From 8743faf04b1fd94c34dc0ae4810b1a1caa603512 Mon Sep 17 00:00:00 2001 From: support Date: Wed, 6 Apr 2022 09:07:56 +0000 Subject: [PATCH] Built motion from commit d766f235.|2.6.7 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1195 files changed, 1195 insertions(+), 1195 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index cf0952f..7dd8ebf 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-05T15:37:12.207Z", + "time": "2022-04-06T08:59:26.974Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 3539f5e..da8251f 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-05T15:37:12.207Z", + "time": "2022-04-06T08:59:26.974Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 5cd4707..cff07a0 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 _0x5fde=['browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','contactManager','integration','motionbar','jscripty'];(function(_0x3d99b3,_0x2ccc68){var _0x4364cd=function(_0x49b735){while(--_0x49b735){_0x3d99b3['push'](_0x3d99b3['shift']());}};_0x4364cd(++_0x2ccc68);}(_0x5fde,0x80));var _0xe5fd=function(_0x187272,_0xfcd3e7){_0x187272=_0x187272-0x0;var _0x3e10ae=_0x5fde[_0x187272];return _0x3e10ae;};'use strict';var Sequelize=require(_0xe5fd('0x0'));module[_0xe5fd('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2e93a7){return this[_0xe5fd('0x2')](_0xe5fd('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xe5fd('0x4'),_0xe5fd('0x5'),_0xe5fd('0x6'),_0xe5fd('0x7'),'urlForward',_0xe5fd('0x8'),'bot',_0xe5fd('0x9')]],'msg':_0xe5fd('0xa')}},'comment':_0xe5fd('0xa')},'data1':{'type':Sequelize[_0xe5fd('0xb')](0x1000),'comment':_0xe5fd('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xe5fd('0xb')](0x1000),'comment':_0xe5fd('0xd')},'data4':{'type':Sequelize[_0xe5fd('0xb')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0xe5fd('0xe')},'data7':{'type':Sequelize[_0xe5fd('0xf')],'comments':_0xe5fd('0x10')}}; \ No newline at end of file +var _0xa603=['urlForward[headers],\x20browser[wsindowHeight]','sequelize','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x48e6c1,_0x2c5211){var _0x1521e2=function(_0x27e789){while(--_0x27e789){_0x48e6c1['push'](_0x48e6c1['shift']());}};_0x1521e2(++_0x2c5211);}(_0xa603,0x7f));var _0x3a60=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa603[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x3a60('0x0'));module['exports']={'name':{'type':Sequelize[_0x3a60('0x1')],'get':function(_0x1e46e2){return this[_0x3a60('0x2')](_0x3a60('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3a60('0x4'),_0x3a60('0x5'),'motionbar',_0x3a60('0x6'),_0x3a60('0x7'),_0x3a60('0x8'),_0x3a60('0x9'),'script']],'msg':_0x3a60('0xa')}},'comment':_0x3a60('0xa')},'data1':{'type':Sequelize[_0x3a60('0xb')](0x1000),'comment':_0x3a60('0xc')},'data2':{'type':Sequelize[_0x3a60('0xb')](0x1000),'comment':_0x3a60('0xd')},'data3':{'type':Sequelize[_0x3a60('0xb')](0x1000),'comment':_0x3a60('0xe')},'data4':{'type':Sequelize[_0x3a60('0xb')](0x1000),'comments':_0x3a60('0xf')},'data5':{'type':Sequelize[_0x3a60('0xb')](0x1000),'comments':_0x3a60('0x10')},'data6':{'type':Sequelize[_0x3a60('0xb')],'comments':_0x3a60('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index a07a9fe..8a0c46e 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 _0x960b=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','send','body','Action','params','catch','destroy','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1b0165,_0x33a8c0){var _0x80ea5c=function(_0x1db9c1){while(--_0x1db9c1){_0x1b0165['push'](_0x1b0165['shift']());}};_0x80ea5c(++_0x33a8c0);}(_0x960b,0x148));var _0xb960=function(_0x31ee41,_0x9afe9c){_0x31ee41=_0x31ee41-0x0;var _0x586f81=_0x960b[_0x31ee41];return _0x586f81;};'use strict';var emlformat=require(_0xb960('0x0'));var rimraf=require(_0xb960('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb960('0x2'));var rp=require(_0xb960('0x3'));var moment=require(_0xb960('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb960('0x5'));var util=require('util');var path=require(_0xb960('0x6'));var sox=require('sox');var csv=require(_0xb960('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb960('0x8'));var _=require('lodash');var squel=require(_0xb960('0x9'));var crypto=require('crypto');var jsforce=require(_0xb960('0xa'));var deskjs=require(_0xb960('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb960('0xc'));var Papa=require('papaparse');var Redis=require(_0xb960('0xd'));var authService=require(_0xb960('0xe'));var qs=require(_0xb960('0xf'));var as=require(_0xb960('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb960('0x11'))(_0xb960('0x12'));var utils=require(_0xb960('0x13'));var config=require(_0xb960('0x14'));var licenseUtil=require(_0xb960('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43de80,_0x3075a0){_0x3075a0=_0x3075a0||0xcc;return function(_0x795385){if(_0x795385){return _0x43de80['sendStatus'](_0x3075a0);}return _0x43de80[_0xb960('0x16')](_0x3075a0)['end']();};}function respondWithResult(_0x576c4d,_0x43fd86){_0x43fd86=_0x43fd86||0xc8;return function(_0x3dd027){if(_0x3dd027){return _0x576c4d[_0xb960('0x16')](_0x43fd86)['json'](_0x3dd027);}};}function respondWithFilteredResult(_0x5a7e7d,_0x2920af){return function(_0x1a637f){if(_0x1a637f){var _0x37abf9=typeof _0x2920af[_0xb960('0x17')]==='undefined'&&typeof _0x2920af[_0xb960('0x18')]==='undefined';var _0x29b1f3=_0x1a637f['count'];var _0x3fbe88=_0x37abf9?0x0:_0x2920af['offset'];var _0x52147b=_0x37abf9?_0x1a637f['count']:_0x2920af['offset']+_0x2920af[_0xb960('0x18')];var _0x5d5ea5;if(_0x52147b>=_0x29b1f3){_0x52147b=_0x29b1f3;_0x5d5ea5=0xc8;}else{_0x5d5ea5=0xce;}_0x5a7e7d[_0xb960('0x16')](_0x5d5ea5);return _0x5a7e7d[_0xb960('0x19')](_0xb960('0x1a'),_0x3fbe88+'-'+_0x52147b+'/'+_0x29b1f3)[_0xb960('0x1b')](_0x1a637f);}return null;};}function patchUpdates(_0x23d205){return function(_0x564e88){try{jsonpatch[_0xb960('0x1c')](_0x564e88,_0x23d205,!![]);}catch(_0x32e30e){return BPromise[_0xb960('0x1d')](_0x32e30e);}return _0x564e88[_0xb960('0x1e')]();};}function saveUpdates(_0xee2eac,_0x5c1c9b){return function(_0xa19a9b){if(_0xa19a9b){return _0xa19a9b[_0xb960('0x1f')](_0xee2eac)[_0xb960('0x20')](function(_0x11be02){return _0x11be02;});}return null;};}function removeEntity(_0x21077d,_0x56ebed){return function(_0x5f3a66){if(_0x5f3a66){return _0x5f3a66['destroy']()[_0xb960('0x20')](function(){_0x21077d[_0xb960('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2000f0,_0x4268d6){return function(_0x247d0f){if(!_0x247d0f){_0x2000f0[_0xb960('0x21')](0x194);}return _0x247d0f;};}function handleError(_0x1d47bb,_0x4b234a){_0x4b234a=_0x4b234a||0x1f4;return function(_0x1358b4){logger[_0xb960('0x22')](_0x1358b4['stack']);if(_0x1358b4[_0xb960('0x23')]){delete _0x1358b4[_0xb960('0x23')];}_0x1d47bb['status'](_0x4b234a)[_0xb960('0x24')](_0x1358b4);};}exports[_0xb960('0x1f')]=function(_0x22e535,_0x3cb863){if(_0x22e535[_0xb960('0x25')]['id']){delete _0x22e535[_0xb960('0x25')]['id'];}return db[_0xb960('0x26')]['find']({'where':{'id':_0x22e535[_0xb960('0x27')]['id']}})[_0xb960('0x20')](handleEntityNotFound(_0x3cb863,null))[_0xb960('0x20')](saveUpdates(_0x22e535[_0xb960('0x25')],null))[_0xb960('0x20')](respondWithResult(_0x3cb863,null))[_0xb960('0x28')](handleError(_0x3cb863,null));};exports[_0xb960('0x29')]=function(_0x241c91,_0x36442e){return db['Action'][_0xb960('0x2a')]({'where':{'id':_0x241c91[_0xb960('0x27')]['id']}})[_0xb960('0x20')](handleEntityNotFound(_0x36442e,null))[_0xb960('0x20')](removeEntity(_0x36442e,null))['catch'](handleError(_0x36442e,null));}; \ No newline at end of file +var _0x546e=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','error','stack','update','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x30a25c,_0xd74c95){var _0x3b0562=function(_0x4cc4cb){while(--_0x4cc4cb){_0x30a25c['push'](_0x30a25c['shift']());}};_0x3b0562(++_0xd74c95);}(_0x546e,0x1d3));var _0xe546=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x546e[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0xe546('0x0'));var rimraf=require(_0xe546('0x1'));var zipdir=require(_0xe546('0x2'));var jsonpatch=require(_0xe546('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe546('0x4'));var Mustache=require(_0xe546('0x5'));var util=require(_0xe546('0x6'));var path=require(_0xe546('0x7'));var sox=require(_0xe546('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe546('0x9'));var _=require('lodash');var squel=require(_0xe546('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe546('0xb'));var toCsv=require(_0xe546('0xc'));var querystring=require(_0xe546('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe546('0xe'));var qs=require(_0xe546('0xf'));var as=require(_0xe546('0x10'));var hardwareService=require(_0xe546('0x11'));var logger=require(_0xe546('0x12'))(_0xe546('0x13'));var utils=require(_0xe546('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe546('0x15'));var db=require(_0xe546('0x16'))['db'];function respondWithStatusCode(_0x11a6d3,_0x1f3790){_0x1f3790=_0x1f3790||0xcc;return function(_0x1d0eb5){if(_0x1d0eb5){return _0x11a6d3[_0xe546('0x17')](_0x1f3790);}return _0x11a6d3[_0xe546('0x18')](_0x1f3790)[_0xe546('0x19')]();};}function respondWithResult(_0x55239b,_0x1016f7){_0x1016f7=_0x1016f7||0xc8;return function(_0x46964b){if(_0x46964b){return _0x55239b['status'](_0x1016f7)[_0xe546('0x1a')](_0x46964b);}};}function respondWithFilteredResult(_0x4b3986,_0xf29d58){return function(_0x38ba72){if(_0x38ba72){var _0x184d46=typeof _0xf29d58['offset']===_0xe546('0x1b')&&typeof _0xf29d58[_0xe546('0x1c')]===_0xe546('0x1b');var _0x17d56f=_0x38ba72[_0xe546('0x1d')];var _0x5a0fcd=_0x184d46?0x0:_0xf29d58[_0xe546('0x1e')];var _0x26d6f7=_0x184d46?_0x38ba72[_0xe546('0x1d')]:_0xf29d58['offset']+_0xf29d58[_0xe546('0x1c')];var _0x228783;if(_0x26d6f7>=_0x17d56f){_0x26d6f7=_0x17d56f;_0x228783=0xc8;}else{_0x228783=0xce;}_0x4b3986[_0xe546('0x18')](_0x228783);return _0x4b3986[_0xe546('0x1f')](_0xe546('0x20'),_0x5a0fcd+'-'+_0x26d6f7+'/'+_0x17d56f)[_0xe546('0x1a')](_0x38ba72);}return null;};}function patchUpdates(_0x1d60bd){return function(_0x346ed5){try{jsonpatch[_0xe546('0x21')](_0x346ed5,_0x1d60bd,!![]);}catch(_0x58e40e){return BPromise[_0xe546('0x22')](_0x58e40e);}return _0x346ed5['save']();};}function saveUpdates(_0x4c853d,_0x3f9dd5){return function(_0x2ecaf3){if(_0x2ecaf3){return _0x2ecaf3['update'](_0x4c853d)[_0xe546('0x23')](function(_0x1ecd71){return _0x1ecd71;});}return null;};}function removeEntity(_0x400466,_0x1947cc){return function(_0x39b893){if(_0x39b893){return _0x39b893['destroy']()[_0xe546('0x23')](function(){_0x400466['status'](0xcc)[_0xe546('0x19')]();});}};}function handleEntityNotFound(_0x4c1b6f,_0x5634d6){return function(_0x24eba0){if(!_0x24eba0){_0x4c1b6f[_0xe546('0x17')](0x194);}return _0x24eba0;};}function handleError(_0x3cd38c,_0x1f0788){_0x1f0788=_0x1f0788||0x1f4;return function(_0x23be0d){logger[_0xe546('0x24')](_0x23be0d[_0xe546('0x25')]);if(_0x23be0d['name']){delete _0x23be0d['name'];}_0x3cd38c[_0xe546('0x18')](_0x1f0788)['send'](_0x23be0d);};}exports[_0xe546('0x26')]=function(_0x39f3cd,_0x431395){if(_0x39f3cd[_0xe546('0x27')]['id']){delete _0x39f3cd[_0xe546('0x27')]['id'];}return db[_0xe546('0x28')][_0xe546('0x29')]({'where':{'id':_0x39f3cd['params']['id']}})[_0xe546('0x23')](handleEntityNotFound(_0x431395,null))['then'](saveUpdates(_0x39f3cd['body'],null))[_0xe546('0x23')](respondWithResult(_0x431395,null))[_0xe546('0x2a')](handleError(_0x431395,null));};exports['destroy']=function(_0x3bdfa4,_0x3a160a){return db[_0xe546('0x28')][_0xe546('0x29')]({'where':{'id':_0x3bdfa4[_0xe546('0x2b')]['id']}})[_0xe546('0x23')](handleEntityNotFound(_0x3a160a,null))[_0xe546('0x23')](removeEntity(_0x3a160a,null))[_0xe546('0x2a')](handleError(_0x3a160a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 64df959..7229686 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 _0x43c8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','util'];(function(_0x504dd8,_0x1396f2){var _0x54db75=function(_0x29e990){while(--_0x29e990){_0x504dd8['push'](_0x504dd8['shift']());}};_0x54db75(++_0x1396f2);}(_0x43c8,0xaf));var _0x843c=function(_0x20a2f1,_0xca8a2f){_0x20a2f1=_0x20a2f1-0x0;var _0x4d467e=_0x43c8[_0x20a2f1];return _0x4d467e;};'use strict';var _=require('lodash');var util=require(_0x843c('0x0'));var logger=require('../../config/logger')(_0x843c('0x1'));var moment=require(_0x843c('0x2'));var BPromise=require(_0x843c('0x3'));var rp=require(_0x843c('0x4'));var fs=require('fs');var path=require(_0x843c('0x5'));var rimraf=require(_0x843c('0x6'));var config=require(_0x843c('0x7'));var attributes=require('./action.attributes');module[_0x843c('0x8')]=function(_0x3fc72f,_0xc5913e){return _0x3fc72f[_0x843c('0x9')](_0x843c('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85da=['Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./action.attributes','exports','define'];(function(_0x409fd4,_0x121872){var _0x1c1f46=function(_0xbf97c6){while(--_0xbf97c6){_0x409fd4['push'](_0x409fd4['shift']());}};_0x1c1f46(++_0x121872);}(_0x85da,0x1bc));var _0xa85d=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x85da[_0xfbdff6];return _0x4cb9be;};'use strict';var _=require(_0xa85d('0x0'));var util=require(_0xa85d('0x1'));var logger=require(_0xa85d('0x2'))(_0xa85d('0x3'));var moment=require(_0xa85d('0x4'));var BPromise=require(_0xa85d('0x5'));var rp=require(_0xa85d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa85d('0x7'));var config=require('../../config/environment');var attributes=require(_0xa85d('0x8'));module[_0xa85d('0x9')]=function(_0x28860c,_0x75c0e6){return _0x28860c[_0xa85d('0xa')](_0xa85d('0xb'),attributes,{'tableName':_0xa85d('0xc'),'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 bd21e2c..966b76a 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x814b,0x1a2));var _0xb814=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x814b[_0x1ee5be];return _0x177140;};'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')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x429de6,_0x174708){var _0x523760=function(_0x48fe10){while(--_0x48fe10){_0x429de6['push'](_0x429de6['shift']());}};_0x523760(++_0x174708);}(_0x1261,0x144));var _0x1126=function(_0x8fb092,_0x883290){_0x8fb092=_0x8fb092-0x0;var _0xd63883=_0x1261[_0x8fb092];return _0xd63883;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 11eb191..aa40ff0 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 _0x4c78=['./action.controller','put','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x512980,_0x401e50){var _0x571f0a=function(_0x456237){while(--_0x456237){_0x512980['push'](_0x512980['shift']());}};_0x571f0a(++_0x401e50);}(_0x4c78,0x12c));var _0x84c7=function(_0x43c307,_0x57da61){_0x43c307=_0x43c307-0x0;var _0x3a4436=_0x4c78[_0x43c307];return _0x3a4436;};'use strict';var multer=require(_0x84c7('0x0'));var util=require(_0x84c7('0x1'));var path=require('path');var timeout=require(_0x84c7('0x2'));var express=require(_0x84c7('0x3'));var router=express[_0x84c7('0x4')]();var fs_extra=require(_0x84c7('0x5'));var auth=require(_0x84c7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x84c7('0x7'));var controller=require(_0x84c7('0x8'));router[_0x84c7('0x9')](_0x84c7('0xa'),auth[_0x84c7('0xb')](),controller[_0x84c7('0xc')]);router['delete'](_0x84c7('0xa'),auth[_0x84c7('0xb')](),controller['destroy']);module[_0x84c7('0xd')]=router; \ No newline at end of file +var _0x5b61=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','path','express','Router','fs-extra'];(function(_0x191449,_0x38513c){var _0x3ab5d6=function(_0x45a97d){while(--_0x45a97d){_0x191449['push'](_0x191449['shift']());}};_0x3ab5d6(++_0x38513c);}(_0x5b61,0x10d));var _0x15b6=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0x5b61[_0x3ff4a3];return _0x38676f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x15b6('0x0'));var timeout=require('connect-timeout');var express=require(_0x15b6('0x1'));var router=express[_0x15b6('0x2')]();var fs_extra=require(_0x15b6('0x3'));var auth=require(_0x15b6('0x4'));var interaction=require(_0x15b6('0x5'));var config=require(_0x15b6('0x6'));var controller=require(_0x15b6('0x7'));router[_0x15b6('0x8')]('/:id',auth[_0x15b6('0x9')](),controller[_0x15b6('0xa')]);router[_0x15b6('0xb')](_0x15b6('0xc'),auth[_0x15b6('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index fecce42..c90cf22 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 _0xee14=['STRING','TEXT'];(function(_0x175b06,_0x6db086){var _0x4187cb=function(_0x32c590){while(--_0x32c590){_0x175b06['push'](_0x175b06['shift']());}};_0x4187cb(++_0x6db086);}(_0xee14,0x13a));var _0x4ee1=function(_0x463717,_0x31052c){_0x463717=_0x463717-0x0;var _0x1b9c51=_0xee14[_0x463717];return _0x1b9c51;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file +var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x2ee4e2,_0x4fbae4){var _0x438af=function(_0x43b5c1){while(--_0x43b5c1){_0x2ee4e2['push'](_0x2ee4e2['shift']());}};_0x438af(++_0x4fbae4);}(_0xabce,0x103));var _0xeabc=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xabce[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index d1ed36c..af214cd 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 _0x0630=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','map','AnalyticCustomReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','show','keys','find','catch','create','user','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','replace','function','format','groupBy','orderBy','DESC','alias','joins','includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parse','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','IS\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','metric','web','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','child_process','fork','../../components/export/','output','../../files/reports','savename','COUNT(*)','run','runReport','parentKey','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2a5f88,_0x2a76cc){var _0x1cf550=function(_0x287890){while(--_0x287890){_0x2a5f88['push'](_0x2a5f88['shift']());}};_0x1cf550(++_0x2a76cc);}(_0x0630,0x9d));var _0x0063=function(_0x5de9cd,_0x25360a){_0x5de9cd=_0x5de9cd-0x0;var _0x5aeebb=_0x0630[_0x5de9cd];return _0x5aeebb;};'use strict';var emlformat=require(_0x0063('0x0'));var rimraf=require(_0x0063('0x1'));var zipdir=require(_0x0063('0x2'));var jsonpatch=require(_0x0063('0x3'));var rp=require(_0x0063('0x4'));var moment=require(_0x0063('0x5'));var BPromise=require(_0x0063('0x6'));var Mustache=require(_0x0063('0x7'));var util=require(_0x0063('0x8'));var path=require('path');var sox=require(_0x0063('0x9'));var csv=require(_0x0063('0xa'));var ejs=require(_0x0063('0xb'));var fs=require('fs');var fs_extra=require(_0x0063('0xc'));var _=require(_0x0063('0xd'));var squel=require('squel');var crypto=require(_0x0063('0xe'));var jsforce=require(_0x0063('0xf'));var deskjs=require(_0x0063('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0063('0x11'));var Papa=require(_0x0063('0x12'));var Redis=require(_0x0063('0x13'));var authService=require(_0x0063('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0063('0x15'));var logger=require(_0x0063('0x16'))(_0x0063('0x17'));var utils=require('../../config/utils');var config=require(_0x0063('0x18'));var licenseUtil=require(_0x0063('0x19'));var db=require(_0x0063('0x1a'))['db'];var dbH=require('../../mysqldb')[_0x0063('0x1b')];function respondWithStatusCode(_0x1e89e0,_0x6ab57f){_0x6ab57f=_0x6ab57f||0xcc;return function(_0x52c563){if(_0x52c563){return _0x1e89e0[_0x0063('0x1c')](_0x6ab57f);}return _0x1e89e0['status'](_0x6ab57f)[_0x0063('0x1d')]();};}function respondWithResult(_0x15e52d,_0x4ea19b){_0x4ea19b=_0x4ea19b||0xc8;return function(_0x2856ad){if(_0x2856ad){return _0x15e52d['status'](_0x4ea19b)['json'](_0x2856ad);}};}function respondWithFilteredResult(_0x59d1b3,_0x5e7f00){return function(_0x229aab){if(_0x229aab){var _0x135cc4=typeof _0x5e7f00[_0x0063('0x1e')]===_0x0063('0x1f')&&typeof _0x5e7f00[_0x0063('0x20')]==='undefined';var _0x72239b=_0x229aab[_0x0063('0x21')];var _0x495376=_0x135cc4?0x0:_0x5e7f00[_0x0063('0x1e')];var _0x2277c0=_0x135cc4?_0x229aab[_0x0063('0x21')]:_0x5e7f00[_0x0063('0x1e')]+_0x5e7f00[_0x0063('0x20')];var _0x15970b;if(_0x2277c0>=_0x72239b){_0x2277c0=_0x72239b;_0x15970b=0xc8;}else{_0x15970b=0xce;}_0x59d1b3[_0x0063('0x22')](_0x15970b);return _0x59d1b3[_0x0063('0x23')](_0x0063('0x24'),_0x495376+'-'+_0x2277c0+'/'+_0x72239b)[_0x0063('0x25')](_0x229aab);}return null;};}function patchUpdates(_0x5d5e11){return function(_0x18c028){try{jsonpatch[_0x0063('0x26')](_0x18c028,_0x5d5e11,!![]);}catch(_0x9fcaa9){return BPromise[_0x0063('0x27')](_0x9fcaa9);}return _0x18c028['save']();};}function saveUpdates(_0x481d1c,_0xcd8a46){return function(_0x3f0bd4){if(_0x3f0bd4){return _0x3f0bd4[_0x0063('0x28')](_0x481d1c)[_0x0063('0x29')](function(_0x372390){return _0x372390;});}return null;};}function removeEntity(_0x517f9a,_0x19b27e){return function(_0x1c7ab8){if(_0x1c7ab8){return _0x1c7ab8[_0x0063('0x2a')]()[_0x0063('0x29')](function(){var _0x2d108c=_0x1c7ab8['get']({'plain':!![]});var _0x507eaf=_0x0063('0x2b');return db[_0x0063('0x2c')][_0x0063('0x2a')]({'where':{'type':_0x507eaf,'resourceId':_0x2d108c['id']}})[_0x0063('0x29')](function(){return _0x1c7ab8;});})['then'](function(){_0x517f9a['status'](0xcc)[_0x0063('0x1d')]();});}};}function handleEntityNotFound(_0x1a2d51,_0x3a6e69){return function(_0x112372){if(!_0x112372){_0x1a2d51[_0x0063('0x1c')](0x194);}return _0x112372;};}function handleError(_0xe0c5ef,_0x32c92a){_0x32c92a=_0x32c92a||0x1f4;return function(_0x4d006d){logger[_0x0063('0x2d')](_0x4d006d[_0x0063('0x2e')]);if(_0x4d006d[_0x0063('0x2f')]){delete _0x4d006d[_0x0063('0x2f')];}_0xe0c5ef[_0x0063('0x22')](_0x32c92a)['send'](_0x4d006d);};}exports['index']=function(_0x1c268a,_0x40f0dc){var _0x5937bc={},_0x2f9d28={},_0x586a51={'count':0x0,'rows':[]};var _0x5a988d=_[_0x0063('0x30')](db[_0x0063('0x31')]['rawAttributes'],function(_0x310181){return{'name':_0x310181[_0x0063('0x32')],'type':_0x310181[_0x0063('0x33')][_0x0063('0x34')]};});_0x2f9d28[_0x0063('0x35')]=_[_0x0063('0x30')](_0x5a988d,_0x0063('0x2f'));_0x2f9d28[_0x0063('0x36')]=_['keys'](_0x1c268a['query']);_0x2f9d28[_0x0063('0x37')]=_[_0x0063('0x38')](_0x2f9d28[_0x0063('0x35')],_0x2f9d28[_0x0063('0x36')]);_0x5937bc[_0x0063('0x39')]=_['intersection'](_0x2f9d28[_0x0063('0x35')],qs['fields'](_0x1c268a['query'][_0x0063('0x3a')]));_0x5937bc['attributes']=_0x5937bc[_0x0063('0x39')][_0x0063('0x3b')]?_0x5937bc[_0x0063('0x39')]:_0x2f9d28['model'];if(!_0x1c268a[_0x0063('0x36')]['hasOwnProperty'](_0x0063('0x3c'))){_0x5937bc[_0x0063('0x20')]=qs[_0x0063('0x20')](_0x1c268a[_0x0063('0x36')]['limit']);_0x5937bc[_0x0063('0x1e')]=qs[_0x0063('0x1e')](_0x1c268a['query'][_0x0063('0x1e')]);}_0x5937bc[_0x0063('0x3d')]=qs[_0x0063('0x3e')](_0x1c268a[_0x0063('0x36')][_0x0063('0x3e')]);_0x5937bc[_0x0063('0x3f')]=qs[_0x0063('0x37')](_['pick'](_0x1c268a['query'],_0x2f9d28[_0x0063('0x37')]),_0x5a988d);if(_0x1c268a['query'][_0x0063('0x40')]){_0x5937bc[_0x0063('0x3f')]=_[_0x0063('0x41')](_0x5937bc[_0x0063('0x3f')],{'$or':_[_0x0063('0x30')](_0x5a988d,function(_0x49fb71){if(_0x49fb71[_0x0063('0x33')]!=='VIRTUAL'){var _0x217a8a={};_0x217a8a[_0x49fb71[_0x0063('0x2f')]]={'$like':'%'+_0x1c268a[_0x0063('0x36')]['filter']+'%'};return _0x217a8a;}})});}_0x5937bc=_[_0x0063('0x41')]({},_0x5937bc,_0x1c268a[_0x0063('0x42')]);var _0x528a6c={'where':_0x5937bc[_0x0063('0x3f')]};return db[_0x0063('0x31')][_0x0063('0x21')](_0x528a6c)[_0x0063('0x29')](function(_0x15a261){_0x586a51['count']=_0x15a261;if(_0x1c268a[_0x0063('0x36')][_0x0063('0x43')]){_0x5937bc['include']=[{'all':!![]}];}return db[_0x0063('0x31')][_0x0063('0x44')](_0x5937bc);})[_0x0063('0x29')](function(_0x126acf){_0x586a51['rows']=_0x126acf;return _0x586a51;})[_0x0063('0x29')](respondWithFilteredResult(_0x40f0dc,_0x5937bc))['catch'](handleError(_0x40f0dc,null));};exports[_0x0063('0x45')]=function(_0x48de77,_0x636fcb){var _0x4acd61={'raw':![],'where':{'id':_0x48de77['params']['id']}},_0x2136f6={};_0x2136f6[_0x0063('0x35')]=_[_0x0063('0x46')](db[_0x0063('0x31')]['rawAttributes']);_0x2136f6[_0x0063('0x36')]=_['keys'](_0x48de77[_0x0063('0x36')]);_0x2136f6[_0x0063('0x37')]=_['intersection'](_0x2136f6[_0x0063('0x35')],_0x2136f6[_0x0063('0x36')]);_0x4acd61[_0x0063('0x39')]=_['intersection'](_0x2136f6[_0x0063('0x35')],qs[_0x0063('0x3a')](_0x48de77['query']['fields']));_0x4acd61['attributes']=_0x4acd61[_0x0063('0x39')]['length']?_0x4acd61[_0x0063('0x39')]:_0x2136f6[_0x0063('0x35')];if(_0x48de77[_0x0063('0x36')][_0x0063('0x43')]){_0x4acd61['include']=[{'all':!![]}];}_0x4acd61=_[_0x0063('0x41')]({},_0x4acd61,_0x48de77['options']);return db['AnalyticCustomReport'][_0x0063('0x47')](_0x4acd61)[_0x0063('0x29')](handleEntityNotFound(_0x636fcb,null))[_0x0063('0x29')](respondWithResult(_0x636fcb,null))[_0x0063('0x48')](handleError(_0x636fcb,null));};exports[_0x0063('0x49')]=function(_0x50b512,_0x3bfe53){return db[_0x0063('0x31')][_0x0063('0x49')](_0x50b512['body'],{})[_0x0063('0x29')](function(_0x2868a6){var _0x31fc82=_0x50b512[_0x0063('0x4a')]['get']({'plain':!![]});if(!_0x31fc82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31fc82['role']==='user'){var _0x34c051=_0x2868a6[_0x0063('0x4b')]({'plain':!![]});var _0x17acda=_0x0063('0x4c');return db[_0x0063('0x4d')][_0x0063('0x47')]({'where':{'name':_0x17acda,'userProfileId':_0x31fc82[_0x0063('0x4e')]},'raw':!![]})[_0x0063('0x29')](function(_0x3f04bc){if(_0x3f04bc&&_0x3f04bc[_0x0063('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x34c051['name'],'resourceId':_0x34c051['id'],'type':_0x0063('0x2b'),'sectionId':_0x3f04bc['id']},{})['then'](function(){return _0x2868a6;});}else{return _0x2868a6;}})[_0x0063('0x48')](function(_0x590d2a){logger[_0x0063('0x2d')](_0x0063('0x50'),_0x590d2a);throw _0x590d2a;});}return _0x2868a6;})[_0x0063('0x29')](respondWithResult(_0x3bfe53,0xc9))[_0x0063('0x48')](handleError(_0x3bfe53,null));};exports[_0x0063('0x28')]=function(_0xa2213b,_0x4993fa){if(_0xa2213b['body']['id']){delete _0xa2213b[_0x0063('0x51')]['id'];}return db[_0x0063('0x31')][_0x0063('0x47')]({'where':{'id':_0xa2213b[_0x0063('0x52')]['id']}})['then'](handleEntityNotFound(_0x4993fa,null))[_0x0063('0x29')](saveUpdates(_0xa2213b['body'],null))[_0x0063('0x29')](respondWithResult(_0x4993fa,null))['catch'](handleError(_0x4993fa,null));};exports[_0x0063('0x2a')]=function(_0x49fcf1,_0x29827d){return db[_0x0063('0x31')][_0x0063('0x47')]({'where':{'id':_0x49fcf1['params']['id']}})[_0x0063('0x29')](handleEntityNotFound(_0x29827d,null))['then'](removeEntity(_0x29827d,null))[_0x0063('0x48')](handleError(_0x29827d,null));};exports['preview']=function(_0x29e1ff,_0x57d63e){var _0x58fdf8=0xa;var _0x1dfbe1=[_0x0063('0x53'),_0x0063('0x54'),_0x0063('0x55'),_0x0063('0x56')];var _0x227a20={'SUM':_0x0063('0x57'),'COUNT':_0x0063('0x58'),'COUNT DISTINCT':_0x0063('0x59'),'MAX':_0x0063('0x5a'),'MIN':_0x0063('0x5b'),'AVG':_0x0063('0x5c'),'GROUP_CONCAT':_0x0063('0x5d'),'GROUP_CONCAT ASC':_0x0063('0x5e'),'GROUP_CONCAT DESC':_0x0063('0x5f')};var _0x4dccee={'SEC_TO_TIME':_0x0063('0x60'),'DATE':_0x0063('0x61'),'HOUR':_0x0063('0x62'),'ROUND':_0x0063('0x63'),'UNIX_TIMESTAMP':_0x0063('0x64')};var _0x303e8a=function(_0x131de1){return!_['includes'](['IS\x20NULL',_0x0063('0x65'),_0x0063('0x66'),'IS\x20NOT\x20EMPTY'],_0x131de1);};var _0x186ca6=function(_0x17e0c0){if(!_0x17e0c0||!_0x17e0c0['rules'][_0x0063('0x3b')]){return'';}for(var _0x438289='(',_0x4d19b8=0x0;_0x4d19b8<_0x17e0c0[_0x0063('0x67')][_0x0063('0x3b')];_0x4d19b8+=0x1){_0x4d19b8>0x0&&(_0x438289+='\x20'+_0x17e0c0[_0x0063('0x68')]+'\x20');_0x438289+=_0x17e0c0[_0x0063('0x67')][_0x4d19b8][_0x0063('0x69')]?_0x186ca6(_0x17e0c0[_0x0063('0x67')][_0x4d19b8][_0x0063('0x69')]):_0x17e0c0[_0x0063('0x67')][_0x4d19b8][_0x0063('0x6a')]+'\x20'+_0x17e0c0[_0x0063('0x67')][_0x4d19b8][_0x0063('0x6b')]+(_0x303e8a(_0x17e0c0[_0x0063('0x67')][_0x4d19b8]['condition'])?'\x20'+_0x17e0c0[_0x0063('0x67')][_0x4d19b8][_0x0063('0x6c')]:'');}return _0x438289+')';};var _0x3ff090={'where':{'id':_0x29e1ff['params']['id']}},_0x1e0639,_0x3a37e2,_0x56a835,_0x4afd06,_0x330b2b;_0x3ff090=_[_0x0063('0x41')]({},_0x3ff090,_0x29e1ff[_0x0063('0x42')]);return db[_0x0063('0x31')][_0x0063('0x47')](_0x3ff090)[_0x0063('0x29')](function(_0x20245c){if(_0x20245c){_0x1e0639=_0x20245c;return _0x20245c[_0x0063('0x6d')]();}return null;})[_0x0063('0x29')](function(_0x593e9){if(_0x593e9){if(!_0x593e9[_0x0063('0x3b')]){throw new db['Sequelize'][(_0x0063('0x6e'))](_0x0063('0x6f'),0x193);}_0x3a37e2=_0x593e9;return db[_0x0063('0x70')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1ea217){if(_0x1ea217){_0x56a835=_[_0x0063('0x71')](_0x1ea217,'id');var _0x345722;var _0x57436b=squel[_0x0063('0x72')]();_0x57436b[_0x0063('0x73')](_0x1e0639[_0x0063('0x74')]);for(var _0x49086a=0x0;_0x49086a<_0x3a37e2[_0x0063('0x3b')];_0x49086a+=0x1){_0x345722=_0x3a37e2[_0x49086a][_0x0063('0x75')]?_0x56a835[_0x3a37e2[_0x49086a][_0x0063('0x75')]]['metric']:_0x3a37e2[_0x49086a][_0x0063('0x6a')];_0x345722=_0x3a37e2[_0x49086a]['function']?_[_0x0063('0x76')](_0x227a20[_0x3a37e2[_0x49086a][_0x0063('0x77')]],'%s',_0x345722):_0x345722;_0x345722=_0x3a37e2[_0x49086a][_0x0063('0x78')]?_[_0x0063('0x76')](_0x4dccee[_0x3a37e2[_0x49086a][_0x0063('0x78')]],'%s',_0x345722):_0x345722;if(_0x3a37e2[_0x49086a][_0x0063('0x79')]){_0x57436b[_0x0063('0x69')](_0x345722);}_0x3a37e2[_0x49086a][_0x0063('0x7a')]&&_0x57436b[_0x0063('0x3d')](_0x345722,_0x3a37e2[_0x49086a]['orderBy']===_0x0063('0x7b')?![]:!![]);_0x57436b[_0x0063('0x6a')](_0x345722,_0x3a37e2[_0x49086a][_0x0063('0x7c')]||_0x345722);}if(_0x1e0639[_0x0063('0x7d')]){_0x1e0639[_0x0063('0x7d')]=JSON['parse'](_0x1e0639[_0x0063('0x7d')]);for(var _0x10d938=0x0;_0x10d938<_0x1e0639[_0x0063('0x7d')]['length'];_0x10d938+=0x1){if(_0x1e0639[_0x0063('0x7d')][_0x10d938][_0x0063('0x33')]&&_[_0x0063('0x7e')](_0x1dfbe1,_0x1e0639['joins'][_0x10d938][_0x0063('0x33')])&&_0x1e0639[_0x0063('0x7d')][_0x10d938]['parentKey']&&_0x1e0639[_0x0063('0x7d')][_0x10d938][_0x0063('0x7f')]&&_0x1e0639[_0x0063('0x7d')][_0x10d938][_0x0063('0x80')]){_0x57436b[_0x1e0639[_0x0063('0x7d')][_0x10d938][_0x0063('0x33')]](_0x1e0639[_0x0063('0x7d')][_0x10d938][_0x0063('0x7f')],null,util[_0x0063('0x78')](_0x0063('0x81'),_0x1e0639[_0x0063('0x74')],_0x1e0639[_0x0063('0x7d')][_0x10d938]['parentKey'],_0x1e0639[_0x0063('0x7d')][_0x10d938][_0x0063('0x7f')],_0x1e0639[_0x0063('0x7d')][_0x10d938]['foreignKey']));}}}if(_0x1e0639['conditions']){_0x1e0639['conditions']=JSON[_0x0063('0x82')](_0x1e0639['conditions']);_0x57436b[_0x0063('0x3f')](_0x186ca6(_0x1e0639[_0x0063('0x83')]['group']));}_0x330b2b=_0x57436b[_0x0063('0x84')]();_0x57436b['limit'](_0x58fdf8);_0x57436b[_0x0063('0x1e')](0x0);logger[_0x0063('0x85')](_0x0063('0x86'),_0x57436b[_0x0063('0x87')]());return dbH[_0x0063('0x88')][_0x0063('0x36')](_0x57436b[_0x0063('0x87')](),{'type':dbH['sequelize'][_0x0063('0x89')][_0x0063('0x8a')]});}})[_0x0063('0x29')](respondWithResult(_0x57d63e,null))[_0x0063('0x48')](handleError(_0x57d63e,null));};function runReport(_0x201624,_0x3eff94,_0x4bbcf7){var _0x41a18c=_0x3eff94[_0x0063('0x2f')];var _0xafa00e=0xa;var _0x2c1e7b=[_0x0063('0x53'),_0x0063('0x54'),_0x0063('0x55'),'cross_join'];var _0x261216={'SUM':_0x0063('0x57'),'COUNT':_0x0063('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0063('0x5a'),'MIN':'MIN(%s)','AVG':_0x0063('0x5c'),'GROUP_CONCAT':_0x0063('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2c0d9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0063('0x61'),'HOUR':_0x0063('0x62'),'ROUND':_0x0063('0x63'),'UNIX_TIMESTAMP':_0x0063('0x64')};var _0x45fc15=function(_0x5a5955){return!_[_0x0063('0x7e')]([_0x0063('0x8b'),_0x0063('0x65'),'IS\x20EMPTY',_0x0063('0x8c')],_0x5a5955);};var _0x362493=function(_0xaeb564){if(!_0xaeb564||!_0xaeb564[_0x0063('0x67')]['length']){return'';}for(var _0x20e0f8='(',_0x2ef9ef=0x0;_0x2ef9ef<_0xaeb564[_0x0063('0x67')][_0x0063('0x3b')];_0x2ef9ef+=0x1){_0x2ef9ef>0x0&&(_0x20e0f8+='\x20'+_0xaeb564[_0x0063('0x68')]+'\x20');_0x20e0f8+=_0xaeb564['rules'][_0x2ef9ef][_0x0063('0x69')]?_0x362493(_0xaeb564[_0x0063('0x67')][_0x2ef9ef][_0x0063('0x69')]):_0xaeb564[_0x0063('0x67')][_0x2ef9ef]['field']+'\x20'+_0xaeb564[_0x0063('0x67')][_0x2ef9ef][_0x0063('0x6b')]+(_0x45fc15(_0xaeb564[_0x0063('0x67')][_0x2ef9ef][_0x0063('0x6b')])?'\x20'+_0xaeb564['rules'][_0x2ef9ef][_0x0063('0x6c')]:'');}return _0x20e0f8+')';};var _0x40176c={'where':{'id':_0x201624['id']}},_0x1c405b,_0x2b0213,_0x25bf3a,_0x1e3fc5,_0x2ee614;_0x40176c=_[_0x0063('0x41')]({},_0x40176c,_0x4bbcf7);return db[_0x0063('0x31')][_0x0063('0x47')](_0x40176c)[_0x0063('0x29')](function(_0x1bce4b){if(_0x1bce4b){_0x1c405b=_0x1bce4b;return _0x1bce4b[_0x0063('0x6d')]();}return null;})['then'](function(_0x2b5115){if(_0x2b5115){if(!_0x2b5115[_0x0063('0x3b')]){throw new db[(_0x0063('0x8d'))]['ValidationErrorItem'](_0x0063('0x6f'),0x193);}_0x2b0213=_0x2b5115;return db[_0x0063('0x70')][_0x0063('0x44')]({'raw':!![]});}return null;})[_0x0063('0x29')](function(_0x30d829){if(_0x30d829){_0x25bf3a=_['keyBy'](_0x30d829,'id');var _0x365a81;var _0x2068aa=squel[_0x0063('0x72')]();_0x2068aa[_0x0063('0x73')](_0x1c405b[_0x0063('0x74')]);for(var _0x29c86b=0x0;_0x29c86b<_0x2b0213['length'];_0x29c86b+=0x1){_0x365a81=_0x2b0213[_0x29c86b][_0x0063('0x75')]?_0x25bf3a[_0x2b0213[_0x29c86b][_0x0063('0x75')]][_0x0063('0x8e')]:_0x2b0213[_0x29c86b][_0x0063('0x6a')];_0x365a81=_0x2b0213[_0x29c86b]['function']?_[_0x0063('0x76')](_0x261216[_0x2b0213[_0x29c86b][_0x0063('0x77')]],'%s',_0x365a81):_0x365a81;_0x365a81=_0x2b0213[_0x29c86b][_0x0063('0x78')]?_['replace'](_0x2c0d9[_0x2b0213[_0x29c86b][_0x0063('0x78')]],'%s',_0x365a81):_0x365a81;if(_0x2b0213[_0x29c86b][_0x0063('0x79')]){_0x2068aa[_0x0063('0x69')](_0x365a81);}_0x2b0213[_0x29c86b]['orderBy']&&_0x2068aa[_0x0063('0x3d')](_0x365a81,_0x2b0213[_0x29c86b][_0x0063('0x7a')]===_0x0063('0x7b')?![]:!![]);_0x2068aa[_0x0063('0x6a')](_0x365a81,_0x2b0213[_0x29c86b][_0x0063('0x7c')]||_0x365a81);}if(_0x1c405b['joins']){_0x1c405b['joins']=JSON[_0x0063('0x82')](_0x1c405b[_0x0063('0x7d')]);for(var _0x1bf4ce=0x0;_0x1bf4ce<_0x1c405b['joins'][_0x0063('0x3b')];_0x1bf4ce+=0x1){if(_0x1c405b[_0x0063('0x7d')][_0x1bf4ce][_0x0063('0x33')]&&_[_0x0063('0x7e')](_0x2c1e7b,_0x1c405b[_0x0063('0x7d')][_0x1bf4ce][_0x0063('0x33')])&&_0x1c405b['joins'][_0x1bf4ce]['parentKey']&&_0x1c405b[_0x0063('0x7d')][_0x1bf4ce][_0x0063('0x7f')]&&_0x1c405b[_0x0063('0x7d')][_0x1bf4ce]['foreignKey']){_0x2068aa[_0x1c405b[_0x0063('0x7d')][_0x1bf4ce][_0x0063('0x33')]](_0x1c405b[_0x0063('0x7d')][_0x1bf4ce][_0x0063('0x7f')],null,util[_0x0063('0x78')](_0x0063('0x81'),_0x1c405b[_0x0063('0x74')],_0x1c405b['joins'][_0x1bf4ce]['parentKey'],_0x1c405b[_0x0063('0x7d')][_0x1bf4ce][_0x0063('0x7f')],_0x1c405b[_0x0063('0x7d')][_0x1bf4ce][_0x0063('0x80')]));}}}if(_0x1c405b[_0x0063('0x83')]){_0x1c405b[_0x0063('0x83')]=JSON[_0x0063('0x82')](_0x1c405b[_0x0063('0x83')]);_0x2068aa[_0x0063('0x3f')](_0x362493(_0x1c405b['conditions']['group']));}_0x2ee614=_0x2068aa[_0x0063('0x84')]();_0x2068aa[_0x0063('0x20')](_0xafa00e);_0x2068aa[_0x0063('0x1e')](0x0);return;}})[_0x0063('0x29')](function(){if(_0x3eff94['output']===_0x0063('0x8f')){return null;}var _0x4688b9=_[_0x0063('0x41')](_0x3eff94,{'name':_0x3eff94[_0x0063('0x90')]||_0x3eff94[_0x0063('0x2f')]||_0x1c405b[_0x0063('0x2f')],'basename':_0x41a18c,'savename':util[_0x0063('0x78')](_0x0063('0x91'),_0x3eff94['name']||_0x1c405b[_0x0063('0x2f')],require(_0x0063('0x92'))['generate'](0x4),_0x3eff94['output']||'csv'),'reportId':_0x1c405b['id'],'reportType':_0x0063('0x93')});return db[_0x0063('0x94')][_0x0063('0x49')](_0x4688b9,{'raw':!![]});})[_0x0063('0x29')](function(_0x3df839){if(_0x1c405b[_0x0063('0x74')]===_0x0063('0x95')){_0x2ee614[_0x0063('0x3f')](_0x1c405b[_0x0063('0x74')]+_0x0063('0x96'),_0x3eff94[_0x0063('0x97')],_0x3eff94['endDate']);}else{_0x2ee614[_0x0063('0x3f')](_0x1c405b[_0x0063('0x74')]+_0x0063('0x98'),_0x3eff94['startDate'],_0x3eff94[_0x0063('0x99')]);}if(_0x3df839){logger['info']('Run\x20Query:',_0x2ee614[_0x0063('0x87')]());require(_0x0063('0x9a'))[_0x0063('0x9b')](path[_0x0063('0x53')](__dirname,_0x0063('0x9c'),_0x3df839[_0x0063('0x9d')]),[_0x3df839['id'],_0x2ee614['toString'](),path[_0x0063('0x53')](__dirname,_0x0063('0x9e'),_0x3df839[_0x0063('0x9f')]),_0x41a18c]);return _0x3df839;}else{var _0x38fb6a=squel[_0x0063('0x72')]();_0x38fb6a['from']('('+_0x2ee614[_0x0063('0x87')]()+')','countTable');_0x38fb6a[_0x0063('0x6a')](_0x0063('0xa0'),_0x0063('0x21'));_0x2ee614['limit'](_0x3eff94[_0x0063('0x20')]||_0xafa00e);_0x2ee614['offset'](_0x3eff94[_0x0063('0x1e')]||0x0);return dbH['sequelize'][_0x0063('0x36')](_0x38fb6a[_0x0063('0x87')](),{'type':dbH[_0x0063('0x88')][_0x0063('0x89')]['SELECT']})[_0x0063('0x29')](function(_0xf4f990){if(!_0xf4f990[_0x0063('0x3b')]){_0x1e3fc5=0x0;}else{_0x1e3fc5=_0xf4f990[0x0][_0x0063('0x21')]||0x0;}return dbH[_0x0063('0x88')][_0x0063('0x36')](_0x2ee614[_0x0063('0x87')](),{'type':dbH[_0x0063('0x88')][_0x0063('0x89')][_0x0063('0x8a')]});})['then'](function(_0x353a09){return{'rows':_0x353a09||[],'count':_0x1e3fc5};});}});}exports[_0x0063('0xa1')]=function(_0x1cb681,_0x51a6c0){return runReport(_0x1cb681['params'],_0x1cb681['query'],_0x1cb681[_0x0063('0x42')])[_0x0063('0x29')](respondWithResult(_0x51a6c0,null))[_0x0063('0x48')](handleError(_0x51a6c0,null));};exports[_0x0063('0xa2')]=runReport;exports['query']=function(_0x34e67c,_0x2dc93f){var _0x23ff0c=0xa;var _0x2c9e37=['join',_0x0063('0x54'),_0x0063('0x55'),'cross_join'];var _0x317906={'SUM':'SUM(%s)','COUNT':_0x0063('0x58'),'COUNT DISTINCT':_0x0063('0x59'),'MAX':'MAX(%s)','MIN':_0x0063('0x5b'),'AVG':_0x0063('0x5c'),'GROUP_CONCAT':_0x0063('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0063('0x5f')};var _0x290c53={'SEC_TO_TIME':_0x0063('0x60'),'DATE':_0x0063('0x61'),'HOUR':_0x0063('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0063('0x64')};var _0x54b893=function(_0x8f9ba0){return!_[_0x0063('0x7e')]([_0x0063('0x8b'),_0x0063('0x65'),_0x0063('0x66'),_0x0063('0x8c')],_0x8f9ba0);};var _0x1e4385=function(_0x50da8c){if(!_0x50da8c||!_0x50da8c[_0x0063('0x67')][_0x0063('0x3b')]){return'';}for(var _0x36c5be='(',_0x97d07a=0x0;_0x97d07a<_0x50da8c[_0x0063('0x67')][_0x0063('0x3b')];_0x97d07a+=0x1){_0x97d07a>0x0&&(_0x36c5be+='\x20'+_0x50da8c[_0x0063('0x68')]+'\x20');_0x36c5be+=_0x50da8c[_0x0063('0x67')][_0x97d07a]['group']?_0x1e4385(_0x50da8c[_0x0063('0x67')][_0x97d07a][_0x0063('0x69')]):_0x50da8c[_0x0063('0x67')][_0x97d07a][_0x0063('0x6a')]+'\x20'+_0x50da8c[_0x0063('0x67')][_0x97d07a][_0x0063('0x6b')]+(_0x54b893(_0x50da8c[_0x0063('0x67')][_0x97d07a]['condition'])?'\x20'+_0x50da8c['rules'][_0x97d07a][_0x0063('0x6c')]:'');}return _0x36c5be+')';};var _0x46ded4={'where':{'id':_0x34e67c[_0x0063('0x52')]['id']}},_0xb7f5ea,_0x42cf4f,_0x2d57db,_0xde288a,_0x19c81b;_0x46ded4=_['merge']({},_0x46ded4,_0x34e67c[_0x0063('0x42')]);return db[_0x0063('0x31')]['find'](_0x46ded4)[_0x0063('0x29')](function(_0x54b743){if(_0x54b743){_0xb7f5ea=_0x54b743;return _0x54b743[_0x0063('0x6d')]();}return null;})[_0x0063('0x29')](function(_0x58a0d6){if(_0x58a0d6){if(!_0x58a0d6[_0x0063('0x3b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0063('0x6f'),0x193);}_0x42cf4f=_0x58a0d6;return db[_0x0063('0x70')][_0x0063('0x44')]({'raw':!![]});}return null;})[_0x0063('0x29')](function(_0xacc9e9){if(_0xacc9e9){_0x2d57db=_[_0x0063('0x71')](_0xacc9e9,'id');var _0x310086;var _0x26da36=squel[_0x0063('0x72')]();_0x26da36[_0x0063('0x73')](_0xb7f5ea[_0x0063('0x74')]);for(var _0x3574f4=0x0;_0x3574f4<_0x42cf4f['length'];_0x3574f4+=0x1){_0x310086=_0x42cf4f[_0x3574f4]['MetricId']?_0x2d57db[_0x42cf4f[_0x3574f4][_0x0063('0x75')]][_0x0063('0x8e')]:_0x42cf4f[_0x3574f4][_0x0063('0x6a')];_0x310086=_0x42cf4f[_0x3574f4][_0x0063('0x77')]?_[_0x0063('0x76')](_0x317906[_0x42cf4f[_0x3574f4][_0x0063('0x77')]],'%s',_0x310086):_0x310086;_0x310086=_0x42cf4f[_0x3574f4]['format']?_[_0x0063('0x76')](_0x290c53[_0x42cf4f[_0x3574f4][_0x0063('0x78')]],'%s',_0x310086):_0x310086;if(_0x42cf4f[_0x3574f4][_0x0063('0x79')]){_0x26da36[_0x0063('0x69')](_0x310086);}_0x42cf4f[_0x3574f4][_0x0063('0x7a')]&&_0x26da36[_0x0063('0x3d')](_0x310086,_0x42cf4f[_0x3574f4][_0x0063('0x7a')]===_0x0063('0x7b')?![]:!![]);_0x26da36[_0x0063('0x6a')](_0x310086,_0x42cf4f[_0x3574f4][_0x0063('0x7c')]||_0x310086);}if(_0xb7f5ea[_0x0063('0x7d')]){_0xb7f5ea[_0x0063('0x7d')]=JSON[_0x0063('0x82')](_0xb7f5ea['joins']);for(var _0x2814ed=0x0;_0x2814ed<_0xb7f5ea['joins'][_0x0063('0x3b')];_0x2814ed+=0x1){if(_0xb7f5ea[_0x0063('0x7d')][_0x2814ed][_0x0063('0x33')]&&_[_0x0063('0x7e')](_0x2c9e37,_0xb7f5ea[_0x0063('0x7d')][_0x2814ed][_0x0063('0x33')])&&_0xb7f5ea[_0x0063('0x7d')][_0x2814ed]['parentKey']&&_0xb7f5ea[_0x0063('0x7d')][_0x2814ed][_0x0063('0x7f')]&&_0xb7f5ea[_0x0063('0x7d')][_0x2814ed]['foreignKey']){_0x26da36[_0xb7f5ea[_0x0063('0x7d')][_0x2814ed][_0x0063('0x33')]](_0xb7f5ea[_0x0063('0x7d')][_0x2814ed][_0x0063('0x7f')],null,util[_0x0063('0x78')](_0x0063('0x81'),_0xb7f5ea[_0x0063('0x74')],_0xb7f5ea[_0x0063('0x7d')][_0x2814ed][_0x0063('0xa3')],_0xb7f5ea[_0x0063('0x7d')][_0x2814ed][_0x0063('0x7f')],_0xb7f5ea['joins'][_0x2814ed][_0x0063('0x80')]));}}}if(_0xb7f5ea[_0x0063('0x83')]){_0xb7f5ea[_0x0063('0x83')]=JSON[_0x0063('0x82')](_0xb7f5ea['conditions']);_0x26da36['where'](_0x1e4385(_0xb7f5ea[_0x0063('0x83')][_0x0063('0x69')]));}_0x19c81b=_0x26da36['clone']();_0x26da36[_0x0063('0x20')](_0x23ff0c);_0x26da36[_0x0063('0x1e')](0x0);logger[_0x0063('0x85')]('Limited\x20Query:',_0x26da36['toString']());return dbH[_0x0063('0x88')][_0x0063('0x36')](_0x26da36[_0x0063('0x87')](),{'type':dbH[_0x0063('0x88')]['QueryTypes']['SELECT']});}})[_0x0063('0x29')](function(){return{'sql':_0x19c81b['toString']()};})[_0x0063('0x29')](respondWithResult(_0x2dc93f,null))[_0x0063('0x48')](handleError(_0x2dc93f,null));}; \ No newline at end of file +var _0x39b8=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','rows','catch','show','keys','include','find','create','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','from','table','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','IS\x20EMPTY','operator','Sequelize','keyBy','MetricId','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x4a7d7c,_0x185b74){var _0x11d2b4=function(_0x4f8a24){while(--_0x4f8a24){_0x4a7d7c['push'](_0x4a7d7c['shift']());}};_0x11d2b4(++_0x185b74);}(_0x39b8,0xa0));var _0x839b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x39b8[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x839b('0x0'));var rimraf=require(_0x839b('0x1'));var zipdir=require(_0x839b('0x2'));var jsonpatch=require(_0x839b('0x3'));var rp=require('request-promise');var moment=require(_0x839b('0x4'));var BPromise=require(_0x839b('0x5'));var Mustache=require('mustache');var util=require(_0x839b('0x6'));var path=require(_0x839b('0x7'));var sox=require(_0x839b('0x8'));var csv=require(_0x839b('0x9'));var ejs=require(_0x839b('0xa'));var fs=require('fs');var fs_extra=require(_0x839b('0xb'));var _=require(_0x839b('0xc'));var squel=require(_0x839b('0xd'));var crypto=require(_0x839b('0xe'));var jsforce=require(_0x839b('0xf'));var deskjs=require(_0x839b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x839b('0x11'));var Papa=require(_0x839b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x839b('0x13'));var as=require(_0x839b('0x14'));var hardwareService=require(_0x839b('0x15'));var logger=require(_0x839b('0x16'))(_0x839b('0x17'));var utils=require(_0x839b('0x18'));var config=require(_0x839b('0x19'));var licenseUtil=require(_0x839b('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x839b('0x1b')];function respondWithStatusCode(_0x23c144,_0x1c42c1){_0x1c42c1=_0x1c42c1||0xcc;return function(_0x2cebea){if(_0x2cebea){return _0x23c144[_0x839b('0x1c')](_0x1c42c1);}return _0x23c144[_0x839b('0x1d')](_0x1c42c1)[_0x839b('0x1e')]();};}function respondWithResult(_0x491119,_0x2bdb0c){_0x2bdb0c=_0x2bdb0c||0xc8;return function(_0x5ead47){if(_0x5ead47){return _0x491119[_0x839b('0x1d')](_0x2bdb0c)['json'](_0x5ead47);}};}function respondWithFilteredResult(_0xc26a26,_0x5b7e2c){return function(_0x2fca1c){if(_0x2fca1c){var _0x3204d=typeof _0x5b7e2c[_0x839b('0x1f')]==='undefined'&&typeof _0x5b7e2c[_0x839b('0x20')]===_0x839b('0x21');var _0x512720=_0x2fca1c[_0x839b('0x22')];var _0x189d3c=_0x3204d?0x0:_0x5b7e2c[_0x839b('0x1f')];var _0x1fac80=_0x3204d?_0x2fca1c[_0x839b('0x22')]:_0x5b7e2c[_0x839b('0x1f')]+_0x5b7e2c[_0x839b('0x20')];var _0x3fe179;if(_0x1fac80>=_0x512720){_0x1fac80=_0x512720;_0x3fe179=0xc8;}else{_0x3fe179=0xce;}_0xc26a26['status'](_0x3fe179);return _0xc26a26['set'](_0x839b('0x23'),_0x189d3c+'-'+_0x1fac80+'/'+_0x512720)[_0x839b('0x24')](_0x2fca1c);}return null;};}function patchUpdates(_0x44f413){return function(_0x545578){try{jsonpatch[_0x839b('0x25')](_0x545578,_0x44f413,!![]);}catch(_0x3cd113){return BPromise['reject'](_0x3cd113);}return _0x545578[_0x839b('0x26')]();};}function saveUpdates(_0x34511a,_0x51ffeb){return function(_0x388a35){if(_0x388a35){return _0x388a35[_0x839b('0x27')](_0x34511a)[_0x839b('0x28')](function(_0x4b2618){return _0x4b2618;});}return null;};}function removeEntity(_0x2c631d,_0x1848db){return function(_0x1a5fb8){if(_0x1a5fb8){return _0x1a5fb8[_0x839b('0x29')]()[_0x839b('0x28')](function(){var _0x5a981f=_0x1a5fb8[_0x839b('0x2a')]({'plain':!![]});var _0x5a3797=_0x839b('0x2b');return db[_0x839b('0x2c')][_0x839b('0x29')]({'where':{'type':_0x5a3797,'resourceId':_0x5a981f['id']}})[_0x839b('0x28')](function(){return _0x1a5fb8;});})[_0x839b('0x28')](function(){_0x2c631d[_0x839b('0x1d')](0xcc)[_0x839b('0x1e')]();});}};}function handleEntityNotFound(_0x4cc217,_0x1c641b){return function(_0x4a66a8){if(!_0x4a66a8){_0x4cc217['sendStatus'](0x194);}return _0x4a66a8;};}function handleError(_0x3e6da1,_0x207caf){_0x207caf=_0x207caf||0x1f4;return function(_0x3223ee){logger['error'](_0x3223ee[_0x839b('0x2d')]);if(_0x3223ee[_0x839b('0x2e')]){delete _0x3223ee[_0x839b('0x2e')];}_0x3e6da1['status'](_0x207caf)[_0x839b('0x2f')](_0x3223ee);};}exports[_0x839b('0x30')]=function(_0x2b9866,_0x355508){var _0x1c4402={},_0x1719f3={},_0x5a413c={'count':0x0,'rows':[]};var _0x5579bc=_['map'](db['AnalyticCustomReport'][_0x839b('0x31')],function(_0x395d2e){return{'name':_0x395d2e[_0x839b('0x32')],'type':_0x395d2e[_0x839b('0x33')]['key']};});_0x1719f3[_0x839b('0x34')]=_[_0x839b('0x35')](_0x5579bc,_0x839b('0x2e'));_0x1719f3[_0x839b('0x36')]=_['keys'](_0x2b9866[_0x839b('0x36')]);_0x1719f3['filters']=_[_0x839b('0x37')](_0x1719f3[_0x839b('0x34')],_0x1719f3['query']);_0x1c4402['attributes']=_[_0x839b('0x37')](_0x1719f3[_0x839b('0x34')],qs[_0x839b('0x38')](_0x2b9866[_0x839b('0x36')][_0x839b('0x38')]));_0x1c4402['attributes']=_0x1c4402[_0x839b('0x39')][_0x839b('0x3a')]?_0x1c4402[_0x839b('0x39')]:_0x1719f3['model'];if(!_0x2b9866['query'][_0x839b('0x3b')](_0x839b('0x3c'))){_0x1c4402[_0x839b('0x20')]=qs[_0x839b('0x20')](_0x2b9866[_0x839b('0x36')][_0x839b('0x20')]);_0x1c4402[_0x839b('0x1f')]=qs[_0x839b('0x1f')](_0x2b9866[_0x839b('0x36')][_0x839b('0x1f')]);}_0x1c4402[_0x839b('0x3d')]=qs[_0x839b('0x3e')](_0x2b9866[_0x839b('0x36')][_0x839b('0x3e')]);_0x1c4402[_0x839b('0x3f')]=qs[_0x839b('0x40')](_[_0x839b('0x41')](_0x2b9866[_0x839b('0x36')],_0x1719f3['filters']),_0x5579bc);if(_0x2b9866[_0x839b('0x36')][_0x839b('0x42')]){_0x1c4402['where']=_[_0x839b('0x43')](_0x1c4402['where'],{'$or':_[_0x839b('0x35')](_0x5579bc,function(_0xab88f5){if(_0xab88f5[_0x839b('0x33')]!==_0x839b('0x44')){var _0x3cb419={};_0x3cb419[_0xab88f5['name']]={'$like':'%'+_0x2b9866['query']['filter']+'%'};return _0x3cb419;}})});}_0x1c4402=_[_0x839b('0x43')]({},_0x1c4402,_0x2b9866[_0x839b('0x45')]);var _0x5e8507={'where':_0x1c4402['where']};return db[_0x839b('0x46')][_0x839b('0x22')](_0x5e8507)[_0x839b('0x28')](function(_0x48a96c){_0x5a413c[_0x839b('0x22')]=_0x48a96c;if(_0x2b9866['query'][_0x839b('0x47')]){_0x1c4402['include']=[{'all':!![]}];}return db[_0x839b('0x46')]['findAll'](_0x1c4402);})[_0x839b('0x28')](function(_0x29c880){_0x5a413c[_0x839b('0x48')]=_0x29c880;return _0x5a413c;})[_0x839b('0x28')](respondWithFilteredResult(_0x355508,_0x1c4402))[_0x839b('0x49')](handleError(_0x355508,null));};exports[_0x839b('0x4a')]=function(_0x14abb3,_0x3c3c37){var _0x4b44e6={'raw':![],'where':{'id':_0x14abb3['params']['id']}},_0x57d732={};_0x57d732[_0x839b('0x34')]=_[_0x839b('0x4b')](db['AnalyticCustomReport'][_0x839b('0x31')]);_0x57d732['query']=_[_0x839b('0x4b')](_0x14abb3['query']);_0x57d732['filters']=_[_0x839b('0x37')](_0x57d732['model'],_0x57d732[_0x839b('0x36')]);_0x4b44e6['attributes']=_[_0x839b('0x37')](_0x57d732[_0x839b('0x34')],qs[_0x839b('0x38')](_0x14abb3['query']['fields']));_0x4b44e6[_0x839b('0x39')]=_0x4b44e6[_0x839b('0x39')]['length']?_0x4b44e6[_0x839b('0x39')]:_0x57d732[_0x839b('0x34')];if(_0x14abb3[_0x839b('0x36')][_0x839b('0x47')]){_0x4b44e6[_0x839b('0x4c')]=[{'all':!![]}];}_0x4b44e6=_[_0x839b('0x43')]({},_0x4b44e6,_0x14abb3[_0x839b('0x45')]);return db[_0x839b('0x46')][_0x839b('0x4d')](_0x4b44e6)[_0x839b('0x28')](handleEntityNotFound(_0x3c3c37,null))['then'](respondWithResult(_0x3c3c37,null))[_0x839b('0x49')](handleError(_0x3c3c37,null));};exports[_0x839b('0x4e')]=function(_0x441312,_0x5e6b9c){return db[_0x839b('0x46')][_0x839b('0x4e')](_0x441312['body'],{})['then'](function(_0x3b1e11){var _0x185813=_0x441312[_0x839b('0x4f')]['get']({'plain':!![]});if(!_0x185813)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x185813[_0x839b('0x50')]===_0x839b('0x4f')){var _0x38742a=_0x3b1e11[_0x839b('0x2a')]({'plain':!![]});var _0x1704c1=_0x839b('0x51');return db[_0x839b('0x52')][_0x839b('0x4d')]({'where':{'name':_0x1704c1,'userProfileId':_0x185813[_0x839b('0x53')]},'raw':!![]})[_0x839b('0x28')](function(_0x5a3cc7){if(_0x5a3cc7&&_0x5a3cc7[_0x839b('0x54')]===0x0){return db[_0x839b('0x2c')][_0x839b('0x4e')]({'name':_0x38742a[_0x839b('0x2e')],'resourceId':_0x38742a['id'],'type':_0x839b('0x2b'),'sectionId':_0x5a3cc7['id']},{})[_0x839b('0x28')](function(){return _0x3b1e11;});}else{return _0x3b1e11;}})[_0x839b('0x49')](function(_0x2781d9){logger['error'](_0x839b('0x55'),_0x2781d9);throw _0x2781d9;});}return _0x3b1e11;})[_0x839b('0x28')](respondWithResult(_0x5e6b9c,0xc9))[_0x839b('0x49')](handleError(_0x5e6b9c,null));};exports[_0x839b('0x27')]=function(_0x514d80,_0x25a1a0){if(_0x514d80[_0x839b('0x56')]['id']){delete _0x514d80[_0x839b('0x56')]['id'];}return db[_0x839b('0x46')]['find']({'where':{'id':_0x514d80[_0x839b('0x57')]['id']}})['then'](handleEntityNotFound(_0x25a1a0,null))[_0x839b('0x28')](saveUpdates(_0x514d80[_0x839b('0x56')],null))[_0x839b('0x28')](respondWithResult(_0x25a1a0,null))[_0x839b('0x49')](handleError(_0x25a1a0,null));};exports[_0x839b('0x29')]=function(_0x1ffa49,_0x428839){return db[_0x839b('0x46')][_0x839b('0x4d')]({'where':{'id':_0x1ffa49['params']['id']}})[_0x839b('0x28')](handleEntityNotFound(_0x428839,null))['then'](removeEntity(_0x428839,null))[_0x839b('0x49')](handleError(_0x428839,null));};exports[_0x839b('0x58')]=function(_0x104e9d,_0x3ca7c6){var _0x108822=0xa;var _0x4643d1=[_0x839b('0x59'),'left_join',_0x839b('0x5a'),_0x839b('0x5b')];var _0x2c5502={'SUM':_0x839b('0x5c'),'COUNT':_0x839b('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x839b('0x5e'),'AVG':_0x839b('0x5f'),'GROUP_CONCAT':_0x839b('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x839b('0x61')};var _0x3ac6f0={'SEC_TO_TIME':_0x839b('0x62'),'DATE':_0x839b('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x839b('0x64'),'UNIX_TIMESTAMP':_0x839b('0x65')};var _0x469491=function(_0x4e16f3){return!_[_0x839b('0x66')]([_0x839b('0x67'),_0x839b('0x68'),'IS\x20EMPTY',_0x839b('0x69')],_0x4e16f3);};var _0x139558=function(_0x29e4d3){if(!_0x29e4d3||!_0x29e4d3[_0x839b('0x6a')][_0x839b('0x3a')]){return'';}for(var _0x57294a='(',_0x6788e2=0x0;_0x6788e2<_0x29e4d3[_0x839b('0x6a')][_0x839b('0x3a')];_0x6788e2+=0x1){_0x6788e2>0x0&&(_0x57294a+='\x20'+_0x29e4d3['operator']+'\x20');_0x57294a+=_0x29e4d3[_0x839b('0x6a')][_0x6788e2]['group']?_0x139558(_0x29e4d3['rules'][_0x6788e2]['group']):_0x29e4d3[_0x839b('0x6a')][_0x6788e2][_0x839b('0x6b')]+'\x20'+_0x29e4d3[_0x839b('0x6a')][_0x6788e2]['condition']+(_0x469491(_0x29e4d3[_0x839b('0x6a')][_0x6788e2][_0x839b('0x6c')])?'\x20'+_0x29e4d3[_0x839b('0x6a')][_0x6788e2][_0x839b('0x6d')]:'');}return _0x57294a+')';};var _0x1598ff={'where':{'id':_0x104e9d[_0x839b('0x57')]['id']}},_0x447b7d,_0x390c42,_0x45a628,_0x4310af,_0x59cf95;_0x1598ff=_[_0x839b('0x43')]({},_0x1598ff,_0x104e9d[_0x839b('0x45')]);return db[_0x839b('0x46')]['find'](_0x1598ff)['then'](function(_0x231b6d){if(_0x231b6d){_0x447b7d=_0x231b6d;return _0x231b6d[_0x839b('0x6e')]();}return null;})[_0x839b('0x28')](function(_0x34bca6){if(_0x34bca6){if(!_0x34bca6['length']){throw new db['Sequelize'][(_0x839b('0x6f'))](_0x839b('0x70'),0x193);}_0x390c42=_0x34bca6;return db[_0x839b('0x71')][_0x839b('0x72')]({'raw':!![]});}return null;})[_0x839b('0x28')](function(_0x3e7f90){if(_0x3e7f90){_0x45a628=_['keyBy'](_0x3e7f90,'id');var _0x1caffc;var _0x12b655=squel[_0x839b('0x73')]();_0x12b655[_0x839b('0x74')](_0x447b7d[_0x839b('0x75')]);for(var _0x298e3a=0x0;_0x298e3a<_0x390c42[_0x839b('0x3a')];_0x298e3a+=0x1){_0x1caffc=_0x390c42[_0x298e3a]['MetricId']?_0x45a628[_0x390c42[_0x298e3a]['MetricId']]['metric']:_0x390c42[_0x298e3a]['field'];_0x1caffc=_0x390c42[_0x298e3a][_0x839b('0x76')]?_[_0x839b('0x77')](_0x2c5502[_0x390c42[_0x298e3a]['function']],'%s',_0x1caffc):_0x1caffc;_0x1caffc=_0x390c42[_0x298e3a][_0x839b('0x78')]?_[_0x839b('0x77')](_0x3ac6f0[_0x390c42[_0x298e3a][_0x839b('0x78')]],'%s',_0x1caffc):_0x1caffc;if(_0x390c42[_0x298e3a][_0x839b('0x79')]){_0x12b655['group'](_0x1caffc);}_0x390c42[_0x298e3a]['orderBy']&&_0x12b655['order'](_0x1caffc,_0x390c42[_0x298e3a][_0x839b('0x7a')]===_0x839b('0x7b')?![]:!![]);_0x12b655[_0x839b('0x6b')](_0x1caffc,_0x390c42[_0x298e3a][_0x839b('0x7c')]||_0x1caffc);}if(_0x447b7d[_0x839b('0x7d')]){_0x447b7d[_0x839b('0x7d')]=JSON[_0x839b('0x7e')](_0x447b7d[_0x839b('0x7d')]);for(var _0x14b8eb=0x0;_0x14b8eb<_0x447b7d[_0x839b('0x7d')][_0x839b('0x3a')];_0x14b8eb+=0x1){if(_0x447b7d['joins'][_0x14b8eb][_0x839b('0x33')]&&_[_0x839b('0x66')](_0x4643d1,_0x447b7d[_0x839b('0x7d')][_0x14b8eb][_0x839b('0x33')])&&_0x447b7d[_0x839b('0x7d')][_0x14b8eb]['parentKey']&&_0x447b7d[_0x839b('0x7d')][_0x14b8eb][_0x839b('0x7f')]&&_0x447b7d['joins'][_0x14b8eb][_0x839b('0x80')]){_0x12b655[_0x447b7d[_0x839b('0x7d')][_0x14b8eb][_0x839b('0x33')]](_0x447b7d[_0x839b('0x7d')][_0x14b8eb]['foreignTable'],null,util[_0x839b('0x78')](_0x839b('0x81'),_0x447b7d[_0x839b('0x75')],_0x447b7d['joins'][_0x14b8eb][_0x839b('0x82')],_0x447b7d[_0x839b('0x7d')][_0x14b8eb][_0x839b('0x7f')],_0x447b7d[_0x839b('0x7d')][_0x14b8eb][_0x839b('0x80')]));}}}if(_0x447b7d[_0x839b('0x83')]){_0x447b7d[_0x839b('0x83')]=JSON[_0x839b('0x7e')](_0x447b7d[_0x839b('0x83')]);_0x12b655[_0x839b('0x3f')](_0x139558(_0x447b7d['conditions'][_0x839b('0x84')]));}_0x59cf95=_0x12b655[_0x839b('0x85')]();_0x12b655['limit'](_0x108822);_0x12b655[_0x839b('0x1f')](0x0);logger[_0x839b('0x86')](_0x839b('0x87'),_0x12b655['toString']());return dbH[_0x839b('0x88')]['query'](_0x12b655[_0x839b('0x89')](),{'type':dbH[_0x839b('0x88')]['QueryTypes'][_0x839b('0x8a')]});}})[_0x839b('0x28')](respondWithResult(_0x3ca7c6,null))[_0x839b('0x49')](handleError(_0x3ca7c6,null));};function runReport(_0x4db65f,_0x9afde0,_0x4fc767){var _0xf54643=_0x9afde0[_0x839b('0x2e')];var _0x5a58cd=0xa;var _0x52be61=[_0x839b('0x59'),_0x839b('0x8b'),'right_join','cross_join'];var _0x3b75a4={'SUM':_0x839b('0x5c'),'COUNT':_0x839b('0x5d'),'COUNT DISTINCT':_0x839b('0x8c'),'MAX':_0x839b('0x8d'),'MIN':_0x839b('0x5e'),'AVG':_0x839b('0x5f'),'GROUP_CONCAT':_0x839b('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x839b('0x61')};var _0x1a34a6={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x839b('0x63'),'HOUR':_0x839b('0x8e'),'ROUND':_0x839b('0x64'),'UNIX_TIMESTAMP':_0x839b('0x65')};var _0x2cce64=function(_0x3c5920){return!_[_0x839b('0x66')]([_0x839b('0x67'),_0x839b('0x68'),_0x839b('0x8f'),_0x839b('0x69')],_0x3c5920);};var _0x5bc920=function(_0x2f4f72){if(!_0x2f4f72||!_0x2f4f72[_0x839b('0x6a')]['length']){return'';}for(var _0x1228bd='(',_0x1a0112=0x0;_0x1a0112<_0x2f4f72['rules']['length'];_0x1a0112+=0x1){_0x1a0112>0x0&&(_0x1228bd+='\x20'+_0x2f4f72[_0x839b('0x90')]+'\x20');_0x1228bd+=_0x2f4f72[_0x839b('0x6a')][_0x1a0112][_0x839b('0x84')]?_0x5bc920(_0x2f4f72[_0x839b('0x6a')][_0x1a0112][_0x839b('0x84')]):_0x2f4f72[_0x839b('0x6a')][_0x1a0112]['field']+'\x20'+_0x2f4f72[_0x839b('0x6a')][_0x1a0112][_0x839b('0x6c')]+(_0x2cce64(_0x2f4f72[_0x839b('0x6a')][_0x1a0112][_0x839b('0x6c')])?'\x20'+_0x2f4f72[_0x839b('0x6a')][_0x1a0112][_0x839b('0x6d')]:'');}return _0x1228bd+')';};var _0xcb5b34={'where':{'id':_0x4db65f['id']}},_0x42c8e3,_0x1ab145,_0x2989c5,_0x5ef7c9,_0x363068;_0xcb5b34=_[_0x839b('0x43')]({},_0xcb5b34,_0x4fc767);return db['AnalyticCustomReport'][_0x839b('0x4d')](_0xcb5b34)[_0x839b('0x28')](function(_0x5a84be){if(_0x5a84be){_0x42c8e3=_0x5a84be;return _0x5a84be['getFields']();}return null;})['then'](function(_0x40a516){if(_0x40a516){if(!_0x40a516[_0x839b('0x3a')]){throw new db[(_0x839b('0x91'))][(_0x839b('0x6f'))](_0x839b('0x70'),0x193);}_0x1ab145=_0x40a516;return db[_0x839b('0x71')][_0x839b('0x72')]({'raw':!![]});}return null;})[_0x839b('0x28')](function(_0x468642){if(_0x468642){_0x2989c5=_[_0x839b('0x92')](_0x468642,'id');var _0x44e3f3;var _0x2439bd=squel[_0x839b('0x73')]();_0x2439bd[_0x839b('0x74')](_0x42c8e3['table']);for(var _0xa4f70e=0x0;_0xa4f70e<_0x1ab145['length'];_0xa4f70e+=0x1){_0x44e3f3=_0x1ab145[_0xa4f70e][_0x839b('0x93')]?_0x2989c5[_0x1ab145[_0xa4f70e]['MetricId']][_0x839b('0x94')]:_0x1ab145[_0xa4f70e][_0x839b('0x6b')];_0x44e3f3=_0x1ab145[_0xa4f70e][_0x839b('0x76')]?_[_0x839b('0x77')](_0x3b75a4[_0x1ab145[_0xa4f70e][_0x839b('0x76')]],'%s',_0x44e3f3):_0x44e3f3;_0x44e3f3=_0x1ab145[_0xa4f70e]['format']?_[_0x839b('0x77')](_0x1a34a6[_0x1ab145[_0xa4f70e]['format']],'%s',_0x44e3f3):_0x44e3f3;if(_0x1ab145[_0xa4f70e][_0x839b('0x79')]){_0x2439bd[_0x839b('0x84')](_0x44e3f3);}_0x1ab145[_0xa4f70e][_0x839b('0x7a')]&&_0x2439bd[_0x839b('0x3d')](_0x44e3f3,_0x1ab145[_0xa4f70e][_0x839b('0x7a')]===_0x839b('0x7b')?![]:!![]);_0x2439bd[_0x839b('0x6b')](_0x44e3f3,_0x1ab145[_0xa4f70e][_0x839b('0x7c')]||_0x44e3f3);}if(_0x42c8e3[_0x839b('0x7d')]){_0x42c8e3[_0x839b('0x7d')]=JSON[_0x839b('0x7e')](_0x42c8e3[_0x839b('0x7d')]);for(var _0x19b08f=0x0;_0x19b08f<_0x42c8e3[_0x839b('0x7d')][_0x839b('0x3a')];_0x19b08f+=0x1){if(_0x42c8e3['joins'][_0x19b08f]['type']&&_[_0x839b('0x66')](_0x52be61,_0x42c8e3[_0x839b('0x7d')][_0x19b08f][_0x839b('0x33')])&&_0x42c8e3[_0x839b('0x7d')][_0x19b08f][_0x839b('0x82')]&&_0x42c8e3['joins'][_0x19b08f]['foreignTable']&&_0x42c8e3[_0x839b('0x7d')][_0x19b08f]['foreignKey']){_0x2439bd[_0x42c8e3['joins'][_0x19b08f][_0x839b('0x33')]](_0x42c8e3[_0x839b('0x7d')][_0x19b08f][_0x839b('0x7f')],null,util[_0x839b('0x78')](_0x839b('0x81'),_0x42c8e3[_0x839b('0x75')],_0x42c8e3[_0x839b('0x7d')][_0x19b08f][_0x839b('0x82')],_0x42c8e3[_0x839b('0x7d')][_0x19b08f][_0x839b('0x7f')],_0x42c8e3['joins'][_0x19b08f]['foreignKey']));}}}if(_0x42c8e3[_0x839b('0x83')]){_0x42c8e3[_0x839b('0x83')]=JSON[_0x839b('0x7e')](_0x42c8e3[_0x839b('0x83')]);_0x2439bd[_0x839b('0x3f')](_0x5bc920(_0x42c8e3[_0x839b('0x83')][_0x839b('0x84')]));}_0x363068=_0x2439bd[_0x839b('0x85')]();_0x2439bd[_0x839b('0x20')](_0x5a58cd);_0x2439bd[_0x839b('0x1f')](0x0);return;}})['then'](function(){if(_0x9afde0[_0x839b('0x95')]===_0x839b('0x96')){return null;}var _0x5ed342=_[_0x839b('0x43')](_0x9afde0,{'name':_0x9afde0[_0x839b('0x97')]||_0x9afde0[_0x839b('0x2e')]||_0x42c8e3[_0x839b('0x2e')],'basename':_0xf54643,'savename':util['format'](_0x839b('0x98'),_0x9afde0[_0x839b('0x2e')]||_0x42c8e3[_0x839b('0x2e')],require(_0x839b('0x99'))[_0x839b('0x9a')](0x4),_0x9afde0[_0x839b('0x95')]||_0x839b('0x9b')),'reportId':_0x42c8e3['id'],'reportType':'custom'});return db[_0x839b('0x9c')][_0x839b('0x4e')](_0x5ed342,{'raw':!![]});})['then'](function(_0x59e798){if(_0x42c8e3[_0x839b('0x75')]==='cdr'){_0x363068[_0x839b('0x3f')](_0x42c8e3['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x9afde0[_0x839b('0x9d')],_0x9afde0['endDate']);}else{_0x363068[_0x839b('0x3f')](_0x42c8e3[_0x839b('0x75')]+_0x839b('0x9e'),_0x9afde0['startDate'],_0x9afde0[_0x839b('0x9f')]);}if(_0x59e798){logger[_0x839b('0xa0')]('Run\x20Query:',_0x363068[_0x839b('0x89')]());require('child_process')[_0x839b('0xa1')](path['join'](__dirname,_0x839b('0xa2'),_0x59e798[_0x839b('0x95')]),[_0x59e798['id'],_0x363068['toString'](),path['join'](__dirname,_0x839b('0xa3'),_0x59e798[_0x839b('0xa4')]),_0xf54643]);return _0x59e798;}else{var _0x47d35f=squel['select']();_0x47d35f[_0x839b('0x74')]('('+_0x363068[_0x839b('0x89')]()+')',_0x839b('0xa5'));_0x47d35f['field'](_0x839b('0xa6'),_0x839b('0x22'));_0x363068[_0x839b('0x20')](_0x9afde0[_0x839b('0x20')]||_0x5a58cd);_0x363068[_0x839b('0x1f')](_0x9afde0['offset']||0x0);return dbH[_0x839b('0x88')][_0x839b('0x36')](_0x47d35f[_0x839b('0x89')](),{'type':dbH[_0x839b('0x88')][_0x839b('0xa7')]['SELECT']})['then'](function(_0x1767e0){if(!_0x1767e0[_0x839b('0x3a')]){_0x5ef7c9=0x0;}else{_0x5ef7c9=_0x1767e0[0x0][_0x839b('0x22')]||0x0;}return dbH[_0x839b('0x88')][_0x839b('0x36')](_0x363068[_0x839b('0x89')](),{'type':dbH[_0x839b('0x88')][_0x839b('0xa7')][_0x839b('0x8a')]});})[_0x839b('0x28')](function(_0x120762){return{'rows':_0x120762||[],'count':_0x5ef7c9};});}});}exports[_0x839b('0xa8')]=function(_0x119cdd,_0x502079){return runReport(_0x119cdd['params'],_0x119cdd[_0x839b('0x36')],_0x119cdd[_0x839b('0x45')])[_0x839b('0x28')](respondWithResult(_0x502079,null))[_0x839b('0x49')](handleError(_0x502079,null));};exports[_0x839b('0xa9')]=runReport;exports[_0x839b('0x36')]=function(_0x3bf273,_0x3ffc04){var _0x178d3c=0xa;var _0x5e88a4=['join',_0x839b('0x8b'),_0x839b('0x5a'),_0x839b('0x5b')];var _0x37eef2={'SUM':_0x839b('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x839b('0x8c'),'MAX':_0x839b('0x8d'),'MIN':_0x839b('0x5e'),'AVG':_0x839b('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x839b('0xaa'),'GROUP_CONCAT DESC':_0x839b('0x61')};var _0x5b8226={'SEC_TO_TIME':_0x839b('0x62'),'DATE':_0x839b('0x63'),'HOUR':_0x839b('0x8e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x839b('0x65')};var _0x2194de=function(_0x3a8159){return!_[_0x839b('0x66')]([_0x839b('0x67'),_0x839b('0x68'),_0x839b('0x8f'),_0x839b('0x69')],_0x3a8159);};var _0x6b041a=function(_0x54847d){if(!_0x54847d||!_0x54847d[_0x839b('0x6a')][_0x839b('0x3a')]){return'';}for(var _0xf2b601='(',_0x46e482=0x0;_0x46e482<_0x54847d[_0x839b('0x6a')][_0x839b('0x3a')];_0x46e482+=0x1){_0x46e482>0x0&&(_0xf2b601+='\x20'+_0x54847d['operator']+'\x20');_0xf2b601+=_0x54847d[_0x839b('0x6a')][_0x46e482]['group']?_0x6b041a(_0x54847d[_0x839b('0x6a')][_0x46e482][_0x839b('0x84')]):_0x54847d[_0x839b('0x6a')][_0x46e482]['field']+'\x20'+_0x54847d[_0x839b('0x6a')][_0x46e482][_0x839b('0x6c')]+(_0x2194de(_0x54847d[_0x839b('0x6a')][_0x46e482]['condition'])?'\x20'+_0x54847d['rules'][_0x46e482][_0x839b('0x6d')]:'');}return _0xf2b601+')';};var _0x41be01={'where':{'id':_0x3bf273[_0x839b('0x57')]['id']}},_0x5a9cd4,_0x2076ee,_0xd1ca12,_0x14eee9,_0x45f2b1;_0x41be01=_[_0x839b('0x43')]({},_0x41be01,_0x3bf273[_0x839b('0x45')]);return db[_0x839b('0x46')]['find'](_0x41be01)[_0x839b('0x28')](function(_0x300bbf){if(_0x300bbf){_0x5a9cd4=_0x300bbf;return _0x300bbf[_0x839b('0x6e')]();}return null;})[_0x839b('0x28')](function(_0x3b5903){if(_0x3b5903){if(!_0x3b5903['length']){throw new db[(_0x839b('0x91'))][(_0x839b('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2076ee=_0x3b5903;return db[_0x839b('0x71')][_0x839b('0x72')]({'raw':!![]});}return null;})[_0x839b('0x28')](function(_0x15102a){if(_0x15102a){_0xd1ca12=_['keyBy'](_0x15102a,'id');var _0x1fbc26;var _0x41727e=squel[_0x839b('0x73')]();_0x41727e[_0x839b('0x74')](_0x5a9cd4[_0x839b('0x75')]);for(var _0x599d2c=0x0;_0x599d2c<_0x2076ee[_0x839b('0x3a')];_0x599d2c+=0x1){_0x1fbc26=_0x2076ee[_0x599d2c][_0x839b('0x93')]?_0xd1ca12[_0x2076ee[_0x599d2c][_0x839b('0x93')]][_0x839b('0x94')]:_0x2076ee[_0x599d2c][_0x839b('0x6b')];_0x1fbc26=_0x2076ee[_0x599d2c][_0x839b('0x76')]?_[_0x839b('0x77')](_0x37eef2[_0x2076ee[_0x599d2c][_0x839b('0x76')]],'%s',_0x1fbc26):_0x1fbc26;_0x1fbc26=_0x2076ee[_0x599d2c][_0x839b('0x78')]?_[_0x839b('0x77')](_0x5b8226[_0x2076ee[_0x599d2c][_0x839b('0x78')]],'%s',_0x1fbc26):_0x1fbc26;if(_0x2076ee[_0x599d2c]['groupBy']){_0x41727e[_0x839b('0x84')](_0x1fbc26);}_0x2076ee[_0x599d2c]['orderBy']&&_0x41727e[_0x839b('0x3d')](_0x1fbc26,_0x2076ee[_0x599d2c][_0x839b('0x7a')]===_0x839b('0x7b')?![]:!![]);_0x41727e[_0x839b('0x6b')](_0x1fbc26,_0x2076ee[_0x599d2c][_0x839b('0x7c')]||_0x1fbc26);}if(_0x5a9cd4[_0x839b('0x7d')]){_0x5a9cd4[_0x839b('0x7d')]=JSON['parse'](_0x5a9cd4[_0x839b('0x7d')]);for(var _0x59bab6=0x0;_0x59bab6<_0x5a9cd4['joins']['length'];_0x59bab6+=0x1){if(_0x5a9cd4[_0x839b('0x7d')][_0x59bab6][_0x839b('0x33')]&&_['includes'](_0x5e88a4,_0x5a9cd4[_0x839b('0x7d')][_0x59bab6]['type'])&&_0x5a9cd4[_0x839b('0x7d')][_0x59bab6][_0x839b('0x82')]&&_0x5a9cd4[_0x839b('0x7d')][_0x59bab6][_0x839b('0x7f')]&&_0x5a9cd4[_0x839b('0x7d')][_0x59bab6][_0x839b('0x80')]){_0x41727e[_0x5a9cd4[_0x839b('0x7d')][_0x59bab6]['type']](_0x5a9cd4[_0x839b('0x7d')][_0x59bab6][_0x839b('0x7f')],null,util[_0x839b('0x78')]('%s.%s\x20=\x20%s.%s',_0x5a9cd4[_0x839b('0x75')],_0x5a9cd4[_0x839b('0x7d')][_0x59bab6][_0x839b('0x82')],_0x5a9cd4[_0x839b('0x7d')][_0x59bab6][_0x839b('0x7f')],_0x5a9cd4[_0x839b('0x7d')][_0x59bab6][_0x839b('0x80')]));}}}if(_0x5a9cd4[_0x839b('0x83')]){_0x5a9cd4[_0x839b('0x83')]=JSON[_0x839b('0x7e')](_0x5a9cd4[_0x839b('0x83')]);_0x41727e[_0x839b('0x3f')](_0x6b041a(_0x5a9cd4[_0x839b('0x83')][_0x839b('0x84')]));}_0x45f2b1=_0x41727e[_0x839b('0x85')]();_0x41727e[_0x839b('0x20')](_0x178d3c);_0x41727e[_0x839b('0x1f')](0x0);logger[_0x839b('0x86')](_0x839b('0x87'),_0x41727e['toString']());return dbH['sequelize']['query'](_0x41727e['toString'](),{'type':dbH[_0x839b('0x88')][_0x839b('0xa7')][_0x839b('0x8a')]});}})['then'](function(){return{'sql':_0x45f2b1['toString']()};})['then'](respondWithResult(_0x3ffc04,null))[_0x839b('0x49')](handleError(_0x3ffc04,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index a56999c..423b7c8 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 _0x16dd=['moment','bluebird','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','../../config/logger','api'];(function(_0x5e64c6,_0x37df30){var _0x370feb=function(_0x17e2a5){while(--_0x17e2a5){_0x5e64c6['push'](_0x5e64c6['shift']());}};_0x370feb(++_0x37df30);}(_0x16dd,0xc3));var _0xd16d=function(_0x1c3e8a,_0x5f0150){_0x1c3e8a=_0x1c3e8a-0x0;var _0x1297df=_0x16dd[_0x1c3e8a];return _0x1297df;};'use strict';var _=require(_0xd16d('0x0'));var util=require('util');var logger=require(_0xd16d('0x1'))(_0xd16d('0x2'));var moment=require(_0xd16d('0x3'));var BPromise=require(_0xd16d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd16d('0x5'));var rimraf=require(_0xd16d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd16d('0x7'));module[_0xd16d('0x8')]=function(_0x36d889,_0x44b770){return _0x36d889[_0xd16d('0x9')](_0xd16d('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb4=['../../config/environment','./analyticCustomReport.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb4,0x10c));var _0x41cb=function(_0xd7348f,_0x54e9a7){_0xd7348f=_0xd7348f-0x0;var _0x4d64a9=_0x1cb4[_0xd7348f];return _0x4d64a9;};'use strict';var _=require(_0x41cb('0x0'));var util=require(_0x41cb('0x1'));var logger=require('../../config/logger')(_0x41cb('0x2'));var moment=require(_0x41cb('0x3'));var BPromise=require('bluebird');var rp=require(_0x41cb('0x4'));var fs=require('fs');var path=require(_0x41cb('0x5'));var rimraf=require(_0x41cb('0x6'));var config=require(_0x41cb('0x7'));var attributes=require(_0x41cb('0x8'));module[_0x41cb('0x9')]=function(_0x7b035a,_0x32cce2){return _0x7b035a[_0x41cb('0xa')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','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 26d9e8c..84567b4 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 _0x9cbf=['lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x27d614,_0x4bf4d6){var _0x378d4e=function(_0x489e04){while(--_0x489e04){_0x27d614['push'](_0x27d614['shift']());}};_0x378d4e(++_0x4bf4d6);}(_0x9cbf,0xdc));var _0xf9cb=function(_0x57fd7f,_0x226759){_0x57fd7f=_0x57fd7f-0x0;var _0x4815e7=_0x9cbf[_0x57fd7f];return _0x4815e7;};'use strict';var _=require(_0xf9cb('0x0'));var util=require(_0xf9cb('0x1'));var moment=require('moment');var BPromise=require(_0xf9cb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9cb('0x3'))['db'];var utils=require(_0xf9cb('0x4'));var logger=require('../../config/logger')(_0xf9cb('0x5'));var config=require(_0xf9cb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf9cb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ee404,_0x1b2482,_0x13652b){return new BPromise(function(_0x125ace,_0x517a78){return client[_0xf9cb('0x8')](_0x5ee404,_0x13652b)['then'](function(_0x26303d){logger['info'](_0xf9cb('0x9'),_0x1b2482,_0xf9cb('0xa'));logger[_0xf9cb('0xb')](_0xf9cb('0xc'),_0x1b2482,_0xf9cb('0xa'),JSON[_0xf9cb('0xd')](_0x26303d));if(_0x26303d[_0xf9cb('0xe')]){if(_0x26303d[_0xf9cb('0xe')][_0xf9cb('0xf')]===0x1f4){logger[_0xf9cb('0xe')](_0xf9cb('0x9'),_0x1b2482,_0x26303d['error'][_0xf9cb('0x10')]);return _0x517a78(_0x26303d[_0xf9cb('0xe')][_0xf9cb('0x10')]);}logger['error'](_0xf9cb('0x9'),_0x1b2482,_0x26303d['error'][_0xf9cb('0x10')]);return _0x125ace(_0x26303d[_0xf9cb('0xe')][_0xf9cb('0x10')]);}else{logger[_0xf9cb('0x11')](_0xf9cb('0x9'),_0x1b2482,_0xf9cb('0xa'));_0x125ace(_0x26303d[_0xf9cb('0x12')][_0xf9cb('0x10')]);}})[_0xf9cb('0x13')](function(_0x591033){logger[_0xf9cb('0xe')](_0xf9cb('0x9'),_0x1b2482,_0x591033);_0x517a78(_0x591033);});});} \ No newline at end of file +var _0xb97c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch'];(function(_0x329643,_0x374b43){var _0x58d7bf=function(_0x27beb0){while(--_0x27beb0){_0x329643['push'](_0x329643['shift']());}};_0x58d7bf(++_0x374b43);}(_0xb97c,0x7e));var _0xcb97=function(_0xa171cc,_0x5bac54){_0xa171cc=_0xa171cc-0x0;var _0x275c15=_0xb97c[_0xa171cc];return _0x275c15;};'use strict';var _=require(_0xcb97('0x0'));var util=require(_0xcb97('0x1'));var moment=require(_0xcb97('0x2'));var BPromise=require(_0xcb97('0x3'));var rs=require(_0xcb97('0x4'));var fs=require('fs');var Redis=require(_0xcb97('0x5'));var db=require(_0xcb97('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb97('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcb97('0x8')][_0xcb97('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55e6c7,_0x2b0c28,_0x18c309){return new BPromise(function(_0x1ee9c9,_0xdb9528){return client[_0xcb97('0xa')](_0x55e6c7,_0x18c309)[_0xcb97('0xb')](function(_0x43e91f){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2b0c28,_0xcb97('0xc'));logger[_0xcb97('0xd')](_0xcb97('0xe'),_0x2b0c28,'request\x20sent',JSON['stringify'](_0x43e91f));if(_0x43e91f['error']){if(_0x43e91f[_0xcb97('0xf')][_0xcb97('0x10')]===0x1f4){logger[_0xcb97('0xf')](_0xcb97('0x11'),_0x2b0c28,_0x43e91f[_0xcb97('0xf')]['message']);return _0xdb9528(_0x43e91f[_0xcb97('0xf')][_0xcb97('0x12')]);}logger[_0xcb97('0xf')](_0xcb97('0x11'),_0x2b0c28,_0x43e91f['error'][_0xcb97('0x12')]);return _0x1ee9c9(_0x43e91f[_0xcb97('0xf')][_0xcb97('0x12')]);}else{logger['info'](_0xcb97('0x11'),_0x2b0c28,_0xcb97('0xc'));_0x1ee9c9(_0x43e91f[_0xcb97('0x13')][_0xcb97('0x12')]);}})[_0xcb97('0x14')](function(_0x5cb705){logger[_0xcb97('0xf')](_0xcb97('0x11'),_0x2b0c28,_0x5cb705);_0xdb9528(_0x5cb705);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b6574ed..31b53ed 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 _0x7028=['Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','run','query','post','create','delete','destroy','exports','multer','util'];(function(_0x37d210,_0x5248e7){var _0xe212d9=function(_0x50e334){while(--_0x50e334){_0x37d210['push'](_0x37d210['shift']());}};_0xe212d9(++_0x5248e7);}(_0x7028,0x1d9));var _0x8702=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x7028[_0x55ff3e];return _0x2709eb;};'use strict';var multer=require(_0x8702('0x0'));var util=require(_0x8702('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8702('0x2')]();var fs_extra=require(_0x8702('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8702('0x4'));var config=require('../../config/environment');var controller=require(_0x8702('0x5'));router[_0x8702('0x6')]('/',auth[_0x8702('0x7')](),controller['index']);router['get'](_0x8702('0x8'),auth[_0x8702('0x7')](),controller[_0x8702('0x9')]);router['get'](_0x8702('0xa'),auth[_0x8702('0x7')](),controller[_0x8702('0xb')]);router[_0x8702('0x6')]('/:id/run',auth[_0x8702('0x7')](),controller[_0x8702('0xc')]);router[_0x8702('0x6')]('/:id/query',auth['isAuthenticated'](),controller[_0x8702('0xd')]);router[_0x8702('0xe')]('/',auth[_0x8702('0x7')](),controller[_0x8702('0xf')]);router['put'](_0x8702('0x8'),auth[_0x8702('0x7')](),controller['update']);router[_0x8702('0x10')]('/:id',auth[_0x8702('0x7')](),controller[_0x8702('0x11')]);module[_0x8702('0x12')]=router; \ No newline at end of file +var _0x301c=['/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x5c2a2e,_0x272b52){var _0x3890d4=function(_0x4a20e7){while(--_0x4a20e7){_0x5c2a2e['push'](_0x5c2a2e['shift']());}};_0x3890d4(++_0x272b52);}(_0x301c,0xdb));var _0xc301=function(_0x4b97c6,_0x21017c){_0x4b97c6=_0x4b97c6-0x0;var _0x342ead=_0x301c[_0x4b97c6];return _0x342ead;};'use strict';var multer=require(_0xc301('0x0'));var util=require(_0xc301('0x1'));var path=require(_0xc301('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc301('0x3')]();var fs_extra=require(_0xc301('0x4'));var auth=require(_0xc301('0x5'));var interaction=require(_0xc301('0x6'));var config=require('../../config/environment');var controller=require(_0xc301('0x7'));router[_0xc301('0x8')]('/',auth[_0xc301('0x9')](),controller[_0xc301('0xa')]);router[_0xc301('0x8')](_0xc301('0xb'),auth[_0xc301('0x9')](),controller[_0xc301('0xc')]);router[_0xc301('0x8')](_0xc301('0xd'),auth[_0xc301('0x9')](),controller[_0xc301('0xe')]);router['get'](_0xc301('0xf'),auth[_0xc301('0x9')](),controller[_0xc301('0x10')]);router[_0xc301('0x8')](_0xc301('0x11'),auth[_0xc301('0x9')](),controller['query']);router[_0xc301('0x12')]('/',auth[_0xc301('0x9')](),controller[_0xc301('0x13')]);router['put']('/:id',auth[_0xc301('0x9')](),controller['update']);router[_0xc301('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc301('0x15')]);module[_0xc301('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 5df66cd..ad350e7 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 _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x3c151c,_0x3d6b5f){var _0x57948c=function(_0x1147af){while(--_0x1147af){_0x3c151c['push'](_0x3c151c['shift']());}};_0x57948c(++_0x3d6b5f);}(_0x5d17,0x114));var _0x75d1=function(_0x1d0e07,_0x2037e9){_0x1d0e07=_0x1d0e07-0x0;var _0x8912e0=_0x5d17[_0x1d0e07];return _0x8912e0;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0xfdbd[_0x25efdf];return _0x22c495;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index fe135fd..944c972 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 _0x687b=['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','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x45cb2b,_0x285349){_0x45cb2b=_0x45cb2b-0x0;var _0x9411a6=_0x687b[_0x45cb2b];return _0x9411a6;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file +var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x3a60f1,_0xd1087b){var _0xb3c20b=function(_0x4480d1){while(--_0x4480d1){_0x3a60f1['push'](_0x3a60f1['shift']());}};_0xb3c20b(++_0xd1087b);}(_0x814b,0x1a2));var _0xb814=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x814b[_0x5beda8];return _0x2aa042;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index b6f0f31..9eab8f0 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 _0xf148=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment'];(function(_0x5a6159,_0x21eb22){var _0x60d15c=function(_0x4aed5b){while(--_0x4aed5b){_0x5a6159['push'](_0x5a6159['shift']());}};_0x60d15c(++_0x21eb22);}(_0xf148,0x1a8));var _0x8f14=function(_0x148dd0,_0x62e51d){_0x148dd0=_0x148dd0-0x0;var _0x57b025=_0xf148[_0x148dd0];return _0x57b025;};'use strict';var _=require(_0x8f14('0x0'));var util=require(_0x8f14('0x1'));var logger=require(_0x8f14('0x2'))(_0x8f14('0x3'));var moment=require(_0x8f14('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8f14('0x5'));var config=require(_0x8f14('0x6'));var attributes=require(_0x8f14('0x7'));module[_0x8f14('0x8')]=function(_0x5c0e91,_0x27dc37){return _0x5c0e91[_0x8f14('0x9')](_0x8f14('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a3c=['AnalyticDefaultReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define'];(function(_0x3a6c22,_0x25539e){var _0x61930a=function(_0x69ae65){while(--_0x69ae65){_0x3a6c22['push'](_0x3a6c22['shift']());}};_0x61930a(++_0x25539e);}(_0x1a3c,0xb5));var _0xc1a3=function(_0x39c8c8,_0x552d46){_0x39c8c8=_0x39c8c8-0x0;var _0x540fb5=_0x1a3c[_0x39c8c8];return _0x540fb5;};'use strict';var _=require(_0xc1a3('0x0'));var util=require(_0xc1a3('0x1'));var logger=require(_0xc1a3('0x2'))(_0xc1a3('0x3'));var moment=require('moment');var BPromise=require(_0xc1a3('0x4'));var rp=require(_0xc1a3('0x5'));var fs=require('fs');var path=require(_0xc1a3('0x6'));var rimraf=require(_0xc1a3('0x7'));var config=require(_0xc1a3('0x8'));var attributes=require(_0xc1a3('0x9'));module['exports']=function(_0x5a2a6d,_0x2a609c){return _0x5a2a6d[_0xc1a3('0xa')](_0xc1a3('0xb'),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 2e87dce..13b16de 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 _0x112c=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x112c,0x16c));var _0xc112=function(_0x3ad3f3,_0x100e31){_0x3ad3f3=_0x3ad3f3-0x0;var _0x44baeb=_0x112c[_0x3ad3f3];return _0x44baeb;};'use strict';var _=require(_0xc112('0x0'));var util=require(_0xc112('0x1'));var moment=require(_0xc112('0x2'));var BPromise=require(_0xc112('0x3'));var rs=require(_0xc112('0x4'));var fs=require('fs');var Redis=require(_0xc112('0x5'));var db=require(_0xc112('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc112('0x7'));var jayson=require(_0xc112('0x8'));var client=jayson[_0xc112('0x9')][_0xc112('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26a53b,_0x2ba4fd,_0x436145){return new BPromise(function(_0x68b517,_0x2b78d1){return client[_0xc112('0xb')](_0x26a53b,_0x436145)[_0xc112('0xc')](function(_0x9df69d){logger[_0xc112('0xd')](_0xc112('0xe'),_0x2ba4fd,'request\x20sent');logger[_0xc112('0xf')](_0xc112('0x10'),_0x2ba4fd,_0xc112('0x11'),JSON[_0xc112('0x12')](_0x9df69d));if(_0x9df69d[_0xc112('0x13')]){if(_0x9df69d[_0xc112('0x13')][_0xc112('0x14')]===0x1f4){logger[_0xc112('0x13')](_0xc112('0xe'),_0x2ba4fd,_0x9df69d[_0xc112('0x13')]['message']);return _0x2b78d1(_0x9df69d[_0xc112('0x13')][_0xc112('0x15')]);}logger[_0xc112('0x13')](_0xc112('0xe'),_0x2ba4fd,_0x9df69d[_0xc112('0x13')]['message']);return _0x68b517(_0x9df69d[_0xc112('0x13')][_0xc112('0x15')]);}else{logger[_0xc112('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2ba4fd,_0xc112('0x11'));_0x68b517(_0x9df69d[_0xc112('0x16')][_0xc112('0x15')]);}})[_0xc112('0x17')](function(_0x209b26){logger[_0xc112('0x13')](_0xc112('0xe'),_0x2ba4fd,_0x209b26);_0x2b78d1(_0x209b26);});});} \ No newline at end of file +var _0xaae7=['code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x256351,_0x777b69){var _0x125576=function(_0x307637){while(--_0x307637){_0x256351['push'](_0x256351['shift']());}};_0x125576(++_0x777b69);}(_0xaae7,0x1e5));var _0x7aae=function(_0x4bfdd1,_0x30bbec){_0x4bfdd1=_0x4bfdd1-0x0;var _0xc934e0=_0xaae7[_0x4bfdd1];return _0xc934e0;};'use strict';var _=require(_0x7aae('0x0'));var util=require('util');var moment=require(_0x7aae('0x1'));var BPromise=require(_0x7aae('0x2'));var rs=require(_0x7aae('0x3'));var fs=require('fs');var Redis=require(_0x7aae('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7aae('0x5'))('rpc');var config=require(_0x7aae('0x6'));var jayson=require(_0x7aae('0x7'));var client=jayson[_0x7aae('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x509135,_0x4977c8,_0x878330){return new BPromise(function(_0x51ec42,_0x1c9b31){return client[_0x7aae('0x9')](_0x509135,_0x878330)['then'](function(_0x366aab){logger['info'](_0x7aae('0xa'),_0x4977c8,'request\x20sent');logger[_0x7aae('0xb')](_0x7aae('0xc'),_0x4977c8,_0x7aae('0xd'),JSON['stringify'](_0x366aab));if(_0x366aab[_0x7aae('0xe')]){if(_0x366aab['error'][_0x7aae('0xf')]===0x1f4){logger[_0x7aae('0xe')](_0x7aae('0xa'),_0x4977c8,_0x366aab['error']['message']);return _0x1c9b31(_0x366aab['error'][_0x7aae('0x10')]);}logger[_0x7aae('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4977c8,_0x366aab[_0x7aae('0xe')]['message']);return _0x51ec42(_0x366aab[_0x7aae('0xe')][_0x7aae('0x10')]);}else{logger[_0x7aae('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4977c8,_0x7aae('0xd'));_0x51ec42(_0x366aab[_0x7aae('0x12')][_0x7aae('0x10')]);}})[_0x7aae('0x13')](function(_0x118f01){logger['error'](_0x7aae('0xa'),_0x4977c8,_0x118f01);_0x1c9b31(_0x118f01);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7f95773..3e18c39 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 _0xbdae=['/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','update','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xbdae,0x114));var _0xebda=function(_0x545ff5,_0x29eb1d){_0x545ff5=_0x545ff5-0x0;var _0x22cc7b=_0xbdae[_0x545ff5];return _0x22cc7b;};'use strict';var multer=require(_0xebda('0x0'));var util=require(_0xebda('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xebda('0x2'));var router=express[_0xebda('0x3')]();var fs_extra=require(_0xebda('0x4'));var auth=require(_0xebda('0x5'));var interaction=require(_0xebda('0x6'));var config=require(_0xebda('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xebda('0x8')]('/',auth['isAuthenticated'](),controller[_0xebda('0x9')]);router[_0xebda('0x8')](_0xebda('0xa'),auth[_0xebda('0xb')](),controller[_0xebda('0xc')]);router[_0xebda('0x8')](_0xebda('0xd'),auth[_0xebda('0xb')](),controller[_0xebda('0xe')]);router[_0xebda('0x8')](_0xebda('0xf'),auth[_0xebda('0xb')](),controller[_0xebda('0x10')]);router[_0xebda('0x8')](_0xebda('0x11'),auth[_0xebda('0xb')](),controller['query']);router[_0xebda('0x12')]('/',auth[_0xebda('0xb')](),controller[_0xebda('0x13')]);router['put'](_0xebda('0xa'),auth[_0xebda('0xb')](),controller[_0xebda('0x14')]);router[_0xebda('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9f0e=['./analyticDefaultReport.controller','get','/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','query','post','create','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33ae46,_0x4ea262){var _0x5e99b2=function(_0x36c290){while(--_0x36c290){_0x33ae46['push'](_0x33ae46['shift']());}};_0x5e99b2(++_0x4ea262);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4c71bd,_0x16f85c){_0x4c71bd=_0x4c71bd-0x0;var _0x2e8acf=_0x9f0e[_0x4c71bd];return _0x2e8acf;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['show']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0x9')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x9')]('/:id/query',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x10')]);router[_0xe9f0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe9f0('0x12')]);router['put'](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x13')]);router[_0xe9f0('0x14')]('/:id',auth[_0xe9f0('0xb')](),controller['destroy']);module[_0xe9f0('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index a3cb8f2..08f6591 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 _0x67b8=['INTEGER','UNSIGNED','sequelize','exports','STRING','pdf','DATE','Loading','ENUM','scheduled','manual'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x67b8,0x9c));var _0x867b=function(_0x49b6f5,_0x3fb5eb){_0x49b6f5=_0x49b6f5-0x0;var _0x33aaf1=_0x67b8[_0x49b6f5];return _0x33aaf1;};'use strict';var Sequelize=require(_0x867b('0x0'));var moment=require('moment');module[_0x867b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x867b('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x867b('0x3'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x867b('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x867b('0x4')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x867b('0x2')],'defaultValue':_0x867b('0x5')},'type':{'type':Sequelize[_0x867b('0x6')]('manual',_0x867b('0x7')),'allowNull':![],'defaultValue':_0x867b('0x8')},'reportId':{'type':Sequelize[_0x867b('0x9')](0xb)[_0x867b('0xa')]},'reportType':{'type':Sequelize[_0x867b('0x2')]}}; \ No newline at end of file +var _0x5f5d=['scheduled','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x5f5d,0x109));var _0xd5f5=function(_0x41dd8d,_0x4520f4){_0x41dd8d=_0x41dd8d-0x0;var _0x375be4=_0x5f5d[_0x41dd8d];return _0x375be4;};'use strict';var Sequelize=require(_0xd5f5('0x0'));var moment=require(_0xd5f5('0x1'));module[_0xd5f5('0x2')]={'name':{'type':Sequelize[_0xd5f5('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd5f5('0x4'),_0xd5f5('0x5'),_0xd5f5('0x6')),'allowNull':![],'defaultValue':_0xd5f5('0x4')},'savename':{'type':Sequelize[_0xd5f5('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xd5f5('0x7')]},'status':{'type':Sequelize[_0xd5f5('0x3')],'defaultValue':_0xd5f5('0x8')},'type':{'type':Sequelize[_0xd5f5('0x9')](_0xd5f5('0xa'),_0xd5f5('0xb')),'allowNull':![],'defaultValue':_0xd5f5('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xd5f5('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c9e7ffb..c2e9c43 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 _0x9a1b=['jsforce','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','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','show','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x5bf18d,_0x264c55){var _0x1d6cc0=function(_0x2d69d9){while(--_0x2d69d9){_0x5bf18d['push'](_0x5bf18d['shift']());}};_0x1d6cc0(++_0x264c55);}(_0x9a1b,0x1ce));var _0xb9a1=function(_0x180fea,_0x27ca11){_0x180fea=_0x180fea-0x0;var _0x4068b2=_0x9a1b[_0x180fea];return _0x4068b2;};'use strict';var emlformat=require(_0xb9a1('0x0'));var rimraf=require(_0xb9a1('0x1'));var zipdir=require(_0xb9a1('0x2'));var jsonpatch=require(_0xb9a1('0x3'));var rp=require(_0xb9a1('0x4'));var moment=require(_0xb9a1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb9a1('0x6'));var util=require(_0xb9a1('0x7'));var path=require(_0xb9a1('0x8'));var sox=require(_0xb9a1('0x9'));var csv=require(_0xb9a1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9a1('0xb'));var squel=require(_0xb9a1('0xc'));var crypto=require('crypto');var jsforce=require(_0xb9a1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb9a1('0xa'));var querystring=require('querystring');var Papa=require(_0xb9a1('0xe'));var Redis=require(_0xb9a1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb9a1('0x10'));var as=require(_0xb9a1('0x11'));var hardwareService=require(_0xb9a1('0x12'));var logger=require(_0xb9a1('0x13'))(_0xb9a1('0x14'));var utils=require('../../config/utils');var config=require(_0xb9a1('0x15'));var licenseUtil=require(_0xb9a1('0x16'));var db=require(_0xb9a1('0x17'))['db'];function respondWithStatusCode(_0x22888b,_0x387752){_0x387752=_0x387752||0xcc;return function(_0x42fa97){if(_0x42fa97){return _0x22888b[_0xb9a1('0x18')](_0x387752);}return _0x22888b[_0xb9a1('0x19')](_0x387752)[_0xb9a1('0x1a')]();};}function respondWithResult(_0x26999c,_0x34b1ef){_0x34b1ef=_0x34b1ef||0xc8;return function(_0x5201dd){if(_0x5201dd){return _0x26999c['status'](_0x34b1ef)[_0xb9a1('0x1b')](_0x5201dd);}};}function respondWithFilteredResult(_0x3addd0,_0x2d3ec8){return function(_0x3b7d9c){if(_0x3b7d9c){var _0x2374ab=typeof _0x2d3ec8[_0xb9a1('0x1c')]===_0xb9a1('0x1d')&&typeof _0x2d3ec8[_0xb9a1('0x1e')]===_0xb9a1('0x1d');var _0x41d4bf=_0x3b7d9c[_0xb9a1('0x1f')];var _0x3435b6=_0x2374ab?0x0:_0x2d3ec8['offset'];var _0x14cf47=_0x2374ab?_0x3b7d9c[_0xb9a1('0x1f')]:_0x2d3ec8[_0xb9a1('0x1c')]+_0x2d3ec8[_0xb9a1('0x1e')];var _0x568cc5;if(_0x14cf47>=_0x41d4bf){_0x14cf47=_0x41d4bf;_0x568cc5=0xc8;}else{_0x568cc5=0xce;}_0x3addd0[_0xb9a1('0x19')](_0x568cc5);return _0x3addd0[_0xb9a1('0x20')](_0xb9a1('0x21'),_0x3435b6+'-'+_0x14cf47+'/'+_0x41d4bf)['json'](_0x3b7d9c);}return null;};}function patchUpdates(_0x42a219){return function(_0x341e7a){try{jsonpatch['apply'](_0x341e7a,_0x42a219,!![]);}catch(_0x4b9815){return BPromise[_0xb9a1('0x22')](_0x4b9815);}return _0x341e7a[_0xb9a1('0x23')]();};}function saveUpdates(_0x3f8ef5,_0x17fbe5){return function(_0x2c33df){if(_0x2c33df){return _0x2c33df[_0xb9a1('0x24')](_0x3f8ef5)[_0xb9a1('0x25')](function(_0x45525c){return _0x45525c;});}return null;};}function removeEntity(_0x255f6b,_0x2db2f7){return function(_0x10f629){if(_0x10f629){return _0x10f629[_0xb9a1('0x26')]()[_0xb9a1('0x25')](function(){var _0x15d16d=_0x10f629[_0xb9a1('0x27')]({'plain':!![]});var _0x28c894=_0xb9a1('0x28');return db[_0xb9a1('0x29')]['destroy']({'where':{'type':_0x28c894,'resourceId':_0x15d16d['id']}})[_0xb9a1('0x25')](function(){return _0x10f629;});})[_0xb9a1('0x25')](function(){_0x255f6b['status'](0xcc)[_0xb9a1('0x1a')]();});}};}function handleEntityNotFound(_0x557d3a,_0x2cd634){return function(_0x1a13a1){if(!_0x1a13a1){_0x557d3a[_0xb9a1('0x18')](0x194);}return _0x1a13a1;};}function handleError(_0x22a6b3,_0x5d4fa7){_0x5d4fa7=_0x5d4fa7||0x1f4;return function(_0x54ad9b){logger[_0xb9a1('0x2a')](_0x54ad9b[_0xb9a1('0x2b')]);if(_0x54ad9b[_0xb9a1('0x2c')]){delete _0x54ad9b[_0xb9a1('0x2c')];}_0x22a6b3[_0xb9a1('0x19')](_0x5d4fa7)[_0xb9a1('0x2d')](_0x54ad9b);};}exports[_0xb9a1('0x2e')]=function(_0x2cb9a4,_0x3c0235){var _0x16cf78={},_0x40ea6a={},_0x39e0e3={'count':0x0,'rows':[]};var _0x1e3978=_[_0xb9a1('0x2f')](db[_0xb9a1('0x30')][_0xb9a1('0x31')],function(_0x56ff75){return{'name':_0x56ff75[_0xb9a1('0x32')],'type':_0x56ff75['type'][_0xb9a1('0x33')]};});_0x40ea6a[_0xb9a1('0x34')]=_['map'](_0x1e3978,'name');_0x40ea6a[_0xb9a1('0x35')]=_[_0xb9a1('0x36')](_0x2cb9a4[_0xb9a1('0x35')]);_0x40ea6a[_0xb9a1('0x37')]=_[_0xb9a1('0x38')](_0x40ea6a['model'],_0x40ea6a[_0xb9a1('0x35')]);_0x16cf78[_0xb9a1('0x39')]=_[_0xb9a1('0x38')](_0x40ea6a[_0xb9a1('0x34')],qs[_0xb9a1('0x3a')](_0x2cb9a4[_0xb9a1('0x35')][_0xb9a1('0x3a')]));_0x16cf78['attributes']=_0x16cf78[_0xb9a1('0x39')][_0xb9a1('0x3b')]?_0x16cf78[_0xb9a1('0x39')]:_0x40ea6a['model'];if(!_0x2cb9a4[_0xb9a1('0x35')]['hasOwnProperty'](_0xb9a1('0x3c'))){_0x16cf78['limit']=qs[_0xb9a1('0x1e')](_0x2cb9a4['query']['limit']);_0x16cf78[_0xb9a1('0x1c')]=qs[_0xb9a1('0x1c')](_0x2cb9a4['query'][_0xb9a1('0x1c')]);}_0x16cf78['order']=qs[_0xb9a1('0x3d')](_0x2cb9a4['query'][_0xb9a1('0x3d')]);_0x16cf78[_0xb9a1('0x3e')]=qs[_0xb9a1('0x37')](_[_0xb9a1('0x3f')](_0x2cb9a4[_0xb9a1('0x35')],_0x40ea6a[_0xb9a1('0x37')]),_0x1e3978);if(_0x2cb9a4[_0xb9a1('0x35')][_0xb9a1('0x40')]){_0x16cf78['where']=_[_0xb9a1('0x41')](_0x16cf78[_0xb9a1('0x3e')],{'$or':_[_0xb9a1('0x2f')](_0x1e3978,function(_0x11f3d3){if(_0x11f3d3[_0xb9a1('0x42')]!==_0xb9a1('0x43')){var _0x28c26e={};_0x28c26e[_0x11f3d3[_0xb9a1('0x2c')]]={'$like':'%'+_0x2cb9a4[_0xb9a1('0x35')][_0xb9a1('0x40')]+'%'};return _0x28c26e;}})});}_0x16cf78=_['merge']({},_0x16cf78,_0x2cb9a4['options']);var _0x276029={'where':_0x16cf78[_0xb9a1('0x3e')]};return db[_0xb9a1('0x30')][_0xb9a1('0x1f')](_0x276029)[_0xb9a1('0x25')](function(_0x290bf7){_0x39e0e3[_0xb9a1('0x1f')]=_0x290bf7;if(_0x2cb9a4[_0xb9a1('0x35')][_0xb9a1('0x44')]){_0x16cf78['include']=[{'all':!![]}];}return db[_0xb9a1('0x30')][_0xb9a1('0x45')](_0x16cf78);})['then'](function(_0x1ac74d){_0x39e0e3['rows']=_0x1ac74d;return _0x39e0e3;})[_0xb9a1('0x25')](respondWithFilteredResult(_0x3c0235,_0x16cf78))[_0xb9a1('0x46')](handleError(_0x3c0235,null));};exports[_0xb9a1('0x47')]=function(_0x55abfa,_0x8c49c6){var _0x2f7047={'raw':!![],'where':{'id':_0x55abfa['params']['id']}},_0x3f4746={};_0x3f4746[_0xb9a1('0x34')]=_[_0xb9a1('0x36')](db[_0xb9a1('0x30')]['rawAttributes']);_0x3f4746[_0xb9a1('0x35')]=_[_0xb9a1('0x36')](_0x55abfa[_0xb9a1('0x35')]);_0x3f4746[_0xb9a1('0x37')]=_[_0xb9a1('0x38')](_0x3f4746[_0xb9a1('0x34')],_0x3f4746[_0xb9a1('0x35')]);_0x2f7047[_0xb9a1('0x39')]=_[_0xb9a1('0x38')](_0x3f4746[_0xb9a1('0x34')],qs[_0xb9a1('0x3a')](_0x55abfa['query']['fields']));_0x2f7047[_0xb9a1('0x39')]=_0x2f7047[_0xb9a1('0x39')]['length']?_0x2f7047['attributes']:_0x3f4746[_0xb9a1('0x34')];if(_0x55abfa['query']['includeAll']){_0x2f7047['include']=[{'all':!![]}];}_0x2f7047=_[_0xb9a1('0x41')]({},_0x2f7047,_0x55abfa[_0xb9a1('0x48')]);return db[_0xb9a1('0x30')][_0xb9a1('0x49')](_0x2f7047)[_0xb9a1('0x25')](handleEntityNotFound(_0x8c49c6,null))['then'](respondWithResult(_0x8c49c6,null))[_0xb9a1('0x46')](handleError(_0x8c49c6,null));};exports[_0xb9a1('0x4a')]=function(_0x2d2502,_0x2911d9){return db[_0xb9a1('0x30')][_0xb9a1('0x4a')](_0x2d2502[_0xb9a1('0x4b')],{})['then'](function(_0x118f39){var _0xce44c2=_0x2d2502[_0xb9a1('0x4c')][_0xb9a1('0x27')]({'plain':!![]});if(!_0xce44c2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xce44c2[_0xb9a1('0x4d')]===_0xb9a1('0x4c')){var _0x50a9ee=_0x118f39['get']({'plain':!![]});var _0x34c9af='ExtractedReports';return db[_0xb9a1('0x4e')]['find']({'where':{'name':_0x34c9af,'userProfileId':_0xce44c2[_0xb9a1('0x4f')]},'raw':!![]})[_0xb9a1('0x25')](function(_0x13bb02){if(_0x13bb02&&_0x13bb02[_0xb9a1('0x50')]===0x0){return db[_0xb9a1('0x29')][_0xb9a1('0x4a')]({'name':_0x50a9ee[_0xb9a1('0x2c')],'resourceId':_0x50a9ee['id'],'type':_0x13bb02[_0xb9a1('0x2c')],'sectionId':_0x13bb02['id']},{})[_0xb9a1('0x25')](function(){return _0x118f39;});}else{return _0x118f39;}})[_0xb9a1('0x46')](function(_0x32dd27){logger['error'](_0xb9a1('0x51'),_0x32dd27);throw _0x32dd27;});}return _0x118f39;})[_0xb9a1('0x25')](respondWithResult(_0x2911d9,0xc9))[_0xb9a1('0x46')](handleError(_0x2911d9,null));};exports['update']=function(_0x5235fa,_0x1ba154){if(_0x5235fa[_0xb9a1('0x4b')]['id']){delete _0x5235fa[_0xb9a1('0x4b')]['id'];}return db[_0xb9a1('0x30')][_0xb9a1('0x49')]({'where':{'id':_0x5235fa[_0xb9a1('0x52')]['id']}})[_0xb9a1('0x25')](handleEntityNotFound(_0x1ba154,null))[_0xb9a1('0x25')](saveUpdates(_0x5235fa[_0xb9a1('0x4b')],null))[_0xb9a1('0x25')](respondWithResult(_0x1ba154,null))[_0xb9a1('0x46')](handleError(_0x1ba154,null));};exports[_0xb9a1('0x26')]=function(_0x1aacac,_0x536f5f){return db[_0xb9a1('0x30')][_0xb9a1('0x49')]({'where':{'id':_0x1aacac['params']['id']}})[_0xb9a1('0x25')](handleEntityNotFound(_0x536f5f,null))['then'](removeEntity(_0x536f5f,null))[_0xb9a1('0x46')](handleError(_0x536f5f,null));};exports[_0xb9a1('0x53')]=function(_0x9baac4,_0x42478b,_0x559ed0){return db[_0xb9a1('0x30')]['find']({'where':{'id':_0x9baac4['params']['id']},'attributes':[_0xb9a1('0x2c'),'basename',_0xb9a1('0x54'),_0xb9a1('0x55')],'raw':!![]})[_0xb9a1('0x25')](handleEntityNotFound(_0x42478b,null))[_0xb9a1('0x25')](function(_0x2e8304){if(_0x2e8304){if(!fs['existsSync'](path[_0xb9a1('0x56')](config[_0xb9a1('0x57')],_0xb9a1('0x58'),_0x2e8304[_0xb9a1('0x54')]))){throw new db[(_0xb9a1('0x59'))]['ValidationError'](_0xb9a1('0x5a'));}if(_0x9baac4[_0xb9a1('0x35')][_0xb9a1('0x5b')]){return _0x42478b[_0xb9a1('0x18')](0xc8);}return _0x42478b[_0xb9a1('0x53')](path[_0xb9a1('0x56')](config[_0xb9a1('0x57')],_0xb9a1('0x58'),_0x2e8304[_0xb9a1('0x54')]),util[_0xb9a1('0x5c')]('%s.%s',_0x2e8304[_0xb9a1('0x5d')]||_0x2e8304[_0xb9a1('0x2c')],_0x2e8304['output'][_0xb9a1('0x5e')]()));}})[_0xb9a1('0x46')](handleError(_0x42478b,null));}; \ No newline at end of file +var _0xd064=['end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','rows','catch','show','params','AnalyticExtractedReport','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','savename','output','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5566d9,_0x4f6d53){var _0x3833d2=function(_0x3b8d19){while(--_0x3b8d19){_0x5566d9['push'](_0x5566d9['shift']());}};_0x3833d2(++_0x4f6d53);}(_0xd064,0x1b8));var _0x4d06=function(_0x12f9e3,_0x3fadc1){_0x12f9e3=_0x12f9e3-0x0;var _0x2de0c8=_0xd064[_0x12f9e3];return _0x2de0c8;};'use strict';var emlformat=require(_0x4d06('0x0'));var rimraf=require(_0x4d06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d06('0x2'));var rp=require(_0x4d06('0x3'));var moment=require('moment');var BPromise=require(_0x4d06('0x4'));var Mustache=require(_0x4d06('0x5'));var util=require(_0x4d06('0x6'));var path=require(_0x4d06('0x7'));var sox=require('sox');var csv=require(_0x4d06('0x8'));var ejs=require(_0x4d06('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d06('0xa'));var squel=require(_0x4d06('0xb'));var crypto=require(_0x4d06('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4d06('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4d06('0xe'));var Redis=require(_0x4d06('0xf'));var authService=require(_0x4d06('0x10'));var qs=require(_0x4d06('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d06('0x12'))(_0x4d06('0x13'));var utils=require('../../config/utils');var config=require(_0x4d06('0x14'));var licenseUtil=require(_0x4d06('0x15'));var db=require(_0x4d06('0x16'))['db'];function respondWithStatusCode(_0x3ec18c,_0x84c6c5){_0x84c6c5=_0x84c6c5||0xcc;return function(_0x4347ce){if(_0x4347ce){return _0x3ec18c[_0x4d06('0x17')](_0x84c6c5);}return _0x3ec18c[_0x4d06('0x18')](_0x84c6c5)[_0x4d06('0x19')]();};}function respondWithResult(_0x2df571,_0xc476fa){_0xc476fa=_0xc476fa||0xc8;return function(_0x5ed61c){if(_0x5ed61c){return _0x2df571[_0x4d06('0x18')](_0xc476fa)[_0x4d06('0x1a')](_0x5ed61c);}};}function respondWithFilteredResult(_0x31d23a,_0x45c150){return function(_0x21df17){if(_0x21df17){var _0x4c33eb=typeof _0x45c150[_0x4d06('0x1b')]===_0x4d06('0x1c')&&typeof _0x45c150[_0x4d06('0x1d')]===_0x4d06('0x1c');var _0x57847e=_0x21df17[_0x4d06('0x1e')];var _0x5a6353=_0x4c33eb?0x0:_0x45c150[_0x4d06('0x1b')];var _0x267eeb=_0x4c33eb?_0x21df17['count']:_0x45c150['offset']+_0x45c150[_0x4d06('0x1d')];var _0x368827;if(_0x267eeb>=_0x57847e){_0x267eeb=_0x57847e;_0x368827=0xc8;}else{_0x368827=0xce;}_0x31d23a[_0x4d06('0x18')](_0x368827);return _0x31d23a['set'](_0x4d06('0x1f'),_0x5a6353+'-'+_0x267eeb+'/'+_0x57847e)[_0x4d06('0x1a')](_0x21df17);}return null;};}function patchUpdates(_0x24ea44){return function(_0x490332){try{jsonpatch['apply'](_0x490332,_0x24ea44,!![]);}catch(_0x535596){return BPromise[_0x4d06('0x20')](_0x535596);}return _0x490332[_0x4d06('0x21')]();};}function saveUpdates(_0xf5117b,_0x45c732){return function(_0x197d5f){if(_0x197d5f){return _0x197d5f['update'](_0xf5117b)[_0x4d06('0x22')](function(_0xcbcc19){return _0xcbcc19;});}return null;};}function removeEntity(_0x5b53e4,_0xd8cd61){return function(_0x14bc2e){if(_0x14bc2e){return _0x14bc2e[_0x4d06('0x23')]()['then'](function(){var _0x3206b4=_0x14bc2e['get']({'plain':!![]});var _0x5e6ac9=_0x4d06('0x24');return db[_0x4d06('0x25')]['destroy']({'where':{'type':_0x5e6ac9,'resourceId':_0x3206b4['id']}})['then'](function(){return _0x14bc2e;});})[_0x4d06('0x22')](function(){_0x5b53e4['status'](0xcc)[_0x4d06('0x19')]();});}};}function handleEntityNotFound(_0x512c72,_0xe21003){return function(_0xe126a){if(!_0xe126a){_0x512c72['sendStatus'](0x194);}return _0xe126a;};}function handleError(_0x5228e6,_0x31c6af){_0x31c6af=_0x31c6af||0x1f4;return function(_0x57955f){logger[_0x4d06('0x26')](_0x57955f[_0x4d06('0x27')]);if(_0x57955f['name']){delete _0x57955f[_0x4d06('0x28')];}_0x5228e6['status'](_0x31c6af)[_0x4d06('0x29')](_0x57955f);};}exports[_0x4d06('0x2a')]=function(_0x273086,_0x2af365){var _0x443324={},_0x5bcf4d={},_0x48758f={'count':0x0,'rows':[]};var _0x4f0ff1=_[_0x4d06('0x2b')](db['AnalyticExtractedReport'][_0x4d06('0x2c')],function(_0xf4135e){return{'name':_0xf4135e[_0x4d06('0x2d')],'type':_0xf4135e['type'][_0x4d06('0x2e')]};});_0x5bcf4d[_0x4d06('0x2f')]=_[_0x4d06('0x2b')](_0x4f0ff1,_0x4d06('0x28'));_0x5bcf4d[_0x4d06('0x30')]=_[_0x4d06('0x31')](_0x273086[_0x4d06('0x30')]);_0x5bcf4d[_0x4d06('0x32')]=_[_0x4d06('0x33')](_0x5bcf4d[_0x4d06('0x2f')],_0x5bcf4d['query']);_0x443324[_0x4d06('0x34')]=_['intersection'](_0x5bcf4d[_0x4d06('0x2f')],qs[_0x4d06('0x35')](_0x273086[_0x4d06('0x30')][_0x4d06('0x35')]));_0x443324[_0x4d06('0x34')]=_0x443324[_0x4d06('0x34')][_0x4d06('0x36')]?_0x443324[_0x4d06('0x34')]:_0x5bcf4d['model'];if(!_0x273086[_0x4d06('0x30')][_0x4d06('0x37')](_0x4d06('0x38'))){_0x443324[_0x4d06('0x1d')]=qs[_0x4d06('0x1d')](_0x273086[_0x4d06('0x30')][_0x4d06('0x1d')]);_0x443324[_0x4d06('0x1b')]=qs[_0x4d06('0x1b')](_0x273086[_0x4d06('0x30')][_0x4d06('0x1b')]);}_0x443324['order']=qs['sort'](_0x273086['query']['sort']);_0x443324[_0x4d06('0x39')]=qs[_0x4d06('0x32')](_[_0x4d06('0x3a')](_0x273086[_0x4d06('0x30')],_0x5bcf4d[_0x4d06('0x32')]),_0x4f0ff1);if(_0x273086[_0x4d06('0x30')][_0x4d06('0x3b')]){_0x443324[_0x4d06('0x39')]=_[_0x4d06('0x3c')](_0x443324[_0x4d06('0x39')],{'$or':_[_0x4d06('0x2b')](_0x4f0ff1,function(_0x2d5450){if(_0x2d5450[_0x4d06('0x3d')]!==_0x4d06('0x3e')){var _0x2e224d={};_0x2e224d[_0x2d5450[_0x4d06('0x28')]]={'$like':'%'+_0x273086['query'][_0x4d06('0x3b')]+'%'};return _0x2e224d;}})});}_0x443324=_['merge']({},_0x443324,_0x273086[_0x4d06('0x3f')]);var _0x11ca03={'where':_0x443324[_0x4d06('0x39')]};return db['AnalyticExtractedReport']['count'](_0x11ca03)[_0x4d06('0x22')](function(_0x516e59){_0x48758f[_0x4d06('0x1e')]=_0x516e59;if(_0x273086[_0x4d06('0x30')]['includeAll']){_0x443324['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x443324);})[_0x4d06('0x22')](function(_0x256558){_0x48758f[_0x4d06('0x40')]=_0x256558;return _0x48758f;})[_0x4d06('0x22')](respondWithFilteredResult(_0x2af365,_0x443324))[_0x4d06('0x41')](handleError(_0x2af365,null));};exports[_0x4d06('0x42')]=function(_0xf69081,_0x281e23){var _0x4a1966={'raw':!![],'where':{'id':_0xf69081[_0x4d06('0x43')]['id']}},_0x1c6fdb={};_0x1c6fdb[_0x4d06('0x2f')]=_[_0x4d06('0x31')](db[_0x4d06('0x44')][_0x4d06('0x2c')]);_0x1c6fdb[_0x4d06('0x30')]=_[_0x4d06('0x31')](_0xf69081[_0x4d06('0x30')]);_0x1c6fdb[_0x4d06('0x32')]=_[_0x4d06('0x33')](_0x1c6fdb['model'],_0x1c6fdb['query']);_0x4a1966[_0x4d06('0x34')]=_['intersection'](_0x1c6fdb[_0x4d06('0x2f')],qs[_0x4d06('0x35')](_0xf69081[_0x4d06('0x30')]['fields']));_0x4a1966[_0x4d06('0x34')]=_0x4a1966[_0x4d06('0x34')][_0x4d06('0x36')]?_0x4a1966[_0x4d06('0x34')]:_0x1c6fdb['model'];if(_0xf69081[_0x4d06('0x30')][_0x4d06('0x45')]){_0x4a1966[_0x4d06('0x46')]=[{'all':!![]}];}_0x4a1966=_[_0x4d06('0x3c')]({},_0x4a1966,_0xf69081['options']);return db[_0x4d06('0x44')][_0x4d06('0x47')](_0x4a1966)[_0x4d06('0x22')](handleEntityNotFound(_0x281e23,null))[_0x4d06('0x22')](respondWithResult(_0x281e23,null))[_0x4d06('0x41')](handleError(_0x281e23,null));};exports[_0x4d06('0x48')]=function(_0x1185c5,_0x362c6f){return db[_0x4d06('0x44')][_0x4d06('0x48')](_0x1185c5[_0x4d06('0x49')],{})[_0x4d06('0x22')](function(_0x10a004){var _0x53a70c=_0x1185c5[_0x4d06('0x4a')][_0x4d06('0x4b')]({'plain':!![]});if(!_0x53a70c)throw new Error(_0x4d06('0x4c'));if(_0x53a70c[_0x4d06('0x4d')]==='user'){var _0x594969=_0x10a004[_0x4d06('0x4b')]({'plain':!![]});var _0x439d29=_0x4d06('0x24');return db[_0x4d06('0x4e')][_0x4d06('0x47')]({'where':{'name':_0x439d29,'userProfileId':_0x53a70c['userProfileId']},'raw':!![]})[_0x4d06('0x22')](function(_0x54be61){if(_0x54be61&&_0x54be61[_0x4d06('0x4f')]===0x0){return db[_0x4d06('0x25')][_0x4d06('0x48')]({'name':_0x594969[_0x4d06('0x28')],'resourceId':_0x594969['id'],'type':_0x54be61[_0x4d06('0x28')],'sectionId':_0x54be61['id']},{})[_0x4d06('0x22')](function(){return _0x10a004;});}else{return _0x10a004;}})[_0x4d06('0x41')](function(_0x1affbe){logger[_0x4d06('0x26')](_0x4d06('0x50'),_0x1affbe);throw _0x1affbe;});}return _0x10a004;})['then'](respondWithResult(_0x362c6f,0xc9))[_0x4d06('0x41')](handleError(_0x362c6f,null));};exports[_0x4d06('0x51')]=function(_0x1a7efa,_0x3f74dd){if(_0x1a7efa[_0x4d06('0x49')]['id']){delete _0x1a7efa['body']['id'];}return db[_0x4d06('0x44')][_0x4d06('0x47')]({'where':{'id':_0x1a7efa[_0x4d06('0x43')]['id']}})[_0x4d06('0x22')](handleEntityNotFound(_0x3f74dd,null))['then'](saveUpdates(_0x1a7efa['body'],null))[_0x4d06('0x22')](respondWithResult(_0x3f74dd,null))['catch'](handleError(_0x3f74dd,null));};exports[_0x4d06('0x23')]=function(_0x44a1e3,_0x10f650){return db['AnalyticExtractedReport'][_0x4d06('0x47')]({'where':{'id':_0x44a1e3['params']['id']}})['then'](handleEntityNotFound(_0x10f650,null))['then'](removeEntity(_0x10f650,null))[_0x4d06('0x41')](handleError(_0x10f650,null));};exports['download']=function(_0x553ebb,_0x5d45fe,_0x577634){return db[_0x4d06('0x44')][_0x4d06('0x47')]({'where':{'id':_0x553ebb[_0x4d06('0x43')]['id']},'attributes':[_0x4d06('0x28'),_0x4d06('0x52'),_0x4d06('0x53'),_0x4d06('0x54')],'raw':!![]})[_0x4d06('0x22')](handleEntityNotFound(_0x5d45fe,null))['then'](function(_0xc68a1e){if(_0xc68a1e){if(!fs['existsSync'](path[_0x4d06('0x55')](config[_0x4d06('0x56')],_0x4d06('0x57'),_0xc68a1e[_0x4d06('0x53')]))){throw new db['Sequelize']['ValidationError'](_0x4d06('0x58'));}if(_0x553ebb['query']['exists']){return _0x5d45fe[_0x4d06('0x17')](0xc8);}return _0x5d45fe[_0x4d06('0x59')](path[_0x4d06('0x55')](config['root'],'server/files/reports',_0xc68a1e[_0x4d06('0x53')]),util[_0x4d06('0x5a')](_0x4d06('0x5b'),_0xc68a1e[_0x4d06('0x52')]||_0xc68a1e[_0x4d06('0x28')],_0xc68a1e[_0x4d06('0x54')][_0x4d06('0x5c')]()));}})[_0x4d06('0x41')](handleError(_0x5d45fe,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b2f6dbb..3b87e75 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 _0x6a9b=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2837e9,_0x11134d){var _0x50632b=function(_0x2f2f55){while(--_0x2f2f55){_0x2837e9['push'](_0x2837e9['shift']());}};_0x50632b(++_0x11134d);}(_0x6a9b,0x68));var _0xb6a9=function(_0x45b9c6,_0x1ec45c){_0x45b9c6=_0x45b9c6-0x0;var _0xfc724e=_0x6a9b[_0x45b9c6];return _0xfc724e;};'use strict';var _=require(_0xb6a9('0x0'));var util=require(_0xb6a9('0x1'));var logger=require(_0xb6a9('0x2'))(_0xb6a9('0x3'));var moment=require(_0xb6a9('0x4'));var BPromise=require(_0xb6a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6a9('0x6'));var rimraf=require(_0xb6a9('0x7'));var config=require(_0xb6a9('0x8'));var attributes=require(_0xb6a9('0x9'));module[_0xb6a9('0xa')]=function(_0x302a3a,_0x19c42f){return _0x302a3a[_0xb6a9('0xb')](_0xb6a9('0xc'),attributes,{'tableName':_0xb6a9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe72b=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0xe72b,0x6a));var _0xbe72=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0xe72b[_0x55c1f0];return _0x1530fa;};'use strict';var _=require(_0xbe72('0x0'));var util=require(_0xbe72('0x1'));var logger=require(_0xbe72('0x2'))(_0xbe72('0x3'));var moment=require(_0xbe72('0x4'));var BPromise=require(_0xbe72('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbe72('0x6'));var config=require(_0xbe72('0x7'));var attributes=require(_0xbe72('0x8'));module[_0xbe72('0x9')]=function(_0x4109e2,_0x5b1040){return _0x4109e2[_0xbe72('0xa')](_0xbe72('0xb'),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 9e7e222..1d6eb60 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 _0x20c6=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2acfe6,_0x499e98){var _0x3e0731=function(_0x502be0){while(--_0x502be0){_0x2acfe6['push'](_0x2acfe6['shift']());}};_0x3e0731(++_0x499e98);}(_0x20c6,0xb8));var _0x620c=function(_0x25a6a7,_0x1986cb){_0x25a6a7=_0x25a6a7-0x0;var _0x20cfd1=_0x20c6[_0x25a6a7];return _0x20cfd1;};'use strict';var _=require(_0x620c('0x0'));var util=require(_0x620c('0x1'));var moment=require(_0x620c('0x2'));var BPromise=require(_0x620c('0x3'));var rs=require(_0x620c('0x4'));var fs=require('fs');var Redis=require(_0x620c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x620c('0x6'));var logger=require(_0x620c('0x7'))('rpc');var config=require(_0x620c('0x8'));var jayson=require(_0x620c('0x9'));var client=jayson[_0x620c('0xa')][_0x620c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x351b9f,_0x4f28d1,_0x36f522){return new BPromise(function(_0x544725,_0x66d8f3){return client[_0x620c('0xc')](_0x351b9f,_0x36f522)[_0x620c('0xd')](function(_0x991a3){logger[_0x620c('0xe')](_0x620c('0xf'),_0x4f28d1,'request\x20sent');logger[_0x620c('0x10')](_0x620c('0x11'),_0x4f28d1,'request\x20sent',JSON[_0x620c('0x12')](_0x991a3));if(_0x991a3[_0x620c('0x13')]){if(_0x991a3[_0x620c('0x13')][_0x620c('0x14')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4f28d1,_0x991a3[_0x620c('0x13')][_0x620c('0x15')]);return _0x66d8f3(_0x991a3['error'][_0x620c('0x15')]);}logger[_0x620c('0x13')](_0x620c('0xf'),_0x4f28d1,_0x991a3['error'][_0x620c('0x15')]);return _0x544725(_0x991a3[_0x620c('0x13')]['message']);}else{logger[_0x620c('0xe')](_0x620c('0xf'),_0x4f28d1,'request\x20sent');_0x544725(_0x991a3[_0x620c('0x16')][_0x620c('0x15')]);}})[_0x620c('0x17')](function(_0x4db890){logger[_0x620c('0x13')](_0x620c('0xf'),_0x4f28d1,_0x4db890);_0x66d8f3(_0x4db890);});});} \ No newline at end of file +var _0x04b0=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x04b0,0x7f));var _0x004b=function(_0x1a916c,_0xfe37a8){_0x1a916c=_0x1a916c-0x0;var _0x3fd446=_0x04b0[_0x1a916c];return _0x3fd446;};'use strict';var _=require('lodash');var util=require(_0x004b('0x0'));var moment=require(_0x004b('0x1'));var BPromise=require(_0x004b('0x2'));var rs=require(_0x004b('0x3'));var fs=require('fs');var Redis=require(_0x004b('0x4'));var db=require(_0x004b('0x5'))['db'];var utils=require(_0x004b('0x6'));var logger=require(_0x004b('0x7'))(_0x004b('0x8'));var config=require(_0x004b('0x9'));var jayson=require(_0x004b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x502026,_0x35dcac,_0x408c83){return new BPromise(function(_0x39f95d,_0x32c16a){return client[_0x004b('0xb')](_0x502026,_0x408c83)[_0x004b('0xc')](function(_0x529591){logger[_0x004b('0xd')](_0x004b('0xe'),_0x35dcac,_0x004b('0xf'));logger[_0x004b('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x35dcac,_0x004b('0xf'),JSON['stringify'](_0x529591));if(_0x529591[_0x004b('0x11')]){if(_0x529591[_0x004b('0x11')]['code']===0x1f4){logger[_0x004b('0x11')](_0x004b('0xe'),_0x35dcac,_0x529591[_0x004b('0x11')]['message']);return _0x32c16a(_0x529591[_0x004b('0x11')][_0x004b('0x12')]);}logger[_0x004b('0x11')](_0x004b('0xe'),_0x35dcac,_0x529591[_0x004b('0x11')][_0x004b('0x12')]);return _0x39f95d(_0x529591[_0x004b('0x11')]['message']);}else{logger[_0x004b('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35dcac,'request\x20sent');_0x39f95d(_0x529591[_0x004b('0x13')]['message']);}})[_0x004b('0x14')](function(_0x4184e2){logger[_0x004b('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35dcac,_0x4184e2);_0x32c16a(_0x4184e2);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 64efe60..1038fe5 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 _0x9e66=['path','connect-timeout','express','Router','fs-extra','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4f5b2e,_0x3ef982){var _0x404622=function(_0x5b057c){while(--_0x5b057c){_0x4f5b2e['push'](_0x4f5b2e['shift']());}};_0x404622(++_0x3ef982);}(_0x9e66,0x1a2));var _0x69e6=function(_0x687c2a,_0x20f9d1){_0x687c2a=_0x687c2a-0x0;var _0x1858c0=_0x9e66[_0x687c2a];return _0x1858c0;};'use strict';var multer=require(_0x69e6('0x0'));var util=require(_0x69e6('0x1'));var path=require(_0x69e6('0x2'));var timeout=require(_0x69e6('0x3'));var express=require(_0x69e6('0x4'));var router=express[_0x69e6('0x5')]();var fs_extra=require(_0x69e6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x69e6('0x7'));router[_0x69e6('0x8')]('/',auth['isAuthenticated'](),controller[_0x69e6('0x9')]);router['get'](_0x69e6('0xa'),auth[_0x69e6('0xb')](),controller['show']);router[_0x69e6('0x8')](_0x69e6('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x69e6('0xd')]('/',auth['isAuthenticated'](),controller[_0x69e6('0xe')]);router[_0x69e6('0xf')](_0x69e6('0xa'),auth[_0x69e6('0xb')](),controller[_0x69e6('0x10')]);router[_0x69e6('0x11')](_0x69e6('0xa'),auth[_0x69e6('0xb')](),controller[_0x69e6('0x12')]);module[_0x69e6('0x13')]=router; \ No newline at end of file +var _0xf26a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','/:id/download','download','post','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x2871c9,_0x4f9a78){var _0x596ac2=function(_0xe80a9a){while(--_0xe80a9a){_0x2871c9['push'](_0x2871c9['shift']());}};_0x596ac2(++_0x4f9a78);}(_0xf26a,0x163));var _0xaf26=function(_0xaa1f0,_0x501559){_0xaa1f0=_0xaa1f0-0x0;var _0x1f90d2=_0xf26a[_0xaa1f0];return _0x1f90d2;};'use strict';var multer=require('multer');var util=require(_0xaf26('0x0'));var path=require(_0xaf26('0x1'));var timeout=require(_0xaf26('0x2'));var express=require(_0xaf26('0x3'));var router=express[_0xaf26('0x4')]();var fs_extra=require(_0xaf26('0x5'));var auth=require(_0xaf26('0x6'));var interaction=require(_0xaf26('0x7'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0xaf26('0x8')]('/',auth['isAuthenticated'](),controller[_0xaf26('0x9')]);router[_0xaf26('0x8')]('/:id',auth[_0xaf26('0xa')](),controller[_0xaf26('0xb')]);router[_0xaf26('0x8')](_0xaf26('0xc'),auth[_0xaf26('0xa')](),controller[_0xaf26('0xd')]);router[_0xaf26('0xe')]('/',auth[_0xaf26('0xa')](),controller['create']);router[_0xaf26('0xf')](_0xaf26('0x10'),auth['isAuthenticated'](),controller[_0xaf26('0x11')]);router[_0xaf26('0x12')]('/:id',auth[_0xaf26('0xa')](),controller[_0xaf26('0x13')]);module[_0xaf26('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 84bf283..04d0b63 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 _0x009b=['STRING','BOOLEAN','sequelize'];(function(_0x4cd054,_0x167ed4){var _0x32808a=function(_0x496212){while(--_0x496212){_0x4cd054['push'](_0x4cd054['shift']());}};_0x32808a(++_0x167ed4);}(_0x009b,0x1be));var _0xb009=function(_0x3c536d,_0x2cce6c){_0x3c536d=_0x3c536d-0x0;var _0x57b088=_0x009b[_0x3c536d];return _0x57b088;};'use strict';var Sequelize=require(_0xb009('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xb009('0x1')]},'function':{'type':Sequelize[_0xb009('0x1')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xb009('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb009('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4138=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x4138,0x168));var _0x8413=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4138[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x8413('0x0'));module[_0x8413('0x1')]={'field':{'type':Sequelize[_0x8413('0x2')]},'alias':{'type':Sequelize[_0x8413('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x8413('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'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 c390dcb..8d70ea1 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 _0x29d8=['../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x3ea36a,_0x418619){var _0x4cf1e2=function(_0x8f00a9){while(--_0x8f00a9){_0x3ea36a['push'](_0x3ea36a['shift']());}};_0x4cf1e2(++_0x418619);}(_0x29d8,0x8f));var _0x829d=function(_0x310bef,_0x38797c){_0x310bef=_0x310bef-0x0;var _0x59716f=_0x29d8[_0x310bef];return _0x59716f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x829d('0x0'));var zipdir=require(_0x829d('0x1'));var jsonpatch=require(_0x829d('0x2'));var rp=require(_0x829d('0x3'));var moment=require(_0x829d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x829d('0x5'));var util=require(_0x829d('0x6'));var path=require(_0x829d('0x7'));var sox=require(_0x829d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x829d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x829d('0xa'));var jsforce=require(_0x829d('0xb'));var deskjs=require(_0x829d('0xc'));var toCsv=require(_0x829d('0xd'));var querystring=require(_0x829d('0xe'));var Papa=require(_0x829d('0xf'));var Redis=require('ioredis');var authService=require(_0x829d('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x829d('0x11'))(_0x829d('0x12'));var utils=require('../../config/utils');var config=require(_0x829d('0x13'));var licenseUtil=require(_0x829d('0x14'));var db=require(_0x829d('0x15'))['db'];function respondWithStatusCode(_0x48b15b,_0x2a10c3){_0x2a10c3=_0x2a10c3||0xcc;return function(_0x32cc65){if(_0x32cc65){return _0x48b15b[_0x829d('0x16')](_0x2a10c3);}return _0x48b15b['status'](_0x2a10c3)[_0x829d('0x17')]();};}function respondWithResult(_0x5c0dcb,_0x1fb437){_0x1fb437=_0x1fb437||0xc8;return function(_0x32f712){if(_0x32f712){return _0x5c0dcb[_0x829d('0x18')](_0x1fb437)[_0x829d('0x19')](_0x32f712);}};}function respondWithFilteredResult(_0x58e002,_0x4053c8){return function(_0x220cbe){if(_0x220cbe){var _0x55606b=typeof _0x4053c8[_0x829d('0x1a')]==='undefined'&&typeof _0x4053c8['limit']===_0x829d('0x1b');var _0x26b86b=_0x220cbe[_0x829d('0x1c')];var _0x16fdc0=_0x55606b?0x0:_0x4053c8[_0x829d('0x1a')];var _0x41218b=_0x55606b?_0x220cbe[_0x829d('0x1c')]:_0x4053c8[_0x829d('0x1a')]+_0x4053c8['limit'];var _0xc84caa;if(_0x41218b>=_0x26b86b){_0x41218b=_0x26b86b;_0xc84caa=0xc8;}else{_0xc84caa=0xce;}_0x58e002[_0x829d('0x18')](_0xc84caa);return _0x58e002[_0x829d('0x1d')](_0x829d('0x1e'),_0x16fdc0+'-'+_0x41218b+'/'+_0x26b86b)[_0x829d('0x19')](_0x220cbe);}return null;};}function patchUpdates(_0x4dc53a){return function(_0x521121){try{jsonpatch['apply'](_0x521121,_0x4dc53a,!![]);}catch(_0x4a289d){return BPromise[_0x829d('0x1f')](_0x4a289d);}return _0x521121[_0x829d('0x20')]();};}function saveUpdates(_0x3a9e40,_0x148995){return function(_0x2d3474){if(_0x2d3474){return _0x2d3474[_0x829d('0x21')](_0x3a9e40)[_0x829d('0x22')](function(_0xa1131f){return _0xa1131f;});}return null;};}function removeEntity(_0x42fed9,_0x3c615a){return function(_0x519fd3){if(_0x519fd3){return _0x519fd3[_0x829d('0x23')]()[_0x829d('0x22')](function(){_0x42fed9['status'](0xcc)[_0x829d('0x17')]();});}};}function handleEntityNotFound(_0x96eda,_0x4feda9){return function(_0xe7e431){if(!_0xe7e431){_0x96eda['sendStatus'](0x194);}return _0xe7e431;};}function handleError(_0x40ce3f,_0x58e682){_0x58e682=_0x58e682||0x1f4;return function(_0x50af39){logger[_0x829d('0x24')](_0x50af39['stack']);if(_0x50af39[_0x829d('0x25')]){delete _0x50af39[_0x829d('0x25')];}_0x40ce3f[_0x829d('0x18')](_0x58e682)[_0x829d('0x26')](_0x50af39);};}exports[_0x829d('0x27')]=function(_0x444b01,_0x34492d){var _0x4b802e={},_0x2d9e02={},_0x222ea5={'count':0x0,'rows':[]};var _0x5c17c9=_[_0x829d('0x28')](db[_0x829d('0x29')][_0x829d('0x2a')],function(_0x2c96d9){return{'name':_0x2c96d9[_0x829d('0x2b')],'type':_0x2c96d9[_0x829d('0x2c')][_0x829d('0x2d')]};});_0x2d9e02[_0x829d('0x2e')]=_[_0x829d('0x28')](_0x5c17c9,_0x829d('0x25'));_0x2d9e02[_0x829d('0x2f')]=_[_0x829d('0x30')](_0x444b01['query']);_0x2d9e02[_0x829d('0x31')]=_[_0x829d('0x32')](_0x2d9e02[_0x829d('0x2e')],_0x2d9e02[_0x829d('0x2f')]);_0x4b802e[_0x829d('0x33')]=_[_0x829d('0x32')](_0x2d9e02[_0x829d('0x2e')],qs[_0x829d('0x34')](_0x444b01[_0x829d('0x2f')][_0x829d('0x34')]));_0x4b802e[_0x829d('0x33')]=_0x4b802e[_0x829d('0x33')][_0x829d('0x35')]?_0x4b802e[_0x829d('0x33')]:_0x2d9e02[_0x829d('0x2e')];if(!_0x444b01[_0x829d('0x2f')][_0x829d('0x36')](_0x829d('0x37'))){_0x4b802e[_0x829d('0x38')]=qs[_0x829d('0x38')](_0x444b01[_0x829d('0x2f')][_0x829d('0x38')]);_0x4b802e['offset']=qs[_0x829d('0x1a')](_0x444b01[_0x829d('0x2f')]['offset']);}_0x4b802e[_0x829d('0x39')]=qs[_0x829d('0x3a')](_0x444b01[_0x829d('0x2f')]['sort']);_0x4b802e[_0x829d('0x3b')]=qs[_0x829d('0x31')](_['pick'](_0x444b01[_0x829d('0x2f')],_0x2d9e02['filters']),_0x5c17c9);if(_0x444b01[_0x829d('0x2f')]['filter']){_0x4b802e[_0x829d('0x3b')]=_[_0x829d('0x3c')](_0x4b802e[_0x829d('0x3b')],{'$or':_[_0x829d('0x28')](_0x5c17c9,function(_0x302793){if(_0x302793[_0x829d('0x2c')]!==_0x829d('0x3d')){var _0x54a421={};_0x54a421[_0x302793[_0x829d('0x25')]]={'$like':'%'+_0x444b01[_0x829d('0x2f')][_0x829d('0x3e')]+'%'};return _0x54a421;}})});}_0x4b802e=_[_0x829d('0x3c')]({},_0x4b802e,_0x444b01[_0x829d('0x3f')]);var _0x3edac1={'where':_0x4b802e[_0x829d('0x3b')]};return db['AnalyticFieldReport'][_0x829d('0x1c')](_0x3edac1)[_0x829d('0x22')](function(_0x23e003){_0x222ea5[_0x829d('0x1c')]=_0x23e003;if(_0x444b01[_0x829d('0x2f')][_0x829d('0x40')]){_0x4b802e[_0x829d('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x829d('0x42')](_0x4b802e);})[_0x829d('0x22')](function(_0x4d8699){_0x222ea5['rows']=_0x4d8699;return _0x222ea5;})[_0x829d('0x22')](respondWithFilteredResult(_0x34492d,_0x4b802e))[_0x829d('0x43')](handleError(_0x34492d,null));};exports[_0x829d('0x44')]=function(_0x3d8086,_0x2fbed1){var _0x49ec85={'raw':![],'where':{'id':_0x3d8086[_0x829d('0x45')]['id']}},_0x4ae37f={};_0x4ae37f[_0x829d('0x2e')]=_[_0x829d('0x30')](db[_0x829d('0x29')][_0x829d('0x2a')]);_0x4ae37f['query']=_[_0x829d('0x30')](_0x3d8086[_0x829d('0x2f')]);_0x4ae37f[_0x829d('0x31')]=_[_0x829d('0x32')](_0x4ae37f[_0x829d('0x2e')],_0x4ae37f[_0x829d('0x2f')]);_0x49ec85[_0x829d('0x33')]=_[_0x829d('0x32')](_0x4ae37f[_0x829d('0x2e')],qs[_0x829d('0x34')](_0x3d8086[_0x829d('0x2f')][_0x829d('0x34')]));_0x49ec85[_0x829d('0x33')]=_0x49ec85[_0x829d('0x33')][_0x829d('0x35')]?_0x49ec85[_0x829d('0x33')]:_0x4ae37f[_0x829d('0x2e')];if(_0x3d8086[_0x829d('0x2f')]['includeAll']){_0x49ec85[_0x829d('0x41')]=[{'all':!![]}];}_0x49ec85=_['merge']({},_0x49ec85,_0x3d8086[_0x829d('0x3f')]);return db[_0x829d('0x29')][_0x829d('0x46')](_0x49ec85)[_0x829d('0x22')](handleEntityNotFound(_0x2fbed1,null))[_0x829d('0x22')](respondWithResult(_0x2fbed1,null))['catch'](handleError(_0x2fbed1,null));};exports[_0x829d('0x47')]=function(_0x270031,_0x4efb63){return db[_0x829d('0x29')][_0x829d('0x47')](_0x270031[_0x829d('0x48')],{})[_0x829d('0x22')](respondWithResult(_0x4efb63,0xc9))[_0x829d('0x43')](handleError(_0x4efb63,null));};exports[_0x829d('0x49')]=function(_0x45150f,_0x30756d){return db[_0x829d('0x29')]['bulkCreate'](_0x45150f[_0x829d('0x48')],{'raw':![],'individualHooks':!![]})[_0x829d('0x22')](respondWithResult(_0x30756d,0xc9))[_0x829d('0x43')](handleError(_0x30756d,null));};exports[_0x829d('0x21')]=function(_0x286134,_0x23fa8e){if(_0x286134['body']['id']){delete _0x286134[_0x829d('0x48')]['id'];}return db[_0x829d('0x29')][_0x829d('0x46')]({'where':{'id':_0x286134[_0x829d('0x45')]['id']}})[_0x829d('0x22')](handleEntityNotFound(_0x23fa8e,null))[_0x829d('0x22')](saveUpdates(_0x286134[_0x829d('0x48')],null))['then'](respondWithResult(_0x23fa8e,null))[_0x829d('0x43')](handleError(_0x23fa8e,null));};exports[_0x829d('0x23')]=function(_0x26148a,_0x8237d2){return db[_0x829d('0x29')][_0x829d('0x46')]({'where':{'id':_0x26148a[_0x829d('0x45')]['id']}})[_0x829d('0x22')](handleEntityNotFound(_0x8237d2,null))[_0x829d('0x22')](removeEntity(_0x8237d2,null))['catch'](handleError(_0x8237d2,null));};exports[_0x829d('0x4a')]=function(_0x3757c6,_0x2d286e){return db[_0x829d('0x29')]['destroy']({'where':{'id':_0x3757c6[_0x829d('0x2f')][_0x829d('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2d286e,0xcc))[_0x829d('0x43')](handleError(_0x2d286e,null));};exports[_0x829d('0x4c')]=function(_0x69e161,_0x58d51a,_0x1df97d){return db[_0x829d('0x4d')][_0x829d('0x4e')]({'where':{'id':_0x69e161['params']['id']}})[_0x829d('0x22')](handleEntityNotFound(_0x58d51a,null))[_0x829d('0x22')](function(_0x225e37){if(_0x225e37){return db[_0x829d('0x4f')][_0x829d('0x50')](function(_0xd511d7){return db['AnalyticFieldReport'][_0x829d('0x23')]({'where':{'CustomReportId':_0x69e161[_0x829d('0x45')]['id']},'transaction':_0xd511d7})[_0x829d('0x22')](function(_0x3ab999){var _0x5c2018=_[_0x829d('0x28')](_0x69e161[_0x829d('0x48')],function(_0x19e9c2){delete _0x19e9c2['id'];_0x19e9c2[_0x829d('0x51')]=_0x69e161['params']['id'];return _0x19e9c2;});return db['AnalyticFieldReport']['bulkCreate'](_0x5c2018,{'transaction':_0xd511d7});});})[_0x829d('0x22')](function(){return db[_0x829d('0x29')]['findAll']({'where':{'CustomReportId':_0x69e161[_0x829d('0x45')]['id']}});});}})[_0x829d('0x22')](respondWithResult(_0x58d51a,null))[_0x829d('0x43')](handleError(_0x58d51a,null));}; \ No newline at end of file +var _0xd949=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','end','error','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','includeAll','include','find','create','bulkCreate','body','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xd949,0x181));var _0x9d94=function(_0x23403d,_0x56a443){_0x23403d=_0x23403d-0x0;var _0x163ef2=_0xd949[_0x23403d];return _0x163ef2;};'use strict';var emlformat=require(_0x9d94('0x0'));var rimraf=require(_0x9d94('0x1'));var zipdir=require(_0x9d94('0x2'));var jsonpatch=require(_0x9d94('0x3'));var rp=require('request-promise');var moment=require(_0x9d94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9d94('0x5'));var util=require(_0x9d94('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9d94('0x7'));var ejs=require(_0x9d94('0x8'));var fs=require('fs');var fs_extra=require(_0x9d94('0x9'));var _=require(_0x9d94('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9d94('0xb'));var deskjs=require(_0x9d94('0xc'));var toCsv=require(_0x9d94('0x7'));var querystring=require('querystring');var Papa=require(_0x9d94('0xd'));var Redis=require('ioredis');var authService=require(_0x9d94('0xe'));var qs=require(_0x9d94('0xf'));var as=require(_0x9d94('0x10'));var hardwareService=require(_0x9d94('0x11'));var logger=require(_0x9d94('0x12'))('api');var utils=require(_0x9d94('0x13'));var config=require(_0x9d94('0x14'));var licenseUtil=require(_0x9d94('0x15'));var db=require(_0x9d94('0x16'))['db'];function respondWithStatusCode(_0x1f632a,_0x182325){_0x182325=_0x182325||0xcc;return function(_0x5d5f14){if(_0x5d5f14){return _0x1f632a[_0x9d94('0x17')](_0x182325);}return _0x1f632a[_0x9d94('0x18')](_0x182325)['end']();};}function respondWithResult(_0x180ea5,_0x5a0682){_0x5a0682=_0x5a0682||0xc8;return function(_0x4e6487){if(_0x4e6487){return _0x180ea5[_0x9d94('0x18')](_0x5a0682)[_0x9d94('0x19')](_0x4e6487);}};}function respondWithFilteredResult(_0x5ef20f,_0x468894){return function(_0x26a2b3){if(_0x26a2b3){var _0xa4e910=typeof _0x468894[_0x9d94('0x1a')]==='undefined'&&typeof _0x468894[_0x9d94('0x1b')]===_0x9d94('0x1c');var _0x30e693=_0x26a2b3[_0x9d94('0x1d')];var _0x7e9084=_0xa4e910?0x0:_0x468894[_0x9d94('0x1a')];var _0x2b2906=_0xa4e910?_0x26a2b3[_0x9d94('0x1d')]:_0x468894[_0x9d94('0x1a')]+_0x468894['limit'];var _0x1ad41b;if(_0x2b2906>=_0x30e693){_0x2b2906=_0x30e693;_0x1ad41b=0xc8;}else{_0x1ad41b=0xce;}_0x5ef20f[_0x9d94('0x18')](_0x1ad41b);return _0x5ef20f[_0x9d94('0x1e')](_0x9d94('0x1f'),_0x7e9084+'-'+_0x2b2906+'/'+_0x30e693)[_0x9d94('0x19')](_0x26a2b3);}return null;};}function patchUpdates(_0x1f323a){return function(_0x3d19cc){try{jsonpatch['apply'](_0x3d19cc,_0x1f323a,!![]);}catch(_0x4af527){return BPromise[_0x9d94('0x20')](_0x4af527);}return _0x3d19cc[_0x9d94('0x21')]();};}function saveUpdates(_0x21c091,_0x42d80f){return function(_0x8c280c){if(_0x8c280c){return _0x8c280c['update'](_0x21c091)[_0x9d94('0x22')](function(_0x39d47e){return _0x39d47e;});}return null;};}function removeEntity(_0x4c70ff,_0x1db1d5){return function(_0x26aa3c){if(_0x26aa3c){return _0x26aa3c['destroy']()[_0x9d94('0x22')](function(){_0x4c70ff['status'](0xcc)[_0x9d94('0x23')]();});}};}function handleEntityNotFound(_0x5430d2,_0x394e5b){return function(_0x2529b4){if(!_0x2529b4){_0x5430d2[_0x9d94('0x17')](0x194);}return _0x2529b4;};}function handleError(_0x4d98e3,_0x4c19c2){_0x4c19c2=_0x4c19c2||0x1f4;return function(_0xcbede4){logger[_0x9d94('0x24')](_0xcbede4['stack']);if(_0xcbede4[_0x9d94('0x25')]){delete _0xcbede4[_0x9d94('0x25')];}_0x4d98e3['status'](_0x4c19c2)[_0x9d94('0x26')](_0xcbede4);};}exports['index']=function(_0x516549,_0x58ee5a){var _0x12eec8={},_0x5ebd1e={},_0x418eb6={'count':0x0,'rows':[]};var _0x10e95e=_[_0x9d94('0x27')](db[_0x9d94('0x28')][_0x9d94('0x29')],function(_0x5b0ac3){return{'name':_0x5b0ac3[_0x9d94('0x2a')],'type':_0x5b0ac3[_0x9d94('0x2b')]['key']};});_0x5ebd1e[_0x9d94('0x2c')]=_[_0x9d94('0x27')](_0x10e95e,_0x9d94('0x25'));_0x5ebd1e['query']=_[_0x9d94('0x2d')](_0x516549[_0x9d94('0x2e')]);_0x5ebd1e['filters']=_[_0x9d94('0x2f')](_0x5ebd1e['model'],_0x5ebd1e[_0x9d94('0x2e')]);_0x12eec8[_0x9d94('0x30')]=_[_0x9d94('0x2f')](_0x5ebd1e[_0x9d94('0x2c')],qs[_0x9d94('0x31')](_0x516549[_0x9d94('0x2e')][_0x9d94('0x31')]));_0x12eec8[_0x9d94('0x30')]=_0x12eec8[_0x9d94('0x30')]['length']?_0x12eec8[_0x9d94('0x30')]:_0x5ebd1e['model'];if(!_0x516549['query'][_0x9d94('0x32')]('nolimit')){_0x12eec8[_0x9d94('0x1b')]=qs[_0x9d94('0x1b')](_0x516549[_0x9d94('0x2e')][_0x9d94('0x1b')]);_0x12eec8[_0x9d94('0x1a')]=qs[_0x9d94('0x1a')](_0x516549[_0x9d94('0x2e')]['offset']);}_0x12eec8[_0x9d94('0x33')]=qs[_0x9d94('0x34')](_0x516549[_0x9d94('0x2e')][_0x9d94('0x34')]);_0x12eec8[_0x9d94('0x35')]=qs[_0x9d94('0x36')](_[_0x9d94('0x37')](_0x516549['query'],_0x5ebd1e[_0x9d94('0x36')]),_0x10e95e);if(_0x516549[_0x9d94('0x2e')][_0x9d94('0x38')]){_0x12eec8[_0x9d94('0x35')]=_[_0x9d94('0x39')](_0x12eec8[_0x9d94('0x35')],{'$or':_[_0x9d94('0x27')](_0x10e95e,function(_0x36d785){if(_0x36d785[_0x9d94('0x2b')]!==_0x9d94('0x3a')){var _0x3b4fcb={};_0x3b4fcb[_0x36d785[_0x9d94('0x25')]]={'$like':'%'+_0x516549[_0x9d94('0x2e')][_0x9d94('0x38')]+'%'};return _0x3b4fcb;}})});}_0x12eec8=_[_0x9d94('0x39')]({},_0x12eec8,_0x516549[_0x9d94('0x3b')]);var _0x1d336d={'where':_0x12eec8[_0x9d94('0x35')]};return db[_0x9d94('0x28')][_0x9d94('0x1d')](_0x1d336d)['then'](function(_0x528a7f){_0x418eb6['count']=_0x528a7f;if(_0x516549[_0x9d94('0x2e')]['includeAll']){_0x12eec8['include']=[{'all':!![]}];}return db[_0x9d94('0x28')][_0x9d94('0x3c')](_0x12eec8);})[_0x9d94('0x22')](function(_0x214384){_0x418eb6[_0x9d94('0x3d')]=_0x214384;return _0x418eb6;})['then'](respondWithFilteredResult(_0x58ee5a,_0x12eec8))[_0x9d94('0x3e')](handleError(_0x58ee5a,null));};exports[_0x9d94('0x3f')]=function(_0x193f88,_0x42fad6){var _0x241999={'raw':![],'where':{'id':_0x193f88[_0x9d94('0x40')]['id']}},_0x1f6b1b={};_0x1f6b1b[_0x9d94('0x2c')]=_[_0x9d94('0x2d')](db[_0x9d94('0x28')]['rawAttributes']);_0x1f6b1b['query']=_[_0x9d94('0x2d')](_0x193f88[_0x9d94('0x2e')]);_0x1f6b1b[_0x9d94('0x36')]=_[_0x9d94('0x2f')](_0x1f6b1b['model'],_0x1f6b1b[_0x9d94('0x2e')]);_0x241999[_0x9d94('0x30')]=_[_0x9d94('0x2f')](_0x1f6b1b[_0x9d94('0x2c')],qs[_0x9d94('0x31')](_0x193f88[_0x9d94('0x2e')][_0x9d94('0x31')]));_0x241999[_0x9d94('0x30')]=_0x241999[_0x9d94('0x30')][_0x9d94('0x41')]?_0x241999['attributes']:_0x1f6b1b['model'];if(_0x193f88[_0x9d94('0x2e')][_0x9d94('0x42')]){_0x241999[_0x9d94('0x43')]=[{'all':!![]}];}_0x241999=_['merge']({},_0x241999,_0x193f88[_0x9d94('0x3b')]);return db['AnalyticFieldReport'][_0x9d94('0x44')](_0x241999)[_0x9d94('0x22')](handleEntityNotFound(_0x42fad6,null))['then'](respondWithResult(_0x42fad6,null))[_0x9d94('0x3e')](handleError(_0x42fad6,null));};exports['create']=function(_0x3bbad6,_0x49555c){return db[_0x9d94('0x28')][_0x9d94('0x45')](_0x3bbad6['body'],{})[_0x9d94('0x22')](respondWithResult(_0x49555c,0xc9))[_0x9d94('0x3e')](handleError(_0x49555c,null));};exports['bulkCreate']=function(_0x219edf,_0x1a5e2f){return db['AnalyticFieldReport'][_0x9d94('0x46')](_0x219edf[_0x9d94('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1a5e2f,0xc9))['catch'](handleError(_0x1a5e2f,null));};exports['update']=function(_0x2237d6,_0x56de31){if(_0x2237d6[_0x9d94('0x47')]['id']){delete _0x2237d6[_0x9d94('0x47')]['id'];}return db[_0x9d94('0x28')][_0x9d94('0x44')]({'where':{'id':_0x2237d6['params']['id']}})[_0x9d94('0x22')](handleEntityNotFound(_0x56de31,null))['then'](saveUpdates(_0x2237d6['body'],null))['then'](respondWithResult(_0x56de31,null))[_0x9d94('0x3e')](handleError(_0x56de31,null));};exports[_0x9d94('0x48')]=function(_0x149c05,_0xf0350c){return db[_0x9d94('0x28')][_0x9d94('0x44')]({'where':{'id':_0x149c05[_0x9d94('0x40')]['id']}})['then'](handleEntityNotFound(_0xf0350c,null))[_0x9d94('0x22')](removeEntity(_0xf0350c,null))[_0x9d94('0x3e')](handleError(_0xf0350c,null));};exports[_0x9d94('0x49')]=function(_0xc48fba,_0x18be49){return db['AnalyticFieldReport'][_0x9d94('0x48')]({'where':{'id':_0xc48fba[_0x9d94('0x2e')][_0x9d94('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x18be49,0xcc))[_0x9d94('0x3e')](handleError(_0x18be49,null));};exports[_0x9d94('0x4b')]=function(_0x50ef9b,_0xdf7b9c,_0x3102cf){return db[_0x9d94('0x4c')][_0x9d94('0x4d')]({'where':{'id':_0x50ef9b[_0x9d94('0x40')]['id']}})[_0x9d94('0x22')](handleEntityNotFound(_0xdf7b9c,null))[_0x9d94('0x22')](function(_0x5306ea){if(_0x5306ea){return db[_0x9d94('0x4e')]['transaction'](function(_0xbcf0af){return db[_0x9d94('0x28')][_0x9d94('0x48')]({'where':{'CustomReportId':_0x50ef9b[_0x9d94('0x40')]['id']},'transaction':_0xbcf0af})['then'](function(_0x1cfe43){var _0x5c9199=_[_0x9d94('0x27')](_0x50ef9b[_0x9d94('0x47')],function(_0x42ca4c){delete _0x42ca4c['id'];_0x42ca4c[_0x9d94('0x4f')]=_0x50ef9b['params']['id'];return _0x42ca4c;});return db['AnalyticFieldReport'][_0x9d94('0x46')](_0x5c9199,{'transaction':_0xbcf0af});});})['then'](function(){return db[_0x9d94('0x28')]['findAll']({'where':{'CustomReportId':_0x50ef9b[_0x9d94('0x40')]['id']}});});}})[_0x9d94('0x22')](respondWithResult(_0xdf7b9c,null))['catch'](handleError(_0xdf7b9c,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 222d4eb..4d0d8c7 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 _0xd854=['AnalyticFieldReport','lodash','util','api','moment','request-promise','rimraf','./analyticFieldReport.attributes','define'];(function(_0x3a2e8c,_0x4001d3){var _0x588177=function(_0x2dbc02){while(--_0x2dbc02){_0x3a2e8c['push'](_0x3a2e8c['shift']());}};_0x588177(++_0x4001d3);}(_0xd854,0x1f0));var _0x4d85=function(_0x2dd65c,_0x3e307d){_0x2dd65c=_0x2dd65c-0x0;var _0x384e7e=_0xd854[_0x2dd65c];return _0x384e7e;};'use strict';var _=require(_0x4d85('0x0'));var util=require(_0x4d85('0x1'));var logger=require('../../config/logger')(_0x4d85('0x2'));var moment=require(_0x4d85('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d85('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d85('0x5'));var config=require('../../config/environment');var attributes=require(_0x4d85('0x6'));module['exports']=function(_0xd8d52e,_0x5385aa){return _0xd8d52e[_0x4d85('0x7')](_0x4d85('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb4a=['request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird'];(function(_0x3393a5,_0x3a0827){var _0x47d568=function(_0x2bec7d){while(--_0x2bec7d){_0x3393a5['push'](_0x3393a5['shift']());}};_0x47d568(++_0x3a0827);}(_0xdb4a,0x163));var _0xadb4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xdb4a[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xadb4('0x0'));var util=require(_0xadb4('0x1'));var logger=require(_0xadb4('0x2'))(_0xadb4('0x3'));var moment=require('moment');var BPromise=require(_0xadb4('0x4'));var rp=require(_0xadb4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadb4('0x6'));var config=require(_0xadb4('0x7'));var attributes=require(_0xadb4('0x8'));module['exports']=function(_0xa8dce1,_0x137018){return _0xa8dce1[_0xadb4('0x9')](_0xadb4('0xa'),attributes,{'tableName':_0xadb4('0xb'),'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 c122a3c..58e7d04 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 _0x061b=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x73d553,_0x353cd1){var _0x826343=function(_0x18bac1){while(--_0x18bac1){_0x73d553['push'](_0x73d553['shift']());}};_0x826343(++_0x353cd1);}(_0x061b,0x10a));var _0xb061=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x061b[_0x36c5b0];return _0xf19333;};'use strict';var _=require('lodash');var util=require(_0xb061('0x0'));var moment=require(_0xb061('0x1'));var BPromise=require(_0xb061('0x2'));var rs=require(_0xb061('0x3'));var fs=require('fs');var Redis=require(_0xb061('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb061('0x5'));var logger=require('../../config/logger')(_0xb061('0x6'));var config=require(_0xb061('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb061('0x8')][_0xb061('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d28d1,_0x5d20ae,_0x57e884){return new BPromise(function(_0x2bbd74,_0x4e0b6e){return client[_0xb061('0xa')](_0x5d28d1,_0x57e884)[_0xb061('0xb')](function(_0x29b4a1){logger[_0xb061('0xc')](_0xb061('0xd'),_0x5d20ae,_0xb061('0xe'));logger[_0xb061('0xf')](_0xb061('0x10'),_0x5d20ae,_0xb061('0xe'),JSON['stringify'](_0x29b4a1));if(_0x29b4a1[_0xb061('0x11')]){if(_0x29b4a1[_0xb061('0x11')]['code']===0x1f4){logger[_0xb061('0x11')](_0xb061('0xd'),_0x5d20ae,_0x29b4a1[_0xb061('0x11')][_0xb061('0x12')]);return _0x4e0b6e(_0x29b4a1[_0xb061('0x11')][_0xb061('0x12')]);}logger[_0xb061('0x11')](_0xb061('0xd'),_0x5d20ae,_0x29b4a1[_0xb061('0x11')]['message']);return _0x2bbd74(_0x29b4a1[_0xb061('0x11')][_0xb061('0x12')]);}else{logger[_0xb061('0xc')](_0xb061('0xd'),_0x5d20ae,'request\x20sent');_0x2bbd74(_0x29b4a1['result'][_0xb061('0x12')]);}})[_0xb061('0x13')](function(_0x5167b1){logger[_0xb061('0x11')](_0xb061('0xd'),_0x5d20ae,_0x5167b1);_0x4e0b6e(_0x5167b1);});});} \ No newline at end of file +var _0xd57a=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug'];(function(_0x54da48,_0x1c5f4b){var _0x564ec6=function(_0x418aee){while(--_0x418aee){_0x54da48['push'](_0x54da48['shift']());}};_0x564ec6(++_0x1c5f4b);}(_0xd57a,0x117));var _0xad57=function(_0x1fce55,_0x18396f){_0x1fce55=_0x1fce55-0x0;var _0x237184=_0xd57a[_0x1fce55];return _0x237184;};'use strict';var _=require(_0xad57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xad57('0x1'));var rs=require(_0xad57('0x2'));var fs=require('fs');var Redis=require(_0xad57('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xad57('0x4'))(_0xad57('0x5'));var config=require(_0xad57('0x6'));var jayson=require(_0xad57('0x7'));var client=jayson[_0xad57('0x8')][_0xad57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45d77b,_0x442625,_0x5bed03){return new BPromise(function(_0x4135e1,_0x35aa03){return client[_0xad57('0xa')](_0x45d77b,_0x5bed03)[_0xad57('0xb')](function(_0x367842){logger[_0xad57('0xc')](_0xad57('0xd'),_0x442625,'request\x20sent');logger[_0xad57('0xe')](_0xad57('0xf'),_0x442625,_0xad57('0x10'),JSON['stringify'](_0x367842));if(_0x367842[_0xad57('0x11')]){if(_0x367842[_0xad57('0x11')][_0xad57('0x12')]===0x1f4){logger[_0xad57('0x11')](_0xad57('0xd'),_0x442625,_0x367842[_0xad57('0x11')][_0xad57('0x13')]);return _0x35aa03(_0x367842[_0xad57('0x11')]['message']);}logger[_0xad57('0x11')](_0xad57('0xd'),_0x442625,_0x367842[_0xad57('0x11')]['message']);return _0x4135e1(_0x367842[_0xad57('0x11')][_0xad57('0x13')]);}else{logger[_0xad57('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x442625,_0xad57('0x10'));_0x4135e1(_0x367842['result'][_0xad57('0x13')]);}})[_0xad57('0x14')](function(_0x391f2a){logger[_0xad57('0x11')](_0xad57('0xd'),_0x442625,_0x391f2a);_0x35aa03(_0x391f2a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 973c52c..c6822af 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(_0x1ca3bb,_0x44967d){var _0x271c45=function(_0x387528){while(--_0x387528){_0x1ca3bb['push'](_0x1ca3bb['shift']());}};_0x271c45(++_0x44967d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x575e00,_0x559d6e){var _0x199f97=function(_0xd65d89){while(--_0xd65d89){_0x575e00['push'](_0x575e00['shift']());}};_0x199f97(++_0x559d6e);}(_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'));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 0f600f9..a461b72 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 _0x9aea=['STRING','TEXT','sequelize'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x9aea,0xdd));var _0xa9ae=function(_0x5a3450,_0x57bd53){_0x5a3450=_0x5a3450-0x0;var _0x11e221=_0x9aea[_0x5a3450];return _0x11e221;};'use strict';var Sequelize=require(_0xa9ae('0x0'));module['exports']={'name':{'type':Sequelize[_0xa9ae('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xa9ae('0x1')]},'metric':{'type':Sequelize[_0xa9ae('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc698=['name','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc698,0x85));var _0x8c69=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xc698[_0x470bfb];return _0x2f5d97;};'use strict';var Sequelize=require(_0x8c69('0x0'));module[_0x8c69('0x1')]={'name':{'type':Sequelize[_0x8c69('0x2')],'allowNull':![],'unique':_0x8c69('0x3')},'table':{'type':Sequelize[_0x8c69('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ba4075a..a042b11 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 _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x429e5a,_0x8fe531){var _0x1e4bdf=function(_0x263dc0){while(--_0x263dc0){_0x429e5a['push'](_0x429e5a['shift']());}};_0x1e4bdf(++_0x8fe531);}(_0xa41a,0x6b));var _0xaa41=function(_0x36a2ca,_0x54aa17){_0x36a2ca=_0x36a2ca-0x0;var _0x4aac62=_0xa41a[_0x36a2ca];return _0x4aac62;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file +var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x3d0ccd,_0x43d228){var _0x5781c0=function(_0x306aa6){while(--_0x306aa6){_0x3d0ccd['push'](_0x3d0ccd['shift']());}};_0x5781c0(++_0x43d228);}(_0x9a19,0x114));var _0x99a1=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x9a19[_0x54edc9];return _0x2ae7a9;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 1d7e9e4..0cdff4a 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 _0x5a93=['rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util','api','moment','path'];(function(_0x1af322,_0x16d095){var _0x28ac48=function(_0x32a921){while(--_0x32a921){_0x1af322['push'](_0x1af322['shift']());}};_0x28ac48(++_0x16d095);}(_0x5a93,0xf6));var _0x35a9=function(_0x586121,_0x2db124){_0x586121=_0x586121-0x0;var _0x17c28a=_0x5a93[_0x586121];return _0x17c28a;};'use strict';var _=require('lodash');var util=require(_0x35a9('0x0'));var logger=require('../../config/logger')(_0x35a9('0x1'));var moment=require(_0x35a9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x35a9('0x3'));var rimraf=require(_0x35a9('0x4'));var config=require(_0x35a9('0x5'));var attributes=require('./analyticMetric.attributes');module[_0x35a9('0x6')]=function(_0x27ed9f,_0x2e8a14){return _0x27ed9f[_0x35a9('0x7')](_0x35a9('0x8'),attributes,{'tableName':_0x35a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x398a=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x398a,0x11a));var _0xa398=function(_0x1150e0,_0x2a88eb){_0x1150e0=_0x1150e0-0x0;var _0x249ee9=_0x398a[_0x1150e0];return _0x249ee9;};'use strict';var _=require(_0xa398('0x0'));var util=require(_0xa398('0x1'));var logger=require(_0xa398('0x2'))(_0xa398('0x3'));var moment=require(_0xa398('0x4'));var BPromise=require(_0xa398('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa398('0x6'));var attributes=require(_0xa398('0x7'));module[_0xa398('0x8')]=function(_0x1e57a9,_0x3421a5){return _0x1e57a9[_0xa398('0x9')](_0xa398('0xa'),attributes,{'tableName':_0xa398('0xb'),'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 4e9ed8b..10a69a8 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 _0xc5cc=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xc5cc,0x7b));var _0xcc5c=function(_0x218121,_0x2199c5){_0x218121=_0x218121-0x0;var _0x1b8a54=_0xc5cc[_0x218121];return _0x1b8a54;};'use strict';var _=require(_0xcc5c('0x0'));var util=require(_0xcc5c('0x1'));var moment=require(_0xcc5c('0x2'));var BPromise=require(_0xcc5c('0x3'));var rs=require(_0xcc5c('0x4'));var fs=require('fs');var Redis=require(_0xcc5c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcc5c('0x6'));var jayson=require(_0xcc5c('0x7'));var client=jayson['client'][_0xcc5c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25dfbd,_0x51d935,_0x52e75a){return new BPromise(function(_0x1a7f37,_0x34f5a5){return client[_0xcc5c('0x9')](_0x25dfbd,_0x52e75a)[_0xcc5c('0xa')](function(_0xeb3468){logger[_0xcc5c('0xb')](_0xcc5c('0xc'),_0x51d935,_0xcc5c('0xd'));logger[_0xcc5c('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x51d935,_0xcc5c('0xd'),JSON[_0xcc5c('0xf')](_0xeb3468));if(_0xeb3468[_0xcc5c('0x10')]){if(_0xeb3468[_0xcc5c('0x10')]['code']===0x1f4){logger['error'](_0xcc5c('0xc'),_0x51d935,_0xeb3468['error'][_0xcc5c('0x11')]);return _0x34f5a5(_0xeb3468[_0xcc5c('0x10')][_0xcc5c('0x11')]);}logger[_0xcc5c('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x51d935,_0xeb3468['error'][_0xcc5c('0x11')]);return _0x1a7f37(_0xeb3468[_0xcc5c('0x10')][_0xcc5c('0x11')]);}else{logger[_0xcc5c('0xb')](_0xcc5c('0xc'),_0x51d935,_0xcc5c('0xd'));_0x1a7f37(_0xeb3468['result'][_0xcc5c('0x11')]);}})[_0xcc5c('0x12')](function(_0x273876){logger[_0xcc5c('0x10')](_0xcc5c('0xc'),_0x51d935,_0x273876);_0x34f5a5(_0x273876);});});} \ No newline at end of file +var _0x4bcd=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4bcd,0x7a));var _0xd4bc=function(_0x12f4ef,_0x2ea70d){_0x12f4ef=_0x12f4ef-0x0;var _0x2cbb26=_0x4bcd[_0x12f4ef];return _0x2cbb26;};'use strict';var _=require(_0xd4bc('0x0'));var util=require(_0xd4bc('0x1'));var moment=require(_0xd4bc('0x2'));var BPromise=require(_0xd4bc('0x3'));var rs=require(_0xd4bc('0x4'));var fs=require('fs');var Redis=require(_0xd4bc('0x5'));var db=require(_0xd4bc('0x6'))['db'];var utils=require(_0xd4bc('0x7'));var logger=require(_0xd4bc('0x8'))(_0xd4bc('0x9'));var config=require(_0xd4bc('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd4bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x531d2c,_0x4e6322,_0x98610e){return new BPromise(function(_0x4dc20f,_0x124593){return client['request'](_0x531d2c,_0x98610e)[_0xd4bc('0xc')](function(_0x37f102){logger[_0xd4bc('0xd')](_0xd4bc('0xe'),_0x4e6322,_0xd4bc('0xf'));logger[_0xd4bc('0x10')](_0xd4bc('0x11'),_0x4e6322,_0xd4bc('0xf'),JSON[_0xd4bc('0x12')](_0x37f102));if(_0x37f102[_0xd4bc('0x13')]){if(_0x37f102['error'][_0xd4bc('0x14')]===0x1f4){logger[_0xd4bc('0x13')](_0xd4bc('0xe'),_0x4e6322,_0x37f102[_0xd4bc('0x13')][_0xd4bc('0x15')]);return _0x124593(_0x37f102[_0xd4bc('0x13')][_0xd4bc('0x15')]);}logger['error'](_0xd4bc('0xe'),_0x4e6322,_0x37f102[_0xd4bc('0x13')][_0xd4bc('0x15')]);return _0x4dc20f(_0x37f102[_0xd4bc('0x13')]['message']);}else{logger['info'](_0xd4bc('0xe'),_0x4e6322,_0xd4bc('0xf'));_0x4dc20f(_0x37f102['result'][_0xd4bc('0x15')]);}})[_0xd4bc('0x16')](function(_0x412749){logger[_0xd4bc('0x13')](_0xd4bc('0xe'),_0x4e6322,_0x412749);_0x124593(_0x412749);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 48efb33..f721da2 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 _0xe9e8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x52ff0a,_0x44590f){var _0x3f5b6a=function(_0x347475){while(--_0x347475){_0x52ff0a['push'](_0x52ff0a['shift']());}};_0x3f5b6a(++_0x44590f);}(_0xe9e8,0x179));var _0x8e9e=function(_0x1aea45,_0x4ba377){_0x1aea45=_0x1aea45-0x0;var _0xb3eaff=_0xe9e8[_0x1aea45];return _0xb3eaff;};'use strict';var multer=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var path=require(_0x8e9e('0x2'));var timeout=require(_0x8e9e('0x3'));var express=require(_0x8e9e('0x4'));var router=express[_0x8e9e('0x5')]();var fs_extra=require(_0x8e9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8e9e('0x7'));var config=require('../../config/environment');var controller=require(_0x8e9e('0x8'));router[_0x8e9e('0x9')]('/',auth[_0x8e9e('0xa')](),controller['index']);router['get'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xc')]);router[_0x8e9e('0xd')]('/',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xe')]);router['put']('/:id',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xf')]);router[_0x8e9e('0x10')](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x11')]);module[_0x8e9e('0x12')]=router; \ No newline at end of file +var _0xc906=['./analyticMetric.controller','get','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc906,0x1ad));var _0x6c90=function(_0x14bd26,_0x547d75){_0x14bd26=_0x14bd26-0x0;var _0x417234=_0xc906[_0x14bd26];return _0x417234;};'use strict';var multer=require(_0x6c90('0x0'));var util=require(_0x6c90('0x1'));var path=require('path');var timeout=require(_0x6c90('0x2'));var express=require(_0x6c90('0x3'));var router=express[_0x6c90('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6c90('0x5'));var interaction=require(_0x6c90('0x6'));var config=require(_0x6c90('0x7'));var controller=require(_0x6c90('0x8'));router[_0x6c90('0x9')]('/',auth[_0x6c90('0xa')](),controller['index']);router['get']('/:id',auth[_0x6c90('0xa')](),controller['show']);router[_0x6c90('0xb')]('/',auth[_0x6c90('0xa')](),controller[_0x6c90('0xc')]);router[_0x6c90('0xd')](_0x6c90('0xe'),auth[_0x6c90('0xa')](),controller[_0x6c90('0xf')]);router[_0x6c90('0x10')](_0x6c90('0xe'),auth[_0x6c90('0xa')](),controller[_0x6c90('0x11')]);module[_0x6c90('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index d406586..9d2e9e3 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b5d=['exports'];(function(_0x47c055,_0x515895){var _0xf5b2ba=function(_0x41fdb0){while(--_0x41fdb0){_0x47c055['push'](_0x47c055['shift']());}};_0xf5b2ba(++_0x515895);}(_0x6b5d,0x1c8));var _0xd6b5=function(_0x2177ea,_0x5a3638){_0x2177ea=_0x2177ea-0x0;var _0x299b63=_0x6b5d[_0x2177ea];return _0x299b63;};'use strict';var Sequelize=require('sequelize');module[_0xd6b5('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xf18d=['sequelize','TEXT'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0xf18d,0xe2));var _0xdf18=function(_0x340ca4,_0x109af5){_0x340ca4=_0x340ca4-0x0;var _0x911258=_0xf18d[_0x340ca4];return _0x911258;};'use strict';var Sequelize=require(_0xdf18('0x0'));module['exports']={'tree':{'type':Sequelize[_0xdf18('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 0be9cfb..6b99c5c 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 _0xc8cc=['where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x2136ae,_0x17766d){var _0x53579e=function(_0x3becba){while(--_0x3becba){_0x2136ae['push'](_0x2136ae['shift']());}};_0x53579e(++_0x17766d);}(_0xc8cc,0x14a));var _0xcc8c=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0xc8cc[_0x28407a];return _0x8bd6ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc8c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc8c('0x1'));var rp=require(_0xcc8c('0x2'));var moment=require(_0xcc8c('0x3'));var BPromise=require(_0xcc8c('0x4'));var Mustache=require('mustache');var util=require(_0xcc8c('0x5'));var path=require(_0xcc8c('0x6'));var sox=require(_0xcc8c('0x7'));var csv=require(_0xcc8c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc8c('0x9'));var _=require(_0xcc8c('0xa'));var squel=require(_0xcc8c('0xb'));var crypto=require(_0xcc8c('0xc'));var jsforce=require(_0xcc8c('0xd'));var deskjs=require(_0xcc8c('0xe'));var toCsv=require(_0xcc8c('0x8'));var querystring=require(_0xcc8c('0xf'));var Papa=require(_0xcc8c('0x10'));var Redis=require(_0xcc8c('0x11'));var authService=require(_0xcc8c('0x12'));var qs=require(_0xcc8c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc8c('0x14'));var logger=require(_0xcc8c('0x15'))('api');var utils=require(_0xcc8c('0x16'));var config=require(_0xcc8c('0x17'));var licenseUtil=require(_0xcc8c('0x18'));var db=require(_0xcc8c('0x19'))['db'];function respondWithStatusCode(_0x178a09,_0x1f3e7c){_0x1f3e7c=_0x1f3e7c||0xcc;return function(_0x11b066){if(_0x11b066){return _0x178a09[_0xcc8c('0x1a')](_0x1f3e7c);}return _0x178a09[_0xcc8c('0x1b')](_0x1f3e7c)[_0xcc8c('0x1c')]();};}function respondWithResult(_0x14bdef,_0x1f2960){_0x1f2960=_0x1f2960||0xc8;return function(_0x585664){if(_0x585664){return _0x14bdef[_0xcc8c('0x1b')](_0x1f2960)[_0xcc8c('0x1d')](_0x585664);}};}function respondWithFilteredResult(_0x2a4170,_0x5d7873){return function(_0x4f6532){if(_0x4f6532){var _0xb9e15a=typeof _0x5d7873['offset']==='undefined'&&typeof _0x5d7873[_0xcc8c('0x1e')]===_0xcc8c('0x1f');var _0x4fd8e5=_0x4f6532[_0xcc8c('0x20')];var _0x790440=_0xb9e15a?0x0:_0x5d7873['offset'];var _0x2e8c5c=_0xb9e15a?_0x4f6532['count']:_0x5d7873[_0xcc8c('0x21')]+_0x5d7873[_0xcc8c('0x1e')];var _0x8b4ebb;if(_0x2e8c5c>=_0x4fd8e5){_0x2e8c5c=_0x4fd8e5;_0x8b4ebb=0xc8;}else{_0x8b4ebb=0xce;}_0x2a4170['status'](_0x8b4ebb);return _0x2a4170[_0xcc8c('0x22')](_0xcc8c('0x23'),_0x790440+'-'+_0x2e8c5c+'/'+_0x4fd8e5)[_0xcc8c('0x1d')](_0x4f6532);}return null;};}function patchUpdates(_0x3678eb){return function(_0x17c2df){try{jsonpatch['apply'](_0x17c2df,_0x3678eb,!![]);}catch(_0x4868f8){return BPromise[_0xcc8c('0x24')](_0x4868f8);}return _0x17c2df[_0xcc8c('0x25')]();};}function saveUpdates(_0x455123,_0x75b532){return function(_0xa41197){if(_0xa41197){return _0xa41197[_0xcc8c('0x26')](_0x455123)[_0xcc8c('0x27')](function(_0x55322c){return _0x55322c;});}return null;};}function removeEntity(_0x3a0bfe,_0xafb5ef){return function(_0x3c2830){if(_0x3c2830){return _0x3c2830[_0xcc8c('0x28')]()[_0xcc8c('0x27')](function(){_0x3a0bfe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28176f,_0x2cb704){return function(_0x4d4818){if(!_0x4d4818){_0x28176f['sendStatus'](0x194);}return _0x4d4818;};}function handleError(_0x4ec8f9,_0x1cede7){_0x1cede7=_0x1cede7||0x1f4;return function(_0x105a8b){logger[_0xcc8c('0x29')](_0x105a8b[_0xcc8c('0x2a')]);if(_0x105a8b[_0xcc8c('0x2b')]){delete _0x105a8b[_0xcc8c('0x2b')];}_0x4ec8f9[_0xcc8c('0x1b')](_0x1cede7)[_0xcc8c('0x2c')](_0x105a8b);};}exports[_0xcc8c('0x2d')]=function(_0x1be1f0,_0x2d5292){var _0x5d6a8a={},_0x234886={},_0x43001={'count':0x0,'rows':[]};var _0x4badbf=_[_0xcc8c('0x2e')](db[_0xcc8c('0x2f')][_0xcc8c('0x30')],function(_0x1f943c){return{'name':_0x1f943c[_0xcc8c('0x31')],'type':_0x1f943c[_0xcc8c('0x32')][_0xcc8c('0x33')]};});_0x234886[_0xcc8c('0x34')]=_['map'](_0x4badbf,_0xcc8c('0x2b'));_0x234886[_0xcc8c('0x35')]=_[_0xcc8c('0x36')](_0x1be1f0[_0xcc8c('0x35')]);_0x234886[_0xcc8c('0x37')]=_['intersection'](_0x234886[_0xcc8c('0x34')],_0x234886[_0xcc8c('0x35')]);_0x5d6a8a[_0xcc8c('0x38')]=_[_0xcc8c('0x39')](_0x234886[_0xcc8c('0x34')],qs['fields'](_0x1be1f0[_0xcc8c('0x35')][_0xcc8c('0x3a')]));_0x5d6a8a['attributes']=_0x5d6a8a[_0xcc8c('0x38')][_0xcc8c('0x3b')]?_0x5d6a8a[_0xcc8c('0x38')]:_0x234886[_0xcc8c('0x34')];if(!_0x1be1f0[_0xcc8c('0x35')][_0xcc8c('0x3c')](_0xcc8c('0x3d'))){_0x5d6a8a['limit']=qs[_0xcc8c('0x1e')](_0x1be1f0['query'][_0xcc8c('0x1e')]);_0x5d6a8a[_0xcc8c('0x21')]=qs[_0xcc8c('0x21')](_0x1be1f0[_0xcc8c('0x35')][_0xcc8c('0x21')]);}_0x5d6a8a[_0xcc8c('0x3e')]=qs[_0xcc8c('0x3f')](_0x1be1f0[_0xcc8c('0x35')][_0xcc8c('0x3f')]);_0x5d6a8a['where']=qs[_0xcc8c('0x37')](_[_0xcc8c('0x40')](_0x1be1f0[_0xcc8c('0x35')],_0x234886[_0xcc8c('0x37')]),_0x4badbf);if(_0x1be1f0['query']['filter']){_0x5d6a8a[_0xcc8c('0x41')]=_[_0xcc8c('0x42')](_0x5d6a8a[_0xcc8c('0x41')],{'$or':_[_0xcc8c('0x2e')](_0x4badbf,function(_0x2506ce){if(_0x2506ce[_0xcc8c('0x32')]!==_0xcc8c('0x43')){var _0x363d93={};_0x363d93[_0x2506ce[_0xcc8c('0x2b')]]={'$like':'%'+_0x1be1f0[_0xcc8c('0x35')][_0xcc8c('0x44')]+'%'};return _0x363d93;}})});}_0x5d6a8a=_['merge']({},_0x5d6a8a,_0x1be1f0[_0xcc8c('0x45')]);var _0x4b616f={'where':_0x5d6a8a[_0xcc8c('0x41')]};return db[_0xcc8c('0x2f')][_0xcc8c('0x20')](_0x4b616f)[_0xcc8c('0x27')](function(_0x491a19){_0x43001[_0xcc8c('0x20')]=_0x491a19;if(_0x1be1f0[_0xcc8c('0x35')][_0xcc8c('0x46')]){_0x5d6a8a[_0xcc8c('0x47')]=[{'all':!![]}];}return db[_0xcc8c('0x2f')][_0xcc8c('0x48')](_0x5d6a8a);})[_0xcc8c('0x27')](function(_0x1667ca){_0x43001[_0xcc8c('0x49')]=_0x1667ca;return _0x43001;})[_0xcc8c('0x27')](respondWithFilteredResult(_0x2d5292,_0x5d6a8a))[_0xcc8c('0x4a')](handleError(_0x2d5292,null));};exports[_0xcc8c('0x4b')]=function(_0x19f9c0,_0x2f9712){var _0x586414={'raw':!![],'where':{'id':_0x19f9c0['params']['id']}},_0x1080a7={};_0x1080a7[_0xcc8c('0x34')]=_[_0xcc8c('0x36')](db[_0xcc8c('0x2f')][_0xcc8c('0x30')]);_0x1080a7[_0xcc8c('0x35')]=_[_0xcc8c('0x36')](_0x19f9c0[_0xcc8c('0x35')]);_0x1080a7[_0xcc8c('0x37')]=_[_0xcc8c('0x39')](_0x1080a7[_0xcc8c('0x34')],_0x1080a7[_0xcc8c('0x35')]);_0x586414[_0xcc8c('0x38')]=_[_0xcc8c('0x39')](_0x1080a7[_0xcc8c('0x34')],qs[_0xcc8c('0x3a')](_0x19f9c0[_0xcc8c('0x35')][_0xcc8c('0x3a')]));_0x586414[_0xcc8c('0x38')]=_0x586414[_0xcc8c('0x38')][_0xcc8c('0x3b')]?_0x586414[_0xcc8c('0x38')]:_0x1080a7[_0xcc8c('0x34')];if(_0x19f9c0['query'][_0xcc8c('0x46')]){_0x586414['include']=[{'all':!![]}];}_0x586414=_[_0xcc8c('0x42')]({},_0x586414,_0x19f9c0[_0xcc8c('0x45')]);return db['AnalyticTreeReport'][_0xcc8c('0x4c')](_0x586414)['then'](handleEntityNotFound(_0x2f9712,null))[_0xcc8c('0x27')](respondWithResult(_0x2f9712,null))[_0xcc8c('0x4a')](handleError(_0x2f9712,null));};exports[_0xcc8c('0x4d')]=function(_0x1ca725,_0x441a03){return db[_0xcc8c('0x2f')][_0xcc8c('0x4d')](_0x1ca725[_0xcc8c('0x4e')],{})[_0xcc8c('0x27')](respondWithResult(_0x441a03,0xc9))[_0xcc8c('0x4a')](handleError(_0x441a03,null));};exports[_0xcc8c('0x26')]=function(_0x52e5a9,_0x3a56d5){if(_0x52e5a9[_0xcc8c('0x4e')]['id']){delete _0x52e5a9[_0xcc8c('0x4e')]['id'];}return db[_0xcc8c('0x2f')]['find']({'where':{'id':_0x52e5a9['params']['id']}})[_0xcc8c('0x27')](handleEntityNotFound(_0x3a56d5,null))[_0xcc8c('0x27')](saveUpdates(_0x52e5a9[_0xcc8c('0x4e')],null))[_0xcc8c('0x27')](respondWithResult(_0x3a56d5,null))[_0xcc8c('0x4a')](handleError(_0x3a56d5,null));};exports['destroy']=function(_0x2f4117,_0xd42003){return db[_0xcc8c('0x2f')][_0xcc8c('0x4c')]({'where':{'id':_0x2f4117['params']['id']}})[_0xcc8c('0x27')](handleEntityNotFound(_0xd42003,null))[_0xcc8c('0x27')](removeEntity(_0xd42003,null))[_0xcc8c('0x4a')](handleError(_0xd42003,null));}; \ No newline at end of file +var _0xb94a=['show','params','create','update','body','destroy','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','filter','merge','options','includeAll','include','findAll','catch'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xb94a,0x1bd));var _0xab94=function(_0x4b51ab,_0x23418a){_0x4b51ab=_0x4b51ab-0x0;var _0x1ac35b=_0xb94a[_0x4b51ab];return _0x1ac35b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab94('0x0'));var zipdir=require(_0xab94('0x1'));var jsonpatch=require(_0xab94('0x2'));var rp=require(_0xab94('0x3'));var moment=require(_0xab94('0x4'));var BPromise=require(_0xab94('0x5'));var Mustache=require(_0xab94('0x6'));var util=require(_0xab94('0x7'));var path=require(_0xab94('0x8'));var sox=require(_0xab94('0x9'));var csv=require(_0xab94('0xa'));var ejs=require(_0xab94('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab94('0xc'));var squel=require(_0xab94('0xd'));var crypto=require(_0xab94('0xe'));var jsforce=require(_0xab94('0xf'));var deskjs=require(_0xab94('0x10'));var toCsv=require('to-csv');var querystring=require(_0xab94('0x11'));var Papa=require(_0xab94('0x12'));var Redis=require(_0xab94('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xab94('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab94('0x15'))('api');var utils=require(_0xab94('0x16'));var config=require(_0xab94('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f2f1f,_0x3880f1){_0x3880f1=_0x3880f1||0xcc;return function(_0x206397){if(_0x206397){return _0x5f2f1f[_0xab94('0x18')](_0x3880f1);}return _0x5f2f1f[_0xab94('0x19')](_0x3880f1)[_0xab94('0x1a')]();};}function respondWithResult(_0x5e1cf1,_0x5f28e4){_0x5f28e4=_0x5f28e4||0xc8;return function(_0x135e08){if(_0x135e08){return _0x5e1cf1[_0xab94('0x19')](_0x5f28e4)[_0xab94('0x1b')](_0x135e08);}};}function respondWithFilteredResult(_0x352357,_0x35c3c3){return function(_0x248ad4){if(_0x248ad4){var _0x10a2a7=typeof _0x35c3c3['offset']===_0xab94('0x1c')&&typeof _0x35c3c3['limit']===_0xab94('0x1c');var _0x36bb79=_0x248ad4['count'];var _0x583c13=_0x10a2a7?0x0:_0x35c3c3[_0xab94('0x1d')];var _0x2764b9=_0x10a2a7?_0x248ad4[_0xab94('0x1e')]:_0x35c3c3[_0xab94('0x1d')]+_0x35c3c3[_0xab94('0x1f')];var _0x225b61;if(_0x2764b9>=_0x36bb79){_0x2764b9=_0x36bb79;_0x225b61=0xc8;}else{_0x225b61=0xce;}_0x352357[_0xab94('0x19')](_0x225b61);return _0x352357[_0xab94('0x20')](_0xab94('0x21'),_0x583c13+'-'+_0x2764b9+'/'+_0x36bb79)['json'](_0x248ad4);}return null;};}function patchUpdates(_0x207722){return function(_0x48f818){try{jsonpatch[_0xab94('0x22')](_0x48f818,_0x207722,!![]);}catch(_0x3b8530){return BPromise[_0xab94('0x23')](_0x3b8530);}return _0x48f818[_0xab94('0x24')]();};}function saveUpdates(_0x1363b4,_0x298bd3){return function(_0x2417d0){if(_0x2417d0){return _0x2417d0['update'](_0x1363b4)[_0xab94('0x25')](function(_0x4a449c){return _0x4a449c;});}return null;};}function removeEntity(_0x170066,_0x4429e2){return function(_0x7b8ab){if(_0x7b8ab){return _0x7b8ab['destroy']()[_0xab94('0x25')](function(){_0x170066['status'](0xcc)[_0xab94('0x1a')]();});}};}function handleEntityNotFound(_0x2fdd8b,_0x36a54e){return function(_0x164f56){if(!_0x164f56){_0x2fdd8b[_0xab94('0x18')](0x194);}return _0x164f56;};}function handleError(_0x1e8eaa,_0x510ce3){_0x510ce3=_0x510ce3||0x1f4;return function(_0xf9f832){logger[_0xab94('0x26')](_0xf9f832['stack']);if(_0xf9f832['name']){delete _0xf9f832[_0xab94('0x27')];}_0x1e8eaa[_0xab94('0x19')](_0x510ce3)['send'](_0xf9f832);};}exports[_0xab94('0x28')]=function(_0x1d686c,_0x68745a){var _0xf3a4d5={},_0x340bb6={},_0x5748f5={'count':0x0,'rows':[]};var _0x24eb3a=_[_0xab94('0x29')](db[_0xab94('0x2a')][_0xab94('0x2b')],function(_0x53db27){return{'name':_0x53db27[_0xab94('0x2c')],'type':_0x53db27[_0xab94('0x2d')][_0xab94('0x2e')]};});_0x340bb6[_0xab94('0x2f')]=_[_0xab94('0x29')](_0x24eb3a,'name');_0x340bb6['query']=_[_0xab94('0x30')](_0x1d686c[_0xab94('0x31')]);_0x340bb6[_0xab94('0x32')]=_[_0xab94('0x33')](_0x340bb6[_0xab94('0x2f')],_0x340bb6[_0xab94('0x31')]);_0xf3a4d5[_0xab94('0x34')]=_[_0xab94('0x33')](_0x340bb6['model'],qs['fields'](_0x1d686c['query'][_0xab94('0x35')]));_0xf3a4d5[_0xab94('0x34')]=_0xf3a4d5[_0xab94('0x34')][_0xab94('0x36')]?_0xf3a4d5[_0xab94('0x34')]:_0x340bb6[_0xab94('0x2f')];if(!_0x1d686c[_0xab94('0x31')]['hasOwnProperty'](_0xab94('0x37'))){_0xf3a4d5[_0xab94('0x1f')]=qs[_0xab94('0x1f')](_0x1d686c[_0xab94('0x31')][_0xab94('0x1f')]);_0xf3a4d5[_0xab94('0x1d')]=qs[_0xab94('0x1d')](_0x1d686c[_0xab94('0x31')][_0xab94('0x1d')]);}_0xf3a4d5['order']=qs['sort'](_0x1d686c[_0xab94('0x31')][_0xab94('0x38')]);_0xf3a4d5['where']=qs[_0xab94('0x32')](_[_0xab94('0x39')](_0x1d686c[_0xab94('0x31')],_0x340bb6[_0xab94('0x32')]),_0x24eb3a);if(_0x1d686c[_0xab94('0x31')]['filter']){_0xf3a4d5[_0xab94('0x3a')]=_['merge'](_0xf3a4d5['where'],{'$or':_['map'](_0x24eb3a,function(_0x2b2370){if(_0x2b2370['type']!=='VIRTUAL'){var _0xa9f3d3={};_0xa9f3d3[_0x2b2370['name']]={'$like':'%'+_0x1d686c[_0xab94('0x31')][_0xab94('0x3b')]+'%'};return _0xa9f3d3;}})});}_0xf3a4d5=_[_0xab94('0x3c')]({},_0xf3a4d5,_0x1d686c[_0xab94('0x3d')]);var _0xbe4aee={'where':_0xf3a4d5[_0xab94('0x3a')]};return db[_0xab94('0x2a')][_0xab94('0x1e')](_0xbe4aee)['then'](function(_0x38fcc8){_0x5748f5[_0xab94('0x1e')]=_0x38fcc8;if(_0x1d686c['query'][_0xab94('0x3e')]){_0xf3a4d5[_0xab94('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xab94('0x40')](_0xf3a4d5);})[_0xab94('0x25')](function(_0xb7ef72){_0x5748f5['rows']=_0xb7ef72;return _0x5748f5;})['then'](respondWithFilteredResult(_0x68745a,_0xf3a4d5))[_0xab94('0x41')](handleError(_0x68745a,null));};exports[_0xab94('0x42')]=function(_0x4a598a,_0x44026a){var _0x5817cc={'raw':!![],'where':{'id':_0x4a598a[_0xab94('0x43')]['id']}},_0x4e88d6={};_0x4e88d6[_0xab94('0x2f')]=_[_0xab94('0x30')](db[_0xab94('0x2a')]['rawAttributes']);_0x4e88d6[_0xab94('0x31')]=_[_0xab94('0x30')](_0x4a598a[_0xab94('0x31')]);_0x4e88d6[_0xab94('0x32')]=_[_0xab94('0x33')](_0x4e88d6['model'],_0x4e88d6[_0xab94('0x31')]);_0x5817cc[_0xab94('0x34')]=_[_0xab94('0x33')](_0x4e88d6[_0xab94('0x2f')],qs[_0xab94('0x35')](_0x4a598a['query']['fields']));_0x5817cc[_0xab94('0x34')]=_0x5817cc[_0xab94('0x34')][_0xab94('0x36')]?_0x5817cc[_0xab94('0x34')]:_0x4e88d6[_0xab94('0x2f')];if(_0x4a598a[_0xab94('0x31')][_0xab94('0x3e')]){_0x5817cc[_0xab94('0x3f')]=[{'all':!![]}];}_0x5817cc=_['merge']({},_0x5817cc,_0x4a598a[_0xab94('0x3d')]);return db[_0xab94('0x2a')]['find'](_0x5817cc)[_0xab94('0x25')](handleEntityNotFound(_0x44026a,null))[_0xab94('0x25')](respondWithResult(_0x44026a,null))['catch'](handleError(_0x44026a,null));};exports['create']=function(_0x13b7fb,_0x3fe595){return db[_0xab94('0x2a')][_0xab94('0x44')](_0x13b7fb['body'],{})['then'](respondWithResult(_0x3fe595,0xc9))[_0xab94('0x41')](handleError(_0x3fe595,null));};exports[_0xab94('0x45')]=function(_0x5d14e0,_0x4be94d){if(_0x5d14e0[_0xab94('0x46')]['id']){delete _0x5d14e0['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x5d14e0[_0xab94('0x43')]['id']}})[_0xab94('0x25')](handleEntityNotFound(_0x4be94d,null))[_0xab94('0x25')](saveUpdates(_0x5d14e0[_0xab94('0x46')],null))[_0xab94('0x25')](respondWithResult(_0x4be94d,null))[_0xab94('0x41')](handleError(_0x4be94d,null));};exports[_0xab94('0x47')]=function(_0x476522,_0x2fcfbd){return db['AnalyticTreeReport'][_0xab94('0x48')]({'where':{'id':_0x476522[_0xab94('0x43')]['id']}})[_0xab94('0x25')](handleEntityNotFound(_0x2fcfbd,null))[_0xab94('0x25')](removeEntity(_0x2fcfbd,null))['catch'](handleError(_0x2fcfbd,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index eb80b5c..6754c1e 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 _0x7777=['moment','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','lodash','../../config/logger','api'];(function(_0x502c86,_0xa571a7){var _0x597ea6=function(_0x32e5bd){while(--_0x32e5bd){_0x502c86['push'](_0x502c86['shift']());}};_0x597ea6(++_0xa571a7);}(_0x7777,0xd5));var _0x7777=function(_0x590454,_0x30c9cf){_0x590454=_0x590454-0x0;var _0x21cb88=_0x7777[_0x590454];return _0x21cb88;};'use strict';var _=require(_0x7777('0x0'));var util=require('util');var logger=require(_0x7777('0x1'))(_0x7777('0x2'));var moment=require(_0x7777('0x3'));var BPromise=require('bluebird');var rp=require(_0x7777('0x4'));var fs=require('fs');var path=require(_0x7777('0x5'));var rimraf=require(_0x7777('0x6'));var config=require('../../config/environment');var attributes=require(_0x7777('0x7'));module[_0x7777('0x8')]=function(_0x4f7986,_0x1a6b6a){return _0x4f7986['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab8e=['api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger'];(function(_0x1ac632,_0xf370fb){var _0x4df8d6=function(_0x49063f){while(--_0x49063f){_0x1ac632['push'](_0x1ac632['shift']());}};_0x4df8d6(++_0xf370fb);}(_0xab8e,0x9a));var _0xeab8=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xab8e[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xeab8('0x0'));var util=require('util');var logger=require(_0xeab8('0x1'))(_0xeab8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeab8('0x3'));var fs=require('fs');var path=require(_0xeab8('0x4'));var rimraf=require(_0xeab8('0x5'));var config=require(_0xeab8('0x6'));var attributes=require(_0xeab8('0x7'));module[_0xeab8('0x8')]=function(_0x20c0ae,_0xcb60db){return _0x20c0ae[_0xeab8('0x9')](_0xeab8('0xa'),attributes,{'tableName':_0xeab8('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 6357888..506601a 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4865ed,_0x27fb2f){var _0x373dee=function(_0x334b72){while(--_0x334b72){_0x4865ed['push'](_0x4865ed['shift']());}};_0x373dee(++_0x27fb2f);}(_0x1261,0x144));var _0x1126=function(_0x5c6be5,_0x3ff1d5){_0x5c6be5=_0x5c6be5-0x0;var _0x151348=_0x1261[_0x5c6be5];return _0x151348;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x335d2d,_0x26e065){var _0x379073=function(_0x51f553){while(--_0x51f553){_0x335d2d['push'](_0x335d2d['shift']());}};_0x379073(++_0x26e065);}(_0xadb5,0xad));var _0x5adb=function(_0x16dfcf,_0x4b6d26){_0x16dfcf=_0x16dfcf-0x0;var _0x1870c0=_0xadb5[_0x16dfcf];return _0x1870c0;};'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']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 97b63d3..1c945eb 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 _0x1ade=['put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0xa2be9,_0x350709){var _0x540705=function(_0x5b27da){while(--_0x5b27da){_0xa2be9['push'](_0xa2be9['shift']());}};_0x540705(++_0x350709);}(_0x1ade,0x1a6));var _0xe1ad=function(_0x181b1e,_0x160c56){_0x181b1e=_0x181b1e-0x0;var _0x1ad7bf=_0x1ade[_0x181b1e];return _0x1ad7bf;};'use strict';var multer=require('multer');var util=require(_0xe1ad('0x0'));var path=require('path');var timeout=require(_0xe1ad('0x1'));var express=require(_0xe1ad('0x2'));var router=express[_0xe1ad('0x3')]();var fs_extra=require(_0xe1ad('0x4'));var auth=require(_0xe1ad('0x5'));var interaction=require(_0xe1ad('0x6'));var config=require('../../config/environment');var controller=require(_0xe1ad('0x7'));router[_0xe1ad('0x8')]('/',auth[_0xe1ad('0x9')](),controller[_0xe1ad('0xa')]);router['get'](_0xe1ad('0xb'),auth['isAuthenticated'](),controller[_0xe1ad('0xc')]);router[_0xe1ad('0xd')]('/',auth['isAuthenticated'](),controller[_0xe1ad('0xe')]);router[_0xe1ad('0xf')](_0xe1ad('0xb'),auth[_0xe1ad('0x9')](),controller[_0xe1ad('0x10')]);router['delete'](_0xe1ad('0xb'),auth[_0xe1ad('0x9')](),controller[_0xe1ad('0x11')]);module[_0xe1ad('0x12')]=router; \ No newline at end of file +var _0x4536=['put','update','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x4536,0xb8));var _0x6453=function(_0x2ce286,_0x4104e4){_0x2ce286=_0x2ce286-0x0;var _0x4c471f=_0x4536[_0x2ce286];return _0x4c471f;};'use strict';var multer=require('multer');var util=require(_0x6453('0x0'));var path=require('path');var timeout=require(_0x6453('0x1'));var express=require(_0x6453('0x2'));var router=express[_0x6453('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6453('0x4'));var config=require(_0x6453('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x6453('0x6')]('/',auth[_0x6453('0x7')](),controller[_0x6453('0x8')]);router['get'](_0x6453('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x6453('0xa')]('/',auth[_0x6453('0x7')](),controller['create']);router[_0x6453('0xb')]('/:id',auth[_0x6453('0x7')](),controller[_0x6453('0xc')]);router['delete']('/:id',auth[_0x6453('0x7')](),controller[_0x6453('0xd')]);module[_0x6453('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 4249a1d..902d96d 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 _0xf25a=['sequelize','exports','STRING'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xf25a,0x195));var _0xaf25=function(_0x494053,_0x6c7ef){_0x494053=_0x494053-0x0;var _0x28e0e8=_0xf25a[_0x494053];return _0x28e0e8;};'use strict';var Sequelize=require(_0xaf25('0x0'));module[_0xaf25('0x1')]={'name':{'type':Sequelize[_0xaf25('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaf25('0x2')]}}; \ No newline at end of file +var _0xd493=['STRING','sequelize'];(function(_0x229443,_0x47a652){var _0x4f8829=function(_0x11c5da){while(--_0x11c5da){_0x229443['push'](_0x229443['shift']());}};_0x4f8829(++_0x47a652);}(_0xd493,0x1bd));var _0x3d49=function(_0xd6b7c5,_0x4b5f84){_0xd6b7c5=_0xd6b7c5-0x0;var _0x5daa02=_0xd493[_0xd6b7c5];return _0x5daa02;};'use strict';var Sequelize=require(_0x3d49('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d49('0x1')]},'basename':{'type':Sequelize[_0x3d49('0x1')]},'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 dd66f7a..6cf8b63 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 _0x608b=['nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','catch','show','params','rawAttributes','includeAll','options','find','clone','length','get','omit','createdAt','body','updatedAt','create','file','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','eml-format','request-promise','moment','mustache','util','path','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','keys','intersection','query','attributes','fields'];(function(_0x42a721,_0x2098e5){var _0x300148=function(_0x585f3c){while(--_0x585f3c){_0x42a721['push'](_0x42a721['shift']());}};_0x300148(++_0x2098e5);}(_0x608b,0xcd));var _0xb608=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x608b[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0xb608('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb608('0x1'));var moment=require(_0xb608('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb608('0x3'));var util=require(_0xb608('0x4'));var path=require(_0xb608('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb608('0x6'));var _=require(_0xb608('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb608('0x8'));var toCsv=require(_0xb608('0x9'));var querystring=require(_0xb608('0xa'));var Papa=require(_0xb608('0xb'));var Redis=require(_0xb608('0xc'));var authService=require(_0xb608('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb608('0xe'));var logger=require(_0xb608('0xf'))('api');var utils=require(_0xb608('0x10'));var config=require(_0xb608('0x11'));var licenseUtil=require(_0xb608('0x12'));var db=require(_0xb608('0x13'))['db'];function respondWithStatusCode(_0x463a18,_0x52676e){_0x52676e=_0x52676e||0xcc;return function(_0x4e94e5){if(_0x4e94e5){return _0x463a18[_0xb608('0x14')](_0x52676e);}return _0x463a18[_0xb608('0x15')](_0x52676e)[_0xb608('0x16')]();};}function respondWithResult(_0x26d940,_0xe37fee){_0xe37fee=_0xe37fee||0xc8;return function(_0x146579){if(_0x146579){return _0x26d940[_0xb608('0x15')](_0xe37fee)[_0xb608('0x17')](_0x146579);}};}function respondWithFilteredResult(_0x2c9e28,_0x12f722){return function(_0x2912f6){if(_0x2912f6){var _0x4f1f93=typeof _0x12f722['offset']===_0xb608('0x18')&&typeof _0x12f722['limit']===_0xb608('0x18');var _0x17511b=_0x2912f6[_0xb608('0x19')];var _0x13546a=_0x4f1f93?0x0:_0x12f722[_0xb608('0x1a')];var _0x257d89=_0x4f1f93?_0x2912f6['count']:_0x12f722['offset']+_0x12f722['limit'];var _0x3fdef1;if(_0x257d89>=_0x17511b){_0x257d89=_0x17511b;_0x3fdef1=0xc8;}else{_0x3fdef1=0xce;}_0x2c9e28[_0xb608('0x15')](_0x3fdef1);return _0x2c9e28[_0xb608('0x1b')](_0xb608('0x1c'),_0x13546a+'-'+_0x257d89+'/'+_0x17511b)['json'](_0x2912f6);}return null;};}function patchUpdates(_0x59a0bd){return function(_0x47663d){try{jsonpatch[_0xb608('0x1d')](_0x47663d,_0x59a0bd,!![]);}catch(_0x4b0c9d){return BPromise[_0xb608('0x1e')](_0x4b0c9d);}return _0x47663d['save']();};}function saveUpdates(_0x519662,_0x4caa68){return function(_0x21fbb6){if(_0x21fbb6){return _0x21fbb6[_0xb608('0x1f')](_0x519662)[_0xb608('0x20')](function(_0x358cb2){return _0x358cb2;});}return null;};}function removeEntity(_0x48f8db,_0x522ddb){return function(_0x3ce5fc){if(_0x3ce5fc){return _0x3ce5fc[_0xb608('0x21')]()[_0xb608('0x20')](function(){_0x48f8db[_0xb608('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3468a4,_0x16fc57){return function(_0x3aa975){if(!_0x3aa975){_0x3468a4[_0xb608('0x14')](0x194);}return _0x3aa975;};}function handleError(_0x37dbee,_0xf9ae17){_0xf9ae17=_0xf9ae17||0x1f4;return function(_0x2cae21){logger[_0xb608('0x22')](_0x2cae21[_0xb608('0x23')]);if(_0x2cae21[_0xb608('0x24')]){delete _0x2cae21[_0xb608('0x24')];}_0x37dbee[_0xb608('0x15')](_0xf9ae17)[_0xb608('0x25')](_0x2cae21);};}exports[_0xb608('0x26')]=function(_0x108951,_0x2cfc74){var _0x470b8d={},_0x2e08c5={},_0x440530={'count':0x0,'rows':[]};var _0x17bbf3=_[_0xb608('0x27')](db[_0xb608('0x28')]['rawAttributes'],function(_0x3b9b2e){return{'name':_0x3b9b2e[_0xb608('0x29')],'type':_0x3b9b2e[_0xb608('0x2a')][_0xb608('0x2b')]};});_0x2e08c5[_0xb608('0x2c')]=_[_0xb608('0x27')](_0x17bbf3,'name');_0x2e08c5['query']=_[_0xb608('0x2d')](_0x108951['query']);_0x2e08c5['filters']=_[_0xb608('0x2e')](_0x2e08c5[_0xb608('0x2c')],_0x2e08c5[_0xb608('0x2f')]);_0x470b8d[_0xb608('0x30')]=_['intersection'](_0x2e08c5[_0xb608('0x2c')],qs[_0xb608('0x31')](_0x108951[_0xb608('0x2f')][_0xb608('0x31')]));_0x470b8d[_0xb608('0x30')]=_0x470b8d[_0xb608('0x30')]['length']?_0x470b8d[_0xb608('0x30')]:_0x2e08c5[_0xb608('0x2c')];if(!_0x108951['query']['hasOwnProperty'](_0xb608('0x32'))){_0x470b8d[_0xb608('0x33')]=qs[_0xb608('0x33')](_0x108951[_0xb608('0x2f')][_0xb608('0x33')]);_0x470b8d[_0xb608('0x1a')]=qs['offset'](_0x108951[_0xb608('0x2f')][_0xb608('0x1a')]);}_0x470b8d[_0xb608('0x34')]=qs['sort'](_0x108951['query'][_0xb608('0x35')]);_0x470b8d[_0xb608('0x36')]=qs[_0xb608('0x37')](_['pick'](_0x108951[_0xb608('0x2f')],_0x2e08c5[_0xb608('0x37')]),_0x17bbf3);if(_0x108951[_0xb608('0x2f')][_0xb608('0x38')]){_0x470b8d[_0xb608('0x36')]=_[_0xb608('0x39')](_0x470b8d[_0xb608('0x36')],{'$or':_[_0xb608('0x27')](_0x17bbf3,function(_0x1aad50){if(_0x1aad50[_0xb608('0x2a')]!==_0xb608('0x3a')){var _0x4edc11={};_0x4edc11[_0x1aad50[_0xb608('0x24')]]={'$like':'%'+_0x108951[_0xb608('0x2f')]['filter']+'%'};return _0x4edc11;}})});}_0x470b8d=_[_0xb608('0x39')]({},_0x470b8d,_0x108951['options']);var _0x4151f3={'where':_0x470b8d['where']};return db[_0xb608('0x28')][_0xb608('0x19')](_0x4151f3)['then'](function(_0x5cf166){_0x440530[_0xb608('0x19')]=_0x5cf166;if(_0x108951[_0xb608('0x2f')]['includeAll']){_0x470b8d[_0xb608('0x3b')]=[{'all':!![]}];}return db['Attachment'][_0xb608('0x3c')](_0x470b8d);})[_0xb608('0x20')](function(_0x10b736){_0x440530['rows']=_0x10b736;return _0x440530;})[_0xb608('0x20')](respondWithFilteredResult(_0x2cfc74,_0x470b8d))[_0xb608('0x3d')](handleError(_0x2cfc74,null));};exports[_0xb608('0x3e')]=function(_0x35da1c,_0x5655c5){var _0xf67f29={'raw':!![],'where':{'id':_0x35da1c[_0xb608('0x3f')]['id']}},_0x4e0618={};_0x4e0618['model']=_['keys'](db[_0xb608('0x28')][_0xb608('0x40')]);_0x4e0618[_0xb608('0x2f')]=_[_0xb608('0x2d')](_0x35da1c[_0xb608('0x2f')]);_0x4e0618[_0xb608('0x37')]=_[_0xb608('0x2e')](_0x4e0618[_0xb608('0x2c')],_0x4e0618[_0xb608('0x2f')]);_0xf67f29[_0xb608('0x30')]=_[_0xb608('0x2e')](_0x4e0618[_0xb608('0x2c')],qs[_0xb608('0x31')](_0x35da1c[_0xb608('0x2f')][_0xb608('0x31')]));_0xf67f29[_0xb608('0x30')]=_0xf67f29['attributes']['length']?_0xf67f29[_0xb608('0x30')]:_0x4e0618[_0xb608('0x2c')];if(_0x35da1c[_0xb608('0x2f')][_0xb608('0x41')]){_0xf67f29['include']=[{'all':!![]}];}_0xf67f29=_['merge']({},_0xf67f29,_0x35da1c[_0xb608('0x42')]);return db[_0xb608('0x28')][_0xb608('0x43')](_0xf67f29)['then'](handleEntityNotFound(_0x5655c5,null))['then'](respondWithResult(_0x5655c5,null))[_0xb608('0x3d')](handleError(_0x5655c5,null));};exports[_0xb608('0x44')]=function(_0x26bbcb,_0x42fe87){var _0x57525d={'where':{'id':_0x26bbcb[_0xb608('0x3f')]['id']}},_0x2566dd={};_0x2566dd['model']=_[_0xb608('0x2d')](db['Attachment'][_0xb608('0x40')]);_0x57525d[_0xb608('0x30')]=_[_0xb608('0x2e')](_0x2566dd[_0xb608('0x2c')],qs['fields'](_0x26bbcb['query'][_0xb608('0x31')]));_0x57525d['attributes']=_0x57525d[_0xb608('0x30')][_0xb608('0x45')]?_0x57525d[_0xb608('0x30')]:_0x2566dd[_0xb608('0x2c')];if(_0x26bbcb[_0xb608('0x2f')][_0xb608('0x41')]){_0x57525d[_0xb608('0x3b')]=[{'all':!![]}];}_0x57525d=_['merge']({},_0x57525d,_0x26bbcb[_0xb608('0x42')]);return db[_0xb608('0x28')][_0xb608('0x43')](_0x57525d)[_0xb608('0x20')](handleEntityNotFound(_0x42fe87,null))[_0xb608('0x20')](function(_0x3c7237){if(_0x3c7237){var _0x159a12=_0x3c7237[_0xb608('0x46')]({'plain':!![]});_0x159a12=qs[_0xb608('0x47')](_0x159a12,['id',_0xb608('0x48'),'updatedAt']);_0x26bbcb[_0xb608('0x49')]=_[_0xb608('0x47')](_0x26bbcb[_0xb608('0x49')],['id',_0xb608('0x48'),_0xb608('0x4a')]);return db[_0xb608('0x28')][_0xb608('0x4b')](_[_0xb608('0x39')](_0x159a12,_0x26bbcb[_0xb608('0x49')]),{'include':_0x26bbcb[_0xb608('0x2f')][_0xb608('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x42fe87,0xc9))[_0xb608('0x3d')](handleError(_0x42fe87,null));};exports[_0xb608('0x1f')]=function(_0x41f4f5,_0xe99ed6){if(_0x41f4f5[_0xb608('0x49')]['id']){delete _0x41f4f5[_0xb608('0x49')]['id'];}return db[_0xb608('0x28')][_0xb608('0x43')]({'where':{'id':_0x41f4f5[_0xb608('0x3f')]['id']}})[_0xb608('0x20')](handleEntityNotFound(_0xe99ed6,null))[_0xb608('0x20')](saveUpdates(_0x41f4f5['body'],null))['then'](respondWithResult(_0xe99ed6,null))[_0xb608('0x3d')](handleError(_0xe99ed6,null));};exports[_0xb608('0x21')]=function(_0x3c21f5,_0x4d9b63){return db[_0xb608('0x28')]['find']({'where':{'id':_0x3c21f5[_0xb608('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4d9b63,null))[_0xb608('0x20')](removeEntity(_0x4d9b63,null))[_0xb608('0x3d')](handleError(_0x4d9b63,null));};exports['create']=function(_0x2f7954,_0x1cf76d,_0x49523c){_0x2f7954['body'][_0xb608('0x24')]=_0x2f7954[_0xb608('0x4c')]['originalname'];_0x2f7954['body']['basename']=_0x2f7954[_0xb608('0x4c')]['filename'];_0x2f7954[_0xb608('0x49')][_0xb608('0x2a')]=_0x2f7954[_0xb608('0x4c')][_0xb608('0x4d')];return db[_0xb608('0x28')][_0xb608('0x4b')](_0x2f7954[_0xb608('0x49')])[_0xb608('0x20')](respondWithResult(_0x1cf76d,0xc9))[_0xb608('0x3d')](handleError(_0x1cf76d,null));};exports['download']=function(_0x4f7e0b,_0x215090,_0x438b8f){return db[_0xb608('0x28')][_0xb608('0x4e')]({'where':{'id':_0x4f7e0b[_0xb608('0x3f')]['id']},'raw':!![]})[_0xb608('0x20')](handleEntityNotFound(_0x215090,null))[_0xb608('0x20')](function(_0x32777d){if(_0x32777d){var _0x3599b1=_0x32777d[_0xb608('0x4f')]!==null;var _0x84386c=path[_0xb608('0x50')](config[_0xb608('0x51')],_0xb608('0x52'));if(_0x3599b1){_0x84386c=path[_0xb608('0x50')](_0x84386c,'offline-chat/');}var _0x255df4=path[_0xb608('0x50')](_0x84386c,_0x32777d[_0xb608('0x53')]);return _0x215090[_0xb608('0x54')](_0x255df4);}})['catch'](handleError(_0x215090,null));}; \ No newline at end of file +var _0xcabb=['findAll','rows','catch','show','params','rawAttributes','merge','find','clone','includeAll','get','omit','updatedAt','body','createdAt','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','send','index','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','options','Attachment','include'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xcabb,0x182));var _0xbcab=function(_0xb71344,_0x43896f){_0xb71344=_0xb71344-0x0;var _0x2c131d=_0xcabb[_0xb71344];return _0x2c131d;};'use strict';var emlformat=require(_0xbcab('0x0'));var rimraf=require(_0xbcab('0x1'));var zipdir=require(_0xbcab('0x2'));var jsonpatch=require(_0xbcab('0x3'));var rp=require(_0xbcab('0x4'));var moment=require(_0xbcab('0x5'));var BPromise=require(_0xbcab('0x6'));var Mustache=require(_0xbcab('0x7'));var util=require(_0xbcab('0x8'));var path=require(_0xbcab('0x9'));var sox=require(_0xbcab('0xa'));var csv=require(_0xbcab('0xb'));var ejs=require(_0xbcab('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbcab('0xd'));var squel=require(_0xbcab('0xe'));var crypto=require(_0xbcab('0xf'));var jsforce=require(_0xbcab('0x10'));var deskjs=require(_0xbcab('0x11'));var toCsv=require(_0xbcab('0xb'));var querystring=require(_0xbcab('0x12'));var Papa=require(_0xbcab('0x13'));var Redis=require(_0xbcab('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbcab('0x15'));var hardwareService=require(_0xbcab('0x16'));var logger=require(_0xbcab('0x17'))(_0xbcab('0x18'));var utils=require('../../config/utils');var config=require(_0xbcab('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcab('0x1a'))['db'];function respondWithStatusCode(_0x6d1724,_0x53d330){_0x53d330=_0x53d330||0xcc;return function(_0x1bf267){if(_0x1bf267){return _0x6d1724['sendStatus'](_0x53d330);}return _0x6d1724[_0xbcab('0x1b')](_0x53d330)[_0xbcab('0x1c')]();};}function respondWithResult(_0x2fb07e,_0x59f005){_0x59f005=_0x59f005||0xc8;return function(_0x258f5f){if(_0x258f5f){return _0x2fb07e['status'](_0x59f005)[_0xbcab('0x1d')](_0x258f5f);}};}function respondWithFilteredResult(_0x2b1fae,_0x5d6bd5){return function(_0x427b98){if(_0x427b98){var _0xd6d6d8=typeof _0x5d6bd5[_0xbcab('0x1e')]===_0xbcab('0x1f')&&typeof _0x5d6bd5[_0xbcab('0x20')]===_0xbcab('0x1f');var _0x5d3df8=_0x427b98[_0xbcab('0x21')];var _0xdb8b96=_0xd6d6d8?0x0:_0x5d6bd5['offset'];var _0x1a8213=_0xd6d6d8?_0x427b98[_0xbcab('0x21')]:_0x5d6bd5[_0xbcab('0x1e')]+_0x5d6bd5[_0xbcab('0x20')];var _0x1f1cd4;if(_0x1a8213>=_0x5d3df8){_0x1a8213=_0x5d3df8;_0x1f1cd4=0xc8;}else{_0x1f1cd4=0xce;}_0x2b1fae[_0xbcab('0x1b')](_0x1f1cd4);return _0x2b1fae[_0xbcab('0x22')]('Content-Range',_0xdb8b96+'-'+_0x1a8213+'/'+_0x5d3df8)['json'](_0x427b98);}return null;};}function patchUpdates(_0x5b2792){return function(_0x510941){try{jsonpatch[_0xbcab('0x23')](_0x510941,_0x5b2792,!![]);}catch(_0x1f60a2){return BPromise[_0xbcab('0x24')](_0x1f60a2);}return _0x510941['save']();};}function saveUpdates(_0x1e7a01,_0x4999a7){return function(_0x24936e){if(_0x24936e){return _0x24936e[_0xbcab('0x25')](_0x1e7a01)[_0xbcab('0x26')](function(_0x15236a){return _0x15236a;});}return null;};}function removeEntity(_0x157316,_0x1d1c48){return function(_0x16332e){if(_0x16332e){return _0x16332e[_0xbcab('0x27')]()['then'](function(){_0x157316[_0xbcab('0x1b')](0xcc)[_0xbcab('0x1c')]();});}};}function handleEntityNotFound(_0x357194,_0x21b8f3){return function(_0x313caa){if(!_0x313caa){_0x357194['sendStatus'](0x194);}return _0x313caa;};}function handleError(_0x243cf5,_0x46f689){_0x46f689=_0x46f689||0x1f4;return function(_0x5c472e){logger[_0xbcab('0x28')](_0x5c472e['stack']);if(_0x5c472e[_0xbcab('0x29')]){delete _0x5c472e[_0xbcab('0x29')];}_0x243cf5['status'](_0x46f689)[_0xbcab('0x2a')](_0x5c472e);};}exports[_0xbcab('0x2b')]=function(_0x3d1e91,_0x45c043){var _0xdc7dcd={},_0x95a9b={},_0x2c0c18={'count':0x0,'rows':[]};var _0x2be711=_['map'](db['Attachment']['rawAttributes'],function(_0x3e98b4){return{'name':_0x3e98b4[_0xbcab('0x2c')],'type':_0x3e98b4[_0xbcab('0x2d')]['key']};});_0x95a9b[_0xbcab('0x2e')]=_[_0xbcab('0x2f')](_0x2be711,_0xbcab('0x29'));_0x95a9b[_0xbcab('0x30')]=_[_0xbcab('0x31')](_0x3d1e91[_0xbcab('0x30')]);_0x95a9b[_0xbcab('0x32')]=_[_0xbcab('0x33')](_0x95a9b[_0xbcab('0x2e')],_0x95a9b[_0xbcab('0x30')]);_0xdc7dcd['attributes']=_[_0xbcab('0x33')](_0x95a9b['model'],qs['fields'](_0x3d1e91['query'][_0xbcab('0x34')]));_0xdc7dcd['attributes']=_0xdc7dcd[_0xbcab('0x35')][_0xbcab('0x36')]?_0xdc7dcd[_0xbcab('0x35')]:_0x95a9b[_0xbcab('0x2e')];if(!_0x3d1e91['query'][_0xbcab('0x37')]('nolimit')){_0xdc7dcd['limit']=qs[_0xbcab('0x20')](_0x3d1e91[_0xbcab('0x30')][_0xbcab('0x20')]);_0xdc7dcd[_0xbcab('0x1e')]=qs[_0xbcab('0x1e')](_0x3d1e91['query'][_0xbcab('0x1e')]);}_0xdc7dcd[_0xbcab('0x38')]=qs[_0xbcab('0x39')](_0x3d1e91[_0xbcab('0x30')][_0xbcab('0x39')]);_0xdc7dcd[_0xbcab('0x3a')]=qs[_0xbcab('0x32')](_[_0xbcab('0x3b')](_0x3d1e91[_0xbcab('0x30')],_0x95a9b[_0xbcab('0x32')]),_0x2be711);if(_0x3d1e91['query']['filter']){_0xdc7dcd[_0xbcab('0x3a')]=_['merge'](_0xdc7dcd[_0xbcab('0x3a')],{'$or':_[_0xbcab('0x2f')](_0x2be711,function(_0x391c84){if(_0x391c84[_0xbcab('0x2d')]!==_0xbcab('0x3c')){var _0xa71c9b={};_0xa71c9b[_0x391c84[_0xbcab('0x29')]]={'$like':'%'+_0x3d1e91[_0xbcab('0x30')]['filter']+'%'};return _0xa71c9b;}})});}_0xdc7dcd=_['merge']({},_0xdc7dcd,_0x3d1e91[_0xbcab('0x3d')]);var _0x41c32f={'where':_0xdc7dcd['where']};return db[_0xbcab('0x3e')][_0xbcab('0x21')](_0x41c32f)[_0xbcab('0x26')](function(_0x552db1){_0x2c0c18[_0xbcab('0x21')]=_0x552db1;if(_0x3d1e91[_0xbcab('0x30')]['includeAll']){_0xdc7dcd[_0xbcab('0x3f')]=[{'all':!![]}];}return db[_0xbcab('0x3e')][_0xbcab('0x40')](_0xdc7dcd);})[_0xbcab('0x26')](function(_0x2ee47b){_0x2c0c18[_0xbcab('0x41')]=_0x2ee47b;return _0x2c0c18;})[_0xbcab('0x26')](respondWithFilteredResult(_0x45c043,_0xdc7dcd))[_0xbcab('0x42')](handleError(_0x45c043,null));};exports[_0xbcab('0x43')]=function(_0x3113ab,_0x30d71f){var _0xeda02={'raw':!![],'where':{'id':_0x3113ab[_0xbcab('0x44')]['id']}},_0x18e880={};_0x18e880[_0xbcab('0x2e')]=_[_0xbcab('0x31')](db[_0xbcab('0x3e')][_0xbcab('0x45')]);_0x18e880['query']=_[_0xbcab('0x31')](_0x3113ab[_0xbcab('0x30')]);_0x18e880['filters']=_[_0xbcab('0x33')](_0x18e880[_0xbcab('0x2e')],_0x18e880[_0xbcab('0x30')]);_0xeda02[_0xbcab('0x35')]=_[_0xbcab('0x33')](_0x18e880[_0xbcab('0x2e')],qs[_0xbcab('0x34')](_0x3113ab[_0xbcab('0x30')][_0xbcab('0x34')]));_0xeda02['attributes']=_0xeda02['attributes'][_0xbcab('0x36')]?_0xeda02[_0xbcab('0x35')]:_0x18e880[_0xbcab('0x2e')];if(_0x3113ab[_0xbcab('0x30')]['includeAll']){_0xeda02[_0xbcab('0x3f')]=[{'all':!![]}];}_0xeda02=_[_0xbcab('0x46')]({},_0xeda02,_0x3113ab[_0xbcab('0x3d')]);return db['Attachment'][_0xbcab('0x47')](_0xeda02)[_0xbcab('0x26')](handleEntityNotFound(_0x30d71f,null))[_0xbcab('0x26')](respondWithResult(_0x30d71f,null))['catch'](handleError(_0x30d71f,null));};exports[_0xbcab('0x48')]=function(_0x5a17b2,_0x2d9221){var _0x2fc1a2={'where':{'id':_0x5a17b2[_0xbcab('0x44')]['id']}},_0xaa15aa={};_0xaa15aa[_0xbcab('0x2e')]=_[_0xbcab('0x31')](db[_0xbcab('0x3e')]['rawAttributes']);_0x2fc1a2[_0xbcab('0x35')]=_['intersection'](_0xaa15aa[_0xbcab('0x2e')],qs['fields'](_0x5a17b2[_0xbcab('0x30')][_0xbcab('0x34')]));_0x2fc1a2['attributes']=_0x2fc1a2[_0xbcab('0x35')][_0xbcab('0x36')]?_0x2fc1a2[_0xbcab('0x35')]:_0xaa15aa[_0xbcab('0x2e')];if(_0x5a17b2['query'][_0xbcab('0x49')]){_0x2fc1a2['include']=[{'all':!![]}];}_0x2fc1a2=_['merge']({},_0x2fc1a2,_0x5a17b2[_0xbcab('0x3d')]);return db[_0xbcab('0x3e')]['find'](_0x2fc1a2)[_0xbcab('0x26')](handleEntityNotFound(_0x2d9221,null))[_0xbcab('0x26')](function(_0x5e79c3){if(_0x5e79c3){var _0x1de9fd=_0x5e79c3[_0xbcab('0x4a')]({'plain':!![]});_0x1de9fd=qs[_0xbcab('0x4b')](_0x1de9fd,['id','createdAt',_0xbcab('0x4c')]);_0x5a17b2[_0xbcab('0x4d')]=_[_0xbcab('0x4b')](_0x5a17b2['body'],['id',_0xbcab('0x4e'),_0xbcab('0x4c')]);return db['Attachment'][_0xbcab('0x4f')](_['merge'](_0x1de9fd,_0x5a17b2[_0xbcab('0x4d')]),{'include':_0x5a17b2[_0xbcab('0x30')][_0xbcab('0x49')]?[{'all':!![]}]:undefined});}})[_0xbcab('0x26')](respondWithResult(_0x2d9221,0xc9))['catch'](handleError(_0x2d9221,null));};exports['update']=function(_0x279e9e,_0x42c52c){if(_0x279e9e[_0xbcab('0x4d')]['id']){delete _0x279e9e['body']['id'];}return db[_0xbcab('0x3e')]['find']({'where':{'id':_0x279e9e[_0xbcab('0x44')]['id']}})[_0xbcab('0x26')](handleEntityNotFound(_0x42c52c,null))['then'](saveUpdates(_0x279e9e[_0xbcab('0x4d')],null))['then'](respondWithResult(_0x42c52c,null))[_0xbcab('0x42')](handleError(_0x42c52c,null));};exports[_0xbcab('0x27')]=function(_0x23ed04,_0x37c54f){return db['Attachment'][_0xbcab('0x47')]({'where':{'id':_0x23ed04[_0xbcab('0x44')]['id']}})['then'](handleEntityNotFound(_0x37c54f,null))[_0xbcab('0x26')](removeEntity(_0x37c54f,null))[_0xbcab('0x42')](handleError(_0x37c54f,null));};exports[_0xbcab('0x4f')]=function(_0x41728e,_0x569c43,_0xe71cf5){_0x41728e[_0xbcab('0x4d')][_0xbcab('0x29')]=_0x41728e[_0xbcab('0x50')]['originalname'];_0x41728e[_0xbcab('0x4d')][_0xbcab('0x51')]=_0x41728e['file'][_0xbcab('0x52')];_0x41728e['body'][_0xbcab('0x2d')]=_0x41728e['file'][_0xbcab('0x53')];return db[_0xbcab('0x3e')][_0xbcab('0x4f')](_0x41728e[_0xbcab('0x4d')])['then'](respondWithResult(_0x569c43,0xc9))[_0xbcab('0x42')](handleError(_0x569c43,null));};exports[_0xbcab('0x54')]=function(_0x4d8aab,_0x269ff1,_0x2eb6dc){return db[_0xbcab('0x3e')][_0xbcab('0x55')]({'where':{'id':_0x4d8aab[_0xbcab('0x44')]['id']},'raw':!![]})[_0xbcab('0x26')](handleEntityNotFound(_0x269ff1,null))['then'](function(_0x50b1a8){if(_0x50b1a8){var _0x2df2ec=_0x50b1a8[_0xbcab('0x56')]!==null;var _0xa786d4=path[_0xbcab('0x57')](config[_0xbcab('0x58')],'server/files/attachments/');if(_0x2df2ec){_0xa786d4=path['join'](_0xa786d4,_0xbcab('0x59'));}var _0xe320b4=path['join'](_0xa786d4,_0x50b1a8[_0xbcab('0x51')]);return _0x269ff1[_0xbcab('0x54')](_0xe320b4);}})[_0xbcab('0x42')](handleError(_0x269ff1,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index d86cfd0..aa5f8a5 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 _0x4f0e=['path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x4f0e,0x11b));var _0xe4f0=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x4f0e[_0x25e109];return _0xc0f7d6;};'use strict';var _=require(_0xe4f0('0x0'));var util=require('util');var logger=require(_0xe4f0('0x1'))(_0xe4f0('0x2'));var moment=require(_0xe4f0('0x3'));var BPromise=require(_0xe4f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4f0('0x5'));var rimraf=require(_0xe4f0('0x6'));var config=require(_0xe4f0('0x7'));var attributes=require(_0xe4f0('0x8'));module['exports']=function(_0x3325f8,_0x6163e8){return _0x3325f8[_0xe4f0('0x9')](_0xe4f0('0xa'),attributes,{'tableName':_0xe4f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c17=['Attachment','lodash','api','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x540471,_0x40cd73){var _0x394d2d=function(_0xcad0ff){while(--_0xcad0ff){_0x540471['push'](_0x540471['shift']());}};_0x394d2d(++_0x40cd73);}(_0x3c17,0x97));var _0x73c1=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x3c17[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x73c1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x73c1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x73c1('0x2'));var fs=require('fs');var path=require(_0x73c1('0x3'));var rimraf=require(_0x73c1('0x4'));var config=require(_0x73c1('0x5'));var attributes=require(_0x73c1('0x6'));module[_0x73c1('0x7')]=function(_0x1b4d54,_0x1fe184){return _0x1b4d54[_0x73c1('0x8')](_0x73c1('0x9'),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 6a50d27..6bf4772 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 _0xda65=['info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','body','options','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x10d82a,_0x34ff57){var _0x6cdfbc=function(_0x2e9eef){while(--_0x2e9eef){_0x10d82a['push'](_0x10d82a['shift']());}};_0x6cdfbc(++_0x34ff57);}(_0xda65,0x1d0));var _0x5da6=function(_0x1ff911,_0x184f3d){_0x1ff911=_0x1ff911-0x0;var _0x19d1f6=_0xda65[_0x1ff911];return _0x19d1f6;};'use strict';var _=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var moment=require(_0x5da6('0x2'));var BPromise=require('bluebird');var rs=require(_0x5da6('0x3'));var fs=require('fs');var Redis=require(_0x5da6('0x4'));var db=require(_0x5da6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5da6('0x6'));var config=require(_0x5da6('0x7'));var jayson=require(_0x5da6('0x8'));var client=jayson[_0x5da6('0x9')][_0x5da6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51924c,_0x35aff9,_0x4a7040){return new BPromise(function(_0x55108e,_0x40722c){return client['request'](_0x51924c,_0x4a7040)[_0x5da6('0xb')](function(_0x20cb14){logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));logger[_0x5da6('0xf')](_0x5da6('0x10'),_0x35aff9,_0x5da6('0xe'),JSON['stringify'](_0x20cb14));if(_0x20cb14[_0x5da6('0x11')]){if(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x12')]===0x1f4){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x40722c(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}logger['error'](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x55108e(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}else{logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));_0x55108e(_0x20cb14[_0x5da6('0x14')][_0x5da6('0x13')]);}})['catch'](function(_0x5207e5){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x5207e5);_0x40722c(_0x5207e5);});});}exports[_0x5da6('0x15')]=function(_0x4c3b2d){var _0x4bc49a=this;return new Promise(function(_0x4b42e4,_0x394c63){return db[_0x5da6('0x16')][_0x5da6('0x17')](_0x4c3b2d[_0x5da6('0x18')],{'raw':_0x4c3b2d['options']?_0x4c3b2d[_0x5da6('0x19')][_0x5da6('0x1a')]===undefined?!![]:![]:!![]})[_0x5da6('0xb')](function(_0x24500d){logger[_0x5da6('0xc')](_0x5da6('0x15'),_0x4c3b2d);logger[_0x5da6('0xf')](_0x5da6('0x15'),_0x4c3b2d,JSON['stringify'](_0x24500d));_0x4b42e4(_0x24500d);})[_0x5da6('0x1b')](function(_0x5ad81b){logger[_0x5da6('0x11')](_0x5da6('0x15'),_0x5ad81b[_0x5da6('0x13')],_0x4c3b2d);_0x394c63(_0x4bc49a[_0x5da6('0x11')](0x1f4,_0x5ad81b[_0x5da6('0x13')]));});});}; \ No newline at end of file +var _0x99e9=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','body','raw','CreateAttachment','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x22adda,_0x18243a){var _0x143d3a=function(_0x200e74){while(--_0x200e74){_0x22adda['push'](_0x22adda['shift']());}};_0x143d3a(++_0x18243a);}(_0x99e9,0xb4));var _0x999e=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x99e9[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('Attachment,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});}exports['CreateAttachment']=function(_0x4fcdfb){var _0x3153ce=this;return new Promise(function(_0x43b09e,_0xc4ef74){return db[_0x999e('0x17')][_0x999e('0x18')](_0x4fcdfb[_0x999e('0x19')],{'raw':_0x4fcdfb['options']?_0x4fcdfb['options'][_0x999e('0x1a')]===undefined?!![]:![]:!![]})[_0x999e('0xb')](function(_0x3b3642){logger['info'](_0x999e('0x1b'),_0x4fcdfb);logger[_0x999e('0xf')](_0x999e('0x1b'),_0x4fcdfb,JSON[_0x999e('0x11')](_0x3b3642));_0x43b09e(_0x3b3642);})[_0x999e('0x16')](function(_0x3750a0){logger[_0x999e('0x12')]('CreateAttachment',_0x3750a0['message'],_0x4fcdfb);_0xc4ef74(_0x3153ce[_0x999e('0x12')](0x1f4,_0x3750a0[_0x999e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 3a4624a..51a17fd 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x19feaa,_0x64f982){_0x19feaa=_0x19feaa-0x0;var _0x3cad63=_0xdb28[_0x19feaa];return _0x3cad63;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +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(_0x4b7ef2,_0x29212f){var _0x392166=function(_0x143e88){while(--_0x143e88){_0x4b7ef2['push'](_0x4b7ef2['shift']());}};_0x392166(++_0x29212f);}(_0x2032,0xd9));var _0x2203=function(_0x149e7e,_0x29d3cc){_0x149e7e=_0x149e7e-0x0;var _0x5eb1b7=_0x2032[_0x149e7e];return _0x5eb1b7;};'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 diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 24a3752..4ae8a60 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 _0xf62a=['Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','blocked','online','admin','user','agent','disabled','blockedAt','add','blockDuration','minutes','clearBlockUser','getLicense','status','send','message','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','User','passport-local','Strategy','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf62a,0x12b));var _0xaf62=function(_0x42c420,_0x52750b){_0x42c420=_0x42c420-0x0;var _0x1b8988=_0xf62a[_0x42c420];return _0x1b8988;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xaf62('0x0'))[_0xaf62('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xaf62('0x2'));var BPromise=require(_0xaf62('0x3'));var util=require(_0xaf62('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xaf62('0x5'));var utils=require(_0xaf62('0x6'));var config=require(_0xaf62('0x7'));var logger=require(_0xaf62('0x8'))(_0xaf62('0x9'));function isActiveDirectoryConfigured(_0x438535){var _0x2cee41=![];if(typeof _0x438535[_0xaf62('0xa')]!==_0xaf62('0xb')){_0x2cee41=_0x438535[_0xaf62('0xa')][_0xaf62('0xc')]&&_0x438535[_0xaf62('0xa')][_0xaf62('0xd')]&&_0x438535[_0xaf62('0xa')][_0xaf62('0xe')];}return _0x2cee41;}function adAuthenticate(_0x1a503f,_0x488ee3,_0x47f65b){return new BPromise(function(_0x15b058,_0x3d304c){try{var _0x5af205=new ActiveDirectory(_0x1a503f);_0x5af205['authenticate'](_0x488ee3,_0x47f65b,function(_0x1a34d6,_0x321ee0){if(_0x1a34d6){logger[_0xaf62('0xf')](_0xaf62('0x10'),_0x488ee3,util['inspect'](_0x1a34d6,{'showHidden':![],'depth':null}));_0x3d304c(_0xaf62('0x11'));}else if(!_0x321ee0){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x488ee3);_0x3d304c(_0xaf62('0x11'));}else{_0x15b058(_0x321ee0);}});}catch(_0x3164af){_0x3d304c(_0x3164af);}});}function ActiveDirectoryAuthenticate(_0x292a1a,_0x49e7bf,_0x5edd69,_0x4590b3){var _0x1d22ab,_0x4cf33b;if(!isActiveDirectoryConfigured(config)){logger[_0xaf62('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x49e7bf);return _0x4590b3(null,![],{'message':_0xaf62('0x11')});}return db[_0xaf62('0x12')][_0xaf62('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xaf62('0x14')](function(_0x306e79){_0x1d22ab=_0x306e79;if(!_0x1d22ab['adSsoEnabled']){logger[_0xaf62('0xf')](_0xaf62('0x15'),_0x49e7bf);throw new Error(_0xaf62('0x11'));}return _0x292a1a[_0xaf62('0x13')]({'attributes':['id',_0xaf62('0x16'),_0xaf62('0x17'),'salt',_0xaf62('0x18'),'disabled',_0xaf62('0x19'),'blockedAt',_0xaf62('0x1a')],'where':{'name':_0x49e7bf,'role':{'$or':[_0xaf62('0x1b'),_0xaf62('0x1c'),_0xaf62('0x1d')]},'adSsoEnabled':!![]}});})[_0xaf62('0x14')](function(_0x194480){if(!_0x194480||_0x194480&&_0x194480[_0xaf62('0x16')]!==_0x49e7bf){throw new Error(_0xaf62('0x11'));}_0x4cf33b=_0x194480;var _0x3d5c77=_0x4cf33b[_0xaf62('0x16')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config['activedirectory'],_0x3d5c77,_0x5edd69);})[_0xaf62('0x14')](function(_0x5cd6fc){if(_0x4cf33b[_0xaf62('0x1e')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x1d22ab['blockDuration']>0x0){if(_0x4cf33b[_0xaf62('0x19')]){if(moment(_0x4cf33b[_0xaf62('0x1f')])[_0xaf62('0x20')](_0x1d22ab[_0xaf62('0x21')],_0xaf62('0x22'))>moment()){throw new Error(_0xaf62('0x11'));}return utils[_0xaf62('0x23')](_0x4cf33b,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4cf33b);})[_0xaf62('0x14')](function(){return _0x4590b3(null,_0x4cf33b);});}else{return utils[_0xaf62('0x24')](_0x4cf33b)[_0xaf62('0x14')](function(){return _0x4590b3(null,_0x4cf33b);});}}else{return utils['getLicense'](_0x4cf33b)[_0xaf62('0x14')](function(){return _0x4590b3(null,_0x4cf33b);});}})['catch'](function(_0x42347d){return _0x4590b3(null,![],_0x42347d);});}function handleError(_0x2146bc,_0x14781c,_0x5d7862){return _0x2146bc[_0xaf62('0x25')](_0x14781c||0x1f4)[_0xaf62('0x26')]({'message':_0x5d7862?_0x5d7862[_0xaf62('0x27')]||_0x5d7862:''});}exports[_0xaf62('0x28')]=function(_0x1a8d6c,_0x1bc8ff,_0x5d8a39){passport[_0xaf62('0x29')]('ad-login',function(_0x14dd12,_0x24f390,_0x18c6f4){var _0x121247=_0x14dd12||_0x18c6f4;if(_0x121247){return handleError(_0x1bc8ff,0x191,_0x121247);}if(!_0x24f390){return handleError(_0x1bc8ff,0x194,{'message':_0xaf62('0x2a')});}else{var _0x194532={'payload':{'id':_0x24f390['id'],'role':_0x24f390[_0xaf62('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x194532)[_0xaf62('0x14')](function(_0x3063b9){_0x1bc8ff[_0xaf62('0x2b')]({'id':_0x24f390['id'],'token':_0x3063b9,'statusCall':'','isAlreadyLogged':_0x24f390['online']});});}})(_0x1a8d6c,_0x1bc8ff,_0x5d8a39);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0xaf62('0x16'),'passwordField':_0xaf62('0x17')},function(_0x12d609,_0x3b21ea,_0x238fbb){return ActiveDirectoryAuthenticate(db[_0xaf62('0x2c')],_0x12d609,_0x3b21ea,_0x238fbb);})); \ No newline at end of file +var _0xdad4=['activedirectory','url','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blocked','blockedAt','admin','user','agent','name','domain','blockDuration','add','minutes','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','undefined'];(function(_0x1a65c7,_0x2330a5){var _0x5518b2=function(_0x4daaa3){while(--_0x4daaa3){_0x1a65c7['push'](_0x1a65c7['shift']());}};_0x5518b2(++_0x2330a5);}(_0xdad4,0x82));var _0x4dad=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0xdad4[_0x2650e9];return _0x3511c8;};'use strict';var passport=require(_0x4dad('0x0'));var LocalStrategy=require(_0x4dad('0x1'))[_0x4dad('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x4dad('0x3'));var BPromise=require(_0x4dad('0x4'));var util=require(_0x4dad('0x5'));var db=require(_0x4dad('0x6'))['db'];var authService=require(_0x4dad('0x7'));var utils=require('../../config/utils');var config=require(_0x4dad('0x8'));var logger=require(_0x4dad('0x9'))('api');function isActiveDirectoryConfigured(_0x236e40){var _0x5dcbb9=![];if(typeof _0x236e40['activedirectory']!==_0x4dad('0xa')){_0x5dcbb9=_0x236e40[_0x4dad('0xb')]['baseDN']&&_0x236e40['activedirectory'][_0x4dad('0xc')]&&_0x236e40[_0x4dad('0xb')]['domain'];}return _0x5dcbb9;}function adAuthenticate(_0xc1ba81,_0x1f6ecb,_0x3ed418){return new BPromise(function(_0x757019,_0x2f4eac){try{var _0x572fb9=new ActiveDirectory(_0xc1ba81);_0x572fb9[_0x4dad('0xd')](_0x1f6ecb,_0x3ed418,function(_0x11d33e,_0x5412a1){if(_0x11d33e){logger[_0x4dad('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x1f6ecb,util['inspect'](_0x11d33e,{'showHidden':![],'depth':null}));_0x2f4eac(_0x4dad('0xf'));}else if(!_0x5412a1){logger[_0x4dad('0xe')](_0x4dad('0x10'),_0x1f6ecb);_0x2f4eac(_0x4dad('0xf'));}else{_0x757019(_0x5412a1);}});}catch(_0x457888){_0x2f4eac(_0x457888);}});}function ActiveDirectoryAuthenticate(_0x3bf7f4,_0x4fd8fd,_0x3bf669,_0x210551){var _0x4155b3,_0xbf9c0f;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4dad('0x11'),_0x4fd8fd);return _0x210551(null,![],{'message':_0x4dad('0xf')});}return db[_0x4dad('0x12')][_0x4dad('0x13')]({'where':{'id':0x1},'attributes':[_0x4dad('0x14'),'blockDuration'],'raw':!![]})[_0x4dad('0x15')](function(_0x344acb){_0x4155b3=_0x344acb;if(!_0x4155b3[_0x4dad('0x14')]){logger['error'](_0x4dad('0x16'),_0x4fd8fd);throw new Error(_0x4dad('0xf'));}return _0x3bf7f4[_0x4dad('0x13')]({'attributes':['id','name',_0x4dad('0x17'),'salt',_0x4dad('0x18'),_0x4dad('0x19'),_0x4dad('0x1a'),_0x4dad('0x1b'),'online'],'where':{'name':_0x4fd8fd,'role':{'$or':[_0x4dad('0x1c'),_0x4dad('0x1d'),_0x4dad('0x1e')]},'adSsoEnabled':!![]}});})[_0x4dad('0x15')](function(_0x455eed){if(!_0x455eed||_0x455eed&&_0x455eed[_0x4dad('0x1f')]!==_0x4fd8fd){throw new Error(_0x4dad('0xf'));}_0xbf9c0f=_0x455eed;var _0x44a32e=_0xbf9c0f[_0x4dad('0x1f')]+'@'+config[_0x4dad('0xb')][_0x4dad('0x20')];return adAuthenticate(config[_0x4dad('0xb')],_0x44a32e,_0x3bf669);})[_0x4dad('0x15')](function(_0x463b55){if(_0xbf9c0f['disabled']){throw new Error(_0x4dad('0xf'));}if(_0x4155b3[_0x4dad('0x21')]>0x0){if(_0xbf9c0f['blocked']){if(moment(_0xbf9c0f['blockedAt'])[_0x4dad('0x22')](_0x4155b3[_0x4dad('0x21')],_0x4dad('0x23'))>moment()){throw new Error(_0x4dad('0xf'));}return utils['clearBlockUser'](_0xbf9c0f,0x0,![],null)['then'](function(){return utils[_0x4dad('0x24')](_0xbf9c0f);})[_0x4dad('0x15')](function(){return _0x210551(null,_0xbf9c0f);});}else{return utils[_0x4dad('0x24')](_0xbf9c0f)[_0x4dad('0x15')](function(){return _0x210551(null,_0xbf9c0f);});}}else{return utils[_0x4dad('0x24')](_0xbf9c0f)['then'](function(){return _0x210551(null,_0xbf9c0f);});}})[_0x4dad('0x25')](function(_0x1b1b4b){return _0x210551(null,![],_0x1b1b4b);});}function handleError(_0x50dcd5,_0x421a35,_0xb09049){return _0x50dcd5[_0x4dad('0x26')](_0x421a35||0x1f4)['send']({'message':_0xb09049?_0xb09049[_0x4dad('0x27')]||_0xb09049:''});}exports[_0x4dad('0x28')]=function(_0x4ed9d9,_0x4a8968,_0x2b31d7){passport[_0x4dad('0xd')](_0x4dad('0x29'),function(_0x1d86e2,_0x1b6d37,_0xdf8612){var _0x48ffdb=_0x1d86e2||_0xdf8612;if(_0x48ffdb){return handleError(_0x4a8968,0x191,_0x48ffdb);}if(!_0x1b6d37){return handleError(_0x4a8968,0x194,{'message':_0x4dad('0x2a')});}else{var _0x17f9a5={'payload':{'id':_0x1b6d37['id'],'role':_0x1b6d37[_0x4dad('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0x4dad('0x2b')](_0x17f9a5)['then'](function(_0x1d400b){_0x4a8968[_0x4dad('0x2c')]({'id':_0x1b6d37['id'],'token':_0x1d400b,'statusCall':'','isAlreadyLogged':_0x1b6d37[_0x4dad('0x2d')]});});}})(_0x4ed9d9,_0x4a8968,_0x2b31d7);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0x4dad('0x1f'),'passwordField':_0x4dad('0x17')},function(_0x38f856,_0x4eb2c6,_0x2e90e1){return ActiveDirectoryAuthenticate(db[_0x4dad('0x2e')],_0x38f856,_0x4eb2c6,_0x2e90e1);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 1ea54bd..5b1cc06 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 _0x0f33=['./authActiveDirectory.controller','post','login','exports','Router'];(function(_0x1213ca,_0x341691){var _0x2fdd6f=function(_0x41d9b1){while(--_0x41d9b1){_0x1213ca['push'](_0x1213ca['shift']());}};_0x2fdd6f(++_0x341691);}(_0x0f33,0xfe));var _0x30f3=function(_0x123f1a,_0x5219c1){_0x123f1a=_0x123f1a-0x0;var _0x5908cd=_0x0f33[_0x123f1a];return _0x5908cd;};'use strict';var express=require('express');var router=express[_0x30f3('0x0')]();var controller=require(_0x30f3('0x1'));router[_0x30f3('0x2')]('/',controller[_0x30f3('0x3')]);module[_0x30f3('0x4')]=router; \ No newline at end of file +var _0x72d8=['post','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72d8,0x1da));var _0x872d=function(_0x3ceac4,_0xf57186){_0x3ceac4=_0x3ceac4-0x0;var _0x9e4fe8=_0x72d8[_0x3ceac4];return _0x9e4fe8;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x872d('0x0')]('/',controller['login']);module[_0x872d('0x1')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 5a77eeb..3301978 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(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x7a54,0x106));var _0x47a5=function(_0x1c7df5,_0xee9fb2){_0x1c7df5=_0x1c7df5-0x0;var _0x38c085=_0x7a54[_0x1c7df5];return _0x38c085;};'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(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x7a54,0x106));var _0x47a5=function(_0x19715e,_0x198660){_0x19715e=_0x19715e-0x0;var _0x232fe1=_0x7a54[_0x19715e];return _0x232fe1;};'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 9499093..0a43aaf 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 _0xcd84=['setTokenCookie','exports','express','Router','./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','isMiddleware'];(function(_0x5476c6,_0x500530){var _0x229446=function(_0x1dd127){while(--_0x1dd127){_0x5476c6['push'](_0x5476c6['shift']());}};_0x229446(++_0x500530);}(_0xcd84,0x178));var _0x4cd8=function(_0x147eed,_0xe7c824){_0x147eed=_0x147eed-0x0;var _0xd818a1=_0xcd84[_0x147eed];return _0xd818a1;};'use strict';var express=require(_0x4cd8('0x0'));var passport=require('passport');var router=express[_0x4cd8('0x1')]();var controller=require(_0x4cd8('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x4cd8('0x3'));router[_0x4cd8('0x4')]('/',controller[_0x4cd8('0x5')]);router[_0x4cd8('0x4')](_0x4cd8('0x6'),controller[_0x4cd8('0x7')],authService[_0x4cd8('0x8')],userController['login'],authService[_0x4cd8('0x9')]);module[_0x4cd8('0xa')]=router; \ No newline at end of file +var _0x8ff8=['express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','isMiddleware','login'];(function(_0x38f0f5,_0xa05f6b){var _0x2b0368=function(_0x59c04a){while(--_0x59c04a){_0x38f0f5['push'](_0x38f0f5['shift']());}};_0x2b0368(++_0xa05f6b);}(_0x8ff8,0x1e8));var _0x88ff=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8ff8[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0x88ff('0x0'));var passport=require('passport');var router=express[_0x88ff('0x1')]();var controller=require(_0x88ff('0x2'));var userController=require(_0x88ff('0x3'));var authService=require(_0x88ff('0x4'));router[_0x88ff('0x5')]('/',controller['login']);router[_0x88ff('0x5')]('/callback',controller['callback'],authService[_0x88ff('0x6')],userController[_0x88ff('0x7')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index dae0bcf..965b12f 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 _0x0857=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','disabled','add','minutes','getLicense','catch','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','Reset\x20Email\x20sent!','find','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','previousPasswords','passwordHistoryLimit','resetPasswordExpires','save','status','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','role','blocked','blockedAt','loginAttempts','admin','user','agent'];(function(_0x4c0f74,_0x4cd09f){var _0x5d04a0=function(_0x55b74a){while(--_0x55b74a){_0x4c0f74['push'](_0x4c0f74['shift']());}};_0x5d04a0(++_0x4cd09f);}(_0x0857,0x8f));var _0x7085=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0857[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x7085('0x0'));var passport=require(_0x7085('0x1'));var LocalStrategy=require(_0x7085('0x2'))[_0x7085('0x3')];var jayson=require(_0x7085('0x4'));var _=require('lodash');var rs=require(_0x7085('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x7085('0x6'));var utils=require(_0x7085('0x7'));var client=jayson[_0x7085('0x8')][_0x7085('0x9')]({'port':0x232b});function localAuthenticate(_0x4ac1f5,_0xed844,_0x10921d,_0x13b6ff){var _0xaff8dc,_0x5acc7c;return db[_0x7085('0xa')][_0x7085('0xb')]({'where':{'id':0x1},'attributes':[_0x7085('0xc'),_0x7085('0xd')],'raw':!![]})[_0x7085('0xe')](function(_0x130073){_0xaff8dc=_0x130073;return _0x4ac1f5[_0x7085('0xb')]({'attributes':['id',_0x7085('0xf'),'password','salt',_0x7085('0x10'),'disabled',_0x7085('0x11'),_0x7085('0x12'),_0x7085('0x13')],'where':{'name':_0xed844,'role':{'$or':[_0x7085('0x14'),_0x7085('0x15'),_0x7085('0x16')]}}});})[_0x7085('0xe')](function(_0x407024){if(!_0x407024||_0x407024&&_0x407024['name']!==_0xed844){throw new Error(_0x7085('0x17'));}else{_0x5acc7c=_0x407024;return _0x5acc7c;}})[_0x7085('0xe')](function(){_0x5acc7c['authenticate'](_0x10921d,function(_0x47fd1f,_0x3f0a9a){var _0x2ae9ac=_0x5acc7c[_0x7085('0x13')]+0x1;if(_0x47fd1f){return _0x13b6ff(_0x47fd1f);}else if(!_0x3f0a9a){if(_0x5acc7c['disabled']){return _0x13b6ff(null,![],{'message':_0x7085('0x17')});}else if(_0xaff8dc[_0x7085('0xc')]>0x0){if(_0x5acc7c['blocked']){if(_0xaff8dc[_0x7085('0xd')]>0x0){if(moment(_0x5acc7c[_0x7085('0x12')])['add'](_0xaff8dc[_0x7085('0xd')],'minutes')>moment()){return _0x13b6ff(null,![],{'message':_0x7085('0x17')});}else{return utils[_0x7085('0x18')](_0x5acc7c,_0x2ae9ac,![],null)['then'](function(){return _0x13b6ff(null,![],{'message':_0x7085('0x17')});});}}else{return _0x13b6ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2ae9ac>=_0xaff8dc[_0x7085('0xc')]){return utils[_0x7085('0x18')](_0x5acc7c,0x0,!![],moment())[_0x7085('0xe')](function(){return _0x13b6ff(null,![],{'message':_0x7085('0x17')});});}else{return utils['clearBlockUser'](_0x5acc7c,_0x2ae9ac,![],null)[_0x7085('0xe')](function(){return _0x13b6ff(null,![],{'message':_0x7085('0x17')});});}}}else{return _0x13b6ff(null,![],{'message':_0x7085('0x17')});}}else{if(_0x5acc7c[_0x7085('0x19')]){return _0x13b6ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xaff8dc['allowedLoginAttempts']>0x0){if(_0x5acc7c[_0x7085('0x11')]){if(_0xaff8dc[_0x7085('0xd')]>0x0){if(moment(_0x5acc7c['blockedAt'])[_0x7085('0x1a')](_0xaff8dc[_0x7085('0xd')],_0x7085('0x1b'))>moment()){return _0x13b6ff(null,![],{'message':_0x7085('0x17')});}else{return utils['clearBlockUser'](_0x5acc7c,0x0,![],null)[_0x7085('0xe')](function(){return utils[_0x7085('0x1c')](_0x5acc7c);})[_0x7085('0xe')](function(){return _0x13b6ff(null,_0x5acc7c);});}}else{return _0x13b6ff(null,![],{'message':_0x7085('0x17')});}}else{return utils[_0x7085('0x18')](_0x5acc7c,0x0,![],null)['then'](function(){return utils[_0x7085('0x1c')](_0x5acc7c);})[_0x7085('0xe')](function(){return _0x13b6ff(null,_0x5acc7c);})[_0x7085('0x1d')](function(_0x4568f1){return _0x13b6ff(null,![],_0x4568f1);});}}else{if(_0x5acc7c['blocked']){return _0x13b6ff(null,![],{'message':_0x7085('0x17')});}else{return utils[_0x7085('0x1c')](_0x5acc7c)[_0x7085('0xe')](function(){return _0x13b6ff(null,_0x5acc7c);});}}}});})[_0x7085('0x1d')](function(_0x465b65){return _0x13b6ff(null,![],_0x465b65);});}function sendServiceMail(_0x4633bc){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x7085('0xf'),_0x7085('0x1e')],'include':[{'model':db[_0x7085('0x1f')],'as':_0x7085('0x20'),'include':[{'model':db[_0x7085('0x21')],'as':_0x7085('0x21')}]}]})[_0x7085('0xe')](function(_0x128633){if(!_0x128633){throw new Error(_0x7085('0x22'));}var _0x4b770f=_0x128633[_0x7085('0x23')]();var _0x3477f9={'account':_0x4b770f,'message':_[_0x7085('0x24')]({'from':util[_0x7085('0x25')](_0x7085('0x26'),_0x128633[_0x7085('0xf')],_0x128633[_0x7085('0x1e')]||_0x128633[_0x7085('0x20')][_0x7085('0x15')])},_0x4633bc)};return client[_0x7085('0x27')](_0x7085('0x28'),_0x3477f9);})[_0x7085('0xe')](function(_0x56dded){if(_0x56dded['error']){throw new Error(util[_0x7085('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x56dded[_0x7085('0x29')][_0x7085('0x2a')]||JSON[_0x7085('0x2b')](_0x56dded['error'])));}return!![];});}function handleError(_0xe2f9bf,_0x32b289,_0x28584d){return _0xe2f9bf['status'](_0x32b289||0x1f4)[_0x7085('0x2c')]({'message':_0x28584d?_0x28584d[_0x7085('0x2a')]||_0x28584d:''});}exports[_0x7085('0x2d')]=function(_0x243f53,_0x7d4b71,_0x2aad56){passport['authenticate']('local-login',function(_0x4d047a,_0x23d21c,_0x5f3434){var _0xb2d556=_0x4d047a||_0x5f3434;if(_0xb2d556){return handleError(_0x7d4b71,0x191,_0xb2d556);}if(!_0x23d21c){return handleError(_0x7d4b71,0x194,{'message':_0x7085('0x2e')});}else{var _0x6c7464={'payload':{'id':_0x23d21c['id'],'role':_0x23d21c[_0x7085('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x6c7464)[_0x7085('0xe')](function(_0x504625){_0x7d4b71[_0x7085('0x2f')]({'id':_0x23d21c['id'],'token':_0x504625,'statusCall':'','isAlreadyLogged':_0x23d21c[_0x7085('0x30')]});});}})(_0x243f53,_0x7d4b71,_0x2aad56);};exports[_0x7085('0x31')]=function(_0x5e4d07,_0x4c6f9f){if(!_0x5e4d07[_0x7085('0x32')]['email']){return handleError(_0x4c6f9f,0x1f4,{'message':_0x7085('0x33')});}var _0x10e3fd=rs[_0x7085('0x34')]();_0x5e4d07[_0x7085('0x32')][_0x7085('0x1e')]=_0x5e4d07['body']['email'][_0x7085('0x35')]()[_0x7085('0x36')]();var _0x259413;return db[_0x7085('0xa')][_0x7085('0xb')]({'where':{'id':0x1},'attributes':[_0x7085('0xc'),_0x7085('0xd')],'raw':!![]})[_0x7085('0xe')](function(_0x5191ad){_0x259413=_0x5191ad;return db[_0x7085('0x37')]['find']({'where':{'email':_0x5e4d07[_0x7085('0x32')][_0x7085('0x1e')]}});})['then'](function(_0x481fd0){if(!_0x481fd0){throw new Error(_0x7085('0x38'));}if(_0x481fd0[_0x7085('0x19')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x481fd0[_0x7085('0x11')]){if(moment(_0x481fd0[_0x7085('0x12')])['add'](_0x259413[_0x7085('0xd')],_0x7085('0x1b'))>moment()){throw new Error(_0x7085('0x39'));}else{_0x481fd0[_0x7085('0x11')]=![];_0x481fd0[_0x7085('0x12')]=null;}}_0x481fd0[_0x7085('0x3a')]=_0x10e3fd;_0x481fd0['resetPasswordExpires']=Date[_0x7085('0x3b')]()+0x36ee80;return _0x481fd0['save']();})[_0x7085('0xe')](function(){return sendServiceMail({'to':_0x5e4d07[_0x7085('0x32')][_0x7085('0x1e')],'subject':_0x7085('0x3c'),'text':_0x7085('0x3d')+_0x7085('0x3e')+_0x7085('0x3f')+_0x5e4d07[_0x7085('0x40')][_0x7085('0x41')]+'/reset/'+_0x10e3fd+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x7085('0xe')](function(){_0x4c6f9f['status'](0xc8)[_0x7085('0x2c')]({'message':_0x7085('0x42')});})[_0x7085('0x1d')](function(_0x102550){return handleError(_0x4c6f9f,0x1f4,_0x102550);});};exports['reset']=function(_0x5ea519,_0x3a8479){return db[_0x7085('0x37')][_0x7085('0x43')]({'where':{'resetPasswordToken':_0x5ea519[_0x7085('0x44')][_0x7085('0x45')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x1098ca){if(!_0x1098ca){throw new Error(_0x7085('0x46'));}return db[_0x7085('0xa')][_0x7085('0xb')]({'attributes':['id',_0x7085('0x47'),_0x7085('0x48'),'passwordHistoryLimit']})[_0x7085('0xe')](function(_0x57a450){if(_0x57a450[_0x7085('0x47')])authService[_0x7085('0x49')](_0x5ea519[_0x7085('0x32')][_0x7085('0x4a')]);if(!_0x57a450['enforcePasswordHistory']||!_0x1098ca['previousPasswords'])return _0x1098ca;authService['validatePasswordHistory'](_0x5ea519[_0x7085('0x32')][_0x7085('0x4a')],_0x1098ca[_0x7085('0x4b')],_0x57a450[_0x7085('0x4c')]);return _0x1098ca;})[_0x7085('0xe')](function(){_0x1098ca[_0x7085('0x4a')]=_0x5ea519[_0x7085('0x32')][_0x7085('0x4a')];_0x1098ca['resetPasswordToken']=null;_0x1098ca[_0x7085('0x4d')]=null;return _0x1098ca[_0x7085('0x4e')]();});})[_0x7085('0xe')](function(){_0x3a8479[_0x7085('0x4f')](0xc8)[_0x7085('0x2c')]({'message':_0x7085('0x50')});})[_0x7085('0x1d')](function(_0x10e7d6){return handleError(_0x3a8479,0x1f4,_0x10e7d6);});};passport[_0x7085('0x51')](_0x7085('0x52'),new LocalStrategy({'usernameField':_0x7085('0xf'),'passwordField':_0x7085('0x4a')},function(_0x172e44,_0x4910ba,_0xf39ab2){return localAuthenticate(db[_0x7085('0x37')],_0x172e44,_0x4910ba,_0xf39ab2);})); \ No newline at end of file +var _0xb025=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','host','/reset/','Reset\x20Email\x20sent!','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordExpires','send','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','stringify','status','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','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.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x331ba8,_0x581c0e){var _0x297961=function(_0x2c8711){while(--_0x2c8711){_0x331ba8['push'](_0x331ba8['shift']());}};_0x297961(++_0x581c0e);}(_0xb025,0x106));var _0x5b02=function(_0x4733ee,_0x3c5b68){_0x4733ee=_0x4733ee-0x0;var _0x150db1=_0xb025[_0x4733ee];return _0x150db1;};'use strict';var util=require(_0x5b02('0x0'));var passport=require(_0x5b02('0x1'));var LocalStrategy=require('passport-local')[_0x5b02('0x2')];var jayson=require(_0x5b02('0x3'));var _=require(_0x5b02('0x4'));var rs=require(_0x5b02('0x5'));var moment=require('moment');var db=require(_0x5b02('0x6'))['db'];var authService=require(_0x5b02('0x7'));var utils=require(_0x5b02('0x8'));var client=jayson[_0x5b02('0x9')][_0x5b02('0xa')]({'port':0x232b});function localAuthenticate(_0x180d96,_0x12c473,_0x333e24,_0x33d49e){var _0x158de1,_0x3292f8;return db[_0x5b02('0xb')][_0x5b02('0xc')]({'where':{'id':0x1},'attributes':[_0x5b02('0xd'),_0x5b02('0xe')],'raw':!![]})[_0x5b02('0xf')](function(_0x60f0af){_0x158de1=_0x60f0af;return _0x180d96[_0x5b02('0xc')]({'attributes':['id',_0x5b02('0x10'),_0x5b02('0x11'),_0x5b02('0x12'),'role',_0x5b02('0x13'),_0x5b02('0x14'),_0x5b02('0x15'),_0x5b02('0x16')],'where':{'name':_0x12c473,'role':{'$or':['admin','user',_0x5b02('0x17')]}}});})['then'](function(_0x8d4f07){if(!_0x8d4f07||_0x8d4f07&&_0x8d4f07[_0x5b02('0x10')]!==_0x12c473){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3292f8=_0x8d4f07;return _0x3292f8;}})[_0x5b02('0xf')](function(){_0x3292f8[_0x5b02('0x18')](_0x333e24,function(_0x2336fd,_0x50352d){var _0x3e4468=_0x3292f8[_0x5b02('0x16')]+0x1;if(_0x2336fd){return _0x33d49e(_0x2336fd);}else if(!_0x50352d){if(_0x3292f8[_0x5b02('0x13')]){return _0x33d49e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x158de1[_0x5b02('0xd')]>0x0){if(_0x3292f8[_0x5b02('0x14')]){if(_0x158de1[_0x5b02('0xe')]>0x0){if(moment(_0x3292f8[_0x5b02('0x15')])['add'](_0x158de1[_0x5b02('0xe')],'minutes')>moment()){return _0x33d49e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3292f8,_0x3e4468,![],null)[_0x5b02('0xf')](function(){return _0x33d49e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x33d49e(null,![],{'message':_0x5b02('0x19')});}}else{if(_0x3e4468>=_0x158de1['allowedLoginAttempts']){return utils[_0x5b02('0x1a')](_0x3292f8,0x0,!![],moment())['then'](function(){return _0x33d49e(null,![],{'message':_0x5b02('0x19')});});}else{return utils[_0x5b02('0x1a')](_0x3292f8,_0x3e4468,![],null)['then'](function(){return _0x33d49e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x33d49e(null,![],{'message':_0x5b02('0x19')});}}else{if(_0x3292f8[_0x5b02('0x13')]){return _0x33d49e(null,![],{'message':_0x5b02('0x19')});}else if(_0x158de1[_0x5b02('0xd')]>0x0){if(_0x3292f8[_0x5b02('0x14')]){if(_0x158de1[_0x5b02('0xe')]>0x0){if(moment(_0x3292f8[_0x5b02('0x15')])['add'](_0x158de1['blockDuration'],'minutes')>moment()){return _0x33d49e(null,![],{'message':_0x5b02('0x19')});}else{return utils[_0x5b02('0x1a')](_0x3292f8,0x0,![],null)['then'](function(){return utils[_0x5b02('0x1b')](_0x3292f8);})[_0x5b02('0xf')](function(){return _0x33d49e(null,_0x3292f8);});}}else{return _0x33d49e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x5b02('0x1a')](_0x3292f8,0x0,![],null)['then'](function(){return utils[_0x5b02('0x1b')](_0x3292f8);})[_0x5b02('0xf')](function(){return _0x33d49e(null,_0x3292f8);})[_0x5b02('0x1c')](function(_0x51c707){return _0x33d49e(null,![],_0x51c707);});}}else{if(_0x3292f8['blocked']){return _0x33d49e(null,![],{'message':_0x5b02('0x19')});}else{return utils[_0x5b02('0x1b')](_0x3292f8)[_0x5b02('0xf')](function(){return _0x33d49e(null,_0x3292f8);});}}}});})[_0x5b02('0x1c')](function(_0x505962){return _0x33d49e(null,![],_0x505962);});}function sendServiceMail(_0x770c22){return db[_0x5b02('0x1d')][_0x5b02('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x5b02('0x10'),_0x5b02('0x1f')],'include':[{'model':db[_0x5b02('0x20')],'as':_0x5b02('0x21'),'include':[{'model':db[_0x5b02('0x22')],'as':_0x5b02('0x22')}]}]})[_0x5b02('0xf')](function(_0x48c709){if(!_0x48c709){throw new Error(_0x5b02('0x23'));}var _0x4dca02=_0x48c709['getSmtpOptions']();var _0x5179ed={'account':_0x4dca02,'message':_[_0x5b02('0x24')]({'from':util[_0x5b02('0x25')](_0x5b02('0x26'),_0x48c709['name'],_0x48c709[_0x5b02('0x1f')]||_0x48c709['Smtp']['user'])},_0x770c22)};return client[_0x5b02('0x27')](_0x5b02('0x28'),_0x5179ed);})[_0x5b02('0xf')](function(_0x6dd364){if(_0x6dd364['error']){throw new Error(util['format'](_0x5b02('0x29'),_0x6dd364[_0x5b02('0x2a')]['message']||JSON[_0x5b02('0x2b')](_0x6dd364['error'])));}return!![];});}function handleError(_0x208898,_0x31ce83,_0x5c0111){return _0x208898[_0x5b02('0x2c')](_0x31ce83||0x1f4)['send']({'message':_0x5c0111?_0x5c0111[_0x5b02('0x2d')]||_0x5c0111:''});}exports[_0x5b02('0x2e')]=function(_0x4c5cbb,_0x227148,_0x3060b2){passport[_0x5b02('0x18')](_0x5b02('0x2f'),function(_0x16d04b,_0x43a8bd,_0x3f2303){var _0x32b26f=_0x16d04b||_0x3f2303;if(_0x32b26f){return handleError(_0x227148,0x191,_0x32b26f);}if(!_0x43a8bd){return handleError(_0x227148,0x194,{'message':_0x5b02('0x30')});}else{var _0x270c06={'payload':{'id':_0x43a8bd['id'],'role':_0x43a8bd[_0x5b02('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x5b02('0x32')](_0x270c06)[_0x5b02('0xf')](function(_0x55d291){_0x227148[_0x5b02('0x33')]({'id':_0x43a8bd['id'],'token':_0x55d291,'statusCall':'','isAlreadyLogged':_0x43a8bd[_0x5b02('0x34')]});});}})(_0x4c5cbb,_0x227148,_0x3060b2);};exports[_0x5b02('0x35')]=function(_0x3bc88c,_0x5d504e){if(!_0x3bc88c[_0x5b02('0x36')]['email']){return handleError(_0x5d504e,0x1f4,{'message':_0x5b02('0x37')});}var _0x4723fb=rs[_0x5b02('0x38')]();_0x3bc88c[_0x5b02('0x36')][_0x5b02('0x1f')]=_0x3bc88c['body'][_0x5b02('0x1f')][_0x5b02('0x39')]()['toLowerCase']();var _0x3d5881;return db['Setting'][_0x5b02('0xc')]({'where':{'id':0x1},'attributes':[_0x5b02('0xd'),_0x5b02('0xe')],'raw':!![]})[_0x5b02('0xf')](function(_0x3f6bdf){_0x3d5881=_0x3f6bdf;return db[_0x5b02('0x3a')][_0x5b02('0x1e')]({'where':{'email':_0x3bc88c[_0x5b02('0x36')][_0x5b02('0x1f')]}});})[_0x5b02('0xf')](function(_0x4e7c17){if(!_0x4e7c17){throw new Error(_0x5b02('0x3b'));}if(_0x4e7c17[_0x5b02('0x13')]){throw new Error(_0x5b02('0x3c'));}if(_0x4e7c17['blocked']){if(moment(_0x4e7c17[_0x5b02('0x15')])[_0x5b02('0x3d')](_0x3d5881[_0x5b02('0xe')],'minutes')>moment()){throw new Error(_0x5b02('0x3e'));}else{_0x4e7c17['blocked']=![];_0x4e7c17[_0x5b02('0x15')]=null;}}_0x4e7c17[_0x5b02('0x3f')]=_0x4723fb;_0x4e7c17['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x4e7c17[_0x5b02('0x40')]();})[_0x5b02('0xf')](function(){return sendServiceMail({'to':_0x3bc88c[_0x5b02('0x36')][_0x5b02('0x1f')],'subject':_0x5b02('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5b02('0x42')+'https://'+_0x3bc88c['headers'][_0x5b02('0x43')]+_0x5b02('0x44')+_0x4723fb+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x5d504e[_0x5b02('0x2c')](0xc8)['send']({'message':_0x5b02('0x45')});})[_0x5b02('0x1c')](function(_0xe0c5e1){return handleError(_0x5d504e,0x1f4,_0xe0c5e1);});};exports['reset']=function(_0x93fa04,_0x2a5d05){return db[_0x5b02('0x3a')][_0x5b02('0x1e')]({'where':{'resetPasswordToken':_0x93fa04[_0x5b02('0x46')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x5b02('0xf')](function(_0x36948c){if(!_0x36948c){throw new Error(_0x5b02('0x47'));}return db[_0x5b02('0xb')][_0x5b02('0xc')]({'attributes':['id',_0x5b02('0x48'),_0x5b02('0x49'),_0x5b02('0x4a')]})['then'](function(_0x8d9464){if(_0x8d9464['securePassword'])authService[_0x5b02('0x4b')](_0x93fa04[_0x5b02('0x36')][_0x5b02('0x11')]);if(!_0x8d9464[_0x5b02('0x49')]||!_0x36948c['previousPasswords'])return _0x36948c;authService[_0x5b02('0x4c')](_0x93fa04[_0x5b02('0x36')][_0x5b02('0x11')],_0x36948c[_0x5b02('0x4d')],_0x8d9464['passwordHistoryLimit']);return _0x36948c;})[_0x5b02('0xf')](function(){_0x36948c[_0x5b02('0x11')]=_0x93fa04[_0x5b02('0x36')][_0x5b02('0x11')];_0x36948c[_0x5b02('0x3f')]=null;_0x36948c[_0x5b02('0x4e')]=null;return _0x36948c['save']();});})[_0x5b02('0xf')](function(){_0x2a5d05[_0x5b02('0x2c')](0xc8)[_0x5b02('0x4f')]({'message':_0x5b02('0x50')});})['catch'](function(_0x51cd7f){return handleError(_0x2a5d05,0x1f4,_0x51cd7f);});};passport[_0x5b02('0x51')](_0x5b02('0x2f'),new LocalStrategy({'usernameField':_0x5b02('0x10'),'passwordField':_0x5b02('0x11')},function(_0x379ba6,_0x407a80,_0x3a8834){return localAuthenticate(db[_0x5b02('0x3a')],_0x379ba6,_0x407a80,_0x3a8834);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index ff9406c..c1b6f45 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 _0xc76e=['Router','./authLocal.controller','login','/forgot','forgot','post','/reset/:token','reset','exports','express'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0xc76e,0x117));var _0xec76=function(_0x43a3e1,_0x201820){_0x43a3e1=_0x43a3e1-0x0;var _0x76b6b6=_0xc76e[_0x43a3e1];return _0x76b6b6;};'use strict';var express=require(_0xec76('0x0'));var router=express[_0xec76('0x1')]();var controller=require(_0xec76('0x2'));router['post']('/',controller[_0xec76('0x3')]);router['post'](_0xec76('0x4'),controller[_0xec76('0x5')]);router[_0xec76('0x6')](_0xec76('0x7'),controller[_0xec76('0x8')]);module[_0xec76('0x9')]=router; \ No newline at end of file +var _0xe0b5=['exports','express','Router','login','post','/forgot','reset'];(function(_0x156638,_0x57e8e5){var _0x6d41ca=function(_0xfd6cc8){while(--_0xfd6cc8){_0x156638['push'](_0x156638['shift']());}};_0x6d41ca(++_0x57e8e5);}(_0xe0b5,0xa9));var _0x5e0b=function(_0x7f82f1,_0x404c2d){_0x7f82f1=_0x7f82f1-0x0;var _0x11d503=_0xe0b5[_0x7f82f1];return _0x11d503;};'use strict';var express=require(_0x5e0b('0x0'));var router=express[_0x5e0b('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x5e0b('0x2')]);router[_0x5e0b('0x3')](_0x5e0b('0x4'),controller['forgot']);router[_0x5e0b('0x3')]('/reset/:token',controller[_0x5e0b('0x5')]);module[_0x5e0b('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index e069c0c..4c96fed 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 _0xc52f=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x3e562c,_0x5355d6){var _0x4bfee2=function(_0x314bb7){while(--_0x314bb7){_0x3e562c['push'](_0x3e562c['shift']());}};_0x4bfee2(++_0x5355d6);}(_0xc52f,0xfd));var _0xfc52=function(_0x47b3b8,_0x320d55){_0x47b3b8=_0x47b3b8-0x0;var _0x5978f7=_0xc52f[_0x47b3b8];return _0x5978f7;};'use strict';var Sequelize=require('sequelize');module[_0xfc52('0x0')]={'name':{'type':Sequelize[_0xfc52('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xfc52('0x1')]},'description':{'type':Sequelize[_0xfc52('0x1')]},'status':{'type':Sequelize[_0xfc52('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfc52('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3542=['INTEGER','exports','STRING'];(function(_0x1ea800,_0xf9c4cc){var _0x5a15cc=function(_0x379e62){while(--_0x379e62){_0x1ea800['push'](_0x1ea800['shift']());}};_0x5a15cc(++_0xf9c4cc);}(_0x3542,0x1c0));var _0x2354=function(_0x3895b7,_0xd4796b){_0x3895b7=_0x3895b7-0x0;var _0x3f3b8c=_0x3542[_0x3895b7];return _0x3f3b8c;};'use strict';var Sequelize=require('sequelize');module[_0x2354('0x0')]={'name':{'type':Sequelize[_0x2354('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2354('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2354('0x2')],'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 d1a3694..bf85a61 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 _0x965b=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','ids','omit','getConditions','findOne','Condition','addActions','Action','getActions','options','eml-format','rimraf','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','status','sendStatus','error','stack','name','index','map','Automation','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes'];(function(_0x1db0d2,_0x2c0712){var _0x2a442b=function(_0x28130e){while(--_0x28130e){_0x1db0d2['push'](_0x1db0d2['shift']());}};_0x2a442b(++_0x2c0712);}(_0x965b,0xbd));var _0xb965=function(_0x37b73e,_0x1775e2){_0x37b73e=_0x37b73e-0x0;var _0x20dc71=_0x965b[_0x37b73e];return _0x20dc71;};'use strict';var emlformat=require(_0xb965('0x0'));var rimraf=require(_0xb965('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb965('0x2'));var Mustache=require(_0xb965('0x3'));var util=require(_0xb965('0x4'));var path=require(_0xb965('0x5'));var sox=require(_0xb965('0x6'));var csv=require('to-csv');var ejs=require(_0xb965('0x7'));var fs=require('fs');var fs_extra=require(_0xb965('0x8'));var _=require('lodash');var squel=require(_0xb965('0x9'));var crypto=require(_0xb965('0xa'));var jsforce=require(_0xb965('0xb'));var deskjs=require(_0xb965('0xc'));var toCsv=require(_0xb965('0xd'));var querystring=require('querystring');var Papa=require(_0xb965('0xe'));var Redis=require('ioredis');var authService=require(_0xb965('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb965('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xb965('0x11'));var licenseUtil=require(_0xb965('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47acfb,_0x2a6eaa){_0x2a6eaa=_0x2a6eaa||0xcc;return function(_0x4aafbd){if(_0x4aafbd){return _0x47acfb['sendStatus'](_0x2a6eaa);}return _0x47acfb['status'](_0x2a6eaa)[_0xb965('0x13')]();};}function respondWithResult(_0x506734,_0xaa278f){_0xaa278f=_0xaa278f||0xc8;return function(_0x4632c1){if(_0x4632c1){return _0x506734['status'](_0xaa278f)[_0xb965('0x14')](_0x4632c1);}};}function respondWithFilteredResult(_0x2ef962,_0x4721f4){return function(_0x54567d){if(_0x54567d){var _0xf422fe=typeof _0x4721f4['offset']===_0xb965('0x15')&&typeof _0x4721f4[_0xb965('0x16')]===_0xb965('0x15');var _0x14a162=_0x54567d['count'];var _0x3010cc=_0xf422fe?0x0:_0x4721f4[_0xb965('0x17')];var _0x25a3b3=_0xf422fe?_0x54567d[_0xb965('0x18')]:_0x4721f4['offset']+_0x4721f4[_0xb965('0x16')];var _0x189b31;if(_0x25a3b3>=_0x14a162){_0x25a3b3=_0x14a162;_0x189b31=0xc8;}else{_0x189b31=0xce;}_0x2ef962['status'](_0x189b31);return _0x2ef962[_0xb965('0x19')](_0xb965('0x1a'),_0x3010cc+'-'+_0x25a3b3+'/'+_0x14a162)[_0xb965('0x14')](_0x54567d);}return null;};}function patchUpdates(_0x30655c){return function(_0x1b11e3){try{jsonpatch[_0xb965('0x1b')](_0x1b11e3,_0x30655c,!![]);}catch(_0x1b3ffd){return BPromise[_0xb965('0x1c')](_0x1b3ffd);}return _0x1b11e3[_0xb965('0x1d')]();};}function saveUpdates(_0x4a8385,_0x222ea9){return function(_0x1eb39d){if(_0x1eb39d){return _0x1eb39d[_0xb965('0x1e')](_0x4a8385)[_0xb965('0x1f')](function(_0x3d5414){return _0x3d5414;});}return null;};}function removeEntity(_0x3a5397,_0x4e5e7f){return function(_0x50386a){if(_0x50386a){return _0x50386a[_0xb965('0x20')]()[_0xb965('0x1f')](function(){_0x3a5397[_0xb965('0x21')](0xcc)[_0xb965('0x13')]();});}};}function handleEntityNotFound(_0x5ca6ad,_0x17fa79){return function(_0xdf1b66){if(!_0xdf1b66){_0x5ca6ad[_0xb965('0x22')](0x194);}return _0xdf1b66;};}function handleError(_0xda5e39,_0x164232){_0x164232=_0x164232||0x1f4;return function(_0x232e4a){logger[_0xb965('0x23')](_0x232e4a[_0xb965('0x24')]);if(_0x232e4a[_0xb965('0x25')]){delete _0x232e4a[_0xb965('0x25')];}_0xda5e39['status'](_0x164232)['send'](_0x232e4a);};}exports[_0xb965('0x26')]=function(_0x370171,_0x400bd0){var _0x3ca3b0={},_0x4c2777={},_0x5781ee={'count':0x0,'rows':[]};var _0x3f448e=_[_0xb965('0x27')](db[_0xb965('0x28')][_0xb965('0x29')],function(_0x386073){return{'name':_0x386073['fieldName'],'type':_0x386073[_0xb965('0x2a')][_0xb965('0x2b')]};});_0x4c2777['model']=_[_0xb965('0x27')](_0x3f448e,'name');_0x4c2777[_0xb965('0x2c')]=_[_0xb965('0x2d')](_0x370171[_0xb965('0x2c')]);_0x4c2777[_0xb965('0x2e')]=_['intersection'](_0x4c2777[_0xb965('0x2f')],_0x4c2777[_0xb965('0x2c')]);_0x3ca3b0['attributes']=_[_0xb965('0x30')](_0x4c2777['model'],qs['fields'](_0x370171['query'][_0xb965('0x31')]));_0x3ca3b0[_0xb965('0x32')]=_0x3ca3b0['attributes'][_0xb965('0x33')]?_0x3ca3b0[_0xb965('0x32')]:_0x4c2777['model'];if(!_0x370171[_0xb965('0x2c')][_0xb965('0x34')](_0xb965('0x35'))){_0x3ca3b0[_0xb965('0x16')]=qs['limit'](_0x370171[_0xb965('0x2c')][_0xb965('0x16')]);_0x3ca3b0[_0xb965('0x17')]=qs[_0xb965('0x17')](_0x370171[_0xb965('0x2c')][_0xb965('0x17')]);}_0x3ca3b0[_0xb965('0x36')]=qs[_0xb965('0x37')](_0x370171[_0xb965('0x2c')]['sort']);_0x3ca3b0[_0xb965('0x38')]=qs[_0xb965('0x2e')](_[_0xb965('0x39')](_0x370171[_0xb965('0x2c')],_0x4c2777[_0xb965('0x2e')]),_0x3f448e);if(_0x370171[_0xb965('0x2c')][_0xb965('0x3a')]){_0x3ca3b0[_0xb965('0x38')]=_[_0xb965('0x3b')](_0x3ca3b0['where'],{'$or':_[_0xb965('0x27')](_0x3f448e,function(_0x328de0){if(_0x328de0[_0xb965('0x2a')]!=='VIRTUAL'){var _0x51e2c3={};_0x51e2c3[_0x328de0[_0xb965('0x25')]]={'$like':'%'+_0x370171['query'][_0xb965('0x3a')]+'%'};return _0x51e2c3;}})});}_0x3ca3b0=_['merge']({},_0x3ca3b0,_0x370171['options']);var _0x3bd0e8={'where':_0x3ca3b0['where']};return db[_0xb965('0x28')][_0xb965('0x18')](_0x3bd0e8)[_0xb965('0x1f')](function(_0x51cba4){_0x5781ee[_0xb965('0x18')]=_0x51cba4;if(_0x370171['query'][_0xb965('0x3c')]){_0x3ca3b0[_0xb965('0x3d')]=[{'all':!![]}];}return db[_0xb965('0x28')][_0xb965('0x3e')](_0x3ca3b0);})[_0xb965('0x1f')](function(_0x2bdae6){_0x5781ee[_0xb965('0x3f')]=_0x2bdae6;return _0x5781ee;})['then'](respondWithFilteredResult(_0x400bd0,_0x3ca3b0))[_0xb965('0x40')](handleError(_0x400bd0,null));};exports[_0xb965('0x41')]=function(_0x387185,_0x4679ef){var _0x54b77e={'raw':![],'where':{'id':_0x387185[_0xb965('0x42')]['id']}},_0x10e873={};_0x10e873[_0xb965('0x2f')]=_[_0xb965('0x2d')](db[_0xb965('0x28')][_0xb965('0x29')]);_0x10e873['query']=_[_0xb965('0x2d')](_0x387185[_0xb965('0x2c')]);_0x10e873['filters']=_[_0xb965('0x30')](_0x10e873[_0xb965('0x2f')],_0x10e873[_0xb965('0x2c')]);_0x54b77e[_0xb965('0x32')]=_[_0xb965('0x30')](_0x10e873[_0xb965('0x2f')],qs[_0xb965('0x31')](_0x387185[_0xb965('0x2c')]['fields']));_0x54b77e[_0xb965('0x32')]=_0x54b77e['attributes'][_0xb965('0x33')]?_0x54b77e[_0xb965('0x32')]:_0x10e873[_0xb965('0x2f')];if(_0x387185['query'][_0xb965('0x3c')]){_0x54b77e['include']=[{'all':!![]}];}_0x54b77e=_[_0xb965('0x3b')]({},_0x54b77e,_0x387185['options']);return db[_0xb965('0x28')][_0xb965('0x43')](_0x54b77e)[_0xb965('0x1f')](handleEntityNotFound(_0x4679ef,null))['then'](respondWithResult(_0x4679ef,null))[_0xb965('0x40')](handleError(_0x4679ef,null));};exports[_0xb965('0x44')]=function(_0x2f1449,_0x72a258){return db['Automation']['create'](_0x2f1449['body'],{})['then'](respondWithResult(_0x72a258,0xc9))[_0xb965('0x40')](handleError(_0x72a258,null));};exports[_0xb965('0x1e')]=function(_0x2ab369,_0x338a24){if(_0x2ab369[_0xb965('0x45')]['id']){delete _0x2ab369[_0xb965('0x45')]['id'];}return db[_0xb965('0x28')][_0xb965('0x43')]({'where':{'id':_0x2ab369['params']['id']}})[_0xb965('0x1f')](handleEntityNotFound(_0x338a24,null))[_0xb965('0x1f')](saveUpdates(_0x2ab369[_0xb965('0x45')],null))['then'](respondWithResult(_0x338a24,null))[_0xb965('0x40')](handleError(_0x338a24,null));};exports[_0xb965('0x20')]=function(_0x376b2d,_0x5ceaa9){return db[_0xb965('0x28')][_0xb965('0x43')]({'where':{'id':_0x376b2d['params']['id']}})[_0xb965('0x1f')](handleEntityNotFound(_0x5ceaa9,null))[_0xb965('0x1f')](removeEntity(_0x5ceaa9,null))['catch'](handleError(_0x5ceaa9,null));};exports['addConditions']=function(_0x2ce8bb,_0x2d5164,_0x52d03b){return db['Condition'][_0xb965('0x43')]({'where':{'id':_0x2ce8bb['params']['id']}})[_0xb965('0x1f')](handleEntityNotFound(_0x2d5164,null))['then'](function(_0x5771e4){if(_0x5771e4){return _0x5771e4[_0xb965('0x46')](_0x2ce8bb[_0xb965('0x45')][_0xb965('0x47')],_[_0xb965('0x48')](_0x2ce8bb[_0xb965('0x45')],['ids','id'])||{});}})[_0xb965('0x1f')](respondWithResult(_0x2d5164,null))[_0xb965('0x40')](handleError(_0x2d5164,null));};exports[_0xb965('0x49')]=function(_0x4502ab,_0x56d3ac,_0x729e47){var _0x578095={};var _0x13b023={};var _0x163422;var _0x2c5f20;return db[_0xb965('0x28')][_0xb965('0x4a')]({'where':{'id':_0x4502ab[_0xb965('0x42')]['id']}})[_0xb965('0x1f')](handleEntityNotFound(_0x56d3ac,null))['then'](function(_0x5a941b){if(_0x5a941b){_0x163422=_0x5a941b;_0x13b023[_0xb965('0x2f')]=_['keys'](db[_0xb965('0x4b')]['rawAttributes']);_0x13b023[_0xb965('0x2c')]=_[_0xb965('0x2d')](_0x4502ab['query']);_0x13b023[_0xb965('0x2e')]=_[_0xb965('0x30')](_0x13b023[_0xb965('0x2f')],_0x13b023['query']);_0x578095['attributes']=_[_0xb965('0x30')](_0x13b023[_0xb965('0x2f')],qs[_0xb965('0x31')](_0x4502ab[_0xb965('0x2c')][_0xb965('0x31')]));_0x578095[_0xb965('0x32')]=_0x578095[_0xb965('0x32')][_0xb965('0x33')]?_0x578095[_0xb965('0x32')]:_0x13b023[_0xb965('0x2f')];_0x578095['order']=qs[_0xb965('0x37')](_0x4502ab[_0xb965('0x2c')][_0xb965('0x37')]);_0x578095[_0xb965('0x38')]=qs['filters'](_['pick'](_0x4502ab[_0xb965('0x2c')],_0x13b023[_0xb965('0x2e')]));if(_0x4502ab['query']['filter']){_0x578095[_0xb965('0x38')]=_['merge'](_0x578095[_0xb965('0x38')],{'$or':_[_0xb965('0x27')](_0x578095[_0xb965('0x32')],function(_0x2f4cc8){var _0x2ee1f5={};_0x2ee1f5[_0x2f4cc8]={'$like':'%'+_0x4502ab[_0xb965('0x2c')]['filter']+'%'};return _0x2ee1f5;})});}_0x578095=_[_0xb965('0x3b')]({},_0x578095,_0x4502ab['options']);return _0x163422[_0xb965('0x49')](_0x578095);}})['then'](function(_0x326a84){if(_0x326a84){_0x2c5f20=_0x326a84[_0xb965('0x33')];if(!_0x4502ab[_0xb965('0x2c')][_0xb965('0x34')](_0xb965('0x35'))){_0x578095[_0xb965('0x16')]=qs[_0xb965('0x16')](_0x4502ab[_0xb965('0x2c')]['limit']);_0x578095[_0xb965('0x17')]=qs[_0xb965('0x17')](_0x4502ab[_0xb965('0x2c')][_0xb965('0x17')]);}return _0x163422[_0xb965('0x49')](_0x578095);}})['then'](function(_0x8af435){if(_0x8af435){return _0x8af435?{'count':_0x2c5f20,'rows':_0x8af435}:null;}})[_0xb965('0x1f')](respondWithResult(_0x56d3ac,null))[_0xb965('0x40')](handleError(_0x56d3ac,null));};exports[_0xb965('0x4c')]=function(_0x5a6924,_0x2f8fdf,_0x35cc71){return db[_0xb965('0x4d')][_0xb965('0x43')]({'where':{'id':_0x5a6924[_0xb965('0x42')]['id']}})[_0xb965('0x1f')](handleEntityNotFound(_0x2f8fdf,null))[_0xb965('0x1f')](function(_0x31015e){if(_0x31015e){return _0x31015e[_0xb965('0x4c')](_0x5a6924[_0xb965('0x45')]['ids'],_[_0xb965('0x48')](_0x5a6924[_0xb965('0x45')],[_0xb965('0x47'),'id'])||{});}})[_0xb965('0x1f')](respondWithResult(_0x2f8fdf,null))[_0xb965('0x40')](handleError(_0x2f8fdf,null));};exports[_0xb965('0x4e')]=function(_0x3113e7,_0x5f5ba9,_0x3d2eb1){var _0x47220d={};var _0x4bb589={};var _0x429cdd;var _0x88dbec;return db[_0xb965('0x28')][_0xb965('0x4a')]({'where':{'id':_0x3113e7['params']['id']}})[_0xb965('0x1f')](handleEntityNotFound(_0x5f5ba9,null))[_0xb965('0x1f')](function(_0x5416e6){if(_0x5416e6){_0x429cdd=_0x5416e6;_0x4bb589[_0xb965('0x2f')]=_[_0xb965('0x2d')](db[_0xb965('0x4d')][_0xb965('0x29')]);_0x4bb589[_0xb965('0x2c')]=_[_0xb965('0x2d')](_0x3113e7[_0xb965('0x2c')]);_0x4bb589[_0xb965('0x2e')]=_[_0xb965('0x30')](_0x4bb589[_0xb965('0x2f')],_0x4bb589['query']);_0x47220d[_0xb965('0x32')]=_[_0xb965('0x30')](_0x4bb589[_0xb965('0x2f')],qs['fields'](_0x3113e7['query'][_0xb965('0x31')]));_0x47220d[_0xb965('0x32')]=_0x47220d[_0xb965('0x32')][_0xb965('0x33')]?_0x47220d[_0xb965('0x32')]:_0x4bb589[_0xb965('0x2f')];_0x47220d['order']=qs[_0xb965('0x37')](_0x3113e7[_0xb965('0x2c')][_0xb965('0x37')]);_0x47220d['where']=qs['filters'](_[_0xb965('0x39')](_0x3113e7[_0xb965('0x2c')],_0x4bb589[_0xb965('0x2e')]));if(_0x3113e7['query'][_0xb965('0x3a')]){_0x47220d[_0xb965('0x38')]=_[_0xb965('0x3b')](_0x47220d[_0xb965('0x38')],{'$or':_[_0xb965('0x27')](_0x47220d[_0xb965('0x32')],function(_0x3bc8e1){var _0x43e9c5={};_0x43e9c5[_0x3bc8e1]={'$like':'%'+_0x3113e7[_0xb965('0x2c')][_0xb965('0x3a')]+'%'};return _0x43e9c5;})});}_0x47220d=_[_0xb965('0x3b')]({},_0x47220d,_0x3113e7[_0xb965('0x4f')]);return _0x429cdd['getActions'](_0x47220d);}})[_0xb965('0x1f')](function(_0xd6c804){if(_0xd6c804){_0x88dbec=_0xd6c804[_0xb965('0x33')];if(!_0x3113e7[_0xb965('0x2c')][_0xb965('0x34')](_0xb965('0x35'))){_0x47220d[_0xb965('0x16')]=qs[_0xb965('0x16')](_0x3113e7[_0xb965('0x2c')]['limit']);_0x47220d['offset']=qs[_0xb965('0x17')](_0x3113e7['query']['offset']);}return _0x429cdd['getActions'](_0x47220d);}})[_0xb965('0x1f')](function(_0x1b36b2){if(_0x1b36b2){return _0x1b36b2?{'count':_0x88dbec,'rows':_0x1b36b2}:null;}})[_0xb965('0x1f')](respondWithResult(_0x5f5ba9,null))[_0xb965('0x40')](handleError(_0x5f5ba9,null));}; \ No newline at end of file +var _0x24a3=['apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Automation','then','includeAll','include','findAll','rows','length','options','find','catch','create','body','params','addConditions','ids','omit','getConditions','findOne','Condition','hasOwnProperty','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x24a3,0x1bc));var _0x324a=function(_0x4e4ff8,_0x4054ad){_0x4e4ff8=_0x4e4ff8-0x0;var _0xc104d9=_0x24a3[_0x4e4ff8];return _0xc104d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x324a('0x0'));var zipdir=require(_0x324a('0x1'));var jsonpatch=require(_0x324a('0x2'));var rp=require('request-promise');var moment=require(_0x324a('0x3'));var BPromise=require(_0x324a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x324a('0x5'));var sox=require(_0x324a('0x6'));var csv=require(_0x324a('0x7'));var ejs=require(_0x324a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x324a('0x9'));var crypto=require('crypto');var jsforce=require(_0x324a('0xa'));var deskjs=require(_0x324a('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x324a('0xc'));var Redis=require('ioredis');var authService=require(_0x324a('0xd'));var qs=require(_0x324a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x324a('0xf'));var logger=require(_0x324a('0x10'))(_0x324a('0x11'));var utils=require(_0x324a('0x12'));var config=require(_0x324a('0x13'));var licenseUtil=require(_0x324a('0x14'));var db=require(_0x324a('0x15'))['db'];function respondWithStatusCode(_0x5f1cb6,_0x27669a){_0x27669a=_0x27669a||0xcc;return function(_0x360847){if(_0x360847){return _0x5f1cb6[_0x324a('0x16')](_0x27669a);}return _0x5f1cb6[_0x324a('0x17')](_0x27669a)['end']();};}function respondWithResult(_0x1d97c0,_0x2a3a61){_0x2a3a61=_0x2a3a61||0xc8;return function(_0x49303d){if(_0x49303d){return _0x1d97c0['status'](_0x2a3a61)[_0x324a('0x18')](_0x49303d);}};}function respondWithFilteredResult(_0x4371ec,_0x58871d){return function(_0x56f59c){if(_0x56f59c){var _0x2765c4=typeof _0x58871d[_0x324a('0x19')]===_0x324a('0x1a')&&typeof _0x58871d[_0x324a('0x1b')]===_0x324a('0x1a');var _0x54f3f4=_0x56f59c[_0x324a('0x1c')];var _0x9fee03=_0x2765c4?0x0:_0x58871d[_0x324a('0x19')];var _0x521e20=_0x2765c4?_0x56f59c[_0x324a('0x1c')]:_0x58871d[_0x324a('0x19')]+_0x58871d[_0x324a('0x1b')];var _0x201840;if(_0x521e20>=_0x54f3f4){_0x521e20=_0x54f3f4;_0x201840=0xc8;}else{_0x201840=0xce;}_0x4371ec[_0x324a('0x17')](_0x201840);return _0x4371ec[_0x324a('0x1d')]('Content-Range',_0x9fee03+'-'+_0x521e20+'/'+_0x54f3f4)[_0x324a('0x18')](_0x56f59c);}return null;};}function patchUpdates(_0x207d26){return function(_0x25d003){try{jsonpatch[_0x324a('0x1e')](_0x25d003,_0x207d26,!![]);}catch(_0x4aca57){return BPromise[_0x324a('0x1f')](_0x4aca57);}return _0x25d003['save']();};}function saveUpdates(_0x5dc84d,_0xdf5bb1){return function(_0x58bb5e){if(_0x58bb5e){return _0x58bb5e[_0x324a('0x20')](_0x5dc84d)['then'](function(_0x41af6c){return _0x41af6c;});}return null;};}function removeEntity(_0x338245,_0x3dded8){return function(_0x43bde8){if(_0x43bde8){return _0x43bde8[_0x324a('0x21')]()['then'](function(){_0x338245[_0x324a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58cd64,_0x5543dc){return function(_0x30e4ca){if(!_0x30e4ca){_0x58cd64['sendStatus'](0x194);}return _0x30e4ca;};}function handleError(_0x7bb7a8,_0x2f8f03){_0x2f8f03=_0x2f8f03||0x1f4;return function(_0x483423){logger[_0x324a('0x22')](_0x483423[_0x324a('0x23')]);if(_0x483423[_0x324a('0x24')]){delete _0x483423[_0x324a('0x24')];}_0x7bb7a8[_0x324a('0x17')](_0x2f8f03)[_0x324a('0x25')](_0x483423);};}exports[_0x324a('0x26')]=function(_0x387daf,_0x81c863){var _0x42547d={},_0x1b7273={},_0x27a71c={'count':0x0,'rows':[]};var _0x20e55d=_[_0x324a('0x27')](db['Automation'][_0x324a('0x28')],function(_0x2e7552){return{'name':_0x2e7552['fieldName'],'type':_0x2e7552[_0x324a('0x29')]['key']};});_0x1b7273[_0x324a('0x2a')]=_[_0x324a('0x27')](_0x20e55d,_0x324a('0x24'));_0x1b7273['query']=_[_0x324a('0x2b')](_0x387daf[_0x324a('0x2c')]);_0x1b7273[_0x324a('0x2d')]=_[_0x324a('0x2e')](_0x1b7273[_0x324a('0x2a')],_0x1b7273[_0x324a('0x2c')]);_0x42547d[_0x324a('0x2f')]=_[_0x324a('0x2e')](_0x1b7273[_0x324a('0x2a')],qs[_0x324a('0x30')](_0x387daf[_0x324a('0x2c')][_0x324a('0x30')]));_0x42547d['attributes']=_0x42547d['attributes']['length']?_0x42547d[_0x324a('0x2f')]:_0x1b7273[_0x324a('0x2a')];if(!_0x387daf[_0x324a('0x2c')]['hasOwnProperty'](_0x324a('0x31'))){_0x42547d[_0x324a('0x1b')]=qs[_0x324a('0x1b')](_0x387daf[_0x324a('0x2c')][_0x324a('0x1b')]);_0x42547d[_0x324a('0x19')]=qs[_0x324a('0x19')](_0x387daf[_0x324a('0x2c')][_0x324a('0x19')]);}_0x42547d[_0x324a('0x32')]=qs[_0x324a('0x33')](_0x387daf[_0x324a('0x2c')][_0x324a('0x33')]);_0x42547d[_0x324a('0x34')]=qs[_0x324a('0x2d')](_[_0x324a('0x35')](_0x387daf[_0x324a('0x2c')],_0x1b7273['filters']),_0x20e55d);if(_0x387daf[_0x324a('0x2c')][_0x324a('0x36')]){_0x42547d[_0x324a('0x34')]=_[_0x324a('0x37')](_0x42547d[_0x324a('0x34')],{'$or':_['map'](_0x20e55d,function(_0x20a04b){if(_0x20a04b[_0x324a('0x29')]!==_0x324a('0x38')){var _0x2ecc8f={};_0x2ecc8f[_0x20a04b[_0x324a('0x24')]]={'$like':'%'+_0x387daf[_0x324a('0x2c')][_0x324a('0x36')]+'%'};return _0x2ecc8f;}})});}_0x42547d=_[_0x324a('0x37')]({},_0x42547d,_0x387daf['options']);var _0xac547f={'where':_0x42547d[_0x324a('0x34')]};return db[_0x324a('0x39')][_0x324a('0x1c')](_0xac547f)[_0x324a('0x3a')](function(_0x2ae1ef){_0x27a71c[_0x324a('0x1c')]=_0x2ae1ef;if(_0x387daf[_0x324a('0x2c')][_0x324a('0x3b')]){_0x42547d[_0x324a('0x3c')]=[{'all':!![]}];}return db['Automation'][_0x324a('0x3d')](_0x42547d);})[_0x324a('0x3a')](function(_0x43f346){_0x27a71c[_0x324a('0x3e')]=_0x43f346;return _0x27a71c;})[_0x324a('0x3a')](respondWithFilteredResult(_0x81c863,_0x42547d))['catch'](handleError(_0x81c863,null));};exports['show']=function(_0x4549e8,_0x12e56c){var _0x396950={'raw':![],'where':{'id':_0x4549e8['params']['id']}},_0x47665c={};_0x47665c[_0x324a('0x2a')]=_[_0x324a('0x2b')](db[_0x324a('0x39')]['rawAttributes']);_0x47665c['query']=_[_0x324a('0x2b')](_0x4549e8[_0x324a('0x2c')]);_0x47665c['filters']=_[_0x324a('0x2e')](_0x47665c['model'],_0x47665c['query']);_0x396950[_0x324a('0x2f')]=_[_0x324a('0x2e')](_0x47665c[_0x324a('0x2a')],qs[_0x324a('0x30')](_0x4549e8[_0x324a('0x2c')][_0x324a('0x30')]));_0x396950[_0x324a('0x2f')]=_0x396950['attributes'][_0x324a('0x3f')]?_0x396950[_0x324a('0x2f')]:_0x47665c['model'];if(_0x4549e8[_0x324a('0x2c')][_0x324a('0x3b')]){_0x396950['include']=[{'all':!![]}];}_0x396950=_[_0x324a('0x37')]({},_0x396950,_0x4549e8[_0x324a('0x40')]);return db[_0x324a('0x39')][_0x324a('0x41')](_0x396950)[_0x324a('0x3a')](handleEntityNotFound(_0x12e56c,null))[_0x324a('0x3a')](respondWithResult(_0x12e56c,null))[_0x324a('0x42')](handleError(_0x12e56c,null));};exports[_0x324a('0x43')]=function(_0x233fda,_0x3d9d0a){return db[_0x324a('0x39')][_0x324a('0x43')](_0x233fda[_0x324a('0x44')],{})[_0x324a('0x3a')](respondWithResult(_0x3d9d0a,0xc9))[_0x324a('0x42')](handleError(_0x3d9d0a,null));};exports['update']=function(_0x5a03e9,_0x5b9b60){if(_0x5a03e9[_0x324a('0x44')]['id']){delete _0x5a03e9[_0x324a('0x44')]['id'];}return db[_0x324a('0x39')]['find']({'where':{'id':_0x5a03e9[_0x324a('0x45')]['id']}})[_0x324a('0x3a')](handleEntityNotFound(_0x5b9b60,null))['then'](saveUpdates(_0x5a03e9[_0x324a('0x44')],null))[_0x324a('0x3a')](respondWithResult(_0x5b9b60,null))[_0x324a('0x42')](handleError(_0x5b9b60,null));};exports[_0x324a('0x21')]=function(_0x208a7f,_0x2a8c11){return db['Automation']['find']({'where':{'id':_0x208a7f[_0x324a('0x45')]['id']}})[_0x324a('0x3a')](handleEntityNotFound(_0x2a8c11,null))[_0x324a('0x3a')](removeEntity(_0x2a8c11,null))[_0x324a('0x42')](handleError(_0x2a8c11,null));};exports[_0x324a('0x46')]=function(_0x4b8eb0,_0x1b479e,_0x52cb6b){return db['Condition']['find']({'where':{'id':_0x4b8eb0['params']['id']}})[_0x324a('0x3a')](handleEntityNotFound(_0x1b479e,null))[_0x324a('0x3a')](function(_0x40e51d){if(_0x40e51d){return _0x40e51d[_0x324a('0x46')](_0x4b8eb0[_0x324a('0x44')][_0x324a('0x47')],_[_0x324a('0x48')](_0x4b8eb0['body'],[_0x324a('0x47'),'id'])||{});}})[_0x324a('0x3a')](respondWithResult(_0x1b479e,null))[_0x324a('0x42')](handleError(_0x1b479e,null));};exports[_0x324a('0x49')]=function(_0x503a61,_0x4bd19b,_0x117a01){var _0x5c0809={};var _0x49473b={};var _0x365b0;var _0x408f66;return db[_0x324a('0x39')][_0x324a('0x4a')]({'where':{'id':_0x503a61['params']['id']}})[_0x324a('0x3a')](handleEntityNotFound(_0x4bd19b,null))[_0x324a('0x3a')](function(_0x4d0f74){if(_0x4d0f74){_0x365b0=_0x4d0f74;_0x49473b[_0x324a('0x2a')]=_[_0x324a('0x2b')](db[_0x324a('0x4b')][_0x324a('0x28')]);_0x49473b[_0x324a('0x2c')]=_[_0x324a('0x2b')](_0x503a61[_0x324a('0x2c')]);_0x49473b[_0x324a('0x2d')]=_[_0x324a('0x2e')](_0x49473b[_0x324a('0x2a')],_0x49473b[_0x324a('0x2c')]);_0x5c0809[_0x324a('0x2f')]=_['intersection'](_0x49473b[_0x324a('0x2a')],qs[_0x324a('0x30')](_0x503a61[_0x324a('0x2c')][_0x324a('0x30')]));_0x5c0809[_0x324a('0x2f')]=_0x5c0809['attributes'][_0x324a('0x3f')]?_0x5c0809[_0x324a('0x2f')]:_0x49473b['model'];_0x5c0809['order']=qs[_0x324a('0x33')](_0x503a61[_0x324a('0x2c')][_0x324a('0x33')]);_0x5c0809[_0x324a('0x34')]=qs[_0x324a('0x2d')](_[_0x324a('0x35')](_0x503a61[_0x324a('0x2c')],_0x49473b['filters']));if(_0x503a61[_0x324a('0x2c')][_0x324a('0x36')]){_0x5c0809[_0x324a('0x34')]=_[_0x324a('0x37')](_0x5c0809['where'],{'$or':_[_0x324a('0x27')](_0x5c0809['attributes'],function(_0x16d5a1){var _0xb209a4={};_0xb209a4[_0x16d5a1]={'$like':'%'+_0x503a61[_0x324a('0x2c')][_0x324a('0x36')]+'%'};return _0xb209a4;})});}_0x5c0809=_[_0x324a('0x37')]({},_0x5c0809,_0x503a61[_0x324a('0x40')]);return _0x365b0[_0x324a('0x49')](_0x5c0809);}})[_0x324a('0x3a')](function(_0x3da5a3){if(_0x3da5a3){_0x408f66=_0x3da5a3[_0x324a('0x3f')];if(!_0x503a61['query'][_0x324a('0x4c')](_0x324a('0x31'))){_0x5c0809[_0x324a('0x1b')]=qs['limit'](_0x503a61[_0x324a('0x2c')]['limit']);_0x5c0809['offset']=qs[_0x324a('0x19')](_0x503a61[_0x324a('0x2c')][_0x324a('0x19')]);}return _0x365b0['getConditions'](_0x5c0809);}})[_0x324a('0x3a')](function(_0x20030d){if(_0x20030d){return _0x20030d?{'count':_0x408f66,'rows':_0x20030d}:null;}})[_0x324a('0x3a')](respondWithResult(_0x4bd19b,null))[_0x324a('0x42')](handleError(_0x4bd19b,null));};exports['addActions']=function(_0x41d78f,_0x25bc15,_0x3de809){return db[_0x324a('0x4d')][_0x324a('0x41')]({'where':{'id':_0x41d78f[_0x324a('0x45')]['id']}})[_0x324a('0x3a')](handleEntityNotFound(_0x25bc15,null))['then'](function(_0x1f3338){if(_0x1f3338){return _0x1f3338['addActions'](_0x41d78f['body'][_0x324a('0x47')],_[_0x324a('0x48')](_0x41d78f[_0x324a('0x44')],[_0x324a('0x47'),'id'])||{});}})[_0x324a('0x3a')](respondWithResult(_0x25bc15,null))[_0x324a('0x42')](handleError(_0x25bc15,null));};exports['getActions']=function(_0x7ea168,_0x389659,_0x4d3874){var _0x1f7d5f={};var _0x40db2b={};var _0x2de804;var _0x100a6b;return db['Automation'][_0x324a('0x4a')]({'where':{'id':_0x7ea168[_0x324a('0x45')]['id']}})[_0x324a('0x3a')](handleEntityNotFound(_0x389659,null))[_0x324a('0x3a')](function(_0x46bd39){if(_0x46bd39){_0x2de804=_0x46bd39;_0x40db2b[_0x324a('0x2a')]=_[_0x324a('0x2b')](db[_0x324a('0x4d')][_0x324a('0x28')]);_0x40db2b[_0x324a('0x2c')]=_['keys'](_0x7ea168['query']);_0x40db2b[_0x324a('0x2d')]=_[_0x324a('0x2e')](_0x40db2b[_0x324a('0x2a')],_0x40db2b['query']);_0x1f7d5f['attributes']=_[_0x324a('0x2e')](_0x40db2b['model'],qs['fields'](_0x7ea168[_0x324a('0x2c')][_0x324a('0x30')]));_0x1f7d5f[_0x324a('0x2f')]=_0x1f7d5f[_0x324a('0x2f')]['length']?_0x1f7d5f[_0x324a('0x2f')]:_0x40db2b[_0x324a('0x2a')];_0x1f7d5f['order']=qs[_0x324a('0x33')](_0x7ea168[_0x324a('0x2c')][_0x324a('0x33')]);_0x1f7d5f[_0x324a('0x34')]=qs[_0x324a('0x2d')](_[_0x324a('0x35')](_0x7ea168[_0x324a('0x2c')],_0x40db2b[_0x324a('0x2d')]));if(_0x7ea168[_0x324a('0x2c')][_0x324a('0x36')]){_0x1f7d5f[_0x324a('0x34')]=_['merge'](_0x1f7d5f['where'],{'$or':_['map'](_0x1f7d5f[_0x324a('0x2f')],function(_0x2f8bf6){var _0x472fe6={};_0x472fe6[_0x2f8bf6]={'$like':'%'+_0x7ea168[_0x324a('0x2c')]['filter']+'%'};return _0x472fe6;})});}_0x1f7d5f=_['merge']({},_0x1f7d5f,_0x7ea168[_0x324a('0x40')]);return _0x2de804[_0x324a('0x4e')](_0x1f7d5f);}})[_0x324a('0x3a')](function(_0x10c64c){if(_0x10c64c){_0x100a6b=_0x10c64c[_0x324a('0x3f')];if(!_0x7ea168[_0x324a('0x2c')]['hasOwnProperty'](_0x324a('0x31'))){_0x1f7d5f[_0x324a('0x1b')]=qs['limit'](_0x7ea168[_0x324a('0x2c')][_0x324a('0x1b')]);_0x1f7d5f['offset']=qs[_0x324a('0x19')](_0x7ea168[_0x324a('0x2c')]['offset']);}return _0x2de804[_0x324a('0x4e')](_0x1f7d5f);}})['then'](function(_0xe44ed1){if(_0xe44ed1){return _0xe44ed1?{'count':_0x100a6b,'rows':_0xe44ed1}:null;}})['then'](respondWithResult(_0x389659,null))[_0x324a('0x42')](handleError(_0x389659,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 313ef06..eed76f3 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 _0x7526=['tools_automations','util','../../config/logger','api','moment','bluebird','rimraf','./automation.attributes','exports','Automation'];(function(_0x508c89,_0xe8e2a1){var _0x196b80=function(_0x112a42){while(--_0x112a42){_0x508c89['push'](_0x508c89['shift']());}};_0x196b80(++_0xe8e2a1);}(_0x7526,0x12d));var _0x6752=function(_0x165b19,_0x126813){_0x165b19=_0x165b19-0x0;var _0x58237c=_0x7526[_0x165b19];return _0x58237c;};'use strict';var _=require('lodash');var util=require(_0x6752('0x0'));var logger=require(_0x6752('0x1'))(_0x6752('0x2'));var moment=require(_0x6752('0x3'));var BPromise=require(_0x6752('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6752('0x5'));var config=require('../../config/environment');var attributes=require(_0x6752('0x6'));module[_0x6752('0x7')]=function(_0x15d6ea,_0x2fe940){return _0x15d6ea['define'](_0x6752('0x8'),attributes,{'tableName':_0x6752('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd53=['request-promise','path','rimraf','../../config/environment','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x13588c,_0x289580){var _0x53a0d0=function(_0x627cce){while(--_0x627cce){_0x13588c['push'](_0x13588c['shift']());}};_0x53a0d0(++_0x289580);}(_0xfd53,0xaa));var _0x3fd5=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xfd53[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x3fd5('0x0'));var util=require(_0x3fd5('0x1'));var logger=require(_0x3fd5('0x2'))(_0x3fd5('0x3'));var moment=require(_0x3fd5('0x4'));var BPromise=require(_0x3fd5('0x5'));var rp=require(_0x3fd5('0x6'));var fs=require('fs');var path=require(_0x3fd5('0x7'));var rimraf=require(_0x3fd5('0x8'));var config=require(_0x3fd5('0x9'));var attributes=require('./automation.attributes');module['exports']=function(_0x1ff33c,_0x29f733){return _0x1ff33c[_0x3fd5('0xa')]('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 f00b0c0..f12f3dc 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 _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x4441cf,_0x4509a6){var _0x3b8877=function(_0x3f3a17){while(--_0x3f3a17){_0x4441cf['push'](_0x4441cf['shift']());}};_0x3b8877(++_0x4509a6);}(_0xda2d,0x102));var _0xdda2=function(_0x16f5f8,_0x389f83){_0x16f5f8=_0x16f5f8-0x0;var _0x81880a=_0xda2d[_0x16f5f8];return _0x81880a;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Automation,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file +var _0xc23d=['stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xc23d,0x7f));var _0xdc23=function(_0x130209,_0x2cc129){_0x130209=_0x130209-0x0;var _0x155fb7=_0xc23d[_0x130209];return _0x155fb7;};'use strict';var _=require(_0xdc23('0x0'));var util=require(_0xdc23('0x1'));var moment=require(_0xdc23('0x2'));var BPromise=require(_0xdc23('0x3'));var rs=require(_0xdc23('0x4'));var fs=require('fs');var Redis=require(_0xdc23('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc23('0x6'));var logger=require(_0xdc23('0x7'))(_0xdc23('0x8'));var config=require(_0xdc23('0x9'));var jayson=require(_0xdc23('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17cb48,_0x47c9cd,_0x2a5303){return new BPromise(function(_0x4d16cf,_0x459f6d){return client[_0xdc23('0xb')](_0x17cb48,_0x2a5303)[_0xdc23('0xc')](function(_0x43ba94){logger[_0xdc23('0xd')]('Automation,\x20%s,\x20%s',_0x47c9cd,_0xdc23('0xe'));logger[_0xdc23('0xf')](_0xdc23('0x10'),_0x47c9cd,_0xdc23('0xe'),JSON[_0xdc23('0x11')](_0x43ba94));if(_0x43ba94[_0xdc23('0x12')]){if(_0x43ba94['error'][_0xdc23('0x13')]===0x1f4){logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x43ba94[_0xdc23('0x12')]['message']);return _0x459f6d(_0x43ba94[_0xdc23('0x12')][_0xdc23('0x15')]);}logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x43ba94[_0xdc23('0x12')][_0xdc23('0x15')]);return _0x4d16cf(_0x43ba94['error'][_0xdc23('0x15')]);}else{logger['info'](_0xdc23('0x14'),_0x47c9cd,_0xdc23('0xe'));_0x4d16cf(_0x43ba94[_0xdc23('0x16')]['message']);}})[_0xdc23('0x17')](function(_0x476654){logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x476654);_0x459f6d(_0x476654);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 1e4d0f9..1a71cef 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 _0x3351=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','delete','exports','multer'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x3351,0x1b4));var _0x1335=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x3351[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x1335('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1335('0x1'));var express=require(_0x1335('0x2'));var router=express[_0x1335('0x3')]();var fs_extra=require(_0x1335('0x4'));var auth=require(_0x1335('0x5'));var interaction=require(_0x1335('0x6'));var config=require(_0x1335('0x7'));var controller=require('./automation.controller');router[_0x1335('0x8')]('/',auth[_0x1335('0x9')](),controller[_0x1335('0xa')]);router[_0x1335('0x8')](_0x1335('0xb'),auth[_0x1335('0x9')](),controller[_0x1335('0xc')]);router[_0x1335('0x8')](_0x1335('0xd'),auth[_0x1335('0x9')](),controller[_0x1335('0xe')]);router['get'](_0x1335('0xf'),auth['isAuthenticated'](),controller[_0x1335('0x10')]);router[_0x1335('0x11')]('/',auth[_0x1335('0x9')](),controller[_0x1335('0x12')]);router[_0x1335('0x11')](_0x1335('0xd'),auth['isAuthenticated'](),controller[_0x1335('0x13')]);router['post'](_0x1335('0xf'),auth['isAuthenticated'](),controller[_0x1335('0x14')]);router['put'](_0x1335('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1335('0x15')](_0x1335('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1335('0x16')]=router; \ No newline at end of file +var _0xd737=['index','get','/:id','show','/:id/conditions','/:id/actions','getActions','create','post','addConditions','addActions','put','destroy','multer','path','express','Router','fs-extra','../../config/environment','isAuthenticated'];(function(_0x117dbc,_0x28e5a5){var _0x3d70e8=function(_0x2928e9){while(--_0x2928e9){_0x117dbc['push'](_0x117dbc['shift']());}};_0x3d70e8(++_0x28e5a5);}(_0xd737,0x85));var _0x7d73=function(_0x17730a,_0x362127){_0x17730a=_0x17730a-0x0;var _0x485db1=_0xd737[_0x17730a];return _0x485db1;};'use strict';var multer=require(_0x7d73('0x0'));var util=require('util');var path=require(_0x7d73('0x1'));var timeout=require('connect-timeout');var express=require(_0x7d73('0x2'));var router=express[_0x7d73('0x3')]();var fs_extra=require(_0x7d73('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7d73('0x5'));var controller=require('./automation.controller');router['get']('/',auth[_0x7d73('0x6')](),controller[_0x7d73('0x7')]);router[_0x7d73('0x8')](_0x7d73('0x9'),auth[_0x7d73('0x6')](),controller[_0x7d73('0xa')]);router[_0x7d73('0x8')](_0x7d73('0xb'),auth['isAuthenticated'](),controller['getConditions']);router[_0x7d73('0x8')](_0x7d73('0xc'),auth['isAuthenticated'](),controller[_0x7d73('0xd')]);router['post']('/',auth[_0x7d73('0x6')](),controller[_0x7d73('0xe')]);router[_0x7d73('0xf')]('/:id/conditions',auth[_0x7d73('0x6')](),controller[_0x7d73('0x10')]);router['post'](_0x7d73('0xc'),auth[_0x7d73('0x6')](),controller[_0x7d73('0x11')]);router[_0x7d73('0x12')]('/:id',auth[_0x7d73('0x6')](),controller['update']);router['delete'](_0x7d73('0x9'),auth[_0x7d73('0x6')](),controller[_0x7d73('0x13')]);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 eacf056..7b11ec0 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 _0xee14=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x380125,_0x259372){var _0x100bc0=function(_0x2a6bda){while(--_0x2a6bda){_0x380125['push'](_0x380125['shift']());}};_0x100bc0(++_0x259372);}(_0xee14,0x14e));var _0x4ee1=function(_0x226b2e,_0x18c687){_0x226b2e=_0x226b2e-0x0;var _0x78cff7=_0xee14[_0x226b2e];return _0x78cff7;};'use strict';var Sequelize=require(_0x4ee1('0x0'));module[_0x4ee1('0x1')]={'name':{'type':Sequelize[_0x4ee1('0x2')],'unique':_0x4ee1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x4ee1('0x4')](_0x4ee1('0x5')),'allowNull':![],'defaultValue':_0x4ee1('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0,'comment':_0x4ee1('0x7')},'limitCalls':{'type':Sequelize[_0x4ee1('0x8')](0x4)[_0x4ee1('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x4ee1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4ee1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4ee1('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ee1('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4ee1('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ee1('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4ee1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ee1('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x4ee1('0x8')](0x3)[_0x4ee1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ee1('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4ee1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ee1('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4ee1('0x8')](0x3)[_0x4ee1('0x9')],'defaultValue':0x3,'comment':_0x4ee1('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4ee1('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ee1('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4ee1('0x8')](0x3)[_0x4ee1('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4ee1('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4ee1('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x4ee1('0x12'),_0x4ee1('0x13')),'defaultValue':_0x4ee1('0x14')},'dialAMDActive':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x4ee1('0x8')](0x9)[_0x4ee1('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4ee1('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x4ee1('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4ee1('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4ee1('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4ee1('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4ee1('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4ee1('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x4ee1('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4ee1('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4ee1('0x8')](0x9)[_0x4ee1('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4ee1('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4ee1('0x8')](0x5)[_0x4ee1('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4ee1('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4ee1('0x8')](0x9)[_0x4ee1('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4ee1('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4ee1('0x4')](_0x4ee1('0x1c'),'ASC'),'defaultValue':_0x4ee1('0x1c')},'dialPrefix':{'type':Sequelize[_0x4ee1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4ee1('0x1d')},'dialCutDigit':{'type':Sequelize[_0x4ee1('0x8')](0x3)[_0x4ee1('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4ee1('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4ee1('0x8')](0x3)[_0x4ee1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ee1('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ee1('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x4ee1('0x8')](0x3)[_0x4ee1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ee1('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x4ee1('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ee1('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ee1('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4ee1('0x8')](0x5)[_0x4ee1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ee1('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x4ee1('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ee1('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ee1('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4ee1('0x8')](0x3)[_0x4ee1('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4ee1('0x8')](0x5)[_0x4ee1('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ee1('0x27')}}; \ No newline at end of file +var _0x6582=['STRING','name','ENUM','ivr','BOOLEAN','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','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)','sequelize','exports'];(function(_0x2c874e,_0x401b1d){var _0x45c3d8=function(_0x26dc41){while(--_0x26dc41){_0x2c874e['push'](_0x2c874e['shift']());}};_0x45c3d8(++_0x401b1d);}(_0x6582,0x108));var _0x2658=function(_0x17749b,_0x4b4e3e){_0x17749b=_0x17749b-0x0;var _0x37ad41=_0x6582[_0x17749b];return _0x37ad41;};'use strict';var Sequelize=require(_0x2658('0x0'));module[_0x2658('0x1')]={'name':{'type':Sequelize[_0x2658('0x2')],'unique':_0x2658('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2658('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x2658('0x5')},'description':{'type':Sequelize[_0x2658('0x2')]},'active':{'type':Sequelize[_0x2658('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2658('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2658('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2658('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x2658('0x8')](0x3)[_0x2658('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2658('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2658('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2658('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2658('0x8')](0x5)[_0x2658('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2658('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x2658('0x8')](0x3)[_0x2658('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2658('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2658('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2658('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2658('0x9')],'defaultValue':0x3,'comment':_0x2658('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2658('0x8')](0x5)[_0x2658('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2658('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2658('0x8')](0x3)[_0x2658('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x2658('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2658('0x2')],'defaultValue':_0x2658('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x2658('0x4')](_0x2658('0x12'),'never',_0x2658('0x13')),'defaultValue':_0x2658('0x12')},'dialAMDActive':{'type':Sequelize[_0x2658('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x2658('0x8')](0x9)[_0x2658('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2658('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x2658('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2658('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2658('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2658('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2658('0x8')](0x9)[_0x2658('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x2658('0x8')](0x9)[_0x2658('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2658('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2658('0x8')](0x9)[_0x2658('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2658('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x2658('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2658('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2658('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2658('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x2658('0x4')](_0x2658('0x1a'),_0x2658('0x1b')),'defaultValue':_0x2658('0x1a')},'dialPrefix':{'type':Sequelize[_0x2658('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2658('0x8')](0x3)[_0x2658('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2658('0x1c')},'dialCutDigit':{'type':Sequelize[_0x2658('0x8')](0x3)[_0x2658('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2658('0x8')](0x3)[_0x2658('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2658('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2658('0x8')](0x5)[_0x2658('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2658('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2658('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2658('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x2658('0x8')](0x5)[_0x2658('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2658('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2658('0x8')](0x3)[_0x2658('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2658('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2658('0x8')](0x5)[_0x2658('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2658('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x2658('0x8')](0x3)[_0x2658('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2658('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2658('0x8')](0x5)[_0x2658('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2658('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2658('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2658('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2658('0x8')](0x5)[_0x2658('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 7fafea0..ca5568d 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 _0x7462=['clone','params','rawAttributes','omit','createdAt','updatedAt','UserProfileSection','UserProfileResource','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','select','field','phone','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','ListId','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','IvrCampaigns','destroy','then','end','error','index','map','Campaign','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','show','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x51d944,_0x57d671){var _0xf1b107=function(_0x1b638d){while(--_0x1b638d){_0x51d944['push'](_0x51d944['shift']());}};_0xf1b107(++_0x57d671);}(_0x7462,0x165));var _0x2746=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0x7462[_0x32729c];return _0x482cfd;};'use strict';var emlformat=require(_0x2746('0x0'));var rimraf=require(_0x2746('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2746('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2746('0x3'));var util=require(_0x2746('0x4'));var path=require('path');var sox=require(_0x2746('0x5'));var csv=require(_0x2746('0x6'));var ejs=require(_0x2746('0x7'));var fs=require('fs');var fs_extra=require(_0x2746('0x8'));var _=require(_0x2746('0x9'));var squel=require(_0x2746('0xa'));var crypto=require(_0x2746('0xb'));var jsforce=require(_0x2746('0xc'));var deskjs=require(_0x2746('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2746('0xe'));var Papa=require(_0x2746('0xf'));var Redis=require('ioredis');var authService=require(_0x2746('0x10'));var qs=require(_0x2746('0x11'));var as=require(_0x2746('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2746('0x13'))(_0x2746('0x14'));var utils=require(_0x2746('0x15'));var config=require(_0x2746('0x16'));var licenseUtil=require(_0x2746('0x17'));var db=require(_0x2746('0x18'))['db'];function respondWithStatusCode(_0x51ddae,_0x126a1f){_0x126a1f=_0x126a1f||0xcc;return function(_0x10c17d){if(_0x10c17d){return _0x51ddae[_0x2746('0x19')](_0x126a1f);}return _0x51ddae[_0x2746('0x1a')](_0x126a1f)['end']();};}function respondWithResult(_0x57e57c,_0x251401){_0x251401=_0x251401||0xc8;return function(_0x38c1b3){if(_0x38c1b3){return _0x57e57c[_0x2746('0x1a')](_0x251401)[_0x2746('0x1b')](_0x38c1b3);}};}function respondWithFilteredResult(_0x52028f,_0x1abd61){return function(_0x1a1e02){if(_0x1a1e02){var _0x57edcd=typeof _0x1abd61['offset']===_0x2746('0x1c')&&typeof _0x1abd61[_0x2746('0x1d')]===_0x2746('0x1c');var _0x407d46=_0x1a1e02[_0x2746('0x1e')];var _0x232108=_0x57edcd?0x0:_0x1abd61[_0x2746('0x1f')];var _0x6102f3=_0x57edcd?_0x1a1e02[_0x2746('0x1e')]:_0x1abd61['offset']+_0x1abd61[_0x2746('0x1d')];var _0x5dde3b;if(_0x6102f3>=_0x407d46){_0x6102f3=_0x407d46;_0x5dde3b=0xc8;}else{_0x5dde3b=0xce;}_0x52028f[_0x2746('0x1a')](_0x5dde3b);return _0x52028f[_0x2746('0x20')](_0x2746('0x21'),_0x232108+'-'+_0x6102f3+'/'+_0x407d46)[_0x2746('0x1b')](_0x1a1e02);}return null;};}function patchUpdates(_0xa64e76){return function(_0x2cc260){try{jsonpatch[_0x2746('0x22')](_0x2cc260,_0xa64e76,!![]);}catch(_0x25233b){return BPromise[_0x2746('0x23')](_0x25233b);}return _0x2cc260['save']();};}function saveUpdates(_0x4acb70,_0x7390b3){return function(_0x101c47){if(_0x101c47){return _0x101c47[_0x2746('0x24')](_0x4acb70)['then'](function(_0x24b9c5){return _0x24b9c5;});}return null;};}function removeEntity(_0xf97651,_0x55fe95){return function(_0x2b4652){if(_0x2b4652){return _0x2b4652['destroy']()['then'](function(){var _0x5bc3c8=_0x2b4652['get']({'plain':!![]});var _0xe5a485=_0x2746('0x25');return db['UserProfileResource'][_0x2746('0x26')]({'where':{'type':_0xe5a485,'resourceId':_0x5bc3c8['id']}})['then'](function(){return _0x2b4652;});})[_0x2746('0x27')](function(){_0xf97651[_0x2746('0x1a')](0xcc)[_0x2746('0x28')]();});}};}function handleEntityNotFound(_0x31c9c3,_0x19017f){return function(_0x433526){if(!_0x433526){_0x31c9c3[_0x2746('0x19')](0x194);}return _0x433526;};}function handleError(_0x39b719,_0x5bb96e){_0x5bb96e=_0x5bb96e||0x1f4;return function(_0x102f58){logger[_0x2746('0x29')](_0x102f58['stack']);if(_0x102f58['name']){delete _0x102f58['name'];}_0x39b719['status'](_0x5bb96e)['send'](_0x102f58);};}exports[_0x2746('0x2a')]=function(_0x1305b8,_0x4b4e0f){var _0x51ee16={},_0x44e985={},_0x17f7bf={'count':0x0,'rows':[]};var _0x5d05a2=_[_0x2746('0x2b')](db[_0x2746('0x2c')]['rawAttributes'],function(_0xf7fb3c){return{'name':_0xf7fb3c['fieldName'],'type':_0xf7fb3c['type'][_0x2746('0x2d')]};});_0x44e985[_0x2746('0x2e')]=_[_0x2746('0x2b')](_0x5d05a2,_0x2746('0x2f'));_0x44e985['query']=_[_0x2746('0x30')](_0x1305b8[_0x2746('0x31')]);_0x44e985[_0x2746('0x32')]=_[_0x2746('0x33')](_0x44e985[_0x2746('0x2e')],_0x44e985[_0x2746('0x31')]);_0x51ee16[_0x2746('0x34')]=_[_0x2746('0x33')](_0x44e985['model'],qs[_0x2746('0x35')](_0x1305b8[_0x2746('0x31')][_0x2746('0x35')]));_0x51ee16[_0x2746('0x34')]=_0x51ee16[_0x2746('0x34')][_0x2746('0x36')]?_0x51ee16['attributes']:_0x44e985['model'];if(!_0x1305b8[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x51ee16[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x1305b8['query'][_0x2746('0x1d')]);_0x51ee16[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x1305b8[_0x2746('0x31')][_0x2746('0x1f')]);}_0x51ee16[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x1305b8[_0x2746('0x31')][_0x2746('0x3a')]);_0x51ee16[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x1305b8[_0x2746('0x31')],_0x44e985['filters']),_0x5d05a2);if(_0x1305b8[_0x2746('0x31')][_0x2746('0x3d')]){_0x51ee16[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x51ee16[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x5d05a2,function(_0xd683de){if(_0xd683de[_0x2746('0x3f')]!==_0x2746('0x40')){var _0x57ba44={};_0x57ba44[_0xd683de[_0x2746('0x2f')]]={'$like':'%'+_0x1305b8[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x57ba44;}})});}_0x51ee16=_[_0x2746('0x3e')]({},_0x51ee16,_0x1305b8['options']);var _0xca2a32={'where':_0x51ee16[_0x2746('0x3b')]};return db['Campaign'][_0x2746('0x1e')](_0xca2a32)[_0x2746('0x27')](function(_0x5ef41e){_0x17f7bf['count']=_0x5ef41e;if(_0x1305b8[_0x2746('0x31')]['includeAll']){_0x51ee16['include']=[{'all':!![]}];}return db[_0x2746('0x2c')][_0x2746('0x41')](_0x51ee16);})[_0x2746('0x27')](function(_0x3b5ea4){_0x17f7bf[_0x2746('0x42')]=_0x3b5ea4;return _0x17f7bf;})[_0x2746('0x27')](respondWithFilteredResult(_0x4b4e0f,_0x51ee16))[_0x2746('0x43')](handleError(_0x4b4e0f,null));};exports[_0x2746('0x44')]=function(_0x2132f6,_0x12f5bf){var _0x376c05={'raw':![],'where':{'id':_0x2132f6['params']['id']}},_0x44cb28={};_0x44cb28[_0x2746('0x2e')]=_['keys'](db[_0x2746('0x2c')]['rawAttributes']);_0x44cb28[_0x2746('0x31')]=_['keys'](_0x2132f6[_0x2746('0x31')]);_0x44cb28[_0x2746('0x32')]=_[_0x2746('0x33')](_0x44cb28[_0x2746('0x2e')],_0x44cb28[_0x2746('0x31')]);_0x376c05[_0x2746('0x34')]=_[_0x2746('0x33')](_0x44cb28[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x2132f6[_0x2746('0x31')]['fields']));_0x376c05[_0x2746('0x34')]=_0x376c05['attributes']['length']?_0x376c05[_0x2746('0x34')]:_0x44cb28[_0x2746('0x2e')];if(_0x2132f6[_0x2746('0x31')][_0x2746('0x45')]){_0x376c05[_0x2746('0x46')]=[{'all':!![]}];}_0x376c05=_[_0x2746('0x3e')]({},_0x376c05,_0x2132f6[_0x2746('0x47')]);return db['Campaign'][_0x2746('0x48')](_0x376c05)[_0x2746('0x27')](handleEntityNotFound(_0x12f5bf,null))[_0x2746('0x27')](respondWithResult(_0x12f5bf,null))[_0x2746('0x43')](handleError(_0x12f5bf,null));};exports[_0x2746('0x49')]=function(_0x57191d,_0xc3b3a0){return db['Campaign'][_0x2746('0x49')](_0x57191d[_0x2746('0x4a')],{})[_0x2746('0x27')](function(_0x444826){var _0x3b3359=_0x57191d[_0x2746('0x4b')][_0x2746('0x4c')]({'plain':!![]});if(!_0x3b3359)throw new Error(_0x2746('0x4d'));if(_0x3b3359[_0x2746('0x4e')]==='user'){var _0x5cdd91=_0x444826[_0x2746('0x4c')]({'plain':!![]});var _0x42d7a6=_0x2746('0x25');return db['UserProfileSection'][_0x2746('0x48')]({'where':{'name':_0x42d7a6,'userProfileId':_0x3b3359['userProfileId']},'raw':!![]})['then'](function(_0x2c3696){if(_0x2c3696&&_0x2c3696[_0x2746('0x4f')]===0x0){return db['UserProfileResource'][_0x2746('0x49')]({'name':_0x5cdd91['name'],'resourceId':_0x5cdd91['id'],'type':_0x2c3696[_0x2746('0x2f')],'sectionId':_0x2c3696['id']},{})['then'](function(){return _0x444826;});}else{return _0x444826;}})[_0x2746('0x43')](function(_0x5f20fd){logger[_0x2746('0x29')](_0x2746('0x50'),_0x5f20fd);throw _0x5f20fd;});}return _0x444826;})[_0x2746('0x27')](respondWithResult(_0xc3b3a0,0xc9))[_0x2746('0x43')](handleError(_0xc3b3a0,null));};exports[_0x2746('0x51')]=function(_0x460e51,_0x4b9174){var _0x2aa969={'where':{'id':_0x460e51[_0x2746('0x52')]['id']}},_0x1c2cc8={};_0x1c2cc8[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x2c')][_0x2746('0x53')]);_0x2aa969['attributes']=_[_0x2746('0x33')](_0x1c2cc8[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x460e51[_0x2746('0x31')][_0x2746('0x35')]));_0x2aa969[_0x2746('0x34')]=_0x2aa969[_0x2746('0x34')]['length']?_0x2aa969[_0x2746('0x34')]:_0x1c2cc8[_0x2746('0x2e')];if(_0x460e51[_0x2746('0x31')]['includeAll']){_0x2aa969[_0x2746('0x46')]=[{'all':!![]}];}_0x2aa969=_[_0x2746('0x3e')]({},_0x2aa969,_0x460e51[_0x2746('0x47')]);return db[_0x2746('0x2c')]['find'](_0x2aa969)[_0x2746('0x27')](handleEntityNotFound(_0x4b9174,null))[_0x2746('0x27')](function(_0x56fdca){if(_0x56fdca){var _0x18b604=_0x56fdca[_0x2746('0x4c')]({'plain':!![]});_0x18b604=qs[_0x2746('0x54')](_0x18b604,['id',_0x2746('0x55'),'updatedAt']);_0x460e51[_0x2746('0x4a')]=_[_0x2746('0x54')](_0x460e51[_0x2746('0x4a')],['id','createdAt',_0x2746('0x56')]);return db[_0x2746('0x2c')][_0x2746('0x49')](_[_0x2746('0x3e')](_0x18b604,_0x460e51[_0x2746('0x4a')]),{'include':_0x460e51[_0x2746('0x31')][_0x2746('0x45')]?[{'all':!![]}]:undefined})[_0x2746('0x27')](function(_0x5b455d){var _0xf4e61d=_0x460e51[_0x2746('0x4b')]['get']({'plain':!![]});if(!_0xf4e61d)throw new Error(_0x2746('0x4d'));if(_0xf4e61d[_0x2746('0x4e')]===_0x2746('0x4b')){var _0x58f359=_0x5b455d['get']({'plain':!![]});var _0x270a0c='IvrCampaigns';return db[_0x2746('0x57')][_0x2746('0x48')]({'where':{'name':_0x270a0c,'userProfileId':_0xf4e61d['userProfileId']},'raw':!![]})[_0x2746('0x27')](function(_0x45ce9c){if(_0x45ce9c&&_0x45ce9c['autoAssociation']===0x0){return db[_0x2746('0x58')][_0x2746('0x49')]({'name':_0x58f359[_0x2746('0x2f')],'resourceId':_0x58f359['id'],'type':_0x45ce9c[_0x2746('0x2f')],'sectionId':_0x45ce9c['id']},{})['then'](function(){return _0x5b455d;});}else{return _0x5b455d;}})[_0x2746('0x43')](function(_0x53bf3d){logger[_0x2746('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53bf3d);throw _0x53bf3d;});}return _0x5b455d;});}})['then'](respondWithResult(_0x4b9174,0xc9))['catch'](handleError(_0x4b9174,null));};exports[_0x2746('0x24')]=function(_0x471c90,_0x3d5c47){if(_0x471c90['body']['id']){delete _0x471c90[_0x2746('0x4a')]['id'];}return db['Campaign'][_0x2746('0x48')]({'where':{'id':_0x471c90[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x3d5c47,null))[_0x2746('0x27')](saveUpdates(_0x471c90[_0x2746('0x4a')],null))['then'](respondWithResult(_0x3d5c47,null))['catch'](handleError(_0x3d5c47,null));};exports[_0x2746('0x26')]=function(_0x1fa74f,_0x4c301c){return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x1fa74f[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x4c301c,null))[_0x2746('0x27')](removeEntity(_0x4c301c,null))[_0x2746('0x43')](handleError(_0x4c301c,null));};exports['getHoppers']=function(_0x26f6a1,_0x55b90f,_0x8d71bb){var _0x3aa455={'raw':!![],'where':{}};var _0x41bfeb={};var _0x538548={'count':0x0,'rows':[]};return db[_0x2746('0x2c')][_0x2746('0x59')]({'where':{'id':_0x26f6a1[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x55b90f,null))[_0x2746('0x27')](function(_0x454801){if(_0x454801){_0x41bfeb['model']=_[_0x2746('0x30')](db[_0x2746('0x5a')][_0x2746('0x53')]);_0x41bfeb['query']=_[_0x2746('0x30')](_0x26f6a1[_0x2746('0x31')]);_0x41bfeb['filters']=_[_0x2746('0x33')](_0x41bfeb[_0x2746('0x2e')],_0x41bfeb[_0x2746('0x31')]);_0x3aa455[_0x2746('0x34')]=_[_0x2746('0x33')](_0x41bfeb[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x26f6a1[_0x2746('0x31')][_0x2746('0x35')]));_0x3aa455[_0x2746('0x34')]=_0x3aa455[_0x2746('0x34')]['length']?_0x3aa455[_0x2746('0x34')]:_0x41bfeb[_0x2746('0x2e')];if(!_0x26f6a1[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x3aa455[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x26f6a1['query'][_0x2746('0x1d')]);_0x3aa455[_0x2746('0x1f')]=qs['offset'](_0x26f6a1[_0x2746('0x31')][_0x2746('0x1f')]);}_0x3aa455[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x26f6a1['query']['sort']);_0x3aa455['where']=qs[_0x2746('0x32')](_['pick'](_0x26f6a1['query'],_0x41bfeb[_0x2746('0x32')]));_0x3aa455[_0x2746('0x3b')][_0x2746('0x5b')]=_0x454801['id'];if(_0x26f6a1['query'][_0x2746('0x3d')]){_0x3aa455[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x3aa455[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x3aa455[_0x2746('0x34')],function(_0x41d1f5){var _0x4c1bb5={};_0x4c1bb5[_0x41d1f5]={'$like':'%'+_0x26f6a1['query'][_0x2746('0x3d')]+'%'};return _0x4c1bb5;})});}_0x3aa455=_[_0x2746('0x3e')]({},_0x3aa455,_0x26f6a1[_0x2746('0x47')]);return db[_0x2746('0x5a')][_0x2746('0x1e')]({'where':_0x3aa455[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x5b6436){_0x538548[_0x2746('0x1e')]=_0x5b6436;if(_0x26f6a1[_0x2746('0x31')][_0x2746('0x45')]){_0x3aa455[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5a')][_0x2746('0x41')](_0x3aa455);})[_0x2746('0x27')](function(_0x3db2ef){_0x538548[_0x2746('0x42')]=_0x3db2ef;return _0x538548;});}})[_0x2746('0x27')](respondWithFilteredResult(_0x55b90f,_0x3aa455))[_0x2746('0x43')](handleError(_0x55b90f,null));};exports[_0x2746('0x5c')]=function(_0x47b1ac,_0x12747f,_0x239cc5){var _0x4f4289={'raw':!![],'where':{}};var _0x54f4d0={};var _0x1868b3={'count':0x0,'rows':[]};return db[_0x2746('0x2c')][_0x2746('0x59')]({'where':{'id':_0x47b1ac[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x12747f,null))['then'](function(_0x2402f4){if(_0x2402f4){_0x54f4d0[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x5d')][_0x2746('0x53')]);_0x54f4d0[_0x2746('0x31')]=_['keys'](_0x47b1ac[_0x2746('0x31')]);_0x54f4d0[_0x2746('0x32')]=_['intersection'](_0x54f4d0[_0x2746('0x2e')],_0x54f4d0[_0x2746('0x31')]);_0x4f4289[_0x2746('0x34')]=_[_0x2746('0x33')](_0x54f4d0[_0x2746('0x2e')],qs['fields'](_0x47b1ac[_0x2746('0x31')][_0x2746('0x35')]));_0x4f4289[_0x2746('0x34')]=_0x4f4289['attributes'][_0x2746('0x36')]?_0x4f4289[_0x2746('0x34')]:_0x54f4d0[_0x2746('0x2e')];if(!_0x47b1ac[_0x2746('0x31')][_0x2746('0x37')]('nolimit')){_0x4f4289[_0x2746('0x1d')]=qs['limit'](_0x47b1ac[_0x2746('0x31')][_0x2746('0x1d')]);_0x4f4289[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x47b1ac[_0x2746('0x31')][_0x2746('0x1f')]);}_0x4f4289['order']=qs[_0x2746('0x3a')](_0x47b1ac['query']['sort']);_0x4f4289[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x47b1ac[_0x2746('0x31')],_0x54f4d0[_0x2746('0x32')]));_0x4f4289[_0x2746('0x3b')]['CampaignId']=_0x2402f4['id'];if(_0x47b1ac[_0x2746('0x31')][_0x2746('0x3d')]){_0x4f4289['where']=_[_0x2746('0x3e')](_0x4f4289[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x4f4289['attributes'],function(_0x8ccb24){var _0x283348={};_0x283348[_0x8ccb24]={'$like':'%'+_0x47b1ac[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x283348;})});}_0x4f4289=_[_0x2746('0x3e')]({},_0x4f4289,_0x47b1ac[_0x2746('0x47')]);return db[_0x2746('0x5d')]['count']({'where':_0x4f4289[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x4f5f62){_0x1868b3[_0x2746('0x1e')]=_0x4f5f62;if(_0x47b1ac[_0x2746('0x31')][_0x2746('0x45')]){_0x4f4289[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5d')][_0x2746('0x41')](_0x4f4289);})[_0x2746('0x27')](function(_0x460f4d){_0x1868b3['rows']=_0x460f4d;return _0x1868b3;});}})[_0x2746('0x27')](respondWithFilteredResult(_0x12747f,_0x4f4289))[_0x2746('0x43')](handleError(_0x12747f,null));};exports[_0x2746('0x5e')]=function(_0x39c55d,_0xe3d45b,_0x6d6be2){var _0xa7ddd7={'raw':!![],'where':{}};var _0x2182e4={};var _0x4f077e={'count':0x0,'rows':[]};return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x39c55d[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0xe3d45b,null))[_0x2746('0x27')](function(_0x21264e){if(_0x21264e){_0x2182e4[_0x2746('0x2e')]=_['keys'](db['CmHopperFinal'][_0x2746('0x53')]);_0x2182e4['query']=_[_0x2746('0x30')](_0x39c55d['query']);_0x2182e4['filters']=_[_0x2746('0x33')](_0x2182e4[_0x2746('0x2e')],_0x2182e4['query']);_0xa7ddd7[_0x2746('0x34')]=_['intersection'](_0x2182e4[_0x2746('0x2e')],qs[_0x2746('0x35')](_0x39c55d[_0x2746('0x31')][_0x2746('0x35')]));_0xa7ddd7[_0x2746('0x34')]=_0xa7ddd7[_0x2746('0x34')][_0x2746('0x36')]?_0xa7ddd7[_0x2746('0x34')]:_0x2182e4[_0x2746('0x2e')];if(!_0x39c55d['query'][_0x2746('0x37')](_0x2746('0x38'))){_0xa7ddd7[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x39c55d['query'][_0x2746('0x1d')]);_0xa7ddd7[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x39c55d['query'][_0x2746('0x1f')]);}_0xa7ddd7[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x39c55d[_0x2746('0x31')][_0x2746('0x3a')]);_0xa7ddd7['where']=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x39c55d[_0x2746('0x31')],_0x2182e4['filters']));_0xa7ddd7[_0x2746('0x3b')]['CampaignId']=_0x21264e['id'];if(_0x39c55d[_0x2746('0x31')][_0x2746('0x3d')]){_0xa7ddd7[_0x2746('0x3b')]=_['merge'](_0xa7ddd7[_0x2746('0x3b')],{'$or':_['map'](_0xa7ddd7['attributes'],function(_0x4d4e35){var _0x23098b={};_0x23098b[_0x4d4e35]={'$like':'%'+_0x39c55d['query'][_0x2746('0x3d')]+'%'};return _0x23098b;})});}_0xa7ddd7=_[_0x2746('0x3e')]({},_0xa7ddd7,_0x39c55d[_0x2746('0x47')]);return db[_0x2746('0x5f')][_0x2746('0x1e')]({'where':_0xa7ddd7[_0x2746('0x3b')]})[_0x2746('0x27')](function(_0x197941){_0x4f077e[_0x2746('0x1e')]=_0x197941;if(_0x39c55d[_0x2746('0x31')][_0x2746('0x45')]){_0xa7ddd7[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x5f')][_0x2746('0x41')](_0xa7ddd7);})[_0x2746('0x27')](function(_0x379087){_0x4f077e[_0x2746('0x42')]=_0x379087;return _0x4f077e;});}})[_0x2746('0x27')](respondWithFilteredResult(_0xe3d45b,_0xa7ddd7))['catch'](handleError(_0xe3d45b,null));};exports['getHopperBlacks']=function(_0x5684bf,_0x2030ed,_0x3ce8a1){var _0x4bc154={'raw':!![],'where':{}};var _0x41bc73={};var _0x47ca03={'count':0x0,'rows':[]};return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x5684bf[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x2030ed,null))[_0x2746('0x27')](function(_0x268936){if(_0x268936){_0x41bc73[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x60')][_0x2746('0x53')]);_0x41bc73['query']=_[_0x2746('0x30')](_0x5684bf[_0x2746('0x31')]);_0x41bc73[_0x2746('0x32')]=_[_0x2746('0x33')](_0x41bc73[_0x2746('0x2e')],_0x41bc73[_0x2746('0x31')]);_0x4bc154[_0x2746('0x34')]=_[_0x2746('0x33')](_0x41bc73['model'],qs[_0x2746('0x35')](_0x5684bf[_0x2746('0x31')][_0x2746('0x35')]));_0x4bc154[_0x2746('0x34')]=_0x4bc154[_0x2746('0x34')][_0x2746('0x36')]?_0x4bc154[_0x2746('0x34')]:_0x41bc73[_0x2746('0x2e')];if(!_0x5684bf[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x4bc154['limit']=qs[_0x2746('0x1d')](_0x5684bf[_0x2746('0x31')][_0x2746('0x1d')]);_0x4bc154[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x5684bf[_0x2746('0x31')][_0x2746('0x1f')]);}_0x4bc154[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x5684bf[_0x2746('0x31')][_0x2746('0x3a')]);_0x4bc154[_0x2746('0x3b')]=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x5684bf['query'],_0x41bc73[_0x2746('0x32')]));_0x4bc154[_0x2746('0x3b')]['CampaignId']=_0x268936['id'];if(_0x5684bf['query']['filter']){_0x4bc154[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x4bc154[_0x2746('0x3b')],{'$or':_['map'](_0x4bc154[_0x2746('0x34')],function(_0x3732ed){var _0x47a2c9={};_0x47a2c9[_0x3732ed]={'$like':'%'+_0x5684bf[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x47a2c9;})});}_0x4bc154=_[_0x2746('0x3e')]({},_0x4bc154,_0x5684bf[_0x2746('0x47')]);return db[_0x2746('0x60')][_0x2746('0x1e')]({'where':_0x4bc154[_0x2746('0x3b')]})['then'](function(_0x343a2f){_0x47ca03[_0x2746('0x1e')]=_0x343a2f;if(_0x5684bf['query'][_0x2746('0x45')]){_0x4bc154[_0x2746('0x46')]=[{'all':!![]}];}return db[_0x2746('0x60')]['findAll'](_0x4bc154);})[_0x2746('0x27')](function(_0x416d47){_0x47ca03[_0x2746('0x42')]=_0x416d47;return _0x47ca03;});}})['then'](respondWithFilteredResult(_0x2030ed,_0x4bc154))['catch'](handleError(_0x2030ed,null));};exports[_0x2746('0x61')]=function(_0x4812da,_0x53bc21,_0x9b01a3){var _0x3e358e={};var _0x29b1e3={};var _0x1363f3;var _0x213e80;return db['Campaign'][_0x2746('0x59')]({'where':{'id':_0x4812da['params']['id']}})['then'](handleEntityNotFound(_0x53bc21,null))[_0x2746('0x27')](function(_0x25cf86){if(_0x25cf86){_0x1363f3=_0x25cf86;_0x29b1e3[_0x2746('0x2e')]=_[_0x2746('0x30')](db[_0x2746('0x62')][_0x2746('0x53')]);_0x29b1e3[_0x2746('0x31')]=_[_0x2746('0x30')](_0x4812da[_0x2746('0x31')]);_0x29b1e3[_0x2746('0x32')]=_[_0x2746('0x33')](_0x29b1e3[_0x2746('0x2e')],_0x29b1e3[_0x2746('0x31')]);_0x3e358e['attributes']=_[_0x2746('0x33')](_0x29b1e3[_0x2746('0x2e')],qs['fields'](_0x4812da[_0x2746('0x31')][_0x2746('0x35')]));_0x3e358e[_0x2746('0x34')]=_0x3e358e[_0x2746('0x34')]['length']?_0x3e358e['attributes']:_0x29b1e3['model'];_0x3e358e[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x4812da['query']['sort']);_0x3e358e['where']=qs[_0x2746('0x32')](_[_0x2746('0x3c')](_0x4812da[_0x2746('0x31')],_0x29b1e3[_0x2746('0x32')]));if(_0x4812da[_0x2746('0x31')][_0x2746('0x3d')]){_0x3e358e[_0x2746('0x3b')]=_['merge'](_0x3e358e['where'],{'$or':_[_0x2746('0x2b')](_0x3e358e[_0x2746('0x34')],function(_0x576d07){var _0xe05ced={};_0xe05ced[_0x576d07]={'$like':'%'+_0x4812da[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0xe05ced;})});}_0x3e358e=_['merge']({},_0x3e358e,_0x4812da[_0x2746('0x47')]);return _0x1363f3[_0x2746('0x61')](_0x3e358e);}})['then'](function(_0x39f31e){if(_0x39f31e){_0x213e80=_0x39f31e[_0x2746('0x36')];if(!_0x4812da[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x3e358e[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x4812da[_0x2746('0x31')][_0x2746('0x1d')]);_0x3e358e[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x4812da[_0x2746('0x31')][_0x2746('0x1f')]);}return _0x1363f3[_0x2746('0x61')](_0x3e358e);}})['then'](function(_0x39eaa6){if(_0x39eaa6){return _0x39eaa6?{'count':_0x213e80,'rows':_0x39eaa6}:null;}})[_0x2746('0x27')](respondWithResult(_0x53bc21,null))[_0x2746('0x43')](handleError(_0x53bc21,null));};exports[_0x2746('0x63')]=function(_0x125b68,_0x56a140,_0x20849e){var _0x1bddea,_0x512478;var _0xd971ba=[];var _0x1c01a2=moment()[_0x2746('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x125b68[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x56a140,null))[_0x2746('0x27')](function(_0x134307){if(_0x134307){_0x512478=_0x134307;return _0x134307[_0x2746('0x63')](_0x125b68[_0x2746('0x4a')][_0x2746('0x65')],_[_0x2746('0x54')](_0x125b68[_0x2746('0x4a')],[_0x2746('0x65'),'id'])||{});}return null;})[_0x2746('0x66')](function(_0x3b636b){var _0x2f2217;var _0x8a877f;_0x1bddea=_0x3b636b||[];var _0x52cb5c=[];if(_0x3b636b){for(var _0x4d52b0=0x0;_0x4d52b0<_0x3b636b[_0x2746('0x36')];_0x4d52b0+=0x1){var _0x4761f2=_0x3b636b[_0x4d52b0][_0x2746('0x4c')]({'plain':!![]});_0x512478[_0x2746('0x67')]=_0x125b68[_0x2746('0x4a')]['dialCheckDuplicateType']?_0x125b68[_0x2746('0x4a')][_0x2746('0x67')]:_0x512478['dialCheckDuplicateType'];switch(_0x512478['dialCheckDuplicateType']){case _0x2746('0x68'):_0x2f2217=squel[_0x2746('0x69')]()[_0x2746('0x6a')](_0x2746('0x6b'))[_0x2746('0x6c')](['phone',_0x2746('0x6d'),'ContactId','ListId',_0x2746('0x5b'),_0x2746('0x55'),_0x2746('0x56')],squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x70'),_0x2746('0x70'))['field'](_0x2746('0x71'),_0x2746('0x6d'))[_0x2746('0x6f')]('id',_0x2746('0x72'))[_0x2746('0x6f')](_0x4761f2['CmListId'][_0x2746('0x73')](),'ListId')[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id']['toString'](),_0x2746('0x5b'))[_0x2746('0x6f')]('\x27'+_0x1c01a2+'\x27','createdAt')[_0x2746('0x6f')]('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))['from'](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')](_0x2746('0x76'),_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78'))[_0x2746('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2746('0x6e')]()['field'](_0x2746('0x79'))[_0x2746('0x7a')](_0x2746('0x7b'))[_0x2746('0x3b')](_0x2746('0x7c'),_0x125b68['params']['id']['toString']()))['where'](_0x2746('0x7d'),squel[_0x2746('0x6e')]()[_0x2746('0x6f')]('COALESCE(phone,\x27\x27)')[_0x2746('0x7a')](_0x2746('0x6b'))[_0x2746('0x3b')](_0x2746('0x7c'),_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')]())))['toString']();break;case'onlyIfOpen':_0x2f2217=squel[_0x2746('0x69')]()['into'](_0x2746('0x6b'))[_0x2746('0x6c')]([_0x2746('0x70'),_0x2746('0x6d'),_0x2746('0x72'),'ListId',_0x2746('0x5b'),'createdAt',_0x2746('0x56')],squel[_0x2746('0x6e')]()['field'](_0x2746('0x70'),_0x2746('0x70'))[_0x2746('0x6f')]('NOW()',_0x2746('0x6d'))[_0x2746('0x6f')]('id','ContactId')[_0x2746('0x6f')](_0x4761f2['CmListId'][_0x2746('0x73')](),_0x2746('0x7e'))[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))['field']('\x27'+_0x1c01a2+'\x27','createdAt')['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))[_0x2746('0x7a')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x2746('0x3b')]('ListId\x20=\x20?',_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78'))['where'](_0x2746('0x7d'),squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x7f'))[_0x2746('0x7a')](_0x2746('0x6b'))[_0x2746('0x3b')]('CampaignId\x20=\x20?',_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')]())))[_0x2746('0x73')]();break;default:_0x2f2217=squel['insert']()['into'](_0x2746('0x6b'))['fromQuery'](['phone',_0x2746('0x6d'),'ContactId','ListId',_0x2746('0x5b'),'createdAt','updatedAt'],squel[_0x2746('0x6e')]()['field'](_0x2746('0x70'),_0x2746('0x70'))['field'](_0x2746('0x71'),'scheduledAt')[_0x2746('0x6f')]('id',_0x2746('0x72'))[_0x2746('0x6f')](_0x4761f2[_0x2746('0x77')][_0x2746('0x73')](),_0x2746('0x7e'))[_0x2746('0x6f')](_0x125b68[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x55'))['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))[_0x2746('0x7a')](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')](_0x2746('0x76'),_0x4761f2[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x78')))[_0x2746('0x73')]();}_0x8a877f=squel['insert']()[_0x2746('0x6a')](_0x2746('0x80'))[_0x2746('0x6c')]([_0x2746('0x81'),'scheduledAt',_0x2746('0x70'),'OrderBy',_0x2746('0x55'),_0x2746('0x56')],squel[_0x2746('0x6e')]()[_0x2746('0x6f')](_0x2746('0x82'),'id')[_0x2746('0x6f')](_0x2746('0x71'),'scheduledAt')[_0x2746('0x6f')]('ci.item',_0x2746('0x70'))[_0x2746('0x6f')](_0x2746('0x83'),_0x2746('0x84'))['field']('\x27'+_0x1c01a2+'\x27','createdAt')['field']('\x27'+_0x1c01a2+'\x27',_0x2746('0x56'))['from'](_0x2746('0x85'),'ci')[_0x2746('0x86')](_0x2746('0x6b'),'h',_0x2746('0x87'))[_0x2746('0x3b')]('h.ListId\x20=\x20?',_0x4761f2[_0x2746('0x77')]['toString']())[_0x2746('0x3b')](_0x2746('0x88'),_0x125b68['params']['id'][_0x2746('0x73')]())[_0x2746('0x3b')](_0x2746('0x89'),_0x1c01a2))[_0x2746('0x73')]();_0x52cb5c[_0x2746('0x8a')](db[_0x2746('0x8b')]['query'](_0x2f2217));_0xd971ba['push'](db[_0x2746('0x8b')][_0x2746('0x31')](_0x8a877f));}return BPromise['all'](_0x52cb5c);}})[_0x2746('0x27')](function(){return BPromise[_0x2746('0x8c')](_0xd971ba);})[_0x2746('0x27')](function(){return _0x1bddea;})[_0x2746('0x27')](respondWithResult(_0x56a140,null))[_0x2746('0x43')](handleError(_0x56a140,null));};exports['removeLists']=function(_0x50d591,_0xf7895c,_0x10b3de){return db[_0x2746('0x2c')]['find']({'where':{'id':_0x50d591[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0xf7895c,null))[_0x2746('0x27')](function(_0x3985a1){if(_0x3985a1){return _0x3985a1[_0x2746('0x8d')](_0x50d591[_0x2746('0x31')]['ids']);}})[_0x2746('0x27')](function(_0x309013){if(_0x309013){return db['CmHopper'][_0x2746('0x26')]({'where':{'ListId':_0x50d591[_0x2746('0x31')][_0x2746('0x65')],'CampaignId':_0x50d591[_0x2746('0x52')]['id']}})[_0x2746('0x27')](function(){return _0x309013;});}})[_0x2746('0x27')](respondWithStatusCode(_0xf7895c,null))[_0x2746('0x43')](handleError(_0xf7895c,null));};exports[_0x2746('0x8e')]=function(_0x4d6e33,_0x5e63a4,_0x3e4e4f){var _0x31eeb8={};var _0x97430b={};var _0x3ffb83;var _0x3b3843;return db[_0x2746('0x2c')]['findOne']({'where':{'id':_0x4d6e33[_0x2746('0x52')]['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x5e63a4,null))[_0x2746('0x27')](function(_0x41acbc){if(_0x41acbc){_0x3ffb83=_0x41acbc;_0x97430b[_0x2746('0x2e')]=_['keys'](db[_0x2746('0x62')][_0x2746('0x53')]);_0x97430b[_0x2746('0x31')]=_[_0x2746('0x30')](_0x4d6e33[_0x2746('0x31')]);_0x97430b[_0x2746('0x32')]=_[_0x2746('0x33')](_0x97430b['model'],_0x97430b[_0x2746('0x31')]);_0x31eeb8[_0x2746('0x34')]=_[_0x2746('0x33')](_0x97430b['model'],qs['fields'](_0x4d6e33[_0x2746('0x31')]['fields']));_0x31eeb8[_0x2746('0x34')]=_0x31eeb8[_0x2746('0x34')][_0x2746('0x36')]?_0x31eeb8[_0x2746('0x34')]:_0x97430b[_0x2746('0x2e')];_0x31eeb8[_0x2746('0x39')]=qs[_0x2746('0x3a')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x3a')]);_0x31eeb8['where']=qs[_0x2746('0x32')](_['pick'](_0x4d6e33[_0x2746('0x31')],_0x97430b['filters']));if(_0x4d6e33[_0x2746('0x31')][_0x2746('0x3d')]){_0x31eeb8[_0x2746('0x3b')]=_[_0x2746('0x3e')](_0x31eeb8[_0x2746('0x3b')],{'$or':_[_0x2746('0x2b')](_0x31eeb8['attributes'],function(_0x49e4c9){var _0x160502={};_0x160502[_0x49e4c9]={'$like':'%'+_0x4d6e33[_0x2746('0x31')][_0x2746('0x3d')]+'%'};return _0x160502;})});}_0x31eeb8=_[_0x2746('0x3e')]({},_0x31eeb8,_0x4d6e33['options']);return _0x3ffb83[_0x2746('0x8e')](_0x31eeb8);}})[_0x2746('0x27')](function(_0x29d02f){if(_0x29d02f){_0x3b3843=_0x29d02f[_0x2746('0x36')];if(!_0x4d6e33[_0x2746('0x31')][_0x2746('0x37')](_0x2746('0x38'))){_0x31eeb8[_0x2746('0x1d')]=qs[_0x2746('0x1d')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x1d')]);_0x31eeb8[_0x2746('0x1f')]=qs[_0x2746('0x1f')](_0x4d6e33[_0x2746('0x31')][_0x2746('0x1f')]);}return _0x3ffb83[_0x2746('0x8e')](_0x31eeb8);}})[_0x2746('0x27')](function(_0x31ee8d){if(_0x31ee8d){return _0x31ee8d?{'count':_0x3b3843,'rows':_0x31ee8d}:null;}})[_0x2746('0x27')](respondWithResult(_0x5e63a4,null))[_0x2746('0x43')](handleError(_0x5e63a4,null));};exports[_0x2746('0x8f')]=function(_0x278e6d,_0x7ab7f8,_0x374078){var _0x1e2293,_0x190358;var _0x1c102f=[];var _0x4e54e8=moment()[_0x2746('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2746('0x2c')][_0x2746('0x48')]({'where':{'id':_0x278e6d[_0x2746('0x52')]['id']}})['then'](handleEntityNotFound(_0x7ab7f8,null))['then'](function(_0x258fe0){if(_0x258fe0){_0x190358=_0x258fe0;return _0x258fe0[_0x2746('0x8f')](_0x278e6d[_0x2746('0x4a')]['ids'],_[_0x2746('0x54')](_0x278e6d[_0x2746('0x4a')],[_0x2746('0x65'),'id'])||{});}return null;})[_0x2746('0x66')](function(_0x51a7ed){var _0xfd070f;var _0x34d8f5;_0x1e2293=_0x51a7ed||[];var _0x469935=[];if(_0x51a7ed){for(var _0x487a6a=0x0;_0x487a6a<_0x51a7ed['length'];_0x487a6a+=0x1){var _0x29d7ea=_0x51a7ed[_0x487a6a][_0x2746('0x4c')]({'plain':!![]});_0xfd070f=squel[_0x2746('0x69')]()['into'](_0x2746('0x90'))[_0x2746('0x6c')]([_0x2746('0x70'),_0x2746('0x72'),_0x2746('0x7e'),_0x2746('0x5b'),_0x2746('0x55'),_0x2746('0x56')],squel['select']()['field'](_0x2746('0x70'),_0x2746('0x70'))[_0x2746('0x6f')]('id','ContactId')[_0x2746('0x6f')](_0x29d7ea[_0x2746('0x77')][_0x2746('0x73')](),'ListId')[_0x2746('0x6f')](_0x278e6d[_0x2746('0x52')]['id'][_0x2746('0x73')](),_0x2746('0x5b'))[_0x2746('0x6f')](_0x2746('0x71'),'createdAt')[_0x2746('0x6f')]('NOW()','updatedAt')[_0x2746('0x7a')](_0x2746('0x74'))[_0x2746('0x3b')](_0x2746('0x75'))[_0x2746('0x3b')]('ListId\x20=\x20?',_0x29d7ea[_0x2746('0x77')][_0x2746('0x73')]())[_0x2746('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x469935[_0x2746('0x8a')](db['sequelize']['query'](_0xfd070f));}return BPromise[_0x2746('0x8c')](_0x469935);}})[_0x2746('0x27')](function(){return _0x1e2293;})[_0x2746('0x27')](respondWithResult(_0x7ab7f8,null))[_0x2746('0x43')](handleError(_0x7ab7f8,null));};exports[_0x2746('0x91')]=function(_0x18473b,_0x2a8fc5,_0x5be077){return db['Campaign'][_0x2746('0x48')]({'where':{'id':_0x18473b['params']['id']}})[_0x2746('0x27')](handleEntityNotFound(_0x2a8fc5,null))[_0x2746('0x27')](function(_0x5a086a){if(_0x5a086a){return _0x5a086a[_0x2746('0x91')](_0x18473b[_0x2746('0x31')]['ids']);}})[_0x2746('0x27')](function(_0x2c21e5){if(_0x2c21e5){return db[_0x2746('0x60')]['destroy']({'where':{'ListId':_0x18473b[_0x2746('0x31')][_0x2746('0x65')],'CampaignId':_0x18473b[_0x2746('0x52')]['id']}})[_0x2746('0x27')](function(){return _0x2c21e5;});}})[_0x2746('0x27')](respondWithStatusCode(_0x2a8fc5,null))['catch'](handleError(_0x2a8fc5,null));}; \ No newline at end of file +var _0x1d2d=['include','findAll','rows','show','params','fields','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','catch','clone','find','omit','createdAt','updatedAt','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper','nolimit','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','ListId','select','field','NOW()','scheduledAt','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','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','CmListId','insert','fromQuery','cmHopperId','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x16b85d,_0x2b8ae2){var _0x2d143a=function(_0x2598ff){while(--_0x2598ff){_0x16b85d['push'](_0x16b85d['shift']());}};_0x2d143a(++_0x2b8ae2);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x1b771b,_0x50fb51){_0x1b771b=_0x1b771b-0x0;var _0x1953ea=_0x1d2d[_0x1b771b];return _0x1953ea;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){var _0x5df4af=_0x3f229c[_0xd1d2('0x28')]({'plain':!![]});var _0x42da6d=_0xd1d2('0x29');return db[_0xd1d2('0x2a')][_0xd1d2('0x27')]({'where':{'type':_0x42da6d,'resourceId':_0x5df4af['id']}})[_0xd1d2('0x26')](function(){return _0x3f229c;});})[_0xd1d2('0x26')](function(){_0x19d535[_0xd1d2('0x1c')](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x384460,_0x3645e9){return function(_0x4e1bc2){if(!_0x4e1bc2){_0x384460['sendStatus'](0x194);}return _0x4e1bc2;};}function handleError(_0x133c6c,_0x442375){_0x442375=_0x442375||0x1f4;return function(_0x1e6072){logger[_0xd1d2('0x2b')](_0x1e6072[_0xd1d2('0x2c')]);if(_0x1e6072['name']){delete _0x1e6072[_0xd1d2('0x2d')];}_0x133c6c[_0xd1d2('0x1c')](_0x442375)[_0xd1d2('0x2e')](_0x1e6072);};}exports['index']=function(_0x19db00,_0x1db17f){var _0xbd855a={},_0x56557d={},_0x419db7={'count':0x0,'rows':[]};var _0x18528f=_[_0xd1d2('0x2f')](db[_0xd1d2('0x30')][_0xd1d2('0x31')],function(_0x14d661){return{'name':_0x14d661[_0xd1d2('0x32')],'type':_0x14d661[_0xd1d2('0x33')][_0xd1d2('0x34')]};});_0x56557d[_0xd1d2('0x35')]=_[_0xd1d2('0x2f')](_0x18528f,_0xd1d2('0x2d'));_0x56557d[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x19db00[_0xd1d2('0x36')]);_0x56557d[_0xd1d2('0x38')]=_[_0xd1d2('0x39')](_0x56557d[_0xd1d2('0x35')],_0x56557d['query']);_0xbd855a[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x56557d[_0xd1d2('0x35')],qs['fields'](_0x19db00[_0xd1d2('0x36')]['fields']));_0xbd855a['attributes']=_0xbd855a[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0xbd855a[_0xd1d2('0x3a')]:_0x56557d[_0xd1d2('0x35')];if(!_0x19db00[_0xd1d2('0x36')][_0xd1d2('0x3c')]('nolimit')){_0xbd855a[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x19db00['query'][_0xd1d2('0x21')]);_0xbd855a[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x19db00[_0xd1d2('0x36')]['offset']);}_0xbd855a['order']=qs[_0xd1d2('0x3d')](_0x19db00['query']['sort']);_0xbd855a['where']=qs[_0xd1d2('0x38')](_['pick'](_0x19db00[_0xd1d2('0x36')],_0x56557d['filters']),_0x18528f);if(_0x19db00['query']['filter']){_0xbd855a[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0xbd855a[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x18528f,function(_0x33ba30){if(_0x33ba30[_0xd1d2('0x33')]!==_0xd1d2('0x40')){var _0x38bf16={};_0x38bf16[_0x33ba30[_0xd1d2('0x2d')]]={'$like':'%'+_0x19db00[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x38bf16;}})});}_0xbd855a=_[_0xd1d2('0x3f')]({},_0xbd855a,_0x19db00[_0xd1d2('0x42')]);var _0x18ff05={'where':_0xbd855a['where']};return db['Campaign'][_0xd1d2('0x22')](_0x18ff05)[_0xd1d2('0x26')](function(_0x24fc93){_0x419db7['count']=_0x24fc93;if(_0x19db00['query'][_0xd1d2('0x43')]){_0xbd855a[_0xd1d2('0x44')]=[{'all':!![]}];}return db['Campaign'][_0xd1d2('0x45')](_0xbd855a);})['then'](function(_0x5a3790){_0x419db7[_0xd1d2('0x46')]=_0x5a3790;return _0x419db7;})['then'](respondWithFilteredResult(_0x1db17f,_0xbd855a))['catch'](handleError(_0x1db17f,null));};exports[_0xd1d2('0x47')]=function(_0x320fa4,_0x2a8961){var _0x49dad2={'raw':![],'where':{'id':_0x320fa4[_0xd1d2('0x48')]['id']}},_0x2ba87b={};_0x2ba87b[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db['Campaign'][_0xd1d2('0x31')]);_0x2ba87b[_0xd1d2('0x36')]=_['keys'](_0x320fa4[_0xd1d2('0x36')]);_0x2ba87b['filters']=_[_0xd1d2('0x39')](_0x2ba87b[_0xd1d2('0x35')],_0x2ba87b[_0xd1d2('0x36')]);_0x49dad2[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x2ba87b['model'],qs['fields'](_0x320fa4[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x49dad2['attributes']=_0x49dad2[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x49dad2[_0xd1d2('0x3a')]:_0x2ba87b[_0xd1d2('0x35')];if(_0x320fa4[_0xd1d2('0x36')][_0xd1d2('0x43')]){_0x49dad2[_0xd1d2('0x44')]=[{'all':!![]}];}_0x49dad2=_['merge']({},_0x49dad2,_0x320fa4[_0xd1d2('0x42')]);return db[_0xd1d2('0x30')]['find'](_0x49dad2)[_0xd1d2('0x26')](handleEntityNotFound(_0x2a8961,null))[_0xd1d2('0x26')](respondWithResult(_0x2a8961,null))['catch'](handleError(_0x2a8961,null));};exports['create']=function(_0x3d4fe3,_0x182ea8){return db['Campaign'][_0xd1d2('0x4a')](_0x3d4fe3[_0xd1d2('0x4b')],{})[_0xd1d2('0x26')](function(_0x23ab46){var _0x404ad2=_0x3d4fe3['user']['get']({'plain':!![]});if(!_0x404ad2)throw new Error(_0xd1d2('0x4c'));if(_0x404ad2['role']===_0xd1d2('0x4d')){var _0xcd4b70=_0x23ab46['get']({'plain':!![]});var _0x389fcb=_0xd1d2('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x389fcb,'userProfileId':_0x404ad2[_0xd1d2('0x4e')]},'raw':!![]})[_0xd1d2('0x26')](function(_0x187de4){if(_0x187de4&&_0x187de4[_0xd1d2('0x4f')]===0x0){return db[_0xd1d2('0x2a')][_0xd1d2('0x4a')]({'name':_0xcd4b70[_0xd1d2('0x2d')],'resourceId':_0xcd4b70['id'],'type':_0x187de4[_0xd1d2('0x2d')],'sectionId':_0x187de4['id']},{})[_0xd1d2('0x26')](function(){return _0x23ab46;});}else{return _0x23ab46;}})['catch'](function(_0x1958f3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1958f3);throw _0x1958f3;});}return _0x23ab46;})[_0xd1d2('0x26')](respondWithResult(_0x182ea8,0xc9))[_0xd1d2('0x50')](handleError(_0x182ea8,null));};exports[_0xd1d2('0x51')]=function(_0x47417f,_0x215dea){var _0x459209={'where':{'id':_0x47417f[_0xd1d2('0x48')]['id']}},_0x35a51b={};_0x35a51b[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db[_0xd1d2('0x30')][_0xd1d2('0x31')]);_0x459209[_0xd1d2('0x3a')]=_['intersection'](_0x35a51b['model'],qs[_0xd1d2('0x49')](_0x47417f[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x459209[_0xd1d2('0x3a')]=_0x459209[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x459209[_0xd1d2('0x3a')]:_0x35a51b[_0xd1d2('0x35')];if(_0x47417f[_0xd1d2('0x36')][_0xd1d2('0x43')]){_0x459209[_0xd1d2('0x44')]=[{'all':!![]}];}_0x459209=_['merge']({},_0x459209,_0x47417f['options']);return db[_0xd1d2('0x30')][_0xd1d2('0x52')](_0x459209)[_0xd1d2('0x26')](handleEntityNotFound(_0x215dea,null))[_0xd1d2('0x26')](function(_0x544870){if(_0x544870){var _0x17e149=_0x544870[_0xd1d2('0x28')]({'plain':!![]});_0x17e149=qs[_0xd1d2('0x53')](_0x17e149,['id',_0xd1d2('0x54'),_0xd1d2('0x55')]);_0x47417f[_0xd1d2('0x4b')]=_[_0xd1d2('0x53')](_0x47417f['body'],['id',_0xd1d2('0x54'),_0xd1d2('0x55')]);return db[_0xd1d2('0x30')]['create'](_['merge'](_0x17e149,_0x47417f[_0xd1d2('0x4b')]),{'include':_0x47417f[_0xd1d2('0x36')][_0xd1d2('0x43')]?[{'all':!![]}]:undefined})[_0xd1d2('0x26')](function(_0x598e6c){var _0xbf1e6e=_0x47417f[_0xd1d2('0x4d')][_0xd1d2('0x28')]({'plain':!![]});if(!_0xbf1e6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbf1e6e[_0xd1d2('0x56')]===_0xd1d2('0x4d')){var _0x4842f1=_0x598e6c[_0xd1d2('0x28')]({'plain':!![]});var _0x3799b7=_0xd1d2('0x29');return db[_0xd1d2('0x57')]['find']({'where':{'name':_0x3799b7,'userProfileId':_0xbf1e6e[_0xd1d2('0x4e')]},'raw':!![]})[_0xd1d2('0x26')](function(_0xd82d10){if(_0xd82d10&&_0xd82d10[_0xd1d2('0x4f')]===0x0){return db[_0xd1d2('0x2a')]['create']({'name':_0x4842f1['name'],'resourceId':_0x4842f1['id'],'type':_0xd82d10['name'],'sectionId':_0xd82d10['id']},{})['then'](function(){return _0x598e6c;});}else{return _0x598e6c;}})['catch'](function(_0x105850){logger[_0xd1d2('0x2b')](_0xd1d2('0x58'),_0x105850);throw _0x105850;});}return _0x598e6c;});}})['then'](respondWithResult(_0x215dea,0xc9))[_0xd1d2('0x50')](handleError(_0x215dea,null));};exports[_0xd1d2('0x59')]=function(_0x22d617,_0x580d83){if(_0x22d617[_0xd1d2('0x4b')]['id']){delete _0x22d617[_0xd1d2('0x4b')]['id'];}return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0x22d617[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x580d83,null))['then'](saveUpdates(_0x22d617[_0xd1d2('0x4b')],null))[_0xd1d2('0x26')](respondWithResult(_0x580d83,null))['catch'](handleError(_0x580d83,null));};exports['destroy']=function(_0x21bfd4,_0x1ea57a){return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0x21bfd4['params']['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x1ea57a,null))[_0xd1d2('0x26')](removeEntity(_0x1ea57a,null))[_0xd1d2('0x50')](handleError(_0x1ea57a,null));};exports[_0xd1d2('0x5a')]=function(_0x5d537e,_0x2d1b0d,_0x379283){var _0x3128b2={'raw':!![],'where':{}};var _0x572b55={};var _0x46ff4d={'count':0x0,'rows':[]};return db[_0xd1d2('0x30')]['findOne']({'where':{'id':_0x5d537e[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x2d1b0d,null))[_0xd1d2('0x26')](function(_0x55c0b5){if(_0x55c0b5){_0x572b55[_0xd1d2('0x35')]=_['keys'](db[_0xd1d2('0x5b')]['rawAttributes']);_0x572b55['query']=_['keys'](_0x5d537e['query']);_0x572b55[_0xd1d2('0x38')]=_['intersection'](_0x572b55[_0xd1d2('0x35')],_0x572b55['query']);_0x3128b2[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x572b55[_0xd1d2('0x35')],qs[_0xd1d2('0x49')](_0x5d537e[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x3128b2['attributes']=_0x3128b2[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x3128b2[_0xd1d2('0x3a')]:_0x572b55[_0xd1d2('0x35')];if(!_0x5d537e[_0xd1d2('0x36')][_0xd1d2('0x3c')](_0xd1d2('0x5c'))){_0x3128b2[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x5d537e[_0xd1d2('0x36')]['limit']);_0x3128b2[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x5d537e[_0xd1d2('0x36')][_0xd1d2('0x1f')]);}_0x3128b2['order']=qs[_0xd1d2('0x3d')](_0x5d537e[_0xd1d2('0x36')][_0xd1d2('0x3d')]);_0x3128b2['where']=qs[_0xd1d2('0x38')](_[_0xd1d2('0x5d')](_0x5d537e['query'],_0x572b55['filters']));_0x3128b2[_0xd1d2('0x3e')][_0xd1d2('0x5e')]=_0x55c0b5['id'];if(_0x5d537e[_0xd1d2('0x36')][_0xd1d2('0x41')]){_0x3128b2[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3128b2[_0xd1d2('0x3e')],{'$or':_['map'](_0x3128b2[_0xd1d2('0x3a')],function(_0x9a98d4){var _0x2bcf43={};_0x2bcf43[_0x9a98d4]={'$like':'%'+_0x5d537e[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x2bcf43;})});}_0x3128b2=_[_0xd1d2('0x3f')]({},_0x3128b2,_0x5d537e[_0xd1d2('0x42')]);return db[_0xd1d2('0x5b')][_0xd1d2('0x22')]({'where':_0x3128b2[_0xd1d2('0x3e')]})[_0xd1d2('0x26')](function(_0x162249){_0x46ff4d[_0xd1d2('0x22')]=_0x162249;if(_0x5d537e[_0xd1d2('0x36')]['includeAll']){_0x3128b2[_0xd1d2('0x44')]=[{'all':!![]}];}return db[_0xd1d2('0x5b')][_0xd1d2('0x45')](_0x3128b2);})[_0xd1d2('0x26')](function(_0x20a3f0){_0x46ff4d[_0xd1d2('0x46')]=_0x20a3f0;return _0x46ff4d;});}})[_0xd1d2('0x26')](respondWithFilteredResult(_0x2d1b0d,_0x3128b2))[_0xd1d2('0x50')](handleError(_0x2d1b0d,null));};exports[_0xd1d2('0x5f')]=function(_0x431057,_0x66fa57,_0x190b55){var _0x1d2d5e={'raw':!![],'where':{}};var _0x548b9d={};var _0x369382={'count':0x0,'rows':[]};return db[_0xd1d2('0x30')][_0xd1d2('0x60')]({'where':{'id':_0x431057[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x66fa57,null))[_0xd1d2('0x26')](function(_0x4c8f82){if(_0x4c8f82){_0x548b9d[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db[_0xd1d2('0x61')][_0xd1d2('0x31')]);_0x548b9d[_0xd1d2('0x36')]=_['keys'](_0x431057[_0xd1d2('0x36')]);_0x548b9d[_0xd1d2('0x38')]=_[_0xd1d2('0x39')](_0x548b9d[_0xd1d2('0x35')],_0x548b9d[_0xd1d2('0x36')]);_0x1d2d5e['attributes']=_[_0xd1d2('0x39')](_0x548b9d[_0xd1d2('0x35')],qs[_0xd1d2('0x49')](_0x431057[_0xd1d2('0x36')]['fields']));_0x1d2d5e[_0xd1d2('0x3a')]=_0x1d2d5e[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x1d2d5e[_0xd1d2('0x3a')]:_0x548b9d[_0xd1d2('0x35')];if(!_0x431057[_0xd1d2('0x36')][_0xd1d2('0x3c')]('nolimit')){_0x1d2d5e[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x431057[_0xd1d2('0x36')][_0xd1d2('0x21')]);_0x1d2d5e[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x431057[_0xd1d2('0x36')][_0xd1d2('0x1f')]);}_0x1d2d5e[_0xd1d2('0x62')]=qs[_0xd1d2('0x3d')](_0x431057[_0xd1d2('0x36')][_0xd1d2('0x3d')]);_0x1d2d5e[_0xd1d2('0x3e')]=qs[_0xd1d2('0x38')](_[_0xd1d2('0x5d')](_0x431057[_0xd1d2('0x36')],_0x548b9d[_0xd1d2('0x38')]));_0x1d2d5e['where'][_0xd1d2('0x5e')]=_0x4c8f82['id'];if(_0x431057['query'][_0xd1d2('0x41')]){_0x1d2d5e[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x1d2d5e[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x1d2d5e[_0xd1d2('0x3a')],function(_0x1489e5){var _0x1d7add={};_0x1d7add[_0x1489e5]={'$like':'%'+_0x431057['query']['filter']+'%'};return _0x1d7add;})});}_0x1d2d5e=_[_0xd1d2('0x3f')]({},_0x1d2d5e,_0x431057['options']);return db['CmHopperHistory'][_0xd1d2('0x22')]({'where':_0x1d2d5e[_0xd1d2('0x3e')]})['then'](function(_0xecdff1){_0x369382[_0xd1d2('0x22')]=_0xecdff1;if(_0x431057[_0xd1d2('0x36')][_0xd1d2('0x43')]){_0x1d2d5e[_0xd1d2('0x44')]=[{'all':!![]}];}return db[_0xd1d2('0x61')][_0xd1d2('0x45')](_0x1d2d5e);})['then'](function(_0x47185d){_0x369382['rows']=_0x47185d;return _0x369382;});}})[_0xd1d2('0x26')](respondWithFilteredResult(_0x66fa57,_0x1d2d5e))['catch'](handleError(_0x66fa57,null));};exports[_0xd1d2('0x63')]=function(_0x3106bc,_0x405aa7,_0x274eb7){var _0x431247={'raw':!![],'where':{}};var _0x8d095a={};var _0x3bf602={'count':0x0,'rows':[]};return db['Campaign'][_0xd1d2('0x60')]({'where':{'id':_0x3106bc[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x405aa7,null))[_0xd1d2('0x26')](function(_0x514b94){if(_0x514b94){_0x8d095a[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db[_0xd1d2('0x64')]['rawAttributes']);_0x8d095a[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x3106bc[_0xd1d2('0x36')]);_0x8d095a[_0xd1d2('0x38')]=_[_0xd1d2('0x39')](_0x8d095a['model'],_0x8d095a[_0xd1d2('0x36')]);_0x431247[_0xd1d2('0x3a')]=_['intersection'](_0x8d095a[_0xd1d2('0x35')],qs[_0xd1d2('0x49')](_0x3106bc[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x431247[_0xd1d2('0x3a')]=_0x431247['attributes'][_0xd1d2('0x3b')]?_0x431247[_0xd1d2('0x3a')]:_0x8d095a[_0xd1d2('0x35')];if(!_0x3106bc[_0xd1d2('0x36')][_0xd1d2('0x3c')](_0xd1d2('0x5c'))){_0x431247[_0xd1d2('0x21')]=qs['limit'](_0x3106bc[_0xd1d2('0x36')][_0xd1d2('0x21')]);_0x431247[_0xd1d2('0x1f')]=qs['offset'](_0x3106bc[_0xd1d2('0x36')][_0xd1d2('0x1f')]);}_0x431247[_0xd1d2('0x62')]=qs[_0xd1d2('0x3d')](_0x3106bc['query'][_0xd1d2('0x3d')]);_0x431247[_0xd1d2('0x3e')]=qs['filters'](_['pick'](_0x3106bc[_0xd1d2('0x36')],_0x8d095a['filters']));_0x431247[_0xd1d2('0x3e')][_0xd1d2('0x5e')]=_0x514b94['id'];if(_0x3106bc['query']['filter']){_0x431247[_0xd1d2('0x3e')]=_['merge'](_0x431247[_0xd1d2('0x3e')],{'$or':_['map'](_0x431247['attributes'],function(_0x21830e){var _0x2fb4f1={};_0x2fb4f1[_0x21830e]={'$like':'%'+_0x3106bc[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x2fb4f1;})});}_0x431247=_[_0xd1d2('0x3f')]({},_0x431247,_0x3106bc[_0xd1d2('0x42')]);return db['CmHopperFinal']['count']({'where':_0x431247[_0xd1d2('0x3e')]})[_0xd1d2('0x26')](function(_0x22047e){_0x3bf602[_0xd1d2('0x22')]=_0x22047e;if(_0x3106bc[_0xd1d2('0x36')][_0xd1d2('0x43')]){_0x431247[_0xd1d2('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd1d2('0x45')](_0x431247);})['then'](function(_0x309075){_0x3bf602[_0xd1d2('0x46')]=_0x309075;return _0x3bf602;});}})['then'](respondWithFilteredResult(_0x405aa7,_0x431247))[_0xd1d2('0x50')](handleError(_0x405aa7,null));};exports[_0xd1d2('0x65')]=function(_0x18333b,_0xdebec0,_0x2075a4){var _0x29664a={'raw':!![],'where':{}};var _0x1d57db={};var _0x714601={'count':0x0,'rows':[]};return db[_0xd1d2('0x30')][_0xd1d2('0x60')]({'where':{'id':_0x18333b[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0xdebec0,null))['then'](function(_0xae1ec5){if(_0xae1ec5){_0x1d57db[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db[_0xd1d2('0x66')][_0xd1d2('0x31')]);_0x1d57db[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x18333b[_0xd1d2('0x36')]);_0x1d57db[_0xd1d2('0x38')]=_[_0xd1d2('0x39')](_0x1d57db[_0xd1d2('0x35')],_0x1d57db[_0xd1d2('0x36')]);_0x29664a[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x1d57db[_0xd1d2('0x35')],qs[_0xd1d2('0x49')](_0x18333b['query'][_0xd1d2('0x49')]));_0x29664a['attributes']=_0x29664a[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x29664a[_0xd1d2('0x3a')]:_0x1d57db[_0xd1d2('0x35')];if(!_0x18333b[_0xd1d2('0x36')][_0xd1d2('0x3c')](_0xd1d2('0x5c'))){_0x29664a[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x18333b['query']['limit']);_0x29664a['offset']=qs[_0xd1d2('0x1f')](_0x18333b[_0xd1d2('0x36')][_0xd1d2('0x1f')]);}_0x29664a['order']=qs['sort'](_0x18333b[_0xd1d2('0x36')][_0xd1d2('0x3d')]);_0x29664a[_0xd1d2('0x3e')]=qs['filters'](_[_0xd1d2('0x5d')](_0x18333b['query'],_0x1d57db[_0xd1d2('0x38')]));_0x29664a['where'][_0xd1d2('0x5e')]=_0xae1ec5['id'];if(_0x18333b[_0xd1d2('0x36')][_0xd1d2('0x41')]){_0x29664a[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x29664a['where'],{'$or':_[_0xd1d2('0x2f')](_0x29664a['attributes'],function(_0x59a836){var _0x3d03ed={};_0x3d03ed[_0x59a836]={'$like':'%'+_0x18333b[_0xd1d2('0x36')]['filter']+'%'};return _0x3d03ed;})});}_0x29664a=_['merge']({},_0x29664a,_0x18333b[_0xd1d2('0x42')]);return db[_0xd1d2('0x66')][_0xd1d2('0x22')]({'where':_0x29664a['where']})['then'](function(_0x33835a){_0x714601[_0xd1d2('0x22')]=_0x33835a;if(_0x18333b[_0xd1d2('0x36')][_0xd1d2('0x43')]){_0x29664a[_0xd1d2('0x44')]=[{'all':!![]}];}return db[_0xd1d2('0x66')][_0xd1d2('0x45')](_0x29664a);})[_0xd1d2('0x26')](function(_0x523a99){_0x714601[_0xd1d2('0x46')]=_0x523a99;return _0x714601;});}})[_0xd1d2('0x26')](respondWithFilteredResult(_0xdebec0,_0x29664a))['catch'](handleError(_0xdebec0,null));};exports[_0xd1d2('0x67')]=function(_0x32f50e,_0x1f9a2d,_0x2aaee8){var _0x534451={};var _0x1df3a8={};var _0x560dc4;var _0xc13416;return db[_0xd1d2('0x30')]['findOne']({'where':{'id':_0x32f50e[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x1f9a2d,null))['then'](function(_0x2eda24){if(_0x2eda24){_0x560dc4=_0x2eda24;_0x1df3a8['model']=_[_0xd1d2('0x37')](db[_0xd1d2('0x68')]['rawAttributes']);_0x1df3a8[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x32f50e[_0xd1d2('0x36')]);_0x1df3a8[_0xd1d2('0x38')]=_['intersection'](_0x1df3a8['model'],_0x1df3a8['query']);_0x534451['attributes']=_[_0xd1d2('0x39')](_0x1df3a8[_0xd1d2('0x35')],qs[_0xd1d2('0x49')](_0x32f50e[_0xd1d2('0x36')]['fields']));_0x534451[_0xd1d2('0x3a')]=_0x534451['attributes'][_0xd1d2('0x3b')]?_0x534451[_0xd1d2('0x3a')]:_0x1df3a8[_0xd1d2('0x35')];_0x534451[_0xd1d2('0x62')]=qs[_0xd1d2('0x3d')](_0x32f50e['query'][_0xd1d2('0x3d')]);_0x534451['where']=qs['filters'](_[_0xd1d2('0x5d')](_0x32f50e['query'],_0x1df3a8['filters']));if(_0x32f50e['query'][_0xd1d2('0x41')]){_0x534451['where']=_['merge'](_0x534451[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x534451[_0xd1d2('0x3a')],function(_0x44c2fd){var _0x30348e={};_0x30348e[_0x44c2fd]={'$like':'%'+_0x32f50e[_0xd1d2('0x36')]['filter']+'%'};return _0x30348e;})});}_0x534451=_['merge']({},_0x534451,_0x32f50e[_0xd1d2('0x42')]);return _0x560dc4[_0xd1d2('0x67')](_0x534451);}})[_0xd1d2('0x26')](function(_0xf326c8){if(_0xf326c8){_0xc13416=_0xf326c8[_0xd1d2('0x3b')];if(!_0x32f50e[_0xd1d2('0x36')]['hasOwnProperty'](_0xd1d2('0x5c'))){_0x534451['limit']=qs[_0xd1d2('0x21')](_0x32f50e[_0xd1d2('0x36')][_0xd1d2('0x21')]);_0x534451[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x32f50e['query'][_0xd1d2('0x1f')]);}return _0x560dc4[_0xd1d2('0x67')](_0x534451);}})['then'](function(_0x16ba2c){if(_0x16ba2c){return _0x16ba2c?{'count':_0xc13416,'rows':_0x16ba2c}:null;}})[_0xd1d2('0x26')](respondWithResult(_0x1f9a2d,null))[_0xd1d2('0x50')](handleError(_0x1f9a2d,null));};exports[_0xd1d2('0x69')]=function(_0x2b9a92,_0x3faef8,_0x52e4ad){var _0x175b16,_0x384716;var _0x159202=[];var _0x4b1719=moment()[_0xd1d2('0x6a')](_0xd1d2('0x6b'));return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0x2b9a92[_0xd1d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x3faef8,null))[_0xd1d2('0x26')](function(_0x2d354e){if(_0x2d354e){_0x384716=_0x2d354e;return _0x2d354e[_0xd1d2('0x69')](_0x2b9a92['body'][_0xd1d2('0x6c')],_['omit'](_0x2b9a92[_0xd1d2('0x4b')],[_0xd1d2('0x6c'),'id'])||{});}return null;})[_0xd1d2('0x6d')](function(_0x98141a){var _0x1e56e4;var _0x33acf4;_0x175b16=_0x98141a||[];var _0x1d8f94=[];if(_0x98141a){for(var _0x368ec8=0x0;_0x368ec8<_0x98141a['length'];_0x368ec8+=0x1){var _0x429aa6=_0x98141a[_0x368ec8][_0xd1d2('0x28')]({'plain':!![]});_0x384716['dialCheckDuplicateType']=_0x2b9a92['body']['dialCheckDuplicateType']?_0x2b9a92[_0xd1d2('0x4b')][_0xd1d2('0x6e')]:_0x384716['dialCheckDuplicateType'];switch(_0x384716[_0xd1d2('0x6e')]){case _0xd1d2('0x6f'):_0x1e56e4=squel['insert']()[_0xd1d2('0x70')](_0xd1d2('0x71'))['fromQuery']([_0xd1d2('0x72'),'scheduledAt','ContactId',_0xd1d2('0x73'),_0xd1d2('0x5e'),_0xd1d2('0x54'),_0xd1d2('0x55')],squel[_0xd1d2('0x74')]()[_0xd1d2('0x75')](_0xd1d2('0x72'),_0xd1d2('0x72'))[_0xd1d2('0x75')](_0xd1d2('0x76'),_0xd1d2('0x77'))[_0xd1d2('0x75')]('id',_0xd1d2('0x78'))[_0xd1d2('0x75')](_0x429aa6['CmListId'][_0xd1d2('0x79')](),_0xd1d2('0x73'))[_0xd1d2('0x75')](_0x2b9a92[_0xd1d2('0x48')]['id'][_0xd1d2('0x79')](),_0xd1d2('0x5e'))['field']('\x27'+_0x4b1719+'\x27',_0xd1d2('0x54'))[_0xd1d2('0x75')]('\x27'+_0x4b1719+'\x27',_0xd1d2('0x55'))[_0xd1d2('0x7a')](_0xd1d2('0x7b'))[_0xd1d2('0x3e')](_0xd1d2('0x7c'))[_0xd1d2('0x3e')](_0xd1d2('0x7d'),_0x429aa6['CmListId']['toString']())[_0xd1d2('0x3e')](_0xd1d2('0x7e'))['where'](_0xd1d2('0x7f'),squel[_0xd1d2('0x74')]()[_0xd1d2('0x75')](_0xd1d2('0x80'))['from'](_0xd1d2('0x81'))[_0xd1d2('0x3e')](_0xd1d2('0x82'),_0x2b9a92['params']['id'][_0xd1d2('0x79')]()))['where'](_0xd1d2('0x7f'),squel[_0xd1d2('0x74')]()[_0xd1d2('0x75')](_0xd1d2('0x83'))['from'](_0xd1d2('0x71'))[_0xd1d2('0x3e')]('CampaignId\x20=\x20?',_0x2b9a92[_0xd1d2('0x48')]['id'][_0xd1d2('0x79')]())))['toString']();break;case _0xd1d2('0x84'):_0x1e56e4=squel['insert']()[_0xd1d2('0x70')]('cm_hopper')['fromQuery']([_0xd1d2('0x72'),_0xd1d2('0x77'),'ContactId',_0xd1d2('0x73'),'CampaignId','createdAt','updatedAt'],squel[_0xd1d2('0x74')]()[_0xd1d2('0x75')](_0xd1d2('0x72'),'phone')[_0xd1d2('0x75')]('NOW()',_0xd1d2('0x77'))[_0xd1d2('0x75')]('id',_0xd1d2('0x78'))['field'](_0x429aa6[_0xd1d2('0x85')][_0xd1d2('0x79')](),_0xd1d2('0x73'))[_0xd1d2('0x75')](_0x2b9a92[_0xd1d2('0x48')]['id'][_0xd1d2('0x79')](),'CampaignId')[_0xd1d2('0x75')]('\x27'+_0x4b1719+'\x27',_0xd1d2('0x54'))[_0xd1d2('0x75')]('\x27'+_0x4b1719+'\x27',_0xd1d2('0x55'))['from'](_0xd1d2('0x7b'))[_0xd1d2('0x3e')](_0xd1d2('0x7c'))[_0xd1d2('0x3e')](_0xd1d2('0x7d'),_0x429aa6[_0xd1d2('0x85')][_0xd1d2('0x79')]())['where'](_0xd1d2('0x7e'))[_0xd1d2('0x3e')](_0xd1d2('0x7f'),squel[_0xd1d2('0x74')]()['field'](_0xd1d2('0x83'))['from'](_0xd1d2('0x71'))['where']('CampaignId\x20=\x20?',_0x2b9a92['params']['id'][_0xd1d2('0x79')]())))['toString']();break;default:_0x1e56e4=squel[_0xd1d2('0x86')]()[_0xd1d2('0x70')](_0xd1d2('0x71'))[_0xd1d2('0x87')]([_0xd1d2('0x72'),_0xd1d2('0x77'),'ContactId',_0xd1d2('0x73'),_0xd1d2('0x5e'),_0xd1d2('0x54'),'updatedAt'],squel[_0xd1d2('0x74')]()[_0xd1d2('0x75')](_0xd1d2('0x72'),_0xd1d2('0x72'))[_0xd1d2('0x75')](_0xd1d2('0x76'),_0xd1d2('0x77'))['field']('id',_0xd1d2('0x78'))[_0xd1d2('0x75')](_0x429aa6['CmListId'][_0xd1d2('0x79')](),_0xd1d2('0x73'))[_0xd1d2('0x75')](_0x2b9a92[_0xd1d2('0x48')]['id'][_0xd1d2('0x79')](),_0xd1d2('0x5e'))[_0xd1d2('0x75')]('\x27'+_0x4b1719+'\x27',_0xd1d2('0x54'))[_0xd1d2('0x75')]('\x27'+_0x4b1719+'\x27',_0xd1d2('0x55'))['from']('cm_contacts')[_0xd1d2('0x3e')](_0xd1d2('0x7c'))[_0xd1d2('0x3e')](_0xd1d2('0x7d'),_0x429aa6[_0xd1d2('0x85')][_0xd1d2('0x79')]())[_0xd1d2('0x3e')](_0xd1d2('0x7e')))['toString']();}_0x33acf4=squel['insert']()[_0xd1d2('0x70')]('cm_hopper_additional_phones')[_0xd1d2('0x87')]([_0xd1d2('0x88'),_0xd1d2('0x77'),_0xd1d2('0x72'),'OrderBy',_0xd1d2('0x54'),'updatedAt'],squel[_0xd1d2('0x74')]()[_0xd1d2('0x75')](_0xd1d2('0x89'),'id')[_0xd1d2('0x75')](_0xd1d2('0x76'),'scheduledAt')[_0xd1d2('0x75')](_0xd1d2('0x8a'),'phone')[_0xd1d2('0x75')](_0xd1d2('0x8b'),'OrderBy')['field']('\x27'+_0x4b1719+'\x27',_0xd1d2('0x54'))[_0xd1d2('0x75')]('\x27'+_0x4b1719+'\x27','updatedAt')[_0xd1d2('0x7a')](_0xd1d2('0x8c'),'ci')[_0xd1d2('0x8d')](_0xd1d2('0x71'),'h',_0xd1d2('0x8e'))[_0xd1d2('0x3e')](_0xd1d2('0x8f'),_0x429aa6['CmListId']['toString']())[_0xd1d2('0x3e')](_0xd1d2('0x90'),_0x2b9a92[_0xd1d2('0x48')]['id'][_0xd1d2('0x79')]())['where'](_0xd1d2('0x91'),_0x4b1719))['toString']();_0x1d8f94[_0xd1d2('0x92')](db[_0xd1d2('0x93')][_0xd1d2('0x36')](_0x1e56e4));_0x159202[_0xd1d2('0x92')](db[_0xd1d2('0x93')]['query'](_0x33acf4));}return BPromise[_0xd1d2('0x94')](_0x1d8f94);}})[_0xd1d2('0x26')](function(){return BPromise[_0xd1d2('0x94')](_0x159202);})[_0xd1d2('0x26')](function(){return _0x175b16;})[_0xd1d2('0x26')](respondWithResult(_0x3faef8,null))['catch'](handleError(_0x3faef8,null));};exports[_0xd1d2('0x95')]=function(_0x2dfaa2,_0x315cae,_0x3fd15a){return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0x2dfaa2['params']['id']}})['then'](handleEntityNotFound(_0x315cae,null))[_0xd1d2('0x26')](function(_0xe37f45){if(_0xe37f45){return _0xe37f45[_0xd1d2('0x95')](_0x2dfaa2[_0xd1d2('0x36')][_0xd1d2('0x6c')]);}})['then'](function(_0x2cf492){if(_0x2cf492){return db[_0xd1d2('0x5b')][_0xd1d2('0x27')]({'where':{'ListId':_0x2dfaa2[_0xd1d2('0x36')][_0xd1d2('0x6c')],'CampaignId':_0x2dfaa2[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](function(){return _0x2cf492;});}})[_0xd1d2('0x26')](respondWithStatusCode(_0x315cae,null))[_0xd1d2('0x50')](handleError(_0x315cae,null));};exports[_0xd1d2('0x96')]=function(_0xf0dfea,_0x592f12,_0x5bedcf){var _0x3cdee5={};var _0x127335={};var _0x4ab5ef;var _0xfd1d1a;return db[_0xd1d2('0x30')][_0xd1d2('0x60')]({'where':{'id':_0xf0dfea[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x592f12,null))[_0xd1d2('0x26')](function(_0x109976){if(_0x109976){_0x4ab5ef=_0x109976;_0x127335[_0xd1d2('0x35')]=_['keys'](db[_0xd1d2('0x68')][_0xd1d2('0x31')]);_0x127335['query']=_[_0xd1d2('0x37')](_0xf0dfea['query']);_0x127335[_0xd1d2('0x38')]=_[_0xd1d2('0x39')](_0x127335['model'],_0x127335[_0xd1d2('0x36')]);_0x3cdee5[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x127335[_0xd1d2('0x35')],qs[_0xd1d2('0x49')](_0xf0dfea[_0xd1d2('0x36')]['fields']));_0x3cdee5[_0xd1d2('0x3a')]=_0x3cdee5[_0xd1d2('0x3a')]['length']?_0x3cdee5[_0xd1d2('0x3a')]:_0x127335[_0xd1d2('0x35')];_0x3cdee5[_0xd1d2('0x62')]=qs['sort'](_0xf0dfea[_0xd1d2('0x36')][_0xd1d2('0x3d')]);_0x3cdee5[_0xd1d2('0x3e')]=qs[_0xd1d2('0x38')](_['pick'](_0xf0dfea[_0xd1d2('0x36')],_0x127335[_0xd1d2('0x38')]));if(_0xf0dfea['query'][_0xd1d2('0x41')]){_0x3cdee5[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3cdee5['where'],{'$or':_['map'](_0x3cdee5[_0xd1d2('0x3a')],function(_0x8f790c){var _0x43e91e={};_0x43e91e[_0x8f790c]={'$like':'%'+_0xf0dfea[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x43e91e;})});}_0x3cdee5=_[_0xd1d2('0x3f')]({},_0x3cdee5,_0xf0dfea[_0xd1d2('0x42')]);return _0x4ab5ef[_0xd1d2('0x96')](_0x3cdee5);}})[_0xd1d2('0x26')](function(_0x117eda){if(_0x117eda){_0xfd1d1a=_0x117eda['length'];if(!_0xf0dfea[_0xd1d2('0x36')][_0xd1d2('0x3c')](_0xd1d2('0x5c'))){_0x3cdee5['limit']=qs['limit'](_0xf0dfea[_0xd1d2('0x36')][_0xd1d2('0x21')]);_0x3cdee5[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0xf0dfea['query']['offset']);}return _0x4ab5ef[_0xd1d2('0x96')](_0x3cdee5);}})['then'](function(_0x1abf3b){if(_0x1abf3b){return _0x1abf3b?{'count':_0xfd1d1a,'rows':_0x1abf3b}:null;}})[_0xd1d2('0x26')](respondWithResult(_0x592f12,null))[_0xd1d2('0x50')](handleError(_0x592f12,null));};exports[_0xd1d2('0x97')]=function(_0x1bc3fa,_0x47e45d,_0x2d0fae){var _0x428a8c,_0x17e231;var _0x4fd85=[];var _0x428164=moment()['format'](_0xd1d2('0x6b'));return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0x1bc3fa[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x47e45d,null))[_0xd1d2('0x26')](function(_0x771cb7){if(_0x771cb7){_0x17e231=_0x771cb7;return _0x771cb7[_0xd1d2('0x97')](_0x1bc3fa[_0xd1d2('0x4b')][_0xd1d2('0x6c')],_['omit'](_0x1bc3fa[_0xd1d2('0x4b')],[_0xd1d2('0x6c'),'id'])||{});}return null;})[_0xd1d2('0x6d')](function(_0x4b0cdf){var _0x22f54d;var _0x2438bc;_0x428a8c=_0x4b0cdf||[];var _0x5e6151=[];if(_0x4b0cdf){for(var _0x524cd5=0x0;_0x524cd5<_0x4b0cdf[_0xd1d2('0x3b')];_0x524cd5+=0x1){var _0x3431c6=_0x4b0cdf[_0x524cd5][_0xd1d2('0x28')]({'plain':!![]});_0x22f54d=squel[_0xd1d2('0x86')]()['into'](_0xd1d2('0x98'))[_0xd1d2('0x87')]([_0xd1d2('0x72'),_0xd1d2('0x78'),_0xd1d2('0x73'),'CampaignId','createdAt',_0xd1d2('0x55')],squel[_0xd1d2('0x74')]()[_0xd1d2('0x75')](_0xd1d2('0x72'),_0xd1d2('0x72'))[_0xd1d2('0x75')]('id',_0xd1d2('0x78'))[_0xd1d2('0x75')](_0x3431c6[_0xd1d2('0x85')]['toString'](),_0xd1d2('0x73'))['field'](_0x1bc3fa[_0xd1d2('0x48')]['id'][_0xd1d2('0x79')](),_0xd1d2('0x5e'))[_0xd1d2('0x75')](_0xd1d2('0x76'),_0xd1d2('0x54'))[_0xd1d2('0x75')](_0xd1d2('0x76'),_0xd1d2('0x55'))[_0xd1d2('0x7a')](_0xd1d2('0x7b'))[_0xd1d2('0x3e')]('deletedAt\x20IS\x20NULL')['where'](_0xd1d2('0x7d'),_0x3431c6[_0xd1d2('0x85')][_0xd1d2('0x79')]())[_0xd1d2('0x3e')](_0xd1d2('0x7e')))[_0xd1d2('0x79')]();_0x5e6151[_0xd1d2('0x92')](db[_0xd1d2('0x93')][_0xd1d2('0x36')](_0x22f54d));}return BPromise['all'](_0x5e6151);}})[_0xd1d2('0x26')](function(){return _0x428a8c;})['then'](respondWithResult(_0x47e45d,null))['catch'](handleError(_0x47e45d,null));};exports[_0xd1d2('0x99')]=function(_0x13ca50,_0x3bae24,_0xfc864f){return db['Campaign'][_0xd1d2('0x52')]({'where':{'id':_0x13ca50[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x3bae24,null))[_0xd1d2('0x26')](function(_0x232861){if(_0x232861){return _0x232861[_0xd1d2('0x99')](_0x13ca50[_0xd1d2('0x36')]['ids']);}})['then'](function(_0x5a817a){if(_0x5a817a){return db[_0xd1d2('0x66')][_0xd1d2('0x27')]({'where':{'ListId':_0x13ca50[_0xd1d2('0x36')][_0xd1d2('0x6c')],'CampaignId':_0x13ca50[_0xd1d2('0x48')]['id']}})['then'](function(){return _0x5a817a;});}})[_0xd1d2('0x26')](respondWithStatusCode(_0x3bae24,null))['catch'](handleError(_0x3bae24,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 4324523..9f824da 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x59ef3d,_0x5c7aee){var _0x585558=function(_0x1f0f81){while(--_0x1f0f81){_0x59ef3d['push'](_0x59ef3d['shift']());}};_0x585558(++_0x5c7aee);}(_0x7a54,0x106));var _0x47a5=function(_0x14997,_0x5a5771){_0x14997=_0x14997-0x0;var _0x5d60da=_0x7a54[_0x14997];return _0x5d60da;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_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':'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 a3ef1f0..ec009dd 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 _0xc6d8=['request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','model','attributes','map','include','then','GetCampaign','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ab05b,_0x59ba0f){var _0x47b4ac=function(_0x100950){while(--_0x100950){_0x5ab05b['push'](_0x5ab05b['shift']());}};_0x47b4ac(++_0x59ba0f);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x2fba0c,_0x2cf2c0){_0x2fba0c=_0x2fba0c-0x0;var _0x263a96=_0xc6d8[_0x2fba0c];return _0x263a96;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Campaign,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['GetCampaign']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['Campaign'][_0x8c6d('0x13')]({'raw':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')][_0x8c6d('0x15')]===undefined?!![]:![]:!![],'where':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['where']||null:null,'attributes':_0x3e5495['options']?_0x3e5495[_0x8c6d('0x14')]['attributes']||null:null,'limit':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['limit']||null:null,'include':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')]['include']?_['map'](_0x3e5495['options']['include'],function(_0x2a85b5){return{'model':db[_0x2a85b5[_0x8c6d('0x16')]],'as':_0x2a85b5['as'],'attributes':_0x2a85b5[_0x8c6d('0x17')],'include':_0x2a85b5['include']?_[_0x8c6d('0x18')](_0x2a85b5['include'],function(_0x15a9c4){return{'model':db[_0x15a9c4['model']],'as':_0x15a9c4['as'],'attributes':_0x15a9c4[_0x8c6d('0x17')],'include':_0x15a9c4[_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x15a9c4[_0x8c6d('0x19')],function(_0x1e6755){return{'model':db[_0x1e6755[_0x8c6d('0x16')]],'as':_0x1e6755['as'],'attributes':_0x1e6755[_0x8c6d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6d('0x1a')](function(_0x3eab38){logger['info']('GetCampaign',_0x3e5495);logger[_0x8c6d('0xd')](_0x8c6d('0x1b'),_0x3e5495,JSON[_0x8c6d('0xf')](_0x3eab38));_0x4c2f8d(_0x3eab38);})[_0x8c6d('0x12')](function(_0x370626){logger[_0x8c6d('0x10')](_0x8c6d('0x1b'),_0x370626[_0x8c6d('0x11')],_0x3e5495);_0x21b8ee(_0x5a22de[_0x8c6d('0x10')](0x1f4,_0x370626[_0x8c6d('0x11')]));});});}; \ No newline at end of file +var _0x35aa=['info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','Campaign,\x20%s,\x20%s','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x116d9e,_0xd63007){var _0x41edb2=function(_0x5de1a6){while(--_0x5de1a6){_0x116d9e['push'](_0x116d9e['shift']());}};_0x41edb2(++_0xd63007);}(_0x35aa,0xbe));var _0xa35a=function(_0x36fecf,_0x2529fe){_0x36fecf=_0x36fecf-0x0;var _0x4b7f8e=_0x35aa[_0x36fecf];return _0x4b7f8e;};'use strict';var _=require('lodash');var util=require(_0xa35a('0x0'));var moment=require(_0xa35a('0x1'));var BPromise=require(_0xa35a('0x2'));var rs=require(_0xa35a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa35a('0x4'))['db'];var utils=require(_0xa35a('0x5'));var logger=require(_0xa35a('0x6'))(_0xa35a('0x7'));var config=require(_0xa35a('0x8'));var jayson=require(_0xa35a('0x9'));var client=jayson[_0xa35a('0xa')][_0xa35a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x563deb,_0x4053fb,_0x4e5d71){return new BPromise(function(_0x476134,_0xe2919c){return client[_0xa35a('0xc')](_0x563deb,_0x4e5d71)[_0xa35a('0xd')](function(_0x42ec44){logger[_0xa35a('0xe')]('Campaign,\x20%s,\x20%s',_0x4053fb,_0xa35a('0xf'));logger[_0xa35a('0x10')](_0xa35a('0x11'),_0x4053fb,_0xa35a('0xf'),JSON['stringify'](_0x42ec44));if(_0x42ec44[_0xa35a('0x12')]){if(_0x42ec44[_0xa35a('0x12')]['code']===0x1f4){logger[_0xa35a('0x12')](_0xa35a('0x13'),_0x4053fb,_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);return _0xe2919c(_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x4053fb,_0x42ec44[_0xa35a('0x12')]['message']);return _0x476134(_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);}else{logger['info'](_0xa35a('0x13'),_0x4053fb,_0xa35a('0xf'));_0x476134(_0x42ec44['result']['message']);}})[_0xa35a('0x15')](function(_0x41c38a){logger[_0xa35a('0x12')](_0xa35a('0x13'),_0x4053fb,_0x41c38a);_0xe2919c(_0x41c38a);});});}exports[_0xa35a('0x16')]=function(_0x223b82){var _0x474cbd=this;return new Promise(function(_0x4fd3e3,_0xdfc2){return db[_0xa35a('0x17')][_0xa35a('0x18')]({'raw':_0x223b82[_0xa35a('0x19')]?_0x223b82[_0xa35a('0x19')][_0xa35a('0x1a')]===undefined?!![]:![]:!![],'where':_0x223b82[_0xa35a('0x19')]?_0x223b82[_0xa35a('0x19')][_0xa35a('0x1b')]||null:null,'attributes':_0x223b82[_0xa35a('0x19')]?_0x223b82[_0xa35a('0x19')][_0xa35a('0x1c')]||null:null,'limit':_0x223b82['options']?_0x223b82[_0xa35a('0x19')][_0xa35a('0x1d')]||null:null,'include':_0x223b82['options']?_0x223b82['options'][_0xa35a('0x1e')]?_['map'](_0x223b82[_0xa35a('0x19')]['include'],function(_0x302592){return{'model':db[_0x302592[_0xa35a('0x1f')]],'as':_0x302592['as'],'attributes':_0x302592[_0xa35a('0x1c')],'include':_0x302592['include']?_[_0xa35a('0x20')](_0x302592[_0xa35a('0x1e')],function(_0x211993){return{'model':db[_0x211993[_0xa35a('0x1f')]],'as':_0x211993['as'],'attributes':_0x211993['attributes'],'include':_0x211993['include']?_[_0xa35a('0x20')](_0x211993[_0xa35a('0x1e')],function(_0x1d3381){return{'model':db[_0x1d3381[_0xa35a('0x1f')]],'as':_0x1d3381['as'],'attributes':_0x1d3381[_0xa35a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa35a('0xd')](function(_0x18bf46){logger['info'](_0xa35a('0x16'),_0x223b82);logger[_0xa35a('0x10')](_0xa35a('0x16'),_0x223b82,JSON[_0xa35a('0x21')](_0x18bf46));_0x4fd3e3(_0x18bf46);})['catch'](function(_0x539d67){logger[_0xa35a('0x12')](_0xa35a('0x16'),_0x539d67[_0xa35a('0x14')],_0x223b82);_0xdfc2(_0x474cbd[_0xa35a('0x12')](0x1f4,_0x539d67[_0xa35a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 82112ac..8de4681 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 _0xd2b4=['../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','get','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','multer','express','fs-extra','../../components/auth/service'];(function(_0x1ed034,_0x5d495d){var _0x4a82b7=function(_0x348231){while(--_0x348231){_0x1ed034['push'](_0x1ed034['shift']());}};_0x4a82b7(++_0x5d495d);}(_0xd2b4,0x70));var _0x4d2b=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0xd2b4[_0x57e00e];return _0x415e60;};'use strict';var multer=require(_0x4d2b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d2b('0x1'));var router=express['Router']();var fs_extra=require(_0x4d2b('0x2'));var auth=require(_0x4d2b('0x3'));var interaction=require(_0x4d2b('0x4'));var config=require(_0x4d2b('0x5'));var controller=require(_0x4d2b('0x6'));router['get']('/',auth[_0x4d2b('0x7')](),controller['index']);router[_0x4d2b('0x8')](_0x4d2b('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4d2b('0xa'),auth[_0x4d2b('0x7')](),controller['getHoppers']);router[_0x4d2b('0x8')](_0x4d2b('0xb'),auth['isAuthenticated'](),controller[_0x4d2b('0xc')]);router['get']('/:id/hopper_finals',auth[_0x4d2b('0x7')](),controller['getHopperFinals']);router[_0x4d2b('0x8')](_0x4d2b('0xd'),auth['isAuthenticated'](),controller[_0x4d2b('0xe')]);router['get'](_0x4d2b('0xf'),auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x10')]);router[_0x4d2b('0x8')]('/:id/blacklists',auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x11')]);router[_0x4d2b('0x12')]('/',auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x13')]);router['post'](_0x4d2b('0x14'),auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x15')]);router[_0x4d2b('0x12')]('/:id/lists',auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x16')]);router[_0x4d2b('0x12')]('/:id/blacklists',auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x17')]);router['put'](_0x4d2b('0x9'),auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x18')]);router[_0x4d2b('0x19')](_0x4d2b('0x9'),auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x1a')]);router[_0x4d2b('0x19')]('/:id/lists',auth[_0x4d2b('0x7')](),controller[_0x4d2b('0x1b')]);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x4d2b('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xf43c=['./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','put','update','destroy','delete','removeLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x14579e,_0x3b1339){var _0x5e2e46=function(_0x2aa6af){while(--_0x2aa6af){_0x14579e['push'](_0x14579e['shift']());}};_0x5e2e46(++_0x3b1339);}(_0xf43c,0x160));var _0xcf43=function(_0x1c1ad5,_0x37d2f6){_0x1c1ad5=_0x1c1ad5-0x0;var _0x1c3e62=_0xf43c[_0x1c1ad5];return _0x1c3e62;};'use strict';var multer=require(_0xcf43('0x0'));var util=require(_0xcf43('0x1'));var path=require(_0xcf43('0x2'));var timeout=require(_0xcf43('0x3'));var express=require('express');var router=express[_0xcf43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcf43('0x5'));var interaction=require(_0xcf43('0x6'));var config=require(_0xcf43('0x7'));var controller=require(_0xcf43('0x8'));router[_0xcf43('0x9')]('/',auth[_0xcf43('0xa')](),controller[_0xcf43('0xb')]);router[_0xcf43('0x9')](_0xcf43('0xc'),auth[_0xcf43('0xa')](),controller[_0xcf43('0xd')]);router[_0xcf43('0x9')](_0xcf43('0xe'),auth['isAuthenticated'](),controller[_0xcf43('0xf')]);router['get'](_0xcf43('0x10'),auth['isAuthenticated'](),controller[_0xcf43('0x11')]);router[_0xcf43('0x9')](_0xcf43('0x12'),auth[_0xcf43('0xa')](),controller[_0xcf43('0x13')]);router[_0xcf43('0x9')]('/:id/hopper_black',auth[_0xcf43('0xa')](),controller[_0xcf43('0x14')]);router[_0xcf43('0x9')](_0xcf43('0x15'),auth['isAuthenticated'](),controller[_0xcf43('0x16')]);router[_0xcf43('0x9')]('/:id/blacklists',auth[_0xcf43('0xa')](),controller[_0xcf43('0x17')]);router[_0xcf43('0x18')]('/',auth[_0xcf43('0xa')](),controller[_0xcf43('0x19')]);router[_0xcf43('0x18')](_0xcf43('0x1a'),auth[_0xcf43('0xa')](),controller[_0xcf43('0x1b')]);router[_0xcf43('0x18')](_0xcf43('0x15'),auth[_0xcf43('0xa')](),controller['addLists']);router[_0xcf43('0x18')](_0xcf43('0x1c'),auth['isAuthenticated'](),controller[_0xcf43('0x1d')]);router[_0xcf43('0x1e')](_0xcf43('0xc'),auth[_0xcf43('0xa')](),controller[_0xcf43('0x1f')]);router['delete'](_0xcf43('0xc'),auth['isAuthenticated'](),controller[_0xcf43('0x20')]);router[_0xcf43('0x21')](_0xcf43('0x15'),auth['isAuthenticated'](),controller[_0xcf43('0x22')]);router[_0xcf43('0x21')]('/:id/blacklists',auth[_0xcf43('0xa')](),controller['removeBlackLists']);module[_0xcf43('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ceab4fc..7dd905a 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 _0xdbe7=['getDataValue','key','exports','STRING','VIRTUAL'];(function(_0xf61a76,_0x249781){var _0x168c51=function(_0x1e2bac){while(--_0x1e2bac){_0xf61a76['push'](_0xf61a76['shift']());}};_0x168c51(++_0x249781);}(_0xdbe7,0xe3));var _0x7dbe=function(_0xeaea4a,_0x2e602a){_0xeaea4a=_0xeaea4a-0x0;var _0x47dcbb=_0xdbe7[_0xeaea4a];return _0x47dcbb;};'use strict';var Sequelize=require('sequelize');module[_0x7dbe('0x0')]={'key':{'type':Sequelize[_0x7dbe('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7dbe('0x2')],'get':function(){return this[_0x7dbe('0x3')](_0x7dbe('0x4'));}}}; \ No newline at end of file +var _0x96a7=['VIRTUAL','key','sequelize','exports','STRING','TEXT'];(function(_0x4d8543,_0x494a3e){var _0x2fda0e=function(_0x2bca2e){while(--_0x2bca2e){_0x4d8543['push'](_0x4d8543['shift']());}};_0x2fda0e(++_0x494a3e);}(_0x96a7,0x1dc));var _0x796a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x96a7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x796a('0x0'));module[_0x796a('0x1')]={'key':{'type':Sequelize[_0x796a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x796a('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x796a('0x2')]},'name':{'type':Sequelize[_0x796a('0x4')],'get':function(){return this['getDataValue'](_0x796a('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index eac6510..e5f86e8 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 _0x4746=['../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','catch','show','params','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x48e8a9,_0x46ef74){var _0x3f3293=function(_0x3ab61f){while(--_0x3ab61f){_0x48e8a9['push'](_0x48e8a9['shift']());}};_0x3f3293(++_0x46ef74);}(_0x4746,0xf3));var _0x6474=function(_0x3b3ee0,_0xa7a113){_0x3b3ee0=_0x3b3ee0-0x0;var _0x63c4e2=_0x4746[_0x3b3ee0];return _0x63c4e2;};'use strict';var emlformat=require(_0x6474('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6474('0x1'));var jsonpatch=require(_0x6474('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6474('0x3'));var Mustache=require(_0x6474('0x4'));var util=require(_0x6474('0x5'));var path=require(_0x6474('0x6'));var sox=require('sox');var csv=require(_0x6474('0x7'));var ejs=require(_0x6474('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6474('0x9'));var squel=require('squel');var crypto=require(_0x6474('0xa'));var jsforce=require(_0x6474('0xb'));var deskjs=require(_0x6474('0xc'));var toCsv=require(_0x6474('0x7'));var querystring=require(_0x6474('0xd'));var Papa=require(_0x6474('0xe'));var Redis=require('ioredis');var authService=require(_0x6474('0xf'));var qs=require(_0x6474('0x10'));var as=require(_0x6474('0x11'));var hardwareService=require(_0x6474('0x12'));var logger=require(_0x6474('0x13'))(_0x6474('0x14'));var utils=require(_0x6474('0x15'));var config=require(_0x6474('0x16'));var licenseUtil=require(_0x6474('0x17'));var db=require(_0x6474('0x18'))['db'];function respondWithStatusCode(_0x46acd3,_0x4cc258){_0x4cc258=_0x4cc258||0xcc;return function(_0xed2aae){if(_0xed2aae){return _0x46acd3['sendStatus'](_0x4cc258);}return _0x46acd3[_0x6474('0x19')](_0x4cc258)['end']();};}function respondWithResult(_0x4eb2e,_0x3c970f){_0x3c970f=_0x3c970f||0xc8;return function(_0x10fe98){if(_0x10fe98){return _0x4eb2e[_0x6474('0x19')](_0x3c970f)['json'](_0x10fe98);}};}function respondWithFilteredResult(_0x18ab7f,_0x141b80){return function(_0x41485a){if(_0x41485a){var _0x3081a4=typeof _0x141b80[_0x6474('0x1a')]===_0x6474('0x1b')&&typeof _0x141b80[_0x6474('0x1c')]==='undefined';var _0x575343=_0x41485a[_0x6474('0x1d')];var _0xfeadbc=_0x3081a4?0x0:_0x141b80['offset'];var _0x4ea812=_0x3081a4?_0x41485a['count']:_0x141b80['offset']+_0x141b80[_0x6474('0x1c')];var _0x31e3ba;if(_0x4ea812>=_0x575343){_0x4ea812=_0x575343;_0x31e3ba=0xc8;}else{_0x31e3ba=0xce;}_0x18ab7f[_0x6474('0x19')](_0x31e3ba);return _0x18ab7f['set'](_0x6474('0x1e'),_0xfeadbc+'-'+_0x4ea812+'/'+_0x575343)[_0x6474('0x1f')](_0x41485a);}return null;};}function patchUpdates(_0x4a899c){return function(_0x43e0c2){try{jsonpatch[_0x6474('0x20')](_0x43e0c2,_0x4a899c,!![]);}catch(_0x330ec7){return BPromise[_0x6474('0x21')](_0x330ec7);}return _0x43e0c2[_0x6474('0x22')]();};}function saveUpdates(_0x1ad2d1,_0x3a4223){return function(_0xd0afb0){if(_0xd0afb0){return _0xd0afb0['update'](_0x1ad2d1)[_0x6474('0x23')](function(_0x62e686){return _0x62e686;});}return null;};}function removeEntity(_0x234a38,_0x57e0ea){return function(_0x5cdc65){if(_0x5cdc65){return _0x5cdc65[_0x6474('0x24')]()[_0x6474('0x23')](function(){var _0x354db3=_0x5cdc65[_0x6474('0x25')]({'plain':!![]});var _0x4d600d=_0x6474('0x26');return db[_0x6474('0x27')][_0x6474('0x24')]({'where':{'type':_0x4d600d,'resourceId':_0x354db3['id']}})['then'](function(){return _0x5cdc65;});})[_0x6474('0x23')](function(){_0x234a38[_0x6474('0x19')](0xcc)[_0x6474('0x28')]();});}};}function handleEntityNotFound(_0x17c864,_0x7735fd){return function(_0x3b127d){if(!_0x3b127d){_0x17c864[_0x6474('0x29')](0x194);}return _0x3b127d;};}function handleError(_0x386b36,_0x5588bd){_0x5588bd=_0x5588bd||0x1f4;return function(_0x3138e3){logger[_0x6474('0x2a')](_0x3138e3[_0x6474('0x2b')]);if(_0x3138e3['name']){delete _0x3138e3[_0x6474('0x2c')];}_0x386b36[_0x6474('0x19')](_0x5588bd)['send'](_0x3138e3);};}exports[_0x6474('0x2d')]=function(_0x4a81bf,_0x3c25c5){var _0x30e54e={},_0x447abc={},_0x2d309c={'count':0x0,'rows':[]};var _0x573877=_[_0x6474('0x2e')](db['CannedAnswer'][_0x6474('0x2f')],function(_0x2048a7){return{'name':_0x2048a7['fieldName'],'type':_0x2048a7[_0x6474('0x30')][_0x6474('0x31')]};});_0x447abc[_0x6474('0x32')]=_[_0x6474('0x2e')](_0x573877,_0x6474('0x2c'));_0x447abc[_0x6474('0x33')]=_[_0x6474('0x34')](_0x4a81bf[_0x6474('0x33')]);_0x447abc['filters']=_['intersection'](_0x447abc[_0x6474('0x32')],_0x447abc['query']);_0x30e54e[_0x6474('0x35')]=_[_0x6474('0x36')](_0x447abc[_0x6474('0x32')],qs[_0x6474('0x37')](_0x4a81bf['query']['fields']));_0x30e54e[_0x6474('0x35')]=_0x30e54e[_0x6474('0x35')][_0x6474('0x38')]?_0x30e54e[_0x6474('0x35')]:_0x447abc[_0x6474('0x32')];if(!_0x4a81bf[_0x6474('0x33')]['hasOwnProperty'](_0x6474('0x39'))){_0x30e54e[_0x6474('0x1c')]=qs[_0x6474('0x1c')](_0x4a81bf['query']['limit']);_0x30e54e[_0x6474('0x1a')]=qs[_0x6474('0x1a')](_0x4a81bf[_0x6474('0x33')][_0x6474('0x1a')]);}_0x30e54e[_0x6474('0x3a')]=qs[_0x6474('0x3b')](_0x4a81bf[_0x6474('0x33')]['sort']);_0x30e54e[_0x6474('0x3c')]=qs[_0x6474('0x3d')](_[_0x6474('0x3e')](_0x4a81bf[_0x6474('0x33')],_0x447abc[_0x6474('0x3d')]),_0x573877);if(_0x4a81bf[_0x6474('0x33')][_0x6474('0x3f')]){_0x30e54e[_0x6474('0x3c')]=_[_0x6474('0x40')](_0x30e54e['where'],{'$or':[{'key':{'$like':'%'+_0x4a81bf['query']['filter']+'%'}},{'value':{'$like':'%'+_0x4a81bf[_0x6474('0x33')][_0x6474('0x3f')]+'%'}}]});}_0x30e54e=_[_0x6474('0x40')]({},_0x30e54e,_0x4a81bf[_0x6474('0x41')]);var _0x1390be={'where':_0x30e54e[_0x6474('0x3c')]};return db[_0x6474('0x42')][_0x6474('0x1d')](_0x1390be)[_0x6474('0x23')](function(_0x17375e){_0x2d309c[_0x6474('0x1d')]=_0x17375e;if(_0x4a81bf[_0x6474('0x33')][_0x6474('0x43')]){_0x30e54e[_0x6474('0x44')]=[{'all':!![]}];}return db[_0x6474('0x42')][_0x6474('0x45')](_0x30e54e);})[_0x6474('0x23')](function(_0x54c7d4){_0x2d309c['rows']=_0x54c7d4;return _0x2d309c;})[_0x6474('0x23')](respondWithFilteredResult(_0x3c25c5,_0x30e54e))[_0x6474('0x46')](handleError(_0x3c25c5,null));};exports[_0x6474('0x47')]=function(_0x162de4,_0x3b9bab){var _0x3ccc98={'raw':!![],'where':{'id':_0x162de4[_0x6474('0x48')]['id']}},_0x18cd6f={};_0x18cd6f[_0x6474('0x32')]=_[_0x6474('0x34')](db[_0x6474('0x42')][_0x6474('0x2f')]);_0x18cd6f['query']=_['keys'](_0x162de4[_0x6474('0x33')]);_0x18cd6f[_0x6474('0x3d')]=_[_0x6474('0x36')](_0x18cd6f[_0x6474('0x32')],_0x18cd6f[_0x6474('0x33')]);_0x3ccc98['attributes']=_['intersection'](_0x18cd6f[_0x6474('0x32')],qs[_0x6474('0x37')](_0x162de4[_0x6474('0x33')]['fields']));_0x3ccc98[_0x6474('0x35')]=_0x3ccc98['attributes']['length']?_0x3ccc98[_0x6474('0x35')]:_0x18cd6f[_0x6474('0x32')];if(_0x162de4[_0x6474('0x33')][_0x6474('0x43')]){_0x3ccc98[_0x6474('0x44')]=[{'all':!![]}];}_0x3ccc98=_[_0x6474('0x40')]({},_0x3ccc98,_0x162de4[_0x6474('0x41')]);return db['CannedAnswer']['find'](_0x3ccc98)[_0x6474('0x23')](handleEntityNotFound(_0x3b9bab,null))['then'](respondWithResult(_0x3b9bab,null))[_0x6474('0x46')](handleError(_0x3b9bab,null));};exports[_0x6474('0x49')]=function(_0x9218a1,_0x3ccf0c){if(_0x9218a1['body']['id']){delete _0x9218a1[_0x6474('0x4a')]['id'];}return db[_0x6474('0x42')][_0x6474('0x4b')]({'where':{'id':_0x9218a1['params']['id']}})[_0x6474('0x23')](handleEntityNotFound(_0x3ccf0c,null))[_0x6474('0x23')](saveUpdates(_0x9218a1[_0x6474('0x4a')],null))[_0x6474('0x23')](respondWithResult(_0x3ccf0c,null))[_0x6474('0x46')](handleError(_0x3ccf0c,null));};exports[_0x6474('0x24')]=function(_0x3eb04e,_0x467346){return db[_0x6474('0x42')][_0x6474('0x4b')]({'where':{'id':_0x3eb04e['params']['id']}})[_0x6474('0x23')](handleEntityNotFound(_0x467346,null))[_0x6474('0x23')](removeEntity(_0x467346,null))['catch'](handleError(_0x467346,null));};exports[_0x6474('0x4c')]=function(_0x5d2ed0,_0x3a4434){var _0x5379f5={'key':_0x5d2ed0['body']['key']};if(_0x5d2ed0[_0x6474('0x4a')][_0x6474('0x4d')]){_0x5379f5[_0x6474('0x4d')]=_0x5d2ed0[_0x6474('0x4a')]['MailAccountId'];}else if(_0x5d2ed0[_0x6474('0x4a')][_0x6474('0x4e')]){_0x5379f5[_0x6474('0x4e')]=_0x5d2ed0[_0x6474('0x4a')][_0x6474('0x4e')];}else if(_0x5d2ed0[_0x6474('0x4a')]['OpenchannelAccountId']){_0x5379f5[_0x6474('0x4f')]=_0x5d2ed0[_0x6474('0x4a')]['OpenchannelAccountId'];}else if(_0x5d2ed0[_0x6474('0x4a')][_0x6474('0x50')]){_0x5379f5[_0x6474('0x50')]=_0x5d2ed0[_0x6474('0x4a')][_0x6474('0x50')];}return db['CannedAnswer']['find']({'where':_0x5379f5})[_0x6474('0x23')](function(_0x39ffba){if(_0x39ffba){throw new db['Sequelize'][(_0x6474('0x51'))](_0x6474('0x52'));}return db[_0x6474('0x42')][_0x6474('0x4c')](_0x5d2ed0[_0x6474('0x4a')]);})[_0x6474('0x23')](function(_0x42de52){var _0x3402d7=_0x5d2ed0['user'][_0x6474('0x25')]({'plain':!![]});if(!_0x3402d7)throw new Error(_0x6474('0x53'));if(_0x3402d7[_0x6474('0x54')]===_0x6474('0x55')){var _0x3f0c08=_0x42de52[_0x6474('0x25')]({'plain':!![]});return db[_0x6474('0x56')][_0x6474('0x4b')]({'where':{'name':_0x6474('0x26'),'userProfileId':_0x3402d7[_0x6474('0x57')]},'raw':!![]})[_0x6474('0x23')](function(_0x442f30){if(_0x442f30&&_0x442f30[_0x6474('0x58')]===0x0){return db['UserProfileResource'][_0x6474('0x4c')]({'name':_0x3f0c08[_0x6474('0x2c')],'resourceId':_0x3f0c08['id'],'type':_0x442f30[_0x6474('0x2c')],'sectionId':_0x442f30['id']},{})[_0x6474('0x23')](function(){return _0x42de52;});}else{return _0x42de52;}})[_0x6474('0x46')](function(_0xb036b4){logger[_0x6474('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb036b4);throw _0xb036b4;});}return _0x42de52;})[_0x6474('0x23')](respondWithResult(_0x3a4434,0xc9))[_0x6474('0x46')](handleError(_0x3a4434,null));}; \ No newline at end of file +var _0x4cc9=['reject','save','update','then','UserProfileResource','destroy','end','error','name','send','map','CannedAnswer','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','includeAll','include','findAll','rows','catch','options','find','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply'];(function(_0xe7d07d,_0x52e4e3){var _0x229e46=function(_0x376839){while(--_0x376839){_0xe7d07d['push'](_0xe7d07d['shift']());}};_0x229e46(++_0x52e4e3);}(_0x4cc9,0x142));var _0x94cc=function(_0x19c652,_0x46b9b3){_0x19c652=_0x19c652-0x0;var _0xa636b8=_0x4cc9[_0x19c652];return _0xa636b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x94cc('0x0'));var rp=require(_0x94cc('0x1'));var moment=require(_0x94cc('0x2'));var BPromise=require(_0x94cc('0x3'));var Mustache=require(_0x94cc('0x4'));var util=require(_0x94cc('0x5'));var path=require(_0x94cc('0x6'));var sox=require(_0x94cc('0x7'));var csv=require(_0x94cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94cc('0x9'));var squel=require('squel');var crypto=require(_0x94cc('0xa'));var jsforce=require(_0x94cc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x94cc('0x8'));var querystring=require(_0x94cc('0xc'));var Papa=require(_0x94cc('0xd'));var Redis=require(_0x94cc('0xe'));var authService=require(_0x94cc('0xf'));var qs=require(_0x94cc('0x10'));var as=require(_0x94cc('0x11'));var hardwareService=require(_0x94cc('0x12'));var logger=require(_0x94cc('0x13'))('api');var utils=require(_0x94cc('0x14'));var config=require(_0x94cc('0x15'));var licenseUtil=require(_0x94cc('0x16'));var db=require(_0x94cc('0x17'))['db'];function respondWithStatusCode(_0x304d38,_0x221358){_0x221358=_0x221358||0xcc;return function(_0x2e0d2a){if(_0x2e0d2a){return _0x304d38[_0x94cc('0x18')](_0x221358);}return _0x304d38['status'](_0x221358)['end']();};}function respondWithResult(_0x1cf8cb,_0x55767f){_0x55767f=_0x55767f||0xc8;return function(_0x14f4a5){if(_0x14f4a5){return _0x1cf8cb[_0x94cc('0x19')](_0x55767f)['json'](_0x14f4a5);}};}function respondWithFilteredResult(_0x5d74ac,_0x5db134){return function(_0x351bda){if(_0x351bda){var _0x269531=typeof _0x5db134[_0x94cc('0x1a')]===_0x94cc('0x1b')&&typeof _0x5db134['limit']==='undefined';var _0x2a077e=_0x351bda[_0x94cc('0x1c')];var _0xbf2573=_0x269531?0x0:_0x5db134['offset'];var _0x36cbc7=_0x269531?_0x351bda[_0x94cc('0x1c')]:_0x5db134[_0x94cc('0x1a')]+_0x5db134[_0x94cc('0x1d')];var _0x162b99;if(_0x36cbc7>=_0x2a077e){_0x36cbc7=_0x2a077e;_0x162b99=0xc8;}else{_0x162b99=0xce;}_0x5d74ac['status'](_0x162b99);return _0x5d74ac[_0x94cc('0x1e')](_0x94cc('0x1f'),_0xbf2573+'-'+_0x36cbc7+'/'+_0x2a077e)[_0x94cc('0x20')](_0x351bda);}return null;};}function patchUpdates(_0xd35457){return function(_0x391c44){try{jsonpatch[_0x94cc('0x21')](_0x391c44,_0xd35457,!![]);}catch(_0x3d10e5){return BPromise[_0x94cc('0x22')](_0x3d10e5);}return _0x391c44[_0x94cc('0x23')]();};}function saveUpdates(_0x5800c0,_0xf350ca){return function(_0x151dc0){if(_0x151dc0){return _0x151dc0[_0x94cc('0x24')](_0x5800c0)['then'](function(_0x2771e2){return _0x2771e2;});}return null;};}function removeEntity(_0x2dcb5f,_0x57c16e){return function(_0x54826a){if(_0x54826a){return _0x54826a['destroy']()[_0x94cc('0x25')](function(){var _0x366b0a=_0x54826a['get']({'plain':!![]});var _0x24a334='CannedAnswers';return db[_0x94cc('0x26')][_0x94cc('0x27')]({'where':{'type':_0x24a334,'resourceId':_0x366b0a['id']}})[_0x94cc('0x25')](function(){return _0x54826a;});})[_0x94cc('0x25')](function(){_0x2dcb5f[_0x94cc('0x19')](0xcc)[_0x94cc('0x28')]();});}};}function handleEntityNotFound(_0x335b8f,_0x264978){return function(_0x5497a7){if(!_0x5497a7){_0x335b8f[_0x94cc('0x18')](0x194);}return _0x5497a7;};}function handleError(_0x35deaa,_0x44f523){_0x44f523=_0x44f523||0x1f4;return function(_0x5c763d){logger[_0x94cc('0x29')](_0x5c763d['stack']);if(_0x5c763d[_0x94cc('0x2a')]){delete _0x5c763d[_0x94cc('0x2a')];}_0x35deaa['status'](_0x44f523)[_0x94cc('0x2b')](_0x5c763d);};}exports['index']=function(_0x2af0d3,_0x14f346){var _0x20c332={},_0x381c5c={},_0x28bb91={'count':0x0,'rows':[]};var _0x345c62=_[_0x94cc('0x2c')](db[_0x94cc('0x2d')][_0x94cc('0x2e')],function(_0x4637fc){return{'name':_0x4637fc['fieldName'],'type':_0x4637fc[_0x94cc('0x2f')]['key']};});_0x381c5c[_0x94cc('0x30')]=_[_0x94cc('0x2c')](_0x345c62,_0x94cc('0x2a'));_0x381c5c[_0x94cc('0x31')]=_[_0x94cc('0x32')](_0x2af0d3[_0x94cc('0x31')]);_0x381c5c['filters']=_[_0x94cc('0x33')](_0x381c5c[_0x94cc('0x30')],_0x381c5c['query']);_0x20c332[_0x94cc('0x34')]=_[_0x94cc('0x33')](_0x381c5c['model'],qs[_0x94cc('0x35')](_0x2af0d3[_0x94cc('0x31')][_0x94cc('0x35')]));_0x20c332[_0x94cc('0x34')]=_0x20c332[_0x94cc('0x34')][_0x94cc('0x36')]?_0x20c332['attributes']:_0x381c5c[_0x94cc('0x30')];if(!_0x2af0d3[_0x94cc('0x31')][_0x94cc('0x37')](_0x94cc('0x38'))){_0x20c332[_0x94cc('0x1d')]=qs[_0x94cc('0x1d')](_0x2af0d3['query']['limit']);_0x20c332[_0x94cc('0x1a')]=qs[_0x94cc('0x1a')](_0x2af0d3[_0x94cc('0x31')][_0x94cc('0x1a')]);}_0x20c332[_0x94cc('0x39')]=qs['sort'](_0x2af0d3[_0x94cc('0x31')]['sort']);_0x20c332['where']=qs[_0x94cc('0x3a')](_[_0x94cc('0x3b')](_0x2af0d3[_0x94cc('0x31')],_0x381c5c[_0x94cc('0x3a')]),_0x345c62);if(_0x2af0d3[_0x94cc('0x31')][_0x94cc('0x3c')]){_0x20c332[_0x94cc('0x3d')]=_['merge'](_0x20c332[_0x94cc('0x3d')],{'$or':[{'key':{'$like':'%'+_0x2af0d3[_0x94cc('0x31')][_0x94cc('0x3c')]+'%'}},{'value':{'$like':'%'+_0x2af0d3[_0x94cc('0x31')][_0x94cc('0x3c')]+'%'}}]});}_0x20c332=_[_0x94cc('0x3e')]({},_0x20c332,_0x2af0d3['options']);var _0x43e2d7={'where':_0x20c332[_0x94cc('0x3d')]};return db['CannedAnswer'][_0x94cc('0x1c')](_0x43e2d7)[_0x94cc('0x25')](function(_0xd70d29){_0x28bb91[_0x94cc('0x1c')]=_0xd70d29;if(_0x2af0d3['query'][_0x94cc('0x3f')]){_0x20c332[_0x94cc('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0x94cc('0x41')](_0x20c332);})[_0x94cc('0x25')](function(_0x466e85){_0x28bb91[_0x94cc('0x42')]=_0x466e85;return _0x28bb91;})[_0x94cc('0x25')](respondWithFilteredResult(_0x14f346,_0x20c332))[_0x94cc('0x43')](handleError(_0x14f346,null));};exports['show']=function(_0x50432b,_0x2f91cc){var _0x3be1e4={'raw':!![],'where':{'id':_0x50432b['params']['id']}},_0x88564d={};_0x88564d[_0x94cc('0x30')]=_[_0x94cc('0x32')](db[_0x94cc('0x2d')][_0x94cc('0x2e')]);_0x88564d[_0x94cc('0x31')]=_[_0x94cc('0x32')](_0x50432b['query']);_0x88564d[_0x94cc('0x3a')]=_[_0x94cc('0x33')](_0x88564d['model'],_0x88564d['query']);_0x3be1e4[_0x94cc('0x34')]=_[_0x94cc('0x33')](_0x88564d[_0x94cc('0x30')],qs[_0x94cc('0x35')](_0x50432b[_0x94cc('0x31')][_0x94cc('0x35')]));_0x3be1e4['attributes']=_0x3be1e4[_0x94cc('0x34')][_0x94cc('0x36')]?_0x3be1e4[_0x94cc('0x34')]:_0x88564d[_0x94cc('0x30')];if(_0x50432b['query'][_0x94cc('0x3f')]){_0x3be1e4[_0x94cc('0x40')]=[{'all':!![]}];}_0x3be1e4=_[_0x94cc('0x3e')]({},_0x3be1e4,_0x50432b[_0x94cc('0x44')]);return db[_0x94cc('0x2d')][_0x94cc('0x45')](_0x3be1e4)[_0x94cc('0x25')](handleEntityNotFound(_0x2f91cc,null))[_0x94cc('0x25')](respondWithResult(_0x2f91cc,null))[_0x94cc('0x43')](handleError(_0x2f91cc,null));};exports[_0x94cc('0x24')]=function(_0x39008a,_0x325e85){if(_0x39008a['body']['id']){delete _0x39008a[_0x94cc('0x46')]['id'];}return db[_0x94cc('0x2d')]['find']({'where':{'id':_0x39008a[_0x94cc('0x47')]['id']}})[_0x94cc('0x25')](handleEntityNotFound(_0x325e85,null))['then'](saveUpdates(_0x39008a['body'],null))[_0x94cc('0x25')](respondWithResult(_0x325e85,null))[_0x94cc('0x43')](handleError(_0x325e85,null));};exports['destroy']=function(_0x418b05,_0x191671){return db[_0x94cc('0x2d')][_0x94cc('0x45')]({'where':{'id':_0x418b05[_0x94cc('0x47')]['id']}})[_0x94cc('0x25')](handleEntityNotFound(_0x191671,null))[_0x94cc('0x25')](removeEntity(_0x191671,null))[_0x94cc('0x43')](handleError(_0x191671,null));};exports[_0x94cc('0x48')]=function(_0x46ff23,_0x5a76cc){var _0x494592={'key':_0x46ff23[_0x94cc('0x46')][_0x94cc('0x49')]};if(_0x46ff23['body'][_0x94cc('0x4a')]){_0x494592[_0x94cc('0x4a')]=_0x46ff23['body'][_0x94cc('0x4a')];}else if(_0x46ff23[_0x94cc('0x46')][_0x94cc('0x4b')]){_0x494592[_0x94cc('0x4b')]=_0x46ff23[_0x94cc('0x46')][_0x94cc('0x4b')];}else if(_0x46ff23['body'][_0x94cc('0x4c')]){_0x494592[_0x94cc('0x4c')]=_0x46ff23['body'][_0x94cc('0x4c')];}else if(_0x46ff23['body'][_0x94cc('0x4d')]){_0x494592['ChatWebsiteId']=_0x46ff23[_0x94cc('0x46')][_0x94cc('0x4d')];}return db[_0x94cc('0x2d')][_0x94cc('0x45')]({'where':_0x494592})['then'](function(_0xe7629){if(_0xe7629){throw new db[(_0x94cc('0x4e'))][(_0x94cc('0x4f'))](_0x94cc('0x50'));}return db[_0x94cc('0x2d')][_0x94cc('0x48')](_0x46ff23['body']);})['then'](function(_0x460734){var _0x2dee2b=_0x46ff23[_0x94cc('0x51')][_0x94cc('0x52')]({'plain':!![]});if(!_0x2dee2b)throw new Error(_0x94cc('0x53'));if(_0x2dee2b[_0x94cc('0x54')]==='user'){var _0x417339=_0x460734['get']({'plain':!![]});return db[_0x94cc('0x55')]['find']({'where':{'name':_0x94cc('0x56'),'userProfileId':_0x2dee2b['userProfileId']},'raw':!![]})['then'](function(_0x241794){if(_0x241794&&_0x241794[_0x94cc('0x57')]===0x0){return db[_0x94cc('0x26')][_0x94cc('0x48')]({'name':_0x417339[_0x94cc('0x2a')],'resourceId':_0x417339['id'],'type':_0x241794['name'],'sectionId':_0x241794['id']},{})[_0x94cc('0x25')](function(){return _0x460734;});}else{return _0x460734;}})['catch'](function(_0x5ee75a){logger[_0x94cc('0x29')](_0x94cc('0x58'),_0x5ee75a);throw _0x5ee75a;});}return _0x460734;})[_0x94cc('0x25')](respondWithResult(_0x5a76cc,0xc9))[_0x94cc('0x43')](handleError(_0x5a76cc,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ce7e682..91885ac 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 _0x205d=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x4315bc,_0x3d8a09){var _0x464fc9=function(_0x4dcc80){while(--_0x4dcc80){_0x4315bc['push'](_0x4315bc['shift']());}};_0x464fc9(++_0x3d8a09);}(_0x205d,0xf6));var _0xd205=function(_0x2da357,_0x1f9b2f){_0x2da357=_0x2da357-0x0;var _0x138fdd=_0x205d[_0x2da357];return _0x138fdd;};'use strict';var _=require(_0xd205('0x0'));var util=require(_0xd205('0x1'));var logger=require(_0xd205('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd205('0x3'));var rp=require(_0xd205('0x4'));var fs=require('fs');var path=require(_0xd205('0x5'));var rimraf=require('rimraf');var config=require(_0xd205('0x6'));var attributes=require(_0xd205('0x7'));module[_0xd205('0x8')]=function(_0x45a533,_0x4c078b){return _0x45a533[_0xd205('0x9')](_0xd205('0xa'),attributes,{'tableName':_0xd205('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd205('0xc'),'collate':_0xd205('0xd')});}; \ No newline at end of file +var _0x2147=['path','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x88abf6,_0x4bf1fe){var _0x52e4e8=function(_0x2f31c6){while(--_0x2f31c6){_0x88abf6['push'](_0x88abf6['shift']());}};_0x52e4e8(++_0x4bf1fe);}(_0x2147,0x7d));var _0x7214=function(_0x19063e,_0x299ab6){_0x19063e=_0x19063e-0x0;var _0x5c0b38=_0x2147[_0x19063e];return _0x5c0b38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7214('0x0'))(_0x7214('0x1'));var moment=require(_0x7214('0x2'));var BPromise=require(_0x7214('0x3'));var rp=require(_0x7214('0x4'));var fs=require('fs');var path=require(_0x7214('0x5'));var rimraf=require('rimraf');var config=require(_0x7214('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x7214('0x7')]=function(_0x5bb448,_0x19c389){return _0x5bb448[_0x7214('0x8')](_0x7214('0x9'),attributes,{'tableName':_0x7214('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7214('0xb'),'collate':_0x7214('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index d489661..b380e32 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(_0x3ff841,_0x3f9b28){var _0x2d8cf8=function(_0x141fed){while(--_0x141fed){_0x3ff841['push'](_0x3ff841['shift']());}};_0x2d8cf8(++_0x3f9b28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x110917,_0x1f9302){var _0x5d71f7=function(_0x1ff618){while(--_0x1ff618){_0x110917['push'](_0x110917['shift']());}};_0x5d71f7(++_0x1f9302);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 735a7c4..b03c9bf 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 _0xa361=['get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','../../config/environment','./cannedAnswer.controller','isAuthenticated'];(function(_0x52f860,_0xc13c2){var _0x47997b=function(_0x54b07d){while(--_0x54b07d){_0x52f860['push'](_0x52f860['shift']());}};_0x47997b(++_0xc13c2);}(_0xa361,0xb0));var _0x1a36=function(_0xd056a9,_0x46784b){_0xd056a9=_0xd056a9-0x0;var _0x4fd925=_0xa361[_0xd056a9];return _0x4fd925;};'use strict';var multer=require('multer');var util=require(_0x1a36('0x0'));var path=require('path');var timeout=require(_0x1a36('0x1'));var express=require(_0x1a36('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(_0x1a36('0x3'));var controller=require(_0x1a36('0x4'));router['get']('/',auth[_0x1a36('0x5')](),controller['index']);router[_0x1a36('0x6')](_0x1a36('0x7'),auth['isAuthenticated'](),controller[_0x1a36('0x8')]);router['post']('/',auth[_0x1a36('0x5')](),controller[_0x1a36('0x9')]);router[_0x1a36('0xa')](_0x1a36('0x7'),auth[_0x1a36('0x5')](),controller['update']);router[_0x1a36('0xb')](_0x1a36('0x7'),auth[_0x1a36('0x5')](),controller[_0x1a36('0xc')]);module['exports']=router; \ No newline at end of file +var _0xa752=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','create','put','update','delete','/:id','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x47b12e,_0x5e3404){var _0x2ba332=function(_0x58f354){while(--_0x58f354){_0x47b12e['push'](_0x47b12e['shift']());}};_0x2ba332(++_0x5e3404);}(_0xa752,0xc6));var _0x2a75=function(_0x122ae6,_0x2f8ddb){_0x122ae6=_0x122ae6-0x0;var _0x2b5efd=_0xa752[_0x122ae6];return _0x2b5efd;};'use strict';var multer=require(_0x2a75('0x0'));var util=require(_0x2a75('0x1'));var path=require('path');var timeout=require(_0x2a75('0x2'));var express=require(_0x2a75('0x3'));var router=express[_0x2a75('0x4')]();var fs_extra=require(_0x2a75('0x5'));var auth=require(_0x2a75('0x6'));var interaction=require(_0x2a75('0x7'));var config=require(_0x2a75('0x8'));var controller=require('./cannedAnswer.controller');router[_0x2a75('0x9')]('/',auth['isAuthenticated'](),controller[_0x2a75('0xa')]);router[_0x2a75('0x9')]('/:id',auth[_0x2a75('0xb')](),controller['show']);router['post']('/',auth[_0x2a75('0xb')](),controller[_0x2a75('0xc')]);router[_0x2a75('0xd')]('/:id',auth[_0x2a75('0xb')](),controller[_0x2a75('0xe')]);router[_0x2a75('0xf')](_0x2a75('0x10'),auth[_0x2a75('0xb')](),controller['destroy']);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 d3c8f68..beaed47 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 _0xea03=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x38e12a,_0xcc0801){var _0xf3b2ee=function(_0x304040){while(--_0x304040){_0x38e12a['push'](_0x38e12a['shift']());}};_0xf3b2ee(++_0xcc0801);}(_0xea03,0x15e));var _0x3ea0=function(_0x3185ad,_0x5e5ca2){_0x3185ad=_0x3185ad-0x0;var _0x4f77fb=_0xea03[_0x3185ad];return _0x4f77fb;};'use strict';var Sequelize=require(_0x3ea0('0x0'));module[_0x3ea0('0x1')]={'calldate':{'type':Sequelize[_0x3ea0('0x2')],'allowNull':![],'defaultValue':_0x3ea0('0x3')},'clid':{'type':Sequelize[_0x3ea0('0x4')]},'src':{'type':Sequelize[_0x3ea0('0x4')]},'dst':{'type':Sequelize[_0x3ea0('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3ea0('0x4')]},'dstchannel':{'type':Sequelize[_0x3ea0('0x4')]},'lastapp':{'type':Sequelize[_0x3ea0('0x4')]},'lastdata':{'type':Sequelize[_0x3ea0('0x4')]},'duration':{'type':Sequelize[_0x3ea0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3ea0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3ea0('0x4')]},'amaflags':{'type':Sequelize[_0x3ea0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x3ea0('0x4')]},'uniqueid':{'type':Sequelize[_0x3ea0('0x4')]},'linkedid':{'type':Sequelize[_0x3ea0('0x4')]},'sequence':{'type':Sequelize[_0x3ea0('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3ea0('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3ce4=['DATE','STRING','INTEGER','sequelize'];(function(_0xb1bbb1,_0x4d1f54){var _0x28b525=function(_0x45dbb5){while(--_0x45dbb5){_0xb1bbb1['push'](_0xb1bbb1['shift']());}};_0x28b525(++_0x4d1f54);}(_0x3ce4,0xcb));var _0x43ce=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x3ce4[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0x43ce('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x43ce('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x43ce('0x2')]},'src':{'type':Sequelize[_0x43ce('0x2')]},'dst':{'type':Sequelize[_0x43ce('0x2')]},'dcontext':{'type':Sequelize[_0x43ce('0x2')]},'channel':{'type':Sequelize[_0x43ce('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x43ce('0x2')]},'lastdata':{'type':Sequelize[_0x43ce('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x43ce('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x43ce('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x43ce('0x2')]},'userfield':{'type':Sequelize[_0x43ce('0x2')]},'uniqueid':{'type':Sequelize[_0x43ce('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x43ce('0x2')]},'peeraccount':{'type':Sequelize[_0x43ce('0x2')]},'type':{'type':Sequelize[_0x43ce('0x2')]},'tag':{'type':Sequelize[_0x43ce('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index a363314..2c5176a 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 _0x0bde=['findAll','rows','create','body','catch','update','find','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0bd('0x1'));var rp=require(_0xe0bd('0x2'));var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var Redis=require(_0xe0bd('0x11'));var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0bd('0x15'));var db=require(_0xe0bd('0x16'))['db'];function respondWithStatusCode(_0x54d40e,_0xc492b4){_0xc492b4=_0xc492b4||0xcc;return function(_0x5272ca){if(_0x5272ca){return _0x54d40e[_0xe0bd('0x17')](_0xc492b4);}return _0x54d40e[_0xe0bd('0x18')](_0xc492b4)[_0xe0bd('0x19')]();};}function respondWithResult(_0x20ab47,_0x47664e){_0x47664e=_0x47664e||0xc8;return function(_0x335f17){if(_0x335f17){return _0x20ab47[_0xe0bd('0x18')](_0x47664e)[_0xe0bd('0x1a')](_0x335f17);}};}function respondWithFilteredResult(_0x4f63fa,_0x50891d){return function(_0x4fb006){if(_0x4fb006){var _0x2ff887=typeof _0x50891d[_0xe0bd('0x1b')]===_0xe0bd('0x1c')&&typeof _0x50891d[_0xe0bd('0x1d')]===_0xe0bd('0x1c');var _0x55f304=_0x4fb006['count'];var _0x1becc8=_0x2ff887?0x0:_0x50891d['offset'];var _0x4f36f7=_0x2ff887?_0x4fb006[_0xe0bd('0x1e')]:_0x50891d[_0xe0bd('0x1b')]+_0x50891d[_0xe0bd('0x1d')];var _0x5f22e2;if(_0x4f36f7>=_0x55f304){_0x4f36f7=_0x55f304;_0x5f22e2=0xc8;}else{_0x5f22e2=0xce;}_0x4f63fa[_0xe0bd('0x18')](_0x5f22e2);return _0x4f63fa[_0xe0bd('0x1f')](_0xe0bd('0x20'),_0x1becc8+'-'+_0x4f36f7+'/'+_0x55f304)['json'](_0x4fb006);}return null;};}function patchUpdates(_0x1bf742){return function(_0x25f595){try{jsonpatch[_0xe0bd('0x21')](_0x25f595,_0x1bf742,!![]);}catch(_0x532584){return BPromise[_0xe0bd('0x22')](_0x532584);}return _0x25f595[_0xe0bd('0x23')]();};}function saveUpdates(_0x2b4f7d,_0x5378d2){return function(_0x1d6a19){if(_0x1d6a19){return _0x1d6a19['update'](_0x2b4f7d)[_0xe0bd('0x24')](function(_0x2bcfcc){return _0x2bcfcc;});}return null;};}function removeEntity(_0x4bcd48,_0xa4a4e9){return function(_0xf6d956){if(_0xf6d956){return _0xf6d956[_0xe0bd('0x25')]()[_0xe0bd('0x24')](function(){_0x4bcd48[_0xe0bd('0x18')](0xcc)[_0xe0bd('0x19')]();});}};}function handleEntityNotFound(_0x2096a2,_0x162356){return function(_0x537708){if(!_0x537708){_0x2096a2['sendStatus'](0x194);}return _0x537708;};}function handleError(_0x275f14,_0x39c98e){_0x39c98e=_0x39c98e||0x1f4;return function(_0x47d171){logger['error'](_0x47d171[_0xe0bd('0x26')]);if(_0x47d171[_0xe0bd('0x27')]){delete _0x47d171[_0xe0bd('0x27')];}_0x275f14[_0xe0bd('0x18')](_0x39c98e)['send'](_0x47d171);};}exports[_0xe0bd('0x28')]=function(_0x4ef39b,_0x9146fe){var _0x170874={},_0x42bea7={},_0x1b857c={'count':0x0,'rows':[]};var _0x1e2020=_[_0xe0bd('0x29')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')],function(_0x25d515){return{'name':_0x25d515[_0xe0bd('0x2c')],'type':_0x25d515[_0xe0bd('0x2d')][_0xe0bd('0x2e')]};});_0x42bea7[_0xe0bd('0x2f')]=_['map'](_0x1e2020,_0xe0bd('0x27'));_0x42bea7[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x4ef39b[_0xe0bd('0x30')]);_0x42bea7[_0xe0bd('0x32')]=_[_0xe0bd('0x33')](_0x42bea7['model'],_0x42bea7['query']);_0x170874[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x42bea7[_0xe0bd('0x2f')],qs[_0xe0bd('0x35')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x170874[_0xe0bd('0x34')]=_0x170874['attributes'][_0xe0bd('0x36')]?_0x170874[_0xe0bd('0x34')]:_0x42bea7[_0xe0bd('0x2f')];if(!_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x37')](_0xe0bd('0x38'))){_0x170874['limit']=qs[_0xe0bd('0x1d')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x1d')]);_0x170874[_0xe0bd('0x1b')]=qs[_0xe0bd('0x1b')](_0x4ef39b['query']['offset']);}_0x170874[_0xe0bd('0x39')]=qs[_0xe0bd('0x3a')](_0x4ef39b[_0xe0bd('0x30')]['sort']);_0x170874[_0xe0bd('0x3b')]=qs['filters'](_['pick'](_0x4ef39b[_0xe0bd('0x30')],_0x42bea7[_0xe0bd('0x32')]),_0x1e2020);if(_0x4ef39b['query']['filter']){_0x170874['where']=_[_0xe0bd('0x3c')](_0x170874[_0xe0bd('0x3b')],{'$or':_[_0xe0bd('0x29')](_0x1e2020,function(_0x5d2aff){if(_0x5d2aff[_0xe0bd('0x2d')]!==_0xe0bd('0x3d')){var _0x1e6823={};_0x1e6823[_0x5d2aff['name']]={'$like':'%'+_0x4ef39b['query'][_0xe0bd('0x3e')]+'%'};return _0x1e6823;}})});}_0x170874=_['merge']({},_0x170874,_0x4ef39b[_0xe0bd('0x3f')]);var _0x195f0f={'where':_0x170874['where']};return db[_0xe0bd('0x2a')][_0xe0bd('0x1e')](_0x195f0f)[_0xe0bd('0x24')](function(_0xb65059){_0x1b857c[_0xe0bd('0x1e')]=_0xb65059;if(_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x170874['include']=[{'all':!![]}];}return db[_0xe0bd('0x2a')][_0xe0bd('0x41')](_0x170874);})[_0xe0bd('0x24')](function(_0x3c138e){_0x1b857c[_0xe0bd('0x42')]=_0x3c138e;return _0x1b857c;})['then'](respondWithFilteredResult(_0x9146fe,_0x170874))['catch'](handleError(_0x9146fe,null));};exports['show']=function(_0x2b27b1,_0x1a121f){var _0x15de49={'raw':!![],'where':{'id':_0x2b27b1['params']['id']}},_0x32ed4f={};_0x32ed4f['model']=_[_0xe0bd('0x31')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')]);_0x32ed4f[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x2b27b1[_0xe0bd('0x30')]);_0x32ed4f[_0xe0bd('0x32')]=_['intersection'](_0x32ed4f[_0xe0bd('0x2f')],_0x32ed4f['query']);_0x15de49[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x32ed4f['model'],qs['fields'](_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x15de49[_0xe0bd('0x34')]=_0x15de49[_0xe0bd('0x34')][_0xe0bd('0x36')]?_0x15de49[_0xe0bd('0x34')]:_0x32ed4f[_0xe0bd('0x2f')];if(_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x15de49['include']=[{'all':!![]}];}_0x15de49=_[_0xe0bd('0x3c')]({},_0x15de49,_0x2b27b1[_0xe0bd('0x3f')]);return db[_0xe0bd('0x2a')]['find'](_0x15de49)[_0xe0bd('0x24')](handleEntityNotFound(_0x1a121f,null))[_0xe0bd('0x24')](respondWithResult(_0x1a121f,null))['catch'](handleError(_0x1a121f,null));};exports[_0xe0bd('0x43')]=function(_0x136ac6,_0x578792){return db[_0xe0bd('0x2a')][_0xe0bd('0x43')](_0x136ac6[_0xe0bd('0x44')],{})['then'](respondWithResult(_0x578792,0xc9))[_0xe0bd('0x45')](handleError(_0x578792,null));};exports[_0xe0bd('0x46')]=function(_0x147438,_0x21ae20){if(_0x147438[_0xe0bd('0x44')]['id']){delete _0x147438[_0xe0bd('0x44')]['id'];}return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0x147438[_0xe0bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](saveUpdates(_0x147438['body'],null))[_0xe0bd('0x24')](respondWithResult(_0x21ae20,null))[_0xe0bd('0x45')](handleError(_0x21ae20,null));};exports['destroy']=function(_0xacd120,_0x284ea3){return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0xacd120[_0xe0bd('0x48')]['id']}})[_0xe0bd('0x24')](handleEntityNotFound(_0x284ea3,null))[_0xe0bd('0x24')](removeEntity(_0x284ea3,null))[_0xe0bd('0x45')](handleError(_0x284ea3,null));};exports[_0xe0bd('0x49')]=function(_0x2631f5,_0x503939){return db[_0xe0bd('0x2a')][_0xe0bd('0x49')]()[_0xe0bd('0x24')](respondWithResult(_0x503939,null))['catch'](handleError(_0x503939,null));}; \ No newline at end of file +var _0x8375=['attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','error','stack','name','send','map','Cdr','fieldName','type','model','query','keys'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x8375,0xa8));var _0x5837=function(_0x2c35f7,_0x541194){_0x2c35f7=_0x2c35f7-0x0;var _0x1360d4=_0x8375[_0x2c35f7];return _0x1360d4;};'use strict';var emlformat=require(_0x5837('0x0'));var rimraf=require(_0x5837('0x1'));var zipdir=require(_0x5837('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var util=require(_0x5837('0x7'));var path=require(_0x5837('0x8'));var sox=require('sox');var csv=require(_0x5837('0x9'));var ejs=require(_0x5837('0xa'));var fs=require('fs');var fs_extra=require(_0x5837('0xb'));var _=require(_0x5837('0xc'));var squel=require(_0x5837('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x9'));var querystring=require('querystring');var Papa=require(_0x5837('0xf'));var Redis=require('ioredis');var authService=require(_0x5837('0x10'));var qs=require(_0x5837('0x11'));var as=require(_0x5837('0x12'));var hardwareService=require(_0x5837('0x13'));var logger=require(_0x5837('0x14'))(_0x5837('0x15'));var utils=require('../../config/utils');var config=require(_0x5837('0x16'));var licenseUtil=require(_0x5837('0x17'));var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x10c1a1,_0x143210){_0x143210=_0x143210||0xcc;return function(_0x485366){if(_0x485366){return _0x10c1a1['sendStatus'](_0x143210);}return _0x10c1a1['status'](_0x143210)[_0x5837('0x19')]();};}function respondWithResult(_0x111dbf,_0x469903){_0x469903=_0x469903||0xc8;return function(_0xa5718d){if(_0xa5718d){return _0x111dbf[_0x5837('0x1a')](_0x469903)[_0x5837('0x1b')](_0xa5718d);}};}function respondWithFilteredResult(_0x206f02,_0x754f39){return function(_0x10d882){if(_0x10d882){var _0x59a378=typeof _0x754f39[_0x5837('0x1c')]===_0x5837('0x1d')&&typeof _0x754f39['limit']===_0x5837('0x1d');var _0x2297b4=_0x10d882[_0x5837('0x1e')];var _0x49279d=_0x59a378?0x0:_0x754f39['offset'];var _0x4bee08=_0x59a378?_0x10d882[_0x5837('0x1e')]:_0x754f39[_0x5837('0x1c')]+_0x754f39[_0x5837('0x1f')];var _0x58e7f7;if(_0x4bee08>=_0x2297b4){_0x4bee08=_0x2297b4;_0x58e7f7=0xc8;}else{_0x58e7f7=0xce;}_0x206f02[_0x5837('0x1a')](_0x58e7f7);return _0x206f02[_0x5837('0x20')](_0x5837('0x21'),_0x49279d+'-'+_0x4bee08+'/'+_0x2297b4)[_0x5837('0x1b')](_0x10d882);}return null;};}function patchUpdates(_0x5881ff){return function(_0x4908c2){try{jsonpatch['apply'](_0x4908c2,_0x5881ff,!![]);}catch(_0x3d352f){return BPromise['reject'](_0x3d352f);}return _0x4908c2[_0x5837('0x22')]();};}function saveUpdates(_0x2bd103,_0x32733a){return function(_0x3a7efe){if(_0x3a7efe){return _0x3a7efe['update'](_0x2bd103)['then'](function(_0x1b80db){return _0x1b80db;});}return null;};}function removeEntity(_0x2262b9,_0x406506){return function(_0x5e8089){if(_0x5e8089){return _0x5e8089[_0x5837('0x23')]()[_0x5837('0x24')](function(){_0x2262b9[_0x5837('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f86a,_0x2646ed){return function(_0x39babd){if(!_0x39babd){_0x41f86a['sendStatus'](0x194);}return _0x39babd;};}function handleError(_0x57baed,_0x1d545c){_0x1d545c=_0x1d545c||0x1f4;return function(_0x15655e){logger[_0x5837('0x25')](_0x15655e[_0x5837('0x26')]);if(_0x15655e[_0x5837('0x27')]){delete _0x15655e[_0x5837('0x27')];}_0x57baed[_0x5837('0x1a')](_0x1d545c)[_0x5837('0x28')](_0x15655e);};}exports['index']=function(_0x2f0c8d,_0x13830f){var _0x3cbd3f={},_0x3918ee={},_0x1c9f32={'count':0x0,'rows':[]};var _0x228f1=_[_0x5837('0x29')](db[_0x5837('0x2a')]['rawAttributes'],function(_0x4f7502){return{'name':_0x4f7502[_0x5837('0x2b')],'type':_0x4f7502[_0x5837('0x2c')]['key']};});_0x3918ee[_0x5837('0x2d')]=_[_0x5837('0x29')](_0x228f1,'name');_0x3918ee[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x2f0c8d[_0x5837('0x2e')]);_0x3918ee['filters']=_['intersection'](_0x3918ee['model'],_0x3918ee[_0x5837('0x2e')]);_0x3cbd3f[_0x5837('0x30')]=_[_0x5837('0x31')](_0x3918ee[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x2f0c8d['query']['fields']));_0x3cbd3f[_0x5837('0x30')]=_0x3cbd3f[_0x5837('0x30')]['length']?_0x3cbd3f['attributes']:_0x3918ee[_0x5837('0x2d')];if(!_0x2f0c8d['query']['hasOwnProperty'](_0x5837('0x33'))){_0x3cbd3f[_0x5837('0x1f')]=qs['limit'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1f')]);_0x3cbd3f[_0x5837('0x1c')]=qs['offset'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1c')]);}_0x3cbd3f[_0x5837('0x34')]=qs[_0x5837('0x35')](_0x2f0c8d[_0x5837('0x2e')]['sort']);_0x3cbd3f[_0x5837('0x36')]=qs['filters'](_['pick'](_0x2f0c8d[_0x5837('0x2e')],_0x3918ee[_0x5837('0x37')]),_0x228f1);if(_0x2f0c8d['query'][_0x5837('0x38')]){_0x3cbd3f[_0x5837('0x36')]=_[_0x5837('0x39')](_0x3cbd3f[_0x5837('0x36')],{'$or':_['map'](_0x228f1,function(_0x2ed688){if(_0x2ed688[_0x5837('0x2c')]!==_0x5837('0x3a')){var _0x5dcd18={};_0x5dcd18[_0x2ed688[_0x5837('0x27')]]={'$like':'%'+_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x38')]+'%'};return _0x5dcd18;}})});}_0x3cbd3f=_[_0x5837('0x39')]({},_0x3cbd3f,_0x2f0c8d[_0x5837('0x3b')]);var _0x76f00d={'where':_0x3cbd3f[_0x5837('0x36')]};return db[_0x5837('0x2a')][_0x5837('0x1e')](_0x76f00d)[_0x5837('0x24')](function(_0x1a5e2d){_0x1c9f32[_0x5837('0x1e')]=_0x1a5e2d;if(_0x2f0c8d['query']['includeAll']){_0x3cbd3f[_0x5837('0x3c')]=[{'all':!![]}];}return db[_0x5837('0x2a')]['findAll'](_0x3cbd3f);})[_0x5837('0x24')](function(_0x1ae168){_0x1c9f32[_0x5837('0x3d')]=_0x1ae168;return _0x1c9f32;})['then'](respondWithFilteredResult(_0x13830f,_0x3cbd3f))[_0x5837('0x3e')](handleError(_0x13830f,null));};exports[_0x5837('0x3f')]=function(_0x1c81ed,_0x3acdf5){var _0x4643e3={'raw':!![],'where':{'id':_0x1c81ed[_0x5837('0x40')]['id']}},_0xd443be={};_0xd443be[_0x5837('0x2d')]=_[_0x5837('0x2f')](db['Cdr'][_0x5837('0x41')]);_0xd443be[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x1c81ed['query']);_0xd443be['filters']=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],_0xd443be[_0x5837('0x2e')]);_0x4643e3[_0x5837('0x30')]=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x1c81ed[_0x5837('0x2e')][_0x5837('0x32')]));_0x4643e3[_0x5837('0x30')]=_0x4643e3[_0x5837('0x30')][_0x5837('0x42')]?_0x4643e3['attributes']:_0xd443be[_0x5837('0x2d')];if(_0x1c81ed['query'][_0x5837('0x43')]){_0x4643e3[_0x5837('0x3c')]=[{'all':!![]}];}_0x4643e3=_['merge']({},_0x4643e3,_0x1c81ed[_0x5837('0x3b')]);return db[_0x5837('0x2a')]['find'](_0x4643e3)[_0x5837('0x24')](handleEntityNotFound(_0x3acdf5,null))[_0x5837('0x24')](respondWithResult(_0x3acdf5,null))[_0x5837('0x3e')](handleError(_0x3acdf5,null));};exports[_0x5837('0x44')]=function(_0x54a23b,_0x55cf2b){return db[_0x5837('0x2a')][_0x5837('0x44')](_0x54a23b['body'],{})['then'](respondWithResult(_0x55cf2b,0xc9))['catch'](handleError(_0x55cf2b,null));};exports['update']=function(_0x38e987,_0x6423f2){if(_0x38e987[_0x5837('0x45')]['id']){delete _0x38e987['body']['id'];}return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x38e987[_0x5837('0x40')]['id']}})[_0x5837('0x24')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x24')](saveUpdates(_0x38e987[_0x5837('0x45')],null))[_0x5837('0x24')](respondWithResult(_0x6423f2,null))[_0x5837('0x3e')](handleError(_0x6423f2,null));};exports[_0x5837('0x23')]=function(_0x27f7b9,_0x38743a){return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x27f7b9[_0x5837('0x40')]['id']}})['then'](handleEntityNotFound(_0x38743a,null))[_0x5837('0x24')](removeEntity(_0x38743a,null))[_0x5837('0x3e')](handleError(_0x38743a,null));};exports[_0x5837('0x47')]=function(_0x397cd9,_0x38e75d){return db['Cdr'][_0x5837('0x47')]()[_0x5837('0x24')](respondWithResult(_0x38e75d,null))[_0x5837('0x3e')](handleError(_0x38e75d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index d4353f5..ad412c0 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(_0x142efc,_0x9be692){var _0x42e655=function(_0x1d0cfc){while(--_0x1d0cfc){_0x142efc['push'](_0x142efc['shift']());}};_0x42e655(++_0x9be692);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x51d6dd,_0x439d44){var _0x3b9806=function(_0x5d347f){while(--_0x5d347f){_0x51d6dd['push'](_0x51d6dd['shift']());}};_0x3b9806(++_0x439d44);}(_0x7a54,0x106));var _0x47a5=function(_0x30e3ab,_0x508bfe){_0x30e3ab=_0x30e3ab-0x0;var _0x1f515a=_0x7a54[_0x30e3ab];return _0x1f515a;};'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 0880711..f4d699a 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 _0x61a6=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x4af736,_0x57183b){var _0x13e98b=function(_0x508869){while(--_0x508869){_0x4af736['push'](_0x4af736['shift']());}};_0x13e98b(++_0x57183b);}(_0x61a6,0x12c));var _0x661a=function(_0x581e7d,_0x125495){_0x581e7d=_0x581e7d-0x0;var _0x58d2b1=_0x61a6[_0x581e7d];return _0x58d2b1;};'use strict';var _=require(_0x661a('0x0'));var util=require(_0x661a('0x1'));var moment=require('moment');var BPromise=require(_0x661a('0x2'));var rs=require(_0x661a('0x3'));var fs=require('fs');var Redis=require(_0x661a('0x4'));var db=require(_0x661a('0x5'))['db'];var utils=require(_0x661a('0x6'));var logger=require(_0x661a('0x7'))(_0x661a('0x8'));var config=require(_0x661a('0x9'));var jayson=require(_0x661a('0xa'));var client=jayson[_0x661a('0xb')][_0x661a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4750ce,_0x6f75f3,_0x4c4176){return new BPromise(function(_0x2e8400,_0x1547a9){return client[_0x661a('0xd')](_0x4750ce,_0x4c4176)[_0x661a('0xe')](function(_0x5dd01c){logger[_0x661a('0xf')](_0x661a('0x10'),_0x6f75f3,'request\x20sent');logger[_0x661a('0x11')](_0x661a('0x12'),_0x6f75f3,_0x661a('0x13'),JSON[_0x661a('0x14')](_0x5dd01c));if(_0x5dd01c[_0x661a('0x15')]){if(_0x5dd01c[_0x661a('0x15')][_0x661a('0x16')]===0x1f4){logger[_0x661a('0x15')](_0x661a('0x10'),_0x6f75f3,_0x5dd01c[_0x661a('0x15')][_0x661a('0x17')]);return _0x1547a9(_0x5dd01c[_0x661a('0x15')][_0x661a('0x17')]);}logger[_0x661a('0x15')](_0x661a('0x10'),_0x6f75f3,_0x5dd01c['error'][_0x661a('0x17')]);return _0x2e8400(_0x5dd01c[_0x661a('0x15')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x6f75f3,_0x661a('0x13'));_0x2e8400(_0x5dd01c['result'][_0x661a('0x17')]);}})[_0x661a('0x18')](function(_0x3f48f3){logger['error'](_0x661a('0x10'),_0x6f75f3,_0x3f48f3);_0x1547a9(_0x3f48f3);});});} \ No newline at end of file +var _0x7842=['debug','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','Cdr,\x20%s,\x20%s'];(function(_0x4d13b7,_0x16a458){var _0x4a6741=function(_0x1c7626){while(--_0x1c7626){_0x4d13b7['push'](_0x4d13b7['shift']());}};_0x4a6741(++_0x16a458);}(_0x7842,0x1ac));var _0x2784=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x7842[_0x4bb581];return _0x316bf5;};'use strict';var _=require(_0x2784('0x0'));var util=require(_0x2784('0x1'));var moment=require(_0x2784('0x2'));var BPromise=require(_0x2784('0x3'));var rs=require(_0x2784('0x4'));var fs=require('fs');var Redis=require(_0x2784('0x5'));var db=require(_0x2784('0x6'))['db'];var utils=require(_0x2784('0x7'));var logger=require(_0x2784('0x8'))(_0x2784('0x9'));var config=require('../../config/environment');var jayson=require(_0x2784('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x497383,_0x33ad9b,_0x569ed0){return new BPromise(function(_0x1f3ff0,_0x398f80){return client['request'](_0x497383,_0x569ed0)[_0x2784('0xb')](function(_0x4d4879){logger['info'](_0x2784('0xc'),_0x33ad9b,'request\x20sent');logger[_0x2784('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x33ad9b,_0x2784('0xe'),JSON[_0x2784('0xf')](_0x4d4879));if(_0x4d4879[_0x2784('0x10')]){if(_0x4d4879[_0x2784('0x10')][_0x2784('0x11')]===0x1f4){logger[_0x2784('0x10')](_0x2784('0xc'),_0x33ad9b,_0x4d4879[_0x2784('0x10')]['message']);return _0x398f80(_0x4d4879[_0x2784('0x10')][_0x2784('0x12')]);}logger[_0x2784('0x10')]('Cdr,\x20%s,\x20%s',_0x33ad9b,_0x4d4879['error'][_0x2784('0x12')]);return _0x1f3ff0(_0x4d4879[_0x2784('0x10')][_0x2784('0x12')]);}else{logger[_0x2784('0x13')]('Cdr,\x20%s,\x20%s',_0x33ad9b,_0x2784('0xe'));_0x1f3ff0(_0x4d4879[_0x2784('0x14')][_0x2784('0x12')]);}})['catch'](function(_0x5a9e52){logger['error'](_0x2784('0xc'),_0x33ad9b,_0x5a9e52);_0x398f80(_0x5a9e52);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 53dd606..b753d4d 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(_0x4f1d8f,_0x2c2d01){var _0x101bcb=function(_0xf440e0){while(--_0xf440e0){_0x4f1d8f['push'](_0x4f1d8f['shift']());}};_0x101bcb(++_0x2c2d01);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_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'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index f0ca714..4b3d48d 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 _0x0c1c=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x16ff21,_0x2f20e6){var _0x279ced=function(_0x4fd58d){while(--_0x4fd58d){_0x16ff21['push'](_0x16ff21['shift']());}};_0x279ced(++_0x2f20e6);}(_0x0c1c,0x183));var _0xc0c1=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x0c1c[_0x54ccd7];return _0x4e667b;};'use strict';var Sequelize=require(_0xc0c1('0x0'));module[_0xc0c1('0x1')]={'priority':{'type':Sequelize[_0xc0c1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc0c1('0x3')],'allowNull':![],'defaultValue':_0xc0c1('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc0c1('0x3')]},'interval':{'type':Sequelize[_0xc0c1('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7fcf=['noop','TEXT','STRING'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7fcf,0xc8));var _0xf7fc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7fcf[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf7fc('0x0')],'allowNull':![],'defaultValue':_0xf7fc('0x1')},'appdata':{'type':Sequelize[_0xf7fc('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf7fc('0x0')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index b8ea46d..29098c7 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 _0x915a=['show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','include','options','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','sendStatus','error','stack','name','send'];(function(_0x44bf54,_0x5be3d6){var _0x2c4a96=function(_0x2bd0ee){while(--_0x2bd0ee){_0x44bf54['push'](_0x44bf54['shift']());}};_0x2c4a96(++_0x5be3d6);}(_0x915a,0x1d2));var _0xa915=function(_0xfbe746,_0x587da9){_0xfbe746=_0xfbe746-0x0;var _0x3ef55b=_0x915a[_0xfbe746];return _0x3ef55b;};'use strict';var emlformat=require(_0xa915('0x0'));var rimraf=require(_0xa915('0x1'));var zipdir=require(_0xa915('0x2'));var jsonpatch=require(_0xa915('0x3'));var rp=require(_0xa915('0x4'));var moment=require('moment');var BPromise=require(_0xa915('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa915('0x6'));var sox=require(_0xa915('0x7'));var csv=require(_0xa915('0x8'));var ejs=require(_0xa915('0x9'));var fs=require('fs');var fs_extra=require(_0xa915('0xa'));var _=require(_0xa915('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa915('0xc'));var deskjs=require(_0xa915('0xd'));var toCsv=require(_0xa915('0x8'));var querystring=require(_0xa915('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa915('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa915('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa915('0x11'))(_0xa915('0x12'));var utils=require(_0xa915('0x13'));var config=require(_0xa915('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3edd93,_0x5d7c09){_0x5d7c09=_0x5d7c09||0xcc;return function(_0x274f4d){if(_0x274f4d){return _0x3edd93['sendStatus'](_0x5d7c09);}return _0x3edd93[_0xa915('0x15')](_0x5d7c09)[_0xa915('0x16')]();};}function respondWithResult(_0x22b588,_0x21d782){_0x21d782=_0x21d782||0xc8;return function(_0x3ecf23){if(_0x3ecf23){return _0x22b588[_0xa915('0x15')](_0x21d782)['json'](_0x3ecf23);}};}function respondWithFilteredResult(_0x23ecd8,_0x19889d){return function(_0xf9f02c){if(_0xf9f02c){var _0x590be6=typeof _0x19889d[_0xa915('0x17')]===_0xa915('0x18')&&typeof _0x19889d[_0xa915('0x19')]===_0xa915('0x18');var _0x3f5aff=_0xf9f02c[_0xa915('0x1a')];var _0x23d0df=_0x590be6?0x0:_0x19889d[_0xa915('0x17')];var _0x339335=_0x590be6?_0xf9f02c[_0xa915('0x1a')]:_0x19889d[_0xa915('0x17')]+_0x19889d['limit'];var _0x24af34;if(_0x339335>=_0x3f5aff){_0x339335=_0x3f5aff;_0x24af34=0xc8;}else{_0x24af34=0xce;}_0x23ecd8['status'](_0x24af34);return _0x23ecd8[_0xa915('0x1b')](_0xa915('0x1c'),_0x23d0df+'-'+_0x339335+'/'+_0x3f5aff)[_0xa915('0x1d')](_0xf9f02c);}return null;};}function patchUpdates(_0x414d36){return function(_0x15c3e0){try{jsonpatch['apply'](_0x15c3e0,_0x414d36,!![]);}catch(_0xa93602){return BPromise[_0xa915('0x1e')](_0xa93602);}return _0x15c3e0[_0xa915('0x1f')]();};}function saveUpdates(_0x3d94d1,_0x12c054){return function(_0x226c30){if(_0x226c30){return _0x226c30['update'](_0x3d94d1)[_0xa915('0x20')](function(_0x3e4726){return _0x3e4726;});}return null;};}function removeEntity(_0x220d66,_0x23515d){return function(_0x5a3eac){if(_0x5a3eac){return _0x5a3eac['destroy']()[_0xa915('0x20')](function(){_0x220d66['status'](0xcc)[_0xa915('0x16')]();});}};}function handleEntityNotFound(_0x3b8cbb,_0x3898cc){return function(_0x462b94){if(!_0x462b94){_0x3b8cbb[_0xa915('0x21')](0x194);}return _0x462b94;};}function handleError(_0x28b71a,_0x116246){_0x116246=_0x116246||0x1f4;return function(_0x525f55){logger[_0xa915('0x22')](_0x525f55[_0xa915('0x23')]);if(_0x525f55['name']){delete _0x525f55[_0xa915('0x24')];}_0x28b71a[_0xa915('0x15')](_0x116246)[_0xa915('0x25')](_0x525f55);};}exports[_0xa915('0x26')]=function(_0x5a62c0,_0x3cca8e){var _0x427742={'raw':!![],'where':{'id':_0x5a62c0[_0xa915('0x27')]['id']}},_0x486ca1={};_0x486ca1[_0xa915('0x28')]=_[_0xa915('0x29')](db[_0xa915('0x2a')][_0xa915('0x2b')]);_0x486ca1[_0xa915('0x2c')]=_['keys'](_0x5a62c0[_0xa915('0x2c')]);_0x486ca1[_0xa915('0x2d')]=_[_0xa915('0x2e')](_0x486ca1['model'],_0x486ca1[_0xa915('0x2c')]);_0x427742[_0xa915('0x2f')]=_[_0xa915('0x2e')](_0x486ca1['model'],qs[_0xa915('0x30')](_0x5a62c0[_0xa915('0x2c')][_0xa915('0x30')]));_0x427742[_0xa915('0x2f')]=_0x427742['attributes']['length']?_0x427742[_0xa915('0x2f')]:_0x486ca1[_0xa915('0x28')];if(_0x5a62c0[_0xa915('0x2c')]['includeAll']){_0x427742[_0xa915('0x31')]=[{'all':!![]}];}_0x427742=_['merge']({},_0x427742,_0x5a62c0[_0xa915('0x32')]);return db[_0xa915('0x2a')][_0xa915('0x33')](_0x427742)[_0xa915('0x20')](handleEntityNotFound(_0x3cca8e,null))[_0xa915('0x20')](respondWithResult(_0x3cca8e,null))[_0xa915('0x34')](handleError(_0x3cca8e,null));};exports[_0xa915('0x35')]=function(_0x4fe01c,_0x252643){if(_0x4fe01c[_0xa915('0x36')]['id']){delete _0x4fe01c[_0xa915('0x36')]['id'];}return db[_0xa915('0x2a')][_0xa915('0x33')]({'where':{'id':_0x4fe01c[_0xa915('0x27')]['id']}})['then'](handleEntityNotFound(_0x252643,null))[_0xa915('0x20')](saveUpdates(_0x4fe01c[_0xa915('0x36')],null))[_0xa915('0x20')](respondWithResult(_0x252643,null))[_0xa915('0x34')](handleError(_0x252643,null));};exports[_0xa915('0x37')]=function(_0x38e3ea,_0x2dccf7){return db['ChatApplication']['find']({'where':{'id':_0x38e3ea['params']['id']}})[_0xa915('0x20')](handleEntityNotFound(_0x2dccf7,null))[_0xa915('0x20')](removeEntity(_0x2dccf7,null))[_0xa915('0x34')](handleError(_0x2dccf7,null));}; \ No newline at end of file +var _0xc16f=['stack','name','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','length','includeAll','include','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','reject','save','update','then','destroy','end','error'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xc16f,0xe6));var _0xfc16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc16f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfc16('0x0'));var rimraf=require(_0xfc16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc16('0x2'));var rp=require(_0xfc16('0x3'));var moment=require(_0xfc16('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfc16('0x5'));var path=require('path');var sox=require(_0xfc16('0x6'));var csv=require(_0xfc16('0x7'));var ejs=require(_0xfc16('0x8'));var fs=require('fs');var fs_extra=require(_0xfc16('0x9'));var _=require(_0xfc16('0xa'));var squel=require(_0xfc16('0xb'));var crypto=require(_0xfc16('0xc'));var jsforce=require(_0xfc16('0xd'));var deskjs=require(_0xfc16('0xe'));var toCsv=require(_0xfc16('0x7'));var querystring=require(_0xfc16('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfc16('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc16('0x11'));var logger=require(_0xfc16('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfc16('0x13'));var licenseUtil=require(_0xfc16('0x14'));var db=require(_0xfc16('0x15'))['db'];function respondWithStatusCode(_0x456478,_0x2dcd29){_0x2dcd29=_0x2dcd29||0xcc;return function(_0x1384e2){if(_0x1384e2){return _0x456478[_0xfc16('0x16')](_0x2dcd29);}return _0x456478[_0xfc16('0x17')](_0x2dcd29)['end']();};}function respondWithResult(_0x17debf,_0x21123d){_0x21123d=_0x21123d||0xc8;return function(_0x2319f3){if(_0x2319f3){return _0x17debf[_0xfc16('0x17')](_0x21123d)[_0xfc16('0x18')](_0x2319f3);}};}function respondWithFilteredResult(_0x86e00b,_0x2ae498){return function(_0x3b01dc){if(_0x3b01dc){var _0x36e3e1=typeof _0x2ae498['offset']==='undefined'&&typeof _0x2ae498['limit']==='undefined';var _0x4ba438=_0x3b01dc[_0xfc16('0x19')];var _0x586309=_0x36e3e1?0x0:_0x2ae498[_0xfc16('0x1a')];var _0x29f87a=_0x36e3e1?_0x3b01dc[_0xfc16('0x19')]:_0x2ae498[_0xfc16('0x1a')]+_0x2ae498[_0xfc16('0x1b')];var _0x2e64eb;if(_0x29f87a>=_0x4ba438){_0x29f87a=_0x4ba438;_0x2e64eb=0xc8;}else{_0x2e64eb=0xce;}_0x86e00b[_0xfc16('0x17')](_0x2e64eb);return _0x86e00b['set']('Content-Range',_0x586309+'-'+_0x29f87a+'/'+_0x4ba438)['json'](_0x3b01dc);}return null;};}function patchUpdates(_0x53a050){return function(_0x5e4185){try{jsonpatch['apply'](_0x5e4185,_0x53a050,!![]);}catch(_0x30799b){return BPromise[_0xfc16('0x1c')](_0x30799b);}return _0x5e4185[_0xfc16('0x1d')]();};}function saveUpdates(_0x1cdd64,_0x56c811){return function(_0x4b2bdf){if(_0x4b2bdf){return _0x4b2bdf[_0xfc16('0x1e')](_0x1cdd64)[_0xfc16('0x1f')](function(_0x2fa332){return _0x2fa332;});}return null;};}function removeEntity(_0x5efe2b,_0xf2335b){return function(_0x49afce){if(_0x49afce){return _0x49afce[_0xfc16('0x20')]()[_0xfc16('0x1f')](function(){_0x5efe2b[_0xfc16('0x17')](0xcc)[_0xfc16('0x21')]();});}};}function handleEntityNotFound(_0x4ec4ea,_0x45187c){return function(_0x4b15a0){if(!_0x4b15a0){_0x4ec4ea[_0xfc16('0x16')](0x194);}return _0x4b15a0;};}function handleError(_0x2af01f,_0x4e29df){_0x4e29df=_0x4e29df||0x1f4;return function(_0x1d3d0c){logger[_0xfc16('0x22')](_0x1d3d0c[_0xfc16('0x23')]);if(_0x1d3d0c[_0xfc16('0x24')]){delete _0x1d3d0c[_0xfc16('0x24')];}_0x2af01f[_0xfc16('0x17')](_0x4e29df)['send'](_0x1d3d0c);};}exports['show']=function(_0x148e17,_0x2528ba){var _0x4fdfb4={'raw':!![],'where':{'id':_0x148e17[_0xfc16('0x25')]['id']}},_0x3f9592={};_0x3f9592[_0xfc16('0x26')]=_['keys'](db[_0xfc16('0x27')][_0xfc16('0x28')]);_0x3f9592[_0xfc16('0x29')]=_[_0xfc16('0x2a')](_0x148e17[_0xfc16('0x29')]);_0x3f9592[_0xfc16('0x2b')]=_[_0xfc16('0x2c')](_0x3f9592[_0xfc16('0x26')],_0x3f9592[_0xfc16('0x29')]);_0x4fdfb4['attributes']=_[_0xfc16('0x2c')](_0x3f9592[_0xfc16('0x26')],qs['fields'](_0x148e17[_0xfc16('0x29')]['fields']));_0x4fdfb4[_0xfc16('0x2d')]=_0x4fdfb4[_0xfc16('0x2d')][_0xfc16('0x2e')]?_0x4fdfb4[_0xfc16('0x2d')]:_0x3f9592[_0xfc16('0x26')];if(_0x148e17['query'][_0xfc16('0x2f')]){_0x4fdfb4[_0xfc16('0x30')]=[{'all':!![]}];}_0x4fdfb4=_['merge']({},_0x4fdfb4,_0x148e17[_0xfc16('0x31')]);return db['ChatApplication'][_0xfc16('0x32')](_0x4fdfb4)['then'](handleEntityNotFound(_0x2528ba,null))[_0xfc16('0x1f')](respondWithResult(_0x2528ba,null))[_0xfc16('0x33')](handleError(_0x2528ba,null));};exports[_0xfc16('0x1e')]=function(_0x3b566b,_0xcc2c22){if(_0x3b566b[_0xfc16('0x34')]['id']){delete _0x3b566b[_0xfc16('0x34')]['id'];}return db['ChatApplication'][_0xfc16('0x32')]({'where':{'id':_0x3b566b[_0xfc16('0x25')]['id']}})[_0xfc16('0x1f')](handleEntityNotFound(_0xcc2c22,null))['then'](saveUpdates(_0x3b566b[_0xfc16('0x34')],null))['then'](respondWithResult(_0xcc2c22,null))[_0xfc16('0x33')](handleError(_0xcc2c22,null));};exports[_0xfc16('0x20')]=function(_0x5df64a,_0xe3920e){return db[_0xfc16('0x27')][_0xfc16('0x32')]({'where':{'id':_0x5df64a[_0xfc16('0x25')]['id']}})[_0xfc16('0x1f')](handleEntityNotFound(_0xe3920e,null))[_0xfc16('0x1f')](removeEntity(_0xe3920e,null))[_0xfc16('0x33')](handleError(_0xe3920e,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index f489375..55c8202 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 _0x273c=['util','moment','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash'];(function(_0x20c260,_0x19a98e){var _0x6e0a59=function(_0xc4f641){while(--_0xc4f641){_0x20c260['push'](_0x20c260['shift']());}};_0x6e0a59(++_0x19a98e);}(_0x273c,0x81));var _0xc273=function(_0xcf0d77,_0x2195aa){_0xcf0d77=_0xcf0d77-0x0;var _0x13b05f=_0x273c[_0xcf0d77];return _0x13b05f;};'use strict';var _=require(_0xc273('0x0'));var util=require(_0xc273('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc273('0x2'));var BPromise=require(_0xc273('0x3'));var rp=require(_0xc273('0x4'));var fs=require('fs');var path=require(_0xc273('0x5'));var rimraf=require('rimraf');var config=require(_0xc273('0x6'));var attributes=require(_0xc273('0x7'));module[_0xc273('0x8')]=function(_0x1992bf,_0x35e5e8){return _0x1992bf[_0xc273('0x9')](_0xc273('0xa'),attributes,{'tableName':_0xc273('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc273('0xc')});}; \ No newline at end of file +var _0x96f3=['bluebird','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x390abb,_0x17166e){var _0x4e5787=function(_0x5b2ce9){while(--_0x5b2ce9){_0x390abb['push'](_0x390abb['shift']());}};_0x4e5787(++_0x17166e);}(_0x96f3,0xf7));var _0x396f=function(_0xfd9a61,_0x346a87){_0xfd9a61=_0xfd9a61-0x0;var _0x46b6e7=_0x96f3[_0xfd9a61];return _0x46b6e7;};'use strict';var _=require(_0x396f('0x0'));var util=require(_0x396f('0x1'));var logger=require(_0x396f('0x2'))(_0x396f('0x3'));var moment=require(_0x396f('0x4'));var BPromise=require(_0x396f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x396f('0x6'));var config=require(_0x396f('0x7'));var attributes=require(_0x396f('0x8'));module['exports']=function(_0x5f5949,_0x8f2585){return _0x5f5949[_0x396f('0x9')](_0x396f('0xa'),attributes,{'tableName':_0x396f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x396f('0xc'),'collate':_0x396f('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5b44a1c..8a75fe2 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 _0xd301=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd301,0xe3));var _0x1d30=function(_0x277208,_0x57ab06){_0x277208=_0x277208-0x0;var _0x3e2c03=_0xd301[_0x277208];return _0x3e2c03;};'use strict';var _=require(_0x1d30('0x0'));var util=require(_0x1d30('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d30('0x2'));var fs=require('fs');var Redis=require(_0x1d30('0x3'));var db=require(_0x1d30('0x4'))['db'];var utils=require(_0x1d30('0x5'));var logger=require(_0x1d30('0x6'))(_0x1d30('0x7'));var config=require(_0x1d30('0x8'));var jayson=require(_0x1d30('0x9'));var client=jayson['client'][_0x1d30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9f1b05,_0x1bc22e,_0x53f5e8){return new BPromise(function(_0x52786f,_0xe746d7){return client[_0x1d30('0xb')](_0x9f1b05,_0x53f5e8)[_0x1d30('0xc')](function(_0x3e4970){logger[_0x1d30('0xd')](_0x1d30('0xe'),_0x1bc22e,'request\x20sent');logger['debug'](_0x1d30('0xf'),_0x1bc22e,'request\x20sent',JSON[_0x1d30('0x10')](_0x3e4970));if(_0x3e4970[_0x1d30('0x11')]){if(_0x3e4970[_0x1d30('0x11')][_0x1d30('0x12')]===0x1f4){logger['error'](_0x1d30('0xe'),_0x1bc22e,_0x3e4970[_0x1d30('0x11')][_0x1d30('0x13')]);return _0xe746d7(_0x3e4970[_0x1d30('0x11')]['message']);}logger[_0x1d30('0x11')]('ChatApplication,\x20%s,\x20%s',_0x1bc22e,_0x3e4970['error']['message']);return _0x52786f(_0x3e4970[_0x1d30('0x11')][_0x1d30('0x13')]);}else{logger['info'](_0x1d30('0xe'),_0x1bc22e,_0x1d30('0x14'));_0x52786f(_0x3e4970[_0x1d30('0x15')][_0x1d30('0x13')]);}})[_0x1d30('0x16')](function(_0x16131d){logger[_0x1d30('0x11')](_0x1d30('0xe'),_0x1bc22e,_0x16131d);_0xe746d7(_0x16131d);});});} \ No newline at end of file +var _0x2389=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2389,0xd7));var _0x9238=function(_0x41cc78,_0x114130){_0x41cc78=_0x41cc78-0x0;var _0x48dff5=_0x2389[_0x41cc78];return _0x48dff5;};'use strict';var _=require(_0x9238('0x0'));var util=require(_0x9238('0x1'));var moment=require(_0x9238('0x2'));var BPromise=require(_0x9238('0x3'));var rs=require(_0x9238('0x4'));var fs=require('fs');var Redis=require(_0x9238('0x5'));var db=require(_0x9238('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9238('0x7'))('rpc');var config=require(_0x9238('0x8'));var jayson=require(_0x9238('0x9'));var client=jayson[_0x9238('0xa')][_0x9238('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eaa19,_0x45cfa5,_0x8c26a9){return new BPromise(function(_0xdf7088,_0xb8a64f){return client['request'](_0x3eaa19,_0x8c26a9)['then'](function(_0x50a107){logger[_0x9238('0xc')](_0x9238('0xd'),_0x45cfa5,_0x9238('0xe'));logger[_0x9238('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x45cfa5,_0x9238('0xe'),JSON['stringify'](_0x50a107));if(_0x50a107['error']){if(_0x50a107[_0x9238('0x10')][_0x9238('0x11')]===0x1f4){logger[_0x9238('0x10')](_0x9238('0xd'),_0x45cfa5,_0x50a107['error'][_0x9238('0x12')]);return _0xb8a64f(_0x50a107[_0x9238('0x10')][_0x9238('0x12')]);}logger[_0x9238('0x10')](_0x9238('0xd'),_0x45cfa5,_0x50a107[_0x9238('0x10')][_0x9238('0x12')]);return _0xdf7088(_0x50a107[_0x9238('0x10')][_0x9238('0x12')]);}else{logger['info'](_0x9238('0xd'),_0x45cfa5,_0x9238('0xe'));_0xdf7088(_0x50a107['result']['message']);}})[_0x9238('0x13')](function(_0x366964){logger[_0x9238('0x10')]('ChatApplication,\x20%s,\x20%s',_0x45cfa5,_0x366964);_0xb8a64f(_0x366964);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index d7abcdd..a28aaab 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 _0x4b9c=['./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0x4b9c,0xd9));var _0xc4b9=function(_0x543341,_0x25271a){_0x543341=_0x543341-0x0;var _0x59362b=_0x4b9c[_0x543341];return _0x59362b;};'use strict';var multer=require(_0xc4b9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc4b9('0x1'));var express=require(_0xc4b9('0x2'));var router=express[_0xc4b9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc4b9('0x4'));var interaction=require(_0xc4b9('0x5'));var config=require(_0xc4b9('0x6'));var controller=require(_0xc4b9('0x7'));router[_0xc4b9('0x8')](_0xc4b9('0x9'),auth[_0xc4b9('0xa')](),controller[_0xc4b9('0xb')]);router['put'](_0xc4b9('0x9'),auth[_0xc4b9('0xa')](),controller[_0xc4b9('0xc')]);router[_0xc4b9('0xd')](_0xc4b9('0x9'),auth[_0xc4b9('0xa')](),controller[_0xc4b9('0xe')]);module[_0xc4b9('0xf')]=router; \ No newline at end of file +var _0x8bfa=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy'];(function(_0x4adce1,_0x41d240){var _0x9110fa=function(_0x4c3c85){while(--_0x4c3c85){_0x4adce1['push'](_0x4adce1['shift']());}};_0x9110fa(++_0x41d240);}(_0x8bfa,0x18d));var _0xa8bf=function(_0x5d9c31,_0x46a08d){_0x5d9c31=_0x5d9c31-0x0;var _0x579098=_0x8bfa[_0x5d9c31];return _0x579098;};'use strict';var multer=require(_0xa8bf('0x0'));var util=require(_0xa8bf('0x1'));var path=require('path');var timeout=require(_0xa8bf('0x2'));var express=require(_0xa8bf('0x3'));var router=express['Router']();var fs_extra=require(_0xa8bf('0x4'));var auth=require(_0xa8bf('0x5'));var interaction=require(_0xa8bf('0x6'));var config=require(_0xa8bf('0x7'));var controller=require(_0xa8bf('0x8'));router[_0xa8bf('0x9')](_0xa8bf('0xa'),auth['isAuthenticated'](),controller[_0xa8bf('0xb')]);router[_0xa8bf('0xc')](_0xa8bf('0xa'),auth[_0xa8bf('0xd')](),controller[_0xa8bf('0xe')]);router[_0xa8bf('0xf')]('/:id',auth[_0xa8bf('0xd')](),controller[_0xa8bf('0x10')]);module[_0xa8bf('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 485a176..b24becc 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 _0x605a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0x605a,0x126));var _0xa605=function(_0xa9d5d3,_0x1ba8ca){_0xa9d5d3=_0xa9d5d3-0x0;var _0x402db3=_0x605a[_0xa9d5d3];return _0x402db3;};'use strict';var Sequelize=require(_0xa605('0x0'));module[_0xa605('0x1')]={'name':{'type':Sequelize[_0xa605('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa605('0x2')]},'write':{'type':Sequelize[_0xa605('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6333=['STRING'];(function(_0xa61bff,_0x1dd784){var _0x7cf1ae=function(_0x167803){while(--_0x167803){_0xa61bff['push'](_0xa61bff['shift']());}};_0x7cf1ae(++_0x1dd784);}(_0x6333,0x83));var _0x3633=function(_0x20be05,_0x411a25){_0x20be05=_0x20be05-0x0;var _0x4af35f=_0x6333[_0x20be05];return _0x4af35f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3633('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index f795cfc..00b7e4d 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 _0xd7d0=['sendStatus','error','stack','name','index','map','ChatGroup','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','nolimit','removeMembers','addMessage','getMessages','order','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','status','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','end'];(function(_0x360c76,_0x41ec7f){var _0x269eb4=function(_0x2ca75c){while(--_0x2ca75c){_0x360c76['push'](_0x360c76['shift']());}};_0x269eb4(++_0x41ec7f);}(_0xd7d0,0x93));var _0x0d7d=function(_0x1a1f2e,_0x2fb1e6){_0x1a1f2e=_0x1a1f2e-0x0;var _0x5ce8bd=_0xd7d0[_0x1a1f2e];return _0x5ce8bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d7d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d7d('0x1'));var rp=require(_0x0d7d('0x2'));var moment=require(_0x0d7d('0x3'));var BPromise=require(_0x0d7d('0x4'));var Mustache=require(_0x0d7d('0x5'));var util=require(_0x0d7d('0x6'));var path=require(_0x0d7d('0x7'));var sox=require(_0x0d7d('0x8'));var csv=require('to-csv');var ejs=require(_0x0d7d('0x9'));var fs=require('fs');var fs_extra=require(_0x0d7d('0xa'));var _=require(_0x0d7d('0xb'));var squel=require(_0x0d7d('0xc'));var crypto=require('crypto');var jsforce=require(_0x0d7d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0d7d('0xe'));var Papa=require(_0x0d7d('0xf'));var Redis=require(_0x0d7d('0x10'));var authService=require(_0x0d7d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0d7d('0x12'));var hardwareService=require(_0x0d7d('0x13'));var logger=require(_0x0d7d('0x14'))(_0x0d7d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0d7d('0x16'));var db=require(_0x0d7d('0x17'))['db'];config[_0x0d7d('0x18')]=_[_0x0d7d('0x19')](config[_0x0d7d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d7d('0x1a'))(new Redis(config[_0x0d7d('0x18')]));require(_0x0d7d('0x1b'))[_0x0d7d('0x1c')](socket);function respondWithStatusCode(_0x320a64,_0x3ef22e){_0x3ef22e=_0x3ef22e||0xcc;return function(_0xead06b){if(_0xead06b){return _0x320a64['sendStatus'](_0x3ef22e);}return _0x320a64[_0x0d7d('0x1d')](_0x3ef22e)['end']();};}function respondWithResult(_0x3c2ddc,_0x39770a){_0x39770a=_0x39770a||0xc8;return function(_0x2f2dfe){if(_0x2f2dfe){return _0x3c2ddc[_0x0d7d('0x1d')](_0x39770a)['json'](_0x2f2dfe);}};}function respondWithFilteredResult(_0x24c857,_0x564715){return function(_0x2ba7bc){if(_0x2ba7bc){var _0x38da06=typeof _0x564715['offset']===_0x0d7d('0x1e')&&typeof _0x564715['limit']==='undefined';var _0x317c2f=_0x2ba7bc[_0x0d7d('0x1f')];var _0x362284=_0x38da06?0x0:_0x564715[_0x0d7d('0x20')];var _0x314800=_0x38da06?_0x2ba7bc[_0x0d7d('0x1f')]:_0x564715[_0x0d7d('0x20')]+_0x564715[_0x0d7d('0x21')];var _0x2bbefd;if(_0x314800>=_0x317c2f){_0x314800=_0x317c2f;_0x2bbefd=0xc8;}else{_0x2bbefd=0xce;}_0x24c857[_0x0d7d('0x1d')](_0x2bbefd);return _0x24c857[_0x0d7d('0x22')](_0x0d7d('0x23'),_0x362284+'-'+_0x314800+'/'+_0x317c2f)['json'](_0x2ba7bc);}return null;};}function patchUpdates(_0x37b0c4){return function(_0x9de92a){try{jsonpatch[_0x0d7d('0x24')](_0x9de92a,_0x37b0c4,!![]);}catch(_0x50343a){return BPromise['reject'](_0x50343a);}return _0x9de92a[_0x0d7d('0x25')]();};}function saveUpdates(_0x42faaf,_0x25b19d){return function(_0x3cae5e){if(_0x3cae5e){return _0x3cae5e[_0x0d7d('0x26')](_0x42faaf)[_0x0d7d('0x27')](function(_0x3fc8ab){return _0x3fc8ab;});}return null;};}function removeEntity(_0x15ab8c,_0x52e1d0){return function(_0x2dd6aa){if(_0x2dd6aa){return _0x2dd6aa['destroy']()[_0x0d7d('0x27')](function(){_0x15ab8c[_0x0d7d('0x1d')](0xcc)[_0x0d7d('0x28')]();});}};}function handleEntityNotFound(_0x39930e,_0x559f87){return function(_0x314df1){if(!_0x314df1){_0x39930e[_0x0d7d('0x29')](0x194);}return _0x314df1;};}function handleError(_0x2ad3c8,_0x1b52f8){_0x1b52f8=_0x1b52f8||0x1f4;return function(_0x25f09f){logger[_0x0d7d('0x2a')](_0x25f09f[_0x0d7d('0x2b')]);if(_0x25f09f[_0x0d7d('0x2c')]){delete _0x25f09f[_0x0d7d('0x2c')];}_0x2ad3c8[_0x0d7d('0x1d')](_0x1b52f8)['send'](_0x25f09f);};}exports[_0x0d7d('0x2d')]=function(_0xa4ad5c,_0x229db7){var _0x423d0d={},_0xf13226={},_0x40e046={'count':0x0,'rows':[]};var _0x465dd1=_[_0x0d7d('0x2e')](db[_0x0d7d('0x2f')][_0x0d7d('0x30')],function(_0x424119){return{'name':_0x424119['fieldName'],'type':_0x424119['type'][_0x0d7d('0x31')]};});_0xf13226[_0x0d7d('0x32')]=_['map'](_0x465dd1,_0x0d7d('0x2c'));_0xf13226[_0x0d7d('0x33')]=_['keys'](_0xa4ad5c[_0x0d7d('0x33')]);_0xf13226['filters']=_[_0x0d7d('0x34')](_0xf13226['model'],_0xf13226[_0x0d7d('0x33')]);_0x423d0d[_0x0d7d('0x35')]=_[_0x0d7d('0x34')](_0xf13226[_0x0d7d('0x32')],qs['fields'](_0xa4ad5c[_0x0d7d('0x33')][_0x0d7d('0x36')]));_0x423d0d['attributes']=_0x423d0d['attributes'][_0x0d7d('0x37')]?_0x423d0d['attributes']:_0xf13226[_0x0d7d('0x32')];if(!_0xa4ad5c[_0x0d7d('0x33')][_0x0d7d('0x38')]('nolimit')){_0x423d0d['limit']=qs[_0x0d7d('0x21')](_0xa4ad5c[_0x0d7d('0x33')][_0x0d7d('0x21')]);_0x423d0d[_0x0d7d('0x20')]=qs['offset'](_0xa4ad5c['query'][_0x0d7d('0x20')]);}_0x423d0d['order']=qs['sort'](_0xa4ad5c['query'][_0x0d7d('0x39')]);_0x423d0d[_0x0d7d('0x3a')]=qs[_0x0d7d('0x3b')](_['pick'](_0xa4ad5c['query'],_0xf13226[_0x0d7d('0x3b')]),_0x465dd1);if(_0xa4ad5c[_0x0d7d('0x33')][_0x0d7d('0x3c')]){_0x423d0d[_0x0d7d('0x3a')]=_[_0x0d7d('0x3d')](_0x423d0d['where'],{'$or':_[_0x0d7d('0x2e')](_0x465dd1,function(_0x162a07){if(_0x162a07['type']!==_0x0d7d('0x3e')){var _0x220275={};_0x220275[_0x162a07[_0x0d7d('0x2c')]]={'$like':'%'+_0xa4ad5c[_0x0d7d('0x33')][_0x0d7d('0x3c')]+'%'};return _0x220275;}})});}_0x423d0d=_[_0x0d7d('0x3d')]({},_0x423d0d,_0xa4ad5c[_0x0d7d('0x3f')]);var _0x80a805={'where':_0x423d0d['where']};return db['ChatGroup'][_0x0d7d('0x1f')](_0x80a805)[_0x0d7d('0x27')](function(_0x2486dd){_0x40e046['count']=_0x2486dd;if(_0xa4ad5c[_0x0d7d('0x33')][_0x0d7d('0x40')]){_0x423d0d[_0x0d7d('0x41')]=[{'all':!![]}];}return db[_0x0d7d('0x2f')][_0x0d7d('0x42')](_0x423d0d);})[_0x0d7d('0x27')](function(_0x3f7e51){_0x40e046[_0x0d7d('0x43')]=_0x3f7e51;return _0x40e046;})[_0x0d7d('0x27')](respondWithFilteredResult(_0x229db7,_0x423d0d))[_0x0d7d('0x44')](handleError(_0x229db7,null));};exports[_0x0d7d('0x45')]=function(_0x178d31,_0xd7cae4){var _0x282703={'raw':!![],'where':{'id':_0x178d31['params']['id']}},_0x3302a8={};_0x3302a8[_0x0d7d('0x32')]=_[_0x0d7d('0x46')](db['ChatGroup'][_0x0d7d('0x30')]);_0x3302a8[_0x0d7d('0x33')]=_[_0x0d7d('0x46')](_0x178d31['query']);_0x3302a8[_0x0d7d('0x3b')]=_[_0x0d7d('0x34')](_0x3302a8[_0x0d7d('0x32')],_0x3302a8[_0x0d7d('0x33')]);_0x282703[_0x0d7d('0x35')]=_[_0x0d7d('0x34')](_0x3302a8['model'],qs[_0x0d7d('0x36')](_0x178d31[_0x0d7d('0x33')][_0x0d7d('0x36')]));_0x282703[_0x0d7d('0x35')]=_0x282703[_0x0d7d('0x35')]['length']?_0x282703[_0x0d7d('0x35')]:_0x3302a8['model'];if(_0x178d31[_0x0d7d('0x33')][_0x0d7d('0x40')]){_0x282703[_0x0d7d('0x41')]=[{'all':!![]}];}_0x282703=_[_0x0d7d('0x3d')]({},_0x282703,_0x178d31[_0x0d7d('0x3f')]);return db['ChatGroup'][_0x0d7d('0x47')](_0x282703)[_0x0d7d('0x27')](handleEntityNotFound(_0xd7cae4,null))[_0x0d7d('0x27')](respondWithResult(_0xd7cae4,null))[_0x0d7d('0x44')](handleError(_0xd7cae4,null));};exports[_0x0d7d('0x48')]=function(_0x30facc,_0x550d9e){return db[_0x0d7d('0x2f')][_0x0d7d('0x48')](_0x30facc[_0x0d7d('0x49')],{})[_0x0d7d('0x27')](respondWithResult(_0x550d9e,0xc9))[_0x0d7d('0x44')](handleError(_0x550d9e,null));};exports[_0x0d7d('0x26')]=function(_0x2b49b2,_0x29a9b7){if(_0x2b49b2[_0x0d7d('0x49')]['id']){delete _0x2b49b2[_0x0d7d('0x49')]['id'];}return db['ChatGroup'][_0x0d7d('0x47')]({'where':{'id':_0x2b49b2[_0x0d7d('0x4a')]['id']}})[_0x0d7d('0x27')](handleEntityNotFound(_0x29a9b7,null))[_0x0d7d('0x27')](saveUpdates(_0x2b49b2['body'],null))[_0x0d7d('0x27')](respondWithResult(_0x29a9b7,null))['catch'](handleError(_0x29a9b7,null));};exports[_0x0d7d('0x4b')]=function(_0x4aacbc,_0x4fefd3){return db['ChatGroup']['find']({'where':{'id':_0x4aacbc[_0x0d7d('0x4a')]['id']}})[_0x0d7d('0x27')](handleEntityNotFound(_0x4fefd3,null))['then'](removeEntity(_0x4fefd3,null))['catch'](handleError(_0x4fefd3,null));};exports[_0x0d7d('0x4c')]=function(_0x14fe2d,_0x5f33b8){return db[_0x0d7d('0x2f')]['describe']()[_0x0d7d('0x27')](respondWithResult(_0x5f33b8,null))[_0x0d7d('0x44')](handleError(_0x5f33b8,null));};exports['getUnread']=function(_0x108f33,_0x5d9f49,_0x127c19){return db[_0x0d7d('0x4d')]['count']({'where':{'ChatGroupId':_0x108f33[_0x0d7d('0x4a')]['id'],'ToId':_0x108f33[_0x0d7d('0x4e')]['id'],'read':![]}})['then'](function(_0x14fc65){return{'id':_[_0x0d7d('0x4f')](_0x108f33[_0x0d7d('0x4a')]['id']),'count':_0x14fc65};})['then'](respondWithResult(_0x5d9f49,null))[_0x0d7d('0x44')](handleError(_0x5d9f49,null));};exports[_0x0d7d('0x50')]=function(_0x28557b,_0x2899c0,_0x2fe07a){return db[_0x0d7d('0x2f')][_0x0d7d('0x47')]({'where':{'id':_0x28557b[_0x0d7d('0x4a')]['id']}})[_0x0d7d('0x27')](handleEntityNotFound(_0x2899c0,null))[_0x0d7d('0x27')](function(_0x5ced44){if(_0x5ced44){return _0x5ced44[_0x0d7d('0x50')](_0x28557b[_0x0d7d('0x49')][_0x0d7d('0x51')],_[_0x0d7d('0x52')](_0x28557b[_0x0d7d('0x49')],[_0x0d7d('0x51'),'id'])||{});}})[_0x0d7d('0x27')](respondWithResult(_0x2899c0,null))[_0x0d7d('0x44')](handleError(_0x2899c0,null));};exports[_0x0d7d('0x53')]=function(_0x57b906,_0x4d2fb1,_0x538c12){var _0x1f8576={};var _0xc80570={};var _0x30b1fd;var _0x3c3ac5;return db[_0x0d7d('0x2f')][_0x0d7d('0x54')]({'where':{'id':_0x57b906['params']['id']}})['then'](handleEntityNotFound(_0x4d2fb1,null))['then'](function(_0x4c6e9d){if(_0x4c6e9d){_0x30b1fd=_0x4c6e9d;_0xc80570[_0x0d7d('0x32')]=_[_0x0d7d('0x46')](db[_0x0d7d('0x55')][_0x0d7d('0x30')]);_0xc80570[_0x0d7d('0x33')]=_[_0x0d7d('0x46')](_0x57b906[_0x0d7d('0x33')]);_0xc80570[_0x0d7d('0x3b')]=_[_0x0d7d('0x34')](_0xc80570[_0x0d7d('0x32')],_0xc80570[_0x0d7d('0x33')]);_0x1f8576['attributes']=_[_0x0d7d('0x34')](_0xc80570[_0x0d7d('0x32')],qs[_0x0d7d('0x36')](_0x57b906[_0x0d7d('0x33')][_0x0d7d('0x36')]));_0x1f8576[_0x0d7d('0x35')]=_0x1f8576[_0x0d7d('0x35')][_0x0d7d('0x37')]?_0x1f8576[_0x0d7d('0x35')]:_0xc80570[_0x0d7d('0x32')];_0x1f8576['order']=qs['sort'](_0x57b906[_0x0d7d('0x33')][_0x0d7d('0x39')]);_0x1f8576[_0x0d7d('0x3a')]=qs['filters'](_['pick'](_0x57b906[_0x0d7d('0x33')],_0xc80570[_0x0d7d('0x3b')]));if(_0x57b906[_0x0d7d('0x33')]['filter']){_0x1f8576[_0x0d7d('0x3a')]=_[_0x0d7d('0x3d')](_0x1f8576[_0x0d7d('0x3a')],{'$or':_[_0x0d7d('0x2e')](_0x1f8576[_0x0d7d('0x35')],function(_0x4aab00){var _0xf718c7={};_0xf718c7[_0x4aab00]={'$like':'%'+_0x57b906[_0x0d7d('0x33')][_0x0d7d('0x3c')]+'%'};return _0xf718c7;})});}_0x1f8576=_['merge']({},_0x1f8576,_0x57b906[_0x0d7d('0x3f')]);return _0x30b1fd[_0x0d7d('0x53')](_0x1f8576);}})[_0x0d7d('0x27')](function(_0x5a4a02){if(_0x5a4a02){_0x3c3ac5=_0x5a4a02['length'];if(!_0x57b906[_0x0d7d('0x33')][_0x0d7d('0x38')](_0x0d7d('0x56'))){_0x1f8576[_0x0d7d('0x21')]=qs[_0x0d7d('0x21')](_0x57b906[_0x0d7d('0x33')][_0x0d7d('0x21')]);_0x1f8576[_0x0d7d('0x20')]=qs[_0x0d7d('0x20')](_0x57b906[_0x0d7d('0x33')][_0x0d7d('0x20')]);}return _0x30b1fd['getMembers'](_0x1f8576);}})[_0x0d7d('0x27')](function(_0x234b23){if(_0x234b23){return _0x234b23?{'count':_0x3c3ac5,'rows':_0x234b23}:null;}})[_0x0d7d('0x27')](respondWithResult(_0x4d2fb1,null))['catch'](handleError(_0x4d2fb1,null));};exports[_0x0d7d('0x57')]=function(_0x5124b9,_0x33c61e,_0x1d1237){return db['ChatGroup'][_0x0d7d('0x47')]({'where':{'id':_0x5124b9[_0x0d7d('0x4a')]['id']}})[_0x0d7d('0x27')](handleEntityNotFound(_0x33c61e,null))['then'](function(_0x3a7fd5){if(_0x3a7fd5){return _0x3a7fd5['removeMembers'](_0x5124b9[_0x0d7d('0x33')][_0x0d7d('0x51')]);}})[_0x0d7d('0x27')](respondWithStatusCode(_0x33c61e,null))[_0x0d7d('0x44')](handleError(_0x33c61e,null));};exports[_0x0d7d('0x58')]=function(_0x1e52e9,_0x5756ff,_0x406f48){if(_0x1e52e9['body']['id']){delete _0x1e52e9[_0x0d7d('0x49')]['id'];}return db[_0x0d7d('0x2f')][_0x0d7d('0x47')]({'where':{'id':_0x1e52e9['params']['id']}})[_0x0d7d('0x27')](handleEntityNotFound(_0x5756ff,null))['then'](function(_0x28d3b4){if(_0x28d3b4){_0x1e52e9[_0x0d7d('0x49')]['ChatGroupId']=_0x28d3b4['id'];return db[_0x0d7d('0x4d')][_0x0d7d('0x48')](_0x1e52e9[_0x0d7d('0x49')]);}})[_0x0d7d('0x27')](respondWithResult(_0x5756ff,null))[_0x0d7d('0x44')](handleError(_0x5756ff,null));};exports[_0x0d7d('0x59')]=function(_0x4092b4,_0x2b811c,_0x225f63){var _0x120184={};var _0x6088f3={};var _0x32aac4;var _0x47fe13;return db[_0x0d7d('0x2f')][_0x0d7d('0x54')]({'where':{'id':_0x4092b4[_0x0d7d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2b811c,null))['then'](function(_0x628d2b){if(_0x628d2b){_0x32aac4=_0x628d2b;_0x6088f3[_0x0d7d('0x32')]=_[_0x0d7d('0x46')](db[_0x0d7d('0x4d')][_0x0d7d('0x30')]);_0x6088f3['query']=_['keys'](_0x4092b4['query']);_0x6088f3[_0x0d7d('0x3b')]=_[_0x0d7d('0x34')](_0x6088f3[_0x0d7d('0x32')],_0x6088f3[_0x0d7d('0x33')]);_0x120184['attributes']=_[_0x0d7d('0x34')](_0x6088f3[_0x0d7d('0x32')],qs['fields'](_0x4092b4['query'][_0x0d7d('0x36')]));_0x120184[_0x0d7d('0x35')]=_0x120184[_0x0d7d('0x35')]['length']?_0x120184[_0x0d7d('0x35')]:_0x6088f3['model'];_0x120184[_0x0d7d('0x5a')]=qs['sort'](_0x4092b4['query'][_0x0d7d('0x39')]);_0x120184['where']=qs[_0x0d7d('0x3b')](_['pick'](_0x4092b4[_0x0d7d('0x33')],_0x6088f3[_0x0d7d('0x3b')]));if(_0x4092b4[_0x0d7d('0x33')][_0x0d7d('0x3c')]){_0x120184[_0x0d7d('0x3a')]=_[_0x0d7d('0x3d')](_0x120184[_0x0d7d('0x3a')],{'$or':_['map'](_0x120184[_0x0d7d('0x35')],function(_0x55b0c7){var _0x47ebc0={};_0x47ebc0[_0x55b0c7]={'$like':'%'+_0x4092b4['query']['filter']+'%'};return _0x47ebc0;})});}if(_0x4092b4['query'][_0x0d7d('0x5b')]){var _0x28a565=_0x4092b4[_0x0d7d('0x33')][_0x0d7d('0x5b')]['split'](',');var _0x8cddb2={};_0x8cddb2[_0x28a565[0x0]]={'$gte':moment(_0x28a565[0x1])[_0x0d7d('0x5c')](_0x0d7d('0x5d'))};_0x120184[_0x0d7d('0x3a')]=_[_0x0d7d('0x3d')](_0x120184['where'],_0x8cddb2);}_0x120184=_[_0x0d7d('0x3d')]({},_0x120184,_0x4092b4[_0x0d7d('0x3f')]);return _0x32aac4[_0x0d7d('0x59')](_0x120184);}})[_0x0d7d('0x27')](function(_0x528db6){if(_0x528db6){_0x47fe13=_0x528db6['length'];if(!_0x4092b4[_0x0d7d('0x33')][_0x0d7d('0x38')](_0x0d7d('0x56'))){_0x120184['limit']=qs['limit'](_0x4092b4[_0x0d7d('0x33')][_0x0d7d('0x21')]);_0x120184['offset']=qs[_0x0d7d('0x20')](_0x4092b4['query']['offset']);}return _0x32aac4[_0x0d7d('0x59')](_0x120184);}})[_0x0d7d('0x27')](function(_0x4115bf){if(_0x4115bf){return _0x4115bf?{'count':_0x47fe13,'rows':_0x4115bf}:null;}})['then'](respondWithResult(_0x2b811c,null))[_0x0d7d('0x44')](handleError(_0x2b811c,null));}; \ No newline at end of file +var _0x57d5=['socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','ChatGroup','includeAll','include','findAll','rows','show','params','length','create','body','catch','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','order','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x217b9a,_0x98b246){var _0x1dee36=function(_0x5a3968){while(--_0x5a3968){_0x217b9a['push'](_0x217b9a['shift']());}};_0x1dee36(++_0x98b246);}(_0x57d5,0x18a));var _0x557d=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x57d5[_0x2f5a22];return _0x326b70;};'use strict';var emlformat=require(_0x557d('0x0'));var rimraf=require(_0x557d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x557d('0x2'));var rp=require(_0x557d('0x3'));var moment=require(_0x557d('0x4'));var BPromise=require(_0x557d('0x5'));var Mustache=require(_0x557d('0x6'));var util=require('util');var path=require(_0x557d('0x7'));var sox=require(_0x557d('0x8'));var csv=require(_0x557d('0x9'));var ejs=require(_0x557d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x557d('0xb'));var squel=require(_0x557d('0xc'));var crypto=require(_0x557d('0xd'));var jsforce=require(_0x557d('0xe'));var deskjs=require(_0x557d('0xf'));var toCsv=require(_0x557d('0x9'));var querystring=require(_0x557d('0x10'));var Papa=require('papaparse');var Redis=require(_0x557d('0x11'));var authService=require(_0x557d('0x12'));var qs=require(_0x557d('0x13'));var as=require(_0x557d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x557d('0x15'))(_0x557d('0x16'));var utils=require(_0x557d('0x17'));var config=require(_0x557d('0x18'));var licenseUtil=require(_0x557d('0x19'));var db=require(_0x557d('0x1a'))['db'];config[_0x557d('0x1b')]=_[_0x557d('0x1c')](config['redis'],{'host':_0x557d('0x1d'),'port':0x18eb});var socket=require(_0x557d('0x1e'))(new Redis(config['redis']));require(_0x557d('0x1f'))[_0x557d('0x20')](socket);function respondWithStatusCode(_0x55fa24,_0x1b7353){_0x1b7353=_0x1b7353||0xcc;return function(_0x3d150a){if(_0x3d150a){return _0x55fa24[_0x557d('0x21')](_0x1b7353);}return _0x55fa24[_0x557d('0x22')](_0x1b7353)[_0x557d('0x23')]();};}function respondWithResult(_0x38624b,_0x366dc1){_0x366dc1=_0x366dc1||0xc8;return function(_0x352b13){if(_0x352b13){return _0x38624b[_0x557d('0x22')](_0x366dc1)[_0x557d('0x24')](_0x352b13);}};}function respondWithFilteredResult(_0x4bb682,_0x16abec){return function(_0x480a7c){if(_0x480a7c){var _0x4ce2a2=typeof _0x16abec[_0x557d('0x25')]===_0x557d('0x26')&&typeof _0x16abec[_0x557d('0x27')]==='undefined';var _0x4e0536=_0x480a7c[_0x557d('0x28')];var _0x38055f=_0x4ce2a2?0x0:_0x16abec[_0x557d('0x25')];var _0x39aeab=_0x4ce2a2?_0x480a7c[_0x557d('0x28')]:_0x16abec['offset']+_0x16abec[_0x557d('0x27')];var _0x59f9b2;if(_0x39aeab>=_0x4e0536){_0x39aeab=_0x4e0536;_0x59f9b2=0xc8;}else{_0x59f9b2=0xce;}_0x4bb682[_0x557d('0x22')](_0x59f9b2);return _0x4bb682[_0x557d('0x29')]('Content-Range',_0x38055f+'-'+_0x39aeab+'/'+_0x4e0536)[_0x557d('0x24')](_0x480a7c);}return null;};}function patchUpdates(_0x33c988){return function(_0x2b8a99){try{jsonpatch[_0x557d('0x2a')](_0x2b8a99,_0x33c988,!![]);}catch(_0x31bab2){return BPromise[_0x557d('0x2b')](_0x31bab2);}return _0x2b8a99[_0x557d('0x2c')]();};}function saveUpdates(_0x1a4f4b,_0x27d8e2){return function(_0x573fcd){if(_0x573fcd){return _0x573fcd[_0x557d('0x2d')](_0x1a4f4b)[_0x557d('0x2e')](function(_0x39f973){return _0x39f973;});}return null;};}function removeEntity(_0x24923c,_0x691a1e){return function(_0x2130d6){if(_0x2130d6){return _0x2130d6[_0x557d('0x2f')]()[_0x557d('0x2e')](function(){_0x24923c[_0x557d('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fd106,_0x1e53cf){return function(_0x2cace7){if(!_0x2cace7){_0x1fd106['sendStatus'](0x194);}return _0x2cace7;};}function handleError(_0x955db,_0x403482){_0x403482=_0x403482||0x1f4;return function(_0xba08c4){logger[_0x557d('0x30')](_0xba08c4[_0x557d('0x31')]);if(_0xba08c4[_0x557d('0x32')]){delete _0xba08c4[_0x557d('0x32')];}_0x955db[_0x557d('0x22')](_0x403482)[_0x557d('0x33')](_0xba08c4);};}exports[_0x557d('0x34')]=function(_0x2c11a0,_0x29be23){var _0x45ec6e={},_0x513728={},_0x327d8={'count':0x0,'rows':[]};var _0x40ef15=_['map'](db['ChatGroup']['rawAttributes'],function(_0x34fbab){return{'name':_0x34fbab[_0x557d('0x35')],'type':_0x34fbab[_0x557d('0x36')][_0x557d('0x37')]};});_0x513728[_0x557d('0x38')]=_[_0x557d('0x39')](_0x40ef15,_0x557d('0x32'));_0x513728[_0x557d('0x3a')]=_[_0x557d('0x3b')](_0x2c11a0[_0x557d('0x3a')]);_0x513728['filters']=_[_0x557d('0x3c')](_0x513728[_0x557d('0x38')],_0x513728[_0x557d('0x3a')]);_0x45ec6e[_0x557d('0x3d')]=_['intersection'](_0x513728[_0x557d('0x38')],qs['fields'](_0x2c11a0['query'][_0x557d('0x3e')]));_0x45ec6e[_0x557d('0x3d')]=_0x45ec6e[_0x557d('0x3d')]['length']?_0x45ec6e[_0x557d('0x3d')]:_0x513728[_0x557d('0x38')];if(!_0x2c11a0[_0x557d('0x3a')][_0x557d('0x3f')](_0x557d('0x40'))){_0x45ec6e[_0x557d('0x27')]=qs[_0x557d('0x27')](_0x2c11a0[_0x557d('0x3a')][_0x557d('0x27')]);_0x45ec6e['offset']=qs[_0x557d('0x25')](_0x2c11a0[_0x557d('0x3a')][_0x557d('0x25')]);}_0x45ec6e['order']=qs[_0x557d('0x41')](_0x2c11a0[_0x557d('0x3a')][_0x557d('0x41')]);_0x45ec6e[_0x557d('0x42')]=qs[_0x557d('0x43')](_[_0x557d('0x44')](_0x2c11a0['query'],_0x513728[_0x557d('0x43')]),_0x40ef15);if(_0x2c11a0[_0x557d('0x3a')]['filter']){_0x45ec6e[_0x557d('0x42')]=_[_0x557d('0x45')](_0x45ec6e[_0x557d('0x42')],{'$or':_['map'](_0x40ef15,function(_0x577dec){if(_0x577dec['type']!==_0x557d('0x46')){var _0x192681={};_0x192681[_0x577dec[_0x557d('0x32')]]={'$like':'%'+_0x2c11a0['query'][_0x557d('0x47')]+'%'};return _0x192681;}})});}_0x45ec6e=_[_0x557d('0x45')]({},_0x45ec6e,_0x2c11a0[_0x557d('0x48')]);var _0x233623={'where':_0x45ec6e[_0x557d('0x42')]};return db[_0x557d('0x49')]['count'](_0x233623)[_0x557d('0x2e')](function(_0x52ca7f){_0x327d8[_0x557d('0x28')]=_0x52ca7f;if(_0x2c11a0[_0x557d('0x3a')][_0x557d('0x4a')]){_0x45ec6e[_0x557d('0x4b')]=[{'all':!![]}];}return db['ChatGroup'][_0x557d('0x4c')](_0x45ec6e);})[_0x557d('0x2e')](function(_0x80198a){_0x327d8[_0x557d('0x4d')]=_0x80198a;return _0x327d8;})[_0x557d('0x2e')](respondWithFilteredResult(_0x29be23,_0x45ec6e))['catch'](handleError(_0x29be23,null));};exports[_0x557d('0x4e')]=function(_0x1cbaa9,_0x3a6438){var _0x433389={'raw':!![],'where':{'id':_0x1cbaa9[_0x557d('0x4f')]['id']}},_0x315589={};_0x315589[_0x557d('0x38')]=_[_0x557d('0x3b')](db['ChatGroup']['rawAttributes']);_0x315589['query']=_[_0x557d('0x3b')](_0x1cbaa9[_0x557d('0x3a')]);_0x315589[_0x557d('0x43')]=_[_0x557d('0x3c')](_0x315589[_0x557d('0x38')],_0x315589[_0x557d('0x3a')]);_0x433389[_0x557d('0x3d')]=_[_0x557d('0x3c')](_0x315589[_0x557d('0x38')],qs[_0x557d('0x3e')](_0x1cbaa9['query'][_0x557d('0x3e')]));_0x433389[_0x557d('0x3d')]=_0x433389[_0x557d('0x3d')][_0x557d('0x50')]?_0x433389[_0x557d('0x3d')]:_0x315589[_0x557d('0x38')];if(_0x1cbaa9[_0x557d('0x3a')][_0x557d('0x4a')]){_0x433389['include']=[{'all':!![]}];}_0x433389=_[_0x557d('0x45')]({},_0x433389,_0x1cbaa9[_0x557d('0x48')]);return db[_0x557d('0x49')]['find'](_0x433389)[_0x557d('0x2e')](handleEntityNotFound(_0x3a6438,null))[_0x557d('0x2e')](respondWithResult(_0x3a6438,null))['catch'](handleError(_0x3a6438,null));};exports[_0x557d('0x51')]=function(_0x272ce3,_0x5acb71){return db[_0x557d('0x49')][_0x557d('0x51')](_0x272ce3[_0x557d('0x52')],{})[_0x557d('0x2e')](respondWithResult(_0x5acb71,0xc9))[_0x557d('0x53')](handleError(_0x5acb71,null));};exports[_0x557d('0x2d')]=function(_0x3c3bcd,_0x46c2c1){if(_0x3c3bcd['body']['id']){delete _0x3c3bcd[_0x557d('0x52')]['id'];}return db[_0x557d('0x49')]['find']({'where':{'id':_0x3c3bcd[_0x557d('0x4f')]['id']}})[_0x557d('0x2e')](handleEntityNotFound(_0x46c2c1,null))[_0x557d('0x2e')](saveUpdates(_0x3c3bcd[_0x557d('0x52')],null))[_0x557d('0x2e')](respondWithResult(_0x46c2c1,null))[_0x557d('0x53')](handleError(_0x46c2c1,null));};exports[_0x557d('0x2f')]=function(_0x5b9390,_0xc030fd){return db['ChatGroup'][_0x557d('0x54')]({'where':{'id':_0x5b9390[_0x557d('0x4f')]['id']}})[_0x557d('0x2e')](handleEntityNotFound(_0xc030fd,null))['then'](removeEntity(_0xc030fd,null))['catch'](handleError(_0xc030fd,null));};exports[_0x557d('0x55')]=function(_0x459ba0,_0xa3b77){return db['ChatGroup'][_0x557d('0x55')]()[_0x557d('0x2e')](respondWithResult(_0xa3b77,null))[_0x557d('0x53')](handleError(_0xa3b77,null));};exports[_0x557d('0x56')]=function(_0x2b2e85,_0x4557b5,_0x4f2421){return db[_0x557d('0x57')][_0x557d('0x28')]({'where':{'ChatGroupId':_0x2b2e85[_0x557d('0x4f')]['id'],'ToId':_0x2b2e85[_0x557d('0x58')]['id'],'read':![]}})[_0x557d('0x2e')](function(_0x47599b){return{'id':_[_0x557d('0x59')](_0x2b2e85[_0x557d('0x4f')]['id']),'count':_0x47599b};})[_0x557d('0x2e')](respondWithResult(_0x4557b5,null))[_0x557d('0x53')](handleError(_0x4557b5,null));};exports[_0x557d('0x5a')]=function(_0x4ea903,_0x1a475b,_0x2139aa){return db[_0x557d('0x49')][_0x557d('0x54')]({'where':{'id':_0x4ea903[_0x557d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a475b,null))[_0x557d('0x2e')](function(_0x52422c){if(_0x52422c){return _0x52422c[_0x557d('0x5a')](_0x4ea903[_0x557d('0x52')][_0x557d('0x5b')],_[_0x557d('0x5c')](_0x4ea903['body'],[_0x557d('0x5b'),'id'])||{});}})[_0x557d('0x2e')](respondWithResult(_0x1a475b,null))[_0x557d('0x53')](handleError(_0x1a475b,null));};exports[_0x557d('0x5d')]=function(_0x10de13,_0x11cbf0,_0x358ec3){var _0x5204d8={};var _0xbff570={};var _0x115aec;var _0x4b61b6;return db['ChatGroup'][_0x557d('0x5e')]({'where':{'id':_0x10de13[_0x557d('0x4f')]['id']}})[_0x557d('0x2e')](handleEntityNotFound(_0x11cbf0,null))[_0x557d('0x2e')](function(_0x37b4cc){if(_0x37b4cc){_0x115aec=_0x37b4cc;_0xbff570[_0x557d('0x38')]=_[_0x557d('0x3b')](db[_0x557d('0x5f')][_0x557d('0x60')]);_0xbff570['query']=_['keys'](_0x10de13[_0x557d('0x3a')]);_0xbff570[_0x557d('0x43')]=_[_0x557d('0x3c')](_0xbff570[_0x557d('0x38')],_0xbff570[_0x557d('0x3a')]);_0x5204d8[_0x557d('0x3d')]=_['intersection'](_0xbff570[_0x557d('0x38')],qs[_0x557d('0x3e')](_0x10de13[_0x557d('0x3a')]['fields']));_0x5204d8[_0x557d('0x3d')]=_0x5204d8[_0x557d('0x3d')][_0x557d('0x50')]?_0x5204d8['attributes']:_0xbff570[_0x557d('0x38')];_0x5204d8[_0x557d('0x61')]=qs['sort'](_0x10de13[_0x557d('0x3a')][_0x557d('0x41')]);_0x5204d8[_0x557d('0x42')]=qs['filters'](_[_0x557d('0x44')](_0x10de13[_0x557d('0x3a')],_0xbff570[_0x557d('0x43')]));if(_0x10de13['query'][_0x557d('0x47')]){_0x5204d8[_0x557d('0x42')]=_['merge'](_0x5204d8[_0x557d('0x42')],{'$or':_[_0x557d('0x39')](_0x5204d8['attributes'],function(_0x572fd1){var _0x1e9a34={};_0x1e9a34[_0x572fd1]={'$like':'%'+_0x10de13[_0x557d('0x3a')][_0x557d('0x47')]+'%'};return _0x1e9a34;})});}_0x5204d8=_[_0x557d('0x45')]({},_0x5204d8,_0x10de13[_0x557d('0x48')]);return _0x115aec['getMembers'](_0x5204d8);}})[_0x557d('0x2e')](function(_0x9eaab5){if(_0x9eaab5){_0x4b61b6=_0x9eaab5['length'];if(!_0x10de13['query'][_0x557d('0x3f')](_0x557d('0x40'))){_0x5204d8[_0x557d('0x27')]=qs[_0x557d('0x27')](_0x10de13[_0x557d('0x3a')][_0x557d('0x27')]);_0x5204d8[_0x557d('0x25')]=qs['offset'](_0x10de13[_0x557d('0x3a')][_0x557d('0x25')]);}return _0x115aec[_0x557d('0x5d')](_0x5204d8);}})[_0x557d('0x2e')](function(_0x5157f6){if(_0x5157f6){return _0x5157f6?{'count':_0x4b61b6,'rows':_0x5157f6}:null;}})[_0x557d('0x2e')](respondWithResult(_0x11cbf0,null))[_0x557d('0x53')](handleError(_0x11cbf0,null));};exports[_0x557d('0x62')]=function(_0x26541a,_0x4a9bfb,_0x36038e){return db[_0x557d('0x49')][_0x557d('0x54')]({'where':{'id':_0x26541a[_0x557d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a9bfb,null))[_0x557d('0x2e')](function(_0x223f48){if(_0x223f48){return _0x223f48[_0x557d('0x62')](_0x26541a[_0x557d('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x4a9bfb,null))[_0x557d('0x53')](handleError(_0x4a9bfb,null));};exports[_0x557d('0x63')]=function(_0x38d8f5,_0x20fd4c,_0xcaf442){if(_0x38d8f5['body']['id']){delete _0x38d8f5['body']['id'];}return db[_0x557d('0x49')]['find']({'where':{'id':_0x38d8f5[_0x557d('0x4f')]['id']}})[_0x557d('0x2e')](handleEntityNotFound(_0x20fd4c,null))[_0x557d('0x2e')](function(_0x3a46bd){if(_0x3a46bd){_0x38d8f5[_0x557d('0x52')][_0x557d('0x64')]=_0x3a46bd['id'];return db[_0x557d('0x57')][_0x557d('0x51')](_0x38d8f5[_0x557d('0x52')]);}})['then'](respondWithResult(_0x20fd4c,null))[_0x557d('0x53')](handleError(_0x20fd4c,null));};exports[_0x557d('0x65')]=function(_0x34cb9f,_0x40408d,_0x2d4db2){var _0x44333b={};var _0x3bf9bb={};var _0x3f8524;var _0x2bf91f;return db[_0x557d('0x49')][_0x557d('0x5e')]({'where':{'id':_0x34cb9f[_0x557d('0x4f')]['id']}})[_0x557d('0x2e')](handleEntityNotFound(_0x40408d,null))[_0x557d('0x2e')](function(_0x12ddc4){if(_0x12ddc4){_0x3f8524=_0x12ddc4;_0x3bf9bb[_0x557d('0x38')]=_[_0x557d('0x3b')](db['ChatInternalMessage']['rawAttributes']);_0x3bf9bb['query']=_[_0x557d('0x3b')](_0x34cb9f[_0x557d('0x3a')]);_0x3bf9bb[_0x557d('0x43')]=_[_0x557d('0x3c')](_0x3bf9bb[_0x557d('0x38')],_0x3bf9bb[_0x557d('0x3a')]);_0x44333b[_0x557d('0x3d')]=_[_0x557d('0x3c')](_0x3bf9bb[_0x557d('0x38')],qs['fields'](_0x34cb9f[_0x557d('0x3a')]['fields']));_0x44333b['attributes']=_0x44333b['attributes'][_0x557d('0x50')]?_0x44333b[_0x557d('0x3d')]:_0x3bf9bb['model'];_0x44333b[_0x557d('0x61')]=qs[_0x557d('0x41')](_0x34cb9f[_0x557d('0x3a')][_0x557d('0x41')]);_0x44333b[_0x557d('0x42')]=qs[_0x557d('0x43')](_['pick'](_0x34cb9f['query'],_0x3bf9bb[_0x557d('0x43')]));if(_0x34cb9f[_0x557d('0x3a')][_0x557d('0x47')]){_0x44333b[_0x557d('0x42')]=_[_0x557d('0x45')](_0x44333b[_0x557d('0x42')],{'$or':_[_0x557d('0x39')](_0x44333b['attributes'],function(_0xe67014){var _0x3d60a9={};_0x3d60a9[_0xe67014]={'$like':'%'+_0x34cb9f[_0x557d('0x3a')][_0x557d('0x47')]+'%'};return _0x3d60a9;})});}if(_0x34cb9f[_0x557d('0x3a')]['$gte']){var _0x3eb10f=_0x34cb9f[_0x557d('0x3a')][_0x557d('0x66')][_0x557d('0x67')](',');var _0x49fe12={};_0x49fe12[_0x3eb10f[0x0]]={'$gte':moment(_0x3eb10f[0x1])[_0x557d('0x68')](_0x557d('0x69'))};_0x44333b['where']=_[_0x557d('0x45')](_0x44333b[_0x557d('0x42')],_0x49fe12);}_0x44333b=_[_0x557d('0x45')]({},_0x44333b,_0x34cb9f['options']);return _0x3f8524['getMessages'](_0x44333b);}})[_0x557d('0x2e')](function(_0x57d713){if(_0x57d713){_0x2bf91f=_0x57d713[_0x557d('0x50')];if(!_0x34cb9f[_0x557d('0x3a')][_0x557d('0x3f')]('nolimit')){_0x44333b[_0x557d('0x27')]=qs['limit'](_0x34cb9f[_0x557d('0x3a')][_0x557d('0x27')]);_0x44333b[_0x557d('0x25')]=qs['offset'](_0x34cb9f[_0x557d('0x3a')][_0x557d('0x25')]);}return _0x3f8524[_0x557d('0x65')](_0x44333b);}})[_0x557d('0x2e')](function(_0x34b3cd){if(_0x34b3cd){return _0x34b3cd?{'count':_0x2bf91f,'rows':_0x34b3cd}:null;}})['then'](respondWithResult(_0x40408d,null))[_0x557d('0x53')](handleError(_0x40408d,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6cc8afd..458a83d 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 _0xa105=['events','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0xa105,0xd8));var _0x5a10=function(_0x4578ef,_0x1abb6b){_0x4578ef=_0x4578ef-0x0;var _0x2106ec=_0xa105[_0x4578ef];return _0x2106ec;};'use strict';var EventEmitter=require(_0x5a10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x5a10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5a10('0x2')](0x0);var events={'afterCreate':_0x5a10('0x3'),'afterUpdate':'update','afterDestroy':_0x5a10('0x4')};function emitEvent(_0xa6fca1){return function(_0x11e784,_0x307748,_0x491022){ChatGroupEvents[_0x5a10('0x5')](_0xa6fca1+':'+_0x11e784['id'],_0x11e784);ChatGroupEvents[_0x5a10('0x5')](_0xa6fca1,_0x11e784);_0x491022(null);};}for(var e in events){if(events[_0x5a10('0x6')](e)){var event=events[e];ChatGroup[_0x5a10('0x7')](e,emitEvent(event));}}module[_0x5a10('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x9134=['hook','exports','../../mysqldb','ChatGroup','setMaxListeners','save','emit'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9134,0x87));var _0x4913=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9134[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x4913('0x0'))['db'][_0x4913('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4913('0x2')](0x0);var events={'afterCreate':_0x4913('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x352f58){return function(_0x488795,_0x367836,_0x349c8c){ChatGroupEvents[_0x4913('0x4')](_0x352f58+':'+_0x488795['id'],_0x488795);ChatGroupEvents[_0x4913('0x4')](_0x352f58,_0x488795);_0x349c8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4913('0x5')](e,emitEvent(event));}}module[_0x4913('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 174bd51..2d85c73 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 _0x0941=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define','chat_groups'];(function(_0xe6cbf9,_0x6123c2){var _0x172772=function(_0x32ca7d){while(--_0x32ca7d){_0xe6cbf9['push'](_0xe6cbf9['shift']());}};_0x172772(++_0x6123c2);}(_0x0941,0x1e0));var _0x1094=function(_0x58f9e7,_0x26e8b0){_0x58f9e7=_0x58f9e7-0x0;var _0x5b77e0=_0x0941[_0x58f9e7];return _0x5b77e0;};'use strict';var _=require(_0x1094('0x0'));var util=require(_0x1094('0x1'));var logger=require(_0x1094('0x2'))(_0x1094('0x3'));var moment=require(_0x1094('0x4'));var BPromise=require(_0x1094('0x5'));var rp=require(_0x1094('0x6'));var fs=require('fs');var path=require(_0x1094('0x7'));var rimraf=require(_0x1094('0x8'));var config=require('../../config/environment');var attributes=require(_0x1094('0x9'));module['exports']=function(_0x254c6d,_0x35ba30){return _0x254c6d[_0x1094('0xa')]('ChatGroup',attributes,{'tableName':_0x1094('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcfb=['lodash','../../config/logger','api','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x2644f8,_0x40977c){var _0x233fea=function(_0x308f49){while(--_0x308f49){_0x2644f8['push'](_0x2644f8['shift']());}};_0x233fea(++_0x40977c);}(_0xfcfb,0x120));var _0xbfcf=function(_0x33b685,_0x43e6f4){_0x33b685=_0x33b685-0x0;var _0x1d11ee=_0xfcfb[_0x33b685];return _0x1d11ee;};'use strict';var _=require(_0xbfcf('0x0'));var util=require('util');var logger=require(_0xbfcf('0x1'))(_0xbfcf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbfcf('0x3'));var fs=require('fs');var path=require(_0xbfcf('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbfcf('0x5'));module[_0xbfcf('0x6')]=function(_0x26e582,_0x4b4d46){return _0x26e582[_0xbfcf('0x7')](_0xbfcf('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 806b790..6371d65 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 _0xa261=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash'];(function(_0x439d1e,_0x1ab881){var _0x5df5ad=function(_0x1dade6){while(--_0x1dade6){_0x439d1e['push'](_0x439d1e['shift']());}};_0x5df5ad(++_0x1ab881);}(_0xa261,0x1a3));var _0x1a26=function(_0x15123f,_0xc0be83){_0x15123f=_0x15123f-0x0;var _0x196c6e=_0xa261[_0x15123f];return _0x196c6e;};'use strict';var _=require(_0x1a26('0x0'));var util=require('util');var moment=require(_0x1a26('0x1'));var BPromise=require(_0x1a26('0x2'));var rs=require(_0x1a26('0x3'));var fs=require('fs');var Redis=require(_0x1a26('0x4'));var db=require(_0x1a26('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1a26('0x6'));var jayson=require(_0x1a26('0x7'));var client=jayson[_0x1a26('0x8')][_0x1a26('0x9')]({'port':0x232a});config[_0x1a26('0xa')]=_['defaults'](config[_0x1a26('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a26('0xb'))(new Redis(config[_0x1a26('0xa')]));require(_0x1a26('0xc'))['register'](socket);function respondWithRpcPromise(_0x1abb20,_0x9bd619,_0x284113){return new BPromise(function(_0xf7bbf8,_0x306670){return client['request'](_0x1abb20,_0x284113)[_0x1a26('0xd')](function(_0x1bf4fe){logger[_0x1a26('0xe')](_0x1a26('0xf'),_0x9bd619,_0x1a26('0x10'));logger[_0x1a26('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x9bd619,_0x1a26('0x10'),JSON['stringify'](_0x1bf4fe));if(_0x1bf4fe[_0x1a26('0x12')]){if(_0x1bf4fe[_0x1a26('0x12')][_0x1a26('0x13')]===0x1f4){logger['error'](_0x1a26('0xf'),_0x9bd619,_0x1bf4fe[_0x1a26('0x12')][_0x1a26('0x14')]);return _0x306670(_0x1bf4fe[_0x1a26('0x12')][_0x1a26('0x14')]);}logger['error'](_0x1a26('0xf'),_0x9bd619,_0x1bf4fe[_0x1a26('0x12')][_0x1a26('0x14')]);return _0xf7bbf8(_0x1bf4fe[_0x1a26('0x12')][_0x1a26('0x14')]);}else{logger[_0x1a26('0xe')]('ChatGroup,\x20%s,\x20%s',_0x9bd619,_0x1a26('0x10'));_0xf7bbf8(_0x1bf4fe['result']['message']);}})['catch'](function(_0x536101){logger[_0x1a26('0x12')](_0x1a26('0xf'),_0x9bd619,_0x536101);_0x306670(_0x536101);});});} \ No newline at end of file +var _0x8558=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x571d29,_0x3563ec){var _0x369217=function(_0x5cb831){while(--_0x5cb831){_0x571d29['push'](_0x571d29['shift']());}};_0x369217(++_0x3563ec);}(_0x8558,0x103));var _0x8855=function(_0x474733,_0x17af29){_0x474733=_0x474733-0x0;var _0x4393a3=_0x8558[_0x474733];return _0x4393a3;};'use strict';var _=require('lodash');var util=require(_0x8855('0x0'));var moment=require(_0x8855('0x1'));var BPromise=require(_0x8855('0x2'));var rs=require(_0x8855('0x3'));var fs=require('fs');var Redis=require(_0x8855('0x4'));var db=require(_0x8855('0x5'))['db'];var utils=require(_0x8855('0x6'));var logger=require('../../config/logger')(_0x8855('0x7'));var config=require('../../config/environment');var jayson=require(_0x8855('0x8'));var client=jayson['client'][_0x8855('0x9')]({'port':0x232a});config[_0x8855('0xa')]=_[_0x8855('0xb')](config[_0x8855('0xa')],{'host':_0x8855('0xc'),'port':0x18eb});var socket=require(_0x8855('0xd'))(new Redis(config[_0x8855('0xa')]));require('./chatGroup.socket')[_0x8855('0xe')](socket);function respondWithRpcPromise(_0x1eb46e,_0x1713b9,_0xe2cb98){return new BPromise(function(_0x2d9d08,_0x2e1cd8){return client[_0x8855('0xf')](_0x1eb46e,_0xe2cb98)[_0x8855('0x10')](function(_0x53da3b){logger[_0x8855('0x11')](_0x8855('0x12'),_0x1713b9,'request\x20sent');logger[_0x8855('0x13')](_0x8855('0x14'),_0x1713b9,'request\x20sent',JSON[_0x8855('0x15')](_0x53da3b));if(_0x53da3b[_0x8855('0x16')]){if(_0x53da3b[_0x8855('0x16')][_0x8855('0x17')]===0x1f4){logger['error'](_0x8855('0x12'),_0x1713b9,_0x53da3b['error'][_0x8855('0x18')]);return _0x2e1cd8(_0x53da3b['error'][_0x8855('0x18')]);}logger[_0x8855('0x16')](_0x8855('0x12'),_0x1713b9,_0x53da3b[_0x8855('0x16')]['message']);return _0x2d9d08(_0x53da3b[_0x8855('0x16')]['message']);}else{logger[_0x8855('0x11')](_0x8855('0x12'),_0x1713b9,'request\x20sent');_0x2d9d08(_0x53da3b[_0x8855('0x19')][_0x8855('0x18')]);}})['catch'](function(_0x1b1b79){logger[_0x8855('0x16')]('ChatGroup,\x20%s,\x20%s',_0x1713b9,_0x1b1b79);_0x2e1cd8(_0x1b1b79);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f3be09d..e5072f3 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 _0x0df9=['emit','removeListener','register','chatGroup:','./chatGroup.events','remove','update'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x0df9,0x170));var _0x90df=function(_0x3ee096,_0xc7d961){_0x3ee096=_0x3ee096-0x0;var _0x193966=_0x0df9[_0x3ee096];return _0x193966;};'use strict';var ChatGroupEvents=require(_0x90df('0x0'));var events=['save',_0x90df('0x1'),_0x90df('0x2')];function createListener(_0x5a1f28,_0x3f0fd3){return function(_0x1ff359){_0x3f0fd3[_0x90df('0x3')](_0x5a1f28,_0x1ff359);};}function removeListener(_0x715755,_0x2bfaee){return function(){ChatGroupEvents[_0x90df('0x4')](_0x715755,_0x2bfaee);};}exports[_0x90df('0x5')]=function(_0x65a4f1){for(var _0x3aa0ab=0x0,_0x2fc700=events['length'];_0x3aa0ab<_0x2fc700;_0x3aa0ab++){var _0x5ccd23=events[_0x3aa0ab];var _0x36c766=createListener(_0x90df('0x6')+_0x5ccd23,_0x65a4f1);ChatGroupEvents['on'](_0x5ccd23,_0x36c766);}}; \ No newline at end of file +var _0x596b=['register','length','chatGroup:','save','remove','update','emit','removeListener'];(function(_0x92a987,_0x4415b6){var _0x331f4c=function(_0x223e9d){while(--_0x223e9d){_0x92a987['push'](_0x92a987['shift']());}};_0x331f4c(++_0x4415b6);}(_0x596b,0x1d3));var _0xb596=function(_0x16d9eb,_0x5d5921){_0x16d9eb=_0x16d9eb-0x0;var _0x16f48d=_0x596b[_0x16d9eb];return _0x16f48d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xb596('0x0'),_0xb596('0x1'),_0xb596('0x2')];function createListener(_0x3f994e,_0x4742d4){return function(_0x344f46){_0x4742d4[_0xb596('0x3')](_0x3f994e,_0x344f46);};}function removeListener(_0x39e674,_0x450460){return function(){ChatGroupEvents[_0xb596('0x4')](_0x39e674,_0x450460);};}exports[_0xb596('0x5')]=function(_0x59b4d8){for(var _0x4882d2=0x0,_0x473861=events[_0xb596('0x6')];_0x4882d2<_0x473861;_0x4882d2++){var _0x102d9c=events[_0x4882d2];var _0x25a166=createListener(_0xb596('0x7')+_0x102d9c,_0x59b4d8);ChatGroupEvents['on'](_0x102d9c,_0x25a166);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index fa04737..ab74387 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 _0x624a=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','removeMembers','util','path','connect-timeout'];(function(_0x24e507,_0x250931){var _0x588429=function(_0x4874d4){while(--_0x4874d4){_0x24e507['push'](_0x24e507['shift']());}};_0x588429(++_0x250931);}(_0x624a,0xf0));var _0xa624=function(_0x112929,_0x7da466){_0x112929=_0x112929-0x0;var _0x333c16=_0x624a[_0x112929];return _0x333c16;};'use strict';var multer=require('multer');var util=require(_0xa624('0x0'));var path=require(_0xa624('0x1'));var timeout=require(_0xa624('0x2'));var express=require('express');var router=express[_0xa624('0x3')]();var fs_extra=require(_0xa624('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa624('0x5'));var config=require(_0xa624('0x6'));var controller=require(_0xa624('0x7'));router[_0xa624('0x8')]('/',auth[_0xa624('0x9')](),controller[_0xa624('0xa')]);router['get'](_0xa624('0xb'),auth['isAuthenticated'](),controller[_0xa624('0xc')]);router[_0xa624('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa624('0xd')]);router[_0xa624('0x8')](_0xa624('0xe'),auth['isAuthenticated'](),controller[_0xa624('0xf')]);router[_0xa624('0x8')](_0xa624('0x10'),auth[_0xa624('0x9')](),controller['getMembers']);router[_0xa624('0x8')](_0xa624('0x11'),auth[_0xa624('0x9')](),controller[_0xa624('0x12')]);router[_0xa624('0x13')]('/',auth['isAuthenticated'](),controller[_0xa624('0x14')]);router[_0xa624('0x13')]('/:id/members',auth[_0xa624('0x9')](),controller[_0xa624('0x15')]);router[_0xa624('0x13')](_0xa624('0x11'),auth['isAuthenticated'](),controller[_0xa624('0x16')]);router[_0xa624('0x17')]('/:id',auth[_0xa624('0x9')](),controller[_0xa624('0x18')]);router[_0xa624('0x19')]('/:id',auth[_0xa624('0x9')](),controller['destroy']);router[_0xa624('0x19')]('/:id/members',auth[_0xa624('0x9')](),controller[_0xa624('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x3bde=['delete','removeMembers','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','update','destroy'];(function(_0x4997c1,_0x3e48b6){var _0x223fad=function(_0x17743b){while(--_0x17743b){_0x4997c1['push'](_0x4997c1['shift']());}};_0x223fad(++_0x3e48b6);}(_0x3bde,0x1e8));var _0xe3bd=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x3bde[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0xe3bd('0x0'));var util=require(_0xe3bd('0x1'));var path=require(_0xe3bd('0x2'));var timeout=require(_0xe3bd('0x3'));var express=require(_0xe3bd('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe3bd('0x5'));var interaction=require(_0xe3bd('0x6'));var config=require(_0xe3bd('0x7'));var controller=require('./chatGroup.controller');router[_0xe3bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe3bd('0x9')]);router[_0xe3bd('0x8')](_0xe3bd('0xa'),auth[_0xe3bd('0xb')](),controller[_0xe3bd('0xc')]);router['get'](_0xe3bd('0xd'),auth['isAuthenticated'](),controller[_0xe3bd('0xe')]);router[_0xe3bd('0x8')]('/:id/unread',auth[_0xe3bd('0xb')](),controller[_0xe3bd('0xf')]);router['get'](_0xe3bd('0x10'),auth[_0xe3bd('0xb')](),controller[_0xe3bd('0x11')]);router[_0xe3bd('0x8')](_0xe3bd('0x12'),auth[_0xe3bd('0xb')](),controller[_0xe3bd('0x13')]);router[_0xe3bd('0x14')]('/',auth[_0xe3bd('0xb')](),controller['create']);router[_0xe3bd('0x14')](_0xe3bd('0x10'),auth[_0xe3bd('0xb')](),controller[_0xe3bd('0x15')]);router[_0xe3bd('0x14')](_0xe3bd('0x12'),auth['isAuthenticated'](),controller[_0xe3bd('0x16')]);router['put']('/:id',auth[_0xe3bd('0xb')](),controller[_0xe3bd('0x17')]);router['delete'](_0xe3bd('0xd'),auth[_0xe3bd('0xb')](),controller[_0xe3bd('0x18')]);router[_0xe3bd('0x19')](_0xe3bd('0x10'),auth[_0xe3bd('0xb')](),controller[_0xe3bd('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 7620ea0..cb7cc99 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 _0xa478=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x55875c,_0x2fc345){var _0xe56021=function(_0xf0d093){while(--_0xf0d093){_0x55875c['push'](_0x55875c['shift']());}};_0xe56021(++_0x2fc345);}(_0xa478,0x136));var _0x8a47=function(_0x4da3b6,_0x233aff){_0x4da3b6=_0x4da3b6-0x0;var _0x574d38=_0xa478[_0x4da3b6];return _0x574d38;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'closed':{'type':Sequelize[_0x8a47('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8a47('0x3')]},'ratingType':{'type':Sequelize[_0x8a47('0x4')](_0x8a47('0x5'),_0x8a47('0x6')),'defaultValue':_0x8a47('0x5')},'ratingMessage':{'type':Sequelize[_0x8a47('0x7')]},'pathTranscript':{'type':Sequelize[_0x8a47('0x7')]},'mailTranscript':{'type':Sequelize[_0x8a47('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8a47('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8a47('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8a47('0x8')]},'note':{'type':Sequelize[_0x8a47('0x8')]},'browserName':{'type':Sequelize[_0x8a47('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8a47('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x8a47('0x8')]},'deviceVendor':{'type':Sequelize[_0x8a47('0x8')]},'deviceType':{'type':Sequelize[_0x8a47('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x8a47('0x8')]},'formData':{'type':Sequelize[_0x8a47('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x8a47('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8a47('0x4')]('in',_0x8a47('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8a47('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7269=['star','thumb','TEXT','STRING','DATE','long','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7269,0x76));var _0x9726=function(_0x2a7a3d,_0x1845b9){_0x2a7a3d=_0x2a7a3d-0x0;var _0x34a93f=_0x7269[_0x2a7a3d];return _0x34a93f;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'closed':{'type':Sequelize[_0x9726('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x9726('0x3'),_0x9726('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9726('0x5')]},'pathTranscript':{'type':Sequelize[_0x9726('0x5')]},'mailTranscript':{'type':Sequelize[_0x9726('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9726('0x7')]},'disposition':{'type':Sequelize[_0x9726('0x6')]},'secondDisposition':{'type':Sequelize[_0x9726('0x6')]},'thirdDisposition':{'type':Sequelize[_0x9726('0x6')]},'note':{'type':Sequelize[_0x9726('0x6')]},'browserName':{'type':Sequelize[_0x9726('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x9726('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9726('0x6')]},'deviceVendor':{'type':Sequelize[_0x9726('0x6')]},'deviceType':{'type':Sequelize[_0x9726('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x9726('0x6')]},'formData':{'type':Sequelize[_0x9726('0x5')](_0x9726('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9726('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x9726('0x9')]('in',_0x9726('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9726('0x6')]},'customerPort':{'type':Sequelize[_0x9726('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4e8197a..bbd319a 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 _0x8042=['filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','user','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','vidaooNote','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','type','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ChatWebsite','ContactId','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','sort','where','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','hasOwnProperty','nolimit','pick','includeAgent','push','addTags','setTags','Tag','color','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','Owner','get','mkdirSync','Account','N.A.','closedAt','browserName','referer','customerIp','customerPort','pipe','createWriteStream','lastName','read','value','renderFile','views','transcript-','.pdf','Chat','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','sendStatus','stack','name','send','render','body','agent','interaction','account','index','rawAttributes','fieldName','key','getOptions','findAll','show','params','model','keys','ChatInteraction','query'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8042,0x157));var _0x2804=function(_0x34e0dd,_0x1bd86f){_0x34e0dd=_0x34e0dd-0x0;var _0x505d0c=_0x8042[_0x34e0dd];return _0x505d0c;};'use strict';var rimraf=require(_0x2804('0x0'));var zipdir=require(_0x2804('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2804('0x2'));var Mustache=require(_0x2804('0x3'));var util=require(_0x2804('0x4'));var path=require(_0x2804('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2804('0x6'));var Redis=require(_0x2804('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x2804('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x2804('0x9'))(_0x2804('0xa'));var config=require(_0x2804('0xb'));var db=require(_0x2804('0xc'))['db'];config[_0x2804('0xd')]=_[_0x2804('0xe')](config[_0x2804('0xd')],{'host':_0x2804('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2804('0x10'))[_0x2804('0x11')](socket);var jayson=require(_0x2804('0x12'));var client=jayson['client'][_0x2804('0x13')]({'port':0x232b});var client9004=jayson[_0x2804('0x14')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2e27e2,_0x3bbd93,_0x4e1f77,_0x55a551){return new BPromise(function(_0xdb4ad7,_0x417960){var _0x44be58=_0x55a551||client;return _0x44be58[_0x2804('0x15')](_0x2e27e2,_0x4e1f77)[_0x2804('0x16')](function(_0x1084c3){logger[_0x2804('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x3bbd93,_0x2804('0x18'));logger['debug'](_0x2804('0x19'),_0x3bbd93,'request\x20sent',JSON[_0x2804('0x1a')](_0x1084c3));if(_0x1084c3[_0x2804('0x1b')]){if(_0x1084c3[_0x2804('0x1b')][_0x2804('0x1c')]===0x1f4){logger[_0x2804('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x3bbd93,_0x1084c3['error'][_0x2804('0x1d')]);return _0x417960(_0x1084c3[_0x2804('0x1b')][_0x2804('0x1d')]);}logger[_0x2804('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x3bbd93,_0x1084c3[_0x2804('0x1b')]['message']);return _0xdb4ad7(_0x1084c3[_0x2804('0x1b')][_0x2804('0x1d')]);}else{logger[_0x2804('0x17')](_0x2804('0x1e'),_0x3bbd93,_0x2804('0x18'));_0xdb4ad7(_0x1084c3[_0x2804('0x1f')]['message']);}})[_0x2804('0x20')](function(_0x19f2d4){logger['error'](_0x2804('0x1e'),_0x3bbd93,_0x19f2d4);_0x417960(_0x19f2d4);});});}function respondWithStatusCode(_0x4ccb10,_0x47d153){_0x47d153=_0x47d153||0xcc;return function(_0x269542){if(_0x269542){return _0x4ccb10['sendStatus'](_0x47d153);}return _0x4ccb10[_0x2804('0x21')](_0x47d153)[_0x2804('0x22')]();};}function respondWithResult(_0x47e311,_0x44a7f7){_0x44a7f7=_0x44a7f7||0xc8;return function(_0x9eb499){if(_0x9eb499){return _0x47e311[_0x2804('0x21')](_0x44a7f7)[_0x2804('0x23')](_0x9eb499);}};}function respondWithFilteredResult(_0x391dbf,_0x30066d){return function(_0xaadc00){if(_0xaadc00){var _0x928981=typeof _0x30066d[_0x2804('0x24')]===_0x2804('0x25')&&typeof _0x30066d[_0x2804('0x26')]===_0x2804('0x25');var _0x4c1d94=_0xaadc00[_0x2804('0x27')];var _0x4f4e4c=_0x928981?0x0:_0x30066d[_0x2804('0x24')];var _0x248aee=_0x928981?_0xaadc00[_0x2804('0x27')]:_0x30066d[_0x2804('0x24')]+_0x30066d[_0x2804('0x26')];var _0x2a923e;if(_0x248aee>=_0x4c1d94){_0x248aee=_0x4c1d94;_0x2a923e=0xc8;}else{_0x2a923e=0xce;}_0x391dbf['status'](_0x2a923e);return _0x391dbf[_0x2804('0x28')](_0x2804('0x29'),_0x4f4e4c+'-'+_0x248aee+'/'+_0x4c1d94)[_0x2804('0x23')](_0xaadc00);}return null;};}function saveUpdates(_0xed1cee){return function(_0xbb3434){if(_0xbb3434){return _0xbb3434[_0x2804('0x2a')](_0xed1cee)[_0x2804('0x16')](function(_0x55a4dc){return _0x55a4dc;});}return null;};}function removeEntity(_0x1ea92f){return function(_0x2f5ec9){if(_0x2f5ec9){return _0x2f5ec9[_0x2804('0x2b')]()[_0x2804('0x16')](function(){_0x1ea92f[_0x2804('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x543ca5){return function(_0x30274d){if(!_0x30274d){_0x543ca5[_0x2804('0x2c')](0x194);}return _0x30274d;};}function handleError(_0x1fad73,_0x15ac1a){_0x15ac1a=_0x15ac1a||0x1f4;return function(_0x2c5982){logger[_0x2804('0x1b')](_0x2c5982[_0x2804('0x2d')]);if(_0x2c5982[_0x2804('0x2e')]){delete _0x2c5982[_0x2804('0x2e')];}_0x1fad73[_0x2804('0x21')](_0x15ac1a)[_0x2804('0x2f')](_0x2c5982);};}function getMustacheRender(_0x5e49e5,_0x2db520){return Mustache[_0x2804('0x30')](_0x5e49e5,_['merge'](_0x2db520[_0x2804('0x31')],{'contact':_0x2db520['contact'],'message':_0x2db520[_0x2804('0x1d')],'agent':_0x2db520[_0x2804('0x32')],'interaction':_0x2db520[_0x2804('0x33')],'account':_0x2db520[_0x2804('0x34')]}))||'';}exports[_0x2804('0x35')]=function(_0x4b3a4d,_0x381caf){var _0x19de55={};var _0x22c53f=_['map'](db['ChatInteraction'][_0x2804('0x36')],function(_0x3874d9){return{'name':_0x3874d9[_0x2804('0x37')],'type':_0x3874d9['type'][_0x2804('0x38')]};});_0x19de55=qs[_0x2804('0x39')](_0x22c53f,_0x4b3a4d);return interaction[_0x2804('0x3a')]('chat',_0x4b3a4d['query'],_0x4b3a4d['user'],_0x19de55,_0x22c53f)['then'](respondWithFilteredResult(_0x381caf,_0x19de55))[_0x2804('0x20')](handleError(_0x381caf,null));};exports[_0x2804('0x3b')]=function(_0x4839e0,_0x5a1d78){var _0x431f43={'raw':![],'where':{'id':_0x4839e0[_0x2804('0x3c')]['id']}},_0x394b9a={};_0x394b9a[_0x2804('0x3d')]=_[_0x2804('0x3e')](db[_0x2804('0x3f')][_0x2804('0x36')]);_0x394b9a[_0x2804('0x40')]=_['keys'](_0x4839e0[_0x2804('0x40')]);_0x394b9a[_0x2804('0x41')]=_['intersection'](_0x394b9a[_0x2804('0x3d')],_0x394b9a[_0x2804('0x40')]);_0x431f43[_0x2804('0x42')]=_[_0x2804('0x43')](_0x394b9a['model'],qs[_0x2804('0x44')](_0x4839e0[_0x2804('0x40')][_0x2804('0x44')]));_0x431f43['attributes']=_0x431f43[_0x2804('0x42')][_0x2804('0x45')]?_0x431f43[_0x2804('0x42')]:_0x394b9a[_0x2804('0x3d')];if(_0x4839e0[_0x2804('0x40')][_0x2804('0x46')]){_0x431f43[_0x2804('0x47')]=[{'all':!![]}];}_0x431f43=_[_0x2804('0x48')]({},_0x431f43,_0x4839e0[_0x2804('0x49')]);return db['ChatInteraction'][_0x2804('0x4a')](_0x431f43)[_0x2804('0x16')](handleEntityNotFound(_0x5a1d78,null))[_0x2804('0x16')](respondWithResult(_0x5a1d78,null))[_0x2804('0x20')](handleError(_0x5a1d78,null));};exports['create']=function(_0x289eda,_0x4a30b0){return db[_0x2804('0x3f')][_0x2804('0x4b')](_0x289eda[_0x2804('0x31')],{})[_0x2804('0x16')](respondWithResult(_0x4a30b0,0xc9))[_0x2804('0x20')](handleError(_0x4a30b0,null));};exports[_0x2804('0x2a')]=function(_0x2a2675,_0x2026f6){if(_0x2a2675[_0x2804('0x31')]['id']){delete _0x2a2675['body']['id'];}return db[_0x2804('0x3f')][_0x2804('0x4a')]({'where':{'id':_0x2a2675[_0x2804('0x3c')]['id']}})[_0x2804('0x16')](handleEntityNotFound(_0x2026f6,null))['then'](saveUpdates(_0x2a2675[_0x2804('0x31')],null))[_0x2804('0x16')](respondWithResult(_0x2026f6,null))[_0x2804('0x20')](handleError(_0x2026f6,null));};exports[_0x2804('0x2b')]=function(_0x2c5acf,_0x3600b0){return db['ChatInteraction']['find']({'where':{'id':_0x2c5acf[_0x2804('0x3c')]['id']}})[_0x2804('0x16')](handleEntityNotFound(_0x3600b0,null))[_0x2804('0x16')](removeEntity(_0x3600b0,null))[_0x2804('0x20')](handleError(_0x3600b0,null));};exports['describe']=function(_0x4c9877,_0x41577d){return db[_0x2804('0x3f')][_0x2804('0x4c')]()[_0x2804('0x16')](respondWithResult(_0x41577d,null))[_0x2804('0x20')](handleError(_0x41577d,null));};exports[_0x2804('0x4d')]=function(_0x2a5c41,_0xc232){var _0x517f7a=_0x2a5c41[_0x2804('0x3c')]['id'];var _0x1cc2dc;var _0x15716c;var _0x513d56;return db[_0x2804('0x3f')][_0x2804('0x4e')]({'where':{'id':_0x517f7a}})[_0x2804('0x16')](function(_0x4a6fb3){_0x1cc2dc=_0x4a6fb3;return db['ChatWebsite']['findOne']({'where':{'id':_0x4a6fb3[_0x2804('0x4f')]},'attributes':['id',_0x2804('0x50'),_0x2804('0x51'),_0x2804('0x52'),'vidaooNote',_0x2804('0x53')],'raw':!![]});})['then'](function(_0x35313c){if(_0x35313c&&_0x35313c['vidaooApiKey']&&_0x35313c[_0x2804('0x51')]){_0x15716c=_0x35313c;var _0xf4c6f3={'interaction':{'id':_0x517f7a},'agent':{'id':_0x2a5c41[_0x2804('0x54')]['id'],'name':_0x2a5c41[_0x2804('0x54')]['name'],'fullname':_0x2a5c41[_0x2804('0x54')][_0x2804('0x55')],'email':_0x2a5c41[_0x2804('0x54')]['email']},'contact':_0x2a5c41['body']['contact'],'account':_0x2a5c41['body'][_0x2804('0x34')]};var _0x335cc7={'rejectUnauthorized':![],'method':_0x2804('0x56'),'url':_0x2804('0x57'),'headers':{'X-APIKEY':_0x35313c['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2a5c41[_0x2804('0x54')][_0x2804('0x58')]],'buttons':null,'topic':_0x15716c['vidaooTopic'],'note':_[_0x2804('0x59')](_0x15716c[_0x2804('0x5a')])?null:getMustacheRender(_0x15716c['vidaooNote'],_0xf4c6f3),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x2804('0x59')](_0x15716c['vidaooMetadata'])){var _0xb46cdf=getMustacheRender(_0x15716c[_0x2804('0x53')],_0xf4c6f3);var _0x268a38=JSON[_0x2804('0x5b')](_0xb46cdf);_0x335cc7['body']['metadata']=_0x268a38;}}catch(_0x526410){throw new db['Sequelize'][(_0x2804('0x5c'))](_0x2804('0x5d'));}return rp(_0x335cc7);}else{throw new db[(_0x2804('0x5e'))][(_0x2804('0x5c'))](_0x2804('0x5f'));}})[_0x2804('0x16')](function(_0x165b25){_0x513d56=_0x165b25;if(_0x513d56['id']){var _0x3b6797={'body':_0x513d56['join_url'],'ChatWebsiteId':_0x15716c['id'],'ChatInteractionId':_0x1cc2dc['id'],'direction':_0x2804('0x60'),'UserId':_0x2a5c41[_0x2804('0x54')]['id']};return db[_0x2804('0x61')][_0x2804('0x4b')](_0x3b6797,{});}else{throw new db[(_0x2804('0x5e'))][(_0x2804('0x5c'))](_0x2804('0x62'));}})[_0x2804('0x16')](function(){return _0x1cc2dc['updateAttributes']({'vidaooSessionId':_0x513d56['id']});})['then'](respondWithResult(_0xc232,null))[_0x2804('0x20')](handleError(_0xc232,null));};exports['customUpdate']=function(_0x47542e,_0x2c7c3f){if(_0x47542e['body']['id']){delete _0x47542e['body']['id'];}return db[_0x2804('0x3f')][_0x2804('0x4a')]({'where':{'id':_0x47542e[_0x2804('0x3c')]['id']},'include':[{'model':db[_0x2804('0x63')],'as':_0x2804('0x64')}]})[_0x2804('0x16')](handleEntityNotFound(_0x2c7c3f,null))[_0x2804('0x16')](saveUpdates(_0x47542e[_0x2804('0x31')],null))['then'](respondWithResult(_0x2c7c3f,null))[_0x2804('0x20')](handleError(_0x2c7c3f,null));};exports['abandon']=function(_0xe310de,_0x3ba3af){if(_0xe310de[_0x2804('0x31')]['id']){delete _0xe310de['body']['id'];}return db[_0x2804('0x3f')][_0x2804('0x4a')]({'where':{'id':_0xe310de[_0x2804('0x3c')]['id']}})[_0x2804('0x16')](function(_0x18670f){if(!_0x18670f){logger[_0x2804('0x1b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x2804('0x65'),0x194,_0x2804('0x66'));_0x3ba3af['sendStatus'](0x194);}else{if(_0x18670f[_0x2804('0x67')]){throw new db[(_0x2804('0x5e'))][(_0x2804('0x5c'))](_0x2804('0x68'));}}return _0x18670f;})[_0x2804('0x16')](function(_0x218dac){if(_0x218dac){return _0x218dac['update']({'closed':_0xe310de[_0x2804('0x31')][_0x2804('0x69')],'disposition':_0xe310de[_0x2804('0x31')][_0x2804('0x6a')]})['then'](function(_0x4c614e){return _0x4c614e;});}})[_0x2804('0x16')](function(){return respondWithRpcPromise(_0x2804('0x6b'),'abandon',_0xe310de[_0x2804('0x31')],client9004);})['then'](respondWithResult(_0x3ba3af,null))['catch'](handleError(_0x3ba3af,null));};exports[_0x2804('0x6c')]=function(_0xe59e86,_0x4da154){_0xe59e86[_0x2804('0x31')][_0x2804('0x2e')]=_0xe59e86[_0x2804('0x6d')]['originalname'];_0xe59e86[_0x2804('0x31')][_0x2804('0x6e')]=_0xe59e86[_0x2804('0x6d')]['filename'];_0xe59e86[_0x2804('0x31')][_0x2804('0x6f')]=_0xe59e86[_0x2804('0x6d')][_0x2804('0x70')];return db[_0x2804('0x71')][_0x2804('0x4b')](_0xe59e86[_0x2804('0x31')])[_0x2804('0x16')](respondWithResult(_0x4da154,0xc9))['catch'](handleError(_0x4da154,null));};exports[_0x2804('0x72')]=function(_0x2909bc,_0x46f5ad){return db[_0x2804('0x3f')][_0x2804('0x4e')]({'where':{'id':_0x2909bc[_0x2804('0x3c')]['id']},'raw':!![]})[_0x2804('0x16')](handleEntityNotFound(_0x46f5ad,null))[_0x2804('0x16')](function(_0x29d553){if(_0x29d553){if(_0x29d553[_0x2804('0x69')]){return _0x46f5ad['status'](0x193)[_0x2804('0x23')]({'status':0x193,'message':_0x2804('0x73')});}return db[_0x2804('0x71')][_0x2804('0x4e')]({'where':{'id':_0x2909bc[_0x2804('0x40')][_0x2804('0x74')]},'raw':!![]})[_0x2804('0x16')](handleEntityNotFound(_0x46f5ad,null));}})[_0x2804('0x16')](function(_0x4359ce){if(_0x4359ce){var _0x1215fe=_0x4359ce[_0x2804('0x75')]!==null;var _0x3991a8=path[_0x2804('0x76')](config[_0x2804('0x77')],'server/files/attachments/');if(_0x1215fe){_0x3991a8=path['join'](_0x3991a8,_0x2804('0x78'));}var _0x316e0f=path['join'](_0x3991a8,_0x4359ce[_0x2804('0x6e')]);return _0x46f5ad[_0x2804('0x79')](_0x316e0f);}})[_0x2804('0x20')](handleError(_0x46f5ad,null));};exports[_0x2804('0x7a')]=function(_0x48deb7,_0x568f94){var _0x1c8fa9=null;var _0x22f672=null;var _0x408bda=null;if(_0x48deb7[_0x2804('0x31')]['id']){delete _0x48deb7['body']['id'];}if(_0x48deb7[_0x2804('0x31')][_0x2804('0x7b')]){_0x408bda=path[_0x2804('0x76')](config[_0x2804('0x77')],_0x2804('0x7c'),util[_0x2804('0x7d')](_0x2804('0x7e'),Date[_0x2804('0x7f')]()));_0x48deb7[_0x2804('0x31')]['pathTranscript']=_0x408bda;}return db[_0x2804('0x3f')][_0x2804('0x4a')]({'where':{'id':_0x48deb7['params']['id']},'include':[{'model':db[_0x2804('0x61')],'as':_0x2804('0x80'),'include':[{'model':db[_0x2804('0x81')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x568f94,null))[_0x2804('0x16')](saveUpdates(_0x48deb7['body'],null))[_0x2804('0x16')](function(_0x2221ba){if(_0x2221ba){_0x1c8fa9=_0x2221ba;return db[_0x2804('0x82')][_0x2804('0x4a')]({'where':{'id':_0x1c8fa9[_0x2804('0x4f')]}});}})[_0x2804('0x16')](function(_0x2a080d){if(_0x2a080d){_0x22f672=_0x2a080d;return db[_0x2804('0x63')][_0x2804('0x4a')]({'where':{'id':_0x1c8fa9[_0x2804('0x83')]}});}})[_0x2804('0x16')](function(_0xd7b0e9){if(_0xd7b0e9){if(_0x408bda){var _0x391574=null;for(var _0x3c8209=0x1;_0x3c8209<_0x1c8fa9[_0x2804('0x80')][_0x2804('0x45')];++_0x3c8209){_0x391574=_0x1c8fa9[_0x2804('0x80')][_0x3c8209];var _0x40aff9=_0x391574[_0x2804('0x67')]?util[_0x2804('0x7d')](_0x2804('0x84'),_0x22f672[_0x2804('0x85')],_0x391574['UserId']):_0x2804('0x86');var _0x430c00=_0x48deb7['body'][_0x2804('0x87')]||util[_0x2804('0x7d')](_0x2804('0x84'),_0x2804('0x88'),_0x391574[_0x2804('0x83')]);switch(_0x22f672['agentIdentifier']){case _0x2804('0x89'):_0x40aff9=_0x391574[_0x2804('0x67')]?util[_0x2804('0x7d')]('%s%d',_0x22f672['agentAlias'],_0x391574[_0x2804('0x67')]):_0x2804('0x86');break;case _0x2804('0x8a'):_0x40aff9=_0x391574[_0x2804('0x67')]?_0x391574['User'][_0x2804('0x8b')]||_0x391574[_0x2804('0x81')][_0x2804('0x55')]:'System';break;case'agent_fullname':_0x40aff9=_0x391574[_0x2804('0x67')]?_0x391574[_0x2804('0x81')][_0x2804('0x55')]:_0x2804('0x86');break;default:_0x40aff9=_0x391574[_0x2804('0x67')]?util[_0x2804('0x7d')]('%s%d',_0x22f672[_0x2804('0x85')],_0x391574['UserId']):_0x2804('0x86');}var _0x4ee1c2=util[_0x2804('0x7d')](_0x2804('0x8c'),moment(_0x391574[_0x2804('0x8d')])[_0x2804('0x7d')]('MM/DD/YYYY\x20HH:mm:ss'),_0x391574[_0x2804('0x8e')]==='in'?_0x430c00:_0x40aff9,_0x391574[_0x2804('0x31')]);if(!_0x391574[_0x2804('0x8f')]){fs[_0x2804('0x90')](_0x408bda,_0x4ee1c2);}}return db['MailAccount'][_0x2804('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x2804('0x91')],'as':_0x2804('0x92'),'raw':!![],'include':[{'model':db[_0x2804('0x93')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x2804('0x16')](function(_0x185d92){if(!_0x185d92||!_0x185d92[_0x2804('0x92')]||!_0x48deb7[_0x2804('0x31')])return _0x1c8fa9;var _0x286cd8=_0x185d92[_0x2804('0x94')]();return respondWithRpcPromise('SendMail',_0x2804('0x95'),{'account':_0x286cd8,'message':{'from':util[_0x2804('0x7d')](_0x2804('0x96'),_0x185d92[_0x2804('0x2e')],_0x185d92['email']||_0x185d92[_0x2804('0x92')][_0x2804('0x54')]),'to':_0x48deb7[_0x2804('0x31')][_0x2804('0x7b')],'subject':_0x2804('0x97'),'text':util[_0x2804('0x7d')](_0x2804('0x98'),_0x48deb7[_0x2804('0x31')][_0x2804('0x7b')]),'attachments':[{'path':_0x408bda}]}})[_0x2804('0x16')](function(){return _0x1c8fa9;})[_0x2804('0x20')](function(_0x4b077a){logger[_0x2804('0x1b')](_0x4b077a);});})[_0x2804('0x16')](respondWithStatusCode(_0x568f94,0xc8))['catch'](handleError(_0x568f94,null));};exports[_0x2804('0x99')]=function(_0x4b2871,_0x4c1542){return db[_0x2804('0x61')]['find']({'where':{'id':_0x4b2871[_0x2804('0x3c')]['id']}})[_0x2804('0x16')](handleEntityNotFound(_0x4c1542,null))[_0x2804('0x16')](function(_0x106132){if(_0x106132){return _0x106132[_0x2804('0x99')](_0x4b2871['body'][_0x2804('0x9a')],_['omit'](_0x4b2871[_0x2804('0x31')],[_0x2804('0x9a'),'id'])||{});}})[_0x2804('0x16')](respondWithResult(_0x4c1542,null))[_0x2804('0x20')](handleError(_0x4c1542,null));};exports[_0x2804('0x9b')]=function(_0x48fa2d,_0x35047c){var _0x51856f={'raw':![],'where':{}};var _0x162f66={};var _0x26cf53={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x48fa2d[_0x2804('0x3c')]['id']}})[_0x2804('0x16')](handleEntityNotFound(_0x35047c,null))[_0x2804('0x16')](function(_0xef34fd){if(_0xef34fd){_0x162f66[_0x2804('0x3d')]=_[_0x2804('0x3e')](db[_0x2804('0x61')][_0x2804('0x36')]);_0x162f66[_0x2804('0x40')]=_[_0x2804('0x3e')](_0x48fa2d[_0x2804('0x40')]);_0x162f66[_0x2804('0x41')]=_[_0x2804('0x43')](_0x162f66[_0x2804('0x3d')],_0x162f66[_0x2804('0x40')]);_0x51856f[_0x2804('0x42')]=_['intersection'](_0x162f66[_0x2804('0x3d')],qs[_0x2804('0x44')](_0x48fa2d[_0x2804('0x40')][_0x2804('0x44')]));_0x51856f[_0x2804('0x42')]=_0x51856f[_0x2804('0x42')][_0x2804('0x45')]?_0x51856f[_0x2804('0x42')]:_0x162f66[_0x2804('0x3d')];if(!_0x48fa2d['query']['hasOwnProperty']('nolimit')){_0x51856f[_0x2804('0x26')]=qs[_0x2804('0x26')](_0x48fa2d['query'][_0x2804('0x26')]);_0x51856f[_0x2804('0x24')]=qs[_0x2804('0x24')](_0x48fa2d[_0x2804('0x40')]['offset']);}_0x51856f['order']=qs['sort'](_0x48fa2d[_0x2804('0x40')][_0x2804('0x9c')]);_0x51856f['where']=qs[_0x2804('0x41')](_['pick'](_0x48fa2d[_0x2804('0x40')],_0x162f66[_0x2804('0x41')]));_0x51856f[_0x2804('0x9d')][_0x2804('0x9e')]=_0xef34fd['id'];if(_0x48fa2d[_0x2804('0x40')][_0x2804('0x9f')]){_0x51856f[_0x2804('0x9d')]=_[_0x2804('0x48')](_0x51856f[_0x2804('0x9d')],{'$or':_[_0x2804('0xa0')](_0x51856f[_0x2804('0x42')],function(_0x3d0da8){var _0x6be0f6={};_0x6be0f6[_0x3d0da8]={'$like':'%'+_0x48fa2d[_0x2804('0x40')]['filter']+'%'};return _0x6be0f6;})});}if(_0x48fa2d[_0x2804('0x40')]['$gte']){var _0x484436=_0x48fa2d[_0x2804('0x40')][_0x2804('0xa1')][_0x2804('0xa2')](',');var _0x54f333={};_0x54f333[_0x484436[0x0]]={'$gte':moment(_0x484436[0x1])[_0x2804('0x7d')](_0x2804('0xa3'))};_0x51856f[_0x2804('0x9d')]=_[_0x2804('0x48')](_0x51856f['where'],_0x54f333);}_0x51856f=_[_0x2804('0x48')]({},_0x51856f,_0x48fa2d['options']);return db[_0x2804('0x61')][_0x2804('0x27')]({'where':_0x51856f[_0x2804('0x9d')]})[_0x2804('0x16')](function(_0x1c3030){_0x26cf53[_0x2804('0x27')]=_0x1c3030;if(_0x48fa2d[_0x2804('0x40')][_0x2804('0x46')]){_0x51856f[_0x2804('0x47')]=[{'all':!![]}];}return db['ChatMessage'][_0x2804('0x3a')](_0x51856f);})['then'](function(_0x4235e2){_0x26cf53['rows']=_0x4235e2;return _0x26cf53;});}})[_0x2804('0x16')](respondWithFilteredResult(_0x35047c,_0x51856f))[_0x2804('0x20')](handleError(_0x35047c,null));};exports[_0x2804('0xa4')]=function(_0xd27d2e,_0x4905eb){var _0x2c895d={'where':{}},_0x42d697={},_0x518a06={'count':0x0,'rows':[]};return db[_0x2804('0x3f')]['findOne']({'where':{'id':_0xd27d2e['params']['id']}})['then'](handleEntityNotFound(_0x4905eb,null))[_0x2804('0x16')](function(_0x26f20e){if(_0x26f20e){_0x42d697[_0x2804('0x3d')]=_[_0x2804('0x3e')](db[_0x2804('0x61')][_0x2804('0x36')]);_0x42d697['query']=_[_0x2804('0x3e')](_0xd27d2e[_0x2804('0x40')]);_0x42d697['filters']=_['intersection'](_0x42d697[_0x2804('0x3d')],_0x42d697[_0x2804('0x40')]);_0x2c895d[_0x2804('0x42')]=_[_0x2804('0x43')](_0x42d697[_0x2804('0x3d')],qs['fields'](_0xd27d2e[_0x2804('0x40')][_0x2804('0x44')]));_0x2c895d[_0x2804('0x42')]=_0x2c895d[_0x2804('0x42')][_0x2804('0x45')]?_0x2c895d[_0x2804('0x42')]:_0x42d697[_0x2804('0x3d')];if(!_0xd27d2e[_0x2804('0x40')][_0x2804('0xa5')](_0x2804('0xa6'))){_0x2c895d['limit']=qs['limit'](_0xd27d2e[_0x2804('0x40')][_0x2804('0x26')]);_0x2c895d['offset']=qs[_0x2804('0x24')](_0xd27d2e[_0x2804('0x40')][_0x2804('0x24')]);}_0x2c895d['order']=qs['sort'](_0xd27d2e[_0x2804('0x40')][_0x2804('0x9c')]);_0x2c895d[_0x2804('0x9d')]=qs[_0x2804('0x41')](_[_0x2804('0xa7')](_0xd27d2e[_0x2804('0x40')],_0x42d697[_0x2804('0x41')]));_0x2c895d['where']['ChatInteractionId']=_0x26f20e['id'];if(_0xd27d2e[_0x2804('0x40')][_0x2804('0x9f')]){_0x2c895d[_0x2804('0x9d')]=_[_0x2804('0x48')](_0x2c895d[_0x2804('0x9d')],{'$or':_['map'](_0x2c895d[_0x2804('0x42')],function(_0x125816){var _0x342b8e={};_0x342b8e[_0x125816]={'$like':'%'+_0xd27d2e[_0x2804('0x40')][_0x2804('0x9f')]+'%'};return _0x342b8e;})});}_0x2c895d[_0x2804('0x9d')][_0x2804('0x8f')]=![];if(_0xd27d2e['query']['id']){_0x2c895d[_0x2804('0x9d')]['id']={'$gt':_0xd27d2e[_0x2804('0x40')]['id']};}_0x2c895d=_[_0x2804('0x48')]({},_0x2c895d,_0xd27d2e['options']);return db['ChatMessage'][_0x2804('0x27')]({'where':_0x2c895d[_0x2804('0x9d')]})[_0x2804('0x16')](function(_0x43732b){_0x518a06[_0x2804('0x27')]=_0x43732b;_0x2c895d['include']=[];if(_0xd27d2e[_0x2804('0x40')][_0x2804('0xa8')]){_0x2c895d[_0x2804('0x47')][_0x2804('0xa9')]({'model':db[_0x2804('0x81')],'as':_0x2804('0x81'),'attributes':['id',_0x2804('0x55'),'alias']});}if(_0xd27d2e['query'][_0x2804('0x46')]){_0x2c895d[_0x2804('0x47')]=[{'all':!![]}];}return db['ChatMessage'][_0x2804('0x3a')](_0x2c895d);})['then'](function(_0x5571cd){_0x518a06['rows']=_0x5571cd;return _0x518a06;});}})[_0x2804('0x16')](respondWithFilteredResult(_0x4905eb,_0x2c895d))[_0x2804('0x20')](handleError(_0x4905eb,null));};exports[_0x2804('0xaa')]=function(_0x24a590,_0x42ebb1){return db[_0x2804('0x3f')]['find']({'where':{'id':_0x24a590[_0x2804('0x3c')]['id']}})[_0x2804('0x16')](handleEntityNotFound(_0x42ebb1,null))[_0x2804('0x16')](function(_0x47b289){if(_0x47b289){return _0x47b289[_0x2804('0xab')](_0x24a590[_0x2804('0x31')][_0x2804('0x9a')],_['omit'](_0x24a590[_0x2804('0x31')],[_0x2804('0x9a'),'id'])||{})['spread'](function(){return db[_0x2804('0xac')][_0x2804('0x3a')]({'attributes':['id',_0x2804('0x2e'),_0x2804('0xad')],'where':{'id':_0x24a590['body'][_0x2804('0x9a')]}});})[_0x2804('0x16')](function(_0x2e5d5d){socket['emit'](_0x2804('0xae'),{'id':Number(_0x24a590[_0x2804('0x3c')]['id']),'tags':_0x2e5d5d||[]});return{'id':Number(_0x24a590['params']['id']),'tags':_0x2e5d5d||[]};});}})[_0x2804('0x16')](respondWithResult(_0x42ebb1,null))['catch'](handleError(_0x42ebb1,null));};exports[_0x2804('0xaf')]=function(_0x30aba0,_0x4fc3ae){return db[_0x2804('0x3f')]['find']({'where':{'id':_0x30aba0[_0x2804('0x3c')]['id']}})[_0x2804('0x16')](handleEntityNotFound(_0x4fc3ae,null))[_0x2804('0x16')](function(_0x14b63c){if(_0x14b63c){return _0x14b63c[_0x2804('0xaf')](_0x30aba0['query']['ids']);}})[_0x2804('0x16')](respondWithStatusCode(_0x4fc3ae,null))[_0x2804('0x20')](handleError(_0x4fc3ae,null));};exports[_0x2804('0x79')]=function(_0x2995d8,_0xe471fc){var _0x546d4b=moment()[_0x2804('0xb0')]()[_0x2804('0xb1')]();var _0x353c9a=path[_0x2804('0x76')](config[_0x2804('0x77')],_0x2804('0xb2'),'files','tmp');var _0x5b2800=path[_0x2804('0x76')](config[_0x2804('0x77')],_0x2804('0xb2'),_0x2804('0xb3'),_0x2804('0xb4'));var _0x4f8098=path['join'](_0x353c9a,_0x546d4b);var _0x4ec597=util[_0x2804('0x7d')](_0x2804('0xb5'),_0x2995d8[_0x2804('0x3c')]['id'],_0x546d4b);var _0x4a79f1=path['join'](_0x353c9a,_0x4ec597);var _0x4e13bf=[];_0x4e13bf['push']({'model':db[_0x2804('0x81')],'as':_0x2804('0x81'),'attributes':['id',_0x2804('0x55')],'raw':!![]});_0x4e13bf[_0x2804('0xa9')]({'model':db[_0x2804('0x63')],'as':'Contact','attributes':['id',_0x2804('0xb6'),'lastName'],'raw':!![]});if(_0x2995d8[_0x2804('0x40')][_0x2804('0xb4')]){_0x4e13bf['push']({'model':db[_0x2804('0x71')],'as':_0x2804('0x71'),'raw':!![]});}var _0x4440b3=[{'model':db[_0x2804('0x61')],'as':'Messages','attributes':['id','body',_0x2804('0x8d'),_0x2804('0x8e'),'secret','read'],'include':_0x4e13bf}];_0x4440b3['push']({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x2804('0x2e')]});_0x4440b3[_0x2804('0xa9')]({'model':db[_0x2804('0x81')],'as':_0x2804('0xb7'),'attributes':['id',_0x2804('0x55')]});return db['ChatInteraction'][_0x2804('0x4a')]({'where':{'id':_0x2995d8[_0x2804('0x3c')]['id']},'include':_0x4440b3})[_0x2804('0x16')](handleEntityNotFound(_0xe471fc,null))[_0x2804('0x16')](function(_0xd5718b){if(_0xd5718b){var _0x5edc30=_0xd5718b[_0x2804('0xb8')]({'plain':!![]});fs[_0x2804('0xb9')](_0x4f8098);var _0x201aef={'channel':'Chat','account':_0x5edc30[_0x2804('0xba')][_0x2804('0x2e')],'agent':_0x5edc30['Owner']?_0x5edc30[_0x2804('0xb7')]['fullname']:_0x2804('0xbb'),'createdAt':moment(_0x5edc30[_0x2804('0x8d')])[_0x2804('0x7d')](_0x2804('0xa3'))[_0x2804('0xb1')](),'closedAt':_0x5edc30[_0x2804('0x69')]?moment(_0x5edc30[_0x2804('0xbc')])[_0x2804('0x7d')](_0x2804('0xa3'))[_0x2804('0xb1')]():'','disposition':_0x5edc30[_0x2804('0x6a')],'chatInfo':{'browser':_0x5edc30[_0x2804('0xbd')],'os':_0x5edc30['osName'],'referer':_0x5edc30[_0x2804('0xbe')],'customerIp':_0x5edc30[_0x2804('0xbf')],'customerPort':_0x5edc30['customerPort']?_0x5edc30[_0x2804('0xc0')]:_0x2804('0xbb')},'messages':_(_0x5edc30[_0x2804('0x80')])['tail']()['filter']({'secret':![]})[_0x2804('0xa0')](function(_0x11413f){if(_0x11413f['Attachment']){var _0x5a8762=path[_0x2804('0x76')](_0x5b2800,_0x11413f[_0x2804('0x71')]['basename']);if(fs['existsSync'](_0x5a8762)){fs['createReadStream'](_0x5a8762)[_0x2804('0xc1')](fs[_0x2804('0xc2')](path['join'](_0x4f8098,_0x11413f[_0x2804('0x71')][_0x2804('0x6e')])));}}return{'date':moment(_0x11413f[_0x2804('0x8d')])[_0x2804('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x11413f[_0x2804('0x8e')]==='out'?_0x11413f['User']?_0x11413f[_0x2804('0x81')]['fullname']:_0x2804('0x86'):_0x11413f['Contact'][_0x2804('0xb6')]+(_0x11413f['Contact']['lastName']?'\x20'+_0x11413f[_0x2804('0x64')][_0x2804('0xc3')]:''),'body':_0x11413f[_0x2804('0x71')]?_0x11413f[_0x2804('0x71')][_0x2804('0x6e')]:_0x11413f['body'],'direction':_0x11413f[_0x2804('0x8e')]===_0x2804('0x60')?'A':'C','secret':_0x11413f[_0x2804('0x8f')],'read':_0x11413f[_0x2804('0xc4')],'attachment':_0x11413f['Attachment']};})[_0x2804('0xc5')]()};return ejs[_0x2804('0xc6')](path['join'](config[_0x2804('0x77')],_0x2804('0xb2'),_0x2804('0xc7'),'downloadInteraction.ejs'),{'interaction':_0x201aef})['then'](function(_0x11433e){var _0x3139f7=path[_0x2804('0x76')](_0x4f8098,_0x2804('0xc8')+_0x5edc30['id']+'-'+_0x546d4b+_0x2804('0xc9'));var _0x360755={'path':_0x3139f7,'channel':_0x2804('0xca'),'interactionId':_0x5edc30['id']};return pdf['createPdfFromHTML'](_0x11433e,_0x360755);})['then'](function(){return new Promise(function(_0x35f721,_0x1d0f96){zipdir(_0x4f8098,{'saveTo':_0x4a79f1},function(_0x3a0793,_0x5af466){if(_0x3a0793)return _0x1d0f96(_0x3a0793);return _0x35f721(_0x5af466);});})[_0x2804('0x16')](function(){return new BPromise(function(_0x2e8951,_0x437593){rimraf(_0x4f8098,function(_0x5e7bfb){if(_0x5e7bfb)_0x437593(_0x5e7bfb);return _0x2e8951();});});})[_0x2804('0x16')](function(){return _0xe471fc[_0x2804('0x79')](_0x4a79f1,_0x4ec597,function(_0x2d8608){if(_0x2d8608){logger[_0x2804('0x1b')]('err',_0x2d8608);}else{fs[_0x2804('0xcb')](_0x4a79f1);}});});});}else{return _0xe471fc[_0x2804('0x2c')](0xc8);}})['catch'](handleError(_0xe471fc,null));}; \ No newline at end of file +var _0x2c67=['customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','pathTranscript','User','ChatWebsite','ChatWebsiteId','ContactId','Messages','length','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','secret','addTags','setTags','spread','color','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','firstName','lastName','push','direction','read','Account','Owner','get','Chat','N.A.','toString','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','info','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','sendStatus','stack','name','send','merge','body','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','catch','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','include','options','find','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','user','fullname','email','vidaooTopic','isNull','vidaooNote','follow','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes'];(function(_0x391b94,_0x3dbaf1){var _0x2b8852=function(_0x593b72){while(--_0x593b72){_0x391b94['push'](_0x391b94['shift']());}};_0x2b8852(++_0x3dbaf1);}(_0x2c67,0x13a));var _0x72c6=function(_0x4ad3df,_0x504543){_0x4ad3df=_0x4ad3df-0x0;var _0xbd9e63=_0x2c67[_0x4ad3df];return _0xbd9e63;};'use strict';var rimraf=require(_0x72c6('0x0'));var zipdir=require(_0x72c6('0x1'));var rp=require(_0x72c6('0x2'));var moment=require(_0x72c6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x72c6('0x4'));var path=require(_0x72c6('0x5'));var ejs=require(_0x72c6('0x6'));var fs=require('fs');var _=require(_0x72c6('0x7'));var Redis=require(_0x72c6('0x8'));var interaction=require(_0x72c6('0x9'));var qs=require(_0x72c6('0xa'));var pdf=require(_0x72c6('0xb'));var logger=require(_0x72c6('0xc'))(_0x72c6('0xd'));var config=require(_0x72c6('0xe'));var db=require(_0x72c6('0xf'))['db'];config[_0x72c6('0x10')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x72c6('0x11'))(new Redis(config[_0x72c6('0x10')]));require(_0x72c6('0x12'))[_0x72c6('0x13')](socket);var jayson=require(_0x72c6('0x14'));var client=jayson[_0x72c6('0x15')][_0x72c6('0x16')]({'port':0x232b});var client9004=jayson[_0x72c6('0x15')][_0x72c6('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x4f4e87,_0x58cf63,_0x1d6724,_0x5ad8d6){return new BPromise(function(_0x414001,_0xf6ee26){var _0x3c1787=_0x5ad8d6||client;return _0x3c1787[_0x72c6('0x17')](_0x4f4e87,_0x1d6724)['then'](function(_0x7d1c0a){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x58cf63,'request\x20sent');logger['debug'](_0x72c6('0x18'),_0x58cf63,'request\x20sent',JSON[_0x72c6('0x19')](_0x7d1c0a));if(_0x7d1c0a[_0x72c6('0x1a')]){if(_0x7d1c0a[_0x72c6('0x1a')]['code']===0x1f4){logger[_0x72c6('0x1a')](_0x72c6('0x1b'),_0x58cf63,_0x7d1c0a['error'][_0x72c6('0x1c')]);return _0xf6ee26(_0x7d1c0a[_0x72c6('0x1a')][_0x72c6('0x1c')]);}logger[_0x72c6('0x1a')](_0x72c6('0x1b'),_0x58cf63,_0x7d1c0a[_0x72c6('0x1a')][_0x72c6('0x1c')]);return _0x414001(_0x7d1c0a[_0x72c6('0x1a')]['message']);}else{logger[_0x72c6('0x1d')](_0x72c6('0x1b'),_0x58cf63,'request\x20sent');_0x414001(_0x7d1c0a['result'][_0x72c6('0x1c')]);}})['catch'](function(_0x59d194){logger[_0x72c6('0x1a')](_0x72c6('0x1b'),_0x58cf63,_0x59d194);_0xf6ee26(_0x59d194);});});}function respondWithStatusCode(_0x42b0b5,_0x40349a){_0x40349a=_0x40349a||0xcc;return function(_0x28e5e1){if(_0x28e5e1){return _0x42b0b5['sendStatus'](_0x40349a);}return _0x42b0b5[_0x72c6('0x1e')](_0x40349a)[_0x72c6('0x1f')]();};}function respondWithResult(_0x1620b0,_0x8fdebd){_0x8fdebd=_0x8fdebd||0xc8;return function(_0x156769){if(_0x156769){return _0x1620b0['status'](_0x8fdebd)['json'](_0x156769);}};}function respondWithFilteredResult(_0x148a52,_0x2840b6){return function(_0x3d938a){if(_0x3d938a){var _0x40b2d8=typeof _0x2840b6[_0x72c6('0x20')]==='undefined'&&typeof _0x2840b6[_0x72c6('0x21')]===_0x72c6('0x22');var _0x5e4b9d=_0x3d938a[_0x72c6('0x23')];var _0x3a4d2d=_0x40b2d8?0x0:_0x2840b6['offset'];var _0x4c81af=_0x40b2d8?_0x3d938a[_0x72c6('0x23')]:_0x2840b6[_0x72c6('0x20')]+_0x2840b6[_0x72c6('0x21')];var _0x1f9565;if(_0x4c81af>=_0x5e4b9d){_0x4c81af=_0x5e4b9d;_0x1f9565=0xc8;}else{_0x1f9565=0xce;}_0x148a52[_0x72c6('0x1e')](_0x1f9565);return _0x148a52[_0x72c6('0x24')](_0x72c6('0x25'),_0x3a4d2d+'-'+_0x4c81af+'/'+_0x5e4b9d)[_0x72c6('0x26')](_0x3d938a);}return null;};}function saveUpdates(_0x442477){return function(_0x2d293d){if(_0x2d293d){return _0x2d293d[_0x72c6('0x27')](_0x442477)[_0x72c6('0x28')](function(_0x34935e){return _0x34935e;});}return null;};}function removeEntity(_0x2646e1){return function(_0x2d9d71){if(_0x2d9d71){return _0x2d9d71[_0x72c6('0x29')]()[_0x72c6('0x28')](function(){_0x2646e1[_0x72c6('0x1e')](0xcc)[_0x72c6('0x1f')]();});}};}function handleEntityNotFound(_0x4dd17a){return function(_0x5135ab){if(!_0x5135ab){_0x4dd17a[_0x72c6('0x2a')](0x194);}return _0x5135ab;};}function handleError(_0x44a7af,_0x39b159){_0x39b159=_0x39b159||0x1f4;return function(_0x5d02ce){logger[_0x72c6('0x1a')](_0x5d02ce[_0x72c6('0x2b')]);if(_0x5d02ce[_0x72c6('0x2c')]){delete _0x5d02ce[_0x72c6('0x2c')];}_0x44a7af[_0x72c6('0x1e')](_0x39b159)[_0x72c6('0x2d')](_0x5d02ce);};}function getMustacheRender(_0x34c7d3,_0x1eaab1){return Mustache['render'](_0x34c7d3,_[_0x72c6('0x2e')](_0x1eaab1[_0x72c6('0x2f')],{'contact':_0x1eaab1['contact'],'message':_0x1eaab1[_0x72c6('0x1c')],'agent':_0x1eaab1[_0x72c6('0x30')],'interaction':_0x1eaab1[_0x72c6('0x31')],'account':_0x1eaab1[_0x72c6('0x32')]}))||'';}exports[_0x72c6('0x33')]=function(_0x2a339d,_0x217a22){var _0x107fbb={};var _0x239825=_[_0x72c6('0x34')](db[_0x72c6('0x35')]['rawAttributes'],function(_0x5bed29){return{'name':_0x5bed29[_0x72c6('0x36')],'type':_0x5bed29[_0x72c6('0x37')][_0x72c6('0x38')]};});_0x107fbb=qs[_0x72c6('0x39')](_0x239825,_0x2a339d);return interaction[_0x72c6('0x3a')](_0x72c6('0x3b'),_0x2a339d['query'],_0x2a339d['user'],_0x107fbb,_0x239825)[_0x72c6('0x28')](respondWithFilteredResult(_0x217a22,_0x107fbb))[_0x72c6('0x3c')](handleError(_0x217a22,null));};exports['show']=function(_0x266551,_0x4c9558){var _0x53c053={'raw':![],'where':{'id':_0x266551[_0x72c6('0x3d')]['id']}},_0xaae586={};_0xaae586[_0x72c6('0x3e')]=_[_0x72c6('0x3f')](db['ChatInteraction'][_0x72c6('0x40')]);_0xaae586[_0x72c6('0x41')]=_[_0x72c6('0x3f')](_0x266551[_0x72c6('0x41')]);_0xaae586[_0x72c6('0x42')]=_['intersection'](_0xaae586['model'],_0xaae586[_0x72c6('0x41')]);_0x53c053[_0x72c6('0x43')]=_[_0x72c6('0x44')](_0xaae586[_0x72c6('0x3e')],qs['fields'](_0x266551[_0x72c6('0x41')][_0x72c6('0x45')]));_0x53c053[_0x72c6('0x43')]=_0x53c053['attributes']['length']?_0x53c053[_0x72c6('0x43')]:_0xaae586['model'];if(_0x266551[_0x72c6('0x41')]['includeAll']){_0x53c053[_0x72c6('0x46')]=[{'all':!![]}];}_0x53c053=_['merge']({},_0x53c053,_0x266551[_0x72c6('0x47')]);return db['ChatInteraction'][_0x72c6('0x48')](_0x53c053)[_0x72c6('0x28')](handleEntityNotFound(_0x4c9558,null))['then'](respondWithResult(_0x4c9558,null))[_0x72c6('0x3c')](handleError(_0x4c9558,null));};exports[_0x72c6('0x49')]=function(_0x1700fb,_0x3f7249){return db[_0x72c6('0x35')][_0x72c6('0x49')](_0x1700fb['body'],{})[_0x72c6('0x28')](respondWithResult(_0x3f7249,0xc9))[_0x72c6('0x3c')](handleError(_0x3f7249,null));};exports[_0x72c6('0x27')]=function(_0x33b942,_0x3fc556){if(_0x33b942['body']['id']){delete _0x33b942['body']['id'];}return db['ChatInteraction'][_0x72c6('0x48')]({'where':{'id':_0x33b942[_0x72c6('0x3d')]['id']}})[_0x72c6('0x28')](handleEntityNotFound(_0x3fc556,null))[_0x72c6('0x28')](saveUpdates(_0x33b942[_0x72c6('0x2f')],null))['then'](respondWithResult(_0x3fc556,null))[_0x72c6('0x3c')](handleError(_0x3fc556,null));};exports[_0x72c6('0x29')]=function(_0x23f182,_0x1c2edf){return db[_0x72c6('0x35')][_0x72c6('0x48')]({'where':{'id':_0x23f182[_0x72c6('0x3d')]['id']}})[_0x72c6('0x28')](handleEntityNotFound(_0x1c2edf,null))[_0x72c6('0x28')](removeEntity(_0x1c2edf,null))[_0x72c6('0x3c')](handleError(_0x1c2edf,null));};exports[_0x72c6('0x4a')]=function(_0x39d707,_0x5608d4){return db[_0x72c6('0x35')][_0x72c6('0x4a')]()[_0x72c6('0x28')](respondWithResult(_0x5608d4,null))[_0x72c6('0x3c')](handleError(_0x5608d4,null));};exports[_0x72c6('0x4b')]=function(_0x3d9bd6,_0x4e1293){var _0x1063b4=_0x3d9bd6[_0x72c6('0x3d')]['id'];var _0x255487;var _0x55e3f0;var _0x58dccd;return db[_0x72c6('0x35')][_0x72c6('0x4c')]({'where':{'id':_0x1063b4}})[_0x72c6('0x28')](function(_0x53eb95){_0x255487=_0x53eb95;return db['ChatWebsite'][_0x72c6('0x4c')]({'where':{'id':_0x53eb95['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x72c6('0x28')](function(_0xf1d654){if(_0xf1d654&&_0xf1d654[_0x72c6('0x4d')]&&_0xf1d654[_0x72c6('0x4e')]){_0x55e3f0=_0xf1d654;var _0x5a724d={'interaction':{'id':_0x1063b4},'agent':{'id':_0x3d9bd6[_0x72c6('0x4f')]['id'],'name':_0x3d9bd6['user'][_0x72c6('0x2c')],'fullname':_0x3d9bd6[_0x72c6('0x4f')][_0x72c6('0x50')],'email':_0x3d9bd6[_0x72c6('0x4f')]['email']},'contact':_0x3d9bd6[_0x72c6('0x2f')]['contact'],'account':_0x3d9bd6[_0x72c6('0x2f')]['account']};var _0x1280cd={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0xf1d654[_0x72c6('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3d9bd6[_0x72c6('0x4f')][_0x72c6('0x51')]],'buttons':null,'topic':_0x55e3f0[_0x72c6('0x52')],'note':_[_0x72c6('0x53')](_0x55e3f0[_0x72c6('0x54')])?null:getMustacheRender(_0x55e3f0[_0x72c6('0x54')],_0x5a724d),'metadata':null},'redirect':_0x72c6('0x55'),'json':!![]};try{if(!_[_0x72c6('0x53')](_0x55e3f0[_0x72c6('0x56')])){var _0x4ceb0e=getMustacheRender(_0x55e3f0[_0x72c6('0x56')],_0x5a724d);var _0x304f6d=JSON[_0x72c6('0x57')](_0x4ceb0e);_0x1280cd[_0x72c6('0x2f')]['metadata']=_0x304f6d;}}catch(_0x4b1ae1){throw new db[(_0x72c6('0x58'))][(_0x72c6('0x59'))](_0x72c6('0x5a'));}return rp(_0x1280cd);}else{throw new db[(_0x72c6('0x58'))][(_0x72c6('0x59'))](_0x72c6('0x5b'));}})[_0x72c6('0x28')](function(_0x5d872d){_0x58dccd=_0x5d872d;if(_0x58dccd['id']){var _0x29f106={'body':_0x58dccd[_0x72c6('0x5c')],'ChatWebsiteId':_0x55e3f0['id'],'ChatInteractionId':_0x255487['id'],'direction':'out','UserId':_0x3d9bd6[_0x72c6('0x4f')]['id']};return db[_0x72c6('0x5d')][_0x72c6('0x49')](_0x29f106,{});}else{throw new db[(_0x72c6('0x58'))][(_0x72c6('0x59'))](_0x72c6('0x5e'));}})[_0x72c6('0x28')](function(){return _0x255487[_0x72c6('0x5f')]({'vidaooSessionId':_0x58dccd['id']});})['then'](respondWithResult(_0x4e1293,null))[_0x72c6('0x3c')](handleError(_0x4e1293,null));};exports[_0x72c6('0x60')]=function(_0x267f02,_0x5cd72f){if(_0x267f02['body']['id']){delete _0x267f02[_0x72c6('0x2f')]['id'];}return db[_0x72c6('0x35')][_0x72c6('0x48')]({'where':{'id':_0x267f02['params']['id']},'include':[{'model':db[_0x72c6('0x61')],'as':_0x72c6('0x62')}]})[_0x72c6('0x28')](handleEntityNotFound(_0x5cd72f,null))[_0x72c6('0x28')](saveUpdates(_0x267f02[_0x72c6('0x2f')],null))[_0x72c6('0x28')](respondWithResult(_0x5cd72f,null))['catch'](handleError(_0x5cd72f,null));};exports[_0x72c6('0x63')]=function(_0x168c22,_0x4e04cb){if(_0x168c22[_0x72c6('0x2f')]['id']){delete _0x168c22['body']['id'];}return db['ChatInteraction'][_0x72c6('0x48')]({'where':{'id':_0x168c22[_0x72c6('0x3d')]['id']}})[_0x72c6('0x28')](function(_0x5e09b7){if(!_0x5e09b7){logger[_0x72c6('0x1a')](_0x72c6('0x64'),_0x72c6('0x63'),0x194,_0x72c6('0x65'));_0x4e04cb['sendStatus'](0x194);}else{if(_0x5e09b7[_0x72c6('0x66')]){throw new db[(_0x72c6('0x58'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x5e09b7;})['then'](function(_0x13eceb){if(_0x13eceb){return _0x13eceb['update']({'closed':_0x168c22['body'][_0x72c6('0x67')],'disposition':_0x168c22[_0x72c6('0x2f')][_0x72c6('0x68')]})[_0x72c6('0x28')](function(_0x2317d5){return _0x2317d5;});}})[_0x72c6('0x28')](function(){return respondWithRpcPromise(_0x72c6('0x69'),'abandon',_0x168c22['body'],client9004);})[_0x72c6('0x28')](respondWithResult(_0x4e04cb,null))['catch'](handleError(_0x4e04cb,null));};exports['attachmentUpload']=function(_0x5d7390,_0x3c1fc6){_0x5d7390[_0x72c6('0x2f')][_0x72c6('0x2c')]=_0x5d7390['file'][_0x72c6('0x6a')];_0x5d7390[_0x72c6('0x2f')][_0x72c6('0x6b')]=_0x5d7390[_0x72c6('0x6c')][_0x72c6('0x6d')];_0x5d7390['body'][_0x72c6('0x37')]=_0x5d7390['file'][_0x72c6('0x6e')];return db[_0x72c6('0x6f')]['create'](_0x5d7390[_0x72c6('0x2f')])[_0x72c6('0x28')](respondWithResult(_0x3c1fc6,0xc9))[_0x72c6('0x3c')](handleError(_0x3c1fc6,null));};exports[_0x72c6('0x70')]=function(_0x5df5a3,_0x1f57f8){return db[_0x72c6('0x35')][_0x72c6('0x4c')]({'where':{'id':_0x5df5a3[_0x72c6('0x3d')]['id']},'raw':!![]})[_0x72c6('0x28')](handleEntityNotFound(_0x1f57f8,null))['then'](function(_0x350382){if(_0x350382){if(_0x350382[_0x72c6('0x67')]){return _0x1f57f8[_0x72c6('0x1e')](0x193)[_0x72c6('0x26')]({'status':0x193,'message':_0x72c6('0x71')});}return db[_0x72c6('0x6f')]['findOne']({'where':{'id':_0x5df5a3[_0x72c6('0x41')][_0x72c6('0x72')]},'raw':!![]})['then'](handleEntityNotFound(_0x1f57f8,null));}})[_0x72c6('0x28')](function(_0x4e2423){if(_0x4e2423){var _0x2e7d06=_0x4e2423[_0x72c6('0x73')]!==null;var _0x37a38b=path[_0x72c6('0x74')](config[_0x72c6('0x75')],_0x72c6('0x76'));if(_0x2e7d06){_0x37a38b=path[_0x72c6('0x74')](_0x37a38b,'offline-chat/');}var _0x59f4b0=path[_0x72c6('0x74')](_0x37a38b,_0x4e2423[_0x72c6('0x6b')]);return _0x1f57f8[_0x72c6('0x77')](_0x59f4b0);}})[_0x72c6('0x3c')](handleError(_0x1f57f8,null));};exports[_0x72c6('0x78')]=function(_0x4fc315,_0x4017ef){var _0xd3dc9a=null;var _0x220f2f=null;var _0x5d9d6d=null;if(_0x4fc315['body']['id']){delete _0x4fc315[_0x72c6('0x2f')]['id'];}if(_0x4fc315['body'][_0x72c6('0x79')]){_0x5d9d6d=path['join'](config[_0x72c6('0x75')],_0x72c6('0x7a'),util[_0x72c6('0x7b')]('transcript-%s.txt',Date['now']()));_0x4fc315[_0x72c6('0x2f')][_0x72c6('0x7c')]=_0x5d9d6d;}return db['ChatInteraction'][_0x72c6('0x48')]({'where':{'id':_0x4fc315[_0x72c6('0x3d')]['id']},'include':[{'model':db[_0x72c6('0x5d')],'as':'Messages','include':[{'model':db['User'],'as':_0x72c6('0x7d')}]}]})[_0x72c6('0x28')](handleEntityNotFound(_0x4017ef,null))[_0x72c6('0x28')](saveUpdates(_0x4fc315[_0x72c6('0x2f')],null))[_0x72c6('0x28')](function(_0x50a575){if(_0x50a575){_0xd3dc9a=_0x50a575;return db[_0x72c6('0x7e')][_0x72c6('0x48')]({'where':{'id':_0xd3dc9a[_0x72c6('0x7f')]}});}})['then'](function(_0x3ded2a){if(_0x3ded2a){_0x220f2f=_0x3ded2a;return db['CmContact'][_0x72c6('0x48')]({'where':{'id':_0xd3dc9a[_0x72c6('0x80')]}});}})[_0x72c6('0x28')](function(_0x37b05a){if(_0x37b05a){if(_0x5d9d6d){var _0x1d7ff1=null;for(var _0x2f85d5=0x1;_0x2f85d5<_0xd3dc9a[_0x72c6('0x81')][_0x72c6('0x82')];++_0x2f85d5){_0x1d7ff1=_0xd3dc9a[_0x72c6('0x81')][_0x2f85d5];var _0x2fe797=_0x1d7ff1[_0x72c6('0x66')]?util[_0x72c6('0x7b')](_0x72c6('0x83'),_0x220f2f[_0x72c6('0x84')],_0x1d7ff1['UserId']):_0x72c6('0x85');var _0x32abef=_0x4fc315[_0x72c6('0x2f')][_0x72c6('0x86')]||util[_0x72c6('0x7b')](_0x72c6('0x83'),'Visitor',_0x1d7ff1['ContactId']);switch(_0x220f2f[_0x72c6('0x87')]){case _0x72c6('0x88'):_0x2fe797=_0x1d7ff1['UserId']?util[_0x72c6('0x7b')](_0x72c6('0x83'),_0x220f2f[_0x72c6('0x84')],_0x1d7ff1['UserId']):_0x72c6('0x85');break;case _0x72c6('0x89'):_0x2fe797=_0x1d7ff1[_0x72c6('0x66')]?_0x1d7ff1['User'][_0x72c6('0x8a')]||_0x1d7ff1[_0x72c6('0x7d')]['fullname']:'System';break;case _0x72c6('0x8b'):_0x2fe797=_0x1d7ff1[_0x72c6('0x66')]?_0x1d7ff1['User'][_0x72c6('0x50')]:_0x72c6('0x85');break;default:_0x2fe797=_0x1d7ff1[_0x72c6('0x66')]?util[_0x72c6('0x7b')]('%s%d',_0x220f2f[_0x72c6('0x84')],_0x1d7ff1[_0x72c6('0x66')]):_0x72c6('0x85');}var _0x1b55a=util[_0x72c6('0x7b')](_0x72c6('0x8c'),moment(_0x1d7ff1[_0x72c6('0x8d')])[_0x72c6('0x7b')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1d7ff1['direction']==='in'?_0x32abef:_0x2fe797,_0x1d7ff1['body']);if(!_0x1d7ff1['secret']){fs[_0x72c6('0x8e')](_0x5d9d6d,_0x1b55a);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x72c6('0x8f')],'as':_0x72c6('0x90'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x72c6('0x91'),'raw':!![]}]}]});}}})[_0x72c6('0x28')](function(_0x57a826){if(!_0x57a826||!_0x57a826[_0x72c6('0x90')]||!_0x4fc315[_0x72c6('0x2f')])return _0xd3dc9a;var _0x2f1b73=_0x57a826[_0x72c6('0x92')]();return respondWithRpcPromise('SendMail',_0x72c6('0x93'),{'account':_0x2f1b73,'message':{'from':util[_0x72c6('0x7b')](_0x72c6('0x94'),_0x57a826['name'],_0x57a826[_0x72c6('0x51')]||_0x57a826[_0x72c6('0x90')][_0x72c6('0x4f')]),'to':_0x4fc315[_0x72c6('0x2f')][_0x72c6('0x79')],'subject':_0x72c6('0x95'),'text':util[_0x72c6('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4fc315[_0x72c6('0x2f')][_0x72c6('0x79')]),'attachments':[{'path':_0x5d9d6d}]}})['then'](function(){return _0xd3dc9a;})['catch'](function(_0x25470d){logger[_0x72c6('0x1a')](_0x25470d);});})[_0x72c6('0x28')](respondWithStatusCode(_0x4017ef,0xc8))[_0x72c6('0x3c')](handleError(_0x4017ef,null));};exports[_0x72c6('0x96')]=function(_0x2fb14a,_0x3fc07b){return db[_0x72c6('0x5d')][_0x72c6('0x48')]({'where':{'id':_0x2fb14a[_0x72c6('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3fc07b,null))['then'](function(_0xf65015){if(_0xf65015){return _0xf65015[_0x72c6('0x96')](_0x2fb14a[_0x72c6('0x2f')][_0x72c6('0x97')],_[_0x72c6('0x98')](_0x2fb14a['body'],[_0x72c6('0x97'),'id'])||{});}})['then'](respondWithResult(_0x3fc07b,null))[_0x72c6('0x3c')](handleError(_0x3fc07b,null));};exports[_0x72c6('0x99')]=function(_0x35ef02,_0x4f6206){var _0x2f8475={'raw':![],'where':{}};var _0xefbabf={};var _0x436180={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x72c6('0x4c')]({'where':{'id':_0x35ef02[_0x72c6('0x3d')]['id']}})[_0x72c6('0x28')](handleEntityNotFound(_0x4f6206,null))[_0x72c6('0x28')](function(_0x5e0c69){if(_0x5e0c69){_0xefbabf['model']=_[_0x72c6('0x3f')](db[_0x72c6('0x5d')][_0x72c6('0x40')]);_0xefbabf[_0x72c6('0x41')]=_[_0x72c6('0x3f')](_0x35ef02[_0x72c6('0x41')]);_0xefbabf[_0x72c6('0x42')]=_['intersection'](_0xefbabf['model'],_0xefbabf[_0x72c6('0x41')]);_0x2f8475[_0x72c6('0x43')]=_[_0x72c6('0x44')](_0xefbabf[_0x72c6('0x3e')],qs[_0x72c6('0x45')](_0x35ef02[_0x72c6('0x41')][_0x72c6('0x45')]));_0x2f8475['attributes']=_0x2f8475[_0x72c6('0x43')][_0x72c6('0x82')]?_0x2f8475[_0x72c6('0x43')]:_0xefbabf[_0x72c6('0x3e')];if(!_0x35ef02[_0x72c6('0x41')][_0x72c6('0x9a')](_0x72c6('0x9b'))){_0x2f8475[_0x72c6('0x21')]=qs['limit'](_0x35ef02[_0x72c6('0x41')][_0x72c6('0x21')]);_0x2f8475[_0x72c6('0x20')]=qs[_0x72c6('0x20')](_0x35ef02[_0x72c6('0x41')][_0x72c6('0x20')]);}_0x2f8475[_0x72c6('0x9c')]=qs[_0x72c6('0x9d')](_0x35ef02['query']['sort']);_0x2f8475[_0x72c6('0x9e')]=qs['filters'](_[_0x72c6('0x9f')](_0x35ef02[_0x72c6('0x41')],_0xefbabf[_0x72c6('0x42')]));_0x2f8475[_0x72c6('0x9e')][_0x72c6('0xa0')]=_0x5e0c69['id'];if(_0x35ef02[_0x72c6('0x41')][_0x72c6('0xa1')]){_0x2f8475[_0x72c6('0x9e')]=_[_0x72c6('0x2e')](_0x2f8475[_0x72c6('0x9e')],{'$or':_[_0x72c6('0x34')](_0x2f8475[_0x72c6('0x43')],function(_0xf65600){var _0x1ef0cd={};_0x1ef0cd[_0xf65600]={'$like':'%'+_0x35ef02[_0x72c6('0x41')][_0x72c6('0xa1')]+'%'};return _0x1ef0cd;})});}if(_0x35ef02[_0x72c6('0x41')][_0x72c6('0xa2')]){var _0x169f05=_0x35ef02['query'][_0x72c6('0xa2')][_0x72c6('0xa3')](',');var _0x44bdf9={};_0x44bdf9[_0x169f05[0x0]]={'$gte':moment(_0x169f05[0x1])[_0x72c6('0x7b')](_0x72c6('0xa4'))};_0x2f8475[_0x72c6('0x9e')]=_[_0x72c6('0x2e')](_0x2f8475[_0x72c6('0x9e')],_0x44bdf9);}_0x2f8475=_[_0x72c6('0x2e')]({},_0x2f8475,_0x35ef02[_0x72c6('0x47')]);return db['ChatMessage']['count']({'where':_0x2f8475[_0x72c6('0x9e')]})[_0x72c6('0x28')](function(_0x3ff269){_0x436180[_0x72c6('0x23')]=_0x3ff269;if(_0x35ef02[_0x72c6('0x41')]['includeAll']){_0x2f8475[_0x72c6('0x46')]=[{'all':!![]}];}return db[_0x72c6('0x5d')][_0x72c6('0x3a')](_0x2f8475);})[_0x72c6('0x28')](function(_0x3b0370){_0x436180[_0x72c6('0xa5')]=_0x3b0370;return _0x436180;});}})['then'](respondWithFilteredResult(_0x4f6206,_0x2f8475))[_0x72c6('0x3c')](handleError(_0x4f6206,null));};exports[_0x72c6('0xa6')]=function(_0x15990d,_0x5c0b39){var _0x1348d0={'where':{}},_0x5f5a1d={},_0x209f57={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x72c6('0x4c')]({'where':{'id':_0x15990d[_0x72c6('0x3d')]['id']}})[_0x72c6('0x28')](handleEntityNotFound(_0x5c0b39,null))[_0x72c6('0x28')](function(_0x4d1998){if(_0x4d1998){_0x5f5a1d[_0x72c6('0x3e')]=_[_0x72c6('0x3f')](db[_0x72c6('0x5d')]['rawAttributes']);_0x5f5a1d['query']=_[_0x72c6('0x3f')](_0x15990d[_0x72c6('0x41')]);_0x5f5a1d['filters']=_['intersection'](_0x5f5a1d[_0x72c6('0x3e')],_0x5f5a1d[_0x72c6('0x41')]);_0x1348d0['attributes']=_['intersection'](_0x5f5a1d[_0x72c6('0x3e')],qs[_0x72c6('0x45')](_0x15990d[_0x72c6('0x41')]['fields']));_0x1348d0[_0x72c6('0x43')]=_0x1348d0[_0x72c6('0x43')][_0x72c6('0x82')]?_0x1348d0[_0x72c6('0x43')]:_0x5f5a1d[_0x72c6('0x3e')];if(!_0x15990d[_0x72c6('0x41')][_0x72c6('0x9a')]('nolimit')){_0x1348d0[_0x72c6('0x21')]=qs[_0x72c6('0x21')](_0x15990d['query'][_0x72c6('0x21')]);_0x1348d0[_0x72c6('0x20')]=qs[_0x72c6('0x20')](_0x15990d[_0x72c6('0x41')][_0x72c6('0x20')]);}_0x1348d0[_0x72c6('0x9c')]=qs[_0x72c6('0x9d')](_0x15990d[_0x72c6('0x41')][_0x72c6('0x9d')]);_0x1348d0['where']=qs[_0x72c6('0x42')](_['pick'](_0x15990d['query'],_0x5f5a1d['filters']));_0x1348d0[_0x72c6('0x9e')][_0x72c6('0xa0')]=_0x4d1998['id'];if(_0x15990d[_0x72c6('0x41')][_0x72c6('0xa1')]){_0x1348d0[_0x72c6('0x9e')]=_['merge'](_0x1348d0[_0x72c6('0x9e')],{'$or':_[_0x72c6('0x34')](_0x1348d0[_0x72c6('0x43')],function(_0x4ff8b2){var _0x5a2162={};_0x5a2162[_0x4ff8b2]={'$like':'%'+_0x15990d['query']['filter']+'%'};return _0x5a2162;})});}_0x1348d0[_0x72c6('0x9e')][_0x72c6('0xa7')]=![];if(_0x15990d[_0x72c6('0x41')]['id']){_0x1348d0[_0x72c6('0x9e')]['id']={'$gt':_0x15990d['query']['id']};}_0x1348d0=_[_0x72c6('0x2e')]({},_0x1348d0,_0x15990d['options']);return db['ChatMessage'][_0x72c6('0x23')]({'where':_0x1348d0[_0x72c6('0x9e')]})['then'](function(_0x20dde9){_0x209f57[_0x72c6('0x23')]=_0x20dde9;_0x1348d0[_0x72c6('0x46')]=[];if(_0x15990d[_0x72c6('0x41')]['includeAgent']){_0x1348d0[_0x72c6('0x46')]['push']({'model':db['User'],'as':_0x72c6('0x7d'),'attributes':['id',_0x72c6('0x50'),_0x72c6('0x8a')]});}if(_0x15990d[_0x72c6('0x41')]['includeAll']){_0x1348d0[_0x72c6('0x46')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1348d0);})[_0x72c6('0x28')](function(_0x2153f5){_0x209f57[_0x72c6('0xa5')]=_0x2153f5;return _0x209f57;});}})[_0x72c6('0x28')](respondWithFilteredResult(_0x5c0b39,_0x1348d0))[_0x72c6('0x3c')](handleError(_0x5c0b39,null));};exports[_0x72c6('0xa8')]=function(_0x5a1511,_0x44fe9a){return db[_0x72c6('0x35')][_0x72c6('0x48')]({'where':{'id':_0x5a1511[_0x72c6('0x3d')]['id']}})[_0x72c6('0x28')](handleEntityNotFound(_0x44fe9a,null))[_0x72c6('0x28')](function(_0x5f36f9){if(_0x5f36f9){return _0x5f36f9[_0x72c6('0xa9')](_0x5a1511['body'][_0x72c6('0x97')],_['omit'](_0x5a1511[_0x72c6('0x2f')],[_0x72c6('0x97'),'id'])||{})[_0x72c6('0xaa')](function(){return db['Tag'][_0x72c6('0x3a')]({'attributes':['id',_0x72c6('0x2c'),_0x72c6('0xab')],'where':{'id':_0x5a1511[_0x72c6('0x2f')][_0x72c6('0x97')]}});})['then'](function(_0x1d5560){socket['emit'](_0x72c6('0xac'),{'id':Number(_0x5a1511[_0x72c6('0x3d')]['id']),'tags':_0x1d5560||[]});return{'id':Number(_0x5a1511['params']['id']),'tags':_0x1d5560||[]};});}})[_0x72c6('0x28')](respondWithResult(_0x44fe9a,null))[_0x72c6('0x3c')](handleError(_0x44fe9a,null));};exports[_0x72c6('0xad')]=function(_0x339bab,_0x3321f2){return db['ChatInteraction'][_0x72c6('0x48')]({'where':{'id':_0x339bab[_0x72c6('0x3d')]['id']}})[_0x72c6('0x28')](handleEntityNotFound(_0x3321f2,null))[_0x72c6('0x28')](function(_0x2ff82a){if(_0x2ff82a){return _0x2ff82a['removeTags'](_0x339bab[_0x72c6('0x41')][_0x72c6('0x97')]);}})[_0x72c6('0x28')](respondWithStatusCode(_0x3321f2,null))[_0x72c6('0x3c')](handleError(_0x3321f2,null));};exports[_0x72c6('0x77')]=function(_0x8609b5,_0x7622c3){var _0x204e31=moment()[_0x72c6('0xae')]()['toString']();var _0x19a017=path['join'](config['root'],_0x72c6('0xaf'),_0x72c6('0xb0'),_0x72c6('0xb1'));var _0x3828b2=path[_0x72c6('0x74')](config[_0x72c6('0x75')],_0x72c6('0xaf'),_0x72c6('0xb0'),_0x72c6('0xb2'));var _0x4254c4=path['join'](_0x19a017,_0x204e31);var _0x40d0d5=util[_0x72c6('0x7b')]('transcript-%d-%s.zip',_0x8609b5[_0x72c6('0x3d')]['id'],_0x204e31);var _0x118269=path['join'](_0x19a017,_0x40d0d5);var _0x513a61=[];_0x513a61['push']({'model':db[_0x72c6('0x7d')],'as':'User','attributes':['id',_0x72c6('0x50')],'raw':!![]});_0x513a61['push']({'model':db['CmContact'],'as':_0x72c6('0x62'),'attributes':['id',_0x72c6('0xb3'),_0x72c6('0xb4')],'raw':!![]});if(_0x8609b5[_0x72c6('0x41')][_0x72c6('0xb2')]){_0x513a61[_0x72c6('0xb5')]({'model':db[_0x72c6('0x6f')],'as':_0x72c6('0x6f'),'raw':!![]});}var _0x41cbe1=[{'model':db[_0x72c6('0x5d')],'as':_0x72c6('0x81'),'attributes':['id','body',_0x72c6('0x8d'),_0x72c6('0xb6'),_0x72c6('0xa7'),_0x72c6('0xb7')],'include':_0x513a61}];_0x41cbe1[_0x72c6('0xb5')]({'model':db[_0x72c6('0x7e')],'as':_0x72c6('0xb8'),'attributes':['id',_0x72c6('0x2c')]});_0x41cbe1[_0x72c6('0xb5')]({'model':db[_0x72c6('0x7d')],'as':_0x72c6('0xb9'),'attributes':['id','fullname']});return db[_0x72c6('0x35')]['find']({'where':{'id':_0x8609b5[_0x72c6('0x3d')]['id']},'include':_0x41cbe1})['then'](handleEntityNotFound(_0x7622c3,null))[_0x72c6('0x28')](function(_0x11e3ec){if(_0x11e3ec){var _0x1b6112=_0x11e3ec[_0x72c6('0xba')]({'plain':!![]});fs['mkdirSync'](_0x4254c4);var _0xd5321e={'channel':_0x72c6('0xbb'),'account':_0x1b6112['Account'][_0x72c6('0x2c')],'agent':_0x1b6112[_0x72c6('0xb9')]?_0x1b6112[_0x72c6('0xb9')]['fullname']:_0x72c6('0xbc'),'createdAt':moment(_0x1b6112[_0x72c6('0x8d')])[_0x72c6('0x7b')](_0x72c6('0xa4'))[_0x72c6('0xbd')](),'closedAt':_0x1b6112['closed']?moment(_0x1b6112['closedAt'])[_0x72c6('0x7b')](_0x72c6('0xa4'))[_0x72c6('0xbd')]():'','disposition':_0x1b6112[_0x72c6('0x68')],'chatInfo':{'browser':_0x1b6112['browserName'],'os':_0x1b6112[_0x72c6('0xbe')],'referer':_0x1b6112[_0x72c6('0xbf')],'customerIp':_0x1b6112[_0x72c6('0xc0')],'customerPort':_0x1b6112[_0x72c6('0xc1')]?_0x1b6112[_0x72c6('0xc1')]:_0x72c6('0xbc')},'messages':_(_0x1b6112[_0x72c6('0x81')])['tail']()[_0x72c6('0xa1')]({'secret':![]})[_0x72c6('0x34')](function(_0x2bcef1){if(_0x2bcef1[_0x72c6('0x6f')]){var _0x598bae=path[_0x72c6('0x74')](_0x3828b2,_0x2bcef1[_0x72c6('0x6f')][_0x72c6('0x6b')]);if(fs[_0x72c6('0xc2')](_0x598bae)){fs[_0x72c6('0xc3')](_0x598bae)[_0x72c6('0xc4')](fs[_0x72c6('0xc5')](path[_0x72c6('0x74')](_0x4254c4,_0x2bcef1[_0x72c6('0x6f')]['basename'])));}}return{'date':moment(_0x2bcef1[_0x72c6('0x8d')])['format'](_0x72c6('0xa4'))[_0x72c6('0xbd')](),'sender':_0x2bcef1[_0x72c6('0xb6')]===_0x72c6('0xc6')?_0x2bcef1[_0x72c6('0x7d')]?_0x2bcef1[_0x72c6('0x7d')]['fullname']:_0x72c6('0x85'):_0x2bcef1[_0x72c6('0x62')][_0x72c6('0xb3')]+(_0x2bcef1[_0x72c6('0x62')][_0x72c6('0xb4')]?'\x20'+_0x2bcef1[_0x72c6('0x62')][_0x72c6('0xb4')]:''),'body':_0x2bcef1[_0x72c6('0x6f')]?_0x2bcef1['Attachment'][_0x72c6('0x6b')]:_0x2bcef1['body'],'direction':_0x2bcef1['direction']===_0x72c6('0xc6')?'A':'C','secret':_0x2bcef1[_0x72c6('0xa7')],'read':_0x2bcef1[_0x72c6('0xb7')],'attachment':_0x2bcef1[_0x72c6('0x6f')]};})['value']()};return ejs[_0x72c6('0xc7')](path[_0x72c6('0x74')](config[_0x72c6('0x75')],_0x72c6('0xaf'),_0x72c6('0xc8'),'downloadInteraction.ejs'),{'interaction':_0xd5321e})['then'](function(_0x44e9b0){var _0x3ef588=path[_0x72c6('0x74')](_0x4254c4,_0x72c6('0xc9')+_0x1b6112['id']+'-'+_0x204e31+_0x72c6('0xca'));var _0x10cfa7={'path':_0x3ef588,'channel':_0x72c6('0xbb'),'interactionId':_0x1b6112['id']};return pdf[_0x72c6('0xcb')](_0x44e9b0,_0x10cfa7);})[_0x72c6('0x28')](function(){return new Promise(function(_0x23d23e,_0x1d80a8){zipdir(_0x4254c4,{'saveTo':_0x118269},function(_0x17ea77,_0x402997){if(_0x17ea77)return _0x1d80a8(_0x17ea77);return _0x23d23e(_0x402997);});})[_0x72c6('0x28')](function(){return new BPromise(function(_0x7efd7f,_0x2a275b){rimraf(_0x4254c4,function(_0x3e659f){if(_0x3e659f)_0x2a275b(_0x3e659f);return _0x7efd7f();});});})[_0x72c6('0x28')](function(){return _0x7622c3['download'](_0x118269,_0x40d0d5,function(_0x4571a8){if(_0x4571a8){logger['error']('err',_0x4571a8);}else{fs[_0x72c6('0xcc')](_0x118269);}});});});}else{return _0x7622c3['sendStatus'](0xc8);}})[_0x72c6('0x3c')](handleError(_0x7622c3,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index a352ea9..8bb1c52 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 _0x2f6a=['setMaxListeners','save','update','getUsers','then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x28c108,_0x15fd8d){var _0x9a21a0=function(_0x3dcd81){while(--_0x3dcd81){_0x28c108['push'](_0x28c108['shift']());}};_0x9a21a0(++_0x15fd8d);}(_0x2f6a,0xfe));var _0xa2f6=function(_0x4946a5,_0x8172ba){_0x4946a5=_0x4946a5-0x0;var _0x5590ec=_0x2f6a[_0x4946a5];return _0x5590ec;};'use strict';var EventEmitter=require(_0xa2f6('0x0'));var ChatInteraction=require(_0xa2f6('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa2f6('0x2')](0x0);var events={'afterCreate':_0xa2f6('0x3'),'afterUpdate':_0xa2f6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3789da){return function(_0x42ce64,_0x6aa74b,_0x4102ee){_0x42ce64[_0xa2f6('0x5')]({'attributes':['id'],'raw':!![]})[_0xa2f6('0x6')](function(_0x179dca){_0x42ce64['setDataValue'](_0xa2f6('0x7'),_0x179dca[_0xa2f6('0x8')](function(_0x1c62c0){return{'id':_0x1c62c0['id']};}));return ChatMessage[_0xa2f6('0x9')]({'where':{'ChatInteractionId':_0x42ce64['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa2f6('0x6')](function(_0x30c14e){_0x42ce64[_0xa2f6('0xa')]('unreadMessages',_0x30c14e[_0xa2f6('0xb')]);ChatInteractionEvents[_0xa2f6('0xc')](_0x3789da+':'+_0x42ce64['id'],_0x42ce64);ChatInteractionEvents[_0xa2f6('0xc')](_0x3789da,_0x42ce64);_0x4102ee(null);})[_0xa2f6('0xd')](_0x4102ee(null));};}for(var e in events){if(events[_0xa2f6('0xe')](e)){var event=events[e];ChatInteraction[_0xa2f6('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x876f=['getUsers','then','findAll','unreadMessages','length','emit','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x398ce3,_0x3955af){var _0x6317d8=function(_0x1c6663){while(--_0x1c6663){_0x398ce3['push'](_0x398ce3['shift']());}};_0x6317d8(++_0x3955af);}(_0x876f,0x1ba));var _0xf876=function(_0x2127a8,_0x5a5cb2){_0x2127a8=_0x2127a8-0x0;var _0x5aad94=_0x876f[_0x2127a8];return _0x5aad94;};'use strict';var EventEmitter=require(_0xf876('0x0'));var ChatInteraction=require(_0xf876('0x1'))['db'][_0xf876('0x2')];var ChatMessage=require(_0xf876('0x1'))['db'][_0xf876('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf876('0x4')](0x0);var events={'afterCreate':_0xf876('0x5'),'afterUpdate':_0xf876('0x6'),'afterDestroy':_0xf876('0x7')};function emitEvent(_0x49afb3){return function(_0x50e791,_0x38154b,_0x15a8e8){_0x50e791[_0xf876('0x8')]({'attributes':['id'],'raw':!![]})[_0xf876('0x9')](function(_0x3b8f09){_0x50e791['setDataValue']('Users',_0x3b8f09['map'](function(_0x2b45c4){return{'id':_0x2b45c4['id']};}));return ChatMessage[_0xf876('0xa')]({'where':{'ChatInteractionId':_0x50e791['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf876('0x9')](function(_0x3b0b57){_0x50e791['setDataValue'](_0xf876('0xb'),_0x3b0b57[_0xf876('0xc')]);ChatInteractionEvents[_0xf876('0xd')](_0x49afb3+':'+_0x50e791['id'],_0x50e791);ChatInteractionEvents[_0xf876('0xd')](_0x49afb3,_0x50e791);_0x15a8e8(null);})['catch'](_0x15a8e8(null));};}for(var e in events){if(events[_0xf876('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 04f1847..3c34130 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 _0xc689=['closedAt','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0xc689,0x19b));var _0x9c68=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xc689[_0x245afe];return _0x4eefde;};'use strict';var _=require(_0x9c68('0x0'));var util=require(_0x9c68('0x1'));var logger=require(_0x9c68('0x2'))(_0x9c68('0x3'));var moment=require('moment');var BPromise=require(_0x9c68('0x4'));var rp=require(_0x9c68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c68('0x6'));var config=require(_0x9c68('0x7'));var attributes=require(_0x9c68('0x8'));module[_0x9c68('0x9')]=function(_0x44aed0,_0x5c2bb1){return _0x44aed0[_0x9c68('0xa')](_0x9c68('0xb'),attributes,{'tableName':_0x9c68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ccf84,_0x281179,_0x17d91a){if(_0x4ccf84['changed'](_0x9c68('0xd'))){_0x4ccf84[_0x9c68('0xe')]=moment()[_0x9c68('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x17d91a(null,_0x4ccf84);}},'charset':'utf8mb4','collate':_0x9c68('0x10')});}; \ No newline at end of file +var _0xb34f=['ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInteraction.attributes','exports','define'];(function(_0x2181a2,_0x4e415c){var _0x2a9161=function(_0x3bba70){while(--_0x3bba70){_0x2181a2['push'](_0x2181a2['shift']());}};_0x2a9161(++_0x4e415c);}(_0xb34f,0x1ca));var _0xfb34=function(_0x5582bf,_0x556de3){_0x5582bf=_0x5582bf-0x0;var _0x43bba4=_0xb34f[_0x5582bf];return _0x43bba4;};'use strict';var _=require('lodash');var util=require(_0xfb34('0x0'));var logger=require(_0xfb34('0x1'))(_0xfb34('0x2'));var moment=require(_0xfb34('0x3'));var BPromise=require(_0xfb34('0x4'));var rp=require(_0xfb34('0x5'));var fs=require('fs');var path=require(_0xfb34('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb34('0x7'));module[_0xfb34('0x8')]=function(_0x33b3b7,_0x73bb9a){return _0x33b3b7[_0xfb34('0x9')](_0xfb34('0xa'),attributes,{'tableName':_0xfb34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57a8e6,_0x1c36cf,_0x33b6d2){if(_0x57a8e6[_0xfb34('0xc')](_0xfb34('0xd'))){_0x57a8e6['closedAt']=moment()[_0xfb34('0xe')](_0xfb34('0xf'));}_0x33b6d2(null,_0x57a8e6);}},'charset':_0xfb34('0x10'),'collate':_0xfb34('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index d0733d4..12dc94f 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 _0x8ffb=['omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateChatInteraction','update','options','raw','where','limit','debug','catch','AddTagsToChatInteraction','ChatInteraction','find','body'];(function(_0x5df8ec,_0x51017f){var _0x20ca94=function(_0x32c22c){while(--_0x32c22c){_0x5df8ec['push'](_0x5df8ec['shift']());}};_0x20ca94(++_0x51017f);}(_0x8ffb,0x1b1));var _0xb8ff=function(_0x1c12b9,_0x2e14ed){_0x1c12b9=_0x1c12b9-0x0;var _0x2784ec=_0x8ffb[_0x1c12b9];return _0x2784ec;};'use strict';var _=require(_0xb8ff('0x0'));var util=require('util');var moment=require(_0xb8ff('0x1'));var BPromise=require(_0xb8ff('0x2'));var rs=require(_0xb8ff('0x3'));var fs=require('fs');var Redis=require(_0xb8ff('0x4'));var db=require(_0xb8ff('0x5'))['db'];var utils=require(_0xb8ff('0x6'));var logger=require(_0xb8ff('0x7'))(_0xb8ff('0x8'));var config=require(_0xb8ff('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb8ff('0xa')][_0xb8ff('0xb')]({'port':0x232a});config[_0xb8ff('0xc')]=_[_0xb8ff('0xd')](config[_0xb8ff('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8ff('0xe'))(new Redis(config['redis']));require(_0xb8ff('0xf'))[_0xb8ff('0x10')](socket);function respondWithRpcPromise(_0x2b5416,_0x4d70fc,_0x22b14c){return new BPromise(function(_0x155637,_0x8aa7dc){return client[_0xb8ff('0x11')](_0x2b5416,_0x22b14c)[_0xb8ff('0x12')](function(_0x1520e0){logger[_0xb8ff('0x13')](_0xb8ff('0x14'),_0x4d70fc,'request\x20sent');logger['debug'](_0xb8ff('0x15'),_0x4d70fc,_0xb8ff('0x16'),JSON[_0xb8ff('0x17')](_0x1520e0));if(_0x1520e0[_0xb8ff('0x18')]){if(_0x1520e0['error'][_0xb8ff('0x19')]===0x1f4){logger[_0xb8ff('0x18')](_0xb8ff('0x14'),_0x4d70fc,_0x1520e0[_0xb8ff('0x18')]['message']);return _0x8aa7dc(_0x1520e0[_0xb8ff('0x18')][_0xb8ff('0x1a')]);}logger[_0xb8ff('0x18')](_0xb8ff('0x14'),_0x4d70fc,_0x1520e0[_0xb8ff('0x18')][_0xb8ff('0x1a')]);return _0x155637(_0x1520e0[_0xb8ff('0x18')][_0xb8ff('0x1a')]);}else{logger['info'](_0xb8ff('0x14'),_0x4d70fc,_0xb8ff('0x16'));_0x155637(_0x1520e0[_0xb8ff('0x1b')][_0xb8ff('0x1a')]);}})['catch'](function(_0x4adb7e){logger[_0xb8ff('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4d70fc,_0x4adb7e);_0x8aa7dc(_0x4adb7e);});});}exports[_0xb8ff('0x1c')]=function(_0x4f2ee9){var _0x240590=this;return new Promise(function(_0x14c47e,_0x3184c7){return db['ChatInteraction'][_0xb8ff('0x1d')](_0x4f2ee9['body'],{'raw':_0x4f2ee9[_0xb8ff('0x1e')]?_0x4f2ee9[_0xb8ff('0x1e')][_0xb8ff('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f2ee9[_0xb8ff('0x1e')]?_0x4f2ee9[_0xb8ff('0x1e')][_0xb8ff('0x20')]||null:null,'attributes':_0x4f2ee9[_0xb8ff('0x1e')]?_0x4f2ee9[_0xb8ff('0x1e')]['attributes']||null:null,'limit':_0x4f2ee9[_0xb8ff('0x1e')]?_0x4f2ee9['options'][_0xb8ff('0x21')]||null:null})[_0xb8ff('0x12')](function(_0x456c24){logger[_0xb8ff('0x13')]('UpdateChatInteraction',_0x4f2ee9);logger[_0xb8ff('0x22')]('UpdateChatInteraction',_0x4f2ee9,JSON[_0xb8ff('0x17')](_0x456c24));_0x14c47e(_0x456c24);})[_0xb8ff('0x23')](function(_0x458901){logger[_0xb8ff('0x18')]('UpdateChatInteraction',_0x458901[_0xb8ff('0x1a')],_0x4f2ee9);_0x3184c7(_0x240590[_0xb8ff('0x18')](0x1f4,_0x458901[_0xb8ff('0x1a')]));});});};exports[_0xb8ff('0x24')]=function(_0x367a41){return new Promise(function(_0x248e62,_0x4c4b6c){return db[_0xb8ff('0x25')][_0xb8ff('0x26')]({'where':_0x367a41[_0xb8ff('0x1e')]?_0x367a41[_0xb8ff('0x1e')][_0xb8ff('0x20')]||null:null})['then'](function(_0x2494b1){if(_0x2494b1){return _0x2494b1['addTags'](_0x367a41[_0xb8ff('0x27')]['ids'],_[_0xb8ff('0x28')](_0x367a41[_0xb8ff('0x27')],['ids','id'])||{});}})[_0xb8ff('0x29')](function(_0x43c758){logger[_0xb8ff('0x13')](_0xb8ff('0x2a'),_0x367a41);logger[_0xb8ff('0x22')](_0xb8ff('0x2a'),_0x367a41,JSON[_0xb8ff('0x17')](_0x43c758));_0x248e62(_0x43c758);})[_0xb8ff('0x23')](function(_0x2f1a48){logger[_0xb8ff('0x18')](_0xb8ff('0x2a'),_0x2f1a48['message'],_0x367a41);_0x4c4b6c(_this['error'](0x1f4,_0x2f1a48[_0xb8ff('0x1a')]));});});}; \ No newline at end of file +var _0xd05f=['code','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','body','options','raw','where','attributes','limit','then','debug','UpdateChatInteraction','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2d4269,_0x13625d){var _0x27ee8d=function(_0x54738a){while(--_0x54738a){_0x2d4269['push'](_0x2d4269['shift']());}};_0x27ee8d(++_0x13625d);}(_0xd05f,0xba));var _0xfd05=function(_0x291c1b,_0x4da125){_0x291c1b=_0x291c1b-0x0;var _0x2af172=_0xd05f[_0x291c1b];return _0x2af172;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd05('0x0'));var BPromise=require(_0xfd05('0x1'));var rs=require(_0xfd05('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd05('0x3'))['db'];var utils=require(_0xfd05('0x4'));var logger=require(_0xfd05('0x5'))(_0xfd05('0x6'));var config=require(_0xfd05('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfd05('0x8')][_0xfd05('0x9')]({'port':0x232a});config[_0xfd05('0xa')]=_['defaults'](config[_0xfd05('0xa')],{'host':_0xfd05('0xb'),'port':0x18eb});var socket=require(_0xfd05('0xc'))(new Redis(config[_0xfd05('0xa')]));require('./chatInteraction.socket')[_0xfd05('0xd')](socket);function respondWithRpcPromise(_0x19281e,_0x5b6096,_0x3276dc){return new BPromise(function(_0x2a7782,_0xf2f8f3){return client[_0xfd05('0xe')](_0x19281e,_0x3276dc)['then'](function(_0x2c3032){logger[_0xfd05('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x5b6096,_0xfd05('0x10'));logger['debug'](_0xfd05('0x11'),_0x5b6096,'request\x20sent',JSON[_0xfd05('0x12')](_0x2c3032));if(_0x2c3032['error']){if(_0x2c3032['error'][_0xfd05('0x13')]===0x1f4){logger[_0xfd05('0x14')](_0xfd05('0x15'),_0x5b6096,_0x2c3032['error'][_0xfd05('0x16')]);return _0xf2f8f3(_0x2c3032[_0xfd05('0x14')]['message']);}logger[_0xfd05('0x14')](_0xfd05('0x15'),_0x5b6096,_0x2c3032[_0xfd05('0x14')][_0xfd05('0x16')]);return _0x2a7782(_0x2c3032[_0xfd05('0x14')][_0xfd05('0x16')]);}else{logger['info'](_0xfd05('0x15'),_0x5b6096,_0xfd05('0x10'));_0x2a7782(_0x2c3032[_0xfd05('0x17')][_0xfd05('0x16')]);}})[_0xfd05('0x18')](function(_0xe76004){logger['error'](_0xfd05('0x15'),_0x5b6096,_0xe76004);_0xf2f8f3(_0xe76004);});});}exports['UpdateChatInteraction']=function(_0x5e9eba){var _0x413db7=this;return new Promise(function(_0x368096,_0x1815ff){return db[_0xfd05('0x19')]['update'](_0x5e9eba[_0xfd05('0x1a')],{'raw':_0x5e9eba[_0xfd05('0x1b')]?_0x5e9eba['options'][_0xfd05('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e9eba['options']?_0x5e9eba[_0xfd05('0x1b')][_0xfd05('0x1d')]||null:null,'attributes':_0x5e9eba[_0xfd05('0x1b')]?_0x5e9eba['options'][_0xfd05('0x1e')]||null:null,'limit':_0x5e9eba[_0xfd05('0x1b')]?_0x5e9eba['options'][_0xfd05('0x1f')]||null:null})[_0xfd05('0x20')](function(_0x1c44aa){logger[_0xfd05('0xf')]('UpdateChatInteraction',_0x5e9eba);logger[_0xfd05('0x21')](_0xfd05('0x22'),_0x5e9eba,JSON[_0xfd05('0x12')](_0x1c44aa));_0x368096(_0x1c44aa);})[_0xfd05('0x18')](function(_0x449b9d){logger[_0xfd05('0x14')](_0xfd05('0x22'),_0x449b9d[_0xfd05('0x16')],_0x5e9eba);_0x1815ff(_0x413db7[_0xfd05('0x14')](0x1f4,_0x449b9d[_0xfd05('0x16')]));});});};exports[_0xfd05('0x23')]=function(_0xcd406c){return new Promise(function(_0x17c5c1,_0x4b5ce8){return db[_0xfd05('0x19')][_0xfd05('0x24')]({'where':_0xcd406c['options']?_0xcd406c[_0xfd05('0x1b')][_0xfd05('0x1d')]||null:null})[_0xfd05('0x20')](function(_0x214fdd){if(_0x214fdd){return _0x214fdd['addTags'](_0xcd406c[_0xfd05('0x1a')][_0xfd05('0x25')],_[_0xfd05('0x26')](_0xcd406c['body'],['ids','id'])||{});}})[_0xfd05('0x27')](function(_0x16e3ed){logger[_0xfd05('0xf')](_0xfd05('0x28'),_0xcd406c);logger[_0xfd05('0x21')](_0xfd05('0x28'),_0xcd406c,JSON['stringify'](_0x16e3ed));_0x17c5c1(_0x16e3ed);})[_0xfd05('0x18')](function(_0x2f4941){logger[_0xfd05('0x14')]('AddTags',_0x2f4941[_0xfd05('0x16')],_0xcd406c);_0x4b5ce8(_this[_0xfd05('0x14')](0x1f4,_0x2f4941[_0xfd05('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d6feb0d..4845d52 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 _0x2233=['removeListener','length','./chatInteraction.events','save','remove','emit'];(function(_0x4e69ac,_0x3ca9b1){var _0x2b04ae=function(_0x45c6dc){while(--_0x45c6dc){_0x4e69ac['push'](_0x4e69ac['shift']());}};_0x2b04ae(++_0x3ca9b1);}(_0x2233,0x13a));var _0x3223=function(_0x2fbb8c,_0x15bc93){_0x2fbb8c=_0x2fbb8c-0x0;var _0x1005b4=_0x2233[_0x2fbb8c];return _0x1005b4;};'use strict';var ChatInteractionEvents=require(_0x3223('0x0'));var events=[_0x3223('0x1'),_0x3223('0x2'),'update'];function createListener(_0x30b613,_0x501022){return function(_0x412238){_0x501022[_0x3223('0x3')](_0x30b613,_0x412238);};}function removeListener(_0x343b1f,_0x284f34){return function(){ChatInteractionEvents[_0x3223('0x4')](_0x343b1f,_0x284f34);};}exports['register']=function(_0x144724){for(var _0x31c84c=0x0,_0x5c4067=events[_0x3223('0x5')];_0x31c84c<_0x5c4067;_0x31c84c++){var _0x1ee9b7=events[_0x31c84c];var _0xad1a17=createListener('chatInteraction:'+_0x1ee9b7,_0x144724);ChatInteractionEvents['on'](_0x1ee9b7,_0xad1a17);}}; \ No newline at end of file +var _0xa755=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0xcbd0e1,_0x7f490b){var _0x1fdc6e=function(_0x546b56){while(--_0x546b56){_0xcbd0e1['push'](_0xcbd0e1['shift']());}};_0x1fdc6e(++_0x7f490b);}(_0xa755,0x174));var _0x5a75=function(_0x5c12b1,_0x41da52){_0x5c12b1=_0x5c12b1-0x0;var _0xc604c9=_0xa755[_0x5c12b1];return _0xc604c9;};'use strict';var ChatInteractionEvents=require(_0x5a75('0x0'));var events=[_0x5a75('0x1'),_0x5a75('0x2'),_0x5a75('0x3')];function createListener(_0x542fc3,_0x13f211){return function(_0x3016cc){_0x13f211[_0x5a75('0x4')](_0x542fc3,_0x3016cc);};}function removeListener(_0xa8af6b,_0x34d1f9){return function(){ChatInteractionEvents[_0x5a75('0x5')](_0xa8af6b,_0x34d1f9);};}exports[_0x5a75('0x6')]=function(_0x2b0fe8){for(var _0x4caca5=0x0,_0x29bd3f=events[_0x5a75('0x7')];_0x4caca5<_0x29bd3f;_0x4caca5++){var _0x3c7f62=events[_0x4caca5];var _0x24e279=createListener(_0x5a75('0x8')+_0x3c7f62,_0x2b0fe8);ChatInteractionEvents['on'](_0x3c7f62,_0x24e279);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4c22bed..9b40134 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 _0x59af=['download','post','create','/:id/vidaoo','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59af,0x1c9));var _0xf59a=function(_0x461758,_0xb1d830){_0x461758=_0x461758-0x0;var _0x485c7a=_0x59af[_0x461758];return _0x485c7a;};'use strict';var multer=require(_0xf59a('0x0'));var util=require(_0xf59a('0x1'));var path=require(_0xf59a('0x2'));var timeout=require(_0xf59a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf59a('0x4'));var config=require(_0xf59a('0x5'));var controller=require(_0xf59a('0x6'));router['get']('/',auth[_0xf59a('0x7')](),controller[_0xf59a('0x8')]);router[_0xf59a('0x9')](_0xf59a('0xa'),auth['isAuthenticated'](),controller[_0xf59a('0xb')]);router[_0xf59a('0x9')](_0xf59a('0xc'),auth[_0xf59a('0xd')](),controller['show']);router[_0xf59a('0x9')](_0xf59a('0xe'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xf59a('0x9')](_0xf59a('0xf'),auth[_0xf59a('0x7')](),controller[_0xf59a('0x10')]);router[_0xf59a('0x9')](_0xf59a('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xf59a('0x12')]);router[_0xf59a('0x9')](_0xf59a('0x13'),auth[_0xf59a('0x7')](),controller[_0xf59a('0x14')]);router[_0xf59a('0x15')]('/',auth[_0xf59a('0x7')](),controller[_0xf59a('0x16')]);router[_0xf59a('0x15')](_0xf59a('0x17'),auth[_0xf59a('0x7')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2299f6,_0x47b107,_0x4397f8){_0x4397f8(null,path[_0xf59a('0x18')](config[_0xf59a('0x19')],_0xf59a('0x1a')));},'filename':function(_0x4689ce,_0x222947,_0x429aab){_0x429aab(null,util[_0xf59a('0x1b')](_0xf59a('0x1c'),Date[_0xf59a('0x1d')](),_0x222947[_0xf59a('0x1e')][_0xf59a('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf59a('0x15')](_0xf59a('0x20'),upload['single'](_0xf59a('0x21')),controller[_0xf59a('0x22')]);router[_0xf59a('0x15')]('/:id/messages',auth[_0xf59a('0xd')](),controller[_0xf59a('0x23')]);router[_0xf59a('0x15')](_0xf59a('0x24'),auth[_0xf59a('0x7')](),interaction[_0xf59a('0x25')](_0xf59a('0x26'),_0xf59a('0x27')),controller['addTags']);router[_0xf59a('0x28')](_0xf59a('0xc'),auth[_0xf59a('0x7')](),interaction[_0xf59a('0x25')](_0xf59a('0x26'),_0xf59a('0x29')),controller[_0xf59a('0x2a')]);router[_0xf59a('0x28')](_0xf59a('0x2b'),controller[_0xf59a('0x2c')]);router[_0xf59a('0x28')](_0xf59a('0x2d'),auth[_0xf59a('0xd')](),controller[_0xf59a('0x2e')]);router['put']('/:id/close',controller[_0xf59a('0x2f')]);router[_0xf59a('0x30')](_0xf59a('0xc'),auth[_0xf59a('0x7')](),interaction[_0xf59a('0x25')](_0xf59a('0x26'),_0xf59a('0x31')),controller[_0xf59a('0x32')]);router['delete']('/:id/tags',auth[_0xf59a('0x7')](),controller[_0xf59a('0x33')]);module[_0xf59a('0x34')]=router; \ No newline at end of file +var _0x3653=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/attachment_download','isChatInteractionAuthorized','getMessages','/:id/my_messages','getMyMessages','/:id/download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','chatinteraction:update','update','put','customUpdate','delete','chatinteraction:destroy','destroy','exports','multer'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x3653,0x8f));var _0x3365=function(_0x54227c,_0x4d9ce0){_0x54227c=_0x54227c-0x0;var _0x5bf242=_0x3653[_0x54227c];return _0x5bf242;};'use strict';var multer=require(_0x3365('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3365('0x1'));var express=require(_0x3365('0x2'));var router=express[_0x3365('0x3')]();var fs_extra=require(_0x3365('0x4'));var auth=require(_0x3365('0x5'));var interaction=require(_0x3365('0x6'));var config=require(_0x3365('0x7'));var controller=require(_0x3365('0x8'));router[_0x3365('0x9')]('/',auth[_0x3365('0xa')](),controller[_0x3365('0xb')]);router['get']('/describe',auth[_0x3365('0xa')](),controller[_0x3365('0xc')]);router[_0x3365('0x9')](_0x3365('0xd'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x3365('0x9')](_0x3365('0xe'),auth[_0x3365('0xf')](),controller['attachmentDownload']);router['get']('/:id/messages',auth[_0x3365('0xa')](),controller[_0x3365('0x10')]);router[_0x3365('0x9')](_0x3365('0x11'),auth[_0x3365('0xf')](),controller[_0x3365('0x12')]);router['get'](_0x3365('0x13'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x3365('0xa')](),controller[_0x3365('0x14')]);router[_0x3365('0x15')](_0x3365('0x16'),auth['isAuthenticated'](),controller[_0x3365('0x17')]);var upload=multer({'storage':multer[_0x3365('0x18')]({'destination':function(_0x27eb1a,_0x119a7e,_0x4a45ba){_0x4a45ba(null,path[_0x3365('0x19')](config[_0x3365('0x1a')],'server/files/attachments/'));},'filename':function(_0x29be6a,_0x5f57fb,_0xff9baa){_0xff9baa(null,util[_0x3365('0x1b')]('%s-%s',Date[_0x3365('0x1c')](),_0x5f57fb[_0x3365('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3365('0x15')](_0x3365('0x1e'),upload[_0x3365('0x1f')](_0x3365('0x20')),controller[_0x3365('0x21')]);router[_0x3365('0x15')](_0x3365('0x22'),auth[_0x3365('0xf')](),controller[_0x3365('0x23')]);router[_0x3365('0x15')](_0x3365('0x24'),auth[_0x3365('0xa')](),interaction[_0x3365('0x25')](_0x3365('0x26'),_0x3365('0x27')),controller['addTags']);router['put'](_0x3365('0xd'),auth[_0x3365('0xa')](),interaction[_0x3365('0x25')](_0x3365('0x26'),_0x3365('0x28')),controller[_0x3365('0x29')]);router[_0x3365('0x2a')]('/:id/custom_update',controller[_0x3365('0x2b')]);router[_0x3365('0x2a')]('/:id/abandon',auth[_0x3365('0xf')](),controller['abandon']);router[_0x3365('0x2a')]('/:id/close',controller['close']);router[_0x3365('0x2c')]('/:id',auth['isAuthenticated'](),interaction['tracked']('chat',_0x3365('0x2d')),controller[_0x3365('0x2e')]);router['delete'](_0x3365('0x24'),auth['isAuthenticated'](),controller['removeTags']);module[_0x3365('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index da60534..d5b32ad 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 _0x1d7e=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x1d7e,0x16c));var _0xe1d7=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x1d7e[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0xe1d7('0x0'));module[_0xe1d7('0x1')]={'body':{'type':Sequelize[_0xe1d7('0x2')](_0xe1d7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe1d7('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe1d7('0x5')]}}; \ No newline at end of file +var _0x3810=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x4811a6,_0x4c53f7){var _0x59bd19=function(_0x527be5){while(--_0x527be5){_0x4811a6['push'](_0x4811a6['shift']());}};_0x59bd19(++_0x4c53f7);}(_0x3810,0x1bc));var _0x0381=function(_0x470212,_0x1387de){_0x470212=_0x470212-0x0;var _0x5083cb=_0x3810[_0x470212];return _0x5083cb;};'use strict';var Sequelize=require(_0x0381('0x0'));module[_0x0381('0x1')]={'body':{'type':Sequelize[_0x0381('0x2')](_0x0381('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0381('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0381('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index e58d6b8..c2b7d01 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 _0xfb6f=['include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options'];(function(_0x4cbf51,_0x435be1){var _0x54e59f=function(_0x23d2c6){while(--_0x23d2c6){_0x4cbf51['push'](_0x4cbf51['shift']());}};_0x54e59f(++_0x435be1);}(_0xfb6f,0x108));var _0xffb6=function(_0x54bf68,_0x45fd68){_0x54bf68=_0x54bf68-0x0;var _0x2641e8=_0xfb6f[_0x54bf68];return _0x2641e8;};'use strict';var emlformat=require(_0xffb6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffb6('0x1'));var jsonpatch=require(_0xffb6('0x2'));var rp=require(_0xffb6('0x3'));var moment=require(_0xffb6('0x4'));var BPromise=require(_0xffb6('0x5'));var Mustache=require('mustache');var util=require(_0xffb6('0x6'));var path=require('path');var sox=require(_0xffb6('0x7'));var csv=require(_0xffb6('0x8'));var ejs=require(_0xffb6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffb6('0xa'));var squel=require(_0xffb6('0xb'));var crypto=require(_0xffb6('0xc'));var jsforce=require(_0xffb6('0xd'));var deskjs=require(_0xffb6('0xe'));var toCsv=require(_0xffb6('0x8'));var querystring=require('querystring');var Papa=require(_0xffb6('0xf'));var Redis=require(_0xffb6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xffb6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xffb6('0x12'));var logger=require(_0xffb6('0x13'))(_0xffb6('0x14'));var utils=require(_0xffb6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xffb6('0x16'))['db'];config['redis']=_[_0xffb6('0x17')](config['redis'],{'host':_0xffb6('0x18'),'port':0x18eb});var socket=require(_0xffb6('0x19'))(new Redis(config['redis']));require(_0xffb6('0x1a'))[_0xffb6('0x1b')](socket);function respondWithStatusCode(_0x590a9d,_0x1c6d1a){_0x1c6d1a=_0x1c6d1a||0xcc;return function(_0x3e1c11){if(_0x3e1c11){return _0x590a9d[_0xffb6('0x1c')](_0x1c6d1a);}return _0x590a9d[_0xffb6('0x1d')](_0x1c6d1a)['end']();};}function respondWithResult(_0x3707c9,_0x4290f2){_0x4290f2=_0x4290f2||0xc8;return function(_0x4d7046){if(_0x4d7046){return _0x3707c9[_0xffb6('0x1d')](_0x4290f2)['json'](_0x4d7046);}};}function respondWithFilteredResult(_0x483385,_0x23c2ae){return function(_0x1de8eb){if(_0x1de8eb){var _0x2b0f05=typeof _0x23c2ae[_0xffb6('0x1e')]==='undefined'&&typeof _0x23c2ae[_0xffb6('0x1f')]===_0xffb6('0x20');var _0x31fc9c=_0x1de8eb[_0xffb6('0x21')];var _0x58281c=_0x2b0f05?0x0:_0x23c2ae[_0xffb6('0x1e')];var _0x229f6c=_0x2b0f05?_0x1de8eb[_0xffb6('0x21')]:_0x23c2ae[_0xffb6('0x1e')]+_0x23c2ae[_0xffb6('0x1f')];var _0x5d8e1f;if(_0x229f6c>=_0x31fc9c){_0x229f6c=_0x31fc9c;_0x5d8e1f=0xc8;}else{_0x5d8e1f=0xce;}_0x483385[_0xffb6('0x1d')](_0x5d8e1f);return _0x483385[_0xffb6('0x22')](_0xffb6('0x23'),_0x58281c+'-'+_0x229f6c+'/'+_0x31fc9c)['json'](_0x1de8eb);}return null;};}function patchUpdates(_0x21cc07){return function(_0x2db05e){try{jsonpatch[_0xffb6('0x24')](_0x2db05e,_0x21cc07,!![]);}catch(_0x5557e1){return BPromise[_0xffb6('0x25')](_0x5557e1);}return _0x2db05e['save']();};}function saveUpdates(_0xc1d327,_0x11eea4){return function(_0x5c61af){if(_0x5c61af){return _0x5c61af[_0xffb6('0x26')](_0xc1d327)[_0xffb6('0x27')](function(_0x385d7f){return _0x385d7f;});}return null;};}function removeEntity(_0x2baa98,_0x27e861){return function(_0x2e4db6){if(_0x2e4db6){return _0x2e4db6[_0xffb6('0x28')]()[_0xffb6('0x27')](function(){_0x2baa98[_0xffb6('0x1d')](0xcc)[_0xffb6('0x29')]();});}};}function handleEntityNotFound(_0x1fb163,_0x5dbdcd){return function(_0xe281a5){if(!_0xe281a5){_0x1fb163[_0xffb6('0x1c')](0x194);}return _0xe281a5;};}function handleError(_0x2033d9,_0x44a2d9){_0x44a2d9=_0x44a2d9||0x1f4;return function(_0x54d22c){logger[_0xffb6('0x2a')](_0x54d22c[_0xffb6('0x2b')]);if(_0x54d22c[_0xffb6('0x2c')]){delete _0x54d22c[_0xffb6('0x2c')];}_0x2033d9[_0xffb6('0x1d')](_0x44a2d9)[_0xffb6('0x2d')](_0x54d22c);};}exports[_0xffb6('0x2e')]=function(_0x1df0af,_0x2c7931){var _0x4a12b0={},_0x2e991a={},_0x93a500={'count':0x0,'rows':[]};var _0x1c1f60=_[_0xffb6('0x2f')](db[_0xffb6('0x30')][_0xffb6('0x31')],function(_0x13398f){return{'name':_0x13398f['fieldName'],'type':_0x13398f[_0xffb6('0x32')]['key']};});_0x2e991a[_0xffb6('0x33')]=_[_0xffb6('0x2f')](_0x1c1f60,_0xffb6('0x2c'));_0x2e991a[_0xffb6('0x34')]=_[_0xffb6('0x35')](_0x1df0af[_0xffb6('0x34')]);_0x2e991a['filters']=_[_0xffb6('0x36')](_0x2e991a[_0xffb6('0x33')],_0x2e991a['query']);_0x4a12b0[_0xffb6('0x37')]=_[_0xffb6('0x36')](_0x2e991a[_0xffb6('0x33')],qs[_0xffb6('0x38')](_0x1df0af[_0xffb6('0x34')][_0xffb6('0x38')]));_0x4a12b0[_0xffb6('0x37')]=_0x4a12b0['attributes'][_0xffb6('0x39')]?_0x4a12b0[_0xffb6('0x37')]:_0x2e991a['model'];if(!_0x1df0af[_0xffb6('0x34')][_0xffb6('0x3a')](_0xffb6('0x3b'))){_0x4a12b0[_0xffb6('0x1f')]=qs['limit'](_0x1df0af[_0xffb6('0x34')][_0xffb6('0x1f')]);_0x4a12b0[_0xffb6('0x1e')]=qs[_0xffb6('0x1e')](_0x1df0af[_0xffb6('0x34')][_0xffb6('0x1e')]);}_0x4a12b0[_0xffb6('0x3c')]=qs[_0xffb6('0x3d')](_0x1df0af[_0xffb6('0x34')][_0xffb6('0x3d')]);_0x4a12b0['where']=qs[_0xffb6('0x3e')](_[_0xffb6('0x3f')](_0x1df0af[_0xffb6('0x34')],_0x2e991a[_0xffb6('0x3e')]),_0x1c1f60);if(_0x1df0af[_0xffb6('0x34')][_0xffb6('0x40')]){_0x4a12b0[_0xffb6('0x41')]=_[_0xffb6('0x42')](_0x4a12b0[_0xffb6('0x41')],{'$or':_[_0xffb6('0x2f')](_0x1c1f60,function(_0x1fcb23){if(_0x1fcb23[_0xffb6('0x32')]!==_0xffb6('0x43')){var _0x2fe9cd={};_0x2fe9cd[_0x1fcb23[_0xffb6('0x2c')]]={'$like':'%'+_0x1df0af[_0xffb6('0x34')]['filter']+'%'};return _0x2fe9cd;}})});}_0x4a12b0=_[_0xffb6('0x42')]({},_0x4a12b0,_0x1df0af[_0xffb6('0x44')]);var _0x372b52={'where':_0x4a12b0[_0xffb6('0x41')]};return db['ChatInternalMessage']['count'](_0x372b52)[_0xffb6('0x27')](function(_0x4fc5de){_0x93a500[_0xffb6('0x21')]=_0x4fc5de;if(_0x1df0af[_0xffb6('0x34')]['includeAll']){_0x4a12b0[_0xffb6('0x45')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xffb6('0x46')](_0x4a12b0);})['then'](function(_0x3c6218){_0x93a500[_0xffb6('0x47')]=_0x3c6218;return _0x93a500;})['then'](respondWithFilteredResult(_0x2c7931,_0x4a12b0))[_0xffb6('0x48')](handleError(_0x2c7931,null));};exports[_0xffb6('0x49')]=function(_0x506fdd,_0x52b287){var _0x33c602={'raw':!![],'where':{'id':_0x506fdd[_0xffb6('0x4a')]['id']}},_0x2e6bbe={};_0x2e6bbe[_0xffb6('0x33')]=_[_0xffb6('0x35')](db[_0xffb6('0x30')][_0xffb6('0x31')]);_0x2e6bbe[_0xffb6('0x34')]=_['keys'](_0x506fdd['query']);_0x2e6bbe[_0xffb6('0x3e')]=_['intersection'](_0x2e6bbe[_0xffb6('0x33')],_0x2e6bbe[_0xffb6('0x34')]);_0x33c602['attributes']=_['intersection'](_0x2e6bbe[_0xffb6('0x33')],qs[_0xffb6('0x38')](_0x506fdd['query'][_0xffb6('0x38')]));_0x33c602[_0xffb6('0x37')]=_0x33c602[_0xffb6('0x37')][_0xffb6('0x39')]?_0x33c602[_0xffb6('0x37')]:_0x2e6bbe['model'];if(_0x506fdd[_0xffb6('0x34')][_0xffb6('0x4b')]){_0x33c602['include']=[{'all':!![]}];}_0x33c602=_['merge']({},_0x33c602,_0x506fdd[_0xffb6('0x44')]);return db[_0xffb6('0x30')][_0xffb6('0x4c')](_0x33c602)['then'](handleEntityNotFound(_0x52b287,null))[_0xffb6('0x27')](respondWithResult(_0x52b287,null))['catch'](handleError(_0x52b287,null));};exports['create']=function(_0x30bf17,_0x25b86e){return db[_0xffb6('0x30')][_0xffb6('0x4d')](_0x30bf17['body'],{})[_0xffb6('0x27')](respondWithResult(_0x25b86e,0xc9))['catch'](handleError(_0x25b86e,null));};exports[_0xffb6('0x26')]=function(_0x57fa52,_0x1c4398){if(_0x57fa52[_0xffb6('0x4e')]['id']){delete _0x57fa52[_0xffb6('0x4e')]['id'];}return db[_0xffb6('0x30')][_0xffb6('0x4c')]({'where':{'id':_0x57fa52[_0xffb6('0x4a')]['id']}})[_0xffb6('0x27')](handleEntityNotFound(_0x1c4398,null))[_0xffb6('0x27')](saveUpdates(_0x57fa52['body'],null))[_0xffb6('0x27')](respondWithResult(_0x1c4398,null))[_0xffb6('0x48')](handleError(_0x1c4398,null));};exports[_0xffb6('0x28')]=function(_0x5c4da6,_0x316af5){return db[_0xffb6('0x30')][_0xffb6('0x4c')]({'where':{'id':_0x5c4da6[_0xffb6('0x4a')]['id']}})[_0xffb6('0x27')](handleEntityNotFound(_0x316af5,null))['then'](removeEntity(_0x316af5,null))[_0xffb6('0x48')](handleError(_0x316af5,null));};exports[_0xffb6('0x4f')]=function(_0x46f35d,_0x397e6a){return db[_0xffb6('0x30')]['describe']()[_0xffb6('0x27')](respondWithResult(_0x397e6a,null))[_0xffb6('0x48')](handleError(_0x397e6a,null));};function wrapUser(_0x41dcb8){return function(_0x27ddb7){var _0x4cdb8a=_0x41dcb8[_0xffb6('0x50')]({'plain':!![]});_0x4cdb8a['messages']=[];if(_0x27ddb7){_0x4cdb8a[_0xffb6('0x51')]=_0x27ddb7[_0xffb6('0x52')];_0x4cdb8a[_0xffb6('0x53')]=_0x27ddb7;}else{_0x4cdb8a[_0xffb6('0x51')]=moment(0x0)['format'](_0xffb6('0x54'));_0x4cdb8a[_0xffb6('0x53')]={};}return _0x4cdb8a;};}exports[_0xffb6('0x55')]=function(_0x4c761a,_0x561024,_0x514f5e){var _0x5dd2a0=[];return db[_0xffb6('0x56')][_0xffb6('0x46')]({'where':{'role':[_0xffb6('0x57'),'admin','user']},'attributes':['id',_0xffb6('0x58'),_0xffb6('0x2c'),_0xffb6('0x59'),_0xffb6('0x5a'),_0xffb6('0x5b'),_0xffb6('0x5c'),_0xffb6('0x5d'),_0xffb6('0x5e'),_0xffb6('0x5f')],'order':qs[_0xffb6('0x3d')](_0xffb6('0x60')),'include':[{'model':db['VoiceQueue'],'as':_0xffb6('0x61'),'attributes':['id',_0xffb6('0x2c'),_0xffb6('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x22ef74){if(_0x22ef74){var _0x42a4cc=_0x4c761a['user'][_0xffb6('0x50')]({'plain':!![]});if(!_0x42a4cc)throw new Error(_0xffb6('0x62'));if(_0x42a4cc[_0xffb6('0x59')]===_0xffb6('0x63')){return db[_0xffb6('0x64')][_0xffb6('0x4c')]({'where':{'name':_0xffb6('0x65'),'userProfileId':_0x42a4cc[_0xffb6('0x66')]},'raw':!![]})['then'](function(_0x273dfa){if(_0x273dfa){if(_0x273dfa[_0xffb6('0x67')]===0x0){return db[_0xffb6('0x68')][_0xffb6('0x46')]({'where':{'sectionId':_0x273dfa['id']},'raw':!![]})['then'](function(_0x310b4e){var _0x446920=[];if(_[_0xffb6('0x69')](_0x310b4e)){_0x446920=_[_0xffb6('0x40')](_0x22ef74,function(_0x32edfe){if(_0x32edfe[_0xffb6('0x59')]!=='agent'){return _0x32edfe;}});return _0x446920;}else{for(var _0x3c07b8=0x0;_0x3c07b8<_0x22ef74[_0xffb6('0x39')];_0x3c07b8++){var _0x2aa40=_0x22ef74[_0x3c07b8];if(_0x2aa40['role']===_0xffb6('0x57')){var _0x39f826=_[_0xffb6('0x4c')](_0x310b4e,function(_0x2a4864){return _0x2a4864[_0xffb6('0x6a')]===_0x2aa40['id'];});if(_0x39f826)_0x446920[_0xffb6('0x6b')](_0x2aa40);}else{_0x446920[_0xffb6('0x6b')](_0x2aa40);}}return _0x446920;}});}else{return _0x22ef74;}}else{var _0x4ad0b6=_[_0xffb6('0x40')](_0x22ef74,function(_0x166595){if(_0x166595[_0xffb6('0x59')]!==_0xffb6('0x57')){return _0x166595;}});return _0x4ad0b6;}});}else{return _0x22ef74;}}})[_0xffb6('0x27')](function(_0x35f7d5){var _0x5f01dc=[];if(_0x35f7d5){_0x5dd2a0=_0x35f7d5;for(var _0x72d12e=0x0;_0x72d12e<_0x35f7d5['length'];_0x72d12e+=0x1){_0x5dd2a0[_0x72d12e]['messages']=[];_0x5f01dc[_0xffb6('0x6b')](db['ChatInternalMessage'][_0xffb6('0x4c')]({'where':{'FromId':[_0x4c761a['user']['id'],_0x35f7d5[_0x72d12e]['id']],'ToId':[_0x4c761a['user']['id'],_0x35f7d5[_0x72d12e]['id']],'ChatGroupId':null},'attributes':['id',_0xffb6('0x52'),_0xffb6('0x6c'),_0xffb6('0x6d'),_0xffb6('0x6e'),_0xffb6('0x4e')],'order':qs[_0xffb6('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x35f7d5[_0x72d12e])));}return BPromise['all'](_0x5f01dc);}return[];})[_0xffb6('0x27')](function(_0x413219){return{'rows':_0x413219,'count':_0x413219[_0xffb6('0x39')]};})[_0xffb6('0x27')](respondWithResult(_0x561024,null))[_0xffb6('0x48')](handleError(_0x561024,null));}; \ No newline at end of file +var _0xb6fb=['order','sort','where','filters','pick','filter','type','VIRTUAL','merge','count','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','user','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','undefined','limit','set','apply','save','update','then','end','error','stack','name','send','map','ChatInternalMessage','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0xc350,_0x2fb0f8){var _0x126021=function(_0x3f0b9e){while(--_0x3f0b9e){_0xc350['push'](_0xc350['shift']());}};_0x126021(++_0x2fb0f8);}(_0xb6fb,0x188));var _0xbb6f=function(_0x9f8aa3,_0x44c052){_0x9f8aa3=_0x9f8aa3-0x0;var _0x598966=_0xb6fb[_0x9f8aa3];return _0x598966;};'use strict';var emlformat=require(_0xbb6f('0x0'));var rimraf=require(_0xbb6f('0x1'));var zipdir=require(_0xbb6f('0x2'));var jsonpatch=require(_0xbb6f('0x3'));var rp=require(_0xbb6f('0x4'));var moment=require(_0xbb6f('0x5'));var BPromise=require(_0xbb6f('0x6'));var Mustache=require(_0xbb6f('0x7'));var util=require(_0xbb6f('0x8'));var path=require('path');var sox=require(_0xbb6f('0x9'));var csv=require(_0xbb6f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb6f('0xb'));var squel=require(_0xbb6f('0xc'));var crypto=require('crypto');var jsforce=require(_0xbb6f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbb6f('0xa'));var querystring=require(_0xbb6f('0xe'));var Papa=require('papaparse');var Redis=require(_0xbb6f('0xf'));var authService=require(_0xbb6f('0x10'));var qs=require(_0xbb6f('0x11'));var as=require(_0xbb6f('0x12'));var hardwareService=require(_0xbb6f('0x13'));var logger=require('../../config/logger')(_0xbb6f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbb6f('0x15'));var db=require(_0xbb6f('0x16'))['db'];config[_0xbb6f('0x17')]=_[_0xbb6f('0x18')](config['redis'],{'host':_0xbb6f('0x19'),'port':0x18eb});var socket=require(_0xbb6f('0x1a'))(new Redis(config[_0xbb6f('0x17')]));require(_0xbb6f('0x1b'))['register'](socket);function respondWithStatusCode(_0x59aa1c,_0x4c648b){_0x4c648b=_0x4c648b||0xcc;return function(_0x36b894){if(_0x36b894){return _0x59aa1c[_0xbb6f('0x1c')](_0x4c648b);}return _0x59aa1c['status'](_0x4c648b)['end']();};}function respondWithResult(_0x5b2427,_0xc440d4){_0xc440d4=_0xc440d4||0xc8;return function(_0x47be00){if(_0x47be00){return _0x5b2427[_0xbb6f('0x1d')](_0xc440d4)[_0xbb6f('0x1e')](_0x47be00);}};}function respondWithFilteredResult(_0x1f3751,_0x14cbe0){return function(_0x308336){if(_0x308336){var _0x4453c0=typeof _0x14cbe0[_0xbb6f('0x1f')]===_0xbb6f('0x20')&&typeof _0x14cbe0[_0xbb6f('0x21')]===_0xbb6f('0x20');var _0x352b18=_0x308336['count'];var _0x5816ad=_0x4453c0?0x0:_0x14cbe0['offset'];var _0x5f38f7=_0x4453c0?_0x308336['count']:_0x14cbe0[_0xbb6f('0x1f')]+_0x14cbe0[_0xbb6f('0x21')];var _0x5e7fce;if(_0x5f38f7>=_0x352b18){_0x5f38f7=_0x352b18;_0x5e7fce=0xc8;}else{_0x5e7fce=0xce;}_0x1f3751[_0xbb6f('0x1d')](_0x5e7fce);return _0x1f3751[_0xbb6f('0x22')]('Content-Range',_0x5816ad+'-'+_0x5f38f7+'/'+_0x352b18)[_0xbb6f('0x1e')](_0x308336);}return null;};}function patchUpdates(_0x230e79){return function(_0x553712){try{jsonpatch[_0xbb6f('0x23')](_0x553712,_0x230e79,!![]);}catch(_0x158c0d){return BPromise['reject'](_0x158c0d);}return _0x553712[_0xbb6f('0x24')]();};}function saveUpdates(_0x298170,_0x351d73){return function(_0x5c4bc0){if(_0x5c4bc0){return _0x5c4bc0[_0xbb6f('0x25')](_0x298170)[_0xbb6f('0x26')](function(_0x402227){return _0x402227;});}return null;};}function removeEntity(_0x286e8f,_0x3da810){return function(_0x1a32e0){if(_0x1a32e0){return _0x1a32e0['destroy']()['then'](function(){_0x286e8f[_0xbb6f('0x1d')](0xcc)[_0xbb6f('0x27')]();});}};}function handleEntityNotFound(_0x12fe8a,_0x38a320){return function(_0x4213e3){if(!_0x4213e3){_0x12fe8a['sendStatus'](0x194);}return _0x4213e3;};}function handleError(_0x1840c0,_0x1e6eb0){_0x1e6eb0=_0x1e6eb0||0x1f4;return function(_0x7de065){logger[_0xbb6f('0x28')](_0x7de065[_0xbb6f('0x29')]);if(_0x7de065[_0xbb6f('0x2a')]){delete _0x7de065[_0xbb6f('0x2a')];}_0x1840c0[_0xbb6f('0x1d')](_0x1e6eb0)[_0xbb6f('0x2b')](_0x7de065);};}exports['index']=function(_0x207223,_0x3526ef){var _0x1350b1={},_0x32f76f={},_0x11df3c={'count':0x0,'rows':[]};var _0x291b14=_[_0xbb6f('0x2c')](db[_0xbb6f('0x2d')]['rawAttributes'],function(_0x8f9ac2){return{'name':_0x8f9ac2[_0xbb6f('0x2e')],'type':_0x8f9ac2['type']['key']};});_0x32f76f[_0xbb6f('0x2f')]=_[_0xbb6f('0x2c')](_0x291b14,_0xbb6f('0x2a'));_0x32f76f[_0xbb6f('0x30')]=_[_0xbb6f('0x31')](_0x207223[_0xbb6f('0x30')]);_0x32f76f['filters']=_['intersection'](_0x32f76f[_0xbb6f('0x2f')],_0x32f76f[_0xbb6f('0x30')]);_0x1350b1[_0xbb6f('0x32')]=_[_0xbb6f('0x33')](_0x32f76f[_0xbb6f('0x2f')],qs[_0xbb6f('0x34')](_0x207223[_0xbb6f('0x30')][_0xbb6f('0x34')]));_0x1350b1[_0xbb6f('0x32')]=_0x1350b1[_0xbb6f('0x32')][_0xbb6f('0x35')]?_0x1350b1[_0xbb6f('0x32')]:_0x32f76f['model'];if(!_0x207223[_0xbb6f('0x30')][_0xbb6f('0x36')](_0xbb6f('0x37'))){_0x1350b1[_0xbb6f('0x21')]=qs['limit'](_0x207223[_0xbb6f('0x30')]['limit']);_0x1350b1['offset']=qs[_0xbb6f('0x1f')](_0x207223[_0xbb6f('0x30')]['offset']);}_0x1350b1[_0xbb6f('0x38')]=qs[_0xbb6f('0x39')](_0x207223[_0xbb6f('0x30')]['sort']);_0x1350b1[_0xbb6f('0x3a')]=qs[_0xbb6f('0x3b')](_[_0xbb6f('0x3c')](_0x207223[_0xbb6f('0x30')],_0x32f76f[_0xbb6f('0x3b')]),_0x291b14);if(_0x207223['query'][_0xbb6f('0x3d')]){_0x1350b1[_0xbb6f('0x3a')]=_['merge'](_0x1350b1[_0xbb6f('0x3a')],{'$or':_[_0xbb6f('0x2c')](_0x291b14,function(_0x5c4263){if(_0x5c4263[_0xbb6f('0x3e')]!==_0xbb6f('0x3f')){var _0x3b07f6={};_0x3b07f6[_0x5c4263[_0xbb6f('0x2a')]]={'$like':'%'+_0x207223[_0xbb6f('0x30')]['filter']+'%'};return _0x3b07f6;}})});}_0x1350b1=_[_0xbb6f('0x40')]({},_0x1350b1,_0x207223['options']);var _0x1ab99e={'where':_0x1350b1[_0xbb6f('0x3a')]};return db[_0xbb6f('0x2d')]['count'](_0x1ab99e)[_0xbb6f('0x26')](function(_0x3a2869){_0x11df3c[_0xbb6f('0x41')]=_0x3a2869;if(_0x207223[_0xbb6f('0x30')][_0xbb6f('0x42')]){_0x1350b1[_0xbb6f('0x43')]=[{'all':!![]}];}return db[_0xbb6f('0x2d')][_0xbb6f('0x44')](_0x1350b1);})[_0xbb6f('0x26')](function(_0x1920a7){_0x11df3c[_0xbb6f('0x45')]=_0x1920a7;return _0x11df3c;})['then'](respondWithFilteredResult(_0x3526ef,_0x1350b1))['catch'](handleError(_0x3526ef,null));};exports[_0xbb6f('0x46')]=function(_0x40a9ae,_0x55bffd){var _0x37643a={'raw':!![],'where':{'id':_0x40a9ae[_0xbb6f('0x47')]['id']}},_0x375df3={};_0x375df3[_0xbb6f('0x2f')]=_['keys'](db[_0xbb6f('0x2d')][_0xbb6f('0x48')]);_0x375df3[_0xbb6f('0x30')]=_[_0xbb6f('0x31')](_0x40a9ae['query']);_0x375df3[_0xbb6f('0x3b')]=_['intersection'](_0x375df3[_0xbb6f('0x2f')],_0x375df3[_0xbb6f('0x30')]);_0x37643a[_0xbb6f('0x32')]=_[_0xbb6f('0x33')](_0x375df3[_0xbb6f('0x2f')],qs['fields'](_0x40a9ae['query']['fields']));_0x37643a[_0xbb6f('0x32')]=_0x37643a[_0xbb6f('0x32')][_0xbb6f('0x35')]?_0x37643a[_0xbb6f('0x32')]:_0x375df3[_0xbb6f('0x2f')];if(_0x40a9ae[_0xbb6f('0x30')][_0xbb6f('0x42')]){_0x37643a[_0xbb6f('0x43')]=[{'all':!![]}];}_0x37643a=_[_0xbb6f('0x40')]({},_0x37643a,_0x40a9ae['options']);return db['ChatInternalMessage']['find'](_0x37643a)[_0xbb6f('0x26')](handleEntityNotFound(_0x55bffd,null))[_0xbb6f('0x26')](respondWithResult(_0x55bffd,null))[_0xbb6f('0x49')](handleError(_0x55bffd,null));};exports[_0xbb6f('0x4a')]=function(_0x31dc93,_0x35d727){return db[_0xbb6f('0x2d')][_0xbb6f('0x4a')](_0x31dc93['body'],{})[_0xbb6f('0x26')](respondWithResult(_0x35d727,0xc9))[_0xbb6f('0x49')](handleError(_0x35d727,null));};exports[_0xbb6f('0x25')]=function(_0x277d5c,_0x1adb56){if(_0x277d5c[_0xbb6f('0x4b')]['id']){delete _0x277d5c[_0xbb6f('0x4b')]['id'];}return db[_0xbb6f('0x2d')][_0xbb6f('0x4c')]({'where':{'id':_0x277d5c['params']['id']}})[_0xbb6f('0x26')](handleEntityNotFound(_0x1adb56,null))['then'](saveUpdates(_0x277d5c[_0xbb6f('0x4b')],null))['then'](respondWithResult(_0x1adb56,null))[_0xbb6f('0x49')](handleError(_0x1adb56,null));};exports[_0xbb6f('0x4d')]=function(_0x15f6b9,_0x10a3fd){return db[_0xbb6f('0x2d')][_0xbb6f('0x4c')]({'where':{'id':_0x15f6b9[_0xbb6f('0x47')]['id']}})[_0xbb6f('0x26')](handleEntityNotFound(_0x10a3fd,null))[_0xbb6f('0x26')](removeEntity(_0x10a3fd,null))[_0xbb6f('0x49')](handleError(_0x10a3fd,null));};exports[_0xbb6f('0x4e')]=function(_0x7cac28,_0x59fae3){return db[_0xbb6f('0x2d')][_0xbb6f('0x4e')]()[_0xbb6f('0x26')](respondWithResult(_0x59fae3,null))[_0xbb6f('0x49')](handleError(_0x59fae3,null));};function wrapUser(_0x47ba20){return function(_0x3581d2){var _0x18a206=_0x47ba20[_0xbb6f('0x4f')]({'plain':!![]});_0x18a206[_0xbb6f('0x50')]=[];if(_0x3581d2){_0x18a206[_0xbb6f('0x51')]=_0x3581d2[_0xbb6f('0x52')];_0x18a206[_0xbb6f('0x53')]=_0x3581d2;}else{_0x18a206[_0xbb6f('0x51')]=moment(0x0)[_0xbb6f('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x18a206['lastMessage']={};}return _0x18a206;};}exports[_0xbb6f('0x55')]=function(_0x2ad56b,_0x398539,_0x21bf4b){var _0x3459e0=[];return db[_0xbb6f('0x56')][_0xbb6f('0x44')]({'where':{'role':[_0xbb6f('0x57'),_0xbb6f('0x58'),'user']},'attributes':['id',_0xbb6f('0x59'),_0xbb6f('0x2a'),_0xbb6f('0x5a'),_0xbb6f('0x5b'),_0xbb6f('0x5c'),'online',_0xbb6f('0x5d'),_0xbb6f('0x5e'),_0xbb6f('0x5f')],'order':qs[_0xbb6f('0x39')]('-online'),'include':[{'model':db[_0xbb6f('0x60')],'as':_0xbb6f('0x61'),'attributes':['id','name',_0xbb6f('0x3e')],'through':{'attributes':[]}}]})['then'](function(_0x5731ff){if(_0x5731ff){var _0x161825=_0x2ad56b['user'][_0xbb6f('0x4f')]({'plain':!![]});if(!_0x161825)throw new Error(_0xbb6f('0x62'));if(_0x161825[_0xbb6f('0x5a')]==='user'){return db[_0xbb6f('0x63')][_0xbb6f('0x4c')]({'where':{'name':_0xbb6f('0x64'),'userProfileId':_0x161825[_0xbb6f('0x65')]},'raw':!![]})[_0xbb6f('0x26')](function(_0x4b3590){if(_0x4b3590){if(_0x4b3590[_0xbb6f('0x66')]===0x0){return db[_0xbb6f('0x67')][_0xbb6f('0x44')]({'where':{'sectionId':_0x4b3590['id']},'raw':!![]})[_0xbb6f('0x26')](function(_0x5f34b4){var _0x4dbcac=[];if(_[_0xbb6f('0x68')](_0x5f34b4)){_0x4dbcac=_[_0xbb6f('0x3d')](_0x5731ff,function(_0x2d830c){if(_0x2d830c[_0xbb6f('0x5a')]!=='agent'){return _0x2d830c;}});return _0x4dbcac;}else{for(var _0x10def3=0x0;_0x10def3<_0x5731ff['length'];_0x10def3++){var _0xfb71d8=_0x5731ff[_0x10def3];if(_0xfb71d8[_0xbb6f('0x5a')]===_0xbb6f('0x57')){var _0x145545=_[_0xbb6f('0x4c')](_0x5f34b4,function(_0x290906){return _0x290906[_0xbb6f('0x69')]===_0xfb71d8['id'];});if(_0x145545)_0x4dbcac[_0xbb6f('0x6a')](_0xfb71d8);}else{_0x4dbcac[_0xbb6f('0x6a')](_0xfb71d8);}}return _0x4dbcac;}});}else{return _0x5731ff;}}else{var _0x590155=_[_0xbb6f('0x3d')](_0x5731ff,function(_0x452b4c){if(_0x452b4c[_0xbb6f('0x5a')]!==_0xbb6f('0x57')){return _0x452b4c;}});return _0x590155;}});}else{return _0x5731ff;}}})[_0xbb6f('0x26')](function(_0x3d24d9){var _0x473ac7=[];if(_0x3d24d9){_0x3459e0=_0x3d24d9;for(var _0x1602ee=0x0;_0x1602ee<_0x3d24d9[_0xbb6f('0x35')];_0x1602ee+=0x1){_0x3459e0[_0x1602ee][_0xbb6f('0x50')]=[];_0x473ac7[_0xbb6f('0x6a')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x2ad56b[_0xbb6f('0x6b')]['id'],_0x3d24d9[_0x1602ee]['id']],'ToId':[_0x2ad56b[_0xbb6f('0x6b')]['id'],_0x3d24d9[_0x1602ee]['id']],'ChatGroupId':null},'attributes':['id',_0xbb6f('0x52'),_0xbb6f('0x6c'),_0xbb6f('0x6d'),_0xbb6f('0x6e'),'body'],'order':qs[_0xbb6f('0x39')](_0xbb6f('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbb6f('0x26')](wrapUser(_0x3d24d9[_0x1602ee])));}return BPromise['all'](_0x473ac7);}return[];})[_0xbb6f('0x26')](function(_0x46e77e){return{'rows':_0x46e77e,'count':_0x46e77e[_0xbb6f('0x35')]};})[_0xbb6f('0x26')](respondWithResult(_0x398539,null))[_0xbb6f('0x49')](handleError(_0x398539,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index fb97c23..025493d 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 _0x9514=['save','update','remove','emit','hasOwnProperty','exports','events','ChatInternalMessage','setMaxListeners'];(function(_0x1ea943,_0x7230b4){var _0x26aa1c=function(_0x3d0fc1){while(--_0x3d0fc1){_0x1ea943['push'](_0x1ea943['shift']());}};_0x26aa1c(++_0x7230b4);}(_0x9514,0x1da));var _0x4951=function(_0x4b22b3,_0x557b4c){_0x4b22b3=_0x4b22b3-0x0;var _0x34086e=_0x9514[_0x4b22b3];return _0x34086e;};'use strict';var EventEmitter=require(_0x4951('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x4951('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4951('0x2')](0x0);var events={'afterCreate':_0x4951('0x3'),'afterUpdate':_0x4951('0x4'),'afterDestroy':_0x4951('0x5')};function emitEvent(_0x2f452d){return function(_0x3b1be5,_0x47e8ba,_0x1729df){ChatInternalMessageEvents['emit'](_0x2f452d+':'+_0x3b1be5['id'],_0x3b1be5);ChatInternalMessageEvents[_0x4951('0x6')](_0x2f452d,_0x3b1be5);_0x1729df(null);};}for(var e in events){if(events[_0x4951('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x4951('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x5686=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x5686,0x1be));var _0x6568=function(_0x266ddc,_0x45aa52){_0x266ddc=_0x266ddc-0x0;var _0x39c1d7=_0x5686[_0x266ddc];return _0x39c1d7;};'use strict';var EventEmitter=require(_0x6568('0x0'));var ChatInternalMessage=require(_0x6568('0x1'))['db'][_0x6568('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6568('0x3')](0x0);var events={'afterCreate':_0x6568('0x4'),'afterUpdate':_0x6568('0x5'),'afterDestroy':_0x6568('0x6')};function emitEvent(_0x2e381f){return function(_0x2e4089,_0x24129b,_0xc95c){ChatInternalMessageEvents['emit'](_0x2e381f+':'+_0x2e4089['id'],_0x2e4089);ChatInternalMessageEvents[_0x6568('0x7')](_0x2e381f,_0x2e4089);_0xc95c(null);};}for(var e in events){if(events[_0x6568('0x8')](e)){var event=events[e];ChatInternalMessage[_0x6568('0x9')](e,emitEvent(event));}}module[_0x6568('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 1776ab8..ce86b8a 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 _0xe611=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','utf8mb4','utf8mb4_unicode_ci'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe611,0x180));var _0x1e61=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xe611[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x1e61('0x0'));var util=require(_0x1e61('0x1'));var logger=require('../../config/logger')(_0x1e61('0x2'));var moment=require(_0x1e61('0x3'));var BPromise=require(_0x1e61('0x4'));var rp=require(_0x1e61('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e61('0x6'));var config=require(_0x1e61('0x7'));var attributes=require(_0x1e61('0x8'));module[_0x1e61('0x9')]=function(_0xef3ac6,_0x558ec5){return _0xef3ac6['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e61('0xa'),'collate':_0x1e61('0xb')});}; \ No newline at end of file +var _0x6361=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6361,0x110));var _0x1636=function(_0x4c5645,_0x19edb0){_0x4c5645=_0x4c5645-0x0;var _0x2612cf=_0x6361[_0x4c5645];return _0x2612cf;};'use strict';var _=require(_0x1636('0x0'));var util=require('util');var logger=require(_0x1636('0x1'))('api');var moment=require(_0x1636('0x2'));var BPromise=require(_0x1636('0x3'));var rp=require(_0x1636('0x4'));var fs=require('fs');var path=require(_0x1636('0x5'));var rimraf=require('rimraf');var config=require(_0x1636('0x6'));var attributes=require(_0x1636('0x7'));module[_0x1636('0x8')]=function(_0x4338d0,_0x319496){return _0x4338d0[_0x1636('0x9')](_0x1636('0xa'),attributes,{'tableName':_0x1636('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1636('0xc'),'collate':_0x1636('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index c5f6689..cee38e3 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 _0x7bfa=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','bluebird','randomstring','../../mysqldb'];(function(_0x70d3b5,_0x4bbd30){var _0x4f96d6=function(_0x25798d){while(--_0x25798d){_0x70d3b5['push'](_0x70d3b5['shift']());}};_0x4f96d6(++_0x4bbd30);}(_0x7bfa,0x173));var _0xa7bf=function(_0x5106c1,_0x13233a){_0x5106c1=_0x5106c1-0x0;var _0x5bcaac=_0x7bfa[_0x5106c1];return _0x5bcaac;};'use strict';var _=require(_0xa7bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa7bf('0x1'));var rs=require(_0xa7bf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7bf('0x3'))['db'];var utils=require(_0xa7bf('0x4'));var logger=require(_0xa7bf('0x5'))(_0xa7bf('0x6'));var config=require(_0xa7bf('0x7'));var jayson=require(_0xa7bf('0x8'));var client=jayson[_0xa7bf('0x9')][_0xa7bf('0xa')]({'port':0x232a});config[_0xa7bf('0xb')]=_[_0xa7bf('0xc')](config[_0xa7bf('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7bf('0xb')]));require(_0xa7bf('0xd'))[_0xa7bf('0xe')](socket);function respondWithRpcPromise(_0x184f7d,_0x341f8e,_0x2f6cc4){return new BPromise(function(_0x2f72c3,_0x575c80){return client[_0xa7bf('0xf')](_0x184f7d,_0x2f6cc4)[_0xa7bf('0x10')](function(_0x502c88){logger[_0xa7bf('0x11')](_0xa7bf('0x12'),_0x341f8e,_0xa7bf('0x13'));logger[_0xa7bf('0x14')](_0xa7bf('0x15'),_0x341f8e,_0xa7bf('0x13'),JSON['stringify'](_0x502c88));if(_0x502c88[_0xa7bf('0x16')]){if(_0x502c88[_0xa7bf('0x16')]['code']===0x1f4){logger[_0xa7bf('0x16')](_0xa7bf('0x12'),_0x341f8e,_0x502c88[_0xa7bf('0x16')][_0xa7bf('0x17')]);return _0x575c80(_0x502c88['error'][_0xa7bf('0x17')]);}logger['error'](_0xa7bf('0x12'),_0x341f8e,_0x502c88[_0xa7bf('0x16')][_0xa7bf('0x17')]);return _0x2f72c3(_0x502c88[_0xa7bf('0x16')][_0xa7bf('0x17')]);}else{logger[_0xa7bf('0x11')](_0xa7bf('0x12'),_0x341f8e,'request\x20sent');_0x2f72c3(_0x502c88['result'][_0xa7bf('0x17')]);}})[_0xa7bf('0x18')](function(_0x4a5f29){logger[_0xa7bf('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x341f8e,_0x4a5f29);_0x575c80(_0x4a5f29);});});} \ No newline at end of file +var _0x59bb=['request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInternalMessage.socket'];(function(_0x253ad4,_0x969b41){var _0x3498b9=function(_0x4ca5c4){while(--_0x4ca5c4){_0x253ad4['push'](_0x253ad4['shift']());}};_0x3498b9(++_0x969b41);}(_0x59bb,0x88));var _0xb59b=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x59bb[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xb59b('0x0'));var util=require(_0xb59b('0x1'));var moment=require('moment');var BPromise=require(_0xb59b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb59b('0x3'));var db=require(_0xb59b('0x4'))['db'];var utils=require(_0xb59b('0x5'));var logger=require(_0xb59b('0x6'))('rpc');var config=require(_0xb59b('0x7'));var jayson=require(_0xb59b('0x8'));var client=jayson[_0xb59b('0x9')][_0xb59b('0xa')]({'port':0x232a});config[_0xb59b('0xb')]=_[_0xb59b('0xc')](config[_0xb59b('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb59b('0xb')]));require(_0xb59b('0xd'))['register'](socket);function respondWithRpcPromise(_0x1f4ad7,_0x313590,_0x4e2a4a){return new BPromise(function(_0x3b452a,_0x498621){return client[_0xb59b('0xe')](_0x1f4ad7,_0x4e2a4a)['then'](function(_0x10f5d7){logger[_0xb59b('0xf')](_0xb59b('0x10'),_0x313590,_0xb59b('0x11'));logger[_0xb59b('0x12')](_0xb59b('0x13'),_0x313590,_0xb59b('0x11'),JSON[_0xb59b('0x14')](_0x10f5d7));if(_0x10f5d7[_0xb59b('0x15')]){if(_0x10f5d7[_0xb59b('0x15')]['code']===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x313590,_0x10f5d7[_0xb59b('0x15')][_0xb59b('0x16')]);return _0x498621(_0x10f5d7['error'][_0xb59b('0x16')]);}logger[_0xb59b('0x15')](_0xb59b('0x10'),_0x313590,_0x10f5d7[_0xb59b('0x15')][_0xb59b('0x16')]);return _0x3b452a(_0x10f5d7['error']['message']);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x313590,_0xb59b('0x11'));_0x3b452a(_0x10f5d7[_0xb59b('0x17')][_0xb59b('0x16')]);}})[_0xb59b('0x18')](function(_0x323511){logger[_0xb59b('0x15')](_0xb59b('0x10'),_0x313590,_0x323511);_0x498621(_0x323511);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 95bb086..105fa12 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 _0x5d7d=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','register'];(function(_0x222641,_0x5ca2e0){var _0x334dc5=function(_0x5736fd){while(--_0x5736fd){_0x222641['push'](_0x222641['shift']());}};_0x334dc5(++_0x5ca2e0);}(_0x5d7d,0x1ec));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xd5d7('0x0'));var events=[_0xd5d7('0x1'),_0xd5d7('0x2'),_0xd5d7('0x3')];function createListener(_0x42c6e9,_0x5789ec){return function(_0xc292f1){_0x5789ec['emit'](_0x42c6e9,_0xc292f1);};}function removeListener(_0xc717d7,_0x5e838e){return function(){ChatInternalMessageEvents['removeListener'](_0xc717d7,_0x5e838e);};}exports[_0xd5d7('0x4')]=function(_0x28869e){for(var _0x28fcce=0x0,_0x1c0221=events[_0xd5d7('0x5')];_0x28fcce<_0x1c0221;_0x28fcce++){var _0x39867e=events[_0x28fcce];var _0x33ee14=createListener(_0xd5d7('0x6')+_0x39867e,_0x28869e);ChatInternalMessageEvents['on'](_0x39867e,_0x33ee14);}}; \ No newline at end of file +var _0x03d6=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x03d6,0x1ba));var _0x603d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03d6[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x603d('0x0'));var events=[_0x603d('0x1'),_0x603d('0x2'),_0x603d('0x3')];function createListener(_0x12f664,_0x5cb08b){return function(_0x544021){_0x5cb08b[_0x603d('0x4')](_0x12f664,_0x544021);};}function removeListener(_0x49ad82,_0x32f665){return function(){ChatInternalMessageEvents[_0x603d('0x5')](_0x49ad82,_0x32f665);};}exports[_0x603d('0x6')]=function(_0x247e67){for(var _0x572d0a=0x0,_0x48937e=events[_0x603d('0x7')];_0x572d0a<_0x48937e;_0x572d0a++){var _0x3b2c3a=events[_0x572d0a];var _0x4e8782=createListener(_0x603d('0x8')+_0x3b2c3a,_0x247e67);ChatInternalMessageEvents['on'](_0x3b2c3a,_0x4e8782);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index bcaccdd..169b07e 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 _0x1d5f=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id'];(function(_0x189d3c,_0x5efebf){var _0x485959=function(_0x1161da){while(--_0x1161da){_0x189d3c['push'](_0x189d3c['shift']());}};_0x485959(++_0x5efebf);}(_0x1d5f,0xbf));var _0xf1d5=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x1d5f[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0xf1d5('0x0'));var util=require(_0xf1d5('0x1'));var path=require(_0xf1d5('0x2'));var timeout=require(_0xf1d5('0x3'));var express=require('express');var router=express[_0xf1d5('0x4')]();var fs_extra=require(_0xf1d5('0x5'));var auth=require(_0xf1d5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf1d5('0x7'));var controller=require(_0xf1d5('0x8'));router[_0xf1d5('0x9')]('/',auth[_0xf1d5('0xa')](),controller['index']);router[_0xf1d5('0x9')](_0xf1d5('0xb'),auth[_0xf1d5('0xa')](),controller[_0xf1d5('0xc')]);router[_0xf1d5('0x9')](_0xf1d5('0xd'),auth[_0xf1d5('0xa')](),controller[_0xf1d5('0xe')]);router['get'](_0xf1d5('0xf'),auth[_0xf1d5('0xa')](),controller[_0xf1d5('0x10')]);router[_0xf1d5('0x11')]('/',auth['isAuthenticated'](),controller[_0xf1d5('0x12')]);router[_0xf1d5('0x13')](_0xf1d5('0xf'),controller[_0xf1d5('0x14')]);router[_0xf1d5('0x15')](_0xf1d5('0xf'),auth[_0xf1d5('0xa')](),controller[_0xf1d5('0x16')]);module['exports']=router; \ No newline at end of file +var _0xab52=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post','create','put','update'];(function(_0x4dde2a,_0x5411d6){var _0x289aeb=function(_0x2429bd){while(--_0x2429bd){_0x4dde2a['push'](_0x4dde2a['shift']());}};_0x289aeb(++_0x5411d6);}(_0xab52,0x15b));var _0x2ab5=function(_0x2ba900,_0x15b5ae){_0x2ba900=_0x2ba900-0x0;var _0xed894e=_0xab52[_0x2ba900];return _0xed894e;};'use strict';var multer=require(_0x2ab5('0x0'));var util=require(_0x2ab5('0x1'));var path=require(_0x2ab5('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ab5('0x3'));var router=express[_0x2ab5('0x4')]();var fs_extra=require(_0x2ab5('0x5'));var auth=require(_0x2ab5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ab5('0x7'));var controller=require(_0x2ab5('0x8'));router[_0x2ab5('0x9')]('/',auth[_0x2ab5('0xa')](),controller[_0x2ab5('0xb')]);router['get']('/describe',auth[_0x2ab5('0xa')](),controller[_0x2ab5('0xc')]);router[_0x2ab5('0x9')](_0x2ab5('0xd'),auth[_0x2ab5('0xa')](),controller[_0x2ab5('0xe')]);router[_0x2ab5('0x9')](_0x2ab5('0xf'),auth['isAuthenticated'](),controller[_0x2ab5('0x10')]);router[_0x2ab5('0x11')]('/',auth[_0x2ab5('0xa')](),controller[_0x2ab5('0x12')]);router[_0x2ab5('0x13')]('/:id',controller[_0x2ab5('0x14')]);router['delete'](_0x2ab5('0xf'),auth['isAuthenticated'](),controller[_0x2ab5('0x15')]);module[_0x2ab5('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2eb53d9..bf0644e 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 _0xbc87=['STRING','TEXT','sequelize','medium','BOOLEAN','out','DATE'];(function(_0x5c3101,_0x332896){var _0x3e328d=function(_0x4d7f1a){while(--_0x4d7f1a){_0x5c3101['push'](_0x5c3101['shift']());}};_0x3e328d(++_0x332896);}(_0xbc87,0x144));var _0x7bc8=function(_0x11b849,_0x433d21){_0x11b849=_0x11b849-0x0;var _0x3d9cdc=_0xbc87[_0x11b849];return _0x3d9cdc;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7bc8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7bc8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7bc8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x7bc8('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7bc8('0x4')]},'providerName':{'type':Sequelize[_0x7bc8('0x5')]},'providerResponse':{'type':Sequelize[_0x7bc8('0x6')]}}; \ No newline at end of file +var _0x757a=['exports','TEXT','ENUM','out','DATE','STRING'];(function(_0x3a4762,_0x4d5e81){var _0x4edacd=function(_0x3b1a04){while(--_0x3b1a04){_0x3a4762['push'](_0x3a4762['shift']());}};_0x4edacd(++_0x4d5e81);}(_0x757a,0xde));var _0xa757=function(_0x1bc553,_0x1416bf){_0x1bc553=_0x1bc553-0x0;var _0x5d5cb9=_0x757a[_0x1bc553];return _0x5d5cb9;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa757('0x2')]('in',_0xa757('0x3')),'defaultValue':_0xa757('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa757('0x4')]},'providerName':{'type':Sequelize[_0xa757('0x5')]},'providerResponse':{'type':Sequelize[_0xa757('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 8f7ed42..a4f2388 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 _0x2430=['key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','type','filter','ChatMessage','includeAll','include','findAll','show','params','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','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','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','stringify','RejectMessage','interface','event','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','stack','name','rawAttributes','fieldName'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2430,0x1d2));var _0x0243=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x2430[_0x277107];return _0x1da046;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0243('0x0'));var zipdir=require(_0x0243('0x1'));var jsonpatch=require(_0x0243('0x2'));var rp=require(_0x0243('0x3'));var moment=require(_0x0243('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0243('0x5'));var path=require(_0x0243('0x6'));var sox=require(_0x0243('0x7'));var csv=require(_0x0243('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0243('0x9'));var squel=require(_0x0243('0xa'));var crypto=require('crypto');var jsforce=require(_0x0243('0xb'));var deskjs=require(_0x0243('0xc'));var toCsv=require(_0x0243('0x8'));var querystring=require(_0x0243('0xd'));var Papa=require(_0x0243('0xe'));var Redis=require(_0x0243('0xf'));var authService=require(_0x0243('0x10'));var qs=require(_0x0243('0x11'));var as=require(_0x0243('0x12'));var hardwareService=require(_0x0243('0x13'));var logger=require(_0x0243('0x14'))(_0x0243('0x15'));var utils=require(_0x0243('0x16'));var config=require(_0x0243('0x17'));var licenseUtil=require(_0x0243('0x18'));var db=require(_0x0243('0x19'))['db'];config[_0x0243('0x1a')]=_['defaults'](config[_0x0243('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0243('0x1b'))(new Redis(config[_0x0243('0x1a')]));require('./chatMessage.socket')[_0x0243('0x1c')](socket);var jayson=require(_0x0243('0x1d'));var client=jayson['client'][_0x0243('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x106919,_0x4ef68b,_0x3a482f,_0x455276){return new BPromise(function(_0x438490,_0x50b9ac){var _0x4cc56a=_0x455276||client;return _0x4cc56a[_0x0243('0x1f')](_0x106919,_0x3a482f)['then'](function(_0x57a3ba){logger[_0x0243('0x20')](_0x0243('0x21'),_0x4ef68b,_0x0243('0x22'));logger[_0x0243('0x23')](_0x0243('0x24'),_0x4ef68b,_0x0243('0x22'),JSON['stringify'](_0x57a3ba));if(_0x57a3ba['error']){if(_0x57a3ba[_0x0243('0x25')][_0x0243('0x26')]===0x1f4){logger['error'](_0x0243('0x21'),_0x4ef68b,_0x57a3ba[_0x0243('0x25')][_0x0243('0x27')]);return _0x50b9ac(_0x57a3ba[_0x0243('0x25')][_0x0243('0x27')]);}logger[_0x0243('0x25')](_0x0243('0x21'),_0x4ef68b,_0x57a3ba[_0x0243('0x25')][_0x0243('0x27')]);return _0x438490(_0x57a3ba[_0x0243('0x25')][_0x0243('0x27')]);}else{logger[_0x0243('0x20')]('ChatMessage,\x20%s,\x20%s',_0x4ef68b,_0x0243('0x22'));_0x438490(_0x57a3ba['result'][_0x0243('0x27')]);}})[_0x0243('0x28')](function(_0x2d404d){logger['error'](_0x0243('0x21'),_0x4ef68b,_0x2d404d);_0x50b9ac(_0x2d404d);});});}function respondWithStatusCode(_0x5ccf04,_0x14f7d9){_0x14f7d9=_0x14f7d9||0xcc;return function(_0x287ca9){if(_0x287ca9){return _0x5ccf04[_0x0243('0x29')](_0x14f7d9);}return _0x5ccf04[_0x0243('0x2a')](_0x14f7d9)[_0x0243('0x2b')]();};}function respondWithResult(_0x3fd9f6,_0x3fc423){_0x3fc423=_0x3fc423||0xc8;return function(_0x38e102){if(_0x38e102){return _0x3fd9f6['status'](_0x3fc423)[_0x0243('0x2c')](_0x38e102);}};}function respondWithFilteredResult(_0x1e299d,_0x2f8480){return function(_0x190162){if(_0x190162){var _0x1ed860=typeof _0x2f8480[_0x0243('0x2d')]==='undefined'&&typeof _0x2f8480[_0x0243('0x2e')]===_0x0243('0x2f');var _0x19824c=_0x190162[_0x0243('0x30')];var _0x6f369d=_0x1ed860?0x0:_0x2f8480['offset'];var _0x66e973=_0x1ed860?_0x190162[_0x0243('0x30')]:_0x2f8480[_0x0243('0x2d')]+_0x2f8480['limit'];var _0x2b394c;if(_0x66e973>=_0x19824c){_0x66e973=_0x19824c;_0x2b394c=0xc8;}else{_0x2b394c=0xce;}_0x1e299d[_0x0243('0x2a')](_0x2b394c);return _0x1e299d['set'](_0x0243('0x31'),_0x6f369d+'-'+_0x66e973+'/'+_0x19824c)['json'](_0x190162);}return null;};}function patchUpdates(_0x4fd9c2){return function(_0x401ec1){try{jsonpatch[_0x0243('0x32')](_0x401ec1,_0x4fd9c2,!![]);}catch(_0x3420c8){return BPromise[_0x0243('0x33')](_0x3420c8);}return _0x401ec1['save']();};}function saveUpdates(_0x1f1e71,_0x2f7f51){return function(_0x2df36c){if(_0x2df36c){return _0x2df36c[_0x0243('0x34')](_0x1f1e71)[_0x0243('0x35')](function(_0x4b49f9){return _0x4b49f9;});}return null;};}function removeEntity(_0x346ba7,_0x25a716){return function(_0x4cb1ba){if(_0x4cb1ba){return _0x4cb1ba['destroy']()[_0x0243('0x35')](function(){_0x346ba7['status'](0xcc)[_0x0243('0x2b')]();});}};}function handleEntityNotFound(_0xd99d4f,_0x14f7f6){return function(_0x6c5e){if(!_0x6c5e){_0xd99d4f['sendStatus'](0x194);}return _0x6c5e;};}function handleError(_0x2df13f,_0x32bae2){_0x32bae2=_0x32bae2||0x1f4;return function(_0x45a82c){logger[_0x0243('0x25')](_0x45a82c[_0x0243('0x36')]);if(_0x45a82c[_0x0243('0x37')]){delete _0x45a82c[_0x0243('0x37')];}_0x2df13f[_0x0243('0x2a')](_0x32bae2)['send'](_0x45a82c);};}exports['index']=function(_0x51f71a,_0x4b038f){var _0x232ad4={},_0x3261ca={},_0x3e0aed={'count':0x0,'rows':[]};var _0x1e169c=_['map'](db['ChatMessage'][_0x0243('0x38')],function(_0x1d38af){return{'name':_0x1d38af[_0x0243('0x39')],'type':_0x1d38af['type'][_0x0243('0x3a')]};});_0x3261ca[_0x0243('0x3b')]=_['map'](_0x1e169c,'name');_0x3261ca['query']=_[_0x0243('0x3c')](_0x51f71a['query']);_0x3261ca[_0x0243('0x3d')]=_[_0x0243('0x3e')](_0x3261ca['model'],_0x3261ca[_0x0243('0x3f')]);_0x232ad4['attributes']=_[_0x0243('0x3e')](_0x3261ca['model'],qs[_0x0243('0x40')](_0x51f71a[_0x0243('0x3f')][_0x0243('0x40')]));_0x232ad4['attributes']=_0x232ad4[_0x0243('0x41')][_0x0243('0x42')]?_0x232ad4[_0x0243('0x41')]:_0x3261ca[_0x0243('0x3b')];if(!_0x51f71a[_0x0243('0x3f')][_0x0243('0x43')](_0x0243('0x44'))){_0x232ad4[_0x0243('0x2e')]=qs['limit'](_0x51f71a['query'][_0x0243('0x2e')]);_0x232ad4['offset']=qs[_0x0243('0x2d')](_0x51f71a[_0x0243('0x3f')][_0x0243('0x2d')]);}_0x232ad4[_0x0243('0x45')]=qs['sort'](_0x51f71a[_0x0243('0x3f')][_0x0243('0x46')]);_0x232ad4['where']=qs[_0x0243('0x3d')](_[_0x0243('0x47')](_0x51f71a[_0x0243('0x3f')],_0x3261ca['filters']),_0x1e169c);if(_0x51f71a[_0x0243('0x3f')]['filter']){_0x232ad4[_0x0243('0x48')]=_[_0x0243('0x49')](_0x232ad4[_0x0243('0x48')],{'$or':_[_0x0243('0x4a')](_0x1e169c,function(_0x10cf3f){if(_0x10cf3f[_0x0243('0x4b')]!=='VIRTUAL'){var _0x4982d9={};_0x4982d9[_0x10cf3f['name']]={'$like':'%'+_0x51f71a[_0x0243('0x3f')][_0x0243('0x4c')]+'%'};return _0x4982d9;}})});}_0x232ad4=_[_0x0243('0x49')]({},_0x232ad4,_0x51f71a['options']);var _0x1be75e={'where':_0x232ad4['where']};return db[_0x0243('0x4d')][_0x0243('0x30')](_0x1be75e)[_0x0243('0x35')](function(_0x2feffa){_0x3e0aed[_0x0243('0x30')]=_0x2feffa;if(_0x51f71a[_0x0243('0x3f')][_0x0243('0x4e')]){_0x232ad4[_0x0243('0x4f')]=[{'all':!![]}];}return db[_0x0243('0x4d')][_0x0243('0x50')](_0x232ad4);})[_0x0243('0x35')](function(_0x3c4d20){_0x3e0aed['rows']=_0x3c4d20;return _0x3e0aed;})[_0x0243('0x35')](respondWithFilteredResult(_0x4b038f,_0x232ad4))['catch'](handleError(_0x4b038f,null));};exports[_0x0243('0x51')]=function(_0x47d6ba,_0x3557e5){var _0x3a6a5d={'raw':!![],'where':{'id':_0x47d6ba[_0x0243('0x52')]['id']}},_0x1e2049={};_0x1e2049[_0x0243('0x3b')]=_[_0x0243('0x3c')](db[_0x0243('0x4d')][_0x0243('0x38')]);_0x1e2049[_0x0243('0x3f')]=_[_0x0243('0x3c')](_0x47d6ba[_0x0243('0x3f')]);_0x1e2049[_0x0243('0x3d')]=_[_0x0243('0x3e')](_0x1e2049[_0x0243('0x3b')],_0x1e2049[_0x0243('0x3f')]);_0x3a6a5d[_0x0243('0x41')]=_[_0x0243('0x3e')](_0x1e2049['model'],qs[_0x0243('0x40')](_0x47d6ba['query']['fields']));_0x3a6a5d[_0x0243('0x41')]=_0x3a6a5d[_0x0243('0x41')][_0x0243('0x42')]?_0x3a6a5d['attributes']:_0x1e2049[_0x0243('0x3b')];if(_0x47d6ba[_0x0243('0x3f')]['includeAll']){_0x3a6a5d['include']=[{'all':!![]}];}_0x3a6a5d=_[_0x0243('0x49')]({},_0x3a6a5d,_0x47d6ba[_0x0243('0x53')]);return db['ChatMessage'][_0x0243('0x54')](_0x3a6a5d)['then'](handleEntityNotFound(_0x3557e5,null))[_0x0243('0x35')](respondWithResult(_0x3557e5,null))['catch'](handleError(_0x3557e5,null));};exports[_0x0243('0x55')]=function(_0x57c888,_0xdb6ea9){return db[_0x0243('0x4d')][_0x0243('0x55')](_0x57c888[_0x0243('0x56')],{})[_0x0243('0x35')](respondWithResult(_0xdb6ea9,0xc9))[_0x0243('0x28')](handleError(_0xdb6ea9,null));};exports[_0x0243('0x34')]=function(_0x5e41e8,_0x1cb7e6){if(_0x5e41e8[_0x0243('0x56')]['id']){delete _0x5e41e8[_0x0243('0x56')]['id'];}return db[_0x0243('0x4d')][_0x0243('0x54')]({'where':{'id':_0x5e41e8[_0x0243('0x52')]['id']}})[_0x0243('0x35')](handleEntityNotFound(_0x1cb7e6,null))[_0x0243('0x35')](saveUpdates(_0x5e41e8[_0x0243('0x56')],null))[_0x0243('0x35')](respondWithResult(_0x1cb7e6,null))[_0x0243('0x28')](handleError(_0x1cb7e6,null));};exports['destroy']=function(_0xc95b36,_0xea3bd4){return db['ChatMessage'][_0x0243('0x54')]({'where':{'id':_0xc95b36[_0x0243('0x52')]['id']}})[_0x0243('0x35')](handleEntityNotFound(_0xea3bd4,null))[_0x0243('0x35')](removeEntity(_0xea3bd4,null))[_0x0243('0x28')](handleError(_0xea3bd4,null));};exports[_0x0243('0x57')]=function(_0x2be387,_0x3566c1){return db['ChatMessage']['describe']()['then'](respondWithResult(_0x3566c1,null))['catch'](handleError(_0x3566c1,null));};var interaction_log=require('../../config/logger')(_0x0243('0x58'));exports[_0x0243('0x59')]=function(_0x2090c5,_0x4063d8,_0xf00cb9){var _0x139897={'agent':{},'channel':_0x0243('0x5a')};if(_0x2090c5[_0x0243('0x56')]['id']){delete _0x2090c5[_0x0243('0x56')]['id'];}_0x2090c5['body'][_0x0243('0x5b')]=!![];_0x2090c5[_0x0243('0x56')][_0x0243('0x5c')]=moment()[_0x0243('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x2090c5[_0x0243('0x56')][_0x0243('0x5e')]=_0x2090c5[_0x0243('0x56')]['UserId']||_0x2090c5[_0x0243('0x5f')]['id'];_0x139897[_0x0243('0x60')]['id']=_0x2090c5['body']['UserId'];return db[_0x0243('0x4d')][_0x0243('0x54')]({'where':{'id':_0x2090c5['params']['id'],'UserId':null}})[_0x0243('0x35')](handleEntityNotFound(_0x4063d8,null))['then'](saveUpdates(_0x2090c5[_0x0243('0x56')],null))[_0x0243('0x35')](function(_0x360fe0){if(_0x360fe0){_0x139897['message']=_0x360fe0[_0x0243('0x61')]({'plain':!![]});return db[_0x0243('0x62')][_0x0243('0x54')]({'where':{'id':_0x360fe0[_0x0243('0x63')]}});}return null;})[_0x0243('0x35')](handleEntityNotFound(_0x4063d8,null))[_0x0243('0x35')](function(_0x1a5bb0){if(_0x1a5bb0){return _0x1a5bb0['update']({'UserId':_0x2090c5[_0x0243('0x56')][_0x0243('0x5e')],'read1stAt':_[_0x0243('0x64')](_0x1a5bb0[_0x0243('0x65')])?moment()[_0x0243('0x5d')](_0x0243('0x66')):undefined});}return null;})['then'](function(_0x1b2cfd){if(_0x1b2cfd){_0x139897[_0x0243('0x67')]=_0x1b2cfd[_0x0243('0x61')]({'plain':!![]});interaction_log[_0x0243('0x20')](_0x0243('0x68'),_0x2090c5['user']['id'],_0x2090c5[_0x0243('0x5f')][_0x0243('0x37')],_0x2090c5['user'][_0x0243('0x69')],_0x139897[_0x0243('0x67')]['id'],_0x2090c5[_0x0243('0x56')]?JSON['stringify'](_0x2090c5['body']):_0x0243('0x6a'));return respondWithRpcPromise(_0x0243('0x6b'),_0x0243('0x6c'),_0x139897);}return null;})['then'](function(_0x242e91){var _0x26406b=_0x0243('0x6d')+_0x242e91[_0x0243('0x27')][_0x0243('0x6e')];return db[_0x0243('0x6f')][_0x0243('0x3f')](_0x26406b,{'type':db[_0x0243('0x70')][_0x0243('0x71')][_0x0243('0x72')],'raw':!![]})[_0x0243('0x35')](function(_0x58b8a1){return _0x58b8a1;});})['then'](function(_0x11910a){if(_0x11910a){_0x139897[_0x0243('0x27')][_0x0243('0x73')]=_0x11910a[0x0];if(!_0x2090c5[_0x0243('0x56')][_0x0243('0x5e')])return;return db[_0x0243('0x74')][_0x0243('0x54')]({'where':{'id':_0x2090c5[_0x0243('0x56')]['UserId'],'role':_0x0243('0x60')},'attributes':['id',_0x0243('0x37'),_0x0243('0x75'),'email',_0x0243('0x76')],'raw':!![]});}return null;})[_0x0243('0x35')](function(_0x50e25d){if(!_0x50e25d)return null;_0x139897[_0x0243('0x27')]['agent']=_0x50e25d;return _0x139897;})['then'](function(_0x188101){if(_0x188101){if(_0x2090c5[_0x0243('0x56')]['manual']){_0x139897[_0x0243('0x27')]['interface']=util[_0x0243('0x5d')](_0x0243('0x77'),_0x2090c5[_0x0243('0x5f')][_0x0243('0x37')]);_0x139897[_0x0243('0x27')][_0x0243('0x78')]=_0x139897[_0x0243('0x78')];_0x139897[_0x0243('0x27')][_0x0243('0x79')]=_0x139897[_0x0243('0x78')];_0x139897[_0x0243('0x27')]['event']=_0x0243('0x59');return respondWithRpcPromise(_0x0243('0x7a'),_0x0243('0x7a'),{'event':_0x0243('0x7b'),'message':_[_0x0243('0x49')](_0x139897[_0x0243('0x27')],JSON[_0x0243('0x7c')](_0x139897[_0x0243('0x67')][_0x0243('0x7d')]))},client9002)[_0x0243('0x35')](function(){return _0x139897;});}return _0x139897;}return null;})[_0x0243('0x35')](respondWithResult(_0x4063d8,null))[_0x0243('0x28')](handleError(_0x4063d8,null));};var interaction_log=require(_0x0243('0x14'))(_0x0243('0x58'));exports['reject']=function(_0x1b94da,_0x24d011,_0x485f1a){var _0xf0afca={'agent':{},'channel':_0x0243('0x5a')};if(_0x1b94da['body']['id']){delete _0x1b94da[_0x0243('0x56')]['id'];}_0x1b94da[_0x0243('0x56')][_0x0243('0x5e')]=_0x1b94da['body'][_0x0243('0x5e')]||_0x1b94da[_0x0243('0x5f')]['id'];_0xf0afca[_0x0243('0x60')]['id']=_0x1b94da[_0x0243('0x56')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x1b94da[_0x0243('0x52')]['id'],'UserId':null}})[_0x0243('0x35')](handleEntityNotFound(_0x24d011,null))[_0x0243('0x35')](function(_0x2ff3e8){if(_0x2ff3e8){_0xf0afca[_0x0243('0x27')]=_0x2ff3e8[_0x0243('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x0243('0x54')]({'where':{'id':_0x2ff3e8[_0x0243('0x63')]}});}return null;})[_0x0243('0x35')](handleEntityNotFound(_0x24d011,null))['then'](function(_0x223046){if(_0x223046){_0xf0afca[_0x0243('0x67')]=_0x223046[_0x0243('0x61')]({'plain':!![]});interaction_log[_0x0243('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b94da[_0x0243('0x5f')]['id'],_0x1b94da['user'][_0x0243('0x37')],_0x1b94da['user'][_0x0243('0x69')],_0xf0afca['interaction']['id'],_0x1b94da[_0x0243('0x56')]?JSON[_0x0243('0x7e')](_0x1b94da[_0x0243('0x56')]):'null');return respondWithRpcPromise(_0x0243('0x7f'),'rejectMessage',_0xf0afca);}return null;})[_0x0243('0x35')](function(_0x14c103){var _0x83dd54=_0x0243('0x6d')+_0x14c103[_0x0243('0x27')][_0x0243('0x6e')];return db['sequelize']['query'](_0x83dd54,{'type':db[_0x0243('0x70')][_0x0243('0x71')][_0x0243('0x72')],'raw':!![]})[_0x0243('0x35')](function(_0xe30437){return _0xe30437;});})[_0x0243('0x35')](function(_0x4a3b96){if(_0x4a3b96){_0xf0afca[_0x0243('0x27')][_0x0243('0x73')]=_0x4a3b96[0x0];if(!_0x1b94da['body'][_0x0243('0x5e')])return;return db[_0x0243('0x74')][_0x0243('0x54')]({'where':{'id':_0x1b94da['body'][_0x0243('0x5e')],'role':'agent'},'attributes':['id',_0x0243('0x37'),'fullname','email',_0x0243('0x76')],'raw':!![]});}return null;})[_0x0243('0x35')](function(_0x5c7ada){if(!_0x5c7ada)return null;_0xf0afca[_0x0243('0x27')][_0x0243('0x60')]=_0x5c7ada;return _0xf0afca;})[_0x0243('0x35')](function(_0x373d29){if(_0x373d29){_0x373d29[_0x0243('0x27')][_0x0243('0x80')]=util[_0x0243('0x5d')](_0x0243('0x77'),_0x1b94da[_0x0243('0x5f')][_0x0243('0x37')]);_0x373d29[_0x0243('0x27')]['channel']=_0xf0afca[_0x0243('0x78')];_0x373d29[_0x0243('0x27')]['motionChannel']=_0xf0afca[_0x0243('0x78')];_0x373d29[_0x0243('0x27')][_0x0243('0x81')]=_0x0243('0x33');respondWithRpcPromise(_0x0243('0x7a'),_0x0243('0x7a'),{'event':_0x0243('0x82'),'message':_[_0x0243('0x49')](_0xf0afca[_0x0243('0x27')],JSON[_0x0243('0x7c')](_0xf0afca['interaction']['formData']))},client9002);return _0xf0afca;}return null;})[_0x0243('0x35')](respondWithResult(_0x24d011,null))[_0x0243('0x28')](handleError(_0x24d011,null));}; \ No newline at end of file +var _0xe21b=['get','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','reject','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','rejectMessage','QueryTypes','contact','internal','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','update','destroy','sendStatus','name','send','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','fields','find','create','body','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent'];(function(_0x22b70f,_0x4c853f){var _0x100985=function(_0x18628e){while(--_0x18628e){_0x22b70f['push'](_0x22b70f['shift']());}};_0x100985(++_0x4c853f);}(_0xe21b,0x12c));var _0xbe21=function(_0x82e061,_0x526369){_0x82e061=_0x82e061-0x0;var _0x2f7f4d=_0xe21b[_0x82e061];return _0x2f7f4d;};'use strict';var emlformat=require(_0xbe21('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe21('0x1'));var jsonpatch=require(_0xbe21('0x2'));var rp=require(_0xbe21('0x3'));var moment=require(_0xbe21('0x4'));var BPromise=require(_0xbe21('0x5'));var Mustache=require('mustache');var util=require(_0xbe21('0x6'));var path=require('path');var sox=require(_0xbe21('0x7'));var csv=require(_0xbe21('0x8'));var ejs=require(_0xbe21('0x9'));var fs=require('fs');var fs_extra=require(_0xbe21('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbe21('0xb'));var jsforce=require(_0xbe21('0xc'));var deskjs=require(_0xbe21('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbe21('0xe'));var Papa=require(_0xbe21('0xf'));var Redis=require(_0xbe21('0x10'));var authService=require(_0xbe21('0x11'));var qs=require(_0xbe21('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe21('0x13'));var logger=require(_0xbe21('0x14'))(_0xbe21('0x15'));var utils=require('../../config/utils');var config=require(_0xbe21('0x16'));var licenseUtil=require(_0xbe21('0x17'));var db=require(_0xbe21('0x18'))['db'];config['redis']=_[_0xbe21('0x19')](config[_0xbe21('0x1a')],{'host':_0xbe21('0x1b'),'port':0x18eb});var socket=require(_0xbe21('0x1c'))(new Redis(config[_0xbe21('0x1a')]));require(_0xbe21('0x1d'))[_0xbe21('0x1e')](socket);var jayson=require(_0xbe21('0x1f'));var client=jayson[_0xbe21('0x20')][_0xbe21('0x21')]({'port':0x232c});var client9002=jayson[_0xbe21('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd0a42,_0x3e8dc9,_0x816ef2,_0x127647){return new BPromise(function(_0x2862d7,_0x1226bb){var _0x3bb760=_0x127647||client;return _0x3bb760['request'](_0xd0a42,_0x816ef2)[_0xbe21('0x22')](function(_0x5b758a){logger[_0xbe21('0x23')](_0xbe21('0x24'),_0x3e8dc9,_0xbe21('0x25'));logger['debug'](_0xbe21('0x26'),_0x3e8dc9,_0xbe21('0x25'),JSON['stringify'](_0x5b758a));if(_0x5b758a[_0xbe21('0x27')]){if(_0x5b758a[_0xbe21('0x27')]['code']===0x1f4){logger['error'](_0xbe21('0x24'),_0x3e8dc9,_0x5b758a[_0xbe21('0x27')][_0xbe21('0x28')]);return _0x1226bb(_0x5b758a[_0xbe21('0x27')][_0xbe21('0x28')]);}logger[_0xbe21('0x27')](_0xbe21('0x24'),_0x3e8dc9,_0x5b758a[_0xbe21('0x27')]['message']);return _0x2862d7(_0x5b758a[_0xbe21('0x27')][_0xbe21('0x28')]);}else{logger[_0xbe21('0x23')](_0xbe21('0x24'),_0x3e8dc9,_0xbe21('0x25'));_0x2862d7(_0x5b758a['result']['message']);}})[_0xbe21('0x29')](function(_0xc1a7b4){logger[_0xbe21('0x27')]('ChatMessage,\x20%s,\x20%s',_0x3e8dc9,_0xc1a7b4);_0x1226bb(_0xc1a7b4);});});}function respondWithStatusCode(_0x367633,_0x2d2121){_0x2d2121=_0x2d2121||0xcc;return function(_0x3b9a24){if(_0x3b9a24){return _0x367633['sendStatus'](_0x2d2121);}return _0x367633[_0xbe21('0x2a')](_0x2d2121)[_0xbe21('0x2b')]();};}function respondWithResult(_0x5d7ea9,_0x4d62c3){_0x4d62c3=_0x4d62c3||0xc8;return function(_0x4a1321){if(_0x4a1321){return _0x5d7ea9[_0xbe21('0x2a')](_0x4d62c3)['json'](_0x4a1321);}};}function respondWithFilteredResult(_0x1f53b4,_0x29f7f7){return function(_0x2a27f8){if(_0x2a27f8){var _0x5c39d9=typeof _0x29f7f7[_0xbe21('0x2c')]===_0xbe21('0x2d')&&typeof _0x29f7f7['limit']===_0xbe21('0x2d');var _0x1995e2=_0x2a27f8[_0xbe21('0x2e')];var _0x46715b=_0x5c39d9?0x0:_0x29f7f7[_0xbe21('0x2c')];var _0x25e434=_0x5c39d9?_0x2a27f8['count']:_0x29f7f7['offset']+_0x29f7f7[_0xbe21('0x2f')];var _0x11d7af;if(_0x25e434>=_0x1995e2){_0x25e434=_0x1995e2;_0x11d7af=0xc8;}else{_0x11d7af=0xce;}_0x1f53b4[_0xbe21('0x2a')](_0x11d7af);return _0x1f53b4[_0xbe21('0x30')](_0xbe21('0x31'),_0x46715b+'-'+_0x25e434+'/'+_0x1995e2)[_0xbe21('0x32')](_0x2a27f8);}return null;};}function patchUpdates(_0xc86656){return function(_0x2d57ab){try{jsonpatch[_0xbe21('0x33')](_0x2d57ab,_0xc86656,!![]);}catch(_0x5cf33a){return BPromise['reject'](_0x5cf33a);}return _0x2d57ab['save']();};}function saveUpdates(_0x323107,_0x44981e){return function(_0xd0d252){if(_0xd0d252){return _0xd0d252[_0xbe21('0x34')](_0x323107)[_0xbe21('0x22')](function(_0x32dfb0){return _0x32dfb0;});}return null;};}function removeEntity(_0x2bcb96,_0xcc5f19){return function(_0x5035d8){if(_0x5035d8){return _0x5035d8[_0xbe21('0x35')]()[_0xbe21('0x22')](function(){_0x2bcb96[_0xbe21('0x2a')](0xcc)[_0xbe21('0x2b')]();});}};}function handleEntityNotFound(_0x5393b0,_0x374056){return function(_0x5ed208){if(!_0x5ed208){_0x5393b0[_0xbe21('0x36')](0x194);}return _0x5ed208;};}function handleError(_0x51d272,_0x47e4d1){_0x47e4d1=_0x47e4d1||0x1f4;return function(_0x13207c){logger[_0xbe21('0x27')](_0x13207c['stack']);if(_0x13207c[_0xbe21('0x37')]){delete _0x13207c[_0xbe21('0x37')];}_0x51d272[_0xbe21('0x2a')](_0x47e4d1)[_0xbe21('0x38')](_0x13207c);};}exports['index']=function(_0x118c94,_0x313345){var _0x3eb55d={},_0x8df6fc={},_0x3ac714={'count':0x0,'rows':[]};var _0x10c994=_['map'](db[_0xbe21('0x39')][_0xbe21('0x3a')],function(_0x2f3d43){return{'name':_0x2f3d43[_0xbe21('0x3b')],'type':_0x2f3d43[_0xbe21('0x3c')][_0xbe21('0x3d')]};});_0x8df6fc[_0xbe21('0x3e')]=_[_0xbe21('0x3f')](_0x10c994,_0xbe21('0x37'));_0x8df6fc[_0xbe21('0x40')]=_[_0xbe21('0x41')](_0x118c94[_0xbe21('0x40')]);_0x8df6fc[_0xbe21('0x42')]=_[_0xbe21('0x43')](_0x8df6fc[_0xbe21('0x3e')],_0x8df6fc[_0xbe21('0x40')]);_0x3eb55d[_0xbe21('0x44')]=_[_0xbe21('0x43')](_0x8df6fc['model'],qs['fields'](_0x118c94[_0xbe21('0x40')]['fields']));_0x3eb55d[_0xbe21('0x44')]=_0x3eb55d[_0xbe21('0x44')][_0xbe21('0x45')]?_0x3eb55d['attributes']:_0x8df6fc['model'];if(!_0x118c94['query'][_0xbe21('0x46')](_0xbe21('0x47'))){_0x3eb55d[_0xbe21('0x2f')]=qs[_0xbe21('0x2f')](_0x118c94[_0xbe21('0x40')]['limit']);_0x3eb55d[_0xbe21('0x2c')]=qs[_0xbe21('0x2c')](_0x118c94['query'][_0xbe21('0x2c')]);}_0x3eb55d[_0xbe21('0x48')]=qs[_0xbe21('0x49')](_0x118c94[_0xbe21('0x40')]['sort']);_0x3eb55d[_0xbe21('0x4a')]=qs[_0xbe21('0x42')](_[_0xbe21('0x4b')](_0x118c94[_0xbe21('0x40')],_0x8df6fc[_0xbe21('0x42')]),_0x10c994);if(_0x118c94['query'][_0xbe21('0x4c')]){_0x3eb55d['where']=_[_0xbe21('0x4d')](_0x3eb55d[_0xbe21('0x4a')],{'$or':_['map'](_0x10c994,function(_0x11b9d1){if(_0x11b9d1[_0xbe21('0x3c')]!=='VIRTUAL'){var _0x19e9ab={};_0x19e9ab[_0x11b9d1['name']]={'$like':'%'+_0x118c94[_0xbe21('0x40')][_0xbe21('0x4c')]+'%'};return _0x19e9ab;}})});}_0x3eb55d=_[_0xbe21('0x4d')]({},_0x3eb55d,_0x118c94[_0xbe21('0x4e')]);var _0x6c7d24={'where':_0x3eb55d[_0xbe21('0x4a')]};return db['ChatMessage']['count'](_0x6c7d24)[_0xbe21('0x22')](function(_0x4c0515){_0x3ac714['count']=_0x4c0515;if(_0x118c94[_0xbe21('0x40')][_0xbe21('0x4f')]){_0x3eb55d[_0xbe21('0x50')]=[{'all':!![]}];}return db[_0xbe21('0x39')]['findAll'](_0x3eb55d);})['then'](function(_0x1aa05c){_0x3ac714[_0xbe21('0x51')]=_0x1aa05c;return _0x3ac714;})[_0xbe21('0x22')](respondWithFilteredResult(_0x313345,_0x3eb55d))[_0xbe21('0x29')](handleError(_0x313345,null));};exports[_0xbe21('0x52')]=function(_0x325aae,_0x21d5d2){var _0x1310a6={'raw':!![],'where':{'id':_0x325aae[_0xbe21('0x53')]['id']}},_0x4e2c58={};_0x4e2c58[_0xbe21('0x3e')]=_[_0xbe21('0x41')](db['ChatMessage'][_0xbe21('0x3a')]);_0x4e2c58[_0xbe21('0x40')]=_[_0xbe21('0x41')](_0x325aae[_0xbe21('0x40')]);_0x4e2c58[_0xbe21('0x42')]=_[_0xbe21('0x43')](_0x4e2c58[_0xbe21('0x3e')],_0x4e2c58[_0xbe21('0x40')]);_0x1310a6[_0xbe21('0x44')]=_[_0xbe21('0x43')](_0x4e2c58[_0xbe21('0x3e')],qs['fields'](_0x325aae[_0xbe21('0x40')][_0xbe21('0x54')]));_0x1310a6[_0xbe21('0x44')]=_0x1310a6[_0xbe21('0x44')][_0xbe21('0x45')]?_0x1310a6['attributes']:_0x4e2c58[_0xbe21('0x3e')];if(_0x325aae[_0xbe21('0x40')][_0xbe21('0x4f')]){_0x1310a6[_0xbe21('0x50')]=[{'all':!![]}];}_0x1310a6=_[_0xbe21('0x4d')]({},_0x1310a6,_0x325aae[_0xbe21('0x4e')]);return db['ChatMessage'][_0xbe21('0x55')](_0x1310a6)[_0xbe21('0x22')](handleEntityNotFound(_0x21d5d2,null))[_0xbe21('0x22')](respondWithResult(_0x21d5d2,null))[_0xbe21('0x29')](handleError(_0x21d5d2,null));};exports[_0xbe21('0x56')]=function(_0x299f93,_0x4701fa){return db[_0xbe21('0x39')][_0xbe21('0x56')](_0x299f93[_0xbe21('0x57')],{})[_0xbe21('0x22')](respondWithResult(_0x4701fa,0xc9))['catch'](handleError(_0x4701fa,null));};exports[_0xbe21('0x34')]=function(_0x3d935e,_0x40feb9){if(_0x3d935e[_0xbe21('0x57')]['id']){delete _0x3d935e[_0xbe21('0x57')]['id'];}return db['ChatMessage'][_0xbe21('0x55')]({'where':{'id':_0x3d935e['params']['id']}})[_0xbe21('0x22')](handleEntityNotFound(_0x40feb9,null))[_0xbe21('0x22')](saveUpdates(_0x3d935e['body'],null))['then'](respondWithResult(_0x40feb9,null))[_0xbe21('0x29')](handleError(_0x40feb9,null));};exports[_0xbe21('0x35')]=function(_0x36e311,_0x35598a){return db[_0xbe21('0x39')][_0xbe21('0x55')]({'where':{'id':_0x36e311[_0xbe21('0x53')]['id']}})[_0xbe21('0x22')](handleEntityNotFound(_0x35598a,null))[_0xbe21('0x22')](removeEntity(_0x35598a,null))[_0xbe21('0x29')](handleError(_0x35598a,null));};exports['describe']=function(_0xf48d0a,_0x328370){return db[_0xbe21('0x39')]['describe']()[_0xbe21('0x22')](respondWithResult(_0x328370,null))['catch'](handleError(_0x328370,null));};var interaction_log=require(_0xbe21('0x14'))(_0xbe21('0x58'));exports[_0xbe21('0x59')]=function(_0x2740a3,_0x216ad4,_0x42c07c){var _0x386686={'agent':{},'channel':_0xbe21('0x5a')};if(_0x2740a3[_0xbe21('0x57')]['id']){delete _0x2740a3[_0xbe21('0x57')]['id'];}_0x2740a3['body'][_0xbe21('0x5b')]=!![];_0x2740a3['body'][_0xbe21('0x5c')]=moment()['format'](_0xbe21('0x5d'));_0x2740a3[_0xbe21('0x57')][_0xbe21('0x5e')]=_0x2740a3[_0xbe21('0x57')][_0xbe21('0x5e')]||_0x2740a3['user']['id'];_0x386686[_0xbe21('0x5f')]['id']=_0x2740a3[_0xbe21('0x57')]['UserId'];return db[_0xbe21('0x39')]['find']({'where':{'id':_0x2740a3[_0xbe21('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x216ad4,null))[_0xbe21('0x22')](saveUpdates(_0x2740a3[_0xbe21('0x57')],null))[_0xbe21('0x22')](function(_0x4ec3b6){if(_0x4ec3b6){_0x386686[_0xbe21('0x28')]=_0x4ec3b6[_0xbe21('0x60')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4ec3b6['ChatInteractionId']}});}return null;})[_0xbe21('0x22')](handleEntityNotFound(_0x216ad4,null))[_0xbe21('0x22')](function(_0x33c5cc){if(_0x33c5cc){return _0x33c5cc[_0xbe21('0x34')]({'UserId':_0x2740a3[_0xbe21('0x57')][_0xbe21('0x5e')],'read1stAt':_[_0xbe21('0x61')](_0x33c5cc[_0xbe21('0x62')])?moment()[_0xbe21('0x63')](_0xbe21('0x5d')):undefined});}return null;})[_0xbe21('0x22')](function(_0x2191ce){if(_0x2191ce){_0x386686[_0xbe21('0x64')]=_0x2191ce[_0xbe21('0x60')]({'plain':!![]});interaction_log[_0xbe21('0x23')](_0xbe21('0x65'),_0x2740a3['user']['id'],_0x2740a3['user']['name'],_0x2740a3[_0xbe21('0x66')]['role'],_0x386686[_0xbe21('0x64')]['id'],_0x2740a3['body']?JSON['stringify'](_0x2740a3[_0xbe21('0x57')]):_0xbe21('0x67'));return respondWithRpcPromise(_0xbe21('0x68'),'acceptMessage',_0x386686);}return null;})[_0xbe21('0x22')](function(_0x952b13){var _0x530692=_0xbe21('0x69')+_0x952b13[_0xbe21('0x28')][_0xbe21('0x6a')];return db[_0xbe21('0x6b')][_0xbe21('0x40')](_0x530692,{'type':db[_0xbe21('0x6c')]['QueryTypes'][_0xbe21('0x6d')],'raw':!![]})['then'](function(_0x3737e7){return _0x3737e7;});})[_0xbe21('0x22')](function(_0x50db0c){if(_0x50db0c){_0x386686['message']['contact']=_0x50db0c[0x0];if(!_0x2740a3[_0xbe21('0x57')][_0xbe21('0x5e')])return;return db['User']['find']({'where':{'id':_0x2740a3['body'][_0xbe21('0x5e')],'role':_0xbe21('0x5f')},'attributes':['id',_0xbe21('0x37'),_0xbe21('0x6e'),_0xbe21('0x6f'),'internal'],'raw':!![]});}return null;})['then'](function(_0xfc3967){if(!_0xfc3967)return null;_0x386686['message'][_0xbe21('0x5f')]=_0xfc3967;return _0x386686;})[_0xbe21('0x22')](function(_0x21fd09){if(_0x21fd09){if(_0x2740a3['body'][_0xbe21('0x70')]){_0x386686[_0xbe21('0x28')][_0xbe21('0x71')]=util[_0xbe21('0x63')](_0xbe21('0x72'),_0x2740a3[_0xbe21('0x66')][_0xbe21('0x37')]);_0x386686[_0xbe21('0x28')][_0xbe21('0x73')]=_0x386686['channel'];_0x386686[_0xbe21('0x28')][_0xbe21('0x74')]=_0x386686[_0xbe21('0x73')];_0x386686[_0xbe21('0x28')][_0xbe21('0x75')]='accept';return respondWithRpcPromise(_0xbe21('0x76'),_0xbe21('0x76'),{'event':_0xbe21('0x77'),'message':_['merge'](_0x386686[_0xbe21('0x28')],JSON['parse'](_0x386686[_0xbe21('0x64')][_0xbe21('0x78')]))},client9002)[_0xbe21('0x22')](function(){return _0x386686;});}return _0x386686;}return null;})['then'](respondWithResult(_0x216ad4,null))[_0xbe21('0x29')](handleError(_0x216ad4,null));};var interaction_log=require(_0xbe21('0x14'))(_0xbe21('0x58'));exports[_0xbe21('0x79')]=function(_0x566ad6,_0x3d4154,_0x162909){var _0x359d35={'agent':{},'channel':'chat'};if(_0x566ad6[_0xbe21('0x57')]['id']){delete _0x566ad6[_0xbe21('0x57')]['id'];}_0x566ad6[_0xbe21('0x57')][_0xbe21('0x5e')]=_0x566ad6[_0xbe21('0x57')]['UserId']||_0x566ad6['user']['id'];_0x359d35[_0xbe21('0x5f')]['id']=_0x566ad6[_0xbe21('0x57')][_0xbe21('0x5e')];return db[_0xbe21('0x39')][_0xbe21('0x55')]({'where':{'id':_0x566ad6['params']['id'],'UserId':null}})[_0xbe21('0x22')](handleEntityNotFound(_0x3d4154,null))[_0xbe21('0x22')](function(_0x3033cf){if(_0x3033cf){_0x359d35[_0xbe21('0x28')]=_0x3033cf['get']({'plain':!![]});return db[_0xbe21('0x7a')][_0xbe21('0x55')]({'where':{'id':_0x3033cf[_0xbe21('0x7b')]}});}return null;})[_0xbe21('0x22')](handleEntityNotFound(_0x3d4154,null))['then'](function(_0x30e8d5){if(_0x30e8d5){_0x359d35['interaction']=_0x30e8d5[_0xbe21('0x60')]({'plain':!![]});interaction_log['info'](_0xbe21('0x7c'),_0x566ad6[_0xbe21('0x66')]['id'],_0x566ad6[_0xbe21('0x66')][_0xbe21('0x37')],_0x566ad6[_0xbe21('0x66')][_0xbe21('0x7d')],_0x359d35[_0xbe21('0x64')]['id'],_0x566ad6[_0xbe21('0x57')]?JSON[_0xbe21('0x7e')](_0x566ad6['body']):'null');return respondWithRpcPromise('RejectMessage',_0xbe21('0x7f'),_0x359d35);}return null;})[_0xbe21('0x22')](function(_0x176c04){var _0xfdd8c7=_0xbe21('0x69')+_0x176c04[_0xbe21('0x28')]['ContactId'];return db[_0xbe21('0x6b')][_0xbe21('0x40')](_0xfdd8c7,{'type':db[_0xbe21('0x6c')][_0xbe21('0x80')][_0xbe21('0x6d')],'raw':!![]})[_0xbe21('0x22')](function(_0x391131){return _0x391131;});})[_0xbe21('0x22')](function(_0x1b59f1){if(_0x1b59f1){_0x359d35['message'][_0xbe21('0x81')]=_0x1b59f1[0x0];if(!_0x566ad6[_0xbe21('0x57')][_0xbe21('0x5e')])return;return db['User'][_0xbe21('0x55')]({'where':{'id':_0x566ad6[_0xbe21('0x57')][_0xbe21('0x5e')],'role':_0xbe21('0x5f')},'attributes':['id',_0xbe21('0x37'),_0xbe21('0x6e'),_0xbe21('0x6f'),_0xbe21('0x82')],'raw':!![]});}return null;})[_0xbe21('0x22')](function(_0x30e7f4){if(!_0x30e7f4)return null;_0x359d35[_0xbe21('0x28')][_0xbe21('0x5f')]=_0x30e7f4;return _0x359d35;})['then'](function(_0x1daa4b){if(_0x1daa4b){_0x1daa4b[_0xbe21('0x28')]['interface']=util['format']('SIP/%s',_0x566ad6['user'][_0xbe21('0x37')]);_0x1daa4b['message']['channel']=_0x359d35['channel'];_0x1daa4b['message']['motionChannel']=_0x359d35[_0xbe21('0x73')];_0x1daa4b[_0xbe21('0x28')]['event']=_0xbe21('0x79');respondWithRpcPromise(_0xbe21('0x76'),_0xbe21('0x76'),{'event':_0xbe21('0x83'),'message':_['merge'](_0x359d35[_0xbe21('0x28')],JSON['parse'](_0x359d35[_0xbe21('0x64')][_0xbe21('0x78')]))},client9002);return _0x359d35;}return null;})['then'](respondWithResult(_0x3d4154,null))[_0xbe21('0x29')](handleError(_0x3d4154,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 1a2f5c9..0c1612e 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 _0xd89d=['hook','exports','events','../../mysqldb','ChatMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x495121,_0x22dc49){var _0x135046=function(_0x25eb41){while(--_0x25eb41){_0x495121['push'](_0x495121['shift']());}};_0x135046(++_0x22dc49);}(_0xd89d,0x1ce));var _0xdd89=function(_0x54da13,_0x2aad17){_0x54da13=_0x54da13-0x0;var _0x15bcb2=_0xd89d[_0x54da13];return _0x15bcb2;};'use strict';var EventEmitter=require(_0xdd89('0x0'));var ChatMessage=require(_0xdd89('0x1'))['db'][_0xdd89('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd89('0x3'),'afterUpdate':_0xdd89('0x4'),'afterDestroy':_0xdd89('0x5')};function emitEvent(_0x4d55b3){return function(_0x1cbd03,_0x5e0692,_0x20e6b5){ChatMessageEvents['emit'](_0x4d55b3+':'+_0x1cbd03['id'],_0x1cbd03);ChatMessageEvents[_0xdd89('0x6')](_0x4d55b3,_0x1cbd03);_0x20e6b5(null);};}for(var e in events){if(events[_0xdd89('0x7')](e)){var event=events[e];ChatMessage[_0xdd89('0x8')](e,emitEvent(event));}}module[_0xdd89('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x63cd=['events','../../mysqldb','ChatMessage','update','remove','emit','hasOwnProperty','hook'];(function(_0x16b667,_0xadec02){var _0x58620e=function(_0x5db60b){while(--_0x5db60b){_0x16b667['push'](_0x16b667['shift']());}};_0x58620e(++_0xadec02);}(_0x63cd,0x128));var _0xd63c=function(_0x4dd7e3,_0x22fa36){_0x4dd7e3=_0x4dd7e3-0x0;var _0x56cce9=_0x63cd[_0x4dd7e3];return _0x56cce9;};'use strict';var EventEmitter=require(_0xd63c('0x0'));var ChatMessage=require(_0xd63c('0x1'))['db'][_0xd63c('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd63c('0x3'),'afterDestroy':_0xd63c('0x4')};function emitEvent(_0x3e6967){return function(_0x4ca85f,_0x5aab7f,_0x45e9b2){ChatMessageEvents[_0xd63c('0x5')](_0x3e6967+':'+_0x4ca85f['id'],_0x4ca85f);ChatMessageEvents[_0xd63c('0x5')](_0x3e6967,_0x4ca85f);_0x45e9b2(null);};}for(var e in events){if(events[_0xd63c('0x6')](e)){var event=events[e];ChatMessage[_0xd63c('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index cb71bb6..98863b8 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 _0x0e60=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0e60,0x1ab));var _0x00e6=function(_0x2f50f5,_0x95bbf1){_0x2f50f5=_0x2f50f5-0x0;var _0x4fb2d5=_0x0e60[_0x2f50f5];return _0x4fb2d5;};'use strict';var _=require('lodash');var util=require(_0x00e6('0x0'));var logger=require(_0x00e6('0x1'))(_0x00e6('0x2'));var moment=require(_0x00e6('0x3'));var BPromise=require(_0x00e6('0x4'));var rp=require(_0x00e6('0x5'));var fs=require('fs');var path=require(_0x00e6('0x6'));var rimraf=require(_0x00e6('0x7'));var config=require(_0x00e6('0x8'));var attributes=require(_0x00e6('0x9'));module[_0x00e6('0xa')]=function(_0x23b981,_0x447035){return _0x23b981[_0x00e6('0xb')](_0x00e6('0xc'),attributes,{'tableName':_0x00e6('0xd'),'paranoid':![],'indexes':[{'name':_0x00e6('0xe'),'fields':[_0x00e6('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x559bde,_0x2bdbe6,_0x1c7f7a){var _0x5dc029=_0x23b981[_0x00e6('0x10')];var _0x7c0c15=_0x559bde[_0x00e6('0x11')]({'plain':!![]});if(_0x7c0c15[_0x00e6('0x12')][_0x00e6('0x13')]()==='in'||_0x7c0c15['direction'][_0x00e6('0x13')]()===_0x00e6('0x14')&&!_0x7c0c15[_0x00e6('0x15')]&&!_[_0x00e6('0x16')](_0x7c0c15[_0x00e6('0x17')])){_0x5dc029[_0x00e6('0x18')]['findOne']({'where':{'id':_0x7c0c15[_0x00e6('0x19')]}})[_0x00e6('0x1a')](function(_0x486737){if(_0x486737){_0x486737['update']({'lastMsgAt':_0x7c0c15[_0x00e6('0x1b')],'lastMsgDirection':_0x7c0c15[_0x00e6('0x12')][_0x00e6('0x13')]()});}})[_0x00e6('0x1c')](function(_0x313ebb){console['error'](_0x313ebb);});}_0x1c7f7a();}},'charset':_0x00e6('0x1d'),'collate':_0x00e6('0x1e')});}; \ No newline at end of file +var _0x736a=['request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x736a,0x96));var _0xa736=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x736a[_0x4b73a2];return _0x383c66;};'use strict';var _=require('lodash');var util=require(_0xa736('0x0'));var logger=require(_0xa736('0x1'))(_0xa736('0x2'));var moment=require(_0xa736('0x3'));var BPromise=require(_0xa736('0x4'));var rp=require(_0xa736('0x5'));var fs=require('fs');var path=require(_0xa736('0x6'));var rimraf=require(_0xa736('0x7'));var config=require(_0xa736('0x8'));var attributes=require(_0xa736('0x9'));module[_0xa736('0xa')]=function(_0x2c8c5c,_0x220505){return _0x2c8c5c[_0xa736('0xb')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xa736('0xc'),'fields':[_0xa736('0xd')],'type':_0xa736('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x242637,_0x5356bc,_0x22463e){var _0x360df7=_0x2c8c5c[_0xa736('0xf')];var _0x5a67bf=_0x242637[_0xa736('0x10')]({'plain':!![]});if(_0x5a67bf[_0xa736('0x11')][_0xa736('0x12')]()==='in'||_0x5a67bf[_0xa736('0x11')][_0xa736('0x12')]()===_0xa736('0x13')&&!_0x5a67bf[_0xa736('0x14')]&&!_[_0xa736('0x15')](_0x5a67bf[_0xa736('0x16')])){_0x360df7['ChatInteraction'][_0xa736('0x17')]({'where':{'id':_0x5a67bf[_0xa736('0x18')]}})[_0xa736('0x19')](function(_0x52180e){if(_0x52180e){_0x52180e[_0xa736('0x1a')]({'lastMsgAt':_0x5a67bf[_0xa736('0x1b')],'lastMsgDirection':_0x5a67bf['direction'][_0xa736('0x12')]()});}})[_0xa736('0x1c')](function(_0x20f98c){console['error'](_0x20f98c);});}_0x22463e();}},'charset':_0xa736('0x1d'),'collate':_0xa736('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 7d56c81..02051d1 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 _0xd3f7=['code','ChatMessage,\x20%s,\x20%s','message','create','body','options','raw','CreateChatMessage','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x317219,_0x5c45a0){var _0x5c4403=function(_0x9baf4c){while(--_0x9baf4c){_0x317219['push'](_0x317219['shift']());}};_0x5c4403(++_0x5c45a0);}(_0xd3f7,0xe2));var _0x7d3f=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0xd3f7[_0x5be7aa];return _0x215408;};'use strict';var _=require(_0x7d3f('0x0'));var util=require(_0x7d3f('0x1'));var moment=require(_0x7d3f('0x2'));var BPromise=require(_0x7d3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d3f('0x4'))['db'];var utils=require(_0x7d3f('0x5'));var logger=require(_0x7d3f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7d3f('0x7'));var client=jayson[_0x7d3f('0x8')][_0x7d3f('0x9')]({'port':0x232a});config[_0x7d3f('0xa')]=_[_0x7d3f('0xb')](config[_0x7d3f('0xa')],{'host':_0x7d3f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0x7d3f('0xd')](socket);function respondWithRpcPromise(_0x29548c,_0x23f13b,_0xc769){return new BPromise(function(_0x4daa13,_0x154baf){return client[_0x7d3f('0xe')](_0x29548c,_0xc769)[_0x7d3f('0xf')](function(_0xf8be39){logger[_0x7d3f('0x10')]('ChatMessage,\x20%s,\x20%s',_0x23f13b,'request\x20sent');logger[_0x7d3f('0x11')](_0x7d3f('0x12'),_0x23f13b,_0x7d3f('0x13'),JSON[_0x7d3f('0x14')](_0xf8be39));if(_0xf8be39[_0x7d3f('0x15')]){if(_0xf8be39[_0x7d3f('0x15')][_0x7d3f('0x16')]===0x1f4){logger[_0x7d3f('0x15')](_0x7d3f('0x17'),_0x23f13b,_0xf8be39[_0x7d3f('0x15')][_0x7d3f('0x18')]);return _0x154baf(_0xf8be39[_0x7d3f('0x15')][_0x7d3f('0x18')]);}logger[_0x7d3f('0x15')]('ChatMessage,\x20%s,\x20%s',_0x23f13b,_0xf8be39[_0x7d3f('0x15')][_0x7d3f('0x18')]);return _0x4daa13(_0xf8be39['error'][_0x7d3f('0x18')]);}else{logger[_0x7d3f('0x10')](_0x7d3f('0x17'),_0x23f13b,_0x7d3f('0x13'));_0x4daa13(_0xf8be39['result']['message']);}})['catch'](function(_0x197ad1){logger['error'](_0x7d3f('0x17'),_0x23f13b,_0x197ad1);_0x154baf(_0x197ad1);});});}exports['CreateChatMessage']=function(_0x25242){var _0x32fdcd=this;return new Promise(function(_0x19295d,_0x5aeb18){return db['ChatMessage'][_0x7d3f('0x19')](_0x25242[_0x7d3f('0x1a')],{'raw':_0x25242[_0x7d3f('0x1b')]?_0x25242[_0x7d3f('0x1b')][_0x7d3f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x545b1a){logger[_0x7d3f('0x10')](_0x7d3f('0x1d'),_0x25242);logger[_0x7d3f('0x11')](_0x7d3f('0x1d'),_0x25242,JSON[_0x7d3f('0x14')](_0x545b1a));_0x19295d(_0x545b1a);})[_0x7d3f('0x1e')](function(_0x571f4a){logger[_0x7d3f('0x15')](_0x7d3f('0x1d'),_0x571f4a['message'],_0x25242);_0x5aeb18(_0x32fdcd[_0x7d3f('0x15')](0x1f4,_0x571f4a['message']));});});}; \ No newline at end of file +var _0xd087=['CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1b0bfe,_0x589135){var _0x14bb4c=function(_0x143a4d){while(--_0x143a4d){_0x1b0bfe['push'](_0x1b0bfe['shift']());}};_0x14bb4c(++_0x589135);}(_0xd087,0x6f));var _0x7d08=function(_0xab39a,_0x9d1016){_0xab39a=_0xab39a-0x0;var _0x17bbe2=_0xd087[_0xab39a];return _0x17bbe2;};'use strict';var _=require(_0x7d08('0x0'));var util=require(_0x7d08('0x1'));var moment=require(_0x7d08('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d08('0x3'));var fs=require('fs');var Redis=require(_0x7d08('0x4'));var db=require(_0x7d08('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d08('0x6'))(_0x7d08('0x7'));var config=require(_0x7d08('0x8'));var jayson=require(_0x7d08('0x9'));var client=jayson['client'][_0x7d08('0xa')]({'port':0x232a});config[_0x7d08('0xb')]=_[_0x7d08('0xc')](config[_0x7d08('0xb')],{'host':_0x7d08('0xd'),'port':0x18eb});var socket=require(_0x7d08('0xe'))(new Redis(config['redis']));require(_0x7d08('0xf'))[_0x7d08('0x10')](socket);function respondWithRpcPromise(_0x5bbbf3,_0x4a596a,_0x472a43){return new BPromise(function(_0x45bd17,_0x30d932){return client[_0x7d08('0x11')](_0x5bbbf3,_0x472a43)[_0x7d08('0x12')](function(_0x53f050){logger[_0x7d08('0x13')](_0x7d08('0x14'),_0x4a596a,_0x7d08('0x15'));logger['debug'](_0x7d08('0x16'),_0x4a596a,_0x7d08('0x15'),JSON[_0x7d08('0x17')](_0x53f050));if(_0x53f050[_0x7d08('0x18')]){if(_0x53f050[_0x7d08('0x18')][_0x7d08('0x19')]===0x1f4){logger[_0x7d08('0x18')](_0x7d08('0x14'),_0x4a596a,_0x53f050[_0x7d08('0x18')][_0x7d08('0x1a')]);return _0x30d932(_0x53f050[_0x7d08('0x18')]['message']);}logger[_0x7d08('0x18')](_0x7d08('0x14'),_0x4a596a,_0x53f050[_0x7d08('0x18')][_0x7d08('0x1a')]);return _0x45bd17(_0x53f050['error'][_0x7d08('0x1a')]);}else{logger[_0x7d08('0x13')](_0x7d08('0x14'),_0x4a596a,_0x7d08('0x15'));_0x45bd17(_0x53f050[_0x7d08('0x1b')][_0x7d08('0x1a')]);}})[_0x7d08('0x1c')](function(_0x3cf9d1){logger[_0x7d08('0x18')](_0x7d08('0x14'),_0x4a596a,_0x3cf9d1);_0x30d932(_0x3cf9d1);});});}exports[_0x7d08('0x1d')]=function(_0x2eeb2f){var _0x22152e=this;return new Promise(function(_0x47e294,_0xdd82cf){return db[_0x7d08('0x1e')][_0x7d08('0x1f')](_0x2eeb2f[_0x7d08('0x20')],{'raw':_0x2eeb2f[_0x7d08('0x21')]?_0x2eeb2f[_0x7d08('0x21')][_0x7d08('0x22')]===undefined?!![]:![]:!![]})[_0x7d08('0x12')](function(_0x226739){logger[_0x7d08('0x13')](_0x7d08('0x1d'),_0x2eeb2f);logger['debug'](_0x7d08('0x1d'),_0x2eeb2f,JSON[_0x7d08('0x17')](_0x226739));_0x47e294(_0x226739);})['catch'](function(_0x537dda){logger[_0x7d08('0x18')](_0x7d08('0x1d'),_0x537dda[_0x7d08('0x1a')],_0x2eeb2f);_0xdd82cf(_0x22152e['error'](0x1f4,_0x537dda[_0x7d08('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 97d4f5c..75fc388 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 _0xaa19=['length','./chatMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x592ca0,_0x30d956){var _0x2c2e71=function(_0x19310e){while(--_0x19310e){_0x592ca0['push'](_0x592ca0['shift']());}};_0x2c2e71(++_0x30d956);}(_0xaa19,0x79));var _0x9aa1=function(_0x41df98,_0x148551){_0x41df98=_0x41df98-0x0;var _0x3c3566=_0xaa19[_0x41df98];return _0x3c3566;};'use strict';var ChatMessageEvents=require(_0x9aa1('0x0'));var events=[_0x9aa1('0x1'),_0x9aa1('0x2'),_0x9aa1('0x3')];function createListener(_0x4af2e4,_0x343b95){return function(_0x5371a9){_0x343b95[_0x9aa1('0x4')](_0x4af2e4,_0x5371a9);};}function removeListener(_0x58fb46,_0x11fd1b){return function(){ChatMessageEvents[_0x9aa1('0x5')](_0x58fb46,_0x11fd1b);};}exports[_0x9aa1('0x6')]=function(_0x52124b){for(var _0x1e59f8=0x0,_0x473aa0=events[_0x9aa1('0x7')];_0x1e59f8<_0x473aa0;_0x1e59f8++){var _0x5363e3=events[_0x1e59f8];var _0x302408=createListener('chatMessage:'+_0x5363e3,_0x52124b);ChatMessageEvents['on'](_0x5363e3,_0x302408);}}; \ No newline at end of file +var _0x4b84=['./chatMessage.events','save','emit','length'];(function(_0x2c6055,_0x236f99){var _0x4943ea=function(_0x15ac49){while(--_0x15ac49){_0x2c6055['push'](_0x2c6055['shift']());}};_0x4943ea(++_0x236f99);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x4b84[_0x2fc012];return _0x2891f9;};'use strict';var ChatMessageEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatMessageEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatMessage:'+_0x5947f7,_0x55f25d);ChatMessageEvents['on'](_0x5947f7,_0x3e87c5);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 8cd1cd5..921220a 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 _0x97cc=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','create','update','put','/:id/reject','delete','destroy'];(function(_0x189a72,_0x4ac342){var _0x2b457a=function(_0x151b57){while(--_0x151b57){_0x189a72['push'](_0x189a72['shift']());}};_0x2b457a(++_0x4ac342);}(_0x97cc,0xd1));var _0xc97c=function(_0x363821,_0x284098){_0x363821=_0x363821-0x0;var _0x4a981b=_0x97cc[_0x363821];return _0x4a981b;};'use strict';var multer=require(_0xc97c('0x0'));var util=require(_0xc97c('0x1'));var path=require(_0xc97c('0x2'));var timeout=require('connect-timeout');var express=require(_0xc97c('0x3'));var router=express[_0xc97c('0x4')]();var fs_extra=require(_0xc97c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc97c('0x6'));var config=require(_0xc97c('0x7'));var controller=require(_0xc97c('0x8'));router[_0xc97c('0x9')]('/',auth[_0xc97c('0xa')](),controller[_0xc97c('0xb')]);router['get'](_0xc97c('0xc'),auth[_0xc97c('0xa')](),controller[_0xc97c('0xd')]);router[_0xc97c('0x9')](_0xc97c('0xe'),auth[_0xc97c('0xa')](),controller[_0xc97c('0xf')]);router[_0xc97c('0x10')]('/',auth[_0xc97c('0xa')](),interaction[_0xc97c('0x11')](_0xc97c('0x12'),'chatmessage:create'),controller[_0xc97c('0x13')]);router['put']('/:id',controller[_0xc97c('0x14')]);router[_0xc97c('0x15')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router['put'](_0xc97c('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0xc97c('0x17')](_0xc97c('0xe'),auth[_0xc97c('0xa')](),controller[_0xc97c('0x18')]);module[_0xc97c('0x19')]=router; \ No newline at end of file +var _0x8983=['show','post','tracked','chat','chatmessage:create','put','update','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x1fd491,_0x2f35ce){var _0x52c1ad=function(_0x43d4cb){while(--_0x43d4cb){_0x1fd491['push'](_0x1fd491['shift']());}};_0x52c1ad(++_0x2f35ce);}(_0x8983,0x124));var _0x3898=function(_0x2d2663,_0x4fd308){_0x2d2663=_0x2d2663-0x0;var _0x8b9c63=_0x8983[_0x2d2663];return _0x8b9c63;};'use strict';var multer=require(_0x3898('0x0'));var util=require(_0x3898('0x1'));var path=require(_0x3898('0x2'));var timeout=require(_0x3898('0x3'));var express=require('express');var router=express[_0x3898('0x4')]();var fs_extra=require(_0x3898('0x5'));var auth=require(_0x3898('0x6'));var interaction=require(_0x3898('0x7'));var config=require(_0x3898('0x8'));var controller=require(_0x3898('0x9'));router['get']('/',auth[_0x3898('0xa')](),controller[_0x3898('0xb')]);router[_0x3898('0xc')](_0x3898('0xd'),auth[_0x3898('0xa')](),controller[_0x3898('0xe')]);router[_0x3898('0xc')](_0x3898('0xf'),auth[_0x3898('0xa')](),controller[_0x3898('0x10')]);router[_0x3898('0x11')]('/',auth[_0x3898('0xa')](),interaction[_0x3898('0x12')](_0x3898('0x13'),_0x3898('0x14')),controller['create']);router[_0x3898('0x15')](_0x3898('0xf'),controller[_0x3898('0x16')]);router['put']('/:id/accept',auth[_0x3898('0xa')](),controller['accept']);router['put'](_0x3898('0x17'),auth[_0x3898('0xa')](),controller[_0x3898('0x18')]);router[_0x3898('0x19')](_0x3898('0xf'),auth['isAuthenticated'](),controller[_0x3898('0x1a')]);module[_0x3898('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index ccb5d58..55fe11e 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x107f2f,_0x29a2ec){var _0x1e50f1=function(_0x4499f1){while(--_0x4499f1){_0x107f2f['push'](_0x107f2f['shift']());}};_0x1e50f1(++_0x29a2ec);}(_0xb10b,0x12a));var _0xbb10=function(_0x20076b,_0x4f218e){_0x20076b=_0x20076b-0x0;var _0x1ae3de=_0xb10b[_0x20076b];return _0x1ae3de;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0xb5a414,_0x365f3b){var _0x2970c0=function(_0xc89c39){while(--_0xc89c39){_0xb5a414['push'](_0xb5a414['shift']());}};_0x2970c0(++_0x365f3b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a0259,_0xada701){_0x5a0259=_0x5a0259-0x0;var _0x538fc4=_0x5f2f[_0x5a0259];return _0x538fc4;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index c9d67bb..5d3157d 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(_0x143c1f,_0x5087d3){var _0x5be345=function(_0x35fca2){while(--_0x35fca2){_0x143c1f['push'](_0x143c1f['shift']());}};_0x5be345(++_0x5087d3);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 _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(_0xe0f204,_0x304926){var _0x25dd13=function(_0x42f086){while(--_0x42f086){_0xe0f204['push'](_0xe0f204['shift']());}};_0x25dd13(++_0x304926);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index cb2cba3..2e4ef70 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 _0xbc61=['hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','emit'];(function(_0x526d75,_0x5d0d6a){var _0x9d2302=function(_0x265968){while(--_0x265968){_0x526d75['push'](_0x526d75['shift']());}};_0x9d2302(++_0x5d0d6a);}(_0xbc61,0x1b2));var _0x1bc6=function(_0x1c78a7,_0x4ecaa0){_0x1c78a7=_0x1c78a7-0x0;var _0x60aa6b=_0xbc61[_0x1c78a7];return _0x60aa6b;};'use strict';var EventEmitter=require(_0x1bc6('0x0'));var ChatOfflineMessage=require(_0x1bc6('0x1'))['db'][_0x1bc6('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1bc6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1bc6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x458fdc){return function(_0x2416a1,_0x571edc,_0x3fde73){ChatOfflineMessageEvents[_0x1bc6('0x5')](_0x458fdc+':'+_0x2416a1['id'],_0x2416a1);ChatOfflineMessageEvents[_0x1bc6('0x5')](_0x458fdc,_0x2416a1);_0x3fde73(null);};}for(var e in events){if(events[_0x1bc6('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1bc6('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xfbf2=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0x4f1651,_0xc4ac4f){var _0x44868e=function(_0x2a2ec1){while(--_0x2a2ec1){_0x4f1651['push'](_0x4f1651['shift']());}};_0x44868e(++_0xc4ac4f);}(_0xfbf2,0xc0));var _0x2fbf=function(_0x14a095,_0x2f28ad){_0x14a095=_0x14a095-0x0;var _0xce32dc=_0xfbf2[_0x14a095];return _0xce32dc;};'use strict';var EventEmitter=require(_0x2fbf('0x0'));var ChatOfflineMessage=require(_0x2fbf('0x1'))['db'][_0x2fbf('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x2fbf('0x3')](0x0);var events={'afterCreate':_0x2fbf('0x4'),'afterUpdate':_0x2fbf('0x5'),'afterDestroy':'remove'};function emitEvent(_0x255a0b){return function(_0x1f4177,_0xfc9ee7,_0x32b674){ChatOfflineMessageEvents[_0x2fbf('0x6')](_0x255a0b+':'+_0x1f4177['id'],_0x1f4177);ChatOfflineMessageEvents[_0x2fbf('0x6')](_0x255a0b,_0x1f4177);_0x32b674(null);};}for(var e in events){if(events[_0x2fbf('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x2fbf('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index d8842f0..2fc97ec 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 _0x5767=['ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x2d0549,_0x1f7695){var _0x6817f2=function(_0x31e69d){while(--_0x31e69d){_0x2d0549['push'](_0x2d0549['shift']());}};_0x6817f2(++_0x1f7695);}(_0x5767,0xe1));var _0x7576=function(_0x24b1e9,_0x17f6b4){_0x24b1e9=_0x24b1e9-0x0;var _0x3ad1f9=_0x5767[_0x24b1e9];return _0x3ad1f9;};'use strict';var attributes=require(_0x7576('0x0'));module[_0x7576('0x1')]=function(_0x13927d){return _0x13927d[_0x7576('0x2')](_0x7576('0x3'),attributes,{'tableName':_0x7576('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7576('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4077=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x3a1ca6,_0x2d40b5){var _0x1dfd64=function(_0x4d1a2c){while(--_0x4d1a2c){_0x3a1ca6['push'](_0x3a1ca6['shift']());}};_0x1dfd64(++_0x2d40b5);}(_0x4077,0x117));var _0x7407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4077[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x7407('0x0'));module[_0x7407('0x1')]=function(_0x129c77){return _0x129c77[_0x7407('0x2')](_0x7407('0x3'),attributes,{'tableName':_0x7407('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7407('0x5'),'collate':_0x7407('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 879015d..ec34bc4 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 _0x7ca8=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x36c38c,_0x15e6c2){var _0x1dc6ae=function(_0x4a91e6){while(--_0x4a91e6){_0x36c38c['push'](_0x36c38c['shift']());}};_0x1dc6ae(++_0x15e6c2);}(_0x7ca8,0xf5));var _0x87ca=function(_0x3d21fd,_0x4c1aab){_0x3d21fd=_0x3d21fd-0x0;var _0x154980=_0x7ca8[_0x3d21fd];return _0x154980;};'use strict';var _=require('lodash');var util=require(_0x87ca('0x0'));var moment=require(_0x87ca('0x1'));var BPromise=require(_0x87ca('0x2'));var rs=require(_0x87ca('0x3'));var fs=require('fs');var Redis=require(_0x87ca('0x4'));var db=require(_0x87ca('0x5'))['db'];var utils=require(_0x87ca('0x6'));var logger=require(_0x87ca('0x7'))(_0x87ca('0x8'));var config=require(_0x87ca('0x9'));var jayson=require(_0x87ca('0xa'));var client=jayson[_0x87ca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ce850,_0x1c5ca3,_0x12b73f){return new BPromise(function(_0x10323f,_0x444f47){return client[_0x87ca('0xc')](_0x4ce850,_0x12b73f)[_0x87ca('0xd')](function(_0x4953ff){logger[_0x87ca('0xe')](_0x87ca('0xf'),_0x1c5ca3,'request\x20sent');logger[_0x87ca('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1c5ca3,_0x87ca('0x11'),JSON['stringify'](_0x4953ff));if(_0x4953ff[_0x87ca('0x12')]){if(_0x4953ff[_0x87ca('0x12')][_0x87ca('0x13')]===0x1f4){logger[_0x87ca('0x12')](_0x87ca('0xf'),_0x1c5ca3,_0x4953ff[_0x87ca('0x12')][_0x87ca('0x14')]);return _0x444f47(_0x4953ff[_0x87ca('0x12')][_0x87ca('0x14')]);}logger['error'](_0x87ca('0xf'),_0x1c5ca3,_0x4953ff['error'][_0x87ca('0x14')]);return _0x10323f(_0x4953ff[_0x87ca('0x12')][_0x87ca('0x14')]);}else{logger[_0x87ca('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1c5ca3,_0x87ca('0x11'));_0x10323f(_0x4953ff['result'][_0x87ca('0x14')]);}})[_0x87ca('0x15')](function(_0xd8d74b){logger[_0x87ca('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1c5ca3,_0xd8d74b);_0x444f47(_0xd8d74b);});});} \ No newline at end of file +var _0x24bf=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','request','then','info','request\x20sent','debug','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x46969b,_0x60ebd1){var _0x113267=function(_0x30596f){while(--_0x30596f){_0x46969b['push'](_0x46969b['shift']());}};_0x113267(++_0x60ebd1);}(_0x24bf,0xee));var _0xf24b=function(_0x27d8af,_0x423c80){_0x27d8af=_0x27d8af-0x0;var _0xf4c794=_0x24bf[_0x27d8af];return _0xf4c794;};'use strict';var _=require(_0xf24b('0x0'));var util=require(_0xf24b('0x1'));var moment=require(_0xf24b('0x2'));var BPromise=require('bluebird');var rs=require(_0xf24b('0x3'));var fs=require('fs');var Redis=require(_0xf24b('0x4'));var db=require(_0xf24b('0x5'))['db'];var utils=require(_0xf24b('0x6'));var logger=require('../../config/logger')(_0xf24b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49d77e,_0x7fe9ac,_0x3ae084){return new BPromise(function(_0x3bbdb2,_0x18d780){return client[_0xf24b('0x8')](_0x49d77e,_0x3ae084)[_0xf24b('0x9')](function(_0x7a7391){logger[_0xf24b('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x7fe9ac,_0xf24b('0xb'));logger[_0xf24b('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x7fe9ac,_0xf24b('0xb'),JSON[_0xf24b('0xd')](_0x7a7391));if(_0x7a7391[_0xf24b('0xe')]){if(_0x7a7391['error'][_0xf24b('0xf')]===0x1f4){logger[_0xf24b('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x7fe9ac,_0x7a7391[_0xf24b('0xe')][_0xf24b('0x10')]);return _0x18d780(_0x7a7391[_0xf24b('0xe')]['message']);}logger['error'](_0xf24b('0x11'),_0x7fe9ac,_0x7a7391[_0xf24b('0xe')]['message']);return _0x3bbdb2(_0x7a7391['error']['message']);}else{logger[_0xf24b('0xa')](_0xf24b('0x11'),_0x7fe9ac,'request\x20sent');_0x3bbdb2(_0x7a7391[_0xf24b('0x12')][_0xf24b('0x10')]);}})[_0xf24b('0x13')](function(_0x235117){logger[_0xf24b('0xe')](_0xf24b('0x11'),_0x7fe9ac,_0x235117);_0x18d780(_0x235117);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3bbb04d..d012ef1 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 _0x46d5=['index','/describe','isAuthenticated','describe','get','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0x34ecea,_0x3d11ce){var _0x44b6a8=function(_0x5843a1){while(--_0x5843a1){_0x34ecea['push'](_0x34ecea['shift']());}};_0x44b6a8(++_0x3d11ce);}(_0x46d5,0x1c4));var _0x546d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x46d5[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x546d('0x0'));var util=require('util');var path=require(_0x546d('0x1'));var timeout=require(_0x546d('0x2'));var express=require(_0x546d('0x3'));var router=express[_0x546d('0x4')]();var fs_extra=require(_0x546d('0x5'));var auth=require(_0x546d('0x6'));var interaction=require(_0x546d('0x7'));var config=require(_0x546d('0x8'));var controller=require(_0x546d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x546d('0xa')]);router['get'](_0x546d('0xb'),auth[_0x546d('0xc')](),controller[_0x546d('0xd')]);router[_0x546d('0xe')](_0x546d('0xf'),auth[_0x546d('0xc')](),controller[_0x546d('0x10')]);router[_0x546d('0x11')]('/',auth[_0x546d('0xc')](),controller[_0x546d('0x12')]);router['put'](_0x546d('0xf'),auth[_0x546d('0xc')](),controller[_0x546d('0x13')]);router[_0x546d('0x14')](_0x546d('0xf'),auth[_0x546d('0xc')](),controller['destroy']);module[_0x546d('0x15')]=router; \ No newline at end of file +var _0x029b=['get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0x5a240c,_0x10c586){var _0x349d51=function(_0xa9ee4d){while(--_0xa9ee4d){_0x5a240c['push'](_0x5a240c['shift']());}};_0x349d51(++_0x10c586);}(_0x029b,0x1ef));var _0xb029=function(_0x5a81fa,_0x21d2d0){_0x5a81fa=_0x5a81fa-0x0;var _0x342813=_0x029b[_0x5a81fa];return _0x342813;};'use strict';var multer=require(_0xb029('0x0'));var util=require(_0xb029('0x1'));var path=require(_0xb029('0x2'));var timeout=require(_0xb029('0x3'));var express=require(_0xb029('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb029('0x5'));var interaction=require(_0xb029('0x6'));var config=require(_0xb029('0x7'));var controller=require(_0xb029('0x8'));router[_0xb029('0x9')]('/',auth[_0xb029('0xa')](),controller['index']);router['get'](_0xb029('0xb'),auth[_0xb029('0xa')](),controller[_0xb029('0xc')]);router[_0xb029('0x9')](_0xb029('0xd'),auth[_0xb029('0xa')](),controller['show']);router[_0xb029('0xe')]('/',auth[_0xb029('0xa')](),controller[_0xb029('0xf')]);router[_0xb029('0x10')](_0xb029('0xd'),auth[_0xb029('0xa')](),controller[_0xb029('0x11')]);router[_0xb029('0x12')](_0xb029('0xd'),auth[_0xb029('0xa')](),controller[_0xb029('0x13')]);module[_0xb029('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 6ff49f9..016e509 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 _0x1082=['mouseOver','INTEGER','exports','STRING'];(function(_0x2b3411,_0x164872){var _0x4d988e=function(_0x33e1cd){while(--_0x33e1cd){_0x2b3411['push'](_0x2b3411['shift']());}};_0x4d988e(++_0x164872);}(_0x1082,0xe2));var _0x2108=function(_0xfc36d8,_0x233b0b){_0xfc36d8=_0xfc36d8-0x0;var _0x234f42=_0x1082[_0xfc36d8];return _0x234f42;};'use strict';var Sequelize=require('sequelize');module[_0x2108('0x0')]={'name':{'type':Sequelize[_0x2108('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2108('0x2'),'timeout'),'defaultValue':_0x2108('0x2')},'selector':{'type':Sequelize[_0x2108('0x1')]},'timeout':{'type':Sequelize[_0x2108('0x3')]}}; \ No newline at end of file +var _0x81bb=['mouseOver','timeout','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x4a350c,_0x2760a1){var _0x51bb79=function(_0x1789a8){while(--_0x1789a8){_0x4a350c['push'](_0x4a350c['shift']());}};_0x51bb79(++_0x2760a1);}(_0x81bb,0x1ae));var _0xb81b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb81b('0x0'));module[_0xb81b('0x1')]={'name':{'type':Sequelize[_0xb81b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb81b('0x3')](_0xb81b('0x4'),_0xb81b('0x5')),'defaultValue':_0xb81b('0x4')},'selector':{'type':Sequelize[_0xb81b('0x2')]},'timeout':{'type':Sequelize[_0xb81b('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 3fa2424..ac3b6bf 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 _0xf569=['reject','save','then','destroy','end','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x424b79,_0x4ed2bd){var _0x1008d8=function(_0x466db1){while(--_0x466db1){_0x424b79['push'](_0x424b79['shift']());}};_0x1008d8(++_0x4ed2bd);}(_0xf569,0xd0));var _0x9f56=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xf569[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f56('0x0'));var zipdir=require(_0x9f56('0x1'));var jsonpatch=require(_0x9f56('0x2'));var rp=require(_0x9f56('0x3'));var moment=require(_0x9f56('0x4'));var BPromise=require(_0x9f56('0x5'));var Mustache=require(_0x9f56('0x6'));var util=require(_0x9f56('0x7'));var path=require('path');var sox=require(_0x9f56('0x8'));var csv=require('to-csv');var ejs=require(_0x9f56('0x9'));var fs=require('fs');var fs_extra=require(_0x9f56('0xa'));var _=require('lodash');var squel=require(_0x9f56('0xb'));var crypto=require(_0x9f56('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f56('0xd'));var toCsv=require(_0x9f56('0xe'));var querystring=require(_0x9f56('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f56('0x10'));var qs=require(_0x9f56('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f56('0x12'));var logger=require(_0x9f56('0x13'))(_0x9f56('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9f56('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bbd25,_0x562e22){_0x562e22=_0x562e22||0xcc;return function(_0x4dfeb3){if(_0x4dfeb3){return _0x3bbd25[_0x9f56('0x16')](_0x562e22);}return _0x3bbd25[_0x9f56('0x17')](_0x562e22)['end']();};}function respondWithResult(_0x227587,_0x41a602){_0x41a602=_0x41a602||0xc8;return function(_0x380d36){if(_0x380d36){return _0x227587[_0x9f56('0x17')](_0x41a602)[_0x9f56('0x18')](_0x380d36);}};}function respondWithFilteredResult(_0x8e3485,_0x1527d6){return function(_0x244d06){if(_0x244d06){var _0x4228f5=typeof _0x1527d6[_0x9f56('0x19')]===_0x9f56('0x1a')&&typeof _0x1527d6[_0x9f56('0x1b')]===_0x9f56('0x1a');var _0x9c39ec=_0x244d06[_0x9f56('0x1c')];var _0x21808b=_0x4228f5?0x0:_0x1527d6[_0x9f56('0x19')];var _0x175dbe=_0x4228f5?_0x244d06['count']:_0x1527d6['offset']+_0x1527d6[_0x9f56('0x1b')];var _0x2294aa;if(_0x175dbe>=_0x9c39ec){_0x175dbe=_0x9c39ec;_0x2294aa=0xc8;}else{_0x2294aa=0xce;}_0x8e3485[_0x9f56('0x17')](_0x2294aa);return _0x8e3485[_0x9f56('0x1d')](_0x9f56('0x1e'),_0x21808b+'-'+_0x175dbe+'/'+_0x9c39ec)['json'](_0x244d06);}return null;};}function patchUpdates(_0x433418){return function(_0x25d1ea){try{jsonpatch[_0x9f56('0x1f')](_0x25d1ea,_0x433418,!![]);}catch(_0x2da6af){return BPromise[_0x9f56('0x20')](_0x2da6af);}return _0x25d1ea[_0x9f56('0x21')]();};}function saveUpdates(_0x249605,_0x4a4f94){return function(_0x151c83){if(_0x151c83){return _0x151c83['update'](_0x249605)[_0x9f56('0x22')](function(_0x61c6f2){return _0x61c6f2;});}return null;};}function removeEntity(_0x43aae6,_0x29441b){return function(_0x488d21){if(_0x488d21){return _0x488d21[_0x9f56('0x23')]()[_0x9f56('0x22')](function(){_0x43aae6['status'](0xcc)[_0x9f56('0x24')]();});}};}function handleEntityNotFound(_0x2c0905,_0x5b45ee){return function(_0x460da4){if(!_0x460da4){_0x2c0905[_0x9f56('0x16')](0x194);}return _0x460da4;};}function handleError(_0x5c4ed7,_0x5bda8f){_0x5bda8f=_0x5bda8f||0x1f4;return function(_0x42c371){logger[_0x9f56('0x25')](_0x42c371[_0x9f56('0x26')]);if(_0x42c371[_0x9f56('0x27')]){delete _0x42c371[_0x9f56('0x27')];}_0x5c4ed7[_0x9f56('0x17')](_0x5bda8f)['send'](_0x42c371);};}exports[_0x9f56('0x28')]=function(_0xe2ebc1,_0x23b49a){var _0xe119e5={'raw':!![],'where':{'id':_0xe2ebc1[_0x9f56('0x29')]['id']}},_0x4b4066={};_0x4b4066[_0x9f56('0x2a')]=_[_0x9f56('0x2b')](db[_0x9f56('0x2c')][_0x9f56('0x2d')]);_0x4b4066[_0x9f56('0x2e')]=_[_0x9f56('0x2b')](_0xe2ebc1[_0x9f56('0x2e')]);_0x4b4066[_0x9f56('0x2f')]=_[_0x9f56('0x30')](_0x4b4066[_0x9f56('0x2a')],_0x4b4066[_0x9f56('0x2e')]);_0xe119e5['attributes']=_['intersection'](_0x4b4066[_0x9f56('0x2a')],qs['fields'](_0xe2ebc1[_0x9f56('0x2e')][_0x9f56('0x31')]));_0xe119e5[_0x9f56('0x32')]=_0xe119e5[_0x9f56('0x32')][_0x9f56('0x33')]?_0xe119e5[_0x9f56('0x32')]:_0x4b4066[_0x9f56('0x2a')];if(_0xe2ebc1['query'][_0x9f56('0x34')]){_0xe119e5['include']=[{'all':!![]}];}_0xe119e5=_[_0x9f56('0x35')]({},_0xe119e5,_0xe2ebc1[_0x9f56('0x36')]);return db[_0x9f56('0x2c')][_0x9f56('0x37')](_0xe119e5)[_0x9f56('0x22')](handleEntityNotFound(_0x23b49a,null))[_0x9f56('0x22')](respondWithResult(_0x23b49a,null))[_0x9f56('0x38')](handleError(_0x23b49a,null));};exports[_0x9f56('0x39')]=function(_0x4b938f,_0x4deb0d){return db[_0x9f56('0x2c')][_0x9f56('0x39')](_0x4b938f['body'],{})['then'](respondWithResult(_0x4deb0d,0xc9))['catch'](handleError(_0x4deb0d,null));};exports[_0x9f56('0x3a')]=function(_0x3df1b3,_0x380aac){if(_0x3df1b3['body']['id']){delete _0x3df1b3[_0x9f56('0x3b')]['id'];}return db[_0x9f56('0x2c')][_0x9f56('0x37')]({'where':{'id':_0x3df1b3['params']['id']}})[_0x9f56('0x22')](handleEntityNotFound(_0x380aac,null))[_0x9f56('0x22')](saveUpdates(_0x3df1b3['body'],null))[_0x9f56('0x22')](respondWithResult(_0x380aac,null))['catch'](handleError(_0x380aac,null));};exports[_0x9f56('0x23')]=function(_0x50fb79,_0x50ccc7){return db['ChatProactiveAction'][_0x9f56('0x37')]({'where':{'id':_0x50fb79[_0x9f56('0x29')]['id']}})[_0x9f56('0x22')](handleEntityNotFound(_0x50ccc7,null))['then'](removeEntity(_0x50ccc7,null))['catch'](handleError(_0x50ccc7,null));}; \ No newline at end of file +var _0xac4f=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','model','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','eml-format','zip-dir','request-promise','mustache','util'];(function(_0x16c32f,_0x364af0){var _0x227819=function(_0x364430){while(--_0x364430){_0x16c32f['push'](_0x16c32f['shift']());}};_0x227819(++_0x364af0);}(_0xac4f,0x122));var _0xfac4=function(_0x1ad07b,_0x551d55){_0x1ad07b=_0x1ad07b-0x0;var _0x2c447f=_0xac4f[_0x1ad07b];return _0x2c447f;};'use strict';var emlformat=require(_0xfac4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfac4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfac4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfac4('0x3'));var util=require(_0xfac4('0x4'));var path=require('path');var sox=require(_0xfac4('0x5'));var csv=require(_0xfac4('0x6'));var ejs=require(_0xfac4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfac4('0x8'));var squel=require(_0xfac4('0x9'));var crypto=require(_0xfac4('0xa'));var jsforce=require(_0xfac4('0xb'));var deskjs=require(_0xfac4('0xc'));var toCsv=require(_0xfac4('0x6'));var querystring=require('querystring');var Papa=require(_0xfac4('0xd'));var Redis=require(_0xfac4('0xe'));var authService=require(_0xfac4('0xf'));var qs=require(_0xfac4('0x10'));var as=require(_0xfac4('0x11'));var hardwareService=require(_0xfac4('0x12'));var logger=require(_0xfac4('0x13'))(_0xfac4('0x14'));var utils=require(_0xfac4('0x15'));var config=require(_0xfac4('0x16'));var licenseUtil=require(_0xfac4('0x17'));var db=require(_0xfac4('0x18'))['db'];function respondWithStatusCode(_0x5e374a,_0x2f9c87){_0x2f9c87=_0x2f9c87||0xcc;return function(_0x5bcc16){if(_0x5bcc16){return _0x5e374a[_0xfac4('0x19')](_0x2f9c87);}return _0x5e374a[_0xfac4('0x1a')](_0x2f9c87)[_0xfac4('0x1b')]();};}function respondWithResult(_0x4599cc,_0x114653){_0x114653=_0x114653||0xc8;return function(_0xcde790){if(_0xcde790){return _0x4599cc[_0xfac4('0x1a')](_0x114653)[_0xfac4('0x1c')](_0xcde790);}};}function respondWithFilteredResult(_0x48a42b,_0x3d529f){return function(_0x40fe62){if(_0x40fe62){var _0x3be3c1=typeof _0x3d529f[_0xfac4('0x1d')]===_0xfac4('0x1e')&&typeof _0x3d529f[_0xfac4('0x1f')]===_0xfac4('0x1e');var _0x310bb2=_0x40fe62[_0xfac4('0x20')];var _0x4baa92=_0x3be3c1?0x0:_0x3d529f['offset'];var _0x4ba14e=_0x3be3c1?_0x40fe62[_0xfac4('0x20')]:_0x3d529f[_0xfac4('0x1d')]+_0x3d529f['limit'];var _0x5d75c2;if(_0x4ba14e>=_0x310bb2){_0x4ba14e=_0x310bb2;_0x5d75c2=0xc8;}else{_0x5d75c2=0xce;}_0x48a42b['status'](_0x5d75c2);return _0x48a42b[_0xfac4('0x21')](_0xfac4('0x22'),_0x4baa92+'-'+_0x4ba14e+'/'+_0x310bb2)['json'](_0x40fe62);}return null;};}function patchUpdates(_0x227f7e){return function(_0xb69d66){try{jsonpatch[_0xfac4('0x23')](_0xb69d66,_0x227f7e,!![]);}catch(_0x626514){return BPromise[_0xfac4('0x24')](_0x626514);}return _0xb69d66[_0xfac4('0x25')]();};}function saveUpdates(_0x41ac63,_0x6b08a2){return function(_0x238895){if(_0x238895){return _0x238895[_0xfac4('0x26')](_0x41ac63)[_0xfac4('0x27')](function(_0x54d294){return _0x54d294;});}return null;};}function removeEntity(_0x3c3947,_0x1b09d2){return function(_0x56aab9){if(_0x56aab9){return _0x56aab9[_0xfac4('0x28')]()[_0xfac4('0x27')](function(){_0x3c3947[_0xfac4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d637,_0x8e5686){return function(_0x58bb4b){if(!_0x58bb4b){_0x44d637[_0xfac4('0x19')](0x194);}return _0x58bb4b;};}function handleError(_0x41c8c6,_0x395754){_0x395754=_0x395754||0x1f4;return function(_0x3b54e4){logger[_0xfac4('0x29')](_0x3b54e4['stack']);if(_0x3b54e4[_0xfac4('0x2a')]){delete _0x3b54e4['name'];}_0x41c8c6[_0xfac4('0x1a')](_0x395754)[_0xfac4('0x2b')](_0x3b54e4);};}exports['show']=function(_0x10eb97,_0x4bf01e){var _0xe6e21c={'raw':!![],'where':{'id':_0x10eb97['params']['id']}},_0x59c386={};_0x59c386[_0xfac4('0x2c')]=_['keys'](db[_0xfac4('0x2d')][_0xfac4('0x2e')]);_0x59c386['query']=_['keys'](_0x10eb97[_0xfac4('0x2f')]);_0x59c386['filters']=_[_0xfac4('0x30')](_0x59c386[_0xfac4('0x2c')],_0x59c386[_0xfac4('0x2f')]);_0xe6e21c[_0xfac4('0x31')]=_[_0xfac4('0x30')](_0x59c386[_0xfac4('0x2c')],qs['fields'](_0x10eb97['query'][_0xfac4('0x32')]));_0xe6e21c[_0xfac4('0x31')]=_0xe6e21c[_0xfac4('0x31')][_0xfac4('0x33')]?_0xe6e21c[_0xfac4('0x31')]:_0x59c386[_0xfac4('0x2c')];if(_0x10eb97[_0xfac4('0x2f')][_0xfac4('0x34')]){_0xe6e21c[_0xfac4('0x35')]=[{'all':!![]}];}_0xe6e21c=_[_0xfac4('0x36')]({},_0xe6e21c,_0x10eb97['options']);return db['ChatProactiveAction'][_0xfac4('0x37')](_0xe6e21c)[_0xfac4('0x27')](handleEntityNotFound(_0x4bf01e,null))[_0xfac4('0x27')](respondWithResult(_0x4bf01e,null))[_0xfac4('0x38')](handleError(_0x4bf01e,null));};exports[_0xfac4('0x39')]=function(_0x1a27dd,_0x1a8d65){return db[_0xfac4('0x2d')][_0xfac4('0x39')](_0x1a27dd[_0xfac4('0x3a')],{})[_0xfac4('0x27')](respondWithResult(_0x1a8d65,0xc9))[_0xfac4('0x38')](handleError(_0x1a8d65,null));};exports['update']=function(_0x3e944d,_0x150733){if(_0x3e944d[_0xfac4('0x3a')]['id']){delete _0x3e944d[_0xfac4('0x3a')]['id'];}return db[_0xfac4('0x2d')][_0xfac4('0x37')]({'where':{'id':_0x3e944d['params']['id']}})['then'](handleEntityNotFound(_0x150733,null))[_0xfac4('0x27')](saveUpdates(_0x3e944d[_0xfac4('0x3a')],null))[_0xfac4('0x27')](respondWithResult(_0x150733,null))['catch'](handleError(_0x150733,null));};exports[_0xfac4('0x28')]=function(_0x1cdbc5,_0x4384dd){return db[_0xfac4('0x2d')][_0xfac4('0x37')]({'where':{'id':_0x1cdbc5['params']['id']}})[_0xfac4('0x27')](handleEntityNotFound(_0x4384dd,null))[_0xfac4('0x27')](removeEntity(_0x4384dd,null))[_0xfac4('0x38')](handleError(_0x4384dd,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 113218e..0a524cf 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 _0x721d=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','path','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x5b8e8d,_0x41e634){var _0x24e6e3=function(_0x4fb5d4){while(--_0x4fb5d4){_0x5b8e8d['push'](_0x5b8e8d['shift']());}};_0x24e6e3(++_0x41e634);}(_0x721d,0x1d7));var _0xd721=function(_0x259a42,_0x2b4483){_0x259a42=_0x259a42-0x0;var _0x548d68=_0x721d[_0x259a42];return _0x548d68;};'use strict';var _=require(_0xd721('0x0'));var util=require(_0xd721('0x1'));var logger=require(_0xd721('0x2'))(_0xd721('0x3'));var moment=require(_0xd721('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd721('0x5'));var rimraf=require(_0xd721('0x6'));var config=require('../../config/environment');var attributes=require(_0xd721('0x7'));module[_0xd721('0x8')]=function(_0x3c3595,_0x598d8d){return _0x3c3595[_0xd721('0x9')](_0xd721('0xa'),attributes,{'tableName':_0xd721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb41f=['request-promise','path','../../config/environment','exports','define','chat_proactive_actions','lodash','util','moment'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xb41f,0x189));var _0xfb41=function(_0x152820,_0x1a3e1f){_0x152820=_0x152820-0x0;var _0x1a5895=_0xb41f[_0x152820];return _0x1a5895;};'use strict';var _=require(_0xfb41('0x0'));var util=require(_0xfb41('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfb41('0x2'));var BPromise=require('bluebird');var rp=require(_0xfb41('0x3'));var fs=require('fs');var path=require(_0xfb41('0x4'));var rimraf=require('rimraf');var config=require(_0xfb41('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0xfb41('0x6')]=function(_0x57cbd6,_0xdf1031){return _0x57cbd6[_0xfb41('0x7')]('ChatProactiveAction',attributes,{'tableName':_0xfb41('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 577f229..18b3b32 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 _0xae95=['../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error','message','catch','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x1e7df0,_0x52e3df){var _0x44fdea=function(_0xd4b08d){while(--_0xd4b08d){_0x1e7df0['push'](_0x1e7df0['shift']());}};_0x44fdea(++_0x52e3df);}(_0xae95,0xcc));var _0x5ae9=function(_0x24dcb7,_0x370f00){_0x24dcb7=_0x24dcb7-0x0;var _0x5e12bb=_0xae95[_0x24dcb7];return _0x5e12bb;};'use strict';var _=require('lodash');var util=require(_0x5ae9('0x0'));var moment=require(_0x5ae9('0x1'));var BPromise=require(_0x5ae9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ae9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ae9('0x4'))('rpc');var config=require(_0x5ae9('0x5'));var jayson=require(_0x5ae9('0x6'));var client=jayson[_0x5ae9('0x7')][_0x5ae9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ca96d,_0x291eea,_0x1b4fd5){return new BPromise(function(_0x1a8f57,_0x508cb8){return client[_0x5ae9('0x9')](_0x4ca96d,_0x1b4fd5)[_0x5ae9('0xa')](function(_0x5cccd8){logger['info'](_0x5ae9('0xb'),_0x291eea,_0x5ae9('0xc'));logger[_0x5ae9('0xd')](_0x5ae9('0xe'),_0x291eea,_0x5ae9('0xc'),JSON['stringify'](_0x5cccd8));if(_0x5cccd8['error']){if(_0x5cccd8['error'][_0x5ae9('0xf')]===0x1f4){logger[_0x5ae9('0x10')](_0x5ae9('0xb'),_0x291eea,_0x5cccd8['error'][_0x5ae9('0x11')]);return _0x508cb8(_0x5cccd8[_0x5ae9('0x10')][_0x5ae9('0x11')]);}logger[_0x5ae9('0x10')](_0x5ae9('0xb'),_0x291eea,_0x5cccd8[_0x5ae9('0x10')]['message']);return _0x1a8f57(_0x5cccd8[_0x5ae9('0x10')]['message']);}else{logger['info'](_0x5ae9('0xb'),_0x291eea,_0x5ae9('0xc'));_0x1a8f57(_0x5cccd8['result'][_0x5ae9('0x11')]);}})[_0x5ae9('0x12')](function(_0x574662){logger[_0x5ae9('0x10')](_0x5ae9('0xb'),_0x291eea,_0x574662);_0x508cb8(_0x574662);});});} \ No newline at end of file +var _0x0059=['moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4d4124,_0x203fb2){var _0x241ed7=function(_0x505402){while(--_0x505402){_0x4d4124['push'](_0x4d4124['shift']());}};_0x241ed7(++_0x203fb2);}(_0x0059,0x1a0));var _0x9005=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x0059[_0x4164f2];return _0x2575c7;};'use strict';var _=require(_0x9005('0x0'));var util=require(_0x9005('0x1'));var moment=require(_0x9005('0x2'));var BPromise=require(_0x9005('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9005('0x4'))['db'];var utils=require(_0x9005('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9005('0x6'));var client=jayson[_0x9005('0x7')][_0x9005('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x455d7e,_0x401487,_0x3cfd00){return new BPromise(function(_0x111d0a,_0x56ca11){return client[_0x9005('0x9')](_0x455d7e,_0x3cfd00)[_0x9005('0xa')](function(_0x17e4ea){logger[_0x9005('0xb')](_0x9005('0xc'),_0x401487,_0x9005('0xd'));logger[_0x9005('0xe')](_0x9005('0xf'),_0x401487,_0x9005('0xd'),JSON[_0x9005('0x10')](_0x17e4ea));if(_0x17e4ea[_0x9005('0x11')]){if(_0x17e4ea['error'][_0x9005('0x12')]===0x1f4){logger[_0x9005('0x11')](_0x9005('0xc'),_0x401487,_0x17e4ea[_0x9005('0x11')]['message']);return _0x56ca11(_0x17e4ea[_0x9005('0x11')][_0x9005('0x13')]);}logger[_0x9005('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x401487,_0x17e4ea[_0x9005('0x11')]['message']);return _0x111d0a(_0x17e4ea['error'][_0x9005('0x13')]);}else{logger[_0x9005('0xb')](_0x9005('0xc'),_0x401487,_0x9005('0xd'));_0x111d0a(_0x17e4ea[_0x9005('0x14')][_0x9005('0x13')]);}})[_0x9005('0x15')](function(_0xa7cc27){logger['error'](_0x9005('0xc'),_0x401487,_0xa7cc27);_0x56ca11(_0xa7cc27);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 4ecc716..89f1943 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x75e381,_0x2b6221){_0x75e381=_0x75e381-0x0;var _0x439cd8=_0xb4c7[_0x75e381];return _0x439cd8;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file +var _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x19dfd0,_0x30a860){var _0x4f34f2=function(_0x1700c2){while(--_0x1700c2){_0x19dfd0['push'](_0x19dfd0['shift']());}};_0x4f34f2(++_0x30a860);}(_0xdc97,0x13b));var _0x7dc9=function(_0x7fbff5,_0x2cefab){_0x7fbff5=_0x7fbff5-0x0;var _0x267b7b=_0xdc97[_0x7fbff5];return _0x267b7b;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 7da64aa..27a4474 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 _0xfc04=['rrmemory','beepall','sequelize','name','STRING','ENUM'];(function(_0x54c81c,_0x3a13ab){var _0x35931a=function(_0xab93ab){while(--_0xab93ab){_0x54c81c['push'](_0x54c81c['shift']());}};_0x35931a(++_0x3a13ab);}(_0xfc04,0x8c));var _0x4fc0=function(_0x36ac8e,_0x1fe4d2){_0x36ac8e=_0x36ac8e-0x0;var _0x25e11f=_0xfc04[_0x36ac8e];return _0x25e11f;};'use strict';var Sequelize=require(_0x4fc0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4fc0('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4fc0('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4fc0('0x3')](_0x4fc0('0x4'),_0x4fc0('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x44f6=['name','STRING','beepall','roundrobin','sequelize'];(function(_0x1dfdd9,_0x929f05){var _0x317c2e=function(_0x5ac989){while(--_0x5ac989){_0x1dfdd9['push'](_0x1dfdd9['shift']());}};_0x317c2e(++_0x929f05);}(_0x44f6,0x1da));var _0x644f=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x44f6[_0x474d97];return _0x1edf25;};'use strict';var Sequelize=require(_0x644f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x644f('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x644f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x644f('0x3'),_0x644f('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0eddbb2..95b668e 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 _0x6c89=['online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','ids','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','union','compact','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','http','request','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','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','ChatQueue','include','findAll','rows','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','nolimit','order','pick','ChatQueueId','User','findAndCountAll','createdAt','format','%s/%s','chatPause','updatedAt','getTeams','addTeams','Team','Agents'];(function(_0x52161c,_0x369f65){var _0x1404ee=function(_0x27ba33){while(--_0x27ba33){_0x52161c['push'](_0x52161c['shift']());}};_0x1404ee(++_0x369f65);}(_0x6c89,0x1e8));var _0x96c8=function(_0x2bade9,_0x5ba94e){_0x2bade9=_0x2bade9-0x0;var _0x1d6356=_0x6c89[_0x2bade9];return _0x1d6356;};'use strict';var emlformat=require(_0x96c8('0x0'));var rimraf=require(_0x96c8('0x1'));var zipdir=require(_0x96c8('0x2'));var jsonpatch=require(_0x96c8('0x3'));var rp=require(_0x96c8('0x4'));var moment=require(_0x96c8('0x5'));var BPromise=require(_0x96c8('0x6'));var Mustache=require(_0x96c8('0x7'));var util=require(_0x96c8('0x8'));var path=require('path');var sox=require(_0x96c8('0x9'));var csv=require(_0x96c8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96c8('0xb'));var _=require(_0x96c8('0xc'));var squel=require(_0x96c8('0xd'));var crypto=require('crypto');var jsforce=require(_0x96c8('0xe'));var deskjs=require(_0x96c8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x96c8('0x10'));var Papa=require('papaparse');var Redis=require(_0x96c8('0x11'));var authService=require(_0x96c8('0x12'));var qs=require(_0x96c8('0x13'));var as=require(_0x96c8('0x14'));var hardwareService=require(_0x96c8('0x15'));var logger=require(_0x96c8('0x16'))('api');var utils=require(_0x96c8('0x17'));var config=require(_0x96c8('0x18'));var licenseUtil=require(_0x96c8('0x19'));var db=require(_0x96c8('0x1a'))['db'];config['redis']=_[_0x96c8('0x1b')](config[_0x96c8('0x1c')],{'host':_0x96c8('0x1d'),'port':0x18eb});var socket=require(_0x96c8('0x1e'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x96c8('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x96c8('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3abd06,_0xbf78cf,_0x5dddff,_0x2aa88e){return new BPromise(function(_0x4fb662,_0x1c23a4){var _0x3b39a3=_0x2aa88e||client;return _0x3b39a3[_0x96c8('0x21')](_0x3abd06,_0x5dddff)[_0x96c8('0x22')](function(_0x3e0236){logger['info'](_0x96c8('0x23'),_0xbf78cf,_0x96c8('0x24'));logger[_0x96c8('0x25')](_0x96c8('0x26'),_0xbf78cf,_0x96c8('0x24'),JSON[_0x96c8('0x27')](_0x3e0236));if(_0x3e0236[_0x96c8('0x28')]){if(_0x3e0236['error'][_0x96c8('0x29')]===0x1f4){logger[_0x96c8('0x28')]('ChatQueue,\x20%s,\x20%s',_0xbf78cf,_0x3e0236['error'][_0x96c8('0x2a')]);return _0x1c23a4(_0x3e0236[_0x96c8('0x28')][_0x96c8('0x2a')]);}logger['error'](_0x96c8('0x23'),_0xbf78cf,_0x3e0236[_0x96c8('0x28')][_0x96c8('0x2a')]);return _0x4fb662(_0x3e0236[_0x96c8('0x28')]['message']);}else{logger[_0x96c8('0x2b')](_0x96c8('0x23'),_0xbf78cf,'request\x20sent');_0x4fb662(_0x3e0236['result'][_0x96c8('0x2a')]);}})[_0x96c8('0x2c')](function(_0x969ce2){logger[_0x96c8('0x28')](_0x96c8('0x23'),_0xbf78cf,_0x969ce2);_0x1c23a4(_0x969ce2);});});}function respondWithStatusCode(_0x4a3ce1,_0x44b025){_0x44b025=_0x44b025||0xcc;return function(_0x352e2f){if(_0x352e2f){return _0x4a3ce1[_0x96c8('0x2d')](_0x44b025);}return _0x4a3ce1[_0x96c8('0x2e')](_0x44b025)[_0x96c8('0x2f')]();};}function respondWithResult(_0x42e10a,_0x213b23){_0x213b23=_0x213b23||0xc8;return function(_0x413d17){if(_0x413d17){return _0x42e10a['status'](_0x213b23)[_0x96c8('0x30')](_0x413d17);}};}function respondWithFilteredResult(_0xeb1c1,_0x5bf904){return function(_0xf7e80f){if(_0xf7e80f){var _0x33f74b=typeof _0x5bf904['offset']===_0x96c8('0x31')&&typeof _0x5bf904[_0x96c8('0x32')]===_0x96c8('0x31');var _0x5e27b6=_0xf7e80f[_0x96c8('0x33')];var _0x5e8539=_0x33f74b?0x0:_0x5bf904[_0x96c8('0x34')];var _0xf5869a=_0x33f74b?_0xf7e80f['count']:_0x5bf904[_0x96c8('0x34')]+_0x5bf904[_0x96c8('0x32')];var _0xa2c989;if(_0xf5869a>=_0x5e27b6){_0xf5869a=_0x5e27b6;_0xa2c989=0xc8;}else{_0xa2c989=0xce;}_0xeb1c1[_0x96c8('0x2e')](_0xa2c989);return _0xeb1c1['set'](_0x96c8('0x35'),_0x5e8539+'-'+_0xf5869a+'/'+_0x5e27b6)[_0x96c8('0x30')](_0xf7e80f);}return null;};}function patchUpdates(_0x340da2){return function(_0x5f420c){try{jsonpatch[_0x96c8('0x36')](_0x5f420c,_0x340da2,!![]);}catch(_0x19ca16){return BPromise[_0x96c8('0x37')](_0x19ca16);}return _0x5f420c[_0x96c8('0x38')]();};}function saveUpdates(_0x5b94c8,_0x6fdac3){return function(_0x524b36){if(_0x524b36){return _0x524b36[_0x96c8('0x39')](_0x5b94c8)[_0x96c8('0x22')](function(_0x4a9a0a){return _0x4a9a0a;});}return null;};}function removeEntity(_0x593b66,_0x5e1e09){return function(_0x471173){if(_0x471173){return _0x471173[_0x96c8('0x3a')]()[_0x96c8('0x22')](function(){var _0x9d49ad=_0x471173[_0x96c8('0x3b')]({'plain':!![]});var _0xa97271=_0x96c8('0x3c');return db[_0x96c8('0x3d')][_0x96c8('0x3a')]({'where':{'type':_0xa97271,'resourceId':_0x9d49ad['id']}})[_0x96c8('0x22')](function(){return _0x471173;});})[_0x96c8('0x22')](function(){_0x593b66['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c1bf6,_0x33d7ea){return function(_0x4f642a){if(!_0x4f642a){_0x3c1bf6['sendStatus'](0x194);}return _0x4f642a;};}function handleError(_0x4f4ffe,_0x54b805){_0x54b805=_0x54b805||0x1f4;return function(_0x26dc5b){logger[_0x96c8('0x28')](_0x26dc5b['stack']);if(_0x26dc5b[_0x96c8('0x3e')]){delete _0x26dc5b[_0x96c8('0x3e')];}_0x4f4ffe[_0x96c8('0x2e')](_0x54b805)[_0x96c8('0x3f')](_0x26dc5b);};}exports[_0x96c8('0x40')]=function(_0xe784d4,_0x8a4adb){var _0x1eb398={},_0x446336={},_0x417ebe={'count':0x0,'rows':[]};var _0x4ee1cf=_[_0x96c8('0x41')](db['ChatQueue']['rawAttributes'],function(_0x29c39e){return{'name':_0x29c39e['fieldName'],'type':_0x29c39e[_0x96c8('0x42')]['key']};});_0x446336[_0x96c8('0x43')]=_[_0x96c8('0x41')](_0x4ee1cf,'name');_0x446336[_0x96c8('0x44')]=_[_0x96c8('0x45')](_0xe784d4['query']);_0x446336[_0x96c8('0x46')]=_['intersection'](_0x446336[_0x96c8('0x43')],_0x446336[_0x96c8('0x44')]);_0x1eb398[_0x96c8('0x47')]=_[_0x96c8('0x48')](_0x446336[_0x96c8('0x43')],qs[_0x96c8('0x49')](_0xe784d4['query'][_0x96c8('0x49')]));_0x1eb398[_0x96c8('0x47')]=_0x1eb398[_0x96c8('0x47')][_0x96c8('0x4a')]?_0x1eb398[_0x96c8('0x47')]:_0x446336[_0x96c8('0x43')];if(!_0xe784d4[_0x96c8('0x44')][_0x96c8('0x4b')]('nolimit')){_0x1eb398['limit']=qs[_0x96c8('0x32')](_0xe784d4[_0x96c8('0x44')]['limit']);_0x1eb398[_0x96c8('0x34')]=qs['offset'](_0xe784d4['query'][_0x96c8('0x34')]);}_0x1eb398['order']=qs[_0x96c8('0x4c')](_0xe784d4['query'][_0x96c8('0x4c')]);_0x1eb398[_0x96c8('0x4d')]=qs[_0x96c8('0x46')](_['pick'](_0xe784d4['query'],_0x446336[_0x96c8('0x46')]),_0x4ee1cf);if(_0xe784d4['query'][_0x96c8('0x4e')]){_0x1eb398[_0x96c8('0x4d')]=_['merge'](_0x1eb398[_0x96c8('0x4d')],{'$or':_['map'](_0x4ee1cf,function(_0x3bb318){if(_0x3bb318[_0x96c8('0x42')]!==_0x96c8('0x4f')){var _0x38c7b3={};_0x38c7b3[_0x3bb318[_0x96c8('0x3e')]]={'$like':'%'+_0xe784d4[_0x96c8('0x44')]['filter']+'%'};return _0x38c7b3;}})});}_0x1eb398=_[_0x96c8('0x50')]({},_0x1eb398,_0xe784d4[_0x96c8('0x51')]);var _0x407d98={'where':_0x1eb398[_0x96c8('0x4d')]};return db[_0x96c8('0x52')][_0x96c8('0x33')](_0x407d98)['then'](function(_0x6aa42a){_0x417ebe[_0x96c8('0x33')]=_0x6aa42a;if(_0xe784d4[_0x96c8('0x44')]['includeAll']){_0x1eb398[_0x96c8('0x53')]=[{'all':!![]}];}return db[_0x96c8('0x52')][_0x96c8('0x54')](_0x1eb398);})['then'](function(_0x35b9e3){_0x417ebe[_0x96c8('0x55')]=_0x35b9e3;return _0x417ebe;})[_0x96c8('0x22')](respondWithFilteredResult(_0x8a4adb,_0x1eb398))[_0x96c8('0x2c')](handleError(_0x8a4adb,null));};exports[_0x96c8('0x56')]=function(_0x13fb8e,_0x44d649){var _0x70d9b2={'raw':!![],'where':{'id':_0x13fb8e['params']['id']}},_0x392952={};_0x392952[_0x96c8('0x43')]=_['keys'](db[_0x96c8('0x52')][_0x96c8('0x57')]);_0x392952[_0x96c8('0x44')]=_[_0x96c8('0x45')](_0x13fb8e[_0x96c8('0x44')]);_0x392952['filters']=_['intersection'](_0x392952[_0x96c8('0x43')],_0x392952['query']);_0x70d9b2[_0x96c8('0x47')]=_[_0x96c8('0x48')](_0x392952[_0x96c8('0x43')],qs['fields'](_0x13fb8e[_0x96c8('0x44')][_0x96c8('0x49')]));_0x70d9b2['attributes']=_0x70d9b2[_0x96c8('0x47')][_0x96c8('0x4a')]?_0x70d9b2[_0x96c8('0x47')]:_0x392952[_0x96c8('0x43')];if(_0x13fb8e[_0x96c8('0x44')][_0x96c8('0x58')]){_0x70d9b2[_0x96c8('0x53')]=[{'all':!![]}];}_0x70d9b2=_['merge']({},_0x70d9b2,_0x13fb8e[_0x96c8('0x51')]);return db[_0x96c8('0x52')][_0x96c8('0x59')](_0x70d9b2)[_0x96c8('0x22')](handleEntityNotFound(_0x44d649,null))[_0x96c8('0x22')](respondWithResult(_0x44d649,null))[_0x96c8('0x2c')](handleError(_0x44d649,null));};exports[_0x96c8('0x5a')]=function(_0x1ed791,_0x53042f){return db[_0x96c8('0x52')][_0x96c8('0x5a')](_0x1ed791[_0x96c8('0x5b')],{})[_0x96c8('0x22')](function(_0x49a3cd){var _0x44006c=_0x1ed791[_0x96c8('0x5c')][_0x96c8('0x3b')]({'plain':!![]});if(!_0x44006c)throw new Error(_0x96c8('0x5d'));if(_0x44006c[_0x96c8('0x5e')]===_0x96c8('0x5c')){var _0x59cb8f=_0x49a3cd[_0x96c8('0x3b')]({'plain':!![]});var _0x28d039=_0x96c8('0x3c');return db[_0x96c8('0x5f')][_0x96c8('0x59')]({'where':{'name':_0x28d039,'userProfileId':_0x44006c['userProfileId']},'raw':!![]})[_0x96c8('0x22')](function(_0x331f20){if(_0x331f20&&_0x331f20['autoAssociation']===0x0){return db[_0x96c8('0x3d')][_0x96c8('0x5a')]({'name':_0x59cb8f[_0x96c8('0x3e')],'resourceId':_0x59cb8f['id'],'type':_0x331f20[_0x96c8('0x3e')],'sectionId':_0x331f20['id']},{})[_0x96c8('0x22')](function(){return _0x49a3cd;});}else{return _0x49a3cd;}})[_0x96c8('0x2c')](function(_0x99fb25){logger['error'](_0x96c8('0x60'),_0x99fb25);throw _0x99fb25;});}return _0x49a3cd;})[_0x96c8('0x22')](respondWithResult(_0x53042f,0xc9))[_0x96c8('0x2c')](handleError(_0x53042f,null));};exports[_0x96c8('0x39')]=function(_0xffabba,_0x397bb7){if(_0xffabba[_0x96c8('0x5b')]['id']){delete _0xffabba[_0x96c8('0x5b')]['id'];}return db[_0x96c8('0x52')][_0x96c8('0x59')]({'where':{'id':_0xffabba[_0x96c8('0x61')]['id']}})['then'](handleEntityNotFound(_0x397bb7,null))['then'](saveUpdates(_0xffabba[_0x96c8('0x5b')],null))[_0x96c8('0x22')](respondWithResult(_0x397bb7,null))[_0x96c8('0x2c')](handleError(_0x397bb7,null));};exports[_0x96c8('0x3a')]=function(_0x9e9793,_0x5bcbdf){return db['ChatQueue'][_0x96c8('0x59')]({'where':{'id':_0x9e9793['params']['id']}})[_0x96c8('0x22')](handleEntityNotFound(_0x5bcbdf,null))[_0x96c8('0x22')](removeEntity(_0x5bcbdf,null))[_0x96c8('0x2c')](handleError(_0x5bcbdf,null));};exports[_0x96c8('0x62')]=function(_0x4511d4,_0x41e47d){return db[_0x96c8('0x52')]['describe']()[_0x96c8('0x22')](respondWithResult(_0x41e47d,null))['catch'](handleError(_0x41e47d,null));};exports['getMembers']=function(_0x2200e5,_0x46aa72,_0x2e9fcb){var _0x40ee31={'raw':!![],'where':{}},_0x5c3612={},_0xd25718;return db[_0x96c8('0x52')][_0x96c8('0x63')]({'where':{'id':_0x2200e5[_0x96c8('0x61')]['id']}})[_0x96c8('0x22')](handleEntityNotFound(_0x46aa72,null))[_0x96c8('0x22')](function(_0x37de32){if(_0x37de32){_0xd25718=_0x37de32[_0x96c8('0x3b')]({'plain':!![]});_0x5c3612[_0x96c8('0x43')]=_['keys'](db[_0x96c8('0x64')][_0x96c8('0x57')]);_0x5c3612['query']=_['keys'](_0x2200e5[_0x96c8('0x44')]);_0x5c3612[_0x96c8('0x46')]=_['intersection'](_0x5c3612[_0x96c8('0x43')],_0x5c3612[_0x96c8('0x44')]);_0x40ee31[_0x96c8('0x47')]=_[_0x96c8('0x48')](_0x5c3612['model'],qs[_0x96c8('0x49')](_0x2200e5[_0x96c8('0x44')][_0x96c8('0x49')]));_0x40ee31[_0x96c8('0x47')]=_0x40ee31[_0x96c8('0x47')]['length']?_0x40ee31['attributes']:_0x5c3612[_0x96c8('0x43')];if(!_0x2200e5[_0x96c8('0x44')][_0x96c8('0x4b')](_0x96c8('0x65'))){_0x40ee31[_0x96c8('0x32')]=qs[_0x96c8('0x32')](_0x2200e5[_0x96c8('0x44')]['limit']);_0x40ee31[_0x96c8('0x34')]=qs[_0x96c8('0x34')](_0x2200e5[_0x96c8('0x44')][_0x96c8('0x34')]);}_0x40ee31[_0x96c8('0x66')]=qs[_0x96c8('0x4c')](_0x2200e5[_0x96c8('0x44')][_0x96c8('0x4c')]);_0x40ee31[_0x96c8('0x4d')]=qs[_0x96c8('0x46')](_[_0x96c8('0x67')](_0x2200e5[_0x96c8('0x44')],_0x5c3612[_0x96c8('0x46')]));_0x40ee31[_0x96c8('0x4d')][_0x96c8('0x68')]=_0x37de32['id'];if(_0x2200e5[_0x96c8('0x44')][_0x96c8('0x4e')]){_0x40ee31[_0x96c8('0x4d')]=_[_0x96c8('0x50')](_0x40ee31['where'],{'$or':_[_0x96c8('0x41')](_0x40ee31[_0x96c8('0x47')],function(_0xc9ed22){var _0x7119a8={};_0x7119a8[_0xc9ed22]={'$like':'%'+_0x2200e5[_0x96c8('0x44')][_0x96c8('0x4e')]+'%'};return _0x7119a8;})});}_0x40ee31=_[_0x96c8('0x50')]({},_0x40ee31,_0x2200e5[_0x96c8('0x51')]);return db[_0x96c8('0x64')]['findAll'](_0x40ee31);}})['then'](function(_0x23edae){if(_0x23edae){return db[_0x96c8('0x69')][_0x96c8('0x6a')]({'where':{'id':_[_0x96c8('0x41')](_0x23edae,'UserId'),'role':'agent'},'attributes':['id',_0x96c8('0x3e'),'chatPause','updatedAt',_0x96c8('0x6b')]});}})[_0x96c8('0x22')](function(_0xa987c4){if(_0xa987c4){return{'count':_0xa987c4[_0x96c8('0x33')],'rows':_[_0x96c8('0x41')](_0xa987c4['rows'],function(_0x541c74){return{'membername':_0x541c74[_0x96c8('0x3e')],'UserId':_0x541c74['id'],'queue_name':_0xd25718[_0x96c8('0x3e')],'ChatQueueId':_0xd25718['id'],'interface':util[_0x96c8('0x6c')](_0x96c8('0x6d'),'SIP',_0x541c74[_0x96c8('0x3e')]),'penalty':0x0,'paused':_0x541c74[_0x96c8('0x6e')],'createdAt':_0x541c74[_0x96c8('0x6b')],'updatedAt':_0x541c74[_0x96c8('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x96c8('0x22')](respondWithFilteredResult(_0x46aa72,_0x40ee31))[_0x96c8('0x2c')](handleError(_0x46aa72,null));};exports[_0x96c8('0x70')]=function(_0xa0228e,_0x1b87cb,_0x24ed08){var _0x2c98c8={};var _0x4cddd6={};var _0x466258;var _0x4ce41d;return db['ChatQueue'][_0x96c8('0x63')]({'where':{'id':_0xa0228e[_0x96c8('0x61')]['id']}})[_0x96c8('0x22')](handleEntityNotFound(_0x1b87cb,null))['then'](function(_0x3f0a32){if(_0x3f0a32){_0x466258=_0x3f0a32;_0x4cddd6[_0x96c8('0x43')]=_['keys'](db['Team']['rawAttributes']);_0x4cddd6[_0x96c8('0x44')]=_[_0x96c8('0x45')](_0xa0228e[_0x96c8('0x44')]);_0x4cddd6[_0x96c8('0x46')]=_[_0x96c8('0x48')](_0x4cddd6[_0x96c8('0x43')],_0x4cddd6[_0x96c8('0x44')]);_0x2c98c8[_0x96c8('0x47')]=_[_0x96c8('0x48')](_0x4cddd6[_0x96c8('0x43')],qs[_0x96c8('0x49')](_0xa0228e[_0x96c8('0x44')][_0x96c8('0x49')]));_0x2c98c8[_0x96c8('0x47')]=_0x2c98c8[_0x96c8('0x47')]['length']?_0x2c98c8[_0x96c8('0x47')]:_0x4cddd6['model'];_0x2c98c8['order']=qs['sort'](_0xa0228e[_0x96c8('0x44')][_0x96c8('0x4c')]);_0x2c98c8['where']=qs[_0x96c8('0x46')](_[_0x96c8('0x67')](_0xa0228e[_0x96c8('0x44')],_0x4cddd6['filters']));if(_0xa0228e[_0x96c8('0x44')][_0x96c8('0x4e')]){_0x2c98c8[_0x96c8('0x4d')]=_[_0x96c8('0x50')](_0x2c98c8[_0x96c8('0x4d')],{'$or':_[_0x96c8('0x41')](_0x2c98c8['attributes'],function(_0x30d7a5){var _0x467f28={};_0x467f28[_0x30d7a5]={'$like':'%'+_0xa0228e[_0x96c8('0x44')]['filter']+'%'};return _0x467f28;})});}_0x2c98c8=_[_0x96c8('0x50')]({},_0x2c98c8,_0xa0228e['options']);return _0x466258[_0x96c8('0x70')](_0x2c98c8);}})[_0x96c8('0x22')](function(_0x4625a0){if(_0x4625a0){_0x4ce41d=_0x4625a0[_0x96c8('0x4a')];if(!_0xa0228e[_0x96c8('0x44')]['hasOwnProperty'](_0x96c8('0x65'))){_0x2c98c8[_0x96c8('0x32')]=qs['limit'](_0xa0228e[_0x96c8('0x44')][_0x96c8('0x32')]);_0x2c98c8[_0x96c8('0x34')]=qs[_0x96c8('0x34')](_0xa0228e[_0x96c8('0x44')][_0x96c8('0x34')]);}return _0x466258[_0x96c8('0x70')](_0x2c98c8);}})['then'](function(_0x2efae5){if(_0x2efae5){return _0x2efae5?{'count':_0x4ce41d,'rows':_0x2efae5}:null;}})[_0x96c8('0x22')](respondWithResult(_0x1b87cb,null))[_0x96c8('0x2c')](handleError(_0x1b87cb,null));};exports[_0x96c8('0x71')]=function(_0x278764,_0x382293,_0x5f3c93){var _0xf8624=_0x278764[_0x96c8('0x5b')]['ids'];return db[_0x96c8('0x72')][_0x96c8('0x54')]({'where':{'id':_0xf8624},'attributes':['id'],'include':[{'model':db[_0x96c8('0x69')],'as':_0x96c8('0x73'),'attributes':['id',_0x96c8('0x3e'),_0x96c8('0x74'),_0x96c8('0x75'),_0x96c8('0x76')],'raw':!![]}]})['then'](function(_0x1bc4d7){if(_0x1bc4d7){var _0x466693=_[_0x96c8('0x77')](_0x1bc4d7,function(_0x5ceb69){var _0x30523b=_0x5ceb69[_0x96c8('0x3b')]({'plain':!![]});return _0x30523b['Agents'];});return db[_0x96c8('0x52')]['find']({'where':{'id':_0x278764[_0x96c8('0x61')]['id']}})['then'](function(_0x497e44){return db[_0x96c8('0x78')][_0x96c8('0x79')](function(_0x214252){return _0x497e44[_0x96c8('0x71')](_0xf8624,{'transaction':_0x214252})['then'](function(){return BPromise[_0x96c8('0x7a')](_0x466693,function(_0x1c7f03){return db[_0x96c8('0x64')][_0x96c8('0x7b')]({'where':{'UserId':_0x1c7f03['id'],'ChatQueueId':_0x278764['params']['id']},'transaction':_0x214252});});})[_0x96c8('0x22')](function(){_0x466693[_0x96c8('0x7c')](function(_0x16070c){socket[_0x96c8('0x7d')](_0x96c8('0x7e'),{'UserId':_0x16070c['id'],'ChatQueueId':_0x497e44['id']});});});});});}})[_0x96c8('0x22')](respondWithStatusCode(_0x382293,null))[_0x96c8('0x2c')](handleError(_0x382293,null));};exports['removeTeams']=function(_0x35511c,_0x4e5d90,_0x223b2f){return db[_0x96c8('0x72')][_0x96c8('0x54')]({'where':{'id':_0x35511c[_0x96c8('0x44')][_0x96c8('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x96c8('0x73'),'attributes':['id'],'raw':!![]}]})[_0x96c8('0x22')](handleEntityNotFound(_0x4e5d90,null))[_0x96c8('0x22')](function(_0x4d55e9){var _0x92e9f9=_[_0x96c8('0x41')](_0x4d55e9,'id');var _0x5ba19b=[];var _0x190aa8=[];var _0x1ecd55=squel['select']();_0x1ecd55[_0x96c8('0x80')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0x96c8('0x81')](_0x96c8('0x82'),'ut',_0x96c8('0x83'))['where'](_0x96c8('0x84'),_0x35511c[_0x96c8('0x61')]['id']);for(var _0xc29b32=0x0;_0xc29b32<_0x4d55e9[_0x96c8('0x4a')];_0xc29b32+=0x1){let _0x135cfd=_0x4d55e9[_0xc29b32];for(var _0x13a031=0x0;_0x13a031<_0x135cfd[_0x96c8('0x73')][_0x96c8('0x4a')];_0x13a031+=0x1){let _0x29676b=_0x135cfd['Agents'][_0x13a031];var _0x2a3bac=_0x1ecd55[_0x96c8('0x85')]();_0x2a3bac[_0x96c8('0x4d')]('ut.UserId\x20=\x20?',_0x29676b['id']);_0x190aa8[_0x96c8('0x86')](db['sequelize'][_0x96c8('0x44')](_0x2a3bac[_0x96c8('0x87')](),{'type':db[_0x96c8('0x78')][_0x96c8('0x88')]['SELECT']})[_0x96c8('0x22')](function(_0xe1b42e){if(_0xe1b42e[_0x96c8('0x4a')]===0x1){return _0x29676b['id'];}else{var _0x1f97ce=_[_0x96c8('0x89')](_[_0x96c8('0x41')](_0xe1b42e,_0x96c8('0x8a')),function(_0x320079){return _[_0x96c8('0x8b')](_0x92e9f9,_0x320079);});if(_0x1f97ce){return _0x29676b['id'];}}}));}}return BPromise['all'](_0x190aa8)[_0x96c8('0x22')](function(_0x225db1){_0x5ba19b=_(_0x5ba19b)[_0x96c8('0x8c')](_0x225db1)[_0x96c8('0x8d')]()['value']();return db[_0x96c8('0x52')][_0x96c8('0x59')]({'where':{'id':_0x35511c[_0x96c8('0x61')]['id']}})[_0x96c8('0x22')](function(_0x108772){return db[_0x96c8('0x78')][_0x96c8('0x79')](function(_0x3cb6dc){return _0x108772[_0x96c8('0x8e')](_0x35511c[_0x96c8('0x44')]['ids'],{'transaction':_0x3cb6dc})[_0x96c8('0x22')](function(){if(!_[_0x96c8('0x8f')](_0x5ba19b)){return _0x108772[_0x96c8('0x90')](_0x5ba19b,{'transaction':_0x3cb6dc});}})[_0x96c8('0x22')](function(){_0x5ba19b['forEach'](function(_0x4e81c0){socket['emit'](_0x96c8('0x91'),{'UserId':_0x4e81c0,'ChatQueueId':_0x108772['id']});});});});});});})[_0x96c8('0x22')](respondWithStatusCode(_0x4e5d90,null))['catch'](handleError(_0x4e5d90,null));};exports['addAgents']=function(_0x4b3c9c,_0x1be153,_0xd5782c){return db[_0x96c8('0x52')][_0x96c8('0x59')]({'where':{'id':_0x4b3c9c['params']['id']}})[_0x96c8('0x22')](handleEntityNotFound(_0x1be153,null))[_0x96c8('0x22')](function(_0x2abcda){if(_0x2abcda){return _0x2abcda[_0x96c8('0x92')](_0x4b3c9c[_0x96c8('0x5b')][_0x96c8('0x7f')],_[_0x96c8('0x93')](_0x4b3c9c[_0x96c8('0x5b')],[_0x96c8('0x7f'),'id'])||{})[_0x96c8('0x94')](function(_0x586a34){for(var _0x231526=0x0;_0x231526<_0x4b3c9c[_0x96c8('0x5b')]['ids']['length'];_0x231526+=0x1){socket[_0x96c8('0x7d')](_0x96c8('0x7e'),{'UserId':Number(_0x4b3c9c['body'][_0x96c8('0x7f')][_0x231526]),'ChatQueueId':Number(_0x4b3c9c[_0x96c8('0x61')]['id'])});}return _0x586a34;});}})[_0x96c8('0x22')](respondWithResult(_0x1be153,null))[_0x96c8('0x2c')](handleError(_0x1be153,null));};exports[_0x96c8('0x90')]=function(_0x32822b,_0x3a7007,_0x53c687){return db[_0x96c8('0x52')][_0x96c8('0x59')]({'where':{'id':_0x32822b[_0x96c8('0x61')]['id']}})[_0x96c8('0x22')](handleEntityNotFound(_0x3a7007,null))['then'](function(_0x51065c){if(_0x51065c){return _0x51065c['removeAgents'](_0x32822b['query'][_0x96c8('0x7f')])[_0x96c8('0x22')](function(){if(_[_0x96c8('0x95')](_0x32822b[_0x96c8('0x44')][_0x96c8('0x7f')])){for(var _0x174190=0x0;_0x174190<_0x32822b[_0x96c8('0x44')][_0x96c8('0x7f')][_0x96c8('0x4a')];_0x174190+=0x1){socket[_0x96c8('0x7d')](_0x96c8('0x91'),{'UserId':Number(_0x32822b[_0x96c8('0x44')][_0x96c8('0x7f')][_0x174190]),'ChatQueueId':Number(_0x32822b[_0x96c8('0x61')]['id'])});}}else{socket['emit'](_0x96c8('0x91'),{'UserId':Number(_0x32822b[_0x96c8('0x44')][_0x96c8('0x7f')]),'ChatQueueId':Number(_0x32822b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3a7007,null))[_0x96c8('0x2c')](handleError(_0x3a7007,null));};exports['getAgents']=function(_0xa6f973,_0x167f0a,_0x2f36be){var _0x4981d4={};var _0x4e88bd={};var _0x174c14;var _0x2ebfea;return db[_0x96c8('0x52')][_0x96c8('0x63')]({'where':{'id':_0xa6f973[_0x96c8('0x61')]['id']}})[_0x96c8('0x22')](handleEntityNotFound(_0x167f0a,null))[_0x96c8('0x22')](function(_0x18f778){if(_0x18f778){_0x174c14=_0x18f778;_0x4e88bd['model']=_['keys'](db[_0x96c8('0x69')]['rawAttributes']);_0x4e88bd['query']=_['keys'](_0xa6f973[_0x96c8('0x44')]);_0x4e88bd[_0x96c8('0x46')]=_[_0x96c8('0x48')](_0x4e88bd[_0x96c8('0x43')],_0x4e88bd[_0x96c8('0x44')]);_0x4981d4[_0x96c8('0x47')]=_[_0x96c8('0x48')](_0x4e88bd[_0x96c8('0x43')],qs[_0x96c8('0x49')](_0xa6f973['query'][_0x96c8('0x49')]));_0x4981d4[_0x96c8('0x47')]=_0x4981d4[_0x96c8('0x47')][_0x96c8('0x4a')]?_0x4981d4[_0x96c8('0x47')]:_0x4e88bd[_0x96c8('0x43')];_0x4981d4['order']=qs[_0x96c8('0x4c')](_0xa6f973['query'][_0x96c8('0x4c')]);_0x4981d4['where']=qs[_0x96c8('0x46')](_[_0x96c8('0x67')](_0xa6f973[_0x96c8('0x44')],_0x4e88bd[_0x96c8('0x46')]));if(_0xa6f973[_0x96c8('0x44')][_0x96c8('0x4e')]){_0x4981d4[_0x96c8('0x4d')]=_['merge'](_0x4981d4['where'],{'$or':_[_0x96c8('0x41')](_0x4981d4['attributes'],function(_0x49b9f1){var _0x108287={};_0x108287[_0x49b9f1]={'$like':'%'+_0xa6f973[_0x96c8('0x44')][_0x96c8('0x4e')]+'%'};return _0x108287;})});}_0x4981d4=_[_0x96c8('0x50')]({},_0x4981d4,_0xa6f973['options']);return _0x174c14['getAgents'](_0x4981d4);}})['then'](function(_0x116000){if(_0x116000){_0x2ebfea=_0x116000[_0x96c8('0x4a')];if(!_0xa6f973[_0x96c8('0x44')][_0x96c8('0x4b')](_0x96c8('0x65'))){_0x4981d4[_0x96c8('0x32')]=qs[_0x96c8('0x32')](_0xa6f973['query'][_0x96c8('0x32')]);_0x4981d4[_0x96c8('0x34')]=qs[_0x96c8('0x34')](_0xa6f973['query'][_0x96c8('0x34')]);}return _0x174c14[_0x96c8('0x96')](_0x4981d4);}})[_0x96c8('0x22')](function(_0x59251a){if(_0x59251a){return _0x59251a?{'count':_0x2ebfea,'rows':_0x59251a}:null;}})['then'](respondWithResult(_0x167f0a,null))[_0x96c8('0x2c')](handleError(_0x167f0a,null));}; \ No newline at end of file +var _0x8c44=['intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','UserId','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','findOne','Team','voicePause','flatMap','Agents','findOrCreate','forEach','userChatQueue:save','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','removeTeams','ids','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','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','catch','sendStatus','status','undefined','limit','count','offset','set','json','apply','save','update','destroy','ChatQueues','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','filters'];(function(_0x3ae1a9,_0x3f6243){var _0x36b7e4=function(_0x5b1fea){while(--_0x5b1fea){_0x3ae1a9['push'](_0x3ae1a9['shift']());}};_0x36b7e4(++_0x3f6243);}(_0x8c44,0x181));var _0x48c4=function(_0x1c4c24,_0x154c79){_0x1c4c24=_0x1c4c24-0x0;var _0x1c033d=_0x8c44[_0x1c4c24];return _0x1c033d;};'use strict';var emlformat=require(_0x48c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48c4('0x1'));var jsonpatch=require(_0x48c4('0x2'));var rp=require(_0x48c4('0x3'));var moment=require(_0x48c4('0x4'));var BPromise=require(_0x48c4('0x5'));var Mustache=require('mustache');var util=require(_0x48c4('0x6'));var path=require(_0x48c4('0x7'));var sox=require('sox');var csv=require(_0x48c4('0x8'));var ejs=require(_0x48c4('0x9'));var fs=require('fs');var fs_extra=require(_0x48c4('0xa'));var _=require('lodash');var squel=require(_0x48c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x48c4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x48c4('0x8'));var querystring=require(_0x48c4('0xd'));var Papa=require(_0x48c4('0xe'));var Redis=require(_0x48c4('0xf'));var authService=require(_0x48c4('0x10'));var qs=require(_0x48c4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48c4('0x12'));var logger=require(_0x48c4('0x13'))('api');var utils=require(_0x48c4('0x14'));var config=require(_0x48c4('0x15'));var licenseUtil=require(_0x48c4('0x16'));var db=require(_0x48c4('0x17'))['db'];config[_0x48c4('0x18')]=_['defaults'](config[_0x48c4('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x48c4('0x19'))(new Redis(config[_0x48c4('0x18')]));require(_0x48c4('0x1a'))[_0x48c4('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ef0a1,_0x2c6f07,_0x438a4d,_0x159a47){return new BPromise(function(_0x66e18,_0x35ab17){var _0x314749=_0x159a47||client;return _0x314749[_0x48c4('0x1c')](_0x3ef0a1,_0x438a4d)[_0x48c4('0x1d')](function(_0x20c00e){logger[_0x48c4('0x1e')](_0x48c4('0x1f'),_0x2c6f07,_0x48c4('0x20'));logger[_0x48c4('0x21')](_0x48c4('0x22'),_0x2c6f07,'request\x20sent',JSON[_0x48c4('0x23')](_0x20c00e));if(_0x20c00e[_0x48c4('0x24')]){if(_0x20c00e[_0x48c4('0x24')][_0x48c4('0x25')]===0x1f4){logger[_0x48c4('0x24')](_0x48c4('0x1f'),_0x2c6f07,_0x20c00e[_0x48c4('0x24')][_0x48c4('0x26')]);return _0x35ab17(_0x20c00e['error'][_0x48c4('0x26')]);}logger[_0x48c4('0x24')](_0x48c4('0x1f'),_0x2c6f07,_0x20c00e[_0x48c4('0x24')][_0x48c4('0x26')]);return _0x66e18(_0x20c00e['error'][_0x48c4('0x26')]);}else{logger[_0x48c4('0x1e')](_0x48c4('0x1f'),_0x2c6f07,_0x48c4('0x20'));_0x66e18(_0x20c00e[_0x48c4('0x27')][_0x48c4('0x26')]);}})[_0x48c4('0x28')](function(_0xe0f7bf){logger[_0x48c4('0x24')](_0x48c4('0x1f'),_0x2c6f07,_0xe0f7bf);_0x35ab17(_0xe0f7bf);});});}function respondWithStatusCode(_0x5be19f,_0x201b21){_0x201b21=_0x201b21||0xcc;return function(_0x5f5c52){if(_0x5f5c52){return _0x5be19f[_0x48c4('0x29')](_0x201b21);}return _0x5be19f[_0x48c4('0x2a')](_0x201b21)['end']();};}function respondWithResult(_0x5caa93,_0x3361cf){_0x3361cf=_0x3361cf||0xc8;return function(_0x2b2b60){if(_0x2b2b60){return _0x5caa93['status'](_0x3361cf)['json'](_0x2b2b60);}};}function respondWithFilteredResult(_0x19b336,_0x288674){return function(_0x2db1bc){if(_0x2db1bc){var _0x163f8c=typeof _0x288674['offset']===_0x48c4('0x2b')&&typeof _0x288674[_0x48c4('0x2c')]===_0x48c4('0x2b');var _0x1c3751=_0x2db1bc[_0x48c4('0x2d')];var _0x11ab2f=_0x163f8c?0x0:_0x288674[_0x48c4('0x2e')];var _0x37fdfd=_0x163f8c?_0x2db1bc['count']:_0x288674[_0x48c4('0x2e')]+_0x288674[_0x48c4('0x2c')];var _0x3db340;if(_0x37fdfd>=_0x1c3751){_0x37fdfd=_0x1c3751;_0x3db340=0xc8;}else{_0x3db340=0xce;}_0x19b336[_0x48c4('0x2a')](_0x3db340);return _0x19b336[_0x48c4('0x2f')]('Content-Range',_0x11ab2f+'-'+_0x37fdfd+'/'+_0x1c3751)[_0x48c4('0x30')](_0x2db1bc);}return null;};}function patchUpdates(_0x2e1077){return function(_0xaef6e2){try{jsonpatch[_0x48c4('0x31')](_0xaef6e2,_0x2e1077,!![]);}catch(_0x1d8f1c){return BPromise['reject'](_0x1d8f1c);}return _0xaef6e2[_0x48c4('0x32')]();};}function saveUpdates(_0x4db7eb,_0x11e48b){return function(_0x5b3ef2){if(_0x5b3ef2){return _0x5b3ef2[_0x48c4('0x33')](_0x4db7eb)[_0x48c4('0x1d')](function(_0x1a8259){return _0x1a8259;});}return null;};}function removeEntity(_0x3e4022,_0x1f8d8d){return function(_0x4539f6){if(_0x4539f6){return _0x4539f6[_0x48c4('0x34')]()['then'](function(){var _0x2e1005=_0x4539f6['get']({'plain':!![]});var _0x29d9ab=_0x48c4('0x35');return db['UserProfileResource'][_0x48c4('0x34')]({'where':{'type':_0x29d9ab,'resourceId':_0x2e1005['id']}})[_0x48c4('0x1d')](function(){return _0x4539f6;});})[_0x48c4('0x1d')](function(){_0x3e4022[_0x48c4('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x521f46,_0x19e329){return function(_0x314faa){if(!_0x314faa){_0x521f46[_0x48c4('0x29')](0x194);}return _0x314faa;};}function handleError(_0x59c2b5,_0x5f41aa){_0x5f41aa=_0x5f41aa||0x1f4;return function(_0xc99a0e){logger[_0x48c4('0x24')](_0xc99a0e['stack']);if(_0xc99a0e['name']){delete _0xc99a0e[_0x48c4('0x36')];}_0x59c2b5[_0x48c4('0x2a')](_0x5f41aa)[_0x48c4('0x37')](_0xc99a0e);};}exports['index']=function(_0x39484c,_0x431474){var _0x1a8b6f={},_0x38076d={},_0x2272f9={'count':0x0,'rows':[]};var _0x458a26=_[_0x48c4('0x38')](db[_0x48c4('0x39')][_0x48c4('0x3a')],function(_0x1f5d06){return{'name':_0x1f5d06[_0x48c4('0x3b')],'type':_0x1f5d06[_0x48c4('0x3c')][_0x48c4('0x3d')]};});_0x38076d[_0x48c4('0x3e')]=_[_0x48c4('0x38')](_0x458a26,'name');_0x38076d['query']=_[_0x48c4('0x3f')](_0x39484c['query']);_0x38076d[_0x48c4('0x40')]=_[_0x48c4('0x41')](_0x38076d['model'],_0x38076d[_0x48c4('0x42')]);_0x1a8b6f[_0x48c4('0x43')]=_['intersection'](_0x38076d['model'],qs[_0x48c4('0x44')](_0x39484c[_0x48c4('0x42')][_0x48c4('0x44')]));_0x1a8b6f['attributes']=_0x1a8b6f[_0x48c4('0x43')][_0x48c4('0x45')]?_0x1a8b6f[_0x48c4('0x43')]:_0x38076d[_0x48c4('0x3e')];if(!_0x39484c[_0x48c4('0x42')][_0x48c4('0x46')](_0x48c4('0x47'))){_0x1a8b6f[_0x48c4('0x2c')]=qs['limit'](_0x39484c['query']['limit']);_0x1a8b6f['offset']=qs['offset'](_0x39484c['query']['offset']);}_0x1a8b6f[_0x48c4('0x48')]=qs['sort'](_0x39484c[_0x48c4('0x42')][_0x48c4('0x49')]);_0x1a8b6f[_0x48c4('0x4a')]=qs['filters'](_[_0x48c4('0x4b')](_0x39484c['query'],_0x38076d[_0x48c4('0x40')]),_0x458a26);if(_0x39484c[_0x48c4('0x42')]['filter']){_0x1a8b6f[_0x48c4('0x4a')]=_[_0x48c4('0x4c')](_0x1a8b6f[_0x48c4('0x4a')],{'$or':_[_0x48c4('0x38')](_0x458a26,function(_0xb1d911){if(_0xb1d911[_0x48c4('0x3c')]!==_0x48c4('0x4d')){var _0xf94fe6={};_0xf94fe6[_0xb1d911[_0x48c4('0x36')]]={'$like':'%'+_0x39484c[_0x48c4('0x42')][_0x48c4('0x4e')]+'%'};return _0xf94fe6;}})});}_0x1a8b6f=_[_0x48c4('0x4c')]({},_0x1a8b6f,_0x39484c[_0x48c4('0x4f')]);var _0x35ad61={'where':_0x1a8b6f[_0x48c4('0x4a')]};return db[_0x48c4('0x39')][_0x48c4('0x2d')](_0x35ad61)[_0x48c4('0x1d')](function(_0x3f97fc){_0x2272f9[_0x48c4('0x2d')]=_0x3f97fc;if(_0x39484c[_0x48c4('0x42')][_0x48c4('0x50')]){_0x1a8b6f[_0x48c4('0x51')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x1a8b6f);})[_0x48c4('0x1d')](function(_0x4270f5){_0x2272f9[_0x48c4('0x52')]=_0x4270f5;return _0x2272f9;})[_0x48c4('0x1d')](respondWithFilteredResult(_0x431474,_0x1a8b6f))[_0x48c4('0x28')](handleError(_0x431474,null));};exports['show']=function(_0xe47a5a,_0x4a7c28){var _0x361b84={'raw':!![],'where':{'id':_0xe47a5a[_0x48c4('0x53')]['id']}},_0xbf4d00={};_0xbf4d00[_0x48c4('0x3e')]=_[_0x48c4('0x3f')](db['ChatQueue'][_0x48c4('0x3a')]);_0xbf4d00[_0x48c4('0x42')]=_[_0x48c4('0x3f')](_0xe47a5a[_0x48c4('0x42')]);_0xbf4d00[_0x48c4('0x40')]=_[_0x48c4('0x41')](_0xbf4d00[_0x48c4('0x3e')],_0xbf4d00['query']);_0x361b84[_0x48c4('0x43')]=_[_0x48c4('0x41')](_0xbf4d00[_0x48c4('0x3e')],qs['fields'](_0xe47a5a[_0x48c4('0x42')][_0x48c4('0x44')]));_0x361b84['attributes']=_0x361b84[_0x48c4('0x43')][_0x48c4('0x45')]?_0x361b84[_0x48c4('0x43')]:_0xbf4d00[_0x48c4('0x3e')];if(_0xe47a5a[_0x48c4('0x42')][_0x48c4('0x50')]){_0x361b84[_0x48c4('0x51')]=[{'all':!![]}];}_0x361b84=_['merge']({},_0x361b84,_0xe47a5a[_0x48c4('0x4f')]);return db[_0x48c4('0x39')][_0x48c4('0x54')](_0x361b84)[_0x48c4('0x1d')](handleEntityNotFound(_0x4a7c28,null))[_0x48c4('0x1d')](respondWithResult(_0x4a7c28,null))[_0x48c4('0x28')](handleError(_0x4a7c28,null));};exports['create']=function(_0x53dc36,_0xc2ba28){return db[_0x48c4('0x39')][_0x48c4('0x55')](_0x53dc36[_0x48c4('0x56')],{})[_0x48c4('0x1d')](function(_0x23faa9){var _0x4cccc0=_0x53dc36[_0x48c4('0x57')][_0x48c4('0x58')]({'plain':!![]});if(!_0x4cccc0)throw new Error(_0x48c4('0x59'));if(_0x4cccc0[_0x48c4('0x5a')]===_0x48c4('0x57')){var _0x1642c1=_0x23faa9[_0x48c4('0x58')]({'plain':!![]});var _0x1ce01c=_0x48c4('0x35');return db[_0x48c4('0x5b')][_0x48c4('0x54')]({'where':{'name':_0x1ce01c,'userProfileId':_0x4cccc0[_0x48c4('0x5c')]},'raw':!![]})['then'](function(_0x16401a){if(_0x16401a&&_0x16401a[_0x48c4('0x5d')]===0x0){return db[_0x48c4('0x5e')][_0x48c4('0x55')]({'name':_0x1642c1[_0x48c4('0x36')],'resourceId':_0x1642c1['id'],'type':_0x16401a[_0x48c4('0x36')],'sectionId':_0x16401a['id']},{})[_0x48c4('0x1d')](function(){return _0x23faa9;});}else{return _0x23faa9;}})['catch'](function(_0x166101){logger[_0x48c4('0x24')](_0x48c4('0x5f'),_0x166101);throw _0x166101;});}return _0x23faa9;})[_0x48c4('0x1d')](respondWithResult(_0xc2ba28,0xc9))[_0x48c4('0x28')](handleError(_0xc2ba28,null));};exports[_0x48c4('0x33')]=function(_0x78aecd,_0x5576fd){if(_0x78aecd[_0x48c4('0x56')]['id']){delete _0x78aecd[_0x48c4('0x56')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x78aecd[_0x48c4('0x53')]['id']}})[_0x48c4('0x1d')](handleEntityNotFound(_0x5576fd,null))['then'](saveUpdates(_0x78aecd[_0x48c4('0x56')],null))[_0x48c4('0x1d')](respondWithResult(_0x5576fd,null))[_0x48c4('0x28')](handleError(_0x5576fd,null));};exports['destroy']=function(_0x51528a,_0x16ff87){return db['ChatQueue'][_0x48c4('0x54')]({'where':{'id':_0x51528a[_0x48c4('0x53')]['id']}})[_0x48c4('0x1d')](handleEntityNotFound(_0x16ff87,null))['then'](removeEntity(_0x16ff87,null))['catch'](handleError(_0x16ff87,null));};exports[_0x48c4('0x60')]=function(_0x544ca9,_0xd12bd5){return db[_0x48c4('0x39')][_0x48c4('0x60')]()[_0x48c4('0x1d')](respondWithResult(_0xd12bd5,null))['catch'](handleError(_0xd12bd5,null));};exports['getMembers']=function(_0x5e2165,_0x177d82,_0x55bee6){var _0x9976f8={'raw':!![],'where':{}},_0x44a486={},_0x179270;return db[_0x48c4('0x39')]['findOne']({'where':{'id':_0x5e2165[_0x48c4('0x53')]['id']}})[_0x48c4('0x1d')](handleEntityNotFound(_0x177d82,null))[_0x48c4('0x1d')](function(_0x64aace){if(_0x64aace){_0x179270=_0x64aace[_0x48c4('0x58')]({'plain':!![]});_0x44a486['model']=_[_0x48c4('0x3f')](db[_0x48c4('0x61')][_0x48c4('0x3a')]);_0x44a486['query']=_[_0x48c4('0x3f')](_0x5e2165[_0x48c4('0x42')]);_0x44a486[_0x48c4('0x40')]=_[_0x48c4('0x41')](_0x44a486['model'],_0x44a486[_0x48c4('0x42')]);_0x9976f8[_0x48c4('0x43')]=_['intersection'](_0x44a486[_0x48c4('0x3e')],qs['fields'](_0x5e2165[_0x48c4('0x42')][_0x48c4('0x44')]));_0x9976f8['attributes']=_0x9976f8[_0x48c4('0x43')]['length']?_0x9976f8[_0x48c4('0x43')]:_0x44a486[_0x48c4('0x3e')];if(!_0x5e2165[_0x48c4('0x42')][_0x48c4('0x46')](_0x48c4('0x47'))){_0x9976f8[_0x48c4('0x2c')]=qs['limit'](_0x5e2165[_0x48c4('0x42')][_0x48c4('0x2c')]);_0x9976f8[_0x48c4('0x2e')]=qs[_0x48c4('0x2e')](_0x5e2165[_0x48c4('0x42')]['offset']);}_0x9976f8[_0x48c4('0x48')]=qs[_0x48c4('0x49')](_0x5e2165['query'][_0x48c4('0x49')]);_0x9976f8[_0x48c4('0x4a')]=qs[_0x48c4('0x40')](_[_0x48c4('0x4b')](_0x5e2165['query'],_0x44a486[_0x48c4('0x40')]));_0x9976f8[_0x48c4('0x4a')][_0x48c4('0x62')]=_0x64aace['id'];if(_0x5e2165[_0x48c4('0x42')][_0x48c4('0x4e')]){_0x9976f8['where']=_['merge'](_0x9976f8[_0x48c4('0x4a')],{'$or':_[_0x48c4('0x38')](_0x9976f8[_0x48c4('0x43')],function(_0x43e34a){var _0x48dd80={};_0x48dd80[_0x43e34a]={'$like':'%'+_0x5e2165['query'][_0x48c4('0x4e')]+'%'};return _0x48dd80;})});}_0x9976f8=_[_0x48c4('0x4c')]({},_0x9976f8,_0x5e2165[_0x48c4('0x4f')]);return db['UserChatQueue'][_0x48c4('0x63')](_0x9976f8);}})[_0x48c4('0x1d')](function(_0xe74d48){if(_0xe74d48){return db[_0x48c4('0x64')][_0x48c4('0x65')]({'where':{'id':_[_0x48c4('0x38')](_0xe74d48,_0x48c4('0x66')),'role':'agent'},'attributes':['id',_0x48c4('0x36'),_0x48c4('0x67'),'updatedAt',_0x48c4('0x68')]});}})[_0x48c4('0x1d')](function(_0x15a6ae){if(_0x15a6ae){return{'count':_0x15a6ae[_0x48c4('0x2d')],'rows':_[_0x48c4('0x38')](_0x15a6ae[_0x48c4('0x52')],function(_0x5170b4){return{'membername':_0x5170b4['name'],'UserId':_0x5170b4['id'],'queue_name':_0x179270['name'],'ChatQueueId':_0x179270['id'],'interface':util['format'](_0x48c4('0x69'),_0x48c4('0x6a'),_0x5170b4[_0x48c4('0x36')]),'penalty':0x0,'paused':_0x5170b4['chatPause'],'createdAt':_0x5170b4['createdAt'],'updatedAt':_0x5170b4[_0x48c4('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x48c4('0x1d')](respondWithFilteredResult(_0x177d82,_0x9976f8))[_0x48c4('0x28')](handleError(_0x177d82,null));};exports[_0x48c4('0x6c')]=function(_0x29bcff,_0x3c574d,_0x1a3d02){var _0x41a366={};var _0x41dea2={};var _0xde7c17;var _0x2b5e83;return db[_0x48c4('0x39')][_0x48c4('0x6d')]({'where':{'id':_0x29bcff[_0x48c4('0x53')]['id']}})[_0x48c4('0x1d')](handleEntityNotFound(_0x3c574d,null))['then'](function(_0x4d58d8){if(_0x4d58d8){_0xde7c17=_0x4d58d8;_0x41dea2[_0x48c4('0x3e')]=_[_0x48c4('0x3f')](db[_0x48c4('0x6e')][_0x48c4('0x3a')]);_0x41dea2[_0x48c4('0x42')]=_[_0x48c4('0x3f')](_0x29bcff['query']);_0x41dea2[_0x48c4('0x40')]=_[_0x48c4('0x41')](_0x41dea2[_0x48c4('0x3e')],_0x41dea2[_0x48c4('0x42')]);_0x41a366[_0x48c4('0x43')]=_[_0x48c4('0x41')](_0x41dea2[_0x48c4('0x3e')],qs['fields'](_0x29bcff[_0x48c4('0x42')][_0x48c4('0x44')]));_0x41a366[_0x48c4('0x43')]=_0x41a366[_0x48c4('0x43')][_0x48c4('0x45')]?_0x41a366[_0x48c4('0x43')]:_0x41dea2[_0x48c4('0x3e')];_0x41a366[_0x48c4('0x48')]=qs['sort'](_0x29bcff[_0x48c4('0x42')]['sort']);_0x41a366[_0x48c4('0x4a')]=qs[_0x48c4('0x40')](_['pick'](_0x29bcff[_0x48c4('0x42')],_0x41dea2[_0x48c4('0x40')]));if(_0x29bcff[_0x48c4('0x42')][_0x48c4('0x4e')]){_0x41a366[_0x48c4('0x4a')]=_[_0x48c4('0x4c')](_0x41a366[_0x48c4('0x4a')],{'$or':_[_0x48c4('0x38')](_0x41a366[_0x48c4('0x43')],function(_0x2526ae){var _0x150cd3={};_0x150cd3[_0x2526ae]={'$like':'%'+_0x29bcff['query'][_0x48c4('0x4e')]+'%'};return _0x150cd3;})});}_0x41a366=_[_0x48c4('0x4c')]({},_0x41a366,_0x29bcff['options']);return _0xde7c17[_0x48c4('0x6c')](_0x41a366);}})[_0x48c4('0x1d')](function(_0x41685a){if(_0x41685a){_0x2b5e83=_0x41685a[_0x48c4('0x45')];if(!_0x29bcff['query'][_0x48c4('0x46')](_0x48c4('0x47'))){_0x41a366[_0x48c4('0x2c')]=qs[_0x48c4('0x2c')](_0x29bcff[_0x48c4('0x42')]['limit']);_0x41a366[_0x48c4('0x2e')]=qs[_0x48c4('0x2e')](_0x29bcff[_0x48c4('0x42')]['offset']);}return _0xde7c17[_0x48c4('0x6c')](_0x41a366);}})[_0x48c4('0x1d')](function(_0x52cbda){if(_0x52cbda){return _0x52cbda?{'count':_0x2b5e83,'rows':_0x52cbda}:null;}})['then'](respondWithResult(_0x3c574d,null))[_0x48c4('0x28')](handleError(_0x3c574d,null));};exports['addTeams']=function(_0x3c5134,_0x57035e,_0x3c867c){var _0x35a80b=_0x3c5134[_0x48c4('0x56')]['ids'];return db['Team'][_0x48c4('0x63')]({'where':{'id':_0x35a80b},'attributes':['id'],'include':[{'model':db[_0x48c4('0x64')],'as':'Agents','attributes':['id','name','online',_0x48c4('0x6f'),'interface'],'raw':!![]}]})[_0x48c4('0x1d')](function(_0x11ac54){if(_0x11ac54){var _0x5b2cc5=_[_0x48c4('0x70')](_0x11ac54,function(_0x4099f2){var _0x9118ec=_0x4099f2[_0x48c4('0x58')]({'plain':!![]});return _0x9118ec[_0x48c4('0x71')];});return db['ChatQueue'][_0x48c4('0x54')]({'where':{'id':_0x3c5134[_0x48c4('0x53')]['id']}})[_0x48c4('0x1d')](function(_0x177502){return db['sequelize']['transaction'](function(_0x338b3c){return _0x177502['addTeams'](_0x35a80b,{'transaction':_0x338b3c})[_0x48c4('0x1d')](function(){return BPromise['each'](_0x5b2cc5,function(_0x2ed0c6){return db['UserChatQueue'][_0x48c4('0x72')]({'where':{'UserId':_0x2ed0c6['id'],'ChatQueueId':_0x3c5134[_0x48c4('0x53')]['id']},'transaction':_0x338b3c});});})[_0x48c4('0x1d')](function(){_0x5b2cc5[_0x48c4('0x73')](function(_0x235ea8){socket['emit'](_0x48c4('0x74'),{'UserId':_0x235ea8['id'],'ChatQueueId':_0x177502['id']});});});});});}})[_0x48c4('0x1d')](respondWithStatusCode(_0x57035e,null))[_0x48c4('0x28')](handleError(_0x57035e,null));};exports['removeTeams']=function(_0x19b491,_0x806947,_0x26f72d){return db[_0x48c4('0x6e')][_0x48c4('0x63')]({'where':{'id':_0x19b491[_0x48c4('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x48c4('0x64')],'as':_0x48c4('0x71'),'attributes':['id'],'raw':!![]}]})[_0x48c4('0x1d')](handleEntityNotFound(_0x806947,null))[_0x48c4('0x1d')](function(_0xe3f3e9){var _0x2ecce3=_[_0x48c4('0x38')](_0xe3f3e9,'id');var _0x452e54=[];var _0x315b65=[];var _0x47080f=squel[_0x48c4('0x75')]();_0x47080f[_0x48c4('0x76')]('tq.TeamId')[_0x48c4('0x77')](_0x48c4('0x78'),'tq')[_0x48c4('0x79')](_0x48c4('0x7a'),'ut',_0x48c4('0x7b'))[_0x48c4('0x4a')](_0x48c4('0x7c'),_0x19b491[_0x48c4('0x53')]['id']);for(var _0x360c06=0x0;_0x360c06<_0xe3f3e9[_0x48c4('0x45')];_0x360c06+=0x1){let _0x2682dc=_0xe3f3e9[_0x360c06];for(var _0x2964ac=0x0;_0x2964ac<_0x2682dc[_0x48c4('0x71')][_0x48c4('0x45')];_0x2964ac+=0x1){let _0x13651d=_0x2682dc['Agents'][_0x2964ac];var _0x19328b=_0x47080f[_0x48c4('0x7d')]();_0x19328b[_0x48c4('0x4a')](_0x48c4('0x7e'),_0x13651d['id']);_0x315b65[_0x48c4('0x7f')](db[_0x48c4('0x80')]['query'](_0x19328b[_0x48c4('0x81')](),{'type':db[_0x48c4('0x80')][_0x48c4('0x82')][_0x48c4('0x83')]})[_0x48c4('0x1d')](function(_0x586643){if(_0x586643[_0x48c4('0x45')]===0x1){return _0x13651d['id'];}else{var _0xcee81=_[_0x48c4('0x84')](_['map'](_0x586643,_0x48c4('0x85')),function(_0x1a69d9){return _['includes'](_0x2ecce3,_0x1a69d9);});if(_0xcee81){return _0x13651d['id'];}}}));}}return BPromise[_0x48c4('0x86')](_0x315b65)[_0x48c4('0x1d')](function(_0x3cbf24){_0x452e54=_(_0x452e54)[_0x48c4('0x87')](_0x3cbf24)[_0x48c4('0x88')]()[_0x48c4('0x89')]();return db[_0x48c4('0x39')][_0x48c4('0x54')]({'where':{'id':_0x19b491['params']['id']}})[_0x48c4('0x1d')](function(_0x43e322){return db['sequelize'][_0x48c4('0x8a')](function(_0x1b54f2){return _0x43e322[_0x48c4('0x8b')](_0x19b491[_0x48c4('0x42')][_0x48c4('0x8c')],{'transaction':_0x1b54f2})['then'](function(){if(!_[_0x48c4('0x8d')](_0x452e54)){return _0x43e322[_0x48c4('0x8e')](_0x452e54,{'transaction':_0x1b54f2});}})['then'](function(){_0x452e54['forEach'](function(_0x19858a){socket[_0x48c4('0x8f')]('userChatQueue:remove',{'UserId':_0x19858a,'ChatQueueId':_0x43e322['id']});});});});});});})[_0x48c4('0x1d')](respondWithStatusCode(_0x806947,null))[_0x48c4('0x28')](handleError(_0x806947,null));};exports[_0x48c4('0x90')]=function(_0x436e2b,_0x46bba0,_0x3cbfa6){return db[_0x48c4('0x39')]['find']({'where':{'id':_0x436e2b[_0x48c4('0x53')]['id']}})[_0x48c4('0x1d')](handleEntityNotFound(_0x46bba0,null))[_0x48c4('0x1d')](function(_0xb48eb4){if(_0xb48eb4){return _0xb48eb4[_0x48c4('0x90')](_0x436e2b[_0x48c4('0x56')][_0x48c4('0x8c')],_[_0x48c4('0x91')](_0x436e2b[_0x48c4('0x56')],[_0x48c4('0x8c'),'id'])||{})[_0x48c4('0x92')](function(_0x2942b6){for(var _0x244f1d=0x0;_0x244f1d<_0x436e2b[_0x48c4('0x56')]['ids'][_0x48c4('0x45')];_0x244f1d+=0x1){socket[_0x48c4('0x8f')]('userChatQueue:save',{'UserId':Number(_0x436e2b['body']['ids'][_0x244f1d]),'ChatQueueId':Number(_0x436e2b[_0x48c4('0x53')]['id'])});}return _0x2942b6;});}})[_0x48c4('0x1d')](respondWithResult(_0x46bba0,null))[_0x48c4('0x28')](handleError(_0x46bba0,null));};exports[_0x48c4('0x8e')]=function(_0x1e4911,_0x85e7a8,_0x54fbc2){return db['ChatQueue'][_0x48c4('0x54')]({'where':{'id':_0x1e4911[_0x48c4('0x53')]['id']}})[_0x48c4('0x1d')](handleEntityNotFound(_0x85e7a8,null))[_0x48c4('0x1d')](function(_0x6f106a){if(_0x6f106a){return _0x6f106a['removeAgents'](_0x1e4911['query'][_0x48c4('0x8c')])[_0x48c4('0x1d')](function(){if(_[_0x48c4('0x93')](_0x1e4911[_0x48c4('0x42')][_0x48c4('0x8c')])){for(var _0x13f423=0x0;_0x13f423<_0x1e4911['query'][_0x48c4('0x8c')][_0x48c4('0x45')];_0x13f423+=0x1){socket[_0x48c4('0x8f')](_0x48c4('0x94'),{'UserId':Number(_0x1e4911[_0x48c4('0x42')][_0x48c4('0x8c')][_0x13f423]),'ChatQueueId':Number(_0x1e4911[_0x48c4('0x53')]['id'])});}}else{socket[_0x48c4('0x8f')]('userChatQueue:remove',{'UserId':Number(_0x1e4911['query'][_0x48c4('0x8c')]),'ChatQueueId':Number(_0x1e4911[_0x48c4('0x53')]['id'])});}});}})[_0x48c4('0x1d')](respondWithStatusCode(_0x85e7a8,null))[_0x48c4('0x28')](handleError(_0x85e7a8,null));};exports[_0x48c4('0x95')]=function(_0x5a25e2,_0x58ba0f,_0x68e926){var _0x1ce456={};var _0x464bfe={};var _0x1a3f45;var _0x6f0188;return db['ChatQueue']['findOne']({'where':{'id':_0x5a25e2[_0x48c4('0x53')]['id']}})[_0x48c4('0x1d')](handleEntityNotFound(_0x58ba0f,null))[_0x48c4('0x1d')](function(_0x124a1d){if(_0x124a1d){_0x1a3f45=_0x124a1d;_0x464bfe[_0x48c4('0x3e')]=_[_0x48c4('0x3f')](db[_0x48c4('0x64')][_0x48c4('0x3a')]);_0x464bfe[_0x48c4('0x42')]=_[_0x48c4('0x3f')](_0x5a25e2[_0x48c4('0x42')]);_0x464bfe['filters']=_[_0x48c4('0x41')](_0x464bfe[_0x48c4('0x3e')],_0x464bfe['query']);_0x1ce456['attributes']=_['intersection'](_0x464bfe[_0x48c4('0x3e')],qs['fields'](_0x5a25e2[_0x48c4('0x42')][_0x48c4('0x44')]));_0x1ce456[_0x48c4('0x43')]=_0x1ce456[_0x48c4('0x43')][_0x48c4('0x45')]?_0x1ce456[_0x48c4('0x43')]:_0x464bfe[_0x48c4('0x3e')];_0x1ce456[_0x48c4('0x48')]=qs[_0x48c4('0x49')](_0x5a25e2[_0x48c4('0x42')][_0x48c4('0x49')]);_0x1ce456[_0x48c4('0x4a')]=qs[_0x48c4('0x40')](_[_0x48c4('0x4b')](_0x5a25e2[_0x48c4('0x42')],_0x464bfe['filters']));if(_0x5a25e2[_0x48c4('0x42')][_0x48c4('0x4e')]){_0x1ce456[_0x48c4('0x4a')]=_[_0x48c4('0x4c')](_0x1ce456[_0x48c4('0x4a')],{'$or':_['map'](_0x1ce456[_0x48c4('0x43')],function(_0x3bdfbf){var _0x5e0bd9={};_0x5e0bd9[_0x3bdfbf]={'$like':'%'+_0x5a25e2['query'][_0x48c4('0x4e')]+'%'};return _0x5e0bd9;})});}_0x1ce456=_[_0x48c4('0x4c')]({},_0x1ce456,_0x5a25e2[_0x48c4('0x4f')]);return _0x1a3f45[_0x48c4('0x95')](_0x1ce456);}})[_0x48c4('0x1d')](function(_0x5addda){if(_0x5addda){_0x6f0188=_0x5addda['length'];if(!_0x5a25e2['query'][_0x48c4('0x46')](_0x48c4('0x47'))){_0x1ce456[_0x48c4('0x2c')]=qs[_0x48c4('0x2c')](_0x5a25e2[_0x48c4('0x42')][_0x48c4('0x2c')]);_0x1ce456['offset']=qs[_0x48c4('0x2e')](_0x5a25e2[_0x48c4('0x42')]['offset']);}return _0x1a3f45[_0x48c4('0x95')](_0x1ce456);}})[_0x48c4('0x1d')](function(_0x338c79){if(_0x338c79){return _0x338c79?{'count':_0x6f0188,'rows':_0x338c79}:null;}})['then'](respondWithResult(_0x58ba0f,null))[_0x48c4('0x28')](handleError(_0x58ba0f,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index e275220..6a6e418 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 _0x5f96=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0xd7ac32,_0x50dcf3){var _0x126f77=function(_0x5885cb){while(--_0x5885cb){_0xd7ac32['push'](_0xd7ac32['shift']());}};_0x126f77(++_0x50dcf3);}(_0x5f96,0x75));var _0x65f9=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f96[_0x173441];return _0x2423a8;};'use strict';var EventEmitter=require(_0x65f9('0x0'));var ChatQueue=require(_0x65f9('0x1'))['db'][_0x65f9('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x65f9('0x3')](0x0);var events={'afterCreate':_0x65f9('0x4'),'afterUpdate':_0x65f9('0x5'),'afterDestroy':_0x65f9('0x6')};function emitEvent(_0x5e5904){return function(_0x354244,_0x52994b,_0x18d941){ChatQueueEvents[_0x65f9('0x7')](_0x5e5904+':'+_0x354244['id'],_0x354244);ChatQueueEvents['emit'](_0x5e5904,_0x354244);_0x18d941(null);};}for(var e in events){if(events[_0x65f9('0x8')](e)){var event=events[e];ChatQueue[_0x65f9('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x1780=['update','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners','save'];(function(_0x94a64e,_0x566677){var _0x6acb41=function(_0x38a6b0){while(--_0x38a6b0){_0x94a64e['push'](_0x94a64e['shift']());}};_0x6acb41(++_0x566677);}(_0x1780,0x1af));var _0x0178=function(_0x14b84d,_0x1600a7){_0x14b84d=_0x14b84d-0x0;var _0x15215d=_0x1780[_0x14b84d];return _0x15215d;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x0178('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0178('0x1')](0x0);var events={'afterCreate':_0x0178('0x2'),'afterUpdate':_0x0178('0x3'),'afterDestroy':'remove'};function emitEvent(_0x174e3c){return function(_0x401339,_0x46ced3,_0x467629){ChatQueueEvents['emit'](_0x174e3c+':'+_0x401339['id'],_0x401339);ChatQueueEvents['emit'](_0x174e3c,_0x401339);_0x467629(null);};}for(var e in events){if(events[_0x0178('0x4')](e)){var event=events[e];ChatQueue[_0x0178('0x5')](e,emitEvent(event));}}module[_0x0178('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index c0fa3ff..625f1cc 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 _0x1983=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0x1983,0x150));var _0x3198=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x1983[_0xd09668];return _0x68726;};'use strict';var _=require(_0x3198('0x0'));var util=require(_0x3198('0x1'));var logger=require(_0x3198('0x2'))('api');var moment=require(_0x3198('0x3'));var BPromise=require(_0x3198('0x4'));var rp=require(_0x3198('0x5'));var fs=require('fs');var path=require(_0x3198('0x6'));var rimraf=require(_0x3198('0x7'));var config=require(_0x3198('0x8'));var attributes=require(_0x3198('0x9'));module[_0x3198('0xa')]=function(_0x567027,_0x4a5da9){return _0x567027[_0x3198('0xb')](_0x3198('0xc'),attributes,{'tableName':_0x3198('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e26=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatQueue'];(function(_0x25de85,_0x5bd5d2){var _0x71697=function(_0x4f2c42){while(--_0x4f2c42){_0x25de85['push'](_0x25de85['shift']());}};_0x71697(++_0x5bd5d2);}(_0x7e26,0xf2));var _0x67e2=function(_0x4268a1,_0x18e090){_0x4268a1=_0x4268a1-0x0;var _0x464149=_0x7e26[_0x4268a1];return _0x464149;};'use strict';var _=require(_0x67e2('0x0'));var util=require(_0x67e2('0x1'));var logger=require(_0x67e2('0x2'))('api');var moment=require(_0x67e2('0x3'));var BPromise=require(_0x67e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67e2('0x5'));var rimraf=require(_0x67e2('0x6'));var config=require(_0x67e2('0x7'));var attributes=require('./chatQueue.attributes');module[_0x67e2('0x8')]=function(_0x4bfe67,_0x3c51c6){return _0x4bfe67[_0x67e2('0x9')](_0x67e2('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index c2f7e58..f9e3b77 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 _0x6739=['socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','redis','defaults'];(function(_0x1b2e44,_0x536087){var _0xf8f838=function(_0x3f62e8){while(--_0x3f62e8){_0x1b2e44['push'](_0x1b2e44['shift']());}};_0xf8f838(++_0x536087);}(_0x6739,0xd3));var _0x9673=function(_0x547c1c,_0x31294b){_0x547c1c=_0x547c1c-0x0;var _0x44838a=_0x6739[_0x547c1c];return _0x44838a;};'use strict';var _=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var moment=require(_0x9673('0x2'));var BPromise=require(_0x9673('0x3'));var rs=require(_0x9673('0x4'));var fs=require('fs');var Redis=require(_0x9673('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9673('0x6'))('rpc');var config=require(_0x9673('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9673('0x8')]({'port':0x232a});config[_0x9673('0x9')]=_[_0x9673('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9673('0xb'))(new Redis(config[_0x9673('0x9')]));require(_0x9673('0xc'))['register'](socket);function respondWithRpcPromise(_0x405101,_0x1e99fd,_0x33073e){return new BPromise(function(_0x55f6a5,_0x30d538){return client[_0x9673('0xd')](_0x405101,_0x33073e)[_0x9673('0xe')](function(_0x3db27a){logger['info'](_0x9673('0xf'),_0x1e99fd,_0x9673('0x10'));logger[_0x9673('0x11')](_0x9673('0x12'),_0x1e99fd,'request\x20sent',JSON[_0x9673('0x13')](_0x3db27a));if(_0x3db27a[_0x9673('0x14')]){if(_0x3db27a['error'][_0x9673('0x15')]===0x1f4){logger[_0x9673('0x14')](_0x9673('0xf'),_0x1e99fd,_0x3db27a['error'][_0x9673('0x16')]);return _0x30d538(_0x3db27a['error'][_0x9673('0x16')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1e99fd,_0x3db27a[_0x9673('0x14')]['message']);return _0x55f6a5(_0x3db27a[_0x9673('0x14')][_0x9673('0x16')]);}else{logger['info'](_0x9673('0xf'),_0x1e99fd,_0x9673('0x10'));_0x55f6a5(_0x3db27a[_0x9673('0x17')][_0x9673('0x16')]);}})[_0x9673('0x18')](function(_0x281a1a){logger[_0x9673('0x14')](_0x9673('0xf'),_0x1e99fd,_0x281a1a);_0x30d538(_0x281a1a);});});}exports[_0x9673('0x19')]=function(_0x9e3c82){var _0x5e0d05=this;return new Promise(function(_0x1831ab,_0xbfc9d6){return db['ChatQueue'][_0x9673('0x1a')]({'raw':_0x9e3c82[_0x9673('0x1b')]?_0x9e3c82['options'][_0x9673('0x1c')]===undefined?!![]:![]:!![],'where':_0x9e3c82[_0x9673('0x1b')]?_0x9e3c82[_0x9673('0x1b')]['where']||null:null,'attributes':_0x9e3c82[_0x9673('0x1b')]?_0x9e3c82[_0x9673('0x1b')][_0x9673('0x1d')]||null:null,'limit':_0x9e3c82[_0x9673('0x1b')]?_0x9e3c82['options'][_0x9673('0x1e')]||null:null,'include':_0x9e3c82['options']?_0x9e3c82[_0x9673('0x1b')][_0x9673('0x1f')]?_[_0x9673('0x20')](_0x9e3c82[_0x9673('0x1b')][_0x9673('0x1f')],function(_0x415f9b){return{'model':db[_0x415f9b[_0x9673('0x21')]],'as':_0x415f9b['as'],'attributes':_0x415f9b[_0x9673('0x1d')],'include':_0x415f9b[_0x9673('0x1f')]?_['map'](_0x415f9b[_0x9673('0x1f')],function(_0x221b33){return{'model':db[_0x221b33['model']],'as':_0x221b33['as'],'attributes':_0x221b33['attributes'],'include':_0x221b33[_0x9673('0x1f')]?_[_0x9673('0x20')](_0x221b33[_0x9673('0x1f')],function(_0x3dba72){return{'model':db[_0x3dba72['model']],'as':_0x3dba72['as'],'attributes':_0x3dba72[_0x9673('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25acab){logger['info'](_0x9673('0x19'),_0x9e3c82);logger[_0x9673('0x11')](_0x9673('0x19'),_0x9e3c82,JSON['stringify'](_0x25acab));_0x1831ab(_0x25acab);})[_0x9673('0x18')](function(_0x590825){logger[_0x9673('0x14')](_0x9673('0x19'),_0x590825['message'],_0x9e3c82);_0xbfc9d6(_0x5e0d05['error'](0x1f4,_0x590825[_0x9673('0x16')]));});});};exports[_0x9673('0x22')]=function(_0x12f8a7){var _0x28d3c0=this;return new Promise(function(_0x332966,_0x2f9949){return db[_0x9673('0x23')]['find']({'raw':_0x12f8a7[_0x9673('0x1b')]?_0x12f8a7[_0x9673('0x1b')][_0x9673('0x1c')]===undefined?!![]:![]:!![],'where':_0x12f8a7[_0x9673('0x1b')]?_0x12f8a7[_0x9673('0x1b')][_0x9673('0x24')]||null:null,'attributes':_0x12f8a7[_0x9673('0x1b')]?_0x12f8a7[_0x9673('0x1b')][_0x9673('0x1d')]||null:null,'include':_0x12f8a7[_0x9673('0x1b')]?_0x12f8a7['options'][_0x9673('0x1f')]?_['map'](_0x12f8a7['options'][_0x9673('0x1f')],function(_0x344c12){return{'model':db[_0x344c12[_0x9673('0x21')]],'as':_0x344c12['as'],'attributes':_0x344c12[_0x9673('0x1d')],'include':_0x344c12['include']?_[_0x9673('0x20')](_0x344c12[_0x9673('0x1f')],function(_0x37f616){return{'model':db[_0x37f616[_0x9673('0x21')]],'as':_0x37f616['as'],'attributes':_0x37f616[_0x9673('0x1d')],'include':_0x37f616[_0x9673('0x1f')]?_[_0x9673('0x20')](_0x37f616[_0x9673('0x1f')],function(_0x34b115){return{'model':db[_0x34b115['model']],'as':_0x34b115['as'],'attributes':_0x34b115[_0x9673('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9673('0xe')](function(_0x4b67ad){logger['info'](_0x9673('0x22'),_0x12f8a7);logger['debug'](_0x9673('0x22'),_0x12f8a7,JSON[_0x9673('0x13')](_0x4b67ad));_0x332966(_0x4b67ad);})['catch'](function(_0x5634aa){logger[_0x9673('0x14')](_0x9673('0x22'),_0x5634aa[_0x9673('0x16')],_0x12f8a7);_0x2f9949(_0x28d3c0[_0x9673('0x14')](0x1f4,_0x5634aa[_0x9673('0x16')]));});});}; \ No newline at end of file +var _0xbc95=['randomstring','../../config/logger','rpc','http','defaults','socket.io-emitter','redis','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','include','map','model','ShowChatQueue','lodash','util','moment','bluebird'];(function(_0x5003e7,_0x2058c0){var _0x525c79=function(_0x210fb7){while(--_0x210fb7){_0x5003e7['push'](_0x5003e7['shift']());}};_0x525c79(++_0x2058c0);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x2e3cb8,_0x590443){_0x2e3cb8=_0x2e3cb8-0x0;var _0x486d78=_0xbc95[_0x2e3cb8];return _0x486d78;};'use strict';var _=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var moment=require(_0x5bc9('0x2'));var BPromise=require(_0x5bc9('0x3'));var rs=require(_0x5bc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bc9('0x5'))(_0x5bc9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5bc9('0x7')]({'port':0x232a});config['redis']=_[_0x5bc9('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5bc9('0x9'))(new Redis(config[_0x5bc9('0xa')]));require(_0x5bc9('0xb'))[_0x5bc9('0xc')](socket);function respondWithRpcPromise(_0x24d4b3,_0x2caa35,_0x4ae726){return new BPromise(function(_0x404864,_0x4ad1c0){return client['request'](_0x24d4b3,_0x4ae726)[_0x5bc9('0xd')](function(_0x5c6238){logger[_0x5bc9('0xe')](_0x5bc9('0xf'),_0x2caa35,_0x5bc9('0x10'));logger[_0x5bc9('0x11')](_0x5bc9('0x12'),_0x2caa35,'request\x20sent',JSON[_0x5bc9('0x13')](_0x5c6238));if(_0x5c6238[_0x5bc9('0x14')]){if(_0x5c6238['error'][_0x5bc9('0x15')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2caa35,_0x5c6238[_0x5bc9('0x14')][_0x5bc9('0x16')]);return _0x4ad1c0(_0x5c6238[_0x5bc9('0x14')][_0x5bc9('0x16')]);}logger[_0x5bc9('0x14')](_0x5bc9('0xf'),_0x2caa35,_0x5c6238['error']['message']);return _0x404864(_0x5c6238[_0x5bc9('0x14')][_0x5bc9('0x16')]);}else{logger['info'](_0x5bc9('0xf'),_0x2caa35,_0x5bc9('0x10'));_0x404864(_0x5c6238[_0x5bc9('0x17')]['message']);}})[_0x5bc9('0x18')](function(_0x1eeca2){logger[_0x5bc9('0x14')]('ChatQueue,\x20%s,\x20%s',_0x2caa35,_0x1eeca2);_0x4ad1c0(_0x1eeca2);});});}exports[_0x5bc9('0x19')]=function(_0x50f1ef){var _0x102ab2=this;return new Promise(function(_0x471d9c,_0x299a7c){return db[_0x5bc9('0x1a')][_0x5bc9('0x1b')]({'raw':_0x50f1ef['options']?_0x50f1ef['options'][_0x5bc9('0x1c')]===undefined?!![]:![]:!![],'where':_0x50f1ef[_0x5bc9('0x1d')]?_0x50f1ef[_0x5bc9('0x1d')][_0x5bc9('0x1e')]||null:null,'attributes':_0x50f1ef[_0x5bc9('0x1d')]?_0x50f1ef[_0x5bc9('0x1d')][_0x5bc9('0x1f')]||null:null,'limit':_0x50f1ef[_0x5bc9('0x1d')]?_0x50f1ef[_0x5bc9('0x1d')]['limit']||null:null,'include':_0x50f1ef[_0x5bc9('0x1d')]?_0x50f1ef[_0x5bc9('0x1d')][_0x5bc9('0x20')]?_[_0x5bc9('0x21')](_0x50f1ef['options'][_0x5bc9('0x20')],function(_0x51262f){return{'model':db[_0x51262f[_0x5bc9('0x22')]],'as':_0x51262f['as'],'attributes':_0x51262f[_0x5bc9('0x1f')],'include':_0x51262f[_0x5bc9('0x20')]?_[_0x5bc9('0x21')](_0x51262f['include'],function(_0x1f19e0){return{'model':db[_0x1f19e0['model']],'as':_0x1f19e0['as'],'attributes':_0x1f19e0['attributes'],'include':_0x1f19e0[_0x5bc9('0x20')]?_['map'](_0x1f19e0[_0x5bc9('0x20')],function(_0x49d8a3){return{'model':db[_0x49d8a3['model']],'as':_0x49d8a3['as'],'attributes':_0x49d8a3[_0x5bc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5bc9('0xd')](function(_0x17d53d){logger[_0x5bc9('0xe')](_0x5bc9('0x19'),_0x50f1ef);logger[_0x5bc9('0x11')]('GetChatQueue',_0x50f1ef,JSON['stringify'](_0x17d53d));_0x471d9c(_0x17d53d);})['catch'](function(_0x5d7044){logger[_0x5bc9('0x14')](_0x5bc9('0x19'),_0x5d7044[_0x5bc9('0x16')],_0x50f1ef);_0x299a7c(_0x102ab2[_0x5bc9('0x14')](0x1f4,_0x5d7044[_0x5bc9('0x16')]));});});};exports[_0x5bc9('0x23')]=function(_0x73a4d2){var _0x3ba7a6=this;return new Promise(function(_0x5dd7e6,_0x232552){return db['ChatQueue']['find']({'raw':_0x73a4d2[_0x5bc9('0x1d')]?_0x73a4d2[_0x5bc9('0x1d')][_0x5bc9('0x1c')]===undefined?!![]:![]:!![],'where':_0x73a4d2['options']?_0x73a4d2['options']['where']||null:null,'attributes':_0x73a4d2[_0x5bc9('0x1d')]?_0x73a4d2[_0x5bc9('0x1d')][_0x5bc9('0x1f')]||null:null,'include':_0x73a4d2[_0x5bc9('0x1d')]?_0x73a4d2[_0x5bc9('0x1d')][_0x5bc9('0x20')]?_[_0x5bc9('0x21')](_0x73a4d2[_0x5bc9('0x1d')]['include'],function(_0x307c11){return{'model':db[_0x307c11[_0x5bc9('0x22')]],'as':_0x307c11['as'],'attributes':_0x307c11[_0x5bc9('0x1f')],'include':_0x307c11[_0x5bc9('0x20')]?_[_0x5bc9('0x21')](_0x307c11[_0x5bc9('0x20')],function(_0x2f7d19){return{'model':db[_0x2f7d19['model']],'as':_0x2f7d19['as'],'attributes':_0x2f7d19['attributes'],'include':_0x2f7d19[_0x5bc9('0x20')]?_[_0x5bc9('0x21')](_0x2f7d19[_0x5bc9('0x20')],function(_0x4570d5){return{'model':db[_0x4570d5[_0x5bc9('0x22')]],'as':_0x4570d5['as'],'attributes':_0x4570d5[_0x5bc9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5bc9('0xd')](function(_0x2fa6a9){logger[_0x5bc9('0xe')]('ShowChatQueue',_0x73a4d2);logger[_0x5bc9('0x11')](_0x5bc9('0x23'),_0x73a4d2,JSON[_0x5bc9('0x13')](_0x2fa6a9));_0x5dd7e6(_0x2fa6a9);})['catch'](function(_0x517afa){logger[_0x5bc9('0x14')](_0x5bc9('0x23'),_0x517afa[_0x5bc9('0x16')],_0x73a4d2);_0x232552(_0x3ba7a6['error'](0x1f4,_0x517afa['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index fcf5244..e604448 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 _0xbb53=['length','./chatQueue.events','save','remove','update','emit'];(function(_0x1f8b3f,_0x10f91c){var _0x17c1c2=function(_0x985b67){while(--_0x985b67){_0x1f8b3f['push'](_0x1f8b3f['shift']());}};_0x17c1c2(++_0x10f91c);}(_0xbb53,0x121));var _0x3bb5=function(_0x904b82,_0x24786f){_0x904b82=_0x904b82-0x0;var _0x1e072d=_0xbb53[_0x904b82];return _0x1e072d;};'use strict';var ChatQueueEvents=require(_0x3bb5('0x0'));var events=[_0x3bb5('0x1'),_0x3bb5('0x2'),_0x3bb5('0x3')];function createListener(_0x20c8b6,_0x226d39){return function(_0x414da7){_0x226d39[_0x3bb5('0x4')](_0x20c8b6,_0x414da7);};}function removeListener(_0x83e44b,_0x450d9e){return function(){ChatQueueEvents['removeListener'](_0x83e44b,_0x450d9e);};}exports['register']=function(_0x23f11e){for(var _0x2460b0=0x0,_0x28aa7d=events[_0x3bb5('0x5')];_0x2460b0<_0x28aa7d;_0x2460b0++){var _0x22f92f=events[_0x2460b0];var _0x480f9c=createListener('chatQueue:'+_0x22f92f,_0x23f11e);ChatQueueEvents['on'](_0x22f92f,_0x480f9c);}}; \ No newline at end of file +var _0x5178=['remove','update','register','length','save'];(function(_0x40c88d,_0x6a96ed){var _0x108216=function(_0x33470f){while(--_0x33470f){_0x40c88d['push'](_0x40c88d['shift']());}};_0x108216(++_0x6a96ed);}(_0x5178,0x171));var _0x8517=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5178[_0x1ac595];return _0x455fff;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8517('0x0'),_0x8517('0x1'),_0x8517('0x2')];function createListener(_0x2dc28f,_0x38d5b3){return function(_0x5e0a44){_0x38d5b3['emit'](_0x2dc28f,_0x5e0a44);};}function removeListener(_0x3ed6a5,_0x221184){return function(){ChatQueueEvents['removeListener'](_0x3ed6a5,_0x221184);};}exports[_0x8517('0x3')]=function(_0x58ed7e){for(var _0x13ba05=0x0,_0x45498e=events[_0x8517('0x4')];_0x13ba05<_0x45498e;_0x13ba05++){var _0x10f918=events[_0x13ba05];var _0x25146d=createListener('chatQueue:'+_0x10f918,_0x58ed7e);ChatQueueEvents['on'](_0x10f918,_0x25146d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 443e67d..3bcf5f2 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 _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(_0x2d012e,_0x2e1cea){var _0x390c17=function(_0x54f8a7){while(--_0x54f8a7){_0x2d012e['push'](_0x2d012e['shift']());}};_0x390c17(++_0x2e1cea);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',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 +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x38ae00,_0x2f6454){_0x38ae00=_0x38ae00-0x0;var _0x261fef=_0x3e74[_0x38ae00];return _0x261fef;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 3fbaf16..902ccea 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 _0x62f7=['DATE','sequelize','exports','STRING'];(function(_0x4a2a2b,_0x2d03b2){var _0x47682b=function(_0x5e4304){while(--_0x5e4304){_0x4a2a2b['push'](_0x4a2a2b['shift']());}};_0x47682b(++_0x2d03b2);}(_0x62f7,0x1e9));var _0x762f=function(_0x1751ab,_0x558200){_0x1751ab=_0x1751ab-0x0;var _0x2f64e9=_0x62f7[_0x1751ab];return _0x2f64e9;};'use strict';var moment=require('moment');var Sequelize=require(_0x762f('0x0'));module[_0x762f('0x1')]={'uniqueid':{'type':Sequelize[_0x762f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x762f('0x2')]},'joinAt':{'type':Sequelize[_0x762f('0x3')]},'leaveAt':{'type':Sequelize[_0x762f('0x3')]},'acceptAt':{'type':Sequelize[_0x762f('0x3')]},'exitAt':{'type':Sequelize[_0x762f('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1108=['DATE','STRING','moment','exports'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x1108,0x1de));var _0x8110=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x1108[_0x128450];return _0x4d80ed;};'use strict';var moment=require(_0x8110('0x0'));var Sequelize=require('sequelize');module[_0x8110('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8110('0x2')]},'acceptAt':{'type':Sequelize[_0x8110('0x2')]},'exitAt':{'type':Sequelize[_0x8110('0x2')]},'reason':{'type':Sequelize[_0x8110('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e57f52c..7f9d606 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 _0x8b52=['limit','count','Content-Range','json','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset'];(function(_0x31234d,_0x1fc94c){var _0x24322f=function(_0x561a5b){while(--_0x561a5b){_0x31234d['push'](_0x31234d['shift']());}};_0x24322f(++_0x1fc94c);}(_0x8b52,0x151));var _0x28b5=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8b52[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x28b5('0x0'));var rimraf=require(_0x28b5('0x1'));var zipdir=require(_0x28b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28b5('0x3'));var moment=require(_0x28b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28b5('0x5'));var util=require(_0x28b5('0x6'));var path=require(_0x28b5('0x7'));var sox=require(_0x28b5('0x8'));var csv=require(_0x28b5('0x9'));var ejs=require(_0x28b5('0xa'));var fs=require('fs');var fs_extra=require(_0x28b5('0xb'));var _=require(_0x28b5('0xc'));var squel=require(_0x28b5('0xd'));var crypto=require('crypto');var jsforce=require(_0x28b5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28b5('0xf'));var Papa=require(_0x28b5('0x10'));var Redis=require('ioredis');var authService=require(_0x28b5('0x11'));var qs=require(_0x28b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28b5('0x13'));var logger=require(_0x28b5('0x14'))(_0x28b5('0x15'));var utils=require(_0x28b5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x28b5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc18108,_0x3bd9f3){_0x3bd9f3=_0x3bd9f3||0xcc;return function(_0x5f41b6){if(_0x5f41b6){return _0xc18108[_0x28b5('0x18')](_0x3bd9f3);}return _0xc18108['status'](_0x3bd9f3)[_0x28b5('0x19')]();};}function respondWithResult(_0x4a684e,_0x58f350){_0x58f350=_0x58f350||0xc8;return function(_0xff943a){if(_0xff943a){return _0x4a684e[_0x28b5('0x1a')](_0x58f350)['json'](_0xff943a);}};}function respondWithFilteredResult(_0x2c17c7,_0x26213c){return function(_0x1e4a10){if(_0x1e4a10){var _0x16c115=typeof _0x26213c[_0x28b5('0x1b')]==='undefined'&&typeof _0x26213c[_0x28b5('0x1c')]==='undefined';var _0x7b6900=_0x1e4a10[_0x28b5('0x1d')];var _0xfea919=_0x16c115?0x0:_0x26213c[_0x28b5('0x1b')];var _0x540933=_0x16c115?_0x1e4a10[_0x28b5('0x1d')]:_0x26213c[_0x28b5('0x1b')]+_0x26213c[_0x28b5('0x1c')];var _0x534136;if(_0x540933>=_0x7b6900){_0x540933=_0x7b6900;_0x534136=0xc8;}else{_0x534136=0xce;}_0x2c17c7[_0x28b5('0x1a')](_0x534136);return _0x2c17c7['set'](_0x28b5('0x1e'),_0xfea919+'-'+_0x540933+'/'+_0x7b6900)[_0x28b5('0x1f')](_0x1e4a10);}return null;};}function patchUpdates(_0x2c4cae){return function(_0x386494){try{jsonpatch['apply'](_0x386494,_0x2c4cae,!![]);}catch(_0x3ebe9e){return BPromise[_0x28b5('0x20')](_0x3ebe9e);}return _0x386494[_0x28b5('0x21')]();};}function saveUpdates(_0x32c819,_0x5c453a){return function(_0x4a8893){if(_0x4a8893){return _0x4a8893['update'](_0x32c819)[_0x28b5('0x22')](function(_0x1bf044){return _0x1bf044;});}return null;};}function removeEntity(_0x395feb,_0x740562){return function(_0x8fa4b9){if(_0x8fa4b9){return _0x8fa4b9[_0x28b5('0x23')]()['then'](function(){_0x395feb['status'](0xcc)[_0x28b5('0x19')]();});}};}function handleEntityNotFound(_0x528993,_0x304f72){return function(_0x25fd54){if(!_0x25fd54){_0x528993[_0x28b5('0x18')](0x194);}return _0x25fd54;};}function handleError(_0x18176c,_0x127ab0){_0x127ab0=_0x127ab0||0x1f4;return function(_0x5ae41d){logger['error'](_0x5ae41d[_0x28b5('0x24')]);if(_0x5ae41d[_0x28b5('0x25')]){delete _0x5ae41d[_0x28b5('0x25')];}_0x18176c[_0x28b5('0x1a')](_0x127ab0)[_0x28b5('0x26')](_0x5ae41d);};}exports[_0x28b5('0x27')]=function(_0x2db6f1,_0x1bbe54){var _0x139524={},_0x2a182a={},_0x491b72={'count':0x0,'rows':[]};var _0x2b46f7=_[_0x28b5('0x28')](db['ChatQueueReport'][_0x28b5('0x29')],function(_0x330767){return{'name':_0x330767[_0x28b5('0x2a')],'type':_0x330767[_0x28b5('0x2b')][_0x28b5('0x2c')]};});_0x2a182a[_0x28b5('0x2d')]=_[_0x28b5('0x28')](_0x2b46f7,'name');_0x2a182a[_0x28b5('0x2e')]=_['keys'](_0x2db6f1[_0x28b5('0x2e')]);_0x2a182a[_0x28b5('0x2f')]=_[_0x28b5('0x30')](_0x2a182a[_0x28b5('0x2d')],_0x2a182a[_0x28b5('0x2e')]);_0x139524[_0x28b5('0x31')]=_[_0x28b5('0x30')](_0x2a182a[_0x28b5('0x2d')],qs[_0x28b5('0x32')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x32')]));_0x139524[_0x28b5('0x31')]=_0x139524[_0x28b5('0x31')][_0x28b5('0x33')]?_0x139524[_0x28b5('0x31')]:_0x2a182a[_0x28b5('0x2d')];if(!_0x2db6f1['query'][_0x28b5('0x34')]('nolimit')){_0x139524[_0x28b5('0x1c')]=qs[_0x28b5('0x1c')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x1c')]);_0x139524['offset']=qs[_0x28b5('0x1b')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x1b')]);}_0x139524['order']=qs['sort'](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x35')]);_0x139524[_0x28b5('0x36')]=qs[_0x28b5('0x2f')](_['pick'](_0x2db6f1[_0x28b5('0x2e')],_0x2a182a[_0x28b5('0x2f')]),_0x2b46f7);if(_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x37')]){_0x139524[_0x28b5('0x36')]=_[_0x28b5('0x38')](_0x139524[_0x28b5('0x36')],{'$or':_[_0x28b5('0x28')](_0x2b46f7,function(_0x4cc88a){if(_0x4cc88a[_0x28b5('0x2b')]!==_0x28b5('0x39')){var _0x4d3d09={};_0x4d3d09[_0x4cc88a[_0x28b5('0x25')]]={'$like':'%'+_0x2db6f1['query'][_0x28b5('0x37')]+'%'};return _0x4d3d09;}})});}_0x139524=_[_0x28b5('0x38')]({},_0x139524,_0x2db6f1[_0x28b5('0x3a')]);var _0x5e1fb2={'where':_0x139524[_0x28b5('0x36')]};return db[_0x28b5('0x3b')][_0x28b5('0x1d')](_0x5e1fb2)[_0x28b5('0x22')](function(_0x31f620){_0x491b72[_0x28b5('0x1d')]=_0x31f620;if(_0x2db6f1['query'][_0x28b5('0x3c')]){_0x139524[_0x28b5('0x3d')]=[{'all':!![]}];}return db[_0x28b5('0x3b')][_0x28b5('0x3e')](_0x139524);})[_0x28b5('0x22')](function(_0x5c237f){_0x491b72[_0x28b5('0x3f')]=_0x5c237f;return _0x491b72;})[_0x28b5('0x22')](respondWithFilteredResult(_0x1bbe54,_0x139524))[_0x28b5('0x40')](handleError(_0x1bbe54,null));};exports[_0x28b5('0x41')]=function(_0x45bd3c,_0x4bd2e3){var _0x2ac508={'raw':!![],'where':{'id':_0x45bd3c[_0x28b5('0x42')]['id']}},_0x5bee77={};_0x5bee77[_0x28b5('0x2d')]=_[_0x28b5('0x43')](db[_0x28b5('0x3b')]['rawAttributes']);_0x5bee77['query']=_[_0x28b5('0x43')](_0x45bd3c[_0x28b5('0x2e')]);_0x5bee77[_0x28b5('0x2f')]=_[_0x28b5('0x30')](_0x5bee77[_0x28b5('0x2d')],_0x5bee77['query']);_0x2ac508[_0x28b5('0x31')]=_['intersection'](_0x5bee77[_0x28b5('0x2d')],qs[_0x28b5('0x32')](_0x45bd3c[_0x28b5('0x2e')][_0x28b5('0x32')]));_0x2ac508[_0x28b5('0x31')]=_0x2ac508[_0x28b5('0x31')][_0x28b5('0x33')]?_0x2ac508['attributes']:_0x5bee77[_0x28b5('0x2d')];if(_0x45bd3c[_0x28b5('0x2e')][_0x28b5('0x3c')]){_0x2ac508[_0x28b5('0x3d')]=[{'all':!![]}];}_0x2ac508=_[_0x28b5('0x38')]({},_0x2ac508,_0x45bd3c[_0x28b5('0x3a')]);return db[_0x28b5('0x3b')][_0x28b5('0x44')](_0x2ac508)[_0x28b5('0x22')](handleEntityNotFound(_0x4bd2e3,null))['then'](respondWithResult(_0x4bd2e3,null))[_0x28b5('0x40')](handleError(_0x4bd2e3,null));};exports[_0x28b5('0x45')]=function(_0xe46b0a,_0x141f9a){return db['ChatQueueReport'][_0x28b5('0x45')](_0xe46b0a[_0x28b5('0x46')],{})[_0x28b5('0x22')](respondWithResult(_0x141f9a,0xc9))[_0x28b5('0x40')](handleError(_0x141f9a,null));};exports[_0x28b5('0x47')]=function(_0xaf449d,_0x3d7fdd){if(_0xaf449d[_0x28b5('0x46')]['id']){delete _0xaf449d[_0x28b5('0x46')]['id'];}return db[_0x28b5('0x3b')][_0x28b5('0x44')]({'where':{'id':_0xaf449d[_0x28b5('0x42')]['id']}})[_0x28b5('0x22')](handleEntityNotFound(_0x3d7fdd,null))[_0x28b5('0x22')](saveUpdates(_0xaf449d['body'],null))['then'](respondWithResult(_0x3d7fdd,null))['catch'](handleError(_0x3d7fdd,null));};exports[_0x28b5('0x23')]=function(_0x97af32,_0x5aaef3){return db[_0x28b5('0x3b')][_0x28b5('0x44')]({'where':{'id':_0x97af32['params']['id']}})[_0x28b5('0x22')](handleEntityNotFound(_0x5aaef3,null))[_0x28b5('0x22')](removeEntity(_0x5aaef3,null))[_0x28b5('0x40')](handleError(_0x5aaef3,null));};exports[_0x28b5('0x48')]=function(_0x5da088,_0x4f6853){return db[_0x28b5('0x3b')][_0x28b5('0x48')]()[_0x28b5('0x22')](respondWithResult(_0x4f6853,null))[_0x28b5('0x40')](handleError(_0x4f6853,null));}; \ No newline at end of file +var _0x79bf=['reject','save','update','destroy','then','stack','name','send','index','map','ChatQueueReport','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filters','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','set','Content-Range','json'];(function(_0x17b1ec,_0x30d982){var _0x3e51c1=function(_0x3489ca){while(--_0x3489ca){_0x17b1ec['push'](_0x17b1ec['shift']());}};_0x3e51c1(++_0x30d982);}(_0x79bf,0x1df));var _0xf79b=function(_0x54c977,_0x382295){_0x54c977=_0x54c977-0x0;var _0x53a048=_0x79bf[_0x54c977];return _0x53a048;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf79b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf79b('0x1'));var rp=require('request-promise');var moment=require(_0xf79b('0x2'));var BPromise=require(_0xf79b('0x3'));var Mustache=require(_0xf79b('0x4'));var util=require(_0xf79b('0x5'));var path=require(_0xf79b('0x6'));var sox=require(_0xf79b('0x7'));var csv=require(_0xf79b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf79b('0x9'));var _=require(_0xf79b('0xa'));var squel=require(_0xf79b('0xb'));var crypto=require('crypto');var jsforce=require(_0xf79b('0xc'));var deskjs=require(_0xf79b('0xd'));var toCsv=require(_0xf79b('0x8'));var querystring=require(_0xf79b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf79b('0xf'));var qs=require(_0xf79b('0x10'));var as=require(_0xf79b('0x11'));var hardwareService=require(_0xf79b('0x12'));var logger=require(_0xf79b('0x13'))(_0xf79b('0x14'));var utils=require(_0xf79b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf79b('0x16'));var db=require(_0xf79b('0x17'))['db'];function respondWithStatusCode(_0x1e7c75,_0x1bf2bf){_0x1bf2bf=_0x1bf2bf||0xcc;return function(_0x38e886){if(_0x38e886){return _0x1e7c75[_0xf79b('0x18')](_0x1bf2bf);}return _0x1e7c75[_0xf79b('0x19')](_0x1bf2bf)[_0xf79b('0x1a')]();};}function respondWithResult(_0x1ac99c,_0xe046eb){_0xe046eb=_0xe046eb||0xc8;return function(_0x1bd011){if(_0x1bd011){return _0x1ac99c[_0xf79b('0x19')](_0xe046eb)['json'](_0x1bd011);}};}function respondWithFilteredResult(_0x487967,_0x1647c5){return function(_0x595790){if(_0x595790){var _0x3caf78=typeof _0x1647c5['offset']===_0xf79b('0x1b')&&typeof _0x1647c5['limit']==='undefined';var _0x14b21d=_0x595790['count'];var _0x387e4e=_0x3caf78?0x0:_0x1647c5[_0xf79b('0x1c')];var _0x202d01=_0x3caf78?_0x595790['count']:_0x1647c5[_0xf79b('0x1c')]+_0x1647c5['limit'];var _0x379ac0;if(_0x202d01>=_0x14b21d){_0x202d01=_0x14b21d;_0x379ac0=0xc8;}else{_0x379ac0=0xce;}_0x487967[_0xf79b('0x19')](_0x379ac0);return _0x487967[_0xf79b('0x1d')](_0xf79b('0x1e'),_0x387e4e+'-'+_0x202d01+'/'+_0x14b21d)[_0xf79b('0x1f')](_0x595790);}return null;};}function patchUpdates(_0x4c91a6){return function(_0x27f68b){try{jsonpatch['apply'](_0x27f68b,_0x4c91a6,!![]);}catch(_0x5d33fa){return BPromise[_0xf79b('0x20')](_0x5d33fa);}return _0x27f68b[_0xf79b('0x21')]();};}function saveUpdates(_0x20a975,_0x400cfd){return function(_0x20a503){if(_0x20a503){return _0x20a503[_0xf79b('0x22')](_0x20a975)['then'](function(_0x255c13){return _0x255c13;});}return null;};}function removeEntity(_0x471e42,_0x378db3){return function(_0x13a339){if(_0x13a339){return _0x13a339[_0xf79b('0x23')]()[_0xf79b('0x24')](function(){_0x471e42[_0xf79b('0x19')](0xcc)[_0xf79b('0x1a')]();});}};}function handleEntityNotFound(_0xf1480e,_0x31bd2a){return function(_0x5c9dfb){if(!_0x5c9dfb){_0xf1480e[_0xf79b('0x18')](0x194);}return _0x5c9dfb;};}function handleError(_0x5e7f72,_0x55740a){_0x55740a=_0x55740a||0x1f4;return function(_0x1a99e3){logger['error'](_0x1a99e3[_0xf79b('0x25')]);if(_0x1a99e3[_0xf79b('0x26')]){delete _0x1a99e3[_0xf79b('0x26')];}_0x5e7f72[_0xf79b('0x19')](_0x55740a)[_0xf79b('0x27')](_0x1a99e3);};}exports[_0xf79b('0x28')]=function(_0x3e6171,_0x479b41){var _0x1bd31c={},_0x470f5b={},_0x1a4a13={'count':0x0,'rows':[]};var _0x5751f9=_[_0xf79b('0x29')](db[_0xf79b('0x2a')]['rawAttributes'],function(_0x152b06){return{'name':_0x152b06['fieldName'],'type':_0x152b06[_0xf79b('0x2b')][_0xf79b('0x2c')]};});_0x470f5b[_0xf79b('0x2d')]=_[_0xf79b('0x29')](_0x5751f9,_0xf79b('0x26'));_0x470f5b[_0xf79b('0x2e')]=_[_0xf79b('0x2f')](_0x3e6171[_0xf79b('0x2e')]);_0x470f5b['filters']=_[_0xf79b('0x30')](_0x470f5b[_0xf79b('0x2d')],_0x470f5b[_0xf79b('0x2e')]);_0x1bd31c[_0xf79b('0x31')]=_[_0xf79b('0x30')](_0x470f5b['model'],qs['fields'](_0x3e6171[_0xf79b('0x2e')][_0xf79b('0x32')]));_0x1bd31c[_0xf79b('0x31')]=_0x1bd31c[_0xf79b('0x31')][_0xf79b('0x33')]?_0x1bd31c['attributes']:_0x470f5b['model'];if(!_0x3e6171[_0xf79b('0x2e')][_0xf79b('0x34')](_0xf79b('0x35'))){_0x1bd31c[_0xf79b('0x36')]=qs[_0xf79b('0x36')](_0x3e6171[_0xf79b('0x2e')]['limit']);_0x1bd31c[_0xf79b('0x1c')]=qs[_0xf79b('0x1c')](_0x3e6171[_0xf79b('0x2e')][_0xf79b('0x1c')]);}_0x1bd31c[_0xf79b('0x37')]=qs['sort'](_0x3e6171[_0xf79b('0x2e')]['sort']);_0x1bd31c[_0xf79b('0x38')]=qs['filters'](_[_0xf79b('0x39')](_0x3e6171[_0xf79b('0x2e')],_0x470f5b[_0xf79b('0x3a')]),_0x5751f9);if(_0x3e6171[_0xf79b('0x2e')]['filter']){_0x1bd31c['where']=_['merge'](_0x1bd31c[_0xf79b('0x38')],{'$or':_[_0xf79b('0x29')](_0x5751f9,function(_0x5d0953){if(_0x5d0953[_0xf79b('0x2b')]!=='VIRTUAL'){var _0x14501a={};_0x14501a[_0x5d0953[_0xf79b('0x26')]]={'$like':'%'+_0x3e6171[_0xf79b('0x2e')]['filter']+'%'};return _0x14501a;}})});}_0x1bd31c=_[_0xf79b('0x3b')]({},_0x1bd31c,_0x3e6171[_0xf79b('0x3c')]);var _0x4ae653={'where':_0x1bd31c[_0xf79b('0x38')]};return db['ChatQueueReport'][_0xf79b('0x3d')](_0x4ae653)[_0xf79b('0x24')](function(_0x17bf96){_0x1a4a13[_0xf79b('0x3d')]=_0x17bf96;if(_0x3e6171[_0xf79b('0x2e')][_0xf79b('0x3e')]){_0x1bd31c[_0xf79b('0x3f')]=[{'all':!![]}];}return db[_0xf79b('0x2a')][_0xf79b('0x40')](_0x1bd31c);})[_0xf79b('0x24')](function(_0x1cbb9a){_0x1a4a13[_0xf79b('0x41')]=_0x1cbb9a;return _0x1a4a13;})['then'](respondWithFilteredResult(_0x479b41,_0x1bd31c))[_0xf79b('0x42')](handleError(_0x479b41,null));};exports[_0xf79b('0x43')]=function(_0x4e495d,_0x4a1a04){var _0x12e8a1={'raw':!![],'where':{'id':_0x4e495d[_0xf79b('0x44')]['id']}},_0x3953c8={};_0x3953c8[_0xf79b('0x2d')]=_[_0xf79b('0x2f')](db['ChatQueueReport'][_0xf79b('0x45')]);_0x3953c8[_0xf79b('0x2e')]=_[_0xf79b('0x2f')](_0x4e495d[_0xf79b('0x2e')]);_0x3953c8[_0xf79b('0x3a')]=_[_0xf79b('0x30')](_0x3953c8[_0xf79b('0x2d')],_0x3953c8[_0xf79b('0x2e')]);_0x12e8a1[_0xf79b('0x31')]=_[_0xf79b('0x30')](_0x3953c8[_0xf79b('0x2d')],qs[_0xf79b('0x32')](_0x4e495d[_0xf79b('0x2e')][_0xf79b('0x32')]));_0x12e8a1[_0xf79b('0x31')]=_0x12e8a1[_0xf79b('0x31')]['length']?_0x12e8a1[_0xf79b('0x31')]:_0x3953c8['model'];if(_0x4e495d[_0xf79b('0x2e')][_0xf79b('0x3e')]){_0x12e8a1[_0xf79b('0x3f')]=[{'all':!![]}];}_0x12e8a1=_[_0xf79b('0x3b')]({},_0x12e8a1,_0x4e495d[_0xf79b('0x3c')]);return db[_0xf79b('0x2a')][_0xf79b('0x46')](_0x12e8a1)[_0xf79b('0x24')](handleEntityNotFound(_0x4a1a04,null))[_0xf79b('0x24')](respondWithResult(_0x4a1a04,null))['catch'](handleError(_0x4a1a04,null));};exports['create']=function(_0xba74c7,_0x58fade){return db['ChatQueueReport']['create'](_0xba74c7[_0xf79b('0x47')],{})[_0xf79b('0x24')](respondWithResult(_0x58fade,0xc9))[_0xf79b('0x42')](handleError(_0x58fade,null));};exports['update']=function(_0xe5b3e6,_0xc61317){if(_0xe5b3e6['body']['id']){delete _0xe5b3e6[_0xf79b('0x47')]['id'];}return db[_0xf79b('0x2a')]['find']({'where':{'id':_0xe5b3e6[_0xf79b('0x44')]['id']}})[_0xf79b('0x24')](handleEntityNotFound(_0xc61317,null))[_0xf79b('0x24')](saveUpdates(_0xe5b3e6[_0xf79b('0x47')],null))[_0xf79b('0x24')](respondWithResult(_0xc61317,null))[_0xf79b('0x42')](handleError(_0xc61317,null));};exports[_0xf79b('0x23')]=function(_0x1ca74a,_0x5ed363){return db[_0xf79b('0x2a')][_0xf79b('0x46')]({'where':{'id':_0x1ca74a[_0xf79b('0x44')]['id']}})[_0xf79b('0x24')](handleEntityNotFound(_0x5ed363,null))[_0xf79b('0x24')](removeEntity(_0x5ed363,null))[_0xf79b('0x42')](handleError(_0x5ed363,null));};exports['describe']=function(_0x2ab57a,_0x5ee2b6){return db[_0xf79b('0x2a')][_0xf79b('0x48')]()[_0xf79b('0x24')](respondWithResult(_0x5ee2b6,null))['catch'](handleError(_0x5ee2b6,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 3911f13..aea7f6c 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x3396cd,_0x4047f0){var _0x2d6b4a=function(_0x389663){while(--_0x389663){_0x3396cd['push'](_0x3396cd['shift']());}};_0x2d6b4a(++_0x4047f0);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a213a,_0x2b4a23){_0x5a213a=_0x5a213a-0x0;var _0x3577b3=_0xb10b[_0x5a213a];return _0x3577b3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0xd79c49,_0x18994e){var _0x52d29f=function(_0x388ed6){while(--_0x388ed6){_0xd79c49['push'](_0xd79c49['shift']());}};_0x52d29f(++_0x18994e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xb7e7[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 0301c24..d313e2e 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 _0x52fb=['error','code','message','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5ad8aa,_0x3ac689){var _0x246cf1=function(_0x3814cb){while(--_0x3814cb){_0x5ad8aa['push'](_0x5ad8aa['shift']());}};_0x246cf1(++_0x3ac689);}(_0x52fb,0xa8));var _0xb52f=function(_0x43fd92,_0x4a8be1){_0x43fd92=_0x43fd92-0x0;var _0x29f876=_0x52fb[_0x43fd92];return _0x29f876;};'use strict';var _=require(_0xb52f('0x0'));var util=require('util');var moment=require(_0xb52f('0x1'));var BPromise=require(_0xb52f('0x2'));var rs=require(_0xb52f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb52f('0x4'))['db'];var utils=require(_0xb52f('0x5'));var logger=require('../../config/logger')(_0xb52f('0x6'));var config=require('../../config/environment');var jayson=require(_0xb52f('0x7'));var client=jayson[_0xb52f('0x8')][_0xb52f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48779d,_0x2a6134,_0x5e657e){return new BPromise(function(_0x37a3b3,_0x3d91b8){return client[_0xb52f('0xa')](_0x48779d,_0x5e657e)[_0xb52f('0xb')](function(_0x179296){logger[_0xb52f('0xc')](_0xb52f('0xd'),_0x2a6134,'request\x20sent');logger[_0xb52f('0xe')](_0xb52f('0xf'),_0x2a6134,_0xb52f('0x10'),JSON[_0xb52f('0x11')](_0x179296));if(_0x179296[_0xb52f('0x12')]){if(_0x179296[_0xb52f('0x12')][_0xb52f('0x13')]===0x1f4){logger['error'](_0xb52f('0xd'),_0x2a6134,_0x179296['error'][_0xb52f('0x14')]);return _0x3d91b8(_0x179296[_0xb52f('0x12')][_0xb52f('0x14')]);}logger[_0xb52f('0x12')](_0xb52f('0xd'),_0x2a6134,_0x179296[_0xb52f('0x12')][_0xb52f('0x14')]);return _0x37a3b3(_0x179296[_0xb52f('0x12')]['message']);}else{logger['info'](_0xb52f('0xd'),_0x2a6134,_0xb52f('0x10'));_0x37a3b3(_0x179296['result'][_0xb52f('0x14')]);}})[_0xb52f('0x15')](function(_0x18f886){logger[_0xb52f('0x12')](_0xb52f('0xd'),_0x2a6134,_0x18f886);_0x3d91b8(_0x18f886);});});}exports[_0xb52f('0x16')]=function(_0x5b2417){var _0x157ac1=this;return new Promise(function(_0x5c9cb6,_0x3ab6f1){return db[_0xb52f('0x17')]['create'](_0x5b2417[_0xb52f('0x18')],{'raw':_0x5b2417['options']?_0x5b2417[_0xb52f('0x19')][_0xb52f('0x1a')]===undefined?!![]:![]:!![]})[_0xb52f('0xb')](function(_0x2b23c4){logger[_0xb52f('0xc')](_0xb52f('0x16'),_0x5b2417);logger[_0xb52f('0xe')](_0xb52f('0x16'),_0x5b2417,JSON['stringify'](_0x2b23c4));_0x5c9cb6(_0x2b23c4);})[_0xb52f('0x15')](function(_0x198faf){logger[_0xb52f('0x12')]('CreateChatQueueReport',_0x198faf[_0xb52f('0x14')],_0x5b2417);_0x3ab6f1(_0x157ac1[_0xb52f('0x12')](0x1f4,_0x198faf[_0xb52f('0x14')]));});});};exports[_0xb52f('0x1b')]=function(_0x36341a){var _0x788d3e=this;return new Promise(function(_0x56c318,_0x16ecfa){return db[_0xb52f('0x17')][_0xb52f('0x1c')](_0x36341a[_0xb52f('0x18')],{'raw':_0x36341a[_0xb52f('0x19')]?_0x36341a[_0xb52f('0x19')][_0xb52f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36341a[_0xb52f('0x19')]?_0x36341a['options'][_0xb52f('0x1d')]||null:null,'attributes':_0x36341a['options']?_0x36341a[_0xb52f('0x19')]['attributes']||null:null,'limit':_0x36341a[_0xb52f('0x19')]?_0x36341a[_0xb52f('0x19')][_0xb52f('0x1e')]||null:null})['then'](function(_0x3ffc97){logger['info'](_0xb52f('0x1b'),_0x36341a);logger['debug'](_0xb52f('0x1b'),_0x36341a,JSON[_0xb52f('0x11')](_0x3ffc97));_0x56c318(_0x3ffc97);})[_0xb52f('0x15')](function(_0x2aee08){logger[_0xb52f('0x12')](_0xb52f('0x1b'),_0x2aee08[_0xb52f('0x14')],_0x36341a);_0x16ecfa(_0x788d3e['error'](0x1f4,_0x2aee08['message']));});});}; \ No newline at end of file +var _0x1c35=['create','body','options','raw','catch','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport'];(function(_0x3ca5b0,_0x33b572){var _0x507349=function(_0x378368){while(--_0x378368){_0x3ca5b0['push'](_0x3ca5b0['shift']());}};_0x507349(++_0x33b572);}(_0x1c35,0x6e));var _0x51c3=function(_0x12c8a8,_0x39a592){_0x12c8a8=_0x12c8a8-0x0;var _0x371934=_0x1c35[_0x12c8a8];return _0x371934;};'use strict';var _=require('lodash');var util=require(_0x51c3('0x0'));var moment=require(_0x51c3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51c3('0x2'));var db=require(_0x51c3('0x3'))['db'];var utils=require(_0x51c3('0x4'));var logger=require(_0x51c3('0x5'))(_0x51c3('0x6'));var config=require('../../config/environment');var jayson=require(_0x51c3('0x7'));var client=jayson['client'][_0x51c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xeba811,_0x5bfaae,_0x1e2582){return new BPromise(function(_0x5d6174,_0x3d3424){return client[_0x51c3('0x9')](_0xeba811,_0x1e2582)[_0x51c3('0xa')](function(_0x270429){logger[_0x51c3('0xb')](_0x51c3('0xc'),_0x5bfaae,_0x51c3('0xd'));logger[_0x51c3('0xe')](_0x51c3('0xf'),_0x5bfaae,_0x51c3('0xd'),JSON[_0x51c3('0x10')](_0x270429));if(_0x270429[_0x51c3('0x11')]){if(_0x270429['error'][_0x51c3('0x12')]===0x1f4){logger[_0x51c3('0x11')](_0x51c3('0xc'),_0x5bfaae,_0x270429['error']['message']);return _0x3d3424(_0x270429[_0x51c3('0x11')][_0x51c3('0x13')]);}logger[_0x51c3('0x11')](_0x51c3('0xc'),_0x5bfaae,_0x270429[_0x51c3('0x11')]['message']);return _0x5d6174(_0x270429[_0x51c3('0x11')][_0x51c3('0x13')]);}else{logger[_0x51c3('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x5bfaae,_0x51c3('0xd'));_0x5d6174(_0x270429[_0x51c3('0x14')][_0x51c3('0x13')]);}})['catch'](function(_0x2fd1d6){logger[_0x51c3('0x11')](_0x51c3('0xc'),_0x5bfaae,_0x2fd1d6);_0x3d3424(_0x2fd1d6);});});}exports[_0x51c3('0x15')]=function(_0x294cbc){var _0xd0cbcb=this;return new Promise(function(_0x5a08cf,_0x31c82c){return db['ChatQueueReport'][_0x51c3('0x16')](_0x294cbc[_0x51c3('0x17')],{'raw':_0x294cbc['options']?_0x294cbc[_0x51c3('0x18')][_0x51c3('0x19')]===undefined?!![]:![]:!![]})[_0x51c3('0xa')](function(_0x23216d){logger[_0x51c3('0xb')]('CreateChatQueueReport',_0x294cbc);logger[_0x51c3('0xe')]('CreateChatQueueReport',_0x294cbc,JSON['stringify'](_0x23216d));_0x5a08cf(_0x23216d);})[_0x51c3('0x1a')](function(_0x1d7289){logger['error'](_0x51c3('0x15'),_0x1d7289['message'],_0x294cbc);_0x31c82c(_0xd0cbcb[_0x51c3('0x11')](0x1f4,_0x1d7289['message']));});});};exports[_0x51c3('0x1b')]=function(_0x1113e7){var _0x30b311=this;return new Promise(function(_0x400165,_0x975dc4){return db[_0x51c3('0x1c')][_0x51c3('0x1d')](_0x1113e7[_0x51c3('0x17')],{'raw':_0x1113e7['options']?_0x1113e7[_0x51c3('0x18')][_0x51c3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1113e7['options']?_0x1113e7['options'][_0x51c3('0x1e')]||null:null,'attributes':_0x1113e7[_0x51c3('0x18')]?_0x1113e7[_0x51c3('0x18')][_0x51c3('0x1f')]||null:null,'limit':_0x1113e7[_0x51c3('0x18')]?_0x1113e7[_0x51c3('0x18')][_0x51c3('0x20')]||null:null})['then'](function(_0x12b96c){logger[_0x51c3('0xb')](_0x51c3('0x1b'),_0x1113e7);logger[_0x51c3('0xe')](_0x51c3('0x1b'),_0x1113e7,JSON['stringify'](_0x12b96c));_0x400165(_0x12b96c);})[_0x51c3('0x1a')](function(_0x228e40){logger['error'](_0x51c3('0x1b'),_0x228e40[_0x51c3('0x13')],_0x1113e7);_0x975dc4(_0x30b311['error'](0x1f4,_0x228e40[_0x51c3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 9889d5c..0cd83e5 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 _0xd4de=['delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','put','/:id','update'];(function(_0x582021,_0x548882){var _0x2be373=function(_0x53c301){while(--_0x53c301){_0x582021['push'](_0x582021['shift']());}};_0x2be373(++_0x548882);}(_0xd4de,0x10f));var _0xed4d=function(_0x37fcc3,_0x24652f){_0x37fcc3=_0x37fcc3-0x0;var _0x35e707=_0xd4de[_0x37fcc3];return _0x35e707;};'use strict';var multer=require(_0xed4d('0x0'));var util=require(_0xed4d('0x1'));var path=require(_0xed4d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xed4d('0x3')]();var fs_extra=require(_0xed4d('0x4'));var auth=require(_0xed4d('0x5'));var interaction=require(_0xed4d('0x6'));var config=require(_0xed4d('0x7'));var controller=require('./chatQueueReport.controller');router[_0xed4d('0x8')]('/',auth[_0xed4d('0x9')](),controller['index']);router[_0xed4d('0x8')]('/describe',auth[_0xed4d('0x9')](),controller['describe']);router[_0xed4d('0x8')]('/:id',auth[_0xed4d('0x9')](),controller['show']);router[_0xed4d('0xa')]('/',auth[_0xed4d('0x9')](),controller['create']);router[_0xed4d('0xb')](_0xed4d('0xc'),auth[_0xed4d('0x9')](),controller[_0xed4d('0xd')]);router[_0xed4d('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe151=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xb12603,_0x142505){var _0x2bdc24=function(_0x5dca90){while(--_0x5dca90){_0xb12603['push'](_0xb12603['shift']());}};_0x2bdc24(++_0x142505);}(_0xe151,0x119));var _0x1e15=function(_0x4ba8c3,_0x33c457){_0x4ba8c3=_0x4ba8c3-0x0;var _0xf65364=_0xe151[_0x4ba8c3];return _0xf65364;};'use strict';var multer=require(_0x1e15('0x0'));var util=require(_0x1e15('0x1'));var path=require(_0x1e15('0x2'));var timeout=require(_0x1e15('0x3'));var express=require(_0x1e15('0x4'));var router=express[_0x1e15('0x5')]();var fs_extra=require(_0x1e15('0x6'));var auth=require(_0x1e15('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x1e15('0x8')]('/',auth[_0x1e15('0x9')](),controller[_0x1e15('0xa')]);router[_0x1e15('0x8')](_0x1e15('0xb'),auth[_0x1e15('0x9')](),controller[_0x1e15('0xc')]);router[_0x1e15('0x8')](_0x1e15('0xd'),auth[_0x1e15('0x9')](),controller[_0x1e15('0xe')]);router[_0x1e15('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e15('0x10')]);router[_0x1e15('0x11')](_0x1e15('0xd'),auth[_0x1e15('0x9')](),controller[_0x1e15('0x12')]);router[_0x1e15('0x13')](_0x1e15('0xd'),auth[_0x1e15('0x9')](),controller[_0x1e15('0x14')]);module[_0x1e15('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index c356616..7e733d2 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x55205c,_0x27b46b){var _0x575bd7=function(_0x351603){while(--_0x351603){_0x55205c['push'](_0x55205c['shift']());}};_0x575bd7(++_0x27b46b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x00bb[_0x5447fd];return _0x15b28a;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x30af23,_0x1b9d6a){var _0x5cea96=function(_0x31be06){while(--_0x31be06){_0x30af23['push'](_0x30af23['shift']());}};_0x5cea96(++_0x1b9d6a);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index b30c6cb..42a8c2b 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 _0x43cf=['jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','includeAll','include','rows','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','ejs','squel','crypto'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x43cf,0x1a6));var _0xf43c=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x43cf[_0x277af0];return _0x43bd7c;};'use strict';var emlformat=require(_0xf43c('0x0'));var rimraf=require(_0xf43c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf43c('0x2'));var rp=require('request-promise');var moment=require(_0xf43c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf43c('0x4'));var util=require(_0xf43c('0x5'));var path=require(_0xf43c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf43c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf43c('0x8'));var crypto=require(_0xf43c('0x9'));var jsforce=require(_0xf43c('0xa'));var deskjs=require(_0xf43c('0xb'));var toCsv=require(_0xf43c('0xc'));var querystring=require(_0xf43c('0xd'));var Papa=require('papaparse');var Redis=require(_0xf43c('0xe'));var authService=require(_0xf43c('0xf'));var qs=require(_0xf43c('0x10'));var as=require(_0xf43c('0x11'));var hardwareService=require(_0xf43c('0x12'));var logger=require(_0xf43c('0x13'))(_0xf43c('0x14'));var utils=require(_0xf43c('0x15'));var config=require(_0xf43c('0x16'));var licenseUtil=require(_0xf43c('0x17'));var db=require(_0xf43c('0x18'))['db'];function respondWithStatusCode(_0x8f32fb,_0x2d3111){_0x2d3111=_0x2d3111||0xcc;return function(_0x4754eb){if(_0x4754eb){return _0x8f32fb['sendStatus'](_0x2d3111);}return _0x8f32fb[_0xf43c('0x19')](_0x2d3111)[_0xf43c('0x1a')]();};}function respondWithResult(_0x59e8ca,_0x23ae74){_0x23ae74=_0x23ae74||0xc8;return function(_0x1a6b35){if(_0x1a6b35){return _0x59e8ca[_0xf43c('0x19')](_0x23ae74)[_0xf43c('0x1b')](_0x1a6b35);}};}function respondWithFilteredResult(_0x5638f3,_0x4379b4){return function(_0x106ace){if(_0x106ace){var _0x1fc0b1=typeof _0x4379b4[_0xf43c('0x1c')]===_0xf43c('0x1d')&&typeof _0x4379b4['limit']===_0xf43c('0x1d');var _0x5edf1f=_0x106ace['count'];var _0x4e132c=_0x1fc0b1?0x0:_0x4379b4[_0xf43c('0x1c')];var _0x568e23=_0x1fc0b1?_0x106ace[_0xf43c('0x1e')]:_0x4379b4['offset']+_0x4379b4[_0xf43c('0x1f')];var _0x36c117;if(_0x568e23>=_0x5edf1f){_0x568e23=_0x5edf1f;_0x36c117=0xc8;}else{_0x36c117=0xce;}_0x5638f3['status'](_0x36c117);return _0x5638f3[_0xf43c('0x20')]('Content-Range',_0x4e132c+'-'+_0x568e23+'/'+_0x5edf1f)[_0xf43c('0x1b')](_0x106ace);}return null;};}function patchUpdates(_0x2e9fc2){return function(_0x107dc4){try{jsonpatch[_0xf43c('0x21')](_0x107dc4,_0x2e9fc2,!![]);}catch(_0x4b51f5){return BPromise[_0xf43c('0x22')](_0x4b51f5);}return _0x107dc4[_0xf43c('0x23')]();};}function saveUpdates(_0x418cd9,_0x593476){return function(_0x5192c3){if(_0x5192c3){return _0x5192c3[_0xf43c('0x24')](_0x418cd9)[_0xf43c('0x25')](function(_0x1d47fd){return _0x1d47fd;});}return null;};}function removeEntity(_0x2765de,_0x551379){return function(_0x18560f){if(_0x18560f){return _0x18560f['destroy']()[_0xf43c('0x25')](function(){_0x2765de[_0xf43c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x305115,_0x5dc1b5){return function(_0x4d8705){if(!_0x4d8705){_0x305115[_0xf43c('0x26')](0x194);}return _0x4d8705;};}function handleError(_0x2406ab,_0x43ff09){_0x43ff09=_0x43ff09||0x1f4;return function(_0x17cbd7){logger['error'](_0x17cbd7[_0xf43c('0x27')]);if(_0x17cbd7[_0xf43c('0x28')]){delete _0x17cbd7['name'];}_0x2406ab[_0xf43c('0x19')](_0x43ff09)[_0xf43c('0x29')](_0x17cbd7);};}exports[_0xf43c('0x2a')]=function(_0x11dbf2,_0x2970b6){var _0x38fafc={},_0x3aad73={},_0x52ca36={'count':0x0,'rows':[]};var _0x10ad27=_[_0xf43c('0x2b')](db[_0xf43c('0x2c')][_0xf43c('0x2d')],function(_0x257cdf){return{'name':_0x257cdf['fieldName'],'type':_0x257cdf['type']['key']};});_0x3aad73[_0xf43c('0x2e')]=_['map'](_0x10ad27,'name');_0x3aad73[_0xf43c('0x2f')]=_['keys'](_0x11dbf2['query']);_0x3aad73[_0xf43c('0x30')]=_[_0xf43c('0x31')](_0x3aad73[_0xf43c('0x2e')],_0x3aad73['query']);_0x38fafc[_0xf43c('0x32')]=_[_0xf43c('0x31')](_0x3aad73[_0xf43c('0x2e')],qs['fields'](_0x11dbf2[_0xf43c('0x2f')][_0xf43c('0x33')]));_0x38fafc[_0xf43c('0x32')]=_0x38fafc['attributes'][_0xf43c('0x34')]?_0x38fafc[_0xf43c('0x32')]:_0x3aad73[_0xf43c('0x2e')];if(!_0x11dbf2[_0xf43c('0x2f')][_0xf43c('0x35')]('nolimit')){_0x38fafc['limit']=qs[_0xf43c('0x1f')](_0x11dbf2[_0xf43c('0x2f')][_0xf43c('0x1f')]);_0x38fafc['offset']=qs[_0xf43c('0x1c')](_0x11dbf2[_0xf43c('0x2f')][_0xf43c('0x1c')]);}_0x38fafc[_0xf43c('0x36')]=qs['sort'](_0x11dbf2['query']['sort']);_0x38fafc[_0xf43c('0x37')]=qs['filters'](_[_0xf43c('0x38')](_0x11dbf2['query'],_0x3aad73[_0xf43c('0x30')]),_0x10ad27);if(_0x11dbf2[_0xf43c('0x2f')][_0xf43c('0x39')]){_0x38fafc['where']=_[_0xf43c('0x3a')](_0x38fafc[_0xf43c('0x37')],{'$or':_[_0xf43c('0x2b')](_0x10ad27,function(_0x38e690){if(_0x38e690[_0xf43c('0x3b')]!=='VIRTUAL'){var _0x5929e9={};_0x5929e9[_0x38e690[_0xf43c('0x28')]]={'$like':'%'+_0x11dbf2['query'][_0xf43c('0x39')]+'%'};return _0x5929e9;}})});}_0x38fafc=_['merge']({},_0x38fafc,_0x11dbf2['options']);var _0xbd69ce={'where':_0x38fafc[_0xf43c('0x37')]};return db['ChatTransferReport']['count'](_0xbd69ce)[_0xf43c('0x25')](function(_0x5bf14d){_0x52ca36[_0xf43c('0x1e')]=_0x5bf14d;if(_0x11dbf2['query'][_0xf43c('0x3c')]){_0x38fafc[_0xf43c('0x3d')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x38fafc);})['then'](function(_0x48dec5){_0x52ca36[_0xf43c('0x3e')]=_0x48dec5;return _0x52ca36;})['then'](respondWithFilteredResult(_0x2970b6,_0x38fafc))[_0xf43c('0x3f')](handleError(_0x2970b6,null));};exports[_0xf43c('0x40')]=function(_0x3d2102,_0x5b01ae){var _0x41e928={'raw':!![],'where':{'id':_0x3d2102[_0xf43c('0x41')]['id']}},_0x495efb={};_0x495efb[_0xf43c('0x2e')]=_[_0xf43c('0x42')](db[_0xf43c('0x2c')]['rawAttributes']);_0x495efb[_0xf43c('0x2f')]=_[_0xf43c('0x42')](_0x3d2102[_0xf43c('0x2f')]);_0x495efb[_0xf43c('0x30')]=_[_0xf43c('0x31')](_0x495efb['model'],_0x495efb['query']);_0x41e928[_0xf43c('0x32')]=_[_0xf43c('0x31')](_0x495efb['model'],qs[_0xf43c('0x33')](_0x3d2102[_0xf43c('0x2f')]['fields']));_0x41e928[_0xf43c('0x32')]=_0x41e928[_0xf43c('0x32')][_0xf43c('0x34')]?_0x41e928[_0xf43c('0x32')]:_0x495efb[_0xf43c('0x2e')];if(_0x3d2102['query'][_0xf43c('0x3c')]){_0x41e928['include']=[{'all':!![]}];}_0x41e928=_[_0xf43c('0x3a')]({},_0x41e928,_0x3d2102['options']);return db[_0xf43c('0x2c')]['find'](_0x41e928)[_0xf43c('0x25')](handleEntityNotFound(_0x5b01ae,null))[_0xf43c('0x25')](respondWithResult(_0x5b01ae,null))[_0xf43c('0x3f')](handleError(_0x5b01ae,null));};exports['create']=function(_0x57dbf1,_0x223e4f){return db[_0xf43c('0x2c')][_0xf43c('0x43')](_0x57dbf1[_0xf43c('0x44')],{})[_0xf43c('0x25')](respondWithResult(_0x223e4f,0xc9))[_0xf43c('0x3f')](handleError(_0x223e4f,null));};exports[_0xf43c('0x24')]=function(_0x46703a,_0x482e58){if(_0x46703a[_0xf43c('0x44')]['id']){delete _0x46703a[_0xf43c('0x44')]['id'];}return db[_0xf43c('0x2c')][_0xf43c('0x45')]({'where':{'id':_0x46703a['params']['id']}})[_0xf43c('0x25')](handleEntityNotFound(_0x482e58,null))['then'](saveUpdates(_0x46703a['body'],null))[_0xf43c('0x25')](respondWithResult(_0x482e58,null))['catch'](handleError(_0x482e58,null));};exports[_0xf43c('0x46')]=function(_0x201c68,_0x42020d){return db[_0xf43c('0x2c')][_0xf43c('0x45')]({'where':{'id':_0x201c68[_0xf43c('0x41')]['id']}})[_0xf43c('0x25')](handleEntityNotFound(_0x42020d,null))[_0xf43c('0x25')](removeEntity(_0x42020d,null))[_0xf43c('0x3f')](handleError(_0x42020d,null));};exports[_0xf43c('0x47')]=function(_0xced55a,_0x2446de){return db[_0xf43c('0x2c')][_0xf43c('0x47')]()['then'](respondWithResult(_0x2446de,null))['catch'](handleError(_0x2446de,null));}; \ No newline at end of file +var _0xdaf3=['ChatTransferReport','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','map'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdaf3,0x14c));var _0x3daf=function(_0x64b210,_0x301877){_0x64b210=_0x64b210-0x0;var _0x232a2b=_0xdaf3[_0x64b210];return _0x232a2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3daf('0x0'));var jsonpatch=require(_0x3daf('0x1'));var rp=require(_0x3daf('0x2'));var moment=require(_0x3daf('0x3'));var BPromise=require(_0x3daf('0x4'));var Mustache=require(_0x3daf('0x5'));var util=require(_0x3daf('0x6'));var path=require(_0x3daf('0x7'));var sox=require(_0x3daf('0x8'));var csv=require(_0x3daf('0x9'));var ejs=require(_0x3daf('0xa'));var fs=require('fs');var fs_extra=require(_0x3daf('0xb'));var _=require('lodash');var squel=require(_0x3daf('0xc'));var crypto=require('crypto');var jsforce=require(_0x3daf('0xd'));var deskjs=require(_0x3daf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3daf('0xf'));var Papa=require(_0x3daf('0x10'));var Redis=require(_0x3daf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3daf('0x12'));var as=require(_0x3daf('0x13'));var hardwareService=require(_0x3daf('0x14'));var logger=require('../../config/logger')(_0x3daf('0x15'));var utils=require('../../config/utils');var config=require(_0x3daf('0x16'));var licenseUtil=require(_0x3daf('0x17'));var db=require(_0x3daf('0x18'))['db'];function respondWithStatusCode(_0x21d46b,_0x258697){_0x258697=_0x258697||0xcc;return function(_0xdd1ccf){if(_0xdd1ccf){return _0x21d46b[_0x3daf('0x19')](_0x258697);}return _0x21d46b['status'](_0x258697)['end']();};}function respondWithResult(_0x382948,_0x536821){_0x536821=_0x536821||0xc8;return function(_0x1b002b){if(_0x1b002b){return _0x382948[_0x3daf('0x1a')](_0x536821)[_0x3daf('0x1b')](_0x1b002b);}};}function respondWithFilteredResult(_0x5d66f4,_0x3c30e0){return function(_0x40db3a){if(_0x40db3a){var _0x580813=typeof _0x3c30e0['offset']===_0x3daf('0x1c')&&typeof _0x3c30e0['limit']===_0x3daf('0x1c');var _0x320eb3=_0x40db3a[_0x3daf('0x1d')];var _0x2a5932=_0x580813?0x0:_0x3c30e0[_0x3daf('0x1e')];var _0x5d6179=_0x580813?_0x40db3a[_0x3daf('0x1d')]:_0x3c30e0['offset']+_0x3c30e0['limit'];var _0x3216c5;if(_0x5d6179>=_0x320eb3){_0x5d6179=_0x320eb3;_0x3216c5=0xc8;}else{_0x3216c5=0xce;}_0x5d66f4[_0x3daf('0x1a')](_0x3216c5);return _0x5d66f4[_0x3daf('0x1f')](_0x3daf('0x20'),_0x2a5932+'-'+_0x5d6179+'/'+_0x320eb3)[_0x3daf('0x1b')](_0x40db3a);}return null;};}function patchUpdates(_0x3ccebd){return function(_0x12830){try{jsonpatch['apply'](_0x12830,_0x3ccebd,!![]);}catch(_0x4e29aa){return BPromise[_0x3daf('0x21')](_0x4e29aa);}return _0x12830['save']();};}function saveUpdates(_0x1cf58a,_0x196a27){return function(_0x24ed5e){if(_0x24ed5e){return _0x24ed5e[_0x3daf('0x22')](_0x1cf58a)[_0x3daf('0x23')](function(_0x4e943e){return _0x4e943e;});}return null;};}function removeEntity(_0x5cea77,_0x39abc3){return function(_0xbadec3){if(_0xbadec3){return _0xbadec3[_0x3daf('0x24')]()[_0x3daf('0x23')](function(){_0x5cea77[_0x3daf('0x1a')](0xcc)[_0x3daf('0x25')]();});}};}function handleEntityNotFound(_0x3e3fb0,_0x332704){return function(_0x17fcae){if(!_0x17fcae){_0x3e3fb0[_0x3daf('0x19')](0x194);}return _0x17fcae;};}function handleError(_0x198a24,_0x15a3be){_0x15a3be=_0x15a3be||0x1f4;return function(_0x34b6a2){logger[_0x3daf('0x26')](_0x34b6a2[_0x3daf('0x27')]);if(_0x34b6a2[_0x3daf('0x28')]){delete _0x34b6a2[_0x3daf('0x28')];}_0x198a24['status'](_0x15a3be)[_0x3daf('0x29')](_0x34b6a2);};}exports['index']=function(_0x3c471c,_0x578d5d){var _0x2e2a05={},_0x21d165={},_0x29606c={'count':0x0,'rows':[]};var _0x3d4108=_[_0x3daf('0x2a')](db[_0x3daf('0x2b')][_0x3daf('0x2c')],function(_0x56cb1f){return{'name':_0x56cb1f['fieldName'],'type':_0x56cb1f[_0x3daf('0x2d')]['key']};});_0x21d165[_0x3daf('0x2e')]=_[_0x3daf('0x2a')](_0x3d4108,'name');_0x21d165[_0x3daf('0x2f')]=_['keys'](_0x3c471c['query']);_0x21d165[_0x3daf('0x30')]=_[_0x3daf('0x31')](_0x21d165[_0x3daf('0x2e')],_0x21d165[_0x3daf('0x2f')]);_0x2e2a05[_0x3daf('0x32')]=_[_0x3daf('0x31')](_0x21d165[_0x3daf('0x2e')],qs[_0x3daf('0x33')](_0x3c471c['query'][_0x3daf('0x33')]));_0x2e2a05[_0x3daf('0x32')]=_0x2e2a05[_0x3daf('0x32')][_0x3daf('0x34')]?_0x2e2a05[_0x3daf('0x32')]:_0x21d165[_0x3daf('0x2e')];if(!_0x3c471c[_0x3daf('0x2f')][_0x3daf('0x35')]('nolimit')){_0x2e2a05[_0x3daf('0x36')]=qs[_0x3daf('0x36')](_0x3c471c[_0x3daf('0x2f')][_0x3daf('0x36')]);_0x2e2a05['offset']=qs[_0x3daf('0x1e')](_0x3c471c[_0x3daf('0x2f')]['offset']);}_0x2e2a05[_0x3daf('0x37')]=qs[_0x3daf('0x38')](_0x3c471c[_0x3daf('0x2f')][_0x3daf('0x38')]);_0x2e2a05[_0x3daf('0x39')]=qs[_0x3daf('0x30')](_[_0x3daf('0x3a')](_0x3c471c[_0x3daf('0x2f')],_0x21d165[_0x3daf('0x30')]),_0x3d4108);if(_0x3c471c['query']['filter']){_0x2e2a05[_0x3daf('0x39')]=_[_0x3daf('0x3b')](_0x2e2a05[_0x3daf('0x39')],{'$or':_[_0x3daf('0x2a')](_0x3d4108,function(_0x3c1192){if(_0x3c1192['type']!==_0x3daf('0x3c')){var _0x1a6418={};_0x1a6418[_0x3c1192[_0x3daf('0x28')]]={'$like':'%'+_0x3c471c[_0x3daf('0x2f')][_0x3daf('0x3d')]+'%'};return _0x1a6418;}})});}_0x2e2a05=_['merge']({},_0x2e2a05,_0x3c471c[_0x3daf('0x3e')]);var _0x5d44af={'where':_0x2e2a05[_0x3daf('0x39')]};return db[_0x3daf('0x2b')][_0x3daf('0x1d')](_0x5d44af)[_0x3daf('0x23')](function(_0x14b038){_0x29606c['count']=_0x14b038;if(_0x3c471c[_0x3daf('0x2f')][_0x3daf('0x3f')]){_0x2e2a05[_0x3daf('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x3daf('0x41')](_0x2e2a05);})[_0x3daf('0x23')](function(_0x39b445){_0x29606c[_0x3daf('0x42')]=_0x39b445;return _0x29606c;})[_0x3daf('0x23')](respondWithFilteredResult(_0x578d5d,_0x2e2a05))[_0x3daf('0x43')](handleError(_0x578d5d,null));};exports[_0x3daf('0x44')]=function(_0x55cece,_0x1b7276){var _0x5a79bd={'raw':!![],'where':{'id':_0x55cece[_0x3daf('0x45')]['id']}},_0x554f75={};_0x554f75[_0x3daf('0x2e')]=_['keys'](db[_0x3daf('0x2b')][_0x3daf('0x2c')]);_0x554f75['query']=_[_0x3daf('0x46')](_0x55cece[_0x3daf('0x2f')]);_0x554f75['filters']=_[_0x3daf('0x31')](_0x554f75[_0x3daf('0x2e')],_0x554f75[_0x3daf('0x2f')]);_0x5a79bd[_0x3daf('0x32')]=_[_0x3daf('0x31')](_0x554f75[_0x3daf('0x2e')],qs['fields'](_0x55cece[_0x3daf('0x2f')]['fields']));_0x5a79bd[_0x3daf('0x32')]=_0x5a79bd['attributes'][_0x3daf('0x34')]?_0x5a79bd[_0x3daf('0x32')]:_0x554f75[_0x3daf('0x2e')];if(_0x55cece[_0x3daf('0x2f')][_0x3daf('0x3f')]){_0x5a79bd[_0x3daf('0x40')]=[{'all':!![]}];}_0x5a79bd=_[_0x3daf('0x3b')]({},_0x5a79bd,_0x55cece[_0x3daf('0x3e')]);return db['ChatTransferReport'][_0x3daf('0x47')](_0x5a79bd)[_0x3daf('0x23')](handleEntityNotFound(_0x1b7276,null))[_0x3daf('0x23')](respondWithResult(_0x1b7276,null))['catch'](handleError(_0x1b7276,null));};exports['create']=function(_0x103231,_0x417cdb){return db[_0x3daf('0x2b')][_0x3daf('0x48')](_0x103231[_0x3daf('0x49')],{})[_0x3daf('0x23')](respondWithResult(_0x417cdb,0xc9))[_0x3daf('0x43')](handleError(_0x417cdb,null));};exports[_0x3daf('0x22')]=function(_0x71ccec,_0x544c56){if(_0x71ccec[_0x3daf('0x49')]['id']){delete _0x71ccec[_0x3daf('0x49')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x71ccec['params']['id']}})[_0x3daf('0x23')](handleEntityNotFound(_0x544c56,null))[_0x3daf('0x23')](saveUpdates(_0x71ccec['body'],null))[_0x3daf('0x23')](respondWithResult(_0x544c56,null))[_0x3daf('0x43')](handleError(_0x544c56,null));};exports[_0x3daf('0x24')]=function(_0x30fd3b,_0x22d2ef){return db[_0x3daf('0x2b')][_0x3daf('0x47')]({'where':{'id':_0x30fd3b['params']['id']}})[_0x3daf('0x23')](handleEntityNotFound(_0x22d2ef,null))['then'](removeEntity(_0x22d2ef,null))[_0x3daf('0x43')](handleError(_0x22d2ef,null));};exports[_0x3daf('0x4a')]=function(_0x4e0cdd,_0x311b00){return db[_0x3daf('0x2b')][_0x3daf('0x4a')]()[_0x3daf('0x23')](respondWithResult(_0x311b00,null))[_0x3daf('0x43')](handleError(_0x311b00,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d439d7d..bb20fa0 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 _0x5d39=['path','rimraf','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x4f4753,_0x416a1a){var _0x129536=function(_0x4f37ec){while(--_0x4f37ec){_0x4f4753['push'](_0x4f4753['shift']());}};_0x129536(++_0x416a1a);}(_0x5d39,0x104));var _0x95d3=function(_0x589446,_0xd0c66b){_0x589446=_0x589446-0x0;var _0x5ac82d=_0x5d39[_0x589446];return _0x5ac82d;};'use strict';var _=require(_0x95d3('0x0'));var util=require(_0x95d3('0x1'));var logger=require(_0x95d3('0x2'))('api');var moment=require(_0x95d3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95d3('0x4'));var rimraf=require(_0x95d3('0x5'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x95d3('0x6')]=function(_0x45925a,_0x1126c4){return _0x45925a[_0x95d3('0x7')](_0x95d3('0x8'),attributes,{'tableName':_0x95d3('0x9'),'paranoid':![],'indexes':[{'name':_0x95d3('0xa'),'fields':[_0x95d3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa681=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer'];(function(_0x4a4e43,_0x52c12e){var _0x50d528=function(_0x3a2761){while(--_0x3a2761){_0x4a4e43['push'](_0x4a4e43['shift']());}};_0x50d528(++_0x52c12e);}(_0xa681,0xb7));var _0x1a68=function(_0xb3f597,_0x37d9af){_0xb3f597=_0xb3f597-0x0;var _0x3c7930=_0xa681[_0xb3f597];return _0x3c7930;};'use strict';var _=require(_0x1a68('0x0'));var util=require(_0x1a68('0x1'));var logger=require(_0x1a68('0x2'))(_0x1a68('0x3'));var moment=require('moment');var BPromise=require(_0x1a68('0x4'));var rp=require(_0x1a68('0x5'));var fs=require('fs');var path=require(_0x1a68('0x6'));var rimraf=require(_0x1a68('0x7'));var config=require('../../config/environment');var attributes=require(_0x1a68('0x8'));module['exports']=function(_0x43529a,_0x277a5f){return _0x43529a[_0x1a68('0x9')](_0x1a68('0xa'),attributes,{'tableName':_0x1a68('0xb'),'paranoid':![],'indexes':[{'name':_0x1a68('0xc'),'fields':[_0x1a68('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 38d9277..e75d66b 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 _0xb916=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2f1ac4,_0x236a72){var _0x18e1a5=function(_0x18f34b){while(--_0x18f34b){_0x2f1ac4['push'](_0x2f1ac4['shift']());}};_0x18e1a5(++_0x236a72);}(_0xb916,0xa8));var _0x6b91=function(_0x3adde2,_0x3062c3){_0x3adde2=_0x3adde2-0x0;var _0xd3726d=_0xb916[_0x3adde2];return _0xd3726d;};'use strict';var _=require(_0x6b91('0x0'));var util=require(_0x6b91('0x1'));var moment=require('moment');var BPromise=require(_0x6b91('0x2'));var rs=require(_0x6b91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6b91('0x4'))(_0x6b91('0x5'));var config=require('../../config/environment');var jayson=require(_0x6b91('0x6'));var client=jayson[_0x6b91('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a869,_0x36044b,_0x473760){return new BPromise(function(_0x4bd870,_0x812312){return client['request'](_0x12a869,_0x473760)[_0x6b91('0x8')](function(_0x458535){logger['info'](_0x6b91('0x9'),_0x36044b,_0x6b91('0xa'));logger[_0x6b91('0xb')](_0x6b91('0xc'),_0x36044b,'request\x20sent',JSON[_0x6b91('0xd')](_0x458535));if(_0x458535[_0x6b91('0xe')]){if(_0x458535[_0x6b91('0xe')][_0x6b91('0xf')]===0x1f4){logger[_0x6b91('0xe')](_0x6b91('0x9'),_0x36044b,_0x458535['error'][_0x6b91('0x10')]);return _0x812312(_0x458535[_0x6b91('0xe')][_0x6b91('0x10')]);}logger[_0x6b91('0xe')](_0x6b91('0x9'),_0x36044b,_0x458535[_0x6b91('0xe')][_0x6b91('0x10')]);return _0x4bd870(_0x458535[_0x6b91('0xe')][_0x6b91('0x10')]);}else{logger[_0x6b91('0x11')](_0x6b91('0x9'),_0x36044b,_0x6b91('0xa'));_0x4bd870(_0x458535[_0x6b91('0x12')][_0x6b91('0x10')]);}})[_0x6b91('0x13')](function(_0x3538d0){logger[_0x6b91('0xe')](_0x6b91('0x9'),_0x36044b,_0x3538d0);_0x812312(_0x3538d0);});});} \ No newline at end of file +var _0x05a0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0x05a0,0x14c));var _0x005a=function(_0x19ea86,_0x3de44e){_0x19ea86=_0x19ea86-0x0;var _0x197768=_0x05a0[_0x19ea86];return _0x197768;};'use strict';var _=require('lodash');var util=require(_0x005a('0x0'));var moment=require(_0x005a('0x1'));var BPromise=require('bluebird');var rs=require(_0x005a('0x2'));var fs=require('fs');var Redis=require(_0x005a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x005a('0x4'));var logger=require('../../config/logger')(_0x005a('0x5'));var config=require(_0x005a('0x6'));var jayson=require(_0x005a('0x7'));var client=jayson[_0x005a('0x8')][_0x005a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445ae5,_0x1aad71,_0x1659ab){return new BPromise(function(_0x10027f,_0x2af7fe){return client['request'](_0x445ae5,_0x1659ab)[_0x005a('0xa')](function(_0x53474e){logger[_0x005a('0xb')](_0x005a('0xc'),_0x1aad71,_0x005a('0xd'));logger['debug'](_0x005a('0xe'),_0x1aad71,_0x005a('0xd'),JSON[_0x005a('0xf')](_0x53474e));if(_0x53474e[_0x005a('0x10')]){if(_0x53474e[_0x005a('0x10')][_0x005a('0x11')]===0x1f4){logger[_0x005a('0x10')](_0x005a('0xc'),_0x1aad71,_0x53474e[_0x005a('0x10')][_0x005a('0x12')]);return _0x2af7fe(_0x53474e[_0x005a('0x10')]['message']);}logger[_0x005a('0x10')](_0x005a('0xc'),_0x1aad71,_0x53474e[_0x005a('0x10')]['message']);return _0x10027f(_0x53474e[_0x005a('0x10')][_0x005a('0x12')]);}else{logger['info'](_0x005a('0xc'),_0x1aad71,_0x005a('0xd'));_0x10027f(_0x53474e[_0x005a('0x13')][_0x005a('0x12')]);}})[_0x005a('0x14')](function(_0x2060e5){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1aad71,_0x2060e5);_0x2af7fe(_0x2060e5);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 2b29f44..d6f0d5d 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 _0xbb34=['/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get'];(function(_0x22baaa,_0x64526b){var _0x4a40bc=function(_0x4f97f1){while(--_0x4f97f1){_0x22baaa['push'](_0x22baaa['shift']());}};_0x4a40bc(++_0x64526b);}(_0xbb34,0xf0));var _0x4bb3=function(_0x59ecf9,_0x9a29d){_0x59ecf9=_0x59ecf9-0x0;var _0x3c68c1=_0xbb34[_0x59ecf9];return _0x3c68c1;};'use strict';var multer=require(_0x4bb3('0x0'));var util=require(_0x4bb3('0x1'));var path=require(_0x4bb3('0x2'));var timeout=require('connect-timeout');var express=require(_0x4bb3('0x3'));var router=express[_0x4bb3('0x4')]();var fs_extra=require(_0x4bb3('0x5'));var auth=require(_0x4bb3('0x6'));var interaction=require(_0x4bb3('0x7'));var config=require(_0x4bb3('0x8'));var controller=require(_0x4bb3('0x9'));router['get']('/',auth[_0x4bb3('0xa')](),controller[_0x4bb3('0xb')]);router[_0x4bb3('0xc')](_0x4bb3('0xd'),auth['isAuthenticated'](),controller[_0x4bb3('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4bb3('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4bb3('0x10')]);router[_0x4bb3('0x11')](_0x4bb3('0x12'),auth[_0x4bb3('0xa')](),controller[_0x4bb3('0x13')]);router[_0x4bb3('0x14')](_0x4bb3('0x12'),auth['isAuthenticated'](),controller[_0x4bb3('0x15')]);module[_0x4bb3('0x16')]=router; \ No newline at end of file +var _0x1e32=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x1e32,0x1c8));var _0x21e3=function(_0x99d5a0,_0x253e41){_0x99d5a0=_0x99d5a0-0x0;var _0x3b19de=_0x1e32[_0x99d5a0];return _0x3b19de;};'use strict';var multer=require(_0x21e3('0x0'));var util=require(_0x21e3('0x1'));var path=require(_0x21e3('0x2'));var timeout=require(_0x21e3('0x3'));var express=require(_0x21e3('0x4'));var router=express['Router']();var fs_extra=require(_0x21e3('0x5'));var auth=require(_0x21e3('0x6'));var interaction=require(_0x21e3('0x7'));var config=require(_0x21e3('0x8'));var controller=require(_0x21e3('0x9'));router[_0x21e3('0xa')]('/',auth[_0x21e3('0xb')](),controller[_0x21e3('0xc')]);router[_0x21e3('0xa')](_0x21e3('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x21e3('0xa')](_0x21e3('0xe'),auth[_0x21e3('0xb')](),controller['show']);router[_0x21e3('0xf')]('/',auth[_0x21e3('0xb')](),controller['create']);router[_0x21e3('0x10')](_0x21e3('0xe'),auth[_0x21e3('0xb')](),controller[_0x21e3('0x11')]);router['delete']('/:id',auth[_0x21e3('0xb')](),controller[_0x21e3('0x12')]);module[_0x21e3('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 a04dba2..c5afb79 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 _0x0a9a=['#011F6A','#ffffff','INTEGER','rounded','squared','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','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.','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','randomstring','STRING','address','email','Agent'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x0a9a,0x183));var _0xa0a9=function(_0x21b990,_0x2dee74){_0x21b990=_0x21b990-0x0;var _0x46bdef=_0x0a9a[_0x21b990];return _0x46bdef;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa0a9('0x0'));module['exports']={'name':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![],'unique':_0xa0a9('0x2')},'description':{'type':Sequelize[_0xa0a9('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xa0a9('0x3')},'mapKeyOffline':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':'email'},'key':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x4')},'customerAlias':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa0a9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa0a9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![],'defaultValue':_0xa0a9('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa0a9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa0a9('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xa0a9('0x8'),_0xa0a9('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0xa')},'header_offline':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0xb')},'download_transcript':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa0a9('0xe')]},'closingQuestion':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa0a9('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x11')},'placeholderMessage':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa0a9('0x13')},'closingMessageButton':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0xa')},'skipMessageButton':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x14')},'conditionAgreement':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa0a9('0x15')](_0xa0a9('0x16'),_0xa0a9('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa0a9('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa0a9('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xa0a9('0x19'),'type':_0xa0a9('0x1a'),'required':!![]},'props':{'title':_0xa0a9('0x19'),'helpText':''}},{'type':_0xa0a9('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa0a9('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa0a9('0x1c')](_0xa0a9('0x1d'))?JSON[_0xa0a9('0x1e')](this[_0xa0a9('0x1c')]('onlineForm')):{};},'set':function(_0x7c1502){return this[_0xa0a9('0x1f')](_0xa0a9('0x1d'),JSON[_0xa0a9('0x18')](_0x7c1502));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa0a9('0x18')]({'items':[{'type':_0xa0a9('0x1b'),'props':{'title':_0xa0a9('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0xa0a9('0x20'),'config':{'placeholder':_0xa0a9('0x21')},'props':{'title':_0xa0a9('0x21'),'helpText':_0xa0a9('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xa0a9('0x1c')](_0xa0a9('0x23'))?JSON[_0xa0a9('0x1e')](this[_0xa0a9('0x1c')](_0xa0a9('0x23'))):{};},'set':function(_0x42024c){return this[_0xa0a9('0x1f')]('offlineForm',JSON[_0xa0a9('0x18')](_0x42024c));}},'token':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa0a9('0x24')},'waitingMessage':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x26')},'offlineMessageBody':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xa0a9('0x14')},'sendUnmanaged':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0xa')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa0a9('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa0a9('0x1')]},'notificationTemplate':{'type':Sequelize[_0xa0a9('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xa0a9('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa0a9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xa0a9('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x2a')},'messagesAlignment':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x2b')},'defaultTitle':{'type':Sequelize[_0xa0a9('0x1')]},'customerAvatar':{'type':Sequelize[_0xa0a9('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa0a9('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![],'defaultValue':_0xa0a9('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa0a9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa0a9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':_0xa0a9('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa0a9('0x7')],'comment':_0xa0a9('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x757e10){if(!_0x757e10)this[_0xa0a9('0x1f')](_0xa0a9('0x2f'),null);this[_0xa0a9('0x1f')]('mandatoryDisposition',_0x757e10);}},'vidaooEscalation':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa0a9('0x1')]},'vidaooTopic':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![],'defaultValue':_0xa0a9('0x30')},'vidaooNote':{'type':Sequelize[_0xa0a9('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa0a9('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa0a9('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa0a9('0xe')]}}; \ No newline at end of file +var _0x878f=['Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','BOOLEAN','Feedback','thumb','star','TEXT','stringify','input','name','text','onlineForm','parse','getDataValue','textarea','Comments','offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#ffffff','INTEGER','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us'];(function(_0x10244a,_0x3e96f4){var _0x4daacd=function(_0x3ef358){while(--_0x3ef358){_0x10244a['push'](_0x10244a['shift']());}};_0x4daacd(++_0x3e96f4);}(_0x878f,0x173));var _0xf878=function(_0x2ec263,_0x51b542){_0x2ec263=_0x2ec263-0x0;var _0x425ac1=_0x878f[_0x2ec263];return _0x425ac1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf878('0x0'));module[_0xf878('0x1')]={'name':{'type':Sequelize[_0xf878('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'unique':_0xf878('0x3')},'description':{'type':Sequelize[_0xf878('0x2')]},'mapKey':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x4')},'mapKeyOffline':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x4')},'key':{'type':Sequelize[_0xf878('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf878('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf878('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf878('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf878('0x7')](_0xf878('0x8'),'squared'),'defaultValue':_0xf878('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf878('0x9')},'start_chat_button':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf878('0xb')},'header_offline':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf878('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x10')},'noteTitle':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x11')},'placeholderMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x12')},'closingMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xb')},'skipMessageButton':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x13')},'conditionAgreement':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x15')},'ratingType':{'type':Sequelize[_0xf878('0x7')]('star',_0xf878('0x16')),'defaultValue':_0xf878('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xf878('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf878('0x18')],'defaultValue':function(){return JSON[_0xf878('0x19')]({'items':[{'type':_0xf878('0x1a'),'variable':null,'config':{'placeholder':_0xf878('0x1b'),'type':_0xf878('0x1c'),'required':!![]},'props':{'title':_0xf878('0x1b'),'helpText':''}},{'type':_0xf878('0x1a'),'props':{'title':_0xf878('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf878('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xf878('0x1d'))?JSON[_0xf878('0x1e')](this[_0xf878('0x1f')](_0xf878('0x1d'))):{};},'set':function(_0x20449e){return this['setDataValue']('onlineForm',JSON['stringify'](_0x20449e));}},'offlineForm':{'type':Sequelize[_0xf878('0x18')],'defaultValue':function(){return JSON[_0xf878('0x19')]({'items':[{'type':_0xf878('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf878('0x4'),'type':_0xf878('0x4')},'variable':null},{'type':_0xf878('0x20'),'config':{'placeholder':_0xf878('0x21')},'props':{'title':_0xf878('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf878('0x22'))?JSON[_0xf878('0x1e')](this['getDataValue'](_0xf878('0x22'))):{};},'set':function(_0x52da83){return this[_0xf878('0x23')]('offlineForm',JSON[_0xf878('0x19')](_0x52da83));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf878('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf878('0x2')]},'forwardOffline':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf878('0x2')]},'waitingTitle':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x26')},'offlineMessageBody':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xf878('0x14')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x13')},'sendUnmanaged':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf878('0x18')]},'showAgentAvatar':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf878('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf878('0x18')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf878('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf878('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xf878('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'defaultValue':_0xf878('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf878('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf878('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x2b')},'systemAvatar':{'type':Sequelize[_0xf878('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf878('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![],'comment':_0xf878('0x2c'),'set':function(_0x47ec1b){if(!_0x47ec1b)this[_0xf878('0x23')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xf878('0x2d'),_0x47ec1b);}},'vidaooEscalation':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf878('0x2')]},'vidaooTopic':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'defaultValue':_0xf878('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xf878('0x2f');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf878('0x18')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 473ae04..92a54e6 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 _0x2469=['%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','firstName','messageId','created','autoclose','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','findAll','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','remote','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','getAgents','bluebird','mustache','util','path','ejs','fs-extra','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','end','offset','undefined','limit','count','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','status','name','index','ChatWebsite','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','Pause','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','pick','map','rows','removeDispositions','CannedAnswer','removeAnswers','ids','sitepic','filename','agentAvatar','file','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','existsSync','server/files/images/logos/','download','getAvatar','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','account','applications','list','priority','asc','Contacts','contact','cf-connecting-ip','x-forwarded-for','first','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor'];(function(_0x2912c5,_0x3e4b2f){var _0x419643=function(_0x255f27){while(--_0x255f27){_0x2912c5['push'](_0x2912c5['shift']());}};_0x419643(++_0x3e4b2f);}(_0x2469,0x1b7));var _0x9246=function(_0x5851d9,_0x3cfa29){_0x5851d9=_0x5851d9-0x0;var _0x41c262=_0x2469[_0x5851d9];return _0x41c262;};'use strict';var BPromise=require(_0x9246('0x0'));var Mustache=require(_0x9246('0x1'));var util=require(_0x9246('0x2'));var path=require(_0x9246('0x3'));var ejs=require(_0x9246('0x4'));var fs=require('fs');var fs_extra=require(_0x9246('0x5'));var _=require('lodash');var querystring=require('querystring');var Redis=require(_0x9246('0x6'));var qs=require(_0x9246('0x7'));var logger=require(_0x9246('0x8'))(_0x9246('0x9'));var config=require(_0x9246('0xa'));var db=require(_0x9246('0xb'))['db'];config[_0x9246('0xc')]=_[_0x9246('0xd')](config[_0x9246('0xc')],{'host':_0x9246('0xe'),'port':0x18eb});var socket=require(_0x9246('0xf'))(new Redis(config[_0x9246('0xc')]));require(_0x9246('0x10'))[_0x9246('0x11')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x9246('0x12'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x9246('0x13')]({'port':0x232a});var client9003=jayson[_0x9246('0x14')][_0x9246('0x13')]({'port':0x232b});var client9001=jayson[_0x9246('0x14')][_0x9246('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x177772,_0x607781,_0x1c0792,_0x25ed77){return new BPromise(function(_0x366d6c,_0x4230ee){var _0x322cd6=_0x25ed77||client;return _0x322cd6['request'](_0x177772,_0x1c0792)[_0x9246('0x15')](function(_0x414a32){logger['info'](_0x9246('0x16'),_0x607781,'request\x20sent');logger[_0x9246('0x17')](_0x9246('0x18'),_0x607781,_0x9246('0x19'),JSON[_0x9246('0x1a')](_0x414a32));if(_0x414a32['error']){if(_0x414a32[_0x9246('0x1b')][_0x9246('0x1c')]===0x1f4){logger[_0x9246('0x1b')](_0x9246('0x16'),_0x607781,_0x414a32[_0x9246('0x1b')][_0x9246('0x1d')]);return _0x4230ee(_0x414a32['error']['message']);}logger[_0x9246('0x1b')](_0x9246('0x16'),_0x607781,_0x414a32[_0x9246('0x1b')]['message']);return _0x366d6c(_0x414a32[_0x9246('0x1b')][_0x9246('0x1d')]);}else{logger[_0x9246('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x607781,_0x9246('0x19'));_0x366d6c(_0x414a32['result'][_0x9246('0x1d')]);}})[_0x9246('0x1f')](function(_0x360a6d){logger[_0x9246('0x1b')](_0x9246('0x16'),_0x607781,_0x360a6d);_0x4230ee(_0x360a6d);});});}function respondWithStatusCode(_0x105e3e,_0x4580c4){_0x4580c4=_0x4580c4||0xcc;return function(_0xb443b8){if(_0xb443b8){return _0x105e3e[_0x9246('0x20')](_0x4580c4);}return _0x105e3e['status'](_0x4580c4)[_0x9246('0x21')]();};}function respondWithResult(_0x19fb68,_0x150c1a){_0x150c1a=_0x150c1a||0xc8;return function(_0x3a3b3f){if(_0x3a3b3f){return _0x19fb68['status'](_0x150c1a)['json'](_0x3a3b3f);}};}function respondWithFilteredResult(_0x16f481,_0x54fc8a){return function(_0xb7e6e3){if(_0xb7e6e3){var _0x57dd3e=typeof _0x54fc8a[_0x9246('0x22')]===_0x9246('0x23')&&typeof _0x54fc8a[_0x9246('0x24')]===_0x9246('0x23');var _0x43293f=_0xb7e6e3[_0x9246('0x25')];var _0x5b79e5=_0x57dd3e?0x0:_0x54fc8a[_0x9246('0x22')];var _0x59416c=_0x57dd3e?_0xb7e6e3[_0x9246('0x25')]:_0x54fc8a[_0x9246('0x22')]+_0x54fc8a['limit'];var _0xd0ca12;if(_0x59416c>=_0x43293f){_0x59416c=_0x43293f;_0xd0ca12=0xc8;}else{_0xd0ca12=0xce;}_0x16f481['status'](_0xd0ca12);return _0x16f481['set'](_0x9246('0x26'),_0x5b79e5+'-'+_0x59416c+'/'+_0x43293f)[_0x9246('0x27')](_0xb7e6e3);}return null;};}function saveUpdates(_0x2f5651){return function(_0x4a0781){if(_0x4a0781){return _0x4a0781[_0x9246('0x28')](_0x2f5651)[_0x9246('0x15')](function(_0x2d1c98){return _0x2d1c98;});}return null;};}function removeEntity(_0x5b4114){return function(_0x37244a){if(_0x37244a){return _0x37244a[_0x9246('0x29')]()['then'](function(){var _0x135ad5=_0x37244a[_0x9246('0x2a')]({'plain':!![]});var _0x2ed05c=_0x9246('0x2b');return db[_0x9246('0x2c')][_0x9246('0x29')]({'where':{'type':_0x2ed05c,'resourceId':_0x135ad5['id']}})[_0x9246('0x15')](function(){return _0x37244a;});})[_0x9246('0x15')](function(){_0x5b4114[_0x9246('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d1f3){return function(_0x1c50aa){if(!_0x1c50aa){_0x46d1f3[_0x9246('0x20')](0x194);}return _0x1c50aa;};}function handleError(_0x3384e3,_0x4de926){_0x4de926=_0x4de926||0x1f4;return function(_0x30915d){logger[_0x9246('0x1b')](_0x30915d['stack']);if(_0x30915d[_0x9246('0x2e')]){delete _0x30915d[_0x9246('0x2e')];}_0x3384e3['status'](_0x4de926)['send'](_0x30915d);};}exports[_0x9246('0x2f')]=function(_0x2294ef,_0x484913){var _0x4b700b={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1a8128={},_0x18f481={'count':0x0,'rows':[]};var _0x1dc7a4=_['map'](db[_0x9246('0x30')]['rawAttributes'],function(_0x572aaf){return{'name':_0x572aaf[_0x9246('0x31')],'type':_0x572aaf[_0x9246('0x32')]['key']};});_0x1a8128[_0x9246('0x33')]=_['map'](_0x1dc7a4,_0x9246('0x2e'));_0x1a8128[_0x9246('0x34')]=_[_0x9246('0x35')](_0x2294ef['query']);_0x1a8128[_0x9246('0x36')]=_[_0x9246('0x37')](_0x1a8128[_0x9246('0x33')],_0x1a8128[_0x9246('0x34')]);_0x4b700b[_0x9246('0x38')]=_[_0x9246('0x37')](_0x1a8128[_0x9246('0x33')],qs[_0x9246('0x39')](_0x2294ef[_0x9246('0x34')][_0x9246('0x39')]));_0x4b700b[_0x9246('0x38')]=_0x4b700b['attributes'][_0x9246('0x3a')]?_0x4b700b[_0x9246('0x38')]:_0x1a8128[_0x9246('0x33')];if(!_0x2294ef[_0x9246('0x34')][_0x9246('0x3b')](_0x9246('0x3c'))){_0x4b700b[_0x9246('0x24')]=qs[_0x9246('0x24')](_0x2294ef[_0x9246('0x34')][_0x9246('0x24')]);_0x4b700b[_0x9246('0x22')]=qs[_0x9246('0x22')](_0x2294ef[_0x9246('0x34')][_0x9246('0x22')]);}_0x4b700b[_0x9246('0x3d')]=qs[_0x9246('0x3e')](_0x2294ef[_0x9246('0x34')][_0x9246('0x3e')]);_0x4b700b[_0x9246('0x3f')]=qs[_0x9246('0x36')](_['pick'](_0x2294ef[_0x9246('0x34')],_0x1a8128['filters']),_0x1dc7a4);if(_0x2294ef[_0x9246('0x34')][_0x9246('0x40')]){_0x4b700b[_0x9246('0x3f')]=_[_0x9246('0x41')](_0x4b700b[_0x9246('0x3f')],{'$or':_['map'](_0x1dc7a4,function(_0x2f3324){if(_0x2f3324[_0x9246('0x32')]!==_0x9246('0x42')){var _0x58e32d={};_0x58e32d[_0x2f3324[_0x9246('0x2e')]]={'$like':'%'+_0x2294ef[_0x9246('0x34')][_0x9246('0x40')]+'%'};return _0x58e32d;}})});}_0x4b700b=_[_0x9246('0x41')]({},_0x4b700b,_0x2294ef[_0x9246('0x43')]);var _0x39f221={'where':_0x4b700b['where']};return db[_0x9246('0x30')][_0x9246('0x25')](_0x39f221)['then'](function(_0x29e3f4){_0x18f481[_0x9246('0x25')]=_0x29e3f4;if(_0x2294ef[_0x9246('0x34')][_0x9246('0x44')]){_0x4b700b[_0x9246('0x45')]=[{'all':!![]}];}return db[_0x9246('0x30')]['findAll'](_0x4b700b);})[_0x9246('0x15')](function(_0x47e444){_0x18f481['rows']=_0x47e444;return _0x18f481;})[_0x9246('0x15')](respondWithFilteredResult(_0x484913,_0x4b700b))[_0x9246('0x1f')](handleError(_0x484913,null));};exports[_0x9246('0x46')]=function(_0xd6ccb8,_0x79b4c3){var _0x34ac93={'raw':![],'where':{'id':_0xd6ccb8['params']['id']},'include':[{'model':db[_0x9246('0x47')],'as':'mandatoryDispositionPause'}]},_0x59e166={};_0x59e166[_0x9246('0x33')]=_[_0x9246('0x35')](db[_0x9246('0x30')][_0x9246('0x48')]);_0x59e166[_0x9246('0x34')]=_['keys'](_0xd6ccb8[_0x9246('0x34')]);_0x59e166[_0x9246('0x36')]=_[_0x9246('0x37')](_0x59e166['model'],_0x59e166[_0x9246('0x34')]);_0x34ac93['attributes']=_['intersection'](_0x59e166[_0x9246('0x33')],qs['fields'](_0xd6ccb8[_0x9246('0x34')][_0x9246('0x39')]));_0x34ac93[_0x9246('0x38')]=_0x34ac93[_0x9246('0x38')][_0x9246('0x3a')]?_0x34ac93[_0x9246('0x38')]:_0x59e166['model'];if(_0xd6ccb8[_0x9246('0x34')]['includeAll']){_0x34ac93['include']=[{'all':!![]}];}_0x34ac93=_[_0x9246('0x41')]({},_0x34ac93,_0xd6ccb8[_0x9246('0x43')]);return db[_0x9246('0x30')]['find'](_0x34ac93)[_0x9246('0x15')](handleEntityNotFound(_0x79b4c3,null))[_0x9246('0x15')](respondWithResult(_0x79b4c3,null))['catch'](handleError(_0x79b4c3,null));};exports[_0x9246('0x49')]=function(_0x46bae9,_0x587057){return db[_0x9246('0x30')][_0x9246('0x49')](_0x46bae9[_0x9246('0x4a')],{})[_0x9246('0x15')](function(_0x16c3ef){var _0x341090=_0x46bae9[_0x9246('0x4b')][_0x9246('0x2a')]({'plain':!![]});if(!_0x341090)throw new Error(_0x9246('0x4c'));if(_0x341090[_0x9246('0x4d')]===_0x9246('0x4b')){var _0x1abaef=_0x16c3ef[_0x9246('0x2a')]({'plain':!![]});var _0x515e49=_0x9246('0x2b');return db[_0x9246('0x4e')][_0x9246('0x4f')]({'where':{'name':_0x515e49,'userProfileId':_0x341090[_0x9246('0x50')]},'raw':!![]})[_0x9246('0x15')](function(_0x3b32bf){if(_0x3b32bf&&_0x3b32bf[_0x9246('0x51')]===0x0){return db['UserProfileResource'][_0x9246('0x49')]({'name':_0x1abaef[_0x9246('0x2e')],'resourceId':_0x1abaef['id'],'type':_0x3b32bf[_0x9246('0x2e')],'sectionId':_0x3b32bf['id']},{})['then'](function(){return _0x16c3ef;});}else{return _0x16c3ef;}})[_0x9246('0x1f')](function(_0x8cce25){logger[_0x9246('0x1b')](_0x9246('0x52'),_0x8cce25);throw _0x8cce25;});}return _0x16c3ef;})['then'](respondWithResult(_0x587057,0xc9))[_0x9246('0x1f')](handleError(_0x587057,null));};exports[_0x9246('0x28')]=function(_0x535834,_0x437f2d){if(_0x535834[_0x9246('0x4a')]['id']){delete _0x535834[_0x9246('0x4a')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x535834[_0x9246('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x9246('0x54')}]})[_0x9246('0x15')](handleEntityNotFound(_0x437f2d,null))[_0x9246('0x15')](saveUpdates(_0x535834[_0x9246('0x4a')],null))[_0x9246('0x15')](respondWithResult(_0x437f2d,null))['catch'](handleError(_0x437f2d,null));};exports[_0x9246('0x29')]=function(_0x77e233,_0x3dafc2){return db[_0x9246('0x30')][_0x9246('0x4f')]({'where':{'id':_0x77e233[_0x9246('0x53')]['id']}})['then'](handleEntityNotFound(_0x3dafc2,null))[_0x9246('0x15')](removeEntity(_0x3dafc2,null))[_0x9246('0x1f')](handleError(_0x3dafc2,null));};exports[_0x9246('0x55')]=function(_0x401505,_0x201df7){return db[_0x9246('0x30')][_0x9246('0x55')]()['then'](respondWithResult(_0x201df7,null))[_0x9246('0x1f')](handleError(_0x201df7,null));};exports[_0x9246('0x56')]=function(_0x2fbf93,_0x4f1f09){if(_0x2fbf93['body']['id']){delete _0x2fbf93[_0x9246('0x4a')]['id'];}return db['ChatWebsite'][_0x9246('0x4f')]({'where':{'id':_0x2fbf93[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x4f1f09,null))[_0x9246('0x15')](function(_0x5f25bc){if(_0x5f25bc){_0x2fbf93[_0x9246('0x4a')][_0x9246('0x57')]=_0x5f25bc['id'];return db[_0x9246('0x58')][_0x9246('0x49')](_0x2fbf93[_0x9246('0x4a')]);}})[_0x9246('0x15')](respondWithResult(_0x4f1f09,null))['catch'](handleError(_0x4f1f09,null));};exports[_0x9246('0x59')]=function(_0x2e60e1,_0x5ab970){var _0x6bf2ee={'raw':![],'where':{}};var _0x59e93b={};var _0x4b57e6={'count':0x0,'rows':[]};return db[_0x9246('0x30')][_0x9246('0x5a')]({'where':{'id':_0x2e60e1[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x5ab970,null))[_0x9246('0x15')](function(_0x278554){if(_0x278554){_0x59e93b[_0x9246('0x33')]=_[_0x9246('0x35')](db[_0x9246('0x58')][_0x9246('0x48')]);_0x59e93b[_0x9246('0x34')]=_[_0x9246('0x35')](_0x2e60e1[_0x9246('0x34')]);_0x59e93b[_0x9246('0x36')]=_[_0x9246('0x37')](_0x59e93b['model'],_0x59e93b[_0x9246('0x34')]);_0x6bf2ee[_0x9246('0x38')]=_[_0x9246('0x37')](_0x59e93b[_0x9246('0x33')],qs['fields'](_0x2e60e1['query'][_0x9246('0x39')]));_0x6bf2ee[_0x9246('0x38')]=_0x6bf2ee[_0x9246('0x38')][_0x9246('0x3a')]?_0x6bf2ee['attributes']:_0x59e93b[_0x9246('0x33')];if(!_0x2e60e1[_0x9246('0x34')][_0x9246('0x3b')](_0x9246('0x3c'))){_0x6bf2ee[_0x9246('0x24')]=qs[_0x9246('0x24')](_0x2e60e1[_0x9246('0x34')][_0x9246('0x24')]);_0x6bf2ee['offset']=qs['offset'](_0x2e60e1[_0x9246('0x34')][_0x9246('0x22')]);}_0x6bf2ee[_0x9246('0x3d')]=qs[_0x9246('0x3e')](_0x2e60e1[_0x9246('0x34')][_0x9246('0x3e')]);_0x6bf2ee['where']=qs[_0x9246('0x36')](_[_0x9246('0x5b')](_0x2e60e1[_0x9246('0x34')],_0x59e93b[_0x9246('0x36')]));_0x6bf2ee[_0x9246('0x3f')]['ChatWebsiteId']=_0x278554['id'];if(_0x2e60e1[_0x9246('0x34')][_0x9246('0x40')]){_0x6bf2ee[_0x9246('0x3f')]=_['merge'](_0x6bf2ee[_0x9246('0x3f')],{'$or':_[_0x9246('0x5c')](_0x6bf2ee[_0x9246('0x38')],function(_0x4483a9){var _0x9a111f={};_0x9a111f[_0x4483a9]={'$like':'%'+_0x2e60e1[_0x9246('0x34')][_0x9246('0x40')]+'%'};return _0x9a111f;})});}_0x6bf2ee=_[_0x9246('0x41')]({},_0x6bf2ee,_0x2e60e1[_0x9246('0x43')]);return db['Disposition']['count']({'where':_0x6bf2ee[_0x9246('0x3f')]})[_0x9246('0x15')](function(_0x43385a){_0x4b57e6[_0x9246('0x25')]=_0x43385a;if(_0x2e60e1[_0x9246('0x34')][_0x9246('0x44')]){_0x6bf2ee[_0x9246('0x45')]=[{'all':!![]}];}return db[_0x9246('0x58')]['findAll'](_0x6bf2ee);})[_0x9246('0x15')](function(_0x2e104a){_0x4b57e6[_0x9246('0x5d')]=_0x2e104a;return _0x4b57e6;});}})[_0x9246('0x15')](respondWithFilteredResult(_0x5ab970,_0x6bf2ee))[_0x9246('0x1f')](handleError(_0x5ab970,null));};exports['removeDispositions']=function(_0x5b2448,_0x2d86d4){return db[_0x9246('0x30')][_0x9246('0x4f')]({'where':{'id':_0x5b2448[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x2d86d4,null))['then'](function(_0x2dfaf2){if(_0x2dfaf2){return _0x2dfaf2[_0x9246('0x5e')](_0x5b2448[_0x9246('0x34')]['ids']);}})[_0x9246('0x15')](respondWithStatusCode(_0x2d86d4,null))[_0x9246('0x1f')](handleError(_0x2d86d4,null));};exports['addAnswer']=function(_0x3b5676,_0x57a806){if(_0x3b5676['body']['id']){delete _0x3b5676[_0x9246('0x4a')]['id'];}return db[_0x9246('0x30')][_0x9246('0x4f')]({'where':{'id':_0x3b5676[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x57a806,null))[_0x9246('0x15')](function(_0x2e13a3){if(_0x2e13a3){_0x3b5676[_0x9246('0x4a')][_0x9246('0x57')]=_0x2e13a3['id'];return db[_0x9246('0x5f')]['create'](_0x3b5676[_0x9246('0x4a')]);}})[_0x9246('0x15')](respondWithResult(_0x57a806,null))[_0x9246('0x1f')](handleError(_0x57a806,null));};exports['getAnswers']=function(_0x11f033,_0x47ecc1){var _0x4472de={'raw':![],'where':{}};var _0x154968={};var _0x47a3c8={'count':0x0,'rows':[]};return db[_0x9246('0x30')][_0x9246('0x5a')]({'where':{'id':_0x11f033[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x47ecc1,null))[_0x9246('0x15')](function(_0x29013e){if(_0x29013e){_0x154968['model']=_[_0x9246('0x35')](db[_0x9246('0x5f')][_0x9246('0x48')]);_0x154968[_0x9246('0x34')]=_[_0x9246('0x35')](_0x11f033[_0x9246('0x34')]);_0x154968[_0x9246('0x36')]=_[_0x9246('0x37')](_0x154968['model'],_0x154968[_0x9246('0x34')]);_0x4472de['attributes']=_[_0x9246('0x37')](_0x154968[_0x9246('0x33')],qs[_0x9246('0x39')](_0x11f033[_0x9246('0x34')]['fields']));_0x4472de[_0x9246('0x38')]=_0x4472de['attributes'][_0x9246('0x3a')]?_0x4472de[_0x9246('0x38')]:_0x154968[_0x9246('0x33')];if(!_0x11f033['query'][_0x9246('0x3b')](_0x9246('0x3c'))){_0x4472de[_0x9246('0x24')]=qs['limit'](_0x11f033[_0x9246('0x34')][_0x9246('0x24')]);_0x4472de['offset']=qs['offset'](_0x11f033['query'][_0x9246('0x22')]);}_0x4472de[_0x9246('0x3d')]=qs['sort'](_0x11f033[_0x9246('0x34')][_0x9246('0x3e')]);_0x4472de[_0x9246('0x3f')]=qs[_0x9246('0x36')](_[_0x9246('0x5b')](_0x11f033[_0x9246('0x34')],_0x154968[_0x9246('0x36')]));_0x4472de[_0x9246('0x3f')][_0x9246('0x57')]=_0x29013e['id'];if(_0x11f033['query'][_0x9246('0x40')]){_0x4472de[_0x9246('0x3f')]=_['merge'](_0x4472de[_0x9246('0x3f')],{'$or':_[_0x9246('0x5c')](_0x4472de[_0x9246('0x38')],function(_0x2dd90d){var _0x47f4e7={};_0x47f4e7[_0x2dd90d]={'$like':'%'+_0x11f033['query'][_0x9246('0x40')]+'%'};return _0x47f4e7;})});}_0x4472de=_['merge']({},_0x4472de,_0x11f033[_0x9246('0x43')]);return db['CannedAnswer'][_0x9246('0x25')]({'where':_0x4472de[_0x9246('0x3f')]})[_0x9246('0x15')](function(_0x1e919a){_0x47a3c8[_0x9246('0x25')]=_0x1e919a;if(_0x11f033[_0x9246('0x34')][_0x9246('0x44')]){_0x4472de[_0x9246('0x45')]=[{'all':!![]}];}return db[_0x9246('0x5f')]['findAll'](_0x4472de);})[_0x9246('0x15')](function(_0x448373){_0x47a3c8[_0x9246('0x5d')]=_0x448373;return _0x47a3c8;});}})[_0x9246('0x15')](respondWithFilteredResult(_0x47ecc1,_0x4472de))[_0x9246('0x1f')](handleError(_0x47ecc1,null));};exports[_0x9246('0x60')]=function(_0x408cca,_0xca50d7){return db['ChatWebsite']['find']({'where':{'id':_0x408cca['params']['id']}})[_0x9246('0x15')](handleEntityNotFound(_0xca50d7,null))[_0x9246('0x15')](function(_0x305867){if(_0x305867){return _0x305867[_0x9246('0x60')](_0x408cca[_0x9246('0x34')][_0x9246('0x61')]);}})[_0x9246('0x15')](respondWithStatusCode(_0xca50d7,null))[_0x9246('0x1f')](handleError(_0xca50d7,null));};exports['addLogo']=function(_0x31ec2a,_0x5862ad){_0x31ec2a[_0x9246('0x4a')][_0x9246('0x62')]=_0x31ec2a['file'][_0x9246('0x63')];return db[_0x9246('0x30')][_0x9246('0x4f')]({'where':{'id':_0x31ec2a[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x5862ad,null))[_0x9246('0x15')](saveUpdates(_0x31ec2a['body'],null))[_0x9246('0x15')](respondWithResult(_0x5862ad,null))[_0x9246('0x1f')](handleError(_0x5862ad,null));};exports['addAvatar']=function(_0x1d8a2d,_0x2a45ec){_0x1d8a2d['body'][_0x9246('0x64')]=_0x1d8a2d[_0x9246('0x65')][_0x9246('0x63')];return db['ChatWebsite']['find']({'where':{'id':_0x1d8a2d[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x2a45ec,null))[_0x9246('0x15')](saveUpdates(_0x1d8a2d['body'],null))[_0x9246('0x15')](respondWithResult(_0x2a45ec,null))['catch'](handleError(_0x2a45ec,null));};exports['addCustomerAvatar']=function(_0x1de285,_0x1b3d45){_0x1de285[_0x9246('0x4a')][_0x9246('0x66')]=_0x1de285[_0x9246('0x65')]['filename'];return db[_0x9246('0x30')][_0x9246('0x4f')]({'where':{'id':_0x1de285[_0x9246('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b3d45,null))[_0x9246('0x15')](saveUpdates(_0x1de285[_0x9246('0x4a')],null))[_0x9246('0x15')](respondWithResult(_0x1b3d45,null))['catch'](handleError(_0x1b3d45,null));};exports['addSystemAvatar']=function(_0x1aefd4,_0x453748){_0x1aefd4[_0x9246('0x4a')][_0x9246('0x67')]=_0x1aefd4[_0x9246('0x65')][_0x9246('0x63')];return db[_0x9246('0x30')]['find']({'where':{'id':_0x1aefd4[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x453748,null))['then'](saveUpdates(_0x1aefd4[_0x9246('0x4a')],null))['then'](respondWithResult(_0x453748,null))[_0x9246('0x1f')](handleError(_0x453748,null));};exports[_0x9246('0x68')]=function(_0x5bdb85,_0x563ad9){var _0x4be880=path[_0x9246('0x69')](config[_0x9246('0x6a')],_0x9246('0x6b'));var _0x33aeda={'where':{'id':_0x5bdb85[_0x9246('0x53')]['id']},'attributes':['id',_0x9246('0x62')],'raw':!![]};var _0x124995=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x39b8c6){if(_0x39b8c6){_0x124995=_0x39b8c6[_0x9246('0x6c')];}})[_0x9246('0x15')](function(){return db[_0x9246('0x30')]['find'](_0x33aeda);})[_0x9246('0x15')](handleEntityNotFound(_0x563ad9,null))[_0x9246('0x15')](function(_0x4d2edf){if(_0x4d2edf){if(!_['isNil'](_0x4d2edf[_0x9246('0x62')])){if(fs[_0x9246('0x6d')](path[_0x9246('0x69')](config[_0x9246('0x6a')],_0x9246('0x6e'),_0x4d2edf['sitepic']))&&_0x124995){_0x4be880=path[_0x9246('0x69')](config[_0x9246('0x6a')],_0x9246('0x6e'),_0x4d2edf[_0x9246('0x62')]);}}return _0x563ad9[_0x9246('0x6f')](_0x4be880);}})['catch'](handleError(_0x563ad9,null));};exports[_0x9246('0x70')]=function(_0x3a85a3,_0x2033aa){var _0x213d2b=path['join'](config[_0x9246('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x3ec022={'where':{'id':_0x3a85a3[_0x9246('0x53')]['id']},'attributes':['id',_0x9246('0x64')],'raw':!![]};return db[_0x9246('0x30')][_0x9246('0x4f')](_0x3ec022)[_0x9246('0x15')](handleEntityNotFound(_0x2033aa,null))['then'](function(_0x10e10a){if(_0x10e10a){if(!_[_0x9246('0x71')](_0x10e10a['agentAvatar'])){if(fs[_0x9246('0x6d')](path[_0x9246('0x69')](config['root'],_0x9246('0x72'),_0x10e10a[_0x9246('0x64')]))){_0x213d2b=path[_0x9246('0x69')](config['root'],'server/files/images/avatars/',_0x10e10a[_0x9246('0x64')]);}}return _0x2033aa[_0x9246('0x6f')](_0x213d2b);}})[_0x9246('0x1f')](handleError(_0x2033aa,null));};exports[_0x9246('0x73')]=function(_0x2a2193,_0xec129e){var _0x1b8db4=path[_0x9246('0x69')](config['root'],_0x9246('0x74'));var _0x38f658={'where':{'id':_0x2a2193[_0x9246('0x53')]['id']},'attributes':['id',_0x9246('0x66'),_0x9246('0x75')],'raw':!![]};return db[_0x9246('0x30')]['find'](_0x38f658)[_0x9246('0x15')](handleEntityNotFound(_0xec129e,null))[_0x9246('0x15')](function(_0x45d50a){if(_0x45d50a){if(!_[_0x9246('0x71')](_0x45d50a[_0x9246('0x66')])){if(fs[_0x9246('0x6d')](path[_0x9246('0x69')](config[_0x9246('0x6a')],'server/files/images/avatars/',_0x45d50a[_0x9246('0x66')]))&&_0x45d50a[_0x9246('0x75')]){_0x1b8db4=path[_0x9246('0x69')](config[_0x9246('0x6a')],_0x9246('0x72'),_0x45d50a[_0x9246('0x66')]);}}return _0xec129e[_0x9246('0x6f')](_0x1b8db4);}})[_0x9246('0x1f')](handleError(_0xec129e,null));};exports[_0x9246('0x76')]=function(_0xb13e0d,_0x55c6bf){var _0x428b38=path[_0x9246('0x69')](config[_0x9246('0x6a')],_0x9246('0x77'));var _0x2ddbec={'where':{'id':_0xb13e0d[_0x9246('0x53')]['id']},'attributes':['id',_0x9246('0x67')],'raw':!![]};return db[_0x9246('0x30')][_0x9246('0x4f')](_0x2ddbec)[_0x9246('0x15')](handleEntityNotFound(_0x55c6bf,null))[_0x9246('0x15')](function(_0x499165){if(_0x499165){if(!_[_0x9246('0x71')](_0x499165[_0x9246('0x67')])){if(fs[_0x9246('0x6d')](path[_0x9246('0x69')](config[_0x9246('0x6a')],'server/files/images/avatars/',_0x499165[_0x9246('0x67')]))){_0x428b38=path[_0x9246('0x69')](config['root'],_0x9246('0x72'),_0x499165[_0x9246('0x67')]);}}return _0x55c6bf['download'](_0x428b38);}})[_0x9246('0x1f')](handleError(_0x55c6bf,null));};exports[_0x9246('0x78')]=function(_0x1a3b6f,_0x3aeaf8){var _0x13ec44=require(_0x9246('0x79'));var _0x182465=new _0x13ec44();var _0x7f8d42=_0x182465['setUA'](_0x1a3b6f[_0x9246('0x7a')][_0x9246('0x7b')])[_0x9246('0x7c')]();var _0x169753={'body':_0x1a3b6f[_0x9246('0x4a')],'channel':_0x9246('0x7d')};var _0x4c9ce8=[];var _0x3ebad4=[];var _0x254cc9={};var _0x3a6516=![];return db[_0x9246('0x7e')][_0x9246('0x55')]()[_0x9246('0x15')](function(_0x567c77){if(!_0x567c77){throw new db[(_0x9246('0x7f'))][(_0x9246('0x80'))]('no\x20available\x20attributes');}_0x4c9ce8=_['difference'](_[_0x9246('0x35')](_0x567c77),['createdAt',_0x9246('0x81')]);_0x3ebad4=_[_0x9246('0x82')](_[_0x9246('0x35')](_0x567c77),[_0x9246('0x83'),_0x9246('0x81'),_0x9246('0x84'),_0x9246('0x85')]);if(_0x1a3b6f[_0x9246('0x4a')]['id']){delete _0x1a3b6f['body']['id'];}if(_[_0x9246('0x71')](_0x1a3b6f[_0x9246('0x4a')][_0x9246('0x86')])){throw new db[(_0x9246('0x7f'))]['ValidationError'](_0x9246('0x87'));}if(_[_0x9246('0x71')](_0x1a3b6f[_0x9246('0x4a')][_0x9246('0x4a')])||_0x1a3b6f[_0x9246('0x4a')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x9246('0x88'));}if(_['isNil'](_0x1a3b6f[_0x9246('0x4a')][_0x9246('0x89')])){throw new db[(_0x9246('0x7f'))][(_0x9246('0x80'))](_0x9246('0x8a')+_0x3ebad4);}if(!_[_0x9246('0x8b')](_0x3ebad4,_0x1a3b6f['body']['mapKey'])){throw new db[(_0x9246('0x7f'))][(_0x9246('0x80'))](_0x9246('0x8c')+_0x3ebad4);}_0x254cc9[_0x1a3b6f[_0x9246('0x4a')]['mapKey']]=_0x1a3b6f[_0x9246('0x4a')]['from'];})[_0x9246('0x15')](function(){return db['ChatWebsite'][_0x9246('0x4f')]({'where':{'id':_0x1a3b6f[_0x9246('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0x9246('0x8d'),'include':[{'model':db[_0x9246('0x7e')],'as':'Contacts','where':_0x254cc9,'limit':0x1,'order':[[_0x9246('0x81'),_0x9246('0x8e')]]}]},{'model':db[_0x9246('0x8f')],'as':_0x9246('0x90')}]});})[_0x9246('0x15')](handleEntityNotFound(_0x3aeaf8,null))[_0x9246('0x15')](function(_0x3290a4){if(_0x3290a4&&_0x3290a4[_0x9246('0x8d')]){_0x169753[_0x9246('0x91')]=_0x3290a4;_0x169753[_0x9246('0x92')]=_0x3290a4['Applications'];_0x169753[_0x9246('0x93')]=_0x3290a4[_0x9246('0x8d')];_0x169753[_0x9246('0x92')]=_['orderBy'](_0x169753[_0x9246('0x92')],[_0x9246('0x94')],[_0x9246('0x95')]);if(_0x169753[_0x9246('0x91')][_0x9246('0x90')]){delete _0x169753['account'][_0x9246('0x90')];}if(_0x169753[_0x9246('0x91')][_0x9246('0x8d')]&&_0x169753['account'][_0x9246('0x8d')][_0x9246('0x96')][_0x9246('0x3a')]){return _0x169753[_0x9246('0x91')][_0x9246('0x8d')]['Contacts'][0x0];}var _0x1e3b13=_[_0x9246('0xd')](_0x1a3b6f[_0x9246('0x4a')],{'firstName':_0x1a3b6f[_0x9246('0x4a')][_0x9246('0x86')],'ListId':_0x3290a4[_0x9246('0x85')]});_0x1e3b13[_0x1a3b6f[_0x9246('0x4a')][_0x9246('0x89')]]=_0x1a3b6f['body'][_0x9246('0x86')];return db[_0x9246('0x7e')][_0x9246('0x49')](_0x1e3b13,{'fields':_0x4c9ce8,'raw':!![]});}})[_0x9246('0x15')](handleEntityNotFound(_0x3aeaf8,null))[_0x9246('0x15')](function(_0x2ca71e){_0x169753[_0x9246('0x97')]=_0x2ca71e;var _0x3814d7=_0x1a3b6f[_0x9246('0x4a')]['customerIp'];if(_0x1a3b6f['headers'][_0x9246('0x98')]){_0x3814d7=_0x1a3b6f['headers'][_0x9246('0x98')];}else if(_0x1a3b6f[_0x9246('0x7a')][_0x9246('0x99')]){_0x3814d7=_[_0x9246('0x9a')](_0x1a3b6f[_0x9246('0x7a')][_0x9246('0x99')]['split'](','));}if(_0x2ca71e){var _0x3b1c5a={'ContactId':_0x2ca71e['id'],'ChatWebsiteId':_0x1a3b6f[_0x9246('0x53')]['id'],'from':(_0x2ca71e['firstName']||'')+'\x20'+(_0x2ca71e[_0x9246('0x9b')]||''),'customerIp':_0x3814d7,'customerPort':_0x1a3b6f['headers'][_0x9246('0x9c')]?_0x1a3b6f[_0x9246('0x7a')][_0x9246('0x9c')]:null,'referer':_0x1a3b6f['body'][_0x9246('0x9d')],'browserName':_0x7f8d42[_0x9246('0x9e')][_0x9246('0x2e')]&&_0x7f8d42[_0x9246('0x9e')][_0x9246('0x9f')]?util[_0x9246('0xa0')](_0x9246('0xa1'),_0x7f8d42[_0x9246('0x9e')]['name'],_0x7f8d42[_0x9246('0x9e')][_0x9246('0x9f')]):'unknown','browserVersion':_0x7f8d42[_0x9246('0x9e')][_0x9246('0x9f')]||_0x9246('0xa2'),'osName':util[_0x9246('0xa0')](_0x9246('0xa1'),_0x7f8d42['os'][_0x9246('0x2e')],_0x7f8d42['os'][_0x9246('0x9f')]),'osVersion':_0x7f8d42['os'][_0x9246('0x9f')],'deviceModel':_0x7f8d42[_0x9246('0xa3')][_0x9246('0x33')]&&_0x7f8d42[_0x9246('0xa3')][_0x9246('0xa4')]?util[_0x9246('0xa0')](_0x9246('0xa5'),_0x7f8d42['device'][_0x9246('0x33')],_0x7f8d42['device']['vendor'],_0x7f8d42[_0x9246('0xa3')][_0x9246('0x32')]):null,'deviceVendor':_0x7f8d42[_0x9246('0xa3')][_0x9246('0xa4')],'deviceType':_0x7f8d42[_0x9246('0xa3')]['type'],'formData':JSON[_0x9246('0x1a')](_0x1a3b6f[_0x9246('0x4a')])};var _0xa7b91e={'ChatWebsiteId':_0x1a3b6f[_0x9246('0x53')]['id'],'closed':![]};if(_0x1a3b6f['body'][_0x9246('0xa6')]){_0xa7b91e[_0x9246('0xa6')]=_0x1a3b6f[_0x9246('0x4a')]['threadId'];return db['ChatInteraction']['find']({'where':_0xa7b91e})[_0x9246('0x15')](function(_0x32ab3b){if(_0x32ab3b){return[_0x32ab3b,![]];}_0x3b1c5a[_0x9246('0xa6')]=_0x1a3b6f[_0x9246('0x4a')]['threadId'];_0x3b1c5a[_0x9246('0xa7')]=_0x1a3b6f[_0x9246('0x4a')][_0x9246('0xa7')];return db[_0x9246('0xa8')][_0x9246('0x49')](_0x3b1c5a)[_0x9246('0x15')](function(_0x44e933){return[_0x44e933,!![]];});});}_0xa7b91e[_0x9246('0xa9')]=_0x2ca71e['id'];if(_0x1a3b6f[_0x9246('0x4a')][_0x9246('0xaa')]&&_0x1a3b6f[_0x9246('0x4a')][_0x9246('0xaa')]['id']){_0xa7b91e['id']=_0x1a3b6f[_0x9246('0x4a')][_0x9246('0xaa')]['id'];return db[_0x9246('0xa8')][_0x9246('0x4f')]({'where':_0xa7b91e})[_0x9246('0x15')](function(_0x16d54f){if(_0x16d54f){return[_0x16d54f,![]];}return db[_0x9246('0xa8')]['create'](_0x3b1c5a)[_0x9246('0x15')](function(_0x499506){return[_0x499506,!![]];});});}return db[_0x9246('0xa8')][_0x9246('0x49')](_0x3b1c5a)[_0x9246('0x15')](function(_0x120add){return[_0x120add,!![]];});}})[_0x9246('0xab')](function(_0x4e0af5,_0x14ba23){if(_0x4e0af5){_0x3a6516=_0x14ba23;if(!_0x14ba23){var _0x2aa4e5={'from':(_0x169753[_0x9246('0x97')][_0x9246('0xac')]||'')+'\x20'+(_0x169753[_0x9246('0x97')]['lastName']||'')};if(_0x1a3b6f['body'][_0x9246('0xa6')]&&_0x1a3b6f[_0x9246('0x4a')][_0x9246('0xad')]&&_0x1a3b6f[_0x9246('0x4a')]['threadId']!=_0x1a3b6f[_0x9246('0x4a')][_0x9246('0xad')]){_0x2aa4e5['threadId']=_0x1a3b6f[_0x9246('0x4a')][_0x9246('0xad')];}return _0x4e0af5[_0x9246('0x28')](_0x2aa4e5);}else{return _0x4e0af5;}}})['then'](function(_0x23c10a){_0x169753[_0x9246('0xaa')]=_0x23c10a[_0x9246('0x2a')]({'plain':!![]});_0x169753[_0x9246('0xaa')]['created']=_0x3a6516;if(_0x169753[_0x9246('0xaa')][_0x9246('0xae')]){if(_0x169753[_0x9246('0x91')][_0x9246('0xaf')]){_0x169753[_0x9246('0x92')]['push']({'id':0x0,'priority':_0x169753[_0x9246('0x92')][_0x9246('0x3a')]+0x1,'app':_0x9246('0xb0'),'appdata':'unmanaged','interval':_0x9246('0xb1')});}}return db[_0x9246('0xb2')][_0x9246('0x49')]({'body':_0x1a3b6f[_0x9246('0x4a')][_0x9246('0x4a')],'ChatWebsiteId':_0x1a3b6f[_0x9246('0x53')]['id'],'ChatInteractionId':_0x23c10a['id'],'direction':'in','ContactId':_0x169753[_0x9246('0x97')]['id'],'AttachmentId':_0x1a3b6f['body'][_0x9246('0xb3')]});})[_0x9246('0x15')](function(_0x1d3592){_0x169753[_0x9246('0x1d')]=_0x1d3592;if(_0x169753[_0x9246('0xaa')][_0x9246('0xb4')]){return db[_0x9246('0xb5')]['find']({'attributes':['id',_0x9246('0x2e')],'where':{'id':_0x169753[_0x9246('0xaa')][_0x9246('0xb4')]}})[_0x9246('0x15')](function(_0x5cfbfd){if(_0x5cfbfd){_0x169753[_0x9246('0x92')][_0x9246('0xb6')]({'id':0x0,'priority':0x0,'app':_0x9246('0xb7'),'appdata':_0x5cfbfd[_0x9246('0x2e')]+','+(_0x169753[_0x9246('0x91')][_0x9246('0xb8')]||0xa),'interval':_0x9246('0xb1')});_0x169753[_0x9246('0xb9')]=!![];}return respondWithRpcPromise(_0x9246('0xba'),_0x9246('0xbb'),_0x169753);});}return respondWithRpcPromise(_0x9246('0xba'),_0x9246('0xbb'),_0x169753);})[_0x9246('0x15')](function(_0x43e187){respondWithRpcPromise(_0x9246('0xbc'),_0x9246('0xbc'),{'event':_0x9246('0x78'),'message':_0x43e187},client9002);return _0x43e187;})['then'](respondWithResult(_0x3aeaf8,null))['catch'](handleError(_0x3aeaf8,null));};exports[_0x9246('0xbd')]=function(_0x5408f1,_0x8f2229){var _0x2505ba,_0x2650a0,_0x35e9fc;var _0xcb1008=[];var _0x3a39f1={};var _0x13887d=_0x5408f1[_0x9246('0xbe')]||[];var _0x37ee85=[];var _0x4041ad;return db['CmContact'][_0x9246('0x55')]()[_0x9246('0x15')](function(_0x45cae3){if(!_0x45cae3){throw new db[(_0x9246('0x7f'))][(_0x9246('0x80'))](_0x9246('0xbf'));}_0xcb1008=_[_0x9246('0x82')](_[_0x9246('0x35')](_0x45cae3),[_0x9246('0x83'),_0x9246('0x81'),'CompanyId',_0x9246('0x85')]);if(_0x5408f1['body']['id']){delete _0x5408f1[_0x9246('0x4a')]['id'];}if(_['isNil'](_0x5408f1[_0x9246('0x4a')][_0x9246('0x86')])){throw _0x8f2229[_0x9246('0x2d')](0x1f4)[_0x9246('0xc0')](new db['Sequelize'][(_0x9246('0x80'))](_0x9246('0x87')));}if(_[_0x9246('0x71')](_0x5408f1[_0x9246('0x4a')][_0x9246('0x4a')])||_0x5408f1[_0x9246('0x4a')][_0x9246('0x4a')]===''){throw _0x8f2229['status'](0x1f4)[_0x9246('0xc0')](new db['Sequelize'][(_0x9246('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x9246('0x71')](_0x5408f1[_0x9246('0x4a')]['mapKeyOffline'])){throw _0x8f2229[_0x9246('0x2d')](0x1f4)[_0x9246('0xc0')](new db[(_0x9246('0x7f'))]['ValidationError'](_0x9246('0xc1')+_0xcb1008));}if(!_[_0x9246('0x8b')](_0xcb1008,_0x5408f1[_0x9246('0x4a')]['mapKeyOffline'])){throw _0x8f2229[_0x9246('0x2d')](0x1f4)[_0x9246('0xc0')](new db[(_0x9246('0x7f'))]['ValidationError'](_0x9246('0xc2')+_0xcb1008));}_0x3a39f1[_0x5408f1[_0x9246('0x4a')][_0x9246('0xc3')]]=_0x5408f1[_0x9246('0x4a')][_0x9246('0x86')];})[_0x9246('0x15')](function(){return db['ChatWebsite'][_0x9246('0x4f')]({'where':{'id':_0x5408f1[_0x9246('0x53')]['id']},'include':[{'model':db[_0x9246('0xc4')],'as':_0x9246('0x8d')},{'model':db[_0x9246('0xc5')],'as':_0x9246('0xc5')}]});})[_0x9246('0x15')](handleEntityNotFound(_0x8f2229,null))['then'](function(_0x2d6069){if(_0x2d6069&&_0x2d6069[_0x9246('0x8d')]){_0x2650a0=_0x2d6069;var _0x2ebe93=_[_0x9246('0xd')](_0x5408f1[_0x9246('0x4a')],{'firstName':_0x5408f1[_0x9246('0x4a')][_0x9246('0x86')],'phone':_0x5408f1[_0x9246('0x4a')][_0x9246('0x86')],'ListId':_0x2d6069[_0x9246('0x85')]});_0x2ebe93[_0x5408f1[_0x9246('0x4a')]['mapKeyOffline']]=_0x5408f1[_0x9246('0x4a')][_0x9246('0x86')];return db[_0x9246('0x7e')][_0x9246('0xc6')]({'where':_0x3a39f1,'defaults':_0x2ebe93});}})[_0x9246('0xab')](function(_0x53a0d8){if(_0x53a0d8){_0x35e9fc=_0x53a0d8;var _0x167381=fs[_0x9246('0xc7')](path[_0x9246('0x69')](config[_0x9246('0x6a')],_0x9246('0xc8')),_0x9246('0xc9'));var _0x4e027f=ejs[_0x9246('0xca')](_0x167381,{'body':_[_0x9246('0xcb')](_0x5408f1[_0x9246('0x4a')][_0x9246('0x4a')]),'bodyTitle':_0x2650a0['offlineMessageBody']});return db[_0x9246('0xcc')][_0x9246('0x49')]({'body':_0x4e027f,'plainBody':htmlToText['fromString'](_0x4e027f),'ContactId':_0x53a0d8['id'],'ChatWebsiteId':_0x2650a0['id']});}})[_0x9246('0x15')](function(_0x36c7bb){_0x4041ad=_0x36c7bb;if(_0x13887d['length']){var _0x5e9184=_0x13887d[_0x9246('0x5c')](function(_0x12edf3){return{'name':_0x12edf3['originalname'],'basename':_0x12edf3[_0x9246('0x63')],'type':_0x12edf3[_0x9246('0xcd')],'ChatOfflineMessageId':_0x36c7bb['id']};});_0x37ee85=_0x5e9184[_0x9246('0x5c')](_0x262e98=>{var _0xe30e50={'filename':_0x262e98[_0x9246('0x2e')],'path':path['join'](config[_0x9246('0x6a')],'server',_0x9246('0xbe'),_0x9246('0xce'),_0x9246('0xcf'),_0x262e98[_0x9246('0xd0')])};return _0xe30e50;});if(!_0x2650a0[_0x9246('0xd1')]){return db[_0x9246('0xd2')]['transaction'](function(_0x37b0aa){return db['Attachment'][_0x9246('0xd3')](_0x5e9184,{'transaction':_0x37b0aa});});}}})['then'](function(){if(_0x4041ad){_0x2505ba=_0x4041ad;return db[_0x9246('0xc5')][_0x9246('0x5a')]({'where':{'service':!![]},'include':[{'model':db[_0x9246('0xd4')],'as':_0x9246('0xd5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9246('0xd6'),'raw':!![]}]}]});}})[_0x9246('0x15')](function(_0x553a0c){if(_0x553a0c&&_0x553a0c['Smtp']&&_0x2650a0[_0x9246('0xd7')]&&_0x2650a0[_0x9246('0xd8')]){var _0x434636=_0x553a0c[_0x9246('0xd9')]();return respondWithRpcPromise(_0x9246('0xda'),_0x9246('0xdb'),{'account':_0x434636,'message':{'from':util[_0x9246('0xa0')](_0x9246('0xdc'),_0x553a0c[_0x9246('0x2e')],_0x553a0c[_0x9246('0xdd')]||_0x553a0c['Smtp'][_0x9246('0x4b')]),'to':_0x2650a0['forwardOfflineAddress'],'subject':_0x2650a0[_0x9246('0xde')],'html':_0x2505ba['body'],'attachments':_0x37ee85}},client9003)[_0x9246('0x15')](function(){return _0x2505ba;})[_0x9246('0x1f')](function(_0x48e1fb){logger[_0x9246('0x1b')](_0x48e1fb);});}})[_0x9246('0x15')](function(){if(_0x2650a0&&_0x2650a0['openNewInteraction']&&_0x2650a0[_0x9246('0xdf')]){var _0x1c5c63=[];if(_0x13887d[_0x9246('0x3a')]){_0x1c5c63=_0x13887d[_0x9246('0x5c')](function(_0x35e441){return{'name':_0x35e441[_0x9246('0xe0')],'basename':_0x35e441[_0x9246('0x63')],'type':_0x35e441[_0x9246('0xcd')],'ChatOfflineMessageId':_0x4041ad['id']};});}var _0x4dbc08;if(!_[_0x9246('0x71')](_0x2650a0[_0x9246('0xe1')])){var _0x1756f3=_[_0x9246('0x5c')](_0x5408f1['body'],function(_0x4a079b){return _0x4a079b;});var _0x4348fc=_[_0x9246('0xe2')](_0x1756f3)[0x0];var _0x53a049=_[_0x9246('0xe3')](_0x4348fc,function(_0x1c4167){return _0x1c4167;});_0x4dbc08=_0x53a049[0x1][_0x2650a0['subjectOffline']];}var _0x3b43fc={'from':_0x35e9fc[_0x9246('0xdd')],'firstName':_0x35e9fc[_0x9246('0xac')],'lastName':_0x35e9fc[_0x9246('0x9b')],'mapKey':'email','message':{'from':_0x35e9fc[_0x9246('0xdd')],'to':_0x2650a0[_0x9246('0xc5')][_0x9246('0xdd')],'cc':'','subject':_[_0x9246('0x71')](_0x4dbc08)?_0x2650a0[_0x9246('0xde')]:_0x4dbc08,'messageId':'','sentAt':new Date(),'attach':_0x1c5c63['length'],'attachments':_0x1c5c63,'originChannel':'Chat','ChatWebsiteId':_0x2650a0['id'],'ChatOfflineMessageId':_0x2505ba['id'],'originTo':_0x2650a0[_0x9246('0xc5')][_0x9246('0xdd')]},'body':_0x2505ba[_0x9246('0x4a')]};var _0x1df32d={'account':{'id':_0x2650a0[_0x9246('0xdf')]},'body':_0x3b43fc,'log':_0x9246('0xe4')};return respondWithRpcPromise(_0x9246('0xe4'),_0x9246('0xe5'),_0x1df32d,client9001)['then'](function(){return _0x2505ba;})[_0x9246('0x1f')](function(_0x3116ea){logger[_0x9246('0x1b')](_0x3116ea);});}return;})[_0x9246('0x15')](function(){if(_0x2505ba){return _0x2505ba;}})[_0x9246('0x15')](respondWithResult(_0x8f2229,null))[_0x9246('0x1f')](function(_0x3fe679){logger[_0x9246('0x1b')](_0x9246('0x1f'),_0x3fe679);for(var _0x4c4906 of _0x13887d){var _0x28707c=path[_0x9246('0x69')](config[_0x9246('0x6a')],_0x9246('0xe6'),_0x9246('0xbe'),_0x9246('0xce'),_0x9246('0xcf'),_0x4c4906[_0x9246('0x63')]);fs_extra[_0x9246('0xe7')](_0x28707c)['catch'](function(_0x2012f2){logger[_0x9246('0x1b')](_0x9246('0xe8'),_0x28707c,_0x2012f2);});}});};exports['addInteraction']=function(_0x2c5b57,_0x1e016f){return db[_0x9246('0xa8')][_0x9246('0x4f')]({'where':{'id':_0x2c5b57[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x1e016f,null))[_0x9246('0x15')](function(_0x1f5145){if(_0x1f5145){return _0x1f5145[_0x9246('0xe9')](_0x2c5b57[_0x9246('0x4a')][_0x9246('0x61')],_[_0x9246('0xea')](_0x2c5b57[_0x9246('0x4a')],[_0x9246('0x61'),'id'])||{});}})[_0x9246('0x15')](respondWithResult(_0x1e016f,null))[_0x9246('0x1f')](handleError(_0x1e016f,null));};exports[_0x9246('0xeb')]=function(_0x241311,_0xa70a6b){var _0x5c3218={'raw':![],'where':{}};var _0x431222={};var _0x65afb={'count':0x0,'rows':[]};return db[_0x9246('0x30')][_0x9246('0x5a')]({'where':{'id':_0x241311[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0xa70a6b,null))[_0x9246('0x15')](function(_0x12a9ef){if(_0x12a9ef){_0x431222[_0x9246('0x33')]=_[_0x9246('0x35')](db['ChatInteraction'][_0x9246('0x48')]);_0x431222[_0x9246('0x34')]=_[_0x9246('0x35')](_0x241311[_0x9246('0x34')]);_0x431222[_0x9246('0x36')]=_[_0x9246('0x37')](_0x431222[_0x9246('0x33')],_0x431222['query']);_0x5c3218[_0x9246('0x38')]=_[_0x9246('0x37')](_0x431222[_0x9246('0x33')],qs[_0x9246('0x39')](_0x241311[_0x9246('0x34')]['fields']));_0x5c3218['attributes']=_0x5c3218[_0x9246('0x38')]['length']?_0x5c3218[_0x9246('0x38')]:_0x431222[_0x9246('0x33')];if(!_0x241311[_0x9246('0x34')][_0x9246('0x3b')](_0x9246('0x3c'))){_0x5c3218[_0x9246('0x24')]=qs[_0x9246('0x24')](_0x241311[_0x9246('0x34')]['limit']);_0x5c3218[_0x9246('0x22')]=qs[_0x9246('0x22')](_0x241311[_0x9246('0x34')]['offset']);}_0x5c3218['order']=qs[_0x9246('0x3e')](_0x241311[_0x9246('0x34')][_0x9246('0x3e')]);_0x5c3218['where']=qs['filters'](_[_0x9246('0x5b')](_0x241311[_0x9246('0x34')],_0x431222[_0x9246('0x36')]));_0x5c3218[_0x9246('0x3f')]['ChatWebsiteId']=_0x12a9ef['id'];if(_0x241311[_0x9246('0x34')][_0x9246('0x40')]){_0x5c3218['where']=_[_0x9246('0x41')](_0x5c3218[_0x9246('0x3f')],{'$or':_['map'](_0x5c3218[_0x9246('0x38')],function(_0x383cd6){var _0x368d85={};_0x368d85[_0x383cd6]={'$like':'%'+_0x241311[_0x9246('0x34')][_0x9246('0x40')]+'%'};return _0x368d85;})});}_0x5c3218=_[_0x9246('0x41')]({},_0x5c3218,_0x241311[_0x9246('0x43')]);return db['ChatInteraction']['count']({'where':_0x5c3218[_0x9246('0x3f')]})[_0x9246('0x15')](function(_0x458bdd){_0x65afb[_0x9246('0x25')]=_0x458bdd;if(_0x241311[_0x9246('0x34')]['includeAll']){_0x5c3218[_0x9246('0x45')]=[{'model':db[_0x9246('0x7e')],'as':_0x9246('0xec'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9246('0x2e'),_0x9246('0xed'),_0x9246('0xee')],'required':![]},{'model':db[_0x9246('0xef')],'as':_0x9246('0xf0'),'attributes':['id',_0x9246('0x2e'),_0x9246('0xf1')],'where':_0x241311[_0x9246('0x34')][_0x9246('0xf2')]?{'id':_0x241311['query'][_0x9246('0xf2')]}:undefined,'required':_0x241311[_0x9246('0x34')]['tag']?!![]:![]}];}return db[_0x9246('0xa8')][_0x9246('0xf3')](_0x5c3218);})[_0x9246('0x15')](function(_0x443cf3){_0x65afb[_0x9246('0x5d')]=_0x443cf3;return _0x65afb;});}})[_0x9246('0x15')](respondWithFilteredResult(_0xa70a6b,_0x5c3218))[_0x9246('0x1f')](handleError(_0xa70a6b,null));};function iftimePromise(_0x3115c6,_0x4d969d){return respondWithRpcPromise(_0x9246('0xf4'),'getSnippet',{'command':_0x4d969d[_0x9246('0xf5')]?util[_0x9246('0xa0')](_0x9246('0xf6'),_0x3115c6[_0x9246('0xf7')],_0x4d969d[_0x9246('0xf5')]):util['format'](_0x9246('0xf8'),_0x3115c6[_0x9246('0xf7')])},client9002)['then'](function(_0x3c54b1){var _0x454aa8=_0x3c54b1&&_0x3c54b1[_0x9246('0xf9')](_0x9246('0xfa'))>=0x0?!![]:![];logger[_0x9246('0x1e')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4d969d['id'],_0x3115c6['id'],_0x3115c6['interval'],_0x454aa8?_0x9246('0xfb'):_0x9246('0xfc'),_0x4d969d[_0x9246('0xf5')]?_0x4d969d['timezone']:'No\x20timezone');return _0x454aa8;})[_0x9246('0x1f')](function(_0x3be877){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4d969d['id'],_0x3115c6['id'],_0x3115c6[_0x9246('0xf7')],util[_0x9246('0xfd')](_0x3be877,{'showHidden':![],'depth':null}),_0x4d969d[_0x9246('0xf5')]?_0x4d969d['timezone']:_0x9246('0xfe'));return![];});}exports[_0x9246('0xff')]=function(_0x519879,_0x575c25){var _0x32d77b=0x0;var _0x356b29=0x0;var _0x543c73=![];var _0x3fd2f8;var _0x307664;return db['ChatWebsite'][_0x9246('0x4f')]({'where':{'id':_0x519879[_0x9246('0x53')]['id']},'include':[{'model':db[_0x9246('0x100')],'as':_0x9246('0x100'),'include':[{'model':db['Interval'],'as':_0x9246('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x9246('0x15')](handleEntityNotFound(_0x575c25,null))[_0x9246('0x15')](function(_0x295f94){if(_0x295f94){_0x3fd2f8=_0x295f94;return _0x295f94[_0x9246('0x102')]({'raw':!![]});}})[_0x9246('0x15')](function(_0x3b8301){if(_0x3fd2f8){if(_0x3b8301){_0x307664=_0x3b8301;}}return require(_0x9246('0x103'))[_0x9246('0x104')]();})[_0x9246('0x15')](function(_0x132107){if(_0x132107){_0x356b29=_0x132107[_0x9246('0x105')];_0x543c73=_0x132107[_0x9246('0x6c')];}})[_0x9246('0x15')](function(){return db[_0x9246('0xa8')][_0x9246('0x25')]({'where':{'closed':![]}});})[_0x9246('0x15')](function(_0x34c637){_0x32d77b=_0x34c637;if(_0x356b29&&_0x34c637>_0x356b29){return db[_0x9246('0x106')][_0x9246('0x5a')]({'where':{'id':0x1}})[_0x9246('0x15')](function(_0x561df5){if(_0x561df5){_0x561df5[_0x9246('0x107')](_0x9246('0x108'));}});}})[_0x9246('0x15')](function(){if(_0x3fd2f8[_0x9246('0x100')]&&_0x3fd2f8[_0x9246('0x100')][_0x9246('0x101')]){var _0xce569c=[];for(var _0x4bda34=0x0;_0x4bda34<_0x3fd2f8[_0x9246('0x100')][_0x9246('0x101')][_0x9246('0x3a')];_0x4bda34++){var _0x1c1826=_0x3fd2f8[_0x9246('0x100')][_0x9246('0x101')][_0x4bda34][_0x9246('0x2a')]({'plain':!![]});_0xce569c['push'](iftimePromise(_0x1c1826,_0x3fd2f8));}return BPromise[_0x9246('0x109')](_0xce569c)[_0x9246('0x15')](function(_0x14c40b){return _[_0x9246('0x10a')](_0x14c40b);});}else{return!![];}})[_0x9246('0x15')](function(_0x48f89f){var _0x76ac5d=fs['readFileSync'](path['join'](config[_0x9246('0x6a')],'server/files/chat/iframe.ejs'),'utf8');var _0x250e75={'remote':_0x3fd2f8[_0x9246('0x10b')],'query':querystring[_0x9246('0x1a')](_['merge'](_0x3fd2f8['get']({'plain':!![]}),{'customerIp':_0x519879['headers'][_0x9246('0x99')]||_0x519879[_0x9246('0x7a')]['x-real-ip']||_0x519879[_0x9246('0x10c')][_0x9246('0x10d')]||_0x519879['ip'],'referer':_0x519879[_0x9246('0x7a')]['referer'],'openedInteractions':_0x32d77b,'maxInteractions':_0x356b29,'virtual':_0x543c73[_0x9246('0x105')],'online':_0x48f89f,'custom':_0x543c73}))['replace'](/'/g,'\x5c\x27')};_0x575c25[_0x9246('0xc0')](ejs[_0x9246('0xca')](Mustache['render'](_0x76ac5d,_0x250e75),{'proactiveActions':_0x307664,'alignment':_0x3fd2f8[_0x9246('0x10e')],'verticalAlignment':_0x3fd2f8[_0x9246('0x10f')],'div_color':_0x3fd2f8[_0x9246('0xf1')],'labelText':_0x3fd2f8[_0x9246('0x110')],'text_color':_0x3fd2f8[_0x9246('0x111')],'text_button_color':_0x3fd2f8[_0x9246('0x112')],'button_color':_0x3fd2f8[_0x9246('0x113')],'background_color':_0x3fd2f8[_0x9246('0x114')],'hideWhenOffline':_0x3fd2f8[_0x9246('0x115')],'interval':_0x3fd2f8[_0x9246('0x116')]}));})[_0x9246('0x1f')](handleError(_0x575c25,null));};exports[_0x9246('0x117')]=function(_0x590ddb,_0x4321af){var _0x166b37=_0x590ddb['params']['id'];var _0x67bdbc=_0x590ddb[_0x9246('0x4a')];var _0x5bf803=0xc8;var _0x15b726=null;return db['sequelize'][_0x9246('0x118')]({'isolationLevel':db[_0x9246('0xd2')]['Transaction'][_0x9246('0x119')][_0x9246('0x11a')]},function(_0x498bbd){return db[_0x9246('0x30')][_0x9246('0x5a')]({'where':{'id':_0x166b37},'transaction':_0x498bbd})['then'](function(_0x13298d){if(_0x13298d){return db[_0x9246('0x8f')][_0x9246('0x29')]({'where':{'ChatWebsiteId':_0x166b37},'transaction':_0x498bbd})['then'](function(){var _0x5ed5e0=_[_0x9246('0x5c')](_0x67bdbc,function(_0x53f444){_0x53f444[_0x9246('0x57')]=_0x166b37;return _0x53f444;});return db[_0x9246('0x8f')]['bulkCreate'](_0x5ed5e0,{'transaction':_0x498bbd});});}else{_0x5bf803=0x194;_0x15b726=[];}});})[_0x9246('0x15')](function(){if(_0x5bf803!==0x194){return db['ChatApplication'][_0x9246('0x11b')]({'where':{'ChatWebsiteId':_0x166b37},'order':_0x9246('0x94')})[_0x9246('0x15')](function(_0x281bb7){_0x15b726=_0x281bb7;});}})[_0x9246('0x1f')](function(_0x218fe3){_0x5bf803=0x1f4;logger[_0x9246('0x1b')](_0x218fe3[_0x9246('0x11c')]);if(_0x218fe3[_0x9246('0x2e')]){delete _0x218fe3['name'];}_0x15b726=_0x218fe3;})[_0x9246('0x11d')](function(){if(_0x15b726===null){_0x4321af[_0x9246('0x20')](_0x5bf803);}else{if(_0x5bf803===0x1f4){_0x4321af[_0x9246('0x2d')](_0x5bf803)[_0x9246('0xc0')](_0x15b726);}else{_0x4321af[_0x9246('0x2d')](_0x5bf803)[_0x9246('0x27')](_0x15b726);}}});};exports[_0x9246('0x11e')]=function(_0x23fcad,_0x2c3af4){var _0x5e5ad9={};var _0x3abb33={};var _0x46df72;var _0x286832;return db[_0x9246('0x30')][_0x9246('0x5a')]({'where':{'id':_0x23fcad[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x2c3af4,null))[_0x9246('0x15')](function(_0xb688f4){if(_0xb688f4){_0x46df72=_0xb688f4;_0x3abb33[_0x9246('0x33')]=_['keys'](db[_0x9246('0x8f')][_0x9246('0x48')]);_0x3abb33[_0x9246('0x34')]=_['keys'](_0x23fcad[_0x9246('0x34')]);_0x3abb33[_0x9246('0x36')]=_[_0x9246('0x37')](_0x3abb33[_0x9246('0x33')],_0x3abb33[_0x9246('0x34')]);_0x5e5ad9[_0x9246('0x38')]=_[_0x9246('0x37')](_0x3abb33[_0x9246('0x33')],qs[_0x9246('0x39')](_0x23fcad['query'][_0x9246('0x39')]));_0x5e5ad9[_0x9246('0x38')]=_0x5e5ad9[_0x9246('0x38')][_0x9246('0x3a')]?_0x5e5ad9[_0x9246('0x38')]:_0x3abb33[_0x9246('0x33')];_0x5e5ad9[_0x9246('0x3d')]=qs['sort'](_0x23fcad[_0x9246('0x34')]['sort']);_0x5e5ad9[_0x9246('0x3f')]=qs[_0x9246('0x36')](_[_0x9246('0x5b')](_0x23fcad[_0x9246('0x34')],_0x3abb33[_0x9246('0x36')]));if(_0x23fcad[_0x9246('0x34')]['filter']){_0x5e5ad9['where']=_[_0x9246('0x41')](_0x5e5ad9['where'],{'$or':_[_0x9246('0x5c')](_0x5e5ad9['attributes'],function(_0x4f37f7){var _0x411e1e={};_0x411e1e[_0x4f37f7]={'$like':'%'+_0x23fcad[_0x9246('0x34')][_0x9246('0x40')]+'%'};return _0x411e1e;})});}_0x5e5ad9=_[_0x9246('0x41')]({},_0x5e5ad9,_0x23fcad[_0x9246('0x43')]);return _0x46df72[_0x9246('0x11e')](_0x5e5ad9);}})[_0x9246('0x15')](function(_0x27be3f){if(_0x27be3f){_0x286832=_0x27be3f['length'];if(!_0x23fcad[_0x9246('0x34')][_0x9246('0x3b')](_0x9246('0x3c'))){_0x5e5ad9[_0x9246('0x24')]=qs[_0x9246('0x24')](_0x23fcad[_0x9246('0x34')]['limit']);_0x5e5ad9[_0x9246('0x22')]=qs[_0x9246('0x22')](_0x23fcad[_0x9246('0x34')][_0x9246('0x22')]);}return _0x46df72[_0x9246('0x11e')](_0x5e5ad9);}})['then'](function(_0x3d1fba){if(_0x3d1fba){return _0x3d1fba?{'count':_0x286832,'rows':_0x3d1fba}:null;}})['then'](respondWithResult(_0x2c3af4,null))[_0x9246('0x1f')](handleError(_0x2c3af4,null));};exports[_0x9246('0x11f')]=function(_0x109841,_0x2d6a80){return db[_0x9246('0x120')]['find']({'where':{'id':_0x109841[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x2d6a80,null))[_0x9246('0x15')](function(_0x468fa4){if(_0x468fa4){return _0x468fa4[_0x9246('0x11f')](_0x109841[_0x9246('0x4a')]['ids'],_[_0x9246('0xea')](_0x109841[_0x9246('0x4a')],[_0x9246('0x61'),'id'])||{});}})[_0x9246('0x15')](respondWithResult(_0x2d6a80,null))[_0x9246('0x1f')](handleError(_0x2d6a80,null));};exports[_0x9246('0x102')]=function(_0x2b7701,_0x329475){var _0x53a372={};var _0x195002={};var _0x24f06c;var _0x4c91c9;return db['ChatWebsite'][_0x9246('0x5a')]({'where':{'id':_0x2b7701[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x329475,null))[_0x9246('0x15')](function(_0x527518){if(_0x527518){_0x24f06c=_0x527518;_0x195002[_0x9246('0x33')]=_[_0x9246('0x35')](db['ChatProactiveAction']['rawAttributes']);_0x195002['query']=_[_0x9246('0x35')](_0x2b7701[_0x9246('0x34')]);_0x195002['filters']=_[_0x9246('0x37')](_0x195002[_0x9246('0x33')],_0x195002[_0x9246('0x34')]);_0x53a372[_0x9246('0x38')]=_[_0x9246('0x37')](_0x195002[_0x9246('0x33')],qs['fields'](_0x2b7701['query']['fields']));_0x53a372[_0x9246('0x38')]=_0x53a372[_0x9246('0x38')][_0x9246('0x3a')]?_0x53a372[_0x9246('0x38')]:_0x195002['model'];_0x53a372[_0x9246('0x3d')]=qs[_0x9246('0x3e')](_0x2b7701[_0x9246('0x34')][_0x9246('0x3e')]);_0x53a372[_0x9246('0x3f')]=qs[_0x9246('0x36')](_[_0x9246('0x5b')](_0x2b7701['query'],_0x195002['filters']));if(_0x2b7701[_0x9246('0x34')][_0x9246('0x40')]){_0x53a372[_0x9246('0x3f')]=_[_0x9246('0x41')](_0x53a372[_0x9246('0x3f')],{'$or':_[_0x9246('0x5c')](_0x53a372[_0x9246('0x38')],function(_0x44414b){var _0x4b2924={};_0x4b2924[_0x44414b]={'$like':'%'+_0x2b7701['query'][_0x9246('0x40')]+'%'};return _0x4b2924;})});}_0x53a372=_[_0x9246('0x41')]({},_0x53a372,_0x2b7701[_0x9246('0x43')]);return _0x24f06c[_0x9246('0x102')](_0x53a372);}})['then'](function(_0x136d2c){if(_0x136d2c){_0x4c91c9=_0x136d2c[_0x9246('0x3a')];if(!_0x2b7701[_0x9246('0x34')]['hasOwnProperty']('nolimit')){_0x53a372[_0x9246('0x24')]=qs['limit'](_0x2b7701[_0x9246('0x34')][_0x9246('0x24')]);_0x53a372[_0x9246('0x22')]=qs['offset'](_0x2b7701[_0x9246('0x34')][_0x9246('0x22')]);}return _0x24f06c['getProactiveActions'](_0x53a372);}})[_0x9246('0x15')](function(_0x1abb3d){if(_0x1abb3d){return _0x1abb3d?{'count':_0x4c91c9,'rows':_0x1abb3d}:null;}})['then'](respondWithResult(_0x329475,null))[_0x9246('0x1f')](handleError(_0x329475,null));};exports[_0x9246('0x121')]=function(_0x1c857f,_0x3b4ec9){var _0x163261=_0x1c857f[_0x9246('0x34')]['online']==='false'?_0x9246('0x122'):_0x9246('0x123');return db[_0x9246('0x30')][_0x9246('0x4f')]({'attributes':['id',_0x163261],'where':{'id':_0x1c857f['params']['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x3b4ec9,null))[_0x9246('0x15')](function(_0x4c3851){if(_0x4c3851){var _0x2f3f25=_0x4c3851[_0x163261];var _0x2c7ad1=_0x2f3f25&&_0x2f3f25[_0x9246('0x124')]?_0x2f3f25[_0x9246('0x124')]:[];_0x3b4ec9[_0x9246('0xc0')]({'fromKey':_[_0x9246('0x71')](_0x2f3f25[_0x9246('0x125')])?undefined:_0x2f3f25['fromKey'],'count':_0x2c7ad1[_0x9246('0x3a')],'rows':_0x2c7ad1});}})[_0x9246('0x1f')](handleError(_0x3b4ec9,null));};exports['getOfflineMessages']=function(_0x280779,_0x55d6e0){var _0x38d688={'raw':![],'where':{}};var _0x417841={};var _0x1a1be7={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x280779['params']['id']}})['then'](handleEntityNotFound(_0x55d6e0,null))[_0x9246('0x15')](function(_0x11daff){if(_0x11daff){_0x417841[_0x9246('0x33')]=_[_0x9246('0x35')](db['ChatOfflineMessage'][_0x9246('0x48')]);_0x417841[_0x9246('0x34')]=_[_0x9246('0x35')](_0x280779['query']);_0x417841[_0x9246('0x36')]=_[_0x9246('0x37')](_0x417841['model'],_0x417841[_0x9246('0x34')]);_0x38d688[_0x9246('0x38')]=_[_0x9246('0x37')](_0x417841['model'],qs[_0x9246('0x39')](_0x280779['query'][_0x9246('0x39')]));_0x38d688[_0x9246('0x38')]=_0x38d688['attributes']['length']?_0x38d688[_0x9246('0x38')]:_0x417841[_0x9246('0x33')];if(!_0x280779[_0x9246('0x34')][_0x9246('0x3b')]('nolimit')){_0x38d688[_0x9246('0x24')]=qs[_0x9246('0x24')](_0x280779[_0x9246('0x34')][_0x9246('0x24')]);_0x38d688[_0x9246('0x22')]=qs[_0x9246('0x22')](_0x280779['query'][_0x9246('0x22')]);}_0x38d688['order']=qs[_0x9246('0x3e')](_0x280779[_0x9246('0x34')][_0x9246('0x3e')]);_0x38d688['where']=qs['filters'](_[_0x9246('0x5b')](_0x280779[_0x9246('0x34')],_0x417841[_0x9246('0x36')]));_0x38d688[_0x9246('0x3f')][_0x9246('0x57')]=_0x11daff['id'];if(_0x280779['query'][_0x9246('0x40')]){_0x38d688[_0x9246('0x3f')]=_[_0x9246('0x41')](_0x38d688[_0x9246('0x3f')],{'$or':_[_0x9246('0x5c')](_0x38d688[_0x9246('0x38')],function(_0x29e661){var _0x246569={};_0x246569[_0x29e661]={'$like':'%'+_0x280779[_0x9246('0x34')]['filter']+'%'};return _0x246569;})});}_0x38d688=_[_0x9246('0x41')]({},_0x38d688,_0x280779[_0x9246('0x43')]);return db['ChatOfflineMessage'][_0x9246('0x25')]({'where':_0x38d688['where']})[_0x9246('0x15')](function(_0x1dcebf){_0x1a1be7[_0x9246('0x25')]=_0x1dcebf;if(_0x280779[_0x9246('0x34')][_0x9246('0x44')]){_0x38d688[_0x9246('0x45')]=[{'all':!![]}];}else{_0x38d688[_0x9246('0x45')]=[{'model':db[_0x9246('0x7e')],'as':'Contact','required':![]},{'model':db[_0x9246('0x126')],'as':_0x9246('0x127'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x38d688);})[_0x9246('0x15')](function(_0x4f6aa0){_0x1a1be7[_0x9246('0x5d')]=_0x4f6aa0;return _0x1a1be7;});}})[_0x9246('0x15')](respondWithFilteredResult(_0x55d6e0,_0x38d688))['catch'](handleError(_0x55d6e0,null));};exports[_0x9246('0x128')]=function(_0x1e6a4e,_0x1c4741){return db[_0x9246('0x30')][_0x9246('0x4f')]({'where':{'id':_0x1e6a4e[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x1c4741,null))[_0x9246('0x15')](function(_0x37c011){if(_0x37c011){return _0x37c011['addAgents'](_0x1e6a4e[_0x9246('0x4a')][_0x9246('0x61')],_[_0x9246('0xea')](_0x1e6a4e['body'],[_0x9246('0x61'),'id'])||{})[_0x9246('0xab')](function(_0x6966e9){for(var _0xd5e8a6=0x0;_0xd5e8a6<_0x1e6a4e['body'][_0x9246('0x61')]['length'];_0xd5e8a6+=0x1){socket['emit'](_0x9246('0x129'),{'UserId':Number(_0x1e6a4e[_0x9246('0x4a')][_0x9246('0x61')][_0xd5e8a6]),'ChatWebsiteId':Number(_0x1e6a4e[_0x9246('0x53')]['id'])});}return _0x6966e9;});}})['then'](respondWithResult(_0x1c4741,null))[_0x9246('0x1f')](handleError(_0x1c4741,null));};exports['removeAgents']=function(_0x166491,_0x4068be){return db[_0x9246('0x30')]['find']({'where':{'id':_0x166491[_0x9246('0x53')]['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x4068be,null))[_0x9246('0x15')](function(_0x5cf6e8){if(_0x5cf6e8){return _0x5cf6e8[_0x9246('0x12a')](_0x166491[_0x9246('0x34')][_0x9246('0x61')])['then'](function(){if(_[_0x9246('0x12b')](_0x166491[_0x9246('0x34')][_0x9246('0x61')])){for(var _0x5e6a25=0x0;_0x5e6a25<_0x166491[_0x9246('0x34')]['ids'][_0x9246('0x3a')];_0x5e6a25+=0x1){socket[_0x9246('0x12c')]('userChatWebsite:remove',{'UserId':Number(_0x166491[_0x9246('0x34')][_0x9246('0x61')][_0x5e6a25]),'ChatWebsiteId':Number(_0x166491[_0x9246('0x53')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x166491[_0x9246('0x34')][_0x9246('0x61')]),'ChatWebsiteId':Number(_0x166491[_0x9246('0x53')]['id'])});}});}})[_0x9246('0x15')](respondWithStatusCode(_0x4068be,null))[_0x9246('0x1f')](handleError(_0x4068be,null));};exports[_0x9246('0x12d')]=function(_0x4b2e6d,_0x267085){var _0x57e05d={};var _0xe84220={};var _0x582911;var _0x41d662;return db['ChatWebsite'][_0x9246('0x5a')]({'where':{'id':_0x4b2e6d['params']['id']}})[_0x9246('0x15')](handleEntityNotFound(_0x267085,null))[_0x9246('0x15')](function(_0x4bd775){if(_0x4bd775){_0x582911=_0x4bd775;_0xe84220['model']=_['keys'](db[_0x9246('0xb5')][_0x9246('0x48')]);_0xe84220[_0x9246('0x34')]=_[_0x9246('0x35')](_0x4b2e6d[_0x9246('0x34')]);_0xe84220[_0x9246('0x36')]=_[_0x9246('0x37')](_0xe84220[_0x9246('0x33')],_0xe84220[_0x9246('0x34')]);_0x57e05d[_0x9246('0x38')]=_[_0x9246('0x37')](_0xe84220[_0x9246('0x33')],qs[_0x9246('0x39')](_0x4b2e6d['query']['fields']));_0x57e05d[_0x9246('0x38')]=_0x57e05d[_0x9246('0x38')]['length']?_0x57e05d['attributes']:_0xe84220['model'];_0x57e05d[_0x9246('0x3d')]=qs[_0x9246('0x3e')](_0x4b2e6d[_0x9246('0x34')][_0x9246('0x3e')]);_0x57e05d[_0x9246('0x3f')]=qs[_0x9246('0x36')](_[_0x9246('0x5b')](_0x4b2e6d[_0x9246('0x34')],_0xe84220[_0x9246('0x36')]));if(_0x4b2e6d[_0x9246('0x34')][_0x9246('0x40')]){_0x57e05d[_0x9246('0x3f')]=_[_0x9246('0x41')](_0x57e05d[_0x9246('0x3f')],{'$or':_[_0x9246('0x5c')](_0x57e05d[_0x9246('0x38')],function(_0x12861b){var _0x2a88b8={};_0x2a88b8[_0x12861b]={'$like':'%'+_0x4b2e6d[_0x9246('0x34')][_0x9246('0x40')]+'%'};return _0x2a88b8;})});}_0x57e05d=_[_0x9246('0x41')]({},_0x57e05d,_0x4b2e6d['options']);return _0x582911[_0x9246('0x12d')](_0x57e05d);}})[_0x9246('0x15')](function(_0x76c35f){if(_0x76c35f){_0x41d662=_0x76c35f[_0x9246('0x3a')];if(!_0x4b2e6d[_0x9246('0x34')]['hasOwnProperty'](_0x9246('0x3c'))){_0x57e05d['limit']=qs[_0x9246('0x24')](_0x4b2e6d[_0x9246('0x34')][_0x9246('0x24')]);_0x57e05d[_0x9246('0x22')]=qs['offset'](_0x4b2e6d[_0x9246('0x34')][_0x9246('0x22')]);}return _0x582911[_0x9246('0x12d')](_0x57e05d);}})[_0x9246('0x15')](function(_0x107f9e){if(_0x107f9e){return _0x107f9e?{'count':_0x41d662,'rows':_0x107f9e}:null;}})[_0x9246('0x15')](respondWithResult(_0x267085,null))[_0x9246('0x1f')](handleError(_0x267085,null));}; \ No newline at end of file +var _0xd7a3=['html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','status','json','offset','undefined','limit','count','update','get','ChatWebsites','UserProfileResource','destroy','end','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','include','rows','show','params','mandatoryDispositionPause','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','pick','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addLogo','filename','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','existsSync','server/files/images/avatars/system_avatar.png','setUA','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','CmList','List','Applications','account','list','applications','priority','asc','Contacts','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','subjectOffline','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','fullname','internal','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','true','interval','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','virtual','License','chatLicenseExceeded','Intervals','push','all','some','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ChatApplication','bulkCreate','findAndCountAll','finally','sendStatus','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7a3,0x117));var _0x3d7a=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xd7a3[_0x125ff8];return _0x2d9ef;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x3d7a('0x0'));var util=require(_0x3d7a('0x1'));var path=require(_0x3d7a('0x2'));var ejs=require(_0x3d7a('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d7a('0x4'));var querystring=require(_0x3d7a('0x5'));var Redis=require('ioredis');var qs=require(_0x3d7a('0x6'));var logger=require(_0x3d7a('0x7'))(_0x3d7a('0x8'));var config=require(_0x3d7a('0x9'));var db=require(_0x3d7a('0xa'))['db'];config[_0x3d7a('0xb')]=_[_0x3d7a('0xc')](config[_0x3d7a('0xb')],{'host':_0x3d7a('0xd'),'port':0x18eb});var socket=require(_0x3d7a('0xe'))(new Redis(config[_0x3d7a('0xb')]));require('./chatWebsite.socket')[_0x3d7a('0xf')](socket);var htmlToText=require(_0x3d7a('0x10'));var jayson=require(_0x3d7a('0x11'));var client=jayson[_0x3d7a('0x12')][_0x3d7a('0x13')]({'port':0x232c});var client9002=jayson[_0x3d7a('0x12')][_0x3d7a('0x13')]({'port':0x232a});var client9003=jayson['client'][_0x3d7a('0x13')]({'port':0x232b});var client9001=jayson['client'][_0x3d7a('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x158d4a,_0x320f26,_0x33a022,_0x314dc1){return new BPromise(function(_0x5de2f3,_0x2c830d){var _0x4ee757=_0x314dc1||client;return _0x4ee757[_0x3d7a('0x14')](_0x158d4a,_0x33a022)[_0x3d7a('0x15')](function(_0x2e4182){logger[_0x3d7a('0x16')](_0x3d7a('0x17'),_0x320f26,_0x3d7a('0x18'));logger[_0x3d7a('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x320f26,_0x3d7a('0x18'),JSON['stringify'](_0x2e4182));if(_0x2e4182[_0x3d7a('0x1a')]){if(_0x2e4182[_0x3d7a('0x1a')][_0x3d7a('0x1b')]===0x1f4){logger[_0x3d7a('0x1a')](_0x3d7a('0x17'),_0x320f26,_0x2e4182[_0x3d7a('0x1a')][_0x3d7a('0x1c')]);return _0x2c830d(_0x2e4182[_0x3d7a('0x1a')][_0x3d7a('0x1c')]);}logger[_0x3d7a('0x1a')](_0x3d7a('0x17'),_0x320f26,_0x2e4182['error'][_0x3d7a('0x1c')]);return _0x5de2f3(_0x2e4182[_0x3d7a('0x1a')][_0x3d7a('0x1c')]);}else{logger['info'](_0x3d7a('0x17'),_0x320f26,'request\x20sent');_0x5de2f3(_0x2e4182['result'][_0x3d7a('0x1c')]);}})[_0x3d7a('0x1d')](function(_0x5ced8e){logger['error'](_0x3d7a('0x17'),_0x320f26,_0x5ced8e);_0x2c830d(_0x5ced8e);});});}function respondWithStatusCode(_0x43a639,_0x48984e){_0x48984e=_0x48984e||0xcc;return function(_0x1c0b00){if(_0x1c0b00){return _0x43a639['sendStatus'](_0x48984e);}return _0x43a639['status'](_0x48984e)['end']();};}function respondWithResult(_0x4feb49,_0x460f3f){_0x460f3f=_0x460f3f||0xc8;return function(_0x17fcf6){if(_0x17fcf6){return _0x4feb49[_0x3d7a('0x1e')](_0x460f3f)[_0x3d7a('0x1f')](_0x17fcf6);}};}function respondWithFilteredResult(_0x3c7e07,_0xa86fcb){return function(_0x3396b3){if(_0x3396b3){var _0x1c59e3=typeof _0xa86fcb[_0x3d7a('0x20')]===_0x3d7a('0x21')&&typeof _0xa86fcb[_0x3d7a('0x22')]===_0x3d7a('0x21');var _0x1b426e=_0x3396b3['count'];var _0x19851b=_0x1c59e3?0x0:_0xa86fcb['offset'];var _0x390eda=_0x1c59e3?_0x3396b3[_0x3d7a('0x23')]:_0xa86fcb['offset']+_0xa86fcb[_0x3d7a('0x22')];var _0x5dc128;if(_0x390eda>=_0x1b426e){_0x390eda=_0x1b426e;_0x5dc128=0xc8;}else{_0x5dc128=0xce;}_0x3c7e07[_0x3d7a('0x1e')](_0x5dc128);return _0x3c7e07['set']('Content-Range',_0x19851b+'-'+_0x390eda+'/'+_0x1b426e)['json'](_0x3396b3);}return null;};}function saveUpdates(_0x2babf7){return function(_0x136366){if(_0x136366){return _0x136366[_0x3d7a('0x24')](_0x2babf7)['then'](function(_0x468ffe){return _0x468ffe;});}return null;};}function removeEntity(_0x4e5b1a){return function(_0x27625a){if(_0x27625a){return _0x27625a['destroy']()[_0x3d7a('0x15')](function(){var _0x1f3a36=_0x27625a[_0x3d7a('0x25')]({'plain':!![]});var _0x311734=_0x3d7a('0x26');return db[_0x3d7a('0x27')][_0x3d7a('0x28')]({'where':{'type':_0x311734,'resourceId':_0x1f3a36['id']}})[_0x3d7a('0x15')](function(){return _0x27625a;});})[_0x3d7a('0x15')](function(){_0x4e5b1a[_0x3d7a('0x1e')](0xcc)[_0x3d7a('0x29')]();});}};}function handleEntityNotFound(_0x47df32){return function(_0x164684){if(!_0x164684){_0x47df32['sendStatus'](0x194);}return _0x164684;};}function handleError(_0x29c3dd,_0x3934af){_0x3934af=_0x3934af||0x1f4;return function(_0x5b51e8){logger[_0x3d7a('0x1a')](_0x5b51e8[_0x3d7a('0x2a')]);if(_0x5b51e8['name']){delete _0x5b51e8[_0x3d7a('0x2b')];}_0x29c3dd[_0x3d7a('0x1e')](_0x3934af)[_0x3d7a('0x2c')](_0x5b51e8);};}exports[_0x3d7a('0x2d')]=function(_0x514b80,_0x51995e){var _0x76bdc1={'include':[{'model':db[_0x3d7a('0x2e')],'as':'mandatoryDispositionPause'}]},_0x588a7b={},_0x24cb6b={'count':0x0,'rows':[]};var _0x4933d=_[_0x3d7a('0x2f')](db[_0x3d7a('0x30')][_0x3d7a('0x31')],function(_0x59f676){return{'name':_0x59f676[_0x3d7a('0x32')],'type':_0x59f676[_0x3d7a('0x33')][_0x3d7a('0x34')]};});_0x588a7b[_0x3d7a('0x35')]=_[_0x3d7a('0x2f')](_0x4933d,'name');_0x588a7b[_0x3d7a('0x36')]=_[_0x3d7a('0x37')](_0x514b80[_0x3d7a('0x36')]);_0x588a7b[_0x3d7a('0x38')]=_['intersection'](_0x588a7b['model'],_0x588a7b[_0x3d7a('0x36')]);_0x76bdc1[_0x3d7a('0x39')]=_[_0x3d7a('0x3a')](_0x588a7b['model'],qs[_0x3d7a('0x3b')](_0x514b80[_0x3d7a('0x36')][_0x3d7a('0x3b')]));_0x76bdc1[_0x3d7a('0x39')]=_0x76bdc1['attributes']['length']?_0x76bdc1[_0x3d7a('0x39')]:_0x588a7b[_0x3d7a('0x35')];if(!_0x514b80['query'][_0x3d7a('0x3c')](_0x3d7a('0x3d'))){_0x76bdc1[_0x3d7a('0x22')]=qs[_0x3d7a('0x22')](_0x514b80['query']['limit']);_0x76bdc1[_0x3d7a('0x20')]=qs['offset'](_0x514b80[_0x3d7a('0x36')][_0x3d7a('0x20')]);}_0x76bdc1[_0x3d7a('0x3e')]=qs[_0x3d7a('0x3f')](_0x514b80[_0x3d7a('0x36')][_0x3d7a('0x3f')]);_0x76bdc1[_0x3d7a('0x40')]=qs['filters'](_['pick'](_0x514b80[_0x3d7a('0x36')],_0x588a7b[_0x3d7a('0x38')]),_0x4933d);if(_0x514b80[_0x3d7a('0x36')]['filter']){_0x76bdc1[_0x3d7a('0x40')]=_[_0x3d7a('0x41')](_0x76bdc1[_0x3d7a('0x40')],{'$or':_[_0x3d7a('0x2f')](_0x4933d,function(_0x30e4ca){if(_0x30e4ca[_0x3d7a('0x33')]!==_0x3d7a('0x42')){var _0x19fc85={};_0x19fc85[_0x30e4ca[_0x3d7a('0x2b')]]={'$like':'%'+_0x514b80[_0x3d7a('0x36')][_0x3d7a('0x43')]+'%'};return _0x19fc85;}})});}_0x76bdc1=_[_0x3d7a('0x41')]({},_0x76bdc1,_0x514b80['options']);var _0x23eb01={'where':_0x76bdc1[_0x3d7a('0x40')]};return db[_0x3d7a('0x30')][_0x3d7a('0x23')](_0x23eb01)[_0x3d7a('0x15')](function(_0x27f454){_0x24cb6b[_0x3d7a('0x23')]=_0x27f454;if(_0x514b80[_0x3d7a('0x36')]['includeAll']){_0x76bdc1[_0x3d7a('0x44')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x76bdc1);})['then'](function(_0x565731){_0x24cb6b[_0x3d7a('0x45')]=_0x565731;return _0x24cb6b;})[_0x3d7a('0x15')](respondWithFilteredResult(_0x51995e,_0x76bdc1))[_0x3d7a('0x1d')](handleError(_0x51995e,null));};exports[_0x3d7a('0x46')]=function(_0x545fbb,_0x23fbbb){var _0x454a22={'raw':![],'where':{'id':_0x545fbb[_0x3d7a('0x47')]['id']},'include':[{'model':db[_0x3d7a('0x2e')],'as':_0x3d7a('0x48')}]},_0x50ec15={};_0x50ec15[_0x3d7a('0x35')]=_[_0x3d7a('0x37')](db[_0x3d7a('0x30')]['rawAttributes']);_0x50ec15['query']=_[_0x3d7a('0x37')](_0x545fbb[_0x3d7a('0x36')]);_0x50ec15[_0x3d7a('0x38')]=_[_0x3d7a('0x3a')](_0x50ec15[_0x3d7a('0x35')],_0x50ec15[_0x3d7a('0x36')]);_0x454a22[_0x3d7a('0x39')]=_[_0x3d7a('0x3a')](_0x50ec15[_0x3d7a('0x35')],qs['fields'](_0x545fbb['query']['fields']));_0x454a22[_0x3d7a('0x39')]=_0x454a22[_0x3d7a('0x39')][_0x3d7a('0x49')]?_0x454a22[_0x3d7a('0x39')]:_0x50ec15['model'];if(_0x545fbb['query'][_0x3d7a('0x4a')]){_0x454a22[_0x3d7a('0x44')]=[{'all':!![]}];}_0x454a22=_[_0x3d7a('0x41')]({},_0x454a22,_0x545fbb[_0x3d7a('0x4b')]);return db[_0x3d7a('0x30')][_0x3d7a('0x4c')](_0x454a22)['then'](handleEntityNotFound(_0x23fbbb,null))['then'](respondWithResult(_0x23fbbb,null))['catch'](handleError(_0x23fbbb,null));};exports[_0x3d7a('0x4d')]=function(_0x42ddd0,_0x56b9ad){return db['ChatWebsite']['create'](_0x42ddd0[_0x3d7a('0x4e')],{})[_0x3d7a('0x15')](function(_0x43d9de){var _0x26e0a0=_0x42ddd0[_0x3d7a('0x4f')][_0x3d7a('0x25')]({'plain':!![]});if(!_0x26e0a0)throw new Error(_0x3d7a('0x50'));if(_0x26e0a0['role']===_0x3d7a('0x4f')){var _0x1b9621=_0x43d9de[_0x3d7a('0x25')]({'plain':!![]});var _0x1bc966=_0x3d7a('0x26');return db[_0x3d7a('0x51')][_0x3d7a('0x4c')]({'where':{'name':_0x1bc966,'userProfileId':_0x26e0a0[_0x3d7a('0x52')]},'raw':!![]})[_0x3d7a('0x15')](function(_0x11e034){if(_0x11e034&&_0x11e034[_0x3d7a('0x53')]===0x0){return db[_0x3d7a('0x27')]['create']({'name':_0x1b9621[_0x3d7a('0x2b')],'resourceId':_0x1b9621['id'],'type':_0x11e034[_0x3d7a('0x2b')],'sectionId':_0x11e034['id']},{})['then'](function(){return _0x43d9de;});}else{return _0x43d9de;}})[_0x3d7a('0x1d')](function(_0x49befc){logger[_0x3d7a('0x1a')](_0x3d7a('0x54'),_0x49befc);throw _0x49befc;});}return _0x43d9de;})[_0x3d7a('0x15')](respondWithResult(_0x56b9ad,0xc9))[_0x3d7a('0x1d')](handleError(_0x56b9ad,null));};exports[_0x3d7a('0x24')]=function(_0xe93bd5,_0x2ab40b){if(_0xe93bd5[_0x3d7a('0x4e')]['id']){delete _0xe93bd5[_0x3d7a('0x4e')]['id'];}return db['ChatWebsite'][_0x3d7a('0x4c')]({'where':{'id':_0xe93bd5['params']['id']},'include':[{'model':db[_0x3d7a('0x2e')],'as':_0x3d7a('0x48')}]})[_0x3d7a('0x15')](handleEntityNotFound(_0x2ab40b,null))[_0x3d7a('0x15')](saveUpdates(_0xe93bd5[_0x3d7a('0x4e')],null))[_0x3d7a('0x15')](respondWithResult(_0x2ab40b,null))[_0x3d7a('0x1d')](handleError(_0x2ab40b,null));};exports[_0x3d7a('0x28')]=function(_0x3430b9,_0x47f356){return db[_0x3d7a('0x30')][_0x3d7a('0x4c')]({'where':{'id':_0x3430b9['params']['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x47f356,null))[_0x3d7a('0x15')](removeEntity(_0x47f356,null))[_0x3d7a('0x1d')](handleError(_0x47f356,null));};exports[_0x3d7a('0x55')]=function(_0x2f4e36,_0x10aa1b){return db[_0x3d7a('0x30')]['describe']()[_0x3d7a('0x15')](respondWithResult(_0x10aa1b,null))['catch'](handleError(_0x10aa1b,null));};exports['addDisposition']=function(_0x592ffe,_0x4a1587){if(_0x592ffe['body']['id']){delete _0x592ffe[_0x3d7a('0x4e')]['id'];}return db[_0x3d7a('0x30')]['find']({'where':{'id':_0x592ffe[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x4a1587,null))[_0x3d7a('0x15')](function(_0x4a42a2){if(_0x4a42a2){_0x592ffe['body']['ChatWebsiteId']=_0x4a42a2['id'];return db[_0x3d7a('0x56')][_0x3d7a('0x4d')](_0x592ffe[_0x3d7a('0x4e')]);}})['then'](respondWithResult(_0x4a1587,null))[_0x3d7a('0x1d')](handleError(_0x4a1587,null));};exports['getDispositions']=function(_0x172150,_0x1ab402){var _0x1e2c22={'raw':![],'where':{}};var _0x2b4132={};var _0x2f2587={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x172150[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x1ab402,null))[_0x3d7a('0x15')](function(_0x48a3c6){if(_0x48a3c6){_0x2b4132['model']=_[_0x3d7a('0x37')](db[_0x3d7a('0x56')]['rawAttributes']);_0x2b4132[_0x3d7a('0x36')]=_[_0x3d7a('0x37')](_0x172150[_0x3d7a('0x36')]);_0x2b4132[_0x3d7a('0x38')]=_[_0x3d7a('0x3a')](_0x2b4132[_0x3d7a('0x35')],_0x2b4132[_0x3d7a('0x36')]);_0x1e2c22[_0x3d7a('0x39')]=_[_0x3d7a('0x3a')](_0x2b4132[_0x3d7a('0x35')],qs['fields'](_0x172150['query']['fields']));_0x1e2c22['attributes']=_0x1e2c22[_0x3d7a('0x39')]['length']?_0x1e2c22[_0x3d7a('0x39')]:_0x2b4132['model'];if(!_0x172150[_0x3d7a('0x36')][_0x3d7a('0x3c')](_0x3d7a('0x3d'))){_0x1e2c22[_0x3d7a('0x22')]=qs[_0x3d7a('0x22')](_0x172150[_0x3d7a('0x36')][_0x3d7a('0x22')]);_0x1e2c22['offset']=qs[_0x3d7a('0x20')](_0x172150[_0x3d7a('0x36')][_0x3d7a('0x20')]);}_0x1e2c22['order']=qs['sort'](_0x172150[_0x3d7a('0x36')][_0x3d7a('0x3f')]);_0x1e2c22[_0x3d7a('0x40')]=qs[_0x3d7a('0x38')](_[_0x3d7a('0x57')](_0x172150[_0x3d7a('0x36')],_0x2b4132[_0x3d7a('0x38')]));_0x1e2c22[_0x3d7a('0x40')]['ChatWebsiteId']=_0x48a3c6['id'];if(_0x172150[_0x3d7a('0x36')][_0x3d7a('0x43')]){_0x1e2c22[_0x3d7a('0x40')]=_[_0x3d7a('0x41')](_0x1e2c22[_0x3d7a('0x40')],{'$or':_[_0x3d7a('0x2f')](_0x1e2c22[_0x3d7a('0x39')],function(_0x3cf6ea){var _0x3c79aa={};_0x3c79aa[_0x3cf6ea]={'$like':'%'+_0x172150['query'][_0x3d7a('0x43')]+'%'};return _0x3c79aa;})});}_0x1e2c22=_[_0x3d7a('0x41')]({},_0x1e2c22,_0x172150[_0x3d7a('0x4b')]);return db[_0x3d7a('0x56')]['count']({'where':_0x1e2c22['where']})[_0x3d7a('0x15')](function(_0x4c8f42){_0x2f2587['count']=_0x4c8f42;if(_0x172150[_0x3d7a('0x36')][_0x3d7a('0x4a')]){_0x1e2c22[_0x3d7a('0x44')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1e2c22);})[_0x3d7a('0x15')](function(_0x57d4f7){_0x2f2587[_0x3d7a('0x45')]=_0x57d4f7;return _0x2f2587;});}})[_0x3d7a('0x15')](respondWithFilteredResult(_0x1ab402,_0x1e2c22))[_0x3d7a('0x1d')](handleError(_0x1ab402,null));};exports[_0x3d7a('0x58')]=function(_0x444080,_0x70df70){return db[_0x3d7a('0x30')][_0x3d7a('0x4c')]({'where':{'id':_0x444080[_0x3d7a('0x47')]['id']}})['then'](handleEntityNotFound(_0x70df70,null))[_0x3d7a('0x15')](function(_0x1a304c){if(_0x1a304c){return _0x1a304c['removeDispositions'](_0x444080[_0x3d7a('0x36')][_0x3d7a('0x59')]);}})[_0x3d7a('0x15')](respondWithStatusCode(_0x70df70,null))[_0x3d7a('0x1d')](handleError(_0x70df70,null));};exports[_0x3d7a('0x5a')]=function(_0x671d01,_0x5e7b92){if(_0x671d01[_0x3d7a('0x4e')]['id']){delete _0x671d01[_0x3d7a('0x4e')]['id'];}return db[_0x3d7a('0x30')]['find']({'where':{'id':_0x671d01[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x5e7b92,null))[_0x3d7a('0x15')](function(_0x168d60){if(_0x168d60){_0x671d01[_0x3d7a('0x4e')][_0x3d7a('0x5b')]=_0x168d60['id'];return db[_0x3d7a('0x5c')][_0x3d7a('0x4d')](_0x671d01['body']);}})[_0x3d7a('0x15')](respondWithResult(_0x5e7b92,null))[_0x3d7a('0x1d')](handleError(_0x5e7b92,null));};exports[_0x3d7a('0x5d')]=function(_0x45b651,_0x1f4685){var _0xdd2d={'raw':![],'where':{}};var _0x3bccfd={};var _0x369b6d={'count':0x0,'rows':[]};return db[_0x3d7a('0x30')][_0x3d7a('0x5e')]({'where':{'id':_0x45b651[_0x3d7a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f4685,null))[_0x3d7a('0x15')](function(_0x595f74){if(_0x595f74){_0x3bccfd['model']=_[_0x3d7a('0x37')](db[_0x3d7a('0x5c')]['rawAttributes']);_0x3bccfd[_0x3d7a('0x36')]=_[_0x3d7a('0x37')](_0x45b651[_0x3d7a('0x36')]);_0x3bccfd['filters']=_['intersection'](_0x3bccfd[_0x3d7a('0x35')],_0x3bccfd[_0x3d7a('0x36')]);_0xdd2d[_0x3d7a('0x39')]=_['intersection'](_0x3bccfd['model'],qs[_0x3d7a('0x3b')](_0x45b651['query']['fields']));_0xdd2d[_0x3d7a('0x39')]=_0xdd2d[_0x3d7a('0x39')][_0x3d7a('0x49')]?_0xdd2d[_0x3d7a('0x39')]:_0x3bccfd[_0x3d7a('0x35')];if(!_0x45b651[_0x3d7a('0x36')]['hasOwnProperty'](_0x3d7a('0x3d'))){_0xdd2d[_0x3d7a('0x22')]=qs['limit'](_0x45b651[_0x3d7a('0x36')]['limit']);_0xdd2d[_0x3d7a('0x20')]=qs[_0x3d7a('0x20')](_0x45b651[_0x3d7a('0x36')]['offset']);}_0xdd2d[_0x3d7a('0x3e')]=qs['sort'](_0x45b651[_0x3d7a('0x36')]['sort']);_0xdd2d[_0x3d7a('0x40')]=qs[_0x3d7a('0x38')](_[_0x3d7a('0x57')](_0x45b651['query'],_0x3bccfd[_0x3d7a('0x38')]));_0xdd2d[_0x3d7a('0x40')][_0x3d7a('0x5b')]=_0x595f74['id'];if(_0x45b651[_0x3d7a('0x36')][_0x3d7a('0x43')]){_0xdd2d['where']=_[_0x3d7a('0x41')](_0xdd2d[_0x3d7a('0x40')],{'$or':_[_0x3d7a('0x2f')](_0xdd2d[_0x3d7a('0x39')],function(_0x42b37e){var _0x1810a5={};_0x1810a5[_0x42b37e]={'$like':'%'+_0x45b651[_0x3d7a('0x36')]['filter']+'%'};return _0x1810a5;})});}_0xdd2d=_[_0x3d7a('0x41')]({},_0xdd2d,_0x45b651['options']);return db[_0x3d7a('0x5c')][_0x3d7a('0x23')]({'where':_0xdd2d[_0x3d7a('0x40')]})[_0x3d7a('0x15')](function(_0x2e4fee){_0x369b6d['count']=_0x2e4fee;if(_0x45b651['query']['includeAll']){_0xdd2d['include']=[{'all':!![]}];}return db[_0x3d7a('0x5c')][_0x3d7a('0x5f')](_0xdd2d);})[_0x3d7a('0x15')](function(_0x1de0d7){_0x369b6d[_0x3d7a('0x45')]=_0x1de0d7;return _0x369b6d;});}})[_0x3d7a('0x15')](respondWithFilteredResult(_0x1f4685,_0xdd2d))[_0x3d7a('0x1d')](handleError(_0x1f4685,null));};exports[_0x3d7a('0x60')]=function(_0x5e6419,_0x31a6db){return db['ChatWebsite'][_0x3d7a('0x4c')]({'where':{'id':_0x5e6419[_0x3d7a('0x47')]['id']}})['then'](handleEntityNotFound(_0x31a6db,null))[_0x3d7a('0x15')](function(_0x375de2){if(_0x375de2){return _0x375de2[_0x3d7a('0x60')](_0x5e6419[_0x3d7a('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x31a6db,null))[_0x3d7a('0x1d')](handleError(_0x31a6db,null));};exports[_0x3d7a('0x61')]=function(_0x4b4d55,_0x3c60dd){_0x4b4d55[_0x3d7a('0x4e')]['sitepic']=_0x4b4d55['file'][_0x3d7a('0x62')];return db[_0x3d7a('0x30')][_0x3d7a('0x4c')]({'where':{'id':_0x4b4d55[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x3c60dd,null))['then'](saveUpdates(_0x4b4d55['body'],null))[_0x3d7a('0x15')](respondWithResult(_0x3c60dd,null))[_0x3d7a('0x1d')](handleError(_0x3c60dd,null));};exports['addAvatar']=function(_0x360bb6,_0x538b70){_0x360bb6[_0x3d7a('0x4e')][_0x3d7a('0x63')]=_0x360bb6[_0x3d7a('0x64')]['filename'];return db[_0x3d7a('0x30')][_0x3d7a('0x4c')]({'where':{'id':_0x360bb6[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x538b70,null))[_0x3d7a('0x15')](saveUpdates(_0x360bb6[_0x3d7a('0x4e')],null))[_0x3d7a('0x15')](respondWithResult(_0x538b70,null))[_0x3d7a('0x1d')](handleError(_0x538b70,null));};exports[_0x3d7a('0x65')]=function(_0x29c5a5,_0x110b25){_0x29c5a5[_0x3d7a('0x4e')][_0x3d7a('0x66')]=_0x29c5a5['file'][_0x3d7a('0x62')];return db[_0x3d7a('0x30')]['find']({'where':{'id':_0x29c5a5[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x110b25,null))[_0x3d7a('0x15')](saveUpdates(_0x29c5a5[_0x3d7a('0x4e')],null))[_0x3d7a('0x15')](respondWithResult(_0x110b25,null))[_0x3d7a('0x1d')](handleError(_0x110b25,null));};exports[_0x3d7a('0x67')]=function(_0xbd78b,_0x4fbd3a){_0xbd78b[_0x3d7a('0x4e')][_0x3d7a('0x68')]=_0xbd78b[_0x3d7a('0x64')]['filename'];return db[_0x3d7a('0x30')][_0x3d7a('0x4c')]({'where':{'id':_0xbd78b[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x4fbd3a,null))[_0x3d7a('0x15')](saveUpdates(_0xbd78b[_0x3d7a('0x4e')],null))[_0x3d7a('0x15')](respondWithResult(_0x4fbd3a,null))[_0x3d7a('0x1d')](handleError(_0x4fbd3a,null));};exports[_0x3d7a('0x69')]=function(_0x34f978,_0x37f97e){var _0x438fc4=path[_0x3d7a('0x6a')](config['root'],_0x3d7a('0x6b'));var _0x31a996={'where':{'id':_0x34f978[_0x3d7a('0x47')]['id']},'attributes':['id',_0x3d7a('0x6c')],'raw':!![]};var _0x38b233=![];return require(_0x3d7a('0x6d'))[_0x3d7a('0x6e')]()[_0x3d7a('0x15')](function(_0x447c68){if(_0x447c68){_0x38b233=_0x447c68[_0x3d7a('0x6f')];}})[_0x3d7a('0x15')](function(){return db[_0x3d7a('0x30')][_0x3d7a('0x4c')](_0x31a996);})[_0x3d7a('0x15')](handleEntityNotFound(_0x37f97e,null))[_0x3d7a('0x15')](function(_0x54195d){if(_0x54195d){if(!_[_0x3d7a('0x70')](_0x54195d[_0x3d7a('0x6c')])){if(fs['existsSync'](path['join'](config[_0x3d7a('0x71')],_0x3d7a('0x72'),_0x54195d[_0x3d7a('0x6c')]))&&_0x38b233){_0x438fc4=path['join'](config[_0x3d7a('0x71')],'server/files/images/logos/',_0x54195d[_0x3d7a('0x6c')]);}}return _0x37f97e[_0x3d7a('0x73')](_0x438fc4);}})[_0x3d7a('0x1d')](handleError(_0x37f97e,null));};exports[_0x3d7a('0x74')]=function(_0x16d6ac,_0x4b6508){var _0x12a112=path[_0x3d7a('0x6a')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x517475={'where':{'id':_0x16d6ac[_0x3d7a('0x47')]['id']},'attributes':['id',_0x3d7a('0x63')],'raw':!![]};return db[_0x3d7a('0x30')][_0x3d7a('0x4c')](_0x517475)[_0x3d7a('0x15')](handleEntityNotFound(_0x4b6508,null))[_0x3d7a('0x15')](function(_0x439d0b){if(_0x439d0b){if(!_[_0x3d7a('0x70')](_0x439d0b[_0x3d7a('0x63')])){if(fs['existsSync'](path['join'](config['root'],_0x3d7a('0x75'),_0x439d0b['agentAvatar']))){_0x12a112=path[_0x3d7a('0x6a')](config[_0x3d7a('0x71')],_0x3d7a('0x75'),_0x439d0b['agentAvatar']);}}return _0x4b6508[_0x3d7a('0x73')](_0x12a112);}})['catch'](handleError(_0x4b6508,null));};exports[_0x3d7a('0x76')]=function(_0x280aea,_0x59764b){var _0x39ac93=path[_0x3d7a('0x6a')](config[_0x3d7a('0x71')],'server/files/images/avatars/customer_avatar.png');var _0x4422fc={'where':{'id':_0x280aea[_0x3d7a('0x47')]['id']},'attributes':['id',_0x3d7a('0x66'),_0x3d7a('0x77')],'raw':!![]};return db['ChatWebsite'][_0x3d7a('0x4c')](_0x4422fc)[_0x3d7a('0x15')](handleEntityNotFound(_0x59764b,null))[_0x3d7a('0x15')](function(_0x43bedf){if(_0x43bedf){if(!_['isNil'](_0x43bedf['customerAvatar'])){if(fs[_0x3d7a('0x78')](path[_0x3d7a('0x6a')](config[_0x3d7a('0x71')],_0x3d7a('0x75'),_0x43bedf[_0x3d7a('0x66')]))&&_0x43bedf[_0x3d7a('0x77')]){_0x39ac93=path[_0x3d7a('0x6a')](config[_0x3d7a('0x71')],_0x3d7a('0x75'),_0x43bedf[_0x3d7a('0x66')]);}}return _0x59764b[_0x3d7a('0x73')](_0x39ac93);}})[_0x3d7a('0x1d')](handleError(_0x59764b,null));};exports['getSystemAvatar']=function(_0x41028e,_0x31fad3){var _0x33d460=path[_0x3d7a('0x6a')](config[_0x3d7a('0x71')],_0x3d7a('0x79'));var _0x4d98ab={'where':{'id':_0x41028e[_0x3d7a('0x47')]['id']},'attributes':['id',_0x3d7a('0x68')],'raw':!![]};return db['ChatWebsite'][_0x3d7a('0x4c')](_0x4d98ab)[_0x3d7a('0x15')](handleEntityNotFound(_0x31fad3,null))[_0x3d7a('0x15')](function(_0x5166fb){if(_0x5166fb){if(!_[_0x3d7a('0x70')](_0x5166fb['systemAvatar'])){if(fs[_0x3d7a('0x78')](path['join'](config['root'],_0x3d7a('0x75'),_0x5166fb[_0x3d7a('0x68')]))){_0x33d460=path['join'](config[_0x3d7a('0x71')],_0x3d7a('0x75'),_0x5166fb['systemAvatar']);}}return _0x31fad3[_0x3d7a('0x73')](_0x33d460);}})[_0x3d7a('0x1d')](handleError(_0x31fad3,null));};exports['notify']=function(_0x3f66fd,_0x4f2da8){var _0xb55825=require('user-agent-parser');var _0x5e24d1=new _0xb55825();var _0xf88ef9=_0x5e24d1[_0x3d7a('0x7a')](_0x3f66fd['headers'][_0x3d7a('0x7b')])['getResult']();var _0x5cfea5={'body':_0x3f66fd[_0x3d7a('0x4e')],'channel':_0x3d7a('0x7c')};var _0x3d5662=[];var _0x463e61=[];var _0x21ef35={};var _0x6ac420=![];return db[_0x3d7a('0x7d')][_0x3d7a('0x55')]()[_0x3d7a('0x15')](function(_0x5a8575){if(!_0x5a8575){throw new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))](_0x3d7a('0x80'));}_0x3d5662=_[_0x3d7a('0x81')](_[_0x3d7a('0x37')](_0x5a8575),[_0x3d7a('0x82'),_0x3d7a('0x83')]);_0x463e61=_[_0x3d7a('0x81')](_[_0x3d7a('0x37')](_0x5a8575),[_0x3d7a('0x82'),_0x3d7a('0x83'),_0x3d7a('0x84'),_0x3d7a('0x85')]);if(_0x3f66fd[_0x3d7a('0x4e')]['id']){delete _0x3f66fd['body']['id'];}if(_[_0x3d7a('0x70')](_0x3f66fd[_0x3d7a('0x4e')]['from'])){throw new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))](_0x3d7a('0x86'));}if(_['isNil'](_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0x4e')])||_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0x4e')]===''){throw new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))](_0x3d7a('0x87'));}if(_[_0x3d7a('0x70')](_0x3f66fd['body'][_0x3d7a('0x88')])){throw new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x463e61);}if(!_[_0x3d7a('0x89')](_0x463e61,_0x3f66fd[_0x3d7a('0x4e')]['mapKey'])){throw new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x463e61);}_0x21ef35[_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0x88')]]=_0x3f66fd['body'][_0x3d7a('0x8a')];})[_0x3d7a('0x15')](function(){return db[_0x3d7a('0x30')]['find']({'where':{'id':_0x3f66fd['params']['id']},'include':[{'model':db[_0x3d7a('0x8b')],'as':_0x3d7a('0x8c'),'include':[{'model':db[_0x3d7a('0x7d')],'as':'Contacts','where':_0x21ef35,'limit':0x1,'order':[[_0x3d7a('0x83'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x3d7a('0x8d')}]});})['then'](handleEntityNotFound(_0x4f2da8,null))[_0x3d7a('0x15')](function(_0x4752b9){if(_0x4752b9&&_0x4752b9[_0x3d7a('0x8c')]){_0x5cfea5[_0x3d7a('0x8e')]=_0x4752b9;_0x5cfea5['applications']=_0x4752b9['Applications'];_0x5cfea5[_0x3d7a('0x8f')]=_0x4752b9[_0x3d7a('0x8c')];_0x5cfea5['applications']=_['orderBy'](_0x5cfea5[_0x3d7a('0x90')],[_0x3d7a('0x91')],[_0x3d7a('0x92')]);if(_0x5cfea5[_0x3d7a('0x8e')][_0x3d7a('0x8d')]){delete _0x5cfea5[_0x3d7a('0x8e')][_0x3d7a('0x8d')];}if(_0x5cfea5['account']['List']&&_0x5cfea5[_0x3d7a('0x8e')][_0x3d7a('0x8c')]['Contacts']['length']){return _0x5cfea5['account']['List'][_0x3d7a('0x93')][0x0];}var _0x502535=_['defaults'](_0x3f66fd[_0x3d7a('0x4e')],{'firstName':_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0x8a')],'ListId':_0x4752b9['ListId']});_0x502535[_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0x88')]]=_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0x8a')];return db[_0x3d7a('0x7d')][_0x3d7a('0x4d')](_0x502535,{'fields':_0x3d5662,'raw':!![]});}})[_0x3d7a('0x15')](handleEntityNotFound(_0x4f2da8,null))[_0x3d7a('0x15')](function(_0x3f13f4){_0x5cfea5[_0x3d7a('0x94')]=_0x3f13f4;var _0x204cc4=_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0x95')];if(_0x3f66fd[_0x3d7a('0x96')]['cf-connecting-ip']){_0x204cc4=_0x3f66fd[_0x3d7a('0x96')][_0x3d7a('0x97')];}else if(_0x3f66fd[_0x3d7a('0x96')][_0x3d7a('0x98')]){_0x204cc4=_[_0x3d7a('0x99')](_0x3f66fd['headers'][_0x3d7a('0x98')][_0x3d7a('0x9a')](','));}if(_0x3f13f4){var _0x4fd8be={'ContactId':_0x3f13f4['id'],'ChatWebsiteId':_0x3f66fd[_0x3d7a('0x47')]['id'],'from':(_0x3f13f4['firstName']||'')+'\x20'+(_0x3f13f4[_0x3d7a('0x9b')]||''),'customerIp':_0x204cc4,'customerPort':_0x3f66fd['headers']['x-real-port']?_0x3f66fd[_0x3d7a('0x96')][_0x3d7a('0x9c')]:null,'referer':_0x3f66fd['body'][_0x3d7a('0x9d')],'browserName':_0xf88ef9[_0x3d7a('0x9e')][_0x3d7a('0x2b')]&&_0xf88ef9['browser'][_0x3d7a('0x9f')]?util['format'](_0x3d7a('0xa0'),_0xf88ef9[_0x3d7a('0x9e')][_0x3d7a('0x2b')],_0xf88ef9[_0x3d7a('0x9e')]['version']):_0x3d7a('0xa1'),'browserVersion':_0xf88ef9['browser'][_0x3d7a('0x9f')]||'unknown','osName':util[_0x3d7a('0xa2')](_0x3d7a('0xa0'),_0xf88ef9['os']['name'],_0xf88ef9['os'][_0x3d7a('0x9f')]),'osVersion':_0xf88ef9['os'][_0x3d7a('0x9f')],'deviceModel':_0xf88ef9[_0x3d7a('0xa3')][_0x3d7a('0x35')]&&_0xf88ef9['device'][_0x3d7a('0xa4')]?util['format'](_0x3d7a('0xa5'),_0xf88ef9[_0x3d7a('0xa3')][_0x3d7a('0x35')],_0xf88ef9['device'][_0x3d7a('0xa4')],_0xf88ef9['device'][_0x3d7a('0x33')]):null,'deviceVendor':_0xf88ef9[_0x3d7a('0xa3')]['vendor'],'deviceType':_0xf88ef9[_0x3d7a('0xa3')]['type'],'formData':JSON[_0x3d7a('0xa6')](_0x3f66fd[_0x3d7a('0x4e')])};var _0x29af80={'ChatWebsiteId':_0x3f66fd[_0x3d7a('0x47')]['id'],'closed':![]};if(_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0xa7')]){_0x29af80['threadId']=_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0xa7')];return db[_0x3d7a('0xa8')][_0x3d7a('0x4c')]({'where':_0x29af80})[_0x3d7a('0x15')](function(_0x1a4dba){if(_0x1a4dba){return[_0x1a4dba,![]];}_0x4fd8be[_0x3d7a('0xa7')]=_0x3f66fd[_0x3d7a('0x4e')]['threadId'];_0x4fd8be[_0x3d7a('0xa9')]=_0x3f66fd[_0x3d7a('0x4e')]['externalUrl'];return db['ChatInteraction']['create'](_0x4fd8be)[_0x3d7a('0x15')](function(_0x428200){return[_0x428200,!![]];});});}_0x29af80[_0x3d7a('0xaa')]=_0x3f13f4['id'];if(_0x3f66fd[_0x3d7a('0x4e')]['interaction']&&_0x3f66fd['body']['interaction']['id']){_0x29af80['id']=_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0xab')]['id'];return db[_0x3d7a('0xa8')][_0x3d7a('0x4c')]({'where':_0x29af80})[_0x3d7a('0x15')](function(_0x385e74){if(_0x385e74){return[_0x385e74,![]];}return db[_0x3d7a('0xa8')]['create'](_0x4fd8be)[_0x3d7a('0x15')](function(_0x3a477e){return[_0x3a477e,!![]];});});}return db['ChatInteraction'][_0x3d7a('0x4d')](_0x4fd8be)[_0x3d7a('0x15')](function(_0x415438){return[_0x415438,!![]];});}})[_0x3d7a('0xac')](function(_0x48144f,_0x4de183){if(_0x48144f){_0x6ac420=_0x4de183;if(!_0x4de183){var _0x3cb206={'from':(_0x5cfea5[_0x3d7a('0x94')][_0x3d7a('0xad')]||'')+'\x20'+(_0x5cfea5['contact']['lastName']||'')};if(_0x3f66fd[_0x3d7a('0x4e')]['threadId']&&_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0xae')]&&_0x3f66fd['body'][_0x3d7a('0xa7')]!=_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0xae')]){_0x3cb206[_0x3d7a('0xa7')]=_0x3f66fd[_0x3d7a('0x4e')][_0x3d7a('0xae')];}return _0x48144f[_0x3d7a('0x24')](_0x3cb206);}else{return _0x48144f;}}})[_0x3d7a('0x15')](function(_0x4a099c){_0x5cfea5[_0x3d7a('0xab')]=_0x4a099c[_0x3d7a('0x25')]({'plain':!![]});_0x5cfea5[_0x3d7a('0xab')][_0x3d7a('0xaf')]=_0x6ac420;if(_0x5cfea5['interaction'][_0x3d7a('0xaf')]){if(_0x5cfea5['account'][_0x3d7a('0xb0')]){_0x5cfea5[_0x3d7a('0x90')]['push']({'id':0x0,'priority':_0x5cfea5[_0x3d7a('0x90')]['length']+0x1,'app':_0x3d7a('0xb1'),'appdata':_0x3d7a('0xb2'),'interval':'*,*,*,*'});}}return db[_0x3d7a('0xb3')][_0x3d7a('0x4d')]({'body':_0x3f66fd['body']['body'],'ChatWebsiteId':_0x3f66fd[_0x3d7a('0x47')]['id'],'ChatInteractionId':_0x4a099c['id'],'direction':'in','ContactId':_0x5cfea5[_0x3d7a('0x94')]['id'],'AttachmentId':_0x3f66fd['body'][_0x3d7a('0xb4')]});})[_0x3d7a('0x15')](function(_0x4cee22){_0x5cfea5['message']=_0x4cee22;if(_0x5cfea5[_0x3d7a('0xab')]['UserId']){return db[_0x3d7a('0xb5')][_0x3d7a('0x4c')]({'attributes':['id',_0x3d7a('0x2b')],'where':{'id':_0x5cfea5[_0x3d7a('0xab')][_0x3d7a('0xb6')]}})['then'](function(_0x4dc187){if(_0x4dc187){_0x5cfea5[_0x3d7a('0x90')][_0x3d7a('0xb7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4dc187['name']+','+(_0x5cfea5['account'][_0x3d7a('0xb8')]||0xa),'interval':_0x3d7a('0xb9')});_0x5cfea5[_0x3d7a('0xba')]=!![];}return respondWithRpcPromise('Start',_0x3d7a('0xbb'),_0x5cfea5);});}return respondWithRpcPromise(_0x3d7a('0xbc'),_0x3d7a('0xbb'),_0x5cfea5);})[_0x3d7a('0x15')](function(_0x18d482){respondWithRpcPromise(_0x3d7a('0xbd'),_0x3d7a('0xbd'),{'event':_0x3d7a('0xbe'),'message':_0x18d482},client9002);return _0x18d482;})[_0x3d7a('0x15')](respondWithResult(_0x4f2da8,null))[_0x3d7a('0x1d')](handleError(_0x4f2da8,null));};exports[_0x3d7a('0xbf')]=function(_0x463ce1,_0x158154){var _0x3f4a9b,_0x54c11a,_0x476bf6;var _0x538fc6=[];var _0x3f5c23={};var _0x1c239a=_0x463ce1[_0x3d7a('0xc0')]||[];var _0xe3c5a1=[];var _0x27342f;return db[_0x3d7a('0x7d')]['describe']()['then'](function(_0x1cae37){if(!_0x1cae37){throw new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))](_0x3d7a('0x80'));}_0x538fc6=_[_0x3d7a('0x81')](_[_0x3d7a('0x37')](_0x1cae37),['createdAt','updatedAt',_0x3d7a('0x84'),_0x3d7a('0x85')]);if(_0x463ce1[_0x3d7a('0x4e')]['id']){delete _0x463ce1[_0x3d7a('0x4e')]['id'];}if(_[_0x3d7a('0x70')](_0x463ce1[_0x3d7a('0x4e')]['from'])){throw _0x158154[_0x3d7a('0x1e')](0x1f4)[_0x3d7a('0x2c')](new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x463ce1[_0x3d7a('0x4e')][_0x3d7a('0x4e')])||_0x463ce1['body'][_0x3d7a('0x4e')]===''){throw _0x158154[_0x3d7a('0x1e')](0x1f4)[_0x3d7a('0x2c')](new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))](_0x3d7a('0x87')));}if(_['isNil'](_0x463ce1[_0x3d7a('0x4e')][_0x3d7a('0xc1')])){throw _0x158154['status'](0x1f4)[_0x3d7a('0x2c')](new db[(_0x3d7a('0x7e'))][(_0x3d7a('0x7f'))](_0x3d7a('0xc2')+_0x538fc6));}if(!_[_0x3d7a('0x89')](_0x538fc6,_0x463ce1['body'][_0x3d7a('0xc1')])){throw _0x158154['status'](0x1f4)['send'](new db['Sequelize'][(_0x3d7a('0x7f'))](_0x3d7a('0xc3')+_0x538fc6));}_0x3f5c23[_0x463ce1[_0x3d7a('0x4e')][_0x3d7a('0xc1')]]=_0x463ce1[_0x3d7a('0x4e')]['from'];})[_0x3d7a('0x15')](function(){return db[_0x3d7a('0x30')][_0x3d7a('0x4c')]({'where':{'id':_0x463ce1[_0x3d7a('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x3d7a('0x8c')},{'model':db[_0x3d7a('0xc4')],'as':_0x3d7a('0xc4')}]});})[_0x3d7a('0x15')](handleEntityNotFound(_0x158154,null))[_0x3d7a('0x15')](function(_0x48b430){if(_0x48b430&&_0x48b430[_0x3d7a('0x8c')]){_0x54c11a=_0x48b430;var _0x180406=_[_0x3d7a('0xc')](_0x463ce1['body'],{'firstName':_0x463ce1[_0x3d7a('0x4e')][_0x3d7a('0x8a')],'phone':_0x463ce1[_0x3d7a('0x4e')][_0x3d7a('0x8a')],'ListId':_0x48b430['ListId']});_0x180406[_0x463ce1[_0x3d7a('0x4e')]['mapKeyOffline']]=_0x463ce1[_0x3d7a('0x4e')]['from'];return db['CmContact'][_0x3d7a('0xc5')]({'where':_0x3f5c23,'defaults':_0x180406});}})[_0x3d7a('0xac')](function(_0x39e97f){if(_0x39e97f){_0x476bf6=_0x39e97f;var _0xa32b21=fs[_0x3d7a('0xc6')](path[_0x3d7a('0x6a')](config[_0x3d7a('0x71')],_0x3d7a('0xc7')),_0x3d7a('0xc8'));var _0x3b9673=ejs[_0x3d7a('0xc9')](_0xa32b21,{'body':_[_0x3d7a('0xca')](_0x463ce1[_0x3d7a('0x4e')][_0x3d7a('0x4e')]),'bodyTitle':_0x54c11a['offlineMessageBody']});return db[_0x3d7a('0xcb')][_0x3d7a('0x4d')]({'body':_0x3b9673,'plainBody':htmlToText[_0x3d7a('0xcc')](_0x3b9673),'ContactId':_0x39e97f['id'],'ChatWebsiteId':_0x54c11a['id']});}})[_0x3d7a('0x15')](function(_0x5aef9f){_0x27342f=_0x5aef9f;if(_0x1c239a[_0x3d7a('0x49')]){var _0x3034cc=_0x1c239a[_0x3d7a('0x2f')](function(_0x1489f2){return{'name':_0x1489f2[_0x3d7a('0xcd')],'basename':_0x1489f2['filename'],'type':_0x1489f2[_0x3d7a('0xce')],'ChatOfflineMessageId':_0x5aef9f['id']};});_0xe3c5a1=_0x3034cc[_0x3d7a('0x2f')](_0x32d532=>{var _0x5307c0={'filename':_0x32d532[_0x3d7a('0x2b')],'path':path[_0x3d7a('0x6a')](config['root'],_0x3d7a('0xcf'),_0x3d7a('0xc0'),_0x3d7a('0xd0'),_0x3d7a('0xd1'),_0x32d532[_0x3d7a('0xd2')])};return _0x5307c0;});if(!_0x54c11a[_0x3d7a('0xd3')]){return db[_0x3d7a('0xd4')]['transaction'](function(_0x2e9527){return db[_0x3d7a('0xd5')]['bulkCreate'](_0x3034cc,{'transaction':_0x2e9527});});}}})['then'](function(){if(_0x27342f){_0x3f4a9b=_0x27342f;return db[_0x3d7a('0xc4')][_0x3d7a('0x5e')]({'where':{'service':!![]},'include':[{'model':db[_0x3d7a('0xd6')],'as':_0x3d7a('0xd7'),'raw':!![],'include':[{'model':db[_0x3d7a('0xd8')],'as':_0x3d7a('0xd8'),'raw':!![]}]}]});}})['then'](function(_0x31c431){if(_0x31c431&&_0x31c431[_0x3d7a('0xd7')]&&_0x54c11a[_0x3d7a('0xd9')]&&_0x54c11a[_0x3d7a('0xda')]){var _0x4702e4=_0x31c431[_0x3d7a('0xdb')]();return respondWithRpcPromise('SendMail',_0x3d7a('0xdc'),{'account':_0x4702e4,'message':{'from':util[_0x3d7a('0xa2')](_0x3d7a('0xdd'),_0x31c431[_0x3d7a('0x2b')],_0x31c431[_0x3d7a('0xde')]||_0x31c431[_0x3d7a('0xd7')][_0x3d7a('0x4f')]),'to':_0x54c11a['forwardOfflineAddress'],'subject':_0x54c11a[_0x3d7a('0xdf')],'html':_0x3f4a9b[_0x3d7a('0x4e')],'attachments':_0xe3c5a1}},client9003)[_0x3d7a('0x15')](function(){return _0x3f4a9b;})[_0x3d7a('0x1d')](function(_0x5a183f){logger[_0x3d7a('0x1a')](_0x5a183f);});}})['then'](function(){if(_0x54c11a&&_0x54c11a[_0x3d7a('0xd3')]&&_0x54c11a[_0x3d7a('0xe0')]){var _0x11dcb7=[];if(_0x1c239a[_0x3d7a('0x49')]){_0x11dcb7=_0x1c239a['map'](function(_0x5828ba){return{'name':_0x5828ba[_0x3d7a('0xcd')],'basename':_0x5828ba[_0x3d7a('0x62')],'type':_0x5828ba[_0x3d7a('0xce')],'ChatOfflineMessageId':_0x27342f['id']};});}var _0x1221ce;if(!_[_0x3d7a('0x70')](_0x54c11a['subjectOffline'])){var _0x5c6634=_[_0x3d7a('0x2f')](_0x463ce1['body'],function(_0x117a5f){return _0x117a5f;});var _0x9edcba=_[_0x3d7a('0xe1')](_0x5c6634)[0x0];var _0x2ebbb2=_['mapValues'](_0x9edcba,function(_0x325fe7){return _0x325fe7;});_0x1221ce=_0x2ebbb2[0x1][_0x54c11a[_0x3d7a('0xe2')]];}var _0x1f4af8={'from':_0x476bf6[_0x3d7a('0xde')],'firstName':_0x476bf6['firstName'],'lastName':_0x476bf6[_0x3d7a('0x9b')],'mapKey':_0x3d7a('0xde'),'message':{'from':_0x476bf6['email'],'to':_0x54c11a[_0x3d7a('0xc4')][_0x3d7a('0xde')],'cc':'','subject':_[_0x3d7a('0x70')](_0x1221ce)?_0x54c11a['offlineMessageSubject']:_0x1221ce,'messageId':'','sentAt':new Date(),'attach':_0x11dcb7[_0x3d7a('0x49')],'attachments':_0x11dcb7,'originChannel':'Chat','ChatWebsiteId':_0x54c11a['id'],'ChatOfflineMessageId':_0x3f4a9b['id'],'originTo':_0x54c11a[_0x3d7a('0xc4')][_0x3d7a('0xde')]},'body':_0x3f4a9b['body']};var _0x450fce={'account':{'id':_0x54c11a[_0x3d7a('0xe0')]},'body':_0x1f4af8,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x3d7a('0xe3'),_0x3d7a('0xe4'),_0x450fce,client9001)[_0x3d7a('0x15')](function(){return _0x3f4a9b;})[_0x3d7a('0x1d')](function(_0x4ef480){logger['error'](_0x4ef480);});}return;})['then'](function(){if(_0x3f4a9b){return _0x3f4a9b;}})[_0x3d7a('0x15')](respondWithResult(_0x158154,null))[_0x3d7a('0x1d')](function(_0x830ee9){logger[_0x3d7a('0x1a')]('catch',_0x830ee9);for(var _0x45bcfd of _0x1c239a){var _0x1fbca3=path[_0x3d7a('0x6a')](config[_0x3d7a('0x71')],_0x3d7a('0xcf'),_0x3d7a('0xc0'),'attachments',_0x3d7a('0xd1'),_0x45bcfd[_0x3d7a('0x62')]);fs_extra[_0x3d7a('0xe5')](_0x1fbca3)[_0x3d7a('0x1d')](function(_0x5d8dee){logger[_0x3d7a('0x1a')]('Could\x20not\x20remove\x20attachment\x20file',_0x1fbca3,_0x5d8dee);});}});};exports[_0x3d7a('0xe6')]=function(_0x3a59d5,_0x4c6ea5){return db[_0x3d7a('0xa8')][_0x3d7a('0x4c')]({'where':{'id':_0x3a59d5[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x4c6ea5,null))['then'](function(_0x55cabc){if(_0x55cabc){return _0x55cabc[_0x3d7a('0xe6')](_0x3a59d5[_0x3d7a('0x4e')][_0x3d7a('0x59')],_[_0x3d7a('0xe7')](_0x3a59d5[_0x3d7a('0x4e')],['ids','id'])||{});}})[_0x3d7a('0x15')](respondWithResult(_0x4c6ea5,null))[_0x3d7a('0x1d')](handleError(_0x4c6ea5,null));};exports[_0x3d7a('0xe8')]=function(_0x334ea7,_0x394e92){var _0x1f5ea5={'raw':![],'where':{}};var _0x3de673={};var _0x4560d1={'count':0x0,'rows':[]};return db[_0x3d7a('0x30')][_0x3d7a('0x5e')]({'where':{'id':_0x334ea7[_0x3d7a('0x47')]['id']}})['then'](handleEntityNotFound(_0x394e92,null))[_0x3d7a('0x15')](function(_0x460814){if(_0x460814){_0x3de673[_0x3d7a('0x35')]=_['keys'](db[_0x3d7a('0xa8')]['rawAttributes']);_0x3de673[_0x3d7a('0x36')]=_[_0x3d7a('0x37')](_0x334ea7['query']);_0x3de673['filters']=_[_0x3d7a('0x3a')](_0x3de673[_0x3d7a('0x35')],_0x3de673['query']);_0x1f5ea5[_0x3d7a('0x39')]=_['intersection'](_0x3de673['model'],qs[_0x3d7a('0x3b')](_0x334ea7['query'][_0x3d7a('0x3b')]));_0x1f5ea5[_0x3d7a('0x39')]=_0x1f5ea5[_0x3d7a('0x39')][_0x3d7a('0x49')]?_0x1f5ea5[_0x3d7a('0x39')]:_0x3de673[_0x3d7a('0x35')];if(!_0x334ea7[_0x3d7a('0x36')][_0x3d7a('0x3c')](_0x3d7a('0x3d'))){_0x1f5ea5[_0x3d7a('0x22')]=qs['limit'](_0x334ea7[_0x3d7a('0x36')][_0x3d7a('0x22')]);_0x1f5ea5[_0x3d7a('0x20')]=qs[_0x3d7a('0x20')](_0x334ea7[_0x3d7a('0x36')][_0x3d7a('0x20')]);}_0x1f5ea5[_0x3d7a('0x3e')]=qs['sort'](_0x334ea7['query']['sort']);_0x1f5ea5[_0x3d7a('0x40')]=qs[_0x3d7a('0x38')](_['pick'](_0x334ea7[_0x3d7a('0x36')],_0x3de673[_0x3d7a('0x38')]));_0x1f5ea5[_0x3d7a('0x40')][_0x3d7a('0x5b')]=_0x460814['id'];if(_0x334ea7[_0x3d7a('0x36')][_0x3d7a('0x43')]){_0x1f5ea5['where']=_[_0x3d7a('0x41')](_0x1f5ea5[_0x3d7a('0x40')],{'$or':_[_0x3d7a('0x2f')](_0x1f5ea5[_0x3d7a('0x39')],function(_0x31f74b){var _0x4c0cd4={};_0x4c0cd4[_0x31f74b]={'$like':'%'+_0x334ea7[_0x3d7a('0x36')]['filter']+'%'};return _0x4c0cd4;})});}_0x1f5ea5=_[_0x3d7a('0x41')]({},_0x1f5ea5,_0x334ea7[_0x3d7a('0x4b')]);return db['ChatInteraction'][_0x3d7a('0x23')]({'where':_0x1f5ea5['where']})['then'](function(_0x953346){_0x4560d1[_0x3d7a('0x23')]=_0x953346;if(_0x334ea7[_0x3d7a('0x36')][_0x3d7a('0x4a')]){_0x1f5ea5[_0x3d7a('0x44')]=[{'model':db['CmContact'],'as':_0x3d7a('0xe9'),'required':![]},{'model':db[_0x3d7a('0xb5')],'as':'Owner','attributes':[_0x3d7a('0x2b'),_0x3d7a('0xea'),_0x3d7a('0xeb')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x3d7a('0x2b'),'color'],'where':_0x334ea7[_0x3d7a('0x36')][_0x3d7a('0xec')]?{'id':_0x334ea7[_0x3d7a('0x36')][_0x3d7a('0xec')]}:undefined,'required':_0x334ea7[_0x3d7a('0x36')][_0x3d7a('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0x3d7a('0x5f')](_0x1f5ea5);})[_0x3d7a('0x15')](function(_0x48aea9){_0x4560d1[_0x3d7a('0x45')]=_0x48aea9;return _0x4560d1;});}})['then'](respondWithFilteredResult(_0x394e92,_0x1f5ea5))[_0x3d7a('0x1d')](handleError(_0x394e92,null));};function iftimePromise(_0x264cd8,_0x406e64){return respondWithRpcPromise('Command',_0x3d7a('0xed'),{'command':_0x406e64[_0x3d7a('0xee')]?util['format'](_0x3d7a('0xef'),_0x264cd8['interval'],_0x406e64['timezone']):util[_0x3d7a('0xa2')](_0x3d7a('0xf0'),_0x264cd8['interval'])},client9002)['then'](function(_0x4ecd52){var _0x2ed64a=_0x4ecd52&&_0x4ecd52[_0x3d7a('0xf1')](_0x3d7a('0xf2'))>=0x0?!![]:![];logger[_0x3d7a('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x406e64['id'],_0x264cd8['id'],_0x264cd8[_0x3d7a('0xf3')],_0x2ed64a?_0x3d7a('0xf4'):_0x3d7a('0xf5'),_0x406e64[_0x3d7a('0xee')]?_0x406e64[_0x3d7a('0xee')]:_0x3d7a('0xf6'));return _0x2ed64a;})[_0x3d7a('0x1d')](function(_0xd3ee02){logger[_0x3d7a('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x406e64['id'],_0x264cd8['id'],_0x264cd8[_0x3d7a('0xf3')],util[_0x3d7a('0xf7')](_0xd3ee02,{'showHidden':![],'depth':null}),_0x406e64[_0x3d7a('0xee')]?_0x406e64['timezone']:'No\x20timezone');return![];});}exports[_0x3d7a('0xed')]=function(_0x3d0166,_0x2e8dcc){var _0x7a2d20=0x0;var _0x4848b3=0x0;var _0x3cc143=![];var _0x53d411;var _0x348c38;return db[_0x3d7a('0x30')][_0x3d7a('0x4c')]({'where':{'id':_0x3d0166[_0x3d7a('0x47')]['id']},'include':[{'model':db[_0x3d7a('0xf8')],'as':_0x3d7a('0xf8'),'include':[{'model':db[_0x3d7a('0xf8')],'as':'Intervals','attributes':['id',_0x3d7a('0xf3')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2e8dcc,null))[_0x3d7a('0x15')](function(_0xbd7bd2){if(_0xbd7bd2){_0x53d411=_0xbd7bd2;return _0xbd7bd2['getProactiveActions']({'raw':!![]});}})['then'](function(_0x2e0a9b){if(_0x53d411){if(_0x2e0a9b){_0x348c38=_0x2e0a9b;}}return require(_0x3d7a('0x6d'))[_0x3d7a('0x6e')]();})[_0x3d7a('0x15')](function(_0x5976f5){if(_0x5976f5){_0x4848b3=_0x5976f5[_0x3d7a('0xf9')];_0x3cc143=_0x5976f5[_0x3d7a('0x6f')];}})[_0x3d7a('0x15')](function(){return db[_0x3d7a('0xa8')][_0x3d7a('0x23')]({'where':{'closed':![]}});})['then'](function(_0x44e134){_0x7a2d20=_0x44e134;if(_0x4848b3&&_0x44e134>_0x4848b3){return db[_0x3d7a('0xfa')]['findOne']({'where':{'id':0x1}})['then'](function(_0x3fcbda){if(_0x3fcbda){_0x3fcbda['increment'](_0x3d7a('0xfb'));}});}})[_0x3d7a('0x15')](function(){if(_0x53d411[_0x3d7a('0xf8')]&&_0x53d411['Interval'][_0x3d7a('0xfc')]){var _0x25b85e=[];for(var _0x44a310=0x0;_0x44a310<_0x53d411[_0x3d7a('0xf8')][_0x3d7a('0xfc')][_0x3d7a('0x49')];_0x44a310++){var _0x9247a3=_0x53d411[_0x3d7a('0xf8')][_0x3d7a('0xfc')][_0x44a310][_0x3d7a('0x25')]({'plain':!![]});_0x25b85e[_0x3d7a('0xfd')](iftimePromise(_0x9247a3,_0x53d411));}return BPromise[_0x3d7a('0xfe')](_0x25b85e)['then'](function(_0x21a956){return _[_0x3d7a('0xff')](_0x21a956);});}else{return!![];}})[_0x3d7a('0x15')](function(_0x27aee8){var _0x59aa14=fs[_0x3d7a('0xc6')](path[_0x3d7a('0x6a')](config[_0x3d7a('0x71')],_0x3d7a('0x100')),_0x3d7a('0xc8'));var _0xdd36cb={'remote':_0x53d411['remote'],'query':querystring['stringify'](_['merge'](_0x53d411['get']({'plain':!![]}),{'customerIp':_0x3d0166['headers'][_0x3d7a('0x98')]||_0x3d0166['headers'][_0x3d7a('0x101')]||_0x3d0166[_0x3d7a('0x102')][_0x3d7a('0x103')]||_0x3d0166['ip'],'referer':_0x3d0166['headers'][_0x3d7a('0x9d')],'openedInteractions':_0x7a2d20,'maxInteractions':_0x4848b3,'virtual':_0x3cc143[_0x3d7a('0xf9')],'online':_0x27aee8,'custom':_0x3cc143}))[_0x3d7a('0x104')](/'/g,'\x5c\x27')};_0x2e8dcc[_0x3d7a('0x2c')](ejs[_0x3d7a('0xc9')](Mustache[_0x3d7a('0xc9')](_0x59aa14,_0xdd36cb),{'proactiveActions':_0x348c38,'alignment':_0x53d411[_0x3d7a('0x105')],'verticalAlignment':_0x53d411[_0x3d7a('0x106')],'div_color':_0x53d411[_0x3d7a('0x107')],'labelText':_0x53d411[_0x3d7a('0x108')],'text_color':_0x53d411[_0x3d7a('0x109')],'text_button_color':_0x53d411[_0x3d7a('0x10a')],'button_color':_0x53d411['color_button'],'background_color':_0x53d411[_0x3d7a('0x10b')],'hideWhenOffline':_0x53d411[_0x3d7a('0x10c')],'interval':_0x53d411[_0x3d7a('0x10d')]}));})[_0x3d7a('0x1d')](handleError(_0x2e8dcc,null));};exports[_0x3d7a('0x10e')]=function(_0x106109,_0x5a379a){var _0x43b4d8=_0x106109['params']['id'];var _0x2ddcb7=_0x106109['body'];var _0x19e61b=0xc8;var _0x3a46ad=null;return db[_0x3d7a('0xd4')]['transaction']({'isolationLevel':db[_0x3d7a('0xd4')][_0x3d7a('0x10f')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x1a547f){return db[_0x3d7a('0x30')][_0x3d7a('0x5e')]({'where':{'id':_0x43b4d8},'transaction':_0x1a547f})['then'](function(_0x13417c){if(_0x13417c){return db[_0x3d7a('0x110')][_0x3d7a('0x28')]({'where':{'ChatWebsiteId':_0x43b4d8},'transaction':_0x1a547f})['then'](function(){var _0x5b6cb4=_[_0x3d7a('0x2f')](_0x2ddcb7,function(_0x4e07cb){_0x4e07cb['ChatWebsiteId']=_0x43b4d8;return _0x4e07cb;});return db[_0x3d7a('0x110')][_0x3d7a('0x111')](_0x5b6cb4,{'transaction':_0x1a547f});});}else{_0x19e61b=0x194;_0x3a46ad=[];}});})['then'](function(){if(_0x19e61b!==0x194){return db[_0x3d7a('0x110')][_0x3d7a('0x112')]({'where':{'ChatWebsiteId':_0x43b4d8},'order':_0x3d7a('0x91')})[_0x3d7a('0x15')](function(_0x21dad8){_0x3a46ad=_0x21dad8;});}})[_0x3d7a('0x1d')](function(_0x31b4e8){_0x19e61b=0x1f4;logger[_0x3d7a('0x1a')](_0x31b4e8[_0x3d7a('0x2a')]);if(_0x31b4e8[_0x3d7a('0x2b')]){delete _0x31b4e8[_0x3d7a('0x2b')];}_0x3a46ad=_0x31b4e8;})[_0x3d7a('0x113')](function(){if(_0x3a46ad===null){_0x5a379a[_0x3d7a('0x114')](_0x19e61b);}else{if(_0x19e61b===0x1f4){_0x5a379a[_0x3d7a('0x1e')](_0x19e61b)[_0x3d7a('0x2c')](_0x3a46ad);}else{_0x5a379a['status'](_0x19e61b)[_0x3d7a('0x1f')](_0x3a46ad);}}});};exports['getApplications']=function(_0x3c5409,_0x29416){var _0x1b9059={};var _0x12f507={};var _0x140704;var _0x2a9b1a;return db[_0x3d7a('0x30')][_0x3d7a('0x5e')]({'where':{'id':_0x3c5409[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x29416,null))[_0x3d7a('0x15')](function(_0x20c196){if(_0x20c196){_0x140704=_0x20c196;_0x12f507['model']=_[_0x3d7a('0x37')](db['ChatApplication'][_0x3d7a('0x31')]);_0x12f507[_0x3d7a('0x36')]=_[_0x3d7a('0x37')](_0x3c5409[_0x3d7a('0x36')]);_0x12f507[_0x3d7a('0x38')]=_[_0x3d7a('0x3a')](_0x12f507['model'],_0x12f507[_0x3d7a('0x36')]);_0x1b9059['attributes']=_[_0x3d7a('0x3a')](_0x12f507[_0x3d7a('0x35')],qs['fields'](_0x3c5409[_0x3d7a('0x36')][_0x3d7a('0x3b')]));_0x1b9059[_0x3d7a('0x39')]=_0x1b9059[_0x3d7a('0x39')][_0x3d7a('0x49')]?_0x1b9059[_0x3d7a('0x39')]:_0x12f507[_0x3d7a('0x35')];_0x1b9059[_0x3d7a('0x3e')]=qs[_0x3d7a('0x3f')](_0x3c5409[_0x3d7a('0x36')][_0x3d7a('0x3f')]);_0x1b9059[_0x3d7a('0x40')]=qs[_0x3d7a('0x38')](_[_0x3d7a('0x57')](_0x3c5409[_0x3d7a('0x36')],_0x12f507[_0x3d7a('0x38')]));if(_0x3c5409[_0x3d7a('0x36')]['filter']){_0x1b9059['where']=_['merge'](_0x1b9059['where'],{'$or':_[_0x3d7a('0x2f')](_0x1b9059['attributes'],function(_0x37689b){var _0x965ae3={};_0x965ae3[_0x37689b]={'$like':'%'+_0x3c5409[_0x3d7a('0x36')][_0x3d7a('0x43')]+'%'};return _0x965ae3;})});}_0x1b9059=_[_0x3d7a('0x41')]({},_0x1b9059,_0x3c5409[_0x3d7a('0x4b')]);return _0x140704[_0x3d7a('0x115')](_0x1b9059);}})[_0x3d7a('0x15')](function(_0x2b7578){if(_0x2b7578){_0x2a9b1a=_0x2b7578[_0x3d7a('0x49')];if(!_0x3c5409['query'][_0x3d7a('0x3c')](_0x3d7a('0x3d'))){_0x1b9059['limit']=qs['limit'](_0x3c5409[_0x3d7a('0x36')][_0x3d7a('0x22')]);_0x1b9059['offset']=qs['offset'](_0x3c5409[_0x3d7a('0x36')][_0x3d7a('0x20')]);}return _0x140704[_0x3d7a('0x115')](_0x1b9059);}})[_0x3d7a('0x15')](function(_0xc2a9a4){if(_0xc2a9a4){return _0xc2a9a4?{'count':_0x2a9b1a,'rows':_0xc2a9a4}:null;}})[_0x3d7a('0x15')](respondWithResult(_0x29416,null))[_0x3d7a('0x1d')](handleError(_0x29416,null));};exports[_0x3d7a('0x116')]=function(_0x1b74b9,_0x3e02d9){return db[_0x3d7a('0x117')][_0x3d7a('0x4c')]({'where':{'id':_0x1b74b9['params']['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x3e02d9,null))[_0x3d7a('0x15')](function(_0x4b1043){if(_0x4b1043){return _0x4b1043[_0x3d7a('0x116')](_0x1b74b9[_0x3d7a('0x4e')][_0x3d7a('0x59')],_['omit'](_0x1b74b9[_0x3d7a('0x4e')],['ids','id'])||{});}})[_0x3d7a('0x15')](respondWithResult(_0x3e02d9,null))[_0x3d7a('0x1d')](handleError(_0x3e02d9,null));};exports[_0x3d7a('0x118')]=function(_0x3efbb3,_0x358abf){var _0x118858={};var _0x7fa4e5={};var _0x2ac82f;var _0x494bc4;return db['ChatWebsite']['findOne']({'where':{'id':_0x3efbb3['params']['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x358abf,null))[_0x3d7a('0x15')](function(_0x3a2d25){if(_0x3a2d25){_0x2ac82f=_0x3a2d25;_0x7fa4e5[_0x3d7a('0x35')]=_[_0x3d7a('0x37')](db[_0x3d7a('0x119')][_0x3d7a('0x31')]);_0x7fa4e5['query']=_['keys'](_0x3efbb3['query']);_0x7fa4e5['filters']=_[_0x3d7a('0x3a')](_0x7fa4e5[_0x3d7a('0x35')],_0x7fa4e5['query']);_0x118858[_0x3d7a('0x39')]=_['intersection'](_0x7fa4e5[_0x3d7a('0x35')],qs['fields'](_0x3efbb3[_0x3d7a('0x36')][_0x3d7a('0x3b')]));_0x118858[_0x3d7a('0x39')]=_0x118858['attributes'][_0x3d7a('0x49')]?_0x118858[_0x3d7a('0x39')]:_0x7fa4e5[_0x3d7a('0x35')];_0x118858[_0x3d7a('0x3e')]=qs[_0x3d7a('0x3f')](_0x3efbb3[_0x3d7a('0x36')][_0x3d7a('0x3f')]);_0x118858['where']=qs[_0x3d7a('0x38')](_['pick'](_0x3efbb3['query'],_0x7fa4e5[_0x3d7a('0x38')]));if(_0x3efbb3[_0x3d7a('0x36')]['filter']){_0x118858['where']=_[_0x3d7a('0x41')](_0x118858[_0x3d7a('0x40')],{'$or':_['map'](_0x118858[_0x3d7a('0x39')],function(_0x2d4ce1){var _0x50ae57={};_0x50ae57[_0x2d4ce1]={'$like':'%'+_0x3efbb3['query'][_0x3d7a('0x43')]+'%'};return _0x50ae57;})});}_0x118858=_[_0x3d7a('0x41')]({},_0x118858,_0x3efbb3[_0x3d7a('0x4b')]);return _0x2ac82f[_0x3d7a('0x118')](_0x118858);}})[_0x3d7a('0x15')](function(_0x5a2074){if(_0x5a2074){_0x494bc4=_0x5a2074['length'];if(!_0x3efbb3['query'][_0x3d7a('0x3c')](_0x3d7a('0x3d'))){_0x118858[_0x3d7a('0x22')]=qs[_0x3d7a('0x22')](_0x3efbb3[_0x3d7a('0x36')]['limit']);_0x118858[_0x3d7a('0x20')]=qs['offset'](_0x3efbb3[_0x3d7a('0x36')][_0x3d7a('0x20')]);}return _0x2ac82f['getProactiveActions'](_0x118858);}})['then'](function(_0xfc5bc2){if(_0xfc5bc2){return _0xfc5bc2?{'count':_0x494bc4,'rows':_0xfc5bc2}:null;}})['then'](respondWithResult(_0x358abf,null))['catch'](handleError(_0x358abf,null));};exports['getFields']=function(_0x219952,_0x1db5da){var _0x38ff59=_0x219952['query'][_0x3d7a('0x11a')]===_0x3d7a('0x11b')?_0x3d7a('0x11c'):_0x3d7a('0x11d');return db[_0x3d7a('0x30')][_0x3d7a('0x4c')]({'attributes':['id',_0x38ff59],'where':{'id':_0x219952[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x1db5da,null))['then'](function(_0x11a7f7){if(_0x11a7f7){var _0x455533=_0x11a7f7[_0x38ff59];var _0x3f9302=_0x455533&&_0x455533[_0x3d7a('0x11e')]?_0x455533['items']:[];_0x1db5da[_0x3d7a('0x2c')]({'fromKey':_[_0x3d7a('0x70')](_0x455533[_0x3d7a('0x11f')])?undefined:_0x455533[_0x3d7a('0x11f')],'count':_0x3f9302[_0x3d7a('0x49')],'rows':_0x3f9302});}})['catch'](handleError(_0x1db5da,null));};exports['getOfflineMessages']=function(_0x438146,_0x1ab16a){var _0x4808ac={'raw':![],'where':{}};var _0x35eae8={};var _0x545cc1={'count':0x0,'rows':[]};return db[_0x3d7a('0x30')]['findOne']({'where':{'id':_0x438146[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x1ab16a,null))[_0x3d7a('0x15')](function(_0x384247){if(_0x384247){_0x35eae8[_0x3d7a('0x35')]=_[_0x3d7a('0x37')](db[_0x3d7a('0xcb')][_0x3d7a('0x31')]);_0x35eae8[_0x3d7a('0x36')]=_[_0x3d7a('0x37')](_0x438146[_0x3d7a('0x36')]);_0x35eae8[_0x3d7a('0x38')]=_[_0x3d7a('0x3a')](_0x35eae8[_0x3d7a('0x35')],_0x35eae8[_0x3d7a('0x36')]);_0x4808ac[_0x3d7a('0x39')]=_['intersection'](_0x35eae8[_0x3d7a('0x35')],qs[_0x3d7a('0x3b')](_0x438146[_0x3d7a('0x36')][_0x3d7a('0x3b')]));_0x4808ac[_0x3d7a('0x39')]=_0x4808ac[_0x3d7a('0x39')]['length']?_0x4808ac[_0x3d7a('0x39')]:_0x35eae8['model'];if(!_0x438146['query'][_0x3d7a('0x3c')](_0x3d7a('0x3d'))){_0x4808ac[_0x3d7a('0x22')]=qs['limit'](_0x438146[_0x3d7a('0x36')][_0x3d7a('0x22')]);_0x4808ac['offset']=qs[_0x3d7a('0x20')](_0x438146['query'][_0x3d7a('0x20')]);}_0x4808ac[_0x3d7a('0x3e')]=qs[_0x3d7a('0x3f')](_0x438146['query'][_0x3d7a('0x3f')]);_0x4808ac[_0x3d7a('0x40')]=qs[_0x3d7a('0x38')](_[_0x3d7a('0x57')](_0x438146[_0x3d7a('0x36')],_0x35eae8[_0x3d7a('0x38')]));_0x4808ac[_0x3d7a('0x40')][_0x3d7a('0x5b')]=_0x384247['id'];if(_0x438146[_0x3d7a('0x36')][_0x3d7a('0x43')]){_0x4808ac[_0x3d7a('0x40')]=_[_0x3d7a('0x41')](_0x4808ac[_0x3d7a('0x40')],{'$or':_[_0x3d7a('0x2f')](_0x4808ac[_0x3d7a('0x39')],function(_0x343134){var _0x4f6649={};_0x4f6649[_0x343134]={'$like':'%'+_0x438146[_0x3d7a('0x36')][_0x3d7a('0x43')]+'%'};return _0x4f6649;})});}_0x4808ac=_[_0x3d7a('0x41')]({},_0x4808ac,_0x438146[_0x3d7a('0x4b')]);return db['ChatOfflineMessage'][_0x3d7a('0x23')]({'where':_0x4808ac[_0x3d7a('0x40')]})['then'](function(_0x1b67d2){_0x545cc1[_0x3d7a('0x23')]=_0x1b67d2;if(_0x438146[_0x3d7a('0x36')][_0x3d7a('0x4a')]){_0x4808ac[_0x3d7a('0x44')]=[{'all':!![]}];}else{_0x4808ac[_0x3d7a('0x44')]=[{'model':db['CmContact'],'as':_0x3d7a('0xe9'),'required':![]},{'model':db[_0x3d7a('0xd5')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x3d7a('0x5f')](_0x4808ac);})[_0x3d7a('0x15')](function(_0x24270d){_0x545cc1['rows']=_0x24270d;return _0x545cc1;});}})[_0x3d7a('0x15')](respondWithFilteredResult(_0x1ab16a,_0x4808ac))[_0x3d7a('0x1d')](handleError(_0x1ab16a,null));};exports[_0x3d7a('0x120')]=function(_0xfd829d,_0x429c7f){return db[_0x3d7a('0x30')]['find']({'where':{'id':_0xfd829d['params']['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x429c7f,null))[_0x3d7a('0x15')](function(_0x3cf937){if(_0x3cf937){return _0x3cf937[_0x3d7a('0x120')](_0xfd829d['body'][_0x3d7a('0x59')],_[_0x3d7a('0xe7')](_0xfd829d['body'],[_0x3d7a('0x59'),'id'])||{})['spread'](function(_0x37803d){for(var _0x2ebf0a=0x0;_0x2ebf0a<_0xfd829d['body'][_0x3d7a('0x59')][_0x3d7a('0x49')];_0x2ebf0a+=0x1){socket['emit'](_0x3d7a('0x121'),{'UserId':Number(_0xfd829d['body'][_0x3d7a('0x59')][_0x2ebf0a]),'ChatWebsiteId':Number(_0xfd829d[_0x3d7a('0x47')]['id'])});}return _0x37803d;});}})[_0x3d7a('0x15')](respondWithResult(_0x429c7f,null))[_0x3d7a('0x1d')](handleError(_0x429c7f,null));};exports[_0x3d7a('0x122')]=function(_0x22af37,_0x14ffbc){return db[_0x3d7a('0x30')]['find']({'where':{'id':_0x22af37[_0x3d7a('0x47')]['id']}})[_0x3d7a('0x15')](handleEntityNotFound(_0x14ffbc,null))['then'](function(_0x2ba990){if(_0x2ba990){return _0x2ba990['removeAgents'](_0x22af37[_0x3d7a('0x36')]['ids'])['then'](function(){if(_[_0x3d7a('0x123')](_0x22af37[_0x3d7a('0x36')][_0x3d7a('0x59')])){for(var _0x57c4f4=0x0;_0x57c4f4<_0x22af37[_0x3d7a('0x36')]['ids']['length'];_0x57c4f4+=0x1){socket[_0x3d7a('0x124')](_0x3d7a('0x125'),{'UserId':Number(_0x22af37[_0x3d7a('0x36')][_0x3d7a('0x59')][_0x57c4f4]),'ChatWebsiteId':Number(_0x22af37['params']['id'])});}}else{socket[_0x3d7a('0x124')](_0x3d7a('0x125'),{'UserId':Number(_0x22af37[_0x3d7a('0x36')][_0x3d7a('0x59')]),'ChatWebsiteId':Number(_0x22af37['params']['id'])});}});}})['then'](respondWithStatusCode(_0x14ffbc,null))['catch'](handleError(_0x14ffbc,null));};exports['getAgents']=function(_0x1a0fe8,_0x569eb0){var _0x2cf69a={};var _0x2fee88={};var _0x419209;var _0x59cc26;return db['ChatWebsite'][_0x3d7a('0x5e')]({'where':{'id':_0x1a0fe8['params']['id']}})['then'](handleEntityNotFound(_0x569eb0,null))[_0x3d7a('0x15')](function(_0x4d57bf){if(_0x4d57bf){_0x419209=_0x4d57bf;_0x2fee88[_0x3d7a('0x35')]=_[_0x3d7a('0x37')](db['User'][_0x3d7a('0x31')]);_0x2fee88[_0x3d7a('0x36')]=_['keys'](_0x1a0fe8['query']);_0x2fee88[_0x3d7a('0x38')]=_['intersection'](_0x2fee88[_0x3d7a('0x35')],_0x2fee88[_0x3d7a('0x36')]);_0x2cf69a[_0x3d7a('0x39')]=_['intersection'](_0x2fee88[_0x3d7a('0x35')],qs[_0x3d7a('0x3b')](_0x1a0fe8[_0x3d7a('0x36')][_0x3d7a('0x3b')]));_0x2cf69a[_0x3d7a('0x39')]=_0x2cf69a['attributes'][_0x3d7a('0x49')]?_0x2cf69a[_0x3d7a('0x39')]:_0x2fee88[_0x3d7a('0x35')];_0x2cf69a['order']=qs['sort'](_0x1a0fe8[_0x3d7a('0x36')][_0x3d7a('0x3f')]);_0x2cf69a[_0x3d7a('0x40')]=qs['filters'](_[_0x3d7a('0x57')](_0x1a0fe8[_0x3d7a('0x36')],_0x2fee88[_0x3d7a('0x38')]));if(_0x1a0fe8[_0x3d7a('0x36')][_0x3d7a('0x43')]){_0x2cf69a['where']=_['merge'](_0x2cf69a[_0x3d7a('0x40')],{'$or':_[_0x3d7a('0x2f')](_0x2cf69a['attributes'],function(_0x55dd2c){var _0x58d1e5={};_0x58d1e5[_0x55dd2c]={'$like':'%'+_0x1a0fe8[_0x3d7a('0x36')][_0x3d7a('0x43')]+'%'};return _0x58d1e5;})});}_0x2cf69a=_['merge']({},_0x2cf69a,_0x1a0fe8['options']);return _0x419209['getAgents'](_0x2cf69a);}})['then'](function(_0x15666f){if(_0x15666f){_0x59cc26=_0x15666f[_0x3d7a('0x49')];if(!_0x1a0fe8[_0x3d7a('0x36')]['hasOwnProperty']('nolimit')){_0x2cf69a[_0x3d7a('0x22')]=qs[_0x3d7a('0x22')](_0x1a0fe8[_0x3d7a('0x36')]['limit']);_0x2cf69a[_0x3d7a('0x20')]=qs[_0x3d7a('0x20')](_0x1a0fe8[_0x3d7a('0x36')][_0x3d7a('0x20')]);}return _0x419209[_0x3d7a('0x126')](_0x2cf69a);}})['then'](function(_0x2349bf){if(_0x2349bf){return _0x2349bf?{'count':_0x59cc26,'rows':_0x2349bf}:null;}})[_0x3d7a('0x15')](respondWithResult(_0x569eb0,null))['catch'](handleError(_0x569eb0,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 31fec65..96b3837 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 _0x4944=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4c5fa8,_0x11a293){var _0x58f868=function(_0x2ec548){while(--_0x2ec548){_0x4c5fa8['push'](_0x4c5fa8['shift']());}};_0x58f868(++_0x11a293);}(_0x4944,0x6d));var _0x4494=function(_0x2def0a,_0x293f6f){_0x2def0a=_0x2def0a-0x0;var _0x1804f4=_0x4944[_0x2def0a];return _0x1804f4;};'use strict';var EventEmitter=require(_0x4494('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4494('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4494('0x2')](0x0);var events={'afterCreate':_0x4494('0x3'),'afterUpdate':_0x4494('0x4'),'afterDestroy':_0x4494('0x5')};function emitEvent(_0x5074d9){return function(_0x187098,_0x5c7492,_0x370748){ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9+':'+_0x187098['id'],_0x187098);ChatWebsiteEvents[_0x4494('0x6')](_0x5074d9,_0x187098);_0x370748(null);};}for(var e in events){if(events[_0x4494('0x7')](e)){var event=events[e];ChatWebsite[_0x4494('0x8')](e,emitEvent(event));}}module[_0x4494('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x1e19=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x332931,_0x2dfab4){var _0x9d43a8=function(_0x498b52){while(--_0x498b52){_0x332931['push'](_0x332931['shift']());}};_0x9d43a8(++_0x2dfab4);}(_0x1e19,0x1c9));var _0x91e1=function(_0x32da14,_0x477a3e){_0x32da14=_0x32da14-0x0;var _0x36306b=_0x1e19[_0x32da14];return _0x36306b;};'use strict';var EventEmitter=require(_0x91e1('0x0'));var ChatWebsite=require(_0x91e1('0x1'))['db'][_0x91e1('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x91e1('0x3')](0x0);var events={'afterCreate':_0x91e1('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x561f69){return function(_0x5e4bdc,_0x169cdf,_0x2db427){ChatWebsiteEvents[_0x91e1('0x5')](_0x561f69+':'+_0x5e4bdc['id'],_0x5e4bdc);ChatWebsiteEvents[_0x91e1('0x5')](_0x561f69,_0x5e4bdc);_0x2db427(null);};}for(var e in events){if(events[_0x91e1('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x91e1('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index f5ce3a5..0a424b5 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 _0x062d=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','../../config/logger','api','moment','bluebird','path'];(function(_0x4fc2ca,_0x19ba6a){var _0x2a74a5=function(_0x559775){while(--_0x559775){_0x4fc2ca['push'](_0x4fc2ca['shift']());}};_0x2a74a5(++_0x19ba6a);}(_0x062d,0xaf));var _0xd062=function(_0x4734d8,_0x479950){_0x4734d8=_0x4734d8-0x0;var _0x3b1120=_0x062d[_0x4734d8];return _0x3b1120;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd062('0x0'))(_0xd062('0x1'));var moment=require(_0xd062('0x2'));var BPromise=require(_0xd062('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd062('0x4'));var rimraf=require(_0xd062('0x5'));var config=require(_0xd062('0x6'));var attributes=require(_0xd062('0x7'));module[_0xd062('0x8')]=function(_0x1961d2,_0x5cb724){return _0x1961d2[_0xd062('0x9')](_0xd062('0xa'),attributes,{'tableName':_0xd062('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e9=['define','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x32018a,_0x1e5b5f){var _0x335327=function(_0x371a16){while(--_0x371a16){_0x32018a['push'](_0x32018a['shift']());}};_0x335327(++_0x1e5b5f);}(_0xb4e9,0x177));var _0x9b4e=function(_0x12e747,_0x33ab29){_0x12e747=_0x12e747-0x0;var _0x54adb6=_0xb4e9[_0x12e747];return _0x54adb6;};'use strict';var _=require(_0x9b4e('0x0'));var util=require(_0x9b4e('0x1'));var logger=require(_0x9b4e('0x2'))('api');var moment=require(_0x9b4e('0x3'));var BPromise=require(_0x9b4e('0x4'));var rp=require(_0x9b4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b4e('0x6'));var config=require(_0x9b4e('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x9b4e('0x8')]=function(_0x40f9c6,_0x5e675c){return _0x40f9c6[_0x9b4e('0x9')](_0x9b4e('0xa'),attributes,{'tableName':_0x9b4e('0xb'),'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 76c40c4..1f506dc 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 _0x6263=['defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x2f03c2,_0x2f7f6e){var _0x15d995=function(_0x3bbef7){while(--_0x3bbef7){_0x2f03c2['push'](_0x2f03c2['shift']());}};_0x15d995(++_0x2f7f6e);}(_0x6263,0xf8));var _0x3626=function(_0x4840f5,_0x5ebb78){_0x4840f5=_0x4840f5-0x0;var _0x2ac1b8=_0x6263[_0x4840f5];return _0x2ac1b8;};'use strict';var _=require(_0x3626('0x0'));var util=require(_0x3626('0x1'));var moment=require(_0x3626('0x2'));var BPromise=require(_0x3626('0x3'));var rs=require(_0x3626('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3626('0x5'))['db'];var utils=require(_0x3626('0x6'));var logger=require(_0x3626('0x7'))(_0x3626('0x8'));var config=require('../../config/environment');var jayson=require(_0x3626('0x9'));var client=jayson[_0x3626('0xa')][_0x3626('0xb')]({'port':0x232a});config[_0x3626('0xc')]=_[_0x3626('0xd')](config['redis'],{'host':_0x3626('0xe'),'port':0x18eb});var socket=require(_0x3626('0xf'))(new Redis(config[_0x3626('0xc')]));require('./chatWebsite.socket')[_0x3626('0x10')](socket);function respondWithRpcPromise(_0x53e284,_0x293c27,_0x14e1d7){return new BPromise(function(_0x33aa2a,_0x2e615d){return client[_0x3626('0x11')](_0x53e284,_0x14e1d7)[_0x3626('0x12')](function(_0x4772a7){logger['info'](_0x3626('0x13'),_0x293c27,_0x3626('0x14'));logger[_0x3626('0x15')](_0x3626('0x16'),_0x293c27,_0x3626('0x14'),JSON[_0x3626('0x17')](_0x4772a7));if(_0x4772a7[_0x3626('0x18')]){if(_0x4772a7[_0x3626('0x18')]['code']===0x1f4){logger[_0x3626('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x293c27,_0x4772a7[_0x3626('0x18')][_0x3626('0x19')]);return _0x2e615d(_0x4772a7[_0x3626('0x18')][_0x3626('0x19')]);}logger[_0x3626('0x18')](_0x3626('0x13'),_0x293c27,_0x4772a7['error'][_0x3626('0x19')]);return _0x33aa2a(_0x4772a7[_0x3626('0x18')][_0x3626('0x19')]);}else{logger[_0x3626('0x1a')](_0x3626('0x13'),_0x293c27,'request\x20sent');_0x33aa2a(_0x4772a7[_0x3626('0x1b')][_0x3626('0x19')]);}})[_0x3626('0x1c')](function(_0x571ff){logger[_0x3626('0x18')](_0x3626('0x13'),_0x293c27,_0x571ff);_0x2e615d(_0x571ff);});});} \ No newline at end of file +var _0x75a1=['http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x16adda,_0x2217dc){var _0x51f20b=function(_0x4ed026){while(--_0x4ed026){_0x16adda['push'](_0x16adda['shift']());}};_0x51f20b(++_0x2217dc);}(_0x75a1,0x12e));var _0x175a=function(_0x166412,_0x27c1f8){_0x166412=_0x166412-0x0;var _0x32676d=_0x75a1[_0x166412];return _0x32676d;};'use strict';var _=require(_0x175a('0x0'));var util=require('util');var moment=require(_0x175a('0x1'));var BPromise=require(_0x175a('0x2'));var rs=require(_0x175a('0x3'));var fs=require('fs');var Redis=require(_0x175a('0x4'));var db=require(_0x175a('0x5'))['db'];var utils=require(_0x175a('0x6'));var logger=require(_0x175a('0x7'))(_0x175a('0x8'));var config=require(_0x175a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x175a('0xa')]({'port':0x232a});config[_0x175a('0xb')]=_[_0x175a('0xc')](config[_0x175a('0xb')],{'host':_0x175a('0xd'),'port':0x18eb});var socket=require(_0x175a('0xe'))(new Redis(config[_0x175a('0xb')]));require(_0x175a('0xf'))['register'](socket);function respondWithRpcPromise(_0x21c189,_0x1c70ec,_0x3115be){return new BPromise(function(_0x419e40,_0x3a29c7){return client[_0x175a('0x10')](_0x21c189,_0x3115be)[_0x175a('0x11')](function(_0x31ddf9){logger[_0x175a('0x12')](_0x175a('0x13'),_0x1c70ec,_0x175a('0x14'));logger[_0x175a('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1c70ec,_0x175a('0x14'),JSON['stringify'](_0x31ddf9));if(_0x31ddf9['error']){if(_0x31ddf9['error'][_0x175a('0x16')]===0x1f4){logger[_0x175a('0x17')](_0x175a('0x13'),_0x1c70ec,_0x31ddf9[_0x175a('0x17')][_0x175a('0x18')]);return _0x3a29c7(_0x31ddf9[_0x175a('0x17')][_0x175a('0x18')]);}logger[_0x175a('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1c70ec,_0x31ddf9[_0x175a('0x17')]['message']);return _0x419e40(_0x31ddf9['error'][_0x175a('0x18')]);}else{logger[_0x175a('0x12')](_0x175a('0x13'),_0x1c70ec,_0x175a('0x14'));_0x419e40(_0x31ddf9[_0x175a('0x19')]['message']);}})['catch'](function(_0x20ba0){logger['error'](_0x175a('0x13'),_0x1c70ec,_0x20ba0);_0x3a29c7(_0x20ba0);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8af9ebd..80ed458 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 _0x2353=['register','length','./chatWebsite.events','remove','emit'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x2353,0x124));var _0x3235=function(_0x20d0cd,_0x41bf42){_0x20d0cd=_0x20d0cd-0x0;var _0x56dc6d=_0x2353[_0x20d0cd];return _0x56dc6d;};'use strict';var ChatWebsiteEvents=require(_0x3235('0x0'));var events=['save',_0x3235('0x1'),'update'];function createListener(_0x3dda80,_0x4edf3c){return function(_0x204cb8){_0x4edf3c[_0x3235('0x2')](_0x3dda80,_0x204cb8);};}function removeListener(_0x6d7022,_0x5acfb9){return function(){ChatWebsiteEvents['removeListener'](_0x6d7022,_0x5acfb9);};}exports[_0x3235('0x3')]=function(_0x5f4865){for(var _0x119558=0x0,_0x58736b=events[_0x3235('0x4')];_0x119558<_0x58736b;_0x119558++){var _0x5c3da2=events[_0x119558];var _0x35d7bc=createListener('chatWebsite:'+_0x5c3da2,_0x5f4865);ChatWebsiteEvents['on'](_0x5c3da2,_0x35d7bc);}}; \ No newline at end of file +var _0xdd5b=['update','emit','removeListener','register','chatWebsite:','./chatWebsite.events'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0xdd5b,0x7d));var _0xbdd5=function(_0x14cd0b,_0x2eebd1){_0x14cd0b=_0x14cd0b-0x0;var _0x4728d5=_0xdd5b[_0x14cd0b];return _0x4728d5;};'use strict';var ChatWebsiteEvents=require(_0xbdd5('0x0'));var events=['save','remove',_0xbdd5('0x1')];function createListener(_0x449093,_0x3b5a56){return function(_0x1f719e){_0x3b5a56[_0xbdd5('0x2')](_0x449093,_0x1f719e);};}function removeListener(_0x400bf9,_0x4b6a47){return function(){ChatWebsiteEvents[_0xbdd5('0x3')](_0x400bf9,_0x4b6a47);};}exports[_0xbdd5('0x4')]=function(_0x22bb60){for(var _0x358901=0x0,_0x2f049c=events['length'];_0x358901<_0x2f049c;_0x358901++){var _0x4c66cb=events[_0x358901];var _0x445c6f=createListener(_0xbdd5('0x5')+_0x4c66cb,_0x22bb60);ChatWebsiteEvents['on'](_0x4c66cb,_0x445c6f);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 32bbbf4..95edd74 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 _0xbdca=['isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','offline','addInteraction','/:id/applications','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe'];(function(_0x1939e7,_0x40a7a5){var _0x2dc847=function(_0x54c62a){while(--_0x54c62a){_0x1939e7['push'](_0x1939e7['shift']());}};_0x2dc847(++_0x40a7a5);}(_0xbdca,0x199));var _0xabdc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbdca[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xabdc('0x0'));var util=require(_0xabdc('0x1'));var path=require(_0xabdc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xabdc('0x3'));var auth=require(_0xabdc('0x4'));var interaction=require(_0xabdc('0x5'));var config=require(_0xabdc('0x6'));var controller=require(_0xabdc('0x7'));router[_0xabdc('0x8')]('/',auth['isAuthenticated'](),controller[_0xabdc('0x9')]);router[_0xabdc('0x8')](_0xabdc('0xa'),auth[_0xabdc('0xb')](),controller[_0xabdc('0xc')]);router['get'](_0xabdc('0xd'),auth['isAuthenticated'](),controller[_0xabdc('0xe')]);router[_0xabdc('0x8')](_0xabdc('0xf'),auth[_0xabdc('0xb')](),controller[_0xabdc('0x10')]);router['get'](_0xabdc('0x11'),auth[_0xabdc('0xb')](),controller['getAnswers']);router['get'](_0xabdc('0x12'),controller[_0xabdc('0x13')]);router[_0xabdc('0x8')](_0xabdc('0x14'),controller['getAvatar']);router[_0xabdc('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xabdc('0x8')](_0xabdc('0x15'),controller[_0xabdc('0x16')]);router[_0xabdc('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xabdc('0x17')]);router['get'](_0xabdc('0x18'),controller[_0xabdc('0x19')]);router['get']('/:id/applications',auth[_0xabdc('0xb')](),controller[_0xabdc('0x1a')]);router[_0xabdc('0x8')](_0xabdc('0x1b'),auth[_0xabdc('0xb')](),controller[_0xabdc('0x1c')]);router[_0xabdc('0x8')](_0xabdc('0x1d'),controller[_0xabdc('0x1e')]);router[_0xabdc('0x8')](_0xabdc('0x1f'),auth[_0xabdc('0xb')](),controller[_0xabdc('0x20')]);router[_0xabdc('0x8')]('/:id/users',auth[_0xabdc('0xb')](),controller[_0xabdc('0x21')]);router[_0xabdc('0x22')]('/',auth[_0xabdc('0xb')](),controller[_0xabdc('0x23')]);router['post'](_0xabdc('0xf'),auth['isAuthenticated'](),controller[_0xabdc('0x24')]);router['post'](_0xabdc('0x11'),auth[_0xabdc('0xb')](),controller[_0xabdc('0x25')]);var upload=multer({'storage':multer[_0xabdc('0x26')]({'destination':function(_0x240418,_0x38720a,_0x1999bc){_0x1999bc(null,path[_0xabdc('0x27')](config[_0xabdc('0x28')],_0xabdc('0x29')));},'filename':function(_0x5e5a92,_0x285f32,_0x4071d1){_0x4071d1(null,util[_0xabdc('0x2a')](_0xabdc('0x2b'),Date[_0xabdc('0x2c')](),_0x285f32[_0xabdc('0x2d')]));}})});router[_0xabdc('0x22')](_0xabdc('0x12'),upload[_0xabdc('0x2e')](_0xabdc('0x2f')),controller[_0xabdc('0x30')]);var upload=multer({'storage':multer[_0xabdc('0x26')]({'destination':function(_0x454c06,_0x59faf4,_0x54aa25){_0x54aa25(null,path[_0xabdc('0x27')](config[_0xabdc('0x28')],_0xabdc('0x31')));},'filename':function(_0x590d57,_0x521103,_0x29e3ef){_0x29e3ef(null,util['format'](_0xabdc('0x2b'),Date[_0xabdc('0x2c')](),_0x521103[_0xabdc('0x2d')]));}})});router[_0xabdc('0x22')](_0xabdc('0x14'),upload[_0xabdc('0x2e')](_0xabdc('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x503d98,_0x286682,_0x239883){_0x239883(null,path[_0xabdc('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x355f0c,_0x349e60,_0x18a854){_0x18a854(null,util[_0xabdc('0x2a')](_0xabdc('0x2b'),Date[_0xabdc('0x2c')](),_0x349e60[_0xabdc('0x2d')]));}})});router[_0xabdc('0x22')]('/:id/customer_avatar',upload[_0xabdc('0x2e')]('file'),controller[_0xabdc('0x32')]);var upload=multer({'storage':multer[_0xabdc('0x26')]({'destination':function(_0x6b59cb,_0x262f34,_0x163016){_0x163016(null,path[_0xabdc('0x27')](config[_0xabdc('0x28')],_0xabdc('0x31')));},'filename':function(_0x5df140,_0x11737e,_0x3ad714){_0x3ad714(null,util['format'](_0xabdc('0x2b'),Date[_0xabdc('0x2c')](),_0x11737e['originalname']));}})});router[_0xabdc('0x22')](_0xabdc('0x15'),upload['single']('file'),controller[_0xabdc('0x33')]);router[_0xabdc('0x22')](_0xabdc('0x34'),controller[_0xabdc('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x502801,_0xc91f7f,_0x5e5b1d){const _0x8fbb7a=path[_0xabdc('0x27')](config[_0xabdc('0x28')],_0xabdc('0x36'),_0xabdc('0x37'),_0xabdc('0x38'));fs_extra['ensureDir'](_0x8fbb7a,function(){_0x5e5b1d(null,_0x8fbb7a);});},'filename':function(_0x1e2623,_0x50cb62,_0x2c43a0){const _0x3d264f=_0x50cb62[_0xabdc('0x2d')][_0xabdc('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x453417=path[_0xabdc('0x3a')](_0x3d264f);const _0x28770b=Date[_0xabdc('0x2c')]()+'-'+_0x3d264f[_0xabdc('0x39')](_0x453417,'')+_0x453417;_0x2c43a0(null,_0x28770b);}})});router[_0xabdc('0x22')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xabdc('0x3b')]);router[_0xabdc('0x22')]('/:id/interactions',auth[_0xabdc('0xb')](),controller[_0xabdc('0x3c')]);router[_0xabdc('0x22')](_0xabdc('0x3d'),auth[_0xabdc('0xb')](),controller[_0xabdc('0x3e')]);router[_0xabdc('0x22')](_0xabdc('0x1b'),auth[_0xabdc('0xb')](),controller['addProactiveActions']);router[_0xabdc('0x22')]('/:id/users',auth[_0xabdc('0xb')](),controller[_0xabdc('0x3f')]);router[_0xabdc('0x40')](_0xabdc('0xd'),auth[_0xabdc('0xb')](),controller[_0xabdc('0x41')]);router[_0xabdc('0x42')](_0xabdc('0xd'),auth[_0xabdc('0xb')](),controller[_0xabdc('0x43')]);router['delete'](_0xabdc('0xf'),auth['isAuthenticated'](),controller[_0xabdc('0x44')]);router[_0xabdc('0x42')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xabdc('0x45')]);router['delete']('/:id/users',auth[_0xabdc('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xe7bf=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','%s-%s','now','file','addLogo','root','format','originalname','single','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','exports'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xe7bf,0x1d4));var _0xfe7b=function(_0x3233f7,_0x3a51e7){_0x3233f7=_0x3233f7-0x0;var _0x419790=_0xe7bf[_0x3233f7];return _0x419790;};'use strict';var multer=require(_0xfe7b('0x0'));var util=require(_0xfe7b('0x1'));var path=require(_0xfe7b('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe7b('0x3'));var router=express[_0xfe7b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfe7b('0x5'));var config=require(_0xfe7b('0x6'));var controller=require(_0xfe7b('0x7'));router[_0xfe7b('0x8')]('/',auth[_0xfe7b('0x9')](),controller[_0xfe7b('0xa')]);router[_0xfe7b('0x8')](_0xfe7b('0xb'),auth['isAuthenticated'](),controller[_0xfe7b('0xc')]);router[_0xfe7b('0x8')](_0xfe7b('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xfe7b('0xe'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0xf')]);router[_0xfe7b('0x8')](_0xfe7b('0x10'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x11')]);router[_0xfe7b('0x8')](_0xfe7b('0x12'),controller[_0xfe7b('0x13')]);router['get'](_0xfe7b('0x14'),controller[_0xfe7b('0x15')]);router['get'](_0xfe7b('0x16'),controller[_0xfe7b('0x17')]);router['get'](_0xfe7b('0x18'),controller[_0xfe7b('0x19')]);router[_0xfe7b('0x8')](_0xfe7b('0x1a'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x1b')]);router[_0xfe7b('0x8')](_0xfe7b('0x1c'),controller[_0xfe7b('0x1d')]);router[_0xfe7b('0x8')]('/:id/applications',auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x1e')]);router[_0xfe7b('0x8')](_0xfe7b('0x1f'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x20')]);router['get'](_0xfe7b('0x21'),controller['getFields']);router['get'](_0xfe7b('0x22'),auth['isAuthenticated'](),controller[_0xfe7b('0x23')]);router[_0xfe7b('0x8')]('/:id/users',auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x24')]);router[_0xfe7b('0x25')]('/',auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x26')]);router['post'](_0xfe7b('0xe'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x27')]);router['post'](_0xfe7b('0x10'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x28')]);var upload=multer({'storage':multer[_0xfe7b('0x29')]({'destination':function(_0x191dd0,_0x508484,_0x3fb475){_0x3fb475(null,path[_0xfe7b('0x2a')](config['root'],_0xfe7b('0x2b')));},'filename':function(_0x4a4abd,_0x5e3202,_0x496669){_0x496669(null,util['format'](_0xfe7b('0x2c'),Date[_0xfe7b('0x2d')](),_0x5e3202['originalname']));}})});router[_0xfe7b('0x25')](_0xfe7b('0x12'),upload['single'](_0xfe7b('0x2e')),controller[_0xfe7b('0x2f')]);var upload=multer({'storage':multer[_0xfe7b('0x29')]({'destination':function(_0x56755b,_0x55746f,_0x235af6){_0x235af6(null,path[_0xfe7b('0x2a')](config[_0xfe7b('0x30')],'server/files/images/avatars/'));},'filename':function(_0x153ca7,_0x9475c,_0x5aa41d){_0x5aa41d(null,util[_0xfe7b('0x31')]('%s-%s',Date[_0xfe7b('0x2d')](),_0x9475c[_0xfe7b('0x32')]));}})});router[_0xfe7b('0x25')](_0xfe7b('0x14'),upload[_0xfe7b('0x33')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51d372,_0x9c7273,_0x14b9fc){_0x14b9fc(null,path['join'](config[_0xfe7b('0x30')],_0xfe7b('0x34')));},'filename':function(_0x45e46b,_0x32500b,_0x4191cc){_0x4191cc(null,util['format']('%s-%s',Date[_0xfe7b('0x2d')](),_0x32500b[_0xfe7b('0x32')]));}})});router[_0xfe7b('0x25')](_0xfe7b('0x16'),upload[_0xfe7b('0x33')](_0xfe7b('0x2e')),controller[_0xfe7b('0x35')]);var upload=multer({'storage':multer[_0xfe7b('0x29')]({'destination':function(_0x314384,_0xf4c4fc,_0x11043b){_0x11043b(null,path[_0xfe7b('0x2a')](config['root'],_0xfe7b('0x34')));},'filename':function(_0x45c8d1,_0x536477,_0x209146){_0x209146(null,util[_0xfe7b('0x31')](_0xfe7b('0x2c'),Date[_0xfe7b('0x2d')](),_0x536477[_0xfe7b('0x32')]));}})});router[_0xfe7b('0x25')]('/:id/system_avatar',upload[_0xfe7b('0x33')](_0xfe7b('0x2e')),controller[_0xfe7b('0x36')]);router[_0xfe7b('0x25')](_0xfe7b('0x37'),controller[_0xfe7b('0x38')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5ddc42,_0x36cf72,_0x404f7b){const _0x4b1a25=path[_0xfe7b('0x2a')](config[_0xfe7b('0x30')],_0xfe7b('0x39'),_0xfe7b('0x3a'),_0xfe7b('0x3b'));fs_extra[_0xfe7b('0x3c')](_0x4b1a25,function(){_0x404f7b(null,_0x4b1a25);});},'filename':function(_0x4df721,_0x5448f0,_0x56db6e){const _0x1cd2e3=_0x5448f0['originalname'][_0xfe7b('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4ad36a=path[_0xfe7b('0x3e')](_0x1cd2e3);const _0x3e91a7=Date[_0xfe7b('0x2d')]()+'-'+_0x1cd2e3[_0xfe7b('0x3d')](_0x4ad36a,'')+_0x4ad36a;_0x56db6e(null,_0x3e91a7);}})});router[_0xfe7b('0x25')](_0xfe7b('0x3f'),offlineUploadMulter[_0xfe7b('0x40')](),controller[_0xfe7b('0x41')]);router[_0xfe7b('0x25')](_0xfe7b('0x1a'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xfe7b('0x25')](_0xfe7b('0x42'),auth['isAuthenticated'](),controller[_0xfe7b('0x43')]);router[_0xfe7b('0x25')]('/:id/proactive_actions',auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x44')]);router[_0xfe7b('0x25')](_0xfe7b('0x45'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x46')]);router[_0xfe7b('0x47')]('/:id',auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x48')]);router['delete'](_0xfe7b('0xd'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x49')]);router[_0xfe7b('0x4a')](_0xfe7b('0xe'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x4b')]);router[_0xfe7b('0x4a')](_0xfe7b('0x10'),auth[_0xfe7b('0x9')](),controller['removeAnswers']);router[_0xfe7b('0x4a')](_0xfe7b('0x45'),auth[_0xfe7b('0x9')](),controller[_0xfe7b('0x4c')]);module[_0xfe7b('0x4d')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 1cca361..a87381c 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 _0xb257=['app','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','../config/environment','Router','production'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb257,0x1d6));var _0x7b25=function(_0x20c439,_0x3d6b82){_0x20c439=_0x20c439-0x0;var _0x51c4ab=_0xb257[_0x20c439];return _0x51c4ab;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require('../components/auth/service');var config=require(_0x7b25('0x0'));var router=express[_0x7b25('0x1')]();var isProduction=config['env']===_0x7b25('0x2')||![];function clientSideLogs(_0x167ac9,_0x5bfa6b,_0x1babb7){var _0x34483b=_0x167ac9[_0x7b25('0x3')][_0x7b25('0x4')](_0x7b25('0x5'));if(!_0x34483b){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x7b25('0x6')]({'uri':_0x7b25('0x7'),'logger':_0x34483b,'enableCors':!isProduction})(_0x167ac9,_0x5bfa6b,_0x1babb7);}router[_0x7b25('0x8')](auth[_0x7b25('0x9')](),clientSideLogs);module[_0x7b25('0xa')]=router; \ No newline at end of file +var _0x0796=['isAuthenticated','exports','beaver-logger/server','express','Router','env','app','get','client-side-logger','expressEndpoint','/client-logs','use'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x0796,0x6e));var _0x6079=function(_0x540f44,_0x81ff64){_0x540f44=_0x540f44-0x0;var _0xbd255c=_0x0796[_0x540f44];return _0xbd255c;};var beaverLogger=require(_0x6079('0x0'));var express=require(_0x6079('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x6079('0x2')]();var isProduction=config[_0x6079('0x3')]==='production'||![];function clientSideLogs(_0xdac97e,_0x3c4d5f,_0x281c71){var _0x239c10=_0xdac97e[_0x6079('0x4')][_0x6079('0x5')](_0x6079('0x6'));if(!_0x239c10){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x6079('0x7')]({'uri':_0x6079('0x8'),'logger':_0x239c10,'enableCors':!isProduction})(_0xdac97e,_0x3c4d5f,_0x281c71);}router[_0x6079('0x9')](auth[_0x6079('0xa')](),clientSideLogs);module[_0x6079('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 044bc5d..3a6346d 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 _0xbbd6=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x19a74b,_0x4cd4f2){var _0x436d29=function(_0x426574){while(--_0x426574){_0x19a74b['push'](_0x19a74b['shift']());}};_0x436d29(++_0x4cd4f2);}(_0xbbd6,0x19a));var _0x6bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6bbd('0x0'));module['exports']={'name':{'type':Sequelize[_0x6bbd('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6bbd('0x2')](_0x6bbd('0x3'),_0x6bbd('0x4'),_0x6bbd('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x6bbd('0x6'))},'data1':{'type':Sequelize[_0x6bbd('0x1')],'comment':_0x6bbd('0x7')},'data2':{'type':Sequelize[_0x6bbd('0x1')],'comment':_0x6bbd('0x8')},'data3':{'type':Sequelize[_0x6bbd('0x1')],'comment':_0x6bbd('0x9')},'data4':{'type':Sequelize[_0x6bbd('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x6bbd('0xa')],'comment':_0x6bbd('0xb')},'data6':{'type':Sequelize[_0x6bbd('0xa')],'comment':_0x6bbd('0xc')},'data7':{'type':Sequelize[_0x6bbd('0xa')],'comment':_0x6bbd('0xd')}}; \ No newline at end of file +var _0x55c3=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55c3,0x1ab));var _0x355c=function(_0x58b85e,_0x1e7ab4){_0x58b85e=_0x58b85e-0x0;var _0x1cbde5=_0x55c3[_0x58b85e];return _0x1cbde5;};'use strict';var Sequelize=require(_0x355c('0x0'));module[_0x355c('0x1')]={'name':{'type':Sequelize[_0x355c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x355c('0x3'),_0x355c('0x4'),_0x355c('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x355c('0x6')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x355c('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x355c('0x2')],'comment':_0x355c('0x7')},'data3':{'type':Sequelize[_0x355c('0x2')],'comment':_0x355c('0x8')},'data4':{'type':Sequelize[_0x355c('0x2')],'comment':_0x355c('0x9')},'data5':{'type':Sequelize[_0x355c('0xa')],'comment':_0x355c('0xb')},'data6':{'type':Sequelize[_0x355c('0xa')],'comment':_0x355c('0xc')},'data7':{'type':Sequelize[_0x355c('0xa')],'comment':_0x355c('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 129cd14..6b1e844 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 _0xde37=['filter','merge','type','VIRTUAL','options','includeAll','include','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','find','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','error','stack','name','send','slice','map','CloudProvider','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xde37,0x1ee));var _0x7de3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde37[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7de3('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x7de3('0x1'));var config=require(_0x7de3('0x2'));var logger=require(_0x7de3('0x3'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x7de3('0x4'));config[_0x7de3('0x5')]=_[_0x7de3('0x6')](config[_0x7de3('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x7de3('0x7'))(new Redis(config[_0x7de3('0x5')]));var redis=new Redis(config[_0x7de3('0x5')]);function respondWithStatusCode(_0x793205,_0x1704a2){_0x1704a2=_0x1704a2||0xcc;return function(_0x18a7c7){if(_0x18a7c7){return _0x793205[_0x7de3('0x8')](_0x1704a2);}return _0x793205[_0x7de3('0x9')](_0x1704a2)['end']();};}function respondWithResult(_0xf7707f,_0x119f8c){_0x119f8c=_0x119f8c||0xc8;return function(_0x4b17c8){if(_0x4b17c8){return _0xf7707f[_0x7de3('0x9')](_0x119f8c)[_0x7de3('0xa')](_0x4b17c8);}};}function respondWithFilteredResult(_0x5b74b0,_0x2830df){return function(_0x422fbc){if(_0x422fbc){var _0x182eeb=typeof _0x2830df[_0x7de3('0xb')]===_0x7de3('0xc')&&typeof _0x2830df['limit']===_0x7de3('0xc');var _0x53d3ca=_0x422fbc['count'];var _0x1790aa=_0x182eeb?0x0:_0x2830df['offset'];var _0x411fc5=_0x182eeb?_0x422fbc[_0x7de3('0xd')]:_0x2830df['offset']+_0x2830df[_0x7de3('0xe')];var _0x5b01db;if(_0x411fc5>=_0x53d3ca){_0x411fc5=_0x53d3ca;_0x5b01db=0xc8;}else{_0x5b01db=0xce;}_0x5b74b0[_0x7de3('0x9')](_0x5b01db);return _0x5b74b0[_0x7de3('0xf')](_0x7de3('0x10'),_0x1790aa+'-'+_0x411fc5+'/'+_0x53d3ca)[_0x7de3('0xa')](_0x422fbc);}return null;};}function saveUpdates(_0x2e459f){return function(_0x224227){if(_0x224227){return _0x224227[_0x7de3('0x11')](_0x2e459f)[_0x7de3('0x12')](function(_0x572986){return _0x572986;});}return null;};}function removeEntity(_0x19333d){return function(_0x5727e7){if(_0x5727e7){return _0x5727e7['destroy']()[_0x7de3('0x12')](function(){_0x19333d[_0x7de3('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x491b6d){return function(_0x31638a){if(!_0x31638a){_0x491b6d[_0x7de3('0x8')](0x194);}return _0x31638a;};}function handleError(_0x2b8089,_0x4fc530){_0x4fc530=_0x4fc530||0x1f4;return function(_0x2558af){logger[_0x7de3('0x13')](_0x2558af[_0x7de3('0x14')]);if(_0x2558af[_0x7de3('0x15')]){delete _0x2558af[_0x7de3('0x15')];}_0x2b8089['status'](_0x4fc530)[_0x7de3('0x16')](_0x2558af);};}function maskClientSecret(_0x14d0f8){return _['padEnd'](_0x14d0f8[_0x7de3('0x17')](0x0,0x3),0x14,'*');}exports['index']=function(_0xb56dc4,_0x32822d){var _0x13f1df={},_0x303d42={},_0x422fd1={'count':0x0,'rows':[]};var _0x51f109=_[_0x7de3('0x18')](db[_0x7de3('0x19')]['rawAttributes'],function(_0x328efd){return{'name':_0x328efd[_0x7de3('0x1a')],'type':_0x328efd['type']['key']};});_0x303d42[_0x7de3('0x1b')]=_[_0x7de3('0x18')](_0x51f109,'name');_0x303d42[_0x7de3('0x1c')]=_[_0x7de3('0x1d')](_0xb56dc4[_0x7de3('0x1c')]);_0x303d42['filters']=_[_0x7de3('0x1e')](_0x303d42[_0x7de3('0x1b')],_0x303d42[_0x7de3('0x1c')]);_0x13f1df['attributes']=_[_0x7de3('0x1e')](_0x303d42['model'],qs[_0x7de3('0x1f')](_0xb56dc4['query']['fields']));_0x13f1df[_0x7de3('0x20')]=_0x13f1df[_0x7de3('0x20')][_0x7de3('0x21')]?_0x13f1df[_0x7de3('0x20')]:_0x303d42['model'];if(!_0xb56dc4[_0x7de3('0x1c')][_0x7de3('0x22')](_0x7de3('0x23'))){_0x13f1df['limit']=qs[_0x7de3('0xe')](_0xb56dc4[_0x7de3('0x1c')][_0x7de3('0xe')]);_0x13f1df[_0x7de3('0xb')]=qs[_0x7de3('0xb')](_0xb56dc4[_0x7de3('0x1c')][_0x7de3('0xb')]);}_0x13f1df[_0x7de3('0x24')]=qs[_0x7de3('0x25')](_0xb56dc4['query']['sort']);_0x13f1df[_0x7de3('0x26')]=qs[_0x7de3('0x27')](_['pick'](_0xb56dc4['query'],_0x303d42[_0x7de3('0x27')]),_0x51f109);if(_0xb56dc4[_0x7de3('0x1c')][_0x7de3('0x28')]){_0x13f1df[_0x7de3('0x26')]=_[_0x7de3('0x29')](_0x13f1df[_0x7de3('0x26')],{'$or':_[_0x7de3('0x18')](_0x51f109,function(_0x493718){if(_0x493718[_0x7de3('0x2a')]!==_0x7de3('0x2b')){var _0x3ec584={};_0x3ec584[_0x493718[_0x7de3('0x15')]]={'$like':'%'+_0xb56dc4[_0x7de3('0x1c')][_0x7de3('0x28')]+'%'};return _0x3ec584;}})});}_0x13f1df=_['merge']({},_0x13f1df,_0xb56dc4[_0x7de3('0x2c')]);var _0x44e821={'where':_0x13f1df[_0x7de3('0x26')]};return db[_0x7de3('0x19')]['count'](_0x44e821)['then'](function(_0x40aa57){_0x422fd1[_0x7de3('0xd')]=_0x40aa57;if(_0xb56dc4[_0x7de3('0x1c')][_0x7de3('0x2d')]){_0x13f1df[_0x7de3('0x2e')]=[{'all':!![]}];}return db[_0x7de3('0x19')]['findAll'](_0x13f1df);})[_0x7de3('0x12')](function(_0x400261){_0x422fd1['rows']=_[_0x7de3('0x18')](_0x400261,function(_0x1b63ec){if(_0x1b63ec[_0x7de3('0x2f')]===_0x7de3('0x30')){var _0x44acd5=encryptor[_0x7de3('0x31')](_0x1b63ec['data3']);_0x1b63ec[_0x7de3('0x32')]=maskClientSecret(_0x44acd5);}return _0x1b63ec;});return _0x422fd1;})[_0x7de3('0x12')](respondWithFilteredResult(_0x32822d,_0x13f1df))[_0x7de3('0x33')](handleError(_0x32822d,null));};exports[_0x7de3('0x34')]=function(_0x31327b,_0x2529a7){var _0x4bc809={'raw':!![],'where':{'id':_0x31327b[_0x7de3('0x35')]['id']}},_0x1e8bc2={};_0x1e8bc2[_0x7de3('0x1b')]=_[_0x7de3('0x1d')](db[_0x7de3('0x19')][_0x7de3('0x36')]);_0x1e8bc2[_0x7de3('0x1c')]=_['keys'](_0x31327b[_0x7de3('0x1c')]);_0x1e8bc2[_0x7de3('0x27')]=_[_0x7de3('0x1e')](_0x1e8bc2['model'],_0x1e8bc2[_0x7de3('0x1c')]);_0x4bc809[_0x7de3('0x20')]=_[_0x7de3('0x1e')](_0x1e8bc2[_0x7de3('0x1b')],qs[_0x7de3('0x1f')](_0x31327b['query'][_0x7de3('0x1f')]));_0x4bc809['attributes']=_0x4bc809[_0x7de3('0x20')]['length']?_0x4bc809[_0x7de3('0x20')]:_0x1e8bc2[_0x7de3('0x1b')];if(_0x31327b[_0x7de3('0x1c')]['includeAll']){_0x4bc809[_0x7de3('0x2e')]=[{'all':!![]}];}_0x4bc809=_[_0x7de3('0x29')]({},_0x4bc809,_0x31327b['options']);return db['CloudProvider'][_0x7de3('0x37')](_0x4bc809)[_0x7de3('0x12')](handleEntityNotFound(_0x2529a7,null))[_0x7de3('0x12')](function(_0x3ff383){if(_0x3ff383[_0x7de3('0x2f')]===_0x7de3('0x30')){var _0x2b7eed=encryptor[_0x7de3('0x31')](_0x3ff383[_0x7de3('0x32')]);_0x3ff383[_0x7de3('0x32')]=maskClientSecret(_0x2b7eed);}return _0x3ff383;})[_0x7de3('0x12')](respondWithResult(_0x2529a7,null))[_0x7de3('0x33')](handleError(_0x2529a7,null));};exports['create']=function(_0x4fd2c2,_0x42bc45){if(!_0x4fd2c2['body'][_0x7de3('0x15')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4fd2c2[_0x7de3('0x38')][_0x7de3('0x2f')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x104093=db['CloudProvider']['rawAttributes']['service'][_0x7de3('0x39')];if(!_0x104093[_0x7de3('0x3a')](_0x4fd2c2[_0x7de3('0x38')][_0x7de3('0x2f')]))throw new Error(_0x7de3('0x3b')+_0x104093[_0x7de3('0x3c')](',\x20'));if(_0x4fd2c2[_0x7de3('0x38')]['service']===_0x7de3('0x30')&&_0x4fd2c2[_0x7de3('0x38')]['data3']){_0x4fd2c2[_0x7de3('0x38')][_0x7de3('0x32')]=encryptor[_0x7de3('0x3d')](_0x4fd2c2[_0x7de3('0x38')][_0x7de3('0x32')]);}return db[_0x7de3('0x19')][_0x7de3('0x3e')](_0x4fd2c2[_0x7de3('0x38')],{})['then'](respondWithResult(_0x42bc45,0xc9))[_0x7de3('0x33')](handleError(_0x42bc45,null));};exports[_0x7de3('0x11')]=function(_0x2b9927,_0x39f3d2){if(_0x2b9927[_0x7de3('0x38')]['id']){delete _0x2b9927[_0x7de3('0x38')]['id'];}return db['CloudProvider'][_0x7de3('0x37')]({'where':{'id':_0x2b9927[_0x7de3('0x35')]['id']}})[_0x7de3('0x12')](handleEntityNotFound(_0x39f3d2,null))['then'](function(_0x326989){if(_0x326989[_0x7de3('0x2f')]===_0x7de3('0x30')&&_0x2b9927[_0x7de3('0x38')]['data3']){_0x2b9927[_0x7de3('0x38')]['data3']=encryptor['encryptString'](_0x2b9927[_0x7de3('0x38')]['data3']);}return _0x326989;})[_0x7de3('0x12')](saveUpdates(_0x2b9927['body'],null))[_0x7de3('0x12')](respondWithResult(_0x39f3d2,null))[_0x7de3('0x33')](handleError(_0x39f3d2,null));};exports[_0x7de3('0x3f')]=function(_0x186724,_0x3febec){return db['CloudProvider'][_0x7de3('0x37')]({'where':{'id':_0x186724[_0x7de3('0x35')]['id']}})[_0x7de3('0x12')](handleEntityNotFound(_0x3febec,null))[_0x7de3('0x12')](removeEntity(_0x3febec,null))[_0x7de3('0x33')](handleError(_0x3febec,null));};exports[_0x7de3('0x40')]=function(_0x2d4f11,_0x43b5de){return db[_0x7de3('0x19')]['findOne']({'where':{'id':_0x2d4f11[_0x7de3('0x35')]['id']},'raw':!![]})['then'](function(_0x547c69){if(!_0x547c69)return _0x43b5de['sendStatus'](0x194);return{'url':oauth[_0x7de3('0x41')](_0x547c69,_0x2d4f11[_0x7de3('0x42')]['id'])};})[_0x7de3('0x12')](respondWithResult(_0x43b5de,null))[_0x7de3('0x33')](handleError(_0x43b5de,null));};exports[_0x7de3('0x43')]=function(_0x4039a4,_0x5f9c48){var _0x162a4f=_0x4039a4[_0x7de3('0x38')];var _0x4b7a99;var _0x27fd50;if(_0x162a4f[_0x7de3('0x13')])throw _0x162a4f;redis[_0x7de3('0x44')](_0x162a4f[_0x7de3('0x45')])[_0x7de3('0x12')](function(_0x5234e3){if(!_0x5234e3)throw new Error('Invalid\x20state\x20parameter');_0x4b7a99=JSON['parse'](_0x5234e3);var _0x41059a=Buffer[_0x7de3('0x46')](_0x162a4f[_0x7de3('0x45')],_0x7de3('0x47'))[_0x7de3('0x48')](_0x7de3('0x49'));_0x27fd50=JSON[_0x7de3('0x4a')](_0x41059a);if(!oauth[_0x7de3('0x4b')](_0x162a4f[_0x7de3('0x4c')],_0x4b7a99[_0x7de3('0x4d')]))throw new Error(_0x7de3('0x4e'));redis['del'](_0x162a4f[_0x7de3('0x45')]);return oauth[_0x7de3('0x4f')](_0x162a4f[_0x7de3('0x50')],_0x4b7a99);})[_0x7de3('0x12')](function(_0x6bfee4){_0x4b7a99[_0x7de3('0x51')]=_0x6bfee4[_0x7de3('0x52')];_0x4b7a99[_0x7de3('0x53')]=_0x6bfee4[_0x7de3('0x54')];return db[_0x7de3('0x19')][_0x7de3('0x11')]({'data5':_0x4b7a99[_0x7de3('0x51')],'data6':_0x4b7a99[_0x7de3('0x53')]},{'where':{'id':_0x4b7a99['id']}});})[_0x7de3('0x12')](function(){oauth[_0x7de3('0x55')](_0x4b7a99);socket[_0x7de3('0x56')]('microsoftAuthorization:success',{'id':_0x27fd50['id']});return;})[_0x7de3('0x12')](respondWithStatusCode(_0x5f9c48,null))[_0x7de3('0x33')](function(_0x555c33){if(_0x27fd50){socket[_0x7de3('0x56')]('microsoftAuthorization:error',{'id':_0x27fd50['id']});}if(!_0x4b7a99){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x555c33);return _0x5f9c48['status'](0x1f4)[_0x7de3('0x16')](_0x555c33['message']);}logger[_0x7de3('0x13')](_0x7de3('0x57'),_0x4b7a99['id'],JSON[_0x7de3('0x58')](_0x555c33));});}; \ No newline at end of file +var _0xd3cd=['findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','defaults','localhost','socket.io-emitter','redis','sendStatus','status','json','offset','limit','undefined','count','set','update','then','destroy','end','error','stack','name','padEnd','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','join','encryptString','find'];(function(_0x2f729b,_0x324639){var _0x5aff18=function(_0x315eaf){while(--_0x315eaf){_0x2f729b['push'](_0x2f729b['shift']());}};_0x5aff18(++_0x324639);}(_0xd3cd,0x1eb));var _0xdd3c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd3cd[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xdd3c('0x0'));var Redis=require(_0xdd3c('0x1'));var qs=require(_0xdd3c('0x2'));var encryptor=require(_0xdd3c('0x3'));var config=require(_0xdd3c('0x4'));var logger=require(_0xdd3c('0x5'))('api');var db=require(_0xdd3c('0x6'))['db'];var oauth=require(_0xdd3c('0x7'));config['redis']=_[_0xdd3c('0x8')](config['redis'],{'host':_0xdd3c('0x9'),'port':0x18eb});var socket=require(_0xdd3c('0xa'))(new Redis(config[_0xdd3c('0xb')]));var redis=new Redis(config[_0xdd3c('0xb')]);function respondWithStatusCode(_0x447160,_0x1ebe1a){_0x1ebe1a=_0x1ebe1a||0xcc;return function(_0xfcfd26){if(_0xfcfd26){return _0x447160[_0xdd3c('0xc')](_0x1ebe1a);}return _0x447160[_0xdd3c('0xd')](_0x1ebe1a)['end']();};}function respondWithResult(_0x5471e8,_0x38397a){_0x38397a=_0x38397a||0xc8;return function(_0x2a838b){if(_0x2a838b){return _0x5471e8['status'](_0x38397a)[_0xdd3c('0xe')](_0x2a838b);}};}function respondWithFilteredResult(_0x53aac7,_0x12b2f6){return function(_0xec7117){if(_0xec7117){var _0x144f09=typeof _0x12b2f6[_0xdd3c('0xf')]==='undefined'&&typeof _0x12b2f6[_0xdd3c('0x10')]===_0xdd3c('0x11');var _0x140732=_0xec7117['count'];var _0x4500d8=_0x144f09?0x0:_0x12b2f6[_0xdd3c('0xf')];var _0x452d98=_0x144f09?_0xec7117[_0xdd3c('0x12')]:_0x12b2f6['offset']+_0x12b2f6[_0xdd3c('0x10')];var _0x20b0aa;if(_0x452d98>=_0x140732){_0x452d98=_0x140732;_0x20b0aa=0xc8;}else{_0x20b0aa=0xce;}_0x53aac7['status'](_0x20b0aa);return _0x53aac7[_0xdd3c('0x13')]('Content-Range',_0x4500d8+'-'+_0x452d98+'/'+_0x140732)[_0xdd3c('0xe')](_0xec7117);}return null;};}function saveUpdates(_0x4f6f65){return function(_0x12a4b8){if(_0x12a4b8){return _0x12a4b8[_0xdd3c('0x14')](_0x4f6f65)[_0xdd3c('0x15')](function(_0x2dba2f){return _0x2dba2f;});}return null;};}function removeEntity(_0x35ce8b){return function(_0x2a03d6){if(_0x2a03d6){return _0x2a03d6[_0xdd3c('0x16')]()[_0xdd3c('0x15')](function(){_0x35ce8b[_0xdd3c('0xd')](0xcc)[_0xdd3c('0x17')]();});}};}function handleEntityNotFound(_0x5c068e){return function(_0x40bed6){if(!_0x40bed6){_0x5c068e['sendStatus'](0x194);}return _0x40bed6;};}function handleError(_0x6e1226,_0x479842){_0x479842=_0x479842||0x1f4;return function(_0x618d0b){logger[_0xdd3c('0x18')](_0x618d0b[_0xdd3c('0x19')]);if(_0x618d0b['name']){delete _0x618d0b[_0xdd3c('0x1a')];}_0x6e1226[_0xdd3c('0xd')](_0x479842)['send'](_0x618d0b);};}function maskClientSecret(_0x289b21){return _[_0xdd3c('0x1b')](_0x289b21['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x1d6286,_0x4d7327){var _0x399765={},_0x252183={},_0x2f5514={'count':0x0,'rows':[]};var _0x567847=_[_0xdd3c('0x1c')](db[_0xdd3c('0x1d')][_0xdd3c('0x1e')],function(_0x4335fe){return{'name':_0x4335fe[_0xdd3c('0x1f')],'type':_0x4335fe[_0xdd3c('0x20')][_0xdd3c('0x21')]};});_0x252183[_0xdd3c('0x22')]=_[_0xdd3c('0x1c')](_0x567847,_0xdd3c('0x1a'));_0x252183[_0xdd3c('0x23')]=_[_0xdd3c('0x24')](_0x1d6286[_0xdd3c('0x23')]);_0x252183['filters']=_[_0xdd3c('0x25')](_0x252183[_0xdd3c('0x22')],_0x252183[_0xdd3c('0x23')]);_0x399765[_0xdd3c('0x26')]=_['intersection'](_0x252183[_0xdd3c('0x22')],qs[_0xdd3c('0x27')](_0x1d6286[_0xdd3c('0x23')][_0xdd3c('0x27')]));_0x399765['attributes']=_0x399765[_0xdd3c('0x26')][_0xdd3c('0x28')]?_0x399765['attributes']:_0x252183['model'];if(!_0x1d6286[_0xdd3c('0x23')]['hasOwnProperty'](_0xdd3c('0x29'))){_0x399765[_0xdd3c('0x10')]=qs[_0xdd3c('0x10')](_0x1d6286[_0xdd3c('0x23')][_0xdd3c('0x10')]);_0x399765[_0xdd3c('0xf')]=qs['offset'](_0x1d6286[_0xdd3c('0x23')][_0xdd3c('0xf')]);}_0x399765['order']=qs[_0xdd3c('0x2a')](_0x1d6286[_0xdd3c('0x23')][_0xdd3c('0x2a')]);_0x399765[_0xdd3c('0x2b')]=qs[_0xdd3c('0x2c')](_[_0xdd3c('0x2d')](_0x1d6286['query'],_0x252183[_0xdd3c('0x2c')]),_0x567847);if(_0x1d6286[_0xdd3c('0x23')][_0xdd3c('0x2e')]){_0x399765[_0xdd3c('0x2b')]=_['merge'](_0x399765['where'],{'$or':_['map'](_0x567847,function(_0xac2e54){if(_0xac2e54['type']!==_0xdd3c('0x2f')){var _0x5ed98d={};_0x5ed98d[_0xac2e54[_0xdd3c('0x1a')]]={'$like':'%'+_0x1d6286['query'][_0xdd3c('0x2e')]+'%'};return _0x5ed98d;}})});}_0x399765=_[_0xdd3c('0x30')]({},_0x399765,_0x1d6286['options']);var _0x24bf74={'where':_0x399765['where']};return db[_0xdd3c('0x1d')][_0xdd3c('0x12')](_0x24bf74)['then'](function(_0x3f1a11){_0x2f5514['count']=_0x3f1a11;if(_0x1d6286['query'][_0xdd3c('0x31')]){_0x399765['include']=[{'all':!![]}];}return db['CloudProvider'][_0xdd3c('0x32')](_0x399765);})[_0xdd3c('0x15')](function(_0x1a331c){_0x2f5514['rows']=_[_0xdd3c('0x1c')](_0x1a331c,function(_0x308e14){if(_0x308e14[_0xdd3c('0x33')]===_0xdd3c('0x34')){var _0x1ab921=encryptor[_0xdd3c('0x35')](_0x308e14[_0xdd3c('0x36')]);_0x308e14[_0xdd3c('0x36')]=maskClientSecret(_0x1ab921);}return _0x308e14;});return _0x2f5514;})[_0xdd3c('0x15')](respondWithFilteredResult(_0x4d7327,_0x399765))[_0xdd3c('0x37')](handleError(_0x4d7327,null));};exports[_0xdd3c('0x38')]=function(_0x3474f4,_0x4bb436){var _0x4662a7={'raw':!![],'where':{'id':_0x3474f4[_0xdd3c('0x39')]['id']}},_0x255d64={};_0x255d64['model']=_[_0xdd3c('0x24')](db[_0xdd3c('0x1d')][_0xdd3c('0x1e')]);_0x255d64[_0xdd3c('0x23')]=_[_0xdd3c('0x24')](_0x3474f4['query']);_0x255d64[_0xdd3c('0x2c')]=_[_0xdd3c('0x25')](_0x255d64['model'],_0x255d64[_0xdd3c('0x23')]);_0x4662a7['attributes']=_[_0xdd3c('0x25')](_0x255d64[_0xdd3c('0x22')],qs[_0xdd3c('0x27')](_0x3474f4[_0xdd3c('0x23')][_0xdd3c('0x27')]));_0x4662a7['attributes']=_0x4662a7[_0xdd3c('0x26')][_0xdd3c('0x28')]?_0x4662a7[_0xdd3c('0x26')]:_0x255d64[_0xdd3c('0x22')];if(_0x3474f4[_0xdd3c('0x23')][_0xdd3c('0x31')]){_0x4662a7['include']=[{'all':!![]}];}_0x4662a7=_['merge']({},_0x4662a7,_0x3474f4[_0xdd3c('0x3a')]);return db[_0xdd3c('0x1d')]['find'](_0x4662a7)[_0xdd3c('0x15')](handleEntityNotFound(_0x4bb436,null))[_0xdd3c('0x15')](function(_0x456500){if(_0x456500[_0xdd3c('0x33')]===_0xdd3c('0x34')){var _0xd1400f=encryptor[_0xdd3c('0x35')](_0x456500[_0xdd3c('0x36')]);_0x456500[_0xdd3c('0x36')]=maskClientSecret(_0xd1400f);}return _0x456500;})[_0xdd3c('0x15')](respondWithResult(_0x4bb436,null))[_0xdd3c('0x37')](handleError(_0x4bb436,null));};exports[_0xdd3c('0x3b')]=function(_0x1f1012,_0x3395aa){if(!_0x1f1012[_0xdd3c('0x3c')]['name'])throw new Error(_0xdd3c('0x3d'));if(!_0x1f1012[_0xdd3c('0x3c')]['service'])throw new Error(_0xdd3c('0x3e'));var _0x57b258=db[_0xdd3c('0x1d')][_0xdd3c('0x1e')][_0xdd3c('0x33')]['values'];if(!_0x57b258[_0xdd3c('0x3f')](_0x1f1012[_0xdd3c('0x3c')][_0xdd3c('0x33')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x57b258[_0xdd3c('0x40')](',\x20'));if(_0x1f1012[_0xdd3c('0x3c')][_0xdd3c('0x33')]==='MicrosoftAzure'&&_0x1f1012[_0xdd3c('0x3c')][_0xdd3c('0x36')]){_0x1f1012[_0xdd3c('0x3c')]['data3']=encryptor[_0xdd3c('0x41')](_0x1f1012['body']['data3']);}return db[_0xdd3c('0x1d')]['create'](_0x1f1012[_0xdd3c('0x3c')],{})[_0xdd3c('0x15')](respondWithResult(_0x3395aa,0xc9))[_0xdd3c('0x37')](handleError(_0x3395aa,null));};exports[_0xdd3c('0x14')]=function(_0x4b2975,_0x1f09ee){if(_0x4b2975[_0xdd3c('0x3c')]['id']){delete _0x4b2975['body']['id'];}return db[_0xdd3c('0x1d')][_0xdd3c('0x42')]({'where':{'id':_0x4b2975['params']['id']}})['then'](handleEntityNotFound(_0x1f09ee,null))['then'](function(_0x28db5a){if(_0x28db5a[_0xdd3c('0x33')]==='MicrosoftAzure'&&_0x4b2975[_0xdd3c('0x3c')][_0xdd3c('0x36')]){_0x4b2975['body'][_0xdd3c('0x36')]=encryptor['encryptString'](_0x4b2975[_0xdd3c('0x3c')][_0xdd3c('0x36')]);}return _0x28db5a;})[_0xdd3c('0x15')](saveUpdates(_0x4b2975[_0xdd3c('0x3c')],null))['then'](respondWithResult(_0x1f09ee,null))[_0xdd3c('0x37')](handleError(_0x1f09ee,null));};exports[_0xdd3c('0x16')]=function(_0x47438d,_0x441199){return db[_0xdd3c('0x1d')]['find']({'where':{'id':_0x47438d[_0xdd3c('0x39')]['id']}})[_0xdd3c('0x15')](handleEntityNotFound(_0x441199,null))[_0xdd3c('0x15')](removeEntity(_0x441199,null))[_0xdd3c('0x37')](handleError(_0x441199,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5919e4,_0x370814){return db[_0xdd3c('0x1d')][_0xdd3c('0x43')]({'where':{'id':_0x5919e4[_0xdd3c('0x39')]['id']},'raw':!![]})[_0xdd3c('0x15')](function(_0x2404c1){if(!_0x2404c1)return _0x370814[_0xdd3c('0xc')](0x194);return{'url':oauth[_0xdd3c('0x44')](_0x2404c1,_0x5919e4['user']['id'])};})[_0xdd3c('0x15')](respondWithResult(_0x370814,null))[_0xdd3c('0x37')](handleError(_0x370814,null));};exports[_0xdd3c('0x45')]=function(_0x3a772a,_0xe54b4c){var _0x8ccb22=_0x3a772a[_0xdd3c('0x3c')];var _0x3b5caa;var _0x9c1d13;if(_0x8ccb22['error'])throw _0x8ccb22;redis[_0xdd3c('0x46')](_0x8ccb22[_0xdd3c('0x47')])['then'](function(_0x58f902){if(!_0x58f902)throw new Error(_0xdd3c('0x48'));_0x3b5caa=JSON['parse'](_0x58f902);var _0x591951=Buffer[_0xdd3c('0x49')](_0x8ccb22['state'],_0xdd3c('0x4a'))[_0xdd3c('0x4b')](_0xdd3c('0x4c'));_0x9c1d13=JSON[_0xdd3c('0x4d')](_0x591951);if(!oauth[_0xdd3c('0x4e')](_0x8ccb22[_0xdd3c('0x4f')],_0x3b5caa[_0xdd3c('0x50')]))throw new Error(_0xdd3c('0x51'));redis[_0xdd3c('0x52')](_0x8ccb22[_0xdd3c('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x8ccb22['code'],_0x3b5caa);})['then'](function(_0x5993d6){_0x3b5caa[_0xdd3c('0x53')]=_0x5993d6[_0xdd3c('0x54')];_0x3b5caa[_0xdd3c('0x55')]=_0x5993d6[_0xdd3c('0x56')];return db[_0xdd3c('0x1d')][_0xdd3c('0x14')]({'data5':_0x3b5caa[_0xdd3c('0x53')],'data6':_0x3b5caa[_0xdd3c('0x55')]},{'where':{'id':_0x3b5caa['id']}});})['then'](function(){oauth[_0xdd3c('0x57')](_0x3b5caa);socket[_0xdd3c('0x58')](_0xdd3c('0x59'),{'id':_0x9c1d13['id']});return;})[_0xdd3c('0x15')](respondWithStatusCode(_0xe54b4c,null))[_0xdd3c('0x37')](function(_0x12e2c4){if(_0x9c1d13){socket['emit'](_0xdd3c('0x5a'),{'id':_0x9c1d13['id']});}if(!_0x3b5caa){logger[_0xdd3c('0x18')](_0xdd3c('0x5b'),_0x12e2c4);return _0xe54b4c[_0xdd3c('0xd')](0x1f4)['send'](_0x12e2c4[_0xdd3c('0x5c')]);}logger[_0xdd3c('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x3b5caa['id'],JSON['stringify'](_0x12e2c4));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 22cc4af..3e9afeb 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 _0x4f16=['moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','../../config/logger'];(function(_0x5d743a,_0x386cc3){var _0x2f0fec=function(_0x48b71e){while(--_0x48b71e){_0x5d743a['push'](_0x5d743a['shift']());}};_0x2f0fec(++_0x386cc3);}(_0x4f16,0x15e));var _0x64f1=function(_0xca78f1,_0x2c90c8){_0xca78f1=_0xca78f1-0x0;var _0xda435e=_0x4f16[_0xca78f1];return _0xda435e;};'use strict';var _=require(_0x64f1('0x0'));var util=require('util');var logger=require(_0x64f1('0x1'))('api');var moment=require(_0x64f1('0x2'));var BPromise=require(_0x64f1('0x3'));var rp=require(_0x64f1('0x4'));var fs=require('fs');var path=require(_0x64f1('0x5'));var rimraf=require('rimraf');var config=require(_0x64f1('0x6'));var attributes=require(_0x64f1('0x7'));module[_0x64f1('0x8')]=function(_0x2f0101,_0x2cd593){return _0x2f0101[_0x64f1('0x9')](_0x64f1('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26e4=['exports','define','CloudProvider','lodash','util','../../config/logger','request-promise','path','../../config/environment','./cloudProvider.attributes'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x26e4,0xad));var _0x426e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x26e4[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x426e('0x0'));var util=require(_0x426e('0x1'));var logger=require(_0x426e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x426e('0x3'));var fs=require('fs');var path=require(_0x426e('0x4'));var rimraf=require('rimraf');var config=require(_0x426e('0x5'));var attributes=require(_0x426e('0x6'));module[_0x426e('0x7')]=function(_0x2bce2c,_0xcab472){return _0x2bce2c[_0x426e('0x8')](_0x426e('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 5538e81..2915449 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 _0x52f4=['issuer','aud','audience','unix','exp','resolve','then','data3','refresh_token','data6','POST','{TENANT_ID}','data5','access_token','CloudProvider','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','type','push','/.default','join','Outlook365','data7','replace','data2','code','id_token','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','form_post','state','nonce','prompt','login','map','key','value','oauth2Claims','oauth2/','set'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x52f4,0x69));var _0x452f=function(_0x544db5,_0x2d8fae){_0x544db5=_0x544db5-0x0;var _0x2339d5=_0x52f4[_0x544db5];return _0x2339d5;};'use strict';var _=require(_0x452f('0x0'));var crypto=require('crypto');var jwt=require(_0x452f('0x1'));var moment=require(_0x452f('0x2'));var Redis=require(_0x452f('0x3'));var rp=require(_0x452f('0x4'));var util=require('util');var encryptor=require(_0x452f('0x5'));var config=require(_0x452f('0x6'));var logger=require(_0x452f('0x7'))(_0x452f('0x8'));var schedule=require(_0x452f('0x9'));var db=require(_0x452f('0xa'))['db'];config[_0x452f('0xb')]=_[_0x452f('0xc')](config[_0x452f('0xb')],{'host':_0x452f('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x452f('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x452f('0xf'),_0x452f('0x10'),_0x452f('0x11'),_0x452f('0x12'),_0x452f('0x13'),_0x452f('0x14'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x452f('0xf'),_0x452f('0x12')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5f1d1d){var _0x43618a=_['map'](AZURE_AUTH_SCOPES[_0x5f1d1d[_0x452f('0x15')]]);if(_0x5f1d1d['type']==='Dynamics365')_0x43618a[_0x452f('0x16')](_0x5f1d1d['data7']+_0x452f('0x17'));return _0x43618a[_0x452f('0x18')]('\x20');}function getAccessTokenScope(_0x28484a){if(_0x28484a[_0x452f('0x15')]===_0x452f('0x19'))return _0x452f('0x13');if(_0x28484a[_0x452f('0x15')]==='Dynamics365')return _0x28484a[_0x452f('0x1a')]+_0x452f('0x17');}function generateMicrosoftAuthorizationUrl(_0x254771,_0x5c5453){var _0x3f096d=MICROSOFT_AUTH_URL[_0x452f('0x1b')]('{TENANT_ID}',_0x254771[_0x452f('0x1c')]);var _0x1b4bff=[_0x452f('0x1d'),_0x452f('0x1e')];var _0x1ca6a4=Buffer['from'](JSON[_0x452f('0x1f')]({'id':_0x5c5453}))[_0x452f('0x20')](_0x452f('0x21'));var _0x1bc10d=crypto[_0x452f('0x22')](0x10)[_0x452f('0x20')](_0x452f('0x23'));var _0x5151df=getAuthorizationScopes(_0x254771);var _0x13e61f=[{'key':_0x452f('0x24'),'value':_0x254771[_0x452f('0x25')]},{'key':'response_type','value':encodeURIComponent(_0x1b4bff['join']('\x20'))},{'key':_0x452f('0x26'),'value':_0x254771[_0x452f('0x27')]},{'key':'response_mode','value':_0x452f('0x28')},{'key':'scope','value':encodeURIComponent(_0x5151df)},{'key':_0x452f('0x29'),'value':_0x1ca6a4},{'key':_0x452f('0x2a'),'value':_0x1bc10d},{'key':_0x452f('0x2b'),'value':_0x452f('0x2c')}];var _0x3afc05=_0x3f096d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x452f('0x2d')](_0x13e61f,function(_0x2e9749){return _0x2e9749[_0x452f('0x2e')]+'='+_0x2e9749[_0x452f('0x2f')];})[_0x452f('0x18')]('&');_0x254771[_0x452f('0x30')]={'issuer':_0x3f096d[_0x452f('0x1b')](_0x452f('0x31'),''),'audience':_0x254771[_0x452f('0x25')],'state':_0x1ca6a4,'nonce':_0x1bc10d};redis[_0x452f('0x32')](_0x1ca6a4,JSON['stringify'](_0x254771));return _0x3afc05;}function isValidIdToken(_0x361fa6,_0x4c80cb){try{var _0x1ece40=jwt['decode'](_0x361fa6,{'complete':!![]});var _0x388587=_0x1ece40['payload'];if(_0x388587['iss']!==_0x4c80cb[_0x452f('0x33')])return![];if(_0x388587[_0x452f('0x34')]!==_0x4c80cb[_0x452f('0x35')])return![];if(_0x388587['nonce']!==_0x4c80cb[_0x452f('0x2a')])return![];if(moment()['isAfter'](moment[_0x452f('0x36')](_0x388587[_0x452f('0x37')])))return![];return!![];}catch(_0x5e7d4){throw _0x5e7d4;}}function refreshOauth2MicrosoftAccessToken(_0x5da058){return Promise[_0x452f('0x38')]()[_0x452f('0x39')](function(){if(_0x5da058[_0x452f('0x3a')])return _0x5da058;return db['CloudProvider']['findOne']({'where':{'id':_0x5da058['id']},'raw':!![]});})[_0x452f('0x39')](function(_0x2314fb){var _0x79f38d={'grant_type':_0x452f('0x3b'),'refresh_token':_0x2314fb[_0x452f('0x3c')],'scope':getAccessTokenScope(_0x2314fb),'redirect_uri':_0x2314fb[_0x452f('0x27')],'client_id':_0x2314fb[_0x452f('0x25')],'client_secret':encryptor['decryptString'](_0x2314fb['data3'])};var _0x5d0f4f={'method':_0x452f('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x452f('0x1b')](_0x452f('0x3e'),_0x2314fb[_0x452f('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x79f38d,'json':!![]};return rp(_0x5d0f4f);})['then'](function(_0x1f2851){_0x5da058[_0x452f('0x3f')]=_0x1f2851[_0x452f('0x40')];_0x5da058['data6']=_0x1f2851[_0x452f('0x3b')];return db[_0x452f('0x41')][_0x452f('0x42')]({'data5':_0x5da058[_0x452f('0x3f')],'data6':_0x5da058[_0x452f('0x3c')]},{'where':{'id':_0x5da058['id']}});})[_0x452f('0x39')](function(){return _0x5da058;})['catch'](function(_0x49b2eb){logger[_0x452f('0x43')](_0x452f('0x44'),_0x5da058['id'],_0x49b2eb);});}function getOauth2MicrosoftAccessToken(_0x24382f,_0x504e8c){var _0x1d5978={'grant_type':_0x452f('0x45'),'code':_0x24382f,'scope':getAccessTokenScope(_0x504e8c),'redirect_uri':_0x504e8c[_0x452f('0x27')],'client_id':_0x504e8c[_0x452f('0x25')],'client_secret':encryptor[_0x452f('0x46')](_0x504e8c['data3'])};var _0xcc2640={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x452f('0x1b')](_0x452f('0x3e'),_0x504e8c[_0x452f('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1d5978,'json':!![]};return rp(_0xcc2640);}function startRefreshInterval(_0x290e86){var _0x42c5b1=schedule[_0x452f('0x47')];if(_0x42c5b1[_0x290e86['id']])clearInterval(_0x42c5b1[_0x290e86['id']]);_0x42c5b1[_0x290e86['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x452f('0x48')](this,{'id':_0x290e86['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x452f('0x47')]=_0x42c5b1;}function startAllRefreshIntervals(){return db[_0x452f('0x41')][_0x452f('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x452f('0x39')](function(_0x5dbdab){var _0x5783e1=_0x5dbdab['map'](function(_0x4bcc67){return refreshOauth2MicrosoftAccessToken(_0x4bcc67)[_0x452f('0x39')](function(_0x19114e){startRefreshInterval(_0x19114e);});});return Promise[_0x452f('0x4a')](_0x5783e1);})[_0x452f('0x4b')](function(_0x58d7da){var _0x2f9fc7=_0x58d7da?util['inspect'](_0x58d7da,{'showHidden':![],'depth':null}):'';logger[_0x452f('0x43')](_0x452f('0x4c'),_0x2f9fc7);});}module[_0x452f('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xf7e4=['/token','map','type','Dynamics365','push','/.default','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','from','stringify','base64','randomBytes','hex','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','decryptString','POST','data5','access_token','catch','error','authorization_code','intervals','bind','findAll','all','inspect','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'];(function(_0x1dbbc9,_0x1f236d){var _0x623a27=function(_0x5df156){while(--_0x5df156){_0x1dbbc9['push'](_0x1dbbc9['shift']());}};_0x623a27(++_0x1f236d);}(_0xf7e4,0x89));var _0x4f7e=function(_0x5ea8d4,_0x51768f){_0x5ea8d4=_0x5ea8d4-0x0;var _0x5b8277=_0xf7e4[_0x5ea8d4];return _0x5b8277;};'use strict';var _=require('lodash');var crypto=require(_0x4f7e('0x0'));var jwt=require(_0x4f7e('0x1'));var moment=require(_0x4f7e('0x2'));var Redis=require(_0x4f7e('0x3'));var rp=require(_0x4f7e('0x4'));var util=require(_0x4f7e('0x5'));var encryptor=require(_0x4f7e('0x6'));var config=require(_0x4f7e('0x7'));var logger=require(_0x4f7e('0x8'))(_0x4f7e('0x9'));var schedule=require(_0x4f7e('0xa'));var db=require(_0x4f7e('0xb'))['db'];config[_0x4f7e('0xc')]=_[_0x4f7e('0xd')](config[_0x4f7e('0xc')],{'host':_0x4f7e('0xe'),'port':0x18eb});var redis=new Redis(config[_0x4f7e('0xc')]);var MICROSOFT_AUTH_URL=_0x4f7e('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4f7e('0x10'),_0x4f7e('0x11'),'email','offline_access',_0x4f7e('0x12'),_0x4f7e('0x13'),_0x4f7e('0x14')],'Dynamics365':[_0x4f7e('0x10'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x4f7e('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5c2cd4){var _0x47b069=_[_0x4f7e('0x16')](AZURE_AUTH_SCOPES[_0x5c2cd4[_0x4f7e('0x17')]]);if(_0x5c2cd4[_0x4f7e('0x17')]===_0x4f7e('0x18'))_0x47b069[_0x4f7e('0x19')](_0x5c2cd4['data7']+_0x4f7e('0x1a'));return _0x47b069['join']('\x20');}function getAccessTokenScope(_0x5a4123){if(_0x5a4123[_0x4f7e('0x17')]===_0x4f7e('0x1b'))return _0x4f7e('0x12');if(_0x5a4123[_0x4f7e('0x17')]===_0x4f7e('0x18'))return _0x5a4123[_0x4f7e('0x1c')]+_0x4f7e('0x1a');}function generateMicrosoftAuthorizationUrl(_0x4288b8,_0x2471fa){var _0x574de2=MICROSOFT_AUTH_URL[_0x4f7e('0x1d')](_0x4f7e('0x1e'),_0x4288b8[_0x4f7e('0x1f')]);var _0x2c53e6=[_0x4f7e('0x20'),_0x4f7e('0x21')];var _0x13516a=Buffer[_0x4f7e('0x22')](JSON[_0x4f7e('0x23')]({'id':_0x2471fa}))['toString'](_0x4f7e('0x24'));var _0x41cf40=crypto[_0x4f7e('0x25')](0x10)['toString'](_0x4f7e('0x26'));var _0x863f5d=getAuthorizationScopes(_0x4288b8);var _0xd17def=[{'key':_0x4f7e('0x27'),'value':_0x4288b8[_0x4f7e('0x28')]},{'key':_0x4f7e('0x29'),'value':encodeURIComponent(_0x2c53e6[_0x4f7e('0x2a')]('\x20'))},{'key':_0x4f7e('0x2b'),'value':_0x4288b8[_0x4f7e('0x2c')]},{'key':_0x4f7e('0x2d'),'value':_0x4f7e('0x2e')},{'key':_0x4f7e('0x2f'),'value':encodeURIComponent(_0x863f5d)},{'key':_0x4f7e('0x30'),'value':_0x13516a},{'key':_0x4f7e('0x31'),'value':_0x41cf40},{'key':_0x4f7e('0x32'),'value':_0x4f7e('0x33')}];var _0x541945=_0x574de2+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4f7e('0x16')](_0xd17def,function(_0x3e1923){return _0x3e1923[_0x4f7e('0x34')]+'='+_0x3e1923[_0x4f7e('0x35')];})[_0x4f7e('0x2a')]('&');_0x4288b8[_0x4f7e('0x36')]={'issuer':_0x574de2[_0x4f7e('0x1d')](_0x4f7e('0x37'),''),'audience':_0x4288b8[_0x4f7e('0x28')],'state':_0x13516a,'nonce':_0x41cf40};redis['set'](_0x13516a,JSON['stringify'](_0x4288b8));return _0x541945;}function isValidIdToken(_0xff9eaf,_0x21a43a){try{var _0x47320e=jwt[_0x4f7e('0x38')](_0xff9eaf,{'complete':!![]});var _0x2ba08d=_0x47320e['payload'];if(_0x2ba08d['iss']!==_0x21a43a['issuer'])return![];if(_0x2ba08d[_0x4f7e('0x39')]!==_0x21a43a['audience'])return![];if(_0x2ba08d[_0x4f7e('0x31')]!==_0x21a43a['nonce'])return![];if(moment()['isAfter'](moment[_0x4f7e('0x3a')](_0x2ba08d[_0x4f7e('0x3b')])))return![];return!![];}catch(_0x44ca41){throw _0x44ca41;}}function refreshOauth2MicrosoftAccessToken(_0x50ad2e){return Promise[_0x4f7e('0x3c')]()[_0x4f7e('0x3d')](function(){if(_0x50ad2e[_0x4f7e('0x3e')])return _0x50ad2e;return db[_0x4f7e('0x3f')][_0x4f7e('0x40')]({'where':{'id':_0x50ad2e['id']},'raw':!![]});})[_0x4f7e('0x3d')](function(_0x37525b){var _0x4cfddd={'grant_type':'refresh_token','refresh_token':_0x37525b[_0x4f7e('0x41')],'scope':getAccessTokenScope(_0x37525b),'redirect_uri':_0x37525b[_0x4f7e('0x2c')],'client_id':_0x37525b[_0x4f7e('0x28')],'client_secret':encryptor[_0x4f7e('0x42')](_0x37525b[_0x4f7e('0x3e')])};var _0x202aad={'method':_0x4f7e('0x43'),'uri':MICROSOFT_AUTH_URL[_0x4f7e('0x1d')](_0x4f7e('0x1e'),_0x37525b[_0x4f7e('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4cfddd,'json':!![]};return rp(_0x202aad);})['then'](function(_0x416046){_0x50ad2e[_0x4f7e('0x44')]=_0x416046[_0x4f7e('0x45')];_0x50ad2e['data6']=_0x416046['refresh_token'];return db[_0x4f7e('0x3f')]['update']({'data5':_0x50ad2e[_0x4f7e('0x44')],'data6':_0x50ad2e[_0x4f7e('0x41')]},{'where':{'id':_0x50ad2e['id']}});})[_0x4f7e('0x3d')](function(){return _0x50ad2e;})[_0x4f7e('0x46')](function(_0x4bb1a1){logger[_0x4f7e('0x47')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x50ad2e['id'],_0x4bb1a1);});}function getOauth2MicrosoftAccessToken(_0x2e2a67,_0x3c35fc){var _0x4cc337={'grant_type':_0x4f7e('0x48'),'code':_0x2e2a67,'scope':getAccessTokenScope(_0x3c35fc),'redirect_uri':_0x3c35fc[_0x4f7e('0x2c')],'client_id':_0x3c35fc[_0x4f7e('0x28')],'client_secret':encryptor[_0x4f7e('0x42')](_0x3c35fc[_0x4f7e('0x3e')])};var _0x15a1d5={'method':_0x4f7e('0x43'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3c35fc[_0x4f7e('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4cc337,'json':!![]};return rp(_0x15a1d5);}function startRefreshInterval(_0x259c51){var _0x3c0047=schedule[_0x4f7e('0x49')];if(_0x3c0047[_0x259c51['id']])clearInterval(_0x3c0047[_0x259c51['id']]);_0x3c0047[_0x259c51['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4f7e('0x4a')](this,{'id':_0x259c51['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4f7e('0x49')]=_0x3c0047;}function startAllRefreshIntervals(){return db[_0x4f7e('0x3f')][_0x4f7e('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4f7e('0x3d')](function(_0x569512){var _0x40126b=_0x569512[_0x4f7e('0x16')](function(_0x5dbfc7){return refreshOauth2MicrosoftAccessToken(_0x5dbfc7)['then'](function(_0xc22e80){startRefreshInterval(_0xc22e80);});});return Promise[_0x4f7e('0x4c')](_0x40126b);})['catch'](function(_0x123e43){var _0x42e2d6=_0x123e43?util[_0x4f7e('0x4d')](_0x123e43,{'showHidden':![],'depth':null}):'';logger[_0x4f7e('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x42e2d6);});}module[_0x4f7e('0x4e')]={'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 69f8f52..731e5d6 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 _0x6faf=['stringify','error','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6faf,0xf9));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xf6fa('0x0'));var moment=require(_0xf6fa('0x1'));var BPromise=require(_0xf6fa('0x2'));var rs=require(_0xf6fa('0x3'));var fs=require('fs');var Redis=require(_0xf6fa('0x4'));var db=require(_0xf6fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6fa('0x6'))('rpc');var config=require(_0xf6fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf6fa('0x8')][_0xf6fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f93f1,_0x1ac55e,_0x2de713){return new BPromise(function(_0x4e1b3c,_0x3f4d3f){return client[_0xf6fa('0xa')](_0x1f93f1,_0x2de713)[_0xf6fa('0xb')](function(_0x585633){logger['info'](_0xf6fa('0xc'),_0x1ac55e,'request\x20sent');logger[_0xf6fa('0xd')](_0xf6fa('0xe'),_0x1ac55e,'request\x20sent',JSON[_0xf6fa('0xf')](_0x585633));if(_0x585633['error']){if(_0x585633[_0xf6fa('0x10')]['code']===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x1ac55e,_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);return _0x3f4d3f(_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);}logger[_0xf6fa('0x10')](_0xf6fa('0xc'),_0x1ac55e,_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);return _0x4e1b3c(_0x585633[_0xf6fa('0x10')][_0xf6fa('0x11')]);}else{logger[_0xf6fa('0x12')]('CloudProvider,\x20%s,\x20%s',_0x1ac55e,_0xf6fa('0x13'));_0x4e1b3c(_0x585633[_0xf6fa('0x14')]['message']);}})[_0xf6fa('0x15')](function(_0x476eeb){logger[_0xf6fa('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1ac55e,_0x476eeb);_0x3f4d3f(_0x476eeb);});});} \ No newline at end of file +var _0x2b47=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5a8aa0,_0x4aca0c){var _0x1c56af=function(_0x56d5dc){while(--_0x56d5dc){_0x5a8aa0['push'](_0x5a8aa0['shift']());}};_0x1c56af(++_0x4aca0c);}(_0x2b47,0x177));var _0x72b4=function(_0x2fcb37,_0x3b8172){_0x2fcb37=_0x2fcb37-0x0;var _0x48adbb=_0x2b47[_0x2fcb37];return _0x48adbb;};'use strict';var _=require(_0x72b4('0x0'));var util=require('util');var moment=require(_0x72b4('0x1'));var BPromise=require(_0x72b4('0x2'));var rs=require(_0x72b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b4('0x4'))['db'];var utils=require(_0x72b4('0x5'));var logger=require(_0x72b4('0x6'))(_0x72b4('0x7'));var config=require(_0x72b4('0x8'));var jayson=require(_0x72b4('0x9'));var client=jayson['client'][_0x72b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x480984,_0x104f08,_0x1c90aa){return new BPromise(function(_0xb1e42f,_0x1bdf7f){return client[_0x72b4('0xb')](_0x480984,_0x1c90aa)[_0x72b4('0xc')](function(_0x114a98){logger[_0x72b4('0xd')](_0x72b4('0xe'),_0x104f08,_0x72b4('0xf'));logger[_0x72b4('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x104f08,_0x72b4('0xf'),JSON[_0x72b4('0x11')](_0x114a98));if(_0x114a98[_0x72b4('0x12')]){if(_0x114a98[_0x72b4('0x12')][_0x72b4('0x13')]===0x1f4){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0x1bdf7f(_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);}logger['error'](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0xb1e42f(_0x114a98[_0x72b4('0x12')]['message']);}else{logger['info'](_0x72b4('0xe'),_0x104f08,'request\x20sent');_0xb1e42f(_0x114a98[_0x72b4('0x15')][_0x72b4('0x14')]);}})['catch'](function(_0x2a9c37){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x2a9c37);_0x1bdf7f(_0x2a9c37);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8ff5284..ed2f836 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x4649ef,_0x17fc1f){var _0x289816=function(_0x17418e){while(--_0x17418e){_0x4649ef['push'](_0x4649ef['shift']());}};_0x289816(++_0x17fc1f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x512cd4,_0x350565){var _0x4fa07d=function(_0xaee46a){while(--_0xaee46a){_0x512cd4['push'](_0x512cd4['shift']());}};_0x4fa07d(++_0x350565);}(_0x2ef3,0xba));var _0x32ef=function(_0x283863,_0x554536){_0x283863=_0x283863-0x0;var _0xa4fb1b=_0x2ef3[_0x283863];return _0xa4fb1b;};'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['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 938a61d..7897971 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 _0xc94a=['name','STRING','sequelize','exports'];(function(_0x55a489,_0x47d06e){var _0x463af6=function(_0x46f502){while(--_0x46f502){_0x55a489['push'](_0x55a489['shift']());}};_0x463af6(++_0x47d06e);}(_0xc94a,0x14a));var _0xac94=function(_0x25145e,_0x3c2c79){_0x25145e=_0x25145e-0x0;var _0x447afe=_0xc94a[_0x25145e];return _0x447afe;};'use strict';var Sequelize=require(_0xac94('0x0'));module[_0xac94('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xac94('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xac94('0x3')]},'companyId':{'type':Sequelize[_0xac94('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xac94('0x3')]},'fax':{'type':Sequelize[_0xac94('0x3')]},'type':{'type':Sequelize[_0xac94('0x3')]},'street':{'type':Sequelize[_0xac94('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xac94('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xac94('0x3')]},'sPostalCode':{'type':Sequelize[_0xac94('0x3')]},'sCity':{'type':Sequelize[_0xac94('0x3')]},'sCountry':{'type':Sequelize[_0xac94('0x3')]},'description':{'type':Sequelize[_0xac94('0x3')]}}; \ No newline at end of file +var _0x836d=['STRING','name','sequelize','exports'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x836d,0x126));var _0xd836=function(_0x49e77d,_0x9a35c){_0x49e77d=_0x49e77d-0x0;var _0x30a66f=_0x836d[_0x49e77d];return _0x30a66f;};'use strict';var Sequelize=require(_0xd836('0x0'));module[_0xd836('0x1')]={'name':{'type':Sequelize[_0xd836('0x2')],'unique':_0xd836('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd836('0x2')]},'companyId':{'type':Sequelize[_0xd836('0x2')]},'website':{'type':Sequelize[_0xd836('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xd836('0x2')]},'type':{'type':Sequelize[_0xd836('0x2')]},'street':{'type':Sequelize[_0xd836('0x2')]},'postalCode':{'type':Sequelize[_0xd836('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd836('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd836('0x2')]},'sStreet':{'type':Sequelize[_0xd836('0x2')]},'sPostalCode':{'type':Sequelize[_0xd836('0x2')]},'sCity':{'type':Sequelize[_0xd836('0x2')]},'sCountry':{'type':Sequelize[_0xd836('0x2')]},'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 a37538a..5fa81e7 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 _0x8968=['rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','addContacts','CmContact','ids','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','options','includeAll'];(function(_0x133804,_0x46eafb){var _0x45b070=function(_0x5512d6){while(--_0x5512d6){_0x133804['push'](_0x133804['shift']());}};_0x45b070(++_0x46eafb);}(_0x8968,0xbb));var _0x8896=function(_0x1d0c7a,_0x39d7a8){_0x1d0c7a=_0x1d0c7a-0x0;var _0x3edec4=_0x8968[_0x1d0c7a];return _0x3edec4;};'use strict';var emlformat=require(_0x8896('0x0'));var rimraf=require(_0x8896('0x1'));var zipdir=require(_0x8896('0x2'));var jsonpatch=require(_0x8896('0x3'));var rp=require('request-promise');var moment=require(_0x8896('0x4'));var BPromise=require(_0x8896('0x5'));var Mustache=require(_0x8896('0x6'));var util=require(_0x8896('0x7'));var path=require(_0x8896('0x8'));var sox=require('sox');var csv=require(_0x8896('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8896('0xa'));var _=require('lodash');var squel=require(_0x8896('0xb'));var crypto=require(_0x8896('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8896('0xd'));var toCsv=require(_0x8896('0x9'));var querystring=require('querystring');var Papa=require(_0x8896('0xe'));var Redis=require(_0x8896('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8896('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8896('0x11'))(_0x8896('0x12'));var utils=require(_0x8896('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8896('0x14'));var db=require(_0x8896('0x15'))['db'];function respondWithStatusCode(_0x488515,_0x73afe7){_0x73afe7=_0x73afe7||0xcc;return function(_0x6cb1dd){if(_0x6cb1dd){return _0x488515['sendStatus'](_0x73afe7);}return _0x488515[_0x8896('0x16')](_0x73afe7)[_0x8896('0x17')]();};}function respondWithResult(_0x35c358,_0x1b19b8){_0x1b19b8=_0x1b19b8||0xc8;return function(_0x5559f4){if(_0x5559f4){return _0x35c358[_0x8896('0x16')](_0x1b19b8)[_0x8896('0x18')](_0x5559f4);}};}function respondWithFilteredResult(_0x508912,_0x48b33b){return function(_0x2e1eb1){if(_0x2e1eb1){var _0x5709c5=typeof _0x48b33b[_0x8896('0x19')]===_0x8896('0x1a')&&typeof _0x48b33b['limit']===_0x8896('0x1a');var _0x5c35f7=_0x2e1eb1[_0x8896('0x1b')];var _0x4266fa=_0x5709c5?0x0:_0x48b33b[_0x8896('0x19')];var _0x2e282d=_0x5709c5?_0x2e1eb1[_0x8896('0x1b')]:_0x48b33b['offset']+_0x48b33b['limit'];var _0x47c28b;if(_0x2e282d>=_0x5c35f7){_0x2e282d=_0x5c35f7;_0x47c28b=0xc8;}else{_0x47c28b=0xce;}_0x508912['status'](_0x47c28b);return _0x508912[_0x8896('0x1c')](_0x8896('0x1d'),_0x4266fa+'-'+_0x2e282d+'/'+_0x5c35f7)['json'](_0x2e1eb1);}return null;};}function patchUpdates(_0xbb9f0f){return function(_0x1c95c5){try{jsonpatch[_0x8896('0x1e')](_0x1c95c5,_0xbb9f0f,!![]);}catch(_0x4a7101){return BPromise[_0x8896('0x1f')](_0x4a7101);}return _0x1c95c5[_0x8896('0x20')]();};}function saveUpdates(_0x3aaf5d,_0x2e0964){return function(_0x264bbb){if(_0x264bbb){return _0x264bbb[_0x8896('0x21')](_0x3aaf5d)[_0x8896('0x22')](function(_0x58a78b){return _0x58a78b;});}return null;};}function removeEntity(_0x4c18e1,_0x362ffd){return function(_0x182dd5){if(_0x182dd5){return _0x182dd5[_0x8896('0x23')]()['then'](function(){var _0xe6dd81=_0x182dd5[_0x8896('0x24')]({'plain':!![]});var _0x2acbd8=_0x8896('0x25');return db[_0x8896('0x26')][_0x8896('0x23')]({'where':{'type':_0x2acbd8,'resourceId':_0xe6dd81['id']}})[_0x8896('0x22')](function(){return _0x182dd5;});})[_0x8896('0x22')](function(){_0x4c18e1[_0x8896('0x16')](0xcc)[_0x8896('0x17')]();});}};}function handleEntityNotFound(_0x4e287e,_0x117742){return function(_0x3be27d){if(!_0x3be27d){_0x4e287e['sendStatus'](0x194);}return _0x3be27d;};}function handleError(_0x4df495,_0x45cf9f){_0x45cf9f=_0x45cf9f||0x1f4;return function(_0x4308c0){logger['error'](_0x4308c0[_0x8896('0x27')]);if(_0x4308c0['name']){delete _0x4308c0[_0x8896('0x28')];}_0x4df495['status'](_0x45cf9f)[_0x8896('0x29')](_0x4308c0);};}exports[_0x8896('0x2a')]=function(_0x51fdb5,_0x145951){var _0x59ba0d={},_0xc2f3c5={},_0x52b54b={'count':0x0,'rows':[]};return db[_0x8896('0x2b')][_0x8896('0x2c')]()[_0x8896('0x22')](function(_0x1131cb){_0xc2f3c5['model']=_[_0x8896('0x2d')](_0x1131cb);_0xc2f3c5[_0x8896('0x2e')]=_['keys'](_0x51fdb5[_0x8896('0x2e')]);_0xc2f3c5[_0x8896('0x2f')]=_[_0x8896('0x30')](_0xc2f3c5[_0x8896('0x31')],_0xc2f3c5['query']);_0x59ba0d[_0x8896('0x32')]=_['intersection'](_0xc2f3c5[_0x8896('0x31')],qs['fields'](_0x51fdb5[_0x8896('0x2e')][_0x8896('0x33')]));_0x59ba0d[_0x8896('0x32')]=_0x59ba0d['attributes'][_0x8896('0x34')]?_0x59ba0d[_0x8896('0x32')]:_0xc2f3c5[_0x8896('0x31')];if(!_0x51fdb5[_0x8896('0x2e')][_0x8896('0x35')](_0x8896('0x36'))){_0x59ba0d['limit']=qs['limit'](_0x51fdb5['query'][_0x8896('0x37')]);_0x59ba0d['offset']=qs[_0x8896('0x19')](_0x51fdb5[_0x8896('0x2e')]['offset']);}_0x59ba0d[_0x8896('0x38')]=qs['sort'](_0x51fdb5[_0x8896('0x2e')][_0x8896('0x39')]);_0x59ba0d[_0x8896('0x3a')]=qs['filters'](_[_0x8896('0x3b')](_0x51fdb5[_0x8896('0x2e')],_0xc2f3c5['filters']),_0x1131cb);if(_0x51fdb5['query'][_0x8896('0x3c')]){_0x59ba0d[_0x8896('0x3a')]=_[_0x8896('0x3d')](_0x59ba0d[_0x8896('0x3a')],{'$or':_[_0x8896('0x3e')](_0x59ba0d[_0x8896('0x32')],function(_0x1d0c55){var _0x369bb7={};_0x369bb7[_0x1d0c55]={'$like':'%'+_0x51fdb5[_0x8896('0x2e')][_0x8896('0x3c')]+'%'};return _0x369bb7;})});}_0x59ba0d=_[_0x8896('0x3d')]({},_0x59ba0d,_0x51fdb5[_0x8896('0x3f')]);var _0x4ca9c6={'where':_0x59ba0d[_0x8896('0x3a')]};return db['CmCompany']['count'](_0x4ca9c6)[_0x8896('0x22')](function(_0xc9f67b){_0x52b54b[_0x8896('0x1b')]=_0xc9f67b;if(_0x51fdb5[_0x8896('0x2e')][_0x8896('0x40')]){_0x59ba0d['include']=[{'all':!![]}];}return db[_0x8896('0x2b')]['findAll'](_0x59ba0d);})[_0x8896('0x22')](function(_0x9053e){_0x52b54b[_0x8896('0x41')]=_0x9053e;return _0x52b54b;})[_0x8896('0x22')](respondWithFilteredResult(_0x145951,_0x59ba0d))[_0x8896('0x42')](handleError(_0x145951,null));})['catch'](handleError(_0x145951,null));};exports[_0x8896('0x43')]=function(_0x119e0f,_0x592ca4){var _0x25ef38={'raw':![],'where':{'id':_0x119e0f[_0x8896('0x44')]['id']}},_0xcae855={};_0xcae855[_0x8896('0x31')]=_[_0x8896('0x2d')](db['CmCompany'][_0x8896('0x45')]);_0xcae855[_0x8896('0x2e')]=_[_0x8896('0x2d')](_0x119e0f[_0x8896('0x2e')]);_0xcae855[_0x8896('0x2f')]=_[_0x8896('0x30')](_0xcae855[_0x8896('0x31')],_0xcae855['query']);_0x25ef38[_0x8896('0x32')]=_['intersection'](_0xcae855[_0x8896('0x31')],qs[_0x8896('0x33')](_0x119e0f[_0x8896('0x2e')]['fields']));_0x25ef38[_0x8896('0x32')]=_0x25ef38[_0x8896('0x32')][_0x8896('0x34')]?_0x25ef38[_0x8896('0x32')]:_0xcae855[_0x8896('0x31')];if(_0x119e0f[_0x8896('0x2e')][_0x8896('0x40')]){_0x25ef38[_0x8896('0x46')]=[{'all':!![]}];}_0x25ef38=_['merge']({},_0x25ef38,_0x119e0f[_0x8896('0x3f')]);return db['CmCompany'][_0x8896('0x47')](_0x25ef38)[_0x8896('0x22')](handleEntityNotFound(_0x592ca4,null))[_0x8896('0x22')](respondWithResult(_0x592ca4,null))[_0x8896('0x42')](handleError(_0x592ca4,null));};exports[_0x8896('0x48')]=function(_0x4b75d8,_0x48878f){return db[_0x8896('0x2b')][_0x8896('0x48')](_0x4b75d8[_0x8896('0x49')],{})[_0x8896('0x22')](function(_0x5e0506){var _0x226028=_0x4b75d8[_0x8896('0x4a')][_0x8896('0x24')]({'plain':!![]});if(!_0x226028)throw new Error(_0x8896('0x4b'));if(_0x226028[_0x8896('0x4c')]===_0x8896('0x4a')){var _0x954cc3=_0x5e0506[_0x8896('0x24')]({'plain':!![]});var _0x516fb1='Companies';return db['UserProfileSection'][_0x8896('0x47')]({'where':{'name':_0x516fb1,'userProfileId':_0x226028[_0x8896('0x4d')]},'raw':!![]})['then'](function(_0x26efd1){if(_0x26efd1&&_0x26efd1[_0x8896('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x954cc3['name'],'resourceId':_0x954cc3['id'],'type':_0x26efd1[_0x8896('0x28')],'sectionId':_0x26efd1['id']},{})[_0x8896('0x22')](function(){return _0x5e0506;});}else{return _0x5e0506;}})[_0x8896('0x42')](function(_0x7b5a6a){logger[_0x8896('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7b5a6a);throw _0x7b5a6a;});}return _0x5e0506;})[_0x8896('0x22')](respondWithResult(_0x48878f,0xc9))[_0x8896('0x42')](handleError(_0x48878f,null));};exports[_0x8896('0x21')]=function(_0x2c76e7,_0xc6d108){if(_0x2c76e7['body']['id']){delete _0x2c76e7[_0x8896('0x49')]['id'];}return db[_0x8896('0x2b')][_0x8896('0x47')]({'where':{'id':_0x2c76e7[_0x8896('0x44')]['id']}})[_0x8896('0x22')](handleEntityNotFound(_0xc6d108,null))[_0x8896('0x22')](saveUpdates(_0x2c76e7['body'],null))[_0x8896('0x22')](respondWithResult(_0xc6d108,null))[_0x8896('0x42')](handleError(_0xc6d108,null));};exports[_0x8896('0x23')]=function(_0x34e304,_0x5a931a){return db[_0x8896('0x2b')][_0x8896('0x47')]({'where':{'id':_0x34e304[_0x8896('0x44')]['id']}})[_0x8896('0x22')](handleEntityNotFound(_0x5a931a,null))['then'](removeEntity(_0x5a931a,null))[_0x8896('0x42')](handleError(_0x5a931a,null));};exports[_0x8896('0x2c')]=function(_0x5c995b,_0x4710cf){return db['CmCompany'][_0x8896('0x2c')]()['then'](respondWithResult(_0x4710cf,null))['catch'](handleError(_0x4710cf,null));};exports[_0x8896('0x50')]=function(_0xd7fa8a,_0x15dc94,_0x39f478){return db[_0x8896('0x51')]['find']({'where':{'id':_0xd7fa8a[_0x8896('0x44')]['id']}})[_0x8896('0x22')](handleEntityNotFound(_0x15dc94,null))['then'](function(_0x38eb84){if(_0x38eb84){return _0x38eb84[_0x8896('0x50')](_0xd7fa8a[_0x8896('0x49')][_0x8896('0x52')],_['omit'](_0xd7fa8a['body'],[_0x8896('0x52'),'id'])||{});}})[_0x8896('0x22')](respondWithResult(_0x15dc94,null))[_0x8896('0x42')](handleError(_0x15dc94,null));};exports[_0x8896('0x53')]=function(_0xb994bb,_0x2e8eb7,_0x4d0f39){var _0xf2c911={};var _0x5002ee={};var _0x230900;var _0x2f1e8b;return db['CmCompany']['findOne']({'where':{'id':_0xb994bb['params']['id']}})[_0x8896('0x22')](handleEntityNotFound(_0x2e8eb7,null))[_0x8896('0x22')](function(_0x298f6b){if(_0x298f6b){_0x230900=_0x298f6b;_0x5002ee['model']=_['keys'](db[_0x8896('0x51')][_0x8896('0x45')]);_0x5002ee[_0x8896('0x2e')]=_[_0x8896('0x2d')](_0xb994bb[_0x8896('0x2e')]);_0x5002ee['filters']=_[_0x8896('0x30')](_0x5002ee[_0x8896('0x31')],_0x5002ee[_0x8896('0x2e')]);_0xf2c911[_0x8896('0x32')]=_[_0x8896('0x30')](_0x5002ee[_0x8896('0x31')],qs[_0x8896('0x33')](_0xb994bb[_0x8896('0x2e')][_0x8896('0x33')]));_0xf2c911['attributes']=_0xf2c911[_0x8896('0x32')][_0x8896('0x34')]?_0xf2c911[_0x8896('0x32')]:_0x5002ee[_0x8896('0x31')];_0xf2c911[_0x8896('0x38')]=qs['sort'](_0xb994bb[_0x8896('0x2e')]['sort']);_0xf2c911['where']=qs[_0x8896('0x2f')](_[_0x8896('0x3b')](_0xb994bb[_0x8896('0x2e')],_0x5002ee[_0x8896('0x2f')]));if(_0xb994bb['query']['filter']){_0xf2c911[_0x8896('0x3a')]=_[_0x8896('0x3d')](_0xf2c911[_0x8896('0x3a')],{'$or':_[_0x8896('0x3e')](_0xf2c911[_0x8896('0x32')],function(_0x3da312){var _0x2fc82a={};_0x2fc82a[_0x3da312]={'$like':'%'+_0xb994bb['query'][_0x8896('0x3c')]+'%'};return _0x2fc82a;})});}_0xf2c911=_['merge']({},_0xf2c911,_0xb994bb['options']);return _0x230900[_0x8896('0x53')](_0xf2c911);}})[_0x8896('0x22')](function(_0x1a1050){if(_0x1a1050){_0x2f1e8b=_0x1a1050[_0x8896('0x34')];if(!_0xb994bb[_0x8896('0x2e')]['hasOwnProperty'](_0x8896('0x36'))){_0xf2c911[_0x8896('0x37')]=qs['limit'](_0xb994bb['query'][_0x8896('0x37')]);_0xf2c911['offset']=qs['offset'](_0xb994bb[_0x8896('0x2e')][_0x8896('0x19')]);}return _0x230900[_0x8896('0x53')](_0xf2c911);}})[_0x8896('0x22')](function(_0x5abb64){if(_0x5abb64){return _0x5abb64?{'count':_0x2f1e8b,'rows':_0x5abb64}:null;}})[_0x8896('0x22')](respondWithResult(_0x2e8eb7,null))[_0x8896('0x42')](handleError(_0x2e8eb7,null));}; \ No newline at end of file +var _0xa490=['sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','CmContact','addContacts','ids','findOne','rawAttributes','order','getContacts','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','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','count','limit','set','Content-Range','save','update','then','get','Companies','UserProfileResource','destroy','stack','name','CmCompany','describe','model','keys','query','filters','attributes','fields','hasOwnProperty'];(function(_0x3a3eac,_0x250f74){var _0x4585e3=function(_0x1aef41){while(--_0x1aef41){_0x3a3eac['push'](_0x3a3eac['shift']());}};_0x4585e3(++_0x250f74);}(_0xa490,0x174));var _0x0a49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa490[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a49('0x0'));var zipdir=require(_0x0a49('0x1'));var jsonpatch=require(_0x0a49('0x2'));var rp=require(_0x0a49('0x3'));var moment=require(_0x0a49('0x4'));var BPromise=require(_0x0a49('0x5'));var Mustache=require('mustache');var util=require(_0x0a49('0x6'));var path=require('path');var sox=require(_0x0a49('0x7'));var csv=require('to-csv');var ejs=require(_0x0a49('0x8'));var fs=require('fs');var fs_extra=require(_0x0a49('0x9'));var _=require(_0x0a49('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a49('0xb'));var deskjs=require(_0x0a49('0xc'));var toCsv=require(_0x0a49('0xd'));var querystring=require(_0x0a49('0xe'));var Papa=require(_0x0a49('0xf'));var Redis=require(_0x0a49('0x10'));var authService=require(_0x0a49('0x11'));var qs=require(_0x0a49('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a49('0x13'));var logger=require(_0x0a49('0x14'))(_0x0a49('0x15'));var utils=require(_0x0a49('0x16'));var config=require(_0x0a49('0x17'));var licenseUtil=require(_0x0a49('0x18'));var db=require(_0x0a49('0x19'))['db'];function respondWithStatusCode(_0x205e3c,_0x2808dc){_0x2808dc=_0x2808dc||0xcc;return function(_0x45ded5){if(_0x45ded5){return _0x205e3c[_0x0a49('0x1a')](_0x2808dc);}return _0x205e3c[_0x0a49('0x1b')](_0x2808dc)[_0x0a49('0x1c')]();};}function respondWithResult(_0x380e04,_0x259eb3){_0x259eb3=_0x259eb3||0xc8;return function(_0x5ef1b8){if(_0x5ef1b8){return _0x380e04[_0x0a49('0x1b')](_0x259eb3)[_0x0a49('0x1d')](_0x5ef1b8);}};}function respondWithFilteredResult(_0x41d588,_0x8dfe5a){return function(_0x4266c1){if(_0x4266c1){var _0x1d16d7=typeof _0x8dfe5a['offset']==='undefined'&&typeof _0x8dfe5a['limit']==='undefined';var _0x549adc=_0x4266c1['count'];var _0x420be2=_0x1d16d7?0x0:_0x8dfe5a[_0x0a49('0x1e')];var _0x44c22f=_0x1d16d7?_0x4266c1[_0x0a49('0x1f')]:_0x8dfe5a[_0x0a49('0x1e')]+_0x8dfe5a[_0x0a49('0x20')];var _0x132147;if(_0x44c22f>=_0x549adc){_0x44c22f=_0x549adc;_0x132147=0xc8;}else{_0x132147=0xce;}_0x41d588[_0x0a49('0x1b')](_0x132147);return _0x41d588[_0x0a49('0x21')](_0x0a49('0x22'),_0x420be2+'-'+_0x44c22f+'/'+_0x549adc)[_0x0a49('0x1d')](_0x4266c1);}return null;};}function patchUpdates(_0x31546a){return function(_0x573cfa){try{jsonpatch['apply'](_0x573cfa,_0x31546a,!![]);}catch(_0x28c50e){return BPromise['reject'](_0x28c50e);}return _0x573cfa[_0x0a49('0x23')]();};}function saveUpdates(_0x35bd7f,_0x51ac7e){return function(_0x54ad5f){if(_0x54ad5f){return _0x54ad5f[_0x0a49('0x24')](_0x35bd7f)[_0x0a49('0x25')](function(_0x11dc94){return _0x11dc94;});}return null;};}function removeEntity(_0x1f3e12,_0xa29077){return function(_0x299a84){if(_0x299a84){return _0x299a84['destroy']()['then'](function(){var _0x2e1b95=_0x299a84[_0x0a49('0x26')]({'plain':!![]});var _0xbdbbd5=_0x0a49('0x27');return db[_0x0a49('0x28')][_0x0a49('0x29')]({'where':{'type':_0xbdbbd5,'resourceId':_0x2e1b95['id']}})[_0x0a49('0x25')](function(){return _0x299a84;});})[_0x0a49('0x25')](function(){_0x1f3e12['status'](0xcc)[_0x0a49('0x1c')]();});}};}function handleEntityNotFound(_0x232fdc,_0x5e9661){return function(_0x109c97){if(!_0x109c97){_0x232fdc[_0x0a49('0x1a')](0x194);}return _0x109c97;};}function handleError(_0x1c5975,_0x41c130){_0x41c130=_0x41c130||0x1f4;return function(_0x4fc184){logger['error'](_0x4fc184[_0x0a49('0x2a')]);if(_0x4fc184[_0x0a49('0x2b')]){delete _0x4fc184['name'];}_0x1c5975[_0x0a49('0x1b')](_0x41c130)['send'](_0x4fc184);};}exports['index']=function(_0x354523,_0x572197){var _0x203234={},_0x4e8f3e={},_0x593ff4={'count':0x0,'rows':[]};return db[_0x0a49('0x2c')][_0x0a49('0x2d')]()[_0x0a49('0x25')](function(_0x43b943){_0x4e8f3e[_0x0a49('0x2e')]=_[_0x0a49('0x2f')](_0x43b943);_0x4e8f3e[_0x0a49('0x30')]=_[_0x0a49('0x2f')](_0x354523[_0x0a49('0x30')]);_0x4e8f3e[_0x0a49('0x31')]=_['intersection'](_0x4e8f3e[_0x0a49('0x2e')],_0x4e8f3e[_0x0a49('0x30')]);_0x203234[_0x0a49('0x32')]=_['intersection'](_0x4e8f3e[_0x0a49('0x2e')],qs[_0x0a49('0x33')](_0x354523[_0x0a49('0x30')][_0x0a49('0x33')]));_0x203234['attributes']=_0x203234[_0x0a49('0x32')]['length']?_0x203234['attributes']:_0x4e8f3e['model'];if(!_0x354523[_0x0a49('0x30')][_0x0a49('0x34')]('nolimit')){_0x203234[_0x0a49('0x20')]=qs[_0x0a49('0x20')](_0x354523['query'][_0x0a49('0x20')]);_0x203234[_0x0a49('0x1e')]=qs[_0x0a49('0x1e')](_0x354523[_0x0a49('0x30')][_0x0a49('0x1e')]);}_0x203234['order']=qs[_0x0a49('0x35')](_0x354523[_0x0a49('0x30')][_0x0a49('0x35')]);_0x203234[_0x0a49('0x36')]=qs[_0x0a49('0x31')](_[_0x0a49('0x37')](_0x354523['query'],_0x4e8f3e['filters']),_0x43b943);if(_0x354523[_0x0a49('0x30')][_0x0a49('0x38')]){_0x203234[_0x0a49('0x36')]=_[_0x0a49('0x39')](_0x203234[_0x0a49('0x36')],{'$or':_[_0x0a49('0x3a')](_0x203234[_0x0a49('0x32')],function(_0x488573){var _0x1ebbae={};_0x1ebbae[_0x488573]={'$like':'%'+_0x354523[_0x0a49('0x30')][_0x0a49('0x38')]+'%'};return _0x1ebbae;})});}_0x203234=_[_0x0a49('0x39')]({},_0x203234,_0x354523[_0x0a49('0x3b')]);var _0x3b5dd4={'where':_0x203234['where']};return db['CmCompany']['count'](_0x3b5dd4)[_0x0a49('0x25')](function(_0x2d7d7c){_0x593ff4[_0x0a49('0x1f')]=_0x2d7d7c;if(_0x354523[_0x0a49('0x30')][_0x0a49('0x3c')]){_0x203234[_0x0a49('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0x0a49('0x3e')](_0x203234);})[_0x0a49('0x25')](function(_0x238f10){_0x593ff4['rows']=_0x238f10;return _0x593ff4;})['then'](respondWithFilteredResult(_0x572197,_0x203234))[_0x0a49('0x3f')](handleError(_0x572197,null));})[_0x0a49('0x3f')](handleError(_0x572197,null));};exports[_0x0a49('0x40')]=function(_0x4464f6,_0x1107ed){var _0x1b96ab={'raw':![],'where':{'id':_0x4464f6[_0x0a49('0x41')]['id']}},_0x1dd442={};_0x1dd442[_0x0a49('0x2e')]=_[_0x0a49('0x2f')](db['CmCompany']['rawAttributes']);_0x1dd442[_0x0a49('0x30')]=_[_0x0a49('0x2f')](_0x4464f6[_0x0a49('0x30')]);_0x1dd442[_0x0a49('0x31')]=_[_0x0a49('0x42')](_0x1dd442['model'],_0x1dd442[_0x0a49('0x30')]);_0x1b96ab[_0x0a49('0x32')]=_[_0x0a49('0x42')](_0x1dd442['model'],qs[_0x0a49('0x33')](_0x4464f6[_0x0a49('0x30')][_0x0a49('0x33')]));_0x1b96ab['attributes']=_0x1b96ab[_0x0a49('0x32')][_0x0a49('0x43')]?_0x1b96ab[_0x0a49('0x32')]:_0x1dd442[_0x0a49('0x2e')];if(_0x4464f6[_0x0a49('0x30')][_0x0a49('0x3c')]){_0x1b96ab[_0x0a49('0x3d')]=[{'all':!![]}];}_0x1b96ab=_['merge']({},_0x1b96ab,_0x4464f6[_0x0a49('0x3b')]);return db[_0x0a49('0x2c')]['find'](_0x1b96ab)['then'](handleEntityNotFound(_0x1107ed,null))['then'](respondWithResult(_0x1107ed,null))[_0x0a49('0x3f')](handleError(_0x1107ed,null));};exports['create']=function(_0x1aa89f,_0x29f44a){return db[_0x0a49('0x2c')][_0x0a49('0x44')](_0x1aa89f[_0x0a49('0x45')],{})[_0x0a49('0x25')](function(_0x2dd8a6){var _0x1b109f=_0x1aa89f[_0x0a49('0x46')][_0x0a49('0x26')]({'plain':!![]});if(!_0x1b109f)throw new Error(_0x0a49('0x47'));if(_0x1b109f[_0x0a49('0x48')]===_0x0a49('0x46')){var _0x55c582=_0x2dd8a6[_0x0a49('0x26')]({'plain':!![]});var _0x3cbe9c='Companies';return db[_0x0a49('0x49')]['find']({'where':{'name':_0x3cbe9c,'userProfileId':_0x1b109f[_0x0a49('0x4a')]},'raw':!![]})[_0x0a49('0x25')](function(_0x3353cc){if(_0x3353cc&&_0x3353cc[_0x0a49('0x4b')]===0x0){return db['UserProfileResource'][_0x0a49('0x44')]({'name':_0x55c582['name'],'resourceId':_0x55c582['id'],'type':_0x3353cc[_0x0a49('0x2b')],'sectionId':_0x3353cc['id']},{})[_0x0a49('0x25')](function(){return _0x2dd8a6;});}else{return _0x2dd8a6;}})['catch'](function(_0xcaa7b0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcaa7b0);throw _0xcaa7b0;});}return _0x2dd8a6;})[_0x0a49('0x25')](respondWithResult(_0x29f44a,0xc9))[_0x0a49('0x3f')](handleError(_0x29f44a,null));};exports[_0x0a49('0x24')]=function(_0x57156c,_0xc9ca71){if(_0x57156c['body']['id']){delete _0x57156c[_0x0a49('0x45')]['id'];}return db['CmCompany'][_0x0a49('0x4c')]({'where':{'id':_0x57156c[_0x0a49('0x41')]['id']}})[_0x0a49('0x25')](handleEntityNotFound(_0xc9ca71,null))['then'](saveUpdates(_0x57156c[_0x0a49('0x45')],null))['then'](respondWithResult(_0xc9ca71,null))[_0x0a49('0x3f')](handleError(_0xc9ca71,null));};exports[_0x0a49('0x29')]=function(_0x42742f,_0x10cec2){return db[_0x0a49('0x2c')][_0x0a49('0x4c')]({'where':{'id':_0x42742f[_0x0a49('0x41')]['id']}})[_0x0a49('0x25')](handleEntityNotFound(_0x10cec2,null))[_0x0a49('0x25')](removeEntity(_0x10cec2,null))[_0x0a49('0x3f')](handleError(_0x10cec2,null));};exports[_0x0a49('0x2d')]=function(_0xd2af80,_0xdd4069){return db['CmCompany']['describe']()[_0x0a49('0x25')](respondWithResult(_0xdd4069,null))[_0x0a49('0x3f')](handleError(_0xdd4069,null));};exports['addContacts']=function(_0x2d121f,_0x53a38b,_0x8991f8){return db[_0x0a49('0x4d')][_0x0a49('0x4c')]({'where':{'id':_0x2d121f[_0x0a49('0x41')]['id']}})[_0x0a49('0x25')](handleEntityNotFound(_0x53a38b,null))['then'](function(_0x2a889d){if(_0x2a889d){return _0x2a889d[_0x0a49('0x4e')](_0x2d121f[_0x0a49('0x45')][_0x0a49('0x4f')],_['omit'](_0x2d121f['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x53a38b,null))[_0x0a49('0x3f')](handleError(_0x53a38b,null));};exports['getContacts']=function(_0x3ac40e,_0x17674f,_0xfd3987){var _0x3e04ea={};var _0x3bf67b={};var _0x2ab008;var _0x510764;return db[_0x0a49('0x2c')][_0x0a49('0x50')]({'where':{'id':_0x3ac40e[_0x0a49('0x41')]['id']}})['then'](handleEntityNotFound(_0x17674f,null))[_0x0a49('0x25')](function(_0x4cd2ea){if(_0x4cd2ea){_0x2ab008=_0x4cd2ea;_0x3bf67b[_0x0a49('0x2e')]=_[_0x0a49('0x2f')](db[_0x0a49('0x4d')][_0x0a49('0x51')]);_0x3bf67b[_0x0a49('0x30')]=_[_0x0a49('0x2f')](_0x3ac40e['query']);_0x3bf67b[_0x0a49('0x31')]=_[_0x0a49('0x42')](_0x3bf67b[_0x0a49('0x2e')],_0x3bf67b['query']);_0x3e04ea[_0x0a49('0x32')]=_[_0x0a49('0x42')](_0x3bf67b['model'],qs['fields'](_0x3ac40e['query'][_0x0a49('0x33')]));_0x3e04ea[_0x0a49('0x32')]=_0x3e04ea[_0x0a49('0x32')][_0x0a49('0x43')]?_0x3e04ea['attributes']:_0x3bf67b[_0x0a49('0x2e')];_0x3e04ea[_0x0a49('0x52')]=qs[_0x0a49('0x35')](_0x3ac40e[_0x0a49('0x30')][_0x0a49('0x35')]);_0x3e04ea['where']=qs[_0x0a49('0x31')](_[_0x0a49('0x37')](_0x3ac40e[_0x0a49('0x30')],_0x3bf67b[_0x0a49('0x31')]));if(_0x3ac40e['query']['filter']){_0x3e04ea[_0x0a49('0x36')]=_[_0x0a49('0x39')](_0x3e04ea[_0x0a49('0x36')],{'$or':_[_0x0a49('0x3a')](_0x3e04ea['attributes'],function(_0x1c096b){var _0x20f390={};_0x20f390[_0x1c096b]={'$like':'%'+_0x3ac40e[_0x0a49('0x30')][_0x0a49('0x38')]+'%'};return _0x20f390;})});}_0x3e04ea=_[_0x0a49('0x39')]({},_0x3e04ea,_0x3ac40e[_0x0a49('0x3b')]);return _0x2ab008[_0x0a49('0x53')](_0x3e04ea);}})['then'](function(_0x58f55b){if(_0x58f55b){_0x510764=_0x58f55b['length'];if(!_0x3ac40e[_0x0a49('0x30')][_0x0a49('0x34')](_0x0a49('0x54'))){_0x3e04ea[_0x0a49('0x20')]=qs[_0x0a49('0x20')](_0x3ac40e[_0x0a49('0x30')][_0x0a49('0x20')]);_0x3e04ea[_0x0a49('0x1e')]=qs[_0x0a49('0x1e')](_0x3ac40e[_0x0a49('0x30')]['offset']);}return _0x2ab008[_0x0a49('0x53')](_0x3e04ea);}})[_0x0a49('0x25')](function(_0x43d401){if(_0x43d401){return _0x43d401?{'count':_0x510764,'rows':_0x43d401}:null;}})['then'](respondWithResult(_0x17674f,null))[_0x0a49('0x3f')](handleError(_0x17674f,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index a584482..8f085ae 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 _0x851c=['moment','request-promise','rimraf','../../config/environment','exports','CmCompany','cm_companies','util','../../config/logger','api'];(function(_0x3882d1,_0x5b469a){var _0x52cd7b=function(_0xc09b9){while(--_0xc09b9){_0x3882d1['push'](_0x3882d1['shift']());}};_0x52cd7b(++_0x5b469a);}(_0x851c,0x165));var _0xc851=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x851c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xc851('0x0'));var logger=require(_0xc851('0x1'))(_0xc851('0x2'));var moment=require(_0xc851('0x3'));var BPromise=require('bluebird');var rp=require(_0xc851('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc851('0x5'));var config=require(_0xc851('0x6'));var attributes=require('./cmCompany.attributes');module[_0xc851('0x7')]=function(_0x13d483,_0x3cdc0a){return _0x13d483['define'](_0xc851('0x8'),attributes,{'tableName':_0xc851('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81f6=['exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes'];(function(_0x6b155b,_0x2588dc){var _0x34b96b=function(_0x5aac5f){while(--_0x5aac5f){_0x6b155b['push'](_0x6b155b['shift']());}};_0x34b96b(++_0x2588dc);}(_0x81f6,0x10e));var _0x681f=function(_0x5d790e,_0x33f8ce){_0x5d790e=_0x5d790e-0x0;var _0x16871c=_0x81f6[_0x5d790e];return _0x16871c;};'use strict';var _=require(_0x681f('0x0'));var util=require(_0x681f('0x1'));var logger=require(_0x681f('0x2'))(_0x681f('0x3'));var moment=require(_0x681f('0x4'));var BPromise=require(_0x681f('0x5'));var rp=require(_0x681f('0x6'));var fs=require('fs');var path=require(_0x681f('0x7'));var rimraf=require('rimraf');var config=require(_0x681f('0x8'));var attributes=require(_0x681f('0x9'));module[_0x681f('0xa')]=function(_0x48571f,_0xb0ecc1){return _0x48571f[_0x681f('0xb')](_0x681f('0xc'),attributes,{'tableName':_0x681f('0xd'),'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 e32d7c8..8016445 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 _0xcaa7=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','bluebird'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0xcaa7,0xe2));var _0x7caa=function(_0x1b7571,_0x1ef958){_0x1b7571=_0x1b7571-0x0;var _0x276621=_0xcaa7[_0x1b7571];return _0x276621;};'use strict';var _=require(_0x7caa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7caa('0x1'));var rs=require(_0x7caa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7caa('0x3'));var logger=require(_0x7caa('0x4'))(_0x7caa('0x5'));var config=require(_0x7caa('0x6'));var jayson=require(_0x7caa('0x7'));var client=jayson[_0x7caa('0x8')][_0x7caa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x113c2d,_0x476e8a,_0x9c15d3){return new BPromise(function(_0x164843,_0xfc3f0d){return client['request'](_0x113c2d,_0x9c15d3)[_0x7caa('0xa')](function(_0x52fe25){logger['info']('CmCompany,\x20%s,\x20%s',_0x476e8a,'request\x20sent');logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x476e8a,_0x7caa('0xb'),JSON[_0x7caa('0xc')](_0x52fe25));if(_0x52fe25[_0x7caa('0xd')]){if(_0x52fe25[_0x7caa('0xd')][_0x7caa('0xe')]===0x1f4){logger[_0x7caa('0xd')](_0x7caa('0xf'),_0x476e8a,_0x52fe25[_0x7caa('0xd')][_0x7caa('0x10')]);return _0xfc3f0d(_0x52fe25[_0x7caa('0xd')][_0x7caa('0x10')]);}logger['error'](_0x7caa('0xf'),_0x476e8a,_0x52fe25['error'][_0x7caa('0x10')]);return _0x164843(_0x52fe25[_0x7caa('0xd')]['message']);}else{logger['info'](_0x7caa('0xf'),_0x476e8a,_0x7caa('0xb'));_0x164843(_0x52fe25[_0x7caa('0x11')]['message']);}})[_0x7caa('0x12')](function(_0x496218){logger[_0x7caa('0xd')](_0x7caa('0xf'),_0x476e8a,_0x496218);_0xfc3f0d(_0x496218);});});} \ No newline at end of file +var _0x7371=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch'];(function(_0x422a18,_0x30f992){var _0x2bad13=function(_0x467d89){while(--_0x467d89){_0x422a18['push'](_0x422a18['shift']());}};_0x2bad13(++_0x30f992);}(_0x7371,0x114));var _0x1737=function(_0x4882ad,_0xa54b65){_0x4882ad=_0x4882ad-0x0;var _0x2b0c57=_0x7371[_0x4882ad];return _0x2b0c57;};'use strict';var _=require(_0x1737('0x0'));var util=require(_0x1737('0x1'));var moment=require('moment');var BPromise=require(_0x1737('0x2'));var rs=require(_0x1737('0x3'));var fs=require('fs');var Redis=require(_0x1737('0x4'));var db=require(_0x1737('0x5'))['db'];var utils=require(_0x1737('0x6'));var logger=require(_0x1737('0x7'))('rpc');var config=require(_0x1737('0x8'));var jayson=require(_0x1737('0x9'));var client=jayson[_0x1737('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33c893,_0x4f3904,_0xf0125d){return new BPromise(function(_0x10cbeb,_0x2c57ea){return client[_0x1737('0xb')](_0x33c893,_0xf0125d)['then'](function(_0x29d3d4){logger[_0x1737('0xc')]('CmCompany,\x20%s,\x20%s',_0x4f3904,_0x1737('0xd'));logger[_0x1737('0xe')](_0x1737('0xf'),_0x4f3904,_0x1737('0xd'),JSON[_0x1737('0x10')](_0x29d3d4));if(_0x29d3d4[_0x1737('0x11')]){if(_0x29d3d4[_0x1737('0x11')][_0x1737('0x12')]===0x1f4){logger['error'](_0x1737('0x13'),_0x4f3904,_0x29d3d4[_0x1737('0x11')][_0x1737('0x14')]);return _0x2c57ea(_0x29d3d4['error'][_0x1737('0x14')]);}logger[_0x1737('0x11')](_0x1737('0x13'),_0x4f3904,_0x29d3d4[_0x1737('0x11')][_0x1737('0x14')]);return _0x10cbeb(_0x29d3d4[_0x1737('0x11')]['message']);}else{logger[_0x1737('0xc')](_0x1737('0x13'),_0x4f3904,'request\x20sent');_0x10cbeb(_0x29d3d4[_0x1737('0x15')][_0x1737('0x14')]);}})[_0x1737('0x16')](function(_0x249911){logger[_0x1737('0x11')]('CmCompany,\x20%s,\x20%s',_0x4f3904,_0x249911);_0x2c57ea(_0x249911);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index e3c5a26..bd2398d 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 _0x73e0=['../../components/interaction/service','isAuthenticated','index','get','show','/:id/contacts','getContacts','post','addContacts','put','/:id','delete','destroy','exports','util','express','Router','../../components/auth/service'];(function(_0x4c3ee2,_0x2221fa){var _0x5a5184=function(_0x17c594){while(--_0x17c594){_0x4c3ee2['push'](_0x4c3ee2['shift']());}};_0x5a5184(++_0x2221fa);}(_0x73e0,0x1ac));var _0x073e=function(_0x1c3e19,_0x195d5d){_0x1c3e19=_0x1c3e19-0x0;var _0x47de50=_0x73e0[_0x1c3e19];return _0x47de50;};'use strict';var multer=require('multer');var util=require(_0x073e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x073e('0x1'));var router=express[_0x073e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x073e('0x3'));var interaction=require(_0x073e('0x4'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0x073e('0x5')](),controller[_0x073e('0x6')]);router[_0x073e('0x7')]('/describe',auth[_0x073e('0x5')](),controller['describe']);router[_0x073e('0x7')]('/:id',auth[_0x073e('0x5')](),controller[_0x073e('0x8')]);router['get'](_0x073e('0x9'),auth[_0x073e('0x5')](),controller[_0x073e('0xa')]);router['post']('/',auth[_0x073e('0x5')](),controller['create']);router[_0x073e('0xb')]('/:id/contacts',auth[_0x073e('0x5')](),controller[_0x073e('0xc')]);router[_0x073e('0xd')](_0x073e('0xe'),auth[_0x073e('0x5')](),controller['update']);router[_0x073e('0xf')](_0x073e('0xe'),auth[_0x073e('0x5')](),controller[_0x073e('0x10')]);module[_0x073e('0x11')]=router; \ No newline at end of file +var _0xc47f=['exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','create','post','addContacts','put','update','delete'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc47f,0x169));var _0xfc47=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc47f[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xfc47('0x0'));var util=require('util');var path=require(_0xfc47('0x1'));var timeout=require(_0xfc47('0x2'));var express=require(_0xfc47('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc47('0x4'));var config=require(_0xfc47('0x5'));var controller=require(_0xfc47('0x6'));router[_0xfc47('0x7')]('/',auth[_0xfc47('0x8')](),controller[_0xfc47('0x9')]);router[_0xfc47('0x7')]('/describe',auth[_0xfc47('0x8')](),controller[_0xfc47('0xa')]);router[_0xfc47('0x7')](_0xfc47('0xb'),auth[_0xfc47('0x8')](),controller[_0xfc47('0xc')]);router[_0xfc47('0x7')]('/:id/contacts',auth[_0xfc47('0x8')](),controller['getContacts']);router['post']('/',auth['isAuthenticated'](),controller[_0xfc47('0xd')]);router[_0xfc47('0xe')]('/:id/contacts',auth[_0xfc47('0x8')](),controller[_0xfc47('0xf')]);router[_0xfc47('0x10')](_0xfc47('0xb'),auth[_0xfc47('0x8')](),controller[_0xfc47('0x11')]);router[_0xfc47('0x12')](_0xfc47('0xb'),auth[_0xfc47('0x8')](),controller['destroy']);module[_0xfc47('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 31b92b2..0bfe7fe 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 _0x7fb2=['TEXT','INTEGER','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x37b060,_0x412b9e){var _0x313606=function(_0x102beb){while(--_0x102beb){_0x37b060['push'](_0x37b060['shift']());}};_0x313606(++_0x412b9e);}(_0x7fb2,0x1d4));var _0x27fb=function(_0x2ecc6d,_0x145cf5){_0x2ecc6d=_0x2ecc6d-0x0;var _0x346adb=_0x7fb2[_0x2ecc6d];return _0x346adb;};'use strict';var _=require(_0x27fb('0x0'));var Sequelize=require(_0x27fb('0x1'));module[_0x27fb('0x2')]={'firstName':{'type':Sequelize[_0x27fb('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x27fb('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x27fb('0x3')]},'city':{'type':Sequelize[_0x27fb('0x3')]},'country':{'type':Sequelize[_0x27fb('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x27fb('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x27fb('0x3')]},'fax':{'type':Sequelize[_0x27fb('0x3')]},'email':{'type':Sequelize[_0x27fb('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x27fb('0x3')]},'fb_data':{'type':Sequelize[_0x27fb('0x3')]},'twitter':{'type':Sequelize[_0x27fb('0x3')]},'skype':{'type':Sequelize[_0x27fb('0x3')]},'teams':{'type':Sequelize[_0x27fb('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x27fb('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x27fb('0x3')]},'UserId':{'type':Sequelize[_0x27fb('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x27fb('0x3')]},'priority':{'type':Sequelize[_0x27fb('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x27fb('0x6')],'defaultValue':Sequelize[_0x27fb('0x7')]},'dialTimezone':{'type':Sequelize[_0x27fb('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9d7a=['lodash','sequelize','STRING','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9d7a,0x1c7));var _0xa9d7=function(_0x35f376,_0x42b58b){_0x35f376=_0x35f376-0x0;var _0x26d455=_0x9d7a[_0x35f376];return _0x26d455;};'use strict';var _=require(_0xa9d7('0x0'));var Sequelize=require(_0xa9d7('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa9d7('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa9d7('0x2')]},'country':{'type':Sequelize[_0xa9d7('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xa9d7('0x2')]},'mobile':{'type':Sequelize[_0xa9d7('0x2')]},'fax':{'type':Sequelize[_0xa9d7('0x2')]},'email':{'type':Sequelize[_0xa9d7('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xa9d7('0x2')]},'skype':{'type':Sequelize[_0xa9d7('0x2')]},'teams':{'type':Sequelize[_0xa9d7('0x2')]},'viber':{'type':Sequelize[_0xa9d7('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xa9d7('0x2')]},'telegram':{'type':Sequelize[_0xa9d7('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa9d7('0x3')](0x2)[_0xa9d7('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa9d7('0x5')],'defaultValue':Sequelize[_0xa9d7('0x6')]},'dialTimezone':{'type':Sequelize[_0xa9d7('0x2')]},'utcOffset':{'type':Sequelize[_0xa9d7('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 660503f..ea50e29 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 1bb4fda..74ba506 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 _0xaad7=['events','update','remove','emit','hook','exports'];(function(_0x50b16c,_0x5e9cce){var _0x4e939a=function(_0x9f560){while(--_0x9f560){_0x50b16c['push'](_0x50b16c['shift']());}};_0x4e939a(++_0x5e9cce);}(_0xaad7,0x1c2));var _0x7aad=function(_0x4be084,_0x2dc32d){_0x4be084=_0x4be084-0x0;var _0x2e4cf4=_0xaad7[_0x4be084];return _0x2e4cf4;};'use strict';var EventEmitter=require(_0x7aad('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7aad('0x1'),'afterDestroy':_0x7aad('0x2')};function emitEvent(_0x2a9ab6){return function(_0x237819,_0x5cb74a,_0x16a5bf){CmContactEvents[_0x7aad('0x3')](_0x2a9ab6+':'+_0x237819['id'],_0x237819);CmContactEvents['emit'](_0x2a9ab6,_0x237819);_0x16a5bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x7aad('0x4')](e,emitEvent(event));}}module[_0x7aad('0x5')]=CmContactEvents; \ No newline at end of file +var _0x4ebf=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','CmContact','save'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x4ebf,0xb5));var _0xf4eb=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x4ebf[_0x2bf141];return _0x48277b;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xf4eb('0x0'))['db'][_0xf4eb('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf4eb('0x2'),'afterUpdate':_0xf4eb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6c59){return function(_0x1bcacc,_0x1efcd6,_0x5ae1c0){CmContactEvents[_0xf4eb('0x4')](_0x2f6c59+':'+_0x1bcacc['id'],_0x1bcacc);CmContactEvents['emit'](_0x2f6c59,_0x1bcacc);_0x5ae1c0(null);};}for(var e in events){if(events[_0xf4eb('0x5')](e)){var event=events[e];CmContact[_0xf4eb('0x6')](e,emitEvent(event));}}module[_0xf4eb('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index a014fda..ba4807a 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 _0x4756=['email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','findOne','then','isNil','utcOffset','add','minutes','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','cmContact','afterCreate','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','outbound','dialCheckDuplicateType','CmList','length','onlyIfOpen','findAll','BlackLists','CmHopperBlack','message','Lists','always','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','mobile','fax'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x4756,0x14e));var _0x6475=function(_0x43b193,_0xe5c1e6){_0x43b193=_0x43b193-0x0;var _0x494f12=_0x4756[_0x43b193];return _0x494f12;};'use strict';var _=require(_0x6475('0x0'));var util=require('util');var logger=require(_0x6475('0x1'))('api');var moment=require(_0x6475('0x2'));var BPromise=require(_0x6475('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6475('0x4'));var rimraf=require(_0x6475('0x5'));var config=require(_0x6475('0x6'));var shared=require(_0x6475('0x7'));var attributes=require(_0x6475('0x8'));module[_0x6475('0x9')]=function(_0x5a062b,_0x5c52b0){return _0x5a062b[_0x6475('0xa')](_0x6475('0xb'),attributes,{'tableName':_0x6475('0xc'),'paranoid':!![],'indexes':[{'name':_0x6475('0xd'),'fields':[_0x6475('0xd')]},{'name':'fti_cm_contacts','fields':['firstName','lastName','phone',_0x6475('0xe'),_0x6475('0xf'),_0x6475('0x10')],'type':_0x6475('0x11')}],'timestamps':!![],'charset':_0x6475('0x12'),'collate':_0x6475('0x13'),'hooks':{'afterCreate':function(_0x35631b,_0x2b5382,_0x3eef62){var _0x11e556=_0x5a062b['models'];var _0x32e863=_0x35631b[_0x6475('0x14')]({'plain':!![]});function _0x50e8a9(){return function(_0x2165eb){logger[_0x6475('0x15')]('cmContact','afterCreate',util[_0x6475('0x16')](_0x2165eb,{'showHidden':![],'depth':null}));};}function _0x2da731(_0x3e7a45,_0x1d2904){var _0x2712da=_0x1d2904[_0x6475('0x17')]?_0x1d2904[_0x6475('0x17')]:moment()[_0x6475('0x18')](_0x6475('0x19'));return new BPromise(function(_0x2a48f6,_0x2943be){if(_['isNil'](_0x1d2904[_0x6475('0x1a')])){_0x2a48f6({'ret':_0x2712da});}else{_0x11e556['VoiceQueue'][_0x6475('0x1b')]({'where':{'id':_0x3e7a45['id']}})[_0x6475('0x1c')](function(_0x215ce0){if(!_[_0x6475('0x1d')](_0x215ce0)){var _0x3bae51=_0x215ce0[_0x6475('0x1a')];if(!_[_0x6475('0x1d')](_0x3bae51)){var _0x478e50=shared['timezones'];var _0x2e3690=_0x478e50[_0x3bae51];var _0x1ea733=_0x478e50[_0x1d2904[_0x6475('0x1a')]];if(!_[_0x6475('0x1d')](_0x2e3690)&&!_[_0x6475('0x1d')](_0x1ea733)){var _0x2a2121=_0x2e3690[_0x6475('0x1e')]-_0x1ea733[_0x6475('0x1e')];_0x2712da=_0x1d2904['scheduledat']?_0x1d2904[_0x6475('0x17')]:moment();var _0x242e5b=moment(_0x2712da)[_0x6475('0x1f')](_0x2a2121,_0x6475('0x20'));_0x2a48f6({'ret':_0x242e5b[_0x6475('0x18')](_0x6475('0x19'))});}else _0x2a48f6({'ret':_0x2712da});}else _0x2a48f6({'ret':_0x2712da});}else{_0x2a48f6({'ret':_0x2712da});}});}});return 0xa;}var _0x180b8a=function(_0x25d623){return new BPromise(function(_0x2c7db9,_0x4acdd2){_0x2da731(_0x25d623,_0x32e863)[_0x6475('0x1c')](function(_0xf4ac66){_0x32e863[_0x6475('0x17')]=_0xf4ac66[_0x6475('0x21')];_0x11e556['CmHopper'][_0x6475('0x1b')]({'where':{'phone':_0x32e863['phone'],'VoiceQueueId':_0x25d623['id']}})[_0x6475('0x1c')](function(_0xd4dfaa){if(!_[_0x6475('0x1d')](_0xd4dfaa)){throw new Error('cmContact,\x20afterCreate\x20'+_0x32e863['phone']+_0x6475('0x22')+_0x25d623['id']);}return _0x11e556[_0x6475('0x23')][_0x6475('0x24')]({'phone':_0x32e863[_0x6475('0xd')],'ContactId':_0x32e863['id'],'ListId':_0x32e863[_0x6475('0x25')],'priority':_0x32e863[_0x6475('0x26')]?_0x32e863['priority']:0x2,'scheduledat':_0x32e863[_0x6475('0x17')]?_0x32e863[_0x6475('0x17')]:moment()[_0x6475('0x18')](_0x6475('0x19')),'callback':_0x32e863[_0x6475('0x27')]?!![]:![],'callbackuniqueid':_0x32e863[_0x6475('0x27')]?_0x32e863['callbackUniqueid']:undefined,'callbackat':_0x32e863[_0x6475('0x27')]?moment()[_0x6475('0x18')](_0x6475('0x19')):undefined,'VoiceQueueId':_0x25d623['id']});})[_0x6475('0x28')](function(_0x21dac6){_0x4acdd2(_0x21dac6);});});});};var _0x2237be=function(_0x2a9954){return new BPromise(function(_0x46c0f2,_0x407d5e){_0x2da731(_0x2a9954,_0x32e863)['then'](function(_0x15ad53){_0x32e863['scheduledat']=_0x15ad53['ret'];_0x11e556[_0x6475('0x23')][_0x6475('0x1b')]({'where':{'phone':_0x32e863[_0x6475('0xd')],'VoiceQueueId':_0x2a9954['id']}})[_0x6475('0x1c')](function(_0x17ee56){if(!_[_0x6475('0x1d')](_0x17ee56)){throw new Error(_0x6475('0x29')+_0x32e863[_0x6475('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x2a9954['id']);}return _0x11e556[_0x6475('0x2a')]['findOne']({'where':{'calleridnum':_0x32e863[_0x6475('0xd')],'VoiceQueueId':_0x2a9954['id']}});})['then'](function(_0x57d88f){if(!_['isNil'](_0x57d88f)){throw new Error(_0x6475('0x2b')+_0x32e863[_0x6475('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x2a9954['id']);}return _0x11e556[_0x6475('0x23')][_0x6475('0x24')]({'phone':_0x32e863[_0x6475('0xd')],'ContactId':_0x32e863['id'],'ListId':_0x32e863[_0x6475('0x25')],'priority':_0x32e863[_0x6475('0x26')]?_0x32e863['priority']:0x2,'scheduledat':_0x32e863[_0x6475('0x17')]?_0x32e863[_0x6475('0x17')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x32e863[_0x6475('0x27')]?!![]:![],'callbackuniqueid':_0x32e863[_0x6475('0x27')]?_0x32e863['callbackUniqueid']:undefined,'callbackat':_0x32e863[_0x6475('0x27')]?moment()['format'](_0x6475('0x19')):undefined,'VoiceQueueId':_0x2a9954['id']});})[_0x6475('0x28')](function(_0x3f44f6){_0x407d5e(_0x3f44f6);});});});};function _0x3b3c3f(){return function(_0x57211f){logger[_0x6475('0x15')](_0x6475('0x2c'),_0x6475('0x2d'),util['inspect'](_0x57211f,{'showHidden':![],'depth':null}));};}function _0x57e296(_0x3fc2c9,_0x517407){var _0x19928d=_0x517407['scheduledat']?_0x517407['scheduledat']:moment()['format'](_0x6475('0x19'));return new BPromise(function(_0x48dfe7,_0x24ff95){if(_['isNil'](_0x517407[_0x6475('0x1a')])){_0x48dfe7({'ret':_0x19928d});}else{_0x11e556[_0x6475('0x2e')]['findOne']({'where':{'id':_0x3fc2c9['id']}})[_0x6475('0x1c')](function(_0x23e0cc){if(!_[_0x6475('0x1d')](_0x23e0cc)){var _0x445dc8=_0x23e0cc['dialTimezone'];if(!_[_0x6475('0x1d')](_0x445dc8)){var _0x4a4347=shared['timezones'];var _0x53d84c=_0x4a4347[_0x445dc8];var _0x2f61fb=_0x4a4347[_0x517407[_0x6475('0x1a')]];if(!_[_0x6475('0x1d')](_0x53d84c)&&!_[_0x6475('0x1d')](_0x2f61fb)){var _0x4c0955=_0x53d84c[_0x6475('0x1e')]-_0x2f61fb[_0x6475('0x1e')];_0x19928d=_0x517407[_0x6475('0x17')]?_0x517407['scheduledat']:moment();var _0x39e969=moment(_0x19928d)[_0x6475('0x1f')](_0x4c0955,_0x6475('0x20'));_0x48dfe7({'ret':_0x39e969[_0x6475('0x18')](_0x6475('0x19'))});}else _0x48dfe7({'ret':_0x19928d});}else _0x48dfe7({'ret':_0x19928d});}else{_0x48dfe7({'ret':_0x19928d});}});}});return 0xa;}var _0x15b13c=function(_0x3530ad){return new BPromise(function(_0x170e56,_0x2e1507){_0x57e296(_0x3530ad,_0x32e863)[_0x6475('0x1c')](function(_0x39cb94){_0x32e863[_0x6475('0x17')]=_0x39cb94['ret'];_0x11e556[_0x6475('0x23')]['findOne']({'where':{'phone':_0x32e863['phone'],'CampaignId':_0x3530ad['id']}})[_0x6475('0x1c')](function(_0x2cac11){if(!_[_0x6475('0x1d')](_0x2cac11)){throw new Error(_0x6475('0x29')+_0x32e863[_0x6475('0xd')]+_0x6475('0x2f')+_0x3530ad['id']);}return _0x11e556[_0x6475('0x23')]['create']({'phone':_0x32e863[_0x6475('0xd')],'ContactId':_0x32e863['id'],'ListId':_0x32e863['ListId'],'priority':_0x32e863[_0x6475('0x26')]?_0x32e863[_0x6475('0x26')]:0x2,'scheduledat':_0x32e863['scheduledat']?_0x32e863[_0x6475('0x17')]:moment()[_0x6475('0x18')](_0x6475('0x19')),'callback':_0x32e863[_0x6475('0x27')]?!![]:![],'callbackuniqueid':_0x32e863['callbackUniqueid']?_0x32e863[_0x6475('0x27')]:undefined,'callbackat':_0x32e863[_0x6475('0x27')]?moment()[_0x6475('0x18')](_0x6475('0x19')):undefined,'CampaignId':_0x3530ad['id']});})[_0x6475('0x28')](function(_0x51294a){_0x2e1507(_0x51294a);});});});};var _0x86b5cc=function(_0x25b6c7){return new BPromise(function(_0x5ab7a9,_0x67f18f){_0x57e296(_0x25b6c7,_0x32e863)[_0x6475('0x1c')](function(_0x470813){_0x32e863['scheduledat']=_0x470813[_0x6475('0x21')];_0x11e556[_0x6475('0x23')][_0x6475('0x1b')]({'where':{'phone':_0x32e863['phone'],'CampaignId':_0x25b6c7['id']}})[_0x6475('0x1c')](function(_0x3925bd){if(!_['isNil'](_0x3925bd)){throw new Error('cmContact,\x20afterCreate\x20'+_0x32e863[_0x6475('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x25b6c7['id']);}return _0x11e556[_0x6475('0x2a')]['findOne']({'where':{'calleridnum':_0x32e863['phone'],'CampaignId':_0x25b6c7['id']}});})[_0x6475('0x1c')](function(_0x2d958a){if(!_[_0x6475('0x1d')](_0x2d958a)){throw new Error(_0x6475('0x2b')+_0x32e863[_0x6475('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x25b6c7['id']);}return _0x11e556[_0x6475('0x23')]['create']({'phone':_0x32e863[_0x6475('0xd')],'ContactId':_0x32e863['id'],'ListId':_0x32e863['ListId'],'priority':_0x32e863[_0x6475('0x26')]?_0x32e863['priority']:0x2,'scheduledat':_0x32e863[_0x6475('0x17')]?_0x32e863['scheduledat']:moment()['format'](_0x6475('0x19')),'callback':_0x32e863[_0x6475('0x27')]?!![]:![],'callbackuniqueid':_0x32e863[_0x6475('0x27')]?_0x32e863[_0x6475('0x27')]:undefined,'callbackat':_0x32e863[_0x6475('0x27')]?moment()['format'](_0x6475('0x19')):undefined,'CampaignId':_0x25b6c7['id']});})['catch'](function(_0x4ae73f){_0x67f18f(_0x4ae73f);});});});};if(_0x32e863['ListId']){_0x11e556[_0x6475('0x30')]['findAll']({'where':{'type':_0x6475('0x31')},'attributes':['id',_0x6475('0x32'),_0x6475('0x1a')],'include':[{'model':_0x11e556[_0x6475('0x33')],'as':'Lists','where':{'id':_0x32e863[_0x6475('0x25')]}}]})[_0x6475('0x1c')](function(_0x4e0625){if(_0x4e0625){var _0x5ae567=[];for(var _0x26d439=0x0,_0x30cf08;_0x26d439<_0x4e0625[_0x6475('0x34')];_0x26d439+=0x1){_0x30cf08=_0x4e0625[_0x26d439][_0x6475('0x14')]({'plain':!![]});switch(_0x30cf08[_0x6475('0x32')]){case'always':_0x2237be(_0x30cf08)['catch'](_0x50e8a9());break;case _0x6475('0x35'):_0x180b8a(_0x30cf08)[_0x6475('0x28')](_0x50e8a9());break;default:_0x57e296(_0x30cf08,_0x32e863)['then'](function(_0x360f5b){_0x32e863['scheduledat']=_0x360f5b[_0x6475('0x21')];_0x11e556[_0x6475('0x23')][_0x6475('0x24')]({'phone':_0x32e863[_0x6475('0xd')],'ContactId':_0x32e863['id'],'ListId':_0x32e863[_0x6475('0x25')],'scheduledat':_0x32e863['scheduledat']?_0x32e863[_0x6475('0x17')]:moment()['format'](_0x6475('0x19')),'priority':_0x32e863[_0x6475('0x26')]?_0x32e863[_0x6475('0x26')]:0x2,'callback':_0x32e863[_0x6475('0x27')]?!![]:![],'callbackuniqueid':_0x32e863[_0x6475('0x27')]?_0x32e863[_0x6475('0x27')]:undefined,'callbackat':_0x32e863[_0x6475('0x27')]?moment()[_0x6475('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x30cf08['id']})['catch'](_0x50e8a9());});}}}})['then'](function(){return _0x11e556[_0x6475('0x30')][_0x6475('0x36')]({'where':{'type':_0x6475('0x31')},'attributes':['id'],'include':[{'model':_0x11e556[_0x6475('0x33')],'as':_0x6475('0x37'),'where':{'id':_0x32e863[_0x6475('0x25')]}}]})[_0x6475('0x1c')](function(_0x5a88d3){if(_0x5a88d3){var _0x1fda75=[];for(var _0x551f13=0x0,_0x217f1e;_0x551f13<_0x5a88d3[_0x6475('0x34')];_0x551f13+=0x1){_0x217f1e=_0x5a88d3[_0x551f13][_0x6475('0x14')]({'plain':!![]});_0x11e556[_0x6475('0x38')][_0x6475('0x24')]({'phone':_0x32e863[_0x6475('0xd')],'ContactId':_0x32e863['id'],'ListId':_0x32e863[_0x6475('0x25')],'VoiceQueueId':_0x217f1e['id']})[_0x6475('0x28')](function(_0x4e6b85){logger[_0x6475('0x15')]('cmContact,\x20%s,\x20%s',_0x6475('0x2d'),_0x4e6b85[_0x6475('0x39')]);});}}});})[_0x6475('0x1c')](function(){return _0x11e556[_0x6475('0x2e')][_0x6475('0x36')]({'attributes':['id',_0x6475('0x32'),_0x6475('0x1a')],'include':[{'model':_0x11e556['CmList'],'as':_0x6475('0x3a'),'where':{'id':_0x32e863['ListId']}}]})[_0x6475('0x1c')](function(_0x39b85f){if(_0x39b85f){var _0x431c7e=[];for(var _0x17bb7c=0x0,_0x366754;_0x17bb7c<_0x39b85f[_0x6475('0x34')];_0x17bb7c+=0x1){_0x366754=_0x39b85f[_0x17bb7c][_0x6475('0x14')]({'plain':!![]});switch(_0x366754['dialCheckDuplicateType']){case _0x6475('0x3b'):_0x86b5cc(_0x366754)['catch'](_0x3b3c3f());break;case _0x6475('0x35'):_0x15b13c(_0x366754)[_0x6475('0x28')](_0x3b3c3f());break;default:_0x11e556['CmHopper']['create']({'phone':_0x32e863[_0x6475('0xd')],'ContactId':_0x32e863['id'],'ListId':_0x32e863[_0x6475('0x25')],'scheduledat':_0x32e863[_0x6475('0x17')]?_0x32e863['scheduledat']:moment()[_0x6475('0x18')](_0x6475('0x19')),'priority':_0x32e863[_0x6475('0x26')]?_0x32e863['priority']:0x2,'callback':_0x32e863[_0x6475('0x27')]?!![]:![],'callbackuniqueid':_0x32e863[_0x6475('0x27')]?_0x32e863[_0x6475('0x27')]:undefined,'callbackat':_0x32e863[_0x6475('0x27')]?moment()[_0x6475('0x18')](_0x6475('0x19')):undefined,'CampaignId':_0x366754['id']})[_0x6475('0x28')](_0x3b3c3f());}}}});})[_0x6475('0x1c')](function(){return _0x11e556[_0x6475('0x2e')][_0x6475('0x36')]({'attributes':['id'],'include':[{'model':_0x11e556[_0x6475('0x33')],'as':_0x6475('0x37'),'where':{'id':_0x32e863['ListId']}}]})['then'](function(_0x52413f){if(_0x52413f){var _0xda3834=[];for(var _0x15a995=0x0,_0x140534;_0x15a995<_0x52413f[_0x6475('0x34')];_0x15a995+=0x1){_0x140534=_0x52413f[_0x15a995][_0x6475('0x14')]({'plain':!![]});_0x11e556[_0x6475('0x38')][_0x6475('0x24')]({'phone':_0x32e863[_0x6475('0xd')],'ContactId':_0x32e863['id'],'ListId':_0x32e863[_0x6475('0x25')],'CampaignId':_0x140534['id']})['catch'](function(_0x3090b9){logger[_0x6475('0x15')](_0x6475('0x3c'),_0x6475('0x2d'),_0x3090b9[_0x6475('0x39')]);});}}});})[_0x6475('0x1c')](function(){_0x3eef62();})[_0x6475('0x28')](function(_0x1f60fe){logger[_0x6475('0x15')]('cmContact,\x20%s,\x20%s',_0x6475('0x2d'),_0x1f60fe[_0x6475('0x39')]);_0x3eef62(_0x1f60fe);});}else{_0x3eef62(new Error(_0x6475('0x3d')));}},'afterDestroy':function(_0x668abd,_0xcda18d,_0x3ac52e){var _0x222f56=_0x5a062b['models'];var _0x1ab3a5=_0x668abd[_0x6475('0x14')]({'plain':!![]});return _0x222f56[_0x6475('0x23')][_0x6475('0x36')]({'raw':!![],'where':{'ListId':_0x1ab3a5[_0x6475('0x25')],'ContactId':_0x1ab3a5['id']}})['then'](function(_0x1f7710){if(!_[_0x6475('0x3e')](_0x1f7710)){var _0x570a99=[];for(var _0x3100bf=0x0;_0x3100bf<_0x1f7710[_0x6475('0x34')];_0x3100bf+=0x1){var _0x10052c=_0x222f56[_0x6475('0x23')][_0x6475('0x3f')]({'where':{'ListId':_0x1f7710[_0x3100bf][_0x6475('0x25')],'ContactId':_0x1f7710[_0x3100bf]['ContactId'],'VoiceQueueId':_0x1f7710[_0x3100bf][_0x6475('0x40')],'CampaignId':_0x1f7710[_0x3100bf][_0x6475('0x41')]}});_0x570a99[_0x6475('0x42')](_0x10052c);}return BPromise[_0x6475('0x43')](_0x570a99);}})[_0x6475('0x1c')](function(_0x4388ee){logger['info'](_0x6475('0x44'),util['inspect'](_0x4388ee,{'showHidden':![],'depth':null}));_0x3ac52e();})['catch'](function(_0x48b2f4){logger[_0x6475('0x15')](_0x6475('0x45'),util[_0x6475('0x16')](_0x48b2f4,{'showHidden':![],'depth':null}));_0x3ac52e(_0x48b2f4);});}}});}; \ No newline at end of file +var _0xddbc=['dialCheckDuplicateType','CmList','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','inspect','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','timezones','utcOffset','scheduledat','add','minutes','ret','cmContact,\x20afterCreate\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','Campaign','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound'];(function(_0x4f2287,_0x6edd1d){var _0x2f0943=function(_0xe4bf0){while(--_0xe4bf0){_0x4f2287['push'](_0x4f2287['shift']());}};_0x2f0943(++_0x6edd1d);}(_0xddbc,0x185));var _0xcddb=function(_0x12f281,_0x162891){_0x12f281=_0x12f281-0x0;var _0x64bbb3=_0xddbc[_0x12f281];return _0x64bbb3;};'use strict';var _=require('lodash');var util=require(_0xcddb('0x0'));var logger=require(_0xcddb('0x1'))(_0xcddb('0x2'));var moment=require(_0xcddb('0x3'));var BPromise=require(_0xcddb('0x4'));var rp=require(_0xcddb('0x5'));var fs=require('fs');var path=require(_0xcddb('0x6'));var rimraf=require(_0xcddb('0x7'));var config=require(_0xcddb('0x8'));var shared=require(_0xcddb('0x9'));var attributes=require('./cmContact.attributes');module[_0xcddb('0xa')]=function(_0x360d11,_0x25c0b){return _0x360d11['define'](_0xcddb('0xb'),attributes,{'tableName':_0xcddb('0xc'),'paranoid':!![],'indexes':[{'name':_0xcddb('0xd'),'fields':[_0xcddb('0xd')]},{'name':_0xcddb('0xe'),'fields':[_0xcddb('0xf'),_0xcddb('0x10'),_0xcddb('0xd'),'mobile',_0xcddb('0x11'),'email'],'type':_0xcddb('0x12')}],'timestamps':!![],'charset':_0xcddb('0x13'),'collate':_0xcddb('0x14'),'hooks':{'afterCreate':function(_0x328442,_0x207ba9,_0x5d2741){var _0x547eec=_0x360d11[_0xcddb('0x15')];var _0x11e00c=_0x328442[_0xcddb('0x16')]({'plain':!![]});function _0x505c18(){return function(_0x4afb1b){logger[_0xcddb('0x17')](_0xcddb('0x18'),'afterCreate',util[_0xcddb('0x19')](_0x4afb1b,{'showHidden':![],'depth':null}));};}function _0x42c33a(_0x4f9297,_0x212c31){var _0x38f2f5=_0x212c31['scheduledat']?_0x212c31['scheduledat']:moment()[_0xcddb('0x1a')](_0xcddb('0x1b'));return new BPromise(function(_0x3d93b9,_0x317752){if(_[_0xcddb('0x1c')](_0x212c31[_0xcddb('0x1d')])){_0x3d93b9({'ret':_0x38f2f5});}else{_0x547eec[_0xcddb('0x1e')]['findOne']({'where':{'id':_0x4f9297['id']}})[_0xcddb('0x1f')](function(_0xec878a){if(!_['isNil'](_0xec878a)){var _0x5a820f=_0xec878a['dialTimezone'];if(!_['isNil'](_0x5a820f)){var _0x337099=shared[_0xcddb('0x20')];var _0x22fc53=_0x337099[_0x5a820f];var _0x1d38ec=_0x337099[_0x212c31[_0xcddb('0x1d')]];if(!_[_0xcddb('0x1c')](_0x22fc53)&&!_[_0xcddb('0x1c')](_0x1d38ec)){var _0x150b1f=_0x22fc53[_0xcddb('0x21')]-_0x1d38ec[_0xcddb('0x21')];_0x38f2f5=_0x212c31[_0xcddb('0x22')]?_0x212c31[_0xcddb('0x22')]:moment();var _0x3df8ed=moment(_0x38f2f5)[_0xcddb('0x23')](_0x150b1f,_0xcddb('0x24'));_0x3d93b9({'ret':_0x3df8ed[_0xcddb('0x1a')](_0xcddb('0x1b'))});}else _0x3d93b9({'ret':_0x38f2f5});}else _0x3d93b9({'ret':_0x38f2f5});}else{_0x3d93b9({'ret':_0x38f2f5});}});}});return 0xa;}var _0x1a87ae=function(_0x43090e){return new BPromise(function(_0x14a022,_0x11d01f){_0x42c33a(_0x43090e,_0x11e00c)[_0xcddb('0x1f')](function(_0xe441c7){_0x11e00c[_0xcddb('0x22')]=_0xe441c7[_0xcddb('0x25')];_0x547eec['CmHopper']['findOne']({'where':{'phone':_0x11e00c['phone'],'VoiceQueueId':_0x43090e['id']}})[_0xcddb('0x1f')](function(_0xf98dc0){if(!_['isNil'](_0xf98dc0)){throw new Error(_0xcddb('0x26')+_0x11e00c[_0xcddb('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x43090e['id']);}return _0x547eec[_0xcddb('0x27')][_0xcddb('0x28')]({'phone':_0x11e00c[_0xcddb('0xd')],'ContactId':_0x11e00c['id'],'ListId':_0x11e00c[_0xcddb('0x29')],'priority':_0x11e00c['priority']?_0x11e00c[_0xcddb('0x2a')]:0x2,'scheduledat':_0x11e00c[_0xcddb('0x22')]?_0x11e00c[_0xcddb('0x22')]:moment()[_0xcddb('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x11e00c[_0xcddb('0x2b')]?!![]:![],'callbackuniqueid':_0x11e00c[_0xcddb('0x2b')]?_0x11e00c[_0xcddb('0x2b')]:undefined,'callbackat':_0x11e00c[_0xcddb('0x2b')]?moment()['format'](_0xcddb('0x1b')):undefined,'VoiceQueueId':_0x43090e['id']});})[_0xcddb('0x2c')](function(_0x454944){_0x11d01f(_0x454944);});});});};var _0x4cfac6=function(_0xe60942){return new BPromise(function(_0x4f884d,_0xe5a3e){_0x42c33a(_0xe60942,_0x11e00c)[_0xcddb('0x1f')](function(_0x3129d6){_0x11e00c[_0xcddb('0x22')]=_0x3129d6['ret'];_0x547eec[_0xcddb('0x27')][_0xcddb('0x2d')]({'where':{'phone':_0x11e00c['phone'],'VoiceQueueId':_0xe60942['id']}})[_0xcddb('0x1f')](function(_0x954a5d){if(!_[_0xcddb('0x1c')](_0x954a5d)){throw new Error(_0xcddb('0x26')+_0x11e00c[_0xcddb('0xd')]+_0xcddb('0x2e')+_0xe60942['id']);}return _0x547eec['CmHopperFinal'][_0xcddb('0x2d')]({'where':{'calleridnum':_0x11e00c[_0xcddb('0xd')],'VoiceQueueId':_0xe60942['id']}});})[_0xcddb('0x1f')](function(_0xe2b02c){if(!_['isNil'](_0xe2b02c)){throw new Error(_0xcddb('0x2f')+_0x11e00c[_0xcddb('0xd')]+_0xcddb('0x30')+_0xe60942['id']);}return _0x547eec['CmHopper'][_0xcddb('0x28')]({'phone':_0x11e00c[_0xcddb('0xd')],'ContactId':_0x11e00c['id'],'ListId':_0x11e00c[_0xcddb('0x29')],'priority':_0x11e00c[_0xcddb('0x2a')]?_0x11e00c[_0xcddb('0x2a')]:0x2,'scheduledat':_0x11e00c['scheduledat']?_0x11e00c['scheduledat']:moment()[_0xcddb('0x1a')](_0xcddb('0x1b')),'callback':_0x11e00c[_0xcddb('0x2b')]?!![]:![],'callbackuniqueid':_0x11e00c[_0xcddb('0x2b')]?_0x11e00c['callbackUniqueid']:undefined,'callbackat':_0x11e00c[_0xcddb('0x2b')]?moment()['format'](_0xcddb('0x1b')):undefined,'VoiceQueueId':_0xe60942['id']});})['catch'](function(_0x5aec82){_0xe5a3e(_0x5aec82);});});});};function _0x366b5f(){return function(_0x4ba6ea){logger[_0xcddb('0x17')](_0xcddb('0x18'),_0xcddb('0x31'),util[_0xcddb('0x19')](_0x4ba6ea,{'showHidden':![],'depth':null}));};}function _0x4ade45(_0x54168a,_0x4d53be){var _0x2bbef6=_0x4d53be[_0xcddb('0x22')]?_0x4d53be[_0xcddb('0x22')]:moment()[_0xcddb('0x1a')](_0xcddb('0x1b'));return new BPromise(function(_0x484be7,_0x17e0fa){if(_[_0xcddb('0x1c')](_0x4d53be['dialTimezone'])){_0x484be7({'ret':_0x2bbef6});}else{_0x547eec[_0xcddb('0x32')][_0xcddb('0x2d')]({'where':{'id':_0x54168a['id']}})['then'](function(_0x59f63){if(!_[_0xcddb('0x1c')](_0x59f63)){var _0x17d0a1=_0x59f63[_0xcddb('0x1d')];if(!_[_0xcddb('0x1c')](_0x17d0a1)){var _0x2321de=shared[_0xcddb('0x20')];var _0x1c0957=_0x2321de[_0x17d0a1];var _0x474585=_0x2321de[_0x4d53be[_0xcddb('0x1d')]];if(!_[_0xcddb('0x1c')](_0x1c0957)&&!_['isNil'](_0x474585)){var _0x306e37=_0x1c0957[_0xcddb('0x21')]-_0x474585[_0xcddb('0x21')];_0x2bbef6=_0x4d53be['scheduledat']?_0x4d53be[_0xcddb('0x22')]:moment();var _0x39a29c=moment(_0x2bbef6)[_0xcddb('0x23')](_0x306e37,_0xcddb('0x24'));_0x484be7({'ret':_0x39a29c[_0xcddb('0x1a')](_0xcddb('0x1b'))});}else _0x484be7({'ret':_0x2bbef6});}else _0x484be7({'ret':_0x2bbef6});}else{_0x484be7({'ret':_0x2bbef6});}});}});return 0xa;}var _0x508443=function(_0x18e221){return new BPromise(function(_0xa0d192,_0x295383){_0x4ade45(_0x18e221,_0x11e00c)[_0xcddb('0x1f')](function(_0x28e8a4){_0x11e00c[_0xcddb('0x22')]=_0x28e8a4[_0xcddb('0x25')];_0x547eec['CmHopper'][_0xcddb('0x2d')]({'where':{'phone':_0x11e00c[_0xcddb('0xd')],'CampaignId':_0x18e221['id']}})['then'](function(_0x487cce){if(!_['isNil'](_0x487cce)){throw new Error('cmContact,\x20afterCreate\x20'+_0x11e00c[_0xcddb('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x18e221['id']);}return _0x547eec[_0xcddb('0x27')][_0xcddb('0x28')]({'phone':_0x11e00c[_0xcddb('0xd')],'ContactId':_0x11e00c['id'],'ListId':_0x11e00c[_0xcddb('0x29')],'priority':_0x11e00c[_0xcddb('0x2a')]?_0x11e00c['priority']:0x2,'scheduledat':_0x11e00c['scheduledat']?_0x11e00c['scheduledat']:moment()[_0xcddb('0x1a')](_0xcddb('0x1b')),'callback':_0x11e00c[_0xcddb('0x2b')]?!![]:![],'callbackuniqueid':_0x11e00c[_0xcddb('0x2b')]?_0x11e00c['callbackUniqueid']:undefined,'callbackat':_0x11e00c['callbackUniqueid']?moment()[_0xcddb('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x18e221['id']});})['catch'](function(_0x332a0d){_0x295383(_0x332a0d);});});});};var _0x47ae43=function(_0x12d211){return new BPromise(function(_0x4d4972,_0x207805){_0x4ade45(_0x12d211,_0x11e00c)['then'](function(_0x5a6edc){_0x11e00c['scheduledat']=_0x5a6edc[_0xcddb('0x25')];_0x547eec[_0xcddb('0x27')][_0xcddb('0x2d')]({'where':{'phone':_0x11e00c[_0xcddb('0xd')],'CampaignId':_0x12d211['id']}})['then'](function(_0x231e9a){if(!_['isNil'](_0x231e9a)){throw new Error('cmContact,\x20afterCreate\x20'+_0x11e00c[_0xcddb('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x12d211['id']);}return _0x547eec[_0xcddb('0x33')]['findOne']({'where':{'calleridnum':_0x11e00c[_0xcddb('0xd')],'CampaignId':_0x12d211['id']}});})['then'](function(_0x14dc73){if(!_[_0xcddb('0x1c')](_0x14dc73)){throw new Error(_0xcddb('0x2f')+_0x11e00c['phone']+_0xcddb('0x34')+_0x12d211['id']);}return _0x547eec[_0xcddb('0x27')][_0xcddb('0x28')]({'phone':_0x11e00c[_0xcddb('0xd')],'ContactId':_0x11e00c['id'],'ListId':_0x11e00c[_0xcddb('0x29')],'priority':_0x11e00c[_0xcddb('0x2a')]?_0x11e00c[_0xcddb('0x2a')]:0x2,'scheduledat':_0x11e00c[_0xcddb('0x22')]?_0x11e00c[_0xcddb('0x22')]:moment()['format'](_0xcddb('0x1b')),'callback':_0x11e00c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x11e00c[_0xcddb('0x2b')]?_0x11e00c[_0xcddb('0x2b')]:undefined,'callbackat':_0x11e00c['callbackUniqueid']?moment()[_0xcddb('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x12d211['id']});})[_0xcddb('0x2c')](function(_0x3217b1){_0x207805(_0x3217b1);});});});};if(_0x11e00c[_0xcddb('0x29')]){_0x547eec['VoiceQueue'][_0xcddb('0x35')]({'where':{'type':_0xcddb('0x36')},'attributes':['id',_0xcddb('0x37'),_0xcddb('0x1d')],'include':[{'model':_0x547eec[_0xcddb('0x38')],'as':'Lists','where':{'id':_0x11e00c[_0xcddb('0x29')]}}]})[_0xcddb('0x1f')](function(_0x426314){if(_0x426314){var _0x4d634b=[];for(var _0x3b194c=0x0,_0x1d72e8;_0x3b194c<_0x426314[_0xcddb('0x39')];_0x3b194c+=0x1){_0x1d72e8=_0x426314[_0x3b194c][_0xcddb('0x16')]({'plain':!![]});switch(_0x1d72e8[_0xcddb('0x37')]){case _0xcddb('0x3a'):_0x4cfac6(_0x1d72e8)[_0xcddb('0x2c')](_0x505c18());break;case _0xcddb('0x3b'):_0x1a87ae(_0x1d72e8)['catch'](_0x505c18());break;default:_0x4ade45(_0x1d72e8,_0x11e00c)[_0xcddb('0x1f')](function(_0x18dc44){_0x11e00c[_0xcddb('0x22')]=_0x18dc44[_0xcddb('0x25')];_0x547eec['CmHopper'][_0xcddb('0x28')]({'phone':_0x11e00c[_0xcddb('0xd')],'ContactId':_0x11e00c['id'],'ListId':_0x11e00c[_0xcddb('0x29')],'scheduledat':_0x11e00c[_0xcddb('0x22')]?_0x11e00c[_0xcddb('0x22')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x11e00c['priority']?_0x11e00c['priority']:0x2,'callback':_0x11e00c[_0xcddb('0x2b')]?!![]:![],'callbackuniqueid':_0x11e00c[_0xcddb('0x2b')]?_0x11e00c[_0xcddb('0x2b')]:undefined,'callbackat':_0x11e00c[_0xcddb('0x2b')]?moment()['format'](_0xcddb('0x1b')):undefined,'VoiceQueueId':_0x1d72e8['id']})['catch'](_0x505c18());});}}}})[_0xcddb('0x1f')](function(){return _0x547eec[_0xcddb('0x1e')][_0xcddb('0x35')]({'where':{'type':_0xcddb('0x36')},'attributes':['id'],'include':[{'model':_0x547eec[_0xcddb('0x38')],'as':_0xcddb('0x3c'),'where':{'id':_0x11e00c[_0xcddb('0x29')]}}]})[_0xcddb('0x1f')](function(_0x154f0a){if(_0x154f0a){var _0x2bc851=[];for(var _0x332a49=0x0,_0x29a4ae;_0x332a49<_0x154f0a['length'];_0x332a49+=0x1){_0x29a4ae=_0x154f0a[_0x332a49]['get']({'plain':!![]});_0x547eec[_0xcddb('0x3d')][_0xcddb('0x28')]({'phone':_0x11e00c[_0xcddb('0xd')],'ContactId':_0x11e00c['id'],'ListId':_0x11e00c['ListId'],'VoiceQueueId':_0x29a4ae['id']})[_0xcddb('0x2c')](function(_0x55c97f){logger[_0xcddb('0x17')](_0xcddb('0x3e'),'afterCreate',_0x55c97f[_0xcddb('0x3f')]);});}}});})['then'](function(){return _0x547eec[_0xcddb('0x32')][_0xcddb('0x35')]({'attributes':['id',_0xcddb('0x37'),_0xcddb('0x1d')],'include':[{'model':_0x547eec[_0xcddb('0x38')],'as':'Lists','where':{'id':_0x11e00c['ListId']}}]})[_0xcddb('0x1f')](function(_0x2129e4){if(_0x2129e4){var _0x3c58bb=[];for(var _0xa9c079=0x0,_0x28a14d;_0xa9c079<_0x2129e4[_0xcddb('0x39')];_0xa9c079+=0x1){_0x28a14d=_0x2129e4[_0xa9c079][_0xcddb('0x16')]({'plain':!![]});switch(_0x28a14d[_0xcddb('0x37')]){case _0xcddb('0x3a'):_0x47ae43(_0x28a14d)[_0xcddb('0x2c')](_0x366b5f());break;case _0xcddb('0x3b'):_0x508443(_0x28a14d)['catch'](_0x366b5f());break;default:_0x547eec[_0xcddb('0x27')]['create']({'phone':_0x11e00c[_0xcddb('0xd')],'ContactId':_0x11e00c['id'],'ListId':_0x11e00c[_0xcddb('0x29')],'scheduledat':_0x11e00c[_0xcddb('0x22')]?_0x11e00c['scheduledat']:moment()[_0xcddb('0x1a')](_0xcddb('0x1b')),'priority':_0x11e00c[_0xcddb('0x2a')]?_0x11e00c[_0xcddb('0x2a')]:0x2,'callback':_0x11e00c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x11e00c[_0xcddb('0x2b')]?_0x11e00c[_0xcddb('0x2b')]:undefined,'callbackat':_0x11e00c[_0xcddb('0x2b')]?moment()[_0xcddb('0x1a')](_0xcddb('0x1b')):undefined,'CampaignId':_0x28a14d['id']})['catch'](_0x366b5f());}}}});})[_0xcddb('0x1f')](function(){return _0x547eec[_0xcddb('0x32')][_0xcddb('0x35')]({'attributes':['id'],'include':[{'model':_0x547eec[_0xcddb('0x38')],'as':'BlackLists','where':{'id':_0x11e00c['ListId']}}]})[_0xcddb('0x1f')](function(_0x2ae5eb){if(_0x2ae5eb){var _0x90afc9=[];for(var _0x10a6c9=0x0,_0x1402ea;_0x10a6c9<_0x2ae5eb[_0xcddb('0x39')];_0x10a6c9+=0x1){_0x1402ea=_0x2ae5eb[_0x10a6c9][_0xcddb('0x16')]({'plain':!![]});_0x547eec[_0xcddb('0x3d')]['create']({'phone':_0x11e00c[_0xcddb('0xd')],'ContactId':_0x11e00c['id'],'ListId':_0x11e00c[_0xcddb('0x29')],'CampaignId':_0x1402ea['id']})[_0xcddb('0x2c')](function(_0x1b8598){logger['error']('cmContact,\x20%s,\x20%s',_0xcddb('0x31'),_0x1b8598[_0xcddb('0x3f')]);});}}});})[_0xcddb('0x1f')](function(){_0x5d2741();})[_0xcddb('0x2c')](function(_0x4991b8){logger[_0xcddb('0x17')](_0xcddb('0x3e'),'afterCreate',_0x4991b8['message']);_0x5d2741(_0x4991b8);});}else{_0x5d2741(new Error(_0xcddb('0x40')));}},'afterDestroy':function(_0xf8cf49,_0x16a2ba,_0x5cf938){var _0x3d4711=_0x360d11[_0xcddb('0x15')];var _0x1b884c=_0xf8cf49[_0xcddb('0x16')]({'plain':!![]});return _0x3d4711[_0xcddb('0x27')][_0xcddb('0x35')]({'raw':!![],'where':{'ListId':_0x1b884c[_0xcddb('0x29')],'ContactId':_0x1b884c['id']}})[_0xcddb('0x1f')](function(_0x191754){if(!_[_0xcddb('0x41')](_0x191754)){var _0x3157a8=[];for(var _0x212e04=0x0;_0x212e04<_0x191754[_0xcddb('0x39')];_0x212e04+=0x1){var _0x3dfd1b=_0x3d4711[_0xcddb('0x27')][_0xcddb('0x42')]({'where':{'ListId':_0x191754[_0x212e04]['ListId'],'ContactId':_0x191754[_0x212e04][_0xcddb('0x43')],'VoiceQueueId':_0x191754[_0x212e04]['VoiceQueueId'],'CampaignId':_0x191754[_0x212e04][_0xcddb('0x44')]}});_0x3157a8[_0xcddb('0x45')](_0x3dfd1b);}return BPromise[_0xcddb('0x46')](_0x3157a8);}})[_0xcddb('0x1f')](function(_0x527688){logger[_0xcddb('0x47')](_0xcddb('0x48'),util[_0xcddb('0x19')](_0x527688,{'showHidden':![],'depth':null}));_0x5cf938();})[_0xcddb('0x2c')](function(_0xf4dd66){logger[_0xcddb('0x17')](_0xcddb('0x49'),util[_0xcddb('0x19')](_0xf4dd66,{'showHidden':![],'depth':null}));_0x5cf938(_0xf4dd66);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 89c1a0c..792b5b4 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x30bde9,_0x4dab76){var _0x545c5a=function(_0xf4277f){while(--_0xf4277f){_0x30bde9['push'](_0x30bde9['shift']());}};_0x545c5a(++_0x4dab76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 549ba96..70f2619 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 _0xbd50=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x531c7d,_0x521c33){var _0x4eaf19=function(_0x2f0b19){while(--_0x2f0b19){_0x531c7d['push'](_0x531c7d['shift']());}};_0x4eaf19(++_0x521c33);}(_0xbd50,0x196));var _0x0bd5=function(_0x3c8d51,_0x51b312){_0x3c8d51=_0x3c8d51-0x0;var _0x1ec26f=_0xbd50[_0x3c8d51];return _0x1ec26f;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'CmContactId':{'type':Sequelize[_0x0bd5('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x0bd5('0x3')],'defaultValue':_0x0bd5('0x4')},'OrderBy':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0bd5('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0xde13=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x327bc4,_0x174fb2){var _0x2d331e=function(_0x31f999){while(--_0x31f999){_0x327bc4['push'](_0x327bc4['shift']());}};_0x2d331e(++_0x174fb2);}(_0xde13,0x146));var _0x3de1=function(_0x23ba46,_0x295058){_0x23ba46=_0x23ba46-0x0;var _0x23a4b3=_0xde13[_0x23ba46];return _0x23a4b3;};'use strict';var Sequelize=require(_0x3de1('0x0'));module[_0x3de1('0x1')]={'CmContactId':{'type':Sequelize[_0x3de1('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x3de1('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x3de1('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x3de1('0x4')},'OrderBy':{'type':Sequelize[_0x3de1('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x3de1('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 052f284..6eccda6 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 _0xf83e=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection'];(function(_0x2866c1,_0x2e6614){var _0x515cfa=function(_0x48eb4a){while(--_0x48eb4a){_0x2866c1['push'](_0x2866c1['shift']());}};_0x515cfa(++_0x2e6614);}(_0xf83e,0x153));var _0xef83=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0xf83e[_0x5dee2a];return _0x31e98e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef83('0x0'));var zipdir=require(_0xef83('0x1'));var jsonpatch=require(_0xef83('0x2'));var rp=require(_0xef83('0x3'));var moment=require(_0xef83('0x4'));var BPromise=require(_0xef83('0x5'));var Mustache=require('mustache');var util=require(_0xef83('0x6'));var path=require(_0xef83('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xef83('0x8'));var fs=require('fs');var fs_extra=require(_0xef83('0x9'));var _=require(_0xef83('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xef83('0xb'));var toCsv=require('to-csv');var querystring=require(_0xef83('0xc'));var Papa=require(_0xef83('0xd'));var Redis=require(_0xef83('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xef83('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef83('0x10'));var logger=require(_0xef83('0x11'))(_0xef83('0x12'));var utils=require(_0xef83('0x13'));var config=require(_0xef83('0x14'));var licenseUtil=require(_0xef83('0x15'));var db=require(_0xef83('0x16'))['db'];function respondWithStatusCode(_0x3ef004,_0x1e1366){_0x1e1366=_0x1e1366||0xcc;return function(_0x30bbd9){if(_0x30bbd9){return _0x3ef004['sendStatus'](_0x1e1366);}return _0x3ef004[_0xef83('0x17')](_0x1e1366)[_0xef83('0x18')]();};}function respondWithResult(_0x585de7,_0x517bca){_0x517bca=_0x517bca||0xc8;return function(_0x256523){if(_0x256523){return _0x585de7[_0xef83('0x17')](_0x517bca)[_0xef83('0x19')](_0x256523);}};}function respondWithFilteredResult(_0x33190b,_0x8b1520){return function(_0x6190ca){if(_0x6190ca){var _0x468a60=typeof _0x8b1520[_0xef83('0x1a')]===_0xef83('0x1b')&&typeof _0x8b1520[_0xef83('0x1c')]===_0xef83('0x1b');var _0x30b0a2=_0x6190ca['count'];var _0x330330=_0x468a60?0x0:_0x8b1520[_0xef83('0x1a')];var _0x1877fb=_0x468a60?_0x6190ca[_0xef83('0x1d')]:_0x8b1520['offset']+_0x8b1520[_0xef83('0x1c')];var _0x1e209e;if(_0x1877fb>=_0x30b0a2){_0x1877fb=_0x30b0a2;_0x1e209e=0xc8;}else{_0x1e209e=0xce;}_0x33190b['status'](_0x1e209e);return _0x33190b[_0xef83('0x1e')]('Content-Range',_0x330330+'-'+_0x1877fb+'/'+_0x30b0a2)[_0xef83('0x19')](_0x6190ca);}return null;};}function patchUpdates(_0x29cc77){return function(_0x2999f0){try{jsonpatch[_0xef83('0x1f')](_0x2999f0,_0x29cc77,!![]);}catch(_0x47062c){return BPromise[_0xef83('0x20')](_0x47062c);}return _0x2999f0[_0xef83('0x21')]();};}function saveUpdates(_0x3fa990,_0x446b43){return function(_0x1b3ed2){if(_0x1b3ed2){return _0x1b3ed2[_0xef83('0x22')](_0x3fa990)[_0xef83('0x23')](function(_0x1733a4){return _0x1733a4;});}return null;};}function removeEntity(_0x23ea1e,_0x17a8c0){return function(_0x31827b){if(_0x31827b){return _0x31827b[_0xef83('0x24')]()[_0xef83('0x23')](function(){var _0x295f32=_0x31827b[_0xef83('0x25')]({'plain':!![]});var _0x3f25de='CmContactHasItems';return db[_0xef83('0x26')]['destroy']({'where':{'type':_0x3f25de,'resourceId':_0x295f32['id']}})[_0xef83('0x23')](function(){return _0x31827b;});})[_0xef83('0x23')](function(){_0x23ea1e['status'](0xcc)[_0xef83('0x18')]();});}};}function handleEntityNotFound(_0x5f4929,_0x3d38e4){return function(_0x35c82c){if(!_0x35c82c){_0x5f4929[_0xef83('0x27')](0x194);}return _0x35c82c;};}function handleError(_0x26a228,_0x1b9b8a){_0x1b9b8a=_0x1b9b8a||0x1f4;return function(_0x429905){logger[_0xef83('0x28')](_0x429905[_0xef83('0x29')]);if(_0x429905[_0xef83('0x2a')]){delete _0x429905[_0xef83('0x2a')];}_0x26a228[_0xef83('0x17')](_0x1b9b8a)['send'](_0x429905);};}exports[_0xef83('0x2b')]=function(_0x4c17c5,_0x1caa3c){var _0x2e77df={},_0x49bb33={},_0x2587d0={'count':0x0,'rows':[]};var _0x321fdc=_[_0xef83('0x2c')](db[_0xef83('0x2d')][_0xef83('0x2e')],function(_0x78991e){return{'name':_0x78991e[_0xef83('0x2f')],'type':_0x78991e[_0xef83('0x30')][_0xef83('0x31')]};});_0x49bb33[_0xef83('0x32')]=_[_0xef83('0x2c')](_0x321fdc,_0xef83('0x2a'));_0x49bb33[_0xef83('0x33')]=_[_0xef83('0x34')](_0x4c17c5['query']);_0x49bb33[_0xef83('0x35')]=_['intersection'](_0x49bb33[_0xef83('0x32')],_0x49bb33[_0xef83('0x33')]);_0x2e77df['attributes']=_[_0xef83('0x36')](_0x49bb33[_0xef83('0x32')],qs['fields'](_0x4c17c5[_0xef83('0x33')][_0xef83('0x37')]));_0x2e77df['attributes']=_0x2e77df['attributes'][_0xef83('0x38')]?_0x2e77df[_0xef83('0x39')]:_0x49bb33[_0xef83('0x32')];if(!_0x4c17c5[_0xef83('0x33')][_0xef83('0x3a')](_0xef83('0x3b'))){_0x2e77df[_0xef83('0x1c')]=qs[_0xef83('0x1c')](_0x4c17c5['query']['limit']);_0x2e77df['offset']=qs['offset'](_0x4c17c5['query'][_0xef83('0x1a')]);}_0x2e77df[_0xef83('0x3c')]=qs[_0xef83('0x3d')](_0x4c17c5[_0xef83('0x33')]['sort']);_0x2e77df['where']=qs[_0xef83('0x35')](_[_0xef83('0x3e')](_0x4c17c5[_0xef83('0x33')],_0x49bb33[_0xef83('0x35')]),_0x321fdc);if(_0x4c17c5[_0xef83('0x33')][_0xef83('0x3f')]){_0x2e77df[_0xef83('0x40')]=_[_0xef83('0x41')](_0x2e77df[_0xef83('0x40')],{'$or':_[_0xef83('0x2c')](_0x321fdc,function(_0x5604f3){if(_0x5604f3[_0xef83('0x30')]!==_0xef83('0x42')){var _0x2f007a={};_0x2f007a[_0x5604f3[_0xef83('0x2a')]]={'$like':'%'+_0x4c17c5[_0xef83('0x33')]['filter']+'%'};return _0x2f007a;}})});}_0x2e77df=_[_0xef83('0x41')]({},_0x2e77df,_0x4c17c5['options']);var _0x1eacee={'where':_0x2e77df[_0xef83('0x40')]};return db[_0xef83('0x2d')][_0xef83('0x1d')](_0x1eacee)['then'](function(_0x33d139){_0x2587d0[_0xef83('0x1d')]=_0x33d139;if(_0x4c17c5[_0xef83('0x33')][_0xef83('0x43')]){_0x2e77df[_0xef83('0x44')]=[{'all':!![]}];}return db[_0xef83('0x2d')][_0xef83('0x45')](_0x2e77df);})[_0xef83('0x23')](function(_0x205456){_0x2587d0['rows']=_0x205456;return _0x2587d0;})[_0xef83('0x23')](respondWithFilteredResult(_0x1caa3c,_0x2e77df))[_0xef83('0x46')](handleError(_0x1caa3c,null));};exports[_0xef83('0x47')]=function(_0x308f46,_0x282603){var _0x5ef7ac={'raw':!![],'where':{'id':_0x308f46[_0xef83('0x48')]['id']}},_0x19f863={};_0x19f863[_0xef83('0x32')]=_[_0xef83('0x34')](db[_0xef83('0x2d')][_0xef83('0x2e')]);_0x19f863[_0xef83('0x33')]=_[_0xef83('0x34')](_0x308f46[_0xef83('0x33')]);_0x19f863[_0xef83('0x35')]=_['intersection'](_0x19f863[_0xef83('0x32')],_0x19f863[_0xef83('0x33')]);_0x5ef7ac[_0xef83('0x39')]=_[_0xef83('0x36')](_0x19f863['model'],qs[_0xef83('0x37')](_0x308f46[_0xef83('0x33')][_0xef83('0x37')]));_0x5ef7ac['attributes']=_0x5ef7ac[_0xef83('0x39')]['length']?_0x5ef7ac['attributes']:_0x19f863[_0xef83('0x32')];if(_0x308f46[_0xef83('0x33')][_0xef83('0x43')]){_0x5ef7ac['include']=[{'all':!![]}];}_0x5ef7ac=_[_0xef83('0x41')]({},_0x5ef7ac,_0x308f46[_0xef83('0x49')]);return db[_0xef83('0x2d')][_0xef83('0x4a')](_0x5ef7ac)[_0xef83('0x23')](handleEntityNotFound(_0x282603,null))[_0xef83('0x23')](respondWithResult(_0x282603,null))[_0xef83('0x46')](handleError(_0x282603,null));};exports['create']=function(_0x5dd705,_0x46320e){return db['CmContactHasItem'][_0xef83('0x4b')](_0x5dd705[_0xef83('0x4c')],{})['then'](function(_0x5c5543){var _0x3e09c0=_0x5dd705['user'][_0xef83('0x25')]({'plain':!![]});if(!_0x3e09c0)throw new Error(_0xef83('0x4d'));if(_0x3e09c0[_0xef83('0x4e')]==='user'){var _0x5f0b53=_0x5c5543[_0xef83('0x25')]({'plain':!![]});var _0x19c0f8=_0xef83('0x4f');return db[_0xef83('0x50')]['find']({'where':{'name':_0x19c0f8,'userProfileId':_0x3e09c0[_0xef83('0x51')]},'raw':!![]})[_0xef83('0x23')](function(_0x45641a){if(_0x45641a&&_0x45641a[_0xef83('0x52')]===0x0){return db[_0xef83('0x26')][_0xef83('0x4b')]({'name':_0x5f0b53[_0xef83('0x2a')],'resourceId':_0x5f0b53['id'],'type':_0x45641a[_0xef83('0x2a')],'sectionId':_0x45641a['id']},{})['then'](function(){return _0x5c5543;});}else{return _0x5c5543;}})['catch'](function(_0x1fe125){logger[_0xef83('0x28')](_0xef83('0x53'),_0x1fe125);throw _0x1fe125;});}return _0x5c5543;})['then'](respondWithResult(_0x46320e,0xc9))[_0xef83('0x46')](handleError(_0x46320e,null));};exports[_0xef83('0x22')]=function(_0x1b832e,_0x33485e){if(_0x1b832e[_0xef83('0x4c')]['id']){delete _0x1b832e[_0xef83('0x4c')]['id'];}return db[_0xef83('0x2d')]['find']({'where':{'id':_0x1b832e['params']['id']}})['then'](handleEntityNotFound(_0x33485e,null))[_0xef83('0x23')](saveUpdates(_0x1b832e['body'],null))[_0xef83('0x23')](respondWithResult(_0x33485e,null))[_0xef83('0x46')](handleError(_0x33485e,null));};exports[_0xef83('0x24')]=function(_0x12d770,_0x11645e){return db[_0xef83('0x2d')][_0xef83('0x4a')]({'where':{'id':_0x12d770[_0xef83('0x48')]['id']}})[_0xef83('0x23')](handleEntityNotFound(_0x11645e,null))[_0xef83('0x23')](removeEntity(_0x11645e,null))[_0xef83('0x46')](handleError(_0x11645e,null));}; \ No newline at end of file +var _0x14e8=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','sendStatus','error','stack','name','send','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','keys','find','catch','create','body','user'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x14e8,0xf9));var _0x814e=function(_0x10b707,_0x4e9955){_0x10b707=_0x10b707-0x0;var _0xdf7d54=_0x14e8[_0x10b707];return _0xdf7d54;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x814e('0x0'));var rp=require(_0x814e('0x1'));var moment=require(_0x814e('0x2'));var BPromise=require(_0x814e('0x3'));var Mustache=require(_0x814e('0x4'));var util=require('util');var path=require('path');var sox=require(_0x814e('0x5'));var csv=require('to-csv');var ejs=require(_0x814e('0x6'));var fs=require('fs');var fs_extra=require(_0x814e('0x7'));var _=require(_0x814e('0x8'));var squel=require('squel');var crypto=require(_0x814e('0x9'));var jsforce=require(_0x814e('0xa'));var deskjs=require(_0x814e('0xb'));var toCsv=require(_0x814e('0xc'));var querystring=require(_0x814e('0xd'));var Papa=require(_0x814e('0xe'));var Redis=require(_0x814e('0xf'));var authService=require(_0x814e('0x10'));var qs=require(_0x814e('0x11'));var as=require(_0x814e('0x12'));var hardwareService=require(_0x814e('0x13'));var logger=require(_0x814e('0x14'))('api');var utils=require(_0x814e('0x15'));var config=require(_0x814e('0x16'));var licenseUtil=require(_0x814e('0x17'));var db=require(_0x814e('0x18'))['db'];function respondWithStatusCode(_0x3a3f02,_0x5392f9){_0x5392f9=_0x5392f9||0xcc;return function(_0x5e9221){if(_0x5e9221){return _0x3a3f02['sendStatus'](_0x5392f9);}return _0x3a3f02['status'](_0x5392f9)[_0x814e('0x19')]();};}function respondWithResult(_0x38bfb2,_0xa90ebd){_0xa90ebd=_0xa90ebd||0xc8;return function(_0xa5d796){if(_0xa5d796){return _0x38bfb2['status'](_0xa90ebd)['json'](_0xa5d796);}};}function respondWithFilteredResult(_0x2b5d34,_0x2c924b){return function(_0x5be041){if(_0x5be041){var _0x498fd5=typeof _0x2c924b[_0x814e('0x1a')]===_0x814e('0x1b')&&typeof _0x2c924b[_0x814e('0x1c')]==='undefined';var _0x5e090c=_0x5be041['count'];var _0xb1eb98=_0x498fd5?0x0:_0x2c924b[_0x814e('0x1a')];var _0x5c2759=_0x498fd5?_0x5be041[_0x814e('0x1d')]:_0x2c924b[_0x814e('0x1a')]+_0x2c924b[_0x814e('0x1c')];var _0x3e0903;if(_0x5c2759>=_0x5e090c){_0x5c2759=_0x5e090c;_0x3e0903=0xc8;}else{_0x3e0903=0xce;}_0x2b5d34[_0x814e('0x1e')](_0x3e0903);return _0x2b5d34['set'](_0x814e('0x1f'),_0xb1eb98+'-'+_0x5c2759+'/'+_0x5e090c)[_0x814e('0x20')](_0x5be041);}return null;};}function patchUpdates(_0x474396){return function(_0x15e8e5){try{jsonpatch[_0x814e('0x21')](_0x15e8e5,_0x474396,!![]);}catch(_0x341cc1){return BPromise[_0x814e('0x22')](_0x341cc1);}return _0x15e8e5[_0x814e('0x23')]();};}function saveUpdates(_0x4c17e3,_0x3933bd){return function(_0xc8705d){if(_0xc8705d){return _0xc8705d[_0x814e('0x24')](_0x4c17e3)[_0x814e('0x25')](function(_0x52c930){return _0x52c930;});}return null;};}function removeEntity(_0x12ac11,_0x16b52f){return function(_0x3dd193){if(_0x3dd193){return _0x3dd193[_0x814e('0x26')]()[_0x814e('0x25')](function(){var _0x22259e=_0x3dd193[_0x814e('0x27')]({'plain':!![]});var _0x207c3b=_0x814e('0x28');return db[_0x814e('0x29')][_0x814e('0x26')]({'where':{'type':_0x207c3b,'resourceId':_0x22259e['id']}})[_0x814e('0x25')](function(){return _0x3dd193;});})[_0x814e('0x25')](function(){_0x12ac11['status'](0xcc)[_0x814e('0x19')]();});}};}function handleEntityNotFound(_0x2d0907,_0x38abd8){return function(_0x3e15f0){if(!_0x3e15f0){_0x2d0907[_0x814e('0x2a')](0x194);}return _0x3e15f0;};}function handleError(_0x41c300,_0x1ce710){_0x1ce710=_0x1ce710||0x1f4;return function(_0x141dc8){logger[_0x814e('0x2b')](_0x141dc8[_0x814e('0x2c')]);if(_0x141dc8[_0x814e('0x2d')]){delete _0x141dc8[_0x814e('0x2d')];}_0x41c300[_0x814e('0x1e')](_0x1ce710)[_0x814e('0x2e')](_0x141dc8);};}exports['index']=function(_0x38b6f6,_0x32f734){var _0x129d14={},_0x578d45={},_0xf8e71e={'count':0x0,'rows':[]};var _0x4e5d84=_[_0x814e('0x2f')](db[_0x814e('0x30')][_0x814e('0x31')],function(_0xaa10b7){return{'name':_0xaa10b7[_0x814e('0x32')],'type':_0xaa10b7[_0x814e('0x33')][_0x814e('0x34')]};});_0x578d45[_0x814e('0x35')]=_[_0x814e('0x2f')](_0x4e5d84,'name');_0x578d45[_0x814e('0x36')]=_['keys'](_0x38b6f6[_0x814e('0x36')]);_0x578d45['filters']=_['intersection'](_0x578d45[_0x814e('0x35')],_0x578d45[_0x814e('0x36')]);_0x129d14[_0x814e('0x37')]=_['intersection'](_0x578d45[_0x814e('0x35')],qs[_0x814e('0x38')](_0x38b6f6['query'][_0x814e('0x38')]));_0x129d14[_0x814e('0x37')]=_0x129d14[_0x814e('0x37')][_0x814e('0x39')]?_0x129d14[_0x814e('0x37')]:_0x578d45[_0x814e('0x35')];if(!_0x38b6f6[_0x814e('0x36')][_0x814e('0x3a')](_0x814e('0x3b'))){_0x129d14['limit']=qs[_0x814e('0x1c')](_0x38b6f6['query'][_0x814e('0x1c')]);_0x129d14[_0x814e('0x1a')]=qs[_0x814e('0x1a')](_0x38b6f6[_0x814e('0x36')]['offset']);}_0x129d14[_0x814e('0x3c')]=qs[_0x814e('0x3d')](_0x38b6f6['query'][_0x814e('0x3d')]);_0x129d14['where']=qs[_0x814e('0x3e')](_[_0x814e('0x3f')](_0x38b6f6[_0x814e('0x36')],_0x578d45[_0x814e('0x3e')]),_0x4e5d84);if(_0x38b6f6['query'][_0x814e('0x40')]){_0x129d14[_0x814e('0x41')]=_[_0x814e('0x42')](_0x129d14[_0x814e('0x41')],{'$or':_['map'](_0x4e5d84,function(_0x565eca){if(_0x565eca[_0x814e('0x33')]!==_0x814e('0x43')){var _0x47727b={};_0x47727b[_0x565eca[_0x814e('0x2d')]]={'$like':'%'+_0x38b6f6[_0x814e('0x36')][_0x814e('0x40')]+'%'};return _0x47727b;}})});}_0x129d14=_['merge']({},_0x129d14,_0x38b6f6['options']);var _0x5f1fa3={'where':_0x129d14[_0x814e('0x41')]};return db['CmContactHasItem'][_0x814e('0x1d')](_0x5f1fa3)[_0x814e('0x25')](function(_0x225966){_0xf8e71e['count']=_0x225966;if(_0x38b6f6[_0x814e('0x36')][_0x814e('0x44')]){_0x129d14[_0x814e('0x45')]=[{'all':!![]}];}return db[_0x814e('0x30')]['findAll'](_0x129d14);})[_0x814e('0x25')](function(_0x350ea6){_0xf8e71e[_0x814e('0x46')]=_0x350ea6;return _0xf8e71e;})[_0x814e('0x25')](respondWithFilteredResult(_0x32f734,_0x129d14))['catch'](handleError(_0x32f734,null));};exports[_0x814e('0x47')]=function(_0x113184,_0x1f5a26){var _0x4ad63b={'raw':!![],'where':{'id':_0x113184[_0x814e('0x48')]['id']}},_0xbcba5e={};_0xbcba5e[_0x814e('0x35')]=_[_0x814e('0x49')](db[_0x814e('0x30')][_0x814e('0x31')]);_0xbcba5e[_0x814e('0x36')]=_[_0x814e('0x49')](_0x113184['query']);_0xbcba5e[_0x814e('0x3e')]=_['intersection'](_0xbcba5e[_0x814e('0x35')],_0xbcba5e[_0x814e('0x36')]);_0x4ad63b[_0x814e('0x37')]=_['intersection'](_0xbcba5e['model'],qs[_0x814e('0x38')](_0x113184['query'][_0x814e('0x38')]));_0x4ad63b['attributes']=_0x4ad63b['attributes'][_0x814e('0x39')]?_0x4ad63b[_0x814e('0x37')]:_0xbcba5e[_0x814e('0x35')];if(_0x113184[_0x814e('0x36')]['includeAll']){_0x4ad63b[_0x814e('0x45')]=[{'all':!![]}];}_0x4ad63b=_[_0x814e('0x42')]({},_0x4ad63b,_0x113184['options']);return db['CmContactHasItem'][_0x814e('0x4a')](_0x4ad63b)['then'](handleEntityNotFound(_0x1f5a26,null))[_0x814e('0x25')](respondWithResult(_0x1f5a26,null))[_0x814e('0x4b')](handleError(_0x1f5a26,null));};exports['create']=function(_0xdf7b1b,_0x147779){return db[_0x814e('0x30')][_0x814e('0x4c')](_0xdf7b1b[_0x814e('0x4d')],{})[_0x814e('0x25')](function(_0xdf9a5){var _0xb953f7=_0xdf7b1b[_0x814e('0x4e')][_0x814e('0x27')]({'plain':!![]});if(!_0xb953f7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb953f7['role']==='user'){var _0x4ecc88=_0xdf9a5['get']({'plain':!![]});var _0x9d61ce=_0x814e('0x28');return db[_0x814e('0x4f')][_0x814e('0x4a')]({'where':{'name':_0x9d61ce,'userProfileId':_0xb953f7['userProfileId']},'raw':!![]})[_0x814e('0x25')](function(_0x59cbb9){if(_0x59cbb9&&_0x59cbb9[_0x814e('0x50')]===0x0){return db[_0x814e('0x29')][_0x814e('0x4c')]({'name':_0x4ecc88[_0x814e('0x2d')],'resourceId':_0x4ecc88['id'],'type':_0x59cbb9[_0x814e('0x2d')],'sectionId':_0x59cbb9['id']},{})[_0x814e('0x25')](function(){return _0xdf9a5;});}else{return _0xdf9a5;}})[_0x814e('0x4b')](function(_0x1477cf){logger[_0x814e('0x2b')](_0x814e('0x51'),_0x1477cf);throw _0x1477cf;});}return _0xdf9a5;})[_0x814e('0x25')](respondWithResult(_0x147779,0xc9))[_0x814e('0x4b')](handleError(_0x147779,null));};exports[_0x814e('0x24')]=function(_0x2e91c2,_0x429c81){if(_0x2e91c2[_0x814e('0x4d')]['id']){delete _0x2e91c2[_0x814e('0x4d')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x2e91c2['params']['id']}})[_0x814e('0x25')](handleEntityNotFound(_0x429c81,null))[_0x814e('0x25')](saveUpdates(_0x2e91c2[_0x814e('0x4d')],null))[_0x814e('0x25')](respondWithResult(_0x429c81,null))[_0x814e('0x4b')](handleError(_0x429c81,null));};exports[_0x814e('0x26')]=function(_0x55c51c,_0x4672a6){return db[_0x814e('0x30')][_0x814e('0x4a')]({'where':{'id':_0x55c51c[_0x814e('0x48')]['id']}})[_0x814e('0x25')](handleEntityNotFound(_0x4672a6,null))['then'](removeEntity(_0x4672a6,null))[_0x814e('0x4b')](handleError(_0x4672a6,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 38a5a4d..a752f7a 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 _0x3e57=['CmContactHasItem','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x3e57,0x1c8));var _0x73e5=function(_0x5d0609,_0x127562){_0x5d0609=_0x5d0609-0x0;var _0xaa3fd1=_0x3e57[_0x5d0609];return _0xaa3fd1;};'use strict';var _=require(_0x73e5('0x0'));var util=require(_0x73e5('0x1'));var logger=require(_0x73e5('0x2'))(_0x73e5('0x3'));var moment=require(_0x73e5('0x4'));var BPromise=require(_0x73e5('0x5'));var rp=require(_0x73e5('0x6'));var fs=require('fs');var path=require(_0x73e5('0x7'));var rimraf=require(_0x73e5('0x8'));var config=require(_0x73e5('0x9'));var attributes=require(_0x73e5('0xa'));module['exports']=function(_0x2a4272,_0x1a78e0){return _0x2a4272[_0x73e5('0xb')](_0x73e5('0xc'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eff=['request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','lodash','util','moment','bluebird'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x2eff,0xd4));var _0xf2ef=function(_0x8b885,_0x31740b){_0x8b885=_0x8b885-0x0;var _0x122eb8=_0x2eff[_0x8b885];return _0x122eb8;};'use strict';var _=require(_0xf2ef('0x0'));var util=require(_0xf2ef('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf2ef('0x2'));var BPromise=require(_0xf2ef('0x3'));var rp=require(_0xf2ef('0x4'));var fs=require('fs');var path=require(_0xf2ef('0x5'));var rimraf=require(_0xf2ef('0x6'));var config=require(_0xf2ef('0x7'));var attributes=require(_0xf2ef('0x8'));module[_0xf2ef('0x9')]=function(_0x390cd9,_0x138b75){return _0x390cd9['define'](_0xf2ef('0xa'),attributes,{'tableName':_0xf2ef('0xb'),'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 e100ce7..660e90f 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 _0x28e4=['rpc','../../config/environment','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x275241,_0x111605){var _0x465ec6=function(_0xc60c3d){while(--_0xc60c3d){_0x275241['push'](_0x275241['shift']());}};_0x465ec6(++_0x111605);}(_0x28e4,0x149));var _0x428e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28e4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x428e('0x0'));var util=require(_0x428e('0x1'));var moment=require(_0x428e('0x2'));var BPromise=require('bluebird');var rs=require(_0x428e('0x3'));var fs=require('fs');var Redis=require(_0x428e('0x4'));var db=require(_0x428e('0x5'))['db'];var utils=require(_0x428e('0x6'));var logger=require('../../config/logger')(_0x428e('0x7'));var config=require(_0x428e('0x8'));var jayson=require(_0x428e('0x9'));var client=jayson['client'][_0x428e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x146c87,_0x27af00,_0x1ff88f){return new BPromise(function(_0x24a68c,_0x2185d7){return client[_0x428e('0xb')](_0x146c87,_0x1ff88f)[_0x428e('0xc')](function(_0x2cab71){logger[_0x428e('0xd')](_0x428e('0xe'),_0x27af00,_0x428e('0xf'));logger[_0x428e('0x10')](_0x428e('0x11'),_0x27af00,'request\x20sent',JSON[_0x428e('0x12')](_0x2cab71));if(_0x2cab71[_0x428e('0x13')]){if(_0x2cab71[_0x428e('0x13')][_0x428e('0x14')]===0x1f4){logger[_0x428e('0x13')](_0x428e('0xe'),_0x27af00,_0x2cab71[_0x428e('0x13')][_0x428e('0x15')]);return _0x2185d7(_0x2cab71[_0x428e('0x13')][_0x428e('0x15')]);}logger[_0x428e('0x13')](_0x428e('0xe'),_0x27af00,_0x2cab71[_0x428e('0x13')][_0x428e('0x15')]);return _0x24a68c(_0x2cab71['error'][_0x428e('0x15')]);}else{logger[_0x428e('0xd')](_0x428e('0xe'),_0x27af00,_0x428e('0xf'));_0x24a68c(_0x2cab71[_0x428e('0x16')][_0x428e('0x15')]);}})[_0x428e('0x17')](function(_0x2f2c07){logger[_0x428e('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x27af00,_0x2f2c07);_0x2185d7(_0x2f2c07);});});} \ No newline at end of file +var _0xc010=['then','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','info','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x521849,_0x32c13c){var _0x355560=function(_0x1132cb){while(--_0x1132cb){_0x521849['push'](_0x521849['shift']());}};_0x355560(++_0x32c13c);}(_0xc010,0x107));var _0x0c01=function(_0x6587e3,_0x162c5d){_0x6587e3=_0x6587e3-0x0;var _0x56ca38=_0xc010[_0x6587e3];return _0x56ca38;};'use strict';var _=require(_0x0c01('0x0'));var util=require('util');var moment=require(_0x0c01('0x1'));var BPromise=require('bluebird');var rs=require(_0x0c01('0x2'));var fs=require('fs');var Redis=require(_0x0c01('0x3'));var db=require(_0x0c01('0x4'))['db'];var utils=require(_0x0c01('0x5'));var logger=require(_0x0c01('0x6'))('rpc');var config=require(_0x0c01('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0c01('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34efed,_0x530821,_0x503789){return new BPromise(function(_0x1f4562,_0x6c13fe){return client[_0x0c01('0x9')](_0x34efed,_0x503789)[_0x0c01('0xa')](function(_0xc0ecfc){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x530821,_0x0c01('0xb'));logger[_0x0c01('0xc')](_0x0c01('0xd'),_0x530821,_0x0c01('0xb'),JSON[_0x0c01('0xe')](_0xc0ecfc));if(_0xc0ecfc[_0x0c01('0xf')]){if(_0xc0ecfc[_0x0c01('0xf')][_0x0c01('0x10')]===0x1f4){logger[_0x0c01('0xf')](_0x0c01('0x11'),_0x530821,_0xc0ecfc[_0x0c01('0xf')]['message']);return _0x6c13fe(_0xc0ecfc[_0x0c01('0xf')][_0x0c01('0x12')]);}logger[_0x0c01('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x530821,_0xc0ecfc[_0x0c01('0xf')][_0x0c01('0x12')]);return _0x1f4562(_0xc0ecfc[_0x0c01('0xf')][_0x0c01('0x12')]);}else{logger[_0x0c01('0x13')](_0x0c01('0x11'),_0x530821,_0x0c01('0xb'));_0x1f4562(_0xc0ecfc['result']['message']);}})[_0x0c01('0x14')](function(_0x3f1674){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x530821,_0x3f1674);_0x6c13fe(_0x3f1674);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 6004b7d..da85d98 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 _0xc8af=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','/:id','post','put','delete','destroy','multer','path'];(function(_0x1fbddc,_0x1e2b06){var _0x2012f7=function(_0x18ccb4){while(--_0x18ccb4){_0x1fbddc['push'](_0x1fbddc['shift']());}};_0x2012f7(++_0x1e2b06);}(_0xc8af,0x1a2));var _0xfc8a=function(_0x57962a,_0x51bab7){_0x57962a=_0x57962a-0x0;var _0x3d2141=_0xc8af[_0x57962a];return _0x3d2141;};'use strict';var multer=require(_0xfc8a('0x0'));var util=require('util');var path=require(_0xfc8a('0x1'));var timeout=require(_0xfc8a('0x2'));var express=require('express');var router=express[_0xfc8a('0x3')]();var fs_extra=require(_0xfc8a('0x4'));var auth=require(_0xfc8a('0x5'));var interaction=require(_0xfc8a('0x6'));var config=require(_0xfc8a('0x7'));var controller=require(_0xfc8a('0x8'));router['get']('/',auth[_0xfc8a('0x9')](),controller['index']);router['get'](_0xfc8a('0xa'),auth[_0xfc8a('0x9')](),controller['show']);router[_0xfc8a('0xb')]('/',auth[_0xfc8a('0x9')](),controller['create']);router[_0xfc8a('0xc')](_0xfc8a('0xa'),auth[_0xfc8a('0x9')](),controller['update']);router[_0xfc8a('0xd')](_0xfc8a('0xa'),auth[_0xfc8a('0x9')](),controller[_0xfc8a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2d65=['../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2d65,0x1f2));var _0x52d6=function(_0x37c2cb,_0x596e66){_0x37c2cb=_0x37c2cb-0x0;var _0x338565=_0x2d65[_0x37c2cb];return _0x338565;};'use strict';var multer=require(_0x52d6('0x0'));var util=require(_0x52d6('0x1'));var path=require('path');var timeout=require(_0x52d6('0x2'));var express=require('express');var router=express[_0x52d6('0x3')]();var fs_extra=require(_0x52d6('0x4'));var auth=require(_0x52d6('0x5'));var interaction=require(_0x52d6('0x6'));var config=require('../../config/environment');var controller=require(_0x52d6('0x7'));router[_0x52d6('0x8')]('/',auth[_0x52d6('0x9')](),controller[_0x52d6('0xa')]);router[_0x52d6('0x8')]('/:id',auth[_0x52d6('0x9')](),controller[_0x52d6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x52d6('0xc')]);router[_0x52d6('0xd')](_0x52d6('0xe'),auth[_0x52d6('0x9')](),controller[_0x52d6('0xf')]);router[_0x52d6('0x10')](_0x52d6('0xe'),auth[_0x52d6('0x9')](),controller[_0x52d6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index cb2ec28..c0daa17 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 _0x59c4=['stringify','BOOLEAN','ENUM','voice','VIRTUAL','alias','STRING','setDataValue','getDataValue','name','TEXT','select','parse','values','isArray'];(function(_0x5e9d3a,_0x89a62f){var _0x525832=function(_0x14ab40){while(--_0x14ab40){_0x5e9d3a['push'](_0x5e9d3a['shift']());}};_0x525832(++_0x89a62f);}(_0x59c4,0x1b7));var _0x459c=function(_0x12f789,_0x21280e){_0x12f789=_0x12f789-0x0;var _0x2a955b=_0x59c4[_0x12f789];return _0x2a955b;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x459c('0x0')],'get':function(_0x3aa4bc){return this['getDataValue'](_0x459c('0x1'));}},'alias':{'type':Sequelize[_0x459c('0x2')],'allowNull':![],'set':function(_0x55fe72){this[_0x459c('0x3')](_0x459c('0x1'),_0x55fe72?_0x55fe72:this[_0x459c('0x4')](_0x459c('0x5')));}},'type':{'type':Sequelize[_0x459c('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0x459c('0x6')]('long'),'get':function(){if(this['getDataValue']('type')===_0x459c('0x7')){return JSON[_0x459c('0x8')](this[_0x459c('0x4')](_0x459c('0x9')));}else{return this[_0x459c('0x4')](_0x459c('0x9'));}},'set':function(_0x2ae07c){if(Array[_0x459c('0xa')](_0x2ae07c)){this[_0x459c('0x3')]('values',JSON[_0x459c('0xb')](_0x2ae07c));}else{this['setDataValue'](_0x459c('0x9'),_0x2ae07c);}}},'required':{'type':Sequelize[_0x459c('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x459c('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x459c('0xd')](_0x459c('0xe'))}}; \ No newline at end of file +var _0xf0ef=['exports','getDataValue','STRING','setDataValue','name','long','type','select','parse','isArray','values','stringify','BOOLEAN','ENUM'];(function(_0x4443ef,_0x35d09d){var _0x3ae432=function(_0xd16a47){while(--_0xd16a47){_0x4443ef['push'](_0x4443ef['shift']());}};_0x3ae432(++_0x35d09d);}(_0xf0ef,0x70));var _0xff0e=function(_0x4a5d4f,_0x1fbaf6){_0x4a5d4f=_0x4a5d4f-0x0;var _0x18f13c=_0xf0ef[_0x4a5d4f];return _0x18f13c;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xff0e('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xfceaac){return this[_0xff0e('0x1')]('alias');}},'alias':{'type':Sequelize[_0xff0e('0x2')],'allowNull':![],'set':function(_0x26988b){this[_0xff0e('0x3')]('alias',_0x26988b?_0x26988b:this['getDataValue'](_0xff0e('0x4')));}},'type':{'type':Sequelize[_0xff0e('0x2')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xff0e('0x5')),'get':function(){if(this[_0xff0e('0x1')](_0xff0e('0x6'))===_0xff0e('0x7')){return JSON[_0xff0e('0x8')](this[_0xff0e('0x1')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0x18cb16){if(Array[_0xff0e('0x9')](_0x18cb16)){this['setDataValue'](_0xff0e('0xa'),JSON[_0xff0e('0xb')](_0x18cb16));}else{this['setDataValue'](_0xff0e('0xa'),_0x18cb16);}}},'required':{'type':Sequelize[_0xff0e('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xff0e('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xff0e('0xd')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 2c080d9..158d093 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 _0x214a=['index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','nolimit','limit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','create','sequelize','transaction','TEXT','text','Sequelize','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x2eb299,_0x49a841){var _0x16eae3=function(_0x4040df){while(--_0x4040df){_0x2eb299['push'](_0x2eb299['shift']());}};_0x16eae3(++_0x49a841);}(_0x214a,0x1d3));var _0xa214=function(_0x29b6ee,_0x2d72a1){_0x29b6ee=_0x29b6ee-0x0;var _0x396001=_0x214a[_0x29b6ee];return _0x396001;};'use strict';var emlformat=require(_0xa214('0x0'));var rimraf=require(_0xa214('0x1'));var zipdir=require(_0xa214('0x2'));var jsonpatch=require(_0xa214('0x3'));var rp=require(_0xa214('0x4'));var moment=require('moment');var BPromise=require(_0xa214('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa214('0x6'));var sox=require(_0xa214('0x7'));var csv=require('to-csv');var ejs=require(_0xa214('0x8'));var fs=require('fs');var fs_extra=require(_0xa214('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa214('0xa'));var jsforce=require(_0xa214('0xb'));var deskjs=require(_0xa214('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa214('0xd'));var Papa=require(_0xa214('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa214('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa214('0x10'));var utils=require(_0xa214('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa214('0x12'))['db'];function respondWithStatusCode(_0x2e01cf,_0xf4d6f){_0xf4d6f=_0xf4d6f||0xcc;return function(_0x1491fc){if(_0x1491fc){return _0x2e01cf[_0xa214('0x13')](_0xf4d6f);}return _0x2e01cf[_0xa214('0x14')](_0xf4d6f)['end']();};}function respondWithResult(_0x2f9f6a,_0x5e3e2e){_0x5e3e2e=_0x5e3e2e||0xc8;return function(_0x436a84){if(_0x436a84){return _0x2f9f6a[_0xa214('0x14')](_0x5e3e2e)['json'](_0x436a84);}};}function respondWithFilteredResult(_0x105747,_0x304570){return function(_0x38de27){if(_0x38de27){var _0x3779c4=typeof _0x304570[_0xa214('0x15')]===_0xa214('0x16')&&typeof _0x304570['limit']===_0xa214('0x16');var _0x9a439a=_0x38de27[_0xa214('0x17')];var _0x1b38fa=_0x3779c4?0x0:_0x304570[_0xa214('0x15')];var _0x2435c0=_0x3779c4?_0x38de27[_0xa214('0x17')]:_0x304570[_0xa214('0x15')]+_0x304570['limit'];var _0x32037f;if(_0x2435c0>=_0x9a439a){_0x2435c0=_0x9a439a;_0x32037f=0xc8;}else{_0x32037f=0xce;}_0x105747[_0xa214('0x14')](_0x32037f);return _0x105747[_0xa214('0x18')](_0xa214('0x19'),_0x1b38fa+'-'+_0x2435c0+'/'+_0x9a439a)[_0xa214('0x1a')](_0x38de27);}return null;};}function patchUpdates(_0x5ae2ff){return function(_0x229540){try{jsonpatch['apply'](_0x229540,_0x5ae2ff,!![]);}catch(_0x1dbaa6){return BPromise[_0xa214('0x1b')](_0x1dbaa6);}return _0x229540[_0xa214('0x1c')]();};}function saveUpdates(_0x125711,_0x56d66d){return function(_0x407e19){if(_0x407e19){return _0x407e19[_0xa214('0x1d')](_0x125711)[_0xa214('0x1e')](function(_0x298e3a){return _0x298e3a;});}return null;};}function removeEntity(_0x1a5302,_0x39271a){return function(_0x5c3238){if(_0x5c3238){return _0x5c3238[_0xa214('0x1f')]()[_0xa214('0x1e')](function(){_0x1a5302[_0xa214('0x14')](0xcc)[_0xa214('0x20')]();});}};}function handleEntityNotFound(_0x3c6b88,_0x13684a){return function(_0x408abe){if(!_0x408abe){_0x3c6b88[_0xa214('0x13')](0x194);}return _0x408abe;};}function handleError(_0x41a0e9,_0x126e44){_0x126e44=_0x126e44||0x1f4;return function(_0x4c64fb){logger[_0xa214('0x21')](_0x4c64fb[_0xa214('0x22')]);if(_0x4c64fb[_0xa214('0x23')]){delete _0x4c64fb['name'];}_0x41a0e9[_0xa214('0x14')](_0x126e44)[_0xa214('0x24')](_0x4c64fb);};}exports[_0xa214('0x25')]=function(_0x21af83,_0x1f2b84){var _0x9e9543={},_0x570259={},_0x2a82ce={'count':0x0,'rows':[]};var _0x49f8aa=_[_0xa214('0x26')](db[_0xa214('0x27')][_0xa214('0x28')],function(_0x3b35f7){return{'name':_0x3b35f7[_0xa214('0x29')],'type':_0x3b35f7[_0xa214('0x2a')][_0xa214('0x2b')]};});_0x570259[_0xa214('0x2c')]=_[_0xa214('0x2d')](_[_0xa214('0x26')](_0x49f8aa,'name'),['name']);_0x570259[_0xa214('0x2e')]=_[_0xa214('0x2f')](_0x21af83[_0xa214('0x2e')]);_0x570259['filters']=_[_0xa214('0x30')](_0x570259['model'],_0x570259['query']);_0x9e9543[_0xa214('0x31')]=_[_0xa214('0x30')](_0x570259['model'],qs[_0xa214('0x32')](_0x21af83['query'][_0xa214('0x32')]));_0x9e9543[_0xa214('0x31')]=_0x9e9543[_0xa214('0x31')][_0xa214('0x33')]?_0x9e9543[_0xa214('0x31')]:_0x570259[_0xa214('0x2c')];if(!_0x21af83[_0xa214('0x2e')]['hasOwnProperty'](_0xa214('0x34'))){_0x9e9543[_0xa214('0x35')]=qs[_0xa214('0x35')](_0x21af83[_0xa214('0x2e')][_0xa214('0x35')]);_0x9e9543[_0xa214('0x15')]=qs[_0xa214('0x15')](_0x21af83[_0xa214('0x2e')][_0xa214('0x15')]);}_0x9e9543['order']=qs[_0xa214('0x36')](_0x21af83[_0xa214('0x2e')][_0xa214('0x36')]);_0x9e9543['where']=qs[_0xa214('0x37')](_[_0xa214('0x38')](_0x21af83[_0xa214('0x2e')],_0x570259[_0xa214('0x37')]),_0x49f8aa);if(_0x21af83[_0xa214('0x2e')][_0xa214('0x39')]){_0x9e9543['where']=_[_0xa214('0x3a')](_0x9e9543[_0xa214('0x3b')],{'$or':_[_0xa214('0x26')](_0x49f8aa,function(_0x22977e){if(_0x22977e[_0xa214('0x2a')]!==_0xa214('0x3c')){var _0x2b299f={};_0x2b299f[_0x22977e[_0xa214('0x23')]]={'$like':'%'+_0x21af83['query'][_0xa214('0x39')]+'%'};return _0x2b299f;}})});}_0x9e9543=_[_0xa214('0x3a')]({},_0x9e9543,_0x21af83[_0xa214('0x3d')]);var _0x5eadb7={'where':_0x9e9543[_0xa214('0x3b')]};return db[_0xa214('0x27')][_0xa214('0x17')](_0x5eadb7)[_0xa214('0x1e')](function(_0x240579){_0x2a82ce['count']=_0x240579;if(_0x21af83[_0xa214('0x2e')][_0xa214('0x3e')]){_0x9e9543[_0xa214('0x3f')]=[{'all':!![]}];}return db[_0xa214('0x27')][_0xa214('0x40')](_0x9e9543);})[_0xa214('0x1e')](function(_0x1efb7d){_0x2a82ce[_0xa214('0x41')]=_0x1efb7d;return _0x2a82ce;})[_0xa214('0x1e')](respondWithFilteredResult(_0x1f2b84,_0x9e9543))[_0xa214('0x42')](handleError(_0x1f2b84,null));};exports['show']=function(_0x21466c,_0x255299){var _0x183933={'raw':!![],'where':{'id':_0x21466c[_0xa214('0x43')]['id']}},_0x25ad35={};_0x25ad35[_0xa214('0x2c')]=_[_0xa214('0x2f')](db['CmCustomField'][_0xa214('0x28')]);_0x25ad35[_0xa214('0x2e')]=_[_0xa214('0x2f')](_0x21466c['query']);_0x25ad35[_0xa214('0x37')]=_[_0xa214('0x30')](_0x25ad35['model'],_0x25ad35[_0xa214('0x2e')]);_0x183933[_0xa214('0x31')]=_[_0xa214('0x30')](_0x25ad35['model'],qs[_0xa214('0x32')](_0x21466c['query'][_0xa214('0x32')]));_0x183933[_0xa214('0x31')]=_0x183933[_0xa214('0x31')][_0xa214('0x33')]?_0x183933['attributes']:_0x25ad35['model'];if(_0x21466c[_0xa214('0x2e')][_0xa214('0x3e')]){_0x183933[_0xa214('0x3f')]=[{'all':!![]}];}_0x183933=_[_0xa214('0x3a')]({},_0x183933,_0x21466c['options']);return db['CmCustomField'][_0xa214('0x44')](_0x183933)[_0xa214('0x1e')](handleEntityNotFound(_0x255299,null))[_0xa214('0x1e')](respondWithResult(_0x255299,null))[_0xa214('0x42')](handleError(_0x255299,null));};exports[_0xa214('0x1d')]=function(_0x485e8c,_0x5ad70b){if(_0x485e8c[_0xa214('0x45')]['id']){delete _0x485e8c[_0xa214('0x45')]['id'];}return db[_0xa214('0x27')]['find']({'where':{'id':_0x485e8c['params']['id']}})[_0xa214('0x1e')](handleEntityNotFound(_0x5ad70b,null))[_0xa214('0x1e')](saveUpdates(_0x485e8c[_0xa214('0x45')],null))['then'](respondWithResult(_0x5ad70b,null))[_0xa214('0x42')](handleError(_0x5ad70b,null));};exports[_0xa214('0x1f')]=function(_0x531cb4,_0x487099){return db['CmCustomField'][_0xa214('0x44')]({'where':{'id':_0x531cb4[_0xa214('0x43')]['id']}})[_0xa214('0x1e')](handleEntityNotFound(_0x487099,null))[_0xa214('0x1e')](removeEntity(_0x487099,null))[_0xa214('0x42')](handleError(_0x487099,null));};exports[_0xa214('0x46')]=function(_0x1f323e,_0x55ee66){var _0x502c1b;return db[_0xa214('0x47')][_0xa214('0x48')](function(_0x30ee91){return db[_0xa214('0x27')][_0xa214('0x46')](_0x1f323e[_0xa214('0x45')],{'transaction':_0x30ee91})['then'](function(_0xe7fa5c){_0x502c1b=_0xe7fa5c;var _0x4aef57={'type':db['Sequelize'][_0xa214('0x49')],'transaction':_0x30ee91};switch(_0x1f323e[_0xa214('0x45')]['type']){case _0xa214('0x4a'):_0x4aef57[_0xa214('0x2a')]=db[_0xa214('0x4b')]['TEXT'];break;case _0xa214('0x4c'):_0x4aef57[_0xa214('0x2a')]=db[_0xa214('0x4b')]['INTEGER'];break;case _0xa214('0x4d'):_0x4aef57['type']=db[_0xa214('0x4b')][_0xa214('0x4e')];_0x4aef57[_0xa214('0x4f')]=![];break;default:}return db[_0xa214('0x47')][_0xa214('0x50')][_0xa214('0x51')](_0xa214('0x52'),util['format'](_0xa214('0x53'),_0x502c1b['id']),_0x4aef57);})['then'](function(){return _0x502c1b;});})['then'](respondWithResult(_0x55ee66,0xc9))[_0xa214('0x42')](handleError(_0x55ee66,null));}; \ No newline at end of file +var _0xf1e7=['cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','error','name','map','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','body','transaction','create','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format'];(function(_0x5615fc,_0x42d7b5){var _0x3b3b3f=function(_0x31c586){while(--_0x31c586){_0x5615fc['push'](_0x5615fc['shift']());}};_0x3b3b3f(++_0x42d7b5);}(_0xf1e7,0x109));var _0x7f1e=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xf1e7[_0x344a3f];return _0x264712;};'use strict';var emlformat=require(_0x7f1e('0x0'));var rimraf=require(_0x7f1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f1e('0x2'));var rp=require(_0x7f1e('0x3'));var moment=require(_0x7f1e('0x4'));var BPromise=require(_0x7f1e('0x5'));var Mustache=require(_0x7f1e('0x6'));var util=require(_0x7f1e('0x7'));var path=require(_0x7f1e('0x8'));var sox=require('sox');var csv=require(_0x7f1e('0x9'));var ejs=require(_0x7f1e('0xa'));var fs=require('fs');var fs_extra=require(_0x7f1e('0xb'));var _=require(_0x7f1e('0xc'));var squel=require('squel');var crypto=require(_0x7f1e('0xd'));var jsforce=require(_0x7f1e('0xe'));var deskjs=require(_0x7f1e('0xf'));var toCsv=require(_0x7f1e('0x9'));var querystring=require(_0x7f1e('0x10'));var Papa=require(_0x7f1e('0x11'));var Redis=require(_0x7f1e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7f1e('0x13'));var as=require(_0x7f1e('0x14'));var hardwareService=require(_0x7f1e('0x15'));var logger=require(_0x7f1e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7f1e('0x17'));var licenseUtil=require(_0x7f1e('0x18'));var db=require(_0x7f1e('0x19'))['db'];function respondWithStatusCode(_0x4294ca,_0x18b918){_0x18b918=_0x18b918||0xcc;return function(_0x9288e3){if(_0x9288e3){return _0x4294ca[_0x7f1e('0x1a')](_0x18b918);}return _0x4294ca[_0x7f1e('0x1b')](_0x18b918)[_0x7f1e('0x1c')]();};}function respondWithResult(_0x4e3c35,_0x23c291){_0x23c291=_0x23c291||0xc8;return function(_0x4dbc55){if(_0x4dbc55){return _0x4e3c35[_0x7f1e('0x1b')](_0x23c291)[_0x7f1e('0x1d')](_0x4dbc55);}};}function respondWithFilteredResult(_0x5d043a,_0x3c9a61){return function(_0x1f1704){if(_0x1f1704){var _0x45ca67=typeof _0x3c9a61[_0x7f1e('0x1e')]===_0x7f1e('0x1f')&&typeof _0x3c9a61[_0x7f1e('0x20')]===_0x7f1e('0x1f');var _0x44e953=_0x1f1704[_0x7f1e('0x21')];var _0x18ae26=_0x45ca67?0x0:_0x3c9a61[_0x7f1e('0x1e')];var _0x81bd93=_0x45ca67?_0x1f1704[_0x7f1e('0x21')]:_0x3c9a61[_0x7f1e('0x1e')]+_0x3c9a61[_0x7f1e('0x20')];var _0x308cbc;if(_0x81bd93>=_0x44e953){_0x81bd93=_0x44e953;_0x308cbc=0xc8;}else{_0x308cbc=0xce;}_0x5d043a[_0x7f1e('0x1b')](_0x308cbc);return _0x5d043a[_0x7f1e('0x22')]('Content-Range',_0x18ae26+'-'+_0x81bd93+'/'+_0x44e953)[_0x7f1e('0x1d')](_0x1f1704);}return null;};}function patchUpdates(_0x5c2d85){return function(_0x207c4e){try{jsonpatch[_0x7f1e('0x23')](_0x207c4e,_0x5c2d85,!![]);}catch(_0x39ca9f){return BPromise[_0x7f1e('0x24')](_0x39ca9f);}return _0x207c4e['save']();};}function saveUpdates(_0x525aa2,_0x32fac6){return function(_0x1ea0b7){if(_0x1ea0b7){return _0x1ea0b7[_0x7f1e('0x25')](_0x525aa2)['then'](function(_0x8010f3){return _0x8010f3;});}return null;};}function removeEntity(_0x2c3fba,_0x5391ac){return function(_0x4df1ec){if(_0x4df1ec){return _0x4df1ec[_0x7f1e('0x26')]()[_0x7f1e('0x27')](function(){_0x2c3fba[_0x7f1e('0x1b')](0xcc)[_0x7f1e('0x1c')]();});}};}function handleEntityNotFound(_0x157e84,_0x53c536){return function(_0x2ed9dd){if(!_0x2ed9dd){_0x157e84[_0x7f1e('0x1a')](0x194);}return _0x2ed9dd;};}function handleError(_0xb275e5,_0x3423b5){_0x3423b5=_0x3423b5||0x1f4;return function(_0x2f9421){logger[_0x7f1e('0x28')](_0x2f9421['stack']);if(_0x2f9421[_0x7f1e('0x29')]){delete _0x2f9421['name'];}_0xb275e5['status'](_0x3423b5)['send'](_0x2f9421);};}exports['index']=function(_0x44fdb2,_0x157dd0){var _0x59470d={},_0x568bfe={},_0x16b946={'count':0x0,'rows':[]};var _0x1c0c08=_[_0x7f1e('0x2a')](db[_0x7f1e('0x2b')][_0x7f1e('0x2c')],function(_0x2ff565){return{'name':_0x2ff565[_0x7f1e('0x2d')],'type':_0x2ff565['type'][_0x7f1e('0x2e')]};});_0x568bfe[_0x7f1e('0x2f')]=_[_0x7f1e('0x30')](_[_0x7f1e('0x2a')](_0x1c0c08,'name'),[_0x7f1e('0x29')]);_0x568bfe[_0x7f1e('0x31')]=_[_0x7f1e('0x32')](_0x44fdb2[_0x7f1e('0x31')]);_0x568bfe[_0x7f1e('0x33')]=_['intersection'](_0x568bfe[_0x7f1e('0x2f')],_0x568bfe[_0x7f1e('0x31')]);_0x59470d[_0x7f1e('0x34')]=_[_0x7f1e('0x35')](_0x568bfe['model'],qs['fields'](_0x44fdb2[_0x7f1e('0x31')][_0x7f1e('0x36')]));_0x59470d[_0x7f1e('0x34')]=_0x59470d[_0x7f1e('0x34')][_0x7f1e('0x37')]?_0x59470d['attributes']:_0x568bfe[_0x7f1e('0x2f')];if(!_0x44fdb2['query'][_0x7f1e('0x38')](_0x7f1e('0x39'))){_0x59470d[_0x7f1e('0x20')]=qs[_0x7f1e('0x20')](_0x44fdb2['query'][_0x7f1e('0x20')]);_0x59470d[_0x7f1e('0x1e')]=qs[_0x7f1e('0x1e')](_0x44fdb2[_0x7f1e('0x31')][_0x7f1e('0x1e')]);}_0x59470d[_0x7f1e('0x3a')]=qs[_0x7f1e('0x3b')](_0x44fdb2[_0x7f1e('0x31')][_0x7f1e('0x3b')]);_0x59470d[_0x7f1e('0x3c')]=qs[_0x7f1e('0x33')](_['pick'](_0x44fdb2['query'],_0x568bfe[_0x7f1e('0x33')]),_0x1c0c08);if(_0x44fdb2['query'][_0x7f1e('0x3d')]){_0x59470d[_0x7f1e('0x3c')]=_[_0x7f1e('0x3e')](_0x59470d['where'],{'$or':_[_0x7f1e('0x2a')](_0x1c0c08,function(_0x156805){if(_0x156805[_0x7f1e('0x3f')]!=='VIRTUAL'){var _0x9990cf={};_0x9990cf[_0x156805[_0x7f1e('0x29')]]={'$like':'%'+_0x44fdb2[_0x7f1e('0x31')]['filter']+'%'};return _0x9990cf;}})});}_0x59470d=_[_0x7f1e('0x3e')]({},_0x59470d,_0x44fdb2[_0x7f1e('0x40')]);var _0x10c360={'where':_0x59470d[_0x7f1e('0x3c')]};return db[_0x7f1e('0x2b')][_0x7f1e('0x21')](_0x10c360)[_0x7f1e('0x27')](function(_0x22c0bf){_0x16b946[_0x7f1e('0x21')]=_0x22c0bf;if(_0x44fdb2[_0x7f1e('0x31')][_0x7f1e('0x41')]){_0x59470d[_0x7f1e('0x42')]=[{'all':!![]}];}return db[_0x7f1e('0x2b')][_0x7f1e('0x43')](_0x59470d);})[_0x7f1e('0x27')](function(_0x595fc1){_0x16b946[_0x7f1e('0x44')]=_0x595fc1;return _0x16b946;})['then'](respondWithFilteredResult(_0x157dd0,_0x59470d))['catch'](handleError(_0x157dd0,null));};exports[_0x7f1e('0x45')]=function(_0x52e5e4,_0x12645b){var _0x38dcbc={'raw':!![],'where':{'id':_0x52e5e4[_0x7f1e('0x46')]['id']}},_0x4b6ef0={};_0x4b6ef0['model']=_[_0x7f1e('0x32')](db[_0x7f1e('0x2b')][_0x7f1e('0x2c')]);_0x4b6ef0['query']=_[_0x7f1e('0x32')](_0x52e5e4[_0x7f1e('0x31')]);_0x4b6ef0['filters']=_[_0x7f1e('0x35')](_0x4b6ef0[_0x7f1e('0x2f')],_0x4b6ef0[_0x7f1e('0x31')]);_0x38dcbc[_0x7f1e('0x34')]=_['intersection'](_0x4b6ef0[_0x7f1e('0x2f')],qs[_0x7f1e('0x36')](_0x52e5e4[_0x7f1e('0x31')][_0x7f1e('0x36')]));_0x38dcbc[_0x7f1e('0x34')]=_0x38dcbc['attributes'][_0x7f1e('0x37')]?_0x38dcbc['attributes']:_0x4b6ef0[_0x7f1e('0x2f')];if(_0x52e5e4[_0x7f1e('0x31')][_0x7f1e('0x41')]){_0x38dcbc['include']=[{'all':!![]}];}_0x38dcbc=_[_0x7f1e('0x3e')]({},_0x38dcbc,_0x52e5e4['options']);return db['CmCustomField'][_0x7f1e('0x47')](_0x38dcbc)[_0x7f1e('0x27')](handleEntityNotFound(_0x12645b,null))[_0x7f1e('0x27')](respondWithResult(_0x12645b,null))[_0x7f1e('0x48')](handleError(_0x12645b,null));};exports[_0x7f1e('0x25')]=function(_0xd1c772,_0x418f14){if(_0xd1c772[_0x7f1e('0x49')]['id']){delete _0xd1c772[_0x7f1e('0x49')]['id'];}return db['CmCustomField'][_0x7f1e('0x47')]({'where':{'id':_0xd1c772['params']['id']}})[_0x7f1e('0x27')](handleEntityNotFound(_0x418f14,null))[_0x7f1e('0x27')](saveUpdates(_0xd1c772[_0x7f1e('0x49')],null))[_0x7f1e('0x27')](respondWithResult(_0x418f14,null))[_0x7f1e('0x48')](handleError(_0x418f14,null));};exports[_0x7f1e('0x26')]=function(_0xfa6658,_0x2f50ac){return db[_0x7f1e('0x2b')]['find']({'where':{'id':_0xfa6658['params']['id']}})['then'](handleEntityNotFound(_0x2f50ac,null))[_0x7f1e('0x27')](removeEntity(_0x2f50ac,null))['catch'](handleError(_0x2f50ac,null));};exports['create']=function(_0x33434f,_0x2ac144){var _0x4fa8be;return db['sequelize'][_0x7f1e('0x4a')](function(_0x3c160e){return db[_0x7f1e('0x2b')][_0x7f1e('0x4b')](_0x33434f[_0x7f1e('0x49')],{'transaction':_0x3c160e})[_0x7f1e('0x27')](function(_0x478340){_0x4fa8be=_0x478340;var _0xe61a0d={'type':db[_0x7f1e('0x4c')][_0x7f1e('0x4d')],'transaction':_0x3c160e};switch(_0x33434f[_0x7f1e('0x49')][_0x7f1e('0x3f')]){case _0x7f1e('0x4e'):_0xe61a0d[_0x7f1e('0x3f')]=db[_0x7f1e('0x4c')]['TEXT'];break;case'number':_0xe61a0d[_0x7f1e('0x3f')]=db[_0x7f1e('0x4c')][_0x7f1e('0x4f')];break;case _0x7f1e('0x50'):_0xe61a0d[_0x7f1e('0x3f')]=db[_0x7f1e('0x4c')][_0x7f1e('0x51')];_0xe61a0d[_0x7f1e('0x52')]=![];break;default:}return db['sequelize'][_0x7f1e('0x53')][_0x7f1e('0x54')](_0x7f1e('0x55'),util[_0x7f1e('0x56')](_0x7f1e('0x57'),_0x4fa8be['id']),_0xe61a0d);})[_0x7f1e('0x27')](function(){return _0x4fa8be;});})[_0x7f1e('0x27')](respondWithResult(_0x2ac144,0xc9))['catch'](handleError(_0x2ac144,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 543d18b..af85b05 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 _0x67d1=['CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','path','exports','define'];(function(_0x3f7dd5,_0x578780){var _0x27c097=function(_0x23ddfb){while(--_0x23ddfb){_0x3f7dd5['push'](_0x3f7dd5['shift']());}};_0x27c097(++_0x578780);}(_0x67d1,0x70));var _0x167d=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x67d1[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x167d('0x0'));var util=require(_0x167d('0x1'));var logger=require(_0x167d('0x2'))(_0x167d('0x3'));var moment=require(_0x167d('0x4'));var BPromise=require(_0x167d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x167d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x167d('0x7')]=function(_0x3bb2ca,_0x29814a){return _0x3bb2ca[_0x167d('0x8')](_0x167d('0x9'),attributes,{'tableName':_0x167d('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bd5=['cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','define'];(function(_0x5179c6,_0x299926){var _0x225e1e=function(_0x232661){while(--_0x232661){_0x5179c6['push'](_0x5179c6['shift']());}};_0x225e1e(++_0x299926);}(_0x5bd5,0x121));var _0x55bd=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0x5bd5[_0x3d9b04];return _0x557936;};'use strict';var _=require('lodash');var util=require(_0x55bd('0x0'));var logger=require(_0x55bd('0x1'))(_0x55bd('0x2'));var moment=require(_0x55bd('0x3'));var BPromise=require(_0x55bd('0x4'));var rp=require(_0x55bd('0x5'));var fs=require('fs');var path=require(_0x55bd('0x6'));var rimraf=require(_0x55bd('0x7'));var config=require(_0x55bd('0x8'));var attributes=require(_0x55bd('0x9'));module['exports']=function(_0xd571ab,_0x350494){return _0xd571ab[_0x55bd('0xa')]('CmCustomField',attributes,{'tableName':_0x55bd('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index da0e91f..728e854 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 _0xb1c5=['message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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'];(function(_0x449452,_0x41437a){var _0x3299d3=function(_0x50dc21){while(--_0x50dc21){_0x449452['push'](_0x449452['shift']());}};_0x3299d3(++_0x41437a);}(_0xb1c5,0x182));var _0x5b1c=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xb1c5[_0x599f41];return _0x2e4d58;};'use strict';var _=require('lodash');var util=require(_0x5b1c('0x0'));var moment=require('moment');var BPromise=require(_0x5b1c('0x1'));var rs=require(_0x5b1c('0x2'));var fs=require('fs');var Redis=require(_0x5b1c('0x3'));var db=require(_0x5b1c('0x4'))['db'];var utils=require(_0x5b1c('0x5'));var logger=require(_0x5b1c('0x6'))(_0x5b1c('0x7'));var config=require(_0x5b1c('0x8'));var jayson=require(_0x5b1c('0x9'));var client=jayson[_0x5b1c('0xa')][_0x5b1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33b28f,_0x285398,_0x52beab){return new BPromise(function(_0x55a896,_0x34808b){return client[_0x5b1c('0xc')](_0x33b28f,_0x52beab)[_0x5b1c('0xd')](function(_0x35e8dd){logger[_0x5b1c('0xe')](_0x5b1c('0xf'),_0x285398,_0x5b1c('0x10'));logger[_0x5b1c('0x11')](_0x5b1c('0x12'),_0x285398,_0x5b1c('0x10'),JSON[_0x5b1c('0x13')](_0x35e8dd));if(_0x35e8dd['error']){if(_0x35e8dd[_0x5b1c('0x14')][_0x5b1c('0x15')]===0x1f4){logger[_0x5b1c('0x14')](_0x5b1c('0xf'),_0x285398,_0x35e8dd[_0x5b1c('0x14')][_0x5b1c('0x16')]);return _0x34808b(_0x35e8dd[_0x5b1c('0x14')][_0x5b1c('0x16')]);}logger['error'](_0x5b1c('0xf'),_0x285398,_0x35e8dd[_0x5b1c('0x14')][_0x5b1c('0x16')]);return _0x55a896(_0x35e8dd[_0x5b1c('0x14')]['message']);}else{logger['info'](_0x5b1c('0xf'),_0x285398,_0x5b1c('0x10'));_0x55a896(_0x35e8dd['result'][_0x5b1c('0x16')]);}})[_0x5b1c('0x17')](function(_0x2d2a0c){logger[_0x5b1c('0x14')](_0x5b1c('0xf'),_0x285398,_0x2d2a0c);_0x34808b(_0x2d2a0c);});});} \ No newline at end of file +var _0x81e8=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','CmCustomField,\x20%s,\x20%s','message','result','catch'];(function(_0x4dcac4,_0x10e48a){var _0x2a238d=function(_0x25c6fc){while(--_0x25c6fc){_0x4dcac4['push'](_0x4dcac4['shift']());}};_0x2a238d(++_0x10e48a);}(_0x81e8,0x168));var _0x881e=function(_0x83420c,_0x50fd91){_0x83420c=_0x83420c-0x0;var _0x1057d7=_0x81e8[_0x83420c];return _0x1057d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x881e('0x0'));var BPromise=require(_0x881e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x881e('0x2'));var db=require(_0x881e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x881e('0x4'))('rpc');var config=require(_0x881e('0x5'));var jayson=require(_0x881e('0x6'));var client=jayson[_0x881e('0x7')][_0x881e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x318dcd,_0x474273,_0x950463){return new BPromise(function(_0xd3fd39,_0x515686){return client[_0x881e('0x9')](_0x318dcd,_0x950463)[_0x881e('0xa')](function(_0xfae24d){logger[_0x881e('0xb')]('CmCustomField,\x20%s,\x20%s',_0x474273,_0x881e('0xc'));logger[_0x881e('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x474273,_0x881e('0xc'),JSON[_0x881e('0xe')](_0xfae24d));if(_0xfae24d[_0x881e('0xf')]){if(_0xfae24d[_0x881e('0xf')]['code']===0x1f4){logger['error'](_0x881e('0x10'),_0x474273,_0xfae24d[_0x881e('0xf')]['message']);return _0x515686(_0xfae24d['error'][_0x881e('0x11')]);}logger[_0x881e('0xf')](_0x881e('0x10'),_0x474273,_0xfae24d[_0x881e('0xf')][_0x881e('0x11')]);return _0xd3fd39(_0xfae24d[_0x881e('0xf')]['message']);}else{logger[_0x881e('0xb')](_0x881e('0x10'),_0x474273,_0x881e('0xc'));_0xd3fd39(_0xfae24d[_0x881e('0x12')]['message']);}})[_0x881e('0x13')](function(_0xd9734b){logger[_0x881e('0xf')](_0x881e('0x10'),_0x474273,_0xd9734b);_0x515686(_0xd9734b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 42217c8..cf25511 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 _0xd094=['show','create','put','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0xd094,0x96));var _0x4d09=function(_0x361fdb,_0x449bb6){_0x361fdb=_0x361fdb-0x0;var _0x4459da=_0xd094[_0x361fdb];return _0x4459da;};'use strict';var multer=require('multer');var util=require(_0x4d09('0x0'));var path=require(_0x4d09('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d09('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x4d09('0x3'));var config=require(_0x4d09('0x4'));var controller=require(_0x4d09('0x5'));router['get']('/',auth[_0x4d09('0x6')](),controller[_0x4d09('0x7')]);router[_0x4d09('0x8')](_0x4d09('0x9'),auth['isAuthenticated'](),controller[_0x4d09('0xa')]);router['post']('/',auth[_0x4d09('0x6')](),controller[_0x4d09('0xb')]);router[_0x4d09('0xc')](_0x4d09('0x9'),auth[_0x4d09('0x6')](),controller['update']);router[_0x4d09('0xd')](_0x4d09('0x9'),auth[_0x4d09('0x6')](),controller[_0x4d09('0xe')]);module[_0x4d09('0xf')]=router; \ No newline at end of file +var _0xc99e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x491768,_0x44a0e8){var _0x567b81=function(_0xaa8d45){while(--_0xaa8d45){_0x491768['push'](_0x491768['shift']());}};_0x567b81(++_0x44a0e8);}(_0xc99e,0x6e));var _0xec99=function(_0x347b87,_0x101175){_0x347b87=_0x347b87-0x0;var _0x5d59ae=_0xc99e[_0x347b87];return _0x5d59ae;};'use strict';var multer=require(_0xec99('0x0'));var util=require(_0xec99('0x1'));var path=require(_0xec99('0x2'));var timeout=require(_0xec99('0x3'));var express=require(_0xec99('0x4'));var router=express[_0xec99('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xec99('0x6'));var interaction=require(_0xec99('0x7'));var config=require(_0xec99('0x8'));var controller=require(_0xec99('0x9'));router[_0xec99('0xa')]('/',auth[_0xec99('0xb')](),controller[_0xec99('0xc')]);router[_0xec99('0xa')]('/:id',auth[_0xec99('0xb')](),controller[_0xec99('0xd')]);router['post']('/',auth[_0xec99('0xb')](),controller[_0xec99('0xe')]);router['put']('/:id',auth[_0xec99('0xb')](),controller[_0xec99('0xf')]);router[_0xec99('0x10')]('/:id',auth[_0xec99('0xb')](),controller[_0xec99('0x11')]);module[_0xec99('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 bc7b3ec..1adcbff 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 _0x4176=['exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x5d84b8,_0x175496){var _0x11820f=function(_0x1be819){while(--_0x1be819){_0x5d84b8['push'](_0x5d84b8['shift']());}};_0x11820f(++_0x175496);}(_0x4176,0xf2));var _0x6417=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x4176[_0x4e1d03];return _0x362d4b;};'use strict';var moment=require(_0x6417('0x0'));var Sequelize=require('sequelize');module[_0x6417('0x1')]={'phone':{'type':Sequelize[_0x6417('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x6417('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6417('0x4')],'defaultValue':moment()['format'](_0x6417('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6417('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6417('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6417('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x6417('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6417('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6417('0x6')],'unique':_0x6417('0x8')},'ListId':{'type':Sequelize[_0x6417('0x6')],'unique':_0x6417('0x8')},'UserId':{'type':Sequelize[_0x6417('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x6417('0x6')],'unique':_0x6417('0x8')},'CampaignId':{'type':Sequelize[_0x6417('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x6417('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6417('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6417('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6417('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x6417('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6417('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6417('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xe6e3=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','exports','BOOLEAN'];(function(_0x512f81,_0x4a7986){var _0xa15099=function(_0x1f7371){while(--_0x1f7371){_0x512f81['push'](_0x512f81['shift']());}};_0xa15099(++_0x4a7986);}(_0xe6e3,0xf1));var _0x3e6e=function(_0x27ad07,_0x2d3d47){_0x27ad07=_0x27ad07-0x0;var _0x3148b4=_0xe6e3[_0x27ad07];return _0x3148b4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x3e6e('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x3e6e('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3e6e('0x2')],'defaultValue':moment()[_0x3e6e('0x3')](_0x3e6e('0x4'))},'countbusyretry':{'type':Sequelize[_0x3e6e('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3e6e('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3e6e('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3e6e('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3e6e('0x2')]},'priority':{'type':Sequelize[_0x3e6e('0x5')](0x2)[_0x3e6e('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3e6e('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3e6e('0x5')],'unique':_0x3e6e('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x3e6e('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x3e6e('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x3e6e('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3e6e('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3e6e('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3e6e('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3e6e('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3e6e('0x6')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 5a5c723..02ee1cf 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 _0x9c5a=['UserId','user','deleted','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','DESC','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getPreviewRecall','getOpenContacts','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','moment','lodash','../../config/logger','api','../../config/environment','../../mysqldb','json','undefined','limit','count','offset','status','set','Content-Range','update','sendStatus','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','model','keys','query','filters','intersection','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$in','$like','$notLike','$notILike','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','length','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','omit','updatedAt','statedesc','campaign','membername'];(function(_0x15f25d,_0x37cad2){var _0x4008c7=function(_0x581a3e){while(--_0x581a3e){_0x15f25d['push'](_0x15f25d['shift']());}};_0x4008c7(++_0x37cad2);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x56d796,_0xb07903){_0x56d796=_0x56d796-0x0;var _0x516464=_0x9c5a[_0x56d796];return _0x516464;};'use strict';var moment=require(_0xa9c5('0x0'));var _=require(_0xa9c5('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xa9c5('0x2'))(_0xa9c5('0x3'));var shared=require(_0xa9c5('0x4'));var db=require(_0xa9c5('0x5'))['db'];function respondWithResult(_0x4f5552,_0x2acfaf){_0x2acfaf=_0x2acfaf||0xc8;return function(_0x3051b1){if(_0x3051b1){return _0x4f5552['status'](_0x2acfaf)[_0xa9c5('0x6')](_0x3051b1);}};}function respondWithFilteredResult(_0x4d9c7a,_0x394d84){return function(_0x3df556){if(_0x3df556){var _0x4cb597=typeof _0x394d84['offset']===_0xa9c5('0x7')&&typeof _0x394d84[_0xa9c5('0x8')]==='undefined';var _0x2e2b3e=_0x3df556[_0xa9c5('0x9')];var _0x51c14c=_0x4cb597?0x0:_0x394d84[_0xa9c5('0xa')];var _0x40a79d=_0x4cb597?_0x3df556['count']:_0x394d84['offset']+_0x394d84[_0xa9c5('0x8')];var _0x11421c;if(_0x40a79d>=_0x2e2b3e){_0x40a79d=_0x2e2b3e;_0x11421c=0xc8;}else{_0x11421c=0xce;}_0x4d9c7a[_0xa9c5('0xb')](_0x11421c);return _0x4d9c7a[_0xa9c5('0xc')](_0xa9c5('0xd'),_0x51c14c+'-'+_0x40a79d+'/'+_0x2e2b3e)[_0xa9c5('0x6')](_0x3df556);}return null;};}function saveUpdates(_0x51c8d,_0x42d5cf){return function(_0x3c5ac7){if(_0x3c5ac7){return _0x3c5ac7[_0xa9c5('0xe')](_0x51c8d)['then'](function(_0x390ca2){return _0x390ca2;});}return null;};}function handleEntityNotFound(_0x1276d2,_0x7df76d){return function(_0x3806c4){if(!_0x3806c4){_0x1276d2[_0xa9c5('0xf')](0x194);}return _0x3806c4;};}function handleError(_0x1dad66,_0x251099){_0x251099=_0x251099||0x1f4;return function(_0x40b001){logger[_0xa9c5('0x10')](_0x40b001[_0xa9c5('0x11')]);if(_0x40b001['name']){delete _0x40b001[_0xa9c5('0x12')];}_0x1dad66[_0xa9c5('0xb')](_0x251099)[_0xa9c5('0x13')](_0x40b001);};}exports['index']=function(_0x2cda1b,_0x1142d9){var _0x2b9ac5={},_0x3b8cf7={},_0x452a9b={'count':0x0,'rows':[]};var _0x349f27=_[_0xa9c5('0x14')](db[_0xa9c5('0x15')][_0xa9c5('0x16')],function(_0x36c486){return{'name':_0x36c486[_0xa9c5('0x17')],'type':_0x36c486[_0xa9c5('0x18')]['key']};});_0x3b8cf7[_0xa9c5('0x19')]=_[_0xa9c5('0x14')](_0x349f27,'name');_0x3b8cf7['query']=_[_0xa9c5('0x1a')](_0x2cda1b[_0xa9c5('0x1b')]);_0x3b8cf7[_0xa9c5('0x1c')]=_[_0xa9c5('0x1d')](_0x3b8cf7[_0xa9c5('0x19')],_0x3b8cf7[_0xa9c5('0x1b')]);_0x3b8cf7['filters']=_['concat'](_0x3b8cf7[_0xa9c5('0x1c')],[_0xa9c5('0x1e'),'$or',_0xa9c5('0x1f'),_0xa9c5('0x20'),_0xa9c5('0x21'),_0xa9c5('0x22'),_0xa9c5('0x23'),_0xa9c5('0x24'),_0xa9c5('0x25'),'$between','$notBetween',_0xa9c5('0x26'),'$notIn',_0xa9c5('0x27'),_0xa9c5('0x28'),'$iLike',_0xa9c5('0x29'),_0xa9c5('0x27'),'$overlap',_0xa9c5('0x2a'),_0xa9c5('0x2b'),_0xa9c5('0x2c')]);_0x2b9ac5[_0xa9c5('0x2d')]=_[_0xa9c5('0x1d')](_0x3b8cf7['model'],qs[_0xa9c5('0x2e')](_0x2cda1b['query'][_0xa9c5('0x2e')]));_0x2b9ac5[_0xa9c5('0x2d')]=_0x2b9ac5[_0xa9c5('0x2d')]['length']?_0x2b9ac5[_0xa9c5('0x2d')]:_0x3b8cf7[_0xa9c5('0x19')];if(!_0x2cda1b['query'][_0xa9c5('0x2f')](_0xa9c5('0x30'))){_0x2b9ac5[_0xa9c5('0x8')]=qs[_0xa9c5('0x8')](_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0x8')]);_0x2b9ac5[_0xa9c5('0xa')]=qs['offset'](_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0xa')]);}_0x2b9ac5[_0xa9c5('0x31')]=qs[_0xa9c5('0x32')](_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0x32')]);_0x2b9ac5[_0xa9c5('0x33')]=qs[_0xa9c5('0x1c')](_['pick'](_0x2cda1b['query'],_0x3b8cf7[_0xa9c5('0x1c')]),_0x349f27);if(_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0x34')]){_0x2b9ac5[_0xa9c5('0x33')]=_[_0xa9c5('0x35')](_0x2b9ac5[_0xa9c5('0x33')],{'$or':_['map'](_0x349f27,function(_0x598920){if(_0x598920['type']!==_0xa9c5('0x36')){var _0x27d614={};_0x27d614[_0x598920['name']]={'$like':'%'+_0x2cda1b[_0xa9c5('0x1b')]['filter']+'%'};return _0x27d614;}})});}_0x2b9ac5=_[_0xa9c5('0x35')]({},_0x2b9ac5,_0x2cda1b[_0xa9c5('0x37')]);var _0x2567be={'where':_0x2b9ac5[_0xa9c5('0x33')]};return db['CmHopper'][_0xa9c5('0x9')](_0x2567be)[_0xa9c5('0x38')](function(_0x191153){_0x452a9b[_0xa9c5('0x9')]=_0x191153;if(_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0x39')]){_0x2b9ac5[_0xa9c5('0x3a')]=[{'all':!![]}];}return db[_0xa9c5('0x15')]['findAll'](_0x2b9ac5);})[_0xa9c5('0x38')](function(_0x46e5d2){_0x452a9b[_0xa9c5('0x3b')]=_0x46e5d2;return _0x452a9b;})[_0xa9c5('0x38')](respondWithFilteredResult(_0x1142d9,_0x2b9ac5))[_0xa9c5('0x3c')](handleError(_0x1142d9,null));};exports[_0xa9c5('0x3d')]=function(_0x493b20,_0x307736){var _0x5b7a0a={'raw':!![],'where':{'id':_0x493b20['params']['id']}},_0x2fa3e3={};_0x2fa3e3[_0xa9c5('0x19')]=_[_0xa9c5('0x1a')](db[_0xa9c5('0x15')]['rawAttributes']);_0x2fa3e3[_0xa9c5('0x1b')]=_[_0xa9c5('0x1a')](_0x493b20[_0xa9c5('0x1b')]);_0x2fa3e3[_0xa9c5('0x1c')]=_['intersection'](_0x2fa3e3[_0xa9c5('0x19')],_0x2fa3e3[_0xa9c5('0x1b')]);_0x5b7a0a[_0xa9c5('0x2d')]=_[_0xa9c5('0x1d')](_0x2fa3e3[_0xa9c5('0x19')],qs['fields'](_0x493b20[_0xa9c5('0x1b')]['fields']));_0x5b7a0a[_0xa9c5('0x2d')]=_0x5b7a0a[_0xa9c5('0x2d')][_0xa9c5('0x3e')]?_0x5b7a0a[_0xa9c5('0x2d')]:_0x2fa3e3[_0xa9c5('0x19')];if(_0x493b20[_0xa9c5('0x1b')][_0xa9c5('0x39')]){_0x5b7a0a[_0xa9c5('0x3a')]=[{'all':!![]}];}_0x5b7a0a=_[_0xa9c5('0x35')]({},_0x5b7a0a,_0x493b20[_0xa9c5('0x37')]);return db['CmHopper'][_0xa9c5('0x3f')](_0x5b7a0a)[_0xa9c5('0x38')](handleEntityNotFound(_0x307736,null))[_0xa9c5('0x38')](respondWithResult(_0x307736,null))[_0xa9c5('0x3c')](handleError(_0x307736,null));};exports[_0xa9c5('0x40')]=function(_0x3794d2,_0x583ec9){return db[_0xa9c5('0x15')][_0xa9c5('0x40')](_0x3794d2['body'],{})['then'](respondWithResult(_0x583ec9,0xc9))['catch'](handleError(_0x583ec9,null));};exports['update']=function(_0x4e97bf,_0x160020){if(_0x4e97bf[_0xa9c5('0x41')]['id']){delete _0x4e97bf[_0xa9c5('0x41')]['id'];}return db[_0xa9c5('0x15')][_0xa9c5('0x3f')]({'where':{'id':_0x4e97bf[_0xa9c5('0x42')]['id']}})[_0xa9c5('0x38')](handleEntityNotFound(_0x160020,null))[_0xa9c5('0x38')](saveUpdates(_0x4e97bf[_0xa9c5('0x41')],null))[_0xa9c5('0x38')](respondWithResult(_0x160020,null))[_0xa9c5('0x3c')](handleError(_0x160020,null));};exports[_0xa9c5('0x43')]=function(_0x1c2ccf,_0x4bf8b4){return db[_0xa9c5('0x15')]['describe']()[_0xa9c5('0x38')](respondWithResult(_0x4bf8b4,null))[_0xa9c5('0x3c')](handleError(_0x4bf8b4,null));};exports['destroy']=function(_0x5cbd33,_0xf00970){var _0x32e64a;var _0xeb0720=_0x5cbd33['params']['id'];return db['CmHopper'][_0xa9c5('0x3f')]({'where':{'id':_0x5cbd33[_0xa9c5('0x42')]['id']}})['then'](handleEntityNotFound(_0xf00970,null))[_0xa9c5('0x38')](function(_0x2c095f){if(_0x2c095f){return _0x2c095f[_0xa9c5('0x44')]()[_0xa9c5('0x38')](function(_0x34020f){return _0x34020f;});}})[_0xa9c5('0x38')](function(_0x4b6fc9){_0x32e64a=_0x4b6fc9;if(_0x4b6fc9){if(_0x4b6fc9['VoiceQueueId']||_0x4b6fc9['CampaignId']){return db[_0x4b6fc9[_0xa9c5('0x45')]?_0xa9c5('0x46'):_0xa9c5('0x47')][_0xa9c5('0x3f')]({'where':{'id':_0x4b6fc9[_0xa9c5('0x45')]?_0x4b6fc9[_0xa9c5('0x45')]:_0x4b6fc9['CampaignId']},'attributes':['id',_0xa9c5('0x12')],'raw':!![]});}}})[_0xa9c5('0x38')](function(_0x433a58){var _0x2bdc77={};if(_0x433a58){_[_0xa9c5('0x35')](_0x2bdc77,_[_0xa9c5('0x48')](_0x32e64a['dataValues'],['createdAt',_0xa9c5('0x49'),'id']));_0x2bdc77['state']=0x15;_0x2bdc77[_0xa9c5('0x4a')]='deleted';_0x2bdc77[_0xa9c5('0x4b')]=_0x433a58[_0xa9c5('0x12')];_0x2bdc77[_0xa9c5('0x4c')]=_0x5cbd33['user'][_0xa9c5('0x12')];_0x2bdc77[_0xa9c5('0x4d')]=_0x5cbd33[_0xa9c5('0x4e')]['id'];_0x2bdc77[_0xa9c5('0x4f')]=!![];_0x2bdc77['deletedat']=moment()['format'](_0xa9c5('0x50'));_0x2bdc77[_0xa9c5('0x51')]=_0x32e64a[_0xa9c5('0x52')];_0x2bdc77['campaigntype']=_0x32e64a[_0xa9c5('0x45')]?_0xa9c5('0x53'):_0xa9c5('0x54');return db[_0xa9c5('0x55')][_0xa9c5('0x3f')]({'where':{'id':_0x2bdc77[_0xa9c5('0x56')]},'attributes':[_0xa9c5('0x57'),_0xa9c5('0x58')]})['then'](function(_0x41f528){if(!_['isNil'](_0xf00970)&&!_[_0xa9c5('0x59')](_0x41f528[_0xa9c5('0x57')])){_0x2bdc77[_0xa9c5('0x5a')]=_0x41f528['firstName'];if(!_[_0xa9c5('0x59')](_0x41f528[_0xa9c5('0x58')])){_0x2bdc77['calleridname']+='\x20'+_0x41f528[_0xa9c5('0x58')];}}})[_0xa9c5('0x5b')](function(){return db[_0xa9c5('0x5c')][_0xa9c5('0x40')](_0x2bdc77);});}})['then'](function(_0x3505d3){return db[_0xa9c5('0x5d')][_0xa9c5('0x44')]({'where':{'CmHopperId':_0xeb0720}});})[_0xa9c5('0x38')](function(){return _0xf00970['status'](0xcc)['end']();})[_0xa9c5('0x3c')](handleError(_0xf00970,null));};exports[_0xa9c5('0x5e')]=function(_0x67c1f8,_0x1b676e){var _0x279a26=[];return db[_0xa9c5('0x55')]['describe']()[_0xa9c5('0x38')](function(_0x1e787e){_0x279a26=_[_0xa9c5('0x1a')](_0x1e787e);return _0x67c1f8[_0xa9c5('0x4e')][_0xa9c5('0x5f')]({'where':{'type':_0xa9c5('0x60'),'dialActive':!![],'dialMethod':_0xa9c5('0x61')},'attributes':['id',_0xa9c5('0x62'),_0xa9c5('0x63')],'raw':!![]});})[_0xa9c5('0x38')](function(_0x50d438){if(_0x50d438&&_0x50d438['length']){return db[_0xa9c5('0x64')][_0xa9c5('0x65')](function(_0x3322cc){var _0x47afaa={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa9c5('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x50d438,'id')},'$or':[{'UserId':null},{'UserId':_0x67c1f8[_0xa9c5('0x4e')]['id']}]};var _0x28c0df={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x50d438)[_0xa9c5('0x34')]([_0xa9c5('0x63'),0x0])[_0xa9c5('0x14')]('id')[_0xa9c5('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x67c1f8[_0xa9c5('0x4e')]['id']}]};var _0x3890b4={'$or':[_0x47afaa,_0x28c0df]};var _0x2f323e=[];if(_0x67c1f8[_0xa9c5('0x41')][_0xa9c5('0x67')]&&_0x67c1f8[_0xa9c5('0x41')]['direction']===_0xa9c5('0x68')){if(!_[_0xa9c5('0x69')](_0x67c1f8[_0xa9c5('0x41')][_0xa9c5('0x6a')])){_0x3890b4['id']={'$in':_0x67c1f8[_0xa9c5('0x41')][_0xa9c5('0x6a')]};}_0x2f323e=[[_0xa9c5('0x6b'),'ASC'],['scheduledAt',_0x50d438[0x0][_0xa9c5('0x62')]==='ASC'?_0xa9c5('0x6c'):_0xa9c5('0x6d')],db['sequelize'][_0xa9c5('0x6e')](_0xa9c5('0x6f')),['id','DESC']];}else{if(!_['isEmpty'](_0x67c1f8[_0xa9c5('0x41')][_0xa9c5('0x6a')])){_0x3890b4['id']={'$notIn':_0x67c1f8[_0xa9c5('0x41')]['hopperIds']};}_0x2f323e=[['priority',_0xa9c5('0x6c')],[_0xa9c5('0x70'),_0x50d438[0x0]['dialOrderByScheduledAt']],db[_0xa9c5('0x64')][_0xa9c5('0x6e')](_0xa9c5('0x71')),['id',_0xa9c5('0x6d')]];}return db[_0xa9c5('0x15')][_0xa9c5('0x72')]({'attributes':['id','scheduledat',_0xa9c5('0x52'),_0xa9c5('0x73')],'where':_0x3890b4,'order':_0x2f323e,'transaction':_0x3322cc,'lock':_0x3322cc[_0xa9c5('0x74')][_0xa9c5('0x75')],'include':[{'model':db['CmContact'],'as':_0xa9c5('0x76'),'attributes':_0x279a26,'include':[{'model':db[_0xa9c5('0x77')],'as':'Company','attributes':['id',_0xa9c5('0x12')]}]},{'model':db[_0xa9c5('0x78')],'as':_0xa9c5('0x79'),'attributes':['id','name']},{'model':db[_0xa9c5('0x46')],'as':_0xa9c5('0x7a'),'attributes':['id',_0xa9c5('0x12'),_0xa9c5('0x7b')]}]})[_0xa9c5('0x38')](function(_0x4db621){if(_0x4db621){return _0x4db621[_0xa9c5('0xe')]({'UserId':_0x67c1f8['user']['id']},{'transaction':_0x3322cc});}});});}})[_0xa9c5('0x38')](handleEntityNotFound(_0x1b676e,null))[_0xa9c5('0x38')](respondWithResult(_0x1b676e,null))[_0xa9c5('0x3c')](handleError(_0x1b676e,null));};exports[_0xa9c5('0x7c')]=function(_0x427817,_0x42b1d7,_0x39fae1){var _0x390d0b=[];var _0x3f6114=_0x427817[_0xa9c5('0x42')]['id'];var _0x2f350e=_0x427817['user']['id'];return db[_0xa9c5('0x55')][_0xa9c5('0x43')]()['then'](function(_0x2a0a94){_0x390d0b=_[_0xa9c5('0x1a')](_0x2a0a94);return db[_0xa9c5('0x64')]['transaction'](function(_0x27bcc0){const _0x282f84={'id':_0x3f6114};return db[_0xa9c5('0x15')][_0xa9c5('0x72')]({'attributes':['id','scheduledat',_0xa9c5('0x73')],'where':_0x282f84,'transaction':_0x27bcc0,'lock':_0x27bcc0[_0xa9c5('0x74')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x390d0b,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xa9c5('0x12')]},{'model':db[_0xa9c5('0x46')],'as':_0xa9c5('0x7a'),'attributes':['id',_0xa9c5('0x12'),_0xa9c5('0x7b')]}]})['then'](function(_0x4d7772){if(_0x4d7772){return _0x4d7772['update']({'UserId':_0x2f350e},{'transaction':_0x27bcc0});}});});})['then'](handleEntityNotFound(_0x42b1d7,null))[_0xa9c5('0x38')](respondWithResult(_0x42b1d7,null))[_0xa9c5('0x3c')](handleError(_0x42b1d7,null));};exports[_0xa9c5('0x7d')]=function(_0x2eda17,_0x5253e8){return _0x2eda17['user'][_0xa9c5('0x5f')]({'where':{'type':_0xa9c5('0x60'),'dialActive':!![],'dialMethod':_0xa9c5('0x61')},'attributes':['id'],'raw':!![]})[_0xa9c5('0x38')](function(_0x1d89ec){if(_0x1d89ec&&_0x1d89ec['length']){return db[_0xa9c5('0x15')][_0xa9c5('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa9c5('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xa9c5('0x14')](_0x1d89ec,'id')},'$or':[{'UserId':null},{'UserId':_0x2eda17[_0xa9c5('0x4e')]['id']}]}});}return 0x0;})[_0xa9c5('0x38')](function(_0x3dfef2){if(!_['isNil'](_0x3dfef2)&&_[_0xa9c5('0x7f')](_0x3dfef2)){return _0x5253e8[_0xa9c5('0xb')](0xc8)['json']({'contacts':_0x3dfef2});}else{logger['error'](_0xa9c5('0x80'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x5253e8[_0xa9c5('0xf')](0x194);}})[_0xa9c5('0x3c')](handleError(_0x5253e8,null));};exports[_0xa9c5('0x81')]=function(_0x2f9757,_0x22661f){var _0x5bc433=shared[_0xa9c5('0x82')];var _0x4c04f7=[];_[_0xa9c5('0x14')](_0x5bc433,function(_0x2ff914){_0x4c04f7[_0xa9c5('0x83')]({'id':_0x2ff914[_0xa9c5('0x12')],'name':_0x2ff914['name'],'utcOffset':_0x2ff914['utcOffset']});});return _0x22661f[_0xa9c5('0xb')](0xc8)['json']({'tz':_0x4c04f7});};exports['getTimezone']=function(_0x38e2f,_0x370bbb){var _0x4cdf88=shared['timezones'];var _0x4335ff={};if(!_[_0xa9c5('0x59')](_0x4cdf88[_0x38e2f[_0xa9c5('0x41')]['id']]))_0x4335ff=_0x4cdf88[_0x38e2f[_0xa9c5('0x41')]['id']];return _0x370bbb['status'](0xc8)['json'](_0x4335ff);}; \ No newline at end of file +var _0xb66c=['$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','find','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','keys','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','update','then','name','send','map','CmHopper','rawAttributes','model','query','filters','intersection','concat','$and','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$notIn','$like','$notLike'];(function(_0x52f90b,_0x602db5){var _0x273733=function(_0x261d4a){while(--_0x261d4a){_0x52f90b['push'](_0x52f90b['shift']());}};_0x273733(++_0x602db5);}(_0xb66c,0x175));var _0xcb66=function(_0x5aa3ac,_0x203828){_0x5aa3ac=_0x5aa3ac-0x0;var _0x4a287e=_0xb66c[_0x5aa3ac];return _0x4a287e;};'use strict';var moment=require(_0xcb66('0x0'));var _=require('lodash');var qs=require(_0xcb66('0x1'));var logger=require('../../config/logger')(_0xcb66('0x2'));var shared=require(_0xcb66('0x3'));var db=require(_0xcb66('0x4'))['db'];function respondWithResult(_0x5f487c,_0x35d439){_0x35d439=_0x35d439||0xc8;return function(_0x386241){if(_0x386241){return _0x5f487c[_0xcb66('0x5')](_0x35d439)[_0xcb66('0x6')](_0x386241);}};}function respondWithFilteredResult(_0x5d766d,_0x518163){return function(_0x19adf5){if(_0x19adf5){var _0x1b6852=typeof _0x518163[_0xcb66('0x7')]===_0xcb66('0x8')&&typeof _0x518163[_0xcb66('0x9')]==='undefined';var _0x2c62ad=_0x19adf5[_0xcb66('0xa')];var _0x174969=_0x1b6852?0x0:_0x518163[_0xcb66('0x7')];var _0x3c4ce1=_0x1b6852?_0x19adf5['count']:_0x518163[_0xcb66('0x7')]+_0x518163[_0xcb66('0x9')];var _0xf12828;if(_0x3c4ce1>=_0x2c62ad){_0x3c4ce1=_0x2c62ad;_0xf12828=0xc8;}else{_0xf12828=0xce;}_0x5d766d[_0xcb66('0x5')](_0xf12828);return _0x5d766d['set'](_0xcb66('0xb'),_0x174969+'-'+_0x3c4ce1+'/'+_0x2c62ad)[_0xcb66('0x6')](_0x19adf5);}return null;};}function saveUpdates(_0x4105d2,_0x2339bb){return function(_0x582523){if(_0x582523){return _0x582523[_0xcb66('0xc')](_0x4105d2)[_0xcb66('0xd')](function(_0x36c846){return _0x36c846;});}return null;};}function handleEntityNotFound(_0x401bc9,_0x58fb9e){return function(_0x19072b){if(!_0x19072b){_0x401bc9['sendStatus'](0x194);}return _0x19072b;};}function handleError(_0x6af5b5,_0x52b058){_0x52b058=_0x52b058||0x1f4;return function(_0x27442d){logger['error'](_0x27442d['stack']);if(_0x27442d[_0xcb66('0xe')]){delete _0x27442d[_0xcb66('0xe')];}_0x6af5b5[_0xcb66('0x5')](_0x52b058)[_0xcb66('0xf')](_0x27442d);};}exports['index']=function(_0x3a6e26,_0x42ad03){var _0x8a0f3f={},_0x58bca0={},_0x2e4126={'count':0x0,'rows':[]};var _0x496d12=_[_0xcb66('0x10')](db[_0xcb66('0x11')][_0xcb66('0x12')],function(_0x1ccb71){return{'name':_0x1ccb71['fieldName'],'type':_0x1ccb71['type']['key']};});_0x58bca0[_0xcb66('0x13')]=_['map'](_0x496d12,'name');_0x58bca0[_0xcb66('0x14')]=_['keys'](_0x3a6e26[_0xcb66('0x14')]);_0x58bca0[_0xcb66('0x15')]=_[_0xcb66('0x16')](_0x58bca0[_0xcb66('0x13')],_0x58bca0[_0xcb66('0x14')]);_0x58bca0[_0xcb66('0x15')]=_[_0xcb66('0x17')](_0x58bca0['filters'],[_0xcb66('0x18'),'$or','$gt',_0xcb66('0x19'),_0xcb66('0x1a'),_0xcb66('0x1b'),'$ne',_0xcb66('0x1c'),_0xcb66('0x1d'),_0xcb66('0x1e'),_0xcb66('0x1f'),'$in',_0xcb66('0x20'),_0xcb66('0x21'),_0xcb66('0x22'),_0xcb66('0x23'),_0xcb66('0x24'),_0xcb66('0x21'),_0xcb66('0x25'),_0xcb66('0x26'),_0xcb66('0x27'),_0xcb66('0x28')]);_0x8a0f3f['attributes']=_[_0xcb66('0x16')](_0x58bca0['model'],qs['fields'](_0x3a6e26['query'][_0xcb66('0x29')]));_0x8a0f3f['attributes']=_0x8a0f3f[_0xcb66('0x2a')][_0xcb66('0x2b')]?_0x8a0f3f[_0xcb66('0x2a')]:_0x58bca0['model'];if(!_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x2c')](_0xcb66('0x2d'))){_0x8a0f3f[_0xcb66('0x9')]=qs[_0xcb66('0x9')](_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x9')]);_0x8a0f3f[_0xcb66('0x7')]=qs[_0xcb66('0x7')](_0x3a6e26[_0xcb66('0x14')]['offset']);}_0x8a0f3f[_0xcb66('0x2e')]=qs[_0xcb66('0x2f')](_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x2f')]);_0x8a0f3f[_0xcb66('0x30')]=qs[_0xcb66('0x15')](_[_0xcb66('0x31')](_0x3a6e26['query'],_0x58bca0[_0xcb66('0x15')]),_0x496d12);if(_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x32')]){_0x8a0f3f[_0xcb66('0x30')]=_['merge'](_0x8a0f3f[_0xcb66('0x30')],{'$or':_[_0xcb66('0x10')](_0x496d12,function(_0x907fff){if(_0x907fff[_0xcb66('0x33')]!==_0xcb66('0x34')){var _0x1d9957={};_0x1d9957[_0x907fff[_0xcb66('0xe')]]={'$like':'%'+_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x32')]+'%'};return _0x1d9957;}})});}_0x8a0f3f=_[_0xcb66('0x35')]({},_0x8a0f3f,_0x3a6e26[_0xcb66('0x36')]);var _0x17b087={'where':_0x8a0f3f['where']};return db['CmHopper']['count'](_0x17b087)[_0xcb66('0xd')](function(_0x4182f9){_0x2e4126[_0xcb66('0xa')]=_0x4182f9;if(_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x37')]){_0x8a0f3f[_0xcb66('0x38')]=[{'all':!![]}];}return db['CmHopper'][_0xcb66('0x39')](_0x8a0f3f);})['then'](function(_0x4b25f0){_0x2e4126['rows']=_0x4b25f0;return _0x2e4126;})[_0xcb66('0xd')](respondWithFilteredResult(_0x42ad03,_0x8a0f3f))[_0xcb66('0x3a')](handleError(_0x42ad03,null));};exports[_0xcb66('0x3b')]=function(_0x9db922,_0x11d2ac){var _0x3e71a7={'raw':!![],'where':{'id':_0x9db922[_0xcb66('0x3c')]['id']}},_0x3422b6={};_0x3422b6[_0xcb66('0x13')]=_['keys'](db[_0xcb66('0x11')][_0xcb66('0x12')]);_0x3422b6[_0xcb66('0x14')]=_['keys'](_0x9db922[_0xcb66('0x14')]);_0x3422b6[_0xcb66('0x15')]=_['intersection'](_0x3422b6['model'],_0x3422b6[_0xcb66('0x14')]);_0x3e71a7['attributes']=_['intersection'](_0x3422b6[_0xcb66('0x13')],qs[_0xcb66('0x29')](_0x9db922[_0xcb66('0x14')][_0xcb66('0x29')]));_0x3e71a7[_0xcb66('0x2a')]=_0x3e71a7[_0xcb66('0x2a')][_0xcb66('0x2b')]?_0x3e71a7[_0xcb66('0x2a')]:_0x3422b6[_0xcb66('0x13')];if(_0x9db922['query']['includeAll']){_0x3e71a7['include']=[{'all':!![]}];}_0x3e71a7=_[_0xcb66('0x35')]({},_0x3e71a7,_0x9db922['options']);return db[_0xcb66('0x11')]['find'](_0x3e71a7)[_0xcb66('0xd')](handleEntityNotFound(_0x11d2ac,null))[_0xcb66('0xd')](respondWithResult(_0x11d2ac,null))[_0xcb66('0x3a')](handleError(_0x11d2ac,null));};exports[_0xcb66('0x3d')]=function(_0x3115e2,_0xbc92e){return db['CmHopper']['create'](_0x3115e2[_0xcb66('0x3e')],{})[_0xcb66('0xd')](respondWithResult(_0xbc92e,0xc9))[_0xcb66('0x3a')](handleError(_0xbc92e,null));};exports[_0xcb66('0xc')]=function(_0xf2c532,_0x1c149b){if(_0xf2c532[_0xcb66('0x3e')]['id']){delete _0xf2c532[_0xcb66('0x3e')]['id'];}return db[_0xcb66('0x11')]['find']({'where':{'id':_0xf2c532[_0xcb66('0x3c')]['id']}})[_0xcb66('0xd')](handleEntityNotFound(_0x1c149b,null))[_0xcb66('0xd')](saveUpdates(_0xf2c532[_0xcb66('0x3e')],null))['then'](respondWithResult(_0x1c149b,null))[_0xcb66('0x3a')](handleError(_0x1c149b,null));};exports[_0xcb66('0x3f')]=function(_0x1aab4e,_0x5a1083){return db[_0xcb66('0x11')][_0xcb66('0x3f')]()[_0xcb66('0xd')](respondWithResult(_0x5a1083,null))[_0xcb66('0x3a')](handleError(_0x5a1083,null));};exports['destroy']=function(_0x43e0e0,_0xb0854f){var _0x3b839b;var _0x4b1d46=_0x43e0e0['params']['id'];return db[_0xcb66('0x11')]['find']({'where':{'id':_0x43e0e0[_0xcb66('0x3c')]['id']}})['then'](handleEntityNotFound(_0xb0854f,null))[_0xcb66('0xd')](function(_0x416448){if(_0x416448){return _0x416448[_0xcb66('0x40')]()['then'](function(_0x2071d5){return _0x2071d5;});}})['then'](function(_0x228504){_0x3b839b=_0x228504;if(_0x228504){if(_0x228504[_0xcb66('0x41')]||_0x228504[_0xcb66('0x42')]){return db[_0x228504[_0xcb66('0x41')]?_0xcb66('0x43'):'Campaign'][_0xcb66('0x44')]({'where':{'id':_0x228504['VoiceQueueId']?_0x228504[_0xcb66('0x41')]:_0x228504[_0xcb66('0x42')]},'attributes':['id',_0xcb66('0xe')],'raw':!![]});}}})['then'](function(_0x48d7a3){var _0x52ff91={};if(_0x48d7a3){_[_0xcb66('0x35')](_0x52ff91,_[_0xcb66('0x45')](_0x3b839b[_0xcb66('0x46')],[_0xcb66('0x47'),_0xcb66('0x48'),'id']));_0x52ff91[_0xcb66('0x49')]=0x15;_0x52ff91[_0xcb66('0x4a')]=_0xcb66('0x4b');_0x52ff91[_0xcb66('0x4c')]=_0x48d7a3[_0xcb66('0xe')];_0x52ff91['membername']=_0x43e0e0[_0xcb66('0x4d')][_0xcb66('0xe')];_0x52ff91[_0xcb66('0x4e')]=_0x43e0e0[_0xcb66('0x4d')]['id'];_0x52ff91['deleted']=!![];_0x52ff91['deletedat']=moment()[_0xcb66('0x4f')](_0xcb66('0x50'));_0x52ff91[_0xcb66('0x51')]=_0x3b839b[_0xcb66('0x52')];_0x52ff91[_0xcb66('0x53')]=_0x3b839b[_0xcb66('0x41')]?'queue':_0xcb66('0x54');return db[_0xcb66('0x55')][_0xcb66('0x44')]({'where':{'id':_0x52ff91[_0xcb66('0x56')]},'attributes':['firstName',_0xcb66('0x57')]})['then'](function(_0xd37bbd){if(!_['isNil'](_0xb0854f)&&!_[_0xcb66('0x58')](_0xd37bbd[_0xcb66('0x59')])){_0x52ff91[_0xcb66('0x5a')]=_0xd37bbd['firstName'];if(!_['isNil'](_0xd37bbd[_0xcb66('0x57')])){_0x52ff91[_0xcb66('0x5a')]+='\x20'+_0xd37bbd['lastName'];}}})['finally'](function(){return db[_0xcb66('0x5b')]['create'](_0x52ff91);});}})[_0xcb66('0xd')](function(_0x56e524){return db[_0xcb66('0x5c')][_0xcb66('0x40')]({'where':{'CmHopperId':_0x4b1d46}});})[_0xcb66('0xd')](function(){return _0xb0854f['status'](0xcc)[_0xcb66('0x5d')]();})[_0xcb66('0x3a')](handleError(_0xb0854f,null));};exports['getPreview']=function(_0x244003,_0x27e83c){var _0x417c7e=[];return db[_0xcb66('0x55')][_0xcb66('0x3f')]()[_0xcb66('0xd')](function(_0x5352aa){_0x417c7e=_[_0xcb66('0x5e')](_0x5352aa);return _0x244003[_0xcb66('0x4d')][_0xcb66('0x5f')]({'where':{'type':_0xcb66('0x60'),'dialActive':!![],'dialMethod':_0xcb66('0x61')},'attributes':['id',_0xcb66('0x62'),_0xcb66('0x63')],'raw':!![]});})[_0xcb66('0xd')](function(_0x1e2287){if(_0x1e2287&&_0x1e2287['length']){return db[_0xcb66('0x64')][_0xcb66('0x65')](function(_0x25e648){var _0x3ab8b3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcb66('0x4f')](_0xcb66('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x1e2287,'id')},'$or':[{'UserId':null},{'UserId':_0x244003[_0xcb66('0x4d')]['id']}]};var _0x40d4f3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1e2287)['filter']([_0xcb66('0x63'),0x0])[_0xcb66('0x10')]('id')[_0xcb66('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x244003[_0xcb66('0x4d')]['id']}]};var _0x5b6e1f={'$or':[_0x3ab8b3,_0x40d4f3]};var _0x3dbc42=[];if(_0x244003[_0xcb66('0x3e')][_0xcb66('0x67')]&&_0x244003[_0xcb66('0x3e')][_0xcb66('0x67')]===_0xcb66('0x68')){if(!_[_0xcb66('0x69')](_0x244003[_0xcb66('0x3e')][_0xcb66('0x6a')])){_0x5b6e1f['id']={'$in':_0x244003[_0xcb66('0x3e')]['hopperIds']};}_0x3dbc42=[[_0xcb66('0x6b'),_0xcb66('0x6c')],[_0xcb66('0x6d'),_0x1e2287[0x0][_0xcb66('0x62')]==='ASC'?_0xcb66('0x6e'):_0xcb66('0x6c')],db[_0xcb66('0x64')][_0xcb66('0x6f')](_0xcb66('0x70')),['id',_0xcb66('0x6e')]];}else{if(!_[_0xcb66('0x69')](_0x244003['body']['hopperIds'])){_0x5b6e1f['id']={'$notIn':_0x244003[_0xcb66('0x3e')][_0xcb66('0x6a')]};}_0x3dbc42=[[_0xcb66('0x6b'),_0xcb66('0x6e')],[_0xcb66('0x6d'),_0x1e2287[0x0][_0xcb66('0x62')]],db['sequelize'][_0xcb66('0x6f')](_0xcb66('0x71')),['id',_0xcb66('0x6c')]];}return db[_0xcb66('0x11')][_0xcb66('0x72')]({'attributes':['id',_0xcb66('0x73'),'phone',_0xcb66('0x74')],'where':_0x5b6e1f,'order':_0x3dbc42,'transaction':_0x25e648,'lock':_0x25e648[_0xcb66('0x75')][_0xcb66('0x76')],'include':[{'model':db[_0xcb66('0x55')],'as':_0xcb66('0x77'),'attributes':_0x417c7e,'include':[{'model':db[_0xcb66('0x78')],'as':_0xcb66('0x79'),'attributes':['id',_0xcb66('0xe')]}]},{'model':db[_0xcb66('0x7a')],'as':_0xcb66('0x7b'),'attributes':['id',_0xcb66('0xe')]},{'model':db[_0xcb66('0x43')],'as':_0xcb66('0x7c'),'attributes':['id',_0xcb66('0xe'),_0xcb66('0x7d')]}]})[_0xcb66('0xd')](function(_0x3b0f10){if(_0x3b0f10){return _0x3b0f10[_0xcb66('0xc')]({'UserId':_0x244003[_0xcb66('0x4d')]['id']},{'transaction':_0x25e648});}});});}})['then'](handleEntityNotFound(_0x27e83c,null))[_0xcb66('0xd')](respondWithResult(_0x27e83c,null))['catch'](handleError(_0x27e83c,null));};exports[_0xcb66('0x7e')]=function(_0x51311b,_0x279264,_0x2912c9){var _0x42a71a=[];var _0x1a4cdb=_0x51311b[_0xcb66('0x3c')]['id'];var _0x283600=_0x51311b[_0xcb66('0x4d')]['id'];return db[_0xcb66('0x55')][_0xcb66('0x3f')]()[_0xcb66('0xd')](function(_0xf7c710){_0x42a71a=_[_0xcb66('0x5e')](_0xf7c710);return db[_0xcb66('0x64')]['transaction'](function(_0x91725a){const _0x45b25e={'id':_0x1a4cdb};return db[_0xcb66('0x11')]['findOne']({'attributes':['id',_0xcb66('0x73'),_0xcb66('0x74')],'where':_0x45b25e,'transaction':_0x91725a,'lock':_0x91725a[_0xcb66('0x75')]['UPDATE'],'include':[{'model':db[_0xcb66('0x55')],'as':_0xcb66('0x77'),'attributes':_0x42a71a,'include':[{'model':db[_0xcb66('0x78')],'as':_0xcb66('0x79'),'attributes':['id',_0xcb66('0xe')]}]},{'model':db[_0xcb66('0x7a')],'as':'List','attributes':['id',_0xcb66('0xe')]},{'model':db['VoiceQueue'],'as':_0xcb66('0x7c'),'attributes':['id','name',_0xcb66('0x7d')]}]})['then'](function(_0x3b4c30){if(_0x3b4c30){return _0x3b4c30[_0xcb66('0xc')]({'UserId':_0x283600},{'transaction':_0x91725a});}});});})[_0xcb66('0xd')](handleEntityNotFound(_0x279264,null))['then'](respondWithResult(_0x279264,null))[_0xcb66('0x3a')](handleError(_0x279264,null));};exports['getOpenContacts']=function(_0x112f25,_0x21d871){return _0x112f25[_0xcb66('0x4d')][_0xcb66('0x5f')]({'where':{'type':_0xcb66('0x60'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xcb66('0xd')](function(_0xfa72ee){if(_0xfa72ee&&_0xfa72ee[_0xcb66('0x2b')]){return db[_0xcb66('0x11')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcb66('0x4f')](_0xcb66('0x50'))},'VoiceQueueId':{'$in':_['map'](_0xfa72ee,'id')},'$or':[{'UserId':null},{'UserId':_0x112f25[_0xcb66('0x4d')]['id']}]}});}return 0x0;})[_0xcb66('0xd')](function(_0x16f9a3){if(!_[_0xcb66('0x58')](_0x16f9a3)&&_['isNumber'](_0x16f9a3)){return _0x21d871[_0xcb66('0x5')](0xc8)[_0xcb66('0x6')]({'contacts':_0x16f9a3});}else{logger[_0xcb66('0x7f')](_0xcb66('0x80'),_0xcb66('0x81'),0x194,'entity\x20not\x20found');_0x21d871[_0xcb66('0x82')](0x194);}})[_0xcb66('0x3a')](handleError(_0x21d871,null));};exports[_0xcb66('0x83')]=function(_0x1105d5,_0xb3a1e){var _0xf7b62b=shared[_0xcb66('0x84')];var _0x5b0db8=[];_['map'](_0xf7b62b,function(_0x56b8d5){_0x5b0db8[_0xcb66('0x85')]({'id':_0x56b8d5[_0xcb66('0xe')],'name':_0x56b8d5['name'],'utcOffset':_0x56b8d5[_0xcb66('0x86')]});});return _0xb3a1e['status'](0xc8)[_0xcb66('0x6')]({'tz':_0x5b0db8});};exports[_0xcb66('0x87')]=function(_0x220fea,_0x28987a){var _0x4d45b2=shared[_0xcb66('0x84')];var _0x2c08fc={};if(!_[_0xcb66('0x58')](_0x4d45b2[_0x220fea[_0xcb66('0x3e')]['id']]))_0x2c08fc=_0x4d45b2[_0x220fea[_0xcb66('0x3e')]['id']];return _0x28987a['status'](0xc8)['json'](_0x2c08fc);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index e99d5e9..27fb3ac 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 _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x90b1,0x1bb));var _0x190b=function(_0x4c221d,_0x3bc12f){_0x4c221d=_0x4c221d-0x0;var _0x203a04=_0x90b1[_0x4c221d];return _0x203a04;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','../../config/logger'];(function(_0x4cd8e1,_0x3fb58a){var _0x5e7ec4=function(_0x2c7d0f){while(--_0x2c7d0f){_0x4cd8e1['push'](_0x4cd8e1['shift']());}};_0x5e7ec4(++_0x3fb58a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x403103,_0x420ed7){_0x403103=_0x403103-0x0;var _0x27decc=_0x1cb9[_0x403103];return _0x27decc;};'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':'cm_hopper','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['scheduledat']},{'name':_0x91cb('0xc'),'fields':['phone']},{'name':_0x91cb('0xd'),'fields':[_0x91cb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index bba5386..2103b8b 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 _0x8de2=['push','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]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','GetCmHopperPreview','keys','GetContactByPhone','findOne','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','NOW()','name','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','CmHopper','findAll','options','where','attributes','include','map','model','then','GetCmHopper','catch','find','raw','ShowCmHopper','stringify','CreateCmHopper','create','body','UpdateCmHopper','update','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','limit','order','LOCK','UPDATE','CmContact','Contact','User','Agent','voicePause','length'];(function(_0x33700b,_0x3e7665){var _0x30efd0=function(_0x12a6c7){while(--_0x12a6c7){_0x33700b['push'](_0x33700b['shift']());}};_0x30efd0(++_0x3e7665);}(_0x8de2,0x77));var _0x28de=function(_0x215775,_0x15bc76){_0x215775=_0x215775-0x0;var _0x2c189d=_0x8de2[_0x215775];return _0x2c189d;};'use strict';var _=require(_0x28de('0x0'));var util=require(_0x28de('0x1'));var moment=require(_0x28de('0x2'));var BPromise=require(_0x28de('0x3'));var db=require(_0x28de('0x4'))['db'];var logger=require(_0x28de('0x5'))('rpc');var jayson=require(_0x28de('0x6'));var client=jayson[_0x28de('0x7')][_0x28de('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x206ade,_0x18e271,_0x3742af){return new BPromise(function(_0x55443c,_0x3ae8b0){return client['request'](_0x206ade,_0x3742af)['then'](function(_0x1cdace){logger[_0x28de('0x9')](_0x28de('0xa'),_0x18e271,_0x28de('0xb'));logger[_0x28de('0xc')](_0x28de('0xd'),_0x18e271,_0x28de('0xb'),JSON['stringify'](_0x1cdace));if(_0x1cdace[_0x28de('0xe')]){if(_0x1cdace[_0x28de('0xe')][_0x28de('0xf')]===0x1f4){logger[_0x28de('0xe')]('CmHopper,\x20%s,\x20%s',_0x18e271,_0x1cdace[_0x28de('0xe')][_0x28de('0x10')]);return _0x3ae8b0(_0x1cdace[_0x28de('0xe')][_0x28de('0x10')]);}logger[_0x28de('0xe')](_0x28de('0xa'),_0x18e271,_0x1cdace[_0x28de('0xe')][_0x28de('0x10')]);return _0x55443c(_0x1cdace[_0x28de('0xe')][_0x28de('0x10')]);}else{logger[_0x28de('0x9')](_0x28de('0xa'),_0x18e271,_0x28de('0xb'));_0x55443c(_0x1cdace[_0x28de('0x11')][_0x28de('0x10')]);}})['catch'](function(_0x5a7271){logger[_0x28de('0xe')](_0x28de('0xa'),_0x18e271,_0x5a7271);_0x3ae8b0(_0x5a7271);});});}exports['GetCmHopper']=function(_0x18f34f){var _0x2f4333=this;return new Promise(function(_0x2163d0,_0x4253d3){return db[_0x28de('0x12')][_0x28de('0x13')]({'raw':_0x18f34f[_0x28de('0x14')]?_0x18f34f[_0x28de('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x18f34f['options']?_0x18f34f[_0x28de('0x14')][_0x28de('0x15')]||null:null,'attributes':_0x18f34f['options']?_0x18f34f[_0x28de('0x14')][_0x28de('0x16')]||null:null,'limit':_0x18f34f[_0x28de('0x14')]?_0x18f34f[_0x28de('0x14')]['limit']||null:null,'include':_0x18f34f[_0x28de('0x14')]?_0x18f34f['options'][_0x28de('0x17')]?_[_0x28de('0x18')](_0x18f34f['options']['include'],function(_0x2b94db){return{'model':db[_0x2b94db[_0x28de('0x19')]],'as':_0x2b94db['as'],'attributes':_0x2b94db[_0x28de('0x16')],'include':_0x2b94db[_0x28de('0x17')]?_['map'](_0x2b94db[_0x28de('0x17')],function(_0x246924){return{'model':db[_0x246924['model']],'as':_0x246924['as'],'attributes':_0x246924[_0x28de('0x16')],'include':_0x246924[_0x28de('0x17')]?_['map'](_0x246924['include'],function(_0xb9fe67){return{'model':db[_0xb9fe67['model']],'as':_0xb9fe67['as'],'attributes':_0xb9fe67[_0x28de('0x16')]};}):[]};}):[]};}):[]:[]})[_0x28de('0x1a')](function(_0x31aff5){logger[_0x28de('0x9')](_0x28de('0x1b'),_0x18f34f);logger['debug'](_0x28de('0x1b'),_0x18f34f,JSON['stringify'](_0x31aff5));_0x2163d0(_0x31aff5);})[_0x28de('0x1c')](function(_0x3f5dc9){logger['error'](_0x28de('0x1b'),_0x3f5dc9['message'],_0x18f34f);_0x4253d3(_0x2f4333['error'](0x1f4,_0x3f5dc9[_0x28de('0x10')]));});});};exports['ShowCmHopper']=function(_0x5a0c28){var _0x144406=this;return new Promise(function(_0x519a53,_0x1097c6){return db[_0x28de('0x12')][_0x28de('0x1d')]({'raw':_0x5a0c28[_0x28de('0x14')]?_0x5a0c28[_0x28de('0x14')][_0x28de('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a0c28[_0x28de('0x14')]?_0x5a0c28[_0x28de('0x14')][_0x28de('0x15')]||null:null,'attributes':_0x5a0c28[_0x28de('0x14')]?_0x5a0c28[_0x28de('0x14')][_0x28de('0x16')]||null:null,'include':_0x5a0c28[_0x28de('0x14')]?_0x5a0c28[_0x28de('0x14')][_0x28de('0x17')]?_[_0x28de('0x18')](_0x5a0c28[_0x28de('0x14')]['include'],function(_0x2d0824){return{'model':db[_0x2d0824['model']],'as':_0x2d0824['as'],'attributes':_0x2d0824[_0x28de('0x16')],'include':_0x2d0824[_0x28de('0x17')]?_[_0x28de('0x18')](_0x2d0824['include'],function(_0x530bbd){return{'model':db[_0x530bbd[_0x28de('0x19')]],'as':_0x530bbd['as'],'attributes':_0x530bbd[_0x28de('0x16')],'include':_0x530bbd[_0x28de('0x17')]?_[_0x28de('0x18')](_0x530bbd[_0x28de('0x17')],function(_0x3036b7){return{'model':db[_0x3036b7['model']],'as':_0x3036b7['as'],'attributes':_0x3036b7[_0x28de('0x16')]};}):[]};}):[]};}):[]:[]})[_0x28de('0x1a')](function(_0x416419){logger[_0x28de('0x9')](_0x28de('0x1f'),_0x5a0c28);logger[_0x28de('0xc')](_0x28de('0x1f'),_0x5a0c28,JSON[_0x28de('0x20')](_0x416419));_0x519a53(_0x416419);})[_0x28de('0x1c')](function(_0x5e0ca1){logger[_0x28de('0xe')](_0x28de('0x1f'),_0x5e0ca1['message'],_0x5a0c28);_0x1097c6(_0x144406[_0x28de('0xe')](0x1f4,_0x5e0ca1[_0x28de('0x10')]));});});};exports[_0x28de('0x21')]=function(_0x33262d){var _0x1df36b=this;return new Promise(function(_0x527f3a,_0x26b0d4){return db[_0x28de('0x12')][_0x28de('0x22')](_0x33262d[_0x28de('0x23')],{'raw':_0x33262d['options']?_0x33262d[_0x28de('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x28de('0x1a')](function(_0x14571b){logger['info'](_0x28de('0x21'),_0x33262d);logger['debug'](_0x28de('0x21'),_0x33262d,JSON[_0x28de('0x20')](_0x14571b));_0x527f3a(_0x14571b);})[_0x28de('0x1c')](function(_0x787b87){logger[_0x28de('0xe')](_0x28de('0x21'),_0x787b87[_0x28de('0x10')],_0x33262d);_0x26b0d4(_0x1df36b[_0x28de('0xe')](0x1f4,_0x787b87['message']));});});};exports[_0x28de('0x24')]=function(_0x3f865d){var _0x467ad5=this;return new Promise(function(_0x3b0c88,_0x44cedd){return db['CmHopper'][_0x28de('0x25')](_0x3f865d[_0x28de('0x23')],{'raw':_0x3f865d['options']?_0x3f865d[_0x28de('0x14')][_0x28de('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f865d[_0x28de('0x14')]?_0x3f865d[_0x28de('0x14')][_0x28de('0x15')]||null:null,'attributes':_0x3f865d[_0x28de('0x14')]?_0x3f865d[_0x28de('0x14')]['attributes']||null:null,'limit':_0x3f865d['options']?_0x3f865d[_0x28de('0x14')]['limit']||null:null})[_0x28de('0x1a')](function(_0x1c50d2){logger[_0x28de('0x9')](_0x28de('0x24'),_0x3f865d);logger[_0x28de('0x9')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x3f865d[_0x28de('0x14')][_0x28de('0x15')]),_0x3f865d[_0x28de('0x23')][_0x28de('0x26')]);logger[_0x28de('0xc')](_0x28de('0x24'),_0x3f865d,JSON[_0x28de('0x20')](_0x1c50d2));_0x3b0c88(_0x1c50d2);})[_0x28de('0x1c')](function(_0x41a40e){logger['error']('UpdateCmHopper',_0x41a40e[_0x28de('0x10')],_0x3f865d);_0x44cedd(_0x467ad5['error'](0x1f4,_0x41a40e[_0x28de('0x10')]));});});};exports[_0x28de('0x27')]=function(_0x2529fc){var _0x1d38b4=this;return new Promise(function(_0x384560,_0x3d8b7d){return db[_0x28de('0x12')][_0x28de('0x28')]({'where':_0x2529fc[_0x28de('0x14')]?_0x2529fc['options'][_0x28de('0x15')]||null:null})[_0x28de('0x1a')](function(_0x2a0e27){logger[_0x28de('0x9')](_0x28de('0x27'),_0x2529fc);logger[_0x28de('0xc')](_0x28de('0x27'),_0x2529fc,JSON[_0x28de('0x20')](_0x2a0e27));_0x384560(_0x2a0e27);})[_0x28de('0x1c')](function(_0x30181a){logger[_0x28de('0xe')]('DestroyCmHopper',_0x30181a['message'],_0x2529fc);_0x3d8b7d(_0x1d38b4[_0x28de('0xe')](0x1f4,_0x30181a[_0x28de('0x10')]));});});};exports[_0x28de('0x29')]=function(_0x2623ec){var _0x1c27ca=this;return new Promise(function(_0x2ee436,_0x1484ea){return db['CmContact'][_0x28de('0x2a')]()[_0x28de('0x1a')](function(_0x404a42){return db[_0x28de('0x2b')][_0x28de('0x2c')](function(_0x3624a2){return db[_0x28de('0x12')]['findAll']({'where':_0x2623ec[_0x28de('0x14')]?_0x2623ec[_0x28de('0x14')]['where']||null:null,'attributes':_0x2623ec[_0x28de('0x14')]?_0x2623ec[_0x28de('0x14')][_0x28de('0x16')]||null:null,'limit':_0x2623ec[_0x28de('0x14')]?_0x2623ec['options'][_0x28de('0x2d')]||null:null,'order':_0x2623ec[_0x28de('0x14')]?_0x2623ec['options'][_0x28de('0x2e')]||null:null,'transaction':_0x3624a2,'lock':_0x3624a2[_0x28de('0x2f')][_0x28de('0x30')],'include':[{'model':db[_0x28de('0x31')],'as':_0x28de('0x32'),'attributes':_['keys'](_0x404a42)},{'model':db[_0x28de('0x33')],'as':_0x28de('0x34'),'attributes':['id','name',_0x28de('0x35')]}]})['then'](function(_0x13cfd2){var _0x4da372=[];var _0x139485=[];for(var _0x2c5908=0x0;_0x2c5908<_0x13cfd2[_0x28de('0x36')];_0x2c5908+=0x1){var _0x3525fe=_0x13cfd2[_0x2c5908]['UserId'];if(_0x3525fe===null){_0x4da372[_0x28de('0x37')](_0x13cfd2[_0x2c5908][_0x28de('0x25')](_0x2623ec['body'],{'transaction':_0x3624a2}));}else if(!_0x139485['includes'](_0x3525fe)){_0x139485['push'](_0x3525fe);_0x4da372[_0x28de('0x37')](_0x13cfd2[_0x2c5908][_0x28de('0x25')](_0x2623ec['body'],{'transaction':_0x3624a2}));}}return BPromise[_0x28de('0x38')](_0x4da372);});})[_0x28de('0x1a')](function(_0x800e36){logger[_0x28de('0x9')](_0x28de('0x29'),_0x2623ec);if(_0x800e36[_0x28de('0x36')]>0x0){logger[_0x28de('0x9')](_0x28de('0x39'),_0x800e36[0x0][_0x28de('0x3a')]['id'],_0x800e36[0x0][_0x28de('0x3a')][_0x28de('0x3b')],_0x800e36[0x0][_0x28de('0x3a')]['active']);}logger[_0x28de('0xc')](_0x28de('0x29'),_0x2623ec,JSON['stringify'](_0x800e36));_0x2ee436(_0x800e36);})['catch'](function(_0xf029c2){logger['error'](_0x28de('0x29'),_0xf029c2[_0x28de('0x10')],_0x2623ec);_0x1484ea(_0x1c27ca['error'](0x1f4,_0xf029c2[_0x28de('0x10')]));});});});};exports[_0x28de('0x3c')]=function(_0x2cd5df){var _0x529d56=this;return new Promise(function(_0x2ca191,_0x4fc617){return db['sequelize'][_0x28de('0x2c')](function(_0x52a4d9){return db[_0x28de('0x3d')][_0x28de('0x22')](_0x2cd5df['body'],{'raw':_0x2cd5df['options']?_0x2cd5df[_0x28de('0x14')][_0x28de('0x1e')]===undefined?!![]:![]:!![],'transaction':_0x52a4d9})[_0x28de('0x1a')](function(){logger[_0x28de('0x9')](_0x28de('0x3e'),JSON[_0x28de('0x20')](_0x2cd5df[_0x28de('0x14')]['where']),_0x2cd5df[_0x28de('0x14')][_0x28de('0x15')][_0x28de('0x26')]);return db[_0x28de('0x12')][_0x28de('0x28')]({'where':_0x2cd5df[_0x28de('0x14')]?_0x2cd5df[_0x28de('0x14')][_0x28de('0x15')]||null:null,'transaction':_0x52a4d9});});})[_0x28de('0x1a')](function(_0x47792f){logger[_0x28de('0x9')](_0x28de('0x3c'),_0x2cd5df);logger['debug'](_0x28de('0x3c'),_0x2cd5df,JSON[_0x28de('0x20')](_0x47792f));_0x2ca191(_0x47792f);})['catch'](function(_0x239987){logger[_0x28de('0xe')](_0x28de('0x3c'),_0x239987[_0x28de('0x10')],_0x2cd5df);_0x4fc617(_0x529d56[_0x28de('0xe')](0x1f4,_0x239987[_0x28de('0x10')]));});});};exports[_0x28de('0x3f')]=function(_0x323a82){var _0x40750a=this;return new Promise(function(_0x31799b,_0x4c36b7){return db[_0x28de('0x12')][_0x28de('0x13')]({'raw':_0x323a82[_0x28de('0x14')]?_0x323a82['options'][_0x28de('0x1e')]===undefined?!![]:![]:!![],'where':_0x323a82[_0x28de('0x14')]?_0x323a82[_0x28de('0x14')]['where']||null:null,'attributes':[[db[_0x28de('0x2b')]['fn'](_0x28de('0x40'),db[_0x28de('0x2b')]['fn']('IF',db[_0x28de('0x2b')]['literal'](_0x28de('0x41')+util[_0x28de('0x42')]('\x22%s\x22',moment()[_0x28de('0x42')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x28de('0x43')))),_0x28de('0x44')]]})[_0x28de('0x1a')](function(_0xebfd49){logger[_0x28de('0x9')](_0x28de('0x3f'),_0x323a82);logger[_0x28de('0xc')](_0x28de('0x3f'),_0x323a82,JSON[_0x28de('0x20')](_0xebfd49));_0x31799b(_0xebfd49);})['catch'](function(_0x1532d4){logger[_0x28de('0xe')]('CountReScheduled',_0x1532d4[_0x28de('0x10')],_0x323a82);_0x4c36b7(_0x40750a[_0x28de('0xe')](0x1f4,_0x1532d4[_0x28de('0x10')]));});});};exports[_0x28de('0x45')]=function(_0xdeac1a){var _0x294e49=this;return new Promise(function(_0x4b6385,_0x5eefcb){return db['CmContact'][_0x28de('0x2a')]()[_0x28de('0x1a')](function(_0x3609ec){return db[_0x28de('0x2b')][_0x28de('0x2c')](function(_0x1b2d97){return db[_0x28de('0x12')]['findAll']({'where':_0xdeac1a[_0x28de('0x14')]?_0xdeac1a['options'][_0x28de('0x15')]||null:null,'attributes':_0xdeac1a['options']?_0xdeac1a[_0x28de('0x14')][_0x28de('0x16')]||null:null,'limit':0x1,'order':_0xdeac1a[_0x28de('0x14')]?_0xdeac1a['options'][_0x28de('0x2e')]||null:null,'group':db[_0x28de('0x12')][_0x28de('0x46')],'transaction':_0x1b2d97,'lock':_0x1b2d97[_0x28de('0x2f')]['UPDATE'],'include':_0xdeac1a['options']?_0xdeac1a[_0x28de('0x14')]['include']?_[_0x28de('0x18')](_0xdeac1a[_0x28de('0x14')]['include'],function(_0x4a37f9){return{'model':db[_0x4a37f9[_0x28de('0x19')]],'as':_0x4a37f9['as'],'attributes':_0x4a37f9[_0x28de('0x16')],'include':_0x4a37f9['include']?_['map'](_0x4a37f9[_0x28de('0x17')],function(_0x2e6f4c){return{'model':db[_0x2e6f4c[_0x28de('0x19')]],'as':_0x2e6f4c['as'],'attributes':_0x2e6f4c['attributes'],'include':_0x2e6f4c['include']?_[_0x28de('0x18')](_0x2e6f4c[_0x28de('0x17')],function(_0x5dab34){return{'model':db[_0x5dab34[_0x28de('0x19')]],'as':_0x5dab34['as'],'attributes':_0x5dab34[_0x28de('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f2c32){var _0x24bcd2=[];for(var _0x28639d=0x0;_0x28639d<_0x5f2c32[_0x28de('0x36')];_0x28639d+=0x1){_0x24bcd2[_0x28de('0x37')](_0x5f2c32[_0x28639d]['update'](_0xdeac1a[_0x28de('0x23')],{'transaction':_0x1b2d97}));}return BPromise[_0x28de('0x38')](_0x24bcd2);});})['then'](function(_0x511b7f){logger[_0x28de('0x9')]('GetContactRecallMe',_0xdeac1a);logger[_0x28de('0xc')](_0x28de('0x45'),_0xdeac1a,JSON[_0x28de('0x20')](_0x511b7f));_0x4b6385(_0x511b7f);})[_0x28de('0x1c')](function(_0x20b418){logger[_0x28de('0xe')]('GetContactRecallMe',_0x20b418['message'],_0xdeac1a);_0x5eefcb(_0x294e49[_0x28de('0xe')](0x1f4,_0x20b418[_0x28de('0x10')]));});});});};exports[_0x28de('0x47')]=function(_0x4bb8aa){var _0x297ab1=this;return new Promise(function(_0x17717c,_0x2eb5f4){db[_0x28de('0x31')][_0x28de('0x2a')]()['then'](function(_0x392226){return db[_0x28de('0x12')][_0x28de('0x13')]({'raw':_0x4bb8aa[_0x28de('0x14')]?_0x4bb8aa[_0x28de('0x14')][_0x28de('0x1e')]===undefined?!![]:![]:!![],'where':_0x4bb8aa[_0x28de('0x14')]?_0x4bb8aa[_0x28de('0x14')][_0x28de('0x15')]||null:null,'attributes':_0x4bb8aa[_0x28de('0x14')]?_0x4bb8aa['options'][_0x28de('0x16')]||null:null,'limit':_0x4bb8aa['options']?_0x4bb8aa[_0x28de('0x14')][_0x28de('0x2d')]||null:null,'include':_0x4bb8aa['options']?_0x4bb8aa[_0x28de('0x14')]['include']?_[_0x28de('0x18')](_0x4bb8aa['options'][_0x28de('0x17')],function(_0x6f5da4){return{'model':db[_0x6f5da4[_0x28de('0x19')]],'as':_0x6f5da4['as'],'attributes':_0x6f5da4['as']===_0x28de('0x32')?_[_0x28de('0x48')](_0x392226):_0x6f5da4[_0x28de('0x16')],'include':_0x6f5da4['include']?_[_0x28de('0x18')](_0x6f5da4['include'],function(_0x38b48b){return{'model':db[_0x38b48b[_0x28de('0x19')]],'as':_0x38b48b['as'],'attributes':_0x38b48b[_0x28de('0x16')],'include':_0x38b48b['include']?_[_0x28de('0x18')](_0x38b48b[_0x28de('0x17')],function(_0xfb29ba){return{'model':db[_0xfb29ba[_0x28de('0x19')]],'as':_0xfb29ba['as'],'attributes':_0xfb29ba[_0x28de('0x16')]};}):[]};}):[]};}):[]:[]})[_0x28de('0x1a')](function(_0x273b31){logger['info'](_0x28de('0x1b'),_0x4bb8aa);logger[_0x28de('0xc')](_0x28de('0x1b'),_0x4bb8aa,JSON[_0x28de('0x20')](_0x273b31));_0x17717c(_0x273b31);})[_0x28de('0x1c')](function(_0x305606){logger['error'](_0x28de('0x1b'),_0x305606['message'],_0x4bb8aa);_0x2eb5f4(_0x297ab1[_0x28de('0xe')](0x1f4,_0x305606['message']));});});});};exports[_0x28de('0x49')]=function(_0x317cd5){var _0x153e35=this;return new Promise(function(_0x499890,_0x533d49){return db[_0x28de('0x31')][_0x28de('0x4a')]({'raw':!![],'where':{'phone':_0x317cd5['options']['where'][_0x28de('0x4b')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x28de('0x1a')](function(_0x45e5bf){logger[_0x28de('0x9')](_0x28de('0x4c'),_0x317cd5);logger['debug'](_0x28de('0x4c'),_0x317cd5,JSON[_0x28de('0x20')](_0x45e5bf));_0x499890(_0x45e5bf);})[_0x28de('0x1c')](function(_0x11c4cb){logger[_0x28de('0xe')](_0x28de('0x4c'),_0x11c4cb[_0x28de('0x10')],_0x317cd5);_0x533d49(_0x153e35[_0x28de('0xe')](0x1f4,_0x11c4cb[_0x28de('0x10')]));});});};exports[_0x28de('0x4d')]=function(_0x533898){var _0x3d609a=this;return new Promise(function(_0x33a72d,_0x4989fd){return db[_0x28de('0x2b')][_0x28de('0x2c')](function(_0x4a96d3){return db['CmHopper'][_0x28de('0x25')](_0x533898[_0x28de('0x23')],{'where':{},'transaction':_0x4a96d3})[_0x28de('0x1a')](function(_0x3b2802){logger[_0x28de('0x9')](_0x28de('0x4d'),_0x533898);logger[_0x28de('0xc')](_0x28de('0x4d'),_0x533898,JSON[_0x28de('0x20')](_0x3b2802));_0x33a72d(_0x3b2802);})[_0x28de('0x1c')](function(_0x4e9463){logger[_0x28de('0xe')]('ResetActiveCalls',_0x4e9463[_0x28de('0x10')],_0x533898);_0x4989fd(_0x3d609a[_0x28de('0xe')](0x1f4,_0x4e9463[_0x28de('0x10')]));});});});};exports[_0x28de('0x4e')]=function(_0x3d8c54){var _0x87df6c=this;var _0x2d7681=_0x3d8c54[_0x28de('0x23')][_0x28de('0x15')][_0x28de('0x4f')];var _0x37a135=_0x3d8c54[_0x28de('0x23')][_0x28de('0x15')][_0x28de('0x50')];var _0x38998b=_0x3d8c54[_0x28de('0x23')]['where'][_0x28de('0x51')];return new Promise(function(_0x413e78,_0x2293c2){return db['CmHopper'][_0x28de('0x13')]({'where':{'voiceQueueId':{'$in':_0x2d7681},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x28de('0x52')](_0x28de('0x53')+_0x37a135+'\x20MINUTE'),'$gt':db[_0x28de('0x2b')][_0x28de('0x52')](_0x28de('0x54'))}},'UserId':{'$in':_0x38998b}},'include':[{'model':db['CmContact'],'as':_0x28de('0x32')},{'model':db[_0x28de('0x33')],'as':'Agent','attributes':['id',_0x28de('0x55'),_0x28de('0x35')]},{'model':db['CmList'],'as':_0x28de('0x56')}]})[_0x28de('0x1a')](function(_0x11e690){if(_0x11e690['length']>0x0){return db[_0x28de('0x2b')][_0x28de('0x2c')](function(_0x4df24e){return db[_0x28de('0x12')]['update']({'recallmeNotifiedDate':db['sequelize']['literal']('NOW()')},{'where':{'id':{'$in':_[_0x28de('0x18')](_0x11e690,'id')}},'transaction':_0x4df24e})[_0x28de('0x1a')](function(){_0x413e78(_0x11e690);})[_0x28de('0x1c')](function(_0x3196a1){logger[_0x28de('0xe')](_0x28de('0x4e'),_0x3196a1[_0x28de('0x10')],_0x3d8c54);_0x2293c2(_0x87df6c[_0x28de('0xe')](0x1f4,_0x3196a1[_0x28de('0x10')]));});})[_0x28de('0x1c')](function(_0x5d85e1){logger[_0x28de('0xe')](_0x28de('0x4e'),_0x5d85e1[_0x28de('0x10')],_0x3d8c54);_0x2293c2(_0x87df6c['error'](0x1f4,_0x5d85e1['message']));});}else{_0x413e78(_0x11e690);}});});}; \ No newline at end of file +var _0x7027=['format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','LOCK','Contact','GetContactByPhone','findOne','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()','CmList','List','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CmHopper','findAll','options','raw','where','attributes','limit','map','model','include','debug','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','body','active','destroy','DestroyCmHopper','GetContactDialer','CmContact','sequelize','transaction','order','UPDATE','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20'];(function(_0x588c1c,_0x1f581f){var _0x476dd9=function(_0x32a2f9){while(--_0x32a2f9){_0x588c1c['push'](_0x588c1c['shift']());}};_0x476dd9(++_0x1f581f);}(_0x7027,0x6d));var _0x7702=function(_0x280786,_0x3b8193){_0x280786=_0x280786-0x0;var _0x27927e=_0x7027[_0x280786];return _0x27927e;};'use strict';var _=require(_0x7702('0x0'));var util=require('util');var moment=require(_0x7702('0x1'));var BPromise=require(_0x7702('0x2'));var db=require(_0x7702('0x3'))['db'];var logger=require(_0x7702('0x4'))(_0x7702('0x5'));var jayson=require(_0x7702('0x6'));var client=jayson['client'][_0x7702('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x458fc7,_0x33b02b,_0x203b78){return new BPromise(function(_0x49d663,_0xcdf48c){return client[_0x7702('0x8')](_0x458fc7,_0x203b78)[_0x7702('0x9')](function(_0x265729){logger['info'](_0x7702('0xa'),_0x33b02b,_0x7702('0xb'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x33b02b,_0x7702('0xb'),JSON[_0x7702('0xc')](_0x265729));if(_0x265729[_0x7702('0xd')]){if(_0x265729[_0x7702('0xd')][_0x7702('0xe')]===0x1f4){logger[_0x7702('0xd')](_0x7702('0xa'),_0x33b02b,_0x265729[_0x7702('0xd')]['message']);return _0xcdf48c(_0x265729[_0x7702('0xd')][_0x7702('0xf')]);}logger[_0x7702('0xd')](_0x7702('0xa'),_0x33b02b,_0x265729[_0x7702('0xd')][_0x7702('0xf')]);return _0x49d663(_0x265729['error']['message']);}else{logger[_0x7702('0x10')]('CmHopper,\x20%s,\x20%s',_0x33b02b,_0x7702('0xb'));_0x49d663(_0x265729[_0x7702('0x11')][_0x7702('0xf')]);}})[_0x7702('0x12')](function(_0x1913df){logger[_0x7702('0xd')]('CmHopper,\x20%s,\x20%s',_0x33b02b,_0x1913df);_0xcdf48c(_0x1913df);});});}exports['GetCmHopper']=function(_0x2cca5a){var _0x143c20=this;return new Promise(function(_0x46c20b,_0x42c9d6){return db[_0x7702('0x13')][_0x7702('0x14')]({'raw':_0x2cca5a[_0x7702('0x15')]?_0x2cca5a[_0x7702('0x15')][_0x7702('0x16')]===undefined?!![]:![]:!![],'where':_0x2cca5a[_0x7702('0x15')]?_0x2cca5a['options'][_0x7702('0x17')]||null:null,'attributes':_0x2cca5a['options']?_0x2cca5a['options'][_0x7702('0x18')]||null:null,'limit':_0x2cca5a['options']?_0x2cca5a[_0x7702('0x15')][_0x7702('0x19')]||null:null,'include':_0x2cca5a['options']?_0x2cca5a[_0x7702('0x15')]['include']?_[_0x7702('0x1a')](_0x2cca5a['options']['include'],function(_0x25967f){return{'model':db[_0x25967f['model']],'as':_0x25967f['as'],'attributes':_0x25967f[_0x7702('0x18')],'include':_0x25967f['include']?_[_0x7702('0x1a')](_0x25967f['include'],function(_0x6fa372){return{'model':db[_0x6fa372[_0x7702('0x1b')]],'as':_0x6fa372['as'],'attributes':_0x6fa372[_0x7702('0x18')],'include':_0x6fa372[_0x7702('0x1c')]?_[_0x7702('0x1a')](_0x6fa372[_0x7702('0x1c')],function(_0x4c2e1b){return{'model':db[_0x4c2e1b[_0x7702('0x1b')]],'as':_0x4c2e1b['as'],'attributes':_0x4c2e1b[_0x7702('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x920edd){logger[_0x7702('0x10')]('GetCmHopper',_0x2cca5a);logger[_0x7702('0x1d')](_0x7702('0x1e'),_0x2cca5a,JSON['stringify'](_0x920edd));_0x46c20b(_0x920edd);})['catch'](function(_0x2cd313){logger['error']('GetCmHopper',_0x2cd313[_0x7702('0xf')],_0x2cca5a);_0x42c9d6(_0x143c20['error'](0x1f4,_0x2cd313[_0x7702('0xf')]));});});};exports[_0x7702('0x1f')]=function(_0x39426f){var _0x3cd3de=this;return new Promise(function(_0x50beec,_0x38f0ee){return db[_0x7702('0x13')][_0x7702('0x20')]({'raw':_0x39426f['options']?_0x39426f[_0x7702('0x15')][_0x7702('0x16')]===undefined?!![]:![]:!![],'where':_0x39426f[_0x7702('0x15')]?_0x39426f[_0x7702('0x15')]['where']||null:null,'attributes':_0x39426f[_0x7702('0x15')]?_0x39426f['options'][_0x7702('0x18')]||null:null,'include':_0x39426f['options']?_0x39426f[_0x7702('0x15')][_0x7702('0x1c')]?_[_0x7702('0x1a')](_0x39426f['options'][_0x7702('0x1c')],function(_0x41148e){return{'model':db[_0x41148e[_0x7702('0x1b')]],'as':_0x41148e['as'],'attributes':_0x41148e['attributes'],'include':_0x41148e[_0x7702('0x1c')]?_['map'](_0x41148e[_0x7702('0x1c')],function(_0x450146){return{'model':db[_0x450146['model']],'as':_0x450146['as'],'attributes':_0x450146[_0x7702('0x18')],'include':_0x450146[_0x7702('0x1c')]?_['map'](_0x450146[_0x7702('0x1c')],function(_0xdbb3b6){return{'model':db[_0xdbb3b6[_0x7702('0x1b')]],'as':_0xdbb3b6['as'],'attributes':_0xdbb3b6[_0x7702('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7702('0x9')](function(_0x191b13){logger[_0x7702('0x10')]('ShowCmHopper',_0x39426f);logger[_0x7702('0x1d')](_0x7702('0x1f'),_0x39426f,JSON['stringify'](_0x191b13));_0x50beec(_0x191b13);})[_0x7702('0x12')](function(_0x4eb356){logger[_0x7702('0xd')](_0x7702('0x1f'),_0x4eb356[_0x7702('0xf')],_0x39426f);_0x38f0ee(_0x3cd3de[_0x7702('0xd')](0x1f4,_0x4eb356[_0x7702('0xf')]));});});};exports[_0x7702('0x21')]=function(_0x16228b){var _0x2d8d13=this;return new Promise(function(_0x3720af,_0x530464){return db['CmHopper'][_0x7702('0x22')](_0x16228b['body'],{'raw':_0x16228b[_0x7702('0x15')]?_0x16228b[_0x7702('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x7702('0x9')](function(_0x1bbcf8){logger['info'](_0x7702('0x21'),_0x16228b);logger['debug'](_0x7702('0x21'),_0x16228b,JSON[_0x7702('0xc')](_0x1bbcf8));_0x3720af(_0x1bbcf8);})['catch'](function(_0x1bdc01){logger[_0x7702('0xd')]('CreateCmHopper',_0x1bdc01['message'],_0x16228b);_0x530464(_0x2d8d13[_0x7702('0xd')](0x1f4,_0x1bdc01[_0x7702('0xf')]));});});};exports[_0x7702('0x23')]=function(_0xeac80a){var _0x118f94=this;return new Promise(function(_0x53d2fd,_0x5595f9){return db[_0x7702('0x13')][_0x7702('0x24')](_0xeac80a[_0x7702('0x25')],{'raw':_0xeac80a['options']?_0xeac80a[_0x7702('0x15')][_0x7702('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeac80a[_0x7702('0x15')]?_0xeac80a['options'][_0x7702('0x17')]||null:null,'attributes':_0xeac80a[_0x7702('0x15')]?_0xeac80a[_0x7702('0x15')][_0x7702('0x18')]||null:null,'limit':_0xeac80a[_0x7702('0x15')]?_0xeac80a[_0x7702('0x15')][_0x7702('0x19')]||null:null})['then'](function(_0x588116){logger[_0x7702('0x10')](_0x7702('0x23'),_0xeac80a);logger[_0x7702('0x10')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x7702('0xc')](_0xeac80a[_0x7702('0x15')]['where']),_0xeac80a['body'][_0x7702('0x26')]);logger[_0x7702('0x1d')](_0x7702('0x23'),_0xeac80a,JSON[_0x7702('0xc')](_0x588116));_0x53d2fd(_0x588116);})[_0x7702('0x12')](function(_0x2511b1){logger[_0x7702('0xd')](_0x7702('0x23'),_0x2511b1[_0x7702('0xf')],_0xeac80a);_0x5595f9(_0x118f94['error'](0x1f4,_0x2511b1[_0x7702('0xf')]));});});};exports['DestroyCmHopper']=function(_0x4148b5){var _0x145347=this;return new Promise(function(_0x314e0b,_0x34c2fa){return db[_0x7702('0x13')][_0x7702('0x27')]({'where':_0x4148b5[_0x7702('0x15')]?_0x4148b5[_0x7702('0x15')][_0x7702('0x17')]||null:null})[_0x7702('0x9')](function(_0x78f514){logger[_0x7702('0x10')](_0x7702('0x28'),_0x4148b5);logger['debug'](_0x7702('0x28'),_0x4148b5,JSON['stringify'](_0x78f514));_0x314e0b(_0x78f514);})[_0x7702('0x12')](function(_0x12c558){logger['error']('DestroyCmHopper',_0x12c558[_0x7702('0xf')],_0x4148b5);_0x34c2fa(_0x145347[_0x7702('0xd')](0x1f4,_0x12c558['message']));});});};exports[_0x7702('0x29')]=function(_0x47f3af){var _0xf09998=this;return new Promise(function(_0x2e3216,_0x299528){return db[_0x7702('0x2a')]['describe']()['then'](function(_0x55713a){return db[_0x7702('0x2b')][_0x7702('0x2c')](function(_0xfdf39c){return db[_0x7702('0x13')]['findAll']({'where':_0x47f3af[_0x7702('0x15')]?_0x47f3af[_0x7702('0x15')]['where']||null:null,'attributes':_0x47f3af['options']?_0x47f3af['options'][_0x7702('0x18')]||null:null,'limit':_0x47f3af[_0x7702('0x15')]?_0x47f3af[_0x7702('0x15')]['limit']||null:null,'order':_0x47f3af[_0x7702('0x15')]?_0x47f3af['options'][_0x7702('0x2d')]||null:null,'transaction':_0xfdf39c,'lock':_0xfdf39c['LOCK'][_0x7702('0x2e')],'include':[{'model':db[_0x7702('0x2a')],'as':'Contact','attributes':_[_0x7702('0x2f')](_0x55713a)},{'model':db[_0x7702('0x30')],'as':_0x7702('0x31'),'attributes':['id',_0x7702('0x32'),_0x7702('0x33')]}]})[_0x7702('0x9')](function(_0x1a8727){var _0x23bdf0=[];var _0x3e0215=[];for(var _0x86a4f7=0x0;_0x86a4f7<_0x1a8727[_0x7702('0x34')];_0x86a4f7+=0x1){var _0x52b0dd=_0x1a8727[_0x86a4f7][_0x7702('0x35')];if(_0x52b0dd===null){_0x23bdf0[_0x7702('0x36')](_0x1a8727[_0x86a4f7]['update'](_0x47f3af[_0x7702('0x25')],{'transaction':_0xfdf39c}));}else if(!_0x3e0215[_0x7702('0x37')](_0x52b0dd)){_0x3e0215[_0x7702('0x36')](_0x52b0dd);_0x23bdf0[_0x7702('0x36')](_0x1a8727[_0x86a4f7]['update'](_0x47f3af[_0x7702('0x25')],{'transaction':_0xfdf39c}));}}return BPromise[_0x7702('0x38')](_0x23bdf0);});})[_0x7702('0x9')](function(_0x2ede38){logger['info'](_0x7702('0x29'),_0x47f3af);if(_0x2ede38['length']>0x0){logger[_0x7702('0x10')](_0x7702('0x39'),_0x2ede38[0x0][_0x7702('0x3a')]['id'],_0x2ede38[0x0][_0x7702('0x3a')][_0x7702('0x3b')],_0x2ede38[0x0][_0x7702('0x3a')][_0x7702('0x26')]);}logger[_0x7702('0x1d')](_0x7702('0x29'),_0x47f3af,JSON[_0x7702('0xc')](_0x2ede38));_0x2e3216(_0x2ede38);})[_0x7702('0x12')](function(_0x28525d){logger[_0x7702('0xd')](_0x7702('0x29'),_0x28525d[_0x7702('0xf')],_0x47f3af);_0x299528(_0xf09998[_0x7702('0xd')](0x1f4,_0x28525d[_0x7702('0xf')]));});});});};exports['MoveContactManagedDialer']=function(_0xb23758){var _0x55b618=this;return new Promise(function(_0x2ead2f,_0x2bffa0){return db[_0x7702('0x2b')][_0x7702('0x2c')](function(_0x2df02e){return db[_0x7702('0x3c')][_0x7702('0x22')](_0xb23758[_0x7702('0x25')],{'raw':_0xb23758[_0x7702('0x15')]?_0xb23758[_0x7702('0x15')][_0x7702('0x16')]===undefined?!![]:![]:!![],'transaction':_0x2df02e})['then'](function(){logger[_0x7702('0x10')](_0x7702('0x3d'),JSON[_0x7702('0xc')](_0xb23758['options'][_0x7702('0x17')]),_0xb23758['options'][_0x7702('0x17')]['active']);return db[_0x7702('0x13')]['destroy']({'where':_0xb23758[_0x7702('0x15')]?_0xb23758[_0x7702('0x15')][_0x7702('0x17')]||null:null,'transaction':_0x2df02e});});})[_0x7702('0x9')](function(_0x489398){logger[_0x7702('0x10')](_0x7702('0x3e'),_0xb23758);logger[_0x7702('0x1d')](_0x7702('0x3e'),_0xb23758,JSON[_0x7702('0xc')](_0x489398));_0x2ead2f(_0x489398);})[_0x7702('0x12')](function(_0x2e3894){logger[_0x7702('0xd')](_0x7702('0x3e'),_0x2e3894[_0x7702('0xf')],_0xb23758);_0x2bffa0(_0x55b618[_0x7702('0xd')](0x1f4,_0x2e3894[_0x7702('0xf')]));});});};exports[_0x7702('0x3f')]=function(_0x527bdb){var _0x56a8d3=this;return new Promise(function(_0x14e427,_0x45ba13){return db[_0x7702('0x13')][_0x7702('0x14')]({'raw':_0x527bdb[_0x7702('0x15')]?_0x527bdb[_0x7702('0x15')][_0x7702('0x16')]===undefined?!![]:![]:!![],'where':_0x527bdb[_0x7702('0x15')]?_0x527bdb['options'][_0x7702('0x17')]||null:null,'attributes':[[db['sequelize']['fn'](_0x7702('0x40'),db['sequelize']['fn']('IF',db['sequelize'][_0x7702('0x41')](_0x7702('0x42')+util[_0x7702('0x43')](_0x7702('0x44'),moment()[_0x7702('0x43')](_0x7702('0x45')))+_0x7702('0x46')))),_0x7702('0x47')]]})[_0x7702('0x9')](function(_0xd3319b){logger[_0x7702('0x10')]('CountReScheduled',_0x527bdb);logger[_0x7702('0x1d')](_0x7702('0x3f'),_0x527bdb,JSON['stringify'](_0xd3319b));_0x14e427(_0xd3319b);})[_0x7702('0x12')](function(_0x23efcc){logger[_0x7702('0xd')]('CountReScheduled',_0x23efcc[_0x7702('0xf')],_0x527bdb);_0x45ba13(_0x56a8d3[_0x7702('0xd')](0x1f4,_0x23efcc[_0x7702('0xf')]));});});};exports[_0x7702('0x48')]=function(_0x5c926d){var _0x3c2685=this;return new Promise(function(_0x42b8ba,_0x39507f){return db[_0x7702('0x2a')][_0x7702('0x49')]()[_0x7702('0x9')](function(_0x48eee4){return db[_0x7702('0x2b')]['transaction'](function(_0x4e8257){return db['CmHopper']['findAll']({'where':_0x5c926d[_0x7702('0x15')]?_0x5c926d[_0x7702('0x15')][_0x7702('0x17')]||null:null,'attributes':_0x5c926d['options']?_0x5c926d[_0x7702('0x15')][_0x7702('0x18')]||null:null,'limit':0x1,'order':_0x5c926d['options']?_0x5c926d[_0x7702('0x15')][_0x7702('0x2d')]||null:null,'group':db[_0x7702('0x13')][_0x7702('0x35')],'transaction':_0x4e8257,'lock':_0x4e8257[_0x7702('0x4a')]['UPDATE'],'include':_0x5c926d[_0x7702('0x15')]?_0x5c926d[_0x7702('0x15')][_0x7702('0x1c')]?_[_0x7702('0x1a')](_0x5c926d[_0x7702('0x15')][_0x7702('0x1c')],function(_0x1c4514){return{'model':db[_0x1c4514[_0x7702('0x1b')]],'as':_0x1c4514['as'],'attributes':_0x1c4514[_0x7702('0x18')],'include':_0x1c4514[_0x7702('0x1c')]?_[_0x7702('0x1a')](_0x1c4514[_0x7702('0x1c')],function(_0x1a435a){return{'model':db[_0x1a435a[_0x7702('0x1b')]],'as':_0x1a435a['as'],'attributes':_0x1a435a[_0x7702('0x18')],'include':_0x1a435a[_0x7702('0x1c')]?_[_0x7702('0x1a')](_0x1a435a[_0x7702('0x1c')],function(_0x40929e){return{'model':db[_0x40929e[_0x7702('0x1b')]],'as':_0x40929e['as'],'attributes':_0x40929e['attributes']};}):[]};}):[]};}):[]:[]})[_0x7702('0x9')](function(_0xab285d){var _0x8118b3=[];for(var _0x8eba60=0x0;_0x8eba60<_0xab285d[_0x7702('0x34')];_0x8eba60+=0x1){_0x8118b3[_0x7702('0x36')](_0xab285d[_0x8eba60]['update'](_0x5c926d[_0x7702('0x25')],{'transaction':_0x4e8257}));}return BPromise[_0x7702('0x38')](_0x8118b3);});})[_0x7702('0x9')](function(_0x45925e){logger['info'](_0x7702('0x48'),_0x5c926d);logger[_0x7702('0x1d')](_0x7702('0x48'),_0x5c926d,JSON[_0x7702('0xc')](_0x45925e));_0x42b8ba(_0x45925e);})[_0x7702('0x12')](function(_0x547a8e){logger[_0x7702('0xd')](_0x7702('0x48'),_0x547a8e[_0x7702('0xf')],_0x5c926d);_0x39507f(_0x3c2685[_0x7702('0xd')](0x1f4,_0x547a8e[_0x7702('0xf')]));});});});};exports['GetCmHopperPreview']=function(_0x3bdbff){var _0x3e0f21=this;return new Promise(function(_0x2af322,_0x573c53){db['CmContact'][_0x7702('0x49')]()[_0x7702('0x9')](function(_0x33ae8b){return db[_0x7702('0x13')][_0x7702('0x14')]({'raw':_0x3bdbff[_0x7702('0x15')]?_0x3bdbff[_0x7702('0x15')][_0x7702('0x16')]===undefined?!![]:![]:!![],'where':_0x3bdbff[_0x7702('0x15')]?_0x3bdbff[_0x7702('0x15')][_0x7702('0x17')]||null:null,'attributes':_0x3bdbff[_0x7702('0x15')]?_0x3bdbff['options']['attributes']||null:null,'limit':_0x3bdbff[_0x7702('0x15')]?_0x3bdbff[_0x7702('0x15')][_0x7702('0x19')]||null:null,'include':_0x3bdbff['options']?_0x3bdbff[_0x7702('0x15')]['include']?_['map'](_0x3bdbff[_0x7702('0x15')][_0x7702('0x1c')],function(_0xc9ccbd){return{'model':db[_0xc9ccbd[_0x7702('0x1b')]],'as':_0xc9ccbd['as'],'attributes':_0xc9ccbd['as']===_0x7702('0x4b')?_[_0x7702('0x2f')](_0x33ae8b):_0xc9ccbd['attributes'],'include':_0xc9ccbd['include']?_[_0x7702('0x1a')](_0xc9ccbd[_0x7702('0x1c')],function(_0x49f039){return{'model':db[_0x49f039[_0x7702('0x1b')]],'as':_0x49f039['as'],'attributes':_0x49f039['attributes'],'include':_0x49f039['include']?_['map'](_0x49f039['include'],function(_0xb4399f){return{'model':db[_0xb4399f[_0x7702('0x1b')]],'as':_0xb4399f['as'],'attributes':_0xb4399f[_0x7702('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7702('0x9')](function(_0x4239d3){logger[_0x7702('0x10')](_0x7702('0x1e'),_0x3bdbff);logger['debug'](_0x7702('0x1e'),_0x3bdbff,JSON[_0x7702('0xc')](_0x4239d3));_0x2af322(_0x4239d3);})['catch'](function(_0x238b91){logger[_0x7702('0xd')](_0x7702('0x1e'),_0x238b91[_0x7702('0xf')],_0x3bdbff);_0x573c53(_0x3e0f21[_0x7702('0xd')](0x1f4,_0x238b91[_0x7702('0xf')]));});});});};exports[_0x7702('0x4c')]=function(_0xf34186){var _0x343a77=this;return new Promise(function(_0x308580,_0x50ef21){return db[_0x7702('0x2a')][_0x7702('0x4d')]({'raw':!![],'where':{'phone':_0xf34186[_0x7702('0x15')][_0x7702('0x17')][_0x7702('0x4e')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x7702('0x9')](function(_0x29e12d){logger[_0x7702('0x10')]('getContactByPhone',_0xf34186);logger[_0x7702('0x1d')]('getContactByPhone',_0xf34186,JSON['stringify'](_0x29e12d));_0x308580(_0x29e12d);})[_0x7702('0x12')](function(_0x299d88){logger[_0x7702('0xd')](_0x7702('0x4f'),_0x299d88[_0x7702('0xf')],_0xf34186);_0x50ef21(_0x343a77[_0x7702('0xd')](0x1f4,_0x299d88[_0x7702('0xf')]));});});};exports[_0x7702('0x50')]=function(_0x47c8a0){var _0x54c421=this;return new Promise(function(_0x14c55e,_0x451730){return db[_0x7702('0x2b')][_0x7702('0x2c')](function(_0x4056ae){return db[_0x7702('0x13')][_0x7702('0x24')](_0x47c8a0[_0x7702('0x25')],{'where':{},'transaction':_0x4056ae})[_0x7702('0x9')](function(_0x35f877){logger[_0x7702('0x10')](_0x7702('0x50'),_0x47c8a0);logger['debug']('ResetActiveCalls',_0x47c8a0,JSON[_0x7702('0xc')](_0x35f877));_0x14c55e(_0x35f877);})[_0x7702('0x12')](function(_0x1add4c){logger[_0x7702('0xd')]('ResetActiveCalls',_0x1add4c[_0x7702('0xf')],_0x47c8a0);_0x451730(_0x54c421[_0x7702('0xd')](0x1f4,_0x1add4c['message']));});});});};exports[_0x7702('0x51')]=function(_0x376621){var _0x4b7665=this;var _0x1210ab=_0x376621[_0x7702('0x25')][_0x7702('0x17')][_0x7702('0x52')];var _0x1275c8=_0x376621[_0x7702('0x25')][_0x7702('0x17')][_0x7702('0x53')];var _0x5d2186=_0x376621[_0x7702('0x25')][_0x7702('0x17')][_0x7702('0x54')];return new Promise(function(_0x2ebb23,_0x45818d){return db[_0x7702('0x13')]['findAll']({'where':{'voiceQueueId':{'$in':_0x1210ab},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x7702('0x2b')][_0x7702('0x41')]('NOW()\x20+\x20INTERVAL\x20'+_0x1275c8+'\x20MINUTE'),'$gt':db[_0x7702('0x2b')][_0x7702('0x41')](_0x7702('0x55'))}},'UserId':{'$in':_0x5d2186}},'include':[{'model':db[_0x7702('0x2a')],'as':'Contact'},{'model':db[_0x7702('0x30')],'as':_0x7702('0x31'),'attributes':['id',_0x7702('0x32'),'voicePause']},{'model':db[_0x7702('0x56')],'as':_0x7702('0x57')}]})[_0x7702('0x9')](function(_0x27e6fc){if(_0x27e6fc[_0x7702('0x34')]>0x0){return db[_0x7702('0x2b')][_0x7702('0x2c')](function(_0x23b0eb){return db['CmHopper'][_0x7702('0x24')]({'recallmeNotifiedDate':db[_0x7702('0x2b')]['literal'](_0x7702('0x55'))},{'where':{'id':{'$in':_[_0x7702('0x1a')](_0x27e6fc,'id')}},'transaction':_0x23b0eb})[_0x7702('0x9')](function(){_0x2ebb23(_0x27e6fc);})[_0x7702('0x12')](function(_0x45e444){logger['error'](_0x7702('0x51'),_0x45e444['message'],_0x376621);_0x45818d(_0x4b7665[_0x7702('0xd')](0x1f4,_0x45e444[_0x7702('0xf')]));});})[_0x7702('0x12')](function(_0xcc8a64){logger[_0x7702('0xd')]('CmHopperHandlePreviewRecallNotifications',_0xcc8a64[_0x7702('0xf')],_0x376621);_0x45818d(_0x4b7665[_0x7702('0xd')](0x1f4,_0xcc8a64['message']));});}else{_0x2ebb23(_0x27e6fc);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 69b0657..105e358 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 _0x4c07=['delete','destroy','exports','express','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','/timezone','getTimezone','put','update'];(function(_0x24cf4b,_0x1ade3b){var _0x31120a=function(_0x4f001c){while(--_0x4f001c){_0x24cf4b['push'](_0x24cf4b['shift']());}};_0x31120a(++_0x1ade3b);}(_0x4c07,0x117));var _0x74c0=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x4c07[_0x26b5ff];return _0x58603e;};'use strict';var express=require(_0x74c0('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x74c0('0x1'));router[_0x74c0('0x2')]('/',auth[_0x74c0('0x3')](),controller[_0x74c0('0x4')]);router[_0x74c0('0x2')](_0x74c0('0x5'),auth[_0x74c0('0x3')](),controller[_0x74c0('0x6')]);router[_0x74c0('0x2')](_0x74c0('0x7'),auth[_0x74c0('0x3')](),controller['getOpenContacts']);router[_0x74c0('0x2')](_0x74c0('0x8'),auth['isAuthenticated'](),controller['getTimezones']);router[_0x74c0('0x2')](_0x74c0('0x9'),auth[_0x74c0('0x3')](),controller[_0x74c0('0xa')]);router[_0x74c0('0x2')](_0x74c0('0xb'),auth[_0x74c0('0x3')](),controller[_0x74c0('0xc')]);router[_0x74c0('0xd')]('/',auth[_0x74c0('0x3')](),controller['create']);router[_0x74c0('0xd')](_0x74c0('0xe'),auth[_0x74c0('0x3')](),controller[_0x74c0('0xf')]);router[_0x74c0('0xd')](_0x74c0('0x10'),auth[_0x74c0('0x3')](),controller[_0x74c0('0x11')]);router[_0x74c0('0x12')](_0x74c0('0x9'),auth['isAuthenticated'](),controller[_0x74c0('0x13')]);router[_0x74c0('0x14')](_0x74c0('0x9'),auth[_0x74c0('0x3')](),controller[_0x74c0('0x15')]);module[_0x74c0('0x16')]=router; \ No newline at end of file +var _0x9cd3=['post','create','getPreview','getTimezone','put','/:id','delete','destroy','express','Router','../../components/auth/service','./cmHopper.controller','get','index','/describe','isAuthenticated','getOpenContacts','getTimezones','show','getPreviewRecall'];(function(_0x268e29,_0x322430){var _0x5e5aa3=function(_0x2e291d){while(--_0x2e291d){_0x268e29['push'](_0x268e29['shift']());}};_0x5e5aa3(++_0x322430);}(_0x9cd3,0x1d4));var _0x39cd=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0x9cd3[_0x118afa];return _0x167d76;};'use strict';var express=require(_0x39cd('0x0'));var router=express[_0x39cd('0x1')]();var auth=require(_0x39cd('0x2'));var controller=require(_0x39cd('0x3'));router[_0x39cd('0x4')]('/',auth['isAuthenticated'](),controller[_0x39cd('0x5')]);router[_0x39cd('0x4')](_0x39cd('0x6'),auth[_0x39cd('0x7')](),controller['describe']);router['get']('/opencontacts',auth[_0x39cd('0x7')](),controller[_0x39cd('0x8')]);router[_0x39cd('0x4')]('/timezones',auth[_0x39cd('0x7')](),controller[_0x39cd('0x9')]);router[_0x39cd('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x39cd('0xa')]);router['get']('/:id/previewrecall',auth[_0x39cd('0x7')](),controller[_0x39cd('0xb')]);router[_0x39cd('0xc')]('/',auth[_0x39cd('0x7')](),controller[_0x39cd('0xd')]);router[_0x39cd('0xc')]('/preview',auth[_0x39cd('0x7')](),controller[_0x39cd('0xe')]);router[_0x39cd('0xc')]('/timezone',auth['isAuthenticated'](),controller[_0x39cd('0xf')]);router[_0x39cd('0x10')](_0x39cd('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x39cd('0x12')](_0x39cd('0x11'),auth[_0x39cd('0x7')](),controller[_0x39cd('0x13')]);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 3f6e866..17c8abd 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 _0xbe22=['moment','exports','INTEGER','STRING','DATE','format'];(function(_0x4fd617,_0xa7fac5){var _0x66573d=function(_0x1b94f0){while(--_0x1b94f0){_0x4fd617['push'](_0x4fd617['shift']());}};_0x66573d(++_0xa7fac5);}(_0xbe22,0x72));var _0x2be2=function(_0x398447,_0x18df90){_0x398447=_0x398447-0x0;var _0x5d2094=_0xbe22[_0x398447];return _0x5d2094;};'use strict';var moment=require(_0x2be2('0x0'));var Sequelize=require('sequelize');module[_0x2be2('0x1')]={'CmHopperId':{'type':Sequelize[_0x2be2('0x2')]},'phone':{'type':Sequelize[_0x2be2('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x2be2('0x4')],'defaultValue':moment()[_0x2be2('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9a5c=['STRING','DATE','format','moment','sequelize','exports','INTEGER'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x9a5c,0xc7));var _0xc9a5=function(_0x2b2d50,_0x1f5c00){_0x2b2d50=_0x2b2d50-0x0;var _0x12f227=_0x9a5c[_0x2b2d50];return _0x12f227;};'use strict';var moment=require(_0xc9a5('0x0'));var Sequelize=require(_0xc9a5('0x1'));module[_0xc9a5('0x2')]={'CmHopperId':{'type':Sequelize[_0xc9a5('0x3')]},'phone':{'type':Sequelize[_0xc9a5('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xc9a5('0x5')],'defaultValue':moment()[_0xc9a5('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc9a5('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index b64e854..2e8a3a4 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 _0x1e93=['bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','type','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','fast-json-patch','request-promise','moment'];(function(_0x167707,_0x37e36e){var _0x344672=function(_0x21e1ea){while(--_0x21e1ea){_0x167707['push'](_0x167707['shift']());}};_0x344672(++_0x37e36e);}(_0x1e93,0x98));var _0x31e9=function(_0x5028aa,_0x38b7d9){_0x5028aa=_0x5028aa-0x0;var _0x10c7ee=_0x1e93[_0x5028aa];return _0x10c7ee;};'use strict';var emlformat=require(_0x31e9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x31e9('0x1'));var rp=require(_0x31e9('0x2'));var moment=require(_0x31e9('0x3'));var BPromise=require(_0x31e9('0x4'));var Mustache=require(_0x31e9('0x5'));var util=require('util');var path=require('path');var sox=require(_0x31e9('0x6'));var csv=require(_0x31e9('0x7'));var ejs=require(_0x31e9('0x8'));var fs=require('fs');var fs_extra=require(_0x31e9('0x9'));var _=require('lodash');var squel=require(_0x31e9('0xa'));var crypto=require(_0x31e9('0xb'));var jsforce=require(_0x31e9('0xc'));var deskjs=require(_0x31e9('0xd'));var toCsv=require(_0x31e9('0x7'));var querystring=require(_0x31e9('0xe'));var Papa=require(_0x31e9('0xf'));var Redis=require(_0x31e9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x31e9('0x11'));var as=require(_0x31e9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31e9('0x13'))(_0x31e9('0x14'));var utils=require(_0x31e9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2508e3,_0x499a5d){_0x499a5d=_0x499a5d||0xcc;return function(_0x1da388){if(_0x1da388){return _0x2508e3['sendStatus'](_0x499a5d);}return _0x2508e3[_0x31e9('0x16')](_0x499a5d)['end']();};}function respondWithResult(_0x4c0097,_0x1a6e2a){_0x1a6e2a=_0x1a6e2a||0xc8;return function(_0xf1bc6){if(_0xf1bc6){return _0x4c0097[_0x31e9('0x16')](_0x1a6e2a)[_0x31e9('0x17')](_0xf1bc6);}};}function respondWithFilteredResult(_0xc85460,_0x439859){return function(_0x4a36b9){if(_0x4a36b9){var _0xf1f8ce=typeof _0x439859['offset']===_0x31e9('0x18')&&typeof _0x439859[_0x31e9('0x19')]===_0x31e9('0x18');var _0x1ba931=_0x4a36b9['count'];var _0x4d2cbd=_0xf1f8ce?0x0:_0x439859[_0x31e9('0x1a')];var _0x3edbba=_0xf1f8ce?_0x4a36b9[_0x31e9('0x1b')]:_0x439859[_0x31e9('0x1a')]+_0x439859[_0x31e9('0x19')];var _0x8bc16;if(_0x3edbba>=_0x1ba931){_0x3edbba=_0x1ba931;_0x8bc16=0xc8;}else{_0x8bc16=0xce;}_0xc85460[_0x31e9('0x16')](_0x8bc16);return _0xc85460[_0x31e9('0x1c')](_0x31e9('0x1d'),_0x4d2cbd+'-'+_0x3edbba+'/'+_0x1ba931)[_0x31e9('0x17')](_0x4a36b9);}return null;};}function patchUpdates(_0xd02137){return function(_0x7119d8){try{jsonpatch[_0x31e9('0x1e')](_0x7119d8,_0xd02137,!![]);}catch(_0x513e7f){return BPromise[_0x31e9('0x1f')](_0x513e7f);}return _0x7119d8[_0x31e9('0x20')]();};}function saveUpdates(_0x46c4e0,_0x45a1c2){return function(_0x4da034){if(_0x4da034){return _0x4da034['update'](_0x46c4e0)[_0x31e9('0x21')](function(_0xc28139){return _0xc28139;});}return null;};}function removeEntity(_0x3dca89,_0x180b70){return function(_0x49ea0f){if(_0x49ea0f){return _0x49ea0f[_0x31e9('0x22')]()[_0x31e9('0x21')](function(){var _0x118b62=_0x49ea0f[_0x31e9('0x23')]({'plain':!![]});var _0x14623b=_0x31e9('0x24');return db[_0x31e9('0x25')][_0x31e9('0x22')]({'where':{'type':_0x14623b,'resourceId':_0x118b62['id']}})[_0x31e9('0x21')](function(){return _0x49ea0f;});})[_0x31e9('0x21')](function(){_0x3dca89['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ca939,_0x180f78){return function(_0x20c095){if(!_0x20c095){_0x4ca939['sendStatus'](0x194);}return _0x20c095;};}function handleError(_0x42a31f,_0x4d020b){_0x4d020b=_0x4d020b||0x1f4;return function(_0x45e858){logger[_0x31e9('0x26')](_0x45e858['stack']);if(_0x45e858[_0x31e9('0x27')]){delete _0x45e858[_0x31e9('0x27')];}_0x42a31f[_0x31e9('0x16')](_0x4d020b)[_0x31e9('0x28')](_0x45e858);};}exports[_0x31e9('0x29')]=function(_0x44222c,_0x3464f7){var _0x33f0cd={},_0x4057f0={},_0x1cc65a={'count':0x0,'rows':[]};var _0x3c7e80=_[_0x31e9('0x2a')](db[_0x31e9('0x2b')][_0x31e9('0x2c')],function(_0x51588c){return{'name':_0x51588c['fieldName'],'type':_0x51588c['type']['key']};});_0x4057f0[_0x31e9('0x2d')]=_[_0x31e9('0x2a')](_0x3c7e80,'name');_0x4057f0[_0x31e9('0x2e')]=_[_0x31e9('0x2f')](_0x44222c[_0x31e9('0x2e')]);_0x4057f0['filters']=_[_0x31e9('0x30')](_0x4057f0[_0x31e9('0x2d')],_0x4057f0['query']);_0x33f0cd['attributes']=_[_0x31e9('0x30')](_0x4057f0['model'],qs[_0x31e9('0x31')](_0x44222c[_0x31e9('0x2e')][_0x31e9('0x31')]));_0x33f0cd['attributes']=_0x33f0cd[_0x31e9('0x32')]['length']?_0x33f0cd[_0x31e9('0x32')]:_0x4057f0[_0x31e9('0x2d')];if(!_0x44222c['query'][_0x31e9('0x33')]('nolimit')){_0x33f0cd[_0x31e9('0x19')]=qs[_0x31e9('0x19')](_0x44222c[_0x31e9('0x2e')][_0x31e9('0x19')]);_0x33f0cd[_0x31e9('0x1a')]=qs[_0x31e9('0x1a')](_0x44222c['query'][_0x31e9('0x1a')]);}_0x33f0cd[_0x31e9('0x34')]=qs[_0x31e9('0x35')](_0x44222c[_0x31e9('0x2e')]['sort']);_0x33f0cd[_0x31e9('0x36')]=qs[_0x31e9('0x37')](_[_0x31e9('0x38')](_0x44222c[_0x31e9('0x2e')],_0x4057f0[_0x31e9('0x37')]),_0x3c7e80);if(_0x44222c[_0x31e9('0x2e')][_0x31e9('0x39')]){_0x33f0cd[_0x31e9('0x36')]=_['merge'](_0x33f0cd[_0x31e9('0x36')],{'$or':_[_0x31e9('0x2a')](_0x3c7e80,function(_0x29def8){if(_0x29def8[_0x31e9('0x3a')]!=='VIRTUAL'){var _0x4be756={};_0x4be756[_0x29def8[_0x31e9('0x27')]]={'$like':'%'+_0x44222c[_0x31e9('0x2e')]['filter']+'%'};return _0x4be756;}})});}_0x33f0cd=_[_0x31e9('0x3b')]({},_0x33f0cd,_0x44222c[_0x31e9('0x3c')]);var _0x2a30f5={'where':_0x33f0cd[_0x31e9('0x36')]};return db[_0x31e9('0x2b')][_0x31e9('0x1b')](_0x2a30f5)[_0x31e9('0x21')](function(_0x30269d){_0x1cc65a[_0x31e9('0x1b')]=_0x30269d;if(_0x44222c[_0x31e9('0x2e')][_0x31e9('0x3d')]){_0x33f0cd['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x31e9('0x3e')](_0x33f0cd);})['then'](function(_0x4a521b){_0x1cc65a[_0x31e9('0x3f')]=_0x4a521b;return _0x1cc65a;})[_0x31e9('0x21')](respondWithFilteredResult(_0x3464f7,_0x33f0cd))[_0x31e9('0x40')](handleError(_0x3464f7,null));};exports[_0x31e9('0x41')]=function(_0x22f4ad,_0x417afd){var _0x91fa9={'raw':!![],'where':{'id':_0x22f4ad[_0x31e9('0x42')]['id']}},_0x4dddd3={};_0x4dddd3[_0x31e9('0x2d')]=_[_0x31e9('0x2f')](db[_0x31e9('0x2b')][_0x31e9('0x2c')]);_0x4dddd3[_0x31e9('0x2e')]=_[_0x31e9('0x2f')](_0x22f4ad[_0x31e9('0x2e')]);_0x4dddd3[_0x31e9('0x37')]=_['intersection'](_0x4dddd3['model'],_0x4dddd3[_0x31e9('0x2e')]);_0x91fa9['attributes']=_[_0x31e9('0x30')](_0x4dddd3[_0x31e9('0x2d')],qs[_0x31e9('0x31')](_0x22f4ad['query'][_0x31e9('0x31')]));_0x91fa9[_0x31e9('0x32')]=_0x91fa9['attributes'][_0x31e9('0x43')]?_0x91fa9['attributes']:_0x4dddd3['model'];if(_0x22f4ad[_0x31e9('0x2e')][_0x31e9('0x3d')]){_0x91fa9[_0x31e9('0x44')]=[{'all':!![]}];}_0x91fa9=_[_0x31e9('0x3b')]({},_0x91fa9,_0x22f4ad[_0x31e9('0x3c')]);return db[_0x31e9('0x2b')][_0x31e9('0x45')](_0x91fa9)[_0x31e9('0x21')](handleEntityNotFound(_0x417afd,null))[_0x31e9('0x21')](respondWithResult(_0x417afd,null))['catch'](handleError(_0x417afd,null));};exports[_0x31e9('0x46')]=function(_0xd48a31,_0x4e2007){return db[_0x31e9('0x2b')][_0x31e9('0x46')](_0xd48a31[_0x31e9('0x47')],{})['then'](function(_0x2802f1){var _0x13e910=_0xd48a31[_0x31e9('0x48')][_0x31e9('0x23')]({'plain':!![]});if(!_0x13e910)throw new Error(_0x31e9('0x49'));if(_0x13e910[_0x31e9('0x4a')]===_0x31e9('0x48')){var _0x29ab92=_0x2802f1[_0x31e9('0x23')]({'plain':!![]});var _0x4279bc='CmHopperAdditionalPhones';return db['UserProfileSection'][_0x31e9('0x45')]({'where':{'name':_0x4279bc,'userProfileId':_0x13e910['userProfileId']},'raw':!![]})[_0x31e9('0x21')](function(_0x15a9c3){if(_0x15a9c3&&_0x15a9c3[_0x31e9('0x4b')]===0x0){return db[_0x31e9('0x25')]['create']({'name':_0x29ab92[_0x31e9('0x27')],'resourceId':_0x29ab92['id'],'type':_0x15a9c3[_0x31e9('0x27')],'sectionId':_0x15a9c3['id']},{})[_0x31e9('0x21')](function(){return _0x2802f1;});}else{return _0x2802f1;}})[_0x31e9('0x40')](function(_0x2615ce){logger['error'](_0x31e9('0x4c'),_0x2615ce);throw _0x2615ce;});}return _0x2802f1;})[_0x31e9('0x21')](respondWithResult(_0x4e2007,0xc9))[_0x31e9('0x40')](handleError(_0x4e2007,null));};exports[_0x31e9('0x4d')]=function(_0x706df,_0x23c109){if(_0x706df[_0x31e9('0x47')]['id']){delete _0x706df[_0x31e9('0x47')]['id'];}return db[_0x31e9('0x2b')][_0x31e9('0x45')]({'where':{'id':_0x706df[_0x31e9('0x42')]['id']}})[_0x31e9('0x21')](handleEntityNotFound(_0x23c109,null))[_0x31e9('0x21')](saveUpdates(_0x706df[_0x31e9('0x47')],null))[_0x31e9('0x21')](respondWithResult(_0x23c109,null))[_0x31e9('0x40')](handleError(_0x23c109,null));};exports[_0x31e9('0x22')]=function(_0x31728f,_0x1ac4e2){return db[_0x31e9('0x2b')][_0x31e9('0x45')]({'where':{'id':_0x31728f[_0x31e9('0x42')]['id']}})[_0x31e9('0x21')](handleEntityNotFound(_0x1ac4e2,null))['then'](removeEntity(_0x1ac4e2,null))[_0x31e9('0x40')](handleError(_0x1ac4e2,null));}; \ No newline at end of file +var _0x11c7=['ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','offset','count','limit','json','apply','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','map','VIRTUAL','merge','options','CmHopperAdditionalPhone','findAll','show','params','include','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv'];(function(_0xb4f6d6,_0x44b863){var _0x236dad=function(_0x2dbfd6){while(--_0x2dbfd6){_0xb4f6d6['push'](_0xb4f6d6['shift']());}};_0x236dad(++_0x44b863);}(_0x11c7,0x186));var _0x711c=function(_0x14c494,_0x39ba43){_0x14c494=_0x14c494-0x0;var _0x513ba4=_0x11c7[_0x14c494];return _0x513ba4;};'use strict';var emlformat=require(_0x711c('0x0'));var rimraf=require(_0x711c('0x1'));var zipdir=require(_0x711c('0x2'));var jsonpatch=require(_0x711c('0x3'));var rp=require(_0x711c('0x4'));var moment=require(_0x711c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x711c('0x6'));var util=require('util');var path=require(_0x711c('0x7'));var sox=require(_0x711c('0x8'));var csv=require(_0x711c('0x9'));var ejs=require(_0x711c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x711c('0xb'));var crypto=require(_0x711c('0xc'));var jsforce=require(_0x711c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x711c('0x9'));var querystring=require(_0x711c('0xe'));var Papa=require(_0x711c('0xf'));var Redis=require(_0x711c('0x10'));var authService=require(_0x711c('0x11'));var qs=require(_0x711c('0x12'));var as=require(_0x711c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x711c('0x14'));var utils=require(_0x711c('0x15'));var config=require(_0x711c('0x16'));var licenseUtil=require(_0x711c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3acab5,_0x2505c8){_0x2505c8=_0x2505c8||0xcc;return function(_0x30f6a0){if(_0x30f6a0){return _0x3acab5[_0x711c('0x18')](_0x2505c8);}return _0x3acab5['status'](_0x2505c8)['end']();};}function respondWithResult(_0x19c28c,_0x336c08){_0x336c08=_0x336c08||0xc8;return function(_0x5bfeab){if(_0x5bfeab){return _0x19c28c[_0x711c('0x19')](_0x336c08)['json'](_0x5bfeab);}};}function respondWithFilteredResult(_0xcbd280,_0x1416af){return function(_0x1510de){if(_0x1510de){var _0x1a541d=typeof _0x1416af['offset']==='undefined'&&typeof _0x1416af['limit']===_0x711c('0x1a');var _0x32d756=_0x1510de['count'];var _0x57efc5=_0x1a541d?0x0:_0x1416af[_0x711c('0x1b')];var _0x51b1a5=_0x1a541d?_0x1510de[_0x711c('0x1c')]:_0x1416af[_0x711c('0x1b')]+_0x1416af[_0x711c('0x1d')];var _0x45b0bb;if(_0x51b1a5>=_0x32d756){_0x51b1a5=_0x32d756;_0x45b0bb=0xc8;}else{_0x45b0bb=0xce;}_0xcbd280['status'](_0x45b0bb);return _0xcbd280['set']('Content-Range',_0x57efc5+'-'+_0x51b1a5+'/'+_0x32d756)[_0x711c('0x1e')](_0x1510de);}return null;};}function patchUpdates(_0x3c0bec){return function(_0x355148){try{jsonpatch[_0x711c('0x1f')](_0x355148,_0x3c0bec,!![]);}catch(_0x24c2c8){return BPromise['reject'](_0x24c2c8);}return _0x355148['save']();};}function saveUpdates(_0x231da7,_0x167eb7){return function(_0x48cf2c){if(_0x48cf2c){return _0x48cf2c[_0x711c('0x20')](_0x231da7)[_0x711c('0x21')](function(_0x440336){return _0x440336;});}return null;};}function removeEntity(_0xa2e451,_0x3c0264){return function(_0x166329){if(_0x166329){return _0x166329[_0x711c('0x22')]()['then'](function(){var _0x399a41=_0x166329['get']({'plain':!![]});var _0x5646c9='CmHopperAdditionalPhones';return db[_0x711c('0x23')][_0x711c('0x22')]({'where':{'type':_0x5646c9,'resourceId':_0x399a41['id']}})[_0x711c('0x21')](function(){return _0x166329;});})[_0x711c('0x21')](function(){_0xa2e451['status'](0xcc)[_0x711c('0x24')]();});}};}function handleEntityNotFound(_0x43f7e7,_0x14deae){return function(_0x2e44e6){if(!_0x2e44e6){_0x43f7e7[_0x711c('0x18')](0x194);}return _0x2e44e6;};}function handleError(_0x46cb33,_0x9165bc){_0x9165bc=_0x9165bc||0x1f4;return function(_0x4fb52e){logger[_0x711c('0x25')](_0x4fb52e[_0x711c('0x26')]);if(_0x4fb52e[_0x711c('0x27')]){delete _0x4fb52e[_0x711c('0x27')];}_0x46cb33[_0x711c('0x19')](_0x9165bc)[_0x711c('0x28')](_0x4fb52e);};}exports[_0x711c('0x29')]=function(_0x108cd2,_0x453d62){var _0x143aef={},_0x591589={},_0x528862={'count':0x0,'rows':[]};var _0x50f190=_['map'](db['CmHopperAdditionalPhone'][_0x711c('0x2a')],function(_0x56f531){return{'name':_0x56f531[_0x711c('0x2b')],'type':_0x56f531[_0x711c('0x2c')][_0x711c('0x2d')]};});_0x591589[_0x711c('0x2e')]=_['map'](_0x50f190,_0x711c('0x27'));_0x591589[_0x711c('0x2f')]=_[_0x711c('0x30')](_0x108cd2[_0x711c('0x2f')]);_0x591589[_0x711c('0x31')]=_[_0x711c('0x32')](_0x591589[_0x711c('0x2e')],_0x591589[_0x711c('0x2f')]);_0x143aef[_0x711c('0x33')]=_[_0x711c('0x32')](_0x591589[_0x711c('0x2e')],qs[_0x711c('0x34')](_0x108cd2[_0x711c('0x2f')][_0x711c('0x34')]));_0x143aef['attributes']=_0x143aef[_0x711c('0x33')][_0x711c('0x35')]?_0x143aef[_0x711c('0x33')]:_0x591589['model'];if(!_0x108cd2[_0x711c('0x2f')]['hasOwnProperty']('nolimit')){_0x143aef['limit']=qs[_0x711c('0x1d')](_0x108cd2[_0x711c('0x2f')]['limit']);_0x143aef[_0x711c('0x1b')]=qs['offset'](_0x108cd2[_0x711c('0x2f')][_0x711c('0x1b')]);}_0x143aef[_0x711c('0x36')]=qs[_0x711c('0x37')](_0x108cd2['query'][_0x711c('0x37')]);_0x143aef[_0x711c('0x38')]=qs[_0x711c('0x31')](_[_0x711c('0x39')](_0x108cd2[_0x711c('0x2f')],_0x591589[_0x711c('0x31')]),_0x50f190);if(_0x108cd2[_0x711c('0x2f')][_0x711c('0x3a')]){_0x143aef[_0x711c('0x38')]=_['merge'](_0x143aef['where'],{'$or':_[_0x711c('0x3b')](_0x50f190,function(_0x171fa8){if(_0x171fa8['type']!==_0x711c('0x3c')){var _0x4320ed={};_0x4320ed[_0x171fa8[_0x711c('0x27')]]={'$like':'%'+_0x108cd2['query']['filter']+'%'};return _0x4320ed;}})});}_0x143aef=_[_0x711c('0x3d')]({},_0x143aef,_0x108cd2[_0x711c('0x3e')]);var _0x3aa25d={'where':_0x143aef[_0x711c('0x38')]};return db[_0x711c('0x3f')][_0x711c('0x1c')](_0x3aa25d)[_0x711c('0x21')](function(_0x3448c7){_0x528862[_0x711c('0x1c')]=_0x3448c7;if(_0x108cd2[_0x711c('0x2f')]['includeAll']){_0x143aef['include']=[{'all':!![]}];}return db[_0x711c('0x3f')][_0x711c('0x40')](_0x143aef);})[_0x711c('0x21')](function(_0x84dc0f){_0x528862['rows']=_0x84dc0f;return _0x528862;})[_0x711c('0x21')](respondWithFilteredResult(_0x453d62,_0x143aef))['catch'](handleError(_0x453d62,null));};exports[_0x711c('0x41')]=function(_0x5ef38b,_0x553aea){var _0x129fcc={'raw':!![],'where':{'id':_0x5ef38b[_0x711c('0x42')]['id']}},_0x44e1a6={};_0x44e1a6['model']=_[_0x711c('0x30')](db[_0x711c('0x3f')][_0x711c('0x2a')]);_0x44e1a6[_0x711c('0x2f')]=_[_0x711c('0x30')](_0x5ef38b['query']);_0x44e1a6[_0x711c('0x31')]=_[_0x711c('0x32')](_0x44e1a6['model'],_0x44e1a6[_0x711c('0x2f')]);_0x129fcc[_0x711c('0x33')]=_[_0x711c('0x32')](_0x44e1a6[_0x711c('0x2e')],qs[_0x711c('0x34')](_0x5ef38b[_0x711c('0x2f')]['fields']));_0x129fcc[_0x711c('0x33')]=_0x129fcc[_0x711c('0x33')]['length']?_0x129fcc[_0x711c('0x33')]:_0x44e1a6['model'];if(_0x5ef38b[_0x711c('0x2f')]['includeAll']){_0x129fcc[_0x711c('0x43')]=[{'all':!![]}];}_0x129fcc=_[_0x711c('0x3d')]({},_0x129fcc,_0x5ef38b['options']);return db[_0x711c('0x3f')][_0x711c('0x44')](_0x129fcc)[_0x711c('0x21')](handleEntityNotFound(_0x553aea,null))[_0x711c('0x21')](respondWithResult(_0x553aea,null))[_0x711c('0x45')](handleError(_0x553aea,null));};exports[_0x711c('0x46')]=function(_0x468bf3,_0x570087){return db['CmHopperAdditionalPhone'][_0x711c('0x46')](_0x468bf3[_0x711c('0x47')],{})[_0x711c('0x21')](function(_0x240b69){var _0x326132=_0x468bf3['user'][_0x711c('0x48')]({'plain':!![]});if(!_0x326132)throw new Error(_0x711c('0x49'));if(_0x326132[_0x711c('0x4a')]===_0x711c('0x4b')){var _0x464ae4=_0x240b69[_0x711c('0x48')]({'plain':!![]});var _0x3b1bbc='CmHopperAdditionalPhones';return db[_0x711c('0x4c')][_0x711c('0x44')]({'where':{'name':_0x3b1bbc,'userProfileId':_0x326132[_0x711c('0x4d')]},'raw':!![]})['then'](function(_0x3b5973){if(_0x3b5973&&_0x3b5973[_0x711c('0x4e')]===0x0){return db['UserProfileResource'][_0x711c('0x46')]({'name':_0x464ae4[_0x711c('0x27')],'resourceId':_0x464ae4['id'],'type':_0x3b5973['name'],'sectionId':_0x3b5973['id']},{})[_0x711c('0x21')](function(){return _0x240b69;});}else{return _0x240b69;}})['catch'](function(_0x3dc7ed){logger['error'](_0x711c('0x4f'),_0x3dc7ed);throw _0x3dc7ed;});}return _0x240b69;})['then'](respondWithResult(_0x570087,0xc9))[_0x711c('0x45')](handleError(_0x570087,null));};exports[_0x711c('0x20')]=function(_0x4b1e42,_0xc9b19d){if(_0x4b1e42[_0x711c('0x47')]['id']){delete _0x4b1e42['body']['id'];}return db['CmHopperAdditionalPhone'][_0x711c('0x44')]({'where':{'id':_0x4b1e42[_0x711c('0x42')]['id']}})[_0x711c('0x21')](handleEntityNotFound(_0xc9b19d,null))[_0x711c('0x21')](saveUpdates(_0x4b1e42[_0x711c('0x47')],null))['then'](respondWithResult(_0xc9b19d,null))[_0x711c('0x45')](handleError(_0xc9b19d,null));};exports[_0x711c('0x22')]=function(_0x281e7e,_0x2dbe5a){return db['CmHopperAdditionalPhone'][_0x711c('0x44')]({'where':{'id':_0x281e7e[_0x711c('0x42')]['id']}})[_0x711c('0x21')](handleEntityNotFound(_0x2dbe5a,null))[_0x711c('0x21')](removeEntity(_0x2dbe5a,null))[_0x711c('0x45')](handleError(_0x2dbe5a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index f1eeee2..317f995 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 _0x927f=['path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','CmHopperAdditionalPhone','lodash','../../config/logger','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x927f,0x10d));var _0xf927=function(_0x1ad428,_0x4f0632){_0x1ad428=_0x1ad428-0x0;var _0x2b2353=_0x927f[_0x1ad428];return _0x2b2353;};'use strict';var _=require(_0xf927('0x0'));var util=require('util');var logger=require(_0xf927('0x1'))(_0xf927('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf927('0x3'));var rimraf=require(_0xf927('0x4'));var config=require(_0xf927('0x5'));var attributes=require(_0xf927('0x6'));module['exports']=function(_0x47642c,_0x2c351e){return _0x47642c['define'](_0xf927('0x7'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8773=['exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes'];(function(_0x2302a1,_0x4bc33d){var _0x413cae=function(_0x233632){while(--_0x233632){_0x2302a1['push'](_0x2302a1['shift']());}};_0x413cae(++_0x4bc33d);}(_0x8773,0x108));var _0x3877=function(_0x43383c,_0x477b8d){_0x43383c=_0x43383c-0x0;var _0x187ecd=_0x8773[_0x43383c];return _0x187ecd;};'use strict';var _=require('lodash');var util=require(_0x3877('0x0'));var logger=require(_0x3877('0x1'))('api');var moment=require(_0x3877('0x2'));var BPromise=require(_0x3877('0x3'));var rp=require(_0x3877('0x4'));var fs=require('fs');var path=require(_0x3877('0x5'));var rimraf=require(_0x3877('0x6'));var config=require(_0x3877('0x7'));var attributes=require(_0x3877('0x8'));module[_0x3877('0x9')]=function(_0x39d026,_0x3778d4){return _0x39d026[_0x3877('0xa')](_0x3877('0xb'),attributes,{'tableName':_0x3877('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 12707ff..59c4120 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 _0x3bb5=['VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','countnoanswerretry','VerifyAdditionalPhones','SwapAdditionalPhones','ListId','duration','waitTime','scheduledat','add','minutes','isNil','createdAt','updatedAt','sequelize','transaction','update','phone','activateAdditionalPhone','IncrementPreviewCounters','field','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','findOne','body','ContactId'];(function(_0x181b70,_0x41dc80){var _0x5ddf86=function(_0x8e5f07){while(--_0x8e5f07){_0x181b70['push'](_0x181b70['shift']());}};_0x5ddf86(++_0x41dc80);}(_0x3bb5,0xfe));var _0x53bb=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x3bb5[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x53bb('0x0'));var rs=require(_0x53bb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53bb('0x2'))['db'];var utils=require(_0x53bb('0x3'));var logger=require(_0x53bb('0x4'))(_0x53bb('0x5'));var config=require('../../config/environment');var jayson=require(_0x53bb('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6b6242,_0x4f000e,_0x212fc6){return new BPromise(function(_0x10f75e,_0x1820e1){return client['request'](_0x6b6242,_0x212fc6)['then'](function(_0x467f05){logger[_0x53bb('0x7')](_0x53bb('0x8'),_0x4f000e,_0x53bb('0x9'));logger[_0x53bb('0xa')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x4f000e,_0x53bb('0x9'),JSON[_0x53bb('0xb')](_0x467f05));if(_0x467f05['error']){if(_0x467f05[_0x53bb('0xc')][_0x53bb('0xd')]===0x1f4){logger['error'](_0x53bb('0x8'),_0x4f000e,_0x467f05[_0x53bb('0xc')]['message']);return _0x1820e1(_0x467f05[_0x53bb('0xc')][_0x53bb('0xe')]);}logger[_0x53bb('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4f000e,_0x467f05[_0x53bb('0xc')][_0x53bb('0xe')]);return _0x10f75e(_0x467f05[_0x53bb('0xc')][_0x53bb('0xe')]);}else{logger['info'](_0x53bb('0x8'),_0x4f000e,'request\x20sent');_0x10f75e(_0x467f05[_0x53bb('0xf')][_0x53bb('0xe')]);}})[_0x53bb('0x10')](function(_0x5002e4){logger[_0x53bb('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4f000e,_0x5002e4);_0x1820e1(_0x5002e4);});});}exports['VerifyAdditionalPhones']=function(_0x300230){var _0x2f6ad4=this;return new Promise(function(_0xb1baf0,_0x52e424){return db[_0x53bb('0x11')][_0x53bb('0x12')]({'raw':!![],'where':{'ContactId':_0x300230[_0x53bb('0x13')][_0x53bb('0x14')],'ListId':_0x300230[_0x53bb('0x13')]['ListId'],'VoiceQueueId':_0x300230['body'][_0x53bb('0x15')]===undefined?null:_0x300230[_0x53bb('0x13')][_0x53bb('0x15')],'CampaignId':_0x300230[_0x53bb('0x13')][_0x53bb('0x16')]===undefined?null:_0x300230[_0x53bb('0x13')][_0x53bb('0x16')]}})[_0x53bb('0x17')](function(_0x344eea){if(_0x344eea!=null){return db[_0x53bb('0x18')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x344eea['id'],'OrderBy':{'$gt':_0x344eea['OrderBy']}},'order':[[_0x53bb('0x19'),_0x53bb('0x1a')]]})[_0x53bb('0x17')](function(_0x166502){var _0x384162=0x0;if(_0x166502){if(_0x166502['countbusyretry']+_0x166502[_0x53bb('0x1b')]+_0x166502['countnoanswerretry']+_0x166502[_0x53bb('0x1c')]+_0x166502[_0x53bb('0x1d')]+_0x166502[_0x53bb('0x1e')]+_0x166502[_0x53bb('0x1f')]+_0x166502[_0x53bb('0x20')]<_0x300230[_0x53bb('0x21')][_0x53bb('0x22')])_0x384162=0x1;_0xb1baf0({'additional':_0x384162});}else{return db[_0x53bb('0x18')][_0x53bb('0x12')]({'raw':!![],'where':{'CmHopperId':_0x344eea['id']},'order':[[_0x53bb('0x19'),_0x53bb('0x1a')]]})['then'](function(_0x3ae65a){var _0x3a1a5f=0x0;if(_0x3ae65a){if(_0x3ae65a[_0x53bb('0x23')]+_0x3ae65a[_0x53bb('0x1b')]+_0x3ae65a[_0x53bb('0x24')]+_0x3ae65a[_0x53bb('0x1c')]+_0x3ae65a[_0x53bb('0x1d')]+_0x3ae65a[_0x53bb('0x1e')]+_0x3ae65a[_0x53bb('0x1f')]+_0x3ae65a['countagentrejectretry']<_0x300230['entity'][_0x53bb('0x22')])_0x3a1a5f=0x1;_0xb1baf0({'additional':_0x3a1a5f});}else{_0xb1baf0({'additional':0x0});}})['catch'](function(_0x511c2d){logger[_0x53bb('0xc')](_0x53bb('0x25'),_0x511c2d[_0x53bb('0xe')]);_0x52e424(_0x2f6ad4[_0x53bb('0xc')](0x1f4,_0x511c2d['message']));});}})[_0x53bb('0x10')](function(_0x2f71f2){logger[_0x53bb('0xc')](_0x53bb('0x25'),_0x2f71f2[_0x53bb('0xe')]);_0x52e424(_0x2f6ad4[_0x53bb('0xc')](0x1f4,_0x2f71f2['message']));});}else _0xb1baf0({'additional':0x0});});});};exports[_0x53bb('0x26')]=function(_0x324749){var _0x3b630c=this;return new Promise(function(_0x4edbe8,_0x45f73a){return db[_0x53bb('0x11')][_0x53bb('0x12')]({'raw':!![],'where':{'ContactId':_0x324749[_0x53bb('0x13')][_0x53bb('0x14')],'ListId':_0x324749[_0x53bb('0x13')][_0x53bb('0x27')],'VoiceQueueId':_0x324749[_0x53bb('0x13')][_0x53bb('0x15')]===undefined?null:_0x324749['body'][_0x53bb('0x15')],'CampaignId':_0x324749[_0x53bb('0x13')][_0x53bb('0x16')]===undefined?null:_0x324749['body'][_0x53bb('0x16')]}})[_0x53bb('0x17')](function(_0x3d9f1a){if(_0x3d9f1a!=null){return db['CmHopperAdditionalPhone'][_0x53bb('0x12')]({'raw':!![],'where':{'CmHopperId':_0x3d9f1a['id'],'OrderBy':{'$gte':_0x3d9f1a[_0x53bb('0x19')]}},'order':[[_0x53bb('0x19'),_0x53bb('0x1a')]]})[_0x53bb('0x17')](function(_0x9fd10a){if(_0x9fd10a)return activateAdditionalPhone(_0x3d9f1a,_0x324749['body'],_0x9fd10a,_0x324749[_0x53bb('0x28')],_0x324749[_0x53bb('0x29')])['then'](function(_0xf5d790){_0x4edbe8(_0xf5d790);});else{return db[_0x53bb('0x18')][_0x53bb('0x12')]({'raw':!![],'where':{'CmHopperId':_0x3d9f1a['id']},'order':[['OrderBy',_0x53bb('0x1a')]]})[_0x53bb('0x17')](function(_0xe1557e){if(_0xe1557e)return activateAdditionalPhone(_0x3d9f1a,_0x324749[_0x53bb('0x13')],_0xe1557e,_0x324749[_0x53bb('0x28')],_0x324749['waitTime'])[_0x53bb('0x17')](function(_0x1cf275){_0x4edbe8(_0x1cf275);});else{_0x4edbe8({'id':_0x3d9f1a['id'],'phone':''});}})[_0x53bb('0x10')](function(_0x596650){logger['error'](_0x53bb('0x25'),_0x596650[_0x53bb('0xe')]);_0x45f73a(_0x3b630c[_0x53bb('0xc')](0x1f4,_0x596650[_0x53bb('0xe')]));});}})[_0x53bb('0x10')](function(_0xb1c1e){logger[_0x53bb('0xc')](_0x53bb('0x25'),_0xb1c1e[_0x53bb('0xe')]);_0x45f73a(_0x3b630c[_0x53bb('0xc')](0x1f4,_0xb1c1e['message']));});}else _0x4edbe8(0x1);});});};function activateAdditionalPhone(_0x50bfa8,_0x153595,_0x1bae6e,_0x29cdc6,_0x528a71){return new Promise(function(_0x33e6e8,_0x26b652){var _0x1d587e;if(_['isNil'](_0x1bae6e['scheduledat'])){_0x1bae6e[_0x53bb('0x2a')]=moment();}if(moment()>moment(_0x1bae6e[_0x53bb('0x2a')])){_0x1d587e=moment()[_0x53bb('0x2b')](_0x528a71||0x3,_0x53bb('0x2c'));}else{if(_0x1bae6e[_0x53bb('0x19')]==0x0){_0x1d587e=moment(_0x1bae6e['scheduledat']);}else{_0x1d587e=moment()[_0x53bb('0x2b')](_0x528a71||0x3,_0x53bb('0x2c'));}}if(_[_0x53bb('0x2d')](_0x1d587e)){_0x1d587e=moment()[_0x53bb('0x2b')](_0x528a71||0x3,_0x53bb('0x2c'));}var _0x393510={'phone':_0x50bfa8['phone'],'active':0x0,'OrderBy':_['isNil'](_0x50bfa8['OrderBy'])?0x0:_0x50bfa8[_0x53bb('0x19')],'scheduledat':moment()[_0x53bb('0x2b')](_0x29cdc6||0x1,_0x53bb('0x2c')),'countbusyretry':_0x153595['countbusyretry'],'countcongestionretry':_0x153595[_0x53bb('0x1b')],'countnoanswerretry':_0x153595[_0x53bb('0x24')],'countnosuchnumberretry':_0x153595['countnosuchnumberretry'],'countdropretry':_0x153595[_0x53bb('0x1d')],'countabandonedretry':_0x153595[_0x53bb('0x1e')],'countmachineretry':_0x153595[_0x53bb('0x1f')],'countagentrejectretry':_0x153595[_0x53bb('0x20')],'createdAt':_0x153595['createdAt'],'updatedAt':_0x153595['updatedAt']};var _0x4b99ab={'CmHopperId':_0x50bfa8['id'],'phone':_0x1bae6e['phone'],'active':0x0,'OrderBy':_[_0x53bb('0x2d')](_0x1bae6e[_0x53bb('0x19')])?0x0:_0x1bae6e['OrderBy'],'scheduledat':_0x1d587e,'countbusyretry':_0x1bae6e[_0x53bb('0x23')],'countcongestionretry':_0x1bae6e[_0x53bb('0x1b')],'countnoanswerretry':_0x1bae6e['countnoanswerretry'],'countnosuchnumberretry':_0x1bae6e[_0x53bb('0x1c')],'countdropretry':_0x1bae6e[_0x53bb('0x1d')],'countabandonedretry':_0x1bae6e[_0x53bb('0x1e')],'countmachineretry':_0x1bae6e['countmachineretry'],'countagentrejectretry':_0x1bae6e[_0x53bb('0x20')],'createdAt':_0x1bae6e[_0x53bb('0x2e')],'updatedAt':_0x1bae6e[_0x53bb('0x2f')]};return db[_0x53bb('0x30')][_0x53bb('0x31')](function(_0x407c96){return db['CmHopperAdditionalPhone'][_0x53bb('0x32')](_0x393510,{'where':{'id':_0x1bae6e['id']}},{'transaction':_0x407c96})[_0x53bb('0x17')](function(){return db[_0x53bb('0x11')][_0x53bb('0x32')](_0x4b99ab,{'where':{'id':_0x50bfa8['id']}},{'transaction':_0x407c96});});})[_0x53bb('0x17')](function(_0x15499b){_0x33e6e8({'id':_0x50bfa8['id'],'phone':_0x1bae6e[_0x53bb('0x33')]});})[_0x53bb('0x10')](function(_0x2c4aae){logger[_0x53bb('0xc')](_0x53bb('0x34'),_0x2c4aae[_0x53bb('0xe')]);_0x26b652({'error':_0x2c4aae['message']});});});}exports[_0x53bb('0x35')]=function(_0x436c80){var _0x3c2bc8=this;return new Promise(function(_0x50e24c,_0x153c25){return db[_0x53bb('0x11')][_0x53bb('0x32')](_0x436c80['body'][_0x53bb('0x36')],{'where':{'id':_0x436c80['body']['id']}})['then'](function(_0x386c2e){_0x50e24c(_0x386c2e);})[_0x53bb('0x10')](function(_0x5cba50){logger[_0x53bb('0xc')](_0x53bb('0x35'),_0x5cba50[_0x53bb('0xe')]);_0x153c25(_0x3c2bc8['error'](0x1f4,_0x5cba50[_0x53bb('0xe')]));});});}; \ No newline at end of file +var _0x93d9=['ContactId','ListId','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','countcongestionretry','SwapAdditionalPhones','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','field','IncrementPreviewCounters','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','VerifyAdditionalPhones','CmHopper','findOne'];(function(_0x1559f6,_0x23f8be){var _0xdfe5e9=function(_0x738a99){while(--_0x738a99){_0x1559f6['push'](_0x1559f6['shift']());}};_0xdfe5e9(++_0x23f8be);}(_0x93d9,0xf7));var _0x993d=function(_0x5099ee,_0x331450){_0x5099ee=_0x5099ee-0x0;var _0x5e72b9=_0x93d9[_0x5099ee];return _0x5e72b9;};'use strict';var _=require('lodash');var util=require(_0x993d('0x0'));var moment=require(_0x993d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x993d('0x2'))['db'];var utils=require(_0x993d('0x3'));var logger=require(_0x993d('0x4'))('rpc');var config=require(_0x993d('0x5'));var jayson=require(_0x993d('0x6'));var client=jayson[_0x993d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23f050,_0x219fe3,_0x33bc7c){return new BPromise(function(_0x370c85,_0x19aeac){return client[_0x993d('0x8')](_0x23f050,_0x33bc7c)[_0x993d('0x9')](function(_0x4867b4){logger['info'](_0x993d('0xa'),_0x219fe3,_0x993d('0xb'));logger[_0x993d('0xc')](_0x993d('0xd'),_0x219fe3,_0x993d('0xb'),JSON[_0x993d('0xe')](_0x4867b4));if(_0x4867b4['error']){if(_0x4867b4[_0x993d('0xf')]['code']===0x1f4){logger[_0x993d('0xf')](_0x993d('0xa'),_0x219fe3,_0x4867b4[_0x993d('0xf')][_0x993d('0x10')]);return _0x19aeac(_0x4867b4['error'][_0x993d('0x10')]);}logger[_0x993d('0xf')](_0x993d('0xa'),_0x219fe3,_0x4867b4[_0x993d('0xf')][_0x993d('0x10')]);return _0x370c85(_0x4867b4[_0x993d('0xf')][_0x993d('0x10')]);}else{logger[_0x993d('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x219fe3,'request\x20sent');_0x370c85(_0x4867b4[_0x993d('0x12')][_0x993d('0x10')]);}})[_0x993d('0x13')](function(_0x1c50fc){logger[_0x993d('0xf')](_0x993d('0xa'),_0x219fe3,_0x1c50fc);_0x19aeac(_0x1c50fc);});});}exports[_0x993d('0x14')]=function(_0x4f0cd7){var _0x91a1eb=this;return new Promise(function(_0x5221af,_0x424e00){return db[_0x993d('0x15')][_0x993d('0x16')]({'raw':!![],'where':{'ContactId':_0x4f0cd7['body'][_0x993d('0x17')],'ListId':_0x4f0cd7['body'][_0x993d('0x18')],'VoiceQueueId':_0x4f0cd7[_0x993d('0x19')][_0x993d('0x1a')]===undefined?null:_0x4f0cd7['body'][_0x993d('0x1a')],'CampaignId':_0x4f0cd7['body'][_0x993d('0x1b')]===undefined?null:_0x4f0cd7['body'][_0x993d('0x1b')]}})[_0x993d('0x9')](function(_0x380e92){if(_0x380e92!=null){return db[_0x993d('0x1c')][_0x993d('0x16')]({'raw':!![],'where':{'CmHopperId':_0x380e92['id'],'OrderBy':{'$gt':_0x380e92[_0x993d('0x1d')]}},'order':[[_0x993d('0x1d'),_0x993d('0x1e')]]})['then'](function(_0x4ec1e1){var _0x50eba2=0x0;if(_0x4ec1e1){if(_0x4ec1e1[_0x993d('0x1f')]+_0x4ec1e1['countcongestionretry']+_0x4ec1e1[_0x993d('0x20')]+_0x4ec1e1[_0x993d('0x21')]+_0x4ec1e1[_0x993d('0x22')]+_0x4ec1e1[_0x993d('0x23')]+_0x4ec1e1[_0x993d('0x24')]+_0x4ec1e1['countagentrejectretry']<_0x4f0cd7[_0x993d('0x25')][_0x993d('0x26')])_0x50eba2=0x1;_0x5221af({'additional':_0x50eba2});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x380e92['id']},'order':[[_0x993d('0x1d'),'ASC']]})['then'](function(_0x1252af){var _0x3d41ea=0x0;if(_0x1252af){if(_0x1252af['countbusyretry']+_0x1252af[_0x993d('0x27')]+_0x1252af[_0x993d('0x20')]+_0x1252af['countnosuchnumberretry']+_0x1252af['countdropretry']+_0x1252af[_0x993d('0x23')]+_0x1252af[_0x993d('0x24')]+_0x1252af['countagentrejectretry']<_0x4f0cd7[_0x993d('0x25')][_0x993d('0x26')])_0x3d41ea=0x1;_0x5221af({'additional':_0x3d41ea});}else{_0x5221af({'additional':0x0});}})['catch'](function(_0x3ab80e){logger['error'](_0x993d('0x14'),_0x3ab80e[_0x993d('0x10')]);_0x424e00(_0x91a1eb[_0x993d('0xf')](0x1f4,_0x3ab80e['message']));});}})[_0x993d('0x13')](function(_0x46e687){logger[_0x993d('0xf')](_0x993d('0x14'),_0x46e687[_0x993d('0x10')]);_0x424e00(_0x91a1eb[_0x993d('0xf')](0x1f4,_0x46e687['message']));});}else _0x5221af({'additional':0x0});});});};exports[_0x993d('0x28')]=function(_0x38c1df){var _0x126538=this;return new Promise(function(_0x230140,_0xe5daec){return db[_0x993d('0x15')]['findOne']({'raw':!![],'where':{'ContactId':_0x38c1df[_0x993d('0x19')][_0x993d('0x17')],'ListId':_0x38c1df[_0x993d('0x19')][_0x993d('0x18')],'VoiceQueueId':_0x38c1df[_0x993d('0x19')][_0x993d('0x1a')]===undefined?null:_0x38c1df[_0x993d('0x19')]['VoiceQueueId'],'CampaignId':_0x38c1df['body'][_0x993d('0x1b')]===undefined?null:_0x38c1df['body'][_0x993d('0x1b')]}})[_0x993d('0x9')](function(_0x208936){if(_0x208936!=null){return db['CmHopperAdditionalPhone'][_0x993d('0x16')]({'raw':!![],'where':{'CmHopperId':_0x208936['id'],'OrderBy':{'$gte':_0x208936[_0x993d('0x1d')]}},'order':[[_0x993d('0x1d'),_0x993d('0x1e')]]})[_0x993d('0x9')](function(_0x21f390){if(_0x21f390)return activateAdditionalPhone(_0x208936,_0x38c1df[_0x993d('0x19')],_0x21f390,_0x38c1df['duration'],_0x38c1df[_0x993d('0x29')])[_0x993d('0x9')](function(_0x269c8c){_0x230140(_0x269c8c);});else{return db[_0x993d('0x1c')][_0x993d('0x16')]({'raw':!![],'where':{'CmHopperId':_0x208936['id']},'order':[[_0x993d('0x1d'),_0x993d('0x1e')]]})['then'](function(_0x2e0d81){if(_0x2e0d81)return activateAdditionalPhone(_0x208936,_0x38c1df[_0x993d('0x19')],_0x2e0d81,_0x38c1df['duration'],_0x38c1df[_0x993d('0x29')])[_0x993d('0x9')](function(_0x5838a3){_0x230140(_0x5838a3);});else{_0x230140({'id':_0x208936['id'],'phone':''});}})[_0x993d('0x13')](function(_0x4d3cd1){logger[_0x993d('0xf')](_0x993d('0x14'),_0x4d3cd1[_0x993d('0x10')]);_0xe5daec(_0x126538[_0x993d('0xf')](0x1f4,_0x4d3cd1['message']));});}})[_0x993d('0x13')](function(_0x556957){logger['error'](_0x993d('0x14'),_0x556957[_0x993d('0x10')]);_0xe5daec(_0x126538[_0x993d('0xf')](0x1f4,_0x556957[_0x993d('0x10')]));});}else _0x230140(0x1);});});};function activateAdditionalPhone(_0x227abd,_0x371e36,_0x4765f6,_0x2a8a5a,_0x162d82){return new Promise(function(_0x2df42a,_0x3078fc){var _0x5af291;if(_[_0x993d('0x2a')](_0x4765f6['scheduledat'])){_0x4765f6[_0x993d('0x2b')]=moment();}if(moment()>moment(_0x4765f6['scheduledat'])){_0x5af291=moment()[_0x993d('0x2c')](_0x162d82||0x3,_0x993d('0x2d'));}else{if(_0x4765f6[_0x993d('0x1d')]==0x0){_0x5af291=moment(_0x4765f6[_0x993d('0x2b')]);}else{_0x5af291=moment()[_0x993d('0x2c')](_0x162d82||0x3,'minutes');}}if(_['isNil'](_0x5af291)){_0x5af291=moment()[_0x993d('0x2c')](_0x162d82||0x3,'minutes');}var _0x20021b={'phone':_0x227abd[_0x993d('0x2e')],'active':0x0,'OrderBy':_[_0x993d('0x2a')](_0x227abd[_0x993d('0x1d')])?0x0:_0x227abd[_0x993d('0x1d')],'scheduledat':moment()[_0x993d('0x2c')](_0x2a8a5a||0x1,_0x993d('0x2d')),'countbusyretry':_0x371e36[_0x993d('0x1f')],'countcongestionretry':_0x371e36[_0x993d('0x27')],'countnoanswerretry':_0x371e36[_0x993d('0x20')],'countnosuchnumberretry':_0x371e36[_0x993d('0x21')],'countdropretry':_0x371e36[_0x993d('0x22')],'countabandonedretry':_0x371e36[_0x993d('0x23')],'countmachineretry':_0x371e36[_0x993d('0x24')],'countagentrejectretry':_0x371e36['countagentrejectretry'],'createdAt':_0x371e36[_0x993d('0x2f')],'updatedAt':_0x371e36[_0x993d('0x30')]};var _0x3f9f64={'CmHopperId':_0x227abd['id'],'phone':_0x4765f6[_0x993d('0x2e')],'active':0x0,'OrderBy':_[_0x993d('0x2a')](_0x4765f6[_0x993d('0x1d')])?0x0:_0x4765f6[_0x993d('0x1d')],'scheduledat':_0x5af291,'countbusyretry':_0x4765f6['countbusyretry'],'countcongestionretry':_0x4765f6[_0x993d('0x27')],'countnoanswerretry':_0x4765f6[_0x993d('0x20')],'countnosuchnumberretry':_0x4765f6[_0x993d('0x21')],'countdropretry':_0x4765f6[_0x993d('0x22')],'countabandonedretry':_0x4765f6[_0x993d('0x23')],'countmachineretry':_0x4765f6[_0x993d('0x24')],'countagentrejectretry':_0x4765f6['countagentrejectretry'],'createdAt':_0x4765f6['createdAt'],'updatedAt':_0x4765f6[_0x993d('0x30')]};return db[_0x993d('0x31')][_0x993d('0x32')](function(_0x2e9b27){return db[_0x993d('0x1c')][_0x993d('0x33')](_0x20021b,{'where':{'id':_0x4765f6['id']}},{'transaction':_0x2e9b27})[_0x993d('0x9')](function(){return db[_0x993d('0x15')]['update'](_0x3f9f64,{'where':{'id':_0x227abd['id']}},{'transaction':_0x2e9b27});});})[_0x993d('0x9')](function(_0x2f8710){_0x2df42a({'id':_0x227abd['id'],'phone':_0x4765f6[_0x993d('0x2e')]});})['catch'](function(_0x882e73){logger[_0x993d('0xf')]('activateAdditionalPhone',_0x882e73[_0x993d('0x10')]);_0x3078fc({'error':_0x882e73['message']});});});}exports['IncrementPreviewCounters']=function(_0x585615){var _0x45ba18=this;return new Promise(function(_0x2aa5c3,_0x3f7c95){return db['CmHopper'][_0x993d('0x33')](_0x585615[_0x993d('0x19')][_0x993d('0x34')],{'where':{'id':_0x585615[_0x993d('0x19')]['id']}})['then'](function(_0x52c3ee){_0x2aa5c3(_0x52c3ee);})[_0x993d('0x13')](function(_0x3c6e14){logger[_0x993d('0xf')](_0x993d('0x35'),_0x3c6e14[_0x993d('0x10')]);_0x3f7c95(_0x45ba18['error'](0x1f4,_0x3c6e14[_0x993d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 0f82749..9e615f4 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 _0xbac0=['../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4eadce,_0x37db7f){var _0x1f1dfe=function(_0x1283c1){while(--_0x1283c1){_0x4eadce['push'](_0x4eadce['shift']());}};_0x1f1dfe(++_0x37db7f);}(_0xbac0,0x8c));var _0x0bac=function(_0xd6fcb5,_0x526523){_0xd6fcb5=_0xd6fcb5-0x0;var _0x278ac7=_0xbac0[_0xd6fcb5];return _0x278ac7;};'use strict';var multer=require(_0x0bac('0x0'));var util=require('util');var path=require(_0x0bac('0x1'));var timeout=require(_0x0bac('0x2'));var express=require(_0x0bac('0x3'));var router=express[_0x0bac('0x4')]();var fs_extra=require(_0x0bac('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0bac('0x6'));var config=require(_0x0bac('0x7'));var controller=require(_0x0bac('0x8'));router[_0x0bac('0x9')]('/',auth[_0x0bac('0xa')](),controller[_0x0bac('0xb')]);router[_0x0bac('0x9')](_0x0bac('0xc'),auth[_0x0bac('0xa')](),controller[_0x0bac('0xd')]);router[_0x0bac('0xe')]('/',auth[_0x0bac('0xa')](),controller[_0x0bac('0xf')]);router[_0x0bac('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0bac('0x11')]);router[_0x0bac('0x12')]('/:id',auth[_0x0bac('0xa')](),controller[_0x0bac('0x13')]);module[_0x0bac('0x14')]=router; \ No newline at end of file +var _0x082f=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','put'];(function(_0x163ed6,_0x2a45ad){var _0x301162=function(_0x43231e){while(--_0x43231e){_0x163ed6['push'](_0x163ed6['shift']());}};_0x301162(++_0x2a45ad);}(_0x082f,0xf4));var _0xf082=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0x082f[_0x3df3c6];return _0x254c43;};'use strict';var multer=require('multer');var util=require(_0xf082('0x0'));var path=require(_0xf082('0x1'));var timeout=require(_0xf082('0x2'));var express=require(_0xf082('0x3'));var router=express[_0xf082('0x4')]();var fs_extra=require(_0xf082('0x5'));var auth=require(_0xf082('0x6'));var interaction=require(_0xf082('0x7'));var config=require(_0xf082('0x8'));var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth[_0xf082('0x9')](),controller[_0xf082('0xa')]);router[_0xf082('0xb')](_0xf082('0xc'),auth[_0xf082('0x9')](),controller[_0xf082('0xd')]);router['post']('/',auth[_0xf082('0x9')](),controller[_0xf082('0xe')]);router[_0xf082('0xf')](_0xf082('0xc'),auth[_0xf082('0x9')](),controller[_0xf082('0x10')]);router[_0xf082('0x11')](_0xf082('0xc'),auth[_0xf082('0x9')](),controller[_0xf082('0x12')]);module[_0xf082('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index e5f949f..5b88291 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 _0xc3a8=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0xf8ef99,_0x3e389d){var _0x53a843=function(_0x5b278b){while(--_0x5b278b){_0xf8ef99['push'](_0xf8ef99['shift']());}};_0x53a843(++_0x3e389d);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x28fca4,_0x11e78b){_0x28fca4=_0x28fca4-0x0;var _0x42fd01=_0xc3a8[_0x28fca4];return _0x42fd01;};'use strict';var moment=require(_0x8c3a('0x0'));var Sequelize=require(_0x8c3a('0x1'));module[_0x8c3a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8c3a('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8c3a('0x3')],'unique':_0x8c3a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x8c3a('0x3')],'unique':_0x8c3a('0x4')}}; \ No newline at end of file +var _0x1228=['exports','INTEGER','contactListQueue','moment'];(function(_0x2197c3,_0x310b38){var _0x120c87=function(_0x32b0bb){while(--_0x32b0bb){_0x2197c3['push'](_0x2197c3['shift']());}};_0x120c87(++_0x310b38);}(_0x1228,0x12f));var _0x8122=function(_0x39eb93,_0x23bd66){_0x39eb93=_0x39eb93-0x0;var _0x31bdfd=_0x1228[_0x39eb93];return _0x31bdfd;};'use strict';var moment=require(_0x8122('0x0'));var Sequelize=require('sequelize');module[_0x8122('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8122('0x2')],'unique':_0x8122('0x3')},'ListId':{'type':Sequelize[_0x8122('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x8122('0x2')],'unique':_0x8122('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b7d4b2e..6312aab 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 _0xdc84=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','findAll','rows','catch','params','include','find','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1c3a1a,_0xfa88ee){var _0x37eb4e=function(_0x48c7c0){while(--_0x48c7c0){_0x1c3a1a['push'](_0x1c3a1a['shift']());}};_0x37eb4e(++_0xfa88ee);}(_0xdc84,0x1ad));var _0x4dc8=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0xdc84[_0x2d61ac];return _0x3f7d3c;};'use strict';var emlformat=require(_0x4dc8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4dc8('0x1'));var jsonpatch=require(_0x4dc8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4dc8('0x3'));var Mustache=require(_0x4dc8('0x4'));var util=require(_0x4dc8('0x5'));var path=require(_0x4dc8('0x6'));var sox=require(_0x4dc8('0x7'));var csv=require(_0x4dc8('0x8'));var ejs=require(_0x4dc8('0x9'));var fs=require('fs');var fs_extra=require(_0x4dc8('0xa'));var _=require(_0x4dc8('0xb'));var squel=require(_0x4dc8('0xc'));var crypto=require(_0x4dc8('0xd'));var jsforce=require(_0x4dc8('0xe'));var deskjs=require(_0x4dc8('0xf'));var toCsv=require(_0x4dc8('0x8'));var querystring=require('querystring');var Papa=require(_0x4dc8('0x10'));var Redis=require(_0x4dc8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4dc8('0x12'));var hardwareService=require(_0x4dc8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4dc8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4dc8('0x15'));var db=require(_0x4dc8('0x16'))['db'];function respondWithStatusCode(_0x11bf09,_0x546788){_0x546788=_0x546788||0xcc;return function(_0x2160cc){if(_0x2160cc){return _0x11bf09[_0x4dc8('0x17')](_0x546788);}return _0x11bf09[_0x4dc8('0x18')](_0x546788)[_0x4dc8('0x19')]();};}function respondWithResult(_0x21d42f,_0x5a5462){_0x5a5462=_0x5a5462||0xc8;return function(_0x54f203){if(_0x54f203){return _0x21d42f[_0x4dc8('0x18')](_0x5a5462)[_0x4dc8('0x1a')](_0x54f203);}};}function respondWithFilteredResult(_0x18664a,_0x118c9d){return function(_0x2310a8){if(_0x2310a8){var _0x55a9fc=typeof _0x118c9d['offset']===_0x4dc8('0x1b')&&typeof _0x118c9d[_0x4dc8('0x1c')]===_0x4dc8('0x1b');var _0x453453=_0x2310a8[_0x4dc8('0x1d')];var _0xbb0cea=_0x55a9fc?0x0:_0x118c9d[_0x4dc8('0x1e')];var _0x4334d3=_0x55a9fc?_0x2310a8[_0x4dc8('0x1d')]:_0x118c9d[_0x4dc8('0x1e')]+_0x118c9d[_0x4dc8('0x1c')];var _0xfe3c96;if(_0x4334d3>=_0x453453){_0x4334d3=_0x453453;_0xfe3c96=0xc8;}else{_0xfe3c96=0xce;}_0x18664a[_0x4dc8('0x18')](_0xfe3c96);return _0x18664a[_0x4dc8('0x1f')](_0x4dc8('0x20'),_0xbb0cea+'-'+_0x4334d3+'/'+_0x453453)[_0x4dc8('0x1a')](_0x2310a8);}return null;};}function patchUpdates(_0x262aa6){return function(_0x19b48f){try{jsonpatch[_0x4dc8('0x21')](_0x19b48f,_0x262aa6,!![]);}catch(_0x3e36dc){return BPromise['reject'](_0x3e36dc);}return _0x19b48f[_0x4dc8('0x22')]();};}function saveUpdates(_0x429971,_0x486588){return function(_0x4518a3){if(_0x4518a3){return _0x4518a3[_0x4dc8('0x23')](_0x429971)[_0x4dc8('0x24')](function(_0x106fbe){return _0x106fbe;});}return null;};}function removeEntity(_0x1842bc,_0x3e4e2b){return function(_0x5daefa){if(_0x5daefa){return _0x5daefa[_0x4dc8('0x25')]()[_0x4dc8('0x24')](function(){_0x1842bc[_0x4dc8('0x18')](0xcc)[_0x4dc8('0x19')]();});}};}function handleEntityNotFound(_0x29f96b,_0x246860){return function(_0x1186a9){if(!_0x1186a9){_0x29f96b[_0x4dc8('0x17')](0x194);}return _0x1186a9;};}function handleError(_0x332cb5,_0x1a8d38){_0x1a8d38=_0x1a8d38||0x1f4;return function(_0x158b28){logger[_0x4dc8('0x26')](_0x158b28[_0x4dc8('0x27')]);if(_0x158b28[_0x4dc8('0x28')]){delete _0x158b28[_0x4dc8('0x28')];}_0x332cb5[_0x4dc8('0x18')](_0x1a8d38)['send'](_0x158b28);};}exports[_0x4dc8('0x29')]=function(_0x2838a2,_0xae941c){var _0x19dd56={},_0x136ecb={},_0x1905ac={'count':0x0,'rows':[]};var _0x3387f2=_[_0x4dc8('0x2a')](db[_0x4dc8('0x2b')][_0x4dc8('0x2c')],function(_0x477197){return{'name':_0x477197[_0x4dc8('0x2d')],'type':_0x477197['type'][_0x4dc8('0x2e')]};});_0x136ecb[_0x4dc8('0x2f')]=_[_0x4dc8('0x2a')](_0x3387f2,'name');_0x136ecb[_0x4dc8('0x30')]=_[_0x4dc8('0x31')](_0x2838a2['query']);_0x136ecb[_0x4dc8('0x32')]=_['intersection'](_0x136ecb['model'],_0x136ecb[_0x4dc8('0x30')]);_0x19dd56['attributes']=_[_0x4dc8('0x33')](_0x136ecb[_0x4dc8('0x2f')],qs[_0x4dc8('0x34')](_0x2838a2[_0x4dc8('0x30')][_0x4dc8('0x34')]));_0x19dd56['attributes']=_0x19dd56[_0x4dc8('0x35')][_0x4dc8('0x36')]?_0x19dd56[_0x4dc8('0x35')]:_0x136ecb[_0x4dc8('0x2f')];if(!_0x2838a2['query'][_0x4dc8('0x37')](_0x4dc8('0x38'))){_0x19dd56[_0x4dc8('0x1c')]=qs[_0x4dc8('0x1c')](_0x2838a2['query'][_0x4dc8('0x1c')]);_0x19dd56[_0x4dc8('0x1e')]=qs[_0x4dc8('0x1e')](_0x2838a2[_0x4dc8('0x30')][_0x4dc8('0x1e')]);}_0x19dd56[_0x4dc8('0x39')]=qs[_0x4dc8('0x3a')](_0x2838a2[_0x4dc8('0x30')][_0x4dc8('0x3a')]);_0x19dd56['where']=qs['filters'](_[_0x4dc8('0x3b')](_0x2838a2[_0x4dc8('0x30')],_0x136ecb['filters']),_0x3387f2);if(_0x2838a2['query'][_0x4dc8('0x3c')]){_0x19dd56[_0x4dc8('0x3d')]=_[_0x4dc8('0x3e')](_0x19dd56[_0x4dc8('0x3d')],{'$or':_[_0x4dc8('0x2a')](_0x3387f2,function(_0x2e1eb6){if(_0x2e1eb6[_0x4dc8('0x3f')]!==_0x4dc8('0x40')){var _0x3e2148={};_0x3e2148[_0x2e1eb6[_0x4dc8('0x28')]]={'$like':'%'+_0x2838a2[_0x4dc8('0x30')][_0x4dc8('0x3c')]+'%'};return _0x3e2148;}})});}_0x19dd56=_[_0x4dc8('0x3e')]({},_0x19dd56,_0x2838a2['options']);var _0x3ef8b={'where':_0x19dd56[_0x4dc8('0x3d')]};return db[_0x4dc8('0x2b')][_0x4dc8('0x1d')](_0x3ef8b)[_0x4dc8('0x24')](function(_0x54650e){_0x1905ac['count']=_0x54650e;if(_0x2838a2[_0x4dc8('0x30')]['includeAll']){_0x19dd56['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x4dc8('0x41')](_0x19dd56);})[_0x4dc8('0x24')](function(_0x5cf85a){_0x1905ac[_0x4dc8('0x42')]=_0x5cf85a;return _0x1905ac;})[_0x4dc8('0x24')](respondWithFilteredResult(_0xae941c,_0x19dd56))[_0x4dc8('0x43')](handleError(_0xae941c,null));};exports['show']=function(_0x4d11e9,_0x2168b1){var _0x47f88d={'raw':!![],'where':{'id':_0x4d11e9[_0x4dc8('0x44')]['id']}},_0x2687ee={};_0x2687ee[_0x4dc8('0x2f')]=_[_0x4dc8('0x31')](db[_0x4dc8('0x2b')][_0x4dc8('0x2c')]);_0x2687ee[_0x4dc8('0x30')]=_['keys'](_0x4d11e9[_0x4dc8('0x30')]);_0x2687ee[_0x4dc8('0x32')]=_[_0x4dc8('0x33')](_0x2687ee[_0x4dc8('0x2f')],_0x2687ee['query']);_0x47f88d[_0x4dc8('0x35')]=_[_0x4dc8('0x33')](_0x2687ee[_0x4dc8('0x2f')],qs[_0x4dc8('0x34')](_0x4d11e9['query']['fields']));_0x47f88d['attributes']=_0x47f88d[_0x4dc8('0x35')]['length']?_0x47f88d[_0x4dc8('0x35')]:_0x2687ee[_0x4dc8('0x2f')];if(_0x4d11e9[_0x4dc8('0x30')]['includeAll']){_0x47f88d[_0x4dc8('0x45')]=[{'all':!![]}];}_0x47f88d=_['merge']({},_0x47f88d,_0x4d11e9['options']);return db['CmHopperBlack'][_0x4dc8('0x46')](_0x47f88d)[_0x4dc8('0x24')](handleEntityNotFound(_0x2168b1,null))['then'](respondWithResult(_0x2168b1,null))[_0x4dc8('0x43')](handleError(_0x2168b1,null));};exports[_0x4dc8('0x23')]=function(_0xfd0963,_0x5a1c9e){if(_0xfd0963[_0x4dc8('0x47')]['id']){delete _0xfd0963[_0x4dc8('0x47')]['id'];}return db[_0x4dc8('0x2b')][_0x4dc8('0x46')]({'where':{'id':_0xfd0963[_0x4dc8('0x44')]['id']}})[_0x4dc8('0x24')](handleEntityNotFound(_0x5a1c9e,null))[_0x4dc8('0x24')](saveUpdates(_0xfd0963[_0x4dc8('0x47')],null))[_0x4dc8('0x24')](respondWithResult(_0x5a1c9e,null))[_0x4dc8('0x43')](handleError(_0x5a1c9e,null));};exports[_0x4dc8('0x25')]=function(_0x1fc455,_0x189bb7){return db[_0x4dc8('0x2b')][_0x4dc8('0x46')]({'where':{'id':_0x1fc455[_0x4dc8('0x44')]['id']}})[_0x4dc8('0x24')](handleEntityNotFound(_0x189bb7,null))[_0x4dc8('0x24')](removeEntity(_0x189bb7,null))[_0x4dc8('0x43')](handleError(_0x189bb7,null));};exports[_0x4dc8('0x48')]=function(_0x3464c4,_0x2210d6){return db[_0x4dc8('0x2b')][_0x4dc8('0x48')]()[_0x4dc8('0x24')](respondWithResult(_0x2210d6,null))[_0x4dc8('0x43')](handleError(_0x2210d6,null));}; \ No newline at end of file +var _0x24ee=['body','describe','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','CmHopperBlack','fieldName','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','keys','find'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x24ee,0x1b2));var _0xe24e=function(_0x325bc4,_0x4df462){_0x325bc4=_0x325bc4-0x0;var _0x330091=_0x24ee[_0x325bc4];return _0x330091;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe24e('0x0'));var moment=require(_0xe24e('0x1'));var BPromise=require(_0xe24e('0x2'));var Mustache=require(_0xe24e('0x3'));var util=require(_0xe24e('0x4'));var path=require(_0xe24e('0x5'));var sox=require(_0xe24e('0x6'));var csv=require(_0xe24e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe24e('0x8'));var _=require(_0xe24e('0x9'));var squel=require(_0xe24e('0xa'));var crypto=require(_0xe24e('0xb'));var jsforce=require(_0xe24e('0xc'));var deskjs=require(_0xe24e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe24e('0xe'));var Papa=require(_0xe24e('0xf'));var Redis=require('ioredis');var authService=require(_0xe24e('0x10'));var qs=require(_0xe24e('0x11'));var as=require(_0xe24e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe24e('0x13'))('api');var utils=require(_0xe24e('0x14'));var config=require(_0xe24e('0x15'));var licenseUtil=require(_0xe24e('0x16'));var db=require(_0xe24e('0x17'))['db'];function respondWithStatusCode(_0x5c8ca5,_0x5e3bca){_0x5e3bca=_0x5e3bca||0xcc;return function(_0x530968){if(_0x530968){return _0x5c8ca5['sendStatus'](_0x5e3bca);}return _0x5c8ca5[_0xe24e('0x18')](_0x5e3bca)['end']();};}function respondWithResult(_0x273fb7,_0xe010c6){_0xe010c6=_0xe010c6||0xc8;return function(_0x4967e9){if(_0x4967e9){return _0x273fb7[_0xe24e('0x18')](_0xe010c6)[_0xe24e('0x19')](_0x4967e9);}};}function respondWithFilteredResult(_0x193478,_0x27eb9a){return function(_0x5e30f6){if(_0x5e30f6){var _0x3aa137=typeof _0x27eb9a['offset']===_0xe24e('0x1a')&&typeof _0x27eb9a[_0xe24e('0x1b')]===_0xe24e('0x1a');var _0x175162=_0x5e30f6[_0xe24e('0x1c')];var _0x1b164d=_0x3aa137?0x0:_0x27eb9a[_0xe24e('0x1d')];var _0xc9ffd3=_0x3aa137?_0x5e30f6['count']:_0x27eb9a[_0xe24e('0x1d')]+_0x27eb9a[_0xe24e('0x1b')];var _0x2e844c;if(_0xc9ffd3>=_0x175162){_0xc9ffd3=_0x175162;_0x2e844c=0xc8;}else{_0x2e844c=0xce;}_0x193478[_0xe24e('0x18')](_0x2e844c);return _0x193478['set'](_0xe24e('0x1e'),_0x1b164d+'-'+_0xc9ffd3+'/'+_0x175162)[_0xe24e('0x19')](_0x5e30f6);}return null;};}function patchUpdates(_0x80b4e3){return function(_0xad5dd6){try{jsonpatch[_0xe24e('0x1f')](_0xad5dd6,_0x80b4e3,!![]);}catch(_0x2710b5){return BPromise[_0xe24e('0x20')](_0x2710b5);}return _0xad5dd6[_0xe24e('0x21')]();};}function saveUpdates(_0xa95d73,_0x286d7a){return function(_0x497d1f){if(_0x497d1f){return _0x497d1f[_0xe24e('0x22')](_0xa95d73)[_0xe24e('0x23')](function(_0x19ac7a){return _0x19ac7a;});}return null;};}function removeEntity(_0x1cc665,_0x471455){return function(_0xd1a30a){if(_0xd1a30a){return _0xd1a30a[_0xe24e('0x24')]()['then'](function(){_0x1cc665[_0xe24e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f845d,_0x502a30){return function(_0x3f1e0d){if(!_0x3f1e0d){_0x1f845d[_0xe24e('0x25')](0x194);}return _0x3f1e0d;};}function handleError(_0x31254d,_0x574ab3){_0x574ab3=_0x574ab3||0x1f4;return function(_0x51b75c){logger[_0xe24e('0x26')](_0x51b75c[_0xe24e('0x27')]);if(_0x51b75c['name']){delete _0x51b75c['name'];}_0x31254d[_0xe24e('0x18')](_0x574ab3)[_0xe24e('0x28')](_0x51b75c);};}exports[_0xe24e('0x29')]=function(_0x424d3c,_0x30ef61){var _0x3e01c4={},_0x5c3efc={},_0x42cdba={'count':0x0,'rows':[]};var _0x4d46ef=_[_0xe24e('0x2a')](db[_0xe24e('0x2b')]['rawAttributes'],function(_0x2342a7){return{'name':_0x2342a7[_0xe24e('0x2c')],'type':_0x2342a7[_0xe24e('0x2d')][_0xe24e('0x2e')]};});_0x5c3efc[_0xe24e('0x2f')]=_['map'](_0x4d46ef,_0xe24e('0x30'));_0x5c3efc[_0xe24e('0x31')]=_['keys'](_0x424d3c['query']);_0x5c3efc['filters']=_[_0xe24e('0x32')](_0x5c3efc[_0xe24e('0x2f')],_0x5c3efc[_0xe24e('0x31')]);_0x3e01c4[_0xe24e('0x33')]=_[_0xe24e('0x32')](_0x5c3efc[_0xe24e('0x2f')],qs['fields'](_0x424d3c[_0xe24e('0x31')][_0xe24e('0x34')]));_0x3e01c4[_0xe24e('0x33')]=_0x3e01c4[_0xe24e('0x33')][_0xe24e('0x35')]?_0x3e01c4[_0xe24e('0x33')]:_0x5c3efc[_0xe24e('0x2f')];if(!_0x424d3c[_0xe24e('0x31')][_0xe24e('0x36')](_0xe24e('0x37'))){_0x3e01c4[_0xe24e('0x1b')]=qs[_0xe24e('0x1b')](_0x424d3c['query'][_0xe24e('0x1b')]);_0x3e01c4[_0xe24e('0x1d')]=qs[_0xe24e('0x1d')](_0x424d3c[_0xe24e('0x31')]['offset']);}_0x3e01c4['order']=qs[_0xe24e('0x38')](_0x424d3c['query']['sort']);_0x3e01c4[_0xe24e('0x39')]=qs[_0xe24e('0x3a')](_[_0xe24e('0x3b')](_0x424d3c[_0xe24e('0x31')],_0x5c3efc['filters']),_0x4d46ef);if(_0x424d3c[_0xe24e('0x31')][_0xe24e('0x3c')]){_0x3e01c4[_0xe24e('0x39')]=_[_0xe24e('0x3d')](_0x3e01c4[_0xe24e('0x39')],{'$or':_['map'](_0x4d46ef,function(_0x10861e){if(_0x10861e['type']!==_0xe24e('0x3e')){var _0x7494d8={};_0x7494d8[_0x10861e[_0xe24e('0x30')]]={'$like':'%'+_0x424d3c['query'][_0xe24e('0x3c')]+'%'};return _0x7494d8;}})});}_0x3e01c4=_['merge']({},_0x3e01c4,_0x424d3c['options']);var _0x23534d={'where':_0x3e01c4['where']};return db[_0xe24e('0x2b')]['count'](_0x23534d)[_0xe24e('0x23')](function(_0x4cf89e){_0x42cdba[_0xe24e('0x1c')]=_0x4cf89e;if(_0x424d3c[_0xe24e('0x31')][_0xe24e('0x3f')]){_0x3e01c4['include']=[{'all':!![]}];}return db[_0xe24e('0x2b')][_0xe24e('0x40')](_0x3e01c4);})[_0xe24e('0x23')](function(_0x54b704){_0x42cdba['rows']=_0x54b704;return _0x42cdba;})[_0xe24e('0x23')](respondWithFilteredResult(_0x30ef61,_0x3e01c4))[_0xe24e('0x41')](handleError(_0x30ef61,null));};exports[_0xe24e('0x42')]=function(_0x232746,_0x485c3a){var _0x3623c7={'raw':!![],'where':{'id':_0x232746[_0xe24e('0x43')]['id']}},_0x3a6879={};_0x3a6879[_0xe24e('0x2f')]=_[_0xe24e('0x44')](db[_0xe24e('0x2b')]['rawAttributes']);_0x3a6879[_0xe24e('0x31')]=_['keys'](_0x232746['query']);_0x3a6879[_0xe24e('0x3a')]=_['intersection'](_0x3a6879['model'],_0x3a6879[_0xe24e('0x31')]);_0x3623c7['attributes']=_[_0xe24e('0x32')](_0x3a6879[_0xe24e('0x2f')],qs[_0xe24e('0x34')](_0x232746['query'][_0xe24e('0x34')]));_0x3623c7[_0xe24e('0x33')]=_0x3623c7[_0xe24e('0x33')][_0xe24e('0x35')]?_0x3623c7['attributes']:_0x3a6879[_0xe24e('0x2f')];if(_0x232746[_0xe24e('0x31')][_0xe24e('0x3f')]){_0x3623c7['include']=[{'all':!![]}];}_0x3623c7=_[_0xe24e('0x3d')]({},_0x3623c7,_0x232746['options']);return db[_0xe24e('0x2b')][_0xe24e('0x45')](_0x3623c7)[_0xe24e('0x23')](handleEntityNotFound(_0x485c3a,null))['then'](respondWithResult(_0x485c3a,null))[_0xe24e('0x41')](handleError(_0x485c3a,null));};exports[_0xe24e('0x22')]=function(_0x33ee96,_0x501219){if(_0x33ee96[_0xe24e('0x46')]['id']){delete _0x33ee96[_0xe24e('0x46')]['id'];}return db[_0xe24e('0x2b')][_0xe24e('0x45')]({'where':{'id':_0x33ee96[_0xe24e('0x43')]['id']}})[_0xe24e('0x23')](handleEntityNotFound(_0x501219,null))[_0xe24e('0x23')](saveUpdates(_0x33ee96[_0xe24e('0x46')],null))[_0xe24e('0x23')](respondWithResult(_0x501219,null))[_0xe24e('0x41')](handleError(_0x501219,null));};exports['destroy']=function(_0x2bb4fd,_0x4d3fb7){return db['CmHopperBlack'][_0xe24e('0x45')]({'where':{'id':_0x2bb4fd['params']['id']}})[_0xe24e('0x23')](handleEntityNotFound(_0x4d3fb7,null))[_0xe24e('0x23')](removeEntity(_0x4d3fb7,null))[_0xe24e('0x41')](handleError(_0x4d3fb7,null));};exports[_0xe24e('0x47')]=function(_0x3e8799,_0x4df023){return db[_0xe24e('0x2b')]['describe']()[_0xe24e('0x23')](respondWithResult(_0x4df023,null))[_0xe24e('0x41')](handleError(_0x4df023,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4b3757a..7538ad9 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 _0x3d9d=['../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x54603a,_0x199824){var _0x467b1d=function(_0x567ba3){while(--_0x567ba3){_0x54603a['push'](_0x54603a['shift']());}};_0x467b1d(++_0x199824);}(_0x3d9d,0x1b5));var _0xd3d9=function(_0x4cd69c,_0x1bd26f){_0x4cd69c=_0x4cd69c-0x0;var _0x4b50fe=_0x3d9d[_0x4cd69c];return _0x4b50fe;};'use strict';var _=require(_0xd3d9('0x0'));var util=require(_0xd3d9('0x1'));var logger=require(_0xd3d9('0x2'))(_0xd3d9('0x3'));var moment=require(_0xd3d9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3d9('0x5'));var rimraf=require(_0xd3d9('0x6'));var config=require(_0xd3d9('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0xd3d9('0x8')]=function(_0x686742,_0x7a7557){return _0x686742[_0xd3d9('0x9')](_0xd3d9('0xa'),attributes,{'tableName':_0xd3d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0874=['lodash','util','../../config/logger','moment','request-promise','exports','CmHopperBlack','cm_hopper_black'];(function(_0x4b8414,_0x2a7f22){var _0x505c83=function(_0x2196fa){while(--_0x2196fa){_0x4b8414['push'](_0x4b8414['shift']());}};_0x505c83(++_0x2a7f22);}(_0x0874,0x1f0));var _0x4087=function(_0x47c665,_0x3bf1f0){_0x47c665=_0x47c665-0x0;var _0x3c12c2=_0x0874[_0x47c665];return _0x3c12c2;};'use strict';var _=require(_0x4087('0x0'));var util=require(_0x4087('0x1'));var logger=require(_0x4087('0x2'))('api');var moment=require(_0x4087('0x3'));var BPromise=require('bluebird');var rp=require(_0x4087('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x4087('0x5')]=function(_0x1fb25f,_0x3b4d3e){return _0x1fb25f['define'](_0x4087('0x6'),attributes,{'tableName':_0x4087('0x7'),'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 cb5b92a..bcbe91a 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 _0x0712=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','UpdateCmHopperBlack','body','where','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2bd6d9,_0x2071cb){var _0x4b4929=function(_0x41a57b){while(--_0x41a57b){_0x2bd6d9['push'](_0x2bd6d9['shift']());}};_0x4b4929(++_0x2071cb);}(_0x0712,0x139));var _0x2071=function(_0x5d6b76,_0x46b965){_0x5d6b76=_0x5d6b76-0x0;var _0x471076=_0x0712[_0x5d6b76];return _0x471076;};'use strict';var _=require(_0x2071('0x0'));var util=require(_0x2071('0x1'));var moment=require(_0x2071('0x2'));var BPromise=require(_0x2071('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2071('0x4'));var db=require(_0x2071('0x5'))['db'];var utils=require(_0x2071('0x6'));var logger=require('../../config/logger')(_0x2071('0x7'));var config=require(_0x2071('0x8'));var jayson=require(_0x2071('0x9'));var client=jayson[_0x2071('0xa')][_0x2071('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7ace8e,_0x48eccf,_0x1beb4e){return new BPromise(function(_0x463763,_0x540955){return client[_0x2071('0xc')](_0x7ace8e,_0x1beb4e)[_0x2071('0xd')](function(_0x1f03fd){logger[_0x2071('0xe')](_0x2071('0xf'),_0x48eccf,'request\x20sent');logger['debug'](_0x2071('0x10'),_0x48eccf,_0x2071('0x11'),JSON['stringify'](_0x1f03fd));if(_0x1f03fd[_0x2071('0x12')]){if(_0x1f03fd['error'][_0x2071('0x13')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x48eccf,_0x1f03fd[_0x2071('0x12')][_0x2071('0x14')]);return _0x540955(_0x1f03fd['error']['message']);}logger[_0x2071('0x12')](_0x2071('0xf'),_0x48eccf,_0x1f03fd[_0x2071('0x12')][_0x2071('0x14')]);return _0x463763(_0x1f03fd[_0x2071('0x12')][_0x2071('0x14')]);}else{logger['info'](_0x2071('0xf'),_0x48eccf,_0x2071('0x11'));_0x463763(_0x1f03fd[_0x2071('0x15')][_0x2071('0x14')]);}})[_0x2071('0x16')](function(_0x36ef04){logger['error'](_0x2071('0xf'),_0x48eccf,_0x36ef04);_0x540955(_0x36ef04);});});}exports[_0x2071('0x17')]=function(_0x38cfe3){var _0x51de4f=this;return new Promise(function(_0x1d395e,_0x535a58){return db[_0x2071('0x18')][_0x2071('0x19')]({'raw':_0x38cfe3[_0x2071('0x1a')]?_0x38cfe3['options'][_0x2071('0x1b')]===undefined?!![]:![]:!![],'where':_0x38cfe3['options']?_0x38cfe3[_0x2071('0x1a')]['where']||null:null,'attributes':_0x38cfe3[_0x2071('0x1a')]?_0x38cfe3[_0x2071('0x1a')][_0x2071('0x1c')]||null:null,'limit':_0x38cfe3['options']?_0x38cfe3['options'][_0x2071('0x1d')]||null:null,'include':_0x38cfe3[_0x2071('0x1a')]?_0x38cfe3[_0x2071('0x1a')][_0x2071('0x1e')]?_[_0x2071('0x1f')](_0x38cfe3['options'][_0x2071('0x1e')],function(_0x4c30a7){return{'model':db[_0x4c30a7[_0x2071('0x20')]],'as':_0x4c30a7['as'],'attributes':_0x4c30a7[_0x2071('0x1c')],'include':_0x4c30a7['include']?_['map'](_0x4c30a7[_0x2071('0x1e')],function(_0x2e66b1){return{'model':db[_0x2e66b1['model']],'as':_0x2e66b1['as'],'attributes':_0x2e66b1['attributes'],'include':_0x2e66b1[_0x2071('0x1e')]?_[_0x2071('0x1f')](_0x2e66b1[_0x2071('0x1e')],function(_0x209d61){return{'model':db[_0x209d61[_0x2071('0x20')]],'as':_0x209d61['as'],'attributes':_0x209d61[_0x2071('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2071('0xd')](function(_0x521c6a){logger[_0x2071('0xe')](_0x2071('0x17'),_0x38cfe3);logger[_0x2071('0x21')](_0x2071('0x17'),_0x38cfe3,JSON[_0x2071('0x22')](_0x521c6a));_0x1d395e(_0x521c6a);})[_0x2071('0x16')](function(_0x32c314){logger[_0x2071('0x12')](_0x2071('0x17'),_0x32c314[_0x2071('0x14')],_0x38cfe3);_0x535a58(_0x51de4f['error'](0x1f4,_0x32c314[_0x2071('0x14')]));});});};exports[_0x2071('0x23')]=function(_0x5aef4a){var _0x3e43d8=this;return new Promise(function(_0x3dba31,_0x35181a){return db['CmHopperBlack']['update'](_0x5aef4a[_0x2071('0x24')],{'raw':_0x5aef4a[_0x2071('0x1a')]?_0x5aef4a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aef4a[_0x2071('0x1a')]?_0x5aef4a[_0x2071('0x1a')][_0x2071('0x25')]||null:null,'attributes':_0x5aef4a[_0x2071('0x1a')]?_0x5aef4a['options']['attributes']||null:null,'limit':_0x5aef4a[_0x2071('0x1a')]?_0x5aef4a[_0x2071('0x1a')][_0x2071('0x1d')]||null:null})[_0x2071('0xd')](function(_0x4d1e8f){logger['info'](_0x2071('0x23'),_0x5aef4a);logger[_0x2071('0x21')](_0x2071('0x23'),_0x5aef4a,JSON[_0x2071('0x22')](_0x4d1e8f));_0x3dba31(_0x4d1e8f);})['catch'](function(_0x2f2711){logger[_0x2071('0x12')]('UpdateCmHopperBlack',_0x2f2711[_0x2071('0x14')],_0x5aef4a);_0x35181a(_0x3e43d8[_0x2071('0x12')](0x1f4,_0x2f2711['message']));});});};exports[_0x2071('0x26')]=function(_0x1d4d0a){var _0xafdcde=this;return new Promise(function(_0x43c828,_0x34f83d){return db[_0x2071('0x18')][_0x2071('0x27')]({'where':_0x1d4d0a[_0x2071('0x1a')]?_0x1d4d0a[_0x2071('0x1a')]['where']||null:null})['then'](function(_0x110c02){logger[_0x2071('0xe')](_0x2071('0x26'),_0x1d4d0a);logger[_0x2071('0x21')]('DestroyCmHopperBlack',_0x1d4d0a,JSON['stringify'](_0x110c02));_0x43c828(_0x110c02);})['catch'](function(_0x41c73f){logger[_0x2071('0x12')](_0x2071('0x26'),_0x41c73f[_0x2071('0x14')],_0x1d4d0a);_0x34f83d(_0xafdcde['error'](0x1f4,_0x41c73f[_0x2071('0x14')]));});});}; \ No newline at end of file +var _0x3cc5=['../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','map','model','attributes','debug','stringify','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','where','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x28f7a7,_0x5e7ad8){var _0x37b1fd=function(_0x4a4940){while(--_0x4a4940){_0x28f7a7['push'](_0x28f7a7['shift']());}};_0x37b1fd(++_0x5e7ad8);}(_0x3cc5,0x103));var _0x53cc=function(_0x2f9528,_0x468543){_0x2f9528=_0x2f9528-0x0;var _0x26b016=_0x3cc5[_0x2f9528];return _0x26b016;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x53cc('0x0'));var rs=require(_0x53cc('0x1'));var fs=require('fs');var Redis=require(_0x53cc('0x2'));var db=require(_0x53cc('0x3'))['db'];var utils=require(_0x53cc('0x4'));var logger=require(_0x53cc('0x5'))(_0x53cc('0x6'));var config=require(_0x53cc('0x7'));var jayson=require(_0x53cc('0x8'));var client=jayson[_0x53cc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3f74,_0x2871a3,_0x15e21f){return new BPromise(function(_0x318f20,_0x308d88){return client[_0x53cc('0xa')](_0x4e3f74,_0x15e21f)[_0x53cc('0xb')](function(_0x5e739d){logger[_0x53cc('0xc')](_0x53cc('0xd'),_0x2871a3,_0x53cc('0xe'));logger['debug'](_0x53cc('0xf'),_0x2871a3,'request\x20sent',JSON['stringify'](_0x5e739d));if(_0x5e739d[_0x53cc('0x10')]){if(_0x5e739d[_0x53cc('0x10')]['code']===0x1f4){logger[_0x53cc('0x10')](_0x53cc('0xd'),_0x2871a3,_0x5e739d[_0x53cc('0x10')]['message']);return _0x308d88(_0x5e739d[_0x53cc('0x10')][_0x53cc('0x11')]);}logger[_0x53cc('0x10')](_0x53cc('0xd'),_0x2871a3,_0x5e739d[_0x53cc('0x10')][_0x53cc('0x11')]);return _0x318f20(_0x5e739d[_0x53cc('0x10')][_0x53cc('0x11')]);}else{logger[_0x53cc('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x2871a3,_0x53cc('0xe'));_0x318f20(_0x5e739d[_0x53cc('0x12')][_0x53cc('0x11')]);}})['catch'](function(_0x1f3906){logger[_0x53cc('0x10')](_0x53cc('0xd'),_0x2871a3,_0x1f3906);_0x308d88(_0x1f3906);});});}exports[_0x53cc('0x13')]=function(_0xea7d74){var _0x10b4f4=this;return new Promise(function(_0x165c86,_0x49498d){return db[_0x53cc('0x14')][_0x53cc('0x15')]({'raw':_0xea7d74[_0x53cc('0x16')]?_0xea7d74[_0x53cc('0x16')][_0x53cc('0x17')]===undefined?!![]:![]:!![],'where':_0xea7d74['options']?_0xea7d74[_0x53cc('0x16')]['where']||null:null,'attributes':_0xea7d74['options']?_0xea7d74[_0x53cc('0x16')]['attributes']||null:null,'limit':_0xea7d74[_0x53cc('0x16')]?_0xea7d74[_0x53cc('0x16')][_0x53cc('0x18')]||null:null,'include':_0xea7d74[_0x53cc('0x16')]?_0xea7d74[_0x53cc('0x16')][_0x53cc('0x19')]?_[_0x53cc('0x1a')](_0xea7d74[_0x53cc('0x16')][_0x53cc('0x19')],function(_0x58ae65){return{'model':db[_0x58ae65[_0x53cc('0x1b')]],'as':_0x58ae65['as'],'attributes':_0x58ae65[_0x53cc('0x1c')],'include':_0x58ae65['include']?_['map'](_0x58ae65['include'],function(_0x395efb){return{'model':db[_0x395efb[_0x53cc('0x1b')]],'as':_0x395efb['as'],'attributes':_0x395efb[_0x53cc('0x1c')],'include':_0x395efb[_0x53cc('0x19')]?_[_0x53cc('0x1a')](_0x395efb[_0x53cc('0x19')],function(_0x22492c){return{'model':db[_0x22492c[_0x53cc('0x1b')]],'as':_0x22492c['as'],'attributes':_0x22492c[_0x53cc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34f970){logger[_0x53cc('0xc')]('GetCmHopperBlack',_0xea7d74);logger[_0x53cc('0x1d')](_0x53cc('0x13'),_0xea7d74,JSON[_0x53cc('0x1e')](_0x34f970));_0x165c86(_0x34f970);})[_0x53cc('0x1f')](function(_0x5dd40d){logger[_0x53cc('0x10')]('GetCmHopperBlack',_0x5dd40d[_0x53cc('0x11')],_0xea7d74);_0x49498d(_0x10b4f4['error'](0x1f4,_0x5dd40d[_0x53cc('0x11')]));});});};exports[_0x53cc('0x20')]=function(_0x8203a8){var _0x280d3f=this;return new Promise(function(_0x1c2df5,_0x19009d){return db[_0x53cc('0x14')][_0x53cc('0x21')](_0x8203a8[_0x53cc('0x22')],{'raw':_0x8203a8[_0x53cc('0x16')]?_0x8203a8[_0x53cc('0x16')][_0x53cc('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8203a8['options']?_0x8203a8['options']['where']||null:null,'attributes':_0x8203a8[_0x53cc('0x16')]?_0x8203a8[_0x53cc('0x16')][_0x53cc('0x1c')]||null:null,'limit':_0x8203a8['options']?_0x8203a8[_0x53cc('0x16')][_0x53cc('0x18')]||null:null})[_0x53cc('0xb')](function(_0xa15736){logger[_0x53cc('0xc')](_0x53cc('0x20'),_0x8203a8);logger[_0x53cc('0x1d')](_0x53cc('0x20'),_0x8203a8,JSON[_0x53cc('0x1e')](_0xa15736));_0x1c2df5(_0xa15736);})['catch'](function(_0x4aa8c6){logger[_0x53cc('0x10')](_0x53cc('0x20'),_0x4aa8c6['message'],_0x8203a8);_0x19009d(_0x280d3f[_0x53cc('0x10')](0x1f4,_0x4aa8c6[_0x53cc('0x11')]));});});};exports[_0x53cc('0x23')]=function(_0xa4baf6){var _0x7c1a16=this;return new Promise(function(_0x549343,_0x545bb6){return db[_0x53cc('0x14')][_0x53cc('0x24')]({'where':_0xa4baf6[_0x53cc('0x16')]?_0xa4baf6['options'][_0x53cc('0x25')]||null:null})['then'](function(_0x4f29e5){logger[_0x53cc('0xc')](_0x53cc('0x23'),_0xa4baf6);logger['debug']('DestroyCmHopperBlack',_0xa4baf6,JSON[_0x53cc('0x1e')](_0x4f29e5));_0x549343(_0x4f29e5);})[_0x53cc('0x1f')](function(_0x3e6169){logger['error'](_0x53cc('0x23'),_0x3e6169[_0x53cc('0x11')],_0xa4baf6);_0x545bb6(_0x7c1a16[_0x53cc('0x10')](0x1f4,_0x3e6169[_0x53cc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 6223594..c4b76ee 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 _0x82c4=['get','/describe','describe','show','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated'];(function(_0x4114ee,_0x3200a8){var _0x2cbf62=function(_0x27cf17){while(--_0x27cf17){_0x4114ee['push'](_0x4114ee['shift']());}};_0x2cbf62(++_0x3200a8);}(_0x82c4,0x1ca));var _0x482c=function(_0x358ef6,_0x3328c5){_0x358ef6=_0x358ef6-0x0;var _0x1fe44d=_0x82c4[_0x358ef6];return _0x1fe44d;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var fs_extra=require(_0x482c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x482c('0x7'));var config=require('../../config/environment');var controller=require(_0x482c('0x8'));router['get']('/',auth[_0x482c('0x9')](),controller['index']);router[_0x482c('0xa')](_0x482c('0xb'),auth[_0x482c('0x9')](),controller[_0x482c('0xc')]);router[_0x482c('0xa')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0xd')]);router[_0x482c('0xe')](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x10')]);router['delete'](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1883=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x585ee9,_0x182d24){var _0x33f2d7=function(_0x31698d){while(--_0x31698d){_0x585ee9['push'](_0x585ee9['shift']());}};_0x33f2d7(++_0x182d24);}(_0x1883,0xab));var _0x3188=function(_0x5af7a6,_0x59101f){_0x5af7a6=_0x5af7a6-0x0;var _0xee7eba=_0x1883[_0x5af7a6];return _0xee7eba;};'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['put'](_0x3188('0xf'),auth[_0x3188('0xc')](),controller[_0x3188('0x11')]);router[_0x3188('0x12')]('/:id',auth[_0x3188('0xc')](),controller[_0x3188('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 819e32f..c406d5d 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 _0xbbd4=['DATE','INTEGER','STRING','getDataValue','endtime','setDataValue','followuptime','BOOLEAN','sequelize','moment','exports'];(function(_0x3b4706,_0x471557){var _0x3405a0=function(_0x3afed0){while(--_0x3afed0){_0x3b4706['push'](_0x3b4706['shift']());}};_0x3405a0(++_0x471557);}(_0xbbd4,0x1b5));var _0x4bbd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbbd4[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x4bbd('0x0'));var moment=require(_0x4bbd('0x1'));module[_0x4bbd('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4bbd('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4bbd('0x5')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x4bbd('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4bbd('0x5')]},'starttime':{'type':Sequelize[_0x4bbd('0x3')]},'responsetime':{'type':Sequelize[_0x4bbd('0x3')]},'answertime':{'type':Sequelize[_0x4bbd('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x4bbd('0x3')]},'ringtime':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4bbd('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4bbd('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4bbd('0x5')]},'dispositionat':{'type':Sequelize[_0x4bbd('0x3')],'set':function(_0x12423b){var _0x110050=this[_0x4bbd('0x6')](_0x4bbd('0x7'));if(_0x110050&&_0x12423b){this[_0x4bbd('0x8')](_0x4bbd('0x9'),moment(_0x12423b)['diff'](moment(_0x110050),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x4bbd('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x4bbd('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x4bbd('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4bbd('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4bbd('0x3')]},'deleted':{'type':Sequelize[_0x4bbd('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x4bbd('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x4bbd('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4bbd('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x98ae=['followuptime','diff','seconds','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x198b0e,_0x2d8cb8){var _0x140a2e=function(_0x574305){while(--_0x574305){_0x198b0e['push'](_0x198b0e['shift']());}};_0x140a2e(++_0x2d8cb8);}(_0x98ae,0x9e));var _0xe98a=function(_0x38bfb9,_0x2c9cfc){_0x38bfb9=_0x38bfb9-0x0;var _0x48a730=_0x98ae[_0x38bfb9];return _0x48a730;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe98a('0x0'));module[_0xe98a('0x1')]={'state':{'type':Sequelize[_0xe98a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe98a('0x3')]},'scheduledat':{'type':Sequelize[_0xe98a('0x4')]},'countbusyretry':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe98a('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xe98a('0x3')]},'calleridnum':{'type':Sequelize[_0xe98a('0x3')]},'calleridname':{'type':Sequelize[_0xe98a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe98a('0x4')]},'answertime':{'type':Sequelize[_0xe98a('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe98a('0x4')]},'ringtime':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe98a('0x3')]},'campaign':{'type':Sequelize[_0xe98a('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe98a('0x3')]},'reason':{'type':Sequelize[_0xe98a('0x3')]},'disposition':{'type':Sequelize[_0xe98a('0x3')]},'secondDisposition':{'type':Sequelize[_0xe98a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xe98a('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x5ea1c3){var _0x5ae45e=this[_0xe98a('0x5')](_0xe98a('0x6'));if(_0x5ae45e&&_0x5ea1c3){this['setDataValue'](_0xe98a('0x7'),moment(_0x5ea1c3)[_0xe98a('0x8')](moment(_0x5ae45e),_0xe98a('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xe98a('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe98a('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe98a('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe98a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe98a('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe98a('0x4')]},'recallme':{'type':Sequelize[_0xe98a('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe98a('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe98a('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index ed698a5..fb0add3 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 _0xc2c7=['`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal'];(function(_0x40b06a,_0x123455){var _0xee60ca=function(_0x587782){while(--_0x587782){_0x40b06a['push'](_0x40b06a['shift']());}};_0xee60ca(++_0x123455);}(_0xc2c7,0x134));var _0x7c2c=function(_0x51d133,_0x38bd68){_0x51d133=_0x51d133-0x0;var _0x36f583=_0xc2c7[_0x51d133];return _0x36f583;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['CmHopperFinal'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['describe']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['describe']()['then'](respondWithResult(_0x3091bd,null))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x39d5af,_0x2b79d5){if(_0x39d5af['body']['uniqueid']){delete _0x39d5af['body'][_0x7c2c('0x48')];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'uniqueid':_0x39d5af[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x2b79d5,null))['then'](saveUpdates(_0x39d5af[_0x7c2c('0x4a')],null))[_0x7c2c('0x26')](respondWithResult(_0x2b79d5,null))['catch'](handleError(_0x2b79d5,null));};exports[_0x7c2c('0x4b')]=function(_0x56e09d,_0xfba6a7,_0x3806f4){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x56e09d['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x4d')))),_0x7c2c('0x4e')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x7c2c('0x53')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x54')))),'congestionContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x58')))),_0x7c2c('0x59')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7c2c('0x26')](handleEntityNotFound(_0xfba6a7,null))[_0x7c2c('0x26')](respondWithResult(_0xfba6a7,null))[_0x7c2c('0x45')](handleError(_0xfba6a7,null));};exports[_0x7c2c('0x5a')]=function(_0x44602a,_0x1ad537,_0x2d04da){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'CampaignId':_0x44602a['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x7c2c('0x4e')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x5b')))),'busyContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7c2c('0x54')))),_0x7c2c('0x5c')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5d')))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5e')))),_0x7c2c('0x5f')]]})['then'](handleEntityNotFound(_0x1ad537,null))[_0x7c2c('0x26')](respondWithResult(_0x1ad537,null))['catch'](handleError(_0x1ad537,null));};exports[_0x7c2c('0x60')]=function(_0x2b597d,_0x20eb63,_0x56f737){return db[_0x7c2c('0x61')][_0x7c2c('0x47')]({'where':{'id':_0x2b597d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x20eb63,null))['then'](function(_0x158352){var _0x1e711e;if(_0x158352){_0x1e711e=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')](_0x7c2c('0x64'))[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),'ListId',_0x7c2c('0x69'),_0x7c2c('0x6a'),'updatedAt'],squel[_0x7c2c('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x7c2c('0x66'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),'scheduledAt')[_0x7c2c('0x6c')](_0x7c2c('0x6e'),_0x7c2c('0x68'))['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')](_0x7c2c('0x71'),'VoiceQueueId')[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),_0x7c2c('0x72'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2b597d[_0x7c2c('0x4a')][_0x7c2c('0x77')][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x66'))[_0x7c2c('0x73')](_0x7c2c('0x64'))['where'](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel['select']()[_0x7c2c('0x6c')]('calleridnum')[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')]('state\x20=\x204'))[_0x7c2c('0x7b')](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x1e711e);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x20eb63,null))[_0x7c2c('0x45')](handleError(_0x20eb63,null));};exports[_0x7c2c('0x7c')]=function(_0x2f249d,_0x136226,_0x354236){return db[_0x7c2c('0x7d')][_0x7c2c('0x47')]({'where':{'id':_0x2f249d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x136226,null))[_0x7c2c('0x26')](function(_0xb47bf0){var _0x4d0922;if(_0xb47bf0){_0x4d0922=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')]('cm_hopper')[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),_0x7c2c('0x70'),'CampaignId',_0x7c2c('0x6a'),_0x7c2c('0x72')],squel[_0x7c2c('0x6b')]()['field'](_0x7c2c('0x7e'),_0x7c2c('0x66'))[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x67'))['field'](_0x7c2c('0x6e'),'ContactId')['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')]('ANY_VALUE(CampaignId)',_0x7c2c('0x7f'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),'updatedAt')['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2f249d[_0x7c2c('0x4a')]['state'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()['field']('phone')[_0x7c2c('0x73')](_0x7c2c('0x64'))[_0x7c2c('0x3d')](_0x7c2c('0x80'),_0x2f249d['params']['id'][_0x7c2c('0x78')]()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x81'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')]('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())['where'](_0x7c2c('0x82')))['group'](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x4d0922);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x136226,null))[_0x7c2c('0x45')](handleError(_0x136226,null));};exports[_0x7c2c('0x83')]=function(_0x309051,_0x3f8683,_0x1eeb00){return db[_0x7c2c('0x84')]['findOne']({'where':{'VoiceQueueId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x69')],'CampaignId':_0x309051[_0x7c2c('0x4a')]['CampaignId'],'ContactId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x68')]}})['then'](handleEntityNotFound(_0x3f8683,null))[_0x7c2c('0x26')](function(_0x511158){if(_0x511158){return _0x511158;}return null;})[_0x7c2c('0x26')](respondWithResult(_0x3f8683,null))['catch'](handleError(_0x3f8683,null));}; \ No newline at end of file +var _0xacf4=['reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','NOW()','CampaignId\x20=\x20?','checkContactHopper','CmHopper','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x2c10c6,_0x248ce7){var _0x5e4cd2=function(_0x1ac489){while(--_0x1ac489){_0x2c10c6['push'](_0x2c10c6['shift']());}};_0x5e4cd2(++_0x248ce7);}(_0xacf4,0xe7));var _0x4acf=function(_0x2512be,_0x2715eb){_0x2512be=_0x2512be-0x0;var _0x323f42=_0xacf4[_0x2512be];return _0x323f42;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['CmHopperFinal'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':!![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['CmHopperFinal']['describe']()[_0x4acf('0x21')](respondWithResult(_0x2d946c,null))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x33bc52,_0x287406){if(_0x33bc52[_0x4acf('0x47')][_0x4acf('0x48')]){delete _0x33bc52[_0x4acf('0x47')][_0x4acf('0x48')];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'uniqueid':_0x33bc52[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x287406,null))[_0x4acf('0x21')](saveUpdates(_0x33bc52[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x287406,null))[_0x4acf('0x3f')](handleError(_0x287406,null));};exports[_0x4acf('0x49')]=function(_0x3cf54a,_0x2785b9,_0x2d0561){return db[_0x4acf('0x29')][_0x4acf('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x3cf54a[_0x4acf('0x41')]['id']},'attributes':[[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x200,\x201,\x20null'))),_0x4acf('0x4d')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x4e')))),_0x4acf('0x4f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x50')))),'busyContacts'],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x51')))),_0x4acf('0x52')],[db['sequelize']['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4acf('0x53')],[db['sequelize']['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x54')))),_0x4acf('0x55')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4acf('0x56')],[db[_0x4acf('0x4a')]['fn']('COUNT',db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal'](_0x4acf('0x57')))),_0x4acf('0x58')]]})[_0x4acf('0x21')](handleEntityNotFound(_0x2785b9,null))['then'](respondWithResult(_0x2785b9,null))[_0x4acf('0x3f')](handleError(_0x2785b9,null));};exports[_0x4acf('0x59')]=function(_0xb5bd81,_0x452ee6,_0x54b093){return db[_0x4acf('0x29')][_0x4acf('0x3d')]({'raw':![],'where':{'CampaignId':_0xb5bd81[_0x4acf('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x5a')))),_0x4acf('0x4d')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x4e')))),_0x4acf('0x4f')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x50')))),_0x4acf('0x5b')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x4acf('0x52')],[db['sequelize']['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4acf('0x5c')))),_0x4acf('0x53')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db['sequelize'][_0x4acf('0x4c')](_0x4acf('0x5d')))),_0x4acf('0x56')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db['sequelize'][_0x4acf('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x4acf('0x58')]]})[_0x4acf('0x21')](handleEntityNotFound(_0x452ee6,null))[_0x4acf('0x21')](respondWithResult(_0x452ee6,null))[_0x4acf('0x3f')](handleError(_0x452ee6,null));};exports[_0x4acf('0x5e')]=function(_0x173655,_0x1f2dbc,_0xc0d942){return db[_0x4acf('0x5f')][_0x4acf('0x45')]({'where':{'id':_0x173655[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x1f2dbc,null))['then'](function(_0x11f356){var _0xacca91;if(_0x11f356){_0xacca91=squel[_0x4acf('0x60')]()[_0x4acf('0x61')](_0x4acf('0x62'))[_0x4acf('0x63')]([_0x4acf('0x64'),_0x4acf('0x65'),_0x4acf('0x66'),_0x4acf('0x67'),'VoiceQueueId',_0x4acf('0x68'),_0x4acf('0x69')],squel['select']()[_0x4acf('0x6a')](_0x4acf('0x6b'),'phone')[_0x4acf('0x6a')]('NOW()','scheduledAt')[_0x4acf('0x6a')]('ANY_VALUE(ContactId)',_0x4acf('0x66'))[_0x4acf('0x6a')](_0x4acf('0x6c'),_0x4acf('0x67'))['field'](_0x4acf('0x6d'),_0x4acf('0x6e'))['field']('NOW()','createdAt')[_0x4acf('0x6a')]('NOW()',_0x4acf('0x69'))[_0x4acf('0x6f')](_0x4acf('0x70'))['where'](_0x4acf('0x71'),_0x173655[_0x4acf('0x41')]['id']['toString']())[_0x4acf('0x35')](_0x4acf('0x72'),_0x173655['body'][_0x4acf('0x73')][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x75'))[_0x4acf('0x35')](_0x4acf('0x76'),squel['select']()[_0x4acf('0x6a')]('phone')[_0x4acf('0x6f')](_0x4acf('0x62'))['where']('VoiceQueueId\x20=\x20?',_0x173655['params']['id'][_0x4acf('0x74')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x4acf('0x6a')]('calleridnum')[_0x4acf('0x6f')](_0x4acf('0x70'))[_0x4acf('0x35')](_0x4acf('0x71'),_0x173655[_0x4acf('0x41')]['id']['toString']())['where'](_0x4acf('0x77')))[_0x4acf('0x78')](_0x4acf('0x66')))[_0x4acf('0x74')]();return db[_0x4acf('0x4a')]['query'](_0xacca91);}return[];})[_0x4acf('0x21')](respondWithResult(_0x1f2dbc,null))[_0x4acf('0x3f')](handleError(_0x1f2dbc,null));};exports[_0x4acf('0x79')]=function(_0x453c6d,_0x1a82e7,_0x3d02c7){return db[_0x4acf('0x7a')]['find']({'where':{'id':_0x453c6d[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a82e7,null))[_0x4acf('0x21')](function(_0x1bbe6d){var _0x2a36e2;if(_0x1bbe6d){_0x2a36e2=squel[_0x4acf('0x60')]()[_0x4acf('0x61')]('cm_hopper')[_0x4acf('0x63')](['phone',_0x4acf('0x65'),_0x4acf('0x66'),'ListId',_0x4acf('0x7b'),_0x4acf('0x68'),_0x4acf('0x69')],squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')]('ANY_VALUE(calleridnum)',_0x4acf('0x64'))['field']('NOW()',_0x4acf('0x65'))[_0x4acf('0x6a')](_0x4acf('0x7d'),_0x4acf('0x66'))['field']('ANY_VALUE(ListId)',_0x4acf('0x67'))[_0x4acf('0x6a')](_0x4acf('0x7e'),_0x4acf('0x7b'))[_0x4acf('0x6a')](_0x4acf('0x7f'),_0x4acf('0x68'))[_0x4acf('0x6a')]('NOW()','updatedAt')[_0x4acf('0x6f')](_0x4acf('0x70'))[_0x4acf('0x35')](_0x4acf('0x80'),_0x453c6d[_0x4acf('0x41')]['id'][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x72'),_0x453c6d[_0x4acf('0x47')]['state'][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x75'))[_0x4acf('0x35')](_0x4acf('0x76'),squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')](_0x4acf('0x64'))[_0x4acf('0x6f')](_0x4acf('0x62'))[_0x4acf('0x35')](_0x4acf('0x80'),_0x453c6d[_0x4acf('0x41')]['id']['toString']()))[_0x4acf('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')]('calleridnum')[_0x4acf('0x6f')](_0x4acf('0x70'))['where']('CampaignId\x20=\x20?',_0x453c6d[_0x4acf('0x41')]['id'][_0x4acf('0x74')]())['where']('state\x20=\x204'))[_0x4acf('0x78')](_0x4acf('0x66')))[_0x4acf('0x74')]();return db[_0x4acf('0x4a')]['query'](_0x2a36e2);}return[];})[_0x4acf('0x21')](respondWithResult(_0x1a82e7,null))[_0x4acf('0x3f')](handleError(_0x1a82e7,null));};exports[_0x4acf('0x81')]=function(_0x34e1ea,_0x43e9bf,_0x367ad4){return db[_0x4acf('0x82')]['findOne']({'where':{'VoiceQueueId':_0x34e1ea[_0x4acf('0x47')][_0x4acf('0x6e')],'CampaignId':_0x34e1ea[_0x4acf('0x47')]['CampaignId'],'ContactId':_0x34e1ea[_0x4acf('0x47')][_0x4acf('0x66')]}})[_0x4acf('0x21')](handleEntityNotFound(_0x43e9bf,null))[_0x4acf('0x21')](function(_0x37ffab){if(_0x37ffab){return _0x37ffab;}return null;})[_0x4acf('0x21')](respondWithResult(_0x43e9bf,null))[_0x4acf('0x3f')](handleError(_0x43e9bf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index cf5e3fb..3e9391f 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 _0x23ad=['calleridnum','uniqueid','lodash','api','moment','bluebird','request-promise','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x23ad,0x12b));var _0xd23a=function(_0x563d0b,_0x2814d5){_0x563d0b=_0x563d0b-0x0;var _0x3b8b55=_0x23ad[_0x563d0b];return _0x3b8b55;};'use strict';var _=require(_0xd23a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd23a('0x1'));var moment=require(_0xd23a('0x2'));var BPromise=require(_0xd23a('0x3'));var rp=require(_0xd23a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd23a('0x5'));module[_0xd23a('0x6')]=function(_0x56fef9,_0x2e2b4c){return _0x56fef9[_0xd23a('0x7')](_0xd23a('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xd23a('0x9'),'fields':[_0xd23a('0x9')]},{'name':_0xd23a('0xa'),'fields':[_0xd23a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f67=['bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment'];(function(_0x1d6be0,_0x5e2b0b){var _0x4b6c6c=function(_0x45c439){while(--_0x45c439){_0x1d6be0['push'](_0x1d6be0['shift']());}};_0x4b6c6c(++_0x5e2b0b);}(_0x9f67,0xa5));var _0x79f6=function(_0x2e20cb,_0x1fe626){_0x2e20cb=_0x2e20cb-0x0;var _0x51d5fa=_0x9f67[_0x2e20cb];return _0x51d5fa;};'use strict';var _=require('lodash');var util=require(_0x79f6('0x0'));var logger=require(_0x79f6('0x1'))(_0x79f6('0x2'));var moment=require(_0x79f6('0x3'));var BPromise=require(_0x79f6('0x4'));var rp=require(_0x79f6('0x5'));var fs=require('fs');var path=require(_0x79f6('0x6'));var rimraf=require(_0x79f6('0x7'));var config=require('../../config/environment');var attributes=require(_0x79f6('0x8'));module[_0x79f6('0x9')]=function(_0x276dd5,_0x4465aa){return _0x276dd5['define']('CmHopperFinal',attributes,{'tableName':_0x79f6('0xa'),'paranoid':![],'indexes':[{'name':_0x79f6('0xb'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x79f6('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 1d202b2..3e0450b 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x50cf60,_0x10c50c){var _0x51b3b0=function(_0x143aed){while(--_0x143aed){_0x50cf60['push'](_0x50cf60['shift']());}};_0x51b3b0(++_0x10c50c);}(_0xb10b,0x12a));var _0xbb10=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xb10b[_0x38ce4c];return _0x5d4544;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3524e3,_0x325a04){var _0x26b7c9=function(_0x398446){while(--_0x398446){_0x3524e3['push'](_0x3524e3['shift']());}};_0x26b7c9(++_0x325a04);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e38a4,_0x333514){_0x5e38a4=_0x5e38a4-0x0;var _0x401332=_0xb10b[_0x5e38a4];return _0x401332;};'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 cfa8fab..7d388ab 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 _0x36fb=['./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','/:id','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4370c7,_0x5dbfb0){var _0xce78a9=function(_0x157b2c){while(--_0x157b2c){_0x4370c7['push'](_0x4370c7['shift']());}};_0xce78a9(++_0x5dbfb0);}(_0x36fb,0xc8));var _0xb36f=function(_0x7bf747,_0x5a3e7e){_0x7bf747=_0x7bf747-0x0;var _0x198866=_0x36fb[_0x7bf747];return _0x198866;};'use strict';var multer=require(_0xb36f('0x0'));var util=require(_0xb36f('0x1'));var path=require(_0xb36f('0x2'));var timeout=require('connect-timeout');var express=require(_0xb36f('0x3'));var router=express[_0xb36f('0x4')]();var fs_extra=require(_0xb36f('0x5'));var auth=require(_0xb36f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb36f('0x7'));var controller=require(_0xb36f('0x8'));router[_0xb36f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb36f('0xa')]);router[_0xb36f('0x9')](_0xb36f('0xb'),auth[_0xb36f('0xc')](),controller[_0xb36f('0xd')]);router[_0xb36f('0x9')]('/:id',auth[_0xb36f('0xc')](),controller[_0xb36f('0xe')]);router[_0xb36f('0x9')](_0xb36f('0xf'),auth[_0xb36f('0xc')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xb36f('0x9')](_0xb36f('0x10'),auth[_0xb36f('0xc')](),controller[_0xb36f('0x11')]);router['post'](_0xb36f('0x12'),auth[_0xb36f('0xc')](),controller[_0xb36f('0x13')]);router[_0xb36f('0x14')](_0xb36f('0x15'),auth[_0xb36f('0xc')](),controller[_0xb36f('0x16')]);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0xb36f('0x17')]);router['put'](_0xb36f('0x18'),auth[_0xb36f('0xc')](),controller[_0xb36f('0x19')]);module['exports']=router; \ No newline at end of file +var _0x8782=['fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','index','get','isAuthenticated','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','exports','multer','path','express','Router'];(function(_0x53780b,_0x2dd15c){var _0x175167=function(_0x57842f){while(--_0x57842f){_0x53780b['push'](_0x53780b['shift']());}};_0x175167(++_0x2dd15c);}(_0x8782,0x11c));var _0x2878=function(_0x446c90,_0x5e8d4f){_0x446c90=_0x446c90-0x0;var _0x5498aa=_0x8782[_0x446c90];return _0x5498aa;};'use strict';var multer=require(_0x2878('0x0'));var util=require('util');var path=require(_0x2878('0x1'));var timeout=require('connect-timeout');var express=require(_0x2878('0x2'));var router=express[_0x2878('0x3')]();var fs_extra=require(_0x2878('0x4'));var auth=require(_0x2878('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2878('0x6'));var controller=require(_0x2878('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2878('0x8')]);router[_0x2878('0x9')]('/describe',auth[_0x2878('0xa')](),controller[_0x2878('0xb')]);router['get']('/:id',auth[_0x2878('0xa')](),controller[_0x2878('0xc')]);router[_0x2878('0x9')](_0x2878('0xd'),auth['isAuthenticated'](),controller[_0x2878('0xe')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0x2878('0xf')]);router[_0x2878('0x10')](_0x2878('0x11'),auth[_0x2878('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth[_0x2878('0xa')](),controller[_0x2878('0x12')]);router[_0x2878('0x10')](_0x2878('0x13'),auth[_0x2878('0xa')](),controller[_0x2878('0x14')]);router[_0x2878('0x15')](_0x2878('0x16'),auth[_0x2878('0xa')](),controller['update']);module[_0x2878('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index d88a439..50a2b5a 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 _0x2786=['BOOLEAN','sequelize','exports','INTEGER','DATE','STRING'];(function(_0x141dfd,_0x5310c4){var _0x35f88d=function(_0x491a73){while(--_0x491a73){_0x141dfd['push'](_0x141dfd['shift']());}};_0x35f88d(++_0x5310c4);}(_0x2786,0xc1));var _0x6278=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2786[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x6278('0x0'));module[_0x6278('0x1')]={'state':{'type':Sequelize[_0x6278('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x6278('0x3')]},'countbusyretry':{'type':Sequelize[_0x6278('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6278('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x6278('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6278('0x4')]},'calleridname':{'type':Sequelize[_0x6278('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6278('0x3')]},'answertime':{'type':Sequelize[_0x6278('0x3')]},'droptime':{'type':Sequelize[_0x6278('0x3')]},'endtime':{'type':Sequelize[_0x6278('0x3')]},'ringtime':{'type':Sequelize[_0x6278('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6278('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6278('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6278('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x6278('0x4')]},'campaigntype':{'type':Sequelize[_0x6278('0x4')]},'membername':{'type':Sequelize[_0x6278('0x4')]},'reason':{'type':Sequelize[_0x6278('0x4')]},'amd':{'type':Sequelize[_0x6278('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x6278('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6278('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6278('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6278('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6278('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6278('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6278('0x4')]}}; \ No newline at end of file +var _0x8838=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x3d3133,_0x91c70f){var _0x23c055=function(_0x1b3c60){while(--_0x1b3c60){_0x3d3133['push'](_0x3d3133['shift']());}};_0x23c055(++_0x91c70f);}(_0x8838,0x90));var _0x8883=function(_0x971c2f,_0x4ac0a9){_0x971c2f=_0x971c2f-0x0;var _0x2aa178=_0x8838[_0x971c2f];return _0x2aa178;};'use strict';var Sequelize=require(_0x8883('0x0'));module[_0x8883('0x1')]={'state':{'type':Sequelize[_0x8883('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8883('0x3')]},'scheduledat':{'type':Sequelize[_0x8883('0x4')]},'countbusyretry':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8883('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8883('0x3')]},'originatecalleridname':{'type':Sequelize[_0x8883('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8883('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8883('0x4')]},'droptime':{'type':Sequelize[_0x8883('0x4')]},'endtime':{'type':Sequelize[_0x8883('0x4')]},'ringtime':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x8883('0x3')]},'campaigntype':{'type':Sequelize[_0x8883('0x3')]},'membername':{'type':Sequelize[_0x8883('0x3')]},'reason':{'type':Sequelize[_0x8883('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x8883('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8883('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8883('0x4')]},'recallme':{'type':Sequelize[_0x8883('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8883('0x4')]},'edited':{'type':Sequelize[_0x8883('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8883('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8883('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8fadc7e..506d9d6 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 _0x5184=['model','query','keys','intersection','fields','attributes','length','nolimit','filters','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','uniqueid','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','error','name','index','map','CmHopperHistory','fieldName','key'];(function(_0x68359d,_0x51477f){var _0x15d875=function(_0x5efef8){while(--_0x5efef8){_0x68359d['push'](_0x68359d['shift']());}};_0x15d875(++_0x51477f);}(_0x5184,0xa0));var _0x4518=function(_0x283a63,_0x33bae8){_0x283a63=_0x283a63-0x0;var _0x28785c=_0x5184[_0x283a63];return _0x28785c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4518('0x0'));var zipdir=require(_0x4518('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4518('0x2'));var Mustache=require('mustache');var util=require(_0x4518('0x3'));var path=require(_0x4518('0x4'));var sox=require(_0x4518('0x5'));var csv=require(_0x4518('0x6'));var ejs=require(_0x4518('0x7'));var fs=require('fs');var fs_extra=require(_0x4518('0x8'));var _=require('lodash');var squel=require(_0x4518('0x9'));var crypto=require(_0x4518('0xa'));var jsforce=require(_0x4518('0xb'));var deskjs=require(_0x4518('0xc'));var toCsv=require(_0x4518('0x6'));var querystring=require(_0x4518('0xd'));var Papa=require(_0x4518('0xe'));var Redis=require(_0x4518('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4518('0x10'));var logger=require(_0x4518('0x11'))(_0x4518('0x12'));var utils=require(_0x4518('0x13'));var config=require(_0x4518('0x14'));var licenseUtil=require(_0x4518('0x15'));var db=require(_0x4518('0x16'))['db'];function respondWithStatusCode(_0x5a0203,_0x15dc2f){_0x15dc2f=_0x15dc2f||0xcc;return function(_0x16116f){if(_0x16116f){return _0x5a0203['sendStatus'](_0x15dc2f);}return _0x5a0203[_0x4518('0x17')](_0x15dc2f)[_0x4518('0x18')]();};}function respondWithResult(_0x4c8427,_0x312c61){_0x312c61=_0x312c61||0xc8;return function(_0x58d3d2){if(_0x58d3d2){return _0x4c8427['status'](_0x312c61)[_0x4518('0x19')](_0x58d3d2);}};}function respondWithFilteredResult(_0x382235,_0x3d25c2){return function(_0x45a666){if(_0x45a666){var _0x24d118=typeof _0x3d25c2[_0x4518('0x1a')]===_0x4518('0x1b')&&typeof _0x3d25c2[_0x4518('0x1c')]==='undefined';var _0x18da15=_0x45a666[_0x4518('0x1d')];var _0x5af9dc=_0x24d118?0x0:_0x3d25c2[_0x4518('0x1a')];var _0x3616ac=_0x24d118?_0x45a666['count']:_0x3d25c2[_0x4518('0x1a')]+_0x3d25c2[_0x4518('0x1c')];var _0x509873;if(_0x3616ac>=_0x18da15){_0x3616ac=_0x18da15;_0x509873=0xc8;}else{_0x509873=0xce;}_0x382235['status'](_0x509873);return _0x382235[_0x4518('0x1e')](_0x4518('0x1f'),_0x5af9dc+'-'+_0x3616ac+'/'+_0x18da15)[_0x4518('0x19')](_0x45a666);}return null;};}function patchUpdates(_0x33e863){return function(_0x432b57){try{jsonpatch[_0x4518('0x20')](_0x432b57,_0x33e863,!![]);}catch(_0x18279c){return BPromise[_0x4518('0x21')](_0x18279c);}return _0x432b57['save']();};}function saveUpdates(_0x56fd27,_0x2c19fa){return function(_0x3cdf5d){if(_0x3cdf5d){return _0x3cdf5d[_0x4518('0x22')](_0x56fd27)[_0x4518('0x23')](function(_0x344be0){return _0x344be0;});}return null;};}function removeEntity(_0xf555b7,_0x58fab7){return function(_0x4e87ae){if(_0x4e87ae){return _0x4e87ae['destroy']()[_0x4518('0x23')](function(){_0xf555b7['status'](0xcc)[_0x4518('0x18')]();});}};}function handleEntityNotFound(_0x5ae82f,_0x58cc2f){return function(_0x237d4f){if(!_0x237d4f){_0x5ae82f[_0x4518('0x24')](0x194);}return _0x237d4f;};}function handleError(_0x3f49ba,_0x199ebc){_0x199ebc=_0x199ebc||0x1f4;return function(_0x908349){logger[_0x4518('0x25')](_0x908349['stack']);if(_0x908349[_0x4518('0x26')]){delete _0x908349[_0x4518('0x26')];}_0x3f49ba[_0x4518('0x17')](_0x199ebc)['send'](_0x908349);};}exports[_0x4518('0x27')]=function(_0x86924e,_0x34a85f){var _0x423d67={},_0x190682={},_0x24f4d2={'count':0x0,'rows':[]};var _0x572156=_[_0x4518('0x28')](db[_0x4518('0x29')]['rawAttributes'],function(_0x32004d){return{'name':_0x32004d[_0x4518('0x2a')],'type':_0x32004d['type'][_0x4518('0x2b')]};});_0x190682[_0x4518('0x2c')]=_[_0x4518('0x28')](_0x572156,_0x4518('0x26'));_0x190682[_0x4518('0x2d')]=_[_0x4518('0x2e')](_0x86924e[_0x4518('0x2d')]);_0x190682['filters']=_['intersection'](_0x190682[_0x4518('0x2c')],_0x190682['query']);_0x423d67['attributes']=_[_0x4518('0x2f')](_0x190682['model'],qs['fields'](_0x86924e[_0x4518('0x2d')][_0x4518('0x30')]));_0x423d67[_0x4518('0x31')]=_0x423d67['attributes'][_0x4518('0x32')]?_0x423d67[_0x4518('0x31')]:_0x190682[_0x4518('0x2c')];if(!_0x86924e[_0x4518('0x2d')]['hasOwnProperty'](_0x4518('0x33'))){_0x423d67[_0x4518('0x1c')]=qs[_0x4518('0x1c')](_0x86924e['query'][_0x4518('0x1c')]);_0x423d67['offset']=qs[_0x4518('0x1a')](_0x86924e[_0x4518('0x2d')][_0x4518('0x1a')]);}_0x423d67['order']=qs['sort'](_0x86924e[_0x4518('0x2d')]['sort']);_0x423d67['where']=qs['filters'](_['pick'](_0x86924e[_0x4518('0x2d')],_0x190682[_0x4518('0x34')]),_0x572156);if(_0x86924e[_0x4518('0x2d')]['filter']){_0x423d67['where']=_['merge'](_0x423d67[_0x4518('0x35')],{'$or':_[_0x4518('0x28')](_0x572156,function(_0x303ff1){if(_0x303ff1['type']!==_0x4518('0x36')){var _0x4e9c2f={};_0x4e9c2f[_0x303ff1[_0x4518('0x26')]]={'$like':'%'+_0x86924e[_0x4518('0x2d')]['filter']+'%'};return _0x4e9c2f;}})});}_0x423d67=_['merge']({},_0x423d67,_0x86924e[_0x4518('0x37')]);var _0x29e9e7={'where':_0x423d67[_0x4518('0x35')]};return db[_0x4518('0x29')][_0x4518('0x1d')](_0x29e9e7)[_0x4518('0x23')](function(_0x2844d2){_0x24f4d2[_0x4518('0x1d')]=_0x2844d2;if(_0x86924e[_0x4518('0x2d')][_0x4518('0x38')]){_0x423d67[_0x4518('0x39')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4518('0x3a')](_0x423d67);})[_0x4518('0x23')](function(_0x3c5048){_0x24f4d2[_0x4518('0x3b')]=_0x3c5048;return _0x24f4d2;})[_0x4518('0x23')](respondWithFilteredResult(_0x34a85f,_0x423d67))[_0x4518('0x3c')](handleError(_0x34a85f,null));};exports['show']=function(_0x23fd8f,_0x8e56e5){var _0x2547a6={'raw':!![],'where':{'id':_0x23fd8f[_0x4518('0x3d')]['id']}},_0x5ae5da={};_0x5ae5da[_0x4518('0x2c')]=_[_0x4518('0x2e')](db[_0x4518('0x29')][_0x4518('0x3e')]);_0x5ae5da[_0x4518('0x2d')]=_[_0x4518('0x2e')](_0x23fd8f['query']);_0x5ae5da[_0x4518('0x34')]=_['intersection'](_0x5ae5da['model'],_0x5ae5da[_0x4518('0x2d')]);_0x2547a6[_0x4518('0x31')]=_[_0x4518('0x2f')](_0x5ae5da[_0x4518('0x2c')],qs[_0x4518('0x30')](_0x23fd8f['query']['fields']));_0x2547a6[_0x4518('0x31')]=_0x2547a6[_0x4518('0x31')][_0x4518('0x32')]?_0x2547a6[_0x4518('0x31')]:_0x5ae5da['model'];if(_0x23fd8f[_0x4518('0x2d')][_0x4518('0x38')]){_0x2547a6['include']=[{'all':!![]}];}_0x2547a6=_['merge']({},_0x2547a6,_0x23fd8f[_0x4518('0x37')]);return db[_0x4518('0x29')][_0x4518('0x3f')](_0x2547a6)[_0x4518('0x23')](handleEntityNotFound(_0x8e56e5,null))[_0x4518('0x23')](respondWithResult(_0x8e56e5,null))['catch'](handleError(_0x8e56e5,null));};exports[_0x4518('0x40')]=function(_0x115fe2,_0x47cfed){return db['CmHopperHistory']['create'](_0x115fe2[_0x4518('0x41')],{})[_0x4518('0x23')](respondWithResult(_0x47cfed,0xc9))[_0x4518('0x3c')](handleError(_0x47cfed,null));};exports[_0x4518('0x42')]=function(_0x4613af,_0x213f38){return db['CmHopperHistory'][_0x4518('0x42')]()[_0x4518('0x23')](respondWithResult(_0x213f38,null))[_0x4518('0x3c')](handleError(_0x213f38,null));};exports['update']=function(_0x4c9173,_0x5e9290){if(_0x4c9173[_0x4518('0x41')][_0x4518('0x43')]){delete _0x4c9173['body'][_0x4518('0x43')];}return db[_0x4518('0x29')]['find']({'where':{'uniqueid':_0x4c9173[_0x4518('0x3d')]['id']}})[_0x4518('0x23')](handleEntityNotFound(_0x5e9290,null))['then'](saveUpdates(_0x4c9173[_0x4518('0x41')],null))[_0x4518('0x23')](respondWithResult(_0x5e9290,null))[_0x4518('0x3c')](handleError(_0x5e9290,null));}; \ No newline at end of file +var _0x582f=['type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','uniqueid','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','CmHopperHistory','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x582f,0xbf));var _0xf582=function(_0x4b7e4d,_0x82d2ab){_0x4b7e4d=_0x4b7e4d-0x0;var _0x38d6af=_0x582f[_0x4b7e4d];return _0x38d6af;};'use strict';var emlformat=require(_0xf582('0x0'));var rimraf=require(_0xf582('0x1'));var zipdir=require(_0xf582('0x2'));var jsonpatch=require(_0xf582('0x3'));var rp=require('request-promise');var moment=require(_0xf582('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf582('0x5'));var util=require(_0xf582('0x6'));var path=require(_0xf582('0x7'));var sox=require(_0xf582('0x8'));var csv=require(_0xf582('0x9'));var ejs=require(_0xf582('0xa'));var fs=require('fs');var fs_extra=require(_0xf582('0xb'));var _=require(_0xf582('0xc'));var squel=require(_0xf582('0xd'));var crypto=require(_0xf582('0xe'));var jsforce=require(_0xf582('0xf'));var deskjs=require(_0xf582('0x10'));var toCsv=require(_0xf582('0x9'));var querystring=require(_0xf582('0x11'));var Papa=require(_0xf582('0x12'));var Redis=require(_0xf582('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf582('0x14'));var as=require(_0xf582('0x15'));var hardwareService=require(_0xf582('0x16'));var logger=require(_0xf582('0x17'))('api');var utils=require(_0xf582('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf582('0x19'));var db=require(_0xf582('0x1a'))['db'];function respondWithStatusCode(_0x253020,_0x1f1499){_0x1f1499=_0x1f1499||0xcc;return function(_0x4dd6a2){if(_0x4dd6a2){return _0x253020[_0xf582('0x1b')](_0x1f1499);}return _0x253020[_0xf582('0x1c')](_0x1f1499)[_0xf582('0x1d')]();};}function respondWithResult(_0x14d1c7,_0x5ac6ec){_0x5ac6ec=_0x5ac6ec||0xc8;return function(_0x250cbb){if(_0x250cbb){return _0x14d1c7['status'](_0x5ac6ec)[_0xf582('0x1e')](_0x250cbb);}};}function respondWithFilteredResult(_0x132567,_0x1660cd){return function(_0x40638d){if(_0x40638d){var _0x371a9e=typeof _0x1660cd[_0xf582('0x1f')]===_0xf582('0x20')&&typeof _0x1660cd[_0xf582('0x21')]==='undefined';var _0x417173=_0x40638d['count'];var _0x49d24e=_0x371a9e?0x0:_0x1660cd[_0xf582('0x1f')];var _0x108c8e=_0x371a9e?_0x40638d[_0xf582('0x22')]:_0x1660cd['offset']+_0x1660cd[_0xf582('0x21')];var _0x4d8de4;if(_0x108c8e>=_0x417173){_0x108c8e=_0x417173;_0x4d8de4=0xc8;}else{_0x4d8de4=0xce;}_0x132567[_0xf582('0x1c')](_0x4d8de4);return _0x132567['set'](_0xf582('0x23'),_0x49d24e+'-'+_0x108c8e+'/'+_0x417173)[_0xf582('0x1e')](_0x40638d);}return null;};}function patchUpdates(_0xe319db){return function(_0x5dc48e){try{jsonpatch[_0xf582('0x24')](_0x5dc48e,_0xe319db,!![]);}catch(_0x22b478){return BPromise[_0xf582('0x25')](_0x22b478);}return _0x5dc48e[_0xf582('0x26')]();};}function saveUpdates(_0x255543,_0x2ff664){return function(_0x502ad7){if(_0x502ad7){return _0x502ad7[_0xf582('0x27')](_0x255543)['then'](function(_0x4ccd92){return _0x4ccd92;});}return null;};}function removeEntity(_0x5e09c7,_0x3a04d4){return function(_0x33b8d6){if(_0x33b8d6){return _0x33b8d6[_0xf582('0x28')]()[_0xf582('0x29')](function(){_0x5e09c7[_0xf582('0x1c')](0xcc)[_0xf582('0x1d')]();});}};}function handleEntityNotFound(_0x1b976f,_0x4b5d69){return function(_0x217495){if(!_0x217495){_0x1b976f['sendStatus'](0x194);}return _0x217495;};}function handleError(_0x579487,_0x580b0b){_0x580b0b=_0x580b0b||0x1f4;return function(_0x299279){logger[_0xf582('0x2a')](_0x299279['stack']);if(_0x299279[_0xf582('0x2b')]){delete _0x299279[_0xf582('0x2b')];}_0x579487[_0xf582('0x1c')](_0x580b0b)[_0xf582('0x2c')](_0x299279);};}exports[_0xf582('0x2d')]=function(_0x44dd78,_0x3cfda9){var _0x39b2a6={},_0x3e6e01={},_0x1d1422={'count':0x0,'rows':[]};var _0x3a8366=_[_0xf582('0x2e')](db[_0xf582('0x2f')]['rawAttributes'],function(_0x273b49){return{'name':_0x273b49[_0xf582('0x30')],'type':_0x273b49[_0xf582('0x31')][_0xf582('0x32')]};});_0x3e6e01[_0xf582('0x33')]=_[_0xf582('0x2e')](_0x3a8366,_0xf582('0x2b'));_0x3e6e01[_0xf582('0x34')]=_[_0xf582('0x35')](_0x44dd78[_0xf582('0x34')]);_0x3e6e01['filters']=_['intersection'](_0x3e6e01[_0xf582('0x33')],_0x3e6e01[_0xf582('0x34')]);_0x39b2a6[_0xf582('0x36')]=_[_0xf582('0x37')](_0x3e6e01[_0xf582('0x33')],qs[_0xf582('0x38')](_0x44dd78['query'][_0xf582('0x38')]));_0x39b2a6[_0xf582('0x36')]=_0x39b2a6['attributes']['length']?_0x39b2a6[_0xf582('0x36')]:_0x3e6e01[_0xf582('0x33')];if(!_0x44dd78[_0xf582('0x34')]['hasOwnProperty'](_0xf582('0x39'))){_0x39b2a6[_0xf582('0x21')]=qs[_0xf582('0x21')](_0x44dd78[_0xf582('0x34')][_0xf582('0x21')]);_0x39b2a6['offset']=qs[_0xf582('0x1f')](_0x44dd78[_0xf582('0x34')]['offset']);}_0x39b2a6[_0xf582('0x3a')]=qs['sort'](_0x44dd78['query'][_0xf582('0x3b')]);_0x39b2a6[_0xf582('0x3c')]=qs['filters'](_[_0xf582('0x3d')](_0x44dd78[_0xf582('0x34')],_0x3e6e01[_0xf582('0x3e')]),_0x3a8366);if(_0x44dd78[_0xf582('0x34')][_0xf582('0x3f')]){_0x39b2a6[_0xf582('0x3c')]=_['merge'](_0x39b2a6[_0xf582('0x3c')],{'$or':_[_0xf582('0x2e')](_0x3a8366,function(_0x275960){if(_0x275960[_0xf582('0x31')]!==_0xf582('0x40')){var _0x23963d={};_0x23963d[_0x275960[_0xf582('0x2b')]]={'$like':'%'+_0x44dd78[_0xf582('0x34')]['filter']+'%'};return _0x23963d;}})});}_0x39b2a6=_[_0xf582('0x41')]({},_0x39b2a6,_0x44dd78[_0xf582('0x42')]);var _0x17ee7f={'where':_0x39b2a6[_0xf582('0x3c')]};return db[_0xf582('0x2f')][_0xf582('0x22')](_0x17ee7f)[_0xf582('0x29')](function(_0x513a15){_0x1d1422[_0xf582('0x22')]=_0x513a15;if(_0x44dd78[_0xf582('0x34')][_0xf582('0x43')]){_0x39b2a6[_0xf582('0x44')]=[{'all':!![]}];}return db[_0xf582('0x2f')]['findAll'](_0x39b2a6);})[_0xf582('0x29')](function(_0x363d72){_0x1d1422[_0xf582('0x45')]=_0x363d72;return _0x1d1422;})[_0xf582('0x29')](respondWithFilteredResult(_0x3cfda9,_0x39b2a6))[_0xf582('0x46')](handleError(_0x3cfda9,null));};exports[_0xf582('0x47')]=function(_0x229255,_0x351d02){var _0x1f0bf5={'raw':!![],'where':{'id':_0x229255[_0xf582('0x48')]['id']}},_0x21553a={};_0x21553a[_0xf582('0x33')]=_[_0xf582('0x35')](db[_0xf582('0x2f')][_0xf582('0x49')]);_0x21553a['query']=_[_0xf582('0x35')](_0x229255[_0xf582('0x34')]);_0x21553a['filters']=_['intersection'](_0x21553a['model'],_0x21553a[_0xf582('0x34')]);_0x1f0bf5[_0xf582('0x36')]=_[_0xf582('0x37')](_0x21553a[_0xf582('0x33')],qs[_0xf582('0x38')](_0x229255[_0xf582('0x34')][_0xf582('0x38')]));_0x1f0bf5[_0xf582('0x36')]=_0x1f0bf5[_0xf582('0x36')][_0xf582('0x4a')]?_0x1f0bf5[_0xf582('0x36')]:_0x21553a['model'];if(_0x229255[_0xf582('0x34')]['includeAll']){_0x1f0bf5['include']=[{'all':!![]}];}_0x1f0bf5=_[_0xf582('0x41')]({},_0x1f0bf5,_0x229255[_0xf582('0x42')]);return db[_0xf582('0x2f')][_0xf582('0x4b')](_0x1f0bf5)['then'](handleEntityNotFound(_0x351d02,null))[_0xf582('0x29')](respondWithResult(_0x351d02,null))[_0xf582('0x46')](handleError(_0x351d02,null));};exports[_0xf582('0x4c')]=function(_0x662864,_0x4e3baf){return db[_0xf582('0x2f')]['create'](_0x662864[_0xf582('0x4d')],{})[_0xf582('0x29')](respondWithResult(_0x4e3baf,0xc9))[_0xf582('0x46')](handleError(_0x4e3baf,null));};exports['describe']=function(_0xace82b,_0x2ef5a8){return db[_0xf582('0x2f')][_0xf582('0x4e')]()[_0xf582('0x29')](respondWithResult(_0x2ef5a8,null))[_0xf582('0x46')](handleError(_0x2ef5a8,null));};exports['update']=function(_0x307d1b,_0x1781c5){if(_0x307d1b[_0xf582('0x4d')]['uniqueid']){delete _0x307d1b[_0xf582('0x4d')][_0xf582('0x4f')];}return db[_0xf582('0x2f')][_0xf582('0x4b')]({'where':{'uniqueid':_0x307d1b[_0xf582('0x48')]['id']}})[_0xf582('0x29')](handleEntityNotFound(_0x1781c5,null))[_0xf582('0x29')](saveUpdates(_0x307d1b[_0xf582('0x4d')],null))['then'](respondWithResult(_0x1781c5,null))[_0xf582('0x46')](handleError(_0x1781c5,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 8e3c941..4c69768 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 _0x77d4=['exports','define','endtime','uniqueid','util','api','bluebird','request-promise','../../config/environment','./cmHopperHistory.attributes'];(function(_0x5676df,_0x14d122){var _0x1fb878=function(_0x84c80a){while(--_0x84c80a){_0x5676df['push'](_0x5676df['shift']());}};_0x1fb878(++_0x14d122);}(_0x77d4,0x108));var _0x477d=function(_0xde3d50,_0x4b3ead){_0xde3d50=_0xde3d50-0x0;var _0x3acdb9=_0x77d4[_0xde3d50];return _0x3acdb9;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var logger=require('../../config/logger')(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rp=require(_0x477d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x477d('0x4'));var attributes=require(_0x477d('0x5'));module[_0x477d('0x6')]=function(_0x471fca,_0x2545e5){return _0x471fca[_0x477d('0x7')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x477d('0x8'),'fields':['endtime']},{'name':'uniqueid','fields':[_0x477d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3a8=['util','../../config/logger','moment','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x51e05c,_0x235663){var _0x5bc10a=function(_0x130965){while(--_0x130965){_0x51e05c['push'](_0x51e05c['shift']());}};_0x5bc10a(++_0x235663);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x432526,_0x3fc104){_0x432526=_0x432526-0x0;var _0x525a41=_0xf3a8[_0x432526];return _0x525a41;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var logger=require(_0x8f3a('0x1'))('api');var moment=require(_0x8f3a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f3a('0x3'));var rimraf=require('rimraf');var config=require(_0x8f3a('0x4'));var attributes=require('./cmHopperHistory.attributes');module[_0x8f3a('0x5')]=function(_0x3d6e2d,_0x109997){return _0x3d6e2d[_0x8f3a('0x6')](_0x8f3a('0x7'),attributes,{'tableName':_0x8f3a('0x8'),'paranoid':![],'indexes':[{'name':_0x8f3a('0x9'),'fields':[_0x8f3a('0x9')]},{'name':_0x8f3a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index fe776f0..a5b1f63 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 _0x97a2=['predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','campaign','outboundNoSuchCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','name','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','debug','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'];(function(_0x4b81a9,_0x3a0abf){var _0x5ef7da=function(_0x40b5d0){while(--_0x40b5d0){_0x4b81a9['push'](_0x4b81a9['shift']());}};_0x5ef7da(++_0x3a0abf);}(_0x97a2,0x1b1));var _0x297a=function(_0x4fa16e,_0x1f7517){_0x4fa16e=_0x4fa16e-0x0;var _0x2d875a=_0x97a2[_0x4fa16e];return _0x2d875a;};'use strict';var _=require(_0x297a('0x0'));var util=require('util');var moment=require(_0x297a('0x1'));var BPromise=require(_0x297a('0x2'));var rs=require(_0x297a('0x3'));var fs=require('fs');var Redis=require(_0x297a('0x4'));var db=require(_0x297a('0x5'))['db'];var utils=require(_0x297a('0x6'));var logger=require(_0x297a('0x7'))(_0x297a('0x8'));var config=require('../../config/environment');var jayson=require(_0x297a('0x9'));var client=jayson[_0x297a('0xa')][_0x297a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8cbc92,_0x43a7d7,_0x3d9c6a){return new BPromise(function(_0x5ab57b,_0x38b066){return client[_0x297a('0xc')](_0x8cbc92,_0x3d9c6a)[_0x297a('0xd')](function(_0xbf6378){logger[_0x297a('0xe')](_0x297a('0xf'),_0x43a7d7,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x43a7d7,_0x297a('0x10'),JSON[_0x297a('0x11')](_0xbf6378));if(_0xbf6378[_0x297a('0x12')]){if(_0xbf6378[_0x297a('0x12')]['code']===0x1f4){logger[_0x297a('0x12')](_0x297a('0xf'),_0x43a7d7,_0xbf6378[_0x297a('0x12')][_0x297a('0x13')]);return _0x38b066(_0xbf6378[_0x297a('0x12')][_0x297a('0x13')]);}logger[_0x297a('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x43a7d7,_0xbf6378['error'][_0x297a('0x13')]);return _0x5ab57b(_0xbf6378['error'][_0x297a('0x13')]);}else{logger[_0x297a('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x43a7d7,_0x297a('0x10'));_0x5ab57b(_0xbf6378[_0x297a('0x14')]['message']);}})[_0x297a('0x15')](function(_0x333868){logger[_0x297a('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x43a7d7,_0x333868);_0x38b066(_0x333868);});});}exports[_0x297a('0x16')]=function(_0x3af847){var _0x29c6d6=this;return new Promise(function(_0x4d6194,_0xba3b73){return db[_0x297a('0x17')]['create'](_0x3af847[_0x297a('0x18')],{'raw':_0x3af847[_0x297a('0x19')]?_0x3af847[_0x297a('0x19')][_0x297a('0x1a')]===undefined?!![]:![]:!![]})[_0x297a('0xd')](function(_0xde6d1c){logger[_0x297a('0xe')](_0x297a('0x16'),_0x3af847);logger[_0x297a('0x1b')](_0x297a('0x16'),_0x3af847,JSON[_0x297a('0x11')](_0xde6d1c));_0x4d6194(_0xde6d1c);})[_0x297a('0x15')](function(_0x481f59){logger['error']('CreateCmHopperHistory',_0x481f59[_0x297a('0x13')],_0x3af847);_0xba3b73(_0x29c6d6[_0x297a('0x12')](0x1f4,_0x481f59['message']));});});};exports[_0x297a('0x1c')]=function(_0x40919d){var _0x2de036=this;return new Promise(function(_0x1cfe08,_0x519f3b){return db[_0x297a('0x17')][_0x297a('0x1d')]({'raw':_0x40919d[_0x297a('0x19')]?_0x40919d['options'][_0x297a('0x1a')]===undefined?!![]:![]:!![],'where':_0x40919d[_0x297a('0x19')]?_0x40919d[_0x297a('0x19')][_0x297a('0x1e')]||null:null,'attributes':[[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db[_0x297a('0x1f')][_0x297a('0x21')]('id')),_0x297a('0x22')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db['sequelize']['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x24')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x25')))),_0x297a('0x26')],[db['sequelize']['fn']('COUNT',db[_0x297a('0x1f')]['fn']('IF',db['sequelize'][_0x297a('0x23')](_0x297a('0x27')))),_0x297a('0x28')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x29'),db['sequelize']['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x2a')))),_0x297a('0x2b')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x29'),db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x297a('0x2c')]]})['then'](function(_0x399b37){logger[_0x297a('0xe')](_0x297a('0x1c'),_0x40919d);logger[_0x297a('0x1b')]('AvgHandleTime',_0x40919d,JSON[_0x297a('0x11')](_0x399b37));_0x1cfe08(_0x399b37);})['catch'](function(_0x100723){logger[_0x297a('0x12')]('AvgHandleTime',_0x100723[_0x297a('0x13')],_0x40919d);_0x519f3b(_0x2de036[_0x297a('0x12')](0x1f4,_0x100723[_0x297a('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4a17ee){var _0x1fd3b4=this;return new Promise(function(_0x2aa6f9,_0x22e365){return db['CmHopperHistory'][_0x297a('0x1d')]({'raw':_0x4a17ee[_0x297a('0x19')]?_0x4a17ee[_0x297a('0x19')][_0x297a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a17ee[_0x297a('0x19')]?_0x4a17ee[_0x297a('0x19')]['where']||null:null,'attributes':[[_0x297a('0x2d'),'name'],[db[_0x297a('0x1f')]['fn']('COUNT',db[_0x297a('0x1f')]['fn']('IF',db['sequelize'][_0x297a('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0x297a('0x2e')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x297a('0x23')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db['sequelize'][_0x297a('0x23')](_0x297a('0x24')))),_0x297a('0x2f')],[db['sequelize']['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x30')))),'outboundBusyCallsDay'],[db[_0x297a('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x297a('0x23')](_0x297a('0x31')))),_0x297a('0x32')],[db['sequelize']['fn'](_0x297a('0x20'),db['sequelize']['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x33')))),_0x297a('0x34')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db['sequelize']['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x297a('0x35')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')]['literal'](_0x297a('0x36')))),_0x297a('0x37')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x38')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x297a('0x39')))),_0x297a('0x3a')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db['sequelize']['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x3b')))),_0x297a('0x3c')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x3d')))),'outboundAnswerAgiCallsDay'],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')]('`state`\x20=\x2020,\x201,\x20null'))),_0x297a('0x3c')],[db[_0x297a('0x1f')]['fn'](_0x297a('0x20'),db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x3e')))),_0x297a('0x3f')]],'group':[_0x297a('0x2d')]})['then'](function(_0x3d1bfd){logger[_0x297a('0xe')](_0x297a('0x40'),_0x4a17ee);logger[_0x297a('0x1b')](_0x297a('0x40'),_0x4a17ee,JSON[_0x297a('0x11')](_0x3d1bfd));_0x2aa6f9(_0x3d1bfd);})['catch'](function(_0x5f32f5){logger[_0x297a('0x12')](_0x297a('0x40'),_0x5f32f5[_0x297a('0x13')],_0x4a17ee);_0x22e365(_0x1fd3b4[_0x297a('0x12')](0x1f4,_0x5f32f5['message']));});});};exports['GetCampaignHopperHistory']=function(_0x38585b){var _0x22eb86=this;return new Promise(function(_0x149b75,_0x7f8313){return db[_0x297a('0x17')][_0x297a('0x1d')]({'raw':_0x38585b[_0x297a('0x19')]?_0x38585b['options']['raw']===undefined?!![]:![]:!![],'where':_0x38585b[_0x297a('0x19')]?_0x38585b['options']['where']||null:null,'attributes':[['campaign',_0x297a('0x41')],[db['sequelize']['fn'](_0x297a('0x20'),db[_0x297a('0x1f')][_0x297a('0x21')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn']('COUNT',db[_0x297a('0x1f')]['fn']('IF',db[_0x297a('0x1f')][_0x297a('0x23')](_0x297a('0x24')))),_0x297a('0x42')]],'group':['campaign']})['then'](function(_0x3530df){logger[_0x297a('0xe')]('GetCampaignHopperHistory',_0x38585b);logger[_0x297a('0x1b')](_0x297a('0x43'),_0x38585b,JSON[_0x297a('0x11')](_0x3530df));_0x149b75(_0x3530df);})[_0x297a('0x15')](function(_0x222d1d){logger[_0x297a('0x12')]('GetCampaignHopperHistory',_0x222d1d['message'],_0x38585b);_0x7f8313(_0x22eb86[_0x297a('0x12')](0x1f4,_0x222d1d[_0x297a('0x13')]));});});}; \ No newline at end of file +var _0x4a47=['findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','stringify','AvgHandleTime'];(function(_0x1e3000,_0x3629ec){var _0x28fd19=function(_0x1d5855){while(--_0x1d5855){_0x1e3000['push'](_0x1e3000['shift']());}};_0x28fd19(++_0x3629ec);}(_0x4a47,0xb5));var _0x74a4=function(_0x288d33,_0x58ee36){_0x288d33=_0x288d33-0x0;var _0x1033bd=_0x4a47[_0x288d33];return _0x1033bd;};'use strict';var _=require(_0x74a4('0x0'));var util=require(_0x74a4('0x1'));var moment=require(_0x74a4('0x2'));var BPromise=require(_0x74a4('0x3'));var rs=require(_0x74a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74a4('0x6'))(_0x74a4('0x7'));var config=require('../../config/environment');var jayson=require(_0x74a4('0x8'));var client=jayson[_0x74a4('0x9')][_0x74a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ebaa6,_0x41ef5a,_0x55e8a1){return new BPromise(function(_0x3122ba,_0x58e307){return client[_0x74a4('0xb')](_0x4ebaa6,_0x55e8a1)[_0x74a4('0xc')](function(_0x19f82b){logger[_0x74a4('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x41ef5a,_0x74a4('0xe'));logger[_0x74a4('0xf')](_0x74a4('0x10'),_0x41ef5a,_0x74a4('0xe'),JSON['stringify'](_0x19f82b));if(_0x19f82b[_0x74a4('0x11')]){if(_0x19f82b[_0x74a4('0x11')][_0x74a4('0x12')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x41ef5a,_0x19f82b[_0x74a4('0x11')][_0x74a4('0x13')]);return _0x58e307(_0x19f82b[_0x74a4('0x11')][_0x74a4('0x13')]);}logger[_0x74a4('0x11')](_0x74a4('0x14'),_0x41ef5a,_0x19f82b[_0x74a4('0x11')][_0x74a4('0x13')]);return _0x3122ba(_0x19f82b[_0x74a4('0x11')][_0x74a4('0x13')]);}else{logger[_0x74a4('0xd')](_0x74a4('0x14'),_0x41ef5a,_0x74a4('0xe'));_0x3122ba(_0x19f82b[_0x74a4('0x15')][_0x74a4('0x13')]);}})[_0x74a4('0x16')](function(_0x5d6dad){logger[_0x74a4('0x11')](_0x74a4('0x14'),_0x41ef5a,_0x5d6dad);_0x58e307(_0x5d6dad);});});}exports[_0x74a4('0x17')]=function(_0x2c9130){var _0x55cf53=this;return new Promise(function(_0xf224ef,_0x105998){return db[_0x74a4('0x18')][_0x74a4('0x19')](_0x2c9130['body'],{'raw':_0x2c9130[_0x74a4('0x1a')]?_0x2c9130[_0x74a4('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x74a4('0xc')](function(_0x2d3075){logger['info']('CreateCmHopperHistory',_0x2c9130);logger[_0x74a4('0xf')](_0x74a4('0x17'),_0x2c9130,JSON[_0x74a4('0x1b')](_0x2d3075));_0xf224ef(_0x2d3075);})[_0x74a4('0x16')](function(_0x484802){logger[_0x74a4('0x11')]('CreateCmHopperHistory',_0x484802['message'],_0x2c9130);_0x105998(_0x55cf53[_0x74a4('0x11')](0x1f4,_0x484802[_0x74a4('0x13')]));});});};exports[_0x74a4('0x1c')]=function(_0x5c3362){var _0x22f0fa=this;return new Promise(function(_0x387d89,_0x47c200){return db[_0x74a4('0x18')][_0x74a4('0x1d')]({'raw':_0x5c3362['options']?_0x5c3362[_0x74a4('0x1a')][_0x74a4('0x1e')]===undefined?!![]:![]:!![],'where':_0x5c3362[_0x74a4('0x1a')]?_0x5c3362['options'][_0x74a4('0x1f')]||null:null,'attributes':[[db[_0x74a4('0x20')]['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')][_0x74a4('0x22')]('id')),_0x74a4('0x23')],[db['sequelize']['fn']('COUNT',db[_0x74a4('0x20')]['fn']('IF',db['sequelize'][_0x74a4('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x74a4('0x25')],[db['sequelize']['fn']('COUNT',db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x74a4('0x24')]('`state`\x20=\x2011,\x201,\x20null'))),_0x74a4('0x26')],[db[_0x74a4('0x20')]['fn'](_0x74a4('0x27'),db['sequelize']['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')](_0x74a4('0x28')))),_0x74a4('0x29')],[db[_0x74a4('0x20')]['fn'](_0x74a4('0x27'),db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')]['literal'](_0x74a4('0x2a')))),_0x74a4('0x2b')]]})['then'](function(_0x2434ae){logger['info']('AvgHandleTime',_0x5c3362);logger[_0x74a4('0xf')](_0x74a4('0x1c'),_0x5c3362,JSON[_0x74a4('0x1b')](_0x2434ae));_0x387d89(_0x2434ae);})[_0x74a4('0x16')](function(_0x1d4e14){logger[_0x74a4('0x11')](_0x74a4('0x1c'),_0x1d4e14[_0x74a4('0x13')],_0x5c3362);_0x47c200(_0x22f0fa[_0x74a4('0x11')](0x1f4,_0x1d4e14['message']));});});};exports[_0x74a4('0x2c')]=function(_0x3da4f6){var _0x26572e=this;return new Promise(function(_0x5d874c,_0x1834cc){return db['CmHopperHistory'][_0x74a4('0x1d')]({'raw':_0x3da4f6[_0x74a4('0x1a')]?_0x3da4f6['options'][_0x74a4('0x1e')]===undefined?!![]:![]:!![],'where':_0x3da4f6[_0x74a4('0x1a')]?_0x3da4f6[_0x74a4('0x1a')][_0x74a4('0x1f')]||null:null,'attributes':[[_0x74a4('0x2d'),_0x74a4('0x2e')],[db['sequelize']['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db['sequelize'][_0x74a4('0x24')](_0x74a4('0x2f')))),_0x74a4('0x30')],[db[_0x74a4('0x20')]['fn'](_0x74a4('0x21'),db['sequelize']['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')]('`state`\x20=\x203,\x201,\x20null'))),_0x74a4('0x31')],[db[_0x74a4('0x20')]['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db['sequelize']['literal'](_0x74a4('0x32')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')]['literal'](_0x74a4('0x33')))),_0x74a4('0x34')],[db['sequelize']['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0x74a4('0x35')],[db[_0x74a4('0x20')]['fn']('COUNT',db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')](_0x74a4('0x36')))),_0x74a4('0x37')],[db[_0x74a4('0x20')]['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')](_0x74a4('0x38')))),'outboundDropCallsDayCallersExit'],[db[_0x74a4('0x20')]['fn']('COUNT',db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')]('`state`\x20=\x2012,\x201,\x20null'))),_0x74a4('0x39')],[db[_0x74a4('0x20')]['fn']('COUNT',db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')](_0x74a4('0x3a')))),_0x74a4('0x3b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')](_0x74a4('0x3c')))),'outboundOriginateFailureCallsDay'],[db[_0x74a4('0x20')]['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')]['literal'](_0x74a4('0x3d')))),_0x74a4('0x3e')],[db['sequelize']['fn']('COUNT',db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')]['literal'](_0x74a4('0x3f')))),_0x74a4('0x40')],[db['sequelize']['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')](_0x74a4('0x41')))),_0x74a4('0x3e')],[db[_0x74a4('0x20')]['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')](_0x74a4('0x42')))),_0x74a4('0x43')]],'group':[_0x74a4('0x2d')]})['then'](function(_0xf2bbca){logger['info'](_0x74a4('0x2c'),_0x3da4f6);logger[_0x74a4('0xf')](_0x74a4('0x2c'),_0x3da4f6,JSON[_0x74a4('0x1b')](_0xf2bbca));_0x5d874c(_0xf2bbca);})[_0x74a4('0x16')](function(_0xa6330f){logger[_0x74a4('0x11')](_0x74a4('0x2c'),_0xa6330f['message'],_0x3da4f6);_0x1834cc(_0x26572e[_0x74a4('0x11')](0x1f4,_0xa6330f[_0x74a4('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x3d591d){var _0x4c2e5b=this;return new Promise(function(_0x3c3c46,_0x1380d){return db[_0x74a4('0x18')][_0x74a4('0x1d')]({'raw':_0x3d591d[_0x74a4('0x1a')]?_0x3d591d[_0x74a4('0x1a')][_0x74a4('0x1e')]===undefined?!![]:![]:!![],'where':_0x3d591d['options']?_0x3d591d[_0x74a4('0x1a')][_0x74a4('0x1f')]||null:null,'attributes':[[_0x74a4('0x2d'),_0x74a4('0x2e')],[db[_0x74a4('0x20')]['fn']('COUNT',db['sequelize']['col']('id')),'ivrTotalCallsDays'],[db[_0x74a4('0x20')]['fn'](_0x74a4('0x21'),db[_0x74a4('0x20')]['fn']('IF',db[_0x74a4('0x20')][_0x74a4('0x24')](_0x74a4('0x32')))),_0x74a4('0x44')]],'group':[_0x74a4('0x2d')]})[_0x74a4('0xc')](function(_0x336d44){logger[_0x74a4('0xd')](_0x74a4('0x45'),_0x3d591d);logger[_0x74a4('0xf')](_0x74a4('0x45'),_0x3d591d,JSON['stringify'](_0x336d44));_0x3c3c46(_0x336d44);})[_0x74a4('0x16')](function(_0x4708a5){logger['error']('GetCampaignHopperHistory',_0x4708a5[_0x74a4('0x13')],_0x3d591d);_0x1380d(_0x4c2e5b['error'](0x1f4,_0x4708a5[_0x74a4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index c3a7dd3..e968e20 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 _0x5eb0=['util','connect-timeout','Router','../../components/interaction/service','./cmHopperHistory.controller','index','get','describe','show','post','create','put','/:id','isAuthenticated','update','exports'];(function(_0x5acf0b,_0x34142d){var _0x9e2ff6=function(_0x4c9ad6){while(--_0x4c9ad6){_0x5acf0b['push'](_0x5acf0b['shift']());}};_0x9e2ff6(++_0x34142d);}(_0x5eb0,0x180));var _0x05eb=function(_0x28a92c,_0x39d6de){_0x28a92c=_0x28a92c-0x0;var _0x4238c1=_0x5eb0[_0x28a92c];return _0x4238c1;};'use strict';var multer=require('multer');var util=require(_0x05eb('0x0'));var path=require('path');var timeout=require(_0x05eb('0x1'));var express=require('express');var router=express[_0x05eb('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x05eb('0x3'));var config=require('../../config/environment');var controller=require(_0x05eb('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x05eb('0x5')]);router[_0x05eb('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x05eb('0x7')]);router[_0x05eb('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x05eb('0x8')]);router[_0x05eb('0x9')]('/',auth['isAuthenticated'](),controller[_0x05eb('0xa')]);router[_0x05eb('0xb')](_0x05eb('0xc'),auth[_0x05eb('0xd')](),controller[_0x05eb('0xe')]);module[_0x05eb('0xf')]=router; \ No newline at end of file +var _0x0fd9=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','exports','multer'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0x0fd9,0xdb));var _0x90fd=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0x0fd9[_0x2390bd];return _0x3a969d;};'use strict';var multer=require(_0x90fd('0x0'));var util=require('util');var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express[_0x90fd('0x4')]();var fs_extra=require(_0x90fd('0x5'));var auth=require(_0x90fd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x90fd('0x7'));var controller=require(_0x90fd('0x8'));router[_0x90fd('0x9')]('/',auth[_0x90fd('0xa')](),controller[_0x90fd('0xb')]);router[_0x90fd('0x9')](_0x90fd('0xc'),auth['isAuthenticated'](),controller[_0x90fd('0xd')]);router['get'](_0x90fd('0xe'),auth['isAuthenticated'](),controller[_0x90fd('0xf')]);router[_0x90fd('0x10')]('/',auth[_0x90fd('0xa')](),controller['create']);router[_0x90fd('0x11')]('/:id',auth[_0x90fd('0xa')](),controller[_0x90fd('0x12')]);module[_0x90fd('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 0e51e93..74fccab 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 _0xeddd=['name','sequelize','exports','STRING'];(function(_0x4eb2ce,_0x1177df){var _0x41b752=function(_0x9ae04b){while(--_0x9ae04b){_0x4eb2ce['push'](_0x4eb2ce['shift']());}};_0x41b752(++_0x1177df);}(_0xeddd,0x69));var _0xdedd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xeddd[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xdedd('0x0'));module[_0xdedd('0x1')]={'name':{'type':Sequelize[_0xdedd('0x2')],'unique':_0xdedd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xdedd('0x2')]}}; \ No newline at end of file +var _0x4b19=['sequelize','STRING','name'];(function(_0x37306a,_0x435902){var _0x552039=function(_0x1ea1a5){while(--_0x1ea1a5){_0x37306a['push'](_0x37306a['shift']());}};_0x552039(++_0x435902);}(_0x4b19,0x195));var _0x94b1=function(_0x41868e,_0x30f9a6){_0x41868e=_0x41868e-0x0;var _0x27b68e=_0x4b19[_0x41868e];return _0x27b68e;};'use strict';var Sequelize=require(_0x94b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x94b1('0x1')],'unique':_0x94b1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x94b1('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 3170a39..e149b9a 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 _0x00c9=['model','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Lists','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','nolimit','pick','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','alias','select','from','cm_contacts','c.ListId\x20=\x20?','field','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','each','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','queryInterface','addColumn','cf_%s','getGlobalCustomFields','findAndCountAll','addAgents','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','spread','eml-format','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/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','keys','query','filters'];(function(_0x224891,_0x51d439){var _0x518a31=function(_0x3e9dbf){while(--_0x3e9dbf){_0x224891['push'](_0x224891['shift']());}};_0x518a31(++_0x51d439);}(_0x00c9,0x1ac));var _0x900c=function(_0x1bd8fd,_0x526cee){_0x1bd8fd=_0x1bd8fd-0x0;var _0x36f371=_0x00c9[_0x1bd8fd];return _0x36f371;};'use strict';var emlformat=require(_0x900c('0x0'));var rimraf=require(_0x900c('0x1'));var zipdir=require(_0x900c('0x2'));var jsonpatch=require(_0x900c('0x3'));var rp=require(_0x900c('0x4'));var moment=require(_0x900c('0x5'));var BPromise=require(_0x900c('0x6'));var Mustache=require(_0x900c('0x7'));var util=require(_0x900c('0x8'));var path=require(_0x900c('0x9'));var sox=require(_0x900c('0xa'));var csv=require('to-csv');var ejs=require(_0x900c('0xb'));var fs=require('fs');var fs_extra=require(_0x900c('0xc'));var _=require(_0x900c('0xd'));var squel=require(_0x900c('0xe'));var crypto=require(_0x900c('0xf'));var jsforce=require(_0x900c('0x10'));var deskjs=require(_0x900c('0x11'));var toCsv=require('to-csv');var querystring=require(_0x900c('0x12'));var Papa=require(_0x900c('0x13'));var Redis=require('ioredis');var authService=require(_0x900c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x900c('0x15'));var hardwareService=require(_0x900c('0x16'));var logger=require(_0x900c('0x17'))(_0x900c('0x18'));var utils=require('../../config/utils');var config=require(_0x900c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x900c('0x1a'))['db'];var csv_results;config[_0x900c('0x1b')]=_[_0x900c('0x1c')](config['redis'],{'host':_0x900c('0x1d'),'port':0x18eb});var socket=require(_0x900c('0x1e'))(new Redis(config[_0x900c('0x1b')]));require('./cmList.socket')[_0x900c('0x1f')](socket);function respondWithStatusCode(_0x1404a8,_0x5cb4d8){_0x5cb4d8=_0x5cb4d8||0xcc;return function(_0x38fa07){if(_0x38fa07){return _0x1404a8[_0x900c('0x20')](_0x5cb4d8);}return _0x1404a8[_0x900c('0x21')](_0x5cb4d8)['end']();};}function respondWithResult(_0xe16b7b,_0x38f4c0){_0x38f4c0=_0x38f4c0||0xc8;return function(_0x5dd275){if(_0x5dd275){return _0xe16b7b[_0x900c('0x21')](_0x38f4c0)[_0x900c('0x22')](_0x5dd275);}};}function respondWithFilteredResult(_0x3c72b1,_0x30a595){return function(_0x2eebd3){if(_0x2eebd3){var _0x3f95d3=typeof _0x30a595[_0x900c('0x23')]===_0x900c('0x24')&&typeof _0x30a595[_0x900c('0x25')]===_0x900c('0x24');var _0x387710=_0x2eebd3[_0x900c('0x26')];var _0x550151=_0x3f95d3?0x0:_0x30a595['offset'];var _0x9041e5=_0x3f95d3?_0x2eebd3[_0x900c('0x26')]:_0x30a595[_0x900c('0x23')]+_0x30a595['limit'];var _0xfd5029;if(_0x9041e5>=_0x387710){_0x9041e5=_0x387710;_0xfd5029=0xc8;}else{_0xfd5029=0xce;}_0x3c72b1['status'](_0xfd5029);return _0x3c72b1['set'](_0x900c('0x27'),_0x550151+'-'+_0x9041e5+'/'+_0x387710)['json'](_0x2eebd3);}return null;};}function patchUpdates(_0x3e085c){return function(_0x1c5f32){try{jsonpatch[_0x900c('0x28')](_0x1c5f32,_0x3e085c,!![]);}catch(_0x506ac4){return BPromise['reject'](_0x506ac4);}return _0x1c5f32[_0x900c('0x29')]();};}function saveUpdates(_0x536425,_0x1b3b59){return function(_0x4732e8){if(_0x4732e8){return _0x4732e8[_0x900c('0x2a')](_0x536425)[_0x900c('0x2b')](function(_0x5b9426){return _0x5b9426;});}return null;};}function removeEntity(_0x4c9b4e,_0x49fb85){return function(_0x51d92a){if(_0x51d92a){return _0x51d92a['destroy']()['then'](function(){var _0x2dca51=_0x51d92a[_0x900c('0x2c')]({'plain':!![]});var _0x3d377c='Lists';return db[_0x900c('0x2d')][_0x900c('0x2e')]({'where':{'type':_0x3d377c,'resourceId':_0x2dca51['id']}})[_0x900c('0x2b')](function(){return _0x51d92a;});})[_0x900c('0x2b')](function(){_0x4c9b4e[_0x900c('0x21')](0xcc)[_0x900c('0x2f')]();});}};}function handleEntityNotFound(_0x1145dc,_0x21542e){return function(_0x763c84){if(!_0x763c84){_0x1145dc[_0x900c('0x20')](0x194);}return _0x763c84;};}function handleError(_0x31666c,_0x2b2322){_0x2b2322=_0x2b2322||0x1f4;return function(_0x59bfc9){logger[_0x900c('0x30')](_0x59bfc9['stack']);if(_0x59bfc9[_0x900c('0x31')]){delete _0x59bfc9[_0x900c('0x31')];}_0x31666c['status'](_0x2b2322)[_0x900c('0x32')](_0x59bfc9);};}exports[_0x900c('0x33')]=function(_0x4e2fe5,_0x4ab230){var _0x448f93={},_0x594163={},_0x560866={'count':0x0,'rows':[]};var _0xfbd683=_[_0x900c('0x34')](db[_0x900c('0x35')][_0x900c('0x36')],function(_0x584af4){return{'name':_0x584af4[_0x900c('0x37')],'type':_0x584af4[_0x900c('0x38')][_0x900c('0x39')]};});_0x594163['model']=_[_0x900c('0x34')](_0xfbd683,'name');_0x594163['query']=_[_0x900c('0x3a')](_0x4e2fe5[_0x900c('0x3b')]);_0x594163[_0x900c('0x3c')]=_['intersection'](_0x594163[_0x900c('0x3d')],_0x594163['query']);_0x448f93[_0x900c('0x3e')]=_[_0x900c('0x3f')](_0x594163[_0x900c('0x3d')],qs['fields'](_0x4e2fe5[_0x900c('0x3b')][_0x900c('0x40')]));_0x448f93['attributes']=_0x448f93[_0x900c('0x3e')]['length']?_0x448f93[_0x900c('0x3e')]:_0x594163[_0x900c('0x3d')];if(!_0x4e2fe5['query'][_0x900c('0x41')]('nolimit')){_0x448f93['limit']=qs[_0x900c('0x25')](_0x4e2fe5[_0x900c('0x3b')][_0x900c('0x25')]);_0x448f93[_0x900c('0x23')]=qs[_0x900c('0x23')](_0x4e2fe5['query'][_0x900c('0x23')]);}_0x448f93[_0x900c('0x42')]=qs[_0x900c('0x43')](_0x4e2fe5[_0x900c('0x3b')][_0x900c('0x43')]);_0x448f93[_0x900c('0x44')]=qs[_0x900c('0x3c')](_['pick'](_0x4e2fe5[_0x900c('0x3b')],_0x594163[_0x900c('0x3c')]),_0xfbd683);if(_0x4e2fe5[_0x900c('0x3b')][_0x900c('0x45')]){_0x448f93[_0x900c('0x44')]=_[_0x900c('0x46')](_0x448f93[_0x900c('0x44')],{'$or':_[_0x900c('0x34')](_0xfbd683,function(_0x3844e4){if(_0x3844e4[_0x900c('0x38')]!==_0x900c('0x47')){var _0x57ec5c={};_0x57ec5c[_0x3844e4[_0x900c('0x31')]]={'$like':'%'+_0x4e2fe5[_0x900c('0x3b')][_0x900c('0x45')]+'%'};return _0x57ec5c;}})});}_0x448f93=_['merge']({},_0x448f93,_0x4e2fe5[_0x900c('0x48')]);var _0x24ff9d={'where':_0x448f93[_0x900c('0x44')]};return db['CmList']['count'](_0x24ff9d)['then'](function(_0x30b8d4){_0x560866[_0x900c('0x26')]=_0x30b8d4;if(_0x4e2fe5[_0x900c('0x3b')][_0x900c('0x49')]){_0x448f93['include']=[{'all':!![]}];}return db[_0x900c('0x35')][_0x900c('0x4a')](_0x448f93);})[_0x900c('0x2b')](function(_0x39a191){_0x560866[_0x900c('0x4b')]=_0x39a191;return _0x560866;})['then'](respondWithFilteredResult(_0x4ab230,_0x448f93))[_0x900c('0x4c')](handleError(_0x4ab230,null));};exports['show']=function(_0x963364,_0x9c331b){var _0x54e4fc={'raw':![],'where':{'id':_0x963364[_0x900c('0x4d')]['id']}},_0x265a04={};_0x265a04[_0x900c('0x3d')]=_['keys'](db[_0x900c('0x35')][_0x900c('0x36')]);_0x265a04['query']=_['keys'](_0x963364[_0x900c('0x3b')]);_0x265a04[_0x900c('0x3c')]=_['intersection'](_0x265a04[_0x900c('0x3d')],_0x265a04[_0x900c('0x3b')]);_0x54e4fc[_0x900c('0x3e')]=_['intersection'](_0x265a04['model'],qs[_0x900c('0x40')](_0x963364[_0x900c('0x3b')][_0x900c('0x40')]));_0x54e4fc[_0x900c('0x3e')]=_0x54e4fc['attributes'][_0x900c('0x4e')]?_0x54e4fc['attributes']:_0x265a04[_0x900c('0x3d')];if(_0x963364[_0x900c('0x3b')]['includeAll']){_0x54e4fc[_0x900c('0x4f')]=[{'all':!![]}];}_0x54e4fc=_[_0x900c('0x46')]({},_0x54e4fc,_0x963364['options']);return db[_0x900c('0x35')][_0x900c('0x50')](_0x54e4fc)['then'](handleEntityNotFound(_0x9c331b,null))[_0x900c('0x2b')](respondWithResult(_0x9c331b,null))[_0x900c('0x4c')](handleError(_0x9c331b,null));};exports[_0x900c('0x51')]=function(_0x12b0d6,_0x49fba9){return db['CmList']['create'](_0x12b0d6[_0x900c('0x52')],{})[_0x900c('0x2b')](function(_0x433cc9){var _0x576563=_0x12b0d6['user'][_0x900c('0x2c')]({'plain':!![]});if(!_0x576563)throw new Error(_0x900c('0x53'));if(_0x576563['role']===_0x900c('0x54')){var _0x317de0=_0x433cc9['get']({'plain':!![]});var _0x4a594b=_0x900c('0x55');return db[_0x900c('0x56')][_0x900c('0x50')]({'where':{'name':_0x4a594b,'userProfileId':_0x576563[_0x900c('0x57')]},'raw':!![]})[_0x900c('0x2b')](function(_0x596db9){if(_0x596db9&&_0x596db9[_0x900c('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x317de0[_0x900c('0x31')],'resourceId':_0x317de0['id'],'type':_0x596db9['name'],'sectionId':_0x596db9['id']},{})[_0x900c('0x2b')](function(){return _0x433cc9;});}else{return _0x433cc9;}})[_0x900c('0x4c')](function(_0x5ea2b9){logger[_0x900c('0x30')](_0x900c('0x59'),_0x5ea2b9);throw _0x5ea2b9;});}return _0x433cc9;})['then'](respondWithResult(_0x49fba9,0xc9))[_0x900c('0x4c')](handleError(_0x49fba9,null));};exports['update']=function(_0x53f87b,_0x397a5e){if(_0x53f87b['body']['id']){delete _0x53f87b[_0x900c('0x52')]['id'];}return db[_0x900c('0x35')]['find']({'where':{'id':_0x53f87b[_0x900c('0x4d')]['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x397a5e,null))[_0x900c('0x2b')](saveUpdates(_0x53f87b[_0x900c('0x52')],null))[_0x900c('0x2b')](respondWithResult(_0x397a5e,null))[_0x900c('0x4c')](handleError(_0x397a5e,null));};exports[_0x900c('0x2e')]=function(_0x37ab2e,_0x458dbe){return db['CmList'][_0x900c('0x50')]({'where':{'id':_0x37ab2e['params']['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x458dbe,null))[_0x900c('0x2b')](removeEntity(_0x458dbe,null))['catch'](handleError(_0x458dbe,null));};exports[_0x900c('0x5a')]=function(_0x3f4919,_0x3a11df){return db[_0x900c('0x35')][_0x900c('0x5a')]()[_0x900c('0x2b')](respondWithResult(_0x3a11df,null))[_0x900c('0x4c')](handleError(_0x3a11df,null));};exports[_0x900c('0x5b')]=function(_0x5e449c,_0x2973cd,_0xc46b5b){if(_0x5e449c[_0x900c('0x52')]['id']){delete _0x5e449c['body']['id'];}return db['CmList']['find']({'where':{'id':_0x5e449c[_0x900c('0x4d')]['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x2973cd,null))[_0x900c('0x2b')](function(_0x5a4d0c){if(_0x5a4d0c){_0x5e449c[_0x900c('0x52')][_0x900c('0x5c')]=_0x5a4d0c['id'];return db['Disposition'][_0x900c('0x51')](_0x5e449c[_0x900c('0x52')]);}})[_0x900c('0x2b')](respondWithResult(_0x2973cd,null))['catch'](handleError(_0x2973cd,null));};exports[_0x900c('0x5d')]=function(_0x2a4b07,_0x328526,_0x4f025d){var _0x4f9027={'raw':![],'where':{}};var _0x5d9c9a={};var _0x4dc18d={'count':0x0,'rows':[]};return db[_0x900c('0x35')][_0x900c('0x5e')]({'where':{'id':_0x2a4b07['params']['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x328526,null))[_0x900c('0x2b')](function(_0x2c29c6){if(_0x2c29c6){_0x5d9c9a[_0x900c('0x3d')]=_[_0x900c('0x3a')](db[_0x900c('0x5f')]['rawAttributes']);_0x5d9c9a[_0x900c('0x3b')]=_[_0x900c('0x3a')](_0x2a4b07[_0x900c('0x3b')]);_0x5d9c9a[_0x900c('0x3c')]=_[_0x900c('0x3f')](_0x5d9c9a[_0x900c('0x3d')],_0x5d9c9a['query']);_0x4f9027[_0x900c('0x3e')]=_['intersection'](_0x5d9c9a[_0x900c('0x3d')],qs[_0x900c('0x40')](_0x2a4b07[_0x900c('0x3b')][_0x900c('0x40')]));_0x4f9027[_0x900c('0x3e')]=_0x4f9027[_0x900c('0x3e')][_0x900c('0x4e')]?_0x4f9027['attributes']:_0x5d9c9a[_0x900c('0x3d')];if(!_0x2a4b07[_0x900c('0x3b')][_0x900c('0x41')](_0x900c('0x60'))){_0x4f9027[_0x900c('0x25')]=qs[_0x900c('0x25')](_0x2a4b07[_0x900c('0x3b')]['limit']);_0x4f9027[_0x900c('0x23')]=qs[_0x900c('0x23')](_0x2a4b07['query'][_0x900c('0x23')]);}_0x4f9027[_0x900c('0x42')]=qs['sort'](_0x2a4b07['query'][_0x900c('0x43')]);_0x4f9027[_0x900c('0x44')]=qs[_0x900c('0x3c')](_[_0x900c('0x61')](_0x2a4b07[_0x900c('0x3b')],_0x5d9c9a[_0x900c('0x3c')]));_0x4f9027[_0x900c('0x44')][_0x900c('0x5c')]=_0x2c29c6['id'];if(_0x2a4b07['query'][_0x900c('0x45')]){_0x4f9027[_0x900c('0x44')]=_[_0x900c('0x46')](_0x4f9027[_0x900c('0x44')],{'$or':_[_0x900c('0x34')](_0x4f9027[_0x900c('0x3e')],function(_0x38d38e){var _0xf1724e={};_0xf1724e[_0x38d38e]={'$like':'%'+_0x2a4b07[_0x900c('0x3b')][_0x900c('0x45')]+'%'};return _0xf1724e;})});}_0x4f9027=_[_0x900c('0x46')]({},_0x4f9027,_0x2a4b07['options']);return db[_0x900c('0x5f')][_0x900c('0x26')]({'where':_0x4f9027['where']})[_0x900c('0x2b')](function(_0x40a385){_0x4dc18d['count']=_0x40a385;if(_0x2a4b07[_0x900c('0x3b')][_0x900c('0x49')]){_0x4f9027[_0x900c('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0x900c('0x4a')](_0x4f9027);})[_0x900c('0x2b')](function(_0x3adb19){_0x4dc18d['rows']=_0x3adb19;return _0x4dc18d;});}})[_0x900c('0x2b')](respondWithFilteredResult(_0x328526,_0x4f9027))['catch'](handleError(_0x328526,null));};exports[_0x900c('0x62')]=function(_0x3225b9,_0x11ea0b,_0x3ce670){return db[_0x900c('0x35')][_0x900c('0x50')]({'where':{'id':_0x3225b9[_0x900c('0x4d')]['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x11ea0b,null))[_0x900c('0x2b')](function(_0x60c3f){if(_0x60c3f){return _0x60c3f[_0x900c('0x62')](_0x3225b9[_0x900c('0x3b')][_0x900c('0x63')]);}})[_0x900c('0x2b')](respondWithStatusCode(_0x11ea0b,null))[_0x900c('0x4c')](handleError(_0x11ea0b,null));};exports[_0x900c('0x64')]=function(_0x37e7c3,_0x1d1a02,_0x42dfcd){return db[_0x900c('0x35')][_0x900c('0x50')]({'where':{'id':_0x37e7c3[_0x900c('0x4d')]['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x1d1a02,null))['then'](function(_0x2b9e64){if(_0x2b9e64){var _0x266e0b=[];var _0x545bdb={'success':[],'errors':[]};return db[_0x900c('0x65')][_0x900c('0x5a')]()['then'](function(_0x54d9a9){if(_0x37e7c3[_0x900c('0x52')][_0x900c('0x66')]&&_[_0x900c('0x67')](_0x37e7c3[_0x900c('0x52')][_0x900c('0x66')])){if(_0x37e7c3[_0x900c('0x52')][_0x900c('0x66')][_0x900c('0x4e')]){_0x37e7c3['body']['tags']=_0x37e7c3['body'][_0x900c('0x66')][_0x900c('0x68')](';')+';';}else{_0x37e7c3[_0x900c('0x52')][_0x900c('0x66')]=null;}}else{_0x37e7c3[_0x900c('0x52')][_0x900c('0x66')]=null;}if(_0x37e7c3[_0x900c('0x52')]&&_[_0x900c('0x67')](_0x37e7c3[_0x900c('0x52')])){for(var _0x3caa66=0x0;_0x3caa66<_0x37e7c3['body']['length'];_0x3caa66+=0x1){_0x37e7c3[_0x900c('0x52')][_0x3caa66][_0x900c('0x5c')]=_0x37e7c3[_0x900c('0x4d')]['id'];_0x266e0b[_0x900c('0x69')](_0x37e7c3[_0x900c('0x52')][_0x3caa66]);}return BPromise['each'](_0x266e0b,function(_0x124211){return db['CmContact'][_0x900c('0x51')](_['omit'](_0x124211,[_0x900c('0x63'),'id'])||{},{'fields':_['keys'](_0x54d9a9),'raw':!![]})[_0x900c('0x2b')](function(_0x2688c4){_0x545bdb[_0x900c('0x6a')][_0x900c('0x69')](_0x2688c4['dataValues']);})['catch'](function(_0x5adc2f){_0x545bdb[_0x900c('0x6b')]['push']({'data':_0x124211,'error':_0x5adc2f[_0x900c('0x6c')]});});})[_0x900c('0x2b')](function(_0x125990){return _0x545bdb;})['catch'](function(_0x196899){return _0x196899;});}else{_0x1d1a02[_0x900c('0x21')](0x190)[_0x900c('0x22')]({'message':_0x900c('0x6d')});}});}})[_0x900c('0x2b')](respondWithResult(_0x1d1a02,null))[_0x900c('0x4c')](handleError(_0x1d1a02,null));};exports[_0x900c('0x6e')]=function(_0x5bf247,_0x4608f9,_0x479f70){var _0x35081d;return db[_0x900c('0x35')][_0x900c('0x50')]({'where':{'id':_0x5bf247['params']['id']},'include':[{'model':db[_0x900c('0x6f')],'as':_0x900c('0x70')}]})['then'](handleEntityNotFound(_0x4608f9,null))[_0x900c('0x2b')](function(_0x5074d9){if(_0x5074d9){_0x35081d=_0x5074d9;return db[_0x900c('0x65')][_0x900c('0x36')];}})[_0x900c('0x2b')](function(_0x373ec1){if(_0x373ec1){var _0x5f0006={};var _0x18a645={};_0x18a645[_0x900c('0x3d')]=_[_0x900c('0x71')](_[_0x900c('0x3a')](_0x373ec1),_[_0x900c('0x34')](_0x35081d[_0x900c('0x70')],function(_0x48d803){return util[_0x900c('0x72')](_0x900c('0x73'),_0x48d803['id']);}));_0x18a645['query']=_[_0x900c('0x3a')](_0x5bf247[_0x900c('0x3b')]);_0x18a645[_0x900c('0x3c')]=_[_0x900c('0x3f')](_0x18a645[_0x900c('0x3d')],_0x18a645[_0x900c('0x3b')]);_0x5f0006[_0x900c('0x3e')]=_[_0x900c('0x3f')](_0x18a645[_0x900c('0x3d')],qs['fields'](_0x5bf247[_0x900c('0x3b')][_0x900c('0x40')]));_0x5f0006[_0x900c('0x3e')]=_0x5f0006['attributes'][_0x900c('0x4e')]?_0x5f0006[_0x900c('0x3e')]:_0x18a645[_0x900c('0x3d')];if(!_0x5bf247[_0x900c('0x3b')]['hasOwnProperty'](_0x900c('0x60'))){_0x5f0006['limit']=qs['limit'](_0x5bf247[_0x900c('0x3b')]['limit']);_0x5f0006['offset']=qs[_0x900c('0x23')](_0x5bf247[_0x900c('0x3b')][_0x900c('0x23')]);}_0x5f0006[_0x900c('0x42')]=qs['sort'](_0x5bf247[_0x900c('0x3b')][_0x900c('0x43')]);_0x5f0006[_0x900c('0x44')]=qs[_0x900c('0x3c')](_['pick'](_0x5bf247[_0x900c('0x3b')],_0x18a645[_0x900c('0x3c')]));_0x5f0006[_0x900c('0x74')]=!![];if(_0x5bf247[_0x900c('0x3b')][_0x900c('0x45')]){_0x5f0006['where']=_[_0x900c('0x46')](_0x5f0006[_0x900c('0x44')],{'$or':_[_0x900c('0x34')](_0x5f0006[_0x900c('0x3e')],function(_0x439a33){var _0x19ad90={};_0x19ad90[_0x439a33]={'$like':'%'+_0x5bf247['query'][_0x900c('0x45')]+'%'};return _0x19ad90;})});}_0x5f0006=_[_0x900c('0x46')]({},_0x5f0006,_0x5bf247[_0x900c('0x48')]);return _0x35081d['getContacts'](_0x5f0006);}})['then'](respondWithResult(_0x4608f9,null))['catch'](handleError(_0x4608f9,null));};exports[_0x900c('0x75')]=function(_0x599f8d,_0xfe475b,_0x36878f){var _0x1883b4;var _0x35e873;var _0xa51875;var _0x181573=_0x599f8d[_0x900c('0x4d')]['id'];csv_results=[];return db['ContactItemType'][_0x900c('0x4a')]({'attributes':['id',_0x900c('0x31')],'raw':!![],'order':['OrderBy']})[_0x900c('0x2b')](function(_0x33dd77){_0x1883b4=_0x33dd77;var _0x34fa64=_[_0x900c('0x3a')](db[_0x900c('0x65')][_0x900c('0x36')]);return db[_0x900c('0x6f')]['findAll']({'raw':!![],'attributes':['id',_0x900c('0x76')]})['then'](function(_0x28e18a){_0x35e873=_0x28e18a;var _0x4ed7e6=squel[_0x900c('0x77')]()['fields'](_0x34fa64)[_0x900c('0x78')](_0x900c('0x79'),'c')[_0x900c('0x44')](_0x900c('0x7a'),_0x181573)[_0x900c('0x44')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x44356e=0x0;_0x44356e<_0x35e873[_0x900c('0x4e')];_0x44356e++){_0x4ed7e6[_0x900c('0x7b')]('c.cf_'+_0x35e873[_0x44356e]['id'],_0x900c('0x7c')+_0x35e873[_0x44356e][_0x900c('0x76')]);}for(var _0x44356e=0x0;_0x44356e<_0x1883b4['length'];_0x44356e++){_0x4ed7e6[_0x900c('0x7b')](squel[_0x900c('0x77')]()['field'](_0x900c('0x7d'))['from'](_0x900c('0x7e'))[_0x900c('0x44')](_0x900c('0x7f'),_0x1883b4[_0x44356e]['id'])[_0x900c('0x44')](_0x900c('0x80')),'additionalPhone_'+_0x1883b4[_0x44356e][_0x900c('0x31')]);_0x4ed7e6[_0x900c('0x7b')](squel[_0x900c('0x77')]()['field']('description')['from']('cm_contact_has_items')['where'](_0x900c('0x7f'),_0x1883b4[_0x44356e]['id'])[_0x900c('0x44')]('CmContactId\x20=\x20c.id'),_0x900c('0x81')+_0x1883b4[_0x44356e][_0x900c('0x31')]);}var _0x214e38=[];_0x214e38[_0x900c('0x69')](_0x4ed7e6[_0x900c('0x82')]());BPromise[_0x900c('0x83')](_0x214e38,handleQuery)[_0x900c('0x2b')](function(_0x47cac7){handleQuery(_0x4ed7e6[_0x900c('0x82')]());var _0x38f3cd=csv_results[0x0];if(!_[_0x900c('0x84')](_0x38f3cd)){var _0x239821=toCsv(_0x38f3cd);var _0xf0ed4=Date[_0x900c('0x85')]();fs[_0x900c('0x86')](util[_0x900c('0x72')]('/tmp/list_%d_%s.csv',_0x181573,_0xf0ed4),_0x239821);_0xfe475b[_0x900c('0x87')](_0x900c('0x88'),_0x900c('0x89')+util[_0x900c('0x72')](_0x900c('0x8a'),_0x181573,_0xf0ed4));_0xfe475b[_0x900c('0x87')]('Content-type',_0x900c('0x8b'));return _0xfe475b['download'](util[_0x900c('0x72')](_0x900c('0x8c'),_0x181573,_0xf0ed4));}else{return _0xfe475b[_0x900c('0x20')](0xcc);}});});});};exports['addCustomField']=function(_0x2050ff,_0x266796,_0xe6953){var _0x3fcf9f;delete _0x2050ff['body']['id'];return db['CmList'][_0x900c('0x5e')]({'where':{'id':_0x2050ff[_0x900c('0x4d')]['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x266796,null))['then'](function(_0x167d4b){if(_0x167d4b){return db[_0x900c('0x8d')][_0x900c('0x8e')](function(_0x4f0cc1){return db['CmCustomField'][_0x900c('0x51')](_0x2050ff[_0x900c('0x52')],{'transaction':_0x4f0cc1})[_0x900c('0x2b')](function(_0x340699){_0x3fcf9f=_0x340699;return _0x167d4b[_0x900c('0x8f')](_0x340699,{'transaction':_0x4f0cc1});})[_0x900c('0x2b')](function(){var _0x42710f={'type':db[_0x900c('0x90')][_0x900c('0x91')],'transaction':_0x4f0cc1};switch(_0x2050ff[_0x900c('0x52')][_0x900c('0x38')]){case _0x900c('0x92'):_0x42710f[_0x900c('0x38')]=db[_0x900c('0x90')][_0x900c('0x91')];break;case _0x900c('0x93'):_0x42710f[_0x900c('0x38')]=db[_0x900c('0x90')][_0x900c('0x94')];break;case _0x900c('0x95'):_0x42710f[_0x900c('0x38')]=db[_0x900c('0x90')]['BOOLEAN'];_0x42710f['defaultValue']=![];break;default:}return db['sequelize'][_0x900c('0x96')][_0x900c('0x97')](_0x900c('0x79'),util[_0x900c('0x72')](_0x900c('0x98'),_0x3fcf9f['id']),_0x42710f);})['then'](function(){return _0x3fcf9f;});});}})[_0x900c('0x2b')](respondWithResult(_0x266796,null))[_0x900c('0x4c')](handleError(_0x266796,null));};exports['getCustomFields']=function(_0xb92c82,_0x3bb037,_0x49dadd){var _0x1adfdb={};var _0x5509c2={};var _0x9e6f28;var _0x2541d9;return db[_0x900c('0x35')][_0x900c('0x5e')]({'where':{'id':_0xb92c82[_0x900c('0x4d')]['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x3bb037,null))['then'](function(_0x144eb5){if(_0x144eb5){_0x9e6f28=_0x144eb5;_0x5509c2[_0x900c('0x3d')]=_['keys'](db[_0x900c('0x6f')][_0x900c('0x36')]);_0x5509c2[_0x900c('0x3b')]=_[_0x900c('0x3a')](_0xb92c82[_0x900c('0x3b')]);_0x5509c2[_0x900c('0x3c')]=_[_0x900c('0x3f')](_0x5509c2[_0x900c('0x3d')],_0x5509c2[_0x900c('0x3b')]);_0x1adfdb['attributes']=_['intersection'](_0x5509c2['model'],qs[_0x900c('0x40')](_0xb92c82[_0x900c('0x3b')][_0x900c('0x40')]));_0x1adfdb['attributes']=_0x1adfdb[_0x900c('0x3e')][_0x900c('0x4e')]?_0x1adfdb[_0x900c('0x3e')]:_0x5509c2[_0x900c('0x3d')];_0x1adfdb['order']=qs[_0x900c('0x43')](_0xb92c82[_0x900c('0x3b')][_0x900c('0x43')]);_0x1adfdb[_0x900c('0x44')]=qs['filters'](_[_0x900c('0x61')](_0xb92c82['query'],_0x5509c2[_0x900c('0x3c')]));_0x1adfdb['where']=_[_0x900c('0x46')](_0x1adfdb['where'],{'$or':[{'ListId':_0x144eb5['id']},{'ListId':null}]});if(_0xb92c82[_0x900c('0x3b')][_0x900c('0x45')]){_0x1adfdb[_0x900c('0x44')]=_[_0x900c('0x46')](_0x1adfdb[_0x900c('0x44')],{'$or':_[_0x900c('0x34')](_0x1adfdb[_0x900c('0x3e')],function(_0x427a1b){var _0x2a6f64={};_0x2a6f64[_0x427a1b]={'$like':'%'+_0xb92c82[_0x900c('0x3b')]['filter']+'%'};return _0x2a6f64;})});}_0x1adfdb=_['merge']({},_0x1adfdb,_0xb92c82['options']);return db[_0x900c('0x6f')]['findAndCountAll'](_0x1adfdb);}})[_0x900c('0x2b')](respondWithResult(_0x3bb037,null))[_0x900c('0x4c')](handleError(_0x3bb037,null));};exports[_0x900c('0x99')]=function(_0x45f8fe,_0x34bda5){return db[_0x900c('0x6f')][_0x900c('0x9a')]({'where':{'ListId':null}})[_0x900c('0x2b')](handleEntityNotFound(_0x34bda5,null))[_0x900c('0x2b')](function(_0x359139){return _0x359139;})[_0x900c('0x2b')](respondWithResult(_0x34bda5,null))[_0x900c('0x4c')](handleError(_0x34bda5,null));};exports[_0x900c('0x9b')]=function(_0x177ba6,_0x11839c,_0x2ce30d){return db[_0x900c('0x35')][_0x900c('0x50')]({'where':{'id':_0x177ba6['params']['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x11839c,null))['then'](function(_0x5b88f3){if(_0x5b88f3){return _0x5b88f3['addAgents'](_0x177ba6[_0x900c('0x52')][_0x900c('0x63')],_['omit'](_0x177ba6[_0x900c('0x52')],['ids','id'])||{})['spread'](function(_0x405cd3){for(var _0xa083ac=0x0;_0xa083ac<_0x177ba6[_0x900c('0x52')]['ids'][_0x900c('0x4e')];_0xa083ac+=0x1){socket['emit'](_0x900c('0x9c'),{'UserId':Number(_0x177ba6[_0x900c('0x52')][_0x900c('0x63')][_0xa083ac]),'CmListId':Number(_0x177ba6[_0x900c('0x4d')]['id'])});}return _0x405cd3;});}})[_0x900c('0x2b')](respondWithResult(_0x11839c,null))[_0x900c('0x4c')](handleError(_0x11839c,null));};exports[_0x900c('0x9d')]=function(_0x3ec03c,_0x9f9697,_0x45dc07){return db[_0x900c('0x35')]['find']({'where':{'id':_0x3ec03c[_0x900c('0x4d')]['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x9f9697,null))[_0x900c('0x2b')](function(_0x4be057){if(_0x4be057){return _0x4be057[_0x900c('0x9d')](_0x3ec03c[_0x900c('0x3b')][_0x900c('0x63')])[_0x900c('0x2b')](function(){if(_['isArray'](_0x3ec03c[_0x900c('0x3b')][_0x900c('0x63')])){for(var _0x12131e=0x0;_0x12131e<_0x3ec03c[_0x900c('0x3b')][_0x900c('0x63')]['length'];_0x12131e+=0x1){socket[_0x900c('0x9e')](_0x900c('0x9f'),{'UserId':Number(_0x3ec03c['query'][_0x900c('0x63')][_0x12131e]),'CmListId':Number(_0x3ec03c[_0x900c('0x4d')]['id'])});}}else{socket['emit'](_0x900c('0x9f'),{'UserId':Number(_0x3ec03c[_0x900c('0x3b')][_0x900c('0x63')]),'CmListId':Number(_0x3ec03c[_0x900c('0x4d')]['id'])});}});}})[_0x900c('0x2b')](respondWithStatusCode(_0x9f9697,null))[_0x900c('0x4c')](handleError(_0x9f9697,null));};exports[_0x900c('0xa0')]=function(_0x3741f3,_0x2268e9,_0x357aab){var _0x5aa5c0={};var _0x1293a4={};var _0xf7875;var _0x4f0161;return db[_0x900c('0x35')][_0x900c('0x5e')]({'where':{'id':_0x3741f3['params']['id']}})[_0x900c('0x2b')](handleEntityNotFound(_0x2268e9,null))[_0x900c('0x2b')](function(_0x289e3e){if(_0x289e3e){_0xf7875=_0x289e3e;_0x1293a4[_0x900c('0x3d')]=_[_0x900c('0x3a')](db[_0x900c('0xa1')]['rawAttributes']);_0x1293a4[_0x900c('0x3b')]=_['keys'](_0x3741f3[_0x900c('0x3b')]);_0x1293a4[_0x900c('0x3c')]=_['intersection'](_0x1293a4[_0x900c('0x3d')],_0x1293a4[_0x900c('0x3b')]);_0x5aa5c0[_0x900c('0x3e')]=_[_0x900c('0x3f')](_0x1293a4[_0x900c('0x3d')],qs[_0x900c('0x40')](_0x3741f3[_0x900c('0x3b')][_0x900c('0x40')]));_0x5aa5c0[_0x900c('0x3e')]=_0x5aa5c0['attributes'][_0x900c('0x4e')]?_0x5aa5c0[_0x900c('0x3e')]:_0x1293a4['model'];_0x5aa5c0[_0x900c('0x42')]=qs['sort'](_0x3741f3[_0x900c('0x3b')]['sort']);_0x5aa5c0[_0x900c('0x44')]=qs['filters'](_[_0x900c('0x61')](_0x3741f3[_0x900c('0x3b')],_0x1293a4['filters']));if(_0x3741f3[_0x900c('0x3b')]['filter']){_0x5aa5c0[_0x900c('0x44')]=_[_0x900c('0x46')](_0x5aa5c0['where'],{'$or':_[_0x900c('0x34')](_0x5aa5c0[_0x900c('0x3e')],function(_0x5f791c){var _0x2a7645={};_0x2a7645[_0x5f791c]={'$like':'%'+_0x3741f3['query'][_0x900c('0x45')]+'%'};return _0x2a7645;})});}_0x5aa5c0=_[_0x900c('0x46')]({},_0x5aa5c0,_0x3741f3[_0x900c('0x48')]);return _0xf7875['getAgents'](_0x5aa5c0);}})['then'](function(_0x20f517){if(_0x20f517){_0x4f0161=_0x20f517['length'];if(!_0x3741f3[_0x900c('0x3b')][_0x900c('0x41')](_0x900c('0x60'))){_0x5aa5c0['limit']=qs[_0x900c('0x25')](_0x3741f3['query']['limit']);_0x5aa5c0['offset']=qs[_0x900c('0x23')](_0x3741f3[_0x900c('0x3b')][_0x900c('0x23')]);}return _0xf7875[_0x900c('0xa0')](_0x5aa5c0);}})[_0x900c('0x2b')](function(_0x395dc8){if(_0x395dc8){return _0x395dc8?{'count':_0x4f0161,'rows':_0x395dc8}:null;}})[_0x900c('0x2b')](respondWithResult(_0x2268e9,null))[_0x900c('0x4c')](handleError(_0x2268e9,null));};function handleQuery(_0x228fef){logger['info'](_0x228fef);return db['sequelize'][_0x900c('0x3b')](_0x228fef)[_0x900c('0xa2')](function(_0x4e9132){csv_results[_0x900c('0x69')](_0x4e9132);})[_0x900c('0x4c')](function(_0x10420c){logger[_0x900c('0x30')](_0x10420c[_0x900c('0x6c')]);});} \ No newline at end of file +var _0x2024=['ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','destroy','error','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','options','CmList','include','findAll','rows','catch','show','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','findOne','includeAll','removeDispositions','ids','tags','isArray','join','push','each','dataValues','errors','message','getContacts','CmCustomField','CustomFields','CmContact','concat','format','cf_%d','nolimit','raw','OrderBy','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','c.cf_','customField_','field','select','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','setHeader','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','switch','BOOLEAN','queryInterface','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','omit','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv'];(function(_0x20eca2,_0xde75ef){var _0x41cb7a=function(_0x1edeb7){while(--_0x1edeb7){_0x20eca2['push'](_0x20eca2['shift']());}};_0x41cb7a(++_0xde75ef);}(_0x2024,0x91));var _0x4202=function(_0xbdf1d4,_0x14490f){_0xbdf1d4=_0xbdf1d4-0x0;var _0x35464c=_0x2024[_0xbdf1d4];return _0x35464c;};'use strict';var emlformat=require(_0x4202('0x0'));var rimraf=require(_0x4202('0x1'));var zipdir=require(_0x4202('0x2'));var jsonpatch=require(_0x4202('0x3'));var rp=require(_0x4202('0x4'));var moment=require(_0x4202('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4202('0x6'));var util=require('util');var path=require(_0x4202('0x7'));var sox=require(_0x4202('0x8'));var csv=require(_0x4202('0x9'));var ejs=require(_0x4202('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4202('0xb'));var squel=require(_0x4202('0xc'));var crypto=require(_0x4202('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4202('0xe'));var Papa=require(_0x4202('0xf'));var Redis=require(_0x4202('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4202('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4202('0x12'));var logger=require('../../config/logger')(_0x4202('0x13'));var utils=require('../../config/utils');var config=require(_0x4202('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4202('0x15'))['db'];var csv_results;config[_0x4202('0x16')]=_['defaults'](config[_0x4202('0x16')],{'host':_0x4202('0x17'),'port':0x18eb});var socket=require(_0x4202('0x18'))(new Redis(config[_0x4202('0x16')]));require(_0x4202('0x19'))[_0x4202('0x1a')](socket);function respondWithStatusCode(_0xb7d80a,_0x2bc2bf){_0x2bc2bf=_0x2bc2bf||0xcc;return function(_0xd9375){if(_0xd9375){return _0xb7d80a[_0x4202('0x1b')](_0x2bc2bf);}return _0xb7d80a[_0x4202('0x1c')](_0x2bc2bf)[_0x4202('0x1d')]();};}function respondWithResult(_0x45ac3f,_0x38bdb0){_0x38bdb0=_0x38bdb0||0xc8;return function(_0x884464){if(_0x884464){return _0x45ac3f['status'](_0x38bdb0)[_0x4202('0x1e')](_0x884464);}};}function respondWithFilteredResult(_0x49a0d7,_0x594e9c){return function(_0x18b967){if(_0x18b967){var _0x39bbec=typeof _0x594e9c['offset']==='undefined'&&typeof _0x594e9c['limit']==='undefined';var _0x1c72f9=_0x18b967[_0x4202('0x1f')];var _0x1eb9bc=_0x39bbec?0x0:_0x594e9c[_0x4202('0x20')];var _0x532bc1=_0x39bbec?_0x18b967[_0x4202('0x1f')]:_0x594e9c[_0x4202('0x20')]+_0x594e9c[_0x4202('0x21')];var _0x4401bc;if(_0x532bc1>=_0x1c72f9){_0x532bc1=_0x1c72f9;_0x4401bc=0xc8;}else{_0x4401bc=0xce;}_0x49a0d7['status'](_0x4401bc);return _0x49a0d7[_0x4202('0x22')](_0x4202('0x23'),_0x1eb9bc+'-'+_0x532bc1+'/'+_0x1c72f9)['json'](_0x18b967);}return null;};}function patchUpdates(_0x5e15bf){return function(_0x2612e8){try{jsonpatch[_0x4202('0x24')](_0x2612e8,_0x5e15bf,!![]);}catch(_0x151d59){return BPromise[_0x4202('0x25')](_0x151d59);}return _0x2612e8[_0x4202('0x26')]();};}function saveUpdates(_0x3bf6d3,_0x2d3cb8){return function(_0x116912){if(_0x116912){return _0x116912[_0x4202('0x27')](_0x3bf6d3)[_0x4202('0x28')](function(_0x129f93){return _0x129f93;});}return null;};}function removeEntity(_0x4edbab,_0x2a4851){return function(_0x351a50){if(_0x351a50){return _0x351a50['destroy']()[_0x4202('0x28')](function(){var _0x31d97d=_0x351a50[_0x4202('0x29')]({'plain':!![]});var _0x4962fe='Lists';return db['UserProfileResource'][_0x4202('0x2a')]({'where':{'type':_0x4962fe,'resourceId':_0x31d97d['id']}})[_0x4202('0x28')](function(){return _0x351a50;});})[_0x4202('0x28')](function(){_0x4edbab['status'](0xcc)[_0x4202('0x1d')]();});}};}function handleEntityNotFound(_0x4490a8,_0x162de3){return function(_0x33deaf){if(!_0x33deaf){_0x4490a8['sendStatus'](0x194);}return _0x33deaf;};}function handleError(_0x5aba33,_0x5791ec){_0x5791ec=_0x5791ec||0x1f4;return function(_0x4cdd57){logger[_0x4202('0x2b')](_0x4cdd57['stack']);if(_0x4cdd57[_0x4202('0x2c')]){delete _0x4cdd57[_0x4202('0x2c')];}_0x5aba33['status'](_0x5791ec)[_0x4202('0x2d')](_0x4cdd57);};}exports[_0x4202('0x2e')]=function(_0x1389b1,_0x321065){var _0x475e59={},_0x123e6b={},_0xf137f5={'count':0x0,'rows':[]};var _0x26e8a7=_['map'](db['CmList'][_0x4202('0x2f')],function(_0x18eee1){return{'name':_0x18eee1['fieldName'],'type':_0x18eee1[_0x4202('0x30')][_0x4202('0x31')]};});_0x123e6b[_0x4202('0x32')]=_[_0x4202('0x33')](_0x26e8a7,_0x4202('0x2c'));_0x123e6b[_0x4202('0x34')]=_[_0x4202('0x35')](_0x1389b1[_0x4202('0x34')]);_0x123e6b[_0x4202('0x36')]=_['intersection'](_0x123e6b[_0x4202('0x32')],_0x123e6b[_0x4202('0x34')]);_0x475e59['attributes']=_[_0x4202('0x37')](_0x123e6b['model'],qs[_0x4202('0x38')](_0x1389b1['query'][_0x4202('0x38')]));_0x475e59[_0x4202('0x39')]=_0x475e59[_0x4202('0x39')]['length']?_0x475e59['attributes']:_0x123e6b[_0x4202('0x32')];if(!_0x1389b1[_0x4202('0x34')][_0x4202('0x3a')]('nolimit')){_0x475e59[_0x4202('0x21')]=qs[_0x4202('0x21')](_0x1389b1[_0x4202('0x34')][_0x4202('0x21')]);_0x475e59[_0x4202('0x20')]=qs[_0x4202('0x20')](_0x1389b1['query'][_0x4202('0x20')]);}_0x475e59[_0x4202('0x3b')]=qs[_0x4202('0x3c')](_0x1389b1[_0x4202('0x34')]['sort']);_0x475e59[_0x4202('0x3d')]=qs['filters'](_[_0x4202('0x3e')](_0x1389b1[_0x4202('0x34')],_0x123e6b[_0x4202('0x36')]),_0x26e8a7);if(_0x1389b1['query'][_0x4202('0x3f')]){_0x475e59[_0x4202('0x3d')]=_['merge'](_0x475e59['where'],{'$or':_[_0x4202('0x33')](_0x26e8a7,function(_0x5addfa){if(_0x5addfa[_0x4202('0x30')]!=='VIRTUAL'){var _0x162b79={};_0x162b79[_0x5addfa[_0x4202('0x2c')]]={'$like':'%'+_0x1389b1[_0x4202('0x34')][_0x4202('0x3f')]+'%'};return _0x162b79;}})});}_0x475e59=_['merge']({},_0x475e59,_0x1389b1[_0x4202('0x40')]);var _0x365e5e={'where':_0x475e59[_0x4202('0x3d')]};return db[_0x4202('0x41')][_0x4202('0x1f')](_0x365e5e)[_0x4202('0x28')](function(_0x232bfb){_0xf137f5[_0x4202('0x1f')]=_0x232bfb;if(_0x1389b1['query']['includeAll']){_0x475e59[_0x4202('0x42')]=[{'all':!![]}];}return db['CmList'][_0x4202('0x43')](_0x475e59);})[_0x4202('0x28')](function(_0x5b5533){_0xf137f5[_0x4202('0x44')]=_0x5b5533;return _0xf137f5;})[_0x4202('0x28')](respondWithFilteredResult(_0x321065,_0x475e59))[_0x4202('0x45')](handleError(_0x321065,null));};exports[_0x4202('0x46')]=function(_0x1c255f,_0xea5032){var _0x380ffb={'raw':![],'where':{'id':_0x1c255f['params']['id']}},_0x3bde66={};_0x3bde66['model']=_[_0x4202('0x35')](db[_0x4202('0x41')]['rawAttributes']);_0x3bde66[_0x4202('0x34')]=_[_0x4202('0x35')](_0x1c255f[_0x4202('0x34')]);_0x3bde66[_0x4202('0x36')]=_[_0x4202('0x37')](_0x3bde66['model'],_0x3bde66[_0x4202('0x34')]);_0x380ffb[_0x4202('0x39')]=_['intersection'](_0x3bde66[_0x4202('0x32')],qs[_0x4202('0x38')](_0x1c255f[_0x4202('0x34')][_0x4202('0x38')]));_0x380ffb[_0x4202('0x39')]=_0x380ffb[_0x4202('0x39')][_0x4202('0x47')]?_0x380ffb[_0x4202('0x39')]:_0x3bde66[_0x4202('0x32')];if(_0x1c255f[_0x4202('0x34')]['includeAll']){_0x380ffb[_0x4202('0x42')]=[{'all':!![]}];}_0x380ffb=_[_0x4202('0x48')]({},_0x380ffb,_0x1c255f['options']);return db[_0x4202('0x41')]['find'](_0x380ffb)[_0x4202('0x28')](handleEntityNotFound(_0xea5032,null))['then'](respondWithResult(_0xea5032,null))[_0x4202('0x45')](handleError(_0xea5032,null));};exports[_0x4202('0x49')]=function(_0x49754d,_0xf45aba){return db[_0x4202('0x41')][_0x4202('0x49')](_0x49754d[_0x4202('0x4a')],{})[_0x4202('0x28')](function(_0x16c7dc){var _0x4f1cff=_0x49754d[_0x4202('0x4b')][_0x4202('0x29')]({'plain':!![]});if(!_0x4f1cff)throw new Error(_0x4202('0x4c'));if(_0x4f1cff[_0x4202('0x4d')]===_0x4202('0x4b')){var _0xcb0c1b=_0x16c7dc[_0x4202('0x29')]({'plain':!![]});var _0x416e60=_0x4202('0x4e');return db['UserProfileSection'][_0x4202('0x4f')]({'where':{'name':_0x416e60,'userProfileId':_0x4f1cff[_0x4202('0x50')]},'raw':!![]})[_0x4202('0x28')](function(_0x30977c){if(_0x30977c&&_0x30977c[_0x4202('0x51')]===0x0){return db[_0x4202('0x52')][_0x4202('0x49')]({'name':_0xcb0c1b['name'],'resourceId':_0xcb0c1b['id'],'type':_0x30977c[_0x4202('0x2c')],'sectionId':_0x30977c['id']},{})[_0x4202('0x28')](function(){return _0x16c7dc;});}else{return _0x16c7dc;}})[_0x4202('0x45')](function(_0x4243be){logger[_0x4202('0x2b')](_0x4202('0x53'),_0x4243be);throw _0x4243be;});}return _0x16c7dc;})['then'](respondWithResult(_0xf45aba,0xc9))[_0x4202('0x45')](handleError(_0xf45aba,null));};exports['update']=function(_0x97ca33,_0x564ab1){if(_0x97ca33[_0x4202('0x4a')]['id']){delete _0x97ca33['body']['id'];}return db['CmList']['find']({'where':{'id':_0x97ca33[_0x4202('0x54')]['id']}})['then'](handleEntityNotFound(_0x564ab1,null))[_0x4202('0x28')](saveUpdates(_0x97ca33['body'],null))[_0x4202('0x28')](respondWithResult(_0x564ab1,null))[_0x4202('0x45')](handleError(_0x564ab1,null));};exports[_0x4202('0x2a')]=function(_0x25d03b,_0x5c66ad){return db[_0x4202('0x41')][_0x4202('0x4f')]({'where':{'id':_0x25d03b[_0x4202('0x54')]['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x5c66ad,null))[_0x4202('0x28')](removeEntity(_0x5c66ad,null))[_0x4202('0x45')](handleError(_0x5c66ad,null));};exports[_0x4202('0x55')]=function(_0x4d96d7,_0x10d408){return db['CmList']['describe']()[_0x4202('0x28')](respondWithResult(_0x10d408,null))[_0x4202('0x45')](handleError(_0x10d408,null));};exports[_0x4202('0x56')]=function(_0x51769b,_0x434906,_0x2398a5){if(_0x51769b['body']['id']){delete _0x51769b[_0x4202('0x4a')]['id'];}return db[_0x4202('0x41')][_0x4202('0x4f')]({'where':{'id':_0x51769b['params']['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x434906,null))['then'](function(_0x257c78){if(_0x257c78){_0x51769b[_0x4202('0x4a')][_0x4202('0x57')]=_0x257c78['id'];return db[_0x4202('0x58')][_0x4202('0x49')](_0x51769b[_0x4202('0x4a')]);}})[_0x4202('0x28')](respondWithResult(_0x434906,null))[_0x4202('0x45')](handleError(_0x434906,null));};exports['getDispositions']=function(_0x4f2759,_0x5ee2c4,_0x36299c){var _0x145865={'raw':![],'where':{}};var _0x1f888d={};var _0x476cf5={'count':0x0,'rows':[]};return db['CmList'][_0x4202('0x59')]({'where':{'id':_0x4f2759[_0x4202('0x54')]['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x5ee2c4,null))[_0x4202('0x28')](function(_0x20b0ac){if(_0x20b0ac){_0x1f888d[_0x4202('0x32')]=_[_0x4202('0x35')](db[_0x4202('0x58')][_0x4202('0x2f')]);_0x1f888d[_0x4202('0x34')]=_[_0x4202('0x35')](_0x4f2759[_0x4202('0x34')]);_0x1f888d[_0x4202('0x36')]=_[_0x4202('0x37')](_0x1f888d[_0x4202('0x32')],_0x1f888d[_0x4202('0x34')]);_0x145865['attributes']=_['intersection'](_0x1f888d['model'],qs[_0x4202('0x38')](_0x4f2759[_0x4202('0x34')]['fields']));_0x145865[_0x4202('0x39')]=_0x145865['attributes']['length']?_0x145865['attributes']:_0x1f888d[_0x4202('0x32')];if(!_0x4f2759[_0x4202('0x34')][_0x4202('0x3a')]('nolimit')){_0x145865[_0x4202('0x21')]=qs['limit'](_0x4f2759[_0x4202('0x34')][_0x4202('0x21')]);_0x145865[_0x4202('0x20')]=qs[_0x4202('0x20')](_0x4f2759[_0x4202('0x34')][_0x4202('0x20')]);}_0x145865[_0x4202('0x3b')]=qs[_0x4202('0x3c')](_0x4f2759['query'][_0x4202('0x3c')]);_0x145865[_0x4202('0x3d')]=qs[_0x4202('0x36')](_['pick'](_0x4f2759['query'],_0x1f888d[_0x4202('0x36')]));_0x145865[_0x4202('0x3d')][_0x4202('0x57')]=_0x20b0ac['id'];if(_0x4f2759[_0x4202('0x34')][_0x4202('0x3f')]){_0x145865[_0x4202('0x3d')]=_[_0x4202('0x48')](_0x145865[_0x4202('0x3d')],{'$or':_['map'](_0x145865['attributes'],function(_0x4c969b){var _0x26de3c={};_0x26de3c[_0x4c969b]={'$like':'%'+_0x4f2759['query']['filter']+'%'};return _0x26de3c;})});}_0x145865=_[_0x4202('0x48')]({},_0x145865,_0x4f2759[_0x4202('0x40')]);return db[_0x4202('0x58')]['count']({'where':_0x145865[_0x4202('0x3d')]})[_0x4202('0x28')](function(_0x32d43b){_0x476cf5[_0x4202('0x1f')]=_0x32d43b;if(_0x4f2759[_0x4202('0x34')][_0x4202('0x5a')]){_0x145865[_0x4202('0x42')]=[{'all':!![]}];}return db[_0x4202('0x58')][_0x4202('0x43')](_0x145865);})['then'](function(_0x5c7736){_0x476cf5[_0x4202('0x44')]=_0x5c7736;return _0x476cf5;});}})['then'](respondWithFilteredResult(_0x5ee2c4,_0x145865))['catch'](handleError(_0x5ee2c4,null));};exports[_0x4202('0x5b')]=function(_0x1616ba,_0x3763d8,_0x36212e){return db[_0x4202('0x41')][_0x4202('0x4f')]({'where':{'id':_0x1616ba[_0x4202('0x54')]['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x3763d8,null))[_0x4202('0x28')](function(_0x4cd739){if(_0x4cd739){return _0x4cd739[_0x4202('0x5b')](_0x1616ba[_0x4202('0x34')][_0x4202('0x5c')]);}})[_0x4202('0x28')](respondWithStatusCode(_0x3763d8,null))[_0x4202('0x45')](handleError(_0x3763d8,null));};exports['addContacts']=function(_0x53a058,_0x401d45,_0x2474d4){return db[_0x4202('0x41')][_0x4202('0x4f')]({'where':{'id':_0x53a058['params']['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x401d45,null))[_0x4202('0x28')](function(_0x54df9b){if(_0x54df9b){var _0x59f5ee=[];var _0x2a3e48={'success':[],'errors':[]};return db['CmContact'][_0x4202('0x55')]()['then'](function(_0x389042){if(_0x53a058['body'][_0x4202('0x5d')]&&_[_0x4202('0x5e')](_0x53a058['body'][_0x4202('0x5d')])){if(_0x53a058[_0x4202('0x4a')][_0x4202('0x5d')][_0x4202('0x47')]){_0x53a058[_0x4202('0x4a')][_0x4202('0x5d')]=_0x53a058[_0x4202('0x4a')][_0x4202('0x5d')][_0x4202('0x5f')](';')+';';}else{_0x53a058[_0x4202('0x4a')][_0x4202('0x5d')]=null;}}else{_0x53a058[_0x4202('0x4a')]['tags']=null;}if(_0x53a058[_0x4202('0x4a')]&&_[_0x4202('0x5e')](_0x53a058[_0x4202('0x4a')])){for(var _0x5638d2=0x0;_0x5638d2<_0x53a058[_0x4202('0x4a')][_0x4202('0x47')];_0x5638d2+=0x1){_0x53a058['body'][_0x5638d2][_0x4202('0x57')]=_0x53a058[_0x4202('0x54')]['id'];_0x59f5ee[_0x4202('0x60')](_0x53a058[_0x4202('0x4a')][_0x5638d2]);}return BPromise[_0x4202('0x61')](_0x59f5ee,function(_0x292da7){return db['CmContact'][_0x4202('0x49')](_['omit'](_0x292da7,['ids','id'])||{},{'fields':_['keys'](_0x389042),'raw':!![]})[_0x4202('0x28')](function(_0x47314a){_0x2a3e48['success'][_0x4202('0x60')](_0x47314a[_0x4202('0x62')]);})[_0x4202('0x45')](function(_0x247d31){_0x2a3e48[_0x4202('0x63')][_0x4202('0x60')]({'data':_0x292da7,'error':_0x247d31[_0x4202('0x64')]});});})[_0x4202('0x28')](function(_0x26d41a){return _0x2a3e48;})[_0x4202('0x45')](function(_0x4132d9){return _0x4132d9;});}else{_0x401d45[_0x4202('0x1c')](0x190)[_0x4202('0x1e')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x4202('0x28')](respondWithResult(_0x401d45,null))[_0x4202('0x45')](handleError(_0x401d45,null));};exports[_0x4202('0x65')]=function(_0x536c3c,_0x45cd96,_0x20b3f3){var _0x32ef82;return db[_0x4202('0x41')][_0x4202('0x4f')]({'where':{'id':_0x536c3c[_0x4202('0x54')]['id']},'include':[{'model':db[_0x4202('0x66')],'as':_0x4202('0x67')}]})[_0x4202('0x28')](handleEntityNotFound(_0x45cd96,null))[_0x4202('0x28')](function(_0x5d4b94){if(_0x5d4b94){_0x32ef82=_0x5d4b94;return db[_0x4202('0x68')][_0x4202('0x2f')];}})[_0x4202('0x28')](function(_0x3374c0){if(_0x3374c0){var _0xc370a2={};var _0xf63c61={};_0xf63c61[_0x4202('0x32')]=_[_0x4202('0x69')](_[_0x4202('0x35')](_0x3374c0),_['map'](_0x32ef82['CustomFields'],function(_0x5311a1){return util[_0x4202('0x6a')](_0x4202('0x6b'),_0x5311a1['id']);}));_0xf63c61[_0x4202('0x34')]=_['keys'](_0x536c3c[_0x4202('0x34')]);_0xf63c61['filters']=_['intersection'](_0xf63c61[_0x4202('0x32')],_0xf63c61['query']);_0xc370a2[_0x4202('0x39')]=_['intersection'](_0xf63c61[_0x4202('0x32')],qs[_0x4202('0x38')](_0x536c3c[_0x4202('0x34')][_0x4202('0x38')]));_0xc370a2[_0x4202('0x39')]=_0xc370a2[_0x4202('0x39')][_0x4202('0x47')]?_0xc370a2[_0x4202('0x39')]:_0xf63c61['model'];if(!_0x536c3c['query'][_0x4202('0x3a')](_0x4202('0x6c'))){_0xc370a2['limit']=qs[_0x4202('0x21')](_0x536c3c['query'][_0x4202('0x21')]);_0xc370a2[_0x4202('0x20')]=qs[_0x4202('0x20')](_0x536c3c[_0x4202('0x34')][_0x4202('0x20')]);}_0xc370a2['order']=qs[_0x4202('0x3c')](_0x536c3c[_0x4202('0x34')][_0x4202('0x3c')]);_0xc370a2[_0x4202('0x3d')]=qs[_0x4202('0x36')](_[_0x4202('0x3e')](_0x536c3c[_0x4202('0x34')],_0xf63c61[_0x4202('0x36')]));_0xc370a2[_0x4202('0x6d')]=!![];if(_0x536c3c[_0x4202('0x34')]['filter']){_0xc370a2[_0x4202('0x3d')]=_['merge'](_0xc370a2['where'],{'$or':_[_0x4202('0x33')](_0xc370a2[_0x4202('0x39')],function(_0x30e74b){var _0x1cf572={};_0x1cf572[_0x30e74b]={'$like':'%'+_0x536c3c[_0x4202('0x34')][_0x4202('0x3f')]+'%'};return _0x1cf572;})});}_0xc370a2=_['merge']({},_0xc370a2,_0x536c3c[_0x4202('0x40')]);return _0x32ef82[_0x4202('0x65')](_0xc370a2);}})[_0x4202('0x28')](respondWithResult(_0x45cd96,null))[_0x4202('0x45')](handleError(_0x45cd96,null));};exports['getContactsCsv']=function(_0x5f2e9b,_0x417350,_0x2c5efa){var _0x14716d;var _0x3860e8;var _0x5e54ea;var _0x4ab076=_0x5f2e9b[_0x4202('0x54')]['id'];csv_results=[];return db['ContactItemType'][_0x4202('0x43')]({'attributes':['id','name'],'raw':!![],'order':[_0x4202('0x6e')]})[_0x4202('0x28')](function(_0x3c1468){_0x14716d=_0x3c1468;var _0xd86eb8=_[_0x4202('0x35')](db['CmContact'][_0x4202('0x2f')]);return db[_0x4202('0x66')][_0x4202('0x43')]({'raw':!![],'attributes':['id','alias']})[_0x4202('0x28')](function(_0x117f9e){_0x3860e8=_0x117f9e;var _0x403e44=squel['select']()[_0x4202('0x38')](_0xd86eb8)[_0x4202('0x6f')](_0x4202('0x70'),'c')[_0x4202('0x3d')](_0x4202('0x71'),_0x4ab076)['where'](_0x4202('0x72'))['distinct']();for(var _0x35fc51=0x0;_0x35fc51<_0x3860e8[_0x4202('0x47')];_0x35fc51++){_0x403e44['field'](_0x4202('0x73')+_0x3860e8[_0x35fc51]['id'],_0x4202('0x74')+_0x3860e8[_0x35fc51]['alias']);}for(var _0x35fc51=0x0;_0x35fc51<_0x14716d[_0x4202('0x47')];_0x35fc51++){_0x403e44[_0x4202('0x75')](squel[_0x4202('0x76')]()[_0x4202('0x75')](_0x4202('0x77'))[_0x4202('0x6f')](_0x4202('0x78'))[_0x4202('0x3d')]('ItemTypeId\x20=\x20?',_0x14716d[_0x35fc51]['id'])[_0x4202('0x3d')](_0x4202('0x79')),_0x4202('0x7a')+_0x14716d[_0x35fc51][_0x4202('0x2c')]);_0x403e44[_0x4202('0x75')](squel[_0x4202('0x76')]()[_0x4202('0x75')](_0x4202('0x7b'))[_0x4202('0x6f')](_0x4202('0x78'))['where'](_0x4202('0x7c'),_0x14716d[_0x35fc51]['id'])[_0x4202('0x3d')](_0x4202('0x79')),_0x4202('0x7d')+_0x14716d[_0x35fc51][_0x4202('0x2c')]);}var _0x350076=[];_0x350076[_0x4202('0x60')](_0x403e44[_0x4202('0x7e')]());BPromise['each'](_0x350076,handleQuery)[_0x4202('0x28')](function(_0x3a7262){handleQuery(_0x403e44[_0x4202('0x7e')]());var _0x42af3f=csv_results[0x0];if(!_[_0x4202('0x7f')](_0x42af3f)){var _0x149ae8=toCsv(_0x42af3f);var _0x2f9ec2=Date['now']();fs[_0x4202('0x80')](util[_0x4202('0x6a')](_0x4202('0x81'),_0x4ab076,_0x2f9ec2),_0x149ae8);_0x417350['setHeader']('Content-disposition',_0x4202('0x82')+util[_0x4202('0x6a')]('list_%d_%s.csv',_0x4ab076,_0x2f9ec2));_0x417350[_0x4202('0x83')]('Content-type',_0x4202('0x84'));return _0x417350[_0x4202('0x85')](util[_0x4202('0x6a')](_0x4202('0x81'),_0x4ab076,_0x2f9ec2));}else{return _0x417350[_0x4202('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x54b586,_0x23a003,_0x31352f){var _0x4de663;delete _0x54b586[_0x4202('0x4a')]['id'];return db[_0x4202('0x41')][_0x4202('0x59')]({'where':{'id':_0x54b586[_0x4202('0x54')]['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x23a003,null))['then'](function(_0x1f4588){if(_0x1f4588){return db[_0x4202('0x86')][_0x4202('0x87')](function(_0x1f4c7d){return db['CmCustomField'][_0x4202('0x49')](_0x54b586[_0x4202('0x4a')],{'transaction':_0x1f4c7d})['then'](function(_0x51fbcf){_0x4de663=_0x51fbcf;return _0x1f4588[_0x4202('0x88')](_0x51fbcf,{'transaction':_0x1f4c7d});})[_0x4202('0x28')](function(){var _0x28e2ac={'type':db[_0x4202('0x89')][_0x4202('0x8a')],'transaction':_0x1f4c7d};switch(_0x54b586[_0x4202('0x4a')][_0x4202('0x30')]){case'text':_0x28e2ac[_0x4202('0x30')]=db[_0x4202('0x89')][_0x4202('0x8a')];break;case _0x4202('0x8b'):_0x28e2ac['type']=db[_0x4202('0x89')]['INTEGER'];break;case _0x4202('0x8c'):_0x28e2ac[_0x4202('0x30')]=db[_0x4202('0x89')][_0x4202('0x8d')];_0x28e2ac['defaultValue']=![];break;default:}return db['sequelize'][_0x4202('0x8e')]['addColumn']('cm_contacts',util[_0x4202('0x6a')]('cf_%s',_0x4de663['id']),_0x28e2ac);})[_0x4202('0x28')](function(){return _0x4de663;});});}})[_0x4202('0x28')](respondWithResult(_0x23a003,null))['catch'](handleError(_0x23a003,null));};exports[_0x4202('0x8f')]=function(_0x3d4610,_0x411a78,_0x5bdbcc){var _0xb46b20={};var _0x244734={};var _0x25c76d;var _0x3ae080;return db[_0x4202('0x41')]['findOne']({'where':{'id':_0x3d4610[_0x4202('0x54')]['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x411a78,null))[_0x4202('0x28')](function(_0x4edd7e){if(_0x4edd7e){_0x25c76d=_0x4edd7e;_0x244734[_0x4202('0x32')]=_[_0x4202('0x35')](db[_0x4202('0x66')][_0x4202('0x2f')]);_0x244734[_0x4202('0x34')]=_[_0x4202('0x35')](_0x3d4610[_0x4202('0x34')]);_0x244734['filters']=_[_0x4202('0x37')](_0x244734[_0x4202('0x32')],_0x244734[_0x4202('0x34')]);_0xb46b20[_0x4202('0x39')]=_[_0x4202('0x37')](_0x244734[_0x4202('0x32')],qs[_0x4202('0x38')](_0x3d4610[_0x4202('0x34')][_0x4202('0x38')]));_0xb46b20[_0x4202('0x39')]=_0xb46b20[_0x4202('0x39')][_0x4202('0x47')]?_0xb46b20[_0x4202('0x39')]:_0x244734['model'];_0xb46b20['order']=qs['sort'](_0x3d4610[_0x4202('0x34')]['sort']);_0xb46b20[_0x4202('0x3d')]=qs['filters'](_['pick'](_0x3d4610[_0x4202('0x34')],_0x244734[_0x4202('0x36')]));_0xb46b20[_0x4202('0x3d')]=_[_0x4202('0x48')](_0xb46b20[_0x4202('0x3d')],{'$or':[{'ListId':_0x4edd7e['id']},{'ListId':null}]});if(_0x3d4610[_0x4202('0x34')]['filter']){_0xb46b20[_0x4202('0x3d')]=_['merge'](_0xb46b20[_0x4202('0x3d')],{'$or':_[_0x4202('0x33')](_0xb46b20['attributes'],function(_0x3b30c4){var _0x595953={};_0x595953[_0x3b30c4]={'$like':'%'+_0x3d4610[_0x4202('0x34')][_0x4202('0x3f')]+'%'};return _0x595953;})});}_0xb46b20=_[_0x4202('0x48')]({},_0xb46b20,_0x3d4610[_0x4202('0x40')]);return db[_0x4202('0x66')]['findAndCountAll'](_0xb46b20);}})['then'](respondWithResult(_0x411a78,null))[_0x4202('0x45')](handleError(_0x411a78,null));};exports[_0x4202('0x90')]=function(_0x4ffb39,_0x400ad9){return db['CmCustomField'][_0x4202('0x91')]({'where':{'ListId':null}})[_0x4202('0x28')](handleEntityNotFound(_0x400ad9,null))[_0x4202('0x28')](function(_0x48f601){return _0x48f601;})[_0x4202('0x28')](respondWithResult(_0x400ad9,null))['catch'](handleError(_0x400ad9,null));};exports['addAgents']=function(_0x5c8745,_0x6210a5,_0x1e0c11){return db[_0x4202('0x41')]['find']({'where':{'id':_0x5c8745[_0x4202('0x54')]['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x6210a5,null))['then'](function(_0x3a98ca){if(_0x3a98ca){return _0x3a98ca[_0x4202('0x92')](_0x5c8745[_0x4202('0x4a')][_0x4202('0x5c')],_[_0x4202('0x93')](_0x5c8745['body'],['ids','id'])||{})['spread'](function(_0x23dcb7){for(var _0xab673c=0x0;_0xab673c<_0x5c8745[_0x4202('0x4a')][_0x4202('0x5c')][_0x4202('0x47')];_0xab673c+=0x1){socket[_0x4202('0x94')](_0x4202('0x95'),{'UserId':Number(_0x5c8745[_0x4202('0x4a')][_0x4202('0x5c')][_0xab673c]),'CmListId':Number(_0x5c8745[_0x4202('0x54')]['id'])});}return _0x23dcb7;});}})[_0x4202('0x28')](respondWithResult(_0x6210a5,null))['catch'](handleError(_0x6210a5,null));};exports['removeAgents']=function(_0x304139,_0x321d3f,_0x3988eb){return db[_0x4202('0x41')][_0x4202('0x4f')]({'where':{'id':_0x304139['params']['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x321d3f,null))[_0x4202('0x28')](function(_0xf27da6){if(_0xf27da6){return _0xf27da6[_0x4202('0x96')](_0x304139['query'][_0x4202('0x5c')])['then'](function(){if(_[_0x4202('0x5e')](_0x304139['query'][_0x4202('0x5c')])){for(var _0x292d1e=0x0;_0x292d1e<_0x304139[_0x4202('0x34')][_0x4202('0x5c')][_0x4202('0x47')];_0x292d1e+=0x1){socket[_0x4202('0x94')]('userCmList:remove',{'UserId':Number(_0x304139['query'][_0x4202('0x5c')][_0x292d1e]),'CmListId':Number(_0x304139[_0x4202('0x54')]['id'])});}}else{socket['emit'](_0x4202('0x97'),{'UserId':Number(_0x304139[_0x4202('0x34')][_0x4202('0x5c')]),'CmListId':Number(_0x304139[_0x4202('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x321d3f,null))[_0x4202('0x45')](handleError(_0x321d3f,null));};exports[_0x4202('0x98')]=function(_0x1375df,_0x2248cf,_0x10080e){var _0x281dda={};var _0x8d27f4={};var _0x42ad6e;var _0x4c4bd6;return db[_0x4202('0x41')][_0x4202('0x59')]({'where':{'id':_0x1375df[_0x4202('0x54')]['id']}})[_0x4202('0x28')](handleEntityNotFound(_0x2248cf,null))[_0x4202('0x28')](function(_0x324ce2){if(_0x324ce2){_0x42ad6e=_0x324ce2;_0x8d27f4['model']=_[_0x4202('0x35')](db[_0x4202('0x99')]['rawAttributes']);_0x8d27f4['query']=_[_0x4202('0x35')](_0x1375df[_0x4202('0x34')]);_0x8d27f4[_0x4202('0x36')]=_[_0x4202('0x37')](_0x8d27f4[_0x4202('0x32')],_0x8d27f4[_0x4202('0x34')]);_0x281dda[_0x4202('0x39')]=_[_0x4202('0x37')](_0x8d27f4[_0x4202('0x32')],qs[_0x4202('0x38')](_0x1375df[_0x4202('0x34')]['fields']));_0x281dda[_0x4202('0x39')]=_0x281dda[_0x4202('0x39')]['length']?_0x281dda[_0x4202('0x39')]:_0x8d27f4[_0x4202('0x32')];_0x281dda[_0x4202('0x3b')]=qs[_0x4202('0x3c')](_0x1375df[_0x4202('0x34')][_0x4202('0x3c')]);_0x281dda['where']=qs[_0x4202('0x36')](_['pick'](_0x1375df[_0x4202('0x34')],_0x8d27f4[_0x4202('0x36')]));if(_0x1375df['query'][_0x4202('0x3f')]){_0x281dda[_0x4202('0x3d')]=_[_0x4202('0x48')](_0x281dda[_0x4202('0x3d')],{'$or':_['map'](_0x281dda[_0x4202('0x39')],function(_0x9fbb21){var _0x213052={};_0x213052[_0x9fbb21]={'$like':'%'+_0x1375df[_0x4202('0x34')][_0x4202('0x3f')]+'%'};return _0x213052;})});}_0x281dda=_[_0x4202('0x48')]({},_0x281dda,_0x1375df[_0x4202('0x40')]);return _0x42ad6e['getAgents'](_0x281dda);}})[_0x4202('0x28')](function(_0x238e41){if(_0x238e41){_0x4c4bd6=_0x238e41[_0x4202('0x47')];if(!_0x1375df[_0x4202('0x34')][_0x4202('0x3a')]('nolimit')){_0x281dda['limit']=qs['limit'](_0x1375df[_0x4202('0x34')][_0x4202('0x21')]);_0x281dda['offset']=qs[_0x4202('0x20')](_0x1375df[_0x4202('0x34')][_0x4202('0x20')]);}return _0x42ad6e[_0x4202('0x98')](_0x281dda);}})[_0x4202('0x28')](function(_0x154be2){if(_0x154be2){return _0x154be2?{'count':_0x4c4bd6,'rows':_0x154be2}:null;}})['then'](respondWithResult(_0x2248cf,null))[_0x4202('0x45')](handleError(_0x2248cf,null));};function handleQuery(_0x1cd978){logger[_0x4202('0x9a')](_0x1cd978);return db[_0x4202('0x86')][_0x4202('0x34')](_0x1cd978)['spread'](function(_0x5b8bf3){csv_results[_0x4202('0x60')](_0x5b8bf3);})['catch'](function(_0x2c0cc5){logger[_0x4202('0x2b')](_0x2c0cc5['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 1fcb2ae..1c85be2 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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x2ec5ee,_0x279e9a){_0x2ec5ee=_0x2ec5ee-0x0;var _0x72258d=_0x326f[_0x2ec5ee];return _0x72258d;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0xf8e14d,_0x5d1b4e){var _0x21c32f=function(_0xcce77){while(--_0xcce77){_0xf8e14d['push'](_0xf8e14d['shift']());}};_0x21c32f(++_0x5d1b4e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 7cbb8e9..96e87a2 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 _0xa8a8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util'];(function(_0x926e67,_0x27d4fd){var _0x4b2a84=function(_0x24f1d4){while(--_0x24f1d4){_0x926e67['push'](_0x926e67['shift']());}};_0x4b2a84(++_0x27d4fd);}(_0xa8a8,0xec));var _0x8a8a=function(_0x48dc7b,_0x1a5ea5){_0x48dc7b=_0x48dc7b-0x0;var _0x134088=_0xa8a8[_0x48dc7b];return _0x134088;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdb7=['request-promise','path','rimraf','./cmList.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x300dbb,_0xd7fd5b){_0x300dbb=_0x300dbb-0x0;var _0x1a4120=_0xbdb7[_0x300dbb];return _0x1a4120;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('CmList',attributes,{'tableName':'cm_lists','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 5fe31a1..2609d25 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 _0xa7e5=['../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0xa7e5,0x13e));var _0x5a7e=function(_0x132801,_0xd1e33a){_0x132801=_0x132801-0x0;var _0x540ee9=_0xa7e5[_0x132801];return _0x540ee9;};'use strict';var _=require(_0x5a7e('0x0'));var util=require('util');var moment=require(_0x5a7e('0x1'));var BPromise=require(_0x5a7e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a7e('0x3'));var db=require(_0x5a7e('0x4'))['db'];var utils=require(_0x5a7e('0x5'));var logger=require(_0x5a7e('0x6'))(_0x5a7e('0x7'));var config=require('../../config/environment');var jayson=require(_0x5a7e('0x8'));var client=jayson[_0x5a7e('0x9')]['http']({'port':0x232a});config[_0x5a7e('0xa')]=_[_0x5a7e('0xb')](config[_0x5a7e('0xa')],{'host':_0x5a7e('0xc'),'port':0x18eb});var socket=require(_0x5a7e('0xd'))(new Redis(config[_0x5a7e('0xa')]));require('./cmList.socket')[_0x5a7e('0xe')](socket);function respondWithRpcPromise(_0x5447a0,_0x128f81,_0x36e0f8){return new BPromise(function(_0x1dc6b6,_0x10464b){return client[_0x5a7e('0xf')](_0x5447a0,_0x36e0f8)[_0x5a7e('0x10')](function(_0x4dfe63){logger[_0x5a7e('0x11')](_0x5a7e('0x12'),_0x128f81,_0x5a7e('0x13'));logger[_0x5a7e('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x128f81,_0x5a7e('0x13'),JSON[_0x5a7e('0x15')](_0x4dfe63));if(_0x4dfe63['error']){if(_0x4dfe63[_0x5a7e('0x16')][_0x5a7e('0x17')]===0x1f4){logger[_0x5a7e('0x16')]('CmList,\x20%s,\x20%s',_0x128f81,_0x4dfe63[_0x5a7e('0x16')]['message']);return _0x10464b(_0x4dfe63[_0x5a7e('0x16')][_0x5a7e('0x18')]);}logger[_0x5a7e('0x16')]('CmList,\x20%s,\x20%s',_0x128f81,_0x4dfe63[_0x5a7e('0x16')][_0x5a7e('0x18')]);return _0x1dc6b6(_0x4dfe63['error'][_0x5a7e('0x18')]);}else{logger[_0x5a7e('0x11')]('CmList,\x20%s,\x20%s',_0x128f81,_0x5a7e('0x13'));_0x1dc6b6(_0x4dfe63[_0x5a7e('0x19')][_0x5a7e('0x18')]);}})[_0x5a7e('0x1a')](function(_0x4ae370){logger[_0x5a7e('0x16')](_0x5a7e('0x12'),_0x128f81,_0x4ae370);_0x10464b(_0x4ae370);});});} \ No newline at end of file +var _0x7082=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x1da278,_0x2741bd){var _0x3501a8=function(_0x428005){while(--_0x428005){_0x1da278['push'](_0x1da278['shift']());}};_0x3501a8(++_0x2741bd);}(_0x7082,0x129));var _0x2708=function(_0x5c1f07,_0x35d59e){_0x5c1f07=_0x5c1f07-0x0;var _0x22c4d3=_0x7082[_0x5c1f07];return _0x22c4d3;};'use strict';var _=require('lodash');var util=require(_0x2708('0x0'));var moment=require('moment');var BPromise=require(_0x2708('0x1'));var rs=require(_0x2708('0x2'));var fs=require('fs');var Redis=require(_0x2708('0x3'));var db=require(_0x2708('0x4'))['db'];var utils=require(_0x2708('0x5'));var logger=require(_0x2708('0x6'))(_0x2708('0x7'));var config=require('../../config/environment');var jayson=require(_0x2708('0x8'));var client=jayson['client'][_0x2708('0x9')]({'port':0x232a});config[_0x2708('0xa')]=_[_0x2708('0xb')](config[_0x2708('0xa')],{'host':_0x2708('0xc'),'port':0x18eb});var socket=require(_0x2708('0xd'))(new Redis(config[_0x2708('0xa')]));require(_0x2708('0xe'))[_0x2708('0xf')](socket);function respondWithRpcPromise(_0x42b41b,_0x413b7f,_0x4b972c){return new BPromise(function(_0xd8a0cc,_0x400b55){return client['request'](_0x42b41b,_0x4b972c)['then'](function(_0x5b9fc8){logger[_0x2708('0x10')](_0x2708('0x11'),_0x413b7f,_0x2708('0x12'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x413b7f,_0x2708('0x12'),JSON[_0x2708('0x13')](_0x5b9fc8));if(_0x5b9fc8[_0x2708('0x14')]){if(_0x5b9fc8['error'][_0x2708('0x15')]===0x1f4){logger[_0x2708('0x14')](_0x2708('0x11'),_0x413b7f,_0x5b9fc8[_0x2708('0x14')][_0x2708('0x16')]);return _0x400b55(_0x5b9fc8[_0x2708('0x14')]['message']);}logger[_0x2708('0x14')](_0x2708('0x11'),_0x413b7f,_0x5b9fc8[_0x2708('0x14')][_0x2708('0x16')]);return _0xd8a0cc(_0x5b9fc8[_0x2708('0x14')]['message']);}else{logger[_0x2708('0x10')](_0x2708('0x11'),_0x413b7f,_0x2708('0x12'));_0xd8a0cc(_0x5b9fc8[_0x2708('0x17')][_0x2708('0x16')]);}})[_0x2708('0x18')](function(_0x1e0098){logger[_0x2708('0x14')]('CmList,\x20%s,\x20%s',_0x413b7f,_0x1e0098);_0x400b55(_0x1e0098);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 122a9a3..4fa2c9f 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 _0xb9c8=['cmList:','./cmList.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3e5e03,_0x2fac27){var _0x45279e=function(_0xb0f1c8){while(--_0xb0f1c8){_0x3e5e03['push'](_0x3e5e03['shift']());}};_0x45279e(++_0x2fac27);}(_0xb9c8,0x12a));var _0x8b9c=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xb9c8[_0x3a07c1];return _0x2bbe15;};'use strict';var CmListEvents=require(_0x8b9c('0x0'));var events=[_0x8b9c('0x1'),_0x8b9c('0x2'),_0x8b9c('0x3')];function createListener(_0x3fdb10,_0x55a4b2){return function(_0x1d2bb3){_0x55a4b2[_0x8b9c('0x4')](_0x3fdb10,_0x1d2bb3);};}function removeListener(_0x512d31,_0x5afadc){return function(){CmListEvents[_0x8b9c('0x5')](_0x512d31,_0x5afadc);};}exports[_0x8b9c('0x6')]=function(_0x2d8eb5){for(var _0x3c9ff1=0x0,_0x1365d7=events[_0x8b9c('0x7')];_0x3c9ff1<_0x1365d7;_0x3c9ff1++){var _0x4476a5=events[_0x3c9ff1];var _0x4c3f0b=createListener(_0x8b9c('0x8')+_0x4476a5,_0x2d8eb5);CmListEvents['on'](_0x4476a5,_0x4c3f0b);}}; \ No newline at end of file +var _0xdada=['register','length','cmList:','./cmList.events','save','update','emit'];(function(_0x449cd5,_0x42d2b1){var _0x329198=function(_0x200fe9){while(--_0x200fe9){_0x449cd5['push'](_0x449cd5['shift']());}};_0x329198(++_0x42d2b1);}(_0xdada,0x130));var _0xadad=function(_0x41e955,_0x1ef7e8){_0x41e955=_0x41e955-0x0;var _0x7670a2=_0xdada[_0x41e955];return _0x7670a2;};'use strict';var CmListEvents=require(_0xadad('0x0'));var events=[_0xadad('0x1'),'remove',_0xadad('0x2')];function createListener(_0x5363ab,_0x5e15f3){return function(_0x393c4d){_0x5e15f3[_0xadad('0x3')](_0x5363ab,_0x393c4d);};}function removeListener(_0x188c43,_0x4d0948){return function(){CmListEvents['removeListener'](_0x188c43,_0x4d0948);};}exports[_0xadad('0x4')]=function(_0x4704ce){for(var _0x42b009=0x0,_0x5e6128=events[_0xadad('0x5')];_0x42b009<_0x5e6128;_0x42b009++){var _0x1ccd7b=events[_0x42b009];var _0x4cd54b=createListener(_0xadad('0x6')+_0x1ccd7b,_0x4704ce);CmListEvents['on'](_0x1ccd7b,_0x4cd54b);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index ff2428d..222e785 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 _0xc8bf=['isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get'];(function(_0x5c2666,_0x4e6cfc){var _0x2ea361=function(_0x284b0b){while(--_0x284b0b){_0x5c2666['push'](_0x5c2666['shift']());}};_0x2ea361(++_0x4e6cfc);}(_0xc8bf,0x181));var _0xfc8b=function(_0x6c06f0,_0x4577c4){_0x6c06f0=_0x6c06f0-0x0;var _0x2efad0=_0xc8bf[_0x6c06f0];return _0x2efad0;};'use strict';var multer=require(_0xfc8b('0x0'));var util=require(_0xfc8b('0x1'));var path=require(_0xfc8b('0x2'));var timeout=require(_0xfc8b('0x3'));var express=require(_0xfc8b('0x4'));var router=express[_0xfc8b('0x5')]();var fs_extra=require(_0xfc8b('0x6'));var auth=require(_0xfc8b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfc8b('0x8'));var controller=require(_0xfc8b('0x9'));router[_0xfc8b('0xa')]('/',auth[_0xfc8b('0xb')](),controller[_0xfc8b('0xc')]);router['get'](_0xfc8b('0xd'),auth['isAuthenticated'](),controller[_0xfc8b('0xe')]);router['get'](_0xfc8b('0xf'),auth['isAuthenticated'](),controller[_0xfc8b('0x10')]);router[_0xfc8b('0xa')](_0xfc8b('0x11'),auth[_0xfc8b('0xb')](),controller['show']);router[_0xfc8b('0xa')]('/:id/dispositions',auth[_0xfc8b('0xb')](),controller[_0xfc8b('0x12')]);router[_0xfc8b('0xa')](_0xfc8b('0x13'),auth[_0xfc8b('0xb')](),controller[_0xfc8b('0x14')]);router[_0xfc8b('0xa')](_0xfc8b('0x15'),auth[_0xfc8b('0xb')](),controller['getContactsCsv']);router[_0xfc8b('0xa')](_0xfc8b('0x16'),auth['isAuthenticated'](),controller[_0xfc8b('0x17')]);router[_0xfc8b('0xa')](_0xfc8b('0x18'),auth[_0xfc8b('0xb')](),controller[_0xfc8b('0x19')]);router[_0xfc8b('0x1a')]('/',auth['isAuthenticated'](),controller[_0xfc8b('0x1b')]);router[_0xfc8b('0x1a')]('/:id/dispositions',auth[_0xfc8b('0xb')](),controller[_0xfc8b('0x1c')]);router[_0xfc8b('0x1a')]('/:id/contacts',auth[_0xfc8b('0xb')](),controller[_0xfc8b('0x1d')]);router['post'](_0xfc8b('0x16'),auth[_0xfc8b('0xb')](),controller[_0xfc8b('0x1e')]);router[_0xfc8b('0x1a')](_0xfc8b('0x18'),auth['isAuthenticated'](),controller['addAgents']);router[_0xfc8b('0x1f')](_0xfc8b('0x11'),auth[_0xfc8b('0xb')](),controller[_0xfc8b('0x20')]);router[_0xfc8b('0x21')](_0xfc8b('0x11'),auth[_0xfc8b('0xb')](),controller[_0xfc8b('0x22')]);router['delete']('/:id/dispositions',auth[_0xfc8b('0xb')](),controller['removeDispositions']);router[_0xfc8b('0x21')](_0xfc8b('0x18'),auth[_0xfc8b('0xb')](),controller['removeAgents']);module[_0xfc8b('0x23')]=router; \ No newline at end of file +var _0x6b64=['getContacts','/:id/users','getAgents','post','/:id/contacts','addContacts','/:id/fields','addCustomField','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','get','/describe','describe','/global_fields','show','/:id/dispositions'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x6b64,0x6a));var _0x46b6=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x6b64[_0x5c4e16];return _0x36044a;};'use strict';var multer=require(_0x46b6('0x0'));var util=require(_0x46b6('0x1'));var path=require(_0x46b6('0x2'));var timeout=require(_0x46b6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x46b6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x46b6('0x5'));var controller=require(_0x46b6('0x6'));router['get']('/',auth[_0x46b6('0x7')](),controller['index']);router[_0x46b6('0x8')](_0x46b6('0x9'),auth[_0x46b6('0x7')](),controller[_0x46b6('0xa')]);router['get'](_0x46b6('0xb'),auth[_0x46b6('0x7')](),controller['getGlobalCustomFields']);router[_0x46b6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x46b6('0xc')]);router[_0x46b6('0x8')](_0x46b6('0xd'),auth[_0x46b6('0x7')](),controller['getDispositions']);router[_0x46b6('0x8')]('/:id/contacts',auth[_0x46b6('0x7')](),controller[_0x46b6('0xe')]);router['get']('/:id/contacts/csv',auth[_0x46b6('0x7')](),controller['getContactsCsv']);router[_0x46b6('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getCustomFields']);router['get'](_0x46b6('0xf'),auth[_0x46b6('0x7')](),controller[_0x46b6('0x10')]);router[_0x46b6('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x46b6('0x11')](_0x46b6('0xd'),auth[_0x46b6('0x7')](),controller['addDisposition']);router[_0x46b6('0x11')](_0x46b6('0x12'),auth[_0x46b6('0x7')](),controller[_0x46b6('0x13')]);router[_0x46b6('0x11')](_0x46b6('0x14'),auth['isAuthenticated'](),controller[_0x46b6('0x15')]);router[_0x46b6('0x11')](_0x46b6('0xf'),auth[_0x46b6('0x7')](),controller['addAgents']);router[_0x46b6('0x16')](_0x46b6('0x17'),auth[_0x46b6('0x7')](),controller[_0x46b6('0x18')]);router[_0x46b6('0x19')]('/:id',auth[_0x46b6('0x7')](),controller[_0x46b6('0x1a')]);router[_0x46b6('0x19')](_0x46b6('0xd'),auth[_0x46b6('0x7')](),controller[_0x46b6('0x1b')]);router[_0x46b6('0x19')](_0x46b6('0xf'),auth['isAuthenticated'](),controller[_0x46b6('0x1c')]);module[_0x46b6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index e4e8f6a..3f52000 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 _0x6c7a=['VIRTUAL','getDataValue','STRING'];(function(_0x41cae7,_0x307030){var _0x49ca95=function(_0x1595cd){while(--_0x1595cd){_0x41cae7['push'](_0x41cae7['shift']());}};_0x49ca95(++_0x307030);}(_0x6c7a,0xd2));var _0xa6c7=function(_0x597b24,_0x2d7800){_0x597b24=_0x597b24-0x0;var _0xf7a0b9=_0x6c7a[_0x597b24];return _0xf7a0b9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa6c7('0x0')],'get':function(_0x1fac20){return this[_0xa6c7('0x1')]('field');}},'field':{'type':Sequelize[_0xa6c7('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0xa6c7('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa6c7('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xfb16=['getDataValue','field','STRING','exports','VIRTUAL'];(function(_0x3bd0c0,_0x1b53fc){var _0x43983f=function(_0x35abc8){while(--_0x35abc8){_0x3bd0c0['push'](_0x3bd0c0['shift']());}};_0x43983f(++_0x1b53fc);}(_0xfb16,0x1b1));var _0x6fb1=function(_0x1b7366,_0x2a4ddc){_0x1b7366=_0x1b7366-0x0;var _0x9e0c8d=_0xfb16[_0x1b7366];return _0x9e0c8d;};'use strict';var Sequelize=require('sequelize');module[_0x6fb1('0x0')]={'name':{'type':Sequelize[_0x6fb1('0x1')],'get':function(_0x20490a){return this[_0x6fb1('0x2')](_0x6fb1('0x3'));}},'field':{'type':Sequelize[_0x6fb1('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x6fb1('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x6fb1('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 4015a28..dd1f8a4 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(_0x45ab38,_0xc822fd){var _0x18282f=function(_0x31af2c){while(--_0x31af2c){_0x45ab38['push'](_0x45ab38['shift']());}};_0x18282f(++_0xc822fd);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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(_0x465bdd,_0x230ccb){var _0x37a4e0=function(_0xcc1e52){while(--_0xcc1e52){_0x465bdd['push'](_0x465bdd['shift']());}};_0x37a4e0(++_0x230ccb);}(_0x7a54,0x106));var _0x47a5=function(_0x3140bb,_0x15278f){_0x3140bb=_0x3140bb-0x0;var _0x551dab=_0x7a54[_0x3140bb];return _0x551dab;};'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 942f507..d3c0fcb 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 _0xe20d=['rimraf','../../config/environment','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xe20d,0x1e7));var _0xde20=function(_0x156787,_0x26f440){_0x156787=_0x156787-0x0;var _0x4aee06=_0xe20d[_0x156787];return _0x4aee06;};'use strict';var _=require(_0xde20('0x0'));var util=require(_0xde20('0x1'));var logger=require(_0xde20('0x2'))(_0xde20('0x3'));var moment=require(_0xde20('0x4'));var BPromise=require(_0xde20('0x5'));var rp=require(_0xde20('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde20('0x7'));var config=require(_0xde20('0x8'));var attributes=require('./condition.attributes');module[_0xde20('0x9')]=function(_0x5883fb,_0x593766){return _0x5883fb[_0xde20('0xa')](_0xde20('0xb'),attributes,{'tableName':_0xde20('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x630c=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Condition','tools_conditions','util','../../config/logger','api'];(function(_0x3e02c5,_0x1777e2){var _0x5c9b09=function(_0x15e002){while(--_0x15e002){_0x3e02c5['push'](_0x3e02c5['shift']());}};_0x5c9b09(++_0x1777e2);}(_0x630c,0x159));var _0xc630=function(_0x4a7a04,_0x456819){_0x4a7a04=_0x4a7a04-0x0;var _0x44d659=_0x630c[_0x4a7a04];return _0x44d659;};'use strict';var _=require('lodash');var util=require(_0xc630('0x0'));var logger=require(_0xc630('0x1'))(_0xc630('0x2'));var moment=require(_0xc630('0x3'));var BPromise=require(_0xc630('0x4'));var rp=require(_0xc630('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc630('0x6'));var config=require(_0xc630('0x7'));var attributes=require('./condition.attributes');module[_0xc630('0x8')]=function(_0x3d3bb4,_0x366074){return _0x3d3bb4[_0xc630('0x9')](_0xc630('0xa'),attributes,{'tableName':_0xc630('0xb'),'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 becdc8a..a8fc1cc 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 _0x547c=['util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x556a60,_0x40d99){var _0x3eafb6=function(_0x26b3ae){while(--_0x26b3ae){_0x556a60['push'](_0x556a60['shift']());}};_0x3eafb6(++_0x40d99);}(_0x547c,0xb4));var _0xc547=function(_0x55df69,_0x47b9c1){_0x55df69=_0x55df69-0x0;var _0x3e42e2=_0x547c[_0x55df69];return _0x3e42e2;};'use strict';var _=require('lodash');var util=require(_0xc547('0x0'));var moment=require('moment');var BPromise=require(_0xc547('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc547('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc547('0x3'))(_0xc547('0x4'));var config=require('../../config/environment');var jayson=require(_0xc547('0x5'));var client=jayson[_0xc547('0x6')][_0xc547('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x10e6fb,_0x346715,_0x1a3edd){return new BPromise(function(_0x4cae97,_0x17adbb){return client[_0xc547('0x8')](_0x10e6fb,_0x1a3edd)['then'](function(_0x3cb938){logger[_0xc547('0x9')](_0xc547('0xa'),_0x346715,'request\x20sent');logger[_0xc547('0xb')](_0xc547('0xc'),_0x346715,_0xc547('0xd'),JSON[_0xc547('0xe')](_0x3cb938));if(_0x3cb938[_0xc547('0xf')]){if(_0x3cb938[_0xc547('0xf')][_0xc547('0x10')]===0x1f4){logger[_0xc547('0xf')](_0xc547('0xa'),_0x346715,_0x3cb938[_0xc547('0xf')][_0xc547('0x11')]);return _0x17adbb(_0x3cb938[_0xc547('0xf')][_0xc547('0x11')]);}logger[_0xc547('0xf')](_0xc547('0xa'),_0x346715,_0x3cb938[_0xc547('0xf')][_0xc547('0x11')]);return _0x4cae97(_0x3cb938['error'][_0xc547('0x11')]);}else{logger[_0xc547('0x9')](_0xc547('0xa'),_0x346715,_0xc547('0xd'));_0x4cae97(_0x3cb938[_0xc547('0x12')][_0xc547('0x11')]);}})[_0xc547('0x13')](function(_0x2e1a7d){logger['error']('Condition,\x20%s,\x20%s',_0x346715,_0x2e1a7d);_0x17adbb(_0x2e1a7d);});});} \ No newline at end of file +var _0xaf04=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x255a2d,_0x5c7a75){var _0x44e1e4=function(_0x293a93){while(--_0x293a93){_0x255a2d['push'](_0x255a2d['shift']());}};_0x44e1e4(++_0x5c7a75);}(_0xaf04,0x193));var _0x4af0=function(_0x4881ae,_0x2f54da){_0x4881ae=_0x4881ae-0x0;var _0x230a76=_0xaf04[_0x4881ae];return _0x230a76;};'use strict';var _=require(_0x4af0('0x0'));var util=require(_0x4af0('0x1'));var moment=require(_0x4af0('0x2'));var BPromise=require(_0x4af0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4af0('0x4'));var db=require(_0x4af0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4af0('0x6'))(_0x4af0('0x7'));var config=require(_0x4af0('0x8'));var jayson=require(_0x4af0('0x9'));var client=jayson[_0x4af0('0xa')][_0x4af0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x204c43,_0x3d2c07,_0x414dde){return new BPromise(function(_0x3b5701,_0x37c088){return client[_0x4af0('0xc')](_0x204c43,_0x414dde)[_0x4af0('0xd')](function(_0x117ed5){logger['info'](_0x4af0('0xe'),_0x3d2c07,'request\x20sent');logger[_0x4af0('0xf')](_0x4af0('0x10'),_0x3d2c07,_0x4af0('0x11'),JSON[_0x4af0('0x12')](_0x117ed5));if(_0x117ed5[_0x4af0('0x13')]){if(_0x117ed5[_0x4af0('0x13')]['code']===0x1f4){logger[_0x4af0('0x13')](_0x4af0('0xe'),_0x3d2c07,_0x117ed5[_0x4af0('0x13')][_0x4af0('0x14')]);return _0x37c088(_0x117ed5[_0x4af0('0x13')][_0x4af0('0x14')]);}logger[_0x4af0('0x13')](_0x4af0('0xe'),_0x3d2c07,_0x117ed5[_0x4af0('0x13')][_0x4af0('0x14')]);return _0x3b5701(_0x117ed5[_0x4af0('0x13')][_0x4af0('0x14')]);}else{logger[_0x4af0('0x15')](_0x4af0('0xe'),_0x3d2c07,_0x4af0('0x11'));_0x3b5701(_0x117ed5[_0x4af0('0x16')][_0x4af0('0x14')]);}})[_0x4af0('0x17')](function(_0x447fa8){logger['error'](_0x4af0('0xe'),_0x3d2c07,_0x447fa8);_0x37c088(_0x447fa8);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 3ef0670..2cf9464 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 _0x9909=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','isAuthenticated','update','destroy','exports','multer'];(function(_0x223320,_0x26b76e){var _0x56520d=function(_0x2f619c){while(--_0x2f619c){_0x223320['push'](_0x223320['shift']());}};_0x56520d(++_0x26b76e);}(_0x9909,0x1db));var _0x9990=function(_0x45515b,_0x1e16a8){_0x45515b=_0x45515b-0x0;var _0x20ed56=_0x9909[_0x45515b];return _0x20ed56;};'use strict';var multer=require(_0x9990('0x0'));var util=require(_0x9990('0x1'));var path=require(_0x9990('0x2'));var timeout=require(_0x9990('0x3'));var express=require(_0x9990('0x4'));var router=express[_0x9990('0x5')]();var fs_extra=require(_0x9990('0x6'));var auth=require(_0x9990('0x7'));var interaction=require(_0x9990('0x8'));var config=require('../../config/environment');var controller=require(_0x9990('0x9'));router['put']('/:id',auth[_0x9990('0xa')](),controller[_0x9990('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9990('0xc')]);module[_0x9990('0xd')]=router; \ No newline at end of file +var _0x6a05=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated'];(function(_0x302685,_0x4fd0b4){var _0x5880c1=function(_0xd320c3){while(--_0xd320c3){_0x302685['push'](_0x302685['shift']());}};_0x5880c1(++_0x4fd0b4);}(_0x6a05,0x111));var _0x56a0=function(_0x4dccfb,_0x5c9f92){_0x4dccfb=_0x4dccfb-0x0;var _0x20bc89=_0x6a05[_0x4dccfb];return _0x20bc89;};'use strict';var multer=require(_0x56a0('0x0'));var util=require(_0x56a0('0x1'));var path=require(_0x56a0('0x2'));var timeout=require(_0x56a0('0x3'));var express=require('express');var router=express[_0x56a0('0x4')]();var fs_extra=require(_0x56a0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x56a0('0x6'));var config=require(_0x56a0('0x7'));var controller=require(_0x56a0('0x8'));router[_0x56a0('0x9')](_0x56a0('0xa'),auth[_0x56a0('0xb')](),controller['update']);router[_0x56a0('0xc')](_0x56a0('0xa'),auth[_0x56a0('0xb')](),controller[_0x56a0('0xd')]);module[_0x56a0('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 867e64d..3539727 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 _0xb25b=['exports','STRING','name','INTEGER'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb25b,0x80));var _0xbb25=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb25b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xbb25('0x0')]={'name':{'type':Sequelize[_0xbb25('0x1')],'allowNull':![],'unique':_0xbb25('0x2')},'OrderBy':{'type':Sequelize[_0xbb25('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x6b73=['INTEGER','sequelize','exports','STRING','name'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x6b73,0x79));var _0x36b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b73[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x36b7('0x0'));module[_0x36b7('0x1')]={'name':{'type':Sequelize[_0x36b7('0x2')],'allowNull':![],'unique':_0x36b7('0x3')},'OrderBy':{'type':Sequelize[_0x36b7('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x36b7('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 03752f7..b3ac4cb 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 _0x6a95=['get','ContactItemTypes','error','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','keys','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','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','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x2e56f5,_0x4edf27){var _0x19a241=function(_0x5b4fc7){while(--_0x5b4fc7){_0x2e56f5['push'](_0x2e56f5['shift']());}};_0x19a241(++_0x4edf27);}(_0x6a95,0x1db));var _0x56a9=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x6a95[_0xf0bcac];return _0x4e4c65;};'use strict';var emlformat=require(_0x56a9('0x0'));var rimraf=require(_0x56a9('0x1'));var zipdir=require(_0x56a9('0x2'));var jsonpatch=require(_0x56a9('0x3'));var rp=require(_0x56a9('0x4'));var moment=require(_0x56a9('0x5'));var BPromise=require(_0x56a9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56a9('0x7'));var sox=require(_0x56a9('0x8'));var csv=require(_0x56a9('0x9'));var ejs=require(_0x56a9('0xa'));var fs=require('fs');var fs_extra=require(_0x56a9('0xb'));var _=require(_0x56a9('0xc'));var squel=require(_0x56a9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x56a9('0xe'));var toCsv=require(_0x56a9('0x9'));var querystring=require('querystring');var Papa=require(_0x56a9('0xf'));var Redis=require(_0x56a9('0x10'));var authService=require(_0x56a9('0x11'));var qs=require(_0x56a9('0x12'));var as=require(_0x56a9('0x13'));var hardwareService=require(_0x56a9('0x14'));var logger=require(_0x56a9('0x15'))(_0x56a9('0x16'));var utils=require(_0x56a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56a9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b2c7f,_0x4552ce){_0x4552ce=_0x4552ce||0xcc;return function(_0x420667){if(_0x420667){return _0x2b2c7f[_0x56a9('0x19')](_0x4552ce);}return _0x2b2c7f[_0x56a9('0x1a')](_0x4552ce)[_0x56a9('0x1b')]();};}function respondWithResult(_0x124ab8,_0x1a2eb4){_0x1a2eb4=_0x1a2eb4||0xc8;return function(_0x40b2cb){if(_0x40b2cb){return _0x124ab8['status'](_0x1a2eb4)['json'](_0x40b2cb);}};}function respondWithFilteredResult(_0x2e0dfd,_0x2a0714){return function(_0x42007b){if(_0x42007b){var _0x46f854=typeof _0x2a0714['offset']===_0x56a9('0x1c')&&typeof _0x2a0714['limit']==='undefined';var _0x4e292f=_0x42007b[_0x56a9('0x1d')];var _0x576bdf=_0x46f854?0x0:_0x2a0714[_0x56a9('0x1e')];var _0x105fe5=_0x46f854?_0x42007b[_0x56a9('0x1d')]:_0x2a0714[_0x56a9('0x1e')]+_0x2a0714[_0x56a9('0x1f')];var _0xbfeb1a;if(_0x105fe5>=_0x4e292f){_0x105fe5=_0x4e292f;_0xbfeb1a=0xc8;}else{_0xbfeb1a=0xce;}_0x2e0dfd[_0x56a9('0x1a')](_0xbfeb1a);return _0x2e0dfd[_0x56a9('0x20')](_0x56a9('0x21'),_0x576bdf+'-'+_0x105fe5+'/'+_0x4e292f)[_0x56a9('0x22')](_0x42007b);}return null;};}function patchUpdates(_0x5f145f){return function(_0x5bc03a){try{jsonpatch[_0x56a9('0x23')](_0x5bc03a,_0x5f145f,!![]);}catch(_0x16f9de){return BPromise[_0x56a9('0x24')](_0x16f9de);}return _0x5bc03a[_0x56a9('0x25')]();};}function saveUpdates(_0x4a09e5,_0x6100fe){return function(_0x3355c4){if(_0x3355c4){return _0x3355c4[_0x56a9('0x26')](_0x4a09e5)[_0x56a9('0x27')](function(_0x5a82e0){return _0x5a82e0;});}return null;};}function removeEntity(_0x44762e,_0x32839b){return function(_0x21ab38){if(_0x21ab38){return _0x21ab38[_0x56a9('0x28')]()[_0x56a9('0x27')](function(){var _0x52016c=_0x21ab38[_0x56a9('0x29')]({'plain':!![]});var _0x217bda=_0x56a9('0x2a');return db['UserProfileResource'][_0x56a9('0x28')]({'where':{'type':_0x217bda,'resourceId':_0x52016c['id']}})['then'](function(){return _0x21ab38;});})[_0x56a9('0x27')](function(){_0x44762e[_0x56a9('0x1a')](0xcc)[_0x56a9('0x1b')]();});}};}function handleEntityNotFound(_0x20432a,_0x45f38c){return function(_0x1afe8a){if(!_0x1afe8a){_0x20432a[_0x56a9('0x19')](0x194);}return _0x1afe8a;};}function handleError(_0xff5f55,_0x51fd64){_0x51fd64=_0x51fd64||0x1f4;return function(_0x437ccf){logger[_0x56a9('0x2b')](_0x437ccf['stack']);if(_0x437ccf[_0x56a9('0x2c')]){delete _0x437ccf['name'];}_0xff5f55['status'](_0x51fd64)[_0x56a9('0x2d')](_0x437ccf);};}exports['index']=function(_0x2f933a,_0x11002a){var _0x2fbd5d={},_0x2c1c3d={},_0x5879db={'count':0x0,'rows':[]};var _0x332707=_[_0x56a9('0x2e')](db[_0x56a9('0x2f')][_0x56a9('0x30')],function(_0xbbb47d){return{'name':_0xbbb47d[_0x56a9('0x31')],'type':_0xbbb47d[_0x56a9('0x32')][_0x56a9('0x33')]};});_0x2c1c3d[_0x56a9('0x34')]=_[_0x56a9('0x2e')](_0x332707,_0x56a9('0x2c'));_0x2c1c3d[_0x56a9('0x35')]=_['keys'](_0x2f933a[_0x56a9('0x35')]);_0x2c1c3d[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x2c1c3d['model'],_0x2c1c3d[_0x56a9('0x35')]);_0x2fbd5d['attributes']=_['intersection'](_0x2c1c3d['model'],qs[_0x56a9('0x38')](_0x2f933a[_0x56a9('0x35')]['fields']));_0x2fbd5d['attributes']=_0x2fbd5d[_0x56a9('0x39')][_0x56a9('0x3a')]?_0x2fbd5d[_0x56a9('0x39')]:_0x2c1c3d[_0x56a9('0x34')];if(!_0x2f933a[_0x56a9('0x35')][_0x56a9('0x3b')](_0x56a9('0x3c'))){_0x2fbd5d[_0x56a9('0x1f')]=qs[_0x56a9('0x1f')](_0x2f933a[_0x56a9('0x35')]['limit']);_0x2fbd5d['offset']=qs['offset'](_0x2f933a['query'][_0x56a9('0x1e')]);}_0x2fbd5d[_0x56a9('0x3d')]=qs['sort'](_0x2f933a[_0x56a9('0x35')][_0x56a9('0x3e')]);_0x2fbd5d[_0x56a9('0x3f')]=qs[_0x56a9('0x36')](_[_0x56a9('0x40')](_0x2f933a[_0x56a9('0x35')],_0x2c1c3d[_0x56a9('0x36')]),_0x332707);if(_0x2f933a['query'][_0x56a9('0x41')]){_0x2fbd5d[_0x56a9('0x3f')]=_['merge'](_0x2fbd5d['where'],{'$or':_[_0x56a9('0x2e')](_0x332707,function(_0x1180c6){if(_0x1180c6[_0x56a9('0x32')]!==_0x56a9('0x42')){var _0x158504={};_0x158504[_0x1180c6[_0x56a9('0x2c')]]={'$like':'%'+_0x2f933a[_0x56a9('0x35')][_0x56a9('0x41')]+'%'};return _0x158504;}})});}_0x2fbd5d=_[_0x56a9('0x43')]({},_0x2fbd5d,_0x2f933a[_0x56a9('0x44')]);var _0x9f24ea={'where':_0x2fbd5d[_0x56a9('0x3f')]};return db[_0x56a9('0x2f')][_0x56a9('0x1d')](_0x9f24ea)[_0x56a9('0x27')](function(_0xe57cfb){_0x5879db[_0x56a9('0x1d')]=_0xe57cfb;if(_0x2f933a[_0x56a9('0x35')]['includeAll']){_0x2fbd5d[_0x56a9('0x45')]=[{'all':!![]}];}return db[_0x56a9('0x2f')][_0x56a9('0x46')](_0x2fbd5d);})['then'](function(_0x1f8b30){_0x5879db['rows']=_0x1f8b30;return _0x5879db;})[_0x56a9('0x27')](respondWithFilteredResult(_0x11002a,_0x2fbd5d))['catch'](handleError(_0x11002a,null));};exports[_0x56a9('0x47')]=function(_0x39c445,_0x3998f1){var _0x49286b={'raw':!![],'where':{'id':_0x39c445['params']['id']}},_0x5192d8={};_0x5192d8['model']=_[_0x56a9('0x48')](db[_0x56a9('0x2f')][_0x56a9('0x30')]);_0x5192d8[_0x56a9('0x35')]=_[_0x56a9('0x48')](_0x39c445[_0x56a9('0x35')]);_0x5192d8[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x5192d8[_0x56a9('0x34')],_0x5192d8[_0x56a9('0x35')]);_0x49286b[_0x56a9('0x39')]=_[_0x56a9('0x37')](_0x5192d8[_0x56a9('0x34')],qs[_0x56a9('0x38')](_0x39c445['query'][_0x56a9('0x38')]));_0x49286b[_0x56a9('0x39')]=_0x49286b[_0x56a9('0x39')]['length']?_0x49286b[_0x56a9('0x39')]:_0x5192d8[_0x56a9('0x34')];if(_0x39c445['query'][_0x56a9('0x49')]){_0x49286b[_0x56a9('0x45')]=[{'all':!![]}];}_0x49286b=_[_0x56a9('0x43')]({},_0x49286b,_0x39c445[_0x56a9('0x44')]);return db['ContactItemType'][_0x56a9('0x4a')](_0x49286b)[_0x56a9('0x27')](handleEntityNotFound(_0x3998f1,null))[_0x56a9('0x27')](respondWithResult(_0x3998f1,null))[_0x56a9('0x4b')](handleError(_0x3998f1,null));};exports[_0x56a9('0x4c')]=function(_0x3942d8,_0x31aaf5){return db[_0x56a9('0x2f')][_0x56a9('0x4c')](_0x3942d8[_0x56a9('0x4d')],{})[_0x56a9('0x27')](function(_0x500656){var _0x58d370=_0x3942d8[_0x56a9('0x4e')][_0x56a9('0x29')]({'plain':!![]});if(!_0x58d370)throw new Error(_0x56a9('0x4f'));if(_0x58d370[_0x56a9('0x50')]==='user'){var _0x1986f2=_0x500656[_0x56a9('0x29')]({'plain':!![]});var _0x26ad3e=_0x56a9('0x2a');return db['UserProfileSection'][_0x56a9('0x4a')]({'where':{'name':_0x26ad3e,'userProfileId':_0x58d370[_0x56a9('0x51')]},'raw':!![]})['then'](function(_0x1ff42f){if(_0x1ff42f&&_0x1ff42f[_0x56a9('0x52')]===0x0){return db['UserProfileResource'][_0x56a9('0x4c')]({'name':_0x1986f2[_0x56a9('0x2c')],'resourceId':_0x1986f2['id'],'type':_0x1ff42f[_0x56a9('0x2c')],'sectionId':_0x1ff42f['id']},{})[_0x56a9('0x27')](function(){return _0x500656;});}else{return _0x500656;}})['catch'](function(_0x4938d6){logger[_0x56a9('0x2b')](_0x56a9('0x53'),_0x4938d6);throw _0x4938d6;});}return _0x500656;})[_0x56a9('0x27')](respondWithResult(_0x31aaf5,0xc9))[_0x56a9('0x4b')](handleError(_0x31aaf5,null));};exports[_0x56a9('0x26')]=function(_0xce9dc0,_0x798b4e){if(_0xce9dc0[_0x56a9('0x4d')]['id']){delete _0xce9dc0[_0x56a9('0x4d')]['id'];}return db[_0x56a9('0x2f')]['find']({'where':{'id':_0xce9dc0[_0x56a9('0x54')]['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x798b4e,null))[_0x56a9('0x27')](saveUpdates(_0xce9dc0[_0x56a9('0x4d')],null))[_0x56a9('0x27')](respondWithResult(_0x798b4e,null))[_0x56a9('0x4b')](handleError(_0x798b4e,null));};exports[_0x56a9('0x28')]=function(_0x488577,_0x870aa5){return db[_0x56a9('0x2f')][_0x56a9('0x4a')]({'where':{'id':_0x488577[_0x56a9('0x54')]['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x870aa5,null))[_0x56a9('0x27')](db[_0x56a9('0x55')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x488577[_0x56a9('0x54')]['id']}}))['then'](removeEntity(_0x870aa5,null))['catch'](handleError(_0x870aa5,null));}; \ No newline at end of file +var _0x93e9=['send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','ContactItemType','includeAll','include','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x93e9,0xcc));var _0x993e=function(_0xc252b1,_0x885f6f){_0xc252b1=_0xc252b1-0x0;var _0x41a2fc=_0x93e9[_0xc252b1];return _0x41a2fc;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];function respondWithStatusCode(_0x5d5c0d,_0x4c2707){_0x4c2707=_0x4c2707||0xcc;return function(_0x31ece2){if(_0x31ece2){return _0x5d5c0d[_0x993e('0x19')](_0x4c2707);}return _0x5d5c0d[_0x993e('0x1a')](_0x4c2707)[_0x993e('0x1b')]();};}function respondWithResult(_0x3e082b,_0x397b42){_0x397b42=_0x397b42||0xc8;return function(_0x34ddda){if(_0x34ddda){return _0x3e082b[_0x993e('0x1a')](_0x397b42)[_0x993e('0x1c')](_0x34ddda);}};}function respondWithFilteredResult(_0xa43a4e,_0x1a7726){return function(_0x135771){if(_0x135771){var _0x3df0e7=typeof _0x1a7726[_0x993e('0x1d')]===_0x993e('0x1e')&&typeof _0x1a7726[_0x993e('0x1f')]===_0x993e('0x1e');var _0x526e06=_0x135771[_0x993e('0x20')];var _0x1acd21=_0x3df0e7?0x0:_0x1a7726[_0x993e('0x1d')];var _0x3d6109=_0x3df0e7?_0x135771[_0x993e('0x20')]:_0x1a7726[_0x993e('0x1d')]+_0x1a7726['limit'];var _0x11cd41;if(_0x3d6109>=_0x526e06){_0x3d6109=_0x526e06;_0x11cd41=0xc8;}else{_0x11cd41=0xce;}_0xa43a4e[_0x993e('0x1a')](_0x11cd41);return _0xa43a4e[_0x993e('0x21')](_0x993e('0x22'),_0x1acd21+'-'+_0x3d6109+'/'+_0x526e06)[_0x993e('0x1c')](_0x135771);}return null;};}function patchUpdates(_0x425ab4){return function(_0x29e48d){try{jsonpatch[_0x993e('0x23')](_0x29e48d,_0x425ab4,!![]);}catch(_0x4bbe9c){return BPromise[_0x993e('0x24')](_0x4bbe9c);}return _0x29e48d['save']();};}function saveUpdates(_0x11f6f4,_0x37ff57){return function(_0x32b09e){if(_0x32b09e){return _0x32b09e['update'](_0x11f6f4)[_0x993e('0x25')](function(_0x13db4e){return _0x13db4e;});}return null;};}function removeEntity(_0xfba00f,_0x1c52fd){return function(_0x3b45ef){if(_0x3b45ef){return _0x3b45ef[_0x993e('0x26')]()[_0x993e('0x25')](function(){var _0x3ad96f=_0x3b45ef[_0x993e('0x27')]({'plain':!![]});var _0x18f6ac=_0x993e('0x28');return db[_0x993e('0x29')]['destroy']({'where':{'type':_0x18f6ac,'resourceId':_0x3ad96f['id']}})[_0x993e('0x25')](function(){return _0x3b45ef;});})[_0x993e('0x25')](function(){_0xfba00f['status'](0xcc)[_0x993e('0x1b')]();});}};}function handleEntityNotFound(_0x4f5cc1,_0x14a0c7){return function(_0xa03fbd){if(!_0xa03fbd){_0x4f5cc1[_0x993e('0x19')](0x194);}return _0xa03fbd;};}function handleError(_0x2ff973,_0x5c7507){_0x5c7507=_0x5c7507||0x1f4;return function(_0x48d457){logger[_0x993e('0x2a')](_0x48d457[_0x993e('0x2b')]);if(_0x48d457['name']){delete _0x48d457[_0x993e('0x2c')];}_0x2ff973[_0x993e('0x1a')](_0x5c7507)[_0x993e('0x2d')](_0x48d457);};}exports['index']=function(_0x2495b7,_0x9e0309){var _0x1f5d51={},_0x1fa8a5={},_0x2599ec={'count':0x0,'rows':[]};var _0x54da4e=_[_0x993e('0x2e')](db['ContactItemType'][_0x993e('0x2f')],function(_0x5ba163){return{'name':_0x5ba163[_0x993e('0x30')],'type':_0x5ba163['type'][_0x993e('0x31')]};});_0x1fa8a5[_0x993e('0x32')]=_[_0x993e('0x2e')](_0x54da4e,_0x993e('0x2c'));_0x1fa8a5[_0x993e('0x33')]=_[_0x993e('0x34')](_0x2495b7['query']);_0x1fa8a5[_0x993e('0x35')]=_['intersection'](_0x1fa8a5['model'],_0x1fa8a5[_0x993e('0x33')]);_0x1f5d51['attributes']=_[_0x993e('0x36')](_0x1fa8a5[_0x993e('0x32')],qs[_0x993e('0x37')](_0x2495b7[_0x993e('0x33')][_0x993e('0x37')]));_0x1f5d51[_0x993e('0x38')]=_0x1f5d51[_0x993e('0x38')][_0x993e('0x39')]?_0x1f5d51[_0x993e('0x38')]:_0x1fa8a5[_0x993e('0x32')];if(!_0x2495b7[_0x993e('0x33')][_0x993e('0x3a')](_0x993e('0x3b'))){_0x1f5d51[_0x993e('0x1f')]=qs[_0x993e('0x1f')](_0x2495b7['query'][_0x993e('0x1f')]);_0x1f5d51[_0x993e('0x1d')]=qs[_0x993e('0x1d')](_0x2495b7[_0x993e('0x33')][_0x993e('0x1d')]);}_0x1f5d51[_0x993e('0x3c')]=qs[_0x993e('0x3d')](_0x2495b7[_0x993e('0x33')][_0x993e('0x3d')]);_0x1f5d51['where']=qs[_0x993e('0x35')](_['pick'](_0x2495b7[_0x993e('0x33')],_0x1fa8a5[_0x993e('0x35')]),_0x54da4e);if(_0x2495b7[_0x993e('0x33')][_0x993e('0x3e')]){_0x1f5d51[_0x993e('0x3f')]=_[_0x993e('0x40')](_0x1f5d51[_0x993e('0x3f')],{'$or':_[_0x993e('0x2e')](_0x54da4e,function(_0x4f057e){if(_0x4f057e[_0x993e('0x41')]!=='VIRTUAL'){var _0x180ad4={};_0x180ad4[_0x4f057e['name']]={'$like':'%'+_0x2495b7[_0x993e('0x33')][_0x993e('0x3e')]+'%'};return _0x180ad4;}})});}_0x1f5d51=_[_0x993e('0x40')]({},_0x1f5d51,_0x2495b7[_0x993e('0x42')]);var _0x39424a={'where':_0x1f5d51[_0x993e('0x3f')]};return db[_0x993e('0x43')][_0x993e('0x20')](_0x39424a)['then'](function(_0xe64c){_0x2599ec['count']=_0xe64c;if(_0x2495b7['query'][_0x993e('0x44')]){_0x1f5d51[_0x993e('0x45')]=[{'all':!![]}];}return db[_0x993e('0x43')]['findAll'](_0x1f5d51);})[_0x993e('0x25')](function(_0x40719d){_0x2599ec[_0x993e('0x46')]=_0x40719d;return _0x2599ec;})['then'](respondWithFilteredResult(_0x9e0309,_0x1f5d51))['catch'](handleError(_0x9e0309,null));};exports['show']=function(_0x3f29c8,_0x1adb09){var _0x254f74={'raw':!![],'where':{'id':_0x3f29c8[_0x993e('0x47')]['id']}},_0x539c9d={};_0x539c9d[_0x993e('0x32')]=_['keys'](db[_0x993e('0x43')][_0x993e('0x2f')]);_0x539c9d['query']=_[_0x993e('0x34')](_0x3f29c8[_0x993e('0x33')]);_0x539c9d[_0x993e('0x35')]=_['intersection'](_0x539c9d['model'],_0x539c9d['query']);_0x254f74[_0x993e('0x38')]=_[_0x993e('0x36')](_0x539c9d[_0x993e('0x32')],qs[_0x993e('0x37')](_0x3f29c8['query'][_0x993e('0x37')]));_0x254f74[_0x993e('0x38')]=_0x254f74[_0x993e('0x38')][_0x993e('0x39')]?_0x254f74[_0x993e('0x38')]:_0x539c9d[_0x993e('0x32')];if(_0x3f29c8['query']['includeAll']){_0x254f74[_0x993e('0x45')]=[{'all':!![]}];}_0x254f74=_[_0x993e('0x40')]({},_0x254f74,_0x3f29c8['options']);return db['ContactItemType'][_0x993e('0x48')](_0x254f74)[_0x993e('0x25')](handleEntityNotFound(_0x1adb09,null))[_0x993e('0x25')](respondWithResult(_0x1adb09,null))[_0x993e('0x49')](handleError(_0x1adb09,null));};exports[_0x993e('0x4a')]=function(_0x256ce3,_0x5b18e3){return db[_0x993e('0x43')]['create'](_0x256ce3[_0x993e('0x4b')],{})[_0x993e('0x25')](function(_0x28cf3b){var _0x402e37=_0x256ce3[_0x993e('0x4c')][_0x993e('0x27')]({'plain':!![]});if(!_0x402e37)throw new Error(_0x993e('0x4d'));if(_0x402e37[_0x993e('0x4e')]==='user'){var _0x23f09c=_0x28cf3b[_0x993e('0x27')]({'plain':!![]});var _0x8b1516='ContactItemTypes';return db[_0x993e('0x4f')]['find']({'where':{'name':_0x8b1516,'userProfileId':_0x402e37[_0x993e('0x50')]},'raw':!![]})[_0x993e('0x25')](function(_0x5cd41a){if(_0x5cd41a&&_0x5cd41a[_0x993e('0x51')]===0x0){return db[_0x993e('0x29')]['create']({'name':_0x23f09c[_0x993e('0x2c')],'resourceId':_0x23f09c['id'],'type':_0x5cd41a[_0x993e('0x2c')],'sectionId':_0x5cd41a['id']},{})[_0x993e('0x25')](function(){return _0x28cf3b;});}else{return _0x28cf3b;}})[_0x993e('0x49')](function(_0x2e368e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e368e);throw _0x2e368e;});}return _0x28cf3b;})['then'](respondWithResult(_0x5b18e3,0xc9))[_0x993e('0x49')](handleError(_0x5b18e3,null));};exports[_0x993e('0x52')]=function(_0x42af4f,_0x2c3df7){if(_0x42af4f[_0x993e('0x4b')]['id']){delete _0x42af4f[_0x993e('0x4b')]['id'];}return db['ContactItemType'][_0x993e('0x48')]({'where':{'id':_0x42af4f[_0x993e('0x47')]['id']}})[_0x993e('0x25')](handleEntityNotFound(_0x2c3df7,null))['then'](saveUpdates(_0x42af4f[_0x993e('0x4b')],null))['then'](respondWithResult(_0x2c3df7,null))['catch'](handleError(_0x2c3df7,null));};exports[_0x993e('0x26')]=function(_0x37d7b1,_0x511641){return db[_0x993e('0x43')]['find']({'where':{'id':_0x37d7b1[_0x993e('0x47')]['id']}})[_0x993e('0x25')](handleEntityNotFound(_0x511641,null))['then'](db['CmContactHasItem'][_0x993e('0x52')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x37d7b1[_0x993e('0x47')]['id']}}))[_0x993e('0x25')](removeEntity(_0x511641,null))[_0x993e('0x49')](handleError(_0x511641,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 5ec50a1..57585df 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 _0x5e1f=['request-promise','path','rimraf','./contactItemType.attributes','define','ContactItemType','tools_contact_item_types','lodash','util','api','moment','bluebird'];(function(_0x2de385,_0xf61a82){var _0x132ac5=function(_0x3a3527){while(--_0x3a3527){_0x2de385['push'](_0x2de385['shift']());}};_0x132ac5(++_0xf61a82);}(_0x5e1f,0xbb));var _0xf5e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e1f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf5e1('0x0'));var util=require(_0xf5e1('0x1'));var logger=require('../../config/logger')(_0xf5e1('0x2'));var moment=require(_0xf5e1('0x3'));var BPromise=require(_0xf5e1('0x4'));var rp=require(_0xf5e1('0x5'));var fs=require('fs');var path=require(_0xf5e1('0x6'));var rimraf=require(_0xf5e1('0x7'));var config=require('../../config/environment');var attributes=require(_0xf5e1('0x8'));module['exports']=function(_0x1446f3,_0x46a1f2){return _0x1446f3[_0xf5e1('0x9')](_0xf5e1('0xa'),attributes,{'tableName':_0xf5e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe814=['exports','ContactItemType','tools_contact_item_types','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes'];(function(_0x5089ff,_0x254775){var _0x5de9ae=function(_0x553587){while(--_0x553587){_0x5089ff['push'](_0x5089ff['shift']());}};_0x5de9ae(++_0x254775);}(_0xe814,0x1ef));var _0x4e81=function(_0xb6ef46,_0x44e005){_0xb6ef46=_0xb6ef46-0x0;var _0x45653a=_0xe814[_0xb6ef46];return _0x45653a;};'use strict';var _=require(_0x4e81('0x0'));var util=require(_0x4e81('0x1'));var logger=require('../../config/logger')(_0x4e81('0x2'));var moment=require(_0x4e81('0x3'));var BPromise=require('bluebird');var rp=require(_0x4e81('0x4'));var fs=require('fs');var path=require(_0x4e81('0x5'));var rimraf=require(_0x4e81('0x6'));var config=require(_0x4e81('0x7'));var attributes=require(_0x4e81('0x8'));module[_0x4e81('0x9')]=function(_0x1f0846,_0x270d01){return _0x1f0846['define'](_0x4e81('0xa'),attributes,{'tableName':_0x4e81('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index a591332..74dc54b 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 _0xeeaf=['ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent'];(function(_0x60b6df,_0xcbc63d){var _0x58dcf1=function(_0x1d86e2){while(--_0x1d86e2){_0x60b6df['push'](_0x60b6df['shift']());}};_0x58dcf1(++_0xcbc63d);}(_0xeeaf,0x150));var _0xfeea=function(_0x29622f,_0x1ff1e3){_0x29622f=_0x29622f-0x0;var _0x3a4fb7=_0xeeaf[_0x29622f];return _0x3a4fb7;};'use strict';var _=require(_0xfeea('0x0'));var util=require('util');var moment=require(_0xfeea('0x1'));var BPromise=require(_0xfeea('0x2'));var rs=require(_0xfeea('0x3'));var fs=require('fs');var Redis=require(_0xfeea('0x4'));var db=require(_0xfeea('0x5'))['db'];var utils=require(_0xfeea('0x6'));var logger=require(_0xfeea('0x7'))(_0xfeea('0x8'));var config=require(_0xfeea('0x9'));var jayson=require(_0xfeea('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a18a8,_0x421507,_0x430d0e){return new BPromise(function(_0x325cf4,_0x313779){return client[_0xfeea('0xb')](_0x2a18a8,_0x430d0e)[_0xfeea('0xc')](function(_0x5aa010){logger[_0xfeea('0xd')](_0xfeea('0xe'),_0x421507,_0xfeea('0xf'));logger['debug'](_0xfeea('0x10'),_0x421507,'request\x20sent',JSON[_0xfeea('0x11')](_0x5aa010));if(_0x5aa010[_0xfeea('0x12')]){if(_0x5aa010[_0xfeea('0x12')][_0xfeea('0x13')]===0x1f4){logger['error'](_0xfeea('0xe'),_0x421507,_0x5aa010['error']['message']);return _0x313779(_0x5aa010[_0xfeea('0x12')][_0xfeea('0x14')]);}logger[_0xfeea('0x12')](_0xfeea('0xe'),_0x421507,_0x5aa010[_0xfeea('0x12')][_0xfeea('0x14')]);return _0x325cf4(_0x5aa010[_0xfeea('0x12')][_0xfeea('0x14')]);}else{logger[_0xfeea('0xd')](_0xfeea('0xe'),_0x421507,'request\x20sent');_0x325cf4(_0x5aa010['result'][_0xfeea('0x14')]);}})[_0xfeea('0x15')](function(_0x657ce8){logger[_0xfeea('0x12')](_0xfeea('0xe'),_0x421507,_0x657ce8);_0x313779(_0x657ce8);});});} \ No newline at end of file +var _0xbf1a=['ContactItemType,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xbf1a,0x16d));var _0xabf1=function(_0x10f95f,_0xe0a31b){_0x10f95f=_0x10f95f-0x0;var _0x191874=_0xbf1a[_0x10f95f];return _0x191874;};'use strict';var _=require(_0xabf1('0x0'));var util=require(_0xabf1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xabf1('0x2'));var fs=require('fs');var Redis=require(_0xabf1('0x3'));var db=require(_0xabf1('0x4'))['db'];var utils=require(_0xabf1('0x5'));var logger=require(_0xabf1('0x6'))(_0xabf1('0x7'));var config=require(_0xabf1('0x8'));var jayson=require(_0xabf1('0x9'));var client=jayson[_0xabf1('0xa')][_0xabf1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e5203,_0x4be08b,_0x1bf70e){return new BPromise(function(_0xcfec60,_0x48c89c){return client['request'](_0x2e5203,_0x1bf70e)[_0xabf1('0xc')](function(_0x2e36b6){logger['info'](_0xabf1('0xd'),_0x4be08b,'request\x20sent');logger[_0xabf1('0xe')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x4be08b,_0xabf1('0xf'),JSON['stringify'](_0x2e36b6));if(_0x2e36b6['error']){if(_0x2e36b6[_0xabf1('0x10')][_0xabf1('0x11')]===0x1f4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x4be08b,_0x2e36b6[_0xabf1('0x10')]['message']);return _0x48c89c(_0x2e36b6[_0xabf1('0x10')][_0xabf1('0x12')]);}logger[_0xabf1('0x10')](_0xabf1('0xd'),_0x4be08b,_0x2e36b6[_0xabf1('0x10')][_0xabf1('0x12')]);return _0xcfec60(_0x2e36b6['error']['message']);}else{logger['info'](_0xabf1('0xd'),_0x4be08b,_0xabf1('0xf'));_0xcfec60(_0x2e36b6[_0xabf1('0x13')][_0xabf1('0x12')]);}})[_0xabf1('0x14')](function(_0x53c76e){logger[_0xabf1('0x10')](_0xabf1('0xd'),_0x4be08b,_0x53c76e);_0x48c89c(_0x53c76e);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index baaf2e0..aed727b 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 _0xa7f5=['../../components/auth/service','../../components/interaction/service','./contactItemType.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7f5,0xb7));var _0x5a7f=function(_0x1ae885,_0x4e4b72){_0x1ae885=_0x1ae885-0x0;var _0x354a46=_0xa7f5[_0x1ae885];return _0x354a46;};'use strict';var multer=require(_0x5a7f('0x0'));var util=require(_0x5a7f('0x1'));var path=require(_0x5a7f('0x2'));var timeout=require(_0x5a7f('0x3'));var express=require(_0x5a7f('0x4'));var router=express[_0x5a7f('0x5')]();var fs_extra=require(_0x5a7f('0x6'));var auth=require(_0x5a7f('0x7'));var interaction=require(_0x5a7f('0x8'));var config=require('../../config/environment');var controller=require(_0x5a7f('0x9'));router['get']('/',auth[_0x5a7f('0xa')](),controller[_0x5a7f('0xb')]);router[_0x5a7f('0xc')](_0x5a7f('0xd'),auth[_0x5a7f('0xa')](),controller[_0x5a7f('0xe')]);router[_0x5a7f('0xf')]('/',auth[_0x5a7f('0xa')](),controller[_0x5a7f('0x10')]);router[_0x5a7f('0x11')](_0x5a7f('0xd'),auth[_0x5a7f('0xa')](),controller[_0x5a7f('0x12')]);router['delete'](_0x5a7f('0xd'),auth[_0x5a7f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf3d0=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','isAuthenticated','index','/:id','post','put','destroy'];(function(_0xc4dde7,_0x45b417){var _0x521532=function(_0x453ae5){while(--_0x453ae5){_0xc4dde7['push'](_0xc4dde7['shift']());}};_0x521532(++_0x45b417);}(_0xf3d0,0x97));var _0x0f3d=function(_0x9a7fb4,_0x104d70){_0x9a7fb4=_0x9a7fb4-0x0;var _0x4df2ab=_0xf3d0[_0x9a7fb4];return _0x4df2ab;};'use strict';var multer=require(_0x0f3d('0x0'));var util=require(_0x0f3d('0x1'));var path=require(_0x0f3d('0x2'));var timeout=require(_0x0f3d('0x3'));var express=require(_0x0f3d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0f3d('0x5'));var interaction=require(_0x0f3d('0x6'));var config=require('../../config/environment');var controller=require(_0x0f3d('0x7'));router['get']('/',auth[_0x0f3d('0x8')](),controller[_0x0f3d('0x9')]);router['get'](_0x0f3d('0xa'),auth[_0x0f3d('0x8')](),controller['show']);router[_0x0f3d('0xb')]('/',auth[_0x0f3d('0x8')](),controller['create']);router[_0x0f3d('0xc')]('/:id',auth[_0x0f3d('0x8')](),controller['update']);router['delete'](_0x0f3d('0xa'),auth[_0x0f3d('0x8')](),controller[_0x0f3d('0xd')]);module[_0x0f3d('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 71a35a9..f9a55bc 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 _0x2032=['name','exports','STRING'];(function(_0x5f126c,_0x3456cc){var _0x2660de=function(_0x5e0e61){while(--_0x5e0e61){_0x5f126c['push'](_0x5f126c['shift']());}};_0x2660de(++_0x3456cc);}(_0x2032,0xd9));var _0x2203=function(_0x332da4,_0x1b00a3){_0x332da4=_0x332da4-0x0;var _0xba5d6d=_0x2032[_0x332da4];return _0xba5d6d;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x43ec4a,_0x5e9548){var _0x1fd398=function(_0x1f1e09){while(--_0x1f1e09){_0x43ec4a['push'](_0x43ec4a['shift']());}};_0x1fd398(++_0x5e9548);}(_0x757a,0xde));var _0xa757=function(_0xb02ef9,_0x2157d7){_0xb02ef9=_0xb02ef9-0x0;var _0x115547=_0x757a[_0xb02ef9];return _0x115547;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index f938cec..95ec25c 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 _0x1e21=['defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','offset','limit','undefined','count','status','Content-Range','json','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','include','rows','catch','params','keys','includeAll','options','find','create','body','user','role','autoAssociation','createdAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x2af452,_0x4c7d2d){var _0x37cae6=function(_0x58e457){while(--_0x58e457){_0x2af452['push'](_0x2af452['shift']());}};_0x37cae6(++_0x4c7d2d);}(_0x1e21,0x67));var _0x11e2=function(_0x245744,_0x252b4b){_0x245744=_0x245744-0x0;var _0x1a4250=_0x1e21[_0x245744];return _0x1a4250;};'use strict';var emlformat=require(_0x11e2('0x0'));var rimraf=require(_0x11e2('0x1'));var zipdir=require(_0x11e2('0x2'));var jsonpatch=require(_0x11e2('0x3'));var rp=require('request-promise');var moment=require(_0x11e2('0x4'));var BPromise=require(_0x11e2('0x5'));var Mustache=require(_0x11e2('0x6'));var util=require('util');var path=require(_0x11e2('0x7'));var sox=require(_0x11e2('0x8'));var csv=require(_0x11e2('0x9'));var ejs=require(_0x11e2('0xa'));var fs=require('fs');var fs_extra=require(_0x11e2('0xb'));var _=require(_0x11e2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x11e2('0xd'));var toCsv=require(_0x11e2('0x9'));var querystring=require(_0x11e2('0xe'));var Papa=require(_0x11e2('0xf'));var Redis=require(_0x11e2('0x10'));var authService=require(_0x11e2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x11e2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11e2('0x13'))('api');var utils=require(_0x11e2('0x14'));var config=require(_0x11e2('0x15'));var licenseUtil=require(_0x11e2('0x16'));var db=require(_0x11e2('0x17'))['db'];config[_0x11e2('0x18')]=_[_0x11e2('0x19')](config[_0x11e2('0x18')],{'host':_0x11e2('0x1a'),'port':0x18eb});var socket=require(_0x11e2('0x1b'))(new Redis(config[_0x11e2('0x18')]));require(_0x11e2('0x1c'))[_0x11e2('0x1d')](socket);function respondWithStatusCode(_0x56db5e,_0x24092c){_0x24092c=_0x24092c||0xcc;return function(_0x2084b0){if(_0x2084b0){return _0x56db5e[_0x11e2('0x1e')](_0x24092c);}return _0x56db5e['status'](_0x24092c)[_0x11e2('0x1f')]();};}function respondWithResult(_0x283b17,_0x22c6c1){_0x22c6c1=_0x22c6c1||0xc8;return function(_0x41b50e){if(_0x41b50e){return _0x283b17['status'](_0x22c6c1)['json'](_0x41b50e);}};}function respondWithFilteredResult(_0x38b796,_0x32eeda){return function(_0x32ebda){if(_0x32ebda){var _0x459749=typeof _0x32eeda[_0x11e2('0x20')]==='undefined'&&typeof _0x32eeda[_0x11e2('0x21')]===_0x11e2('0x22');var _0xe3388c=_0x32ebda['count'];var _0x137df5=_0x459749?0x0:_0x32eeda[_0x11e2('0x20')];var _0x592c80=_0x459749?_0x32ebda[_0x11e2('0x23')]:_0x32eeda[_0x11e2('0x20')]+_0x32eeda[_0x11e2('0x21')];var _0x4baf5a;if(_0x592c80>=_0xe3388c){_0x592c80=_0xe3388c;_0x4baf5a=0xc8;}else{_0x4baf5a=0xce;}_0x38b796[_0x11e2('0x24')](_0x4baf5a);return _0x38b796['set'](_0x11e2('0x25'),_0x137df5+'-'+_0x592c80+'/'+_0xe3388c)[_0x11e2('0x26')](_0x32ebda);}return null;};}function patchUpdates(_0x39cacc){return function(_0x1876f6){try{jsonpatch[_0x11e2('0x27')](_0x1876f6,_0x39cacc,!![]);}catch(_0x9c2ea){return BPromise[_0x11e2('0x28')](_0x9c2ea);}return _0x1876f6[_0x11e2('0x29')]();};}function saveUpdates(_0x55e7a0,_0x21f239){return function(_0x1fdbbb){if(_0x1fdbbb){return _0x1fdbbb['update'](_0x55e7a0)[_0x11e2('0x2a')](function(_0x4c8feb){return _0x4c8feb;});}return null;};}function removeEntity(_0x1470e0,_0x21859a){return function(_0x38fc08){if(_0x38fc08){return _0x38fc08[_0x11e2('0x2b')]()['then'](function(){var _0x208985=_0x38fc08[_0x11e2('0x2c')]({'plain':!![]});var _0x19291d=_0x11e2('0x2d');return db[_0x11e2('0x2e')][_0x11e2('0x2b')]({'where':{'type':_0x19291d,'resourceId':_0x208985['id']}})[_0x11e2('0x2a')](function(){return _0x38fc08;});})[_0x11e2('0x2a')](function(){_0x1470e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42cbdd,_0x4290a5){return function(_0xa22bab){if(!_0xa22bab){_0x42cbdd[_0x11e2('0x1e')](0x194);}return _0xa22bab;};}function handleError(_0x1bc22d,_0x48ede6){_0x48ede6=_0x48ede6||0x1f4;return function(_0x4f4a01){logger[_0x11e2('0x2f')](_0x4f4a01[_0x11e2('0x30')]);if(_0x4f4a01[_0x11e2('0x31')]){delete _0x4f4a01['name'];}_0x1bc22d[_0x11e2('0x24')](_0x48ede6)['send'](_0x4f4a01);};}exports[_0x11e2('0x32')]=function(_0xb2df,_0x2fec64){var _0x5e52fb={},_0x5006b3={},_0x565eac={'count':0x0,'rows':[]};var _0x6973ae=_[_0x11e2('0x33')](db[_0x11e2('0x34')][_0x11e2('0x35')],function(_0x7bf072){return{'name':_0x7bf072[_0x11e2('0x36')],'type':_0x7bf072[_0x11e2('0x37')][_0x11e2('0x38')]};});_0x5006b3[_0x11e2('0x39')]=_[_0x11e2('0x33')](_0x6973ae,'name');_0x5006b3[_0x11e2('0x3a')]=_['keys'](_0xb2df[_0x11e2('0x3a')]);_0x5006b3[_0x11e2('0x3b')]=_[_0x11e2('0x3c')](_0x5006b3[_0x11e2('0x39')],_0x5006b3[_0x11e2('0x3a')]);_0x5e52fb[_0x11e2('0x3d')]=_[_0x11e2('0x3c')](_0x5006b3[_0x11e2('0x39')],qs[_0x11e2('0x3e')](_0xb2df[_0x11e2('0x3a')][_0x11e2('0x3e')]));_0x5e52fb[_0x11e2('0x3d')]=_0x5e52fb['attributes'][_0x11e2('0x3f')]?_0x5e52fb['attributes']:_0x5006b3[_0x11e2('0x39')];if(!_0xb2df[_0x11e2('0x3a')]['hasOwnProperty'](_0x11e2('0x40'))){_0x5e52fb[_0x11e2('0x21')]=qs['limit'](_0xb2df['query'][_0x11e2('0x21')]);_0x5e52fb[_0x11e2('0x20')]=qs['offset'](_0xb2df['query']['offset']);}_0x5e52fb[_0x11e2('0x41')]=qs[_0x11e2('0x42')](_0xb2df[_0x11e2('0x3a')][_0x11e2('0x42')]);_0x5e52fb[_0x11e2('0x43')]=qs[_0x11e2('0x3b')](_['pick'](_0xb2df[_0x11e2('0x3a')],_0x5006b3[_0x11e2('0x3b')]),_0x6973ae);if(_0xb2df[_0x11e2('0x3a')][_0x11e2('0x44')]){_0x5e52fb[_0x11e2('0x43')]=_['merge'](_0x5e52fb['where'],{'$or':_[_0x11e2('0x33')](_0x6973ae,function(_0x2750ce){if(_0x2750ce[_0x11e2('0x37')]!==_0x11e2('0x45')){var _0x127656={};_0x127656[_0x2750ce[_0x11e2('0x31')]]={'$like':'%'+_0xb2df[_0x11e2('0x3a')][_0x11e2('0x44')]+'%'};return _0x127656;}})});}_0x5e52fb=_[_0x11e2('0x46')]({},_0x5e52fb,_0xb2df['options']);var _0x25df22={'where':_0x5e52fb[_0x11e2('0x43')]};return db[_0x11e2('0x34')]['count'](_0x25df22)['then'](function(_0xec0b5c){_0x565eac['count']=_0xec0b5c;if(_0xb2df[_0x11e2('0x3a')]['includeAll']){_0x5e52fb[_0x11e2('0x47')]=[{'all':!![]}];}return db[_0x11e2('0x34')]['findAll'](_0x5e52fb);})[_0x11e2('0x2a')](function(_0x13cdf0){_0x565eac[_0x11e2('0x48')]=_0x13cdf0;return _0x565eac;})[_0x11e2('0x2a')](respondWithFilteredResult(_0x2fec64,_0x5e52fb))[_0x11e2('0x49')](handleError(_0x2fec64,null));};exports['show']=function(_0x5695ff,_0x2f0638){var _0x3404e7={'raw':![],'where':{'id':_0x5695ff[_0x11e2('0x4a')]['id']}},_0x478c10={};_0x478c10[_0x11e2('0x39')]=_['keys'](db[_0x11e2('0x34')]['rawAttributes']);_0x478c10[_0x11e2('0x3a')]=_[_0x11e2('0x4b')](_0x5695ff[_0x11e2('0x3a')]);_0x478c10[_0x11e2('0x3b')]=_[_0x11e2('0x3c')](_0x478c10[_0x11e2('0x39')],_0x478c10[_0x11e2('0x3a')]);_0x3404e7[_0x11e2('0x3d')]=_[_0x11e2('0x3c')](_0x478c10[_0x11e2('0x39')],qs[_0x11e2('0x3e')](_0x5695ff[_0x11e2('0x3a')][_0x11e2('0x3e')]));_0x3404e7[_0x11e2('0x3d')]=_0x3404e7[_0x11e2('0x3d')][_0x11e2('0x3f')]?_0x3404e7[_0x11e2('0x3d')]:_0x478c10[_0x11e2('0x39')];if(_0x5695ff[_0x11e2('0x3a')][_0x11e2('0x4c')]){_0x3404e7['include']=[{'all':!![]}];}_0x3404e7=_[_0x11e2('0x46')]({},_0x3404e7,_0x5695ff[_0x11e2('0x4d')]);return db[_0x11e2('0x34')][_0x11e2('0x4e')](_0x3404e7)[_0x11e2('0x2a')](handleEntityNotFound(_0x2f0638,null))[_0x11e2('0x2a')](respondWithResult(_0x2f0638,null))[_0x11e2('0x49')](handleError(_0x2f0638,null));};exports['create']=function(_0x2efefa,_0x55dc31){return db[_0x11e2('0x34')][_0x11e2('0x4f')](_0x2efefa[_0x11e2('0x50')],{})['then'](function(_0x395a24){var _0x115bd5=_0x2efefa[_0x11e2('0x51')][_0x11e2('0x2c')]({'plain':!![]});if(!_0x115bd5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x115bd5[_0x11e2('0x52')]===_0x11e2('0x51')){var _0x2cf1d5=_0x395a24[_0x11e2('0x2c')]({'plain':!![]});var _0x43884d=_0x11e2('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x43884d,'userProfileId':_0x115bd5['userProfileId']},'raw':!![]})['then'](function(_0x3d8157){if(_0x3d8157&&_0x3d8157[_0x11e2('0x53')]===0x0){return db[_0x11e2('0x2e')][_0x11e2('0x4f')]({'name':_0x2cf1d5['name'],'resourceId':_0x2cf1d5['id'],'type':_0x3d8157['name'],'sectionId':_0x3d8157['id']},{})['then'](function(){return _0x395a24;});}else{return _0x395a24;}})[_0x11e2('0x49')](function(_0x4b07a6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b07a6);throw _0x4b07a6;});}return _0x395a24;})[_0x11e2('0x2a')](respondWithResult(_0x55dc31,0xc9))[_0x11e2('0x49')](handleError(_0x55dc31,null));};exports['clone']=function(_0x662f5d,_0xee9ec4){var _0x20e141={'where':{'id':_0x662f5d[_0x11e2('0x4a')]['id']}},_0x38bf8b={};_0x38bf8b[_0x11e2('0x39')]=_['keys'](db[_0x11e2('0x34')][_0x11e2('0x35')]);_0x20e141[_0x11e2('0x3d')]=_['intersection'](_0x38bf8b[_0x11e2('0x39')],qs[_0x11e2('0x3e')](_0x662f5d[_0x11e2('0x3a')][_0x11e2('0x3e')]));_0x20e141[_0x11e2('0x3d')]=_0x20e141[_0x11e2('0x3d')][_0x11e2('0x3f')]?_0x20e141[_0x11e2('0x3d')]:_0x38bf8b[_0x11e2('0x39')];if(_0x662f5d[_0x11e2('0x3a')]['includeAll']){_0x20e141[_0x11e2('0x47')]=[{'all':!![]}];}_0x20e141=_[_0x11e2('0x46')]({},_0x20e141,_0x662f5d[_0x11e2('0x4d')]);return db['Dashboard']['find'](_0x20e141)['then'](handleEntityNotFound(_0xee9ec4,null))['then'](function(_0x14a024){if(_0x14a024){var _0x5ea64e=_0x14a024[_0x11e2('0x2c')]({'plain':!![]});_0x5ea64e=qs['omit'](_0x5ea64e,['id',_0x11e2('0x54'),'updatedAt']);_0x662f5d[_0x11e2('0x50')]=_[_0x11e2('0x55')](_0x662f5d[_0x11e2('0x50')],['id',_0x11e2('0x54'),'updatedAt']);return db[_0x11e2('0x34')][_0x11e2('0x4f')](_[_0x11e2('0x46')](_0x5ea64e,_0x662f5d[_0x11e2('0x50')]),{'include':_0x662f5d[_0x11e2('0x3a')][_0x11e2('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x3fa2f5){var _0x31bb22=_0x662f5d[_0x11e2('0x51')]['get']({'plain':!![]});if(!_0x31bb22)throw new Error(_0x11e2('0x56'));if(_0x31bb22[_0x11e2('0x52')]===_0x11e2('0x51')){var _0x4defd0=_0x3fa2f5['get']({'plain':!![]});var _0x383472=_0x11e2('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x383472,'userProfileId':_0x31bb22[_0x11e2('0x57')]},'raw':!![]})[_0x11e2('0x2a')](function(_0x5d6113){if(_0x5d6113&&_0x5d6113['autoAssociation']===0x0){return db[_0x11e2('0x2e')][_0x11e2('0x4f')]({'name':_0x4defd0[_0x11e2('0x31')],'resourceId':_0x4defd0['id'],'type':_0x5d6113[_0x11e2('0x31')],'sectionId':_0x5d6113['id']},{})[_0x11e2('0x2a')](function(){return _0x3fa2f5;});}else{return _0x3fa2f5;}})[_0x11e2('0x49')](function(_0x31fda6){logger[_0x11e2('0x2f')](_0x11e2('0x58'),_0x31fda6);throw _0x31fda6;});}return _0x3fa2f5;});}})['then'](respondWithResult(_0xee9ec4,0xc9))[_0x11e2('0x49')](handleError(_0xee9ec4,null));};exports[_0x11e2('0x59')]=function(_0x36c875,_0x264a84){if(_0x36c875['body']['id']){delete _0x36c875[_0x11e2('0x50')]['id'];}return db['Dashboard'][_0x11e2('0x4e')]({'where':{'id':_0x36c875[_0x11e2('0x4a')]['id']}})[_0x11e2('0x2a')](handleEntityNotFound(_0x264a84,null))['then'](saveUpdates(_0x36c875['body'],null))[_0x11e2('0x2a')](respondWithResult(_0x264a84,null))[_0x11e2('0x49')](handleError(_0x264a84,null));};exports['destroy']=function(_0xc8c2e1,_0x3eccb5){return db[_0x11e2('0x34')][_0x11e2('0x4e')]({'where':{'id':_0xc8c2e1[_0x11e2('0x4a')]['id']}})[_0x11e2('0x2a')](handleEntityNotFound(_0x3eccb5,null))['then'](removeEntity(_0x3eccb5,null))[_0x11e2('0x49')](handleError(_0x3eccb5,null));};function widgetAttributes(_0x3d16b2){try{switch(_0x3d16b2[_0x11e2('0x37')]){case _0x11e2('0x5a'):return[{'name':'attrUrl','value':_0x3d16b2[_0x11e2('0x5b')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2['attrs'][0x0]?_0x3d16b2[_0x11e2('0x5c')][0x0][_0x11e2('0x5d')]:undefined)||'https://'}];case _0x11e2('0x5e'):return[{'name':_0x11e2('0x5f'),'value':_0x3d16b2[_0x11e2('0x5f')]||(_0x3d16b2['attrs']&&_0x3d16b2[_0x11e2('0x5c')][0x0]?_0x3d16b2[_0x11e2('0x5c')][0x0][_0x11e2('0x5d')]:undefined)||''}];case _0x11e2('0x60'):return[{'name':_0x11e2('0x61'),'value':_0x3d16b2[_0x11e2('0x61')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x0]?_0x3d16b2['attrs'][0x0]['value']:undefined)||_0x11e2('0x62')},{'name':'attrTimezone','value':_0x3d16b2[_0x11e2('0x63')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x1]?_0x3d16b2[_0x11e2('0x5c')][0x1][_0x11e2('0x5d')]:undefined)||_0x11e2('0x64')},{'name':_0x11e2('0x65'),'value':_0x3d16b2['attrFontSize']||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x2]?_0x3d16b2[_0x11e2('0x5c')][0x2][_0x11e2('0x5d')]:undefined)||0xc}];case _0x11e2('0x66'):return[{'name':_0x11e2('0x67'),'value':_0x3d16b2[_0x11e2('0x67')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2['attrs'][0x0]?_0x3d16b2[_0x11e2('0x5c')][0x0]['value']:undefined)||_0x11e2('0x68')},{'name':'attrVoiceQueues','value':_0x3d16b2[_0x11e2('0x69')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x1]?_0x3d16b2[_0x11e2('0x5c')][0x1]['value']:undefined)||[]},{'name':_0x11e2('0x65'),'value':_0x3d16b2['attrFontSize']||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x2]?_0x3d16b2[_0x11e2('0x5c')][0x2][_0x11e2('0x5d')]:undefined)||0x14},{'name':_0x11e2('0x6a'),'value':_0x3d16b2[_0x11e2('0x6a')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2['attrs'][0x3]?_0x3d16b2[_0x11e2('0x5c')][0x3][_0x11e2('0x5d')]:undefined)||'voice'},{'name':_0x11e2('0x6b'),'value':_0x3d16b2[_0x11e2('0x6b')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2['attrs'][0x4]?_0x3d16b2['attrs'][0x4][_0x11e2('0x5d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3d16b2[_0x11e2('0x6c')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2['attrs'][0x5]?_0x3d16b2[_0x11e2('0x5c')][0x5][_0x11e2('0x5d')]:undefined)||''},{'name':_0x11e2('0x6d'),'value':_0x3d16b2['attrSmsAccounts']||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x6]?_0x3d16b2[_0x11e2('0x5c')][0x6][_0x11e2('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3d16b2[_0x11e2('0x6e')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x7]?_0x3d16b2[_0x11e2('0x5c')][0x7]['value']:undefined)||''},{'name':_0x11e2('0x6f'),'value':_0x3d16b2[_0x11e2('0x6f')]||(_0x3d16b2['attrs']&&_0x3d16b2['attrs'][0x8]?_0x3d16b2[_0x11e2('0x5c')][0x8][_0x11e2('0x5d')]:undefined)||''},{'name':_0x11e2('0x70'),'value':_0x3d16b2[_0x11e2('0x70')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x9]?_0x3d16b2['attrs'][0x9]['value']:undefined)||''}];case _0x11e2('0x71'):case'pie-chart':return[{'name':_0x11e2('0x72'),'value':_0x3d16b2['attrSerie1']||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x0]?_0x3d16b2[_0x11e2('0x5c')][0x0][_0x11e2('0x5d')]:undefined)||_0x11e2('0x68')},{'name':_0x11e2('0x73'),'value':_0x3d16b2[_0x11e2('0x73')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x1]?_0x3d16b2[_0x11e2('0x5c')][0x1]['value']:undefined)||null},{'name':_0x11e2('0x74'),'value':_0x3d16b2[_0x11e2('0x74')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x2]?_0x3d16b2['attrs'][0x2][_0x11e2('0x5d')]:undefined)||null},{'name':_0x11e2('0x69'),'value':_0x3d16b2[_0x11e2('0x69')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x3]?_0x3d16b2[_0x11e2('0x5c')][0x3]['value']:undefined)||[]},{'name':_0x11e2('0x6a'),'value':_0x3d16b2[_0x11e2('0x6a')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2['attrs'][0x4]?_0x3d16b2['attrs'][0x4][_0x11e2('0x5d')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x3d16b2[_0x11e2('0x6b')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2['attrs'][0x5]?_0x3d16b2['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x3d16b2['attrFaxAccounts']||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x6]?_0x3d16b2[_0x11e2('0x5c')][0x6][_0x11e2('0x5d')]:undefined)||''},{'name':_0x11e2('0x6d'),'value':_0x3d16b2['attrSmsAccounts']||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2['attrs'][0x7]?_0x3d16b2[_0x11e2('0x5c')][0x7][_0x11e2('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3d16b2[_0x11e2('0x6e')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x8]?_0x3d16b2[_0x11e2('0x5c')][0x8]['value']:undefined)||''},{'name':_0x11e2('0x6f'),'value':_0x3d16b2[_0x11e2('0x6f')]||(_0x3d16b2['attrs']&&_0x3d16b2['attrs'][0x9]?_0x3d16b2[_0x11e2('0x5c')][0x9][_0x11e2('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3d16b2[_0x11e2('0x70')]||(_0x3d16b2['attrs']&&_0x3d16b2['attrs'][0xa]?_0x3d16b2['attrs'][0xa][_0x11e2('0x5d')]:undefined)||''}];case _0x11e2('0x75'):return[{'name':_0x11e2('0x76'),'type':_0x3d16b2[_0x11e2('0x77')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x0]?_0x3d16b2['attrs'][0x0]['type']:undefined)||null,'value':_0x3d16b2['attrReport']||(_0x3d16b2['attrs']&&_0x3d16b2[_0x11e2('0x5c')][0x0]?_0x3d16b2[_0x11e2('0x5c')][0x0][_0x11e2('0x5d')]:undefined)||null},{'name':_0x11e2('0x78'),'value':_0x3d16b2[_0x11e2('0x78')]||(_0x3d16b2[_0x11e2('0x5c')]&&_0x3d16b2[_0x11e2('0x5c')][0x1]?_0x3d16b2[_0x11e2('0x5c')][0x1][_0x11e2('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x387ba9){logger[_0x11e2('0x2f')]('widgetAttributes:\x20%s',JSON[_0x11e2('0x79')](_0x387ba9));return[];}}exports[_0x11e2('0x7a')]=function(_0xc507f3,_0x71cb2b,_0x37872e){if(_0xc507f3[_0x11e2('0x50')]['id']){delete _0xc507f3[_0x11e2('0x50')]['id'];}return db[_0x11e2('0x34')]['find']({'where':{'id':_0xc507f3[_0x11e2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x71cb2b,null))[_0x11e2('0x2a')](function(_0x4fc093){if(_0x4fc093){_0xc507f3['body'][_0x11e2('0x7b')]=_0x4fc093['id'];_0xc507f3[_0x11e2('0x50')][_0x11e2('0x5c')]=widgetAttributes(_0xc507f3['body']);return db[_0x11e2('0x7c')][_0x11e2('0x4f')](_0xc507f3[_0x11e2('0x50')]);}})['then'](respondWithResult(_0x71cb2b,null))[_0x11e2('0x49')](handleError(_0x71cb2b,null));};exports[_0x11e2('0x7d')]=function(_0x4c902b,_0x3b120e,_0x380c8b){var _0x5a2675={};var _0x17fb53={};var _0x468818;var _0x1bf10c;return db[_0x11e2('0x34')][_0x11e2('0x7e')]({'where':{'id':_0x4c902b[_0x11e2('0x4a')]['id']}})[_0x11e2('0x2a')](handleEntityNotFound(_0x3b120e,null))[_0x11e2('0x2a')](function(_0x5e3568){if(_0x5e3568){_0x468818=_0x5e3568;_0x17fb53[_0x11e2('0x39')]=_['keys'](db[_0x11e2('0x7c')]['rawAttributes']);_0x17fb53[_0x11e2('0x3a')]=_['keys'](_0x4c902b[_0x11e2('0x3a')]);_0x17fb53[_0x11e2('0x3b')]=_['intersection'](_0x17fb53[_0x11e2('0x39')],_0x17fb53[_0x11e2('0x3a')]);_0x5a2675[_0x11e2('0x3d')]=_[_0x11e2('0x3c')](_0x17fb53[_0x11e2('0x39')],qs['fields'](_0x4c902b[_0x11e2('0x3a')][_0x11e2('0x3e')]));_0x5a2675[_0x11e2('0x3d')]=_0x5a2675[_0x11e2('0x3d')][_0x11e2('0x3f')]?_0x5a2675[_0x11e2('0x3d')]:_0x17fb53['model'];_0x5a2675['order']=qs[_0x11e2('0x42')](_0x4c902b[_0x11e2('0x3a')][_0x11e2('0x42')]);_0x5a2675[_0x11e2('0x43')]=qs[_0x11e2('0x3b')](_[_0x11e2('0x7f')](_0x4c902b['query'],_0x17fb53[_0x11e2('0x3b')]));if(_0x4c902b[_0x11e2('0x3a')][_0x11e2('0x44')]){_0x5a2675[_0x11e2('0x43')]=_[_0x11e2('0x46')](_0x5a2675[_0x11e2('0x43')],{'$or':_[_0x11e2('0x33')](_0x5a2675[_0x11e2('0x3d')],function(_0x5e5292){var _0x15ce91={};_0x15ce91[_0x5e5292]={'$like':'%'+_0x4c902b[_0x11e2('0x3a')]['filter']+'%'};return _0x15ce91;})});}_0x5a2675=_[_0x11e2('0x46')]({},_0x5a2675,_0x4c902b[_0x11e2('0x4d')]);return _0x468818['getItems'](_0x5a2675);}})[_0x11e2('0x2a')](function(_0x33eb98){if(_0x33eb98){_0x1bf10c=_0x33eb98[_0x11e2('0x3f')];if(!_0x4c902b[_0x11e2('0x3a')]['hasOwnProperty'](_0x11e2('0x40'))){_0x5a2675[_0x11e2('0x21')]=qs[_0x11e2('0x21')](_0x4c902b['query'][_0x11e2('0x21')]);_0x5a2675[_0x11e2('0x20')]=qs[_0x11e2('0x20')](_0x4c902b[_0x11e2('0x3a')]['offset']);}return _0x468818['getItems'](_0x5a2675);}})[_0x11e2('0x2a')](function(_0x4ca53e){if(_0x4ca53e){return _0x4ca53e?{'count':_0x1bf10c,'rows':_0x4ca53e}:null;}})['then'](respondWithResult(_0x3b120e,null))[_0x11e2('0x49')](handleError(_0x3b120e,null));}; \ No newline at end of file +var _0xdd17=['CustomDashboards','UserProfileResource','end','error','stack','name','status','send','map','Dashboard','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','updatedAt','body','createdAt','destroy','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','order','getItems','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','json','offset','undefined','limit','count','reject','save','update','then','get'];(function(_0x4660b9,_0x172664){var _0x3d0b6b=function(_0x3632e1){while(--_0x3632e1){_0x4660b9['push'](_0x4660b9['shift']());}};_0x3d0b6b(++_0x172664);}(_0xdd17,0xde));var _0x7dd1=function(_0x3fffb3,_0x140ea8){_0x3fffb3=_0x3fffb3-0x0;var _0x260f9a=_0xdd17[_0x3fffb3];return _0x260f9a;};'use strict';var emlformat=require(_0x7dd1('0x0'));var rimraf=require(_0x7dd1('0x1'));var zipdir=require(_0x7dd1('0x2'));var jsonpatch=require(_0x7dd1('0x3'));var rp=require(_0x7dd1('0x4'));var moment=require('moment');var BPromise=require(_0x7dd1('0x5'));var Mustache=require(_0x7dd1('0x6'));var util=require('util');var path=require(_0x7dd1('0x7'));var sox=require('sox');var csv=require(_0x7dd1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7dd1('0x9'));var _=require(_0x7dd1('0xa'));var squel=require(_0x7dd1('0xb'));var crypto=require(_0x7dd1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7dd1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7dd1('0xe'));var Papa=require(_0x7dd1('0xf'));var Redis=require(_0x7dd1('0x10'));var authService=require(_0x7dd1('0x11'));var qs=require(_0x7dd1('0x12'));var as=require(_0x7dd1('0x13'));var hardwareService=require(_0x7dd1('0x14'));var logger=require(_0x7dd1('0x15'))('api');var utils=require(_0x7dd1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7dd1('0x17'));var db=require(_0x7dd1('0x18'))['db'];config[_0x7dd1('0x19')]=_[_0x7dd1('0x1a')](config[_0x7dd1('0x19')],{'host':_0x7dd1('0x1b'),'port':0x18eb});var socket=require(_0x7dd1('0x1c'))(new Redis(config[_0x7dd1('0x19')]));require(_0x7dd1('0x1d'))[_0x7dd1('0x1e')](socket);function respondWithStatusCode(_0x5e41f0,_0x423dd5){_0x423dd5=_0x423dd5||0xcc;return function(_0x5e2e10){if(_0x5e2e10){return _0x5e41f0[_0x7dd1('0x1f')](_0x423dd5);}return _0x5e41f0['status'](_0x423dd5)['end']();};}function respondWithResult(_0x17c525,_0x17092d){_0x17092d=_0x17092d||0xc8;return function(_0x5173ea){if(_0x5173ea){return _0x17c525['status'](_0x17092d)[_0x7dd1('0x20')](_0x5173ea);}};}function respondWithFilteredResult(_0x52177e,_0x491754){return function(_0x4b879d){if(_0x4b879d){var _0x3befb4=typeof _0x491754[_0x7dd1('0x21')]===_0x7dd1('0x22')&&typeof _0x491754[_0x7dd1('0x23')]===_0x7dd1('0x22');var _0x52a97c=_0x4b879d['count'];var _0x1eb645=_0x3befb4?0x0:_0x491754['offset'];var _0x36bd1c=_0x3befb4?_0x4b879d[_0x7dd1('0x24')]:_0x491754[_0x7dd1('0x21')]+_0x491754[_0x7dd1('0x23')];var _0x269812;if(_0x36bd1c>=_0x52a97c){_0x36bd1c=_0x52a97c;_0x269812=0xc8;}else{_0x269812=0xce;}_0x52177e['status'](_0x269812);return _0x52177e['set']('Content-Range',_0x1eb645+'-'+_0x36bd1c+'/'+_0x52a97c)[_0x7dd1('0x20')](_0x4b879d);}return null;};}function patchUpdates(_0x26ddb7){return function(_0x4674f0){try{jsonpatch['apply'](_0x4674f0,_0x26ddb7,!![]);}catch(_0x24fb67){return BPromise[_0x7dd1('0x25')](_0x24fb67);}return _0x4674f0[_0x7dd1('0x26')]();};}function saveUpdates(_0x339c32,_0x4db164){return function(_0x2cf812){if(_0x2cf812){return _0x2cf812[_0x7dd1('0x27')](_0x339c32)[_0x7dd1('0x28')](function(_0x153d77){return _0x153d77;});}return null;};}function removeEntity(_0x59523d,_0xc516ce){return function(_0x1dd6e8){if(_0x1dd6e8){return _0x1dd6e8['destroy']()[_0x7dd1('0x28')](function(){var _0x527ebc=_0x1dd6e8[_0x7dd1('0x29')]({'plain':!![]});var _0x15b3c4=_0x7dd1('0x2a');return db[_0x7dd1('0x2b')]['destroy']({'where':{'type':_0x15b3c4,'resourceId':_0x527ebc['id']}})['then'](function(){return _0x1dd6e8;});})[_0x7dd1('0x28')](function(){_0x59523d['status'](0xcc)[_0x7dd1('0x2c')]();});}};}function handleEntityNotFound(_0x2c6c13,_0x1148c6){return function(_0x3ab6ef){if(!_0x3ab6ef){_0x2c6c13[_0x7dd1('0x1f')](0x194);}return _0x3ab6ef;};}function handleError(_0x1c42d8,_0x504bbc){_0x504bbc=_0x504bbc||0x1f4;return function(_0x170356){logger[_0x7dd1('0x2d')](_0x170356[_0x7dd1('0x2e')]);if(_0x170356[_0x7dd1('0x2f')]){delete _0x170356[_0x7dd1('0x2f')];}_0x1c42d8[_0x7dd1('0x30')](_0x504bbc)[_0x7dd1('0x31')](_0x170356);};}exports['index']=function(_0x5eaf2c,_0xb50bc7){var _0x22d8d6={},_0x3e9b29={},_0x466ac4={'count':0x0,'rows':[]};var _0x13713f=_[_0x7dd1('0x32')](db[_0x7dd1('0x33')][_0x7dd1('0x34')],function(_0x35c07a){return{'name':_0x35c07a['fieldName'],'type':_0x35c07a[_0x7dd1('0x35')][_0x7dd1('0x36')]};});_0x3e9b29[_0x7dd1('0x37')]=_[_0x7dd1('0x32')](_0x13713f,_0x7dd1('0x2f'));_0x3e9b29[_0x7dd1('0x38')]=_[_0x7dd1('0x39')](_0x5eaf2c[_0x7dd1('0x38')]);_0x3e9b29[_0x7dd1('0x3a')]=_[_0x7dd1('0x3b')](_0x3e9b29[_0x7dd1('0x37')],_0x3e9b29[_0x7dd1('0x38')]);_0x22d8d6[_0x7dd1('0x3c')]=_['intersection'](_0x3e9b29['model'],qs[_0x7dd1('0x3d')](_0x5eaf2c[_0x7dd1('0x38')][_0x7dd1('0x3d')]));_0x22d8d6[_0x7dd1('0x3c')]=_0x22d8d6[_0x7dd1('0x3c')][_0x7dd1('0x3e')]?_0x22d8d6[_0x7dd1('0x3c')]:_0x3e9b29[_0x7dd1('0x37')];if(!_0x5eaf2c[_0x7dd1('0x38')][_0x7dd1('0x3f')](_0x7dd1('0x40'))){_0x22d8d6[_0x7dd1('0x23')]=qs[_0x7dd1('0x23')](_0x5eaf2c[_0x7dd1('0x38')][_0x7dd1('0x23')]);_0x22d8d6[_0x7dd1('0x21')]=qs[_0x7dd1('0x21')](_0x5eaf2c[_0x7dd1('0x38')][_0x7dd1('0x21')]);}_0x22d8d6['order']=qs[_0x7dd1('0x41')](_0x5eaf2c[_0x7dd1('0x38')][_0x7dd1('0x41')]);_0x22d8d6[_0x7dd1('0x42')]=qs[_0x7dd1('0x3a')](_[_0x7dd1('0x43')](_0x5eaf2c[_0x7dd1('0x38')],_0x3e9b29[_0x7dd1('0x3a')]),_0x13713f);if(_0x5eaf2c[_0x7dd1('0x38')][_0x7dd1('0x44')]){_0x22d8d6['where']=_[_0x7dd1('0x45')](_0x22d8d6[_0x7dd1('0x42')],{'$or':_['map'](_0x13713f,function(_0x33d2d6){if(_0x33d2d6[_0x7dd1('0x35')]!=='VIRTUAL'){var _0x380ed6={};_0x380ed6[_0x33d2d6[_0x7dd1('0x2f')]]={'$like':'%'+_0x5eaf2c[_0x7dd1('0x38')][_0x7dd1('0x44')]+'%'};return _0x380ed6;}})});}_0x22d8d6=_['merge']({},_0x22d8d6,_0x5eaf2c[_0x7dd1('0x46')]);var _0x2e0ffe={'where':_0x22d8d6['where']};return db[_0x7dd1('0x33')]['count'](_0x2e0ffe)[_0x7dd1('0x28')](function(_0x29aad2){_0x466ac4[_0x7dd1('0x24')]=_0x29aad2;if(_0x5eaf2c['query'][_0x7dd1('0x47')]){_0x22d8d6[_0x7dd1('0x48')]=[{'all':!![]}];}return db[_0x7dd1('0x33')][_0x7dd1('0x49')](_0x22d8d6);})[_0x7dd1('0x28')](function(_0x5df076){_0x466ac4['rows']=_0x5df076;return _0x466ac4;})[_0x7dd1('0x28')](respondWithFilteredResult(_0xb50bc7,_0x22d8d6))[_0x7dd1('0x4a')](handleError(_0xb50bc7,null));};exports['show']=function(_0x3c0ac2,_0x6e9177){var _0x4bd440={'raw':![],'where':{'id':_0x3c0ac2[_0x7dd1('0x4b')]['id']}},_0x1ebdd8={};_0x1ebdd8[_0x7dd1('0x37')]=_[_0x7dd1('0x39')](db[_0x7dd1('0x33')][_0x7dd1('0x34')]);_0x1ebdd8[_0x7dd1('0x38')]=_[_0x7dd1('0x39')](_0x3c0ac2[_0x7dd1('0x38')]);_0x1ebdd8[_0x7dd1('0x3a')]=_[_0x7dd1('0x3b')](_0x1ebdd8[_0x7dd1('0x37')],_0x1ebdd8[_0x7dd1('0x38')]);_0x4bd440[_0x7dd1('0x3c')]=_[_0x7dd1('0x3b')](_0x1ebdd8[_0x7dd1('0x37')],qs[_0x7dd1('0x3d')](_0x3c0ac2[_0x7dd1('0x38')][_0x7dd1('0x3d')]));_0x4bd440[_0x7dd1('0x3c')]=_0x4bd440[_0x7dd1('0x3c')][_0x7dd1('0x3e')]?_0x4bd440['attributes']:_0x1ebdd8[_0x7dd1('0x37')];if(_0x3c0ac2[_0x7dd1('0x38')][_0x7dd1('0x47')]){_0x4bd440[_0x7dd1('0x48')]=[{'all':!![]}];}_0x4bd440=_[_0x7dd1('0x45')]({},_0x4bd440,_0x3c0ac2[_0x7dd1('0x46')]);return db['Dashboard']['find'](_0x4bd440)['then'](handleEntityNotFound(_0x6e9177,null))['then'](respondWithResult(_0x6e9177,null))[_0x7dd1('0x4a')](handleError(_0x6e9177,null));};exports[_0x7dd1('0x4c')]=function(_0x2d980f,_0x43ee70){return db[_0x7dd1('0x33')][_0x7dd1('0x4c')](_0x2d980f['body'],{})[_0x7dd1('0x28')](function(_0x3bd854){var _0x1aca6f=_0x2d980f[_0x7dd1('0x4d')]['get']({'plain':!![]});if(!_0x1aca6f)throw new Error(_0x7dd1('0x4e'));if(_0x1aca6f[_0x7dd1('0x4f')]===_0x7dd1('0x4d')){var _0x56cb03=_0x3bd854[_0x7dd1('0x29')]({'plain':!![]});var _0x592182=_0x7dd1('0x2a');return db[_0x7dd1('0x50')]['find']({'where':{'name':_0x592182,'userProfileId':_0x1aca6f[_0x7dd1('0x51')]},'raw':!![]})[_0x7dd1('0x28')](function(_0x27eb34){if(_0x27eb34&&_0x27eb34[_0x7dd1('0x52')]===0x0){return db[_0x7dd1('0x2b')][_0x7dd1('0x4c')]({'name':_0x56cb03[_0x7dd1('0x2f')],'resourceId':_0x56cb03['id'],'type':_0x27eb34[_0x7dd1('0x2f')],'sectionId':_0x27eb34['id']},{})[_0x7dd1('0x28')](function(){return _0x3bd854;});}else{return _0x3bd854;}})[_0x7dd1('0x4a')](function(_0x5d7887){logger[_0x7dd1('0x2d')](_0x7dd1('0x53'),_0x5d7887);throw _0x5d7887;});}return _0x3bd854;})[_0x7dd1('0x28')](respondWithResult(_0x43ee70,0xc9))[_0x7dd1('0x4a')](handleError(_0x43ee70,null));};exports[_0x7dd1('0x54')]=function(_0x2f94ef,_0x2c8d00){var _0x519411={'where':{'id':_0x2f94ef[_0x7dd1('0x4b')]['id']}},_0x38a62d={};_0x38a62d[_0x7dd1('0x37')]=_['keys'](db['Dashboard'][_0x7dd1('0x34')]);_0x519411[_0x7dd1('0x3c')]=_[_0x7dd1('0x3b')](_0x38a62d[_0x7dd1('0x37')],qs[_0x7dd1('0x3d')](_0x2f94ef['query']['fields']));_0x519411[_0x7dd1('0x3c')]=_0x519411[_0x7dd1('0x3c')][_0x7dd1('0x3e')]?_0x519411['attributes']:_0x38a62d[_0x7dd1('0x37')];if(_0x2f94ef[_0x7dd1('0x38')][_0x7dd1('0x47')]){_0x519411[_0x7dd1('0x48')]=[{'all':!![]}];}_0x519411=_['merge']({},_0x519411,_0x2f94ef[_0x7dd1('0x46')]);return db['Dashboard'][_0x7dd1('0x55')](_0x519411)[_0x7dd1('0x28')](handleEntityNotFound(_0x2c8d00,null))[_0x7dd1('0x28')](function(_0x4fc2f8){if(_0x4fc2f8){var _0x9f4086=_0x4fc2f8[_0x7dd1('0x29')]({'plain':!![]});_0x9f4086=qs[_0x7dd1('0x56')](_0x9f4086,['id','createdAt',_0x7dd1('0x57')]);_0x2f94ef[_0x7dd1('0x58')]=_[_0x7dd1('0x56')](_0x2f94ef[_0x7dd1('0x58')],['id',_0x7dd1('0x59'),_0x7dd1('0x57')]);return db[_0x7dd1('0x33')]['create'](_[_0x7dd1('0x45')](_0x9f4086,_0x2f94ef[_0x7dd1('0x58')]),{'include':_0x2f94ef['query'][_0x7dd1('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x4d408e){var _0x3f7648=_0x2f94ef[_0x7dd1('0x4d')][_0x7dd1('0x29')]({'plain':!![]});if(!_0x3f7648)throw new Error(_0x7dd1('0x4e'));if(_0x3f7648[_0x7dd1('0x4f')]==='user'){var _0xc6dd70=_0x4d408e[_0x7dd1('0x29')]({'plain':!![]});var _0x2e3b1f='CustomDashboards';return db[_0x7dd1('0x50')]['find']({'where':{'name':_0x2e3b1f,'userProfileId':_0x3f7648[_0x7dd1('0x51')]},'raw':!![]})['then'](function(_0x1da222){if(_0x1da222&&_0x1da222[_0x7dd1('0x52')]===0x0){return db[_0x7dd1('0x2b')]['create']({'name':_0xc6dd70[_0x7dd1('0x2f')],'resourceId':_0xc6dd70['id'],'type':_0x1da222[_0x7dd1('0x2f')],'sectionId':_0x1da222['id']},{})[_0x7dd1('0x28')](function(){return _0x4d408e;});}else{return _0x4d408e;}})[_0x7dd1('0x4a')](function(_0x4bfd4e){logger[_0x7dd1('0x2d')](_0x7dd1('0x53'),_0x4bfd4e);throw _0x4bfd4e;});}return _0x4d408e;});}})[_0x7dd1('0x28')](respondWithResult(_0x2c8d00,0xc9))[_0x7dd1('0x4a')](handleError(_0x2c8d00,null));};exports[_0x7dd1('0x27')]=function(_0x2ffe47,_0x5a7658){if(_0x2ffe47[_0x7dd1('0x58')]['id']){delete _0x2ffe47[_0x7dd1('0x58')]['id'];}return db['Dashboard'][_0x7dd1('0x55')]({'where':{'id':_0x2ffe47[_0x7dd1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7658,null))[_0x7dd1('0x28')](saveUpdates(_0x2ffe47[_0x7dd1('0x58')],null))[_0x7dd1('0x28')](respondWithResult(_0x5a7658,null))[_0x7dd1('0x4a')](handleError(_0x5a7658,null));};exports[_0x7dd1('0x5a')]=function(_0x1f1899,_0x1d2d93){return db[_0x7dd1('0x33')]['find']({'where':{'id':_0x1f1899[_0x7dd1('0x4b')]['id']}})[_0x7dd1('0x28')](handleEntityNotFound(_0x1d2d93,null))[_0x7dd1('0x28')](removeEntity(_0x1d2d93,null))[_0x7dd1('0x4a')](handleError(_0x1d2d93,null));};function widgetAttributes(_0x59d94a){try{switch(_0x59d94a[_0x7dd1('0x35')]){case _0x7dd1('0x5b'):return[{'name':_0x7dd1('0x5c'),'value':_0x59d94a['attrUrl']||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x0]?_0x59d94a[_0x7dd1('0x5d')][0x0][_0x7dd1('0x5e')]:undefined)||_0x7dd1('0x5f')}];case _0x7dd1('0x60'):return[{'name':'attrPath','value':_0x59d94a[_0x7dd1('0x61')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x0]?_0x59d94a['attrs'][0x0][_0x7dd1('0x5e')]:undefined)||''}];case'clock':return[{'name':_0x7dd1('0x62'),'value':_0x59d94a[_0x7dd1('0x62')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x0]?_0x59d94a[_0x7dd1('0x5d')][0x0][_0x7dd1('0x5e')]:undefined)||_0x7dd1('0x63')},{'name':_0x7dd1('0x64'),'value':_0x59d94a[_0x7dd1('0x64')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a['attrs'][0x1]?_0x59d94a[_0x7dd1('0x5d')][0x1]['value']:undefined)||_0x7dd1('0x65')},{'name':_0x7dd1('0x66'),'value':_0x59d94a[_0x7dd1('0x66')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x2]?_0x59d94a['attrs'][0x2]['value']:undefined)||0xc}];case _0x7dd1('0x67'):return[{'name':_0x7dd1('0x68'),'value':_0x59d94a[_0x7dd1('0x68')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x0]?_0x59d94a[_0x7dd1('0x5d')][0x0][_0x7dd1('0x5e')]:undefined)||_0x7dd1('0x69')},{'name':_0x7dd1('0x6a'),'value':_0x59d94a['attrVoiceQueues']||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x1]?_0x59d94a[_0x7dd1('0x5d')][0x1][_0x7dd1('0x5e')]:undefined)||[]},{'name':'attrFontSize','value':_0x59d94a['attrFontSize']||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x2]?_0x59d94a['attrs'][0x2][_0x7dd1('0x5e')]:undefined)||0x14},{'name':_0x7dd1('0x6b'),'value':_0x59d94a['attrChannel']||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x3]?_0x59d94a[_0x7dd1('0x5d')][0x3][_0x7dd1('0x5e')]:undefined)||_0x7dd1('0x6c')},{'name':_0x7dd1('0x6d'),'value':_0x59d94a[_0x7dd1('0x6d')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x4]?_0x59d94a['attrs'][0x4][_0x7dd1('0x5e')]:undefined)||''},{'name':_0x7dd1('0x6e'),'value':_0x59d94a[_0x7dd1('0x6e')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x5]?_0x59d94a['attrs'][0x5][_0x7dd1('0x5e')]:undefined)||''},{'name':_0x7dd1('0x6f'),'value':_0x59d94a[_0x7dd1('0x6f')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x6]?_0x59d94a[_0x7dd1('0x5d')][0x6][_0x7dd1('0x5e')]:undefined)||''},{'name':_0x7dd1('0x70'),'value':_0x59d94a['attrOpenchannelAccounts']||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x7]?_0x59d94a[_0x7dd1('0x5d')][0x7][_0x7dd1('0x5e')]:undefined)||''},{'name':_0x7dd1('0x71'),'value':_0x59d94a[_0x7dd1('0x71')]||(_0x59d94a['attrs']&&_0x59d94a[_0x7dd1('0x5d')][0x8]?_0x59d94a['attrs'][0x8][_0x7dd1('0x5e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x59d94a[_0x7dd1('0x72')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x9]?_0x59d94a[_0x7dd1('0x5d')][0x9][_0x7dd1('0x5e')]:undefined)||''}];case _0x7dd1('0x73'):case _0x7dd1('0x74'):return[{'name':_0x7dd1('0x75'),'value':_0x59d94a[_0x7dd1('0x75')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x0]?_0x59d94a[_0x7dd1('0x5d')][0x0]['value']:undefined)||_0x7dd1('0x69')},{'name':_0x7dd1('0x76'),'value':_0x59d94a[_0x7dd1('0x76')]||(_0x59d94a['attrs']&&_0x59d94a[_0x7dd1('0x5d')][0x1]?_0x59d94a['attrs'][0x1][_0x7dd1('0x5e')]:undefined)||null},{'name':_0x7dd1('0x77'),'value':_0x59d94a[_0x7dd1('0x77')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x2]?_0x59d94a[_0x7dd1('0x5d')][0x2][_0x7dd1('0x5e')]:undefined)||null},{'name':_0x7dd1('0x6a'),'value':_0x59d94a[_0x7dd1('0x6a')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x3]?_0x59d94a[_0x7dd1('0x5d')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x59d94a[_0x7dd1('0x6b')]||(_0x59d94a['attrs']&&_0x59d94a[_0x7dd1('0x5d')][0x4]?_0x59d94a[_0x7dd1('0x5d')][0x4]['value']:undefined)||_0x7dd1('0x6c')},{'name':_0x7dd1('0x6d'),'value':_0x59d94a[_0x7dd1('0x6d')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x5]?_0x59d94a[_0x7dd1('0x5d')][0x5][_0x7dd1('0x5e')]:undefined)||''},{'name':_0x7dd1('0x6e'),'value':_0x59d94a[_0x7dd1('0x6e')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x6]?_0x59d94a[_0x7dd1('0x5d')][0x6][_0x7dd1('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x59d94a[_0x7dd1('0x6f')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x7]?_0x59d94a[_0x7dd1('0x5d')][0x7][_0x7dd1('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x59d94a[_0x7dd1('0x70')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x8]?_0x59d94a['attrs'][0x8]['value']:undefined)||''},{'name':_0x7dd1('0x71'),'value':_0x59d94a[_0x7dd1('0x71')]||(_0x59d94a['attrs']&&_0x59d94a[_0x7dd1('0x5d')][0x9]?_0x59d94a[_0x7dd1('0x5d')][0x9][_0x7dd1('0x5e')]:undefined)||''},{'name':_0x7dd1('0x72'),'value':_0x59d94a[_0x7dd1('0x72')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0xa]?_0x59d94a[_0x7dd1('0x5d')][0xa][_0x7dd1('0x5e')]:undefined)||''}];case _0x7dd1('0x78'):return[{'name':_0x7dd1('0x79'),'type':_0x59d94a[_0x7dd1('0x7a')]||(_0x59d94a[_0x7dd1('0x5d')]&&_0x59d94a[_0x7dd1('0x5d')][0x0]?_0x59d94a[_0x7dd1('0x5d')][0x0][_0x7dd1('0x35')]:undefined)||null,'value':_0x59d94a[_0x7dd1('0x79')]||(_0x59d94a['attrs']&&_0x59d94a[_0x7dd1('0x5d')][0x0]?_0x59d94a['attrs'][0x0]['value']:undefined)||null},{'name':_0x7dd1('0x7b'),'value':_0x59d94a[_0x7dd1('0x7b')]||(_0x59d94a['attrs']&&_0x59d94a[_0x7dd1('0x5d')][0x1]?_0x59d94a[_0x7dd1('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4919fa){logger[_0x7dd1('0x2d')](_0x7dd1('0x7c'),JSON[_0x7dd1('0x7d')](_0x4919fa));return[];}}exports[_0x7dd1('0x7e')]=function(_0x536800,_0x32edde,_0x2ac1c1){if(_0x536800[_0x7dd1('0x58')]['id']){delete _0x536800[_0x7dd1('0x58')]['id'];}return db[_0x7dd1('0x33')]['find']({'where':{'id':_0x536800[_0x7dd1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x32edde,null))[_0x7dd1('0x28')](function(_0x217a3c){if(_0x217a3c){_0x536800[_0x7dd1('0x58')][_0x7dd1('0x7f')]=_0x217a3c['id'];_0x536800[_0x7dd1('0x58')][_0x7dd1('0x5d')]=widgetAttributes(_0x536800[_0x7dd1('0x58')]);return db[_0x7dd1('0x80')][_0x7dd1('0x4c')](_0x536800[_0x7dd1('0x58')]);}})[_0x7dd1('0x28')](respondWithResult(_0x32edde,null))[_0x7dd1('0x4a')](handleError(_0x32edde,null));};exports['getItems']=function(_0x3a441a,_0x361842,_0x1d2a76){var _0x5e494e={};var _0x204522={};var _0x4d3608;var _0x90b556;return db[_0x7dd1('0x33')][_0x7dd1('0x81')]({'where':{'id':_0x3a441a[_0x7dd1('0x4b')]['id']}})[_0x7dd1('0x28')](handleEntityNotFound(_0x361842,null))[_0x7dd1('0x28')](function(_0x179e33){if(_0x179e33){_0x4d3608=_0x179e33;_0x204522[_0x7dd1('0x37')]=_['keys'](db[_0x7dd1('0x80')][_0x7dd1('0x34')]);_0x204522[_0x7dd1('0x38')]=_['keys'](_0x3a441a[_0x7dd1('0x38')]);_0x204522[_0x7dd1('0x3a')]=_[_0x7dd1('0x3b')](_0x204522[_0x7dd1('0x37')],_0x204522[_0x7dd1('0x38')]);_0x5e494e[_0x7dd1('0x3c')]=_['intersection'](_0x204522[_0x7dd1('0x37')],qs[_0x7dd1('0x3d')](_0x3a441a[_0x7dd1('0x38')][_0x7dd1('0x3d')]));_0x5e494e[_0x7dd1('0x3c')]=_0x5e494e[_0x7dd1('0x3c')][_0x7dd1('0x3e')]?_0x5e494e[_0x7dd1('0x3c')]:_0x204522[_0x7dd1('0x37')];_0x5e494e[_0x7dd1('0x82')]=qs[_0x7dd1('0x41')](_0x3a441a[_0x7dd1('0x38')][_0x7dd1('0x41')]);_0x5e494e[_0x7dd1('0x42')]=qs[_0x7dd1('0x3a')](_['pick'](_0x3a441a[_0x7dd1('0x38')],_0x204522[_0x7dd1('0x3a')]));if(_0x3a441a[_0x7dd1('0x38')]['filter']){_0x5e494e['where']=_['merge'](_0x5e494e['where'],{'$or':_[_0x7dd1('0x32')](_0x5e494e[_0x7dd1('0x3c')],function(_0x49f216){var _0x414304={};_0x414304[_0x49f216]={'$like':'%'+_0x3a441a[_0x7dd1('0x38')][_0x7dd1('0x44')]+'%'};return _0x414304;})});}_0x5e494e=_[_0x7dd1('0x45')]({},_0x5e494e,_0x3a441a['options']);return _0x4d3608[_0x7dd1('0x83')](_0x5e494e);}})['then'](function(_0x1e7ee5){if(_0x1e7ee5){_0x90b556=_0x1e7ee5[_0x7dd1('0x3e')];if(!_0x3a441a[_0x7dd1('0x38')]['hasOwnProperty'](_0x7dd1('0x40'))){_0x5e494e[_0x7dd1('0x23')]=qs[_0x7dd1('0x23')](_0x3a441a[_0x7dd1('0x38')][_0x7dd1('0x23')]);_0x5e494e[_0x7dd1('0x21')]=qs[_0x7dd1('0x21')](_0x3a441a[_0x7dd1('0x38')][_0x7dd1('0x21')]);}return _0x4d3608[_0x7dd1('0x83')](_0x5e494e);}})[_0x7dd1('0x28')](function(_0x58e092){if(_0x58e092){return _0x58e092?{'count':_0x90b556,'rows':_0x58e092}:null;}})['then'](respondWithResult(_0x361842,null))[_0x7dd1('0x4a')](handleError(_0x361842,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index e10fd4a..b7a5daa 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 _0xef47=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2e8ddc,_0x5674a0){var _0x41401e=function(_0x1e2163){while(--_0x1e2163){_0x2e8ddc['push'](_0x2e8ddc['shift']());}};_0x41401e(++_0x5674a0);}(_0xef47,0x118));var _0x7ef4=function(_0x12692d,_0x295452){_0x12692d=_0x12692d-0x0;var _0x511390=_0xef47[_0x12692d];return _0x511390;};'use strict';var EventEmitter=require(_0x7ef4('0x0'));var Dashboard=require(_0x7ef4('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7ef4('0x2')](0x0);var events={'afterCreate':_0x7ef4('0x3'),'afterUpdate':_0x7ef4('0x4'),'afterDestroy':_0x7ef4('0x5')};function emitEvent(_0x33ff2a){return function(_0x2f586c,_0x35e009,_0x1846c2){DashboardEvents[_0x7ef4('0x6')](_0x33ff2a+':'+_0x2f586c['id'],_0x2f586c);DashboardEvents[_0x7ef4('0x6')](_0x33ff2a,_0x2f586c);_0x1846c2(null);};}for(var e in events){if(events[_0x7ef4('0x7')](e)){var event=events[e];Dashboard[_0x7ef4('0x8')](e,emitEvent(event));}}module[_0x7ef4('0x9')]=DashboardEvents; \ No newline at end of file +var _0xc64b=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc64b,0x7e));var _0xbc64=function(_0x1e11c2,_0x1bcbca){_0x1e11c2=_0x1e11c2-0x0;var _0x4faa44=_0xc64b[_0x1e11c2];return _0x4faa44;};'use strict';var EventEmitter=require(_0xbc64('0x0'));var Dashboard=require(_0xbc64('0x1'))['db'][_0xbc64('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xbc64('0x3')](0x0);var events={'afterCreate':_0xbc64('0x4'),'afterUpdate':_0xbc64('0x5'),'afterDestroy':_0xbc64('0x6')};function emitEvent(_0x5026bd){return function(_0x58d24b,_0x132518,_0x5422cb){DashboardEvents['emit'](_0x5026bd+':'+_0x58d24b['id'],_0x58d24b);DashboardEvents[_0xbc64('0x7')](_0x5026bd,_0x58d24b);_0x5422cb(null);};}for(var e in events){if(events[_0xbc64('0x8')](e)){var event=events[e];Dashboard[_0xbc64('0x9')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index c3c52d0..4323526 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 _0xe148=['path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','util','../../config/logger','api','moment'];(function(_0x5ef836,_0xf2906c){var _0x50fa55=function(_0x2609fd){while(--_0x2609fd){_0x5ef836['push'](_0x5ef836['shift']());}};_0x50fa55(++_0xf2906c);}(_0xe148,0x6a));var _0x8e14=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0xe148[_0x28fbe3];return _0x45db6a;};'use strict';var _=require('lodash');var util=require(_0x8e14('0x0'));var logger=require(_0x8e14('0x1'))(_0x8e14('0x2'));var moment=require(_0x8e14('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e14('0x4'));var rimraf=require(_0x8e14('0x5'));var config=require(_0x8e14('0x6'));var attributes=require(_0x8e14('0x7'));module[_0x8e14('0x8')]=function(_0x48f03a,_0x202be7){return _0x48f03a['define'](_0x8e14('0x9'),attributes,{'tableName':_0x8e14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74cf=['bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x3c8033,_0x18ad41){var _0x35f8f3=function(_0x568c09){while(--_0x568c09){_0x3c8033['push'](_0x3c8033['shift']());}};_0x35f8f3(++_0x18ad41);}(_0x74cf,0x126));var _0xf74c=function(_0x5049e1,_0x4ac87a){_0x5049e1=_0x5049e1-0x0;var _0x37f162=_0x74cf[_0x5049e1];return _0x37f162;};'use strict';var _=require(_0xf74c('0x0'));var util=require(_0xf74c('0x1'));var logger=require(_0xf74c('0x2'))(_0xf74c('0x3'));var moment=require(_0xf74c('0x4'));var BPromise=require(_0xf74c('0x5'));var rp=require(_0xf74c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf74c('0x7'));var config=require(_0xf74c('0x8'));var attributes=require(_0xf74c('0x9'));module[_0xf74c('0xa')]=function(_0x28945b,_0x36228f){return _0x28945b[_0xf74c('0xb')]('Dashboard',attributes,{'tableName':_0xf74c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 3b2bfa0..f634a69 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 _0x25c0=['redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','defaults'];(function(_0x5718cc,_0x48133f){var _0x5f328b=function(_0x362790){while(--_0x362790){_0x5718cc['push'](_0x5718cc['shift']());}};_0x5f328b(++_0x48133f);}(_0x25c0,0x93));var _0x025c=function(_0x2feda5,_0x3cfeba){_0x2feda5=_0x2feda5-0x0;var _0x57b7ad=_0x25c0[_0x2feda5];return _0x57b7ad;};'use strict';var _=require(_0x025c('0x0'));var util=require(_0x025c('0x1'));var moment=require(_0x025c('0x2'));var BPromise=require(_0x025c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x025c('0x4'));var db=require(_0x025c('0x5'))['db'];var utils=require(_0x025c('0x6'));var logger=require(_0x025c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x025c('0x8')](config[_0x025c('0x9')],{'host':_0x025c('0xa'),'port':0x18eb});var socket=require(_0x025c('0xb'))(new Redis(config[_0x025c('0x9')]));require(_0x025c('0xc'))[_0x025c('0xd')](socket);function respondWithRpcPromise(_0x395beb,_0x415b64,_0x12ca3b){return new BPromise(function(_0x2387d6,_0x347180){return client[_0x025c('0xe')](_0x395beb,_0x12ca3b)[_0x025c('0xf')](function(_0x16aaa7){logger[_0x025c('0x10')](_0x025c('0x11'),_0x415b64,'request\x20sent');logger['debug'](_0x025c('0x12'),_0x415b64,'request\x20sent',JSON[_0x025c('0x13')](_0x16aaa7));if(_0x16aaa7[_0x025c('0x14')]){if(_0x16aaa7[_0x025c('0x14')][_0x025c('0x15')]===0x1f4){logger[_0x025c('0x14')](_0x025c('0x11'),_0x415b64,_0x16aaa7[_0x025c('0x14')][_0x025c('0x16')]);return _0x347180(_0x16aaa7['error']['message']);}logger['error'](_0x025c('0x11'),_0x415b64,_0x16aaa7[_0x025c('0x14')][_0x025c('0x16')]);return _0x2387d6(_0x16aaa7[_0x025c('0x14')][_0x025c('0x16')]);}else{logger[_0x025c('0x10')](_0x025c('0x11'),_0x415b64,_0x025c('0x17'));_0x2387d6(_0x16aaa7[_0x025c('0x18')][_0x025c('0x16')]);}})[_0x025c('0x19')](function(_0x313130){logger[_0x025c('0x14')](_0x025c('0x11'),_0x415b64,_0x313130);_0x347180(_0x313130);});});} \ No newline at end of file +var _0x77e0=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x77e0,0x13d));var _0x077e=function(_0x2c0951,_0x3a4049){_0x2c0951=_0x2c0951-0x0;var _0x5b4b24=_0x77e0[_0x2c0951];return _0x5b4b24;};'use strict';var _=require(_0x077e('0x0'));var util=require(_0x077e('0x1'));var moment=require(_0x077e('0x2'));var BPromise=require(_0x077e('0x3'));var rs=require(_0x077e('0x4'));var fs=require('fs');var Redis=require(_0x077e('0x5'));var db=require(_0x077e('0x6'))['db'];var utils=require(_0x077e('0x7'));var logger=require(_0x077e('0x8'))(_0x077e('0x9'));var config=require('../../config/environment');var jayson=require(_0x077e('0xa'));var client=jayson['client'][_0x077e('0xb')]({'port':0x232a});config[_0x077e('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x077e('0xd'))(new Redis(config[_0x077e('0xc')]));require('./dashboard.socket')[_0x077e('0xe')](socket);function respondWithRpcPromise(_0x28cdca,_0x2dfea4,_0x2f89c4){return new BPromise(function(_0x41a779,_0x339914){return client['request'](_0x28cdca,_0x2f89c4)[_0x077e('0xf')](function(_0x39ff60){logger[_0x077e('0x10')](_0x077e('0x11'),_0x2dfea4,_0x077e('0x12'));logger[_0x077e('0x13')](_0x077e('0x14'),_0x2dfea4,'request\x20sent',JSON[_0x077e('0x15')](_0x39ff60));if(_0x39ff60[_0x077e('0x16')]){if(_0x39ff60['error']['code']===0x1f4){logger[_0x077e('0x16')]('Dashboard,\x20%s,\x20%s',_0x2dfea4,_0x39ff60['error'][_0x077e('0x17')]);return _0x339914(_0x39ff60[_0x077e('0x16')]['message']);}logger['error']('Dashboard,\x20%s,\x20%s',_0x2dfea4,_0x39ff60[_0x077e('0x16')][_0x077e('0x17')]);return _0x41a779(_0x39ff60[_0x077e('0x16')][_0x077e('0x17')]);}else{logger['info'](_0x077e('0x11'),_0x2dfea4,_0x077e('0x12'));_0x41a779(_0x39ff60[_0x077e('0x18')][_0x077e('0x17')]);}})[_0x077e('0x19')](function(_0x53a3d4){logger['error'](_0x077e('0x11'),_0x2dfea4,_0x53a3d4);_0x339914(_0x53a3d4);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 549c1f3..5c96988 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 _0xb126=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','length'];(function(_0x3ab8b8,_0x5833eb){var _0x4b1297=function(_0x11797d){while(--_0x11797d){_0x3ab8b8['push'](_0x3ab8b8['shift']());}};_0x4b1297(++_0x5833eb);}(_0xb126,0xf1));var _0x6b12=function(_0x391bf4,_0x3c2db5){_0x391bf4=_0x391bf4-0x0;var _0x5c07e4=_0xb126[_0x391bf4];return _0x5c07e4;};'use strict';var DashboardEvents=require(_0x6b12('0x0'));var events=[_0x6b12('0x1'),_0x6b12('0x2'),_0x6b12('0x3')];function createListener(_0x1e5051,_0x5316c1){return function(_0xebfb5f){_0x5316c1[_0x6b12('0x4')](_0x1e5051,_0xebfb5f);};}function removeListener(_0x144db9,_0xf9f6a7){return function(){DashboardEvents[_0x6b12('0x5')](_0x144db9,_0xf9f6a7);};}exports['register']=function(_0x1380d6){for(var _0x8fef0f=0x0,_0x2cae42=events[_0x6b12('0x6')];_0x8fef0f<_0x2cae42;_0x8fef0f++){var _0x2f64af=events[_0x8fef0f];var _0x2f08db=createListener(_0x6b12('0x7')+_0x2f64af,_0x1380d6);DashboardEvents['on'](_0x2f64af,_0x2f08db);}}; \ No newline at end of file +var _0xb9bc=['save','update','emit','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x864cd5,_0x10313b){var _0x1f1b99=function(_0x1d2fde){while(--_0x1d2fde){_0x864cd5['push'](_0x864cd5['shift']());}};_0x1f1b99(++_0x10313b);}(_0xb9bc,0x77));var _0xcb9b=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xb9bc[_0x725b8e];return _0x43ac45;};'use strict';var DashboardEvents=require(_0xcb9b('0x0'));var events=[_0xcb9b('0x1'),'remove',_0xcb9b('0x2')];function createListener(_0x17668b,_0x11f7ac){return function(_0x3f274c){_0x11f7ac[_0xcb9b('0x3')](_0x17668b,_0x3f274c);};}function removeListener(_0x4a4d65,_0x1d16b5){return function(){DashboardEvents[_0xcb9b('0x4')](_0x4a4d65,_0x1d16b5);};}exports[_0xcb9b('0x5')]=function(_0x137c97){for(var _0x15596f=0x0,_0x43a83c=events[_0xcb9b('0x6')];_0x15596f<_0x43a83c;_0x15596f++){var _0x21fefd=events[_0x15596f];var _0x39d607=createListener(_0xcb9b('0x7')+_0x21fefd,_0x137c97);DashboardEvents['on'](_0x21fefd,_0x39d607);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 45c81da..cd6b2d0 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 _0x2205=['../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','clone','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0x2205,0x130));var _0x5220=function(_0xa23504,_0x5218f1){_0xa23504=_0xa23504-0x0;var _0xa767ab=_0x2205[_0xa23504];return _0xa767ab;};'use strict';var multer=require(_0x5220('0x0'));var util=require(_0x5220('0x1'));var path=require(_0x5220('0x2'));var timeout=require(_0x5220('0x3'));var express=require(_0x5220('0x4'));var router=express[_0x5220('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5220('0x6'));var interaction=require(_0x5220('0x7'));var config=require(_0x5220('0x8'));var controller=require(_0x5220('0x9'));router[_0x5220('0xa')]('/',auth[_0x5220('0xb')](),controller[_0x5220('0xc')]);router['get'](_0x5220('0xd'),auth[_0x5220('0xb')](),controller[_0x5220('0xe')]);router['get'](_0x5220('0xf'),auth[_0x5220('0xb')](),controller[_0x5220('0x10')]);router[_0x5220('0x11')]('/',auth[_0x5220('0xb')](),controller[_0x5220('0x12')]);router[_0x5220('0x11')]('/:id/clone',auth[_0x5220('0xb')](),controller[_0x5220('0x13')]);router[_0x5220('0x11')](_0x5220('0xf'),auth[_0x5220('0xb')](),controller['addItem']);router[_0x5220('0x14')]('/:id',auth[_0x5220('0xb')](),controller['update']);router[_0x5220('0x15')](_0x5220('0xd'),auth[_0x5220('0xb')](),controller[_0x5220('0x16')]);module[_0x5220('0x17')]=router; \ No newline at end of file +var _0x1815=['index','/:id','show','/:id/items','getItems','post','addItem','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x1934fc,_0x437669){var _0x4c2de0=function(_0x89358c){while(--_0x89358c){_0x1934fc['push'](_0x1934fc['shift']());}};_0x4c2de0(++_0x437669);}(_0x1815,0x159));var _0x5181=function(_0xc2c13a,_0x1070d3){_0xc2c13a=_0xc2c13a-0x0;var _0x2b8e2f=_0x1815[_0xc2c13a];return _0x2b8e2f;};'use strict';var multer=require(_0x5181('0x0'));var util=require(_0x5181('0x1'));var path=require(_0x5181('0x2'));var timeout=require(_0x5181('0x3'));var express=require(_0x5181('0x4'));var router=express[_0x5181('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5181('0x6'));var interaction=require(_0x5181('0x7'));var config=require(_0x5181('0x8'));var controller=require(_0x5181('0x9'));router[_0x5181('0xa')]('/',auth[_0x5181('0xb')](),controller[_0x5181('0xc')]);router[_0x5181('0xa')](_0x5181('0xd'),auth['isAuthenticated'](),controller[_0x5181('0xe')]);router[_0x5181('0xa')](_0x5181('0xf'),auth['isAuthenticated'](),controller[_0x5181('0x10')]);router[_0x5181('0x11')]('/',auth[_0x5181('0xb')](),controller['create']);router[_0x5181('0x11')]('/:id/clone',auth[_0x5181('0xb')](),controller['clone']);router[_0x5181('0x11')](_0x5181('0xf'),auth[_0x5181('0xb')](),controller[_0x5181('0x12')]);router[_0x5181('0x13')](_0x5181('0xd'),auth[_0x5181('0xb')](),controller['update']);router['delete'](_0x5181('0xd'),auth[_0x5181('0xb')](),controller['destroy']);module[_0x5181('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 78e4385..2b92458 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 _0xeda8=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','#ffffff','sequelize','squel','exports','STRING'];(function(_0x15d748,_0x4bd8de){var _0x57ec7f=function(_0x4ceaee){while(--_0x4ceaee){_0x15d748['push'](_0x15d748['shift']());}};_0x57ec7f(++_0x4bd8de);}(_0xeda8,0x104));var _0x8eda=function(_0x8fd32d,_0x256448){_0x8fd32d=_0x8fd32d-0x0;var _0x28d495=_0xeda8[_0x8fd32d];return _0x28d495;};'use strict';var Sequelize=require(_0x8eda('0x0'));var squel=require(_0x8eda('0x1'));var _=require('lodash');module[_0x8eda('0x2')]={'title':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eda('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8eda('0x4')](_0x8eda('0x5')),'get':function(){try{return JSON[_0x8eda('0x6')](this[_0x8eda('0x7')](_0x8eda('0x8')));}catch(_0x22dee9){return[];}},'set':function(_0x1f3556){try{this[_0x8eda('0x9')](_0x8eda('0x8'),JSON['stringify'](_0x1f3556));}catch(_0x28b721){this[_0x8eda('0x9')](_0x8eda('0x8'),JSON[_0x8eda('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':_0x8eda('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eda('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x6d38=['INTEGER','STRING','#2196f3','squel','lodash','exports','TEXT','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0xa00aab,_0x5c5b7e){var _0x60ac36=function(_0x3e4fe4){while(--_0x3e4fe4){_0xa00aab['push'](_0xa00aab['shift']());}};_0x60ac36(++_0x5c5b7e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x86d3('0x0'));var _=require(_0x86d3('0x1'));module[_0x86d3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x86d3('0x3')]('long'),'get':function(){try{return JSON[_0x86d3('0x4')](this[_0x86d3('0x5')](_0x86d3('0x6')));}catch(_0x4ef557){return[];}},'set':function(_0x2d8272){try{this[_0x86d3('0x7')](_0x86d3('0x6'),JSON[_0x86d3('0x8')](_0x2d8272));}catch(_0x47e654){this['setDataValue'](_0x86d3('0x6'),JSON[_0x86d3('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x86d3('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x86d3('0x9')]},'background':{'type':Sequelize[_0x86d3('0xa')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86d3('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x86d3('0xa')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 9985de9..a9f6cdb 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 _0x1ffe=['end','stack','name','send','params','model','keys','DashboardItem','rawAttributes','filters','intersection','query','fields','attributes','length','includeAll','include','merge','options','find','catch','type','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','value','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy'];(function(_0x14495e,_0x489352){var _0x275a09=function(_0x137915){while(--_0x137915){_0x14495e['push'](_0x14495e['shift']());}};_0x275a09(++_0x489352);}(_0x1ffe,0xa5));var _0xe1ff=function(_0x541ecc,_0x3344d0){_0x541ecc=_0x541ecc-0x0;var _0x125151=_0x1ffe[_0x541ecc];return _0x125151;};'use strict';var emlformat=require(_0xe1ff('0x0'));var rimraf=require(_0xe1ff('0x1'));var zipdir=require(_0xe1ff('0x2'));var jsonpatch=require(_0xe1ff('0x3'));var rp=require(_0xe1ff('0x4'));var moment=require(_0xe1ff('0x5'));var BPromise=require(_0xe1ff('0x6'));var Mustache=require(_0xe1ff('0x7'));var util=require(_0xe1ff('0x8'));var path=require(_0xe1ff('0x9'));var sox=require(_0xe1ff('0xa'));var csv=require(_0xe1ff('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1ff('0xc'));var squel=require(_0xe1ff('0xd'));var crypto=require(_0xe1ff('0xe'));var jsforce=require(_0xe1ff('0xf'));var deskjs=require(_0xe1ff('0x10'));var toCsv=require(_0xe1ff('0xb'));var querystring=require(_0xe1ff('0x11'));var Papa=require(_0xe1ff('0x12'));var Redis=require(_0xe1ff('0x13'));var authService=require(_0xe1ff('0x14'));var qs=require(_0xe1ff('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1ff('0x16'));var logger=require(_0xe1ff('0x17'))(_0xe1ff('0x18'));var utils=require(_0xe1ff('0x19'));var config=require(_0xe1ff('0x1a'));var licenseUtil=require(_0xe1ff('0x1b'));var db=require(_0xe1ff('0x1c'))['db'];config[_0xe1ff('0x1d')]=_[_0xe1ff('0x1e')](config[_0xe1ff('0x1d')],{'host':_0xe1ff('0x1f'),'port':0x18eb});var socket=require(_0xe1ff('0x20'))(new Redis(config['redis']));require(_0xe1ff('0x21'))[_0xe1ff('0x22')](socket);function respondWithStatusCode(_0x26511f,_0x486942){_0x486942=_0x486942||0xcc;return function(_0x15ca4b){if(_0x15ca4b){return _0x26511f[_0xe1ff('0x23')](_0x486942);}return _0x26511f['status'](_0x486942)['end']();};}function respondWithResult(_0x5a9d67,_0x207234){_0x207234=_0x207234||0xc8;return function(_0x217f4d){if(_0x217f4d){return _0x5a9d67[_0xe1ff('0x24')](_0x207234)[_0xe1ff('0x25')](_0x217f4d);}};}function respondWithFilteredResult(_0x45c3be,_0x29de7f){return function(_0x588ec4){if(_0x588ec4){var _0x5ebfe7=typeof _0x29de7f[_0xe1ff('0x26')]===_0xe1ff('0x27')&&typeof _0x29de7f[_0xe1ff('0x28')]===_0xe1ff('0x27');var _0x5c4ffc=_0x588ec4[_0xe1ff('0x29')];var _0x223b2c=_0x5ebfe7?0x0:_0x29de7f[_0xe1ff('0x26')];var _0x354b43=_0x5ebfe7?_0x588ec4[_0xe1ff('0x29')]:_0x29de7f[_0xe1ff('0x26')]+_0x29de7f[_0xe1ff('0x28')];var _0x110a9e;if(_0x354b43>=_0x5c4ffc){_0x354b43=_0x5c4ffc;_0x110a9e=0xc8;}else{_0x110a9e=0xce;}_0x45c3be[_0xe1ff('0x24')](_0x110a9e);return _0x45c3be[_0xe1ff('0x2a')](_0xe1ff('0x2b'),_0x223b2c+'-'+_0x354b43+'/'+_0x5c4ffc)[_0xe1ff('0x25')](_0x588ec4);}return null;};}function patchUpdates(_0x186f6c){return function(_0xb8fc93){try{jsonpatch[_0xe1ff('0x2c')](_0xb8fc93,_0x186f6c,!![]);}catch(_0x1afc5d){return BPromise[_0xe1ff('0x2d')](_0x1afc5d);}return _0xb8fc93[_0xe1ff('0x2e')]();};}function saveUpdates(_0x3ee7f4,_0x2fb25e){return function(_0x1f1b3f){if(_0x1f1b3f){return _0x1f1b3f['update'](_0x3ee7f4)[_0xe1ff('0x2f')](function(_0x440c83){return _0x440c83;});}return null;};}function removeEntity(_0x3f4024,_0x1ff27e){return function(_0x58c146){if(_0x58c146){return _0x58c146[_0xe1ff('0x30')]()[_0xe1ff('0x2f')](function(){_0x3f4024['status'](0xcc)[_0xe1ff('0x31')]();});}};}function handleEntityNotFound(_0x2546c9,_0x328192){return function(_0x21f6e0){if(!_0x21f6e0){_0x2546c9[_0xe1ff('0x23')](0x194);}return _0x21f6e0;};}function handleError(_0x45babb,_0x473b4a){_0x473b4a=_0x473b4a||0x1f4;return function(_0x24eacf){logger['error'](_0x24eacf[_0xe1ff('0x32')]);if(_0x24eacf[_0xe1ff('0x33')]){delete _0x24eacf[_0xe1ff('0x33')];}_0x45babb[_0xe1ff('0x24')](_0x473b4a)[_0xe1ff('0x34')](_0x24eacf);};}exports['show']=function(_0x28cc90,_0x3acd63){var _0x315a56={'raw':![],'where':{'id':_0x28cc90[_0xe1ff('0x35')]['id']}},_0x362008={};_0x362008[_0xe1ff('0x36')]=_[_0xe1ff('0x37')](db[_0xe1ff('0x38')][_0xe1ff('0x39')]);_0x362008['query']=_[_0xe1ff('0x37')](_0x28cc90['query']);_0x362008[_0xe1ff('0x3a')]=_[_0xe1ff('0x3b')](_0x362008[_0xe1ff('0x36')],_0x362008[_0xe1ff('0x3c')]);_0x315a56['attributes']=_[_0xe1ff('0x3b')](_0x362008['model'],qs[_0xe1ff('0x3d')](_0x28cc90[_0xe1ff('0x3c')][_0xe1ff('0x3d')]));_0x315a56[_0xe1ff('0x3e')]=_0x315a56[_0xe1ff('0x3e')][_0xe1ff('0x3f')]?_0x315a56[_0xe1ff('0x3e')]:_0x362008[_0xe1ff('0x36')];if(_0x28cc90[_0xe1ff('0x3c')][_0xe1ff('0x40')]){_0x315a56[_0xe1ff('0x41')]=[{'all':!![]}];}_0x315a56=_[_0xe1ff('0x42')]({},_0x315a56,_0x28cc90[_0xe1ff('0x43')]);return db[_0xe1ff('0x38')]['find'](_0x315a56)[_0xe1ff('0x2f')](handleEntityNotFound(_0x3acd63,null))[_0xe1ff('0x2f')](respondWithResult(_0x3acd63,null))['catch'](handleError(_0x3acd63,null));};exports[_0xe1ff('0x30')]=function(_0x1366ed,_0x1c0cd8){return db[_0xe1ff('0x38')][_0xe1ff('0x44')]({'where':{'id':_0x1366ed[_0xe1ff('0x35')]['id']}})[_0xe1ff('0x2f')](handleEntityNotFound(_0x1c0cd8,null))[_0xe1ff('0x2f')](removeEntity(_0x1c0cd8,null))[_0xe1ff('0x45')](handleError(_0x1c0cd8,null));};function widgetAttributes(_0x58634c){try{switch(_0x58634c[_0xe1ff('0x46')]){case'iframe':return[{'name':'attrUrl','value':_0x58634c[_0xe1ff('0x47')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x0]?_0x58634c[_0xe1ff('0x48')][0x0]['value']:undefined)||_0xe1ff('0x49')}];case _0xe1ff('0x4a'):return[{'name':_0xe1ff('0x4b'),'value':_0x58634c[_0xe1ff('0x4b')]||(_0x58634c['attrs']&&_0x58634c[_0xe1ff('0x48')][0x0]?_0x58634c[_0xe1ff('0x48')][0x0]['value']:undefined)||''}];case _0xe1ff('0x4c'):return[{'name':_0xe1ff('0x4d'),'value':_0x58634c['attrHourFormat']||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x0]?_0x58634c['attrs'][0x0][_0xe1ff('0x4e')]:undefined)||'HH:mm:ss'},{'name':_0xe1ff('0x4f'),'value':_0x58634c[_0xe1ff('0x4f')]||(_0x58634c['attrs']&&_0x58634c['attrs'][0x1]?_0x58634c[_0xe1ff('0x48')][0x1][_0xe1ff('0x4e')]:undefined)||'0.00'},{'name':_0xe1ff('0x50'),'value':_0x58634c[_0xe1ff('0x50')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x2]?_0x58634c[_0xe1ff('0x48')][0x2]['value']:undefined)||0xc}];case _0xe1ff('0x51'):return[{'name':_0xe1ff('0x52'),'value':_0x58634c[_0xe1ff('0x52')]||(_0x58634c['attrs']&&_0x58634c[_0xe1ff('0x48')][0x0]?_0x58634c['attrs'][0x0][_0xe1ff('0x4e')]:undefined)||_0xe1ff('0x53')},{'name':'attrVoiceQueues','value':_0x58634c[_0xe1ff('0x54')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x1]?_0x58634c[_0xe1ff('0x48')][0x1][_0xe1ff('0x4e')]:undefined)||[]},{'name':_0xe1ff('0x50'),'value':_0x58634c['attrFontSize']||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x2]?_0x58634c[_0xe1ff('0x48')][0x2][_0xe1ff('0x4e')]:undefined)||0x14},{'name':_0xe1ff('0x55'),'value':_0x58634c['attrChannel']||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x3]?_0x58634c[_0xe1ff('0x48')][0x3][_0xe1ff('0x4e')]:undefined)||_0xe1ff('0x56')},{'name':_0xe1ff('0x57'),'value':_0x58634c[_0xe1ff('0x57')]||(_0x58634c['attrs']&&_0x58634c[_0xe1ff('0x48')][0x4]?_0x58634c[_0xe1ff('0x48')][0x4][_0xe1ff('0x4e')]:undefined)||''},{'name':_0xe1ff('0x58'),'value':_0x58634c[_0xe1ff('0x58')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x5]?_0x58634c[_0xe1ff('0x48')][0x5][_0xe1ff('0x4e')]:undefined)||''},{'name':_0xe1ff('0x59'),'value':_0x58634c[_0xe1ff('0x59')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x6]?_0x58634c['attrs'][0x6][_0xe1ff('0x4e')]:undefined)||''},{'name':_0xe1ff('0x5a'),'value':_0x58634c[_0xe1ff('0x5a')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x7]?_0x58634c['attrs'][0x7][_0xe1ff('0x4e')]:undefined)||''},{'name':_0xe1ff('0x5b'),'value':_0x58634c['attrWhatsappAccounts']||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c['attrs'][0x8]?_0x58634c[_0xe1ff('0x48')][0x8]['value']:undefined)||''},{'name':_0xe1ff('0x5c'),'value':_0x58634c[_0xe1ff('0x5c')]||(_0x58634c['attrs']&&_0x58634c[_0xe1ff('0x48')][0x9]?_0x58634c[_0xe1ff('0x48')][0x9][_0xe1ff('0x4e')]:undefined)||''}];case _0xe1ff('0x5d'):case _0xe1ff('0x5e'):return[{'name':_0xe1ff('0x5f'),'value':_0x58634c['attrSerie1']||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x0]?_0x58634c['attrs'][0x0][_0xe1ff('0x4e')]:undefined)||_0xe1ff('0x53')},{'name':_0xe1ff('0x60'),'value':_0x58634c[_0xe1ff('0x60')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x1]?_0x58634c['attrs'][0x1][_0xe1ff('0x4e')]:undefined)||null},{'name':'attrSerie3','value':_0x58634c[_0xe1ff('0x61')]||(_0x58634c['attrs']&&_0x58634c[_0xe1ff('0x48')][0x2]?_0x58634c[_0xe1ff('0x48')][0x2][_0xe1ff('0x4e')]:undefined)||null},{'name':_0xe1ff('0x54'),'value':_0x58634c[_0xe1ff('0x54')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x3]?_0x58634c[_0xe1ff('0x48')][0x3][_0xe1ff('0x4e')]:undefined)||[]},{'name':'attrChannel','value':_0x58634c['attrChannel']||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x4]?_0x58634c[_0xe1ff('0x48')][0x4]['value']:undefined)||_0xe1ff('0x56')},{'name':'attrEmailAccounts','value':_0x58634c[_0xe1ff('0x57')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x5]?_0x58634c[_0xe1ff('0x48')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x58634c[_0xe1ff('0x58')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x6]?_0x58634c[_0xe1ff('0x48')][0x6][_0xe1ff('0x4e')]:undefined)||''},{'name':_0xe1ff('0x59'),'value':_0x58634c[_0xe1ff('0x59')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c['attrs'][0x7]?_0x58634c[_0xe1ff('0x48')][0x7]['value']:undefined)||''},{'name':_0xe1ff('0x5a'),'value':_0x58634c[_0xe1ff('0x5a')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x8]?_0x58634c['attrs'][0x8][_0xe1ff('0x4e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x58634c['attrWhatsappAccounts']||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c['attrs'][0x9]?_0x58634c[_0xe1ff('0x48')][0x9][_0xe1ff('0x4e')]:undefined)||''},{'name':_0xe1ff('0x5c'),'value':_0x58634c[_0xe1ff('0x5c')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0xa]?_0x58634c[_0xe1ff('0x48')][0xa]['value']:undefined)||''}];case _0xe1ff('0x62'):return[{'name':'attrReport','type':_0x58634c[_0xe1ff('0x63')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x0]?_0x58634c[_0xe1ff('0x48')][0x0][_0xe1ff('0x46')]:undefined)||null,'value':_0x58634c[_0xe1ff('0x64')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x0]?_0x58634c[_0xe1ff('0x48')][0x0][_0xe1ff('0x4e')]:undefined)||null},{'name':'attrRefresh','value':_0x58634c[_0xe1ff('0x65')]||(_0x58634c[_0xe1ff('0x48')]&&_0x58634c[_0xe1ff('0x48')][0x1]?_0x58634c[_0xe1ff('0x48')][0x1][_0xe1ff('0x4e')]:undefined)||0x0}];default:return[];}}catch(_0x134727){logger[_0xe1ff('0x66')](_0xe1ff('0x67'),JSON[_0xe1ff('0x68')](_0x134727));return[];}}exports[_0xe1ff('0x69')]=function(_0xbde8cc,_0x8773b6){if(_0xbde8cc[_0xe1ff('0x6a')]){_0xbde8cc[_0xe1ff('0x6a')]['attrs']=widgetAttributes(_0xbde8cc[_0xe1ff('0x6a')]);}return db[_0xe1ff('0x38')][_0xe1ff('0x69')](_0xbde8cc['body'],{})['then'](respondWithResult(_0x8773b6,0xc9))[_0xe1ff('0x45')](handleError(_0x8773b6,null));};exports['update']=function(_0x3a9e36,_0x2292dc){if(_0x3a9e36[_0xe1ff('0x6a')]['id']){delete _0x3a9e36[_0xe1ff('0x6a')]['id'];}_0x3a9e36[_0xe1ff('0x6a')][_0xe1ff('0x48')]=widgetAttributes(_0x3a9e36[_0xe1ff('0x6a')]);return db[_0xe1ff('0x38')][_0xe1ff('0x44')]({'where':{'id':_0x3a9e36[_0xe1ff('0x35')]['id']}})[_0xe1ff('0x2f')](handleEntityNotFound(_0x2292dc,null))['then'](saveUpdates(_0x3a9e36[_0xe1ff('0x6a')],null))[_0xe1ff('0x2f')](respondWithResult(_0x2292dc,null))[_0xe1ff('0x45')](handleError(_0x2292dc,null));}; \ No newline at end of file +var _0x12e9=['web-report','attrReport','reportType','attrRefresh','stringify','create','body','catch','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','limit','count','set','reject','update','then','sendStatus','error','name','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','destroy','type','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts'];(function(_0x434ab9,_0x2c3eef){var _0x2ca0d9=function(_0x1bf939){while(--_0x1bf939){_0x434ab9['push'](_0x434ab9['shift']());}};_0x2ca0d9(++_0x2c3eef);}(_0x12e9,0x66));var _0x912e=function(_0x13a373,_0x229e7d){_0x13a373=_0x13a373-0x0;var _0x116ccb=_0x12e9[_0x13a373];return _0x116ccb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x912e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x912e('0x1'));var moment=require(_0x912e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x912e('0x3'));var util=require(_0x912e('0x4'));var path=require('path');var sox=require(_0x912e('0x5'));var csv=require(_0x912e('0x6'));var ejs=require(_0x912e('0x7'));var fs=require('fs');var fs_extra=require(_0x912e('0x8'));var _=require('lodash');var squel=require(_0x912e('0x9'));var crypto=require(_0x912e('0xa'));var jsforce=require(_0x912e('0xb'));var deskjs=require(_0x912e('0xc'));var toCsv=require(_0x912e('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x912e('0xd'));var qs=require(_0x912e('0xe'));var as=require(_0x912e('0xf'));var hardwareService=require(_0x912e('0x10'));var logger=require(_0x912e('0x11'))('api');var utils=require(_0x912e('0x12'));var config=require(_0x912e('0x13'));var licenseUtil=require(_0x912e('0x14'));var db=require(_0x912e('0x15'))['db'];config[_0x912e('0x16')]=_[_0x912e('0x17')](config[_0x912e('0x16')],{'host':_0x912e('0x18'),'port':0x18eb});var socket=require(_0x912e('0x19'))(new Redis(config[_0x912e('0x16')]));require(_0x912e('0x1a'))[_0x912e('0x1b')](socket);function respondWithStatusCode(_0x536c1b,_0x3a02aa){_0x3a02aa=_0x3a02aa||0xcc;return function(_0x4e0c4d){if(_0x4e0c4d){return _0x536c1b['sendStatus'](_0x3a02aa);}return _0x536c1b[_0x912e('0x1c')](_0x3a02aa)[_0x912e('0x1d')]();};}function respondWithResult(_0x19eed4,_0x5c44b1){_0x5c44b1=_0x5c44b1||0xc8;return function(_0x572179){if(_0x572179){return _0x19eed4[_0x912e('0x1c')](_0x5c44b1)[_0x912e('0x1e')](_0x572179);}};}function respondWithFilteredResult(_0x265614,_0x54860e){return function(_0x36fb67){if(_0x36fb67){var _0x100790=typeof _0x54860e[_0x912e('0x1f')]===_0x912e('0x20')&&typeof _0x54860e[_0x912e('0x21')]==='undefined';var _0x1f3ab0=_0x36fb67[_0x912e('0x22')];var _0x2dd441=_0x100790?0x0:_0x54860e[_0x912e('0x1f')];var _0x2f9d2f=_0x100790?_0x36fb67[_0x912e('0x22')]:_0x54860e[_0x912e('0x1f')]+_0x54860e[_0x912e('0x21')];var _0x271e00;if(_0x2f9d2f>=_0x1f3ab0){_0x2f9d2f=_0x1f3ab0;_0x271e00=0xc8;}else{_0x271e00=0xce;}_0x265614[_0x912e('0x1c')](_0x271e00);return _0x265614[_0x912e('0x23')]('Content-Range',_0x2dd441+'-'+_0x2f9d2f+'/'+_0x1f3ab0)[_0x912e('0x1e')](_0x36fb67);}return null;};}function patchUpdates(_0x4f1a6f){return function(_0x46f935){try{jsonpatch['apply'](_0x46f935,_0x4f1a6f,!![]);}catch(_0x3817a9){return BPromise[_0x912e('0x24')](_0x3817a9);}return _0x46f935['save']();};}function saveUpdates(_0x28497d,_0x1e59d8){return function(_0x892de0){if(_0x892de0){return _0x892de0[_0x912e('0x25')](_0x28497d)[_0x912e('0x26')](function(_0x5ba003){return _0x5ba003;});}return null;};}function removeEntity(_0x92f64d,_0x27c6f6){return function(_0x4636ce){if(_0x4636ce){return _0x4636ce['destroy']()[_0x912e('0x26')](function(){_0x92f64d['status'](0xcc)[_0x912e('0x1d')]();});}};}function handleEntityNotFound(_0x1c4ab6,_0xe48a67){return function(_0x3c6a2a){if(!_0x3c6a2a){_0x1c4ab6[_0x912e('0x27')](0x194);}return _0x3c6a2a;};}function handleError(_0x5267ef,_0x1f9ad4){_0x1f9ad4=_0x1f9ad4||0x1f4;return function(_0x12150f){logger[_0x912e('0x28')](_0x12150f['stack']);if(_0x12150f[_0x912e('0x29')]){delete _0x12150f['name'];}_0x5267ef['status'](_0x1f9ad4)['send'](_0x12150f);};}exports[_0x912e('0x2a')]=function(_0x58b9cf,_0x4cbb33){var _0x58d575={'raw':![],'where':{'id':_0x58b9cf[_0x912e('0x2b')]['id']}},_0x3f61a2={};_0x3f61a2[_0x912e('0x2c')]=_[_0x912e('0x2d')](db[_0x912e('0x2e')][_0x912e('0x2f')]);_0x3f61a2[_0x912e('0x30')]=_[_0x912e('0x2d')](_0x58b9cf[_0x912e('0x30')]);_0x3f61a2[_0x912e('0x31')]=_[_0x912e('0x32')](_0x3f61a2[_0x912e('0x2c')],_0x3f61a2[_0x912e('0x30')]);_0x58d575['attributes']=_['intersection'](_0x3f61a2[_0x912e('0x2c')],qs['fields'](_0x58b9cf[_0x912e('0x30')][_0x912e('0x33')]));_0x58d575[_0x912e('0x34')]=_0x58d575[_0x912e('0x34')][_0x912e('0x35')]?_0x58d575[_0x912e('0x34')]:_0x3f61a2[_0x912e('0x2c')];if(_0x58b9cf[_0x912e('0x30')][_0x912e('0x36')]){_0x58d575[_0x912e('0x37')]=[{'all':!![]}];}_0x58d575=_['merge']({},_0x58d575,_0x58b9cf[_0x912e('0x38')]);return db[_0x912e('0x2e')][_0x912e('0x39')](_0x58d575)[_0x912e('0x26')](handleEntityNotFound(_0x4cbb33,null))[_0x912e('0x26')](respondWithResult(_0x4cbb33,null))['catch'](handleError(_0x4cbb33,null));};exports[_0x912e('0x3a')]=function(_0x56a159,_0x3e716f){return db[_0x912e('0x2e')][_0x912e('0x39')]({'where':{'id':_0x56a159['params']['id']}})[_0x912e('0x26')](handleEntityNotFound(_0x3e716f,null))[_0x912e('0x26')](removeEntity(_0x3e716f,null))['catch'](handleError(_0x3e716f,null));};function widgetAttributes(_0x33b61d){try{switch(_0x33b61d[_0x912e('0x3b')]){case'iframe':return[{'name':_0x912e('0x3c'),'value':_0x33b61d[_0x912e('0x3c')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d['attrs'][0x0][_0x912e('0x3e')]:undefined)||'https://'}];case'custom':return[{'name':_0x912e('0x3f'),'value':_0x33b61d[_0x912e('0x3f')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d[_0x912e('0x3d')][0x0][_0x912e('0x3e')]:undefined)||''}];case _0x912e('0x40'):return[{'name':_0x912e('0x41'),'value':_0x33b61d[_0x912e('0x41')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d[_0x912e('0x3d')][0x0][_0x912e('0x3e')]:undefined)||_0x912e('0x42')},{'name':_0x912e('0x43'),'value':_0x33b61d[_0x912e('0x43')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x1]?_0x33b61d[_0x912e('0x3d')][0x1][_0x912e('0x3e')]:undefined)||_0x912e('0x44')},{'name':_0x912e('0x45'),'value':_0x33b61d[_0x912e('0x45')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x2]?_0x33b61d[_0x912e('0x3d')][0x2]['value']:undefined)||0xc}];case _0x912e('0x46'):return[{'name':_0x912e('0x47'),'value':_0x33b61d['attrMetric']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x0]?_0x33b61d['attrs'][0x0]['value']:undefined)||_0x912e('0x48')},{'name':_0x912e('0x49'),'value':_0x33b61d[_0x912e('0x49')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x1]?_0x33b61d[_0x912e('0x3d')][0x1][_0x912e('0x3e')]:undefined)||[]},{'name':'attrFontSize','value':_0x33b61d[_0x912e('0x45')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x2]?_0x33b61d['attrs'][0x2][_0x912e('0x3e')]:undefined)||0x14},{'name':_0x912e('0x4a'),'value':_0x33b61d[_0x912e('0x4a')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x3]?_0x33b61d[_0x912e('0x3d')][0x3][_0x912e('0x3e')]:undefined)||_0x912e('0x4b')},{'name':_0x912e('0x4c'),'value':_0x33b61d[_0x912e('0x4c')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x4]?_0x33b61d[_0x912e('0x3d')][0x4][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4d'),'value':_0x33b61d[_0x912e('0x4d')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x5]?_0x33b61d[_0x912e('0x3d')][0x5][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4e'),'value':_0x33b61d[_0x912e('0x4e')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x6]?_0x33b61d[_0x912e('0x3d')][0x6][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4f'),'value':_0x33b61d[_0x912e('0x4f')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x7]?_0x33b61d[_0x912e('0x3d')][0x7][_0x912e('0x3e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x33b61d['attrWhatsappAccounts']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x8]?_0x33b61d[_0x912e('0x3d')][0x8][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x50'),'value':_0x33b61d[_0x912e('0x50')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x9]?_0x33b61d[_0x912e('0x3d')][0x9][_0x912e('0x3e')]:undefined)||''}];case _0x912e('0x51'):case'pie-chart':return[{'name':_0x912e('0x52'),'value':_0x33b61d['attrSerie1']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d['attrs'][0x0][_0x912e('0x3e')]:undefined)||_0x912e('0x48')},{'name':_0x912e('0x53'),'value':_0x33b61d['attrSerie2']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x1]?_0x33b61d[_0x912e('0x3d')][0x1]['value']:undefined)||null},{'name':_0x912e('0x54'),'value':_0x33b61d['attrSerie3']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x2]?_0x33b61d[_0x912e('0x3d')][0x2]['value']:undefined)||null},{'name':_0x912e('0x49'),'value':_0x33b61d[_0x912e('0x49')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x3]?_0x33b61d['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x33b61d[_0x912e('0x4a')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x4]?_0x33b61d[_0x912e('0x3d')][0x4]['value']:undefined)||_0x912e('0x4b')},{'name':'attrEmailAccounts','value':_0x33b61d[_0x912e('0x4c')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x5]?_0x33b61d[_0x912e('0x3d')][0x5][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4d'),'value':_0x33b61d[_0x912e('0x4d')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x6]?_0x33b61d[_0x912e('0x3d')][0x6][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4e'),'value':_0x33b61d[_0x912e('0x4e')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x7]?_0x33b61d[_0x912e('0x3d')][0x7]['value']:undefined)||''},{'name':_0x912e('0x4f'),'value':_0x33b61d[_0x912e('0x4f')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x8]?_0x33b61d[_0x912e('0x3d')][0x8][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x55'),'value':_0x33b61d['attrWhatsappAccounts']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x9]?_0x33b61d[_0x912e('0x3d')][0x9][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x50'),'value':_0x33b61d[_0x912e('0x50')]||(_0x33b61d['attrs']&&_0x33b61d['attrs'][0xa]?_0x33b61d[_0x912e('0x3d')][0xa][_0x912e('0x3e')]:undefined)||''}];case _0x912e('0x56'):return[{'name':_0x912e('0x57'),'type':_0x33b61d[_0x912e('0x58')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d[_0x912e('0x3d')][0x0][_0x912e('0x3b')]:undefined)||null,'value':_0x33b61d['attrReport']||(_0x33b61d['attrs']&&_0x33b61d['attrs'][0x0]?_0x33b61d[_0x912e('0x3d')][0x0][_0x912e('0x3e')]:undefined)||null},{'name':_0x912e('0x59'),'value':_0x33b61d[_0x912e('0x59')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x1]?_0x33b61d[_0x912e('0x3d')][0x1][_0x912e('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x404788){logger[_0x912e('0x28')]('widgetAttributes:\x20%s',JSON[_0x912e('0x5a')](_0x404788));return[];}}exports[_0x912e('0x5b')]=function(_0x5ddf2d,_0x474d70){if(_0x5ddf2d[_0x912e('0x5c')]){_0x5ddf2d[_0x912e('0x5c')]['attrs']=widgetAttributes(_0x5ddf2d['body']);}return db['DashboardItem'][_0x912e('0x5b')](_0x5ddf2d[_0x912e('0x5c')],{})[_0x912e('0x26')](respondWithResult(_0x474d70,0xc9))[_0x912e('0x5d')](handleError(_0x474d70,null));};exports[_0x912e('0x25')]=function(_0x14a397,_0x461f83){if(_0x14a397[_0x912e('0x5c')]['id']){delete _0x14a397['body']['id'];}_0x14a397['body'][_0x912e('0x3d')]=widgetAttributes(_0x14a397[_0x912e('0x5c')]);return db[_0x912e('0x2e')][_0x912e('0x39')]({'where':{'id':_0x14a397[_0x912e('0x2b')]['id']}})[_0x912e('0x26')](handleEntityNotFound(_0x461f83,null))[_0x912e('0x26')](saveUpdates(_0x14a397[_0x912e('0x5c')],null))[_0x912e('0x26')](respondWithResult(_0x461f83,null))[_0x912e('0x5d')](handleError(_0x461f83,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a51cb67..38f463e 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 _0x0b17=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hook','exports'];(function(_0x27f595,_0x5b3145){var _0x116f52=function(_0x2c49b7){while(--_0x2c49b7){_0x27f595['push'](_0x27f595['shift']());}};_0x116f52(++_0x5b3145);}(_0x0b17,0xb4));var _0x70b1=function(_0xcba81,_0x2d4fe8){_0xcba81=_0xcba81-0x0;var _0x2f4468=_0x0b17[_0xcba81];return _0x2f4468;};'use strict';var EventEmitter=require(_0x70b1('0x0'));var DashboardItem=require(_0x70b1('0x1'))['db'][_0x70b1('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x70b1('0x3')](0x0);var events={'afterCreate':_0x70b1('0x4'),'afterUpdate':_0x70b1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5339e4){return function(_0x11dad7,_0x777865,_0x4c9c9c){DashboardItemEvents[_0x70b1('0x6')](_0x5339e4+':'+_0x11dad7['id'],_0x11dad7);DashboardItemEvents[_0x70b1('0x6')](_0x5339e4,_0x11dad7);_0x4c9c9c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x70b1('0x7')](e,emitEvent(event));}}module[_0x70b1('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x40df=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x3ec0d7,_0x1f80c1){var _0x2accad=function(_0x190cf4){while(--_0x190cf4){_0x3ec0d7['push'](_0x3ec0d7['shift']());}};_0x2accad(++_0x1f80c1);}(_0x40df,0x1c9));var _0xf40d=function(_0xbe4b45,_0x5079fa){_0xbe4b45=_0xbe4b45-0x0;var _0x399116=_0x40df[_0xbe4b45];return _0x399116;};'use strict';var EventEmitter=require(_0xf40d('0x0'));var DashboardItem=require(_0xf40d('0x1'))['db'][_0xf40d('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf40d('0x3')](0x0);var events={'afterCreate':_0xf40d('0x4'),'afterUpdate':_0xf40d('0x5'),'afterDestroy':_0xf40d('0x6')};function emitEvent(_0x11021f){return function(_0x5e95b0,_0x2dcf74,_0x34240f){DashboardItemEvents[_0xf40d('0x7')](_0x11021f+':'+_0x5e95b0['id'],_0x5e95b0);DashboardItemEvents[_0xf40d('0x7')](_0x11021f,_0x5e95b0);_0x34240f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xf40d('0x8')](e,emitEvent(event));}}module[_0xf40d('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b09feef..3d87b38 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 _0x3768=['rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util','api','moment','bluebird','request-promise','path'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x3768,0x10e));var _0x8376=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x3768[_0x5d1044];return _0x3cd90e;};'use strict';var _=require('lodash');var util=require(_0x8376('0x0'));var logger=require('../../config/logger')(_0x8376('0x1'));var moment=require(_0x8376('0x2'));var BPromise=require(_0x8376('0x3'));var rp=require(_0x8376('0x4'));var fs=require('fs');var path=require(_0x8376('0x5'));var rimraf=require(_0x8376('0x6'));var config=require(_0x8376('0x7'));var attributes=require(_0x8376('0x8'));module[_0x8376('0x9')]=function(_0xe47048,_0x5b778c){return _0xe47048[_0x8376('0xa')](_0x8376('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07b1=['bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','../../config/logger','api','moment'];(function(_0x34c6a3,_0x3e1a91){var _0x58fcda=function(_0x104547){while(--_0x104547){_0x34c6a3['push'](_0x34c6a3['shift']());}};_0x58fcda(++_0x3e1a91);}(_0x07b1,0x1a9));var _0x107b=function(_0x137b26,_0x176e50){_0x137b26=_0x137b26-0x0;var _0x353d0b=_0x07b1[_0x137b26];return _0x353d0b;};'use strict';var _=require(_0x107b('0x0'));var util=require('util');var logger=require(_0x107b('0x1'))(_0x107b('0x2'));var moment=require(_0x107b('0x3'));var BPromise=require(_0x107b('0x4'));var rp=require(_0x107b('0x5'));var fs=require('fs');var path=require(_0x107b('0x6'));var rimraf=require(_0x107b('0x7'));var config=require('../../config/environment');var attributes=require(_0x107b('0x8'));module[_0x107b('0x9')]=function(_0x506ef3,_0x57f44f){return _0x506ef3[_0x107b('0xa')](_0x107b('0xb'),attributes,{'tableName':_0x107b('0xc'),'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 e310c47..ea538a6 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 _0xc7ce=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4341e7,_0x5b0585){var _0x56c7d7=function(_0x59612a){while(--_0x59612a){_0x4341e7['push'](_0x4341e7['shift']());}};_0x56c7d7(++_0x5b0585);}(_0xc7ce,0x170));var _0xec7c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xc7ce[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xec7c('0x0'));var util=require(_0xec7c('0x1'));var moment=require(_0xec7c('0x2'));var BPromise=require(_0xec7c('0x3'));var rs=require(_0xec7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec7c('0x5'))['db'];var utils=require(_0xec7c('0x6'));var logger=require(_0xec7c('0x7'))(_0xec7c('0x8'));var config=require(_0xec7c('0x9'));var jayson=require(_0xec7c('0xa'));var client=jayson[_0xec7c('0xb')][_0xec7c('0xc')]({'port':0x232a});config['redis']=_[_0xec7c('0xd')](config[_0xec7c('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboardItem.socket')[_0xec7c('0xf')](socket);function respondWithRpcPromise(_0x3e410c,_0x3163d5,_0x6c3dc4){return new BPromise(function(_0x14cf66,_0x53c6b1){return client[_0xec7c('0x10')](_0x3e410c,_0x6c3dc4)['then'](function(_0x75cdb8){logger[_0xec7c('0x11')](_0xec7c('0x12'),_0x3163d5,_0xec7c('0x13'));logger[_0xec7c('0x14')](_0xec7c('0x15'),_0x3163d5,_0xec7c('0x13'),JSON[_0xec7c('0x16')](_0x75cdb8));if(_0x75cdb8[_0xec7c('0x17')]){if(_0x75cdb8['error'][_0xec7c('0x18')]===0x1f4){logger['error'](_0xec7c('0x12'),_0x3163d5,_0x75cdb8[_0xec7c('0x17')][_0xec7c('0x19')]);return _0x53c6b1(_0x75cdb8['error'][_0xec7c('0x19')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x3163d5,_0x75cdb8['error'][_0xec7c('0x19')]);return _0x14cf66(_0x75cdb8[_0xec7c('0x17')][_0xec7c('0x19')]);}else{logger[_0xec7c('0x11')]('DashboardItem,\x20%s,\x20%s',_0x3163d5,_0xec7c('0x13'));_0x14cf66(_0x75cdb8[_0xec7c('0x1a')][_0xec7c('0x19')]);}})[_0xec7c('0x1b')](function(_0x3e9265){logger[_0xec7c('0x17')]('DashboardItem,\x20%s,\x20%s',_0x3163d5,_0x3e9265);_0x53c6b1(_0x3e9265);});});} \ No newline at end of file +var _0x220d=['DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xec1c35,_0x3ab8fd){var _0x38f1fe=function(_0x8b895d){while(--_0x8b895d){_0xec1c35['push'](_0xec1c35['shift']());}};_0x38f1fe(++_0x3ab8fd);}(_0x220d,0xce));var _0xd220=function(_0x30224,_0x4077ee){_0x30224=_0x30224-0x0;var _0x36be6c=_0x220d[_0x30224];return _0x36be6c;};'use strict';var _=require('lodash');var util=require(_0xd220('0x0'));var moment=require(_0xd220('0x1'));var BPromise=require(_0xd220('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd220('0x3'))['db'];var utils=require(_0xd220('0x4'));var logger=require(_0xd220('0x5'))(_0xd220('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd220('0x7')]['http']({'port':0x232a});config[_0xd220('0x8')]=_['defaults'](config['redis'],{'host':_0xd220('0x9'),'port':0x18eb});var socket=require(_0xd220('0xa'))(new Redis(config[_0xd220('0x8')]));require(_0xd220('0xb'))[_0xd220('0xc')](socket);function respondWithRpcPromise(_0xbcef02,_0x38ecc6,_0x428b08){return new BPromise(function(_0x6ab00,_0x581f90){return client[_0xd220('0xd')](_0xbcef02,_0x428b08)[_0xd220('0xe')](function(_0x483429){logger[_0xd220('0xf')](_0xd220('0x10'),_0x38ecc6,_0xd220('0x11'));logger[_0xd220('0x12')](_0xd220('0x13'),_0x38ecc6,_0xd220('0x11'),JSON[_0xd220('0x14')](_0x483429));if(_0x483429['error']){if(_0x483429[_0xd220('0x15')][_0xd220('0x16')]===0x1f4){logger[_0xd220('0x15')](_0xd220('0x10'),_0x38ecc6,_0x483429[_0xd220('0x15')][_0xd220('0x17')]);return _0x581f90(_0x483429[_0xd220('0x15')][_0xd220('0x17')]);}logger[_0xd220('0x15')](_0xd220('0x10'),_0x38ecc6,_0x483429[_0xd220('0x15')][_0xd220('0x17')]);return _0x6ab00(_0x483429[_0xd220('0x15')]['message']);}else{logger[_0xd220('0xf')](_0xd220('0x10'),_0x38ecc6,_0xd220('0x11'));_0x6ab00(_0x483429[_0xd220('0x18')][_0xd220('0x17')]);}})['catch'](function(_0x38e06b){logger[_0xd220('0x15')](_0xd220('0x10'),_0x38ecc6,_0x38e06b);_0x581f90(_0x38e06b);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 4ef4af7..5e72467 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 _0x3ded=['register','dashboardItem:','./dashboardItem.events','remove','update','removeListener'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0x3ded,0xa4));var _0xd3de=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x3ded[_0x5783f4];return _0x28e380;};'use strict';var DashboardItemEvents=require(_0xd3de('0x0'));var events=['save',_0xd3de('0x1'),_0xd3de('0x2')];function createListener(_0x5a534b,_0x2709da){return function(_0x6421f0){_0x2709da['emit'](_0x5a534b,_0x6421f0);};}function removeListener(_0x4b0323,_0x54ec99){return function(){DashboardItemEvents[_0xd3de('0x3')](_0x4b0323,_0x54ec99);};}exports[_0xd3de('0x4')]=function(_0x256f2e){for(var _0x45cf19=0x0,_0x106f37=events['length'];_0x45cf19<_0x106f37;_0x45cf19++){var _0x1a7e72=events[_0x45cf19];var _0x158b36=createListener(_0xd3de('0x5')+_0x1a7e72,_0x256f2e);DashboardItemEvents['on'](_0x1a7e72,_0x158b36);}}; \ No newline at end of file +var _0x39b4=['dashboardItem:','save','remove','update','emit','removeListener','register','length'];(function(_0x4ff86d,_0x5979a7){var _0x40fb06=function(_0x1fbde0){while(--_0x1fbde0){_0x4ff86d['push'](_0x4ff86d['shift']());}};_0x40fb06(++_0x5979a7);}(_0x39b4,0x1a1));var _0x439b=function(_0x588dd4,_0x8d56f1){_0x588dd4=_0x588dd4-0x0;var _0x3f548a=_0x39b4[_0x588dd4];return _0x3f548a;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x439b('0x0'),_0x439b('0x1'),_0x439b('0x2')];function createListener(_0x5937cc,_0x2ff2c3){return function(_0x4f0216){_0x2ff2c3[_0x439b('0x3')](_0x5937cc,_0x4f0216);};}function removeListener(_0x16ca52,_0x5a7c63){return function(){DashboardItemEvents[_0x439b('0x4')](_0x16ca52,_0x5a7c63);};}exports[_0x439b('0x5')]=function(_0x4fe5db){for(var _0x238ea7=0x0,_0x2dcbb5=events[_0x439b('0x6')];_0x238ea7<_0x2dcbb5;_0x238ea7++){var _0x3c72f0=events[_0x238ea7];var _0x1d6370=createListener(_0x439b('0x7')+_0x3c72f0,_0x4fe5db);DashboardItemEvents['on'](_0x3c72f0,_0x1d6370);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 87cc7d0..8895d12 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 _0x39da=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x4997f9,_0x832b9a){var _0x488b9b=function(_0x6ab118){while(--_0x6ab118){_0x4997f9['push'](_0x4997f9['shift']());}};_0x488b9b(++_0x832b9a);}(_0x39da,0x83));var _0xa39d=function(_0x1272c0,_0x8471a5){_0x1272c0=_0x1272c0-0x0;var _0x3fa41e=_0x39da[_0x1272c0];return _0x3fa41e;};'use strict';var multer=require(_0xa39d('0x0'));var util=require(_0xa39d('0x1'));var path=require(_0xa39d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa39d('0x3'));var auth=require(_0xa39d('0x4'));var interaction=require(_0xa39d('0x5'));var config=require(_0xa39d('0x6'));var controller=require(_0xa39d('0x7'));router['get'](_0xa39d('0x8'),auth[_0xa39d('0x9')](),controller[_0xa39d('0xa')]);router[_0xa39d('0xb')]('/',auth[_0xa39d('0x9')](),controller[_0xa39d('0xc')]);router['put'](_0xa39d('0x8'),auth[_0xa39d('0x9')](),controller[_0xa39d('0xd')]);router[_0xa39d('0xe')](_0xa39d('0x8'),auth['isAuthenticated'](),controller[_0xa39d('0xf')]);module[_0xa39d('0x10')]=router; \ No newline at end of file +var _0xd651=['./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x851dc3,_0x1d1b90){var _0x2f4478=function(_0x3119eb){while(--_0x3119eb){_0x851dc3['push'](_0x851dc3['shift']());}};_0x2f4478(++_0x1d1b90);}(_0xd651,0x9b));var _0x1d65=function(_0x5545c0,_0x402569){_0x5545c0=_0x5545c0-0x0;var _0x33aaa4=_0xd651[_0x5545c0];return _0x33aaa4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1d65('0x0'));var timeout=require(_0x1d65('0x1'));var express=require(_0x1d65('0x2'));var router=express[_0x1d65('0x3')]();var fs_extra=require(_0x1d65('0x4'));var auth=require(_0x1d65('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1d65('0x6'));var controller=require(_0x1d65('0x7'));router[_0x1d65('0x8')](_0x1d65('0x9'),auth[_0x1d65('0xa')](),controller[_0x1d65('0xb')]);router[_0x1d65('0xc')]('/',auth[_0x1d65('0xa')](),controller[_0x1d65('0xd')]);router['put'](_0x1d65('0x9'),auth[_0x1d65('0xa')](),controller[_0x1d65('0xe')]);router[_0x1d65('0xf')](_0x1d65('0x9'),auth['isAuthenticated'](),controller[_0x1d65('0x10')]);module[_0x1d65('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 229c207..a6aa9bb 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 _0xa484=['third','first','exports','STRING'];(function(_0x16a15e,_0xa50fa1){var _0x3a08a9=function(_0x254660){while(--_0x254660){_0x16a15e['push'](_0x16a15e['shift']());}};_0x3a08a9(++_0xa50fa1);}(_0xa484,0x14a));var _0x4a48=function(_0x1adcd8,_0x1aa823){_0x1adcd8=_0x1adcd8-0x0;var _0x40c965=_0xa484[_0x1adcd8];return _0x40c965;};'use strict';var Sequelize=require('sequelize');module[_0x4a48('0x0')]={'name':{'type':Sequelize[_0x4a48('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first','second',_0x4a48('0x2')),'allowNull':![],'defaultValue':_0x4a48('0x3')},'description':{'type':Sequelize[_0x4a48('0x1')]}}; \ No newline at end of file +var _0x3c00=['third','sequelize','exports','STRING','ENUM','first'];(function(_0x4f959b,_0x2c0712){var _0x263ddb=function(_0x11de9e){while(--_0x11de9e){_0x4f959b['push'](_0x4f959b['shift']());}};_0x263ddb(++_0x2c0712);}(_0x3c00,0xeb));var _0x03c0=function(_0x5c6238,_0x560a5e){_0x5c6238=_0x5c6238-0x0;var _0x37fdca=_0x3c00[_0x5c6238];return _0x37fdca;};'use strict';var Sequelize=require(_0x03c0('0x0'));module[_0x03c0('0x1')]={'name':{'type':Sequelize[_0x03c0('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x03c0('0x3')](_0x03c0('0x4'),'second',_0x03c0('0x5')),'allowNull':![],'defaultValue':_0x03c0('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index cab4ff9..9f0c797 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 _0x261a=['set','Content-Range','reject','save','update','then','get','Dispositions','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Disposition','rows','catch','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x261a,0x1e6));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xa261('0x0'));var rimraf=require(_0xa261('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa261('0x2'));var rp=require(_0xa261('0x3'));var moment=require(_0xa261('0x4'));var BPromise=require(_0xa261('0x5'));var Mustache=require(_0xa261('0x6'));var util=require(_0xa261('0x7'));var path=require(_0xa261('0x8'));var sox=require(_0xa261('0x9'));var csv=require(_0xa261('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa261('0xb'));var _=require(_0xa261('0xc'));var squel=require('squel');var crypto=require(_0xa261('0xd'));var jsforce=require(_0xa261('0xe'));var deskjs=require(_0xa261('0xf'));var toCsv=require(_0xa261('0xa'));var querystring=require(_0xa261('0x10'));var Papa=require(_0xa261('0x11'));var Redis=require(_0xa261('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa261('0x13'));var as=require(_0xa261('0x14'));var hardwareService=require(_0xa261('0x15'));var logger=require(_0xa261('0x16'))(_0xa261('0x17'));var utils=require(_0xa261('0x18'));var config=require(_0xa261('0x19'));var licenseUtil=require(_0xa261('0x1a'));var db=require(_0xa261('0x1b'))['db'];function respondWithStatusCode(_0xe19cd8,_0x225c3e){_0x225c3e=_0x225c3e||0xcc;return function(_0x135093){if(_0x135093){return _0xe19cd8[_0xa261('0x1c')](_0x225c3e);}return _0xe19cd8[_0xa261('0x1d')](_0x225c3e)[_0xa261('0x1e')]();};}function respondWithResult(_0x3ff195,_0x5b75ce){_0x5b75ce=_0x5b75ce||0xc8;return function(_0x22348c){if(_0x22348c){return _0x3ff195[_0xa261('0x1d')](_0x5b75ce)[_0xa261('0x1f')](_0x22348c);}};}function respondWithFilteredResult(_0x32b5c2,_0x4204bb){return function(_0x2ec87a){if(_0x2ec87a){var _0xcec6a3=typeof _0x4204bb[_0xa261('0x20')]===_0xa261('0x21')&&typeof _0x4204bb[_0xa261('0x22')]===_0xa261('0x21');var _0x2f5dc6=_0x2ec87a['count'];var _0x3e00de=_0xcec6a3?0x0:_0x4204bb['offset'];var _0x356692=_0xcec6a3?_0x2ec87a[_0xa261('0x23')]:_0x4204bb[_0xa261('0x20')]+_0x4204bb[_0xa261('0x22')];var _0x34b1fc;if(_0x356692>=_0x2f5dc6){_0x356692=_0x2f5dc6;_0x34b1fc=0xc8;}else{_0x34b1fc=0xce;}_0x32b5c2['status'](_0x34b1fc);return _0x32b5c2[_0xa261('0x24')](_0xa261('0x25'),_0x3e00de+'-'+_0x356692+'/'+_0x2f5dc6)[_0xa261('0x1f')](_0x2ec87a);}return null;};}function patchUpdates(_0x40eb25){return function(_0x4b0734){try{jsonpatch['apply'](_0x4b0734,_0x40eb25,!![]);}catch(_0x42624e){return BPromise[_0xa261('0x26')](_0x42624e);}return _0x4b0734[_0xa261('0x27')]();};}function saveUpdates(_0x5afe54,_0x943d3e){return function(_0x3fa9c8){if(_0x3fa9c8){return _0x3fa9c8[_0xa261('0x28')](_0x5afe54)['then'](function(_0xaa4e15){return _0xaa4e15;});}return null;};}function removeEntity(_0xf36003,_0x274802){return function(_0x773cdf){if(_0x773cdf){return _0x773cdf['destroy']()[_0xa261('0x29')](function(){var _0x41472e=_0x773cdf[_0xa261('0x2a')]({'plain':!![]});var _0x2c6f53=_0xa261('0x2b');return db[_0xa261('0x2c')]['destroy']({'where':{'type':_0x2c6f53,'resourceId':_0x41472e['id']}})[_0xa261('0x29')](function(){return _0x773cdf;});})[_0xa261('0x29')](function(){_0xf36003[_0xa261('0x1d')](0xcc)[_0xa261('0x1e')]();});}};}function handleEntityNotFound(_0x5513d6,_0x441608){return function(_0x5a9cfe){if(!_0x5a9cfe){_0x5513d6[_0xa261('0x1c')](0x194);}return _0x5a9cfe;};}function handleError(_0x55c44d,_0x1f78be){_0x1f78be=_0x1f78be||0x1f4;return function(_0x41091b){logger[_0xa261('0x2d')](_0x41091b[_0xa261('0x2e')]);if(_0x41091b['name']){delete _0x41091b[_0xa261('0x2f')];}_0x55c44d[_0xa261('0x1d')](_0x1f78be)[_0xa261('0x30')](_0x41091b);};}exports['index']=function(_0x1e132e,_0x49e2ca){var _0x50a34c={},_0x43a32a={},_0x24cb93={'count':0x0,'rows':[]};var _0x5a6b79=_[_0xa261('0x31')](db['Disposition'][_0xa261('0x32')],function(_0x492c51){return{'name':_0x492c51[_0xa261('0x33')],'type':_0x492c51[_0xa261('0x34')][_0xa261('0x35')]};});_0x43a32a[_0xa261('0x36')]=_['map'](_0x5a6b79,_0xa261('0x2f'));_0x43a32a['query']=_[_0xa261('0x37')](_0x1e132e['query']);_0x43a32a['filters']=_[_0xa261('0x38')](_0x43a32a['model'],_0x43a32a[_0xa261('0x39')]);_0x50a34c[_0xa261('0x3a')]=_[_0xa261('0x38')](_0x43a32a[_0xa261('0x36')],qs[_0xa261('0x3b')](_0x1e132e[_0xa261('0x39')]['fields']));_0x50a34c['attributes']=_0x50a34c['attributes'][_0xa261('0x3c')]?_0x50a34c[_0xa261('0x3a')]:_0x43a32a[_0xa261('0x36')];if(!_0x1e132e[_0xa261('0x39')][_0xa261('0x3d')](_0xa261('0x3e'))){_0x50a34c['limit']=qs['limit'](_0x1e132e['query'][_0xa261('0x22')]);_0x50a34c[_0xa261('0x20')]=qs[_0xa261('0x20')](_0x1e132e[_0xa261('0x39')][_0xa261('0x20')]);}_0x50a34c[_0xa261('0x3f')]=qs[_0xa261('0x40')](_0x1e132e['query'][_0xa261('0x40')]);_0x50a34c[_0xa261('0x41')]=qs[_0xa261('0x42')](_[_0xa261('0x43')](_0x1e132e[_0xa261('0x39')],_0x43a32a['filters']),_0x5a6b79);if(_0x1e132e['query'][_0xa261('0x44')]){_0x50a34c[_0xa261('0x41')]=_[_0xa261('0x45')](_0x50a34c[_0xa261('0x41')],{'$or':_[_0xa261('0x31')](_0x5a6b79,function(_0x4690bb){if(_0x4690bb[_0xa261('0x34')]!==_0xa261('0x46')){var _0x57eefd={};_0x57eefd[_0x4690bb[_0xa261('0x2f')]]={'$like':'%'+_0x1e132e[_0xa261('0x39')][_0xa261('0x44')]+'%'};return _0x57eefd;}})});}_0x50a34c=_[_0xa261('0x45')]({},_0x50a34c,_0x1e132e[_0xa261('0x47')]);var _0x27db7d={'where':_0x50a34c[_0xa261('0x41')]};return db['Disposition']['count'](_0x27db7d)['then'](function(_0x4bd1ee){_0x24cb93[_0xa261('0x23')]=_0x4bd1ee;if(_0x1e132e[_0xa261('0x39')]['includeAll']){_0x50a34c['include']=[{'all':!![]}];}return db[_0xa261('0x48')]['findAll'](_0x50a34c);})[_0xa261('0x29')](function(_0x221e7b){_0x24cb93[_0xa261('0x49')]=_0x221e7b;return _0x24cb93;})[_0xa261('0x29')](respondWithFilteredResult(_0x49e2ca,_0x50a34c))[_0xa261('0x4a')](handleError(_0x49e2ca,null));};exports['show']=function(_0x5b9170,_0x21c806){var _0xa29003={'raw':!![],'where':{'id':_0x5b9170[_0xa261('0x4b')]['id']}},_0x3492c0={};_0x3492c0['model']=_[_0xa261('0x37')](db['Disposition'][_0xa261('0x32')]);_0x3492c0[_0xa261('0x39')]=_[_0xa261('0x37')](_0x5b9170[_0xa261('0x39')]);_0x3492c0[_0xa261('0x42')]=_[_0xa261('0x38')](_0x3492c0[_0xa261('0x36')],_0x3492c0[_0xa261('0x39')]);_0xa29003[_0xa261('0x3a')]=_[_0xa261('0x38')](_0x3492c0[_0xa261('0x36')],qs[_0xa261('0x3b')](_0x5b9170[_0xa261('0x39')][_0xa261('0x3b')]));_0xa29003[_0xa261('0x3a')]=_0xa29003[_0xa261('0x3a')][_0xa261('0x3c')]?_0xa29003['attributes']:_0x3492c0[_0xa261('0x36')];if(_0x5b9170[_0xa261('0x39')][_0xa261('0x4c')]){_0xa29003[_0xa261('0x4d')]=[{'all':!![]}];}_0xa29003=_['merge']({},_0xa29003,_0x5b9170[_0xa261('0x47')]);return db[_0xa261('0x48')][_0xa261('0x4e')](_0xa29003)[_0xa261('0x29')](handleEntityNotFound(_0x21c806,null))[_0xa261('0x29')](respondWithResult(_0x21c806,null))[_0xa261('0x4a')](handleError(_0x21c806,null));};exports[_0xa261('0x4f')]=function(_0x4bcf76,_0x53b022){return db[_0xa261('0x48')]['create'](_0x4bcf76[_0xa261('0x50')],{})[_0xa261('0x29')](function(_0x29317b){var _0x1fb008=_0x4bcf76[_0xa261('0x51')]['get']({'plain':!![]});if(!_0x1fb008)throw new Error(_0xa261('0x52'));if(_0x1fb008[_0xa261('0x53')]==='user'){var _0x424e91=_0x29317b['get']({'plain':!![]});var _0x1b0b15=_0xa261('0x2b');return db[_0xa261('0x54')]['find']({'where':{'name':_0x1b0b15,'userProfileId':_0x1fb008[_0xa261('0x55')]},'raw':!![]})['then'](function(_0x3be858){if(_0x3be858&&_0x3be858['autoAssociation']===0x0){return db['UserProfileResource'][_0xa261('0x4f')]({'name':_0x424e91[_0xa261('0x2f')],'resourceId':_0x424e91['id'],'type':_0x3be858[_0xa261('0x2f')],'sectionId':_0x3be858['id']},{})['then'](function(){return _0x29317b;});}else{return _0x29317b;}})['catch'](function(_0x1d234e){logger[_0xa261('0x2d')](_0xa261('0x56'),_0x1d234e);throw _0x1d234e;});}return _0x29317b;})[_0xa261('0x29')](respondWithResult(_0x53b022,0xc9))[_0xa261('0x4a')](handleError(_0x53b022,null));};exports[_0xa261('0x28')]=function(_0x5272df,_0x7f67d5){if(_0x5272df[_0xa261('0x50')]['id']){delete _0x5272df['body']['id'];}return db[_0xa261('0x48')][_0xa261('0x4e')]({'where':{'id':_0x5272df[_0xa261('0x4b')]['id']}})[_0xa261('0x29')](handleEntityNotFound(_0x7f67d5,null))[_0xa261('0x29')](saveUpdates(_0x5272df[_0xa261('0x50')],null))[_0xa261('0x29')](respondWithResult(_0x7f67d5,null))['catch'](handleError(_0x7f67d5,null));};exports['destroy']=function(_0x1c2613,_0x5bb00b){return db[_0xa261('0x48')][_0xa261('0x4e')]({'where':{'id':_0x1c2613[_0xa261('0x4b')]['id']}})[_0xa261('0x29')](handleEntityNotFound(_0x5bb00b,null))[_0xa261('0x29')](removeEntity(_0x5bb00b,null))[_0xa261('0x4a')](handleError(_0x5bb00b,null));}; \ No newline at end of file +var _0x0f6a=['keys','fields','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0xa95463,_0x1e124b){var _0x7d64fa=function(_0x4a7dd8){while(--_0x4a7dd8){_0xa95463['push'](_0xa95463['shift']());}};_0x7d64fa(++_0x1e124b);}(_0x0f6a,0x1b6));var _0xa0f6=function(_0x56ece1,_0x21a42f){_0x56ece1=_0x56ece1-0x0;var _0x5ce05c=_0x0f6a[_0x56ece1];return _0x5ce05c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0f6('0x0'));var zipdir=require(_0xa0f6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa0f6('0x2'));var BPromise=require(_0xa0f6('0x3'));var Mustache=require(_0xa0f6('0x4'));var util=require(_0xa0f6('0x5'));var path=require(_0xa0f6('0x6'));var sox=require(_0xa0f6('0x7'));var csv=require(_0xa0f6('0x8'));var ejs=require(_0xa0f6('0x9'));var fs=require('fs');var fs_extra=require(_0xa0f6('0xa'));var _=require(_0xa0f6('0xb'));var squel=require(_0xa0f6('0xc'));var crypto=require('crypto');var jsforce=require(_0xa0f6('0xd'));var deskjs=require(_0xa0f6('0xe'));var toCsv=require(_0xa0f6('0x8'));var querystring=require(_0xa0f6('0xf'));var Papa=require('papaparse');var Redis=require(_0xa0f6('0x10'));var authService=require(_0xa0f6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa0f6('0x12'));var hardwareService=require(_0xa0f6('0x13'));var logger=require(_0xa0f6('0x14'))(_0xa0f6('0x15'));var utils=require(_0xa0f6('0x16'));var config=require(_0xa0f6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0f6('0x18'))['db'];function respondWithStatusCode(_0xb421f3,_0x12bbfe){_0x12bbfe=_0x12bbfe||0xcc;return function(_0x4d0b2f){if(_0x4d0b2f){return _0xb421f3['sendStatus'](_0x12bbfe);}return _0xb421f3[_0xa0f6('0x19')](_0x12bbfe)[_0xa0f6('0x1a')]();};}function respondWithResult(_0x2c620b,_0x1b6b5d){_0x1b6b5d=_0x1b6b5d||0xc8;return function(_0x2385e4){if(_0x2385e4){return _0x2c620b[_0xa0f6('0x19')](_0x1b6b5d)[_0xa0f6('0x1b')](_0x2385e4);}};}function respondWithFilteredResult(_0x40a639,_0x19295e){return function(_0xf8f649){if(_0xf8f649){var _0x4f3b94=typeof _0x19295e[_0xa0f6('0x1c')]==='undefined'&&typeof _0x19295e[_0xa0f6('0x1d')]==='undefined';var _0x1534cf=_0xf8f649['count'];var _0x38587e=_0x4f3b94?0x0:_0x19295e[_0xa0f6('0x1c')];var _0x49d9af=_0x4f3b94?_0xf8f649[_0xa0f6('0x1e')]:_0x19295e[_0xa0f6('0x1c')]+_0x19295e[_0xa0f6('0x1d')];var _0x4f78ea;if(_0x49d9af>=_0x1534cf){_0x49d9af=_0x1534cf;_0x4f78ea=0xc8;}else{_0x4f78ea=0xce;}_0x40a639[_0xa0f6('0x19')](_0x4f78ea);return _0x40a639[_0xa0f6('0x1f')](_0xa0f6('0x20'),_0x38587e+'-'+_0x49d9af+'/'+_0x1534cf)[_0xa0f6('0x1b')](_0xf8f649);}return null;};}function patchUpdates(_0x325374){return function(_0x519085){try{jsonpatch[_0xa0f6('0x21')](_0x519085,_0x325374,!![]);}catch(_0x2f4211){return BPromise[_0xa0f6('0x22')](_0x2f4211);}return _0x519085[_0xa0f6('0x23')]();};}function saveUpdates(_0x775b25,_0x14b6f5){return function(_0x27e194){if(_0x27e194){return _0x27e194[_0xa0f6('0x24')](_0x775b25)[_0xa0f6('0x25')](function(_0x2c2b8b){return _0x2c2b8b;});}return null;};}function removeEntity(_0x284585,_0x5ecddf){return function(_0x2f0589){if(_0x2f0589){return _0x2f0589['destroy']()[_0xa0f6('0x25')](function(){var _0x366099=_0x2f0589[_0xa0f6('0x26')]({'plain':!![]});var _0x26f398='Dispositions';return db[_0xa0f6('0x27')][_0xa0f6('0x28')]({'where':{'type':_0x26f398,'resourceId':_0x366099['id']}})[_0xa0f6('0x25')](function(){return _0x2f0589;});})['then'](function(){_0x284585[_0xa0f6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x245bd1,_0x15b99b){return function(_0xa033ca){if(!_0xa033ca){_0x245bd1['sendStatus'](0x194);}return _0xa033ca;};}function handleError(_0x175c29,_0x154968){_0x154968=_0x154968||0x1f4;return function(_0x2c5c22){logger['error'](_0x2c5c22[_0xa0f6('0x29')]);if(_0x2c5c22[_0xa0f6('0x2a')]){delete _0x2c5c22[_0xa0f6('0x2a')];}_0x175c29[_0xa0f6('0x19')](_0x154968)['send'](_0x2c5c22);};}exports[_0xa0f6('0x2b')]=function(_0x1fceac,_0x3229b8){var _0x1da2f0={},_0x47e13e={},_0x46c23f={'count':0x0,'rows':[]};var _0x342ac5=_[_0xa0f6('0x2c')](db['Disposition']['rawAttributes'],function(_0x25de42){return{'name':_0x25de42[_0xa0f6('0x2d')],'type':_0x25de42[_0xa0f6('0x2e')][_0xa0f6('0x2f')]};});_0x47e13e[_0xa0f6('0x30')]=_[_0xa0f6('0x2c')](_0x342ac5,_0xa0f6('0x2a'));_0x47e13e[_0xa0f6('0x31')]=_['keys'](_0x1fceac['query']);_0x47e13e[_0xa0f6('0x32')]=_[_0xa0f6('0x33')](_0x47e13e[_0xa0f6('0x30')],_0x47e13e[_0xa0f6('0x31')]);_0x1da2f0[_0xa0f6('0x34')]=_[_0xa0f6('0x33')](_0x47e13e[_0xa0f6('0x30')],qs['fields'](_0x1fceac[_0xa0f6('0x31')]['fields']));_0x1da2f0[_0xa0f6('0x34')]=_0x1da2f0[_0xa0f6('0x34')][_0xa0f6('0x35')]?_0x1da2f0['attributes']:_0x47e13e['model'];if(!_0x1fceac[_0xa0f6('0x31')][_0xa0f6('0x36')]('nolimit')){_0x1da2f0[_0xa0f6('0x1d')]=qs[_0xa0f6('0x1d')](_0x1fceac[_0xa0f6('0x31')]['limit']);_0x1da2f0['offset']=qs[_0xa0f6('0x1c')](_0x1fceac[_0xa0f6('0x31')][_0xa0f6('0x1c')]);}_0x1da2f0[_0xa0f6('0x37')]=qs[_0xa0f6('0x38')](_0x1fceac[_0xa0f6('0x31')]['sort']);_0x1da2f0[_0xa0f6('0x39')]=qs[_0xa0f6('0x32')](_[_0xa0f6('0x3a')](_0x1fceac[_0xa0f6('0x31')],_0x47e13e[_0xa0f6('0x32')]),_0x342ac5);if(_0x1fceac[_0xa0f6('0x31')][_0xa0f6('0x3b')]){_0x1da2f0[_0xa0f6('0x39')]=_[_0xa0f6('0x3c')](_0x1da2f0[_0xa0f6('0x39')],{'$or':_[_0xa0f6('0x2c')](_0x342ac5,function(_0x2b9082){if(_0x2b9082[_0xa0f6('0x2e')]!==_0xa0f6('0x3d')){var _0x89fdc2={};_0x89fdc2[_0x2b9082[_0xa0f6('0x2a')]]={'$like':'%'+_0x1fceac[_0xa0f6('0x31')]['filter']+'%'};return _0x89fdc2;}})});}_0x1da2f0=_[_0xa0f6('0x3c')]({},_0x1da2f0,_0x1fceac[_0xa0f6('0x3e')]);var _0x35ec54={'where':_0x1da2f0['where']};return db[_0xa0f6('0x3f')][_0xa0f6('0x1e')](_0x35ec54)[_0xa0f6('0x25')](function(_0x3ea6f3){_0x46c23f[_0xa0f6('0x1e')]=_0x3ea6f3;if(_0x1fceac[_0xa0f6('0x31')][_0xa0f6('0x40')]){_0x1da2f0[_0xa0f6('0x41')]=[{'all':!![]}];}return db[_0xa0f6('0x3f')][_0xa0f6('0x42')](_0x1da2f0);})['then'](function(_0x173a20){_0x46c23f[_0xa0f6('0x43')]=_0x173a20;return _0x46c23f;})[_0xa0f6('0x25')](respondWithFilteredResult(_0x3229b8,_0x1da2f0))[_0xa0f6('0x44')](handleError(_0x3229b8,null));};exports[_0xa0f6('0x45')]=function(_0x1186b0,_0x493f3f){var _0x3619cc={'raw':!![],'where':{'id':_0x1186b0[_0xa0f6('0x46')]['id']}},_0x1f62a3={};_0x1f62a3['model']=_['keys'](db['Disposition'][_0xa0f6('0x47')]);_0x1f62a3[_0xa0f6('0x31')]=_[_0xa0f6('0x48')](_0x1186b0[_0xa0f6('0x31')]);_0x1f62a3[_0xa0f6('0x32')]=_[_0xa0f6('0x33')](_0x1f62a3[_0xa0f6('0x30')],_0x1f62a3[_0xa0f6('0x31')]);_0x3619cc[_0xa0f6('0x34')]=_[_0xa0f6('0x33')](_0x1f62a3[_0xa0f6('0x30')],qs[_0xa0f6('0x49')](_0x1186b0[_0xa0f6('0x31')][_0xa0f6('0x49')]));_0x3619cc[_0xa0f6('0x34')]=_0x3619cc[_0xa0f6('0x34')][_0xa0f6('0x35')]?_0x3619cc[_0xa0f6('0x34')]:_0x1f62a3[_0xa0f6('0x30')];if(_0x1186b0[_0xa0f6('0x31')][_0xa0f6('0x40')]){_0x3619cc[_0xa0f6('0x41')]=[{'all':!![]}];}_0x3619cc=_[_0xa0f6('0x3c')]({},_0x3619cc,_0x1186b0[_0xa0f6('0x3e')]);return db['Disposition']['find'](_0x3619cc)[_0xa0f6('0x25')](handleEntityNotFound(_0x493f3f,null))[_0xa0f6('0x25')](respondWithResult(_0x493f3f,null))[_0xa0f6('0x44')](handleError(_0x493f3f,null));};exports[_0xa0f6('0x4a')]=function(_0x16b97f,_0xf81961){return db[_0xa0f6('0x3f')][_0xa0f6('0x4a')](_0x16b97f['body'],{})['then'](function(_0xfb2e66){var _0x570048=_0x16b97f[_0xa0f6('0x4b')][_0xa0f6('0x26')]({'plain':!![]});if(!_0x570048)throw new Error(_0xa0f6('0x4c'));if(_0x570048[_0xa0f6('0x4d')]==='user'){var _0x208744=_0xfb2e66[_0xa0f6('0x26')]({'plain':!![]});var _0x5139b6=_0xa0f6('0x4e');return db[_0xa0f6('0x4f')]['find']({'where':{'name':_0x5139b6,'userProfileId':_0x570048[_0xa0f6('0x50')]},'raw':!![]})[_0xa0f6('0x25')](function(_0x21767b){if(_0x21767b&&_0x21767b['autoAssociation']===0x0){return db[_0xa0f6('0x27')]['create']({'name':_0x208744[_0xa0f6('0x2a')],'resourceId':_0x208744['id'],'type':_0x21767b[_0xa0f6('0x2a')],'sectionId':_0x21767b['id']},{})['then'](function(){return _0xfb2e66;});}else{return _0xfb2e66;}})['catch'](function(_0x1001ee){logger[_0xa0f6('0x51')](_0xa0f6('0x52'),_0x1001ee);throw _0x1001ee;});}return _0xfb2e66;})[_0xa0f6('0x25')](respondWithResult(_0xf81961,0xc9))['catch'](handleError(_0xf81961,null));};exports['update']=function(_0x227922,_0x539ac4){if(_0x227922[_0xa0f6('0x53')]['id']){delete _0x227922[_0xa0f6('0x53')]['id'];}return db[_0xa0f6('0x3f')][_0xa0f6('0x54')]({'where':{'id':_0x227922[_0xa0f6('0x46')]['id']}})['then'](handleEntityNotFound(_0x539ac4,null))[_0xa0f6('0x25')](saveUpdates(_0x227922[_0xa0f6('0x53')],null))['then'](respondWithResult(_0x539ac4,null))[_0xa0f6('0x44')](handleError(_0x539ac4,null));};exports['destroy']=function(_0x370245,_0x2d6a34){return db[_0xa0f6('0x3f')]['find']({'where':{'id':_0x370245[_0xa0f6('0x46')]['id']}})[_0xa0f6('0x25')](handleEntityNotFound(_0x2d6a34,null))[_0xa0f6('0x25')](removeEntity(_0x2d6a34,null))[_0xa0f6('0x44')](handleError(_0x2d6a34,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 8279b02..c14c1aa 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 _0xafe2=['../../config/environment','./disposition.attributes','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','moment','bluebird','request-promise','rimraf'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0xafe2,0x6d));var _0x2afe=function(_0x1100d1,_0x5d69b8){_0x1100d1=_0x1100d1-0x0;var _0x55ad67=_0xafe2[_0x1100d1];return _0x55ad67;};'use strict';var _=require('lodash');var util=require(_0x2afe('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2afe('0x1'));var BPromise=require(_0x2afe('0x2'));var rp=require(_0x2afe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2afe('0x4'));var config=require(_0x2afe('0x5'));var attributes=require(_0x2afe('0x6'));module['exports']=function(_0x26f4d3,_0x731d7f){return _0x26f4d3['define']('Disposition',attributes,{'tableName':_0x2afe('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x2afe('0x8')]},{'unique':!![],'name':_0x2afe('0x9'),'fields':[_0x2afe('0xa'),_0x2afe('0xb')]},{'unique':!![],'name':_0x2afe('0xc'),'fields':['name',_0x2afe('0xd')]},{'unique':!![],'name':_0x2afe('0xe'),'fields':[_0x2afe('0xa'),_0x2afe('0xf')]},{'unique':!![],'name':'name_fax','fields':[_0x2afe('0xa'),'FaxAccountId']},{'unique':!![],'name':_0x2afe('0x10'),'fields':[_0x2afe('0xa'),'OpenchannelAccountId']},{'unique':!![],'name':_0x2afe('0x11'),'fields':[_0x2afe('0xa'),_0x2afe('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd77f=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','WhatsappAccountId'];(function(_0x18666e,_0x301464){var _0x9b4606=function(_0x3ae7ce){while(--_0x3ae7ce){_0x18666e['push'](_0x18666e['shift']());}};_0x9b4606(++_0x301464);}(_0xd77f,0x150));var _0xfd77=function(_0x35fe13,_0x1400c9){_0x35fe13=_0x35fe13-0x0;var _0x2eec32=_0xd77f[_0x35fe13];return _0x2eec32;};'use strict';var _=require(_0xfd77('0x0'));var util=require('util');var logger=require(_0xfd77('0x1'))(_0xfd77('0x2'));var moment=require(_0xfd77('0x3'));var BPromise=require(_0xfd77('0x4'));var rp=require(_0xfd77('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd77('0x6'));var config=require(_0xfd77('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0xdff224,_0x42fdd3){return _0xdff224['define'](_0xfd77('0x8'),attributes,{'tableName':_0xfd77('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xfd77('0xa'),_0xfd77('0xb')]},{'unique':!![],'name':_0xfd77('0xc'),'fields':[_0xfd77('0xa'),_0xfd77('0xd')]},{'unique':!![],'name':'name_mail','fields':['name',_0xfd77('0xe')]},{'unique':!![],'name':_0xfd77('0xf'),'fields':[_0xfd77('0xa'),_0xfd77('0x10')]},{'unique':!![],'name':_0xfd77('0x11'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xfd77('0x12'),'fields':[_0xfd77('0xa'),_0xfd77('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':[_0xfd77('0xa'),_0xfd77('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 989eb6a..e586dc2 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(_0x52695f,_0x58f240){var _0x2c965f=function(_0x5bb602){while(--_0x5bb602){_0x52695f['push'](_0x52695f['shift']());}};_0x2c965f(++_0x58f240);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x2faaac,_0x226773){var _0x3c40d2=function(_0x14f404){while(--_0x14f404){_0x2faaac['push'](_0x2faaac['shift']());}};_0x3c40d2(++_0x226773);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index bbbadcd..093c728 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 _0xecba=['../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x452fde,_0x339a5f){var _0x36ecee=function(_0x830839){while(--_0x830839){_0x452fde['push'](_0x452fde['shift']());}};_0x36ecee(++_0x339a5f);}(_0xecba,0x1ec));var _0xaecb=function(_0x152320,_0x5f54c5){_0x152320=_0x152320-0x0;var _0xa8e3ec=_0xecba[_0x152320];return _0xa8e3ec;};'use strict';var multer=require(_0xaecb('0x0'));var util=require(_0xaecb('0x1'));var path=require(_0xaecb('0x2'));var timeout=require(_0xaecb('0x3'));var express=require(_0xaecb('0x4'));var router=express[_0xaecb('0x5')]();var fs_extra=require(_0xaecb('0x6'));var auth=require(_0xaecb('0x7'));var interaction=require(_0xaecb('0x8'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xaecb('0x9')]('/',auth[_0xaecb('0xa')](),controller[_0xaecb('0xb')]);router[_0xaecb('0x9')](_0xaecb('0xc'),auth[_0xaecb('0xa')](),controller['show']);router[_0xaecb('0xd')]('/',auth['isAuthenticated'](),controller[_0xaecb('0xe')]);router[_0xaecb('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xaecb('0x10')]);router[_0xaecb('0x11')](_0xaecb('0xc'),auth['isAuthenticated'](),controller[_0xaecb('0x12')]);module[_0xaecb('0x13')]=router; \ No newline at end of file +var _0x0252=['show','post','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0252,0xf6));var _0x2025=function(_0x22cb1e,_0x48ac66){_0x22cb1e=_0x22cb1e-0x0;var _0x5be612=_0x0252[_0x22cb1e];return _0x5be612;};'use strict';var multer=require('multer');var util=require(_0x2025('0x0'));var path=require(_0x2025('0x1'));var timeout=require(_0x2025('0x2'));var express=require(_0x2025('0x3'));var router=express[_0x2025('0x4')]();var fs_extra=require(_0x2025('0x5'));var auth=require(_0x2025('0x6'));var interaction=require(_0x2025('0x7'));var config=require(_0x2025('0x8'));var controller=require(_0x2025('0x9'));router[_0x2025('0xa')]('/',auth[_0x2025('0xb')](),controller[_0x2025('0xc')]);router[_0x2025('0xa')](_0x2025('0xd'),auth[_0x2025('0xb')](),controller[_0x2025('0xe')]);router[_0x2025('0xf')]('/',auth[_0x2025('0xb')](),controller[_0x2025('0x10')]);router['put'](_0x2025('0xd'),auth['isAuthenticated'](),controller[_0x2025('0x11')]);router[_0x2025('0x12')](_0x2025('0xd'),auth[_0x2025('0xb')](),controller['destroy']);module[_0x2025('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 0708f48..efef846 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 _0x4fe2=['14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','ENUM'];(function(_0x21d0d7,_0x4c55a3){var _0x5e725b=function(_0x35acf8){while(--_0x35acf8){_0x21d0d7['push'](_0x21d0d7['shift']());}};_0x5e725b(++_0x4c55a3);}(_0x4fe2,0x153));var _0x24fe=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4fe2[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x24fe('0x0'));module['exports']={'name':{'type':Sequelize[_0x24fe('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x24fe('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x24fe('0x2'),'no'),'defaultValue':_0x24fe('0x2')},'headerinfo':{'type':Sequelize[_0x24fe('0x1')],'defaultValue':_0x24fe('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x24fe('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x24fe('0x5'),_0x24fe('0x6'),_0x24fe('0x7'),_0x24fe('0x8'),_0x24fe('0x9'),'14400'),'defaultValue':_0x24fe('0x6')},'maxrate':{'type':Sequelize[_0x24fe('0xa')]('2400',_0x24fe('0x6'),_0x24fe('0x7'),_0x24fe('0x8'),_0x24fe('0x9'),_0x24fe('0xb')),'defaultValue':_0x24fe('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x24fe('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x24fe('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x24fe('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x24fe('0xa')](_0x24fe('0xe'),_0x24fe('0xf'),_0x24fe('0x10'),_0x24fe('0x11')),'defaultValue':_0x24fe('0xe')},'key':{'type':Sequelize[_0x24fe('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x24fe('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x24fe('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x24fe('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x24fe('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x24fe('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x24fe('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x24fe('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x24fe('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x24fe('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x24fe('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x24fe('0x13')],'defaultValue':![],'comment':_0x24fe('0x15'),'set':function(_0x5bed71){if(!_0x5bed71)this['setDataValue'](_0x24fe('0x16'),null);this[_0x24fe('0x17')](_0x24fe('0x18'),_0x5bed71);}}}; \ No newline at end of file +var _0x59db=['sequelize','exports','ENUM','yes','xCALLY\x20Motion\x20Fax','STRING','2400','4800','14400','7200','12000','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59db,0x108));var _0xb59d=function(_0x5462b2,_0x345ed1){_0x5462b2=_0x5462b2-0x0;var _0xb969ca=_0x59db[_0x5462b2];return _0xb969ca;};'use strict';var Sequelize=require(_0xb59d('0x0'));module[_0xb59d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xb59d('0x2')](_0xb59d('0x3'),'no'),'defaultValue':_0xb59d('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xb59d('0x4')},'localstationid':{'type':Sequelize[_0xb59d('0x5')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0xb59d('0x6'),_0xb59d('0x7'),'7200','9600','12000',_0xb59d('0x8')),'defaultValue':_0xb59d('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0xb59d('0x6'),_0xb59d('0x7'),_0xb59d('0x9'),'9600',_0xb59d('0xa'),_0xb59d('0x8')),'defaultValue':_0xb59d('0x8')},'modem':{'type':Sequelize[_0xb59d('0x5')],'defaultValue':_0xb59d('0xb')},'gateway':{'type':Sequelize[_0xb59d('0x5')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb59d('0x5')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb59d('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb59d('0x2')](_0xb59d('0xd'),_0xb59d('0xe'),_0xb59d('0xf'),'KHOMP'),'defaultValue':_0xb59d('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb59d('0x10')],'defaultValue':function(){return _0xb59d('0x11');}},'notificationSound':{'type':Sequelize[_0xb59d('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb59d('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb59d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb59d('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb59d('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb59d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb59d('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb59d('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1f07a4){if(!_0x1f07a4)this[_0xb59d('0x13')](_0xb59d('0x14'),null);this['setDataValue'](_0xb59d('0x15'),_0x1f07a4);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index b91fe7c..4d77fe8 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 _0xfba5=['from','\x22%s\x22\x20<%s>','fax','ListId','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','FaxAccount','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','rawAttributes','pick','FaxAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','ids','Contact','User','Owner','internal','Tag','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','send','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','ecm','gateway','headerinfo','modem','FAXOPT(','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','CmList','List','CmContact','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil'];(function(_0x2c2b74,_0x47e891){var _0x27cb17=function(_0x168d8f){while(--_0x168d8f){_0x2c2b74['push'](_0x2c2b74['shift']());}};_0x27cb17(++_0x47e891);}(_0xfba5,0xd5));var _0x5fba=function(_0x49fb1c,_0x57640d){_0x49fb1c=_0x49fb1c-0x0;var _0x2b9c13=_0xfba5[_0x49fb1c];return _0x2b9c13;};'use strict';var emlformat=require(_0x5fba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5fba('0x1'));var jsonpatch=require(_0x5fba('0x2'));var rp=require(_0x5fba('0x3'));var moment=require(_0x5fba('0x4'));var BPromise=require(_0x5fba('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5fba('0x6'));var sox=require(_0x5fba('0x7'));var csv=require(_0x5fba('0x8'));var ejs=require(_0x5fba('0x9'));var fs=require('fs');var fs_extra=require(_0x5fba('0xa'));var _=require(_0x5fba('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5fba('0xc'));var deskjs=require(_0x5fba('0xd'));var toCsv=require(_0x5fba('0x8'));var querystring=require(_0x5fba('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5fba('0xf'));var qs=require(_0x5fba('0x10'));var as=require(_0x5fba('0x11'));var hardwareService=require(_0x5fba('0x12'));var logger=require(_0x5fba('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5fba('0x14'));var licenseUtil=require(_0x5fba('0x15'));var db=require(_0x5fba('0x16'))['db'];config['redis']=_[_0x5fba('0x17')](config[_0x5fba('0x18')],{'host':_0x5fba('0x19'),'port':0x18eb});var socket=require(_0x5fba('0x1a'))(new Redis(config[_0x5fba('0x18')]));require(_0x5fba('0x1b'))[_0x5fba('0x1c')](socket);var jayson=require(_0x5fba('0x1d'));var client=jayson[_0x5fba('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x5fba('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a7029,_0x1c05fd,_0x489271,_0x131feb){return new BPromise(function(_0x3e9e2b,_0x405f22){var _0x382fee=_0x131feb||client;return _0x382fee[_0x5fba('0x1f')](_0x4a7029,_0x489271)[_0x5fba('0x20')](function(_0x53e321){logger['info'](_0x5fba('0x21'),_0x1c05fd,_0x5fba('0x22'));logger[_0x5fba('0x23')](_0x5fba('0x24'),_0x1c05fd,_0x5fba('0x22'),JSON['stringify'](_0x53e321));if(_0x53e321[_0x5fba('0x25')]){if(_0x53e321[_0x5fba('0x25')][_0x5fba('0x26')]===0x1f4){logger[_0x5fba('0x25')](_0x5fba('0x21'),_0x1c05fd,_0x53e321['error'][_0x5fba('0x27')]);return _0x405f22(_0x53e321[_0x5fba('0x25')][_0x5fba('0x27')]);}logger[_0x5fba('0x25')](_0x5fba('0x21'),_0x1c05fd,_0x53e321[_0x5fba('0x25')]['message']);return _0x3e9e2b(_0x53e321[_0x5fba('0x25')][_0x5fba('0x27')]);}else{logger[_0x5fba('0x28')](_0x5fba('0x21'),_0x1c05fd,_0x5fba('0x22'));_0x3e9e2b(_0x53e321[_0x5fba('0x29')][_0x5fba('0x27')]);}})[_0x5fba('0x2a')](function(_0xdbbd45){logger['error']('FaxAccount,\x20%s,\x20%s',_0x1c05fd,_0xdbbd45);_0x405f22(_0xdbbd45);});});}function respondWithStatusCode(_0x1ca423,_0x2c4bf3){_0x2c4bf3=_0x2c4bf3||0xcc;return function(_0x2c0972){if(_0x2c0972){return _0x1ca423[_0x5fba('0x2b')](_0x2c4bf3);}return _0x1ca423[_0x5fba('0x2c')](_0x2c4bf3)[_0x5fba('0x2d')]();};}function respondWithResult(_0x59b5cf,_0x582fe7){_0x582fe7=_0x582fe7||0xc8;return function(_0x4041e6){if(_0x4041e6){return _0x59b5cf[_0x5fba('0x2c')](_0x582fe7)[_0x5fba('0x2e')](_0x4041e6);}};}function respondWithFilteredResult(_0x5b066e,_0x392298){return function(_0x5dd7c1){if(_0x5dd7c1){var _0x7fb9b7=typeof _0x392298[_0x5fba('0x2f')]===_0x5fba('0x30')&&typeof _0x392298['limit']===_0x5fba('0x30');var _0x58a332=_0x5dd7c1[_0x5fba('0x31')];var _0x197d13=_0x7fb9b7?0x0:_0x392298[_0x5fba('0x2f')];var _0x538f7b=_0x7fb9b7?_0x5dd7c1[_0x5fba('0x31')]:_0x392298[_0x5fba('0x2f')]+_0x392298[_0x5fba('0x32')];var _0x4d2142;if(_0x538f7b>=_0x58a332){_0x538f7b=_0x58a332;_0x4d2142=0xc8;}else{_0x4d2142=0xce;}_0x5b066e[_0x5fba('0x2c')](_0x4d2142);return _0x5b066e[_0x5fba('0x33')](_0x5fba('0x34'),_0x197d13+'-'+_0x538f7b+'/'+_0x58a332)['json'](_0x5dd7c1);}return null;};}function patchUpdates(_0x2f5e6e){return function(_0x1bec1f){try{jsonpatch['apply'](_0x1bec1f,_0x2f5e6e,!![]);}catch(_0x597a43){return BPromise[_0x5fba('0x35')](_0x597a43);}return _0x1bec1f[_0x5fba('0x36')]();};}function saveUpdates(_0x4e25e6,_0x232d7d){return function(_0x4f531e){if(_0x4f531e){return _0x4f531e[_0x5fba('0x37')](_0x4e25e6)['then'](function(_0x4929bf){return _0x4929bf;});}return null;};}function removeEntity(_0x1d2347,_0x2fa953){return function(_0x1522e6){if(_0x1522e6){return _0x1522e6[_0x5fba('0x38')]()['then'](function(){var _0x108ddb=_0x1522e6[_0x5fba('0x39')]({'plain':!![]});var _0x1b3a3c=_0x5fba('0x3a');return db[_0x5fba('0x3b')][_0x5fba('0x38')]({'where':{'type':_0x1b3a3c,'resourceId':_0x108ddb['id']}})[_0x5fba('0x20')](function(){return _0x1522e6;});})['then'](function(){_0x1d2347[_0x5fba('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39f544,_0x5ca231){return function(_0x3a7f6b){if(!_0x3a7f6b){_0x39f544['sendStatus'](0x194);}return _0x3a7f6b;};}function handleError(_0x5684ca,_0x5f18aa){_0x5f18aa=_0x5f18aa||0x1f4;return function(_0x3b703b){logger[_0x5fba('0x25')](_0x3b703b[_0x5fba('0x3c')]);if(_0x3b703b[_0x5fba('0x3d')]){delete _0x3b703b[_0x5fba('0x3d')];}_0x5684ca['status'](_0x5f18aa)['send'](_0x3b703b);};}exports[_0x5fba('0x3e')]=function(_0x337e68,_0x17abb4){var _0x5810c5={'include':[{'model':db['Pause'],'as':_0x5fba('0x3f')}]},_0x2a7106={},_0x2b98bf={'count':0x0,'rows':[]};var _0x5f2fd8=_['map'](db[_0x5fba('0x40')]['rawAttributes'],function(_0x28e525){return{'name':_0x28e525['fieldName'],'type':_0x28e525['type'][_0x5fba('0x41')]};});_0x2a7106[_0x5fba('0x42')]=_[_0x5fba('0x43')](_0x5f2fd8,'name');_0x2a7106['query']=_[_0x5fba('0x44')](_0x337e68[_0x5fba('0x45')]);_0x2a7106[_0x5fba('0x46')]=_[_0x5fba('0x47')](_0x2a7106[_0x5fba('0x42')],_0x2a7106[_0x5fba('0x45')]);_0x5810c5[_0x5fba('0x48')]=_[_0x5fba('0x47')](_0x2a7106[_0x5fba('0x42')],qs[_0x5fba('0x49')](_0x337e68['query'][_0x5fba('0x49')]));_0x5810c5[_0x5fba('0x48')]=_0x5810c5[_0x5fba('0x48')][_0x5fba('0x4a')]?_0x5810c5['attributes']:_0x2a7106[_0x5fba('0x42')];if(!_0x337e68[_0x5fba('0x45')][_0x5fba('0x4b')](_0x5fba('0x4c'))){_0x5810c5['limit']=qs[_0x5fba('0x32')](_0x337e68[_0x5fba('0x45')]['limit']);_0x5810c5[_0x5fba('0x2f')]=qs[_0x5fba('0x2f')](_0x337e68[_0x5fba('0x45')]['offset']);}_0x5810c5[_0x5fba('0x4d')]=qs[_0x5fba('0x4e')](_0x337e68['query'][_0x5fba('0x4e')]);_0x5810c5[_0x5fba('0x4f')]=qs[_0x5fba('0x46')](_['pick'](_0x337e68[_0x5fba('0x45')],_0x2a7106[_0x5fba('0x46')]),_0x5f2fd8);if(_0x337e68[_0x5fba('0x45')][_0x5fba('0x50')]){_0x5810c5['where']=_[_0x5fba('0x51')](_0x5810c5['where'],{'$or':_[_0x5fba('0x43')](_0x5f2fd8,function(_0x206ef6){if(_0x206ef6[_0x5fba('0x52')]!==_0x5fba('0x53')){var _0x20e027={};_0x20e027[_0x206ef6[_0x5fba('0x3d')]]={'$like':'%'+_0x337e68[_0x5fba('0x45')][_0x5fba('0x50')]+'%'};return _0x20e027;}})});}_0x5810c5=_['merge']({},_0x5810c5,_0x337e68[_0x5fba('0x54')]);var _0x5580bd={'where':_0x5810c5[_0x5fba('0x4f')]};return db[_0x5fba('0x40')][_0x5fba('0x31')](_0x5580bd)[_0x5fba('0x20')](function(_0x1493ce){_0x2b98bf[_0x5fba('0x31')]=_0x1493ce;if(_0x337e68['query'][_0x5fba('0x55')]){_0x5810c5[_0x5fba('0x56')]=[{'all':!![]}];}return db[_0x5fba('0x40')][_0x5fba('0x57')](_0x5810c5);})[_0x5fba('0x20')](function(_0x3b5d1e){_0x2b98bf[_0x5fba('0x58')]=_0x3b5d1e;return _0x2b98bf;})[_0x5fba('0x20')](respondWithFilteredResult(_0x17abb4,_0x5810c5))[_0x5fba('0x2a')](handleError(_0x17abb4,null));};exports[_0x5fba('0x59')]=function(_0x1cb7f1,_0xfef7bc){var _0x4494a8={'raw':![],'where':{'id':_0x1cb7f1[_0x5fba('0x5a')]['id']},'include':[{'model':db[_0x5fba('0x5b')],'as':_0x5fba('0x3f')}]},_0x82c5fa={};_0x82c5fa['model']=_[_0x5fba('0x44')](db[_0x5fba('0x40')]['rawAttributes']);_0x82c5fa[_0x5fba('0x45')]=_[_0x5fba('0x44')](_0x1cb7f1['query']);_0x82c5fa[_0x5fba('0x46')]=_['intersection'](_0x82c5fa[_0x5fba('0x42')],_0x82c5fa['query']);_0x4494a8[_0x5fba('0x48')]=_[_0x5fba('0x47')](_0x82c5fa[_0x5fba('0x42')],qs['fields'](_0x1cb7f1[_0x5fba('0x45')][_0x5fba('0x49')]));_0x4494a8[_0x5fba('0x48')]=_0x4494a8[_0x5fba('0x48')][_0x5fba('0x4a')]?_0x4494a8[_0x5fba('0x48')]:_0x82c5fa[_0x5fba('0x42')];if(_0x1cb7f1[_0x5fba('0x45')]['includeAll']){_0x4494a8[_0x5fba('0x56')]=[{'all':!![]}];}_0x4494a8=_[_0x5fba('0x51')]({},_0x4494a8,_0x1cb7f1['options']);return db[_0x5fba('0x40')]['find'](_0x4494a8)[_0x5fba('0x20')](handleEntityNotFound(_0xfef7bc,null))[_0x5fba('0x20')](respondWithResult(_0xfef7bc,null))[_0x5fba('0x2a')](handleError(_0xfef7bc,null));};exports[_0x5fba('0x5c')]=function(_0x4383a9,_0xf1f73c){return db[_0x5fba('0x40')][_0x5fba('0x5c')](_0x4383a9[_0x5fba('0x5d')],{})[_0x5fba('0x20')](function(_0x5cf242){var _0x18cb3=_0x4383a9[_0x5fba('0x5e')][_0x5fba('0x39')]({'plain':!![]});if(!_0x18cb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18cb3['role']===_0x5fba('0x5e')){var _0x4517a=_0x5cf242[_0x5fba('0x39')]({'plain':!![]});var _0x12ea94='FaxAccounts';return db[_0x5fba('0x5f')][_0x5fba('0x60')]({'where':{'name':_0x12ea94,'userProfileId':_0x18cb3[_0x5fba('0x61')]},'raw':!![]})[_0x5fba('0x20')](function(_0x465d8a){if(_0x465d8a&&_0x465d8a[_0x5fba('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x4517a[_0x5fba('0x3d')],'resourceId':_0x4517a['id'],'type':_0x465d8a['name'],'sectionId':_0x465d8a['id']},{})[_0x5fba('0x20')](function(){return _0x5cf242;});}else{return _0x5cf242;}})[_0x5fba('0x2a')](function(_0x541dfa){logger[_0x5fba('0x25')](_0x5fba('0x63'),_0x541dfa);throw _0x541dfa;});}return _0x5cf242;})[_0x5fba('0x20')](respondWithResult(_0xf1f73c,0xc9))[_0x5fba('0x2a')](handleError(_0xf1f73c,null));};exports[_0x5fba('0x37')]=function(_0x55de4b,_0x254e04){if(_0x55de4b[_0x5fba('0x5d')]['id']){delete _0x55de4b[_0x5fba('0x5d')]['id'];}return db[_0x5fba('0x40')]['find']({'where':{'id':_0x55de4b[_0x5fba('0x5a')]['id']},'include':[{'model':db[_0x5fba('0x5b')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x254e04,null))[_0x5fba('0x20')](saveUpdates(_0x55de4b[_0x5fba('0x5d')],null))[_0x5fba('0x20')](respondWithResult(_0x254e04,null))[_0x5fba('0x2a')](handleError(_0x254e04,null));};exports['destroy']=function(_0x1beab4,_0x3d6bb9){return db[_0x5fba('0x40')][_0x5fba('0x60')]({'where':{'id':_0x1beab4['params']['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x3d6bb9,null))[_0x5fba('0x20')](removeEntity(_0x3d6bb9,null))['catch'](handleError(_0x3d6bb9,null));};exports[_0x5fba('0x64')]=function(_0x24bb34,_0x26cce4){return db[_0x5fba('0x40')][_0x5fba('0x64')]()[_0x5fba('0x20')](respondWithResult(_0x26cce4,null))[_0x5fba('0x2a')](handleError(_0x26cce4,null));};exports[_0x5fba('0x65')]=function(_0x391164,_0x5147df,_0x2f0555){if(_0x391164[_0x5fba('0x5d')]['id']){delete _0x391164[_0x5fba('0x5d')]['id'];}return db[_0x5fba('0x40')][_0x5fba('0x60')]({'where':{'id':_0x391164[_0x5fba('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5147df,null))[_0x5fba('0x20')](function(_0x544c25){if(_0x544c25){_0x391164[_0x5fba('0x5d')]['FaxAccountId']=_0x544c25['id'];return db[_0x5fba('0x66')][_0x5fba('0x5c')](_0x391164[_0x5fba('0x5d')]);}})['then'](respondWithResult(_0x5147df,null))[_0x5fba('0x2a')](handleError(_0x5147df,null));};exports['getDispositions']=function(_0x2a07ae,_0x465431,_0x57c5b3){var _0x3c2eae={'raw':![],'where':{}};var _0x49e624={};var _0x1a56dc={'count':0x0,'rows':[]};return db[_0x5fba('0x40')][_0x5fba('0x67')]({'where':{'id':_0x2a07ae['params']['id']}})['then'](handleEntityNotFound(_0x465431,null))[_0x5fba('0x20')](function(_0x507eb4){if(_0x507eb4){_0x49e624[_0x5fba('0x42')]=_[_0x5fba('0x44')](db[_0x5fba('0x66')][_0x5fba('0x68')]);_0x49e624[_0x5fba('0x45')]=_[_0x5fba('0x44')](_0x2a07ae[_0x5fba('0x45')]);_0x49e624[_0x5fba('0x46')]=_['intersection'](_0x49e624[_0x5fba('0x42')],_0x49e624[_0x5fba('0x45')]);_0x3c2eae['attributes']=_[_0x5fba('0x47')](_0x49e624[_0x5fba('0x42')],qs['fields'](_0x2a07ae[_0x5fba('0x45')][_0x5fba('0x49')]));_0x3c2eae[_0x5fba('0x48')]=_0x3c2eae[_0x5fba('0x48')][_0x5fba('0x4a')]?_0x3c2eae[_0x5fba('0x48')]:_0x49e624[_0x5fba('0x42')];if(!_0x2a07ae[_0x5fba('0x45')][_0x5fba('0x4b')](_0x5fba('0x4c'))){_0x3c2eae['limit']=qs[_0x5fba('0x32')](_0x2a07ae[_0x5fba('0x45')][_0x5fba('0x32')]);_0x3c2eae[_0x5fba('0x2f')]=qs[_0x5fba('0x2f')](_0x2a07ae[_0x5fba('0x45')][_0x5fba('0x2f')]);}_0x3c2eae[_0x5fba('0x4d')]=qs[_0x5fba('0x4e')](_0x2a07ae[_0x5fba('0x45')][_0x5fba('0x4e')]);_0x3c2eae['where']=qs[_0x5fba('0x46')](_[_0x5fba('0x69')](_0x2a07ae[_0x5fba('0x45')],_0x49e624[_0x5fba('0x46')]));_0x3c2eae[_0x5fba('0x4f')][_0x5fba('0x6a')]=_0x507eb4['id'];if(_0x2a07ae[_0x5fba('0x45')][_0x5fba('0x50')]){_0x3c2eae[_0x5fba('0x4f')]=_[_0x5fba('0x51')](_0x3c2eae[_0x5fba('0x4f')],{'$or':_['map'](_0x3c2eae['attributes'],function(_0x43db04){var _0x2b2388={};_0x2b2388[_0x43db04]={'$like':'%'+_0x2a07ae[_0x5fba('0x45')][_0x5fba('0x50')]+'%'};return _0x2b2388;})});}_0x3c2eae=_[_0x5fba('0x51')]({},_0x3c2eae,_0x2a07ae[_0x5fba('0x54')]);return db['Disposition'][_0x5fba('0x31')]({'where':_0x3c2eae[_0x5fba('0x4f')]})['then'](function(_0x57699a){_0x1a56dc[_0x5fba('0x31')]=_0x57699a;if(_0x2a07ae['query'][_0x5fba('0x55')]){_0x3c2eae[_0x5fba('0x56')]=[{'all':!![]}];}return db[_0x5fba('0x66')]['findAll'](_0x3c2eae);})[_0x5fba('0x20')](function(_0x33d082){_0x1a56dc[_0x5fba('0x58')]=_0x33d082;return _0x1a56dc;});}})['then'](respondWithFilteredResult(_0x465431,_0x3c2eae))[_0x5fba('0x2a')](handleError(_0x465431,null));};exports[_0x5fba('0x6b')]=function(_0x237a43,_0x467f37,_0x51cba1){return db[_0x5fba('0x40')][_0x5fba('0x60')]({'where':{'id':_0x237a43[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x467f37,null))[_0x5fba('0x20')](function(_0x155cfb){if(_0x155cfb){return _0x155cfb[_0x5fba('0x6b')](_0x237a43[_0x5fba('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x467f37,null))[_0x5fba('0x2a')](handleError(_0x467f37,null));};exports[_0x5fba('0x6c')]=function(_0x374b0a,_0x3ef93e,_0x2bed9d){if(_0x374b0a[_0x5fba('0x5d')]['id']){delete _0x374b0a[_0x5fba('0x5d')]['id'];}return db['FaxAccount'][_0x5fba('0x60')]({'where':{'id':_0x374b0a['params']['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x3ef93e,null))[_0x5fba('0x20')](function(_0x51315d){if(_0x51315d){_0x374b0a['body'][_0x5fba('0x6a')]=_0x51315d['id'];return db[_0x5fba('0x6d')][_0x5fba('0x5c')](_0x374b0a[_0x5fba('0x5d')]);}})[_0x5fba('0x20')](respondWithResult(_0x3ef93e,null))[_0x5fba('0x2a')](handleError(_0x3ef93e,null));};exports[_0x5fba('0x6e')]=function(_0x541e0f,_0x4c1325,_0x1a6566){var _0x178df8={'raw':![],'where':{}};var _0xa5afce={};var _0x30fb0c={'count':0x0,'rows':[]};return db[_0x5fba('0x40')]['findOne']({'where':{'id':_0x541e0f[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x4c1325,null))['then'](function(_0x17f289){if(_0x17f289){_0xa5afce[_0x5fba('0x42')]=_['keys'](db[_0x5fba('0x6d')][_0x5fba('0x68')]);_0xa5afce[_0x5fba('0x45')]=_[_0x5fba('0x44')](_0x541e0f[_0x5fba('0x45')]);_0xa5afce[_0x5fba('0x46')]=_['intersection'](_0xa5afce[_0x5fba('0x42')],_0xa5afce[_0x5fba('0x45')]);_0x178df8[_0x5fba('0x48')]=_['intersection'](_0xa5afce[_0x5fba('0x42')],qs[_0x5fba('0x49')](_0x541e0f[_0x5fba('0x45')][_0x5fba('0x49')]));_0x178df8[_0x5fba('0x48')]=_0x178df8['attributes']['length']?_0x178df8[_0x5fba('0x48')]:_0xa5afce[_0x5fba('0x42')];if(!_0x541e0f[_0x5fba('0x45')][_0x5fba('0x4b')](_0x5fba('0x4c'))){_0x178df8[_0x5fba('0x32')]=qs['limit'](_0x541e0f[_0x5fba('0x45')][_0x5fba('0x32')]);_0x178df8[_0x5fba('0x2f')]=qs[_0x5fba('0x2f')](_0x541e0f[_0x5fba('0x45')][_0x5fba('0x2f')]);}_0x178df8['order']=qs['sort'](_0x541e0f[_0x5fba('0x45')]['sort']);_0x178df8[_0x5fba('0x4f')]=qs['filters'](_[_0x5fba('0x69')](_0x541e0f['query'],_0xa5afce[_0x5fba('0x46')]));_0x178df8['where']['FaxAccountId']=_0x17f289['id'];if(_0x541e0f['query'][_0x5fba('0x50')]){_0x178df8[_0x5fba('0x4f')]=_[_0x5fba('0x51')](_0x178df8[_0x5fba('0x4f')],{'$or':_[_0x5fba('0x43')](_0x178df8[_0x5fba('0x48')],function(_0x4c4077){var _0x2961bb={};_0x2961bb[_0x4c4077]={'$like':'%'+_0x541e0f[_0x5fba('0x45')][_0x5fba('0x50')]+'%'};return _0x2961bb;})});}_0x178df8=_[_0x5fba('0x51')]({},_0x178df8,_0x541e0f[_0x5fba('0x54')]);return db[_0x5fba('0x6d')]['count']({'where':_0x178df8[_0x5fba('0x4f')]})[_0x5fba('0x20')](function(_0x33c1c0){_0x30fb0c['count']=_0x33c1c0;if(_0x541e0f[_0x5fba('0x45')]['includeAll']){_0x178df8['include']=[{'all':!![]}];}return db[_0x5fba('0x6d')][_0x5fba('0x57')](_0x178df8);})[_0x5fba('0x20')](function(_0x147fd5){_0x30fb0c[_0x5fba('0x58')]=_0x147fd5;return _0x30fb0c;});}})[_0x5fba('0x20')](respondWithFilteredResult(_0x4c1325,_0x178df8))['catch'](handleError(_0x4c1325,null));};exports[_0x5fba('0x6f')]=function(_0x1de0a3,_0x308fa7,_0x59b4b6){return db['FaxAccount'][_0x5fba('0x60')]({'where':{'id':_0x1de0a3[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x308fa7,null))['then'](function(_0x48362a){if(_0x48362a){return _0x48362a[_0x5fba('0x6f')](_0x1de0a3[_0x5fba('0x45')]['ids']);}})[_0x5fba('0x20')](respondWithStatusCode(_0x308fa7,null))[_0x5fba('0x2a')](handleError(_0x308fa7,null));};exports[_0x5fba('0x70')]=function(_0xd0ca72,_0x5b47a5,_0x36869c){return db[_0x5fba('0x71')]['find']({'where':{'id':_0xd0ca72[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x5b47a5,null))[_0x5fba('0x20')](function(_0x5431a3){if(_0x5431a3){return _0x5431a3['addInteraction'](_0xd0ca72[_0x5fba('0x5d')][_0x5fba('0x72')],_['omit'](_0xd0ca72[_0x5fba('0x5d')],[_0x5fba('0x72'),'id'])||{});}})[_0x5fba('0x20')](respondWithResult(_0x5b47a5,null))['catch'](handleError(_0x5b47a5,null));};exports['getInteractions']=function(_0x49e8ef,_0x8daebb,_0x10a532){var _0xb3949d={'raw':![],'where':{}};var _0x3324c2={};var _0x4024c1={'count':0x0,'rows':[]};return db[_0x5fba('0x40')][_0x5fba('0x67')]({'where':{'id':_0x49e8ef[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x8daebb,null))[_0x5fba('0x20')](function(_0x504a6f){if(_0x504a6f){_0x3324c2[_0x5fba('0x42')]=_[_0x5fba('0x44')](db[_0x5fba('0x71')][_0x5fba('0x68')]);_0x3324c2['query']=_[_0x5fba('0x44')](_0x49e8ef[_0x5fba('0x45')]);_0x3324c2['filters']=_[_0x5fba('0x47')](_0x3324c2[_0x5fba('0x42')],_0x3324c2[_0x5fba('0x45')]);_0xb3949d[_0x5fba('0x48')]=_['intersection'](_0x3324c2['model'],qs[_0x5fba('0x49')](_0x49e8ef[_0x5fba('0x45')][_0x5fba('0x49')]));_0xb3949d['attributes']=_0xb3949d[_0x5fba('0x48')]['length']?_0xb3949d['attributes']:_0x3324c2[_0x5fba('0x42')];if(!_0x49e8ef[_0x5fba('0x45')]['hasOwnProperty'](_0x5fba('0x4c'))){_0xb3949d[_0x5fba('0x32')]=qs[_0x5fba('0x32')](_0x49e8ef[_0x5fba('0x45')][_0x5fba('0x32')]);_0xb3949d[_0x5fba('0x2f')]=qs[_0x5fba('0x2f')](_0x49e8ef[_0x5fba('0x45')][_0x5fba('0x2f')]);}_0xb3949d[_0x5fba('0x4d')]=qs['sort'](_0x49e8ef['query'][_0x5fba('0x4e')]);_0xb3949d[_0x5fba('0x4f')]=qs[_0x5fba('0x46')](_[_0x5fba('0x69')](_0x49e8ef['query'],_0x3324c2['filters']));_0xb3949d['where']['FaxAccountId']=_0x504a6f['id'];if(_0x49e8ef['query'][_0x5fba('0x50')]){_0xb3949d[_0x5fba('0x4f')]=_[_0x5fba('0x51')](_0xb3949d['where'],{'$or':_[_0x5fba('0x43')](_0xb3949d['attributes'],function(_0x1e44d4){var _0x15b1f3={};_0x15b1f3[_0x1e44d4]={'$like':'%'+_0x49e8ef[_0x5fba('0x45')][_0x5fba('0x50')]+'%'};return _0x15b1f3;})});}_0xb3949d=_[_0x5fba('0x51')]({},_0xb3949d,_0x49e8ef[_0x5fba('0x54')]);return db[_0x5fba('0x71')][_0x5fba('0x31')]({'where':_0xb3949d[_0x5fba('0x4f')]})['then'](function(_0x3698c3){_0x4024c1['count']=_0x3698c3;if(_0x49e8ef['query'][_0x5fba('0x55')]){_0xb3949d[_0x5fba('0x56')]=[{'model':db['CmContact'],'as':_0x5fba('0x73'),'required':![]},{'model':db[_0x5fba('0x74')],'as':_0x5fba('0x75'),'attributes':['name','fullname',_0x5fba('0x76')],'required':![]},{'model':db[_0x5fba('0x77')],'as':'Tags','attributes':['id',_0x5fba('0x3d'),_0x5fba('0x78')],'where':_0x49e8ef[_0x5fba('0x45')]['tag']?{'id':_0x49e8ef['query'][_0x5fba('0x79')]}:undefined,'required':_0x49e8ef[_0x5fba('0x45')][_0x5fba('0x79')]?!![]:![]}];}return db[_0x5fba('0x71')][_0x5fba('0x57')](_0xb3949d);})[_0x5fba('0x20')](function(_0x12d389){_0x4024c1[_0x5fba('0x58')]=_0x12d389;return _0x4024c1;});}})[_0x5fba('0x20')](respondWithFilteredResult(_0x8daebb,_0xb3949d))['catch'](handleError(_0x8daebb,null));};exports[_0x5fba('0x7a')]=function(_0x24765e,_0x462796){var _0x359e7b=_0x24765e[_0x5fba('0x5a')]['id'];var _0x2a15b0=_0x24765e[_0x5fba('0x5d')];var _0x552820=0xc8;var _0x1d9bfe=null;return db[_0x5fba('0x7b')][_0x5fba('0x7c')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x5fba('0x7d')]},function(_0xf95d8e){return db[_0x5fba('0x40')][_0x5fba('0x67')]({'where':{'id':_0x359e7b},'transaction':_0xf95d8e})[_0x5fba('0x20')](function(_0x1d97b3){if(_0x1d97b3){return db['FaxApplication'][_0x5fba('0x38')]({'where':{'FaxAccountId':_0x359e7b},'transaction':_0xf95d8e})[_0x5fba('0x20')](function(){var _0x299ab2=_['map'](_0x2a15b0,function(_0x3ada08){_0x3ada08[_0x5fba('0x6a')]=_0x359e7b;return _0x3ada08;});return db[_0x5fba('0x7e')][_0x5fba('0x7f')](_0x299ab2,{'transaction':_0xf95d8e});});}else{_0x552820=0x194;_0x1d9bfe=[];}});})['then'](function(){if(_0x552820!==0x194){return db[_0x5fba('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x359e7b},'order':_0x5fba('0x80')})[_0x5fba('0x20')](function(_0x10cdd4){_0x1d9bfe=_0x10cdd4;});}})[_0x5fba('0x2a')](function(_0x1d97d7){_0x552820=0x1f4;logger[_0x5fba('0x25')](_0x1d97d7[_0x5fba('0x3c')]);if(_0x1d97d7['name']){delete _0x1d97d7[_0x5fba('0x3d')];}_0x1d9bfe=_0x1d97d7;})[_0x5fba('0x81')](function(){if(_0x1d9bfe===null){_0x462796[_0x5fba('0x2b')](_0x552820);}else{if(_0x552820===0x1f4){_0x462796['status'](_0x552820)[_0x5fba('0x82')](_0x1d9bfe);}else{_0x462796['status'](_0x552820)[_0x5fba('0x2e')](_0x1d9bfe);}}});};exports['getApplications']=function(_0x15226e,_0x2452ca,_0x248a85){var _0x22bf67={};var _0x57340a={};var _0x2a3aac;var _0x4b90ab;return db['FaxAccount'][_0x5fba('0x67')]({'where':{'id':_0x15226e[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x2452ca,null))[_0x5fba('0x20')](function(_0x3a965f){if(_0x3a965f){_0x2a3aac=_0x3a965f;_0x57340a[_0x5fba('0x42')]=_[_0x5fba('0x44')](db['FaxApplication'][_0x5fba('0x68')]);_0x57340a[_0x5fba('0x45')]=_['keys'](_0x15226e[_0x5fba('0x45')]);_0x57340a['filters']=_[_0x5fba('0x47')](_0x57340a[_0x5fba('0x42')],_0x57340a[_0x5fba('0x45')]);_0x22bf67[_0x5fba('0x48')]=_[_0x5fba('0x47')](_0x57340a[_0x5fba('0x42')],qs[_0x5fba('0x49')](_0x15226e[_0x5fba('0x45')][_0x5fba('0x49')]));_0x22bf67[_0x5fba('0x48')]=_0x22bf67[_0x5fba('0x48')][_0x5fba('0x4a')]?_0x22bf67[_0x5fba('0x48')]:_0x57340a[_0x5fba('0x42')];_0x22bf67['order']=qs[_0x5fba('0x4e')](_0x15226e[_0x5fba('0x45')][_0x5fba('0x4e')]);_0x22bf67[_0x5fba('0x4f')]=qs['filters'](_[_0x5fba('0x69')](_0x15226e[_0x5fba('0x45')],_0x57340a[_0x5fba('0x46')]));if(_0x15226e[_0x5fba('0x45')]['filter']){_0x22bf67[_0x5fba('0x4f')]=_[_0x5fba('0x51')](_0x22bf67[_0x5fba('0x4f')],{'$or':_[_0x5fba('0x43')](_0x22bf67[_0x5fba('0x48')],function(_0x6d527c){var _0x182ff3={};_0x182ff3[_0x6d527c]={'$like':'%'+_0x15226e[_0x5fba('0x45')][_0x5fba('0x50')]+'%'};return _0x182ff3;})});}_0x22bf67=_['merge']({},_0x22bf67,_0x15226e[_0x5fba('0x54')]);return _0x2a3aac[_0x5fba('0x83')](_0x22bf67);}})[_0x5fba('0x20')](function(_0x4fe943){if(_0x4fe943){_0x4b90ab=_0x4fe943[_0x5fba('0x4a')];if(!_0x15226e[_0x5fba('0x45')][_0x5fba('0x4b')]('nolimit')){_0x22bf67[_0x5fba('0x32')]=qs[_0x5fba('0x32')](_0x15226e['query']['limit']);_0x22bf67['offset']=qs[_0x5fba('0x2f')](_0x15226e['query']['offset']);}return _0x2a3aac[_0x5fba('0x83')](_0x22bf67);}})[_0x5fba('0x20')](function(_0x3c2f02){if(_0x3c2f02){return _0x3c2f02?{'count':_0x4b90ab,'rows':_0x3c2f02}:null;}})['then'](respondWithResult(_0x2452ca,null))[_0x5fba('0x2a')](handleError(_0x2452ca,null));};function Extension(_0x4821ab,_0x187cfd,_0x15dc01,_0x57c6cf){this[_0x5fba('0x84')]=_0x5fba('0x85');this['exten']=_0x4821ab[_0x5fba('0x86')];this[_0x5fba('0x87')]=_0x57c6cf;this['type']=_0x5fba('0x88');this[_0x5fba('0x89')]=_0x5fba('0x8a');this[_0x5fba('0x6a')]=_0x4821ab['id'];this[_0x5fba('0x80')]=_0x187cfd;this[_0x5fba('0x8b')]=_0x15dc01;}function createExtensionsReciveFax(_0x1ee39d){var _0x59f587=0x1;var _0x89ab3f=[];_0x89ab3f[_0x5fba('0x8c')](new Extension(_0x1ee39d,_0x59f587,'','Answer'));_0x59f587+=0x1;_0x89ab3f[_0x5fba('0x8c')](new Extension(_0x1ee39d,_0x59f587,_0x5fba('0x8d'),'Set'));_0x59f587+=0x1;for(var _0x1e3a0e in _0x1ee39d){if(_0x1ee39d[_0x5fba('0x4b')](_0x1e3a0e)&&(_0x1e3a0e===_0x5fba('0x8e')||_0x1e3a0e==='localstationid'||_0x1e3a0e===_0x5fba('0x8f')||_0x1e3a0e==='faxdetect'||_0x1e3a0e===_0x5fba('0x90')||_0x1e3a0e==='maxrate'||_0x1e3a0e==='minrate'||_0x1e3a0e===_0x5fba('0x91')||_0x1e3a0e==='t38timeout')){_0x89ab3f[_0x5fba('0x8c')](new Extension(_0x1ee39d,_0x59f587,_0x5fba('0x92')+_0x1e3a0e+')='+_0x1ee39d[_0x1e3a0e],_0x5fba('0x93')));_0x59f587+=0x1;}}_0x89ab3f[_0x5fba('0x8c')](new Extension(_0x1ee39d,_0x59f587,'6','Wait'));_0x59f587+=0x1;_0x89ab3f[_0x5fba('0x8c')](new Extension(_0x1ee39d,_0x59f587,_0x5fba('0x94'),_0x5fba('0x95')));_0x59f587=0x0;return _0x89ab3f;}exports[_0x5fba('0x96')]=function(_0x28589f,_0x480dc3,_0x7a7405){var _0x2bb48f;return db[_0x5fba('0x7b')]['transaction'](function(_0x2d2425){return db[_0x5fba('0x40')][_0x5fba('0x5c')](_0x28589f[_0x5fba('0x5d')],{'transaction':_0x2d2425})[_0x5fba('0x20')](function(_0x2c6558){_0x2bb48f=_0x2c6558[_0x5fba('0x39')]({'plain':!![]});return db[_0x5fba('0x97')][_0x5fba('0x7f')](createExtensionsReciveFax(_0x2bb48f),{'transaction':_0x2d2425});});})[_0x5fba('0x20')](function(){return _0x2bb48f;})['then'](respondWithResult(_0x480dc3,null))[_0x5fba('0x2a')](handleError(_0x480dc3,null));};exports[_0x5fba('0x98')]=function(_0x5450ee,_0x34a17a,_0x1eced6){var _0x9f79ad;return db['sequelize']['transaction'](function(_0x321b4d){return db[_0x5fba('0x40')]['update'](_0x5450ee['body'],{'where':{'id':_0x5450ee['body']['id']},'transaction':_0x321b4d})[_0x5fba('0x20')](function(_0x42c572){return db[_0x5fba('0x97')][_0x5fba('0x38')]({'where':{'FaxAccountId':_0x5450ee[_0x5fba('0x5d')]['id']},'transaction':_0x321b4d})[_0x5fba('0x20')](function(_0x5ce715){return db[_0x5fba('0x97')][_0x5fba('0x7f')](createExtensionsReciveFax(_[_0x5fba('0x99')](_0x5450ee[_0x5fba('0x5d')],[_0x5fba('0x9a'),_0x5fba('0x41'),_0x5fba('0x9b'),_0x5fba('0x9c'),_0x5fba('0x9d'),'ListId'])),{'transaction':_0x321b4d});});});})[_0x5fba('0x20')](function(){return db[_0x5fba('0x40')][_0x5fba('0x9e')](_0x5450ee[_0x5fba('0x5d')]['id']);})[_0x5fba('0x20')](respondWithResult(_0x34a17a,null))['catch'](handleError(_0x34a17a,null));};exports[_0x5fba('0x9f')]=function(_0x383373,_0x4ed9bc,_0x2dc0ee){var _0x50c789={'raw':!![],'where':{}};var _0x4bac51={};var _0x416093={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x383373[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x4ed9bc,null))[_0x5fba('0x20')](function(_0x31c4a6){if(_0x31c4a6){_0x4bac51[_0x5fba('0x42')]=_[_0x5fba('0x44')](db[_0x5fba('0xa0')]['rawAttributes']);_0x4bac51[_0x5fba('0x45')]=_[_0x5fba('0x44')](_0x383373['query']);_0x4bac51[_0x5fba('0x46')]=_[_0x5fba('0x47')](_0x4bac51[_0x5fba('0x42')],_0x4bac51[_0x5fba('0x45')]);_0x50c789[_0x5fba('0x48')]=_[_0x5fba('0x47')](_0x4bac51[_0x5fba('0x42')],qs[_0x5fba('0x49')](_0x383373[_0x5fba('0x45')][_0x5fba('0x49')]));_0x50c789['attributes']=_0x50c789[_0x5fba('0x48')][_0x5fba('0x4a')]?_0x50c789[_0x5fba('0x48')]:_0x4bac51[_0x5fba('0x42')];if(!_0x383373['query'][_0x5fba('0x4b')]('nolimit')){_0x50c789[_0x5fba('0x32')]=qs[_0x5fba('0x32')](_0x383373[_0x5fba('0x45')][_0x5fba('0x32')]);_0x50c789[_0x5fba('0x2f')]=qs[_0x5fba('0x2f')](_0x383373['query'][_0x5fba('0x2f')]);}_0x50c789[_0x5fba('0x4d')]=qs['sort'](_0x383373['query'][_0x5fba('0x4e')]);_0x50c789[_0x5fba('0x4f')]=qs['filters'](_['pick'](_0x383373[_0x5fba('0x45')],_0x4bac51[_0x5fba('0x46')]));_0x50c789['where'][_0x5fba('0x6a')]=_0x31c4a6['id'];if(_0x383373['query'][_0x5fba('0x50')]){_0x50c789[_0x5fba('0x4f')]=_[_0x5fba('0x51')](_0x50c789['where'],{'$or':_[_0x5fba('0x43')](_0x50c789[_0x5fba('0x48')],function(_0x356df2){var _0x5c09e6={};_0x5c09e6[_0x356df2]={'$like':'%'+_0x383373['query'][_0x5fba('0x50')]+'%'};return _0x5c09e6;})});}if(_0x383373[_0x5fba('0x45')][_0x5fba('0xa1')]){var _0x39803c=_0x383373[_0x5fba('0x45')]['$gte']['split'](',');var _0x16461e={};_0x16461e[_0x39803c[0x0]]={'$gte':moment(_0x39803c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x50c789['where']=_['merge'](_0x50c789['where'],_0x16461e);}_0x50c789=_[_0x5fba('0x51')]({},_0x50c789,_0x383373['options']);return db[_0x5fba('0xa0')][_0x5fba('0x31')]({'where':_0x50c789['where']})[_0x5fba('0x20')](function(_0x120979){_0x416093[_0x5fba('0x31')]=_0x120979;if(_0x383373[_0x5fba('0x45')][_0x5fba('0x55')]){_0x50c789[_0x5fba('0x56')]=[{'all':!![]}];}return db[_0x5fba('0xa0')]['findAll'](_0x50c789);})[_0x5fba('0x20')](function(_0x943171){_0x416093[_0x5fba('0x58')]=_0x943171;return _0x416093;});}})['then'](respondWithFilteredResult(_0x4ed9bc,_0x50c789))[_0x5fba('0x2a')](handleError(_0x4ed9bc,null));};exports[_0x5fba('0x82')]=function(_0x3ad070,_0x167639,_0x27e75d){var _0x55266a,_0x2e36f3={},_0x2d4006;if(_0x3ad070['body']['to']){_0x2d4006=_0x3ad070[_0x5fba('0x5d')]['to'][0x0];}return db[_0x5fba('0x40')][_0x5fba('0x60')]({'where':{'id':_0x3ad070[_0x5fba('0x5a')]['id']},'include':[{'model':db[_0x5fba('0xa2')],'as':_0x5fba('0xa3'),'include':[{'model':db[_0x5fba('0xa4')],'as':_0x5fba('0xa5'),'where':{'fax':_0x2d4006},'limit':0x1,'order':[[_0x5fba('0x9c'),_0x5fba('0xa6')]]}]}]})[_0x5fba('0x20')](handleEntityNotFound(_0x167639,null))[_0x5fba('0x20')](function(_0x5ded3d){_0x55266a=_0x5ded3d;if(_0x3ad070['body']['attachments']&&_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')]['length']){for(var _0x2dfeba=0x0;_0x2dfeba<_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][_0x5fba('0x4a')];_0x2dfeba+=0x1){_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][_0x2dfeba]={'filename':_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][_0x2dfeba][_0x5fba('0x3d')],'id':_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][_0x2dfeba]['id'],'path':path[_0x5fba('0xa8')](config[_0x5fba('0xa9')],'server/files/attachments',_0x3ad070[_0x5fba('0x5d')]['attachments'][_0x2dfeba][_0x5fba('0xaa')])};}}return respondWithRpcPromise(_0x5fba('0xab'),_0x5fba('0xab'),{'FaxAccountId':_[_0x5fba('0xac')](_0x3ad070[_0x5fba('0x5a')]['id'])?undefined:_0x3ad070[_0x5fba('0x5a')]['id'],'path':_[_0x5fba('0xac')](_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][0x0]['path'])?undefined:_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][0x0][_0x5fba('0x6')],'fax':_[_0x5fba('0xac')](_0x3ad070[_0x5fba('0x5d')]['to'][0x0])?undefined:_0x3ad070[_0x5fba('0x5d')]['to'][0x0]},client9002);})[_0x5fba('0x20')](function(){if(_0x55266a){if(_['isNil'](_0x3ad070['body'][_0x5fba('0xad')])){_0x3ad070['body'][_0x5fba('0xad')]=util['format'](_0x5fba('0xae'),_0x55266a[_0x5fba('0x3d')],_0x55266a[_0x5fba('0xaf')]);}if(_0x55266a[_0x5fba('0xa3')]){if(_0x55266a[_0x5fba('0xa3')][_0x5fba('0xa5')][_0x5fba('0x4a')]){return _0x55266a[_0x5fba('0xa3')][_0x5fba('0xa5')][0x0];}else{return db[_0x5fba('0xa4')][_0x5fba('0x5c')](_[_0x5fba('0x17')](_0x3ad070[_0x5fba('0x5d')],{'firstName':_0x3ad070[_0x5fba('0x5d')]['to'][0x0],'phone':_0x3ad070['body']['to'][0x0],'fax':_0x3ad070['body']['to'][0x0],'ListId':_0x55266a[_0x5fba('0xb0')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5fba('0xb1'));}})[_0x5fba('0x20')](function(_0x3da873){if(_0x3da873){return db[_0x5fba('0x71')][_0x5fba('0x60')]({'where':{'ContactId':_0x3da873['id'],'closed':![],'FaxAccountId':_0x55266a['id']}})[_0x5fba('0x20')](function(_0x50b8f8){if(_0x50b8f8){return[_0x50b8f8,![]];}return db[_0x5fba('0x71')][_0x5fba('0x5c')]({'UserId':_0x3ad070['user']['id'],'ContactId':_0x3da873['id'],'FaxAccountId':_0x55266a['id'],'fax':_0x3ad070[_0x5fba('0x5d')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x5fba('0x51')](_0x3ad070[_0x5fba('0x5d')],{'read':![],'body':_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][0x0][_0x5fba('0xb2')],'FaxAccountId':_0x55266a['id'],'UserId':_0x3ad070[_0x5fba('0x5e')]['id'],'ContactId':_0x3da873['id'],'AttachmentId':_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x5fba('0xa0')],'as':_0x5fba('0xb3')}]})[_0x5fba('0x20')](function(_0x43e3c2){return[_0x43e3c2,!![]];});});}else{throw new Error(_0x5fba('0xb4'));}})[_0x5fba('0xb5')](function(_0x21666c,_0x1e4709){if(_0x1e4709){return _0x21666c;}return db[_0x5fba('0xa0')]['create']({'direction':'out','read':![],'body':_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][0x0]['filename'],'FaxAccountId':_0x55266a['id'],'FaxInteractionId':_0x21666c['id'],'UserId':_0x3ad070['user']['id'],'ContactId':_0x21666c[_0x5fba('0xb6')],'AttachmentId':_0x3ad070[_0x5fba('0x5d')]['attachments'][0x0]['id']})[_0x5fba('0x20')](function(_0x3eb62){_0x21666c[_0x5fba('0xb7')][_0x5fba('0xb3')]=[];_0x21666c[_0x5fba('0xb7')][_0x5fba('0xb3')][_0x5fba('0x8c')](_0x3eb62[_0x5fba('0xb7')]);return _0x21666c;});})[_0x5fba('0x20')](function(_0x27221e){respondWithRpcPromise(_0x5fba('0xb8'),_0x5fba('0xb8'),{'FaxAccountId':_['isNil'](_0x3ad070['params']['id'])?undefined:_0x3ad070['params']['id'],'path':_[_0x5fba('0xac')](_0x3ad070[_0x5fba('0x5d')][_0x5fba('0xa7')][0x0]['path'])?undefined:_0x3ad070[_0x5fba('0x5d')]['attachments'][0x0][_0x5fba('0x6')],'fax':_['isNil'](_0x3ad070[_0x5fba('0x5d')]['to'][0x0])?undefined:_0x3ad070[_0x5fba('0x5d')]['to'][0x0],'AttachmentId':_0x3ad070['body'][_0x5fba('0xa7')][0x0]['id']},client9002)['then'](function(_0x507ba1){logger[_0x5fba('0x28')](_0x5fba('0xb9'),_0x507ba1);})[_0x5fba('0x2a')](function(_0x305058){logger[_0x5fba('0x28')](_0x5fba('0xb9'),_0x305058);});return _0x27221e;})[_0x5fba('0x20')](respondWithResult(_0x167639,null))[_0x5fba('0x2a')](handleError(_0x167639,null));};exports[_0x5fba('0xba')]=function(_0x3ae4f4,_0x3743a1,_0x35473c){return db['FaxAccount']['find']({'where':{'id':_0x3ae4f4[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x3743a1,null))[_0x5fba('0x20')](function(_0x3e0ad0){if(_0x3e0ad0){return _0x3e0ad0[_0x5fba('0xba')](_0x3ae4f4[_0x5fba('0x5d')]['ids'],_[_0x5fba('0x99')](_0x3ae4f4[_0x5fba('0x5d')],[_0x5fba('0x72'),'id'])||{})[_0x5fba('0xb5')](function(_0x512980){for(var _0x14ce11=0x0;_0x14ce11<_0x3ae4f4['body'][_0x5fba('0x72')][_0x5fba('0x4a')];_0x14ce11+=0x1){socket[_0x5fba('0xbb')](_0x5fba('0xbc'),{'UserId':Number(_0x3ae4f4[_0x5fba('0x5d')]['ids'][_0x14ce11]),'FaxAccountId':Number(_0x3ae4f4[_0x5fba('0x5a')]['id'])});}return _0x512980;});}})['then'](respondWithResult(_0x3743a1,null))[_0x5fba('0x2a')](handleError(_0x3743a1,null));};exports[_0x5fba('0xbd')]=function(_0x1dfd91,_0xfea1fd,_0x2f7cbb){return db[_0x5fba('0x40')]['find']({'where':{'id':_0x1dfd91['params']['id']}})['then'](handleEntityNotFound(_0xfea1fd,null))[_0x5fba('0x20')](function(_0x47358e){if(_0x47358e){return _0x47358e[_0x5fba('0xbd')](_0x1dfd91['query']['ids'])[_0x5fba('0x20')](function(){if(_[_0x5fba('0xbe')](_0x1dfd91[_0x5fba('0x45')][_0x5fba('0x72')])){for(var _0x2cc39b=0x0;_0x2cc39b<_0x1dfd91['query'][_0x5fba('0x72')]['length'];_0x2cc39b+=0x1){socket[_0x5fba('0xbb')](_0x5fba('0xbf'),{'UserId':Number(_0x1dfd91[_0x5fba('0x45')][_0x5fba('0x72')][_0x2cc39b]),'FaxAccountId':Number(_0x1dfd91[_0x5fba('0x5a')]['id'])});}}else{socket['emit'](_0x5fba('0xbf'),{'UserId':Number(_0x1dfd91['query'][_0x5fba('0x72')]),'FaxAccountId':Number(_0x1dfd91[_0x5fba('0x5a')]['id'])});}});}})[_0x5fba('0x20')](respondWithStatusCode(_0xfea1fd,null))[_0x5fba('0x2a')](handleError(_0xfea1fd,null));};exports['getAgents']=function(_0x509bf3,_0x2b0565,_0x214045){var _0x40c303={};var _0x427719={};var _0x40b6ae;var _0x39f2f9;return db['FaxAccount'][_0x5fba('0x67')]({'where':{'id':_0x509bf3[_0x5fba('0x5a')]['id']}})[_0x5fba('0x20')](handleEntityNotFound(_0x2b0565,null))['then'](function(_0x3764f0){if(_0x3764f0){_0x40b6ae=_0x3764f0;_0x427719[_0x5fba('0x42')]=_[_0x5fba('0x44')](db['User'][_0x5fba('0x68')]);_0x427719['query']=_[_0x5fba('0x44')](_0x509bf3[_0x5fba('0x45')]);_0x427719[_0x5fba('0x46')]=_[_0x5fba('0x47')](_0x427719[_0x5fba('0x42')],_0x427719['query']);_0x40c303[_0x5fba('0x48')]=_[_0x5fba('0x47')](_0x427719[_0x5fba('0x42')],qs[_0x5fba('0x49')](_0x509bf3[_0x5fba('0x45')]['fields']));_0x40c303['attributes']=_0x40c303[_0x5fba('0x48')][_0x5fba('0x4a')]?_0x40c303[_0x5fba('0x48')]:_0x427719[_0x5fba('0x42')];_0x40c303['order']=qs[_0x5fba('0x4e')](_0x509bf3[_0x5fba('0x45')][_0x5fba('0x4e')]);_0x40c303[_0x5fba('0x4f')]=qs['filters'](_['pick'](_0x509bf3['query'],_0x427719['filters']));if(_0x509bf3[_0x5fba('0x45')][_0x5fba('0x50')]){_0x40c303['where']=_[_0x5fba('0x51')](_0x40c303[_0x5fba('0x4f')],{'$or':_[_0x5fba('0x43')](_0x40c303[_0x5fba('0x48')],function(_0x3bb007){var _0x1f9945={};_0x1f9945[_0x3bb007]={'$like':'%'+_0x509bf3[_0x5fba('0x45')]['filter']+'%'};return _0x1f9945;})});}_0x40c303=_[_0x5fba('0x51')]({},_0x40c303,_0x509bf3[_0x5fba('0x54')]);return _0x40b6ae['getAgents'](_0x40c303);}})[_0x5fba('0x20')](function(_0x570189){if(_0x570189){_0x39f2f9=_0x570189[_0x5fba('0x4a')];if(!_0x509bf3[_0x5fba('0x45')][_0x5fba('0x4b')](_0x5fba('0x4c'))){_0x40c303[_0x5fba('0x32')]=qs['limit'](_0x509bf3[_0x5fba('0x45')][_0x5fba('0x32')]);_0x40c303['offset']=qs['offset'](_0x509bf3[_0x5fba('0x45')][_0x5fba('0x2f')]);}return _0x40b6ae[_0x5fba('0xc0')](_0x40c303);}})[_0x5fba('0x20')](function(_0x6fb72f){if(_0x6fb72f){return _0x6fb72f?{'count':_0x39f2f9,'rows':_0x6fb72f}:null;}})['then'](respondWithResult(_0x2b0565,null))[_0x5fba('0x2a')](handleError(_0x2b0565,null));}; \ No newline at end of file +var _0x0284=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','include','rows','show','params','includeAll','create','body','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','getDispositions','findOne','Disposition','pick','options','removeDispositions','addAnswer','CannedAnswer','getAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','findAll','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','send','getApplications','context','from-voip-provider','localstationid','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','ReceiveFax','updateAccountApplications','VoiceExtension','tech','updatedAt','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x26b5a9,_0x2c1f6f){var _0x5dc833=function(_0x1309e9){while(--_0x1309e9){_0x26b5a9['push'](_0x26b5a9['shift']());}};_0x5dc833(++_0x2c1f6f);}(_0x0284,0xb3));var _0x4028=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x0284[_0x176329];return _0x31997c;};'use strict';var emlformat=require(_0x4028('0x0'));var rimraf=require(_0x4028('0x1'));var zipdir=require(_0x4028('0x2'));var jsonpatch=require(_0x4028('0x3'));var rp=require(_0x4028('0x4'));var moment=require('moment');var BPromise=require(_0x4028('0x5'));var Mustache=require(_0x4028('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4028('0x7'));var csv=require(_0x4028('0x8'));var ejs=require(_0x4028('0x9'));var fs=require('fs');var fs_extra=require(_0x4028('0xa'));var _=require('lodash');var squel=require(_0x4028('0xb'));var crypto=require(_0x4028('0xc'));var jsforce=require(_0x4028('0xd'));var deskjs=require(_0x4028('0xe'));var toCsv=require(_0x4028('0x8'));var querystring=require(_0x4028('0xf'));var Papa=require('papaparse');var Redis=require(_0x4028('0x10'));var authService=require(_0x4028('0x11'));var qs=require(_0x4028('0x12'));var as=require(_0x4028('0x13'));var hardwareService=require(_0x4028('0x14'));var logger=require(_0x4028('0x15'))('api');var utils=require(_0x4028('0x16'));var config=require(_0x4028('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x4028('0x18')](config[_0x4028('0x19')],{'host':_0x4028('0x1a'),'port':0x18eb});var socket=require(_0x4028('0x1b'))(new Redis(config[_0x4028('0x19')]));require(_0x4028('0x1c'))['register'](socket);var jayson=require(_0x4028('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4028('0x1e')][_0x4028('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x398a5c,_0x19cccd,_0x4aa526,_0xf9a1d2){return new BPromise(function(_0x343e72,_0x496db6){var _0x825dec=_0xf9a1d2||client;return _0x825dec[_0x4028('0x20')](_0x398a5c,_0x4aa526)[_0x4028('0x21')](function(_0x37776b){logger['info'](_0x4028('0x22'),_0x19cccd,_0x4028('0x23'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x19cccd,_0x4028('0x23'),JSON[_0x4028('0x24')](_0x37776b));if(_0x37776b['error']){if(_0x37776b[_0x4028('0x25')][_0x4028('0x26')]===0x1f4){logger[_0x4028('0x25')](_0x4028('0x22'),_0x19cccd,_0x37776b[_0x4028('0x25')][_0x4028('0x27')]);return _0x496db6(_0x37776b[_0x4028('0x25')][_0x4028('0x27')]);}logger[_0x4028('0x25')](_0x4028('0x22'),_0x19cccd,_0x37776b['error'][_0x4028('0x27')]);return _0x343e72(_0x37776b[_0x4028('0x25')][_0x4028('0x27')]);}else{logger[_0x4028('0x28')](_0x4028('0x22'),_0x19cccd,'request\x20sent');_0x343e72(_0x37776b[_0x4028('0x29')]['message']);}})[_0x4028('0x2a')](function(_0x306489){logger[_0x4028('0x25')]('FaxAccount,\x20%s,\x20%s',_0x19cccd,_0x306489);_0x496db6(_0x306489);});});}function respondWithStatusCode(_0x2785a8,_0x1e0084){_0x1e0084=_0x1e0084||0xcc;return function(_0x38a5f8){if(_0x38a5f8){return _0x2785a8[_0x4028('0x2b')](_0x1e0084);}return _0x2785a8['status'](_0x1e0084)[_0x4028('0x2c')]();};}function respondWithResult(_0x54e6da,_0x48fbcc){_0x48fbcc=_0x48fbcc||0xc8;return function(_0x1b648f){if(_0x1b648f){return _0x54e6da['status'](_0x48fbcc)[_0x4028('0x2d')](_0x1b648f);}};}function respondWithFilteredResult(_0xace8fc,_0x2fcab8){return function(_0x52b210){if(_0x52b210){var _0x586b57=typeof _0x2fcab8[_0x4028('0x2e')]==='undefined'&&typeof _0x2fcab8[_0x4028('0x2f')]===_0x4028('0x30');var _0x1a2498=_0x52b210[_0x4028('0x31')];var _0x259273=_0x586b57?0x0:_0x2fcab8[_0x4028('0x2e')];var _0x29c7e7=_0x586b57?_0x52b210['count']:_0x2fcab8['offset']+_0x2fcab8[_0x4028('0x2f')];var _0x2cd1e6;if(_0x29c7e7>=_0x1a2498){_0x29c7e7=_0x1a2498;_0x2cd1e6=0xc8;}else{_0x2cd1e6=0xce;}_0xace8fc[_0x4028('0x32')](_0x2cd1e6);return _0xace8fc[_0x4028('0x33')](_0x4028('0x34'),_0x259273+'-'+_0x29c7e7+'/'+_0x1a2498)[_0x4028('0x2d')](_0x52b210);}return null;};}function patchUpdates(_0x450258){return function(_0x4f5cf2){try{jsonpatch[_0x4028('0x35')](_0x4f5cf2,_0x450258,!![]);}catch(_0xaa2fa3){return BPromise[_0x4028('0x36')](_0xaa2fa3);}return _0x4f5cf2[_0x4028('0x37')]();};}function saveUpdates(_0x52f90e,_0x47b4be){return function(_0x4c34dc){if(_0x4c34dc){return _0x4c34dc[_0x4028('0x38')](_0x52f90e)['then'](function(_0x3a89d4){return _0x3a89d4;});}return null;};}function removeEntity(_0x1a541d,_0x417118){return function(_0x4718aa){if(_0x4718aa){return _0x4718aa[_0x4028('0x39')]()[_0x4028('0x21')](function(){var _0x2ddc5c=_0x4718aa[_0x4028('0x3a')]({'plain':!![]});var _0x1b1eee=_0x4028('0x3b');return db[_0x4028('0x3c')][_0x4028('0x39')]({'where':{'type':_0x1b1eee,'resourceId':_0x2ddc5c['id']}})[_0x4028('0x21')](function(){return _0x4718aa;});})[_0x4028('0x21')](function(){_0x1a541d[_0x4028('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54618b,_0xa785fe){return function(_0x24ec30){if(!_0x24ec30){_0x54618b[_0x4028('0x2b')](0x194);}return _0x24ec30;};}function handleError(_0x47a905,_0x561823){_0x561823=_0x561823||0x1f4;return function(_0x5154df){logger[_0x4028('0x25')](_0x5154df[_0x4028('0x3d')]);if(_0x5154df[_0x4028('0x3e')]){delete _0x5154df['name'];}_0x47a905['status'](_0x561823)['send'](_0x5154df);};}exports[_0x4028('0x3f')]=function(_0xae1d4e,_0x40850c){var _0x3c9e1f={'include':[{'model':db[_0x4028('0x40')],'as':_0x4028('0x41')}]},_0x37d7ce={},_0x2ac189={'count':0x0,'rows':[]};var _0x5ac5b1=_[_0x4028('0x42')](db[_0x4028('0x43')][_0x4028('0x44')],function(_0x488f56){return{'name':_0x488f56[_0x4028('0x45')],'type':_0x488f56[_0x4028('0x46')]['key']};});_0x37d7ce[_0x4028('0x47')]=_[_0x4028('0x42')](_0x5ac5b1,_0x4028('0x3e'));_0x37d7ce[_0x4028('0x48')]=_[_0x4028('0x49')](_0xae1d4e[_0x4028('0x48')]);_0x37d7ce['filters']=_['intersection'](_0x37d7ce['model'],_0x37d7ce[_0x4028('0x48')]);_0x3c9e1f[_0x4028('0x4a')]=_[_0x4028('0x4b')](_0x37d7ce['model'],qs['fields'](_0xae1d4e[_0x4028('0x48')][_0x4028('0x4c')]));_0x3c9e1f['attributes']=_0x3c9e1f['attributes'][_0x4028('0x4d')]?_0x3c9e1f['attributes']:_0x37d7ce[_0x4028('0x47')];if(!_0xae1d4e[_0x4028('0x48')][_0x4028('0x4e')](_0x4028('0x4f'))){_0x3c9e1f[_0x4028('0x2f')]=qs[_0x4028('0x2f')](_0xae1d4e['query'][_0x4028('0x2f')]);_0x3c9e1f['offset']=qs[_0x4028('0x2e')](_0xae1d4e[_0x4028('0x48')][_0x4028('0x2e')]);}_0x3c9e1f[_0x4028('0x50')]=qs[_0x4028('0x51')](_0xae1d4e[_0x4028('0x48')]['sort']);_0x3c9e1f[_0x4028('0x52')]=qs[_0x4028('0x53')](_['pick'](_0xae1d4e[_0x4028('0x48')],_0x37d7ce[_0x4028('0x53')]),_0x5ac5b1);if(_0xae1d4e[_0x4028('0x48')][_0x4028('0x54')]){_0x3c9e1f['where']=_[_0x4028('0x55')](_0x3c9e1f[_0x4028('0x52')],{'$or':_[_0x4028('0x42')](_0x5ac5b1,function(_0x5234a2){if(_0x5234a2['type']!==_0x4028('0x56')){var _0x326bee={};_0x326bee[_0x5234a2[_0x4028('0x3e')]]={'$like':'%'+_0xae1d4e[_0x4028('0x48')][_0x4028('0x54')]+'%'};return _0x326bee;}})});}_0x3c9e1f=_[_0x4028('0x55')]({},_0x3c9e1f,_0xae1d4e['options']);var _0x1e73f6={'where':_0x3c9e1f[_0x4028('0x52')]};return db['FaxAccount'][_0x4028('0x31')](_0x1e73f6)[_0x4028('0x21')](function(_0x418534){_0x2ac189['count']=_0x418534;if(_0xae1d4e[_0x4028('0x48')]['includeAll']){_0x3c9e1f[_0x4028('0x57')]=[{'all':!![]}];}return db[_0x4028('0x43')]['findAll'](_0x3c9e1f);})[_0x4028('0x21')](function(_0x376aff){_0x2ac189[_0x4028('0x58')]=_0x376aff;return _0x2ac189;})[_0x4028('0x21')](respondWithFilteredResult(_0x40850c,_0x3c9e1f))[_0x4028('0x2a')](handleError(_0x40850c,null));};exports[_0x4028('0x59')]=function(_0x103950,_0x50c138){var _0x2c3427={'raw':![],'where':{'id':_0x103950[_0x4028('0x5a')]['id']},'include':[{'model':db[_0x4028('0x40')],'as':_0x4028('0x41')}]},_0x2959a6={};_0x2959a6['model']=_[_0x4028('0x49')](db[_0x4028('0x43')]['rawAttributes']);_0x2959a6[_0x4028('0x48')]=_['keys'](_0x103950['query']);_0x2959a6[_0x4028('0x53')]=_[_0x4028('0x4b')](_0x2959a6['model'],_0x2959a6['query']);_0x2c3427[_0x4028('0x4a')]=_[_0x4028('0x4b')](_0x2959a6['model'],qs[_0x4028('0x4c')](_0x103950['query'][_0x4028('0x4c')]));_0x2c3427['attributes']=_0x2c3427[_0x4028('0x4a')][_0x4028('0x4d')]?_0x2c3427[_0x4028('0x4a')]:_0x2959a6[_0x4028('0x47')];if(_0x103950['query'][_0x4028('0x5b')]){_0x2c3427[_0x4028('0x57')]=[{'all':!![]}];}_0x2c3427=_[_0x4028('0x55')]({},_0x2c3427,_0x103950['options']);return db[_0x4028('0x43')]['find'](_0x2c3427)[_0x4028('0x21')](handleEntityNotFound(_0x50c138,null))[_0x4028('0x21')](respondWithResult(_0x50c138,null))[_0x4028('0x2a')](handleError(_0x50c138,null));};exports[_0x4028('0x5c')]=function(_0x3fc9ca,_0xac534a){return db[_0x4028('0x43')]['create'](_0x3fc9ca[_0x4028('0x5d')],{})[_0x4028('0x21')](function(_0x11c25c){var _0x4b1ac4=_0x3fc9ca[_0x4028('0x5e')]['get']({'plain':!![]});if(!_0x4b1ac4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b1ac4['role']===_0x4028('0x5e')){var _0x71fac2=_0x11c25c['get']({'plain':!![]});var _0x4a084f=_0x4028('0x3b');return db[_0x4028('0x5f')][_0x4028('0x60')]({'where':{'name':_0x4a084f,'userProfileId':_0x4b1ac4['userProfileId']},'raw':!![]})[_0x4028('0x21')](function(_0x4b53bb){if(_0x4b53bb&&_0x4b53bb[_0x4028('0x61')]===0x0){return db[_0x4028('0x3c')]['create']({'name':_0x71fac2['name'],'resourceId':_0x71fac2['id'],'type':_0x4b53bb[_0x4028('0x3e')],'sectionId':_0x4b53bb['id']},{})[_0x4028('0x21')](function(){return _0x11c25c;});}else{return _0x11c25c;}})[_0x4028('0x2a')](function(_0x2b89d9){logger[_0x4028('0x25')](_0x4028('0x62'),_0x2b89d9);throw _0x2b89d9;});}return _0x11c25c;})[_0x4028('0x21')](respondWithResult(_0xac534a,0xc9))['catch'](handleError(_0xac534a,null));};exports[_0x4028('0x38')]=function(_0xcb85f5,_0x5c05ce){if(_0xcb85f5['body']['id']){delete _0xcb85f5['body']['id'];}return db[_0x4028('0x43')][_0x4028('0x60')]({'where':{'id':_0xcb85f5[_0x4028('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x4028('0x21')](handleEntityNotFound(_0x5c05ce,null))[_0x4028('0x21')](saveUpdates(_0xcb85f5[_0x4028('0x5d')],null))[_0x4028('0x21')](respondWithResult(_0x5c05ce,null))[_0x4028('0x2a')](handleError(_0x5c05ce,null));};exports[_0x4028('0x39')]=function(_0x31ff94,_0x3d2c0c){return db[_0x4028('0x43')][_0x4028('0x60')]({'where':{'id':_0x31ff94['params']['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x3d2c0c,null))[_0x4028('0x21')](removeEntity(_0x3d2c0c,null))[_0x4028('0x2a')](handleError(_0x3d2c0c,null));};exports[_0x4028('0x63')]=function(_0x2a158c,_0x132e23){return db[_0x4028('0x43')][_0x4028('0x63')]()[_0x4028('0x21')](respondWithResult(_0x132e23,null))[_0x4028('0x2a')](handleError(_0x132e23,null));};exports['addDisposition']=function(_0x4b1d49,_0x384562,_0x40358d){if(_0x4b1d49['body']['id']){delete _0x4b1d49[_0x4028('0x5d')]['id'];}return db['FaxAccount'][_0x4028('0x60')]({'where':{'id':_0x4b1d49[_0x4028('0x5a')]['id']}})['then'](handleEntityNotFound(_0x384562,null))[_0x4028('0x21')](function(_0x1b0b70){if(_0x1b0b70){_0x4b1d49[_0x4028('0x5d')][_0x4028('0x64')]=_0x1b0b70['id'];return db['Disposition']['create'](_0x4b1d49['body']);}})['then'](respondWithResult(_0x384562,null))['catch'](handleError(_0x384562,null));};exports[_0x4028('0x65')]=function(_0x421df6,_0xb881d,_0x15a5b){var _0x556041={'raw':![],'where':{}};var _0x16086b={};var _0x72a16a={'count':0x0,'rows':[]};return db[_0x4028('0x43')][_0x4028('0x66')]({'where':{'id':_0x421df6['params']['id']}})['then'](handleEntityNotFound(_0xb881d,null))[_0x4028('0x21')](function(_0x23d688){if(_0x23d688){_0x16086b[_0x4028('0x47')]=_['keys'](db[_0x4028('0x67')]['rawAttributes']);_0x16086b[_0x4028('0x48')]=_[_0x4028('0x49')](_0x421df6[_0x4028('0x48')]);_0x16086b[_0x4028('0x53')]=_[_0x4028('0x4b')](_0x16086b['model'],_0x16086b['query']);_0x556041[_0x4028('0x4a')]=_[_0x4028('0x4b')](_0x16086b['model'],qs['fields'](_0x421df6['query'][_0x4028('0x4c')]));_0x556041[_0x4028('0x4a')]=_0x556041['attributes'][_0x4028('0x4d')]?_0x556041[_0x4028('0x4a')]:_0x16086b[_0x4028('0x47')];if(!_0x421df6[_0x4028('0x48')][_0x4028('0x4e')](_0x4028('0x4f'))){_0x556041[_0x4028('0x2f')]=qs[_0x4028('0x2f')](_0x421df6[_0x4028('0x48')][_0x4028('0x2f')]);_0x556041[_0x4028('0x2e')]=qs[_0x4028('0x2e')](_0x421df6[_0x4028('0x48')]['offset']);}_0x556041[_0x4028('0x50')]=qs[_0x4028('0x51')](_0x421df6['query'][_0x4028('0x51')]);_0x556041[_0x4028('0x52')]=qs[_0x4028('0x53')](_[_0x4028('0x68')](_0x421df6[_0x4028('0x48')],_0x16086b[_0x4028('0x53')]));_0x556041[_0x4028('0x52')]['FaxAccountId']=_0x23d688['id'];if(_0x421df6[_0x4028('0x48')][_0x4028('0x54')]){_0x556041['where']=_[_0x4028('0x55')](_0x556041[_0x4028('0x52')],{'$or':_[_0x4028('0x42')](_0x556041['attributes'],function(_0x26d72c){var _0x3753b6={};_0x3753b6[_0x26d72c]={'$like':'%'+_0x421df6[_0x4028('0x48')][_0x4028('0x54')]+'%'};return _0x3753b6;})});}_0x556041=_['merge']({},_0x556041,_0x421df6[_0x4028('0x69')]);return db[_0x4028('0x67')][_0x4028('0x31')]({'where':_0x556041['where']})['then'](function(_0x3313f4){_0x72a16a[_0x4028('0x31')]=_0x3313f4;if(_0x421df6[_0x4028('0x48')][_0x4028('0x5b')]){_0x556041[_0x4028('0x57')]=[{'all':!![]}];}return db[_0x4028('0x67')]['findAll'](_0x556041);})[_0x4028('0x21')](function(_0x259bac){_0x72a16a[_0x4028('0x58')]=_0x259bac;return _0x72a16a;});}})[_0x4028('0x21')](respondWithFilteredResult(_0xb881d,_0x556041))[_0x4028('0x2a')](handleError(_0xb881d,null));};exports[_0x4028('0x6a')]=function(_0x3d6611,_0x5ebcb0,_0x23a840){return db[_0x4028('0x43')][_0x4028('0x60')]({'where':{'id':_0x3d6611['params']['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x5ebcb0,null))['then'](function(_0x45fe66){if(_0x45fe66){return _0x45fe66[_0x4028('0x6a')](_0x3d6611[_0x4028('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x5ebcb0,null))[_0x4028('0x2a')](handleError(_0x5ebcb0,null));};exports[_0x4028('0x6b')]=function(_0x416678,_0x166c58,_0x490e3a){if(_0x416678[_0x4028('0x5d')]['id']){delete _0x416678[_0x4028('0x5d')]['id'];}return db[_0x4028('0x43')][_0x4028('0x60')]({'where':{'id':_0x416678[_0x4028('0x5a')]['id']}})['then'](handleEntityNotFound(_0x166c58,null))[_0x4028('0x21')](function(_0x18a1e8){if(_0x18a1e8){_0x416678[_0x4028('0x5d')]['FaxAccountId']=_0x18a1e8['id'];return db[_0x4028('0x6c')][_0x4028('0x5c')](_0x416678[_0x4028('0x5d')]);}})[_0x4028('0x21')](respondWithResult(_0x166c58,null))[_0x4028('0x2a')](handleError(_0x166c58,null));};exports[_0x4028('0x6d')]=function(_0x2d336f,_0x2032cb,_0x1e768f){var _0x1bb093={'raw':![],'where':{}};var _0x4efd8b={};var _0x3aa821={'count':0x0,'rows':[]};return db[_0x4028('0x43')][_0x4028('0x66')]({'where':{'id':_0x2d336f[_0x4028('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2032cb,null))[_0x4028('0x21')](function(_0x4969e2){if(_0x4969e2){_0x4efd8b[_0x4028('0x47')]=_[_0x4028('0x49')](db[_0x4028('0x6c')][_0x4028('0x44')]);_0x4efd8b['query']=_[_0x4028('0x49')](_0x2d336f[_0x4028('0x48')]);_0x4efd8b['filters']=_[_0x4028('0x4b')](_0x4efd8b['model'],_0x4efd8b['query']);_0x1bb093['attributes']=_[_0x4028('0x4b')](_0x4efd8b['model'],qs[_0x4028('0x4c')](_0x2d336f[_0x4028('0x48')][_0x4028('0x4c')]));_0x1bb093['attributes']=_0x1bb093['attributes'][_0x4028('0x4d')]?_0x1bb093['attributes']:_0x4efd8b[_0x4028('0x47')];if(!_0x2d336f[_0x4028('0x48')]['hasOwnProperty'](_0x4028('0x4f'))){_0x1bb093[_0x4028('0x2f')]=qs[_0x4028('0x2f')](_0x2d336f[_0x4028('0x48')][_0x4028('0x2f')]);_0x1bb093['offset']=qs['offset'](_0x2d336f[_0x4028('0x48')][_0x4028('0x2e')]);}_0x1bb093[_0x4028('0x50')]=qs[_0x4028('0x51')](_0x2d336f[_0x4028('0x48')]['sort']);_0x1bb093[_0x4028('0x52')]=qs['filters'](_['pick'](_0x2d336f[_0x4028('0x48')],_0x4efd8b[_0x4028('0x53')]));_0x1bb093['where'][_0x4028('0x64')]=_0x4969e2['id'];if(_0x2d336f[_0x4028('0x48')]['filter']){_0x1bb093[_0x4028('0x52')]=_[_0x4028('0x55')](_0x1bb093[_0x4028('0x52')],{'$or':_[_0x4028('0x42')](_0x1bb093['attributes'],function(_0x242d0c){var _0x7b9f9c={};_0x7b9f9c[_0x242d0c]={'$like':'%'+_0x2d336f[_0x4028('0x48')][_0x4028('0x54')]+'%'};return _0x7b9f9c;})});}_0x1bb093=_[_0x4028('0x55')]({},_0x1bb093,_0x2d336f[_0x4028('0x69')]);return db['CannedAnswer'][_0x4028('0x31')]({'where':_0x1bb093[_0x4028('0x52')]})['then'](function(_0x12fca4){_0x3aa821['count']=_0x12fca4;if(_0x2d336f[_0x4028('0x48')]['includeAll']){_0x1bb093[_0x4028('0x57')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1bb093);})[_0x4028('0x21')](function(_0x9ed822){_0x3aa821['rows']=_0x9ed822;return _0x3aa821;});}})['then'](respondWithFilteredResult(_0x2032cb,_0x1bb093))[_0x4028('0x2a')](handleError(_0x2032cb,null));};exports['removeAnswers']=function(_0x359059,_0x409304,_0xc5bd1){return db[_0x4028('0x43')]['find']({'where':{'id':_0x359059[_0x4028('0x5a')]['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x409304,null))['then'](function(_0x3e3772){if(_0x3e3772){return _0x3e3772['removeAnswers'](_0x359059[_0x4028('0x48')][_0x4028('0x6e')]);}})[_0x4028('0x21')](respondWithStatusCode(_0x409304,null))[_0x4028('0x2a')](handleError(_0x409304,null));};exports[_0x4028('0x6f')]=function(_0x3b8c67,_0x409749,_0x51d607){return db[_0x4028('0x70')]['find']({'where':{'id':_0x3b8c67['params']['id']}})['then'](handleEntityNotFound(_0x409749,null))[_0x4028('0x21')](function(_0x14c144){if(_0x14c144){return _0x14c144[_0x4028('0x6f')](_0x3b8c67[_0x4028('0x5d')]['ids'],_[_0x4028('0x71')](_0x3b8c67[_0x4028('0x5d')],['ids','id'])||{});}})[_0x4028('0x21')](respondWithResult(_0x409749,null))[_0x4028('0x2a')](handleError(_0x409749,null));};exports[_0x4028('0x72')]=function(_0x11a357,_0x512b06,_0x4d7ac0){var _0x116a99={'raw':![],'where':{}};var _0x55d287={};var _0x28793e={'count':0x0,'rows':[]};return db[_0x4028('0x43')]['findOne']({'where':{'id':_0x11a357[_0x4028('0x5a')]['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x512b06,null))[_0x4028('0x21')](function(_0x4f72e5){if(_0x4f72e5){_0x55d287[_0x4028('0x47')]=_['keys'](db[_0x4028('0x70')][_0x4028('0x44')]);_0x55d287['query']=_[_0x4028('0x49')](_0x11a357[_0x4028('0x48')]);_0x55d287[_0x4028('0x53')]=_[_0x4028('0x4b')](_0x55d287[_0x4028('0x47')],_0x55d287[_0x4028('0x48')]);_0x116a99['attributes']=_['intersection'](_0x55d287[_0x4028('0x47')],qs['fields'](_0x11a357[_0x4028('0x48')]['fields']));_0x116a99[_0x4028('0x4a')]=_0x116a99[_0x4028('0x4a')][_0x4028('0x4d')]?_0x116a99[_0x4028('0x4a')]:_0x55d287[_0x4028('0x47')];if(!_0x11a357['query'][_0x4028('0x4e')]('nolimit')){_0x116a99[_0x4028('0x2f')]=qs[_0x4028('0x2f')](_0x11a357[_0x4028('0x48')]['limit']);_0x116a99[_0x4028('0x2e')]=qs[_0x4028('0x2e')](_0x11a357[_0x4028('0x48')][_0x4028('0x2e')]);}_0x116a99[_0x4028('0x50')]=qs[_0x4028('0x51')](_0x11a357[_0x4028('0x48')][_0x4028('0x51')]);_0x116a99[_0x4028('0x52')]=qs[_0x4028('0x53')](_[_0x4028('0x68')](_0x11a357[_0x4028('0x48')],_0x55d287[_0x4028('0x53')]));_0x116a99[_0x4028('0x52')]['FaxAccountId']=_0x4f72e5['id'];if(_0x11a357[_0x4028('0x48')][_0x4028('0x54')]){_0x116a99[_0x4028('0x52')]=_['merge'](_0x116a99[_0x4028('0x52')],{'$or':_[_0x4028('0x42')](_0x116a99['attributes'],function(_0x482304){var _0x512ca4={};_0x512ca4[_0x482304]={'$like':'%'+_0x11a357[_0x4028('0x48')]['filter']+'%'};return _0x512ca4;})});}_0x116a99=_[_0x4028('0x55')]({},_0x116a99,_0x11a357[_0x4028('0x69')]);return db[_0x4028('0x70')][_0x4028('0x31')]({'where':_0x116a99[_0x4028('0x52')]})['then'](function(_0x40b605){_0x28793e[_0x4028('0x31')]=_0x40b605;if(_0x11a357[_0x4028('0x48')][_0x4028('0x5b')]){_0x116a99[_0x4028('0x57')]=[{'model':db[_0x4028('0x73')],'as':_0x4028('0x74'),'required':![]},{'model':db[_0x4028('0x75')],'as':'Owner','attributes':[_0x4028('0x3e'),_0x4028('0x76'),_0x4028('0x77')],'required':![]},{'model':db[_0x4028('0x78')],'as':_0x4028('0x79'),'attributes':['id',_0x4028('0x3e'),_0x4028('0x7a')],'where':_0x11a357[_0x4028('0x48')]['tag']?{'id':_0x11a357[_0x4028('0x48')][_0x4028('0x7b')]}:undefined,'required':_0x11a357[_0x4028('0x48')][_0x4028('0x7b')]?!![]:![]}];}return db[_0x4028('0x70')][_0x4028('0x7c')](_0x116a99);})[_0x4028('0x21')](function(_0x161d0f){_0x28793e[_0x4028('0x58')]=_0x161d0f;return _0x28793e;});}})[_0x4028('0x21')](respondWithFilteredResult(_0x512b06,_0x116a99))[_0x4028('0x2a')](handleError(_0x512b06,null));};exports[_0x4028('0x7d')]=function(_0x484211,_0x56a8e2){var _0x5abec3=_0x484211[_0x4028('0x5a')]['id'];var _0x555678=_0x484211['body'];var _0x4dd147=0xc8;var _0x54cdd8=null;return db['sequelize'][_0x4028('0x7e')]({'isolationLevel':db[_0x4028('0x7f')]['Transaction'][_0x4028('0x80')][_0x4028('0x81')]},function(_0x8d0892){return db[_0x4028('0x43')][_0x4028('0x66')]({'where':{'id':_0x5abec3},'transaction':_0x8d0892})['then'](function(_0x2c2282){if(_0x2c2282){return db['FaxApplication'][_0x4028('0x39')]({'where':{'FaxAccountId':_0x5abec3},'transaction':_0x8d0892})['then'](function(){var _0x11731d=_['map'](_0x555678,function(_0x1a9c28){_0x1a9c28['FaxAccountId']=_0x5abec3;return _0x1a9c28;});return db['FaxApplication'][_0x4028('0x82')](_0x11731d,{'transaction':_0x8d0892});});}else{_0x4dd147=0x194;_0x54cdd8=[];}});})['then'](function(){if(_0x4dd147!==0x194){return db['FaxApplication'][_0x4028('0x83')]({'where':{'FaxAccountId':_0x5abec3},'order':_0x4028('0x84')})[_0x4028('0x21')](function(_0x1d8fff){_0x54cdd8=_0x1d8fff;});}})[_0x4028('0x2a')](function(_0x20ed66){_0x4dd147=0x1f4;logger[_0x4028('0x25')](_0x20ed66['stack']);if(_0x20ed66['name']){delete _0x20ed66[_0x4028('0x3e')];}_0x54cdd8=_0x20ed66;})[_0x4028('0x85')](function(){if(_0x54cdd8===null){_0x56a8e2['sendStatus'](_0x4dd147);}else{if(_0x4dd147===0x1f4){_0x56a8e2['status'](_0x4dd147)[_0x4028('0x86')](_0x54cdd8);}else{_0x56a8e2['status'](_0x4dd147)[_0x4028('0x2d')](_0x54cdd8);}}});};exports[_0x4028('0x87')]=function(_0xe9295a,_0x41190b,_0x283a57){var _0x5a8df4={};var _0xd5c908={};var _0x42358c;var _0x33eab7;return db[_0x4028('0x43')][_0x4028('0x66')]({'where':{'id':_0xe9295a['params']['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x41190b,null))[_0x4028('0x21')](function(_0x97c809){if(_0x97c809){_0x42358c=_0x97c809;_0xd5c908[_0x4028('0x47')]=_[_0x4028('0x49')](db['FaxApplication'][_0x4028('0x44')]);_0xd5c908[_0x4028('0x48')]=_[_0x4028('0x49')](_0xe9295a[_0x4028('0x48')]);_0xd5c908[_0x4028('0x53')]=_[_0x4028('0x4b')](_0xd5c908[_0x4028('0x47')],_0xd5c908[_0x4028('0x48')]);_0x5a8df4[_0x4028('0x4a')]=_[_0x4028('0x4b')](_0xd5c908[_0x4028('0x47')],qs[_0x4028('0x4c')](_0xe9295a['query'][_0x4028('0x4c')]));_0x5a8df4['attributes']=_0x5a8df4['attributes'][_0x4028('0x4d')]?_0x5a8df4[_0x4028('0x4a')]:_0xd5c908['model'];_0x5a8df4[_0x4028('0x50')]=qs[_0x4028('0x51')](_0xe9295a[_0x4028('0x48')][_0x4028('0x51')]);_0x5a8df4[_0x4028('0x52')]=qs[_0x4028('0x53')](_[_0x4028('0x68')](_0xe9295a[_0x4028('0x48')],_0xd5c908[_0x4028('0x53')]));if(_0xe9295a['query'][_0x4028('0x54')]){_0x5a8df4[_0x4028('0x52')]=_['merge'](_0x5a8df4[_0x4028('0x52')],{'$or':_[_0x4028('0x42')](_0x5a8df4[_0x4028('0x4a')],function(_0x842f22){var _0x597c22={};_0x597c22[_0x842f22]={'$like':'%'+_0xe9295a[_0x4028('0x48')][_0x4028('0x54')]+'%'};return _0x597c22;})});}_0x5a8df4=_[_0x4028('0x55')]({},_0x5a8df4,_0xe9295a['options']);return _0x42358c[_0x4028('0x87')](_0x5a8df4);}})[_0x4028('0x21')](function(_0x3a4eb9){if(_0x3a4eb9){_0x33eab7=_0x3a4eb9[_0x4028('0x4d')];if(!_0xe9295a[_0x4028('0x48')][_0x4028('0x4e')](_0x4028('0x4f'))){_0x5a8df4[_0x4028('0x2f')]=qs[_0x4028('0x2f')](_0xe9295a[_0x4028('0x48')][_0x4028('0x2f')]);_0x5a8df4['offset']=qs[_0x4028('0x2e')](_0xe9295a[_0x4028('0x48')][_0x4028('0x2e')]);}return _0x42358c[_0x4028('0x87')](_0x5a8df4);}})[_0x4028('0x21')](function(_0x4a0867){if(_0x4a0867){return _0x4a0867?{'count':_0x33eab7,'rows':_0x4a0867}:null;}})[_0x4028('0x21')](respondWithResult(_0x41190b,null))[_0x4028('0x2a')](handleError(_0x41190b,null));};function Extension(_0x55ea77,_0x4f7eef,_0x5c2e6e,_0x46b126){this[_0x4028('0x88')]=_0x4028('0x89');this['exten']=_0x55ea77[_0x4028('0x8a')];this['app']=_0x46b126;this['type']='system';this[_0x4028('0x8b')]=_0x4028('0x8c');this[_0x4028('0x64')]=_0x55ea77['id'];this[_0x4028('0x84')]=_0x4f7eef;this['appdata']=_0x5c2e6e;}function createExtensionsReciveFax(_0x38984a){var _0x41e785=0x1;var _0x5be9e8=[];_0x5be9e8[_0x4028('0x8d')](new Extension(_0x38984a,_0x41e785,'',_0x4028('0x8e')));_0x41e785+=0x1;_0x5be9e8[_0x4028('0x8d')](new Extension(_0x38984a,_0x41e785,_0x4028('0x8f'),_0x4028('0x90')));_0x41e785+=0x1;for(var _0x3c876d in _0x38984a){if(_0x38984a[_0x4028('0x4e')](_0x3c876d)&&(_0x3c876d===_0x4028('0x91')||_0x3c876d===_0x4028('0x8a')||_0x3c876d===_0x4028('0x92')||_0x3c876d===_0x4028('0x93')||_0x3c876d===_0x4028('0x94')||_0x3c876d===_0x4028('0x95')||_0x3c876d===_0x4028('0x96')||_0x3c876d==='modem'||_0x3c876d===_0x4028('0x97'))){_0x5be9e8[_0x4028('0x8d')](new Extension(_0x38984a,_0x41e785,_0x4028('0x98')+_0x3c876d+')='+_0x38984a[_0x3c876d],_0x4028('0x90')));_0x41e785+=0x1;}}_0x5be9e8[_0x4028('0x8d')](new Extension(_0x38984a,_0x41e785,'6',_0x4028('0x99')));_0x41e785+=0x1;_0x5be9e8[_0x4028('0x8d')](new Extension(_0x38984a,_0x41e785,'/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',_0x4028('0x9a')));_0x41e785=0x0;return _0x5be9e8;}exports['addAccountApplications']=function(_0x3f1548,_0x5c3981,_0x2b37ba){var _0x3bf11e;return db[_0x4028('0x7f')][_0x4028('0x7e')](function(_0x34e5c1){return db['FaxAccount']['create'](_0x3f1548['body'],{'transaction':_0x34e5c1})[_0x4028('0x21')](function(_0x19c74){_0x3bf11e=_0x19c74[_0x4028('0x3a')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x3bf11e),{'transaction':_0x34e5c1});});})[_0x4028('0x21')](function(){return _0x3bf11e;})[_0x4028('0x21')](respondWithResult(_0x5c3981,null))[_0x4028('0x2a')](handleError(_0x5c3981,null));};exports[_0x4028('0x9b')]=function(_0x2765b0,_0x5240cd,_0x4e2aba){var _0x4fb3dc;return db[_0x4028('0x7f')]['transaction'](function(_0x1cb199){return db['FaxAccount'][_0x4028('0x38')](_0x2765b0[_0x4028('0x5d')],{'where':{'id':_0x2765b0[_0x4028('0x5d')]['id']},'transaction':_0x1cb199})[_0x4028('0x21')](function(_0xc22a20){return db[_0x4028('0x9c')][_0x4028('0x39')]({'where':{'FaxAccountId':_0x2765b0[_0x4028('0x5d')]['id']},'transaction':_0x1cb199})[_0x4028('0x21')](function(_0x459cb0){return db[_0x4028('0x9c')]['bulkCreate'](createExtensionsReciveFax(_[_0x4028('0x71')](_0x2765b0['body'],[_0x4028('0x9d'),'key','createdAt',_0x4028('0x9e'),'TrunkId','ListId'])),{'transaction':_0x1cb199});});});})['then'](function(){return db[_0x4028('0x43')][_0x4028('0x9f')](_0x2765b0[_0x4028('0x5d')]['id']);})[_0x4028('0x21')](respondWithResult(_0x5240cd,null))[_0x4028('0x2a')](handleError(_0x5240cd,null));};exports[_0x4028('0xa0')]=function(_0x234689,_0x902faf,_0x3f1192){var _0x652a08={'raw':!![],'where':{}};var _0xc19787={};var _0x54ea62={'count':0x0,'rows':[]};return db[_0x4028('0x43')]['findOne']({'where':{'id':_0x234689['params']['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x902faf,null))['then'](function(_0xf29320){if(_0xf29320){_0xc19787[_0x4028('0x47')]=_[_0x4028('0x49')](db[_0x4028('0xa1')][_0x4028('0x44')]);_0xc19787[_0x4028('0x48')]=_['keys'](_0x234689[_0x4028('0x48')]);_0xc19787['filters']=_[_0x4028('0x4b')](_0xc19787[_0x4028('0x47')],_0xc19787[_0x4028('0x48')]);_0x652a08[_0x4028('0x4a')]=_['intersection'](_0xc19787['model'],qs[_0x4028('0x4c')](_0x234689[_0x4028('0x48')][_0x4028('0x4c')]));_0x652a08['attributes']=_0x652a08[_0x4028('0x4a')]['length']?_0x652a08[_0x4028('0x4a')]:_0xc19787['model'];if(!_0x234689['query'][_0x4028('0x4e')](_0x4028('0x4f'))){_0x652a08[_0x4028('0x2f')]=qs[_0x4028('0x2f')](_0x234689[_0x4028('0x48')]['limit']);_0x652a08[_0x4028('0x2e')]=qs[_0x4028('0x2e')](_0x234689['query'][_0x4028('0x2e')]);}_0x652a08[_0x4028('0x50')]=qs[_0x4028('0x51')](_0x234689[_0x4028('0x48')][_0x4028('0x51')]);_0x652a08[_0x4028('0x52')]=qs[_0x4028('0x53')](_[_0x4028('0x68')](_0x234689[_0x4028('0x48')],_0xc19787[_0x4028('0x53')]));_0x652a08[_0x4028('0x52')]['FaxAccountId']=_0xf29320['id'];if(_0x234689[_0x4028('0x48')][_0x4028('0x54')]){_0x652a08[_0x4028('0x52')]=_[_0x4028('0x55')](_0x652a08[_0x4028('0x52')],{'$or':_['map'](_0x652a08['attributes'],function(_0x51537d){var _0x249fa3={};_0x249fa3[_0x51537d]={'$like':'%'+_0x234689[_0x4028('0x48')][_0x4028('0x54')]+'%'};return _0x249fa3;})});}if(_0x234689[_0x4028('0x48')][_0x4028('0xa2')]){var _0x24cd15=_0x234689[_0x4028('0x48')][_0x4028('0xa2')]['split'](',');var _0x3498dd={};_0x3498dd[_0x24cd15[0x0]]={'$gte':moment(_0x24cd15[0x1])[_0x4028('0xa3')](_0x4028('0xa4'))};_0x652a08['where']=_[_0x4028('0x55')](_0x652a08[_0x4028('0x52')],_0x3498dd);}_0x652a08=_[_0x4028('0x55')]({},_0x652a08,_0x234689[_0x4028('0x69')]);return db[_0x4028('0xa1')][_0x4028('0x31')]({'where':_0x652a08[_0x4028('0x52')]})['then'](function(_0x4c0659){_0x54ea62[_0x4028('0x31')]=_0x4c0659;if(_0x234689['query'][_0x4028('0x5b')]){_0x652a08[_0x4028('0x57')]=[{'all':!![]}];}return db[_0x4028('0xa1')]['findAll'](_0x652a08);})['then'](function(_0xd6c9bb){_0x54ea62[_0x4028('0x58')]=_0xd6c9bb;return _0x54ea62;});}})[_0x4028('0x21')](respondWithFilteredResult(_0x902faf,_0x652a08))[_0x4028('0x2a')](handleError(_0x902faf,null));};exports['send']=function(_0x522d78,_0x2439ea,_0x25ad24){var _0x17c3d7,_0x5ac22b={},_0x37296b;if(_0x522d78['body']['to']){_0x37296b=_0x522d78['body']['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x522d78[_0x4028('0x5a')]['id']},'include':[{'model':db[_0x4028('0xa5')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4028('0xa6'),'where':{'fax':_0x37296b},'limit':0x1,'order':[[_0x4028('0x9e'),'DESC']]}]}]})[_0x4028('0x21')](handleEntityNotFound(_0x2439ea,null))[_0x4028('0x21')](function(_0x16e632){_0x17c3d7=_0x16e632;if(_0x522d78[_0x4028('0x5d')][_0x4028('0xa7')]&&_0x522d78[_0x4028('0x5d')][_0x4028('0xa7')]['length']){for(var _0x19a163=0x0;_0x19a163<_0x522d78['body'][_0x4028('0xa7')]['length'];_0x19a163+=0x1){_0x522d78['body'][_0x4028('0xa7')][_0x19a163]={'filename':_0x522d78[_0x4028('0x5d')][_0x4028('0xa7')][_0x19a163][_0x4028('0x3e')],'id':_0x522d78['body'][_0x4028('0xa7')][_0x19a163]['id'],'path':path[_0x4028('0xa8')](config[_0x4028('0xa9')],_0x4028('0xaa'),_0x522d78['body'][_0x4028('0xa7')][_0x19a163][_0x4028('0xab')])};}}return respondWithRpcPromise(_0x4028('0xac'),'CheckAfterSend',{'FaxAccountId':_[_0x4028('0xad')](_0x522d78[_0x4028('0x5a')]['id'])?undefined:_0x522d78[_0x4028('0x5a')]['id'],'path':_['isNil'](_0x522d78[_0x4028('0x5d')]['attachments'][0x0][_0x4028('0xae')])?undefined:_0x522d78[_0x4028('0x5d')][_0x4028('0xa7')][0x0][_0x4028('0xae')],'fax':_[_0x4028('0xad')](_0x522d78['body']['to'][0x0])?undefined:_0x522d78['body']['to'][0x0]},client9002);})[_0x4028('0x21')](function(){if(_0x17c3d7){if(_[_0x4028('0xad')](_0x522d78[_0x4028('0x5d')][_0x4028('0xaf')])){_0x522d78[_0x4028('0x5d')][_0x4028('0xaf')]=util[_0x4028('0xa3')](_0x4028('0xb0'),_0x17c3d7[_0x4028('0x3e')],_0x17c3d7[_0x4028('0xb1')]);}if(_0x17c3d7[_0x4028('0xb2')]){if(_0x17c3d7[_0x4028('0xb2')][_0x4028('0xa6')][_0x4028('0x4d')]){return _0x17c3d7[_0x4028('0xb2')]['Contacts'][0x0];}else{return db[_0x4028('0x73')]['create'](_[_0x4028('0x18')](_0x522d78['body'],{'firstName':_0x522d78[_0x4028('0x5d')]['to'][0x0],'phone':_0x522d78[_0x4028('0x5d')]['to'][0x0],'fax':_0x522d78[_0x4028('0x5d')]['to'][0x0],'ListId':_0x17c3d7[_0x4028('0xb3')]}));}}else{throw new Error(_0x4028('0xb4'));}}else{throw new Error(_0x4028('0xb5'));}})['then'](function(_0x2127e3){if(_0x2127e3){return db[_0x4028('0x70')][_0x4028('0x60')]({'where':{'ContactId':_0x2127e3['id'],'closed':![],'FaxAccountId':_0x17c3d7['id']}})[_0x4028('0x21')](function(_0x3b4778){if(_0x3b4778){return[_0x3b4778,![]];}return db[_0x4028('0x70')]['create']({'UserId':_0x522d78['user']['id'],'ContactId':_0x2127e3['id'],'FaxAccountId':_0x17c3d7['id'],'fax':_0x522d78['body']['to'][0x0],'firstMsgDirection':_0x4028('0xb6'),'Messages':[_['merge'](_0x522d78[_0x4028('0x5d')],{'read':![],'body':_0x522d78[_0x4028('0x5d')]['attachments'][0x0]['filename'],'FaxAccountId':_0x17c3d7['id'],'UserId':_0x522d78[_0x4028('0x5e')]['id'],'ContactId':_0x2127e3['id'],'AttachmentId':_0x522d78[_0x4028('0x5d')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x4028('0xa1')],'as':'Messages'}]})[_0x4028('0x21')](function(_0x1f73fb){return[_0x1f73fb,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x3738c6,_0x52d798){if(_0x52d798){return _0x3738c6;}return db[_0x4028('0xa1')][_0x4028('0x5c')]({'direction':_0x4028('0xb6'),'read':![],'body':_0x522d78[_0x4028('0x5d')][_0x4028('0xa7')][0x0][_0x4028('0xb7')],'FaxAccountId':_0x17c3d7['id'],'FaxInteractionId':_0x3738c6['id'],'UserId':_0x522d78['user']['id'],'ContactId':_0x3738c6['ContactId'],'AttachmentId':_0x522d78[_0x4028('0x5d')][_0x4028('0xa7')][0x0]['id']})[_0x4028('0x21')](function(_0x284b78){_0x3738c6[_0x4028('0xb8')][_0x4028('0xb9')]=[];_0x3738c6[_0x4028('0xb8')][_0x4028('0xb9')]['push'](_0x284b78[_0x4028('0xb8')]);return _0x3738c6;});})['then'](function(_0x21c7b5){respondWithRpcPromise('SendFax',_0x4028('0xba'),{'FaxAccountId':_[_0x4028('0xad')](_0x522d78[_0x4028('0x5a')]['id'])?undefined:_0x522d78['params']['id'],'path':_[_0x4028('0xad')](_0x522d78['body'][_0x4028('0xa7')][0x0][_0x4028('0xae')])?undefined:_0x522d78[_0x4028('0x5d')]['attachments'][0x0]['path'],'fax':_[_0x4028('0xad')](_0x522d78[_0x4028('0x5d')]['to'][0x0])?undefined:_0x522d78[_0x4028('0x5d')]['to'][0x0],'AttachmentId':_0x522d78[_0x4028('0x5d')]['attachments'][0x0]['id']},client9002)['then'](function(_0x2b94f6){logger[_0x4028('0x28')](_0x4028('0xbb'),_0x2b94f6);})[_0x4028('0x2a')](function(_0x319b75){logger['info'](_0x4028('0xbb'),_0x319b75);});return _0x21c7b5;})[_0x4028('0x21')](respondWithResult(_0x2439ea,null))[_0x4028('0x2a')](handleError(_0x2439ea,null));};exports[_0x4028('0xbc')]=function(_0x1af6c8,_0x4a666e,_0xdf9211){return db['FaxAccount'][_0x4028('0x60')]({'where':{'id':_0x1af6c8['params']['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x4a666e,null))[_0x4028('0x21')](function(_0x2a07ad){if(_0x2a07ad){return _0x2a07ad[_0x4028('0xbc')](_0x1af6c8['body'][_0x4028('0x6e')],_[_0x4028('0x71')](_0x1af6c8[_0x4028('0x5d')],['ids','id'])||{})['spread'](function(_0x25102a){for(var _0x3d3442=0x0;_0x3d3442<_0x1af6c8['body'][_0x4028('0x6e')][_0x4028('0x4d')];_0x3d3442+=0x1){socket[_0x4028('0xbd')](_0x4028('0xbe'),{'UserId':Number(_0x1af6c8[_0x4028('0x5d')][_0x4028('0x6e')][_0x3d3442]),'FaxAccountId':Number(_0x1af6c8[_0x4028('0x5a')]['id'])});}return _0x25102a;});}})['then'](respondWithResult(_0x4a666e,null))[_0x4028('0x2a')](handleError(_0x4a666e,null));};exports[_0x4028('0xbf')]=function(_0x29e188,_0x4def01,_0x390eb8){return db[_0x4028('0x43')][_0x4028('0x60')]({'where':{'id':_0x29e188[_0x4028('0x5a')]['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x4def01,null))[_0x4028('0x21')](function(_0x5a7af8){if(_0x5a7af8){return _0x5a7af8[_0x4028('0xbf')](_0x29e188[_0x4028('0x48')]['ids'])[_0x4028('0x21')](function(){if(_[_0x4028('0xc0')](_0x29e188[_0x4028('0x48')][_0x4028('0x6e')])){for(var _0xae06a7=0x0;_0xae06a7<_0x29e188[_0x4028('0x48')]['ids']['length'];_0xae06a7+=0x1){socket[_0x4028('0xbd')](_0x4028('0xc1'),{'UserId':Number(_0x29e188[_0x4028('0x48')][_0x4028('0x6e')][_0xae06a7]),'FaxAccountId':Number(_0x29e188[_0x4028('0x5a')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x29e188[_0x4028('0x48')][_0x4028('0x6e')]),'FaxAccountId':Number(_0x29e188[_0x4028('0x5a')]['id'])});}});}})[_0x4028('0x21')](respondWithStatusCode(_0x4def01,null))[_0x4028('0x2a')](handleError(_0x4def01,null));};exports['getAgents']=function(_0x4c5199,_0x2b11f9,_0x42dd4){var _0x39b4fc={};var _0x3e4857={};var _0x5b62ab;var _0x2a5e60;return db[_0x4028('0x43')][_0x4028('0x66')]({'where':{'id':_0x4c5199['params']['id']}})[_0x4028('0x21')](handleEntityNotFound(_0x2b11f9,null))['then'](function(_0x25cf1d){if(_0x25cf1d){_0x5b62ab=_0x25cf1d;_0x3e4857['model']=_[_0x4028('0x49')](db[_0x4028('0x75')][_0x4028('0x44')]);_0x3e4857[_0x4028('0x48')]=_[_0x4028('0x49')](_0x4c5199[_0x4028('0x48')]);_0x3e4857[_0x4028('0x53')]=_[_0x4028('0x4b')](_0x3e4857[_0x4028('0x47')],_0x3e4857[_0x4028('0x48')]);_0x39b4fc[_0x4028('0x4a')]=_['intersection'](_0x3e4857[_0x4028('0x47')],qs[_0x4028('0x4c')](_0x4c5199[_0x4028('0x48')][_0x4028('0x4c')]));_0x39b4fc[_0x4028('0x4a')]=_0x39b4fc[_0x4028('0x4a')][_0x4028('0x4d')]?_0x39b4fc['attributes']:_0x3e4857['model'];_0x39b4fc['order']=qs[_0x4028('0x51')](_0x4c5199['query'][_0x4028('0x51')]);_0x39b4fc[_0x4028('0x52')]=qs[_0x4028('0x53')](_[_0x4028('0x68')](_0x4c5199[_0x4028('0x48')],_0x3e4857[_0x4028('0x53')]));if(_0x4c5199[_0x4028('0x48')][_0x4028('0x54')]){_0x39b4fc['where']=_[_0x4028('0x55')](_0x39b4fc[_0x4028('0x52')],{'$or':_[_0x4028('0x42')](_0x39b4fc[_0x4028('0x4a')],function(_0x3ed512){var _0x9b0e95={};_0x9b0e95[_0x3ed512]={'$like':'%'+_0x4c5199['query'][_0x4028('0x54')]+'%'};return _0x9b0e95;})});}_0x39b4fc=_[_0x4028('0x55')]({},_0x39b4fc,_0x4c5199[_0x4028('0x69')]);return _0x5b62ab['getAgents'](_0x39b4fc);}})[_0x4028('0x21')](function(_0x5194a9){if(_0x5194a9){_0x2a5e60=_0x5194a9[_0x4028('0x4d')];if(!_0x4c5199[_0x4028('0x48')][_0x4028('0x4e')](_0x4028('0x4f'))){_0x39b4fc[_0x4028('0x2f')]=qs[_0x4028('0x2f')](_0x4c5199['query'][_0x4028('0x2f')]);_0x39b4fc[_0x4028('0x2e')]=qs[_0x4028('0x2e')](_0x4c5199[_0x4028('0x48')][_0x4028('0x2e')]);}return _0x5b62ab[_0x4028('0xc2')](_0x39b4fc);}})['then'](function(_0x1a1390){if(_0x1a1390){return _0x1a1390?{'count':_0x2a5e60,'rows':_0x1a1390}:null;}})[_0x4028('0x21')](respondWithResult(_0x2b11f9,null))[_0x4028('0x2a')](handleError(_0x2b11f9,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 5166f04..5190510 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 _0x959f=['../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x16dbcd,_0x274516){var _0x34706e=function(_0x43433d){while(--_0x43433d){_0x16dbcd['push'](_0x16dbcd['shift']());}};_0x34706e(++_0x274516);}(_0x959f,0x8b));var _0xf959=function(_0x221024,_0x1ca885){_0x221024=_0x221024-0x0;var _0x4a38ce=_0x959f[_0x221024];return _0x4a38ce;};'use strict';var EventEmitter=require(_0xf959('0x0'));var FaxAccount=require(_0xf959('0x1'))['db'][_0xf959('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf959('0x3')](0x0);var events={'afterCreate':_0xf959('0x4'),'afterUpdate':_0xf959('0x5'),'afterDestroy':'remove'};function emitEvent(_0x51d37e){return function(_0x4b031c,_0x1c08ff,_0x5c8b38){FaxAccountEvents[_0xf959('0x6')](_0x51d37e+':'+_0x4b031c['id'],_0x4b031c);FaxAccountEvents[_0xf959('0x6')](_0x51d37e,_0x4b031c);_0x5c8b38(null);};}for(var e in events){if(events[_0xf959('0x7')](e)){var event=events[e];FaxAccount[_0xf959('0x8')](e,emitEvent(event));}}module[_0xf959('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x2fbd=['emit','hasOwnProperty','hook','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x2fbd,0x12c));var _0xd2fb=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2fbd[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xd2fb('0x0'))['db'][_0xd2fb('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd2fb('0x2')](0x0);var events={'afterCreate':_0xd2fb('0x3'),'afterUpdate':_0xd2fb('0x4'),'afterDestroy':_0xd2fb('0x5')};function emitEvent(_0x43a2c7){return function(_0xb05b73,_0x14c86f,_0x1c445d){FaxAccountEvents[_0xd2fb('0x6')](_0x43a2c7+':'+_0xb05b73['id'],_0xb05b73);FaxAccountEvents['emit'](_0x43a2c7,_0xb05b73);_0x1c445d(null);};}for(var e in events){if(events[_0xd2fb('0x7')](e)){var event=events[e];FaxAccount[_0xd2fb('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index fb28849..4b1efc9 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 _0x47f6=['util','api','bluebird','path','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x245c9f,_0x1d9e8c){var _0x276b79=function(_0x2bdbd7){while(--_0x2bdbd7){_0x245c9f['push'](_0x245c9f['shift']());}};_0x276b79(++_0x1d9e8c);}(_0x47f6,0x1a3));var _0x647f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x647f('0x0'));var util=require(_0x647f('0x1'));var logger=require('../../config/logger')(_0x647f('0x2'));var moment=require('moment');var BPromise=require(_0x647f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x647f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x647f('0x5'));module[_0x647f('0x6')]=function(_0x5600a1,_0x452b2b){return _0x5600a1[_0x647f('0x7')](_0x647f('0x8'),attributes,{'tableName':_0x647f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d36=['bluebird','request-promise','path','rimraf','exports','define','FaxAccount','lodash','util','../../config/logger','api','moment'];(function(_0x36b93c,_0x566f2d){var _0x5d91d0=function(_0x27b8fb){while(--_0x27b8fb){_0x36b93c['push'](_0x36b93c['shift']());}};_0x5d91d0(++_0x566f2d);}(_0x6d36,0x163));var _0x66d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6d36[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x66d3('0x0'));var util=require(_0x66d3('0x1'));var logger=require(_0x66d3('0x2'))(_0x66d3('0x3'));var moment=require(_0x66d3('0x4'));var BPromise=require(_0x66d3('0x5'));var rp=require(_0x66d3('0x6'));var fs=require('fs');var path=require(_0x66d3('0x7'));var rimraf=require(_0x66d3('0x8'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x66d3('0x9')]=function(_0x1ee9e8,_0x217b81){return _0x1ee9e8[_0x66d3('0xa')](_0x66d3('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 8a450bb..e69231b 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 _0x6899=['describe','Sequelize','ValidationError','keys','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','find','CmList','List','DESC','FaxApplication','Applications','get','account','applications','orderBy','priority','asc','Contacts','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','*,*,*,*','created','interaction','ContactId','UserId','User','name','unshift','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','./faxAccount.socket','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','CmContact'];(function(_0x11884e,_0x1a20e2){var _0x37a290=function(_0x493d1d){while(--_0x493d1d){_0x11884e['push'](_0x11884e['shift']());}};_0x37a290(++_0x1a20e2);}(_0x6899,0x88));var _0x9689=function(_0x457c8c,_0x53a573){_0x457c8c=_0x457c8c-0x0;var _0x1379b4=_0x6899[_0x457c8c];return _0x1379b4;};'use strict';var _=require(_0x9689('0x0'));var util=require(_0x9689('0x1'));var moment=require(_0x9689('0x2'));var BPromise=require(_0x9689('0x3'));var rs=require(_0x9689('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9689('0x5'))['db'];var utils=require(_0x9689('0x6'));var logger=require(_0x9689('0x7'))(_0x9689('0x8'));var config=require(_0x9689('0x9'));var jayson=require(_0x9689('0xa'));var client=jayson['client'][_0x9689('0xb')]({'port':0x232c});config['redis']=_[_0x9689('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9689('0xd'))(new Redis(config[_0x9689('0xe')]));require(_0x9689('0xf'))['register'](socket);function respondWithRpcPromise(_0x51469c,_0x345082,_0xd2121c){return new BPromise(function(_0x3f65b4,_0x6e35c8){return client['request'](_0x51469c,_0xd2121c)[_0x9689('0x10')](function(_0x31cc9b){logger[_0x9689('0x11')]('FaxAccount,\x20%s,\x20%s',_0x345082,_0x9689('0x12'));logger[_0x9689('0x13')](_0x9689('0x14'),_0x345082,_0x9689('0x12'),JSON['stringify'](_0x31cc9b));if(_0x31cc9b[_0x9689('0x15')]){if(_0x31cc9b[_0x9689('0x15')][_0x9689('0x16')]===0x1f4){logger[_0x9689('0x15')](_0x9689('0x17'),_0x345082,_0x31cc9b[_0x9689('0x15')][_0x9689('0x18')]);return _0x6e35c8(_0x31cc9b['error'][_0x9689('0x18')]);}logger[_0x9689('0x15')](_0x9689('0x17'),_0x345082,_0x31cc9b[_0x9689('0x15')]['message']);return _0x3f65b4(_0x31cc9b['error']['message']);}else{logger['info'](_0x9689('0x17'),_0x345082,_0x9689('0x12'));_0x3f65b4(_0x31cc9b['result']['message']);}})[_0x9689('0x19')](function(_0x1be2b0){logger[_0x9689('0x15')](_0x9689('0x17'),_0x345082,_0x1be2b0);_0x6e35c8(_0x1be2b0);});});}exports[_0x9689('0x1a')]=function(_0x25b18f){var _0x30033d=this;return new Promise(function(_0x21e6b2,_0x4635cb){return db[_0x9689('0x1b')][_0x9689('0x1c')]({'raw':_0x25b18f[_0x9689('0x1d')]?_0x25b18f['options'][_0x9689('0x1e')]===undefined?!![]:![]:!![],'where':_0x25b18f[_0x9689('0x1d')]?_0x25b18f[_0x9689('0x1d')][_0x9689('0x1f')]||null:null,'attributes':_0x25b18f[_0x9689('0x1d')]?_0x25b18f[_0x9689('0x1d')][_0x9689('0x20')]||null:null,'limit':_0x25b18f['options']?_0x25b18f[_0x9689('0x1d')][_0x9689('0x21')]||null:null,'include':_0x25b18f[_0x9689('0x1d')]?_0x25b18f[_0x9689('0x1d')][_0x9689('0x22')]?_[_0x9689('0x23')](_0x25b18f['options'][_0x9689('0x22')],function(_0x4b2b6c){return{'model':db[_0x4b2b6c['model']],'as':_0x4b2b6c['as'],'attributes':_0x4b2b6c[_0x9689('0x20')],'include':_0x4b2b6c[_0x9689('0x22')]?_[_0x9689('0x23')](_0x4b2b6c[_0x9689('0x22')],function(_0x263bf6){return{'model':db[_0x263bf6[_0x9689('0x24')]],'as':_0x263bf6['as'],'attributes':_0x263bf6[_0x9689('0x20')],'include':_0x263bf6['include']?_[_0x9689('0x23')](_0x263bf6['include'],function(_0x36525e){return{'model':db[_0x36525e[_0x9689('0x24')]],'as':_0x36525e['as'],'attributes':_0x36525e[_0x9689('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c0b40){logger[_0x9689('0x11')](_0x9689('0x1a'),_0x25b18f);logger[_0x9689('0x13')](_0x9689('0x1a'),_0x25b18f,JSON[_0x9689('0x25')](_0x3c0b40));_0x21e6b2(_0x3c0b40);})['catch'](function(_0x210e28){logger['error'](_0x9689('0x1a'),_0x210e28['message'],_0x25b18f);_0x4635cb(_0x30033d[_0x9689('0x15')](0x1f4,_0x210e28[_0x9689('0x18')]));});});};exports[_0x9689('0x26')]=function(_0xcf02b4,_0x1ec849,_0x70599d){var _0x3c05c4=this;return new Promise(function(_0x320b4a,_0x473919){var _0x1183aa={'body':_0xcf02b4[_0x9689('0x27')],'channel':_0x9689('0x28')};var _0x1e94ba=[];var _0x35cf62=[];var _0x45ccc4={};return db[_0x9689('0x29')][_0x9689('0x2a')]()[_0x9689('0x10')](function(_0x42478a){if(!_0x42478a){throw new db[(_0x9689('0x2b'))][(_0x9689('0x2c'))]('no\x20available\x20attributes');}_0x1e94ba=_['difference'](_[_0x9689('0x2d')](_0x42478a),[_0x9689('0x2e'),_0x9689('0x2f')]);_0x35cf62=_['difference'](_['keys'](_0x42478a),[_0x9689('0x2e'),_0x9689('0x2f'),_0x9689('0x30'),'ListId']);if(_0xcf02b4[_0x9689('0x27')]['id']){delete _0xcf02b4[_0x9689('0x27')]['id'];}if(_[_0x9689('0x31')](_0xcf02b4[_0x9689('0x27')]['from'])){throw new db[(_0x9689('0x2b'))][(_0x9689('0x2c'))](_0x9689('0x32'));}if(_['isNil'](_0xcf02b4[_0x9689('0x27')][_0x9689('0x27')])||_0xcf02b4['body'][_0x9689('0x27')]===''){throw new db[(_0x9689('0x2b'))]['ValidationError'](_0x9689('0x33'));}if(_[_0x9689('0x31')](_0xcf02b4[_0x9689('0x27')][_0x9689('0x34')])){throw new db[(_0x9689('0x2b'))]['ValidationError'](_0x9689('0x35')+_0x35cf62);}if(!_[_0x9689('0x36')](_0x35cf62,_0xcf02b4['body'][_0x9689('0x34')])){throw new db[(_0x9689('0x2b'))][(_0x9689('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35cf62);}_0x45ccc4[_0xcf02b4[_0x9689('0x27')]['mapKey']]=_0xcf02b4[_0x9689('0x27')][_0x9689('0x37')];})[_0x9689('0x10')](function(){return db[_0x9689('0x1b')][_0x9689('0x38')]({'where':{'id':_0xcf02b4['account']['id']},'include':[{'model':db[_0x9689('0x39')],'as':_0x9689('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x45ccc4,'limit':0x1,'order':[[_0x9689('0x2f'),_0x9689('0x3b')]]}]},{'model':db[_0x9689('0x3c')],'as':_0x9689('0x3d')}]});})['then'](function(_0x5ba0e9){if(_0x5ba0e9&&_0x5ba0e9[_0x9689('0x3a')]){var _0x3dffe8=_0x5ba0e9[_0x9689('0x3e')]({'plain':!![]});_0x1183aa[_0x9689('0x3f')]=_0x3dffe8;_0x1183aa[_0x9689('0x40')]=_0x3dffe8[_0x9689('0x3d')];_0x1183aa['list']=_0x3dffe8[_0x9689('0x3a')];_0x1183aa['applications']=_[_0x9689('0x41')](_0x1183aa[_0x9689('0x40')],[_0x9689('0x42')],[_0x9689('0x43')]);if(_0x1183aa['account'][_0x9689('0x3d')]){delete _0x1183aa[_0x9689('0x3f')][_0x9689('0x3d')];}if(_0x1183aa[_0x9689('0x3f')][_0x9689('0x3a')]&&_0x1183aa[_0x9689('0x3f')][_0x9689('0x3a')][_0x9689('0x44')][_0x9689('0x45')]){return _0x1183aa[_0x9689('0x3f')][_0x9689('0x3a')][_0x9689('0x44')][0x0];}var _0x441fb0=_[_0x9689('0xc')](_0xcf02b4[_0x9689('0x27')],{'firstName':_0xcf02b4[_0x9689('0x27')]['from'],'ListId':_0x3dffe8[_0x9689('0x46')]});_0x441fb0[_0xcf02b4[_0x9689('0x27')]['mapKey']]=_0xcf02b4[_0x9689('0x27')][_0x9689('0x37')];return db[_0x9689('0x29')][_0x9689('0x47')](_0x441fb0,{'fields':_0x1e94ba,'raw':!![]});}})[_0x9689('0x10')](function(_0x3b2735){_0x1183aa[_0x9689('0x48')]=_0x3b2735;if(_0x3b2735){var _0x5e3b24={'ContactId':_0x3b2735['id'],'FaxAccountId':_0xcf02b4[_0x9689('0x3f')]['id'],'fax':_0x3b2735[_0x9689('0x28')]};return db[_0x9689('0x49')][_0x9689('0x38')]({'where':{'ContactId':_0x3b2735['id'],'closed':![],'FaxAccountId':_0xcf02b4[_0x9689('0x3f')]['id']}})[_0x9689('0x10')](function(_0x379510){if(_0x379510){return[_0x379510,![]];}return db['FaxInteraction'][_0x9689('0x47')](_0x5e3b24)[_0x9689('0x10')](function(_0x4a4916){return[_0x4a4916,!![]];});});}else{throw new Error(_0x9689('0x4a'));}})['spread'](function(_0x48db8c,_0x185732){var _0x509c44=_0x48db8c['get']({'plain':!![]});if(_0x185732){if(_0x1183aa[_0x9689('0x3f')][_0x9689('0x4b')]){_0x1183aa[_0x9689('0x40')][_0x9689('0x4c')]({'id':0x0,'priority':_0x1183aa['applications'][_0x9689('0x45')]+0x1,'app':_0x9689('0x4d'),'appdata':'unmanaged','interval':_0x9689('0x4e')});}_0x509c44[_0x9689('0x4f')]=!![];}else{_0x509c44[_0x9689('0x4f')]=![];}_0x1183aa[_0x9689('0x50')]=_0x509c44;return db['FaxMessage']['create']({'body':_0xcf02b4['body'][_0x9689('0x27')],'FaxAccountId':_0xcf02b4[_0x9689('0x3f')]['id'],'FaxInteractionId':_0x48db8c['id'],'direction':'in','ContactId':_0x48db8c[_0x9689('0x51')],'AttachmentId':_0xcf02b4['body']['AttachmentId']});})['then'](function(_0x13cdb4){_0x1183aa[_0x9689('0x18')]=_0x13cdb4;if(_0x1183aa[_0x9689('0x50')][_0x9689('0x52')]){return db[_0x9689('0x53')][_0x9689('0x38')]({'attributes':['id',_0x9689('0x54')],'where':{'id':_0x1183aa[_0x9689('0x50')][_0x9689('0x52')]}})['then'](function(_0x77ced6){if(_0x77ced6){_0x1183aa[_0x9689('0x40')][_0x9689('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x77ced6['name']+','+(_0x1183aa[_0x9689('0x3f')][_0x9689('0x56')]||0xa),'interval':_0x9689('0x4e')});}return respondWithRpcPromise('Start',_0x9689('0x57'),_0x1183aa);});}return respondWithRpcPromise(_0x9689('0x58'),'startRouting',_0x1183aa);})[_0x9689('0x10')](function(_0x172346){_0x320b4a(_0x172346);})[_0x9689('0x19')](function(_0x3b1d01){_0x473919(_0x3c05c4[_0x9689('0x15')](0x1f4,_0x3b1d01[_0x9689('0x18')]));});});}; \ No newline at end of file +var _0x3a1c=['asc','Contacts','length','CmContact','create','FaxInteraction','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','findAll','options','raw','where','attributes','include','model','map','then','catch','NotifyFaxAccount','body','fax','describe','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','orderBy'];(function(_0x4009b6,_0x3ce4d0){var _0x1ee8ba=function(_0x57fa4d){while(--_0x57fa4d){_0x4009b6['push'](_0x4009b6['shift']());}};_0x1ee8ba(++_0x3ce4d0);}(_0x3a1c,0xc7));var _0xc3a1=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x3a1c[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xc3a1('0x0'));var util=require(_0xc3a1('0x1'));var moment=require(_0xc3a1('0x2'));var BPromise=require(_0xc3a1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3a1('0x4'));var db=require(_0xc3a1('0x5'))['db'];var utils=require(_0xc3a1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc3a1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc3a1('0x8')][_0xc3a1('0x9')]({'port':0x232c});config[_0xc3a1('0xa')]=_[_0xc3a1('0xb')](config[_0xc3a1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3a1('0xa')]));require(_0xc3a1('0xc'))['register'](socket);function respondWithRpcPromise(_0xa090a8,_0x55cea4,_0x52ce25){return new BPromise(function(_0x4c079c,_0x251a9e){return client[_0xc3a1('0xd')](_0xa090a8,_0x52ce25)['then'](function(_0x50288e){logger[_0xc3a1('0xe')](_0xc3a1('0xf'),_0x55cea4,_0xc3a1('0x10'));logger[_0xc3a1('0x11')](_0xc3a1('0x12'),_0x55cea4,'request\x20sent',JSON[_0xc3a1('0x13')](_0x50288e));if(_0x50288e[_0xc3a1('0x14')]){if(_0x50288e[_0xc3a1('0x14')][_0xc3a1('0x15')]===0x1f4){logger[_0xc3a1('0x14')](_0xc3a1('0xf'),_0x55cea4,_0x50288e[_0xc3a1('0x14')]['message']);return _0x251a9e(_0x50288e['error'][_0xc3a1('0x16')]);}logger[_0xc3a1('0x14')](_0xc3a1('0xf'),_0x55cea4,_0x50288e[_0xc3a1('0x14')][_0xc3a1('0x16')]);return _0x4c079c(_0x50288e[_0xc3a1('0x14')]['message']);}else{logger['info'](_0xc3a1('0xf'),_0x55cea4,'request\x20sent');_0x4c079c(_0x50288e[_0xc3a1('0x17')]['message']);}})['catch'](function(_0x5e2e2b){logger['error'](_0xc3a1('0xf'),_0x55cea4,_0x5e2e2b);_0x251a9e(_0x5e2e2b);});});}exports[_0xc3a1('0x18')]=function(_0x8d5637){var _0x4aefa0=this;return new Promise(function(_0x262e18,_0x529aef){return db['FaxAccount'][_0xc3a1('0x19')]({'raw':_0x8d5637[_0xc3a1('0x1a')]?_0x8d5637[_0xc3a1('0x1a')][_0xc3a1('0x1b')]===undefined?!![]:![]:!![],'where':_0x8d5637['options']?_0x8d5637[_0xc3a1('0x1a')][_0xc3a1('0x1c')]||null:null,'attributes':_0x8d5637[_0xc3a1('0x1a')]?_0x8d5637[_0xc3a1('0x1a')][_0xc3a1('0x1d')]||null:null,'limit':_0x8d5637[_0xc3a1('0x1a')]?_0x8d5637[_0xc3a1('0x1a')]['limit']||null:null,'include':_0x8d5637[_0xc3a1('0x1a')]?_0x8d5637['options']['include']?_['map'](_0x8d5637[_0xc3a1('0x1a')][_0xc3a1('0x1e')],function(_0x1eb7f7){return{'model':db[_0x1eb7f7[_0xc3a1('0x1f')]],'as':_0x1eb7f7['as'],'attributes':_0x1eb7f7['attributes'],'include':_0x1eb7f7['include']?_[_0xc3a1('0x20')](_0x1eb7f7[_0xc3a1('0x1e')],function(_0x4dc808){return{'model':db[_0x4dc808['model']],'as':_0x4dc808['as'],'attributes':_0x4dc808[_0xc3a1('0x1d')],'include':_0x4dc808['include']?_['map'](_0x4dc808[_0xc3a1('0x1e')],function(_0x49ce24){return{'model':db[_0x49ce24[_0xc3a1('0x1f')]],'as':_0x49ce24['as'],'attributes':_0x49ce24[_0xc3a1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc3a1('0x21')](function(_0x2257b2){logger['info'](_0xc3a1('0x18'),_0x8d5637);logger['debug'](_0xc3a1('0x18'),_0x8d5637,JSON[_0xc3a1('0x13')](_0x2257b2));_0x262e18(_0x2257b2);})[_0xc3a1('0x22')](function(_0x3dbdea){logger[_0xc3a1('0x14')](_0xc3a1('0x18'),_0x3dbdea[_0xc3a1('0x16')],_0x8d5637);_0x529aef(_0x4aefa0['error'](0x1f4,_0x3dbdea[_0xc3a1('0x16')]));});});};exports[_0xc3a1('0x23')]=function(_0x122f93,_0x190440,_0x5b294d){var _0xa11948=this;return new Promise(function(_0x202b4e,_0x4c40bc){var _0x7bd270={'body':_0x122f93[_0xc3a1('0x24')],'channel':_0xc3a1('0x25')};var _0x2a0b2c=[];var _0x25585d=[];var _0x4d7e80={};return db['CmContact'][_0xc3a1('0x26')]()[_0xc3a1('0x21')](function(_0x1f3f09){if(!_0x1f3f09){throw new db[(_0xc3a1('0x27'))]['ValidationError'](_0xc3a1('0x28'));}_0x2a0b2c=_[_0xc3a1('0x29')](_[_0xc3a1('0x2a')](_0x1f3f09),['createdAt',_0xc3a1('0x2b')]);_0x25585d=_[_0xc3a1('0x29')](_['keys'](_0x1f3f09),[_0xc3a1('0x2c'),_0xc3a1('0x2b'),_0xc3a1('0x2d'),_0xc3a1('0x2e')]);if(_0x122f93[_0xc3a1('0x24')]['id']){delete _0x122f93[_0xc3a1('0x24')]['id'];}if(_[_0xc3a1('0x2f')](_0x122f93[_0xc3a1('0x24')][_0xc3a1('0x30')])){throw new db[(_0xc3a1('0x27'))][(_0xc3a1('0x31'))](_0xc3a1('0x32'));}if(_['isNil'](_0x122f93[_0xc3a1('0x24')]['body'])||_0x122f93[_0xc3a1('0x24')]['body']===''){throw new db[(_0xc3a1('0x27'))]['ValidationError'](_0xc3a1('0x33'));}if(_['isNil'](_0x122f93['body']['mapKey'])){throw new db[(_0xc3a1('0x27'))][(_0xc3a1('0x31'))](_0xc3a1('0x34')+_0x25585d);}if(!_[_0xc3a1('0x35')](_0x25585d,_0x122f93[_0xc3a1('0x24')][_0xc3a1('0x36')])){throw new db[(_0xc3a1('0x27'))][(_0xc3a1('0x31'))](_0xc3a1('0x37')+_0x25585d);}_0x4d7e80[_0x122f93[_0xc3a1('0x24')][_0xc3a1('0x36')]]=_0x122f93[_0xc3a1('0x24')][_0xc3a1('0x30')];})[_0xc3a1('0x21')](function(){return db[_0xc3a1('0x38')][_0xc3a1('0x39')]({'where':{'id':_0x122f93[_0xc3a1('0x3a')]['id']},'include':[{'model':db[_0xc3a1('0x3b')],'as':_0xc3a1('0x3c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4d7e80,'limit':0x1,'order':[['updatedAt',_0xc3a1('0x3d')]]}]},{'model':db[_0xc3a1('0x3e')],'as':_0xc3a1('0x3f')}]});})[_0xc3a1('0x21')](function(_0xb560fd){if(_0xb560fd&&_0xb560fd['List']){var _0x5aea24=_0xb560fd[_0xc3a1('0x40')]({'plain':!![]});_0x7bd270['account']=_0x5aea24;_0x7bd270[_0xc3a1('0x41')]=_0x5aea24[_0xc3a1('0x3f')];_0x7bd270[_0xc3a1('0x42')]=_0x5aea24[_0xc3a1('0x3c')];_0x7bd270[_0xc3a1('0x41')]=_[_0xc3a1('0x43')](_0x7bd270[_0xc3a1('0x41')],['priority'],[_0xc3a1('0x44')]);if(_0x7bd270[_0xc3a1('0x3a')][_0xc3a1('0x3f')]){delete _0x7bd270[_0xc3a1('0x3a')][_0xc3a1('0x3f')];}if(_0x7bd270['account'][_0xc3a1('0x3c')]&&_0x7bd270[_0xc3a1('0x3a')]['List'][_0xc3a1('0x45')][_0xc3a1('0x46')]){return _0x7bd270[_0xc3a1('0x3a')][_0xc3a1('0x3c')][_0xc3a1('0x45')][0x0];}var _0x3b982e=_[_0xc3a1('0xb')](_0x122f93[_0xc3a1('0x24')],{'firstName':_0x122f93[_0xc3a1('0x24')][_0xc3a1('0x30')],'ListId':_0x5aea24[_0xc3a1('0x2e')]});_0x3b982e[_0x122f93[_0xc3a1('0x24')][_0xc3a1('0x36')]]=_0x122f93[_0xc3a1('0x24')]['from'];return db[_0xc3a1('0x47')][_0xc3a1('0x48')](_0x3b982e,{'fields':_0x2a0b2c,'raw':!![]});}})[_0xc3a1('0x21')](function(_0x4b807c){_0x7bd270['contact']=_0x4b807c;if(_0x4b807c){var _0x288917={'ContactId':_0x4b807c['id'],'FaxAccountId':_0x122f93[_0xc3a1('0x3a')]['id'],'fax':_0x4b807c[_0xc3a1('0x25')]};return db[_0xc3a1('0x49')][_0xc3a1('0x39')]({'where':{'ContactId':_0x4b807c['id'],'closed':![],'FaxAccountId':_0x122f93[_0xc3a1('0x3a')]['id']}})[_0xc3a1('0x21')](function(_0x5b85ca){if(_0x5b85ca){return[_0x5b85ca,![]];}return db[_0xc3a1('0x49')]['create'](_0x288917)[_0xc3a1('0x21')](function(_0x473ff5){return[_0x473ff5,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc3a1('0x4a')](function(_0x36bdaa,_0x38c434){var _0x49891f=_0x36bdaa[_0xc3a1('0x40')]({'plain':!![]});if(_0x38c434){if(_0x7bd270[_0xc3a1('0x3a')][_0xc3a1('0x4b')]){_0x7bd270[_0xc3a1('0x41')][_0xc3a1('0x4c')]({'id':0x0,'priority':_0x7bd270['applications']['length']+0x1,'app':_0xc3a1('0x4d'),'appdata':'unmanaged','interval':_0xc3a1('0x4e')});}_0x49891f[_0xc3a1('0x4f')]=!![];}else{_0x49891f[_0xc3a1('0x4f')]=![];}_0x7bd270[_0xc3a1('0x50')]=_0x49891f;return db[_0xc3a1('0x51')][_0xc3a1('0x48')]({'body':_0x122f93[_0xc3a1('0x24')][_0xc3a1('0x24')],'FaxAccountId':_0x122f93[_0xc3a1('0x3a')]['id'],'FaxInteractionId':_0x36bdaa['id'],'direction':'in','ContactId':_0x36bdaa[_0xc3a1('0x52')],'AttachmentId':_0x122f93[_0xc3a1('0x24')]['AttachmentId']});})[_0xc3a1('0x21')](function(_0x3baecd){_0x7bd270[_0xc3a1('0x16')]=_0x3baecd;if(_0x7bd270[_0xc3a1('0x50')]['UserId']){return db[_0xc3a1('0x53')][_0xc3a1('0x39')]({'attributes':['id',_0xc3a1('0x54')],'where':{'id':_0x7bd270[_0xc3a1('0x50')]['UserId']}})[_0xc3a1('0x21')](function(_0x286b89){if(_0x286b89){_0x7bd270[_0xc3a1('0x41')][_0xc3a1('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x286b89[_0xc3a1('0x54')]+','+(_0x7bd270[_0xc3a1('0x3a')][_0xc3a1('0x56')]||0xa),'interval':_0xc3a1('0x4e')});}return respondWithRpcPromise(_0xc3a1('0x57'),_0xc3a1('0x58'),_0x7bd270);});}return respondWithRpcPromise('Start',_0xc3a1('0x58'),_0x7bd270);})['then'](function(_0x491a07){_0x202b4e(_0x491a07);})['catch'](function(_0x440fbd){_0x4c40bc(_0xa11948[_0xc3a1('0x14')](0x1f4,_0x440fbd[_0xc3a1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 44bb20d..1995c01 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 _0x92d7=['emit','removeListener','register','remove'];(function(_0x336caa,_0x2d74dd){var _0x564a11=function(_0x5ceb08){while(--_0x5ceb08){_0x336caa['push'](_0x336caa['shift']());}};_0x564a11(++_0x2d74dd);}(_0x92d7,0x167));var _0x792d=function(_0x177bfc,_0x993e6){_0x177bfc=_0x177bfc-0x0;var _0x2ca696=_0x92d7[_0x177bfc];return _0x2ca696;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x792d('0x0'),'update'];function createListener(_0xf8acf7,_0x40a32a){return function(_0x2cbe3c){_0x40a32a[_0x792d('0x1')](_0xf8acf7,_0x2cbe3c);};}function removeListener(_0x473178,_0x24d954){return function(){FaxAccountEvents[_0x792d('0x2')](_0x473178,_0x24d954);};}exports[_0x792d('0x3')]=function(_0x128b58){for(var _0x77028a=0x0,_0x2dfc93=events['length'];_0x77028a<_0x2dfc93;_0x77028a++){var _0x88f3a8=events[_0x77028a];var _0xd56d87=createListener('faxAccount:'+_0x88f3a8,_0x128b58);FaxAccountEvents['on'](_0x88f3a8,_0xd56d87);}}; \ No newline at end of file +var _0x5c1f=['emit','removeListener','register','length','./faxAccount.events','remove'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x5c1f,0x178));var _0xf5c1=function(_0x1cec84,_0x101ec2){_0x1cec84=_0x1cec84-0x0;var _0x12b7d3=_0x5c1f[_0x1cec84];return _0x12b7d3;};'use strict';var FaxAccountEvents=require(_0xf5c1('0x0'));var events=['save',_0xf5c1('0x1'),'update'];function createListener(_0x9eb3d4,_0x1d8846){return function(_0x124cd5){_0x1d8846[_0xf5c1('0x2')](_0x9eb3d4,_0x124cd5);};}function removeListener(_0x33259b,_0x43abf0){return function(){FaxAccountEvents[_0xf5c1('0x3')](_0x33259b,_0x43abf0);};}exports[_0xf5c1('0x4')]=function(_0x42b902){for(var _0x417ae5=0x0,_0x24a0d7=events[_0xf5c1('0x5')];_0x417ae5<_0x24a0d7;_0x417ae5++){var _0x5c34a9=events[_0x417ae5];var _0x391fe2=createListener('faxAccount:'+_0x5c34a9,_0x42b902);FaxAccountEvents['on'](_0x5c34a9,_0x391fe2);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 20baf1e..a5e4eb3 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(_0x1edb57,_0x217b2d){var _0x311eec=function(_0x536c5c){while(--_0x536c5c){_0x1edb57['push'](_0x1edb57['shift']());}};_0x311eec(++_0x217b2d);}(_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['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(_0x5411cb,_0x1cd69d){var _0x32727a=function(_0x22a762){while(--_0x22a762){_0x5411cb['push'](_0x5411cb['shift']());}};_0x32727a(++_0x1cd69d);}(_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'));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 74043a0..ebba25e 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 _0xf052=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x416c15,_0x186d0a){var _0x75a7cc=function(_0x20120a){while(--_0x20120a){_0x416c15['push'](_0x416c15['shift']());}};_0x75a7cc(++_0x186d0a);}(_0xf052,0x1cb));var _0x2f05=function(_0x21fec0,_0x2f9a99){_0x21fec0=_0x21fec0-0x0;var _0xcf272e=_0xf052[_0x21fec0];return _0xcf272e;};'use strict';var Sequelize=require(_0x2f05('0x0'));module[_0x2f05('0x1')]={'priority':{'type':Sequelize[_0x2f05('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2f05('0x3')],'allowNull':![],'defaultValue':_0x2f05('0x4')},'appdata':{'type':Sequelize[_0x2f05('0x5')]()},'description':{'type':Sequelize[_0x2f05('0x3')]},'interval':{'type':Sequelize[_0x2f05('0x3')],'defaultValue':_0x2f05('0x6')}}; \ No newline at end of file +var _0x6106=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x5cdc68,_0x406b80){var _0x3db725=function(_0xab6fdc){while(--_0xab6fdc){_0x5cdc68['push'](_0x5cdc68['shift']());}};_0x3db725(++_0x406b80);}(_0x6106,0x101));var _0x6610=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x6106[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x6610('0x0'));module[_0x6610('0x1')]={'priority':{'type':Sequelize[_0x6610('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6610('0x3')],'allowNull':![],'defaultValue':_0x6610('0x4')},'appdata':{'type':Sequelize[_0x6610('0x5')]()},'description':{'type':Sequelize[_0x6610('0x3')]},'interval':{'type':Sequelize[_0x6610('0x3')],'defaultValue':_0x6610('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 3f8b312..faab621 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 _0xd30b=['includeAll','include','findAll','rows','show','params','keys','find','catch','create','update','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','map','FaxApplication','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd30b,0x16f));var _0xbd30=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xd30b[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0xbd30('0x0'));var rimraf=require(_0xbd30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbd30('0x2'));var moment=require(_0xbd30('0x3'));var BPromise=require(_0xbd30('0x4'));var Mustache=require(_0xbd30('0x5'));var util=require(_0xbd30('0x6'));var path=require(_0xbd30('0x7'));var sox=require('sox');var csv=require(_0xbd30('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd30('0x9'));var _=require('lodash');var squel=require(_0xbd30('0xa'));var crypto=require(_0xbd30('0xb'));var jsforce=require(_0xbd30('0xc'));var deskjs=require(_0xbd30('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd30('0xe'));var authService=require(_0xbd30('0xf'));var qs=require(_0xbd30('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd30('0x11'));var logger=require(_0xbd30('0x12'))('api');var utils=require(_0xbd30('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbd30('0x14'));var db=require(_0xbd30('0x15'))['db'];function respondWithStatusCode(_0x2230c4,_0x1867c3){_0x1867c3=_0x1867c3||0xcc;return function(_0x2c3161){if(_0x2c3161){return _0x2230c4['sendStatus'](_0x1867c3);}return _0x2230c4[_0xbd30('0x16')](_0x1867c3)[_0xbd30('0x17')]();};}function respondWithResult(_0x338966,_0x47bf81){_0x47bf81=_0x47bf81||0xc8;return function(_0x13e00){if(_0x13e00){return _0x338966[_0xbd30('0x16')](_0x47bf81)[_0xbd30('0x18')](_0x13e00);}};}function respondWithFilteredResult(_0x419c0b,_0x309b23){return function(_0x19a615){if(_0x19a615){var _0x18741f=typeof _0x309b23[_0xbd30('0x19')]===_0xbd30('0x1a')&&typeof _0x309b23[_0xbd30('0x1b')]===_0xbd30('0x1a');var _0x16e484=_0x19a615['count'];var _0x3510d2=_0x18741f?0x0:_0x309b23['offset'];var _0x15bcbb=_0x18741f?_0x19a615['count']:_0x309b23[_0xbd30('0x19')]+_0x309b23['limit'];var _0x33844e;if(_0x15bcbb>=_0x16e484){_0x15bcbb=_0x16e484;_0x33844e=0xc8;}else{_0x33844e=0xce;}_0x419c0b[_0xbd30('0x16')](_0x33844e);return _0x419c0b[_0xbd30('0x1c')](_0xbd30('0x1d'),_0x3510d2+'-'+_0x15bcbb+'/'+_0x16e484)['json'](_0x19a615);}return null;};}function patchUpdates(_0x3e6f06){return function(_0x345375){try{jsonpatch[_0xbd30('0x1e')](_0x345375,_0x3e6f06,!![]);}catch(_0x4d80df){return BPromise['reject'](_0x4d80df);}return _0x345375[_0xbd30('0x1f')]();};}function saveUpdates(_0x33419c,_0x43f4db){return function(_0x3e8175){if(_0x3e8175){return _0x3e8175['update'](_0x33419c)['then'](function(_0xbf7c58){return _0xbf7c58;});}return null;};}function removeEntity(_0xa39753,_0x567552){return function(_0x1b54e2){if(_0x1b54e2){return _0x1b54e2[_0xbd30('0x20')]()[_0xbd30('0x21')](function(){_0xa39753[_0xbd30('0x16')](0xcc)[_0xbd30('0x17')]();});}};}function handleEntityNotFound(_0x374c90,_0x15c013){return function(_0x2b3727){if(!_0x2b3727){_0x374c90['sendStatus'](0x194);}return _0x2b3727;};}function handleError(_0x598387,_0xae7013){_0xae7013=_0xae7013||0x1f4;return function(_0x3fc626){logger['error'](_0x3fc626[_0xbd30('0x22')]);if(_0x3fc626['name']){delete _0x3fc626[_0xbd30('0x23')];}_0x598387[_0xbd30('0x16')](_0xae7013)[_0xbd30('0x24')](_0x3fc626);};}exports['index']=function(_0x418a37,_0x39ed32){var _0x5d097c={},_0x39bcfd={},_0x119073={'count':0x0,'rows':[]};var _0x4e1ca7=_[_0xbd30('0x25')](db[_0xbd30('0x26')][_0xbd30('0x27')],function(_0x5f4f29){return{'name':_0x5f4f29['fieldName'],'type':_0x5f4f29[_0xbd30('0x28')]['key']};});_0x39bcfd[_0xbd30('0x29')]=_[_0xbd30('0x25')](_0x4e1ca7,_0xbd30('0x23'));_0x39bcfd[_0xbd30('0x2a')]=_['keys'](_0x418a37[_0xbd30('0x2a')]);_0x39bcfd[_0xbd30('0x2b')]=_[_0xbd30('0x2c')](_0x39bcfd[_0xbd30('0x29')],_0x39bcfd[_0xbd30('0x2a')]);_0x5d097c[_0xbd30('0x2d')]=_['intersection'](_0x39bcfd[_0xbd30('0x29')],qs[_0xbd30('0x2e')](_0x418a37[_0xbd30('0x2a')]['fields']));_0x5d097c['attributes']=_0x5d097c['attributes'][_0xbd30('0x2f')]?_0x5d097c['attributes']:_0x39bcfd['model'];if(!_0x418a37[_0xbd30('0x2a')][_0xbd30('0x30')](_0xbd30('0x31'))){_0x5d097c['limit']=qs[_0xbd30('0x1b')](_0x418a37['query'][_0xbd30('0x1b')]);_0x5d097c['offset']=qs['offset'](_0x418a37[_0xbd30('0x2a')][_0xbd30('0x19')]);}_0x5d097c[_0xbd30('0x32')]=qs[_0xbd30('0x33')](_0x418a37[_0xbd30('0x2a')]['sort']);_0x5d097c[_0xbd30('0x34')]=qs[_0xbd30('0x2b')](_[_0xbd30('0x35')](_0x418a37[_0xbd30('0x2a')],_0x39bcfd[_0xbd30('0x2b')]),_0x4e1ca7);if(_0x418a37[_0xbd30('0x2a')]['filter']){_0x5d097c['where']=_['merge'](_0x5d097c[_0xbd30('0x34')],{'$or':_[_0xbd30('0x25')](_0x4e1ca7,function(_0x2efc8b){if(_0x2efc8b[_0xbd30('0x28')]!==_0xbd30('0x36')){var _0x51e082={};_0x51e082[_0x2efc8b[_0xbd30('0x23')]]={'$like':'%'+_0x418a37[_0xbd30('0x2a')][_0xbd30('0x37')]+'%'};return _0x51e082;}})});}_0x5d097c=_[_0xbd30('0x38')]({},_0x5d097c,_0x418a37[_0xbd30('0x39')]);var _0x10886c={'where':_0x5d097c[_0xbd30('0x34')]};return db['FaxApplication'][_0xbd30('0x3a')](_0x10886c)[_0xbd30('0x21')](function(_0x34b8e3){_0x119073[_0xbd30('0x3a')]=_0x34b8e3;if(_0x418a37[_0xbd30('0x2a')][_0xbd30('0x3b')]){_0x5d097c[_0xbd30('0x3c')]=[{'all':!![]}];}return db['FaxApplication'][_0xbd30('0x3d')](_0x5d097c);})[_0xbd30('0x21')](function(_0x17563c){_0x119073[_0xbd30('0x3e')]=_0x17563c;return _0x119073;})['then'](respondWithFilteredResult(_0x39ed32,_0x5d097c))['catch'](handleError(_0x39ed32,null));};exports[_0xbd30('0x3f')]=function(_0x4306a0,_0x47e988){var _0x4880e0={'raw':!![],'where':{'id':_0x4306a0[_0xbd30('0x40')]['id']}},_0x33374b={};_0x33374b[_0xbd30('0x29')]=_['keys'](db[_0xbd30('0x26')]['rawAttributes']);_0x33374b[_0xbd30('0x2a')]=_[_0xbd30('0x41')](_0x4306a0[_0xbd30('0x2a')]);_0x33374b[_0xbd30('0x2b')]=_[_0xbd30('0x2c')](_0x33374b[_0xbd30('0x29')],_0x33374b[_0xbd30('0x2a')]);_0x4880e0[_0xbd30('0x2d')]=_[_0xbd30('0x2c')](_0x33374b[_0xbd30('0x29')],qs[_0xbd30('0x2e')](_0x4306a0[_0xbd30('0x2a')][_0xbd30('0x2e')]));_0x4880e0[_0xbd30('0x2d')]=_0x4880e0[_0xbd30('0x2d')][_0xbd30('0x2f')]?_0x4880e0[_0xbd30('0x2d')]:_0x33374b[_0xbd30('0x29')];if(_0x4306a0['query'][_0xbd30('0x3b')]){_0x4880e0['include']=[{'all':!![]}];}_0x4880e0=_['merge']({},_0x4880e0,_0x4306a0[_0xbd30('0x39')]);return db[_0xbd30('0x26')][_0xbd30('0x42')](_0x4880e0)[_0xbd30('0x21')](handleEntityNotFound(_0x47e988,null))[_0xbd30('0x21')](respondWithResult(_0x47e988,null))[_0xbd30('0x43')](handleError(_0x47e988,null));};exports[_0xbd30('0x44')]=function(_0x3688f2,_0x31d46e){return db[_0xbd30('0x26')][_0xbd30('0x44')](_0x3688f2['body'],{})[_0xbd30('0x21')](respondWithResult(_0x31d46e,0xc9))[_0xbd30('0x43')](handleError(_0x31d46e,null));};exports[_0xbd30('0x45')]=function(_0x4c0f96,_0x24a7c8){if(_0x4c0f96[_0xbd30('0x46')]['id']){delete _0x4c0f96['body']['id'];}return db[_0xbd30('0x26')][_0xbd30('0x42')]({'where':{'id':_0x4c0f96[_0xbd30('0x40')]['id']}})[_0xbd30('0x21')](handleEntityNotFound(_0x24a7c8,null))[_0xbd30('0x21')](saveUpdates(_0x4c0f96[_0xbd30('0x46')],null))[_0xbd30('0x21')](respondWithResult(_0x24a7c8,null))['catch'](handleError(_0x24a7c8,null));};exports[_0xbd30('0x20')]=function(_0x3c1f9c,_0x27a0f0){return db[_0xbd30('0x26')][_0xbd30('0x42')]({'where':{'id':_0x3c1f9c[_0xbd30('0x40')]['id']}})['then'](handleEntityNotFound(_0x27a0f0,null))[_0xbd30('0x21')](removeEntity(_0x27a0f0,null))['catch'](handleError(_0x27a0f0,null));}; \ No newline at end of file +var _0x5834=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','map','FaxApplication','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x213013,_0x2e746f){var _0x4ccb1f=function(_0x23522b){while(--_0x23522b){_0x213013['push'](_0x213013['shift']());}};_0x4ccb1f(++_0x2e746f);}(_0x5834,0x16c));var _0x4583=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x5834[_0x5c9307];return _0x373e29;};'use strict';var emlformat=require(_0x4583('0x0'));var rimraf=require(_0x4583('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4583('0x2'));var rp=require(_0x4583('0x3'));var moment=require(_0x4583('0x4'));var BPromise=require(_0x4583('0x5'));var Mustache=require(_0x4583('0x6'));var util=require('util');var path=require(_0x4583('0x7'));var sox=require(_0x4583('0x8'));var csv=require(_0x4583('0x9'));var ejs=require(_0x4583('0xa'));var fs=require('fs');var fs_extra=require(_0x4583('0xb'));var _=require(_0x4583('0xc'));var squel=require(_0x4583('0xd'));var crypto=require('crypto');var jsforce=require(_0x4583('0xe'));var deskjs=require(_0x4583('0xf'));var toCsv=require(_0x4583('0x9'));var querystring=require(_0x4583('0x10'));var Papa=require('papaparse');var Redis=require(_0x4583('0x11'));var authService=require(_0x4583('0x12'));var qs=require(_0x4583('0x13'));var as=require(_0x4583('0x14'));var hardwareService=require(_0x4583('0x15'));var logger=require(_0x4583('0x16'))(_0x4583('0x17'));var utils=require(_0x4583('0x18'));var config=require(_0x4583('0x19'));var licenseUtil=require(_0x4583('0x1a'));var db=require(_0x4583('0x1b'))['db'];function respondWithStatusCode(_0x1af235,_0x1117ba){_0x1117ba=_0x1117ba||0xcc;return function(_0x22d71a){if(_0x22d71a){return _0x1af235[_0x4583('0x1c')](_0x1117ba);}return _0x1af235[_0x4583('0x1d')](_0x1117ba)['end']();};}function respondWithResult(_0x516952,_0x2ca861){_0x2ca861=_0x2ca861||0xc8;return function(_0x16cf48){if(_0x16cf48){return _0x516952['status'](_0x2ca861)[_0x4583('0x1e')](_0x16cf48);}};}function respondWithFilteredResult(_0xb0043,_0x54845f){return function(_0x10879d){if(_0x10879d){var _0x487759=typeof _0x54845f[_0x4583('0x1f')]===_0x4583('0x20')&&typeof _0x54845f[_0x4583('0x21')]===_0x4583('0x20');var _0x349ef8=_0x10879d[_0x4583('0x22')];var _0x1100fd=_0x487759?0x0:_0x54845f['offset'];var _0x59a30f=_0x487759?_0x10879d[_0x4583('0x22')]:_0x54845f[_0x4583('0x1f')]+_0x54845f[_0x4583('0x21')];var _0x3c53ae;if(_0x59a30f>=_0x349ef8){_0x59a30f=_0x349ef8;_0x3c53ae=0xc8;}else{_0x3c53ae=0xce;}_0xb0043[_0x4583('0x1d')](_0x3c53ae);return _0xb0043[_0x4583('0x23')](_0x4583('0x24'),_0x1100fd+'-'+_0x59a30f+'/'+_0x349ef8)[_0x4583('0x1e')](_0x10879d);}return null;};}function patchUpdates(_0x309084){return function(_0x59bf06){try{jsonpatch[_0x4583('0x25')](_0x59bf06,_0x309084,!![]);}catch(_0x4f75e6){return BPromise[_0x4583('0x26')](_0x4f75e6);}return _0x59bf06[_0x4583('0x27')]();};}function saveUpdates(_0x77ec14,_0x94eb2e){return function(_0x26b50a){if(_0x26b50a){return _0x26b50a[_0x4583('0x28')](_0x77ec14)[_0x4583('0x29')](function(_0x798731){return _0x798731;});}return null;};}function removeEntity(_0x5c88a5,_0x4af3ea){return function(_0x2c75fb){if(_0x2c75fb){return _0x2c75fb[_0x4583('0x2a')]()[_0x4583('0x29')](function(){_0x5c88a5[_0x4583('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa58824,_0x12f27d){return function(_0x11e70a){if(!_0x11e70a){_0xa58824[_0x4583('0x1c')](0x194);}return _0x11e70a;};}function handleError(_0x135f76,_0x1de9ce){_0x1de9ce=_0x1de9ce||0x1f4;return function(_0x869c7a){logger['error'](_0x869c7a[_0x4583('0x2b')]);if(_0x869c7a['name']){delete _0x869c7a['name'];}_0x135f76[_0x4583('0x1d')](_0x1de9ce)['send'](_0x869c7a);};}exports['index']=function(_0x15ddec,_0x93bff5){var _0x6aa869={},_0x33bde8={},_0x4b31b9={'count':0x0,'rows':[]};var _0x2d1b5e=_[_0x4583('0x2c')](db[_0x4583('0x2d')]['rawAttributes'],function(_0x5d79b1){return{'name':_0x5d79b1['fieldName'],'type':_0x5d79b1[_0x4583('0x2e')][_0x4583('0x2f')]};});_0x33bde8[_0x4583('0x30')]=_[_0x4583('0x2c')](_0x2d1b5e,'name');_0x33bde8[_0x4583('0x31')]=_[_0x4583('0x32')](_0x15ddec['query']);_0x33bde8[_0x4583('0x33')]=_[_0x4583('0x34')](_0x33bde8[_0x4583('0x30')],_0x33bde8[_0x4583('0x31')]);_0x6aa869[_0x4583('0x35')]=_[_0x4583('0x34')](_0x33bde8[_0x4583('0x30')],qs['fields'](_0x15ddec[_0x4583('0x31')][_0x4583('0x36')]));_0x6aa869[_0x4583('0x35')]=_0x6aa869[_0x4583('0x35')][_0x4583('0x37')]?_0x6aa869['attributes']:_0x33bde8[_0x4583('0x30')];if(!_0x15ddec['query'][_0x4583('0x38')](_0x4583('0x39'))){_0x6aa869[_0x4583('0x21')]=qs[_0x4583('0x21')](_0x15ddec['query'][_0x4583('0x21')]);_0x6aa869[_0x4583('0x1f')]=qs[_0x4583('0x1f')](_0x15ddec[_0x4583('0x31')][_0x4583('0x1f')]);}_0x6aa869[_0x4583('0x3a')]=qs[_0x4583('0x3b')](_0x15ddec['query']['sort']);_0x6aa869[_0x4583('0x3c')]=qs['filters'](_[_0x4583('0x3d')](_0x15ddec[_0x4583('0x31')],_0x33bde8[_0x4583('0x33')]),_0x2d1b5e);if(_0x15ddec[_0x4583('0x31')][_0x4583('0x3e')]){_0x6aa869[_0x4583('0x3c')]=_[_0x4583('0x3f')](_0x6aa869['where'],{'$or':_[_0x4583('0x2c')](_0x2d1b5e,function(_0x3844f1){if(_0x3844f1['type']!==_0x4583('0x40')){var _0xd66c51={};_0xd66c51[_0x3844f1[_0x4583('0x41')]]={'$like':'%'+_0x15ddec[_0x4583('0x31')][_0x4583('0x3e')]+'%'};return _0xd66c51;}})});}_0x6aa869=_[_0x4583('0x3f')]({},_0x6aa869,_0x15ddec[_0x4583('0x42')]);var _0x55bc2e={'where':_0x6aa869[_0x4583('0x3c')]};return db['FaxApplication'][_0x4583('0x22')](_0x55bc2e)[_0x4583('0x29')](function(_0x2e72db){_0x4b31b9['count']=_0x2e72db;if(_0x15ddec['query'][_0x4583('0x43')]){_0x6aa869['include']=[{'all':!![]}];}return db[_0x4583('0x2d')][_0x4583('0x44')](_0x6aa869);})[_0x4583('0x29')](function(_0x274f3a){_0x4b31b9[_0x4583('0x45')]=_0x274f3a;return _0x4b31b9;})['then'](respondWithFilteredResult(_0x93bff5,_0x6aa869))[_0x4583('0x46')](handleError(_0x93bff5,null));};exports[_0x4583('0x47')]=function(_0x548cb2,_0x1194ed){var _0x223c08={'raw':!![],'where':{'id':_0x548cb2[_0x4583('0x48')]['id']}},_0x3dce6c={};_0x3dce6c[_0x4583('0x30')]=_['keys'](db['FaxApplication'][_0x4583('0x49')]);_0x3dce6c[_0x4583('0x31')]=_[_0x4583('0x32')](_0x548cb2['query']);_0x3dce6c['filters']=_['intersection'](_0x3dce6c[_0x4583('0x30')],_0x3dce6c[_0x4583('0x31')]);_0x223c08[_0x4583('0x35')]=_[_0x4583('0x34')](_0x3dce6c[_0x4583('0x30')],qs['fields'](_0x548cb2[_0x4583('0x31')][_0x4583('0x36')]));_0x223c08[_0x4583('0x35')]=_0x223c08[_0x4583('0x35')]['length']?_0x223c08[_0x4583('0x35')]:_0x3dce6c[_0x4583('0x30')];if(_0x548cb2[_0x4583('0x31')][_0x4583('0x43')]){_0x223c08[_0x4583('0x4a')]=[{'all':!![]}];}_0x223c08=_[_0x4583('0x3f')]({},_0x223c08,_0x548cb2[_0x4583('0x42')]);return db[_0x4583('0x2d')][_0x4583('0x4b')](_0x223c08)['then'](handleEntityNotFound(_0x1194ed,null))[_0x4583('0x29')](respondWithResult(_0x1194ed,null))[_0x4583('0x46')](handleError(_0x1194ed,null));};exports[_0x4583('0x4c')]=function(_0x1b7b8f,_0x25823c){return db['FaxApplication'][_0x4583('0x4c')](_0x1b7b8f['body'],{})[_0x4583('0x29')](respondWithResult(_0x25823c,0xc9))[_0x4583('0x46')](handleError(_0x25823c,null));};exports[_0x4583('0x28')]=function(_0x2abe5b,_0x5c6b17){if(_0x2abe5b[_0x4583('0x4d')]['id']){delete _0x2abe5b[_0x4583('0x4d')]['id'];}return db[_0x4583('0x2d')][_0x4583('0x4b')]({'where':{'id':_0x2abe5b[_0x4583('0x48')]['id']}})[_0x4583('0x29')](handleEntityNotFound(_0x5c6b17,null))['then'](saveUpdates(_0x2abe5b['body'],null))['then'](respondWithResult(_0x5c6b17,null))[_0x4583('0x46')](handleError(_0x5c6b17,null));};exports[_0x4583('0x2a')]=function(_0x188ee3,_0x1d4230){return db[_0x4583('0x2d')][_0x4583('0x4b')]({'where':{'id':_0x188ee3[_0x4583('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d4230,null))[_0x4583('0x29')](removeEntity(_0x1d4230,null))[_0x4583('0x46')](handleError(_0x1d4230,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index e864c74..6bae6f2 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 _0x8da6=['./faxApplication.attributes','define','FaxApplication','utf8mb4','util','../../config/logger','path','../../config/environment'];(function(_0x3f2a44,_0xf70f4b){var _0x50d3cb=function(_0x4f896d){while(--_0x4f896d){_0x3f2a44['push'](_0x3f2a44['shift']());}};_0x50d3cb(++_0xf70f4b);}(_0x8da6,0x11c));var _0x68da=function(_0x489f6a,_0x5eee18){_0x489f6a=_0x489f6a-0x0;var _0x441128=_0x8da6[_0x489f6a];return _0x441128;};'use strict';var _=require('lodash');var util=require(_0x68da('0x0'));var logger=require(_0x68da('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x68da('0x2'));var rimraf=require('rimraf');var config=require(_0x68da('0x3'));var attributes=require(_0x68da('0x4'));module['exports']=function(_0x5959b8,_0x3ebc5f){return _0x5959b8[_0x68da('0x5')](_0x68da('0x6'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x68da('0x7'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb405=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xb405,0x144));var _0x5b40=function(_0x3b4de2,_0x403ad7){_0x3b4de2=_0x3b4de2-0x0;var _0x2872be=_0xb405[_0x3b4de2];return _0x2872be;};'use strict';var _=require('lodash');var util=require(_0x5b40('0x0'));var logger=require(_0x5b40('0x1'))('api');var moment=require(_0x5b40('0x2'));var BPromise=require('bluebird');var rp=require(_0x5b40('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b40('0x4'));var config=require(_0x5b40('0x5'));var attributes=require(_0x5b40('0x6'));module[_0x5b40('0x7')]=function(_0x1dcc1d,_0x439692){return _0x1dcc1d['define'](_0x5b40('0x8'),attributes,{'tableName':_0x5b40('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5b40('0xa'),'collate':_0x5b40('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 588b68d..7a8229e 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 _0x0dd6=['../../config/environment','client','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0x0dd6,0xca));var _0x60dd=function(_0x1aa62f,_0x567e8a){_0x1aa62f=_0x1aa62f-0x0;var _0x202da1=_0x0dd6[_0x1aa62f];return _0x202da1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x60dd('0x0'));var BPromise=require(_0x60dd('0x1'));var rs=require(_0x60dd('0x2'));var fs=require('fs');var Redis=require(_0x60dd('0x3'));var db=require(_0x60dd('0x4'))['db'];var utils=require(_0x60dd('0x5'));var logger=require(_0x60dd('0x6'))(_0x60dd('0x7'));var config=require(_0x60dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x60dd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x87ab7,_0x53048b,_0x30543f){return new BPromise(function(_0x407a6c,_0x371079){return client[_0x60dd('0xa')](_0x87ab7,_0x30543f)[_0x60dd('0xb')](function(_0x39915e){logger[_0x60dd('0xc')](_0x60dd('0xd'),_0x53048b,'request\x20sent');logger[_0x60dd('0xe')](_0x60dd('0xf'),_0x53048b,_0x60dd('0x10'),JSON[_0x60dd('0x11')](_0x39915e));if(_0x39915e[_0x60dd('0x12')]){if(_0x39915e[_0x60dd('0x12')]['code']===0x1f4){logger[_0x60dd('0x12')](_0x60dd('0xd'),_0x53048b,_0x39915e['error'][_0x60dd('0x13')]);return _0x371079(_0x39915e[_0x60dd('0x12')]['message']);}logger[_0x60dd('0x12')](_0x60dd('0xd'),_0x53048b,_0x39915e['error'][_0x60dd('0x13')]);return _0x407a6c(_0x39915e[_0x60dd('0x12')][_0x60dd('0x13')]);}else{logger[_0x60dd('0xc')](_0x60dd('0xd'),_0x53048b,'request\x20sent');_0x407a6c(_0x39915e[_0x60dd('0x14')][_0x60dd('0x13')]);}})[_0x60dd('0x15')](function(_0x40f487){logger['error']('FaxApplication,\x20%s,\x20%s',_0x53048b,_0x40f487);_0x371079(_0x40f487);});});}exports[_0x60dd('0x16')]=function(_0x291845){var _0x22be59=this;return new Promise(function(_0x53db8e,_0x1a7b67){return db[_0x60dd('0x17')]['update'](_0x291845[_0x60dd('0x18')],{'raw':_0x291845[_0x60dd('0x19')]?_0x291845[_0x60dd('0x19')][_0x60dd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291845[_0x60dd('0x19')]?_0x291845[_0x60dd('0x19')][_0x60dd('0x1b')]||null:null,'attributes':_0x291845[_0x60dd('0x19')]?_0x291845[_0x60dd('0x19')][_0x60dd('0x1c')]||null:null,'limit':_0x291845['options']?_0x291845[_0x60dd('0x19')][_0x60dd('0x1d')]||null:null})[_0x60dd('0xb')](function(_0x451bf2){logger[_0x60dd('0xc')]('UpdateFaxApplication',_0x291845);logger[_0x60dd('0xe')](_0x60dd('0x16'),_0x291845,JSON[_0x60dd('0x11')](_0x451bf2));_0x53db8e(_0x451bf2);})[_0x60dd('0x15')](function(_0xd0dc0d){logger[_0x60dd('0x12')](_0x60dd('0x16'),_0xd0dc0d['message'],_0x291845);_0x1a7b67(_0x22be59[_0x60dd('0x12')](0x1f4,_0xd0dc0d[_0x60dd('0x13')]));});});}; \ No newline at end of file +var _0x7ad9=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','then','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5b2398,_0x5b823d){var _0x1ec61c=function(_0x305d9c){while(--_0x305d9c){_0x5b2398['push'](_0x5b2398['shift']());}};_0x1ec61c(++_0x5b823d);}(_0x7ad9,0x16f));var _0x97ad=function(_0x4d9a55,_0x15d214){_0x4d9a55=_0x4d9a55-0x0;var _0x49a33c=_0x7ad9[_0x4d9a55];return _0x49a33c;};'use strict';var _=require(_0x97ad('0x0'));var util=require(_0x97ad('0x1'));var moment=require('moment');var BPromise=require(_0x97ad('0x2'));var rs=require(_0x97ad('0x3'));var fs=require('fs');var Redis=require(_0x97ad('0x4'));var db=require(_0x97ad('0x5'))['db'];var utils=require(_0x97ad('0x6'));var logger=require('../../config/logger')(_0x97ad('0x7'));var config=require(_0x97ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x97ad('0x9')][_0x97ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6c31a9,_0xe8f96b,_0x4789bf){return new BPromise(function(_0x31b7b6,_0x129c21){return client[_0x97ad('0xb')](_0x6c31a9,_0x4789bf)['then'](function(_0x48c36b){logger[_0x97ad('0xc')](_0x97ad('0xd'),_0xe8f96b,_0x97ad('0xe'));logger[_0x97ad('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0xe8f96b,_0x97ad('0xe'),JSON[_0x97ad('0x10')](_0x48c36b));if(_0x48c36b[_0x97ad('0x11')]){if(_0x48c36b[_0x97ad('0x11')][_0x97ad('0x12')]===0x1f4){logger[_0x97ad('0x11')](_0x97ad('0xd'),_0xe8f96b,_0x48c36b[_0x97ad('0x11')]['message']);return _0x129c21(_0x48c36b[_0x97ad('0x11')][_0x97ad('0x13')]);}logger[_0x97ad('0x11')](_0x97ad('0xd'),_0xe8f96b,_0x48c36b[_0x97ad('0x11')][_0x97ad('0x13')]);return _0x31b7b6(_0x48c36b[_0x97ad('0x11')][_0x97ad('0x13')]);}else{logger[_0x97ad('0xc')](_0x97ad('0xd'),_0xe8f96b,_0x97ad('0xe'));_0x31b7b6(_0x48c36b[_0x97ad('0x14')][_0x97ad('0x13')]);}})[_0x97ad('0x15')](function(_0x5e3b36){logger[_0x97ad('0x11')](_0x97ad('0xd'),_0xe8f96b,_0x5e3b36);_0x129c21(_0x5e3b36);});});}exports[_0x97ad('0x16')]=function(_0x3df4d5){var _0x1e9bea=this;return new Promise(function(_0x1ba197,_0x9230ca){return db[_0x97ad('0x17')][_0x97ad('0x18')](_0x3df4d5[_0x97ad('0x19')],{'raw':_0x3df4d5['options']?_0x3df4d5[_0x97ad('0x1a')][_0x97ad('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df4d5[_0x97ad('0x1a')]?_0x3df4d5[_0x97ad('0x1a')]['where']||null:null,'attributes':_0x3df4d5[_0x97ad('0x1a')]?_0x3df4d5[_0x97ad('0x1a')][_0x97ad('0x1c')]||null:null,'limit':_0x3df4d5['options']?_0x3df4d5[_0x97ad('0x1a')][_0x97ad('0x1d')]||null:null})[_0x97ad('0x1e')](function(_0x36cd39){logger[_0x97ad('0xc')]('UpdateFaxApplication',_0x3df4d5);logger[_0x97ad('0xf')](_0x97ad('0x16'),_0x3df4d5,JSON[_0x97ad('0x10')](_0x36cd39));_0x1ba197(_0x36cd39);})[_0x97ad('0x15')](function(_0x260ddb){logger[_0x97ad('0x11')]('UpdateFaxApplication',_0x260ddb[_0x97ad('0x13')],_0x3df4d5);_0x9230ca(_0x1e9bea['error'](0x1f4,_0x260ddb[_0x97ad('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index b5bdac4..c63af03 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(_0x2d0d9f,_0x22c0d8){var _0x30243d=function(_0x29a92b){while(--_0x29a92b){_0x2d0d9f['push'](_0x2d0d9f['shift']());}};_0x30243d(++_0x22c0d8);}(_0x4fc2,0x111));var _0x24fc=function(_0x480b14,_0x397259){_0x480b14=_0x480b14-0x0;var _0x271f62=_0x4fc2[_0x480b14];return _0x271f62;};'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 _0xa571=['index','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x54b2c8,_0x1ef03c){var _0x500b47=function(_0x4f2019){while(--_0x4f2019){_0x54b2c8['push'](_0x54b2c8['shift']());}};_0x500b47(++_0x1ef03c);}(_0xa571,0x107));var _0x1a57=function(_0x565f8e,_0x4767dc){_0x565f8e=_0x565f8e-0x0;var _0x35dea5=_0xa571[_0x565f8e];return _0x35dea5;};'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('./faxApplication.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0xb')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0xc')]);router['put'](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);module[_0x1a57('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c25f120..8c61f4a 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 _0xdb5c=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x29d0b1,_0x333bc1){var _0x1392a6=function(_0xc18af3){while(--_0xc18af3){_0x29d0b1['push'](_0x29d0b1['shift']());}};_0x1392a6(++_0x333bc1);}(_0xdb5c,0xf9));var _0xcdb5=function(_0x353f75,_0x5e1a78){_0x353f75=_0x353f75-0x0;var _0x1087de=_0xdb5c[_0x353f75];return _0x1087de;};'use strict';var Sequelize=require(_0xcdb5('0x0'));module[_0xcdb5('0x1')]={'closed':{'type':Sequelize[_0xcdb5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcdb5('0x3')]},'disposition':{'type':Sequelize[_0xcdb5('0x4')]},'secondDisposition':{'type':Sequelize[_0xcdb5('0x4')]},'thirdDisposition':{'type':Sequelize[_0xcdb5('0x4')]},'note':{'type':Sequelize[_0xcdb5('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xcdb5('0x5')]('in',_0xcdb5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcdb5('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xcdb5('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xa17e=['DATE','STRING','ENUM','out','sequelize'];(function(_0x2b588d,_0x347b8c){var _0x1e59fd=function(_0x5c557f){while(--_0x5c557f){_0x2b588d['push'](_0x2b588d['shift']());}};_0x1e59fd(++_0x347b8c);}(_0xa17e,0x117));var _0xea17=function(_0x30a4a9,_0x196c42){_0x30a4a9=_0x30a4a9-0x0;var _0x5bf93d=_0xa17e[_0x30a4a9];return _0x5bf93d;};'use strict';var Sequelize=require(_0xea17('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xea17('0x1')]},'disposition':{'type':Sequelize[_0xea17('0x2')]},'secondDisposition':{'type':Sequelize[_0xea17('0x2')]},'thirdDisposition':{'type':Sequelize[_0xea17('0x2')]},'note':{'type':Sequelize[_0xea17('0x2')]},'read1stAt':{'type':Sequelize[_0xea17('0x1')]},'fax':{'type':Sequelize[_0xea17('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xea17('0x3')]('in',_0xea17('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xea17('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xea17('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 1ba90c9..b119600 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 _0x9c50=['user','catch','show','params','keys','filters','intersection','attributes','fields','length','model','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','FaxMessage','ids','getMessages','findOne','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','rows','addTags','setTags','omit','name','emit','faxInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','push','Attachment','Messages','createdAt','get','basename','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query'];(function(_0x221ca3,_0xb25dd3){var _0x5974e4=function(_0x4c1607){while(--_0x4c1607){_0x221ca3['push'](_0x221ca3['shift']());}};_0x5974e4(++_0xb25dd3);}(_0x9c50,0x116));var _0x09c5=function(_0x33268a,_0x4bac65){_0x33268a=_0x33268a-0x0;var _0x37bbde=_0x9c50[_0x33268a];return _0x37bbde;};'use strict';var rimraf=require(_0x09c5('0x0'));var zipdir=require(_0x09c5('0x1'));var moment=require(_0x09c5('0x2'));var BPromise=require(_0x09c5('0x3'));var util=require(_0x09c5('0x4'));var path=require(_0x09c5('0x5'));var fs=require('fs');var _=require(_0x09c5('0x6'));var Redis=require('ioredis');var interaction=require(_0x09c5('0x7'));var qs=require(_0x09c5('0x8'));var logger=require(_0x09c5('0x9'))(_0x09c5('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x09c5('0xb')]=_[_0x09c5('0xc')](config['redis'],{'host':_0x09c5('0xd'),'port':0x18eb});var socket=require(_0x09c5('0xe'))(new Redis(config[_0x09c5('0xb')]));require(_0x09c5('0xf'))[_0x09c5('0x10')](socket);function respondWithStatusCode(_0x532ee6,_0x3ab6e3){_0x3ab6e3=_0x3ab6e3||0xcc;return function(_0xe81f77){if(_0xe81f77){return _0x532ee6[_0x09c5('0x11')](_0x3ab6e3);}return _0x532ee6[_0x09c5('0x12')](_0x3ab6e3)[_0x09c5('0x13')]();};}function respondWithResult(_0x30893e,_0x39b225){_0x39b225=_0x39b225||0xc8;return function(_0x32ee5d){if(_0x32ee5d){return _0x30893e[_0x09c5('0x12')](_0x39b225)[_0x09c5('0x14')](_0x32ee5d);}};}function respondWithFilteredResult(_0x109544,_0x5c2c47){return function(_0x500c97){if(_0x500c97){var _0x543d0b=typeof _0x5c2c47[_0x09c5('0x15')]===_0x09c5('0x16')&&typeof _0x5c2c47[_0x09c5('0x17')]===_0x09c5('0x16');var _0x35218f=_0x500c97['count'];var _0x1dfacb=_0x543d0b?0x0:_0x5c2c47[_0x09c5('0x15')];var _0x13f746=_0x543d0b?_0x500c97[_0x09c5('0x18')]:_0x5c2c47[_0x09c5('0x15')]+_0x5c2c47['limit'];var _0x3ef38b;if(_0x13f746>=_0x35218f){_0x13f746=_0x35218f;_0x3ef38b=0xc8;}else{_0x3ef38b=0xce;}_0x109544['status'](_0x3ef38b);return _0x109544[_0x09c5('0x19')](_0x09c5('0x1a'),_0x1dfacb+'-'+_0x13f746+'/'+_0x35218f)[_0x09c5('0x14')](_0x500c97);}return null;};}function saveUpdates(_0x27d785){return function(_0x187a2c){if(_0x187a2c){return _0x187a2c[_0x09c5('0x1b')](_0x27d785)['then'](function(_0x1003e6){return _0x1003e6;});}return null;};}function removeEntity(_0x11f0d0){return function(_0x48bee4){if(_0x48bee4){return _0x48bee4['destroy']()[_0x09c5('0x1c')](function(){_0x11f0d0[_0x09c5('0x12')](0xcc)[_0x09c5('0x13')]();});}};}function handleEntityNotFound(_0x324695){return function(_0x41f549){if(!_0x41f549){_0x324695['sendStatus'](0x194);}return _0x41f549;};}function handleError(_0x371405,_0x119fdc){_0x119fdc=_0x119fdc||0x1f4;return function(_0x284970){logger[_0x09c5('0x1d')](_0x284970[_0x09c5('0x1e')]);if(_0x284970['name']){delete _0x284970['name'];}_0x371405[_0x09c5('0x12')](_0x119fdc)[_0x09c5('0x1f')](_0x284970);};}exports[_0x09c5('0x20')]=function(_0x1107fd,_0x4aa8e1){var _0x1ac7c7={};var _0xa62bab=_[_0x09c5('0x21')](db[_0x09c5('0x22')][_0x09c5('0x23')],function(_0x372944){return{'name':_0x372944[_0x09c5('0x24')],'type':_0x372944[_0x09c5('0x25')][_0x09c5('0x26')]};});_0x1ac7c7=qs[_0x09c5('0x27')](_0xa62bab,_0x1107fd);return interaction[_0x09c5('0x28')](_0x09c5('0x29'),_0x1107fd[_0x09c5('0x2a')],_0x1107fd[_0x09c5('0x2b')],_0x1ac7c7,_0xa62bab)[_0x09c5('0x1c')](respondWithFilteredResult(_0x4aa8e1,_0x1ac7c7))[_0x09c5('0x2c')](handleError(_0x4aa8e1,null));};exports[_0x09c5('0x2d')]=function(_0x263680,_0x80b11e){var _0xa64879={'raw':![],'where':{'id':_0x263680[_0x09c5('0x2e')]['id']}},_0x5e9a4d={};_0x5e9a4d['model']=_[_0x09c5('0x2f')](db['FaxInteraction'][_0x09c5('0x23')]);_0x5e9a4d[_0x09c5('0x2a')]=_[_0x09c5('0x2f')](_0x263680[_0x09c5('0x2a')]);_0x5e9a4d[_0x09c5('0x30')]=_[_0x09c5('0x31')](_0x5e9a4d['model'],_0x5e9a4d[_0x09c5('0x2a')]);_0xa64879[_0x09c5('0x32')]=_['intersection'](_0x5e9a4d['model'],qs[_0x09c5('0x33')](_0x263680[_0x09c5('0x2a')][_0x09c5('0x33')]));_0xa64879[_0x09c5('0x32')]=_0xa64879[_0x09c5('0x32')][_0x09c5('0x34')]?_0xa64879[_0x09c5('0x32')]:_0x5e9a4d[_0x09c5('0x35')];if(_0x263680[_0x09c5('0x2a')][_0x09c5('0x36')]){_0xa64879[_0x09c5('0x37')]=[{'all':!![]}];}_0xa64879=_[_0x09c5('0x38')]({},_0xa64879,_0x263680[_0x09c5('0x39')]);return db[_0x09c5('0x22')][_0x09c5('0x3a')](_0xa64879)['then'](handleEntityNotFound(_0x80b11e,null))[_0x09c5('0x1c')](respondWithResult(_0x80b11e,null))['catch'](handleError(_0x80b11e,null));};exports['create']=function(_0x17ca3b,_0x438b31){return db[_0x09c5('0x22')][_0x09c5('0x3b')](_0x17ca3b[_0x09c5('0x3c')],{})[_0x09c5('0x1c')](respondWithResult(_0x438b31,0xc9))[_0x09c5('0x2c')](handleError(_0x438b31,null));};exports[_0x09c5('0x1b')]=function(_0x534389,_0x1c1307){if(_0x534389['body']['id']){delete _0x534389['body']['id'];}return db[_0x09c5('0x22')][_0x09c5('0x3a')]({'where':{'id':_0x534389[_0x09c5('0x2e')]['id']}})[_0x09c5('0x1c')](handleEntityNotFound(_0x1c1307,null))[_0x09c5('0x1c')](saveUpdates(_0x534389[_0x09c5('0x3c')],null))[_0x09c5('0x1c')](respondWithResult(_0x1c1307,null))['catch'](handleError(_0x1c1307,null));};exports[_0x09c5('0x3d')]=function(_0x404b98,_0x551b40){return db[_0x09c5('0x22')][_0x09c5('0x3a')]({'where':{'id':_0x404b98[_0x09c5('0x2e')]['id']}})[_0x09c5('0x1c')](handleEntityNotFound(_0x551b40,null))['then'](removeEntity(_0x551b40,null))[_0x09c5('0x2c')](handleError(_0x551b40,null));};exports[_0x09c5('0x3e')]=function(_0x5623dd,_0x190fa4){return db['FaxInteraction'][_0x09c5('0x3e')]()[_0x09c5('0x1c')](respondWithResult(_0x190fa4,null))[_0x09c5('0x2c')](handleError(_0x190fa4,null));};exports[_0x09c5('0x3f')]=function(_0x4fbb49,_0x2d70cc){return db[_0x09c5('0x40')][_0x09c5('0x3a')]({'where':{'id':_0x4fbb49[_0x09c5('0x2e')]['id']}})[_0x09c5('0x1c')](handleEntityNotFound(_0x2d70cc,null))['then'](function(_0x5c3687){if(_0x5c3687){return _0x5c3687[_0x09c5('0x3f')](_0x4fbb49[_0x09c5('0x3c')][_0x09c5('0x41')],_['omit'](_0x4fbb49[_0x09c5('0x3c')],[_0x09c5('0x41'),'id'])||{});}})['then'](respondWithResult(_0x2d70cc,null))[_0x09c5('0x2c')](handleError(_0x2d70cc,null));};exports[_0x09c5('0x42')]=function(_0x27a885,_0x257ba7){var _0x3030b4={'raw':![],'where':{}};var _0x42c7ad={};var _0x2f7ac0={'count':0x0,'rows':[]};return db[_0x09c5('0x22')][_0x09c5('0x43')]({'where':{'id':_0x27a885[_0x09c5('0x2e')]['id']}})[_0x09c5('0x1c')](handleEntityNotFound(_0x257ba7,null))['then'](function(_0x865288){if(_0x865288){_0x42c7ad['model']=_[_0x09c5('0x2f')](db[_0x09c5('0x40')][_0x09c5('0x23')]);_0x42c7ad[_0x09c5('0x2a')]=_['keys'](_0x27a885[_0x09c5('0x2a')]);_0x42c7ad[_0x09c5('0x30')]=_[_0x09c5('0x31')](_0x42c7ad[_0x09c5('0x35')],_0x42c7ad[_0x09c5('0x2a')]);_0x3030b4['attributes']=_['intersection'](_0x42c7ad['model'],qs[_0x09c5('0x33')](_0x27a885[_0x09c5('0x2a')][_0x09c5('0x33')]));_0x3030b4[_0x09c5('0x32')]=_0x3030b4['attributes'][_0x09c5('0x34')]?_0x3030b4[_0x09c5('0x32')]:_0x42c7ad[_0x09c5('0x35')];if(!_0x27a885['query']['hasOwnProperty'](_0x09c5('0x44'))){_0x3030b4['limit']=qs[_0x09c5('0x17')](_0x27a885[_0x09c5('0x2a')][_0x09c5('0x17')]);_0x3030b4[_0x09c5('0x15')]=qs[_0x09c5('0x15')](_0x27a885[_0x09c5('0x2a')][_0x09c5('0x15')]);}_0x3030b4[_0x09c5('0x45')]=qs[_0x09c5('0x46')](_0x27a885[_0x09c5('0x2a')][_0x09c5('0x46')]);_0x3030b4[_0x09c5('0x47')]=qs[_0x09c5('0x30')](_[_0x09c5('0x48')](_0x27a885[_0x09c5('0x2a')],_0x42c7ad[_0x09c5('0x30')]));_0x3030b4['where'][_0x09c5('0x49')]=_0x865288['id'];if(_0x27a885[_0x09c5('0x2a')][_0x09c5('0x4a')]){_0x3030b4[_0x09c5('0x47')]=_[_0x09c5('0x38')](_0x3030b4['where'],{'$or':_[_0x09c5('0x21')](_0x3030b4['attributes'],function(_0x2e92a6){var _0x888105={};_0x888105[_0x2e92a6]={'$like':'%'+_0x27a885[_0x09c5('0x2a')][_0x09c5('0x4a')]+'%'};return _0x888105;})});}if(_0x27a885[_0x09c5('0x2a')][_0x09c5('0x4b')]){var _0x11ef70=_0x27a885[_0x09c5('0x2a')][_0x09c5('0x4b')][_0x09c5('0x4c')](',');var _0x5f4f7f={};_0x5f4f7f[_0x11ef70[0x0]]={'$gte':moment(_0x11ef70[0x1])[_0x09c5('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3030b4[_0x09c5('0x47')]=_[_0x09c5('0x38')](_0x3030b4[_0x09c5('0x47')],_0x5f4f7f);}_0x3030b4=_['merge']({},_0x3030b4,_0x27a885[_0x09c5('0x39')]);return db[_0x09c5('0x40')][_0x09c5('0x18')]({'where':_0x3030b4[_0x09c5('0x47')]})['then'](function(_0x5b746c){_0x2f7ac0[_0x09c5('0x18')]=_0x5b746c;if(_0x27a885[_0x09c5('0x2a')][_0x09c5('0x36')]){_0x3030b4['include']=[{'all':!![]}];}return db['FaxMessage'][_0x09c5('0x28')](_0x3030b4);})[_0x09c5('0x1c')](function(_0x4cc005){_0x2f7ac0[_0x09c5('0x4e')]=_0x4cc005;return _0x2f7ac0;});}})[_0x09c5('0x1c')](respondWithFilteredResult(_0x257ba7,_0x3030b4))[_0x09c5('0x2c')](handleError(_0x257ba7,null));};exports[_0x09c5('0x4f')]=function(_0x818149,_0x32cfdd){return db[_0x09c5('0x22')][_0x09c5('0x3a')]({'where':{'id':_0x818149['params']['id']}})['then'](handleEntityNotFound(_0x32cfdd,null))['then'](function(_0x212f38){if(_0x212f38){return _0x212f38[_0x09c5('0x50')](_0x818149[_0x09c5('0x3c')][_0x09c5('0x41')],_[_0x09c5('0x51')](_0x818149[_0x09c5('0x3c')],[_0x09c5('0x41'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x09c5('0x52'),'color'],'where':{'id':_0x818149[_0x09c5('0x3c')]['ids']}});})[_0x09c5('0x1c')](function(_0x4b39a8){socket[_0x09c5('0x53')](_0x09c5('0x54'),{'id':Number(_0x818149['params']['id']),'tags':_0x4b39a8||[]});return{'id':Number(_0x818149[_0x09c5('0x2e')]['id']),'tags':_0x4b39a8||[]};});}})[_0x09c5('0x1c')](respondWithResult(_0x32cfdd,null))[_0x09c5('0x2c')](handleError(_0x32cfdd,null));};exports['removeTags']=function(_0x4a9002,_0x444f23){return db['FaxInteraction'][_0x09c5('0x3a')]({'where':{'id':_0x4a9002['params']['id']}})[_0x09c5('0x1c')](handleEntityNotFound(_0x444f23,null))['then'](function(_0x9dfddb){if(_0x9dfddb){return _0x9dfddb[_0x09c5('0x55')](_0x4a9002[_0x09c5('0x2a')][_0x09c5('0x41')]);}})[_0x09c5('0x1c')](respondWithStatusCode(_0x444f23,null))[_0x09c5('0x2c')](handleError(_0x444f23,null));};exports[_0x09c5('0x56')]=function(_0x3cf41d,_0x15b7e1){var _0x1288d2=moment()[_0x09c5('0x57')]()[_0x09c5('0x58')]();var _0x359ae7=path['join'](config[_0x09c5('0x59')],_0x09c5('0x5a'),_0x09c5('0x5b'),_0x09c5('0x5c'));var _0x45a8bc=path[_0x09c5('0x5d')](config[_0x09c5('0x59')],'server','files',_0x09c5('0x5e'));var _0x331603=path[_0x09c5('0x5d')](_0x359ae7,_0x1288d2);var _0x290ce1=util[_0x09c5('0x4d')]('transcript-%d-%s.zip',_0x3cf41d[_0x09c5('0x2e')]['id'],_0x1288d2);var _0x2d0948=path[_0x09c5('0x5d')](_0x359ae7,_0x290ce1);var _0x29f9d1=[];_0x29f9d1[_0x09c5('0x5f')]({'model':db[_0x09c5('0x60')],'as':_0x09c5('0x60'),'raw':!![]});var _0x3a0616=[{'model':db[_0x09c5('0x40')],'as':_0x09c5('0x61'),'attributes':['id',_0x09c5('0x3c'),_0x09c5('0x62')],'include':_0x29f9d1}];return db[_0x09c5('0x22')][_0x09c5('0x3a')]({'where':{'id':_0x3cf41d['params']['id']},'include':_0x3a0616})[_0x09c5('0x1c')](handleEntityNotFound(_0x15b7e1,null))[_0x09c5('0x1c')](function(_0x1377d2){if(_0x1377d2&&_0x1377d2[_0x09c5('0x61')]){var _0x1f9f2a=_0x1377d2[_0x09c5('0x63')]({'plain':!![]});fs['mkdirSync'](_0x331603);for(var _0x1feba8=0x0;_0x1feba8<_0x1f9f2a[_0x09c5('0x61')][_0x09c5('0x34')];_0x1feba8++){var _0x1dde8c=_0x1f9f2a[_0x09c5('0x61')][_0x1feba8][_0x09c5('0x60')];if(_0x1dde8c){var _0x574720=path[_0x09c5('0x5d')](_0x45a8bc,_0x1dde8c[_0x09c5('0x64')]);if(fs['existsSync'](_0x574720)){fs[_0x09c5('0x65')](_0x574720)[_0x09c5('0x66')](fs[_0x09c5('0x67')](path[_0x09c5('0x5d')](_0x331603,_0x1dde8c[_0x09c5('0x64')])));}}}return BPromise[_0x09c5('0x68')]()[_0x09c5('0x1c')](function(){return new BPromise(function(_0x2add7f,_0xb4652){zipdir(_0x331603,{'saveTo':_0x2d0948},function(_0x59e065,_0x31b1af){if(_0x59e065)return _0xb4652(_0x59e065);return _0x2add7f(_0x31b1af);});})['then'](function(){return new BPromise(function(_0x47d879,_0x545098){rimraf(_0x331603,function(_0x107ec4){if(_0x107ec4)_0x545098(_0x107ec4);return _0x47d879();});});})[_0x09c5('0x1c')](function(){return _0x15b7e1[_0x09c5('0x56')](_0x2d0948,_0x290ce1,function(_0x1b6250){if(_0x1b6250){console[_0x09c5('0x69')]('err',_0x1b6250);}else{fs[_0x09c5('0x6a')](_0x2d0948);}});});});}else{return _0x15b7e1['sendStatus'](0xc8);}})[_0x09c5('0x2c')](handleError(_0x15b7e1,null));}; \ No newline at end of file +var _0x5d71=['options','find','catch','create','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','where','pick','FaxInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','join','root','files','tmp','server','attachments','push','Attachment','Messages','createdAt','basename','existsSync','pipe','createWriteStream','download','log','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../config/logger','api','redis','defaults','./faxInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','name','send','index','map','FaxInteraction','rawAttributes','type','key','getOptions','findAll','query','user','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','merge'];(function(_0x5721d2,_0x31671c){var _0x22c839=function(_0x21117b){while(--_0x21117b){_0x5721d2['push'](_0x5721d2['shift']());}};_0x22c839(++_0x31671c);}(_0x5d71,0x152));var _0x15d7=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5d71[_0x3947c9];return _0x2e7871;};'use strict';var rimraf=require(_0x15d7('0x0'));var zipdir=require(_0x15d7('0x1'));var moment=require(_0x15d7('0x2'));var BPromise=require('bluebird');var util=require(_0x15d7('0x3'));var path=require(_0x15d7('0x4'));var fs=require('fs');var _=require(_0x15d7('0x5'));var Redis=require('ioredis');var interaction=require(_0x15d7('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x15d7('0x7'))(_0x15d7('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x15d7('0x9')]=_[_0x15d7('0xa')](config[_0x15d7('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x15d7('0xb'))[_0x15d7('0xc')](socket);function respondWithStatusCode(_0x4a6a3,_0x40d928){_0x40d928=_0x40d928||0xcc;return function(_0x536f9d){if(_0x536f9d){return _0x4a6a3[_0x15d7('0xd')](_0x40d928);}return _0x4a6a3['status'](_0x40d928)[_0x15d7('0xe')]();};}function respondWithResult(_0x5840e6,_0xafc107){_0xafc107=_0xafc107||0xc8;return function(_0x532ca8){if(_0x532ca8){return _0x5840e6[_0x15d7('0xf')](_0xafc107)[_0x15d7('0x10')](_0x532ca8);}};}function respondWithFilteredResult(_0x290fa5,_0x206d83){return function(_0x373ced){if(_0x373ced){var _0x32395f=typeof _0x206d83['offset']===_0x15d7('0x11')&&typeof _0x206d83[_0x15d7('0x12')]===_0x15d7('0x11');var _0x759cce=_0x373ced[_0x15d7('0x13')];var _0x4a78a7=_0x32395f?0x0:_0x206d83[_0x15d7('0x14')];var _0x1b82c0=_0x32395f?_0x373ced['count']:_0x206d83['offset']+_0x206d83[_0x15d7('0x12')];var _0x141829;if(_0x1b82c0>=_0x759cce){_0x1b82c0=_0x759cce;_0x141829=0xc8;}else{_0x141829=0xce;}_0x290fa5[_0x15d7('0xf')](_0x141829);return _0x290fa5[_0x15d7('0x15')](_0x15d7('0x16'),_0x4a78a7+'-'+_0x1b82c0+'/'+_0x759cce)[_0x15d7('0x10')](_0x373ced);}return null;};}function saveUpdates(_0x36109d){return function(_0x5d9493){if(_0x5d9493){return _0x5d9493[_0x15d7('0x17')](_0x36109d)[_0x15d7('0x18')](function(_0x2acd05){return _0x2acd05;});}return null;};}function removeEntity(_0x5bebd4){return function(_0x2045f1){if(_0x2045f1){return _0x2045f1[_0x15d7('0x19')]()[_0x15d7('0x18')](function(){_0x5bebd4[_0x15d7('0xf')](0xcc)[_0x15d7('0xe')]();});}};}function handleEntityNotFound(_0x2db8a4){return function(_0x109db6){if(!_0x109db6){_0x2db8a4[_0x15d7('0xd')](0x194);}return _0x109db6;};}function handleError(_0x427ac5,_0x1d5884){_0x1d5884=_0x1d5884||0x1f4;return function(_0x18fb88){logger[_0x15d7('0x1a')](_0x18fb88['stack']);if(_0x18fb88[_0x15d7('0x1b')]){delete _0x18fb88['name'];}_0x427ac5[_0x15d7('0xf')](_0x1d5884)[_0x15d7('0x1c')](_0x18fb88);};}exports[_0x15d7('0x1d')]=function(_0x2c4a0c,_0x317bf5){var _0x24ccb3={};var _0x4fcb52=_[_0x15d7('0x1e')](db[_0x15d7('0x1f')][_0x15d7('0x20')],function(_0x3e6fe5){return{'name':_0x3e6fe5['fieldName'],'type':_0x3e6fe5[_0x15d7('0x21')][_0x15d7('0x22')]};});_0x24ccb3=qs[_0x15d7('0x23')](_0x4fcb52,_0x2c4a0c);return interaction[_0x15d7('0x24')]('fax',_0x2c4a0c[_0x15d7('0x25')],_0x2c4a0c[_0x15d7('0x26')],_0x24ccb3,_0x4fcb52)[_0x15d7('0x18')](respondWithFilteredResult(_0x317bf5,_0x24ccb3))['catch'](handleError(_0x317bf5,null));};exports[_0x15d7('0x27')]=function(_0x2d8f78,_0x52997f){var _0x2ca8a3={'raw':![],'where':{'id':_0x2d8f78[_0x15d7('0x28')]['id']}},_0x5ec0b4={};_0x5ec0b4[_0x15d7('0x29')]=_[_0x15d7('0x2a')](db[_0x15d7('0x1f')][_0x15d7('0x20')]);_0x5ec0b4[_0x15d7('0x25')]=_[_0x15d7('0x2a')](_0x2d8f78[_0x15d7('0x25')]);_0x5ec0b4[_0x15d7('0x2b')]=_['intersection'](_0x5ec0b4[_0x15d7('0x29')],_0x5ec0b4[_0x15d7('0x25')]);_0x2ca8a3[_0x15d7('0x2c')]=_[_0x15d7('0x2d')](_0x5ec0b4['model'],qs['fields'](_0x2d8f78[_0x15d7('0x25')][_0x15d7('0x2e')]));_0x2ca8a3['attributes']=_0x2ca8a3[_0x15d7('0x2c')][_0x15d7('0x2f')]?_0x2ca8a3['attributes']:_0x5ec0b4[_0x15d7('0x29')];if(_0x2d8f78['query'][_0x15d7('0x30')]){_0x2ca8a3['include']=[{'all':!![]}];}_0x2ca8a3=_[_0x15d7('0x31')]({},_0x2ca8a3,_0x2d8f78[_0x15d7('0x32')]);return db['FaxInteraction'][_0x15d7('0x33')](_0x2ca8a3)[_0x15d7('0x18')](handleEntityNotFound(_0x52997f,null))[_0x15d7('0x18')](respondWithResult(_0x52997f,null))[_0x15d7('0x34')](handleError(_0x52997f,null));};exports['create']=function(_0x47faab,_0x1a4353){return db['FaxInteraction'][_0x15d7('0x35')](_0x47faab[_0x15d7('0x36')],{})['then'](respondWithResult(_0x1a4353,0xc9))[_0x15d7('0x34')](handleError(_0x1a4353,null));};exports[_0x15d7('0x17')]=function(_0xa53573,_0x3d8726){if(_0xa53573[_0x15d7('0x36')]['id']){delete _0xa53573[_0x15d7('0x36')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0xa53573[_0x15d7('0x28')]['id']}})['then'](handleEntityNotFound(_0x3d8726,null))['then'](saveUpdates(_0xa53573[_0x15d7('0x36')],null))['then'](respondWithResult(_0x3d8726,null))['catch'](handleError(_0x3d8726,null));};exports[_0x15d7('0x19')]=function(_0x4d6196,_0x440d15){return db[_0x15d7('0x1f')][_0x15d7('0x33')]({'where':{'id':_0x4d6196['params']['id']}})[_0x15d7('0x18')](handleEntityNotFound(_0x440d15,null))['then'](removeEntity(_0x440d15,null))[_0x15d7('0x34')](handleError(_0x440d15,null));};exports['describe']=function(_0x325267,_0x11a809){return db['FaxInteraction'][_0x15d7('0x37')]()[_0x15d7('0x18')](respondWithResult(_0x11a809,null))[_0x15d7('0x34')](handleError(_0x11a809,null));};exports['addMessage']=function(_0x1c4219,_0x509907){return db[_0x15d7('0x38')]['find']({'where':{'id':_0x1c4219[_0x15d7('0x28')]['id']}})[_0x15d7('0x18')](handleEntityNotFound(_0x509907,null))[_0x15d7('0x18')](function(_0x25c5a6){if(_0x25c5a6){return _0x25c5a6[_0x15d7('0x39')](_0x1c4219[_0x15d7('0x36')][_0x15d7('0x3a')],_[_0x15d7('0x3b')](_0x1c4219[_0x15d7('0x36')],['ids','id'])||{});}})[_0x15d7('0x18')](respondWithResult(_0x509907,null))[_0x15d7('0x34')](handleError(_0x509907,null));};exports[_0x15d7('0x3c')]=function(_0x198800,_0x429d7d){var _0x3672a2={'raw':![],'where':{}};var _0x2d587f={};var _0x23657c={'count':0x0,'rows':[]};return db[_0x15d7('0x1f')][_0x15d7('0x3d')]({'where':{'id':_0x198800[_0x15d7('0x28')]['id']}})['then'](handleEntityNotFound(_0x429d7d,null))[_0x15d7('0x18')](function(_0x569c9d){if(_0x569c9d){_0x2d587f[_0x15d7('0x29')]=_[_0x15d7('0x2a')](db[_0x15d7('0x38')]['rawAttributes']);_0x2d587f[_0x15d7('0x25')]=_['keys'](_0x198800[_0x15d7('0x25')]);_0x2d587f['filters']=_['intersection'](_0x2d587f[_0x15d7('0x29')],_0x2d587f[_0x15d7('0x25')]);_0x3672a2[_0x15d7('0x2c')]=_[_0x15d7('0x2d')](_0x2d587f[_0x15d7('0x29')],qs[_0x15d7('0x2e')](_0x198800[_0x15d7('0x25')][_0x15d7('0x2e')]));_0x3672a2[_0x15d7('0x2c')]=_0x3672a2[_0x15d7('0x2c')][_0x15d7('0x2f')]?_0x3672a2[_0x15d7('0x2c')]:_0x2d587f['model'];if(!_0x198800[_0x15d7('0x25')][_0x15d7('0x3e')]('nolimit')){_0x3672a2[_0x15d7('0x12')]=qs[_0x15d7('0x12')](_0x198800[_0x15d7('0x25')][_0x15d7('0x12')]);_0x3672a2['offset']=qs['offset'](_0x198800[_0x15d7('0x25')][_0x15d7('0x14')]);}_0x3672a2[_0x15d7('0x3f')]=qs['sort'](_0x198800[_0x15d7('0x25')][_0x15d7('0x40')]);_0x3672a2[_0x15d7('0x41')]=qs['filters'](_[_0x15d7('0x42')](_0x198800['query'],_0x2d587f[_0x15d7('0x2b')]));_0x3672a2['where'][_0x15d7('0x43')]=_0x569c9d['id'];if(_0x198800[_0x15d7('0x25')]['filter']){_0x3672a2[_0x15d7('0x41')]=_[_0x15d7('0x31')](_0x3672a2[_0x15d7('0x41')],{'$or':_[_0x15d7('0x1e')](_0x3672a2[_0x15d7('0x2c')],function(_0x11c9e0){var _0x5e7084={};_0x5e7084[_0x11c9e0]={'$like':'%'+_0x198800[_0x15d7('0x25')][_0x15d7('0x44')]+'%'};return _0x5e7084;})});}if(_0x198800['query'][_0x15d7('0x45')]){var _0x5744e8=_0x198800[_0x15d7('0x25')][_0x15d7('0x45')]['split'](',');var _0x5077b8={};_0x5077b8[_0x5744e8[0x0]]={'$gte':moment(_0x5744e8[0x1])[_0x15d7('0x46')](_0x15d7('0x47'))};_0x3672a2[_0x15d7('0x41')]=_[_0x15d7('0x31')](_0x3672a2[_0x15d7('0x41')],_0x5077b8);}_0x3672a2=_[_0x15d7('0x31')]({},_0x3672a2,_0x198800[_0x15d7('0x32')]);return db[_0x15d7('0x38')][_0x15d7('0x13')]({'where':_0x3672a2[_0x15d7('0x41')]})[_0x15d7('0x18')](function(_0xf02d07){_0x23657c['count']=_0xf02d07;if(_0x198800[_0x15d7('0x25')][_0x15d7('0x30')]){_0x3672a2[_0x15d7('0x48')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x3672a2);})[_0x15d7('0x18')](function(_0x51a171){_0x23657c[_0x15d7('0x49')]=_0x51a171;return _0x23657c;});}})[_0x15d7('0x18')](respondWithFilteredResult(_0x429d7d,_0x3672a2))[_0x15d7('0x34')](handleError(_0x429d7d,null));};exports['addTags']=function(_0x3119ab,_0x248785){return db['FaxInteraction'][_0x15d7('0x33')]({'where':{'id':_0x3119ab[_0x15d7('0x28')]['id']}})['then'](handleEntityNotFound(_0x248785,null))[_0x15d7('0x18')](function(_0x23f3bf){if(_0x23f3bf){return _0x23f3bf[_0x15d7('0x4a')](_0x3119ab[_0x15d7('0x36')][_0x15d7('0x3a')],_[_0x15d7('0x3b')](_0x3119ab[_0x15d7('0x36')],[_0x15d7('0x3a'),'id'])||{})[_0x15d7('0x4b')](function(){return db[_0x15d7('0x4c')]['findAll']({'attributes':['id',_0x15d7('0x1b'),'color'],'where':{'id':_0x3119ab[_0x15d7('0x36')][_0x15d7('0x3a')]}});})['then'](function(_0x4cee0c){socket[_0x15d7('0x4d')](_0x15d7('0x4e'),{'id':Number(_0x3119ab['params']['id']),'tags':_0x4cee0c||[]});return{'id':Number(_0x3119ab[_0x15d7('0x28')]['id']),'tags':_0x4cee0c||[]};});}})[_0x15d7('0x18')](respondWithResult(_0x248785,null))[_0x15d7('0x34')](handleError(_0x248785,null));};exports['removeTags']=function(_0x1abcd3,_0x2d2820){return db[_0x15d7('0x1f')]['find']({'where':{'id':_0x1abcd3[_0x15d7('0x28')]['id']}})[_0x15d7('0x18')](handleEntityNotFound(_0x2d2820,null))['then'](function(_0x4856a0){if(_0x4856a0){return _0x4856a0[_0x15d7('0x4f')](_0x1abcd3[_0x15d7('0x25')][_0x15d7('0x3a')]);}})[_0x15d7('0x18')](respondWithStatusCode(_0x2d2820,null))[_0x15d7('0x34')](handleError(_0x2d2820,null));};exports['download']=function(_0x155479,_0x45b56d){var _0x143edd=moment()['unix']()['toString']();var _0xf7a5bb=path[_0x15d7('0x50')](config[_0x15d7('0x51')],'server',_0x15d7('0x52'),_0x15d7('0x53'));var _0x4df7f1=path[_0x15d7('0x50')](config[_0x15d7('0x51')],_0x15d7('0x54'),_0x15d7('0x52'),_0x15d7('0x55'));var _0x1ae250=path[_0x15d7('0x50')](_0xf7a5bb,_0x143edd);var _0x43f3ce=util[_0x15d7('0x46')]('transcript-%d-%s.zip',_0x155479[_0x15d7('0x28')]['id'],_0x143edd);var _0x4e980f=path[_0x15d7('0x50')](_0xf7a5bb,_0x43f3ce);var _0x1060f4=[];_0x1060f4[_0x15d7('0x56')]({'model':db[_0x15d7('0x57')],'as':_0x15d7('0x57'),'raw':!![]});var _0x258135=[{'model':db[_0x15d7('0x38')],'as':_0x15d7('0x58'),'attributes':['id',_0x15d7('0x36'),_0x15d7('0x59')],'include':_0x1060f4}];return db[_0x15d7('0x1f')][_0x15d7('0x33')]({'where':{'id':_0x155479[_0x15d7('0x28')]['id']},'include':_0x258135})[_0x15d7('0x18')](handleEntityNotFound(_0x45b56d,null))[_0x15d7('0x18')](function(_0x54eadc){if(_0x54eadc&&_0x54eadc[_0x15d7('0x58')]){var _0x15a522=_0x54eadc['get']({'plain':!![]});fs['mkdirSync'](_0x1ae250);for(var _0x20b053=0x0;_0x20b053<_0x15a522['Messages'][_0x15d7('0x2f')];_0x20b053++){var _0xed2e32=_0x15a522[_0x15d7('0x58')][_0x20b053][_0x15d7('0x57')];if(_0xed2e32){var _0x17b7ee=path['join'](_0x4df7f1,_0xed2e32[_0x15d7('0x5a')]);if(fs[_0x15d7('0x5b')](_0x17b7ee)){fs['createReadStream'](_0x17b7ee)[_0x15d7('0x5c')](fs[_0x15d7('0x5d')](path[_0x15d7('0x50')](_0x1ae250,_0xed2e32[_0x15d7('0x5a')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x477185,_0x4bba76){zipdir(_0x1ae250,{'saveTo':_0x4e980f},function(_0x18946c,_0x4b178c){if(_0x18946c)return _0x4bba76(_0x18946c);return _0x477185(_0x4b178c);});})[_0x15d7('0x18')](function(){return new BPromise(function(_0x2bb2af,_0x3fe4a7){rimraf(_0x1ae250,function(_0x42b5be){if(_0x42b5be)_0x3fe4a7(_0x42b5be);return _0x2bb2af();});});})[_0x15d7('0x18')](function(){return _0x45b56d[_0x15d7('0x5e')](_0x4e980f,_0x43f3ce,function(_0x40ec31){if(_0x40ec31){console[_0x15d7('0x5f')]('err',_0x40ec31);}else{fs[_0x15d7('0x60')](_0x4e980f);}});});});}else{return _0x45b56d['sendStatus'](0xc8);}})[_0x15d7('0x34')](handleError(_0x45b56d,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 7aa5179..cc7b3a9 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 _0x52f0=['events','../../mysqldb','FaxMessage','setMaxListeners','getUsers','then','setDataValue','map','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x52f0,0xb4));var _0x052f=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x52f0[_0x2c5255];return _0x30d0ea;};'use strict';var EventEmitter=require(_0x052f('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x052f('0x1'))['db'][_0x052f('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x052f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a5183){return function(_0x167a85,_0x52e9d7,_0x2faca2){_0x167a85[_0x052f('0x4')]({'attributes':['id'],'raw':!![]})[_0x052f('0x5')](function(_0x5566e8){_0x167a85[_0x052f('0x6')]('Users',_0x5566e8[_0x052f('0x7')](function(_0x212454){return{'id':_0x212454['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x167a85['id'],'direction':'in','read':![]},'raw':!![]});})[_0x052f('0x5')](function(_0x37784a){_0x167a85[_0x052f('0x6')](_0x052f('0x8'),_0x37784a['length']);FaxInteractionEvents[_0x052f('0x9')](_0x5a5183+':'+_0x167a85['id'],_0x167a85);FaxInteractionEvents[_0x052f('0x9')](_0x5a5183,_0x167a85);_0x2faca2(null);})[_0x052f('0xa')](_0x2faca2(null));};}for(var e in events){if(events[_0x052f('0xb')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xe259=['map','findAll','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x8f037f,_0x12a77c){var _0x4b8134=function(_0x330e28){while(--_0x330e28){_0x8f037f['push'](_0x8f037f['shift']());}};_0x4b8134(++_0x12a77c);}(_0xe259,0x1a9));var _0x9e25=function(_0x5b86b9,_0x300ce5){_0x5b86b9=_0x5b86b9-0x0;var _0x206ee6=_0xe259[_0x5b86b9];return _0x206ee6;};'use strict';var EventEmitter=require(_0x9e25('0x0'));var FaxInteraction=require(_0x9e25('0x1'))['db'][_0x9e25('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x9e25('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9e25('0x4')](0x0);var events={'afterCreate':_0x9e25('0x5'),'afterUpdate':_0x9e25('0x6'),'afterDestroy':_0x9e25('0x7')};function emitEvent(_0x9caa0a){return function(_0xf3d8be,_0x246a11,_0x5f4a5f){_0xf3d8be[_0x9e25('0x8')]({'attributes':['id'],'raw':!![]})[_0x9e25('0x9')](function(_0x1af0ee){_0xf3d8be[_0x9e25('0xa')](_0x9e25('0xb'),_0x1af0ee[_0x9e25('0xc')](function(_0x1fc18c){return{'id':_0x1fc18c['id']};}));return FaxMessage[_0x9e25('0xd')]({'where':{'FaxInteractionId':_0xf3d8be['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e25('0x9')](function(_0x49ded9){_0xf3d8be[_0x9e25('0xa')]('unreadMessages',_0x49ded9['length']);FaxInteractionEvents[_0x9e25('0xe')](_0x9caa0a+':'+_0xf3d8be['id'],_0xf3d8be);FaxInteractionEvents[_0x9e25('0xe')](_0x9caa0a,_0xf3d8be);_0x5f4a5f(null);})[_0x9e25('0xf')](_0x5f4a5f(null));};}for(var e in events){if(events[_0x9e25('0x10')](e)){var event=events[e];FaxInteraction[_0x9e25('0x11')](e,emitEvent(event));}}module[_0x9e25('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 818ce48..9752861 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 _0x4991=['exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x45744f,_0x2570a5){var _0x2c090d=function(_0x139db5){while(--_0x139db5){_0x45744f['push'](_0x45744f['shift']());}};_0x2c090d(++_0x2570a5);}(_0x4991,0xf7));var _0x1499=function(_0x5de687,_0x484594){_0x5de687=_0x5de687-0x0;var _0x227d18=_0x4991[_0x5de687];return _0x227d18;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var logger=require(_0x1499('0x1'))('api');var moment=require(_0x1499('0x2'));var BPromise=require(_0x1499('0x3'));var rp=require(_0x1499('0x4'));var fs=require('fs');var path=require(_0x1499('0x5'));var rimraf=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var attributes=require(_0x1499('0x8'));module[_0x1499('0x9')]=function(_0x4b6154,_0x2a8e96){return _0x4b6154[_0x1499('0xa')](_0x1499('0xb'),attributes,{'tableName':_0x1499('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x133bae,_0x380e48,_0x3277b3){if(_0x133bae[_0x1499('0xd')]('closed')){_0x133bae[_0x1499('0xe')]=moment()[_0x1499('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3277b3(null,_0x133bae);}}});}; \ No newline at end of file +var _0xffb1=['changed','closed','closedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0xffb1,0x93));var _0x1ffb=function(_0x4cba56,_0x5b2c44){_0x4cba56=_0x4cba56-0x0;var _0x3cc9f3=_0xffb1[_0x4cba56];return _0x3cc9f3;};'use strict';var _=require(_0x1ffb('0x0'));var util=require(_0x1ffb('0x1'));var logger=require(_0x1ffb('0x2'))(_0x1ffb('0x3'));var moment=require(_0x1ffb('0x4'));var BPromise=require(_0x1ffb('0x5'));var rp=require(_0x1ffb('0x6'));var fs=require('fs');var path=require(_0x1ffb('0x7'));var rimraf=require(_0x1ffb('0x8'));var config=require(_0x1ffb('0x9'));var attributes=require('./faxInteraction.attributes');module[_0x1ffb('0xa')]=function(_0x677ad0,_0x3fc606){return _0x677ad0[_0x1ffb('0xb')](_0x1ffb('0xc'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1787b1,_0x4bcfb6,_0x5ed7f4){if(_0x1787b1[_0x1ffb('0xd')](_0x1ffb('0xe'))){_0x1787b1[_0x1ffb('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5ed7f4(null,_0x1787b1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 3f2d840..0c523b0 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 _0xe790=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxInteraction','update','body','options','raw','where','limit','stringify','UpdateFaxInteraction','AddTagsToFaxInteraction','find','ids','spread','AddTags','lodash'];(function(_0x2f9026,_0x3b954b){var _0x2dec99=function(_0x21ca70){while(--_0x21ca70){_0x2f9026['push'](_0x2f9026['shift']());}};_0x2dec99(++_0x3b954b);}(_0xe790,0x15e));var _0x0e79=function(_0x231539,_0x4a1102){_0x231539=_0x231539-0x0;var _0x302a27=_0xe790[_0x231539];return _0x302a27;};'use strict';var _=require(_0x0e79('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0e79('0x1'));var rs=require(_0x0e79('0x2'));var fs=require('fs');var Redis=require(_0x0e79('0x3'));var db=require(_0x0e79('0x4'))['db'];var utils=require(_0x0e79('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0e79('0x6'));var jayson=require(_0x0e79('0x7'));var client=jayson[_0x0e79('0x8')]['http']({'port':0x232a});config[_0x0e79('0x9')]=_[_0x0e79('0xa')](config[_0x0e79('0x9')],{'host':_0x0e79('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e79('0x9')]));require(_0x0e79('0xc'))[_0x0e79('0xd')](socket);function respondWithRpcPromise(_0x461d61,_0x363d5e,_0x28da97){return new BPromise(function(_0x4dcd24,_0xbcbce7){return client['request'](_0x461d61,_0x28da97)[_0x0e79('0xe')](function(_0x81c8d0){logger[_0x0e79('0xf')](_0x0e79('0x10'),_0x363d5e,_0x0e79('0x11'));logger[_0x0e79('0x12')](_0x0e79('0x13'),_0x363d5e,_0x0e79('0x11'),JSON['stringify'](_0x81c8d0));if(_0x81c8d0['error']){if(_0x81c8d0[_0x0e79('0x14')][_0x0e79('0x15')]===0x1f4){logger['error'](_0x0e79('0x10'),_0x363d5e,_0x81c8d0[_0x0e79('0x14')][_0x0e79('0x16')]);return _0xbcbce7(_0x81c8d0[_0x0e79('0x14')][_0x0e79('0x16')]);}logger[_0x0e79('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x363d5e,_0x81c8d0[_0x0e79('0x14')][_0x0e79('0x16')]);return _0x4dcd24(_0x81c8d0[_0x0e79('0x14')][_0x0e79('0x16')]);}else{logger[_0x0e79('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x363d5e,_0x0e79('0x11'));_0x4dcd24(_0x81c8d0[_0x0e79('0x17')]['message']);}})[_0x0e79('0x18')](function(_0x3a9dc5){logger[_0x0e79('0x14')](_0x0e79('0x10'),_0x363d5e,_0x3a9dc5);_0xbcbce7(_0x3a9dc5);});});}exports['UpdateFaxInteraction']=function(_0x4e2895){var _0x13d868=this;return new Promise(function(_0x210545,_0x25ca6b){return db[_0x0e79('0x19')][_0x0e79('0x1a')](_0x4e2895[_0x0e79('0x1b')],{'raw':_0x4e2895[_0x0e79('0x1c')]?_0x4e2895['options'][_0x0e79('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e2895[_0x0e79('0x1c')]?_0x4e2895[_0x0e79('0x1c')][_0x0e79('0x1e')]||null:null,'attributes':_0x4e2895['options']?_0x4e2895[_0x0e79('0x1c')]['attributes']||null:null,'limit':_0x4e2895[_0x0e79('0x1c')]?_0x4e2895[_0x0e79('0x1c')][_0x0e79('0x1f')]||null:null})[_0x0e79('0xe')](function(_0x4c9544){logger[_0x0e79('0xf')]('UpdateFaxInteraction',_0x4e2895);logger[_0x0e79('0x12')]('UpdateFaxInteraction',_0x4e2895,JSON[_0x0e79('0x20')](_0x4c9544));_0x210545(_0x4c9544);})[_0x0e79('0x18')](function(_0x1a8cfb){logger['error'](_0x0e79('0x21'),_0x1a8cfb[_0x0e79('0x16')],_0x4e2895);_0x25ca6b(_0x13d868[_0x0e79('0x14')](0x1f4,_0x1a8cfb['message']));});});};exports[_0x0e79('0x22')]=function(_0x10d01f){return new Promise(function(_0x192c2c,_0xb7dd8d){return db[_0x0e79('0x19')][_0x0e79('0x23')]({'where':_0x10d01f['options']?_0x10d01f[_0x0e79('0x1c')][_0x0e79('0x1e')]||null:null})['then'](function(_0x338ca1){if(_0x338ca1){return _0x338ca1['addTags'](_0x10d01f[_0x0e79('0x1b')][_0x0e79('0x24')],_['omit'](_0x10d01f[_0x0e79('0x1b')],[_0x0e79('0x24'),'id'])||{});}})[_0x0e79('0x25')](function(_0x294db0){logger[_0x0e79('0xf')]('AddTags',_0x10d01f);logger[_0x0e79('0x12')](_0x0e79('0x26'),_0x10d01f,JSON[_0x0e79('0x20')](_0x294db0));_0x192c2c(_0x294db0);})[_0x0e79('0x18')](function(_0x56c77e){logger[_0x0e79('0x14')](_0x0e79('0x26'),_0x56c77e[_0x0e79('0x16')],_0x10d01f);_0xb7dd8d(_this[_0x0e79('0x14')](0x1f4,_0x56c77e['message']));});});}; \ No newline at end of file +var _0x206a=['spread','AddTags','stringify','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','omit'];(function(_0x56d08a,_0x2ada71){var _0x2d8216=function(_0x230e9e){while(--_0x230e9e){_0x56d08a['push'](_0x56d08a['shift']());}};_0x2d8216(++_0x2ada71);}(_0x206a,0xed));var _0xa206=function(_0x5393ea,_0x3526d9){_0x5393ea=_0x5393ea-0x0;var _0x58b30f=_0x206a[_0x5393ea];return _0x58b30f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa206('0x0'));var BPromise=require('bluebird');var rs=require(_0xa206('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa206('0x2'));var logger=require(_0xa206('0x3'))('rpc');var config=require(_0xa206('0x4'));var jayson=require(_0xa206('0x5'));var client=jayson[_0xa206('0x6')][_0xa206('0x7')]({'port':0x232a});config['redis']=_[_0xa206('0x8')](config['redis'],{'host':_0xa206('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa206('0xa'))[_0xa206('0xb')](socket);function respondWithRpcPromise(_0x354ea2,_0xbf446,_0x2e0033){return new BPromise(function(_0x51c6df,_0x193598){return client[_0xa206('0xc')](_0x354ea2,_0x2e0033)[_0xa206('0xd')](function(_0x468cfa){logger[_0xa206('0xe')]('FaxInteraction,\x20%s,\x20%s',_0xbf446,_0xa206('0xf'));logger[_0xa206('0x10')](_0xa206('0x11'),_0xbf446,_0xa206('0xf'),JSON['stringify'](_0x468cfa));if(_0x468cfa[_0xa206('0x12')]){if(_0x468cfa[_0xa206('0x12')][_0xa206('0x13')]===0x1f4){logger[_0xa206('0x12')](_0xa206('0x14'),_0xbf446,_0x468cfa[_0xa206('0x12')][_0xa206('0x15')]);return _0x193598(_0x468cfa[_0xa206('0x12')][_0xa206('0x15')]);}logger[_0xa206('0x12')]('FaxInteraction,\x20%s,\x20%s',_0xbf446,_0x468cfa[_0xa206('0x12')][_0xa206('0x15')]);return _0x51c6df(_0x468cfa['error'][_0xa206('0x15')]);}else{logger['info'](_0xa206('0x14'),_0xbf446,_0xa206('0xf'));_0x51c6df(_0x468cfa[_0xa206('0x16')][_0xa206('0x15')]);}})[_0xa206('0x17')](function(_0x4c95d9){logger['error'](_0xa206('0x14'),_0xbf446,_0x4c95d9);_0x193598(_0x4c95d9);});});}exports[_0xa206('0x18')]=function(_0x1631bc){var _0xf8f4fd=this;return new Promise(function(_0x2f4fb1,_0x5727c9){return db[_0xa206('0x19')]['update'](_0x1631bc[_0xa206('0x1a')],{'raw':_0x1631bc[_0xa206('0x1b')]?_0x1631bc[_0xa206('0x1b')][_0xa206('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1631bc[_0xa206('0x1b')]?_0x1631bc['options'][_0xa206('0x1d')]||null:null,'attributes':_0x1631bc[_0xa206('0x1b')]?_0x1631bc[_0xa206('0x1b')][_0xa206('0x1e')]||null:null,'limit':_0x1631bc[_0xa206('0x1b')]?_0x1631bc[_0xa206('0x1b')][_0xa206('0x1f')]||null:null})[_0xa206('0xd')](function(_0x41a5c9){logger[_0xa206('0xe')](_0xa206('0x18'),_0x1631bc);logger[_0xa206('0x10')]('UpdateFaxInteraction',_0x1631bc,JSON['stringify'](_0x41a5c9));_0x2f4fb1(_0x41a5c9);})[_0xa206('0x17')](function(_0x36f0ac){logger[_0xa206('0x12')](_0xa206('0x18'),_0x36f0ac[_0xa206('0x15')],_0x1631bc);_0x5727c9(_0xf8f4fd[_0xa206('0x12')](0x1f4,_0x36f0ac['message']));});});};exports[_0xa206('0x20')]=function(_0x14eb24){return new Promise(function(_0x5eb216,_0x579704){return db[_0xa206('0x19')][_0xa206('0x21')]({'where':_0x14eb24[_0xa206('0x1b')]?_0x14eb24[_0xa206('0x1b')]['where']||null:null})[_0xa206('0xd')](function(_0x2e58ea){if(_0x2e58ea){return _0x2e58ea[_0xa206('0x22')](_0x14eb24['body']['ids'],_[_0xa206('0x23')](_0x14eb24[_0xa206('0x1a')],['ids','id'])||{});}})[_0xa206('0x24')](function(_0x63e163){logger[_0xa206('0xe')](_0xa206('0x25'),_0x14eb24);logger[_0xa206('0x10')](_0xa206('0x25'),_0x14eb24,JSON[_0xa206('0x26')](_0x63e163));_0x5eb216(_0x63e163);})[_0xa206('0x17')](function(_0xe9361e){logger[_0xa206('0x12')]('AddTags',_0xe9361e[_0xa206('0x15')],_0x14eb24);_0x579704(_this['error'](0x1f4,_0xe9361e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ddc7577..e62288c 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 _0xf4b7=['faxInteraction:','./faxInteraction.events','save','remove','update','removeListener','register'];(function(_0x3c0c3,_0x539fc0){var _0x20a20a=function(_0x26fb76){while(--_0x26fb76){_0x3c0c3['push'](_0x3c0c3['shift']());}};_0x20a20a(++_0x539fc0);}(_0xf4b7,0x19e));var _0x7f4b=function(_0x390574,_0x4ae6d6){_0x390574=_0x390574-0x0;var _0x4e4996=_0xf4b7[_0x390574];return _0x4e4996;};'use strict';var FaxInteractionEvents=require(_0x7f4b('0x0'));var events=[_0x7f4b('0x1'),_0x7f4b('0x2'),_0x7f4b('0x3')];function createListener(_0x5adc85,_0x31e830){return function(_0x5b8240){_0x31e830['emit'](_0x5adc85,_0x5b8240);};}function removeListener(_0x15f0a1,_0x32d77f){return function(){FaxInteractionEvents[_0x7f4b('0x4')](_0x15f0a1,_0x32d77f);};}exports[_0x7f4b('0x5')]=function(_0x148b58){for(var _0x586e54=0x0,_0x741226=events['length'];_0x586e54<_0x741226;_0x586e54++){var _0x35f528=events[_0x586e54];var _0x40eaea=createListener(_0x7f4b('0x6')+_0x35f528,_0x148b58);FaxInteractionEvents['on'](_0x35f528,_0x40eaea);}}; \ No newline at end of file +var _0xd847=['emit','removeListener','./faxInteraction.events','save','update'];(function(_0x32d883,_0x3057df){var _0x159535=function(_0x2a3037){while(--_0x2a3037){_0x32d883['push'](_0x32d883['shift']());}};_0x159535(++_0x3057df);}(_0xd847,0xa2));var _0x7d84=function(_0x53f852,_0x18ab08){_0x53f852=_0x53f852-0x0;var _0x2640c2=_0xd847[_0x53f852];return _0x2640c2;};'use strict';var FaxInteractionEvents=require(_0x7d84('0x0'));var events=[_0x7d84('0x1'),'remove',_0x7d84('0x2')];function createListener(_0x544875,_0x2eb0ec){return function(_0x283e64){_0x2eb0ec[_0x7d84('0x3')](_0x544875,_0x283e64);};}function removeListener(_0x4fba38,_0x221574){return function(){FaxInteractionEvents[_0x7d84('0x4')](_0x4fba38,_0x221574);};}exports['register']=function(_0x3032df){for(var _0x18dfe3=0x0,_0x3e6778=events['length'];_0x18dfe3<_0x3e6778;_0x18dfe3++){var _0x2c24ae=events[_0x18dfe3];var _0x523f9c=createListener('faxInteraction:'+_0x2c24ae,_0x3032df);FaxInteractionEvents['on'](_0x2c24ae,_0x523f9c);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 0fc3e12..6239329 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 _0xf781=['update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','put','fax','faxinteraction:update'];(function(_0x43139e,_0x762629){var _0x2bc838=function(_0x593ec3){while(--_0x593ec3){_0x43139e['push'](_0x43139e['shift']());}};_0x2bc838(++_0x762629);}(_0xf781,0xb5));var _0x1f78=function(_0x516d60,_0x127592){_0x516d60=_0x516d60-0x0;var _0x535058=_0xf781[_0x516d60];return _0x535058;};'use strict';var multer=require(_0x1f78('0x0'));var util=require(_0x1f78('0x1'));var path=require(_0x1f78('0x2'));var timeout=require(_0x1f78('0x3'));var express=require(_0x1f78('0x4'));var router=express[_0x1f78('0x5')]();var fs_extra=require(_0x1f78('0x6'));var auth=require(_0x1f78('0x7'));var interaction=require(_0x1f78('0x8'));var config=require(_0x1f78('0x9'));var controller=require(_0x1f78('0xa'));router[_0x1f78('0xb')]('/',auth[_0x1f78('0xc')](),controller[_0x1f78('0xd')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1f78('0xe')]);router[_0x1f78('0xb')](_0x1f78('0xf'),auth[_0x1f78('0xc')](),controller[_0x1f78('0x10')]);router['get'](_0x1f78('0x11'),auth['isAuthenticated'](),controller[_0x1f78('0x12')]);router[_0x1f78('0xb')](_0x1f78('0x13'),auth[_0x1f78('0xc')](),controller['download']);router[_0x1f78('0x14')]('/',auth[_0x1f78('0xc')](),controller[_0x1f78('0x15')]);router[_0x1f78('0x14')](_0x1f78('0x11'),auth[_0x1f78('0xc')](),controller[_0x1f78('0x16')]);router[_0x1f78('0x14')](_0x1f78('0x17'),auth[_0x1f78('0xc')](),interaction[_0x1f78('0x18')]('fax',_0x1f78('0x19')),controller['addTags']);router[_0x1f78('0x1a')](_0x1f78('0xf'),auth[_0x1f78('0xc')](),interaction[_0x1f78('0x18')](_0x1f78('0x1b'),_0x1f78('0x1c')),controller[_0x1f78('0x1d')]);router[_0x1f78('0x1e')](_0x1f78('0xf'),auth[_0x1f78('0xc')](),interaction[_0x1f78('0x18')]('fax',_0x1f78('0x1f')),controller[_0x1f78('0x20')]);router[_0x1f78('0x1e')]('/:id/tags',auth[_0x1f78('0xc')](),controller[_0x1f78('0x21')]);module[_0x1f78('0x22')]=router; \ No newline at end of file +var _0x1847=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','util','path','connect-timeout'];(function(_0x282cce,_0x3ee554){var _0xd6fb01=function(_0x3578b0){while(--_0x3578b0){_0x282cce['push'](_0x282cce['shift']());}};_0xd6fb01(++_0x3ee554);}(_0x1847,0x1dd));var _0x7184=function(_0x1ad53d,_0x3067eb){_0x1ad53d=_0x1ad53d-0x0;var _0x57df8d=_0x1847[_0x1ad53d];return _0x57df8d;};'use strict';var multer=require('multer');var util=require(_0x7184('0x0'));var path=require(_0x7184('0x1'));var timeout=require(_0x7184('0x2'));var express=require('express');var router=express[_0x7184('0x3')]();var fs_extra=require(_0x7184('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7184('0x5'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0x7184('0x6')]('/',auth[_0x7184('0x7')](),controller[_0x7184('0x8')]);router[_0x7184('0x6')](_0x7184('0x9'),auth[_0x7184('0x7')](),controller[_0x7184('0xa')]);router[_0x7184('0x6')](_0x7184('0xb'),auth[_0x7184('0x7')](),controller[_0x7184('0xc')]);router[_0x7184('0x6')](_0x7184('0xd'),auth[_0x7184('0x7')](),controller['getMessages']);router[_0x7184('0x6')](_0x7184('0xe'),auth[_0x7184('0x7')](),controller[_0x7184('0xf')]);router[_0x7184('0x10')]('/',auth['isAuthenticated'](),controller[_0x7184('0x11')]);router[_0x7184('0x10')](_0x7184('0xd'),auth[_0x7184('0x7')](),controller['addMessage']);router[_0x7184('0x10')](_0x7184('0x12'),auth['isAuthenticated'](),interaction[_0x7184('0x13')](_0x7184('0x14'),_0x7184('0x15')),controller[_0x7184('0x16')]);router[_0x7184('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x7184('0x13')](_0x7184('0x14'),_0x7184('0x18')),controller[_0x7184('0x19')]);router[_0x7184('0x1a')](_0x7184('0xb'),auth[_0x7184('0x7')](),interaction[_0x7184('0x13')](_0x7184('0x14'),_0x7184('0x1b')),controller[_0x7184('0x1c')]);router[_0x7184('0x1a')](_0x7184('0x12'),auth[_0x7184('0x7')](),controller['removeTags']);module[_0x7184('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 519ded9..08a6961 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 _0xf3cd=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x2a0034,_0x51c1a1){var _0x55c1b0=function(_0x349508){while(--_0x349508){_0x2a0034['push'](_0x2a0034['shift']());}};_0x55c1b0(++_0x51c1a1);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x47a5bd,_0x508329){_0x47a5bd=_0x47a5bd-0x0;var _0x5c2184=_0xf3cd[_0x47a5bd];return _0x5c2184;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'body':{'type':Sequelize[_0xdf3c('0x2')](_0xdf3c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdf3c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdf3c('0x5')]('in','out'),'defaultValue':_0xdf3c('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xdf3c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xdf3c('0x7')]}}; \ No newline at end of file +var _0x54f3=['exports','TEXT','medium','BOOLEAN','ENUM','DATE'];(function(_0x41e509,_0xb1e361){var _0x1859db=function(_0x3c7dac){while(--_0x3c7dac){_0x41e509['push'](_0x41e509['shift']());}};_0x1859db(++_0xb1e361);}(_0x54f3,0x120));var _0x354f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x54f3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x354f('0x0')]={'body':{'type':Sequelize[_0x354f('0x1')](_0x354f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x354f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x354f('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x354f('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x354f('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index b071c6d..c928e26 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 _0xe04b=['keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','FaxMessage','findAll','rows','show','length','includeAll','include','merge','find','catch','body','destroy','describe','accept','read','readAt','format','UserId','user','agent','params','get','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','reject','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','User','EventManager','rejectmessage','create','CmContact','findOne','isNil','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','server','files','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','request','then','FaxMessage,\x20%s,\x20%s','debug','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0xe04b,0xe2));var _0xbe04=function(_0x5ab6f7,_0x5ebde9){_0x5ab6f7=_0x5ab6f7-0x0;var _0x853e97=_0xe04b[_0x5ab6f7];return _0x853e97;};'use strict';var emlformat=require(_0xbe04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe04('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe04('0x2'));var moment=require(_0xbe04('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe04('0x4'));var util=require(_0xbe04('0x5'));var path=require('path');var sox=require(_0xbe04('0x6'));var csv=require(_0xbe04('0x7'));var ejs=require(_0xbe04('0x8'));var fs=require('fs');var fs_extra=require(_0xbe04('0x9'));var _=require('lodash');var squel=require(_0xbe04('0xa'));var crypto=require('crypto');var jsforce=require(_0xbe04('0xb'));var deskjs=require(_0xbe04('0xc'));var toCsv=require(_0xbe04('0x7'));var querystring=require(_0xbe04('0xd'));var Papa=require(_0xbe04('0xe'));var Redis=require(_0xbe04('0xf'));var authService=require(_0xbe04('0x10'));var qs=require(_0xbe04('0x11'));var as=require(_0xbe04('0x12'));var hardwareService=require(_0xbe04('0x13'));var logger=require(_0xbe04('0x14'))(_0xbe04('0x15'));var utils=require(_0xbe04('0x16'));var config=require(_0xbe04('0x17'));var licenseUtil=require(_0xbe04('0x18'));var db=require('../../mysqldb')['db'];config[_0xbe04('0x19')]=_['defaults'](config[_0xbe04('0x19')],{'host':_0xbe04('0x1a'),'port':0x18eb});var socket=require(_0xbe04('0x1b'))(new Redis(config['redis']));require(_0xbe04('0x1c'))[_0xbe04('0x1d')](socket);var jayson=require(_0xbe04('0x1e'));var client=jayson[_0xbe04('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xbe04('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12c8ac,_0x18753e,_0x1197a4,_0x4d64f7){return new BPromise(function(_0x532e02,_0x460493){var _0xb4a11=_0x4d64f7||client;return _0xb4a11[_0xbe04('0x20')](_0x12c8ac,_0x1197a4)[_0xbe04('0x21')](function(_0x159b11){logger['info'](_0xbe04('0x22'),_0x18753e,'request\x20sent');logger[_0xbe04('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x18753e,'request\x20sent',JSON[_0xbe04('0x24')](_0x159b11));if(_0x159b11[_0xbe04('0x25')]){if(_0x159b11[_0xbe04('0x25')]['code']===0x1f4){logger[_0xbe04('0x25')]('FaxMessage,\x20%s,\x20%s',_0x18753e,_0x159b11['error'][_0xbe04('0x26')]);return _0x460493(_0x159b11['error'][_0xbe04('0x26')]);}logger[_0xbe04('0x25')](_0xbe04('0x22'),_0x18753e,_0x159b11[_0xbe04('0x25')][_0xbe04('0x26')]);return _0x532e02(_0x159b11[_0xbe04('0x25')][_0xbe04('0x26')]);}else{logger['info'](_0xbe04('0x22'),_0x18753e,'request\x20sent');_0x532e02(_0x159b11[_0xbe04('0x27')][_0xbe04('0x26')]);}})['catch'](function(_0x452f66){logger['error'](_0xbe04('0x22'),_0x18753e,_0x452f66);_0x460493(_0x452f66);});});}function respondWithStatusCode(_0xe30a2e,_0x439e00){_0x439e00=_0x439e00||0xcc;return function(_0x23f1c5){if(_0x23f1c5){return _0xe30a2e[_0xbe04('0x28')](_0x439e00);}return _0xe30a2e[_0xbe04('0x29')](_0x439e00)[_0xbe04('0x2a')]();};}function respondWithResult(_0x4a68ad,_0x22702e){_0x22702e=_0x22702e||0xc8;return function(_0x530e82){if(_0x530e82){return _0x4a68ad[_0xbe04('0x29')](_0x22702e)[_0xbe04('0x2b')](_0x530e82);}};}function respondWithFilteredResult(_0x2748a4,_0x19e0d6){return function(_0x242de0){if(_0x242de0){var _0x57274b=typeof _0x19e0d6[_0xbe04('0x2c')]===_0xbe04('0x2d')&&typeof _0x19e0d6[_0xbe04('0x2e')]===_0xbe04('0x2d');var _0x27ea15=_0x242de0['count'];var _0x357349=_0x57274b?0x0:_0x19e0d6['offset'];var _0x28f9ae=_0x57274b?_0x242de0[_0xbe04('0x2f')]:_0x19e0d6[_0xbe04('0x2c')]+_0x19e0d6[_0xbe04('0x2e')];var _0x2ef316;if(_0x28f9ae>=_0x27ea15){_0x28f9ae=_0x27ea15;_0x2ef316=0xc8;}else{_0x2ef316=0xce;}_0x2748a4[_0xbe04('0x29')](_0x2ef316);return _0x2748a4[_0xbe04('0x30')]('Content-Range',_0x357349+'-'+_0x28f9ae+'/'+_0x27ea15)[_0xbe04('0x2b')](_0x242de0);}return null;};}function patchUpdates(_0x4b037c){return function(_0x25a426){try{jsonpatch[_0xbe04('0x31')](_0x25a426,_0x4b037c,!![]);}catch(_0xf0798d){return BPromise['reject'](_0xf0798d);}return _0x25a426[_0xbe04('0x32')]();};}function saveUpdates(_0x17dead,_0x12dbc5){return function(_0x17796d){if(_0x17796d){return _0x17796d[_0xbe04('0x33')](_0x17dead)[_0xbe04('0x21')](function(_0x2ab72d){return _0x2ab72d;});}return null;};}function removeEntity(_0x4e1a73,_0x3082fa){return function(_0x205e4e){if(_0x205e4e){return _0x205e4e['destroy']()[_0xbe04('0x21')](function(){_0x4e1a73[_0xbe04('0x29')](0xcc)[_0xbe04('0x2a')]();});}};}function handleEntityNotFound(_0x1da4c1,_0x19e745){return function(_0x59200d){if(!_0x59200d){_0x1da4c1[_0xbe04('0x28')](0x194);}return _0x59200d;};}function handleError(_0xf6233d,_0x3f2fbc){_0x3f2fbc=_0x3f2fbc||0x1f4;return function(_0x1f371d){logger[_0xbe04('0x25')](_0x1f371d['stack']);if(_0x1f371d[_0xbe04('0x34')]){delete _0x1f371d[_0xbe04('0x34')];}_0xf6233d[_0xbe04('0x29')](_0x3f2fbc)[_0xbe04('0x35')](_0x1f371d);};}exports[_0xbe04('0x36')]=function(_0x4bceb9,_0x1efd74){var _0x442b91={},_0x575fb3={},_0x428f37={'count':0x0,'rows':[]};var _0x5acc38=_[_0xbe04('0x37')](db['FaxMessage'][_0xbe04('0x38')],function(_0xac9561){return{'name':_0xac9561[_0xbe04('0x39')],'type':_0xac9561[_0xbe04('0x3a')][_0xbe04('0x3b')]};});_0x575fb3[_0xbe04('0x3c')]=_[_0xbe04('0x37')](_0x5acc38,_0xbe04('0x34'));_0x575fb3[_0xbe04('0x3d')]=_[_0xbe04('0x3e')](_0x4bceb9[_0xbe04('0x3d')]);_0x575fb3[_0xbe04('0x3f')]=_[_0xbe04('0x40')](_0x575fb3[_0xbe04('0x3c')],_0x575fb3[_0xbe04('0x3d')]);_0x442b91['attributes']=_[_0xbe04('0x40')](_0x575fb3[_0xbe04('0x3c')],qs[_0xbe04('0x41')](_0x4bceb9[_0xbe04('0x3d')][_0xbe04('0x41')]));_0x442b91[_0xbe04('0x42')]=_0x442b91[_0xbe04('0x42')]['length']?_0x442b91[_0xbe04('0x42')]:_0x575fb3[_0xbe04('0x3c')];if(!_0x4bceb9[_0xbe04('0x3d')][_0xbe04('0x43')](_0xbe04('0x44'))){_0x442b91[_0xbe04('0x2e')]=qs[_0xbe04('0x2e')](_0x4bceb9['query'][_0xbe04('0x2e')]);_0x442b91[_0xbe04('0x2c')]=qs[_0xbe04('0x2c')](_0x4bceb9['query'][_0xbe04('0x2c')]);}_0x442b91['order']=qs[_0xbe04('0x45')](_0x4bceb9['query'][_0xbe04('0x45')]);_0x442b91[_0xbe04('0x46')]=qs[_0xbe04('0x3f')](_['pick'](_0x4bceb9[_0xbe04('0x3d')],_0x575fb3[_0xbe04('0x3f')]),_0x5acc38);if(_0x4bceb9['query'][_0xbe04('0x47')]){_0x442b91['where']=_['merge'](_0x442b91[_0xbe04('0x46')],{'$or':_[_0xbe04('0x37')](_0x5acc38,function(_0x37a563){if(_0x37a563[_0xbe04('0x3a')]!==_0xbe04('0x48')){var _0x502c4c={};_0x502c4c[_0x37a563[_0xbe04('0x34')]]={'$like':'%'+_0x4bceb9[_0xbe04('0x3d')][_0xbe04('0x47')]+'%'};return _0x502c4c;}})});}_0x442b91=_['merge']({},_0x442b91,_0x4bceb9[_0xbe04('0x49')]);var _0x4450b2={'where':_0x442b91[_0xbe04('0x46')]};return db['FaxMessage']['count'](_0x4450b2)[_0xbe04('0x21')](function(_0x2e3639){_0x428f37['count']=_0x2e3639;if(_0x4bceb9[_0xbe04('0x3d')]['includeAll']){_0x442b91['include']=[{'all':!![]}];}return db[_0xbe04('0x4a')][_0xbe04('0x4b')](_0x442b91);})[_0xbe04('0x21')](function(_0x5c4d1b){_0x428f37[_0xbe04('0x4c')]=_0x5c4d1b;return _0x428f37;})['then'](respondWithFilteredResult(_0x1efd74,_0x442b91))['catch'](handleError(_0x1efd74,null));};exports[_0xbe04('0x4d')]=function(_0x237740,_0x53bd4d){var _0x2b1d65={'raw':!![],'where':{'id':_0x237740['params']['id']}},_0x5d6af5={};_0x5d6af5[_0xbe04('0x3c')]=_[_0xbe04('0x3e')](db[_0xbe04('0x4a')][_0xbe04('0x38')]);_0x5d6af5[_0xbe04('0x3d')]=_['keys'](_0x237740[_0xbe04('0x3d')]);_0x5d6af5[_0xbe04('0x3f')]=_[_0xbe04('0x40')](_0x5d6af5[_0xbe04('0x3c')],_0x5d6af5['query']);_0x2b1d65[_0xbe04('0x42')]=_[_0xbe04('0x40')](_0x5d6af5['model'],qs['fields'](_0x237740[_0xbe04('0x3d')]['fields']));_0x2b1d65[_0xbe04('0x42')]=_0x2b1d65[_0xbe04('0x42')][_0xbe04('0x4e')]?_0x2b1d65['attributes']:_0x5d6af5[_0xbe04('0x3c')];if(_0x237740[_0xbe04('0x3d')][_0xbe04('0x4f')]){_0x2b1d65[_0xbe04('0x50')]=[{'all':!![]}];}_0x2b1d65=_[_0xbe04('0x51')]({},_0x2b1d65,_0x237740[_0xbe04('0x49')]);return db['FaxMessage'][_0xbe04('0x52')](_0x2b1d65)[_0xbe04('0x21')](handleEntityNotFound(_0x53bd4d,null))[_0xbe04('0x21')](respondWithResult(_0x53bd4d,null))[_0xbe04('0x53')](handleError(_0x53bd4d,null));};exports[_0xbe04('0x33')]=function(_0x5a7786,_0x5aafa0){if(_0x5a7786[_0xbe04('0x54')]['id']){delete _0x5a7786[_0xbe04('0x54')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x5a7786['params']['id']}})[_0xbe04('0x21')](handleEntityNotFound(_0x5aafa0,null))[_0xbe04('0x21')](saveUpdates(_0x5a7786[_0xbe04('0x54')],null))[_0xbe04('0x21')](respondWithResult(_0x5aafa0,null))[_0xbe04('0x53')](handleError(_0x5aafa0,null));};exports[_0xbe04('0x55')]=function(_0x36a508,_0xb9c17d){return db[_0xbe04('0x4a')][_0xbe04('0x52')]({'where':{'id':_0x36a508['params']['id']}})[_0xbe04('0x21')](handleEntityNotFound(_0xb9c17d,null))[_0xbe04('0x21')](removeEntity(_0xb9c17d,null))[_0xbe04('0x53')](handleError(_0xb9c17d,null));};exports[_0xbe04('0x56')]=function(_0x58e25e,_0x3229a1){return db['FaxMessage'][_0xbe04('0x56')]()[_0xbe04('0x21')](respondWithResult(_0x3229a1,null))['catch'](handleError(_0x3229a1,null));};var interaction_log=require(_0xbe04('0x14'))('fax-interactions');exports[_0xbe04('0x57')]=function(_0x1947c0,_0x422238,_0x49647c){var _0x4933d0={'agent':{},'channel':'fax'};if(_0x1947c0[_0xbe04('0x54')]['id']){delete _0x1947c0[_0xbe04('0x54')]['id'];}_0x1947c0[_0xbe04('0x54')][_0xbe04('0x58')]=!![];_0x1947c0[_0xbe04('0x54')][_0xbe04('0x59')]=moment()[_0xbe04('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1947c0['body']['UserId']=_0x1947c0[_0xbe04('0x54')][_0xbe04('0x5b')]||_0x1947c0[_0xbe04('0x5c')]['id'];_0x4933d0[_0xbe04('0x5d')]['id']=_0x1947c0['body'][_0xbe04('0x5b')];return db[_0xbe04('0x4a')][_0xbe04('0x52')]({'where':{'id':_0x1947c0[_0xbe04('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x422238,null))[_0xbe04('0x21')](saveUpdates(_0x1947c0[_0xbe04('0x54')],null))['then'](function(_0x51487e){if(_0x51487e){_0x4933d0[_0xbe04('0x26')]=_0x51487e[_0xbe04('0x5f')]({'plain':!![]});return db['FaxInteraction'][_0xbe04('0x52')]({'where':{'id':_0x51487e[_0xbe04('0x60')]}});}return null;})[_0xbe04('0x21')](handleEntityNotFound(_0x422238,null))[_0xbe04('0x21')](function(_0x488093){if(_0x488093){return _0x488093[_0xbe04('0x33')]({'UserId':_0x1947c0[_0xbe04('0x54')][_0xbe04('0x5b')],'read1stAt':_['isNil'](_0x488093[_0xbe04('0x61')])?moment()[_0xbe04('0x5a')](_0xbe04('0x62')):undefined});}return null;})[_0xbe04('0x21')](function(_0x4144ea){if(_0x4144ea){_0x4933d0['interaction']=_0x4144ea[_0xbe04('0x5f')]({'plain':!![]});interaction_log[_0xbe04('0x63')](_0xbe04('0x64'),_0x1947c0[_0xbe04('0x5c')]['id'],_0x1947c0[_0xbe04('0x5c')]['name'],_0x1947c0[_0xbe04('0x5c')][_0xbe04('0x65')],_0x4933d0[_0xbe04('0x66')]['id'],_0x1947c0[_0xbe04('0x54')]?JSON[_0xbe04('0x24')](_0x1947c0[_0xbe04('0x54')]):_0xbe04('0x67'));return respondWithRpcPromise(_0xbe04('0x68'),_0xbe04('0x69'),_0x4933d0);}return null;})[_0xbe04('0x21')](function(_0x4e7966){var _0x5af8b7=_0xbe04('0x6a')+_0x4e7966[_0xbe04('0x26')][_0xbe04('0x6b')];return db[_0xbe04('0x6c')][_0xbe04('0x3d')](_0x5af8b7,{'type':db['Sequelize'][_0xbe04('0x6d')][_0xbe04('0x6e')],'raw':!![]})['then'](function(_0x114551){return _0x114551;});})[_0xbe04('0x21')](function(_0x55e4b5){if(_0x55e4b5){_0x4933d0[_0xbe04('0x26')][_0xbe04('0x6f')]=_0x55e4b5[0x0];if(!_0x1947c0['body'][_0xbe04('0x5b')])return;return db['User']['find']({'where':{'id':_0x1947c0[_0xbe04('0x54')][_0xbe04('0x5b')],'role':_0xbe04('0x5d')},'attributes':['id',_0xbe04('0x34'),_0xbe04('0x70'),_0xbe04('0x71'),_0xbe04('0x72')],'raw':!![]});}return null;})[_0xbe04('0x21')](function(_0x30f30b){if(!_0x30f30b)return null;_0x4933d0[_0xbe04('0x26')][_0xbe04('0x5d')]=_0x30f30b;return _0x4933d0;})[_0xbe04('0x21')](function(_0x3c0030){if(_0x3c0030){if(_0x1947c0[_0xbe04('0x54')][_0xbe04('0x73')]){_0x4933d0[_0xbe04('0x26')][_0xbe04('0x74')]=util[_0xbe04('0x5a')](_0xbe04('0x75'),_0x1947c0[_0xbe04('0x5c')]['name']);_0x4933d0['message'][_0xbe04('0x76')]=_0x4933d0[_0xbe04('0x76')];_0x4933d0[_0xbe04('0x26')][_0xbe04('0x77')]=_0x4933d0[_0xbe04('0x76')];_0x4933d0[_0xbe04('0x26')][_0xbe04('0x78')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0xbe04('0x79'),'message':_0x4933d0[_0xbe04('0x26')]},client9002)['then'](function(){return _0x4933d0;});}return _0x4933d0;}return null;})['then'](respondWithResult(_0x422238,null))['catch'](handleError(_0x422238,null));};var interaction_log=require(_0xbe04('0x14'))('fax-interactions');exports[_0xbe04('0x7a')]=function(_0x1aaff0,_0x448e5d,_0xc6984f){var _0x88016a={'agent':{},'channel':_0xbe04('0x7b')};if(_0x1aaff0[_0xbe04('0x54')]['id']){delete _0x1aaff0[_0xbe04('0x54')]['id'];}_0x1aaff0[_0xbe04('0x54')][_0xbe04('0x5b')]=_0x1aaff0[_0xbe04('0x54')][_0xbe04('0x5b')]||_0x1aaff0[_0xbe04('0x5c')]['id'];_0x88016a[_0xbe04('0x5d')]['id']=_0x1aaff0['body']['UserId'];return db[_0xbe04('0x4a')][_0xbe04('0x52')]({'where':{'id':_0x1aaff0['params']['id'],'UserId':null}})[_0xbe04('0x21')](handleEntityNotFound(_0x448e5d,null))[_0xbe04('0x21')](function(_0x18f27a){if(_0x18f27a){_0x88016a[_0xbe04('0x26')]=_0x18f27a[_0xbe04('0x5f')]({'plain':!![]});return db[_0xbe04('0x7c')][_0xbe04('0x52')]({'where':{'id':_0x18f27a['FaxInteractionId']}});}return null;})[_0xbe04('0x21')](handleEntityNotFound(_0x448e5d,null))[_0xbe04('0x21')](function(_0x140f1c){if(_0x140f1c){_0x88016a[_0xbe04('0x66')]=_0x140f1c[_0xbe04('0x5f')]({'plain':!![]});interaction_log['info'](_0xbe04('0x7d'),_0x1aaff0[_0xbe04('0x5c')]['id'],_0x1aaff0[_0xbe04('0x5c')][_0xbe04('0x34')],_0x1aaff0['user'][_0xbe04('0x65')],_0x88016a[_0xbe04('0x66')]['id'],_0x1aaff0[_0xbe04('0x54')]?JSON['stringify'](_0x1aaff0[_0xbe04('0x54')]):'null');return respondWithRpcPromise('RejectMessage',_0xbe04('0x7e'),_0x88016a);}return null;})[_0xbe04('0x21')](function(_0x5e3a9e){var _0xe4b891=_0xbe04('0x6a')+_0x5e3a9e[_0xbe04('0x26')][_0xbe04('0x6b')];return db[_0xbe04('0x6c')][_0xbe04('0x3d')](_0xe4b891,{'type':db[_0xbe04('0x7f')][_0xbe04('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x788c47){return _0x788c47;});})[_0xbe04('0x21')](function(_0x98929e){if(_0x98929e){_0x88016a[_0xbe04('0x26')]['contact']=_0x98929e[0x0];if(!_0x1aaff0[_0xbe04('0x54')]['UserId'])return;return db[_0xbe04('0x80')][_0xbe04('0x52')]({'where':{'id':_0x1aaff0[_0xbe04('0x54')][_0xbe04('0x5b')],'role':'agent'},'attributes':['id',_0xbe04('0x34'),'fullname',_0xbe04('0x71'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5a9a99){if(!_0x5a9a99)return null;_0x88016a[_0xbe04('0x26')]['agent']=_0x5a9a99;return _0x88016a;})[_0xbe04('0x21')](function(_0xa6dd01){if(_0xa6dd01){_0xa6dd01['message'][_0xbe04('0x74')]=util[_0xbe04('0x5a')](_0xbe04('0x75'),_0x1aaff0['user'][_0xbe04('0x34')]);_0xa6dd01[_0xbe04('0x26')][_0xbe04('0x76')]=_0x88016a[_0xbe04('0x76')];_0xa6dd01[_0xbe04('0x26')][_0xbe04('0x77')]=_0x88016a[_0xbe04('0x76')];_0xa6dd01['message'][_0xbe04('0x78')]=_0xbe04('0x7a');respondWithRpcPromise(_0xbe04('0x81'),'EventManager',{'event':_0xbe04('0x82'),'message':_0xa6dd01[_0xbe04('0x26')]},client9002);return _0x88016a;}return null;})[_0xbe04('0x21')](respondWithResult(_0x448e5d,null))['catch'](handleError(_0x448e5d,null));};exports[_0xbe04('0x83')]=function(_0xf2c075,_0x11e686){var _0x1cf812;return db[_0xbe04('0x4a')]['create'](_0xf2c075[_0xbe04('0x54')],{})[_0xbe04('0x21')](function(_0x59fed6){_0x1cf812=_0x59fed6;return db[_0xbe04('0x84')][_0xbe04('0x85')]({'where':{'id':_0x1cf812[_0xbe04('0x6b')]}});})[_0xbe04('0x21')](function(_0x32a745){if(_[_0xbe04('0x86')](_0x32a745)){return;}else{_0x1cf812['fax']=_0x32a745[_0xbe04('0x7b')];return db[_0xbe04('0x87')][_0xbe04('0x85')]({'where':{'id':_0x1cf812['AttachmentId']}});}})[_0xbe04('0x21')](function(_0xc4c884){return respondWithRpcPromise(_0xbe04('0x88'),_0xbe04('0x88'),{'FaxAccountId':_[_0xbe04('0x86')](_0xf2c075[_0xbe04('0x54')])?undefined:_0xf2c075[_0xbe04('0x54')]['FaxAccountId'],'path':_['isNil'](_0xc4c884)?undefined:util[_0xbe04('0x5a')](_0xbe04('0x89'),_0xc4c884[_0xbe04('0x8a')]),'fax':_[_0xbe04('0x86')](_0x1cf812[_0xbe04('0x7b')])?undefined:_0x1cf812['fax'],'AttachmentId':_0x1cf812[_0xbe04('0x8b')]},client9002);})[_0xbe04('0x21')](respondWithResult(_0x11e686,0xc9))[_0xbe04('0x53')](handleError(_0x11e686,null));};exports[_0xbe04('0x8c')]=function(_0x31abed,_0x5f5d88){var _0x4b4cd0=path[_0xbe04('0x8d')](config['root'],_0xbe04('0x8e'),_0xbe04('0x8f'),'attachments');return db[_0xbe04('0x4a')]['find']({'where':{'id':_0x31abed[_0xbe04('0x5e')]['id']},'include':[{'model':db['Attachment'],'as':_0xbe04('0x87')}]})[_0xbe04('0x21')](handleEntityNotFound(_0x5f5d88,null))['then'](function(_0x100a21){if(_0x100a21){return _0x5f5d88[_0xbe04('0x8c')](path['join'](_0x4b4cd0,_0x100a21['Attachment']['basename']));}})[_0xbe04('0x53')](handleError(_0x5f5d88,null));}; \ No newline at end of file +var _0x94bb=['options','update','body','find','params','destroy','describe','fax-interactions','fax','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','UserId','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','contact','fullname','email','manual','SIP/%s','channel','event','accept','EventManager','FaxInteraction','FaxInteractionId','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','User','internal','interface','motionChannel','rejectmessage','create','CmContact','isNil','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','attachments','Attachment','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','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','../../mysqldb','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','name','send','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','FaxMessage','findAll','rows','show','rawAttributes','keys'];(function(_0x49ceff,_0x5e60e1){var _0x1b03b9=function(_0x37af3c){while(--_0x37af3c){_0x49ceff['push'](_0x49ceff['shift']());}};_0x1b03b9(++_0x5e60e1);}(_0x94bb,0x147));var _0xb94b=function(_0x6d97b2,_0x3c1332){_0x6d97b2=_0x6d97b2-0x0;var _0x514465=_0x94bb[_0x6d97b2];return _0x514465;};'use strict';var emlformat=require(_0xb94b('0x0'));var rimraf=require(_0xb94b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb94b('0x2'));var rp=require(_0xb94b('0x3'));var moment=require(_0xb94b('0x4'));var BPromise=require(_0xb94b('0x5'));var Mustache=require(_0xb94b('0x6'));var util=require(_0xb94b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb94b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb94b('0x9'));var squel=require(_0xb94b('0xa'));var crypto=require(_0xb94b('0xb'));var jsforce=require(_0xb94b('0xc'));var deskjs=require(_0xb94b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb94b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb94b('0xf'));var qs=require(_0xb94b('0x10'));var as=require(_0xb94b('0x11'));var hardwareService=require(_0xb94b('0x12'));var logger=require(_0xb94b('0x13'))(_0xb94b('0x14'));var utils=require(_0xb94b('0x15'));var config=require(_0xb94b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb94b('0x17'))['db'];config[_0xb94b('0x18')]=_['defaults'](config[_0xb94b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb94b('0x19'))(new Redis(config[_0xb94b('0x18')]));require(_0xb94b('0x1a'))[_0xb94b('0x1b')](socket);var jayson=require(_0xb94b('0x1c'));var client=jayson[_0xb94b('0x1d')][_0xb94b('0x1e')]({'port':0x232c});var client9002=jayson[_0xb94b('0x1d')][_0xb94b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xcc98b,_0x1e7d14,_0x5c3c08,_0x1a6fe9){return new BPromise(function(_0x3bcacf,_0x2bc6c6){var _0x431e91=_0x1a6fe9||client;return _0x431e91['request'](_0xcc98b,_0x5c3c08)['then'](function(_0x21602e){logger['info'](_0xb94b('0x1f'),_0x1e7d14,_0xb94b('0x20'));logger['debug'](_0xb94b('0x21'),_0x1e7d14,_0xb94b('0x20'),JSON[_0xb94b('0x22')](_0x21602e));if(_0x21602e[_0xb94b('0x23')]){if(_0x21602e['error'][_0xb94b('0x24')]===0x1f4){logger[_0xb94b('0x23')](_0xb94b('0x1f'),_0x1e7d14,_0x21602e[_0xb94b('0x23')][_0xb94b('0x25')]);return _0x2bc6c6(_0x21602e[_0xb94b('0x23')][_0xb94b('0x25')]);}logger[_0xb94b('0x23')](_0xb94b('0x1f'),_0x1e7d14,_0x21602e['error']['message']);return _0x3bcacf(_0x21602e[_0xb94b('0x23')][_0xb94b('0x25')]);}else{logger[_0xb94b('0x26')](_0xb94b('0x1f'),_0x1e7d14,_0xb94b('0x20'));_0x3bcacf(_0x21602e['result'][_0xb94b('0x25')]);}})[_0xb94b('0x27')](function(_0x2ae39f){logger[_0xb94b('0x23')](_0xb94b('0x1f'),_0x1e7d14,_0x2ae39f);_0x2bc6c6(_0x2ae39f);});});}function respondWithStatusCode(_0x76157b,_0x1028fc){_0x1028fc=_0x1028fc||0xcc;return function(_0x4c98c0){if(_0x4c98c0){return _0x76157b['sendStatus'](_0x1028fc);}return _0x76157b[_0xb94b('0x28')](_0x1028fc)[_0xb94b('0x29')]();};}function respondWithResult(_0x2126fb,_0x126773){_0x126773=_0x126773||0xc8;return function(_0x2866d5){if(_0x2866d5){return _0x2126fb[_0xb94b('0x28')](_0x126773)[_0xb94b('0x2a')](_0x2866d5);}};}function respondWithFilteredResult(_0x52fbe4,_0x96af4b){return function(_0x40ae7a){if(_0x40ae7a){var _0x3e0e01=typeof _0x96af4b[_0xb94b('0x2b')]===_0xb94b('0x2c')&&typeof _0x96af4b[_0xb94b('0x2d')]===_0xb94b('0x2c');var _0x47b71b=_0x40ae7a['count'];var _0x3f4241=_0x3e0e01?0x0:_0x96af4b[_0xb94b('0x2b')];var _0x3d9290=_0x3e0e01?_0x40ae7a[_0xb94b('0x2e')]:_0x96af4b['offset']+_0x96af4b[_0xb94b('0x2d')];var _0x32cdc6;if(_0x3d9290>=_0x47b71b){_0x3d9290=_0x47b71b;_0x32cdc6=0xc8;}else{_0x32cdc6=0xce;}_0x52fbe4['status'](_0x32cdc6);return _0x52fbe4['set'](_0xb94b('0x2f'),_0x3f4241+'-'+_0x3d9290+'/'+_0x47b71b)[_0xb94b('0x2a')](_0x40ae7a);}return null;};}function patchUpdates(_0x4a1e62){return function(_0x3686c7){try{jsonpatch[_0xb94b('0x30')](_0x3686c7,_0x4a1e62,!![]);}catch(_0x8be744){return BPromise[_0xb94b('0x31')](_0x8be744);}return _0x3686c7[_0xb94b('0x32')]();};}function saveUpdates(_0x954404,_0x1712d9){return function(_0x550bef){if(_0x550bef){return _0x550bef['update'](_0x954404)[_0xb94b('0x33')](function(_0x1d1c2c){return _0x1d1c2c;});}return null;};}function removeEntity(_0x4e0855,_0x126e28){return function(_0x1d95a5){if(_0x1d95a5){return _0x1d95a5['destroy']()['then'](function(){_0x4e0855[_0xb94b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f59a1,_0x4ba9bd){return function(_0x2eed58){if(!_0x2eed58){_0x2f59a1['sendStatus'](0x194);}return _0x2eed58;};}function handleError(_0x30ff98,_0xbf2c7){_0xbf2c7=_0xbf2c7||0x1f4;return function(_0x2a06c8){logger[_0xb94b('0x23')](_0x2a06c8['stack']);if(_0x2a06c8[_0xb94b('0x34')]){delete _0x2a06c8[_0xb94b('0x34')];}_0x30ff98[_0xb94b('0x28')](_0xbf2c7)[_0xb94b('0x35')](_0x2a06c8);};}exports['index']=function(_0x151fad,_0x38eb69){var _0x125bfd={},_0x4650e8={},_0x5f591e={'count':0x0,'rows':[]};var _0x28ef7b=_['map'](db['FaxMessage']['rawAttributes'],function(_0x487172){return{'name':_0x487172[_0xb94b('0x36')],'type':_0x487172[_0xb94b('0x37')]['key']};});_0x4650e8[_0xb94b('0x38')]=_['map'](_0x28ef7b,'name');_0x4650e8[_0xb94b('0x39')]=_['keys'](_0x151fad[_0xb94b('0x39')]);_0x4650e8[_0xb94b('0x3a')]=_[_0xb94b('0x3b')](_0x4650e8[_0xb94b('0x38')],_0x4650e8['query']);_0x125bfd[_0xb94b('0x3c')]=_['intersection'](_0x4650e8[_0xb94b('0x38')],qs[_0xb94b('0x3d')](_0x151fad['query'][_0xb94b('0x3d')]));_0x125bfd['attributes']=_0x125bfd[_0xb94b('0x3c')][_0xb94b('0x3e')]?_0x125bfd[_0xb94b('0x3c')]:_0x4650e8[_0xb94b('0x38')];if(!_0x151fad[_0xb94b('0x39')][_0xb94b('0x3f')](_0xb94b('0x40'))){_0x125bfd['limit']=qs[_0xb94b('0x2d')](_0x151fad['query'][_0xb94b('0x2d')]);_0x125bfd[_0xb94b('0x2b')]=qs[_0xb94b('0x2b')](_0x151fad[_0xb94b('0x39')][_0xb94b('0x2b')]);}_0x125bfd['order']=qs[_0xb94b('0x41')](_0x151fad[_0xb94b('0x39')][_0xb94b('0x41')]);_0x125bfd[_0xb94b('0x42')]=qs[_0xb94b('0x3a')](_[_0xb94b('0x43')](_0x151fad[_0xb94b('0x39')],_0x4650e8[_0xb94b('0x3a')]),_0x28ef7b);if(_0x151fad[_0xb94b('0x39')]['filter']){_0x125bfd[_0xb94b('0x42')]=_[_0xb94b('0x44')](_0x125bfd[_0xb94b('0x42')],{'$or':_['map'](_0x28ef7b,function(_0x3afd8e){if(_0x3afd8e[_0xb94b('0x37')]!=='VIRTUAL'){var _0x38bc4d={};_0x38bc4d[_0x3afd8e[_0xb94b('0x34')]]={'$like':'%'+_0x151fad[_0xb94b('0x39')][_0xb94b('0x45')]+'%'};return _0x38bc4d;}})});}_0x125bfd=_[_0xb94b('0x44')]({},_0x125bfd,_0x151fad['options']);var _0x373ac9={'where':_0x125bfd['where']};return db['FaxMessage']['count'](_0x373ac9)['then'](function(_0x482b84){_0x5f591e[_0xb94b('0x2e')]=_0x482b84;if(_0x151fad[_0xb94b('0x39')][_0xb94b('0x46')]){_0x125bfd[_0xb94b('0x47')]=[{'all':!![]}];}return db[_0xb94b('0x48')][_0xb94b('0x49')](_0x125bfd);})[_0xb94b('0x33')](function(_0x201b88){_0x5f591e[_0xb94b('0x4a')]=_0x201b88;return _0x5f591e;})['then'](respondWithFilteredResult(_0x38eb69,_0x125bfd))[_0xb94b('0x27')](handleError(_0x38eb69,null));};exports[_0xb94b('0x4b')]=function(_0xc9e0f4,_0x56b286){var _0x708b2a={'raw':!![],'where':{'id':_0xc9e0f4['params']['id']}},_0x4da435={};_0x4da435[_0xb94b('0x38')]=_['keys'](db['FaxMessage'][_0xb94b('0x4c')]);_0x4da435[_0xb94b('0x39')]=_[_0xb94b('0x4d')](_0xc9e0f4[_0xb94b('0x39')]);_0x4da435[_0xb94b('0x3a')]=_[_0xb94b('0x3b')](_0x4da435[_0xb94b('0x38')],_0x4da435[_0xb94b('0x39')]);_0x708b2a[_0xb94b('0x3c')]=_['intersection'](_0x4da435['model'],qs[_0xb94b('0x3d')](_0xc9e0f4[_0xb94b('0x39')][_0xb94b('0x3d')]));_0x708b2a[_0xb94b('0x3c')]=_0x708b2a[_0xb94b('0x3c')]['length']?_0x708b2a[_0xb94b('0x3c')]:_0x4da435[_0xb94b('0x38')];if(_0xc9e0f4[_0xb94b('0x39')][_0xb94b('0x46')]){_0x708b2a[_0xb94b('0x47')]=[{'all':!![]}];}_0x708b2a=_[_0xb94b('0x44')]({},_0x708b2a,_0xc9e0f4[_0xb94b('0x4e')]);return db[_0xb94b('0x48')]['find'](_0x708b2a)[_0xb94b('0x33')](handleEntityNotFound(_0x56b286,null))[_0xb94b('0x33')](respondWithResult(_0x56b286,null))['catch'](handleError(_0x56b286,null));};exports[_0xb94b('0x4f')]=function(_0x619166,_0x5cee82){if(_0x619166[_0xb94b('0x50')]['id']){delete _0x619166[_0xb94b('0x50')]['id'];}return db['FaxMessage'][_0xb94b('0x51')]({'where':{'id':_0x619166[_0xb94b('0x52')]['id']}})[_0xb94b('0x33')](handleEntityNotFound(_0x5cee82,null))[_0xb94b('0x33')](saveUpdates(_0x619166['body'],null))[_0xb94b('0x33')](respondWithResult(_0x5cee82,null))[_0xb94b('0x27')](handleError(_0x5cee82,null));};exports[_0xb94b('0x53')]=function(_0x9847a4,_0x3677fe){return db[_0xb94b('0x48')]['find']({'where':{'id':_0x9847a4['params']['id']}})[_0xb94b('0x33')](handleEntityNotFound(_0x3677fe,null))[_0xb94b('0x33')](removeEntity(_0x3677fe,null))['catch'](handleError(_0x3677fe,null));};exports[_0xb94b('0x54')]=function(_0x73e126,_0x3f8f9e){return db[_0xb94b('0x48')][_0xb94b('0x54')]()['then'](respondWithResult(_0x3f8f9e,null))['catch'](handleError(_0x3f8f9e,null));};var interaction_log=require(_0xb94b('0x13'))(_0xb94b('0x55'));exports['accept']=function(_0x348063,_0x9847ed,_0x172234){var _0x5c79fe={'agent':{},'channel':_0xb94b('0x56')};if(_0x348063[_0xb94b('0x50')]['id']){delete _0x348063[_0xb94b('0x50')]['id'];}_0x348063[_0xb94b('0x50')]['read']=!![];_0x348063[_0xb94b('0x50')]['readAt']=moment()[_0xb94b('0x57')](_0xb94b('0x58'));_0x348063[_0xb94b('0x50')]['UserId']=_0x348063[_0xb94b('0x50')]['UserId']||_0x348063[_0xb94b('0x59')]['id'];_0x5c79fe[_0xb94b('0x5a')]['id']=_0x348063[_0xb94b('0x50')]['UserId'];return db['FaxMessage'][_0xb94b('0x51')]({'where':{'id':_0x348063[_0xb94b('0x52')]['id'],'UserId':null}})[_0xb94b('0x33')](handleEntityNotFound(_0x9847ed,null))[_0xb94b('0x33')](saveUpdates(_0x348063[_0xb94b('0x50')],null))[_0xb94b('0x33')](function(_0x5e483d){if(_0x5e483d){_0x5c79fe[_0xb94b('0x25')]=_0x5e483d[_0xb94b('0x5b')]({'plain':!![]});return db['FaxInteraction'][_0xb94b('0x51')]({'where':{'id':_0x5e483d['FaxInteractionId']}});}return null;})[_0xb94b('0x33')](handleEntityNotFound(_0x9847ed,null))['then'](function(_0x38cbdd){if(_0x38cbdd){return _0x38cbdd[_0xb94b('0x4f')]({'UserId':_0x348063['body'][_0xb94b('0x5c')],'read1stAt':_['isNil'](_0x38cbdd['read1stAt'])?moment()[_0xb94b('0x57')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb94b('0x33')](function(_0x4a6185){if(_0x4a6185){_0x5c79fe[_0xb94b('0x5d')]=_0x4a6185['get']({'plain':!![]});interaction_log[_0xb94b('0x26')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x348063[_0xb94b('0x59')]['id'],_0x348063[_0xb94b('0x59')]['name'],_0x348063[_0xb94b('0x59')]['role'],_0x5c79fe[_0xb94b('0x5d')]['id'],_0x348063[_0xb94b('0x50')]?JSON[_0xb94b('0x22')](_0x348063[_0xb94b('0x50')]):_0xb94b('0x5e'));return respondWithRpcPromise(_0xb94b('0x5f'),_0xb94b('0x60'),_0x5c79fe);}return null;})[_0xb94b('0x33')](function(_0x19a810){var _0x4b308c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x19a810['message'][_0xb94b('0x61')];return db[_0xb94b('0x62')][_0xb94b('0x39')](_0x4b308c,{'type':db[_0xb94b('0x63')]['QueryTypes']['SELECT'],'raw':!![]})[_0xb94b('0x33')](function(_0x4ce3d3){return _0x4ce3d3;});})[_0xb94b('0x33')](function(_0x4dd5a1){if(_0x4dd5a1){_0x5c79fe['message'][_0xb94b('0x64')]=_0x4dd5a1[0x0];if(!_0x348063[_0xb94b('0x50')]['UserId'])return;return db['User']['find']({'where':{'id':_0x348063[_0xb94b('0x50')][_0xb94b('0x5c')],'role':'agent'},'attributes':['id',_0xb94b('0x34'),_0xb94b('0x65'),_0xb94b('0x66'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4d33a5){if(!_0x4d33a5)return null;_0x5c79fe[_0xb94b('0x25')][_0xb94b('0x5a')]=_0x4d33a5;return _0x5c79fe;})[_0xb94b('0x33')](function(_0x415c46){if(_0x415c46){if(_0x348063['body'][_0xb94b('0x67')]){_0x5c79fe[_0xb94b('0x25')]['interface']=util['format'](_0xb94b('0x68'),_0x348063['user'][_0xb94b('0x34')]);_0x5c79fe[_0xb94b('0x25')][_0xb94b('0x69')]=_0x5c79fe[_0xb94b('0x69')];_0x5c79fe[_0xb94b('0x25')]['motionChannel']=_0x5c79fe[_0xb94b('0x69')];_0x5c79fe['message'][_0xb94b('0x6a')]=_0xb94b('0x6b');return respondWithRpcPromise('EventManager',_0xb94b('0x6c'),{'event':'acceptmessage','message':_0x5c79fe[_0xb94b('0x25')]},client9002)['then'](function(){return _0x5c79fe;});}return _0x5c79fe;}return null;})[_0xb94b('0x33')](respondWithResult(_0x9847ed,null))[_0xb94b('0x27')](handleError(_0x9847ed,null));};var interaction_log=require(_0xb94b('0x13'))('fax-interactions');exports[_0xb94b('0x31')]=function(_0x400e9f,_0x1c97fa,_0x2a69fe){var _0x56d199={'agent':{},'channel':_0xb94b('0x56')};if(_0x400e9f[_0xb94b('0x50')]['id']){delete _0x400e9f['body']['id'];}_0x400e9f[_0xb94b('0x50')][_0xb94b('0x5c')]=_0x400e9f[_0xb94b('0x50')][_0xb94b('0x5c')]||_0x400e9f['user']['id'];_0x56d199['agent']['id']=_0x400e9f[_0xb94b('0x50')][_0xb94b('0x5c')];return db[_0xb94b('0x48')][_0xb94b('0x51')]({'where':{'id':_0x400e9f[_0xb94b('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1c97fa,null))[_0xb94b('0x33')](function(_0x5a57f3){if(_0x5a57f3){_0x56d199[_0xb94b('0x25')]=_0x5a57f3[_0xb94b('0x5b')]({'plain':!![]});return db[_0xb94b('0x6d')][_0xb94b('0x51')]({'where':{'id':_0x5a57f3[_0xb94b('0x6e')]}});}return null;})[_0xb94b('0x33')](handleEntityNotFound(_0x1c97fa,null))[_0xb94b('0x33')](function(_0x58bfd6){if(_0x58bfd6){_0x56d199[_0xb94b('0x5d')]=_0x58bfd6[_0xb94b('0x5b')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x400e9f[_0xb94b('0x59')]['id'],_0x400e9f[_0xb94b('0x59')][_0xb94b('0x34')],_0x400e9f['user'][_0xb94b('0x6f')],_0x56d199['interaction']['id'],_0x400e9f[_0xb94b('0x50')]?JSON[_0xb94b('0x22')](_0x400e9f[_0xb94b('0x50')]):_0xb94b('0x5e'));return respondWithRpcPromise('RejectMessage',_0xb94b('0x70'),_0x56d199);}return null;})[_0xb94b('0x33')](function(_0x1fabf0){var _0x1637b9=_0xb94b('0x71')+_0x1fabf0[_0xb94b('0x25')]['ContactId'];return db[_0xb94b('0x62')][_0xb94b('0x39')](_0x1637b9,{'type':db[_0xb94b('0x63')][_0xb94b('0x72')][_0xb94b('0x73')],'raw':!![]})['then'](function(_0x303d6f){return _0x303d6f;});})[_0xb94b('0x33')](function(_0x447a7e){if(_0x447a7e){_0x56d199[_0xb94b('0x25')]['contact']=_0x447a7e[0x0];if(!_0x400e9f[_0xb94b('0x50')][_0xb94b('0x5c')])return;return db[_0xb94b('0x74')][_0xb94b('0x51')]({'where':{'id':_0x400e9f[_0xb94b('0x50')]['UserId'],'role':'agent'},'attributes':['id','name',_0xb94b('0x65'),_0xb94b('0x66'),_0xb94b('0x75')],'raw':!![]});}return null;})[_0xb94b('0x33')](function(_0x45728b){if(!_0x45728b)return null;_0x56d199[_0xb94b('0x25')]['agent']=_0x45728b;return _0x56d199;})['then'](function(_0x2c6eac){if(_0x2c6eac){_0x2c6eac[_0xb94b('0x25')][_0xb94b('0x76')]=util[_0xb94b('0x57')](_0xb94b('0x68'),_0x400e9f['user']['name']);_0x2c6eac[_0xb94b('0x25')][_0xb94b('0x69')]=_0x56d199[_0xb94b('0x69')];_0x2c6eac['message'][_0xb94b('0x77')]=_0x56d199['channel'];_0x2c6eac[_0xb94b('0x25')][_0xb94b('0x6a')]=_0xb94b('0x31');respondWithRpcPromise('EventManager',_0xb94b('0x6c'),{'event':_0xb94b('0x78'),'message':_0x2c6eac['message']},client9002);return _0x56d199;}return null;})[_0xb94b('0x33')](respondWithResult(_0x1c97fa,null))[_0xb94b('0x27')](handleError(_0x1c97fa,null));};exports[_0xb94b('0x79')]=function(_0x364b7d,_0x14f65f){var _0x4ba6c7;return db[_0xb94b('0x48')][_0xb94b('0x79')](_0x364b7d[_0xb94b('0x50')],{})[_0xb94b('0x33')](function(_0x1dd8a2){_0x4ba6c7=_0x1dd8a2;return db[_0xb94b('0x7a')]['findOne']({'where':{'id':_0x4ba6c7[_0xb94b('0x61')]}});})[_0xb94b('0x33')](function(_0x43806a){if(_[_0xb94b('0x7b')](_0x43806a)){return;}else{_0x4ba6c7[_0xb94b('0x56')]=_0x43806a['fax'];return db['Attachment'][_0xb94b('0x7c')]({'where':{'id':_0x4ba6c7[_0xb94b('0x7d')]}});}})[_0xb94b('0x33')](function(_0x596b1e){return respondWithRpcPromise('SendFax',_0xb94b('0x7e'),{'FaxAccountId':_['isNil'](_0x364b7d[_0xb94b('0x50')])?undefined:_0x364b7d['body'][_0xb94b('0x7f')],'path':_[_0xb94b('0x7b')](_0x596b1e)?undefined:util[_0xb94b('0x57')](_0xb94b('0x80'),_0x596b1e[_0xb94b('0x81')]),'fax':_[_0xb94b('0x7b')](_0x4ba6c7[_0xb94b('0x56')])?undefined:_0x4ba6c7['fax'],'AttachmentId':_0x4ba6c7[_0xb94b('0x7d')]},client9002);})[_0xb94b('0x33')](respondWithResult(_0x14f65f,0xc9))[_0xb94b('0x27')](handleError(_0x14f65f,null));};exports[_0xb94b('0x82')]=function(_0x2a417a,_0x14ef1b){var _0x105201=path[_0xb94b('0x83')](config['root'],_0xb94b('0x84'),'files',_0xb94b('0x85'));return db[_0xb94b('0x48')][_0xb94b('0x51')]({'where':{'id':_0x2a417a['params']['id']},'include':[{'model':db[_0xb94b('0x86')],'as':_0xb94b('0x86')}]})[_0xb94b('0x33')](handleEntityNotFound(_0x14ef1b,null))[_0xb94b('0x33')](function(_0x521df8){if(_0x521df8){return _0x14ef1b['download'](path[_0xb94b('0x83')](_0x105201,_0x521df8[_0xb94b('0x86')]['basename']));}})[_0xb94b('0x27')](handleError(_0x14ef1b,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index a3b218e..de9330a 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 _0x600f=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','save'];(function(_0xde910e,_0x22f948){var _0x506e0a=function(_0x5170f1){while(--_0x5170f1){_0xde910e['push'](_0xde910e['shift']());}};_0x506e0a(++_0x22f948);}(_0x600f,0xb4));var _0xf600=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x600f[_0x4358f5];return _0x4d8104;};'use strict';var EventEmitter=require(_0xf600('0x0'));var FaxMessage=require(_0xf600('0x1'))['db'][_0xf600('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf600('0x3'),'afterUpdate':'update','afterDestroy':_0xf600('0x4')};function emitEvent(_0x3d117d){return function(_0x1b8de0,_0x181497,_0x41ad01){FaxMessageEvents[_0xf600('0x5')](_0x3d117d+':'+_0x1b8de0['id'],_0x1b8de0);FaxMessageEvents[_0xf600('0x5')](_0x3d117d,_0x1b8de0);_0x41ad01(null);};}for(var e in events){if(events[_0xf600('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xf600('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xab00=['exports','events','../../mysqldb','FaxMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1384bd,_0xca0b27){var _0x1bbc4e=function(_0x1904b2){while(--_0x1904b2){_0x1384bd['push'](_0x1384bd['shift']());}};_0x1bbc4e(++_0xca0b27);}(_0xab00,0x1b9));var _0x0ab0=function(_0x76ba6d,_0x3c8047){_0x76ba6d=_0x76ba6d-0x0;var _0x5dab9e=_0xab00[_0x76ba6d];return _0x5dab9e;};'use strict';var EventEmitter=require(_0x0ab0('0x0'));var FaxMessage=require(_0x0ab0('0x1'))['db'][_0x0ab0('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ab0('0x3'),'afterUpdate':_0x0ab0('0x4'),'afterDestroy':_0x0ab0('0x5')};function emitEvent(_0x4d440a){return function(_0x2e4731,_0x4b8205,_0x1bc77d){FaxMessageEvents[_0x0ab0('0x6')](_0x4d440a+':'+_0x2e4731['id'],_0x2e4731);FaxMessageEvents[_0x0ab0('0x6')](_0x4d440a,_0x2e4731);_0x1bc77d(null);};}for(var e in events){if(events[_0x0ab0('0x7')](e)){var event=events[e];FaxMessage[_0x0ab0('0x8')](e,emitEvent(event));}}module[_0x0ab0('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 95cd17a..887ec26 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 _0x4b63=['./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x1a6402,_0x59e768){var _0x51f899=function(_0x42112c){while(--_0x42112c){_0x1a6402['push'](_0x1a6402['shift']());}};_0x51f899(++_0x59e768);}(_0x4b63,0xa7));var _0x34b6=function(_0x37c0db,_0x50f16d){_0x37c0db=_0x37c0db-0x0;var _0x40024b=_0x4b63[_0x37c0db];return _0x40024b;};'use strict';var _=require(_0x34b6('0x0'));var util=require(_0x34b6('0x1'));var logger=require(_0x34b6('0x2'))(_0x34b6('0x3'));var moment=require('moment');var BPromise=require(_0x34b6('0x4'));var rp=require(_0x34b6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x34b6('0x6'));var attributes=require(_0x34b6('0x7'));module[_0x34b6('0x8')]=function(_0x3a2875,_0x24a81e){return _0x3a2875[_0x34b6('0x9')]('FaxMessage',attributes,{'tableName':_0x34b6('0xa'),'paranoid':![],'indexes':[{'name':_0x34b6('0xb'),'fields':[_0x34b6('0xc')],'type':_0x34b6('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40a75,_0x6bf0f1,_0x2b7671){var _0x48beb1=_0x3a2875[_0x34b6('0xe')];var _0x110a3e=_0x40a75[_0x34b6('0xf')]({'plain':!![]});if(_0x110a3e[_0x34b6('0x10')][_0x34b6('0x11')]()==='in'||_0x110a3e[_0x34b6('0x10')][_0x34b6('0x11')]()===_0x34b6('0x12')&&!_0x110a3e[_0x34b6('0x13')]&&!_[_0x34b6('0x14')](_0x110a3e[_0x34b6('0x15')])){_0x48beb1['FaxInteraction']['findOne']({'where':{'id':_0x110a3e[_0x34b6('0x16')]}})[_0x34b6('0x17')](function(_0x1e615c){if(_0x1e615c){_0x1e615c[_0x34b6('0x18')]({'lastMsgAt':_0x110a3e[_0x34b6('0x19')],'lastMsgDirection':_0x110a3e[_0x34b6('0x10')][_0x34b6('0x11')]()});}})[_0x34b6('0x1a')](function(_0x5576c3){console[_0x34b6('0x1b')](_0x5576c3);});}_0x2b7671();}},'charset':'utf8mb4','collate':_0x34b6('0x1c')});}; \ No newline at end of file +var _0x1813=['update','createdAt','error','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','models','get','direction','toLowerCase','out','secret','UserId','findOne','FaxInteractionId','then'];(function(_0x4e99e5,_0x4dc447){var _0x56bf1c=function(_0x4c2a7f){while(--_0x4c2a7f){_0x4e99e5['push'](_0x4e99e5['shift']());}};_0x56bf1c(++_0x4dc447);}(_0x1813,0xba));var _0x3181=function(_0x3fcef8,_0x370e83){_0x3fcef8=_0x3fcef8-0x0;var _0x4e2f94=_0x1813[_0x3fcef8];return _0x4e2f94;};'use strict';var _=require('lodash');var util=require(_0x3181('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3181('0x1'));var BPromise=require(_0x3181('0x2'));var rp=require(_0x3181('0x3'));var fs=require('fs');var path=require(_0x3181('0x4'));var rimraf=require(_0x3181('0x5'));var config=require(_0x3181('0x6'));var attributes=require('./faxMessage.attributes');module[_0x3181('0x7')]=function(_0x503009,_0x5ed29d){return _0x503009[_0x3181('0x8')](_0x3181('0x9'),attributes,{'tableName':_0x3181('0xa'),'paranoid':![],'indexes':[{'name':_0x3181('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xdbc923,_0x568e43,_0x480f32){var _0x1f6cbf=_0x503009[_0x3181('0xc')];var _0x29ab68=_0xdbc923[_0x3181('0xd')]({'plain':!![]});if(_0x29ab68['direction']['toLowerCase']()==='in'||_0x29ab68[_0x3181('0xe')][_0x3181('0xf')]()===_0x3181('0x10')&&!_0x29ab68[_0x3181('0x11')]&&!_['isNil'](_0x29ab68[_0x3181('0x12')])){_0x1f6cbf['FaxInteraction'][_0x3181('0x13')]({'where':{'id':_0x29ab68[_0x3181('0x14')]}})[_0x3181('0x15')](function(_0x5dd70a){if(_0x5dd70a){_0x5dd70a[_0x3181('0x16')]({'lastMsgAt':_0x29ab68[_0x3181('0x17')],'lastMsgDirection':_0x29ab68[_0x3181('0xe')][_0x3181('0xf')]()});}})['catch'](function(_0x463a82){console[_0x3181('0x18')](_0x463a82);});}_0x480f32();}},'charset':'utf8mb4','collate':_0x3181('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index da64c52..61ba297 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 _0x7bae=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxMessage,\x20%s,\x20%s','create','body','options','raw','CreateFaxMessage','debug','FaxMessage','update','where','limit','UpdateFaxMessage','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7bae[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});config[_0xe7ba('0xa')]=_[_0xe7ba('0xb')](config[_0xe7ba('0xa')],{'host':_0xe7ba('0xc'),'port':0x18eb});var socket=require(_0xe7ba('0xd'))(new Redis(config[_0xe7ba('0xa')]));require(_0xe7ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3df8bf,_0xe57e33,_0x375ebb){return new BPromise(function(_0x276bc3,_0x15083a){return client[_0xe7ba('0xf')](_0x3df8bf,_0x375ebb)[_0xe7ba('0x10')](function(_0x448bcc){logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0xe7ba('0x12'));logger['debug'](_0xe7ba('0x13'),_0xe57e33,_0xe7ba('0x12'),JSON[_0xe7ba('0x14')](_0x448bcc));if(_0x448bcc[_0xe7ba('0x15')]){if(_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x16')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x17')]);return _0x15083a(_0x448bcc[_0xe7ba('0x15')]['message']);}logger[_0xe7ba('0x15')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc['error']['message']);return _0x276bc3(_0x448bcc[_0xe7ba('0x15')]['message']);}else{logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,'request\x20sent');_0x276bc3(_0x448bcc['result'][_0xe7ba('0x17')]);}})[_0xe7ba('0x18')](function(_0x39ca38){logger[_0xe7ba('0x15')](_0xe7ba('0x19'),_0xe57e33,_0x39ca38);_0x15083a(_0x39ca38);});});}exports['CreateFaxMessage']=function(_0x149c62){var _0x20c653=this;return new Promise(function(_0x3b40fb,_0x136ec6){return db['FaxMessage'][_0xe7ba('0x1a')](_0x149c62[_0xe7ba('0x1b')],{'raw':_0x149c62['options']?_0x149c62[_0xe7ba('0x1c')][_0xe7ba('0x1d')]===undefined?!![]:![]:!![]})[_0xe7ba('0x10')](function(_0x7ab9e4){logger[_0xe7ba('0x11')](_0xe7ba('0x1e'),_0x149c62);logger[_0xe7ba('0x1f')](_0xe7ba('0x1e'),_0x149c62,JSON[_0xe7ba('0x14')](_0x7ab9e4));_0x3b40fb(_0x7ab9e4);})[_0xe7ba('0x18')](function(_0x58cf43){logger['error']('CreateFaxMessage',_0x58cf43['message'],_0x149c62);_0x136ec6(_0x20c653[_0xe7ba('0x15')](0x1f4,_0x58cf43['message']));});});};exports['UpdateFaxMessage']=function(_0x5ece11){var _0x255def=this;return new Promise(function(_0x32cc00,_0xe32862){return db[_0xe7ba('0x20')][_0xe7ba('0x21')](_0x5ece11[_0xe7ba('0x1b')],{'raw':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11['options'][_0xe7ba('0x22')]||null:null,'attributes':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['attributes']||null:null,'limit':_0x5ece11['options']?_0x5ece11[_0xe7ba('0x1c')][_0xe7ba('0x23')]||null:null})[_0xe7ba('0x10')](function(_0x20b6cd){logger[_0xe7ba('0x11')]('UpdateFaxMessage',_0x5ece11);logger[_0xe7ba('0x1f')](_0xe7ba('0x24'),_0x5ece11,JSON['stringify'](_0x20b6cd));_0x32cc00(_0x20b6cd);})[_0xe7ba('0x18')](function(_0x530227){logger['error'](_0xe7ba('0x24'),_0x530227[_0xe7ba('0x17')],_0x5ece11);_0xe32862(_0x255def[_0xe7ba('0x15')](0x1f4,_0x530227['message']));});});}; \ No newline at end of file +var _0x008c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','options','raw','then','CreateFaxMessage','attributes','limit','UpdateFaxMessage','stringify','lodash','util','moment','bluebird'];(function(_0x435821,_0xeed5fc){var _0x5284ad=function(_0x2eed9){while(--_0x2eed9){_0x435821['push'](_0x435821['shift']());}};_0x5284ad(++_0xeed5fc);}(_0x008c,0x188));var _0xc008=function(_0x2f3738,_0x115a52){_0x2f3738=_0x2f3738-0x0;var _0x3dfa2c=_0x008c[_0x2f3738];return _0x3dfa2c;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});config[_0xc008('0xd')]=_['defaults'](config[_0xc008('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc008('0xe'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xc008('0xf')](socket);function respondWithRpcPromise(_0x7231b4,_0x57c46d,_0x51ba7d){return new BPromise(function(_0x543eb8,_0x1eacfa){return client[_0xc008('0x10')](_0x7231b4,_0x51ba7d)['then'](function(_0xae2dab){logger[_0xc008('0x11')](_0xc008('0x12'),_0x57c46d,_0xc008('0x13'));logger[_0xc008('0x14')](_0xc008('0x15'),_0x57c46d,_0xc008('0x13'),JSON['stringify'](_0xae2dab));if(_0xae2dab['error']){if(_0xae2dab[_0xc008('0x16')]['code']===0x1f4){logger[_0xc008('0x16')](_0xc008('0x12'),_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x1eacfa(_0xae2dab[_0xc008('0x16')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x543eb8(_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x57c46d,'request\x20sent');_0x543eb8(_0xae2dab['result'][_0xc008('0x17')]);}})[_0xc008('0x18')](function(_0x501137){logger[_0xc008('0x16')]('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0x501137);_0x1eacfa(_0x501137);});});}exports['CreateFaxMessage']=function(_0x543e5d){var _0x50261c=this;return new Promise(function(_0x5754a0,_0x4b9726){return db['FaxMessage']['create'](_0x543e5d['body'],{'raw':_0x543e5d['options']?_0x543e5d[_0xc008('0x19')][_0xc008('0x1a')]===undefined?!![]:![]:!![]})[_0xc008('0x1b')](function(_0x415af3){logger[_0xc008('0x11')](_0xc008('0x1c'),_0x543e5d);logger['debug'](_0xc008('0x1c'),_0x543e5d,JSON['stringify'](_0x415af3));_0x5754a0(_0x415af3);})['catch'](function(_0x218599){logger[_0xc008('0x16')](_0xc008('0x1c'),_0x218599[_0xc008('0x17')],_0x543e5d);_0x4b9726(_0x50261c['error'](0x1f4,_0x218599['message']));});});};exports['UpdateFaxMessage']=function(_0x3f7b07){var _0x15dade=this;return new Promise(function(_0x92c582,_0x2e31c2){return db['FaxMessage']['update'](_0x3f7b07['body'],{'raw':_0x3f7b07['options']?_0x3f7b07['options'][_0xc008('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')]['where']||null:null,'attributes':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')][_0xc008('0x1d')]||null:null,'limit':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07['options'][_0xc008('0x1e')]||null:null})[_0xc008('0x1b')](function(_0x53ed35){logger['info']('UpdateFaxMessage',_0x3f7b07);logger[_0xc008('0x14')](_0xc008('0x1f'),_0x3f7b07,JSON[_0xc008('0x20')](_0x53ed35));_0x92c582(_0x53ed35);})[_0xc008('0x18')](function(_0x1de04b){logger[_0xc008('0x16')](_0xc008('0x1f'),_0x1de04b[_0xc008('0x17')],_0x3f7b07);_0x2e31c2(_0x15dade[_0xc008('0x16')](0x1f4,_0x1de04b[_0xc008('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d88639f..5189f2e 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 _0x049f=['register','faxMessage:','./faxMessage.events','save','update'];(function(_0x57969c,_0x225bd6){var _0x239237=function(_0x28ea38){while(--_0x28ea38){_0x57969c['push'](_0x57969c['shift']());}};_0x239237(++_0x225bd6);}(_0x049f,0x16f));var _0xf049=function(_0x3bee55,_0x4e25c8){_0x3bee55=_0x3bee55-0x0;var _0x5649d2=_0x049f[_0x3bee55];return _0x5649d2;};'use strict';var FaxMessageEvents=require(_0xf049('0x0'));var events=[_0xf049('0x1'),'remove',_0xf049('0x2')];function createListener(_0x9adb62,_0x4c6bcc){return function(_0x11dcc4){_0x4c6bcc['emit'](_0x9adb62,_0x11dcc4);};}function removeListener(_0x46cb26,_0xa5655d){return function(){FaxMessageEvents['removeListener'](_0x46cb26,_0xa5655d);};}exports[_0xf049('0x3')]=function(_0x5743ce){for(var _0x667f4e=0x0,_0x54f310=events['length'];_0x667f4e<_0x54f310;_0x667f4e++){var _0x2e7b12=events[_0x667f4e];var _0x16b76b=createListener(_0xf049('0x4')+_0x2e7b12,_0x5743ce);FaxMessageEvents['on'](_0x2e7b12,_0x16b76b);}}; \ No newline at end of file +var _0x2b84=['removeListener','register','length','./faxMessage.events','save','remove','update','emit'];(function(_0x40ca3c,_0x484cf7){var _0x2887a8=function(_0x3869d8){while(--_0x3869d8){_0x40ca3c['push'](_0x40ca3c['shift']());}};_0x2887a8(++_0x484cf7);}(_0x2b84,0x173));var _0x42b8=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x2b84[_0x3ab9ee];return _0x82ee88;};'use strict';var FaxMessageEvents=require(_0x42b8('0x0'));var events=[_0x42b8('0x1'),_0x42b8('0x2'),_0x42b8('0x3')];function createListener(_0x2df46d,_0x164f2a){return function(_0x555e88){_0x164f2a[_0x42b8('0x4')](_0x2df46d,_0x555e88);};}function removeListener(_0x33f8df,_0x2a8a66){return function(){FaxMessageEvents[_0x42b8('0x5')](_0x33f8df,_0x2a8a66);};}exports[_0x42b8('0x6')]=function(_0x46ca94){for(var _0x574d5a=0x0,_0x200f9d=events[_0x42b8('0x7')];_0x574d5a<_0x200f9d;_0x574d5a++){var _0x4caaf6=events[_0x574d5a];var _0x3e6550=createListener('faxMessage:'+_0x4caaf6,_0x46ca94);FaxMessageEvents['on'](_0x4caaf6,_0x3e6550);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a5912c0..d8a70d6 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 _0xc874=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','tracked','faxmessage:create','create','put','accept','/:id/reject','reject','delete'];(function(_0x50b562,_0xd8b88d){var _0x394088=function(_0x10d143){while(--_0x10d143){_0x50b562['push'](_0x50b562['shift']());}};_0x394088(++_0xd8b88d);}(_0xc874,0x154));var _0x4c87=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0xc874[_0xb99421];return _0x4b3ec7;};'use strict';var multer=require(_0x4c87('0x0'));var util=require('util');var path=require(_0x4c87('0x1'));var timeout=require(_0x4c87('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4c87('0x3'));var auth=require(_0x4c87('0x4'));var interaction=require(_0x4c87('0x5'));var config=require('../../config/environment');var controller=require(_0x4c87('0x6'));router[_0x4c87('0x7')]('/',auth['isAuthenticated'](),controller[_0x4c87('0x8')]);router[_0x4c87('0x7')](_0x4c87('0x9'),auth[_0x4c87('0xa')](),controller[_0x4c87('0xb')]);router['get'](_0x4c87('0xc'),auth['isAuthenticated'](),controller[_0x4c87('0xd')]);router[_0x4c87('0x7')](_0x4c87('0xe'),auth[_0x4c87('0xa')](),controller[_0x4c87('0xf')]);router['post']('/',auth[_0x4c87('0xa')](),interaction[_0x4c87('0x10')]('fax',_0x4c87('0x11')),controller[_0x4c87('0x12')]);router[_0x4c87('0x13')](_0x4c87('0xc'),auth[_0x4c87('0xa')](),controller['update']);router['put']('/:id/accept',auth[_0x4c87('0xa')](),controller[_0x4c87('0x14')]);router[_0x4c87('0x13')](_0x4c87('0x15'),auth[_0x4c87('0xa')](),controller[_0x4c87('0x16')]);router[_0x4c87('0x17')](_0x4c87('0xc'),auth['isAuthenticated'](),controller[_0x4c87('0x18')]);module[_0x4c87('0x19')]=router; \ No newline at end of file +var _0xb49a=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post','tracked','fax','create'];(function(_0x194310,_0x4528da){var _0x40af3f=function(_0xbea095){while(--_0xbea095){_0x194310['push'](_0x194310['shift']());}};_0x40af3f(++_0x4528da);}(_0xb49a,0xfb));var _0xab49=function(_0x3e9903,_0x3ec512){_0x3e9903=_0x3e9903-0x0;var _0xcab758=_0xb49a[_0x3e9903];return _0xcab758;};'use strict';var multer=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var path=require(_0xab49('0x2'));var timeout=require(_0xab49('0x3'));var express=require(_0xab49('0x4'));var router=express['Router']();var fs_extra=require(_0xab49('0x5'));var auth=require(_0xab49('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab49('0x7'));router[_0xab49('0x8')]('/',auth[_0xab49('0x9')](),controller[_0xab49('0xa')]);router[_0xab49('0x8')](_0xab49('0xb'),auth[_0xab49('0x9')](),controller['describe']);router[_0xab49('0x8')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0xd')]);router[_0xab49('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xab49('0xe')]);router[_0xab49('0xf')]('/',auth[_0xab49('0x9')](),interaction[_0xab49('0x10')](_0xab49('0x11'),'faxmessage:create'),controller[_0xab49('0x12')]);router[_0xab49('0x13')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x14')]);router[_0xab49('0x13')](_0xab49('0x15'),auth[_0xab49('0x9')](),controller[_0xab49('0x16')]);router[_0xab49('0x13')](_0xab49('0x17'),auth['isAuthenticated'](),controller[_0xab49('0x18')]);router[_0xab49('0x19')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index e2e622a..11c94ee 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 _0xc87b=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x574ea0,_0x504380){var _0x5ecc84=function(_0x1cfa84){while(--_0x1cfa84){_0x574ea0['push'](_0x574ea0['shift']());}};_0x5ecc84(++_0x504380);}(_0xc87b,0x1a3));var _0xbc87=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xc87b[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0xbc87('0x0'));module[_0xbc87('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbc87('0x2')]},'timeout':{'type':Sequelize[_0xbc87('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbc87('0x4')](_0xbc87('0x5'),_0xbc87('0x6'),_0xbc87('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbc87('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe86b=['beepall','roundrobin','sequelize','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x4c6e50,_0x3044f5){var _0x25690f=function(_0x4b1317){while(--_0x4b1317){_0x4c6e50['push'](_0x4c6e50['shift']());}};_0x25690f(++_0x3044f5);}(_0xe86b,0x182));var _0xbe86=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe86b[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xbe86('0x0'));module[_0xbe86('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbe86('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xbe86('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbe86('0x4')](_0xbe86('0x5'),_0xbe86('0x6'),_0xbe86('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbe86('0x3')],'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 3f78df9..67aa6e4 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 _0x692d=['userFaxQueue:save','ids','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','fast-json-patch','mustache','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','redis','./faxQueue.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','FaxQueues','error','stack','name','index','map','FaxQueue','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit'];(function(_0x4b7565,_0x5e2f30){var _0x6154d3=function(_0xd382b7){while(--_0xd382b7){_0x4b7565['push'](_0x4b7565['shift']());}};_0x6154d3(++_0x5e2f30);}(_0x692d,0xa8));var _0xd692=function(_0x55e549,_0x1064c0){_0x55e549=_0x55e549-0x0;var _0x189e20=_0x692d[_0x55e549];return _0x189e20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd692('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd692('0x1'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd692('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd692('0x3'));var _=require('lodash');var squel=require(_0xd692('0x4'));var crypto=require(_0xd692('0x5'));var jsforce=require('jsforce');var deskjs=require(_0xd692('0x6'));var toCsv=require(_0xd692('0x2'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd692('0x7'));var authService=require(_0xd692('0x8'));var qs=require(_0xd692('0x9'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd692('0xa'));var logger=require('../../config/logger')(_0xd692('0xb'));var utils=require(_0xd692('0xc'));var config=require('../../config/environment');var licenseUtil=require(_0xd692('0xd'));var db=require(_0xd692('0xe'))['db'];config['redis']=_[_0xd692('0xf')](config['redis'],{'host':_0xd692('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd692('0x11')]));require(_0xd692('0x12'))[_0xd692('0x13')](socket);function respondWithStatusCode(_0x18de29,_0x467081){_0x467081=_0x467081||0xcc;return function(_0xc25025){if(_0xc25025){return _0x18de29[_0xd692('0x14')](_0x467081);}return _0x18de29['status'](_0x467081)[_0xd692('0x15')]();};}function respondWithResult(_0x184e5d,_0x4e5a89){_0x4e5a89=_0x4e5a89||0xc8;return function(_0x1e5466){if(_0x1e5466){return _0x184e5d[_0xd692('0x16')](_0x4e5a89)['json'](_0x1e5466);}};}function respondWithFilteredResult(_0x4e801c,_0x37ebaf){return function(_0x216883){if(_0x216883){var _0x58c1d8=typeof _0x37ebaf[_0xd692('0x17')]===_0xd692('0x18')&&typeof _0x37ebaf['limit']===_0xd692('0x18');var _0x2aa9d8=_0x216883[_0xd692('0x19')];var _0x2965df=_0x58c1d8?0x0:_0x37ebaf['offset'];var _0x38a87f=_0x58c1d8?_0x216883[_0xd692('0x19')]:_0x37ebaf[_0xd692('0x17')]+_0x37ebaf[_0xd692('0x1a')];var _0x1034d7;if(_0x38a87f>=_0x2aa9d8){_0x38a87f=_0x2aa9d8;_0x1034d7=0xc8;}else{_0x1034d7=0xce;}_0x4e801c['status'](_0x1034d7);return _0x4e801c[_0xd692('0x1b')](_0xd692('0x1c'),_0x2965df+'-'+_0x38a87f+'/'+_0x2aa9d8)['json'](_0x216883);}return null;};}function patchUpdates(_0x4c04a5){return function(_0x1784cf){try{jsonpatch['apply'](_0x1784cf,_0x4c04a5,!![]);}catch(_0x524189){return BPromise[_0xd692('0x1d')](_0x524189);}return _0x1784cf[_0xd692('0x1e')]();};}function saveUpdates(_0x45c506,_0x5cfb47){return function(_0x35fa59){if(_0x35fa59){return _0x35fa59[_0xd692('0x1f')](_0x45c506)['then'](function(_0x464938){return _0x464938;});}return null;};}function removeEntity(_0x350026,_0x44a5f9){return function(_0x45eaa1){if(_0x45eaa1){return _0x45eaa1[_0xd692('0x20')]()[_0xd692('0x21')](function(){var _0x2ab344=_0x45eaa1[_0xd692('0x22')]({'plain':!![]});var _0x1aa5c7=_0xd692('0x23');return db['UserProfileResource'][_0xd692('0x20')]({'where':{'type':_0x1aa5c7,'resourceId':_0x2ab344['id']}})[_0xd692('0x21')](function(){return _0x45eaa1;});})[_0xd692('0x21')](function(){_0x350026[_0xd692('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x391790,_0x4601fd){return function(_0x1c176b){if(!_0x1c176b){_0x391790[_0xd692('0x14')](0x194);}return _0x1c176b;};}function handleError(_0x2efb26,_0x5d6bf4){_0x5d6bf4=_0x5d6bf4||0x1f4;return function(_0x5cacf3){logger[_0xd692('0x24')](_0x5cacf3[_0xd692('0x25')]);if(_0x5cacf3['name']){delete _0x5cacf3[_0xd692('0x26')];}_0x2efb26['status'](_0x5d6bf4)['send'](_0x5cacf3);};}exports[_0xd692('0x27')]=function(_0x342823,_0x366cbb){var _0x267ec8={},_0x19ea48={},_0x4edc91={'count':0x0,'rows':[]};var _0x42c42d=_[_0xd692('0x28')](db[_0xd692('0x29')]['rawAttributes'],function(_0x251733){return{'name':_0x251733[_0xd692('0x2a')],'type':_0x251733[_0xd692('0x2b')][_0xd692('0x2c')]};});_0x19ea48[_0xd692('0x2d')]=_[_0xd692('0x28')](_0x42c42d,_0xd692('0x26'));_0x19ea48['query']=_[_0xd692('0x2e')](_0x342823[_0xd692('0x2f')]);_0x19ea48[_0xd692('0x30')]=_[_0xd692('0x31')](_0x19ea48[_0xd692('0x2d')],_0x19ea48[_0xd692('0x2f')]);_0x267ec8[_0xd692('0x32')]=_[_0xd692('0x31')](_0x19ea48['model'],qs['fields'](_0x342823[_0xd692('0x2f')][_0xd692('0x33')]));_0x267ec8['attributes']=_0x267ec8[_0xd692('0x32')][_0xd692('0x34')]?_0x267ec8[_0xd692('0x32')]:_0x19ea48[_0xd692('0x2d')];if(!_0x342823['query'][_0xd692('0x35')](_0xd692('0x36'))){_0x267ec8[_0xd692('0x1a')]=qs[_0xd692('0x1a')](_0x342823[_0xd692('0x2f')][_0xd692('0x1a')]);_0x267ec8[_0xd692('0x17')]=qs['offset'](_0x342823[_0xd692('0x2f')]['offset']);}_0x267ec8[_0xd692('0x37')]=qs[_0xd692('0x38')](_0x342823['query'][_0xd692('0x38')]);_0x267ec8['where']=qs['filters'](_[_0xd692('0x39')](_0x342823[_0xd692('0x2f')],_0x19ea48[_0xd692('0x30')]),_0x42c42d);if(_0x342823[_0xd692('0x2f')][_0xd692('0x3a')]){_0x267ec8['where']=_[_0xd692('0x3b')](_0x267ec8[_0xd692('0x3c')],{'$or':_['map'](_0x42c42d,function(_0x1784f0){if(_0x1784f0[_0xd692('0x2b')]!==_0xd692('0x3d')){var _0x2ace8c={};_0x2ace8c[_0x1784f0['name']]={'$like':'%'+_0x342823[_0xd692('0x2f')][_0xd692('0x3a')]+'%'};return _0x2ace8c;}})});}_0x267ec8=_['merge']({},_0x267ec8,_0x342823[_0xd692('0x3e')]);var _0x513ded={'where':_0x267ec8[_0xd692('0x3c')]};return db[_0xd692('0x29')][_0xd692('0x19')](_0x513ded)[_0xd692('0x21')](function(_0x10d74b){_0x4edc91[_0xd692('0x19')]=_0x10d74b;if(_0x342823[_0xd692('0x2f')][_0xd692('0x3f')]){_0x267ec8[_0xd692('0x40')]=[{'all':!![]}];}return db[_0xd692('0x29')][_0xd692('0x41')](_0x267ec8);})[_0xd692('0x21')](function(_0x222f8b){_0x4edc91[_0xd692('0x42')]=_0x222f8b;return _0x4edc91;})[_0xd692('0x21')](respondWithFilteredResult(_0x366cbb,_0x267ec8))['catch'](handleError(_0x366cbb,null));};exports[_0xd692('0x43')]=function(_0x1984a2,_0x162c6e){var _0x3bc2db={'raw':!![],'where':{'id':_0x1984a2['params']['id']}},_0x41b566={};_0x41b566['model']=_['keys'](db['FaxQueue'][_0xd692('0x44')]);_0x41b566['query']=_[_0xd692('0x2e')](_0x1984a2['query']);_0x41b566[_0xd692('0x30')]=_[_0xd692('0x31')](_0x41b566[_0xd692('0x2d')],_0x41b566[_0xd692('0x2f')]);_0x3bc2db[_0xd692('0x32')]=_[_0xd692('0x31')](_0x41b566[_0xd692('0x2d')],qs[_0xd692('0x33')](_0x1984a2['query'][_0xd692('0x33')]));_0x3bc2db['attributes']=_0x3bc2db[_0xd692('0x32')][_0xd692('0x34')]?_0x3bc2db[_0xd692('0x32')]:_0x41b566['model'];if(_0x1984a2[_0xd692('0x2f')]['includeAll']){_0x3bc2db['include']=[{'all':!![]}];}_0x3bc2db=_[_0xd692('0x3b')]({},_0x3bc2db,_0x1984a2[_0xd692('0x3e')]);return db[_0xd692('0x29')][_0xd692('0x45')](_0x3bc2db)['then'](handleEntityNotFound(_0x162c6e,null))[_0xd692('0x21')](respondWithResult(_0x162c6e,null))[_0xd692('0x46')](handleError(_0x162c6e,null));};exports[_0xd692('0x47')]=function(_0x2573a2,_0xba5e90){return db['FaxQueue'][_0xd692('0x47')](_0x2573a2[_0xd692('0x48')],{})[_0xd692('0x21')](function(_0x125f40){var _0x55af62=_0x2573a2['user'][_0xd692('0x22')]({'plain':!![]});if(!_0x55af62)throw new Error(_0xd692('0x49'));if(_0x55af62[_0xd692('0x4a')]===_0xd692('0x4b')){var _0x10ef47=_0x125f40[_0xd692('0x22')]({'plain':!![]});var _0x2f3d1c=_0xd692('0x23');return db[_0xd692('0x4c')][_0xd692('0x45')]({'where':{'name':_0x2f3d1c,'userProfileId':_0x55af62[_0xd692('0x4d')]},'raw':!![]})[_0xd692('0x21')](function(_0x641162){if(_0x641162&&_0x641162[_0xd692('0x4e')]===0x0){return db[_0xd692('0x4f')]['create']({'name':_0x10ef47['name'],'resourceId':_0x10ef47['id'],'type':_0x641162[_0xd692('0x26')],'sectionId':_0x641162['id']},{})['then'](function(){return _0x125f40;});}else{return _0x125f40;}})[_0xd692('0x46')](function(_0x565846){logger[_0xd692('0x24')](_0xd692('0x50'),_0x565846);throw _0x565846;});}return _0x125f40;})[_0xd692('0x21')](respondWithResult(_0xba5e90,0xc9))['catch'](handleError(_0xba5e90,null));};exports[_0xd692('0x1f')]=function(_0x2fc842,_0x3629e4){if(_0x2fc842[_0xd692('0x48')]['id']){delete _0x2fc842[_0xd692('0x48')]['id'];}return db[_0xd692('0x29')][_0xd692('0x45')]({'where':{'id':_0x2fc842[_0xd692('0x51')]['id']}})[_0xd692('0x21')](handleEntityNotFound(_0x3629e4,null))[_0xd692('0x21')](saveUpdates(_0x2fc842['body'],null))[_0xd692('0x21')](respondWithResult(_0x3629e4,null))[_0xd692('0x46')](handleError(_0x3629e4,null));};exports[_0xd692('0x20')]=function(_0x378a36,_0x21a57f){return db[_0xd692('0x29')][_0xd692('0x45')]({'where':{'id':_0x378a36['params']['id']}})['then'](handleEntityNotFound(_0x21a57f,null))[_0xd692('0x21')](removeEntity(_0x21a57f,null))[_0xd692('0x46')](handleError(_0x21a57f,null));};exports[_0xd692('0x52')]=function(_0x1585ce,_0x248a72){return db['FaxQueue'][_0xd692('0x52')]()[_0xd692('0x21')](respondWithResult(_0x248a72,null))[_0xd692('0x46')](handleError(_0x248a72,null));};exports[_0xd692('0x53')]=function(_0x4c9c69,_0x2fc78b,_0x4ff84a){var _0xc70ad5={'raw':!![],'where':{}},_0x211ae1={},_0x442aa0;return db[_0xd692('0x29')][_0xd692('0x54')]({'where':{'id':_0x4c9c69[_0xd692('0x51')]['id']}})['then'](handleEntityNotFound(_0x2fc78b,null))[_0xd692('0x21')](function(_0x272b65){if(_0x272b65){_0x442aa0=_0x272b65[_0xd692('0x22')]({'plain':!![]});_0x211ae1[_0xd692('0x2d')]=_[_0xd692('0x2e')](db[_0xd692('0x55')][_0xd692('0x44')]);_0x211ae1[_0xd692('0x2f')]=_[_0xd692('0x2e')](_0x4c9c69[_0xd692('0x2f')]);_0x211ae1[_0xd692('0x30')]=_[_0xd692('0x31')](_0x211ae1[_0xd692('0x2d')],_0x211ae1[_0xd692('0x2f')]);_0xc70ad5['attributes']=_[_0xd692('0x31')](_0x211ae1[_0xd692('0x2d')],qs[_0xd692('0x33')](_0x4c9c69['query']['fields']));_0xc70ad5['attributes']=_0xc70ad5[_0xd692('0x32')][_0xd692('0x34')]?_0xc70ad5[_0xd692('0x32')]:_0x211ae1[_0xd692('0x2d')];if(!_0x4c9c69[_0xd692('0x2f')]['hasOwnProperty'](_0xd692('0x36'))){_0xc70ad5[_0xd692('0x1a')]=qs['limit'](_0x4c9c69[_0xd692('0x2f')][_0xd692('0x1a')]);_0xc70ad5[_0xd692('0x17')]=qs['offset'](_0x4c9c69[_0xd692('0x2f')][_0xd692('0x17')]);}_0xc70ad5['order']=qs[_0xd692('0x38')](_0x4c9c69[_0xd692('0x2f')][_0xd692('0x38')]);_0xc70ad5[_0xd692('0x3c')]=qs[_0xd692('0x30')](_[_0xd692('0x39')](_0x4c9c69['query'],_0x211ae1[_0xd692('0x30')]));_0xc70ad5['where'][_0xd692('0x56')]=_0x272b65['id'];if(_0x4c9c69['query']['filter']){_0xc70ad5[_0xd692('0x3c')]=_[_0xd692('0x3b')](_0xc70ad5[_0xd692('0x3c')],{'$or':_[_0xd692('0x28')](_0xc70ad5[_0xd692('0x32')],function(_0x36cfb5){var _0x58bf95={};_0x58bf95[_0x36cfb5]={'$like':'%'+_0x4c9c69['query']['filter']+'%'};return _0x58bf95;})});}_0xc70ad5=_[_0xd692('0x3b')]({},_0xc70ad5,_0x4c9c69[_0xd692('0x3e')]);return db[_0xd692('0x55')]['findAll'](_0xc70ad5);}})['then'](function(_0x3d5745){if(_0x3d5745){return db[_0xd692('0x57')][_0xd692('0x58')]({'where':{'id':_[_0xd692('0x28')](_0x3d5745,_0xd692('0x59')),'role':_0xd692('0x5a')},'attributes':['id',_0xd692('0x26'),_0xd692('0x5b'),_0xd692('0x5c'),_0xd692('0x5d')]});}})[_0xd692('0x21')](function(_0xf8e317){if(_0xf8e317){return{'count':_0xf8e317[_0xd692('0x19')],'rows':_[_0xd692('0x28')](_0xf8e317[_0xd692('0x42')],function(_0x4725d3){return{'membername':_0x4725d3[_0xd692('0x26')],'UserId':_0x4725d3['id'],'queue_name':_0x442aa0['name'],'FaxQueueId':_0x442aa0['id'],'interface':util[_0xd692('0x5e')](_0xd692('0x5f'),_0xd692('0x60'),_0x4725d3[_0xd692('0x26')]),'penalty':0x0,'paused':_0x4725d3[_0xd692('0x5b')],'createdAt':_0x4725d3['createdAt'],'updatedAt':_0x4725d3[_0xd692('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2fc78b,_0xc70ad5))[_0xd692('0x46')](handleError(_0x2fc78b,null));};exports[_0xd692('0x61')]=function(_0x2ddc2c,_0x4e3104,_0x5e1635){var _0x228174={};var _0x356db1={};var _0x48f425;var _0x57d559;return db[_0xd692('0x29')][_0xd692('0x54')]({'where':{'id':_0x2ddc2c[_0xd692('0x51')]['id']}})[_0xd692('0x21')](handleEntityNotFound(_0x4e3104,null))[_0xd692('0x21')](function(_0x32b219){if(_0x32b219){_0x48f425=_0x32b219;_0x356db1[_0xd692('0x2d')]=_[_0xd692('0x2e')](db[_0xd692('0x62')][_0xd692('0x44')]);_0x356db1[_0xd692('0x2f')]=_['keys'](_0x2ddc2c[_0xd692('0x2f')]);_0x356db1[_0xd692('0x30')]=_['intersection'](_0x356db1[_0xd692('0x2d')],_0x356db1[_0xd692('0x2f')]);_0x228174['attributes']=_[_0xd692('0x31')](_0x356db1['model'],qs['fields'](_0x2ddc2c['query']['fields']));_0x228174[_0xd692('0x32')]=_0x228174[_0xd692('0x32')]['length']?_0x228174[_0xd692('0x32')]:_0x356db1['model'];_0x228174['order']=qs[_0xd692('0x38')](_0x2ddc2c['query'][_0xd692('0x38')]);_0x228174[_0xd692('0x3c')]=qs[_0xd692('0x30')](_[_0xd692('0x39')](_0x2ddc2c['query'],_0x356db1[_0xd692('0x30')]));if(_0x2ddc2c[_0xd692('0x2f')][_0xd692('0x3a')]){_0x228174[_0xd692('0x3c')]=_[_0xd692('0x3b')](_0x228174[_0xd692('0x3c')],{'$or':_[_0xd692('0x28')](_0x228174['attributes'],function(_0x5a5b3f){var _0x2bfbec={};_0x2bfbec[_0x5a5b3f]={'$like':'%'+_0x2ddc2c[_0xd692('0x2f')][_0xd692('0x3a')]+'%'};return _0x2bfbec;})});}_0x228174=_['merge']({},_0x228174,_0x2ddc2c[_0xd692('0x3e')]);return _0x48f425[_0xd692('0x61')](_0x228174);}})[_0xd692('0x21')](function(_0xaffb08){if(_0xaffb08){_0x57d559=_0xaffb08[_0xd692('0x34')];if(!_0x2ddc2c['query'][_0xd692('0x35')](_0xd692('0x36'))){_0x228174[_0xd692('0x1a')]=qs[_0xd692('0x1a')](_0x2ddc2c[_0xd692('0x2f')][_0xd692('0x1a')]);_0x228174[_0xd692('0x17')]=qs[_0xd692('0x17')](_0x2ddc2c[_0xd692('0x2f')][_0xd692('0x17')]);}return _0x48f425[_0xd692('0x61')](_0x228174);}})[_0xd692('0x21')](function(_0x182794){if(_0x182794){return _0x182794?{'count':_0x57d559,'rows':_0x182794}:null;}})[_0xd692('0x21')](respondWithResult(_0x4e3104,null))[_0xd692('0x46')](handleError(_0x4e3104,null));};exports[_0xd692('0x63')]=function(_0x59c9ce,_0x5b9672,_0x13bfd4){var _0x55c373=_0x59c9ce[_0xd692('0x48')]['ids'];return db[_0xd692('0x62')][_0xd692('0x41')]({'where':{'id':_0x55c373},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xd692('0x26'),_0xd692('0x64'),_0xd692('0x65'),_0xd692('0x66')],'raw':!![]}]})[_0xd692('0x21')](function(_0x3c69e9){if(_0x3c69e9){var _0x2c9ad7=_[_0xd692('0x67')](_0x3c69e9,function(_0x25a20c){var _0x1ae969=_0x25a20c['get']({'plain':!![]});return _0x1ae969[_0xd692('0x68')];});return db[_0xd692('0x29')][_0xd692('0x45')]({'where':{'id':_0x59c9ce[_0xd692('0x51')]['id']}})[_0xd692('0x21')](function(_0x4ea28a){return db[_0xd692('0x69')][_0xd692('0x6a')](function(_0x2c2f8c){return _0x4ea28a[_0xd692('0x63')](_0x55c373,{'transaction':_0x2c2f8c})[_0xd692('0x21')](function(){return BPromise[_0xd692('0x6b')](_0x2c9ad7,function(_0x389149){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x389149['id'],'FaxQueueId':_0x59c9ce['params']['id']},'transaction':_0x2c2f8c});});})[_0xd692('0x21')](function(){_0x2c9ad7[_0xd692('0x6c')](function(_0xcc4e05){socket[_0xd692('0x6d')](_0xd692('0x6e'),{'UserId':_0xcc4e05['id'],'FaxQueueId':_0x4ea28a['id']});});});});});}})[_0xd692('0x21')](respondWithStatusCode(_0x5b9672,null))[_0xd692('0x46')](handleError(_0x5b9672,null));};exports['removeTeams']=function(_0x2c11cc,_0x29467b,_0x573d85){return db[_0xd692('0x62')][_0xd692('0x41')]({'where':{'id':_0x2c11cc[_0xd692('0x2f')][_0xd692('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xd692('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x29467b,null))[_0xd692('0x21')](function(_0x2b9a40){var _0x15e368=_[_0xd692('0x28')](_0x2b9a40,'id');var _0x187f9b=[];var _0x102170=[];var _0xa6012=squel[_0xd692('0x70')]();_0xa6012[_0xd692('0x71')](_0xd692('0x72'))[_0xd692('0x73')](_0xd692('0x74'),'tq')[_0xd692('0x75')]('user_has_teams','ut',_0xd692('0x76'))[_0xd692('0x3c')](_0xd692('0x77'),_0x2c11cc['params']['id']);for(var _0x16e69f=0x0;_0x16e69f<_0x2b9a40[_0xd692('0x34')];_0x16e69f+=0x1){let _0x550f8b=_0x2b9a40[_0x16e69f];for(var _0x5c27a4=0x0;_0x5c27a4<_0x550f8b[_0xd692('0x68')][_0xd692('0x34')];_0x5c27a4+=0x1){let _0x58ff87=_0x550f8b[_0xd692('0x68')][_0x5c27a4];var _0x8ed83=_0xa6012[_0xd692('0x78')]();_0x8ed83[_0xd692('0x3c')](_0xd692('0x79'),_0x58ff87['id']);_0x102170[_0xd692('0x7a')](db[_0xd692('0x69')][_0xd692('0x2f')](_0x8ed83[_0xd692('0x7b')](),{'type':db[_0xd692('0x69')][_0xd692('0x7c')][_0xd692('0x7d')]})['then'](function(_0x1fd9f6){if(_0x1fd9f6[_0xd692('0x34')]===0x1){return _0x58ff87['id'];}else{var _0x53cfe6=_[_0xd692('0x7e')](_['map'](_0x1fd9f6,_0xd692('0x7f')),function(_0xb4d30){return _['includes'](_0x15e368,_0xb4d30);});if(_0x53cfe6){return _0x58ff87['id'];}}}));}}return BPromise[_0xd692('0x80')](_0x102170)[_0xd692('0x21')](function(_0x25c5d9){_0x187f9b=_(_0x187f9b)[_0xd692('0x81')](_0x25c5d9)[_0xd692('0x82')]()[_0xd692('0x83')]();return db[_0xd692('0x29')][_0xd692('0x45')]({'where':{'id':_0x2c11cc[_0xd692('0x51')]['id']}})[_0xd692('0x21')](function(_0x56c990){return db[_0xd692('0x69')][_0xd692('0x6a')](function(_0x1e3486){return _0x56c990['removeTeams'](_0x2c11cc[_0xd692('0x2f')][_0xd692('0x6f')],{'transaction':_0x1e3486})['then'](function(){if(!_[_0xd692('0x84')](_0x187f9b)){return _0x56c990['removeAgents'](_0x187f9b,{'transaction':_0x1e3486});}})[_0xd692('0x21')](function(){_0x187f9b[_0xd692('0x6c')](function(_0x11f5e5){socket[_0xd692('0x6d')](_0xd692('0x85'),{'UserId':_0x11f5e5,'FaxQueueId':_0x56c990['id']});});});});});});})[_0xd692('0x21')](respondWithStatusCode(_0x29467b,null))[_0xd692('0x46')](handleError(_0x29467b,null));};exports[_0xd692('0x86')]=function(_0x3d5999,_0x36c6a4,_0x3497c8){return db[_0xd692('0x29')][_0xd692('0x45')]({'where':{'id':_0x3d5999[_0xd692('0x51')]['id']}})[_0xd692('0x21')](handleEntityNotFound(_0x36c6a4,null))[_0xd692('0x21')](function(_0x347c6f){if(_0x347c6f){return _0x347c6f['addAgents'](_0x3d5999[_0xd692('0x48')][_0xd692('0x6f')],_[_0xd692('0x87')](_0x3d5999['body'],['ids','id'])||{})[_0xd692('0x88')](function(_0x5169b8){for(var _0x247110=0x0;_0x247110<_0x3d5999[_0xd692('0x48')][_0xd692('0x6f')][_0xd692('0x34')];_0x247110+=0x1){socket[_0xd692('0x6d')](_0xd692('0x6e'),{'UserId':Number(_0x3d5999[_0xd692('0x48')]['ids'][_0x247110]),'FaxQueueId':Number(_0x3d5999[_0xd692('0x51')]['id'])});}return _0x5169b8;});}})[_0xd692('0x21')](respondWithResult(_0x36c6a4,null))[_0xd692('0x46')](handleError(_0x36c6a4,null));};exports[_0xd692('0x89')]=function(_0x563a36,_0x135acf,_0x4aea1e){return db[_0xd692('0x29')][_0xd692('0x45')]({'where':{'id':_0x563a36[_0xd692('0x51')]['id']}})['then'](handleEntityNotFound(_0x135acf,null))[_0xd692('0x21')](function(_0x540099){if(_0x540099){return _0x540099[_0xd692('0x89')](_0x563a36[_0xd692('0x2f')][_0xd692('0x6f')])[_0xd692('0x21')](function(){if(_[_0xd692('0x8a')](_0x563a36['query'][_0xd692('0x6f')])){for(var _0x547214=0x0;_0x547214<_0x563a36[_0xd692('0x2f')][_0xd692('0x6f')][_0xd692('0x34')];_0x547214+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x563a36[_0xd692('0x2f')][_0xd692('0x6f')][_0x547214]),'FaxQueueId':Number(_0x563a36[_0xd692('0x51')]['id'])});}}else{socket[_0xd692('0x6d')](_0xd692('0x85'),{'UserId':Number(_0x563a36[_0xd692('0x2f')][_0xd692('0x6f')]),'FaxQueueId':Number(_0x563a36[_0xd692('0x51')]['id'])});}});}})[_0xd692('0x21')](respondWithStatusCode(_0x135acf,null))[_0xd692('0x46')](handleError(_0x135acf,null));};exports['getAgents']=function(_0x2a47cc,_0x57191f,_0x2941f8){var _0x3fa2f6={};var _0x16342c={};var _0x184d14;var _0x10bcf5;return db['FaxQueue'][_0xd692('0x54')]({'where':{'id':_0x2a47cc[_0xd692('0x51')]['id']}})[_0xd692('0x21')](handleEntityNotFound(_0x57191f,null))['then'](function(_0x5148ac){if(_0x5148ac){_0x184d14=_0x5148ac;_0x16342c[_0xd692('0x2d')]=_[_0xd692('0x2e')](db['User'][_0xd692('0x44')]);_0x16342c[_0xd692('0x2f')]=_[_0xd692('0x2e')](_0x2a47cc['query']);_0x16342c[_0xd692('0x30')]=_[_0xd692('0x31')](_0x16342c['model'],_0x16342c[_0xd692('0x2f')]);_0x3fa2f6['attributes']=_['intersection'](_0x16342c[_0xd692('0x2d')],qs[_0xd692('0x33')](_0x2a47cc[_0xd692('0x2f')]['fields']));_0x3fa2f6[_0xd692('0x32')]=_0x3fa2f6['attributes'][_0xd692('0x34')]?_0x3fa2f6[_0xd692('0x32')]:_0x16342c[_0xd692('0x2d')];_0x3fa2f6['order']=qs['sort'](_0x2a47cc[_0xd692('0x2f')][_0xd692('0x38')]);_0x3fa2f6[_0xd692('0x3c')]=qs[_0xd692('0x30')](_['pick'](_0x2a47cc['query'],_0x16342c[_0xd692('0x30')]));if(_0x2a47cc[_0xd692('0x2f')][_0xd692('0x3a')]){_0x3fa2f6[_0xd692('0x3c')]=_[_0xd692('0x3b')](_0x3fa2f6[_0xd692('0x3c')],{'$or':_[_0xd692('0x28')](_0x3fa2f6['attributes'],function(_0xaa13ef){var _0x84979a={};_0x84979a[_0xaa13ef]={'$like':'%'+_0x2a47cc['query'][_0xd692('0x3a')]+'%'};return _0x84979a;})});}_0x3fa2f6=_[_0xd692('0x3b')]({},_0x3fa2f6,_0x2a47cc['options']);return _0x184d14['getAgents'](_0x3fa2f6);}})[_0xd692('0x21')](function(_0x13f2e0){if(_0x13f2e0){_0x10bcf5=_0x13f2e0['length'];if(!_0x2a47cc[_0xd692('0x2f')][_0xd692('0x35')]('nolimit')){_0x3fa2f6[_0xd692('0x1a')]=qs[_0xd692('0x1a')](_0x2a47cc[_0xd692('0x2f')][_0xd692('0x1a')]);_0x3fa2f6[_0xd692('0x17')]=qs['offset'](_0x2a47cc[_0xd692('0x2f')]['offset']);}return _0x184d14['getAgents'](_0x3fa2f6);}})[_0xd692('0x21')](function(_0x3793b8){if(_0x3793b8){return _0x3793b8?{'count':_0x10bcf5,'rows':_0x3793b8}:null;}})['then'](respondWithResult(_0x57191f,null))[_0xd692('0x46')](handleError(_0x57191f,null));}; \ No newline at end of file +var _0x1bab=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','userProfileId','autoAssociation','describe','pick','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','forEach','removeTeams','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','emit','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x1977ca,_0x14231f){var _0x3f4131=function(_0x2c1a60){while(--_0x2c1a60){_0x1977ca['push'](_0x1977ca['shift']());}};_0x3f4131(++_0x14231f);}(_0x1bab,0x186));var _0xb1ba=function(_0x39421a,_0x291499){_0x39421a=_0x39421a-0x0;var _0x1f6e66=_0x1bab[_0x39421a];return _0x1f6e66;};'use strict';var emlformat=require(_0xb1ba('0x0'));var rimraf=require(_0xb1ba('0x1'));var zipdir=require(_0xb1ba('0x2'));var jsonpatch=require(_0xb1ba('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb1ba('0x4'));var util=require(_0xb1ba('0x5'));var path=require(_0xb1ba('0x6'));var sox=require('sox');var csv=require(_0xb1ba('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1ba('0x8'));var squel=require(_0xb1ba('0x9'));var crypto=require('crypto');var jsforce=require(_0xb1ba('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb1ba('0x7'));var querystring=require(_0xb1ba('0xb'));var Papa=require(_0xb1ba('0xc'));var Redis=require(_0xb1ba('0xd'));var authService=require(_0xb1ba('0xe'));var qs=require(_0xb1ba('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1ba('0x10'));var logger=require(_0xb1ba('0x11'))(_0xb1ba('0x12'));var utils=require(_0xb1ba('0x13'));var config=require(_0xb1ba('0x14'));var licenseUtil=require(_0xb1ba('0x15'));var db=require(_0xb1ba('0x16'))['db'];config[_0xb1ba('0x17')]=_[_0xb1ba('0x18')](config['redis'],{'host':_0xb1ba('0x19'),'port':0x18eb});var socket=require(_0xb1ba('0x1a'))(new Redis(config[_0xb1ba('0x17')]));require(_0xb1ba('0x1b'))[_0xb1ba('0x1c')](socket);function respondWithStatusCode(_0x23aa6d,_0x39722e){_0x39722e=_0x39722e||0xcc;return function(_0x3d9c61){if(_0x3d9c61){return _0x23aa6d[_0xb1ba('0x1d')](_0x39722e);}return _0x23aa6d['status'](_0x39722e)[_0xb1ba('0x1e')]();};}function respondWithResult(_0x1ddab5,_0x52e42c){_0x52e42c=_0x52e42c||0xc8;return function(_0x3135ee){if(_0x3135ee){return _0x1ddab5[_0xb1ba('0x1f')](_0x52e42c)[_0xb1ba('0x20')](_0x3135ee);}};}function respondWithFilteredResult(_0x1919b5,_0x58bee5){return function(_0x58203b){if(_0x58203b){var _0x406be7=typeof _0x58bee5[_0xb1ba('0x21')]===_0xb1ba('0x22')&&typeof _0x58bee5[_0xb1ba('0x23')]===_0xb1ba('0x22');var _0x51ac1c=_0x58203b[_0xb1ba('0x24')];var _0x59c192=_0x406be7?0x0:_0x58bee5[_0xb1ba('0x21')];var _0x31c61b=_0x406be7?_0x58203b[_0xb1ba('0x24')]:_0x58bee5[_0xb1ba('0x21')]+_0x58bee5[_0xb1ba('0x23')];var _0x1160ba;if(_0x31c61b>=_0x51ac1c){_0x31c61b=_0x51ac1c;_0x1160ba=0xc8;}else{_0x1160ba=0xce;}_0x1919b5[_0xb1ba('0x1f')](_0x1160ba);return _0x1919b5['set'](_0xb1ba('0x25'),_0x59c192+'-'+_0x31c61b+'/'+_0x51ac1c)[_0xb1ba('0x20')](_0x58203b);}return null;};}function patchUpdates(_0x3d1879){return function(_0x296943){try{jsonpatch[_0xb1ba('0x26')](_0x296943,_0x3d1879,!![]);}catch(_0x42a9be){return BPromise[_0xb1ba('0x27')](_0x42a9be);}return _0x296943[_0xb1ba('0x28')]();};}function saveUpdates(_0xc5c2f3,_0x35691e){return function(_0x188812){if(_0x188812){return _0x188812[_0xb1ba('0x29')](_0xc5c2f3)[_0xb1ba('0x2a')](function(_0x3b8a5d){return _0x3b8a5d;});}return null;};}function removeEntity(_0x15a052,_0x1f0535){return function(_0x4e8f1c){if(_0x4e8f1c){return _0x4e8f1c[_0xb1ba('0x2b')]()['then'](function(){var _0x42e6a7=_0x4e8f1c['get']({'plain':!![]});var _0x3761a0=_0xb1ba('0x2c');return db[_0xb1ba('0x2d')][_0xb1ba('0x2b')]({'where':{'type':_0x3761a0,'resourceId':_0x42e6a7['id']}})['then'](function(){return _0x4e8f1c;});})[_0xb1ba('0x2a')](function(){_0x15a052['status'](0xcc)[_0xb1ba('0x1e')]();});}};}function handleEntityNotFound(_0x5c6ceb,_0x20015c){return function(_0x1cfc7f){if(!_0x1cfc7f){_0x5c6ceb[_0xb1ba('0x1d')](0x194);}return _0x1cfc7f;};}function handleError(_0x317ec1,_0x9b5641){_0x9b5641=_0x9b5641||0x1f4;return function(_0x52edea){logger[_0xb1ba('0x2e')](_0x52edea[_0xb1ba('0x2f')]);if(_0x52edea[_0xb1ba('0x30')]){delete _0x52edea[_0xb1ba('0x30')];}_0x317ec1[_0xb1ba('0x1f')](_0x9b5641)['send'](_0x52edea);};}exports[_0xb1ba('0x31')]=function(_0x20c918,_0x23a5c2){var _0x20f3e3={},_0x1ad3ba={},_0x5493e4={'count':0x0,'rows':[]};var _0x1bee05=_[_0xb1ba('0x32')](db[_0xb1ba('0x33')][_0xb1ba('0x34')],function(_0x113894){return{'name':_0x113894['fieldName'],'type':_0x113894['type']['key']};});_0x1ad3ba[_0xb1ba('0x35')]=_[_0xb1ba('0x32')](_0x1bee05,'name');_0x1ad3ba[_0xb1ba('0x36')]=_['keys'](_0x20c918[_0xb1ba('0x36')]);_0x1ad3ba[_0xb1ba('0x37')]=_[_0xb1ba('0x38')](_0x1ad3ba[_0xb1ba('0x35')],_0x1ad3ba[_0xb1ba('0x36')]);_0x20f3e3['attributes']=_[_0xb1ba('0x38')](_0x1ad3ba[_0xb1ba('0x35')],qs[_0xb1ba('0x39')](_0x20c918['query'][_0xb1ba('0x39')]));_0x20f3e3[_0xb1ba('0x3a')]=_0x20f3e3[_0xb1ba('0x3a')][_0xb1ba('0x3b')]?_0x20f3e3[_0xb1ba('0x3a')]:_0x1ad3ba[_0xb1ba('0x35')];if(!_0x20c918[_0xb1ba('0x36')][_0xb1ba('0x3c')](_0xb1ba('0x3d'))){_0x20f3e3[_0xb1ba('0x23')]=qs[_0xb1ba('0x23')](_0x20c918[_0xb1ba('0x36')][_0xb1ba('0x23')]);_0x20f3e3[_0xb1ba('0x21')]=qs['offset'](_0x20c918[_0xb1ba('0x36')][_0xb1ba('0x21')]);}_0x20f3e3[_0xb1ba('0x3e')]=qs[_0xb1ba('0x3f')](_0x20c918[_0xb1ba('0x36')]['sort']);_0x20f3e3[_0xb1ba('0x40')]=qs[_0xb1ba('0x37')](_['pick'](_0x20c918[_0xb1ba('0x36')],_0x1ad3ba[_0xb1ba('0x37')]),_0x1bee05);if(_0x20c918[_0xb1ba('0x36')]['filter']){_0x20f3e3['where']=_[_0xb1ba('0x41')](_0x20f3e3[_0xb1ba('0x40')],{'$or':_['map'](_0x1bee05,function(_0x4e966f){if(_0x4e966f[_0xb1ba('0x42')]!=='VIRTUAL'){var _0x22b08a={};_0x22b08a[_0x4e966f[_0xb1ba('0x30')]]={'$like':'%'+_0x20c918[_0xb1ba('0x36')][_0xb1ba('0x43')]+'%'};return _0x22b08a;}})});}_0x20f3e3=_[_0xb1ba('0x41')]({},_0x20f3e3,_0x20c918[_0xb1ba('0x44')]);var _0x23b525={'where':_0x20f3e3[_0xb1ba('0x40')]};return db[_0xb1ba('0x33')]['count'](_0x23b525)[_0xb1ba('0x2a')](function(_0x3073c9){_0x5493e4['count']=_0x3073c9;if(_0x20c918[_0xb1ba('0x36')][_0xb1ba('0x45')]){_0x20f3e3[_0xb1ba('0x46')]=[{'all':!![]}];}return db[_0xb1ba('0x33')][_0xb1ba('0x47')](_0x20f3e3);})[_0xb1ba('0x2a')](function(_0xdbe443){_0x5493e4[_0xb1ba('0x48')]=_0xdbe443;return _0x5493e4;})[_0xb1ba('0x2a')](respondWithFilteredResult(_0x23a5c2,_0x20f3e3))[_0xb1ba('0x49')](handleError(_0x23a5c2,null));};exports[_0xb1ba('0x4a')]=function(_0x1268e1,_0x367abb){var _0x5cb3b3={'raw':!![],'where':{'id':_0x1268e1[_0xb1ba('0x4b')]['id']}},_0x1b6800={};_0x1b6800[_0xb1ba('0x35')]=_[_0xb1ba('0x4c')](db[_0xb1ba('0x33')][_0xb1ba('0x34')]);_0x1b6800[_0xb1ba('0x36')]=_[_0xb1ba('0x4c')](_0x1268e1['query']);_0x1b6800[_0xb1ba('0x37')]=_[_0xb1ba('0x38')](_0x1b6800[_0xb1ba('0x35')],_0x1b6800[_0xb1ba('0x36')]);_0x5cb3b3[_0xb1ba('0x3a')]=_[_0xb1ba('0x38')](_0x1b6800[_0xb1ba('0x35')],qs[_0xb1ba('0x39')](_0x1268e1[_0xb1ba('0x36')][_0xb1ba('0x39')]));_0x5cb3b3[_0xb1ba('0x3a')]=_0x5cb3b3[_0xb1ba('0x3a')][_0xb1ba('0x3b')]?_0x5cb3b3[_0xb1ba('0x3a')]:_0x1b6800[_0xb1ba('0x35')];if(_0x1268e1[_0xb1ba('0x36')][_0xb1ba('0x45')]){_0x5cb3b3[_0xb1ba('0x46')]=[{'all':!![]}];}_0x5cb3b3=_['merge']({},_0x5cb3b3,_0x1268e1[_0xb1ba('0x44')]);return db[_0xb1ba('0x33')][_0xb1ba('0x4d')](_0x5cb3b3)[_0xb1ba('0x2a')](handleEntityNotFound(_0x367abb,null))['then'](respondWithResult(_0x367abb,null))[_0xb1ba('0x49')](handleError(_0x367abb,null));};exports['create']=function(_0x299ea5,_0x341604){return db[_0xb1ba('0x33')][_0xb1ba('0x4e')](_0x299ea5[_0xb1ba('0x4f')],{})[_0xb1ba('0x2a')](function(_0x2caf3d){var _0x588a05=_0x299ea5[_0xb1ba('0x50')][_0xb1ba('0x51')]({'plain':!![]});if(!_0x588a05)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x588a05['role']==='user'){var _0x120a89=_0x2caf3d[_0xb1ba('0x51')]({'plain':!![]});var _0x1d5f2b=_0xb1ba('0x2c');return db['UserProfileSection'][_0xb1ba('0x4d')]({'where':{'name':_0x1d5f2b,'userProfileId':_0x588a05[_0xb1ba('0x52')]},'raw':!![]})[_0xb1ba('0x2a')](function(_0x862e0f){if(_0x862e0f&&_0x862e0f[_0xb1ba('0x53')]===0x0){return db['UserProfileResource'][_0xb1ba('0x4e')]({'name':_0x120a89[_0xb1ba('0x30')],'resourceId':_0x120a89['id'],'type':_0x862e0f[_0xb1ba('0x30')],'sectionId':_0x862e0f['id']},{})[_0xb1ba('0x2a')](function(){return _0x2caf3d;});}else{return _0x2caf3d;}})[_0xb1ba('0x49')](function(_0x1a9382){logger[_0xb1ba('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a9382);throw _0x1a9382;});}return _0x2caf3d;})['then'](respondWithResult(_0x341604,0xc9))[_0xb1ba('0x49')](handleError(_0x341604,null));};exports[_0xb1ba('0x29')]=function(_0x51fa6d,_0xf3dcad){if(_0x51fa6d[_0xb1ba('0x4f')]['id']){delete _0x51fa6d[_0xb1ba('0x4f')]['id'];}return db[_0xb1ba('0x33')][_0xb1ba('0x4d')]({'where':{'id':_0x51fa6d['params']['id']}})[_0xb1ba('0x2a')](handleEntityNotFound(_0xf3dcad,null))[_0xb1ba('0x2a')](saveUpdates(_0x51fa6d['body'],null))['then'](respondWithResult(_0xf3dcad,null))['catch'](handleError(_0xf3dcad,null));};exports[_0xb1ba('0x2b')]=function(_0x4ea51f,_0x54f0f7){return db['FaxQueue'][_0xb1ba('0x4d')]({'where':{'id':_0x4ea51f[_0xb1ba('0x4b')]['id']}})[_0xb1ba('0x2a')](handleEntityNotFound(_0x54f0f7,null))['then'](removeEntity(_0x54f0f7,null))[_0xb1ba('0x49')](handleError(_0x54f0f7,null));};exports[_0xb1ba('0x54')]=function(_0x54a2f0,_0x35c5ac){return db[_0xb1ba('0x33')][_0xb1ba('0x54')]()[_0xb1ba('0x2a')](respondWithResult(_0x35c5ac,null))['catch'](handleError(_0x35c5ac,null));};exports['getMembers']=function(_0x4a475c,_0x352f33,_0x1f3309){var _0x3584ed={'raw':!![],'where':{}},_0x37366f={},_0x58d3dc;return db[_0xb1ba('0x33')]['findOne']({'where':{'id':_0x4a475c[_0xb1ba('0x4b')]['id']}})[_0xb1ba('0x2a')](handleEntityNotFound(_0x352f33,null))[_0xb1ba('0x2a')](function(_0x3c94bd){if(_0x3c94bd){_0x58d3dc=_0x3c94bd[_0xb1ba('0x51')]({'plain':!![]});_0x37366f[_0xb1ba('0x35')]=_['keys'](db['UserFaxQueue'][_0xb1ba('0x34')]);_0x37366f[_0xb1ba('0x36')]=_[_0xb1ba('0x4c')](_0x4a475c[_0xb1ba('0x36')]);_0x37366f['filters']=_[_0xb1ba('0x38')](_0x37366f[_0xb1ba('0x35')],_0x37366f[_0xb1ba('0x36')]);_0x3584ed[_0xb1ba('0x3a')]=_[_0xb1ba('0x38')](_0x37366f[_0xb1ba('0x35')],qs[_0xb1ba('0x39')](_0x4a475c[_0xb1ba('0x36')]['fields']));_0x3584ed['attributes']=_0x3584ed[_0xb1ba('0x3a')]['length']?_0x3584ed[_0xb1ba('0x3a')]:_0x37366f[_0xb1ba('0x35')];if(!_0x4a475c[_0xb1ba('0x36')][_0xb1ba('0x3c')](_0xb1ba('0x3d'))){_0x3584ed['limit']=qs['limit'](_0x4a475c[_0xb1ba('0x36')][_0xb1ba('0x23')]);_0x3584ed[_0xb1ba('0x21')]=qs[_0xb1ba('0x21')](_0x4a475c['query']['offset']);}_0x3584ed[_0xb1ba('0x3e')]=qs[_0xb1ba('0x3f')](_0x4a475c[_0xb1ba('0x36')]['sort']);_0x3584ed[_0xb1ba('0x40')]=qs[_0xb1ba('0x37')](_[_0xb1ba('0x55')](_0x4a475c[_0xb1ba('0x36')],_0x37366f[_0xb1ba('0x37')]));_0x3584ed[_0xb1ba('0x40')][_0xb1ba('0x56')]=_0x3c94bd['id'];if(_0x4a475c[_0xb1ba('0x36')][_0xb1ba('0x43')]){_0x3584ed[_0xb1ba('0x40')]=_[_0xb1ba('0x41')](_0x3584ed[_0xb1ba('0x40')],{'$or':_[_0xb1ba('0x32')](_0x3584ed['attributes'],function(_0x33e7a0){var _0x53cefe={};_0x53cefe[_0x33e7a0]={'$like':'%'+_0x4a475c[_0xb1ba('0x36')][_0xb1ba('0x43')]+'%'};return _0x53cefe;})});}_0x3584ed=_[_0xb1ba('0x41')]({},_0x3584ed,_0x4a475c['options']);return db[_0xb1ba('0x57')]['findAll'](_0x3584ed);}})[_0xb1ba('0x2a')](function(_0x569f81){if(_0x569f81){return db[_0xb1ba('0x58')][_0xb1ba('0x59')]({'where':{'id':_[_0xb1ba('0x32')](_0x569f81,_0xb1ba('0x5a')),'role':_0xb1ba('0x5b')},'attributes':['id',_0xb1ba('0x30'),_0xb1ba('0x5c'),_0xb1ba('0x5d'),_0xb1ba('0x5e')]});}})['then'](function(_0x30f413){if(_0x30f413){return{'count':_0x30f413[_0xb1ba('0x24')],'rows':_['map'](_0x30f413[_0xb1ba('0x48')],function(_0x404a6c){return{'membername':_0x404a6c[_0xb1ba('0x30')],'UserId':_0x404a6c['id'],'queue_name':_0x58d3dc[_0xb1ba('0x30')],'FaxQueueId':_0x58d3dc['id'],'interface':util['format'](_0xb1ba('0x5f'),_0xb1ba('0x60'),_0x404a6c[_0xb1ba('0x30')]),'penalty':0x0,'paused':_0x404a6c[_0xb1ba('0x5c')],'createdAt':_0x404a6c[_0xb1ba('0x5e')],'updatedAt':_0x404a6c[_0xb1ba('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb1ba('0x2a')](respondWithFilteredResult(_0x352f33,_0x3584ed))[_0xb1ba('0x49')](handleError(_0x352f33,null));};exports['getTeams']=function(_0x266c5b,_0x5d0f32,_0x21ba88){var _0x2aef8d={};var _0x2349d0={};var _0x23047d;var _0x142aa8;return db['FaxQueue'][_0xb1ba('0x61')]({'where':{'id':_0x266c5b[_0xb1ba('0x4b')]['id']}})[_0xb1ba('0x2a')](handleEntityNotFound(_0x5d0f32,null))[_0xb1ba('0x2a')](function(_0x33cbe4){if(_0x33cbe4){_0x23047d=_0x33cbe4;_0x2349d0[_0xb1ba('0x35')]=_['keys'](db[_0xb1ba('0x62')]['rawAttributes']);_0x2349d0[_0xb1ba('0x36')]=_['keys'](_0x266c5b[_0xb1ba('0x36')]);_0x2349d0[_0xb1ba('0x37')]=_[_0xb1ba('0x38')](_0x2349d0[_0xb1ba('0x35')],_0x2349d0[_0xb1ba('0x36')]);_0x2aef8d[_0xb1ba('0x3a')]=_[_0xb1ba('0x38')](_0x2349d0[_0xb1ba('0x35')],qs[_0xb1ba('0x39')](_0x266c5b['query'][_0xb1ba('0x39')]));_0x2aef8d['attributes']=_0x2aef8d[_0xb1ba('0x3a')][_0xb1ba('0x3b')]?_0x2aef8d[_0xb1ba('0x3a')]:_0x2349d0[_0xb1ba('0x35')];_0x2aef8d['order']=qs[_0xb1ba('0x3f')](_0x266c5b[_0xb1ba('0x36')][_0xb1ba('0x3f')]);_0x2aef8d[_0xb1ba('0x40')]=qs[_0xb1ba('0x37')](_['pick'](_0x266c5b[_0xb1ba('0x36')],_0x2349d0[_0xb1ba('0x37')]));if(_0x266c5b['query'][_0xb1ba('0x43')]){_0x2aef8d[_0xb1ba('0x40')]=_[_0xb1ba('0x41')](_0x2aef8d[_0xb1ba('0x40')],{'$or':_[_0xb1ba('0x32')](_0x2aef8d[_0xb1ba('0x3a')],function(_0x4e462d){var _0x2edb2c={};_0x2edb2c[_0x4e462d]={'$like':'%'+_0x266c5b['query'][_0xb1ba('0x43')]+'%'};return _0x2edb2c;})});}_0x2aef8d=_[_0xb1ba('0x41')]({},_0x2aef8d,_0x266c5b[_0xb1ba('0x44')]);return _0x23047d[_0xb1ba('0x63')](_0x2aef8d);}})[_0xb1ba('0x2a')](function(_0x2e5634){if(_0x2e5634){_0x142aa8=_0x2e5634[_0xb1ba('0x3b')];if(!_0x266c5b['query'][_0xb1ba('0x3c')](_0xb1ba('0x3d'))){_0x2aef8d[_0xb1ba('0x23')]=qs[_0xb1ba('0x23')](_0x266c5b['query'][_0xb1ba('0x23')]);_0x2aef8d[_0xb1ba('0x21')]=qs[_0xb1ba('0x21')](_0x266c5b[_0xb1ba('0x36')][_0xb1ba('0x21')]);}return _0x23047d[_0xb1ba('0x63')](_0x2aef8d);}})[_0xb1ba('0x2a')](function(_0x30db88){if(_0x30db88){return _0x30db88?{'count':_0x142aa8,'rows':_0x30db88}:null;}})[_0xb1ba('0x2a')](respondWithResult(_0x5d0f32,null))[_0xb1ba('0x49')](handleError(_0x5d0f32,null));};exports[_0xb1ba('0x64')]=function(_0x5ddf4d,_0x2e8336,_0xaa0951){var _0x3899d5=_0x5ddf4d[_0xb1ba('0x4f')][_0xb1ba('0x65')];return db['Team'][_0xb1ba('0x47')]({'where':{'id':_0x3899d5},'attributes':['id'],'include':[{'model':db[_0xb1ba('0x58')],'as':'Agents','attributes':['id',_0xb1ba('0x30'),_0xb1ba('0x66'),_0xb1ba('0x67'),_0xb1ba('0x68')],'raw':!![]}]})['then'](function(_0x5b7bc0){if(_0x5b7bc0){var _0x2c7a9b=_[_0xb1ba('0x69')](_0x5b7bc0,function(_0x389a08){var _0xa2d490=_0x389a08[_0xb1ba('0x51')]({'plain':!![]});return _0xa2d490[_0xb1ba('0x6a')];});return db[_0xb1ba('0x33')][_0xb1ba('0x4d')]({'where':{'id':_0x5ddf4d['params']['id']}})[_0xb1ba('0x2a')](function(_0x45873c){return db[_0xb1ba('0x6b')][_0xb1ba('0x6c')](function(_0x12f47b){return _0x45873c[_0xb1ba('0x64')](_0x3899d5,{'transaction':_0x12f47b})[_0xb1ba('0x2a')](function(){return BPromise['each'](_0x2c7a9b,function(_0x2434e6){return db[_0xb1ba('0x57')]['findOrCreate']({'where':{'UserId':_0x2434e6['id'],'FaxQueueId':_0x5ddf4d[_0xb1ba('0x4b')]['id']},'transaction':_0x12f47b});});})[_0xb1ba('0x2a')](function(){_0x2c7a9b[_0xb1ba('0x6d')](function(_0x59b33f){socket['emit']('userFaxQueue:save',{'UserId':_0x59b33f['id'],'FaxQueueId':_0x45873c['id']});});});});});}})[_0xb1ba('0x2a')](respondWithStatusCode(_0x2e8336,null))[_0xb1ba('0x49')](handleError(_0x2e8336,null));};exports[_0xb1ba('0x6e')]=function(_0x1316f1,_0x3bc726,_0x5a29f0){return db[_0xb1ba('0x62')]['findAll']({'where':{'id':_0x1316f1[_0xb1ba('0x36')][_0xb1ba('0x65')]},'attributes':['id'],'include':[{'model':db[_0xb1ba('0x58')],'as':_0xb1ba('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xb1ba('0x2a')](handleEntityNotFound(_0x3bc726,null))[_0xb1ba('0x2a')](function(_0x131940){var _0x4a21d6=_[_0xb1ba('0x32')](_0x131940,'id');var _0x12fb42=[];var _0x59f8d7=[];var _0x54ec5e=squel[_0xb1ba('0x6f')]();_0x54ec5e[_0xb1ba('0x70')]('tq.TeamId')[_0xb1ba('0x71')](_0xb1ba('0x72'),'tq')[_0xb1ba('0x73')](_0xb1ba('0x74'),'ut',_0xb1ba('0x75'))[_0xb1ba('0x40')](_0xb1ba('0x76'),_0x1316f1[_0xb1ba('0x4b')]['id']);for(var _0x420475=0x0;_0x420475<_0x131940[_0xb1ba('0x3b')];_0x420475+=0x1){let _0xf64f2e=_0x131940[_0x420475];for(var _0x480cc3=0x0;_0x480cc3<_0xf64f2e[_0xb1ba('0x6a')][_0xb1ba('0x3b')];_0x480cc3+=0x1){let _0x599bae=_0xf64f2e[_0xb1ba('0x6a')][_0x480cc3];var _0x5afeb5=_0x54ec5e['clone']();_0x5afeb5['where'](_0xb1ba('0x77'),_0x599bae['id']);_0x59f8d7['push'](db[_0xb1ba('0x6b')]['query'](_0x5afeb5[_0xb1ba('0x78')](),{'type':db[_0xb1ba('0x6b')][_0xb1ba('0x79')][_0xb1ba('0x7a')]})['then'](function(_0x2f2021){if(_0x2f2021[_0xb1ba('0x3b')]===0x1){return _0x599bae['id'];}else{var _0x418b2f=_['every'](_['map'](_0x2f2021,'TeamId'),function(_0x2c4d13){return _['includes'](_0x4a21d6,_0x2c4d13);});if(_0x418b2f){return _0x599bae['id'];}}}));}}return BPromise['all'](_0x59f8d7)['then'](function(_0x10052e){_0x12fb42=_(_0x12fb42)[_0xb1ba('0x7b')](_0x10052e)[_0xb1ba('0x7c')]()[_0xb1ba('0x7d')]();return db['FaxQueue'][_0xb1ba('0x4d')]({'where':{'id':_0x1316f1[_0xb1ba('0x4b')]['id']}})[_0xb1ba('0x2a')](function(_0xa92efe){return db[_0xb1ba('0x6b')][_0xb1ba('0x6c')](function(_0x4f7685){return _0xa92efe['removeTeams'](_0x1316f1[_0xb1ba('0x36')][_0xb1ba('0x65')],{'transaction':_0x4f7685})[_0xb1ba('0x2a')](function(){if(!_[_0xb1ba('0x7e')](_0x12fb42)){return _0xa92efe[_0xb1ba('0x7f')](_0x12fb42,{'transaction':_0x4f7685});}})[_0xb1ba('0x2a')](function(){_0x12fb42[_0xb1ba('0x6d')](function(_0xc21821){socket['emit'](_0xb1ba('0x80'),{'UserId':_0xc21821,'FaxQueueId':_0xa92efe['id']});});});});});});})['then'](respondWithStatusCode(_0x3bc726,null))['catch'](handleError(_0x3bc726,null));};exports[_0xb1ba('0x81')]=function(_0x152bd2,_0x36768d,_0x55abec){return db[_0xb1ba('0x33')]['find']({'where':{'id':_0x152bd2[_0xb1ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x36768d,null))[_0xb1ba('0x2a')](function(_0x4497a3){if(_0x4497a3){return _0x4497a3[_0xb1ba('0x81')](_0x152bd2[_0xb1ba('0x4f')][_0xb1ba('0x65')],_[_0xb1ba('0x82')](_0x152bd2[_0xb1ba('0x4f')],[_0xb1ba('0x65'),'id'])||{})[_0xb1ba('0x83')](function(_0x559da7){for(var _0xcbd949=0x0;_0xcbd949<_0x152bd2[_0xb1ba('0x4f')][_0xb1ba('0x65')]['length'];_0xcbd949+=0x1){socket[_0xb1ba('0x84')](_0xb1ba('0x85'),{'UserId':Number(_0x152bd2['body'][_0xb1ba('0x65')][_0xcbd949]),'FaxQueueId':Number(_0x152bd2[_0xb1ba('0x4b')]['id'])});}return _0x559da7;});}})[_0xb1ba('0x2a')](respondWithResult(_0x36768d,null))[_0xb1ba('0x49')](handleError(_0x36768d,null));};exports[_0xb1ba('0x7f')]=function(_0x1041d5,_0xae0498,_0x57f09a){return db[_0xb1ba('0x33')]['find']({'where':{'id':_0x1041d5['params']['id']}})[_0xb1ba('0x2a')](handleEntityNotFound(_0xae0498,null))['then'](function(_0x41da45){if(_0x41da45){return _0x41da45['removeAgents'](_0x1041d5[_0xb1ba('0x36')][_0xb1ba('0x65')])[_0xb1ba('0x2a')](function(){if(_[_0xb1ba('0x86')](_0x1041d5[_0xb1ba('0x36')]['ids'])){for(var _0x4c7b87=0x0;_0x4c7b87<_0x1041d5['query'][_0xb1ba('0x65')]['length'];_0x4c7b87+=0x1){socket['emit'](_0xb1ba('0x80'),{'UserId':Number(_0x1041d5['query']['ids'][_0x4c7b87]),'FaxQueueId':Number(_0x1041d5[_0xb1ba('0x4b')]['id'])});}}else{socket[_0xb1ba('0x84')](_0xb1ba('0x80'),{'UserId':Number(_0x1041d5[_0xb1ba('0x36')][_0xb1ba('0x65')]),'FaxQueueId':Number(_0x1041d5[_0xb1ba('0x4b')]['id'])});}});}})[_0xb1ba('0x2a')](respondWithStatusCode(_0xae0498,null))[_0xb1ba('0x49')](handleError(_0xae0498,null));};exports[_0xb1ba('0x87')]=function(_0x3aac1e,_0x37bf7a,_0x3e2bc1){var _0x55dd5b={};var _0x5dd469={};var _0x47f7fb;var _0x13ecdb;return db['FaxQueue'][_0xb1ba('0x61')]({'where':{'id':_0x3aac1e[_0xb1ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x37bf7a,null))['then'](function(_0x1d093e){if(_0x1d093e){_0x47f7fb=_0x1d093e;_0x5dd469[_0xb1ba('0x35')]=_[_0xb1ba('0x4c')](db[_0xb1ba('0x58')][_0xb1ba('0x34')]);_0x5dd469[_0xb1ba('0x36')]=_[_0xb1ba('0x4c')](_0x3aac1e['query']);_0x5dd469[_0xb1ba('0x37')]=_[_0xb1ba('0x38')](_0x5dd469[_0xb1ba('0x35')],_0x5dd469[_0xb1ba('0x36')]);_0x55dd5b[_0xb1ba('0x3a')]=_[_0xb1ba('0x38')](_0x5dd469[_0xb1ba('0x35')],qs[_0xb1ba('0x39')](_0x3aac1e[_0xb1ba('0x36')][_0xb1ba('0x39')]));_0x55dd5b['attributes']=_0x55dd5b[_0xb1ba('0x3a')][_0xb1ba('0x3b')]?_0x55dd5b['attributes']:_0x5dd469[_0xb1ba('0x35')];_0x55dd5b['order']=qs[_0xb1ba('0x3f')](_0x3aac1e[_0xb1ba('0x36')][_0xb1ba('0x3f')]);_0x55dd5b[_0xb1ba('0x40')]=qs[_0xb1ba('0x37')](_[_0xb1ba('0x55')](_0x3aac1e[_0xb1ba('0x36')],_0x5dd469[_0xb1ba('0x37')]));if(_0x3aac1e[_0xb1ba('0x36')][_0xb1ba('0x43')]){_0x55dd5b[_0xb1ba('0x40')]=_['merge'](_0x55dd5b[_0xb1ba('0x40')],{'$or':_[_0xb1ba('0x32')](_0x55dd5b[_0xb1ba('0x3a')],function(_0x32af62){var _0x41427c={};_0x41427c[_0x32af62]={'$like':'%'+_0x3aac1e[_0xb1ba('0x36')][_0xb1ba('0x43')]+'%'};return _0x41427c;})});}_0x55dd5b=_[_0xb1ba('0x41')]({},_0x55dd5b,_0x3aac1e[_0xb1ba('0x44')]);return _0x47f7fb[_0xb1ba('0x87')](_0x55dd5b);}})[_0xb1ba('0x2a')](function(_0x51d273){if(_0x51d273){_0x13ecdb=_0x51d273['length'];if(!_0x3aac1e[_0xb1ba('0x36')]['hasOwnProperty'](_0xb1ba('0x3d'))){_0x55dd5b['limit']=qs['limit'](_0x3aac1e[_0xb1ba('0x36')][_0xb1ba('0x23')]);_0x55dd5b[_0xb1ba('0x21')]=qs[_0xb1ba('0x21')](_0x3aac1e['query']['offset']);}return _0x47f7fb[_0xb1ba('0x87')](_0x55dd5b);}})['then'](function(_0x519627){if(_0x519627){return _0x519627?{'count':_0x13ecdb,'rows':_0x519627}:null;}})['then'](respondWithResult(_0x37bf7a,null))[_0xb1ba('0x49')](handleError(_0x37bf7a,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index aacddfe..8b5aae4 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 _0xcf35=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xcf35,0xa2));var _0x5cf3=function(_0x7da302,_0x16d521){_0x7da302=_0x7da302-0x0;var _0x1ee3dd=_0xcf35[_0x7da302];return _0x1ee3dd;};'use strict';var EventEmitter=require(_0x5cf3('0x0'));var FaxQueue=require(_0x5cf3('0x1'))['db'][_0x5cf3('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5cf3('0x3')](0x0);var events={'afterCreate':_0x5cf3('0x4'),'afterUpdate':_0x5cf3('0x5'),'afterDestroy':_0x5cf3('0x6')};function emitEvent(_0x3d2c2c){return function(_0x16b3d0,_0x4bc368,_0x51c2c9){FaxQueueEvents[_0x5cf3('0x7')](_0x3d2c2c+':'+_0x16b3d0['id'],_0x16b3d0);FaxQueueEvents['emit'](_0x3d2c2c,_0x16b3d0);_0x51c2c9(null);};}for(var e in events){if(events[_0x5cf3('0x8')](e)){var event=events[e];FaxQueue[_0x5cf3('0x9')](e,emitEvent(event));}}module[_0x5cf3('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x81b2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','remove'];(function(_0x2b93a5,_0x31934c){var _0x4111dc=function(_0x3d4f71){while(--_0x3d4f71){_0x2b93a5['push'](_0x2b93a5['shift']());}};_0x4111dc(++_0x31934c);}(_0x81b2,0x9a));var _0x281b=function(_0x57e50b,_0x16e856){_0x57e50b=_0x57e50b-0x0;var _0x4a1016=_0x81b2[_0x57e50b];return _0x4a1016;};'use strict';var EventEmitter=require(_0x281b('0x0'));var FaxQueue=require(_0x281b('0x1'))['db'][_0x281b('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x281b('0x3')](0x0);var events={'afterCreate':_0x281b('0x4'),'afterUpdate':'update','afterDestroy':_0x281b('0x5')};function emitEvent(_0xb93f5a){return function(_0x4cd0e2,_0x414eb9,_0x189bd8){FaxQueueEvents['emit'](_0xb93f5a+':'+_0x4cd0e2['id'],_0x4cd0e2);FaxQueueEvents[_0x281b('0x6')](_0xb93f5a,_0x4cd0e2);_0x189bd8(null);};}for(var e in events){if(events[_0x281b('0x7')](e)){var event=events[e];FaxQueue[_0x281b('0x8')](e,emitEvent(event));}}module[_0x281b('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 6a7dd86..12d4ffc 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 _0x4ed5=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','FaxQueue','fax_queues','util','../../config/logger'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x4ed5,0xe2));var _0x54ed=function(_0x1b517c,_0x23c626){_0x1b517c=_0x1b517c-0x0;var _0x52b50d=_0x4ed5[_0x1b517c];return _0x52b50d;};'use strict';var _=require('lodash');var util=require(_0x54ed('0x0'));var logger=require(_0x54ed('0x1'))(_0x54ed('0x2'));var moment=require(_0x54ed('0x3'));var BPromise=require(_0x54ed('0x4'));var rp=require(_0x54ed('0x5'));var fs=require('fs');var path=require(_0x54ed('0x6'));var rimraf=require('rimraf');var config=require(_0x54ed('0x7'));var attributes=require('./faxQueue.attributes');module[_0x54ed('0x8')]=function(_0x65db55,_0x3c93ee){return _0x65db55[_0x54ed('0x9')](_0x54ed('0xa'),attributes,{'tableName':_0x54ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd68=['request-promise','path','rimraf','../../config/environment','define','FaxQueue','fax_queues','lodash','../../config/logger','moment','bluebird'];(function(_0x257653,_0x1ac1ea){var _0x14b98f=function(_0x2c85ed){while(--_0x2c85ed){_0x257653['push'](_0x257653['shift']());}};_0x14b98f(++_0x1ac1ea);}(_0xbd68,0x1b4));var _0x8bd6=function(_0x3a18d6,_0x36d0fe){_0x3a18d6=_0x3a18d6-0x0;var _0x14a227=_0xbd68[_0x3a18d6];return _0x14a227;};'use strict';var _=require(_0x8bd6('0x0'));var util=require('util');var logger=require(_0x8bd6('0x1'))('api');var moment=require(_0x8bd6('0x2'));var BPromise=require(_0x8bd6('0x3'));var rp=require(_0x8bd6('0x4'));var fs=require('fs');var path=require(_0x8bd6('0x5'));var rimraf=require(_0x8bd6('0x6'));var config=require(_0x8bd6('0x7'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x1e00b3,_0x2611a2){return _0x1e00b3[_0x8bd6('0x8')](_0x8bd6('0x9'),attributes,{'tableName':_0x8bd6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 00c8f17..9200c85 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 _0xdee7=['client','http','redis','defaults','localhost','./faxQueue.socket','register','then','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','debug','stringify','ShowFaxQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0xa0f949,_0x398028){var _0x2b8715=function(_0x4cde18){while(--_0x4cde18){_0xa0f949['push'](_0xa0f949['shift']());}};_0x2b8715(++_0x398028);}(_0xdee7,0x128));var _0x7dee=function(_0xecc9aa,_0x245b47){_0xecc9aa=_0xecc9aa-0x0;var _0x709b3c=_0xdee7[_0xecc9aa];return _0x709b3c;};'use strict';var _=require(_0x7dee('0x0'));var util=require(_0x7dee('0x1'));var moment=require(_0x7dee('0x2'));var BPromise=require(_0x7dee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dee('0x4'))['db'];var utils=require(_0x7dee('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7dee('0x6'));var jayson=require(_0x7dee('0x7'));var client=jayson[_0x7dee('0x8')][_0x7dee('0x9')]({'port':0x232a});config[_0x7dee('0xa')]=_[_0x7dee('0xb')](config[_0x7dee('0xa')],{'host':_0x7dee('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7dee('0xd'))[_0x7dee('0xe')](socket);function respondWithRpcPromise(_0x2474f7,_0x75d8f8,_0x4b19c3){return new BPromise(function(_0x1e1210,_0x3d4886){return client['request'](_0x2474f7,_0x4b19c3)[_0x7dee('0xf')](function(_0x3e7c8d){logger[_0x7dee('0x10')]('FaxQueue,\x20%s,\x20%s',_0x75d8f8,_0x7dee('0x11'));logger['debug'](_0x7dee('0x12'),_0x75d8f8,_0x7dee('0x11'),JSON['stringify'](_0x3e7c8d));if(_0x3e7c8d[_0x7dee('0x13')]){if(_0x3e7c8d[_0x7dee('0x13')]['code']===0x1f4){logger[_0x7dee('0x13')](_0x7dee('0x14'),_0x75d8f8,_0x3e7c8d[_0x7dee('0x13')][_0x7dee('0x15')]);return _0x3d4886(_0x3e7c8d[_0x7dee('0x13')][_0x7dee('0x15')]);}logger[_0x7dee('0x13')](_0x7dee('0x14'),_0x75d8f8,_0x3e7c8d[_0x7dee('0x13')][_0x7dee('0x15')]);return _0x1e1210(_0x3e7c8d[_0x7dee('0x13')][_0x7dee('0x15')]);}else{logger[_0x7dee('0x10')](_0x7dee('0x14'),_0x75d8f8,_0x7dee('0x11'));_0x1e1210(_0x3e7c8d['result']['message']);}})[_0x7dee('0x16')](function(_0x4c456e){logger[_0x7dee('0x13')]('FaxQueue,\x20%s,\x20%s',_0x75d8f8,_0x4c456e);_0x3d4886(_0x4c456e);});});}exports[_0x7dee('0x17')]=function(_0x141ee7){var _0x351078=this;return new Promise(function(_0x130c68,_0x303f1c){return db[_0x7dee('0x18')][_0x7dee('0x19')]({'raw':_0x141ee7['options']?_0x141ee7[_0x7dee('0x1a')][_0x7dee('0x1b')]===undefined?!![]:![]:!![],'where':_0x141ee7[_0x7dee('0x1a')]?_0x141ee7['options'][_0x7dee('0x1c')]||null:null,'attributes':_0x141ee7['options']?_0x141ee7[_0x7dee('0x1a')][_0x7dee('0x1d')]||null:null,'limit':_0x141ee7[_0x7dee('0x1a')]?_0x141ee7['options'][_0x7dee('0x1e')]||null:null,'include':_0x141ee7[_0x7dee('0x1a')]?_0x141ee7[_0x7dee('0x1a')]['include']?_[_0x7dee('0x1f')](_0x141ee7['options'][_0x7dee('0x20')],function(_0x384ee5){return{'model':db[_0x384ee5[_0x7dee('0x21')]],'as':_0x384ee5['as'],'attributes':_0x384ee5[_0x7dee('0x1d')],'include':_0x384ee5[_0x7dee('0x20')]?_[_0x7dee('0x1f')](_0x384ee5[_0x7dee('0x20')],function(_0x275c76){return{'model':db[_0x275c76[_0x7dee('0x21')]],'as':_0x275c76['as'],'attributes':_0x275c76[_0x7dee('0x1d')],'include':_0x275c76[_0x7dee('0x20')]?_['map'](_0x275c76['include'],function(_0x20fca5){return{'model':db[_0x20fca5[_0x7dee('0x21')]],'as':_0x20fca5['as'],'attributes':_0x20fca5['attributes']};}):[]};}):[]};}):[]:[]})[_0x7dee('0xf')](function(_0x3d1cb2){logger[_0x7dee('0x10')](_0x7dee('0x17'),_0x141ee7);logger[_0x7dee('0x22')](_0x7dee('0x17'),_0x141ee7,JSON[_0x7dee('0x23')](_0x3d1cb2));_0x130c68(_0x3d1cb2);})[_0x7dee('0x16')](function(_0x3258a9){logger[_0x7dee('0x13')](_0x7dee('0x17'),_0x3258a9[_0x7dee('0x15')],_0x141ee7);_0x303f1c(_0x351078['error'](0x1f4,_0x3258a9[_0x7dee('0x15')]));});});};exports[_0x7dee('0x24')]=function(_0x384b54){var _0x4b2d34=this;return new Promise(function(_0x29672b,_0x479d83){return db[_0x7dee('0x18')][_0x7dee('0x25')]({'raw':_0x384b54[_0x7dee('0x1a')]?_0x384b54[_0x7dee('0x1a')][_0x7dee('0x1b')]===undefined?!![]:![]:!![],'where':_0x384b54[_0x7dee('0x1a')]?_0x384b54[_0x7dee('0x1a')][_0x7dee('0x1c')]||null:null,'attributes':_0x384b54[_0x7dee('0x1a')]?_0x384b54[_0x7dee('0x1a')][_0x7dee('0x1d')]||null:null,'include':_0x384b54[_0x7dee('0x1a')]?_0x384b54['options']['include']?_['map'](_0x384b54[_0x7dee('0x1a')][_0x7dee('0x20')],function(_0x16df0a){return{'model':db[_0x16df0a[_0x7dee('0x21')]],'as':_0x16df0a['as'],'attributes':_0x16df0a[_0x7dee('0x1d')],'include':_0x16df0a['include']?_[_0x7dee('0x1f')](_0x16df0a[_0x7dee('0x20')],function(_0x2bff36){return{'model':db[_0x2bff36['model']],'as':_0x2bff36['as'],'attributes':_0x2bff36[_0x7dee('0x1d')],'include':_0x2bff36['include']?_['map'](_0x2bff36['include'],function(_0x3cdade){return{'model':db[_0x3cdade['model']],'as':_0x3cdade['as'],'attributes':_0x3cdade[_0x7dee('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7dee('0xf')](function(_0x2bea3a){logger[_0x7dee('0x10')]('ShowFaxQueue',_0x384b54);logger[_0x7dee('0x22')]('ShowFaxQueue',_0x384b54,JSON[_0x7dee('0x23')](_0x2bea3a));_0x29672b(_0x2bea3a);})[_0x7dee('0x16')](function(_0x53805b){logger[_0x7dee('0x13')](_0x7dee('0x24'),_0x53805b['message'],_0x384b54);_0x479d83(_0x4b2d34[_0x7dee('0x13')](0x1f4,_0x53805b[_0x7dee('0x15')]));});});}; \ No newline at end of file +var _0x703f=['include','map','stringify','ShowFaxQueue','FaxQueue','find','model','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFaxQueue','findAll','options','where','attributes'];(function(_0x4d46ac,_0x4b25c4){var _0x2dba51=function(_0x50d748){while(--_0x50d748){_0x4d46ac['push'](_0x4d46ac['shift']());}};_0x2dba51(++_0x4b25c4);}(_0x703f,0x16f));var _0xf703=function(_0x29611a,_0x11ce01){_0x29611a=_0x29611a-0x0;var _0x4e00c1=_0x703f[_0x29611a];return _0x4e00c1;};'use strict';var _=require(_0xf703('0x0'));var util=require('util');var moment=require(_0xf703('0x1'));var BPromise=require(_0xf703('0x2'));var rs=require(_0xf703('0x3'));var fs=require('fs');var Redis=require(_0xf703('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf703('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf703('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf703('0x7')]['http']({'port':0x232a});config['redis']=_[_0xf703('0x8')](config[_0xf703('0x9')],{'host':_0xf703('0xa'),'port':0x18eb});var socket=require(_0xf703('0xb'))(new Redis(config[_0xf703('0x9')]));require(_0xf703('0xc'))[_0xf703('0xd')](socket);function respondWithRpcPromise(_0x25dd6c,_0x1ad6fb,_0x13f67e){return new BPromise(function(_0x4b5478,_0x124f52){return client['request'](_0x25dd6c,_0x13f67e)[_0xf703('0xe')](function(_0x840176){logger[_0xf703('0xf')](_0xf703('0x10'),_0x1ad6fb,_0xf703('0x11'));logger[_0xf703('0x12')](_0xf703('0x13'),_0x1ad6fb,'request\x20sent',JSON['stringify'](_0x840176));if(_0x840176['error']){if(_0x840176[_0xf703('0x14')]['code']===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x1ad6fb,_0x840176['error']['message']);return _0x124f52(_0x840176[_0xf703('0x14')][_0xf703('0x15')]);}logger[_0xf703('0x14')](_0xf703('0x10'),_0x1ad6fb,_0x840176[_0xf703('0x14')][_0xf703('0x15')]);return _0x4b5478(_0x840176[_0xf703('0x14')][_0xf703('0x15')]);}else{logger[_0xf703('0xf')]('FaxQueue,\x20%s,\x20%s',_0x1ad6fb,_0xf703('0x11'));_0x4b5478(_0x840176[_0xf703('0x16')][_0xf703('0x15')]);}})[_0xf703('0x17')](function(_0x2bc350){logger['error'](_0xf703('0x10'),_0x1ad6fb,_0x2bc350);_0x124f52(_0x2bc350);});});}exports[_0xf703('0x18')]=function(_0x295ad7){var _0x16fd7b=this;return new Promise(function(_0x5847c8,_0x50e1a0){return db['FaxQueue'][_0xf703('0x19')]({'raw':_0x295ad7[_0xf703('0x1a')]?_0x295ad7[_0xf703('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x295ad7[_0xf703('0x1a')]?_0x295ad7[_0xf703('0x1a')][_0xf703('0x1b')]||null:null,'attributes':_0x295ad7[_0xf703('0x1a')]?_0x295ad7[_0xf703('0x1a')][_0xf703('0x1c')]||null:null,'limit':_0x295ad7[_0xf703('0x1a')]?_0x295ad7[_0xf703('0x1a')]['limit']||null:null,'include':_0x295ad7[_0xf703('0x1a')]?_0x295ad7[_0xf703('0x1a')][_0xf703('0x1d')]?_[_0xf703('0x1e')](_0x295ad7[_0xf703('0x1a')]['include'],function(_0x103eda){return{'model':db[_0x103eda['model']],'as':_0x103eda['as'],'attributes':_0x103eda[_0xf703('0x1c')],'include':_0x103eda[_0xf703('0x1d')]?_[_0xf703('0x1e')](_0x103eda['include'],function(_0x444019){return{'model':db[_0x444019['model']],'as':_0x444019['as'],'attributes':_0x444019['attributes'],'include':_0x444019[_0xf703('0x1d')]?_[_0xf703('0x1e')](_0x444019[_0xf703('0x1d')],function(_0xc11087){return{'model':db[_0xc11087['model']],'as':_0xc11087['as'],'attributes':_0xc11087[_0xf703('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf703('0xe')](function(_0x5aa8fa){logger[_0xf703('0xf')]('GetFaxQueue',_0x295ad7);logger[_0xf703('0x12')](_0xf703('0x18'),_0x295ad7,JSON[_0xf703('0x1f')](_0x5aa8fa));_0x5847c8(_0x5aa8fa);})[_0xf703('0x17')](function(_0x2187c5){logger[_0xf703('0x14')]('GetFaxQueue',_0x2187c5[_0xf703('0x15')],_0x295ad7);_0x50e1a0(_0x16fd7b['error'](0x1f4,_0x2187c5[_0xf703('0x15')]));});});};exports[_0xf703('0x20')]=function(_0x51ba04){var _0x8af454=this;return new Promise(function(_0x30bed4,_0x4400f9){return db[_0xf703('0x21')][_0xf703('0x22')]({'raw':_0x51ba04[_0xf703('0x1a')]?_0x51ba04[_0xf703('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x51ba04[_0xf703('0x1a')]?_0x51ba04[_0xf703('0x1a')]['where']||null:null,'attributes':_0x51ba04['options']?_0x51ba04[_0xf703('0x1a')][_0xf703('0x1c')]||null:null,'include':_0x51ba04[_0xf703('0x1a')]?_0x51ba04[_0xf703('0x1a')][_0xf703('0x1d')]?_['map'](_0x51ba04['options'][_0xf703('0x1d')],function(_0x2e13f6){return{'model':db[_0x2e13f6['model']],'as':_0x2e13f6['as'],'attributes':_0x2e13f6[_0xf703('0x1c')],'include':_0x2e13f6[_0xf703('0x1d')]?_[_0xf703('0x1e')](_0x2e13f6[_0xf703('0x1d')],function(_0x55de3b){return{'model':db[_0x55de3b['model']],'as':_0x55de3b['as'],'attributes':_0x55de3b[_0xf703('0x1c')],'include':_0x55de3b[_0xf703('0x1d')]?_[_0xf703('0x1e')](_0x55de3b[_0xf703('0x1d')],function(_0x564f27){return{'model':db[_0x564f27[_0xf703('0x23')]],'as':_0x564f27['as'],'attributes':_0x564f27[_0xf703('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x261830){logger[_0xf703('0xf')](_0xf703('0x20'),_0x51ba04);logger['debug'](_0xf703('0x20'),_0x51ba04,JSON['stringify'](_0x261830));_0x30bed4(_0x261830);})['catch'](function(_0x8ba8e6){logger['error'](_0xf703('0x20'),_0x8ba8e6[_0xf703('0x15')],_0x51ba04);_0x4400f9(_0x8af454['error'](0x1f4,_0x8ba8e6[_0xf703('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 41e7561..09a7727 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 _0x5f05=['removeListener','length','faxQueue:','./faxQueue.events','remove','emit'];(function(_0x268d63,_0x969e6c){var _0x25f0e0=function(_0x2594e0){while(--_0x2594e0){_0x268d63['push'](_0x268d63['shift']());}};_0x25f0e0(++_0x969e6c);}(_0x5f05,0x147));var _0x55f0=function(_0x3a3c64,_0x10eb88){_0x3a3c64=_0x3a3c64-0x0;var _0xd755aa=_0x5f05[_0x3a3c64];return _0xd755aa;};'use strict';var FaxQueueEvents=require(_0x55f0('0x0'));var events=['save',_0x55f0('0x1'),'update'];function createListener(_0xa712f0,_0x381b1a){return function(_0x3e8137){_0x381b1a[_0x55f0('0x2')](_0xa712f0,_0x3e8137);};}function removeListener(_0xbc2fb7,_0x3b841b){return function(){FaxQueueEvents[_0x55f0('0x3')](_0xbc2fb7,_0x3b841b);};}exports['register']=function(_0x186222){for(var _0x2706ff=0x0,_0x715faa=events[_0x55f0('0x4')];_0x2706ff<_0x715faa;_0x2706ff++){var _0x16959b=events[_0x2706ff];var _0x582329=createListener(_0x55f0('0x5')+_0x16959b,_0x186222);FaxQueueEvents['on'](_0x16959b,_0x582329);}}; \ No newline at end of file +var _0x7eef=['length','faxQueue:','save','remove','update','removeListener','register'];(function(_0x2401d2,_0x57caea){var _0x17c81f=function(_0x43259f){while(--_0x43259f){_0x2401d2['push'](_0x2401d2['shift']());}};_0x17c81f(++_0x57caea);}(_0x7eef,0x87));var _0xf7ee=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x7eef[_0x2af29a];return _0x5ef02f;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf7ee('0x0'),_0xf7ee('0x1'),_0xf7ee('0x2')];function createListener(_0x3ae9cb,_0x145e92){return function(_0x5a892){_0x145e92['emit'](_0x3ae9cb,_0x5a892);};}function removeListener(_0x5641c2,_0x140e41){return function(){FaxQueueEvents[_0xf7ee('0x3')](_0x5641c2,_0x140e41);};}exports[_0xf7ee('0x4')]=function(_0x4f0b23){for(var _0x320d93=0x0,_0x534d17=events[_0xf7ee('0x5')];_0x320d93<_0x534d17;_0x320d93++){var _0x60f9ae=events[_0x320d93];var _0x47683b=createListener(_0xf7ee('0x6')+_0x60f9ae,_0x4f0b23);FaxQueueEvents['on'](_0x60f9ae,_0x47683b);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 9c0086c..e425653 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 _0x8506=['addTeams','put','update','delete','destroy','removeTeams','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0x8506,0xe8));var _0x6850=function(_0xc6dfb,_0x352a13){_0xc6dfb=_0xc6dfb-0x0;var _0x1b4de9=_0x8506[_0xc6dfb];return _0x1b4de9;};'use strict';var multer=require('multer');var util=require(_0x6850('0x0'));var path=require('path');var timeout=require(_0x6850('0x1'));var express=require('express');var router=express[_0x6850('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6850('0x3'));var interaction=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var controller=require('./faxQueue.controller');router[_0x6850('0x6')]('/',auth[_0x6850('0x7')](),controller[_0x6850('0x8')]);router[_0x6850('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6850('0x6')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller['show']);router['get'](_0x6850('0xa'),auth[_0x6850('0x7')](),controller[_0x6850('0xb')]);router[_0x6850('0x6')](_0x6850('0xc'),auth['isAuthenticated'](),controller[_0x6850('0xd')]);router[_0x6850('0x6')](_0x6850('0xe'),auth[_0x6850('0x7')](),controller[_0x6850('0xf')]);router[_0x6850('0x10')]('/',auth['isAuthenticated'](),controller[_0x6850('0x11')]);router[_0x6850('0x10')](_0x6850('0xc'),auth[_0x6850('0x7')](),controller[_0x6850('0x12')]);router[_0x6850('0x10')]('/:id/users',auth[_0x6850('0x7')](),controller['addAgents']);router[_0x6850('0x13')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller[_0x6850('0x14')]);router[_0x6850('0x15')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller[_0x6850('0x16')]);router[_0x6850('0x15')](_0x6850('0xc'),auth[_0x6850('0x7')](),controller[_0x6850('0x17')]);router[_0x6850('0x15')](_0x6850('0xe'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x6850('0x18')]=router; \ No newline at end of file +var _0x0eeb=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','addTeams','addAgents','put','update','delete','destroy','removeAgents','multer','util','path'];(function(_0xd3af98,_0x45e301){var _0x1d2fd3=function(_0x5434e4){while(--_0x5434e4){_0xd3af98['push'](_0xd3af98['shift']());}};_0x1d2fd3(++_0x45e301);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0eeb[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var path=require(_0xb0ee('0x2'));var timeout=require(_0xb0ee('0x3'));var express=require(_0xb0ee('0x4'));var router=express[_0xb0ee('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb0ee('0x6'));var config=require(_0xb0ee('0x7'));var controller=require(_0xb0ee('0x8'));router[_0xb0ee('0x9')]('/',auth[_0xb0ee('0xa')](),controller[_0xb0ee('0xb')]);router[_0xb0ee('0x9')]('/describe',auth[_0xb0ee('0xa')](),controller['describe']);router[_0xb0ee('0x9')](_0xb0ee('0xc'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0xd')]);router[_0xb0ee('0x9')](_0xb0ee('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xb0ee('0x9')](_0xb0ee('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xb0ee('0x9')](_0xb0ee('0x10'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x11')]);router['post']('/',auth[_0xb0ee('0xa')](),controller['create']);router['post']('/:id/teams',auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x12')]);router['post'](_0xb0ee('0x10'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x13')]);router[_0xb0ee('0x14')](_0xb0ee('0xc'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x15')]);router[_0xb0ee('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb0ee('0x17')]);router['delete'](_0xb0ee('0xf'),auth[_0xb0ee('0xa')](),controller['removeTeams']);router['delete'](_0xb0ee('0x10'),auth[_0xb0ee('0xa')](),controller[_0xb0ee('0x18')]);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 0dfcd26..4767363 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 _0xc7b3=['DATE','moment','sequelize','exports','STRING'];(function(_0x34d952,_0xe5545d){var _0x42c9e0=function(_0x316fdc){while(--_0x316fdc){_0x34d952['push'](_0x34d952['shift']());}};_0x42c9e0(++_0xe5545d);}(_0xc7b3,0x10a));var _0x3c7b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc7b3[_0x465a0c];return _0x1e202e;};'use strict';var moment=require(_0x3c7b('0x0'));var Sequelize=require(_0x3c7b('0x1'));module[_0x3c7b('0x2')]={'uniqueid':{'type':Sequelize[_0x3c7b('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3c7b('0x4')]},'leaveAt':{'type':Sequelize[_0x3c7b('0x4')]},'acceptAt':{'type':Sequelize[_0x3c7b('0x4')]},'exitAt':{'type':Sequelize[_0x3c7b('0x4')]},'reason':{'type':Sequelize[_0x3c7b('0x3')]}}; \ No newline at end of file +var _0x2e5a=['DATE','moment','sequelize','exports','STRING'];(function(_0x45afe3,_0x798a3e){var _0x182f2e=function(_0x376da6){while(--_0x376da6){_0x45afe3['push'](_0x45afe3['shift']());}};_0x182f2e(++_0x798a3e);}(_0x2e5a,0x182));var _0xa2e5=function(_0x53b7cd,_0x4b2806){_0x53b7cd=_0x53b7cd-0x0;var _0x14e15a=_0x2e5a[_0x53b7cd];return _0x14e15a;};'use strict';var moment=require(_0xa2e5('0x0'));var Sequelize=require(_0xa2e5('0x1'));module[_0xa2e5('0x2')]={'uniqueid':{'type':Sequelize[_0xa2e5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa2e5('0x3')]},'joinAt':{'type':Sequelize[_0xa2e5('0x4')]},'leaveAt':{'type':Sequelize[_0xa2e5('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa2e5('0x4')]},'reason':{'type':Sequelize[_0xa2e5('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index e94b66f..6b0a373 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 _0xbe45=['pick','filter','where','VIRTUAL','merge','options','FaxQueueReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x299511,_0x38f383){var _0x45ca1b=function(_0x47ebbc){while(--_0x47ebbc){_0x299511['push'](_0x299511['shift']());}};_0x45ca1b(++_0x38f383);}(_0xbe45,0xf0));var _0x5be4=function(_0x2f56cd,_0x2e2620){_0x2f56cd=_0x2f56cd-0x0;var _0xc57d09=_0xbe45[_0x2f56cd];return _0xc57d09;};'use strict';var emlformat=require(_0x5be4('0x0'));var rimraf=require(_0x5be4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5be4('0x2'));var rp=require(_0x5be4('0x3'));var moment=require(_0x5be4('0x4'));var BPromise=require(_0x5be4('0x5'));var Mustache=require(_0x5be4('0x6'));var util=require(_0x5be4('0x7'));var path=require('path');var sox=require(_0x5be4('0x8'));var csv=require(_0x5be4('0x9'));var ejs=require(_0x5be4('0xa'));var fs=require('fs');var fs_extra=require(_0x5be4('0xb'));var _=require(_0x5be4('0xc'));var squel=require(_0x5be4('0xd'));var crypto=require(_0x5be4('0xe'));var jsforce=require(_0x5be4('0xf'));var deskjs=require(_0x5be4('0x10'));var toCsv=require(_0x5be4('0x9'));var querystring=require(_0x5be4('0x11'));var Papa=require(_0x5be4('0x12'));var Redis=require(_0x5be4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5be4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5be4('0x15'))('api');var utils=require(_0x5be4('0x16'));var config=require(_0x5be4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5be4('0x18'))['db'];function respondWithStatusCode(_0x43a60f,_0x1d7960){_0x1d7960=_0x1d7960||0xcc;return function(_0x5c6615){if(_0x5c6615){return _0x43a60f[_0x5be4('0x19')](_0x1d7960);}return _0x43a60f['status'](_0x1d7960)[_0x5be4('0x1a')]();};}function respondWithResult(_0x2afee8,_0x2dd93e){_0x2dd93e=_0x2dd93e||0xc8;return function(_0x335842){if(_0x335842){return _0x2afee8[_0x5be4('0x1b')](_0x2dd93e)[_0x5be4('0x1c')](_0x335842);}};}function respondWithFilteredResult(_0x3980fc,_0x5ebe65){return function(_0x3e830e){if(_0x3e830e){var _0x8466a7=typeof _0x5ebe65[_0x5be4('0x1d')]===_0x5be4('0x1e')&&typeof _0x5ebe65[_0x5be4('0x1f')]===_0x5be4('0x1e');var _0x94f434=_0x3e830e[_0x5be4('0x20')];var _0x51662a=_0x8466a7?0x0:_0x5ebe65[_0x5be4('0x1d')];var _0x50b970=_0x8466a7?_0x3e830e['count']:_0x5ebe65[_0x5be4('0x1d')]+_0x5ebe65[_0x5be4('0x1f')];var _0x4cce93;if(_0x50b970>=_0x94f434){_0x50b970=_0x94f434;_0x4cce93=0xc8;}else{_0x4cce93=0xce;}_0x3980fc[_0x5be4('0x1b')](_0x4cce93);return _0x3980fc[_0x5be4('0x21')]('Content-Range',_0x51662a+'-'+_0x50b970+'/'+_0x94f434)['json'](_0x3e830e);}return null;};}function patchUpdates(_0x2690be){return function(_0x207948){try{jsonpatch['apply'](_0x207948,_0x2690be,!![]);}catch(_0x553f59){return BPromise[_0x5be4('0x22')](_0x553f59);}return _0x207948[_0x5be4('0x23')]();};}function saveUpdates(_0x2843e3,_0x3ccd67){return function(_0xa20552){if(_0xa20552){return _0xa20552['update'](_0x2843e3)[_0x5be4('0x24')](function(_0x51d7a7){return _0x51d7a7;});}return null;};}function removeEntity(_0x242005,_0x12b9cd){return function(_0x4d6eff){if(_0x4d6eff){return _0x4d6eff[_0x5be4('0x25')]()[_0x5be4('0x24')](function(){_0x242005['status'](0xcc)[_0x5be4('0x1a')]();});}};}function handleEntityNotFound(_0x2b2e2c,_0x353a65){return function(_0x39cf54){if(!_0x39cf54){_0x2b2e2c[_0x5be4('0x19')](0x194);}return _0x39cf54;};}function handleError(_0x13779f,_0x112728){_0x112728=_0x112728||0x1f4;return function(_0x5b49ea){logger['error'](_0x5b49ea[_0x5be4('0x26')]);if(_0x5b49ea[_0x5be4('0x27')]){delete _0x5b49ea[_0x5be4('0x27')];}_0x13779f['status'](_0x112728)[_0x5be4('0x28')](_0x5b49ea);};}exports[_0x5be4('0x29')]=function(_0x3bd842,_0x412ef6){var _0x16f3bf={},_0x1e0485={},_0x4b9029={'count':0x0,'rows':[]};var _0x1661c2=_[_0x5be4('0x2a')](db['FaxQueueReport'][_0x5be4('0x2b')],function(_0x49780a){return{'name':_0x49780a[_0x5be4('0x2c')],'type':_0x49780a[_0x5be4('0x2d')]['key']};});_0x1e0485[_0x5be4('0x2e')]=_['map'](_0x1661c2,'name');_0x1e0485[_0x5be4('0x2f')]=_[_0x5be4('0x30')](_0x3bd842[_0x5be4('0x2f')]);_0x1e0485[_0x5be4('0x31')]=_[_0x5be4('0x32')](_0x1e0485[_0x5be4('0x2e')],_0x1e0485[_0x5be4('0x2f')]);_0x16f3bf[_0x5be4('0x33')]=_[_0x5be4('0x32')](_0x1e0485[_0x5be4('0x2e')],qs[_0x5be4('0x34')](_0x3bd842[_0x5be4('0x2f')]['fields']));_0x16f3bf['attributes']=_0x16f3bf[_0x5be4('0x33')][_0x5be4('0x35')]?_0x16f3bf[_0x5be4('0x33')]:_0x1e0485[_0x5be4('0x2e')];if(!_0x3bd842['query'][_0x5be4('0x36')]('nolimit')){_0x16f3bf[_0x5be4('0x1f')]=qs['limit'](_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x1f')]);_0x16f3bf['offset']=qs['offset'](_0x3bd842[_0x5be4('0x2f')]['offset']);}_0x16f3bf['order']=qs[_0x5be4('0x37')](_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x37')]);_0x16f3bf['where']=qs[_0x5be4('0x31')](_[_0x5be4('0x38')](_0x3bd842['query'],_0x1e0485[_0x5be4('0x31')]),_0x1661c2);if(_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x39')]){_0x16f3bf[_0x5be4('0x3a')]=_['merge'](_0x16f3bf[_0x5be4('0x3a')],{'$or':_[_0x5be4('0x2a')](_0x1661c2,function(_0x178500){if(_0x178500[_0x5be4('0x2d')]!==_0x5be4('0x3b')){var _0x3ddba4={};_0x3ddba4[_0x178500[_0x5be4('0x27')]]={'$like':'%'+_0x3bd842[_0x5be4('0x2f')]['filter']+'%'};return _0x3ddba4;}})});}_0x16f3bf=_[_0x5be4('0x3c')]({},_0x16f3bf,_0x3bd842[_0x5be4('0x3d')]);var _0x348c30={'where':_0x16f3bf[_0x5be4('0x3a')]};return db[_0x5be4('0x3e')]['count'](_0x348c30)[_0x5be4('0x24')](function(_0x344411){_0x4b9029['count']=_0x344411;if(_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x3f')]){_0x16f3bf['include']=[{'all':!![]}];}return db[_0x5be4('0x3e')][_0x5be4('0x40')](_0x16f3bf);})[_0x5be4('0x24')](function(_0x1d480c){_0x4b9029[_0x5be4('0x41')]=_0x1d480c;return _0x4b9029;})[_0x5be4('0x24')](respondWithFilteredResult(_0x412ef6,_0x16f3bf))[_0x5be4('0x42')](handleError(_0x412ef6,null));};exports[_0x5be4('0x43')]=function(_0x2313d6,_0x53974f){var _0x1add45={'raw':!![],'where':{'id':_0x2313d6[_0x5be4('0x44')]['id']}},_0x536473={};_0x536473[_0x5be4('0x2e')]=_['keys'](db[_0x5be4('0x3e')]['rawAttributes']);_0x536473['query']=_[_0x5be4('0x30')](_0x2313d6[_0x5be4('0x2f')]);_0x536473[_0x5be4('0x31')]=_[_0x5be4('0x32')](_0x536473[_0x5be4('0x2e')],_0x536473[_0x5be4('0x2f')]);_0x1add45[_0x5be4('0x33')]=_['intersection'](_0x536473[_0x5be4('0x2e')],qs['fields'](_0x2313d6[_0x5be4('0x2f')]['fields']));_0x1add45[_0x5be4('0x33')]=_0x1add45[_0x5be4('0x33')]['length']?_0x1add45[_0x5be4('0x33')]:_0x536473[_0x5be4('0x2e')];if(_0x2313d6[_0x5be4('0x2f')]['includeAll']){_0x1add45[_0x5be4('0x45')]=[{'all':!![]}];}_0x1add45=_[_0x5be4('0x3c')]({},_0x1add45,_0x2313d6['options']);return db[_0x5be4('0x3e')]['find'](_0x1add45)['then'](handleEntityNotFound(_0x53974f,null))[_0x5be4('0x24')](respondWithResult(_0x53974f,null))[_0x5be4('0x42')](handleError(_0x53974f,null));};exports['create']=function(_0x47734f,_0x57f25d){return db['FaxQueueReport'][_0x5be4('0x46')](_0x47734f[_0x5be4('0x47')],{})[_0x5be4('0x24')](respondWithResult(_0x57f25d,0xc9))['catch'](handleError(_0x57f25d,null));};exports['update']=function(_0x378ae7,_0x2fb7cd){if(_0x378ae7[_0x5be4('0x47')]['id']){delete _0x378ae7[_0x5be4('0x47')]['id'];}return db['FaxQueueReport'][_0x5be4('0x48')]({'where':{'id':_0x378ae7[_0x5be4('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fb7cd,null))[_0x5be4('0x24')](saveUpdates(_0x378ae7[_0x5be4('0x47')],null))[_0x5be4('0x24')](respondWithResult(_0x2fb7cd,null))['catch'](handleError(_0x2fb7cd,null));};exports[_0x5be4('0x25')]=function(_0x3481c9,_0xc9ca2f){return db[_0x5be4('0x3e')][_0x5be4('0x48')]({'where':{'id':_0x3481c9[_0x5be4('0x44')]['id']}})[_0x5be4('0x24')](handleEntityNotFound(_0xc9ca2f,null))[_0x5be4('0x24')](removeEntity(_0xc9ca2f,null))[_0x5be4('0x42')](handleError(_0xc9ca2f,null));};exports[_0x5be4('0x49')]=function(_0x5f0999,_0x2caec3){return db['FaxQueueReport'][_0x5be4('0x49')]()[_0x5be4('0x24')](respondWithResult(_0x2caec3,null))[_0x5be4('0x42')](handleError(_0x2caec3,null));}; \ No newline at end of file +var _0xce25=['limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','catch','show','params','length','includeAll','find','create','body','update','describe','zip-dir','bluebird','mustache','path','sox','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','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count'];(function(_0x1299d2,_0x652fd6){var _0x206e38=function(_0x5967b6){while(--_0x5967b6){_0x1299d2['push'](_0x1299d2['shift']());}};_0x206e38(++_0x652fd6);}(_0xce25,0x196));var _0x5ce2=function(_0x3b7576,_0x181ee5){_0x3b7576=_0x3b7576-0x0;var _0x48a85f=_0xce25[_0x3b7576];return _0x48a85f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ce2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ce2('0x1'));var Mustache=require(_0x5ce2('0x2'));var util=require('util');var path=require(_0x5ce2('0x3'));var sox=require(_0x5ce2('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ce2('0x5'));var _=require(_0x5ce2('0x6'));var squel=require(_0x5ce2('0x7'));var crypto=require(_0x5ce2('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5ce2('0x9'));var toCsv=require(_0x5ce2('0xa'));var querystring=require(_0x5ce2('0xb'));var Papa=require('papaparse');var Redis=require(_0x5ce2('0xc'));var authService=require(_0x5ce2('0xd'));var qs=require(_0x5ce2('0xe'));var as=require(_0x5ce2('0xf'));var hardwareService=require(_0x5ce2('0x10'));var logger=require(_0x5ce2('0x11'))('api');var utils=require(_0x5ce2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5ce2('0x13'));var db=require(_0x5ce2('0x14'))['db'];function respondWithStatusCode(_0x5387b2,_0x496c1e){_0x496c1e=_0x496c1e||0xcc;return function(_0x595d33){if(_0x595d33){return _0x5387b2['sendStatus'](_0x496c1e);}return _0x5387b2[_0x5ce2('0x15')](_0x496c1e)['end']();};}function respondWithResult(_0x5360b8,_0x3a69ec){_0x3a69ec=_0x3a69ec||0xc8;return function(_0x56bd1b){if(_0x56bd1b){return _0x5360b8[_0x5ce2('0x15')](_0x3a69ec)[_0x5ce2('0x16')](_0x56bd1b);}};}function respondWithFilteredResult(_0x24522c,_0x53e047){return function(_0x36a2a5){if(_0x36a2a5){var _0x2727c7=typeof _0x53e047[_0x5ce2('0x17')]==='undefined'&&typeof _0x53e047['limit']===_0x5ce2('0x18');var _0x2509c6=_0x36a2a5[_0x5ce2('0x19')];var _0x5369e7=_0x2727c7?0x0:_0x53e047[_0x5ce2('0x17')];var _0x30cb39=_0x2727c7?_0x36a2a5[_0x5ce2('0x19')]:_0x53e047[_0x5ce2('0x17')]+_0x53e047[_0x5ce2('0x1a')];var _0x2f9013;if(_0x30cb39>=_0x2509c6){_0x30cb39=_0x2509c6;_0x2f9013=0xc8;}else{_0x2f9013=0xce;}_0x24522c[_0x5ce2('0x15')](_0x2f9013);return _0x24522c[_0x5ce2('0x1b')](_0x5ce2('0x1c'),_0x5369e7+'-'+_0x30cb39+'/'+_0x2509c6)[_0x5ce2('0x16')](_0x36a2a5);}return null;};}function patchUpdates(_0x3519c4){return function(_0x2d32c9){try{jsonpatch[_0x5ce2('0x1d')](_0x2d32c9,_0x3519c4,!![]);}catch(_0x3cf781){return BPromise[_0x5ce2('0x1e')](_0x3cf781);}return _0x2d32c9[_0x5ce2('0x1f')]();};}function saveUpdates(_0x13d32d,_0x28899f){return function(_0x350fd9){if(_0x350fd9){return _0x350fd9['update'](_0x13d32d)['then'](function(_0x2e6251){return _0x2e6251;});}return null;};}function removeEntity(_0x2e9675,_0x3440b5){return function(_0x4f27aa){if(_0x4f27aa){return _0x4f27aa['destroy']()[_0x5ce2('0x20')](function(){_0x2e9675[_0x5ce2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3008af,_0x3ab8c8){return function(_0x25accf){if(!_0x25accf){_0x3008af[_0x5ce2('0x21')](0x194);}return _0x25accf;};}function handleError(_0x44c692,_0x208448){_0x208448=_0x208448||0x1f4;return function(_0x3a4bb9){logger[_0x5ce2('0x22')](_0x3a4bb9[_0x5ce2('0x23')]);if(_0x3a4bb9[_0x5ce2('0x24')]){delete _0x3a4bb9[_0x5ce2('0x24')];}_0x44c692[_0x5ce2('0x15')](_0x208448)[_0x5ce2('0x25')](_0x3a4bb9);};}exports[_0x5ce2('0x26')]=function(_0xf57c7e,_0x3ee0cd){var _0x33d83c={},_0x2898ae={},_0x444d56={'count':0x0,'rows':[]};var _0x127a83=_[_0x5ce2('0x27')](db[_0x5ce2('0x28')][_0x5ce2('0x29')],function(_0x35bb72){return{'name':_0x35bb72[_0x5ce2('0x2a')],'type':_0x35bb72[_0x5ce2('0x2b')][_0x5ce2('0x2c')]};});_0x2898ae[_0x5ce2('0x2d')]=_[_0x5ce2('0x27')](_0x127a83,_0x5ce2('0x24'));_0x2898ae[_0x5ce2('0x2e')]=_[_0x5ce2('0x2f')](_0xf57c7e['query']);_0x2898ae[_0x5ce2('0x30')]=_[_0x5ce2('0x31')](_0x2898ae[_0x5ce2('0x2d')],_0x2898ae['query']);_0x33d83c['attributes']=_[_0x5ce2('0x31')](_0x2898ae[_0x5ce2('0x2d')],qs[_0x5ce2('0x32')](_0xf57c7e['query']['fields']));_0x33d83c[_0x5ce2('0x33')]=_0x33d83c[_0x5ce2('0x33')]['length']?_0x33d83c[_0x5ce2('0x33')]:_0x2898ae[_0x5ce2('0x2d')];if(!_0xf57c7e[_0x5ce2('0x2e')][_0x5ce2('0x34')](_0x5ce2('0x35'))){_0x33d83c[_0x5ce2('0x1a')]=qs[_0x5ce2('0x1a')](_0xf57c7e[_0x5ce2('0x2e')][_0x5ce2('0x1a')]);_0x33d83c[_0x5ce2('0x17')]=qs[_0x5ce2('0x17')](_0xf57c7e['query']['offset']);}_0x33d83c['order']=qs['sort'](_0xf57c7e[_0x5ce2('0x2e')][_0x5ce2('0x36')]);_0x33d83c[_0x5ce2('0x37')]=qs[_0x5ce2('0x30')](_[_0x5ce2('0x38')](_0xf57c7e[_0x5ce2('0x2e')],_0x2898ae[_0x5ce2('0x30')]),_0x127a83);if(_0xf57c7e[_0x5ce2('0x2e')][_0x5ce2('0x39')]){_0x33d83c[_0x5ce2('0x37')]=_[_0x5ce2('0x3a')](_0x33d83c[_0x5ce2('0x37')],{'$or':_['map'](_0x127a83,function(_0x425417){if(_0x425417[_0x5ce2('0x2b')]!=='VIRTUAL'){var _0x468637={};_0x468637[_0x425417[_0x5ce2('0x24')]]={'$like':'%'+_0xf57c7e[_0x5ce2('0x2e')][_0x5ce2('0x39')]+'%'};return _0x468637;}})});}_0x33d83c=_['merge']({},_0x33d83c,_0xf57c7e[_0x5ce2('0x3b')]);var _0x3c6377={'where':_0x33d83c[_0x5ce2('0x37')]};return db[_0x5ce2('0x28')][_0x5ce2('0x19')](_0x3c6377)[_0x5ce2('0x20')](function(_0x5ab123){_0x444d56[_0x5ce2('0x19')]=_0x5ab123;if(_0xf57c7e[_0x5ce2('0x2e')]['includeAll']){_0x33d83c[_0x5ce2('0x3c')]=[{'all':!![]}];}return db[_0x5ce2('0x28')]['findAll'](_0x33d83c);})[_0x5ce2('0x20')](function(_0x413a16){_0x444d56[_0x5ce2('0x3d')]=_0x413a16;return _0x444d56;})[_0x5ce2('0x20')](respondWithFilteredResult(_0x3ee0cd,_0x33d83c))[_0x5ce2('0x3e')](handleError(_0x3ee0cd,null));};exports[_0x5ce2('0x3f')]=function(_0x3ec79d,_0x370e3e){var _0x3fde76={'raw':!![],'where':{'id':_0x3ec79d[_0x5ce2('0x40')]['id']}},_0x49a759={};_0x49a759[_0x5ce2('0x2d')]=_['keys'](db[_0x5ce2('0x28')]['rawAttributes']);_0x49a759[_0x5ce2('0x2e')]=_[_0x5ce2('0x2f')](_0x3ec79d[_0x5ce2('0x2e')]);_0x49a759[_0x5ce2('0x30')]=_[_0x5ce2('0x31')](_0x49a759[_0x5ce2('0x2d')],_0x49a759[_0x5ce2('0x2e')]);_0x3fde76['attributes']=_[_0x5ce2('0x31')](_0x49a759[_0x5ce2('0x2d')],qs[_0x5ce2('0x32')](_0x3ec79d[_0x5ce2('0x2e')]['fields']));_0x3fde76[_0x5ce2('0x33')]=_0x3fde76[_0x5ce2('0x33')][_0x5ce2('0x41')]?_0x3fde76[_0x5ce2('0x33')]:_0x49a759['model'];if(_0x3ec79d[_0x5ce2('0x2e')][_0x5ce2('0x42')]){_0x3fde76[_0x5ce2('0x3c')]=[{'all':!![]}];}_0x3fde76=_[_0x5ce2('0x3a')]({},_0x3fde76,_0x3ec79d['options']);return db[_0x5ce2('0x28')][_0x5ce2('0x43')](_0x3fde76)[_0x5ce2('0x20')](handleEntityNotFound(_0x370e3e,null))[_0x5ce2('0x20')](respondWithResult(_0x370e3e,null))[_0x5ce2('0x3e')](handleError(_0x370e3e,null));};exports['create']=function(_0xb2734,_0x2fe4d4){return db[_0x5ce2('0x28')][_0x5ce2('0x44')](_0xb2734[_0x5ce2('0x45')],{})[_0x5ce2('0x20')](respondWithResult(_0x2fe4d4,0xc9))[_0x5ce2('0x3e')](handleError(_0x2fe4d4,null));};exports[_0x5ce2('0x46')]=function(_0x1c29af,_0x215d5){if(_0x1c29af['body']['id']){delete _0x1c29af[_0x5ce2('0x45')]['id'];}return db[_0x5ce2('0x28')][_0x5ce2('0x43')]({'where':{'id':_0x1c29af['params']['id']}})[_0x5ce2('0x20')](handleEntityNotFound(_0x215d5,null))['then'](saveUpdates(_0x1c29af[_0x5ce2('0x45')],null))['then'](respondWithResult(_0x215d5,null))[_0x5ce2('0x3e')](handleError(_0x215d5,null));};exports['destroy']=function(_0x50568c,_0x4ae957){return db[_0x5ce2('0x28')][_0x5ce2('0x43')]({'where':{'id':_0x50568c[_0x5ce2('0x40')]['id']}})[_0x5ce2('0x20')](handleEntityNotFound(_0x4ae957,null))[_0x5ce2('0x20')](removeEntity(_0x4ae957,null))[_0x5ce2('0x3e')](handleError(_0x4ae957,null));};exports[_0x5ce2('0x47')]=function(_0x54d572,_0x51944a){return db['FaxQueueReport']['describe']()[_0x5ce2('0x20')](respondWithResult(_0x51944a,null))['catch'](handleError(_0x51944a,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e032b2c..759239b 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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x3a6699,_0x1ab9a4){var _0x27df97=function(_0x4b44a4){while(--_0x4b44a4){_0x3a6699['push'](_0x3a6699['shift']());}};_0x27df97(++_0x1ab9a4);}(_0xf494,0x1c6));var _0x4f49=function(_0x2353b3,_0x62f7cb){_0x2353b3=_0x2353b3-0x0;var _0x34aeeb=_0xf494[_0x2353b3];return _0x34aeeb;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xc9457e,_0x49f315){var _0x23cd3d=function(_0x40e148){while(--_0x40e148){_0xc9457e['push'](_0xc9457e['shift']());}};_0x23cd3d(++_0x49f315);}(_0x4975,0x86));var _0x5497=function(_0x27eda2,_0x93ed20){_0x27eda2=_0x27eda2-0x0;var _0x59f8b2=_0x4975[_0x27eda2];return _0x59f8b2;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index fcae2c2..b365812 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 _0x8e9e=['body','raw','info','UpdateFaxQueueReport','update','options','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create'];(function(_0x283f7f,_0x39422d){var _0x4623fa=function(_0x29a002){while(--_0x29a002){_0x283f7f['push'](_0x283f7f['shift']());}};_0x4623fa(++_0x39422d);}(_0x8e9e,0x1d6));var _0xe8e9=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0x8e9e[_0x5d61b4];return _0x183fc5;};'use strict';var _=require(_0xe8e9('0x0'));var util=require(_0xe8e9('0x1'));var moment=require('moment');var BPromise=require(_0xe8e9('0x2'));var rs=require(_0xe8e9('0x3'));var fs=require('fs');var Redis=require(_0xe8e9('0x4'));var db=require(_0xe8e9('0x5'))['db'];var utils=require(_0xe8e9('0x6'));var logger=require(_0xe8e9('0x7'))(_0xe8e9('0x8'));var config=require('../../config/environment');var jayson=require(_0xe8e9('0x9'));var client=jayson[_0xe8e9('0xa')][_0xe8e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c9de3,_0x518d37,_0x3a4eba){return new BPromise(function(_0xc30e3c,_0x21e769){return client['request'](_0x3c9de3,_0x3a4eba)[_0xe8e9('0xc')](function(_0x2fd2a1){logger['info'](_0xe8e9('0xd'),_0x518d37,'request\x20sent');logger[_0xe8e9('0xe')](_0xe8e9('0xf'),_0x518d37,_0xe8e9('0x10'),JSON[_0xe8e9('0x11')](_0x2fd2a1));if(_0x2fd2a1[_0xe8e9('0x12')]){if(_0x2fd2a1['error'][_0xe8e9('0x13')]===0x1f4){logger[_0xe8e9('0x12')](_0xe8e9('0xd'),_0x518d37,_0x2fd2a1[_0xe8e9('0x12')][_0xe8e9('0x14')]);return _0x21e769(_0x2fd2a1[_0xe8e9('0x12')][_0xe8e9('0x14')]);}logger[_0xe8e9('0x12')](_0xe8e9('0xd'),_0x518d37,_0x2fd2a1[_0xe8e9('0x12')][_0xe8e9('0x14')]);return _0xc30e3c(_0x2fd2a1[_0xe8e9('0x12')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x518d37,_0xe8e9('0x10'));_0xc30e3c(_0x2fd2a1['result'][_0xe8e9('0x14')]);}})[_0xe8e9('0x15')](function(_0x572880){logger['error'](_0xe8e9('0xd'),_0x518d37,_0x572880);_0x21e769(_0x572880);});});}exports[_0xe8e9('0x16')]=function(_0xb27f2d){var _0x1727d6=this;return new Promise(function(_0x45715a,_0x77795d){return db[_0xe8e9('0x17')][_0xe8e9('0x18')](_0xb27f2d[_0xe8e9('0x19')],{'raw':_0xb27f2d['options']?_0xb27f2d['options'][_0xe8e9('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5ce70b){logger[_0xe8e9('0x1b')](_0xe8e9('0x16'),_0xb27f2d);logger[_0xe8e9('0xe')](_0xe8e9('0x16'),_0xb27f2d,JSON[_0xe8e9('0x11')](_0x5ce70b));_0x45715a(_0x5ce70b);})[_0xe8e9('0x15')](function(_0x408dd7){logger[_0xe8e9('0x12')](_0xe8e9('0x16'),_0x408dd7['message'],_0xb27f2d);_0x77795d(_0x1727d6[_0xe8e9('0x12')](0x1f4,_0x408dd7[_0xe8e9('0x14')]));});});};exports[_0xe8e9('0x1c')]=function(_0x4f41c2){var _0x288f76=this;return new Promise(function(_0x11e693,_0x162792){return db['FaxQueueReport'][_0xe8e9('0x1d')](_0x4f41c2[_0xe8e9('0x19')],{'raw':_0x4f41c2[_0xe8e9('0x1e')]?_0x4f41c2['options'][_0xe8e9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f41c2['options']?_0x4f41c2[_0xe8e9('0x1e')]['where']||null:null,'attributes':_0x4f41c2[_0xe8e9('0x1e')]?_0x4f41c2[_0xe8e9('0x1e')][_0xe8e9('0x1f')]||null:null,'limit':_0x4f41c2[_0xe8e9('0x1e')]?_0x4f41c2[_0xe8e9('0x1e')][_0xe8e9('0x20')]||null:null})[_0xe8e9('0xc')](function(_0x3d9eb6){logger[_0xe8e9('0x1b')](_0xe8e9('0x1c'),_0x4f41c2);logger[_0xe8e9('0xe')](_0xe8e9('0x1c'),_0x4f41c2,JSON[_0xe8e9('0x11')](_0x3d9eb6));_0x11e693(_0x3d9eb6);})[_0xe8e9('0x15')](function(_0x5943c9){logger['error'](_0xe8e9('0x1c'),_0x5943c9[_0xe8e9('0x14')],_0x4f41c2);_0x162792(_0x288f76[_0xe8e9('0x12')](0x1f4,_0x5943c9[_0xe8e9('0x14')]));});});}; \ No newline at end of file +var _0xaa4e=['stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0xaa4e,0x96));var _0xeaa4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xaa4e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xeaa4('0x0'));var util=require(_0xeaa4('0x1'));var moment=require('moment');var BPromise=require(_0xeaa4('0x2'));var rs=require(_0xeaa4('0x3'));var fs=require('fs');var Redis=require(_0xeaa4('0x4'));var db=require(_0xeaa4('0x5'))['db'];var utils=require(_0xeaa4('0x6'));var logger=require('../../config/logger')(_0xeaa4('0x7'));var config=require(_0xeaa4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26f7ad,_0x36a5c8,_0x159b2f){return new BPromise(function(_0x38b45d,_0x15973e){return client[_0xeaa4('0x9')](_0x26f7ad,_0x159b2f)[_0xeaa4('0xa')](function(_0x72c936){logger[_0xeaa4('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x36a5c8,_0xeaa4('0xc'));logger[_0xeaa4('0xd')](_0xeaa4('0xe'),_0x36a5c8,_0xeaa4('0xc'),JSON[_0xeaa4('0xf')](_0x72c936));if(_0x72c936[_0xeaa4('0x10')]){if(_0x72c936[_0xeaa4('0x10')][_0xeaa4('0x11')]===0x1f4){logger['error'](_0xeaa4('0x12'),_0x36a5c8,_0x72c936['error']['message']);return _0x15973e(_0x72c936[_0xeaa4('0x10')][_0xeaa4('0x13')]);}logger[_0xeaa4('0x10')](_0xeaa4('0x12'),_0x36a5c8,_0x72c936['error'][_0xeaa4('0x13')]);return _0x38b45d(_0x72c936[_0xeaa4('0x10')][_0xeaa4('0x13')]);}else{logger[_0xeaa4('0xb')](_0xeaa4('0x12'),_0x36a5c8,_0xeaa4('0xc'));_0x38b45d(_0x72c936[_0xeaa4('0x14')][_0xeaa4('0x13')]);}})[_0xeaa4('0x15')](function(_0x5a742a){logger[_0xeaa4('0x10')](_0xeaa4('0x12'),_0x36a5c8,_0x5a742a);_0x15973e(_0x5a742a);});});}exports[_0xeaa4('0x16')]=function(_0x4354d6){var _0x5829bb=this;return new Promise(function(_0x364460,_0x28806f){return db[_0xeaa4('0x17')][_0xeaa4('0x18')](_0x4354d6[_0xeaa4('0x19')],{'raw':_0x4354d6['options']?_0x4354d6[_0xeaa4('0x1a')][_0xeaa4('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3576f1){logger[_0xeaa4('0xb')](_0xeaa4('0x16'),_0x4354d6);logger['debug'](_0xeaa4('0x16'),_0x4354d6,JSON[_0xeaa4('0xf')](_0x3576f1));_0x364460(_0x3576f1);})['catch'](function(_0x176537){logger[_0xeaa4('0x10')](_0xeaa4('0x16'),_0x176537['message'],_0x4354d6);_0x28806f(_0x5829bb[_0xeaa4('0x10')](0x1f4,_0x176537[_0xeaa4('0x13')]));});});};exports[_0xeaa4('0x1c')]=function(_0x43b006){var _0x441b13=this;return new Promise(function(_0x5958b2,_0x22514c){return db[_0xeaa4('0x17')][_0xeaa4('0x1d')](_0x43b006[_0xeaa4('0x19')],{'raw':_0x43b006[_0xeaa4('0x1a')]?_0x43b006[_0xeaa4('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43b006[_0xeaa4('0x1a')]?_0x43b006[_0xeaa4('0x1a')][_0xeaa4('0x1e')]||null:null,'attributes':_0x43b006['options']?_0x43b006[_0xeaa4('0x1a')][_0xeaa4('0x1f')]||null:null,'limit':_0x43b006['options']?_0x43b006[_0xeaa4('0x1a')][_0xeaa4('0x20')]||null:null})[_0xeaa4('0xa')](function(_0x5cea5f){logger[_0xeaa4('0xb')](_0xeaa4('0x1c'),_0x43b006);logger['debug'](_0xeaa4('0x1c'),_0x43b006,JSON[_0xeaa4('0xf')](_0x5cea5f));_0x5958b2(_0x5cea5f);})['catch'](function(_0x2f5d09){logger['error'](_0xeaa4('0x1c'),_0x2f5d09[_0xeaa4('0x13')],_0x43b006);_0x22514c(_0x441b13[_0xeaa4('0x10')](0x1f4,_0x2f5d09[_0xeaa4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 9c69f0b..c12619d 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 _0x8c1f=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','/:id','update'];(function(_0x3f9c9d,_0x115318){var _0x1a4e90=function(_0xdd504f){while(--_0xdd504f){_0x3f9c9d['push'](_0x3f9c9d['shift']());}};_0x1a4e90(++_0x115318);}(_0x8c1f,0x6b));var _0xf8c1=function(_0x263403,_0x3c5d4b){_0x263403=_0x263403-0x0;var _0x5ba742=_0x8c1f[_0x263403];return _0x5ba742;};'use strict';var multer=require(_0xf8c1('0x0'));var util=require(_0xf8c1('0x1'));var path=require(_0xf8c1('0x2'));var timeout=require(_0xf8c1('0x3'));var express=require(_0xf8c1('0x4'));var router=express['Router']();var fs_extra=require(_0xf8c1('0x5'));var auth=require(_0xf8c1('0x6'));var interaction=require(_0xf8c1('0x7'));var config=require(_0xf8c1('0x8'));var controller=require('./faxQueueReport.controller');router[_0xf8c1('0x9')]('/',auth[_0xf8c1('0xa')](),controller[_0xf8c1('0xb')]);router['get']('/describe',auth[_0xf8c1('0xa')](),controller[_0xf8c1('0xc')]);router[_0xf8c1('0x9')]('/:id',auth[_0xf8c1('0xa')](),controller[_0xf8c1('0xd')]);router[_0xf8c1('0xe')]('/',auth[_0xf8c1('0xa')](),controller[_0xf8c1('0xf')]);router[_0xf8c1('0x10')](_0xf8c1('0x11'),auth['isAuthenticated'](),controller[_0xf8c1('0x12')]);router['delete'](_0xf8c1('0x11'),auth['isAuthenticated'](),controller[_0xf8c1('0x13')]);module[_0xf8c1('0x14')]=router; \ No newline at end of file +var _0x8e7c=['get','/describe','isAuthenticated','describe','/:id','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index'];(function(_0x3ba2a3,_0x34d0ba){var _0x2d0e38=function(_0x12ee87){while(--_0x12ee87){_0x3ba2a3['push'](_0x3ba2a3['shift']());}};_0x2d0e38(++_0x34d0ba);}(_0x8e7c,0xa2));var _0xc8e7=function(_0x29965d,_0x52a4e9){_0x29965d=_0x29965d-0x0;var _0x384766=_0x8e7c[_0x29965d];return _0x384766;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc8e7('0x0'));var timeout=require(_0xc8e7('0x1'));var express=require(_0xc8e7('0x2'));var router=express[_0xc8e7('0x3')]();var fs_extra=require(_0xc8e7('0x4'));var auth=require(_0xc8e7('0x5'));var interaction=require(_0xc8e7('0x6'));var config=require(_0xc8e7('0x7'));var controller=require('./faxQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc8e7('0x8')]);router[_0xc8e7('0x9')](_0xc8e7('0xa'),auth[_0xc8e7('0xb')](),controller[_0xc8e7('0xc')]);router[_0xc8e7('0x9')](_0xc8e7('0xd'),auth[_0xc8e7('0xb')](),controller['show']);router[_0xc8e7('0xe')]('/',auth[_0xc8e7('0xb')](),controller[_0xc8e7('0xf')]);router[_0xc8e7('0x10')](_0xc8e7('0xd'),auth[_0xc8e7('0xb')](),controller['update']);router['delete'](_0xc8e7('0xd'),auth[_0xc8e7('0xb')](),controller[_0xc8e7('0x11')]);module[_0xc8e7('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index e33479d..a080c6f 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x9d1180,_0x2f71fb){var _0x155274=function(_0x1867c1){while(--_0x1867c1){_0x9d1180['push'](_0x9d1180['shift']());}};_0x155274(++_0x2f71fb);}(_0x54ef,0x112));var _0xf54e=function(_0x169c6f,_0x19bb0f){_0x169c6f=_0x169c6f-0x0;var _0x4a62fe=_0x54ef[_0x169c6f];return _0x4a62fe;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x12e35f,_0x3781ad){var _0x469ba0=function(_0x14dc33){while(--_0x14dc33){_0x12e35f['push'](_0x12e35f['shift']());}};_0x469ba0(++_0x3781ad);}(_0xaa88,0x137));var _0x8aa8=function(_0x11b1b3,_0xf3cc69){_0x11b1b3=_0x11b1b3-0x0;var _0x437029=_0xaa88[_0x11b1b3];return _0x437029;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index cc3072f..4c7cd1f 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 _0x2e7a=['mustache','util','path','sox','squel','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','FaxTransferReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0xda9f84,_0x69a268){var _0x200288=function(_0x3f0a41){while(--_0x3f0a41){_0xda9f84['push'](_0xda9f84['shift']());}};_0x200288(++_0x69a268);}(_0x2e7a,0x1ec));var _0xa2e7=function(_0x38b2a8,_0x46fcde){_0x38b2a8=_0x38b2a8-0x0;var _0x4981b6=_0x2e7a[_0x38b2a8];return _0x4981b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2e7('0x0'));var zipdir=require(_0xa2e7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa2e7('0x2'));var moment=require(_0xa2e7('0x3'));var BPromise=require(_0xa2e7('0x4'));var Mustache=require(_0xa2e7('0x5'));var util=require(_0xa2e7('0x6'));var path=require(_0xa2e7('0x7'));var sox=require(_0xa2e7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa2e7('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa2e7('0xa'));var querystring=require('querystring');var Papa=require(_0xa2e7('0xb'));var Redis=require(_0xa2e7('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xa2e7('0xd'));var as=require(_0xa2e7('0xe'));var hardwareService=require(_0xa2e7('0xf'));var logger=require('../../config/logger')(_0xa2e7('0x10'));var utils=require(_0xa2e7('0x11'));var config=require(_0xa2e7('0x12'));var licenseUtil=require(_0xa2e7('0x13'));var db=require(_0xa2e7('0x14'))['db'];function respondWithStatusCode(_0x1f93a0,_0x4939f2){_0x4939f2=_0x4939f2||0xcc;return function(_0x522f88){if(_0x522f88){return _0x1f93a0[_0xa2e7('0x15')](_0x4939f2);}return _0x1f93a0[_0xa2e7('0x16')](_0x4939f2)['end']();};}function respondWithResult(_0x568608,_0x2e6362){_0x2e6362=_0x2e6362||0xc8;return function(_0x3ccd2a){if(_0x3ccd2a){return _0x568608[_0xa2e7('0x16')](_0x2e6362)[_0xa2e7('0x17')](_0x3ccd2a);}};}function respondWithFilteredResult(_0x16f234,_0xfbdc41){return function(_0x150a4b){if(_0x150a4b){var _0x225dc9=typeof _0xfbdc41[_0xa2e7('0x18')]===_0xa2e7('0x19')&&typeof _0xfbdc41[_0xa2e7('0x1a')]===_0xa2e7('0x19');var _0x4d32a6=_0x150a4b[_0xa2e7('0x1b')];var _0x1443ae=_0x225dc9?0x0:_0xfbdc41['offset'];var _0x25c220=_0x225dc9?_0x150a4b['count']:_0xfbdc41[_0xa2e7('0x18')]+_0xfbdc41[_0xa2e7('0x1a')];var _0x385ade;if(_0x25c220>=_0x4d32a6){_0x25c220=_0x4d32a6;_0x385ade=0xc8;}else{_0x385ade=0xce;}_0x16f234['status'](_0x385ade);return _0x16f234[_0xa2e7('0x1c')](_0xa2e7('0x1d'),_0x1443ae+'-'+_0x25c220+'/'+_0x4d32a6)[_0xa2e7('0x17')](_0x150a4b);}return null;};}function patchUpdates(_0x3647df){return function(_0xd19ab8){try{jsonpatch[_0xa2e7('0x1e')](_0xd19ab8,_0x3647df,!![]);}catch(_0x2852c0){return BPromise['reject'](_0x2852c0);}return _0xd19ab8[_0xa2e7('0x1f')]();};}function saveUpdates(_0x20bc52,_0x49c98c){return function(_0x256dd7){if(_0x256dd7){return _0x256dd7[_0xa2e7('0x20')](_0x20bc52)[_0xa2e7('0x21')](function(_0x11ca76){return _0x11ca76;});}return null;};}function removeEntity(_0x36cea9,_0x433cfb){return function(_0xd21fe1){if(_0xd21fe1){return _0xd21fe1['destroy']()[_0xa2e7('0x21')](function(){_0x36cea9[_0xa2e7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d642,_0xa71a5c){return function(_0x517e7a){if(!_0x517e7a){_0x42d642[_0xa2e7('0x15')](0x194);}return _0x517e7a;};}function handleError(_0x14eebf,_0xd9bc6b){_0xd9bc6b=_0xd9bc6b||0x1f4;return function(_0x2f6ec5){logger[_0xa2e7('0x22')](_0x2f6ec5[_0xa2e7('0x23')]);if(_0x2f6ec5['name']){delete _0x2f6ec5[_0xa2e7('0x24')];}_0x14eebf['status'](_0xd9bc6b)['send'](_0x2f6ec5);};}exports[_0xa2e7('0x25')]=function(_0x4dca91,_0x1984bd){var _0x13e5a8={},_0x255e80={},_0x15c200={'count':0x0,'rows':[]};var _0x3f8e88=_[_0xa2e7('0x26')](db[_0xa2e7('0x27')]['rawAttributes'],function(_0x439479){return{'name':_0x439479[_0xa2e7('0x28')],'type':_0x439479[_0xa2e7('0x29')]['key']};});_0x255e80[_0xa2e7('0x2a')]=_['map'](_0x3f8e88,'name');_0x255e80[_0xa2e7('0x2b')]=_[_0xa2e7('0x2c')](_0x4dca91[_0xa2e7('0x2b')]);_0x255e80[_0xa2e7('0x2d')]=_['intersection'](_0x255e80['model'],_0x255e80[_0xa2e7('0x2b')]);_0x13e5a8['attributes']=_[_0xa2e7('0x2e')](_0x255e80[_0xa2e7('0x2a')],qs[_0xa2e7('0x2f')](_0x4dca91['query']['fields']));_0x13e5a8['attributes']=_0x13e5a8[_0xa2e7('0x30')][_0xa2e7('0x31')]?_0x13e5a8[_0xa2e7('0x30')]:_0x255e80[_0xa2e7('0x2a')];if(!_0x4dca91['query']['hasOwnProperty'](_0xa2e7('0x32'))){_0x13e5a8[_0xa2e7('0x1a')]=qs[_0xa2e7('0x1a')](_0x4dca91[_0xa2e7('0x2b')][_0xa2e7('0x1a')]);_0x13e5a8['offset']=qs['offset'](_0x4dca91['query']['offset']);}_0x13e5a8[_0xa2e7('0x33')]=qs['sort'](_0x4dca91[_0xa2e7('0x2b')][_0xa2e7('0x34')]);_0x13e5a8['where']=qs[_0xa2e7('0x2d')](_[_0xa2e7('0x35')](_0x4dca91[_0xa2e7('0x2b')],_0x255e80[_0xa2e7('0x2d')]),_0x3f8e88);if(_0x4dca91[_0xa2e7('0x2b')][_0xa2e7('0x36')]){_0x13e5a8[_0xa2e7('0x37')]=_[_0xa2e7('0x38')](_0x13e5a8['where'],{'$or':_[_0xa2e7('0x26')](_0x3f8e88,function(_0xeac260){if(_0xeac260[_0xa2e7('0x29')]!==_0xa2e7('0x39')){var _0x1ab22e={};_0x1ab22e[_0xeac260['name']]={'$like':'%'+_0x4dca91[_0xa2e7('0x2b')][_0xa2e7('0x36')]+'%'};return _0x1ab22e;}})});}_0x13e5a8=_[_0xa2e7('0x38')]({},_0x13e5a8,_0x4dca91[_0xa2e7('0x3a')]);var _0x5d8e8d={'where':_0x13e5a8[_0xa2e7('0x37')]};return db[_0xa2e7('0x27')][_0xa2e7('0x1b')](_0x5d8e8d)[_0xa2e7('0x21')](function(_0xfd7a41){_0x15c200[_0xa2e7('0x1b')]=_0xfd7a41;if(_0x4dca91[_0xa2e7('0x2b')][_0xa2e7('0x3b')]){_0x13e5a8[_0xa2e7('0x3c')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xa2e7('0x3d')](_0x13e5a8);})[_0xa2e7('0x21')](function(_0x177193){_0x15c200[_0xa2e7('0x3e')]=_0x177193;return _0x15c200;})[_0xa2e7('0x21')](respondWithFilteredResult(_0x1984bd,_0x13e5a8))[_0xa2e7('0x3f')](handleError(_0x1984bd,null));};exports[_0xa2e7('0x40')]=function(_0x37b69e,_0x366f8d){var _0x57441a={'raw':!![],'where':{'id':_0x37b69e[_0xa2e7('0x41')]['id']}},_0x537b42={};_0x537b42[_0xa2e7('0x2a')]=_[_0xa2e7('0x2c')](db[_0xa2e7('0x27')][_0xa2e7('0x42')]);_0x537b42[_0xa2e7('0x2b')]=_[_0xa2e7('0x2c')](_0x37b69e['query']);_0x537b42['filters']=_['intersection'](_0x537b42[_0xa2e7('0x2a')],_0x537b42['query']);_0x57441a['attributes']=_[_0xa2e7('0x2e')](_0x537b42[_0xa2e7('0x2a')],qs['fields'](_0x37b69e[_0xa2e7('0x2b')][_0xa2e7('0x2f')]));_0x57441a[_0xa2e7('0x30')]=_0x57441a[_0xa2e7('0x30')][_0xa2e7('0x31')]?_0x57441a['attributes']:_0x537b42[_0xa2e7('0x2a')];if(_0x37b69e[_0xa2e7('0x2b')]['includeAll']){_0x57441a[_0xa2e7('0x3c')]=[{'all':!![]}];}_0x57441a=_['merge']({},_0x57441a,_0x37b69e[_0xa2e7('0x3a')]);return db[_0xa2e7('0x27')][_0xa2e7('0x43')](_0x57441a)['then'](handleEntityNotFound(_0x366f8d,null))['then'](respondWithResult(_0x366f8d,null))[_0xa2e7('0x3f')](handleError(_0x366f8d,null));};exports['create']=function(_0x14292c,_0x37b4c0){return db[_0xa2e7('0x27')][_0xa2e7('0x44')](_0x14292c[_0xa2e7('0x45')],{})[_0xa2e7('0x21')](respondWithResult(_0x37b4c0,0xc9))[_0xa2e7('0x3f')](handleError(_0x37b4c0,null));};exports[_0xa2e7('0x20')]=function(_0xe750b3,_0x1af5ee){if(_0xe750b3[_0xa2e7('0x45')]['id']){delete _0xe750b3[_0xa2e7('0x45')]['id'];}return db['FaxTransferReport'][_0xa2e7('0x43')]({'where':{'id':_0xe750b3[_0xa2e7('0x41')]['id']}})[_0xa2e7('0x21')](handleEntityNotFound(_0x1af5ee,null))['then'](saveUpdates(_0xe750b3['body'],null))[_0xa2e7('0x21')](respondWithResult(_0x1af5ee,null))[_0xa2e7('0x3f')](handleError(_0x1af5ee,null));};exports['destroy']=function(_0x2b5222,_0x5236b5){return db[_0xa2e7('0x27')][_0xa2e7('0x43')]({'where':{'id':_0x2b5222[_0xa2e7('0x41')]['id']}})[_0xa2e7('0x21')](handleEntityNotFound(_0x5236b5,null))[_0xa2e7('0x21')](removeEntity(_0x5236b5,null))[_0xa2e7('0x3f')](handleError(_0x5236b5,null));};exports['describe']=function(_0x529107,_0x166bae){return db[_0xa2e7('0x27')][_0xa2e7('0x46')]()['then'](respondWithResult(_0x166bae,null))[_0xa2e7('0x3f')](handleError(_0x166bae,null));}; \ No newline at end of file +var _0xb7d8=['model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','map','VIRTUAL','count','includeAll','include','findAll','rows','show','params','fields','merge','find','catch','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','Content-Range','json','reject','update','then','destroy','stack','name','send','FaxTransferReport','rawAttributes','fieldName','type','key'];(function(_0x2c1750,_0x22dccb){var _0x119d2b=function(_0x35f209){while(--_0x35f209){_0x2c1750['push'](_0x2c1750['shift']());}};_0x119d2b(++_0x22dccb);}(_0xb7d8,0x13a));var _0x8b7d=function(_0x85d510,_0x4430e1){_0x85d510=_0x85d510-0x0;var _0x425935=_0xb7d8[_0x85d510];return _0x425935;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8b7d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b7d('0x1'));var moment=require(_0x8b7d('0x2'));var BPromise=require(_0x8b7d('0x3'));var Mustache=require(_0x8b7d('0x4'));var util=require(_0x8b7d('0x5'));var path=require('path');var sox=require(_0x8b7d('0x6'));var csv=require(_0x8b7d('0x7'));var ejs=require(_0x8b7d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b7d('0x9'));var squel=require('squel');var crypto=require(_0x8b7d('0xa'));var jsforce=require(_0x8b7d('0xb'));var deskjs=require(_0x8b7d('0xc'));var toCsv=require(_0x8b7d('0x7'));var querystring=require(_0x8b7d('0xd'));var Papa=require(_0x8b7d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8b7d('0xf'));var as=require(_0x8b7d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8b7d('0x11'));var utils=require(_0x8b7d('0x12'));var config=require(_0x8b7d('0x13'));var licenseUtil=require(_0x8b7d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47119e,_0x230183){_0x230183=_0x230183||0xcc;return function(_0x25c63a){if(_0x25c63a){return _0x47119e[_0x8b7d('0x15')](_0x230183);}return _0x47119e['status'](_0x230183)[_0x8b7d('0x16')]();};}function respondWithResult(_0x4f2af1,_0x4c4c9a){_0x4c4c9a=_0x4c4c9a||0xc8;return function(_0x12385b){if(_0x12385b){return _0x4f2af1[_0x8b7d('0x17')](_0x4c4c9a)['json'](_0x12385b);}};}function respondWithFilteredResult(_0x2431a8,_0x2feaf7){return function(_0x494757){if(_0x494757){var _0x55c8b1=typeof _0x2feaf7[_0x8b7d('0x18')]===_0x8b7d('0x19')&&typeof _0x2feaf7['limit']===_0x8b7d('0x19');var _0x44d751=_0x494757['count'];var _0x2a4b0d=_0x55c8b1?0x0:_0x2feaf7['offset'];var _0x440652=_0x55c8b1?_0x494757['count']:_0x2feaf7['offset']+_0x2feaf7[_0x8b7d('0x1a')];var _0x2173b9;if(_0x440652>=_0x44d751){_0x440652=_0x44d751;_0x2173b9=0xc8;}else{_0x2173b9=0xce;}_0x2431a8['status'](_0x2173b9);return _0x2431a8['set'](_0x8b7d('0x1b'),_0x2a4b0d+'-'+_0x440652+'/'+_0x44d751)[_0x8b7d('0x1c')](_0x494757);}return null;};}function patchUpdates(_0x40544f){return function(_0x5417e9){try{jsonpatch['apply'](_0x5417e9,_0x40544f,!![]);}catch(_0x4ad8da){return BPromise[_0x8b7d('0x1d')](_0x4ad8da);}return _0x5417e9['save']();};}function saveUpdates(_0x117f18,_0xa53aba){return function(_0x42387c){if(_0x42387c){return _0x42387c[_0x8b7d('0x1e')](_0x117f18)[_0x8b7d('0x1f')](function(_0x21bab9){return _0x21bab9;});}return null;};}function removeEntity(_0x52d2de,_0x351627){return function(_0x3d8361){if(_0x3d8361){return _0x3d8361[_0x8b7d('0x20')]()['then'](function(){_0x52d2de[_0x8b7d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc3d534,_0x3c8f8e){return function(_0x587a75){if(!_0x587a75){_0xc3d534[_0x8b7d('0x15')](0x194);}return _0x587a75;};}function handleError(_0xe6f99d,_0x34b95c){_0x34b95c=_0x34b95c||0x1f4;return function(_0x403f26){logger['error'](_0x403f26[_0x8b7d('0x21')]);if(_0x403f26['name']){delete _0x403f26[_0x8b7d('0x22')];}_0xe6f99d['status'](_0x34b95c)[_0x8b7d('0x23')](_0x403f26);};}exports['index']=function(_0x5626bc,_0x3e383f){var _0x261817={},_0x3a4f3d={},_0x17c8fb={'count':0x0,'rows':[]};var _0x515f96=_['map'](db[_0x8b7d('0x24')][_0x8b7d('0x25')],function(_0x4a3b6e){return{'name':_0x4a3b6e[_0x8b7d('0x26')],'type':_0x4a3b6e[_0x8b7d('0x27')][_0x8b7d('0x28')]};});_0x3a4f3d[_0x8b7d('0x29')]=_['map'](_0x515f96,_0x8b7d('0x22'));_0x3a4f3d[_0x8b7d('0x2a')]=_[_0x8b7d('0x2b')](_0x5626bc['query']);_0x3a4f3d['filters']=_['intersection'](_0x3a4f3d[_0x8b7d('0x29')],_0x3a4f3d['query']);_0x261817[_0x8b7d('0x2c')]=_[_0x8b7d('0x2d')](_0x3a4f3d[_0x8b7d('0x29')],qs['fields'](_0x5626bc[_0x8b7d('0x2a')]['fields']));_0x261817[_0x8b7d('0x2c')]=_0x261817['attributes'][_0x8b7d('0x2e')]?_0x261817[_0x8b7d('0x2c')]:_0x3a4f3d['model'];if(!_0x5626bc['query'][_0x8b7d('0x2f')](_0x8b7d('0x30'))){_0x261817[_0x8b7d('0x1a')]=qs[_0x8b7d('0x1a')](_0x5626bc['query'][_0x8b7d('0x1a')]);_0x261817[_0x8b7d('0x18')]=qs[_0x8b7d('0x18')](_0x5626bc[_0x8b7d('0x2a')][_0x8b7d('0x18')]);}_0x261817[_0x8b7d('0x31')]=qs[_0x8b7d('0x32')](_0x5626bc[_0x8b7d('0x2a')][_0x8b7d('0x32')]);_0x261817['where']=qs['filters'](_[_0x8b7d('0x33')](_0x5626bc[_0x8b7d('0x2a')],_0x3a4f3d[_0x8b7d('0x34')]),_0x515f96);if(_0x5626bc['query'][_0x8b7d('0x35')]){_0x261817['where']=_['merge'](_0x261817[_0x8b7d('0x36')],{'$or':_[_0x8b7d('0x37')](_0x515f96,function(_0x3e928f){if(_0x3e928f[_0x8b7d('0x27')]!==_0x8b7d('0x38')){var _0x51f595={};_0x51f595[_0x3e928f['name']]={'$like':'%'+_0x5626bc[_0x8b7d('0x2a')][_0x8b7d('0x35')]+'%'};return _0x51f595;}})});}_0x261817=_['merge']({},_0x261817,_0x5626bc['options']);var _0x1ef927={'where':_0x261817[_0x8b7d('0x36')]};return db[_0x8b7d('0x24')][_0x8b7d('0x39')](_0x1ef927)[_0x8b7d('0x1f')](function(_0x491caa){_0x17c8fb['count']=_0x491caa;if(_0x5626bc[_0x8b7d('0x2a')][_0x8b7d('0x3a')]){_0x261817[_0x8b7d('0x3b')]=[{'all':!![]}];}return db[_0x8b7d('0x24')][_0x8b7d('0x3c')](_0x261817);})['then'](function(_0x1825a8){_0x17c8fb[_0x8b7d('0x3d')]=_0x1825a8;return _0x17c8fb;})[_0x8b7d('0x1f')](respondWithFilteredResult(_0x3e383f,_0x261817))['catch'](handleError(_0x3e383f,null));};exports[_0x8b7d('0x3e')]=function(_0x265d36,_0x278362){var _0x308a20={'raw':!![],'where':{'id':_0x265d36[_0x8b7d('0x3f')]['id']}},_0x10d4ab={};_0x10d4ab['model']=_[_0x8b7d('0x2b')](db[_0x8b7d('0x24')][_0x8b7d('0x25')]);_0x10d4ab[_0x8b7d('0x2a')]=_[_0x8b7d('0x2b')](_0x265d36[_0x8b7d('0x2a')]);_0x10d4ab['filters']=_[_0x8b7d('0x2d')](_0x10d4ab[_0x8b7d('0x29')],_0x10d4ab['query']);_0x308a20[_0x8b7d('0x2c')]=_[_0x8b7d('0x2d')](_0x10d4ab['model'],qs[_0x8b7d('0x40')](_0x265d36[_0x8b7d('0x2a')][_0x8b7d('0x40')]));_0x308a20[_0x8b7d('0x2c')]=_0x308a20[_0x8b7d('0x2c')][_0x8b7d('0x2e')]?_0x308a20[_0x8b7d('0x2c')]:_0x10d4ab[_0x8b7d('0x29')];if(_0x265d36[_0x8b7d('0x2a')]['includeAll']){_0x308a20[_0x8b7d('0x3b')]=[{'all':!![]}];}_0x308a20=_[_0x8b7d('0x41')]({},_0x308a20,_0x265d36['options']);return db[_0x8b7d('0x24')][_0x8b7d('0x42')](_0x308a20)[_0x8b7d('0x1f')](handleEntityNotFound(_0x278362,null))[_0x8b7d('0x1f')](respondWithResult(_0x278362,null))[_0x8b7d('0x43')](handleError(_0x278362,null));};exports[_0x8b7d('0x44')]=function(_0x27aeec,_0x513d56){return db['FaxTransferReport'][_0x8b7d('0x44')](_0x27aeec[_0x8b7d('0x45')],{})[_0x8b7d('0x1f')](respondWithResult(_0x513d56,0xc9))[_0x8b7d('0x43')](handleError(_0x513d56,null));};exports[_0x8b7d('0x1e')]=function(_0x4230a7,_0x520d40){if(_0x4230a7['body']['id']){delete _0x4230a7['body']['id'];}return db[_0x8b7d('0x24')][_0x8b7d('0x42')]({'where':{'id':_0x4230a7[_0x8b7d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x520d40,null))[_0x8b7d('0x1f')](saveUpdates(_0x4230a7['body'],null))[_0x8b7d('0x1f')](respondWithResult(_0x520d40,null))[_0x8b7d('0x43')](handleError(_0x520d40,null));};exports[_0x8b7d('0x20')]=function(_0x4a31ba,_0x5528ef){return db[_0x8b7d('0x24')][_0x8b7d('0x42')]({'where':{'id':_0x4a31ba[_0x8b7d('0x3f')]['id']}})[_0x8b7d('0x1f')](handleEntityNotFound(_0x5528ef,null))[_0x8b7d('0x1f')](removeEntity(_0x5528ef,null))[_0x8b7d('0x43')](handleError(_0x5528ef,null));};exports[_0x8b7d('0x46')]=function(_0x38b55b,_0x30566e){return db[_0x8b7d('0x24')][_0x8b7d('0x46')]()['then'](respondWithResult(_0x30566e,null))[_0x8b7d('0x43')](handleError(_0x30566e,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 42fce81..06f1f8f 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 _0xfc5a=['api','moment','bluebird','request-promise','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfc5a,0x169));var _0xafc5=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0xfc5a[_0x562ec5];return _0x279c8c;};'use strict';var _=require(_0xafc5('0x0'));var util=require(_0xafc5('0x1'));var logger=require(_0xafc5('0x2'))(_0xafc5('0x3'));var moment=require(_0xafc5('0x4'));var BPromise=require(_0xafc5('0x5'));var rp=require(_0xafc5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafc5('0x7'));var config=require('../../config/environment');var attributes=require(_0xafc5('0x8'));module['exports']=function(_0x32c787,_0x21f714){return _0x32c787[_0xafc5('0x9')](_0xafc5('0xa'),attributes,{'tableName':_0xafc5('0xb'),'paranoid':![],'indexes':[{'name':_0xafc5('0xc'),'fields':[_0xafc5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8075=['exports','define','FaxTransferReport','report_fax_transfer','lodash','util','api','moment','path','rimraf','./faxTransferReport.attributes'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x8075,0x143));var _0x5807=function(_0x31dc05,_0x828154){_0x31dc05=_0x31dc05-0x0;var _0x2186d8=_0x8075[_0x31dc05];return _0x2186d8;};'use strict';var _=require(_0x5807('0x0'));var util=require(_0x5807('0x1'));var logger=require('../../config/logger')(_0x5807('0x2'));var moment=require(_0x5807('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5807('0x4'));var rimraf=require(_0x5807('0x5'));var config=require('../../config/environment');var attributes=require(_0x5807('0x6'));module[_0x5807('0x7')]=function(_0x3eb4f0,_0x50cbd6){return _0x3eb4f0[_0x5807('0x8')](_0x5807('0x9'),attributes,{'tableName':_0x5807('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 442f22a..a1f8459 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 _0xd064=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x47c9f1,_0x298b77){var _0x39e650=function(_0x275af9){while(--_0x275af9){_0x47c9f1['push'](_0x47c9f1['shift']());}};_0x39e650(++_0x298b77);}(_0xd064,0x1b1));var _0x4d06=function(_0xf2ee56,_0x565642){_0xf2ee56=_0xf2ee56-0x0;var _0x2b9bc9=_0xd064[_0xf2ee56];return _0x2b9bc9;};'use strict';var _=require(_0x4d06('0x0'));var util=require(_0x4d06('0x1'));var moment=require(_0x4d06('0x2'));var BPromise=require(_0x4d06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d06('0x4'));var db=require(_0x4d06('0x5'))['db'];var utils=require(_0x4d06('0x6'));var logger=require(_0x4d06('0x7'))(_0x4d06('0x8'));var config=require(_0x4d06('0x9'));var jayson=require(_0x4d06('0xa'));var client=jayson[_0x4d06('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x716b64,_0x5b1eb6,_0x184453){return new BPromise(function(_0x38627d,_0x41ab6e){return client[_0x4d06('0xc')](_0x716b64,_0x184453)['then'](function(_0x1fa9d6){logger['info'](_0x4d06('0xd'),_0x5b1eb6,_0x4d06('0xe'));logger[_0x4d06('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x5b1eb6,_0x4d06('0xe'),JSON['stringify'](_0x1fa9d6));if(_0x1fa9d6['error']){if(_0x1fa9d6[_0x4d06('0x10')]['code']===0x1f4){logger[_0x4d06('0x10')](_0x4d06('0xd'),_0x5b1eb6,_0x1fa9d6['error'][_0x4d06('0x11')]);return _0x41ab6e(_0x1fa9d6[_0x4d06('0x10')][_0x4d06('0x11')]);}logger[_0x4d06('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x5b1eb6,_0x1fa9d6[_0x4d06('0x10')][_0x4d06('0x11')]);return _0x38627d(_0x1fa9d6[_0x4d06('0x10')]['message']);}else{logger[_0x4d06('0x12')](_0x4d06('0xd'),_0x5b1eb6,_0x4d06('0xe'));_0x38627d(_0x1fa9d6[_0x4d06('0x13')][_0x4d06('0x11')]);}})['catch'](function(_0xf93693){logger[_0x4d06('0x10')](_0x4d06('0xd'),_0x5b1eb6,_0xf93693);_0x41ab6e(_0xf93693);});});} \ No newline at end of file +var _0x7bb2=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x36fca9,_0x1f7569){var _0x3ddbc5=function(_0x5111c6){while(--_0x5111c6){_0x36fca9['push'](_0x36fca9['shift']());}};_0x3ddbc5(++_0x1f7569);}(_0x7bb2,0xfe));var _0x27bb=function(_0x56f746,_0x4d17c2){_0x56f746=_0x56f746-0x0;var _0x29dd9c=_0x7bb2[_0x56f746];return _0x29dd9c;};'use strict';var _=require(_0x27bb('0x0'));var util=require(_0x27bb('0x1'));var moment=require(_0x27bb('0x2'));var BPromise=require(_0x27bb('0x3'));var rs=require(_0x27bb('0x4'));var fs=require('fs');var Redis=require(_0x27bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x27bb('0x6'));var logger=require('../../config/logger')(_0x27bb('0x7'));var config=require(_0x27bb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x27bb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15dbc5,_0x528ecd,_0x491dd5){return new BPromise(function(_0xf8bdf9,_0x356572){return client[_0x27bb('0xa')](_0x15dbc5,_0x491dd5)[_0x27bb('0xb')](function(_0x27be7a){logger[_0x27bb('0xc')](_0x27bb('0xd'),_0x528ecd,_0x27bb('0xe'));logger[_0x27bb('0xf')](_0x27bb('0x10'),_0x528ecd,'request\x20sent',JSON[_0x27bb('0x11')](_0x27be7a));if(_0x27be7a[_0x27bb('0x12')]){if(_0x27be7a[_0x27bb('0x12')]['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x528ecd,_0x27be7a[_0x27bb('0x12')][_0x27bb('0x13')]);return _0x356572(_0x27be7a[_0x27bb('0x12')][_0x27bb('0x13')]);}logger['error'](_0x27bb('0xd'),_0x528ecd,_0x27be7a[_0x27bb('0x12')][_0x27bb('0x13')]);return _0xf8bdf9(_0x27be7a[_0x27bb('0x12')][_0x27bb('0x13')]);}else{logger['info'](_0x27bb('0xd'),_0x528ecd,_0x27bb('0xe'));_0xf8bdf9(_0x27be7a[_0x27bb('0x14')][_0x27bb('0x13')]);}})['catch'](function(_0xe511eb){logger[_0x27bb('0x12')](_0x27bb('0xd'),_0x528ecd,_0xe511eb);_0x356572(_0xe511eb);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 30a55fc..16e54a0 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 _0xe381=['put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','/describe','get','/:id','create'];(function(_0x3441b7,_0x2f648e){var _0x3a89ae=function(_0x2f9234){while(--_0x2f9234){_0x3441b7['push'](_0x3441b7['shift']());}};_0x3a89ae(++_0x2f648e);}(_0xe381,0x82));var _0x1e38=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0xe381[_0x4709c8];return _0x478cdd;};'use strict';var multer=require(_0x1e38('0x0'));var util=require(_0x1e38('0x1'));var path=require(_0x1e38('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e38('0x3'));var router=express[_0x1e38('0x4')]();var fs_extra=require(_0x1e38('0x5'));var auth=require(_0x1e38('0x6'));var interaction=require(_0x1e38('0x7'));var config=require('../../config/environment');var controller=require(_0x1e38('0x8'));router['get']('/',auth[_0x1e38('0x9')](),controller['index']);router['get'](_0x1e38('0xa'),auth[_0x1e38('0x9')](),controller['describe']);router[_0x1e38('0xb')](_0x1e38('0xc'),auth[_0x1e38('0x9')](),controller['show']);router['post']('/',auth[_0x1e38('0x9')](),controller[_0x1e38('0xd')]);router[_0x1e38('0xe')](_0x1e38('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1e38('0xf')]('/:id',auth[_0x1e38('0x9')](),controller[_0x1e38('0x10')]);module[_0x1e38('0x11')]=router; \ No newline at end of file +var _0x38e7=['/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x33b85e,_0x9ab507){var _0x4d222e=function(_0x212925){while(--_0x212925){_0x33b85e['push'](_0x33b85e['shift']());}};_0x4d222e(++_0x9ab507);}(_0x38e7,0x112));var _0x738e=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x38e7[_0x305b20];return _0x26d64a;};'use strict';var multer=require('multer');var util=require(_0x738e('0x0'));var path=require(_0x738e('0x1'));var timeout=require(_0x738e('0x2'));var express=require(_0x738e('0x3'));var router=express['Router']();var fs_extra=require(_0x738e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x738e('0x5'));var config=require(_0x738e('0x6'));var controller=require('./faxTransferReport.controller');router[_0x738e('0x7')]('/',auth[_0x738e('0x8')](),controller['index']);router[_0x738e('0x7')](_0x738e('0x9'),auth[_0x738e('0x8')](),controller[_0x738e('0xa')]);router[_0x738e('0x7')](_0x738e('0xb'),auth['isAuthenticated'](),controller[_0x738e('0xc')]);router[_0x738e('0xd')]('/',auth['isAuthenticated'](),controller[_0x738e('0xe')]);router[_0x738e('0xf')](_0x738e('0xb'),auth[_0x738e('0x8')](),controller[_0x738e('0x10')]);router[_0x738e('0x11')](_0x738e('0xb'),auth[_0x738e('0x8')](),controller[_0x738e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6ea2080..423a180 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 _0x6dea=['isAuthenticated','/:id/fields','getFields','create','post','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id','show'];(function(_0x1dbe4e,_0x12ebdb){var _0x265f39=function(_0x3486a0){while(--_0x3486a0){_0x1dbe4e['push'](_0x1dbe4e['shift']());}};_0x265f39(++_0x12ebdb);}(_0x6dea,0x86));var _0xa6de=function(_0x762888,_0x31c7e5){_0x762888=_0x762888-0x0;var _0x31d9f2=_0x6dea[_0x762888];return _0x31d9f2;};'use strict';var multer=require(_0xa6de('0x0'));var util=require('util');var path=require(_0xa6de('0x1'));var timeout=require(_0xa6de('0x2'));var express=require(_0xa6de('0x3'));var router=express[_0xa6de('0x4')]();var fs_extra=require(_0xa6de('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa6de('0x6'));var config=require(_0xa6de('0x7'));var controller=require(_0xa6de('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa6de('0x9')]);router[_0xa6de('0xa')](_0xa6de('0xb'),auth['isAuthenticated'](),controller[_0xa6de('0xc')]);router[_0xa6de('0xa')]('/:id/configurations',auth[_0xa6de('0xd')](),controller['getConfigurations']);router[_0xa6de('0xa')](_0xa6de('0xe'),auth[_0xa6de('0xd')](),controller[_0xa6de('0xf')]);router['post']('/',auth[_0xa6de('0xd')](),controller[_0xa6de('0x10')]);router[_0xa6de('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa6de('0x12')]('/:id',auth[_0xa6de('0xd')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa6de('0x13')]);module[_0xa6de('0x14')]=router; \ No newline at end of file +var _0x384c=['/:id/fields','getFields','post','addConfiguration','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','./intDeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x3fb743,_0x2b6886){var _0x135901=function(_0x5adc16){while(--_0x5adc16){_0x3fb743['push'](_0x3fb743['shift']());}};_0x135901(++_0x2b6886);}(_0x384c,0x1d7));var _0xc384=function(_0x31b3aa,_0x39d044){_0x31b3aa=_0x31b3aa-0x0;var _0x41d2ee=_0x384c[_0x31b3aa];return _0x41d2ee;};'use strict';var multer=require(_0xc384('0x0'));var util=require(_0xc384('0x1'));var path=require(_0xc384('0x2'));var timeout=require(_0xc384('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc384('0x4'));var auth=require(_0xc384('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc384('0x6'));router[_0xc384('0x7')]('/',auth[_0xc384('0x8')](),controller['index']);router['get']('/:id',auth[_0xc384('0x8')](),controller[_0xc384('0x9')]);router['get'](_0xc384('0xa'),auth[_0xc384('0x8')](),controller[_0xc384('0xb')]);router[_0xc384('0x7')](_0xc384('0xc'),auth[_0xc384('0x8')](),controller[_0xc384('0xd')]);router[_0xc384('0xe')]('/',auth[_0xc384('0x8')](),controller['create']);router[_0xc384('0xe')](_0xc384('0xa'),auth[_0xc384('0x8')](),controller[_0xc384('0xf')]);router[_0xc384('0x10')]('/:id',auth[_0xc384('0x8')](),controller['update']);router[_0xc384('0x11')](_0xc384('0x12'),auth['isAuthenticated'](),controller[_0xc384('0x13')]);module[_0xc384('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 3a6bc76..2e46bbc 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 _0x2d77=['integrationTab','exports','STRING','ENUM','basic','newTab'];(function(_0x3b7d88,_0x2750e4){var _0x13c79c=function(_0x1f8f5b){while(--_0x1f8f5b){_0x3b7d88['push'](_0x3b7d88['shift']());}};_0x13c79c(++_0x2750e4);}(_0x2d77,0x67));var _0x72d7=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x2d77[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require('sequelize');module[_0x72d7('0x0')]={'name':{'type':Sequelize[_0x72d7('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x72d7('0x1')]},'remoteUri':{'type':Sequelize[_0x72d7('0x1')]},'authType':{'type':Sequelize[_0x72d7('0x2')](_0x72d7('0x3')),'defaultValue':_0x72d7('0x3')},'password':{'type':Sequelize[_0x72d7('0x1')]},'consumerKey':{'type':Sequelize[_0x72d7('0x1')]},'consumerSecret':{'type':Sequelize[_0x72d7('0x1')]},'token':{'type':Sequelize[_0x72d7('0x1')]},'tokenSecret':{'type':Sequelize[_0x72d7('0x1')]},'serverUrl':{'type':Sequelize[_0x72d7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x72d7('0x2')]('integrationTab',_0x72d7('0x4')),'defaultValue':_0x72d7('0x5')}}; \ No newline at end of file +var _0x23f9=['ENUM','basic','integrationTab','sequelize','STRING'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x23f9,0x1a7));var _0x923f=function(_0x1246dd,_0x4c29af){_0x1246dd=_0x1246dd-0x0;var _0x4c7fe8=_0x23f9[_0x1246dd];return _0x4c7fe8;};'use strict';var Sequelize=require(_0x923f('0x0'));module['exports']={'name':{'type':Sequelize[_0x923f('0x1')]},'description':{'type':Sequelize[_0x923f('0x1')]},'username':{'type':Sequelize[_0x923f('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x923f('0x2')](_0x923f('0x3')),'defaultValue':_0x923f('0x3')},'password':{'type':Sequelize[_0x923f('0x1')]},'consumerKey':{'type':Sequelize[_0x923f('0x1')]},'consumerSecret':{'type':Sequelize[_0x923f('0x1')]},'token':{'type':Sequelize[_0x923f('0x1')]},'tokenSecret':{'type':Sequelize[_0x923f('0x1')]},'serverUrl':{'type':Sequelize[_0x923f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x923f('0x2')](_0x923f('0x4'),'newTab'),'defaultValue':_0x923f('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 6cb3bc3..bbea844 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 _0xc356=['priority','remoteUri','username','consumerKey','consumerSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','password','toString','_embedded','entries','label','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','DeskAccount','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','params','keys','options','find','create','body','catch','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getDescriptions','channel','DeskField','Descriptions','getFields'];(function(_0x19f4de,_0x45acb0){var _0x5dd3c9=function(_0xefb4bd){while(--_0xefb4bd){_0x19f4de['push'](_0x19f4de['shift']());}};_0x5dd3c9(++_0x45acb0);}(_0xc356,0xf5));var _0x6c35=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc356[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x6c35('0x0'));var rimraf=require(_0x6c35('0x1'));var zipdir=require(_0x6c35('0x2'));var jsonpatch=require(_0x6c35('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6c35('0x4'));var Mustache=require(_0x6c35('0x5'));var util=require('util');var path=require(_0x6c35('0x6'));var sox=require(_0x6c35('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c35('0x8'));var _=require(_0x6c35('0x9'));var squel=require(_0x6c35('0xa'));var crypto=require('crypto');var jsforce=require(_0x6c35('0xb'));var deskjs=require(_0x6c35('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c35('0xd'));var Papa=require(_0x6c35('0xe'));var Redis=require(_0x6c35('0xf'));var authService=require(_0x6c35('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6c35('0x11'));var hardwareService=require(_0x6c35('0x12'));var logger=require('../../config/logger')(_0x6c35('0x13'));var utils=require(_0x6c35('0x14'));var config=require(_0x6c35('0x15'));var licenseUtil=require(_0x6c35('0x16'));var db=require(_0x6c35('0x17'))['db'];var integrations=require(_0x6c35('0x18'));function respondWithStatusCode(_0x1e2ea8,_0x21237f){_0x21237f=_0x21237f||0xcc;return function(_0x1ea1f8){if(_0x1ea1f8){return _0x1e2ea8[_0x6c35('0x19')](_0x21237f);}return _0x1e2ea8[_0x6c35('0x1a')](_0x21237f)[_0x6c35('0x1b')]();};}function respondWithResult(_0x1086b0,_0x2f8b63){_0x2f8b63=_0x2f8b63||0xc8;return function(_0x1042c2){if(_0x1042c2){return _0x1086b0['status'](_0x2f8b63)[_0x6c35('0x1c')](_0x1042c2);}};}function respondWithFilteredResult(_0xdf4828,_0x38857b){return function(_0x267e66){if(_0x267e66){var _0x2b1b62=typeof _0x38857b[_0x6c35('0x1d')]===_0x6c35('0x1e')&&typeof _0x38857b[_0x6c35('0x1f')]===_0x6c35('0x1e');var _0x13b693=_0x267e66[_0x6c35('0x20')];var _0x206b8b=_0x2b1b62?0x0:_0x38857b[_0x6c35('0x1d')];var _0x3547b6=_0x2b1b62?_0x267e66['count']:_0x38857b[_0x6c35('0x1d')]+_0x38857b[_0x6c35('0x1f')];var _0x11f023;if(_0x3547b6>=_0x13b693){_0x3547b6=_0x13b693;_0x11f023=0xc8;}else{_0x11f023=0xce;}_0xdf4828[_0x6c35('0x1a')](_0x11f023);return _0xdf4828[_0x6c35('0x21')](_0x6c35('0x22'),_0x206b8b+'-'+_0x3547b6+'/'+_0x13b693)[_0x6c35('0x1c')](_0x267e66);}return null;};}function patchUpdates(_0x4c4431){return function(_0x22e869){try{jsonpatch['apply'](_0x22e869,_0x4c4431,!![]);}catch(_0x33de5f){return BPromise[_0x6c35('0x23')](_0x33de5f);}return _0x22e869[_0x6c35('0x24')]();};}function saveUpdates(_0x59cd9c,_0x5c3722){return function(_0x43ddce){if(_0x43ddce){return _0x43ddce[_0x6c35('0x25')](_0x59cd9c)[_0x6c35('0x26')](function(_0x5eaa95){return _0x5eaa95;});}return null;};}function removeEntity(_0x2e8422,_0x296835){return function(_0x118022){if(_0x118022){return _0x118022[_0x6c35('0x27')]()['then'](function(){_0x2e8422[_0x6c35('0x1a')](0xcc)[_0x6c35('0x1b')]();});}};}function handleEntityNotFound(_0x1b6609,_0x811c52){return function(_0x1b9759){if(!_0x1b9759){_0x1b6609['sendStatus'](0x194);}return _0x1b9759;};}function handleError(_0x1a6594,_0x4c5144){_0x4c5144=_0x4c5144||0x1f4;return function(_0x3ad8e7){logger[_0x6c35('0x28')](_0x3ad8e7['stack']);if(_0x3ad8e7[_0x6c35('0x29')]){delete _0x3ad8e7[_0x6c35('0x29')];}_0x1a6594[_0x6c35('0x1a')](_0x4c5144)[_0x6c35('0x2a')](_0x3ad8e7);};}exports['index']=function(_0x40bf30,_0x496110){var _0x468998={},_0x5d3e79={},_0x11f75e={'count':0x0,'rows':[]};var _0xce2938=_[_0x6c35('0x2b')](db[_0x6c35('0x2c')][_0x6c35('0x2d')],function(_0x3e386b){return{'name':_0x3e386b['fieldName'],'type':_0x3e386b[_0x6c35('0x2e')][_0x6c35('0x2f')]};});_0x5d3e79[_0x6c35('0x30')]=_['map'](_0xce2938,'name');_0x5d3e79[_0x6c35('0x31')]=_['keys'](_0x40bf30['query']);_0x5d3e79[_0x6c35('0x32')]=_[_0x6c35('0x33')](_0x5d3e79[_0x6c35('0x30')],_0x5d3e79[_0x6c35('0x31')]);_0x468998['attributes']=_['intersection'](_0x5d3e79[_0x6c35('0x30')],qs[_0x6c35('0x34')](_0x40bf30['query'][_0x6c35('0x34')]));_0x468998[_0x6c35('0x35')]=_0x468998[_0x6c35('0x35')][_0x6c35('0x36')]?_0x468998[_0x6c35('0x35')]:_0x5d3e79[_0x6c35('0x30')];if(!_0x40bf30[_0x6c35('0x31')][_0x6c35('0x37')](_0x6c35('0x38'))){_0x468998[_0x6c35('0x1f')]=qs[_0x6c35('0x1f')](_0x40bf30[_0x6c35('0x31')][_0x6c35('0x1f')]);_0x468998['offset']=qs[_0x6c35('0x1d')](_0x40bf30[_0x6c35('0x31')]['offset']);}_0x468998[_0x6c35('0x39')]=qs[_0x6c35('0x3a')](_0x40bf30[_0x6c35('0x31')]['sort']);_0x468998[_0x6c35('0x3b')]=qs[_0x6c35('0x32')](_[_0x6c35('0x3c')](_0x40bf30[_0x6c35('0x31')],_0x5d3e79[_0x6c35('0x32')]),_0xce2938);if(_0x40bf30['query']['filter']){_0x468998['where']=_[_0x6c35('0x3d')](_0x468998['where'],{'$or':_[_0x6c35('0x2b')](_0xce2938,function(_0x3f8f1a){if(_0x3f8f1a[_0x6c35('0x2e')]!=='VIRTUAL'){var _0x39b3cb={};_0x39b3cb[_0x3f8f1a['name']]={'$like':'%'+_0x40bf30[_0x6c35('0x31')][_0x6c35('0x3e')]+'%'};return _0x39b3cb;}})});}_0x468998=_[_0x6c35('0x3d')]({},_0x468998,_0x40bf30['options']);var _0x3956ce={'where':_0x468998[_0x6c35('0x3b')]};return db[_0x6c35('0x2c')]['count'](_0x3956ce)['then'](function(_0x2a13aa){_0x11f75e['count']=_0x2a13aa;if(_0x40bf30[_0x6c35('0x31')][_0x6c35('0x3f')]){_0x468998[_0x6c35('0x40')]=[{'all':!![]}];}return db['DeskAccount'][_0x6c35('0x41')](_0x468998);})['then'](function(_0x5bb4d2){_0x11f75e[_0x6c35('0x42')]=_0x5bb4d2;return _0x11f75e;})[_0x6c35('0x26')](respondWithFilteredResult(_0x496110,_0x468998))['catch'](handleError(_0x496110,null));};exports['show']=function(_0x52eac8,_0x10691e){var _0x44a12b={'raw':![],'where':{'id':_0x52eac8[_0x6c35('0x43')]['id']}},_0x410aa9={};_0x410aa9[_0x6c35('0x30')]=_[_0x6c35('0x44')](db[_0x6c35('0x2c')][_0x6c35('0x2d')]);_0x410aa9[_0x6c35('0x31')]=_[_0x6c35('0x44')](_0x52eac8[_0x6c35('0x31')]);_0x410aa9[_0x6c35('0x32')]=_[_0x6c35('0x33')](_0x410aa9[_0x6c35('0x30')],_0x410aa9[_0x6c35('0x31')]);_0x44a12b[_0x6c35('0x35')]=_[_0x6c35('0x33')](_0x410aa9[_0x6c35('0x30')],qs[_0x6c35('0x34')](_0x52eac8[_0x6c35('0x31')][_0x6c35('0x34')]));_0x44a12b['attributes']=_0x44a12b['attributes']['length']?_0x44a12b[_0x6c35('0x35')]:_0x410aa9[_0x6c35('0x30')];if(_0x52eac8['query'][_0x6c35('0x3f')]){_0x44a12b[_0x6c35('0x40')]=[{'all':!![]}];}_0x44a12b=_[_0x6c35('0x3d')]({},_0x44a12b,_0x52eac8[_0x6c35('0x45')]);return db[_0x6c35('0x2c')][_0x6c35('0x46')](_0x44a12b)['then'](handleEntityNotFound(_0x10691e,null))[_0x6c35('0x26')](respondWithResult(_0x10691e,null))['catch'](handleError(_0x10691e,null));};exports['create']=function(_0x568749,_0x1dd261){return db['DeskAccount'][_0x6c35('0x47')](_0x568749[_0x6c35('0x48')],{})[_0x6c35('0x26')](respondWithResult(_0x1dd261,0xc9))[_0x6c35('0x49')](handleError(_0x1dd261,null));};exports['update']=function(_0x469dee,_0x2693ac){if(_0x469dee[_0x6c35('0x48')]['id']){delete _0x469dee[_0x6c35('0x48')]['id'];}return db[_0x6c35('0x2c')][_0x6c35('0x46')]({'where':{'id':_0x469dee[_0x6c35('0x43')]['id']}})[_0x6c35('0x26')](handleEntityNotFound(_0x2693ac,null))[_0x6c35('0x26')](saveUpdates(_0x469dee['body'],null))[_0x6c35('0x26')](respondWithResult(_0x2693ac,null))[_0x6c35('0x49')](handleError(_0x2693ac,null));};exports[_0x6c35('0x27')]=function(_0x2e78ff,_0x136fd6){return db[_0x6c35('0x2c')][_0x6c35('0x46')]({'where':{'id':_0x2e78ff[_0x6c35('0x43')]['id']}})['then'](handleEntityNotFound(_0x136fd6,null))[_0x6c35('0x26')](removeEntity(_0x136fd6,null))[_0x6c35('0x49')](handleError(_0x136fd6,null));};exports[_0x6c35('0x4a')]=function(_0x3e027a,_0x25db28,_0x5a6387){var _0x164270={};var _0x4512ed={};var _0x174b18;var _0x5adfbb;return db['DeskAccount'][_0x6c35('0x4b')]({'where':{'id':_0x3e027a[_0x6c35('0x43')]['id']}})[_0x6c35('0x26')](handleEntityNotFound(_0x25db28,null))[_0x6c35('0x26')](function(_0x1cf99e){if(_0x1cf99e){_0x174b18=_0x1cf99e;_0x4512ed[_0x6c35('0x30')]=_[_0x6c35('0x44')](db[_0x6c35('0x4c')]['rawAttributes']);_0x4512ed[_0x6c35('0x31')]=_[_0x6c35('0x44')](_0x3e027a[_0x6c35('0x31')]);_0x4512ed[_0x6c35('0x32')]=_[_0x6c35('0x33')](_0x4512ed[_0x6c35('0x30')],_0x4512ed[_0x6c35('0x31')]);_0x164270[_0x6c35('0x35')]=_['intersection'](_0x4512ed[_0x6c35('0x30')],qs[_0x6c35('0x34')](_0x3e027a[_0x6c35('0x31')]['fields']));_0x164270[_0x6c35('0x35')]=_0x164270['attributes']['length']?_0x164270[_0x6c35('0x35')]:_0x4512ed[_0x6c35('0x30')];_0x164270[_0x6c35('0x39')]=qs[_0x6c35('0x3a')](_0x3e027a[_0x6c35('0x31')][_0x6c35('0x3a')]);_0x164270[_0x6c35('0x3b')]=qs[_0x6c35('0x32')](_[_0x6c35('0x3c')](_0x3e027a['query'],_0x4512ed[_0x6c35('0x32')]));if(_0x3e027a[_0x6c35('0x31')][_0x6c35('0x3e')]){_0x164270[_0x6c35('0x3b')]=_[_0x6c35('0x3d')](_0x164270[_0x6c35('0x3b')],{'$or':_[_0x6c35('0x2b')](_0x164270[_0x6c35('0x35')],function(_0x3510d6){var _0x3e41d4={};_0x3e41d4[_0x3510d6]={'$like':'%'+_0x3e027a['query'][_0x6c35('0x3e')]+'%'};return _0x3e41d4;})});}_0x164270=_['merge']({},_0x164270,_0x3e027a[_0x6c35('0x45')]);return _0x174b18['getConfigurations'](_0x164270);}})[_0x6c35('0x26')](function(_0x14feeb){if(_0x14feeb){_0x5adfbb=_0x14feeb[_0x6c35('0x36')];if(!_0x3e027a[_0x6c35('0x31')][_0x6c35('0x37')](_0x6c35('0x38'))){_0x164270['limit']=qs[_0x6c35('0x1f')](_0x3e027a['query'][_0x6c35('0x1f')]);_0x164270[_0x6c35('0x1d')]=qs['offset'](_0x3e027a[_0x6c35('0x31')][_0x6c35('0x1d')]);}return _0x174b18[_0x6c35('0x4a')](_0x164270);}})[_0x6c35('0x26')](function(_0x39b5c7){if(_0x39b5c7){return _0x39b5c7?{'count':_0x5adfbb,'rows':_0x39b5c7}:null;}})[_0x6c35('0x26')](respondWithResult(_0x25db28,null))[_0x6c35('0x49')](handleError(_0x25db28,null));};exports[_0x6c35('0x4d')]=function(_0x264a85,_0x83b0db,_0x4cb2aa){if(_0x264a85[_0x6c35('0x48')]['id']){delete _0x264a85[_0x6c35('0x48')]['id'];}return db['DeskAccount'][_0x6c35('0x4b')]({'where':{'id':_0x264a85[_0x6c35('0x43')]['id']}})['then'](handleEntityNotFound(_0x83b0db,null))['then'](function(_0x5e15ce){if(_0x5e15ce){_0x264a85[_0x6c35('0x48')][_0x6c35('0x4e')]=_0x5e15ce['id'];_0x264a85[_0x6c35('0x48')][_0x6c35('0x4f')]=integrations['getSubjects'](_0x264a85['body']['channel'],_0x264a85[_0x6c35('0x48')]['type']);_0x264a85[_0x6c35('0x48')]['Descriptions']=integrations[_0x6c35('0x50')](_0x264a85[_0x6c35('0x48')][_0x6c35('0x51')],_0x264a85[_0x6c35('0x48')]['type']);return db['DeskConfiguration'][_0x6c35('0x47')](_0x264a85[_0x6c35('0x48')],{'include':[{'model':db['DeskField'],'as':_0x6c35('0x4f')},{'model':db[_0x6c35('0x52')],'as':_0x6c35('0x53')}]});}return null;})[_0x6c35('0x26')](respondWithResult(_0x83b0db,null))[_0x6c35('0x49')](handleError(_0x83b0db,null));};exports[_0x6c35('0x54')]=function(_0x59b6db,_0x44ae9f,_0x23c552){var _0x580f24=[{'name':_0x6c35('0x55'),'label':_0x6c35('0x55'),'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 _0x47f8f4='';return db['DeskAccount'][_0x6c35('0x4b')]({'where':{'id':_0x59b6db['params']['id']},'attributes':['id',_0x6c35('0x56'),'authType',_0x6c35('0x57'),'password',_0x6c35('0x58'),_0x6c35('0x59'),'token','tokenSecret']})['then'](handleEntityNotFound(_0x44ae9f,null))[_0x6c35('0x26')](function(_0x378e6b){if(_0x378e6b){_0x47f8f4=_0x378e6b[_0x6c35('0x56')];var _0x2a39fd=_0x47f8f4[_0x6c35('0x5a')](-0x1);if(_0x2a39fd==='/'){_0x47f8f4=_0x47f8f4['substring'](0x0,_0x47f8f4[_0x6c35('0x5b')](_0x2a39fd));}var _0xe0d4d0={'method':_0x6c35('0x5c'),'uri':util[_0x6c35('0x5d')](_0x6c35('0x5e'),_0x47f8f4),'headers':{'Content-Type':'application/json','Accept':_0x6c35('0x5f')},'json':!![]};if(_0x378e6b['authType']===_0x6c35('0x60')){_0xe0d4d0[_0x6c35('0x61')][_0x6c35('0x62')]=util[_0x6c35('0x5d')]('Basic\x20%s',new Buffer(util[_0x6c35('0x5d')](_0x6c35('0x63'),_0x378e6b[_0x6c35('0x57')],_0x378e6b[_0x6c35('0x64')]))[_0x6c35('0x65')]('base64'));}return rp(_0xe0d4d0)[_0x6c35('0x26')](function(_0x107acf){return _0x580f24['concat'](_['map'](_0x107acf[_0x6c35('0x66')][_0x6c35('0x67')],function(_0x3bc808){return{'id':_0x3bc808[_0x6c35('0x29')],'name':_0x3bc808[_0x6c35('0x29')],'type':_0x3bc808[_0x6c35('0x2e')],'active':_0x3bc808['active'],'label':_0x3bc808[_0x6c35('0x68')],'custom':!![]};}));});}})[_0x6c35('0x26')](function(_0x1554a2){return{'count':_0x1554a2[_0x6c35('0x36')],'rows':_0x1554a2};})[_0x6c35('0x26')](respondWithResult(_0x44ae9f,null))['catch'](function(_0x221e9a){var _0x1f1630=_0x59b6db[_0x6c35('0x31')]['test']?0x1f4:_0x221e9a['statusCode']||0x1f4;logger[_0x6c35('0x28')](_0x6c35('0x69'),_0x6c35('0x54'),_0x1f1630,JSON[_0x6c35('0x6a')](_0x221e9a));delete _0x221e9a['name'];if(_0x1f1630===0x191){_0x1f1630=0x190;}_0x44ae9f[_0x6c35('0x1a')](_0x1f1630)[_0x6c35('0x2a')](_0x59b6db[_0x6c35('0x31')][_0x6c35('0x6b')]?{'message':_0x6c35('0x6c'),'statusCode':_0x221e9a[_0x6c35('0x6d')]}:_0x221e9a);});}; \ No newline at end of file +var _0xa9ee=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','DeskAccount','rawAttributes','fieldName','key','map','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','count','include','findAll','catch','includeAll','find','create','body','params','keys','pick','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','%s/custom_fields','application/json','basic','headers','Authorization','format','toString','concat','_embedded','entries','label','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x1bd232,_0x1bffa4){var _0x2dd8b7=function(_0x23ab79){while(--_0x23ab79){_0x1bd232['push'](_0x1bd232['shift']());}};_0x2dd8b7(++_0x1bffa4);}(_0xa9ee,0xcb));var _0xea9e=function(_0x2750de,_0x5edf3c){_0x2750de=_0x2750de-0x0;var _0x3ff649=_0xa9ee[_0x2750de];return _0x3ff649;};'use strict';var emlformat=require(_0xea9e('0x0'));var rimraf=require(_0xea9e('0x1'));var zipdir=require(_0xea9e('0x2'));var jsonpatch=require(_0xea9e('0x3'));var rp=require('request-promise');var moment=require(_0xea9e('0x4'));var BPromise=require(_0xea9e('0x5'));var Mustache=require(_0xea9e('0x6'));var util=require(_0xea9e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xea9e('0x8'));var ejs=require(_0xea9e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea9e('0xa'));var squel=require(_0xea9e('0xb'));var crypto=require(_0xea9e('0xc'));var jsforce=require(_0xea9e('0xd'));var deskjs=require(_0xea9e('0xe'));var toCsv=require(_0xea9e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea9e('0xf'));var authService=require(_0xea9e('0x10'));var qs=require(_0xea9e('0x11'));var as=require(_0xea9e('0x12'));var hardwareService=require(_0xea9e('0x13'));var logger=require('../../config/logger')(_0xea9e('0x14'));var utils=require(_0xea9e('0x15'));var config=require(_0xea9e('0x16'));var licenseUtil=require(_0xea9e('0x17'));var db=require(_0xea9e('0x18'))['db'];var integrations=require(_0xea9e('0x19'));function respondWithStatusCode(_0x1fcac9,_0x386900){_0x386900=_0x386900||0xcc;return function(_0x305ebd){if(_0x305ebd){return _0x1fcac9[_0xea9e('0x1a')](_0x386900);}return _0x1fcac9[_0xea9e('0x1b')](_0x386900)[_0xea9e('0x1c')]();};}function respondWithResult(_0x168665,_0x52cb3b){_0x52cb3b=_0x52cb3b||0xc8;return function(_0x62a865){if(_0x62a865){return _0x168665[_0xea9e('0x1b')](_0x52cb3b)['json'](_0x62a865);}};}function respondWithFilteredResult(_0x553934,_0x297165){return function(_0x20cf1b){if(_0x20cf1b){var _0x3bc01c=typeof _0x297165[_0xea9e('0x1d')]==='undefined'&&typeof _0x297165[_0xea9e('0x1e')]==='undefined';var _0x4d151e=_0x20cf1b['count'];var _0x38d351=_0x3bc01c?0x0:_0x297165['offset'];var _0x5a9013=_0x3bc01c?_0x20cf1b['count']:_0x297165[_0xea9e('0x1d')]+_0x297165[_0xea9e('0x1e')];var _0x4100b7;if(_0x5a9013>=_0x4d151e){_0x5a9013=_0x4d151e;_0x4100b7=0xc8;}else{_0x4100b7=0xce;}_0x553934['status'](_0x4100b7);return _0x553934['set'](_0xea9e('0x1f'),_0x38d351+'-'+_0x5a9013+'/'+_0x4d151e)[_0xea9e('0x20')](_0x20cf1b);}return null;};}function patchUpdates(_0x165d9c){return function(_0x2add62){try{jsonpatch[_0xea9e('0x21')](_0x2add62,_0x165d9c,!![]);}catch(_0x178291){return BPromise[_0xea9e('0x22')](_0x178291);}return _0x2add62[_0xea9e('0x23')]();};}function saveUpdates(_0x2bfa69,_0x2879fe){return function(_0x26f111){if(_0x26f111){return _0x26f111[_0xea9e('0x24')](_0x2bfa69)[_0xea9e('0x25')](function(_0x3af43e){return _0x3af43e;});}return null;};}function removeEntity(_0x2adf77,_0x2025ca){return function(_0x18062f){if(_0x18062f){return _0x18062f[_0xea9e('0x26')]()[_0xea9e('0x25')](function(){_0x2adf77[_0xea9e('0x1b')](0xcc)[_0xea9e('0x1c')]();});}};}function handleEntityNotFound(_0x4456cd,_0x2b9116){return function(_0x7d867d){if(!_0x7d867d){_0x4456cd[_0xea9e('0x1a')](0x194);}return _0x7d867d;};}function handleError(_0x3133d8,_0x57b34c){_0x57b34c=_0x57b34c||0x1f4;return function(_0x4974d4){logger[_0xea9e('0x27')](_0x4974d4[_0xea9e('0x28')]);if(_0x4974d4[_0xea9e('0x29')]){delete _0x4974d4['name'];}_0x3133d8[_0xea9e('0x1b')](_0x57b34c)['send'](_0x4974d4);};}exports[_0xea9e('0x2a')]=function(_0x49ba2a,_0x1c305d){var _0x8f9bb={},_0x4068b5={},_0x33e088={'count':0x0,'rows':[]};var _0x3d3ea1=_['map'](db[_0xea9e('0x2b')][_0xea9e('0x2c')],function(_0x144e35){return{'name':_0x144e35[_0xea9e('0x2d')],'type':_0x144e35['type'][_0xea9e('0x2e')]};});_0x4068b5['model']=_[_0xea9e('0x2f')](_0x3d3ea1,_0xea9e('0x29'));_0x4068b5[_0xea9e('0x30')]=_['keys'](_0x49ba2a[_0xea9e('0x30')]);_0x4068b5['filters']=_['intersection'](_0x4068b5['model'],_0x4068b5[_0xea9e('0x30')]);_0x8f9bb[_0xea9e('0x31')]=_[_0xea9e('0x32')](_0x4068b5[_0xea9e('0x33')],qs[_0xea9e('0x34')](_0x49ba2a[_0xea9e('0x30')][_0xea9e('0x34')]));_0x8f9bb[_0xea9e('0x31')]=_0x8f9bb['attributes'][_0xea9e('0x35')]?_0x8f9bb[_0xea9e('0x31')]:_0x4068b5[_0xea9e('0x33')];if(!_0x49ba2a['query'][_0xea9e('0x36')](_0xea9e('0x37'))){_0x8f9bb['limit']=qs['limit'](_0x49ba2a['query'][_0xea9e('0x1e')]);_0x8f9bb['offset']=qs[_0xea9e('0x1d')](_0x49ba2a[_0xea9e('0x30')][_0xea9e('0x1d')]);}_0x8f9bb[_0xea9e('0x38')]=qs['sort'](_0x49ba2a[_0xea9e('0x30')][_0xea9e('0x39')]);_0x8f9bb[_0xea9e('0x3a')]=qs[_0xea9e('0x3b')](_['pick'](_0x49ba2a[_0xea9e('0x30')],_0x4068b5[_0xea9e('0x3b')]),_0x3d3ea1);if(_0x49ba2a[_0xea9e('0x30')]['filter']){_0x8f9bb[_0xea9e('0x3a')]=_[_0xea9e('0x3c')](_0x8f9bb[_0xea9e('0x3a')],{'$or':_[_0xea9e('0x2f')](_0x3d3ea1,function(_0x434f49){if(_0x434f49[_0xea9e('0x3d')]!==_0xea9e('0x3e')){var _0x14ff0c={};_0x14ff0c[_0x434f49['name']]={'$like':'%'+_0x49ba2a['query'][_0xea9e('0x3f')]+'%'};return _0x14ff0c;}})});}_0x8f9bb=_[_0xea9e('0x3c')]({},_0x8f9bb,_0x49ba2a[_0xea9e('0x40')]);var _0xb64964={'where':_0x8f9bb[_0xea9e('0x3a')]};return db[_0xea9e('0x2b')][_0xea9e('0x41')](_0xb64964)[_0xea9e('0x25')](function(_0x2bcf32){_0x33e088[_0xea9e('0x41')]=_0x2bcf32;if(_0x49ba2a[_0xea9e('0x30')]['includeAll']){_0x8f9bb[_0xea9e('0x42')]=[{'all':!![]}];}return db[_0xea9e('0x2b')][_0xea9e('0x43')](_0x8f9bb);})[_0xea9e('0x25')](function(_0x4a8c0c){_0x33e088['rows']=_0x4a8c0c;return _0x33e088;})[_0xea9e('0x25')](respondWithFilteredResult(_0x1c305d,_0x8f9bb))[_0xea9e('0x44')](handleError(_0x1c305d,null));};exports['show']=function(_0x65ae53,_0x12a579){var _0x4fcfa3={'raw':![],'where':{'id':_0x65ae53['params']['id']}},_0x2eea4e={};_0x2eea4e[_0xea9e('0x33')]=_['keys'](db[_0xea9e('0x2b')]['rawAttributes']);_0x2eea4e[_0xea9e('0x30')]=_['keys'](_0x65ae53[_0xea9e('0x30')]);_0x2eea4e['filters']=_['intersection'](_0x2eea4e[_0xea9e('0x33')],_0x2eea4e['query']);_0x4fcfa3[_0xea9e('0x31')]=_['intersection'](_0x2eea4e[_0xea9e('0x33')],qs[_0xea9e('0x34')](_0x65ae53['query']['fields']));_0x4fcfa3[_0xea9e('0x31')]=_0x4fcfa3[_0xea9e('0x31')]['length']?_0x4fcfa3[_0xea9e('0x31')]:_0x2eea4e[_0xea9e('0x33')];if(_0x65ae53[_0xea9e('0x30')][_0xea9e('0x45')]){_0x4fcfa3['include']=[{'all':!![]}];}_0x4fcfa3=_[_0xea9e('0x3c')]({},_0x4fcfa3,_0x65ae53[_0xea9e('0x40')]);return db[_0xea9e('0x2b')][_0xea9e('0x46')](_0x4fcfa3)[_0xea9e('0x25')](handleEntityNotFound(_0x12a579,null))[_0xea9e('0x25')](respondWithResult(_0x12a579,null))[_0xea9e('0x44')](handleError(_0x12a579,null));};exports[_0xea9e('0x47')]=function(_0x56340d,_0x15f96a){return db['DeskAccount'][_0xea9e('0x47')](_0x56340d['body'],{})[_0xea9e('0x25')](respondWithResult(_0x15f96a,0xc9))[_0xea9e('0x44')](handleError(_0x15f96a,null));};exports[_0xea9e('0x24')]=function(_0x119865,_0x3435dd){if(_0x119865[_0xea9e('0x48')]['id']){delete _0x119865[_0xea9e('0x48')]['id'];}return db[_0xea9e('0x2b')]['find']({'where':{'id':_0x119865['params']['id']}})[_0xea9e('0x25')](handleEntityNotFound(_0x3435dd,null))['then'](saveUpdates(_0x119865[_0xea9e('0x48')],null))[_0xea9e('0x25')](respondWithResult(_0x3435dd,null))['catch'](handleError(_0x3435dd,null));};exports['destroy']=function(_0x447626,_0x42852){return db[_0xea9e('0x2b')][_0xea9e('0x46')]({'where':{'id':_0x447626['params']['id']}})[_0xea9e('0x25')](handleEntityNotFound(_0x42852,null))[_0xea9e('0x25')](removeEntity(_0x42852,null))[_0xea9e('0x44')](handleError(_0x42852,null));};exports['getConfigurations']=function(_0xeafdd,_0x2a368a,_0x2aaf7b){var _0x279434={};var _0x8921={};var _0x84fbc0;var _0x323a3f;return db[_0xea9e('0x2b')]['findOne']({'where':{'id':_0xeafdd[_0xea9e('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a368a,null))[_0xea9e('0x25')](function(_0x8788b6){if(_0x8788b6){_0x84fbc0=_0x8788b6;_0x8921[_0xea9e('0x33')]=_[_0xea9e('0x4a')](db['DeskConfiguration'][_0xea9e('0x2c')]);_0x8921[_0xea9e('0x30')]=_[_0xea9e('0x4a')](_0xeafdd[_0xea9e('0x30')]);_0x8921[_0xea9e('0x3b')]=_[_0xea9e('0x32')](_0x8921['model'],_0x8921['query']);_0x279434[_0xea9e('0x31')]=_[_0xea9e('0x32')](_0x8921[_0xea9e('0x33')],qs[_0xea9e('0x34')](_0xeafdd['query']['fields']));_0x279434[_0xea9e('0x31')]=_0x279434[_0xea9e('0x31')]['length']?_0x279434[_0xea9e('0x31')]:_0x8921['model'];_0x279434['order']=qs[_0xea9e('0x39')](_0xeafdd[_0xea9e('0x30')][_0xea9e('0x39')]);_0x279434[_0xea9e('0x3a')]=qs[_0xea9e('0x3b')](_[_0xea9e('0x4b')](_0xeafdd[_0xea9e('0x30')],_0x8921[_0xea9e('0x3b')]));if(_0xeafdd[_0xea9e('0x30')][_0xea9e('0x3f')]){_0x279434[_0xea9e('0x3a')]=_[_0xea9e('0x3c')](_0x279434[_0xea9e('0x3a')],{'$or':_['map'](_0x279434[_0xea9e('0x31')],function(_0x5d1385){var _0x28cc8e={};_0x28cc8e[_0x5d1385]={'$like':'%'+_0xeafdd['query'][_0xea9e('0x3f')]+'%'};return _0x28cc8e;})});}_0x279434=_['merge']({},_0x279434,_0xeafdd['options']);return _0x84fbc0[_0xea9e('0x4c')](_0x279434);}})[_0xea9e('0x25')](function(_0x1a328d){if(_0x1a328d){_0x323a3f=_0x1a328d[_0xea9e('0x35')];if(!_0xeafdd[_0xea9e('0x30')][_0xea9e('0x36')](_0xea9e('0x37'))){_0x279434[_0xea9e('0x1e')]=qs[_0xea9e('0x1e')](_0xeafdd['query']['limit']);_0x279434[_0xea9e('0x1d')]=qs['offset'](_0xeafdd['query'][_0xea9e('0x1d')]);}return _0x84fbc0[_0xea9e('0x4c')](_0x279434);}})[_0xea9e('0x25')](function(_0x258050){if(_0x258050){return _0x258050?{'count':_0x323a3f,'rows':_0x258050}:null;}})[_0xea9e('0x25')](respondWithResult(_0x2a368a,null))[_0xea9e('0x44')](handleError(_0x2a368a,null));};exports['addConfiguration']=function(_0x57a085,_0x2d0081,_0x1a06e7){if(_0x57a085[_0xea9e('0x48')]['id']){delete _0x57a085[_0xea9e('0x48')]['id'];}return db[_0xea9e('0x2b')]['findOne']({'where':{'id':_0x57a085['params']['id']}})['then'](handleEntityNotFound(_0x2d0081,null))[_0xea9e('0x25')](function(_0x21921d){if(_0x21921d){_0x57a085[_0xea9e('0x48')][_0xea9e('0x4d')]=_0x21921d['id'];_0x57a085[_0xea9e('0x48')][_0xea9e('0x4e')]=integrations[_0xea9e('0x4f')](_0x57a085[_0xea9e('0x48')]['channel'],_0x57a085[_0xea9e('0x48')][_0xea9e('0x3d')]);_0x57a085[_0xea9e('0x48')][_0xea9e('0x50')]=integrations[_0xea9e('0x51')](_0x57a085[_0xea9e('0x48')][_0xea9e('0x52')],_0x57a085[_0xea9e('0x48')][_0xea9e('0x3d')]);return db[_0xea9e('0x53')][_0xea9e('0x47')](_0x57a085[_0xea9e('0x48')],{'include':[{'model':db[_0xea9e('0x54')],'as':'Subjects'},{'model':db[_0xea9e('0x54')],'as':_0xea9e('0x50')}]});}return null;})['then'](respondWithResult(_0x2d0081,null))[_0xea9e('0x44')](handleError(_0x2d0081,null));};exports[_0xea9e('0x55')]=function(_0x3e95cf,_0x5a9bb9,_0x20f004){var _0x2607e6=[{'name':'priority','label':_0xea9e('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x18e138='';return db[_0xea9e('0x2b')]['findOne']({'where':{'id':_0x3e95cf[_0xea9e('0x49')]['id']},'attributes':['id',_0xea9e('0x57'),_0xea9e('0x58'),_0xea9e('0x59'),_0xea9e('0x5a'),_0xea9e('0x5b'),_0xea9e('0x5c'),_0xea9e('0x5d'),'tokenSecret']})[_0xea9e('0x25')](handleEntityNotFound(_0x5a9bb9,null))[_0xea9e('0x25')](function(_0x42be7e){if(_0x42be7e){_0x18e138=_0x42be7e[_0xea9e('0x57')];var _0x4fdb2f=_0x18e138[_0xea9e('0x5e')](-0x1);if(_0x4fdb2f==='/'){_0x18e138=_0x18e138[_0xea9e('0x5f')](0x0,_0x18e138[_0xea9e('0x60')](_0x4fdb2f));}var _0x3e10cb={'method':'GET','uri':util['format'](_0xea9e('0x61'),_0x18e138),'headers':{'Content-Type':'application/json','Accept':_0xea9e('0x62')},'json':!![]};if(_0x42be7e[_0xea9e('0x58')]===_0xea9e('0x63')){_0x3e10cb[_0xea9e('0x64')][_0xea9e('0x65')]=util[_0xea9e('0x66')]('Basic\x20%s',new Buffer(util[_0xea9e('0x66')]('%s:%s',_0x42be7e[_0xea9e('0x59')],_0x42be7e[_0xea9e('0x5a')]))[_0xea9e('0x67')]('base64'));}return rp(_0x3e10cb)[_0xea9e('0x25')](function(_0x32eee1){return _0x2607e6[_0xea9e('0x68')](_['map'](_0x32eee1[_0xea9e('0x69')][_0xea9e('0x6a')],function(_0x5b13ca){return{'id':_0x5b13ca['name'],'name':_0x5b13ca[_0xea9e('0x29')],'type':_0x5b13ca[_0xea9e('0x3d')],'active':_0x5b13ca['active'],'label':_0x5b13ca[_0xea9e('0x6b')],'custom':!![]};}));});}})['then'](function(_0x1b7373){return{'count':_0x1b7373[_0xea9e('0x35')],'rows':_0x1b7373};})[_0xea9e('0x25')](respondWithResult(_0x5a9bb9,null))[_0xea9e('0x44')](function(_0x281cfc){var _0x1101e0=_0x3e95cf[_0xea9e('0x30')][_0xea9e('0x6c')]?0x1f4:_0x281cfc[_0xea9e('0x6d')]||0x1f4;logger[_0xea9e('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xea9e('0x55'),_0x1101e0,JSON[_0xea9e('0x6e')](_0x281cfc));delete _0x281cfc[_0xea9e('0x29')];if(_0x1101e0===0x191){_0x1101e0=0x190;}_0x5a9bb9[_0xea9e('0x1b')](_0x1101e0)[_0xea9e('0x6f')](_0x3e95cf['query'][_0xea9e('0x6c')]?{'message':_0xea9e('0x70'),'statusCode':_0x281cfc[_0xea9e('0x6d')]}:_0x281cfc);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 2d2b650..9fb126e 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 _0x9a1e=['int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount'];(function(_0x19c578,_0x14c36c){var _0x5190c6=function(_0x187976){while(--_0x187976){_0x19c578['push'](_0x19c578['shift']());}};_0x5190c6(++_0x14c36c);}(_0x9a1e,0x10b));var _0xe9a1=function(_0x342e9e,_0x4db6a0){_0x342e9e=_0x342e9e-0x0;var _0x196fb0=_0x9a1e[_0x342e9e];return _0x196fb0;};'use strict';var _=require(_0xe9a1('0x0'));var util=require(_0xe9a1('0x1'));var logger=require(_0xe9a1('0x2'))(_0xe9a1('0x3'));var moment=require('moment');var BPromise=require(_0xe9a1('0x4'));var rp=require(_0xe9a1('0x5'));var fs=require('fs');var path=require(_0xe9a1('0x6'));var rimraf=require(_0xe9a1('0x7'));var config=require('../../config/environment');var attributes=require(_0xe9a1('0x8'));var integrations=require(_0xe9a1('0x9'));module[_0xe9a1('0xa')]=function(_0x5b84e4,_0xd290db){return _0x5b84e4[_0xe9a1('0xb')](_0xe9a1('0xc'),attributes,{'tableName':_0xe9a1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b1c=['../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intDeskAccount.attributes'];(function(_0x28f387,_0x2c9233){var _0x2fa2d2=function(_0x3e6dc1){while(--_0x3e6dc1){_0x28f387['push'](_0x28f387['shift']());}};_0x2fa2d2(++_0x2c9233);}(_0x3b1c,0x1f2));var _0xc3b1=function(_0x4096ca,_0x42dfb2){_0x4096ca=_0x4096ca-0x0;var _0x4650c8=_0x3b1c[_0x4096ca];return _0x4650c8;};'use strict';var _=require(_0xc3b1('0x0'));var util=require(_0xc3b1('0x1'));var logger=require(_0xc3b1('0x2'))(_0xc3b1('0x3'));var moment=require(_0xc3b1('0x4'));var BPromise=require(_0xc3b1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3b1('0x6'));var rimraf=require(_0xc3b1('0x7'));var config=require('../../config/environment');var attributes=require(_0xc3b1('0x8'));var integrations=require(_0xc3b1('0x9'));module[_0xc3b1('0xa')]=function(_0x2b2bf0,_0x47ea13){return _0x2b2bf0[_0xc3b1('0xb')](_0xc3b1('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 5c34f69..b77dd54 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 _0x49fe=['stringify','error','message','result','catch','GetDeskAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowDeskAccount','DeskAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4cd14a,_0x3c08b4){var _0x59ac6a=function(_0x5d95ec){while(--_0x5d95ec){_0x4cd14a['push'](_0x4cd14a['shift']());}};_0x59ac6a(++_0x3c08b4);}(_0x49fe,0x1ab));var _0xe49f=function(_0x4495c7,_0x36a025){_0x4495c7=_0x4495c7-0x0;var _0x3d0e93=_0x49fe[_0x4495c7];return _0x3d0e93;};'use strict';var _=require('lodash');var util=require(_0xe49f('0x0'));var moment=require(_0xe49f('0x1'));var BPromise=require(_0xe49f('0x2'));var rs=require(_0xe49f('0x3'));var fs=require('fs');var Redis=require(_0xe49f('0x4'));var db=require(_0xe49f('0x5'))['db'];var utils=require(_0xe49f('0x6'));var logger=require(_0xe49f('0x7'))(_0xe49f('0x8'));var config=require('../../config/environment');var jayson=require(_0xe49f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x345609,_0x161cf4,_0x57aee2){return new BPromise(function(_0x3202ca,_0x2470c9){return client['request'](_0x345609,_0x57aee2)['then'](function(_0x4a2def){logger[_0xe49f('0xa')](_0xe49f('0xb'),_0x161cf4,_0xe49f('0xc'));logger[_0xe49f('0xd')](_0xe49f('0xe'),_0x161cf4,_0xe49f('0xc'),JSON[_0xe49f('0xf')](_0x4a2def));if(_0x4a2def[_0xe49f('0x10')]){if(_0x4a2def[_0xe49f('0x10')]['code']===0x1f4){logger['error'](_0xe49f('0xb'),_0x161cf4,_0x4a2def[_0xe49f('0x10')][_0xe49f('0x11')]);return _0x2470c9(_0x4a2def['error'][_0xe49f('0x11')]);}logger[_0xe49f('0x10')](_0xe49f('0xb'),_0x161cf4,_0x4a2def[_0xe49f('0x10')][_0xe49f('0x11')]);return _0x3202ca(_0x4a2def[_0xe49f('0x10')]['message']);}else{logger[_0xe49f('0xa')](_0xe49f('0xb'),_0x161cf4,_0xe49f('0xc'));_0x3202ca(_0x4a2def[_0xe49f('0x12')][_0xe49f('0x11')]);}})[_0xe49f('0x13')](function(_0x3cd852){logger['error']('DeskAccount,\x20%s,\x20%s',_0x161cf4,_0x3cd852);_0x2470c9(_0x3cd852);});});}exports[_0xe49f('0x14')]=function(_0x5c3bfb){var _0x5bada6=this;return new Promise(function(_0xb4db9a,_0x434f66){return db['DeskAccount'][_0xe49f('0x15')]({'raw':_0x5c3bfb[_0xe49f('0x16')]?_0x5c3bfb[_0xe49f('0x16')][_0xe49f('0x17')]===undefined?!![]:![]:!![],'where':_0x5c3bfb[_0xe49f('0x16')]?_0x5c3bfb[_0xe49f('0x16')]['where']||null:null,'attributes':_0x5c3bfb[_0xe49f('0x16')]?_0x5c3bfb[_0xe49f('0x16')][_0xe49f('0x18')]||null:null,'limit':_0x5c3bfb[_0xe49f('0x16')]?_0x5c3bfb[_0xe49f('0x16')][_0xe49f('0x19')]||null:null,'include':_0x5c3bfb[_0xe49f('0x16')]?_0x5c3bfb[_0xe49f('0x16')][_0xe49f('0x1a')]?_[_0xe49f('0x1b')](_0x5c3bfb[_0xe49f('0x16')][_0xe49f('0x1a')],function(_0x56698b){return{'model':db[_0x56698b['model']],'as':_0x56698b['as'],'attributes':_0x56698b[_0xe49f('0x18')],'include':_0x56698b[_0xe49f('0x1a')]?_[_0xe49f('0x1b')](_0x56698b[_0xe49f('0x1a')],function(_0x542be1){return{'model':db[_0x542be1[_0xe49f('0x1c')]],'as':_0x542be1['as'],'attributes':_0x542be1[_0xe49f('0x18')],'include':_0x542be1[_0xe49f('0x1a')]?_[_0xe49f('0x1b')](_0x542be1[_0xe49f('0x1a')],function(_0x26b112){return{'model':db[_0x26b112[_0xe49f('0x1c')]],'as':_0x26b112['as'],'attributes':_0x26b112['attributes']};}):[]};}):[]};}):[]:[]})[_0xe49f('0x1d')](function(_0x42fd61){logger[_0xe49f('0xa')]('GetDeskAccount',_0x5c3bfb);logger['debug']('GetDeskAccount',_0x5c3bfb,JSON[_0xe49f('0xf')](_0x42fd61));_0xb4db9a(_0x42fd61);})[_0xe49f('0x13')](function(_0x2ffb07){logger['error'](_0xe49f('0x14'),_0x2ffb07[_0xe49f('0x11')],_0x5c3bfb);_0x434f66(_0x5bada6['error'](0x1f4,_0x2ffb07[_0xe49f('0x11')]));});});};exports[_0xe49f('0x1e')]=function(_0x1795d2){var _0x2249fa=this;return new Promise(function(_0x2fbc95,_0x50cdac){return db[_0xe49f('0x1f')][_0xe49f('0x20')]({'raw':_0x1795d2[_0xe49f('0x16')]?_0x1795d2[_0xe49f('0x16')][_0xe49f('0x17')]===undefined?!![]:![]:!![],'where':_0x1795d2[_0xe49f('0x16')]?_0x1795d2[_0xe49f('0x16')][_0xe49f('0x21')]||null:null,'attributes':_0x1795d2[_0xe49f('0x16')]?_0x1795d2[_0xe49f('0x16')][_0xe49f('0x18')]||null:null,'include':_0x1795d2['options']?_0x1795d2[_0xe49f('0x16')][_0xe49f('0x1a')]?_[_0xe49f('0x1b')](_0x1795d2[_0xe49f('0x16')][_0xe49f('0x1a')],function(_0x2e5e70){return{'model':db[_0x2e5e70[_0xe49f('0x1c')]],'as':_0x2e5e70['as'],'attributes':_0x2e5e70['attributes'],'include':_0x2e5e70['include']?_['map'](_0x2e5e70[_0xe49f('0x1a')],function(_0x397d7b){return{'model':db[_0x397d7b['model']],'as':_0x397d7b['as'],'attributes':_0x397d7b['attributes'],'include':_0x397d7b[_0xe49f('0x1a')]?_[_0xe49f('0x1b')](_0x397d7b['include'],function(_0x4cc8b7){return{'model':db[_0x4cc8b7[_0xe49f('0x1c')]],'as':_0x4cc8b7['as'],'attributes':_0x4cc8b7[_0xe49f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8ef813){logger[_0xe49f('0xa')]('ShowDeskAccount',_0x1795d2);logger['debug']('ShowDeskAccount',_0x1795d2,JSON['stringify'](_0x8ef813));_0x2fbc95(_0x8ef813);})[_0xe49f('0x13')](function(_0x40c08e){logger['error']('ShowDeskAccount',_0x40c08e['message'],_0x1795d2);_0x50cdac(_0x2249fa['error'](0x1f4,_0x40c08e[_0xe49f('0x11')]));});});}; \ No newline at end of file +var _0x1557=['http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x1557,0x16f));var _0x7155=function(_0x124b0a,_0x5bcdc3){_0x124b0a=_0x124b0a-0x0;var _0xaa31d2=_0x1557[_0x124b0a];return _0xaa31d2;};'use strict';var _=require(_0x7155('0x0'));var util=require(_0x7155('0x1'));var moment=require(_0x7155('0x2'));var BPromise=require(_0x7155('0x3'));var rs=require(_0x7155('0x4'));var fs=require('fs');var Redis=require(_0x7155('0x5'));var db=require(_0x7155('0x6'))['db'];var utils=require(_0x7155('0x7'));var logger=require(_0x7155('0x8'))(_0x7155('0x9'));var config=require(_0x7155('0xa'));var jayson=require(_0x7155('0xb'));var client=jayson[_0x7155('0xc')][_0x7155('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x54c9fe,_0x41722a,_0x4402a4){return new BPromise(function(_0x2fd505,_0x135146){return client[_0x7155('0xe')](_0x54c9fe,_0x4402a4)[_0x7155('0xf')](function(_0x4715fa){logger['info'](_0x7155('0x10'),_0x41722a,_0x7155('0x11'));logger[_0x7155('0x12')](_0x7155('0x13'),_0x41722a,_0x7155('0x11'),JSON[_0x7155('0x14')](_0x4715fa));if(_0x4715fa['error']){if(_0x4715fa[_0x7155('0x15')][_0x7155('0x16')]===0x1f4){logger[_0x7155('0x15')](_0x7155('0x10'),_0x41722a,_0x4715fa[_0x7155('0x15')][_0x7155('0x17')]);return _0x135146(_0x4715fa[_0x7155('0x15')]['message']);}logger[_0x7155('0x15')](_0x7155('0x10'),_0x41722a,_0x4715fa['error'][_0x7155('0x17')]);return _0x2fd505(_0x4715fa[_0x7155('0x15')][_0x7155('0x17')]);}else{logger['info'](_0x7155('0x10'),_0x41722a,_0x7155('0x11'));_0x2fd505(_0x4715fa['result'][_0x7155('0x17')]);}})[_0x7155('0x18')](function(_0xb78409){logger[_0x7155('0x15')](_0x7155('0x10'),_0x41722a,_0xb78409);_0x135146(_0xb78409);});});}exports['GetDeskAccount']=function(_0x3a0d2a){var _0x5ec6eb=this;return new Promise(function(_0x2b5d00,_0x53fe28){return db['DeskAccount'][_0x7155('0x19')]({'raw':_0x3a0d2a[_0x7155('0x1a')]?_0x3a0d2a['options'][_0x7155('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a0d2a['options']?_0x3a0d2a[_0x7155('0x1a')][_0x7155('0x1c')]||null:null,'attributes':_0x3a0d2a[_0x7155('0x1a')]?_0x3a0d2a[_0x7155('0x1a')][_0x7155('0x1d')]||null:null,'limit':_0x3a0d2a[_0x7155('0x1a')]?_0x3a0d2a[_0x7155('0x1a')][_0x7155('0x1e')]||null:null,'include':_0x3a0d2a['options']?_0x3a0d2a[_0x7155('0x1a')][_0x7155('0x1f')]?_[_0x7155('0x20')](_0x3a0d2a['options'][_0x7155('0x1f')],function(_0x508a5a){return{'model':db[_0x508a5a[_0x7155('0x21')]],'as':_0x508a5a['as'],'attributes':_0x508a5a[_0x7155('0x1d')],'include':_0x508a5a[_0x7155('0x1f')]?_[_0x7155('0x20')](_0x508a5a[_0x7155('0x1f')],function(_0x56cf7d){return{'model':db[_0x56cf7d[_0x7155('0x21')]],'as':_0x56cf7d['as'],'attributes':_0x56cf7d['attributes'],'include':_0x56cf7d[_0x7155('0x1f')]?_[_0x7155('0x20')](_0x56cf7d[_0x7155('0x1f')],function(_0x5b479f){return{'model':db[_0x5b479f['model']],'as':_0x5b479f['as'],'attributes':_0x5b479f[_0x7155('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7155('0xf')](function(_0x45eb3b){logger[_0x7155('0x22')](_0x7155('0x23'),_0x3a0d2a);logger[_0x7155('0x12')](_0x7155('0x23'),_0x3a0d2a,JSON['stringify'](_0x45eb3b));_0x2b5d00(_0x45eb3b);})[_0x7155('0x18')](function(_0x37d66f){logger['error'](_0x7155('0x23'),_0x37d66f['message'],_0x3a0d2a);_0x53fe28(_0x5ec6eb['error'](0x1f4,_0x37d66f[_0x7155('0x17')]));});});};exports[_0x7155('0x24')]=function(_0x230cfe){var _0xf6934b=this;return new Promise(function(_0x28931f,_0x319e68){return db['DeskAccount'][_0x7155('0x25')]({'raw':_0x230cfe['options']?_0x230cfe['options'][_0x7155('0x1b')]===undefined?!![]:![]:!![],'where':_0x230cfe[_0x7155('0x1a')]?_0x230cfe['options'][_0x7155('0x1c')]||null:null,'attributes':_0x230cfe['options']?_0x230cfe['options']['attributes']||null:null,'include':_0x230cfe[_0x7155('0x1a')]?_0x230cfe['options'][_0x7155('0x1f')]?_[_0x7155('0x20')](_0x230cfe[_0x7155('0x1a')][_0x7155('0x1f')],function(_0x4d8264){return{'model':db[_0x4d8264[_0x7155('0x21')]],'as':_0x4d8264['as'],'attributes':_0x4d8264['attributes'],'include':_0x4d8264[_0x7155('0x1f')]?_['map'](_0x4d8264[_0x7155('0x1f')],function(_0x8713fa){return{'model':db[_0x8713fa[_0x7155('0x21')]],'as':_0x8713fa['as'],'attributes':_0x8713fa[_0x7155('0x1d')],'include':_0x8713fa[_0x7155('0x1f')]?_[_0x7155('0x20')](_0x8713fa[_0x7155('0x1f')],function(_0x51014f){return{'model':db[_0x51014f[_0x7155('0x21')]],'as':_0x51014f['as'],'attributes':_0x51014f['attributes']};}):[]};}):[]};}):[]:[]})[_0x7155('0xf')](function(_0x695b7a){logger[_0x7155('0x22')](_0x7155('0x24'),_0x230cfe);logger['debug'](_0x7155('0x24'),_0x230cfe,JSON[_0x7155('0x14')](_0x695b7a));_0x28931f(_0x695b7a);})['catch'](function(_0x121213){logger[_0x7155('0x15')]('ShowDeskAccount',_0x121213['message'],_0x230cfe);_0x319e68(_0xf6934b[_0x7155('0x15')](0x1f4,_0x121213[_0x7155('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 291abec..8c5f50c 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 _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(_0x2aa7ea,_0x2dfd21){var _0x209c2e=function(_0x219755){while(--_0x219755){_0x2aa7ea['push'](_0x2aa7ea['shift']());}};_0x209c2e(++_0x2dfd21);}(_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/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 +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(_0x148ba6,_0x4d450d){var _0x4c6d9a=function(_0x35e8ca){while(--_0x35e8ca){_0x148ba6['push'](_0x148ba6['shift']());}};_0x4c6d9a(++_0x4d450d);}(_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 e44ca62..6026afe 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 _0xbeed=['exports','STRING','sequelize'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xbeed,0xd1));var _0xdbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeed[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xdbee('0x0'));module[_0xdbee('0x1')]={'name':{'type':Sequelize[_0xdbee('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6b0b=['sequelize','exports','STRING'];(function(_0x29fa48,_0x466688){var _0x2a0f79=function(_0x2ae4fc){while(--_0x2ae4fc){_0x29fa48['push'](_0x29fa48['shift']());}};_0x2a0f79(++_0x466688);}(_0x6b0b,0xc3));var _0xb6b0=function(_0x26ded6,_0x552c8e){_0x26ded6=_0x26ded6-0x0;var _0x227322=_0x6b0b[_0x26ded6];return _0x227322;};'use strict';var Sequelize=require(_0xb6b0('0x0'));module[_0xb6b0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb6b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2fd4718..8e28162 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 _0x5bf7=['count','set','Content-Range','json','reject','update','destroy','then','error','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','rows','params','length','include','find','catch','create','body','getFields','findOne','DeskField','nolimit','getSubjects','getDescriptions','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset'];(function(_0x16f073,_0x172d78){var _0x228991=function(_0x3cb226){while(--_0x3cb226){_0x16f073['push'](_0x16f073['shift']());}};_0x228991(++_0x172d78);}(_0x5bf7,0x127));var _0x75bf=function(_0x5a7461,_0x3c5226){_0x5a7461=_0x5a7461-0x0;var _0x170aa1=_0x5bf7[_0x5a7461];return _0x170aa1;};'use strict';var emlformat=require(_0x75bf('0x0'));var rimraf=require(_0x75bf('0x1'));var zipdir=require(_0x75bf('0x2'));var jsonpatch=require(_0x75bf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x75bf('0x4'));var Mustache=require(_0x75bf('0x5'));var util=require(_0x75bf('0x6'));var path=require('path');var sox=require(_0x75bf('0x7'));var csv=require(_0x75bf('0x8'));var ejs=require(_0x75bf('0x9'));var fs=require('fs');var fs_extra=require(_0x75bf('0xa'));var _=require(_0x75bf('0xb'));var squel=require(_0x75bf('0xc'));var crypto=require(_0x75bf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x75bf('0xe'));var toCsv=require(_0x75bf('0x8'));var querystring=require(_0x75bf('0xf'));var Papa=require(_0x75bf('0x10'));var Redis=require(_0x75bf('0x11'));var authService=require(_0x75bf('0x12'));var qs=require(_0x75bf('0x13'));var as=require(_0x75bf('0x14'));var hardwareService=require(_0x75bf('0x15'));var logger=require(_0x75bf('0x16'))(_0x75bf('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x75bf('0x18'))['db'];function respondWithStatusCode(_0x9a10cb,_0x2f952e){_0x2f952e=_0x2f952e||0xcc;return function(_0x11bf6e){if(_0x11bf6e){return _0x9a10cb[_0x75bf('0x19')](_0x2f952e);}return _0x9a10cb[_0x75bf('0x1a')](_0x2f952e)[_0x75bf('0x1b')]();};}function respondWithResult(_0x50a943,_0x2e2a72){_0x2e2a72=_0x2e2a72||0xc8;return function(_0x29d502){if(_0x29d502){return _0x50a943[_0x75bf('0x1a')](_0x2e2a72)['json'](_0x29d502);}};}function respondWithFilteredResult(_0x1e96f6,_0x3404bd){return function(_0x20da6d){if(_0x20da6d){var _0x5b2ccb=typeof _0x3404bd[_0x75bf('0x1c')]==='undefined'&&typeof _0x3404bd['limit']==='undefined';var _0x36c380=_0x20da6d[_0x75bf('0x1d')];var _0x5af203=_0x5b2ccb?0x0:_0x3404bd[_0x75bf('0x1c')];var _0x3dff7d=_0x5b2ccb?_0x20da6d[_0x75bf('0x1d')]:_0x3404bd['offset']+_0x3404bd['limit'];var _0x38e4dc;if(_0x3dff7d>=_0x36c380){_0x3dff7d=_0x36c380;_0x38e4dc=0xc8;}else{_0x38e4dc=0xce;}_0x1e96f6[_0x75bf('0x1a')](_0x38e4dc);return _0x1e96f6[_0x75bf('0x1e')](_0x75bf('0x1f'),_0x5af203+'-'+_0x3dff7d+'/'+_0x36c380)[_0x75bf('0x20')](_0x20da6d);}return null;};}function patchUpdates(_0x1e3900){return function(_0x49e857){try{jsonpatch['apply'](_0x49e857,_0x1e3900,!![]);}catch(_0x213032){return BPromise[_0x75bf('0x21')](_0x213032);}return _0x49e857['save']();};}function saveUpdates(_0x210681,_0x11851a){return function(_0x2a147c){if(_0x2a147c){return _0x2a147c[_0x75bf('0x22')](_0x210681)['then'](function(_0x9a061a){return _0x9a061a;});}return null;};}function removeEntity(_0x2822c2,_0x19538f){return function(_0x46d930){if(_0x46d930){return _0x46d930[_0x75bf('0x23')]()[_0x75bf('0x24')](function(){_0x2822c2[_0x75bf('0x1a')](0xcc)[_0x75bf('0x1b')]();});}};}function handleEntityNotFound(_0x4e8316,_0x4f51a7){return function(_0x5636cd){if(!_0x5636cd){_0x4e8316[_0x75bf('0x19')](0x194);}return _0x5636cd;};}function handleError(_0x28c6af,_0x4cdf0b){_0x4cdf0b=_0x4cdf0b||0x1f4;return function(_0x2036ff){logger[_0x75bf('0x25')](_0x2036ff['stack']);if(_0x2036ff[_0x75bf('0x26')]){delete _0x2036ff[_0x75bf('0x26')];}_0x28c6af[_0x75bf('0x1a')](_0x4cdf0b)[_0x75bf('0x27')](_0x2036ff);};}exports[_0x75bf('0x28')]=function(_0x392356,_0x13ee58){var _0x3c5d57={},_0x5ade75={},_0x487239={'count':0x0,'rows':[]};var _0x3fd750=_[_0x75bf('0x29')](db[_0x75bf('0x2a')][_0x75bf('0x2b')],function(_0x678989){return{'name':_0x678989[_0x75bf('0x2c')],'type':_0x678989[_0x75bf('0x2d')][_0x75bf('0x2e')]};});_0x5ade75[_0x75bf('0x2f')]=_[_0x75bf('0x29')](_0x3fd750,'name');_0x5ade75[_0x75bf('0x30')]=_[_0x75bf('0x31')](_0x392356['query']);_0x5ade75[_0x75bf('0x32')]=_['intersection'](_0x5ade75['model'],_0x5ade75[_0x75bf('0x30')]);_0x3c5d57[_0x75bf('0x33')]=_[_0x75bf('0x34')](_0x5ade75[_0x75bf('0x2f')],qs['fields'](_0x392356['query'][_0x75bf('0x35')]));_0x3c5d57[_0x75bf('0x33')]=_0x3c5d57[_0x75bf('0x33')]['length']?_0x3c5d57[_0x75bf('0x33')]:_0x5ade75['model'];if(!_0x392356[_0x75bf('0x30')][_0x75bf('0x36')]('nolimit')){_0x3c5d57[_0x75bf('0x37')]=qs[_0x75bf('0x37')](_0x392356[_0x75bf('0x30')][_0x75bf('0x37')]);_0x3c5d57[_0x75bf('0x1c')]=qs[_0x75bf('0x1c')](_0x392356['query'][_0x75bf('0x1c')]);}_0x3c5d57[_0x75bf('0x38')]=qs[_0x75bf('0x39')](_0x392356['query'][_0x75bf('0x39')]);_0x3c5d57[_0x75bf('0x3a')]=qs[_0x75bf('0x32')](_[_0x75bf('0x3b')](_0x392356['query'],_0x5ade75['filters']),_0x3fd750);if(_0x392356['query'][_0x75bf('0x3c')]){_0x3c5d57[_0x75bf('0x3a')]=_[_0x75bf('0x3d')](_0x3c5d57[_0x75bf('0x3a')],{'$or':_['map'](_0x3fd750,function(_0x1808b4){if(_0x1808b4[_0x75bf('0x2d')]!=='VIRTUAL'){var _0x503124={};_0x503124[_0x1808b4[_0x75bf('0x26')]]={'$like':'%'+_0x392356['query'][_0x75bf('0x3c')]+'%'};return _0x503124;}})});}_0x3c5d57=_[_0x75bf('0x3d')]({},_0x3c5d57,_0x392356[_0x75bf('0x3e')]);var _0x2422b1={'where':_0x3c5d57[_0x75bf('0x3a')]};return db[_0x75bf('0x2a')][_0x75bf('0x1d')](_0x2422b1)['then'](function(_0x128df8){_0x487239[_0x75bf('0x1d')]=_0x128df8;if(_0x392356[_0x75bf('0x30')][_0x75bf('0x3f')]){_0x3c5d57['include']=[{'all':!![]}];}return db[_0x75bf('0x2a')]['findAll'](_0x3c5d57);})[_0x75bf('0x24')](function(_0x7085fc){_0x487239[_0x75bf('0x40')]=_0x7085fc;return _0x487239;})[_0x75bf('0x24')](respondWithFilteredResult(_0x13ee58,_0x3c5d57))['catch'](handleError(_0x13ee58,null));};exports['show']=function(_0x57417f,_0x389846){var _0x2ddac8={'raw':![],'where':{'id':_0x57417f[_0x75bf('0x41')]['id']}},_0x1ff58c={};_0x1ff58c[_0x75bf('0x2f')]=_['keys'](db[_0x75bf('0x2a')][_0x75bf('0x2b')]);_0x1ff58c['query']=_[_0x75bf('0x31')](_0x57417f[_0x75bf('0x30')]);_0x1ff58c[_0x75bf('0x32')]=_[_0x75bf('0x34')](_0x1ff58c[_0x75bf('0x2f')],_0x1ff58c[_0x75bf('0x30')]);_0x2ddac8[_0x75bf('0x33')]=_['intersection'](_0x1ff58c['model'],qs[_0x75bf('0x35')](_0x57417f['query'][_0x75bf('0x35')]));_0x2ddac8[_0x75bf('0x33')]=_0x2ddac8[_0x75bf('0x33')][_0x75bf('0x42')]?_0x2ddac8['attributes']:_0x1ff58c[_0x75bf('0x2f')];if(_0x57417f[_0x75bf('0x30')][_0x75bf('0x3f')]){_0x2ddac8[_0x75bf('0x43')]=[{'all':!![]}];}_0x2ddac8=_['merge']({},_0x2ddac8,_0x57417f[_0x75bf('0x3e')]);return db[_0x75bf('0x2a')][_0x75bf('0x44')](_0x2ddac8)[_0x75bf('0x24')](handleEntityNotFound(_0x389846,null))[_0x75bf('0x24')](respondWithResult(_0x389846,null))[_0x75bf('0x45')](handleError(_0x389846,null));};exports[_0x75bf('0x46')]=function(_0x359176,_0x40cf68){return db[_0x75bf('0x2a')][_0x75bf('0x46')](_0x359176[_0x75bf('0x47')],{})[_0x75bf('0x24')](respondWithResult(_0x40cf68,0xc9))['catch'](handleError(_0x40cf68,null));};exports[_0x75bf('0x22')]=function(_0x2685b4,_0x37ba12){if(_0x2685b4['body']['id']){delete _0x2685b4['body']['id'];}return db[_0x75bf('0x2a')]['find']({'where':{'id':_0x2685b4[_0x75bf('0x41')]['id']}})[_0x75bf('0x24')](handleEntityNotFound(_0x37ba12,null))[_0x75bf('0x24')](saveUpdates(_0x2685b4[_0x75bf('0x47')],null))['then'](respondWithResult(_0x37ba12,null))['catch'](handleError(_0x37ba12,null));};exports[_0x75bf('0x23')]=function(_0x5f1941,_0x2f2eb9){return db[_0x75bf('0x2a')][_0x75bf('0x44')]({'where':{'id':_0x5f1941[_0x75bf('0x41')]['id']}})[_0x75bf('0x24')](handleEntityNotFound(_0x2f2eb9,null))['then'](removeEntity(_0x2f2eb9,null))[_0x75bf('0x45')](handleError(_0x2f2eb9,null));};exports[_0x75bf('0x48')]=function(_0x58649d,_0x5cd7fa,_0x2d9603){var _0x5c8f4b={};var _0x3b2276={};var _0x1439d0;var _0x15042e;return db[_0x75bf('0x2a')][_0x75bf('0x49')]({'where':{'id':_0x58649d['params']['id']}})[_0x75bf('0x24')](handleEntityNotFound(_0x5cd7fa,null))[_0x75bf('0x24')](function(_0x2b108b){if(_0x2b108b){_0x1439d0=_0x2b108b;_0x3b2276[_0x75bf('0x2f')]=_[_0x75bf('0x31')](db[_0x75bf('0x4a')][_0x75bf('0x2b')]);_0x3b2276[_0x75bf('0x30')]=_[_0x75bf('0x31')](_0x58649d['query']);_0x3b2276['filters']=_[_0x75bf('0x34')](_0x3b2276[_0x75bf('0x2f')],_0x3b2276[_0x75bf('0x30')]);_0x5c8f4b[_0x75bf('0x33')]=_[_0x75bf('0x34')](_0x3b2276[_0x75bf('0x2f')],qs[_0x75bf('0x35')](_0x58649d[_0x75bf('0x30')]['fields']));_0x5c8f4b[_0x75bf('0x33')]=_0x5c8f4b[_0x75bf('0x33')][_0x75bf('0x42')]?_0x5c8f4b[_0x75bf('0x33')]:_0x3b2276['model'];_0x5c8f4b[_0x75bf('0x38')]=qs['sort'](_0x58649d[_0x75bf('0x30')][_0x75bf('0x39')]);_0x5c8f4b[_0x75bf('0x3a')]=qs['filters'](_[_0x75bf('0x3b')](_0x58649d[_0x75bf('0x30')],_0x3b2276['filters']));if(_0x58649d[_0x75bf('0x30')][_0x75bf('0x3c')]){_0x5c8f4b[_0x75bf('0x3a')]=_[_0x75bf('0x3d')](_0x5c8f4b[_0x75bf('0x3a')],{'$or':_['map'](_0x5c8f4b[_0x75bf('0x33')],function(_0x3b82d8){var _0x7185ad={};_0x7185ad[_0x3b82d8]={'$like':'%'+_0x58649d[_0x75bf('0x30')]['filter']+'%'};return _0x7185ad;})});}_0x5c8f4b=_[_0x75bf('0x3d')]({},_0x5c8f4b,_0x58649d['options']);return _0x1439d0[_0x75bf('0x48')](_0x5c8f4b);}})[_0x75bf('0x24')](function(_0x43c0da){if(_0x43c0da){_0x15042e=_0x43c0da[_0x75bf('0x42')];if(!_0x58649d[_0x75bf('0x30')][_0x75bf('0x36')](_0x75bf('0x4b'))){_0x5c8f4b['limit']=qs[_0x75bf('0x37')](_0x58649d['query'][_0x75bf('0x37')]);_0x5c8f4b['offset']=qs[_0x75bf('0x1c')](_0x58649d[_0x75bf('0x30')][_0x75bf('0x1c')]);}return _0x1439d0[_0x75bf('0x48')](_0x5c8f4b);}})['then'](function(_0x59948e){if(_0x59948e){return _0x59948e?{'count':_0x15042e,'rows':_0x59948e}:null;}})['then'](respondWithResult(_0x5cd7fa,null))['catch'](handleError(_0x5cd7fa,null));};exports[_0x75bf('0x4c')]=function(_0x59b96b,_0xccf694,_0x185717){var _0x3d9fed={};var _0x582f8b={};var _0x511cd9;var _0x1557d1;return db[_0x75bf('0x2a')]['findOne']({'where':{'id':_0x59b96b['params']['id']}})[_0x75bf('0x24')](handleEntityNotFound(_0xccf694,null))[_0x75bf('0x24')](function(_0x32f4ea){if(_0x32f4ea){_0x511cd9=_0x32f4ea;_0x582f8b['model']=_['keys'](db['DeskField'][_0x75bf('0x2b')]);_0x582f8b[_0x75bf('0x30')]=_[_0x75bf('0x31')](_0x59b96b[_0x75bf('0x30')]);_0x582f8b['filters']=_['intersection'](_0x582f8b[_0x75bf('0x2f')],_0x582f8b[_0x75bf('0x30')]);_0x3d9fed[_0x75bf('0x33')]=_[_0x75bf('0x34')](_0x582f8b['model'],qs['fields'](_0x59b96b[_0x75bf('0x30')][_0x75bf('0x35')]));_0x3d9fed[_0x75bf('0x33')]=_0x3d9fed['attributes'][_0x75bf('0x42')]?_0x3d9fed[_0x75bf('0x33')]:_0x582f8b['model'];_0x3d9fed['order']=qs[_0x75bf('0x39')](_0x59b96b[_0x75bf('0x30')]['sort']);_0x3d9fed['where']=qs['filters'](_[_0x75bf('0x3b')](_0x59b96b['query'],_0x582f8b[_0x75bf('0x32')]));if(_0x59b96b[_0x75bf('0x30')][_0x75bf('0x3c')]){_0x3d9fed['where']=_[_0x75bf('0x3d')](_0x3d9fed['where'],{'$or':_[_0x75bf('0x29')](_0x3d9fed[_0x75bf('0x33')],function(_0x2e12f7){var _0x251a07={};_0x251a07[_0x2e12f7]={'$like':'%'+_0x59b96b['query'][_0x75bf('0x3c')]+'%'};return _0x251a07;})});}_0x3d9fed=_[_0x75bf('0x3d')]({},_0x3d9fed,_0x59b96b[_0x75bf('0x3e')]);return _0x511cd9[_0x75bf('0x4c')](_0x3d9fed);}})[_0x75bf('0x24')](function(_0x21e429){if(_0x21e429){_0x1557d1=_0x21e429[_0x75bf('0x42')];if(!_0x59b96b['query'][_0x75bf('0x36')](_0x75bf('0x4b'))){_0x3d9fed[_0x75bf('0x37')]=qs[_0x75bf('0x37')](_0x59b96b['query'][_0x75bf('0x37')]);_0x3d9fed[_0x75bf('0x1c')]=qs[_0x75bf('0x1c')](_0x59b96b['query'][_0x75bf('0x1c')]);}return _0x511cd9[_0x75bf('0x4c')](_0x3d9fed);}})[_0x75bf('0x24')](function(_0x1907cc){if(_0x1907cc){return _0x1907cc?{'count':_0x1557d1,'rows':_0x1907cc}:null;}})[_0x75bf('0x24')](respondWithResult(_0xccf694,null))[_0x75bf('0x45')](handleError(_0xccf694,null));};exports[_0x75bf('0x4d')]=function(_0x551926,_0x4d815e,_0x11b101){var _0x1fcda5={};var _0x16c0fb={};var _0x47f75c;var _0x4706d6;return db['DeskConfiguration']['findOne']({'where':{'id':_0x551926[_0x75bf('0x41')]['id']}})[_0x75bf('0x24')](handleEntityNotFound(_0x4d815e,null))[_0x75bf('0x24')](function(_0x29d9c9){if(_0x29d9c9){_0x47f75c=_0x29d9c9;_0x16c0fb['model']=_[_0x75bf('0x31')](db[_0x75bf('0x4a')][_0x75bf('0x2b')]);_0x16c0fb[_0x75bf('0x30')]=_[_0x75bf('0x31')](_0x551926[_0x75bf('0x30')]);_0x16c0fb['filters']=_[_0x75bf('0x34')](_0x16c0fb[_0x75bf('0x2f')],_0x16c0fb[_0x75bf('0x30')]);_0x1fcda5[_0x75bf('0x33')]=_['intersection'](_0x16c0fb[_0x75bf('0x2f')],qs[_0x75bf('0x35')](_0x551926[_0x75bf('0x30')]['fields']));_0x1fcda5[_0x75bf('0x33')]=_0x1fcda5[_0x75bf('0x33')][_0x75bf('0x42')]?_0x1fcda5[_0x75bf('0x33')]:_0x16c0fb[_0x75bf('0x2f')];_0x1fcda5['order']=qs[_0x75bf('0x39')](_0x551926[_0x75bf('0x30')][_0x75bf('0x39')]);_0x1fcda5[_0x75bf('0x3a')]=qs['filters'](_['pick'](_0x551926[_0x75bf('0x30')],_0x16c0fb['filters']));if(_0x551926['query'][_0x75bf('0x3c')]){_0x1fcda5[_0x75bf('0x3a')]=_[_0x75bf('0x3d')](_0x1fcda5[_0x75bf('0x3a')],{'$or':_[_0x75bf('0x29')](_0x1fcda5[_0x75bf('0x33')],function(_0x2b1495){var _0x6db892={};_0x6db892[_0x2b1495]={'$like':'%'+_0x551926[_0x75bf('0x30')][_0x75bf('0x3c')]+'%'};return _0x6db892;})});}_0x1fcda5=_[_0x75bf('0x3d')]({},_0x1fcda5,_0x551926[_0x75bf('0x3e')]);return _0x47f75c[_0x75bf('0x4d')](_0x1fcda5);}})[_0x75bf('0x24')](function(_0x226b2c){if(_0x226b2c){_0x4706d6=_0x226b2c[_0x75bf('0x42')];if(!_0x551926[_0x75bf('0x30')][_0x75bf('0x36')](_0x75bf('0x4b'))){_0x1fcda5[_0x75bf('0x37')]=qs['limit'](_0x551926[_0x75bf('0x30')][_0x75bf('0x37')]);_0x1fcda5[_0x75bf('0x1c')]=qs[_0x75bf('0x1c')](_0x551926[_0x75bf('0x30')][_0x75bf('0x1c')]);}return _0x47f75c['getDescriptions'](_0x1fcda5);}})[_0x75bf('0x24')](function(_0x41f778){if(_0x41f778){return _0x41f778?{'count':_0x4706d6,'rows':_0x41f778}:null;}})['then'](respondWithResult(_0x4d815e,null))['catch'](handleError(_0x4d815e,null));};exports['getTags']=function(_0xb82af2,_0x32b176,_0x5027b6){var _0x21fcf1={};var _0x10b10f={};var _0x330152;var _0x2e89e9;return db[_0x75bf('0x2a')][_0x75bf('0x49')]({'where':{'id':_0xb82af2[_0x75bf('0x41')]['id']}})[_0x75bf('0x24')](handleEntityNotFound(_0x32b176,null))[_0x75bf('0x24')](function(_0x54a98c){if(_0x54a98c){_0x330152=_0x54a98c;_0x10b10f[_0x75bf('0x2f')]=_['keys'](db[_0x75bf('0x4e')][_0x75bf('0x2b')]);_0x10b10f[_0x75bf('0x30')]=_['keys'](_0xb82af2['query']);_0x10b10f['filters']=_['intersection'](_0x10b10f[_0x75bf('0x2f')],_0x10b10f[_0x75bf('0x30')]);_0x21fcf1[_0x75bf('0x33')]=_[_0x75bf('0x34')](_0x10b10f[_0x75bf('0x2f')],qs[_0x75bf('0x35')](_0xb82af2[_0x75bf('0x30')]['fields']));_0x21fcf1[_0x75bf('0x33')]=_0x21fcf1[_0x75bf('0x33')][_0x75bf('0x42')]?_0x21fcf1['attributes']:_0x10b10f[_0x75bf('0x2f')];_0x21fcf1[_0x75bf('0x38')]=qs[_0x75bf('0x39')](_0xb82af2['query'][_0x75bf('0x39')]);_0x21fcf1[_0x75bf('0x3a')]=qs[_0x75bf('0x32')](_[_0x75bf('0x3b')](_0xb82af2[_0x75bf('0x30')],_0x10b10f[_0x75bf('0x32')]));if(_0xb82af2[_0x75bf('0x30')][_0x75bf('0x3c')]){_0x21fcf1['where']=_['merge'](_0x21fcf1['where'],{'$or':_['map'](_0x21fcf1[_0x75bf('0x33')],function(_0x24626b){var _0x4e4393={};_0x4e4393[_0x24626b]={'$like':'%'+_0xb82af2[_0x75bf('0x30')]['filter']+'%'};return _0x4e4393;})});}_0x21fcf1=_[_0x75bf('0x3d')]({},_0x21fcf1,_0xb82af2[_0x75bf('0x3e')]);return _0x330152['getTags'](_0x21fcf1);}})['then'](function(_0x36f121){if(_0x36f121){_0x2e89e9=_0x36f121[_0x75bf('0x42')];if(!_0xb82af2[_0x75bf('0x30')][_0x75bf('0x36')](_0x75bf('0x4b'))){_0x21fcf1['limit']=qs['limit'](_0xb82af2[_0x75bf('0x30')][_0x75bf('0x37')]);_0x21fcf1[_0x75bf('0x1c')]=qs['offset'](_0xb82af2[_0x75bf('0x30')][_0x75bf('0x1c')]);}return _0x330152['getTags'](_0x21fcf1);}})[_0x75bf('0x24')](function(_0x591253){if(_0x591253){return _0x591253?{'count':_0x2e89e9,'rows':_0x591253}:null;}})['then'](respondWithResult(_0x32b176,null))[_0x75bf('0x45')](handleError(_0x32b176,null));};exports['setTags']=function(_0x3c5416,_0x5dffc0,_0x5eb521){if(_0x3c5416[_0x75bf('0x47')]['id']){delete _0x3c5416[_0x75bf('0x47')]['id'];}return db[_0x75bf('0x2a')]['findOne']({'where':{'id':_0x3c5416['params']['id']}})[_0x75bf('0x24')](handleEntityNotFound(_0x5dffc0,null))[_0x75bf('0x24')](function(_0x4f7921){if(_0x4f7921){return _0x4f7921[_0x75bf('0x4f')](_0x3c5416[_0x75bf('0x47')][_0x75bf('0x50')]||[]);}return null;})[_0x75bf('0x24')](respondWithResult(_0x5dffc0,null))[_0x75bf('0x45')](handleError(_0x5dffc0,null));}; \ No newline at end of file +var _0x6a5c=['count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','findAll','catch','show','params','length','includeAll','find','create','body','keys','options','getFields','getSubjects','findOne','DeskField','getDescriptions','setTags','ids','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','limit','undefined'];(function(_0x56321f,_0x1c41eb){var _0x5aa129=function(_0x5cab95){while(--_0x5cab95){_0x56321f['push'](_0x56321f['shift']());}};_0x5aa129(++_0x1c41eb);}(_0x6a5c,0x1cd));var _0xc6a5=function(_0x6c0b0a,_0x496391){_0x6c0b0a=_0x6c0b0a-0x0;var _0x5f456a=_0x6a5c[_0x6c0b0a];return _0x5f456a;};'use strict';var emlformat=require(_0xc6a5('0x0'));var rimraf=require(_0xc6a5('0x1'));var zipdir=require(_0xc6a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc6a5('0x3'));var BPromise=require(_0xc6a5('0x4'));var Mustache=require(_0xc6a5('0x5'));var util=require(_0xc6a5('0x6'));var path=require(_0xc6a5('0x7'));var sox=require(_0xc6a5('0x8'));var csv=require(_0xc6a5('0x9'));var ejs=require(_0xc6a5('0xa'));var fs=require('fs');var fs_extra=require(_0xc6a5('0xb'));var _=require(_0xc6a5('0xc'));var squel=require(_0xc6a5('0xd'));var crypto=require(_0xc6a5('0xe'));var jsforce=require(_0xc6a5('0xf'));var deskjs=require(_0xc6a5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc6a5('0x11'));var Papa=require(_0xc6a5('0x12'));var Redis=require('ioredis');var authService=require(_0xc6a5('0x13'));var qs=require(_0xc6a5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6a5('0x15'));var logger=require('../../config/logger')(_0xc6a5('0x16'));var utils=require(_0xc6a5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc6a5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb2e7e8,_0x14f5a0){_0x14f5a0=_0x14f5a0||0xcc;return function(_0x1cbd3f){if(_0x1cbd3f){return _0xb2e7e8['sendStatus'](_0x14f5a0);}return _0xb2e7e8[_0xc6a5('0x19')](_0x14f5a0)[_0xc6a5('0x1a')]();};}function respondWithResult(_0x49c80f,_0x4b32c7){_0x4b32c7=_0x4b32c7||0xc8;return function(_0x89fe68){if(_0x89fe68){return _0x49c80f[_0xc6a5('0x19')](_0x4b32c7)[_0xc6a5('0x1b')](_0x89fe68);}};}function respondWithFilteredResult(_0x95a38b,_0x208097){return function(_0x3f64e5){if(_0x3f64e5){var _0x2ff6f2=typeof _0x208097[_0xc6a5('0x1c')]==='undefined'&&typeof _0x208097[_0xc6a5('0x1d')]===_0xc6a5('0x1e');var _0xffdd4f=_0x3f64e5[_0xc6a5('0x1f')];var _0x433fb3=_0x2ff6f2?0x0:_0x208097[_0xc6a5('0x1c')];var _0x3efb18=_0x2ff6f2?_0x3f64e5[_0xc6a5('0x1f')]:_0x208097['offset']+_0x208097[_0xc6a5('0x1d')];var _0x17dda2;if(_0x3efb18>=_0xffdd4f){_0x3efb18=_0xffdd4f;_0x17dda2=0xc8;}else{_0x17dda2=0xce;}_0x95a38b['status'](_0x17dda2);return _0x95a38b[_0xc6a5('0x20')](_0xc6a5('0x21'),_0x433fb3+'-'+_0x3efb18+'/'+_0xffdd4f)['json'](_0x3f64e5);}return null;};}function patchUpdates(_0x53b394){return function(_0x57d9e2){try{jsonpatch[_0xc6a5('0x22')](_0x57d9e2,_0x53b394,!![]);}catch(_0x35e2e1){return BPromise[_0xc6a5('0x23')](_0x35e2e1);}return _0x57d9e2[_0xc6a5('0x24')]();};}function saveUpdates(_0x52bd16,_0x355172){return function(_0x36ae00){if(_0x36ae00){return _0x36ae00[_0xc6a5('0x25')](_0x52bd16)[_0xc6a5('0x26')](function(_0x596e75){return _0x596e75;});}return null;};}function removeEntity(_0x4f3fc8,_0x36f20e){return function(_0x245cce){if(_0x245cce){return _0x245cce[_0xc6a5('0x27')]()['then'](function(){_0x4f3fc8[_0xc6a5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49154f,_0x47200b){return function(_0x32d64e){if(!_0x32d64e){_0x49154f['sendStatus'](0x194);}return _0x32d64e;};}function handleError(_0x40d5e3,_0x2ca5a9){_0x2ca5a9=_0x2ca5a9||0x1f4;return function(_0x119709){logger[_0xc6a5('0x28')](_0x119709[_0xc6a5('0x29')]);if(_0x119709[_0xc6a5('0x2a')]){delete _0x119709['name'];}_0x40d5e3[_0xc6a5('0x19')](_0x2ca5a9)[_0xc6a5('0x2b')](_0x119709);};}exports['index']=function(_0x2a140d,_0x4de668){var _0x4c4905={},_0x50f2d2={},_0x5a2318={'count':0x0,'rows':[]};var _0xa443ac=_[_0xc6a5('0x2c')](db[_0xc6a5('0x2d')][_0xc6a5('0x2e')],function(_0x5a8f62){return{'name':_0x5a8f62[_0xc6a5('0x2f')],'type':_0x5a8f62['type'][_0xc6a5('0x30')]};});_0x50f2d2[_0xc6a5('0x31')]=_[_0xc6a5('0x2c')](_0xa443ac,_0xc6a5('0x2a'));_0x50f2d2[_0xc6a5('0x32')]=_['keys'](_0x2a140d[_0xc6a5('0x32')]);_0x50f2d2[_0xc6a5('0x33')]=_[_0xc6a5('0x34')](_0x50f2d2[_0xc6a5('0x31')],_0x50f2d2[_0xc6a5('0x32')]);_0x4c4905[_0xc6a5('0x35')]=_[_0xc6a5('0x34')](_0x50f2d2[_0xc6a5('0x31')],qs[_0xc6a5('0x36')](_0x2a140d[_0xc6a5('0x32')][_0xc6a5('0x36')]));_0x4c4905[_0xc6a5('0x35')]=_0x4c4905[_0xc6a5('0x35')]['length']?_0x4c4905[_0xc6a5('0x35')]:_0x50f2d2[_0xc6a5('0x31')];if(!_0x2a140d[_0xc6a5('0x32')][_0xc6a5('0x37')](_0xc6a5('0x38'))){_0x4c4905[_0xc6a5('0x1d')]=qs[_0xc6a5('0x1d')](_0x2a140d['query'][_0xc6a5('0x1d')]);_0x4c4905['offset']=qs[_0xc6a5('0x1c')](_0x2a140d[_0xc6a5('0x32')][_0xc6a5('0x1c')]);}_0x4c4905[_0xc6a5('0x39')]=qs[_0xc6a5('0x3a')](_0x2a140d['query'][_0xc6a5('0x3a')]);_0x4c4905[_0xc6a5('0x3b')]=qs[_0xc6a5('0x33')](_[_0xc6a5('0x3c')](_0x2a140d[_0xc6a5('0x32')],_0x50f2d2['filters']),_0xa443ac);if(_0x2a140d[_0xc6a5('0x32')][_0xc6a5('0x3d')]){_0x4c4905['where']=_[_0xc6a5('0x3e')](_0x4c4905['where'],{'$or':_[_0xc6a5('0x2c')](_0xa443ac,function(_0x1f993c){if(_0x1f993c[_0xc6a5('0x3f')]!=='VIRTUAL'){var _0x4f1583={};_0x4f1583[_0x1f993c[_0xc6a5('0x2a')]]={'$like':'%'+_0x2a140d['query'][_0xc6a5('0x3d')]+'%'};return _0x4f1583;}})});}_0x4c4905=_['merge']({},_0x4c4905,_0x2a140d['options']);var _0x159250={'where':_0x4c4905[_0xc6a5('0x3b')]};return db['DeskConfiguration']['count'](_0x159250)[_0xc6a5('0x26')](function(_0x2646d9){_0x5a2318[_0xc6a5('0x1f')]=_0x2646d9;if(_0x2a140d['query']['includeAll']){_0x4c4905['include']=[{'all':!![]}];}return db[_0xc6a5('0x2d')][_0xc6a5('0x40')](_0x4c4905);})[_0xc6a5('0x26')](function(_0x3cf283){_0x5a2318['rows']=_0x3cf283;return _0x5a2318;})['then'](respondWithFilteredResult(_0x4de668,_0x4c4905))[_0xc6a5('0x41')](handleError(_0x4de668,null));};exports[_0xc6a5('0x42')]=function(_0x2e41fe,_0x4a2682){var _0x445d30={'raw':![],'where':{'id':_0x2e41fe[_0xc6a5('0x43')]['id']}},_0x4b78b4={};_0x4b78b4[_0xc6a5('0x31')]=_['keys'](db['DeskConfiguration'][_0xc6a5('0x2e')]);_0x4b78b4['query']=_['keys'](_0x2e41fe[_0xc6a5('0x32')]);_0x4b78b4[_0xc6a5('0x33')]=_[_0xc6a5('0x34')](_0x4b78b4[_0xc6a5('0x31')],_0x4b78b4[_0xc6a5('0x32')]);_0x445d30[_0xc6a5('0x35')]=_[_0xc6a5('0x34')](_0x4b78b4['model'],qs[_0xc6a5('0x36')](_0x2e41fe[_0xc6a5('0x32')]['fields']));_0x445d30[_0xc6a5('0x35')]=_0x445d30[_0xc6a5('0x35')][_0xc6a5('0x44')]?_0x445d30['attributes']:_0x4b78b4[_0xc6a5('0x31')];if(_0x2e41fe[_0xc6a5('0x32')][_0xc6a5('0x45')]){_0x445d30['include']=[{'all':!![]}];}_0x445d30=_['merge']({},_0x445d30,_0x2e41fe['options']);return db[_0xc6a5('0x2d')][_0xc6a5('0x46')](_0x445d30)[_0xc6a5('0x26')](handleEntityNotFound(_0x4a2682,null))[_0xc6a5('0x26')](respondWithResult(_0x4a2682,null))[_0xc6a5('0x41')](handleError(_0x4a2682,null));};exports[_0xc6a5('0x47')]=function(_0x547891,_0x2abcc5){return db['DeskConfiguration'][_0xc6a5('0x47')](_0x547891['body'],{})[_0xc6a5('0x26')](respondWithResult(_0x2abcc5,0xc9))[_0xc6a5('0x41')](handleError(_0x2abcc5,null));};exports['update']=function(_0x345460,_0x3655e7){if(_0x345460[_0xc6a5('0x48')]['id']){delete _0x345460[_0xc6a5('0x48')]['id'];}return db[_0xc6a5('0x2d')][_0xc6a5('0x46')]({'where':{'id':_0x345460['params']['id']}})['then'](handleEntityNotFound(_0x3655e7,null))[_0xc6a5('0x26')](saveUpdates(_0x345460[_0xc6a5('0x48')],null))[_0xc6a5('0x26')](respondWithResult(_0x3655e7,null))['catch'](handleError(_0x3655e7,null));};exports['destroy']=function(_0x1ec352,_0x11d9dc){return db['DeskConfiguration'][_0xc6a5('0x46')]({'where':{'id':_0x1ec352[_0xc6a5('0x43')]['id']}})[_0xc6a5('0x26')](handleEntityNotFound(_0x11d9dc,null))[_0xc6a5('0x26')](removeEntity(_0x11d9dc,null))[_0xc6a5('0x41')](handleError(_0x11d9dc,null));};exports['getFields']=function(_0x142f9c,_0x5b83a2,_0x1fab9c){var _0x197dce={};var _0x31f19a={};var _0x1dd1d7;var _0x3923b2;return db[_0xc6a5('0x2d')]['findOne']({'where':{'id':_0x142f9c['params']['id']}})['then'](handleEntityNotFound(_0x5b83a2,null))['then'](function(_0x372816){if(_0x372816){_0x1dd1d7=_0x372816;_0x31f19a['model']=_[_0xc6a5('0x49')](db['DeskField'][_0xc6a5('0x2e')]);_0x31f19a[_0xc6a5('0x32')]=_['keys'](_0x142f9c[_0xc6a5('0x32')]);_0x31f19a['filters']=_[_0xc6a5('0x34')](_0x31f19a[_0xc6a5('0x31')],_0x31f19a[_0xc6a5('0x32')]);_0x197dce[_0xc6a5('0x35')]=_['intersection'](_0x31f19a['model'],qs[_0xc6a5('0x36')](_0x142f9c[_0xc6a5('0x32')]['fields']));_0x197dce[_0xc6a5('0x35')]=_0x197dce[_0xc6a5('0x35')][_0xc6a5('0x44')]?_0x197dce['attributes']:_0x31f19a['model'];_0x197dce[_0xc6a5('0x39')]=qs[_0xc6a5('0x3a')](_0x142f9c[_0xc6a5('0x32')][_0xc6a5('0x3a')]);_0x197dce['where']=qs[_0xc6a5('0x33')](_[_0xc6a5('0x3c')](_0x142f9c[_0xc6a5('0x32')],_0x31f19a[_0xc6a5('0x33')]));if(_0x142f9c[_0xc6a5('0x32')]['filter']){_0x197dce[_0xc6a5('0x3b')]=_[_0xc6a5('0x3e')](_0x197dce[_0xc6a5('0x3b')],{'$or':_[_0xc6a5('0x2c')](_0x197dce['attributes'],function(_0x9ee42a){var _0x223a22={};_0x223a22[_0x9ee42a]={'$like':'%'+_0x142f9c['query'][_0xc6a5('0x3d')]+'%'};return _0x223a22;})});}_0x197dce=_[_0xc6a5('0x3e')]({},_0x197dce,_0x142f9c[_0xc6a5('0x4a')]);return _0x1dd1d7[_0xc6a5('0x4b')](_0x197dce);}})['then'](function(_0x1548c3){if(_0x1548c3){_0x3923b2=_0x1548c3[_0xc6a5('0x44')];if(!_0x142f9c[_0xc6a5('0x32')][_0xc6a5('0x37')](_0xc6a5('0x38'))){_0x197dce[_0xc6a5('0x1d')]=qs['limit'](_0x142f9c[_0xc6a5('0x32')][_0xc6a5('0x1d')]);_0x197dce[_0xc6a5('0x1c')]=qs['offset'](_0x142f9c[_0xc6a5('0x32')][_0xc6a5('0x1c')]);}return _0x1dd1d7[_0xc6a5('0x4b')](_0x197dce);}})['then'](function(_0x1d1ab8){if(_0x1d1ab8){return _0x1d1ab8?{'count':_0x3923b2,'rows':_0x1d1ab8}:null;}})[_0xc6a5('0x26')](respondWithResult(_0x5b83a2,null))[_0xc6a5('0x41')](handleError(_0x5b83a2,null));};exports[_0xc6a5('0x4c')]=function(_0x1a8d88,_0xde1fba,_0x2de99e){var _0xe49dca={};var _0x1e3f9d={};var _0x951ab7;var _0x229516;return db[_0xc6a5('0x2d')][_0xc6a5('0x4d')]({'where':{'id':_0x1a8d88[_0xc6a5('0x43')]['id']}})[_0xc6a5('0x26')](handleEntityNotFound(_0xde1fba,null))[_0xc6a5('0x26')](function(_0x1f9a54){if(_0x1f9a54){_0x951ab7=_0x1f9a54;_0x1e3f9d[_0xc6a5('0x31')]=_['keys'](db[_0xc6a5('0x4e')][_0xc6a5('0x2e')]);_0x1e3f9d['query']=_[_0xc6a5('0x49')](_0x1a8d88[_0xc6a5('0x32')]);_0x1e3f9d[_0xc6a5('0x33')]=_[_0xc6a5('0x34')](_0x1e3f9d[_0xc6a5('0x31')],_0x1e3f9d[_0xc6a5('0x32')]);_0xe49dca[_0xc6a5('0x35')]=_[_0xc6a5('0x34')](_0x1e3f9d['model'],qs[_0xc6a5('0x36')](_0x1a8d88['query'][_0xc6a5('0x36')]));_0xe49dca['attributes']=_0xe49dca['attributes'][_0xc6a5('0x44')]?_0xe49dca['attributes']:_0x1e3f9d[_0xc6a5('0x31')];_0xe49dca[_0xc6a5('0x39')]=qs[_0xc6a5('0x3a')](_0x1a8d88['query'][_0xc6a5('0x3a')]);_0xe49dca[_0xc6a5('0x3b')]=qs[_0xc6a5('0x33')](_[_0xc6a5('0x3c')](_0x1a8d88[_0xc6a5('0x32')],_0x1e3f9d[_0xc6a5('0x33')]));if(_0x1a8d88[_0xc6a5('0x32')][_0xc6a5('0x3d')]){_0xe49dca[_0xc6a5('0x3b')]=_['merge'](_0xe49dca[_0xc6a5('0x3b')],{'$or':_[_0xc6a5('0x2c')](_0xe49dca['attributes'],function(_0x5e8c5b){var _0x33ee5b={};_0x33ee5b[_0x5e8c5b]={'$like':'%'+_0x1a8d88[_0xc6a5('0x32')][_0xc6a5('0x3d')]+'%'};return _0x33ee5b;})});}_0xe49dca=_['merge']({},_0xe49dca,_0x1a8d88['options']);return _0x951ab7[_0xc6a5('0x4c')](_0xe49dca);}})[_0xc6a5('0x26')](function(_0xdf5f4f){if(_0xdf5f4f){_0x229516=_0xdf5f4f[_0xc6a5('0x44')];if(!_0x1a8d88[_0xc6a5('0x32')]['hasOwnProperty']('nolimit')){_0xe49dca[_0xc6a5('0x1d')]=qs['limit'](_0x1a8d88['query'][_0xc6a5('0x1d')]);_0xe49dca['offset']=qs['offset'](_0x1a8d88[_0xc6a5('0x32')][_0xc6a5('0x1c')]);}return _0x951ab7[_0xc6a5('0x4c')](_0xe49dca);}})['then'](function(_0x200b8a){if(_0x200b8a){return _0x200b8a?{'count':_0x229516,'rows':_0x200b8a}:null;}})[_0xc6a5('0x26')](respondWithResult(_0xde1fba,null))[_0xc6a5('0x41')](handleError(_0xde1fba,null));};exports[_0xc6a5('0x4f')]=function(_0x4de44c,_0x257f40,_0x3cfbcb){var _0x332a38={};var _0x3dca26={};var _0x405e1d;var _0xee38e4;return db[_0xc6a5('0x2d')][_0xc6a5('0x4d')]({'where':{'id':_0x4de44c['params']['id']}})['then'](handleEntityNotFound(_0x257f40,null))[_0xc6a5('0x26')](function(_0x19d9e1){if(_0x19d9e1){_0x405e1d=_0x19d9e1;_0x3dca26[_0xc6a5('0x31')]=_['keys'](db['DeskField'][_0xc6a5('0x2e')]);_0x3dca26[_0xc6a5('0x32')]=_[_0xc6a5('0x49')](_0x4de44c[_0xc6a5('0x32')]);_0x3dca26['filters']=_[_0xc6a5('0x34')](_0x3dca26['model'],_0x3dca26[_0xc6a5('0x32')]);_0x332a38[_0xc6a5('0x35')]=_[_0xc6a5('0x34')](_0x3dca26[_0xc6a5('0x31')],qs[_0xc6a5('0x36')](_0x4de44c[_0xc6a5('0x32')]['fields']));_0x332a38['attributes']=_0x332a38['attributes'][_0xc6a5('0x44')]?_0x332a38[_0xc6a5('0x35')]:_0x3dca26[_0xc6a5('0x31')];_0x332a38[_0xc6a5('0x39')]=qs['sort'](_0x4de44c[_0xc6a5('0x32')]['sort']);_0x332a38['where']=qs['filters'](_['pick'](_0x4de44c[_0xc6a5('0x32')],_0x3dca26[_0xc6a5('0x33')]));if(_0x4de44c[_0xc6a5('0x32')][_0xc6a5('0x3d')]){_0x332a38[_0xc6a5('0x3b')]=_['merge'](_0x332a38[_0xc6a5('0x3b')],{'$or':_[_0xc6a5('0x2c')](_0x332a38[_0xc6a5('0x35')],function(_0x105855){var _0x4b69f5={};_0x4b69f5[_0x105855]={'$like':'%'+_0x4de44c['query'][_0xc6a5('0x3d')]+'%'};return _0x4b69f5;})});}_0x332a38=_[_0xc6a5('0x3e')]({},_0x332a38,_0x4de44c[_0xc6a5('0x4a')]);return _0x405e1d['getDescriptions'](_0x332a38);}})['then'](function(_0x516c74){if(_0x516c74){_0xee38e4=_0x516c74[_0xc6a5('0x44')];if(!_0x4de44c[_0xc6a5('0x32')][_0xc6a5('0x37')](_0xc6a5('0x38'))){_0x332a38[_0xc6a5('0x1d')]=qs[_0xc6a5('0x1d')](_0x4de44c[_0xc6a5('0x32')][_0xc6a5('0x1d')]);_0x332a38['offset']=qs[_0xc6a5('0x1c')](_0x4de44c['query'][_0xc6a5('0x1c')]);}return _0x405e1d[_0xc6a5('0x4f')](_0x332a38);}})[_0xc6a5('0x26')](function(_0x5bc566){if(_0x5bc566){return _0x5bc566?{'count':_0xee38e4,'rows':_0x5bc566}:null;}})[_0xc6a5('0x26')](respondWithResult(_0x257f40,null))[_0xc6a5('0x41')](handleError(_0x257f40,null));};exports['getTags']=function(_0x3d67fd,_0x36478c,_0x5ea38c){var _0x4bf67d={};var _0x34022c={};var _0x30ab78;var _0x5cd159;return db[_0xc6a5('0x2d')][_0xc6a5('0x4d')]({'where':{'id':_0x3d67fd[_0xc6a5('0x43')]['id']}})['then'](handleEntityNotFound(_0x36478c,null))[_0xc6a5('0x26')](function(_0x183af0){if(_0x183af0){_0x30ab78=_0x183af0;_0x34022c[_0xc6a5('0x31')]=_[_0xc6a5('0x49')](db['Tag'][_0xc6a5('0x2e')]);_0x34022c[_0xc6a5('0x32')]=_['keys'](_0x3d67fd[_0xc6a5('0x32')]);_0x34022c[_0xc6a5('0x33')]=_[_0xc6a5('0x34')](_0x34022c['model'],_0x34022c['query']);_0x4bf67d['attributes']=_[_0xc6a5('0x34')](_0x34022c[_0xc6a5('0x31')],qs[_0xc6a5('0x36')](_0x3d67fd['query'][_0xc6a5('0x36')]));_0x4bf67d[_0xc6a5('0x35')]=_0x4bf67d['attributes'][_0xc6a5('0x44')]?_0x4bf67d['attributes']:_0x34022c['model'];_0x4bf67d[_0xc6a5('0x39')]=qs['sort'](_0x3d67fd[_0xc6a5('0x32')][_0xc6a5('0x3a')]);_0x4bf67d['where']=qs['filters'](_[_0xc6a5('0x3c')](_0x3d67fd[_0xc6a5('0x32')],_0x34022c[_0xc6a5('0x33')]));if(_0x3d67fd[_0xc6a5('0x32')][_0xc6a5('0x3d')]){_0x4bf67d[_0xc6a5('0x3b')]=_[_0xc6a5('0x3e')](_0x4bf67d[_0xc6a5('0x3b')],{'$or':_[_0xc6a5('0x2c')](_0x4bf67d['attributes'],function(_0x415d9f){var _0x30492d={};_0x30492d[_0x415d9f]={'$like':'%'+_0x3d67fd[_0xc6a5('0x32')][_0xc6a5('0x3d')]+'%'};return _0x30492d;})});}_0x4bf67d=_['merge']({},_0x4bf67d,_0x3d67fd[_0xc6a5('0x4a')]);return _0x30ab78['getTags'](_0x4bf67d);}})['then'](function(_0x5a3f96){if(_0x5a3f96){_0x5cd159=_0x5a3f96[_0xc6a5('0x44')];if(!_0x3d67fd[_0xc6a5('0x32')]['hasOwnProperty']('nolimit')){_0x4bf67d['limit']=qs['limit'](_0x3d67fd[_0xc6a5('0x32')]['limit']);_0x4bf67d[_0xc6a5('0x1c')]=qs[_0xc6a5('0x1c')](_0x3d67fd[_0xc6a5('0x32')][_0xc6a5('0x1c')]);}return _0x30ab78['getTags'](_0x4bf67d);}})[_0xc6a5('0x26')](function(_0x4ddb96){if(_0x4ddb96){return _0x4ddb96?{'count':_0x5cd159,'rows':_0x4ddb96}:null;}})[_0xc6a5('0x26')](respondWithResult(_0x36478c,null))['catch'](handleError(_0x36478c,null));};exports[_0xc6a5('0x50')]=function(_0x24f7a9,_0x8436c7,_0x2df2d1){if(_0x24f7a9['body']['id']){delete _0x24f7a9[_0xc6a5('0x48')]['id'];}return db[_0xc6a5('0x2d')][_0xc6a5('0x4d')]({'where':{'id':_0x24f7a9['params']['id']}})[_0xc6a5('0x26')](handleEntityNotFound(_0x8436c7,null))['then'](function(_0x3fcbf3){if(_0x3fcbf3){return _0x3fcbf3['setTags'](_0x24f7a9[_0xc6a5('0x48')][_0xc6a5('0x51')]||[]);}return null;})[_0xc6a5('0x26')](respondWithResult(_0x8436c7,null))['catch'](handleError(_0x8436c7,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 4c4c527..fa031bc 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 _0xe0db=['moment','bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api'];(function(_0x1e2b5b,_0x919349){var _0x27494c=function(_0x11d555){while(--_0x11d555){_0x1e2b5b['push'](_0x1e2b5b['shift']());}};_0x27494c(++_0x919349);}(_0xe0db,0x65));var _0xbe0d=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xe0db[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xbe0d('0x0'));var util=require('util');var logger=require(_0xbe0d('0x1'))(_0xbe0d('0x2'));var moment=require(_0xbe0d('0x3'));var BPromise=require(_0xbe0d('0x4'));var rp=require(_0xbe0d('0x5'));var fs=require('fs');var path=require(_0xbe0d('0x6'));var rimraf=require('rimraf');var config=require(_0xbe0d('0x7'));var attributes=require(_0xbe0d('0x8'));module[_0xbe0d('0x9')]=function(_0xcab340,_0x59b458){return _0xcab340[_0xbe0d('0xa')](_0xbe0d('0xb'),attributes,{'tableName':_0xbe0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d4c=['DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','path','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x59831f,_0x5154ca){var _0x11f70c=function(_0x3e7adf){while(--_0x3e7adf){_0x59831f['push'](_0x59831f['shift']());}};_0x11f70c(++_0x5154ca);}(_0x5d4c,0x1ba));var _0xc5d4=function(_0x4e42a9,_0x57e416){_0x4e42a9=_0x4e42a9-0x0;var _0x2e0d70=_0x5d4c[_0x4e42a9];return _0x2e0d70;};'use strict';var _=require(_0xc5d4('0x0'));var util=require(_0xc5d4('0x1'));var logger=require('../../config/logger')(_0xc5d4('0x2'));var moment=require(_0xc5d4('0x3'));var BPromise=require(_0xc5d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5d4('0x5'));var rimraf=require('rimraf');var config=require(_0xc5d4('0x6'));var attributes=require(_0xc5d4('0x7'));module[_0xc5d4('0x8')]=function(_0x368c78,_0x1c5fe5){return _0x368c78['define'](_0xc5d4('0x9'),attributes,{'tableName':_0xc5d4('0xa'),'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 d912ff4..8bca9cd 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 _0x09ef=['rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1f0bba,_0x430c51){var _0x258c06=function(_0x4b905e){while(--_0x4b905e){_0x1f0bba['push'](_0x1f0bba['shift']());}};_0x258c06(++_0x430c51);}(_0x09ef,0x15e));var _0xf09e=function(_0x274db5,_0xde0e65){_0x274db5=_0x274db5-0x0;var _0x41262e=_0x09ef[_0x274db5];return _0x41262e;};'use strict';var _=require(_0xf09e('0x0'));var util=require(_0xf09e('0x1'));var moment=require(_0xf09e('0x2'));var BPromise=require(_0xf09e('0x3'));var rs=require(_0xf09e('0x4'));var fs=require('fs');var Redis=require(_0xf09e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf09e('0x6'));var logger=require('../../config/logger')(_0xf09e('0x7'));var config=require(_0xf09e('0x8'));var jayson=require(_0xf09e('0x9'));var client=jayson[_0xf09e('0xa')][_0xf09e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x294258,_0x1d205f,_0x877574){return new BPromise(function(_0x2e5a79,_0x2f28e1){return client['request'](_0x294258,_0x877574)[_0xf09e('0xc')](function(_0xfdb22a){logger[_0xf09e('0xd')](_0xf09e('0xe'),_0x1d205f,_0xf09e('0xf'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1d205f,_0xf09e('0xf'),JSON[_0xf09e('0x10')](_0xfdb22a));if(_0xfdb22a['error']){if(_0xfdb22a[_0xf09e('0x11')]['code']===0x1f4){logger[_0xf09e('0x11')](_0xf09e('0xe'),_0x1d205f,_0xfdb22a[_0xf09e('0x11')][_0xf09e('0x12')]);return _0x2f28e1(_0xfdb22a[_0xf09e('0x11')][_0xf09e('0x12')]);}logger['error'](_0xf09e('0xe'),_0x1d205f,_0xfdb22a['error'][_0xf09e('0x12')]);return _0x2e5a79(_0xfdb22a[_0xf09e('0x11')][_0xf09e('0x12')]);}else{logger['info'](_0xf09e('0xe'),_0x1d205f,_0xf09e('0xf'));_0x2e5a79(_0xfdb22a[_0xf09e('0x13')][_0xf09e('0x12')]);}})[_0xf09e('0x14')](function(_0x176029){logger[_0xf09e('0x11')](_0xf09e('0xe'),_0x1d205f,_0x176029);_0x2f28e1(_0x176029);});});} \ No newline at end of file +var _0xa03c=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x438c57,_0x23199b){var _0x538f2=function(_0x12d731){while(--_0x12d731){_0x438c57['push'](_0x438c57['shift']());}};_0x538f2(++_0x23199b);}(_0xa03c,0x94));var _0xca03=function(_0x599c76,_0x3a5b7e){_0x599c76=_0x599c76-0x0;var _0x5e6a38=_0xa03c[_0x599c76];return _0x5e6a38;};'use strict';var _=require(_0xca03('0x0'));var util=require('util');var moment=require(_0xca03('0x1'));var BPromise=require(_0xca03('0x2'));var rs=require(_0xca03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca03('0x4'))['db'];var utils=require(_0xca03('0x5'));var logger=require(_0xca03('0x6'))('rpc');var config=require(_0xca03('0x7'));var jayson=require(_0xca03('0x8'));var client=jayson[_0xca03('0x9')][_0xca03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27aac6,_0x9d2b3d,_0x52f12e){return new BPromise(function(_0x1832cc,_0x18ddee){return client[_0xca03('0xb')](_0x27aac6,_0x52f12e)[_0xca03('0xc')](function(_0x31e7be){logger[_0xca03('0xd')](_0xca03('0xe'),_0x9d2b3d,_0xca03('0xf'));logger[_0xca03('0x10')](_0xca03('0x11'),_0x9d2b3d,'request\x20sent',JSON[_0xca03('0x12')](_0x31e7be));if(_0x31e7be[_0xca03('0x13')]){if(_0x31e7be[_0xca03('0x13')][_0xca03('0x14')]===0x1f4){logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);return _0x18ddee(_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);}logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);return _0x1832cc(_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);}else{logger[_0xca03('0xd')](_0xca03('0xe'),_0x9d2b3d,_0xca03('0xf'));_0x1832cc(_0x31e7be['result'][_0xca03('0x15')]);}})[_0xca03('0x16')](function(_0x184313){logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x184313);_0x18ddee(_0x184313);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index ae1b8a5..eb69106 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 _0xf567=['create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','show','post'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0xf567,0x118));var _0x7f56=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf567[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var path=require(_0x7f56('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f56('0x3'));var router=express[_0x7f56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f56('0x5'));var interaction=require(_0x7f56('0x6'));var config=require(_0x7f56('0x7'));var controller=require(_0x7f56('0x8'));router['get']('/',auth[_0x7f56('0x9')](),controller[_0x7f56('0xa')]);router[_0x7f56('0xb')]('/:id',auth[_0x7f56('0x9')](),controller[_0x7f56('0xc')]);router[_0x7f56('0xd')]('/',auth[_0x7f56('0x9')](),controller[_0x7f56('0xe')]);router[_0x7f56('0xf')](_0x7f56('0x10'),auth[_0x7f56('0x9')](),controller[_0x7f56('0x11')]);router[_0x7f56('0x12')](_0x7f56('0x10'),auth[_0x7f56('0x9')](),controller[_0x7f56('0x13')]);module[_0x7f56('0x14')]=router; \ No newline at end of file +var _0x80b2=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x12bd61,_0x1663e6){var _0x2f1538=function(_0x5de655){while(--_0x5de655){_0x12bd61['push'](_0x12bd61['shift']());}};_0x2f1538(++_0x1663e6);}(_0x80b2,0x141));var _0x280b=function(_0x5d4cd2,_0xe2f5c1){_0x5d4cd2=_0x5d4cd2-0x0;var _0x974029=_0x80b2[_0x5d4cd2];return _0x974029;};'use strict';var multer=require(_0x280b('0x0'));var util=require(_0x280b('0x1'));var path=require('path');var timeout=require(_0x280b('0x2'));var express=require(_0x280b('0x3'));var router=express['Router']();var fs_extra=require(_0x280b('0x4'));var auth=require(_0x280b('0x5'));var interaction=require(_0x280b('0x6'));var config=require(_0x280b('0x7'));var controller=require(_0x280b('0x8'));router['get']('/',auth[_0x280b('0x9')](),controller[_0x280b('0xa')]);router['get'](_0x280b('0xb'),auth[_0x280b('0x9')](),controller[_0x280b('0xc')]);router['post']('/',auth[_0x280b('0x9')](),controller[_0x280b('0xd')]);router[_0x280b('0xe')](_0x280b('0xb'),auth[_0x280b('0x9')](),controller[_0x280b('0xf')]);router['delete']('/:id',auth[_0x280b('0x9')](),controller[_0x280b('0x10')]);module[_0x280b('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 74014e9..9fb5e1b 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 _0x7ebe=['picklist','STRING','customVariable','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x5db583,_0x1497c7){var _0x1525af=function(_0x498fee){while(--_0x498fee){_0x5db583['push'](_0x5db583['shift']());}};_0x1525af(++_0x1497c7);}(_0x7ebe,0x1ac));var _0xe7eb=function(_0x428292,_0x28cafd){_0x428292=_0x428292-0x0;var _0x6faf63=_0x7ebe[_0x428292];return _0x6faf63;};'use strict';var Sequelize=require(_0xe7eb('0x0'));module['exports']={'type':{'type':Sequelize[_0xe7eb('0x1')](_0xe7eb('0x2'),_0xe7eb('0x3'),'customVariable','keyValue',_0xe7eb('0x4')),'defaultValue':_0xe7eb('0x2')},'content':{'type':Sequelize[_0xe7eb('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xe7eb('0x2'),_0xe7eb('0x3'),_0xe7eb('0x6'))},'keyContent':{'type':Sequelize[_0xe7eb('0x5')]},'idField':{'type':Sequelize[_0xe7eb('0x5')]},'nameField':{'type':Sequelize[_0xe7eb('0x5')]},'customField':{'type':Sequelize[_0xe7eb('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3244=['customVariable','keyValue','STRING','sequelize','string','variable'];(function(_0x3dc55d,_0xd07e93){var _0x3aa7f3=function(_0x506b46){while(--_0x506b46){_0x3dc55d['push'](_0x3dc55d['shift']());}};_0x3aa7f3(++_0xd07e93);}(_0x3244,0x1b3));var _0x4324=function(_0x541883,_0x2a4214){_0x541883=_0x541883-0x0;var _0x5ab8a2=_0x3244[_0x541883];return _0x5ab8a2;};'use strict';var Sequelize=require(_0x4324('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x4324('0x1'),_0x4324('0x2'),_0x4324('0x3'),_0x4324('0x4'),'picklist'),'defaultValue':_0x4324('0x1')},'content':{'type':Sequelize[_0x4324('0x5')]},'key':{'type':Sequelize[_0x4324('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x4324('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4324('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'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 53177a4..3c6f369 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 _0xe75a=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','DeskField','include','rows','catch','params','length','includeAll','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0xe75a,0x1de));var _0xae75=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0xe75a[_0x42d2af];return _0x1d6d63;};'use strict';var emlformat=require(_0xae75('0x0'));var rimraf=require(_0xae75('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae75('0x2'));var rp=require(_0xae75('0x3'));var moment=require(_0xae75('0x4'));var BPromise=require(_0xae75('0x5'));var Mustache=require(_0xae75('0x6'));var util=require(_0xae75('0x7'));var path=require(_0xae75('0x8'));var sox=require(_0xae75('0x9'));var csv=require(_0xae75('0xa'));var ejs=require(_0xae75('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae75('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xae75('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae75('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xae75('0xf'));var as=require(_0xae75('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae75('0x11'))(_0xae75('0x12'));var utils=require('../../config/utils');var config=require(_0xae75('0x13'));var licenseUtil=require(_0xae75('0x14'));var db=require(_0xae75('0x15'))['db'];function respondWithStatusCode(_0x5e9127,_0x435111){_0x435111=_0x435111||0xcc;return function(_0x1de6fd){if(_0x1de6fd){return _0x5e9127[_0xae75('0x16')](_0x435111);}return _0x5e9127[_0xae75('0x17')](_0x435111)[_0xae75('0x18')]();};}function respondWithResult(_0x2c1437,_0x39279a){_0x39279a=_0x39279a||0xc8;return function(_0x99fdc8){if(_0x99fdc8){return _0x2c1437[_0xae75('0x17')](_0x39279a)[_0xae75('0x19')](_0x99fdc8);}};}function respondWithFilteredResult(_0x5dcc10,_0x1f76dc){return function(_0xb1461d){if(_0xb1461d){var _0x46ebef=typeof _0x1f76dc[_0xae75('0x1a')]===_0xae75('0x1b')&&typeof _0x1f76dc[_0xae75('0x1c')]==='undefined';var _0x52f683=_0xb1461d[_0xae75('0x1d')];var _0x2cffc8=_0x46ebef?0x0:_0x1f76dc[_0xae75('0x1a')];var _0x582740=_0x46ebef?_0xb1461d[_0xae75('0x1d')]:_0x1f76dc[_0xae75('0x1a')]+_0x1f76dc[_0xae75('0x1c')];var _0x30a3b0;if(_0x582740>=_0x52f683){_0x582740=_0x52f683;_0x30a3b0=0xc8;}else{_0x30a3b0=0xce;}_0x5dcc10[_0xae75('0x17')](_0x30a3b0);return _0x5dcc10[_0xae75('0x1e')]('Content-Range',_0x2cffc8+'-'+_0x582740+'/'+_0x52f683)[_0xae75('0x19')](_0xb1461d);}return null;};}function patchUpdates(_0x43b698){return function(_0x3c82bc){try{jsonpatch[_0xae75('0x1f')](_0x3c82bc,_0x43b698,!![]);}catch(_0x2ec155){return BPromise[_0xae75('0x20')](_0x2ec155);}return _0x3c82bc[_0xae75('0x21')]();};}function saveUpdates(_0x3e656a,_0x33dc4d){return function(_0x56704c){if(_0x56704c){return _0x56704c[_0xae75('0x22')](_0x3e656a)[_0xae75('0x23')](function(_0x2f6b12){return _0x2f6b12;});}return null;};}function removeEntity(_0x349144,_0x4bdbba){return function(_0x52b6e6){if(_0x52b6e6){return _0x52b6e6[_0xae75('0x24')]()['then'](function(){_0x349144[_0xae75('0x17')](0xcc)[_0xae75('0x18')]();});}};}function handleEntityNotFound(_0x3f8b21,_0x14cdb8){return function(_0x25cb0b){if(!_0x25cb0b){_0x3f8b21[_0xae75('0x16')](0x194);}return _0x25cb0b;};}function handleError(_0x76fb08,_0x3a30f8){_0x3a30f8=_0x3a30f8||0x1f4;return function(_0x2af640){logger['error'](_0x2af640[_0xae75('0x25')]);if(_0x2af640['name']){delete _0x2af640[_0xae75('0x26')];}_0x76fb08[_0xae75('0x17')](_0x3a30f8)['send'](_0x2af640);};}exports['index']=function(_0x105007,_0x4cbe0d){var _0x8644b6={},_0x1b5c2f={},_0x2a19e6={'count':0x0,'rows':[]};var _0x2579f7=_['map'](db['DeskField'][_0xae75('0x27')],function(_0x5b2370){return{'name':_0x5b2370[_0xae75('0x28')],'type':_0x5b2370['type'][_0xae75('0x29')]};});_0x1b5c2f[_0xae75('0x2a')]=_[_0xae75('0x2b')](_0x2579f7,_0xae75('0x26'));_0x1b5c2f[_0xae75('0x2c')]=_[_0xae75('0x2d')](_0x105007[_0xae75('0x2c')]);_0x1b5c2f['filters']=_[_0xae75('0x2e')](_0x1b5c2f[_0xae75('0x2a')],_0x1b5c2f[_0xae75('0x2c')]);_0x8644b6[_0xae75('0x2f')]=_['intersection'](_0x1b5c2f[_0xae75('0x2a')],qs[_0xae75('0x30')](_0x105007[_0xae75('0x2c')][_0xae75('0x30')]));_0x8644b6[_0xae75('0x2f')]=_0x8644b6[_0xae75('0x2f')]['length']?_0x8644b6[_0xae75('0x2f')]:_0x1b5c2f[_0xae75('0x2a')];if(!_0x105007[_0xae75('0x2c')]['hasOwnProperty'](_0xae75('0x31'))){_0x8644b6[_0xae75('0x1c')]=qs[_0xae75('0x1c')](_0x105007[_0xae75('0x2c')][_0xae75('0x1c')]);_0x8644b6[_0xae75('0x1a')]=qs[_0xae75('0x1a')](_0x105007[_0xae75('0x2c')][_0xae75('0x1a')]);}_0x8644b6['order']=qs['sort'](_0x105007[_0xae75('0x2c')][_0xae75('0x32')]);_0x8644b6[_0xae75('0x33')]=qs[_0xae75('0x34')](_[_0xae75('0x35')](_0x105007['query'],_0x1b5c2f['filters']),_0x2579f7);if(_0x105007[_0xae75('0x2c')][_0xae75('0x36')]){_0x8644b6[_0xae75('0x33')]=_[_0xae75('0x37')](_0x8644b6[_0xae75('0x33')],{'$or':_[_0xae75('0x2b')](_0x2579f7,function(_0x126455){if(_0x126455[_0xae75('0x38')]!==_0xae75('0x39')){var _0x586f3c={};_0x586f3c[_0x126455[_0xae75('0x26')]]={'$like':'%'+_0x105007[_0xae75('0x2c')][_0xae75('0x36')]+'%'};return _0x586f3c;}})});}_0x8644b6=_['merge']({},_0x8644b6,_0x105007[_0xae75('0x3a')]);var _0x450440={'where':_0x8644b6[_0xae75('0x33')]};return db[_0xae75('0x3b')][_0xae75('0x1d')](_0x450440)[_0xae75('0x23')](function(_0x55ac4b){_0x2a19e6[_0xae75('0x1d')]=_0x55ac4b;if(_0x105007[_0xae75('0x2c')]['includeAll']){_0x8644b6[_0xae75('0x3c')]=[{'all':!![]}];}return db[_0xae75('0x3b')]['findAll'](_0x8644b6);})[_0xae75('0x23')](function(_0x4004ee){_0x2a19e6[_0xae75('0x3d')]=_0x4004ee;return _0x2a19e6;})[_0xae75('0x23')](respondWithFilteredResult(_0x4cbe0d,_0x8644b6))[_0xae75('0x3e')](handleError(_0x4cbe0d,null));};exports['show']=function(_0x2ff63b,_0x46ed96){var _0x350beb={'raw':!![],'where':{'id':_0x2ff63b[_0xae75('0x3f')]['id']}},_0x5decd2={};_0x5decd2[_0xae75('0x2a')]=_[_0xae75('0x2d')](db[_0xae75('0x3b')][_0xae75('0x27')]);_0x5decd2[_0xae75('0x2c')]=_['keys'](_0x2ff63b[_0xae75('0x2c')]);_0x5decd2[_0xae75('0x34')]=_[_0xae75('0x2e')](_0x5decd2['model'],_0x5decd2[_0xae75('0x2c')]);_0x350beb[_0xae75('0x2f')]=_[_0xae75('0x2e')](_0x5decd2['model'],qs[_0xae75('0x30')](_0x2ff63b[_0xae75('0x2c')][_0xae75('0x30')]));_0x350beb[_0xae75('0x2f')]=_0x350beb[_0xae75('0x2f')][_0xae75('0x40')]?_0x350beb[_0xae75('0x2f')]:_0x5decd2[_0xae75('0x2a')];if(_0x2ff63b[_0xae75('0x2c')][_0xae75('0x41')]){_0x350beb[_0xae75('0x3c')]=[{'all':!![]}];}_0x350beb=_[_0xae75('0x37')]({},_0x350beb,_0x2ff63b[_0xae75('0x3a')]);return db[_0xae75('0x3b')]['find'](_0x350beb)[_0xae75('0x23')](handleEntityNotFound(_0x46ed96,null))[_0xae75('0x23')](respondWithResult(_0x46ed96,null))[_0xae75('0x3e')](handleError(_0x46ed96,null));};exports['create']=function(_0x41ba3d,_0xd0ff9d){return db[_0xae75('0x3b')][_0xae75('0x42')](_0x41ba3d[_0xae75('0x43')],{})[_0xae75('0x23')](respondWithResult(_0xd0ff9d,0xc9))[_0xae75('0x3e')](handleError(_0xd0ff9d,null));};exports[_0xae75('0x22')]=function(_0x434787,_0x262c66){if(_0x434787['body']['id']){delete _0x434787[_0xae75('0x43')]['id'];}return db[_0xae75('0x3b')][_0xae75('0x44')]({'where':{'id':_0x434787['params']['id']}})[_0xae75('0x23')](handleEntityNotFound(_0x262c66,null))[_0xae75('0x23')](saveUpdates(_0x434787['body'],null))[_0xae75('0x23')](respondWithResult(_0x262c66,null))[_0xae75('0x3e')](handleError(_0x262c66,null));};exports['destroy']=function(_0x4d196b,_0x4a66f9){return db['DeskField'][_0xae75('0x44')]({'where':{'id':_0x4d196b['params']['id']}})[_0xae75('0x23')](handleEntityNotFound(_0x4a66f9,null))[_0xae75('0x23')](removeEntity(_0x4a66f9,null))[_0xae75('0x3e')](handleError(_0x4a66f9,null));}; \ No newline at end of file +var _0x0dee=['update','then','destroy','sendStatus','error','stack','name','index','DeskField','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','params','keys','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x235fae,_0xea3869){var _0x221dc8=function(_0x1c2a57){while(--_0x1c2a57){_0x235fae['push'](_0x235fae['shift']());}};_0x221dc8(++_0xea3869);}(_0x0dee,0xf7));var _0xe0de=function(_0x24d415,_0x5508f6){_0x24d415=_0x24d415-0x0;var _0x14183b=_0x0dee[_0x24d415];return _0x14183b;};'use strict';var emlformat=require(_0xe0de('0x0'));var rimraf=require(_0xe0de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0de('0x2'));var rp=require('request-promise');var moment=require(_0xe0de('0x3'));var BPromise=require(_0xe0de('0x4'));var Mustache=require('mustache');var util=require(_0xe0de('0x5'));var path=require(_0xe0de('0x6'));var sox=require(_0xe0de('0x7'));var csv=require('to-csv');var ejs=require(_0xe0de('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0de('0x9'));var squel=require(_0xe0de('0xa'));var crypto=require(_0xe0de('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe0de('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe0de('0xd'));var Papa=require('papaparse');var Redis=require(_0xe0de('0xe'));var authService=require(_0xe0de('0xf'));var qs=require(_0xe0de('0x10'));var as=require(_0xe0de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0de('0x12'))(_0xe0de('0x13'));var utils=require(_0xe0de('0x14'));var config=require(_0xe0de('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0defb,_0x37744c){_0x37744c=_0x37744c||0xcc;return function(_0x4c6d4d){if(_0x4c6d4d){return _0xb0defb['sendStatus'](_0x37744c);}return _0xb0defb[_0xe0de('0x16')](_0x37744c)[_0xe0de('0x17')]();};}function respondWithResult(_0x4e4c41,_0x4cd724){_0x4cd724=_0x4cd724||0xc8;return function(_0x5e1fd9){if(_0x5e1fd9){return _0x4e4c41['status'](_0x4cd724)[_0xe0de('0x18')](_0x5e1fd9);}};}function respondWithFilteredResult(_0x3ae86f,_0x363b5f){return function(_0xfc026b){if(_0xfc026b){var _0xb711fb=typeof _0x363b5f[_0xe0de('0x19')]===_0xe0de('0x1a')&&typeof _0x363b5f[_0xe0de('0x1b')]===_0xe0de('0x1a');var _0x22d047=_0xfc026b['count'];var _0x45cecc=_0xb711fb?0x0:_0x363b5f[_0xe0de('0x19')];var _0xeb9581=_0xb711fb?_0xfc026b[_0xe0de('0x1c')]:_0x363b5f[_0xe0de('0x19')]+_0x363b5f[_0xe0de('0x1b')];var _0x4ea410;if(_0xeb9581>=_0x22d047){_0xeb9581=_0x22d047;_0x4ea410=0xc8;}else{_0x4ea410=0xce;}_0x3ae86f[_0xe0de('0x16')](_0x4ea410);return _0x3ae86f[_0xe0de('0x1d')](_0xe0de('0x1e'),_0x45cecc+'-'+_0xeb9581+'/'+_0x22d047)['json'](_0xfc026b);}return null;};}function patchUpdates(_0x2d7ad8){return function(_0x5dae22){try{jsonpatch[_0xe0de('0x1f')](_0x5dae22,_0x2d7ad8,!![]);}catch(_0x5677f9){return BPromise[_0xe0de('0x20')](_0x5677f9);}return _0x5dae22['save']();};}function saveUpdates(_0x2551f7,_0x2debf6){return function(_0x2df49c){if(_0x2df49c){return _0x2df49c[_0xe0de('0x21')](_0x2551f7)[_0xe0de('0x22')](function(_0x59bb8d){return _0x59bb8d;});}return null;};}function removeEntity(_0x94dbf3,_0x211e92){return function(_0x4e0d04){if(_0x4e0d04){return _0x4e0d04[_0xe0de('0x23')]()[_0xe0de('0x22')](function(){_0x94dbf3[_0xe0de('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523891,_0x5877f8){return function(_0x3a41a9){if(!_0x3a41a9){_0x523891[_0xe0de('0x24')](0x194);}return _0x3a41a9;};}function handleError(_0x58edf7,_0x241acd){_0x241acd=_0x241acd||0x1f4;return function(_0x31bab4){logger[_0xe0de('0x25')](_0x31bab4[_0xe0de('0x26')]);if(_0x31bab4['name']){delete _0x31bab4[_0xe0de('0x27')];}_0x58edf7[_0xe0de('0x16')](_0x241acd)['send'](_0x31bab4);};}exports[_0xe0de('0x28')]=function(_0x32ba02,_0x52b466){var _0x569787={},_0x48084f={},_0x4fec50={'count':0x0,'rows':[]};var _0x2e4e4f=_['map'](db[_0xe0de('0x29')][_0xe0de('0x2a')],function(_0x5745ec){return{'name':_0x5745ec[_0xe0de('0x2b')],'type':_0x5745ec['type'][_0xe0de('0x2c')]};});_0x48084f[_0xe0de('0x2d')]=_[_0xe0de('0x2e')](_0x2e4e4f,_0xe0de('0x27'));_0x48084f['query']=_['keys'](_0x32ba02[_0xe0de('0x2f')]);_0x48084f[_0xe0de('0x30')]=_[_0xe0de('0x31')](_0x48084f['model'],_0x48084f[_0xe0de('0x2f')]);_0x569787['attributes']=_[_0xe0de('0x31')](_0x48084f[_0xe0de('0x2d')],qs[_0xe0de('0x32')](_0x32ba02[_0xe0de('0x2f')][_0xe0de('0x32')]));_0x569787[_0xe0de('0x33')]=_0x569787[_0xe0de('0x33')][_0xe0de('0x34')]?_0x569787[_0xe0de('0x33')]:_0x48084f[_0xe0de('0x2d')];if(!_0x32ba02[_0xe0de('0x2f')][_0xe0de('0x35')]('nolimit')){_0x569787[_0xe0de('0x1b')]=qs[_0xe0de('0x1b')](_0x32ba02[_0xe0de('0x2f')]['limit']);_0x569787[_0xe0de('0x19')]=qs[_0xe0de('0x19')](_0x32ba02['query'][_0xe0de('0x19')]);}_0x569787['order']=qs[_0xe0de('0x36')](_0x32ba02[_0xe0de('0x2f')][_0xe0de('0x36')]);_0x569787[_0xe0de('0x37')]=qs['filters'](_[_0xe0de('0x38')](_0x32ba02[_0xe0de('0x2f')],_0x48084f[_0xe0de('0x30')]),_0x2e4e4f);if(_0x32ba02[_0xe0de('0x2f')][_0xe0de('0x39')]){_0x569787[_0xe0de('0x37')]=_[_0xe0de('0x3a')](_0x569787['where'],{'$or':_[_0xe0de('0x2e')](_0x2e4e4f,function(_0x5cd886){if(_0x5cd886[_0xe0de('0x3b')]!==_0xe0de('0x3c')){var _0x127b3f={};_0x127b3f[_0x5cd886['name']]={'$like':'%'+_0x32ba02[_0xe0de('0x2f')][_0xe0de('0x39')]+'%'};return _0x127b3f;}})});}_0x569787=_['merge']({},_0x569787,_0x32ba02[_0xe0de('0x3d')]);var _0x582a36={'where':_0x569787['where']};return db['DeskField']['count'](_0x582a36)[_0xe0de('0x22')](function(_0x245e68){_0x4fec50[_0xe0de('0x1c')]=_0x245e68;if(_0x32ba02[_0xe0de('0x2f')][_0xe0de('0x3e')]){_0x569787[_0xe0de('0x3f')]=[{'all':!![]}];}return db[_0xe0de('0x29')]['findAll'](_0x569787);})[_0xe0de('0x22')](function(_0x4f66fc){_0x4fec50['rows']=_0x4f66fc;return _0x4fec50;})['then'](respondWithFilteredResult(_0x52b466,_0x569787))[_0xe0de('0x40')](handleError(_0x52b466,null));};exports['show']=function(_0x3710f3,_0xf5c494){var _0x496d11={'raw':!![],'where':{'id':_0x3710f3[_0xe0de('0x41')]['id']}},_0x5b3337={};_0x5b3337['model']=_[_0xe0de('0x42')](db[_0xe0de('0x29')][_0xe0de('0x2a')]);_0x5b3337[_0xe0de('0x2f')]=_[_0xe0de('0x42')](_0x3710f3['query']);_0x5b3337['filters']=_[_0xe0de('0x31')](_0x5b3337[_0xe0de('0x2d')],_0x5b3337['query']);_0x496d11[_0xe0de('0x33')]=_[_0xe0de('0x31')](_0x5b3337['model'],qs[_0xe0de('0x32')](_0x3710f3[_0xe0de('0x2f')][_0xe0de('0x32')]));_0x496d11[_0xe0de('0x33')]=_0x496d11[_0xe0de('0x33')][_0xe0de('0x34')]?_0x496d11[_0xe0de('0x33')]:_0x5b3337['model'];if(_0x3710f3[_0xe0de('0x2f')]['includeAll']){_0x496d11[_0xe0de('0x3f')]=[{'all':!![]}];}_0x496d11=_[_0xe0de('0x3a')]({},_0x496d11,_0x3710f3[_0xe0de('0x3d')]);return db['DeskField'][_0xe0de('0x43')](_0x496d11)['then'](handleEntityNotFound(_0xf5c494,null))['then'](respondWithResult(_0xf5c494,null))[_0xe0de('0x40')](handleError(_0xf5c494,null));};exports[_0xe0de('0x44')]=function(_0x35d6be,_0x33f588){return db[_0xe0de('0x29')][_0xe0de('0x44')](_0x35d6be[_0xe0de('0x45')],{})[_0xe0de('0x22')](respondWithResult(_0x33f588,0xc9))[_0xe0de('0x40')](handleError(_0x33f588,null));};exports['update']=function(_0x3f5ce7,_0x529374){if(_0x3f5ce7[_0xe0de('0x45')]['id']){delete _0x3f5ce7['body']['id'];}return db[_0xe0de('0x29')][_0xe0de('0x43')]({'where':{'id':_0x3f5ce7['params']['id']}})[_0xe0de('0x22')](handleEntityNotFound(_0x529374,null))[_0xe0de('0x22')](saveUpdates(_0x3f5ce7['body'],null))[_0xe0de('0x22')](respondWithResult(_0x529374,null))[_0xe0de('0x40')](handleError(_0x529374,null));};exports[_0xe0de('0x23')]=function(_0x4cd2ea,_0x3ce490){return db[_0xe0de('0x29')][_0xe0de('0x43')]({'where':{'id':_0x4cd2ea['params']['id']}})[_0xe0de('0x22')](handleEntityNotFound(_0x3ce490,null))[_0xe0de('0x22')](removeEntity(_0x3ce490,null))[_0xe0de('0x40')](handleError(_0x3ce490,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index bab275a..b6b3533 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 _0x4aa8=['DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0x4aa8,0x16a));var _0x84aa=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x4aa8[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x84aa('0x0'));var util=require(_0x84aa('0x1'));var logger=require(_0x84aa('0x2'))(_0x84aa('0x3'));var moment=require(_0x84aa('0x4'));var BPromise=require(_0x84aa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84aa('0x6'));var rimraf=require(_0x84aa('0x7'));var config=require(_0x84aa('0x8'));var attributes=require(_0x84aa('0x9'));module[_0x84aa('0xa')]=function(_0x10540e,_0x50d309){return _0x10540e[_0x84aa('0xb')](_0x84aa('0xc'),attributes,{'tableName':_0x84aa('0xd'),'paranoid':![],'indexes':[{'name':_0x84aa('0xe'),'fields':[_0x84aa('0xf'),_0x84aa('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6228=['bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6228,0xbb));var _0x8622=function(_0x1dfc98,_0x3264e9){_0x1dfc98=_0x1dfc98-0x0;var _0x57430f=_0x6228[_0x1dfc98];return _0x57430f;};'use strict';var _=require(_0x8622('0x0'));var util=require(_0x8622('0x1'));var logger=require(_0x8622('0x2'))(_0x8622('0x3'));var moment=require(_0x8622('0x4'));var BPromise=require(_0x8622('0x5'));var rp=require(_0x8622('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8622('0x7'));var config=require(_0x8622('0x8'));var attributes=require(_0x8622('0x9'));module[_0x8622('0xa')]=function(_0x341391,_0x518bd4){return _0x341391[_0x8622('0xb')]('DeskField',attributes,{'tableName':_0x8622('0xc'),'paranoid':![],'indexes':[{'name':_0x8622('0xd'),'fields':[_0x8622('0xe'),_0x8622('0xf')],'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 0787e34..4c0caa0 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 _0x1c52=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x1c52,0x159));var _0x21c5=function(_0x426850,_0x3b027f){_0x426850=_0x426850-0x0;var _0x4303cf=_0x1c52[_0x426850];return _0x4303cf;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require(_0x21c5('0x4'));var fs=require('fs');var Redis=require(_0x21c5('0x5'));var db=require(_0x21c5('0x6'))['db'];var utils=require(_0x21c5('0x7'));var logger=require(_0x21c5('0x8'))(_0x21c5('0x9'));var config=require(_0x21c5('0xa'));var jayson=require(_0x21c5('0xb'));var client=jayson['client'][_0x21c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x343687,_0x57e1f4,_0x47ddd1){return new BPromise(function(_0x5a2966,_0x4e611a){return client[_0x21c5('0xd')](_0x343687,_0x47ddd1)[_0x21c5('0xe')](function(_0x3c87c8){logger[_0x21c5('0xf')](_0x21c5('0x10'),_0x57e1f4,'request\x20sent');logger[_0x21c5('0x11')](_0x21c5('0x12'),_0x57e1f4,'request\x20sent',JSON[_0x21c5('0x13')](_0x3c87c8));if(_0x3c87c8[_0x21c5('0x14')]){if(_0x3c87c8[_0x21c5('0x14')][_0x21c5('0x15')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x57e1f4,_0x3c87c8['error']['message']);return _0x4e611a(_0x3c87c8[_0x21c5('0x14')][_0x21c5('0x16')]);}logger[_0x21c5('0x14')](_0x21c5('0x10'),_0x57e1f4,_0x3c87c8[_0x21c5('0x14')][_0x21c5('0x16')]);return _0x5a2966(_0x3c87c8[_0x21c5('0x14')][_0x21c5('0x16')]);}else{logger['info'](_0x21c5('0x10'),_0x57e1f4,_0x21c5('0x17'));_0x5a2966(_0x3c87c8['result'][_0x21c5('0x16')]);}})[_0x21c5('0x18')](function(_0x47a833){logger[_0x21c5('0x14')](_0x21c5('0x10'),_0x57e1f4,_0x47a833);_0x4e611a(_0x47a833);});});} \ No newline at end of file +var _0x0c07=['client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x236837,_0x1abafc){var _0x4427f9=function(_0x1cbfd1){while(--_0x1cbfd1){_0x236837['push'](_0x236837['shift']());}};_0x4427f9(++_0x1abafc);}(_0x0c07,0x1ef));var _0x70c0=function(_0x4a8893,_0x38f6ee){_0x4a8893=_0x4a8893-0x0;var _0x2b6e06=_0x0c07[_0x4a8893];return _0x2b6e06;};'use strict';var _=require('lodash');var util=require(_0x70c0('0x0'));var moment=require(_0x70c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x70c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70c0('0x3'))['db'];var utils=require(_0x70c0('0x4'));var logger=require(_0x70c0('0x5'))(_0x70c0('0x6'));var config=require(_0x70c0('0x7'));var jayson=require(_0x70c0('0x8'));var client=jayson[_0x70c0('0x9')][_0x70c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4de583,_0x316e15,_0x58f43f){return new BPromise(function(_0x38773a,_0x4715a3){return client['request'](_0x4de583,_0x58f43f)[_0x70c0('0xb')](function(_0x25860f){logger[_0x70c0('0xc')](_0x70c0('0xd'),_0x316e15,_0x70c0('0xe'));logger[_0x70c0('0xf')](_0x70c0('0x10'),_0x316e15,_0x70c0('0xe'),JSON['stringify'](_0x25860f));if(_0x25860f[_0x70c0('0x11')]){if(_0x25860f['error'][_0x70c0('0x12')]===0x1f4){logger[_0x70c0('0x11')](_0x70c0('0xd'),_0x316e15,_0x25860f['error'][_0x70c0('0x13')]);return _0x4715a3(_0x25860f[_0x70c0('0x11')]['message']);}logger[_0x70c0('0x11')](_0x70c0('0xd'),_0x316e15,_0x25860f[_0x70c0('0x11')][_0x70c0('0x13')]);return _0x38773a(_0x25860f[_0x70c0('0x11')][_0x70c0('0x13')]);}else{logger[_0x70c0('0xc')](_0x70c0('0xd'),_0x316e15,_0x70c0('0xe'));_0x38773a(_0x25860f[_0x70c0('0x14')][_0x70c0('0x13')]);}})['catch'](function(_0x5bf0b9){logger['error'](_0x70c0('0xd'),_0x316e15,_0x5bf0b9);_0x4715a3(_0x5bf0b9);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ea0ecaf..54023dd 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 _0x68cb=['update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getConfigurations','post','/:id/configurations','addConfiguration','put'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x68cb,0x81));var _0xb68c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x68cb[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xb68c('0x0'));var util=require('util');var path=require(_0xb68c('0x1'));var timeout=require(_0xb68c('0x2'));var express=require(_0xb68c('0x3'));var router=express[_0xb68c('0x4')]();var fs_extra=require(_0xb68c('0x5'));var auth=require(_0xb68c('0x6'));var interaction=require(_0xb68c('0x7'));var config=require(_0xb68c('0x8'));var controller=require('./intDynamics365Account.controller');router[_0xb68c('0x9')]('/',auth[_0xb68c('0xa')](),controller[_0xb68c('0xb')]);router[_0xb68c('0x9')](_0xb68c('0xc'),auth[_0xb68c('0xa')](),controller['show']);router[_0xb68c('0x9')]('/:id/configurations',auth[_0xb68c('0xa')](),controller[_0xb68c('0xd')]);router[_0xb68c('0x9')]('/:id/fields',auth[_0xb68c('0xa')](),controller['getFields']);router[_0xb68c('0xe')]('/',auth[_0xb68c('0xa')](),controller['create']);router[_0xb68c('0xe')](_0xb68c('0xf'),auth[_0xb68c('0xa')](),controller[_0xb68c('0x10')]);router[_0xb68c('0x11')]('/:id',auth[_0xb68c('0xa')](),controller[_0xb68c('0x12')]);router['delete'](_0xb68c('0xc'),auth[_0xb68c('0xa')](),controller[_0xb68c('0x13')]);module[_0xb68c('0x14')]=router; \ No newline at end of file +var _0xe2bd=['update','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put'];(function(_0x29bf1a,_0x2fb582){var _0x4930ed=function(_0x5411a6){while(--_0x5411a6){_0x29bf1a['push'](_0x29bf1a['shift']());}};_0x4930ed(++_0x2fb582);}(_0xe2bd,0xc9));var _0xde2b=function(_0x36efd9,_0x39e082){_0x36efd9=_0x36efd9-0x0;var _0x5beb32=_0xe2bd[_0x36efd9];return _0x5beb32;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xde2b('0x0'));var timeout=require(_0xde2b('0x1'));var express=require(_0xde2b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xde2b('0x3'));var interaction=require(_0xde2b('0x4'));var config=require(_0xde2b('0x5'));var controller=require(_0xde2b('0x6'));router[_0xde2b('0x7')]('/',auth[_0xde2b('0x8')](),controller[_0xde2b('0x9')]);router[_0xde2b('0x7')](_0xde2b('0xa'),auth[_0xde2b('0x8')](),controller[_0xde2b('0xb')]);router[_0xde2b('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xde2b('0xc')]);router[_0xde2b('0x7')](_0xde2b('0xd'),auth[_0xde2b('0x8')](),controller[_0xde2b('0xe')]);router[_0xde2b('0xf')]('/',auth[_0xde2b('0x8')](),controller[_0xde2b('0x10')]);router[_0xde2b('0xf')](_0xde2b('0x11'),auth[_0xde2b('0x8')](),controller['addConfiguration']);router[_0xde2b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xde2b('0x13')]);router[_0xde2b('0x14')](_0xde2b('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xde2b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 65b60cd..0a1ca17 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 _0x2d17=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3258ee,_0x31a74e){var _0x2d0b93=function(_0x1f57aa){while(--_0x1f57aa){_0x3258ee['push'](_0x3258ee['shift']());}};_0x2d0b93(++_0x31a74e);}(_0x2d17,0x17e));var _0x72d1=function(_0x6c337b,_0x5c68af){_0x6c337b=_0x6c337b-0x0;var _0x2cbd80=_0x2d17[_0x6c337b];return _0x2cbd80;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x72d1('0x2')]},'password':{'type':Sequelize[_0x72d1('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x72d1('0x2')]},'clientId':{'type':Sequelize[_0x72d1('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x72d1('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x72d1('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x41f2=['exports','STRING','BOOLEAN','sequelize'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x41f2,0x14f));var _0x241f=function(_0x35cc47,_0xc96530){_0x35cc47=_0x35cc47-0x0;var _0x187ec0=_0x41f2[_0x35cc47];return _0x187ec0;};'use strict';var Sequelize=require(_0x241f('0x0'));module[_0x241f('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x241f('0x2')]},'password':{'type':Sequelize[_0x241f('0x2')]},'remoteUri':{'type':Sequelize[_0x241f('0x2')]},'tenantId':{'type':Sequelize[_0x241f('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x241f('0x2')]},'serverUrl':{'type':Sequelize[_0x241f('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x241f('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 e675efb..ddce087 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 _0x98b7=[')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','Dynamics365Configuration','order','pick','addConfiguration','Subjects','channel','Descriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','socialprofileidname','statuscode','subjectidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','https://login.microsoftonline.com/','/oauth2/token','clientId','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName'];(function(_0x868ffd,_0x122831){var _0x404bf6=function(_0x11d2bc){while(--_0x11d2bc){_0x868ffd['push'](_0x868ffd['shift']());}};_0x404bf6(++_0x122831);}(_0x98b7,0xc1));var _0x798b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x98b7[_0x122ef9];return _0x42fba0;};'use strict';var rp=require(_0x798b('0x0'));var util=require(_0x798b('0x1'));var _=require(_0x798b('0x2'));var qs=require(_0x798b('0x3'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var integrations=require(_0x798b('0x4'));function respondWithResult(_0x71b3e3,_0x3c9c14){_0x3c9c14=_0x3c9c14||0xc8;return function(_0x15b21a){if(_0x15b21a){return _0x71b3e3[_0x798b('0x5')](_0x3c9c14)['json'](_0x15b21a);}};}function respondWithFilteredResult(_0x2bab89,_0x5d70b2){return function(_0x2b904b){if(_0x2b904b){var _0xbf4c6c=typeof _0x5d70b2[_0x798b('0x6')]===_0x798b('0x7')&&typeof _0x5d70b2[_0x798b('0x8')]==='undefined';var _0x24b028=_0x2b904b['count'];var _0x267443=_0xbf4c6c?0x0:_0x5d70b2['offset'];var _0x34ca9b=_0xbf4c6c?_0x2b904b[_0x798b('0x9')]:_0x5d70b2[_0x798b('0x6')]+_0x5d70b2['limit'];var _0x5bafb6;if(_0x34ca9b>=_0x24b028){_0x34ca9b=_0x24b028;_0x5bafb6=0xc8;}else{_0x5bafb6=0xce;}_0x2bab89[_0x798b('0x5')](_0x5bafb6);return _0x2bab89[_0x798b('0xa')](_0x798b('0xb'),_0x267443+'-'+_0x34ca9b+'/'+_0x24b028)['json'](_0x2b904b);}return null;};}function saveUpdates(_0x18057f){return function(_0x53b5f1){if(_0x53b5f1){return _0x53b5f1[_0x798b('0xc')](_0x18057f)['then'](function(_0x30a0e2){return _0x30a0e2;});}return null;};}function removeEntity(_0x2aacd7){return function(_0x33cf2e){if(_0x33cf2e){return _0x33cf2e[_0x798b('0xd')]()[_0x798b('0xe')](function(){_0x2aacd7[_0x798b('0x5')](0xcc)[_0x798b('0xf')]();});}};}function handleEntityNotFound(_0x5936fd){return function(_0x511dd3){if(!_0x511dd3){_0x5936fd[_0x798b('0x10')](0x194);}return _0x511dd3;};}function handleError(_0x1b3179,_0xe5aa69){_0xe5aa69=_0xe5aa69||0x1f4;return function(_0x19b15c){logger[_0x798b('0x11')](_0x19b15c[_0x798b('0x12')]);if(_0x19b15c[_0x798b('0x13')]){delete _0x19b15c[_0x798b('0x13')];}_0x1b3179[_0x798b('0x5')](_0xe5aa69)[_0x798b('0x14')](_0x19b15c);};}exports[_0x798b('0x15')]=function(_0x218290,_0x3d2520){var _0x327312={},_0x4ae887={},_0x52d607={'count':0x0,'rows':[]};var _0x41ae01=_[_0x798b('0x16')](db[_0x798b('0x17')][_0x798b('0x18')],function(_0x10a6c8){return{'name':_0x10a6c8[_0x798b('0x19')],'type':_0x10a6c8[_0x798b('0x1a')][_0x798b('0x1b')]};});_0x4ae887['model']=_[_0x798b('0x16')](_0x41ae01,_0x798b('0x13'));_0x4ae887[_0x798b('0x1c')]=_[_0x798b('0x1d')](_0x218290['query']);_0x4ae887[_0x798b('0x1e')]=_[_0x798b('0x1f')](_0x4ae887[_0x798b('0x20')],_0x4ae887[_0x798b('0x1c')]);_0x327312['attributes']=_[_0x798b('0x1f')](_0x4ae887['model'],qs[_0x798b('0x21')](_0x218290[_0x798b('0x1c')][_0x798b('0x21')]));_0x327312['attributes']=_0x327312[_0x798b('0x22')][_0x798b('0x23')]?_0x327312[_0x798b('0x22')]:_0x4ae887[_0x798b('0x20')];if(!_0x218290[_0x798b('0x1c')][_0x798b('0x24')](_0x798b('0x25'))){_0x327312['limit']=qs[_0x798b('0x8')](_0x218290['query'][_0x798b('0x8')]);_0x327312[_0x798b('0x6')]=qs[_0x798b('0x6')](_0x218290[_0x798b('0x1c')][_0x798b('0x6')]);}_0x327312['order']=qs['sort'](_0x218290[_0x798b('0x1c')][_0x798b('0x26')]);_0x327312[_0x798b('0x27')]=qs[_0x798b('0x1e')](_['pick'](_0x218290[_0x798b('0x1c')],_0x4ae887[_0x798b('0x1e')]),_0x41ae01);if(_0x218290[_0x798b('0x1c')][_0x798b('0x28')]){_0x327312['where']=_[_0x798b('0x29')](_0x327312[_0x798b('0x27')],{'$or':_[_0x798b('0x16')](_0x41ae01,function(_0x2d7878){if(_0x2d7878[_0x798b('0x1a')]!==_0x798b('0x2a')){var _0x1defdc={};_0x1defdc[_0x2d7878[_0x798b('0x13')]]={'$like':'%'+_0x218290[_0x798b('0x1c')]['filter']+'%'};return _0x1defdc;}})});}_0x327312=_[_0x798b('0x29')]({},_0x327312,_0x218290[_0x798b('0x2b')]);var _0x404caa={'where':_0x327312[_0x798b('0x27')]};return db['Dynamics365Account']['count'](_0x404caa)[_0x798b('0xe')](function(_0x16a735){_0x52d607[_0x798b('0x9')]=_0x16a735;if(_0x218290[_0x798b('0x1c')][_0x798b('0x2c')]){_0x327312['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0x798b('0x2d')](_0x327312);})[_0x798b('0xe')](function(_0x19f4b1){_0x52d607[_0x798b('0x2e')]=_0x19f4b1;return _0x52d607;})[_0x798b('0xe')](respondWithFilteredResult(_0x3d2520,_0x327312))[_0x798b('0x2f')](handleError(_0x3d2520,null));};exports[_0x798b('0x30')]=function(_0x234af4,_0x2dc8ac){var _0x59c38d={'raw':![],'where':{'id':_0x234af4[_0x798b('0x31')]['id']}},_0x3d73ca={};_0x3d73ca[_0x798b('0x20')]=_[_0x798b('0x1d')](db[_0x798b('0x17')][_0x798b('0x18')]);_0x3d73ca[_0x798b('0x1c')]=_[_0x798b('0x1d')](_0x234af4[_0x798b('0x1c')]);_0x3d73ca[_0x798b('0x1e')]=_[_0x798b('0x1f')](_0x3d73ca[_0x798b('0x20')],_0x3d73ca[_0x798b('0x1c')]);_0x59c38d[_0x798b('0x22')]=_[_0x798b('0x1f')](_0x3d73ca[_0x798b('0x20')],qs[_0x798b('0x21')](_0x234af4[_0x798b('0x1c')][_0x798b('0x21')]));_0x59c38d[_0x798b('0x22')]=_0x59c38d[_0x798b('0x22')][_0x798b('0x23')]?_0x59c38d[_0x798b('0x22')]:_0x3d73ca['model'];if(_0x234af4[_0x798b('0x1c')][_0x798b('0x2c')]){_0x59c38d['include']=[{'all':!![]}];}_0x59c38d=_[_0x798b('0x29')]({},_0x59c38d,_0x234af4[_0x798b('0x2b')]);return db[_0x798b('0x17')]['find'](_0x59c38d)[_0x798b('0xe')](handleEntityNotFound(_0x2dc8ac,null))[_0x798b('0xe')](respondWithResult(_0x2dc8ac,null))[_0x798b('0x2f')](handleError(_0x2dc8ac,null));};exports[_0x798b('0x32')]=function(_0x5d3d44,_0x5cfe5f){return db['Dynamics365Account'][_0x798b('0x32')](_0x5d3d44[_0x798b('0x33')],{})[_0x798b('0xe')](respondWithResult(_0x5cfe5f,0xc9))[_0x798b('0x2f')](handleError(_0x5cfe5f,null));};exports['update']=function(_0x54d5f0,_0x316a52){if(_0x54d5f0[_0x798b('0x33')]['id']){delete _0x54d5f0[_0x798b('0x33')]['id'];}return db['Dynamics365Account'][_0x798b('0x34')]({'where':{'id':_0x54d5f0['params']['id']}})['then'](handleEntityNotFound(_0x316a52,null))['then'](saveUpdates(_0x54d5f0[_0x798b('0x33')],null))[_0x798b('0xe')](respondWithResult(_0x316a52,null))[_0x798b('0x2f')](handleError(_0x316a52,null));};exports['destroy']=function(_0xc29e18,_0x5080eb){return db['Dynamics365Account']['find']({'where':{'id':_0xc29e18[_0x798b('0x31')]['id']}})[_0x798b('0xe')](handleEntityNotFound(_0x5080eb,null))['then'](removeEntity(_0x5080eb,null))[_0x798b('0x2f')](handleError(_0x5080eb,null));};exports[_0x798b('0x35')]=function(_0x5459cf,_0x26338a){var _0x3f5d05={};var _0x3e6153={};var _0x254727;var _0x572f31;return db[_0x798b('0x17')][_0x798b('0x36')]({'where':{'id':_0x5459cf[_0x798b('0x31')]['id']}})['then'](handleEntityNotFound(_0x26338a,null))[_0x798b('0xe')](function(_0xa970f6){if(_0xa970f6){_0x254727=_0xa970f6;_0x3e6153[_0x798b('0x20')]=_[_0x798b('0x1d')](db[_0x798b('0x37')][_0x798b('0x18')]);_0x3e6153[_0x798b('0x1c')]=_[_0x798b('0x1d')](_0x5459cf[_0x798b('0x1c')]);_0x3e6153[_0x798b('0x1e')]=_[_0x798b('0x1f')](_0x3e6153[_0x798b('0x20')],_0x3e6153[_0x798b('0x1c')]);_0x3f5d05['attributes']=_[_0x798b('0x1f')](_0x3e6153['model'],qs[_0x798b('0x21')](_0x5459cf['query'][_0x798b('0x21')]));_0x3f5d05[_0x798b('0x22')]=_0x3f5d05[_0x798b('0x22')][_0x798b('0x23')]?_0x3f5d05[_0x798b('0x22')]:_0x3e6153[_0x798b('0x20')];_0x3f5d05[_0x798b('0x38')]=qs['sort'](_0x5459cf[_0x798b('0x1c')][_0x798b('0x26')]);_0x3f5d05[_0x798b('0x27')]=qs['filters'](_[_0x798b('0x39')](_0x5459cf['query'],_0x3e6153[_0x798b('0x1e')]));if(_0x5459cf[_0x798b('0x1c')][_0x798b('0x28')]){_0x3f5d05[_0x798b('0x27')]=_[_0x798b('0x29')](_0x3f5d05[_0x798b('0x27')],{'$or':_[_0x798b('0x16')](_0x3f5d05[_0x798b('0x22')],function(_0x1c7747){var _0x2fff90={};_0x2fff90[_0x1c7747]={'$like':'%'+_0x5459cf[_0x798b('0x1c')][_0x798b('0x28')]+'%'};return _0x2fff90;})});}_0x3f5d05=_[_0x798b('0x29')]({},_0x3f5d05,_0x5459cf[_0x798b('0x2b')]);return _0x254727['getConfigurations'](_0x3f5d05);}})[_0x798b('0xe')](function(_0x1cb92d){if(_0x1cb92d){_0x572f31=_0x1cb92d[_0x798b('0x23')];if(!_0x5459cf[_0x798b('0x1c')][_0x798b('0x24')]('nolimit')){_0x3f5d05[_0x798b('0x8')]=qs[_0x798b('0x8')](_0x5459cf['query'][_0x798b('0x8')]);_0x3f5d05['offset']=qs[_0x798b('0x6')](_0x5459cf['query'][_0x798b('0x6')]);}return _0x254727[_0x798b('0x35')](_0x3f5d05);}})[_0x798b('0xe')](function(_0x4234e9){if(_0x4234e9){return _0x4234e9?{'count':_0x572f31,'rows':_0x4234e9}:null;}})[_0x798b('0xe')](respondWithResult(_0x26338a,null))[_0x798b('0x2f')](handleError(_0x26338a,null));};exports[_0x798b('0x3a')]=function(_0x5661da,_0x4e4ed1){if(_0x5661da[_0x798b('0x33')]['id']){delete _0x5661da['body']['id'];}return db[_0x798b('0x17')][_0x798b('0x36')]({'where':{'id':_0x5661da[_0x798b('0x31')]['id']}})[_0x798b('0xe')](handleEntityNotFound(_0x4e4ed1,null))[_0x798b('0xe')](function(_0x509fe9){if(_0x509fe9){_0x5661da[_0x798b('0x33')]['AccountId']=_0x509fe9['id'];_0x5661da[_0x798b('0x33')][_0x798b('0x3b')]=integrations['getSubjects'](_0x5661da['body'][_0x798b('0x3c')],_0x5661da['body'][_0x798b('0x1a')]);_0x5661da[_0x798b('0x33')][_0x798b('0x3d')]=integrations['getDescriptions'](_0x5661da[_0x798b('0x33')]['channel'],_0x5661da[_0x798b('0x33')][_0x798b('0x1a')]);return db[_0x798b('0x37')][_0x798b('0x32')](_0x5661da['body'],{'include':[{'model':db[_0x798b('0x3e')],'as':_0x798b('0x3b')},{'model':db[_0x798b('0x3e')],'as':_0x798b('0x3d')}]});}return null;})['then'](respondWithResult(_0x4e4ed1,null))[_0x798b('0x2f')](handleError(_0x4e4ed1,null));};function sanitizeRemoteUri(_0x2306cf){var _0x3b152b=_0x2306cf[_0x798b('0x3f')](-0x1);if(_0x3b152b==='/')return _0x2306cf[_0x798b('0x40')](0x0,_0x2306cf[_0x798b('0x41')](_0x3b152b));return _0x2306cf;}function getWebApiUrl(_0x58a8c3){return util[_0x798b('0x42')](_0x798b('0x43'),_0x58a8c3);}exports[_0x798b('0x44')]=function(_0x29519b,_0x257d08){var _0x5b4986=_0x29519b[_0x798b('0x1c')][_0x798b('0x45')];var _0x348c66=_0x5b4986===_0x798b('0x46')?_0x798b('0x47'):_0x798b('0x48');var _0x5d3559='';var _0x3d932f='';var _0x13488a='';var _0x2b2865='';var _0x18e3c4='';var _0x519e0a='';var _0x2c4d97='';var _0x224f70='';var _0x4f3d7d=[_0x798b('0x49'),_0x798b('0x4a'),_0x798b('0x4b'),_0x798b('0x4c'),_0x798b('0x4d'),'subject',_0x798b('0x4e'),_0x798b('0x4f'),_0x798b('0x50'),'phonecall_activity_parties'];var _0xa5e5a4=[_0x798b('0x51'),_0x798b('0x52'),_0x798b('0x53'),'billedserviceunits',_0x798b('0x54'),'contactidyominame',_0x798b('0x55'),_0x798b('0x56'),_0x798b('0x57'),_0x798b('0x58'),_0x798b('0x59'),'createdbyyominame',_0x798b('0x5a'),_0x798b('0x5b'),'createdonbehalfbyyominame',_0x798b('0x5c'),_0x798b('0x5d'),_0x798b('0x5e'),_0x798b('0x5f'),'entitlementidname',_0x798b('0x60'),_0x798b('0x61'),_0x798b('0x62'),'exchangerate','firstresponsebykpiidname','followupby',_0x798b('0x63'),'influencescore','kbarticleidname',_0x798b('0x64'),_0x798b('0x65'),_0x798b('0x66'),_0x798b('0x67'),_0x798b('0x68'),'modifiedbyyominame',_0x798b('0x69'),_0x798b('0x6a'),_0x798b('0x6b'),_0x798b('0x6c'),_0x798b('0x6d'),_0x798b('0x6e'),_0x798b('0x6f'),_0x798b('0x70'),_0x798b('0x71'),'owneridtype',_0x798b('0x72'),_0x798b('0x73'),_0x798b('0x74'),_0x798b('0x75'),_0x798b('0x76'),_0x798b('0x77'),_0x798b('0x78'),'resolveby',_0x798b('0x79'),_0x798b('0x7a'),_0x798b('0x7b'),'responsiblecontactidyominame',_0x798b('0x7c'),_0x798b('0x7d'),'slaname',_0x798b('0x7e'),'statecode',_0x798b('0x7f'),_0x798b('0x80'),'ticketnumber','timezoneruleversionnumber','transactioncurrencyidname',_0x798b('0x81'),_0x798b('0x82'),_0x798b('0x83')];var _0x37843a=_0x4f3d7d[_0x798b('0x84')](_0xa5e5a4);return db[_0x798b('0x17')][_0x798b('0x36')]({'where':{'id':_0x29519b[_0x798b('0x31')]['id']},'attributes':['id',_0x798b('0x85'),'password','remoteUri',_0x798b('0x86'),'clientId',_0x798b('0x87'),_0x798b('0x88')],'include':[{'model':db[_0x798b('0x89')],'as':'CloudProvider','attributes':['id',_0x798b('0x8a'),_0x798b('0x8b')]}]})[_0x798b('0xe')](handleEntityNotFound(_0x257d08,null))['then'](function(_0x54d32e){if(_0x54d32e){if(_0x54d32e[_0x798b('0x88')]){_0x54d32e[_0x798b('0x8c')]=_0x54d32e[_0x798b('0x89')][_0x798b('0x8a')];_0x224f70=sanitizeRemoteUri(_0x54d32e[_0x798b('0x89')][_0x798b('0x8b')]);_0x2c4d97=getWebApiUrl(_0x224f70);return _0x54d32e;}_0x224f70=sanitizeRemoteUri(_0x54d32e[_0x798b('0x8d')]);_0x2c4d97=getWebApiUrl(_0x224f70);var _0x376f58={'method':'POST','uri':_0x798b('0x8e')+_0x54d32e[_0x798b('0x86')]+_0x798b('0x8f'),'form':{'client_id':_0x54d32e[_0x798b('0x90')],'resource':_0x224f70,'username':_0x54d32e[_0x798b('0x85')],'password':_0x54d32e['password'],'grant_type':_0x798b('0x91'),'client_secret':_0x54d32e['clientSecret']},'json':!![]};return rp(_0x376f58);}})[_0x798b('0xe')](function(_0x42f0d0){_0x519e0a=_0x42f0d0[_0x798b('0x8c')];var _0x30e304={'method':_0x798b('0x92'),'uri':encodeURI(_0x2c4d97+_0x798b('0x93')+_0x348c66+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x519e0a,'If-None-Match':null,'OData-Version':_0x798b('0x94')},'json':!![]};return rp(_0x30e304);})[_0x798b('0xe')](function(_0x538091){var _0x54eb34=_0x538091['value'][0x0];var _0x3dfa00=_0x54eb34[_0x798b('0x95')];var _0x305442={'method':_0x798b('0x92'),'uri':_0x2c4d97+_0x798b('0x96')+_0x3dfa00+_0x798b('0x97'),'headers':{'Authorization':'Bearer\x20'+_0x519e0a,'If-None-Match':null,'OData-Version':_0x798b('0x94')},'json':!![]};return rp(_0x305442);})['then'](function(_0x3f1c44){_0x5d3559=_0x3f1c44;_0x3d932f=_0x5d3559[_0x798b('0x98')];_0x3d932f=_['remove'](_0x3d932f,function(_0x19da6d){return!_0x37843a[_0x798b('0x99')](_0x19da6d[_0x798b('0x9a')]);});var _0x275f55=[];var _0xc57179=[];_0x3d932f[_0x798b('0x9b')](function(_0xb58b6c){if(_0xb58b6c[_0x798b('0x9c')]){var _0x3359ea=_0xb58b6c[_0x798b('0x9c')][_0x798b('0x40')](_0xb58b6c[_0x798b('0x9c')][_0x798b('0x41')]('.')+0x1);if(_0x3359ea==='PicklistAttributeMetadata'){_0x275f55['push'](getSelectList(_0x2c4d97,_0x5b4986,_0xc57179,_0x5d3559[_0x798b('0x95')],_0xb58b6c[_0x798b('0x95')],_0x519e0a));}}});return Promise['all'](_0x275f55);})[_0x798b('0xe')](function(_0x34f2ed){_0x13488a=_0x34f2ed[0x0];var _0x3948af=[];var _0x3d4507=[];_0x3d932f[_0x798b('0x9b')](function(_0x1f58c9){if(!_[_0x798b('0x9d')](_0x1f58c9['@odata.type'])){var _0x3b8005=_0x1f58c9[_0x798b('0x9c')]['substring'](_0x1f58c9[_0x798b('0x9c')][_0x798b('0x41')]('.')+0x1);if(_0x3b8005===_0x798b('0x9e')){_0x3948af['push'](getBooleanList(_0x2c4d97,_0x5b4986,_0x3d4507,_0x5d3559[_0x798b('0x95')],_0x1f58c9[_0x798b('0x95')],_0x519e0a));}}});return Promise[_0x798b('0x9f')](_0x3948af);})[_0x798b('0xe')](function(_0x56d1a6){_0x2b2865=_0x56d1a6[0x0];var _0x3826e6=[];var _0x522482=[];_0x3d932f['forEach'](function(_0x3b57df){if(_0x3b57df[_0x798b('0x9c')]){var _0x3d3acf=_0x3b57df[_0x798b('0x9c')][_0x798b('0x40')](_0x3b57df[_0x798b('0x9c')][_0x798b('0x41')]('.')+0x1);if(_0x3d3acf===_0x798b('0xa0')||_0x3d3acf===_0x798b('0xa1')||_0x3d3acf==='BigIntAttributeMetadata'||_0x3d3acf===_0x798b('0xa2')||_0x3d3acf===_0x798b('0xa3')||_0x3d3acf===_0x798b('0xa4')||_0x3d3acf==='StatusAttributeMetadata'||_0x3d3acf===_0x798b('0xa5')||_0x3d3acf===_0x798b('0xa6')||_0x3d3acf===_0x798b('0xa7')){_0x3826e6[_0x798b('0xa8')](getInputList(_0x2c4d97,_0x5b4986,_0x3d3acf,_0x522482,_0x5d3559[_0x798b('0x95')],_0x3b57df[_0x798b('0x95')],_0x519e0a));}}});return Promise[_0x798b('0x9f')](_0x3826e6);})[_0x798b('0xe')](function(_0x102490){_0x18e3c4=_0x102490[0x0];var _0x4fd5e9=_0x13488a['concat'](_0x2b2865)['concat'](_0x18e3c4);var _0x25d7f8={'count':_0x4fd5e9[_0x798b('0x23')],'rows':_0x4fd5e9};return _0x25d7f8;})[_0x798b('0xe')](respondWithResult(_0x257d08,null))[_0x798b('0x2f')](function(_0x40f44d){var _0x55fb99=_0x29519b[_0x798b('0x1c')][_0x798b('0xa9')]?0x1f4:_0x40f44d[_0x798b('0xaa')]||0x1f4;logger[_0x798b('0x11')](_0x40f44d['stack']);delete _0x40f44d[_0x798b('0x13')];if(_0x55fb99===0x191){_0x55fb99=0x190;}_0x257d08[_0x798b('0x5')](_0x55fb99)['send'](_0x29519b[_0x798b('0x1c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x40f44d[_0x798b('0xaa')]}:_0x40f44d);});};function getSelectList(_0x1ec3a4,_0x9d880a,_0x39e689,_0x53b0a1,_0x5e96e4,_0x23e8c0){var _0x566e55={'method':_0x798b('0x92'),'uri':_0x1ec3a4+_0x798b('0x96')+_0x53b0a1+_0x798b('0xab')+_0x5e96e4+_0x798b('0xac')+_0x798b('0xad'),'headers':{'Authorization':_0x798b('0xae')+_0x23e8c0,'If-None-Match':null,'OData-Version':_0x798b('0x94')},'json':!![]};return rp(_0x566e55)[_0x798b('0xe')](function(_0x22013c){var _0x37c068=[];var _0x5cd286=_0x22013c[_0x798b('0xaf')][_0x798b('0xb0')];_0x5cd286[_0x798b('0x9b')](function(_0x4de628){_0x37c068[_0x798b('0xa8')]({'name':_0x4de628[_0x798b('0xb1')][_0x798b('0xb2')][_0x798b('0xb1')],'value':String(_0x4de628[_0x798b('0xb3')])});});var _0x266e03={'id':_0x9d880a+'_'+_0x22013c[_0x798b('0x9a')],'name':_0x22013c[_0x798b('0xb4')][_0x798b('0xb2')][_0x798b('0xb1')],'custom':![],'options':_0x37c068};_0x39e689[_0x798b('0xa8')](_0x266e03);return _0x39e689;});}function getBooleanList(_0x3d85aa,_0x11f504,_0x3b50c8,_0x5865f6,_0x135051,_0x26c312){var _0x312463={'method':_0x798b('0x92'),'uri':_0x3d85aa+_0x798b('0x96')+_0x5865f6+_0x798b('0xab')+_0x135051+_0x798b('0xb5'),'headers':{'Authorization':'Bearer\x20'+_0x26c312,'If-None-Match':null,'OData-Version':_0x798b('0x94')},'json':!![]};return rp(_0x312463)[_0x798b('0xe')](function(_0x249287){var _0x482927=[];_0x482927[_0x798b('0xa8')]({'name':_0x249287[_0x798b('0xaf')][_0x798b('0xb6')][_0x798b('0xb1')][_0x798b('0xb2')]['Label'],'value':_0x798b('0xb7')},{'name':_0x249287['OptionSet'][_0x798b('0xb8')]['Label'][_0x798b('0xb2')]['Label'],'value':_0x798b('0xb9')});var _0x213a0f={'id':_0x11f504+'_'+_0x249287[_0x798b('0x9a')],'name':_0x249287[_0x798b('0xb4')][_0x798b('0xb2')][_0x798b('0xb1')],'custom':![],'options':_0x482927};_0x3b50c8[_0x798b('0xa8')](_0x213a0f);return _0x3b50c8;});}function getInputList(_0x4e5f9b,_0xf2e608,_0x3b6578,_0x3cfb85,_0x5a3b93,_0x10e866,_0x51b003){var _0x375ca0={'method':_0x798b('0x92'),'uri':_0x4e5f9b+'EntityDefinitions('+_0x5a3b93+_0x798b('0xab')+_0x10e866+')/Microsoft.Dynamics.CRM.'+_0x3b6578+_0x798b('0xba'),'headers':{'Authorization':_0x798b('0xae')+_0x51b003,'If-None-Match':null,'OData-Version':_0x798b('0x94')},'json':!![]};return rp(_0x375ca0)[_0x798b('0xe')](function(_0x483a31){var _0x49a8dc={'id':_0xf2e608+'_'+_0x483a31['LogicalName'],'name':_0x483a31[_0x798b('0xb4')]['UserLocalizedLabel']?_0x483a31[_0x798b('0xb4')][_0x798b('0xb2')][_0x798b('0xb1')]:_0x483a31[_0x798b('0x9a')],'custom':![],'options':[]};_0x3cfb85[_0x798b('0xa8')](_0x49a8dc);return _0x3cfb85;});} \ No newline at end of file +var _0x5ad1=['regardingobjectid','directioncode','accountidname','accountidyominame','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','data7','access_token','CloudProvider','POST','https://login.microsoftonline.com/','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','EntityDefinitions(','Attributes','remove','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','MetadataId','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','request-promise','util','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','set','Content-Range','then','end','sendStatus','error','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','options','includeAll','findAll','catch','params','include','create','body','update','find','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','substring','format','%s/api/data/v9.0/','getFields','ticketType','Incident','customerid','caseorigincode','subject','phonenumber'];(function(_0x37fa07,_0x2cee43){var _0x33f488=function(_0x5c960d){while(--_0x5c960d){_0x37fa07['push'](_0x37fa07['shift']());}};_0x33f488(++_0x2cee43);}(_0x5ad1,0x12c));var _0x15ad=function(_0x20e5f4,_0x40f7a3){_0x20e5f4=_0x20e5f4-0x0;var _0x5da138=_0x5ad1[_0x20e5f4];return _0x5da138;};'use strict';var rp=require(_0x15ad('0x0'));var util=require(_0x15ad('0x1'));var _=require('lodash');var qs=require(_0x15ad('0x2'));var logger=require('../../config/logger')(_0x15ad('0x3'));var db=require(_0x15ad('0x4'))['db'];var integrations=require(_0x15ad('0x5'));function respondWithResult(_0x5e26ad,_0x5d04e3){_0x5d04e3=_0x5d04e3||0xc8;return function(_0x2ecf57){if(_0x2ecf57){return _0x5e26ad[_0x15ad('0x6')](_0x5d04e3)[_0x15ad('0x7')](_0x2ecf57);}};}function respondWithFilteredResult(_0x2b3b0b,_0x227d2a){return function(_0x4628f8){if(_0x4628f8){var _0x2d385c=typeof _0x227d2a['offset']===_0x15ad('0x8')&&typeof _0x227d2a[_0x15ad('0x9')]===_0x15ad('0x8');var _0x557b18=_0x4628f8[_0x15ad('0xa')];var _0x56e533=_0x2d385c?0x0:_0x227d2a['offset'];var _0x80478=_0x2d385c?_0x4628f8[_0x15ad('0xa')]:_0x227d2a['offset']+_0x227d2a['limit'];var _0x4252e1;if(_0x80478>=_0x557b18){_0x80478=_0x557b18;_0x4252e1=0xc8;}else{_0x4252e1=0xce;}_0x2b3b0b[_0x15ad('0x6')](_0x4252e1);return _0x2b3b0b[_0x15ad('0xb')](_0x15ad('0xc'),_0x56e533+'-'+_0x80478+'/'+_0x557b18)['json'](_0x4628f8);}return null;};}function saveUpdates(_0x2d452b){return function(_0x4b45c2){if(_0x4b45c2){return _0x4b45c2['update'](_0x2d452b)[_0x15ad('0xd')](function(_0x2405e0){return _0x2405e0;});}return null;};}function removeEntity(_0x137bc0){return function(_0x22ee6d){if(_0x22ee6d){return _0x22ee6d['destroy']()[_0x15ad('0xd')](function(){_0x137bc0['status'](0xcc)[_0x15ad('0xe')]();});}};}function handleEntityNotFound(_0x5c8f82){return function(_0x5de92e){if(!_0x5de92e){_0x5c8f82[_0x15ad('0xf')](0x194);}return _0x5de92e;};}function handleError(_0x31d345,_0x3a8e89){_0x3a8e89=_0x3a8e89||0x1f4;return function(_0x316946){logger[_0x15ad('0x10')](_0x316946['stack']);if(_0x316946[_0x15ad('0x11')]){delete _0x316946[_0x15ad('0x11')];}_0x31d345[_0x15ad('0x6')](_0x3a8e89)['send'](_0x316946);};}exports[_0x15ad('0x12')]=function(_0x427705,_0x133c6d){var _0xa745aa={},_0x255906={},_0x555a38={'count':0x0,'rows':[]};var _0x4f4cd0=_[_0x15ad('0x13')](db[_0x15ad('0x14')][_0x15ad('0x15')],function(_0x28c558){return{'name':_0x28c558[_0x15ad('0x16')],'type':_0x28c558[_0x15ad('0x17')]['key']};});_0x255906['model']=_[_0x15ad('0x13')](_0x4f4cd0,_0x15ad('0x11'));_0x255906[_0x15ad('0x18')]=_[_0x15ad('0x19')](_0x427705[_0x15ad('0x18')]);_0x255906[_0x15ad('0x1a')]=_[_0x15ad('0x1b')](_0x255906[_0x15ad('0x1c')],_0x255906[_0x15ad('0x18')]);_0xa745aa[_0x15ad('0x1d')]=_[_0x15ad('0x1b')](_0x255906[_0x15ad('0x1c')],qs[_0x15ad('0x1e')](_0x427705[_0x15ad('0x18')][_0x15ad('0x1e')]));_0xa745aa[_0x15ad('0x1d')]=_0xa745aa['attributes'][_0x15ad('0x1f')]?_0xa745aa[_0x15ad('0x1d')]:_0x255906[_0x15ad('0x1c')];if(!_0x427705['query'][_0x15ad('0x20')](_0x15ad('0x21'))){_0xa745aa[_0x15ad('0x9')]=qs[_0x15ad('0x9')](_0x427705[_0x15ad('0x18')]['limit']);_0xa745aa[_0x15ad('0x22')]=qs[_0x15ad('0x22')](_0x427705['query'][_0x15ad('0x22')]);}_0xa745aa[_0x15ad('0x23')]=qs['sort'](_0x427705['query'][_0x15ad('0x24')]);_0xa745aa[_0x15ad('0x25')]=qs[_0x15ad('0x1a')](_['pick'](_0x427705['query'],_0x255906[_0x15ad('0x1a')]),_0x4f4cd0);if(_0x427705['query'][_0x15ad('0x26')]){_0xa745aa[_0x15ad('0x25')]=_[_0x15ad('0x27')](_0xa745aa[_0x15ad('0x25')],{'$or':_[_0x15ad('0x13')](_0x4f4cd0,function(_0x565327){if(_0x565327[_0x15ad('0x17')]!=='VIRTUAL'){var _0x403042={};_0x403042[_0x565327[_0x15ad('0x11')]]={'$like':'%'+_0x427705[_0x15ad('0x18')][_0x15ad('0x26')]+'%'};return _0x403042;}})});}_0xa745aa=_[_0x15ad('0x27')]({},_0xa745aa,_0x427705[_0x15ad('0x28')]);var _0x39a2f7={'where':_0xa745aa['where']};return db[_0x15ad('0x14')][_0x15ad('0xa')](_0x39a2f7)[_0x15ad('0xd')](function(_0xcd205a){_0x555a38[_0x15ad('0xa')]=_0xcd205a;if(_0x427705[_0x15ad('0x18')][_0x15ad('0x29')]){_0xa745aa['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0x15ad('0x2a')](_0xa745aa);})[_0x15ad('0xd')](function(_0x355b91){_0x555a38['rows']=_0x355b91;return _0x555a38;})[_0x15ad('0xd')](respondWithFilteredResult(_0x133c6d,_0xa745aa))[_0x15ad('0x2b')](handleError(_0x133c6d,null));};exports['show']=function(_0x16f52e,_0x57ff8a){var _0x49a47d={'raw':![],'where':{'id':_0x16f52e[_0x15ad('0x2c')]['id']}},_0x2fe850={};_0x2fe850['model']=_[_0x15ad('0x19')](db['Dynamics365Account'][_0x15ad('0x15')]);_0x2fe850[_0x15ad('0x18')]=_['keys'](_0x16f52e[_0x15ad('0x18')]);_0x2fe850[_0x15ad('0x1a')]=_[_0x15ad('0x1b')](_0x2fe850[_0x15ad('0x1c')],_0x2fe850[_0x15ad('0x18')]);_0x49a47d[_0x15ad('0x1d')]=_[_0x15ad('0x1b')](_0x2fe850[_0x15ad('0x1c')],qs[_0x15ad('0x1e')](_0x16f52e[_0x15ad('0x18')][_0x15ad('0x1e')]));_0x49a47d[_0x15ad('0x1d')]=_0x49a47d[_0x15ad('0x1d')][_0x15ad('0x1f')]?_0x49a47d[_0x15ad('0x1d')]:_0x2fe850[_0x15ad('0x1c')];if(_0x16f52e[_0x15ad('0x18')][_0x15ad('0x29')]){_0x49a47d[_0x15ad('0x2d')]=[{'all':!![]}];}_0x49a47d=_[_0x15ad('0x27')]({},_0x49a47d,_0x16f52e[_0x15ad('0x28')]);return db['Dynamics365Account']['find'](_0x49a47d)[_0x15ad('0xd')](handleEntityNotFound(_0x57ff8a,null))['then'](respondWithResult(_0x57ff8a,null))[_0x15ad('0x2b')](handleError(_0x57ff8a,null));};exports['create']=function(_0x16f7a1,_0x8d9bc1){return db[_0x15ad('0x14')][_0x15ad('0x2e')](_0x16f7a1[_0x15ad('0x2f')],{})[_0x15ad('0xd')](respondWithResult(_0x8d9bc1,0xc9))[_0x15ad('0x2b')](handleError(_0x8d9bc1,null));};exports[_0x15ad('0x30')]=function(_0x39f304,_0x4b891b){if(_0x39f304[_0x15ad('0x2f')]['id']){delete _0x39f304['body']['id'];}return db[_0x15ad('0x14')][_0x15ad('0x31')]({'where':{'id':_0x39f304[_0x15ad('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4b891b,null))[_0x15ad('0xd')](saveUpdates(_0x39f304['body'],null))[_0x15ad('0xd')](respondWithResult(_0x4b891b,null))[_0x15ad('0x2b')](handleError(_0x4b891b,null));};exports['destroy']=function(_0x1862b7,_0x3286ee){return db[_0x15ad('0x14')][_0x15ad('0x31')]({'where':{'id':_0x1862b7[_0x15ad('0x2c')]['id']}})[_0x15ad('0xd')](handleEntityNotFound(_0x3286ee,null))['then'](removeEntity(_0x3286ee,null))['catch'](handleError(_0x3286ee,null));};exports[_0x15ad('0x32')]=function(_0x418df9,_0x1044a6){var _0x2fa961={};var _0x3e7113={};var _0x349978;var _0x1a9646;return db[_0x15ad('0x14')][_0x15ad('0x33')]({'where':{'id':_0x418df9[_0x15ad('0x2c')]['id']}})[_0x15ad('0xd')](handleEntityNotFound(_0x1044a6,null))[_0x15ad('0xd')](function(_0x47faed){if(_0x47faed){_0x349978=_0x47faed;_0x3e7113[_0x15ad('0x1c')]=_[_0x15ad('0x19')](db[_0x15ad('0x34')]['rawAttributes']);_0x3e7113[_0x15ad('0x18')]=_[_0x15ad('0x19')](_0x418df9[_0x15ad('0x18')]);_0x3e7113['filters']=_[_0x15ad('0x1b')](_0x3e7113[_0x15ad('0x1c')],_0x3e7113[_0x15ad('0x18')]);_0x2fa961[_0x15ad('0x1d')]=_['intersection'](_0x3e7113[_0x15ad('0x1c')],qs[_0x15ad('0x1e')](_0x418df9[_0x15ad('0x18')][_0x15ad('0x1e')]));_0x2fa961[_0x15ad('0x1d')]=_0x2fa961['attributes'][_0x15ad('0x1f')]?_0x2fa961[_0x15ad('0x1d')]:_0x3e7113[_0x15ad('0x1c')];_0x2fa961[_0x15ad('0x23')]=qs['sort'](_0x418df9[_0x15ad('0x18')][_0x15ad('0x24')]);_0x2fa961[_0x15ad('0x25')]=qs[_0x15ad('0x1a')](_[_0x15ad('0x35')](_0x418df9[_0x15ad('0x18')],_0x3e7113[_0x15ad('0x1a')]));if(_0x418df9[_0x15ad('0x18')][_0x15ad('0x26')]){_0x2fa961[_0x15ad('0x25')]=_['merge'](_0x2fa961[_0x15ad('0x25')],{'$or':_[_0x15ad('0x13')](_0x2fa961['attributes'],function(_0x55d7ae){var _0x44c185={};_0x44c185[_0x55d7ae]={'$like':'%'+_0x418df9['query'][_0x15ad('0x26')]+'%'};return _0x44c185;})});}_0x2fa961=_[_0x15ad('0x27')]({},_0x2fa961,_0x418df9[_0x15ad('0x28')]);return _0x349978['getConfigurations'](_0x2fa961);}})[_0x15ad('0xd')](function(_0x24d3ff){if(_0x24d3ff){_0x1a9646=_0x24d3ff[_0x15ad('0x1f')];if(!_0x418df9['query'][_0x15ad('0x20')](_0x15ad('0x21'))){_0x2fa961[_0x15ad('0x9')]=qs[_0x15ad('0x9')](_0x418df9[_0x15ad('0x18')][_0x15ad('0x9')]);_0x2fa961[_0x15ad('0x22')]=qs[_0x15ad('0x22')](_0x418df9[_0x15ad('0x18')][_0x15ad('0x22')]);}return _0x349978[_0x15ad('0x32')](_0x2fa961);}})[_0x15ad('0xd')](function(_0x4582b3){if(_0x4582b3){return _0x4582b3?{'count':_0x1a9646,'rows':_0x4582b3}:null;}})[_0x15ad('0xd')](respondWithResult(_0x1044a6,null))['catch'](handleError(_0x1044a6,null));};exports[_0x15ad('0x36')]=function(_0x5c7c6,_0xfeadf7){if(_0x5c7c6[_0x15ad('0x2f')]['id']){delete _0x5c7c6[_0x15ad('0x2f')]['id'];}return db[_0x15ad('0x14')][_0x15ad('0x33')]({'where':{'id':_0x5c7c6[_0x15ad('0x2c')]['id']}})['then'](handleEntityNotFound(_0xfeadf7,null))[_0x15ad('0xd')](function(_0x4dc3bf){if(_0x4dc3bf){_0x5c7c6['body'][_0x15ad('0x37')]=_0x4dc3bf['id'];_0x5c7c6['body'][_0x15ad('0x38')]=integrations[_0x15ad('0x39')](_0x5c7c6['body'][_0x15ad('0x3a')],_0x5c7c6[_0x15ad('0x2f')][_0x15ad('0x17')]);_0x5c7c6[_0x15ad('0x2f')]['Descriptions']=integrations[_0x15ad('0x3b')](_0x5c7c6[_0x15ad('0x2f')][_0x15ad('0x3a')],_0x5c7c6[_0x15ad('0x2f')]['type']);return db[_0x15ad('0x34')][_0x15ad('0x2e')](_0x5c7c6[_0x15ad('0x2f')],{'include':[{'model':db[_0x15ad('0x3c')],'as':_0x15ad('0x38')},{'model':db[_0x15ad('0x3c')],'as':_0x15ad('0x3d')}]});}return null;})['then'](respondWithResult(_0xfeadf7,null))[_0x15ad('0x2b')](handleError(_0xfeadf7,null));};function sanitizeRemoteUri(_0x9ca593){var _0x21db59=_0x9ca593['slice'](-0x1);if(_0x21db59==='/')return _0x9ca593[_0x15ad('0x3e')](0x0,_0x9ca593['lastIndexOf'](_0x21db59));return _0x9ca593;}function getWebApiUrl(_0x19c37d){return util[_0x15ad('0x3f')](_0x15ad('0x40'),_0x19c37d);}exports[_0x15ad('0x41')]=function(_0x3b0604,_0x23f16e){var _0x5d649e=_0x3b0604[_0x15ad('0x18')][_0x15ad('0x42')];var _0x5d5e6f=_0x5d649e==='incident'?_0x15ad('0x43'):'PhoneCall';var _0x2b7b26='';var _0x52d1d4='';var _0x8e8044='';var _0x1444b2='';var _0xf1f34d='';var _0x59004b='';var _0x634813='';var _0x572d9f='';var _0x3b1fe0=['title','description',_0x15ad('0x44'),'ownerid',_0x15ad('0x45'),_0x15ad('0x46'),_0x15ad('0x47'),_0x15ad('0x48'),_0x15ad('0x49'),'phonecall_activity_parties'];var _0x416346=[_0x15ad('0x4a'),_0x15ad('0x4b'),'actualserviceunits',_0x15ad('0x4c'),_0x15ad('0x4d'),'contactidyominame',_0x15ad('0x4e'),_0x15ad('0x4f'),_0x15ad('0x50'),_0x15ad('0x51'),_0x15ad('0x52'),_0x15ad('0x53'),_0x15ad('0x54'),_0x15ad('0x55'),'createdonbehalfbyyominame','customeridname',_0x15ad('0x56'),_0x15ad('0x57'),_0x15ad('0x58'),_0x15ad('0x59'),_0x15ad('0x5a'),_0x15ad('0x5b'),_0x15ad('0x5c'),'exchangerate',_0x15ad('0x5d'),_0x15ad('0x5e'),_0x15ad('0x5f'),_0x15ad('0x60'),_0x15ad('0x61'),_0x15ad('0x62'),_0x15ad('0x63'),_0x15ad('0x64'),_0x15ad('0x65'),'modifiedbyname',_0x15ad('0x66'),'modifiedon','modifiedonbehalfbyname',_0x15ad('0x67'),_0x15ad('0x68'),_0x15ad('0x69'),'numberofchildincidents',_0x15ad('0x6a'),_0x15ad('0x6b'),_0x15ad('0x6c'),_0x15ad('0x6d'),_0x15ad('0x6e'),_0x15ad('0x6f'),_0x15ad('0x70'),_0x15ad('0x71'),'prioritycodename',_0x15ad('0x72'),_0x15ad('0x73'),'resolveby',_0x15ad('0x74'),_0x15ad('0x75'),_0x15ad('0x76'),_0x15ad('0x77'),_0x15ad('0x78'),'slainvokedidname','slaname',_0x15ad('0x79'),'statecode',_0x15ad('0x7a'),_0x15ad('0x7b'),_0x15ad('0x7c'),'timezoneruleversionnumber',_0x15ad('0x7d'),_0x15ad('0x7e'),_0x15ad('0x7f'),_0x15ad('0x80')];var _0xe130b8=_0x3b1fe0['concat'](_0x416346);return db[_0x15ad('0x14')][_0x15ad('0x33')]({'where':{'id':_0x3b0604[_0x15ad('0x2c')]['id']},'attributes':['id',_0x15ad('0x81'),_0x15ad('0x82'),_0x15ad('0x83'),_0x15ad('0x84'),_0x15ad('0x85'),_0x15ad('0x86'),_0x15ad('0x87')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id','data5',_0x15ad('0x88')]}]})[_0x15ad('0xd')](handleEntityNotFound(_0x23f16e,null))[_0x15ad('0xd')](function(_0x52bcee){if(_0x52bcee){if(_0x52bcee['modernAuthentication']){_0x52bcee[_0x15ad('0x89')]=_0x52bcee[_0x15ad('0x8a')]['data5'];_0x572d9f=sanitizeRemoteUri(_0x52bcee[_0x15ad('0x8a')][_0x15ad('0x88')]);_0x634813=getWebApiUrl(_0x572d9f);return _0x52bcee;}_0x572d9f=sanitizeRemoteUri(_0x52bcee[_0x15ad('0x83')]);_0x634813=getWebApiUrl(_0x572d9f);var _0x153c7e={'method':_0x15ad('0x8b'),'uri':_0x15ad('0x8c')+_0x52bcee[_0x15ad('0x84')]+'/oauth2/token','form':{'client_id':_0x52bcee[_0x15ad('0x85')],'resource':_0x572d9f,'username':_0x52bcee[_0x15ad('0x81')],'password':_0x52bcee[_0x15ad('0x82')],'grant_type':_0x15ad('0x82'),'client_secret':_0x52bcee[_0x15ad('0x86')]},'json':!![]};return rp(_0x153c7e);}})[_0x15ad('0xd')](function(_0x8343f3){_0x59004b=_0x8343f3[_0x15ad('0x89')];var _0x198fdf={'method':_0x15ad('0x8d'),'uri':encodeURI(_0x634813+_0x15ad('0x8e')+_0x5d5e6f+'\x27'),'headers':{'Authorization':_0x15ad('0x8f')+_0x59004b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x198fdf);})['then'](function(_0x40e370){var _0x2be0a6=_0x40e370['value'][0x0];var _0x5ea99c=_0x2be0a6['MetadataId'];var _0x7a5542={'method':'GET','uri':_0x634813+_0x15ad('0x90')+_0x5ea99c+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x15ad('0x8f')+_0x59004b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x7a5542);})[_0x15ad('0xd')](function(_0x4bfe13){_0x2b7b26=_0x4bfe13;_0x52d1d4=_0x2b7b26[_0x15ad('0x91')];_0x52d1d4=_[_0x15ad('0x92')](_0x52d1d4,function(_0x2a9a19){return!_0xe130b8['includes'](_0x2a9a19[_0x15ad('0x93')]);});var _0x3c9b4a=[];var _0x41258b=[];_0x52d1d4[_0x15ad('0x94')](function(_0x5a2cd4){if(_0x5a2cd4[_0x15ad('0x95')]){var _0x2abe21=_0x5a2cd4['@odata.type'][_0x15ad('0x3e')](_0x5a2cd4[_0x15ad('0x95')][_0x15ad('0x96')]('.')+0x1);if(_0x2abe21===_0x15ad('0x97')){_0x3c9b4a[_0x15ad('0x98')](getSelectList(_0x634813,_0x5d649e,_0x41258b,_0x2b7b26[_0x15ad('0x99')],_0x5a2cd4[_0x15ad('0x99')],_0x59004b));}}});return Promise[_0x15ad('0x9a')](_0x3c9b4a);})[_0x15ad('0xd')](function(_0x5b510b){_0x8e8044=_0x5b510b[0x0];var _0x1cc81f=[];var _0x2d4dd9=[];_0x52d1d4[_0x15ad('0x94')](function(_0x1c5010){if(!_['isNil'](_0x1c5010[_0x15ad('0x95')])){var _0x3baaaa=_0x1c5010[_0x15ad('0x95')][_0x15ad('0x3e')](_0x1c5010[_0x15ad('0x95')][_0x15ad('0x96')]('.')+0x1);if(_0x3baaaa===_0x15ad('0x9b')){_0x1cc81f[_0x15ad('0x98')](getBooleanList(_0x634813,_0x5d649e,_0x2d4dd9,_0x2b7b26['MetadataId'],_0x1c5010['MetadataId'],_0x59004b));}}});return Promise[_0x15ad('0x9a')](_0x1cc81f);})['then'](function(_0x561f75){_0x1444b2=_0x561f75[0x0];var _0x1a6b21=[];var _0x3dc121=[];_0x52d1d4[_0x15ad('0x94')](function(_0x317865){if(_0x317865[_0x15ad('0x95')]){var _0x5cbd66=_0x317865[_0x15ad('0x95')]['substring'](_0x317865[_0x15ad('0x95')][_0x15ad('0x96')]('.')+0x1);if(_0x5cbd66===_0x15ad('0x9c')||_0x5cbd66===_0x15ad('0x9d')||_0x5cbd66===_0x15ad('0x9e')||_0x5cbd66===_0x15ad('0x9f')||_0x5cbd66===_0x15ad('0xa0')||_0x5cbd66===_0x15ad('0xa1')||_0x5cbd66===_0x15ad('0xa2')||_0x5cbd66==='EntityNameAttributeMetadata'||_0x5cbd66===_0x15ad('0xa3')||_0x5cbd66===_0x15ad('0xa4')){_0x1a6b21[_0x15ad('0x98')](getInputList(_0x634813,_0x5d649e,_0x5cbd66,_0x3dc121,_0x2b7b26['MetadataId'],_0x317865['MetadataId'],_0x59004b));}}});return Promise[_0x15ad('0x9a')](_0x1a6b21);})[_0x15ad('0xd')](function(_0x25b2ce){_0xf1f34d=_0x25b2ce[0x0];var _0x16c161=_0x8e8044[_0x15ad('0xa5')](_0x1444b2)[_0x15ad('0xa5')](_0xf1f34d);var _0x2066f8={'count':_0x16c161[_0x15ad('0x1f')],'rows':_0x16c161};return _0x2066f8;})[_0x15ad('0xd')](respondWithResult(_0x23f16e,null))['catch'](function(_0x51814d){var _0x2c4d39=_0x3b0604[_0x15ad('0x18')][_0x15ad('0xa6')]?0x1f4:_0x51814d[_0x15ad('0xa7')]||0x1f4;logger[_0x15ad('0x10')](_0x51814d[_0x15ad('0xa8')]);delete _0x51814d[_0x15ad('0x11')];if(_0x2c4d39===0x191){_0x2c4d39=0x190;}_0x23f16e[_0x15ad('0x6')](_0x2c4d39)[_0x15ad('0xa9')](_0x3b0604[_0x15ad('0x18')][_0x15ad('0xa6')]?{'message':_0x15ad('0xaa'),'statusCode':_0x51814d[_0x15ad('0xa7')]}:_0x51814d);});};function getSelectList(_0x3f8f81,_0x47d006,_0x2d407b,_0x228b42,_0x249dee,_0x5374ea){var _0x4619ea={'method':_0x15ad('0x8d'),'uri':_0x3f8f81+_0x15ad('0x90')+_0x228b42+_0x15ad('0xab')+_0x249dee+_0x15ad('0xac')+_0x15ad('0xad'),'headers':{'Authorization':_0x15ad('0x8f')+_0x5374ea,'If-None-Match':null,'OData-Version':_0x15ad('0xae')},'json':!![]};return rp(_0x4619ea)['then'](function(_0x339227){var _0x304051=[];var _0x2bdf89=_0x339227[_0x15ad('0xaf')][_0x15ad('0xb0')];_0x2bdf89['forEach'](function(_0x5a47d3){_0x304051['push']({'name':_0x5a47d3['Label'][_0x15ad('0xb1')][_0x15ad('0xb2')],'value':String(_0x5a47d3[_0x15ad('0xb3')])});});var _0x3e4fd9={'id':_0x47d006+'_'+_0x339227[_0x15ad('0x93')],'name':_0x339227[_0x15ad('0xb4')][_0x15ad('0xb1')][_0x15ad('0xb2')],'custom':![],'options':_0x304051};_0x2d407b[_0x15ad('0x98')](_0x3e4fd9);return _0x2d407b;});}function getBooleanList(_0x414d22,_0x5eb2c7,_0x4ec781,_0x301e2d,_0x3c90de,_0x239f74){var _0x58b4c2={'method':_0x15ad('0x8d'),'uri':_0x414d22+'EntityDefinitions('+_0x301e2d+_0x15ad('0xab')+_0x3c90de+_0x15ad('0xb5'),'headers':{'Authorization':_0x15ad('0x8f')+_0x239f74,'If-None-Match':null,'OData-Version':_0x15ad('0xae')},'json':!![]};return rp(_0x58b4c2)[_0x15ad('0xd')](function(_0x3ca482){var _0x3ddd1e=[];_0x3ddd1e[_0x15ad('0x98')]({'name':_0x3ca482['OptionSet'][_0x15ad('0xb6')]['Label'][_0x15ad('0xb1')][_0x15ad('0xb2')],'value':_0x15ad('0xb7')},{'name':_0x3ca482['OptionSet'][_0x15ad('0xb8')]['Label']['UserLocalizedLabel']['Label'],'value':_0x15ad('0xb9')});var _0x307fed={'id':_0x5eb2c7+'_'+_0x3ca482[_0x15ad('0x93')],'name':_0x3ca482[_0x15ad('0xb4')][_0x15ad('0xb1')][_0x15ad('0xb2')],'custom':![],'options':_0x3ddd1e};_0x4ec781[_0x15ad('0x98')](_0x307fed);return _0x4ec781;});}function getInputList(_0xe94497,_0x3a7eab,_0x1786e6,_0x3b71fa,_0x619e43,_0x418e82,_0x40b4c8){var _0xd9ea40={'method':_0x15ad('0x8d'),'uri':_0xe94497+'EntityDefinitions('+_0x619e43+_0x15ad('0xab')+_0x418e82+')/Microsoft.Dynamics.CRM.'+_0x1786e6+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x15ad('0x8f')+_0x40b4c8,'If-None-Match':null,'OData-Version':_0x15ad('0xae')},'json':!![]};return rp(_0xd9ea40)[_0x15ad('0xd')](function(_0x1f5175){var _0x2208c0={'id':_0x3a7eab+'_'+_0x1f5175[_0x15ad('0x93')],'name':_0x1f5175[_0x15ad('0xb4')][_0x15ad('0xb1')]?_0x1f5175['DisplayName'][_0x15ad('0xb1')][_0x15ad('0xb2')]:_0x1f5175[_0x15ad('0x93')],'custom':![],'options':[]};_0x3b71fa[_0x15ad('0x98')](_0x2208c0);return _0x3b71fa;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b2aa5e8..f87f5af 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x547cd9,_0x24fdf6){var _0x4bc14e=function(_0x46c9f2){while(--_0x46c9f2){_0x547cd9['push'](_0x547cd9['shift']());}};_0x4bc14e(++_0x24fdf6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x477538,_0x50925c){var _0x41ccd9=function(_0x59977a){while(--_0x59977a){_0x477538['push'](_0x477538['shift']());}};_0x41ccd9(++_0x50925c);}(_0x757a,0xde));var _0xa757=function(_0x44f416,_0x2cc20c){_0x44f416=_0x44f416-0x0;var _0x339da9=_0x757a[_0x44f416];return _0x339da9;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 70a1b8d..c817067 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 _0x44ff=['request','then','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','limit','include','map','model','attributes','info','debug','ShowDynamics365Account','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x2e655a,_0x6d5799){var _0x26f13b=function(_0x2dd535){while(--_0x2dd535){_0x2e655a['push'](_0x2e655a['shift']());}};_0x26f13b(++_0x6d5799);}(_0x44ff,0x14b));var _0xf44f=function(_0x143e89,_0x5cb0ba){_0x143e89=_0x143e89-0x0;var _0x4aa264=_0x44ff[_0x143e89];return _0x4aa264;};'use strict';var _=require(_0xf44f('0x0'));var util=require('util');var moment=require(_0xf44f('0x1'));var BPromise=require(_0xf44f('0x2'));var rs=require(_0xf44f('0x3'));var fs=require('fs');var Redis=require(_0xf44f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf44f('0x5'));var logger=require(_0xf44f('0x6'))(_0xf44f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf44f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3622e9,_0x1e92cc,_0x7cb24e){return new BPromise(function(_0x16dea5,_0x487797){return client[_0xf44f('0x9')](_0x3622e9,_0x7cb24e)[_0xf44f('0xa')](function(_0x2aa501){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x1e92cc,'request\x20sent');logger['debug'](_0xf44f('0xb'),_0x1e92cc,'request\x20sent',JSON[_0xf44f('0xc')](_0x2aa501));if(_0x2aa501[_0xf44f('0xd')]){if(_0x2aa501['error'][_0xf44f('0xe')]===0x1f4){logger[_0xf44f('0xd')](_0xf44f('0xf'),_0x1e92cc,_0x2aa501[_0xf44f('0xd')][_0xf44f('0x10')]);return _0x487797(_0x2aa501[_0xf44f('0xd')]['message']);}logger[_0xf44f('0xd')](_0xf44f('0xf'),_0x1e92cc,_0x2aa501[_0xf44f('0xd')][_0xf44f('0x10')]);return _0x16dea5(_0x2aa501['error'][_0xf44f('0x10')]);}else{logger['info'](_0xf44f('0xf'),_0x1e92cc,_0xf44f('0x11'));_0x16dea5(_0x2aa501[_0xf44f('0x12')][_0xf44f('0x10')]);}})[_0xf44f('0x13')](function(_0x555fec){logger[_0xf44f('0xd')](_0xf44f('0xf'),_0x1e92cc,_0x555fec);_0x487797(_0x555fec);});});}exports[_0xf44f('0x14')]=function(_0x27e5d4){var _0x566cf0=this;return new Promise(function(_0x1fb850,_0x2d2f87){return db[_0xf44f('0x15')][_0xf44f('0x16')]({'raw':_0x27e5d4[_0xf44f('0x17')]?_0x27e5d4['options']['raw']===undefined?!![]:![]:!![],'where':_0x27e5d4[_0xf44f('0x17')]?_0x27e5d4[_0xf44f('0x17')][_0xf44f('0x18')]||null:null,'attributes':_0x27e5d4[_0xf44f('0x17')]?_0x27e5d4['options']['attributes']||null:null,'limit':_0x27e5d4[_0xf44f('0x17')]?_0x27e5d4['options'][_0xf44f('0x19')]||null:null,'include':_0x27e5d4['options']?_0x27e5d4[_0xf44f('0x17')][_0xf44f('0x1a')]?_[_0xf44f('0x1b')](_0x27e5d4['options'][_0xf44f('0x1a')],function(_0x3f0cab){return{'model':db[_0x3f0cab[_0xf44f('0x1c')]],'as':_0x3f0cab['as'],'attributes':_0x3f0cab[_0xf44f('0x1d')],'include':_0x3f0cab['include']?_[_0xf44f('0x1b')](_0x3f0cab[_0xf44f('0x1a')],function(_0x278a6b){return{'model':db[_0x278a6b[_0xf44f('0x1c')]],'as':_0x278a6b['as'],'attributes':_0x278a6b['attributes'],'include':_0x278a6b[_0xf44f('0x1a')]?_[_0xf44f('0x1b')](_0x278a6b[_0xf44f('0x1a')],function(_0x69b579){return{'model':db[_0x69b579[_0xf44f('0x1c')]],'as':_0x69b579['as'],'attributes':_0x69b579[_0xf44f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf44f('0xa')](function(_0x120cff){logger[_0xf44f('0x1e')](_0xf44f('0x14'),_0x27e5d4);logger[_0xf44f('0x1f')]('GetDynamics365Account',_0x27e5d4,JSON[_0xf44f('0xc')](_0x120cff));_0x1fb850(_0x120cff);})[_0xf44f('0x13')](function(_0xd684af){logger[_0xf44f('0xd')](_0xf44f('0x14'),_0xd684af[_0xf44f('0x10')],_0x27e5d4);_0x2d2f87(_0x566cf0[_0xf44f('0xd')](0x1f4,_0xd684af[_0xf44f('0x10')]));});});};exports[_0xf44f('0x20')]=function(_0x311f45){var _0x404633=this;return new Promise(function(_0x393d08,_0x42b69d){return db[_0xf44f('0x15')]['find']({'raw':_0x311f45[_0xf44f('0x17')]?_0x311f45[_0xf44f('0x17')][_0xf44f('0x21')]===undefined?!![]:![]:!![],'where':_0x311f45[_0xf44f('0x17')]?_0x311f45['options']['where']||null:null,'attributes':_0x311f45[_0xf44f('0x17')]?_0x311f45[_0xf44f('0x17')][_0xf44f('0x1d')]||null:null,'include':_0x311f45[_0xf44f('0x17')]?_0x311f45[_0xf44f('0x17')][_0xf44f('0x1a')]?_['map'](_0x311f45[_0xf44f('0x17')][_0xf44f('0x1a')],function(_0x1b4766){return{'model':db[_0x1b4766[_0xf44f('0x1c')]],'as':_0x1b4766['as'],'attributes':_0x1b4766[_0xf44f('0x1d')],'include':_0x1b4766[_0xf44f('0x1a')]?_['map'](_0x1b4766[_0xf44f('0x1a')],function(_0x4f0f75){return{'model':db[_0x4f0f75['model']],'as':_0x4f0f75['as'],'attributes':_0x4f0f75[_0xf44f('0x1d')],'include':_0x4f0f75[_0xf44f('0x1a')]?_['map'](_0x4f0f75[_0xf44f('0x1a')],function(_0x578b38){return{'model':db[_0x578b38[_0xf44f('0x1c')]],'as':_0x578b38['as'],'attributes':_0x578b38['attributes']};}):[]};}):[]};}):[]:[]})[_0xf44f('0xa')](function(_0x172a4e){logger['info'](_0xf44f('0x20'),_0x311f45);logger[_0xf44f('0x1f')]('ShowDynamics365Account',_0x311f45,JSON[_0xf44f('0xc')](_0x172a4e));_0x393d08(_0x172a4e);})[_0xf44f('0x13')](function(_0x493c0d){logger[_0xf44f('0xd')](_0xf44f('0x20'),_0x493c0d[_0xf44f('0x10')],_0x311f45);_0x42b69d(_0x404633[_0xf44f('0xd')](0x1f4,_0x493c0d[_0xf44f('0x10')]));});});}; \ No newline at end of file +var _0x6b39=['catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','include','map','model','info','ShowDynamics365Account','debug','lodash','util','moment','../../mysqldb','rpc','jayson/promise','client','http','request','then','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','result'];(function(_0x5ac949,_0x19ec4b){var _0x126792=function(_0x4f638a){while(--_0x4f638a){_0x5ac949['push'](_0x5ac949['shift']());}};_0x126792(++_0x19ec4b);}(_0x6b39,0x8a));var _0x96b3=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0x6b39[_0x46c9cc];return _0x21b46e;};'use strict';var _=require(_0x96b3('0x0'));var util=require(_0x96b3('0x1'));var moment=require(_0x96b3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b3('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x96b3('0x4'));var config=require('../../config/environment');var jayson=require(_0x96b3('0x5'));var client=jayson[_0x96b3('0x6')][_0x96b3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5a5278,_0x34e855,_0x1e0c85){return new BPromise(function(_0x2b6cf,_0x382a92){return client[_0x96b3('0x8')](_0x5a5278,_0x1e0c85)[_0x96b3('0x9')](function(_0x4c1978){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x34e855,_0x96b3('0xa'));logger['debug'](_0x96b3('0xb'),_0x34e855,'request\x20sent',JSON[_0x96b3('0xc')](_0x4c1978));if(_0x4c1978['error']){if(_0x4c1978[_0x96b3('0xd')]['code']===0x1f4){logger[_0x96b3('0xd')](_0x96b3('0xe'),_0x34e855,_0x4c1978[_0x96b3('0xd')]['message']);return _0x382a92(_0x4c1978[_0x96b3('0xd')][_0x96b3('0xf')]);}logger[_0x96b3('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x34e855,_0x4c1978[_0x96b3('0xd')][_0x96b3('0xf')]);return _0x2b6cf(_0x4c1978['error'][_0x96b3('0xf')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x34e855,_0x96b3('0xa'));_0x2b6cf(_0x4c1978[_0x96b3('0x10')][_0x96b3('0xf')]);}})[_0x96b3('0x11')](function(_0x1700bb){logger['error'](_0x96b3('0xe'),_0x34e855,_0x1700bb);_0x382a92(_0x1700bb);});});}exports[_0x96b3('0x12')]=function(_0x14ee08){var _0x6258a7=this;return new Promise(function(_0x55aea7,_0x2432d0){return db[_0x96b3('0x13')][_0x96b3('0x14')]({'raw':_0x14ee08[_0x96b3('0x15')]?_0x14ee08[_0x96b3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x14ee08['options']?_0x14ee08[_0x96b3('0x15')][_0x96b3('0x16')]||null:null,'attributes':_0x14ee08[_0x96b3('0x15')]?_0x14ee08[_0x96b3('0x15')][_0x96b3('0x17')]||null:null,'limit':_0x14ee08['options']?_0x14ee08[_0x96b3('0x15')][_0x96b3('0x18')]||null:null,'include':_0x14ee08['options']?_0x14ee08[_0x96b3('0x15')][_0x96b3('0x19')]?_[_0x96b3('0x1a')](_0x14ee08[_0x96b3('0x15')][_0x96b3('0x19')],function(_0x26dfa8){return{'model':db[_0x26dfa8[_0x96b3('0x1b')]],'as':_0x26dfa8['as'],'attributes':_0x26dfa8[_0x96b3('0x17')],'include':_0x26dfa8['include']?_[_0x96b3('0x1a')](_0x26dfa8[_0x96b3('0x19')],function(_0x3f107f){return{'model':db[_0x3f107f[_0x96b3('0x1b')]],'as':_0x3f107f['as'],'attributes':_0x3f107f[_0x96b3('0x17')],'include':_0x3f107f[_0x96b3('0x19')]?_[_0x96b3('0x1a')](_0x3f107f[_0x96b3('0x19')],function(_0x195236){return{'model':db[_0x195236[_0x96b3('0x1b')]],'as':_0x195236['as'],'attributes':_0x195236[_0x96b3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x96b3('0x9')](function(_0x23b556){logger[_0x96b3('0x1c')](_0x96b3('0x12'),_0x14ee08);logger['debug']('GetDynamics365Account',_0x14ee08,JSON[_0x96b3('0xc')](_0x23b556));_0x55aea7(_0x23b556);})[_0x96b3('0x11')](function(_0xbb20e2){logger[_0x96b3('0xd')]('GetDynamics365Account',_0xbb20e2[_0x96b3('0xf')],_0x14ee08);_0x2432d0(_0x6258a7[_0x96b3('0xd')](0x1f4,_0xbb20e2[_0x96b3('0xf')]));});});};exports[_0x96b3('0x1d')]=function(_0x138307){var _0x102503=this;return new Promise(function(_0x2e85c1,_0x2857da){return db['Dynamics365Account']['find']({'raw':_0x138307['options']?_0x138307['options']['raw']===undefined?!![]:![]:!![],'where':_0x138307[_0x96b3('0x15')]?_0x138307['options']['where']||null:null,'attributes':_0x138307[_0x96b3('0x15')]?_0x138307['options'][_0x96b3('0x17')]||null:null,'include':_0x138307[_0x96b3('0x15')]?_0x138307[_0x96b3('0x15')][_0x96b3('0x19')]?_[_0x96b3('0x1a')](_0x138307['options'][_0x96b3('0x19')],function(_0x53fd33){return{'model':db[_0x53fd33[_0x96b3('0x1b')]],'as':_0x53fd33['as'],'attributes':_0x53fd33[_0x96b3('0x17')],'include':_0x53fd33['include']?_['map'](_0x53fd33[_0x96b3('0x19')],function(_0x35a1f3){return{'model':db[_0x35a1f3['model']],'as':_0x35a1f3['as'],'attributes':_0x35a1f3[_0x96b3('0x17')],'include':_0x35a1f3[_0x96b3('0x19')]?_[_0x96b3('0x1a')](_0x35a1f3['include'],function(_0xeabd47){return{'model':db[_0xeabd47[_0x96b3('0x1b')]],'as':_0xeabd47['as'],'attributes':_0xeabd47['attributes']};}):[]};}):[]};}):[]:[]})[_0x96b3('0x9')](function(_0x1fd2e0){logger[_0x96b3('0x1c')](_0x96b3('0x1d'),_0x138307);logger[_0x96b3('0x1e')](_0x96b3('0x1d'),_0x138307,JSON[_0x96b3('0xc')](_0x1fd2e0));_0x2e85c1(_0x1fd2e0);})['catch'](function(_0x1a55a7){logger['error']('ShowDynamics365Account',_0x1a55a7['message'],_0x138307);_0x2857da(_0x102503[_0x96b3('0xd')](0x1f4,_0x1a55a7['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 835ec41..c6361f6 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 _0xa282=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0xa282,0x189));var _0x2a28=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xa282[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x2a28('0x0'));var util=require(_0x2a28('0x1'));var path=require(_0x2a28('0x2'));var timeout=require(_0x2a28('0x3'));var express=require(_0x2a28('0x4'));var router=express[_0x2a28('0x5')]();var fs_extra=require(_0x2a28('0x6'));var auth=require(_0x2a28('0x7'));var interaction=require(_0x2a28('0x8'));var config=require(_0x2a28('0x9'));var controller=require(_0x2a28('0xa'));router[_0x2a28('0xb')]('/',auth[_0x2a28('0xc')](),controller['index']);router['get'](_0x2a28('0xd'),auth[_0x2a28('0xc')](),controller[_0x2a28('0xe')]);router[_0x2a28('0xb')]('/:id/fields',auth[_0x2a28('0xc')](),controller[_0x2a28('0xf')]);router[_0x2a28('0xb')](_0x2a28('0x10'),auth[_0x2a28('0xc')](),controller[_0x2a28('0x11')]);router['get'](_0x2a28('0x12'),auth['isAuthenticated'](),controller[_0x2a28('0x13')]);router['post']('/',auth[_0x2a28('0xc')](),controller[_0x2a28('0x14')]);router[_0x2a28('0x15')](_0x2a28('0xd'),auth[_0x2a28('0xc')](),controller[_0x2a28('0x16')]);router[_0x2a28('0x17')]('/:id',auth[_0x2a28('0xc')](),controller[_0x2a28('0x18')]);module[_0x2a28('0x19')]=router; \ No newline at end of file +var _0x202a=['post','create','put','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions'];(function(_0x1658af,_0x5dbcab){var _0x30d065=function(_0x35a8c4){while(--_0x35a8c4){_0x1658af['push'](_0x1658af['shift']());}};_0x30d065(++_0x5dbcab);}(_0x202a,0xf8));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xa202('0x0'));var path=require('path');var timeout=require(_0xa202('0x1'));var express=require(_0xa202('0x2'));var router=express[_0xa202('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa202('0x4'));var interaction=require(_0xa202('0x5'));var config=require(_0xa202('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0xa202('0x7')]('/',auth[_0xa202('0x8')](),controller[_0xa202('0x9')]);router[_0xa202('0x7')](_0xa202('0xa'),auth[_0xa202('0x8')](),controller[_0xa202('0xb')]);router[_0xa202('0x7')](_0xa202('0xc'),auth[_0xa202('0x8')](),controller[_0xa202('0xd')]);router[_0xa202('0x7')]('/:id/subjects',auth[_0xa202('0x8')](),controller['getSubjects']);router[_0xa202('0x7')](_0xa202('0xe'),auth['isAuthenticated'](),controller[_0xa202('0xf')]);router[_0xa202('0x10')]('/',auth['isAuthenticated'](),controller[_0xa202('0x11')]);router[_0xa202('0x12')](_0xa202('0xa'),auth[_0xa202('0x8')](),controller['update']);router[_0xa202('0x13')](_0xa202('0xa'),auth[_0xa202('0x8')](),controller[_0xa202('0x14')]);module[_0xa202('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index b74a8d8..b4cdfd8 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 _0xa63b=['contact','BOOLEAN','sequelize','exports','STRING','phonecall','incident','nothing'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa63b,0x6a));var _0xba63=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa63b[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0xba63('0x0'));module[_0xba63('0x1')]={'name':{'type':Sequelize[_0xba63('0x2')]},'description':{'type':Sequelize[_0xba63('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0xba63('0x3')),'defaultValue':_0xba63('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0xba63('0x5')),'defaultValue':_0xba63('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xba63('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xba63('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb286=['exports','STRING','ENUM','phonecall','incident','contact','nothing','BOOLEAN','sequelize'];(function(_0x54c695,_0x5d6677){var _0x3ce06b=function(_0x55bdf1){while(--_0x55bdf1){_0x54c695['push'](_0x54c695['shift']());}};_0x3ce06b(++_0x5d6677);}(_0xb286,0x13a));var _0x6b28=function(_0x4a775b,_0x1848e9){_0x4a775b=_0x4a775b-0x0;var _0x20ceec=_0xb286[_0x4a775b];return _0x20ceec;};'use strict';var Sequelize=require(_0x6b28('0x0'));module[_0x6b28('0x1')]={'name':{'type':Sequelize[_0x6b28('0x2')]},'description':{'type':Sequelize[_0x6b28('0x2')]},'ticketType':{'type':Sequelize[_0x6b28('0x3')]('incident',_0x6b28('0x4')),'defaultValue':_0x6b28('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0x6b28('0x6'),_0x6b28('0x7')),'defaultValue':_0x6b28('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x6b28('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x6b28('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index bc427c8..9543044 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 _0x0ff5=['options','find','catch','create','body','params','getFields','Dynamics365Field','pick','getSubjects','findOne','getDescriptions','order','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','show','keys','rawAttributes'];(function(_0x3b3770,_0x2da21a){var _0x382f21=function(_0x56e57c){while(--_0x56e57c){_0x3b3770['push'](_0x3b3770['shift']());}};_0x382f21(++_0x2da21a);}(_0x0ff5,0x106));var _0x50ff=function(_0x19b981,_0x50edd4){_0x19b981=_0x19b981-0x0;var _0x1cd2d3=_0x0ff5[_0x19b981];return _0x1cd2d3;};'use strict';var emlformat=require(_0x50ff('0x0'));var rimraf=require(_0x50ff('0x1'));var zipdir=require(_0x50ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50ff('0x3'));var moment=require(_0x50ff('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50ff('0x5'));var path=require(_0x50ff('0x6'));var sox=require(_0x50ff('0x7'));var csv=require(_0x50ff('0x8'));var ejs=require(_0x50ff('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50ff('0xa'));var squel=require(_0x50ff('0xb'));var crypto=require(_0x50ff('0xc'));var jsforce=require(_0x50ff('0xd'));var deskjs=require(_0x50ff('0xe'));var toCsv=require(_0x50ff('0x8'));var querystring=require(_0x50ff('0xf'));var Papa=require(_0x50ff('0x10'));var Redis=require(_0x50ff('0x11'));var authService=require(_0x50ff('0x12'));var qs=require(_0x50ff('0x13'));var as=require(_0x50ff('0x14'));var hardwareService=require(_0x50ff('0x15'));var logger=require(_0x50ff('0x16'))('api');var utils=require(_0x50ff('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x50ff('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13c541,_0xd45fa5){_0xd45fa5=_0xd45fa5||0xcc;return function(_0x53361e){if(_0x53361e){return _0x13c541[_0x50ff('0x19')](_0xd45fa5);}return _0x13c541[_0x50ff('0x1a')](_0xd45fa5)[_0x50ff('0x1b')]();};}function respondWithResult(_0x38689d,_0xf6db26){_0xf6db26=_0xf6db26||0xc8;return function(_0x255727){if(_0x255727){return _0x38689d[_0x50ff('0x1a')](_0xf6db26)[_0x50ff('0x1c')](_0x255727);}};}function respondWithFilteredResult(_0x4e44b5,_0x1f73b2){return function(_0x1cdcfa){if(_0x1cdcfa){var _0x4f3c7b=typeof _0x1f73b2[_0x50ff('0x1d')]===_0x50ff('0x1e')&&typeof _0x1f73b2[_0x50ff('0x1f')]===_0x50ff('0x1e');var _0x57787a=_0x1cdcfa['count'];var _0x5d6986=_0x4f3c7b?0x0:_0x1f73b2[_0x50ff('0x1d')];var _0x15c892=_0x4f3c7b?_0x1cdcfa[_0x50ff('0x20')]:_0x1f73b2['offset']+_0x1f73b2[_0x50ff('0x1f')];var _0x15623c;if(_0x15c892>=_0x57787a){_0x15c892=_0x57787a;_0x15623c=0xc8;}else{_0x15623c=0xce;}_0x4e44b5[_0x50ff('0x1a')](_0x15623c);return _0x4e44b5[_0x50ff('0x21')](_0x50ff('0x22'),_0x5d6986+'-'+_0x15c892+'/'+_0x57787a)[_0x50ff('0x1c')](_0x1cdcfa);}return null;};}function patchUpdates(_0x310821){return function(_0x4e0a00){try{jsonpatch[_0x50ff('0x23')](_0x4e0a00,_0x310821,!![]);}catch(_0x2513a9){return BPromise[_0x50ff('0x24')](_0x2513a9);}return _0x4e0a00['save']();};}function saveUpdates(_0x55e0f0,_0x474167){return function(_0x51bf9d){if(_0x51bf9d){return _0x51bf9d[_0x50ff('0x25')](_0x55e0f0)[_0x50ff('0x26')](function(_0x581294){return _0x581294;});}return null;};}function removeEntity(_0x1d91e8,_0x57ef05){return function(_0x306e15){if(_0x306e15){return _0x306e15[_0x50ff('0x27')]()[_0x50ff('0x26')](function(){_0x1d91e8[_0x50ff('0x1a')](0xcc)[_0x50ff('0x1b')]();});}};}function handleEntityNotFound(_0x23c882,_0x2f3c6f){return function(_0x13b281){if(!_0x13b281){_0x23c882[_0x50ff('0x19')](0x194);}return _0x13b281;};}function handleError(_0x182f34,_0x400e5d){_0x400e5d=_0x400e5d||0x1f4;return function(_0x11b708){logger[_0x50ff('0x28')](_0x11b708[_0x50ff('0x29')]);if(_0x11b708[_0x50ff('0x2a')]){delete _0x11b708[_0x50ff('0x2a')];}_0x182f34[_0x50ff('0x1a')](_0x400e5d)[_0x50ff('0x2b')](_0x11b708);};}exports[_0x50ff('0x2c')]=function(_0x5c2929,_0x3d7cab){var _0x9317e1={},_0x50a599={},_0x3f42e1={'count':0x0,'rows':[]};var _0x1ebc09=_[_0x50ff('0x2d')](db[_0x50ff('0x2e')]['rawAttributes'],function(_0x54f158){return{'name':_0x54f158[_0x50ff('0x2f')],'type':_0x54f158[_0x50ff('0x30')][_0x50ff('0x31')]};});_0x50a599['model']=_[_0x50ff('0x2d')](_0x1ebc09,_0x50ff('0x2a'));_0x50a599[_0x50ff('0x32')]=_['keys'](_0x5c2929[_0x50ff('0x32')]);_0x50a599[_0x50ff('0x33')]=_[_0x50ff('0x34')](_0x50a599[_0x50ff('0x35')],_0x50a599[_0x50ff('0x32')]);_0x9317e1[_0x50ff('0x36')]=_[_0x50ff('0x34')](_0x50a599[_0x50ff('0x35')],qs[_0x50ff('0x37')](_0x5c2929['query'][_0x50ff('0x37')]));_0x9317e1[_0x50ff('0x36')]=_0x9317e1[_0x50ff('0x36')][_0x50ff('0x38')]?_0x9317e1['attributes']:_0x50a599[_0x50ff('0x35')];if(!_0x5c2929[_0x50ff('0x32')][_0x50ff('0x39')](_0x50ff('0x3a'))){_0x9317e1[_0x50ff('0x1f')]=qs['limit'](_0x5c2929[_0x50ff('0x32')][_0x50ff('0x1f')]);_0x9317e1[_0x50ff('0x1d')]=qs['offset'](_0x5c2929[_0x50ff('0x32')][_0x50ff('0x1d')]);}_0x9317e1['order']=qs[_0x50ff('0x3b')](_0x5c2929['query'][_0x50ff('0x3b')]);_0x9317e1[_0x50ff('0x3c')]=qs[_0x50ff('0x33')](_['pick'](_0x5c2929['query'],_0x50a599[_0x50ff('0x33')]),_0x1ebc09);if(_0x5c2929[_0x50ff('0x32')][_0x50ff('0x3d')]){_0x9317e1[_0x50ff('0x3c')]=_[_0x50ff('0x3e')](_0x9317e1['where'],{'$or':_[_0x50ff('0x2d')](_0x1ebc09,function(_0x40e1df){if(_0x40e1df[_0x50ff('0x30')]!==_0x50ff('0x3f')){var _0x4e1cec={};_0x4e1cec[_0x40e1df[_0x50ff('0x2a')]]={'$like':'%'+_0x5c2929['query']['filter']+'%'};return _0x4e1cec;}})});}_0x9317e1=_[_0x50ff('0x3e')]({},_0x9317e1,_0x5c2929['options']);var _0x19ae9c={'where':_0x9317e1[_0x50ff('0x3c')]};return db[_0x50ff('0x2e')][_0x50ff('0x20')](_0x19ae9c)['then'](function(_0x177c41){_0x3f42e1[_0x50ff('0x20')]=_0x177c41;if(_0x5c2929[_0x50ff('0x32')][_0x50ff('0x40')]){_0x9317e1[_0x50ff('0x41')]=[{'all':!![]}];}return db[_0x50ff('0x2e')]['findAll'](_0x9317e1);})[_0x50ff('0x26')](function(_0x438d11){_0x3f42e1[_0x50ff('0x42')]=_0x438d11;return _0x3f42e1;})[_0x50ff('0x26')](respondWithFilteredResult(_0x3d7cab,_0x9317e1))['catch'](handleError(_0x3d7cab,null));};exports[_0x50ff('0x43')]=function(_0x1259bc,_0x1aca7e){var _0x5b0a9a={'raw':![],'where':{'id':_0x1259bc['params']['id']}},_0x5a3a3b={};_0x5a3a3b[_0x50ff('0x35')]=_[_0x50ff('0x44')](db[_0x50ff('0x2e')][_0x50ff('0x45')]);_0x5a3a3b[_0x50ff('0x32')]=_['keys'](_0x1259bc[_0x50ff('0x32')]);_0x5a3a3b[_0x50ff('0x33')]=_[_0x50ff('0x34')](_0x5a3a3b[_0x50ff('0x35')],_0x5a3a3b['query']);_0x5b0a9a[_0x50ff('0x36')]=_[_0x50ff('0x34')](_0x5a3a3b[_0x50ff('0x35')],qs[_0x50ff('0x37')](_0x1259bc[_0x50ff('0x32')]['fields']));_0x5b0a9a[_0x50ff('0x36')]=_0x5b0a9a[_0x50ff('0x36')][_0x50ff('0x38')]?_0x5b0a9a[_0x50ff('0x36')]:_0x5a3a3b[_0x50ff('0x35')];if(_0x1259bc['query']['includeAll']){_0x5b0a9a[_0x50ff('0x41')]=[{'all':!![]}];}_0x5b0a9a=_[_0x50ff('0x3e')]({},_0x5b0a9a,_0x1259bc[_0x50ff('0x46')]);return db[_0x50ff('0x2e')][_0x50ff('0x47')](_0x5b0a9a)[_0x50ff('0x26')](handleEntityNotFound(_0x1aca7e,null))[_0x50ff('0x26')](respondWithResult(_0x1aca7e,null))[_0x50ff('0x48')](handleError(_0x1aca7e,null));};exports[_0x50ff('0x49')]=function(_0x5c84d9,_0x583855){return db['Dynamics365Configuration'][_0x50ff('0x49')](_0x5c84d9['body'],{})[_0x50ff('0x26')](respondWithResult(_0x583855,0xc9))[_0x50ff('0x48')](handleError(_0x583855,null));};exports[_0x50ff('0x25')]=function(_0xf4f5ab,_0x4985a5){if(_0xf4f5ab[_0x50ff('0x4a')]['id']){delete _0xf4f5ab[_0x50ff('0x4a')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0xf4f5ab[_0x50ff('0x4b')]['id']}})[_0x50ff('0x26')](handleEntityNotFound(_0x4985a5,null))[_0x50ff('0x26')](saveUpdates(_0xf4f5ab[_0x50ff('0x4a')],null))[_0x50ff('0x26')](respondWithResult(_0x4985a5,null))['catch'](handleError(_0x4985a5,null));};exports[_0x50ff('0x27')]=function(_0x3353b9,_0x319ec8){return db[_0x50ff('0x2e')][_0x50ff('0x47')]({'where':{'id':_0x3353b9[_0x50ff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x319ec8,null))[_0x50ff('0x26')](removeEntity(_0x319ec8,null))[_0x50ff('0x48')](handleError(_0x319ec8,null));};exports[_0x50ff('0x4c')]=function(_0x4e3dfa,_0x441d9d,_0x2255fd){var _0x3f083c={};var _0x3701b7={};var _0x428d69;var _0x3cfa3d;return db[_0x50ff('0x2e')]['findOne']({'where':{'id':_0x4e3dfa['params']['id']}})[_0x50ff('0x26')](handleEntityNotFound(_0x441d9d,null))[_0x50ff('0x26')](function(_0x35920e){if(_0x35920e){_0x428d69=_0x35920e;_0x3701b7[_0x50ff('0x35')]=_[_0x50ff('0x44')](db[_0x50ff('0x4d')][_0x50ff('0x45')]);_0x3701b7[_0x50ff('0x32')]=_[_0x50ff('0x44')](_0x4e3dfa[_0x50ff('0x32')]);_0x3701b7[_0x50ff('0x33')]=_[_0x50ff('0x34')](_0x3701b7[_0x50ff('0x35')],_0x3701b7[_0x50ff('0x32')]);_0x3f083c[_0x50ff('0x36')]=_[_0x50ff('0x34')](_0x3701b7['model'],qs[_0x50ff('0x37')](_0x4e3dfa[_0x50ff('0x32')][_0x50ff('0x37')]));_0x3f083c[_0x50ff('0x36')]=_0x3f083c[_0x50ff('0x36')][_0x50ff('0x38')]?_0x3f083c['attributes']:_0x3701b7[_0x50ff('0x35')];_0x3f083c['order']=qs[_0x50ff('0x3b')](_0x4e3dfa[_0x50ff('0x32')]['sort']);_0x3f083c['where']=qs[_0x50ff('0x33')](_[_0x50ff('0x4e')](_0x4e3dfa['query'],_0x3701b7[_0x50ff('0x33')]));if(_0x4e3dfa[_0x50ff('0x32')][_0x50ff('0x3d')]){_0x3f083c[_0x50ff('0x3c')]=_[_0x50ff('0x3e')](_0x3f083c[_0x50ff('0x3c')],{'$or':_[_0x50ff('0x2d')](_0x3f083c[_0x50ff('0x36')],function(_0x860d6){var _0x5672d2={};_0x5672d2[_0x860d6]={'$like':'%'+_0x4e3dfa[_0x50ff('0x32')][_0x50ff('0x3d')]+'%'};return _0x5672d2;})});}_0x3f083c=_[_0x50ff('0x3e')]({},_0x3f083c,_0x4e3dfa[_0x50ff('0x46')]);return _0x428d69[_0x50ff('0x4c')](_0x3f083c);}})['then'](function(_0x359f70){if(_0x359f70){_0x3cfa3d=_0x359f70[_0x50ff('0x38')];if(!_0x4e3dfa['query'][_0x50ff('0x39')]('nolimit')){_0x3f083c[_0x50ff('0x1f')]=qs[_0x50ff('0x1f')](_0x4e3dfa[_0x50ff('0x32')][_0x50ff('0x1f')]);_0x3f083c[_0x50ff('0x1d')]=qs[_0x50ff('0x1d')](_0x4e3dfa[_0x50ff('0x32')][_0x50ff('0x1d')]);}return _0x428d69[_0x50ff('0x4c')](_0x3f083c);}})[_0x50ff('0x26')](function(_0x1a82a0){if(_0x1a82a0){return _0x1a82a0?{'count':_0x3cfa3d,'rows':_0x1a82a0}:null;}})[_0x50ff('0x26')](respondWithResult(_0x441d9d,null))['catch'](handleError(_0x441d9d,null));};exports[_0x50ff('0x4f')]=function(_0x36fff8,_0x499d34,_0x5b35d5){var _0x18d18a={};var _0xd3bd2f={};var _0x49c09c;var _0x2b530d;return db[_0x50ff('0x2e')][_0x50ff('0x50')]({'where':{'id':_0x36fff8[_0x50ff('0x4b')]['id']}})[_0x50ff('0x26')](handleEntityNotFound(_0x499d34,null))['then'](function(_0x523017){if(_0x523017){_0x49c09c=_0x523017;_0xd3bd2f[_0x50ff('0x35')]=_[_0x50ff('0x44')](db['Dynamics365Field'][_0x50ff('0x45')]);_0xd3bd2f[_0x50ff('0x32')]=_[_0x50ff('0x44')](_0x36fff8[_0x50ff('0x32')]);_0xd3bd2f[_0x50ff('0x33')]=_[_0x50ff('0x34')](_0xd3bd2f[_0x50ff('0x35')],_0xd3bd2f['query']);_0x18d18a[_0x50ff('0x36')]=_[_0x50ff('0x34')](_0xd3bd2f[_0x50ff('0x35')],qs['fields'](_0x36fff8[_0x50ff('0x32')][_0x50ff('0x37')]));_0x18d18a[_0x50ff('0x36')]=_0x18d18a[_0x50ff('0x36')][_0x50ff('0x38')]?_0x18d18a[_0x50ff('0x36')]:_0xd3bd2f['model'];_0x18d18a['order']=qs['sort'](_0x36fff8[_0x50ff('0x32')][_0x50ff('0x3b')]);_0x18d18a['where']=qs[_0x50ff('0x33')](_[_0x50ff('0x4e')](_0x36fff8[_0x50ff('0x32')],_0xd3bd2f[_0x50ff('0x33')]));if(_0x36fff8[_0x50ff('0x32')][_0x50ff('0x3d')]){_0x18d18a[_0x50ff('0x3c')]=_['merge'](_0x18d18a[_0x50ff('0x3c')],{'$or':_[_0x50ff('0x2d')](_0x18d18a[_0x50ff('0x36')],function(_0x54190c){var _0x50b025={};_0x50b025[_0x54190c]={'$like':'%'+_0x36fff8['query'][_0x50ff('0x3d')]+'%'};return _0x50b025;})});}_0x18d18a=_['merge']({},_0x18d18a,_0x36fff8[_0x50ff('0x46')]);return _0x49c09c[_0x50ff('0x4f')](_0x18d18a);}})[_0x50ff('0x26')](function(_0x5ed800){if(_0x5ed800){_0x2b530d=_0x5ed800['length'];if(!_0x36fff8[_0x50ff('0x32')]['hasOwnProperty'](_0x50ff('0x3a'))){_0x18d18a['limit']=qs[_0x50ff('0x1f')](_0x36fff8[_0x50ff('0x32')][_0x50ff('0x1f')]);_0x18d18a['offset']=qs[_0x50ff('0x1d')](_0x36fff8['query'][_0x50ff('0x1d')]);}return _0x49c09c['getSubjects'](_0x18d18a);}})[_0x50ff('0x26')](function(_0xe749b2){if(_0xe749b2){return _0xe749b2?{'count':_0x2b530d,'rows':_0xe749b2}:null;}})[_0x50ff('0x26')](respondWithResult(_0x499d34,null))[_0x50ff('0x48')](handleError(_0x499d34,null));};exports[_0x50ff('0x51')]=function(_0x11d5f1,_0x38458c,_0x4c2b7a){var _0x4274a7={};var _0x2d2241={};var _0x597579;var _0x276884;return db[_0x50ff('0x2e')]['findOne']({'where':{'id':_0x11d5f1[_0x50ff('0x4b')]['id']}})[_0x50ff('0x26')](handleEntityNotFound(_0x38458c,null))['then'](function(_0x3da40f){if(_0x3da40f){_0x597579=_0x3da40f;_0x2d2241[_0x50ff('0x35')]=_[_0x50ff('0x44')](db[_0x50ff('0x4d')]['rawAttributes']);_0x2d2241[_0x50ff('0x32')]=_['keys'](_0x11d5f1[_0x50ff('0x32')]);_0x2d2241[_0x50ff('0x33')]=_[_0x50ff('0x34')](_0x2d2241[_0x50ff('0x35')],_0x2d2241[_0x50ff('0x32')]);_0x4274a7[_0x50ff('0x36')]=_[_0x50ff('0x34')](_0x2d2241['model'],qs['fields'](_0x11d5f1[_0x50ff('0x32')][_0x50ff('0x37')]));_0x4274a7[_0x50ff('0x36')]=_0x4274a7[_0x50ff('0x36')][_0x50ff('0x38')]?_0x4274a7['attributes']:_0x2d2241[_0x50ff('0x35')];_0x4274a7[_0x50ff('0x52')]=qs[_0x50ff('0x3b')](_0x11d5f1[_0x50ff('0x32')][_0x50ff('0x3b')]);_0x4274a7['where']=qs[_0x50ff('0x33')](_['pick'](_0x11d5f1[_0x50ff('0x32')],_0x2d2241['filters']));if(_0x11d5f1[_0x50ff('0x32')][_0x50ff('0x3d')]){_0x4274a7['where']=_[_0x50ff('0x3e')](_0x4274a7['where'],{'$or':_[_0x50ff('0x2d')](_0x4274a7[_0x50ff('0x36')],function(_0x2c0873){var _0x2a356f={};_0x2a356f[_0x2c0873]={'$like':'%'+_0x11d5f1[_0x50ff('0x32')]['filter']+'%'};return _0x2a356f;})});}_0x4274a7=_[_0x50ff('0x3e')]({},_0x4274a7,_0x11d5f1[_0x50ff('0x46')]);return _0x597579[_0x50ff('0x51')](_0x4274a7);}})[_0x50ff('0x26')](function(_0x15af35){if(_0x15af35){_0x276884=_0x15af35[_0x50ff('0x38')];if(!_0x11d5f1[_0x50ff('0x32')][_0x50ff('0x39')]('nolimit')){_0x4274a7[_0x50ff('0x1f')]=qs[_0x50ff('0x1f')](_0x11d5f1[_0x50ff('0x32')][_0x50ff('0x1f')]);_0x4274a7[_0x50ff('0x1d')]=qs[_0x50ff('0x1d')](_0x11d5f1[_0x50ff('0x32')]['offset']);}return _0x597579[_0x50ff('0x51')](_0x4274a7);}})[_0x50ff('0x26')](function(_0x254917){if(_0x254917){return _0x254917?{'count':_0x276884,'rows':_0x254917}:null;}})[_0x50ff('0x26')](respondWithResult(_0x38458c,null))['catch'](handleError(_0x38458c,null));}; \ No newline at end of file +var _0x36a4=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','then','destroy','end','stack','send','map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','getFields','getSubjects','findOne','Dynamics365Field','order','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv'];(function(_0x455e82,_0x522f6f){var _0x2d0520=function(_0x11556e){while(--_0x11556e){_0x455e82['push'](_0x455e82['shift']());}};_0x2d0520(++_0x522f6f);}(_0x36a4,0x8f));var _0x436a=function(_0x41f160,_0x3afbf9){_0x41f160=_0x41f160-0x0;var _0x414b08=_0x36a4[_0x41f160];return _0x414b08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x436a('0x0'));var jsonpatch=require(_0x436a('0x1'));var rp=require(_0x436a('0x2'));var moment=require(_0x436a('0x3'));var BPromise=require(_0x436a('0x4'));var Mustache=require('mustache');var util=require(_0x436a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x436a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x436a('0x7'));var squel=require(_0x436a('0x8'));var crypto=require(_0x436a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x436a('0xa'));var toCsv=require(_0x436a('0x6'));var querystring=require(_0x436a('0xb'));var Papa=require(_0x436a('0xc'));var Redis=require('ioredis');var authService=require(_0x436a('0xd'));var qs=require(_0x436a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x436a('0xf'));var logger=require('../../config/logger')(_0x436a('0x10'));var utils=require(_0x436a('0x11'));var config=require(_0x436a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x436a('0x13'))['db'];function respondWithStatusCode(_0x42f438,_0x1be25e){_0x1be25e=_0x1be25e||0xcc;return function(_0xa2e9ad){if(_0xa2e9ad){return _0x42f438[_0x436a('0x14')](_0x1be25e);}return _0x42f438[_0x436a('0x15')](_0x1be25e)['end']();};}function respondWithResult(_0x3a417a,_0x337146){_0x337146=_0x337146||0xc8;return function(_0x165c3e){if(_0x165c3e){return _0x3a417a[_0x436a('0x15')](_0x337146)[_0x436a('0x16')](_0x165c3e);}};}function respondWithFilteredResult(_0x1fec6c,_0x2261c6){return function(_0x1320ad){if(_0x1320ad){var _0x30d89f=typeof _0x2261c6[_0x436a('0x17')]==='undefined'&&typeof _0x2261c6[_0x436a('0x18')]===_0x436a('0x19');var _0x5ef9e9=_0x1320ad[_0x436a('0x1a')];var _0x28c02d=_0x30d89f?0x0:_0x2261c6[_0x436a('0x17')];var _0x49c1aa=_0x30d89f?_0x1320ad[_0x436a('0x1a')]:_0x2261c6['offset']+_0x2261c6['limit'];var _0x120130;if(_0x49c1aa>=_0x5ef9e9){_0x49c1aa=_0x5ef9e9;_0x120130=0xc8;}else{_0x120130=0xce;}_0x1fec6c['status'](_0x120130);return _0x1fec6c[_0x436a('0x1b')]('Content-Range',_0x28c02d+'-'+_0x49c1aa+'/'+_0x5ef9e9)['json'](_0x1320ad);}return null;};}function patchUpdates(_0x2126b3){return function(_0x1aa521){try{jsonpatch['apply'](_0x1aa521,_0x2126b3,!![]);}catch(_0x1a0b59){return BPromise[_0x436a('0x1c')](_0x1a0b59);}return _0x1aa521[_0x436a('0x1d')]();};}function saveUpdates(_0x474014,_0x5e86fb){return function(_0xbc2d6f){if(_0xbc2d6f){return _0xbc2d6f['update'](_0x474014)[_0x436a('0x1e')](function(_0x3d2f54){return _0x3d2f54;});}return null;};}function removeEntity(_0x1b42be,_0x1b72a1){return function(_0xa853b0){if(_0xa853b0){return _0xa853b0[_0x436a('0x1f')]()['then'](function(){_0x1b42be[_0x436a('0x15')](0xcc)[_0x436a('0x20')]();});}};}function handleEntityNotFound(_0x2892b8,_0x3fb1d9){return function(_0x151b53){if(!_0x151b53){_0x2892b8[_0x436a('0x14')](0x194);}return _0x151b53;};}function handleError(_0x18dd6b,_0x1a9f65){_0x1a9f65=_0x1a9f65||0x1f4;return function(_0xab6075){logger['error'](_0xab6075[_0x436a('0x21')]);if(_0xab6075['name']){delete _0xab6075['name'];}_0x18dd6b[_0x436a('0x15')](_0x1a9f65)[_0x436a('0x22')](_0xab6075);};}exports['index']=function(_0x2974d3,_0x1c960b){var _0x56708a={},_0x17ffa0={},_0x42202a={'count':0x0,'rows':[]};var _0x542c08=_[_0x436a('0x23')](db['Dynamics365Configuration'][_0x436a('0x24')],function(_0x1e76fd){return{'name':_0x1e76fd[_0x436a('0x25')],'type':_0x1e76fd['type'][_0x436a('0x26')]};});_0x17ffa0[_0x436a('0x27')]=_['map'](_0x542c08,_0x436a('0x28'));_0x17ffa0[_0x436a('0x29')]=_[_0x436a('0x2a')](_0x2974d3[_0x436a('0x29')]);_0x17ffa0[_0x436a('0x2b')]=_['intersection'](_0x17ffa0[_0x436a('0x27')],_0x17ffa0[_0x436a('0x29')]);_0x56708a['attributes']=_[_0x436a('0x2c')](_0x17ffa0[_0x436a('0x27')],qs[_0x436a('0x2d')](_0x2974d3[_0x436a('0x29')][_0x436a('0x2d')]));_0x56708a[_0x436a('0x2e')]=_0x56708a[_0x436a('0x2e')]['length']?_0x56708a[_0x436a('0x2e')]:_0x17ffa0[_0x436a('0x27')];if(!_0x2974d3[_0x436a('0x29')][_0x436a('0x2f')](_0x436a('0x30'))){_0x56708a[_0x436a('0x18')]=qs[_0x436a('0x18')](_0x2974d3[_0x436a('0x29')][_0x436a('0x18')]);_0x56708a[_0x436a('0x17')]=qs[_0x436a('0x17')](_0x2974d3[_0x436a('0x29')][_0x436a('0x17')]);}_0x56708a['order']=qs[_0x436a('0x31')](_0x2974d3[_0x436a('0x29')][_0x436a('0x31')]);_0x56708a['where']=qs[_0x436a('0x2b')](_[_0x436a('0x32')](_0x2974d3['query'],_0x17ffa0['filters']),_0x542c08);if(_0x2974d3[_0x436a('0x29')][_0x436a('0x33')]){_0x56708a[_0x436a('0x34')]=_[_0x436a('0x35')](_0x56708a[_0x436a('0x34')],{'$or':_['map'](_0x542c08,function(_0x4b43bd){if(_0x4b43bd[_0x436a('0x36')]!==_0x436a('0x37')){var _0x5dfd9e={};_0x5dfd9e[_0x4b43bd['name']]={'$like':'%'+_0x2974d3[_0x436a('0x29')][_0x436a('0x33')]+'%'};return _0x5dfd9e;}})});}_0x56708a=_[_0x436a('0x35')]({},_0x56708a,_0x2974d3['options']);var _0x54f3fa={'where':_0x56708a[_0x436a('0x34')]};return db[_0x436a('0x38')][_0x436a('0x1a')](_0x54f3fa)[_0x436a('0x1e')](function(_0x5e23ca){_0x42202a['count']=_0x5e23ca;if(_0x2974d3['query'][_0x436a('0x39')]){_0x56708a['include']=[{'all':!![]}];}return db[_0x436a('0x38')][_0x436a('0x3a')](_0x56708a);})[_0x436a('0x1e')](function(_0x105bd3){_0x42202a[_0x436a('0x3b')]=_0x105bd3;return _0x42202a;})[_0x436a('0x1e')](respondWithFilteredResult(_0x1c960b,_0x56708a))[_0x436a('0x3c')](handleError(_0x1c960b,null));};exports[_0x436a('0x3d')]=function(_0x4daa6e,_0x45c6fc){var _0x40ede3={'raw':![],'where':{'id':_0x4daa6e[_0x436a('0x3e')]['id']}},_0x4f7d8d={};_0x4f7d8d[_0x436a('0x27')]=_[_0x436a('0x2a')](db[_0x436a('0x38')][_0x436a('0x24')]);_0x4f7d8d[_0x436a('0x29')]=_[_0x436a('0x2a')](_0x4daa6e['query']);_0x4f7d8d[_0x436a('0x2b')]=_[_0x436a('0x2c')](_0x4f7d8d['model'],_0x4f7d8d[_0x436a('0x29')]);_0x40ede3['attributes']=_['intersection'](_0x4f7d8d[_0x436a('0x27')],qs[_0x436a('0x2d')](_0x4daa6e[_0x436a('0x29')][_0x436a('0x2d')]));_0x40ede3[_0x436a('0x2e')]=_0x40ede3['attributes'][_0x436a('0x3f')]?_0x40ede3['attributes']:_0x4f7d8d['model'];if(_0x4daa6e[_0x436a('0x29')]['includeAll']){_0x40ede3[_0x436a('0x40')]=[{'all':!![]}];}_0x40ede3=_[_0x436a('0x35')]({},_0x40ede3,_0x4daa6e[_0x436a('0x41')]);return db['Dynamics365Configuration'][_0x436a('0x42')](_0x40ede3)[_0x436a('0x1e')](handleEntityNotFound(_0x45c6fc,null))[_0x436a('0x1e')](respondWithResult(_0x45c6fc,null))[_0x436a('0x3c')](handleError(_0x45c6fc,null));};exports[_0x436a('0x43')]=function(_0xdd19f0,_0x2b4a13){return db[_0x436a('0x38')]['create'](_0xdd19f0['body'],{})[_0x436a('0x1e')](respondWithResult(_0x2b4a13,0xc9))['catch'](handleError(_0x2b4a13,null));};exports['update']=function(_0x33317d,_0x432d02){if(_0x33317d[_0x436a('0x44')]['id']){delete _0x33317d[_0x436a('0x44')]['id'];}return db['Dynamics365Configuration'][_0x436a('0x42')]({'where':{'id':_0x33317d[_0x436a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x432d02,null))[_0x436a('0x1e')](saveUpdates(_0x33317d[_0x436a('0x44')],null))[_0x436a('0x1e')](respondWithResult(_0x432d02,null))[_0x436a('0x3c')](handleError(_0x432d02,null));};exports[_0x436a('0x1f')]=function(_0x2f2137,_0x4a4e26){return db[_0x436a('0x38')]['find']({'where':{'id':_0x2f2137[_0x436a('0x3e')]['id']}})[_0x436a('0x1e')](handleEntityNotFound(_0x4a4e26,null))[_0x436a('0x1e')](removeEntity(_0x4a4e26,null))[_0x436a('0x3c')](handleError(_0x4a4e26,null));};exports[_0x436a('0x45')]=function(_0x4896f6,_0x20a513,_0x25d746){var _0x8baea0={};var _0x235315={};var _0x4457f8;var _0x4a462f;return db[_0x436a('0x38')]['findOne']({'where':{'id':_0x4896f6[_0x436a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x20a513,null))[_0x436a('0x1e')](function(_0x22ef31){if(_0x22ef31){_0x4457f8=_0x22ef31;_0x235315['model']=_[_0x436a('0x2a')](db['Dynamics365Field'][_0x436a('0x24')]);_0x235315['query']=_[_0x436a('0x2a')](_0x4896f6[_0x436a('0x29')]);_0x235315[_0x436a('0x2b')]=_[_0x436a('0x2c')](_0x235315[_0x436a('0x27')],_0x235315[_0x436a('0x29')]);_0x8baea0[_0x436a('0x2e')]=_[_0x436a('0x2c')](_0x235315[_0x436a('0x27')],qs['fields'](_0x4896f6[_0x436a('0x29')]['fields']));_0x8baea0['attributes']=_0x8baea0[_0x436a('0x2e')]['length']?_0x8baea0[_0x436a('0x2e')]:_0x235315['model'];_0x8baea0['order']=qs[_0x436a('0x31')](_0x4896f6[_0x436a('0x29')][_0x436a('0x31')]);_0x8baea0[_0x436a('0x34')]=qs[_0x436a('0x2b')](_[_0x436a('0x32')](_0x4896f6['query'],_0x235315[_0x436a('0x2b')]));if(_0x4896f6[_0x436a('0x29')][_0x436a('0x33')]){_0x8baea0[_0x436a('0x34')]=_[_0x436a('0x35')](_0x8baea0[_0x436a('0x34')],{'$or':_[_0x436a('0x23')](_0x8baea0[_0x436a('0x2e')],function(_0x2c701c){var _0x20b4d0={};_0x20b4d0[_0x2c701c]={'$like':'%'+_0x4896f6[_0x436a('0x29')][_0x436a('0x33')]+'%'};return _0x20b4d0;})});}_0x8baea0=_[_0x436a('0x35')]({},_0x8baea0,_0x4896f6['options']);return _0x4457f8['getFields'](_0x8baea0);}})[_0x436a('0x1e')](function(_0x539068){if(_0x539068){_0x4a462f=_0x539068[_0x436a('0x3f')];if(!_0x4896f6['query']['hasOwnProperty'](_0x436a('0x30'))){_0x8baea0[_0x436a('0x18')]=qs[_0x436a('0x18')](_0x4896f6[_0x436a('0x29')][_0x436a('0x18')]);_0x8baea0[_0x436a('0x17')]=qs[_0x436a('0x17')](_0x4896f6['query']['offset']);}return _0x4457f8['getFields'](_0x8baea0);}})[_0x436a('0x1e')](function(_0x115e36){if(_0x115e36){return _0x115e36?{'count':_0x4a462f,'rows':_0x115e36}:null;}})[_0x436a('0x1e')](respondWithResult(_0x20a513,null))[_0x436a('0x3c')](handleError(_0x20a513,null));};exports[_0x436a('0x46')]=function(_0x427bb1,_0x1515ba,_0x7f69ae){var _0x5bbf43={};var _0x18fad8={};var _0x1f37d6;var _0x2c6e9c;return db[_0x436a('0x38')][_0x436a('0x47')]({'where':{'id':_0x427bb1[_0x436a('0x3e')]['id']}})[_0x436a('0x1e')](handleEntityNotFound(_0x1515ba,null))[_0x436a('0x1e')](function(_0x267d74){if(_0x267d74){_0x1f37d6=_0x267d74;_0x18fad8[_0x436a('0x27')]=_[_0x436a('0x2a')](db[_0x436a('0x48')][_0x436a('0x24')]);_0x18fad8[_0x436a('0x29')]=_[_0x436a('0x2a')](_0x427bb1[_0x436a('0x29')]);_0x18fad8[_0x436a('0x2b')]=_[_0x436a('0x2c')](_0x18fad8[_0x436a('0x27')],_0x18fad8[_0x436a('0x29')]);_0x5bbf43[_0x436a('0x2e')]=_[_0x436a('0x2c')](_0x18fad8['model'],qs[_0x436a('0x2d')](_0x427bb1[_0x436a('0x29')][_0x436a('0x2d')]));_0x5bbf43[_0x436a('0x2e')]=_0x5bbf43[_0x436a('0x2e')][_0x436a('0x3f')]?_0x5bbf43[_0x436a('0x2e')]:_0x18fad8[_0x436a('0x27')];_0x5bbf43[_0x436a('0x49')]=qs[_0x436a('0x31')](_0x427bb1[_0x436a('0x29')]['sort']);_0x5bbf43[_0x436a('0x34')]=qs[_0x436a('0x2b')](_['pick'](_0x427bb1['query'],_0x18fad8[_0x436a('0x2b')]));if(_0x427bb1[_0x436a('0x29')][_0x436a('0x33')]){_0x5bbf43['where']=_['merge'](_0x5bbf43[_0x436a('0x34')],{'$or':_[_0x436a('0x23')](_0x5bbf43[_0x436a('0x2e')],function(_0x2982ee){var _0x1627b7={};_0x1627b7[_0x2982ee]={'$like':'%'+_0x427bb1[_0x436a('0x29')]['filter']+'%'};return _0x1627b7;})});}_0x5bbf43=_[_0x436a('0x35')]({},_0x5bbf43,_0x427bb1[_0x436a('0x41')]);return _0x1f37d6['getSubjects'](_0x5bbf43);}})[_0x436a('0x1e')](function(_0x137e3e){if(_0x137e3e){_0x2c6e9c=_0x137e3e[_0x436a('0x3f')];if(!_0x427bb1[_0x436a('0x29')][_0x436a('0x2f')](_0x436a('0x30'))){_0x5bbf43[_0x436a('0x18')]=qs[_0x436a('0x18')](_0x427bb1[_0x436a('0x29')]['limit']);_0x5bbf43['offset']=qs[_0x436a('0x17')](_0x427bb1[_0x436a('0x29')][_0x436a('0x17')]);}return _0x1f37d6['getSubjects'](_0x5bbf43);}})['then'](function(_0x1bab9a){if(_0x1bab9a){return _0x1bab9a?{'count':_0x2c6e9c,'rows':_0x1bab9a}:null;}})[_0x436a('0x1e')](respondWithResult(_0x1515ba,null))[_0x436a('0x3c')](handleError(_0x1515ba,null));};exports[_0x436a('0x4a')]=function(_0x4f0474,_0x566202,_0x146703){var _0x2f0997={};var _0x555269={};var _0xc4b2ba;var _0x5dce8e;return db[_0x436a('0x38')][_0x436a('0x47')]({'where':{'id':_0x4f0474[_0x436a('0x3e')]['id']}})[_0x436a('0x1e')](handleEntityNotFound(_0x566202,null))[_0x436a('0x1e')](function(_0x28dbf2){if(_0x28dbf2){_0xc4b2ba=_0x28dbf2;_0x555269['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x555269['query']=_['keys'](_0x4f0474[_0x436a('0x29')]);_0x555269[_0x436a('0x2b')]=_[_0x436a('0x2c')](_0x555269[_0x436a('0x27')],_0x555269['query']);_0x2f0997[_0x436a('0x2e')]=_[_0x436a('0x2c')](_0x555269[_0x436a('0x27')],qs[_0x436a('0x2d')](_0x4f0474[_0x436a('0x29')]['fields']));_0x2f0997['attributes']=_0x2f0997['attributes'][_0x436a('0x3f')]?_0x2f0997[_0x436a('0x2e')]:_0x555269[_0x436a('0x27')];_0x2f0997[_0x436a('0x49')]=qs[_0x436a('0x31')](_0x4f0474[_0x436a('0x29')]['sort']);_0x2f0997[_0x436a('0x34')]=qs[_0x436a('0x2b')](_[_0x436a('0x32')](_0x4f0474[_0x436a('0x29')],_0x555269[_0x436a('0x2b')]));if(_0x4f0474[_0x436a('0x29')][_0x436a('0x33')]){_0x2f0997['where']=_[_0x436a('0x35')](_0x2f0997[_0x436a('0x34')],{'$or':_[_0x436a('0x23')](_0x2f0997[_0x436a('0x2e')],function(_0x47ea59){var _0x13aa39={};_0x13aa39[_0x47ea59]={'$like':'%'+_0x4f0474[_0x436a('0x29')][_0x436a('0x33')]+'%'};return _0x13aa39;})});}_0x2f0997=_['merge']({},_0x2f0997,_0x4f0474[_0x436a('0x41')]);return _0xc4b2ba[_0x436a('0x4a')](_0x2f0997);}})[_0x436a('0x1e')](function(_0x2b92cb){if(_0x2b92cb){_0x5dce8e=_0x2b92cb['length'];if(!_0x4f0474[_0x436a('0x29')][_0x436a('0x2f')](_0x436a('0x30'))){_0x2f0997[_0x436a('0x18')]=qs[_0x436a('0x18')](_0x4f0474['query'][_0x436a('0x18')]);_0x2f0997[_0x436a('0x17')]=qs[_0x436a('0x17')](_0x4f0474[_0x436a('0x29')][_0x436a('0x17')]);}return _0xc4b2ba[_0x436a('0x4a')](_0x2f0997);}})[_0x436a('0x1e')](function(_0x3cb2e3){if(_0x3cb2e3){return _0x3cb2e3?{'count':_0x5dce8e,'rows':_0x3cb2e3}:null;}})[_0x436a('0x1e')](respondWithResult(_0x566202,null))[_0x436a('0x3c')](handleError(_0x566202,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 52ddfda..5c85cb6 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x30d82a,_0x5c8d66){var _0x34340c=function(_0x109342){while(--_0x109342){_0x30d82a['push'](_0x30d82a['shift']());}};_0x34340c(++_0x5c8d66);}(_0xedd9,0xfc));var _0x9edd=function(_0x497d1e,_0x5bb52e){_0x497d1e=_0x497d1e-0x0;var _0x3b70c1=_0xedd9[_0x497d1e];return _0x3b70c1;};'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 +var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x52d868,_0x1bbc8a){var _0x110a32=function(_0x5eceef){while(--_0x5eceef){_0x52d868['push'](_0x52d868['shift']());}};_0x110a32(++_0x1bbc8a);}(_0x54ef,0x112));var _0xf54e=function(_0x2a3f73,_0x666e77){_0x2a3f73=_0x2a3f73-0x0;var _0x3830cb=_0x54ef[_0x2a3f73];return _0x3830cb;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'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 7a9e729..48f92e4 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 _0x2838=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash'];(function(_0x3dd3a7,_0x2bde25){var _0xb8eb11=function(_0x1aefbb){while(--_0x1aefbb){_0x3dd3a7['push'](_0x3dd3a7['shift']());}};_0xb8eb11(++_0x2bde25);}(_0x2838,0x1d0));var _0x8283=function(_0x44799d,_0x26c23a){_0x44799d=_0x44799d-0x0;var _0x4f4a20=_0x2838[_0x44799d];return _0x4f4a20;};'use strict';var _=require(_0x8283('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8283('0x1'));var rs=require(_0x8283('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8283('0x3'));var logger=require(_0x8283('0x4'))(_0x8283('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8283('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2f620a,_0x396ee9,_0x16ac75){return new BPromise(function(_0x53bba6,_0x354f54){return client['request'](_0x2f620a,_0x16ac75)[_0x8283('0x7')](function(_0x18b240){logger[_0x8283('0x8')](_0x8283('0x9'),_0x396ee9,_0x8283('0xa'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x396ee9,'request\x20sent',JSON['stringify'](_0x18b240));if(_0x18b240[_0x8283('0xb')]){if(_0x18b240['error'][_0x8283('0xc')]===0x1f4){logger[_0x8283('0xb')](_0x8283('0x9'),_0x396ee9,_0x18b240[_0x8283('0xb')][_0x8283('0xd')]);return _0x354f54(_0x18b240[_0x8283('0xb')]['message']);}logger[_0x8283('0xb')](_0x8283('0x9'),_0x396ee9,_0x18b240[_0x8283('0xb')][_0x8283('0xd')]);return _0x53bba6(_0x18b240['error']['message']);}else{logger[_0x8283('0x8')](_0x8283('0x9'),_0x396ee9,'request\x20sent');_0x53bba6(_0x18b240[_0x8283('0xe')][_0x8283('0xd')]);}})['catch'](function(_0x3a56e3){logger[_0x8283('0xb')](_0x8283('0x9'),_0x396ee9,_0x3a56e3);_0x354f54(_0x3a56e3);});});} \ No newline at end of file +var _0x244f=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','lodash','util'];(function(_0x5c5456,_0x242b46){var _0x21a6c9=function(_0x2620f7){while(--_0x2620f7){_0x5c5456['push'](_0x5c5456['shift']());}};_0x21a6c9(++_0x242b46);}(_0x244f,0x1c6));var _0xf244=function(_0x28db9b,_0x19fae1){_0x28db9b=_0x28db9b-0x0;var _0x4466bf=_0x244f[_0x28db9b];return _0x4466bf;};'use strict';var _=require(_0xf244('0x0'));var util=require(_0xf244('0x1'));var moment=require(_0xf244('0x2'));var BPromise=require(_0xf244('0x3'));var rs=require(_0xf244('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf244('0x5'));var logger=require(_0xf244('0x6'))(_0xf244('0x7'));var config=require('../../config/environment');var jayson=require(_0xf244('0x8'));var client=jayson[_0xf244('0x9')][_0xf244('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd81eb0,_0x37a91e,_0x3d42ce){return new BPromise(function(_0x53a964,_0x2e1ff3){return client['request'](_0xd81eb0,_0x3d42ce)[_0xf244('0xb')](function(_0x4a880f){logger[_0xf244('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x37a91e,_0xf244('0xd'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x37a91e,_0xf244('0xd'),JSON[_0xf244('0xe')](_0x4a880f));if(_0x4a880f[_0xf244('0xf')]){if(_0x4a880f['error'][_0xf244('0x10')]===0x1f4){logger[_0xf244('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x37a91e,_0x4a880f['error']['message']);return _0x2e1ff3(_0x4a880f['error'][_0xf244('0x11')]);}logger[_0xf244('0xf')](_0xf244('0x12'),_0x37a91e,_0x4a880f[_0xf244('0xf')][_0xf244('0x11')]);return _0x53a964(_0x4a880f[_0xf244('0xf')][_0xf244('0x11')]);}else{logger['info'](_0xf244('0x12'),_0x37a91e,_0xf244('0xd'));_0x53a964(_0x4a880f['result'][_0xf244('0x11')]);}})['catch'](function(_0x401374){logger['error'](_0xf244('0x12'),_0x37a91e,_0x401374);_0x2e1ff3(_0x401374);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index fb8bf4d..2df6c82 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 _0xfcfa=['post','create','/:id','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','show'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xfcfa,0x1c1));var _0xafcf=function(_0x2d4508,_0x44bbc0){_0x2d4508=_0x2d4508-0x0;var _0x3f04bb=_0xfcfa[_0x2d4508];return _0x3f04bb;};'use strict';var multer=require('multer');var util=require(_0xafcf('0x0'));var path=require('path');var timeout=require(_0xafcf('0x1'));var express=require(_0xafcf('0x2'));var router=express['Router']();var fs_extra=require(_0xafcf('0x3'));var auth=require(_0xafcf('0x4'));var interaction=require(_0xafcf('0x5'));var config=require(_0xafcf('0x6'));var controller=require(_0xafcf('0x7'));router['get']('/',auth[_0xafcf('0x8')](),controller['index']);router['get']('/:id',auth[_0xafcf('0x8')](),controller[_0xafcf('0x9')]);router[_0xafcf('0xa')]('/',auth[_0xafcf('0x8')](),controller[_0xafcf('0xb')]);router['put'](_0xafcf('0xc'),auth['isAuthenticated'](),controller[_0xafcf('0xd')]);router[_0xafcf('0xe')](_0xafcf('0xc'),auth[_0xafcf('0x8')](),controller[_0xafcf('0xf')]);module[_0xafcf('0x10')]=router; \ No newline at end of file +var _0xf7b6=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x15fc7a,_0xd21741){var _0x3aa9f4=function(_0x313108){while(--_0x313108){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x3aa9f4(++_0xd21741);}(_0xf7b6,0x1b9));var _0x6f7b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf7b6[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x6f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6f7b('0x1'));var express=require(_0x6f7b('0x2'));var router=express[_0x6f7b('0x3')]();var fs_extra=require(_0x6f7b('0x4'));var auth=require(_0x6f7b('0x5'));var interaction=require(_0x6f7b('0x6'));var config=require('../../config/environment');var controller=require(_0x6f7b('0x7'));router[_0x6f7b('0x8')]('/',auth['isAuthenticated'](),controller[_0x6f7b('0x9')]);router[_0x6f7b('0x8')]('/:id',auth[_0x6f7b('0xa')](),controller[_0x6f7b('0xb')]);router[_0x6f7b('0xc')]('/',auth[_0x6f7b('0xa')](),controller[_0x6f7b('0xd')]);router[_0x6f7b('0xe')](_0x6f7b('0xf'),auth[_0x6f7b('0xa')](),controller[_0x6f7b('0x10')]);router[_0x6f7b('0x11')]('/:id',auth[_0x6f7b('0xa')](),controller[_0x6f7b('0x12')]);module[_0x6f7b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index b89a41d..4766d91 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 _0x34ff=['customVariable','sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING'];(function(_0x35f1de,_0x2623ca){var _0x1e93ad=function(_0x3e1591){while(--_0x3e1591){_0x35f1de['push'](_0x35f1de['shift']());}};_0x1e93ad(++_0x2623ca);}(_0x34ff,0x19f));var _0xf34f=function(_0xf2e1f0,_0x135cf5){_0xf2e1f0=_0xf2e1f0-0x0;var _0x1e7c97=_0x34ff[_0xf2e1f0];return _0x1e7c97;};'use strict';var Sequelize=require(_0xf34f('0x0'));module[_0xf34f('0x1')]={'type':{'type':Sequelize[_0xf34f('0x2')]('string',_0xf34f('0x3'),'customVariable',_0xf34f('0x4'),_0xf34f('0x5')),'defaultValue':_0xf34f('0x6')},'content':{'type':Sequelize[_0xf34f('0x7')]},'key':{'type':Sequelize[_0xf34f('0x7')]},'keyType':{'type':Sequelize[_0xf34f('0x2')](_0xf34f('0x6'),_0xf34f('0x3'),_0xf34f('0x8'))},'keyContent':{'type':Sequelize[_0xf34f('0x7')]},'idField':{'type':Sequelize[_0xf34f('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x01fc=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x20be2e,_0x3c1a0d){var _0x67e1ca=function(_0x48e37b){while(--_0x48e37b){_0x20be2e['push'](_0x20be2e['shift']());}};_0x67e1ca(++_0x3c1a0d);}(_0x01fc,0x76));var _0xc01f=function(_0x3f0aad,_0x17c710){_0x3f0aad=_0x3f0aad-0x0;var _0x36802a=_0x01fc[_0x3f0aad];return _0x36802a;};'use strict';var Sequelize=require(_0xc01f('0x0'));module[_0xc01f('0x1')]={'type':{'type':Sequelize[_0xc01f('0x2')](_0xc01f('0x3'),_0xc01f('0x4'),_0xc01f('0x5'),_0xc01f('0x6'),_0xc01f('0x7')),'defaultValue':_0xc01f('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc01f('0x8')]},'keyType':{'type':Sequelize[_0xc01f('0x2')](_0xc01f('0x3'),_0xc01f('0x4'),_0xc01f('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc01f('0x8')]},'nameField':{'type':Sequelize[_0xc01f('0x8')]},'customField':{'type':Sequelize[_0xc01f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 02f51a5..3e2b782 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 _0x876a=['json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','Dynamics365Field','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x2c7564,_0x31383f){var _0x216784=function(_0x276ee3){while(--_0x276ee3){_0x2c7564['push'](_0x2c7564['shift']());}};_0x216784(++_0x31383f);}(_0x876a,0x14a));var _0xa876=function(_0x2ad9a1,_0x58bd00){_0x2ad9a1=_0x2ad9a1-0x0;var _0x960891=_0x876a[_0x2ad9a1];return _0x960891;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa876('0x0'));var zipdir=require(_0xa876('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa876('0x2'));var moment=require(_0xa876('0x3'));var BPromise=require(_0xa876('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa876('0x5'));var sox=require('sox');var csv=require(_0xa876('0x6'));var ejs=require(_0xa876('0x7'));var fs=require('fs');var fs_extra=require(_0xa876('0x8'));var _=require(_0xa876('0x9'));var squel=require(_0xa876('0xa'));var crypto=require(_0xa876('0xb'));var jsforce=require(_0xa876('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa876('0xd'));var Papa=require(_0xa876('0xe'));var Redis=require(_0xa876('0xf'));var authService=require(_0xa876('0x10'));var qs=require(_0xa876('0x11'));var as=require(_0xa876('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa876('0x13'));var utils=require(_0xa876('0x14'));var config=require(_0xa876('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x397868,_0x1d8f2c){_0x1d8f2c=_0x1d8f2c||0xcc;return function(_0x31a87f){if(_0x31a87f){return _0x397868[_0xa876('0x16')](_0x1d8f2c);}return _0x397868[_0xa876('0x17')](_0x1d8f2c)[_0xa876('0x18')]();};}function respondWithResult(_0x16a8f3,_0x1c8ebf){_0x1c8ebf=_0x1c8ebf||0xc8;return function(_0x794a45){if(_0x794a45){return _0x16a8f3[_0xa876('0x17')](_0x1c8ebf)[_0xa876('0x19')](_0x794a45);}};}function respondWithFilteredResult(_0x48dd4e,_0x501425){return function(_0x287c23){if(_0x287c23){var _0x360b19=typeof _0x501425[_0xa876('0x1a')]===_0xa876('0x1b')&&typeof _0x501425['limit']===_0xa876('0x1b');var _0x179603=_0x287c23[_0xa876('0x1c')];var _0x5e5fd5=_0x360b19?0x0:_0x501425['offset'];var _0x3ec4c8=_0x360b19?_0x287c23[_0xa876('0x1c')]:_0x501425[_0xa876('0x1a')]+_0x501425[_0xa876('0x1d')];var _0x333a5e;if(_0x3ec4c8>=_0x179603){_0x3ec4c8=_0x179603;_0x333a5e=0xc8;}else{_0x333a5e=0xce;}_0x48dd4e[_0xa876('0x17')](_0x333a5e);return _0x48dd4e[_0xa876('0x1e')](_0xa876('0x1f'),_0x5e5fd5+'-'+_0x3ec4c8+'/'+_0x179603)[_0xa876('0x19')](_0x287c23);}return null;};}function patchUpdates(_0x1e593a){return function(_0x3ba79d){try{jsonpatch[_0xa876('0x20')](_0x3ba79d,_0x1e593a,!![]);}catch(_0x17db73){return BPromise['reject'](_0x17db73);}return _0x3ba79d[_0xa876('0x21')]();};}function saveUpdates(_0x4a17f8,_0x4fc2c2){return function(_0x470c0e){if(_0x470c0e){return _0x470c0e[_0xa876('0x22')](_0x4a17f8)[_0xa876('0x23')](function(_0x2045f8){return _0x2045f8;});}return null;};}function removeEntity(_0x10fd98,_0x3609c3){return function(_0x5f1802){if(_0x5f1802){return _0x5f1802[_0xa876('0x24')]()[_0xa876('0x23')](function(){_0x10fd98[_0xa876('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26026b,_0x5571d9){return function(_0x4f7824){if(!_0x4f7824){_0x26026b[_0xa876('0x16')](0x194);}return _0x4f7824;};}function handleError(_0x2fa13d,_0x4265a7){_0x4265a7=_0x4265a7||0x1f4;return function(_0x3df598){logger[_0xa876('0x25')](_0x3df598['stack']);if(_0x3df598[_0xa876('0x26')]){delete _0x3df598[_0xa876('0x26')];}_0x2fa13d[_0xa876('0x17')](_0x4265a7)[_0xa876('0x27')](_0x3df598);};}exports[_0xa876('0x28')]=function(_0x294778,_0x122013){var _0x17ecc9={},_0x45fdb5={},_0x4dfe32={'count':0x0,'rows':[]};var _0x1c26dd=_[_0xa876('0x29')](db[_0xa876('0x2a')]['rawAttributes'],function(_0x29adb9){return{'name':_0x29adb9['fieldName'],'type':_0x29adb9[_0xa876('0x2b')]['key']};});_0x45fdb5['model']=_[_0xa876('0x29')](_0x1c26dd,_0xa876('0x26'));_0x45fdb5[_0xa876('0x2c')]=_[_0xa876('0x2d')](_0x294778['query']);_0x45fdb5[_0xa876('0x2e')]=_[_0xa876('0x2f')](_0x45fdb5['model'],_0x45fdb5[_0xa876('0x2c')]);_0x17ecc9[_0xa876('0x30')]=_[_0xa876('0x2f')](_0x45fdb5[_0xa876('0x31')],qs[_0xa876('0x32')](_0x294778[_0xa876('0x2c')]['fields']));_0x17ecc9[_0xa876('0x30')]=_0x17ecc9[_0xa876('0x30')][_0xa876('0x33')]?_0x17ecc9['attributes']:_0x45fdb5['model'];if(!_0x294778['query'][_0xa876('0x34')](_0xa876('0x35'))){_0x17ecc9[_0xa876('0x1d')]=qs[_0xa876('0x1d')](_0x294778[_0xa876('0x2c')]['limit']);_0x17ecc9[_0xa876('0x1a')]=qs[_0xa876('0x1a')](_0x294778['query']['offset']);}_0x17ecc9[_0xa876('0x36')]=qs[_0xa876('0x37')](_0x294778['query'][_0xa876('0x37')]);_0x17ecc9['where']=qs[_0xa876('0x2e')](_['pick'](_0x294778['query'],_0x45fdb5[_0xa876('0x2e')]),_0x1c26dd);if(_0x294778[_0xa876('0x2c')]['filter']){_0x17ecc9[_0xa876('0x38')]=_[_0xa876('0x39')](_0x17ecc9[_0xa876('0x38')],{'$or':_[_0xa876('0x29')](_0x1c26dd,function(_0x291165){if(_0x291165[_0xa876('0x2b')]!==_0xa876('0x3a')){var _0x5e87a5={};_0x5e87a5[_0x291165[_0xa876('0x26')]]={'$like':'%'+_0x294778[_0xa876('0x2c')][_0xa876('0x3b')]+'%'};return _0x5e87a5;}})});}_0x17ecc9=_[_0xa876('0x39')]({},_0x17ecc9,_0x294778['options']);var _0x2f4eb7={'where':_0x17ecc9['where']};return db[_0xa876('0x2a')]['count'](_0x2f4eb7)[_0xa876('0x23')](function(_0x9807be){_0x4dfe32[_0xa876('0x1c')]=_0x9807be;if(_0x294778[_0xa876('0x2c')][_0xa876('0x3c')]){_0x17ecc9['include']=[{'all':!![]}];}return db[_0xa876('0x2a')][_0xa876('0x3d')](_0x17ecc9);})[_0xa876('0x23')](function(_0x37f4f7){_0x4dfe32[_0xa876('0x3e')]=_0x37f4f7;return _0x4dfe32;})['then'](respondWithFilteredResult(_0x122013,_0x17ecc9))[_0xa876('0x3f')](handleError(_0x122013,null));};exports[_0xa876('0x40')]=function(_0x5ce88c,_0x5c5770){var _0x1009e7={'raw':!![],'where':{'id':_0x5ce88c[_0xa876('0x41')]['id']}},_0x10d834={};_0x10d834['model']=_[_0xa876('0x2d')](db[_0xa876('0x2a')][_0xa876('0x42')]);_0x10d834[_0xa876('0x2c')]=_['keys'](_0x5ce88c[_0xa876('0x2c')]);_0x10d834[_0xa876('0x2e')]=_[_0xa876('0x2f')](_0x10d834[_0xa876('0x31')],_0x10d834['query']);_0x1009e7[_0xa876('0x30')]=_[_0xa876('0x2f')](_0x10d834[_0xa876('0x31')],qs[_0xa876('0x32')](_0x5ce88c[_0xa876('0x2c')][_0xa876('0x32')]));_0x1009e7[_0xa876('0x30')]=_0x1009e7[_0xa876('0x30')][_0xa876('0x33')]?_0x1009e7[_0xa876('0x30')]:_0x10d834['model'];if(_0x5ce88c[_0xa876('0x2c')][_0xa876('0x3c')]){_0x1009e7['include']=[{'all':!![]}];}_0x1009e7=_['merge']({},_0x1009e7,_0x5ce88c[_0xa876('0x43')]);return db[_0xa876('0x2a')][_0xa876('0x44')](_0x1009e7)[_0xa876('0x23')](handleEntityNotFound(_0x5c5770,null))[_0xa876('0x23')](respondWithResult(_0x5c5770,null))[_0xa876('0x3f')](handleError(_0x5c5770,null));};exports[_0xa876('0x45')]=function(_0x3ebbd7,_0x1ac80e){return db[_0xa876('0x2a')][_0xa876('0x45')](_0x3ebbd7[_0xa876('0x46')],{})['then'](respondWithResult(_0x1ac80e,0xc9))[_0xa876('0x3f')](handleError(_0x1ac80e,null));};exports[_0xa876('0x22')]=function(_0x335c74,_0x528dd6){if(_0x335c74[_0xa876('0x46')]['id']){delete _0x335c74[_0xa876('0x46')]['id'];}return db[_0xa876('0x2a')]['find']({'where':{'id':_0x335c74[_0xa876('0x41')]['id']}})[_0xa876('0x23')](handleEntityNotFound(_0x528dd6,null))[_0xa876('0x23')](saveUpdates(_0x335c74[_0xa876('0x46')],null))[_0xa876('0x23')](respondWithResult(_0x528dd6,null))['catch'](handleError(_0x528dd6,null));};exports[_0xa876('0x24')]=function(_0x1b51f6,_0xe3da67){return db['Dynamics365Field'][_0xa876('0x44')]({'where':{'id':_0x1b51f6['params']['id']}})[_0xa876('0x23')](handleEntityNotFound(_0xe3da67,null))[_0xa876('0x23')](removeEntity(_0xe3da67,null))['catch'](handleError(_0xe3da67,null));}; \ No newline at end of file +var _0x3382=['name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','Dynamics365Field','findAll','rows','catch','show','params','includeAll','include','find','create','body','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','then','error','stack'];(function(_0xd27c76,_0xe3946){var _0x383b58=function(_0x6fb710){while(--_0x6fb710){_0xd27c76['push'](_0xd27c76['shift']());}};_0x383b58(++_0xe3946);}(_0x3382,0x14f));var _0x2338=function(_0xfb7c58,_0x4387b8){_0xfb7c58=_0xfb7c58-0x0;var _0x1df090=_0x3382[_0xfb7c58];return _0x1df090;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2338('0x0'));var zipdir=require(_0x2338('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2338('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2338('0x3'));var util=require(_0x2338('0x4'));var path=require(_0x2338('0x5'));var sox=require('sox');var csv=require(_0x2338('0x6'));var ejs=require(_0x2338('0x7'));var fs=require('fs');var fs_extra=require(_0x2338('0x8'));var _=require(_0x2338('0x9'));var squel=require(_0x2338('0xa'));var crypto=require(_0x2338('0xb'));var jsforce=require(_0x2338('0xc'));var deskjs=require(_0x2338('0xd'));var toCsv=require(_0x2338('0x6'));var querystring=require(_0x2338('0xe'));var Papa=require('papaparse');var Redis=require(_0x2338('0xf'));var authService=require(_0x2338('0x10'));var qs=require(_0x2338('0x11'));var as=require(_0x2338('0x12'));var hardwareService=require(_0x2338('0x13'));var logger=require(_0x2338('0x14'))(_0x2338('0x15'));var utils=require('../../config/utils');var config=require(_0x2338('0x16'));var licenseUtil=require(_0x2338('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc9e116,_0x1a4d38){_0x1a4d38=_0x1a4d38||0xcc;return function(_0x2e7693){if(_0x2e7693){return _0xc9e116[_0x2338('0x18')](_0x1a4d38);}return _0xc9e116['status'](_0x1a4d38)[_0x2338('0x19')]();};}function respondWithResult(_0x2e1b9,_0x23d1ef){_0x23d1ef=_0x23d1ef||0xc8;return function(_0x18953b){if(_0x18953b){return _0x2e1b9[_0x2338('0x1a')](_0x23d1ef)[_0x2338('0x1b')](_0x18953b);}};}function respondWithFilteredResult(_0x195550,_0x1c9efa){return function(_0x5e675d){if(_0x5e675d){var _0x544e75=typeof _0x1c9efa[_0x2338('0x1c')]==='undefined'&&typeof _0x1c9efa['limit']===_0x2338('0x1d');var _0x2dc6d1=_0x5e675d[_0x2338('0x1e')];var _0x150bb3=_0x544e75?0x0:_0x1c9efa[_0x2338('0x1c')];var _0x3a75e1=_0x544e75?_0x5e675d['count']:_0x1c9efa['offset']+_0x1c9efa[_0x2338('0x1f')];var _0x3eac6a;if(_0x3a75e1>=_0x2dc6d1){_0x3a75e1=_0x2dc6d1;_0x3eac6a=0xc8;}else{_0x3eac6a=0xce;}_0x195550[_0x2338('0x1a')](_0x3eac6a);return _0x195550['set'](_0x2338('0x20'),_0x150bb3+'-'+_0x3a75e1+'/'+_0x2dc6d1)[_0x2338('0x1b')](_0x5e675d);}return null;};}function patchUpdates(_0x5560bc){return function(_0x3be058){try{jsonpatch['apply'](_0x3be058,_0x5560bc,!![]);}catch(_0x1c800b){return BPromise[_0x2338('0x21')](_0x1c800b);}return _0x3be058[_0x2338('0x22')]();};}function saveUpdates(_0x494c08,_0x38d257){return function(_0xecaa41){if(_0xecaa41){return _0xecaa41[_0x2338('0x23')](_0x494c08)['then'](function(_0x2388c1){return _0x2388c1;});}return null;};}function removeEntity(_0xe75e24,_0x5d405a){return function(_0x273ce0){if(_0x273ce0){return _0x273ce0[_0x2338('0x24')]()[_0x2338('0x25')](function(){_0xe75e24[_0x2338('0x1a')](0xcc)[_0x2338('0x19')]();});}};}function handleEntityNotFound(_0xd4bc78,_0x35bda8){return function(_0x59db15){if(!_0x59db15){_0xd4bc78[_0x2338('0x18')](0x194);}return _0x59db15;};}function handleError(_0x23e142,_0x2d16cc){_0x2d16cc=_0x2d16cc||0x1f4;return function(_0x2c1734){logger[_0x2338('0x26')](_0x2c1734[_0x2338('0x27')]);if(_0x2c1734['name']){delete _0x2c1734[_0x2338('0x28')];}_0x23e142[_0x2338('0x1a')](_0x2d16cc)[_0x2338('0x29')](_0x2c1734);};}exports[_0x2338('0x2a')]=function(_0x3c1d75,_0x29006a){var _0x51db50={},_0x258cd7={},_0x4c3405={'count':0x0,'rows':[]};var _0x4c6a50=_[_0x2338('0x2b')](db['Dynamics365Field'][_0x2338('0x2c')],function(_0x1c7228){return{'name':_0x1c7228[_0x2338('0x2d')],'type':_0x1c7228[_0x2338('0x2e')][_0x2338('0x2f')]};});_0x258cd7[_0x2338('0x30')]=_[_0x2338('0x2b')](_0x4c6a50,_0x2338('0x28'));_0x258cd7[_0x2338('0x31')]=_[_0x2338('0x32')](_0x3c1d75[_0x2338('0x31')]);_0x258cd7[_0x2338('0x33')]=_[_0x2338('0x34')](_0x258cd7[_0x2338('0x30')],_0x258cd7[_0x2338('0x31')]);_0x51db50[_0x2338('0x35')]=_[_0x2338('0x34')](_0x258cd7['model'],qs[_0x2338('0x36')](_0x3c1d75['query'][_0x2338('0x36')]));_0x51db50[_0x2338('0x35')]=_0x51db50[_0x2338('0x35')][_0x2338('0x37')]?_0x51db50[_0x2338('0x35')]:_0x258cd7[_0x2338('0x30')];if(!_0x3c1d75[_0x2338('0x31')][_0x2338('0x38')](_0x2338('0x39'))){_0x51db50['limit']=qs[_0x2338('0x1f')](_0x3c1d75[_0x2338('0x31')][_0x2338('0x1f')]);_0x51db50['offset']=qs['offset'](_0x3c1d75['query']['offset']);}_0x51db50['order']=qs['sort'](_0x3c1d75[_0x2338('0x31')][_0x2338('0x3a')]);_0x51db50[_0x2338('0x3b')]=qs['filters'](_['pick'](_0x3c1d75[_0x2338('0x31')],_0x258cd7[_0x2338('0x33')]),_0x4c6a50);if(_0x3c1d75[_0x2338('0x31')][_0x2338('0x3c')]){_0x51db50[_0x2338('0x3b')]=_['merge'](_0x51db50[_0x2338('0x3b')],{'$or':_[_0x2338('0x2b')](_0x4c6a50,function(_0x8b28d8){if(_0x8b28d8[_0x2338('0x2e')]!==_0x2338('0x3d')){var _0x2b805f={};_0x2b805f[_0x8b28d8['name']]={'$like':'%'+_0x3c1d75['query'][_0x2338('0x3c')]+'%'};return _0x2b805f;}})});}_0x51db50=_[_0x2338('0x3e')]({},_0x51db50,_0x3c1d75[_0x2338('0x3f')]);var _0x43118d={'where':_0x51db50['where']};return db[_0x2338('0x40')]['count'](_0x43118d)['then'](function(_0x1728b4){_0x4c3405[_0x2338('0x1e')]=_0x1728b4;if(_0x3c1d75['query']['includeAll']){_0x51db50['include']=[{'all':!![]}];}return db[_0x2338('0x40')][_0x2338('0x41')](_0x51db50);})['then'](function(_0x297ec8){_0x4c3405[_0x2338('0x42')]=_0x297ec8;return _0x4c3405;})[_0x2338('0x25')](respondWithFilteredResult(_0x29006a,_0x51db50))[_0x2338('0x43')](handleError(_0x29006a,null));};exports[_0x2338('0x44')]=function(_0x4dc458,_0x5699e5){var _0x3c4aef={'raw':!![],'where':{'id':_0x4dc458[_0x2338('0x45')]['id']}},_0x473711={};_0x473711['model']=_['keys'](db[_0x2338('0x40')][_0x2338('0x2c')]);_0x473711[_0x2338('0x31')]=_[_0x2338('0x32')](_0x4dc458[_0x2338('0x31')]);_0x473711[_0x2338('0x33')]=_[_0x2338('0x34')](_0x473711[_0x2338('0x30')],_0x473711[_0x2338('0x31')]);_0x3c4aef['attributes']=_[_0x2338('0x34')](_0x473711[_0x2338('0x30')],qs[_0x2338('0x36')](_0x4dc458[_0x2338('0x31')]['fields']));_0x3c4aef['attributes']=_0x3c4aef['attributes'][_0x2338('0x37')]?_0x3c4aef['attributes']:_0x473711[_0x2338('0x30')];if(_0x4dc458[_0x2338('0x31')][_0x2338('0x46')]){_0x3c4aef[_0x2338('0x47')]=[{'all':!![]}];}_0x3c4aef=_['merge']({},_0x3c4aef,_0x4dc458[_0x2338('0x3f')]);return db[_0x2338('0x40')][_0x2338('0x48')](_0x3c4aef)['then'](handleEntityNotFound(_0x5699e5,null))['then'](respondWithResult(_0x5699e5,null))[_0x2338('0x43')](handleError(_0x5699e5,null));};exports[_0x2338('0x49')]=function(_0x14c3e8,_0x47b4e9){return db[_0x2338('0x40')]['create'](_0x14c3e8[_0x2338('0x4a')],{})[_0x2338('0x25')](respondWithResult(_0x47b4e9,0xc9))[_0x2338('0x43')](handleError(_0x47b4e9,null));};exports['update']=function(_0x407e92,_0x45216e){if(_0x407e92[_0x2338('0x4a')]['id']){delete _0x407e92[_0x2338('0x4a')]['id'];}return db[_0x2338('0x40')][_0x2338('0x48')]({'where':{'id':_0x407e92[_0x2338('0x45')]['id']}})[_0x2338('0x25')](handleEntityNotFound(_0x45216e,null))[_0x2338('0x25')](saveUpdates(_0x407e92[_0x2338('0x4a')],null))[_0x2338('0x25')](respondWithResult(_0x45216e,null))[_0x2338('0x43')](handleError(_0x45216e,null));};exports[_0x2338('0x24')]=function(_0x5352a7,_0x4aec6f){return db[_0x2338('0x40')]['find']({'where':{'id':_0x5352a7[_0x2338('0x45')]['id']}})[_0x2338('0x25')](handleEntityNotFound(_0x4aec6f,null))['then'](removeEntity(_0x4aec6f,null))[_0x2338('0x43')](handleError(_0x4aec6f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 81a1c6a..6a14791 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 _0xc20d=['moment','bluebird','rimraf','../../config/environment','./intDynamics365Field.attributes','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xc20d,0x1e8));var _0xdc20=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xc20d[_0x999b85];return _0x1d7124;};'use strict';var _=require(_0xdc20('0x0'));var util=require(_0xdc20('0x1'));var logger=require(_0xdc20('0x2'))(_0xdc20('0x3'));var moment=require(_0xdc20('0x4'));var BPromise=require(_0xdc20('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdc20('0x6'));var config=require(_0xdc20('0x7'));var attributes=require(_0xdc20('0x8'));module['exports']=function(_0x111ab5,_0x469163){return _0x111ab5['define']('Dynamics365Field',attributes,{'tableName':_0xdc20('0x9'),'paranoid':![],'indexes':[{'name':_0xdc20('0xa'),'fields':['idField',_0xdc20('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdad0=['rimraf','../../config/environment','exports','define','int_dynamics365_fields','dynamics365_unique_index','util','bluebird','request-promise'];(function(_0x4db799,_0x512b9e){var _0x5365a9=function(_0x449e90){while(--_0x449e90){_0x4db799['push'](_0x4db799['shift']());}};_0x5365a9(++_0x512b9e);}(_0xdad0,0x102));var _0x0dad=function(_0x4d415a,_0x209743){_0x4d415a=_0x4d415a-0x0;var _0x18375d=_0xdad0[_0x4d415a];return _0x18375d;};'use strict';var _=require('lodash');var util=require(_0x0dad('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0dad('0x1'));var rp=require(_0x0dad('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0dad('0x3'));var config=require(_0x0dad('0x4'));var attributes=require('./intDynamics365Field.attributes');module[_0x0dad('0x5')]=function(_0x5bcac8,_0x3af6cb){return _0x5bcac8[_0x0dad('0x6')]('Dynamics365Field',attributes,{'tableName':_0x0dad('0x7'),'paranoid':![],'indexes':[{'name':_0x0dad('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 3274c45..a112981 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 _0xa5e6=['../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5e6,0x109));var _0x6a5e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xa5e6[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x6a5e('0x0'));var util=require(_0x6a5e('0x1'));var moment=require('moment');var BPromise=require(_0x6a5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a5e('0x3'));var db=require(_0x6a5e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6a5e('0x5'));var jayson=require(_0x6a5e('0x6'));var client=jayson[_0x6a5e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37710b,_0x32dfd2,_0x3e8ef1){return new BPromise(function(_0x53f1d8,_0x11179f){return client[_0x6a5e('0x8')](_0x37710b,_0x3e8ef1)[_0x6a5e('0x9')](function(_0x555a5d){logger[_0x6a5e('0xa')](_0x6a5e('0xb'),_0x32dfd2,_0x6a5e('0xc'));logger[_0x6a5e('0xd')](_0x6a5e('0xe'),_0x32dfd2,_0x6a5e('0xc'),JSON['stringify'](_0x555a5d));if(_0x555a5d[_0x6a5e('0xf')]){if(_0x555a5d['error'][_0x6a5e('0x10')]===0x1f4){logger['error'](_0x6a5e('0xb'),_0x32dfd2,_0x555a5d[_0x6a5e('0xf')]['message']);return _0x11179f(_0x555a5d[_0x6a5e('0xf')][_0x6a5e('0x11')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x32dfd2,_0x555a5d[_0x6a5e('0xf')][_0x6a5e('0x11')]);return _0x53f1d8(_0x555a5d['error'][_0x6a5e('0x11')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x32dfd2,_0x6a5e('0xc'));_0x53f1d8(_0x555a5d['result'][_0x6a5e('0x11')]);}})['catch'](function(_0xf5b9a0){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x32dfd2,_0xf5b9a0);_0x11179f(_0xf5b9a0);});});} \ No newline at end of file +var _0x6a50=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash'];(function(_0x25fef3,_0x2238b0){var _0x5d9ea1=function(_0x1b469e){while(--_0x1b469e){_0x25fef3['push'](_0x25fef3['shift']());}};_0x5d9ea1(++_0x2238b0);}(_0x6a50,0xd1));var _0x06a5=function(_0x3c9310,_0x58f0c7){_0x3c9310=_0x3c9310-0x0;var _0x24e56c=_0x6a50[_0x3c9310];return _0x24e56c;};'use strict';var _=require(_0x06a5('0x0'));var util=require(_0x06a5('0x1'));var moment=require(_0x06a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x06a5('0x3'));var fs=require('fs');var Redis=require(_0x06a5('0x4'));var db=require(_0x06a5('0x5'))['db'];var utils=require(_0x06a5('0x6'));var logger=require(_0x06a5('0x7'))(_0x06a5('0x8'));var config=require(_0x06a5('0x9'));var jayson=require(_0x06a5('0xa'));var client=jayson[_0x06a5('0xb')][_0x06a5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x582542,_0x1f865e,_0x2f282b){return new BPromise(function(_0x339afb,_0x361ad8){return client['request'](_0x582542,_0x2f282b)[_0x06a5('0xd')](function(_0x453a34){logger['info'](_0x06a5('0xe'),_0x1f865e,_0x06a5('0xf'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1f865e,_0x06a5('0xf'),JSON[_0x06a5('0x10')](_0x453a34));if(_0x453a34[_0x06a5('0x11')]){if(_0x453a34['error']['code']===0x1f4){logger[_0x06a5('0x11')](_0x06a5('0xe'),_0x1f865e,_0x453a34[_0x06a5('0x11')][_0x06a5('0x12')]);return _0x361ad8(_0x453a34['error'][_0x06a5('0x12')]);}logger[_0x06a5('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x1f865e,_0x453a34['error'][_0x06a5('0x12')]);return _0x339afb(_0x453a34['error'][_0x06a5('0x12')]);}else{logger[_0x06a5('0x13')](_0x06a5('0xe'),_0x1f865e,_0x06a5('0xf'));_0x339afb(_0x453a34[_0x06a5('0x14')]['message']);}})['catch'](function(_0xfecfd6){logger[_0x06a5('0x11')](_0x06a5('0xe'),_0x1f865e,_0xfecfd6);_0x361ad8(_0xfecfd6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index fe6f4f6..d2b9ac6 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 _0xb86d=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x4a5046,_0x5b1d8e){var _0x3c3b34=function(_0x2a4d0b){while(--_0x2a4d0b){_0x4a5046['push'](_0x4a5046['shift']());}};_0x3c3b34(++_0x5b1d8e);}(_0xb86d,0x12f));var _0xdb86=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xb86d[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xdb86('0x0'));var util=require('util');var path=require(_0xdb86('0x1'));var timeout=require(_0xdb86('0x2'));var express=require(_0xdb86('0x3'));var router=express['Router']();var fs_extra=require(_0xdb86('0x4'));var auth=require(_0xdb86('0x5'));var interaction=require(_0xdb86('0x6'));var config=require('../../config/environment');var controller=require(_0xdb86('0x7'));router[_0xdb86('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdb86('0x8')](_0xdb86('0x9'),auth[_0xdb86('0xa')](),controller['show']);router[_0xdb86('0x8')](_0xdb86('0xb'),auth['isAuthenticated'](),controller[_0xdb86('0xc')]);router[_0xdb86('0x8')](_0xdb86('0xd'),auth[_0xdb86('0xa')](),controller[_0xdb86('0xe')]);router[_0xdb86('0xf')]('/',auth['isAuthenticated'](),controller[_0xdb86('0x10')]);router[_0xdb86('0xf')](_0xdb86('0xb'),auth[_0xdb86('0xa')](),controller[_0xdb86('0x11')]);router[_0xdb86('0x12')](_0xdb86('0x9'),auth[_0xdb86('0xa')](),controller[_0xdb86('0x13')]);router[_0xdb86('0x14')](_0xdb86('0x9'),auth[_0xdb86('0xa')](),controller[_0xdb86('0x15')]);module[_0xdb86('0x16')]=router; \ No newline at end of file +var _0x5df7=['index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x39145b,_0x1ca213){var _0x3a94c5=function(_0x130d39){while(--_0x130d39){_0x39145b['push'](_0x39145b['shift']());}};_0x3a94c5(++_0x1ca213);}(_0x5df7,0x1f3));var _0x75df=function(_0x442187,_0x5bcb33){_0x442187=_0x442187-0x0;var _0x2874a3=_0x5df7[_0x442187];return _0x2874a3;};'use strict';var multer=require(_0x75df('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x75df('0x1'));var express=require('express');var router=express[_0x75df('0x2')]();var fs_extra=require(_0x75df('0x3'));var auth=require(_0x75df('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x75df('0x5'));var controller=require(_0x75df('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x75df('0x7')]);router[_0x75df('0x8')](_0x75df('0x9'),auth[_0x75df('0xa')](),controller[_0x75df('0xb')]);router[_0x75df('0x8')](_0x75df('0xc'),auth[_0x75df('0xa')](),controller[_0x75df('0xd')]);router[_0x75df('0x8')](_0x75df('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x75df('0xf')]('/',auth[_0x75df('0xa')](),controller['create']);router[_0x75df('0xf')](_0x75df('0xc'),auth[_0x75df('0xa')](),controller[_0x75df('0x10')]);router[_0x75df('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x75df('0x12')]);router[_0x75df('0x13')](_0x75df('0x9'),auth[_0x75df('0xa')](),controller[_0x75df('0x14')]);module[_0x75df('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 92c09c0..3ed9c4c 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 _0x2032=['remoteUri','exports','STRING','username'];(function(_0x4a47e7,_0x579f07){var _0x40d57d=function(_0x245e04){while(--_0x245e04){_0x4a47e7['push'](_0x4a47e7['shift']());}};_0x40d57d(++_0x579f07);}(_0x2032,0xd9));var _0x2203=function(_0x3c394e,_0xf15fa8){_0x3c394e=_0x3c394e-0x0;var _0x11ec0c=_0x2032[_0x3c394e];return _0x11ec0c;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2203('0x2')},'apiKey':{'type':Sequelize[_0x2203('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2203('0x3')},'serverUrl':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0adf=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x1a4385,_0x27f856){_0x1a4385=_0x1a4385-0x0;var _0x128404=_0x0adf[_0x1a4385];return _0x128404;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x3')},'apiKey':{'type':Sequelize[_0xf0ad('0x2')]},'remoteUri':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x4')},'serverUrl':{'type':Sequelize[_0xf0ad('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index d6c56c1..ea31a26 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 _0x340c=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','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','end','json','offset','undefined','limit','apply','reject','save','update','then','destroy','error','stack','send','index','map','FreshdeskAccount','rawAttributes','fieldName','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','type','count','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','getConfigurations','pick','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','subject','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x3a34e1,_0x3b070f){var _0x28934e=function(_0x125773){while(--_0x125773){_0x3a34e1['push'](_0x3a34e1['shift']());}};_0x28934e(++_0x3b070f);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc340('0x0'));var rimraf=require(_0xc340('0x1'));var zipdir=require(_0xc340('0x2'));var jsonpatch=require(_0xc340('0x3'));var rp=require('request-promise');var moment=require(_0xc340('0x4'));var BPromise=require(_0xc340('0x5'));var Mustache=require(_0xc340('0x6'));var util=require(_0xc340('0x7'));var path=require('path');var sox=require(_0xc340('0x8'));var csv=require(_0xc340('0x9'));var ejs=require(_0xc340('0xa'));var fs=require('fs');var fs_extra=require(_0xc340('0xb'));var _=require(_0xc340('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc340('0xd'));var toCsv=require(_0xc340('0x9'));var querystring=require('querystring');var Papa=require(_0xc340('0xe'));var Redis=require(_0xc340('0xf'));var authService=require(_0xc340('0x10'));var qs=require(_0xc340('0x11'));var as=require(_0xc340('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc340('0x13'))(_0xc340('0x14'));var utils=require(_0xc340('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc340('0x16'));var db=require(_0xc340('0x17'))['db'];var integrations=require(_0xc340('0x18'));function respondWithStatusCode(_0x1a9f98,_0x2eae5f){_0x2eae5f=_0x2eae5f||0xcc;return function(_0x50365c){if(_0x50365c){return _0x1a9f98[_0xc340('0x19')](_0x2eae5f);}return _0x1a9f98[_0xc340('0x1a')](_0x2eae5f)[_0xc340('0x1b')]();};}function respondWithResult(_0x10b317,_0x2f257b){_0x2f257b=_0x2f257b||0xc8;return function(_0x4abaa9){if(_0x4abaa9){return _0x10b317[_0xc340('0x1a')](_0x2f257b)[_0xc340('0x1c')](_0x4abaa9);}};}function respondWithFilteredResult(_0x2609b2,_0x27f7f1){return function(_0x3576b7){if(_0x3576b7){var _0x540a86=typeof _0x27f7f1[_0xc340('0x1d')]===_0xc340('0x1e')&&typeof _0x27f7f1[_0xc340('0x1f')]===_0xc340('0x1e');var _0x37c52a=_0x3576b7['count'];var _0x2a08e1=_0x540a86?0x0:_0x27f7f1[_0xc340('0x1d')];var _0x3696f3=_0x540a86?_0x3576b7['count']:_0x27f7f1['offset']+_0x27f7f1[_0xc340('0x1f')];var _0x427a6d;if(_0x3696f3>=_0x37c52a){_0x3696f3=_0x37c52a;_0x427a6d=0xc8;}else{_0x427a6d=0xce;}_0x2609b2[_0xc340('0x1a')](_0x427a6d);return _0x2609b2['set']('Content-Range',_0x2a08e1+'-'+_0x3696f3+'/'+_0x37c52a)[_0xc340('0x1c')](_0x3576b7);}return null;};}function patchUpdates(_0x4a73af){return function(_0x3b01e5){try{jsonpatch[_0xc340('0x20')](_0x3b01e5,_0x4a73af,!![]);}catch(_0x25f22f){return BPromise[_0xc340('0x21')](_0x25f22f);}return _0x3b01e5[_0xc340('0x22')]();};}function saveUpdates(_0x435c28,_0xe1a519){return function(_0xb6e946){if(_0xb6e946){return _0xb6e946[_0xc340('0x23')](_0x435c28)[_0xc340('0x24')](function(_0x5ac403){return _0x5ac403;});}return null;};}function removeEntity(_0x10543e,_0x250dbd){return function(_0x5e3892){if(_0x5e3892){return _0x5e3892[_0xc340('0x25')]()['then'](function(){_0x10543e[_0xc340('0x1a')](0xcc)[_0xc340('0x1b')]();});}};}function handleEntityNotFound(_0x36ea03,_0x57a615){return function(_0x9f91bd){if(!_0x9f91bd){_0x36ea03[_0xc340('0x19')](0x194);}return _0x9f91bd;};}function handleError(_0x33b1b5,_0x183bfa){_0x183bfa=_0x183bfa||0x1f4;return function(_0xd9e330){logger[_0xc340('0x26')](_0xd9e330[_0xc340('0x27')]);if(_0xd9e330['name']){delete _0xd9e330['name'];}_0x33b1b5[_0xc340('0x1a')](_0x183bfa)[_0xc340('0x28')](_0xd9e330);};}exports[_0xc340('0x29')]=function(_0x17a567,_0xa26821){var _0xf81b45={},_0x48c974={},_0x160c38={'count':0x0,'rows':[]};var _0x1b6b00=_[_0xc340('0x2a')](db[_0xc340('0x2b')][_0xc340('0x2c')],function(_0x9f64c2){return{'name':_0x9f64c2[_0xc340('0x2d')],'type':_0x9f64c2['type']['key']};});_0x48c974[_0xc340('0x2e')]=_[_0xc340('0x2a')](_0x1b6b00,_0xc340('0x2f'));_0x48c974[_0xc340('0x30')]=_[_0xc340('0x31')](_0x17a567[_0xc340('0x30')]);_0x48c974[_0xc340('0x32')]=_['intersection'](_0x48c974[_0xc340('0x2e')],_0x48c974[_0xc340('0x30')]);_0xf81b45['attributes']=_[_0xc340('0x33')](_0x48c974[_0xc340('0x2e')],qs[_0xc340('0x34')](_0x17a567['query'][_0xc340('0x34')]));_0xf81b45[_0xc340('0x35')]=_0xf81b45[_0xc340('0x35')]['length']?_0xf81b45[_0xc340('0x35')]:_0x48c974[_0xc340('0x2e')];if(!_0x17a567['query'][_0xc340('0x36')]('nolimit')){_0xf81b45[_0xc340('0x1f')]=qs[_0xc340('0x1f')](_0x17a567[_0xc340('0x30')]['limit']);_0xf81b45[_0xc340('0x1d')]=qs[_0xc340('0x1d')](_0x17a567['query'][_0xc340('0x1d')]);}_0xf81b45[_0xc340('0x37')]=qs[_0xc340('0x38')](_0x17a567[_0xc340('0x30')][_0xc340('0x38')]);_0xf81b45[_0xc340('0x39')]=qs[_0xc340('0x32')](_['pick'](_0x17a567[_0xc340('0x30')],_0x48c974[_0xc340('0x32')]),_0x1b6b00);if(_0x17a567[_0xc340('0x30')][_0xc340('0x3a')]){_0xf81b45[_0xc340('0x39')]=_[_0xc340('0x3b')](_0xf81b45['where'],{'$or':_[_0xc340('0x2a')](_0x1b6b00,function(_0x1d6e27){if(_0x1d6e27[_0xc340('0x3c')]!=='VIRTUAL'){var _0x36ab0e={};_0x36ab0e[_0x1d6e27['name']]={'$like':'%'+_0x17a567['query']['filter']+'%'};return _0x36ab0e;}})});}_0xf81b45=_[_0xc340('0x3b')]({},_0xf81b45,_0x17a567['options']);var _0x1737cf={'where':_0xf81b45[_0xc340('0x39')]};return db['FreshdeskAccount'][_0xc340('0x3d')](_0x1737cf)[_0xc340('0x24')](function(_0x399be0){_0x160c38['count']=_0x399be0;if(_0x17a567[_0xc340('0x30')]['includeAll']){_0xf81b45[_0xc340('0x3e')]=[{'all':!![]}];}return db[_0xc340('0x2b')][_0xc340('0x3f')](_0xf81b45);})[_0xc340('0x24')](function(_0x1d4b1c){_0x160c38[_0xc340('0x40')]=_0x1d4b1c;return _0x160c38;})[_0xc340('0x24')](respondWithFilteredResult(_0xa26821,_0xf81b45))[_0xc340('0x41')](handleError(_0xa26821,null));};exports[_0xc340('0x42')]=function(_0x47ae28,_0x5f00b2){var _0x668a59={'raw':![],'where':{'id':_0x47ae28[_0xc340('0x43')]['id']}},_0xc22c63={};_0xc22c63['model']=_['keys'](db[_0xc340('0x2b')][_0xc340('0x2c')]);_0xc22c63[_0xc340('0x30')]=_[_0xc340('0x31')](_0x47ae28[_0xc340('0x30')]);_0xc22c63[_0xc340('0x32')]=_[_0xc340('0x33')](_0xc22c63[_0xc340('0x2e')],_0xc22c63[_0xc340('0x30')]);_0x668a59[_0xc340('0x35')]=_[_0xc340('0x33')](_0xc22c63['model'],qs[_0xc340('0x34')](_0x47ae28[_0xc340('0x30')][_0xc340('0x34')]));_0x668a59[_0xc340('0x35')]=_0x668a59[_0xc340('0x35')][_0xc340('0x44')]?_0x668a59[_0xc340('0x35')]:_0xc22c63['model'];if(_0x47ae28[_0xc340('0x30')][_0xc340('0x45')]){_0x668a59[_0xc340('0x3e')]=[{'all':!![]}];}_0x668a59=_[_0xc340('0x3b')]({},_0x668a59,_0x47ae28[_0xc340('0x46')]);return db[_0xc340('0x2b')][_0xc340('0x47')](_0x668a59)['then'](handleEntityNotFound(_0x5f00b2,null))['then'](respondWithResult(_0x5f00b2,null))[_0xc340('0x41')](handleError(_0x5f00b2,null));};exports[_0xc340('0x48')]=function(_0x1f3516,_0x265240){return db[_0xc340('0x2b')]['create'](_0x1f3516['body'],{})[_0xc340('0x24')](respondWithResult(_0x265240,0xc9))['catch'](handleError(_0x265240,null));};exports['update']=function(_0x4ad5c8,_0x29d5ad){if(_0x4ad5c8[_0xc340('0x49')]['id']){delete _0x4ad5c8[_0xc340('0x49')]['id'];}return db[_0xc340('0x2b')][_0xc340('0x47')]({'where':{'id':_0x4ad5c8[_0xc340('0x43')]['id']}})[_0xc340('0x24')](handleEntityNotFound(_0x29d5ad,null))[_0xc340('0x24')](saveUpdates(_0x4ad5c8[_0xc340('0x49')],null))[_0xc340('0x24')](respondWithResult(_0x29d5ad,null))[_0xc340('0x41')](handleError(_0x29d5ad,null));};exports[_0xc340('0x25')]=function(_0x599a09,_0x52fe72){return db[_0xc340('0x2b')][_0xc340('0x47')]({'where':{'id':_0x599a09[_0xc340('0x43')]['id']}})[_0xc340('0x24')](handleEntityNotFound(_0x52fe72,null))['then'](removeEntity(_0x52fe72,null))['catch'](handleError(_0x52fe72,null));};exports[_0xc340('0x4a')]=function(_0x5922df,_0x303b26,_0x51cedc){var _0x5d377c={};var _0x4374ce={};var _0x4522f6;var _0x3151f3;return db[_0xc340('0x2b')]['findOne']({'where':{'id':_0x5922df['params']['id']}})[_0xc340('0x24')](handleEntityNotFound(_0x303b26,null))['then'](function(_0x5c333d){if(_0x5c333d){_0x4522f6=_0x5c333d;_0x4374ce[_0xc340('0x2e')]=_[_0xc340('0x31')](db['FreshdeskConfiguration'][_0xc340('0x2c')]);_0x4374ce[_0xc340('0x30')]=_['keys'](_0x5922df['query']);_0x4374ce['filters']=_['intersection'](_0x4374ce[_0xc340('0x2e')],_0x4374ce[_0xc340('0x30')]);_0x5d377c[_0xc340('0x35')]=_[_0xc340('0x33')](_0x4374ce[_0xc340('0x2e')],qs['fields'](_0x5922df[_0xc340('0x30')][_0xc340('0x34')]));_0x5d377c['attributes']=_0x5d377c[_0xc340('0x35')]['length']?_0x5d377c[_0xc340('0x35')]:_0x4374ce[_0xc340('0x2e')];_0x5d377c['order']=qs[_0xc340('0x38')](_0x5922df[_0xc340('0x30')][_0xc340('0x38')]);_0x5d377c[_0xc340('0x39')]=qs[_0xc340('0x32')](_[_0xc340('0x4b')](_0x5922df[_0xc340('0x30')],_0x4374ce[_0xc340('0x32')]));if(_0x5922df['query'][_0xc340('0x3a')]){_0x5d377c[_0xc340('0x39')]=_['merge'](_0x5d377c[_0xc340('0x39')],{'$or':_[_0xc340('0x2a')](_0x5d377c[_0xc340('0x35')],function(_0x40f0f4){var _0x380a46={};_0x380a46[_0x40f0f4]={'$like':'%'+_0x5922df['query'][_0xc340('0x3a')]+'%'};return _0x380a46;})});}_0x5d377c=_[_0xc340('0x3b')]({},_0x5d377c,_0x5922df[_0xc340('0x46')]);return _0x4522f6[_0xc340('0x4a')](_0x5d377c);}})[_0xc340('0x24')](function(_0x350d00){if(_0x350d00){_0x3151f3=_0x350d00[_0xc340('0x44')];if(!_0x5922df[_0xc340('0x30')][_0xc340('0x36')](_0xc340('0x4c'))){_0x5d377c[_0xc340('0x1f')]=qs[_0xc340('0x1f')](_0x5922df[_0xc340('0x30')]['limit']);_0x5d377c['offset']=qs[_0xc340('0x1d')](_0x5922df[_0xc340('0x30')][_0xc340('0x1d')]);}return _0x4522f6['getConfigurations'](_0x5d377c);}})['then'](function(_0x4a07bc){if(_0x4a07bc){return _0x4a07bc?{'count':_0x3151f3,'rows':_0x4a07bc}:null;}})[_0xc340('0x24')](respondWithResult(_0x303b26,null))[_0xc340('0x41')](handleError(_0x303b26,null));};exports[_0xc340('0x4d')]=function(_0x522f3c,_0x174191,_0x36ae6f){if(_0x522f3c[_0xc340('0x49')]['id']){delete _0x522f3c[_0xc340('0x49')]['id'];}return db[_0xc340('0x2b')][_0xc340('0x4e')]({'where':{'id':_0x522f3c['params']['id']}})[_0xc340('0x24')](handleEntityNotFound(_0x174191,null))[_0xc340('0x24')](function(_0x3237bc){if(_0x3237bc){_0x522f3c['body'][_0xc340('0x4f')]=_0x3237bc['id'];_0x522f3c[_0xc340('0x49')][_0xc340('0x50')]=integrations[_0xc340('0x51')](_0x522f3c[_0xc340('0x49')]['channel'],_0x522f3c[_0xc340('0x49')]['type']);_0x522f3c[_0xc340('0x49')][_0xc340('0x52')]=integrations['getDescriptions'](_0x522f3c[_0xc340('0x49')][_0xc340('0x53')],_0x522f3c[_0xc340('0x49')][_0xc340('0x3c')]);return db[_0xc340('0x54')][_0xc340('0x48')](_0x522f3c['body'],{'include':[{'model':db[_0xc340('0x55')],'as':_0xc340('0x50')},{'model':db[_0xc340('0x55')],'as':_0xc340('0x52')}]});}return null;})[_0xc340('0x24')](respondWithResult(_0x174191,null))[_0xc340('0x41')](handleError(_0x174191,null));};exports[_0xc340('0x56')]=function(_0x4c604d,_0x41d3cb,_0x524702){var _0x246fe2='';return db[_0xc340('0x2b')][_0xc340('0x4e')]({'where':{'id':_0x4c604d[_0xc340('0x43')]['id']},'attributes':['id',_0xc340('0x57'),_0xc340('0x58')]})[_0xc340('0x24')](handleEntityNotFound(_0x41d3cb,null))[_0xc340('0x24')](function(_0x1d5a2d){if(_0x1d5a2d){_0x246fe2=_0x1d5a2d[_0xc340('0x57')];var _0x43df6e=_0x246fe2[_0xc340('0x59')](-0x1);if(_0x43df6e==='/'){_0x246fe2=_0x246fe2['substring'](0x0,_0x246fe2[_0xc340('0x5a')](_0x43df6e));}return rp({'method':_0xc340('0x5b'),'uri':util[_0xc340('0x5c')](_0xc340('0x5d'),_0x246fe2,_0xc340('0x5e')),'headers':{'Authorization':util[_0xc340('0x5c')](_0xc340('0x5f'),new Buffer(util['format'](_0xc340('0x60'),_0x1d5a2d[_0xc340('0x58')]))[_0xc340('0x61')](_0xc340('0x62')))},'json':!![]});}})[_0xc340('0x24')](function(_0x3d3a0e){if(_0x3d3a0e){var _0x57f3b5=['requester',_0xc340('0x63'),'agent',_0xc340('0x64'),_0xc340('0x1a'),_0xc340('0x65'),_0xc340('0x66'),_0xc340('0x67'),_0xc340('0x68'),_0xc340('0x66'),_0xc340('0x69')];_[_0xc340('0x6a')](_0x3d3a0e,function(_0x10558c){return _0x57f3b5[_0xc340('0x6b')](_0x10558c['name'])||!_0x10558c[_0xc340('0x6c')]&&_0x10558c[_0xc340('0x3c')]!==_0xc340('0x6d')&&_0x10558c[_0xc340('0x3c')]!=='custom_dropdown';});return{'count':_0x3d3a0e['length'],'rows':_[_0xc340('0x2a')](_0x3d3a0e,function(_0x344a68){return{'id':_0x344a68[_0xc340('0x2f')],'name':_0x344a68[_0xc340('0x6e')],'custom':!_0x344a68[_0xc340('0x6c')],'options':_0x344a68['choices']?_[_0xc340('0x2a')](_0x344a68[_0xc340('0x6f')],function(_0x269974){return{'name':_['capitalize'](_0x269974),'value':_0x269974};}):[]};})};}})[_0xc340('0x24')](respondWithResult(_0x41d3cb,null))[_0xc340('0x41')](function(_0x421a03){var _0x48bbce=_0x4c604d[_0xc340('0x30')][_0xc340('0x70')]?0x1f4:_0x421a03[_0xc340('0x71')]||0x1f4;logger['error'](_0xc340('0x72'),_0xc340('0x56'),_0x48bbce,JSON[_0xc340('0x73')](_0x421a03));delete _0x421a03['name'];if(_0x48bbce===0x191){_0x48bbce=0x190;}_0x41d3cb[_0xc340('0x1a')](_0x48bbce)[_0xc340('0x28')](_0x4c604d[_0xc340('0x30')][_0xc340('0x70')]?{'message':_0xc340('0x74'),'statusCode':_0x421a03['statusCode']}:_0x421a03);});}; \ No newline at end of file +var _0x9b87=['toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','FreshdeskAccount','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey'];(function(_0x1e0543,_0x4e200d){var _0x21a58e=function(_0x15eba6){while(--_0x15eba6){_0x1e0543['push'](_0x1e0543['shift']());}};_0x21a58e(++_0x4e200d);}(_0x9b87,0x8e));var _0x79b8=function(_0xeb859,_0x3be6a5){_0xeb859=_0xeb859-0x0;var _0x22f8aa=_0x9b87[_0xeb859];return _0x22f8aa;};'use strict';var emlformat=require(_0x79b8('0x0'));var rimraf=require(_0x79b8('0x1'));var zipdir=require(_0x79b8('0x2'));var jsonpatch=require(_0x79b8('0x3'));var rp=require(_0x79b8('0x4'));var moment=require(_0x79b8('0x5'));var BPromise=require(_0x79b8('0x6'));var Mustache=require(_0x79b8('0x7'));var util=require(_0x79b8('0x8'));var path=require(_0x79b8('0x9'));var sox=require(_0x79b8('0xa'));var csv=require(_0x79b8('0xb'));var ejs=require(_0x79b8('0xc'));var fs=require('fs');var fs_extra=require(_0x79b8('0xd'));var _=require(_0x79b8('0xe'));var squel=require(_0x79b8('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x79b8('0x10'));var Papa=require(_0x79b8('0x11'));var Redis=require(_0x79b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x79b8('0x13'));var as=require(_0x79b8('0x14'));var hardwareService=require(_0x79b8('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x79b8('0x16'));var config=require(_0x79b8('0x17'));var licenseUtil=require(_0x79b8('0x18'));var db=require(_0x79b8('0x19'))['db'];var integrations=require(_0x79b8('0x1a'));function respondWithStatusCode(_0x33227b,_0x41095c){_0x41095c=_0x41095c||0xcc;return function(_0x41927b){if(_0x41927b){return _0x33227b[_0x79b8('0x1b')](_0x41095c);}return _0x33227b[_0x79b8('0x1c')](_0x41095c)[_0x79b8('0x1d')]();};}function respondWithResult(_0x59e229,_0x150fb7){_0x150fb7=_0x150fb7||0xc8;return function(_0x4d5cd7){if(_0x4d5cd7){return _0x59e229['status'](_0x150fb7)[_0x79b8('0x1e')](_0x4d5cd7);}};}function respondWithFilteredResult(_0x21aae0,_0x57a248){return function(_0x5ddab5){if(_0x5ddab5){var _0x3e3de3=typeof _0x57a248['offset']==='undefined'&&typeof _0x57a248[_0x79b8('0x1f')]===_0x79b8('0x20');var _0x9e0342=_0x5ddab5[_0x79b8('0x21')];var _0x383a34=_0x3e3de3?0x0:_0x57a248[_0x79b8('0x22')];var _0x597f3b=_0x3e3de3?_0x5ddab5[_0x79b8('0x21')]:_0x57a248['offset']+_0x57a248['limit'];var _0x9bcb94;if(_0x597f3b>=_0x9e0342){_0x597f3b=_0x9e0342;_0x9bcb94=0xc8;}else{_0x9bcb94=0xce;}_0x21aae0[_0x79b8('0x1c')](_0x9bcb94);return _0x21aae0[_0x79b8('0x23')](_0x79b8('0x24'),_0x383a34+'-'+_0x597f3b+'/'+_0x9e0342)[_0x79b8('0x1e')](_0x5ddab5);}return null;};}function patchUpdates(_0x1e7507){return function(_0x3611c3){try{jsonpatch[_0x79b8('0x25')](_0x3611c3,_0x1e7507,!![]);}catch(_0x2e1a65){return BPromise['reject'](_0x2e1a65);}return _0x3611c3[_0x79b8('0x26')]();};}function saveUpdates(_0x255207,_0x4dbfcf){return function(_0x2622ef){if(_0x2622ef){return _0x2622ef[_0x79b8('0x27')](_0x255207)['then'](function(_0x28be4b){return _0x28be4b;});}return null;};}function removeEntity(_0x4f543f,_0x5e8228){return function(_0x257ea5){if(_0x257ea5){return _0x257ea5[_0x79b8('0x28')]()[_0x79b8('0x29')](function(){_0x4f543f[_0x79b8('0x1c')](0xcc)[_0x79b8('0x1d')]();});}};}function handleEntityNotFound(_0x4cd38b,_0x35db24){return function(_0x338a7b){if(!_0x338a7b){_0x4cd38b[_0x79b8('0x1b')](0x194);}return _0x338a7b;};}function handleError(_0x3ba5ac,_0x4bbbf8){_0x4bbbf8=_0x4bbbf8||0x1f4;return function(_0x438130){logger[_0x79b8('0x2a')](_0x438130[_0x79b8('0x2b')]);if(_0x438130['name']){delete _0x438130[_0x79b8('0x2c')];}_0x3ba5ac[_0x79b8('0x1c')](_0x4bbbf8)[_0x79b8('0x2d')](_0x438130);};}exports[_0x79b8('0x2e')]=function(_0x3662aa,_0x23483f){var _0x4f51d1={},_0x434ecd={},_0x5a24fd={'count':0x0,'rows':[]};var _0x169597=_['map'](db[_0x79b8('0x2f')][_0x79b8('0x30')],function(_0x300755){return{'name':_0x300755['fieldName'],'type':_0x300755[_0x79b8('0x31')][_0x79b8('0x32')]};});_0x434ecd[_0x79b8('0x33')]=_[_0x79b8('0x34')](_0x169597,'name');_0x434ecd[_0x79b8('0x35')]=_['keys'](_0x3662aa['query']);_0x434ecd[_0x79b8('0x36')]=_[_0x79b8('0x37')](_0x434ecd['model'],_0x434ecd[_0x79b8('0x35')]);_0x4f51d1['attributes']=_['intersection'](_0x434ecd[_0x79b8('0x33')],qs['fields'](_0x3662aa[_0x79b8('0x35')][_0x79b8('0x38')]));_0x4f51d1['attributes']=_0x4f51d1[_0x79b8('0x39')][_0x79b8('0x3a')]?_0x4f51d1[_0x79b8('0x39')]:_0x434ecd[_0x79b8('0x33')];if(!_0x3662aa[_0x79b8('0x35')][_0x79b8('0x3b')]('nolimit')){_0x4f51d1[_0x79b8('0x1f')]=qs[_0x79b8('0x1f')](_0x3662aa[_0x79b8('0x35')][_0x79b8('0x1f')]);_0x4f51d1[_0x79b8('0x22')]=qs[_0x79b8('0x22')](_0x3662aa[_0x79b8('0x35')][_0x79b8('0x22')]);}_0x4f51d1[_0x79b8('0x3c')]=qs[_0x79b8('0x3d')](_0x3662aa[_0x79b8('0x35')]['sort']);_0x4f51d1[_0x79b8('0x3e')]=qs[_0x79b8('0x36')](_[_0x79b8('0x3f')](_0x3662aa['query'],_0x434ecd[_0x79b8('0x36')]),_0x169597);if(_0x3662aa[_0x79b8('0x35')][_0x79b8('0x40')]){_0x4f51d1[_0x79b8('0x3e')]=_[_0x79b8('0x41')](_0x4f51d1[_0x79b8('0x3e')],{'$or':_['map'](_0x169597,function(_0x13d065){if(_0x13d065['type']!=='VIRTUAL'){var _0x1eeb29={};_0x1eeb29[_0x13d065['name']]={'$like':'%'+_0x3662aa['query'][_0x79b8('0x40')]+'%'};return _0x1eeb29;}})});}_0x4f51d1=_[_0x79b8('0x41')]({},_0x4f51d1,_0x3662aa[_0x79b8('0x42')]);var _0x2f25dd={'where':_0x4f51d1[_0x79b8('0x3e')]};return db[_0x79b8('0x2f')][_0x79b8('0x21')](_0x2f25dd)[_0x79b8('0x29')](function(_0x1e5e80){_0x5a24fd[_0x79b8('0x21')]=_0x1e5e80;if(_0x3662aa[_0x79b8('0x35')][_0x79b8('0x43')]){_0x4f51d1[_0x79b8('0x44')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x79b8('0x45')](_0x4f51d1);})[_0x79b8('0x29')](function(_0x4da364){_0x5a24fd[_0x79b8('0x46')]=_0x4da364;return _0x5a24fd;})[_0x79b8('0x29')](respondWithFilteredResult(_0x23483f,_0x4f51d1))['catch'](handleError(_0x23483f,null));};exports[_0x79b8('0x47')]=function(_0x62a011,_0x2ddad8){var _0x28d4e4={'raw':![],'where':{'id':_0x62a011[_0x79b8('0x48')]['id']}},_0x2e7f32={};_0x2e7f32[_0x79b8('0x33')]=_[_0x79b8('0x49')](db[_0x79b8('0x2f')][_0x79b8('0x30')]);_0x2e7f32[_0x79b8('0x35')]=_[_0x79b8('0x49')](_0x62a011['query']);_0x2e7f32['filters']=_[_0x79b8('0x37')](_0x2e7f32[_0x79b8('0x33')],_0x2e7f32[_0x79b8('0x35')]);_0x28d4e4[_0x79b8('0x39')]=_['intersection'](_0x2e7f32[_0x79b8('0x33')],qs[_0x79b8('0x38')](_0x62a011[_0x79b8('0x35')][_0x79b8('0x38')]));_0x28d4e4['attributes']=_0x28d4e4[_0x79b8('0x39')][_0x79b8('0x3a')]?_0x28d4e4[_0x79b8('0x39')]:_0x2e7f32[_0x79b8('0x33')];if(_0x62a011['query'][_0x79b8('0x43')]){_0x28d4e4[_0x79b8('0x44')]=[{'all':!![]}];}_0x28d4e4=_[_0x79b8('0x41')]({},_0x28d4e4,_0x62a011[_0x79b8('0x42')]);return db[_0x79b8('0x2f')][_0x79b8('0x4a')](_0x28d4e4)['then'](handleEntityNotFound(_0x2ddad8,null))[_0x79b8('0x29')](respondWithResult(_0x2ddad8,null))[_0x79b8('0x4b')](handleError(_0x2ddad8,null));};exports[_0x79b8('0x4c')]=function(_0xc89e93,_0x478940){return db['FreshdeskAccount'][_0x79b8('0x4c')](_0xc89e93[_0x79b8('0x4d')],{})[_0x79b8('0x29')](respondWithResult(_0x478940,0xc9))[_0x79b8('0x4b')](handleError(_0x478940,null));};exports[_0x79b8('0x27')]=function(_0x19272d,_0x1d4e87){if(_0x19272d[_0x79b8('0x4d')]['id']){delete _0x19272d[_0x79b8('0x4d')]['id'];}return db['FreshdeskAccount'][_0x79b8('0x4a')]({'where':{'id':_0x19272d[_0x79b8('0x48')]['id']}})[_0x79b8('0x29')](handleEntityNotFound(_0x1d4e87,null))['then'](saveUpdates(_0x19272d[_0x79b8('0x4d')],null))['then'](respondWithResult(_0x1d4e87,null))['catch'](handleError(_0x1d4e87,null));};exports[_0x79b8('0x28')]=function(_0x252c2c,_0x5b4d56){return db[_0x79b8('0x2f')]['find']({'where':{'id':_0x252c2c['params']['id']}})[_0x79b8('0x29')](handleEntityNotFound(_0x5b4d56,null))[_0x79b8('0x29')](removeEntity(_0x5b4d56,null))[_0x79b8('0x4b')](handleError(_0x5b4d56,null));};exports[_0x79b8('0x4e')]=function(_0x2ff973,_0xcfb9c2,_0x3f3ffc){var _0x3d1078={};var _0x26d69e={};var _0x1571cf;var _0x2455c6;return db[_0x79b8('0x2f')][_0x79b8('0x4f')]({'where':{'id':_0x2ff973[_0x79b8('0x48')]['id']}})['then'](handleEntityNotFound(_0xcfb9c2,null))[_0x79b8('0x29')](function(_0x16f272){if(_0x16f272){_0x1571cf=_0x16f272;_0x26d69e[_0x79b8('0x33')]=_[_0x79b8('0x49')](db['FreshdeskConfiguration']['rawAttributes']);_0x26d69e[_0x79b8('0x35')]=_[_0x79b8('0x49')](_0x2ff973[_0x79b8('0x35')]);_0x26d69e[_0x79b8('0x36')]=_['intersection'](_0x26d69e[_0x79b8('0x33')],_0x26d69e[_0x79b8('0x35')]);_0x3d1078['attributes']=_[_0x79b8('0x37')](_0x26d69e[_0x79b8('0x33')],qs[_0x79b8('0x38')](_0x2ff973['query'][_0x79b8('0x38')]));_0x3d1078['attributes']=_0x3d1078[_0x79b8('0x39')][_0x79b8('0x3a')]?_0x3d1078[_0x79b8('0x39')]:_0x26d69e[_0x79b8('0x33')];_0x3d1078[_0x79b8('0x3c')]=qs[_0x79b8('0x3d')](_0x2ff973[_0x79b8('0x35')][_0x79b8('0x3d')]);_0x3d1078[_0x79b8('0x3e')]=qs[_0x79b8('0x36')](_['pick'](_0x2ff973[_0x79b8('0x35')],_0x26d69e['filters']));if(_0x2ff973[_0x79b8('0x35')]['filter']){_0x3d1078[_0x79b8('0x3e')]=_[_0x79b8('0x41')](_0x3d1078[_0x79b8('0x3e')],{'$or':_[_0x79b8('0x34')](_0x3d1078[_0x79b8('0x39')],function(_0x5885a3){var _0x1d5b81={};_0x1d5b81[_0x5885a3]={'$like':'%'+_0x2ff973['query'][_0x79b8('0x40')]+'%'};return _0x1d5b81;})});}_0x3d1078=_[_0x79b8('0x41')]({},_0x3d1078,_0x2ff973[_0x79b8('0x42')]);return _0x1571cf[_0x79b8('0x4e')](_0x3d1078);}})[_0x79b8('0x29')](function(_0x3b18f9){if(_0x3b18f9){_0x2455c6=_0x3b18f9['length'];if(!_0x2ff973[_0x79b8('0x35')][_0x79b8('0x3b')]('nolimit')){_0x3d1078[_0x79b8('0x1f')]=qs['limit'](_0x2ff973[_0x79b8('0x35')][_0x79b8('0x1f')]);_0x3d1078['offset']=qs[_0x79b8('0x22')](_0x2ff973[_0x79b8('0x35')]['offset']);}return _0x1571cf[_0x79b8('0x4e')](_0x3d1078);}})['then'](function(_0x2e11a6){if(_0x2e11a6){return _0x2e11a6?{'count':_0x2455c6,'rows':_0x2e11a6}:null;}})['then'](respondWithResult(_0xcfb9c2,null))[_0x79b8('0x4b')](handleError(_0xcfb9c2,null));};exports[_0x79b8('0x50')]=function(_0x41f243,_0x26722c,_0x17a707){if(_0x41f243[_0x79b8('0x4d')]['id']){delete _0x41f243['body']['id'];}return db[_0x79b8('0x2f')][_0x79b8('0x4f')]({'where':{'id':_0x41f243['params']['id']}})['then'](handleEntityNotFound(_0x26722c,null))[_0x79b8('0x29')](function(_0x40ddfc){if(_0x40ddfc){_0x41f243['body'][_0x79b8('0x51')]=_0x40ddfc['id'];_0x41f243[_0x79b8('0x4d')][_0x79b8('0x52')]=integrations['getSubjects'](_0x41f243[_0x79b8('0x4d')][_0x79b8('0x53')],_0x41f243[_0x79b8('0x4d')][_0x79b8('0x31')]);_0x41f243[_0x79b8('0x4d')][_0x79b8('0x54')]=integrations['getDescriptions'](_0x41f243[_0x79b8('0x4d')][_0x79b8('0x53')],_0x41f243[_0x79b8('0x4d')]['type']);return db[_0x79b8('0x55')][_0x79b8('0x4c')](_0x41f243[_0x79b8('0x4d')],{'include':[{'model':db['FreshdeskField'],'as':_0x79b8('0x52')},{'model':db[_0x79b8('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x26722c,null))[_0x79b8('0x4b')](handleError(_0x26722c,null));};exports[_0x79b8('0x57')]=function(_0x172532,_0x1cba9b,_0xd39bc0){var _0x1c6ff0='';return db[_0x79b8('0x2f')][_0x79b8('0x4f')]({'where':{'id':_0x172532['params']['id']},'attributes':['id',_0x79b8('0x58'),'apiKey']})['then'](handleEntityNotFound(_0x1cba9b,null))[_0x79b8('0x29')](function(_0x54e855){if(_0x54e855){_0x1c6ff0=_0x54e855[_0x79b8('0x58')];var _0x43b067=_0x1c6ff0[_0x79b8('0x59')](-0x1);if(_0x43b067==='/'){_0x1c6ff0=_0x1c6ff0['substring'](0x0,_0x1c6ff0[_0x79b8('0x5a')](_0x43b067));}return rp({'method':_0x79b8('0x5b'),'uri':util[_0x79b8('0x5c')](_0x79b8('0x5d'),_0x1c6ff0,_0x79b8('0x5e')),'headers':{'Authorization':util[_0x79b8('0x5c')](_0x79b8('0x5f'),new Buffer(util[_0x79b8('0x5c')](_0x79b8('0x60'),_0x54e855[_0x79b8('0x61')]))[_0x79b8('0x62')](_0x79b8('0x63')))},'json':!![]});}})['then'](function(_0x2b7dac){if(_0x2b7dac){var _0x2556ad=[_0x79b8('0x64'),_0x79b8('0x65'),_0x79b8('0x66'),_0x79b8('0x67'),_0x79b8('0x1c'),_0x79b8('0x68'),_0x79b8('0x69'),_0x79b8('0x6a'),_0x79b8('0x6b'),'group',_0x79b8('0x6c')];_['remove'](_0x2b7dac,function(_0x5b785b){return _0x2556ad[_0x79b8('0x6d')](_0x5b785b[_0x79b8('0x2c')])||!_0x5b785b[_0x79b8('0x6e')]&&_0x5b785b[_0x79b8('0x31')]!==_0x79b8('0x6f')&&_0x5b785b[_0x79b8('0x31')]!==_0x79b8('0x70');});return{'count':_0x2b7dac[_0x79b8('0x3a')],'rows':_['map'](_0x2b7dac,function(_0x589712){return{'id':_0x589712['name'],'name':_0x589712[_0x79b8('0x71')],'custom':!_0x589712[_0x79b8('0x6e')],'options':_0x589712[_0x79b8('0x72')]?_[_0x79b8('0x34')](_0x589712[_0x79b8('0x72')],function(_0x1fcd5e){return{'name':_[_0x79b8('0x73')](_0x1fcd5e),'value':_0x1fcd5e};}):[]};})};}})[_0x79b8('0x29')](respondWithResult(_0x1cba9b,null))[_0x79b8('0x4b')](function(_0x5c1ca){var _0x211358=_0x172532[_0x79b8('0x35')]['test']?0x1f4:_0x5c1ca[_0x79b8('0x74')]||0x1f4;logger[_0x79b8('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x79b8('0x57'),_0x211358,JSON[_0x79b8('0x75')](_0x5c1ca));delete _0x5c1ca[_0x79b8('0x2c')];if(_0x211358===0x191){_0x211358=0x190;}_0x1cba9b[_0x79b8('0x1c')](_0x211358)[_0x79b8('0x2d')](_0x172532[_0x79b8('0x35')][_0x79b8('0x76')]?{'message':_0x79b8('0x77'),'statusCode':_0x5c1ca['statusCode']}:_0x5c1ca);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 090b10e..530950b 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 _0xc44b=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','lodash'];(function(_0x5593ea,_0x26804a){var _0x3035e0=function(_0x2a36db){while(--_0x2a36db){_0x5593ea['push'](_0x5593ea['shift']());}};_0x3035e0(++_0x26804a);}(_0xc44b,0x6d));var _0xbc44=function(_0x1a3634,_0x3a5fe7){_0x1a3634=_0x1a3634-0x0;var _0x2338c7=_0xc44b[_0x1a3634];return _0x2338c7;};'use strict';var _=require(_0xbc44('0x0'));var util=require('util');var logger=require(_0xbc44('0x1'))(_0xbc44('0x2'));var moment=require(_0xbc44('0x3'));var BPromise=require(_0xbc44('0x4'));var rp=require(_0xbc44('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc44('0x6'));var config=require(_0xbc44('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xbc44('0x8'));module[_0xbc44('0x9')]=function(_0x4a53a9,_0x2e08b1){return _0x4a53a9['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c18=['FreshdeskAccount','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports'];(function(_0x4a9f95,_0x4795ff){var _0x2a77db=function(_0x3e1c92){while(--_0x3e1c92){_0x4a9f95['push'](_0x4a9f95['shift']());}};_0x2a77db(++_0x4795ff);}(_0x8c18,0x7a));var _0x88c1=function(_0x5d14bd,_0x56b910){_0x5d14bd=_0x5d14bd-0x0;var _0x5c31fe=_0x8c18[_0x5d14bd];return _0x5c31fe;};'use strict';var _=require(_0x88c1('0x0'));var util=require('util');var logger=require(_0x88c1('0x1'))('api');var moment=require(_0x88c1('0x2'));var BPromise=require(_0x88c1('0x3'));var rp=require(_0x88c1('0x4'));var fs=require('fs');var path=require(_0x88c1('0x5'));var rimraf=require(_0x88c1('0x6'));var config=require(_0x88c1('0x7'));var attributes=require(_0x88c1('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x88c1('0x9')]=function(_0x544d13,_0x46e4e9){return _0x544d13['define'](_0x88c1('0xa'),attributes,{'tableName':'int_freshdesk_accounts','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 c92d7b4..68857da 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 _0x036b=['where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FreshdeskAccount','options','limit','include','model','attributes','map','GetFreshdeskAccount','ShowFreshdeskAccount','find','raw'];(function(_0x310284,_0x58a7a4){var _0x2357d8=function(_0x17b53d){while(--_0x17b53d){_0x310284['push'](_0x310284['shift']());}};_0x2357d8(++_0x58a7a4);}(_0x036b,0x145));var _0xb036=function(_0x38f879,_0xea1f1c){_0x38f879=_0x38f879-0x0;var _0x2faa08=_0x036b[_0x38f879];return _0x2faa08;};'use strict';var _=require(_0xb036('0x0'));var util=require(_0xb036('0x1'));var moment=require(_0xb036('0x2'));var BPromise=require('bluebird');var rs=require(_0xb036('0x3'));var fs=require('fs');var Redis=require(_0xb036('0x4'));var db=require(_0xb036('0x5'))['db'];var utils=require(_0xb036('0x6'));var logger=require(_0xb036('0x7'))('rpc');var config=require(_0xb036('0x8'));var jayson=require(_0xb036('0x9'));var client=jayson[_0xb036('0xa')][_0xb036('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d495e,_0x35a13f,_0x5bbb44){return new BPromise(function(_0x465d7d,_0x5b3e48){return client[_0xb036('0xc')](_0x1d495e,_0x5bbb44)[_0xb036('0xd')](function(_0x347811){logger[_0xb036('0xe')](_0xb036('0xf'),_0x35a13f,_0xb036('0x10'));logger[_0xb036('0x11')](_0xb036('0x12'),_0x35a13f,_0xb036('0x10'),JSON[_0xb036('0x13')](_0x347811));if(_0x347811[_0xb036('0x14')]){if(_0x347811[_0xb036('0x14')][_0xb036('0x15')]===0x1f4){logger[_0xb036('0x14')]('FreshdeskAccount,\x20%s,\x20%s',_0x35a13f,_0x347811['error']['message']);return _0x5b3e48(_0x347811[_0xb036('0x14')][_0xb036('0x16')]);}logger['error'](_0xb036('0xf'),_0x35a13f,_0x347811[_0xb036('0x14')][_0xb036('0x16')]);return _0x465d7d(_0x347811[_0xb036('0x14')]['message']);}else{logger[_0xb036('0xe')](_0xb036('0xf'),_0x35a13f,'request\x20sent');_0x465d7d(_0x347811['result'][_0xb036('0x16')]);}})[_0xb036('0x17')](function(_0x3c4adc){logger[_0xb036('0x14')]('FreshdeskAccount,\x20%s,\x20%s',_0x35a13f,_0x3c4adc);_0x5b3e48(_0x3c4adc);});});}exports['GetFreshdeskAccount']=function(_0x38e5c8){var _0x4ed446=this;return new Promise(function(_0x992a54,_0x788293){return db[_0xb036('0x18')]['findAll']({'raw':_0x38e5c8['options']?_0x38e5c8[_0xb036('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38e5c8[_0xb036('0x19')]?_0x38e5c8['options']['where']||null:null,'attributes':_0x38e5c8[_0xb036('0x19')]?_0x38e5c8[_0xb036('0x19')]['attributes']||null:null,'limit':_0x38e5c8[_0xb036('0x19')]?_0x38e5c8[_0xb036('0x19')][_0xb036('0x1a')]||null:null,'include':_0x38e5c8[_0xb036('0x19')]?_0x38e5c8[_0xb036('0x19')][_0xb036('0x1b')]?_['map'](_0x38e5c8[_0xb036('0x19')][_0xb036('0x1b')],function(_0x581e8b){return{'model':db[_0x581e8b[_0xb036('0x1c')]],'as':_0x581e8b['as'],'attributes':_0x581e8b[_0xb036('0x1d')],'include':_0x581e8b[_0xb036('0x1b')]?_[_0xb036('0x1e')](_0x581e8b[_0xb036('0x1b')],function(_0x1fc870){return{'model':db[_0x1fc870[_0xb036('0x1c')]],'as':_0x1fc870['as'],'attributes':_0x1fc870[_0xb036('0x1d')],'include':_0x1fc870[_0xb036('0x1b')]?_[_0xb036('0x1e')](_0x1fc870[_0xb036('0x1b')],function(_0x3fff5f){return{'model':db[_0x3fff5f[_0xb036('0x1c')]],'as':_0x3fff5f['as'],'attributes':_0x3fff5f['attributes']};}):[]};}):[]};}):[]:[]})[_0xb036('0xd')](function(_0x1159fd){logger['info'](_0xb036('0x1f'),_0x38e5c8);logger['debug'](_0xb036('0x1f'),_0x38e5c8,JSON[_0xb036('0x13')](_0x1159fd));_0x992a54(_0x1159fd);})['catch'](function(_0x52ee5b){logger[_0xb036('0x14')]('GetFreshdeskAccount',_0x52ee5b['message'],_0x38e5c8);_0x788293(_0x4ed446['error'](0x1f4,_0x52ee5b[_0xb036('0x16')]));});});};exports[_0xb036('0x20')]=function(_0x4628d5){var _0x22aa54=this;return new Promise(function(_0x5dd046,_0x46a75b){return db[_0xb036('0x18')][_0xb036('0x21')]({'raw':_0x4628d5[_0xb036('0x19')]?_0x4628d5['options'][_0xb036('0x22')]===undefined?!![]:![]:!![],'where':_0x4628d5[_0xb036('0x19')]?_0x4628d5['options'][_0xb036('0x23')]||null:null,'attributes':_0x4628d5[_0xb036('0x19')]?_0x4628d5[_0xb036('0x19')]['attributes']||null:null,'include':_0x4628d5[_0xb036('0x19')]?_0x4628d5[_0xb036('0x19')]['include']?_[_0xb036('0x1e')](_0x4628d5[_0xb036('0x19')][_0xb036('0x1b')],function(_0x57d6cb){return{'model':db[_0x57d6cb['model']],'as':_0x57d6cb['as'],'attributes':_0x57d6cb[_0xb036('0x1d')],'include':_0x57d6cb[_0xb036('0x1b')]?_[_0xb036('0x1e')](_0x57d6cb['include'],function(_0x106550){return{'model':db[_0x106550[_0xb036('0x1c')]],'as':_0x106550['as'],'attributes':_0x106550['attributes'],'include':_0x106550[_0xb036('0x1b')]?_[_0xb036('0x1e')](_0x106550[_0xb036('0x1b')],function(_0x21d21){return{'model':db[_0x21d21[_0xb036('0x1c')]],'as':_0x21d21['as'],'attributes':_0x21d21['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f022a){logger[_0xb036('0xe')]('ShowFreshdeskAccount',_0x4628d5);logger[_0xb036('0x11')](_0xb036('0x20'),_0x4628d5,JSON[_0xb036('0x13')](_0x4f022a));_0x5dd046(_0x4f022a);})[_0xb036('0x17')](function(_0x435116){logger['error'](_0xb036('0x20'),_0x435116[_0xb036('0x16')],_0x4628d5);_0x46a75b(_0x22aa54[_0xb036('0x14')](0x1f4,_0x435116[_0xb036('0x16')]));});});}; \ No newline at end of file +var _0xf74f=['attributes','include','map','model','then','stringify','catch','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','GetFreshdeskAccount','FreshdeskAccount','raw','options'];(function(_0x25e625,_0x2a97e2){var _0x3312cb=function(_0x3294e8){while(--_0x3294e8){_0x25e625['push'](_0x25e625['shift']());}};_0x3312cb(++_0x2a97e2);}(_0xf74f,0xa9));var _0xff74=function(_0x5b5efc,_0x2aa448){_0x5b5efc=_0x5b5efc-0x0;var _0x543365=_0xf74f[_0x5b5efc];return _0x543365;};'use strict';var _=require(_0xff74('0x0'));var util=require(_0xff74('0x1'));var moment=require(_0xff74('0x2'));var BPromise=require(_0xff74('0x3'));var rs=require(_0xff74('0x4'));var fs=require('fs');var Redis=require(_0xff74('0x5'));var db=require(_0xff74('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xff74('0x7'))(_0xff74('0x8'));var config=require(_0xff74('0x9'));var jayson=require(_0xff74('0xa'));var client=jayson[_0xff74('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x437970,_0x5e5e99,_0x442569){return new BPromise(function(_0x28036b,_0x19e39f){return client['request'](_0x437970,_0x442569)['then'](function(_0x34734b){logger['info'](_0xff74('0xc'),_0x5e5e99,_0xff74('0xd'));logger[_0xff74('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5e5e99,_0xff74('0xd'),JSON['stringify'](_0x34734b));if(_0x34734b[_0xff74('0xf')]){if(_0x34734b[_0xff74('0xf')][_0xff74('0x10')]===0x1f4){logger[_0xff74('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x5e5e99,_0x34734b[_0xff74('0xf')][_0xff74('0x11')]);return _0x19e39f(_0x34734b['error'][_0xff74('0x11')]);}logger[_0xff74('0xf')](_0xff74('0xc'),_0x5e5e99,_0x34734b[_0xff74('0xf')]['message']);return _0x28036b(_0x34734b[_0xff74('0xf')][_0xff74('0x11')]);}else{logger[_0xff74('0x12')](_0xff74('0xc'),_0x5e5e99,_0xff74('0xd'));_0x28036b(_0x34734b['result'][_0xff74('0x11')]);}})['catch'](function(_0x5af3f0){logger[_0xff74('0xf')](_0xff74('0xc'),_0x5e5e99,_0x5af3f0);_0x19e39f(_0x5af3f0);});});}exports[_0xff74('0x13')]=function(_0x3885d5){var _0x4984b3=this;return new Promise(function(_0x8b3efa,_0x55d061){return db[_0xff74('0x14')]['findAll']({'raw':_0x3885d5['options']?_0x3885d5['options'][_0xff74('0x15')]===undefined?!![]:![]:!![],'where':_0x3885d5[_0xff74('0x16')]?_0x3885d5[_0xff74('0x16')]['where']||null:null,'attributes':_0x3885d5['options']?_0x3885d5['options'][_0xff74('0x17')]||null:null,'limit':_0x3885d5[_0xff74('0x16')]?_0x3885d5[_0xff74('0x16')]['limit']||null:null,'include':_0x3885d5[_0xff74('0x16')]?_0x3885d5['options'][_0xff74('0x18')]?_[_0xff74('0x19')](_0x3885d5['options'][_0xff74('0x18')],function(_0x1b7081){return{'model':db[_0x1b7081['model']],'as':_0x1b7081['as'],'attributes':_0x1b7081[_0xff74('0x17')],'include':_0x1b7081['include']?_[_0xff74('0x19')](_0x1b7081[_0xff74('0x18')],function(_0x360186){return{'model':db[_0x360186[_0xff74('0x1a')]],'as':_0x360186['as'],'attributes':_0x360186[_0xff74('0x17')],'include':_0x360186[_0xff74('0x18')]?_[_0xff74('0x19')](_0x360186[_0xff74('0x18')],function(_0x2aa4a5){return{'model':db[_0x2aa4a5['model']],'as':_0x2aa4a5['as'],'attributes':_0x2aa4a5['attributes']};}):[]};}):[]};}):[]:[]})[_0xff74('0x1b')](function(_0x4cc9fd){logger['info'](_0xff74('0x13'),_0x3885d5);logger[_0xff74('0xe')]('GetFreshdeskAccount',_0x3885d5,JSON[_0xff74('0x1c')](_0x4cc9fd));_0x8b3efa(_0x4cc9fd);})[_0xff74('0x1d')](function(_0xaedec2){logger['error']('GetFreshdeskAccount',_0xaedec2[_0xff74('0x11')],_0x3885d5);_0x55d061(_0x4984b3['error'](0x1f4,_0xaedec2[_0xff74('0x11')]));});});};exports[_0xff74('0x1e')]=function(_0x2c6b29){var _0x4f55c8=this;return new Promise(function(_0x67ba49,_0x2ae3a8){return db[_0xff74('0x14')][_0xff74('0x1f')]({'raw':_0x2c6b29[_0xff74('0x16')]?_0x2c6b29[_0xff74('0x16')][_0xff74('0x15')]===undefined?!![]:![]:!![],'where':_0x2c6b29[_0xff74('0x16')]?_0x2c6b29[_0xff74('0x16')]['where']||null:null,'attributes':_0x2c6b29[_0xff74('0x16')]?_0x2c6b29[_0xff74('0x16')][_0xff74('0x17')]||null:null,'include':_0x2c6b29[_0xff74('0x16')]?_0x2c6b29[_0xff74('0x16')][_0xff74('0x18')]?_[_0xff74('0x19')](_0x2c6b29[_0xff74('0x16')][_0xff74('0x18')],function(_0x3aa0b3){return{'model':db[_0x3aa0b3[_0xff74('0x1a')]],'as':_0x3aa0b3['as'],'attributes':_0x3aa0b3[_0xff74('0x17')],'include':_0x3aa0b3[_0xff74('0x18')]?_[_0xff74('0x19')](_0x3aa0b3[_0xff74('0x18')],function(_0x395d0f){return{'model':db[_0x395d0f[_0xff74('0x1a')]],'as':_0x395d0f['as'],'attributes':_0x395d0f[_0xff74('0x17')],'include':_0x395d0f[_0xff74('0x18')]?_[_0xff74('0x19')](_0x395d0f[_0xff74('0x18')],function(_0x2c2ae8){return{'model':db[_0x2c2ae8['model']],'as':_0x2c2ae8['as'],'attributes':_0x2c2ae8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b7daf){logger[_0xff74('0x12')](_0xff74('0x1e'),_0x2c6b29);logger[_0xff74('0xe')](_0xff74('0x1e'),_0x2c6b29,JSON[_0xff74('0x1c')](_0x2b7daf));_0x67ba49(_0x2b7daf);})[_0xff74('0x1d')](function(_0x2363e0){logger[_0xff74('0xf')]('ShowFreshdeskAccount',_0x2363e0[_0xff74('0x11')],_0x2c6b29);_0x2ae3a8(_0x4f55c8[_0xff74('0xf')](0x1f4,_0x2363e0[_0xff74('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c9e71d4..ea5d16d 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 _0xcd53=['setTags','put','update','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','/:id','show','/:id/fields','getSubjects','isAuthenticated','getDescriptions','getTags','post','/:id/tags'];(function(_0x1d16c0,_0x5c30b4){var _0xb017b3=function(_0x59a2b8){while(--_0x59a2b8){_0x1d16c0['push'](_0x1d16c0['shift']());}};_0xb017b3(++_0x5c30b4);}(_0xcd53,0xe1));var _0x3cd5=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0xcd53[_0x1a8ff0];return _0x3588bf;};'use strict';var multer=require(_0x3cd5('0x0'));var util=require(_0x3cd5('0x1'));var path=require(_0x3cd5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3cd5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3cd5('0x4'));var config=require(_0x3cd5('0x5'));var controller=require(_0x3cd5('0x6'));router[_0x3cd5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3cd5('0x8'),auth['isAuthenticated'](),controller[_0x3cd5('0x9')]);router[_0x3cd5('0x7')](_0x3cd5('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x3cd5('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x3cd5('0xb')]);router[_0x3cd5('0x7')]('/:id/descriptions',auth[_0x3cd5('0xc')](),controller[_0x3cd5('0xd')]);router[_0x3cd5('0x7')]('/:id/tags',auth[_0x3cd5('0xc')](),controller[_0x3cd5('0xe')]);router[_0x3cd5('0xf')]('/',auth[_0x3cd5('0xc')](),controller['create']);router[_0x3cd5('0xf')](_0x3cd5('0x10'),auth['isAuthenticated'](),controller[_0x3cd5('0x11')]);router[_0x3cd5('0x12')](_0x3cd5('0x8'),auth['isAuthenticated'](),controller[_0x3cd5('0x13')]);router['delete'](_0x3cd5('0x8'),auth[_0x3cd5('0xc')](),controller[_0x3cd5('0x14')]);module[_0x3cd5('0x15')]=router; \ No newline at end of file +var _0xb8dd=['getSubjects','/:id/tags','getTags','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','/:id/subjects'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0xb8dd,0xf4));var _0xdb8d=function(_0x44e855,_0x4d8b2c){_0x44e855=_0x44e855-0x0;var _0x1bc647=_0xb8dd[_0x44e855];return _0x1bc647;};'use strict';var multer=require(_0xdb8d('0x0'));var util=require(_0xdb8d('0x1'));var path=require(_0xdb8d('0x2'));var timeout=require(_0xdb8d('0x3'));var express=require(_0xdb8d('0x4'));var router=express[_0xdb8d('0x5')]();var fs_extra=require(_0xdb8d('0x6'));var auth=require(_0xdb8d('0x7'));var interaction=require(_0xdb8d('0x8'));var config=require(_0xdb8d('0x9'));var controller=require(_0xdb8d('0xa'));router[_0xdb8d('0xb')]('/',auth[_0xdb8d('0xc')](),controller['index']);router[_0xdb8d('0xb')](_0xdb8d('0xd'),auth[_0xdb8d('0xc')](),controller['show']);router['get'](_0xdb8d('0xe'),auth[_0xdb8d('0xc')](),controller['getFields']);router[_0xdb8d('0xb')](_0xdb8d('0xf'),auth['isAuthenticated'](),controller[_0xdb8d('0x10')]);router[_0xdb8d('0xb')]('/:id/descriptions',auth[_0xdb8d('0xc')](),controller['getDescriptions']);router['get'](_0xdb8d('0x11'),auth[_0xdb8d('0xc')](),controller[_0xdb8d('0x12')]);router[_0xdb8d('0x13')]('/',auth[_0xdb8d('0xc')](),controller[_0xdb8d('0x14')]);router[_0xdb8d('0x13')]('/:id/tags',auth[_0xdb8d('0xc')](),controller['setTags']);router[_0xdb8d('0x15')]('/:id',auth[_0xdb8d('0xc')](),controller[_0xdb8d('0x16')]);router[_0xdb8d('0x17')](_0xdb8d('0xd'),auth[_0xdb8d('0xc')](),controller[_0xdb8d('0x18')]);module[_0xdb8d('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 07023e7..995b4ab 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 _0x6dab=['STRING','sequelize','exports'];(function(_0x4029aa,_0x3a79c7){var _0x5ed6a0=function(_0x1221ae){while(--_0x1221ae){_0x4029aa['push'](_0x4029aa['shift']());}};_0x5ed6a0(++_0x3a79c7);}(_0x6dab,0x1c9));var _0xb6da=function(_0x39c12e,_0x585534){_0x39c12e=_0x39c12e-0x0;var _0x58dbf4=_0x6dab[_0x39c12e];return _0x58dbf4;};'use strict';var Sequelize=require(_0xb6da('0x0'));module[_0xb6da('0x1')]={'name':{'type':Sequelize[_0xb6da('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf287=['STRING','sequelize','exports'];(function(_0x59ef76,_0x2522a3){var _0x561bde=function(_0x193e8d){while(--_0x193e8d){_0x59ef76['push'](_0x59ef76['shift']());}};_0x561bde(++_0x2522a3);}(_0xf287,0xfd));var _0x7f28=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf287[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0x7f28('0x0'));module[_0x7f28('0x1')]={'name':{'type':Sequelize[_0x7f28('0x2')]},'description':{'type':Sequelize[_0x7f28('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index ae66817..d190ce6 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 _0xad57=['squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','rows','catch','show','params','includeAll','find','create','body','findOne','FreshdeskField','getFields','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x52b4d0,_0x3cfec2){var _0x46c9cb=function(_0x42bada){while(--_0x42bada){_0x52b4d0['push'](_0x52b4d0['shift']());}};_0x46c9cb(++_0x3cfec2);}(_0xad57,0xee));var _0x7ad5=function(_0x341bda,_0x37af8c){_0x341bda=_0x341bda-0x0;var _0x3984e2=_0xad57[_0x341bda];return _0x3984e2;};'use strict';var emlformat=require(_0x7ad5('0x0'));var rimraf=require(_0x7ad5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ad5('0x2'));var rp=require(_0x7ad5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7ad5('0x4'));var util=require(_0x7ad5('0x5'));var path=require(_0x7ad5('0x6'));var sox=require(_0x7ad5('0x7'));var csv=require(_0x7ad5('0x8'));var ejs=require(_0x7ad5('0x9'));var fs=require('fs');var fs_extra=require(_0x7ad5('0xa'));var _=require('lodash');var squel=require(_0x7ad5('0xb'));var crypto=require(_0x7ad5('0xc'));var jsforce=require(_0x7ad5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7ad5('0xe'));var Papa=require('papaparse');var Redis=require(_0x7ad5('0xf'));var authService=require(_0x7ad5('0x10'));var qs=require(_0x7ad5('0x11'));var as=require(_0x7ad5('0x12'));var hardwareService=require(_0x7ad5('0x13'));var logger=require(_0x7ad5('0x14'))(_0x7ad5('0x15'));var utils=require(_0x7ad5('0x16'));var config=require(_0x7ad5('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eba3,_0x12a3b2){_0x12a3b2=_0x12a3b2||0xcc;return function(_0x22ccdc){if(_0x22ccdc){return _0x37eba3[_0x7ad5('0x18')](_0x12a3b2);}return _0x37eba3[_0x7ad5('0x19')](_0x12a3b2)[_0x7ad5('0x1a')]();};}function respondWithResult(_0x48b186,_0xae3749){_0xae3749=_0xae3749||0xc8;return function(_0x8198e6){if(_0x8198e6){return _0x48b186[_0x7ad5('0x19')](_0xae3749)[_0x7ad5('0x1b')](_0x8198e6);}};}function respondWithFilteredResult(_0x561d47,_0x3d451c){return function(_0x3cfdfc){if(_0x3cfdfc){var _0x511ff2=typeof _0x3d451c[_0x7ad5('0x1c')]===_0x7ad5('0x1d')&&typeof _0x3d451c['limit']===_0x7ad5('0x1d');var _0x2802e2=_0x3cfdfc[_0x7ad5('0x1e')];var _0xb0a323=_0x511ff2?0x0:_0x3d451c[_0x7ad5('0x1c')];var _0x541fd6=_0x511ff2?_0x3cfdfc[_0x7ad5('0x1e')]:_0x3d451c[_0x7ad5('0x1c')]+_0x3d451c[_0x7ad5('0x1f')];var _0x451750;if(_0x541fd6>=_0x2802e2){_0x541fd6=_0x2802e2;_0x451750=0xc8;}else{_0x451750=0xce;}_0x561d47[_0x7ad5('0x19')](_0x451750);return _0x561d47[_0x7ad5('0x20')](_0x7ad5('0x21'),_0xb0a323+'-'+_0x541fd6+'/'+_0x2802e2)[_0x7ad5('0x1b')](_0x3cfdfc);}return null;};}function patchUpdates(_0x365d14){return function(_0x483ec4){try{jsonpatch['apply'](_0x483ec4,_0x365d14,!![]);}catch(_0x44fe06){return BPromise['reject'](_0x44fe06);}return _0x483ec4[_0x7ad5('0x22')]();};}function saveUpdates(_0x236c0d,_0x4649f1){return function(_0x23e538){if(_0x23e538){return _0x23e538[_0x7ad5('0x23')](_0x236c0d)['then'](function(_0x2b0637){return _0x2b0637;});}return null;};}function removeEntity(_0x351d79,_0x2875b1){return function(_0x50304c){if(_0x50304c){return _0x50304c[_0x7ad5('0x24')]()[_0x7ad5('0x25')](function(){_0x351d79['status'](0xcc)[_0x7ad5('0x1a')]();});}};}function handleEntityNotFound(_0x1a77b4,_0x1439c5){return function(_0x2ce91e){if(!_0x2ce91e){_0x1a77b4['sendStatus'](0x194);}return _0x2ce91e;};}function handleError(_0x219911,_0x409d83){_0x409d83=_0x409d83||0x1f4;return function(_0x46f06e){logger[_0x7ad5('0x26')](_0x46f06e[_0x7ad5('0x27')]);if(_0x46f06e[_0x7ad5('0x28')]){delete _0x46f06e[_0x7ad5('0x28')];}_0x219911['status'](_0x409d83)[_0x7ad5('0x29')](_0x46f06e);};}exports[_0x7ad5('0x2a')]=function(_0x234b1e,_0x414823){var _0x38ef08={},_0x203fc9={},_0x61a0dc={'count':0x0,'rows':[]};var _0x2543b0=_[_0x7ad5('0x2b')](db[_0x7ad5('0x2c')][_0x7ad5('0x2d')],function(_0x56c620){return{'name':_0x56c620[_0x7ad5('0x2e')],'type':_0x56c620[_0x7ad5('0x2f')][_0x7ad5('0x30')]};});_0x203fc9[_0x7ad5('0x31')]=_[_0x7ad5('0x2b')](_0x2543b0,'name');_0x203fc9[_0x7ad5('0x32')]=_[_0x7ad5('0x33')](_0x234b1e[_0x7ad5('0x32')]);_0x203fc9[_0x7ad5('0x34')]=_[_0x7ad5('0x35')](_0x203fc9['model'],_0x203fc9['query']);_0x38ef08[_0x7ad5('0x36')]=_['intersection'](_0x203fc9[_0x7ad5('0x31')],qs[_0x7ad5('0x37')](_0x234b1e[_0x7ad5('0x32')][_0x7ad5('0x37')]));_0x38ef08[_0x7ad5('0x36')]=_0x38ef08[_0x7ad5('0x36')][_0x7ad5('0x38')]?_0x38ef08['attributes']:_0x203fc9['model'];if(!_0x234b1e['query'][_0x7ad5('0x39')]('nolimit')){_0x38ef08[_0x7ad5('0x1f')]=qs[_0x7ad5('0x1f')](_0x234b1e['query'][_0x7ad5('0x1f')]);_0x38ef08['offset']=qs[_0x7ad5('0x1c')](_0x234b1e[_0x7ad5('0x32')]['offset']);}_0x38ef08[_0x7ad5('0x3a')]=qs[_0x7ad5('0x3b')](_0x234b1e[_0x7ad5('0x32')][_0x7ad5('0x3b')]);_0x38ef08[_0x7ad5('0x3c')]=qs[_0x7ad5('0x34')](_[_0x7ad5('0x3d')](_0x234b1e[_0x7ad5('0x32')],_0x203fc9[_0x7ad5('0x34')]),_0x2543b0);if(_0x234b1e[_0x7ad5('0x32')]['filter']){_0x38ef08[_0x7ad5('0x3c')]=_[_0x7ad5('0x3e')](_0x38ef08['where'],{'$or':_['map'](_0x2543b0,function(_0x5754ee){if(_0x5754ee[_0x7ad5('0x2f')]!=='VIRTUAL'){var _0x57763a={};_0x57763a[_0x5754ee[_0x7ad5('0x28')]]={'$like':'%'+_0x234b1e[_0x7ad5('0x32')][_0x7ad5('0x3f')]+'%'};return _0x57763a;}})});}_0x38ef08=_['merge']({},_0x38ef08,_0x234b1e[_0x7ad5('0x40')]);var _0x55cf24={'where':_0x38ef08['where']};return db[_0x7ad5('0x2c')][_0x7ad5('0x1e')](_0x55cf24)[_0x7ad5('0x25')](function(_0xce7c89){_0x61a0dc[_0x7ad5('0x1e')]=_0xce7c89;if(_0x234b1e['query']['includeAll']){_0x38ef08[_0x7ad5('0x41')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x38ef08);})['then'](function(_0x5db9fc){_0x61a0dc[_0x7ad5('0x42')]=_0x5db9fc;return _0x61a0dc;})[_0x7ad5('0x25')](respondWithFilteredResult(_0x414823,_0x38ef08))[_0x7ad5('0x43')](handleError(_0x414823,null));};exports[_0x7ad5('0x44')]=function(_0x2738b0,_0x2f1c8d){var _0x2d92bc={'raw':![],'where':{'id':_0x2738b0[_0x7ad5('0x45')]['id']}},_0x596e37={};_0x596e37['model']=_['keys'](db[_0x7ad5('0x2c')]['rawAttributes']);_0x596e37[_0x7ad5('0x32')]=_[_0x7ad5('0x33')](_0x2738b0[_0x7ad5('0x32')]);_0x596e37[_0x7ad5('0x34')]=_[_0x7ad5('0x35')](_0x596e37[_0x7ad5('0x31')],_0x596e37[_0x7ad5('0x32')]);_0x2d92bc['attributes']=_[_0x7ad5('0x35')](_0x596e37[_0x7ad5('0x31')],qs[_0x7ad5('0x37')](_0x2738b0['query'][_0x7ad5('0x37')]));_0x2d92bc['attributes']=_0x2d92bc[_0x7ad5('0x36')][_0x7ad5('0x38')]?_0x2d92bc[_0x7ad5('0x36')]:_0x596e37[_0x7ad5('0x31')];if(_0x2738b0[_0x7ad5('0x32')][_0x7ad5('0x46')]){_0x2d92bc['include']=[{'all':!![]}];}_0x2d92bc=_[_0x7ad5('0x3e')]({},_0x2d92bc,_0x2738b0[_0x7ad5('0x40')]);return db[_0x7ad5('0x2c')][_0x7ad5('0x47')](_0x2d92bc)['then'](handleEntityNotFound(_0x2f1c8d,null))[_0x7ad5('0x25')](respondWithResult(_0x2f1c8d,null))['catch'](handleError(_0x2f1c8d,null));};exports[_0x7ad5('0x48')]=function(_0x284f7e,_0x22631b){return db['FreshdeskConfiguration'][_0x7ad5('0x48')](_0x284f7e[_0x7ad5('0x49')],{})['then'](respondWithResult(_0x22631b,0xc9))[_0x7ad5('0x43')](handleError(_0x22631b,null));};exports[_0x7ad5('0x23')]=function(_0x5661e5,_0x38113e){if(_0x5661e5[_0x7ad5('0x49')]['id']){delete _0x5661e5[_0x7ad5('0x49')]['id'];}return db[_0x7ad5('0x2c')][_0x7ad5('0x47')]({'where':{'id':_0x5661e5['params']['id']}})['then'](handleEntityNotFound(_0x38113e,null))['then'](saveUpdates(_0x5661e5[_0x7ad5('0x49')],null))['then'](respondWithResult(_0x38113e,null))[_0x7ad5('0x43')](handleError(_0x38113e,null));};exports[_0x7ad5('0x24')]=function(_0x3151d3,_0x4b9f4a){return db['FreshdeskConfiguration'][_0x7ad5('0x47')]({'where':{'id':_0x3151d3[_0x7ad5('0x45')]['id']}})[_0x7ad5('0x25')](handleEntityNotFound(_0x4b9f4a,null))[_0x7ad5('0x25')](removeEntity(_0x4b9f4a,null))['catch'](handleError(_0x4b9f4a,null));};exports['getFields']=function(_0x22e773,_0x510cea,_0x453fbb){var _0x5cae3d={};var _0x288a9a={};var _0x41d7a1;var _0x5510cc;return db[_0x7ad5('0x2c')][_0x7ad5('0x4a')]({'where':{'id':_0x22e773[_0x7ad5('0x45')]['id']}})[_0x7ad5('0x25')](handleEntityNotFound(_0x510cea,null))['then'](function(_0x11d23a){if(_0x11d23a){_0x41d7a1=_0x11d23a;_0x288a9a[_0x7ad5('0x31')]=_[_0x7ad5('0x33')](db[_0x7ad5('0x4b')][_0x7ad5('0x2d')]);_0x288a9a['query']=_['keys'](_0x22e773['query']);_0x288a9a[_0x7ad5('0x34')]=_[_0x7ad5('0x35')](_0x288a9a[_0x7ad5('0x31')],_0x288a9a[_0x7ad5('0x32')]);_0x5cae3d[_0x7ad5('0x36')]=_['intersection'](_0x288a9a[_0x7ad5('0x31')],qs[_0x7ad5('0x37')](_0x22e773['query'][_0x7ad5('0x37')]));_0x5cae3d[_0x7ad5('0x36')]=_0x5cae3d['attributes']['length']?_0x5cae3d[_0x7ad5('0x36')]:_0x288a9a['model'];_0x5cae3d[_0x7ad5('0x3a')]=qs[_0x7ad5('0x3b')](_0x22e773[_0x7ad5('0x32')]['sort']);_0x5cae3d[_0x7ad5('0x3c')]=qs[_0x7ad5('0x34')](_[_0x7ad5('0x3d')](_0x22e773[_0x7ad5('0x32')],_0x288a9a['filters']));if(_0x22e773[_0x7ad5('0x32')][_0x7ad5('0x3f')]){_0x5cae3d[_0x7ad5('0x3c')]=_['merge'](_0x5cae3d[_0x7ad5('0x3c')],{'$or':_[_0x7ad5('0x2b')](_0x5cae3d[_0x7ad5('0x36')],function(_0x25d272){var _0x13c717={};_0x13c717[_0x25d272]={'$like':'%'+_0x22e773[_0x7ad5('0x32')][_0x7ad5('0x3f')]+'%'};return _0x13c717;})});}_0x5cae3d=_[_0x7ad5('0x3e')]({},_0x5cae3d,_0x22e773['options']);return _0x41d7a1[_0x7ad5('0x4c')](_0x5cae3d);}})[_0x7ad5('0x25')](function(_0x1801df){if(_0x1801df){_0x5510cc=_0x1801df[_0x7ad5('0x38')];if(!_0x22e773['query'][_0x7ad5('0x39')](_0x7ad5('0x4d'))){_0x5cae3d[_0x7ad5('0x1f')]=qs[_0x7ad5('0x1f')](_0x22e773[_0x7ad5('0x32')]['limit']);_0x5cae3d['offset']=qs['offset'](_0x22e773[_0x7ad5('0x32')]['offset']);}return _0x41d7a1['getFields'](_0x5cae3d);}})[_0x7ad5('0x25')](function(_0x57de4c){if(_0x57de4c){return _0x57de4c?{'count':_0x5510cc,'rows':_0x57de4c}:null;}})['then'](respondWithResult(_0x510cea,null))[_0x7ad5('0x43')](handleError(_0x510cea,null));};exports[_0x7ad5('0x4e')]=function(_0x556557,_0x3f1253,_0x1c92e9){var _0x2039cc={};var _0x59628a={};var _0x1dc12e;var _0x31c8db;return db[_0x7ad5('0x2c')][_0x7ad5('0x4a')]({'where':{'id':_0x556557[_0x7ad5('0x45')]['id']}})[_0x7ad5('0x25')](handleEntityNotFound(_0x3f1253,null))[_0x7ad5('0x25')](function(_0x1712d0){if(_0x1712d0){_0x1dc12e=_0x1712d0;_0x59628a[_0x7ad5('0x31')]=_[_0x7ad5('0x33')](db['FreshdeskField']['rawAttributes']);_0x59628a[_0x7ad5('0x32')]=_[_0x7ad5('0x33')](_0x556557['query']);_0x59628a[_0x7ad5('0x34')]=_[_0x7ad5('0x35')](_0x59628a[_0x7ad5('0x31')],_0x59628a[_0x7ad5('0x32')]);_0x2039cc[_0x7ad5('0x36')]=_[_0x7ad5('0x35')](_0x59628a[_0x7ad5('0x31')],qs[_0x7ad5('0x37')](_0x556557[_0x7ad5('0x32')]['fields']));_0x2039cc[_0x7ad5('0x36')]=_0x2039cc[_0x7ad5('0x36')][_0x7ad5('0x38')]?_0x2039cc[_0x7ad5('0x36')]:_0x59628a['model'];_0x2039cc[_0x7ad5('0x3a')]=qs[_0x7ad5('0x3b')](_0x556557[_0x7ad5('0x32')][_0x7ad5('0x3b')]);_0x2039cc[_0x7ad5('0x3c')]=qs[_0x7ad5('0x34')](_['pick'](_0x556557[_0x7ad5('0x32')],_0x59628a[_0x7ad5('0x34')]));if(_0x556557['query'][_0x7ad5('0x3f')]){_0x2039cc[_0x7ad5('0x3c')]=_[_0x7ad5('0x3e')](_0x2039cc[_0x7ad5('0x3c')],{'$or':_[_0x7ad5('0x2b')](_0x2039cc[_0x7ad5('0x36')],function(_0x2ba966){var _0x5ee353={};_0x5ee353[_0x2ba966]={'$like':'%'+_0x556557[_0x7ad5('0x32')][_0x7ad5('0x3f')]+'%'};return _0x5ee353;})});}_0x2039cc=_[_0x7ad5('0x3e')]({},_0x2039cc,_0x556557[_0x7ad5('0x40')]);return _0x1dc12e[_0x7ad5('0x4e')](_0x2039cc);}})[_0x7ad5('0x25')](function(_0x34148a){if(_0x34148a){_0x31c8db=_0x34148a[_0x7ad5('0x38')];if(!_0x556557[_0x7ad5('0x32')]['hasOwnProperty'](_0x7ad5('0x4d'))){_0x2039cc[_0x7ad5('0x1f')]=qs[_0x7ad5('0x1f')](_0x556557[_0x7ad5('0x32')][_0x7ad5('0x1f')]);_0x2039cc[_0x7ad5('0x1c')]=qs[_0x7ad5('0x1c')](_0x556557[_0x7ad5('0x32')][_0x7ad5('0x1c')]);}return _0x1dc12e[_0x7ad5('0x4e')](_0x2039cc);}})[_0x7ad5('0x25')](function(_0x4aba4d){if(_0x4aba4d){return _0x4aba4d?{'count':_0x31c8db,'rows':_0x4aba4d}:null;}})[_0x7ad5('0x25')](respondWithResult(_0x3f1253,null))['catch'](handleError(_0x3f1253,null));};exports[_0x7ad5('0x4f')]=function(_0x396bf0,_0x2997db,_0x1bf9cd){var _0x589b88={};var _0x602653={};var _0x458472;var _0x233946;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x396bf0['params']['id']}})['then'](handleEntityNotFound(_0x2997db,null))[_0x7ad5('0x25')](function(_0x3f6eeb){if(_0x3f6eeb){_0x458472=_0x3f6eeb;_0x602653[_0x7ad5('0x31')]=_['keys'](db[_0x7ad5('0x4b')][_0x7ad5('0x2d')]);_0x602653[_0x7ad5('0x32')]=_[_0x7ad5('0x33')](_0x396bf0[_0x7ad5('0x32')]);_0x602653[_0x7ad5('0x34')]=_['intersection'](_0x602653[_0x7ad5('0x31')],_0x602653[_0x7ad5('0x32')]);_0x589b88['attributes']=_[_0x7ad5('0x35')](_0x602653[_0x7ad5('0x31')],qs['fields'](_0x396bf0[_0x7ad5('0x32')][_0x7ad5('0x37')]));_0x589b88[_0x7ad5('0x36')]=_0x589b88[_0x7ad5('0x36')][_0x7ad5('0x38')]?_0x589b88[_0x7ad5('0x36')]:_0x602653[_0x7ad5('0x31')];_0x589b88[_0x7ad5('0x3a')]=qs[_0x7ad5('0x3b')](_0x396bf0[_0x7ad5('0x32')][_0x7ad5('0x3b')]);_0x589b88[_0x7ad5('0x3c')]=qs[_0x7ad5('0x34')](_[_0x7ad5('0x3d')](_0x396bf0['query'],_0x602653[_0x7ad5('0x34')]));if(_0x396bf0[_0x7ad5('0x32')][_0x7ad5('0x3f')]){_0x589b88[_0x7ad5('0x3c')]=_[_0x7ad5('0x3e')](_0x589b88['where'],{'$or':_[_0x7ad5('0x2b')](_0x589b88[_0x7ad5('0x36')],function(_0x588d73){var _0x3816ba={};_0x3816ba[_0x588d73]={'$like':'%'+_0x396bf0[_0x7ad5('0x32')][_0x7ad5('0x3f')]+'%'};return _0x3816ba;})});}_0x589b88=_[_0x7ad5('0x3e')]({},_0x589b88,_0x396bf0[_0x7ad5('0x40')]);return _0x458472[_0x7ad5('0x4f')](_0x589b88);}})[_0x7ad5('0x25')](function(_0x403a5e){if(_0x403a5e){_0x233946=_0x403a5e[_0x7ad5('0x38')];if(!_0x396bf0[_0x7ad5('0x32')][_0x7ad5('0x39')](_0x7ad5('0x4d'))){_0x589b88[_0x7ad5('0x1f')]=qs[_0x7ad5('0x1f')](_0x396bf0[_0x7ad5('0x32')]['limit']);_0x589b88[_0x7ad5('0x1c')]=qs[_0x7ad5('0x1c')](_0x396bf0['query'][_0x7ad5('0x1c')]);}return _0x458472[_0x7ad5('0x4f')](_0x589b88);}})[_0x7ad5('0x25')](function(_0x183a6d){if(_0x183a6d){return _0x183a6d?{'count':_0x233946,'rows':_0x183a6d}:null;}})[_0x7ad5('0x25')](respondWithResult(_0x2997db,null))[_0x7ad5('0x43')](handleError(_0x2997db,null));};exports['getTags']=function(_0x2e5252,_0x245da0,_0x5205d1){var _0x30df61={};var _0xd1da83={};var _0x2b4e6c;var _0x524a57;return db[_0x7ad5('0x2c')][_0x7ad5('0x4a')]({'where':{'id':_0x2e5252[_0x7ad5('0x45')]['id']}})[_0x7ad5('0x25')](handleEntityNotFound(_0x245da0,null))[_0x7ad5('0x25')](function(_0x1db6e4){if(_0x1db6e4){_0x2b4e6c=_0x1db6e4;_0xd1da83['model']=_[_0x7ad5('0x33')](db[_0x7ad5('0x50')]['rawAttributes']);_0xd1da83[_0x7ad5('0x32')]=_[_0x7ad5('0x33')](_0x2e5252[_0x7ad5('0x32')]);_0xd1da83[_0x7ad5('0x34')]=_[_0x7ad5('0x35')](_0xd1da83[_0x7ad5('0x31')],_0xd1da83[_0x7ad5('0x32')]);_0x30df61[_0x7ad5('0x36')]=_[_0x7ad5('0x35')](_0xd1da83[_0x7ad5('0x31')],qs[_0x7ad5('0x37')](_0x2e5252[_0x7ad5('0x32')]['fields']));_0x30df61[_0x7ad5('0x36')]=_0x30df61[_0x7ad5('0x36')][_0x7ad5('0x38')]?_0x30df61[_0x7ad5('0x36')]:_0xd1da83['model'];_0x30df61[_0x7ad5('0x3a')]=qs['sort'](_0x2e5252[_0x7ad5('0x32')][_0x7ad5('0x3b')]);_0x30df61[_0x7ad5('0x3c')]=qs[_0x7ad5('0x34')](_['pick'](_0x2e5252['query'],_0xd1da83[_0x7ad5('0x34')]));if(_0x2e5252[_0x7ad5('0x32')][_0x7ad5('0x3f')]){_0x30df61[_0x7ad5('0x3c')]=_[_0x7ad5('0x3e')](_0x30df61[_0x7ad5('0x3c')],{'$or':_[_0x7ad5('0x2b')](_0x30df61[_0x7ad5('0x36')],function(_0x387f87){var _0x50f8b1={};_0x50f8b1[_0x387f87]={'$like':'%'+_0x2e5252['query'][_0x7ad5('0x3f')]+'%'};return _0x50f8b1;})});}_0x30df61=_[_0x7ad5('0x3e')]({},_0x30df61,_0x2e5252[_0x7ad5('0x40')]);return _0x2b4e6c[_0x7ad5('0x51')](_0x30df61);}})[_0x7ad5('0x25')](function(_0x2f2a42){if(_0x2f2a42){_0x524a57=_0x2f2a42[_0x7ad5('0x38')];if(!_0x2e5252[_0x7ad5('0x32')][_0x7ad5('0x39')]('nolimit')){_0x30df61['limit']=qs['limit'](_0x2e5252[_0x7ad5('0x32')][_0x7ad5('0x1f')]);_0x30df61['offset']=qs[_0x7ad5('0x1c')](_0x2e5252[_0x7ad5('0x32')][_0x7ad5('0x1c')]);}return _0x2b4e6c[_0x7ad5('0x51')](_0x30df61);}})[_0x7ad5('0x25')](function(_0x3a90c1){if(_0x3a90c1){return _0x3a90c1?{'count':_0x524a57,'rows':_0x3a90c1}:null;}})[_0x7ad5('0x25')](respondWithResult(_0x245da0,null))[_0x7ad5('0x43')](handleError(_0x245da0,null));};exports['setTags']=function(_0x33ca51,_0x14be0c,_0x2d9126){if(_0x33ca51[_0x7ad5('0x49')]['id']){delete _0x33ca51['body']['id'];}return db[_0x7ad5('0x2c')][_0x7ad5('0x4a')]({'where':{'id':_0x33ca51[_0x7ad5('0x45')]['id']}})[_0x7ad5('0x25')](handleEntityNotFound(_0x14be0c,null))[_0x7ad5('0x25')](function(_0x4dde0c){if(_0x4dde0c){return _0x4dde0c[_0x7ad5('0x52')](_0x33ca51['body']['ids']||[]);}return null;})[_0x7ad5('0x25')](respondWithResult(_0x14be0c,null))[_0x7ad5('0x43')](handleError(_0x14be0c,null));}; \ No newline at end of file +var _0x26de=['end','json','offset','undefined','limit','count','set','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','includeAll','FreshdeskConfiguration','findAll','rows','catch','show','params','find','create','body','destroy','getFields','findOne','filter','options','FreshdeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x45f2bf,_0xea1ab0){var _0xd4b0df=function(_0x5c08b2){while(--_0x5c08b2){_0x45f2bf['push'](_0x45f2bf['shift']());}};_0xd4b0df(++_0xea1ab0);}(_0x26de,0x178));var _0xe26d=function(_0x5f3a48,_0x306ee0){_0x5f3a48=_0x5f3a48-0x0;var _0x2aa6b2=_0x26de[_0x5f3a48];return _0x2aa6b2;};'use strict';var emlformat=require(_0xe26d('0x0'));var rimraf=require(_0xe26d('0x1'));var zipdir=require(_0xe26d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe26d('0x3'));var BPromise=require(_0xe26d('0x4'));var Mustache=require(_0xe26d('0x5'));var util=require(_0xe26d('0x6'));var path=require(_0xe26d('0x7'));var sox=require(_0xe26d('0x8'));var csv=require(_0xe26d('0x9'));var ejs=require(_0xe26d('0xa'));var fs=require('fs');var fs_extra=require(_0xe26d('0xb'));var _=require(_0xe26d('0xc'));var squel=require('squel');var crypto=require(_0xe26d('0xd'));var jsforce=require(_0xe26d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe26d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe26d('0x10'));var as=require(_0xe26d('0x11'));var hardwareService=require(_0xe26d('0x12'));var logger=require('../../config/logger')(_0xe26d('0x13'));var utils=require('../../config/utils');var config=require(_0xe26d('0x14'));var licenseUtil=require(_0xe26d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c2eb4,_0x2fb67c){_0x2fb67c=_0x2fb67c||0xcc;return function(_0x936041){if(_0x936041){return _0x5c2eb4[_0xe26d('0x16')](_0x2fb67c);}return _0x5c2eb4[_0xe26d('0x17')](_0x2fb67c)[_0xe26d('0x18')]();};}function respondWithResult(_0xec75dd,_0x6cef8a){_0x6cef8a=_0x6cef8a||0xc8;return function(_0xad7962){if(_0xad7962){return _0xec75dd[_0xe26d('0x17')](_0x6cef8a)[_0xe26d('0x19')](_0xad7962);}};}function respondWithFilteredResult(_0x3a21e0,_0x37b5e7){return function(_0x2555e3){if(_0x2555e3){var _0x4e8886=typeof _0x37b5e7[_0xe26d('0x1a')]===_0xe26d('0x1b')&&typeof _0x37b5e7[_0xe26d('0x1c')]===_0xe26d('0x1b');var _0x49471e=_0x2555e3['count'];var _0x35fe2b=_0x4e8886?0x0:_0x37b5e7[_0xe26d('0x1a')];var _0x576cbc=_0x4e8886?_0x2555e3[_0xe26d('0x1d')]:_0x37b5e7[_0xe26d('0x1a')]+_0x37b5e7[_0xe26d('0x1c')];var _0x8e425;if(_0x576cbc>=_0x49471e){_0x576cbc=_0x49471e;_0x8e425=0xc8;}else{_0x8e425=0xce;}_0x3a21e0[_0xe26d('0x17')](_0x8e425);return _0x3a21e0[_0xe26d('0x1e')]('Content-Range',_0x35fe2b+'-'+_0x576cbc+'/'+_0x49471e)['json'](_0x2555e3);}return null;};}function patchUpdates(_0x7bcebb){return function(_0x2b9d23){try{jsonpatch[_0xe26d('0x1f')](_0x2b9d23,_0x7bcebb,!![]);}catch(_0xfc9d71){return BPromise[_0xe26d('0x20')](_0xfc9d71);}return _0x2b9d23['save']();};}function saveUpdates(_0x39c79c,_0x22520c){return function(_0x459935){if(_0x459935){return _0x459935[_0xe26d('0x21')](_0x39c79c)[_0xe26d('0x22')](function(_0x3fa4a3){return _0x3fa4a3;});}return null;};}function removeEntity(_0x2cda80,_0x40edd9){return function(_0xe193b1){if(_0xe193b1){return _0xe193b1['destroy']()['then'](function(){_0x2cda80['status'](0xcc)[_0xe26d('0x18')]();});}};}function handleEntityNotFound(_0x3b98dd,_0x9f5deb){return function(_0x482ba2){if(!_0x482ba2){_0x3b98dd[_0xe26d('0x16')](0x194);}return _0x482ba2;};}function handleError(_0x45e8ef,_0x573b63){_0x573b63=_0x573b63||0x1f4;return function(_0x2f705c){logger['error'](_0x2f705c[_0xe26d('0x23')]);if(_0x2f705c['name']){delete _0x2f705c[_0xe26d('0x24')];}_0x45e8ef[_0xe26d('0x17')](_0x573b63)[_0xe26d('0x25')](_0x2f705c);};}exports[_0xe26d('0x26')]=function(_0x48034e,_0x62e331){var _0xbbd786={},_0x4f0b91={},_0x1a0eba={'count':0x0,'rows':[]};var _0x35c16d=_[_0xe26d('0x27')](db['FreshdeskConfiguration'][_0xe26d('0x28')],function(_0x2af018){return{'name':_0x2af018[_0xe26d('0x29')],'type':_0x2af018['type'][_0xe26d('0x2a')]};});_0x4f0b91[_0xe26d('0x2b')]=_['map'](_0x35c16d,_0xe26d('0x24'));_0x4f0b91[_0xe26d('0x2c')]=_[_0xe26d('0x2d')](_0x48034e['query']);_0x4f0b91['filters']=_[_0xe26d('0x2e')](_0x4f0b91[_0xe26d('0x2b')],_0x4f0b91[_0xe26d('0x2c')]);_0xbbd786[_0xe26d('0x2f')]=_['intersection'](_0x4f0b91['model'],qs[_0xe26d('0x30')](_0x48034e[_0xe26d('0x2c')][_0xe26d('0x30')]));_0xbbd786['attributes']=_0xbbd786['attributes'][_0xe26d('0x31')]?_0xbbd786[_0xe26d('0x2f')]:_0x4f0b91[_0xe26d('0x2b')];if(!_0x48034e[_0xe26d('0x2c')][_0xe26d('0x32')](_0xe26d('0x33'))){_0xbbd786[_0xe26d('0x1c')]=qs[_0xe26d('0x1c')](_0x48034e[_0xe26d('0x2c')][_0xe26d('0x1c')]);_0xbbd786[_0xe26d('0x1a')]=qs[_0xe26d('0x1a')](_0x48034e[_0xe26d('0x2c')]['offset']);}_0xbbd786[_0xe26d('0x34')]=qs[_0xe26d('0x35')](_0x48034e[_0xe26d('0x2c')][_0xe26d('0x35')]);_0xbbd786[_0xe26d('0x36')]=qs[_0xe26d('0x37')](_[_0xe26d('0x38')](_0x48034e['query'],_0x4f0b91[_0xe26d('0x37')]),_0x35c16d);if(_0x48034e[_0xe26d('0x2c')]['filter']){_0xbbd786['where']=_[_0xe26d('0x39')](_0xbbd786[_0xe26d('0x36')],{'$or':_[_0xe26d('0x27')](_0x35c16d,function(_0x2cc6e1){if(_0x2cc6e1[_0xe26d('0x3a')]!==_0xe26d('0x3b')){var _0x580a38={};_0x580a38[_0x2cc6e1['name']]={'$like':'%'+_0x48034e[_0xe26d('0x2c')]['filter']+'%'};return _0x580a38;}})});}_0xbbd786=_[_0xe26d('0x39')]({},_0xbbd786,_0x48034e['options']);var _0x34e5c2={'where':_0xbbd786[_0xe26d('0x36')]};return db['FreshdeskConfiguration'][_0xe26d('0x1d')](_0x34e5c2)['then'](function(_0x20ba66){_0x1a0eba['count']=_0x20ba66;if(_0x48034e[_0xe26d('0x2c')][_0xe26d('0x3c')]){_0xbbd786['include']=[{'all':!![]}];}return db[_0xe26d('0x3d')][_0xe26d('0x3e')](_0xbbd786);})[_0xe26d('0x22')](function(_0x23dfd5){_0x1a0eba[_0xe26d('0x3f')]=_0x23dfd5;return _0x1a0eba;})[_0xe26d('0x22')](respondWithFilteredResult(_0x62e331,_0xbbd786))[_0xe26d('0x40')](handleError(_0x62e331,null));};exports[_0xe26d('0x41')]=function(_0x3e4f97,_0x48a8e4){var _0x5719e2={'raw':![],'where':{'id':_0x3e4f97[_0xe26d('0x42')]['id']}},_0x2f0d2a={};_0x2f0d2a[_0xe26d('0x2b')]=_[_0xe26d('0x2d')](db[_0xe26d('0x3d')][_0xe26d('0x28')]);_0x2f0d2a[_0xe26d('0x2c')]=_[_0xe26d('0x2d')](_0x3e4f97[_0xe26d('0x2c')]);_0x2f0d2a[_0xe26d('0x37')]=_[_0xe26d('0x2e')](_0x2f0d2a[_0xe26d('0x2b')],_0x2f0d2a[_0xe26d('0x2c')]);_0x5719e2['attributes']=_[_0xe26d('0x2e')](_0x2f0d2a[_0xe26d('0x2b')],qs['fields'](_0x3e4f97[_0xe26d('0x2c')][_0xe26d('0x30')]));_0x5719e2['attributes']=_0x5719e2[_0xe26d('0x2f')][_0xe26d('0x31')]?_0x5719e2[_0xe26d('0x2f')]:_0x2f0d2a['model'];if(_0x3e4f97[_0xe26d('0x2c')][_0xe26d('0x3c')]){_0x5719e2['include']=[{'all':!![]}];}_0x5719e2=_[_0xe26d('0x39')]({},_0x5719e2,_0x3e4f97['options']);return db['FreshdeskConfiguration'][_0xe26d('0x43')](_0x5719e2)[_0xe26d('0x22')](handleEntityNotFound(_0x48a8e4,null))[_0xe26d('0x22')](respondWithResult(_0x48a8e4,null))[_0xe26d('0x40')](handleError(_0x48a8e4,null));};exports[_0xe26d('0x44')]=function(_0x3af572,_0x1c6dde){return db['FreshdeskConfiguration'][_0xe26d('0x44')](_0x3af572[_0xe26d('0x45')],{})['then'](respondWithResult(_0x1c6dde,0xc9))['catch'](handleError(_0x1c6dde,null));};exports['update']=function(_0x98848,_0x447abc){if(_0x98848[_0xe26d('0x45')]['id']){delete _0x98848[_0xe26d('0x45')]['id'];}return db[_0xe26d('0x3d')][_0xe26d('0x43')]({'where':{'id':_0x98848[_0xe26d('0x42')]['id']}})[_0xe26d('0x22')](handleEntityNotFound(_0x447abc,null))[_0xe26d('0x22')](saveUpdates(_0x98848[_0xe26d('0x45')],null))[_0xe26d('0x22')](respondWithResult(_0x447abc,null))[_0xe26d('0x40')](handleError(_0x447abc,null));};exports[_0xe26d('0x46')]=function(_0x43955c,_0x4b40dd){return db[_0xe26d('0x3d')][_0xe26d('0x43')]({'where':{'id':_0x43955c[_0xe26d('0x42')]['id']}})[_0xe26d('0x22')](handleEntityNotFound(_0x4b40dd,null))['then'](removeEntity(_0x4b40dd,null))[_0xe26d('0x40')](handleError(_0x4b40dd,null));};exports[_0xe26d('0x47')]=function(_0x169ed9,_0x2705af,_0x233015){var _0x2ca145={};var _0x554732={};var _0x3a6894;var _0x4c1f8d;return db['FreshdeskConfiguration'][_0xe26d('0x48')]({'where':{'id':_0x169ed9[_0xe26d('0x42')]['id']}})[_0xe26d('0x22')](handleEntityNotFound(_0x2705af,null))[_0xe26d('0x22')](function(_0x5e8f7e){if(_0x5e8f7e){_0x3a6894=_0x5e8f7e;_0x554732[_0xe26d('0x2b')]=_[_0xe26d('0x2d')](db['FreshdeskField'][_0xe26d('0x28')]);_0x554732[_0xe26d('0x2c')]=_['keys'](_0x169ed9[_0xe26d('0x2c')]);_0x554732[_0xe26d('0x37')]=_[_0xe26d('0x2e')](_0x554732[_0xe26d('0x2b')],_0x554732[_0xe26d('0x2c')]);_0x2ca145[_0xe26d('0x2f')]=_['intersection'](_0x554732['model'],qs[_0xe26d('0x30')](_0x169ed9['query'][_0xe26d('0x30')]));_0x2ca145[_0xe26d('0x2f')]=_0x2ca145[_0xe26d('0x2f')]['length']?_0x2ca145[_0xe26d('0x2f')]:_0x554732['model'];_0x2ca145[_0xe26d('0x34')]=qs['sort'](_0x169ed9[_0xe26d('0x2c')][_0xe26d('0x35')]);_0x2ca145[_0xe26d('0x36')]=qs[_0xe26d('0x37')](_[_0xe26d('0x38')](_0x169ed9[_0xe26d('0x2c')],_0x554732[_0xe26d('0x37')]));if(_0x169ed9[_0xe26d('0x2c')]['filter']){_0x2ca145[_0xe26d('0x36')]=_[_0xe26d('0x39')](_0x2ca145[_0xe26d('0x36')],{'$or':_[_0xe26d('0x27')](_0x2ca145[_0xe26d('0x2f')],function(_0x3a58b8){var _0x967c92={};_0x967c92[_0x3a58b8]={'$like':'%'+_0x169ed9[_0xe26d('0x2c')][_0xe26d('0x49')]+'%'};return _0x967c92;})});}_0x2ca145=_['merge']({},_0x2ca145,_0x169ed9[_0xe26d('0x4a')]);return _0x3a6894[_0xe26d('0x47')](_0x2ca145);}})[_0xe26d('0x22')](function(_0x31d0cf){if(_0x31d0cf){_0x4c1f8d=_0x31d0cf['length'];if(!_0x169ed9[_0xe26d('0x2c')][_0xe26d('0x32')](_0xe26d('0x33'))){_0x2ca145['limit']=qs['limit'](_0x169ed9[_0xe26d('0x2c')]['limit']);_0x2ca145[_0xe26d('0x1a')]=qs[_0xe26d('0x1a')](_0x169ed9[_0xe26d('0x2c')]['offset']);}return _0x3a6894[_0xe26d('0x47')](_0x2ca145);}})['then'](function(_0x49d222){if(_0x49d222){return _0x49d222?{'count':_0x4c1f8d,'rows':_0x49d222}:null;}})['then'](respondWithResult(_0x2705af,null))[_0xe26d('0x40')](handleError(_0x2705af,null));};exports['getSubjects']=function(_0x4fc418,_0x59031f,_0xcc90f8){var _0x36d0ac={};var _0x2c1d56={};var _0x21e3b1;var _0x1bcc73;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4fc418['params']['id']}})['then'](handleEntityNotFound(_0x59031f,null))[_0xe26d('0x22')](function(_0x579db5){if(_0x579db5){_0x21e3b1=_0x579db5;_0x2c1d56[_0xe26d('0x2b')]=_[_0xe26d('0x2d')](db[_0xe26d('0x4b')][_0xe26d('0x28')]);_0x2c1d56[_0xe26d('0x2c')]=_[_0xe26d('0x2d')](_0x4fc418['query']);_0x2c1d56['filters']=_[_0xe26d('0x2e')](_0x2c1d56[_0xe26d('0x2b')],_0x2c1d56[_0xe26d('0x2c')]);_0x36d0ac[_0xe26d('0x2f')]=_[_0xe26d('0x2e')](_0x2c1d56[_0xe26d('0x2b')],qs[_0xe26d('0x30')](_0x4fc418['query'][_0xe26d('0x30')]));_0x36d0ac[_0xe26d('0x2f')]=_0x36d0ac[_0xe26d('0x2f')]['length']?_0x36d0ac['attributes']:_0x2c1d56['model'];_0x36d0ac[_0xe26d('0x34')]=qs[_0xe26d('0x35')](_0x4fc418[_0xe26d('0x2c')]['sort']);_0x36d0ac[_0xe26d('0x36')]=qs['filters'](_['pick'](_0x4fc418[_0xe26d('0x2c')],_0x2c1d56[_0xe26d('0x37')]));if(_0x4fc418[_0xe26d('0x2c')][_0xe26d('0x49')]){_0x36d0ac[_0xe26d('0x36')]=_[_0xe26d('0x39')](_0x36d0ac['where'],{'$or':_['map'](_0x36d0ac[_0xe26d('0x2f')],function(_0x21c0c8){var _0x152704={};_0x152704[_0x21c0c8]={'$like':'%'+_0x4fc418[_0xe26d('0x2c')]['filter']+'%'};return _0x152704;})});}_0x36d0ac=_['merge']({},_0x36d0ac,_0x4fc418['options']);return _0x21e3b1['getSubjects'](_0x36d0ac);}})['then'](function(_0x6562d0){if(_0x6562d0){_0x1bcc73=_0x6562d0[_0xe26d('0x31')];if(!_0x4fc418[_0xe26d('0x2c')][_0xe26d('0x32')](_0xe26d('0x33'))){_0x36d0ac[_0xe26d('0x1c')]=qs[_0xe26d('0x1c')](_0x4fc418['query'][_0xe26d('0x1c')]);_0x36d0ac[_0xe26d('0x1a')]=qs[_0xe26d('0x1a')](_0x4fc418['query'][_0xe26d('0x1a')]);}return _0x21e3b1['getSubjects'](_0x36d0ac);}})[_0xe26d('0x22')](function(_0xeb5e3d){if(_0xeb5e3d){return _0xeb5e3d?{'count':_0x1bcc73,'rows':_0xeb5e3d}:null;}})['then'](respondWithResult(_0x59031f,null))[_0xe26d('0x40')](handleError(_0x59031f,null));};exports['getDescriptions']=function(_0x3aed72,_0x446707,_0x10c80a){var _0x1a4f98={};var _0x369177={};var _0x4c553a;var _0x2673fe;return db[_0xe26d('0x3d')][_0xe26d('0x48')]({'where':{'id':_0x3aed72['params']['id']}})[_0xe26d('0x22')](handleEntityNotFound(_0x446707,null))[_0xe26d('0x22')](function(_0x1261ee){if(_0x1261ee){_0x4c553a=_0x1261ee;_0x369177[_0xe26d('0x2b')]=_['keys'](db[_0xe26d('0x4b')][_0xe26d('0x28')]);_0x369177[_0xe26d('0x2c')]=_['keys'](_0x3aed72[_0xe26d('0x2c')]);_0x369177['filters']=_[_0xe26d('0x2e')](_0x369177[_0xe26d('0x2b')],_0x369177[_0xe26d('0x2c')]);_0x1a4f98[_0xe26d('0x2f')]=_[_0xe26d('0x2e')](_0x369177[_0xe26d('0x2b')],qs[_0xe26d('0x30')](_0x3aed72[_0xe26d('0x2c')][_0xe26d('0x30')]));_0x1a4f98['attributes']=_0x1a4f98[_0xe26d('0x2f')][_0xe26d('0x31')]?_0x1a4f98[_0xe26d('0x2f')]:_0x369177[_0xe26d('0x2b')];_0x1a4f98[_0xe26d('0x34')]=qs[_0xe26d('0x35')](_0x3aed72[_0xe26d('0x2c')][_0xe26d('0x35')]);_0x1a4f98['where']=qs['filters'](_[_0xe26d('0x38')](_0x3aed72[_0xe26d('0x2c')],_0x369177['filters']));if(_0x3aed72[_0xe26d('0x2c')][_0xe26d('0x49')]){_0x1a4f98[_0xe26d('0x36')]=_[_0xe26d('0x39')](_0x1a4f98[_0xe26d('0x36')],{'$or':_['map'](_0x1a4f98[_0xe26d('0x2f')],function(_0xb9a27a){var _0x278ad2={};_0x278ad2[_0xb9a27a]={'$like':'%'+_0x3aed72[_0xe26d('0x2c')][_0xe26d('0x49')]+'%'};return _0x278ad2;})});}_0x1a4f98=_['merge']({},_0x1a4f98,_0x3aed72['options']);return _0x4c553a[_0xe26d('0x4c')](_0x1a4f98);}})[_0xe26d('0x22')](function(_0x308649){if(_0x308649){_0x2673fe=_0x308649[_0xe26d('0x31')];if(!_0x3aed72['query'][_0xe26d('0x32')](_0xe26d('0x33'))){_0x1a4f98['limit']=qs[_0xe26d('0x1c')](_0x3aed72['query'][_0xe26d('0x1c')]);_0x1a4f98['offset']=qs[_0xe26d('0x1a')](_0x3aed72[_0xe26d('0x2c')][_0xe26d('0x1a')]);}return _0x4c553a[_0xe26d('0x4c')](_0x1a4f98);}})[_0xe26d('0x22')](function(_0x3ad705){if(_0x3ad705){return _0x3ad705?{'count':_0x2673fe,'rows':_0x3ad705}:null;}})[_0xe26d('0x22')](respondWithResult(_0x446707,null))['catch'](handleError(_0x446707,null));};exports[_0xe26d('0x4d')]=function(_0x5804ce,_0x31b3fd,_0x54a498){var _0x2f48eb={};var _0x1743ae={};var _0x14474d;var _0x1f494a;return db[_0xe26d('0x3d')][_0xe26d('0x48')]({'where':{'id':_0x5804ce[_0xe26d('0x42')]['id']}})['then'](handleEntityNotFound(_0x31b3fd,null))[_0xe26d('0x22')](function(_0xff8cad){if(_0xff8cad){_0x14474d=_0xff8cad;_0x1743ae[_0xe26d('0x2b')]=_[_0xe26d('0x2d')](db[_0xe26d('0x4e')]['rawAttributes']);_0x1743ae['query']=_[_0xe26d('0x2d')](_0x5804ce[_0xe26d('0x2c')]);_0x1743ae[_0xe26d('0x37')]=_['intersection'](_0x1743ae[_0xe26d('0x2b')],_0x1743ae[_0xe26d('0x2c')]);_0x2f48eb[_0xe26d('0x2f')]=_['intersection'](_0x1743ae[_0xe26d('0x2b')],qs['fields'](_0x5804ce[_0xe26d('0x2c')][_0xe26d('0x30')]));_0x2f48eb[_0xe26d('0x2f')]=_0x2f48eb['attributes'][_0xe26d('0x31')]?_0x2f48eb[_0xe26d('0x2f')]:_0x1743ae[_0xe26d('0x2b')];_0x2f48eb['order']=qs[_0xe26d('0x35')](_0x5804ce[_0xe26d('0x2c')]['sort']);_0x2f48eb['where']=qs['filters'](_['pick'](_0x5804ce[_0xe26d('0x2c')],_0x1743ae[_0xe26d('0x37')]));if(_0x5804ce[_0xe26d('0x2c')][_0xe26d('0x49')]){_0x2f48eb['where']=_['merge'](_0x2f48eb[_0xe26d('0x36')],{'$or':_[_0xe26d('0x27')](_0x2f48eb[_0xe26d('0x2f')],function(_0x96d34d){var _0x1547f8={};_0x1547f8[_0x96d34d]={'$like':'%'+_0x5804ce[_0xe26d('0x2c')][_0xe26d('0x49')]+'%'};return _0x1547f8;})});}_0x2f48eb=_[_0xe26d('0x39')]({},_0x2f48eb,_0x5804ce[_0xe26d('0x4a')]);return _0x14474d['getTags'](_0x2f48eb);}})['then'](function(_0x3f7bab){if(_0x3f7bab){_0x1f494a=_0x3f7bab['length'];if(!_0x5804ce['query'][_0xe26d('0x32')]('nolimit')){_0x2f48eb[_0xe26d('0x1c')]=qs[_0xe26d('0x1c')](_0x5804ce[_0xe26d('0x2c')][_0xe26d('0x1c')]);_0x2f48eb[_0xe26d('0x1a')]=qs[_0xe26d('0x1a')](_0x5804ce['query'][_0xe26d('0x1a')]);}return _0x14474d[_0xe26d('0x4d')](_0x2f48eb);}})[_0xe26d('0x22')](function(_0x577db2){if(_0x577db2){return _0x577db2?{'count':_0x1f494a,'rows':_0x577db2}:null;}})[_0xe26d('0x22')](respondWithResult(_0x31b3fd,null))[_0xe26d('0x40')](handleError(_0x31b3fd,null));};exports[_0xe26d('0x4f')]=function(_0xdc2641,_0x20be0f,_0x49a229){if(_0xdc2641[_0xe26d('0x45')]['id']){delete _0xdc2641[_0xe26d('0x45')]['id'];}return db[_0xe26d('0x3d')][_0xe26d('0x48')]({'where':{'id':_0xdc2641[_0xe26d('0x42')]['id']}})[_0xe26d('0x22')](handleEntityNotFound(_0x20be0f,null))[_0xe26d('0x22')](function(_0x4269a7){if(_0x4269a7){return _0x4269a7[_0xe26d('0x4f')](_0xdc2641[_0xe26d('0x45')]['ids']||[]);}return null;})[_0xe26d('0x22')](respondWithResult(_0x20be0f,null))['catch'](handleError(_0x20be0f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a08a420..1b79e06 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 _0xa1b0=['rimraf','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x229e80,_0x414425){var _0x30c4a4=function(_0x249225){while(--_0x249225){_0x229e80['push'](_0x229e80['shift']());}};_0x30c4a4(++_0x414425);}(_0xa1b0,0xf7));var _0x0a1b=function(_0x18dd91,_0x2f0900){_0x18dd91=_0x18dd91-0x0;var _0x11cd61=_0xa1b0[_0x18dd91];return _0x11cd61;};'use strict';var _=require(_0x0a1b('0x0'));var util=require('util');var logger=require(_0x0a1b('0x1'))(_0x0a1b('0x2'));var moment=require(_0x0a1b('0x3'));var BPromise=require(_0x0a1b('0x4'));var rp=require(_0x0a1b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a1b('0x6'));var config=require(_0x0a1b('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x4919ce,_0x25e511){return _0x4919ce[_0x0a1b('0x8')](_0x0a1b('0x9'),attributes,{'tableName':_0x0a1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf865=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash'];(function(_0x35ee4e,_0x5d1c65){var _0x27cab1=function(_0x75d4c4){while(--_0x75d4c4){_0x35ee4e['push'](_0x35ee4e['shift']());}};_0x27cab1(++_0x5d1c65);}(_0xf865,0x1ac));var _0x5f86=function(_0x53f402,_0x326920){_0x53f402=_0x53f402-0x0;var _0x45a76d=_0xf865[_0x53f402];return _0x45a76d;};'use strict';var _=require(_0x5f86('0x0'));var util=require('util');var logger=require(_0x5f86('0x1'))('api');var moment=require(_0x5f86('0x2'));var BPromise=require(_0x5f86('0x3'));var rp=require(_0x5f86('0x4'));var fs=require('fs');var path=require(_0x5f86('0x5'));var rimraf=require(_0x5f86('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f86('0x7'));module[_0x5f86('0x8')]=function(_0x30ee14,_0x3e0792){return _0x30ee14[_0x5f86('0x9')](_0x5f86('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 450aa5b..af0fce8 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 _0xcb35=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','ioredis'];(function(_0x25af7d,_0xce76bd){var _0x353e11=function(_0x2ae547){while(--_0x2ae547){_0x25af7d['push'](_0x25af7d['shift']());}};_0x353e11(++_0xce76bd);}(_0xcb35,0xce));var _0x5cb3=function(_0x1685af,_0x457611){_0x1685af=_0x1685af-0x0;var _0x11a830=_0xcb35[_0x1685af];return _0x11a830;};'use strict';var _=require(_0x5cb3('0x0'));var util=require(_0x5cb3('0x1'));var moment=require(_0x5cb3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cb3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5cb3('0x4'));var logger=require(_0x5cb3('0x5'))(_0x5cb3('0x6'));var config=require(_0x5cb3('0x7'));var jayson=require(_0x5cb3('0x8'));var client=jayson[_0x5cb3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b9515,_0x74e604,_0x54ccaf){return new BPromise(function(_0x5315b5,_0x340120){return client['request'](_0x3b9515,_0x54ccaf)[_0x5cb3('0xa')](function(_0x40d57a){logger['info'](_0x5cb3('0xb'),_0x74e604,_0x5cb3('0xc'));logger[_0x5cb3('0xd')](_0x5cb3('0xe'),_0x74e604,_0x5cb3('0xc'),JSON[_0x5cb3('0xf')](_0x40d57a));if(_0x40d57a[_0x5cb3('0x10')]){if(_0x40d57a[_0x5cb3('0x10')][_0x5cb3('0x11')]===0x1f4){logger[_0x5cb3('0x10')](_0x5cb3('0xb'),_0x74e604,_0x40d57a['error']['message']);return _0x340120(_0x40d57a['error'][_0x5cb3('0x12')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x74e604,_0x40d57a['error'][_0x5cb3('0x12')]);return _0x5315b5(_0x40d57a[_0x5cb3('0x10')][_0x5cb3('0x12')]);}else{logger[_0x5cb3('0x13')](_0x5cb3('0xb'),_0x74e604,_0x5cb3('0xc'));_0x5315b5(_0x40d57a['result'][_0x5cb3('0x12')]);}})[_0x5cb3('0x14')](function(_0x4dbc21){logger['error'](_0x5cb3('0xb'),_0x74e604,_0x4dbc21);_0x340120(_0x4dbc21);});});} \ No newline at end of file +var _0x152f=['code','message','error','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x576e65,_0x4d41fe){var _0x434f5a=function(_0x169335){while(--_0x169335){_0x576e65['push'](_0x576e65['shift']());}};_0x434f5a(++_0x4d41fe);}(_0x152f,0x140));var _0xf152=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x152f[_0x34021d];return _0x16597b;};'use strict';var _=require(_0xf152('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf152('0x1'));var rs=require(_0xf152('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf152('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf152('0x4'))(_0xf152('0x5'));var config=require('../../config/environment');var jayson=require(_0xf152('0x6'));var client=jayson['client'][_0xf152('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2bf8b1,_0x1be40b,_0x4f0857){return new BPromise(function(_0x374c2e,_0x2b7576){return client[_0xf152('0x8')](_0x2bf8b1,_0x4f0857)[_0xf152('0x9')](function(_0x5559a0){logger[_0xf152('0xa')](_0xf152('0xb'),_0x1be40b,'request\x20sent');logger[_0xf152('0xc')](_0xf152('0xd'),_0x1be40b,_0xf152('0xe'),JSON[_0xf152('0xf')](_0x5559a0));if(_0x5559a0['error']){if(_0x5559a0['error'][_0xf152('0x10')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1be40b,_0x5559a0['error'][_0xf152('0x11')]);return _0x2b7576(_0x5559a0[_0xf152('0x12')]['message']);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1be40b,_0x5559a0[_0xf152('0x12')]['message']);return _0x374c2e(_0x5559a0[_0xf152('0x12')][_0xf152('0x11')]);}else{logger[_0xf152('0xa')](_0xf152('0xb'),_0x1be40b,_0xf152('0xe'));_0x374c2e(_0x5559a0[_0xf152('0x13')][_0xf152('0x11')]);}})[_0xf152('0x14')](function(_0x54a72c){logger[_0xf152('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1be40b,_0x54a72c);_0x2b7576(_0x54a72c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 96f65da..2a2e423 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 _0xc6c6=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x317936,_0x4cde90){var _0x6227b5=function(_0x3fb7f1){while(--_0x3fb7f1){_0x317936['push'](_0x317936['shift']());}};_0x6227b5(++_0x4cde90);}(_0xc6c6,0x106));var _0x6c6c=function(_0x502953,_0x28de83){_0x502953=_0x502953-0x0;var _0x2fa32d=_0xc6c6[_0x502953];return _0x2fa32d;};'use strict';var multer=require(_0x6c6c('0x0'));var util=require(_0x6c6c('0x1'));var path=require(_0x6c6c('0x2'));var timeout=require(_0x6c6c('0x3'));var express=require(_0x6c6c('0x4'));var router=express['Router']();var fs_extra=require(_0x6c6c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6c6c('0x6'));var config=require(_0x6c6c('0x7'));var controller=require(_0x6c6c('0x8'));router[_0x6c6c('0x9')]('/',auth[_0x6c6c('0xa')](),controller[_0x6c6c('0xb')]);router[_0x6c6c('0x9')](_0x6c6c('0xc'),auth['isAuthenticated'](),controller[_0x6c6c('0xd')]);router[_0x6c6c('0xe')]('/',auth[_0x6c6c('0xa')](),controller[_0x6c6c('0xf')]);router['put'](_0x6c6c('0xc'),auth[_0x6c6c('0xa')](),controller[_0x6c6c('0x10')]);router[_0x6c6c('0x11')](_0x6c6c('0xc'),auth['isAuthenticated'](),controller[_0x6c6c('0x12')]);module[_0x6c6c('0x13')]=router; \ No newline at end of file +var _0x551b=['put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post'];(function(_0x5da2cc,_0x4bba31){var _0x49844a=function(_0x3061f9){while(--_0x3061f9){_0x5da2cc['push'](_0x5da2cc['shift']());}};_0x49844a(++_0x4bba31);}(_0x551b,0x123));var _0xb551=function(_0x527824,_0xc824a9){_0x527824=_0x527824-0x0;var _0xc8b8ed=_0x551b[_0x527824];return _0xc8b8ed;};'use strict';var multer=require(_0xb551('0x0'));var util=require('util');var path=require(_0xb551('0x1'));var timeout=require(_0xb551('0x2'));var express=require(_0xb551('0x3'));var router=express[_0xb551('0x4')]();var fs_extra=require(_0xb551('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb551('0x6'));var config=require('../../config/environment');var controller=require(_0xb551('0x7'));router[_0xb551('0x8')]('/',auth[_0xb551('0x9')](),controller[_0xb551('0xa')]);router[_0xb551('0x8')](_0xb551('0xb'),auth[_0xb551('0x9')](),controller['show']);router[_0xb551('0xc')]('/',auth[_0xb551('0x9')](),controller['create']);router[_0xb551('0xd')](_0xb551('0xb'),auth[_0xb551('0x9')](),controller['update']);router[_0xb551('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb551('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index ab00a28..53a3420 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 _0x8a07=['sequelize','exports','string','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x5c3a95,_0x1a9999){var _0x833a01=function(_0x39a557){while(--_0x39a557){_0x5c3a95['push'](_0x5c3a95['shift']());}};_0x833a01(++_0x1a9999);}(_0x8a07,0x117));var _0x78a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8a07[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x78a0('0x0'));module[_0x78a0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x78a0('0x2'),'variable',_0x78a0('0x3'),_0x78a0('0x4'),_0x78a0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x78a0('0x6')]},'key':{'type':Sequelize[_0x78a0('0x6')]},'keyType':{'type':Sequelize[_0x78a0('0x7')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x78a0('0x6')]},'customField':{'type':Sequelize[_0x78a0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x78a0('0x6')]}}; \ No newline at end of file +var _0xcaa2=['sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcaa2,0x19e));var _0x2caa=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0xcaa2[_0x516927];return _0x30749b;};'use strict';var Sequelize=require(_0x2caa('0x0'));module[_0x2caa('0x1')]={'type':{'type':Sequelize[_0x2caa('0x2')](_0x2caa('0x3'),'variable',_0x2caa('0x4'),_0x2caa('0x5'),_0x2caa('0x6')),'defaultValue':_0x2caa('0x3')},'content':{'type':Sequelize[_0x2caa('0x7')]},'key':{'type':Sequelize[_0x2caa('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2caa('0x3'),_0x2caa('0x8'),_0x2caa('0x4'))},'keyContent':{'type':Sequelize[_0x2caa('0x7')]},'idField':{'type':Sequelize[_0x2caa('0x7')]},'nameField':{'type':Sequelize[_0x2caa('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2caa('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7c67a9d..bfe5965 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 _0x3c81=['apply','reject','save','update','then','destroy','end','error','name','send','map','FreshdeskField','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','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','status','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c81,0x102));var _0x13c8=function(_0x451411,_0x308845){_0x451411=_0x451411-0x0;var _0x2ea376=_0x3c81[_0x451411];return _0x2ea376;};'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'];function respondWithStatusCode(_0x5ab91d,_0x21442d){_0x21442d=_0x21442d||0xcc;return function(_0x7b6da8){if(_0x7b6da8){return _0x5ab91d[_0x13c8('0x19')](_0x21442d);}return _0x5ab91d[_0x13c8('0x1a')](_0x21442d)['end']();};}function respondWithResult(_0x42955d,_0x515681){_0x515681=_0x515681||0xc8;return function(_0x4d7a88){if(_0x4d7a88){return _0x42955d['status'](_0x515681)[_0x13c8('0x1b')](_0x4d7a88);}};}function respondWithFilteredResult(_0x5e0e06,_0x337397){return function(_0x17a3c1){if(_0x17a3c1){var _0x23f64e=typeof _0x337397[_0x13c8('0x1c')]==='undefined'&&typeof _0x337397[_0x13c8('0x1d')]===_0x13c8('0x1e');var _0x31ae02=_0x17a3c1[_0x13c8('0x1f')];var _0xce1ad2=_0x23f64e?0x0:_0x337397[_0x13c8('0x1c')];var _0x346417=_0x23f64e?_0x17a3c1[_0x13c8('0x1f')]:_0x337397[_0x13c8('0x1c')]+_0x337397[_0x13c8('0x1d')];var _0xe9386a;if(_0x346417>=_0x31ae02){_0x346417=_0x31ae02;_0xe9386a=0xc8;}else{_0xe9386a=0xce;}_0x5e0e06['status'](_0xe9386a);return _0x5e0e06[_0x13c8('0x20')](_0x13c8('0x21'),_0xce1ad2+'-'+_0x346417+'/'+_0x31ae02)[_0x13c8('0x1b')](_0x17a3c1);}return null;};}function patchUpdates(_0x313ea3){return function(_0x513085){try{jsonpatch[_0x13c8('0x22')](_0x513085,_0x313ea3,!![]);}catch(_0x3c4603){return BPromise[_0x13c8('0x23')](_0x3c4603);}return _0x513085[_0x13c8('0x24')]();};}function saveUpdates(_0x436d5d,_0x2fc123){return function(_0x5ab47f){if(_0x5ab47f){return _0x5ab47f[_0x13c8('0x25')](_0x436d5d)[_0x13c8('0x26')](function(_0x315d6c){return _0x315d6c;});}return null;};}function removeEntity(_0xcf41d2,_0x577df6){return function(_0x1770e5){if(_0x1770e5){return _0x1770e5[_0x13c8('0x27')]()['then'](function(){_0xcf41d2['status'](0xcc)[_0x13c8('0x28')]();});}};}function handleEntityNotFound(_0x4aff35,_0x47e8ae){return function(_0x5ad0dc){if(!_0x5ad0dc){_0x4aff35[_0x13c8('0x19')](0x194);}return _0x5ad0dc;};}function handleError(_0xc7f1b6,_0x53ada9){_0x53ada9=_0x53ada9||0x1f4;return function(_0x4df077){logger[_0x13c8('0x29')](_0x4df077['stack']);if(_0x4df077['name']){delete _0x4df077[_0x13c8('0x2a')];}_0xc7f1b6[_0x13c8('0x1a')](_0x53ada9)[_0x13c8('0x2b')](_0x4df077);};}exports['index']=function(_0x5ef2f7,_0x277a89){var _0x1071a0={},_0x399840={},_0x441182={'count':0x0,'rows':[]};var _0x138017=_[_0x13c8('0x2c')](db[_0x13c8('0x2d')]['rawAttributes'],function(_0x109cb8){return{'name':_0x109cb8[_0x13c8('0x2e')],'type':_0x109cb8['type']['key']};});_0x399840[_0x13c8('0x2f')]=_[_0x13c8('0x2c')](_0x138017,'name');_0x399840[_0x13c8('0x30')]=_[_0x13c8('0x31')](_0x5ef2f7['query']);_0x399840[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],_0x399840[_0x13c8('0x30')]);_0x1071a0[_0x13c8('0x34')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x5ef2f7['query']['fields']));_0x1071a0[_0x13c8('0x34')]=_0x1071a0[_0x13c8('0x34')]['length']?_0x1071a0[_0x13c8('0x34')]:_0x399840['model'];if(!_0x5ef2f7[_0x13c8('0x30')]['hasOwnProperty'](_0x13c8('0x36'))){_0x1071a0[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x1d')]);_0x1071a0[_0x13c8('0x1c')]=qs[_0x13c8('0x1c')](_0x5ef2f7['query'][_0x13c8('0x1c')]);}_0x1071a0[_0x13c8('0x37')]=qs['sort'](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x38')]);_0x1071a0[_0x13c8('0x39')]=qs['filters'](_['pick'](_0x5ef2f7['query'],_0x399840[_0x13c8('0x32')]),_0x138017);if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]){_0x1071a0[_0x13c8('0x39')]=_[_0x13c8('0x3b')](_0x1071a0[_0x13c8('0x39')],{'$or':_[_0x13c8('0x2c')](_0x138017,function(_0xe19858){if(_0xe19858[_0x13c8('0x3c')]!=='VIRTUAL'){var _0x5b2a28={};_0x5b2a28[_0xe19858[_0x13c8('0x2a')]]={'$like':'%'+_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]+'%'};return _0x5b2a28;}})});}_0x1071a0=_[_0x13c8('0x3b')]({},_0x1071a0,_0x5ef2f7['options']);var _0x35e1e7={'where':_0x1071a0['where']};return db[_0x13c8('0x2d')][_0x13c8('0x1f')](_0x35e1e7)[_0x13c8('0x26')](function(_0x1cd02c){_0x441182[_0x13c8('0x1f')]=_0x1cd02c;if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3d')]){_0x1071a0[_0x13c8('0x3e')]=[{'all':!![]}];}return db[_0x13c8('0x2d')][_0x13c8('0x3f')](_0x1071a0);})[_0x13c8('0x26')](function(_0x416169){_0x441182[_0x13c8('0x40')]=_0x416169;return _0x441182;})[_0x13c8('0x26')](respondWithFilteredResult(_0x277a89,_0x1071a0))[_0x13c8('0x41')](handleError(_0x277a89,null));};exports[_0x13c8('0x42')]=function(_0x1b2ada,_0x1505fb){var _0xc5eb86={'raw':!![],'where':{'id':_0x1b2ada[_0x13c8('0x43')]['id']}},_0x1cff99={};_0x1cff99[_0x13c8('0x2f')]=_[_0x13c8('0x31')](db[_0x13c8('0x2d')][_0x13c8('0x44')]);_0x1cff99['query']=_[_0x13c8('0x31')](_0x1b2ada[_0x13c8('0x30')]);_0x1cff99[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],_0x1cff99['query']);_0xc5eb86['attributes']=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x1b2ada['query']['fields']));_0xc5eb86['attributes']=_0xc5eb86[_0x13c8('0x34')]['length']?_0xc5eb86[_0x13c8('0x34')]:_0x1cff99['model'];if(_0x1b2ada[_0x13c8('0x30')][_0x13c8('0x3d')]){_0xc5eb86[_0x13c8('0x3e')]=[{'all':!![]}];}_0xc5eb86=_[_0x13c8('0x3b')]({},_0xc5eb86,_0x1b2ada[_0x13c8('0x45')]);return db[_0x13c8('0x2d')]['find'](_0xc5eb86)[_0x13c8('0x26')](handleEntityNotFound(_0x1505fb,null))[_0x13c8('0x26')](respondWithResult(_0x1505fb,null))['catch'](handleError(_0x1505fb,null));};exports[_0x13c8('0x46')]=function(_0x26155d,_0x2e925f){return db[_0x13c8('0x2d')][_0x13c8('0x46')](_0x26155d['body'],{})[_0x13c8('0x26')](respondWithResult(_0x2e925f,0xc9))[_0x13c8('0x41')](handleError(_0x2e925f,null));};exports[_0x13c8('0x25')]=function(_0x38418b,_0x185d18){if(_0x38418b['body']['id']){delete _0x38418b[_0x13c8('0x47')]['id'];}return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x38418b[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x185d18,null))[_0x13c8('0x26')](saveUpdates(_0x38418b[_0x13c8('0x47')],null))[_0x13c8('0x26')](respondWithResult(_0x185d18,null))[_0x13c8('0x41')](handleError(_0x185d18,null));};exports[_0x13c8('0x27')]=function(_0x266f4e,_0x5e1fe5){return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x266f4e[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x5e1fe5,null))[_0x13c8('0x26')](removeEntity(_0x5e1fe5,null))[_0x13c8('0x41')](handleError(_0x5e1fe5,null));}; \ No newline at end of file +var _0x4058=['destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','include','find','create','update','body'];(function(_0x1b8d4b,_0x374529){var _0x3b305b=function(_0x351a7f){while(--_0x351a7f){_0x1b8d4b['push'](_0x1b8d4b['shift']());}};_0x3b305b(++_0x374529);}(_0x4058,0x129));var _0x8405=function(_0x3fef5d,_0x482be0){_0x3fef5d=_0x3fef5d-0x0;var _0x1345d1=_0x4058[_0x3fef5d];return _0x1345d1;};'use strict';var emlformat=require(_0x8405('0x0'));var rimraf=require(_0x8405('0x1'));var zipdir=require(_0x8405('0x2'));var jsonpatch=require(_0x8405('0x3'));var rp=require(_0x8405('0x4'));var moment=require(_0x8405('0x5'));var BPromise=require(_0x8405('0x6'));var Mustache=require(_0x8405('0x7'));var util=require(_0x8405('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8405('0x9'));var fs=require('fs');var fs_extra=require(_0x8405('0xa'));var _=require(_0x8405('0xb'));var squel=require(_0x8405('0xc'));var crypto=require(_0x8405('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8405('0xe'));var toCsv=require(_0x8405('0xf'));var querystring=require(_0x8405('0x10'));var Papa=require('papaparse');var Redis=require(_0x8405('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8405('0x12'));var as=require(_0x8405('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8405('0x14'))(_0x8405('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262d32,_0x575fcb){_0x575fcb=_0x575fcb||0xcc;return function(_0x495190){if(_0x495190){return _0x262d32['sendStatus'](_0x575fcb);}return _0x262d32['status'](_0x575fcb)['end']();};}function respondWithResult(_0x1321d3,_0x238633){_0x238633=_0x238633||0xc8;return function(_0x5a3776){if(_0x5a3776){return _0x1321d3[_0x8405('0x16')](_0x238633)[_0x8405('0x17')](_0x5a3776);}};}function respondWithFilteredResult(_0x221cf8,_0x422822){return function(_0x58eb66){if(_0x58eb66){var _0x218fe7=typeof _0x422822[_0x8405('0x18')]===_0x8405('0x19')&&typeof _0x422822[_0x8405('0x1a')]===_0x8405('0x19');var _0x15a189=_0x58eb66[_0x8405('0x1b')];var _0x358633=_0x218fe7?0x0:_0x422822[_0x8405('0x18')];var _0x1e608f=_0x218fe7?_0x58eb66[_0x8405('0x1b')]:_0x422822[_0x8405('0x18')]+_0x422822[_0x8405('0x1a')];var _0x241000;if(_0x1e608f>=_0x15a189){_0x1e608f=_0x15a189;_0x241000=0xc8;}else{_0x241000=0xce;}_0x221cf8[_0x8405('0x16')](_0x241000);return _0x221cf8[_0x8405('0x1c')](_0x8405('0x1d'),_0x358633+'-'+_0x1e608f+'/'+_0x15a189)[_0x8405('0x17')](_0x58eb66);}return null;};}function patchUpdates(_0x2483ab){return function(_0x1f42e5){try{jsonpatch[_0x8405('0x1e')](_0x1f42e5,_0x2483ab,!![]);}catch(_0x3d5271){return BPromise[_0x8405('0x1f')](_0x3d5271);}return _0x1f42e5[_0x8405('0x20')]();};}function saveUpdates(_0x1ceff7,_0x1e8d08){return function(_0x57130a){if(_0x57130a){return _0x57130a['update'](_0x1ceff7)[_0x8405('0x21')](function(_0x2e021a){return _0x2e021a;});}return null;};}function removeEntity(_0x14436a,_0x4b1c6b){return function(_0x5e3849){if(_0x5e3849){return _0x5e3849['destroy']()[_0x8405('0x21')](function(){_0x14436a['status'](0xcc)[_0x8405('0x22')]();});}};}function handleEntityNotFound(_0x162c03,_0x2a6c7b){return function(_0x4450eb){if(!_0x4450eb){_0x162c03[_0x8405('0x23')](0x194);}return _0x4450eb;};}function handleError(_0x3e5b4c,_0x102b85){_0x102b85=_0x102b85||0x1f4;return function(_0x178ef6){logger[_0x8405('0x24')](_0x178ef6[_0x8405('0x25')]);if(_0x178ef6[_0x8405('0x26')]){delete _0x178ef6[_0x8405('0x26')];}_0x3e5b4c['status'](_0x102b85)[_0x8405('0x27')](_0x178ef6);};}exports['index']=function(_0x48a425,_0xc7df7){var _0x41f06a={},_0x3022cc={},_0x26d5ec={'count':0x0,'rows':[]};var _0x458dbd=_[_0x8405('0x28')](db[_0x8405('0x29')][_0x8405('0x2a')],function(_0x7e216b){return{'name':_0x7e216b[_0x8405('0x2b')],'type':_0x7e216b[_0x8405('0x2c')][_0x8405('0x2d')]};});_0x3022cc[_0x8405('0x2e')]=_['map'](_0x458dbd,_0x8405('0x26'));_0x3022cc[_0x8405('0x2f')]=_['keys'](_0x48a425[_0x8405('0x2f')]);_0x3022cc[_0x8405('0x30')]=_[_0x8405('0x31')](_0x3022cc['model'],_0x3022cc[_0x8405('0x2f')]);_0x41f06a[_0x8405('0x32')]=_[_0x8405('0x31')](_0x3022cc['model'],qs[_0x8405('0x33')](_0x48a425[_0x8405('0x2f')]['fields']));_0x41f06a[_0x8405('0x32')]=_0x41f06a['attributes'][_0x8405('0x34')]?_0x41f06a[_0x8405('0x32')]:_0x3022cc[_0x8405('0x2e')];if(!_0x48a425[_0x8405('0x2f')][_0x8405('0x35')](_0x8405('0x36'))){_0x41f06a[_0x8405('0x1a')]=qs[_0x8405('0x1a')](_0x48a425[_0x8405('0x2f')][_0x8405('0x1a')]);_0x41f06a[_0x8405('0x18')]=qs[_0x8405('0x18')](_0x48a425['query'][_0x8405('0x18')]);}_0x41f06a['order']=qs['sort'](_0x48a425[_0x8405('0x2f')][_0x8405('0x37')]);_0x41f06a['where']=qs[_0x8405('0x30')](_[_0x8405('0x38')](_0x48a425[_0x8405('0x2f')],_0x3022cc[_0x8405('0x30')]),_0x458dbd);if(_0x48a425[_0x8405('0x2f')]['filter']){_0x41f06a[_0x8405('0x39')]=_[_0x8405('0x3a')](_0x41f06a[_0x8405('0x39')],{'$or':_[_0x8405('0x28')](_0x458dbd,function(_0x451faa){if(_0x451faa['type']!==_0x8405('0x3b')){var _0x27a6ec={};_0x27a6ec[_0x451faa[_0x8405('0x26')]]={'$like':'%'+_0x48a425[_0x8405('0x2f')][_0x8405('0x3c')]+'%'};return _0x27a6ec;}})});}_0x41f06a=_[_0x8405('0x3a')]({},_0x41f06a,_0x48a425['options']);var _0xfe699c={'where':_0x41f06a[_0x8405('0x39')]};return db[_0x8405('0x29')][_0x8405('0x1b')](_0xfe699c)[_0x8405('0x21')](function(_0x2ccd08){_0x26d5ec[_0x8405('0x1b')]=_0x2ccd08;if(_0x48a425['query'][_0x8405('0x3d')]){_0x41f06a['include']=[{'all':!![]}];}return db[_0x8405('0x29')][_0x8405('0x3e')](_0x41f06a);})['then'](function(_0x4a13f7){_0x26d5ec[_0x8405('0x3f')]=_0x4a13f7;return _0x26d5ec;})[_0x8405('0x21')](respondWithFilteredResult(_0xc7df7,_0x41f06a))[_0x8405('0x40')](handleError(_0xc7df7,null));};exports[_0x8405('0x41')]=function(_0x2e8468,_0xd2eb6a){var _0x599a42={'raw':!![],'where':{'id':_0x2e8468[_0x8405('0x42')]['id']}},_0x11bce5={};_0x11bce5['model']=_['keys'](db[_0x8405('0x29')]['rawAttributes']);_0x11bce5[_0x8405('0x2f')]=_[_0x8405('0x43')](_0x2e8468[_0x8405('0x2f')]);_0x11bce5['filters']=_[_0x8405('0x31')](_0x11bce5[_0x8405('0x2e')],_0x11bce5['query']);_0x599a42[_0x8405('0x32')]=_[_0x8405('0x31')](_0x11bce5[_0x8405('0x2e')],qs[_0x8405('0x33')](_0x2e8468[_0x8405('0x2f')][_0x8405('0x33')]));_0x599a42[_0x8405('0x32')]=_0x599a42['attributes']['length']?_0x599a42['attributes']:_0x11bce5[_0x8405('0x2e')];if(_0x2e8468[_0x8405('0x2f')][_0x8405('0x3d')]){_0x599a42[_0x8405('0x44')]=[{'all':!![]}];}_0x599a42=_['merge']({},_0x599a42,_0x2e8468['options']);return db[_0x8405('0x29')][_0x8405('0x45')](_0x599a42)[_0x8405('0x21')](handleEntityNotFound(_0xd2eb6a,null))[_0x8405('0x21')](respondWithResult(_0xd2eb6a,null))[_0x8405('0x40')](handleError(_0xd2eb6a,null));};exports[_0x8405('0x46')]=function(_0x11a2d5,_0x600035){return db['FreshdeskField'][_0x8405('0x46')](_0x11a2d5['body'],{})[_0x8405('0x21')](respondWithResult(_0x600035,0xc9))[_0x8405('0x40')](handleError(_0x600035,null));};exports[_0x8405('0x47')]=function(_0x3e0861,_0x9a0ffe){if(_0x3e0861[_0x8405('0x48')]['id']){delete _0x3e0861[_0x8405('0x48')]['id'];}return db[_0x8405('0x29')]['find']({'where':{'id':_0x3e0861[_0x8405('0x42')]['id']}})[_0x8405('0x21')](handleEntityNotFound(_0x9a0ffe,null))[_0x8405('0x21')](saveUpdates(_0x3e0861[_0x8405('0x48')],null))['then'](respondWithResult(_0x9a0ffe,null))['catch'](handleError(_0x9a0ffe,null));};exports[_0x8405('0x49')]=function(_0x30b761,_0x152757){return db[_0x8405('0x29')][_0x8405('0x45')]({'where':{'id':_0x30b761[_0x8405('0x42')]['id']}})[_0x8405('0x21')](handleEntityNotFound(_0x152757,null))['then'](removeEntity(_0x152757,null))['catch'](handleError(_0x152757,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index fb11975..57a58b6 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 _0xdf97=['FieldId','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields'];(function(_0x20b609,_0x9434e0){var _0x165b8b=function(_0x29a7dc){while(--_0x29a7dc){_0x20b609['push'](_0x20b609['shift']());}};_0x165b8b(++_0x9434e0);}(_0xdf97,0x1c4));var _0x7df9=function(_0x23f3a2,_0x329e9e){_0x23f3a2=_0x23f3a2-0x0;var _0x455aa9=_0xdf97[_0x23f3a2];return _0x455aa9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7df9('0x0'))(_0x7df9('0x1'));var moment=require('moment');var BPromise=require(_0x7df9('0x2'));var rp=require(_0x7df9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7df9('0x4'));var config=require(_0x7df9('0x5'));var attributes=require(_0x7df9('0x6'));module[_0x7df9('0x7')]=function(_0x562c40,_0x1db832){return _0x562c40['define'](_0x7df9('0x8'),attributes,{'tableName':_0x7df9('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x7df9('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc431=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util'];(function(_0x23f1db,_0x5f42a1){var _0x539ded=function(_0x126671){while(--_0x126671){_0x23f1db['push'](_0x23f1db['shift']());}};_0x539ded(++_0x5f42a1);}(_0xc431,0x15c));var _0x1c43=function(_0x25b423,_0x15abe0){_0x25b423=_0x25b423-0x0;var _0x29efa6=_0xc431[_0x25b423];return _0x29efa6;};'use strict';var _=require(_0x1c43('0x0'));var util=require(_0x1c43('0x1'));var logger=require(_0x1c43('0x2'))(_0x1c43('0x3'));var moment=require('moment');var BPromise=require(_0x1c43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c43('0x5'));var rimraf=require(_0x1c43('0x6'));var config=require(_0x1c43('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x1c43('0x8')]=function(_0x871106,_0x430bf3){return _0x871106[_0x1c43('0x9')](_0x1c43('0xa'),attributes,{'tableName':_0x1c43('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x1c43('0xc'),_0x1c43('0xd')],'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 d937197..6c6a83a 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 _0x262d=['debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x262d,0x85));var _0xd262=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x262d[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xd262('0x0'));var util=require(_0xd262('0x1'));var moment=require(_0xd262('0x2'));var BPromise=require(_0xd262('0x3'));var rs=require(_0xd262('0x4'));var fs=require('fs');var Redis=require(_0xd262('0x5'));var db=require(_0xd262('0x6'))['db'];var utils=require(_0xd262('0x7'));var logger=require(_0xd262('0x8'))(_0xd262('0x9'));var config=require('../../config/environment');var jayson=require(_0xd262('0xa'));var client=jayson[_0xd262('0xb')][_0xd262('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e1353,_0x2b6802,_0xd9d66c){return new BPromise(function(_0x20432d,_0x1a861c){return client[_0xd262('0xd')](_0x3e1353,_0xd9d66c)[_0xd262('0xe')](function(_0x39fba0){logger['info'](_0xd262('0xf'),_0x2b6802,_0xd262('0x10'));logger[_0xd262('0x11')](_0xd262('0x12'),_0x2b6802,_0xd262('0x10'),JSON[_0xd262('0x13')](_0x39fba0));if(_0x39fba0[_0xd262('0x14')]){if(_0x39fba0[_0xd262('0x14')][_0xd262('0x15')]===0x1f4){logger['error'](_0xd262('0xf'),_0x2b6802,_0x39fba0[_0xd262('0x14')]['message']);return _0x1a861c(_0x39fba0['error']['message']);}logger[_0xd262('0x14')](_0xd262('0xf'),_0x2b6802,_0x39fba0[_0xd262('0x14')][_0xd262('0x16')]);return _0x20432d(_0x39fba0[_0xd262('0x14')][_0xd262('0x16')]);}else{logger[_0xd262('0x17')](_0xd262('0xf'),_0x2b6802,_0xd262('0x10'));_0x20432d(_0x39fba0['result'][_0xd262('0x16')]);}})[_0xd262('0x18')](function(_0x2ab3ae){logger[_0xd262('0x14')](_0xd262('0xf'),_0x2b6802,_0x2ab3ae);_0x1a861c(_0x2ab3ae);});});} \ No newline at end of file +var _0xe108=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x48fd10,_0x30a0d8){var _0x5610d6=function(_0x45cae9){while(--_0x45cae9){_0x48fd10['push'](_0x48fd10['shift']());}};_0x5610d6(++_0x30a0d8);}(_0xe108,0xd9));var _0x8e10=function(_0x47a4ad,_0x189ef5){_0x47a4ad=_0x47a4ad-0x0;var _0x58af9f=_0xe108[_0x47a4ad];return _0x58af9f;};'use strict';var _=require(_0x8e10('0x0'));var util=require(_0x8e10('0x1'));var moment=require(_0x8e10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e10('0x3'))['db'];var utils=require(_0x8e10('0x4'));var logger=require(_0x8e10('0x5'))(_0x8e10('0x6'));var config=require('../../config/environment');var jayson=require(_0x8e10('0x7'));var client=jayson[_0x8e10('0x8')][_0x8e10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43305f,_0x25ff95,_0x20ba6e){return new BPromise(function(_0x3c0e53,_0xd3ba0a){return client['request'](_0x43305f,_0x20ba6e)[_0x8e10('0xa')](function(_0x3388ff){logger[_0x8e10('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x25ff95,_0x8e10('0xc'));logger[_0x8e10('0xd')](_0x8e10('0xe'),_0x25ff95,_0x8e10('0xc'),JSON[_0x8e10('0xf')](_0x3388ff));if(_0x3388ff[_0x8e10('0x10')]){if(_0x3388ff['error']['code']===0x1f4){logger[_0x8e10('0x10')](_0x8e10('0x11'),_0x25ff95,_0x3388ff['error'][_0x8e10('0x12')]);return _0xd3ba0a(_0x3388ff[_0x8e10('0x10')][_0x8e10('0x12')]);}logger[_0x8e10('0x10')](_0x8e10('0x11'),_0x25ff95,_0x3388ff['error'][_0x8e10('0x12')]);return _0x3c0e53(_0x3388ff[_0x8e10('0x10')][_0x8e10('0x12')]);}else{logger[_0x8e10('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x25ff95,_0x8e10('0xc'));_0x3c0e53(_0x3388ff[_0x8e10('0x13')][_0x8e10('0x12')]);}})[_0x8e10('0x14')](function(_0x2321b4){logger['error'](_0x8e10('0x11'),_0x25ff95,_0x2321b4);_0xd3ba0a(_0x2321b4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 15e3f69..4fe888e 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 _0x0abf=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete'];(function(_0x348a44,_0x37ef96){var _0x4b926d=function(_0x15e5c4){while(--_0x15e5c4){_0x348a44['push'](_0x348a44['shift']());}};_0x4b926d(++_0x37ef96);}(_0x0abf,0xe8));var _0xf0ab=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0abf[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xf0ab('0xe')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0xf')]);router[_0xf0ab('0xe')](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')](_0xf0ab('0x12'),auth['isAuthenticated'](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x15')]);module[_0xf0ab('0x16')]=router; \ No newline at end of file +var _0xefda=['update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0x365c43,_0x6ccd07){var _0x305521=function(_0x43f9eb){while(--_0x43f9eb){_0x365c43['push'](_0x365c43['shift']());}};_0x305521(++_0x6ccd07);}(_0xefda,0x96));var _0xaefd=function(_0x14d65b,_0x343f48){_0x14d65b=_0x14d65b-0x0;var _0x5b785c=_0xefda[_0x14d65b];return _0x5b785c;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0xe')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0xe')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);router[_0xaefd('0x11')](_0xaefd('0xa'),auth['isAuthenticated'](),controller[_0xaefd('0x12')]);router['delete'](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x13')]);module[_0xaefd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 9be1c42..d4de23b 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 _0xb44a=['STRING'];(function(_0x190681,_0x590f58){var _0x4f2ada=function(_0x4556db){while(--_0x4556db){_0x190681['push'](_0x190681['shift']());}};_0x4f2ada(++_0x590f58);}(_0xb44a,0x1c2));var _0xab44=function(_0x4ad0f7,_0x1920b0){_0x4ad0f7=_0x4ad0f7-0x0;var _0x30f5c8=_0xb44a[_0x4ad0f7];return _0x30f5c8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xab44('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xab44('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xab44('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xab44('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x6a55=['STRING','sequelize'];(function(_0xc6971f,_0x53138a){var _0x28ca53=function(_0xa0f0b4){while(--_0xa0f0b4){_0xc6971f['push'](_0xc6971f['shift']());}};_0x28ca53(++_0x53138a);}(_0x6a55,0xdb));var _0x56a5=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x6a55[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('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 b2c49bf..a3e29d0 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 _0x5e03=['Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','catch','show','keys','intersection','create','body','find','params','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','send'];(function(_0x475923,_0x25d9ec){var _0x374030=function(_0x3f256b){while(--_0x3f256b){_0x475923['push'](_0x475923['shift']());}};_0x374030(++_0x25d9ec);}(_0x5e03,0x12d));var _0x35e0=function(_0x24d5ce,_0x5e0ccc){_0x24d5ce=_0x24d5ce-0x0;var _0x179faa=_0x5e03[_0x24d5ce];return _0x179faa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35e0('0x0'));var zipdir=require(_0x35e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35e0('0x2'));var moment=require(_0x35e0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x35e0('0x4'));var sox=require(_0x35e0('0x5'));var csv=require(_0x35e0('0x6'));var ejs=require(_0x35e0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35e0('0x8'));var squel=require(_0x35e0('0x9'));var crypto=require(_0x35e0('0xa'));var jsforce=require(_0x35e0('0xb'));var deskjs=require(_0x35e0('0xc'));var toCsv=require(_0x35e0('0x6'));var querystring=require(_0x35e0('0xd'));var Papa=require(_0x35e0('0xe'));var Redis=require(_0x35e0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x35e0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35e0('0x11'))(_0x35e0('0x12'));var utils=require(_0x35e0('0x13'));var config=require(_0x35e0('0x14'));var licenseUtil=require(_0x35e0('0x15'));var db=require(_0x35e0('0x16'))['db'];var integrations=require(_0x35e0('0x17'));function respondWithStatusCode(_0xa7d98a,_0x35d763){_0x35d763=_0x35d763||0xcc;return function(_0x300319){if(_0x300319){return _0xa7d98a[_0x35e0('0x18')](_0x35d763);}return _0xa7d98a[_0x35e0('0x19')](_0x35d763)['end']();};}function respondWithResult(_0x16ee53,_0x1356bc){_0x1356bc=_0x1356bc||0xc8;return function(_0x54552f){if(_0x54552f){return _0x16ee53['status'](_0x1356bc)[_0x35e0('0x1a')](_0x54552f);}};}function respondWithFilteredResult(_0x3d0a3e,_0x4729f1){return function(_0x1a6ba4){if(_0x1a6ba4){var _0x3b1fe1=typeof _0x4729f1[_0x35e0('0x1b')]==='undefined'&&typeof _0x4729f1['limit']===_0x35e0('0x1c');var _0x707183=_0x1a6ba4[_0x35e0('0x1d')];var _0x5b9134=_0x3b1fe1?0x0:_0x4729f1['offset'];var _0x42039e=_0x3b1fe1?_0x1a6ba4[_0x35e0('0x1d')]:_0x4729f1[_0x35e0('0x1b')]+_0x4729f1[_0x35e0('0x1e')];var _0x28d902;if(_0x42039e>=_0x707183){_0x42039e=_0x707183;_0x28d902=0xc8;}else{_0x28d902=0xce;}_0x3d0a3e[_0x35e0('0x19')](_0x28d902);return _0x3d0a3e['set'](_0x35e0('0x1f'),_0x5b9134+'-'+_0x42039e+'/'+_0x707183)['json'](_0x1a6ba4);}return null;};}function patchUpdates(_0x1c3ca7){return function(_0xc6bbd4){try{jsonpatch[_0x35e0('0x20')](_0xc6bbd4,_0x1c3ca7,!![]);}catch(_0x367cd7){return BPromise[_0x35e0('0x21')](_0x367cd7);}return _0xc6bbd4[_0x35e0('0x22')]();};}function saveUpdates(_0x16df1c,_0x4c55c0){return function(_0x4b151c){if(_0x4b151c){return _0x4b151c[_0x35e0('0x23')](_0x16df1c)[_0x35e0('0x24')](function(_0xf20a4e){return _0xf20a4e;});}return null;};}function removeEntity(_0x90801f,_0x3da03c){return function(_0x2a0eb2){if(_0x2a0eb2){return _0x2a0eb2['destroy']()[_0x35e0('0x24')](function(){_0x90801f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfeb3af,_0x11b573){return function(_0x3e116d){if(!_0x3e116d){_0xfeb3af[_0x35e0('0x18')](0x194);}return _0x3e116d;};}function handleError(_0x29e5b9,_0xcc6bdd){_0xcc6bdd=_0xcc6bdd||0x1f4;return function(_0x1e9f06){logger[_0x35e0('0x25')](_0x1e9f06[_0x35e0('0x26')]);if(_0x1e9f06[_0x35e0('0x27')]){delete _0x1e9f06[_0x35e0('0x27')];}_0x29e5b9[_0x35e0('0x19')](_0xcc6bdd)['send'](_0x1e9f06);};}exports['index']=function(_0x49377b,_0x3bcf0c){var _0x37ce8d={},_0x5a7db2={},_0x12ba2d={'count':0x0,'rows':[]};var _0x58b08c=_[_0x35e0('0x28')](db[_0x35e0('0x29')][_0x35e0('0x2a')],function(_0x9c0ad6){return{'name':_0x9c0ad6[_0x35e0('0x2b')],'type':_0x9c0ad6[_0x35e0('0x2c')][_0x35e0('0x2d')]};});_0x5a7db2[_0x35e0('0x2e')]=_[_0x35e0('0x28')](_0x58b08c,'name');_0x5a7db2[_0x35e0('0x2f')]=_['keys'](_0x49377b[_0x35e0('0x2f')]);_0x5a7db2[_0x35e0('0x30')]=_['intersection'](_0x5a7db2[_0x35e0('0x2e')],_0x5a7db2[_0x35e0('0x2f')]);_0x37ce8d[_0x35e0('0x31')]=_['intersection'](_0x5a7db2[_0x35e0('0x2e')],qs[_0x35e0('0x32')](_0x49377b[_0x35e0('0x2f')][_0x35e0('0x32')]));_0x37ce8d[_0x35e0('0x31')]=_0x37ce8d['attributes'][_0x35e0('0x33')]?_0x37ce8d[_0x35e0('0x31')]:_0x5a7db2['model'];if(!_0x49377b['query'][_0x35e0('0x34')](_0x35e0('0x35'))){_0x37ce8d[_0x35e0('0x1e')]=qs['limit'](_0x49377b[_0x35e0('0x2f')][_0x35e0('0x1e')]);_0x37ce8d['offset']=qs[_0x35e0('0x1b')](_0x49377b[_0x35e0('0x2f')][_0x35e0('0x1b')]);}_0x37ce8d[_0x35e0('0x36')]=qs[_0x35e0('0x37')](_0x49377b[_0x35e0('0x2f')][_0x35e0('0x37')]);_0x37ce8d[_0x35e0('0x38')]=qs[_0x35e0('0x30')](_['pick'](_0x49377b[_0x35e0('0x2f')],_0x5a7db2[_0x35e0('0x30')]),_0x58b08c);if(_0x49377b[_0x35e0('0x2f')][_0x35e0('0x39')]){_0x37ce8d[_0x35e0('0x38')]=_[_0x35e0('0x3a')](_0x37ce8d[_0x35e0('0x38')],{'$or':_['map'](_0x58b08c,function(_0x390605){if(_0x390605['type']!=='VIRTUAL'){var _0xc3040c={};_0xc3040c[_0x390605[_0x35e0('0x27')]]={'$like':'%'+_0x49377b[_0x35e0('0x2f')][_0x35e0('0x39')]+'%'};return _0xc3040c;}})});}_0x37ce8d=_['merge']({},_0x37ce8d,_0x49377b[_0x35e0('0x3b')]);var _0x1bb60b={'where':_0x37ce8d[_0x35e0('0x38')]};return db[_0x35e0('0x29')][_0x35e0('0x1d')](_0x1bb60b)[_0x35e0('0x24')](function(_0x5c0fa8){_0x12ba2d[_0x35e0('0x1d')]=_0x5c0fa8;if(_0x49377b[_0x35e0('0x2f')][_0x35e0('0x3c')]){_0x37ce8d['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x35e0('0x3d')](_0x37ce8d);})[_0x35e0('0x24')](function(_0x59a579){_0x12ba2d['rows']=_0x59a579;return _0x12ba2d;})[_0x35e0('0x24')](respondWithFilteredResult(_0x3bcf0c,_0x37ce8d))[_0x35e0('0x3e')](handleError(_0x3bcf0c,null));};exports[_0x35e0('0x3f')]=function(_0x3be63e,_0x3fc79){var _0x1cc958={'raw':![],'where':{'id':_0x3be63e['params']['id']}},_0x18e5ce={};_0x18e5ce[_0x35e0('0x2e')]=_[_0x35e0('0x40')](db[_0x35e0('0x29')][_0x35e0('0x2a')]);_0x18e5ce[_0x35e0('0x2f')]=_[_0x35e0('0x40')](_0x3be63e[_0x35e0('0x2f')]);_0x18e5ce[_0x35e0('0x30')]=_[_0x35e0('0x41')](_0x18e5ce[_0x35e0('0x2e')],_0x18e5ce[_0x35e0('0x2f')]);_0x1cc958[_0x35e0('0x31')]=_[_0x35e0('0x41')](_0x18e5ce[_0x35e0('0x2e')],qs['fields'](_0x3be63e[_0x35e0('0x2f')][_0x35e0('0x32')]));_0x1cc958[_0x35e0('0x31')]=_0x1cc958['attributes'][_0x35e0('0x33')]?_0x1cc958[_0x35e0('0x31')]:_0x18e5ce[_0x35e0('0x2e')];if(_0x3be63e['query'][_0x35e0('0x3c')]){_0x1cc958['include']=[{'all':!![]}];}_0x1cc958=_[_0x35e0('0x3a')]({},_0x1cc958,_0x3be63e[_0x35e0('0x3b')]);return db[_0x35e0('0x29')]['find'](_0x1cc958)[_0x35e0('0x24')](handleEntityNotFound(_0x3fc79,null))[_0x35e0('0x24')](respondWithResult(_0x3fc79,null))[_0x35e0('0x3e')](handleError(_0x3fc79,null));};exports[_0x35e0('0x42')]=function(_0x282a3c,_0x129621){return db[_0x35e0('0x29')][_0x35e0('0x42')](_0x282a3c[_0x35e0('0x43')],{})[_0x35e0('0x24')](respondWithResult(_0x129621,0xc9))['catch'](handleError(_0x129621,null));};exports['update']=function(_0x3a73a4,_0x30a2a1){if(_0x3a73a4['body']['id']){delete _0x3a73a4[_0x35e0('0x43')]['id'];}return db['FreshsalesAccount'][_0x35e0('0x44')]({'where':{'id':_0x3a73a4[_0x35e0('0x45')]['id']}})[_0x35e0('0x24')](handleEntityNotFound(_0x30a2a1,null))[_0x35e0('0x24')](saveUpdates(_0x3a73a4[_0x35e0('0x43')],null))[_0x35e0('0x24')](respondWithResult(_0x30a2a1,null))[_0x35e0('0x3e')](handleError(_0x30a2a1,null));};exports['destroy']=function(_0xd04a12,_0x5af4f1){return db['FreshsalesAccount'][_0x35e0('0x44')]({'where':{'id':_0xd04a12[_0x35e0('0x45')]['id']}})['then'](handleEntityNotFound(_0x5af4f1,null))[_0x35e0('0x24')](removeEntity(_0x5af4f1,null))[_0x35e0('0x3e')](handleError(_0x5af4f1,null));};exports[_0x35e0('0x46')]=function(_0x338b95,_0x5b73ab,_0x58e29d){var _0x482360={};var _0x4a127c={};var _0x3ee4ab;var _0x28a204;return db['FreshsalesAccount'][_0x35e0('0x47')]({'where':{'id':_0x338b95[_0x35e0('0x45')]['id']}})[_0x35e0('0x24')](handleEntityNotFound(_0x5b73ab,null))[_0x35e0('0x24')](function(_0x5c575a){if(_0x5c575a){_0x3ee4ab=_0x5c575a;_0x4a127c[_0x35e0('0x2e')]=_[_0x35e0('0x40')](db[_0x35e0('0x48')]['rawAttributes']);_0x4a127c['query']=_[_0x35e0('0x40')](_0x338b95[_0x35e0('0x2f')]);_0x4a127c[_0x35e0('0x30')]=_[_0x35e0('0x41')](_0x4a127c['model'],_0x4a127c[_0x35e0('0x2f')]);_0x482360['attributes']=_['intersection'](_0x4a127c[_0x35e0('0x2e')],qs[_0x35e0('0x32')](_0x338b95['query'][_0x35e0('0x32')]));_0x482360[_0x35e0('0x31')]=_0x482360[_0x35e0('0x31')][_0x35e0('0x33')]?_0x482360[_0x35e0('0x31')]:_0x4a127c[_0x35e0('0x2e')];_0x482360[_0x35e0('0x36')]=qs[_0x35e0('0x37')](_0x338b95[_0x35e0('0x2f')][_0x35e0('0x37')]);_0x482360[_0x35e0('0x38')]=qs[_0x35e0('0x30')](_[_0x35e0('0x49')](_0x338b95[_0x35e0('0x2f')],_0x4a127c[_0x35e0('0x30')]));if(_0x338b95[_0x35e0('0x2f')][_0x35e0('0x39')]){_0x482360[_0x35e0('0x38')]=_[_0x35e0('0x3a')](_0x482360[_0x35e0('0x38')],{'$or':_[_0x35e0('0x28')](_0x482360['attributes'],function(_0x3d068a){var _0x1196eb={};_0x1196eb[_0x3d068a]={'$like':'%'+_0x338b95[_0x35e0('0x2f')][_0x35e0('0x39')]+'%'};return _0x1196eb;})});}_0x482360=_['merge']({},_0x482360,_0x338b95[_0x35e0('0x3b')]);return _0x3ee4ab[_0x35e0('0x46')](_0x482360);}})[_0x35e0('0x24')](function(_0x3efa59){if(_0x3efa59){_0x28a204=_0x3efa59[_0x35e0('0x33')];if(!_0x338b95[_0x35e0('0x2f')][_0x35e0('0x34')]('nolimit')){_0x482360['limit']=qs['limit'](_0x338b95[_0x35e0('0x2f')]['limit']);_0x482360[_0x35e0('0x1b')]=qs[_0x35e0('0x1b')](_0x338b95[_0x35e0('0x2f')]['offset']);}return _0x3ee4ab['getConfigurations'](_0x482360);}})[_0x35e0('0x24')](function(_0xdc0d07){if(_0xdc0d07){return _0xdc0d07?{'count':_0x28a204,'rows':_0xdc0d07}:null;}})[_0x35e0('0x24')](respondWithResult(_0x5b73ab,null))[_0x35e0('0x3e')](handleError(_0x5b73ab,null));};exports[_0x35e0('0x4a')]=function(_0x3b30fc,_0x4c4693,_0x2a9436){if(_0x3b30fc[_0x35e0('0x43')]['id']){delete _0x3b30fc[_0x35e0('0x43')]['id'];}return db[_0x35e0('0x29')][_0x35e0('0x47')]({'where':{'id':_0x3b30fc[_0x35e0('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c4693,null))[_0x35e0('0x24')](function(_0x21dea8){if(_0x21dea8){_0x3b30fc[_0x35e0('0x43')][_0x35e0('0x4b')]=_0x21dea8['id'];_0x3b30fc[_0x35e0('0x43')][_0x35e0('0x4c')]=integrations[_0x35e0('0x4d')](_0x3b30fc[_0x35e0('0x43')][_0x35e0('0x4e')],_0x3b30fc[_0x35e0('0x43')][_0x35e0('0x2c')]);_0x3b30fc[_0x35e0('0x43')][_0x35e0('0x4f')]=integrations['getDescriptions'](_0x3b30fc[_0x35e0('0x43')]['channel'],_0x3b30fc[_0x35e0('0x43')][_0x35e0('0x2c')]);return db[_0x35e0('0x48')][_0x35e0('0x42')](_0x3b30fc['body'],{'include':[{'model':db[_0x35e0('0x50')],'as':_0x35e0('0x4c')},{'model':db[_0x35e0('0x50')],'as':'Descriptions'}]});}return null;})[_0x35e0('0x24')](respondWithResult(_0x4c4693,null))[_0x35e0('0x3e')](handleError(_0x4c4693,null));};exports[_0x35e0('0x51')]=function(_0x53db84,_0x664a25,_0x2e22b5){var _0x1eafb='';var _0x22af27='';return db[_0x35e0('0x29')][_0x35e0('0x47')]({'where':{'id':_0x53db84[_0x35e0('0x45')]['id']},'attributes':['id',_0x35e0('0x52'),_0x35e0('0x53'),_0x35e0('0x54')]})['then'](handleEntityNotFound(_0x664a25,null))[_0x35e0('0x24')](function(_0x2602ae){if(_0x2602ae){_0x22af27=_0x2602ae[_0x35e0('0x52')];_0x1eafb=_0x2602ae[_0x35e0('0x53')];var _0x5a4e29=_0x2602ae[_0x35e0('0x53')][_0x35e0('0x55')](-0x1);if(_0x5a4e29==='/'){_0x1eafb=_0x1eafb[_0x35e0('0x56')](0x0,_0x1eafb[_0x35e0('0x57')](_0x5a4e29));}return rp({'method':_0x35e0('0x58'),'uri':util[_0x35e0('0x59')](_0x35e0('0x5a'),_0x1eafb,'/api/selector/owners'),'headers':{'Authorization':_0x35e0('0x5b')+_0x2602ae['apiKey']},'json':!![]});}})[_0x35e0('0x24')](function(_0x266e45){if(_0x266e45){var _0x1375c3=_0x266e45[_0x35e0('0x5c')];var _0x2136d8=![];var _0x28e795=null;for(_0x28e795=0x0;_0x28e795<_0x1375c3[_0x35e0('0x33')];_0x28e795++){if(_0x1375c3[_0x28e795][_0x35e0('0x5d')]===_0x22af27){_0x2136d8=!![];}}if(_0x2136d8){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x35e0('0x5e')});}}})[_0x35e0('0x24')](respondWithResult(_0x664a25,null))[_0x35e0('0x3e')](function(_0x4d9945){var _0x352c85=_0x53db84[_0x35e0('0x2f')][_0x35e0('0x5f')]?0x1f4:_0x4d9945[_0x35e0('0x60')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x35e0('0x51'),_0x352c85,JSON[_0x35e0('0x61')](_0x4d9945));delete _0x4d9945['name'];if(_0x352c85===0x191){_0x352c85=0x190;}_0x664a25['status'](_0x352c85)[_0x35e0('0x62')](_0x53db84[_0x35e0('0x2f')][_0x35e0('0x5f')]?{'message':_0x35e0('0x63'),'statusCode':_0x4d9945[_0x35e0('0x60')]}:_0x4d9945);});}; \ No newline at end of file +var _0xab8c=['limit','count','set','Content-Range','apply','update','then','destroy','name','index','map','FreshsalesAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','findOne','FreshsalesConfiguration','rawAttributes','length','sort','getConfigurations','addConfiguration','Subjects','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x29a753,_0x5ce67d){var _0x5d78c7=function(_0x2659dd){while(--_0x2659dd){_0x29a753['push'](_0x29a753['shift']());}};_0x5d78c7(++_0x5ce67d);}(_0xab8c,0x112));var _0xcab8=function(_0x5f3f95,_0x25cc9d){_0x5f3f95=_0x5f3f95-0x0;var _0x2d95b8=_0xab8c[_0x5f3f95];return _0x2d95b8;};'use strict';var emlformat=require(_0xcab8('0x0'));var rimraf=require(_0xcab8('0x1'));var zipdir=require(_0xcab8('0x2'));var jsonpatch=require(_0xcab8('0x3'));var rp=require(_0xcab8('0x4'));var moment=require(_0xcab8('0x5'));var BPromise=require(_0xcab8('0x6'));var Mustache=require(_0xcab8('0x7'));var util=require(_0xcab8('0x8'));var path=require(_0xcab8('0x9'));var sox=require(_0xcab8('0xa'));var csv=require('to-csv');var ejs=require(_0xcab8('0xb'));var fs=require('fs');var fs_extra=require(_0xcab8('0xc'));var _=require(_0xcab8('0xd'));var squel=require(_0xcab8('0xe'));var crypto=require(_0xcab8('0xf'));var jsforce=require(_0xcab8('0x10'));var deskjs=require(_0xcab8('0x11'));var toCsv=require(_0xcab8('0x12'));var querystring=require(_0xcab8('0x13'));var Papa=require(_0xcab8('0x14'));var Redis=require(_0xcab8('0x15'));var authService=require(_0xcab8('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0xcab8('0x17'));var hardwareService=require(_0xcab8('0x18'));var logger=require(_0xcab8('0x19'))('api');var utils=require(_0xcab8('0x1a'));var config=require(_0xcab8('0x1b'));var licenseUtil=require(_0xcab8('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xadbc90,_0x19013d){_0x19013d=_0x19013d||0xcc;return function(_0x1d62fd){if(_0x1d62fd){return _0xadbc90[_0xcab8('0x1d')](_0x19013d);}return _0xadbc90[_0xcab8('0x1e')](_0x19013d)[_0xcab8('0x1f')]();};}function respondWithResult(_0x1c003e,_0x46bff8){_0x46bff8=_0x46bff8||0xc8;return function(_0x27165a){if(_0x27165a){return _0x1c003e[_0xcab8('0x1e')](_0x46bff8)[_0xcab8('0x20')](_0x27165a);}};}function respondWithFilteredResult(_0x1896fe,_0x534b7d){return function(_0x50de29){if(_0x50de29){var _0x576580=typeof _0x534b7d[_0xcab8('0x21')]===_0xcab8('0x22')&&typeof _0x534b7d[_0xcab8('0x23')]===_0xcab8('0x22');var _0xa8dc72=_0x50de29[_0xcab8('0x24')];var _0x2e774b=_0x576580?0x0:_0x534b7d[_0xcab8('0x21')];var _0x2330d6=_0x576580?_0x50de29[_0xcab8('0x24')]:_0x534b7d[_0xcab8('0x21')]+_0x534b7d[_0xcab8('0x23')];var _0x4ac3aa;if(_0x2330d6>=_0xa8dc72){_0x2330d6=_0xa8dc72;_0x4ac3aa=0xc8;}else{_0x4ac3aa=0xce;}_0x1896fe[_0xcab8('0x1e')](_0x4ac3aa);return _0x1896fe[_0xcab8('0x25')](_0xcab8('0x26'),_0x2e774b+'-'+_0x2330d6+'/'+_0xa8dc72)['json'](_0x50de29);}return null;};}function patchUpdates(_0x2bcaae){return function(_0x34ca4a){try{jsonpatch[_0xcab8('0x27')](_0x34ca4a,_0x2bcaae,!![]);}catch(_0x2a77f9){return BPromise['reject'](_0x2a77f9);}return _0x34ca4a['save']();};}function saveUpdates(_0x10eb1e,_0x2f00b1){return function(_0x2a2dbe){if(_0x2a2dbe){return _0x2a2dbe[_0xcab8('0x28')](_0x10eb1e)[_0xcab8('0x29')](function(_0x29b170){return _0x29b170;});}return null;};}function removeEntity(_0x3e9020,_0x338f93){return function(_0x187c5b){if(_0x187c5b){return _0x187c5b[_0xcab8('0x2a')]()[_0xcab8('0x29')](function(){_0x3e9020[_0xcab8('0x1e')](0xcc)[_0xcab8('0x1f')]();});}};}function handleEntityNotFound(_0x5431d2,_0x548cd1){return function(_0x3d777b){if(!_0x3d777b){_0x5431d2[_0xcab8('0x1d')](0x194);}return _0x3d777b;};}function handleError(_0x5b76c5,_0x49352c){_0x49352c=_0x49352c||0x1f4;return function(_0x154b43){logger['error'](_0x154b43['stack']);if(_0x154b43[_0xcab8('0x2b')]){delete _0x154b43[_0xcab8('0x2b')];}_0x5b76c5[_0xcab8('0x1e')](_0x49352c)['send'](_0x154b43);};}exports[_0xcab8('0x2c')]=function(_0x22fe3a,_0x309f3e){var _0xac56e={},_0x59cc8b={},_0x4ff9a={'count':0x0,'rows':[]};var _0x576b86=_[_0xcab8('0x2d')](db[_0xcab8('0x2e')]['rawAttributes'],function(_0x1b2104){return{'name':_0x1b2104[_0xcab8('0x2f')],'type':_0x1b2104[_0xcab8('0x30')][_0xcab8('0x31')]};});_0x59cc8b[_0xcab8('0x32')]=_[_0xcab8('0x2d')](_0x576b86,_0xcab8('0x2b'));_0x59cc8b[_0xcab8('0x33')]=_[_0xcab8('0x34')](_0x22fe3a[_0xcab8('0x33')]);_0x59cc8b[_0xcab8('0x35')]=_['intersection'](_0x59cc8b[_0xcab8('0x32')],_0x59cc8b['query']);_0xac56e['attributes']=_[_0xcab8('0x36')](_0x59cc8b[_0xcab8('0x32')],qs[_0xcab8('0x37')](_0x22fe3a[_0xcab8('0x33')]['fields']));_0xac56e[_0xcab8('0x38')]=_0xac56e['attributes']['length']?_0xac56e[_0xcab8('0x38')]:_0x59cc8b[_0xcab8('0x32')];if(!_0x22fe3a['query'][_0xcab8('0x39')](_0xcab8('0x3a'))){_0xac56e['limit']=qs['limit'](_0x22fe3a[_0xcab8('0x33')]['limit']);_0xac56e['offset']=qs[_0xcab8('0x21')](_0x22fe3a[_0xcab8('0x33')][_0xcab8('0x21')]);}_0xac56e[_0xcab8('0x3b')]=qs['sort'](_0x22fe3a[_0xcab8('0x33')]['sort']);_0xac56e[_0xcab8('0x3c')]=qs[_0xcab8('0x35')](_[_0xcab8('0x3d')](_0x22fe3a[_0xcab8('0x33')],_0x59cc8b[_0xcab8('0x35')]),_0x576b86);if(_0x22fe3a['query'][_0xcab8('0x3e')]){_0xac56e[_0xcab8('0x3c')]=_[_0xcab8('0x3f')](_0xac56e['where'],{'$or':_['map'](_0x576b86,function(_0x3a10c4){if(_0x3a10c4[_0xcab8('0x30')]!==_0xcab8('0x40')){var _0x4cd0e8={};_0x4cd0e8[_0x3a10c4['name']]={'$like':'%'+_0x22fe3a[_0xcab8('0x33')][_0xcab8('0x3e')]+'%'};return _0x4cd0e8;}})});}_0xac56e=_['merge']({},_0xac56e,_0x22fe3a[_0xcab8('0x41')]);var _0x173c64={'where':_0xac56e[_0xcab8('0x3c')]};return db[_0xcab8('0x2e')][_0xcab8('0x24')](_0x173c64)[_0xcab8('0x29')](function(_0x1f006d){_0x4ff9a['count']=_0x1f006d;if(_0x22fe3a[_0xcab8('0x33')]['includeAll']){_0xac56e['include']=[{'all':!![]}];}return db[_0xcab8('0x2e')][_0xcab8('0x42')](_0xac56e);})[_0xcab8('0x29')](function(_0x1b43bf){_0x4ff9a[_0xcab8('0x43')]=_0x1b43bf;return _0x4ff9a;})[_0xcab8('0x29')](respondWithFilteredResult(_0x309f3e,_0xac56e))['catch'](handleError(_0x309f3e,null));};exports[_0xcab8('0x44')]=function(_0x26044d,_0x160593){var _0x181de6={'raw':![],'where':{'id':_0x26044d[_0xcab8('0x45')]['id']}},_0xc96588={};_0xc96588[_0xcab8('0x32')]=_[_0xcab8('0x34')](db[_0xcab8('0x2e')]['rawAttributes']);_0xc96588[_0xcab8('0x33')]=_['keys'](_0x26044d[_0xcab8('0x33')]);_0xc96588[_0xcab8('0x35')]=_[_0xcab8('0x36')](_0xc96588[_0xcab8('0x32')],_0xc96588[_0xcab8('0x33')]);_0x181de6[_0xcab8('0x38')]=_[_0xcab8('0x36')](_0xc96588[_0xcab8('0x32')],qs['fields'](_0x26044d[_0xcab8('0x33')][_0xcab8('0x37')]));_0x181de6[_0xcab8('0x38')]=_0x181de6[_0xcab8('0x38')]['length']?_0x181de6[_0xcab8('0x38')]:_0xc96588[_0xcab8('0x32')];if(_0x26044d[_0xcab8('0x33')][_0xcab8('0x46')]){_0x181de6[_0xcab8('0x47')]=[{'all':!![]}];}_0x181de6=_[_0xcab8('0x3f')]({},_0x181de6,_0x26044d[_0xcab8('0x41')]);return db[_0xcab8('0x2e')][_0xcab8('0x48')](_0x181de6)[_0xcab8('0x29')](handleEntityNotFound(_0x160593,null))[_0xcab8('0x29')](respondWithResult(_0x160593,null))[_0xcab8('0x49')](handleError(_0x160593,null));};exports[_0xcab8('0x4a')]=function(_0x58ddb6,_0x221e90){return db[_0xcab8('0x2e')][_0xcab8('0x4a')](_0x58ddb6[_0xcab8('0x4b')],{})['then'](respondWithResult(_0x221e90,0xc9))[_0xcab8('0x49')](handleError(_0x221e90,null));};exports[_0xcab8('0x28')]=function(_0x26c0e8,_0x4d9bb2){if(_0x26c0e8[_0xcab8('0x4b')]['id']){delete _0x26c0e8[_0xcab8('0x4b')]['id'];}return db[_0xcab8('0x2e')]['find']({'where':{'id':_0x26c0e8[_0xcab8('0x45')]['id']}})[_0xcab8('0x29')](handleEntityNotFound(_0x4d9bb2,null))[_0xcab8('0x29')](saveUpdates(_0x26c0e8['body'],null))['then'](respondWithResult(_0x4d9bb2,null))[_0xcab8('0x49')](handleError(_0x4d9bb2,null));};exports[_0xcab8('0x2a')]=function(_0x3b21be,_0x587dfc){return db[_0xcab8('0x2e')][_0xcab8('0x48')]({'where':{'id':_0x3b21be[_0xcab8('0x45')]['id']}})[_0xcab8('0x29')](handleEntityNotFound(_0x587dfc,null))['then'](removeEntity(_0x587dfc,null))[_0xcab8('0x49')](handleError(_0x587dfc,null));};exports['getConfigurations']=function(_0x2efff9,_0x54feba,_0x103265){var _0x1dacd4={};var _0x450931={};var _0x39d7c2;var _0x273dd5;return db['FreshsalesAccount'][_0xcab8('0x4c')]({'where':{'id':_0x2efff9['params']['id']}})[_0xcab8('0x29')](handleEntityNotFound(_0x54feba,null))[_0xcab8('0x29')](function(_0x57bdc7){if(_0x57bdc7){_0x39d7c2=_0x57bdc7;_0x450931[_0xcab8('0x32')]=_[_0xcab8('0x34')](db[_0xcab8('0x4d')][_0xcab8('0x4e')]);_0x450931[_0xcab8('0x33')]=_[_0xcab8('0x34')](_0x2efff9['query']);_0x450931[_0xcab8('0x35')]=_[_0xcab8('0x36')](_0x450931['model'],_0x450931[_0xcab8('0x33')]);_0x1dacd4[_0xcab8('0x38')]=_[_0xcab8('0x36')](_0x450931[_0xcab8('0x32')],qs[_0xcab8('0x37')](_0x2efff9['query'][_0xcab8('0x37')]));_0x1dacd4[_0xcab8('0x38')]=_0x1dacd4[_0xcab8('0x38')][_0xcab8('0x4f')]?_0x1dacd4[_0xcab8('0x38')]:_0x450931[_0xcab8('0x32')];_0x1dacd4[_0xcab8('0x3b')]=qs[_0xcab8('0x50')](_0x2efff9['query']['sort']);_0x1dacd4[_0xcab8('0x3c')]=qs['filters'](_[_0xcab8('0x3d')](_0x2efff9['query'],_0x450931[_0xcab8('0x35')]));if(_0x2efff9[_0xcab8('0x33')]['filter']){_0x1dacd4[_0xcab8('0x3c')]=_['merge'](_0x1dacd4[_0xcab8('0x3c')],{'$or':_['map'](_0x1dacd4['attributes'],function(_0x437c13){var _0x1ffe33={};_0x1ffe33[_0x437c13]={'$like':'%'+_0x2efff9[_0xcab8('0x33')][_0xcab8('0x3e')]+'%'};return _0x1ffe33;})});}_0x1dacd4=_['merge']({},_0x1dacd4,_0x2efff9[_0xcab8('0x41')]);return _0x39d7c2[_0xcab8('0x51')](_0x1dacd4);}})['then'](function(_0x1c48b6){if(_0x1c48b6){_0x273dd5=_0x1c48b6[_0xcab8('0x4f')];if(!_0x2efff9[_0xcab8('0x33')][_0xcab8('0x39')](_0xcab8('0x3a'))){_0x1dacd4[_0xcab8('0x23')]=qs[_0xcab8('0x23')](_0x2efff9[_0xcab8('0x33')]['limit']);_0x1dacd4[_0xcab8('0x21')]=qs[_0xcab8('0x21')](_0x2efff9[_0xcab8('0x33')]['offset']);}return _0x39d7c2[_0xcab8('0x51')](_0x1dacd4);}})[_0xcab8('0x29')](function(_0x47c78a){if(_0x47c78a){return _0x47c78a?{'count':_0x273dd5,'rows':_0x47c78a}:null;}})[_0xcab8('0x29')](respondWithResult(_0x54feba,null))[_0xcab8('0x49')](handleError(_0x54feba,null));};exports[_0xcab8('0x52')]=function(_0x4cbfd8,_0x31cf9d,_0x5cb663){if(_0x4cbfd8['body']['id']){delete _0x4cbfd8['body']['id'];}return db[_0xcab8('0x2e')][_0xcab8('0x4c')]({'where':{'id':_0x4cbfd8[_0xcab8('0x45')]['id']}})['then'](handleEntityNotFound(_0x31cf9d,null))[_0xcab8('0x29')](function(_0x4cecf7){if(_0x4cecf7){_0x4cbfd8[_0xcab8('0x4b')]['AccountId']=_0x4cecf7['id'];_0x4cbfd8[_0xcab8('0x4b')][_0xcab8('0x53')]=integrations['getSubjects'](_0x4cbfd8['body']['channel'],_0x4cbfd8[_0xcab8('0x4b')][_0xcab8('0x30')]);_0x4cbfd8['body'][_0xcab8('0x54')]=integrations[_0xcab8('0x55')](_0x4cbfd8[_0xcab8('0x4b')]['channel'],_0x4cbfd8['body'][_0xcab8('0x30')]);return db[_0xcab8('0x4d')][_0xcab8('0x4a')](_0x4cbfd8[_0xcab8('0x4b')],{'include':[{'model':db[_0xcab8('0x56')],'as':_0xcab8('0x53')},{'model':db['FreshsalesField'],'as':_0xcab8('0x54')}]});}return null;})[_0xcab8('0x29')](respondWithResult(_0x31cf9d,null))[_0xcab8('0x49')](handleError(_0x31cf9d,null));};exports[_0xcab8('0x57')]=function(_0x58efe5,_0x7d0ac1,_0x551d40){var _0x2bc53d='';var _0x354d85='';return db[_0xcab8('0x2e')]['findOne']({'where':{'id':_0x58efe5[_0xcab8('0x45')]['id']},'attributes':['id',_0xcab8('0x58'),'remoteUri',_0xcab8('0x59')]})['then'](handleEntityNotFound(_0x7d0ac1,null))[_0xcab8('0x29')](function(_0x4be3c0){if(_0x4be3c0){_0x354d85=_0x4be3c0[_0xcab8('0x58')];_0x2bc53d=_0x4be3c0[_0xcab8('0x5a')];var _0x1c4a47=_0x4be3c0[_0xcab8('0x5a')][_0xcab8('0x5b')](-0x1);if(_0x1c4a47==='/'){_0x2bc53d=_0x2bc53d[_0xcab8('0x5c')](0x0,_0x2bc53d[_0xcab8('0x5d')](_0x1c4a47));}return rp({'method':_0xcab8('0x5e'),'uri':util[_0xcab8('0x5f')](_0xcab8('0x60'),_0x2bc53d,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x4be3c0[_0xcab8('0x59')]},'json':!![]});}})[_0xcab8('0x29')](function(_0x211c57){if(_0x211c57){var _0xbd48e9=_0x211c57[_0xcab8('0x61')];var _0x59a759=![];var _0x4dcfc2=null;for(_0x4dcfc2=0x0;_0x4dcfc2<_0xbd48e9['length'];_0x4dcfc2++){if(_0xbd48e9[_0x4dcfc2][_0xcab8('0x62')]===_0x354d85){_0x59a759=!![];}}if(_0x59a759){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x7d0ac1,null))['catch'](function(_0x4de699){var _0xe6537=_0x58efe5[_0xcab8('0x33')][_0xcab8('0x63')]?0x1f4:_0x4de699[_0xcab8('0x64')]||0x1f4;logger['error'](_0xcab8('0x65'),_0xcab8('0x57'),_0xe6537,JSON['stringify'](_0x4de699));delete _0x4de699[_0xcab8('0x2b')];if(_0xe6537===0x191){_0xe6537=0x190;}_0x7d0ac1[_0xcab8('0x1e')](_0xe6537)['send'](_0x58efe5[_0xcab8('0x33')][_0xcab8('0x63')]?{'message':_0xcab8('0x66'),'statusCode':_0x4de699['statusCode']}:_0x4de699);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index ac9e2b0..baead61 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 _0x8aad=['FreshsalesAccount','int_freshsales_accounts','lodash','util','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x42d0ed,_0x91a115){var _0x3f63f6=function(_0x2e961b){while(--_0x2e961b){_0x42d0ed['push'](_0x42d0ed['shift']());}};_0x3f63f6(++_0x91a115);}(_0x8aad,0x146));var _0xd8aa=function(_0x5e29ae,_0x59b06e){_0x5e29ae=_0x5e29ae-0x0;var _0x475575=_0x8aad[_0x5e29ae];return _0x475575;};'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('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd8aa('0x6')]=function(_0x43ddeb,_0x16ea12){return _0x43ddeb['define'](_0xd8aa('0x7'),attributes,{'tableName':_0xd8aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0x7a54,0x106));var _0x47a5=function(_0xfa7576,_0xe3a042){_0xfa7576=_0xfa7576-0x0;var _0x4c8f90=_0x7a54[_0xfa7576];return _0x4c8f90;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),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 47ea908..c7345f6 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 _0x0424=['info','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x34b4d5,_0x5f5bd9){var _0x3bd233=function(_0x4a39a5){while(--_0x4a39a5){_0x34b4d5['push'](_0x34b4d5['shift']());}};_0x3bd233(++_0x5f5bd9);}(_0x0424,0x159));var _0x4042=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0x0424[_0xdad237];return _0x15c575;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['findAll']({'raw':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x466077[_0x4042('0x17')]?_0x466077['options'][_0x4042('0x19')]||null:null,'attributes':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1a')]||null:null,'limit':_0x466077['options']?_0x466077[_0x4042('0x17')][_0x4042('0x1b')]||null:null,'include':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1c')]?_['map'](_0x466077[_0x4042('0x17')][_0x4042('0x1c')],function(_0x519f2c){return{'model':db[_0x519f2c[_0x4042('0x1d')]],'as':_0x519f2c['as'],'attributes':_0x519f2c['attributes'],'include':_0x519f2c[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x519f2c[_0x4042('0x1c')],function(_0x5d5c6d){return{'model':db[_0x5d5c6d[_0x4042('0x1d')]],'as':_0x5d5c6d['as'],'attributes':_0x5d5c6d[_0x4042('0x1a')],'include':_0x5d5c6d[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x5d5c6d[_0x4042('0x1c')],function(_0x52e575){return{'model':db[_0x52e575['model']],'as':_0x52e575['as'],'attributes':_0x52e575[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26542c){logger[_0x4042('0x12')](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('GetFreshsalesAccount',_0x466077,JSON[_0x4042('0xf')](_0x26542c));_0xe5c1ec(_0x26542c);})[_0x4042('0x14')](function(_0x4a6a6e){logger[_0x4042('0x10')](_0x4042('0x15'),_0x4a6a6e[_0x4042('0x11')],_0x466077);_0x4fe024(_0x4b02d4['error'](0x1f4,_0x4a6a6e['message']));});});};exports[_0x4042('0x1f')]=function(_0x43bd1c){var _0x59773f=this;return new Promise(function(_0x3e9304,_0xc42d70){return db[_0x4042('0x16')][_0x4042('0x20')]({'raw':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['where']||null:null,'attributes':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['attributes']||null:null,'include':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['include']?_[_0x4042('0x1e')](_0x43bd1c[_0x4042('0x17')][_0x4042('0x1c')],function(_0xaa7c99){return{'model':db[_0xaa7c99[_0x4042('0x1d')]],'as':_0xaa7c99['as'],'attributes':_0xaa7c99[_0x4042('0x1a')],'include':_0xaa7c99[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0xaa7c99[_0x4042('0x1c')],function(_0x37195b){return{'model':db[_0x37195b[_0x4042('0x1d')]],'as':_0x37195b['as'],'attributes':_0x37195b[_0x4042('0x1a')],'include':_0x37195b[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x37195b[_0x4042('0x1c')],function(_0x2b5f5e){return{'model':db[_0x2b5f5e[_0x4042('0x1d')]],'as':_0x2b5f5e['as'],'attributes':_0x2b5f5e[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26b7b0){logger[_0x4042('0x12')]('ShowFreshsalesAccount',_0x43bd1c);logger[_0x4042('0xd')](_0x4042('0x1f'),_0x43bd1c,JSON[_0x4042('0xf')](_0x26b7b0));_0x3e9304(_0x26b7b0);})[_0x4042('0x14')](function(_0x588932){logger[_0x4042('0x10')](_0x4042('0x1f'),_0x588932[_0x4042('0x11')],_0x43bd1c);_0xc42d70(_0x59773f[_0x4042('0x10')](0x1f4,_0x588932[_0x4042('0x11')]));});});}; \ No newline at end of file +var _0x5fab=['map','model','info','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','include','attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ae22a,_0x4fe753){_0x2ae22a=_0x2ae22a-0x0;var _0x286a82=_0x5fab[_0x2ae22a];return _0x286a82;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}exports[_0xb5fa('0x18')]=function(_0x32e9e5){var _0x46eef0=this;return new Promise(function(_0x324ba5,_0x13e82b){return db[_0xb5fa('0x19')][_0xb5fa('0x1a')]({'raw':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1c')]===undefined?!![]:![]:!![],'where':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5['options'][_0xb5fa('0x1d')]||null:null,'attributes':_0x32e9e5['options']?_0x32e9e5[_0xb5fa('0x1b')]['attributes']||null:null,'limit':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')]['limit']||null:null,'include':_0x32e9e5[_0xb5fa('0x1b')]?_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1e')]?_['map'](_0x32e9e5[_0xb5fa('0x1b')][_0xb5fa('0x1e')],function(_0x444237){return{'model':db[_0x444237['model']],'as':_0x444237['as'],'attributes':_0x444237[_0xb5fa('0x1f')],'include':_0x444237['include']?_[_0xb5fa('0x20')](_0x444237[_0xb5fa('0x1e')],function(_0x11053a){return{'model':db[_0x11053a[_0xb5fa('0x21')]],'as':_0x11053a['as'],'attributes':_0x11053a[_0xb5fa('0x1f')],'include':_0x11053a[_0xb5fa('0x1e')]?_[_0xb5fa('0x20')](_0x11053a[_0xb5fa('0x1e')],function(_0x568870){return{'model':db[_0x568870['model']],'as':_0x568870['as'],'attributes':_0x568870['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28a350){logger[_0xb5fa('0x22')](_0xb5fa('0x18'),_0x32e9e5);logger[_0xb5fa('0xf')](_0xb5fa('0x18'),_0x32e9e5,JSON[_0xb5fa('0x11')](_0x28a350));_0x324ba5(_0x28a350);})[_0xb5fa('0x17')](function(_0x353314){logger[_0xb5fa('0x12')](_0xb5fa('0x18'),_0x353314[_0xb5fa('0x14')],_0x32e9e5);_0x13e82b(_0x46eef0[_0xb5fa('0x12')](0x1f4,_0x353314[_0xb5fa('0x14')]));});});};exports[_0xb5fa('0x23')]=function(_0xed02e){var _0x116773=this;return new Promise(function(_0x5a0152,_0x3fd1fb){return db[_0xb5fa('0x19')][_0xb5fa('0x24')]({'raw':_0xed02e[_0xb5fa('0x1b')]?_0xed02e[_0xb5fa('0x1b')][_0xb5fa('0x1c')]===undefined?!![]:![]:!![],'where':_0xed02e[_0xb5fa('0x1b')]?_0xed02e['options'][_0xb5fa('0x1d')]||null:null,'attributes':_0xed02e['options']?_0xed02e['options']['attributes']||null:null,'include':_0xed02e[_0xb5fa('0x1b')]?_0xed02e['options'][_0xb5fa('0x1e')]?_['map'](_0xed02e['options'][_0xb5fa('0x1e')],function(_0x934b49){return{'model':db[_0x934b49['model']],'as':_0x934b49['as'],'attributes':_0x934b49['attributes'],'include':_0x934b49[_0xb5fa('0x1e')]?_[_0xb5fa('0x20')](_0x934b49[_0xb5fa('0x1e')],function(_0x560b53){return{'model':db[_0x560b53[_0xb5fa('0x21')]],'as':_0x560b53['as'],'attributes':_0x560b53[_0xb5fa('0x1f')],'include':_0x560b53['include']?_[_0xb5fa('0x20')](_0x560b53[_0xb5fa('0x1e')],function(_0x204d6b){return{'model':db[_0x204d6b['model']],'as':_0x204d6b['as'],'attributes':_0x204d6b[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0xd')](function(_0x24ef11){logger['info'](_0xb5fa('0x23'),_0xed02e);logger[_0xb5fa('0xf')](_0xb5fa('0x23'),_0xed02e,JSON[_0xb5fa('0x11')](_0x24ef11));_0x5a0152(_0x24ef11);})['catch'](function(_0x4bba91){logger['error']('ShowFreshsalesAccount',_0x4bba91['message'],_0xed02e);_0x3fd1fb(_0x116773['error'](0x1f4,_0x4bba91[_0xb5fa('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6f3ade9..a0d9b56 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 _0x9875=['isAuthenticated','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','/:id'];(function(_0x1f7d13,_0x886eb9){var _0x28d5ef=function(_0x3dc3a4){while(--_0x3dc3a4){_0x1f7d13['push'](_0x1f7d13['shift']());}};_0x28d5ef(++_0x886eb9);}(_0x9875,0x120));var _0x5987=function(_0x166a00,_0x12e693){_0x166a00=_0x166a00-0x0;var _0x53b170=_0x9875[_0x166a00];return _0x53b170;};'use strict';var multer=require(_0x5987('0x0'));var util=require(_0x5987('0x1'));var path=require(_0x5987('0x2'));var timeout=require(_0x5987('0x3'));var express=require(_0x5987('0x4'));var router=express['Router']();var fs_extra=require(_0x5987('0x5'));var auth=require(_0x5987('0x6'));var interaction=require(_0x5987('0x7'));var config=require('../../config/environment');var controller=require(_0x5987('0x8'));router[_0x5987('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5987('0x9')](_0x5987('0xa'),auth[_0x5987('0xb')](),controller[_0x5987('0xc')]);router[_0x5987('0x9')](_0x5987('0xd'),auth[_0x5987('0xb')](),controller['getSubjects']);router['get'](_0x5987('0xe'),auth[_0x5987('0xb')](),controller[_0x5987('0xf')]);router[_0x5987('0x9')](_0x5987('0x10'),auth[_0x5987('0xb')](),controller[_0x5987('0x11')]);router[_0x5987('0x12')]('/',auth[_0x5987('0xb')](),controller[_0x5987('0x13')]);router['put']('/:id',auth[_0x5987('0xb')](),controller[_0x5987('0x14')]);router['delete'](_0x5987('0xa'),auth[_0x5987('0xb')](),controller[_0x5987('0x15')]);module[_0x5987('0x16')]=router; \ No newline at end of file +var _0x438c=['create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post'];(function(_0x409b5a,_0x2199be){var _0x30a369=function(_0x57e9b0){while(--_0x57e9b0){_0x409b5a['push'](_0x409b5a['shift']());}};_0x30a369(++_0x2199be);}(_0x438c,0x1a3));var _0xc438=function(_0x11de58,_0xc75ba7){_0x11de58=_0x11de58-0x0;var _0x146b2f=_0x438c[_0x11de58];return _0x146b2f;};'use strict';var multer=require(_0xc438('0x0'));var util=require('util');var path=require(_0xc438('0x1'));var timeout=require(_0xc438('0x2'));var express=require('express');var router=express[_0xc438('0x3')]();var fs_extra=require(_0xc438('0x4'));var auth=require(_0xc438('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc438('0x6'));router[_0xc438('0x7')]('/',auth['isAuthenticated'](),controller[_0xc438('0x8')]);router['get'](_0xc438('0x9'),auth[_0xc438('0xa')](),controller[_0xc438('0xb')]);router[_0xc438('0x7')](_0xc438('0xc'),auth[_0xc438('0xa')](),controller[_0xc438('0xd')]);router[_0xc438('0x7')](_0xc438('0xe'),auth[_0xc438('0xa')](),controller[_0xc438('0xf')]);router[_0xc438('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc438('0x10')]);router[_0xc438('0x11')]('/',auth[_0xc438('0xa')](),controller[_0xc438('0x12')]);router['put'](_0xc438('0x9'),auth[_0xc438('0xa')](),controller[_0xc438('0x13')]);router[_0xc438('0x14')](_0xc438('0x9'),auth[_0xc438('0xa')](),controller[_0xc438('0x15')]);module[_0xc438('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 d87f65c..5aa45bc 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 _0xb0a9=['STRING','sequelize','exports'];(function(_0x232f86,_0x52fd9d){var _0x2a21c6=function(_0x582149){while(--_0x582149){_0x232f86['push'](_0x232f86['shift']());}};_0x2a21c6(++_0x52fd9d);}(_0xb0a9,0x1e7));var _0x9b0a=function(_0x132d12,_0x2c9799){_0x132d12=_0x132d12-0x0;var _0x1c3163=_0xb0a9[_0x132d12];return _0x1c3163;};'use strict';var Sequelize=require(_0x9b0a('0x0'));module[_0x9b0a('0x1')]={'name':{'type':Sequelize[_0x9b0a('0x2')]},'description':{'type':Sequelize[_0x9b0a('0x2')]}}; \ No newline at end of file +var _0x7f22=['exports','STRING','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7f22,0x1be));var _0x27f2=function(_0x5b280a,_0x37caeb){_0x5b280a=_0x5b280a-0x0;var _0x2f81f1=_0x7f22[_0x5b280a];return _0x2f81f1;};'use strict';var Sequelize=require(_0x27f2('0x0'));module[_0x27f2('0x1')]={'name':{'type':Sequelize[_0x27f2('0x2')]},'description':{'type':Sequelize[_0x27f2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index accb5f0..7c12c2d 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 _0x5ea7=['filters','length','getDescriptions','findOne','getFields','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','include','rows','catch','show','params','keys','find','create','body','destroy','getSubjects','FreshsalesField'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x5ea7,0x195));var _0x75ea=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x5ea7[_0x87b0ff];return _0x3bc0b2;};'use strict';var emlformat=require(_0x75ea('0x0'));var rimraf=require(_0x75ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x75ea('0x2'));var rp=require('request-promise');var moment=require(_0x75ea('0x3'));var BPromise=require(_0x75ea('0x4'));var Mustache=require('mustache');var util=require(_0x75ea('0x5'));var path=require(_0x75ea('0x6'));var sox=require(_0x75ea('0x7'));var csv=require(_0x75ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75ea('0x9'));var squel=require(_0x75ea('0xa'));var crypto=require(_0x75ea('0xb'));var jsforce=require(_0x75ea('0xc'));var deskjs=require(_0x75ea('0xd'));var toCsv=require(_0x75ea('0x8'));var querystring=require(_0x75ea('0xe'));var Papa=require(_0x75ea('0xf'));var Redis=require('ioredis');var authService=require(_0x75ea('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x75ea('0x11'));var hardwareService=require(_0x75ea('0x12'));var logger=require(_0x75ea('0x13'))(_0x75ea('0x14'));var utils=require(_0x75ea('0x15'));var config=require(_0x75ea('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46d1cb,_0xbc8c2b){_0xbc8c2b=_0xbc8c2b||0xcc;return function(_0x4a2fbe){if(_0x4a2fbe){return _0x46d1cb[_0x75ea('0x17')](_0xbc8c2b);}return _0x46d1cb[_0x75ea('0x18')](_0xbc8c2b)['end']();};}function respondWithResult(_0x4a407b,_0x2a2e4e){_0x2a2e4e=_0x2a2e4e||0xc8;return function(_0x27ddc5){if(_0x27ddc5){return _0x4a407b[_0x75ea('0x18')](_0x2a2e4e)[_0x75ea('0x19')](_0x27ddc5);}};}function respondWithFilteredResult(_0x2af33a,_0x1a45ff){return function(_0x1a7c4b){if(_0x1a7c4b){var _0x204150=typeof _0x1a45ff[_0x75ea('0x1a')]===_0x75ea('0x1b')&&typeof _0x1a45ff[_0x75ea('0x1c')]===_0x75ea('0x1b');var _0x297554=_0x1a7c4b[_0x75ea('0x1d')];var _0x256c0c=_0x204150?0x0:_0x1a45ff['offset'];var _0x382bbf=_0x204150?_0x1a7c4b[_0x75ea('0x1d')]:_0x1a45ff['offset']+_0x1a45ff[_0x75ea('0x1c')];var _0x275610;if(_0x382bbf>=_0x297554){_0x382bbf=_0x297554;_0x275610=0xc8;}else{_0x275610=0xce;}_0x2af33a[_0x75ea('0x18')](_0x275610);return _0x2af33a[_0x75ea('0x1e')](_0x75ea('0x1f'),_0x256c0c+'-'+_0x382bbf+'/'+_0x297554)['json'](_0x1a7c4b);}return null;};}function patchUpdates(_0x330cb3){return function(_0x5a5d78){try{jsonpatch[_0x75ea('0x20')](_0x5a5d78,_0x330cb3,!![]);}catch(_0x21f01a){return BPromise[_0x75ea('0x21')](_0x21f01a);}return _0x5a5d78[_0x75ea('0x22')]();};}function saveUpdates(_0x5eb008,_0x542ce8){return function(_0x3fed59){if(_0x3fed59){return _0x3fed59[_0x75ea('0x23')](_0x5eb008)[_0x75ea('0x24')](function(_0x500724){return _0x500724;});}return null;};}function removeEntity(_0x451051,_0x5945dc){return function(_0x1abbff){if(_0x1abbff){return _0x1abbff['destroy']()['then'](function(){_0x451051[_0x75ea('0x18')](0xcc)[_0x75ea('0x25')]();});}};}function handleEntityNotFound(_0x2c1f8a,_0x29d832){return function(_0x11f3e5){if(!_0x11f3e5){_0x2c1f8a[_0x75ea('0x17')](0x194);}return _0x11f3e5;};}function handleError(_0x5344b2,_0x4b785f){_0x4b785f=_0x4b785f||0x1f4;return function(_0x5c9f7f){logger[_0x75ea('0x26')](_0x5c9f7f[_0x75ea('0x27')]);if(_0x5c9f7f[_0x75ea('0x28')]){delete _0x5c9f7f[_0x75ea('0x28')];}_0x5344b2[_0x75ea('0x18')](_0x4b785f)[_0x75ea('0x29')](_0x5c9f7f);};}exports[_0x75ea('0x2a')]=function(_0x518c99,_0x269573){var _0x1db119={},_0x330af7={},_0x5336fa={'count':0x0,'rows':[]};var _0x2e25a0=_['map'](db[_0x75ea('0x2b')][_0x75ea('0x2c')],function(_0x4712a7){return{'name':_0x4712a7['fieldName'],'type':_0x4712a7[_0x75ea('0x2d')][_0x75ea('0x2e')]};});_0x330af7[_0x75ea('0x2f')]=_[_0x75ea('0x30')](_0x2e25a0,_0x75ea('0x28'));_0x330af7['query']=_['keys'](_0x518c99[_0x75ea('0x31')]);_0x330af7['filters']=_[_0x75ea('0x32')](_0x330af7[_0x75ea('0x2f')],_0x330af7['query']);_0x1db119[_0x75ea('0x33')]=_[_0x75ea('0x32')](_0x330af7[_0x75ea('0x2f')],qs[_0x75ea('0x34')](_0x518c99[_0x75ea('0x31')][_0x75ea('0x34')]));_0x1db119['attributes']=_0x1db119[_0x75ea('0x33')]['length']?_0x1db119[_0x75ea('0x33')]:_0x330af7[_0x75ea('0x2f')];if(!_0x518c99[_0x75ea('0x31')][_0x75ea('0x35')](_0x75ea('0x36'))){_0x1db119['limit']=qs[_0x75ea('0x1c')](_0x518c99[_0x75ea('0x31')][_0x75ea('0x1c')]);_0x1db119['offset']=qs[_0x75ea('0x1a')](_0x518c99[_0x75ea('0x31')]['offset']);}_0x1db119[_0x75ea('0x37')]=qs[_0x75ea('0x38')](_0x518c99['query'][_0x75ea('0x38')]);_0x1db119['where']=qs['filters'](_[_0x75ea('0x39')](_0x518c99['query'],_0x330af7['filters']),_0x2e25a0);if(_0x518c99[_0x75ea('0x31')]['filter']){_0x1db119[_0x75ea('0x3a')]=_['merge'](_0x1db119[_0x75ea('0x3a')],{'$or':_[_0x75ea('0x30')](_0x2e25a0,function(_0x557ed9){if(_0x557ed9[_0x75ea('0x2d')]!==_0x75ea('0x3b')){var _0x56ab52={};_0x56ab52[_0x557ed9[_0x75ea('0x28')]]={'$like':'%'+_0x518c99[_0x75ea('0x31')][_0x75ea('0x3c')]+'%'};return _0x56ab52;}})});}_0x1db119=_[_0x75ea('0x3d')]({},_0x1db119,_0x518c99[_0x75ea('0x3e')]);var _0x150d92={'where':_0x1db119[_0x75ea('0x3a')]};return db[_0x75ea('0x2b')][_0x75ea('0x1d')](_0x150d92)[_0x75ea('0x24')](function(_0x2a9a55){_0x5336fa['count']=_0x2a9a55;if(_0x518c99[_0x75ea('0x31')]['includeAll']){_0x1db119[_0x75ea('0x3f')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x1db119);})[_0x75ea('0x24')](function(_0x225407){_0x5336fa[_0x75ea('0x40')]=_0x225407;return _0x5336fa;})[_0x75ea('0x24')](respondWithFilteredResult(_0x269573,_0x1db119))[_0x75ea('0x41')](handleError(_0x269573,null));};exports[_0x75ea('0x42')]=function(_0x4999e0,_0x5a6ffb){var _0x47e077={'raw':![],'where':{'id':_0x4999e0[_0x75ea('0x43')]['id']}},_0x115f88={};_0x115f88[_0x75ea('0x2f')]=_['keys'](db['FreshsalesConfiguration'][_0x75ea('0x2c')]);_0x115f88[_0x75ea('0x31')]=_[_0x75ea('0x44')](_0x4999e0[_0x75ea('0x31')]);_0x115f88['filters']=_['intersection'](_0x115f88[_0x75ea('0x2f')],_0x115f88[_0x75ea('0x31')]);_0x47e077[_0x75ea('0x33')]=_[_0x75ea('0x32')](_0x115f88[_0x75ea('0x2f')],qs['fields'](_0x4999e0[_0x75ea('0x31')][_0x75ea('0x34')]));_0x47e077[_0x75ea('0x33')]=_0x47e077[_0x75ea('0x33')]['length']?_0x47e077['attributes']:_0x115f88['model'];if(_0x4999e0['query']['includeAll']){_0x47e077[_0x75ea('0x3f')]=[{'all':!![]}];}_0x47e077=_[_0x75ea('0x3d')]({},_0x47e077,_0x4999e0['options']);return db[_0x75ea('0x2b')][_0x75ea('0x45')](_0x47e077)[_0x75ea('0x24')](handleEntityNotFound(_0x5a6ffb,null))[_0x75ea('0x24')](respondWithResult(_0x5a6ffb,null))[_0x75ea('0x41')](handleError(_0x5a6ffb,null));};exports[_0x75ea('0x46')]=function(_0x4c0220,_0xd327a8){return db['FreshsalesConfiguration'][_0x75ea('0x46')](_0x4c0220[_0x75ea('0x47')],{})[_0x75ea('0x24')](respondWithResult(_0xd327a8,0xc9))[_0x75ea('0x41')](handleError(_0xd327a8,null));};exports['update']=function(_0x2553d8,_0x4308f6){if(_0x2553d8[_0x75ea('0x47')]['id']){delete _0x2553d8[_0x75ea('0x47')]['id'];}return db[_0x75ea('0x2b')][_0x75ea('0x45')]({'where':{'id':_0x2553d8[_0x75ea('0x43')]['id']}})[_0x75ea('0x24')](handleEntityNotFound(_0x4308f6,null))['then'](saveUpdates(_0x2553d8[_0x75ea('0x47')],null))[_0x75ea('0x24')](respondWithResult(_0x4308f6,null))[_0x75ea('0x41')](handleError(_0x4308f6,null));};exports[_0x75ea('0x48')]=function(_0x4068ce,_0x2aa40e){return db[_0x75ea('0x2b')][_0x75ea('0x45')]({'where':{'id':_0x4068ce['params']['id']}})[_0x75ea('0x24')](handleEntityNotFound(_0x2aa40e,null))[_0x75ea('0x24')](removeEntity(_0x2aa40e,null))['catch'](handleError(_0x2aa40e,null));};exports[_0x75ea('0x49')]=function(_0x20d93c,_0x2b0ca3,_0x3e3360){var _0x2de8ca={};var _0x2fcbd0={};var _0x33b226;var _0x1d3ab8;return db[_0x75ea('0x2b')]['findOne']({'where':{'id':_0x20d93c['params']['id']}})[_0x75ea('0x24')](handleEntityNotFound(_0x2b0ca3,null))[_0x75ea('0x24')](function(_0x189ec3){if(_0x189ec3){_0x33b226=_0x189ec3;_0x2fcbd0[_0x75ea('0x2f')]=_[_0x75ea('0x44')](db[_0x75ea('0x4a')][_0x75ea('0x2c')]);_0x2fcbd0[_0x75ea('0x31')]=_[_0x75ea('0x44')](_0x20d93c['query']);_0x2fcbd0[_0x75ea('0x4b')]=_['intersection'](_0x2fcbd0[_0x75ea('0x2f')],_0x2fcbd0[_0x75ea('0x31')]);_0x2de8ca[_0x75ea('0x33')]=_[_0x75ea('0x32')](_0x2fcbd0[_0x75ea('0x2f')],qs['fields'](_0x20d93c[_0x75ea('0x31')]['fields']));_0x2de8ca['attributes']=_0x2de8ca[_0x75ea('0x33')][_0x75ea('0x4c')]?_0x2de8ca[_0x75ea('0x33')]:_0x2fcbd0[_0x75ea('0x2f')];_0x2de8ca[_0x75ea('0x37')]=qs['sort'](_0x20d93c[_0x75ea('0x31')]['sort']);_0x2de8ca[_0x75ea('0x3a')]=qs[_0x75ea('0x4b')](_[_0x75ea('0x39')](_0x20d93c[_0x75ea('0x31')],_0x2fcbd0[_0x75ea('0x4b')]));if(_0x20d93c[_0x75ea('0x31')][_0x75ea('0x3c')]){_0x2de8ca[_0x75ea('0x3a')]=_['merge'](_0x2de8ca['where'],{'$or':_[_0x75ea('0x30')](_0x2de8ca['attributes'],function(_0x35e9ca){var _0x46b1d8={};_0x46b1d8[_0x35e9ca]={'$like':'%'+_0x20d93c[_0x75ea('0x31')][_0x75ea('0x3c')]+'%'};return _0x46b1d8;})});}_0x2de8ca=_[_0x75ea('0x3d')]({},_0x2de8ca,_0x20d93c[_0x75ea('0x3e')]);return _0x33b226['getSubjects'](_0x2de8ca);}})[_0x75ea('0x24')](function(_0x6c0b15){if(_0x6c0b15){_0x1d3ab8=_0x6c0b15[_0x75ea('0x4c')];if(!_0x20d93c[_0x75ea('0x31')][_0x75ea('0x35')](_0x75ea('0x36'))){_0x2de8ca[_0x75ea('0x1c')]=qs['limit'](_0x20d93c[_0x75ea('0x31')][_0x75ea('0x1c')]);_0x2de8ca['offset']=qs[_0x75ea('0x1a')](_0x20d93c[_0x75ea('0x31')]['offset']);}return _0x33b226[_0x75ea('0x49')](_0x2de8ca);}})[_0x75ea('0x24')](function(_0x113f0f){if(_0x113f0f){return _0x113f0f?{'count':_0x1d3ab8,'rows':_0x113f0f}:null;}})['then'](respondWithResult(_0x2b0ca3,null))[_0x75ea('0x41')](handleError(_0x2b0ca3,null));};exports[_0x75ea('0x4d')]=function(_0x614903,_0xb5a88c,_0x3c2e53){var _0xcbfca5={};var _0xa791a9={};var _0x2a966d;var _0x1b005b;return db[_0x75ea('0x2b')][_0x75ea('0x4e')]({'where':{'id':_0x614903[_0x75ea('0x43')]['id']}})[_0x75ea('0x24')](handleEntityNotFound(_0xb5a88c,null))[_0x75ea('0x24')](function(_0x44befd){if(_0x44befd){_0x2a966d=_0x44befd;_0xa791a9[_0x75ea('0x2f')]=_[_0x75ea('0x44')](db[_0x75ea('0x4a')][_0x75ea('0x2c')]);_0xa791a9[_0x75ea('0x31')]=_[_0x75ea('0x44')](_0x614903[_0x75ea('0x31')]);_0xa791a9['filters']=_['intersection'](_0xa791a9[_0x75ea('0x2f')],_0xa791a9['query']);_0xcbfca5[_0x75ea('0x33')]=_[_0x75ea('0x32')](_0xa791a9[_0x75ea('0x2f')],qs[_0x75ea('0x34')](_0x614903[_0x75ea('0x31')][_0x75ea('0x34')]));_0xcbfca5['attributes']=_0xcbfca5['attributes']['length']?_0xcbfca5[_0x75ea('0x33')]:_0xa791a9[_0x75ea('0x2f')];_0xcbfca5[_0x75ea('0x37')]=qs['sort'](_0x614903[_0x75ea('0x31')][_0x75ea('0x38')]);_0xcbfca5[_0x75ea('0x3a')]=qs['filters'](_[_0x75ea('0x39')](_0x614903[_0x75ea('0x31')],_0xa791a9['filters']));if(_0x614903[_0x75ea('0x31')]['filter']){_0xcbfca5['where']=_['merge'](_0xcbfca5['where'],{'$or':_[_0x75ea('0x30')](_0xcbfca5[_0x75ea('0x33')],function(_0x535d1a){var _0x383824={};_0x383824[_0x535d1a]={'$like':'%'+_0x614903['query'][_0x75ea('0x3c')]+'%'};return _0x383824;})});}_0xcbfca5=_[_0x75ea('0x3d')]({},_0xcbfca5,_0x614903['options']);return _0x2a966d[_0x75ea('0x4d')](_0xcbfca5);}})['then'](function(_0x5baa57){if(_0x5baa57){_0x1b005b=_0x5baa57[_0x75ea('0x4c')];if(!_0x614903['query'][_0x75ea('0x35')](_0x75ea('0x36'))){_0xcbfca5[_0x75ea('0x1c')]=qs[_0x75ea('0x1c')](_0x614903[_0x75ea('0x31')][_0x75ea('0x1c')]);_0xcbfca5[_0x75ea('0x1a')]=qs[_0x75ea('0x1a')](_0x614903['query'][_0x75ea('0x1a')]);}return _0x2a966d[_0x75ea('0x4d')](_0xcbfca5);}})[_0x75ea('0x24')](function(_0x3de9eb){if(_0x3de9eb){return _0x3de9eb?{'count':_0x1b005b,'rows':_0x3de9eb}:null;}})[_0x75ea('0x24')](respondWithResult(_0xb5a88c,null))['catch'](handleError(_0xb5a88c,null));};exports['getFields']=function(_0x1584a3,_0x308501,_0x466b95){var _0x45ac9c={};var _0x2ba50e={};var _0x30bf34;var _0x467e6b;return db[_0x75ea('0x2b')][_0x75ea('0x4e')]({'where':{'id':_0x1584a3[_0x75ea('0x43')]['id']}})[_0x75ea('0x24')](handleEntityNotFound(_0x308501,null))[_0x75ea('0x24')](function(_0x34978e){if(_0x34978e){_0x30bf34=_0x34978e;_0x2ba50e['model']=_[_0x75ea('0x44')](db[_0x75ea('0x4a')][_0x75ea('0x2c')]);_0x2ba50e[_0x75ea('0x31')]=_[_0x75ea('0x44')](_0x1584a3['query']);_0x2ba50e[_0x75ea('0x4b')]=_[_0x75ea('0x32')](_0x2ba50e[_0x75ea('0x2f')],_0x2ba50e[_0x75ea('0x31')]);_0x45ac9c['attributes']=_['intersection'](_0x2ba50e[_0x75ea('0x2f')],qs[_0x75ea('0x34')](_0x1584a3[_0x75ea('0x31')][_0x75ea('0x34')]));_0x45ac9c[_0x75ea('0x33')]=_0x45ac9c[_0x75ea('0x33')][_0x75ea('0x4c')]?_0x45ac9c[_0x75ea('0x33')]:_0x2ba50e[_0x75ea('0x2f')];_0x45ac9c[_0x75ea('0x37')]=qs[_0x75ea('0x38')](_0x1584a3[_0x75ea('0x31')][_0x75ea('0x38')]);_0x45ac9c['where']=qs[_0x75ea('0x4b')](_[_0x75ea('0x39')](_0x1584a3[_0x75ea('0x31')],_0x2ba50e[_0x75ea('0x4b')]));if(_0x1584a3[_0x75ea('0x31')][_0x75ea('0x3c')]){_0x45ac9c[_0x75ea('0x3a')]=_[_0x75ea('0x3d')](_0x45ac9c['where'],{'$or':_['map'](_0x45ac9c['attributes'],function(_0x27f515){var _0x42a4b8={};_0x42a4b8[_0x27f515]={'$like':'%'+_0x1584a3['query'][_0x75ea('0x3c')]+'%'};return _0x42a4b8;})});}_0x45ac9c=_[_0x75ea('0x3d')]({},_0x45ac9c,_0x1584a3[_0x75ea('0x3e')]);return _0x30bf34[_0x75ea('0x4f')](_0x45ac9c);}})[_0x75ea('0x24')](function(_0x322243){if(_0x322243){_0x467e6b=_0x322243[_0x75ea('0x4c')];if(!_0x1584a3['query'][_0x75ea('0x35')]('nolimit')){_0x45ac9c[_0x75ea('0x1c')]=qs['limit'](_0x1584a3[_0x75ea('0x31')][_0x75ea('0x1c')]);_0x45ac9c[_0x75ea('0x1a')]=qs[_0x75ea('0x1a')](_0x1584a3[_0x75ea('0x31')][_0x75ea('0x1a')]);}return _0x30bf34[_0x75ea('0x4f')](_0x45ac9c);}})['then'](function(_0x56851d){if(_0x56851d){return _0x56851d?{'count':_0x467e6b,'rows':_0x56851d}:null;}})[_0x75ea('0x24')](respondWithResult(_0x308501,null))[_0x75ea('0x41')](handleError(_0x308501,null));}; \ No newline at end of file +var _0xf528=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','FreshsalesConfiguration','includeAll','find','create','body','update','getSubjects','findOne','FreshsalesField','filter','getDescriptions','nolimit','getFields','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0xf528,0x1ca));var _0x8f52=function(_0x3bbc75,_0xddc712){_0x3bbc75=_0x3bbc75-0x0;var _0x48cc18=_0xf528[_0x3bbc75];return _0x48cc18;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8f52('0x0'));var jsonpatch=require(_0x8f52('0x1'));var rp=require(_0x8f52('0x2'));var moment=require(_0x8f52('0x3'));var BPromise=require(_0x8f52('0x4'));var Mustache=require(_0x8f52('0x5'));var util=require(_0x8f52('0x6'));var path=require(_0x8f52('0x7'));var sox=require(_0x8f52('0x8'));var csv=require(_0x8f52('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f52('0xa'));var _=require('lodash');var squel=require(_0x8f52('0xb'));var crypto=require('crypto');var jsforce=require(_0x8f52('0xc'));var deskjs=require(_0x8f52('0xd'));var toCsv=require(_0x8f52('0x9'));var querystring=require(_0x8f52('0xe'));var Papa=require(_0x8f52('0xf'));var Redis=require(_0x8f52('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8f52('0x11'));var as=require(_0x8f52('0x12'));var hardwareService=require(_0x8f52('0x13'));var logger=require(_0x8f52('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8f52('0x15'));var db=require(_0x8f52('0x16'))['db'];function respondWithStatusCode(_0x220fb9,_0x261363){_0x261363=_0x261363||0xcc;return function(_0x59c007){if(_0x59c007){return _0x220fb9[_0x8f52('0x17')](_0x261363);}return _0x220fb9['status'](_0x261363)[_0x8f52('0x18')]();};}function respondWithResult(_0x3dab8c,_0x5d2041){_0x5d2041=_0x5d2041||0xc8;return function(_0x369957){if(_0x369957){return _0x3dab8c[_0x8f52('0x19')](_0x5d2041)[_0x8f52('0x1a')](_0x369957);}};}function respondWithFilteredResult(_0x1b8fef,_0x2b381c){return function(_0x42cc8c){if(_0x42cc8c){var _0x274cbb=typeof _0x2b381c[_0x8f52('0x1b')]===_0x8f52('0x1c')&&typeof _0x2b381c[_0x8f52('0x1d')]===_0x8f52('0x1c');var _0xddc8a6=_0x42cc8c[_0x8f52('0x1e')];var _0x43d530=_0x274cbb?0x0:_0x2b381c[_0x8f52('0x1b')];var _0xf79f11=_0x274cbb?_0x42cc8c[_0x8f52('0x1e')]:_0x2b381c['offset']+_0x2b381c[_0x8f52('0x1d')];var _0x51fb8f;if(_0xf79f11>=_0xddc8a6){_0xf79f11=_0xddc8a6;_0x51fb8f=0xc8;}else{_0x51fb8f=0xce;}_0x1b8fef[_0x8f52('0x19')](_0x51fb8f);return _0x1b8fef[_0x8f52('0x1f')]('Content-Range',_0x43d530+'-'+_0xf79f11+'/'+_0xddc8a6)['json'](_0x42cc8c);}return null;};}function patchUpdates(_0x532f9d){return function(_0x4ce1ef){try{jsonpatch[_0x8f52('0x20')](_0x4ce1ef,_0x532f9d,!![]);}catch(_0x2dbdad){return BPromise[_0x8f52('0x21')](_0x2dbdad);}return _0x4ce1ef['save']();};}function saveUpdates(_0x189060,_0x4fa636){return function(_0x47b10c){if(_0x47b10c){return _0x47b10c['update'](_0x189060)[_0x8f52('0x22')](function(_0x187ed3){return _0x187ed3;});}return null;};}function removeEntity(_0x5aa0ee,_0x1e2e9b){return function(_0x496cdd){if(_0x496cdd){return _0x496cdd[_0x8f52('0x23')]()['then'](function(){_0x5aa0ee[_0x8f52('0x19')](0xcc)[_0x8f52('0x18')]();});}};}function handleEntityNotFound(_0x4f8bba,_0x119aa2){return function(_0x566d2f){if(!_0x566d2f){_0x4f8bba[_0x8f52('0x17')](0x194);}return _0x566d2f;};}function handleError(_0x13af16,_0x50bc6a){_0x50bc6a=_0x50bc6a||0x1f4;return function(_0x3e5b42){logger[_0x8f52('0x24')](_0x3e5b42['stack']);if(_0x3e5b42[_0x8f52('0x25')]){delete _0x3e5b42[_0x8f52('0x25')];}_0x13af16[_0x8f52('0x19')](_0x50bc6a)[_0x8f52('0x26')](_0x3e5b42);};}exports[_0x8f52('0x27')]=function(_0x95e04a,_0x130d46){var _0x1c1737={},_0x172d7e={},_0x411a6b={'count':0x0,'rows':[]};var _0x45210e=_[_0x8f52('0x28')](db['FreshsalesConfiguration'][_0x8f52('0x29')],function(_0x54bef9){return{'name':_0x54bef9['fieldName'],'type':_0x54bef9[_0x8f52('0x2a')][_0x8f52('0x2b')]};});_0x172d7e[_0x8f52('0x2c')]=_[_0x8f52('0x28')](_0x45210e,_0x8f52('0x25'));_0x172d7e[_0x8f52('0x2d')]=_['keys'](_0x95e04a[_0x8f52('0x2d')]);_0x172d7e[_0x8f52('0x2e')]=_[_0x8f52('0x2f')](_0x172d7e['model'],_0x172d7e[_0x8f52('0x2d')]);_0x1c1737[_0x8f52('0x30')]=_[_0x8f52('0x2f')](_0x172d7e['model'],qs['fields'](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x31')]));_0x1c1737[_0x8f52('0x30')]=_0x1c1737[_0x8f52('0x30')][_0x8f52('0x32')]?_0x1c1737['attributes']:_0x172d7e[_0x8f52('0x2c')];if(!_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x33')]('nolimit')){_0x1c1737[_0x8f52('0x1d')]=qs['limit'](_0x95e04a[_0x8f52('0x2d')]['limit']);_0x1c1737[_0x8f52('0x1b')]=qs[_0x8f52('0x1b')](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x1b')]);}_0x1c1737[_0x8f52('0x34')]=qs['sort'](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x35')]);_0x1c1737[_0x8f52('0x36')]=qs['filters'](_[_0x8f52('0x37')](_0x95e04a[_0x8f52('0x2d')],_0x172d7e['filters']),_0x45210e);if(_0x95e04a[_0x8f52('0x2d')]['filter']){_0x1c1737[_0x8f52('0x36')]=_['merge'](_0x1c1737[_0x8f52('0x36')],{'$or':_[_0x8f52('0x28')](_0x45210e,function(_0x4ca1fc){if(_0x4ca1fc[_0x8f52('0x2a')]!==_0x8f52('0x38')){var _0x1ed29f={};_0x1ed29f[_0x4ca1fc[_0x8f52('0x25')]]={'$like':'%'+_0x95e04a['query']['filter']+'%'};return _0x1ed29f;}})});}_0x1c1737=_[_0x8f52('0x39')]({},_0x1c1737,_0x95e04a[_0x8f52('0x3a')]);var _0x42dbba={'where':_0x1c1737[_0x8f52('0x36')]};return db['FreshsalesConfiguration'][_0x8f52('0x1e')](_0x42dbba)[_0x8f52('0x22')](function(_0x5c725d){_0x411a6b['count']=_0x5c725d;if(_0x95e04a[_0x8f52('0x2d')]['includeAll']){_0x1c1737[_0x8f52('0x3b')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x8f52('0x3c')](_0x1c1737);})['then'](function(_0xc1a8ea){_0x411a6b[_0x8f52('0x3d')]=_0xc1a8ea;return _0x411a6b;})['then'](respondWithFilteredResult(_0x130d46,_0x1c1737))[_0x8f52('0x3e')](handleError(_0x130d46,null));};exports[_0x8f52('0x3f')]=function(_0x195672,_0x1dc439){var _0x4775cc={'raw':![],'where':{'id':_0x195672[_0x8f52('0x40')]['id']}},_0x5a80da={};_0x5a80da['model']=_[_0x8f52('0x41')](db[_0x8f52('0x42')]['rawAttributes']);_0x5a80da[_0x8f52('0x2d')]=_[_0x8f52('0x41')](_0x195672[_0x8f52('0x2d')]);_0x5a80da[_0x8f52('0x2e')]=_[_0x8f52('0x2f')](_0x5a80da[_0x8f52('0x2c')],_0x5a80da[_0x8f52('0x2d')]);_0x4775cc['attributes']=_[_0x8f52('0x2f')](_0x5a80da[_0x8f52('0x2c')],qs[_0x8f52('0x31')](_0x195672[_0x8f52('0x2d')][_0x8f52('0x31')]));_0x4775cc[_0x8f52('0x30')]=_0x4775cc[_0x8f52('0x30')]['length']?_0x4775cc[_0x8f52('0x30')]:_0x5a80da['model'];if(_0x195672[_0x8f52('0x2d')][_0x8f52('0x43')]){_0x4775cc[_0x8f52('0x3b')]=[{'all':!![]}];}_0x4775cc=_[_0x8f52('0x39')]({},_0x4775cc,_0x195672['options']);return db['FreshsalesConfiguration'][_0x8f52('0x44')](_0x4775cc)[_0x8f52('0x22')](handleEntityNotFound(_0x1dc439,null))[_0x8f52('0x22')](respondWithResult(_0x1dc439,null))[_0x8f52('0x3e')](handleError(_0x1dc439,null));};exports['create']=function(_0xa17c25,_0x41eb7e){return db[_0x8f52('0x42')][_0x8f52('0x45')](_0xa17c25[_0x8f52('0x46')],{})['then'](respondWithResult(_0x41eb7e,0xc9))[_0x8f52('0x3e')](handleError(_0x41eb7e,null));};exports[_0x8f52('0x47')]=function(_0x18a521,_0x1a6d1d){if(_0x18a521['body']['id']){delete _0x18a521['body']['id'];}return db[_0x8f52('0x42')][_0x8f52('0x44')]({'where':{'id':_0x18a521[_0x8f52('0x40')]['id']}})[_0x8f52('0x22')](handleEntityNotFound(_0x1a6d1d,null))[_0x8f52('0x22')](saveUpdates(_0x18a521[_0x8f52('0x46')],null))[_0x8f52('0x22')](respondWithResult(_0x1a6d1d,null))[_0x8f52('0x3e')](handleError(_0x1a6d1d,null));};exports[_0x8f52('0x23')]=function(_0x21e062,_0x19acf8){return db[_0x8f52('0x42')][_0x8f52('0x44')]({'where':{'id':_0x21e062[_0x8f52('0x40')]['id']}})['then'](handleEntityNotFound(_0x19acf8,null))[_0x8f52('0x22')](removeEntity(_0x19acf8,null))[_0x8f52('0x3e')](handleError(_0x19acf8,null));};exports[_0x8f52('0x48')]=function(_0xe303e0,_0x360734,_0x2d7da5){var _0x514355={};var _0x4c0134={};var _0x4f0a6a;var _0x11344a;return db[_0x8f52('0x42')][_0x8f52('0x49')]({'where':{'id':_0xe303e0[_0x8f52('0x40')]['id']}})[_0x8f52('0x22')](handleEntityNotFound(_0x360734,null))[_0x8f52('0x22')](function(_0x4f44ff){if(_0x4f44ff){_0x4f0a6a=_0x4f44ff;_0x4c0134['model']=_['keys'](db[_0x8f52('0x4a')]['rawAttributes']);_0x4c0134[_0x8f52('0x2d')]=_[_0x8f52('0x41')](_0xe303e0['query']);_0x4c0134[_0x8f52('0x2e')]=_['intersection'](_0x4c0134[_0x8f52('0x2c')],_0x4c0134[_0x8f52('0x2d')]);_0x514355[_0x8f52('0x30')]=_[_0x8f52('0x2f')](_0x4c0134[_0x8f52('0x2c')],qs[_0x8f52('0x31')](_0xe303e0['query']['fields']));_0x514355['attributes']=_0x514355['attributes']['length']?_0x514355[_0x8f52('0x30')]:_0x4c0134[_0x8f52('0x2c')];_0x514355[_0x8f52('0x34')]=qs['sort'](_0xe303e0[_0x8f52('0x2d')]['sort']);_0x514355['where']=qs['filters'](_['pick'](_0xe303e0[_0x8f52('0x2d')],_0x4c0134[_0x8f52('0x2e')]));if(_0xe303e0['query'][_0x8f52('0x4b')]){_0x514355[_0x8f52('0x36')]=_[_0x8f52('0x39')](_0x514355[_0x8f52('0x36')],{'$or':_[_0x8f52('0x28')](_0x514355[_0x8f52('0x30')],function(_0x3fe34e){var _0x597b57={};_0x597b57[_0x3fe34e]={'$like':'%'+_0xe303e0[_0x8f52('0x2d')][_0x8f52('0x4b')]+'%'};return _0x597b57;})});}_0x514355=_[_0x8f52('0x39')]({},_0x514355,_0xe303e0['options']);return _0x4f0a6a['getSubjects'](_0x514355);}})[_0x8f52('0x22')](function(_0x1bd8fe){if(_0x1bd8fe){_0x11344a=_0x1bd8fe['length'];if(!_0xe303e0[_0x8f52('0x2d')][_0x8f52('0x33')]('nolimit')){_0x514355['limit']=qs[_0x8f52('0x1d')](_0xe303e0[_0x8f52('0x2d')][_0x8f52('0x1d')]);_0x514355['offset']=qs['offset'](_0xe303e0[_0x8f52('0x2d')][_0x8f52('0x1b')]);}return _0x4f0a6a['getSubjects'](_0x514355);}})[_0x8f52('0x22')](function(_0x34141e){if(_0x34141e){return _0x34141e?{'count':_0x11344a,'rows':_0x34141e}:null;}})['then'](respondWithResult(_0x360734,null))[_0x8f52('0x3e')](handleError(_0x360734,null));};exports[_0x8f52('0x4c')]=function(_0x1d385d,_0x3c04aa,_0x1931c3){var _0x253a9f={};var _0x2efca3={};var _0x2a8d0e;var _0x486f50;return db[_0x8f52('0x42')]['findOne']({'where':{'id':_0x1d385d['params']['id']}})[_0x8f52('0x22')](handleEntityNotFound(_0x3c04aa,null))['then'](function(_0x5d6b97){if(_0x5d6b97){_0x2a8d0e=_0x5d6b97;_0x2efca3[_0x8f52('0x2c')]=_[_0x8f52('0x41')](db[_0x8f52('0x4a')][_0x8f52('0x29')]);_0x2efca3[_0x8f52('0x2d')]=_[_0x8f52('0x41')](_0x1d385d['query']);_0x2efca3[_0x8f52('0x2e')]=_[_0x8f52('0x2f')](_0x2efca3[_0x8f52('0x2c')],_0x2efca3['query']);_0x253a9f[_0x8f52('0x30')]=_[_0x8f52('0x2f')](_0x2efca3[_0x8f52('0x2c')],qs[_0x8f52('0x31')](_0x1d385d[_0x8f52('0x2d')]['fields']));_0x253a9f['attributes']=_0x253a9f[_0x8f52('0x30')]['length']?_0x253a9f[_0x8f52('0x30')]:_0x2efca3['model'];_0x253a9f[_0x8f52('0x34')]=qs[_0x8f52('0x35')](_0x1d385d[_0x8f52('0x2d')][_0x8f52('0x35')]);_0x253a9f['where']=qs[_0x8f52('0x2e')](_[_0x8f52('0x37')](_0x1d385d[_0x8f52('0x2d')],_0x2efca3['filters']));if(_0x1d385d['query'][_0x8f52('0x4b')]){_0x253a9f['where']=_['merge'](_0x253a9f[_0x8f52('0x36')],{'$or':_[_0x8f52('0x28')](_0x253a9f[_0x8f52('0x30')],function(_0x595655){var _0x3525fd={};_0x3525fd[_0x595655]={'$like':'%'+_0x1d385d['query'][_0x8f52('0x4b')]+'%'};return _0x3525fd;})});}_0x253a9f=_['merge']({},_0x253a9f,_0x1d385d['options']);return _0x2a8d0e[_0x8f52('0x4c')](_0x253a9f);}})[_0x8f52('0x22')](function(_0x4a5f1a){if(_0x4a5f1a){_0x486f50=_0x4a5f1a[_0x8f52('0x32')];if(!_0x1d385d[_0x8f52('0x2d')][_0x8f52('0x33')](_0x8f52('0x4d'))){_0x253a9f[_0x8f52('0x1d')]=qs[_0x8f52('0x1d')](_0x1d385d[_0x8f52('0x2d')][_0x8f52('0x1d')]);_0x253a9f['offset']=qs[_0x8f52('0x1b')](_0x1d385d[_0x8f52('0x2d')]['offset']);}return _0x2a8d0e[_0x8f52('0x4c')](_0x253a9f);}})['then'](function(_0x38a25b){if(_0x38a25b){return _0x38a25b?{'count':_0x486f50,'rows':_0x38a25b}:null;}})[_0x8f52('0x22')](respondWithResult(_0x3c04aa,null))[_0x8f52('0x3e')](handleError(_0x3c04aa,null));};exports['getFields']=function(_0x31a839,_0x1827c9,_0x8b4255){var _0x12b833={};var _0x4e9b6f={};var _0x3c67fc;var _0x3e18a7;return db['FreshsalesConfiguration'][_0x8f52('0x49')]({'where':{'id':_0x31a839['params']['id']}})[_0x8f52('0x22')](handleEntityNotFound(_0x1827c9,null))[_0x8f52('0x22')](function(_0x55abb6){if(_0x55abb6){_0x3c67fc=_0x55abb6;_0x4e9b6f[_0x8f52('0x2c')]=_['keys'](db[_0x8f52('0x4a')][_0x8f52('0x29')]);_0x4e9b6f[_0x8f52('0x2d')]=_['keys'](_0x31a839[_0x8f52('0x2d')]);_0x4e9b6f['filters']=_['intersection'](_0x4e9b6f[_0x8f52('0x2c')],_0x4e9b6f[_0x8f52('0x2d')]);_0x12b833[_0x8f52('0x30')]=_['intersection'](_0x4e9b6f['model'],qs[_0x8f52('0x31')](_0x31a839[_0x8f52('0x2d')][_0x8f52('0x31')]));_0x12b833[_0x8f52('0x30')]=_0x12b833['attributes'][_0x8f52('0x32')]?_0x12b833[_0x8f52('0x30')]:_0x4e9b6f[_0x8f52('0x2c')];_0x12b833[_0x8f52('0x34')]=qs[_0x8f52('0x35')](_0x31a839[_0x8f52('0x2d')][_0x8f52('0x35')]);_0x12b833[_0x8f52('0x36')]=qs[_0x8f52('0x2e')](_[_0x8f52('0x37')](_0x31a839[_0x8f52('0x2d')],_0x4e9b6f['filters']));if(_0x31a839[_0x8f52('0x2d')][_0x8f52('0x4b')]){_0x12b833[_0x8f52('0x36')]=_[_0x8f52('0x39')](_0x12b833['where'],{'$or':_[_0x8f52('0x28')](_0x12b833[_0x8f52('0x30')],function(_0x20bd74){var _0xc31636={};_0xc31636[_0x20bd74]={'$like':'%'+_0x31a839[_0x8f52('0x2d')][_0x8f52('0x4b')]+'%'};return _0xc31636;})});}_0x12b833=_['merge']({},_0x12b833,_0x31a839[_0x8f52('0x3a')]);return _0x3c67fc['getFields'](_0x12b833);}})[_0x8f52('0x22')](function(_0x5bf494){if(_0x5bf494){_0x3e18a7=_0x5bf494[_0x8f52('0x32')];if(!_0x31a839[_0x8f52('0x2d')][_0x8f52('0x33')](_0x8f52('0x4d'))){_0x12b833[_0x8f52('0x1d')]=qs[_0x8f52('0x1d')](_0x31a839['query'][_0x8f52('0x1d')]);_0x12b833['offset']=qs['offset'](_0x31a839[_0x8f52('0x2d')][_0x8f52('0x1b')]);}return _0x3c67fc[_0x8f52('0x4e')](_0x12b833);}})['then'](function(_0x5d4939){if(_0x5d4939){return _0x5d4939?{'count':_0x3e18a7,'rows':_0x5d4939}:null;}})['then'](respondWithResult(_0x1827c9,null))[_0x8f52('0x3e')](handleError(_0x1827c9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 0a9604d..6be4e5d 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 _0x1354=['bluebird','path','../../config/environment','./intFreshsalesConfiguration.attributes','int_freshsales_configurations','lodash','api','moment'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0x1354,0xd5));var _0x4135=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0x1354[_0x243cca];return _0xf94771;};'use strict';var _=require(_0x4135('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4135('0x1'));var moment=require(_0x4135('0x2'));var BPromise=require(_0x4135('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4135('0x4'));var rimraf=require('rimraf');var config=require(_0x4135('0x5'));var attributes=require(_0x4135('0x6'));module['exports']=function(_0x579865,_0x4b1b5a){return _0x579865['define']('FreshsalesConfiguration',attributes,{'tableName':_0x4135('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a3f=['path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0xe506a9,_0x3105d4){var _0x12ca6f=function(_0x5d512d){while(--_0x5d512d){_0xe506a9['push'](_0xe506a9['shift']());}};_0x12ca6f(++_0x3105d4);}(_0x0a3f,0x166));var _0xf0a3=function(_0x265adf,_0x41a78d){_0x265adf=_0x265adf-0x0;var _0x219d6a=_0x0a3f[_0x265adf];return _0x219d6a;};'use strict';var _=require(_0xf0a3('0x0'));var util=require('util');var logger=require(_0xf0a3('0x1'))('api');var moment=require(_0xf0a3('0x2'));var BPromise=require(_0xf0a3('0x3'));var rp=require(_0xf0a3('0x4'));var fs=require('fs');var path=require(_0xf0a3('0x5'));var rimraf=require(_0xf0a3('0x6'));var config=require('../../config/environment');var attributes=require(_0xf0a3('0x7'));module[_0xf0a3('0x8')]=function(_0x296278,_0x348ac1){return _0x296278[_0xf0a3('0x9')](_0xf0a3('0xa'),attributes,{'tableName':'int_freshsales_configurations','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 643a793..35fe117 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 _0x11b6=['stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1d0e07,_0x2037e9){var _0x8912e0=function(_0x3b1c66){while(--_0x3b1c66){_0x1d0e07['push'](_0x1d0e07['shift']());}};_0x8912e0(++_0x2037e9);}(_0x11b6,0x1e8));var _0x611b=function(_0xd7b230,_0x302e4b){_0xd7b230=_0xd7b230-0x0;var _0x39b648=_0x11b6[_0xd7b230];return _0x39b648;};'use strict';var _=require(_0x611b('0x0'));var util=require(_0x611b('0x1'));var moment=require(_0x611b('0x2'));var BPromise=require(_0x611b('0x3'));var rs=require(_0x611b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x611b('0x5'))['db'];var utils=require(_0x611b('0x6'));var logger=require(_0x611b('0x7'))(_0x611b('0x8'));var config=require(_0x611b('0x9'));var jayson=require(_0x611b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25a3c1,_0x6977da,_0x1f13f0){return new BPromise(function(_0x4f296d,_0x5f0991){return client[_0x611b('0xb')](_0x25a3c1,_0x1f13f0)[_0x611b('0xc')](function(_0x4a14cb){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x6977da,_0x611b('0xd'));logger[_0x611b('0xe')](_0x611b('0xf'),_0x6977da,_0x611b('0xd'),JSON[_0x611b('0x10')](_0x4a14cb));if(_0x4a14cb[_0x611b('0x11')]){if(_0x4a14cb[_0x611b('0x11')][_0x611b('0x12')]===0x1f4){logger[_0x611b('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x6977da,_0x4a14cb[_0x611b('0x11')][_0x611b('0x13')]);return _0x5f0991(_0x4a14cb[_0x611b('0x11')][_0x611b('0x13')]);}logger['error'](_0x611b('0x14'),_0x6977da,_0x4a14cb[_0x611b('0x11')]['message']);return _0x4f296d(_0x4a14cb[_0x611b('0x11')][_0x611b('0x13')]);}else{logger[_0x611b('0x15')](_0x611b('0x14'),_0x6977da,_0x611b('0xd'));_0x4f296d(_0x4a14cb[_0x611b('0x16')]['message']);}})[_0x611b('0x17')](function(_0x5b8f29){logger[_0x611b('0x11')](_0x611b('0x14'),_0x6977da,_0x5b8f29);_0x5f0991(_0x5b8f29);});});} \ No newline at end of file +var _0xee7f=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x295031,_0x1e1ccf){var _0x1e8411=function(_0x41183f){while(--_0x41183f){_0x295031['push'](_0x295031['shift']());}};_0x1e8411(++_0x1e1ccf);}(_0xee7f,0x104));var _0xfee7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xee7f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xfee7('0x0'));var moment=require(_0xfee7('0x1'));var BPromise=require(_0xfee7('0x2'));var rs=require(_0xfee7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfee7('0x4'))['db'];var utils=require(_0xfee7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xfee7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfee7('0x7')][_0xfee7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xef3fd7,_0x540e07,_0x11b260){return new BPromise(function(_0xb1cca3,_0x3eef80){return client[_0xfee7('0x9')](_0xef3fd7,_0x11b260)[_0xfee7('0xa')](function(_0x247cb1){logger['info'](_0xfee7('0xb'),_0x540e07,_0xfee7('0xc'));logger[_0xfee7('0xd')](_0xfee7('0xe'),_0x540e07,_0xfee7('0xc'),JSON[_0xfee7('0xf')](_0x247cb1));if(_0x247cb1[_0xfee7('0x10')]){if(_0x247cb1[_0xfee7('0x10')][_0xfee7('0x11')]===0x1f4){logger[_0xfee7('0x10')](_0xfee7('0xb'),_0x540e07,_0x247cb1[_0xfee7('0x10')]['message']);return _0x3eef80(_0x247cb1[_0xfee7('0x10')][_0xfee7('0x12')]);}logger[_0xfee7('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x540e07,_0x247cb1[_0xfee7('0x10')][_0xfee7('0x12')]);return _0xb1cca3(_0x247cb1['error'][_0xfee7('0x12')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x540e07,_0xfee7('0xc'));_0xb1cca3(_0x247cb1[_0xfee7('0x13')][_0xfee7('0x12')]);}})[_0xfee7('0x14')](function(_0x2772c8){logger[_0xfee7('0x10')](_0xfee7('0xb'),_0x540e07,_0x2772c8);_0x3eef80(_0x2772c8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index f80ca23..63bbaa7 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 _0xb201=['Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','exports','multer','path','connect-timeout','express'];(function(_0x314972,_0x557a0d){var _0x1dd1d6=function(_0x11a28e){while(--_0x11a28e){_0x314972['push'](_0x314972['shift']());}};_0x1dd1d6(++_0x557a0d);}(_0xb201,0x1b1));var _0x1b20=function(_0xa2e1a7,_0x16f430){_0xa2e1a7=_0xa2e1a7-0x0;var _0x11b282=_0xb201[_0xa2e1a7];return _0x11b282;};'use strict';var multer=require(_0x1b20('0x0'));var util=require('util');var path=require(_0x1b20('0x1'));var timeout=require(_0x1b20('0x2'));var express=require(_0x1b20('0x3'));var router=express[_0x1b20('0x4')]();var fs_extra=require(_0x1b20('0x5'));var auth=require(_0x1b20('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1b20('0x7'));var controller=require(_0x1b20('0x8'));router[_0x1b20('0x9')]('/',auth['isAuthenticated'](),controller[_0x1b20('0xa')]);router['get'](_0x1b20('0xb'),auth[_0x1b20('0xc')](),controller[_0x1b20('0xd')]);router[_0x1b20('0xe')]('/',auth['isAuthenticated'](),controller[_0x1b20('0xf')]);router[_0x1b20('0x10')](_0x1b20('0xb'),auth['isAuthenticated'](),controller[_0x1b20('0x11')]);router['delete'](_0x1b20('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1b20('0x12')]=router; \ No newline at end of file +var _0x3140=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x126121,_0x35e290){var _0x57d413=function(_0x54e83a){while(--_0x54e83a){_0x126121['push'](_0x126121['shift']());}};_0x57d413(++_0x35e290);}(_0x3140,0xaf));var _0x0314=function(_0x4291dd,_0x95d82){_0x4291dd=_0x4291dd-0x0;var _0x152462=_0x3140[_0x4291dd];return _0x152462;};'use strict';var multer=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var timeout=require(_0x0314('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0314('0x4'));var auth=require(_0x0314('0x5'));var interaction=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var controller=require(_0x0314('0x8'));router[_0x0314('0x9')]('/',auth[_0x0314('0xa')](),controller[_0x0314('0xb')]);router[_0x0314('0x9')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller['show']);router[_0x0314('0xd')]('/',auth[_0x0314('0xa')](),controller['create']);router['put'](_0x0314('0xc'),auth['isAuthenticated'](),controller[_0x0314('0xe')]);router[_0x0314('0xf')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller[_0x0314('0x10')]);module[_0x0314('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 0f81c38..917442c 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 _0x1ce6=['STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x3e3044,_0x10b442){var _0x6f680a=function(_0x14b58a){while(--_0x14b58a){_0x3e3044['push'](_0x3e3044['shift']());}};_0x6f680a(++_0x10b442);}(_0x1ce6,0xb6));var _0x61ce=function(_0x1c1979,_0x4de374){_0x1c1979=_0x1c1979-0x0;var _0x1d1e18=_0x1ce6[_0x1c1979];return _0x1d1e18;};'use strict';var Sequelize=require(_0x61ce('0x0'));module[_0x61ce('0x1')]={'type':{'type':Sequelize[_0x61ce('0x2')](_0x61ce('0x3'),'variable',_0x61ce('0x4'),_0x61ce('0x5'),_0x61ce('0x6')),'defaultValue':_0x61ce('0x3')},'content':{'type':Sequelize[_0x61ce('0x7')]},'key':{'type':Sequelize[_0x61ce('0x7')]},'keyType':{'type':Sequelize[_0x61ce('0x2')](_0x61ce('0x3'),'variable',_0x61ce('0x4'))},'keyContent':{'type':Sequelize[_0x61ce('0x7')]},'idField':{'type':Sequelize[_0x61ce('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x61ce('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x61ce('0x7')]}}; \ No newline at end of file +var _0x8eab=['STRING','ENUM','variable','BOOLEAN','string','customVariable','keyValue','picklist'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x8eab,0x64));var _0xb8ea=function(_0x45437f,_0x3987cd){_0x45437f=_0x45437f-0x0;var _0x5b9afe=_0x8eab[_0x45437f];return _0x5b9afe;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xb8ea('0x0'),'variable',_0xb8ea('0x1'),_0xb8ea('0x2'),_0xb8ea('0x3')),'defaultValue':_0xb8ea('0x0')},'content':{'type':Sequelize[_0xb8ea('0x4')]},'key':{'type':Sequelize[_0xb8ea('0x4')]},'keyType':{'type':Sequelize[_0xb8ea('0x5')]('string',_0xb8ea('0x6'),_0xb8ea('0x1'))},'keyContent':{'type':Sequelize[_0xb8ea('0x4')]},'idField':{'type':Sequelize[_0xb8ea('0x4')]},'nameField':{'type':Sequelize[_0xb8ea('0x4')]},'customField':{'type':Sequelize[_0xb8ea('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb8ea('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 43e4486..aaa68cf 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 _0x7b9e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','end','sendStatus','error','name','send','index','map','FreshsalesField','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7b9e,0x15b));var _0xe7b9=function(_0x183dc4,_0x3ccc4e){_0x183dc4=_0x183dc4-0x0;var _0x122a35=_0x7b9e[_0x183dc4];return _0x122a35;};'use strict';var emlformat=require(_0xe7b9('0x0'));var rimraf=require(_0xe7b9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe7b9('0x2'));var moment=require('moment');var BPromise=require(_0xe7b9('0x3'));var Mustache=require(_0xe7b9('0x4'));var util=require(_0xe7b9('0x5'));var path=require(_0xe7b9('0x6'));var sox=require(_0xe7b9('0x7'));var csv=require(_0xe7b9('0x8'));var ejs=require(_0xe7b9('0x9'));var fs=require('fs');var fs_extra=require(_0xe7b9('0xa'));var _=require(_0xe7b9('0xb'));var squel=require(_0xe7b9('0xc'));var crypto=require(_0xe7b9('0xd'));var jsforce=require(_0xe7b9('0xe'));var deskjs=require(_0xe7b9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe7b9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7b9('0x11'));var qs=require(_0xe7b9('0x12'));var as=require(_0xe7b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7b9('0x14'))(_0xe7b9('0x15'));var utils=require(_0xe7b9('0x16'));var config=require(_0xe7b9('0x17'));var licenseUtil=require(_0xe7b9('0x18'));var db=require(_0xe7b9('0x19'))['db'];function respondWithStatusCode(_0xf66e16,_0x109764){_0x109764=_0x109764||0xcc;return function(_0x29284e){if(_0x29284e){return _0xf66e16['sendStatus'](_0x109764);}return _0xf66e16[_0xe7b9('0x1a')](_0x109764)['end']();};}function respondWithResult(_0x1bd673,_0x5a14b9){_0x5a14b9=_0x5a14b9||0xc8;return function(_0xb1102c){if(_0xb1102c){return _0x1bd673[_0xe7b9('0x1a')](_0x5a14b9)[_0xe7b9('0x1b')](_0xb1102c);}};}function respondWithFilteredResult(_0x103430,_0x9f54ac){return function(_0x41ca64){if(_0x41ca64){var _0x2ca768=typeof _0x9f54ac['offset']==='undefined'&&typeof _0x9f54ac[_0xe7b9('0x1c')]===_0xe7b9('0x1d');var _0x5e0c6b=_0x41ca64[_0xe7b9('0x1e')];var _0x385520=_0x2ca768?0x0:_0x9f54ac[_0xe7b9('0x1f')];var _0x302115=_0x2ca768?_0x41ca64[_0xe7b9('0x1e')]:_0x9f54ac[_0xe7b9('0x1f')]+_0x9f54ac['limit'];var _0x4f6c00;if(_0x302115>=_0x5e0c6b){_0x302115=_0x5e0c6b;_0x4f6c00=0xc8;}else{_0x4f6c00=0xce;}_0x103430[_0xe7b9('0x1a')](_0x4f6c00);return _0x103430[_0xe7b9('0x20')]('Content-Range',_0x385520+'-'+_0x302115+'/'+_0x5e0c6b)['json'](_0x41ca64);}return null;};}function patchUpdates(_0x4d72f2){return function(_0x129439){try{jsonpatch[_0xe7b9('0x21')](_0x129439,_0x4d72f2,!![]);}catch(_0x5b06c3){return BPromise[_0xe7b9('0x22')](_0x5b06c3);}return _0x129439['save']();};}function saveUpdates(_0x4a00a0,_0x1609ee){return function(_0x38def1){if(_0x38def1){return _0x38def1[_0xe7b9('0x23')](_0x4a00a0)[_0xe7b9('0x24')](function(_0x3e0beb){return _0x3e0beb;});}return null;};}function removeEntity(_0x2e1592,_0xdd7743){return function(_0xf378df){if(_0xf378df){return _0xf378df[_0xe7b9('0x25')]()[_0xe7b9('0x24')](function(){_0x2e1592[_0xe7b9('0x1a')](0xcc)[_0xe7b9('0x26')]();});}};}function handleEntityNotFound(_0x2ceaff,_0x986f2e){return function(_0x4fe3d9){if(!_0x4fe3d9){_0x2ceaff[_0xe7b9('0x27')](0x194);}return _0x4fe3d9;};}function handleError(_0x5d68b7,_0x4b7293){_0x4b7293=_0x4b7293||0x1f4;return function(_0x3cd707){logger[_0xe7b9('0x28')](_0x3cd707['stack']);if(_0x3cd707[_0xe7b9('0x29')]){delete _0x3cd707[_0xe7b9('0x29')];}_0x5d68b7[_0xe7b9('0x1a')](_0x4b7293)[_0xe7b9('0x2a')](_0x3cd707);};}exports[_0xe7b9('0x2b')]=function(_0x4d828a,_0x4f6270){var _0x31007e={},_0x39846c={},_0x314a10={'count':0x0,'rows':[]};var _0x4ec964=_[_0xe7b9('0x2c')](db[_0xe7b9('0x2d')]['rawAttributes'],function(_0x1c758d){return{'name':_0x1c758d['fieldName'],'type':_0x1c758d[_0xe7b9('0x2e')]['key']};});_0x39846c[_0xe7b9('0x2f')]=_[_0xe7b9('0x2c')](_0x4ec964,'name');_0x39846c['query']=_[_0xe7b9('0x30')](_0x4d828a[_0xe7b9('0x31')]);_0x39846c[_0xe7b9('0x32')]=_['intersection'](_0x39846c['model'],_0x39846c[_0xe7b9('0x31')]);_0x31007e[_0xe7b9('0x33')]=_[_0xe7b9('0x34')](_0x39846c[_0xe7b9('0x2f')],qs[_0xe7b9('0x35')](_0x4d828a['query'][_0xe7b9('0x35')]));_0x31007e[_0xe7b9('0x33')]=_0x31007e['attributes'][_0xe7b9('0x36')]?_0x31007e[_0xe7b9('0x33')]:_0x39846c[_0xe7b9('0x2f')];if(!_0x4d828a['query'][_0xe7b9('0x37')](_0xe7b9('0x38'))){_0x31007e['limit']=qs[_0xe7b9('0x1c')](_0x4d828a[_0xe7b9('0x31')][_0xe7b9('0x1c')]);_0x31007e[_0xe7b9('0x1f')]=qs['offset'](_0x4d828a[_0xe7b9('0x31')][_0xe7b9('0x1f')]);}_0x31007e[_0xe7b9('0x39')]=qs['sort'](_0x4d828a[_0xe7b9('0x31')]['sort']);_0x31007e[_0xe7b9('0x3a')]=qs[_0xe7b9('0x32')](_[_0xe7b9('0x3b')](_0x4d828a[_0xe7b9('0x31')],_0x39846c[_0xe7b9('0x32')]),_0x4ec964);if(_0x4d828a[_0xe7b9('0x31')][_0xe7b9('0x3c')]){_0x31007e[_0xe7b9('0x3a')]=_[_0xe7b9('0x3d')](_0x31007e[_0xe7b9('0x3a')],{'$or':_[_0xe7b9('0x2c')](_0x4ec964,function(_0x148cee){if(_0x148cee[_0xe7b9('0x2e')]!==_0xe7b9('0x3e')){var _0x3a46a3={};_0x3a46a3[_0x148cee['name']]={'$like':'%'+_0x4d828a[_0xe7b9('0x31')]['filter']+'%'};return _0x3a46a3;}})});}_0x31007e=_['merge']({},_0x31007e,_0x4d828a[_0xe7b9('0x3f')]);var _0x5a8e47={'where':_0x31007e[_0xe7b9('0x3a')]};return db[_0xe7b9('0x2d')][_0xe7b9('0x1e')](_0x5a8e47)[_0xe7b9('0x24')](function(_0x4d781b){_0x314a10[_0xe7b9('0x1e')]=_0x4d781b;if(_0x4d828a['query'][_0xe7b9('0x40')]){_0x31007e[_0xe7b9('0x41')]=[{'all':!![]}];}return db[_0xe7b9('0x2d')][_0xe7b9('0x42')](_0x31007e);})[_0xe7b9('0x24')](function(_0x1af4fe){_0x314a10[_0xe7b9('0x43')]=_0x1af4fe;return _0x314a10;})['then'](respondWithFilteredResult(_0x4f6270,_0x31007e))[_0xe7b9('0x44')](handleError(_0x4f6270,null));};exports['show']=function(_0x1321cc,_0xec589c){var _0x903cb0={'raw':!![],'where':{'id':_0x1321cc[_0xe7b9('0x45')]['id']}},_0x3f6455={};_0x3f6455['model']=_[_0xe7b9('0x30')](db[_0xe7b9('0x2d')]['rawAttributes']);_0x3f6455[_0xe7b9('0x31')]=_['keys'](_0x1321cc[_0xe7b9('0x31')]);_0x3f6455[_0xe7b9('0x32')]=_[_0xe7b9('0x34')](_0x3f6455['model'],_0x3f6455['query']);_0x903cb0[_0xe7b9('0x33')]=_[_0xe7b9('0x34')](_0x3f6455[_0xe7b9('0x2f')],qs[_0xe7b9('0x35')](_0x1321cc[_0xe7b9('0x31')][_0xe7b9('0x35')]));_0x903cb0[_0xe7b9('0x33')]=_0x903cb0[_0xe7b9('0x33')]['length']?_0x903cb0[_0xe7b9('0x33')]:_0x3f6455['model'];if(_0x1321cc['query'][_0xe7b9('0x40')]){_0x903cb0['include']=[{'all':!![]}];}_0x903cb0=_['merge']({},_0x903cb0,_0x1321cc[_0xe7b9('0x3f')]);return db['FreshsalesField'][_0xe7b9('0x46')](_0x903cb0)[_0xe7b9('0x24')](handleEntityNotFound(_0xec589c,null))[_0xe7b9('0x24')](respondWithResult(_0xec589c,null))[_0xe7b9('0x44')](handleError(_0xec589c,null));};exports['create']=function(_0x29a2db,_0x239d9c){return db[_0xe7b9('0x2d')][_0xe7b9('0x47')](_0x29a2db[_0xe7b9('0x48')],{})[_0xe7b9('0x24')](respondWithResult(_0x239d9c,0xc9))['catch'](handleError(_0x239d9c,null));};exports[_0xe7b9('0x23')]=function(_0x2dcac1,_0x226d06){if(_0x2dcac1[_0xe7b9('0x48')]['id']){delete _0x2dcac1['body']['id'];}return db[_0xe7b9('0x2d')][_0xe7b9('0x46')]({'where':{'id':_0x2dcac1[_0xe7b9('0x45')]['id']}})['then'](handleEntityNotFound(_0x226d06,null))[_0xe7b9('0x24')](saveUpdates(_0x2dcac1[_0xe7b9('0x48')],null))[_0xe7b9('0x24')](respondWithResult(_0x226d06,null))[_0xe7b9('0x44')](handleError(_0x226d06,null));};exports[_0xe7b9('0x25')]=function(_0x378871,_0x34b9ce){return db['FreshsalesField'][_0xe7b9('0x46')]({'where':{'id':_0x378871[_0xe7b9('0x45')]['id']}})['then'](handleEntityNotFound(_0x34b9ce,null))[_0xe7b9('0x24')](removeEntity(_0x34b9ce,null))[_0xe7b9('0x44')](handleError(_0x34b9ce,null));}; \ No newline at end of file +var _0x6e97=['nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','length','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','end','stack','name','send','index','map','FreshsalesField','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty'];(function(_0x3462f1,_0x2bb97c){var _0x2866c9=function(_0x3480d0){while(--_0x3480d0){_0x3462f1['push'](_0x3462f1['shift']());}};_0x2866c9(++_0x2bb97c);}(_0x6e97,0x13f));var _0x76e9=function(_0x481c41,_0x48ba3c){_0x481c41=_0x481c41-0x0;var _0xf91fd=_0x6e97[_0x481c41];return _0xf91fd;};'use strict';var emlformat=require(_0x76e9('0x0'));var rimraf=require(_0x76e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76e9('0x2'));var rp=require(_0x76e9('0x3'));var moment=require(_0x76e9('0x4'));var BPromise=require(_0x76e9('0x5'));var Mustache=require(_0x76e9('0x6'));var util=require('util');var path=require(_0x76e9('0x7'));var sox=require(_0x76e9('0x8'));var csv=require(_0x76e9('0x9'));var ejs=require(_0x76e9('0xa'));var fs=require('fs');var fs_extra=require(_0x76e9('0xb'));var _=require(_0x76e9('0xc'));var squel=require(_0x76e9('0xd'));var crypto=require(_0x76e9('0xe'));var jsforce=require(_0x76e9('0xf'));var deskjs=require(_0x76e9('0x10'));var toCsv=require(_0x76e9('0x9'));var querystring=require(_0x76e9('0x11'));var Papa=require(_0x76e9('0x12'));var Redis=require(_0x76e9('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x76e9('0x14'));var as=require(_0x76e9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x76e9('0x16'))(_0x76e9('0x17'));var utils=require(_0x76e9('0x18'));var config=require(_0x76e9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x76e9('0x1a'))['db'];function respondWithStatusCode(_0x248efa,_0x4d4d4f){_0x4d4d4f=_0x4d4d4f||0xcc;return function(_0x5272e1){if(_0x5272e1){return _0x248efa[_0x76e9('0x1b')](_0x4d4d4f);}return _0x248efa['status'](_0x4d4d4f)['end']();};}function respondWithResult(_0x183299,_0x5bae2c){_0x5bae2c=_0x5bae2c||0xc8;return function(_0x118d35){if(_0x118d35){return _0x183299[_0x76e9('0x1c')](_0x5bae2c)[_0x76e9('0x1d')](_0x118d35);}};}function respondWithFilteredResult(_0xf4309,_0x3ab0bd){return function(_0x597a62){if(_0x597a62){var _0xee6c49=typeof _0x3ab0bd[_0x76e9('0x1e')]===_0x76e9('0x1f')&&typeof _0x3ab0bd['limit']===_0x76e9('0x1f');var _0x5a3001=_0x597a62[_0x76e9('0x20')];var _0x2f95aa=_0xee6c49?0x0:_0x3ab0bd['offset'];var _0x5eb5eb=_0xee6c49?_0x597a62[_0x76e9('0x20')]:_0x3ab0bd[_0x76e9('0x1e')]+_0x3ab0bd[_0x76e9('0x21')];var _0x332008;if(_0x5eb5eb>=_0x5a3001){_0x5eb5eb=_0x5a3001;_0x332008=0xc8;}else{_0x332008=0xce;}_0xf4309[_0x76e9('0x1c')](_0x332008);return _0xf4309['set'](_0x76e9('0x22'),_0x2f95aa+'-'+_0x5eb5eb+'/'+_0x5a3001)['json'](_0x597a62);}return null;};}function patchUpdates(_0x406b26){return function(_0x17ce02){try{jsonpatch['apply'](_0x17ce02,_0x406b26,!![]);}catch(_0x34a221){return BPromise[_0x76e9('0x23')](_0x34a221);}return _0x17ce02[_0x76e9('0x24')]();};}function saveUpdates(_0x276a60,_0x57d1c2){return function(_0x429fdf){if(_0x429fdf){return _0x429fdf[_0x76e9('0x25')](_0x276a60)[_0x76e9('0x26')](function(_0x13211a){return _0x13211a;});}return null;};}function removeEntity(_0x12974b,_0x3a55b9){return function(_0x82572c){if(_0x82572c){return _0x82572c['destroy']()[_0x76e9('0x26')](function(){_0x12974b[_0x76e9('0x1c')](0xcc)[_0x76e9('0x27')]();});}};}function handleEntityNotFound(_0xeac44f,_0x57a25a){return function(_0x5f3905){if(!_0x5f3905){_0xeac44f['sendStatus'](0x194);}return _0x5f3905;};}function handleError(_0x40b268,_0x96e1b2){_0x96e1b2=_0x96e1b2||0x1f4;return function(_0x4aa20b){logger['error'](_0x4aa20b[_0x76e9('0x28')]);if(_0x4aa20b[_0x76e9('0x29')]){delete _0x4aa20b[_0x76e9('0x29')];}_0x40b268[_0x76e9('0x1c')](_0x96e1b2)[_0x76e9('0x2a')](_0x4aa20b);};}exports[_0x76e9('0x2b')]=function(_0x42e489,_0x1604fa){var _0x133986={},_0x151f20={},_0x5c7706={'count':0x0,'rows':[]};var _0x460adc=_[_0x76e9('0x2c')](db[_0x76e9('0x2d')][_0x76e9('0x2e')],function(_0x103bee){return{'name':_0x103bee['fieldName'],'type':_0x103bee[_0x76e9('0x2f')][_0x76e9('0x30')]};});_0x151f20[_0x76e9('0x31')]=_[_0x76e9('0x2c')](_0x460adc,_0x76e9('0x29'));_0x151f20[_0x76e9('0x32')]=_[_0x76e9('0x33')](_0x42e489[_0x76e9('0x32')]);_0x151f20['filters']=_['intersection'](_0x151f20[_0x76e9('0x31')],_0x151f20[_0x76e9('0x32')]);_0x133986['attributes']=_[_0x76e9('0x34')](_0x151f20[_0x76e9('0x31')],qs[_0x76e9('0x35')](_0x42e489['query'][_0x76e9('0x35')]));_0x133986['attributes']=_0x133986[_0x76e9('0x36')]['length']?_0x133986[_0x76e9('0x36')]:_0x151f20[_0x76e9('0x31')];if(!_0x42e489[_0x76e9('0x32')][_0x76e9('0x37')](_0x76e9('0x38'))){_0x133986['limit']=qs[_0x76e9('0x21')](_0x42e489[_0x76e9('0x32')][_0x76e9('0x21')]);_0x133986[_0x76e9('0x1e')]=qs['offset'](_0x42e489[_0x76e9('0x32')][_0x76e9('0x1e')]);}_0x133986['order']=qs[_0x76e9('0x39')](_0x42e489[_0x76e9('0x32')]['sort']);_0x133986[_0x76e9('0x3a')]=qs[_0x76e9('0x3b')](_[_0x76e9('0x3c')](_0x42e489[_0x76e9('0x32')],_0x151f20[_0x76e9('0x3b')]),_0x460adc);if(_0x42e489[_0x76e9('0x32')][_0x76e9('0x3d')]){_0x133986['where']=_[_0x76e9('0x3e')](_0x133986['where'],{'$or':_['map'](_0x460adc,function(_0x57726b){if(_0x57726b[_0x76e9('0x2f')]!==_0x76e9('0x3f')){var _0x44de5e={};_0x44de5e[_0x57726b['name']]={'$like':'%'+_0x42e489['query']['filter']+'%'};return _0x44de5e;}})});}_0x133986=_['merge']({},_0x133986,_0x42e489[_0x76e9('0x40')]);var _0x31f7cc={'where':_0x133986[_0x76e9('0x3a')]};return db[_0x76e9('0x2d')][_0x76e9('0x20')](_0x31f7cc)[_0x76e9('0x26')](function(_0x4aa5ea){_0x5c7706[_0x76e9('0x20')]=_0x4aa5ea;if(_0x42e489[_0x76e9('0x32')][_0x76e9('0x41')]){_0x133986[_0x76e9('0x42')]=[{'all':!![]}];}return db[_0x76e9('0x2d')][_0x76e9('0x43')](_0x133986);})['then'](function(_0x45e455){_0x5c7706['rows']=_0x45e455;return _0x5c7706;})['then'](respondWithFilteredResult(_0x1604fa,_0x133986))['catch'](handleError(_0x1604fa,null));};exports['show']=function(_0x27ad4c,_0xc0f867){var _0x4d9b98={'raw':!![],'where':{'id':_0x27ad4c[_0x76e9('0x44')]['id']}},_0x3198fe={};_0x3198fe[_0x76e9('0x31')]=_['keys'](db[_0x76e9('0x2d')]['rawAttributes']);_0x3198fe[_0x76e9('0x32')]=_[_0x76e9('0x33')](_0x27ad4c['query']);_0x3198fe[_0x76e9('0x3b')]=_[_0x76e9('0x34')](_0x3198fe[_0x76e9('0x31')],_0x3198fe['query']);_0x4d9b98[_0x76e9('0x36')]=_[_0x76e9('0x34')](_0x3198fe[_0x76e9('0x31')],qs[_0x76e9('0x35')](_0x27ad4c[_0x76e9('0x32')]['fields']));_0x4d9b98[_0x76e9('0x36')]=_0x4d9b98[_0x76e9('0x36')][_0x76e9('0x45')]?_0x4d9b98[_0x76e9('0x36')]:_0x3198fe[_0x76e9('0x31')];if(_0x27ad4c[_0x76e9('0x32')][_0x76e9('0x41')]){_0x4d9b98[_0x76e9('0x42')]=[{'all':!![]}];}_0x4d9b98=_['merge']({},_0x4d9b98,_0x27ad4c[_0x76e9('0x40')]);return db[_0x76e9('0x2d')][_0x76e9('0x46')](_0x4d9b98)['then'](handleEntityNotFound(_0xc0f867,null))['then'](respondWithResult(_0xc0f867,null))[_0x76e9('0x47')](handleError(_0xc0f867,null));};exports[_0x76e9('0x48')]=function(_0x14c147,_0x3a38d6){return db[_0x76e9('0x2d')]['create'](_0x14c147['body'],{})[_0x76e9('0x26')](respondWithResult(_0x3a38d6,0xc9))['catch'](handleError(_0x3a38d6,null));};exports[_0x76e9('0x25')]=function(_0x26864,_0x38baec){if(_0x26864['body']['id']){delete _0x26864['body']['id'];}return db['FreshsalesField'][_0x76e9('0x46')]({'where':{'id':_0x26864['params']['id']}})[_0x76e9('0x26')](handleEntityNotFound(_0x38baec,null))[_0x76e9('0x26')](saveUpdates(_0x26864[_0x76e9('0x49')],null))[_0x76e9('0x26')](respondWithResult(_0x38baec,null))[_0x76e9('0x47')](handleError(_0x38baec,null));};exports[_0x76e9('0x4a')]=function(_0x48a47f,_0x443a42){return db[_0x76e9('0x2d')][_0x76e9('0x46')]({'where':{'id':_0x48a47f[_0x76e9('0x44')]['id']}})[_0x76e9('0x26')](handleEntityNotFound(_0x443a42,null))[_0x76e9('0x26')](removeEntity(_0x443a42,null))[_0x76e9('0x47')](handleError(_0x443a42,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 245c337..77ad651 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 _0x1b0e=['rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x235996,_0x370c7f){var _0x200c7f=function(_0x153129){while(--_0x153129){_0x235996['push'](_0x235996['shift']());}};_0x200c7f(++_0x370c7f);}(_0x1b0e,0x132));var _0xe1b0=function(_0x3783ff,_0x392a0e){_0x3783ff=_0x3783ff-0x0;var _0x82c5e2=_0x1b0e[_0x3783ff];return _0x82c5e2;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var logger=require(_0xe1b0('0x2'))(_0xe1b0('0x3'));var moment=require(_0xe1b0('0x4'));var BPromise=require(_0xe1b0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe1b0('0x6'));var config=require(_0xe1b0('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0xe1b0('0x8')]=function(_0x2a049f,_0xfb57ae){return _0x2a049f['define'](_0xe1b0('0x9'),attributes,{'tableName':_0xe1b0('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xe1b0('0xb'),_0xe1b0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a15=['freshsales_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','FreshsalesField','int_freshsales_fields'];(function(_0x464d1b,_0x4d4525){var _0x1b21c0=function(_0x43ab20){while(--_0x43ab20){_0x464d1b['push'](_0x464d1b['shift']());}};_0x1b21c0(++_0x4d4525);}(_0x3a15,0xde));var _0x53a1=function(_0x37e0a8,_0x184bc8){_0x37e0a8=_0x37e0a8-0x0;var _0x5ca63c=_0x3a15[_0x37e0a8];return _0x5ca63c;};'use strict';var _=require(_0x53a1('0x0'));var util=require('util');var logger=require(_0x53a1('0x1'))('api');var moment=require(_0x53a1('0x2'));var BPromise=require(_0x53a1('0x3'));var rp=require(_0x53a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x53a1('0x5'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x5acff4,_0x292b62){return _0x5acff4['define'](_0x53a1('0x6'),attributes,{'tableName':_0x53a1('0x7'),'paranoid':![],'indexes':[{'name':_0x53a1('0x8'),'fields':['idField',_0x53a1('0x9')],'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 a346535..e137495 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 _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xfcf0,0x138));var _0x0fcf=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0xfcf0[_0x28b7ab];return _0x56791b;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x112064,_0x3dcce2){var _0x3bbd98=function(_0x42c41f){while(--_0x42c41f){_0x112064['push'](_0x112064['shift']());}};_0x3bbd98(++_0x3dcce2);}(_0xda19,0xd5));var _0x9da1=function(_0x1a9126,_0xa43be2){_0x1a9126=_0x1a9126-0x0;var _0x3b4253=_0xda19[_0x1a9126];return _0x3b4253;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e82f8a1..2b989b4 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(_0x40b888,_0x5e0ab2){var _0x4e4afb=function(_0x499eb5){while(--_0x499eb5){_0x40b888['push'](_0x40b888['shift']());}};_0x4e4afb(++_0x5e0ab2);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x5559c9,_0xe4c1dd){var _0x4b9f80=function(_0x285083){while(--_0x285083){_0x5559c9['push'](_0x5559c9['shift']());}};_0x4b9f80(++_0xe4c1dd);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 b2bff13..cd33875 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 _0x9f0e=['STRING','newTab','integrationTab','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9f0e,0x116));var _0xe9f0=function(_0x5295cc,_0x5631ed){_0x5295cc=_0x5295cc-0x0;var _0x235eec=_0x9f0e[_0x5295cc];return _0x235eec;};'use strict';var Sequelize=require(_0xe9f0('0x0'));module[_0xe9f0('0x1')]={'name':{'type':Sequelize[_0xe9f0('0x2')]},'description':{'type':Sequelize[_0xe9f0('0x2')]},'username':{'type':Sequelize[_0xe9f0('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xe9f0('0x2')]},'clientId':{'type':Sequelize[_0xe9f0('0x2')]},'clientSecret':{'type':Sequelize[_0xe9f0('0x2')]},'securityToken':{'type':Sequelize[_0xe9f0('0x2')]},'serverUrl':{'type':Sequelize[_0xe9f0('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xe9f0('0x3')),'defaultValue':_0xe9f0('0x4')}}; \ No newline at end of file +var _0x7a2f=['exports','STRING','username','ENUM','newTab','integrationTab','sequelize'];(function(_0x11f8e5,_0x4e3695){var _0x1a1a15=function(_0xd2f67f){while(--_0xd2f67f){_0x11f8e5['push'](_0x11f8e5['shift']());}};_0x1a1a15(++_0x4e3695);}(_0x7a2f,0x99));var _0xf7a2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a2f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf7a2('0x0'));module[_0xf7a2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf7a2('0x2')]},'username':{'type':Sequelize[_0xf7a2('0x2')],'unique':_0xf7a2('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf7a2('0x2')]},'clientId':{'type':Sequelize[_0xf7a2('0x2')]},'clientSecret':{'type':Sequelize[_0xf7a2('0x2')]},'securityToken':{'type':Sequelize[_0xf7a2('0x2')]},'serverUrl':{'type':Sequelize[_0xf7a2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf7a2('0x4')]('integrationTab',_0xf7a2('0x5')),'defaultValue':_0xf7a2('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 3af406d..561da3d 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 _0x7613=['IsReminderSet','IsRecurrence','string','int','boolean','textarea','remove','includes','label','custom','picklistValues','value','true','False','false','test','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','params','keys','catch','create','body','find','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','channel','getDescriptions','SalesforceField','Descriptions','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate'];(function(_0x1c6fdf,_0x28742b){var _0x5b0275=function(_0x1b76e2){while(--_0x1b76e2){_0x1c6fdf['push'](_0x1c6fdf['shift']());}};_0x5b0275(++_0x28742b);}(_0x7613,0x8b));var _0x3761=function(_0xc19f4e,_0x458dfb){_0xc19f4e=_0xc19f4e-0x0;var _0x23c2b9=_0x7613[_0xc19f4e];return _0x23c2b9;};'use strict';var emlformat=require(_0x3761('0x0'));var rimraf=require(_0x3761('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3761('0x2'));var moment=require('moment');var BPromise=require(_0x3761('0x3'));var Mustache=require('mustache');var util=require(_0x3761('0x4'));var path=require('path');var sox=require(_0x3761('0x5'));var csv=require(_0x3761('0x6'));var ejs=require(_0x3761('0x7'));var fs=require('fs');var fs_extra=require(_0x3761('0x8'));var _=require(_0x3761('0x9'));var squel=require(_0x3761('0xa'));var crypto=require(_0x3761('0xb'));var jsforce=require(_0x3761('0xc'));var deskjs=require(_0x3761('0xd'));var toCsv=require(_0x3761('0x6'));var querystring=require(_0x3761('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3761('0xf'));var qs=require(_0x3761('0x10'));var as=require(_0x3761('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3761('0x12'))(_0x3761('0x13'));var utils=require(_0x3761('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3761('0x15'));var db=require(_0x3761('0x16'))['db'];var integrations=require(_0x3761('0x17'));function respondWithStatusCode(_0x1afbaa,_0x41d3a3){_0x41d3a3=_0x41d3a3||0xcc;return function(_0x39e9d1){if(_0x39e9d1){return _0x1afbaa[_0x3761('0x18')](_0x41d3a3);}return _0x1afbaa[_0x3761('0x19')](_0x41d3a3)[_0x3761('0x1a')]();};}function respondWithResult(_0x3f7d3d,_0x50d38e){_0x50d38e=_0x50d38e||0xc8;return function(_0x179603){if(_0x179603){return _0x3f7d3d[_0x3761('0x19')](_0x50d38e)[_0x3761('0x1b')](_0x179603);}};}function respondWithFilteredResult(_0x2bedc7,_0x4f160b){return function(_0x354143){if(_0x354143){var _0x350794=typeof _0x4f160b[_0x3761('0x1c')]===_0x3761('0x1d')&&typeof _0x4f160b[_0x3761('0x1e')]===_0x3761('0x1d');var _0x984002=_0x354143[_0x3761('0x1f')];var _0x495ee2=_0x350794?0x0:_0x4f160b[_0x3761('0x1c')];var _0x3c59ac=_0x350794?_0x354143['count']:_0x4f160b[_0x3761('0x1c')]+_0x4f160b[_0x3761('0x1e')];var _0x163c7b;if(_0x3c59ac>=_0x984002){_0x3c59ac=_0x984002;_0x163c7b=0xc8;}else{_0x163c7b=0xce;}_0x2bedc7[_0x3761('0x19')](_0x163c7b);return _0x2bedc7['set'](_0x3761('0x20'),_0x495ee2+'-'+_0x3c59ac+'/'+_0x984002)['json'](_0x354143);}return null;};}function patchUpdates(_0x2e2d12){return function(_0x2732f4){try{jsonpatch[_0x3761('0x21')](_0x2732f4,_0x2e2d12,!![]);}catch(_0x46a939){return BPromise[_0x3761('0x22')](_0x46a939);}return _0x2732f4[_0x3761('0x23')]();};}function saveUpdates(_0x3d847e,_0x233223){return function(_0x5ead9d){if(_0x5ead9d){return _0x5ead9d[_0x3761('0x24')](_0x3d847e)['then'](function(_0x1a0cd9){return _0x1a0cd9;});}return null;};}function removeEntity(_0x4101f2,_0x1e5d89){return function(_0x3c3e2c){if(_0x3c3e2c){return _0x3c3e2c['destroy']()[_0x3761('0x25')](function(){_0x4101f2['status'](0xcc)[_0x3761('0x1a')]();});}};}function handleEntityNotFound(_0x570ea5,_0x4bb9ee){return function(_0x5ccbad){if(!_0x5ccbad){_0x570ea5[_0x3761('0x18')](0x194);}return _0x5ccbad;};}function handleError(_0x140d22,_0x32bfd4){_0x32bfd4=_0x32bfd4||0x1f4;return function(_0x3c6437){logger[_0x3761('0x26')](_0x3c6437[_0x3761('0x27')]);if(_0x3c6437['name']){delete _0x3c6437[_0x3761('0x28')];}_0x140d22['status'](_0x32bfd4)[_0x3761('0x29')](_0x3c6437);};}exports[_0x3761('0x2a')]=function(_0x38cabd,_0x54405e){var _0x4664c0={},_0x2a3fbb={},_0x74c8eb={'count':0x0,'rows':[]};var _0x411cb3=_[_0x3761('0x2b')](db[_0x3761('0x2c')][_0x3761('0x2d')],function(_0x7a573f){return{'name':_0x7a573f[_0x3761('0x2e')],'type':_0x7a573f[_0x3761('0x2f')][_0x3761('0x30')]};});_0x2a3fbb[_0x3761('0x31')]=_[_0x3761('0x2b')](_0x411cb3,_0x3761('0x28'));_0x2a3fbb[_0x3761('0x32')]=_['keys'](_0x38cabd[_0x3761('0x32')]);_0x2a3fbb[_0x3761('0x33')]=_[_0x3761('0x34')](_0x2a3fbb[_0x3761('0x31')],_0x2a3fbb[_0x3761('0x32')]);_0x4664c0[_0x3761('0x35')]=_[_0x3761('0x34')](_0x2a3fbb[_0x3761('0x31')],qs['fields'](_0x38cabd[_0x3761('0x32')][_0x3761('0x36')]));_0x4664c0['attributes']=_0x4664c0['attributes'][_0x3761('0x37')]?_0x4664c0[_0x3761('0x35')]:_0x2a3fbb[_0x3761('0x31')];if(!_0x38cabd[_0x3761('0x32')][_0x3761('0x38')]('nolimit')){_0x4664c0[_0x3761('0x1e')]=qs[_0x3761('0x1e')](_0x38cabd['query'][_0x3761('0x1e')]);_0x4664c0[_0x3761('0x1c')]=qs[_0x3761('0x1c')](_0x38cabd[_0x3761('0x32')][_0x3761('0x1c')]);}_0x4664c0[_0x3761('0x39')]=qs[_0x3761('0x3a')](_0x38cabd[_0x3761('0x32')][_0x3761('0x3a')]);_0x4664c0[_0x3761('0x3b')]=qs['filters'](_[_0x3761('0x3c')](_0x38cabd[_0x3761('0x32')],_0x2a3fbb['filters']),_0x411cb3);if(_0x38cabd[_0x3761('0x32')][_0x3761('0x3d')]){_0x4664c0[_0x3761('0x3b')]=_['merge'](_0x4664c0['where'],{'$or':_[_0x3761('0x2b')](_0x411cb3,function(_0x3c5309){if(_0x3c5309[_0x3761('0x2f')]!==_0x3761('0x3e')){var _0x594ee7={};_0x594ee7[_0x3c5309[_0x3761('0x28')]]={'$like':'%'+_0x38cabd['query']['filter']+'%'};return _0x594ee7;}})});}_0x4664c0=_[_0x3761('0x3f')]({},_0x4664c0,_0x38cabd[_0x3761('0x40')]);var _0x1dd130={'where':_0x4664c0['where']};return db[_0x3761('0x2c')]['count'](_0x1dd130)[_0x3761('0x25')](function(_0x51ef52){_0x74c8eb[_0x3761('0x1f')]=_0x51ef52;if(_0x38cabd[_0x3761('0x32')][_0x3761('0x41')]){_0x4664c0['include']=[{'all':!![]}];}return db[_0x3761('0x2c')][_0x3761('0x42')](_0x4664c0);})[_0x3761('0x25')](function(_0x46d372){_0x74c8eb[_0x3761('0x43')]=_0x46d372;return _0x74c8eb;})['then'](respondWithFilteredResult(_0x54405e,_0x4664c0))['catch'](handleError(_0x54405e,null));};exports['show']=function(_0x30150b,_0xfa6de1){var _0x530710={'raw':![],'where':{'id':_0x30150b[_0x3761('0x44')]['id']}},_0xc57791={};_0xc57791[_0x3761('0x31')]=_[_0x3761('0x45')](db[_0x3761('0x2c')][_0x3761('0x2d')]);_0xc57791[_0x3761('0x32')]=_[_0x3761('0x45')](_0x30150b[_0x3761('0x32')]);_0xc57791[_0x3761('0x33')]=_[_0x3761('0x34')](_0xc57791['model'],_0xc57791['query']);_0x530710[_0x3761('0x35')]=_[_0x3761('0x34')](_0xc57791[_0x3761('0x31')],qs[_0x3761('0x36')](_0x30150b[_0x3761('0x32')][_0x3761('0x36')]));_0x530710[_0x3761('0x35')]=_0x530710[_0x3761('0x35')][_0x3761('0x37')]?_0x530710['attributes']:_0xc57791[_0x3761('0x31')];if(_0x30150b[_0x3761('0x32')][_0x3761('0x41')]){_0x530710['include']=[{'all':!![]}];}_0x530710=_['merge']({},_0x530710,_0x30150b['options']);return db[_0x3761('0x2c')]['find'](_0x530710)[_0x3761('0x25')](handleEntityNotFound(_0xfa6de1,null))[_0x3761('0x25')](respondWithResult(_0xfa6de1,null))[_0x3761('0x46')](handleError(_0xfa6de1,null));};exports[_0x3761('0x47')]=function(_0x4f5b36,_0x1c2642){return db[_0x3761('0x2c')][_0x3761('0x47')](_0x4f5b36[_0x3761('0x48')],{})[_0x3761('0x25')](respondWithResult(_0x1c2642,0xc9))[_0x3761('0x46')](handleError(_0x1c2642,null));};exports[_0x3761('0x24')]=function(_0x2e0ac8,_0x4b8784){if(_0x2e0ac8[_0x3761('0x48')]['id']){delete _0x2e0ac8[_0x3761('0x48')]['id'];}return db['SalesforceAccount'][_0x3761('0x49')]({'where':{'id':_0x2e0ac8[_0x3761('0x44')]['id']}})[_0x3761('0x25')](handleEntityNotFound(_0x4b8784,null))[_0x3761('0x25')](saveUpdates(_0x2e0ac8[_0x3761('0x48')],null))[_0x3761('0x25')](respondWithResult(_0x4b8784,null))['catch'](handleError(_0x4b8784,null));};exports[_0x3761('0x4a')]=function(_0x561732,_0x26f99c){return db[_0x3761('0x2c')][_0x3761('0x49')]({'where':{'id':_0x561732['params']['id']}})[_0x3761('0x25')](handleEntityNotFound(_0x26f99c,null))[_0x3761('0x25')](removeEntity(_0x26f99c,null))[_0x3761('0x46')](handleError(_0x26f99c,null));};exports[_0x3761('0x4b')]=function(_0x2d980f,_0x2560c8,_0x4d429d){var _0x48cfd0={};var _0x57a7e5={};var _0x9f04a9;var _0x5a0d8d;return db[_0x3761('0x2c')][_0x3761('0x4c')]({'where':{'id':_0x2d980f[_0x3761('0x44')]['id']}})[_0x3761('0x25')](handleEntityNotFound(_0x2560c8,null))['then'](function(_0x44862f){if(_0x44862f){_0x9f04a9=_0x44862f;_0x57a7e5[_0x3761('0x31')]=_['keys'](db[_0x3761('0x4d')]['rawAttributes']);_0x57a7e5[_0x3761('0x32')]=_[_0x3761('0x45')](_0x2d980f[_0x3761('0x32')]);_0x57a7e5[_0x3761('0x33')]=_[_0x3761('0x34')](_0x57a7e5['model'],_0x57a7e5[_0x3761('0x32')]);_0x48cfd0[_0x3761('0x35')]=_[_0x3761('0x34')](_0x57a7e5['model'],qs[_0x3761('0x36')](_0x2d980f['query'][_0x3761('0x36')]));_0x48cfd0[_0x3761('0x35')]=_0x48cfd0[_0x3761('0x35')][_0x3761('0x37')]?_0x48cfd0['attributes']:_0x57a7e5[_0x3761('0x31')];_0x48cfd0[_0x3761('0x39')]=qs[_0x3761('0x3a')](_0x2d980f[_0x3761('0x32')][_0x3761('0x3a')]);_0x48cfd0[_0x3761('0x3b')]=qs[_0x3761('0x33')](_[_0x3761('0x3c')](_0x2d980f['query'],_0x57a7e5[_0x3761('0x33')]));if(_0x2d980f[_0x3761('0x32')]['filter']){_0x48cfd0[_0x3761('0x3b')]=_[_0x3761('0x3f')](_0x48cfd0[_0x3761('0x3b')],{'$or':_[_0x3761('0x2b')](_0x48cfd0['attributes'],function(_0x17cc9c){var _0x1b62ec={};_0x1b62ec[_0x17cc9c]={'$like':'%'+_0x2d980f[_0x3761('0x32')][_0x3761('0x3d')]+'%'};return _0x1b62ec;})});}_0x48cfd0=_[_0x3761('0x3f')]({},_0x48cfd0,_0x2d980f[_0x3761('0x40')]);return _0x9f04a9[_0x3761('0x4b')](_0x48cfd0);}})[_0x3761('0x25')](function(_0x3baa26){if(_0x3baa26){_0x5a0d8d=_0x3baa26[_0x3761('0x37')];if(!_0x2d980f['query'][_0x3761('0x38')]('nolimit')){_0x48cfd0[_0x3761('0x1e')]=qs[_0x3761('0x1e')](_0x2d980f[_0x3761('0x32')][_0x3761('0x1e')]);_0x48cfd0[_0x3761('0x1c')]=qs[_0x3761('0x1c')](_0x2d980f[_0x3761('0x32')][_0x3761('0x1c')]);}return _0x9f04a9['getConfigurations'](_0x48cfd0);}})[_0x3761('0x25')](function(_0x4a554e){if(_0x4a554e){return _0x4a554e?{'count':_0x5a0d8d,'rows':_0x4a554e}:null;}})['then'](respondWithResult(_0x2560c8,null))[_0x3761('0x46')](handleError(_0x2560c8,null));};exports[_0x3761('0x4e')]=function(_0x4c8b9f,_0x38758c,_0x34a29e){if(_0x4c8b9f[_0x3761('0x48')]['id']){delete _0x4c8b9f[_0x3761('0x48')]['id'];}return db[_0x3761('0x2c')][_0x3761('0x4c')]({'where':{'id':_0x4c8b9f['params']['id']}})[_0x3761('0x25')](handleEntityNotFound(_0x38758c,null))['then'](function(_0x3cb5c5){if(_0x3cb5c5){_0x4c8b9f['body'][_0x3761('0x4f')]=_0x3cb5c5['id'];_0x4c8b9f['body'][_0x3761('0x50')]=integrations['getSubjects'](_0x4c8b9f[_0x3761('0x48')][_0x3761('0x51')],_0x4c8b9f[_0x3761('0x48')][_0x3761('0x2f')]);_0x4c8b9f[_0x3761('0x48')]['Descriptions']=integrations[_0x3761('0x52')](_0x4c8b9f['body'][_0x3761('0x51')],_0x4c8b9f[_0x3761('0x48')][_0x3761('0x2f')]);return db[_0x3761('0x4d')]['create'](_0x4c8b9f[_0x3761('0x48')],{'include':[{'model':db['SalesforceField'],'as':_0x3761('0x50')},{'model':db[_0x3761('0x53')],'as':_0x3761('0x54')}]});}return null;})[_0x3761('0x25')](respondWithResult(_0x38758c,null))[_0x3761('0x46')](handleError(_0x38758c,null));};exports['getFields']=function(_0x3ffd15,_0xc617e2,_0x2c9ed6){var _0x1a3351;var _0x51638a='';var _0x3c3949='Task';return db[_0x3761('0x2c')][_0x3761('0x4c')]({'where':{'id':_0x3ffd15['params']['id']},'attributes':['id',_0x3761('0x55'),_0x3761('0x56'),_0x3761('0x57'),_0x3761('0x58'),_0x3761('0x59'),_0x3761('0x5a')]})['then'](handleEntityNotFound(_0xc617e2,null))[_0x3761('0x25')](function(_0x593e1e){if(_0x593e1e){_0x51638a=_0x593e1e['remoteUri'];var _0x5cfe53=_0x51638a[_0x3761('0x5b')](-0x1);if(_0x5cfe53==='/'){_0x51638a=_0x51638a[_0x3761('0x5c')](0x0,_0x51638a[_0x3761('0x5d')](_0x5cfe53));}_0x1a3351=new jsforce[(_0x3761('0x5e'))]({'oauth2':{'loginUrl':_0x51638a,'clientId':_0x593e1e[_0x3761('0x56')],'clientSecret':_0x593e1e[_0x3761('0x57')]}});return _0x1a3351[_0x3761('0x5f')](_0x593e1e[_0x3761('0x58')],_0x593e1e[_0x3761('0x59')][_0x3761('0x60')](_0x593e1e[_0x3761('0x5a')]));}})[_0x3761('0x25')](function(_0x64b33f){if(_0x64b33f){if(!_[_0x3761('0x61')](_0x3ffd15['query'][_0x3761('0x62')])){_0x3c3949=_0x3ffd15[_0x3761('0x32')][_0x3761('0x62')];}return _0x1a3351[_0x3761('0x63')](_0x3c3949)[_0x3761('0x64')]();}})[_0x3761('0x25')](function(_0x9853f1){var _0x31e238=[_0x3761('0x65'),_0x3761('0x66'),_0x3761('0x67'),_0x3761('0x68'),'Subject','Description'];var _0x39504e=[_0x3761('0x69'),_0x3761('0x6a'),'picklist',_0x3761('0x6b'),'email',_0x3761('0x6c'),'phone'];if(_0x9853f1){_[_0x3761('0x6d')](_0x9853f1['fields'],function(_0x55820f){return _0x31e238[_0x3761('0x6e')](_0x55820f[_0x3761('0x28')])||!_0x39504e[_0x3761('0x6e')](_0x55820f['type']);});return{'count':_0x9853f1[_0x3761('0x36')][_0x3761('0x37')],'rows':_[_0x3761('0x2b')](_0x9853f1[_0x3761('0x36')],function(_0x51a13c){return{'id':_0x51a13c['name'],'name':_0x51a13c[_0x3761('0x6f')],'custom':_0x51a13c[_0x3761('0x70')],'options':_0x51a13c[_0x3761('0x71')]['length']>0x0?_[_0x3761('0x2b')](_0x51a13c[_0x3761('0x71')],function(_0x515e9d){return{'name':_0x515e9d['label'],'value':_0x515e9d[_0x3761('0x72')]};}):_0x51a13c['type']==_0x3761('0x6b')?[{'name':'True','value':_0x3761('0x73')},{'name':_0x3761('0x74'),'value':_0x3761('0x75')}]:[]};})};}})[_0x3761('0x25')](respondWithResult(_0xc617e2,null))[_0x3761('0x46')](function(_0x58dc5d){var _0x561cdd=_0x3ffd15[_0x3761('0x32')][_0x3761('0x76')]?0x1f4:_0x58dc5d['statusCode']||0x1f4;logger[_0x3761('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x561cdd,JSON['stringify'](_0x58dc5d));delete _0x58dc5d[_0x3761('0x28')];if(_0x561cdd===0x191){_0x561cdd=0x190;}_0xc617e2[_0x3761('0x19')](_0x561cdd)[_0x3761('0x29')](_0x3ffd15[_0x3761('0x32')][_0x3761('0x76')]?{'message':_0x3761('0x77'),'statusCode':_0x58dc5d[_0x3761('0x78')]}:_0x58dc5d);});}; \ No newline at end of file +var _0x0d1e=['crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','name','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','destroy','getConfigurations','findOne','SalesforceConfiguration','pick','AccountId','getSubjects','channel','getDescriptions','create','SalesforceField','Subjects','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','textarea','phone','remove','includes','label','custom','picklistValues','value','True','False','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5c27b6,_0x4a3c28){var _0x284ce4=function(_0x29fa20){while(--_0x29fa20){_0x5c27b6['push'](_0x5c27b6['shift']());}};_0x284ce4(++_0x4a3c28);}(_0x0d1e,0x72));var _0xe0d1=function(_0x5bcc1c,_0x55e799){_0x5bcc1c=_0x5bcc1c-0x0;var _0x1848b8=_0x0d1e[_0x5bcc1c];return _0x1848b8;};'use strict';var emlformat=require(_0xe0d1('0x0'));var rimraf=require(_0xe0d1('0x1'));var zipdir=require(_0xe0d1('0x2'));var jsonpatch=require(_0xe0d1('0x3'));var rp=require(_0xe0d1('0x4'));var moment=require(_0xe0d1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe0d1('0x6'));var util=require(_0xe0d1('0x7'));var path=require(_0xe0d1('0x8'));var sox=require(_0xe0d1('0x9'));var csv=require(_0xe0d1('0xa'));var ejs=require(_0xe0d1('0xb'));var fs=require('fs');var fs_extra=require(_0xe0d1('0xc'));var _=require(_0xe0d1('0xd'));var squel=require('squel');var crypto=require(_0xe0d1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe0d1('0xa'));var querystring=require(_0xe0d1('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0d1('0x10'));var authService=require(_0xe0d1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0d1('0x12'));var hardwareService=require(_0xe0d1('0x13'));var logger=require(_0xe0d1('0x14'))(_0xe0d1('0x15'));var utils=require(_0xe0d1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0d1('0x17'));var db=require(_0xe0d1('0x18'))['db'];var integrations=require(_0xe0d1('0x19'));function respondWithStatusCode(_0x12196c,_0x4b5962){_0x4b5962=_0x4b5962||0xcc;return function(_0x571838){if(_0x571838){return _0x12196c[_0xe0d1('0x1a')](_0x4b5962);}return _0x12196c[_0xe0d1('0x1b')](_0x4b5962)[_0xe0d1('0x1c')]();};}function respondWithResult(_0x37ff84,_0x5c86fe){_0x5c86fe=_0x5c86fe||0xc8;return function(_0x2e5079){if(_0x2e5079){return _0x37ff84['status'](_0x5c86fe)[_0xe0d1('0x1d')](_0x2e5079);}};}function respondWithFilteredResult(_0x41f3d7,_0x57edf3){return function(_0x43fb12){if(_0x43fb12){var _0x171492=typeof _0x57edf3[_0xe0d1('0x1e')]===_0xe0d1('0x1f')&&typeof _0x57edf3[_0xe0d1('0x20')]===_0xe0d1('0x1f');var _0x261e80=_0x43fb12[_0xe0d1('0x21')];var _0x4adebd=_0x171492?0x0:_0x57edf3[_0xe0d1('0x1e')];var _0x22b0ec=_0x171492?_0x43fb12[_0xe0d1('0x21')]:_0x57edf3[_0xe0d1('0x1e')]+_0x57edf3[_0xe0d1('0x20')];var _0x31808e;if(_0x22b0ec>=_0x261e80){_0x22b0ec=_0x261e80;_0x31808e=0xc8;}else{_0x31808e=0xce;}_0x41f3d7[_0xe0d1('0x1b')](_0x31808e);return _0x41f3d7['set'](_0xe0d1('0x22'),_0x4adebd+'-'+_0x22b0ec+'/'+_0x261e80)['json'](_0x43fb12);}return null;};}function patchUpdates(_0x4d2777){return function(_0x5b6131){try{jsonpatch[_0xe0d1('0x23')](_0x5b6131,_0x4d2777,!![]);}catch(_0x356f13){return BPromise['reject'](_0x356f13);}return _0x5b6131[_0xe0d1('0x24')]();};}function saveUpdates(_0x330c90,_0x4fedcc){return function(_0x31cefa){if(_0x31cefa){return _0x31cefa[_0xe0d1('0x25')](_0x330c90)[_0xe0d1('0x26')](function(_0x2ac5c5){return _0x2ac5c5;});}return null;};}function removeEntity(_0x20b935,_0x2645a1){return function(_0x3317ea){if(_0x3317ea){return _0x3317ea['destroy']()[_0xe0d1('0x26')](function(){_0x20b935[_0xe0d1('0x1b')](0xcc)[_0xe0d1('0x1c')]();});}};}function handleEntityNotFound(_0x19f41a,_0x3772c2){return function(_0x2a760c){if(!_0x2a760c){_0x19f41a[_0xe0d1('0x1a')](0x194);}return _0x2a760c;};}function handleError(_0x20e11b,_0x3577a2){_0x3577a2=_0x3577a2||0x1f4;return function(_0x19230b){logger[_0xe0d1('0x27')](_0x19230b['stack']);if(_0x19230b[_0xe0d1('0x28')]){delete _0x19230b[_0xe0d1('0x28')];}_0x20e11b[_0xe0d1('0x1b')](_0x3577a2)['send'](_0x19230b);};}exports[_0xe0d1('0x29')]=function(_0x27b19f,_0x1a1406){var _0x4b9f26={},_0x54bae0={},_0x44a212={'count':0x0,'rows':[]};var _0x2efd1d=_['map'](db[_0xe0d1('0x2a')][_0xe0d1('0x2b')],function(_0x30e200){return{'name':_0x30e200[_0xe0d1('0x2c')],'type':_0x30e200[_0xe0d1('0x2d')][_0xe0d1('0x2e')]};});_0x54bae0[_0xe0d1('0x2f')]=_[_0xe0d1('0x30')](_0x2efd1d,_0xe0d1('0x28'));_0x54bae0[_0xe0d1('0x31')]=_[_0xe0d1('0x32')](_0x27b19f['query']);_0x54bae0['filters']=_[_0xe0d1('0x33')](_0x54bae0['model'],_0x54bae0[_0xe0d1('0x31')]);_0x4b9f26[_0xe0d1('0x34')]=_[_0xe0d1('0x33')](_0x54bae0[_0xe0d1('0x2f')],qs['fields'](_0x27b19f['query'][_0xe0d1('0x35')]));_0x4b9f26['attributes']=_0x4b9f26[_0xe0d1('0x34')][_0xe0d1('0x36')]?_0x4b9f26[_0xe0d1('0x34')]:_0x54bae0[_0xe0d1('0x2f')];if(!_0x27b19f[_0xe0d1('0x31')][_0xe0d1('0x37')](_0xe0d1('0x38'))){_0x4b9f26[_0xe0d1('0x20')]=qs[_0xe0d1('0x20')](_0x27b19f[_0xe0d1('0x31')][_0xe0d1('0x20')]);_0x4b9f26[_0xe0d1('0x1e')]=qs[_0xe0d1('0x1e')](_0x27b19f[_0xe0d1('0x31')][_0xe0d1('0x1e')]);}_0x4b9f26[_0xe0d1('0x39')]=qs[_0xe0d1('0x3a')](_0x27b19f[_0xe0d1('0x31')][_0xe0d1('0x3a')]);_0x4b9f26[_0xe0d1('0x3b')]=qs[_0xe0d1('0x3c')](_['pick'](_0x27b19f['query'],_0x54bae0[_0xe0d1('0x3c')]),_0x2efd1d);if(_0x27b19f[_0xe0d1('0x31')][_0xe0d1('0x3d')]){_0x4b9f26[_0xe0d1('0x3b')]=_[_0xe0d1('0x3e')](_0x4b9f26[_0xe0d1('0x3b')],{'$or':_['map'](_0x2efd1d,function(_0x322e36){if(_0x322e36[_0xe0d1('0x2d')]!=='VIRTUAL'){var _0x4d5f3d={};_0x4d5f3d[_0x322e36['name']]={'$like':'%'+_0x27b19f[_0xe0d1('0x31')][_0xe0d1('0x3d')]+'%'};return _0x4d5f3d;}})});}_0x4b9f26=_[_0xe0d1('0x3e')]({},_0x4b9f26,_0x27b19f[_0xe0d1('0x3f')]);var _0x409b1b={'where':_0x4b9f26[_0xe0d1('0x3b')]};return db[_0xe0d1('0x2a')][_0xe0d1('0x21')](_0x409b1b)[_0xe0d1('0x26')](function(_0x2f6148){_0x44a212['count']=_0x2f6148;if(_0x27b19f[_0xe0d1('0x31')][_0xe0d1('0x40')]){_0x4b9f26['include']=[{'all':!![]}];}return db[_0xe0d1('0x2a')][_0xe0d1('0x41')](_0x4b9f26);})['then'](function(_0x2ac95f){_0x44a212[_0xe0d1('0x42')]=_0x2ac95f;return _0x44a212;})['then'](respondWithFilteredResult(_0x1a1406,_0x4b9f26))[_0xe0d1('0x43')](handleError(_0x1a1406,null));};exports[_0xe0d1('0x44')]=function(_0xb26565,_0x1a13f4){var _0x1ad40f={'raw':![],'where':{'id':_0xb26565[_0xe0d1('0x45')]['id']}},_0x2ea4f6={};_0x2ea4f6['model']=_['keys'](db[_0xe0d1('0x2a')][_0xe0d1('0x2b')]);_0x2ea4f6[_0xe0d1('0x31')]=_[_0xe0d1('0x32')](_0xb26565[_0xe0d1('0x31')]);_0x2ea4f6['filters']=_[_0xe0d1('0x33')](_0x2ea4f6[_0xe0d1('0x2f')],_0x2ea4f6[_0xe0d1('0x31')]);_0x1ad40f[_0xe0d1('0x34')]=_['intersection'](_0x2ea4f6['model'],qs['fields'](_0xb26565[_0xe0d1('0x31')][_0xe0d1('0x35')]));_0x1ad40f['attributes']=_0x1ad40f['attributes'][_0xe0d1('0x36')]?_0x1ad40f['attributes']:_0x2ea4f6[_0xe0d1('0x2f')];if(_0xb26565['query'][_0xe0d1('0x40')]){_0x1ad40f[_0xe0d1('0x46')]=[{'all':!![]}];}_0x1ad40f=_[_0xe0d1('0x3e')]({},_0x1ad40f,_0xb26565[_0xe0d1('0x3f')]);return db[_0xe0d1('0x2a')][_0xe0d1('0x47')](_0x1ad40f)[_0xe0d1('0x26')](handleEntityNotFound(_0x1a13f4,null))[_0xe0d1('0x26')](respondWithResult(_0x1a13f4,null))[_0xe0d1('0x43')](handleError(_0x1a13f4,null));};exports['create']=function(_0x4131f4,_0x2c018f){return db[_0xe0d1('0x2a')]['create'](_0x4131f4[_0xe0d1('0x48')],{})['then'](respondWithResult(_0x2c018f,0xc9))[_0xe0d1('0x43')](handleError(_0x2c018f,null));};exports[_0xe0d1('0x25')]=function(_0x41b36f,_0x23d83c){if(_0x41b36f[_0xe0d1('0x48')]['id']){delete _0x41b36f[_0xe0d1('0x48')]['id'];}return db[_0xe0d1('0x2a')][_0xe0d1('0x47')]({'where':{'id':_0x41b36f[_0xe0d1('0x45')]['id']}})[_0xe0d1('0x26')](handleEntityNotFound(_0x23d83c,null))[_0xe0d1('0x26')](saveUpdates(_0x41b36f[_0xe0d1('0x48')],null))[_0xe0d1('0x26')](respondWithResult(_0x23d83c,null))[_0xe0d1('0x43')](handleError(_0x23d83c,null));};exports[_0xe0d1('0x49')]=function(_0x5cc833,_0x4cba3c){return db['SalesforceAccount'][_0xe0d1('0x47')]({'where':{'id':_0x5cc833['params']['id']}})[_0xe0d1('0x26')](handleEntityNotFound(_0x4cba3c,null))[_0xe0d1('0x26')](removeEntity(_0x4cba3c,null))[_0xe0d1('0x43')](handleError(_0x4cba3c,null));};exports[_0xe0d1('0x4a')]=function(_0x30ec7f,_0x54ba8a,_0x353cec){var _0x5681ea={};var _0x88e2ed={};var _0x3ad36c;var _0x393bb7;return db['SalesforceAccount'][_0xe0d1('0x4b')]({'where':{'id':_0x30ec7f[_0xe0d1('0x45')]['id']}})[_0xe0d1('0x26')](handleEntityNotFound(_0x54ba8a,null))[_0xe0d1('0x26')](function(_0x372f81){if(_0x372f81){_0x3ad36c=_0x372f81;_0x88e2ed['model']=_[_0xe0d1('0x32')](db[_0xe0d1('0x4c')][_0xe0d1('0x2b')]);_0x88e2ed[_0xe0d1('0x31')]=_['keys'](_0x30ec7f[_0xe0d1('0x31')]);_0x88e2ed[_0xe0d1('0x3c')]=_[_0xe0d1('0x33')](_0x88e2ed[_0xe0d1('0x2f')],_0x88e2ed[_0xe0d1('0x31')]);_0x5681ea['attributes']=_[_0xe0d1('0x33')](_0x88e2ed['model'],qs[_0xe0d1('0x35')](_0x30ec7f[_0xe0d1('0x31')][_0xe0d1('0x35')]));_0x5681ea[_0xe0d1('0x34')]=_0x5681ea[_0xe0d1('0x34')][_0xe0d1('0x36')]?_0x5681ea[_0xe0d1('0x34')]:_0x88e2ed[_0xe0d1('0x2f')];_0x5681ea['order']=qs[_0xe0d1('0x3a')](_0x30ec7f['query'][_0xe0d1('0x3a')]);_0x5681ea[_0xe0d1('0x3b')]=qs[_0xe0d1('0x3c')](_[_0xe0d1('0x4d')](_0x30ec7f['query'],_0x88e2ed[_0xe0d1('0x3c')]));if(_0x30ec7f[_0xe0d1('0x31')][_0xe0d1('0x3d')]){_0x5681ea[_0xe0d1('0x3b')]=_['merge'](_0x5681ea[_0xe0d1('0x3b')],{'$or':_[_0xe0d1('0x30')](_0x5681ea[_0xe0d1('0x34')],function(_0x8c6621){var _0xd80227={};_0xd80227[_0x8c6621]={'$like':'%'+_0x30ec7f['query']['filter']+'%'};return _0xd80227;})});}_0x5681ea=_[_0xe0d1('0x3e')]({},_0x5681ea,_0x30ec7f['options']);return _0x3ad36c[_0xe0d1('0x4a')](_0x5681ea);}})[_0xe0d1('0x26')](function(_0x264011){if(_0x264011){_0x393bb7=_0x264011[_0xe0d1('0x36')];if(!_0x30ec7f[_0xe0d1('0x31')][_0xe0d1('0x37')](_0xe0d1('0x38'))){_0x5681ea[_0xe0d1('0x20')]=qs['limit'](_0x30ec7f[_0xe0d1('0x31')][_0xe0d1('0x20')]);_0x5681ea[_0xe0d1('0x1e')]=qs['offset'](_0x30ec7f[_0xe0d1('0x31')][_0xe0d1('0x1e')]);}return _0x3ad36c[_0xe0d1('0x4a')](_0x5681ea);}})[_0xe0d1('0x26')](function(_0xd7d145){if(_0xd7d145){return _0xd7d145?{'count':_0x393bb7,'rows':_0xd7d145}:null;}})[_0xe0d1('0x26')](respondWithResult(_0x54ba8a,null))[_0xe0d1('0x43')](handleError(_0x54ba8a,null));};exports['addConfiguration']=function(_0x21aef7,_0x9b7cfa,_0x1ec8e4){if(_0x21aef7[_0xe0d1('0x48')]['id']){delete _0x21aef7[_0xe0d1('0x48')]['id'];}return db[_0xe0d1('0x2a')][_0xe0d1('0x4b')]({'where':{'id':_0x21aef7[_0xe0d1('0x45')]['id']}})['then'](handleEntityNotFound(_0x9b7cfa,null))['then'](function(_0x2cacf4){if(_0x2cacf4){_0x21aef7[_0xe0d1('0x48')][_0xe0d1('0x4e')]=_0x2cacf4['id'];_0x21aef7[_0xe0d1('0x48')]['Subjects']=integrations[_0xe0d1('0x4f')](_0x21aef7[_0xe0d1('0x48')][_0xe0d1('0x50')],_0x21aef7['body'][_0xe0d1('0x2d')]);_0x21aef7[_0xe0d1('0x48')]['Descriptions']=integrations[_0xe0d1('0x51')](_0x21aef7[_0xe0d1('0x48')][_0xe0d1('0x50')],_0x21aef7[_0xe0d1('0x48')]['type']);return db['SalesforceConfiguration'][_0xe0d1('0x52')](_0x21aef7[_0xe0d1('0x48')],{'include':[{'model':db[_0xe0d1('0x53')],'as':_0xe0d1('0x54')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x9b7cfa,null))['catch'](handleError(_0x9b7cfa,null));};exports['getFields']=function(_0x3e845d,_0xd5fc0c,_0x3a2bd4){var _0x67503d;var _0x51d182='';var _0x246d86=_0xe0d1('0x55');return db[_0xe0d1('0x2a')][_0xe0d1('0x4b')]({'where':{'id':_0x3e845d[_0xe0d1('0x45')]['id']},'attributes':['id',_0xe0d1('0x56'),_0xe0d1('0x57'),_0xe0d1('0x58'),_0xe0d1('0x59'),_0xe0d1('0x5a'),_0xe0d1('0x5b')]})[_0xe0d1('0x26')](handleEntityNotFound(_0xd5fc0c,null))['then'](function(_0x39ed9e){if(_0x39ed9e){_0x51d182=_0x39ed9e['remoteUri'];var _0x584ac3=_0x51d182[_0xe0d1('0x5c')](-0x1);if(_0x584ac3==='/'){_0x51d182=_0x51d182[_0xe0d1('0x5d')](0x0,_0x51d182[_0xe0d1('0x5e')](_0x584ac3));}_0x67503d=new jsforce[(_0xe0d1('0x5f'))]({'oauth2':{'loginUrl':_0x51d182,'clientId':_0x39ed9e['clientId'],'clientSecret':_0x39ed9e['clientSecret']}});return _0x67503d[_0xe0d1('0x60')](_0x39ed9e[_0xe0d1('0x59')],_0x39ed9e[_0xe0d1('0x5a')][_0xe0d1('0x61')](_0x39ed9e[_0xe0d1('0x5b')]));}})[_0xe0d1('0x26')](function(_0x105cc0){if(_0x105cc0){if(!_[_0xe0d1('0x62')](_0x3e845d[_0xe0d1('0x31')][_0xe0d1('0x63')])){_0x246d86=_0x3e845d[_0xe0d1('0x31')][_0xe0d1('0x63')];}return _0x67503d[_0xe0d1('0x64')](_0x246d86)[_0xe0d1('0x65')]();}})['then'](function(_0x25576d){var _0x809ec9=[_0xe0d1('0x66'),_0xe0d1('0x67'),_0xe0d1('0x68'),_0xe0d1('0x69'),_0xe0d1('0x6a'),_0xe0d1('0x6b')];var _0x2bd2e2=[_0xe0d1('0x6c'),_0xe0d1('0x6d'),_0xe0d1('0x6e'),_0xe0d1('0x6f'),'email',_0xe0d1('0x70'),_0xe0d1('0x71')];if(_0x25576d){_[_0xe0d1('0x72')](_0x25576d[_0xe0d1('0x35')],function(_0x4bdbd5){return _0x809ec9[_0xe0d1('0x73')](_0x4bdbd5['name'])||!_0x2bd2e2[_0xe0d1('0x73')](_0x4bdbd5['type']);});return{'count':_0x25576d['fields'][_0xe0d1('0x36')],'rows':_[_0xe0d1('0x30')](_0x25576d['fields'],function(_0x13e122){return{'id':_0x13e122[_0xe0d1('0x28')],'name':_0x13e122[_0xe0d1('0x74')],'custom':_0x13e122[_0xe0d1('0x75')],'options':_0x13e122[_0xe0d1('0x76')]['length']>0x0?_[_0xe0d1('0x30')](_0x13e122[_0xe0d1('0x76')],function(_0x327a3a){return{'name':_0x327a3a[_0xe0d1('0x74')],'value':_0x327a3a[_0xe0d1('0x77')]};}):_0x13e122[_0xe0d1('0x2d')]==_0xe0d1('0x6f')?[{'name':_0xe0d1('0x78'),'value':'true'},{'name':_0xe0d1('0x79'),'value':'false'}]:[]};})};}})[_0xe0d1('0x26')](respondWithResult(_0xd5fc0c,null))['catch'](function(_0xf34c39){var _0x3b5c60=_0x3e845d[_0xe0d1('0x31')][_0xe0d1('0x7a')]?0x1f4:_0xf34c39['statusCode']||0x1f4;logger[_0xe0d1('0x27')](_0xe0d1('0x7b'),_0xe0d1('0x7c'),_0x3b5c60,JSON[_0xe0d1('0x7d')](_0xf34c39));delete _0xf34c39[_0xe0d1('0x28')];if(_0x3b5c60===0x191){_0x3b5c60=0x190;}_0xd5fc0c[_0xe0d1('0x1b')](_0x3b5c60)[_0xe0d1('0x7e')](_0x3e845d['query'][_0xe0d1('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0xf34c39[_0xe0d1('0x7f')]}:_0xf34c39);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 2bbcc93..2182ea3 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 _0xb67c=['define','int_salesforce_accounts','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0xb67c,0x183));var _0xcb67=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0xb67c[_0x10852d];return _0x13a8d6;};'use strict';var _=require(_0xcb67('0x0'));var util=require('util');var logger=require(_0xcb67('0x1'))('api');var moment=require(_0xcb67('0x2'));var BPromise=require(_0xcb67('0x3'));var rp=require(_0xcb67('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb67('0x5'));var config=require(_0xcb67('0x6'));var attributes=require(_0xcb67('0x7'));var integrations=require(_0xcb67('0x8'));module['exports']=function(_0xb2dff2,_0x158ff7){return _0xb2dff2[_0xcb67('0x9')]('SalesforceAccount',attributes,{'tableName':_0xcb67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53b7=['exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration'];(function(_0x1e6951,_0x4d39ee){var _0x235723=function(_0x41180e){while(--_0x41180e){_0x1e6951['push'](_0x1e6951['shift']());}};_0x235723(++_0x4d39ee);}(_0x53b7,0x170));var _0x753b=function(_0x5c249,_0x46c9d1){_0x5c249=_0x5c249-0x0;var _0x2697db=_0x53b7[_0x5c249];return _0x2697db;};'use strict';var _=require(_0x753b('0x0'));var util=require(_0x753b('0x1'));var logger=require(_0x753b('0x2'))(_0x753b('0x3'));var moment=require(_0x753b('0x4'));var BPromise=require(_0x753b('0x5'));var rp=require(_0x753b('0x6'));var fs=require('fs');var path=require(_0x753b('0x7'));var rimraf=require('rimraf');var config=require(_0x753b('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x753b('0x9'));module[_0x753b('0xa')]=function(_0xc0c0a5,_0x3bb0da){return _0xc0c0a5[_0x753b('0xb')](_0x753b('0xc'),attributes,{'tableName':_0x753b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index fe5582b..c5f061a 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 _0xee4c=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','include','map','model','then','ShowSalesforceAccount','raw'];(function(_0x32874f,_0x2b45c6){var _0x5a89c6=function(_0xce908){while(--_0xce908){_0x32874f['push'](_0x32874f['shift']());}};_0x5a89c6(++_0x2b45c6);}(_0xee4c,0x193));var _0xcee4=function(_0x29e38f,_0x5449a9){_0x29e38f=_0x29e38f-0x0;var _0x42e677=_0xee4c[_0x29e38f];return _0x42e677;};'use strict';var _=require(_0xcee4('0x0'));var util=require(_0xcee4('0x1'));var moment=require(_0xcee4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcee4('0x3'));var db=require(_0xcee4('0x4'))['db'];var utils=require(_0xcee4('0x5'));var logger=require(_0xcee4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcee4('0x7')][_0xcee4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1edd7c,_0x440d24,_0x381db7){return new BPromise(function(_0x5f35ac,_0x42b5ac){return client['request'](_0x1edd7c,_0x381db7)['then'](function(_0x19e5ae){logger[_0xcee4('0x9')](_0xcee4('0xa'),_0x440d24,_0xcee4('0xb'));logger[_0xcee4('0xc')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x440d24,_0xcee4('0xb'),JSON[_0xcee4('0xd')](_0x19e5ae));if(_0x19e5ae['error']){if(_0x19e5ae['error'][_0xcee4('0xe')]===0x1f4){logger[_0xcee4('0xf')](_0xcee4('0xa'),_0x440d24,_0x19e5ae[_0xcee4('0xf')][_0xcee4('0x10')]);return _0x42b5ac(_0x19e5ae['error'][_0xcee4('0x10')]);}logger[_0xcee4('0xf')](_0xcee4('0xa'),_0x440d24,_0x19e5ae[_0xcee4('0xf')][_0xcee4('0x10')]);return _0x5f35ac(_0x19e5ae[_0xcee4('0xf')][_0xcee4('0x10')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x440d24,_0xcee4('0xb'));_0x5f35ac(_0x19e5ae[_0xcee4('0x11')][_0xcee4('0x10')]);}})[_0xcee4('0x12')](function(_0x4fecb2){logger['error'](_0xcee4('0xa'),_0x440d24,_0x4fecb2);_0x42b5ac(_0x4fecb2);});});}exports[_0xcee4('0x13')]=function(_0x4364ff){var _0x4ece7f=this;return new Promise(function(_0x50f4d8,_0x1f4674){return db[_0xcee4('0x14')][_0xcee4('0x15')]({'raw':_0x4364ff[_0xcee4('0x16')]?_0x4364ff[_0xcee4('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4364ff[_0xcee4('0x16')]?_0x4364ff[_0xcee4('0x16')][_0xcee4('0x17')]||null:null,'attributes':_0x4364ff[_0xcee4('0x16')]?_0x4364ff[_0xcee4('0x16')][_0xcee4('0x18')]||null:null,'limit':_0x4364ff[_0xcee4('0x16')]?_0x4364ff[_0xcee4('0x16')]['limit']||null:null,'include':_0x4364ff[_0xcee4('0x16')]?_0x4364ff[_0xcee4('0x16')][_0xcee4('0x19')]?_[_0xcee4('0x1a')](_0x4364ff[_0xcee4('0x16')][_0xcee4('0x19')],function(_0x2047f6){return{'model':db[_0x2047f6['model']],'as':_0x2047f6['as'],'attributes':_0x2047f6[_0xcee4('0x18')],'include':_0x2047f6[_0xcee4('0x19')]?_['map'](_0x2047f6[_0xcee4('0x19')],function(_0x15650e){return{'model':db[_0x15650e[_0xcee4('0x1b')]],'as':_0x15650e['as'],'attributes':_0x15650e['attributes'],'include':_0x15650e['include']?_[_0xcee4('0x1a')](_0x15650e[_0xcee4('0x19')],function(_0x54b554){return{'model':db[_0x54b554[_0xcee4('0x1b')]],'as':_0x54b554['as'],'attributes':_0x54b554[_0xcee4('0x18')]};}):[]};}):[]};}):[]:[]})[_0xcee4('0x1c')](function(_0x259fcd){logger[_0xcee4('0x9')](_0xcee4('0x13'),_0x4364ff);logger[_0xcee4('0xc')](_0xcee4('0x13'),_0x4364ff,JSON[_0xcee4('0xd')](_0x259fcd));_0x50f4d8(_0x259fcd);})['catch'](function(_0x6eb9e0){logger[_0xcee4('0xf')]('GetSalesforceAccount',_0x6eb9e0['message'],_0x4364ff);_0x1f4674(_0x4ece7f[_0xcee4('0xf')](0x1f4,_0x6eb9e0[_0xcee4('0x10')]));});});};exports[_0xcee4('0x1d')]=function(_0x301f9e){var _0x3275b9=this;return new Promise(function(_0x34289c,_0x4988b6){return db[_0xcee4('0x14')]['find']({'raw':_0x301f9e[_0xcee4('0x16')]?_0x301f9e[_0xcee4('0x16')][_0xcee4('0x1e')]===undefined?!![]:![]:!![],'where':_0x301f9e['options']?_0x301f9e['options']['where']||null:null,'attributes':_0x301f9e['options']?_0x301f9e[_0xcee4('0x16')]['attributes']||null:null,'include':_0x301f9e[_0xcee4('0x16')]?_0x301f9e[_0xcee4('0x16')][_0xcee4('0x19')]?_[_0xcee4('0x1a')](_0x301f9e[_0xcee4('0x16')][_0xcee4('0x19')],function(_0x11fb05){return{'model':db[_0x11fb05[_0xcee4('0x1b')]],'as':_0x11fb05['as'],'attributes':_0x11fb05['attributes'],'include':_0x11fb05['include']?_[_0xcee4('0x1a')](_0x11fb05[_0xcee4('0x19')],function(_0xe17021){return{'model':db[_0xe17021['model']],'as':_0xe17021['as'],'attributes':_0xe17021[_0xcee4('0x18')],'include':_0xe17021[_0xcee4('0x19')]?_[_0xcee4('0x1a')](_0xe17021['include'],function(_0x136995){return{'model':db[_0x136995[_0xcee4('0x1b')]],'as':_0x136995['as'],'attributes':_0x136995[_0xcee4('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x484bdc){logger[_0xcee4('0x9')]('ShowSalesforceAccount',_0x301f9e);logger[_0xcee4('0xc')](_0xcee4('0x1d'),_0x301f9e,JSON['stringify'](_0x484bdc));_0x34289c(_0x484bdc);})[_0xcee4('0x12')](function(_0x3a1013){logger['error']('ShowSalesforceAccount',_0x3a1013[_0xcee4('0x10')],_0x301f9e);_0x4988b6(_0x3275b9['error'](0x1f4,_0x3a1013[_0xcee4('0x10')]));});});}; \ No newline at end of file +var _0xd6ef=['then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify','find','ShowSalesforceAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0xd6ef,0x16c));var _0xfd6e=function(_0x2c04e8,_0x315be5){_0x2c04e8=_0x2c04e8-0x0;var _0x64377c=_0xd6ef[_0x2c04e8];return _0x64377c;};'use strict';var _=require(_0xfd6e('0x0'));var util=require(_0xfd6e('0x1'));var moment=require(_0xfd6e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd6e('0x3'));var db=require(_0xfd6e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd6e('0x5'))(_0xfd6e('0x6'));var config=require('../../config/environment');var jayson=require(_0xfd6e('0x7'));var client=jayson[_0xfd6e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13cb3e,_0x40191f,_0x1330b8){return new BPromise(function(_0x496890,_0x412539){return client[_0xfd6e('0x9')](_0x13cb3e,_0x1330b8)[_0xfd6e('0xa')](function(_0x4e777a){logger[_0xfd6e('0xb')](_0xfd6e('0xc'),_0x40191f,_0xfd6e('0xd'));logger[_0xfd6e('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x40191f,_0xfd6e('0xd'),JSON['stringify'](_0x4e777a));if(_0x4e777a[_0xfd6e('0xf')]){if(_0x4e777a['error'][_0xfd6e('0x10')]===0x1f4){logger['error'](_0xfd6e('0xc'),_0x40191f,_0x4e777a['error'][_0xfd6e('0x11')]);return _0x412539(_0x4e777a['error']['message']);}logger[_0xfd6e('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x40191f,_0x4e777a[_0xfd6e('0xf')][_0xfd6e('0x11')]);return _0x496890(_0x4e777a[_0xfd6e('0xf')][_0xfd6e('0x11')]);}else{logger[_0xfd6e('0xb')](_0xfd6e('0xc'),_0x40191f,'request\x20sent');_0x496890(_0x4e777a[_0xfd6e('0x12')]['message']);}})[_0xfd6e('0x13')](function(_0x333fe1){logger['error'](_0xfd6e('0xc'),_0x40191f,_0x333fe1);_0x412539(_0x333fe1);});});}exports[_0xfd6e('0x14')]=function(_0x56ccf5){var _0x49ce8b=this;return new Promise(function(_0x4784f8,_0x51340f){return db[_0xfd6e('0x15')][_0xfd6e('0x16')]({'raw':_0x56ccf5[_0xfd6e('0x17')]?_0x56ccf5[_0xfd6e('0x17')][_0xfd6e('0x18')]===undefined?!![]:![]:!![],'where':_0x56ccf5[_0xfd6e('0x17')]?_0x56ccf5[_0xfd6e('0x17')][_0xfd6e('0x19')]||null:null,'attributes':_0x56ccf5['options']?_0x56ccf5[_0xfd6e('0x17')][_0xfd6e('0x1a')]||null:null,'limit':_0x56ccf5[_0xfd6e('0x17')]?_0x56ccf5[_0xfd6e('0x17')][_0xfd6e('0x1b')]||null:null,'include':_0x56ccf5[_0xfd6e('0x17')]?_0x56ccf5[_0xfd6e('0x17')]['include']?_[_0xfd6e('0x1c')](_0x56ccf5[_0xfd6e('0x17')][_0xfd6e('0x1d')],function(_0x45d812){return{'model':db[_0x45d812[_0xfd6e('0x1e')]],'as':_0x45d812['as'],'attributes':_0x45d812[_0xfd6e('0x1a')],'include':_0x45d812[_0xfd6e('0x1d')]?_[_0xfd6e('0x1c')](_0x45d812[_0xfd6e('0x1d')],function(_0x511a26){return{'model':db[_0x511a26['model']],'as':_0x511a26['as'],'attributes':_0x511a26[_0xfd6e('0x1a')],'include':_0x511a26['include']?_[_0xfd6e('0x1c')](_0x511a26[_0xfd6e('0x1d')],function(_0x26cdf4){return{'model':db[_0x26cdf4[_0xfd6e('0x1e')]],'as':_0x26cdf4['as'],'attributes':_0x26cdf4[_0xfd6e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58f650){logger['info'](_0xfd6e('0x14'),_0x56ccf5);logger[_0xfd6e('0xe')](_0xfd6e('0x14'),_0x56ccf5,JSON[_0xfd6e('0x1f')](_0x58f650));_0x4784f8(_0x58f650);})[_0xfd6e('0x13')](function(_0x1b2c83){logger['error'](_0xfd6e('0x14'),_0x1b2c83[_0xfd6e('0x11')],_0x56ccf5);_0x51340f(_0x49ce8b[_0xfd6e('0xf')](0x1f4,_0x1b2c83[_0xfd6e('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x3a9de5){var _0x41704a=this;return new Promise(function(_0x3b138f,_0x2a6f9d){return db['SalesforceAccount'][_0xfd6e('0x20')]({'raw':_0x3a9de5[_0xfd6e('0x17')]?_0x3a9de5[_0xfd6e('0x17')][_0xfd6e('0x18')]===undefined?!![]:![]:!![],'where':_0x3a9de5[_0xfd6e('0x17')]?_0x3a9de5[_0xfd6e('0x17')][_0xfd6e('0x19')]||null:null,'attributes':_0x3a9de5[_0xfd6e('0x17')]?_0x3a9de5['options'][_0xfd6e('0x1a')]||null:null,'include':_0x3a9de5[_0xfd6e('0x17')]?_0x3a9de5[_0xfd6e('0x17')][_0xfd6e('0x1d')]?_[_0xfd6e('0x1c')](_0x3a9de5[_0xfd6e('0x17')][_0xfd6e('0x1d')],function(_0x1e43d1){return{'model':db[_0x1e43d1[_0xfd6e('0x1e')]],'as':_0x1e43d1['as'],'attributes':_0x1e43d1[_0xfd6e('0x1a')],'include':_0x1e43d1['include']?_[_0xfd6e('0x1c')](_0x1e43d1['include'],function(_0x4612fa){return{'model':db[_0x4612fa[_0xfd6e('0x1e')]],'as':_0x4612fa['as'],'attributes':_0x4612fa[_0xfd6e('0x1a')],'include':_0x4612fa[_0xfd6e('0x1d')]?_[_0xfd6e('0x1c')](_0x4612fa[_0xfd6e('0x1d')],function(_0x4909b0){return{'model':db[_0x4909b0['model']],'as':_0x4909b0['as'],'attributes':_0x4909b0['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd6e('0xa')](function(_0x16139c){logger['info'](_0xfd6e('0x21'),_0x3a9de5);logger[_0xfd6e('0xe')](_0xfd6e('0x21'),_0x3a9de5,JSON[_0xfd6e('0x1f')](_0x16139c));_0x3b138f(_0x16139c);})[_0xfd6e('0x13')](function(_0x5ef344){logger['error'](_0xfd6e('0x21'),_0x5ef344[_0xfd6e('0x11')],_0x3a9de5);_0x2a6f9d(_0x41704a[_0xfd6e('0xf')](0x1f4,_0x5ef344[_0xfd6e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 7d8285b..abf42a3 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 _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(_0x456b6c,_0x199268){var _0x16fb9f=function(_0xf208de){while(--_0xf208de){_0x456b6c['push'](_0x456b6c['shift']());}};_0x16fb9f(++_0x199268);}(_0x2ef3,0xba));var _0x32ef=function(_0x1f6d70,_0x4b0130){_0x1f6d70=_0x1f6d70-0x0;var _0x4880f4=_0x2ef3[_0x1f6d70];return _0x4880f4;};'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 +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xdb28,0x106));var _0x8db2=function(_0x355346,_0x31fb18){_0x355346=_0x355346-0x0;var _0x11bc81=_0xdb28[_0x355346];return _0x11bc81;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 03c14ee..c64e93a 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 _0x10a9=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize'];(function(_0x581a37,_0x4b6c84){var _0x3e14e6=function(_0x517491){while(--_0x517491){_0x581a37['push'](_0x581a37['shift']());}};_0x3e14e6(++_0x4b6c84);}(_0x10a9,0x18b));var _0x910a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x10a9[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x910a('0x0'));module[_0x910a('0x1')]={'name':{'type':Sequelize[_0x910a('0x2')]},'description':{'type':Sequelize[_0x910a('0x2')]},'ticketType':{'type':Sequelize[_0x910a('0x3')](_0x910a('0x4'),_0x910a('0x5')),'defaultValue':_0x910a('0x4')},'moduleSearch':{'type':Sequelize[_0x910a('0x3')](_0x910a('0x6'),_0x910a('0x7'),_0x910a('0x8'),_0x910a('0x9'),_0x910a('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x910a('0xb'),_0x910a('0x7'),_0x910a('0x8'),_0x910a('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x910a('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x910a('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x910a('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x910a('0x2')]}}; \ No newline at end of file +var _0x4d05=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','nothing','account','sequelize','exports'];(function(_0x3e2793,_0x4dbc24){var _0x50cb91=function(_0x3f0bdb){while(--_0x3f0bdb){_0x3e2793['push'](_0x3e2793['shift']());}};_0x50cb91(++_0x4dbc24);}(_0x4d05,0xee));var _0x54d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4d05[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x54d0('0x0'));module[_0x54d0('0x1')]={'name':{'type':Sequelize[_0x54d0('0x2')]},'description':{'type':Sequelize[_0x54d0('0x2')]},'ticketType':{'type':Sequelize[_0x54d0('0x3')](_0x54d0('0x4'),_0x54d0('0x5')),'defaultValue':_0x54d0('0x4')},'moduleSearch':{'type':Sequelize[_0x54d0('0x3')](_0x54d0('0x6'),_0x54d0('0x7'),_0x54d0('0x8'),_0x54d0('0x9'),'account'),'defaultValue':_0x54d0('0x6')},'moduleCreate':{'type':Sequelize[_0x54d0('0x3')](_0x54d0('0xa'),_0x54d0('0x7'),_0x54d0('0x8'),_0x54d0('0xb')),'defaultValue':_0x54d0('0x8')},'leadId':{'type':Sequelize[_0x54d0('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x54d0('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x54d0('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x54d0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 656dd2c..b87b7da 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 _0x6816=['fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','options','find','create','body','params','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../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','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','rawAttributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6816,0x16f));var _0x6681=function(_0x239ce2,_0x4fa777){_0x239ce2=_0x239ce2-0x0;var _0x42b05d=_0x6816[_0x239ce2];return _0x42b05d;};'use strict';var emlformat=require(_0x6681('0x0'));var rimraf=require(_0x6681('0x1'));var zipdir=require(_0x6681('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6681('0x3'));var moment=require('moment');var BPromise=require(_0x6681('0x4'));var Mustache=require(_0x6681('0x5'));var util=require(_0x6681('0x6'));var path=require(_0x6681('0x7'));var sox=require(_0x6681('0x8'));var csv=require(_0x6681('0x9'));var ejs=require(_0x6681('0xa'));var fs=require('fs');var fs_extra=require(_0x6681('0xb'));var _=require(_0x6681('0xc'));var squel=require(_0x6681('0xd'));var crypto=require(_0x6681('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6681('0x9'));var querystring=require(_0x6681('0xf'));var Papa=require(_0x6681('0x10'));var Redis=require(_0x6681('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6681('0x12'));var as=require(_0x6681('0x13'));var hardwareService=require(_0x6681('0x14'));var logger=require(_0x6681('0x15'))('api');var utils=require(_0x6681('0x16'));var config=require(_0x6681('0x17'));var licenseUtil=require(_0x6681('0x18'));var db=require(_0x6681('0x19'))['db'];function respondWithStatusCode(_0x49fccd,_0x13e624){_0x13e624=_0x13e624||0xcc;return function(_0x4cdcf5){if(_0x4cdcf5){return _0x49fccd[_0x6681('0x1a')](_0x13e624);}return _0x49fccd[_0x6681('0x1b')](_0x13e624)[_0x6681('0x1c')]();};}function respondWithResult(_0x2a4d07,_0x25205a){_0x25205a=_0x25205a||0xc8;return function(_0x5c1edc){if(_0x5c1edc){return _0x2a4d07[_0x6681('0x1b')](_0x25205a)[_0x6681('0x1d')](_0x5c1edc);}};}function respondWithFilteredResult(_0x15e1cf,_0x5d4f10){return function(_0x1edcae){if(_0x1edcae){var _0x1e2a01=typeof _0x5d4f10[_0x6681('0x1e')]===_0x6681('0x1f')&&typeof _0x5d4f10[_0x6681('0x20')]===_0x6681('0x1f');var _0x3ef50b=_0x1edcae[_0x6681('0x21')];var _0x5bd4eb=_0x1e2a01?0x0:_0x5d4f10[_0x6681('0x1e')];var _0x164be9=_0x1e2a01?_0x1edcae[_0x6681('0x21')]:_0x5d4f10['offset']+_0x5d4f10[_0x6681('0x20')];var _0x2bfab4;if(_0x164be9>=_0x3ef50b){_0x164be9=_0x3ef50b;_0x2bfab4=0xc8;}else{_0x2bfab4=0xce;}_0x15e1cf[_0x6681('0x1b')](_0x2bfab4);return _0x15e1cf['set'](_0x6681('0x22'),_0x5bd4eb+'-'+_0x164be9+'/'+_0x3ef50b)[_0x6681('0x1d')](_0x1edcae);}return null;};}function patchUpdates(_0x33b0e4){return function(_0x588c7a){try{jsonpatch[_0x6681('0x23')](_0x588c7a,_0x33b0e4,!![]);}catch(_0xebaea8){return BPromise[_0x6681('0x24')](_0xebaea8);}return _0x588c7a[_0x6681('0x25')]();};}function saveUpdates(_0x56ae1c,_0x6641c9){return function(_0x30c00a){if(_0x30c00a){return _0x30c00a[_0x6681('0x26')](_0x56ae1c)[_0x6681('0x27')](function(_0x2e646e){return _0x2e646e;});}return null;};}function removeEntity(_0x495d59,_0xb50d60){return function(_0x35a34f){if(_0x35a34f){return _0x35a34f[_0x6681('0x28')]()[_0x6681('0x27')](function(){_0x495d59[_0x6681('0x1b')](0xcc)[_0x6681('0x1c')]();});}};}function handleEntityNotFound(_0x51ea7a,_0x244272){return function(_0x58bb9d){if(!_0x58bb9d){_0x51ea7a[_0x6681('0x1a')](0x194);}return _0x58bb9d;};}function handleError(_0xf7cfea,_0x18b16f){_0x18b16f=_0x18b16f||0x1f4;return function(_0x4acab0){logger[_0x6681('0x29')](_0x4acab0[_0x6681('0x2a')]);if(_0x4acab0[_0x6681('0x2b')]){delete _0x4acab0[_0x6681('0x2b')];}_0xf7cfea['status'](_0x18b16f)['send'](_0x4acab0);};}exports[_0x6681('0x2c')]=function(_0x55906d,_0x5c4886){var _0x55438c={},_0x5409ac={},_0x2da1df={'count':0x0,'rows':[]};var _0x36289a=_[_0x6681('0x2d')](db[_0x6681('0x2e')][_0x6681('0x2f')],function(_0x258949){return{'name':_0x258949[_0x6681('0x30')],'type':_0x258949[_0x6681('0x31')][_0x6681('0x32')]};});_0x5409ac[_0x6681('0x33')]=_[_0x6681('0x2d')](_0x36289a,_0x6681('0x2b'));_0x5409ac['query']=_[_0x6681('0x34')](_0x55906d['query']);_0x5409ac['filters']=_[_0x6681('0x35')](_0x5409ac[_0x6681('0x33')],_0x5409ac[_0x6681('0x36')]);_0x55438c['attributes']=_[_0x6681('0x35')](_0x5409ac['model'],qs[_0x6681('0x37')](_0x55906d[_0x6681('0x36')][_0x6681('0x37')]));_0x55438c[_0x6681('0x38')]=_0x55438c['attributes'][_0x6681('0x39')]?_0x55438c['attributes']:_0x5409ac[_0x6681('0x33')];if(!_0x55906d[_0x6681('0x36')][_0x6681('0x3a')](_0x6681('0x3b'))){_0x55438c[_0x6681('0x20')]=qs[_0x6681('0x20')](_0x55906d['query']['limit']);_0x55438c[_0x6681('0x1e')]=qs['offset'](_0x55906d['query'][_0x6681('0x1e')]);}_0x55438c[_0x6681('0x3c')]=qs[_0x6681('0x3d')](_0x55906d[_0x6681('0x36')][_0x6681('0x3d')]);_0x55438c['where']=qs['filters'](_[_0x6681('0x3e')](_0x55906d['query'],_0x5409ac[_0x6681('0x3f')]),_0x36289a);if(_0x55906d[_0x6681('0x36')]['filter']){_0x55438c[_0x6681('0x40')]=_[_0x6681('0x41')](_0x55438c['where'],{'$or':_['map'](_0x36289a,function(_0x258ddb){if(_0x258ddb[_0x6681('0x31')]!==_0x6681('0x42')){var _0xc93abc={};_0xc93abc[_0x258ddb[_0x6681('0x2b')]]={'$like':'%'+_0x55906d['query'][_0x6681('0x43')]+'%'};return _0xc93abc;}})});}_0x55438c=_[_0x6681('0x41')]({},_0x55438c,_0x55906d['options']);var _0x55cb5c={'where':_0x55438c[_0x6681('0x40')]};return db[_0x6681('0x2e')][_0x6681('0x21')](_0x55cb5c)[_0x6681('0x27')](function(_0x28ccdd){_0x2da1df[_0x6681('0x21')]=_0x28ccdd;if(_0x55906d[_0x6681('0x36')][_0x6681('0x44')]){_0x55438c[_0x6681('0x45')]=[{'all':!![]}];}return db[_0x6681('0x2e')][_0x6681('0x46')](_0x55438c);})['then'](function(_0xe5ea65){_0x2da1df['rows']=_0xe5ea65;return _0x2da1df;})[_0x6681('0x27')](respondWithFilteredResult(_0x5c4886,_0x55438c))[_0x6681('0x47')](handleError(_0x5c4886,null));};exports[_0x6681('0x48')]=function(_0x47e3ff,_0x3a5c03){var _0x23a7da={'raw':![],'where':{'id':_0x47e3ff['params']['id']}},_0x27c7b4={};_0x27c7b4[_0x6681('0x33')]=_['keys'](db['SalesforceConfiguration'][_0x6681('0x2f')]);_0x27c7b4[_0x6681('0x36')]=_[_0x6681('0x34')](_0x47e3ff[_0x6681('0x36')]);_0x27c7b4[_0x6681('0x3f')]=_['intersection'](_0x27c7b4[_0x6681('0x33')],_0x27c7b4[_0x6681('0x36')]);_0x23a7da[_0x6681('0x38')]=_['intersection'](_0x27c7b4['model'],qs['fields'](_0x47e3ff[_0x6681('0x36')][_0x6681('0x37')]));_0x23a7da[_0x6681('0x38')]=_0x23a7da['attributes'][_0x6681('0x39')]?_0x23a7da['attributes']:_0x27c7b4[_0x6681('0x33')];if(_0x47e3ff[_0x6681('0x36')][_0x6681('0x44')]){_0x23a7da[_0x6681('0x45')]=[{'all':!![]}];}_0x23a7da=_['merge']({},_0x23a7da,_0x47e3ff[_0x6681('0x49')]);return db['SalesforceConfiguration'][_0x6681('0x4a')](_0x23a7da)[_0x6681('0x27')](handleEntityNotFound(_0x3a5c03,null))['then'](respondWithResult(_0x3a5c03,null))[_0x6681('0x47')](handleError(_0x3a5c03,null));};exports['create']=function(_0x277a65,_0x391036){return db['SalesforceConfiguration'][_0x6681('0x4b')](_0x277a65[_0x6681('0x4c')],{})[_0x6681('0x27')](respondWithResult(_0x391036,0xc9))[_0x6681('0x47')](handleError(_0x391036,null));};exports[_0x6681('0x26')]=function(_0x60cf09,_0x5c5d9b){if(_0x60cf09[_0x6681('0x4c')]['id']){delete _0x60cf09[_0x6681('0x4c')]['id'];}return db[_0x6681('0x2e')][_0x6681('0x4a')]({'where':{'id':_0x60cf09[_0x6681('0x4d')]['id']}})[_0x6681('0x27')](handleEntityNotFound(_0x5c5d9b,null))[_0x6681('0x27')](saveUpdates(_0x60cf09[_0x6681('0x4c')],null))[_0x6681('0x27')](respondWithResult(_0x5c5d9b,null))[_0x6681('0x47')](handleError(_0x5c5d9b,null));};exports['destroy']=function(_0x49be65,_0x1b021b){return db[_0x6681('0x2e')][_0x6681('0x4a')]({'where':{'id':_0x49be65['params']['id']}})[_0x6681('0x27')](handleEntityNotFound(_0x1b021b,null))['then'](removeEntity(_0x1b021b,null))[_0x6681('0x47')](handleError(_0x1b021b,null));};exports[_0x6681('0x4e')]=function(_0x518385,_0x493dc0,_0x4f09c6){var _0x2466b6={};var _0x5de45c={};var _0x4f4da2;var _0x2240cd;return db['SalesforceConfiguration'][_0x6681('0x4f')]({'where':{'id':_0x518385[_0x6681('0x4d')]['id']}})[_0x6681('0x27')](handleEntityNotFound(_0x493dc0,null))[_0x6681('0x27')](function(_0x39c917){if(_0x39c917){_0x4f4da2=_0x39c917;_0x5de45c[_0x6681('0x33')]=_['keys'](db[_0x6681('0x50')][_0x6681('0x2f')]);_0x5de45c[_0x6681('0x36')]=_[_0x6681('0x34')](_0x518385[_0x6681('0x36')]);_0x5de45c['filters']=_['intersection'](_0x5de45c['model'],_0x5de45c[_0x6681('0x36')]);_0x2466b6[_0x6681('0x38')]=_[_0x6681('0x35')](_0x5de45c[_0x6681('0x33')],qs[_0x6681('0x37')](_0x518385[_0x6681('0x36')][_0x6681('0x37')]));_0x2466b6[_0x6681('0x38')]=_0x2466b6[_0x6681('0x38')][_0x6681('0x39')]?_0x2466b6[_0x6681('0x38')]:_0x5de45c[_0x6681('0x33')];_0x2466b6[_0x6681('0x3c')]=qs[_0x6681('0x3d')](_0x518385['query'][_0x6681('0x3d')]);_0x2466b6[_0x6681('0x40')]=qs['filters'](_['pick'](_0x518385['query'],_0x5de45c[_0x6681('0x3f')]));if(_0x518385[_0x6681('0x36')][_0x6681('0x43')]){_0x2466b6[_0x6681('0x40')]=_[_0x6681('0x41')](_0x2466b6['where'],{'$or':_['map'](_0x2466b6[_0x6681('0x38')],function(_0x5d2c1d){var _0x19e9e4={};_0x19e9e4[_0x5d2c1d]={'$like':'%'+_0x518385['query'][_0x6681('0x43')]+'%'};return _0x19e9e4;})});}_0x2466b6=_[_0x6681('0x41')]({},_0x2466b6,_0x518385[_0x6681('0x49')]);return _0x4f4da2[_0x6681('0x4e')](_0x2466b6);}})[_0x6681('0x27')](function(_0x36b304){if(_0x36b304){_0x2240cd=_0x36b304[_0x6681('0x39')];if(!_0x518385[_0x6681('0x36')][_0x6681('0x3a')](_0x6681('0x3b'))){_0x2466b6[_0x6681('0x20')]=qs['limit'](_0x518385[_0x6681('0x36')][_0x6681('0x20')]);_0x2466b6['offset']=qs[_0x6681('0x1e')](_0x518385[_0x6681('0x36')]['offset']);}return _0x4f4da2[_0x6681('0x4e')](_0x2466b6);}})[_0x6681('0x27')](function(_0x4054d7){if(_0x4054d7){return _0x4054d7?{'count':_0x2240cd,'rows':_0x4054d7}:null;}})[_0x6681('0x27')](respondWithResult(_0x493dc0,null))['catch'](handleError(_0x493dc0,null));};exports[_0x6681('0x51')]=function(_0x2c945f,_0x31c1cf,_0x5f3aba){var _0x2e9830={};var _0xa68ce5={};var _0xbcc257;var _0x1bf76b;return db[_0x6681('0x2e')]['findOne']({'where':{'id':_0x2c945f['params']['id']}})[_0x6681('0x27')](handleEntityNotFound(_0x31c1cf,null))['then'](function(_0x27d7d7){if(_0x27d7d7){_0xbcc257=_0x27d7d7;_0xa68ce5[_0x6681('0x33')]=_[_0x6681('0x34')](db['SalesforceField']['rawAttributes']);_0xa68ce5[_0x6681('0x36')]=_[_0x6681('0x34')](_0x2c945f[_0x6681('0x36')]);_0xa68ce5['filters']=_[_0x6681('0x35')](_0xa68ce5['model'],_0xa68ce5[_0x6681('0x36')]);_0x2e9830[_0x6681('0x38')]=_[_0x6681('0x35')](_0xa68ce5[_0x6681('0x33')],qs[_0x6681('0x37')](_0x2c945f[_0x6681('0x36')][_0x6681('0x37')]));_0x2e9830[_0x6681('0x38')]=_0x2e9830[_0x6681('0x38')]['length']?_0x2e9830[_0x6681('0x38')]:_0xa68ce5[_0x6681('0x33')];_0x2e9830['order']=qs[_0x6681('0x3d')](_0x2c945f[_0x6681('0x36')][_0x6681('0x3d')]);_0x2e9830[_0x6681('0x40')]=qs[_0x6681('0x3f')](_[_0x6681('0x3e')](_0x2c945f['query'],_0xa68ce5['filters']));if(_0x2c945f[_0x6681('0x36')][_0x6681('0x43')]){_0x2e9830['where']=_['merge'](_0x2e9830[_0x6681('0x40')],{'$or':_[_0x6681('0x2d')](_0x2e9830[_0x6681('0x38')],function(_0x6a3eae){var _0x465b8c={};_0x465b8c[_0x6a3eae]={'$like':'%'+_0x2c945f[_0x6681('0x36')][_0x6681('0x43')]+'%'};return _0x465b8c;})});}_0x2e9830=_[_0x6681('0x41')]({},_0x2e9830,_0x2c945f[_0x6681('0x49')]);return _0xbcc257[_0x6681('0x51')](_0x2e9830);}})['then'](function(_0x467f0a){if(_0x467f0a){_0x1bf76b=_0x467f0a[_0x6681('0x39')];if(!_0x2c945f['query']['hasOwnProperty'](_0x6681('0x3b'))){_0x2e9830[_0x6681('0x20')]=qs[_0x6681('0x20')](_0x2c945f['query']['limit']);_0x2e9830[_0x6681('0x1e')]=qs[_0x6681('0x1e')](_0x2c945f['query'][_0x6681('0x1e')]);}return _0xbcc257[_0x6681('0x51')](_0x2e9830);}})[_0x6681('0x27')](function(_0xdd001){if(_0xdd001){return _0xdd001?{'count':_0x1bf76b,'rows':_0xdd001}:null;}})[_0x6681('0x27')](respondWithResult(_0x31c1cf,null))[_0x6681('0x47')](handleError(_0x31c1cf,null));};exports[_0x6681('0x52')]=function(_0x339040,_0x124167,_0x1a661c){var _0x400446={};var _0x2d5f82={};var _0x5206fb;var _0x1faef1;return db[_0x6681('0x2e')][_0x6681('0x4f')]({'where':{'id':_0x339040['params']['id']}})[_0x6681('0x27')](handleEntityNotFound(_0x124167,null))['then'](function(_0x24bb68){if(_0x24bb68){_0x5206fb=_0x24bb68;_0x2d5f82[_0x6681('0x33')]=_['keys'](db[_0x6681('0x50')][_0x6681('0x2f')]);_0x2d5f82[_0x6681('0x36')]=_[_0x6681('0x34')](_0x339040[_0x6681('0x36')]);_0x2d5f82[_0x6681('0x3f')]=_['intersection'](_0x2d5f82[_0x6681('0x33')],_0x2d5f82['query']);_0x400446[_0x6681('0x38')]=_[_0x6681('0x35')](_0x2d5f82['model'],qs[_0x6681('0x37')](_0x339040['query'][_0x6681('0x37')]));_0x400446['attributes']=_0x400446['attributes'][_0x6681('0x39')]?_0x400446['attributes']:_0x2d5f82[_0x6681('0x33')];_0x400446[_0x6681('0x3c')]=qs[_0x6681('0x3d')](_0x339040['query'][_0x6681('0x3d')]);_0x400446[_0x6681('0x40')]=qs[_0x6681('0x3f')](_[_0x6681('0x3e')](_0x339040[_0x6681('0x36')],_0x2d5f82[_0x6681('0x3f')]));if(_0x339040[_0x6681('0x36')][_0x6681('0x43')]){_0x400446[_0x6681('0x40')]=_[_0x6681('0x41')](_0x400446[_0x6681('0x40')],{'$or':_[_0x6681('0x2d')](_0x400446[_0x6681('0x38')],function(_0x3904f2){var _0x5831fc={};_0x5831fc[_0x3904f2]={'$like':'%'+_0x339040[_0x6681('0x36')]['filter']+'%'};return _0x5831fc;})});}_0x400446=_[_0x6681('0x41')]({},_0x400446,_0x339040[_0x6681('0x49')]);return _0x5206fb[_0x6681('0x52')](_0x400446);}})[_0x6681('0x27')](function(_0x5f2074){if(_0x5f2074){_0x1faef1=_0x5f2074[_0x6681('0x39')];if(!_0x339040['query'][_0x6681('0x3a')]('nolimit')){_0x400446[_0x6681('0x20')]=qs[_0x6681('0x20')](_0x339040['query'][_0x6681('0x20')]);_0x400446[_0x6681('0x1e')]=qs[_0x6681('0x1e')](_0x339040['query'][_0x6681('0x1e')]);}return _0x5206fb[_0x6681('0x52')](_0x400446);}})['then'](function(_0x438a1c){if(_0x438a1c){return _0x438a1c?{'count':_0x1faef1,'rows':_0x438a1c}:null;}})[_0x6681('0x27')](respondWithResult(_0x124167,null))[_0x6681('0x47')](handleError(_0x124167,null));}; \ No newline at end of file +var _0xd63e=['Content-Range','apply','save','update','then','destroy','stack','name','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','SalesforceConfiguration','findAll','catch','params','includeAll','find','create','body','getFields','findOne','SalesforceField','length','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set'];(function(_0x35a11d,_0x5e73ae){var _0x116959=function(_0x2899f9){while(--_0x2899f9){_0x35a11d['push'](_0x35a11d['shift']());}};_0x116959(++_0x5e73ae);}(_0xd63e,0x1b8));var _0xed63=function(_0x11818b,_0x2a849e){_0x11818b=_0x11818b-0x0;var _0x17bbeb=_0xd63e[_0x11818b];return _0x17bbeb;};'use strict';var emlformat=require(_0xed63('0x0'));var rimraf=require(_0xed63('0x1'));var zipdir=require(_0xed63('0x2'));var jsonpatch=require(_0xed63('0x3'));var rp=require('request-promise');var moment=require(_0xed63('0x4'));var BPromise=require(_0xed63('0x5'));var Mustache=require(_0xed63('0x6'));var util=require('util');var path=require(_0xed63('0x7'));var sox=require(_0xed63('0x8'));var csv=require(_0xed63('0x9'));var ejs=require(_0xed63('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed63('0xb'));var squel=require(_0xed63('0xc'));var crypto=require(_0xed63('0xd'));var jsforce=require(_0xed63('0xe'));var deskjs=require(_0xed63('0xf'));var toCsv=require(_0xed63('0x9'));var querystring=require(_0xed63('0x10'));var Papa=require(_0xed63('0x11'));var Redis=require(_0xed63('0x12'));var authService=require(_0xed63('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xed63('0x14'));var hardwareService=require(_0xed63('0x15'));var logger=require('../../config/logger')(_0xed63('0x16'));var utils=require(_0xed63('0x17'));var config=require(_0xed63('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xed63('0x19'))['db'];function respondWithStatusCode(_0x5506bb,_0x478a0a){_0x478a0a=_0x478a0a||0xcc;return function(_0x12be40){if(_0x12be40){return _0x5506bb[_0xed63('0x1a')](_0x478a0a);}return _0x5506bb[_0xed63('0x1b')](_0x478a0a)[_0xed63('0x1c')]();};}function respondWithResult(_0x258342,_0x2d9133){_0x2d9133=_0x2d9133||0xc8;return function(_0x57711b){if(_0x57711b){return _0x258342[_0xed63('0x1b')](_0x2d9133)[_0xed63('0x1d')](_0x57711b);}};}function respondWithFilteredResult(_0x164cb5,_0x1d3af7){return function(_0x27f851){if(_0x27f851){var _0x441f3a=typeof _0x1d3af7[_0xed63('0x1e')]===_0xed63('0x1f')&&typeof _0x1d3af7[_0xed63('0x20')]===_0xed63('0x1f');var _0x4ddf74=_0x27f851['count'];var _0x28e3b7=_0x441f3a?0x0:_0x1d3af7[_0xed63('0x1e')];var _0x731ec=_0x441f3a?_0x27f851['count']:_0x1d3af7[_0xed63('0x1e')]+_0x1d3af7[_0xed63('0x20')];var _0x2fef36;if(_0x731ec>=_0x4ddf74){_0x731ec=_0x4ddf74;_0x2fef36=0xc8;}else{_0x2fef36=0xce;}_0x164cb5[_0xed63('0x1b')](_0x2fef36);return _0x164cb5[_0xed63('0x21')](_0xed63('0x22'),_0x28e3b7+'-'+_0x731ec+'/'+_0x4ddf74)[_0xed63('0x1d')](_0x27f851);}return null;};}function patchUpdates(_0x3de2f7){return function(_0x3582b0){try{jsonpatch[_0xed63('0x23')](_0x3582b0,_0x3de2f7,!![]);}catch(_0xb26d25){return BPromise['reject'](_0xb26d25);}return _0x3582b0[_0xed63('0x24')]();};}function saveUpdates(_0x280bb5,_0x85cae4){return function(_0x27b668){if(_0x27b668){return _0x27b668[_0xed63('0x25')](_0x280bb5)[_0xed63('0x26')](function(_0x1e4a69){return _0x1e4a69;});}return null;};}function removeEntity(_0x3b6188,_0x47d174){return function(_0xa6100f){if(_0xa6100f){return _0xa6100f[_0xed63('0x27')]()[_0xed63('0x26')](function(){_0x3b6188[_0xed63('0x1b')](0xcc)[_0xed63('0x1c')]();});}};}function handleEntityNotFound(_0x3a4437,_0x1f7c0c){return function(_0x3487ac){if(!_0x3487ac){_0x3a4437[_0xed63('0x1a')](0x194);}return _0x3487ac;};}function handleError(_0x52465f,_0x6df243){_0x6df243=_0x6df243||0x1f4;return function(_0x4aba6e){logger['error'](_0x4aba6e[_0xed63('0x28')]);if(_0x4aba6e[_0xed63('0x29')]){delete _0x4aba6e[_0xed63('0x29')];}_0x52465f[_0xed63('0x1b')](_0x6df243)['send'](_0x4aba6e);};}exports[_0xed63('0x2a')]=function(_0x4e6d9e,_0x5232d2){var _0x1ee0f8={},_0x4e82dc={},_0x59157a={'count':0x0,'rows':[]};var _0x1df446=_[_0xed63('0x2b')](db['SalesforceConfiguration'][_0xed63('0x2c')],function(_0x36b8c3){return{'name':_0x36b8c3['fieldName'],'type':_0x36b8c3[_0xed63('0x2d')][_0xed63('0x2e')]};});_0x4e82dc['model']=_[_0xed63('0x2b')](_0x1df446,_0xed63('0x29'));_0x4e82dc[_0xed63('0x2f')]=_[_0xed63('0x30')](_0x4e6d9e['query']);_0x4e82dc['filters']=_[_0xed63('0x31')](_0x4e82dc[_0xed63('0x32')],_0x4e82dc[_0xed63('0x2f')]);_0x1ee0f8[_0xed63('0x33')]=_[_0xed63('0x31')](_0x4e82dc[_0xed63('0x32')],qs[_0xed63('0x34')](_0x4e6d9e['query'][_0xed63('0x34')]));_0x1ee0f8[_0xed63('0x33')]=_0x1ee0f8[_0xed63('0x33')]['length']?_0x1ee0f8[_0xed63('0x33')]:_0x4e82dc['model'];if(!_0x4e6d9e[_0xed63('0x2f')][_0xed63('0x35')](_0xed63('0x36'))){_0x1ee0f8[_0xed63('0x20')]=qs['limit'](_0x4e6d9e['query'][_0xed63('0x20')]);_0x1ee0f8[_0xed63('0x1e')]=qs[_0xed63('0x1e')](_0x4e6d9e[_0xed63('0x2f')][_0xed63('0x1e')]);}_0x1ee0f8[_0xed63('0x37')]=qs[_0xed63('0x38')](_0x4e6d9e['query'][_0xed63('0x38')]);_0x1ee0f8[_0xed63('0x39')]=qs[_0xed63('0x3a')](_[_0xed63('0x3b')](_0x4e6d9e[_0xed63('0x2f')],_0x4e82dc[_0xed63('0x3a')]),_0x1df446);if(_0x4e6d9e[_0xed63('0x2f')]['filter']){_0x1ee0f8['where']=_[_0xed63('0x3c')](_0x1ee0f8[_0xed63('0x39')],{'$or':_[_0xed63('0x2b')](_0x1df446,function(_0x552386){if(_0x552386[_0xed63('0x2d')]!==_0xed63('0x3d')){var _0x137fb1={};_0x137fb1[_0x552386[_0xed63('0x29')]]={'$like':'%'+_0x4e6d9e[_0xed63('0x2f')][_0xed63('0x3e')]+'%'};return _0x137fb1;}})});}_0x1ee0f8=_[_0xed63('0x3c')]({},_0x1ee0f8,_0x4e6d9e[_0xed63('0x3f')]);var _0x4dbb75={'where':_0x1ee0f8[_0xed63('0x39')]};return db['SalesforceConfiguration']['count'](_0x4dbb75)[_0xed63('0x26')](function(_0x5a6d8e){_0x59157a['count']=_0x5a6d8e;if(_0x4e6d9e[_0xed63('0x2f')]['includeAll']){_0x1ee0f8[_0xed63('0x40')]=[{'all':!![]}];}return db[_0xed63('0x41')][_0xed63('0x42')](_0x1ee0f8);})[_0xed63('0x26')](function(_0x175ab6){_0x59157a['rows']=_0x175ab6;return _0x59157a;})[_0xed63('0x26')](respondWithFilteredResult(_0x5232d2,_0x1ee0f8))[_0xed63('0x43')](handleError(_0x5232d2,null));};exports['show']=function(_0x5a35db,_0x2ce5c5){var _0x4b5da7={'raw':![],'where':{'id':_0x5a35db[_0xed63('0x44')]['id']}},_0x1fa10b={};_0x1fa10b['model']=_['keys'](db[_0xed63('0x41')][_0xed63('0x2c')]);_0x1fa10b[_0xed63('0x2f')]=_[_0xed63('0x30')](_0x5a35db[_0xed63('0x2f')]);_0x1fa10b[_0xed63('0x3a')]=_[_0xed63('0x31')](_0x1fa10b[_0xed63('0x32')],_0x1fa10b[_0xed63('0x2f')]);_0x4b5da7[_0xed63('0x33')]=_['intersection'](_0x1fa10b[_0xed63('0x32')],qs['fields'](_0x5a35db[_0xed63('0x2f')][_0xed63('0x34')]));_0x4b5da7[_0xed63('0x33')]=_0x4b5da7[_0xed63('0x33')]['length']?_0x4b5da7[_0xed63('0x33')]:_0x1fa10b[_0xed63('0x32')];if(_0x5a35db[_0xed63('0x2f')][_0xed63('0x45')]){_0x4b5da7[_0xed63('0x40')]=[{'all':!![]}];}_0x4b5da7=_[_0xed63('0x3c')]({},_0x4b5da7,_0x5a35db[_0xed63('0x3f')]);return db['SalesforceConfiguration'][_0xed63('0x46')](_0x4b5da7)[_0xed63('0x26')](handleEntityNotFound(_0x2ce5c5,null))[_0xed63('0x26')](respondWithResult(_0x2ce5c5,null))['catch'](handleError(_0x2ce5c5,null));};exports[_0xed63('0x47')]=function(_0x51f13a,_0x150051){return db[_0xed63('0x41')][_0xed63('0x47')](_0x51f13a[_0xed63('0x48')],{})[_0xed63('0x26')](respondWithResult(_0x150051,0xc9))[_0xed63('0x43')](handleError(_0x150051,null));};exports[_0xed63('0x25')]=function(_0x2e8a22,_0x4aab18){if(_0x2e8a22[_0xed63('0x48')]['id']){delete _0x2e8a22[_0xed63('0x48')]['id'];}return db['SalesforceConfiguration'][_0xed63('0x46')]({'where':{'id':_0x2e8a22[_0xed63('0x44')]['id']}})[_0xed63('0x26')](handleEntityNotFound(_0x4aab18,null))[_0xed63('0x26')](saveUpdates(_0x2e8a22[_0xed63('0x48')],null))[_0xed63('0x26')](respondWithResult(_0x4aab18,null))[_0xed63('0x43')](handleError(_0x4aab18,null));};exports[_0xed63('0x27')]=function(_0x58009b,_0x30ad04){return db['SalesforceConfiguration']['find']({'where':{'id':_0x58009b[_0xed63('0x44')]['id']}})['then'](handleEntityNotFound(_0x30ad04,null))[_0xed63('0x26')](removeEntity(_0x30ad04,null))[_0xed63('0x43')](handleError(_0x30ad04,null));};exports[_0xed63('0x49')]=function(_0x535467,_0x8d118b,_0x31f043){var _0x8ab4e5={};var _0x5b7abd={};var _0x1db85d;var _0x46defb;return db[_0xed63('0x41')][_0xed63('0x4a')]({'where':{'id':_0x535467[_0xed63('0x44')]['id']}})[_0xed63('0x26')](handleEntityNotFound(_0x8d118b,null))[_0xed63('0x26')](function(_0xd6d1de){if(_0xd6d1de){_0x1db85d=_0xd6d1de;_0x5b7abd[_0xed63('0x32')]=_[_0xed63('0x30')](db[_0xed63('0x4b')][_0xed63('0x2c')]);_0x5b7abd[_0xed63('0x2f')]=_['keys'](_0x535467[_0xed63('0x2f')]);_0x5b7abd['filters']=_[_0xed63('0x31')](_0x5b7abd[_0xed63('0x32')],_0x5b7abd[_0xed63('0x2f')]);_0x8ab4e5[_0xed63('0x33')]=_[_0xed63('0x31')](_0x5b7abd[_0xed63('0x32')],qs[_0xed63('0x34')](_0x535467['query'][_0xed63('0x34')]));_0x8ab4e5['attributes']=_0x8ab4e5[_0xed63('0x33')][_0xed63('0x4c')]?_0x8ab4e5['attributes']:_0x5b7abd[_0xed63('0x32')];_0x8ab4e5[_0xed63('0x37')]=qs['sort'](_0x535467['query'][_0xed63('0x38')]);_0x8ab4e5['where']=qs[_0xed63('0x3a')](_['pick'](_0x535467[_0xed63('0x2f')],_0x5b7abd['filters']));if(_0x535467[_0xed63('0x2f')][_0xed63('0x3e')]){_0x8ab4e5[_0xed63('0x39')]=_['merge'](_0x8ab4e5[_0xed63('0x39')],{'$or':_[_0xed63('0x2b')](_0x8ab4e5[_0xed63('0x33')],function(_0x10c00d){var _0x240344={};_0x240344[_0x10c00d]={'$like':'%'+_0x535467[_0xed63('0x2f')][_0xed63('0x3e')]+'%'};return _0x240344;})});}_0x8ab4e5=_[_0xed63('0x3c')]({},_0x8ab4e5,_0x535467[_0xed63('0x3f')]);return _0x1db85d[_0xed63('0x49')](_0x8ab4e5);}})[_0xed63('0x26')](function(_0x5a85b6){if(_0x5a85b6){_0x46defb=_0x5a85b6['length'];if(!_0x535467[_0xed63('0x2f')][_0xed63('0x35')](_0xed63('0x36'))){_0x8ab4e5['limit']=qs[_0xed63('0x20')](_0x535467[_0xed63('0x2f')][_0xed63('0x20')]);_0x8ab4e5[_0xed63('0x1e')]=qs[_0xed63('0x1e')](_0x535467[_0xed63('0x2f')][_0xed63('0x1e')]);}return _0x1db85d['getFields'](_0x8ab4e5);}})[_0xed63('0x26')](function(_0x4663a3){if(_0x4663a3){return _0x4663a3?{'count':_0x46defb,'rows':_0x4663a3}:null;}})[_0xed63('0x26')](respondWithResult(_0x8d118b,null))[_0xed63('0x43')](handleError(_0x8d118b,null));};exports[_0xed63('0x4d')]=function(_0x18a57b,_0x4ad9e4,_0x446dba){var _0x4cee49={};var _0x5e19bd={};var _0x5f1ad2;var _0x2f1d8a;return db[_0xed63('0x41')][_0xed63('0x4a')]({'where':{'id':_0x18a57b[_0xed63('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ad9e4,null))[_0xed63('0x26')](function(_0xcd269){if(_0xcd269){_0x5f1ad2=_0xcd269;_0x5e19bd['model']=_[_0xed63('0x30')](db['SalesforceField'][_0xed63('0x2c')]);_0x5e19bd[_0xed63('0x2f')]=_[_0xed63('0x30')](_0x18a57b[_0xed63('0x2f')]);_0x5e19bd[_0xed63('0x3a')]=_[_0xed63('0x31')](_0x5e19bd[_0xed63('0x32')],_0x5e19bd[_0xed63('0x2f')]);_0x4cee49['attributes']=_[_0xed63('0x31')](_0x5e19bd['model'],qs[_0xed63('0x34')](_0x18a57b[_0xed63('0x2f')][_0xed63('0x34')]));_0x4cee49['attributes']=_0x4cee49[_0xed63('0x33')]['length']?_0x4cee49['attributes']:_0x5e19bd[_0xed63('0x32')];_0x4cee49['order']=qs[_0xed63('0x38')](_0x18a57b[_0xed63('0x2f')][_0xed63('0x38')]);_0x4cee49[_0xed63('0x39')]=qs[_0xed63('0x3a')](_[_0xed63('0x3b')](_0x18a57b[_0xed63('0x2f')],_0x5e19bd[_0xed63('0x3a')]));if(_0x18a57b[_0xed63('0x2f')][_0xed63('0x3e')]){_0x4cee49['where']=_[_0xed63('0x3c')](_0x4cee49[_0xed63('0x39')],{'$or':_[_0xed63('0x2b')](_0x4cee49[_0xed63('0x33')],function(_0xc0755a){var _0x573642={};_0x573642[_0xc0755a]={'$like':'%'+_0x18a57b[_0xed63('0x2f')][_0xed63('0x3e')]+'%'};return _0x573642;})});}_0x4cee49=_[_0xed63('0x3c')]({},_0x4cee49,_0x18a57b[_0xed63('0x3f')]);return _0x5f1ad2[_0xed63('0x4d')](_0x4cee49);}})[_0xed63('0x26')](function(_0x1d5711){if(_0x1d5711){_0x2f1d8a=_0x1d5711[_0xed63('0x4c')];if(!_0x18a57b['query'][_0xed63('0x35')]('nolimit')){_0x4cee49['limit']=qs[_0xed63('0x20')](_0x18a57b[_0xed63('0x2f')]['limit']);_0x4cee49[_0xed63('0x1e')]=qs[_0xed63('0x1e')](_0x18a57b['query']['offset']);}return _0x5f1ad2[_0xed63('0x4d')](_0x4cee49);}})[_0xed63('0x26')](function(_0x2d97b1){if(_0x2d97b1){return _0x2d97b1?{'count':_0x2f1d8a,'rows':_0x2d97b1}:null;}})[_0xed63('0x26')](respondWithResult(_0x4ad9e4,null))[_0xed63('0x43')](handleError(_0x4ad9e4,null));};exports[_0xed63('0x4e')]=function(_0x781c41,_0xc2d0c3,_0x3f651f){var _0x19a602={};var _0x2fac5f={};var _0x490a81;var _0x1cea7c;return db[_0xed63('0x41')][_0xed63('0x4a')]({'where':{'id':_0x781c41['params']['id']}})[_0xed63('0x26')](handleEntityNotFound(_0xc2d0c3,null))['then'](function(_0x2f1786){if(_0x2f1786){_0x490a81=_0x2f1786;_0x2fac5f[_0xed63('0x32')]=_[_0xed63('0x30')](db[_0xed63('0x4b')][_0xed63('0x2c')]);_0x2fac5f[_0xed63('0x2f')]=_[_0xed63('0x30')](_0x781c41[_0xed63('0x2f')]);_0x2fac5f['filters']=_[_0xed63('0x31')](_0x2fac5f[_0xed63('0x32')],_0x2fac5f[_0xed63('0x2f')]);_0x19a602[_0xed63('0x33')]=_[_0xed63('0x31')](_0x2fac5f[_0xed63('0x32')],qs[_0xed63('0x34')](_0x781c41[_0xed63('0x2f')][_0xed63('0x34')]));_0x19a602['attributes']=_0x19a602[_0xed63('0x33')][_0xed63('0x4c')]?_0x19a602[_0xed63('0x33')]:_0x2fac5f['model'];_0x19a602[_0xed63('0x37')]=qs[_0xed63('0x38')](_0x781c41[_0xed63('0x2f')][_0xed63('0x38')]);_0x19a602[_0xed63('0x39')]=qs[_0xed63('0x3a')](_[_0xed63('0x3b')](_0x781c41[_0xed63('0x2f')],_0x2fac5f['filters']));if(_0x781c41['query']['filter']){_0x19a602[_0xed63('0x39')]=_['merge'](_0x19a602[_0xed63('0x39')],{'$or':_[_0xed63('0x2b')](_0x19a602[_0xed63('0x33')],function(_0x4d3850){var _0x53bbf0={};_0x53bbf0[_0x4d3850]={'$like':'%'+_0x781c41[_0xed63('0x2f')][_0xed63('0x3e')]+'%'};return _0x53bbf0;})});}_0x19a602=_[_0xed63('0x3c')]({},_0x19a602,_0x781c41[_0xed63('0x3f')]);return _0x490a81[_0xed63('0x4e')](_0x19a602);}})[_0xed63('0x26')](function(_0x2298f4){if(_0x2298f4){_0x1cea7c=_0x2298f4[_0xed63('0x4c')];if(!_0x781c41[_0xed63('0x2f')][_0xed63('0x35')](_0xed63('0x36'))){_0x19a602[_0xed63('0x20')]=qs[_0xed63('0x20')](_0x781c41[_0xed63('0x2f')][_0xed63('0x20')]);_0x19a602[_0xed63('0x1e')]=qs['offset'](_0x781c41[_0xed63('0x2f')][_0xed63('0x1e')]);}return _0x490a81[_0xed63('0x4e')](_0x19a602);}})[_0xed63('0x26')](function(_0x142c6d){if(_0x142c6d){return _0x142c6d?{'count':_0x1cea7c,'rows':_0x142c6d}:null;}})[_0xed63('0x26')](respondWithResult(_0xc2d0c3,null))[_0xed63('0x43')](handleError(_0xc2d0c3,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 8de6d48..dedb13e 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 _0xb208=['define','SalesforceConfiguration','lodash','../../config/logger','api','bluebird','path','./intSalesforceConfiguration.attributes','exports'];(function(_0x24b2a7,_0x18a290){var _0x158221=function(_0x371063){while(--_0x371063){_0x24b2a7['push'](_0x24b2a7['shift']());}};_0x158221(++_0x18a290);}(_0xb208,0xd1));var _0x8b20=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb208[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x8b20('0x0'));var util=require('util');var logger=require(_0x8b20('0x1'))(_0x8b20('0x2'));var moment=require('moment');var BPromise=require(_0x8b20('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b20('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8b20('0x5'));module[_0x8b20('0x6')]=function(_0x145530,_0x6668f){return _0x145530[_0x8b20('0x7')](_0x8b20('0x8'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x195b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x195b,0xa8));var _0xb195=function(_0x1a1f13,_0x221432){_0x1a1f13=_0x1a1f13-0x0;var _0x27edda=_0x195b[_0x1a1f13];return _0x27edda;};'use strict';var _=require(_0xb195('0x0'));var util=require('util');var logger=require(_0xb195('0x1'))(_0xb195('0x2'));var moment=require(_0xb195('0x3'));var BPromise=require(_0xb195('0x4'));var rp=require(_0xb195('0x5'));var fs=require('fs');var path=require(_0xb195('0x6'));var rimraf=require(_0xb195('0x7'));var config=require(_0xb195('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xb195('0x9')]=function(_0x5f5930,_0x570598){return _0x5f5930[_0xb195('0xa')](_0xb195('0xb'),attributes,{'tableName':_0xb195('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 6d51103..02d4567 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 _0x1c56=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x39a5ab,_0x44f3e1){var _0x41c839=function(_0x2c3d8f){while(--_0x2c3d8f){_0x39a5ab['push'](_0x39a5ab['shift']());}};_0x41c839(++_0x44f3e1);}(_0x1c56,0x10e));var _0x61c5=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x1c56[_0x44216d];return _0xeca523;};'use strict';var _=require(_0x61c5('0x0'));var util=require(_0x61c5('0x1'));var moment=require(_0x61c5('0x2'));var BPromise=require(_0x61c5('0x3'));var rs=require(_0x61c5('0x4'));var fs=require('fs');var Redis=require(_0x61c5('0x5'));var db=require(_0x61c5('0x6'))['db'];var utils=require(_0x61c5('0x7'));var logger=require(_0x61c5('0x8'))(_0x61c5('0x9'));var config=require(_0x61c5('0xa'));var jayson=require(_0x61c5('0xb'));var client=jayson['client'][_0x61c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x195ef4,_0xda8b92,_0x1c492d){return new BPromise(function(_0xd0cc9a,_0x1588e4){return client[_0x61c5('0xd')](_0x195ef4,_0x1c492d)[_0x61c5('0xe')](function(_0x3d9f65){logger['info'](_0x61c5('0xf'),_0xda8b92,_0x61c5('0x10'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xda8b92,'request\x20sent',JSON[_0x61c5('0x11')](_0x3d9f65));if(_0x3d9f65[_0x61c5('0x12')]){if(_0x3d9f65[_0x61c5('0x12')][_0x61c5('0x13')]===0x1f4){logger[_0x61c5('0x12')](_0x61c5('0xf'),_0xda8b92,_0x3d9f65['error'][_0x61c5('0x14')]);return _0x1588e4(_0x3d9f65[_0x61c5('0x12')][_0x61c5('0x14')]);}logger[_0x61c5('0x12')](_0x61c5('0xf'),_0xda8b92,_0x3d9f65[_0x61c5('0x12')][_0x61c5('0x14')]);return _0xd0cc9a(_0x3d9f65['error'][_0x61c5('0x14')]);}else{logger[_0x61c5('0x15')](_0x61c5('0xf'),_0xda8b92,'request\x20sent');_0xd0cc9a(_0x3d9f65[_0x61c5('0x16')]['message']);}})[_0x61c5('0x17')](function(_0x54c600){logger[_0x61c5('0x12')](_0x61c5('0xf'),_0xda8b92,_0x54c600);_0x1588e4(_0x54c600);});});} \ No newline at end of file +var _0xb00f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb00f,0x15f));var _0xfb00=function(_0x3709de,_0x57ff8c){_0x3709de=_0x3709de-0x0;var _0x169053=_0xb00f[_0x3709de];return _0x169053;};'use strict';var _=require(_0xfb00('0x0'));var util=require(_0xfb00('0x1'));var moment=require('moment');var BPromise=require(_0xfb00('0x2'));var rs=require(_0xfb00('0x3'));var fs=require('fs');var Redis=require(_0xfb00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb00('0x5'));var logger=require(_0xfb00('0x6'))(_0xfb00('0x7'));var config=require(_0xfb00('0x8'));var jayson=require(_0xfb00('0x9'));var client=jayson[_0xfb00('0xa')][_0xfb00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fc0ad,_0x40f22d,_0x9dd3d8){return new BPromise(function(_0xf9c3c2,_0x3f661d){return client[_0xfb00('0xc')](_0x3fc0ad,_0x9dd3d8)['then'](function(_0x16b342){logger[_0xfb00('0xd')](_0xfb00('0xe'),_0x40f22d,_0xfb00('0xf'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x40f22d,_0xfb00('0xf'),JSON[_0xfb00('0x10')](_0x16b342));if(_0x16b342[_0xfb00('0x11')]){if(_0x16b342[_0xfb00('0x11')]['code']===0x1f4){logger[_0xfb00('0x11')](_0xfb00('0xe'),_0x40f22d,_0x16b342[_0xfb00('0x11')]['message']);return _0x3f661d(_0x16b342['error']['message']);}logger[_0xfb00('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x40f22d,_0x16b342[_0xfb00('0x11')]['message']);return _0xf9c3c2(_0x16b342[_0xfb00('0x11')]['message']);}else{logger[_0xfb00('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x40f22d,_0xfb00('0xf'));_0xf9c3c2(_0x16b342[_0xfb00('0x12')][_0xfb00('0x13')]);}})[_0xfb00('0x14')](function(_0x2e38db){logger['error'](_0xfb00('0xe'),_0x40f22d,_0x2e38db);_0x3f661d(_0x2e38db);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 2da46b0..cd281f6 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 _0x8de6=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','show','create','put','/:id','update','delete','destroy'];(function(_0x480a14,_0x2f123b){var _0x4c3a25=function(_0xc2507){while(--_0xc2507){_0x480a14['push'](_0x480a14['shift']());}};_0x4c3a25(++_0x2f123b);}(_0x8de6,0x157));var _0x68de=function(_0x43d48e,_0xf3dbc3){_0x43d48e=_0x43d48e-0x0;var _0x2b69f2=_0x8de6[_0x43d48e];return _0x2b69f2;};'use strict';var multer=require(_0x68de('0x0'));var util=require(_0x68de('0x1'));var path=require(_0x68de('0x2'));var timeout=require(_0x68de('0x3'));var express=require(_0x68de('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x68de('0x5'));var config=require(_0x68de('0x6'));var controller=require(_0x68de('0x7'));router[_0x68de('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68de('0x8')]('/:id',auth[_0x68de('0x9')](),controller[_0x68de('0xa')]);router['post']('/',auth[_0x68de('0x9')](),controller[_0x68de('0xb')]);router[_0x68de('0xc')](_0x68de('0xd'),auth[_0x68de('0x9')](),controller[_0x68de('0xe')]);router[_0x68de('0xf')](_0x68de('0xd'),auth[_0x68de('0x9')](),controller[_0x68de('0x10')]);module[_0x68de('0x11')]=router; \ No newline at end of file +var _0x92e3=['put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x487ee4,_0x3d3e66){var _0x3b0877=function(_0x5fba36){while(--_0x5fba36){_0x487ee4['push'](_0x487ee4['shift']());}};_0x3b0877(++_0x3d3e66);}(_0x92e3,0x1f0));var _0x392e=function(_0x3fca95,_0xcfbc4f){_0x3fca95=_0x3fca95-0x0;var _0x3564a4=_0x92e3[_0x3fca95];return _0x3564a4;};'use strict';var multer=require('multer');var util=require(_0x392e('0x0'));var path=require(_0x392e('0x1'));var timeout=require(_0x392e('0x2'));var express=require(_0x392e('0x3'));var router=express['Router']();var fs_extra=require(_0x392e('0x4'));var auth=require(_0x392e('0x5'));var interaction=require(_0x392e('0x6'));var config=require(_0x392e('0x7'));var controller=require(_0x392e('0x8'));router['get']('/',auth[_0x392e('0x9')](),controller[_0x392e('0xa')]);router[_0x392e('0xb')](_0x392e('0xc'),auth[_0x392e('0x9')](),controller[_0x392e('0xd')]);router['post']('/',auth[_0x392e('0x9')](),controller['create']);router[_0x392e('0xe')](_0x392e('0xc'),auth[_0x392e('0x9')](),controller['update']);router[_0x392e('0xf')](_0x392e('0xc'),auth[_0x392e('0x9')](),controller[_0x392e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index faa0d84..0e5a41e 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 _0xc287=['exports','ENUM','string','customVariable','picklist','STRING','variable','sequelize'];(function(_0x45b374,_0x20dccb){var _0x24fc74=function(_0x357eaf){while(--_0x357eaf){_0x45b374['push'](_0x45b374['shift']());}};_0x24fc74(++_0x20dccb);}(_0xc287,0x1b7));var _0x7c28=function(_0x3452eb,_0x44035e){_0x3452eb=_0x3452eb-0x0;var _0x4244fd=_0xc287[_0x3452eb];return _0x4244fd;};'use strict';var Sequelize=require(_0x7c28('0x0'));module[_0x7c28('0x1')]={'type':{'type':Sequelize[_0x7c28('0x2')](_0x7c28('0x3'),'variable',_0x7c28('0x4'),'keyValue',_0x7c28('0x5')),'defaultValue':_0x7c28('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7c28('0x6')]},'keyType':{'type':Sequelize[_0x7c28('0x2')](_0x7c28('0x3'),_0x7c28('0x7'),_0x7c28('0x4'))},'keyContent':{'type':Sequelize[_0x7c28('0x6')]},'idField':{'type':Sequelize[_0x7c28('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1a6d=['ENUM','STRING','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1a6d,0x12b));var _0xd1a6=function(_0x4e4d7d,_0x29cb3d){_0x4e4d7d=_0x4e4d7d-0x0;var _0x33a0d4=_0x1a6d[_0x4e4d7d];return _0x33a0d4;};'use strict';var Sequelize=require(_0xd1a6('0x0'));module[_0xd1a6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd1a6('0x2'),_0xd1a6('0x3'),_0xd1a6('0x4'),_0xd1a6('0x5'),_0xd1a6('0x6')),'defaultValue':_0xd1a6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd1a6('0x7')](_0xd1a6('0x2'),'variable',_0xd1a6('0x4'))},'keyContent':{'type':Sequelize[_0xd1a6('0x8')]},'idField':{'type':Sequelize[_0xd1a6('0x8')]},'variableName':{'type':Sequelize[_0xd1a6('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 43efdd9..a621091 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 _0xc4d1=['order','where','pick','filters','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','find','create','body','rimraf','zip-dir','request-promise','bluebird','mustache','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x5ab92d,_0xc00878){var _0x2754cf=function(_0x87cfd4){while(--_0x87cfd4){_0x5ab92d['push'](_0x5ab92d['shift']());}};_0x2754cf(++_0xc00878);}(_0xc4d1,0x12c));var _0x1c4d=function(_0x1726e1,_0x1cc1f4){_0x1726e1=_0x1726e1-0x0;var _0x44eccc=_0xc4d1[_0x1726e1];return _0x44eccc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c4d('0x0'));var zipdir=require(_0x1c4d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c4d('0x2'));var moment=require('moment');var BPromise=require(_0x1c4d('0x3'));var Mustache=require(_0x1c4d('0x4'));var util=require('util');var path=require(_0x1c4d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c4d('0x6'));var _=require('lodash');var squel=require(_0x1c4d('0x7'));var crypto=require(_0x1c4d('0x8'));var jsforce=require(_0x1c4d('0x9'));var deskjs=require(_0x1c4d('0xa'));var toCsv=require(_0x1c4d('0xb'));var querystring=require(_0x1c4d('0xc'));var Papa=require(_0x1c4d('0xd'));var Redis=require(_0x1c4d('0xe'));var authService=require(_0x1c4d('0xf'));var qs=require(_0x1c4d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c4d('0x11'))(_0x1c4d('0x12'));var utils=require(_0x1c4d('0x13'));var config=require(_0x1c4d('0x14'));var licenseUtil=require(_0x1c4d('0x15'));var db=require(_0x1c4d('0x16'))['db'];function respondWithStatusCode(_0x224fbe,_0x40af9f){_0x40af9f=_0x40af9f||0xcc;return function(_0x58fa53){if(_0x58fa53){return _0x224fbe[_0x1c4d('0x17')](_0x40af9f);}return _0x224fbe[_0x1c4d('0x18')](_0x40af9f)[_0x1c4d('0x19')]();};}function respondWithResult(_0x2a9bea,_0x1826f6){_0x1826f6=_0x1826f6||0xc8;return function(_0x264767){if(_0x264767){return _0x2a9bea[_0x1c4d('0x18')](_0x1826f6)[_0x1c4d('0x1a')](_0x264767);}};}function respondWithFilteredResult(_0x2c946f,_0x3356f9){return function(_0x529e5e){if(_0x529e5e){var _0x502e38=typeof _0x3356f9['offset']===_0x1c4d('0x1b')&&typeof _0x3356f9[_0x1c4d('0x1c')]===_0x1c4d('0x1b');var _0x738188=_0x529e5e[_0x1c4d('0x1d')];var _0x55099f=_0x502e38?0x0:_0x3356f9['offset'];var _0x306be4=_0x502e38?_0x529e5e[_0x1c4d('0x1d')]:_0x3356f9[_0x1c4d('0x1e')]+_0x3356f9[_0x1c4d('0x1c')];var _0x33ced3;if(_0x306be4>=_0x738188){_0x306be4=_0x738188;_0x33ced3=0xc8;}else{_0x33ced3=0xce;}_0x2c946f[_0x1c4d('0x18')](_0x33ced3);return _0x2c946f[_0x1c4d('0x1f')]('Content-Range',_0x55099f+'-'+_0x306be4+'/'+_0x738188)[_0x1c4d('0x1a')](_0x529e5e);}return null;};}function patchUpdates(_0x4f2e72){return function(_0x1d79f1){try{jsonpatch['apply'](_0x1d79f1,_0x4f2e72,!![]);}catch(_0x1848bc){return BPromise[_0x1c4d('0x20')](_0x1848bc);}return _0x1d79f1[_0x1c4d('0x21')]();};}function saveUpdates(_0x5105d0,_0x4322a4){return function(_0x1e5f95){if(_0x1e5f95){return _0x1e5f95[_0x1c4d('0x22')](_0x5105d0)['then'](function(_0x21fb45){return _0x21fb45;});}return null;};}function removeEntity(_0x342dc7,_0x8375c8){return function(_0x1dba0b){if(_0x1dba0b){return _0x1dba0b[_0x1c4d('0x23')]()[_0x1c4d('0x24')](function(){_0x342dc7[_0x1c4d('0x18')](0xcc)[_0x1c4d('0x19')]();});}};}function handleEntityNotFound(_0x5e8d07,_0x5502c3){return function(_0x49bf0b){if(!_0x49bf0b){_0x5e8d07[_0x1c4d('0x17')](0x194);}return _0x49bf0b;};}function handleError(_0x2070a0,_0x13c59d){_0x13c59d=_0x13c59d||0x1f4;return function(_0x22b0bd){logger[_0x1c4d('0x25')](_0x22b0bd[_0x1c4d('0x26')]);if(_0x22b0bd[_0x1c4d('0x27')]){delete _0x22b0bd[_0x1c4d('0x27')];}_0x2070a0[_0x1c4d('0x18')](_0x13c59d)[_0x1c4d('0x28')](_0x22b0bd);};}exports[_0x1c4d('0x29')]=function(_0x429c32,_0x1e9b03){var _0x56a7bd={},_0x16557f={},_0x5a8b76={'count':0x0,'rows':[]};var _0x2353f9=_[_0x1c4d('0x2a')](db[_0x1c4d('0x2b')][_0x1c4d('0x2c')],function(_0x4dfcd0){return{'name':_0x4dfcd0['fieldName'],'type':_0x4dfcd0[_0x1c4d('0x2d')]['key']};});_0x16557f[_0x1c4d('0x2e')]=_[_0x1c4d('0x2a')](_0x2353f9,_0x1c4d('0x27'));_0x16557f[_0x1c4d('0x2f')]=_[_0x1c4d('0x30')](_0x429c32[_0x1c4d('0x2f')]);_0x16557f['filters']=_['intersection'](_0x16557f[_0x1c4d('0x2e')],_0x16557f[_0x1c4d('0x2f')]);_0x56a7bd[_0x1c4d('0x31')]=_[_0x1c4d('0x32')](_0x16557f[_0x1c4d('0x2e')],qs[_0x1c4d('0x33')](_0x429c32['query'][_0x1c4d('0x33')]));_0x56a7bd[_0x1c4d('0x31')]=_0x56a7bd[_0x1c4d('0x31')][_0x1c4d('0x34')]?_0x56a7bd[_0x1c4d('0x31')]:_0x16557f[_0x1c4d('0x2e')];if(!_0x429c32['query'][_0x1c4d('0x35')](_0x1c4d('0x36'))){_0x56a7bd[_0x1c4d('0x1c')]=qs[_0x1c4d('0x1c')](_0x429c32['query']['limit']);_0x56a7bd[_0x1c4d('0x1e')]=qs[_0x1c4d('0x1e')](_0x429c32['query']['offset']);}_0x56a7bd[_0x1c4d('0x37')]=qs['sort'](_0x429c32['query']['sort']);_0x56a7bd[_0x1c4d('0x38')]=qs['filters'](_[_0x1c4d('0x39')](_0x429c32[_0x1c4d('0x2f')],_0x16557f[_0x1c4d('0x3a')]),_0x2353f9);if(_0x429c32[_0x1c4d('0x2f')]['filter']){_0x56a7bd['where']=_[_0x1c4d('0x3b')](_0x56a7bd[_0x1c4d('0x38')],{'$or':_[_0x1c4d('0x2a')](_0x2353f9,function(_0x42d448){if(_0x42d448['type']!==_0x1c4d('0x3c')){var _0x314e1d={};_0x314e1d[_0x42d448['name']]={'$like':'%'+_0x429c32['query'][_0x1c4d('0x3d')]+'%'};return _0x314e1d;}})});}_0x56a7bd=_[_0x1c4d('0x3b')]({},_0x56a7bd,_0x429c32[_0x1c4d('0x3e')]);var _0x1e43df={'where':_0x56a7bd[_0x1c4d('0x38')]};return db[_0x1c4d('0x2b')][_0x1c4d('0x1d')](_0x1e43df)[_0x1c4d('0x24')](function(_0x1096f4){_0x5a8b76[_0x1c4d('0x1d')]=_0x1096f4;if(_0x429c32[_0x1c4d('0x2f')]['includeAll']){_0x56a7bd[_0x1c4d('0x3f')]=[{'all':!![]}];}return db[_0x1c4d('0x2b')][_0x1c4d('0x40')](_0x56a7bd);})[_0x1c4d('0x24')](function(_0x41e522){_0x5a8b76['rows']=_0x41e522;return _0x5a8b76;})[_0x1c4d('0x24')](respondWithFilteredResult(_0x1e9b03,_0x56a7bd))[_0x1c4d('0x41')](handleError(_0x1e9b03,null));};exports[_0x1c4d('0x42')]=function(_0x2988f1,_0x2f1ad0){var _0x5f0dfb={'raw':!![],'where':{'id':_0x2988f1[_0x1c4d('0x43')]['id']}},_0x4a39fb={};_0x4a39fb[_0x1c4d('0x2e')]=_['keys'](db['SalesforceField'][_0x1c4d('0x2c')]);_0x4a39fb[_0x1c4d('0x2f')]=_[_0x1c4d('0x30')](_0x2988f1['query']);_0x4a39fb[_0x1c4d('0x3a')]=_[_0x1c4d('0x32')](_0x4a39fb[_0x1c4d('0x2e')],_0x4a39fb[_0x1c4d('0x2f')]);_0x5f0dfb['attributes']=_[_0x1c4d('0x32')](_0x4a39fb[_0x1c4d('0x2e')],qs[_0x1c4d('0x33')](_0x2988f1['query']['fields']));_0x5f0dfb[_0x1c4d('0x31')]=_0x5f0dfb[_0x1c4d('0x31')]['length']?_0x5f0dfb['attributes']:_0x4a39fb[_0x1c4d('0x2e')];if(_0x2988f1[_0x1c4d('0x2f')]['includeAll']){_0x5f0dfb['include']=[{'all':!![]}];}_0x5f0dfb=_[_0x1c4d('0x3b')]({},_0x5f0dfb,_0x2988f1['options']);return db[_0x1c4d('0x2b')][_0x1c4d('0x44')](_0x5f0dfb)[_0x1c4d('0x24')](handleEntityNotFound(_0x2f1ad0,null))[_0x1c4d('0x24')](respondWithResult(_0x2f1ad0,null))[_0x1c4d('0x41')](handleError(_0x2f1ad0,null));};exports[_0x1c4d('0x45')]=function(_0x2fa07c,_0x3127bf){return db['SalesforceField'][_0x1c4d('0x45')](_0x2fa07c['body'],{})[_0x1c4d('0x24')](respondWithResult(_0x3127bf,0xc9))[_0x1c4d('0x41')](handleError(_0x3127bf,null));};exports[_0x1c4d('0x22')]=function(_0x16618b,_0x937ef7){if(_0x16618b[_0x1c4d('0x46')]['id']){delete _0x16618b[_0x1c4d('0x46')]['id'];}return db['SalesforceField'][_0x1c4d('0x44')]({'where':{'id':_0x16618b['params']['id']}})['then'](handleEntityNotFound(_0x937ef7,null))[_0x1c4d('0x24')](saveUpdates(_0x16618b[_0x1c4d('0x46')],null))[_0x1c4d('0x24')](respondWithResult(_0x937ef7,null))[_0x1c4d('0x41')](handleError(_0x937ef7,null));};exports[_0x1c4d('0x23')]=function(_0x32e883,_0x9ea1f5){return db[_0x1c4d('0x2b')][_0x1c4d('0x44')]({'where':{'id':_0x32e883[_0x1c4d('0x43')]['id']}})[_0x1c4d('0x24')](handleEntityNotFound(_0x9ea1f5,null))['then'](removeEntity(_0x9ea1f5,null))[_0x1c4d('0x41')](handleError(_0x9ea1f5,null));}; \ No newline at end of file +var _0xab3f=['sort','where','pick','filter','merge','options','SalesforceField','count','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x4fff14,_0x4d3472){var _0x5afd09=function(_0x27029f){while(--_0x27029f){_0x4fff14['push'](_0x4fff14['shift']());}};_0x5afd09(++_0x4d3472);}(_0xab3f,0xf1));var _0xfab3=function(_0x4da0d5,_0x321a2f){_0x4da0d5=_0x4da0d5-0x0;var _0x462021=_0xab3f[_0x4da0d5];return _0x462021;};'use strict';var emlformat=require(_0xfab3('0x0'));var rimraf=require(_0xfab3('0x1'));var zipdir=require(_0xfab3('0x2'));var jsonpatch=require(_0xfab3('0x3'));var rp=require(_0xfab3('0x4'));var moment=require(_0xfab3('0x5'));var BPromise=require(_0xfab3('0x6'));var Mustache=require(_0xfab3('0x7'));var util=require(_0xfab3('0x8'));var path=require(_0xfab3('0x9'));var sox=require(_0xfab3('0xa'));var csv=require(_0xfab3('0xb'));var ejs=require(_0xfab3('0xc'));var fs=require('fs');var fs_extra=require(_0xfab3('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfab3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfab3('0xf'));var toCsv=require(_0xfab3('0xb'));var querystring=require('querystring');var Papa=require(_0xfab3('0x10'));var Redis=require(_0xfab3('0x11'));var authService=require(_0xfab3('0x12'));var qs=require(_0xfab3('0x13'));var as=require(_0xfab3('0x14'));var hardwareService=require(_0xfab3('0x15'));var logger=require(_0xfab3('0x16'))(_0xfab3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfab3('0x18'))['db'];function respondWithStatusCode(_0x78e2ab,_0x4e56db){_0x4e56db=_0x4e56db||0xcc;return function(_0x32097b){if(_0x32097b){return _0x78e2ab[_0xfab3('0x19')](_0x4e56db);}return _0x78e2ab[_0xfab3('0x1a')](_0x4e56db)['end']();};}function respondWithResult(_0x465061,_0x32ca66){_0x32ca66=_0x32ca66||0xc8;return function(_0x2849f2){if(_0x2849f2){return _0x465061[_0xfab3('0x1a')](_0x32ca66)[_0xfab3('0x1b')](_0x2849f2);}};}function respondWithFilteredResult(_0x5c2402,_0x3a4f25){return function(_0x58f0a5){if(_0x58f0a5){var _0x2fdad6=typeof _0x3a4f25['offset']==='undefined'&&typeof _0x3a4f25[_0xfab3('0x1c')]===_0xfab3('0x1d');var _0x2598f8=_0x58f0a5['count'];var _0x49b5f0=_0x2fdad6?0x0:_0x3a4f25[_0xfab3('0x1e')];var _0xe80603=_0x2fdad6?_0x58f0a5['count']:_0x3a4f25[_0xfab3('0x1e')]+_0x3a4f25[_0xfab3('0x1c')];var _0x253517;if(_0xe80603>=_0x2598f8){_0xe80603=_0x2598f8;_0x253517=0xc8;}else{_0x253517=0xce;}_0x5c2402[_0xfab3('0x1a')](_0x253517);return _0x5c2402[_0xfab3('0x1f')](_0xfab3('0x20'),_0x49b5f0+'-'+_0xe80603+'/'+_0x2598f8)[_0xfab3('0x1b')](_0x58f0a5);}return null;};}function patchUpdates(_0x483df8){return function(_0x1c6be0){try{jsonpatch['apply'](_0x1c6be0,_0x483df8,!![]);}catch(_0x5a1523){return BPromise[_0xfab3('0x21')](_0x5a1523);}return _0x1c6be0[_0xfab3('0x22')]();};}function saveUpdates(_0xa56c66,_0x5aeb7b){return function(_0x4e3e62){if(_0x4e3e62){return _0x4e3e62[_0xfab3('0x23')](_0xa56c66)[_0xfab3('0x24')](function(_0x4ebe3d){return _0x4ebe3d;});}return null;};}function removeEntity(_0x4b55ff,_0x120e70){return function(_0x4a3482){if(_0x4a3482){return _0x4a3482[_0xfab3('0x25')]()[_0xfab3('0x24')](function(){_0x4b55ff['status'](0xcc)[_0xfab3('0x26')]();});}};}function handleEntityNotFound(_0x46a0f8,_0x485b3d){return function(_0x454a1c){if(!_0x454a1c){_0x46a0f8['sendStatus'](0x194);}return _0x454a1c;};}function handleError(_0x333c1c,_0x2f2792){_0x2f2792=_0x2f2792||0x1f4;return function(_0x2f0b15){logger[_0xfab3('0x27')](_0x2f0b15['stack']);if(_0x2f0b15[_0xfab3('0x28')]){delete _0x2f0b15[_0xfab3('0x28')];}_0x333c1c[_0xfab3('0x1a')](_0x2f2792)[_0xfab3('0x29')](_0x2f0b15);};}exports[_0xfab3('0x2a')]=function(_0x348404,_0x4c8cf7){var _0x2c2666={},_0xe7799d={},_0x23aab3={'count':0x0,'rows':[]};var _0x49f928=_['map'](db['SalesforceField'][_0xfab3('0x2b')],function(_0x501309){return{'name':_0x501309[_0xfab3('0x2c')],'type':_0x501309[_0xfab3('0x2d')]['key']};});_0xe7799d[_0xfab3('0x2e')]=_[_0xfab3('0x2f')](_0x49f928,'name');_0xe7799d['query']=_[_0xfab3('0x30')](_0x348404[_0xfab3('0x31')]);_0xe7799d[_0xfab3('0x32')]=_[_0xfab3('0x33')](_0xe7799d[_0xfab3('0x2e')],_0xe7799d[_0xfab3('0x31')]);_0x2c2666[_0xfab3('0x34')]=_[_0xfab3('0x33')](_0xe7799d[_0xfab3('0x2e')],qs[_0xfab3('0x35')](_0x348404[_0xfab3('0x31')][_0xfab3('0x35')]));_0x2c2666['attributes']=_0x2c2666[_0xfab3('0x34')]['length']?_0x2c2666[_0xfab3('0x34')]:_0xe7799d[_0xfab3('0x2e')];if(!_0x348404[_0xfab3('0x31')][_0xfab3('0x36')]('nolimit')){_0x2c2666[_0xfab3('0x1c')]=qs[_0xfab3('0x1c')](_0x348404[_0xfab3('0x31')]['limit']);_0x2c2666[_0xfab3('0x1e')]=qs[_0xfab3('0x1e')](_0x348404[_0xfab3('0x31')][_0xfab3('0x1e')]);}_0x2c2666['order']=qs[_0xfab3('0x37')](_0x348404[_0xfab3('0x31')]['sort']);_0x2c2666[_0xfab3('0x38')]=qs[_0xfab3('0x32')](_[_0xfab3('0x39')](_0x348404[_0xfab3('0x31')],_0xe7799d['filters']),_0x49f928);if(_0x348404[_0xfab3('0x31')][_0xfab3('0x3a')]){_0x2c2666[_0xfab3('0x38')]=_['merge'](_0x2c2666[_0xfab3('0x38')],{'$or':_[_0xfab3('0x2f')](_0x49f928,function(_0x5a77da){if(_0x5a77da['type']!=='VIRTUAL'){var _0xb3d9={};_0xb3d9[_0x5a77da[_0xfab3('0x28')]]={'$like':'%'+_0x348404[_0xfab3('0x31')][_0xfab3('0x3a')]+'%'};return _0xb3d9;}})});}_0x2c2666=_[_0xfab3('0x3b')]({},_0x2c2666,_0x348404[_0xfab3('0x3c')]);var _0x151ef8={'where':_0x2c2666[_0xfab3('0x38')]};return db[_0xfab3('0x3d')]['count'](_0x151ef8)[_0xfab3('0x24')](function(_0x50af9a){_0x23aab3[_0xfab3('0x3e')]=_0x50af9a;if(_0x348404[_0xfab3('0x31')][_0xfab3('0x3f')]){_0x2c2666[_0xfab3('0x40')]=[{'all':!![]}];}return db[_0xfab3('0x3d')][_0xfab3('0x41')](_0x2c2666);})[_0xfab3('0x24')](function(_0x56740f){_0x23aab3[_0xfab3('0x42')]=_0x56740f;return _0x23aab3;})[_0xfab3('0x24')](respondWithFilteredResult(_0x4c8cf7,_0x2c2666))[_0xfab3('0x43')](handleError(_0x4c8cf7,null));};exports[_0xfab3('0x44')]=function(_0x5053ce,_0x44e619){var _0x43784a={'raw':!![],'where':{'id':_0x5053ce[_0xfab3('0x45')]['id']}},_0x2b3f5e={};_0x2b3f5e['model']=_[_0xfab3('0x30')](db['SalesforceField'][_0xfab3('0x2b')]);_0x2b3f5e['query']=_[_0xfab3('0x30')](_0x5053ce[_0xfab3('0x31')]);_0x2b3f5e[_0xfab3('0x32')]=_['intersection'](_0x2b3f5e['model'],_0x2b3f5e['query']);_0x43784a['attributes']=_[_0xfab3('0x33')](_0x2b3f5e['model'],qs['fields'](_0x5053ce[_0xfab3('0x31')][_0xfab3('0x35')]));_0x43784a['attributes']=_0x43784a[_0xfab3('0x34')][_0xfab3('0x46')]?_0x43784a[_0xfab3('0x34')]:_0x2b3f5e[_0xfab3('0x2e')];if(_0x5053ce['query'][_0xfab3('0x3f')]){_0x43784a[_0xfab3('0x40')]=[{'all':!![]}];}_0x43784a=_[_0xfab3('0x3b')]({},_0x43784a,_0x5053ce[_0xfab3('0x3c')]);return db['SalesforceField']['find'](_0x43784a)[_0xfab3('0x24')](handleEntityNotFound(_0x44e619,null))[_0xfab3('0x24')](respondWithResult(_0x44e619,null))[_0xfab3('0x43')](handleError(_0x44e619,null));};exports[_0xfab3('0x47')]=function(_0x404804,_0x3bf221){return db[_0xfab3('0x3d')][_0xfab3('0x47')](_0x404804[_0xfab3('0x48')],{})['then'](respondWithResult(_0x3bf221,0xc9))[_0xfab3('0x43')](handleError(_0x3bf221,null));};exports['update']=function(_0x562532,_0x12f141){if(_0x562532[_0xfab3('0x48')]['id']){delete _0x562532[_0xfab3('0x48')]['id'];}return db[_0xfab3('0x3d')][_0xfab3('0x49')]({'where':{'id':_0x562532[_0xfab3('0x45')]['id']}})[_0xfab3('0x24')](handleEntityNotFound(_0x12f141,null))[_0xfab3('0x24')](saveUpdates(_0x562532['body'],null))[_0xfab3('0x24')](respondWithResult(_0x12f141,null))[_0xfab3('0x43')](handleError(_0x12f141,null));};exports[_0xfab3('0x25')]=function(_0xc4383b,_0x5187fd){return db[_0xfab3('0x3d')][_0xfab3('0x49')]({'where':{'id':_0xc4383b['params']['id']}})[_0xfab3('0x24')](handleEntityNotFound(_0x5187fd,null))[_0xfab3('0x24')](removeEntity(_0x5187fd,null))[_0xfab3('0x43')](handleError(_0x5187fd,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 663c377..37dfd75 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 _0x6630=['api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','lodash','util','../../config/logger'];(function(_0x2c7252,_0x5a1441){var _0x20c1b8=function(_0x4cd670){while(--_0x4cd670){_0x2c7252['push'](_0x2c7252['shift']());}};_0x20c1b8(++_0x5a1441);}(_0x6630,0x1e7));var _0x0663=function(_0xf5c32e,_0x47ee76){_0xf5c32e=_0xf5c32e-0x0;var _0x17f1a8=_0x6630[_0xf5c32e];return _0x17f1a8;};'use strict';var _=require(_0x0663('0x0'));var util=require(_0x0663('0x1'));var logger=require(_0x0663('0x2'))(_0x0663('0x3'));var moment=require(_0x0663('0x4'));var BPromise=require(_0x0663('0x5'));var rp=require(_0x0663('0x6'));var fs=require('fs');var path=require(_0x0663('0x7'));var rimraf=require(_0x0663('0x8'));var config=require('../../config/environment');var attributes=require(_0x0663('0x9'));module['exports']=function(_0xe4e459,_0x42f36e){return _0xe4e459[_0x0663('0xa')](_0x0663('0xb'),attributes,{'tableName':_0x0663('0xc'),'paranoid':![],'indexes':[{'name':_0x0663('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x419c=['request-promise','../../config/environment','exports','define','salesforce_unique_index','idField','FieldId','lodash','api'];(function(_0x5bb488,_0x405570){var _0x3a541a=function(_0x72411d){while(--_0x72411d){_0x5bb488['push'](_0x5bb488['shift']());}};_0x3a541a(++_0x405570);}(_0x419c,0xe8));var _0xc419=function(_0x253f0e,_0x3d2fe7){_0x253f0e=_0x253f0e-0x0;var _0x5d231a=_0x419c[_0x253f0e];return _0x5d231a;};'use strict';var _=require(_0xc419('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc419('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc419('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc419('0x3'));var attributes=require('./intSalesforceField.attributes');module[_0xc419('0x4')]=function(_0x4a4ff3,_0x31cae2){return _0x4a4ff3[_0xc419('0x5')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xc419('0x6'),'fields':[_0xc419('0x7'),_0xc419('0x8')],'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 8733e4b..9c8f122 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 _0x18dd=['message','SalesforceField,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1dc165,_0x5a5d21){var _0x238bfa=function(_0x3a966d){while(--_0x3a966d){_0x1dc165['push'](_0x1dc165['shift']());}};_0x238bfa(++_0x5a5d21);}(_0x18dd,0x10b));var _0xd18d=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x18dd[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd18d('0x0'));var util=require(_0xd18d('0x1'));var moment=require(_0xd18d('0x2'));var BPromise=require('bluebird');var rs=require(_0xd18d('0x3'));var fs=require('fs');var Redis=require(_0xd18d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd18d('0x5'));var logger=require(_0xd18d('0x6'))('rpc');var config=require(_0xd18d('0x7'));var jayson=require(_0xd18d('0x8'));var client=jayson[_0xd18d('0x9')][_0xd18d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x516777,_0x1dde0e,_0x3132db){return new BPromise(function(_0x4dc4e7,_0x2db164){return client[_0xd18d('0xb')](_0x516777,_0x3132db)['then'](function(_0x34c2ea){logger[_0xd18d('0xc')]('SalesforceField,\x20%s,\x20%s',_0x1dde0e,_0xd18d('0xd'));logger[_0xd18d('0xe')](_0xd18d('0xf'),_0x1dde0e,'request\x20sent',JSON[_0xd18d('0x10')](_0x34c2ea));if(_0x34c2ea[_0xd18d('0x11')]){if(_0x34c2ea[_0xd18d('0x11')][_0xd18d('0x12')]===0x1f4){logger[_0xd18d('0x11')]('SalesforceField,\x20%s,\x20%s',_0x1dde0e,_0x34c2ea[_0xd18d('0x11')]['message']);return _0x2db164(_0x34c2ea[_0xd18d('0x11')][_0xd18d('0x13')]);}logger[_0xd18d('0x11')](_0xd18d('0x14'),_0x1dde0e,_0x34c2ea[_0xd18d('0x11')][_0xd18d('0x13')]);return _0x4dc4e7(_0x34c2ea[_0xd18d('0x11')]['message']);}else{logger[_0xd18d('0xc')](_0xd18d('0x14'),_0x1dde0e,_0xd18d('0xd'));_0x4dc4e7(_0x34c2ea['result'][_0xd18d('0x13')]);}})[_0xd18d('0x15')](function(_0x4d8c98){logger[_0xd18d('0x11')]('SalesforceField,\x20%s,\x20%s',_0x1dde0e,_0x4d8c98);_0x2db164(_0x4d8c98);});});} \ No newline at end of file +var _0x2e4a=['info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x142e36,_0x21621f){var _0x4b0f31=function(_0x544161){while(--_0x544161){_0x142e36['push'](_0x142e36['shift']());}};_0x4b0f31(++_0x21621f);}(_0x2e4a,0x1ae));var _0xa2e4=function(_0x3cf3e2,_0x10ae3e){_0x3cf3e2=_0x3cf3e2-0x0;var _0x2f69f7=_0x2e4a[_0x3cf3e2];return _0x2f69f7;};'use strict';var _=require('lodash');var util=require(_0xa2e4('0x0'));var moment=require(_0xa2e4('0x1'));var BPromise=require(_0xa2e4('0x2'));var rs=require(_0xa2e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2e4('0x4'))['db'];var utils=require(_0xa2e4('0x5'));var logger=require(_0xa2e4('0x6'))('rpc');var config=require(_0xa2e4('0x7'));var jayson=require(_0xa2e4('0x8'));var client=jayson[_0xa2e4('0x9')][_0xa2e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23b4d8,_0x37745e,_0x3f24bd){return new BPromise(function(_0x33c88a,_0x188842){return client['request'](_0x23b4d8,_0x3f24bd)['then'](function(_0x210a70){logger[_0xa2e4('0xb')](_0xa2e4('0xc'),_0x37745e,'request\x20sent');logger[_0xa2e4('0xd')](_0xa2e4('0xe'),_0x37745e,_0xa2e4('0xf'),JSON[_0xa2e4('0x10')](_0x210a70));if(_0x210a70['error']){if(_0x210a70[_0xa2e4('0x11')]['code']===0x1f4){logger[_0xa2e4('0x11')](_0xa2e4('0xc'),_0x37745e,_0x210a70[_0xa2e4('0x11')]['message']);return _0x188842(_0x210a70[_0xa2e4('0x11')][_0xa2e4('0x12')]);}logger['error'](_0xa2e4('0xc'),_0x37745e,_0x210a70[_0xa2e4('0x11')]['message']);return _0x33c88a(_0x210a70[_0xa2e4('0x11')]['message']);}else{logger[_0xa2e4('0xb')](_0xa2e4('0xc'),_0x37745e,'request\x20sent');_0x33c88a(_0x210a70[_0xa2e4('0x13')]['message']);}})[_0xa2e4('0x14')](function(_0x3452c5){logger[_0xa2e4('0x11')](_0xa2e4('0xc'),_0x37745e,_0x3452c5);_0x188842(_0x3452c5);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 32748ab..acb9414 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 _0x50c1=['/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','show'];(function(_0x57a094,_0x5a14a7){var _0x4eb82f=function(_0x8d5e1b){while(--_0x8d5e1b){_0x57a094['push'](_0x57a094['shift']());}};_0x4eb82f(++_0x5a14a7);}(_0x50c1,0x1a5));var _0x150c=function(_0x15519a,_0x35f128){_0x15519a=_0x15519a-0x0;var _0x41d421=_0x50c1[_0x15519a];return _0x41d421;};'use strict';var multer=require(_0x150c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x150c('0x1'));var express=require(_0x150c('0x2'));var router=express[_0x150c('0x3')]();var fs_extra=require(_0x150c('0x4'));var auth=require(_0x150c('0x5'));var interaction=require(_0x150c('0x6'));var config=require(_0x150c('0x7'));var controller=require(_0x150c('0x8'));router[_0x150c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x150c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x150c('0xa')]);router[_0x150c('0x9')](_0x150c('0xb'),auth[_0x150c('0xc')](),controller[_0x150c('0xd')]);router[_0x150c('0x9')](_0x150c('0xe'),auth[_0x150c('0xc')](),controller[_0x150c('0xf')]);router[_0x150c('0x10')]('/',auth['isAuthenticated'](),controller[_0x150c('0x11')]);router[_0x150c('0x10')](_0x150c('0xb'),auth['isAuthenticated'](),controller[_0x150c('0x12')]);router['put']('/:id',auth[_0x150c('0xc')](),controller[_0x150c('0x13')]);router[_0x150c('0x14')](_0x150c('0x15'),auth[_0x150c('0xc')](),controller[_0x150c('0x16')]);module[_0x150c('0x17')]=router; \ No newline at end of file +var _0x4679=['addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','post','create'];(function(_0x3d20a0,_0x2b6fe2){var _0x9f05f2=function(_0xebe60c){while(--_0xebe60c){_0x3d20a0['push'](_0x3d20a0['shift']());}};_0x9f05f2(++_0x2b6fe2);}(_0x4679,0xb0));var _0x9467=function(_0x5694f4,_0xe3ad9a){_0x5694f4=_0x5694f4-0x0;var _0x2073cb=_0x4679[_0x5694f4];return _0x2073cb;};'use strict';var multer=require(_0x9467('0x0'));var util=require('util');var path=require(_0x9467('0x1'));var timeout=require(_0x9467('0x2'));var express=require(_0x9467('0x3'));var router=express['Router']();var fs_extra=require(_0x9467('0x4'));var auth=require(_0x9467('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0x9467('0x6')]('/',auth[_0x9467('0x7')](),controller[_0x9467('0x8')]);router['get']('/:id',auth[_0x9467('0x7')](),controller[_0x9467('0x9')]);router[_0x9467('0x6')](_0x9467('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x9467('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x9467('0xc')]('/',auth[_0x9467('0x7')](),controller[_0x9467('0xd')]);router[_0x9467('0xc')](_0x9467('0xa'),auth[_0x9467('0x7')](),controller[_0x9467('0xe')]);router[_0x9467('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9467('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9467('0x11')]);module[_0x9467('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index da18447..8e7d37e 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 _0x1332=['username','sequelize','exports','STRING'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1332,0x1c9));var _0x2133=function(_0x5ad6db,_0x945292){_0x5ad6db=_0x5ad6db-0x0;var _0x372267=_0x1332[_0x5ad6db];return _0x372267;};'use strict';var Sequelize=require(_0x2133('0x0'));module[_0x2133('0x1')]={'name':{'type':Sequelize[_0x2133('0x2')]},'description':{'type':Sequelize[_0x2133('0x2')]},'username':{'type':Sequelize[_0x2133('0x2')],'unique':_0x2133('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2133('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4bfb=['sequelize','exports','STRING','username'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4bfb,0x150));var _0xb4bf=function(_0x4b64a4,_0x1bdc50){_0x4b64a4=_0x4b64a4-0x0;var _0xd19b0e=_0x4bfb[_0x4b64a4];return _0xd19b0e;};'use strict';var Sequelize=require(_0xb4bf('0x0'));module[_0xb4bf('0x1')]={'name':{'type':Sequelize[_0xb4bf('0x2')]},'description':{'type':Sequelize[_0xb4bf('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb4bf('0x3')},'password':{'type':Sequelize[_0xb4bf('0x2')]},'email':{'type':Sequelize[_0xb4bf('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb4bf('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index d96b95b..248818d 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 _0xb9e9=['findOne','ServicenowConfiguration','order','getConfigurations','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','caused_by','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','caller_id','work_notes','close_code','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','close_notes','follow_up','sys_id','reopened_by','urgency','company','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','username','password','remoteUri','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','assign','remove','internalType','label','push','all','log','TCL:\x20_object','includes','forEach','concat','test','Wrong\x20credentials','statusCode','boolean','True','false','sys_choice?sysparm_query=name=incident^element=','result','rimraf','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','ServicenowAccount','includeAll','include','findAll','rows','catch','show','params','options','find','create','body'];(function(_0x1de3a0,_0x17593c){var _0x396141=function(_0x2d6e6f){while(--_0x2d6e6f){_0x1de3a0['push'](_0x1de3a0['shift']());}};_0x396141(++_0x17593c);}(_0xb9e9,0x11e));var _0x9b9e=function(_0x6a239e,_0x1cf0e4){_0x6a239e=_0x6a239e-0x0;var _0x3f3cce=_0xb9e9[_0x6a239e];return _0x3f3cce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b9e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b9e('0x1'));var BPromise=require(_0x9b9e('0x2'));var Mustache=require(_0x9b9e('0x3'));var util=require('util');var path=require(_0x9b9e('0x4'));var sox=require(_0x9b9e('0x5'));var csv=require(_0x9b9e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b9e('0x7'));var _=require(_0x9b9e('0x8'));var squel=require(_0x9b9e('0x9'));var crypto=require('crypto');var jsforce=require(_0x9b9e('0xa'));var deskjs=require(_0x9b9e('0xb'));var toCsv=require(_0x9b9e('0x6'));var querystring=require(_0x9b9e('0xc'));var Papa=require(_0x9b9e('0xd'));var Redis=require(_0x9b9e('0xe'));var authService=require(_0x9b9e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9b9e('0x10'));var hardwareService=require(_0x9b9e('0x11'));var logger=require(_0x9b9e('0x12'))(_0x9b9e('0x13'));var utils=require(_0x9b9e('0x14'));var config=require(_0x9b9e('0x15'));var licenseUtil=require(_0x9b9e('0x16'));var db=require(_0x9b9e('0x17'))['db'];var integrations=require(_0x9b9e('0x18'));function respondWithStatusCode(_0x2a58a2,_0x23182e){_0x23182e=_0x23182e||0xcc;return function(_0x2bf812){if(_0x2bf812){return _0x2a58a2[_0x9b9e('0x19')](_0x23182e);}return _0x2a58a2[_0x9b9e('0x1a')](_0x23182e)['end']();};}function respondWithResult(_0x465d42,_0x3097db){_0x3097db=_0x3097db||0xc8;return function(_0x31f183){if(_0x31f183){return _0x465d42[_0x9b9e('0x1a')](_0x3097db)[_0x9b9e('0x1b')](_0x31f183);}};}function respondWithFilteredResult(_0x1cbfe9,_0x56f51a){return function(_0x224640){if(_0x224640){var _0x1e0e58=typeof _0x56f51a[_0x9b9e('0x1c')]===_0x9b9e('0x1d')&&typeof _0x56f51a[_0x9b9e('0x1e')]===_0x9b9e('0x1d');var _0x5ab92a=_0x224640[_0x9b9e('0x1f')];var _0x39d57e=_0x1e0e58?0x0:_0x56f51a[_0x9b9e('0x1c')];var _0x273d08=_0x1e0e58?_0x224640[_0x9b9e('0x1f')]:_0x56f51a['offset']+_0x56f51a[_0x9b9e('0x1e')];var _0x5d8563;if(_0x273d08>=_0x5ab92a){_0x273d08=_0x5ab92a;_0x5d8563=0xc8;}else{_0x5d8563=0xce;}_0x1cbfe9['status'](_0x5d8563);return _0x1cbfe9[_0x9b9e('0x20')](_0x9b9e('0x21'),_0x39d57e+'-'+_0x273d08+'/'+_0x5ab92a)[_0x9b9e('0x1b')](_0x224640);}return null;};}function patchUpdates(_0x3b6bf5){return function(_0x5f11ae){try{jsonpatch['apply'](_0x5f11ae,_0x3b6bf5,!![]);}catch(_0x387a7a){return BPromise[_0x9b9e('0x22')](_0x387a7a);}return _0x5f11ae[_0x9b9e('0x23')]();};}function saveUpdates(_0x43ca9b,_0x112418){return function(_0x320a77){if(_0x320a77){return _0x320a77[_0x9b9e('0x24')](_0x43ca9b)[_0x9b9e('0x25')](function(_0x3b9b3d){return _0x3b9b3d;});}return null;};}function removeEntity(_0x2e0be0,_0x339d33){return function(_0x4b3379){if(_0x4b3379){return _0x4b3379[_0x9b9e('0x26')]()[_0x9b9e('0x25')](function(){_0x2e0be0[_0x9b9e('0x1a')](0xcc)[_0x9b9e('0x27')]();});}};}function handleEntityNotFound(_0xd62599,_0x6b9287){return function(_0x1396f8){if(!_0x1396f8){_0xd62599['sendStatus'](0x194);}return _0x1396f8;};}function handleError(_0x323dcd,_0x1c89d0){_0x1c89d0=_0x1c89d0||0x1f4;return function(_0x1859fd){logger[_0x9b9e('0x28')](_0x1859fd[_0x9b9e('0x29')]);if(_0x1859fd[_0x9b9e('0x2a')]){delete _0x1859fd[_0x9b9e('0x2a')];}_0x323dcd[_0x9b9e('0x1a')](_0x1c89d0)[_0x9b9e('0x2b')](_0x1859fd);};}exports[_0x9b9e('0x2c')]=function(_0x447242,_0x22300b){var _0x220b50={},_0x3cfc53={},_0x2ea449={'count':0x0,'rows':[]};var _0x23446a=_['map'](db['ServicenowAccount'][_0x9b9e('0x2d')],function(_0x53f420){return{'name':_0x53f420[_0x9b9e('0x2e')],'type':_0x53f420['type'][_0x9b9e('0x2f')]};});_0x3cfc53[_0x9b9e('0x30')]=_[_0x9b9e('0x31')](_0x23446a,_0x9b9e('0x2a'));_0x3cfc53['query']=_[_0x9b9e('0x32')](_0x447242[_0x9b9e('0x33')]);_0x3cfc53['filters']=_['intersection'](_0x3cfc53['model'],_0x3cfc53[_0x9b9e('0x33')]);_0x220b50[_0x9b9e('0x34')]=_[_0x9b9e('0x35')](_0x3cfc53[_0x9b9e('0x30')],qs[_0x9b9e('0x36')](_0x447242[_0x9b9e('0x33')][_0x9b9e('0x36')]));_0x220b50[_0x9b9e('0x34')]=_0x220b50['attributes'][_0x9b9e('0x37')]?_0x220b50[_0x9b9e('0x34')]:_0x3cfc53['model'];if(!_0x447242[_0x9b9e('0x33')][_0x9b9e('0x38')]('nolimit')){_0x220b50[_0x9b9e('0x1e')]=qs['limit'](_0x447242['query'][_0x9b9e('0x1e')]);_0x220b50[_0x9b9e('0x1c')]=qs[_0x9b9e('0x1c')](_0x447242['query'][_0x9b9e('0x1c')]);}_0x220b50['order']=qs[_0x9b9e('0x39')](_0x447242[_0x9b9e('0x33')]['sort']);_0x220b50[_0x9b9e('0x3a')]=qs[_0x9b9e('0x3b')](_[_0x9b9e('0x3c')](_0x447242[_0x9b9e('0x33')],_0x3cfc53[_0x9b9e('0x3b')]),_0x23446a);if(_0x447242[_0x9b9e('0x33')][_0x9b9e('0x3d')]){_0x220b50['where']=_['merge'](_0x220b50[_0x9b9e('0x3a')],{'$or':_['map'](_0x23446a,function(_0x5f0343){if(_0x5f0343['type']!==_0x9b9e('0x3e')){var _0x4b379c={};_0x4b379c[_0x5f0343[_0x9b9e('0x2a')]]={'$like':'%'+_0x447242[_0x9b9e('0x33')]['filter']+'%'};return _0x4b379c;}})});}_0x220b50=_[_0x9b9e('0x3f')]({},_0x220b50,_0x447242['options']);var _0x52792c={'where':_0x220b50[_0x9b9e('0x3a')]};return db[_0x9b9e('0x40')][_0x9b9e('0x1f')](_0x52792c)[_0x9b9e('0x25')](function(_0x330825){_0x2ea449[_0x9b9e('0x1f')]=_0x330825;if(_0x447242[_0x9b9e('0x33')][_0x9b9e('0x41')]){_0x220b50[_0x9b9e('0x42')]=[{'all':!![]}];}return db[_0x9b9e('0x40')][_0x9b9e('0x43')](_0x220b50);})[_0x9b9e('0x25')](function(_0x5ee672){_0x2ea449[_0x9b9e('0x44')]=_0x5ee672;return _0x2ea449;})['then'](respondWithFilteredResult(_0x22300b,_0x220b50))[_0x9b9e('0x45')](handleError(_0x22300b,null));};exports[_0x9b9e('0x46')]=function(_0x3acfbf,_0x286295){var _0x2a9bde={'raw':![],'where':{'id':_0x3acfbf[_0x9b9e('0x47')]['id']}},_0x416d92={};_0x416d92[_0x9b9e('0x30')]=_['keys'](db[_0x9b9e('0x40')][_0x9b9e('0x2d')]);_0x416d92[_0x9b9e('0x33')]=_[_0x9b9e('0x32')](_0x3acfbf[_0x9b9e('0x33')]);_0x416d92['filters']=_[_0x9b9e('0x35')](_0x416d92['model'],_0x416d92[_0x9b9e('0x33')]);_0x2a9bde['attributes']=_['intersection'](_0x416d92[_0x9b9e('0x30')],qs[_0x9b9e('0x36')](_0x3acfbf[_0x9b9e('0x33')]['fields']));_0x2a9bde['attributes']=_0x2a9bde[_0x9b9e('0x34')][_0x9b9e('0x37')]?_0x2a9bde[_0x9b9e('0x34')]:_0x416d92[_0x9b9e('0x30')];if(_0x3acfbf['query'][_0x9b9e('0x41')]){_0x2a9bde[_0x9b9e('0x42')]=[{'all':!![]}];}_0x2a9bde=_[_0x9b9e('0x3f')]({},_0x2a9bde,_0x3acfbf[_0x9b9e('0x48')]);return db[_0x9b9e('0x40')][_0x9b9e('0x49')](_0x2a9bde)[_0x9b9e('0x25')](handleEntityNotFound(_0x286295,null))[_0x9b9e('0x25')](respondWithResult(_0x286295,null))[_0x9b9e('0x45')](handleError(_0x286295,null));};exports['create']=function(_0x4369f6,_0x2a8dbd){return db[_0x9b9e('0x40')][_0x9b9e('0x4a')](_0x4369f6['body'],{})[_0x9b9e('0x25')](respondWithResult(_0x2a8dbd,0xc9))[_0x9b9e('0x45')](handleError(_0x2a8dbd,null));};exports[_0x9b9e('0x24')]=function(_0x423555,_0x2f9f70){if(_0x423555[_0x9b9e('0x4b')]['id']){delete _0x423555[_0x9b9e('0x4b')]['id'];}return db[_0x9b9e('0x40')][_0x9b9e('0x49')]({'where':{'id':_0x423555['params']['id']}})[_0x9b9e('0x25')](handleEntityNotFound(_0x2f9f70,null))[_0x9b9e('0x25')](saveUpdates(_0x423555[_0x9b9e('0x4b')],null))[_0x9b9e('0x25')](respondWithResult(_0x2f9f70,null))[_0x9b9e('0x45')](handleError(_0x2f9f70,null));};exports[_0x9b9e('0x26')]=function(_0x4b1047,_0x22cf35){return db[_0x9b9e('0x40')][_0x9b9e('0x49')]({'where':{'id':_0x4b1047[_0x9b9e('0x47')]['id']}})[_0x9b9e('0x25')](handleEntityNotFound(_0x22cf35,null))[_0x9b9e('0x25')](removeEntity(_0x22cf35,null))['catch'](handleError(_0x22cf35,null));};exports['getConfigurations']=function(_0x29f619,_0x2ad073,_0x45405b){var _0x3640bc={};var _0x350380={};var _0x32a365;var _0x490c0a;return db['ServicenowAccount'][_0x9b9e('0x4c')]({'where':{'id':_0x29f619[_0x9b9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ad073,null))[_0x9b9e('0x25')](function(_0x5a0344){if(_0x5a0344){_0x32a365=_0x5a0344;_0x350380[_0x9b9e('0x30')]=_[_0x9b9e('0x32')](db[_0x9b9e('0x4d')][_0x9b9e('0x2d')]);_0x350380['query']=_[_0x9b9e('0x32')](_0x29f619[_0x9b9e('0x33')]);_0x350380[_0x9b9e('0x3b')]=_[_0x9b9e('0x35')](_0x350380[_0x9b9e('0x30')],_0x350380[_0x9b9e('0x33')]);_0x3640bc[_0x9b9e('0x34')]=_[_0x9b9e('0x35')](_0x350380['model'],qs[_0x9b9e('0x36')](_0x29f619[_0x9b9e('0x33')][_0x9b9e('0x36')]));_0x3640bc[_0x9b9e('0x34')]=_0x3640bc[_0x9b9e('0x34')][_0x9b9e('0x37')]?_0x3640bc[_0x9b9e('0x34')]:_0x350380[_0x9b9e('0x30')];_0x3640bc[_0x9b9e('0x4e')]=qs[_0x9b9e('0x39')](_0x29f619['query'][_0x9b9e('0x39')]);_0x3640bc['where']=qs[_0x9b9e('0x3b')](_[_0x9b9e('0x3c')](_0x29f619[_0x9b9e('0x33')],_0x350380[_0x9b9e('0x3b')]));if(_0x29f619['query']['filter']){_0x3640bc[_0x9b9e('0x3a')]=_[_0x9b9e('0x3f')](_0x3640bc[_0x9b9e('0x3a')],{'$or':_[_0x9b9e('0x31')](_0x3640bc[_0x9b9e('0x34')],function(_0x1f0321){var _0x512e32={};_0x512e32[_0x1f0321]={'$like':'%'+_0x29f619[_0x9b9e('0x33')][_0x9b9e('0x3d')]+'%'};return _0x512e32;})});}_0x3640bc=_[_0x9b9e('0x3f')]({},_0x3640bc,_0x29f619[_0x9b9e('0x48')]);return _0x32a365[_0x9b9e('0x4f')](_0x3640bc);}})['then'](function(_0x50f52d){if(_0x50f52d){_0x490c0a=_0x50f52d['length'];if(!_0x29f619['query'][_0x9b9e('0x38')]('nolimit')){_0x3640bc[_0x9b9e('0x1e')]=qs[_0x9b9e('0x1e')](_0x29f619[_0x9b9e('0x33')][_0x9b9e('0x1e')]);_0x3640bc[_0x9b9e('0x1c')]=qs[_0x9b9e('0x1c')](_0x29f619[_0x9b9e('0x33')]['offset']);}return _0x32a365[_0x9b9e('0x4f')](_0x3640bc);}})['then'](function(_0x1042c5){if(_0x1042c5){return _0x1042c5?{'count':_0x490c0a,'rows':_0x1042c5}:null;}})['then'](respondWithResult(_0x2ad073,null))[_0x9b9e('0x45')](handleError(_0x2ad073,null));};exports['addConfiguration']=function(_0x4e82d5,_0x22b3c5,_0x5e6a97){if(_0x4e82d5[_0x9b9e('0x4b')]['id']){delete _0x4e82d5[_0x9b9e('0x4b')]['id'];}return db[_0x9b9e('0x40')][_0x9b9e('0x4c')]({'where':{'id':_0x4e82d5['params']['id']}})[_0x9b9e('0x25')](handleEntityNotFound(_0x22b3c5,null))[_0x9b9e('0x25')](function(_0x42f6e2){if(_0x42f6e2){_0x4e82d5[_0x9b9e('0x4b')][_0x9b9e('0x50')]=_0x42f6e2['id'];_0x4e82d5[_0x9b9e('0x4b')][_0x9b9e('0x51')]=integrations[_0x9b9e('0x52')](_0x4e82d5[_0x9b9e('0x4b')][_0x9b9e('0x53')],_0x4e82d5['body'][_0x9b9e('0x54')]);_0x4e82d5[_0x9b9e('0x4b')][_0x9b9e('0x55')]=integrations[_0x9b9e('0x56')](_0x4e82d5[_0x9b9e('0x4b')][_0x9b9e('0x53')],_0x4e82d5['body'][_0x9b9e('0x54')]);return db[_0x9b9e('0x4d')][_0x9b9e('0x4a')](_0x4e82d5[_0x9b9e('0x4b')],{'include':[{'model':db['ServicenowField'],'as':_0x9b9e('0x51')},{'model':db[_0x9b9e('0x57')],'as':'Descriptions'}]});}return null;})[_0x9b9e('0x25')](respondWithResult(_0x22b3c5,null))['catch'](handleError(_0x22b3c5,null));};exports[_0x9b9e('0x58')]=function(_0x1c2ce8,_0x474f8b,_0x38c6e7){var _0x43676f=[_0x9b9e('0x59'),_0x9b9e('0x5a'),_0x9b9e('0x5b'),_0x9b9e('0x5c'),'close_code',_0x9b9e('0x5d'),_0x9b9e('0x5e'),_0x9b9e('0x5f'),_0x9b9e('0x60')];var _0x1bff9e=[_0x9b9e('0x61'),_0x9b9e('0x59'),_0x9b9e('0x62'),'watch_list','upon_reject',_0x9b9e('0x63'),_0x9b9e('0x64'),'hold_reason',_0x9b9e('0x65'),_0x9b9e('0x66'),_0x9b9e('0x67'),'sys_updated_by',_0x9b9e('0x68'),_0x9b9e('0x69'),_0x9b9e('0x6a'),_0x9b9e('0x6b'),_0x9b9e('0x6c'),_0x9b9e('0x6d'),'knowledge',_0x9b9e('0x4e'),_0x9b9e('0x6e'),_0x9b9e('0x6f'),_0x9b9e('0x70'),_0x9b9e('0x71'),_0x9b9e('0x72'),'active',_0x9b9e('0x73'),_0x9b9e('0x74'),_0x9b9e('0x75'),_0x9b9e('0x76'),_0x9b9e('0x77'),_0x9b9e('0x78'),_0x9b9e('0x79'),'opened_at',_0x9b9e('0x7a'),'group_list',_0x9b9e('0x7b'),_0x9b9e('0x7c'),_0x9b9e('0x7d'),_0x9b9e('0x7e'),'approval_set',_0x9b9e('0x5c'),_0x9b9e('0x7f'),'short_description',_0x9b9e('0x80'),_0x9b9e('0x81'),_0x9b9e('0x82'),_0x9b9e('0x83'),_0x9b9e('0x84'),'business_stc',_0x9b9e('0x85'),_0x9b9e('0x86'),'calendar_duration',_0x9b9e('0x5d'),'sys_class_name',_0x9b9e('0x87'),'closed_by',_0x9b9e('0x88'),'parent_incident',_0x9b9e('0x89'),'contact_type',_0x9b9e('0x8a'),_0x9b9e('0x5e'),_0x9b9e('0x8b'),'problem_id',_0x9b9e('0x8c'),'reassignment_count',_0x9b9e('0x8d'),_0x9b9e('0x8e'),'severity',_0x9b9e('0x8f'),'sla_due',_0x9b9e('0x90'),_0x9b9e('0x91'),_0x9b9e('0x92'),_0x9b9e('0x93'),_0x9b9e('0x94'),'sys_tags',_0x9b9e('0x95'),_0x9b9e('0x96'),_0x9b9e('0x97'),_0x9b9e('0x98'),_0x9b9e('0x60')];var _0xef50cd='';var _0x29758b='';var _0x259b5f=[];var _0x1f42ee='';var _0xd9c00c='';var _0x3705cd=[];var _0x1c2938='';var _0x98d622='';var _0x555bda={};var _0x38ba0f='';return db[_0x9b9e('0x40')][_0x9b9e('0x4c')]({'where':{'id':_0x1c2ce8[_0x9b9e('0x47')]['id']},'attributes':['id',_0x9b9e('0x99'),_0x9b9e('0x9a'),'email',_0x9b9e('0x9b'),'serverUrl']})[_0x9b9e('0x25')](handleEntityNotFound(_0x474f8b,null))[_0x9b9e('0x25')](function(_0x5680b0){if(_0x5680b0){_0x38ba0f=_0x5680b0[_0x9b9e('0x9b')];var _0x1ce6bf=_0x38ba0f['slice'](-0x1);if(_0x1ce6bf==='/'){_0x38ba0f=_0x38ba0f[_0x9b9e('0x9c')](0x0,_0x38ba0f['lastIndexOf'](_0x1ce6bf));}_0x98d622=util[_0x9b9e('0x9d')](_0x9b9e('0x9e'),_0x38ba0f);_0x1c2938=util[_0x9b9e('0x9d')](_0x9b9e('0x9f'),_0x38ba0f);_0x555bda={'user':_0x5680b0['username'],'pass':_0x5680b0[_0x9b9e('0x9a')]};var _0x2ef457={'method':_0x9b9e('0xa0'),'uri':_0x98d622+_0x9b9e('0xa1'),'auth':_0x555bda,'json':!![]};return rp(_0x2ef457);}})[_0x9b9e('0x25')](function(_0x46833d){if(_0x46833d['result'][_0x9b9e('0x37')]>0x0){_0xef50cd=_0x46833d['result'];}console['log']('incident\x20table\x20objects',_0xef50cd);_0x3705cd=[];_0x29758b=Object[_0x9b9e('0xa2')]([],_0xef50cd);_[_0x9b9e('0xa3')](_0x29758b,function(_0x592223){return!_0x43676f['includes'](_0x592223[_0x9b9e('0x2a')]);});_0x29758b['forEach'](function(_0xc45495){var _0x459faf=createFieldObject(_0x1c2938,_0x555bda,_0xc45495[_0x9b9e('0xa4')],_0xc45495['name'],_0xc45495[_0x9b9e('0xa5')],![]);_0x3705cd[_0x9b9e('0xa6')](_0x459faf);});return Promise[_0x9b9e('0xa7')](_0x3705cd);})[_0x9b9e('0x25')](function(_0x256ddf){_0x259b5f=_0x256ddf;_0x1f42ee=Object['assign']([],_0xef50cd);console[_0x9b9e('0xa8')](_0x9b9e('0xa9'),_0xef50cd);_['remove'](_0x1f42ee,function(_0x22c677){return _0x1bff9e[_0x9b9e('0xaa')](_0x22c677['name']);});console[_0x9b9e('0xa8')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1f42ee);_0x3705cd=[];_0x1f42ee[_0x9b9e('0xab')](function(_0x369a4c){var _0x5723fc=createFieldObject(_0x1c2938,_0x555bda,_0x369a4c[_0x9b9e('0xa4')],_0x369a4c[_0x9b9e('0x2a')],_0x369a4c['label'],!![]);_0x3705cd[_0x9b9e('0xa6')](_0x5723fc);});return Promise[_0x9b9e('0xa7')](_0x3705cd);})[_0x9b9e('0x25')](function(_0x896f7b){_0xd9c00c=_0x896f7b;var _0x4ce316=_0x259b5f[_0x9b9e('0xac')](_0xd9c00c);return{'count':_0x4ce316[_0x9b9e('0x37')],'rows':_0x4ce316};})['then'](respondWithResult(_0x474f8b,null))['catch'](function(_0x4671f5){console[_0x9b9e('0xa8')]('ServiceNow\x20error:\x20'+_0x4671f5);var _0xe3384b=_0x1c2ce8['query'][_0x9b9e('0xad')]?0x1f4:_0x4671f5['statusCode']||0x1f4;logger[_0x9b9e('0x28')](_0x4671f5['stack']);delete _0x4671f5['name'];if(_0xe3384b===0x191){_0xe3384b=0x190;}_0x474f8b['status'](_0xe3384b)[_0x9b9e('0x2b')](_0x1c2ce8['query'][_0x9b9e('0xad')]?{'message':_0x9b9e('0xae'),'statusCode':_0x4671f5[_0x9b9e('0xaf')]}:_0x4671f5);});};function createFieldObject(_0x1e86ed,_0x95d7c0,_0x295e77,_0x586429,_0x5ccaf8,_0x4d017d){return new Promise(function(_0x7fef8c,_0x57b1a7){var _0x345e16={'id':_0x586429,'name':_0x5ccaf8,'custom':_0x4d017d};if(_0x295e77===_0x9b9e('0xb0')){_0x345e16['options']=[{'name':_0x9b9e('0xb1'),'value':'true'},{'name':'False','value':_0x9b9e('0xb2')}];_0x7fef8c(_0x345e16);}else{var _0x45b5d4={'method':_0x9b9e('0xa0'),'uri':_0x1e86ed+_0x9b9e('0xb3')+_0x586429,'auth':_0x95d7c0,'json':!![]};return rp(_0x45b5d4)[_0x9b9e('0x25')](function(_0x6fe63d){var _0x18e135=[];if(_0x6fe63d[_0x9b9e('0xb4')]['length']>0x0){_0x6fe63d[_0x9b9e('0xb4')][_0x9b9e('0xab')](function(_0xb7ad77){if(_0xb7ad77['inactive']==='false'){var _0x16331c={'name':_0xb7ad77[_0x9b9e('0xa5')],'value':_0xb7ad77['value']};_0x18e135['push'](_0x16331c);}});}_0x345e16['options']=_0x18e135;if(_0x345e16[_0x9b9e('0x48')][_0x9b9e('0x37')]>0x0){_0x7fef8c(_0x345e16);}else{if(_0x4d017d==![]){_0x7fef8c();}else{_0x7fef8c(_0x345e16);}}});}});} \ No newline at end of file +var _0x6a63=['resolved_at','caller_id','approval_set','work_notes','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','sys_id','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','GET','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','error','stack','name','send','map','ServicenowAccount','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','show','params','find','catch','body','destroy','getConfigurations','findOne','ServicenowConfiguration','order','options','hasOwnProperty','AccountId','Subjects','channel','create','ServicenowField','Descriptions','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time'];(function(_0x4ac9d5,_0x45c0b7){var _0x567d0c=function(_0x344763){while(--_0x344763){_0x4ac9d5['push'](_0x4ac9d5['shift']());}};_0x567d0c(++_0x45c0b7);}(_0x6a63,0xf4));var _0x36a6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6a63[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36a6('0x0'));var zipdir=require(_0x36a6('0x1'));var jsonpatch=require(_0x36a6('0x2'));var rp=require(_0x36a6('0x3'));var moment=require('moment');var BPromise=require(_0x36a6('0x4'));var Mustache=require('mustache');var util=require(_0x36a6('0x5'));var path=require(_0x36a6('0x6'));var sox=require(_0x36a6('0x7'));var csv=require(_0x36a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36a6('0x9'));var _=require(_0x36a6('0xa'));var squel=require(_0x36a6('0xb'));var crypto=require('crypto');var jsforce=require(_0x36a6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x36a6('0xd'));var Papa=require(_0x36a6('0xe'));var Redis=require(_0x36a6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x36a6('0x10'));var as=require(_0x36a6('0x11'));var hardwareService=require(_0x36a6('0x12'));var logger=require(_0x36a6('0x13'))(_0x36a6('0x14'));var utils=require(_0x36a6('0x15'));var config=require(_0x36a6('0x16'));var licenseUtil=require(_0x36a6('0x17'));var db=require(_0x36a6('0x18'))['db'];var integrations=require(_0x36a6('0x19'));function respondWithStatusCode(_0x4f7df1,_0x54bf17){_0x54bf17=_0x54bf17||0xcc;return function(_0x183f1d){if(_0x183f1d){return _0x4f7df1[_0x36a6('0x1a')](_0x54bf17);}return _0x4f7df1['status'](_0x54bf17)[_0x36a6('0x1b')]();};}function respondWithResult(_0x18ae20,_0x5406ac){_0x5406ac=_0x5406ac||0xc8;return function(_0x41619f){if(_0x41619f){return _0x18ae20[_0x36a6('0x1c')](_0x5406ac)[_0x36a6('0x1d')](_0x41619f);}};}function respondWithFilteredResult(_0x2777dc,_0x451f41){return function(_0x59f122){if(_0x59f122){var _0x38da57=typeof _0x451f41[_0x36a6('0x1e')]===_0x36a6('0x1f')&&typeof _0x451f41[_0x36a6('0x20')]===_0x36a6('0x1f');var _0x4d0027=_0x59f122[_0x36a6('0x21')];var _0x255499=_0x38da57?0x0:_0x451f41[_0x36a6('0x1e')];var _0x34a6c6=_0x38da57?_0x59f122['count']:_0x451f41[_0x36a6('0x1e')]+_0x451f41[_0x36a6('0x20')];var _0x164df0;if(_0x34a6c6>=_0x4d0027){_0x34a6c6=_0x4d0027;_0x164df0=0xc8;}else{_0x164df0=0xce;}_0x2777dc['status'](_0x164df0);return _0x2777dc[_0x36a6('0x22')](_0x36a6('0x23'),_0x255499+'-'+_0x34a6c6+'/'+_0x4d0027)[_0x36a6('0x1d')](_0x59f122);}return null;};}function patchUpdates(_0x4632fc){return function(_0x3fa7c0){try{jsonpatch['apply'](_0x3fa7c0,_0x4632fc,!![]);}catch(_0x40ace9){return BPromise[_0x36a6('0x24')](_0x40ace9);}return _0x3fa7c0['save']();};}function saveUpdates(_0x2531aa,_0x2f0229){return function(_0x3351ca){if(_0x3351ca){return _0x3351ca['update'](_0x2531aa)[_0x36a6('0x25')](function(_0x5078d4){return _0x5078d4;});}return null;};}function removeEntity(_0xb45807,_0x536597){return function(_0x4934a9){if(_0x4934a9){return _0x4934a9['destroy']()['then'](function(){_0xb45807[_0x36a6('0x1c')](0xcc)[_0x36a6('0x1b')]();});}};}function handleEntityNotFound(_0x2abe22,_0x38f0e2){return function(_0x1ecfe2){if(!_0x1ecfe2){_0x2abe22[_0x36a6('0x1a')](0x194);}return _0x1ecfe2;};}function handleError(_0x968817,_0x3ae0ac){_0x3ae0ac=_0x3ae0ac||0x1f4;return function(_0x210f31){logger[_0x36a6('0x26')](_0x210f31[_0x36a6('0x27')]);if(_0x210f31['name']){delete _0x210f31[_0x36a6('0x28')];}_0x968817[_0x36a6('0x1c')](_0x3ae0ac)[_0x36a6('0x29')](_0x210f31);};}exports['index']=function(_0xae56ff,_0x192d06){var _0x248fac={},_0xbdd858={},_0xd16545={'count':0x0,'rows':[]};var _0x274aee=_[_0x36a6('0x2a')](db[_0x36a6('0x2b')][_0x36a6('0x2c')],function(_0x3cd496){return{'name':_0x3cd496['fieldName'],'type':_0x3cd496[_0x36a6('0x2d')]['key']};});_0xbdd858[_0x36a6('0x2e')]=_[_0x36a6('0x2a')](_0x274aee,_0x36a6('0x28'));_0xbdd858[_0x36a6('0x2f')]=_[_0x36a6('0x30')](_0xae56ff[_0x36a6('0x2f')]);_0xbdd858['filters']=_[_0x36a6('0x31')](_0xbdd858[_0x36a6('0x2e')],_0xbdd858[_0x36a6('0x2f')]);_0x248fac[_0x36a6('0x32')]=_[_0x36a6('0x31')](_0xbdd858[_0x36a6('0x2e')],qs[_0x36a6('0x33')](_0xae56ff[_0x36a6('0x2f')][_0x36a6('0x33')]));_0x248fac[_0x36a6('0x32')]=_0x248fac[_0x36a6('0x32')][_0x36a6('0x34')]?_0x248fac[_0x36a6('0x32')]:_0xbdd858[_0x36a6('0x2e')];if(!_0xae56ff[_0x36a6('0x2f')]['hasOwnProperty'](_0x36a6('0x35'))){_0x248fac[_0x36a6('0x20')]=qs[_0x36a6('0x20')](_0xae56ff[_0x36a6('0x2f')][_0x36a6('0x20')]);_0x248fac[_0x36a6('0x1e')]=qs[_0x36a6('0x1e')](_0xae56ff[_0x36a6('0x2f')][_0x36a6('0x1e')]);}_0x248fac['order']=qs[_0x36a6('0x36')](_0xae56ff[_0x36a6('0x2f')][_0x36a6('0x36')]);_0x248fac[_0x36a6('0x37')]=qs[_0x36a6('0x38')](_[_0x36a6('0x39')](_0xae56ff[_0x36a6('0x2f')],_0xbdd858[_0x36a6('0x38')]),_0x274aee);if(_0xae56ff[_0x36a6('0x2f')][_0x36a6('0x3a')]){_0x248fac['where']=_[_0x36a6('0x3b')](_0x248fac['where'],{'$or':_[_0x36a6('0x2a')](_0x274aee,function(_0x3dc7a7){if(_0x3dc7a7[_0x36a6('0x2d')]!=='VIRTUAL'){var _0x1eb5e8={};_0x1eb5e8[_0x3dc7a7[_0x36a6('0x28')]]={'$like':'%'+_0xae56ff[_0x36a6('0x2f')][_0x36a6('0x3a')]+'%'};return _0x1eb5e8;}})});}_0x248fac=_['merge']({},_0x248fac,_0xae56ff['options']);var _0x17e5a3={'where':_0x248fac[_0x36a6('0x37')]};return db[_0x36a6('0x2b')][_0x36a6('0x21')](_0x17e5a3)[_0x36a6('0x25')](function(_0x78e75b){_0xd16545[_0x36a6('0x21')]=_0x78e75b;if(_0xae56ff['query'][_0x36a6('0x3c')]){_0x248fac[_0x36a6('0x3d')]=[{'all':!![]}];}return db[_0x36a6('0x2b')][_0x36a6('0x3e')](_0x248fac);})[_0x36a6('0x25')](function(_0x39a616){_0xd16545[_0x36a6('0x3f')]=_0x39a616;return _0xd16545;})['then'](respondWithFilteredResult(_0x192d06,_0x248fac))['catch'](handleError(_0x192d06,null));};exports[_0x36a6('0x40')]=function(_0x598e68,_0x3b5c4f){var _0xc53b72={'raw':![],'where':{'id':_0x598e68[_0x36a6('0x41')]['id']}},_0x5061c7={};_0x5061c7[_0x36a6('0x2e')]=_[_0x36a6('0x30')](db[_0x36a6('0x2b')][_0x36a6('0x2c')]);_0x5061c7['query']=_['keys'](_0x598e68[_0x36a6('0x2f')]);_0x5061c7[_0x36a6('0x38')]=_[_0x36a6('0x31')](_0x5061c7[_0x36a6('0x2e')],_0x5061c7[_0x36a6('0x2f')]);_0xc53b72[_0x36a6('0x32')]=_[_0x36a6('0x31')](_0x5061c7[_0x36a6('0x2e')],qs[_0x36a6('0x33')](_0x598e68[_0x36a6('0x2f')][_0x36a6('0x33')]));_0xc53b72[_0x36a6('0x32')]=_0xc53b72[_0x36a6('0x32')][_0x36a6('0x34')]?_0xc53b72[_0x36a6('0x32')]:_0x5061c7['model'];if(_0x598e68[_0x36a6('0x2f')][_0x36a6('0x3c')]){_0xc53b72[_0x36a6('0x3d')]=[{'all':!![]}];}_0xc53b72=_['merge']({},_0xc53b72,_0x598e68['options']);return db[_0x36a6('0x2b')][_0x36a6('0x42')](_0xc53b72)[_0x36a6('0x25')](handleEntityNotFound(_0x3b5c4f,null))['then'](respondWithResult(_0x3b5c4f,null))[_0x36a6('0x43')](handleError(_0x3b5c4f,null));};exports['create']=function(_0x46f388,_0x19188e){return db[_0x36a6('0x2b')]['create'](_0x46f388[_0x36a6('0x44')],{})['then'](respondWithResult(_0x19188e,0xc9))[_0x36a6('0x43')](handleError(_0x19188e,null));};exports['update']=function(_0x1894f8,_0x393942){if(_0x1894f8['body']['id']){delete _0x1894f8[_0x36a6('0x44')]['id'];}return db[_0x36a6('0x2b')]['find']({'where':{'id':_0x1894f8[_0x36a6('0x41')]['id']}})[_0x36a6('0x25')](handleEntityNotFound(_0x393942,null))['then'](saveUpdates(_0x1894f8[_0x36a6('0x44')],null))[_0x36a6('0x25')](respondWithResult(_0x393942,null))[_0x36a6('0x43')](handleError(_0x393942,null));};exports[_0x36a6('0x45')]=function(_0x4a4b31,_0x529881){return db[_0x36a6('0x2b')]['find']({'where':{'id':_0x4a4b31[_0x36a6('0x41')]['id']}})[_0x36a6('0x25')](handleEntityNotFound(_0x529881,null))[_0x36a6('0x25')](removeEntity(_0x529881,null))[_0x36a6('0x43')](handleError(_0x529881,null));};exports[_0x36a6('0x46')]=function(_0x321e56,_0xa7948b,_0x188052){var _0x10e3da={};var _0x1852e0={};var _0x11c186;var _0x5757a7;return db[_0x36a6('0x2b')][_0x36a6('0x47')]({'where':{'id':_0x321e56[_0x36a6('0x41')]['id']}})[_0x36a6('0x25')](handleEntityNotFound(_0xa7948b,null))['then'](function(_0x2062b3){if(_0x2062b3){_0x11c186=_0x2062b3;_0x1852e0[_0x36a6('0x2e')]=_[_0x36a6('0x30')](db[_0x36a6('0x48')][_0x36a6('0x2c')]);_0x1852e0[_0x36a6('0x2f')]=_[_0x36a6('0x30')](_0x321e56[_0x36a6('0x2f')]);_0x1852e0[_0x36a6('0x38')]=_[_0x36a6('0x31')](_0x1852e0['model'],_0x1852e0[_0x36a6('0x2f')]);_0x10e3da[_0x36a6('0x32')]=_[_0x36a6('0x31')](_0x1852e0[_0x36a6('0x2e')],qs[_0x36a6('0x33')](_0x321e56[_0x36a6('0x2f')][_0x36a6('0x33')]));_0x10e3da[_0x36a6('0x32')]=_0x10e3da[_0x36a6('0x32')]['length']?_0x10e3da[_0x36a6('0x32')]:_0x1852e0[_0x36a6('0x2e')];_0x10e3da[_0x36a6('0x49')]=qs[_0x36a6('0x36')](_0x321e56[_0x36a6('0x2f')][_0x36a6('0x36')]);_0x10e3da['where']=qs[_0x36a6('0x38')](_[_0x36a6('0x39')](_0x321e56[_0x36a6('0x2f')],_0x1852e0[_0x36a6('0x38')]));if(_0x321e56['query']['filter']){_0x10e3da['where']=_[_0x36a6('0x3b')](_0x10e3da[_0x36a6('0x37')],{'$or':_[_0x36a6('0x2a')](_0x10e3da[_0x36a6('0x32')],function(_0x172890){var _0x349249={};_0x349249[_0x172890]={'$like':'%'+_0x321e56[_0x36a6('0x2f')][_0x36a6('0x3a')]+'%'};return _0x349249;})});}_0x10e3da=_[_0x36a6('0x3b')]({},_0x10e3da,_0x321e56[_0x36a6('0x4a')]);return _0x11c186[_0x36a6('0x46')](_0x10e3da);}})[_0x36a6('0x25')](function(_0x2b598f){if(_0x2b598f){_0x5757a7=_0x2b598f[_0x36a6('0x34')];if(!_0x321e56[_0x36a6('0x2f')][_0x36a6('0x4b')]('nolimit')){_0x10e3da[_0x36a6('0x20')]=qs[_0x36a6('0x20')](_0x321e56[_0x36a6('0x2f')]['limit']);_0x10e3da[_0x36a6('0x1e')]=qs['offset'](_0x321e56[_0x36a6('0x2f')][_0x36a6('0x1e')]);}return _0x11c186[_0x36a6('0x46')](_0x10e3da);}})[_0x36a6('0x25')](function(_0x3b1dd7){if(_0x3b1dd7){return _0x3b1dd7?{'count':_0x5757a7,'rows':_0x3b1dd7}:null;}})['then'](respondWithResult(_0xa7948b,null))[_0x36a6('0x43')](handleError(_0xa7948b,null));};exports['addConfiguration']=function(_0xa8289d,_0x3d85fc,_0x5d2de5){if(_0xa8289d[_0x36a6('0x44')]['id']){delete _0xa8289d[_0x36a6('0x44')]['id'];}return db[_0x36a6('0x2b')][_0x36a6('0x47')]({'where':{'id':_0xa8289d[_0x36a6('0x41')]['id']}})[_0x36a6('0x25')](handleEntityNotFound(_0x3d85fc,null))[_0x36a6('0x25')](function(_0x2636cc){if(_0x2636cc){_0xa8289d[_0x36a6('0x44')][_0x36a6('0x4c')]=_0x2636cc['id'];_0xa8289d[_0x36a6('0x44')][_0x36a6('0x4d')]=integrations['getSubjects'](_0xa8289d['body'][_0x36a6('0x4e')],_0xa8289d['body'][_0x36a6('0x2d')]);_0xa8289d[_0x36a6('0x44')]['Descriptions']=integrations['getDescriptions'](_0xa8289d[_0x36a6('0x44')][_0x36a6('0x4e')],_0xa8289d[_0x36a6('0x44')][_0x36a6('0x2d')]);return db[_0x36a6('0x48')][_0x36a6('0x4f')](_0xa8289d[_0x36a6('0x44')],{'include':[{'model':db[_0x36a6('0x50')],'as':_0x36a6('0x4d')},{'model':db[_0x36a6('0x50')],'as':_0x36a6('0x51')}]});}return null;})[_0x36a6('0x25')](respondWithResult(_0x3d85fc,null))['catch'](handleError(_0x3d85fc,null));};exports['getFields']=function(_0x2e86c4,_0x502f73,_0x8b1598){var _0x561908=[_0x36a6('0x52'),_0x36a6('0x53'),_0x36a6('0x54'),_0x36a6('0x55'),_0x36a6('0x56'),_0x36a6('0x57'),_0x36a6('0x58'),_0x36a6('0x59'),_0x36a6('0x5a')];var _0x2b6317=[_0x36a6('0x5b'),'made_sla',_0x36a6('0x5c'),_0x36a6('0x5d'),_0x36a6('0x5e'),_0x36a6('0x5f'),'child_incidents','hold_reason',_0x36a6('0x60'),_0x36a6('0x61'),_0x36a6('0x62'),_0x36a6('0x63'),_0x36a6('0x64'),'user_input',_0x36a6('0x65'),_0x36a6('0x66'),_0x36a6('0x67'),_0x36a6('0x68'),'knowledge',_0x36a6('0x49'),_0x36a6('0x69'),_0x36a6('0x6a'),_0x36a6('0x6b'),_0x36a6('0x6c'),_0x36a6('0x6d'),_0x36a6('0x6e'),_0x36a6('0x6f'),_0x36a6('0x70'),_0x36a6('0x71'),_0x36a6('0x72'),_0x36a6('0x73'),'time_worked',_0x36a6('0x74'),_0x36a6('0x75'),_0x36a6('0x76'),_0x36a6('0x77'),_0x36a6('0x78'),_0x36a6('0x79'),_0x36a6('0x7a'),_0x36a6('0x7b'),_0x36a6('0x7c'),_0x36a6('0x55'),_0x36a6('0x7d'),'short_description',_0x36a6('0x56'),'correlation_display','delivery_task',_0x36a6('0x7e'),_0x36a6('0x7f'),_0x36a6('0x80'),_0x36a6('0x81'),_0x36a6('0x82'),_0x36a6('0x83'),_0x36a6('0x57'),_0x36a6('0x84'),_0x36a6('0x85'),'closed_by','follow_up','parent_incident',_0x36a6('0x86'),'contact_type',_0x36a6('0x87'),_0x36a6('0x58'),_0x36a6('0x88'),'problem_id',_0x36a6('0x89'),_0x36a6('0x8a'),_0x36a6('0x8b'),_0x36a6('0x8c'),_0x36a6('0x59'),'comments',_0x36a6('0x8d'),_0x36a6('0x8e'),_0x36a6('0x8f'),_0x36a6('0x90'),_0x36a6('0x91'),_0x36a6('0x92'),'sys_tags',_0x36a6('0x93'),_0x36a6('0x94'),_0x36a6('0x95'),'location',_0x36a6('0x5a')];var _0x4bef06='';var _0x315629='';var _0x5bc8a5=[];var _0xbfc992='';var _0x306052='';var _0x13cbba=[];var _0x44abf0='';var _0x524627='';var _0x5b3dd6={};var _0x55d9f3='';return db[_0x36a6('0x2b')]['findOne']({'where':{'id':_0x2e86c4[_0x36a6('0x41')]['id']},'attributes':['id','username',_0x36a6('0x96'),_0x36a6('0x97'),_0x36a6('0x98'),_0x36a6('0x99')]})[_0x36a6('0x25')](handleEntityNotFound(_0x502f73,null))[_0x36a6('0x25')](function(_0x436eda){if(_0x436eda){_0x55d9f3=_0x436eda['remoteUri'];var _0x25245c=_0x55d9f3[_0x36a6('0x9a')](-0x1);if(_0x25245c==='/'){_0x55d9f3=_0x55d9f3[_0x36a6('0x9b')](0x0,_0x55d9f3[_0x36a6('0x9c')](_0x25245c));}_0x524627=util['format'](_0x36a6('0x9d'),_0x55d9f3);_0x44abf0=util[_0x36a6('0x9e')](_0x36a6('0x9f'),_0x55d9f3);_0x5b3dd6={'user':_0x436eda[_0x36a6('0xa0')],'pass':_0x436eda[_0x36a6('0x96')]};var _0x512f5a={'method':_0x36a6('0xa1'),'uri':_0x524627+'incident?sysparm_display_value=all','auth':_0x5b3dd6,'json':!![]};return rp(_0x512f5a);}})[_0x36a6('0x25')](function(_0x3220c6){if(_0x3220c6['result'][_0x36a6('0x34')]>0x0){_0x4bef06=_0x3220c6[_0x36a6('0xa2')];}console['log'](_0x36a6('0xa3'),_0x4bef06);_0x13cbba=[];_0x315629=Object[_0x36a6('0xa4')]([],_0x4bef06);_[_0x36a6('0xa5')](_0x315629,function(_0x14b289){return!_0x561908[_0x36a6('0xa6')](_0x14b289[_0x36a6('0x28')]);});_0x315629[_0x36a6('0xa7')](function(_0x446330){var _0x1c40fe=createFieldObject(_0x44abf0,_0x5b3dd6,_0x446330[_0x36a6('0xa8')],_0x446330['name'],_0x446330['label'],![]);_0x13cbba[_0x36a6('0xa9')](_0x1c40fe);});return Promise[_0x36a6('0xaa')](_0x13cbba);})[_0x36a6('0x25')](function(_0x3f70ff){_0x5bc8a5=_0x3f70ff;_0xbfc992=Object[_0x36a6('0xa4')]([],_0x4bef06);console[_0x36a6('0xab')](_0x36a6('0xac'),_0x4bef06);_[_0x36a6('0xa5')](_0xbfc992,function(_0xd7a9af){return _0x2b6317[_0x36a6('0xa6')](_0xd7a9af[_0x36a6('0x28')]);});console[_0x36a6('0xab')](_0x36a6('0xad'),_0xbfc992);_0x13cbba=[];_0xbfc992['forEach'](function(_0x45ce46){var _0x4fefad=createFieldObject(_0x44abf0,_0x5b3dd6,_0x45ce46[_0x36a6('0xa8')],_0x45ce46[_0x36a6('0x28')],_0x45ce46[_0x36a6('0xae')],!![]);_0x13cbba[_0x36a6('0xa9')](_0x4fefad);});return Promise[_0x36a6('0xaa')](_0x13cbba);})[_0x36a6('0x25')](function(_0x2d102){_0x306052=_0x2d102;var _0x35221c=_0x5bc8a5['concat'](_0x306052);return{'count':_0x35221c[_0x36a6('0x34')],'rows':_0x35221c};})['then'](respondWithResult(_0x502f73,null))[_0x36a6('0x43')](function(_0x370a8a){console['log'](_0x36a6('0xaf')+_0x370a8a);var _0x18dd38=_0x2e86c4[_0x36a6('0x2f')][_0x36a6('0xb0')]?0x1f4:_0x370a8a[_0x36a6('0xb1')]||0x1f4;logger[_0x36a6('0x26')](_0x370a8a[_0x36a6('0x27')]);delete _0x370a8a[_0x36a6('0x28')];if(_0x18dd38===0x191){_0x18dd38=0x190;}_0x502f73[_0x36a6('0x1c')](_0x18dd38)['send'](_0x2e86c4[_0x36a6('0x2f')][_0x36a6('0xb0')]?{'message':_0x36a6('0xb2'),'statusCode':_0x370a8a[_0x36a6('0xb1')]}:_0x370a8a);});};function createFieldObject(_0x37055d,_0x21a158,_0x4f7561,_0x56845e,_0x2d24cc,_0x224bc1){return new Promise(function(_0x5aa7d4,_0x10ff38){var _0x27d600={'id':_0x56845e,'name':_0x2d24cc,'custom':_0x224bc1};if(_0x4f7561==='boolean'){_0x27d600[_0x36a6('0x4a')]=[{'name':_0x36a6('0xb3'),'value':'true'},{'name':'False','value':'false'}];_0x5aa7d4(_0x27d600);}else{var _0x297c34={'method':_0x36a6('0xa1'),'uri':_0x37055d+_0x36a6('0xb4')+_0x56845e,'auth':_0x21a158,'json':!![]};return rp(_0x297c34)[_0x36a6('0x25')](function(_0x4e3891){var _0x3e94eb=[];if(_0x4e3891['result'][_0x36a6('0x34')]>0x0){_0x4e3891['result'][_0x36a6('0xa7')](function(_0x492fc8){if(_0x492fc8[_0x36a6('0xb5')]==='false'){var _0x561358={'name':_0x492fc8[_0x36a6('0xae')],'value':_0x492fc8[_0x36a6('0xb6')]};_0x3e94eb['push'](_0x561358);}});}_0x27d600['options']=_0x3e94eb;if(_0x27d600[_0x36a6('0x4a')][_0x36a6('0x34')]>0x0){_0x5aa7d4(_0x27d600);}else{if(_0x224bc1==![]){_0x5aa7d4();}else{_0x5aa7d4(_0x27d600);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1ed5668..1c4a5cd 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 _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts'];(function(_0x21a534,_0x1f8347){var _0x3b9e98=function(_0x5b1edb){while(--_0x5b1edb){_0x21a534['push'](_0x21a534['shift']());}};_0x3b9e98(++_0x1f8347);}(_0x5fab,0x177));var _0xb5fa=function(_0x26d51f,_0x1de895){_0x26d51f=_0x26d51f-0x0;var _0x48305d=_0x5fab[_0x26d51f];return _0x48305d;};'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'));var integrations=require(_0xb5fa('0xa'));module[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return _0x4a0249[_0xb5fa('0xc')](_0xb5fa('0xd'),attributes,{'tableName':_0xb5fa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x17ab2b,_0x49b916){var _0xd970b1=function(_0x9547ef){while(--_0x9547ef){_0x17ab2b['push'](_0x17ab2b['shift']());}};_0xd970b1(++_0x49b916);}(_0xb138,0x1dd));var _0x8b13=function(_0x309abd,_0x5e28f9){_0x309abd=_0x309abd-0x0;var _0x20e4c0=_0xb138[_0x309abd];return _0x20e4c0;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 3e92b94..4228033 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 _0x5fbb=['find','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowServicenowAccount'];(function(_0xf57e93,_0x459863){var _0x15228b=function(_0x3fcce8){while(--_0x3fcce8){_0xf57e93['push'](_0xf57e93['shift']());}};_0x15228b(++_0x459863);}(_0x5fbb,0x91));var _0xb5fb=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5fbb[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xb5fb('0x0'));var util=require(_0xb5fb('0x1'));var moment=require(_0xb5fb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5fb('0x3'))['db'];var utils=require(_0xb5fb('0x4'));var logger=require(_0xb5fb('0x5'))(_0xb5fb('0x6'));var config=require(_0xb5fb('0x7'));var jayson=require(_0xb5fb('0x8'));var client=jayson['client'][_0xb5fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a8954,_0x378a54,_0x46957a){return new BPromise(function(_0x46fa28,_0x14d5bb){return client[_0xb5fb('0xa')](_0x3a8954,_0x46957a)[_0xb5fb('0xb')](function(_0x101529){logger[_0xb5fb('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x378a54,_0xb5fb('0xd'));logger[_0xb5fb('0xe')](_0xb5fb('0xf'),_0x378a54,'request\x20sent',JSON[_0xb5fb('0x10')](_0x101529));if(_0x101529[_0xb5fb('0x11')]){if(_0x101529[_0xb5fb('0x11')][_0xb5fb('0x12')]===0x1f4){logger[_0xb5fb('0x11')](_0xb5fb('0x13'),_0x378a54,_0x101529['error'][_0xb5fb('0x14')]);return _0x14d5bb(_0x101529[_0xb5fb('0x11')][_0xb5fb('0x14')]);}logger[_0xb5fb('0x11')](_0xb5fb('0x13'),_0x378a54,_0x101529['error'][_0xb5fb('0x14')]);return _0x46fa28(_0x101529[_0xb5fb('0x11')][_0xb5fb('0x14')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x378a54,_0xb5fb('0xd'));_0x46fa28(_0x101529[_0xb5fb('0x15')]['message']);}})[_0xb5fb('0x16')](function(_0x557473){logger[_0xb5fb('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x378a54,_0x557473);_0x14d5bb(_0x557473);});});}exports[_0xb5fb('0x17')]=function(_0x4d9ae3){var _0x40c430=this;return new Promise(function(_0x178c96,_0x48e48f){return db[_0xb5fb('0x18')][_0xb5fb('0x19')]({'raw':_0x4d9ae3['options']?_0x4d9ae3[_0xb5fb('0x1a')][_0xb5fb('0x1b')]===undefined?!![]:![]:!![],'where':_0x4d9ae3[_0xb5fb('0x1a')]?_0x4d9ae3['options'][_0xb5fb('0x1c')]||null:null,'attributes':_0x4d9ae3[_0xb5fb('0x1a')]?_0x4d9ae3[_0xb5fb('0x1a')][_0xb5fb('0x1d')]||null:null,'limit':_0x4d9ae3[_0xb5fb('0x1a')]?_0x4d9ae3['options'][_0xb5fb('0x1e')]||null:null,'include':_0x4d9ae3[_0xb5fb('0x1a')]?_0x4d9ae3[_0xb5fb('0x1a')][_0xb5fb('0x1f')]?_['map'](_0x4d9ae3[_0xb5fb('0x1a')][_0xb5fb('0x1f')],function(_0x1baee0){return{'model':db[_0x1baee0[_0xb5fb('0x20')]],'as':_0x1baee0['as'],'attributes':_0x1baee0[_0xb5fb('0x1d')],'include':_0x1baee0['include']?_[_0xb5fb('0x21')](_0x1baee0['include'],function(_0x236969){return{'model':db[_0x236969[_0xb5fb('0x20')]],'as':_0x236969['as'],'attributes':_0x236969[_0xb5fb('0x1d')],'include':_0x236969[_0xb5fb('0x1f')]?_['map'](_0x236969[_0xb5fb('0x1f')],function(_0x1f2233){return{'model':db[_0x1f2233[_0xb5fb('0x20')]],'as':_0x1f2233['as'],'attributes':_0x1f2233[_0xb5fb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb5fb('0xb')](function(_0x10a033){logger[_0xb5fb('0xc')](_0xb5fb('0x17'),_0x4d9ae3);logger[_0xb5fb('0xe')](_0xb5fb('0x17'),_0x4d9ae3,JSON['stringify'](_0x10a033));_0x178c96(_0x10a033);})['catch'](function(_0x39bc35){logger[_0xb5fb('0x11')](_0xb5fb('0x17'),_0x39bc35[_0xb5fb('0x14')],_0x4d9ae3);_0x48e48f(_0x40c430[_0xb5fb('0x11')](0x1f4,_0x39bc35[_0xb5fb('0x14')]));});});};exports[_0xb5fb('0x22')]=function(_0x4ce2e5){var _0xe6eade=this;return new Promise(function(_0x966c3e,_0x2823bd){return db[_0xb5fb('0x18')][_0xb5fb('0x23')]({'raw':_0x4ce2e5[_0xb5fb('0x1a')]?_0x4ce2e5[_0xb5fb('0x1a')][_0xb5fb('0x1b')]===undefined?!![]:![]:!![],'where':_0x4ce2e5[_0xb5fb('0x1a')]?_0x4ce2e5[_0xb5fb('0x1a')][_0xb5fb('0x1c')]||null:null,'attributes':_0x4ce2e5['options']?_0x4ce2e5[_0xb5fb('0x1a')]['attributes']||null:null,'include':_0x4ce2e5['options']?_0x4ce2e5[_0xb5fb('0x1a')]['include']?_[_0xb5fb('0x21')](_0x4ce2e5[_0xb5fb('0x1a')][_0xb5fb('0x1f')],function(_0x28d322){return{'model':db[_0x28d322[_0xb5fb('0x20')]],'as':_0x28d322['as'],'attributes':_0x28d322[_0xb5fb('0x1d')],'include':_0x28d322[_0xb5fb('0x1f')]?_[_0xb5fb('0x21')](_0x28d322['include'],function(_0x47d8c6){return{'model':db[_0x47d8c6[_0xb5fb('0x20')]],'as':_0x47d8c6['as'],'attributes':_0x47d8c6[_0xb5fb('0x1d')],'include':_0x47d8c6['include']?_[_0xb5fb('0x21')](_0x47d8c6['include'],function(_0xbf8025){return{'model':db[_0xbf8025[_0xb5fb('0x20')]],'as':_0xbf8025['as'],'attributes':_0xbf8025[_0xb5fb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb5fb('0xb')](function(_0x2e7668){logger[_0xb5fb('0xc')](_0xb5fb('0x22'),_0x4ce2e5);logger['debug'](_0xb5fb('0x22'),_0x4ce2e5,JSON[_0xb5fb('0x10')](_0x2e7668));_0x966c3e(_0x2e7668);})['catch'](function(_0x1b0d5c){logger[_0xb5fb('0x11')](_0xb5fb('0x22'),_0x1b0d5c[_0xb5fb('0x14')],_0x4ce2e5);_0x2823bd(_0xe6eade[_0xb5fb('0x11')](0x1f4,_0x1b0d5c[_0xb5fb('0x14')]));});});}; \ No newline at end of file +var _0x8086=['rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetServicenowAccount','findAll','options','raw','attributes','include','model','map','info','debug','ShowServicenowAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1afdc7,_0x4c2858){var _0x13203e=function(_0x2fa915){while(--_0x2fa915){_0x1afdc7['push'](_0x1afdc7['shift']());}};_0x13203e(++_0x4c2858);}(_0x8086,0x1b3));var _0x6808=function(_0x5a98c1,_0x54d90d){_0x5a98c1=_0x5a98c1-0x0;var _0x5384bc=_0x8086[_0x5a98c1];return _0x5384bc;};'use strict';var _=require(_0x6808('0x0'));var util=require(_0x6808('0x1'));var moment=require(_0x6808('0x2'));var BPromise=require(_0x6808('0x3'));var rs=require(_0x6808('0x4'));var fs=require('fs');var Redis=require(_0x6808('0x5'));var db=require(_0x6808('0x6'))['db'];var utils=require(_0x6808('0x7'));var logger=require(_0x6808('0x8'))(_0x6808('0x9'));var config=require(_0x6808('0xa'));var jayson=require(_0x6808('0xb'));var client=jayson[_0x6808('0xc')][_0x6808('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380552,_0x59d535,_0x4f0fdf){return new BPromise(function(_0x4597e2,_0x3ad01b){return client[_0x6808('0xe')](_0x380552,_0x4f0fdf)[_0x6808('0xf')](function(_0x4ad9a2){logger['info'](_0x6808('0x10'),_0x59d535,'request\x20sent');logger['debug'](_0x6808('0x11'),_0x59d535,_0x6808('0x12'),JSON[_0x6808('0x13')](_0x4ad9a2));if(_0x4ad9a2['error']){if(_0x4ad9a2[_0x6808('0x14')][_0x6808('0x15')]===0x1f4){logger[_0x6808('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x59d535,_0x4ad9a2[_0x6808('0x14')]['message']);return _0x3ad01b(_0x4ad9a2['error'][_0x6808('0x16')]);}logger['error'](_0x6808('0x10'),_0x59d535,_0x4ad9a2[_0x6808('0x14')][_0x6808('0x16')]);return _0x4597e2(_0x4ad9a2[_0x6808('0x14')][_0x6808('0x16')]);}else{logger['info'](_0x6808('0x10'),_0x59d535,_0x6808('0x12'));_0x4597e2(_0x4ad9a2['result']['message']);}})[_0x6808('0x17')](function(_0x43b45d){logger[_0x6808('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x59d535,_0x43b45d);_0x3ad01b(_0x43b45d);});});}exports[_0x6808('0x18')]=function(_0x481f42){var _0x315195=this;return new Promise(function(_0x239581,_0x521754){return db['ServicenowAccount'][_0x6808('0x19')]({'raw':_0x481f42[_0x6808('0x1a')]?_0x481f42['options'][_0x6808('0x1b')]===undefined?!![]:![]:!![],'where':_0x481f42[_0x6808('0x1a')]?_0x481f42[_0x6808('0x1a')]['where']||null:null,'attributes':_0x481f42['options']?_0x481f42[_0x6808('0x1a')][_0x6808('0x1c')]||null:null,'limit':_0x481f42[_0x6808('0x1a')]?_0x481f42[_0x6808('0x1a')]['limit']||null:null,'include':_0x481f42['options']?_0x481f42[_0x6808('0x1a')][_0x6808('0x1d')]?_['map'](_0x481f42['options'][_0x6808('0x1d')],function(_0x1e1631){return{'model':db[_0x1e1631[_0x6808('0x1e')]],'as':_0x1e1631['as'],'attributes':_0x1e1631['attributes'],'include':_0x1e1631['include']?_['map'](_0x1e1631[_0x6808('0x1d')],function(_0x2ff0b1){return{'model':db[_0x2ff0b1[_0x6808('0x1e')]],'as':_0x2ff0b1['as'],'attributes':_0x2ff0b1[_0x6808('0x1c')],'include':_0x2ff0b1['include']?_[_0x6808('0x1f')](_0x2ff0b1[_0x6808('0x1d')],function(_0x343a02){return{'model':db[_0x343a02['model']],'as':_0x343a02['as'],'attributes':_0x343a02[_0x6808('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6808('0xf')](function(_0x2d828a){logger[_0x6808('0x20')](_0x6808('0x18'),_0x481f42);logger[_0x6808('0x21')](_0x6808('0x18'),_0x481f42,JSON[_0x6808('0x13')](_0x2d828a));_0x239581(_0x2d828a);})[_0x6808('0x17')](function(_0x4183e2){logger[_0x6808('0x14')](_0x6808('0x18'),_0x4183e2['message'],_0x481f42);_0x521754(_0x315195[_0x6808('0x14')](0x1f4,_0x4183e2[_0x6808('0x16')]));});});};exports[_0x6808('0x22')]=function(_0x4faa44){var _0x1da861=this;return new Promise(function(_0xb17c1f,_0x187aca){return db['ServicenowAccount'][_0x6808('0x23')]({'raw':_0x4faa44['options']?_0x4faa44['options'][_0x6808('0x1b')]===undefined?!![]:![]:!![],'where':_0x4faa44['options']?_0x4faa44[_0x6808('0x1a')][_0x6808('0x24')]||null:null,'attributes':_0x4faa44[_0x6808('0x1a')]?_0x4faa44[_0x6808('0x1a')][_0x6808('0x1c')]||null:null,'include':_0x4faa44[_0x6808('0x1a')]?_0x4faa44[_0x6808('0x1a')][_0x6808('0x1d')]?_[_0x6808('0x1f')](_0x4faa44['options']['include'],function(_0x1aaf18){return{'model':db[_0x1aaf18['model']],'as':_0x1aaf18['as'],'attributes':_0x1aaf18['attributes'],'include':_0x1aaf18[_0x6808('0x1d')]?_[_0x6808('0x1f')](_0x1aaf18[_0x6808('0x1d')],function(_0x4bef16){return{'model':db[_0x4bef16[_0x6808('0x1e')]],'as':_0x4bef16['as'],'attributes':_0x4bef16[_0x6808('0x1c')],'include':_0x4bef16['include']?_[_0x6808('0x1f')](_0x4bef16[_0x6808('0x1d')],function(_0x70f373){return{'model':db[_0x70f373['model']],'as':_0x70f373['as'],'attributes':_0x70f373[_0x6808('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fa7da){logger[_0x6808('0x20')]('ShowServicenowAccount',_0x4faa44);logger[_0x6808('0x21')](_0x6808('0x22'),_0x4faa44,JSON[_0x6808('0x13')](_0x1fa7da));_0xb17c1f(_0x1fa7da);})[_0x6808('0x17')](function(_0x1d28e0){logger['error']('ShowServicenowAccount',_0x1d28e0['message'],_0x4faa44);_0x187aca(_0x1da861[_0x6808('0x14')](0x1f4,_0x1d28e0[_0x6808('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 18a880e..f5e3dd0 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 _0x2abf=['../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','post','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x54e062,_0x34dade){var _0x1e358d=function(_0x37ef75){while(--_0x37ef75){_0x54e062['push'](_0x54e062['shift']());}};_0x1e358d(++_0x34dade);}(_0x2abf,0xa1));var _0xf2ab=function(_0x35846a,_0x3affb1){_0x35846a=_0x35846a-0x0;var _0x1555c1=_0x2abf[_0x35846a];return _0x1555c1;};'use strict';var multer=require('multer');var util=require(_0xf2ab('0x0'));var path=require(_0xf2ab('0x1'));var timeout=require(_0xf2ab('0x2'));var express=require(_0xf2ab('0x3'));var router=express[_0xf2ab('0x4')]();var fs_extra=require(_0xf2ab('0x5'));var auth=require(_0xf2ab('0x6'));var interaction=require(_0xf2ab('0x7'));var config=require(_0xf2ab('0x8'));var controller=require(_0xf2ab('0x9'));router[_0xf2ab('0xa')]('/',auth[_0xf2ab('0xb')](),controller[_0xf2ab('0xc')]);router[_0xf2ab('0xa')]('/:id',auth[_0xf2ab('0xb')](),controller[_0xf2ab('0xd')]);router[_0xf2ab('0xa')]('/:id/fields',auth[_0xf2ab('0xb')](),controller[_0xf2ab('0xe')]);router[_0xf2ab('0xa')](_0xf2ab('0xf'),auth[_0xf2ab('0xb')](),controller[_0xf2ab('0x10')]);router['get']('/:id/descriptions',auth[_0xf2ab('0xb')](),controller['getDescriptions']);router[_0xf2ab('0x11')]('/',auth[_0xf2ab('0xb')](),controller['create']);router[_0xf2ab('0x12')]('/:id',auth[_0xf2ab('0xb')](),controller[_0xf2ab('0x13')]);router[_0xf2ab('0x14')](_0xf2ab('0x15'),auth[_0xf2ab('0xb')](),controller[_0xf2ab('0x16')]);module[_0xf2ab('0x17')]=router; \ No newline at end of file +var _0x0521=['get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','isAuthenticated','update','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0521,0xe0));var _0x1052=function(_0x48ba83,_0x51041d){_0x48ba83=_0x48ba83-0x0;var _0x55aa96=_0x0521[_0x48ba83];return _0x55aa96;};'use strict';var multer=require(_0x1052('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1052('0x1'));var express=require('express');var router=express[_0x1052('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1052('0x3'));var interaction=require(_0x1052('0x4'));var config=require(_0x1052('0x5'));var controller=require(_0x1052('0x6'));router[_0x1052('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1052('0x7')](_0x1052('0x8'),auth['isAuthenticated'](),controller[_0x1052('0x9')]);router[_0x1052('0x7')](_0x1052('0xa'),auth['isAuthenticated'](),controller[_0x1052('0xb')]);router[_0x1052('0x7')](_0x1052('0xc'),auth['isAuthenticated'](),controller[_0x1052('0xd')]);router['get'](_0x1052('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x1052('0xf')]);router[_0x1052('0x10')]('/:id',auth[_0x1052('0x11')](),controller[_0x1052('0x12')]);router['delete']('/:id',auth[_0x1052('0x11')](),controller[_0x1052('0x13')]);module[_0x1052('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a6f5b49..2f6a03e 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 _0x85ec=['sequelize','STRING'];(function(_0x3c8edf,_0x6ef737){var _0x22036e=function(_0x5380ac){while(--_0x5380ac){_0x3c8edf['push'](_0x3c8edf['shift']());}};_0x22036e(++_0x6ef737);}(_0x85ec,0x178));var _0xc85e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85ec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc85e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc85e('0x1')]}}; \ No newline at end of file +var _0x8f3c=['exports','STRING'];(function(_0x2553a3,_0x3e1d99){var _0x1629a3=function(_0xa1d4e9){while(--_0xa1d4e9){_0x2553a3['push'](_0x2553a3['shift']());}};_0x1629a3(++_0x3e1d99);}(_0x8f3c,0xf2));var _0xc8f3=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x8f3c[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require('sequelize');module[_0xc8f3('0x0')]={'name':{'type':Sequelize[_0xc8f3('0x1')]},'description':{'type':Sequelize[_0xc8f3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ee9165b..6220b26 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 _0xb89c=['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','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','getFields','findOne','ServicenowField','length','order','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x4d8b07,_0x3ebf11){var _0x44f2b1=function(_0x50f672){while(--_0x50f672){_0x4d8b07['push'](_0x4d8b07['shift']());}};_0x44f2b1(++_0x3ebf11);}(_0xb89c,0x99));var _0xcb89=function(_0x51ac57,_0xfba35f){_0x51ac57=_0x51ac57-0x0;var _0x3954a5=_0xb89c[_0x51ac57];return _0x3954a5;};'use strict';var emlformat=require(_0xcb89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb89('0x1'));var jsonpatch=require(_0xcb89('0x2'));var rp=require(_0xcb89('0x3'));var moment=require(_0xcb89('0x4'));var BPromise=require(_0xcb89('0x5'));var Mustache=require(_0xcb89('0x6'));var util=require(_0xcb89('0x7'));var path=require(_0xcb89('0x8'));var sox=require(_0xcb89('0x9'));var csv=require(_0xcb89('0xa'));var ejs=require(_0xcb89('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb89('0xc'));var squel=require(_0xcb89('0xd'));var crypto=require(_0xcb89('0xe'));var jsforce=require(_0xcb89('0xf'));var deskjs=require(_0xcb89('0x10'));var toCsv=require(_0xcb89('0xa'));var querystring=require(_0xcb89('0x11'));var Papa=require('papaparse');var Redis=require(_0xcb89('0x12'));var authService=require(_0xcb89('0x13'));var qs=require(_0xcb89('0x14'));var as=require(_0xcb89('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb89('0x16'))(_0xcb89('0x17'));var utils=require(_0xcb89('0x18'));var config=require(_0xcb89('0x19'));var licenseUtil=require(_0xcb89('0x1a'));var db=require(_0xcb89('0x1b'))['db'];function respondWithStatusCode(_0x49855b,_0x289654){_0x289654=_0x289654||0xcc;return function(_0x588653){if(_0x588653){return _0x49855b['sendStatus'](_0x289654);}return _0x49855b[_0xcb89('0x1c')](_0x289654)[_0xcb89('0x1d')]();};}function respondWithResult(_0x1989bf,_0x543fef){_0x543fef=_0x543fef||0xc8;return function(_0x45d166){if(_0x45d166){return _0x1989bf[_0xcb89('0x1c')](_0x543fef)['json'](_0x45d166);}};}function respondWithFilteredResult(_0x146882,_0x2adc2e){return function(_0x294f70){if(_0x294f70){var _0x503e5d=typeof _0x2adc2e[_0xcb89('0x1e')]===_0xcb89('0x1f')&&typeof _0x2adc2e[_0xcb89('0x20')]==='undefined';var _0x1b30ee=_0x294f70[_0xcb89('0x21')];var _0x585f5a=_0x503e5d?0x0:_0x2adc2e[_0xcb89('0x1e')];var _0x20c55d=_0x503e5d?_0x294f70[_0xcb89('0x21')]:_0x2adc2e[_0xcb89('0x1e')]+_0x2adc2e['limit'];var _0x37f826;if(_0x20c55d>=_0x1b30ee){_0x20c55d=_0x1b30ee;_0x37f826=0xc8;}else{_0x37f826=0xce;}_0x146882[_0xcb89('0x1c')](_0x37f826);return _0x146882['set']('Content-Range',_0x585f5a+'-'+_0x20c55d+'/'+_0x1b30ee)[_0xcb89('0x22')](_0x294f70);}return null;};}function patchUpdates(_0x15f8e){return function(_0x5e00ca){try{jsonpatch[_0xcb89('0x23')](_0x5e00ca,_0x15f8e,!![]);}catch(_0x4cd0f1){return BPromise[_0xcb89('0x24')](_0x4cd0f1);}return _0x5e00ca[_0xcb89('0x25')]();};}function saveUpdates(_0x5bd305,_0x5baf74){return function(_0x8fc0fc){if(_0x8fc0fc){return _0x8fc0fc[_0xcb89('0x26')](_0x5bd305)[_0xcb89('0x27')](function(_0x4eef63){return _0x4eef63;});}return null;};}function removeEntity(_0x2629f3,_0x1e6e89){return function(_0x5828f1){if(_0x5828f1){return _0x5828f1[_0xcb89('0x28')]()[_0xcb89('0x27')](function(){_0x2629f3[_0xcb89('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x81d4ce,_0x590aa1){return function(_0x58bb10){if(!_0x58bb10){_0x81d4ce[_0xcb89('0x29')](0x194);}return _0x58bb10;};}function handleError(_0x12e9d4,_0x192415){_0x192415=_0x192415||0x1f4;return function(_0x379347){logger[_0xcb89('0x2a')](_0x379347[_0xcb89('0x2b')]);if(_0x379347[_0xcb89('0x2c')]){delete _0x379347[_0xcb89('0x2c')];}_0x12e9d4[_0xcb89('0x1c')](_0x192415)[_0xcb89('0x2d')](_0x379347);};}exports[_0xcb89('0x2e')]=function(_0x40d746,_0x43fecd){var _0xde2e15={},_0x7fd1fb={},_0xfdaebe={'count':0x0,'rows':[]};var _0x58c1f=_[_0xcb89('0x2f')](db[_0xcb89('0x30')]['rawAttributes'],function(_0x59d15b){return{'name':_0x59d15b[_0xcb89('0x31')],'type':_0x59d15b['type']['key']};});_0x7fd1fb[_0xcb89('0x32')]=_[_0xcb89('0x2f')](_0x58c1f,_0xcb89('0x2c'));_0x7fd1fb[_0xcb89('0x33')]=_[_0xcb89('0x34')](_0x40d746[_0xcb89('0x33')]);_0x7fd1fb[_0xcb89('0x35')]=_['intersection'](_0x7fd1fb[_0xcb89('0x32')],_0x7fd1fb['query']);_0xde2e15[_0xcb89('0x36')]=_[_0xcb89('0x37')](_0x7fd1fb[_0xcb89('0x32')],qs[_0xcb89('0x38')](_0x40d746[_0xcb89('0x33')][_0xcb89('0x38')]));_0xde2e15[_0xcb89('0x36')]=_0xde2e15[_0xcb89('0x36')]['length']?_0xde2e15['attributes']:_0x7fd1fb[_0xcb89('0x32')];if(!_0x40d746[_0xcb89('0x33')][_0xcb89('0x39')]('nolimit')){_0xde2e15[_0xcb89('0x20')]=qs['limit'](_0x40d746[_0xcb89('0x33')][_0xcb89('0x20')]);_0xde2e15[_0xcb89('0x1e')]=qs[_0xcb89('0x1e')](_0x40d746['query'][_0xcb89('0x1e')]);}_0xde2e15['order']=qs[_0xcb89('0x3a')](_0x40d746['query'][_0xcb89('0x3a')]);_0xde2e15[_0xcb89('0x3b')]=qs[_0xcb89('0x35')](_[_0xcb89('0x3c')](_0x40d746['query'],_0x7fd1fb[_0xcb89('0x35')]),_0x58c1f);if(_0x40d746[_0xcb89('0x33')][_0xcb89('0x3d')]){_0xde2e15[_0xcb89('0x3b')]=_[_0xcb89('0x3e')](_0xde2e15[_0xcb89('0x3b')],{'$or':_[_0xcb89('0x2f')](_0x58c1f,function(_0x224d61){if(_0x224d61[_0xcb89('0x3f')]!==_0xcb89('0x40')){var _0x271151={};_0x271151[_0x224d61['name']]={'$like':'%'+_0x40d746['query'][_0xcb89('0x3d')]+'%'};return _0x271151;}})});}_0xde2e15=_[_0xcb89('0x3e')]({},_0xde2e15,_0x40d746[_0xcb89('0x41')]);var _0x4225d0={'where':_0xde2e15['where']};return db['ServicenowConfiguration'][_0xcb89('0x21')](_0x4225d0)['then'](function(_0x1d721c){_0xfdaebe[_0xcb89('0x21')]=_0x1d721c;if(_0x40d746[_0xcb89('0x33')][_0xcb89('0x42')]){_0xde2e15[_0xcb89('0x43')]=[{'all':!![]}];}return db[_0xcb89('0x30')]['findAll'](_0xde2e15);})[_0xcb89('0x27')](function(_0x410b8a){_0xfdaebe[_0xcb89('0x44')]=_0x410b8a;return _0xfdaebe;})[_0xcb89('0x27')](respondWithFilteredResult(_0x43fecd,_0xde2e15))[_0xcb89('0x45')](handleError(_0x43fecd,null));};exports[_0xcb89('0x46')]=function(_0x218c4e,_0x3acdb4){var _0x6dd4d5={'raw':![],'where':{'id':_0x218c4e['params']['id']}},_0x1c91e4={};_0x1c91e4['model']=_[_0xcb89('0x34')](db[_0xcb89('0x30')][_0xcb89('0x47')]);_0x1c91e4[_0xcb89('0x33')]=_['keys'](_0x218c4e[_0xcb89('0x33')]);_0x1c91e4['filters']=_[_0xcb89('0x37')](_0x1c91e4[_0xcb89('0x32')],_0x1c91e4[_0xcb89('0x33')]);_0x6dd4d5[_0xcb89('0x36')]=_[_0xcb89('0x37')](_0x1c91e4[_0xcb89('0x32')],qs[_0xcb89('0x38')](_0x218c4e[_0xcb89('0x33')]['fields']));_0x6dd4d5[_0xcb89('0x36')]=_0x6dd4d5[_0xcb89('0x36')]['length']?_0x6dd4d5['attributes']:_0x1c91e4[_0xcb89('0x32')];if(_0x218c4e['query']['includeAll']){_0x6dd4d5[_0xcb89('0x43')]=[{'all':!![]}];}_0x6dd4d5=_[_0xcb89('0x3e')]({},_0x6dd4d5,_0x218c4e['options']);return db[_0xcb89('0x30')][_0xcb89('0x48')](_0x6dd4d5)[_0xcb89('0x27')](handleEntityNotFound(_0x3acdb4,null))[_0xcb89('0x27')](respondWithResult(_0x3acdb4,null))['catch'](handleError(_0x3acdb4,null));};exports['create']=function(_0x11bb21,_0xf901dd){return db[_0xcb89('0x30')][_0xcb89('0x49')](_0x11bb21[_0xcb89('0x4a')],{})[_0xcb89('0x27')](respondWithResult(_0xf901dd,0xc9))[_0xcb89('0x45')](handleError(_0xf901dd,null));};exports[_0xcb89('0x26')]=function(_0x5c2c24,_0x5a9c21){if(_0x5c2c24[_0xcb89('0x4a')]['id']){delete _0x5c2c24[_0xcb89('0x4a')]['id'];}return db[_0xcb89('0x30')][_0xcb89('0x48')]({'where':{'id':_0x5c2c24[_0xcb89('0x4b')]['id']}})[_0xcb89('0x27')](handleEntityNotFound(_0x5a9c21,null))[_0xcb89('0x27')](saveUpdates(_0x5c2c24[_0xcb89('0x4a')],null))[_0xcb89('0x27')](respondWithResult(_0x5a9c21,null))[_0xcb89('0x45')](handleError(_0x5a9c21,null));};exports[_0xcb89('0x28')]=function(_0x5404b2,_0x18977e){return db['ServicenowConfiguration'][_0xcb89('0x48')]({'where':{'id':_0x5404b2[_0xcb89('0x4b')]['id']}})[_0xcb89('0x27')](handleEntityNotFound(_0x18977e,null))[_0xcb89('0x27')](removeEntity(_0x18977e,null))[_0xcb89('0x45')](handleError(_0x18977e,null));};exports[_0xcb89('0x4c')]=function(_0x1d519f,_0x6a9b76,_0x4c9f49){var _0x2691d5={};var _0x6ce491={};var _0xcab967;var _0x22998f;return db[_0xcb89('0x30')][_0xcb89('0x4d')]({'where':{'id':_0x1d519f[_0xcb89('0x4b')]['id']}})[_0xcb89('0x27')](handleEntityNotFound(_0x6a9b76,null))[_0xcb89('0x27')](function(_0x1cd227){if(_0x1cd227){_0xcab967=_0x1cd227;_0x6ce491[_0xcb89('0x32')]=_[_0xcb89('0x34')](db[_0xcb89('0x4e')][_0xcb89('0x47')]);_0x6ce491[_0xcb89('0x33')]=_[_0xcb89('0x34')](_0x1d519f['query']);_0x6ce491[_0xcb89('0x35')]=_[_0xcb89('0x37')](_0x6ce491[_0xcb89('0x32')],_0x6ce491[_0xcb89('0x33')]);_0x2691d5['attributes']=_[_0xcb89('0x37')](_0x6ce491[_0xcb89('0x32')],qs[_0xcb89('0x38')](_0x1d519f[_0xcb89('0x33')][_0xcb89('0x38')]));_0x2691d5[_0xcb89('0x36')]=_0x2691d5[_0xcb89('0x36')][_0xcb89('0x4f')]?_0x2691d5['attributes']:_0x6ce491[_0xcb89('0x32')];_0x2691d5[_0xcb89('0x50')]=qs[_0xcb89('0x3a')](_0x1d519f[_0xcb89('0x33')][_0xcb89('0x3a')]);_0x2691d5[_0xcb89('0x3b')]=qs[_0xcb89('0x35')](_['pick'](_0x1d519f[_0xcb89('0x33')],_0x6ce491[_0xcb89('0x35')]));if(_0x1d519f['query'][_0xcb89('0x3d')]){_0x2691d5['where']=_[_0xcb89('0x3e')](_0x2691d5[_0xcb89('0x3b')],{'$or':_[_0xcb89('0x2f')](_0x2691d5[_0xcb89('0x36')],function(_0x27186c){var _0x8fd403={};_0x8fd403[_0x27186c]={'$like':'%'+_0x1d519f['query'][_0xcb89('0x3d')]+'%'};return _0x8fd403;})});}_0x2691d5=_[_0xcb89('0x3e')]({},_0x2691d5,_0x1d519f[_0xcb89('0x41')]);return _0xcab967[_0xcb89('0x4c')](_0x2691d5);}})['then'](function(_0x543109){if(_0x543109){_0x22998f=_0x543109[_0xcb89('0x4f')];if(!_0x1d519f[_0xcb89('0x33')][_0xcb89('0x39')](_0xcb89('0x51'))){_0x2691d5[_0xcb89('0x20')]=qs['limit'](_0x1d519f[_0xcb89('0x33')][_0xcb89('0x20')]);_0x2691d5[_0xcb89('0x1e')]=qs[_0xcb89('0x1e')](_0x1d519f[_0xcb89('0x33')]['offset']);}return _0xcab967['getFields'](_0x2691d5);}})[_0xcb89('0x27')](function(_0x4306f4){if(_0x4306f4){return _0x4306f4?{'count':_0x22998f,'rows':_0x4306f4}:null;}})[_0xcb89('0x27')](respondWithResult(_0x6a9b76,null))[_0xcb89('0x45')](handleError(_0x6a9b76,null));};exports[_0xcb89('0x52')]=function(_0x7de84f,_0x3bf329,_0x179c54){var _0x4c9b02={};var _0x215cfd={};var _0x360f1;var _0x22fdb5;return db[_0xcb89('0x30')]['findOne']({'where':{'id':_0x7de84f[_0xcb89('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bf329,null))[_0xcb89('0x27')](function(_0x4e504b){if(_0x4e504b){_0x360f1=_0x4e504b;_0x215cfd['model']=_[_0xcb89('0x34')](db[_0xcb89('0x4e')]['rawAttributes']);_0x215cfd[_0xcb89('0x33')]=_[_0xcb89('0x34')](_0x7de84f['query']);_0x215cfd[_0xcb89('0x35')]=_[_0xcb89('0x37')](_0x215cfd['model'],_0x215cfd[_0xcb89('0x33')]);_0x4c9b02['attributes']=_[_0xcb89('0x37')](_0x215cfd[_0xcb89('0x32')],qs[_0xcb89('0x38')](_0x7de84f[_0xcb89('0x33')]['fields']));_0x4c9b02[_0xcb89('0x36')]=_0x4c9b02[_0xcb89('0x36')][_0xcb89('0x4f')]?_0x4c9b02[_0xcb89('0x36')]:_0x215cfd[_0xcb89('0x32')];_0x4c9b02[_0xcb89('0x50')]=qs['sort'](_0x7de84f[_0xcb89('0x33')][_0xcb89('0x3a')]);_0x4c9b02[_0xcb89('0x3b')]=qs[_0xcb89('0x35')](_[_0xcb89('0x3c')](_0x7de84f[_0xcb89('0x33')],_0x215cfd['filters']));if(_0x7de84f[_0xcb89('0x33')][_0xcb89('0x3d')]){_0x4c9b02['where']=_[_0xcb89('0x3e')](_0x4c9b02[_0xcb89('0x3b')],{'$or':_[_0xcb89('0x2f')](_0x4c9b02[_0xcb89('0x36')],function(_0x4422b2){var _0x52454b={};_0x52454b[_0x4422b2]={'$like':'%'+_0x7de84f[_0xcb89('0x33')]['filter']+'%'};return _0x52454b;})});}_0x4c9b02=_[_0xcb89('0x3e')]({},_0x4c9b02,_0x7de84f[_0xcb89('0x41')]);return _0x360f1['getSubjects'](_0x4c9b02);}})[_0xcb89('0x27')](function(_0x23de56){if(_0x23de56){_0x22fdb5=_0x23de56[_0xcb89('0x4f')];if(!_0x7de84f[_0xcb89('0x33')][_0xcb89('0x39')](_0xcb89('0x51'))){_0x4c9b02[_0xcb89('0x20')]=qs['limit'](_0x7de84f['query'][_0xcb89('0x20')]);_0x4c9b02[_0xcb89('0x1e')]=qs['offset'](_0x7de84f[_0xcb89('0x33')][_0xcb89('0x1e')]);}return _0x360f1['getSubjects'](_0x4c9b02);}})[_0xcb89('0x27')](function(_0xff0d48){if(_0xff0d48){return _0xff0d48?{'count':_0x22fdb5,'rows':_0xff0d48}:null;}})[_0xcb89('0x27')](respondWithResult(_0x3bf329,null))[_0xcb89('0x45')](handleError(_0x3bf329,null));};exports[_0xcb89('0x53')]=function(_0x1a9a92,_0x534e62,_0x24c3b7){var _0x1e6c04={};var _0x5e7a5b={};var _0xec93dd;var _0x1422ca;return db[_0xcb89('0x30')][_0xcb89('0x4d')]({'where':{'id':_0x1a9a92[_0xcb89('0x4b')]['id']}})[_0xcb89('0x27')](handleEntityNotFound(_0x534e62,null))['then'](function(_0x5a83c7){if(_0x5a83c7){_0xec93dd=_0x5a83c7;_0x5e7a5b['model']=_[_0xcb89('0x34')](db[_0xcb89('0x4e')]['rawAttributes']);_0x5e7a5b[_0xcb89('0x33')]=_[_0xcb89('0x34')](_0x1a9a92[_0xcb89('0x33')]);_0x5e7a5b[_0xcb89('0x35')]=_[_0xcb89('0x37')](_0x5e7a5b[_0xcb89('0x32')],_0x5e7a5b[_0xcb89('0x33')]);_0x1e6c04[_0xcb89('0x36')]=_[_0xcb89('0x37')](_0x5e7a5b[_0xcb89('0x32')],qs[_0xcb89('0x38')](_0x1a9a92['query'][_0xcb89('0x38')]));_0x1e6c04[_0xcb89('0x36')]=_0x1e6c04['attributes'][_0xcb89('0x4f')]?_0x1e6c04[_0xcb89('0x36')]:_0x5e7a5b[_0xcb89('0x32')];_0x1e6c04[_0xcb89('0x50')]=qs['sort'](_0x1a9a92['query'][_0xcb89('0x3a')]);_0x1e6c04['where']=qs[_0xcb89('0x35')](_[_0xcb89('0x3c')](_0x1a9a92['query'],_0x5e7a5b[_0xcb89('0x35')]));if(_0x1a9a92[_0xcb89('0x33')][_0xcb89('0x3d')]){_0x1e6c04['where']=_['merge'](_0x1e6c04[_0xcb89('0x3b')],{'$or':_['map'](_0x1e6c04[_0xcb89('0x36')],function(_0x578261){var _0xe40c34={};_0xe40c34[_0x578261]={'$like':'%'+_0x1a9a92[_0xcb89('0x33')][_0xcb89('0x3d')]+'%'};return _0xe40c34;})});}_0x1e6c04=_['merge']({},_0x1e6c04,_0x1a9a92[_0xcb89('0x41')]);return _0xec93dd[_0xcb89('0x53')](_0x1e6c04);}})[_0xcb89('0x27')](function(_0x1f4fec){if(_0x1f4fec){_0x1422ca=_0x1f4fec[_0xcb89('0x4f')];if(!_0x1a9a92[_0xcb89('0x33')][_0xcb89('0x39')](_0xcb89('0x51'))){_0x1e6c04[_0xcb89('0x20')]=qs[_0xcb89('0x20')](_0x1a9a92[_0xcb89('0x33')][_0xcb89('0x20')]);_0x1e6c04[_0xcb89('0x1e')]=qs['offset'](_0x1a9a92[_0xcb89('0x33')][_0xcb89('0x1e')]);}return _0xec93dd[_0xcb89('0x53')](_0x1e6c04);}})['then'](function(_0x1c4c04){if(_0x1c4c04){return _0x1c4c04?{'count':_0x1422ca,'rows':_0x1c4c04}:null;}})[_0xcb89('0x27')](respondWithResult(_0x534e62,null))[_0xcb89('0x45')](handleError(_0x534e62,null));}; \ No newline at end of file +var _0x993d=['ServicenowField','getFields','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','params','includeAll','find','create','body','catch','update'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x993d,0x1f1));var _0xd993=function(_0x25de4c,_0x5c9faa){_0x25de4c=_0x25de4c-0x0;var _0x2bcbc0=_0x993d[_0x25de4c];return _0x2bcbc0;};'use strict';var emlformat=require(_0xd993('0x0'));var rimraf=require(_0xd993('0x1'));var zipdir=require(_0xd993('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd993('0x3'));var moment=require(_0xd993('0x4'));var BPromise=require(_0xd993('0x5'));var Mustache=require(_0xd993('0x6'));var util=require('util');var path=require(_0xd993('0x7'));var sox=require(_0xd993('0x8'));var csv=require(_0xd993('0x9'));var ejs=require(_0xd993('0xa'));var fs=require('fs');var fs_extra=require(_0xd993('0xb'));var _=require(_0xd993('0xc'));var squel=require(_0xd993('0xd'));var crypto=require(_0xd993('0xe'));var jsforce=require(_0xd993('0xf'));var deskjs=require(_0xd993('0x10'));var toCsv=require(_0xd993('0x9'));var querystring=require(_0xd993('0x11'));var Papa=require(_0xd993('0x12'));var Redis=require('ioredis');var authService=require(_0xd993('0x13'));var qs=require(_0xd993('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd993('0x15'));var logger=require(_0xd993('0x16'))(_0xd993('0x17'));var utils=require(_0xd993('0x18'));var config=require(_0xd993('0x19'));var licenseUtil=require(_0xd993('0x1a'));var db=require(_0xd993('0x1b'))['db'];function respondWithStatusCode(_0x465d83,_0x307c3b){_0x307c3b=_0x307c3b||0xcc;return function(_0x20827a){if(_0x20827a){return _0x465d83['sendStatus'](_0x307c3b);}return _0x465d83['status'](_0x307c3b)[_0xd993('0x1c')]();};}function respondWithResult(_0xc284ee,_0x1ecbad){_0x1ecbad=_0x1ecbad||0xc8;return function(_0x570385){if(_0x570385){return _0xc284ee[_0xd993('0x1d')](_0x1ecbad)[_0xd993('0x1e')](_0x570385);}};}function respondWithFilteredResult(_0x1f8e80,_0x2a0be4){return function(_0x13f881){if(_0x13f881){var _0x276a12=typeof _0x2a0be4[_0xd993('0x1f')]===_0xd993('0x20')&&typeof _0x2a0be4[_0xd993('0x21')]===_0xd993('0x20');var _0x3163f3=_0x13f881[_0xd993('0x22')];var _0x462205=_0x276a12?0x0:_0x2a0be4[_0xd993('0x1f')];var _0x21b57f=_0x276a12?_0x13f881[_0xd993('0x22')]:_0x2a0be4[_0xd993('0x1f')]+_0x2a0be4[_0xd993('0x21')];var _0x445ab7;if(_0x21b57f>=_0x3163f3){_0x21b57f=_0x3163f3;_0x445ab7=0xc8;}else{_0x445ab7=0xce;}_0x1f8e80[_0xd993('0x1d')](_0x445ab7);return _0x1f8e80['set']('Content-Range',_0x462205+'-'+_0x21b57f+'/'+_0x3163f3)[_0xd993('0x1e')](_0x13f881);}return null;};}function patchUpdates(_0x2b5716){return function(_0x25b198){try{jsonpatch[_0xd993('0x23')](_0x25b198,_0x2b5716,!![]);}catch(_0x2f7d0a){return BPromise[_0xd993('0x24')](_0x2f7d0a);}return _0x25b198[_0xd993('0x25')]();};}function saveUpdates(_0xc60c09,_0x35e981){return function(_0x45636d){if(_0x45636d){return _0x45636d['update'](_0xc60c09)[_0xd993('0x26')](function(_0x4418f3){return _0x4418f3;});}return null;};}function removeEntity(_0x15b2d9,_0x23f269){return function(_0x44b431){if(_0x44b431){return _0x44b431[_0xd993('0x27')]()[_0xd993('0x26')](function(){_0x15b2d9[_0xd993('0x1d')](0xcc)[_0xd993('0x1c')]();});}};}function handleEntityNotFound(_0x34fa5b,_0xaedbba){return function(_0x40bccd){if(!_0x40bccd){_0x34fa5b[_0xd993('0x28')](0x194);}return _0x40bccd;};}function handleError(_0x1ab5b7,_0x5e01fb){_0x5e01fb=_0x5e01fb||0x1f4;return function(_0x48d64e){logger[_0xd993('0x29')](_0x48d64e[_0xd993('0x2a')]);if(_0x48d64e[_0xd993('0x2b')]){delete _0x48d64e[_0xd993('0x2b')];}_0x1ab5b7[_0xd993('0x1d')](_0x5e01fb)[_0xd993('0x2c')](_0x48d64e);};}exports[_0xd993('0x2d')]=function(_0x3a00ac,_0x551605){var _0x518c7d={},_0x5db71d={},_0x2d6ff6={'count':0x0,'rows':[]};var _0x4bea00=_[_0xd993('0x2e')](db[_0xd993('0x2f')][_0xd993('0x30')],function(_0x4c9afa){return{'name':_0x4c9afa['fieldName'],'type':_0x4c9afa[_0xd993('0x31')]['key']};});_0x5db71d[_0xd993('0x32')]=_['map'](_0x4bea00,_0xd993('0x2b'));_0x5db71d[_0xd993('0x33')]=_[_0xd993('0x34')](_0x3a00ac[_0xd993('0x33')]);_0x5db71d['filters']=_[_0xd993('0x35')](_0x5db71d['model'],_0x5db71d[_0xd993('0x33')]);_0x518c7d[_0xd993('0x36')]=_[_0xd993('0x35')](_0x5db71d[_0xd993('0x32')],qs[_0xd993('0x37')](_0x3a00ac[_0xd993('0x33')][_0xd993('0x37')]));_0x518c7d[_0xd993('0x36')]=_0x518c7d[_0xd993('0x36')][_0xd993('0x38')]?_0x518c7d[_0xd993('0x36')]:_0x5db71d[_0xd993('0x32')];if(!_0x3a00ac[_0xd993('0x33')][_0xd993('0x39')](_0xd993('0x3a'))){_0x518c7d['limit']=qs[_0xd993('0x21')](_0x3a00ac['query'][_0xd993('0x21')]);_0x518c7d[_0xd993('0x1f')]=qs[_0xd993('0x1f')](_0x3a00ac[_0xd993('0x33')][_0xd993('0x1f')]);}_0x518c7d[_0xd993('0x3b')]=qs[_0xd993('0x3c')](_0x3a00ac[_0xd993('0x33')]['sort']);_0x518c7d[_0xd993('0x3d')]=qs[_0xd993('0x3e')](_[_0xd993('0x3f')](_0x3a00ac['query'],_0x5db71d[_0xd993('0x3e')]),_0x4bea00);if(_0x3a00ac[_0xd993('0x33')][_0xd993('0x40')]){_0x518c7d['where']=_[_0xd993('0x41')](_0x518c7d['where'],{'$or':_[_0xd993('0x2e')](_0x4bea00,function(_0x5f4dd1){if(_0x5f4dd1[_0xd993('0x31')]!==_0xd993('0x42')){var _0x2cfdeb={};_0x2cfdeb[_0x5f4dd1['name']]={'$like':'%'+_0x3a00ac[_0xd993('0x33')]['filter']+'%'};return _0x2cfdeb;}})});}_0x518c7d=_[_0xd993('0x41')]({},_0x518c7d,_0x3a00ac[_0xd993('0x43')]);var _0x2019fa={'where':_0x518c7d[_0xd993('0x3d')]};return db['ServicenowConfiguration'][_0xd993('0x22')](_0x2019fa)[_0xd993('0x26')](function(_0x1912c2){_0x2d6ff6['count']=_0x1912c2;if(_0x3a00ac[_0xd993('0x33')]['includeAll']){_0x518c7d[_0xd993('0x44')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x518c7d);})[_0xd993('0x26')](function(_0x9cd35a){_0x2d6ff6['rows']=_0x9cd35a;return _0x2d6ff6;})[_0xd993('0x26')](respondWithFilteredResult(_0x551605,_0x518c7d))['catch'](handleError(_0x551605,null));};exports[_0xd993('0x45')]=function(_0x99e7b9,_0x5936ec){var _0x5b9b43={'raw':![],'where':{'id':_0x99e7b9[_0xd993('0x46')]['id']}},_0xbe4149={};_0xbe4149[_0xd993('0x32')]=_[_0xd993('0x34')](db['ServicenowConfiguration']['rawAttributes']);_0xbe4149[_0xd993('0x33')]=_[_0xd993('0x34')](_0x99e7b9['query']);_0xbe4149[_0xd993('0x3e')]=_[_0xd993('0x35')](_0xbe4149['model'],_0xbe4149[_0xd993('0x33')]);_0x5b9b43[_0xd993('0x36')]=_[_0xd993('0x35')](_0xbe4149[_0xd993('0x32')],qs[_0xd993('0x37')](_0x99e7b9[_0xd993('0x33')][_0xd993('0x37')]));_0x5b9b43['attributes']=_0x5b9b43[_0xd993('0x36')][_0xd993('0x38')]?_0x5b9b43[_0xd993('0x36')]:_0xbe4149['model'];if(_0x99e7b9['query'][_0xd993('0x47')]){_0x5b9b43[_0xd993('0x44')]=[{'all':!![]}];}_0x5b9b43=_[_0xd993('0x41')]({},_0x5b9b43,_0x99e7b9['options']);return db['ServicenowConfiguration'][_0xd993('0x48')](_0x5b9b43)[_0xd993('0x26')](handleEntityNotFound(_0x5936ec,null))[_0xd993('0x26')](respondWithResult(_0x5936ec,null))['catch'](handleError(_0x5936ec,null));};exports[_0xd993('0x49')]=function(_0x2bb3f4,_0x579bca){return db[_0xd993('0x2f')]['create'](_0x2bb3f4[_0xd993('0x4a')],{})[_0xd993('0x26')](respondWithResult(_0x579bca,0xc9))[_0xd993('0x4b')](handleError(_0x579bca,null));};exports[_0xd993('0x4c')]=function(_0x14e23d,_0x465cf9){if(_0x14e23d[_0xd993('0x4a')]['id']){delete _0x14e23d[_0xd993('0x4a')]['id'];}return db['ServicenowConfiguration'][_0xd993('0x48')]({'where':{'id':_0x14e23d[_0xd993('0x46')]['id']}})['then'](handleEntityNotFound(_0x465cf9,null))['then'](saveUpdates(_0x14e23d[_0xd993('0x4a')],null))['then'](respondWithResult(_0x465cf9,null))[_0xd993('0x4b')](handleError(_0x465cf9,null));};exports['destroy']=function(_0x42c395,_0x276fe6){return db[_0xd993('0x2f')][_0xd993('0x48')]({'where':{'id':_0x42c395[_0xd993('0x46')]['id']}})[_0xd993('0x26')](handleEntityNotFound(_0x276fe6,null))[_0xd993('0x26')](removeEntity(_0x276fe6,null))[_0xd993('0x4b')](handleError(_0x276fe6,null));};exports['getFields']=function(_0x32e7bb,_0x59a135,_0x4bf1a0){var _0x47bcf7={};var _0xc840f4={};var _0x63dd12;var _0x3b5891;return db[_0xd993('0x2f')]['findOne']({'where':{'id':_0x32e7bb[_0xd993('0x46')]['id']}})[_0xd993('0x26')](handleEntityNotFound(_0x59a135,null))[_0xd993('0x26')](function(_0x3cce97){if(_0x3cce97){_0x63dd12=_0x3cce97;_0xc840f4[_0xd993('0x32')]=_[_0xd993('0x34')](db[_0xd993('0x4d')][_0xd993('0x30')]);_0xc840f4[_0xd993('0x33')]=_[_0xd993('0x34')](_0x32e7bb[_0xd993('0x33')]);_0xc840f4['filters']=_[_0xd993('0x35')](_0xc840f4['model'],_0xc840f4[_0xd993('0x33')]);_0x47bcf7['attributes']=_[_0xd993('0x35')](_0xc840f4[_0xd993('0x32')],qs[_0xd993('0x37')](_0x32e7bb['query'][_0xd993('0x37')]));_0x47bcf7[_0xd993('0x36')]=_0x47bcf7['attributes']['length']?_0x47bcf7[_0xd993('0x36')]:_0xc840f4['model'];_0x47bcf7['order']=qs[_0xd993('0x3c')](_0x32e7bb[_0xd993('0x33')][_0xd993('0x3c')]);_0x47bcf7[_0xd993('0x3d')]=qs['filters'](_[_0xd993('0x3f')](_0x32e7bb[_0xd993('0x33')],_0xc840f4[_0xd993('0x3e')]));if(_0x32e7bb[_0xd993('0x33')][_0xd993('0x40')]){_0x47bcf7[_0xd993('0x3d')]=_[_0xd993('0x41')](_0x47bcf7[_0xd993('0x3d')],{'$or':_[_0xd993('0x2e')](_0x47bcf7[_0xd993('0x36')],function(_0x4615a7){var _0x17bb04={};_0x17bb04[_0x4615a7]={'$like':'%'+_0x32e7bb[_0xd993('0x33')][_0xd993('0x40')]+'%'};return _0x17bb04;})});}_0x47bcf7=_[_0xd993('0x41')]({},_0x47bcf7,_0x32e7bb[_0xd993('0x43')]);return _0x63dd12[_0xd993('0x4e')](_0x47bcf7);}})[_0xd993('0x26')](function(_0x2f2aa8){if(_0x2f2aa8){_0x3b5891=_0x2f2aa8[_0xd993('0x38')];if(!_0x32e7bb[_0xd993('0x33')][_0xd993('0x39')](_0xd993('0x3a'))){_0x47bcf7[_0xd993('0x21')]=qs[_0xd993('0x21')](_0x32e7bb[_0xd993('0x33')]['limit']);_0x47bcf7[_0xd993('0x1f')]=qs[_0xd993('0x1f')](_0x32e7bb[_0xd993('0x33')]['offset']);}return _0x63dd12[_0xd993('0x4e')](_0x47bcf7);}})[_0xd993('0x26')](function(_0x59b2dd){if(_0x59b2dd){return _0x59b2dd?{'count':_0x3b5891,'rows':_0x59b2dd}:null;}})[_0xd993('0x26')](respondWithResult(_0x59a135,null))[_0xd993('0x4b')](handleError(_0x59a135,null));};exports['getSubjects']=function(_0x4df6a9,_0x173e84,_0xb6fc91){var _0x4de33f={};var _0x331999={};var _0x43c85c;var _0x40c65a;return db['ServicenowConfiguration'][_0xd993('0x4f')]({'where':{'id':_0x4df6a9['params']['id']}})[_0xd993('0x26')](handleEntityNotFound(_0x173e84,null))[_0xd993('0x26')](function(_0x199a93){if(_0x199a93){_0x43c85c=_0x199a93;_0x331999[_0xd993('0x32')]=_[_0xd993('0x34')](db[_0xd993('0x4d')][_0xd993('0x30')]);_0x331999[_0xd993('0x33')]=_[_0xd993('0x34')](_0x4df6a9[_0xd993('0x33')]);_0x331999[_0xd993('0x3e')]=_[_0xd993('0x35')](_0x331999[_0xd993('0x32')],_0x331999[_0xd993('0x33')]);_0x4de33f[_0xd993('0x36')]=_['intersection'](_0x331999[_0xd993('0x32')],qs[_0xd993('0x37')](_0x4df6a9['query'][_0xd993('0x37')]));_0x4de33f[_0xd993('0x36')]=_0x4de33f['attributes'][_0xd993('0x38')]?_0x4de33f['attributes']:_0x331999[_0xd993('0x32')];_0x4de33f[_0xd993('0x3b')]=qs[_0xd993('0x3c')](_0x4df6a9['query'][_0xd993('0x3c')]);_0x4de33f['where']=qs['filters'](_['pick'](_0x4df6a9['query'],_0x331999['filters']));if(_0x4df6a9[_0xd993('0x33')][_0xd993('0x40')]){_0x4de33f[_0xd993('0x3d')]=_[_0xd993('0x41')](_0x4de33f[_0xd993('0x3d')],{'$or':_['map'](_0x4de33f[_0xd993('0x36')],function(_0x203358){var _0x18c0a6={};_0x18c0a6[_0x203358]={'$like':'%'+_0x4df6a9[_0xd993('0x33')][_0xd993('0x40')]+'%'};return _0x18c0a6;})});}_0x4de33f=_[_0xd993('0x41')]({},_0x4de33f,_0x4df6a9[_0xd993('0x43')]);return _0x43c85c[_0xd993('0x50')](_0x4de33f);}})[_0xd993('0x26')](function(_0x6aa6e5){if(_0x6aa6e5){_0x40c65a=_0x6aa6e5[_0xd993('0x38')];if(!_0x4df6a9[_0xd993('0x33')]['hasOwnProperty'](_0xd993('0x3a'))){_0x4de33f[_0xd993('0x21')]=qs[_0xd993('0x21')](_0x4df6a9['query'][_0xd993('0x21')]);_0x4de33f[_0xd993('0x1f')]=qs[_0xd993('0x1f')](_0x4df6a9[_0xd993('0x33')]['offset']);}return _0x43c85c['getSubjects'](_0x4de33f);}})['then'](function(_0x682170){if(_0x682170){return _0x682170?{'count':_0x40c65a,'rows':_0x682170}:null;}})[_0xd993('0x26')](respondWithResult(_0x173e84,null))['catch'](handleError(_0x173e84,null));};exports[_0xd993('0x51')]=function(_0x1ce876,_0xb38d9b,_0x54ad3f){var _0x21a65d={};var _0x5db3d6={};var _0x54d47c;var _0x427046;return db[_0xd993('0x2f')]['findOne']({'where':{'id':_0x1ce876[_0xd993('0x46')]['id']}})[_0xd993('0x26')](handleEntityNotFound(_0xb38d9b,null))['then'](function(_0x3401a3){if(_0x3401a3){_0x54d47c=_0x3401a3;_0x5db3d6['model']=_[_0xd993('0x34')](db[_0xd993('0x4d')]['rawAttributes']);_0x5db3d6[_0xd993('0x33')]=_[_0xd993('0x34')](_0x1ce876[_0xd993('0x33')]);_0x5db3d6[_0xd993('0x3e')]=_[_0xd993('0x35')](_0x5db3d6[_0xd993('0x32')],_0x5db3d6[_0xd993('0x33')]);_0x21a65d['attributes']=_[_0xd993('0x35')](_0x5db3d6['model'],qs[_0xd993('0x37')](_0x1ce876['query']['fields']));_0x21a65d[_0xd993('0x36')]=_0x21a65d[_0xd993('0x36')][_0xd993('0x38')]?_0x21a65d['attributes']:_0x5db3d6[_0xd993('0x32')];_0x21a65d[_0xd993('0x3b')]=qs[_0xd993('0x3c')](_0x1ce876['query']['sort']);_0x21a65d[_0xd993('0x3d')]=qs[_0xd993('0x3e')](_[_0xd993('0x3f')](_0x1ce876[_0xd993('0x33')],_0x5db3d6['filters']));if(_0x1ce876[_0xd993('0x33')]['filter']){_0x21a65d['where']=_[_0xd993('0x41')](_0x21a65d[_0xd993('0x3d')],{'$or':_[_0xd993('0x2e')](_0x21a65d[_0xd993('0x36')],function(_0x451ecc){var _0x1db689={};_0x1db689[_0x451ecc]={'$like':'%'+_0x1ce876[_0xd993('0x33')][_0xd993('0x40')]+'%'};return _0x1db689;})});}_0x21a65d=_[_0xd993('0x41')]({},_0x21a65d,_0x1ce876[_0xd993('0x43')]);return _0x54d47c[_0xd993('0x51')](_0x21a65d);}})[_0xd993('0x26')](function(_0x2b598e){if(_0x2b598e){_0x427046=_0x2b598e['length'];if(!_0x1ce876[_0xd993('0x33')][_0xd993('0x39')]('nolimit')){_0x21a65d[_0xd993('0x21')]=qs['limit'](_0x1ce876[_0xd993('0x33')][_0xd993('0x21')]);_0x21a65d[_0xd993('0x1f')]=qs[_0xd993('0x1f')](_0x1ce876[_0xd993('0x33')][_0xd993('0x1f')]);}return _0x54d47c[_0xd993('0x51')](_0x21a65d);}})[_0xd993('0x26')](function(_0x2b06ea){if(_0x2b06ea){return _0x2b06ea?{'count':_0x427046,'rows':_0x2b06ea}:null;}})['then'](respondWithResult(_0xb38d9b,null))[_0xd993('0x4b')](handleError(_0xb38d9b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index d240752..5723162 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 _0x6017=['../../config/environment','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x3cdcc9,_0x2e4e95){var _0xce1597=function(_0x57a31f){while(--_0x57a31f){_0x3cdcc9['push'](_0x3cdcc9['shift']());}};_0xce1597(++_0x2e4e95);}(_0x6017,0xae));var _0x7601=function(_0x7b9dfc,_0x563df0){_0x7b9dfc=_0x7b9dfc-0x0;var _0x34390f=_0x6017[_0x7b9dfc];return _0x34390f;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var logger=require(_0x7601('0x2'))('api');var moment=require(_0x7601('0x3'));var BPromise=require(_0x7601('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7601('0x5'));var rimraf=require('rimraf');var config=require(_0x7601('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x425bf9,_0xc62b2c){return _0x425bf9[_0x7601('0x7')](_0x7601('0x8'),attributes,{'tableName':_0x7601('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88c7=['api','moment','path','rimraf','./intServicenowConfiguration.attributes','exports','define','lodash'];(function(_0x304c47,_0x4e0e20){var _0x2dbd2c=function(_0x4f7049){while(--_0x4f7049){_0x304c47['push'](_0x304c47['shift']());}};_0x2dbd2c(++_0x4e0e20);}(_0x88c7,0x6f));var _0x788c=function(_0x45b16e,_0x44e0df){_0x45b16e=_0x45b16e-0x0;var _0x585208=_0x88c7[_0x45b16e];return _0x585208;};'use strict';var _=require(_0x788c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x788c('0x1'));var moment=require(_0x788c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x788c('0x3'));var rimraf=require(_0x788c('0x4'));var config=require('../../config/environment');var attributes=require(_0x788c('0x5'));module[_0x788c('0x6')]=function(_0x4e6f8b,_0xbde9d1){return _0x4e6f8b[_0x788c('0x7')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','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 92bfe61..69020b1 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 _0xab61=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x310509,_0x53beb4){var _0x252c23=function(_0x431542){while(--_0x431542){_0x310509['push'](_0x310509['shift']());}};_0x252c23(++_0x53beb4);}(_0xab61,0x179));var _0x1ab6=function(_0x59e1fa,_0x1dace6){_0x59e1fa=_0x59e1fa-0x0;var _0xd6366d=_0xab61[_0x59e1fa];return _0xd6366d;};'use strict';var _=require(_0x1ab6('0x0'));var util=require(_0x1ab6('0x1'));var moment=require(_0x1ab6('0x2'));var BPromise=require(_0x1ab6('0x3'));var rs=require(_0x1ab6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ab6('0x5'))['db'];var utils=require(_0x1ab6('0x6'));var logger=require(_0x1ab6('0x7'))('rpc');var config=require(_0x1ab6('0x8'));var jayson=require(_0x1ab6('0x9'));var client=jayson['client'][_0x1ab6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x203620,_0x5ab5ca,_0x5e642b){return new BPromise(function(_0x1afffa,_0x2e9760){return client['request'](_0x203620,_0x5e642b)[_0x1ab6('0xb')](function(_0x3f396f){logger['info'](_0x1ab6('0xc'),_0x5ab5ca,_0x1ab6('0xd'));logger[_0x1ab6('0xe')](_0x1ab6('0xf'),_0x5ab5ca,'request\x20sent',JSON[_0x1ab6('0x10')](_0x3f396f));if(_0x3f396f[_0x1ab6('0x11')]){if(_0x3f396f[_0x1ab6('0x11')][_0x1ab6('0x12')]===0x1f4){logger[_0x1ab6('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5ab5ca,_0x3f396f[_0x1ab6('0x11')][_0x1ab6('0x13')]);return _0x2e9760(_0x3f396f[_0x1ab6('0x11')]['message']);}logger['error'](_0x1ab6('0xc'),_0x5ab5ca,_0x3f396f['error'][_0x1ab6('0x13')]);return _0x1afffa(_0x3f396f[_0x1ab6('0x11')][_0x1ab6('0x13')]);}else{logger['info'](_0x1ab6('0xc'),_0x5ab5ca,_0x1ab6('0xd'));_0x1afffa(_0x3f396f[_0x1ab6('0x14')][_0x1ab6('0x13')]);}})[_0x1ab6('0x15')](function(_0x35e3ae){logger[_0x1ab6('0x11')](_0x1ab6('0xc'),_0x5ab5ca,_0x35e3ae);_0x2e9760(_0x35e3ae);});});} \ No newline at end of file +var _0x140b=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','ServicenowConfiguration,\x20%s,\x20%s','message','result'];(function(_0x4ecf9,_0x1bfb4b){var _0x4c3fdf=function(_0x5bc1db){while(--_0x5bc1db){_0x4ecf9['push'](_0x4ecf9['shift']());}};_0x4c3fdf(++_0x1bfb4b);}(_0x140b,0x6f));var _0xb140=function(_0x163306,_0x10674c){_0x163306=_0x163306-0x0;var _0x401be1=_0x140b[_0x163306];return _0x401be1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb140('0x0'));var BPromise=require('bluebird');var rs=require(_0xb140('0x1'));var fs=require('fs');var Redis=require(_0xb140('0x2'));var db=require(_0xb140('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb140('0x4'))(_0xb140('0x5'));var config=require(_0xb140('0x6'));var jayson=require(_0xb140('0x7'));var client=jayson[_0xb140('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe5c500,_0x166cf5,_0x2c9702){return new BPromise(function(_0x367779,_0x375bf7){return client[_0xb140('0x9')](_0xe5c500,_0x2c9702)[_0xb140('0xa')](function(_0x305e73){logger[_0xb140('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x166cf5,_0xb140('0xc'));logger[_0xb140('0xd')](_0xb140('0xe'),_0x166cf5,'request\x20sent',JSON[_0xb140('0xf')](_0x305e73));if(_0x305e73['error']){if(_0x305e73['error'][_0xb140('0x10')]===0x1f4){logger[_0xb140('0x11')](_0xb140('0x12'),_0x166cf5,_0x305e73[_0xb140('0x11')][_0xb140('0x13')]);return _0x375bf7(_0x305e73['error'][_0xb140('0x13')]);}logger[_0xb140('0x11')](_0xb140('0x12'),_0x166cf5,_0x305e73[_0xb140('0x11')][_0xb140('0x13')]);return _0x367779(_0x305e73[_0xb140('0x11')]['message']);}else{logger[_0xb140('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x166cf5,'request\x20sent');_0x367779(_0x305e73[_0xb140('0x14')]['message']);}})[_0xb140('0x15')](function(_0x4a17ec){logger['error'](_0xb140('0x12'),_0x166cf5,_0x4a17ec);_0x375bf7(_0x4a17ec);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index d4aae42..b1e59d4 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 _0xf9eb=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0xc62705,_0x106fb9){var _0x4c5806=function(_0x2fedcf){while(--_0x2fedcf){_0xc62705['push'](_0xc62705['shift']());}};_0x4c5806(++_0x106fb9);}(_0xf9eb,0xa4));var _0xbf9e=function(_0x40534b,_0x55ea2d){_0x40534b=_0x40534b-0x0;var _0x497ef3=_0xf9eb[_0x40534b];return _0x497ef3;};'use strict';var multer=require(_0xbf9e('0x0'));var util=require('util');var path=require(_0xbf9e('0x1'));var timeout=require(_0xbf9e('0x2'));var express=require(_0xbf9e('0x3'));var router=express['Router']();var fs_extra=require(_0xbf9e('0x4'));var auth=require(_0xbf9e('0x5'));var interaction=require(_0xbf9e('0x6'));var config=require(_0xbf9e('0x7'));var controller=require(_0xbf9e('0x8'));router[_0xbf9e('0x9')]('/',auth[_0xbf9e('0xa')](),controller[_0xbf9e('0xb')]);router[_0xbf9e('0x9')](_0xbf9e('0xc'),auth[_0xbf9e('0xa')](),controller[_0xbf9e('0xd')]);router['post']('/',auth[_0xbf9e('0xa')](),controller[_0xbf9e('0xe')]);router[_0xbf9e('0xf')](_0xbf9e('0xc'),auth[_0xbf9e('0xa')](),controller[_0xbf9e('0x10')]);router[_0xbf9e('0x11')](_0xbf9e('0xc'),auth[_0xbf9e('0xa')](),controller[_0xbf9e('0x12')]);module[_0xbf9e('0x13')]=router; \ No newline at end of file +var _0xb1ac=['create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x4b37b7,_0x203932){var _0x332eb3=function(_0x15b083){while(--_0x15b083){_0x4b37b7['push'](_0x4b37b7['shift']());}};_0x332eb3(++_0x203932);}(_0xb1ac,0x6b));var _0xcb1a=function(_0x485922,_0x1aa325){_0x485922=_0x485922-0x0;var _0xd58674=_0xb1ac[_0x485922];return _0xd58674;};'use strict';var multer=require(_0xcb1a('0x0'));var util=require(_0xcb1a('0x1'));var path=require(_0xcb1a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcb1a('0x3')]();var fs_extra=require(_0xcb1a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb1a('0x5'));var config=require(_0xcb1a('0x6'));var controller=require('./intServicenowField.controller');router[_0xcb1a('0x7')]('/',auth[_0xcb1a('0x8')](),controller[_0xcb1a('0x9')]);router[_0xcb1a('0x7')](_0xcb1a('0xa'),auth['isAuthenticated'](),controller[_0xcb1a('0xb')]);router['post']('/',auth[_0xcb1a('0x8')](),controller[_0xcb1a('0xc')]);router[_0xcb1a('0xd')](_0xcb1a('0xa'),auth[_0xcb1a('0x8')](),controller['update']);router[_0xcb1a('0xe')](_0xcb1a('0xa'),auth[_0xcb1a('0x8')](),controller[_0xcb1a('0xf')]);module[_0xcb1a('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 27dc64a..6e363f2 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 _0x7730=['keyValue','picklist','STRING','sequelize','ENUM','string','variable','customVariable'];(function(_0x46fcb5,_0x16f00b){var _0x514de3=function(_0x1df7bd){while(--_0x1df7bd){_0x46fcb5['push'](_0x46fcb5['shift']());}};_0x514de3(++_0x16f00b);}(_0x7730,0xd3));var _0x0773=function(_0x34a6e9,_0x25cabe){_0x34a6e9=_0x34a6e9-0x0;var _0x11015c=_0x7730[_0x34a6e9];return _0x11015c;};'use strict';var Sequelize=require(_0x0773('0x0'));module['exports']={'type':{'type':Sequelize[_0x0773('0x1')](_0x0773('0x2'),_0x0773('0x3'),_0x0773('0x4'),_0x0773('0x5'),_0x0773('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0773('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0773('0x1')](_0x0773('0x2'),_0x0773('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0773('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0773('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0773('0x7')]}}; \ No newline at end of file +var _0xe66d=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x1fd6f4,_0x4b8481){var _0x32b7f1=function(_0x4c2dd1){while(--_0x4c2dd1){_0x1fd6f4['push'](_0x1fd6f4['shift']());}};_0x32b7f1(++_0x4b8481);}(_0xe66d,0x1ea));var _0xde66=function(_0x16a7bc,_0x3ee4fb){_0x16a7bc=_0x16a7bc-0x0;var _0x54e51d=_0xe66d[_0x16a7bc];return _0x54e51d;};'use strict';var Sequelize=require('sequelize');module[_0xde66('0x0')]={'type':{'type':Sequelize[_0xde66('0x1')](_0xde66('0x2'),_0xde66('0x3'),_0xde66('0x4'),_0xde66('0x5'),_0xde66('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xde66('0x2'),_0xde66('0x3'),_0xde66('0x4'))},'keyContent':{'type':Sequelize[_0xde66('0x7')]},'idField':{'type':Sequelize[_0xde66('0x7')]},'nameField':{'type':Sequelize[_0xde66('0x7')]},'customField':{'type':Sequelize[_0xde66('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xde66('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 90ae670..e1a6fb5 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 _0x06e1=['keys','catch','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','name','index','map','ServicenowField','rawAttributes','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params'];(function(_0x23e5fa,_0x4ec2d8){var _0x567b46=function(_0x3d03cd){while(--_0x3d03cd){_0x23e5fa['push'](_0x23e5fa['shift']());}};_0x567b46(++_0x4ec2d8);}(_0x06e1,0xda));var _0x106e=function(_0x3e8b1a,_0x3218da){_0x3e8b1a=_0x3e8b1a-0x0;var _0x3b640d=_0x06e1[_0x3e8b1a];return _0x3b640d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x106e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x106e('0x1'));var rp=require(_0x106e('0x2'));var moment=require(_0x106e('0x3'));var BPromise=require(_0x106e('0x4'));var Mustache=require(_0x106e('0x5'));var util=require(_0x106e('0x6'));var path=require(_0x106e('0x7'));var sox=require(_0x106e('0x8'));var csv=require(_0x106e('0x9'));var ejs=require(_0x106e('0xa'));var fs=require('fs');var fs_extra=require(_0x106e('0xb'));var _=require('lodash');var squel=require(_0x106e('0xc'));var crypto=require('crypto');var jsforce=require(_0x106e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x106e('0x9'));var querystring=require('querystring');var Papa=require(_0x106e('0xe'));var Redis=require(_0x106e('0xf'));var authService=require(_0x106e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x106e('0x11'));var hardwareService=require(_0x106e('0x12'));var logger=require('../../config/logger')(_0x106e('0x13'));var utils=require(_0x106e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x106e('0x15'));var db=require(_0x106e('0x16'))['db'];function respondWithStatusCode(_0x2cef4c,_0x30c6bc){_0x30c6bc=_0x30c6bc||0xcc;return function(_0x191594){if(_0x191594){return _0x2cef4c['sendStatus'](_0x30c6bc);}return _0x2cef4c[_0x106e('0x17')](_0x30c6bc)[_0x106e('0x18')]();};}function respondWithResult(_0x4b6f25,_0x585f7c){_0x585f7c=_0x585f7c||0xc8;return function(_0x30ba70){if(_0x30ba70){return _0x4b6f25['status'](_0x585f7c)[_0x106e('0x19')](_0x30ba70);}};}function respondWithFilteredResult(_0x3fc3a7,_0x53de0d){return function(_0x346b92){if(_0x346b92){var _0xc63cbb=typeof _0x53de0d[_0x106e('0x1a')]===_0x106e('0x1b')&&typeof _0x53de0d[_0x106e('0x1c')]===_0x106e('0x1b');var _0x5dce97=_0x346b92[_0x106e('0x1d')];var _0x506851=_0xc63cbb?0x0:_0x53de0d[_0x106e('0x1a')];var _0x206e1=_0xc63cbb?_0x346b92[_0x106e('0x1d')]:_0x53de0d[_0x106e('0x1a')]+_0x53de0d[_0x106e('0x1c')];var _0x389ea6;if(_0x206e1>=_0x5dce97){_0x206e1=_0x5dce97;_0x389ea6=0xc8;}else{_0x389ea6=0xce;}_0x3fc3a7[_0x106e('0x17')](_0x389ea6);return _0x3fc3a7[_0x106e('0x1e')](_0x106e('0x1f'),_0x506851+'-'+_0x206e1+'/'+_0x5dce97)[_0x106e('0x19')](_0x346b92);}return null;};}function patchUpdates(_0x2d48fd){return function(_0x53d64d){try{jsonpatch[_0x106e('0x20')](_0x53d64d,_0x2d48fd,!![]);}catch(_0x7d8d21){return BPromise['reject'](_0x7d8d21);}return _0x53d64d['save']();};}function saveUpdates(_0x24c21a,_0x15a30a){return function(_0x5273d0){if(_0x5273d0){return _0x5273d0[_0x106e('0x21')](_0x24c21a)[_0x106e('0x22')](function(_0x23150a){return _0x23150a;});}return null;};}function removeEntity(_0x550e96,_0x2e4433){return function(_0x2c7446){if(_0x2c7446){return _0x2c7446[_0x106e('0x23')]()['then'](function(){_0x550e96[_0x106e('0x17')](0xcc)[_0x106e('0x18')]();});}};}function handleEntityNotFound(_0x6e38b6,_0xab8cf9){return function(_0x19466e){if(!_0x19466e){_0x6e38b6[_0x106e('0x24')](0x194);}return _0x19466e;};}function handleError(_0x1cfc74,_0x2406a6){_0x2406a6=_0x2406a6||0x1f4;return function(_0x509ee0){logger['error'](_0x509ee0['stack']);if(_0x509ee0[_0x106e('0x25')]){delete _0x509ee0[_0x106e('0x25')];}_0x1cfc74[_0x106e('0x17')](_0x2406a6)['send'](_0x509ee0);};}exports[_0x106e('0x26')]=function(_0x5b42ed,_0x20492e){var _0x2a037f={},_0x1a296c={},_0x130135={'count':0x0,'rows':[]};var _0x8b0ada=_[_0x106e('0x27')](db[_0x106e('0x28')][_0x106e('0x29')],function(_0x50d26f){return{'name':_0x50d26f['fieldName'],'type':_0x50d26f['type'][_0x106e('0x2a')]};});_0x1a296c[_0x106e('0x2b')]=_['map'](_0x8b0ada,'name');_0x1a296c[_0x106e('0x2c')]=_['keys'](_0x5b42ed[_0x106e('0x2c')]);_0x1a296c['filters']=_[_0x106e('0x2d')](_0x1a296c[_0x106e('0x2b')],_0x1a296c['query']);_0x2a037f['attributes']=_[_0x106e('0x2d')](_0x1a296c[_0x106e('0x2b')],qs[_0x106e('0x2e')](_0x5b42ed['query'][_0x106e('0x2e')]));_0x2a037f[_0x106e('0x2f')]=_0x2a037f[_0x106e('0x2f')][_0x106e('0x30')]?_0x2a037f[_0x106e('0x2f')]:_0x1a296c['model'];if(!_0x5b42ed[_0x106e('0x2c')]['hasOwnProperty'](_0x106e('0x31'))){_0x2a037f[_0x106e('0x1c')]=qs[_0x106e('0x1c')](_0x5b42ed[_0x106e('0x2c')][_0x106e('0x1c')]);_0x2a037f[_0x106e('0x1a')]=qs[_0x106e('0x1a')](_0x5b42ed[_0x106e('0x2c')][_0x106e('0x1a')]);}_0x2a037f[_0x106e('0x32')]=qs['sort'](_0x5b42ed[_0x106e('0x2c')][_0x106e('0x33')]);_0x2a037f[_0x106e('0x34')]=qs['filters'](_[_0x106e('0x35')](_0x5b42ed[_0x106e('0x2c')],_0x1a296c[_0x106e('0x36')]),_0x8b0ada);if(_0x5b42ed[_0x106e('0x2c')][_0x106e('0x37')]){_0x2a037f[_0x106e('0x34')]=_['merge'](_0x2a037f[_0x106e('0x34')],{'$or':_[_0x106e('0x27')](_0x8b0ada,function(_0x3cb975){if(_0x3cb975[_0x106e('0x38')]!==_0x106e('0x39')){var _0x33f8dd={};_0x33f8dd[_0x3cb975[_0x106e('0x25')]]={'$like':'%'+_0x5b42ed[_0x106e('0x2c')][_0x106e('0x37')]+'%'};return _0x33f8dd;}})});}_0x2a037f=_[_0x106e('0x3a')]({},_0x2a037f,_0x5b42ed[_0x106e('0x3b')]);var _0x572466={'where':_0x2a037f[_0x106e('0x34')]};return db[_0x106e('0x28')][_0x106e('0x1d')](_0x572466)[_0x106e('0x22')](function(_0x17185a){_0x130135[_0x106e('0x1d')]=_0x17185a;if(_0x5b42ed[_0x106e('0x2c')][_0x106e('0x3c')]){_0x2a037f[_0x106e('0x3d')]=[{'all':!![]}];}return db[_0x106e('0x28')][_0x106e('0x3e')](_0x2a037f);})[_0x106e('0x22')](function(_0x451e54){_0x130135[_0x106e('0x3f')]=_0x451e54;return _0x130135;})[_0x106e('0x22')](respondWithFilteredResult(_0x20492e,_0x2a037f))['catch'](handleError(_0x20492e,null));};exports[_0x106e('0x40')]=function(_0x548d06,_0x42a7ae){var _0x3ed1bc={'raw':!![],'where':{'id':_0x548d06[_0x106e('0x41')]['id']}},_0x483867={};_0x483867[_0x106e('0x2b')]=_[_0x106e('0x42')](db[_0x106e('0x28')][_0x106e('0x29')]);_0x483867[_0x106e('0x2c')]=_[_0x106e('0x42')](_0x548d06['query']);_0x483867[_0x106e('0x36')]=_['intersection'](_0x483867[_0x106e('0x2b')],_0x483867[_0x106e('0x2c')]);_0x3ed1bc[_0x106e('0x2f')]=_[_0x106e('0x2d')](_0x483867[_0x106e('0x2b')],qs['fields'](_0x548d06[_0x106e('0x2c')][_0x106e('0x2e')]));_0x3ed1bc[_0x106e('0x2f')]=_0x3ed1bc[_0x106e('0x2f')]['length']?_0x3ed1bc[_0x106e('0x2f')]:_0x483867[_0x106e('0x2b')];if(_0x548d06[_0x106e('0x2c')][_0x106e('0x3c')]){_0x3ed1bc['include']=[{'all':!![]}];}_0x3ed1bc=_['merge']({},_0x3ed1bc,_0x548d06[_0x106e('0x3b')]);return db['ServicenowField']['find'](_0x3ed1bc)[_0x106e('0x22')](handleEntityNotFound(_0x42a7ae,null))[_0x106e('0x22')](respondWithResult(_0x42a7ae,null))[_0x106e('0x43')](handleError(_0x42a7ae,null));};exports['create']=function(_0x5f3f35,_0x45f469){return db[_0x106e('0x28')][_0x106e('0x44')](_0x5f3f35['body'],{})[_0x106e('0x22')](respondWithResult(_0x45f469,0xc9))[_0x106e('0x43')](handleError(_0x45f469,null));};exports[_0x106e('0x21')]=function(_0x52d038,_0x574587){if(_0x52d038[_0x106e('0x45')]['id']){delete _0x52d038[_0x106e('0x45')]['id'];}return db[_0x106e('0x28')][_0x106e('0x46')]({'where':{'id':_0x52d038[_0x106e('0x41')]['id']}})['then'](handleEntityNotFound(_0x574587,null))[_0x106e('0x22')](saveUpdates(_0x52d038['body'],null))[_0x106e('0x22')](respondWithResult(_0x574587,null))['catch'](handleError(_0x574587,null));};exports[_0x106e('0x23')]=function(_0xe9cb5e,_0x2bc2d1){return db[_0x106e('0x28')][_0x106e('0x46')]({'where':{'id':_0xe9cb5e['params']['id']}})[_0x106e('0x22')](handleEntityNotFound(_0x2bc2d1,null))[_0x106e('0x22')](removeEntity(_0x2bc2d1,null))[_0x106e('0x43')](handleError(_0x2bc2d1,null));}; \ No newline at end of file +var _0x3d03=['map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','ServicenowField','includeAll','include','findAll','rows','show','params','intersection','merge','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','util','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','name','send','index'];(function(_0xdaf2cc,_0x21434b){var _0x1c5e61=function(_0x23a186){while(--_0x23a186){_0xdaf2cc['push'](_0xdaf2cc['shift']());}};_0x1c5e61(++_0x21434b);}(_0x3d03,0xea));var _0x33d0=function(_0x3f96f0,_0xa755cc){_0x3f96f0=_0x3f96f0-0x0;var _0x338019=_0x3d03[_0x3f96f0];return _0x338019;};'use strict';var emlformat=require(_0x33d0('0x0'));var rimraf=require(_0x33d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33d0('0x2'));var rp=require(_0x33d0('0x3'));var moment=require(_0x33d0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x33d0('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x33d0('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33d0('0x7'));var squel=require(_0x33d0('0x8'));var crypto=require(_0x33d0('0x9'));var jsforce=require(_0x33d0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x33d0('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x33d0('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x33d0('0xd'));var hardwareService=require(_0x33d0('0xe'));var logger=require('../../config/logger')(_0x33d0('0xf'));var utils=require('../../config/utils');var config=require(_0x33d0('0x10'));var licenseUtil=require(_0x33d0('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf1ee63,_0x5bae2d){_0x5bae2d=_0x5bae2d||0xcc;return function(_0x305fc0){if(_0x305fc0){return _0xf1ee63[_0x33d0('0x12')](_0x5bae2d);}return _0xf1ee63['status'](_0x5bae2d)['end']();};}function respondWithResult(_0x32b913,_0x165bd6){_0x165bd6=_0x165bd6||0xc8;return function(_0x3ffd8d){if(_0x3ffd8d){return _0x32b913[_0x33d0('0x13')](_0x165bd6)[_0x33d0('0x14')](_0x3ffd8d);}};}function respondWithFilteredResult(_0x3a60e5,_0x4ea080){return function(_0xb8223e){if(_0xb8223e){var _0x182a52=typeof _0x4ea080['offset']==='undefined'&&typeof _0x4ea080[_0x33d0('0x15')]===_0x33d0('0x16');var _0x33dc48=_0xb8223e[_0x33d0('0x17')];var _0x22da91=_0x182a52?0x0:_0x4ea080[_0x33d0('0x18')];var _0x2fcb85=_0x182a52?_0xb8223e[_0x33d0('0x17')]:_0x4ea080['offset']+_0x4ea080[_0x33d0('0x15')];var _0x3873b7;if(_0x2fcb85>=_0x33dc48){_0x2fcb85=_0x33dc48;_0x3873b7=0xc8;}else{_0x3873b7=0xce;}_0x3a60e5[_0x33d0('0x13')](_0x3873b7);return _0x3a60e5[_0x33d0('0x19')](_0x33d0('0x1a'),_0x22da91+'-'+_0x2fcb85+'/'+_0x33dc48)['json'](_0xb8223e);}return null;};}function patchUpdates(_0x2ab82e){return function(_0x3ef738){try{jsonpatch[_0x33d0('0x1b')](_0x3ef738,_0x2ab82e,!![]);}catch(_0x4e5a17){return BPromise[_0x33d0('0x1c')](_0x4e5a17);}return _0x3ef738[_0x33d0('0x1d')]();};}function saveUpdates(_0x4666b8,_0x232a92){return function(_0x5bbf0a){if(_0x5bbf0a){return _0x5bbf0a['update'](_0x4666b8)['then'](function(_0x27aff6){return _0x27aff6;});}return null;};}function removeEntity(_0xddcd77,_0x1c2eb9){return function(_0x318625){if(_0x318625){return _0x318625['destroy']()[_0x33d0('0x1e')](function(){_0xddcd77[_0x33d0('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb1dd3b,_0x42d550){return function(_0x3e5587){if(!_0x3e5587){_0xb1dd3b['sendStatus'](0x194);}return _0x3e5587;};}function handleError(_0x2333ed,_0x4fddd6){_0x4fddd6=_0x4fddd6||0x1f4;return function(_0x160af4){logger['error'](_0x160af4['stack']);if(_0x160af4[_0x33d0('0x1f')]){delete _0x160af4[_0x33d0('0x1f')];}_0x2333ed[_0x33d0('0x13')](_0x4fddd6)[_0x33d0('0x20')](_0x160af4);};}exports[_0x33d0('0x21')]=function(_0x41a020,_0x42ccf8){var _0x13147b={},_0x17e51f={},_0x255cb6={'count':0x0,'rows':[]};var _0x521928=_[_0x33d0('0x22')](db['ServicenowField'][_0x33d0('0x23')],function(_0x25cbf3){return{'name':_0x25cbf3[_0x33d0('0x24')],'type':_0x25cbf3[_0x33d0('0x25')][_0x33d0('0x26')]};});_0x17e51f['model']=_[_0x33d0('0x22')](_0x521928,_0x33d0('0x1f'));_0x17e51f[_0x33d0('0x27')]=_[_0x33d0('0x28')](_0x41a020[_0x33d0('0x27')]);_0x17e51f[_0x33d0('0x29')]=_['intersection'](_0x17e51f[_0x33d0('0x2a')],_0x17e51f[_0x33d0('0x27')]);_0x13147b[_0x33d0('0x2b')]=_['intersection'](_0x17e51f['model'],qs[_0x33d0('0x2c')](_0x41a020[_0x33d0('0x27')][_0x33d0('0x2c')]));_0x13147b[_0x33d0('0x2b')]=_0x13147b[_0x33d0('0x2b')]['length']?_0x13147b[_0x33d0('0x2b')]:_0x17e51f[_0x33d0('0x2a')];if(!_0x41a020[_0x33d0('0x27')][_0x33d0('0x2d')](_0x33d0('0x2e'))){_0x13147b[_0x33d0('0x15')]=qs['limit'](_0x41a020['query'][_0x33d0('0x15')]);_0x13147b[_0x33d0('0x18')]=qs[_0x33d0('0x18')](_0x41a020[_0x33d0('0x27')][_0x33d0('0x18')]);}_0x13147b[_0x33d0('0x2f')]=qs['sort'](_0x41a020[_0x33d0('0x27')][_0x33d0('0x30')]);_0x13147b[_0x33d0('0x31')]=qs[_0x33d0('0x29')](_['pick'](_0x41a020[_0x33d0('0x27')],_0x17e51f[_0x33d0('0x29')]),_0x521928);if(_0x41a020['query'][_0x33d0('0x32')]){_0x13147b[_0x33d0('0x31')]=_['merge'](_0x13147b[_0x33d0('0x31')],{'$or':_[_0x33d0('0x22')](_0x521928,function(_0x316c8e){if(_0x316c8e[_0x33d0('0x25')]!==_0x33d0('0x33')){var _0x2b4baa={};_0x2b4baa[_0x316c8e[_0x33d0('0x1f')]]={'$like':'%'+_0x41a020[_0x33d0('0x27')][_0x33d0('0x32')]+'%'};return _0x2b4baa;}})});}_0x13147b=_['merge']({},_0x13147b,_0x41a020[_0x33d0('0x34')]);var _0x13a800={'where':_0x13147b[_0x33d0('0x31')]};return db[_0x33d0('0x35')][_0x33d0('0x17')](_0x13a800)['then'](function(_0x3adec1){_0x255cb6[_0x33d0('0x17')]=_0x3adec1;if(_0x41a020[_0x33d0('0x27')][_0x33d0('0x36')]){_0x13147b[_0x33d0('0x37')]=[{'all':!![]}];}return db[_0x33d0('0x35')][_0x33d0('0x38')](_0x13147b);})['then'](function(_0xd509d0){_0x255cb6[_0x33d0('0x39')]=_0xd509d0;return _0x255cb6;})[_0x33d0('0x1e')](respondWithFilteredResult(_0x42ccf8,_0x13147b))['catch'](handleError(_0x42ccf8,null));};exports[_0x33d0('0x3a')]=function(_0x2b4839,_0x2b9050){var _0x1ce1fb={'raw':!![],'where':{'id':_0x2b4839[_0x33d0('0x3b')]['id']}},_0x5cc8e0={};_0x5cc8e0[_0x33d0('0x2a')]=_[_0x33d0('0x28')](db[_0x33d0('0x35')]['rawAttributes']);_0x5cc8e0[_0x33d0('0x27')]=_[_0x33d0('0x28')](_0x2b4839['query']);_0x5cc8e0[_0x33d0('0x29')]=_[_0x33d0('0x3c')](_0x5cc8e0[_0x33d0('0x2a')],_0x5cc8e0[_0x33d0('0x27')]);_0x1ce1fb['attributes']=_[_0x33d0('0x3c')](_0x5cc8e0['model'],qs[_0x33d0('0x2c')](_0x2b4839['query'][_0x33d0('0x2c')]));_0x1ce1fb[_0x33d0('0x2b')]=_0x1ce1fb[_0x33d0('0x2b')]['length']?_0x1ce1fb['attributes']:_0x5cc8e0[_0x33d0('0x2a')];if(_0x2b4839[_0x33d0('0x27')][_0x33d0('0x36')]){_0x1ce1fb[_0x33d0('0x37')]=[{'all':!![]}];}_0x1ce1fb=_[_0x33d0('0x3d')]({},_0x1ce1fb,_0x2b4839[_0x33d0('0x34')]);return db[_0x33d0('0x35')][_0x33d0('0x3e')](_0x1ce1fb)[_0x33d0('0x1e')](handleEntityNotFound(_0x2b9050,null))[_0x33d0('0x1e')](respondWithResult(_0x2b9050,null))[_0x33d0('0x3f')](handleError(_0x2b9050,null));};exports[_0x33d0('0x40')]=function(_0x4e3675,_0x2db450){return db['ServicenowField'][_0x33d0('0x40')](_0x4e3675[_0x33d0('0x41')],{})['then'](respondWithResult(_0x2db450,0xc9))['catch'](handleError(_0x2db450,null));};exports[_0x33d0('0x42')]=function(_0x125064,_0x4c4e09){if(_0x125064[_0x33d0('0x41')]['id']){delete _0x125064[_0x33d0('0x41')]['id'];}return db[_0x33d0('0x35')]['find']({'where':{'id':_0x125064[_0x33d0('0x3b')]['id']}})[_0x33d0('0x1e')](handleEntityNotFound(_0x4c4e09,null))[_0x33d0('0x1e')](saveUpdates(_0x125064[_0x33d0('0x41')],null))[_0x33d0('0x1e')](respondWithResult(_0x4c4e09,null))[_0x33d0('0x3f')](handleError(_0x4c4e09,null));};exports['destroy']=function(_0x3aa2de,_0x2998e1){return db['ServicenowField'][_0x33d0('0x3e')]({'where':{'id':_0x3aa2de[_0x33d0('0x3b')]['id']}})[_0x33d0('0x1e')](handleEntityNotFound(_0x2998e1,null))[_0x33d0('0x1e')](removeEntity(_0x2998e1,null))['catch'](handleError(_0x2998e1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 686ea5d..dcad92c 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 _0xdbb3=['rimraf','../../config/environment','./intServicenowField.attributes','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x50ad3a,_0x4ff290){var _0xb0700a=function(_0xe84627){while(--_0xe84627){_0x50ad3a['push'](_0x50ad3a['shift']());}};_0xb0700a(++_0x4ff290);}(_0xdbb3,0xbd));var _0x3dbb=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xdbb3[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x3dbb('0x0'));var util=require(_0x3dbb('0x1'));var logger=require(_0x3dbb('0x2'))(_0x3dbb('0x3'));var moment=require(_0x3dbb('0x4'));var BPromise=require(_0x3dbb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3dbb('0x6'));var config=require(_0x3dbb('0x7'));var attributes=require(_0x3dbb('0x8'));module['exports']=function(_0x3abe7a,_0x347303){return _0x3abe7a['define'](_0x3dbb('0x9'),attributes,{'tableName':_0x3dbb('0xa'),'paranoid':![],'indexes':[{'name':_0x3dbb('0xb'),'fields':[_0x3dbb('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x19fa=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x19fa,0x195));var _0xa19f=function(_0x2baa87,_0x28cbb4){_0x2baa87=_0x2baa87-0x0;var _0x5323c9=_0x19fa[_0x2baa87];return _0x5323c9;};'use strict';var _=require(_0xa19f('0x0'));var util=require(_0xa19f('0x1'));var logger=require(_0xa19f('0x2'))(_0xa19f('0x3'));var moment=require(_0xa19f('0x4'));var BPromise=require(_0xa19f('0x5'));var rp=require(_0xa19f('0x6'));var fs=require('fs');var path=require(_0xa19f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa19f('0x8'));module[_0xa19f('0x9')]=function(_0x36f3d4,_0x1e7c51){return _0x36f3d4[_0xa19f('0xa')](_0xa19f('0xb'),attributes,{'tableName':_0xa19f('0xc'),'paranoid':![],'indexes':[{'name':_0xa19f('0xd'),'fields':['idField',_0xa19f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 2871939..d01d9d6 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5c7af5,_0x3ba0eb){_0x5c7af5=_0x5c7af5-0x0;var _0x4ad4a0=_0xf4eb[_0x5c7af5];return _0x4ad4a0;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_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 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 diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index fee7b3b..77788ec 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(_0x79b4a9,_0xd07856){var _0x9d4543=function(_0x37dda4){while(--_0x37dda4){_0x79b4a9['push'](_0x79b4a9['shift']());}};_0x9d4543(++_0xd07856);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3baa02,_0x196d2f){var _0x51d482=function(_0x22697f){while(--_0x22697f){_0x3baa02['push'](_0x3baa02['shift']());}};_0x51d482(++_0x196d2f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 1ed96a8..464dcb5 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(_0x2b93ef,_0x5d9fab){var _0x2e1262=function(_0x502e5f){while(--_0x502e5f){_0x2b93ef['push'](_0x2b93ef['shift']());}};_0x2e1262(++_0x5d9fab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x3b617e,_0x4a55e7){var _0x92e73=function(_0x2b6034){while(--_0x2b6034){_0x3b617e['push'](_0x3b617e['shift']());}};_0x92e73(++_0x4a55e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 0d4dc43..435b0af 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 _0xef60=['Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','module_fields','remove','includes','label','values','getFields,\x20%s,\x20%s,\x20%s','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','rows','params','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','pick','hasOwnProperty','nolimit','AccountId'];(function(_0x51461b,_0x32ad42){var _0x1a66c4=function(_0x291777){while(--_0x291777){_0x51461b['push'](_0x51461b['shift']());}};_0x1a66c4(++_0x32ad42);}(_0xef60,0xa0));var _0x0ef6=function(_0x46ebbf,_0x436dd9){_0x46ebbf=_0x46ebbf-0x0;var _0x2633b9=_0xef60[_0x46ebbf];return _0x2633b9;};'use strict';var emlformat=require(_0x0ef6('0x0'));var rimraf=require(_0x0ef6('0x1'));var zipdir=require(_0x0ef6('0x2'));var jsonpatch=require(_0x0ef6('0x3'));var rp=require(_0x0ef6('0x4'));var moment=require(_0x0ef6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0ef6('0x6'));var util=require(_0x0ef6('0x7'));var path=require('path');var sox=require(_0x0ef6('0x8'));var csv=require(_0x0ef6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ef6('0xa'));var _=require(_0x0ef6('0xb'));var squel=require(_0x0ef6('0xc'));var crypto=require(_0x0ef6('0xd'));var jsforce=require(_0x0ef6('0xe'));var deskjs=require(_0x0ef6('0xf'));var toCsv=require(_0x0ef6('0x9'));var querystring=require('querystring');var Papa=require(_0x0ef6('0x10'));var Redis=require(_0x0ef6('0x11'));var authService=require(_0x0ef6('0x12'));var qs=require(_0x0ef6('0x13'));var as=require(_0x0ef6('0x14'));var hardwareService=require(_0x0ef6('0x15'));var logger=require('../../config/logger')(_0x0ef6('0x16'));var utils=require(_0x0ef6('0x17'));var config=require(_0x0ef6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ef6('0x19'))['db'];var integrations=require(_0x0ef6('0x1a'));function respondWithStatusCode(_0xf0efea,_0x29eecf){_0x29eecf=_0x29eecf||0xcc;return function(_0x129e5a){if(_0x129e5a){return _0xf0efea[_0x0ef6('0x1b')](_0x29eecf);}return _0xf0efea[_0x0ef6('0x1c')](_0x29eecf)['end']();};}function respondWithResult(_0xa4a5e,_0x2a9cba){_0x2a9cba=_0x2a9cba||0xc8;return function(_0x55bfd1){if(_0x55bfd1){return _0xa4a5e[_0x0ef6('0x1c')](_0x2a9cba)[_0x0ef6('0x1d')](_0x55bfd1);}};}function respondWithFilteredResult(_0x1416a4,_0x3dc698){return function(_0x31f524){if(_0x31f524){var _0x46c0c1=typeof _0x3dc698[_0x0ef6('0x1e')]===_0x0ef6('0x1f')&&typeof _0x3dc698[_0x0ef6('0x20')]===_0x0ef6('0x1f');var _0x338b87=_0x31f524[_0x0ef6('0x21')];var _0x14bdf0=_0x46c0c1?0x0:_0x3dc698['offset'];var _0x3af0df=_0x46c0c1?_0x31f524[_0x0ef6('0x21')]:_0x3dc698[_0x0ef6('0x1e')]+_0x3dc698['limit'];var _0x27486a;if(_0x3af0df>=_0x338b87){_0x3af0df=_0x338b87;_0x27486a=0xc8;}else{_0x27486a=0xce;}_0x1416a4[_0x0ef6('0x1c')](_0x27486a);return _0x1416a4['set'](_0x0ef6('0x22'),_0x14bdf0+'-'+_0x3af0df+'/'+_0x338b87)[_0x0ef6('0x1d')](_0x31f524);}return null;};}function patchUpdates(_0x706213){return function(_0x39074a){try{jsonpatch['apply'](_0x39074a,_0x706213,!![]);}catch(_0x1afef0){return BPromise[_0x0ef6('0x23')](_0x1afef0);}return _0x39074a[_0x0ef6('0x24')]();};}function saveUpdates(_0x4733f2,_0xeee26c){return function(_0x260d15){if(_0x260d15){return _0x260d15[_0x0ef6('0x25')](_0x4733f2)[_0x0ef6('0x26')](function(_0x56d65a){return _0x56d65a;});}return null;};}function removeEntity(_0x277d47,_0x94e858){return function(_0x569afa){if(_0x569afa){return _0x569afa[_0x0ef6('0x27')]()['then'](function(){_0x277d47[_0x0ef6('0x1c')](0xcc)[_0x0ef6('0x28')]();});}};}function handleEntityNotFound(_0x5d6501,_0x3ce3e1){return function(_0x275010){if(!_0x275010){_0x5d6501['sendStatus'](0x194);}return _0x275010;};}function handleError(_0x2c55ac,_0x3e8be0){_0x3e8be0=_0x3e8be0||0x1f4;return function(_0x2c0bfb){logger[_0x0ef6('0x29')](_0x2c0bfb[_0x0ef6('0x2a')]);if(_0x2c0bfb[_0x0ef6('0x2b')]){delete _0x2c0bfb[_0x0ef6('0x2b')];}_0x2c55ac[_0x0ef6('0x1c')](_0x3e8be0)[_0x0ef6('0x2c')](_0x2c0bfb);};}exports['index']=function(_0x3a3c76,_0x2c48c3){var _0x5bf7a6={},_0x1b9983={},_0x4ad66c={'count':0x0,'rows':[]};var _0x331a70=_['map'](db['SugarcrmAccount'][_0x0ef6('0x2d')],function(_0x4e094c){return{'name':_0x4e094c[_0x0ef6('0x2e')],'type':_0x4e094c[_0x0ef6('0x2f')][_0x0ef6('0x30')]};});_0x1b9983[_0x0ef6('0x31')]=_[_0x0ef6('0x32')](_0x331a70,_0x0ef6('0x2b'));_0x1b9983[_0x0ef6('0x33')]=_[_0x0ef6('0x34')](_0x3a3c76[_0x0ef6('0x33')]);_0x1b9983[_0x0ef6('0x35')]=_['intersection'](_0x1b9983[_0x0ef6('0x31')],_0x1b9983[_0x0ef6('0x33')]);_0x5bf7a6['attributes']=_[_0x0ef6('0x36')](_0x1b9983[_0x0ef6('0x31')],qs[_0x0ef6('0x37')](_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x37')]));_0x5bf7a6[_0x0ef6('0x38')]=_0x5bf7a6[_0x0ef6('0x38')][_0x0ef6('0x39')]?_0x5bf7a6[_0x0ef6('0x38')]:_0x1b9983['model'];if(!_0x3a3c76[_0x0ef6('0x33')]['hasOwnProperty']('nolimit')){_0x5bf7a6[_0x0ef6('0x20')]=qs[_0x0ef6('0x20')](_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x20')]);_0x5bf7a6[_0x0ef6('0x1e')]=qs['offset'](_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x1e')]);}_0x5bf7a6[_0x0ef6('0x3a')]=qs[_0x0ef6('0x3b')](_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x3b')]);_0x5bf7a6[_0x0ef6('0x3c')]=qs[_0x0ef6('0x35')](_['pick'](_0x3a3c76['query'],_0x1b9983['filters']),_0x331a70);if(_0x3a3c76['query'][_0x0ef6('0x3d')]){_0x5bf7a6[_0x0ef6('0x3c')]=_[_0x0ef6('0x3e')](_0x5bf7a6[_0x0ef6('0x3c')],{'$or':_['map'](_0x331a70,function(_0x5018a7){if(_0x5018a7[_0x0ef6('0x2f')]!==_0x0ef6('0x3f')){var _0x21ccb2={};_0x21ccb2[_0x5018a7[_0x0ef6('0x2b')]]={'$like':'%'+_0x3a3c76[_0x0ef6('0x33')]['filter']+'%'};return _0x21ccb2;}})});}_0x5bf7a6=_[_0x0ef6('0x3e')]({},_0x5bf7a6,_0x3a3c76[_0x0ef6('0x40')]);var _0x53acec={'where':_0x5bf7a6[_0x0ef6('0x3c')]};return db[_0x0ef6('0x41')][_0x0ef6('0x21')](_0x53acec)[_0x0ef6('0x26')](function(_0x169c8e){_0x4ad66c['count']=_0x169c8e;if(_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x42')]){_0x5bf7a6[_0x0ef6('0x43')]=[{'all':!![]}];}return db[_0x0ef6('0x41')][_0x0ef6('0x44')](_0x5bf7a6);})[_0x0ef6('0x26')](function(_0x5ecca4){_0x4ad66c[_0x0ef6('0x45')]=_0x5ecca4;return _0x4ad66c;})[_0x0ef6('0x26')](respondWithFilteredResult(_0x2c48c3,_0x5bf7a6))['catch'](handleError(_0x2c48c3,null));};exports['show']=function(_0x8a355e,_0x28bff1){var _0x2a9283={'raw':![],'where':{'id':_0x8a355e[_0x0ef6('0x46')]['id']}},_0x1a6dab={};_0x1a6dab[_0x0ef6('0x31')]=_[_0x0ef6('0x34')](db[_0x0ef6('0x41')]['rawAttributes']);_0x1a6dab[_0x0ef6('0x33')]=_['keys'](_0x8a355e[_0x0ef6('0x33')]);_0x1a6dab['filters']=_[_0x0ef6('0x36')](_0x1a6dab['model'],_0x1a6dab[_0x0ef6('0x33')]);_0x2a9283[_0x0ef6('0x38')]=_[_0x0ef6('0x36')](_0x1a6dab['model'],qs[_0x0ef6('0x37')](_0x8a355e[_0x0ef6('0x33')]['fields']));_0x2a9283[_0x0ef6('0x38')]=_0x2a9283[_0x0ef6('0x38')]['length']?_0x2a9283[_0x0ef6('0x38')]:_0x1a6dab[_0x0ef6('0x31')];if(_0x8a355e[_0x0ef6('0x33')][_0x0ef6('0x42')]){_0x2a9283['include']=[{'all':!![]}];}_0x2a9283=_[_0x0ef6('0x3e')]({},_0x2a9283,_0x8a355e[_0x0ef6('0x40')]);return db[_0x0ef6('0x41')][_0x0ef6('0x47')](_0x2a9283)[_0x0ef6('0x26')](handleEntityNotFound(_0x28bff1,null))['then'](respondWithResult(_0x28bff1,null))[_0x0ef6('0x48')](handleError(_0x28bff1,null));};exports[_0x0ef6('0x49')]=function(_0x50f3cd,_0x4be4e6){return db['SugarcrmAccount'][_0x0ef6('0x49')](_0x50f3cd[_0x0ef6('0x4a')],{})['then'](respondWithResult(_0x4be4e6,0xc9))[_0x0ef6('0x48')](handleError(_0x4be4e6,null));};exports[_0x0ef6('0x25')]=function(_0x196cbd,_0x53bd76){if(_0x196cbd['body']['id']){delete _0x196cbd['body']['id'];}return db[_0x0ef6('0x41')]['find']({'where':{'id':_0x196cbd[_0x0ef6('0x46')]['id']}})[_0x0ef6('0x26')](handleEntityNotFound(_0x53bd76,null))[_0x0ef6('0x26')](saveUpdates(_0x196cbd[_0x0ef6('0x4a')],null))[_0x0ef6('0x26')](respondWithResult(_0x53bd76,null))['catch'](handleError(_0x53bd76,null));};exports[_0x0ef6('0x27')]=function(_0xfcabbb,_0x42ab99){return db[_0x0ef6('0x41')][_0x0ef6('0x47')]({'where':{'id':_0xfcabbb['params']['id']}})['then'](handleEntityNotFound(_0x42ab99,null))[_0x0ef6('0x26')](removeEntity(_0x42ab99,null))[_0x0ef6('0x48')](handleError(_0x42ab99,null));};exports[_0x0ef6('0x4b')]=function(_0x1c0c02,_0x1aa4ec,_0x270436){var _0x5990d0={};var _0x4349e5={};var _0x594254;var _0x502164;return db[_0x0ef6('0x41')][_0x0ef6('0x4c')]({'where':{'id':_0x1c0c02['params']['id']}})['then'](handleEntityNotFound(_0x1aa4ec,null))['then'](function(_0x49dbb0){if(_0x49dbb0){_0x594254=_0x49dbb0;_0x4349e5[_0x0ef6('0x31')]=_[_0x0ef6('0x34')](db[_0x0ef6('0x4d')][_0x0ef6('0x2d')]);_0x4349e5[_0x0ef6('0x33')]=_['keys'](_0x1c0c02['query']);_0x4349e5['filters']=_[_0x0ef6('0x36')](_0x4349e5['model'],_0x4349e5[_0x0ef6('0x33')]);_0x5990d0['attributes']=_[_0x0ef6('0x36')](_0x4349e5[_0x0ef6('0x31')],qs['fields'](_0x1c0c02['query']['fields']));_0x5990d0[_0x0ef6('0x38')]=_0x5990d0['attributes'][_0x0ef6('0x39')]?_0x5990d0['attributes']:_0x4349e5[_0x0ef6('0x31')];_0x5990d0[_0x0ef6('0x3a')]=qs[_0x0ef6('0x3b')](_0x1c0c02[_0x0ef6('0x33')][_0x0ef6('0x3b')]);_0x5990d0[_0x0ef6('0x3c')]=qs[_0x0ef6('0x35')](_[_0x0ef6('0x4e')](_0x1c0c02[_0x0ef6('0x33')],_0x4349e5[_0x0ef6('0x35')]));if(_0x1c0c02['query']['filter']){_0x5990d0['where']=_[_0x0ef6('0x3e')](_0x5990d0[_0x0ef6('0x3c')],{'$or':_[_0x0ef6('0x32')](_0x5990d0[_0x0ef6('0x38')],function(_0x8506ae){var _0x56e66b={};_0x56e66b[_0x8506ae]={'$like':'%'+_0x1c0c02[_0x0ef6('0x33')]['filter']+'%'};return _0x56e66b;})});}_0x5990d0=_['merge']({},_0x5990d0,_0x1c0c02[_0x0ef6('0x40')]);return _0x594254[_0x0ef6('0x4b')](_0x5990d0);}})[_0x0ef6('0x26')](function(_0x26c31a){if(_0x26c31a){_0x502164=_0x26c31a['length'];if(!_0x1c0c02[_0x0ef6('0x33')][_0x0ef6('0x4f')](_0x0ef6('0x50'))){_0x5990d0[_0x0ef6('0x20')]=qs[_0x0ef6('0x20')](_0x1c0c02['query']['limit']);_0x5990d0['offset']=qs[_0x0ef6('0x1e')](_0x1c0c02[_0x0ef6('0x33')][_0x0ef6('0x1e')]);}return _0x594254[_0x0ef6('0x4b')](_0x5990d0);}})[_0x0ef6('0x26')](function(_0x27e0e1){if(_0x27e0e1){return _0x27e0e1?{'count':_0x502164,'rows':_0x27e0e1}:null;}})[_0x0ef6('0x26')](respondWithResult(_0x1aa4ec,null))['catch'](handleError(_0x1aa4ec,null));};exports['addConfiguration']=function(_0x45ed8b,_0x53babc,_0x65e80f){if(_0x45ed8b[_0x0ef6('0x4a')]['id']){delete _0x45ed8b[_0x0ef6('0x4a')]['id'];}return db[_0x0ef6('0x41')]['findOne']({'where':{'id':_0x45ed8b['params']['id']}})['then'](handleEntityNotFound(_0x53babc,null))[_0x0ef6('0x26')](function(_0x1c47d0){if(_0x1c47d0){_0x45ed8b['body'][_0x0ef6('0x51')]=_0x1c47d0['id'];_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x52')]=integrations[_0x0ef6('0x53')](_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x54')],_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x2f')]);_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x55')]=integrations[_0x0ef6('0x56')](_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x54')],_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x2f')]);return db[_0x0ef6('0x4d')]['create'](_0x45ed8b[_0x0ef6('0x4a')],{'include':[{'model':db['SugarcrmField'],'as':_0x0ef6('0x52')},{'model':db[_0x0ef6('0x57')],'as':_0x0ef6('0x55')}]});}return null;})[_0x0ef6('0x26')](respondWithResult(_0x53babc,null))[_0x0ef6('0x48')](handleError(_0x53babc,null));};exports[_0x0ef6('0x58')]=function(_0x409d75,_0x4d9984,_0x397357){var _0x36fa86='';var _0x5d0328=['id','name',_0x0ef6('0x59'),_0x0ef6('0x5a'),_0x0ef6('0x5b'),_0x0ef6('0x5c'),'duration_hours',_0x0ef6('0x5d'),_0x0ef6('0x5e'),'parent_type','parent_name',_0x0ef6('0x5f')];return db[_0x0ef6('0x41')]['findOne']({'where':{'id':_0x409d75[_0x0ef6('0x46')]['id']},'attributes':['id',_0x0ef6('0x60'),_0x0ef6('0x61'),_0x0ef6('0x62')]})[_0x0ef6('0x26')](handleEntityNotFound(_0x4d9984,null))[_0x0ef6('0x26')](function(_0xe2f32){if(_0xe2f32){_0x36fa86=_0xe2f32[_0x0ef6('0x62')];var _0xdd2097=_0x36fa86['slice'](-0x1);if(_0xdd2097==='/'){_0x36fa86=_0x36fa86[_0x0ef6('0x63')](0x0,_0x36fa86[_0x0ef6('0x64')](_0xdd2097));}return rp({'method':_0x0ef6('0x65'),'uri':util[_0x0ef6('0x66')](_0x0ef6('0x67'),_0x36fa86,_0x0ef6('0x68')),'json':!![],'form':{'method':_0x0ef6('0x69'),'input_type':_0x0ef6('0x6a'),'response_type':'JSON','rest_data':JSON[_0x0ef6('0x6b')]({'user_auth':{'user_name':_0xe2f32['username'],'password':_0xe2f32[_0x0ef6('0x61')],'encryption':_0x0ef6('0x6c')},'application':_0x0ef6('0x6d')})}});}})[_0x0ef6('0x26')](function(_0x37871b){if(_0x37871b&&_0x37871b[_0x0ef6('0x2b')]!==_0x0ef6('0x6e')&&_0x37871b[_0x0ef6('0x2b')]!==_0x0ef6('0x6f')){return rp({'method':'POST','uri':util[_0x0ef6('0x66')](_0x0ef6('0x67'),_0x36fa86,_0x0ef6('0x68')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x0ef6('0x6a'),'response_type':_0x0ef6('0x6a'),'rest_data':JSON[_0x0ef6('0x6b')]({'session':_0x37871b['id'],'module_name':_0x0ef6('0x70')})}})[_0x0ef6('0x26')](function(_0x18d6b4){if(_0x18d6b4){var _0x4e0567=_['values'](_0x18d6b4[_0x0ef6('0x71')]);_[_0x0ef6('0x72')](_0x4e0567,function(_0x10fd9e){return _0x5d0328[_0x0ef6('0x73')](_0x10fd9e['name']);});return{'count':_0x4e0567['length'],'rows':_[_0x0ef6('0x32')](_0x4e0567,function(_0x2bddfa){return{'id':_0x2bddfa[_0x0ef6('0x2b')],'name':_0x2bddfa[_0x0ef6('0x74')],'custom':_['endsWith'](_0x2bddfa[_0x0ef6('0x2b')],'_c')?!![]:![],'options':_0x2bddfa['options']?_[_0x0ef6('0x32')](_[_0x0ef6('0x75')](_0x2bddfa[_0x0ef6('0x40')]),function(_0x180125){return{'name':_0x180125['value'],'value':_0x180125[_0x0ef6('0x2b')]};}):[]};})};}})['then'](respondWithResult(_0x4d9984,null))['catch'](function(_0x98bfdc){var _0x2585c7=_0x409d75[_0x0ef6('0x33')]['test']?0x1f4:_0x98bfdc['statusCode']||0x1f4;logger[_0x0ef6('0x29')](_0x0ef6('0x76'),_0x0ef6('0x58'),_0x2585c7,JSON['stringify'](_0x98bfdc));delete _0x98bfdc[_0x0ef6('0x2b')];if(_0x2585c7===0x191){_0x2585c7=0x190;}_0x4d9984[_0x0ef6('0x1c')](_0x2585c7)[_0x0ef6('0x2c')](_0x409d75[_0x0ef6('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x98bfdc[_0x0ef6('0x77')]}:_0x98bfdc);});}else{var _0x8a7a0f=0x1f4;_0x4d9984[_0x0ef6('0x1c')](_0x8a7a0f)[_0x0ef6('0x2c')]({'message':_0x0ef6('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x465a=['xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','includes','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','reject','save','then','sendStatus','error','stack','map','rawAttributes','fieldName','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','SugarcrmAccount','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','AccountId','Subjects','getSubjects','type','getDescriptions','channel','SugarcrmField','description','date_start','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x465a,0x1d8));var _0xa465=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x465a[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa465('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa465('0x1'));var rp=require(_0xa465('0x2'));var moment=require(_0xa465('0x3'));var BPromise=require(_0xa465('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa465('0x5'));var sox=require(_0xa465('0x6'));var csv=require(_0xa465('0x7'));var ejs=require(_0xa465('0x8'));var fs=require('fs');var fs_extra=require(_0xa465('0x9'));var _=require('lodash');var squel=require(_0xa465('0xa'));var crypto=require(_0xa465('0xb'));var jsforce=require(_0xa465('0xc'));var deskjs=require(_0xa465('0xd'));var toCsv=require(_0xa465('0x7'));var querystring=require(_0xa465('0xe'));var Papa=require(_0xa465('0xf'));var Redis=require('ioredis');var authService=require(_0xa465('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa465('0x11'));var hardwareService=require(_0xa465('0x12'));var logger=require(_0xa465('0x13'))(_0xa465('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa465('0x15'));var db=require(_0xa465('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x46726b,_0x3d8b3a){_0x3d8b3a=_0x3d8b3a||0xcc;return function(_0x494210){if(_0x494210){return _0x46726b['sendStatus'](_0x3d8b3a);}return _0x46726b['status'](_0x3d8b3a)[_0xa465('0x17')]();};}function respondWithResult(_0x330651,_0x10234d){_0x10234d=_0x10234d||0xc8;return function(_0x2cf3a0){if(_0x2cf3a0){return _0x330651[_0xa465('0x18')](_0x10234d)[_0xa465('0x19')](_0x2cf3a0);}};}function respondWithFilteredResult(_0x5dcbb2,_0x3e5f75){return function(_0x27b6d6){if(_0x27b6d6){var _0x34a89b=typeof _0x3e5f75[_0xa465('0x1a')]===_0xa465('0x1b')&&typeof _0x3e5f75[_0xa465('0x1c')]===_0xa465('0x1b');var _0x31399a=_0x27b6d6[_0xa465('0x1d')];var _0x2bb7a3=_0x34a89b?0x0:_0x3e5f75[_0xa465('0x1a')];var _0x446da9=_0x34a89b?_0x27b6d6[_0xa465('0x1d')]:_0x3e5f75[_0xa465('0x1a')]+_0x3e5f75[_0xa465('0x1c')];var _0x2a4134;if(_0x446da9>=_0x31399a){_0x446da9=_0x31399a;_0x2a4134=0xc8;}else{_0x2a4134=0xce;}_0x5dcbb2[_0xa465('0x18')](_0x2a4134);return _0x5dcbb2[_0xa465('0x1e')]('Content-Range',_0x2bb7a3+'-'+_0x446da9+'/'+_0x31399a)[_0xa465('0x19')](_0x27b6d6);}return null;};}function patchUpdates(_0x1803ec){return function(_0x3c2042){try{jsonpatch['apply'](_0x3c2042,_0x1803ec,!![]);}catch(_0x1875c1){return BPromise[_0xa465('0x1f')](_0x1875c1);}return _0x3c2042[_0xa465('0x20')]();};}function saveUpdates(_0x49ecc7,_0xcdfc33){return function(_0x4a8375){if(_0x4a8375){return _0x4a8375['update'](_0x49ecc7)[_0xa465('0x21')](function(_0x303044){return _0x303044;});}return null;};}function removeEntity(_0x476f8d,_0x409383){return function(_0x2520c8){if(_0x2520c8){return _0x2520c8['destroy']()[_0xa465('0x21')](function(){_0x476f8d[_0xa465('0x18')](0xcc)[_0xa465('0x17')]();});}};}function handleEntityNotFound(_0x79a5f9,_0xa5fd94){return function(_0x5c0465){if(!_0x5c0465){_0x79a5f9[_0xa465('0x22')](0x194);}return _0x5c0465;};}function handleError(_0x2e6047,_0x238c1b){_0x238c1b=_0x238c1b||0x1f4;return function(_0x578c9a){logger[_0xa465('0x23')](_0x578c9a[_0xa465('0x24')]);if(_0x578c9a['name']){delete _0x578c9a['name'];}_0x2e6047[_0xa465('0x18')](_0x238c1b)['send'](_0x578c9a);};}exports['index']=function(_0xa1a457,_0x14dfd3){var _0x35fab6={},_0x146ec1={},_0x41de63={'count':0x0,'rows':[]};var _0x2a7bdb=_[_0xa465('0x25')](db['SugarcrmAccount'][_0xa465('0x26')],function(_0x1a635a){return{'name':_0x1a635a[_0xa465('0x27')],'type':_0x1a635a['type']['key']};});_0x146ec1[_0xa465('0x28')]=_[_0xa465('0x25')](_0x2a7bdb,_0xa465('0x29'));_0x146ec1[_0xa465('0x2a')]=_['keys'](_0xa1a457[_0xa465('0x2a')]);_0x146ec1[_0xa465('0x2b')]=_[_0xa465('0x2c')](_0x146ec1[_0xa465('0x28')],_0x146ec1[_0xa465('0x2a')]);_0x35fab6[_0xa465('0x2d')]=_[_0xa465('0x2c')](_0x146ec1[_0xa465('0x28')],qs[_0xa465('0x2e')](_0xa1a457['query'][_0xa465('0x2e')]));_0x35fab6[_0xa465('0x2d')]=_0x35fab6[_0xa465('0x2d')][_0xa465('0x2f')]?_0x35fab6[_0xa465('0x2d')]:_0x146ec1[_0xa465('0x28')];if(!_0xa1a457[_0xa465('0x2a')][_0xa465('0x30')](_0xa465('0x31'))){_0x35fab6[_0xa465('0x1c')]=qs[_0xa465('0x1c')](_0xa1a457[_0xa465('0x2a')]['limit']);_0x35fab6[_0xa465('0x1a')]=qs['offset'](_0xa1a457[_0xa465('0x2a')][_0xa465('0x1a')]);}_0x35fab6[_0xa465('0x32')]=qs[_0xa465('0x33')](_0xa1a457['query']['sort']);_0x35fab6['where']=qs[_0xa465('0x2b')](_[_0xa465('0x34')](_0xa1a457[_0xa465('0x2a')],_0x146ec1[_0xa465('0x2b')]),_0x2a7bdb);if(_0xa1a457[_0xa465('0x2a')][_0xa465('0x35')]){_0x35fab6[_0xa465('0x36')]=_[_0xa465('0x37')](_0x35fab6[_0xa465('0x36')],{'$or':_[_0xa465('0x25')](_0x2a7bdb,function(_0x3b0539){if(_0x3b0539['type']!=='VIRTUAL'){var _0x356308={};_0x356308[_0x3b0539[_0xa465('0x29')]]={'$like':'%'+_0xa1a457[_0xa465('0x2a')][_0xa465('0x35')]+'%'};return _0x356308;}})});}_0x35fab6=_[_0xa465('0x37')]({},_0x35fab6,_0xa1a457[_0xa465('0x38')]);var _0x4f860c={'where':_0x35fab6[_0xa465('0x36')]};return db['SugarcrmAccount']['count'](_0x4f860c)['then'](function(_0x4de008){_0x41de63[_0xa465('0x1d')]=_0x4de008;if(_0xa1a457[_0xa465('0x2a')][_0xa465('0x39')]){_0x35fab6[_0xa465('0x3a')]=[{'all':!![]}];}return db[_0xa465('0x3b')][_0xa465('0x3c')](_0x35fab6);})['then'](function(_0x443b83){_0x41de63[_0xa465('0x3d')]=_0x443b83;return _0x41de63;})[_0xa465('0x21')](respondWithFilteredResult(_0x14dfd3,_0x35fab6))[_0xa465('0x3e')](handleError(_0x14dfd3,null));};exports[_0xa465('0x3f')]=function(_0x4820a6,_0xb1ca17){var _0x31ce5a={'raw':![],'where':{'id':_0x4820a6[_0xa465('0x40')]['id']}},_0x3a524c={};_0x3a524c[_0xa465('0x28')]=_[_0xa465('0x41')](db[_0xa465('0x3b')][_0xa465('0x26')]);_0x3a524c[_0xa465('0x2a')]=_[_0xa465('0x41')](_0x4820a6[_0xa465('0x2a')]);_0x3a524c[_0xa465('0x2b')]=_[_0xa465('0x2c')](_0x3a524c[_0xa465('0x28')],_0x3a524c[_0xa465('0x2a')]);_0x31ce5a[_0xa465('0x2d')]=_[_0xa465('0x2c')](_0x3a524c[_0xa465('0x28')],qs[_0xa465('0x2e')](_0x4820a6['query'][_0xa465('0x2e')]));_0x31ce5a[_0xa465('0x2d')]=_0x31ce5a[_0xa465('0x2d')][_0xa465('0x2f')]?_0x31ce5a['attributes']:_0x3a524c[_0xa465('0x28')];if(_0x4820a6[_0xa465('0x2a')][_0xa465('0x39')]){_0x31ce5a['include']=[{'all':!![]}];}_0x31ce5a=_['merge']({},_0x31ce5a,_0x4820a6[_0xa465('0x38')]);return db[_0xa465('0x3b')][_0xa465('0x42')](_0x31ce5a)[_0xa465('0x21')](handleEntityNotFound(_0xb1ca17,null))['then'](respondWithResult(_0xb1ca17,null))['catch'](handleError(_0xb1ca17,null));};exports[_0xa465('0x43')]=function(_0x4ead1a,_0x28691f){return db['SugarcrmAccount'][_0xa465('0x43')](_0x4ead1a[_0xa465('0x44')],{})[_0xa465('0x21')](respondWithResult(_0x28691f,0xc9))['catch'](handleError(_0x28691f,null));};exports['update']=function(_0x583aae,_0x27f767){if(_0x583aae[_0xa465('0x44')]['id']){delete _0x583aae['body']['id'];}return db[_0xa465('0x3b')]['find']({'where':{'id':_0x583aae['params']['id']}})[_0xa465('0x21')](handleEntityNotFound(_0x27f767,null))[_0xa465('0x21')](saveUpdates(_0x583aae[_0xa465('0x44')],null))[_0xa465('0x21')](respondWithResult(_0x27f767,null))[_0xa465('0x3e')](handleError(_0x27f767,null));};exports['destroy']=function(_0x4b6cd7,_0x26de50){return db[_0xa465('0x3b')][_0xa465('0x42')]({'where':{'id':_0x4b6cd7[_0xa465('0x40')]['id']}})['then'](handleEntityNotFound(_0x26de50,null))['then'](removeEntity(_0x26de50,null))[_0xa465('0x3e')](handleError(_0x26de50,null));};exports[_0xa465('0x45')]=function(_0x46792e,_0x1b8e78,_0x234845){var _0x4ad217={};var _0x2035c5={};var _0x2a379b;var _0x2e5188;return db[_0xa465('0x3b')][_0xa465('0x46')]({'where':{'id':_0x46792e[_0xa465('0x40')]['id']}})[_0xa465('0x21')](handleEntityNotFound(_0x1b8e78,null))[_0xa465('0x21')](function(_0x10e253){if(_0x10e253){_0x2a379b=_0x10e253;_0x2035c5[_0xa465('0x28')]=_[_0xa465('0x41')](db[_0xa465('0x47')][_0xa465('0x26')]);_0x2035c5[_0xa465('0x2a')]=_['keys'](_0x46792e[_0xa465('0x2a')]);_0x2035c5['filters']=_[_0xa465('0x2c')](_0x2035c5[_0xa465('0x28')],_0x2035c5['query']);_0x4ad217[_0xa465('0x2d')]=_[_0xa465('0x2c')](_0x2035c5['model'],qs[_0xa465('0x2e')](_0x46792e['query']['fields']));_0x4ad217['attributes']=_0x4ad217[_0xa465('0x2d')][_0xa465('0x2f')]?_0x4ad217['attributes']:_0x2035c5[_0xa465('0x28')];_0x4ad217[_0xa465('0x32')]=qs[_0xa465('0x33')](_0x46792e[_0xa465('0x2a')]['sort']);_0x4ad217[_0xa465('0x36')]=qs[_0xa465('0x2b')](_['pick'](_0x46792e[_0xa465('0x2a')],_0x2035c5[_0xa465('0x2b')]));if(_0x46792e[_0xa465('0x2a')]['filter']){_0x4ad217['where']=_['merge'](_0x4ad217[_0xa465('0x36')],{'$or':_['map'](_0x4ad217['attributes'],function(_0x4988a5){var _0x5ac4ef={};_0x5ac4ef[_0x4988a5]={'$like':'%'+_0x46792e[_0xa465('0x2a')][_0xa465('0x35')]+'%'};return _0x5ac4ef;})});}_0x4ad217=_[_0xa465('0x37')]({},_0x4ad217,_0x46792e['options']);return _0x2a379b['getConfigurations'](_0x4ad217);}})[_0xa465('0x21')](function(_0x4a2421){if(_0x4a2421){_0x2e5188=_0x4a2421[_0xa465('0x2f')];if(!_0x46792e['query']['hasOwnProperty'](_0xa465('0x31'))){_0x4ad217[_0xa465('0x1c')]=qs[_0xa465('0x1c')](_0x46792e[_0xa465('0x2a')][_0xa465('0x1c')]);_0x4ad217[_0xa465('0x1a')]=qs[_0xa465('0x1a')](_0x46792e[_0xa465('0x2a')][_0xa465('0x1a')]);}return _0x2a379b['getConfigurations'](_0x4ad217);}})[_0xa465('0x21')](function(_0x1fa80b){if(_0x1fa80b){return _0x1fa80b?{'count':_0x2e5188,'rows':_0x1fa80b}:null;}})['then'](respondWithResult(_0x1b8e78,null))[_0xa465('0x3e')](handleError(_0x1b8e78,null));};exports['addConfiguration']=function(_0x4ecd8f,_0x440b44,_0x3b5035){if(_0x4ecd8f['body']['id']){delete _0x4ecd8f['body']['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x4ecd8f[_0xa465('0x40')]['id']}})[_0xa465('0x21')](handleEntityNotFound(_0x440b44,null))[_0xa465('0x21')](function(_0x1e7398){if(_0x1e7398){_0x4ecd8f[_0xa465('0x44')][_0xa465('0x48')]=_0x1e7398['id'];_0x4ecd8f['body'][_0xa465('0x49')]=integrations[_0xa465('0x4a')](_0x4ecd8f[_0xa465('0x44')]['channel'],_0x4ecd8f[_0xa465('0x44')][_0xa465('0x4b')]);_0x4ecd8f['body']['Descriptions']=integrations[_0xa465('0x4c')](_0x4ecd8f[_0xa465('0x44')][_0xa465('0x4d')],_0x4ecd8f[_0xa465('0x44')][_0xa465('0x4b')]);return db['SugarcrmConfiguration'][_0xa465('0x43')](_0x4ecd8f['body'],{'include':[{'model':db[_0xa465('0x4e')],'as':_0xa465('0x49')},{'model':db[_0xa465('0x4e')],'as':'Descriptions'}]});}return null;})[_0xa465('0x21')](respondWithResult(_0x440b44,null))[_0xa465('0x3e')](handleError(_0x440b44,null));};exports['getFields']=function(_0x173982,_0x32c123,_0x1e8283){var _0x2133c1='';var _0xe696d5=['id',_0xa465('0x29'),'assigned_user_id','created_by',_0xa465('0x4f'),_0xa465('0x50'),'duration_hours',_0xa465('0x51'),'parent_id',_0xa465('0x52'),_0xa465('0x53'),_0xa465('0x54')];return db[_0xa465('0x3b')][_0xa465('0x46')]({'where':{'id':_0x173982['params']['id']},'attributes':['id',_0xa465('0x55'),_0xa465('0x56'),_0xa465('0x57')]})[_0xa465('0x21')](handleEntityNotFound(_0x32c123,null))['then'](function(_0x2ee63e){if(_0x2ee63e){_0x2133c1=_0x2ee63e[_0xa465('0x57')];var _0x1369a9=_0x2133c1[_0xa465('0x58')](-0x1);if(_0x1369a9==='/'){_0x2133c1=_0x2133c1[_0xa465('0x59')](0x0,_0x2133c1[_0xa465('0x5a')](_0x1369a9));}return rp({'method':_0xa465('0x5b'),'uri':util['format'](_0xa465('0x5c'),_0x2133c1,_0xa465('0x5d')),'json':!![],'form':{'method':_0xa465('0x5e'),'input_type':'JSON','response_type':_0xa465('0x5f'),'rest_data':JSON[_0xa465('0x60')]({'user_auth':{'user_name':_0x2ee63e[_0xa465('0x55')],'password':_0x2ee63e[_0xa465('0x56')],'encryption':_0xa465('0x61')},'application':_0xa465('0x62')})}});}})['then'](function(_0x297610){if(_0x297610&&_0x297610[_0xa465('0x29')]!==_0xa465('0x63')&&_0x297610[_0xa465('0x29')]!==_0xa465('0x64')){return rp({'method':'POST','uri':util[_0xa465('0x65')](_0xa465('0x5c'),_0x2133c1,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa465('0x66'),'input_type':_0xa465('0x5f'),'response_type':'JSON','rest_data':JSON[_0xa465('0x60')]({'session':_0x297610['id'],'module_name':_0xa465('0x67')})}})['then'](function(_0x111647){if(_0x111647){var _0x23b261=_[_0xa465('0x68')](_0x111647['module_fields']);_['remove'](_0x23b261,function(_0x296327){return _0xe696d5[_0xa465('0x69')](_0x296327['name']);});return{'count':_0x23b261[_0xa465('0x2f')],'rows':_[_0xa465('0x25')](_0x23b261,function(_0x242817){return{'id':_0x242817[_0xa465('0x29')],'name':_0x242817['label'],'custom':_[_0xa465('0x6a')](_0x242817[_0xa465('0x29')],'_c')?!![]:![],'options':_0x242817['options']?_[_0xa465('0x25')](_[_0xa465('0x68')](_0x242817[_0xa465('0x38')]),function(_0x2102f9){return{'name':_0x2102f9[_0xa465('0x6b')],'value':_0x2102f9[_0xa465('0x29')]};}):[]};})};}})[_0xa465('0x21')](respondWithResult(_0x32c123,null))[_0xa465('0x3e')](function(_0x122a88){var _0x521fa6=_0x173982[_0xa465('0x2a')][_0xa465('0x6c')]?0x1f4:_0x122a88[_0xa465('0x6d')]||0x1f4;logger[_0xa465('0x23')](_0xa465('0x6e'),_0xa465('0x6f'),_0x521fa6,JSON['stringify'](_0x122a88));delete _0x122a88[_0xa465('0x29')];if(_0x521fa6===0x191){_0x521fa6=0x190;}_0x32c123[_0xa465('0x18')](_0x521fa6)[_0xa465('0x70')](_0x173982[_0xa465('0x2a')][_0xa465('0x6c')]?{'message':_0xa465('0x71'),'statusCode':_0x122a88[_0xa465('0x6d')]}:_0x122a88);});}else{var _0x9e2edd=0x1f4;_0x32c123['status'](_0x9e2edd)['send']({'message':_0xa465('0x71'),'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 7fb4a12..16b3610 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 _0xfed7=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x522906,_0x5540a2){var _0x2147d6=function(_0x1d41e2){while(--_0x1d41e2){_0x522906['push'](_0x522906['shift']());}};_0x2147d6(++_0x5540a2);}(_0xfed7,0x190));var _0x7fed=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0xfed7[_0x3747ae];return _0x339035;};'use strict';var _=require(_0x7fed('0x0'));var util=require(_0x7fed('0x1'));var logger=require(_0x7fed('0x2'))(_0x7fed('0x3'));var moment=require(_0x7fed('0x4'));var BPromise=require(_0x7fed('0x5'));var rp=require(_0x7fed('0x6'));var fs=require('fs');var path=require(_0x7fed('0x7'));var rimraf=require(_0x7fed('0x8'));var config=require(_0x7fed('0x9'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x7fed('0xa'));module[_0x7fed('0xb')]=function(_0x517ec1,_0x5eeb9f){return _0x517ec1[_0x7fed('0xc')](_0x7fed('0xd'),attributes,{'tableName':_0x7fed('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7856=['rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7856,0x132));var _0x6785=function(_0x46b413,_0x31996d){_0x46b413=_0x46b413-0x0;var _0x280384=_0x7856[_0x46b413];return _0x280384;};'use strict';var _=require(_0x6785('0x0'));var util=require(_0x6785('0x1'));var logger=require(_0x6785('0x2'))('api');var moment=require(_0x6785('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6785('0x4'));var config=require('../../config/environment');var attributes=require(_0x6785('0x5'));var integrations=require(_0x6785('0x6'));module[_0x6785('0x7')]=function(_0x5943d8,_0x5a751d){return _0x5943d8['define'](_0x6785('0x8'),attributes,{'tableName':_0x6785('0x9'),'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 596aeed..5b280c5 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 _0x01f7=['jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','find','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x01f7,0x1e1));var _0x701f=function(_0x714e4e,_0x220d25){_0x714e4e=_0x714e4e-0x0;var _0x10552a=_0x01f7[_0x714e4e];return _0x10552a;};'use strict';var _=require(_0x701f('0x0'));var util=require('util');var moment=require(_0x701f('0x1'));var BPromise=require(_0x701f('0x2'));var rs=require(_0x701f('0x3'));var fs=require('fs');var Redis=require(_0x701f('0x4'));var db=require(_0x701f('0x5'))['db'];var utils=require(_0x701f('0x6'));var logger=require(_0x701f('0x7'))(_0x701f('0x8'));var config=require('../../config/environment');var jayson=require(_0x701f('0x9'));var client=jayson['client'][_0x701f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb9305,_0x245bee,_0x3c8a80){return new BPromise(function(_0x25b500,_0x4bb376){return client[_0x701f('0xb')](_0xb9305,_0x3c8a80)[_0x701f('0xc')](function(_0x489729){logger[_0x701f('0xd')](_0x701f('0xe'),_0x245bee,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x245bee,_0x701f('0xf'),JSON[_0x701f('0x10')](_0x489729));if(_0x489729[_0x701f('0x11')]){if(_0x489729[_0x701f('0x11')]['code']===0x1f4){logger[_0x701f('0x11')](_0x701f('0xe'),_0x245bee,_0x489729[_0x701f('0x11')][_0x701f('0x12')]);return _0x4bb376(_0x489729[_0x701f('0x11')][_0x701f('0x12')]);}logger[_0x701f('0x11')](_0x701f('0xe'),_0x245bee,_0x489729['error'][_0x701f('0x12')]);return _0x25b500(_0x489729[_0x701f('0x11')]['message']);}else{logger[_0x701f('0xd')](_0x701f('0xe'),_0x245bee,_0x701f('0xf'));_0x25b500(_0x489729[_0x701f('0x13')][_0x701f('0x12')]);}})[_0x701f('0x14')](function(_0x2e2d2c){logger[_0x701f('0x11')](_0x701f('0xe'),_0x245bee,_0x2e2d2c);_0x4bb376(_0x2e2d2c);});});}exports['GetSugarcrmAccount']=function(_0x1ff60e){var _0x5c4f7d=this;return new Promise(function(_0x4e5565,_0x5e7078){return db['SugarcrmAccount'][_0x701f('0x15')]({'raw':_0x1ff60e[_0x701f('0x16')]?_0x1ff60e[_0x701f('0x16')][_0x701f('0x17')]===undefined?!![]:![]:!![],'where':_0x1ff60e[_0x701f('0x16')]?_0x1ff60e[_0x701f('0x16')][_0x701f('0x18')]||null:null,'attributes':_0x1ff60e[_0x701f('0x16')]?_0x1ff60e['options'][_0x701f('0x19')]||null:null,'limit':_0x1ff60e[_0x701f('0x16')]?_0x1ff60e[_0x701f('0x16')][_0x701f('0x1a')]||null:null,'include':_0x1ff60e['options']?_0x1ff60e[_0x701f('0x16')]['include']?_['map'](_0x1ff60e[_0x701f('0x16')][_0x701f('0x1b')],function(_0x4ae68e){return{'model':db[_0x4ae68e[_0x701f('0x1c')]],'as':_0x4ae68e['as'],'attributes':_0x4ae68e['attributes'],'include':_0x4ae68e[_0x701f('0x1b')]?_[_0x701f('0x1d')](_0x4ae68e[_0x701f('0x1b')],function(_0x276f0f){return{'model':db[_0x276f0f[_0x701f('0x1c')]],'as':_0x276f0f['as'],'attributes':_0x276f0f[_0x701f('0x19')],'include':_0x276f0f['include']?_[_0x701f('0x1d')](_0x276f0f[_0x701f('0x1b')],function(_0x431e8c){return{'model':db[_0x431e8c[_0x701f('0x1c')]],'as':_0x431e8c['as'],'attributes':_0x431e8c[_0x701f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x701f('0xc')](function(_0x49d0b6){logger[_0x701f('0xd')](_0x701f('0x1e'),_0x1ff60e);logger['debug']('GetSugarcrmAccount',_0x1ff60e,JSON[_0x701f('0x10')](_0x49d0b6));_0x4e5565(_0x49d0b6);})['catch'](function(_0x786713){logger['error'](_0x701f('0x1e'),_0x786713[_0x701f('0x12')],_0x1ff60e);_0x5e7078(_0x5c4f7d[_0x701f('0x11')](0x1f4,_0x786713[_0x701f('0x12')]));});});};exports[_0x701f('0x1f')]=function(_0x165030){var _0x52be03=this;return new Promise(function(_0x43ce1a,_0x4ede57){return db[_0x701f('0x20')][_0x701f('0x21')]({'raw':_0x165030[_0x701f('0x16')]?_0x165030['options'][_0x701f('0x17')]===undefined?!![]:![]:!![],'where':_0x165030[_0x701f('0x16')]?_0x165030[_0x701f('0x16')]['where']||null:null,'attributes':_0x165030[_0x701f('0x16')]?_0x165030[_0x701f('0x16')][_0x701f('0x19')]||null:null,'include':_0x165030[_0x701f('0x16')]?_0x165030[_0x701f('0x16')][_0x701f('0x1b')]?_[_0x701f('0x1d')](_0x165030[_0x701f('0x16')][_0x701f('0x1b')],function(_0x56ef0b){return{'model':db[_0x56ef0b[_0x701f('0x1c')]],'as':_0x56ef0b['as'],'attributes':_0x56ef0b[_0x701f('0x19')],'include':_0x56ef0b[_0x701f('0x1b')]?_[_0x701f('0x1d')](_0x56ef0b[_0x701f('0x1b')],function(_0xeeea65){return{'model':db[_0xeeea65[_0x701f('0x1c')]],'as':_0xeeea65['as'],'attributes':_0xeeea65[_0x701f('0x19')],'include':_0xeeea65[_0x701f('0x1b')]?_['map'](_0xeeea65[_0x701f('0x1b')],function(_0x5842ca){return{'model':db[_0x5842ca['model']],'as':_0x5842ca['as'],'attributes':_0x5842ca[_0x701f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x701f('0xc')](function(_0x3a69f3){logger['info']('ShowSugarcrmAccount',_0x165030);logger[_0x701f('0x22')](_0x701f('0x1f'),_0x165030,JSON['stringify'](_0x3a69f3));_0x43ce1a(_0x3a69f3);})[_0x701f('0x14')](function(_0x4a99a6){logger[_0x701f('0x11')](_0x701f('0x1f'),_0x4a99a6['message'],_0x165030);_0x4ede57(_0x52be03['error'](0x1f4,_0x4a99a6[_0x701f('0x12')]));});});}; \ No newline at end of file +var _0x2abd=['debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3b211d,_0x1260d7){var _0x37cfe8=function(_0xf03c15){while(--_0xf03c15){_0x3b211d['push'](_0x3b211d['shift']());}};_0x37cfe8(++_0x1260d7);}(_0x2abd,0x17f));var _0xd2ab=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x2abd[_0x5f309e];return _0x487b5e;};'use strict';var _=require('lodash');var util=require(_0xd2ab('0x0'));var moment=require(_0xd2ab('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2ab('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd2ab('0x4'));var config=require(_0xd2ab('0x5'));var jayson=require(_0xd2ab('0x6'));var client=jayson[_0xd2ab('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8872fb,_0x373f42,_0x25773a){return new BPromise(function(_0x44e2c5,_0x1acb17){return client[_0xd2ab('0x8')](_0x8872fb,_0x25773a)[_0xd2ab('0x9')](function(_0x9439a8){logger[_0xd2ab('0xa')](_0xd2ab('0xb'),_0x373f42,_0xd2ab('0xc'));logger[_0xd2ab('0xd')](_0xd2ab('0xe'),_0x373f42,_0xd2ab('0xc'),JSON[_0xd2ab('0xf')](_0x9439a8));if(_0x9439a8[_0xd2ab('0x10')]){if(_0x9439a8['error'][_0xd2ab('0x11')]===0x1f4){logger['error'](_0xd2ab('0xb'),_0x373f42,_0x9439a8[_0xd2ab('0x10')][_0xd2ab('0x12')]);return _0x1acb17(_0x9439a8['error'][_0xd2ab('0x12')]);}logger[_0xd2ab('0x10')](_0xd2ab('0xb'),_0x373f42,_0x9439a8[_0xd2ab('0x10')]['message']);return _0x44e2c5(_0x9439a8[_0xd2ab('0x10')]['message']);}else{logger[_0xd2ab('0xa')](_0xd2ab('0xb'),_0x373f42,'request\x20sent');_0x44e2c5(_0x9439a8[_0xd2ab('0x13')]['message']);}})[_0xd2ab('0x14')](function(_0x173dae){logger['error'](_0xd2ab('0xb'),_0x373f42,_0x173dae);_0x1acb17(_0x173dae);});});}exports['GetSugarcrmAccount']=function(_0x2561d5){var _0x5b62dc=this;return new Promise(function(_0x509363,_0x53ab3d){return db['SugarcrmAccount'][_0xd2ab('0x15')]({'raw':_0x2561d5[_0xd2ab('0x16')]?_0x2561d5['options'][_0xd2ab('0x17')]===undefined?!![]:![]:!![],'where':_0x2561d5[_0xd2ab('0x16')]?_0x2561d5[_0xd2ab('0x16')][_0xd2ab('0x18')]||null:null,'attributes':_0x2561d5[_0xd2ab('0x16')]?_0x2561d5[_0xd2ab('0x16')][_0xd2ab('0x19')]||null:null,'limit':_0x2561d5[_0xd2ab('0x16')]?_0x2561d5[_0xd2ab('0x16')][_0xd2ab('0x1a')]||null:null,'include':_0x2561d5[_0xd2ab('0x16')]?_0x2561d5[_0xd2ab('0x16')][_0xd2ab('0x1b')]?_[_0xd2ab('0x1c')](_0x2561d5[_0xd2ab('0x16')][_0xd2ab('0x1b')],function(_0x4fdf04){return{'model':db[_0x4fdf04[_0xd2ab('0x1d')]],'as':_0x4fdf04['as'],'attributes':_0x4fdf04[_0xd2ab('0x19')],'include':_0x4fdf04[_0xd2ab('0x1b')]?_[_0xd2ab('0x1c')](_0x4fdf04[_0xd2ab('0x1b')],function(_0x11598f){return{'model':db[_0x11598f[_0xd2ab('0x1d')]],'as':_0x11598f['as'],'attributes':_0x11598f[_0xd2ab('0x19')],'include':_0x11598f[_0xd2ab('0x1b')]?_[_0xd2ab('0x1c')](_0x11598f[_0xd2ab('0x1b')],function(_0x498711){return{'model':db[_0x498711[_0xd2ab('0x1d')]],'as':_0x498711['as'],'attributes':_0x498711[_0xd2ab('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd2ab('0x9')](function(_0x10830d){logger[_0xd2ab('0xa')]('GetSugarcrmAccount',_0x2561d5);logger[_0xd2ab('0xd')](_0xd2ab('0x1e'),_0x2561d5,JSON['stringify'](_0x10830d));_0x509363(_0x10830d);})[_0xd2ab('0x14')](function(_0x551534){logger[_0xd2ab('0x10')](_0xd2ab('0x1e'),_0x551534['message'],_0x2561d5);_0x53ab3d(_0x5b62dc[_0xd2ab('0x10')](0x1f4,_0x551534['message']));});});};exports[_0xd2ab('0x1f')]=function(_0x18974a){var _0x3f780e=this;return new Promise(function(_0x3bf076,_0x3fb663){return db['SugarcrmAccount'][_0xd2ab('0x20')]({'raw':_0x18974a[_0xd2ab('0x16')]?_0x18974a[_0xd2ab('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x18974a['options']?_0x18974a[_0xd2ab('0x16')]['where']||null:null,'attributes':_0x18974a['options']?_0x18974a[_0xd2ab('0x16')][_0xd2ab('0x19')]||null:null,'include':_0x18974a[_0xd2ab('0x16')]?_0x18974a[_0xd2ab('0x16')][_0xd2ab('0x1b')]?_[_0xd2ab('0x1c')](_0x18974a['options']['include'],function(_0x3cbf4d){return{'model':db[_0x3cbf4d[_0xd2ab('0x1d')]],'as':_0x3cbf4d['as'],'attributes':_0x3cbf4d[_0xd2ab('0x19')],'include':_0x3cbf4d[_0xd2ab('0x1b')]?_[_0xd2ab('0x1c')](_0x3cbf4d[_0xd2ab('0x1b')],function(_0x5538e9){return{'model':db[_0x5538e9['model']],'as':_0x5538e9['as'],'attributes':_0x5538e9[_0xd2ab('0x19')],'include':_0x5538e9[_0xd2ab('0x1b')]?_[_0xd2ab('0x1c')](_0x5538e9[_0xd2ab('0x1b')],function(_0x8a3849){return{'model':db[_0x8a3849[_0xd2ab('0x1d')]],'as':_0x8a3849['as'],'attributes':_0x8a3849[_0xd2ab('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd2ab('0x9')](function(_0x2437f7){logger[_0xd2ab('0xa')]('ShowSugarcrmAccount',_0x18974a);logger[_0xd2ab('0xd')](_0xd2ab('0x1f'),_0x18974a,JSON[_0xd2ab('0xf')](_0x2437f7));_0x3bf076(_0x2437f7);})[_0xd2ab('0x14')](function(_0x55a98b){logger[_0xd2ab('0x10')]('ShowSugarcrmAccount',_0x55a98b[_0xd2ab('0x12')],_0x18974a);_0x3fb663(_0x3f780e[_0xd2ab('0x10')](0x1f4,_0x55a98b[_0xd2ab('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ceafe4f..d95c763 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 _0xb9f9=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x594fa4,_0x18ad92){var _0x42745a=function(_0x4ef904){while(--_0x4ef904){_0x594fa4['push'](_0x594fa4['shift']());}};_0x42745a(++_0x18ad92);}(_0xb9f9,0x120));var _0x9b9f=function(_0x50e12c,_0x4754a5){_0x50e12c=_0x50e12c-0x0;var _0x3a5529=_0xb9f9[_0x50e12c];return _0x3a5529;};'use strict';var multer=require(_0x9b9f('0x0'));var util=require(_0x9b9f('0x1'));var path=require(_0x9b9f('0x2'));var timeout=require(_0x9b9f('0x3'));var express=require(_0x9b9f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9b9f('0x5'));var interaction=require(_0x9b9f('0x6'));var config=require(_0x9b9f('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x9b9f('0x8')]('/',auth[_0x9b9f('0x9')](),controller['index']);router[_0x9b9f('0x8')](_0x9b9f('0xa'),auth[_0x9b9f('0x9')](),controller[_0x9b9f('0xb')]);router['get'](_0x9b9f('0xc'),auth[_0x9b9f('0x9')](),controller[_0x9b9f('0xd')]);router[_0x9b9f('0x8')](_0x9b9f('0xe'),auth[_0x9b9f('0x9')](),controller[_0x9b9f('0xf')]);router[_0x9b9f('0x8')](_0x9b9f('0x10'),auth[_0x9b9f('0x9')](),controller['getDescriptions']);router[_0x9b9f('0x11')]('/',auth[_0x9b9f('0x9')](),controller[_0x9b9f('0x12')]);router['put'](_0x9b9f('0xa'),auth[_0x9b9f('0x9')](),controller[_0x9b9f('0x13')]);router[_0x9b9f('0x14')](_0x9b9f('0xa'),auth[_0x9b9f('0x9')](),controller[_0x9b9f('0x15')]);module[_0x9b9f('0x16')]=router; \ No newline at end of file +var _0xf653=['put','/:id','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x44b415,_0x4cab8b){var _0x335e2e=function(_0x14af65){while(--_0x14af65){_0x44b415['push'](_0x44b415['shift']());}};_0x335e2e(++_0x4cab8b);}(_0xf653,0x82));var _0x3f65=function(_0x425135,_0x3cbd0e){_0x425135=_0x425135-0x0;var _0x316192=_0xf653[_0x425135];return _0x316192;};'use strict';var multer=require(_0x3f65('0x0'));var util=require('util');var path=require(_0x3f65('0x1'));var timeout=require(_0x3f65('0x2'));var express=require(_0x3f65('0x3'));var router=express['Router']();var fs_extra=require(_0x3f65('0x4'));var auth=require(_0x3f65('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3f65('0x6'));router[_0x3f65('0x7')]('/',auth[_0x3f65('0x8')](),controller[_0x3f65('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3f65('0xa')]);router[_0x3f65('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3f65('0xb')]);router['get'](_0x3f65('0xc'),auth[_0x3f65('0x8')](),controller[_0x3f65('0xd')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x3f65('0xe')]);router[_0x3f65('0xf')]('/',auth[_0x3f65('0x8')](),controller[_0x3f65('0x10')]);router[_0x3f65('0x11')](_0x3f65('0x12'),auth[_0x3f65('0x8')](),controller['update']);router[_0x3f65('0x13')]('/:id',auth[_0x3f65('0x8')](),controller['destroy']);module[_0x3f65('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index efe83f0..085322f 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 _0xe3f2=['exports','STRING','sequelize'];(function(_0x2bf423,_0x17f031){var _0x4b3bb4=function(_0x48b03c){while(--_0x48b03c){_0x2bf423['push'](_0x2bf423['shift']());}};_0x4b3bb4(++_0x17f031);}(_0xe3f2,0x83));var _0x2e3f=function(_0x5f5a00,_0x2b50a3){_0x5f5a00=_0x5f5a00-0x0;var _0xb4036=_0xe3f2[_0x5f5a00];return _0xb4036;};'use strict';var Sequelize=require(_0x2e3f('0x0'));module[_0x2e3f('0x1')]={'name':{'type':Sequelize[_0x2e3f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4db9=['sequelize','STRING'];(function(_0x35a9a7,_0x5e8c7f){var _0x142c13=function(_0x6f2671){while(--_0x6f2671){_0x35a9a7['push'](_0x35a9a7['shift']());}};_0x142c13(++_0x5e8c7f);}(_0x4db9,0x6c));var _0x94db=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0x4db9[_0x126f47];return _0x49508a;};'use strict';var Sequelize=require(_0x94db('0x0'));module['exports']={'name':{'type':Sequelize[_0x94db('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 842e1b6..f36d95d 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 _0x4577=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','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','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','SugarcrmConfiguration','rows','catch','show','params','merge','options','create','body','find','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x4577,0xa2));var _0x7457=function(_0x4b7124,_0x206b7b){_0x4b7124=_0x4b7124-0x0;var _0x23e16d=_0x4577[_0x4b7124];return _0x23e16d;};'use strict';var emlformat=require(_0x7457('0x0'));var rimraf=require(_0x7457('0x1'));var zipdir=require(_0x7457('0x2'));var jsonpatch=require(_0x7457('0x3'));var rp=require(_0x7457('0x4'));var moment=require(_0x7457('0x5'));var BPromise=require(_0x7457('0x6'));var Mustache=require('mustache');var util=require(_0x7457('0x7'));var path=require('path');var sox=require(_0x7457('0x8'));var csv=require(_0x7457('0x9'));var ejs=require(_0x7457('0xa'));var fs=require('fs');var fs_extra=require(_0x7457('0xb'));var _=require(_0x7457('0xc'));var squel=require(_0x7457('0xd'));var crypto=require(_0x7457('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7457('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7457('0x10'));var Papa=require(_0x7457('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7457('0x12'));var as=require(_0x7457('0x13'));var hardwareService=require(_0x7457('0x14'));var logger=require('../../config/logger')(_0x7457('0x15'));var utils=require(_0x7457('0x16'));var config=require(_0x7457('0x17'));var licenseUtil=require(_0x7457('0x18'));var db=require(_0x7457('0x19'))['db'];function respondWithStatusCode(_0x45b0d8,_0xc3f20){_0xc3f20=_0xc3f20||0xcc;return function(_0xa4c17e){if(_0xa4c17e){return _0x45b0d8[_0x7457('0x1a')](_0xc3f20);}return _0x45b0d8[_0x7457('0x1b')](_0xc3f20)[_0x7457('0x1c')]();};}function respondWithResult(_0x5775ef,_0x4f5700){_0x4f5700=_0x4f5700||0xc8;return function(_0x67ab76){if(_0x67ab76){return _0x5775ef[_0x7457('0x1b')](_0x4f5700)[_0x7457('0x1d')](_0x67ab76);}};}function respondWithFilteredResult(_0x362f9c,_0x252e40){return function(_0x5ac641){if(_0x5ac641){var _0x487a19=typeof _0x252e40[_0x7457('0x1e')]===_0x7457('0x1f')&&typeof _0x252e40[_0x7457('0x20')]==='undefined';var _0xf8122c=_0x5ac641['count'];var _0x28cf9f=_0x487a19?0x0:_0x252e40[_0x7457('0x1e')];var _0x44e2bb=_0x487a19?_0x5ac641['count']:_0x252e40['offset']+_0x252e40[_0x7457('0x20')];var _0x2352ad;if(_0x44e2bb>=_0xf8122c){_0x44e2bb=_0xf8122c;_0x2352ad=0xc8;}else{_0x2352ad=0xce;}_0x362f9c[_0x7457('0x1b')](_0x2352ad);return _0x362f9c['set'](_0x7457('0x21'),_0x28cf9f+'-'+_0x44e2bb+'/'+_0xf8122c)['json'](_0x5ac641);}return null;};}function patchUpdates(_0x47514f){return function(_0x520fb6){try{jsonpatch['apply'](_0x520fb6,_0x47514f,!![]);}catch(_0x2fa9e7){return BPromise[_0x7457('0x22')](_0x2fa9e7);}return _0x520fb6[_0x7457('0x23')]();};}function saveUpdates(_0x561352,_0x566dae){return function(_0x37393f){if(_0x37393f){return _0x37393f[_0x7457('0x24')](_0x561352)['then'](function(_0xb1ebc1){return _0xb1ebc1;});}return null;};}function removeEntity(_0x1f65b1,_0x57cf78){return function(_0x112a80){if(_0x112a80){return _0x112a80[_0x7457('0x25')]()[_0x7457('0x26')](function(){_0x1f65b1[_0x7457('0x1b')](0xcc)[_0x7457('0x1c')]();});}};}function handleEntityNotFound(_0x38831c,_0x4b5806){return function(_0x42ef61){if(!_0x42ef61){_0x38831c[_0x7457('0x1a')](0x194);}return _0x42ef61;};}function handleError(_0x55832d,_0x15eb10){_0x15eb10=_0x15eb10||0x1f4;return function(_0x1f8734){logger[_0x7457('0x27')](_0x1f8734[_0x7457('0x28')]);if(_0x1f8734[_0x7457('0x29')]){delete _0x1f8734[_0x7457('0x29')];}_0x55832d[_0x7457('0x1b')](_0x15eb10)[_0x7457('0x2a')](_0x1f8734);};}exports[_0x7457('0x2b')]=function(_0x1f1738,_0x5a36ca){var _0x586750={},_0x164304={},_0x5db6b8={'count':0x0,'rows':[]};var _0x39f5d1=_[_0x7457('0x2c')](db['SugarcrmConfiguration'][_0x7457('0x2d')],function(_0x4af1a0){return{'name':_0x4af1a0[_0x7457('0x2e')],'type':_0x4af1a0[_0x7457('0x2f')][_0x7457('0x30')]};});_0x164304[_0x7457('0x31')]=_[_0x7457('0x2c')](_0x39f5d1,_0x7457('0x29'));_0x164304[_0x7457('0x32')]=_[_0x7457('0x33')](_0x1f1738[_0x7457('0x32')]);_0x164304['filters']=_[_0x7457('0x34')](_0x164304[_0x7457('0x31')],_0x164304[_0x7457('0x32')]);_0x586750[_0x7457('0x35')]=_[_0x7457('0x34')](_0x164304[_0x7457('0x31')],qs[_0x7457('0x36')](_0x1f1738[_0x7457('0x32')][_0x7457('0x36')]));_0x586750[_0x7457('0x35')]=_0x586750[_0x7457('0x35')][_0x7457('0x37')]?_0x586750[_0x7457('0x35')]:_0x164304[_0x7457('0x31')];if(!_0x1f1738[_0x7457('0x32')]['hasOwnProperty'](_0x7457('0x38'))){_0x586750[_0x7457('0x20')]=qs[_0x7457('0x20')](_0x1f1738['query']['limit']);_0x586750['offset']=qs[_0x7457('0x1e')](_0x1f1738[_0x7457('0x32')]['offset']);}_0x586750['order']=qs[_0x7457('0x39')](_0x1f1738['query'][_0x7457('0x39')]);_0x586750['where']=qs[_0x7457('0x3a')](_[_0x7457('0x3b')](_0x1f1738[_0x7457('0x32')],_0x164304[_0x7457('0x3a')]),_0x39f5d1);if(_0x1f1738[_0x7457('0x32')][_0x7457('0x3c')]){_0x586750[_0x7457('0x3d')]=_['merge'](_0x586750[_0x7457('0x3d')],{'$or':_[_0x7457('0x2c')](_0x39f5d1,function(_0x1bce95){if(_0x1bce95['type']!==_0x7457('0x3e')){var _0x5d766f={};_0x5d766f[_0x1bce95[_0x7457('0x29')]]={'$like':'%'+_0x1f1738[_0x7457('0x32')][_0x7457('0x3c')]+'%'};return _0x5d766f;}})});}_0x586750=_['merge']({},_0x586750,_0x1f1738['options']);var _0x6306c0={'where':_0x586750[_0x7457('0x3d')]};return db['SugarcrmConfiguration']['count'](_0x6306c0)['then'](function(_0x28ee8f){_0x5db6b8['count']=_0x28ee8f;if(_0x1f1738[_0x7457('0x32')][_0x7457('0x3f')]){_0x586750[_0x7457('0x40')]=[{'all':!![]}];}return db[_0x7457('0x41')]['findAll'](_0x586750);})[_0x7457('0x26')](function(_0x5aa51f){_0x5db6b8[_0x7457('0x42')]=_0x5aa51f;return _0x5db6b8;})[_0x7457('0x26')](respondWithFilteredResult(_0x5a36ca,_0x586750))[_0x7457('0x43')](handleError(_0x5a36ca,null));};exports[_0x7457('0x44')]=function(_0x14b57f,_0x295647){var _0x47ee13={'raw':![],'where':{'id':_0x14b57f[_0x7457('0x45')]['id']}},_0x1a83c3={};_0x1a83c3[_0x7457('0x31')]=_[_0x7457('0x33')](db[_0x7457('0x41')][_0x7457('0x2d')]);_0x1a83c3['query']=_[_0x7457('0x33')](_0x14b57f[_0x7457('0x32')]);_0x1a83c3[_0x7457('0x3a')]=_['intersection'](_0x1a83c3['model'],_0x1a83c3['query']);_0x47ee13[_0x7457('0x35')]=_['intersection'](_0x1a83c3[_0x7457('0x31')],qs[_0x7457('0x36')](_0x14b57f[_0x7457('0x32')][_0x7457('0x36')]));_0x47ee13[_0x7457('0x35')]=_0x47ee13[_0x7457('0x35')][_0x7457('0x37')]?_0x47ee13[_0x7457('0x35')]:_0x1a83c3['model'];if(_0x14b57f[_0x7457('0x32')][_0x7457('0x3f')]){_0x47ee13[_0x7457('0x40')]=[{'all':!![]}];}_0x47ee13=_[_0x7457('0x46')]({},_0x47ee13,_0x14b57f[_0x7457('0x47')]);return db[_0x7457('0x41')]['find'](_0x47ee13)[_0x7457('0x26')](handleEntityNotFound(_0x295647,null))['then'](respondWithResult(_0x295647,null))[_0x7457('0x43')](handleError(_0x295647,null));};exports[_0x7457('0x48')]=function(_0x11b48f,_0xab9a){return db['SugarcrmConfiguration'][_0x7457('0x48')](_0x11b48f[_0x7457('0x49')],{})[_0x7457('0x26')](respondWithResult(_0xab9a,0xc9))[_0x7457('0x43')](handleError(_0xab9a,null));};exports[_0x7457('0x24')]=function(_0x1242c1,_0x4bf4b9){if(_0x1242c1[_0x7457('0x49')]['id']){delete _0x1242c1['body']['id'];}return db[_0x7457('0x41')]['find']({'where':{'id':_0x1242c1[_0x7457('0x45')]['id']}})[_0x7457('0x26')](handleEntityNotFound(_0x4bf4b9,null))[_0x7457('0x26')](saveUpdates(_0x1242c1[_0x7457('0x49')],null))[_0x7457('0x26')](respondWithResult(_0x4bf4b9,null))[_0x7457('0x43')](handleError(_0x4bf4b9,null));};exports[_0x7457('0x25')]=function(_0x55cdb1,_0x13db0f){return db[_0x7457('0x41')][_0x7457('0x4a')]({'where':{'id':_0x55cdb1[_0x7457('0x45')]['id']}})[_0x7457('0x26')](handleEntityNotFound(_0x13db0f,null))[_0x7457('0x26')](removeEntity(_0x13db0f,null))['catch'](handleError(_0x13db0f,null));};exports[_0x7457('0x4b')]=function(_0x56b767,_0x1c7b33,_0x7ab4bc){var _0x5952ad={};var _0xbdc24a={};var _0x26930c;var _0x57f480;return db[_0x7457('0x41')][_0x7457('0x4c')]({'where':{'id':_0x56b767[_0x7457('0x45')]['id']}})[_0x7457('0x26')](handleEntityNotFound(_0x1c7b33,null))[_0x7457('0x26')](function(_0x4388ed){if(_0x4388ed){_0x26930c=_0x4388ed;_0xbdc24a['model']=_['keys'](db[_0x7457('0x4d')]['rawAttributes']);_0xbdc24a['query']=_[_0x7457('0x33')](_0x56b767[_0x7457('0x32')]);_0xbdc24a[_0x7457('0x3a')]=_[_0x7457('0x34')](_0xbdc24a[_0x7457('0x31')],_0xbdc24a[_0x7457('0x32')]);_0x5952ad[_0x7457('0x35')]=_[_0x7457('0x34')](_0xbdc24a[_0x7457('0x31')],qs['fields'](_0x56b767[_0x7457('0x32')]['fields']));_0x5952ad[_0x7457('0x35')]=_0x5952ad[_0x7457('0x35')][_0x7457('0x37')]?_0x5952ad[_0x7457('0x35')]:_0xbdc24a['model'];_0x5952ad['order']=qs[_0x7457('0x39')](_0x56b767[_0x7457('0x32')][_0x7457('0x39')]);_0x5952ad[_0x7457('0x3d')]=qs[_0x7457('0x3a')](_['pick'](_0x56b767[_0x7457('0x32')],_0xbdc24a[_0x7457('0x3a')]));if(_0x56b767['query'][_0x7457('0x3c')]){_0x5952ad['where']=_[_0x7457('0x46')](_0x5952ad['where'],{'$or':_[_0x7457('0x2c')](_0x5952ad[_0x7457('0x35')],function(_0xcacd06){var _0x37d9d7={};_0x37d9d7[_0xcacd06]={'$like':'%'+_0x56b767[_0x7457('0x32')][_0x7457('0x3c')]+'%'};return _0x37d9d7;})});}_0x5952ad=_[_0x7457('0x46')]({},_0x5952ad,_0x56b767[_0x7457('0x47')]);return _0x26930c[_0x7457('0x4b')](_0x5952ad);}})[_0x7457('0x26')](function(_0xa70352){if(_0xa70352){_0x57f480=_0xa70352[_0x7457('0x37')];if(!_0x56b767[_0x7457('0x32')][_0x7457('0x4e')]('nolimit')){_0x5952ad[_0x7457('0x20')]=qs[_0x7457('0x20')](_0x56b767[_0x7457('0x32')][_0x7457('0x20')]);_0x5952ad['offset']=qs[_0x7457('0x1e')](_0x56b767[_0x7457('0x32')][_0x7457('0x1e')]);}return _0x26930c['getFields'](_0x5952ad);}})[_0x7457('0x26')](function(_0x5abf78){if(_0x5abf78){return _0x5abf78?{'count':_0x57f480,'rows':_0x5abf78}:null;}})[_0x7457('0x26')](respondWithResult(_0x1c7b33,null))[_0x7457('0x43')](handleError(_0x1c7b33,null));};exports['getSubjects']=function(_0x4b2889,_0x526784,_0x31a1e8){var _0x4a596d={};var _0x235ba3={};var _0x1525eb;var _0x803eb0;return db[_0x7457('0x41')][_0x7457('0x4c')]({'where':{'id':_0x4b2889[_0x7457('0x45')]['id']}})[_0x7457('0x26')](handleEntityNotFound(_0x526784,null))['then'](function(_0xf52f14){if(_0xf52f14){_0x1525eb=_0xf52f14;_0x235ba3[_0x7457('0x31')]=_[_0x7457('0x33')](db[_0x7457('0x4d')]['rawAttributes']);_0x235ba3['query']=_[_0x7457('0x33')](_0x4b2889[_0x7457('0x32')]);_0x235ba3['filters']=_[_0x7457('0x34')](_0x235ba3[_0x7457('0x31')],_0x235ba3['query']);_0x4a596d[_0x7457('0x35')]=_['intersection'](_0x235ba3[_0x7457('0x31')],qs['fields'](_0x4b2889['query']['fields']));_0x4a596d[_0x7457('0x35')]=_0x4a596d[_0x7457('0x35')][_0x7457('0x37')]?_0x4a596d['attributes']:_0x235ba3['model'];_0x4a596d['order']=qs[_0x7457('0x39')](_0x4b2889['query']['sort']);_0x4a596d[_0x7457('0x3d')]=qs[_0x7457('0x3a')](_[_0x7457('0x3b')](_0x4b2889[_0x7457('0x32')],_0x235ba3['filters']));if(_0x4b2889['query'][_0x7457('0x3c')]){_0x4a596d['where']=_[_0x7457('0x46')](_0x4a596d[_0x7457('0x3d')],{'$or':_[_0x7457('0x2c')](_0x4a596d['attributes'],function(_0x1c8095){var _0x457433={};_0x457433[_0x1c8095]={'$like':'%'+_0x4b2889[_0x7457('0x32')]['filter']+'%'};return _0x457433;})});}_0x4a596d=_[_0x7457('0x46')]({},_0x4a596d,_0x4b2889[_0x7457('0x47')]);return _0x1525eb[_0x7457('0x4f')](_0x4a596d);}})[_0x7457('0x26')](function(_0xbe0f65){if(_0xbe0f65){_0x803eb0=_0xbe0f65[_0x7457('0x37')];if(!_0x4b2889['query'][_0x7457('0x4e')](_0x7457('0x38'))){_0x4a596d[_0x7457('0x20')]=qs[_0x7457('0x20')](_0x4b2889[_0x7457('0x32')]['limit']);_0x4a596d['offset']=qs[_0x7457('0x1e')](_0x4b2889[_0x7457('0x32')][_0x7457('0x1e')]);}return _0x1525eb['getSubjects'](_0x4a596d);}})['then'](function(_0x4319f7){if(_0x4319f7){return _0x4319f7?{'count':_0x803eb0,'rows':_0x4319f7}:null;}})[_0x7457('0x26')](respondWithResult(_0x526784,null))[_0x7457('0x43')](handleError(_0x526784,null));};exports['getDescriptions']=function(_0x505b8f,_0x229434,_0x4b0477){var _0x58ef2a={};var _0xbd6116={};var _0x564e9c;var _0x283826;return db[_0x7457('0x41')][_0x7457('0x4c')]({'where':{'id':_0x505b8f['params']['id']}})[_0x7457('0x26')](handleEntityNotFound(_0x229434,null))[_0x7457('0x26')](function(_0x2db099){if(_0x2db099){_0x564e9c=_0x2db099;_0xbd6116['model']=_[_0x7457('0x33')](db[_0x7457('0x4d')]['rawAttributes']);_0xbd6116['query']=_[_0x7457('0x33')](_0x505b8f[_0x7457('0x32')]);_0xbd6116[_0x7457('0x3a')]=_[_0x7457('0x34')](_0xbd6116['model'],_0xbd6116[_0x7457('0x32')]);_0x58ef2a[_0x7457('0x35')]=_[_0x7457('0x34')](_0xbd6116['model'],qs[_0x7457('0x36')](_0x505b8f[_0x7457('0x32')][_0x7457('0x36')]));_0x58ef2a[_0x7457('0x35')]=_0x58ef2a[_0x7457('0x35')]['length']?_0x58ef2a[_0x7457('0x35')]:_0xbd6116[_0x7457('0x31')];_0x58ef2a['order']=qs[_0x7457('0x39')](_0x505b8f[_0x7457('0x32')]['sort']);_0x58ef2a[_0x7457('0x3d')]=qs[_0x7457('0x3a')](_[_0x7457('0x3b')](_0x505b8f[_0x7457('0x32')],_0xbd6116[_0x7457('0x3a')]));if(_0x505b8f[_0x7457('0x32')]['filter']){_0x58ef2a[_0x7457('0x3d')]=_[_0x7457('0x46')](_0x58ef2a['where'],{'$or':_[_0x7457('0x2c')](_0x58ef2a[_0x7457('0x35')],function(_0x2956f5){var _0x15a04c={};_0x15a04c[_0x2956f5]={'$like':'%'+_0x505b8f['query'][_0x7457('0x3c')]+'%'};return _0x15a04c;})});}_0x58ef2a=_['merge']({},_0x58ef2a,_0x505b8f[_0x7457('0x47')]);return _0x564e9c[_0x7457('0x50')](_0x58ef2a);}})[_0x7457('0x26')](function(_0x31d347){if(_0x31d347){_0x283826=_0x31d347[_0x7457('0x37')];if(!_0x505b8f['query'][_0x7457('0x4e')](_0x7457('0x38'))){_0x58ef2a[_0x7457('0x20')]=qs['limit'](_0x505b8f[_0x7457('0x32')]['limit']);_0x58ef2a[_0x7457('0x1e')]=qs[_0x7457('0x1e')](_0x505b8f[_0x7457('0x32')][_0x7457('0x1e')]);}return _0x564e9c[_0x7457('0x50')](_0x58ef2a);}})[_0x7457('0x26')](function(_0x1754de){if(_0x1754de){return _0x1754de?{'count':_0x283826,'rows':_0x1754de}:null;}})[_0x7457('0x26')](respondWithResult(_0x229434,null))[_0x7457('0x43')](handleError(_0x229434,null));}; \ No newline at end of file +var _0xec39=['destroy','sendStatus','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','show','params','find','catch','create','body','getFields','findOne','SugarcrmField','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update'];(function(_0x5ac713,_0x1c917a){var _0x1e2174=function(_0xebf8c8){while(--_0xebf8c8){_0x5ac713['push'](_0x5ac713['shift']());}};_0x1e2174(++_0x1c917a);}(_0xec39,0xcd));var _0x9ec3=function(_0x217c14,_0x1ca459){_0x217c14=_0x217c14-0x0;var _0x2999f6=_0xec39[_0x217c14];return _0x2999f6;};'use strict';var emlformat=require(_0x9ec3('0x0'));var rimraf=require(_0x9ec3('0x1'));var zipdir=require(_0x9ec3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ec3('0x3'));var moment=require(_0x9ec3('0x4'));var BPromise=require(_0x9ec3('0x5'));var Mustache=require(_0x9ec3('0x6'));var util=require(_0x9ec3('0x7'));var path=require('path');var sox=require(_0x9ec3('0x8'));var csv=require(_0x9ec3('0x9'));var ejs=require(_0x9ec3('0xa'));var fs=require('fs');var fs_extra=require(_0x9ec3('0xb'));var _=require(_0x9ec3('0xc'));var squel=require(_0x9ec3('0xd'));var crypto=require(_0x9ec3('0xe'));var jsforce=require(_0x9ec3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9ec3('0x9'));var querystring=require(_0x9ec3('0x10'));var Papa=require(_0x9ec3('0x11'));var Redis=require(_0x9ec3('0x12'));var authService=require(_0x9ec3('0x13'));var qs=require(_0x9ec3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ec3('0x15'));var logger=require(_0x9ec3('0x16'))('api');var utils=require(_0x9ec3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9ec3('0x18'));var db=require(_0x9ec3('0x19'))['db'];function respondWithStatusCode(_0x17b2fa,_0x5b371f){_0x5b371f=_0x5b371f||0xcc;return function(_0x337f6b){if(_0x337f6b){return _0x17b2fa['sendStatus'](_0x5b371f);}return _0x17b2fa[_0x9ec3('0x1a')](_0x5b371f)[_0x9ec3('0x1b')]();};}function respondWithResult(_0x505767,_0x552e42){_0x552e42=_0x552e42||0xc8;return function(_0x275bdc){if(_0x275bdc){return _0x505767[_0x9ec3('0x1a')](_0x552e42)[_0x9ec3('0x1c')](_0x275bdc);}};}function respondWithFilteredResult(_0x256605,_0x23e41d){return function(_0x3f2592){if(_0x3f2592){var _0x38ce76=typeof _0x23e41d[_0x9ec3('0x1d')]===_0x9ec3('0x1e')&&typeof _0x23e41d['limit']==='undefined';var _0x4db5a5=_0x3f2592[_0x9ec3('0x1f')];var _0x32a2a2=_0x38ce76?0x0:_0x23e41d[_0x9ec3('0x1d')];var _0x41033f=_0x38ce76?_0x3f2592[_0x9ec3('0x1f')]:_0x23e41d[_0x9ec3('0x1d')]+_0x23e41d[_0x9ec3('0x20')];var _0x38abf5;if(_0x41033f>=_0x4db5a5){_0x41033f=_0x4db5a5;_0x38abf5=0xc8;}else{_0x38abf5=0xce;}_0x256605[_0x9ec3('0x1a')](_0x38abf5);return _0x256605['set'](_0x9ec3('0x21'),_0x32a2a2+'-'+_0x41033f+'/'+_0x4db5a5)[_0x9ec3('0x1c')](_0x3f2592);}return null;};}function patchUpdates(_0x1c86aa){return function(_0x493ff8){try{jsonpatch[_0x9ec3('0x22')](_0x493ff8,_0x1c86aa,!![]);}catch(_0x53f091){return BPromise[_0x9ec3('0x23')](_0x53f091);}return _0x493ff8[_0x9ec3('0x24')]();};}function saveUpdates(_0xb85bf9,_0x30e97b){return function(_0x4df919){if(_0x4df919){return _0x4df919[_0x9ec3('0x25')](_0xb85bf9)['then'](function(_0x5a8af5){return _0x5a8af5;});}return null;};}function removeEntity(_0x2fc64c,_0x3ea640){return function(_0x2085c4){if(_0x2085c4){return _0x2085c4[_0x9ec3('0x26')]()['then'](function(){_0x2fc64c[_0x9ec3('0x1a')](0xcc)[_0x9ec3('0x1b')]();});}};}function handleEntityNotFound(_0x5a8adb,_0x52c6f5){return function(_0x519b3a){if(!_0x519b3a){_0x5a8adb[_0x9ec3('0x27')](0x194);}return _0x519b3a;};}function handleError(_0x1b0d5a,_0x928f51){_0x928f51=_0x928f51||0x1f4;return function(_0x4c66dc){logger[_0x9ec3('0x28')](_0x4c66dc['stack']);if(_0x4c66dc[_0x9ec3('0x29')]){delete _0x4c66dc[_0x9ec3('0x29')];}_0x1b0d5a['status'](_0x928f51)[_0x9ec3('0x2a')](_0x4c66dc);};}exports[_0x9ec3('0x2b')]=function(_0x551786,_0xf46456){var _0x2171f7={},_0x16e090={},_0x52b503={'count':0x0,'rows':[]};var _0x2c960e=_[_0x9ec3('0x2c')](db[_0x9ec3('0x2d')][_0x9ec3('0x2e')],function(_0x28e201){return{'name':_0x28e201['fieldName'],'type':_0x28e201[_0x9ec3('0x2f')][_0x9ec3('0x30')]};});_0x16e090[_0x9ec3('0x31')]=_[_0x9ec3('0x2c')](_0x2c960e,_0x9ec3('0x29'));_0x16e090[_0x9ec3('0x32')]=_[_0x9ec3('0x33')](_0x551786[_0x9ec3('0x32')]);_0x16e090[_0x9ec3('0x34')]=_['intersection'](_0x16e090[_0x9ec3('0x31')],_0x16e090['query']);_0x2171f7['attributes']=_[_0x9ec3('0x35')](_0x16e090[_0x9ec3('0x31')],qs['fields'](_0x551786['query'][_0x9ec3('0x36')]));_0x2171f7[_0x9ec3('0x37')]=_0x2171f7['attributes'][_0x9ec3('0x38')]?_0x2171f7[_0x9ec3('0x37')]:_0x16e090[_0x9ec3('0x31')];if(!_0x551786['query']['hasOwnProperty']('nolimit')){_0x2171f7[_0x9ec3('0x20')]=qs[_0x9ec3('0x20')](_0x551786[_0x9ec3('0x32')][_0x9ec3('0x20')]);_0x2171f7[_0x9ec3('0x1d')]=qs[_0x9ec3('0x1d')](_0x551786[_0x9ec3('0x32')][_0x9ec3('0x1d')]);}_0x2171f7[_0x9ec3('0x39')]=qs[_0x9ec3('0x3a')](_0x551786[_0x9ec3('0x32')][_0x9ec3('0x3a')]);_0x2171f7[_0x9ec3('0x3b')]=qs[_0x9ec3('0x34')](_[_0x9ec3('0x3c')](_0x551786[_0x9ec3('0x32')],_0x16e090[_0x9ec3('0x34')]),_0x2c960e);if(_0x551786[_0x9ec3('0x32')][_0x9ec3('0x3d')]){_0x2171f7['where']=_[_0x9ec3('0x3e')](_0x2171f7[_0x9ec3('0x3b')],{'$or':_[_0x9ec3('0x2c')](_0x2c960e,function(_0x275ebe){if(_0x275ebe['type']!==_0x9ec3('0x3f')){var _0x30e3f4={};_0x30e3f4[_0x275ebe[_0x9ec3('0x29')]]={'$like':'%'+_0x551786[_0x9ec3('0x32')][_0x9ec3('0x3d')]+'%'};return _0x30e3f4;}})});}_0x2171f7=_[_0x9ec3('0x3e')]({},_0x2171f7,_0x551786[_0x9ec3('0x40')]);var _0x357184={'where':_0x2171f7['where']};return db['SugarcrmConfiguration'][_0x9ec3('0x1f')](_0x357184)[_0x9ec3('0x41')](function(_0x2ceea6){_0x52b503[_0x9ec3('0x1f')]=_0x2ceea6;if(_0x551786[_0x9ec3('0x32')][_0x9ec3('0x42')]){_0x2171f7[_0x9ec3('0x43')]=[{'all':!![]}];}return db[_0x9ec3('0x2d')]['findAll'](_0x2171f7);})[_0x9ec3('0x41')](function(_0x19c68f){_0x52b503['rows']=_0x19c68f;return _0x52b503;})[_0x9ec3('0x41')](respondWithFilteredResult(_0xf46456,_0x2171f7))['catch'](handleError(_0xf46456,null));};exports[_0x9ec3('0x44')]=function(_0x7e36ad,_0x5781de){var _0x3bda8c={'raw':![],'where':{'id':_0x7e36ad[_0x9ec3('0x45')]['id']}},_0x5b28dc={};_0x5b28dc[_0x9ec3('0x31')]=_[_0x9ec3('0x33')](db['SugarcrmConfiguration'][_0x9ec3('0x2e')]);_0x5b28dc[_0x9ec3('0x32')]=_[_0x9ec3('0x33')](_0x7e36ad[_0x9ec3('0x32')]);_0x5b28dc[_0x9ec3('0x34')]=_['intersection'](_0x5b28dc[_0x9ec3('0x31')],_0x5b28dc[_0x9ec3('0x32')]);_0x3bda8c[_0x9ec3('0x37')]=_[_0x9ec3('0x35')](_0x5b28dc[_0x9ec3('0x31')],qs[_0x9ec3('0x36')](_0x7e36ad[_0x9ec3('0x32')][_0x9ec3('0x36')]));_0x3bda8c[_0x9ec3('0x37')]=_0x3bda8c[_0x9ec3('0x37')][_0x9ec3('0x38')]?_0x3bda8c[_0x9ec3('0x37')]:_0x5b28dc[_0x9ec3('0x31')];if(_0x7e36ad[_0x9ec3('0x32')][_0x9ec3('0x42')]){_0x3bda8c[_0x9ec3('0x43')]=[{'all':!![]}];}_0x3bda8c=_[_0x9ec3('0x3e')]({},_0x3bda8c,_0x7e36ad[_0x9ec3('0x40')]);return db[_0x9ec3('0x2d')][_0x9ec3('0x46')](_0x3bda8c)['then'](handleEntityNotFound(_0x5781de,null))['then'](respondWithResult(_0x5781de,null))[_0x9ec3('0x47')](handleError(_0x5781de,null));};exports['create']=function(_0x85e0d8,_0x2208e2){return db[_0x9ec3('0x2d')][_0x9ec3('0x48')](_0x85e0d8[_0x9ec3('0x49')],{})['then'](respondWithResult(_0x2208e2,0xc9))['catch'](handleError(_0x2208e2,null));};exports['update']=function(_0x34040f,_0x1d844e){if(_0x34040f[_0x9ec3('0x49')]['id']){delete _0x34040f[_0x9ec3('0x49')]['id'];}return db[_0x9ec3('0x2d')][_0x9ec3('0x46')]({'where':{'id':_0x34040f['params']['id']}})[_0x9ec3('0x41')](handleEntityNotFound(_0x1d844e,null))[_0x9ec3('0x41')](saveUpdates(_0x34040f['body'],null))[_0x9ec3('0x41')](respondWithResult(_0x1d844e,null))[_0x9ec3('0x47')](handleError(_0x1d844e,null));};exports[_0x9ec3('0x26')]=function(_0x9a48b5,_0x132067){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x9a48b5[_0x9ec3('0x45')]['id']}})[_0x9ec3('0x41')](handleEntityNotFound(_0x132067,null))[_0x9ec3('0x41')](removeEntity(_0x132067,null))['catch'](handleError(_0x132067,null));};exports[_0x9ec3('0x4a')]=function(_0x252899,_0x353010,_0x2b08cd){var _0x513be2={};var _0x5450ee={};var _0x23123e;var _0x51d5ba;return db[_0x9ec3('0x2d')][_0x9ec3('0x4b')]({'where':{'id':_0x252899[_0x9ec3('0x45')]['id']}})[_0x9ec3('0x41')](handleEntityNotFound(_0x353010,null))[_0x9ec3('0x41')](function(_0x388954){if(_0x388954){_0x23123e=_0x388954;_0x5450ee['model']=_[_0x9ec3('0x33')](db[_0x9ec3('0x4c')][_0x9ec3('0x2e')]);_0x5450ee[_0x9ec3('0x32')]=_[_0x9ec3('0x33')](_0x252899[_0x9ec3('0x32')]);_0x5450ee['filters']=_['intersection'](_0x5450ee[_0x9ec3('0x31')],_0x5450ee[_0x9ec3('0x32')]);_0x513be2[_0x9ec3('0x37')]=_[_0x9ec3('0x35')](_0x5450ee[_0x9ec3('0x31')],qs[_0x9ec3('0x36')](_0x252899[_0x9ec3('0x32')][_0x9ec3('0x36')]));_0x513be2[_0x9ec3('0x37')]=_0x513be2[_0x9ec3('0x37')]['length']?_0x513be2[_0x9ec3('0x37')]:_0x5450ee[_0x9ec3('0x31')];_0x513be2[_0x9ec3('0x39')]=qs['sort'](_0x252899['query'][_0x9ec3('0x3a')]);_0x513be2['where']=qs['filters'](_[_0x9ec3('0x3c')](_0x252899[_0x9ec3('0x32')],_0x5450ee[_0x9ec3('0x34')]));if(_0x252899[_0x9ec3('0x32')][_0x9ec3('0x3d')]){_0x513be2[_0x9ec3('0x3b')]=_[_0x9ec3('0x3e')](_0x513be2[_0x9ec3('0x3b')],{'$or':_[_0x9ec3('0x2c')](_0x513be2['attributes'],function(_0x51ef5a){var _0x5cd0ca={};_0x5cd0ca[_0x51ef5a]={'$like':'%'+_0x252899[_0x9ec3('0x32')][_0x9ec3('0x3d')]+'%'};return _0x5cd0ca;})});}_0x513be2=_[_0x9ec3('0x3e')]({},_0x513be2,_0x252899[_0x9ec3('0x40')]);return _0x23123e[_0x9ec3('0x4a')](_0x513be2);}})[_0x9ec3('0x41')](function(_0x58db18){if(_0x58db18){_0x51d5ba=_0x58db18[_0x9ec3('0x38')];if(!_0x252899[_0x9ec3('0x32')]['hasOwnProperty']('nolimit')){_0x513be2[_0x9ec3('0x20')]=qs['limit'](_0x252899['query'][_0x9ec3('0x20')]);_0x513be2[_0x9ec3('0x1d')]=qs[_0x9ec3('0x1d')](_0x252899['query']['offset']);}return _0x23123e[_0x9ec3('0x4a')](_0x513be2);}})['then'](function(_0x15c4fb){if(_0x15c4fb){return _0x15c4fb?{'count':_0x51d5ba,'rows':_0x15c4fb}:null;}})[_0x9ec3('0x41')](respondWithResult(_0x353010,null))[_0x9ec3('0x47')](handleError(_0x353010,null));};exports['getSubjects']=function(_0xfc8c92,_0x4ea73a,_0x440d17){var _0x30d8ae={};var _0x5dd469={};var _0x195fc8;var _0x4a1df2;return db[_0x9ec3('0x2d')][_0x9ec3('0x4b')]({'where':{'id':_0xfc8c92[_0x9ec3('0x45')]['id']}})[_0x9ec3('0x41')](handleEntityNotFound(_0x4ea73a,null))[_0x9ec3('0x41')](function(_0x34fa25){if(_0x34fa25){_0x195fc8=_0x34fa25;_0x5dd469['model']=_[_0x9ec3('0x33')](db['SugarcrmField'][_0x9ec3('0x2e')]);_0x5dd469[_0x9ec3('0x32')]=_['keys'](_0xfc8c92[_0x9ec3('0x32')]);_0x5dd469['filters']=_[_0x9ec3('0x35')](_0x5dd469[_0x9ec3('0x31')],_0x5dd469[_0x9ec3('0x32')]);_0x30d8ae['attributes']=_[_0x9ec3('0x35')](_0x5dd469['model'],qs[_0x9ec3('0x36')](_0xfc8c92[_0x9ec3('0x32')][_0x9ec3('0x36')]));_0x30d8ae['attributes']=_0x30d8ae['attributes']['length']?_0x30d8ae[_0x9ec3('0x37')]:_0x5dd469[_0x9ec3('0x31')];_0x30d8ae[_0x9ec3('0x39')]=qs[_0x9ec3('0x3a')](_0xfc8c92['query'][_0x9ec3('0x3a')]);_0x30d8ae[_0x9ec3('0x3b')]=qs['filters'](_[_0x9ec3('0x3c')](_0xfc8c92[_0x9ec3('0x32')],_0x5dd469[_0x9ec3('0x34')]));if(_0xfc8c92[_0x9ec3('0x32')]['filter']){_0x30d8ae[_0x9ec3('0x3b')]=_['merge'](_0x30d8ae[_0x9ec3('0x3b')],{'$or':_[_0x9ec3('0x2c')](_0x30d8ae[_0x9ec3('0x37')],function(_0x2c8993){var _0xf8915a={};_0xf8915a[_0x2c8993]={'$like':'%'+_0xfc8c92[_0x9ec3('0x32')]['filter']+'%'};return _0xf8915a;})});}_0x30d8ae=_[_0x9ec3('0x3e')]({},_0x30d8ae,_0xfc8c92['options']);return _0x195fc8['getSubjects'](_0x30d8ae);}})['then'](function(_0x3657a5){if(_0x3657a5){_0x4a1df2=_0x3657a5[_0x9ec3('0x38')];if(!_0xfc8c92[_0x9ec3('0x32')][_0x9ec3('0x4d')](_0x9ec3('0x4e'))){_0x30d8ae[_0x9ec3('0x20')]=qs['limit'](_0xfc8c92[_0x9ec3('0x32')][_0x9ec3('0x20')]);_0x30d8ae[_0x9ec3('0x1d')]=qs['offset'](_0xfc8c92[_0x9ec3('0x32')][_0x9ec3('0x1d')]);}return _0x195fc8[_0x9ec3('0x4f')](_0x30d8ae);}})[_0x9ec3('0x41')](function(_0x4d8660){if(_0x4d8660){return _0x4d8660?{'count':_0x4a1df2,'rows':_0x4d8660}:null;}})[_0x9ec3('0x41')](respondWithResult(_0x4ea73a,null))['catch'](handleError(_0x4ea73a,null));};exports[_0x9ec3('0x50')]=function(_0x5a3757,_0x70a892,_0x533b23){var _0x90204b={};var _0x521ca7={};var _0x2145dd;var _0x3902b4;return db[_0x9ec3('0x2d')][_0x9ec3('0x4b')]({'where':{'id':_0x5a3757[_0x9ec3('0x45')]['id']}})[_0x9ec3('0x41')](handleEntityNotFound(_0x70a892,null))['then'](function(_0x3ee98c){if(_0x3ee98c){_0x2145dd=_0x3ee98c;_0x521ca7['model']=_[_0x9ec3('0x33')](db['SugarcrmField'][_0x9ec3('0x2e')]);_0x521ca7[_0x9ec3('0x32')]=_[_0x9ec3('0x33')](_0x5a3757['query']);_0x521ca7[_0x9ec3('0x34')]=_[_0x9ec3('0x35')](_0x521ca7[_0x9ec3('0x31')],_0x521ca7['query']);_0x90204b[_0x9ec3('0x37')]=_[_0x9ec3('0x35')](_0x521ca7['model'],qs['fields'](_0x5a3757[_0x9ec3('0x32')][_0x9ec3('0x36')]));_0x90204b[_0x9ec3('0x37')]=_0x90204b[_0x9ec3('0x37')][_0x9ec3('0x38')]?_0x90204b[_0x9ec3('0x37')]:_0x521ca7[_0x9ec3('0x31')];_0x90204b[_0x9ec3('0x39')]=qs[_0x9ec3('0x3a')](_0x5a3757[_0x9ec3('0x32')][_0x9ec3('0x3a')]);_0x90204b[_0x9ec3('0x3b')]=qs[_0x9ec3('0x34')](_[_0x9ec3('0x3c')](_0x5a3757[_0x9ec3('0x32')],_0x521ca7[_0x9ec3('0x34')]));if(_0x5a3757[_0x9ec3('0x32')][_0x9ec3('0x3d')]){_0x90204b[_0x9ec3('0x3b')]=_[_0x9ec3('0x3e')](_0x90204b['where'],{'$or':_[_0x9ec3('0x2c')](_0x90204b['attributes'],function(_0x547dc5){var _0x3fea18={};_0x3fea18[_0x547dc5]={'$like':'%'+_0x5a3757[_0x9ec3('0x32')][_0x9ec3('0x3d')]+'%'};return _0x3fea18;})});}_0x90204b=_[_0x9ec3('0x3e')]({},_0x90204b,_0x5a3757[_0x9ec3('0x40')]);return _0x2145dd['getDescriptions'](_0x90204b);}})['then'](function(_0x17afcb){if(_0x17afcb){_0x3902b4=_0x17afcb[_0x9ec3('0x38')];if(!_0x5a3757['query'][_0x9ec3('0x4d')](_0x9ec3('0x4e'))){_0x90204b[_0x9ec3('0x20')]=qs['limit'](_0x5a3757['query']['limit']);_0x90204b[_0x9ec3('0x1d')]=qs[_0x9ec3('0x1d')](_0x5a3757[_0x9ec3('0x32')][_0x9ec3('0x1d')]);}return _0x2145dd['getDescriptions'](_0x90204b);}})[_0x9ec3('0x41')](function(_0x15f6ee){if(_0x15f6ee){return _0x15f6ee?{'count':_0x3902b4,'rows':_0x15f6ee}:null;}})[_0x9ec3('0x41')](respondWithResult(_0x70a892,null))[_0x9ec3('0x47')](handleError(_0x70a892,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 74d8617..259b9b5 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 _0x8f73=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x100654,_0x4ae04b){var _0x1e9b9f=function(_0x8d69d6){while(--_0x8d69d6){_0x100654['push'](_0x100654['shift']());}};_0x1e9b9f(++_0x4ae04b);}(_0x8f73,0x8a));var _0x38f7=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8f73[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require('lodash');var util=require(_0x38f7('0x0'));var logger=require(_0x38f7('0x1'))(_0x38f7('0x2'));var moment=require(_0x38f7('0x3'));var BPromise=require(_0x38f7('0x4'));var rp=require(_0x38f7('0x5'));var fs=require('fs');var path=require(_0x38f7('0x6'));var rimraf=require(_0x38f7('0x7'));var config=require(_0x38f7('0x8'));var attributes=require(_0x38f7('0x9'));module['exports']=function(_0x5309a6,_0x20f35b){return _0x5309a6[_0x38f7('0xa')](_0x38f7('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e4e=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','bluebird','path'];(function(_0x5da400,_0x1180f8){var _0x3c1858=function(_0x4b762b){while(--_0x4b762b){_0x5da400['push'](_0x5da400['shift']());}};_0x3c1858(++_0x1180f8);}(_0x0e4e,0x16f));var _0xe0e4=function(_0x414648,_0x34a290){_0x414648=_0x414648-0x0;var _0x3fae7=_0x0e4e[_0x414648];return _0x3fae7;};'use strict';var _=require(_0xe0e4('0x0'));var util=require(_0xe0e4('0x1'));var logger=require('../../config/logger')(_0xe0e4('0x2'));var moment=require('moment');var BPromise=require(_0xe0e4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0e4('0x4'));var rimraf=require(_0xe0e4('0x5'));var config=require(_0xe0e4('0x6'));var attributes=require(_0xe0e4('0x7'));module[_0xe0e4('0x8')]=function(_0x1863e,_0x5460a4){return _0x1863e[_0xe0e4('0x9')](_0xe0e4('0xa'),attributes,{'tableName':_0xe0e4('0xb'),'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 862f308..0182d38 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 _0xc5a2=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch'];(function(_0x4a6390,_0x55e98a){var _0x14e4d5=function(_0x2bb9f6){while(--_0x2bb9f6){_0x4a6390['push'](_0x4a6390['shift']());}};_0x14e4d5(++_0x55e98a);}(_0xc5a2,0xcf));var _0x2c5a=function(_0x53f36a,_0x3be2f2){_0x53f36a=_0x53f36a-0x0;var _0x4bb260=_0xc5a2[_0x53f36a];return _0x4bb260;};'use strict';var _=require(_0x2c5a('0x0'));var util=require(_0x2c5a('0x1'));var moment=require(_0x2c5a('0x2'));var BPromise=require(_0x2c5a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c5a('0x4'));var db=require(_0x2c5a('0x5'))['db'];var utils=require(_0x2c5a('0x6'));var logger=require(_0x2c5a('0x7'))(_0x2c5a('0x8'));var config=require(_0x2c5a('0x9'));var jayson=require(_0x2c5a('0xa'));var client=jayson[_0x2c5a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a9a39,_0x46f68b,_0x395da8){return new BPromise(function(_0x3e4011,_0x724f4c){return client['request'](_0x3a9a39,_0x395da8)[_0x2c5a('0xc')](function(_0x14c1ee){logger['info'](_0x2c5a('0xd'),_0x46f68b,'request\x20sent');logger[_0x2c5a('0xe')](_0x2c5a('0xf'),_0x46f68b,'request\x20sent',JSON[_0x2c5a('0x10')](_0x14c1ee));if(_0x14c1ee[_0x2c5a('0x11')]){if(_0x14c1ee[_0x2c5a('0x11')]['code']===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x46f68b,_0x14c1ee['error'][_0x2c5a('0x12')]);return _0x724f4c(_0x14c1ee[_0x2c5a('0x11')]['message']);}logger['error'](_0x2c5a('0xd'),_0x46f68b,_0x14c1ee[_0x2c5a('0x11')][_0x2c5a('0x12')]);return _0x3e4011(_0x14c1ee['error'][_0x2c5a('0x12')]);}else{logger[_0x2c5a('0x13')](_0x2c5a('0xd'),_0x46f68b,_0x2c5a('0x14'));_0x3e4011(_0x14c1ee[_0x2c5a('0x15')][_0x2c5a('0x12')]);}})[_0x2c5a('0x16')](function(_0x2ca81b){logger[_0x2c5a('0x11')](_0x2c5a('0xd'),_0x46f68b,_0x2ca81b);_0x724f4c(_0x2ca81b);});});} \ No newline at end of file +var _0x73aa=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1058d1,_0x122d13){var _0x3078cf=function(_0x3361a5){while(--_0x3361a5){_0x1058d1['push'](_0x1058d1['shift']());}};_0x3078cf(++_0x122d13);}(_0x73aa,0x1a1));var _0xa73a=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x73aa[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require(_0xa73a('0x0'));var util=require(_0xa73a('0x1'));var moment=require('moment');var BPromise=require(_0xa73a('0x2'));var rs=require(_0xa73a('0x3'));var fs=require('fs');var Redis=require(_0xa73a('0x4'));var db=require(_0xa73a('0x5'))['db'];var utils=require(_0xa73a('0x6'));var logger=require(_0xa73a('0x7'))(_0xa73a('0x8'));var config=require(_0xa73a('0x9'));var jayson=require(_0xa73a('0xa'));var client=jayson[_0xa73a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41f34c,_0x14e53b,_0x122128){return new BPromise(function(_0x403d13,_0x118422){return client[_0xa73a('0xc')](_0x41f34c,_0x122128)[_0xa73a('0xd')](function(_0x4902e9){logger[_0xa73a('0xe')](_0xa73a('0xf'),_0x14e53b,_0xa73a('0x10'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x14e53b,_0xa73a('0x10'),JSON[_0xa73a('0x11')](_0x4902e9));if(_0x4902e9[_0xa73a('0x12')]){if(_0x4902e9[_0xa73a('0x12')][_0xa73a('0x13')]===0x1f4){logger[_0xa73a('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x14e53b,_0x4902e9['error'][_0xa73a('0x14')]);return _0x118422(_0x4902e9['error'][_0xa73a('0x14')]);}logger[_0xa73a('0x12')](_0xa73a('0xf'),_0x14e53b,_0x4902e9['error'][_0xa73a('0x14')]);return _0x403d13(_0x4902e9[_0xa73a('0x12')][_0xa73a('0x14')]);}else{logger[_0xa73a('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x14e53b,_0xa73a('0x10'));_0x403d13(_0x4902e9[_0xa73a('0x15')]['message']);}})[_0xa73a('0x16')](function(_0x404da5){logger[_0xa73a('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x14e53b,_0x404da5);_0x118422(_0x404da5);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index d6eff17..a5f5f96 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 _0x6642=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','create','put','update','delete'];(function(_0x5e356a,_0x3cb397){var _0x3b842b=function(_0x545a8d){while(--_0x545a8d){_0x5e356a['push'](_0x5e356a['shift']());}};_0x3b842b(++_0x3cb397);}(_0x6642,0xc7));var _0x2664=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6642[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2664('0x0'));var util=require(_0x2664('0x1'));var path=require(_0x2664('0x2'));var timeout=require('connect-timeout');var express=require(_0x2664('0x3'));var router=express[_0x2664('0x4')]();var fs_extra=require(_0x2664('0x5'));var auth=require(_0x2664('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2664('0x7'));var controller=require(_0x2664('0x8'));router[_0x2664('0x9')]('/',auth[_0x2664('0xa')](),controller[_0x2664('0xb')]);router[_0x2664('0x9')](_0x2664('0xc'),auth[_0x2664('0xa')](),controller['show']);router['post']('/',auth[_0x2664('0xa')](),controller[_0x2664('0xd')]);router[_0x2664('0xe')](_0x2664('0xc'),auth[_0x2664('0xa')](),controller[_0x2664('0xf')]);router[_0x2664('0x10')](_0x2664('0xc'),auth[_0x2664('0xa')](),controller['destroy']);module[_0x2664('0x11')]=router; \ No newline at end of file +var _0x38a5=['show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x4049a7,_0x4ecc75){var _0x44bc2f=function(_0x3bfc4b){while(--_0x3bfc4b){_0x4049a7['push'](_0x4049a7['shift']());}};_0x44bc2f(++_0x4ecc75);}(_0x38a5,0x15b));var _0x538a=function(_0x2faf22,_0x10300b){_0x2faf22=_0x2faf22-0x0;var _0x492f71=_0x38a5[_0x2faf22];return _0x492f71;};'use strict';var multer=require(_0x538a('0x0'));var util=require(_0x538a('0x1'));var path=require(_0x538a('0x2'));var timeout=require('connect-timeout');var express=require(_0x538a('0x3'));var router=express[_0x538a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x538a('0x5'));var config=require(_0x538a('0x6'));var controller=require('./intSugarcrmField.controller');router[_0x538a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x538a('0x7')](_0x538a('0x8'),auth[_0x538a('0x9')](),controller[_0x538a('0xa')]);router[_0x538a('0xb')]('/',auth[_0x538a('0x9')](),controller[_0x538a('0xc')]);router[_0x538a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x538a('0xe')]);router[_0x538a('0xf')](_0x538a('0x8'),auth[_0x538a('0x9')](),controller[_0x538a('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 3b07f97..110d3e7 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 _0x1896=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x39bc44,_0x1d4373){var _0x2916d8=function(_0x1767ac){while(--_0x1767ac){_0x39bc44['push'](_0x39bc44['shift']());}};_0x2916d8(++_0x1d4373);}(_0x1896,0x163));var _0x6189=function(_0x1a1b34,_0x25dfdd){_0x1a1b34=_0x1a1b34-0x0;var _0x263e8d=_0x1896[_0x1a1b34];return _0x263e8d;};'use strict';var Sequelize=require(_0x6189('0x0'));module[_0x6189('0x1')]={'type':{'type':Sequelize[_0x6189('0x2')]('string','variable',_0x6189('0x3'),_0x6189('0x4'),'picklist'),'defaultValue':_0x6189('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6189('0x6')]},'keyType':{'type':Sequelize[_0x6189('0x2')](_0x6189('0x5'),_0x6189('0x7'),_0x6189('0x3'))},'keyContent':{'type':Sequelize[_0x6189('0x6')]},'idField':{'type':Sequelize[_0x6189('0x6')]},'nameField':{'type':Sequelize[_0x6189('0x6')]},'customField':{'type':Sequelize[_0x6189('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6189('0x6')]}}; \ No newline at end of file +var _0xfc94=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string'];(function(_0x369275,_0x223114){var _0x2c0705=function(_0x344327){while(--_0x344327){_0x369275['push'](_0x369275['shift']());}};_0x2c0705(++_0x223114);}(_0xfc94,0x92));var _0x4fc9=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xfc94[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x4fc9('0x0'));module[_0x4fc9('0x1')]={'type':{'type':Sequelize[_0x4fc9('0x2')]('string',_0x4fc9('0x3'),_0x4fc9('0x4'),_0x4fc9('0x5'),'picklist'),'defaultValue':_0x4fc9('0x6')},'content':{'type':Sequelize[_0x4fc9('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x4fc9('0x4'))},'keyContent':{'type':Sequelize[_0x4fc9('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4fc9('0x7')]},'customField':{'type':Sequelize[_0x4fc9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4fc9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 8d91d6d..2983174 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 _0xdb40=['limit','set','then','destroy','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','rows','catch','show','params','include','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','json','offset','undefined'];(function(_0x157624,_0x3ee799){var _0x517e0c=function(_0x21c462){while(--_0x21c462){_0x157624['push'](_0x157624['shift']());}};_0x517e0c(++_0x3ee799);}(_0xdb40,0x6d));var _0x0db4=function(_0x419b7a,_0x299ca7){_0x419b7a=_0x419b7a-0x0;var _0x4e284d=_0xdb40[_0x419b7a];return _0x4e284d;};'use strict';var emlformat=require(_0x0db4('0x0'));var rimraf=require(_0x0db4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0db4('0x2'));var rp=require(_0x0db4('0x3'));var moment=require('moment');var BPromise=require(_0x0db4('0x4'));var Mustache=require(_0x0db4('0x5'));var util=require(_0x0db4('0x6'));var path=require(_0x0db4('0x7'));var sox=require(_0x0db4('0x8'));var csv=require('to-csv');var ejs=require(_0x0db4('0x9'));var fs=require('fs');var fs_extra=require(_0x0db4('0xa'));var _=require(_0x0db4('0xb'));var squel=require('squel');var crypto=require(_0x0db4('0xc'));var jsforce=require(_0x0db4('0xd'));var deskjs=require(_0x0db4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0db4('0xf'));var Redis=require(_0x0db4('0x10'));var authService=require(_0x0db4('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0db4('0x12'));var logger=require(_0x0db4('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0db4('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31a293,_0x292606){_0x292606=_0x292606||0xcc;return function(_0x3ee9f7){if(_0x3ee9f7){return _0x31a293[_0x0db4('0x15')](_0x292606);}return _0x31a293['status'](_0x292606)[_0x0db4('0x16')]();};}function respondWithResult(_0x3cdfcb,_0xdf03b1){_0xdf03b1=_0xdf03b1||0xc8;return function(_0x10aca6){if(_0x10aca6){return _0x3cdfcb[_0x0db4('0x17')](_0xdf03b1)[_0x0db4('0x18')](_0x10aca6);}};}function respondWithFilteredResult(_0x1e2efd,_0xf32b1e){return function(_0x553262){if(_0x553262){var _0x441c97=typeof _0xf32b1e[_0x0db4('0x19')]===_0x0db4('0x1a')&&typeof _0xf32b1e['limit']==='undefined';var _0x4dc2ec=_0x553262['count'];var _0x47eb5a=_0x441c97?0x0:_0xf32b1e[_0x0db4('0x19')];var _0x32f1f7=_0x441c97?_0x553262['count']:_0xf32b1e[_0x0db4('0x19')]+_0xf32b1e[_0x0db4('0x1b')];var _0x47dc74;if(_0x32f1f7>=_0x4dc2ec){_0x32f1f7=_0x4dc2ec;_0x47dc74=0xc8;}else{_0x47dc74=0xce;}_0x1e2efd[_0x0db4('0x17')](_0x47dc74);return _0x1e2efd[_0x0db4('0x1c')]('Content-Range',_0x47eb5a+'-'+_0x32f1f7+'/'+_0x4dc2ec)[_0x0db4('0x18')](_0x553262);}return null;};}function patchUpdates(_0x325ae7){return function(_0x30bb02){try{jsonpatch['apply'](_0x30bb02,_0x325ae7,!![]);}catch(_0x1f3198){return BPromise['reject'](_0x1f3198);}return _0x30bb02['save']();};}function saveUpdates(_0x123bbf,_0x1d5353){return function(_0x42b79d){if(_0x42b79d){return _0x42b79d['update'](_0x123bbf)[_0x0db4('0x1d')](function(_0x3859b5){return _0x3859b5;});}return null;};}function removeEntity(_0x387677,_0x35ff59){return function(_0x3055ad){if(_0x3055ad){return _0x3055ad[_0x0db4('0x1e')]()[_0x0db4('0x1d')](function(){_0x387677[_0x0db4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x373ab4,_0x47e9cb){return function(_0x391da0){if(!_0x391da0){_0x373ab4['sendStatus'](0x194);}return _0x391da0;};}function handleError(_0xf99fb6,_0x4a3ebd){_0x4a3ebd=_0x4a3ebd||0x1f4;return function(_0x5df862){logger[_0x0db4('0x1f')](_0x5df862[_0x0db4('0x20')]);if(_0x5df862['name']){delete _0x5df862[_0x0db4('0x21')];}_0xf99fb6[_0x0db4('0x17')](_0x4a3ebd)['send'](_0x5df862);};}exports[_0x0db4('0x22')]=function(_0x415c19,_0x3055ef){var _0x5e4067={},_0x2acd55={},_0x4b21c6={'count':0x0,'rows':[]};var _0x134ab0=_[_0x0db4('0x23')](db[_0x0db4('0x24')][_0x0db4('0x25')],function(_0x1aaeb0){return{'name':_0x1aaeb0[_0x0db4('0x26')],'type':_0x1aaeb0[_0x0db4('0x27')][_0x0db4('0x28')]};});_0x2acd55[_0x0db4('0x29')]=_[_0x0db4('0x23')](_0x134ab0,_0x0db4('0x21'));_0x2acd55['query']=_[_0x0db4('0x2a')](_0x415c19[_0x0db4('0x2b')]);_0x2acd55[_0x0db4('0x2c')]=_[_0x0db4('0x2d')](_0x2acd55['model'],_0x2acd55['query']);_0x5e4067[_0x0db4('0x2e')]=_['intersection'](_0x2acd55[_0x0db4('0x29')],qs[_0x0db4('0x2f')](_0x415c19[_0x0db4('0x2b')][_0x0db4('0x2f')]));_0x5e4067[_0x0db4('0x2e')]=_0x5e4067[_0x0db4('0x2e')][_0x0db4('0x30')]?_0x5e4067[_0x0db4('0x2e')]:_0x2acd55[_0x0db4('0x29')];if(!_0x415c19[_0x0db4('0x2b')]['hasOwnProperty'](_0x0db4('0x31'))){_0x5e4067[_0x0db4('0x1b')]=qs[_0x0db4('0x1b')](_0x415c19[_0x0db4('0x2b')][_0x0db4('0x1b')]);_0x5e4067['offset']=qs[_0x0db4('0x19')](_0x415c19[_0x0db4('0x2b')][_0x0db4('0x19')]);}_0x5e4067['order']=qs[_0x0db4('0x32')](_0x415c19['query'][_0x0db4('0x32')]);_0x5e4067[_0x0db4('0x33')]=qs[_0x0db4('0x2c')](_[_0x0db4('0x34')](_0x415c19[_0x0db4('0x2b')],_0x2acd55[_0x0db4('0x2c')]),_0x134ab0);if(_0x415c19[_0x0db4('0x2b')][_0x0db4('0x35')]){_0x5e4067[_0x0db4('0x33')]=_['merge'](_0x5e4067[_0x0db4('0x33')],{'$or':_[_0x0db4('0x23')](_0x134ab0,function(_0x1286c7){if(_0x1286c7[_0x0db4('0x27')]!==_0x0db4('0x36')){var _0x39ca39={};_0x39ca39[_0x1286c7[_0x0db4('0x21')]]={'$like':'%'+_0x415c19['query'][_0x0db4('0x35')]+'%'};return _0x39ca39;}})});}_0x5e4067=_[_0x0db4('0x37')]({},_0x5e4067,_0x415c19[_0x0db4('0x38')]);var _0x4f38c3={'where':_0x5e4067[_0x0db4('0x33')]};return db[_0x0db4('0x24')][_0x0db4('0x39')](_0x4f38c3)[_0x0db4('0x1d')](function(_0x55486b){_0x4b21c6[_0x0db4('0x39')]=_0x55486b;if(_0x415c19[_0x0db4('0x2b')][_0x0db4('0x3a')]){_0x5e4067['include']=[{'all':!![]}];}return db[_0x0db4('0x24')]['findAll'](_0x5e4067);})[_0x0db4('0x1d')](function(_0x2f710d){_0x4b21c6[_0x0db4('0x3b')]=_0x2f710d;return _0x4b21c6;})[_0x0db4('0x1d')](respondWithFilteredResult(_0x3055ef,_0x5e4067))[_0x0db4('0x3c')](handleError(_0x3055ef,null));};exports[_0x0db4('0x3d')]=function(_0x30a5ef,_0xe5451c){var _0x3e21c8={'raw':!![],'where':{'id':_0x30a5ef[_0x0db4('0x3e')]['id']}},_0x21ac08={};_0x21ac08[_0x0db4('0x29')]=_[_0x0db4('0x2a')](db[_0x0db4('0x24')][_0x0db4('0x25')]);_0x21ac08[_0x0db4('0x2b')]=_['keys'](_0x30a5ef[_0x0db4('0x2b')]);_0x21ac08[_0x0db4('0x2c')]=_[_0x0db4('0x2d')](_0x21ac08[_0x0db4('0x29')],_0x21ac08['query']);_0x3e21c8['attributes']=_[_0x0db4('0x2d')](_0x21ac08['model'],qs['fields'](_0x30a5ef[_0x0db4('0x2b')]['fields']));_0x3e21c8[_0x0db4('0x2e')]=_0x3e21c8['attributes'][_0x0db4('0x30')]?_0x3e21c8[_0x0db4('0x2e')]:_0x21ac08[_0x0db4('0x29')];if(_0x30a5ef[_0x0db4('0x2b')][_0x0db4('0x3a')]){_0x3e21c8[_0x0db4('0x3f')]=[{'all':!![]}];}_0x3e21c8=_[_0x0db4('0x37')]({},_0x3e21c8,_0x30a5ef[_0x0db4('0x38')]);return db['SugarcrmField'][_0x0db4('0x40')](_0x3e21c8)[_0x0db4('0x1d')](handleEntityNotFound(_0xe5451c,null))[_0x0db4('0x1d')](respondWithResult(_0xe5451c,null))[_0x0db4('0x3c')](handleError(_0xe5451c,null));};exports['create']=function(_0x3a7193,_0x52f4be){return db[_0x0db4('0x24')][_0x0db4('0x41')](_0x3a7193[_0x0db4('0x42')],{})[_0x0db4('0x1d')](respondWithResult(_0x52f4be,0xc9))[_0x0db4('0x3c')](handleError(_0x52f4be,null));};exports[_0x0db4('0x43')]=function(_0x164dfd,_0x4b16d0){if(_0x164dfd['body']['id']){delete _0x164dfd[_0x0db4('0x42')]['id'];}return db[_0x0db4('0x24')]['find']({'where':{'id':_0x164dfd['params']['id']}})[_0x0db4('0x1d')](handleEntityNotFound(_0x4b16d0,null))[_0x0db4('0x1d')](saveUpdates(_0x164dfd['body'],null))[_0x0db4('0x1d')](respondWithResult(_0x4b16d0,null))[_0x0db4('0x3c')](handleError(_0x4b16d0,null));};exports[_0x0db4('0x1e')]=function(_0x59c6a8,_0x4b6463){return db[_0x0db4('0x24')][_0x0db4('0x40')]({'where':{'id':_0x59c6a8[_0x0db4('0x3e')]['id']}})[_0x0db4('0x1d')](handleEntityNotFound(_0x4b6463,null))[_0x0db4('0x1d')](removeEntity(_0x4b6463,null))[_0x0db4('0x3c')](handleError(_0x4b6463,null));}; \ No newline at end of file +var _0x53dc=['util','path','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','name','index','SugarcrmField','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4d8a8f,_0x2afd4c){var _0xfc4adc=function(_0xb89886){while(--_0xb89886){_0x4d8a8f['push'](_0x4d8a8f['shift']());}};_0xfc4adc(++_0x2afd4c);}(_0x53dc,0x8f));var _0xc53d=function(_0x40a545,_0x31c4b4){_0x40a545=_0x40a545-0x0;var _0x91dc40=_0x53dc[_0x40a545];return _0x91dc40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc53d('0x0'));var zipdir=require(_0xc53d('0x1'));var jsonpatch=require(_0xc53d('0x2'));var rp=require(_0xc53d('0x3'));var moment=require(_0xc53d('0x4'));var BPromise=require(_0xc53d('0x5'));var Mustache=require(_0xc53d('0x6'));var util=require(_0xc53d('0x7'));var path=require(_0xc53d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc53d('0x9'));var fs=require('fs');var fs_extra=require(_0xc53d('0xa'));var _=require(_0xc53d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc53d('0xc'));var toCsv=require(_0xc53d('0xd'));var querystring=require(_0xc53d('0xe'));var Papa=require(_0xc53d('0xf'));var Redis=require(_0xc53d('0x10'));var authService=require(_0xc53d('0x11'));var qs=require(_0xc53d('0x12'));var as=require(_0xc53d('0x13'));var hardwareService=require(_0xc53d('0x14'));var logger=require(_0xc53d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc53d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc53d('0x17'))['db'];function respondWithStatusCode(_0x46b176,_0x38db43){_0x38db43=_0x38db43||0xcc;return function(_0x129c25){if(_0x129c25){return _0x46b176[_0xc53d('0x18')](_0x38db43);}return _0x46b176['status'](_0x38db43)[_0xc53d('0x19')]();};}function respondWithResult(_0x4e8fa3,_0x3beeaa){_0x3beeaa=_0x3beeaa||0xc8;return function(_0xb9b3e){if(_0xb9b3e){return _0x4e8fa3[_0xc53d('0x1a')](_0x3beeaa)[_0xc53d('0x1b')](_0xb9b3e);}};}function respondWithFilteredResult(_0x1408a0,_0x5b2da2){return function(_0x37a6df){if(_0x37a6df){var _0x10cb9f=typeof _0x5b2da2[_0xc53d('0x1c')]===_0xc53d('0x1d')&&typeof _0x5b2da2['limit']==='undefined';var _0x58ca55=_0x37a6df[_0xc53d('0x1e')];var _0x43c9ee=_0x10cb9f?0x0:_0x5b2da2[_0xc53d('0x1c')];var _0x37a877=_0x10cb9f?_0x37a6df[_0xc53d('0x1e')]:_0x5b2da2['offset']+_0x5b2da2[_0xc53d('0x1f')];var _0xb249fc;if(_0x37a877>=_0x58ca55){_0x37a877=_0x58ca55;_0xb249fc=0xc8;}else{_0xb249fc=0xce;}_0x1408a0['status'](_0xb249fc);return _0x1408a0[_0xc53d('0x20')](_0xc53d('0x21'),_0x43c9ee+'-'+_0x37a877+'/'+_0x58ca55)[_0xc53d('0x1b')](_0x37a6df);}return null;};}function patchUpdates(_0x3d1145){return function(_0x4d0fb3){try{jsonpatch[_0xc53d('0x22')](_0x4d0fb3,_0x3d1145,!![]);}catch(_0x3172b9){return BPromise[_0xc53d('0x23')](_0x3172b9);}return _0x4d0fb3[_0xc53d('0x24')]();};}function saveUpdates(_0x1022d9,_0x505e63){return function(_0x47cfde){if(_0x47cfde){return _0x47cfde['update'](_0x1022d9)[_0xc53d('0x25')](function(_0x2c9f1d){return _0x2c9f1d;});}return null;};}function removeEntity(_0x59faec,_0x5d5ab2){return function(_0x58f18b){if(_0x58f18b){return _0x58f18b['destroy']()['then'](function(){_0x59faec[_0xc53d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x257357,_0x128dec){return function(_0x16694c){if(!_0x16694c){_0x257357['sendStatus'](0x194);}return _0x16694c;};}function handleError(_0x5b4ba8,_0x39f5c2){_0x39f5c2=_0x39f5c2||0x1f4;return function(_0x1bde94){logger[_0xc53d('0x26')](_0x1bde94['stack']);if(_0x1bde94[_0xc53d('0x27')]){delete _0x1bde94[_0xc53d('0x27')];}_0x5b4ba8[_0xc53d('0x1a')](_0x39f5c2)['send'](_0x1bde94);};}exports[_0xc53d('0x28')]=function(_0x456efd,_0x4f2b86){var _0x3cee60={},_0x47966f={},_0x504da7={'count':0x0,'rows':[]};var _0x345b98=_['map'](db[_0xc53d('0x29')][_0xc53d('0x2a')],function(_0x446857){return{'name':_0x446857[_0xc53d('0x2b')],'type':_0x446857['type'][_0xc53d('0x2c')]};});_0x47966f['model']=_[_0xc53d('0x2d')](_0x345b98,_0xc53d('0x27'));_0x47966f[_0xc53d('0x2e')]=_[_0xc53d('0x2f')](_0x456efd[_0xc53d('0x2e')]);_0x47966f[_0xc53d('0x30')]=_['intersection'](_0x47966f[_0xc53d('0x31')],_0x47966f[_0xc53d('0x2e')]);_0x3cee60[_0xc53d('0x32')]=_[_0xc53d('0x33')](_0x47966f[_0xc53d('0x31')],qs[_0xc53d('0x34')](_0x456efd[_0xc53d('0x2e')][_0xc53d('0x34')]));_0x3cee60['attributes']=_0x3cee60[_0xc53d('0x32')][_0xc53d('0x35')]?_0x3cee60['attributes']:_0x47966f[_0xc53d('0x31')];if(!_0x456efd['query'][_0xc53d('0x36')]('nolimit')){_0x3cee60[_0xc53d('0x1f')]=qs[_0xc53d('0x1f')](_0x456efd[_0xc53d('0x2e')][_0xc53d('0x1f')]);_0x3cee60[_0xc53d('0x1c')]=qs[_0xc53d('0x1c')](_0x456efd['query'][_0xc53d('0x1c')]);}_0x3cee60[_0xc53d('0x37')]=qs[_0xc53d('0x38')](_0x456efd[_0xc53d('0x2e')]['sort']);_0x3cee60['where']=qs['filters'](_[_0xc53d('0x39')](_0x456efd[_0xc53d('0x2e')],_0x47966f[_0xc53d('0x30')]),_0x345b98);if(_0x456efd[_0xc53d('0x2e')][_0xc53d('0x3a')]){_0x3cee60[_0xc53d('0x3b')]=_[_0xc53d('0x3c')](_0x3cee60['where'],{'$or':_['map'](_0x345b98,function(_0x239fc5){if(_0x239fc5[_0xc53d('0x3d')]!==_0xc53d('0x3e')){var _0x58f261={};_0x58f261[_0x239fc5[_0xc53d('0x27')]]={'$like':'%'+_0x456efd[_0xc53d('0x2e')][_0xc53d('0x3a')]+'%'};return _0x58f261;}})});}_0x3cee60=_[_0xc53d('0x3c')]({},_0x3cee60,_0x456efd[_0xc53d('0x3f')]);var _0x163b0f={'where':_0x3cee60['where']};return db[_0xc53d('0x29')]['count'](_0x163b0f)[_0xc53d('0x25')](function(_0x44e672){_0x504da7[_0xc53d('0x1e')]=_0x44e672;if(_0x456efd['query']['includeAll']){_0x3cee60[_0xc53d('0x40')]=[{'all':!![]}];}return db[_0xc53d('0x29')][_0xc53d('0x41')](_0x3cee60);})['then'](function(_0x45f2e4){_0x504da7['rows']=_0x45f2e4;return _0x504da7;})[_0xc53d('0x25')](respondWithFilteredResult(_0x4f2b86,_0x3cee60))[_0xc53d('0x42')](handleError(_0x4f2b86,null));};exports[_0xc53d('0x43')]=function(_0x4e1615,_0x345a85){var _0x5a1e8e={'raw':!![],'where':{'id':_0x4e1615[_0xc53d('0x44')]['id']}},_0x186c54={};_0x186c54[_0xc53d('0x31')]=_[_0xc53d('0x2f')](db[_0xc53d('0x29')][_0xc53d('0x2a')]);_0x186c54[_0xc53d('0x2e')]=_[_0xc53d('0x2f')](_0x4e1615[_0xc53d('0x2e')]);_0x186c54[_0xc53d('0x30')]=_[_0xc53d('0x33')](_0x186c54[_0xc53d('0x31')],_0x186c54[_0xc53d('0x2e')]);_0x5a1e8e['attributes']=_[_0xc53d('0x33')](_0x186c54[_0xc53d('0x31')],qs[_0xc53d('0x34')](_0x4e1615[_0xc53d('0x2e')][_0xc53d('0x34')]));_0x5a1e8e['attributes']=_0x5a1e8e['attributes'][_0xc53d('0x35')]?_0x5a1e8e[_0xc53d('0x32')]:_0x186c54[_0xc53d('0x31')];if(_0x4e1615[_0xc53d('0x2e')][_0xc53d('0x45')]){_0x5a1e8e[_0xc53d('0x40')]=[{'all':!![]}];}_0x5a1e8e=_[_0xc53d('0x3c')]({},_0x5a1e8e,_0x4e1615['options']);return db[_0xc53d('0x29')][_0xc53d('0x46')](_0x5a1e8e)[_0xc53d('0x25')](handleEntityNotFound(_0x345a85,null))[_0xc53d('0x25')](respondWithResult(_0x345a85,null))[_0xc53d('0x42')](handleError(_0x345a85,null));};exports[_0xc53d('0x47')]=function(_0x551384,_0x37019d){return db['SugarcrmField'][_0xc53d('0x47')](_0x551384[_0xc53d('0x48')],{})[_0xc53d('0x25')](respondWithResult(_0x37019d,0xc9))[_0xc53d('0x42')](handleError(_0x37019d,null));};exports[_0xc53d('0x49')]=function(_0xe99abf,_0x3bb1c9){if(_0xe99abf['body']['id']){delete _0xe99abf[_0xc53d('0x48')]['id'];}return db[_0xc53d('0x29')][_0xc53d('0x46')]({'where':{'id':_0xe99abf['params']['id']}})[_0xc53d('0x25')](handleEntityNotFound(_0x3bb1c9,null))[_0xc53d('0x25')](saveUpdates(_0xe99abf[_0xc53d('0x48')],null))[_0xc53d('0x25')](respondWithResult(_0x3bb1c9,null))['catch'](handleError(_0x3bb1c9,null));};exports[_0xc53d('0x4a')]=function(_0x33c72,_0x53cae0){return db[_0xc53d('0x29')][_0xc53d('0x46')]({'where':{'id':_0x33c72[_0xc53d('0x44')]['id']}})[_0xc53d('0x25')](handleEntityNotFound(_0x53cae0,null))[_0xc53d('0x25')](removeEntity(_0x53cae0,null))['catch'](handleError(_0x53cae0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 0f569fe..f2d92fe 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 _0xb750=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','int_sugarcrm_fields','idField','FieldId','lodash'];(function(_0x104c9b,_0x56944d){var _0x39ba4d=function(_0x5d81a1){while(--_0x5d81a1){_0x104c9b['push'](_0x104c9b['shift']());}};_0x39ba4d(++_0x56944d);}(_0xb750,0x179));var _0x0b75=function(_0x22a593,_0x5b895c){_0x22a593=_0x22a593-0x0;var _0x294910=_0xb750[_0x22a593];return _0x294910;};'use strict';var _=require(_0x0b75('0x0'));var util=require(_0x0b75('0x1'));var logger=require(_0x0b75('0x2'))(_0x0b75('0x3'));var moment=require(_0x0b75('0x4'));var BPromise=require(_0x0b75('0x5'));var rp=require(_0x0b75('0x6'));var fs=require('fs');var path=require(_0x0b75('0x7'));var rimraf=require(_0x0b75('0x8'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x0b75('0x9')]=function(_0x21dc0f,_0x2857cd){return _0x21dc0f[_0x0b75('0xa')]('SugarcrmField',attributes,{'tableName':_0x0b75('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x0b75('0xc'),_0x0b75('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf478=['../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x496e43,_0x301624){var _0x48177=function(_0x1d58be){while(--_0x1d58be){_0x496e43['push'](_0x496e43['shift']());}};_0x48177(++_0x301624);}(_0xf478,0x158));var _0x8f47=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xf478[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x8f47('0x0'));var util=require(_0x8f47('0x1'));var logger=require(_0x8f47('0x2'))('api');var moment=require(_0x8f47('0x3'));var BPromise=require(_0x8f47('0x4'));var rp=require(_0x8f47('0x5'));var fs=require('fs');var path=require(_0x8f47('0x6'));var rimraf=require(_0x8f47('0x7'));var config=require(_0x8f47('0x8'));var attributes=require(_0x8f47('0x9'));module[_0x8f47('0xa')]=function(_0x8695eb,_0x870571){return _0x8695eb[_0x8f47('0xb')]('SugarcrmField',attributes,{'tableName':_0x8f47('0xc'),'paranoid':![],'indexes':[{'name':_0x8f47('0xd'),'fields':[_0x8f47('0xe'),_0x8f47('0xf')],'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 41d5b11..0fb5fde 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 _0x2fea=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x2fea,0x14a));var _0xa2fe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2fea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa2fe('0x0'));var util=require(_0xa2fe('0x1'));var moment=require(_0xa2fe('0x2'));var BPromise=require(_0xa2fe('0x3'));var rs=require(_0xa2fe('0x4'));var fs=require('fs');var Redis=require(_0xa2fe('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa2fe('0x6'))(_0xa2fe('0x7'));var config=require(_0xa2fe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa2fe('0x9')][_0xa2fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e1ab3,_0x3ce4bf,_0x14a056){return new BPromise(function(_0x2c9743,_0x10bb0b){return client[_0xa2fe('0xb')](_0x3e1ab3,_0x14a056)[_0xa2fe('0xc')](function(_0x4bdf19){logger[_0xa2fe('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x3ce4bf,_0xa2fe('0xe'));logger[_0xa2fe('0xf')](_0xa2fe('0x10'),_0x3ce4bf,_0xa2fe('0xe'),JSON[_0xa2fe('0x11')](_0x4bdf19));if(_0x4bdf19[_0xa2fe('0x12')]){if(_0x4bdf19[_0xa2fe('0x12')]['code']===0x1f4){logger[_0xa2fe('0x12')](_0xa2fe('0x13'),_0x3ce4bf,_0x4bdf19[_0xa2fe('0x12')][_0xa2fe('0x14')]);return _0x10bb0b(_0x4bdf19[_0xa2fe('0x12')][_0xa2fe('0x14')]);}logger[_0xa2fe('0x12')](_0xa2fe('0x13'),_0x3ce4bf,_0x4bdf19[_0xa2fe('0x12')][_0xa2fe('0x14')]);return _0x2c9743(_0x4bdf19[_0xa2fe('0x12')][_0xa2fe('0x14')]);}else{logger['info'](_0xa2fe('0x13'),_0x3ce4bf,'request\x20sent');_0x2c9743(_0x4bdf19[_0xa2fe('0x15')]['message']);}})[_0xa2fe('0x16')](function(_0x145c0f){logger[_0xa2fe('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x3ce4bf,_0x145c0f);_0x10bb0b(_0x145c0f);});});} \ No newline at end of file +var _0xfce5=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0xcc39b7,_0x3e8b20){var _0x16c505=function(_0x33d57f){while(--_0x33d57f){_0xcc39b7['push'](_0xcc39b7['shift']());}};_0x16c505(++_0x3e8b20);}(_0xfce5,0x109));var _0x5fce=function(_0x5b8df6,_0x3afca6){_0x5b8df6=_0x5b8df6-0x0;var _0x234e78=_0xfce5[_0x5b8df6];return _0x234e78;};'use strict';var _=require('lodash');var util=require(_0x5fce('0x0'));var moment=require(_0x5fce('0x1'));var BPromise=require(_0x5fce('0x2'));var rs=require(_0x5fce('0x3'));var fs=require('fs');var Redis=require(_0x5fce('0x4'));var db=require(_0x5fce('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5fce('0x6'));var config=require(_0x5fce('0x7'));var jayson=require(_0x5fce('0x8'));var client=jayson[_0x5fce('0x9')][_0x5fce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f25cb,_0x4f1796,_0x2343ff){return new BPromise(function(_0x2cb84d,_0x4c48a9){return client[_0x5fce('0xb')](_0x4f25cb,_0x2343ff)[_0x5fce('0xc')](function(_0x3753cb){logger['info'](_0x5fce('0xd'),_0x4f1796,_0x5fce('0xe'));logger[_0x5fce('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x4f1796,'request\x20sent',JSON[_0x5fce('0x10')](_0x3753cb));if(_0x3753cb[_0x5fce('0x11')]){if(_0x3753cb['error'][_0x5fce('0x12')]===0x1f4){logger[_0x5fce('0x11')](_0x5fce('0xd'),_0x4f1796,_0x3753cb[_0x5fce('0x11')][_0x5fce('0x13')]);return _0x4c48a9(_0x3753cb[_0x5fce('0x11')][_0x5fce('0x13')]);}logger[_0x5fce('0x11')](_0x5fce('0xd'),_0x4f1796,_0x3753cb['error']['message']);return _0x2cb84d(_0x3753cb['error'][_0x5fce('0x13')]);}else{logger[_0x5fce('0x14')](_0x5fce('0xd'),_0x4f1796,'request\x20sent');_0x2cb84d(_0x3753cb['result'][_0x5fce('0x13')]);}})[_0x5fce('0x15')](function(_0x5afa59){logger[_0x5fce('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x4f1796,_0x5afa59);_0x4c48a9(_0x5afa59);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 032a27a..22cf36c 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 _0xabe8=['./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x5bdf92,_0x36cd1b){var _0x59ece3=function(_0x44432a){while(--_0x44432a){_0x5bdf92['push'](_0x5bdf92['shift']());}};_0x59ece3(++_0x36cd1b);}(_0xabe8,0x8c));var _0x8abe=function(_0x324c12,_0x3be1fe){_0x324c12=_0x324c12-0x0;var _0x59fad8=_0xabe8[_0x324c12];return _0x59fad8;};'use strict';var multer=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var path=require(_0x8abe('0x2'));var timeout=require('connect-timeout');var express=require(_0x8abe('0x3'));var router=express[_0x8abe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8abe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8abe('0x6'));var controller=require(_0x8abe('0x7'));router[_0x8abe('0x8')]('/',auth[_0x8abe('0x9')](),controller[_0x8abe('0xa')]);router['get']('/:id',auth[_0x8abe('0x9')](),controller[_0x8abe('0xb')]);router[_0x8abe('0x8')](_0x8abe('0xc'),auth[_0x8abe('0x9')](),controller[_0x8abe('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x8abe('0xe')]);router[_0x8abe('0xf')]('/',auth[_0x8abe('0x9')](),controller[_0x8abe('0x10')]);router[_0x8abe('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8abe('0x11')]);router[_0x8abe('0x12')](_0x8abe('0x13'),auth[_0x8abe('0x9')](),controller['update']);router['delete']('/:id',auth[_0x8abe('0x9')](),controller['destroy']);module[_0x8abe('0x14')]=router; \ No newline at end of file +var _0x34ea=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','addConfiguration','put','update','delete','exports'];(function(_0x1ec055,_0x1d622d){var _0x36dbe9=function(_0x79dd43){while(--_0x79dd43){_0x1ec055['push'](_0x1ec055['shift']());}};_0x36dbe9(++_0x1d622d);}(_0x34ea,0xa8));var _0xa34e=function(_0x491673,_0x2c791b){_0x491673=_0x491673-0x0;var _0x453ed8=_0x34ea[_0x491673];return _0x453ed8;};'use strict';var multer=require(_0xa34e('0x0'));var util=require(_0xa34e('0x1'));var path=require(_0xa34e('0x2'));var timeout=require(_0xa34e('0x3'));var express=require(_0xa34e('0x4'));var router=express[_0xa34e('0x5')]();var fs_extra=require(_0xa34e('0x6'));var auth=require(_0xa34e('0x7'));var interaction=require(_0xa34e('0x8'));var config=require(_0xa34e('0x9'));var controller=require('./intVtigerAccount.controller');router[_0xa34e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa34e('0xa')](_0xa34e('0xb'),auth[_0xa34e('0xc')](),controller['show']);router[_0xa34e('0xa')](_0xa34e('0xd'),auth[_0xa34e('0xc')](),controller[_0xa34e('0xe')]);router[_0xa34e('0xa')]('/:id/fields',auth[_0xa34e('0xc')](),controller['getFields']);router['post']('/',auth[_0xa34e('0xc')](),controller['create']);router[_0xa34e('0xf')](_0xa34e('0xd'),auth[_0xa34e('0xc')](),controller[_0xa34e('0x10')]);router[_0xa34e('0x11')]('/:id',auth[_0xa34e('0xc')](),controller[_0xa34e('0x12')]);router[_0xa34e('0x13')](_0xa34e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa34e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index b3c68ff..706fb58 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 _0x9a01=['sequelize','exports','STRING','HelpDesk'];(function(_0x593d2b,_0x5a3b48){var _0x578f8a=function(_0xd94e1a){while(--_0xd94e1a){_0x593d2b['push'](_0x593d2b['shift']());}};_0x578f8a(++_0x5a3b48);}(_0x9a01,0x1c0));var _0x19a0=function(_0x4bf9cc,_0x190be6){_0x4bf9cc=_0x4bf9cc-0x0;var _0x53fd6d=_0x9a01[_0x4bf9cc];return _0x53fd6d;};'use strict';var Sequelize=require(_0x19a0('0x0'));module[_0x19a0('0x1')]={'name':{'type':Sequelize[_0x19a0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x19a0('0x2')]},'username':{'type':Sequelize[_0x19a0('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x19a0('0x2')],'allowNull':![],'defaultValue':_0x19a0('0x3')},'remoteUri':{'type':Sequelize[_0x19a0('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x19a0('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x19a0('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdd5a=['exports','STRING','HelpDesk','sequelize'];(function(_0x399486,_0x5319d4){var _0x381361=function(_0x1b90de){while(--_0x1b90de){_0x399486['push'](_0x399486['shift']());}};_0x381361(++_0x5319d4);}(_0xdd5a,0x103));var _0xadd5=function(_0xae6260,_0x461c46){_0xae6260=_0xae6260-0x0;var _0x5017b9=_0xdd5a[_0xae6260];return _0x5017b9;};'use strict';var Sequelize=require(_0xadd5('0x0'));module[_0xadd5('0x1')]={'name':{'type':Sequelize[_0xadd5('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xadd5('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xadd5('0x2')],'allowNull':![],'defaultValue':_0xadd5('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xadd5('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xadd5('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 29c693e..56f6f4e 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 _0xb320=['getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','getFields','username','moduleName','serverUrl','accessKey','remoteUri','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','result','token','describe','sessionName','reference','owner','remove','includes','editable','false','startsWith','cf_','picklistValues','log','vTiger\x20error:\x20','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','../../components/integrations/configuration','end','status','undefined','limit','offset','set','Content-Range','apply','update','then','destroy','sendStatus','stack','name','send','VtigerAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','count','include','rows','catch','show','params','includeAll','find','create','body'];(function(_0x78f0aa,_0x2b013a){var _0x319a60=function(_0x27a546){while(--_0x27a546){_0x78f0aa['push'](_0x78f0aa['shift']());}};_0x319a60(++_0x2b013a);}(_0xb320,0x11c));var _0x0b32=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xb320[_0x4e93a9];return _0x43013c;};'use strict';var emlformat=require(_0x0b32('0x0'));var rimraf=require(_0x0b32('0x1'));var zipdir=require(_0x0b32('0x2'));var jsonpatch=require(_0x0b32('0x3'));var rp=require(_0x0b32('0x4'));var moment=require(_0x0b32('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0b32('0x6'));var util=require(_0x0b32('0x7'));var path=require(_0x0b32('0x8'));var sox=require(_0x0b32('0x9'));var csv=require('to-csv');var ejs=require(_0x0b32('0xa'));var fs=require('fs');var fs_extra=require(_0x0b32('0xb'));var _=require(_0x0b32('0xc'));var squel=require(_0x0b32('0xd'));var crypto=require(_0x0b32('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0b32('0xf'));var toCsv=require(_0x0b32('0x10'));var querystring=require(_0x0b32('0x11'));var Papa=require(_0x0b32('0x12'));var Redis=require(_0x0b32('0x13'));var authService=require(_0x0b32('0x14'));var qs=require(_0x0b32('0x15'));var as=require(_0x0b32('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b32('0x17'))(_0x0b32('0x18'));var utils=require(_0x0b32('0x19'));var config=require(_0x0b32('0x1a'));var licenseUtil=require(_0x0b32('0x1b'));var db=require(_0x0b32('0x1c'))['db'];var integrations=require(_0x0b32('0x1d'));function respondWithStatusCode(_0x32edd3,_0x498434){_0x498434=_0x498434||0xcc;return function(_0x3fff5f){if(_0x3fff5f){return _0x32edd3['sendStatus'](_0x498434);}return _0x32edd3['status'](_0x498434)[_0x0b32('0x1e')]();};}function respondWithResult(_0xee8c32,_0x2ba981){_0x2ba981=_0x2ba981||0xc8;return function(_0x87b32a){if(_0x87b32a){return _0xee8c32[_0x0b32('0x1f')](_0x2ba981)['json'](_0x87b32a);}};}function respondWithFilteredResult(_0x2d7d50,_0x265603){return function(_0x46f522){if(_0x46f522){var _0x33c8ab=typeof _0x265603['offset']===_0x0b32('0x20')&&typeof _0x265603[_0x0b32('0x21')]===_0x0b32('0x20');var _0x4804e3=_0x46f522['count'];var _0x2f723a=_0x33c8ab?0x0:_0x265603['offset'];var _0xa26003=_0x33c8ab?_0x46f522['count']:_0x265603[_0x0b32('0x22')]+_0x265603[_0x0b32('0x21')];var _0x3f58c6;if(_0xa26003>=_0x4804e3){_0xa26003=_0x4804e3;_0x3f58c6=0xc8;}else{_0x3f58c6=0xce;}_0x2d7d50[_0x0b32('0x1f')](_0x3f58c6);return _0x2d7d50[_0x0b32('0x23')](_0x0b32('0x24'),_0x2f723a+'-'+_0xa26003+'/'+_0x4804e3)['json'](_0x46f522);}return null;};}function patchUpdates(_0x3d267e){return function(_0x3e02ff){try{jsonpatch[_0x0b32('0x25')](_0x3e02ff,_0x3d267e,!![]);}catch(_0x59bce3){return BPromise['reject'](_0x59bce3);}return _0x3e02ff['save']();};}function saveUpdates(_0x2cd282,_0x24cd4e){return function(_0x1394fe){if(_0x1394fe){return _0x1394fe[_0x0b32('0x26')](_0x2cd282)[_0x0b32('0x27')](function(_0x2b766b){return _0x2b766b;});}return null;};}function removeEntity(_0x2a24db,_0x493f06){return function(_0x4b00ff){if(_0x4b00ff){return _0x4b00ff[_0x0b32('0x28')]()['then'](function(){_0x2a24db[_0x0b32('0x1f')](0xcc)[_0x0b32('0x1e')]();});}};}function handleEntityNotFound(_0x185b12,_0x1a9066){return function(_0x2c00ef){if(!_0x2c00ef){_0x185b12[_0x0b32('0x29')](0x194);}return _0x2c00ef;};}function handleError(_0x1fa7b8,_0x4d16a5){_0x4d16a5=_0x4d16a5||0x1f4;return function(_0x31c57f){logger['error'](_0x31c57f[_0x0b32('0x2a')]);if(_0x31c57f['name']){delete _0x31c57f[_0x0b32('0x2b')];}_0x1fa7b8[_0x0b32('0x1f')](_0x4d16a5)[_0x0b32('0x2c')](_0x31c57f);};}exports['index']=function(_0x3856f2,_0x271697){var _0x59cf36={},_0x422df2={},_0x1189d0={'count':0x0,'rows':[]};var _0x3bf336=_['map'](db[_0x0b32('0x2d')][_0x0b32('0x2e')],function(_0x50b716){return{'name':_0x50b716[_0x0b32('0x2f')],'type':_0x50b716[_0x0b32('0x30')][_0x0b32('0x31')]};});_0x422df2[_0x0b32('0x32')]=_[_0x0b32('0x33')](_0x3bf336,_0x0b32('0x2b'));_0x422df2[_0x0b32('0x34')]=_[_0x0b32('0x35')](_0x3856f2[_0x0b32('0x34')]);_0x422df2[_0x0b32('0x36')]=_[_0x0b32('0x37')](_0x422df2[_0x0b32('0x32')],_0x422df2[_0x0b32('0x34')]);_0x59cf36[_0x0b32('0x38')]=_[_0x0b32('0x37')](_0x422df2[_0x0b32('0x32')],qs['fields'](_0x3856f2[_0x0b32('0x34')][_0x0b32('0x39')]));_0x59cf36['attributes']=_0x59cf36['attributes'][_0x0b32('0x3a')]?_0x59cf36[_0x0b32('0x38')]:_0x422df2[_0x0b32('0x32')];if(!_0x3856f2['query']['hasOwnProperty']('nolimit')){_0x59cf36[_0x0b32('0x21')]=qs[_0x0b32('0x21')](_0x3856f2[_0x0b32('0x34')]['limit']);_0x59cf36[_0x0b32('0x22')]=qs['offset'](_0x3856f2[_0x0b32('0x34')]['offset']);}_0x59cf36[_0x0b32('0x3b')]=qs[_0x0b32('0x3c')](_0x3856f2['query'][_0x0b32('0x3c')]);_0x59cf36['where']=qs['filters'](_[_0x0b32('0x3d')](_0x3856f2[_0x0b32('0x34')],_0x422df2[_0x0b32('0x36')]),_0x3bf336);if(_0x3856f2['query'][_0x0b32('0x3e')]){_0x59cf36[_0x0b32('0x3f')]=_[_0x0b32('0x40')](_0x59cf36['where'],{'$or':_[_0x0b32('0x33')](_0x3bf336,function(_0x1fc14f){if(_0x1fc14f[_0x0b32('0x30')]!=='VIRTUAL'){var _0x25430c={};_0x25430c[_0x1fc14f[_0x0b32('0x2b')]]={'$like':'%'+_0x3856f2[_0x0b32('0x34')][_0x0b32('0x3e')]+'%'};return _0x25430c;}})});}_0x59cf36=_[_0x0b32('0x40')]({},_0x59cf36,_0x3856f2[_0x0b32('0x41')]);var _0x2ab2fa={'where':_0x59cf36[_0x0b32('0x3f')]};return db['VtigerAccount'][_0x0b32('0x42')](_0x2ab2fa)[_0x0b32('0x27')](function(_0x1e8627){_0x1189d0[_0x0b32('0x42')]=_0x1e8627;if(_0x3856f2['query']['includeAll']){_0x59cf36[_0x0b32('0x43')]=[{'all':!![]}];}return db[_0x0b32('0x2d')]['findAll'](_0x59cf36);})[_0x0b32('0x27')](function(_0x4adb72){_0x1189d0[_0x0b32('0x44')]=_0x4adb72;return _0x1189d0;})[_0x0b32('0x27')](respondWithFilteredResult(_0x271697,_0x59cf36))[_0x0b32('0x45')](handleError(_0x271697,null));};exports[_0x0b32('0x46')]=function(_0x18cc18,_0x2279e7){var _0x43b8ad={'raw':![],'where':{'id':_0x18cc18[_0x0b32('0x47')]['id']}},_0x86bd05={};_0x86bd05[_0x0b32('0x32')]=_['keys'](db[_0x0b32('0x2d')][_0x0b32('0x2e')]);_0x86bd05[_0x0b32('0x34')]=_[_0x0b32('0x35')](_0x18cc18[_0x0b32('0x34')]);_0x86bd05[_0x0b32('0x36')]=_[_0x0b32('0x37')](_0x86bd05[_0x0b32('0x32')],_0x86bd05[_0x0b32('0x34')]);_0x43b8ad[_0x0b32('0x38')]=_[_0x0b32('0x37')](_0x86bd05[_0x0b32('0x32')],qs[_0x0b32('0x39')](_0x18cc18[_0x0b32('0x34')][_0x0b32('0x39')]));_0x43b8ad[_0x0b32('0x38')]=_0x43b8ad[_0x0b32('0x38')]['length']?_0x43b8ad[_0x0b32('0x38')]:_0x86bd05['model'];if(_0x18cc18[_0x0b32('0x34')][_0x0b32('0x48')]){_0x43b8ad['include']=[{'all':!![]}];}_0x43b8ad=_['merge']({},_0x43b8ad,_0x18cc18['options']);return db['VtigerAccount'][_0x0b32('0x49')](_0x43b8ad)[_0x0b32('0x27')](handleEntityNotFound(_0x2279e7,null))[_0x0b32('0x27')](respondWithResult(_0x2279e7,null))['catch'](handleError(_0x2279e7,null));};exports['create']=function(_0x49792a,_0x5bae74){return db[_0x0b32('0x2d')][_0x0b32('0x4a')](_0x49792a[_0x0b32('0x4b')],{})['then'](respondWithResult(_0x5bae74,0xc9))['catch'](handleError(_0x5bae74,null));};exports['update']=function(_0xee2269,_0x16406d){if(_0xee2269[_0x0b32('0x4b')]['id']){delete _0xee2269[_0x0b32('0x4b')]['id'];}return db['VtigerAccount'][_0x0b32('0x49')]({'where':{'id':_0xee2269[_0x0b32('0x47')]['id']}})[_0x0b32('0x27')](handleEntityNotFound(_0x16406d,null))[_0x0b32('0x27')](saveUpdates(_0xee2269['body'],null))[_0x0b32('0x27')](respondWithResult(_0x16406d,null))[_0x0b32('0x45')](handleError(_0x16406d,null));};exports[_0x0b32('0x28')]=function(_0x26e7fa,_0x1bc6f9){return db[_0x0b32('0x2d')]['find']({'where':{'id':_0x26e7fa[_0x0b32('0x47')]['id']}})['then'](handleEntityNotFound(_0x1bc6f9,null))[_0x0b32('0x27')](removeEntity(_0x1bc6f9,null))[_0x0b32('0x45')](handleError(_0x1bc6f9,null));};exports[_0x0b32('0x4c')]=function(_0x5df42d,_0x1ce119,_0x752930){var _0x268100={};var _0x42d982={};var _0x48d917;var _0x4fcbcc;return db[_0x0b32('0x2d')][_0x0b32('0x4d')]({'where':{'id':_0x5df42d['params']['id']}})[_0x0b32('0x27')](handleEntityNotFound(_0x1ce119,null))[_0x0b32('0x27')](function(_0xe008d5){if(_0xe008d5){_0x48d917=_0xe008d5;_0x42d982[_0x0b32('0x32')]=_[_0x0b32('0x35')](db['VtigerConfiguration'][_0x0b32('0x2e')]);_0x42d982['query']=_[_0x0b32('0x35')](_0x5df42d['query']);_0x42d982[_0x0b32('0x36')]=_[_0x0b32('0x37')](_0x42d982[_0x0b32('0x32')],_0x42d982[_0x0b32('0x34')]);_0x268100[_0x0b32('0x38')]=_['intersection'](_0x42d982[_0x0b32('0x32')],qs['fields'](_0x5df42d[_0x0b32('0x34')][_0x0b32('0x39')]));_0x268100[_0x0b32('0x38')]=_0x268100[_0x0b32('0x38')][_0x0b32('0x3a')]?_0x268100[_0x0b32('0x38')]:_0x42d982[_0x0b32('0x32')];_0x268100[_0x0b32('0x3b')]=qs['sort'](_0x5df42d['query'][_0x0b32('0x3c')]);_0x268100[_0x0b32('0x3f')]=qs[_0x0b32('0x36')](_[_0x0b32('0x3d')](_0x5df42d[_0x0b32('0x34')],_0x42d982[_0x0b32('0x36')]));if(_0x5df42d['query'][_0x0b32('0x3e')]){_0x268100[_0x0b32('0x3f')]=_['merge'](_0x268100[_0x0b32('0x3f')],{'$or':_[_0x0b32('0x33')](_0x268100[_0x0b32('0x38')],function(_0x2a85ac){var _0x1fff9d={};_0x1fff9d[_0x2a85ac]={'$like':'%'+_0x5df42d[_0x0b32('0x34')][_0x0b32('0x3e')]+'%'};return _0x1fff9d;})});}_0x268100=_['merge']({},_0x268100,_0x5df42d[_0x0b32('0x41')]);return _0x48d917[_0x0b32('0x4c')](_0x268100);}})[_0x0b32('0x27')](function(_0x37afcb){if(_0x37afcb){_0x4fcbcc=_0x37afcb[_0x0b32('0x3a')];if(!_0x5df42d['query'][_0x0b32('0x4e')]('nolimit')){_0x268100['limit']=qs['limit'](_0x5df42d['query']['limit']);_0x268100[_0x0b32('0x22')]=qs[_0x0b32('0x22')](_0x5df42d[_0x0b32('0x34')][_0x0b32('0x22')]);}return _0x48d917[_0x0b32('0x4c')](_0x268100);}})['then'](function(_0x14c98a){if(_0x14c98a){return _0x14c98a?{'count':_0x4fcbcc,'rows':_0x14c98a}:null;}})['then'](respondWithResult(_0x1ce119,null))['catch'](handleError(_0x1ce119,null));};exports[_0x0b32('0x4f')]=function(_0x19910d,_0x28aaf4,_0x203c19){if(_0x19910d['body']['id']){delete _0x19910d[_0x0b32('0x4b')]['id'];}return db[_0x0b32('0x2d')][_0x0b32('0x4d')]({'where':{'id':_0x19910d[_0x0b32('0x47')]['id']}})[_0x0b32('0x27')](handleEntityNotFound(_0x28aaf4,null))[_0x0b32('0x27')](function(_0x9f094f){if(_0x9f094f){_0x19910d[_0x0b32('0x4b')][_0x0b32('0x50')]=_0x9f094f['id'];_0x19910d[_0x0b32('0x4b')][_0x0b32('0x51')]=integrations[_0x0b32('0x52')](_0x19910d[_0x0b32('0x4b')][_0x0b32('0x53')],_0x19910d[_0x0b32('0x4b')][_0x0b32('0x30')]);_0x19910d[_0x0b32('0x4b')][_0x0b32('0x54')]=integrations[_0x0b32('0x55')](_0x19910d[_0x0b32('0x4b')][_0x0b32('0x53')],_0x19910d[_0x0b32('0x4b')]['type']);return db[_0x0b32('0x56')][_0x0b32('0x4a')](_0x19910d[_0x0b32('0x4b')],{'include':[{'model':db[_0x0b32('0x57')],'as':_0x0b32('0x51')},{'model':db[_0x0b32('0x57')],'as':_0x0b32('0x54')}]});}return null;})[_0x0b32('0x27')](respondWithResult(_0x28aaf4,null))[_0x0b32('0x45')](handleError(_0x28aaf4,null));};var md5=require('md5');exports[_0x0b32('0x58')]=function(_0x3c2a70,_0x4ebac7,_0x353b52){var _0x32c012=null;var _0x1b4201=null;var _0x196d30=null;var _0x19f70c=null;var _0xb5637c='';return db[_0x0b32('0x2d')]['findOne']({'where':{'id':_0x3c2a70[_0x0b32('0x47')]['id']},'attributes':['id',_0x0b32('0x2b'),_0x0b32('0x59'),'description',_0x0b32('0x5a'),'remoteUri',_0x0b32('0x5b'),_0x0b32('0x5c')]})[_0x0b32('0x27')](handleEntityNotFound(_0x4ebac7,null))[_0x0b32('0x27')](function(_0x4b422d){if(_0x4b422d){_0x32c012=_0x4b422d['username'];_0x1b4201=_0x4b422d['accessKey'];_0x196d30=_0x4b422d[_0x0b32('0x5a')];_0xb5637c=_0x4b422d[_0x0b32('0x5d')];var _0x1fff06=_0xb5637c['slice'](-0x1);if(_0x1fff06==='/'){_0xb5637c=_0xb5637c[_0x0b32('0x5e')](0x0,_0xb5637c[_0x0b32('0x5f')](_0x1fff06));}_0x19f70c=util[_0x0b32('0x60')](_0x0b32('0x61'),_0xb5637c);var _0x40c821={'method':_0x0b32('0x62'),'uri':_0x19f70c,'qs':{'operation':_0x0b32('0x63'),'username':_0x4b422d['username']},'json':!![]};return rp(_0x40c821);}})[_0x0b32('0x27')](function(_0x9abdbd){if(_0x9abdbd[_0x0b32('0x64')]){var _0x2a140b={'method':'POST','uri':_0x19f70c,'form':{'operation':_0x0b32('0x65'),'username':_0x32c012,'accessKey':md5(_0x9abdbd[_0x0b32('0x66')][_0x0b32('0x67')]+_0x1b4201)},'json':!![]};return rp(_0x2a140b);}})[_0x0b32('0x27')](function(_0x176b4f){if(_0x176b4f[_0x0b32('0x64')]){var _0x52f31d={'method':_0x0b32('0x62'),'uri':_0x19f70c,'qs':{'operation':_0x0b32('0x68'),'username':_0x32c012,'sessionName':_0x176b4f['result'][_0x0b32('0x69')],'elementType':_0x196d30},'json':!![]};return rp(_0x52f31d);}})['then'](function(_0x4ed83f){if(_0x4ed83f['success']){var _0x43fc21=['autogenerated',_0x0b32('0x6a'),_0x0b32('0x6b')];_[_0x0b32('0x6c')](_0x4ed83f[_0x0b32('0x66')][_0x0b32('0x39')],function(_0x4a93c2){return _0x43fc21[_0x0b32('0x6d')](_0x4a93c2[_0x0b32('0x30')][_0x0b32('0x2b')]);});_[_0x0b32('0x6c')](_0x4ed83f[_0x0b32('0x66')][_0x0b32('0x39')],function(_0x2098e7){return _0x2098e7[_0x0b32('0x6e')]===_0x0b32('0x6f');});return{'count':_0x4ed83f['result']['fields'][_0x0b32('0x3a')],'rows':_[_0x0b32('0x33')](_0x4ed83f[_0x0b32('0x66')][_0x0b32('0x39')],function(_0x3fb11d){return{'id':_0x3fb11d[_0x0b32('0x2b')],'name':_0x3fb11d['label'],'custom':_[_0x0b32('0x70')](_0x3fb11d[_0x0b32('0x2b')],_0x0b32('0x71'))?!![]:![],'options':_0x3fb11d[_0x0b32('0x30')][_0x0b32('0x2b')]==='picklist'&&_0x3fb11d[_0x0b32('0x30')][_0x0b32('0x72')][_0x0b32('0x3a')]>0x0?_[_0x0b32('0x33')](_0x3fb11d[_0x0b32('0x30')][_0x0b32('0x72')],function(_0x4b9421){return{'name':_0x4b9421['label'],'value':_0x4b9421['value']};}):[]};})};}})[_0x0b32('0x27')](respondWithResult(_0x4ebac7,null))[_0x0b32('0x45')](function(_0x230bdc){console[_0x0b32('0x73')](_0x0b32('0x74')+_0x230bdc);var _0x4fd5a5=_0x3c2a70[_0x0b32('0x34')]['test']?0x1f4:_0x230bdc['statusCode']||0x1f4;logger[_0x0b32('0x75')](_0x0b32('0x76'),'getFields',_0x4fd5a5,JSON[_0x0b32('0x77')](_0x230bdc));delete _0x230bdc['name'];if(_0x4fd5a5===0x191){_0x4fd5a5=0x190;}_0x4ebac7['status'](_0x4fd5a5)['send'](_0x3c2a70[_0x0b32('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x230bdc['statusCode']}:_0x230bdc);});}; \ No newline at end of file +var _0xfced=['getSubjects','channel','getDescriptions','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','describe','sessionName','autogenerated','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','getConfigurations','VtigerConfiguration','addConfiguration','findOne','AccountId','Subjects'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xfced,0x1a8));var _0xdfce=function(_0x179f82,_0xc44f23){_0x179f82=_0x179f82-0x0;var _0x24363e=_0xfced[_0x179f82];return _0x24363e;};'use strict';var emlformat=require(_0xdfce('0x0'));var rimraf=require(_0xdfce('0x1'));var zipdir=require(_0xdfce('0x2'));var jsonpatch=require(_0xdfce('0x3'));var rp=require(_0xdfce('0x4'));var moment=require(_0xdfce('0x5'));var BPromise=require(_0xdfce('0x6'));var Mustache=require(_0xdfce('0x7'));var util=require(_0xdfce('0x8'));var path=require(_0xdfce('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfce('0xa'));var _=require('lodash');var squel=require(_0xdfce('0xb'));var crypto=require(_0xdfce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdfce('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfce('0xe'));var Papa=require(_0xdfce('0xf'));var Redis=require(_0xdfce('0x10'));var authService=require(_0xdfce('0x11'));var qs=require(_0xdfce('0x12'));var as=require(_0xdfce('0x13'));var hardwareService=require(_0xdfce('0x14'));var logger=require(_0xdfce('0x15'))(_0xdfce('0x16'));var utils=require(_0xdfce('0x17'));var config=require(_0xdfce('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdfce('0x19'))['db'];var integrations=require(_0xdfce('0x1a'));function respondWithStatusCode(_0x1bbc23,_0x2b8469){_0x2b8469=_0x2b8469||0xcc;return function(_0x41deee){if(_0x41deee){return _0x1bbc23[_0xdfce('0x1b')](_0x2b8469);}return _0x1bbc23[_0xdfce('0x1c')](_0x2b8469)[_0xdfce('0x1d')]();};}function respondWithResult(_0x1a4568,_0x529e7a){_0x529e7a=_0x529e7a||0xc8;return function(_0x10c109){if(_0x10c109){return _0x1a4568[_0xdfce('0x1c')](_0x529e7a)[_0xdfce('0x1e')](_0x10c109);}};}function respondWithFilteredResult(_0x3f0cc8,_0x44981f){return function(_0x2bd655){if(_0x2bd655){var _0x3ec986=typeof _0x44981f[_0xdfce('0x1f')]==='undefined'&&typeof _0x44981f[_0xdfce('0x20')]===_0xdfce('0x21');var _0x2feffb=_0x2bd655[_0xdfce('0x22')];var _0x412d7b=_0x3ec986?0x0:_0x44981f[_0xdfce('0x1f')];var _0x3b603c=_0x3ec986?_0x2bd655[_0xdfce('0x22')]:_0x44981f[_0xdfce('0x1f')]+_0x44981f[_0xdfce('0x20')];var _0x3820ec;if(_0x3b603c>=_0x2feffb){_0x3b603c=_0x2feffb;_0x3820ec=0xc8;}else{_0x3820ec=0xce;}_0x3f0cc8[_0xdfce('0x1c')](_0x3820ec);return _0x3f0cc8[_0xdfce('0x23')](_0xdfce('0x24'),_0x412d7b+'-'+_0x3b603c+'/'+_0x2feffb)[_0xdfce('0x1e')](_0x2bd655);}return null;};}function patchUpdates(_0x3ad0e3){return function(_0x1b0cd0){try{jsonpatch[_0xdfce('0x25')](_0x1b0cd0,_0x3ad0e3,!![]);}catch(_0x2b3b77){return BPromise['reject'](_0x2b3b77);}return _0x1b0cd0[_0xdfce('0x26')]();};}function saveUpdates(_0x2e9c7f,_0x35fc7c){return function(_0xf530a0){if(_0xf530a0){return _0xf530a0[_0xdfce('0x27')](_0x2e9c7f)[_0xdfce('0x28')](function(_0x457c8a){return _0x457c8a;});}return null;};}function removeEntity(_0x45e4ef,_0x29b869){return function(_0x440520){if(_0x440520){return _0x440520[_0xdfce('0x29')]()[_0xdfce('0x28')](function(){_0x45e4ef['status'](0xcc)[_0xdfce('0x1d')]();});}};}function handleEntityNotFound(_0x36dbac,_0x43e255){return function(_0x37bdbf){if(!_0x37bdbf){_0x36dbac[_0xdfce('0x1b')](0x194);}return _0x37bdbf;};}function handleError(_0x7f0e43,_0x36fabd){_0x36fabd=_0x36fabd||0x1f4;return function(_0x5e6368){logger[_0xdfce('0x2a')](_0x5e6368[_0xdfce('0x2b')]);if(_0x5e6368[_0xdfce('0x2c')]){delete _0x5e6368['name'];}_0x7f0e43['status'](_0x36fabd)[_0xdfce('0x2d')](_0x5e6368);};}exports[_0xdfce('0x2e')]=function(_0x563a7c,_0x326c74){var _0x55641f={},_0x2406e1={},_0x426f02={'count':0x0,'rows':[]};var _0x3fc766=_[_0xdfce('0x2f')](db[_0xdfce('0x30')]['rawAttributes'],function(_0x292f45){return{'name':_0x292f45['fieldName'],'type':_0x292f45[_0xdfce('0x31')][_0xdfce('0x32')]};});_0x2406e1[_0xdfce('0x33')]=_['map'](_0x3fc766,_0xdfce('0x2c'));_0x2406e1['query']=_[_0xdfce('0x34')](_0x563a7c[_0xdfce('0x35')]);_0x2406e1[_0xdfce('0x36')]=_[_0xdfce('0x37')](_0x2406e1[_0xdfce('0x33')],_0x2406e1['query']);_0x55641f[_0xdfce('0x38')]=_[_0xdfce('0x37')](_0x2406e1[_0xdfce('0x33')],qs[_0xdfce('0x39')](_0x563a7c['query'][_0xdfce('0x39')]));_0x55641f[_0xdfce('0x38')]=_0x55641f[_0xdfce('0x38')][_0xdfce('0x3a')]?_0x55641f[_0xdfce('0x38')]:_0x2406e1[_0xdfce('0x33')];if(!_0x563a7c[_0xdfce('0x35')]['hasOwnProperty'](_0xdfce('0x3b'))){_0x55641f[_0xdfce('0x20')]=qs[_0xdfce('0x20')](_0x563a7c['query'][_0xdfce('0x20')]);_0x55641f[_0xdfce('0x1f')]=qs[_0xdfce('0x1f')](_0x563a7c[_0xdfce('0x35')][_0xdfce('0x1f')]);}_0x55641f[_0xdfce('0x3c')]=qs['sort'](_0x563a7c[_0xdfce('0x35')][_0xdfce('0x3d')]);_0x55641f[_0xdfce('0x3e')]=qs[_0xdfce('0x36')](_[_0xdfce('0x3f')](_0x563a7c[_0xdfce('0x35')],_0x2406e1['filters']),_0x3fc766);if(_0x563a7c[_0xdfce('0x35')][_0xdfce('0x40')]){_0x55641f['where']=_[_0xdfce('0x41')](_0x55641f[_0xdfce('0x3e')],{'$or':_[_0xdfce('0x2f')](_0x3fc766,function(_0x5778d4){if(_0x5778d4[_0xdfce('0x31')]!==_0xdfce('0x42')){var _0x9df2cc={};_0x9df2cc[_0x5778d4[_0xdfce('0x2c')]]={'$like':'%'+_0x563a7c[_0xdfce('0x35')][_0xdfce('0x40')]+'%'};return _0x9df2cc;}})});}_0x55641f=_[_0xdfce('0x41')]({},_0x55641f,_0x563a7c[_0xdfce('0x43')]);var _0x40d185={'where':_0x55641f['where']};return db['VtigerAccount'][_0xdfce('0x22')](_0x40d185)['then'](function(_0x210997){_0x426f02[_0xdfce('0x22')]=_0x210997;if(_0x563a7c[_0xdfce('0x35')][_0xdfce('0x44')]){_0x55641f[_0xdfce('0x45')]=[{'all':!![]}];}return db[_0xdfce('0x30')][_0xdfce('0x46')](_0x55641f);})[_0xdfce('0x28')](function(_0x246c50){_0x426f02['rows']=_0x246c50;return _0x426f02;})[_0xdfce('0x28')](respondWithFilteredResult(_0x326c74,_0x55641f))[_0xdfce('0x47')](handleError(_0x326c74,null));};exports[_0xdfce('0x48')]=function(_0x597dea,_0x4d41f3){var _0x3fb021={'raw':![],'where':{'id':_0x597dea[_0xdfce('0x49')]['id']}},_0x4c32e5={};_0x4c32e5['model']=_[_0xdfce('0x34')](db[_0xdfce('0x30')][_0xdfce('0x4a')]);_0x4c32e5[_0xdfce('0x35')]=_[_0xdfce('0x34')](_0x597dea[_0xdfce('0x35')]);_0x4c32e5[_0xdfce('0x36')]=_[_0xdfce('0x37')](_0x4c32e5[_0xdfce('0x33')],_0x4c32e5['query']);_0x3fb021[_0xdfce('0x38')]=_['intersection'](_0x4c32e5[_0xdfce('0x33')],qs[_0xdfce('0x39')](_0x597dea[_0xdfce('0x35')][_0xdfce('0x39')]));_0x3fb021[_0xdfce('0x38')]=_0x3fb021[_0xdfce('0x38')][_0xdfce('0x3a')]?_0x3fb021[_0xdfce('0x38')]:_0x4c32e5['model'];if(_0x597dea[_0xdfce('0x35')][_0xdfce('0x44')]){_0x3fb021[_0xdfce('0x45')]=[{'all':!![]}];}_0x3fb021=_[_0xdfce('0x41')]({},_0x3fb021,_0x597dea[_0xdfce('0x43')]);return db[_0xdfce('0x30')][_0xdfce('0x4b')](_0x3fb021)[_0xdfce('0x28')](handleEntityNotFound(_0x4d41f3,null))['then'](respondWithResult(_0x4d41f3,null))[_0xdfce('0x47')](handleError(_0x4d41f3,null));};exports[_0xdfce('0x4c')]=function(_0x39b91d,_0x1ce8c6){return db[_0xdfce('0x30')][_0xdfce('0x4c')](_0x39b91d['body'],{})['then'](respondWithResult(_0x1ce8c6,0xc9))[_0xdfce('0x47')](handleError(_0x1ce8c6,null));};exports[_0xdfce('0x27')]=function(_0x10ab37,_0x5c96c4){if(_0x10ab37[_0xdfce('0x4d')]['id']){delete _0x10ab37[_0xdfce('0x4d')]['id'];}return db['VtigerAccount'][_0xdfce('0x4b')]({'where':{'id':_0x10ab37[_0xdfce('0x49')]['id']}})[_0xdfce('0x28')](handleEntityNotFound(_0x5c96c4,null))['then'](saveUpdates(_0x10ab37[_0xdfce('0x4d')],null))[_0xdfce('0x28')](respondWithResult(_0x5c96c4,null))[_0xdfce('0x47')](handleError(_0x5c96c4,null));};exports['destroy']=function(_0x2a3af6,_0x58b408){return db[_0xdfce('0x30')]['find']({'where':{'id':_0x2a3af6[_0xdfce('0x49')]['id']}})[_0xdfce('0x28')](handleEntityNotFound(_0x58b408,null))[_0xdfce('0x28')](removeEntity(_0x58b408,null))['catch'](handleError(_0x58b408,null));};exports[_0xdfce('0x4e')]=function(_0x5815a2,_0x4e2aed,_0x17f6ad){var _0x18257f={};var _0x342176={};var _0x399d16;var _0x5126fb;return db[_0xdfce('0x30')]['findOne']({'where':{'id':_0x5815a2[_0xdfce('0x49')]['id']}})[_0xdfce('0x28')](handleEntityNotFound(_0x4e2aed,null))[_0xdfce('0x28')](function(_0x2591ab){if(_0x2591ab){_0x399d16=_0x2591ab;_0x342176[_0xdfce('0x33')]=_['keys'](db[_0xdfce('0x4f')][_0xdfce('0x4a')]);_0x342176[_0xdfce('0x35')]=_[_0xdfce('0x34')](_0x5815a2[_0xdfce('0x35')]);_0x342176[_0xdfce('0x36')]=_[_0xdfce('0x37')](_0x342176[_0xdfce('0x33')],_0x342176[_0xdfce('0x35')]);_0x18257f[_0xdfce('0x38')]=_['intersection'](_0x342176['model'],qs[_0xdfce('0x39')](_0x5815a2[_0xdfce('0x35')][_0xdfce('0x39')]));_0x18257f[_0xdfce('0x38')]=_0x18257f[_0xdfce('0x38')][_0xdfce('0x3a')]?_0x18257f['attributes']:_0x342176[_0xdfce('0x33')];_0x18257f[_0xdfce('0x3c')]=qs[_0xdfce('0x3d')](_0x5815a2[_0xdfce('0x35')][_0xdfce('0x3d')]);_0x18257f['where']=qs['filters'](_[_0xdfce('0x3f')](_0x5815a2[_0xdfce('0x35')],_0x342176[_0xdfce('0x36')]));if(_0x5815a2[_0xdfce('0x35')][_0xdfce('0x40')]){_0x18257f[_0xdfce('0x3e')]=_[_0xdfce('0x41')](_0x18257f[_0xdfce('0x3e')],{'$or':_[_0xdfce('0x2f')](_0x18257f[_0xdfce('0x38')],function(_0x67613f){var _0x39290b={};_0x39290b[_0x67613f]={'$like':'%'+_0x5815a2[_0xdfce('0x35')][_0xdfce('0x40')]+'%'};return _0x39290b;})});}_0x18257f=_[_0xdfce('0x41')]({},_0x18257f,_0x5815a2[_0xdfce('0x43')]);return _0x399d16[_0xdfce('0x4e')](_0x18257f);}})['then'](function(_0x545496){if(_0x545496){_0x5126fb=_0x545496[_0xdfce('0x3a')];if(!_0x5815a2[_0xdfce('0x35')]['hasOwnProperty']('nolimit')){_0x18257f[_0xdfce('0x20')]=qs['limit'](_0x5815a2[_0xdfce('0x35')][_0xdfce('0x20')]);_0x18257f['offset']=qs[_0xdfce('0x1f')](_0x5815a2['query']['offset']);}return _0x399d16[_0xdfce('0x4e')](_0x18257f);}})[_0xdfce('0x28')](function(_0x2353a5){if(_0x2353a5){return _0x2353a5?{'count':_0x5126fb,'rows':_0x2353a5}:null;}})[_0xdfce('0x28')](respondWithResult(_0x4e2aed,null))['catch'](handleError(_0x4e2aed,null));};exports[_0xdfce('0x50')]=function(_0x31ce4,_0x259e26,_0x4311c8){if(_0x31ce4['body']['id']){delete _0x31ce4['body']['id'];}return db[_0xdfce('0x30')][_0xdfce('0x51')]({'where':{'id':_0x31ce4[_0xdfce('0x49')]['id']}})[_0xdfce('0x28')](handleEntityNotFound(_0x259e26,null))[_0xdfce('0x28')](function(_0x16a4ee){if(_0x16a4ee){_0x31ce4[_0xdfce('0x4d')][_0xdfce('0x52')]=_0x16a4ee['id'];_0x31ce4[_0xdfce('0x4d')][_0xdfce('0x53')]=integrations[_0xdfce('0x54')](_0x31ce4[_0xdfce('0x4d')][_0xdfce('0x55')],_0x31ce4[_0xdfce('0x4d')][_0xdfce('0x31')]);_0x31ce4[_0xdfce('0x4d')]['Descriptions']=integrations[_0xdfce('0x56')](_0x31ce4['body'][_0xdfce('0x55')],_0x31ce4[_0xdfce('0x4d')][_0xdfce('0x31')]);return db['VtigerConfiguration'][_0xdfce('0x4c')](_0x31ce4[_0xdfce('0x4d')],{'include':[{'model':db[_0xdfce('0x57')],'as':'Subjects'},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0xdfce('0x28')](respondWithResult(_0x259e26,null))[_0xdfce('0x47')](handleError(_0x259e26,null));};var md5=require(_0xdfce('0x58'));exports['getFields']=function(_0x1f5064,_0xd2df69,_0x1c0afc){var _0x538eca=null;var _0x2cf75d=null;var _0x402eb5=null;var _0x4ee745=null;var _0x4594cb='';return db[_0xdfce('0x30')]['findOne']({'where':{'id':_0x1f5064[_0xdfce('0x49')]['id']},'attributes':['id',_0xdfce('0x2c'),_0xdfce('0x59'),_0xdfce('0x5a'),_0xdfce('0x5b'),_0xdfce('0x5c'),_0xdfce('0x5d'),'accessKey']})[_0xdfce('0x28')](handleEntityNotFound(_0xd2df69,null))[_0xdfce('0x28')](function(_0xb9fa03){if(_0xb9fa03){_0x538eca=_0xb9fa03['username'];_0x2cf75d=_0xb9fa03[_0xdfce('0x5e')];_0x402eb5=_0xb9fa03['moduleName'];_0x4594cb=_0xb9fa03[_0xdfce('0x5c')];var _0x111b11=_0x4594cb[_0xdfce('0x5f')](-0x1);if(_0x111b11==='/'){_0x4594cb=_0x4594cb[_0xdfce('0x60')](0x0,_0x4594cb[_0xdfce('0x61')](_0x111b11));}_0x4ee745=util[_0xdfce('0x62')](_0xdfce('0x63'),_0x4594cb);var _0x189d2c={'method':_0xdfce('0x64'),'uri':_0x4ee745,'qs':{'operation':_0xdfce('0x65'),'username':_0xb9fa03[_0xdfce('0x59')]},'json':!![]};return rp(_0x189d2c);}})[_0xdfce('0x28')](function(_0x379693){if(_0x379693['success']){var _0x2eb3b3={'method':_0xdfce('0x66'),'uri':_0x4ee745,'form':{'operation':_0xdfce('0x67'),'username':_0x538eca,'accessKey':md5(_0x379693[_0xdfce('0x68')][_0xdfce('0x69')]+_0x2cf75d)},'json':!![]};return rp(_0x2eb3b3);}})[_0xdfce('0x28')](function(_0x57d11f){if(_0x57d11f[_0xdfce('0x6a')]){var _0x392359={'method':_0xdfce('0x64'),'uri':_0x4ee745,'qs':{'operation':_0xdfce('0x6b'),'username':_0x538eca,'sessionName':_0x57d11f['result'][_0xdfce('0x6c')],'elementType':_0x402eb5},'json':!![]};return rp(_0x392359);}})[_0xdfce('0x28')](function(_0xd6ee90){if(_0xd6ee90[_0xdfce('0x6a')]){var _0x2530ef=[_0xdfce('0x6d'),'reference',_0xdfce('0x6e')];_[_0xdfce('0x6f')](_0xd6ee90[_0xdfce('0x68')][_0xdfce('0x39')],function(_0x4150ca){return _0x2530ef['includes'](_0x4150ca[_0xdfce('0x31')]['name']);});_[_0xdfce('0x6f')](_0xd6ee90[_0xdfce('0x68')][_0xdfce('0x39')],function(_0x4eb66d){return _0x4eb66d[_0xdfce('0x70')]===_0xdfce('0x71');});return{'count':_0xd6ee90['result'][_0xdfce('0x39')][_0xdfce('0x3a')],'rows':_[_0xdfce('0x2f')](_0xd6ee90[_0xdfce('0x68')][_0xdfce('0x39')],function(_0x1b94c0){return{'id':_0x1b94c0[_0xdfce('0x2c')],'name':_0x1b94c0[_0xdfce('0x72')],'custom':_[_0xdfce('0x73')](_0x1b94c0['name'],_0xdfce('0x74'))?!![]:![],'options':_0x1b94c0[_0xdfce('0x31')][_0xdfce('0x2c')]===_0xdfce('0x75')&&_0x1b94c0[_0xdfce('0x31')][_0xdfce('0x76')]['length']>0x0?_[_0xdfce('0x2f')](_0x1b94c0[_0xdfce('0x31')][_0xdfce('0x76')],function(_0x50b1db){return{'name':_0x50b1db[_0xdfce('0x72')],'value':_0x50b1db[_0xdfce('0x77')]};}):[]};})};}})[_0xdfce('0x28')](respondWithResult(_0xd2df69,null))['catch'](function(_0x49bbaa){console[_0xdfce('0x78')](_0xdfce('0x79')+_0x49bbaa);var _0xa2caa6=_0x1f5064[_0xdfce('0x35')][_0xdfce('0x7a')]?0x1f4:_0x49bbaa[_0xdfce('0x7b')]||0x1f4;logger[_0xdfce('0x2a')](_0xdfce('0x7c'),'getFields',_0xa2caa6,JSON[_0xdfce('0x7d')](_0x49bbaa));delete _0x49bbaa['name'];if(_0xa2caa6===0x191){_0xa2caa6=0x190;}_0xd2df69[_0xdfce('0x1c')](_0xa2caa6)['send'](_0x1f5064['query'][_0xdfce('0x7a')]?{'message':_0xdfce('0x7e'),'statusCode':_0x49bbaa[_0xdfce('0x7b')]}:_0x49bbaa);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 660e722..2da7295 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 _0x5ad8=['api','request-promise','path','exports','define','VtigerAccount','int_vtiger_accounts','../../config/logger'];(function(_0x4c296f,_0xb0a6e8){var _0x29bc9b=function(_0x2dcfd0){while(--_0x2dcfd0){_0x4c296f['push'](_0x4c296f['shift']());}};_0x29bc9b(++_0xb0a6e8);}(_0x5ad8,0xef));var _0x85ad=function(_0x404eff,_0x4ef653){_0x404eff=_0x404eff-0x0;var _0x46cc25=_0x5ad8[_0x404eff];return _0x46cc25;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85ad('0x0'))(_0x85ad('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x85ad('0x2'));var fs=require('fs');var path=require(_0x85ad('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x85ad('0x4')]=function(_0xf7856c,_0x3550ea){return _0xf7856c[_0x85ad('0x5')](_0x85ad('0x6'),attributes,{'tableName':_0x85ad('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfd8=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','util','api','moment','bluebird','request-promise'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xbfd8,0x74));var _0x8bfd=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xbfd8[_0x4fc9e6];return _0x551d28;};'use strict';var _=require('lodash');var util=require(_0x8bfd('0x0'));var logger=require('../../config/logger')(_0x8bfd('0x1'));var moment=require(_0x8bfd('0x2'));var BPromise=require(_0x8bfd('0x3'));var rp=require(_0x8bfd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8bfd('0x5'));var attributes=require(_0x8bfd('0x6'));var integrations=require(_0x8bfd('0x7'));module['exports']=function(_0x549395,_0x3c2f89){return _0x549395[_0x8bfd('0x8')](_0x8bfd('0x9'),attributes,{'tableName':_0x8bfd('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 2ecb2fd..e04d6ed 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 _0xefda=['options','raw','attributes','include','map','model','ShowVtigerAccount','VtigerAccount','find','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','GetVtigerAccount','findAll'];(function(_0x58f2e7,_0x3c2877){var _0x238c22=function(_0xb94bd8){while(--_0xb94bd8){_0x58f2e7['push'](_0x58f2e7['shift']());}};_0x238c22(++_0x3c2877);}(_0xefda,0x96));var _0xaefd=function(_0x4da1f5,_0x3caca0){_0x4da1f5=_0x4da1f5-0x0;var _0x155c6a=_0xefda[_0x4da1f5];return _0x155c6a;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['VtigerAccount'][_0xaefd('0x18')]({'raw':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['where']||null:null,'attributes':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'limit':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['limit']||null:null,'include':_0x9748f4['options']?_0x9748f4['options'][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x9748f4[_0xaefd('0x19')]['include'],function(_0x23060f){return{'model':db[_0x23060f['model']],'as':_0x23060f['as'],'attributes':_0x23060f[_0xaefd('0x1b')],'include':_0x23060f[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x23060f['include'],function(_0x435413){return{'model':db[_0x435413[_0xaefd('0x1e')]],'as':_0x435413['as'],'attributes':_0x435413[_0xaefd('0x1b')],'include':_0x435413[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x435413['include'],function(_0x2fe27e){return{'model':db[_0x2fe27e['model']],'as':_0x2fe27e['as'],'attributes':_0x2fe27e[_0xaefd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x5470bd){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger['debug'](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5470bd));_0x2db61b(_0x5470bd);})[_0xaefd('0x16')](function(_0x4c0898){logger[_0xaefd('0x10')]('GetVtigerAccount',_0x4c0898[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1['error'](0x1f4,_0x4c0898['message']));});});};exports[_0xaefd('0x1f')]=function(_0x1b470c){var _0x4a032d=this;return new Promise(function(_0x578378,_0x4ee0c1){return db[_0xaefd('0x20')][_0xaefd('0x21')]({'raw':_0x1b470c['options']?_0x1b470c['options'][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x22')]||null:null,'attributes':_0x1b470c['options']?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'include':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')],function(_0x3e3fe2){return{'model':db[_0x3e3fe2[_0xaefd('0x1e')]],'as':_0x3e3fe2['as'],'attributes':_0x3e3fe2[_0xaefd('0x1b')],'include':_0x3e3fe2[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x3e3fe2[_0xaefd('0x1c')],function(_0x1ffec4){return{'model':db[_0x1ffec4[_0xaefd('0x1e')]],'as':_0x1ffec4['as'],'attributes':_0x1ffec4['attributes'],'include':_0x1ffec4[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1ffec4[_0xaefd('0x1c')],function(_0x59aec9){return{'model':db[_0x59aec9[_0xaefd('0x1e')]],'as':_0x59aec9['as'],'attributes':_0x59aec9['attributes']};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x3498d9){logger[_0xaefd('0x14')](_0xaefd('0x1f'),_0x1b470c);logger[_0xaefd('0xd')](_0xaefd('0x1f'),_0x1b470c,JSON[_0xaefd('0xf')](_0x3498d9));_0x578378(_0x3498d9);})[_0xaefd('0x16')](function(_0x407bea){logger[_0xaefd('0x10')](_0xaefd('0x1f'),_0x407bea[_0xaefd('0x13')],_0x1b470c);_0x4ee0c1(_0x4a032d[_0xaefd('0x10')](0x1f4,_0x407bea[_0xaefd('0x13')]));});});}; \ No newline at end of file +var _0x41bb=['../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVtigerAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowVtigerAccount','VtigerAccount','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x10b95c,_0x134f5a){var _0x53fbf8=function(_0x5cc266){while(--_0x5cc266){_0x10b95c['push'](_0x10b95c['shift']());}};_0x53fbf8(++_0x134f5a);}(_0x41bb,0xc5));var _0xb41b=function(_0x395646,_0x5c6cfe){_0x395646=_0x395646-0x0;var _0x3737e2=_0x41bb[_0x395646];return _0x3737e2;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});}exports[_0xb41b('0x15')]=function(_0x47154d){var _0x198783=this;return new Promise(function(_0x5df8c2,_0x4b3580){return db['VtigerAccount'][_0xb41b('0x16')]({'raw':_0x47154d['options']?_0x47154d[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x47154d[_0xb41b('0x17')]?_0x47154d['options']['where']||null:null,'attributes':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'limit':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x1a')]||null:null,'include':_0x47154d['options']?_0x47154d['options'][_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x47154d[_0xb41b('0x17')]['include'],function(_0x14e9c8){return{'model':db[_0x14e9c8[_0xb41b('0x1d')]],'as':_0x14e9c8['as'],'attributes':_0x14e9c8['attributes'],'include':_0x14e9c8[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x14e9c8['include'],function(_0xed3c7e){return{'model':db[_0xed3c7e['model']],'as':_0xed3c7e['as'],'attributes':_0xed3c7e[_0xb41b('0x19')],'include':_0xed3c7e[_0xb41b('0x1b')]?_['map'](_0xed3c7e[_0xb41b('0x1b')],function(_0x4265b8){return{'model':db[_0x4265b8['model']],'as':_0x4265b8['as'],'attributes':_0x4265b8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x46aecf){logger[_0xb41b('0xc')](_0xb41b('0x15'),_0x47154d);logger[_0xb41b('0xf')](_0xb41b('0x15'),_0x47154d,JSON[_0xb41b('0x1e')](_0x46aecf));_0x5df8c2(_0x46aecf);})['catch'](function(_0x26ef96){logger[_0xb41b('0x10')]('GetVtigerAccount',_0x26ef96[_0xb41b('0x12')],_0x47154d);_0x4b3580(_0x198783['error'](0x1f4,_0x26ef96[_0xb41b('0x12')]));});});};exports[_0xb41b('0x1f')]=function(_0x597a35){var _0x23a6ed=this;return new Promise(function(_0x4a95e7,_0x29da9f){return db[_0xb41b('0x20')]['find']({'raw':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x21')]||null:null,'attributes':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'include':_0x597a35[_0xb41b('0x17')]?_0x597a35['options'][_0xb41b('0x1b')]?_['map'](_0x597a35['options'][_0xb41b('0x1b')],function(_0x192ceb){return{'model':db[_0x192ceb[_0xb41b('0x1d')]],'as':_0x192ceb['as'],'attributes':_0x192ceb[_0xb41b('0x19')],'include':_0x192ceb[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x192ceb[_0xb41b('0x1b')],function(_0x197197){return{'model':db[_0x197197[_0xb41b('0x1d')]],'as':_0x197197['as'],'attributes':_0x197197[_0xb41b('0x19')],'include':_0x197197[_0xb41b('0x1b')]?_['map'](_0x197197[_0xb41b('0x1b')],function(_0x27990d){return{'model':db[_0x27990d[_0xb41b('0x1d')]],'as':_0x27990d['as'],'attributes':_0x27990d[_0xb41b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x10b3f6){logger['info']('ShowVtigerAccount',_0x597a35);logger[_0xb41b('0xf')](_0xb41b('0x1f'),_0x597a35,JSON['stringify'](_0x10b3f6));_0x4a95e7(_0x10b3f6);})[_0xb41b('0x14')](function(_0x47363e){logger[_0xb41b('0x10')](_0xb41b('0x1f'),_0x47363e[_0xb41b('0x12')],_0x597a35);_0x29da9f(_0x23a6ed['error'](0x1f4,_0x47363e[_0xb41b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ae0d698..f2fd7fc 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 _0xc7da=['getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x4d78ad,_0x1d2126){var _0x35e3f8=function(_0x4ff18c){while(--_0x4ff18c){_0x4d78ad['push'](_0x4d78ad['shift']());}};_0x35e3f8(++_0x1d2126);}(_0xc7da,0x6e));var _0xac7d=function(_0x1f9497,_0x174cf8){_0x1f9497=_0x1f9497-0x0;var _0x395f3d=_0xc7da[_0x1f9497];return _0x395f3d;};'use strict';var multer=require(_0xac7d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xac7d('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xac7d('0x2'));var config=require(_0xac7d('0x3'));var controller=require('./intVtigerConfiguration.controller');router[_0xac7d('0x4')]('/',auth[_0xac7d('0x5')](),controller[_0xac7d('0x6')]);router[_0xac7d('0x4')](_0xac7d('0x7'),auth[_0xac7d('0x5')](),controller[_0xac7d('0x8')]);router['get'](_0xac7d('0x9'),auth[_0xac7d('0x5')](),controller[_0xac7d('0xa')]);router[_0xac7d('0x4')](_0xac7d('0xb'),auth[_0xac7d('0x5')](),controller['getSubjects']);router[_0xac7d('0x4')](_0xac7d('0xc'),auth[_0xac7d('0x5')](),controller[_0xac7d('0xd')]);router[_0xac7d('0xe')]('/',auth[_0xac7d('0x5')](),controller[_0xac7d('0xf')]);router[_0xac7d('0x10')](_0xac7d('0x7'),auth[_0xac7d('0x5')](),controller[_0xac7d('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xac7d('0x12')]);module[_0xac7d('0x13')]=router; \ No newline at end of file +var _0x7021=['put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x36e059,_0x19ee27){var _0x52ee13=function(_0x3dbfb1){while(--_0x3dbfb1){_0x36e059['push'](_0x36e059['shift']());}};_0x52ee13(++_0x19ee27);}(_0x7021,0x65));var _0x1702=function(_0x3fb22d,_0x4d997b){_0x3fb22d=_0x3fb22d-0x0;var _0x42b188=_0x7021[_0x3fb22d];return _0x42b188;};'use strict';var multer=require(_0x1702('0x0'));var util=require('util');var path=require(_0x1702('0x1'));var timeout=require(_0x1702('0x2'));var express=require('express');var router=express[_0x1702('0x3')]();var fs_extra=require(_0x1702('0x4'));var auth=require(_0x1702('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1702('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1702('0x7')]);router[_0x1702('0x8')](_0x1702('0x9'),auth['isAuthenticated'](),controller[_0x1702('0xa')]);router[_0x1702('0x8')](_0x1702('0xb'),auth[_0x1702('0xc')](),controller[_0x1702('0xd')]);router[_0x1702('0x8')]('/:id/subjects',auth[_0x1702('0xc')](),controller[_0x1702('0xe')]);router['get'](_0x1702('0xf'),auth[_0x1702('0xc')](),controller[_0x1702('0x10')]);router[_0x1702('0x11')]('/',auth[_0x1702('0xc')](),controller[_0x1702('0x12')]);router[_0x1702('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x1702('0x14')]);router[_0x1702('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1702('0x16')]);module[_0x1702('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index f1ede2b..c9ccc71 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 _0x30f8=['exports','STRING','sequelize'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x30f8,0xdd));var _0x830f=function(_0xddeb7f,_0x340ab6){_0xddeb7f=_0xddeb7f-0x0;var _0x173a8b=_0x30f8[_0xddeb7f];return _0x173a8b;};'use strict';var Sequelize=require(_0x830f('0x0'));module[_0x830f('0x1')]={'name':{'type':Sequelize[_0x830f('0x2')]},'description':{'type':Sequelize[_0x830f('0x2')]}}; \ No newline at end of file +var _0x0a00=['STRING','sequelize','exports'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x0a00,0x17e));var _0x00a0=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x0a00[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x00a0('0x0'));module[_0x00a0('0x1')]={'name':{'type':Sequelize[_0x00a0('0x2')]},'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 fcd2a7a..bab3be7 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 _0x6a24=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','find','catch','create','body','params','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x3ce181,_0x4cd70a){var _0x590399=function(_0x57fe17){while(--_0x57fe17){_0x3ce181['push'](_0x3ce181['shift']());}};_0x590399(++_0x4cd70a);}(_0x6a24,0xd1));var _0x46a2=function(_0x443aa8,_0x4b7f05){_0x443aa8=_0x443aa8-0x0;var _0x1864d9=_0x6a24[_0x443aa8];return _0x1864d9;};'use strict';var emlformat=require(_0x46a2('0x0'));var rimraf=require(_0x46a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46a2('0x2'));var rp=require(_0x46a2('0x3'));var moment=require(_0x46a2('0x4'));var BPromise=require(_0x46a2('0x5'));var Mustache=require(_0x46a2('0x6'));var util=require('util');var path=require(_0x46a2('0x7'));var sox=require(_0x46a2('0x8'));var csv=require('to-csv');var ejs=require(_0x46a2('0x9'));var fs=require('fs');var fs_extra=require(_0x46a2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x46a2('0xb'));var jsforce=require(_0x46a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x46a2('0xd'));var querystring=require('querystring');var Papa=require(_0x46a2('0xe'));var Redis=require('ioredis');var authService=require(_0x46a2('0xf'));var qs=require(_0x46a2('0x10'));var as=require(_0x46a2('0x11'));var hardwareService=require(_0x46a2('0x12'));var logger=require(_0x46a2('0x13'))(_0x46a2('0x14'));var utils=require(_0x46a2('0x15'));var config=require(_0x46a2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403282,_0x18e584){_0x18e584=_0x18e584||0xcc;return function(_0x5c5d10){if(_0x5c5d10){return _0x403282[_0x46a2('0x17')](_0x18e584);}return _0x403282[_0x46a2('0x18')](_0x18e584)[_0x46a2('0x19')]();};}function respondWithResult(_0x18a038,_0xddc328){_0xddc328=_0xddc328||0xc8;return function(_0x2fd383){if(_0x2fd383){return _0x18a038[_0x46a2('0x18')](_0xddc328)[_0x46a2('0x1a')](_0x2fd383);}};}function respondWithFilteredResult(_0x577591,_0x4a7e7a){return function(_0x3c81e8){if(_0x3c81e8){var _0x2deb20=typeof _0x4a7e7a['offset']===_0x46a2('0x1b')&&typeof _0x4a7e7a[_0x46a2('0x1c')]==='undefined';var _0xa2eb96=_0x3c81e8[_0x46a2('0x1d')];var _0x577f18=_0x2deb20?0x0:_0x4a7e7a[_0x46a2('0x1e')];var _0x24f75f=_0x2deb20?_0x3c81e8['count']:_0x4a7e7a[_0x46a2('0x1e')]+_0x4a7e7a[_0x46a2('0x1c')];var _0x5144c7;if(_0x24f75f>=_0xa2eb96){_0x24f75f=_0xa2eb96;_0x5144c7=0xc8;}else{_0x5144c7=0xce;}_0x577591[_0x46a2('0x18')](_0x5144c7);return _0x577591[_0x46a2('0x1f')](_0x46a2('0x20'),_0x577f18+'-'+_0x24f75f+'/'+_0xa2eb96)[_0x46a2('0x1a')](_0x3c81e8);}return null;};}function patchUpdates(_0x202294){return function(_0x2d65c2){try{jsonpatch[_0x46a2('0x21')](_0x2d65c2,_0x202294,!![]);}catch(_0x473cfb){return BPromise[_0x46a2('0x22')](_0x473cfb);}return _0x2d65c2[_0x46a2('0x23')]();};}function saveUpdates(_0x5c7586,_0xa37d90){return function(_0x504b9e){if(_0x504b9e){return _0x504b9e[_0x46a2('0x24')](_0x5c7586)[_0x46a2('0x25')](function(_0x511ff6){return _0x511ff6;});}return null;};}function removeEntity(_0x43dc69,_0x15e5bb){return function(_0x233c4e){if(_0x233c4e){return _0x233c4e[_0x46a2('0x26')]()['then'](function(){_0x43dc69[_0x46a2('0x18')](0xcc)[_0x46a2('0x19')]();});}};}function handleEntityNotFound(_0x1e48f5,_0x297158){return function(_0x74bb6a){if(!_0x74bb6a){_0x1e48f5[_0x46a2('0x17')](0x194);}return _0x74bb6a;};}function handleError(_0x3e9554,_0xfa9e13){_0xfa9e13=_0xfa9e13||0x1f4;return function(_0x218f1c){logger[_0x46a2('0x27')](_0x218f1c[_0x46a2('0x28')]);if(_0x218f1c['name']){delete _0x218f1c[_0x46a2('0x29')];}_0x3e9554[_0x46a2('0x18')](_0xfa9e13)[_0x46a2('0x2a')](_0x218f1c);};}exports[_0x46a2('0x2b')]=function(_0x435155,_0x33f42a){var _0x577fd2={},_0x185647={},_0x26856f={'count':0x0,'rows':[]};var _0x2166eb=_[_0x46a2('0x2c')](db[_0x46a2('0x2d')][_0x46a2('0x2e')],function(_0x4024be){return{'name':_0x4024be['fieldName'],'type':_0x4024be[_0x46a2('0x2f')][_0x46a2('0x30')]};});_0x185647[_0x46a2('0x31')]=_[_0x46a2('0x2c')](_0x2166eb,_0x46a2('0x29'));_0x185647[_0x46a2('0x32')]=_[_0x46a2('0x33')](_0x435155[_0x46a2('0x32')]);_0x185647[_0x46a2('0x34')]=_['intersection'](_0x185647[_0x46a2('0x31')],_0x185647[_0x46a2('0x32')]);_0x577fd2[_0x46a2('0x35')]=_[_0x46a2('0x36')](_0x185647[_0x46a2('0x31')],qs['fields'](_0x435155['query'][_0x46a2('0x37')]));_0x577fd2[_0x46a2('0x35')]=_0x577fd2[_0x46a2('0x35')][_0x46a2('0x38')]?_0x577fd2[_0x46a2('0x35')]:_0x185647[_0x46a2('0x31')];if(!_0x435155['query']['hasOwnProperty'](_0x46a2('0x39'))){_0x577fd2['limit']=qs[_0x46a2('0x1c')](_0x435155[_0x46a2('0x32')][_0x46a2('0x1c')]);_0x577fd2[_0x46a2('0x1e')]=qs['offset'](_0x435155[_0x46a2('0x32')][_0x46a2('0x1e')]);}_0x577fd2[_0x46a2('0x3a')]=qs[_0x46a2('0x3b')](_0x435155['query'][_0x46a2('0x3b')]);_0x577fd2[_0x46a2('0x3c')]=qs[_0x46a2('0x34')](_[_0x46a2('0x3d')](_0x435155['query'],_0x185647[_0x46a2('0x34')]),_0x2166eb);if(_0x435155['query'][_0x46a2('0x3e')]){_0x577fd2['where']=_[_0x46a2('0x3f')](_0x577fd2[_0x46a2('0x3c')],{'$or':_['map'](_0x2166eb,function(_0x316b3d){if(_0x316b3d['type']!=='VIRTUAL'){var _0x25aa1d={};_0x25aa1d[_0x316b3d[_0x46a2('0x29')]]={'$like':'%'+_0x435155[_0x46a2('0x32')][_0x46a2('0x3e')]+'%'};return _0x25aa1d;}})});}_0x577fd2=_[_0x46a2('0x3f')]({},_0x577fd2,_0x435155[_0x46a2('0x40')]);var _0x482ed8={'where':_0x577fd2[_0x46a2('0x3c')]};return db[_0x46a2('0x2d')][_0x46a2('0x1d')](_0x482ed8)[_0x46a2('0x25')](function(_0x23cfc9){_0x26856f[_0x46a2('0x1d')]=_0x23cfc9;if(_0x435155[_0x46a2('0x32')][_0x46a2('0x41')]){_0x577fd2[_0x46a2('0x42')]=[{'all':!![]}];}return db[_0x46a2('0x2d')]['findAll'](_0x577fd2);})[_0x46a2('0x25')](function(_0x15ec39){_0x26856f[_0x46a2('0x43')]=_0x15ec39;return _0x26856f;})[_0x46a2('0x25')](respondWithFilteredResult(_0x33f42a,_0x577fd2))['catch'](handleError(_0x33f42a,null));};exports[_0x46a2('0x44')]=function(_0x18845e,_0x153305){var _0x3869d4={'raw':![],'where':{'id':_0x18845e['params']['id']}},_0x1fcc03={};_0x1fcc03[_0x46a2('0x31')]=_['keys'](db[_0x46a2('0x2d')][_0x46a2('0x2e')]);_0x1fcc03['query']=_[_0x46a2('0x33')](_0x18845e[_0x46a2('0x32')]);_0x1fcc03[_0x46a2('0x34')]=_[_0x46a2('0x36')](_0x1fcc03[_0x46a2('0x31')],_0x1fcc03[_0x46a2('0x32')]);_0x3869d4[_0x46a2('0x35')]=_[_0x46a2('0x36')](_0x1fcc03[_0x46a2('0x31')],qs[_0x46a2('0x37')](_0x18845e['query'][_0x46a2('0x37')]));_0x3869d4[_0x46a2('0x35')]=_0x3869d4[_0x46a2('0x35')][_0x46a2('0x38')]?_0x3869d4[_0x46a2('0x35')]:_0x1fcc03['model'];if(_0x18845e[_0x46a2('0x32')][_0x46a2('0x41')]){_0x3869d4[_0x46a2('0x42')]=[{'all':!![]}];}_0x3869d4=_[_0x46a2('0x3f')]({},_0x3869d4,_0x18845e[_0x46a2('0x40')]);return db['VtigerConfiguration'][_0x46a2('0x45')](_0x3869d4)['then'](handleEntityNotFound(_0x153305,null))[_0x46a2('0x25')](respondWithResult(_0x153305,null))[_0x46a2('0x46')](handleError(_0x153305,null));};exports['create']=function(_0x41b4cd,_0x3f8673){return db[_0x46a2('0x2d')][_0x46a2('0x47')](_0x41b4cd[_0x46a2('0x48')],{})[_0x46a2('0x25')](respondWithResult(_0x3f8673,0xc9))[_0x46a2('0x46')](handleError(_0x3f8673,null));};exports['update']=function(_0x369015,_0x1f8640){if(_0x369015[_0x46a2('0x48')]['id']){delete _0x369015[_0x46a2('0x48')]['id'];}return db['VtigerConfiguration'][_0x46a2('0x45')]({'where':{'id':_0x369015['params']['id']}})[_0x46a2('0x25')](handleEntityNotFound(_0x1f8640,null))[_0x46a2('0x25')](saveUpdates(_0x369015['body'],null))[_0x46a2('0x25')](respondWithResult(_0x1f8640,null))['catch'](handleError(_0x1f8640,null));};exports[_0x46a2('0x26')]=function(_0x76ccd3,_0x3be2a7){return db[_0x46a2('0x2d')][_0x46a2('0x45')]({'where':{'id':_0x76ccd3[_0x46a2('0x49')]['id']}})['then'](handleEntityNotFound(_0x3be2a7,null))['then'](removeEntity(_0x3be2a7,null))[_0x46a2('0x46')](handleError(_0x3be2a7,null));};exports[_0x46a2('0x4a')]=function(_0x334d0e,_0x545305,_0x3dfe8d){var _0x147c8b={};var _0x2786d5={};var _0x4d33fa;var _0x9795b0;return db[_0x46a2('0x2d')][_0x46a2('0x4b')]({'where':{'id':_0x334d0e[_0x46a2('0x49')]['id']}})[_0x46a2('0x25')](handleEntityNotFound(_0x545305,null))[_0x46a2('0x25')](function(_0xa67ac){if(_0xa67ac){_0x4d33fa=_0xa67ac;_0x2786d5['model']=_[_0x46a2('0x33')](db[_0x46a2('0x4c')]['rawAttributes']);_0x2786d5[_0x46a2('0x32')]=_[_0x46a2('0x33')](_0x334d0e['query']);_0x2786d5[_0x46a2('0x34')]=_[_0x46a2('0x36')](_0x2786d5['model'],_0x2786d5[_0x46a2('0x32')]);_0x147c8b[_0x46a2('0x35')]=_['intersection'](_0x2786d5['model'],qs['fields'](_0x334d0e['query'][_0x46a2('0x37')]));_0x147c8b['attributes']=_0x147c8b['attributes'][_0x46a2('0x38')]?_0x147c8b[_0x46a2('0x35')]:_0x2786d5[_0x46a2('0x31')];_0x147c8b[_0x46a2('0x3a')]=qs[_0x46a2('0x3b')](_0x334d0e[_0x46a2('0x32')][_0x46a2('0x3b')]);_0x147c8b[_0x46a2('0x3c')]=qs[_0x46a2('0x34')](_[_0x46a2('0x3d')](_0x334d0e['query'],_0x2786d5['filters']));if(_0x334d0e[_0x46a2('0x32')][_0x46a2('0x3e')]){_0x147c8b[_0x46a2('0x3c')]=_['merge'](_0x147c8b[_0x46a2('0x3c')],{'$or':_['map'](_0x147c8b[_0x46a2('0x35')],function(_0x576db3){var _0x554048={};_0x554048[_0x576db3]={'$like':'%'+_0x334d0e[_0x46a2('0x32')]['filter']+'%'};return _0x554048;})});}_0x147c8b=_[_0x46a2('0x3f')]({},_0x147c8b,_0x334d0e['options']);return _0x4d33fa[_0x46a2('0x4a')](_0x147c8b);}})['then'](function(_0x2ac617){if(_0x2ac617){_0x9795b0=_0x2ac617['length'];if(!_0x334d0e[_0x46a2('0x32')][_0x46a2('0x4d')]('nolimit')){_0x147c8b[_0x46a2('0x1c')]=qs[_0x46a2('0x1c')](_0x334d0e[_0x46a2('0x32')][_0x46a2('0x1c')]);_0x147c8b[_0x46a2('0x1e')]=qs[_0x46a2('0x1e')](_0x334d0e[_0x46a2('0x32')][_0x46a2('0x1e')]);}return _0x4d33fa[_0x46a2('0x4a')](_0x147c8b);}})[_0x46a2('0x25')](function(_0x1454db){if(_0x1454db){return _0x1454db?{'count':_0x9795b0,'rows':_0x1454db}:null;}})['then'](respondWithResult(_0x545305,null))[_0x46a2('0x46')](handleError(_0x545305,null));};exports[_0x46a2('0x4e')]=function(_0x1fd8c2,_0x3bd256,_0xb6c937){var _0xb40d0a={};var _0x1fc849={};var _0x369246;var _0x404ff8;return db[_0x46a2('0x2d')][_0x46a2('0x4b')]({'where':{'id':_0x1fd8c2[_0x46a2('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bd256,null))['then'](function(_0x49f476){if(_0x49f476){_0x369246=_0x49f476;_0x1fc849[_0x46a2('0x31')]=_[_0x46a2('0x33')](db[_0x46a2('0x4c')][_0x46a2('0x2e')]);_0x1fc849[_0x46a2('0x32')]=_[_0x46a2('0x33')](_0x1fd8c2[_0x46a2('0x32')]);_0x1fc849['filters']=_[_0x46a2('0x36')](_0x1fc849['model'],_0x1fc849['query']);_0xb40d0a[_0x46a2('0x35')]=_[_0x46a2('0x36')](_0x1fc849[_0x46a2('0x31')],qs['fields'](_0x1fd8c2[_0x46a2('0x32')][_0x46a2('0x37')]));_0xb40d0a[_0x46a2('0x35')]=_0xb40d0a[_0x46a2('0x35')][_0x46a2('0x38')]?_0xb40d0a[_0x46a2('0x35')]:_0x1fc849[_0x46a2('0x31')];_0xb40d0a[_0x46a2('0x3a')]=qs[_0x46a2('0x3b')](_0x1fd8c2[_0x46a2('0x32')]['sort']);_0xb40d0a[_0x46a2('0x3c')]=qs[_0x46a2('0x34')](_[_0x46a2('0x3d')](_0x1fd8c2[_0x46a2('0x32')],_0x1fc849[_0x46a2('0x34')]));if(_0x1fd8c2[_0x46a2('0x32')][_0x46a2('0x3e')]){_0xb40d0a['where']=_[_0x46a2('0x3f')](_0xb40d0a[_0x46a2('0x3c')],{'$or':_[_0x46a2('0x2c')](_0xb40d0a[_0x46a2('0x35')],function(_0x55236c){var _0x65304d={};_0x65304d[_0x55236c]={'$like':'%'+_0x1fd8c2[_0x46a2('0x32')][_0x46a2('0x3e')]+'%'};return _0x65304d;})});}_0xb40d0a=_[_0x46a2('0x3f')]({},_0xb40d0a,_0x1fd8c2['options']);return _0x369246[_0x46a2('0x4e')](_0xb40d0a);}})[_0x46a2('0x25')](function(_0x3c04e3){if(_0x3c04e3){_0x404ff8=_0x3c04e3[_0x46a2('0x38')];if(!_0x1fd8c2[_0x46a2('0x32')][_0x46a2('0x4d')](_0x46a2('0x39'))){_0xb40d0a['limit']=qs['limit'](_0x1fd8c2[_0x46a2('0x32')][_0x46a2('0x1c')]);_0xb40d0a['offset']=qs[_0x46a2('0x1e')](_0x1fd8c2[_0x46a2('0x32')]['offset']);}return _0x369246[_0x46a2('0x4e')](_0xb40d0a);}})[_0x46a2('0x25')](function(_0x5b90b8){if(_0x5b90b8){return _0x5b90b8?{'count':_0x404ff8,'rows':_0x5b90b8}:null;}})[_0x46a2('0x25')](respondWithResult(_0x3bd256,null))[_0x46a2('0x46')](handleError(_0x3bd256,null));};exports[_0x46a2('0x4f')]=function(_0x530928,_0x393abd,_0x204088){var _0x22b6af={};var _0x2d34eb={};var _0x5bfa1b;var _0x3f09ff;return db[_0x46a2('0x2d')]['findOne']({'where':{'id':_0x530928['params']['id']}})[_0x46a2('0x25')](handleEntityNotFound(_0x393abd,null))[_0x46a2('0x25')](function(_0x5dcdea){if(_0x5dcdea){_0x5bfa1b=_0x5dcdea;_0x2d34eb['model']=_[_0x46a2('0x33')](db['VtigerField'][_0x46a2('0x2e')]);_0x2d34eb[_0x46a2('0x32')]=_[_0x46a2('0x33')](_0x530928[_0x46a2('0x32')]);_0x2d34eb['filters']=_['intersection'](_0x2d34eb[_0x46a2('0x31')],_0x2d34eb[_0x46a2('0x32')]);_0x22b6af[_0x46a2('0x35')]=_[_0x46a2('0x36')](_0x2d34eb[_0x46a2('0x31')],qs[_0x46a2('0x37')](_0x530928[_0x46a2('0x32')][_0x46a2('0x37')]));_0x22b6af[_0x46a2('0x35')]=_0x22b6af[_0x46a2('0x35')]['length']?_0x22b6af['attributes']:_0x2d34eb[_0x46a2('0x31')];_0x22b6af[_0x46a2('0x3a')]=qs['sort'](_0x530928[_0x46a2('0x32')][_0x46a2('0x3b')]);_0x22b6af[_0x46a2('0x3c')]=qs['filters'](_[_0x46a2('0x3d')](_0x530928[_0x46a2('0x32')],_0x2d34eb[_0x46a2('0x34')]));if(_0x530928[_0x46a2('0x32')][_0x46a2('0x3e')]){_0x22b6af[_0x46a2('0x3c')]=_[_0x46a2('0x3f')](_0x22b6af[_0x46a2('0x3c')],{'$or':_['map'](_0x22b6af[_0x46a2('0x35')],function(_0x330d17){var _0x5a19d0={};_0x5a19d0[_0x330d17]={'$like':'%'+_0x530928['query'][_0x46a2('0x3e')]+'%'};return _0x5a19d0;})});}_0x22b6af=_[_0x46a2('0x3f')]({},_0x22b6af,_0x530928[_0x46a2('0x40')]);return _0x5bfa1b[_0x46a2('0x4f')](_0x22b6af);}})['then'](function(_0xd55ba1){if(_0xd55ba1){_0x3f09ff=_0xd55ba1['length'];if(!_0x530928[_0x46a2('0x32')][_0x46a2('0x4d')](_0x46a2('0x39'))){_0x22b6af[_0x46a2('0x1c')]=qs[_0x46a2('0x1c')](_0x530928[_0x46a2('0x32')]['limit']);_0x22b6af['offset']=qs['offset'](_0x530928['query'][_0x46a2('0x1e')]);}return _0x5bfa1b[_0x46a2('0x4f')](_0x22b6af);}})[_0x46a2('0x25')](function(_0xb9cf18){if(_0xb9cf18){return _0xb9cf18?{'count':_0x3f09ff,'rows':_0xb9cf18}:null;}})['then'](respondWithResult(_0x393abd,null))['catch'](handleError(_0x393abd,null));}; \ No newline at end of file +var _0x4c32=['update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','filter','merge','type','options','findAll','rows','show','VtigerConfiguration','keys','includeAll','include','find','create','body','catch','params','getFields','findOne','sort','pick','nolimit','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save'];(function(_0xf0e7a3,_0xe53247){var _0xdae450=function(_0x41fdef){while(--_0x41fdef){_0xf0e7a3['push'](_0xf0e7a3['shift']());}};_0xdae450(++_0xe53247);}(_0x4c32,0x1d3));var _0x24c3=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x4c32[_0x5c2a2b];return _0x19921f;};'use strict';var emlformat=require(_0x24c3('0x0'));var rimraf=require(_0x24c3('0x1'));var zipdir=require(_0x24c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24c3('0x3'));var moment=require(_0x24c3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x24c3('0x5'));var util=require('util');var path=require('path');var sox=require(_0x24c3('0x6'));var csv=require(_0x24c3('0x7'));var ejs=require(_0x24c3('0x8'));var fs=require('fs');var fs_extra=require(_0x24c3('0x9'));var _=require(_0x24c3('0xa'));var squel=require(_0x24c3('0xb'));var crypto=require(_0x24c3('0xc'));var jsforce=require(_0x24c3('0xd'));var deskjs=require(_0x24c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x24c3('0xf'));var Papa=require(_0x24c3('0x10'));var Redis=require(_0x24c3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x24c3('0x12'));var hardwareService=require(_0x24c3('0x13'));var logger=require(_0x24c3('0x14'))(_0x24c3('0x15'));var utils=require('../../config/utils');var config=require(_0x24c3('0x16'));var licenseUtil=require(_0x24c3('0x17'));var db=require(_0x24c3('0x18'))['db'];function respondWithStatusCode(_0x457ddf,_0x53a4ef){_0x53a4ef=_0x53a4ef||0xcc;return function(_0xc87063){if(_0xc87063){return _0x457ddf[_0x24c3('0x19')](_0x53a4ef);}return _0x457ddf[_0x24c3('0x1a')](_0x53a4ef)['end']();};}function respondWithResult(_0x323009,_0x309eb4){_0x309eb4=_0x309eb4||0xc8;return function(_0x19b727){if(_0x19b727){return _0x323009[_0x24c3('0x1a')](_0x309eb4)['json'](_0x19b727);}};}function respondWithFilteredResult(_0x34e480,_0x15fea9){return function(_0x1b9281){if(_0x1b9281){var _0xd0518=typeof _0x15fea9[_0x24c3('0x1b')]==='undefined'&&typeof _0x15fea9[_0x24c3('0x1c')]===_0x24c3('0x1d');var _0x1bcc49=_0x1b9281[_0x24c3('0x1e')];var _0xefd59a=_0xd0518?0x0:_0x15fea9[_0x24c3('0x1b')];var _0x1a7c79=_0xd0518?_0x1b9281['count']:_0x15fea9[_0x24c3('0x1b')]+_0x15fea9['limit'];var _0x48a4d0;if(_0x1a7c79>=_0x1bcc49){_0x1a7c79=_0x1bcc49;_0x48a4d0=0xc8;}else{_0x48a4d0=0xce;}_0x34e480[_0x24c3('0x1a')](_0x48a4d0);return _0x34e480[_0x24c3('0x1f')](_0x24c3('0x20'),_0xefd59a+'-'+_0x1a7c79+'/'+_0x1bcc49)[_0x24c3('0x21')](_0x1b9281);}return null;};}function patchUpdates(_0x66da3d){return function(_0x39fd4b){try{jsonpatch[_0x24c3('0x22')](_0x39fd4b,_0x66da3d,!![]);}catch(_0x19cd06){return BPromise[_0x24c3('0x23')](_0x19cd06);}return _0x39fd4b[_0x24c3('0x24')]();};}function saveUpdates(_0x3c0abc,_0x10bcca){return function(_0x449ad2){if(_0x449ad2){return _0x449ad2[_0x24c3('0x25')](_0x3c0abc)['then'](function(_0xc59a5a){return _0xc59a5a;});}return null;};}function removeEntity(_0x365c5d,_0x5f43ec){return function(_0xd9a98){if(_0xd9a98){return _0xd9a98[_0x24c3('0x26')]()[_0x24c3('0x27')](function(){_0x365c5d[_0x24c3('0x1a')](0xcc)[_0x24c3('0x28')]();});}};}function handleEntityNotFound(_0x5c9f10,_0x1c7cf1){return function(_0x428a25){if(!_0x428a25){_0x5c9f10['sendStatus'](0x194);}return _0x428a25;};}function handleError(_0x92d619,_0xa7a3c7){_0xa7a3c7=_0xa7a3c7||0x1f4;return function(_0xc6a28c){logger[_0x24c3('0x29')](_0xc6a28c[_0x24c3('0x2a')]);if(_0xc6a28c[_0x24c3('0x2b')]){delete _0xc6a28c[_0x24c3('0x2b')];}_0x92d619['status'](_0xa7a3c7)[_0x24c3('0x2c')](_0xc6a28c);};}exports[_0x24c3('0x2d')]=function(_0x116417,_0x4ff4a9){var _0x2622ea={},_0x41c8e7={},_0x3288b4={'count':0x0,'rows':[]};var _0x1ef83e=_[_0x24c3('0x2e')](db['VtigerConfiguration'][_0x24c3('0x2f')],function(_0x416103){return{'name':_0x416103[_0x24c3('0x30')],'type':_0x416103['type'][_0x24c3('0x31')]};});_0x41c8e7[_0x24c3('0x32')]=_[_0x24c3('0x2e')](_0x1ef83e,_0x24c3('0x2b'));_0x41c8e7[_0x24c3('0x33')]=_['keys'](_0x116417[_0x24c3('0x33')]);_0x41c8e7['filters']=_[_0x24c3('0x34')](_0x41c8e7[_0x24c3('0x32')],_0x41c8e7[_0x24c3('0x33')]);_0x2622ea['attributes']=_[_0x24c3('0x34')](_0x41c8e7[_0x24c3('0x32')],qs[_0x24c3('0x35')](_0x116417[_0x24c3('0x33')][_0x24c3('0x35')]));_0x2622ea[_0x24c3('0x36')]=_0x2622ea[_0x24c3('0x36')][_0x24c3('0x37')]?_0x2622ea[_0x24c3('0x36')]:_0x41c8e7['model'];if(!_0x116417[_0x24c3('0x33')][_0x24c3('0x38')]('nolimit')){_0x2622ea[_0x24c3('0x1c')]=qs[_0x24c3('0x1c')](_0x116417[_0x24c3('0x33')][_0x24c3('0x1c')]);_0x2622ea[_0x24c3('0x1b')]=qs[_0x24c3('0x1b')](_0x116417[_0x24c3('0x33')][_0x24c3('0x1b')]);}_0x2622ea[_0x24c3('0x39')]=qs['sort'](_0x116417[_0x24c3('0x33')]['sort']);_0x2622ea[_0x24c3('0x3a')]=qs[_0x24c3('0x3b')](_['pick'](_0x116417[_0x24c3('0x33')],_0x41c8e7[_0x24c3('0x3b')]),_0x1ef83e);if(_0x116417[_0x24c3('0x33')][_0x24c3('0x3c')]){_0x2622ea[_0x24c3('0x3a')]=_[_0x24c3('0x3d')](_0x2622ea[_0x24c3('0x3a')],{'$or':_['map'](_0x1ef83e,function(_0xa5ced8){if(_0xa5ced8[_0x24c3('0x3e')]!=='VIRTUAL'){var _0x593074={};_0x593074[_0xa5ced8['name']]={'$like':'%'+_0x116417[_0x24c3('0x33')][_0x24c3('0x3c')]+'%'};return _0x593074;}})});}_0x2622ea=_['merge']({},_0x2622ea,_0x116417[_0x24c3('0x3f')]);var _0x372d0e={'where':_0x2622ea[_0x24c3('0x3a')]};return db['VtigerConfiguration'][_0x24c3('0x1e')](_0x372d0e)[_0x24c3('0x27')](function(_0xd136ec){_0x3288b4[_0x24c3('0x1e')]=_0xd136ec;if(_0x116417[_0x24c3('0x33')]['includeAll']){_0x2622ea['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x24c3('0x40')](_0x2622ea);})[_0x24c3('0x27')](function(_0x1f440a){_0x3288b4[_0x24c3('0x41')]=_0x1f440a;return _0x3288b4;})[_0x24c3('0x27')](respondWithFilteredResult(_0x4ff4a9,_0x2622ea))['catch'](handleError(_0x4ff4a9,null));};exports[_0x24c3('0x42')]=function(_0x1ab1d0,_0x4d49cf){var _0x3e6a00={'raw':![],'where':{'id':_0x1ab1d0['params']['id']}},_0x29c6ee={};_0x29c6ee[_0x24c3('0x32')]=_['keys'](db[_0x24c3('0x43')]['rawAttributes']);_0x29c6ee[_0x24c3('0x33')]=_[_0x24c3('0x44')](_0x1ab1d0[_0x24c3('0x33')]);_0x29c6ee[_0x24c3('0x3b')]=_[_0x24c3('0x34')](_0x29c6ee[_0x24c3('0x32')],_0x29c6ee[_0x24c3('0x33')]);_0x3e6a00['attributes']=_[_0x24c3('0x34')](_0x29c6ee[_0x24c3('0x32')],qs['fields'](_0x1ab1d0[_0x24c3('0x33')][_0x24c3('0x35')]));_0x3e6a00[_0x24c3('0x36')]=_0x3e6a00[_0x24c3('0x36')][_0x24c3('0x37')]?_0x3e6a00[_0x24c3('0x36')]:_0x29c6ee['model'];if(_0x1ab1d0[_0x24c3('0x33')][_0x24c3('0x45')]){_0x3e6a00[_0x24c3('0x46')]=[{'all':!![]}];}_0x3e6a00=_[_0x24c3('0x3d')]({},_0x3e6a00,_0x1ab1d0[_0x24c3('0x3f')]);return db[_0x24c3('0x43')][_0x24c3('0x47')](_0x3e6a00)['then'](handleEntityNotFound(_0x4d49cf,null))[_0x24c3('0x27')](respondWithResult(_0x4d49cf,null))['catch'](handleError(_0x4d49cf,null));};exports['create']=function(_0x74306a,_0x258a69){return db[_0x24c3('0x43')][_0x24c3('0x48')](_0x74306a[_0x24c3('0x49')],{})[_0x24c3('0x27')](respondWithResult(_0x258a69,0xc9))[_0x24c3('0x4a')](handleError(_0x258a69,null));};exports[_0x24c3('0x25')]=function(_0x9bdaad,_0x4642ae){if(_0x9bdaad[_0x24c3('0x49')]['id']){delete _0x9bdaad[_0x24c3('0x49')]['id'];}return db[_0x24c3('0x43')][_0x24c3('0x47')]({'where':{'id':_0x9bdaad[_0x24c3('0x4b')]['id']}})[_0x24c3('0x27')](handleEntityNotFound(_0x4642ae,null))['then'](saveUpdates(_0x9bdaad[_0x24c3('0x49')],null))[_0x24c3('0x27')](respondWithResult(_0x4642ae,null))[_0x24c3('0x4a')](handleError(_0x4642ae,null));};exports['destroy']=function(_0xc3029d,_0xad1083){return db[_0x24c3('0x43')]['find']({'where':{'id':_0xc3029d[_0x24c3('0x4b')]['id']}})[_0x24c3('0x27')](handleEntityNotFound(_0xad1083,null))[_0x24c3('0x27')](removeEntity(_0xad1083,null))[_0x24c3('0x4a')](handleError(_0xad1083,null));};exports[_0x24c3('0x4c')]=function(_0x2d159a,_0x14c0e4,_0x33c8e3){var _0x36babc={};var _0xf27915={};var _0x1fd855;var _0x397b08;return db[_0x24c3('0x43')][_0x24c3('0x4d')]({'where':{'id':_0x2d159a[_0x24c3('0x4b')]['id']}})[_0x24c3('0x27')](handleEntityNotFound(_0x14c0e4,null))[_0x24c3('0x27')](function(_0x5eaf4c){if(_0x5eaf4c){_0x1fd855=_0x5eaf4c;_0xf27915[_0x24c3('0x32')]=_['keys'](db['VtigerField']['rawAttributes']);_0xf27915['query']=_[_0x24c3('0x44')](_0x2d159a[_0x24c3('0x33')]);_0xf27915['filters']=_[_0x24c3('0x34')](_0xf27915[_0x24c3('0x32')],_0xf27915[_0x24c3('0x33')]);_0x36babc[_0x24c3('0x36')]=_[_0x24c3('0x34')](_0xf27915['model'],qs['fields'](_0x2d159a[_0x24c3('0x33')][_0x24c3('0x35')]));_0x36babc[_0x24c3('0x36')]=_0x36babc[_0x24c3('0x36')][_0x24c3('0x37')]?_0x36babc[_0x24c3('0x36')]:_0xf27915[_0x24c3('0x32')];_0x36babc[_0x24c3('0x39')]=qs[_0x24c3('0x4e')](_0x2d159a[_0x24c3('0x33')][_0x24c3('0x4e')]);_0x36babc['where']=qs[_0x24c3('0x3b')](_[_0x24c3('0x4f')](_0x2d159a[_0x24c3('0x33')],_0xf27915[_0x24c3('0x3b')]));if(_0x2d159a[_0x24c3('0x33')][_0x24c3('0x3c')]){_0x36babc[_0x24c3('0x3a')]=_[_0x24c3('0x3d')](_0x36babc['where'],{'$or':_[_0x24c3('0x2e')](_0x36babc['attributes'],function(_0x43b511){var _0x10f927={};_0x10f927[_0x43b511]={'$like':'%'+_0x2d159a[_0x24c3('0x33')][_0x24c3('0x3c')]+'%'};return _0x10f927;})});}_0x36babc=_[_0x24c3('0x3d')]({},_0x36babc,_0x2d159a[_0x24c3('0x3f')]);return _0x1fd855[_0x24c3('0x4c')](_0x36babc);}})[_0x24c3('0x27')](function(_0x30edc6){if(_0x30edc6){_0x397b08=_0x30edc6['length'];if(!_0x2d159a[_0x24c3('0x33')][_0x24c3('0x38')](_0x24c3('0x50'))){_0x36babc[_0x24c3('0x1c')]=qs['limit'](_0x2d159a['query'][_0x24c3('0x1c')]);_0x36babc[_0x24c3('0x1b')]=qs[_0x24c3('0x1b')](_0x2d159a[_0x24c3('0x33')][_0x24c3('0x1b')]);}return _0x1fd855[_0x24c3('0x4c')](_0x36babc);}})['then'](function(_0x1bc585){if(_0x1bc585){return _0x1bc585?{'count':_0x397b08,'rows':_0x1bc585}:null;}})[_0x24c3('0x27')](respondWithResult(_0x14c0e4,null))[_0x24c3('0x4a')](handleError(_0x14c0e4,null));};exports['getSubjects']=function(_0x213955,_0x16eb44,_0x53db36){var _0x2c2dce={};var _0xe4dff7={};var _0x2cff09;var _0x3854a6;return db[_0x24c3('0x43')][_0x24c3('0x4d')]({'where':{'id':_0x213955[_0x24c3('0x4b')]['id']}})[_0x24c3('0x27')](handleEntityNotFound(_0x16eb44,null))[_0x24c3('0x27')](function(_0x49a9ac){if(_0x49a9ac){_0x2cff09=_0x49a9ac;_0xe4dff7['model']=_['keys'](db[_0x24c3('0x51')]['rawAttributes']);_0xe4dff7['query']=_[_0x24c3('0x44')](_0x213955[_0x24c3('0x33')]);_0xe4dff7['filters']=_[_0x24c3('0x34')](_0xe4dff7[_0x24c3('0x32')],_0xe4dff7['query']);_0x2c2dce['attributes']=_['intersection'](_0xe4dff7[_0x24c3('0x32')],qs[_0x24c3('0x35')](_0x213955[_0x24c3('0x33')][_0x24c3('0x35')]));_0x2c2dce[_0x24c3('0x36')]=_0x2c2dce[_0x24c3('0x36')][_0x24c3('0x37')]?_0x2c2dce[_0x24c3('0x36')]:_0xe4dff7[_0x24c3('0x32')];_0x2c2dce[_0x24c3('0x39')]=qs[_0x24c3('0x4e')](_0x213955[_0x24c3('0x33')][_0x24c3('0x4e')]);_0x2c2dce[_0x24c3('0x3a')]=qs[_0x24c3('0x3b')](_[_0x24c3('0x4f')](_0x213955[_0x24c3('0x33')],_0xe4dff7[_0x24c3('0x3b')]));if(_0x213955[_0x24c3('0x33')][_0x24c3('0x3c')]){_0x2c2dce['where']=_['merge'](_0x2c2dce[_0x24c3('0x3a')],{'$or':_[_0x24c3('0x2e')](_0x2c2dce[_0x24c3('0x36')],function(_0x16ad49){var _0x4e3576={};_0x4e3576[_0x16ad49]={'$like':'%'+_0x213955[_0x24c3('0x33')]['filter']+'%'};return _0x4e3576;})});}_0x2c2dce=_['merge']({},_0x2c2dce,_0x213955[_0x24c3('0x3f')]);return _0x2cff09['getSubjects'](_0x2c2dce);}})[_0x24c3('0x27')](function(_0x3323d6){if(_0x3323d6){_0x3854a6=_0x3323d6[_0x24c3('0x37')];if(!_0x213955['query'][_0x24c3('0x38')]('nolimit')){_0x2c2dce[_0x24c3('0x1c')]=qs[_0x24c3('0x1c')](_0x213955[_0x24c3('0x33')][_0x24c3('0x1c')]);_0x2c2dce['offset']=qs['offset'](_0x213955['query'][_0x24c3('0x1b')]);}return _0x2cff09[_0x24c3('0x52')](_0x2c2dce);}})[_0x24c3('0x27')](function(_0x5e5c85){if(_0x5e5c85){return _0x5e5c85?{'count':_0x3854a6,'rows':_0x5e5c85}:null;}})[_0x24c3('0x27')](respondWithResult(_0x16eb44,null))[_0x24c3('0x4a')](handleError(_0x16eb44,null));};exports[_0x24c3('0x53')]=function(_0x288dd4,_0x3ac805,_0x1285ff){var _0x54de1c={};var _0x2f12f5={};var _0x1451e2;var _0x2294fe;return db[_0x24c3('0x43')][_0x24c3('0x4d')]({'where':{'id':_0x288dd4[_0x24c3('0x4b')]['id']}})[_0x24c3('0x27')](handleEntityNotFound(_0x3ac805,null))[_0x24c3('0x27')](function(_0x10672d){if(_0x10672d){_0x1451e2=_0x10672d;_0x2f12f5[_0x24c3('0x32')]=_[_0x24c3('0x44')](db['VtigerField'][_0x24c3('0x2f')]);_0x2f12f5['query']=_[_0x24c3('0x44')](_0x288dd4[_0x24c3('0x33')]);_0x2f12f5['filters']=_[_0x24c3('0x34')](_0x2f12f5[_0x24c3('0x32')],_0x2f12f5['query']);_0x54de1c[_0x24c3('0x36')]=_['intersection'](_0x2f12f5[_0x24c3('0x32')],qs['fields'](_0x288dd4[_0x24c3('0x33')][_0x24c3('0x35')]));_0x54de1c['attributes']=_0x54de1c[_0x24c3('0x36')][_0x24c3('0x37')]?_0x54de1c[_0x24c3('0x36')]:_0x2f12f5[_0x24c3('0x32')];_0x54de1c[_0x24c3('0x39')]=qs['sort'](_0x288dd4['query'][_0x24c3('0x4e')]);_0x54de1c[_0x24c3('0x3a')]=qs[_0x24c3('0x3b')](_[_0x24c3('0x4f')](_0x288dd4[_0x24c3('0x33')],_0x2f12f5[_0x24c3('0x3b')]));if(_0x288dd4[_0x24c3('0x33')][_0x24c3('0x3c')]){_0x54de1c[_0x24c3('0x3a')]=_[_0x24c3('0x3d')](_0x54de1c[_0x24c3('0x3a')],{'$or':_[_0x24c3('0x2e')](_0x54de1c[_0x24c3('0x36')],function(_0xfb2037){var _0x12b79d={};_0x12b79d[_0xfb2037]={'$like':'%'+_0x288dd4['query'][_0x24c3('0x3c')]+'%'};return _0x12b79d;})});}_0x54de1c=_[_0x24c3('0x3d')]({},_0x54de1c,_0x288dd4[_0x24c3('0x3f')]);return _0x1451e2['getDescriptions'](_0x54de1c);}})[_0x24c3('0x27')](function(_0x4dd678){if(_0x4dd678){_0x2294fe=_0x4dd678[_0x24c3('0x37')];if(!_0x288dd4[_0x24c3('0x33')][_0x24c3('0x38')](_0x24c3('0x50'))){_0x54de1c[_0x24c3('0x1c')]=qs[_0x24c3('0x1c')](_0x288dd4[_0x24c3('0x33')]['limit']);_0x54de1c['offset']=qs[_0x24c3('0x1b')](_0x288dd4[_0x24c3('0x33')][_0x24c3('0x1b')]);}return _0x1451e2[_0x24c3('0x53')](_0x54de1c);}})[_0x24c3('0x27')](function(_0x1ff979){if(_0x1ff979){return _0x1ff979?{'count':_0x2294fe,'rows':_0x1ff979}:null;}})[_0x24c3('0x27')](respondWithResult(_0x3ac805,null))[_0x24c3('0x4a')](handleError(_0x3ac805,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 945cc1c..229e410 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 _0x56b0=['int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','VtigerConfiguration'];(function(_0x5d8c5f,_0x2dafd8){var _0x3dae59=function(_0x3a8947){while(--_0x3a8947){_0x5d8c5f['push'](_0x5d8c5f['shift']());}};_0x3dae59(++_0x2dafd8);}(_0x56b0,0x18d));var _0x056b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x056b('0x0'));var util=require(_0x056b('0x1'));var logger=require('../../config/logger')(_0x056b('0x2'));var moment=require(_0x056b('0x3'));var BPromise=require(_0x056b('0x4'));var rp=require(_0x056b('0x5'));var fs=require('fs');var path=require(_0x056b('0x6'));var rimraf=require(_0x056b('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x056b('0x8')]=function(_0x4d687a,_0x287680){return _0x4d687a[_0x056b('0x9')](_0x056b('0xa'),attributes,{'tableName':_0x056b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4bb=['rimraf','exports','define','VtigerConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x56634c,_0x14beac){var _0x4ed445=function(_0x538dea){while(--_0x538dea){_0x56634c['push'](_0x56634c['shift']());}};_0x4ed445(++_0x14beac);}(_0xe4bb,0x101));var _0xbe4b=function(_0x1e3e50,_0xdae1ef){_0x1e3e50=_0x1e3e50-0x0;var _0x3fe921=_0xe4bb[_0x1e3e50];return _0x3fe921;};'use strict';var _=require(_0xbe4b('0x0'));var util=require(_0xbe4b('0x1'));var logger=require(_0xbe4b('0x2'))(_0xbe4b('0x3'));var moment=require('moment');var BPromise=require(_0xbe4b('0x4'));var rp=require(_0xbe4b('0x5'));var fs=require('fs');var path=require(_0xbe4b('0x6'));var rimraf=require(_0xbe4b('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0xbe4b('0x8')]=function(_0xf14fa9,_0x1d9fa9){return _0xf14fa9[_0xbe4b('0x9')](_0xbe4b('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 05dd9f7..8428b48 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 _0x74c0=['VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x74c0,0x12b));var _0x074c=function(_0x232583,_0x44bdb5){_0x232583=_0x232583-0x0;var _0x49ddc1=_0x74c0[_0x232583];return _0x49ddc1;};'use strict';var _=require('lodash');var util=require(_0x074c('0x0'));var moment=require(_0x074c('0x1'));var BPromise=require('bluebird');var rs=require(_0x074c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x074c('0x3'));var logger=require(_0x074c('0x4'))(_0x074c('0x5'));var config=require('../../config/environment');var jayson=require(_0x074c('0x6'));var client=jayson[_0x074c('0x7')][_0x074c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfb29d7,_0x3607b8,_0x2a67d7){return new BPromise(function(_0x3fca90,_0x6cf478){return client[_0x074c('0x9')](_0xfb29d7,_0x2a67d7)[_0x074c('0xa')](function(_0x3e30cf){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x3607b8,_0x074c('0xb'));logger[_0x074c('0xc')](_0x074c('0xd'),_0x3607b8,_0x074c('0xb'),JSON['stringify'](_0x3e30cf));if(_0x3e30cf[_0x074c('0xe')]){if(_0x3e30cf[_0x074c('0xe')][_0x074c('0xf')]===0x1f4){logger[_0x074c('0xe')](_0x074c('0x10'),_0x3607b8,_0x3e30cf[_0x074c('0xe')][_0x074c('0x11')]);return _0x6cf478(_0x3e30cf['error'][_0x074c('0x11')]);}logger['error'](_0x074c('0x10'),_0x3607b8,_0x3e30cf[_0x074c('0xe')][_0x074c('0x11')]);return _0x3fca90(_0x3e30cf[_0x074c('0xe')][_0x074c('0x11')]);}else{logger[_0x074c('0x12')](_0x074c('0x10'),_0x3607b8,'request\x20sent');_0x3fca90(_0x3e30cf[_0x074c('0x13')][_0x074c('0x11')]);}})[_0x074c('0x14')](function(_0x495bc2){logger['error'](_0x074c('0x10'),_0x3607b8,_0x495bc2);_0x6cf478(_0x495bc2);});});} \ No newline at end of file +var _0x8c97=['request','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0x8c97,0x1af));var _0x78c9=function(_0x290f16,_0x4f6b83){_0x290f16=_0x290f16-0x0;var _0x2e3bf8=_0x8c97[_0x290f16];return _0x2e3bf8;};'use strict';var _=require('lodash');var util=require(_0x78c9('0x0'));var moment=require('moment');var BPromise=require(_0x78c9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78c9('0x2'));var db=require(_0x78c9('0x3'))['db'];var utils=require(_0x78c9('0x4'));var logger=require(_0x78c9('0x5'))('rpc');var config=require(_0x78c9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x78c9('0x7')][_0x78c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3025e1,_0x4f5afe,_0x216ba2){return new BPromise(function(_0x2d8e3d,_0x498c2a){return client[_0x78c9('0x9')](_0x3025e1,_0x216ba2)['then'](function(_0x2c8882){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x4f5afe,'request\x20sent');logger['debug'](_0x78c9('0xa'),_0x4f5afe,_0x78c9('0xb'),JSON[_0x78c9('0xc')](_0x2c8882));if(_0x2c8882[_0x78c9('0xd')]){if(_0x2c8882['error'][_0x78c9('0xe')]===0x1f4){logger[_0x78c9('0xd')](_0x78c9('0xf'),_0x4f5afe,_0x2c8882['error']['message']);return _0x498c2a(_0x2c8882[_0x78c9('0xd')][_0x78c9('0x10')]);}logger['error'](_0x78c9('0xf'),_0x4f5afe,_0x2c8882[_0x78c9('0xd')][_0x78c9('0x10')]);return _0x2d8e3d(_0x2c8882[_0x78c9('0xd')][_0x78c9('0x10')]);}else{logger[_0x78c9('0x11')](_0x78c9('0xf'),_0x4f5afe,_0x78c9('0xb'));_0x2d8e3d(_0x2c8882[_0x78c9('0x12')]['message']);}})[_0x78c9('0x13')](function(_0x216732){logger[_0x78c9('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x4f5afe,_0x216732);_0x498c2a(_0x216732);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 9def6e6..18b91b9 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 _0xbf41=['show','create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id'];(function(_0xbad322,_0x3e6b0b){var _0x2101cb=function(_0x1c3c3b){while(--_0x1c3c3b){_0xbad322['push'](_0xbad322['shift']());}};_0x2101cb(++_0x3e6b0b);}(_0xbf41,0x14a));var _0x1bf4=function(_0x440df5,_0x49237a){_0x440df5=_0x440df5-0x0;var _0x40e0d5=_0xbf41[_0x440df5];return _0x40e0d5;};'use strict';var multer=require(_0x1bf4('0x0'));var util=require(_0x1bf4('0x1'));var path=require(_0x1bf4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1bf4('0x3')]();var fs_extra=require(_0x1bf4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1bf4('0x5'));var config=require(_0x1bf4('0x6'));var controller=require(_0x1bf4('0x7'));router[_0x1bf4('0x8')]('/',auth[_0x1bf4('0x9')](),controller[_0x1bf4('0xa')]);router[_0x1bf4('0x8')](_0x1bf4('0xb'),auth['isAuthenticated'](),controller[_0x1bf4('0xc')]);router['post']('/',auth[_0x1bf4('0x9')](),controller[_0x1bf4('0xd')]);router[_0x1bf4('0xe')](_0x1bf4('0xb'),auth[_0x1bf4('0x9')](),controller[_0x1bf4('0xf')]);router['delete']('/:id',auth[_0x1bf4('0x9')](),controller[_0x1bf4('0x10')]);module[_0x1bf4('0x11')]=router; \ No newline at end of file +var _0x5ebe=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','show','post','isAuthenticated','create','put','/:id','update','delete','destroy'];(function(_0x3d1c97,_0x465198){var _0x50ed8e=function(_0xb3b726){while(--_0xb3b726){_0x3d1c97['push'](_0x3d1c97['shift']());}};_0x50ed8e(++_0x465198);}(_0x5ebe,0x1e4));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xe5eb('0x0'));var util=require(_0xe5eb('0x1'));var path=require(_0xe5eb('0x2'));var timeout=require(_0xe5eb('0x3'));var express=require(_0xe5eb('0x4'));var router=express[_0xe5eb('0x5')]();var fs_extra=require(_0xe5eb('0x6'));var auth=require(_0xe5eb('0x7'));var interaction=require(_0xe5eb('0x8'));var config=require(_0xe5eb('0x9'));var controller=require(_0xe5eb('0xa'));router[_0xe5eb('0xb')]('/',auth['isAuthenticated'](),controller[_0xe5eb('0xc')]);router[_0xe5eb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe5eb('0xd')]);router[_0xe5eb('0xe')]('/',auth[_0xe5eb('0xf')](),controller[_0xe5eb('0x10')]);router[_0xe5eb('0x11')](_0xe5eb('0x12'),auth[_0xe5eb('0xf')](),controller[_0xe5eb('0x13')]);router[_0xe5eb('0x14')](_0xe5eb('0x12'),auth[_0xe5eb('0xf')](),controller[_0xe5eb('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index bb87c02..62e1c58 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 _0x30be=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x370d52,_0x579a37){var _0x158f61=function(_0x238828){while(--_0x238828){_0x370d52['push'](_0x370d52['shift']());}};_0x158f61(++_0x579a37);}(_0x30be,0x114));var _0xe30b=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x30be[_0x2a5b3b];return _0xae665a;};'use strict';var Sequelize=require('sequelize');module[_0xe30b('0x0')]={'type':{'type':Sequelize[_0xe30b('0x1')](_0xe30b('0x2'),_0xe30b('0x3'),_0xe30b('0x4'),_0xe30b('0x5'),_0xe30b('0x6')),'defaultValue':_0xe30b('0x2')},'content':{'type':Sequelize[_0xe30b('0x7')]},'key':{'type':Sequelize[_0xe30b('0x7')]},'keyType':{'type':Sequelize[_0xe30b('0x1')](_0xe30b('0x2'),_0xe30b('0x3'),_0xe30b('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe30b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe30b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe30b('0x7')]}}; \ No newline at end of file +var _0xab33=['string','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','STRING'];(function(_0x315772,_0x559c3a){var _0x2f3e0b=function(_0x33bd60){while(--_0x33bd60){_0x315772['push'](_0x315772['shift']());}};_0x2f3e0b(++_0x559c3a);}(_0xab33,0x162));var _0x3ab3=function(_0xc0614a,_0x1079c4){_0xc0614a=_0xc0614a-0x0;var _0x4a4e65=_0xab33[_0xc0614a];return _0x4a4e65;};'use strict';var Sequelize=require(_0x3ab3('0x0'));module[_0x3ab3('0x1')]={'type':{'type':Sequelize[_0x3ab3('0x2')]('string','variable',_0x3ab3('0x3'),_0x3ab3('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3ab3('0x5')]},'keyType':{'type':Sequelize[_0x3ab3('0x2')](_0x3ab3('0x6'),_0x3ab3('0x7'),_0x3ab3('0x3'))},'keyContent':{'type':Sequelize[_0x3ab3('0x5')]},'idField':{'type':Sequelize[_0x3ab3('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3ab3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3ab3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 610ee6d..f065243 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 _0xe113=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','apply','save','update','then','sendStatus','error','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','include','find'];(function(_0x2a5cd7,_0x3c4fd7){var _0x39ceee=function(_0x4c9350){while(--_0x4c9350){_0x2a5cd7['push'](_0x2a5cd7['shift']());}};_0x39ceee(++_0x3c4fd7);}(_0xe113,0x97));var _0x3e11=function(_0x5b8f46,_0x56cfc2){_0x5b8f46=_0x5b8f46-0x0;var _0x237cc3=_0xe113[_0x5b8f46];return _0x237cc3;};'use strict';var emlformat=require(_0x3e11('0x0'));var rimraf=require(_0x3e11('0x1'));var zipdir=require(_0x3e11('0x2'));var jsonpatch=require(_0x3e11('0x3'));var rp=require(_0x3e11('0x4'));var moment=require(_0x3e11('0x5'));var BPromise=require(_0x3e11('0x6'));var Mustache=require('mustache');var util=require(_0x3e11('0x7'));var path=require(_0x3e11('0x8'));var sox=require(_0x3e11('0x9'));var csv=require(_0x3e11('0xa'));var ejs=require(_0x3e11('0xb'));var fs=require('fs');var fs_extra=require(_0x3e11('0xc'));var _=require(_0x3e11('0xd'));var squel=require(_0x3e11('0xe'));var crypto=require(_0x3e11('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3e11('0xa'));var querystring=require(_0x3e11('0x10'));var Papa=require('papaparse');var Redis=require(_0x3e11('0x11'));var authService=require(_0x3e11('0x12'));var qs=require(_0x3e11('0x13'));var as=require(_0x3e11('0x14'));var hardwareService=require(_0x3e11('0x15'));var logger=require('../../config/logger')(_0x3e11('0x16'));var utils=require(_0x3e11('0x17'));var config=require(_0x3e11('0x18'));var licenseUtil=require(_0x3e11('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x470480,_0x783771){_0x783771=_0x783771||0xcc;return function(_0x42fc3b){if(_0x42fc3b){return _0x470480['sendStatus'](_0x783771);}return _0x470480[_0x3e11('0x1a')](_0x783771)[_0x3e11('0x1b')]();};}function respondWithResult(_0x5b9819,_0x488374){_0x488374=_0x488374||0xc8;return function(_0x337d76){if(_0x337d76){return _0x5b9819[_0x3e11('0x1a')](_0x488374)['json'](_0x337d76);}};}function respondWithFilteredResult(_0x283f13,_0x2b9323){return function(_0x178b81){if(_0x178b81){var _0x3b4c55=typeof _0x2b9323[_0x3e11('0x1c')]===_0x3e11('0x1d')&&typeof _0x2b9323[_0x3e11('0x1e')]===_0x3e11('0x1d');var _0x400b5c=_0x178b81['count'];var _0x59cf97=_0x3b4c55?0x0:_0x2b9323[_0x3e11('0x1c')];var _0x191721=_0x3b4c55?_0x178b81['count']:_0x2b9323[_0x3e11('0x1c')]+_0x2b9323[_0x3e11('0x1e')];var _0x5000d2;if(_0x191721>=_0x400b5c){_0x191721=_0x400b5c;_0x5000d2=0xc8;}else{_0x5000d2=0xce;}_0x283f13[_0x3e11('0x1a')](_0x5000d2);return _0x283f13['set']('Content-Range',_0x59cf97+'-'+_0x191721+'/'+_0x400b5c)['json'](_0x178b81);}return null;};}function patchUpdates(_0x1c7be0){return function(_0x41e201){try{jsonpatch[_0x3e11('0x1f')](_0x41e201,_0x1c7be0,!![]);}catch(_0x2da8f6){return BPromise['reject'](_0x2da8f6);}return _0x41e201[_0x3e11('0x20')]();};}function saveUpdates(_0x5a5ba8,_0xb47239){return function(_0x3df440){if(_0x3df440){return _0x3df440[_0x3e11('0x21')](_0x5a5ba8)['then'](function(_0x5944aa){return _0x5944aa;});}return null;};}function removeEntity(_0x22c6e8,_0x59a76a){return function(_0x2d3342){if(_0x2d3342){return _0x2d3342['destroy']()[_0x3e11('0x22')](function(){_0x22c6e8[_0x3e11('0x1a')](0xcc)[_0x3e11('0x1b')]();});}};}function handleEntityNotFound(_0x59701a,_0x392efa){return function(_0x354660){if(!_0x354660){_0x59701a[_0x3e11('0x23')](0x194);}return _0x354660;};}function handleError(_0x1c2b17,_0x3e0c70){_0x3e0c70=_0x3e0c70||0x1f4;return function(_0x2b0a12){logger[_0x3e11('0x24')](_0x2b0a12['stack']);if(_0x2b0a12[_0x3e11('0x25')]){delete _0x2b0a12[_0x3e11('0x25')];}_0x1c2b17[_0x3e11('0x1a')](_0x3e0c70)[_0x3e11('0x26')](_0x2b0a12);};}exports[_0x3e11('0x27')]=function(_0x268938,_0x12b281){var _0x343265={},_0x145abd={},_0x21fcd8={'count':0x0,'rows':[]};var _0x5dfc3e=_[_0x3e11('0x28')](db[_0x3e11('0x29')][_0x3e11('0x2a')],function(_0x27bd23){return{'name':_0x27bd23[_0x3e11('0x2b')],'type':_0x27bd23[_0x3e11('0x2c')]['key']};});_0x145abd[_0x3e11('0x2d')]=_['map'](_0x5dfc3e,_0x3e11('0x25'));_0x145abd[_0x3e11('0x2e')]=_[_0x3e11('0x2f')](_0x268938[_0x3e11('0x2e')]);_0x145abd[_0x3e11('0x30')]=_[_0x3e11('0x31')](_0x145abd[_0x3e11('0x2d')],_0x145abd[_0x3e11('0x2e')]);_0x343265['attributes']=_['intersection'](_0x145abd['model'],qs[_0x3e11('0x32')](_0x268938[_0x3e11('0x2e')][_0x3e11('0x32')]));_0x343265[_0x3e11('0x33')]=_0x343265[_0x3e11('0x33')][_0x3e11('0x34')]?_0x343265[_0x3e11('0x33')]:_0x145abd['model'];if(!_0x268938[_0x3e11('0x2e')][_0x3e11('0x35')](_0x3e11('0x36'))){_0x343265['limit']=qs[_0x3e11('0x1e')](_0x268938[_0x3e11('0x2e')]['limit']);_0x343265[_0x3e11('0x1c')]=qs[_0x3e11('0x1c')](_0x268938['query'][_0x3e11('0x1c')]);}_0x343265[_0x3e11('0x37')]=qs[_0x3e11('0x38')](_0x268938[_0x3e11('0x2e')][_0x3e11('0x38')]);_0x343265[_0x3e11('0x39')]=qs[_0x3e11('0x30')](_[_0x3e11('0x3a')](_0x268938[_0x3e11('0x2e')],_0x145abd[_0x3e11('0x30')]),_0x5dfc3e);if(_0x268938[_0x3e11('0x2e')][_0x3e11('0x3b')]){_0x343265[_0x3e11('0x39')]=_['merge'](_0x343265[_0x3e11('0x39')],{'$or':_[_0x3e11('0x28')](_0x5dfc3e,function(_0x131389){if(_0x131389[_0x3e11('0x2c')]!==_0x3e11('0x3c')){var _0x4fb149={};_0x4fb149[_0x131389[_0x3e11('0x25')]]={'$like':'%'+_0x268938[_0x3e11('0x2e')][_0x3e11('0x3b')]+'%'};return _0x4fb149;}})});}_0x343265=_['merge']({},_0x343265,_0x268938[_0x3e11('0x3d')]);var _0x2c7d5e={'where':_0x343265['where']};return db[_0x3e11('0x29')][_0x3e11('0x3e')](_0x2c7d5e)[_0x3e11('0x22')](function(_0x2ef009){_0x21fcd8[_0x3e11('0x3e')]=_0x2ef009;if(_0x268938[_0x3e11('0x2e')][_0x3e11('0x3f')]){_0x343265['include']=[{'all':!![]}];}return db[_0x3e11('0x29')][_0x3e11('0x40')](_0x343265);})['then'](function(_0x3ffe7e){_0x21fcd8[_0x3e11('0x41')]=_0x3ffe7e;return _0x21fcd8;})[_0x3e11('0x22')](respondWithFilteredResult(_0x12b281,_0x343265))[_0x3e11('0x42')](handleError(_0x12b281,null));};exports[_0x3e11('0x43')]=function(_0x8b3183,_0x21bf47){var _0x37ed77={'raw':!![],'where':{'id':_0x8b3183[_0x3e11('0x44')]['id']}},_0x3d7f6f={};_0x3d7f6f[_0x3e11('0x2d')]=_['keys'](db[_0x3e11('0x29')]['rawAttributes']);_0x3d7f6f[_0x3e11('0x2e')]=_['keys'](_0x8b3183['query']);_0x3d7f6f['filters']=_[_0x3e11('0x31')](_0x3d7f6f[_0x3e11('0x2d')],_0x3d7f6f[_0x3e11('0x2e')]);_0x37ed77[_0x3e11('0x33')]=_[_0x3e11('0x31')](_0x3d7f6f[_0x3e11('0x2d')],qs['fields'](_0x8b3183[_0x3e11('0x2e')][_0x3e11('0x32')]));_0x37ed77['attributes']=_0x37ed77[_0x3e11('0x33')][_0x3e11('0x34')]?_0x37ed77[_0x3e11('0x33')]:_0x3d7f6f[_0x3e11('0x2d')];if(_0x8b3183[_0x3e11('0x2e')][_0x3e11('0x3f')]){_0x37ed77[_0x3e11('0x45')]=[{'all':!![]}];}_0x37ed77=_['merge']({},_0x37ed77,_0x8b3183['options']);return db[_0x3e11('0x29')][_0x3e11('0x46')](_0x37ed77)[_0x3e11('0x22')](handleEntityNotFound(_0x21bf47,null))[_0x3e11('0x22')](respondWithResult(_0x21bf47,null))[_0x3e11('0x42')](handleError(_0x21bf47,null));};exports[_0x3e11('0x47')]=function(_0xca0f92,_0x2720be){return db['VtigerField'][_0x3e11('0x47')](_0xca0f92[_0x3e11('0x48')],{})[_0x3e11('0x22')](respondWithResult(_0x2720be,0xc9))['catch'](handleError(_0x2720be,null));};exports[_0x3e11('0x21')]=function(_0xbe51cc,_0x395c41){if(_0xbe51cc[_0x3e11('0x48')]['id']){delete _0xbe51cc['body']['id'];}return db[_0x3e11('0x29')][_0x3e11('0x46')]({'where':{'id':_0xbe51cc[_0x3e11('0x44')]['id']}})[_0x3e11('0x22')](handleEntityNotFound(_0x395c41,null))[_0x3e11('0x22')](saveUpdates(_0xbe51cc['body'],null))[_0x3e11('0x22')](respondWithResult(_0x395c41,null))[_0x3e11('0x42')](handleError(_0x395c41,null));};exports[_0x3e11('0x49')]=function(_0x16a487,_0x1afd4e){return db[_0x3e11('0x29')][_0x3e11('0x46')]({'where':{'id':_0x16a487[_0x3e11('0x44')]['id']}})['then'](handleEntityNotFound(_0x1afd4e,null))[_0x3e11('0x22')](removeEntity(_0x1afd4e,null))['catch'](handleError(_0x1afd4e,null));}; \ No newline at end of file +var _0xf9c9=['Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VtigerField','fieldName','query','keys','model','attributes','intersection','fields','length','order','sort','where','merge','filter','options','includeAll','findAll','rows','show','params','rawAttributes','filters','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set'];(function(_0x22e4c6,_0x4c8802){var _0x180239=function(_0x5d5bb6){while(--_0x5d5bb6){_0x22e4c6['push'](_0x22e4c6['shift']());}};_0x180239(++_0x4c8802);}(_0xf9c9,0xb0));var _0x9f9c=function(_0x118733,_0x2bd820){_0x118733=_0x118733-0x0;var _0x4777af=_0xf9c9[_0x118733];return _0x4777af;};'use strict';var emlformat=require(_0x9f9c('0x0'));var rimraf=require(_0x9f9c('0x1'));var zipdir=require(_0x9f9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f9c('0x3'));var moment=require(_0x9f9c('0x4'));var BPromise=require(_0x9f9c('0x5'));var Mustache=require('mustache');var util=require(_0x9f9c('0x6'));var path=require(_0x9f9c('0x7'));var sox=require(_0x9f9c('0x8'));var csv=require(_0x9f9c('0x9'));var ejs=require(_0x9f9c('0xa'));var fs=require('fs');var fs_extra=require(_0x9f9c('0xb'));var _=require(_0x9f9c('0xc'));var squel=require(_0x9f9c('0xd'));var crypto=require(_0x9f9c('0xe'));var jsforce=require(_0x9f9c('0xf'));var deskjs=require(_0x9f9c('0x10'));var toCsv=require(_0x9f9c('0x9'));var querystring=require(_0x9f9c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f9c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f9c('0x13'))(_0x9f9c('0x14'));var utils=require(_0x9f9c('0x15'));var config=require(_0x9f9c('0x16'));var licenseUtil=require(_0x9f9c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x184e9c,_0x283aa2){_0x283aa2=_0x283aa2||0xcc;return function(_0x413113){if(_0x413113){return _0x184e9c[_0x9f9c('0x18')](_0x283aa2);}return _0x184e9c[_0x9f9c('0x19')](_0x283aa2)['end']();};}function respondWithResult(_0x175774,_0x5dea01){_0x5dea01=_0x5dea01||0xc8;return function(_0x3365cb){if(_0x3365cb){return _0x175774[_0x9f9c('0x19')](_0x5dea01)[_0x9f9c('0x1a')](_0x3365cb);}};}function respondWithFilteredResult(_0x356d6f,_0x5a7a39){return function(_0x4e6ce7){if(_0x4e6ce7){var _0x12aa85=typeof _0x5a7a39[_0x9f9c('0x1b')]==='undefined'&&typeof _0x5a7a39[_0x9f9c('0x1c')]==='undefined';var _0x187580=_0x4e6ce7[_0x9f9c('0x1d')];var _0x370fb9=_0x12aa85?0x0:_0x5a7a39[_0x9f9c('0x1b')];var _0x8ee952=_0x12aa85?_0x4e6ce7['count']:_0x5a7a39['offset']+_0x5a7a39[_0x9f9c('0x1c')];var _0x55ef72;if(_0x8ee952>=_0x187580){_0x8ee952=_0x187580;_0x55ef72=0xc8;}else{_0x55ef72=0xce;}_0x356d6f[_0x9f9c('0x19')](_0x55ef72);return _0x356d6f[_0x9f9c('0x1e')](_0x9f9c('0x1f'),_0x370fb9+'-'+_0x8ee952+'/'+_0x187580)[_0x9f9c('0x1a')](_0x4e6ce7);}return null;};}function patchUpdates(_0xc20bbc){return function(_0x4a7ecc){try{jsonpatch[_0x9f9c('0x20')](_0x4a7ecc,_0xc20bbc,!![]);}catch(_0x5aca8b){return BPromise[_0x9f9c('0x21')](_0x5aca8b);}return _0x4a7ecc[_0x9f9c('0x22')]();};}function saveUpdates(_0x253b12,_0x2207b3){return function(_0xe79382){if(_0xe79382){return _0xe79382[_0x9f9c('0x23')](_0x253b12)[_0x9f9c('0x24')](function(_0xdd85d8){return _0xdd85d8;});}return null;};}function removeEntity(_0x534b04,_0x4d87c3){return function(_0x44aa45){if(_0x44aa45){return _0x44aa45[_0x9f9c('0x25')]()[_0x9f9c('0x24')](function(){_0x534b04[_0x9f9c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x325302,_0x4e4e42){return function(_0x1d13dd){if(!_0x1d13dd){_0x325302[_0x9f9c('0x18')](0x194);}return _0x1d13dd;};}function handleError(_0x4c11c5,_0x131d9e){_0x131d9e=_0x131d9e||0x1f4;return function(_0x2b7227){logger['error'](_0x2b7227[_0x9f9c('0x26')]);if(_0x2b7227[_0x9f9c('0x27')]){delete _0x2b7227[_0x9f9c('0x27')];}_0x4c11c5[_0x9f9c('0x19')](_0x131d9e)[_0x9f9c('0x28')](_0x2b7227);};}exports[_0x9f9c('0x29')]=function(_0x354d14,_0xb766bc){var _0x512641={},_0x3f5c2f={},_0x49a6d7={'count':0x0,'rows':[]};var _0x1ec48d=_[_0x9f9c('0x2a')](db[_0x9f9c('0x2b')]['rawAttributes'],function(_0x29ebcd){return{'name':_0x29ebcd[_0x9f9c('0x2c')],'type':_0x29ebcd['type']['key']};});_0x3f5c2f['model']=_[_0x9f9c('0x2a')](_0x1ec48d,_0x9f9c('0x27'));_0x3f5c2f[_0x9f9c('0x2d')]=_[_0x9f9c('0x2e')](_0x354d14[_0x9f9c('0x2d')]);_0x3f5c2f['filters']=_['intersection'](_0x3f5c2f[_0x9f9c('0x2f')],_0x3f5c2f[_0x9f9c('0x2d')]);_0x512641[_0x9f9c('0x30')]=_[_0x9f9c('0x31')](_0x3f5c2f['model'],qs[_0x9f9c('0x32')](_0x354d14[_0x9f9c('0x2d')]['fields']));_0x512641[_0x9f9c('0x30')]=_0x512641[_0x9f9c('0x30')][_0x9f9c('0x33')]?_0x512641[_0x9f9c('0x30')]:_0x3f5c2f[_0x9f9c('0x2f')];if(!_0x354d14[_0x9f9c('0x2d')]['hasOwnProperty']('nolimit')){_0x512641[_0x9f9c('0x1c')]=qs[_0x9f9c('0x1c')](_0x354d14['query'][_0x9f9c('0x1c')]);_0x512641[_0x9f9c('0x1b')]=qs[_0x9f9c('0x1b')](_0x354d14[_0x9f9c('0x2d')][_0x9f9c('0x1b')]);}_0x512641[_0x9f9c('0x34')]=qs['sort'](_0x354d14['query'][_0x9f9c('0x35')]);_0x512641[_0x9f9c('0x36')]=qs['filters'](_['pick'](_0x354d14[_0x9f9c('0x2d')],_0x3f5c2f['filters']),_0x1ec48d);if(_0x354d14['query']['filter']){_0x512641[_0x9f9c('0x36')]=_[_0x9f9c('0x37')](_0x512641[_0x9f9c('0x36')],{'$or':_[_0x9f9c('0x2a')](_0x1ec48d,function(_0x57f320){if(_0x57f320['type']!=='VIRTUAL'){var _0x16e2c0={};_0x16e2c0[_0x57f320[_0x9f9c('0x27')]]={'$like':'%'+_0x354d14['query'][_0x9f9c('0x38')]+'%'};return _0x16e2c0;}})});}_0x512641=_[_0x9f9c('0x37')]({},_0x512641,_0x354d14[_0x9f9c('0x39')]);var _0xd14af0={'where':_0x512641['where']};return db[_0x9f9c('0x2b')][_0x9f9c('0x1d')](_0xd14af0)[_0x9f9c('0x24')](function(_0x4fd6f4){_0x49a6d7[_0x9f9c('0x1d')]=_0x4fd6f4;if(_0x354d14['query'][_0x9f9c('0x3a')]){_0x512641['include']=[{'all':!![]}];}return db[_0x9f9c('0x2b')][_0x9f9c('0x3b')](_0x512641);})[_0x9f9c('0x24')](function(_0x3acc2b){_0x49a6d7[_0x9f9c('0x3c')]=_0x3acc2b;return _0x49a6d7;})[_0x9f9c('0x24')](respondWithFilteredResult(_0xb766bc,_0x512641))['catch'](handleError(_0xb766bc,null));};exports[_0x9f9c('0x3d')]=function(_0x3cff66,_0x1dab00){var _0x39392b={'raw':!![],'where':{'id':_0x3cff66[_0x9f9c('0x3e')]['id']}},_0x39e0ff={};_0x39e0ff[_0x9f9c('0x2f')]=_[_0x9f9c('0x2e')](db[_0x9f9c('0x2b')][_0x9f9c('0x3f')]);_0x39e0ff[_0x9f9c('0x2d')]=_[_0x9f9c('0x2e')](_0x3cff66[_0x9f9c('0x2d')]);_0x39e0ff[_0x9f9c('0x40')]=_['intersection'](_0x39e0ff['model'],_0x39e0ff['query']);_0x39392b[_0x9f9c('0x30')]=_[_0x9f9c('0x31')](_0x39e0ff[_0x9f9c('0x2f')],qs['fields'](_0x3cff66[_0x9f9c('0x2d')][_0x9f9c('0x32')]));_0x39392b['attributes']=_0x39392b['attributes'][_0x9f9c('0x33')]?_0x39392b[_0x9f9c('0x30')]:_0x39e0ff[_0x9f9c('0x2f')];if(_0x3cff66[_0x9f9c('0x2d')][_0x9f9c('0x3a')]){_0x39392b['include']=[{'all':!![]}];}_0x39392b=_[_0x9f9c('0x37')]({},_0x39392b,_0x3cff66[_0x9f9c('0x39')]);return db['VtigerField'][_0x9f9c('0x41')](_0x39392b)['then'](handleEntityNotFound(_0x1dab00,null))[_0x9f9c('0x24')](respondWithResult(_0x1dab00,null))[_0x9f9c('0x42')](handleError(_0x1dab00,null));};exports[_0x9f9c('0x43')]=function(_0x47f7c4,_0xd27a09){return db['VtigerField'][_0x9f9c('0x43')](_0x47f7c4[_0x9f9c('0x44')],{})[_0x9f9c('0x24')](respondWithResult(_0xd27a09,0xc9))[_0x9f9c('0x42')](handleError(_0xd27a09,null));};exports[_0x9f9c('0x23')]=function(_0x2951eb,_0x33800b){if(_0x2951eb[_0x9f9c('0x44')]['id']){delete _0x2951eb['body']['id'];}return db[_0x9f9c('0x2b')][_0x9f9c('0x41')]({'where':{'id':_0x2951eb[_0x9f9c('0x3e')]['id']}})[_0x9f9c('0x24')](handleEntityNotFound(_0x33800b,null))['then'](saveUpdates(_0x2951eb[_0x9f9c('0x44')],null))[_0x9f9c('0x24')](respondWithResult(_0x33800b,null))['catch'](handleError(_0x33800b,null));};exports[_0x9f9c('0x25')]=function(_0x2d5ce9,_0x341f13){return db[_0x9f9c('0x2b')][_0x9f9c('0x41')]({'where':{'id':_0x2d5ce9[_0x9f9c('0x3e')]['id']}})[_0x9f9c('0x24')](handleEntityNotFound(_0x341f13,null))[_0x9f9c('0x24')](removeEntity(_0x341f13,null))[_0x9f9c('0x42')](handleError(_0x341f13,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index f1e96d8..3f00a06 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 _0xba00=['idField','FieldId','request-promise','path','./intVtigerField.attributes','define','int_vtiger_fields'];(function(_0x335503,_0x15a3fc){var _0x1eaa62=function(_0x523d6b){while(--_0x523d6b){_0x335503['push'](_0x335503['shift']());}};_0x1eaa62(++_0x15a3fc);}(_0xba00,0x113));var _0x0ba0=function(_0xea8de6,_0xda5d92){_0xea8de6=_0xea8de6-0x0;var _0x124d78=_0xba00[_0xea8de6];return _0x124d78;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ba0('0x0'));var fs=require('fs');var path=require(_0x0ba0('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0ba0('0x2'));module['exports']=function(_0xc69bf6,_0x1d71b8){return _0xc69bf6[_0x0ba0('0x3')]('VtigerField',attributes,{'tableName':_0x0ba0('0x4'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x0ba0('0x5'),_0x0ba0('0x6')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc75c=['../../config/environment','./intVtigerField.attributes','exports','int_vtiger_fields','FieldId','api','rimraf'];(function(_0x2cf1ab,_0x50e368){var _0x5311fe=function(_0x3e29f0){while(--_0x3e29f0){_0x2cf1ab['push'](_0x2cf1ab['shift']());}};_0x5311fe(++_0x50e368);}(_0xc75c,0x1d3));var _0xcc75=function(_0x5e2b34,_0x58385c){_0x5e2b34=_0x5e2b34-0x0;var _0x4859f9=_0xc75c[_0x5e2b34];return _0x4859f9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xcc75('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcc75('0x1'));var config=require(_0xcc75('0x2'));var attributes=require(_0xcc75('0x3'));module[_0xcc75('0x4')]=function(_0x2e491c,_0x8f7509){return _0x2e491c['define']('VtigerField',attributes,{'tableName':_0xcc75('0x5'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xcc75('0x6')],'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 e9ba788..018beaf 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 _0xb4aa=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0xb9601e,_0x27f342){var _0x5d3373=function(_0x3d27b2){while(--_0x3d27b2){_0xb9601e['push'](_0xb9601e['shift']());}};_0x5d3373(++_0x27f342);}(_0xb4aa,0xdd));var _0xab4a=function(_0x7e47fa,_0x8aa601){_0x7e47fa=_0x7e47fa-0x0;var _0x5780e9=_0xb4aa[_0x7e47fa];return _0x5780e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab4a('0x0'));var BPromise=require(_0xab4a('0x1'));var rs=require(_0xab4a('0x2'));var fs=require('fs');var Redis=require(_0xab4a('0x3'));var db=require(_0xab4a('0x4'))['db'];var utils=require(_0xab4a('0x5'));var logger=require(_0xab4a('0x6'))(_0xab4a('0x7'));var config=require(_0xab4a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12a79d,_0x42af7b,_0x14e836){return new BPromise(function(_0x3b564a,_0x10cd2e){return client[_0xab4a('0xa')](_0x12a79d,_0x14e836)[_0xab4a('0xb')](function(_0x2c005c){logger['info'](_0xab4a('0xc'),_0x42af7b,_0xab4a('0xd'));logger[_0xab4a('0xe')](_0xab4a('0xf'),_0x42af7b,'request\x20sent',JSON['stringify'](_0x2c005c));if(_0x2c005c['error']){if(_0x2c005c[_0xab4a('0x10')][_0xab4a('0x11')]===0x1f4){logger['error'](_0xab4a('0xc'),_0x42af7b,_0x2c005c[_0xab4a('0x10')][_0xab4a('0x12')]);return _0x10cd2e(_0x2c005c['error']['message']);}logger[_0xab4a('0x10')]('VtigerField,\x20%s,\x20%s',_0x42af7b,_0x2c005c[_0xab4a('0x10')][_0xab4a('0x12')]);return _0x3b564a(_0x2c005c[_0xab4a('0x10')]['message']);}else{logger[_0xab4a('0x13')](_0xab4a('0xc'),_0x42af7b,'request\x20sent');_0x3b564a(_0x2c005c[_0xab4a('0x14')][_0xab4a('0x12')]);}})[_0xab4a('0x15')](function(_0x4fea44){logger[_0xab4a('0x10')](_0xab4a('0xc'),_0x42af7b,_0x4fea44);_0x10cd2e(_0x4fea44);});});} \ No newline at end of file +var _0x0a8d=['stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x264858,_0x1e38f8){var _0x11a422=function(_0x12a514){while(--_0x12a514){_0x264858['push'](_0x264858['shift']());}};_0x11a422(++_0x1e38f8);}(_0x0a8d,0x10f));var _0xd0a8=function(_0x46a0af,_0x3ad441){_0x46a0af=_0x46a0af-0x0;var _0x59820a=_0x0a8d[_0x46a0af];return _0x59820a;};'use strict';var _=require(_0xd0a8('0x0'));var util=require(_0xd0a8('0x1'));var moment=require(_0xd0a8('0x2'));var BPromise=require(_0xd0a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd0a8('0x4'));var logger=require(_0xd0a8('0x5'))(_0xd0a8('0x6'));var config=require(_0xd0a8('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a13ca,_0x2e2706,_0x2e36cf){return new BPromise(function(_0x2e2f6d,_0x329c34){return client[_0xd0a8('0x8')](_0x3a13ca,_0x2e36cf)[_0xd0a8('0x9')](function(_0x17c70d){logger[_0xd0a8('0xa')](_0xd0a8('0xb'),_0x2e2706,_0xd0a8('0xc'));logger[_0xd0a8('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x2e2706,_0xd0a8('0xc'),JSON[_0xd0a8('0xe')](_0x17c70d));if(_0x17c70d[_0xd0a8('0xf')]){if(_0x17c70d['error']['code']===0x1f4){logger[_0xd0a8('0xf')](_0xd0a8('0xb'),_0x2e2706,_0x17c70d[_0xd0a8('0xf')]['message']);return _0x329c34(_0x17c70d[_0xd0a8('0xf')][_0xd0a8('0x10')]);}logger['error'](_0xd0a8('0xb'),_0x2e2706,_0x17c70d[_0xd0a8('0xf')][_0xd0a8('0x10')]);return _0x2e2f6d(_0x17c70d[_0xd0a8('0xf')][_0xd0a8('0x10')]);}else{logger[_0xd0a8('0xa')](_0xd0a8('0xb'),_0x2e2706,_0xd0a8('0xc'));_0x2e2f6d(_0x17c70d[_0xd0a8('0x11')][_0xd0a8('0x10')]);}})[_0xd0a8('0x12')](function(_0xeec853){logger[_0xd0a8('0xf')](_0xd0a8('0xb'),_0x2e2706,_0xeec853);_0x329c34(_0xeec853);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 29638d0..75e876f 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 _0x5557=['exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','delete','destroy'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5557,0x1ba));var _0x7555=function(_0x248e36,_0x5e293d){_0x248e36=_0x248e36-0x0;var _0x5616dd=_0x5557[_0x248e36];return _0x5616dd;};'use strict';var multer=require(_0x7555('0x0'));var util=require('util');var path=require(_0x7555('0x1'));var timeout=require('connect-timeout');var express=require(_0x7555('0x2'));var router=express[_0x7555('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7555('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7555('0x5'));var controller=require(_0x7555('0x6'));router[_0x7555('0x7')]('/',auth[_0x7555('0x8')](),controller[_0x7555('0x9')]);router[_0x7555('0x7')](_0x7555('0xa'),auth[_0x7555('0x8')](),controller[_0x7555('0xb')]);router[_0x7555('0x7')](_0x7555('0xc'),auth[_0x7555('0x8')](),controller[_0x7555('0xd')]);router['get'](_0x7555('0xe'),auth[_0x7555('0x8')](),controller[_0x7555('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7555('0x10')]);router['post']('/:id/configurations',auth[_0x7555('0x8')](),controller[_0x7555('0x11')]);router['put'](_0x7555('0xa'),auth[_0x7555('0x8')](),controller['update']);router[_0x7555('0x12')](_0x7555('0xa'),auth[_0x7555('0x8')](),controller[_0x7555('0x13')]);module[_0x7555('0x14')]=router; \ No newline at end of file +var _0xda31=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show'];(function(_0x3b4d24,_0x400b69){var _0x4b0b0d=function(_0x4eeaa5){while(--_0x4eeaa5){_0x3b4d24['push'](_0x3b4d24['shift']());}};_0x4b0b0d(++_0x400b69);}(_0xda31,0xfb));var _0x1da3=function(_0x46d5ac,_0x4cc7df){_0x46d5ac=_0x46d5ac-0x0;var _0xb6f383=_0xda31[_0x46d5ac];return _0xb6f383;};'use strict';var multer=require(_0x1da3('0x0'));var util=require('util');var path=require(_0x1da3('0x1'));var timeout=require(_0x1da3('0x2'));var express=require(_0x1da3('0x3'));var router=express[_0x1da3('0x4')]();var fs_extra=require(_0x1da3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1da3('0x6'));var config=require(_0x1da3('0x7'));var controller=require(_0x1da3('0x8'));router[_0x1da3('0x9')]('/',auth[_0x1da3('0xa')](),controller[_0x1da3('0xb')]);router['get']('/:id',auth[_0x1da3('0xa')](),controller[_0x1da3('0xc')]);router[_0x1da3('0x9')](_0x1da3('0xd'),auth['isAuthenticated'](),controller[_0x1da3('0xe')]);router[_0x1da3('0x9')](_0x1da3('0xf'),auth['isAuthenticated'](),controller[_0x1da3('0x10')]);router[_0x1da3('0x11')]('/',auth[_0x1da3('0xa')](),controller[_0x1da3('0x12')]);router['post']('/:id/configurations',auth[_0x1da3('0xa')](),controller[_0x1da3('0x13')]);router['put'](_0x1da3('0x14'),auth[_0x1da3('0xa')](),controller[_0x1da3('0x15')]);router['delete'](_0x1da3('0x14'),auth[_0x1da3('0xa')](),controller[_0x1da3('0x16')]);module[_0x1da3('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 c74ed80..7bd8a03 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 _0x27fb=['password','integrationTab','sequelize','exports','STRING','ENUM','token'];(function(_0xde1755,_0x52c92d){var _0x4ca541=function(_0x476e26){while(--_0x476e26){_0xde1755['push'](_0xde1755['shift']());}};_0x4ca541(++_0x52c92d);}(_0x27fb,0x1de));var _0xb27f=function(_0x15e0aa,_0x371fbb){_0x15e0aa=_0x15e0aa-0x0;var _0x32a41f=_0x27fb[_0x15e0aa];return _0x32a41f;};'use strict';var Sequelize=require(_0xb27f('0x0'));module[_0xb27f('0x1')]={'name':{'type':Sequelize[_0xb27f('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb27f('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xb27f('0x2')]},'token':{'type':Sequelize[_0xb27f('0x2')]},'remoteUri':{'type':Sequelize[_0xb27f('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xb27f('0x3')]('password',_0xb27f('0x4')),'defaultValue':_0xb27f('0x5')},'serverUrl':{'type':Sequelize[_0xb27f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb27f('0x3')](_0xb27f('0x6'),'newTab'),'defaultValue':_0xb27f('0x6')}}; \ No newline at end of file +var _0xcefd=['token','password','newTab','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x3e6129,_0x43a8ba){var _0x4164e7=function(_0x5f32af){while(--_0x5f32af){_0x3e6129['push'](_0x3e6129['shift']());}};_0x4164e7(++_0x43a8ba);}(_0xcefd,0x126));var _0xdcef=function(_0xb17208,_0x16f568){_0xb17208=_0xb17208-0x0;var _0x160444=_0xcefd[_0xb17208];return _0x160444;};'use strict';var Sequelize=require(_0xdcef('0x0'));module[_0xdcef('0x1')]={'name':{'type':Sequelize[_0xdcef('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xdcef('0x2')],'unique':_0xdcef('0x3')},'password':{'type':Sequelize[_0xdcef('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xdcef('0x2')],'unique':_0xdcef('0x4')},'authType':{'type':Sequelize[_0xdcef('0x5')]('password',_0xdcef('0x6')),'defaultValue':_0xdcef('0x7')},'serverUrl':{'type':Sequelize[_0xdcef('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdcef('0x5')]('integrationTab',_0xdcef('0x8')),'defaultValue':_0xdcef('0x9')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 5a14df5..d2ee3a9 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 _0xac4a=['count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','ZendeskAccount','includeAll','include','findAll','catch','show','params','options','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','order','pick','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField','getFields','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','ticket_fields','Basic\x20%s','base64','headers','%s/token:%s','username','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xac4a,0x13f));var _0xaac4=function(_0x5dbe9c,_0x14050b){_0x5dbe9c=_0x5dbe9c-0x0;var _0x4fd9a7=_0xac4a[_0x5dbe9c];return _0x4fd9a7;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];var integrations=require(_0xaac4('0x15'));function respondWithStatusCode(_0x45e512,_0x5a4801){_0x5a4801=_0x5a4801||0xcc;return function(_0x6a808d){if(_0x6a808d){return _0x45e512[_0xaac4('0x16')](_0x5a4801);}return _0x45e512['status'](_0x5a4801)[_0xaac4('0x17')]();};}function respondWithResult(_0x2b20d0,_0x46698d){_0x46698d=_0x46698d||0xc8;return function(_0x150fdd){if(_0x150fdd){return _0x2b20d0[_0xaac4('0x18')](_0x46698d)[_0xaac4('0x19')](_0x150fdd);}};}function respondWithFilteredResult(_0x31b7e5,_0x1df9ae){return function(_0x233278){if(_0x233278){var _0xb8466e=typeof _0x1df9ae[_0xaac4('0x1a')]===_0xaac4('0x1b')&&typeof _0x1df9ae[_0xaac4('0x1c')]==='undefined';var _0x33bc73=_0x233278['count'];var _0x220630=_0xb8466e?0x0:_0x1df9ae['offset'];var _0x3ce35a=_0xb8466e?_0x233278[_0xaac4('0x1d')]:_0x1df9ae[_0xaac4('0x1a')]+_0x1df9ae[_0xaac4('0x1c')];var _0x3cbcb1;if(_0x3ce35a>=_0x33bc73){_0x3ce35a=_0x33bc73;_0x3cbcb1=0xc8;}else{_0x3cbcb1=0xce;}_0x31b7e5[_0xaac4('0x18')](_0x3cbcb1);return _0x31b7e5[_0xaac4('0x1e')](_0xaac4('0x1f'),_0x220630+'-'+_0x3ce35a+'/'+_0x33bc73)[_0xaac4('0x19')](_0x233278);}return null;};}function patchUpdates(_0x480fb0){return function(_0x1d9c42){try{jsonpatch['apply'](_0x1d9c42,_0x480fb0,!![]);}catch(_0x3303f1){return BPromise[_0xaac4('0x20')](_0x3303f1);}return _0x1d9c42[_0xaac4('0x21')]();};}function saveUpdates(_0x477b77,_0x17140f){return function(_0x383a8c){if(_0x383a8c){return _0x383a8c['update'](_0x477b77)[_0xaac4('0x22')](function(_0x27a84d){return _0x27a84d;});}return null;};}function removeEntity(_0x174860,_0x4f10ec){return function(_0x3dd059){if(_0x3dd059){return _0x3dd059[_0xaac4('0x23')]()[_0xaac4('0x22')](function(){_0x174860['status'](0xcc)[_0xaac4('0x17')]();});}};}function handleEntityNotFound(_0x4f1b65,_0x54203b){return function(_0x4fac85){if(!_0x4fac85){_0x4f1b65['sendStatus'](0x194);}return _0x4fac85;};}function handleError(_0x22d5a6,_0x17d25f){_0x17d25f=_0x17d25f||0x1f4;return function(_0x22cda2){logger[_0xaac4('0x24')](_0x22cda2[_0xaac4('0x25')]);if(_0x22cda2[_0xaac4('0x26')]){delete _0x22cda2[_0xaac4('0x26')];}_0x22d5a6[_0xaac4('0x18')](_0x17d25f)[_0xaac4('0x27')](_0x22cda2);};}exports[_0xaac4('0x28')]=function(_0x4d0f5f,_0x316445){var _0x16b33c={},_0xda10b6={},_0xb76ccc={'count':0x0,'rows':[]};var _0x669b34=_[_0xaac4('0x29')](db['ZendeskAccount'][_0xaac4('0x2a')],function(_0x5d2c9a){return{'name':_0x5d2c9a[_0xaac4('0x2b')],'type':_0x5d2c9a[_0xaac4('0x2c')][_0xaac4('0x2d')]};});_0xda10b6[_0xaac4('0x2e')]=_['map'](_0x669b34,'name');_0xda10b6['query']=_[_0xaac4('0x2f')](_0x4d0f5f[_0xaac4('0x30')]);_0xda10b6[_0xaac4('0x31')]=_[_0xaac4('0x32')](_0xda10b6[_0xaac4('0x2e')],_0xda10b6[_0xaac4('0x30')]);_0x16b33c[_0xaac4('0x33')]=_[_0xaac4('0x32')](_0xda10b6[_0xaac4('0x2e')],qs[_0xaac4('0x34')](_0x4d0f5f[_0xaac4('0x30')][_0xaac4('0x34')]));_0x16b33c[_0xaac4('0x33')]=_0x16b33c[_0xaac4('0x33')][_0xaac4('0x35')]?_0x16b33c['attributes']:_0xda10b6['model'];if(!_0x4d0f5f[_0xaac4('0x30')][_0xaac4('0x36')](_0xaac4('0x37'))){_0x16b33c['limit']=qs[_0xaac4('0x1c')](_0x4d0f5f[_0xaac4('0x30')][_0xaac4('0x1c')]);_0x16b33c[_0xaac4('0x1a')]=qs[_0xaac4('0x1a')](_0x4d0f5f[_0xaac4('0x30')][_0xaac4('0x1a')]);}_0x16b33c['order']=qs[_0xaac4('0x38')](_0x4d0f5f[_0xaac4('0x30')][_0xaac4('0x38')]);_0x16b33c['where']=qs[_0xaac4('0x31')](_['pick'](_0x4d0f5f['query'],_0xda10b6[_0xaac4('0x31')]),_0x669b34);if(_0x4d0f5f[_0xaac4('0x30')][_0xaac4('0x39')]){_0x16b33c['where']=_['merge'](_0x16b33c[_0xaac4('0x3a')],{'$or':_[_0xaac4('0x29')](_0x669b34,function(_0x2f7300){if(_0x2f7300[_0xaac4('0x2c')]!==_0xaac4('0x3b')){var _0x36f4d4={};_0x36f4d4[_0x2f7300['name']]={'$like':'%'+_0x4d0f5f['query'][_0xaac4('0x39')]+'%'};return _0x36f4d4;}})});}_0x16b33c=_[_0xaac4('0x3c')]({},_0x16b33c,_0x4d0f5f['options']);var _0x416a5b={'where':_0x16b33c[_0xaac4('0x3a')]};return db[_0xaac4('0x3d')]['count'](_0x416a5b)[_0xaac4('0x22')](function(_0x4a4773){_0xb76ccc[_0xaac4('0x1d')]=_0x4a4773;if(_0x4d0f5f['query'][_0xaac4('0x3e')]){_0x16b33c[_0xaac4('0x3f')]=[{'all':!![]}];}return db[_0xaac4('0x3d')][_0xaac4('0x40')](_0x16b33c);})['then'](function(_0x247fea){_0xb76ccc['rows']=_0x247fea;return _0xb76ccc;})['then'](respondWithFilteredResult(_0x316445,_0x16b33c))[_0xaac4('0x41')](handleError(_0x316445,null));};exports[_0xaac4('0x42')]=function(_0x27df36,_0x40c007){var _0x43bc12={'raw':![],'where':{'id':_0x27df36[_0xaac4('0x43')]['id']}},_0xb78221={};_0xb78221[_0xaac4('0x2e')]=_['keys'](db[_0xaac4('0x3d')][_0xaac4('0x2a')]);_0xb78221[_0xaac4('0x30')]=_[_0xaac4('0x2f')](_0x27df36['query']);_0xb78221[_0xaac4('0x31')]=_[_0xaac4('0x32')](_0xb78221[_0xaac4('0x2e')],_0xb78221['query']);_0x43bc12[_0xaac4('0x33')]=_[_0xaac4('0x32')](_0xb78221[_0xaac4('0x2e')],qs[_0xaac4('0x34')](_0x27df36['query'][_0xaac4('0x34')]));_0x43bc12[_0xaac4('0x33')]=_0x43bc12[_0xaac4('0x33')]['length']?_0x43bc12[_0xaac4('0x33')]:_0xb78221[_0xaac4('0x2e')];if(_0x27df36[_0xaac4('0x30')][_0xaac4('0x3e')]){_0x43bc12[_0xaac4('0x3f')]=[{'all':!![]}];}_0x43bc12=_[_0xaac4('0x3c')]({},_0x43bc12,_0x27df36[_0xaac4('0x44')]);return db[_0xaac4('0x3d')][_0xaac4('0x45')](_0x43bc12)['then'](handleEntityNotFound(_0x40c007,null))[_0xaac4('0x22')](respondWithResult(_0x40c007,null))[_0xaac4('0x41')](handleError(_0x40c007,null));};exports[_0xaac4('0x46')]=function(_0x360420,_0x130bb5){return db['ZendeskAccount']['create'](_0x360420[_0xaac4('0x47')],{})[_0xaac4('0x22')](respondWithResult(_0x130bb5,0xc9))[_0xaac4('0x41')](handleError(_0x130bb5,null));};exports[_0xaac4('0x48')]=function(_0x5f33ea,_0x283d51){if(_0x5f33ea['body']['id']){delete _0x5f33ea[_0xaac4('0x47')]['id'];}return db[_0xaac4('0x3d')]['find']({'where':{'id':_0x5f33ea[_0xaac4('0x43')]['id']}})[_0xaac4('0x22')](handleEntityNotFound(_0x283d51,null))[_0xaac4('0x22')](saveUpdates(_0x5f33ea['body'],null))['then'](respondWithResult(_0x283d51,null))[_0xaac4('0x41')](handleError(_0x283d51,null));};exports[_0xaac4('0x23')]=function(_0x22dda7,_0xb32d1d){return db[_0xaac4('0x3d')][_0xaac4('0x45')]({'where':{'id':_0x22dda7['params']['id']}})[_0xaac4('0x22')](handleEntityNotFound(_0xb32d1d,null))[_0xaac4('0x22')](removeEntity(_0xb32d1d,null))[_0xaac4('0x41')](handleError(_0xb32d1d,null));};exports[_0xaac4('0x49')]=function(_0x56201b,_0x3ca377,_0x571418){var _0x33e32f={};var _0x3a703c={};var _0x460252;var _0x3922a0;return db[_0xaac4('0x3d')][_0xaac4('0x4a')]({'where':{'id':_0x56201b[_0xaac4('0x43')]['id']}})[_0xaac4('0x22')](handleEntityNotFound(_0x3ca377,null))[_0xaac4('0x22')](function(_0x1b9219){if(_0x1b9219){_0x460252=_0x1b9219;_0x3a703c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](db[_0xaac4('0x4b')][_0xaac4('0x2a')]);_0x3a703c['query']=_[_0xaac4('0x2f')](_0x56201b[_0xaac4('0x30')]);_0x3a703c[_0xaac4('0x31')]=_[_0xaac4('0x32')](_0x3a703c[_0xaac4('0x2e')],_0x3a703c[_0xaac4('0x30')]);_0x33e32f[_0xaac4('0x33')]=_[_0xaac4('0x32')](_0x3a703c['model'],qs[_0xaac4('0x34')](_0x56201b['query'][_0xaac4('0x34')]));_0x33e32f['attributes']=_0x33e32f[_0xaac4('0x33')]['length']?_0x33e32f['attributes']:_0x3a703c[_0xaac4('0x2e')];_0x33e32f[_0xaac4('0x4c')]=qs['sort'](_0x56201b[_0xaac4('0x30')][_0xaac4('0x38')]);_0x33e32f[_0xaac4('0x3a')]=qs[_0xaac4('0x31')](_[_0xaac4('0x4d')](_0x56201b[_0xaac4('0x30')],_0x3a703c['filters']));if(_0x56201b[_0xaac4('0x30')]['filter']){_0x33e32f[_0xaac4('0x3a')]=_['merge'](_0x33e32f['where'],{'$or':_['map'](_0x33e32f[_0xaac4('0x33')],function(_0x380e9d){var _0x467a61={};_0x467a61[_0x380e9d]={'$like':'%'+_0x56201b[_0xaac4('0x30')]['filter']+'%'};return _0x467a61;})});}_0x33e32f=_[_0xaac4('0x3c')]({},_0x33e32f,_0x56201b[_0xaac4('0x44')]);return _0x460252[_0xaac4('0x49')](_0x33e32f);}})['then'](function(_0x8891d){if(_0x8891d){_0x3922a0=_0x8891d[_0xaac4('0x35')];if(!_0x56201b[_0xaac4('0x30')][_0xaac4('0x36')](_0xaac4('0x37'))){_0x33e32f[_0xaac4('0x1c')]=qs[_0xaac4('0x1c')](_0x56201b['query']['limit']);_0x33e32f[_0xaac4('0x1a')]=qs['offset'](_0x56201b['query'][_0xaac4('0x1a')]);}return _0x460252['getConfigurations'](_0x33e32f);}})[_0xaac4('0x22')](function(_0x4b6881){if(_0x4b6881){return _0x4b6881?{'count':_0x3922a0,'rows':_0x4b6881}:null;}})[_0xaac4('0x22')](respondWithResult(_0x3ca377,null))[_0xaac4('0x41')](handleError(_0x3ca377,null));};exports['addConfiguration']=function(_0x5112d3,_0x4e6de9,_0x4d0ee7){if(_0x5112d3[_0xaac4('0x47')]['id']){delete _0x5112d3[_0xaac4('0x47')]['id'];}return db[_0xaac4('0x3d')][_0xaac4('0x4a')]({'where':{'id':_0x5112d3['params']['id']}})[_0xaac4('0x22')](handleEntityNotFound(_0x4e6de9,null))[_0xaac4('0x22')](function(_0x3b0470){if(_0x3b0470){_0x5112d3[_0xaac4('0x47')][_0xaac4('0x4e')]=_0x3b0470['id'];_0x5112d3[_0xaac4('0x47')][_0xaac4('0x4f')]=integrations[_0xaac4('0x50')](_0x5112d3[_0xaac4('0x47')][_0xaac4('0x51')],_0x5112d3[_0xaac4('0x47')]['type']);_0x5112d3['body'][_0xaac4('0x52')]=integrations['getDescriptions'](_0x5112d3['body'][_0xaac4('0x51')],_0x5112d3['body'][_0xaac4('0x2c')]);return db[_0xaac4('0x4b')][_0xaac4('0x46')](_0x5112d3[_0xaac4('0x47')],{'include':[{'model':db['ZendeskField'],'as':_0xaac4('0x4f')},{'model':db[_0xaac4('0x53')],'as':_0xaac4('0x52')}]});}return null;})[_0xaac4('0x22')](respondWithResult(_0x4e6de9,null))[_0xaac4('0x41')](handleError(_0x4e6de9,null));};exports[_0xaac4('0x54')]=function(_0x5b20c6,_0x1db7c7,_0x429661){var _0x5b5e57='';return db[_0xaac4('0x3d')][_0xaac4('0x4a')]({'where':{'id':_0x5b20c6['params']['id']},'attributes':['id','username',_0xaac4('0x55'),_0xaac4('0x56'),_0xaac4('0x57'),_0xaac4('0x58')]})[_0xaac4('0x22')](handleEntityNotFound(_0x1db7c7,null))[_0xaac4('0x22')](function(_0x13d691){if(_0x13d691){_0x5b5e57=_0x13d691[_0xaac4('0x58')];var _0x59085e=_0x5b5e57[_0xaac4('0x59')](-0x1);if(_0x59085e==='/'){_0x5b5e57=_0x5b5e57[_0xaac4('0x5a')](0x0,_0x5b5e57[_0xaac4('0x5b')](_0x59085e));}var _0x254fb3={'method':_0xaac4('0x5c'),'uri':util[_0xaac4('0x5d')]('%s/%s',_0x5b5e57,_0xaac4('0x5e')),'json':!![]};switch(_0x13d691[_0xaac4('0x57')]){case'password':_0x254fb3['headers']={'Authorization':util['format'](_0xaac4('0x5f'),new Buffer(util['format']('%s:%s',_0x13d691['username'],_0x13d691['password']))['toString'](_0xaac4('0x60')))};break;case _0xaac4('0x56'):_0x254fb3[_0xaac4('0x61')]={'Authorization':util[_0xaac4('0x5d')]('Basic\x20%s',new Buffer(util[_0xaac4('0x5d')](_0xaac4('0x62'),_0x13d691[_0xaac4('0x63')],_0x13d691[_0xaac4('0x56')]))[_0xaac4('0x64')](_0xaac4('0x60')))};break;default:throw new db[(_0xaac4('0x65'))]['ValidationError'](_0xaac4('0x66'));}return rp(_0x254fb3);}})['then'](function(_0x551e53){if(_0x551e53){var _0x20dff9=[_0xaac4('0x67'),_0xaac4('0x68'),_0xaac4('0x69'),_0xaac4('0x6a')];_[_0xaac4('0x6b')](_0x551e53[_0xaac4('0x5e')],function(_0x18d567){return _0x20dff9[_0xaac4('0x6c')](_0x18d567[_0xaac4('0x2c')]);});return{'count':_0x551e53[_0xaac4('0x5e')][_0xaac4('0x35')],'rows':_[_0xaac4('0x29')](_0x551e53[_0xaac4('0x5e')],function(_0xdf6b04){return{'id':_0xdf6b04['id'],'name':_0xdf6b04[_0xaac4('0x6d')]>0x7?_0xdf6b04[_0xaac4('0x6e')]:_0xdf6b04[_0xaac4('0x2c')],'custom':_0xdf6b04[_0xaac4('0x6d')]>0x7?!![]:![],'options':_0xdf6b04[_0xaac4('0x6f')]?_0xdf6b04[_0xaac4('0x6f')]:_0xdf6b04[_0xaac4('0x70')]?_0xdf6b04[_0xaac4('0x70')]:[]};})};}})[_0xaac4('0x22')](respondWithResult(_0x1db7c7,null))[_0xaac4('0x41')](function(_0x59f6dc){var _0xb12069=_0x5b20c6[_0xaac4('0x30')][_0xaac4('0x71')]?0x1f4:_0x59f6dc[_0xaac4('0x72')]||0x1f4;logger[_0xaac4('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xaac4('0x54'),_0xb12069,JSON[_0xaac4('0x73')](_0x59f6dc));delete _0x59f6dc[_0xaac4('0x26')];if(_0xb12069===0x191){_0xb12069=0x190;}_0x1db7c7[_0xaac4('0x18')](_0xb12069)[_0xaac4('0x27')](_0x5b20c6['query'][_0xaac4('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x59f6dc[_0xaac4('0x72')]}:_0x59f6dc);});}; \ No newline at end of file +var _0xb58b=['headers','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','findOne','token','authType','remoteUri','substring','GET','format','%s/%s','password'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3c8b45,_0xb96603){_0x3c8b45=_0x3c8b45-0x0;var _0x2d9dab=_0xb58b[_0x3c8b45];return _0x2d9dab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbb58('0x18'));function respondWithStatusCode(_0x18810f,_0x4cda21){_0x4cda21=_0x4cda21||0xcc;return function(_0x132511){if(_0x132511){return _0x18810f[_0xbb58('0x19')](_0x4cda21);}return _0x18810f[_0xbb58('0x1a')](_0x4cda21)[_0xbb58('0x1b')]();};}function respondWithResult(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xc8;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1a')](_0x58245f)['json'](_0x110944);}};}function respondWithFilteredResult(_0x4ba30e,_0x33c20f){return function(_0x445b1f){if(_0x445b1f){var _0x38d69a=typeof _0x33c20f['offset']==='undefined'&&typeof _0x33c20f['limit']==='undefined';var _0x28637b=_0x445b1f[_0xbb58('0x1c')];var _0x48f3e0=_0x38d69a?0x0:_0x33c20f[_0xbb58('0x1d')];var _0x497653=_0x38d69a?_0x445b1f[_0xbb58('0x1c')]:_0x33c20f[_0xbb58('0x1d')]+_0x33c20f[_0xbb58('0x1e')];var _0xb8f982;if(_0x497653>=_0x28637b){_0x497653=_0x28637b;_0xb8f982=0xc8;}else{_0xb8f982=0xce;}_0x4ba30e[_0xbb58('0x1a')](_0xb8f982);return _0x4ba30e[_0xbb58('0x1f')](_0xbb58('0x20'),_0x48f3e0+'-'+_0x497653+'/'+_0x28637b)['json'](_0x445b1f);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x21')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x22')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x23')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x24')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x25')]()[_0xbb58('0x24')](function(){_0x21964d[_0xbb58('0x1a')](0xcc)[_0xbb58('0x1b')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x19')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x26')](_0x8e9ed9[_0xbb58('0x27')]);if(_0x8e9ed9[_0xbb58('0x28')]){delete _0x8e9ed9[_0xbb58('0x28')];}_0x1be0ae[_0xbb58('0x1a')](_0x129094)[_0xbb58('0x29')](_0x8e9ed9);};}exports[_0xbb58('0x2a')]=function(_0x2a0481,_0x4157c4){var _0x3559b6={},_0x573cca={},_0x2b0f73={'count':0x0,'rows':[]};var _0xe46bc1=_[_0xbb58('0x2b')](db[_0xbb58('0x2c')][_0xbb58('0x2d')],function(_0x9d379f){return{'name':_0x9d379f[_0xbb58('0x2e')],'type':_0x9d379f[_0xbb58('0x2f')][_0xbb58('0x30')]};});_0x573cca['model']=_[_0xbb58('0x2b')](_0xe46bc1,_0xbb58('0x28'));_0x573cca[_0xbb58('0x31')]=_[_0xbb58('0x32')](_0x2a0481[_0xbb58('0x31')]);_0x573cca[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],_0x573cca[_0xbb58('0x31')]);_0x3559b6[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x2a0481['query']['fields']));_0x3559b6['attributes']=_0x3559b6[_0xbb58('0x36')][_0xbb58('0x38')]?_0x3559b6[_0xbb58('0x36')]:_0x573cca[_0xbb58('0x35')];if(!_0x2a0481[_0xbb58('0x31')][_0xbb58('0x39')](_0xbb58('0x3a'))){_0x3559b6[_0xbb58('0x1e')]=qs['limit'](_0x2a0481[_0xbb58('0x31')][_0xbb58('0x1e')]);_0x3559b6['offset']=qs[_0xbb58('0x1d')](_0x2a0481['query'][_0xbb58('0x1d')]);}_0x3559b6['order']=qs[_0xbb58('0x3b')](_0x2a0481[_0xbb58('0x31')]['sort']);_0x3559b6[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x2a0481[_0xbb58('0x31')],_0x573cca[_0xbb58('0x33')]),_0xe46bc1);if(_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]){_0x3559b6[_0xbb58('0x3c')]=_['merge'](_0x3559b6[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0xe46bc1,function(_0x2da5ff){if(_0x2da5ff['type']!=='VIRTUAL'){var _0x133d56={};_0x133d56[_0x2da5ff['name']]={'$like':'%'+_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x133d56;}})});}_0x3559b6=_[_0xbb58('0x3f')]({},_0x3559b6,_0x2a0481['options']);var _0x485830={'where':_0x3559b6[_0xbb58('0x3c')]};return db[_0xbb58('0x2c')][_0xbb58('0x1c')](_0x485830)[_0xbb58('0x24')](function(_0x34a745){_0x2b0f73[_0xbb58('0x1c')]=_0x34a745;if(_0x2a0481['query'][_0xbb58('0x40')]){_0x3559b6[_0xbb58('0x41')]=[{'all':!![]}];}return db[_0xbb58('0x2c')][_0xbb58('0x42')](_0x3559b6);})[_0xbb58('0x24')](function(_0x301e15){_0x2b0f73['rows']=_0x301e15;return _0x2b0f73;})[_0xbb58('0x24')](respondWithFilteredResult(_0x4157c4,_0x3559b6))['catch'](handleError(_0x4157c4,null));};exports[_0xbb58('0x43')]=function(_0x285ad4,_0x29fb1c){var _0x45817f={'raw':![],'where':{'id':_0x285ad4[_0xbb58('0x44')]['id']}},_0x54099f={};_0x54099f[_0xbb58('0x35')]=_[_0xbb58('0x32')](db[_0xbb58('0x2c')]['rawAttributes']);_0x54099f[_0xbb58('0x31')]=_['keys'](_0x285ad4[_0xbb58('0x31')]);_0x54099f[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],_0x54099f[_0xbb58('0x31')]);_0x45817f[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x285ad4[_0xbb58('0x31')][_0xbb58('0x37')]));_0x45817f[_0xbb58('0x36')]=_0x45817f[_0xbb58('0x36')]['length']?_0x45817f[_0xbb58('0x36')]:_0x54099f['model'];if(_0x285ad4['query'][_0xbb58('0x40')]){_0x45817f[_0xbb58('0x41')]=[{'all':!![]}];}_0x45817f=_[_0xbb58('0x3f')]({},_0x45817f,_0x285ad4[_0xbb58('0x45')]);return db[_0xbb58('0x2c')][_0xbb58('0x46')](_0x45817f)[_0xbb58('0x24')](handleEntityNotFound(_0x29fb1c,null))[_0xbb58('0x24')](respondWithResult(_0x29fb1c,null))[_0xbb58('0x47')](handleError(_0x29fb1c,null));};exports[_0xbb58('0x48')]=function(_0x440fb3,_0x59a8cf){return db[_0xbb58('0x2c')][_0xbb58('0x48')](_0x440fb3['body'],{})[_0xbb58('0x24')](respondWithResult(_0x59a8cf,0xc9))[_0xbb58('0x47')](handleError(_0x59a8cf,null));};exports[_0xbb58('0x49')]=function(_0xdb0ff7,_0x5de68e){if(_0xdb0ff7[_0xbb58('0x4a')]['id']){delete _0xdb0ff7['body']['id'];}return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0xdb0ff7[_0xbb58('0x44')]['id']}})['then'](handleEntityNotFound(_0x5de68e,null))[_0xbb58('0x24')](saveUpdates(_0xdb0ff7[_0xbb58('0x4a')],null))['then'](respondWithResult(_0x5de68e,null))[_0xbb58('0x47')](handleError(_0x5de68e,null));};exports['destroy']=function(_0x28301d,_0x2d81e0){return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0x28301d[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x2d81e0,null))[_0xbb58('0x24')](removeEntity(_0x2d81e0,null))['catch'](handleError(_0x2d81e0,null));};exports[_0xbb58('0x4b')]=function(_0x1fd892,_0x592da8,_0x3efbc6){var _0x98157={};var _0x5c19b7={};var _0x22802c;var _0x44636b;return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x1fd892[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x592da8,null))[_0xbb58('0x24')](function(_0x592879){if(_0x592879){_0x22802c=_0x592879;_0x5c19b7[_0xbb58('0x35')]=_['keys'](db[_0xbb58('0x4c')][_0xbb58('0x2d')]);_0x5c19b7[_0xbb58('0x31')]=_['keys'](_0x1fd892['query']);_0x5c19b7[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x5c19b7[_0xbb58('0x35')],_0x5c19b7[_0xbb58('0x31')]);_0x98157[_0xbb58('0x36')]=_['intersection'](_0x5c19b7[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x1fd892[_0xbb58('0x31')]['fields']));_0x98157[_0xbb58('0x36')]=_0x98157[_0xbb58('0x36')][_0xbb58('0x38')]?_0x98157[_0xbb58('0x36')]:_0x5c19b7[_0xbb58('0x35')];_0x98157['order']=qs[_0xbb58('0x3b')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3b')]);_0x98157[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x1fd892[_0xbb58('0x31')],_0x5c19b7[_0xbb58('0x33')]));if(_0x1fd892['query'][_0xbb58('0x3e')]){_0x98157['where']=_[_0xbb58('0x3f')](_0x98157[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0x98157[_0xbb58('0x36')],function(_0x3d6fba){var _0x1dbbd9={};_0x1dbbd9[_0x3d6fba]={'$like':'%'+_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x1dbbd9;})});}_0x98157=_[_0xbb58('0x3f')]({},_0x98157,_0x1fd892[_0xbb58('0x45')]);return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x3933f0){if(_0x3933f0){_0x44636b=_0x3933f0[_0xbb58('0x38')];if(!_0x1fd892[_0xbb58('0x31')]['hasOwnProperty'](_0xbb58('0x3a'))){_0x98157['limit']=qs[_0xbb58('0x1e')](_0x1fd892[_0xbb58('0x31')]['limit']);_0x98157[_0xbb58('0x1d')]=qs[_0xbb58('0x1d')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x1d')]);}return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x54bf2e){if(_0x54bf2e){return _0x54bf2e?{'count':_0x44636b,'rows':_0x54bf2e}:null;}})[_0xbb58('0x24')](respondWithResult(_0x592da8,null))[_0xbb58('0x47')](handleError(_0x592da8,null));};exports[_0xbb58('0x4d')]=function(_0x4bbccf,_0x11d41e,_0x419215){if(_0x4bbccf['body']['id']){delete _0x4bbccf[_0xbb58('0x4a')]['id'];}return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x4bbccf[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x11d41e,null))[_0xbb58('0x24')](function(_0x3c932e){if(_0x3c932e){_0x4bbccf[_0xbb58('0x4a')]['AccountId']=_0x3c932e['id'];_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x4e')]=integrations[_0xbb58('0x4f')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf['body']['type']);_0x4bbccf[_0xbb58('0x4a')]['Descriptions']=integrations[_0xbb58('0x51')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x2f')]);return db[_0xbb58('0x4c')][_0xbb58('0x48')](_0x4bbccf[_0xbb58('0x4a')],{'include':[{'model':db[_0xbb58('0x52')],'as':_0xbb58('0x4e')},{'model':db['ZendeskField'],'as':_0xbb58('0x53')}]});}return null;})[_0xbb58('0x24')](respondWithResult(_0x11d41e,null))[_0xbb58('0x47')](handleError(_0x11d41e,null));};exports['getFields']=function(_0x50bf24,_0x4bdc30,_0x5e9319){var _0x1e315e='';return db[_0xbb58('0x2c')][_0xbb58('0x54')]({'where':{'id':_0x50bf24[_0xbb58('0x44')]['id']},'attributes':['id','username','password',_0xbb58('0x55'),_0xbb58('0x56'),'remoteUri']})[_0xbb58('0x24')](handleEntityNotFound(_0x4bdc30,null))[_0xbb58('0x24')](function(_0x3cd96a){if(_0x3cd96a){_0x1e315e=_0x3cd96a[_0xbb58('0x57')];var _0x382d16=_0x1e315e['slice'](-0x1);if(_0x382d16==='/'){_0x1e315e=_0x1e315e[_0xbb58('0x58')](0x0,_0x1e315e['lastIndexOf'](_0x382d16));}var _0x52cf79={'method':_0xbb58('0x59'),'uri':util[_0xbb58('0x5a')](_0xbb58('0x5b'),_0x1e315e,'ticket_fields'),'json':!![]};switch(_0x3cd96a[_0xbb58('0x56')]){case _0xbb58('0x5c'):_0x52cf79[_0xbb58('0x5d')]={'Authorization':util[_0xbb58('0x5a')]('Basic\x20%s',new Buffer(util[_0xbb58('0x5a')]('%s:%s',_0x3cd96a['username'],_0x3cd96a[_0xbb58('0x5c')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;case'token':_0x52cf79['headers']={'Authorization':util[_0xbb58('0x5a')](_0xbb58('0x60'),new Buffer(util[_0xbb58('0x5a')](_0xbb58('0x61'),_0x3cd96a[_0xbb58('0x62')],_0x3cd96a[_0xbb58('0x55')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;default:throw new db[(_0xbb58('0x63'))][(_0xbb58('0x64'))](_0xbb58('0x65'));}return rp(_0x52cf79);}})['then'](function(_0x502f55){if(_0x502f55){var _0x36e2eb=[_0xbb58('0x66'),_0xbb58('0x67'),'group',_0xbb58('0x68')];_[_0xbb58('0x69')](_0x502f55[_0xbb58('0x6a')],function(_0x494c33){return _0x36e2eb[_0xbb58('0x6b')](_0x494c33['type']);});return{'count':_0x502f55[_0xbb58('0x6a')]['length'],'rows':_[_0xbb58('0x2b')](_0x502f55[_0xbb58('0x6a')],function(_0xaf9d6){return{'id':_0xaf9d6['id'],'name':_0xaf9d6[_0xbb58('0x6c')]>0x7?_0xaf9d6[_0xbb58('0x6d')]:_0xaf9d6[_0xbb58('0x2f')],'custom':_0xaf9d6['position']>0x7?!![]:![],'options':_0xaf9d6['system_field_options']?_0xaf9d6[_0xbb58('0x6e')]:_0xaf9d6[_0xbb58('0x6f')]?_0xaf9d6['custom_field_options']:[]};})};}})[_0xbb58('0x24')](respondWithResult(_0x4bdc30,null))[_0xbb58('0x47')](function(_0x43eb15){var _0x5604d1=_0x50bf24[_0xbb58('0x31')]['test']?0x1f4:_0x43eb15[_0xbb58('0x70')]||0x1f4;logger[_0xbb58('0x26')](_0xbb58('0x71'),_0xbb58('0x72'),_0x5604d1,JSON[_0xbb58('0x73')](_0x43eb15));delete _0x43eb15[_0xbb58('0x28')];if(_0x5604d1===0x191){_0x5604d1=0x190;}_0x4bdc30[_0xbb58('0x1a')](_0x5604d1)['send'](_0x50bf24[_0xbb58('0x31')][_0xbb58('0x74')]?{'message':_0xbb58('0x75'),'statusCode':_0x43eb15['statusCode']}:_0x43eb15);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index ccc6f8c..dbd6dcb 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 _0x1a47=['./intZendeskAccount.attributes','exports','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x367106,_0x53fd00){var _0x476e7f=function(_0x3ef34c){while(--_0x3ef34c){_0x367106['push'](_0x367106['shift']());}};_0x476e7f(++_0x53fd00);}(_0x1a47,0x1bb));var _0x71a4=function(_0x431821,_0x3ca6f4){_0x431821=_0x431821-0x0;var _0xa04fbb=_0x1a47[_0x431821];return _0xa04fbb;};'use strict';var _=require(_0x71a4('0x0'));var util=require(_0x71a4('0x1'));var logger=require(_0x71a4('0x2'))(_0x71a4('0x3'));var moment=require(_0x71a4('0x4'));var BPromise=require(_0x71a4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x71a4('0x6'));var config=require(_0x71a4('0x7'));var attributes=require(_0x71a4('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x71a4('0x9')]=function(_0x171a77,_0x10b15c){return _0x171a77['define']('ZendeskAccount',attributes,{'tableName':_0x71a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8432=['rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','moment','bluebird','path'];(function(_0x4d3a7b,_0x517cee){var _0x303fea=function(_0x4a949c){while(--_0x4a949c){_0x4d3a7b['push'](_0x4d3a7b['shift']());}};_0x303fea(++_0x517cee);}(_0x8432,0x1ca));var _0x2843=function(_0x50e0c5,_0x49351f){_0x50e0c5=_0x50e0c5-0x0;var _0x11d623=_0x8432[_0x50e0c5];return _0x11d623;};'use strict';var _=require(_0x2843('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2843('0x1'));var BPromise=require(_0x2843('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2843('0x3'));var rimraf=require(_0x2843('0x4'));var config=require(_0x2843('0x5'));var attributes=require(_0x2843('0x6'));var integrations=require(_0x2843('0x7'));module[_0x2843('0x8')]=function(_0x439df0,_0xd6e161){return _0x439df0[_0x2843('0x9')](_0x2843('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 2338c4b..55c1b13 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 _0x6f08=['debug','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','options','where','attributes','limit','include','map','model','info','ZendeskAccount','find','raw','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s'];(function(_0x1bfdd2,_0x5d05c6){var _0x2fe5ad=function(_0x1b93fa){while(--_0x1b93fa){_0x1bfdd2['push'](_0x1bfdd2['shift']());}};_0x2fe5ad(++_0x5d05c6);}(_0x6f08,0x9c));var _0x86f0=function(_0xeceb3b,_0x391dc0){_0xeceb3b=_0xeceb3b-0x0;var _0xeab30f=_0x6f08[_0xeceb3b];return _0xeab30f;};'use strict';var _=require(_0x86f0('0x0'));var util=require(_0x86f0('0x1'));var moment=require(_0x86f0('0x2'));var BPromise=require(_0x86f0('0x3'));var rs=require(_0x86f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x86f0('0x5'));var logger=require('../../config/logger')(_0x86f0('0x6'));var config=require(_0x86f0('0x7'));var jayson=require(_0x86f0('0x8'));var client=jayson[_0x86f0('0x9')][_0x86f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22d398,_0x287cc1,_0x41f3b2){return new BPromise(function(_0x5890ea,_0x181e3f){return client[_0x86f0('0xb')](_0x22d398,_0x41f3b2)[_0x86f0('0xc')](function(_0x12c064){logger['info'](_0x86f0('0xd'),_0x287cc1,'request\x20sent');logger[_0x86f0('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x287cc1,_0x86f0('0xf'),JSON[_0x86f0('0x10')](_0x12c064));if(_0x12c064['error']){if(_0x12c064[_0x86f0('0x11')][_0x86f0('0x12')]===0x1f4){logger[_0x86f0('0x11')](_0x86f0('0xd'),_0x287cc1,_0x12c064[_0x86f0('0x11')]['message']);return _0x181e3f(_0x12c064[_0x86f0('0x11')]['message']);}logger['error'](_0x86f0('0xd'),_0x287cc1,_0x12c064[_0x86f0('0x11')][_0x86f0('0x13')]);return _0x5890ea(_0x12c064['error'][_0x86f0('0x13')]);}else{logger['info'](_0x86f0('0xd'),_0x287cc1,_0x86f0('0xf'));_0x5890ea(_0x12c064['result'][_0x86f0('0x13')]);}})[_0x86f0('0x14')](function(_0x43ed19){logger[_0x86f0('0x11')](_0x86f0('0xd'),_0x287cc1,_0x43ed19);_0x181e3f(_0x43ed19);});});}exports[_0x86f0('0x15')]=function(_0x2aaa10){var _0x37fa78=this;return new Promise(function(_0x396fdc,_0x5d9b1c){return db['ZendeskAccount']['findAll']({'raw':_0x2aaa10[_0x86f0('0x16')]?_0x2aaa10[_0x86f0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2aaa10['options']?_0x2aaa10[_0x86f0('0x16')][_0x86f0('0x17')]||null:null,'attributes':_0x2aaa10[_0x86f0('0x16')]?_0x2aaa10[_0x86f0('0x16')][_0x86f0('0x18')]||null:null,'limit':_0x2aaa10[_0x86f0('0x16')]?_0x2aaa10[_0x86f0('0x16')][_0x86f0('0x19')]||null:null,'include':_0x2aaa10[_0x86f0('0x16')]?_0x2aaa10[_0x86f0('0x16')][_0x86f0('0x1a')]?_[_0x86f0('0x1b')](_0x2aaa10[_0x86f0('0x16')][_0x86f0('0x1a')],function(_0x32d985){return{'model':db[_0x32d985[_0x86f0('0x1c')]],'as':_0x32d985['as'],'attributes':_0x32d985[_0x86f0('0x18')],'include':_0x32d985[_0x86f0('0x1a')]?_[_0x86f0('0x1b')](_0x32d985[_0x86f0('0x1a')],function(_0x242da9){return{'model':db[_0x242da9[_0x86f0('0x1c')]],'as':_0x242da9['as'],'attributes':_0x242da9[_0x86f0('0x18')],'include':_0x242da9[_0x86f0('0x1a')]?_['map'](_0x242da9[_0x86f0('0x1a')],function(_0x251eaf){return{'model':db[_0x251eaf['model']],'as':_0x251eaf['as'],'attributes':_0x251eaf['attributes']};}):[]};}):[]};}):[]:[]})[_0x86f0('0xc')](function(_0x10f292){logger[_0x86f0('0x1d')](_0x86f0('0x15'),_0x2aaa10);logger[_0x86f0('0xe')](_0x86f0('0x15'),_0x2aaa10,JSON[_0x86f0('0x10')](_0x10f292));_0x396fdc(_0x10f292);})[_0x86f0('0x14')](function(_0x3b9203){logger[_0x86f0('0x11')]('GetZendeskAccount',_0x3b9203[_0x86f0('0x13')],_0x2aaa10);_0x5d9b1c(_0x37fa78[_0x86f0('0x11')](0x1f4,_0x3b9203['message']));});});};exports['ShowZendeskAccount']=function(_0x467fd7){var _0x4dd14b=this;return new Promise(function(_0x236ea3,_0x360a5a){return db[_0x86f0('0x1e')][_0x86f0('0x1f')]({'raw':_0x467fd7['options']?_0x467fd7[_0x86f0('0x16')][_0x86f0('0x20')]===undefined?!![]:![]:!![],'where':_0x467fd7[_0x86f0('0x16')]?_0x467fd7[_0x86f0('0x16')][_0x86f0('0x17')]||null:null,'attributes':_0x467fd7[_0x86f0('0x16')]?_0x467fd7[_0x86f0('0x16')][_0x86f0('0x18')]||null:null,'include':_0x467fd7['options']?_0x467fd7['options']['include']?_[_0x86f0('0x1b')](_0x467fd7[_0x86f0('0x16')]['include'],function(_0x3f5482){return{'model':db[_0x3f5482[_0x86f0('0x1c')]],'as':_0x3f5482['as'],'attributes':_0x3f5482[_0x86f0('0x18')],'include':_0x3f5482[_0x86f0('0x1a')]?_['map'](_0x3f5482[_0x86f0('0x1a')],function(_0x2439d4){return{'model':db[_0x2439d4[_0x86f0('0x1c')]],'as':_0x2439d4['as'],'attributes':_0x2439d4[_0x86f0('0x18')],'include':_0x2439d4['include']?_[_0x86f0('0x1b')](_0x2439d4['include'],function(_0x2aeb9b){return{'model':db[_0x2aeb9b[_0x86f0('0x1c')]],'as':_0x2aeb9b['as'],'attributes':_0x2aeb9b[_0x86f0('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2812c8){logger['info'](_0x86f0('0x21'),_0x467fd7);logger['debug'](_0x86f0('0x21'),_0x467fd7,JSON[_0x86f0('0x10')](_0x2812c8));_0x236ea3(_0x2812c8);})[_0x86f0('0x14')](function(_0x30c8bf){logger['error'](_0x86f0('0x21'),_0x30c8bf[_0x86f0('0x13')],_0x467fd7);_0x360a5a(_0x4dd14b['error'](0x1f4,_0x30c8bf[_0x86f0('0x13')]));});});}; \ No newline at end of file +var _0xcf3e=['debug','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowZendeskAccount','find','then','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x11eebd,_0x3e2689){var _0x33855d=function(_0x3f3285){while(--_0x3f3285){_0x11eebd['push'](_0x11eebd['shift']());}};_0x33855d(++_0x3e2689);}(_0xcf3e,0xc4));var _0xecf3=function(_0x3ebeba,_0x3cded7){_0x3ebeba=_0x3ebeba-0x0;var _0x13573c=_0xcf3e[_0x3ebeba];return _0x13573c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xecf3('0x0'));var BPromise=require(_0xecf3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecf3('0x2'));var db=require(_0xecf3('0x3'))['db'];var utils=require(_0xecf3('0x4'));var logger=require(_0xecf3('0x5'))(_0xecf3('0x6'));var config=require(_0xecf3('0x7'));var jayson=require(_0xecf3('0x8'));var client=jayson[_0xecf3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xef132c,_0x118d4a,_0x323bd5){return new BPromise(function(_0x2908f8,_0x3f564c){return client[_0xecf3('0xa')](_0xef132c,_0x323bd5)['then'](function(_0x3ced69){logger[_0xecf3('0xb')](_0xecf3('0xc'),_0x118d4a,_0xecf3('0xd'));logger[_0xecf3('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x118d4a,_0xecf3('0xd'),JSON[_0xecf3('0xf')](_0x3ced69));if(_0x3ced69[_0xecf3('0x10')]){if(_0x3ced69[_0xecf3('0x10')][_0xecf3('0x11')]===0x1f4){logger[_0xecf3('0x10')](_0xecf3('0xc'),_0x118d4a,_0x3ced69['error'][_0xecf3('0x12')]);return _0x3f564c(_0x3ced69['error'][_0xecf3('0x12')]);}logger[_0xecf3('0x10')](_0xecf3('0xc'),_0x118d4a,_0x3ced69[_0xecf3('0x10')]['message']);return _0x2908f8(_0x3ced69[_0xecf3('0x10')][_0xecf3('0x12')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x118d4a,_0xecf3('0xd'));_0x2908f8(_0x3ced69[_0xecf3('0x13')][_0xecf3('0x12')]);}})['catch'](function(_0x390a60){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x118d4a,_0x390a60);_0x3f564c(_0x390a60);});});}exports[_0xecf3('0x14')]=function(_0x43b0ab){var _0x31b440=this;return new Promise(function(_0x210f48,_0x106a9f){return db[_0xecf3('0x15')][_0xecf3('0x16')]({'raw':_0x43b0ab[_0xecf3('0x17')]?_0x43b0ab['options'][_0xecf3('0x18')]===undefined?!![]:![]:!![],'where':_0x43b0ab['options']?_0x43b0ab['options'][_0xecf3('0x19')]||null:null,'attributes':_0x43b0ab[_0xecf3('0x17')]?_0x43b0ab[_0xecf3('0x17')][_0xecf3('0x1a')]||null:null,'limit':_0x43b0ab[_0xecf3('0x17')]?_0x43b0ab[_0xecf3('0x17')][_0xecf3('0x1b')]||null:null,'include':_0x43b0ab[_0xecf3('0x17')]?_0x43b0ab['options'][_0xecf3('0x1c')]?_['map'](_0x43b0ab[_0xecf3('0x17')][_0xecf3('0x1c')],function(_0x22b757){return{'model':db[_0x22b757[_0xecf3('0x1d')]],'as':_0x22b757['as'],'attributes':_0x22b757['attributes'],'include':_0x22b757[_0xecf3('0x1c')]?_[_0xecf3('0x1e')](_0x22b757[_0xecf3('0x1c')],function(_0x2f6551){return{'model':db[_0x2f6551['model']],'as':_0x2f6551['as'],'attributes':_0x2f6551[_0xecf3('0x1a')],'include':_0x2f6551[_0xecf3('0x1c')]?_[_0xecf3('0x1e')](_0x2f6551[_0xecf3('0x1c')],function(_0x3c65fa){return{'model':db[_0x3c65fa['model']],'as':_0x3c65fa['as'],'attributes':_0x3c65fa[_0xecf3('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29a7a4){logger[_0xecf3('0xb')]('GetZendeskAccount',_0x43b0ab);logger[_0xecf3('0xe')](_0xecf3('0x14'),_0x43b0ab,JSON[_0xecf3('0xf')](_0x29a7a4));_0x210f48(_0x29a7a4);})[_0xecf3('0x1f')](function(_0x54bc10){logger['error'](_0xecf3('0x14'),_0x54bc10['message'],_0x43b0ab);_0x106a9f(_0x31b440['error'](0x1f4,_0x54bc10['message']));});});};exports[_0xecf3('0x20')]=function(_0x455b3b){var _0x330b23=this;return new Promise(function(_0x1afb23,_0x4f54fc){return db['ZendeskAccount'][_0xecf3('0x21')]({'raw':_0x455b3b[_0xecf3('0x17')]?_0x455b3b[_0xecf3('0x17')][_0xecf3('0x18')]===undefined?!![]:![]:!![],'where':_0x455b3b[_0xecf3('0x17')]?_0x455b3b['options']['where']||null:null,'attributes':_0x455b3b['options']?_0x455b3b[_0xecf3('0x17')][_0xecf3('0x1a')]||null:null,'include':_0x455b3b['options']?_0x455b3b[_0xecf3('0x17')]['include']?_[_0xecf3('0x1e')](_0x455b3b['options']['include'],function(_0x283bd7){return{'model':db[_0x283bd7[_0xecf3('0x1d')]],'as':_0x283bd7['as'],'attributes':_0x283bd7['attributes'],'include':_0x283bd7['include']?_[_0xecf3('0x1e')](_0x283bd7[_0xecf3('0x1c')],function(_0x3183da){return{'model':db[_0x3183da[_0xecf3('0x1d')]],'as':_0x3183da['as'],'attributes':_0x3183da[_0xecf3('0x1a')],'include':_0x3183da['include']?_[_0xecf3('0x1e')](_0x3183da[_0xecf3('0x1c')],function(_0x5e219){return{'model':db[_0x5e219['model']],'as':_0x5e219['as'],'attributes':_0x5e219['attributes']};}):[]};}):[]};}):[]:[]})[_0xecf3('0x22')](function(_0x4ae0a9){logger[_0xecf3('0xb')](_0xecf3('0x20'),_0x455b3b);logger['debug']('ShowZendeskAccount',_0x455b3b,JSON[_0xecf3('0xf')](_0x4ae0a9));_0x1afb23(_0x4ae0a9);})[_0xecf3('0x1f')](function(_0x3bb915){logger['error'](_0xecf3('0x20'),_0x3bb915[_0xecf3('0x12')],_0x455b3b);_0x4f54fc(_0x330b23[_0xecf3('0x10')](0x1f4,_0x3bb915[_0xecf3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 0ae9733..2c70621 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x4559d6,_0x21ff92){var _0x3b77ae=function(_0x1ca65b){while(--_0x1ca65b){_0x4559d6['push'](_0x4559d6['shift']());}};_0x3b77ae(++_0x21ff92);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file +var _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3afbdf,_0x9e463b){_0x3afbdf=_0x3afbdf-0x0;var _0x5b6861=_0xbdb7[_0x3afbdf];return _0x5b6861;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index cba158e..adbd1dc 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 _0x0147=['sequelize','exports','STRING'];(function(_0xbbc96f,_0x220ad8){var _0x445d5a=function(_0x2b1ea9){while(--_0x2b1ea9){_0xbbc96f['push'](_0xbbc96f['shift']());}};_0x445d5a(++_0x220ad8);}(_0x0147,0x147));var _0x7014=function(_0x16b18b,_0x53939c){_0x16b18b=_0x16b18b-0x0;var _0x5049ed=_0x0147[_0x16b18b];return _0x5049ed;};'use strict';var Sequelize=require(_0x7014('0x0'));module[_0x7014('0x1')]={'name':{'type':Sequelize[_0x7014('0x2')]},'description':{'type':Sequelize[_0x7014('0x2')]}}; \ No newline at end of file +var _0x2ee9=['sequelize','exports','STRING'];(function(_0x3b1258,_0x5ecc14){var _0x573958=function(_0x441abd){while(--_0x441abd){_0x3b1258['push'](_0x3b1258['shift']());}};_0x573958(++_0x5ecc14);}(_0x2ee9,0x1ec));var _0x92ee=function(_0x5abec9,_0x1250e9){_0x5abec9=_0x5abec9-0x0;var _0x6ab592=_0x2ee9[_0x5abec9];return _0x6ab592;};'use strict';var Sequelize=require(_0x92ee('0x0'));module[_0x92ee('0x1')]={'name':{'type':Sequelize[_0x92ee('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 99deb0c..e1df504 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 _0x59de=['sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','update','find','getFields','findOne','pick','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','then','sendStatus','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x282a31,_0x3db803){var _0x152786=function(_0x466b7b){while(--_0x466b7b){_0x282a31['push'](_0x282a31['shift']());}};_0x152786(++_0x3db803);}(_0x59de,0x1c5));var _0xe59d=function(_0x2cb1df,_0x4b439c){_0x2cb1df=_0x2cb1df-0x0;var _0x30e674=_0x59de[_0x2cb1df];return _0x30e674;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe59d('0x0'));var zipdir=require(_0xe59d('0x1'));var jsonpatch=require(_0xe59d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe59d('0x3'));var Mustache=require(_0xe59d('0x4'));var util=require(_0xe59d('0x5'));var path=require(_0xe59d('0x6'));var sox=require('sox');var csv=require(_0xe59d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe59d('0x8'));var _=require(_0xe59d('0x9'));var squel=require(_0xe59d('0xa'));var crypto=require('crypto');var jsforce=require(_0xe59d('0xb'));var deskjs=require(_0xe59d('0xc'));var toCsv=require(_0xe59d('0x7'));var querystring=require(_0xe59d('0xd'));var Papa=require(_0xe59d('0xe'));var Redis=require(_0xe59d('0xf'));var authService=require(_0xe59d('0x10'));var qs=require(_0xe59d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe59d('0x12'));var logger=require(_0xe59d('0x13'))(_0xe59d('0x14'));var utils=require(_0xe59d('0x15'));var config=require(_0xe59d('0x16'));var licenseUtil=require(_0xe59d('0x17'));var db=require(_0xe59d('0x18'))['db'];function respondWithStatusCode(_0x4fb770,_0x5b4c8c){_0x5b4c8c=_0x5b4c8c||0xcc;return function(_0x50beaa){if(_0x50beaa){return _0x4fb770['sendStatus'](_0x5b4c8c);}return _0x4fb770[_0xe59d('0x19')](_0x5b4c8c)[_0xe59d('0x1a')]();};}function respondWithResult(_0xc300a7,_0x15a514){_0x15a514=_0x15a514||0xc8;return function(_0x3098d0){if(_0x3098d0){return _0xc300a7['status'](_0x15a514)[_0xe59d('0x1b')](_0x3098d0);}};}function respondWithFilteredResult(_0xfcedbd,_0x5145b9){return function(_0x40125c){if(_0x40125c){var _0x4ad1c4=typeof _0x5145b9[_0xe59d('0x1c')]===_0xe59d('0x1d')&&typeof _0x5145b9[_0xe59d('0x1e')]===_0xe59d('0x1d');var _0x2915de=_0x40125c[_0xe59d('0x1f')];var _0x33799f=_0x4ad1c4?0x0:_0x5145b9[_0xe59d('0x1c')];var _0x22e15a=_0x4ad1c4?_0x40125c[_0xe59d('0x1f')]:_0x5145b9['offset']+_0x5145b9[_0xe59d('0x1e')];var _0x50ee57;if(_0x22e15a>=_0x2915de){_0x22e15a=_0x2915de;_0x50ee57=0xc8;}else{_0x50ee57=0xce;}_0xfcedbd['status'](_0x50ee57);return _0xfcedbd['set']('Content-Range',_0x33799f+'-'+_0x22e15a+'/'+_0x2915de)['json'](_0x40125c);}return null;};}function patchUpdates(_0x35e932){return function(_0x1401ca){try{jsonpatch[_0xe59d('0x20')](_0x1401ca,_0x35e932,!![]);}catch(_0x498bca){return BPromise[_0xe59d('0x21')](_0x498bca);}return _0x1401ca[_0xe59d('0x22')]();};}function saveUpdates(_0x4205cf,_0x1eab65){return function(_0x939da9){if(_0x939da9){return _0x939da9['update'](_0x4205cf)['then'](function(_0x3e9a48){return _0x3e9a48;});}return null;};}function removeEntity(_0x1dfc64,_0x37ecb5){return function(_0x3de4b7){if(_0x3de4b7){return _0x3de4b7[_0xe59d('0x23')]()[_0xe59d('0x24')](function(){_0x1dfc64['status'](0xcc)[_0xe59d('0x1a')]();});}};}function handleEntityNotFound(_0x302e65,_0x28658f){return function(_0x4434c1){if(!_0x4434c1){_0x302e65[_0xe59d('0x25')](0x194);}return _0x4434c1;};}function handleError(_0x572105,_0x36cafb){_0x36cafb=_0x36cafb||0x1f4;return function(_0x3d6b32){logger[_0xe59d('0x26')](_0x3d6b32['stack']);if(_0x3d6b32['name']){delete _0x3d6b32[_0xe59d('0x27')];}_0x572105['status'](_0x36cafb)[_0xe59d('0x28')](_0x3d6b32);};}exports[_0xe59d('0x29')]=function(_0x40768a,_0x391836){var _0x470a83={},_0x254087={},_0x3b94e7={'count':0x0,'rows':[]};var _0x373646=_[_0xe59d('0x2a')](db[_0xe59d('0x2b')][_0xe59d('0x2c')],function(_0x2bb7b6){return{'name':_0x2bb7b6[_0xe59d('0x2d')],'type':_0x2bb7b6['type'][_0xe59d('0x2e')]};});_0x254087[_0xe59d('0x2f')]=_[_0xe59d('0x2a')](_0x373646,_0xe59d('0x27'));_0x254087[_0xe59d('0x30')]=_[_0xe59d('0x31')](_0x40768a[_0xe59d('0x30')]);_0x254087['filters']=_[_0xe59d('0x32')](_0x254087[_0xe59d('0x2f')],_0x254087[_0xe59d('0x30')]);_0x470a83[_0xe59d('0x33')]=_[_0xe59d('0x32')](_0x254087[_0xe59d('0x2f')],qs[_0xe59d('0x34')](_0x40768a[_0xe59d('0x30')][_0xe59d('0x34')]));_0x470a83[_0xe59d('0x33')]=_0x470a83[_0xe59d('0x33')][_0xe59d('0x35')]?_0x470a83[_0xe59d('0x33')]:_0x254087[_0xe59d('0x2f')];if(!_0x40768a[_0xe59d('0x30')][_0xe59d('0x36')](_0xe59d('0x37'))){_0x470a83[_0xe59d('0x1e')]=qs[_0xe59d('0x1e')](_0x40768a[_0xe59d('0x30')][_0xe59d('0x1e')]);_0x470a83['offset']=qs[_0xe59d('0x1c')](_0x40768a[_0xe59d('0x30')][_0xe59d('0x1c')]);}_0x470a83[_0xe59d('0x38')]=qs[_0xe59d('0x39')](_0x40768a[_0xe59d('0x30')]['sort']);_0x470a83[_0xe59d('0x3a')]=qs['filters'](_['pick'](_0x40768a['query'],_0x254087[_0xe59d('0x3b')]),_0x373646);if(_0x40768a['query']['filter']){_0x470a83['where']=_[_0xe59d('0x3c')](_0x470a83[_0xe59d('0x3a')],{'$or':_[_0xe59d('0x2a')](_0x373646,function(_0x4278f5){if(_0x4278f5[_0xe59d('0x3d')]!==_0xe59d('0x3e')){var _0x535e1b={};_0x535e1b[_0x4278f5[_0xe59d('0x27')]]={'$like':'%'+_0x40768a[_0xe59d('0x30')][_0xe59d('0x3f')]+'%'};return _0x535e1b;}})});}_0x470a83=_[_0xe59d('0x3c')]({},_0x470a83,_0x40768a[_0xe59d('0x40')]);var _0x1794d2={'where':_0x470a83[_0xe59d('0x3a')]};return db[_0xe59d('0x2b')][_0xe59d('0x1f')](_0x1794d2)['then'](function(_0x475195){_0x3b94e7[_0xe59d('0x1f')]=_0x475195;if(_0x40768a[_0xe59d('0x30')][_0xe59d('0x41')]){_0x470a83[_0xe59d('0x42')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x470a83);})['then'](function(_0x59c5b4){_0x3b94e7[_0xe59d('0x43')]=_0x59c5b4;return _0x3b94e7;})[_0xe59d('0x24')](respondWithFilteredResult(_0x391836,_0x470a83))[_0xe59d('0x44')](handleError(_0x391836,null));};exports[_0xe59d('0x45')]=function(_0x673b72,_0x5801ca){var _0x5a06f1={'raw':![],'where':{'id':_0x673b72[_0xe59d('0x46')]['id']}},_0x25702d={};_0x25702d[_0xe59d('0x2f')]=_[_0xe59d('0x31')](db[_0xe59d('0x2b')][_0xe59d('0x2c')]);_0x25702d['query']=_['keys'](_0x673b72[_0xe59d('0x30')]);_0x25702d[_0xe59d('0x3b')]=_[_0xe59d('0x32')](_0x25702d['model'],_0x25702d[_0xe59d('0x30')]);_0x5a06f1[_0xe59d('0x33')]=_['intersection'](_0x25702d['model'],qs[_0xe59d('0x34')](_0x673b72[_0xe59d('0x30')][_0xe59d('0x34')]));_0x5a06f1['attributes']=_0x5a06f1[_0xe59d('0x33')]['length']?_0x5a06f1[_0xe59d('0x33')]:_0x25702d['model'];if(_0x673b72[_0xe59d('0x30')]['includeAll']){_0x5a06f1[_0xe59d('0x42')]=[{'all':!![]}];}_0x5a06f1=_[_0xe59d('0x3c')]({},_0x5a06f1,_0x673b72[_0xe59d('0x40')]);return db[_0xe59d('0x2b')]['find'](_0x5a06f1)[_0xe59d('0x24')](handleEntityNotFound(_0x5801ca,null))[_0xe59d('0x24')](respondWithResult(_0x5801ca,null))['catch'](handleError(_0x5801ca,null));};exports[_0xe59d('0x47')]=function(_0x586743,_0x1e3c04){return db[_0xe59d('0x2b')][_0xe59d('0x47')](_0x586743[_0xe59d('0x48')],{})[_0xe59d('0x24')](respondWithResult(_0x1e3c04,0xc9))[_0xe59d('0x44')](handleError(_0x1e3c04,null));};exports[_0xe59d('0x49')]=function(_0x318b4f,_0x196551){if(_0x318b4f[_0xe59d('0x48')]['id']){delete _0x318b4f[_0xe59d('0x48')]['id'];}return db['ZendeskConfiguration'][_0xe59d('0x4a')]({'where':{'id':_0x318b4f[_0xe59d('0x46')]['id']}})['then'](handleEntityNotFound(_0x196551,null))[_0xe59d('0x24')](saveUpdates(_0x318b4f[_0xe59d('0x48')],null))[_0xe59d('0x24')](respondWithResult(_0x196551,null))[_0xe59d('0x44')](handleError(_0x196551,null));};exports['destroy']=function(_0x588ccd,_0x5e7a7a){return db[_0xe59d('0x2b')][_0xe59d('0x4a')]({'where':{'id':_0x588ccd[_0xe59d('0x46')]['id']}})[_0xe59d('0x24')](handleEntityNotFound(_0x5e7a7a,null))[_0xe59d('0x24')](removeEntity(_0x5e7a7a,null))['catch'](handleError(_0x5e7a7a,null));};exports[_0xe59d('0x4b')]=function(_0x2d4e96,_0x203eca,_0x4567a1){var _0x300766={};var _0x181f5b={};var _0x1b8bd5;var _0x56ae18;return db[_0xe59d('0x2b')][_0xe59d('0x4c')]({'where':{'id':_0x2d4e96['params']['id']}})['then'](handleEntityNotFound(_0x203eca,null))['then'](function(_0x472bbf){if(_0x472bbf){_0x1b8bd5=_0x472bbf;_0x181f5b[_0xe59d('0x2f')]=_[_0xe59d('0x31')](db['ZendeskField'][_0xe59d('0x2c')]);_0x181f5b[_0xe59d('0x30')]=_['keys'](_0x2d4e96[_0xe59d('0x30')]);_0x181f5b[_0xe59d('0x3b')]=_[_0xe59d('0x32')](_0x181f5b['model'],_0x181f5b[_0xe59d('0x30')]);_0x300766[_0xe59d('0x33')]=_[_0xe59d('0x32')](_0x181f5b[_0xe59d('0x2f')],qs[_0xe59d('0x34')](_0x2d4e96[_0xe59d('0x30')][_0xe59d('0x34')]));_0x300766['attributes']=_0x300766['attributes'][_0xe59d('0x35')]?_0x300766[_0xe59d('0x33')]:_0x181f5b[_0xe59d('0x2f')];_0x300766[_0xe59d('0x38')]=qs['sort'](_0x2d4e96['query'][_0xe59d('0x39')]);_0x300766['where']=qs['filters'](_[_0xe59d('0x4d')](_0x2d4e96[_0xe59d('0x30')],_0x181f5b['filters']));if(_0x2d4e96[_0xe59d('0x30')][_0xe59d('0x3f')]){_0x300766[_0xe59d('0x3a')]=_[_0xe59d('0x3c')](_0x300766[_0xe59d('0x3a')],{'$or':_['map'](_0x300766[_0xe59d('0x33')],function(_0x2aa5d2){var _0x2e0463={};_0x2e0463[_0x2aa5d2]={'$like':'%'+_0x2d4e96[_0xe59d('0x30')][_0xe59d('0x3f')]+'%'};return _0x2e0463;})});}_0x300766=_[_0xe59d('0x3c')]({},_0x300766,_0x2d4e96['options']);return _0x1b8bd5[_0xe59d('0x4b')](_0x300766);}})[_0xe59d('0x24')](function(_0x240fb0){if(_0x240fb0){_0x56ae18=_0x240fb0[_0xe59d('0x35')];if(!_0x2d4e96[_0xe59d('0x30')]['hasOwnProperty']('nolimit')){_0x300766['limit']=qs[_0xe59d('0x1e')](_0x2d4e96[_0xe59d('0x30')][_0xe59d('0x1e')]);_0x300766['offset']=qs[_0xe59d('0x1c')](_0x2d4e96[_0xe59d('0x30')][_0xe59d('0x1c')]);}return _0x1b8bd5['getFields'](_0x300766);}})[_0xe59d('0x24')](function(_0x2a1b0f){if(_0x2a1b0f){return _0x2a1b0f?{'count':_0x56ae18,'rows':_0x2a1b0f}:null;}})['then'](respondWithResult(_0x203eca,null))[_0xe59d('0x44')](handleError(_0x203eca,null));};exports[_0xe59d('0x4e')]=function(_0x4bfe86,_0x21f6b6,_0x2f157b){var _0x3feb18={};var _0x680380={};var _0x388941;var _0x3874c8;return db[_0xe59d('0x2b')][_0xe59d('0x4c')]({'where':{'id':_0x4bfe86[_0xe59d('0x46')]['id']}})[_0xe59d('0x24')](handleEntityNotFound(_0x21f6b6,null))['then'](function(_0x5c2341){if(_0x5c2341){_0x388941=_0x5c2341;_0x680380['model']=_[_0xe59d('0x31')](db[_0xe59d('0x4f')][_0xe59d('0x2c')]);_0x680380[_0xe59d('0x30')]=_[_0xe59d('0x31')](_0x4bfe86[_0xe59d('0x30')]);_0x680380[_0xe59d('0x3b')]=_[_0xe59d('0x32')](_0x680380['model'],_0x680380[_0xe59d('0x30')]);_0x3feb18[_0xe59d('0x33')]=_[_0xe59d('0x32')](_0x680380[_0xe59d('0x2f')],qs[_0xe59d('0x34')](_0x4bfe86[_0xe59d('0x30')][_0xe59d('0x34')]));_0x3feb18['attributes']=_0x3feb18[_0xe59d('0x33')][_0xe59d('0x35')]?_0x3feb18['attributes']:_0x680380[_0xe59d('0x2f')];_0x3feb18[_0xe59d('0x38')]=qs['sort'](_0x4bfe86[_0xe59d('0x30')][_0xe59d('0x39')]);_0x3feb18['where']=qs[_0xe59d('0x3b')](_[_0xe59d('0x4d')](_0x4bfe86[_0xe59d('0x30')],_0x680380[_0xe59d('0x3b')]));if(_0x4bfe86[_0xe59d('0x30')][_0xe59d('0x3f')]){_0x3feb18[_0xe59d('0x3a')]=_[_0xe59d('0x3c')](_0x3feb18[_0xe59d('0x3a')],{'$or':_[_0xe59d('0x2a')](_0x3feb18[_0xe59d('0x33')],function(_0x2c61de){var _0x194ae5={};_0x194ae5[_0x2c61de]={'$like':'%'+_0x4bfe86[_0xe59d('0x30')][_0xe59d('0x3f')]+'%'};return _0x194ae5;})});}_0x3feb18=_['merge']({},_0x3feb18,_0x4bfe86[_0xe59d('0x40')]);return _0x388941[_0xe59d('0x4e')](_0x3feb18);}})[_0xe59d('0x24')](function(_0x10c38e){if(_0x10c38e){_0x3874c8=_0x10c38e[_0xe59d('0x35')];if(!_0x4bfe86[_0xe59d('0x30')][_0xe59d('0x36')](_0xe59d('0x37'))){_0x3feb18[_0xe59d('0x1e')]=qs[_0xe59d('0x1e')](_0x4bfe86[_0xe59d('0x30')][_0xe59d('0x1e')]);_0x3feb18[_0xe59d('0x1c')]=qs['offset'](_0x4bfe86['query'][_0xe59d('0x1c')]);}return _0x388941[_0xe59d('0x4e')](_0x3feb18);}})['then'](function(_0x5dbada){if(_0x5dbada){return _0x5dbada?{'count':_0x3874c8,'rows':_0x5dbada}:null;}})[_0xe59d('0x24')](respondWithResult(_0x21f6b6,null))['catch'](handleError(_0x21f6b6,null));};exports[_0xe59d('0x50')]=function(_0xd06bf0,_0x35f9a4,_0x24b811){var _0xd9d954={};var _0x4980ce={};var _0x36dfb6;var _0x585b9f;return db[_0xe59d('0x2b')][_0xe59d('0x4c')]({'where':{'id':_0xd06bf0[_0xe59d('0x46')]['id']}})['then'](handleEntityNotFound(_0x35f9a4,null))['then'](function(_0xc8eaee){if(_0xc8eaee){_0x36dfb6=_0xc8eaee;_0x4980ce[_0xe59d('0x2f')]=_[_0xe59d('0x31')](db[_0xe59d('0x4f')][_0xe59d('0x2c')]);_0x4980ce[_0xe59d('0x30')]=_[_0xe59d('0x31')](_0xd06bf0[_0xe59d('0x30')]);_0x4980ce['filters']=_[_0xe59d('0x32')](_0x4980ce[_0xe59d('0x2f')],_0x4980ce[_0xe59d('0x30')]);_0xd9d954['attributes']=_['intersection'](_0x4980ce[_0xe59d('0x2f')],qs[_0xe59d('0x34')](_0xd06bf0[_0xe59d('0x30')][_0xe59d('0x34')]));_0xd9d954['attributes']=_0xd9d954[_0xe59d('0x33')][_0xe59d('0x35')]?_0xd9d954[_0xe59d('0x33')]:_0x4980ce[_0xe59d('0x2f')];_0xd9d954[_0xe59d('0x38')]=qs[_0xe59d('0x39')](_0xd06bf0[_0xe59d('0x30')]['sort']);_0xd9d954[_0xe59d('0x3a')]=qs['filters'](_[_0xe59d('0x4d')](_0xd06bf0[_0xe59d('0x30')],_0x4980ce[_0xe59d('0x3b')]));if(_0xd06bf0[_0xe59d('0x30')][_0xe59d('0x3f')]){_0xd9d954[_0xe59d('0x3a')]=_['merge'](_0xd9d954[_0xe59d('0x3a')],{'$or':_[_0xe59d('0x2a')](_0xd9d954[_0xe59d('0x33')],function(_0x509ed8){var _0x4fcb1f={};_0x4fcb1f[_0x509ed8]={'$like':'%'+_0xd06bf0[_0xe59d('0x30')]['filter']+'%'};return _0x4fcb1f;})});}_0xd9d954=_[_0xe59d('0x3c')]({},_0xd9d954,_0xd06bf0[_0xe59d('0x40')]);return _0x36dfb6[_0xe59d('0x50')](_0xd9d954);}})[_0xe59d('0x24')](function(_0x145de7){if(_0x145de7){_0x585b9f=_0x145de7['length'];if(!_0xd06bf0[_0xe59d('0x30')]['hasOwnProperty'](_0xe59d('0x37'))){_0xd9d954['limit']=qs[_0xe59d('0x1e')](_0xd06bf0[_0xe59d('0x30')]['limit']);_0xd9d954[_0xe59d('0x1c')]=qs['offset'](_0xd06bf0['query'][_0xe59d('0x1c')]);}return _0x36dfb6['getDescriptions'](_0xd9d954);}})['then'](function(_0x1f8f30){if(_0x1f8f30){return _0x1f8f30?{'count':_0x585b9f,'rows':_0x1f8f30}:null;}})['then'](respondWithResult(_0x35f9a4,null))[_0xe59d('0x44')](handleError(_0x35f9a4,null));};exports[_0xe59d('0x51')]=function(_0x13185e,_0x2653f8,_0x3fceae){var _0x12ea19={};var _0x27ad58={};var _0x65c81c;var _0x35455a;return db[_0xe59d('0x2b')][_0xe59d('0x4c')]({'where':{'id':_0x13185e[_0xe59d('0x46')]['id']}})[_0xe59d('0x24')](handleEntityNotFound(_0x2653f8,null))['then'](function(_0x377398){if(_0x377398){_0x65c81c=_0x377398;_0x27ad58['model']=_[_0xe59d('0x31')](db[_0xe59d('0x52')][_0xe59d('0x2c')]);_0x27ad58[_0xe59d('0x30')]=_['keys'](_0x13185e['query']);_0x27ad58[_0xe59d('0x3b')]=_[_0xe59d('0x32')](_0x27ad58['model'],_0x27ad58[_0xe59d('0x30')]);_0x12ea19[_0xe59d('0x33')]=_[_0xe59d('0x32')](_0x27ad58['model'],qs[_0xe59d('0x34')](_0x13185e[_0xe59d('0x30')][_0xe59d('0x34')]));_0x12ea19[_0xe59d('0x33')]=_0x12ea19[_0xe59d('0x33')][_0xe59d('0x35')]?_0x12ea19[_0xe59d('0x33')]:_0x27ad58[_0xe59d('0x2f')];_0x12ea19['order']=qs[_0xe59d('0x39')](_0x13185e[_0xe59d('0x30')][_0xe59d('0x39')]);_0x12ea19['where']=qs[_0xe59d('0x3b')](_[_0xe59d('0x4d')](_0x13185e[_0xe59d('0x30')],_0x27ad58[_0xe59d('0x3b')]));if(_0x13185e[_0xe59d('0x30')][_0xe59d('0x3f')]){_0x12ea19['where']=_[_0xe59d('0x3c')](_0x12ea19[_0xe59d('0x3a')],{'$or':_['map'](_0x12ea19[_0xe59d('0x33')],function(_0x52682a){var _0x356ba9={};_0x356ba9[_0x52682a]={'$like':'%'+_0x13185e[_0xe59d('0x30')][_0xe59d('0x3f')]+'%'};return _0x356ba9;})});}_0x12ea19=_[_0xe59d('0x3c')]({},_0x12ea19,_0x13185e[_0xe59d('0x40')]);return _0x65c81c[_0xe59d('0x51')](_0x12ea19);}})['then'](function(_0x1c1d6f){if(_0x1c1d6f){_0x35455a=_0x1c1d6f['length'];if(!_0x13185e[_0xe59d('0x30')]['hasOwnProperty'](_0xe59d('0x37'))){_0x12ea19[_0xe59d('0x1e')]=qs['limit'](_0x13185e[_0xe59d('0x30')]['limit']);_0x12ea19[_0xe59d('0x1c')]=qs[_0xe59d('0x1c')](_0x13185e[_0xe59d('0x30')][_0xe59d('0x1c')]);}return _0x65c81c[_0xe59d('0x51')](_0x12ea19);}})[_0xe59d('0x24')](function(_0x121374){if(_0x121374){return _0x121374?{'count':_0x35455a,'rows':_0x121374}:null;}})[_0xe59d('0x24')](respondWithResult(_0x2653f8,null))[_0xe59d('0x44')](handleError(_0x2653f8,null));};exports[_0xe59d('0x53')]=function(_0x38f097,_0x776ab8,_0x16f681){if(_0x38f097[_0xe59d('0x48')]['id']){delete _0x38f097[_0xe59d('0x48')]['id'];}return db[_0xe59d('0x2b')][_0xe59d('0x4c')]({'where':{'id':_0x38f097[_0xe59d('0x46')]['id']}})['then'](handleEntityNotFound(_0x776ab8,null))[_0xe59d('0x24')](function(_0x41fcd5){if(_0x41fcd5){return _0x41fcd5[_0xe59d('0x53')](_0x38f097[_0xe59d('0x48')][_0xe59d('0x54')]||[]);}return null;})[_0xe59d('0x24')](respondWithResult(_0x776ab8,null))[_0xe59d('0x44')](handleError(_0x776ab8,null));}; \ No newline at end of file +var _0x3ad1=['show','params','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','ZendeskConfiguration','includeAll','include','rows','catch'];(function(_0x451077,_0x1a688c){var _0x2cda54=function(_0x411ced){while(--_0x411ced){_0x451077['push'](_0x451077['shift']());}};_0x2cda54(++_0x1a688c);}(_0x3ad1,0x15a));var _0x13ad=function(_0x1cd606,_0x56f7f2){_0x1cd606=_0x1cd606-0x0;var _0x215e68=_0x3ad1[_0x1cd606];return _0x215e68;};'use strict';var emlformat=require(_0x13ad('0x0'));var rimraf=require(_0x13ad('0x1'));var zipdir=require(_0x13ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13ad('0x3'));var moment=require(_0x13ad('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x13ad('0x5'));var util=require('util');var path=require(_0x13ad('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x13ad('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x13ad('0x8'));var crypto=require(_0x13ad('0x9'));var jsforce=require(_0x13ad('0xa'));var deskjs=require(_0x13ad('0xb'));var toCsv=require(_0x13ad('0xc'));var querystring=require(_0x13ad('0xd'));var Papa=require('papaparse');var Redis=require(_0x13ad('0xe'));var authService=require(_0x13ad('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x13ad('0x10'));var hardwareService=require(_0x13ad('0x11'));var logger=require(_0x13ad('0x12'))(_0x13ad('0x13'));var utils=require(_0x13ad('0x14'));var config=require(_0x13ad('0x15'));var licenseUtil=require(_0x13ad('0x16'));var db=require(_0x13ad('0x17'))['db'];function respondWithStatusCode(_0x3784ca,_0x593331){_0x593331=_0x593331||0xcc;return function(_0x564e0a){if(_0x564e0a){return _0x3784ca['sendStatus'](_0x593331);}return _0x3784ca[_0x13ad('0x18')](_0x593331)['end']();};}function respondWithResult(_0xc9dcf4,_0x4541bf){_0x4541bf=_0x4541bf||0xc8;return function(_0x7d9c3a){if(_0x7d9c3a){return _0xc9dcf4['status'](_0x4541bf)[_0x13ad('0x19')](_0x7d9c3a);}};}function respondWithFilteredResult(_0x1e588f,_0x1f7586){return function(_0xaedcee){if(_0xaedcee){var _0x5ca73a=typeof _0x1f7586[_0x13ad('0x1a')]==='undefined'&&typeof _0x1f7586[_0x13ad('0x1b')]==='undefined';var _0x3cb1eb=_0xaedcee[_0x13ad('0x1c')];var _0x29d200=_0x5ca73a?0x0:_0x1f7586[_0x13ad('0x1a')];var _0x2abf33=_0x5ca73a?_0xaedcee[_0x13ad('0x1c')]:_0x1f7586['offset']+_0x1f7586[_0x13ad('0x1b')];var _0xebbebf;if(_0x2abf33>=_0x3cb1eb){_0x2abf33=_0x3cb1eb;_0xebbebf=0xc8;}else{_0xebbebf=0xce;}_0x1e588f[_0x13ad('0x18')](_0xebbebf);return _0x1e588f[_0x13ad('0x1d')](_0x13ad('0x1e'),_0x29d200+'-'+_0x2abf33+'/'+_0x3cb1eb)[_0x13ad('0x19')](_0xaedcee);}return null;};}function patchUpdates(_0x5352df){return function(_0x225bb2){try{jsonpatch[_0x13ad('0x1f')](_0x225bb2,_0x5352df,!![]);}catch(_0x21b761){return BPromise['reject'](_0x21b761);}return _0x225bb2['save']();};}function saveUpdates(_0x16210d,_0x2d3a69){return function(_0x38e08c){if(_0x38e08c){return _0x38e08c[_0x13ad('0x20')](_0x16210d)[_0x13ad('0x21')](function(_0x45140c){return _0x45140c;});}return null;};}function removeEntity(_0x597bfb,_0x494c3f){return function(_0x3fd86d){if(_0x3fd86d){return _0x3fd86d[_0x13ad('0x22')]()[_0x13ad('0x21')](function(){_0x597bfb[_0x13ad('0x18')](0xcc)[_0x13ad('0x23')]();});}};}function handleEntityNotFound(_0x56809d,_0x3ac780){return function(_0x62cce1){if(!_0x62cce1){_0x56809d[_0x13ad('0x24')](0x194);}return _0x62cce1;};}function handleError(_0x1dfd8d,_0x1c5a8f){_0x1c5a8f=_0x1c5a8f||0x1f4;return function(_0x545a4a){logger[_0x13ad('0x25')](_0x545a4a[_0x13ad('0x26')]);if(_0x545a4a[_0x13ad('0x27')]){delete _0x545a4a[_0x13ad('0x27')];}_0x1dfd8d[_0x13ad('0x18')](_0x1c5a8f)[_0x13ad('0x28')](_0x545a4a);};}exports[_0x13ad('0x29')]=function(_0x5c95ba,_0x5092b7){var _0x53a74f={},_0x48ecd2={},_0x5de4fe={'count':0x0,'rows':[]};var _0x413cda=_[_0x13ad('0x2a')](db['ZendeskConfiguration'][_0x13ad('0x2b')],function(_0x3e9e24){return{'name':_0x3e9e24[_0x13ad('0x2c')],'type':_0x3e9e24[_0x13ad('0x2d')][_0x13ad('0x2e')]};});_0x48ecd2['model']=_[_0x13ad('0x2a')](_0x413cda,_0x13ad('0x27'));_0x48ecd2[_0x13ad('0x2f')]=_[_0x13ad('0x30')](_0x5c95ba[_0x13ad('0x2f')]);_0x48ecd2[_0x13ad('0x31')]=_[_0x13ad('0x32')](_0x48ecd2[_0x13ad('0x33')],_0x48ecd2[_0x13ad('0x2f')]);_0x53a74f[_0x13ad('0x34')]=_[_0x13ad('0x32')](_0x48ecd2[_0x13ad('0x33')],qs['fields'](_0x5c95ba[_0x13ad('0x2f')][_0x13ad('0x35')]));_0x53a74f[_0x13ad('0x34')]=_0x53a74f[_0x13ad('0x34')][_0x13ad('0x36')]?_0x53a74f['attributes']:_0x48ecd2[_0x13ad('0x33')];if(!_0x5c95ba[_0x13ad('0x2f')][_0x13ad('0x37')](_0x13ad('0x38'))){_0x53a74f[_0x13ad('0x1b')]=qs[_0x13ad('0x1b')](_0x5c95ba[_0x13ad('0x2f')][_0x13ad('0x1b')]);_0x53a74f[_0x13ad('0x1a')]=qs[_0x13ad('0x1a')](_0x5c95ba[_0x13ad('0x2f')]['offset']);}_0x53a74f[_0x13ad('0x39')]=qs[_0x13ad('0x3a')](_0x5c95ba['query'][_0x13ad('0x3a')]);_0x53a74f['where']=qs[_0x13ad('0x31')](_[_0x13ad('0x3b')](_0x5c95ba[_0x13ad('0x2f')],_0x48ecd2[_0x13ad('0x31')]),_0x413cda);if(_0x5c95ba['query']['filter']){_0x53a74f[_0x13ad('0x3c')]=_[_0x13ad('0x3d')](_0x53a74f[_0x13ad('0x3c')],{'$or':_['map'](_0x413cda,function(_0x3717ec){if(_0x3717ec[_0x13ad('0x2d')]!=='VIRTUAL'){var _0x41b966={};_0x41b966[_0x3717ec[_0x13ad('0x27')]]={'$like':'%'+_0x5c95ba[_0x13ad('0x2f')][_0x13ad('0x3e')]+'%'};return _0x41b966;}})});}_0x53a74f=_[_0x13ad('0x3d')]({},_0x53a74f,_0x5c95ba[_0x13ad('0x3f')]);var _0x381559={'where':_0x53a74f[_0x13ad('0x3c')]};return db[_0x13ad('0x40')][_0x13ad('0x1c')](_0x381559)['then'](function(_0x34404a){_0x5de4fe[_0x13ad('0x1c')]=_0x34404a;if(_0x5c95ba[_0x13ad('0x2f')][_0x13ad('0x41')]){_0x53a74f[_0x13ad('0x42')]=[{'all':!![]}];}return db[_0x13ad('0x40')]['findAll'](_0x53a74f);})['then'](function(_0x1f1e7f){_0x5de4fe[_0x13ad('0x43')]=_0x1f1e7f;return _0x5de4fe;})[_0x13ad('0x21')](respondWithFilteredResult(_0x5092b7,_0x53a74f))[_0x13ad('0x44')](handleError(_0x5092b7,null));};exports[_0x13ad('0x45')]=function(_0x2ca614,_0x38e200){var _0x3bcbce={'raw':![],'where':{'id':_0x2ca614[_0x13ad('0x46')]['id']}},_0xde8934={};_0xde8934[_0x13ad('0x33')]=_[_0x13ad('0x30')](db[_0x13ad('0x40')][_0x13ad('0x2b')]);_0xde8934[_0x13ad('0x2f')]=_[_0x13ad('0x30')](_0x2ca614[_0x13ad('0x2f')]);_0xde8934['filters']=_['intersection'](_0xde8934[_0x13ad('0x33')],_0xde8934[_0x13ad('0x2f')]);_0x3bcbce[_0x13ad('0x34')]=_[_0x13ad('0x32')](_0xde8934[_0x13ad('0x33')],qs[_0x13ad('0x35')](_0x2ca614[_0x13ad('0x2f')][_0x13ad('0x35')]));_0x3bcbce['attributes']=_0x3bcbce[_0x13ad('0x34')][_0x13ad('0x36')]?_0x3bcbce[_0x13ad('0x34')]:_0xde8934[_0x13ad('0x33')];if(_0x2ca614[_0x13ad('0x2f')][_0x13ad('0x41')]){_0x3bcbce['include']=[{'all':!![]}];}_0x3bcbce=_[_0x13ad('0x3d')]({},_0x3bcbce,_0x2ca614[_0x13ad('0x3f')]);return db['ZendeskConfiguration'][_0x13ad('0x47')](_0x3bcbce)[_0x13ad('0x21')](handleEntityNotFound(_0x38e200,null))['then'](respondWithResult(_0x38e200,null))['catch'](handleError(_0x38e200,null));};exports['create']=function(_0x28cfc1,_0x2fb72b){return db['ZendeskConfiguration'][_0x13ad('0x48')](_0x28cfc1[_0x13ad('0x49')],{})[_0x13ad('0x21')](respondWithResult(_0x2fb72b,0xc9))[_0x13ad('0x44')](handleError(_0x2fb72b,null));};exports[_0x13ad('0x20')]=function(_0x10b547,_0x539e8f){if(_0x10b547['body']['id']){delete _0x10b547[_0x13ad('0x49')]['id'];}return db[_0x13ad('0x40')][_0x13ad('0x47')]({'where':{'id':_0x10b547[_0x13ad('0x46')]['id']}})[_0x13ad('0x21')](handleEntityNotFound(_0x539e8f,null))['then'](saveUpdates(_0x10b547[_0x13ad('0x49')],null))['then'](respondWithResult(_0x539e8f,null))[_0x13ad('0x44')](handleError(_0x539e8f,null));};exports[_0x13ad('0x22')]=function(_0x4ce596,_0x3bef29){return db[_0x13ad('0x40')][_0x13ad('0x47')]({'where':{'id':_0x4ce596['params']['id']}})[_0x13ad('0x21')](handleEntityNotFound(_0x3bef29,null))[_0x13ad('0x21')](removeEntity(_0x3bef29,null))[_0x13ad('0x44')](handleError(_0x3bef29,null));};exports[_0x13ad('0x4a')]=function(_0x86eaa9,_0x2bc04c,_0x7d3b93){var _0x3e913c={};var _0x71642={};var _0xb7eabb;var _0x4ba024;return db[_0x13ad('0x40')][_0x13ad('0x4b')]({'where':{'id':_0x86eaa9['params']['id']}})[_0x13ad('0x21')](handleEntityNotFound(_0x2bc04c,null))[_0x13ad('0x21')](function(_0x1aea18){if(_0x1aea18){_0xb7eabb=_0x1aea18;_0x71642[_0x13ad('0x33')]=_[_0x13ad('0x30')](db[_0x13ad('0x4c')][_0x13ad('0x2b')]);_0x71642[_0x13ad('0x2f')]=_[_0x13ad('0x30')](_0x86eaa9[_0x13ad('0x2f')]);_0x71642[_0x13ad('0x31')]=_[_0x13ad('0x32')](_0x71642[_0x13ad('0x33')],_0x71642['query']);_0x3e913c[_0x13ad('0x34')]=_[_0x13ad('0x32')](_0x71642[_0x13ad('0x33')],qs[_0x13ad('0x35')](_0x86eaa9[_0x13ad('0x2f')][_0x13ad('0x35')]));_0x3e913c[_0x13ad('0x34')]=_0x3e913c[_0x13ad('0x34')][_0x13ad('0x36')]?_0x3e913c[_0x13ad('0x34')]:_0x71642['model'];_0x3e913c[_0x13ad('0x39')]=qs[_0x13ad('0x3a')](_0x86eaa9[_0x13ad('0x2f')][_0x13ad('0x3a')]);_0x3e913c[_0x13ad('0x3c')]=qs[_0x13ad('0x31')](_[_0x13ad('0x3b')](_0x86eaa9[_0x13ad('0x2f')],_0x71642['filters']));if(_0x86eaa9[_0x13ad('0x2f')]['filter']){_0x3e913c[_0x13ad('0x3c')]=_['merge'](_0x3e913c[_0x13ad('0x3c')],{'$or':_[_0x13ad('0x2a')](_0x3e913c[_0x13ad('0x34')],function(_0x22b1cb){var _0x3755bb={};_0x3755bb[_0x22b1cb]={'$like':'%'+_0x86eaa9['query'][_0x13ad('0x3e')]+'%'};return _0x3755bb;})});}_0x3e913c=_[_0x13ad('0x3d')]({},_0x3e913c,_0x86eaa9[_0x13ad('0x3f')]);return _0xb7eabb['getFields'](_0x3e913c);}})['then'](function(_0x29613d){if(_0x29613d){_0x4ba024=_0x29613d[_0x13ad('0x36')];if(!_0x86eaa9['query'][_0x13ad('0x37')](_0x13ad('0x38'))){_0x3e913c[_0x13ad('0x1b')]=qs[_0x13ad('0x1b')](_0x86eaa9[_0x13ad('0x2f')][_0x13ad('0x1b')]);_0x3e913c['offset']=qs[_0x13ad('0x1a')](_0x86eaa9[_0x13ad('0x2f')][_0x13ad('0x1a')]);}return _0xb7eabb['getFields'](_0x3e913c);}})[_0x13ad('0x21')](function(_0x104a40){if(_0x104a40){return _0x104a40?{'count':_0x4ba024,'rows':_0x104a40}:null;}})[_0x13ad('0x21')](respondWithResult(_0x2bc04c,null))['catch'](handleError(_0x2bc04c,null));};exports[_0x13ad('0x4d')]=function(_0x41956d,_0x4c5f7d,_0x971c86){var _0x397ab5={};var _0x5d65b3={};var _0x47808b;var _0x5bb213;return db[_0x13ad('0x40')][_0x13ad('0x4b')]({'where':{'id':_0x41956d[_0x13ad('0x46')]['id']}})[_0x13ad('0x21')](handleEntityNotFound(_0x4c5f7d,null))[_0x13ad('0x21')](function(_0x4f60db){if(_0x4f60db){_0x47808b=_0x4f60db;_0x5d65b3[_0x13ad('0x33')]=_[_0x13ad('0x30')](db[_0x13ad('0x4c')]['rawAttributes']);_0x5d65b3[_0x13ad('0x2f')]=_[_0x13ad('0x30')](_0x41956d['query']);_0x5d65b3[_0x13ad('0x31')]=_[_0x13ad('0x32')](_0x5d65b3[_0x13ad('0x33')],_0x5d65b3['query']);_0x397ab5[_0x13ad('0x34')]=_[_0x13ad('0x32')](_0x5d65b3[_0x13ad('0x33')],qs[_0x13ad('0x35')](_0x41956d[_0x13ad('0x2f')][_0x13ad('0x35')]));_0x397ab5['attributes']=_0x397ab5[_0x13ad('0x34')]['length']?_0x397ab5[_0x13ad('0x34')]:_0x5d65b3[_0x13ad('0x33')];_0x397ab5[_0x13ad('0x39')]=qs['sort'](_0x41956d['query'][_0x13ad('0x3a')]);_0x397ab5['where']=qs[_0x13ad('0x31')](_[_0x13ad('0x3b')](_0x41956d['query'],_0x5d65b3[_0x13ad('0x31')]));if(_0x41956d[_0x13ad('0x2f')][_0x13ad('0x3e')]){_0x397ab5[_0x13ad('0x3c')]=_[_0x13ad('0x3d')](_0x397ab5[_0x13ad('0x3c')],{'$or':_[_0x13ad('0x2a')](_0x397ab5[_0x13ad('0x34')],function(_0x363bbd){var _0x2a3d70={};_0x2a3d70[_0x363bbd]={'$like':'%'+_0x41956d[_0x13ad('0x2f')][_0x13ad('0x3e')]+'%'};return _0x2a3d70;})});}_0x397ab5=_[_0x13ad('0x3d')]({},_0x397ab5,_0x41956d[_0x13ad('0x3f')]);return _0x47808b[_0x13ad('0x4d')](_0x397ab5);}})['then'](function(_0x33c355){if(_0x33c355){_0x5bb213=_0x33c355['length'];if(!_0x41956d[_0x13ad('0x2f')][_0x13ad('0x37')]('nolimit')){_0x397ab5[_0x13ad('0x1b')]=qs[_0x13ad('0x1b')](_0x41956d[_0x13ad('0x2f')][_0x13ad('0x1b')]);_0x397ab5['offset']=qs[_0x13ad('0x1a')](_0x41956d['query'][_0x13ad('0x1a')]);}return _0x47808b[_0x13ad('0x4d')](_0x397ab5);}})['then'](function(_0x366cd5){if(_0x366cd5){return _0x366cd5?{'count':_0x5bb213,'rows':_0x366cd5}:null;}})['then'](respondWithResult(_0x4c5f7d,null))['catch'](handleError(_0x4c5f7d,null));};exports[_0x13ad('0x4e')]=function(_0x991b3d,_0x5e6770,_0x417a79){var _0x5f3573={};var _0x493e03={};var _0x55b986;var _0x20b87c;return db['ZendeskConfiguration'][_0x13ad('0x4b')]({'where':{'id':_0x991b3d[_0x13ad('0x46')]['id']}})[_0x13ad('0x21')](handleEntityNotFound(_0x5e6770,null))['then'](function(_0x5a980a){if(_0x5a980a){_0x55b986=_0x5a980a;_0x493e03['model']=_[_0x13ad('0x30')](db['ZendeskField'][_0x13ad('0x2b')]);_0x493e03[_0x13ad('0x2f')]=_['keys'](_0x991b3d[_0x13ad('0x2f')]);_0x493e03[_0x13ad('0x31')]=_[_0x13ad('0x32')](_0x493e03[_0x13ad('0x33')],_0x493e03[_0x13ad('0x2f')]);_0x5f3573[_0x13ad('0x34')]=_['intersection'](_0x493e03['model'],qs['fields'](_0x991b3d[_0x13ad('0x2f')][_0x13ad('0x35')]));_0x5f3573[_0x13ad('0x34')]=_0x5f3573[_0x13ad('0x34')]['length']?_0x5f3573['attributes']:_0x493e03[_0x13ad('0x33')];_0x5f3573[_0x13ad('0x39')]=qs[_0x13ad('0x3a')](_0x991b3d[_0x13ad('0x2f')][_0x13ad('0x3a')]);_0x5f3573[_0x13ad('0x3c')]=qs['filters'](_['pick'](_0x991b3d['query'],_0x493e03[_0x13ad('0x31')]));if(_0x991b3d[_0x13ad('0x2f')][_0x13ad('0x3e')]){_0x5f3573[_0x13ad('0x3c')]=_[_0x13ad('0x3d')](_0x5f3573['where'],{'$or':_['map'](_0x5f3573['attributes'],function(_0x405d6e){var _0x4229d0={};_0x4229d0[_0x405d6e]={'$like':'%'+_0x991b3d[_0x13ad('0x2f')][_0x13ad('0x3e')]+'%'};return _0x4229d0;})});}_0x5f3573=_[_0x13ad('0x3d')]({},_0x5f3573,_0x991b3d['options']);return _0x55b986[_0x13ad('0x4e')](_0x5f3573);}})[_0x13ad('0x21')](function(_0x20ab95){if(_0x20ab95){_0x20b87c=_0x20ab95[_0x13ad('0x36')];if(!_0x991b3d[_0x13ad('0x2f')][_0x13ad('0x37')](_0x13ad('0x38'))){_0x5f3573[_0x13ad('0x1b')]=qs[_0x13ad('0x1b')](_0x991b3d[_0x13ad('0x2f')][_0x13ad('0x1b')]);_0x5f3573[_0x13ad('0x1a')]=qs[_0x13ad('0x1a')](_0x991b3d['query'][_0x13ad('0x1a')]);}return _0x55b986[_0x13ad('0x4e')](_0x5f3573);}})[_0x13ad('0x21')](function(_0x2f602a){if(_0x2f602a){return _0x2f602a?{'count':_0x20b87c,'rows':_0x2f602a}:null;}})[_0x13ad('0x21')](respondWithResult(_0x5e6770,null))[_0x13ad('0x44')](handleError(_0x5e6770,null));};exports[_0x13ad('0x4f')]=function(_0x50866d,_0x590516,_0x474e95){var _0x101a73={};var _0x526880={};var _0x414aef;var _0xb3fd13;return db[_0x13ad('0x40')][_0x13ad('0x4b')]({'where':{'id':_0x50866d[_0x13ad('0x46')]['id']}})['then'](handleEntityNotFound(_0x590516,null))['then'](function(_0x30c2b1){if(_0x30c2b1){_0x414aef=_0x30c2b1;_0x526880[_0x13ad('0x33')]=_['keys'](db[_0x13ad('0x50')][_0x13ad('0x2b')]);_0x526880[_0x13ad('0x2f')]=_[_0x13ad('0x30')](_0x50866d['query']);_0x526880[_0x13ad('0x31')]=_[_0x13ad('0x32')](_0x526880['model'],_0x526880[_0x13ad('0x2f')]);_0x101a73[_0x13ad('0x34')]=_['intersection'](_0x526880[_0x13ad('0x33')],qs[_0x13ad('0x35')](_0x50866d['query'][_0x13ad('0x35')]));_0x101a73[_0x13ad('0x34')]=_0x101a73['attributes'][_0x13ad('0x36')]?_0x101a73['attributes']:_0x526880[_0x13ad('0x33')];_0x101a73[_0x13ad('0x39')]=qs[_0x13ad('0x3a')](_0x50866d[_0x13ad('0x2f')][_0x13ad('0x3a')]);_0x101a73['where']=qs[_0x13ad('0x31')](_[_0x13ad('0x3b')](_0x50866d[_0x13ad('0x2f')],_0x526880[_0x13ad('0x31')]));if(_0x50866d['query'][_0x13ad('0x3e')]){_0x101a73[_0x13ad('0x3c')]=_['merge'](_0x101a73[_0x13ad('0x3c')],{'$or':_[_0x13ad('0x2a')](_0x101a73[_0x13ad('0x34')],function(_0x3d8612){var _0x528515={};_0x528515[_0x3d8612]={'$like':'%'+_0x50866d[_0x13ad('0x2f')]['filter']+'%'};return _0x528515;})});}_0x101a73=_[_0x13ad('0x3d')]({},_0x101a73,_0x50866d['options']);return _0x414aef[_0x13ad('0x4f')](_0x101a73);}})[_0x13ad('0x21')](function(_0x39b25a){if(_0x39b25a){_0xb3fd13=_0x39b25a['length'];if(!_0x50866d[_0x13ad('0x2f')][_0x13ad('0x37')](_0x13ad('0x38'))){_0x101a73['limit']=qs['limit'](_0x50866d['query'][_0x13ad('0x1b')]);_0x101a73['offset']=qs[_0x13ad('0x1a')](_0x50866d[_0x13ad('0x2f')][_0x13ad('0x1a')]);}return _0x414aef['getTags'](_0x101a73);}})[_0x13ad('0x21')](function(_0x101d45){if(_0x101d45){return _0x101d45?{'count':_0xb3fd13,'rows':_0x101d45}:null;}})[_0x13ad('0x21')](respondWithResult(_0x590516,null))[_0x13ad('0x44')](handleError(_0x590516,null));};exports[_0x13ad('0x51')]=function(_0x56d09e,_0x2f4905,_0x53eed7){if(_0x56d09e[_0x13ad('0x49')]['id']){delete _0x56d09e[_0x13ad('0x49')]['id'];}return db[_0x13ad('0x40')][_0x13ad('0x4b')]({'where':{'id':_0x56d09e[_0x13ad('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f4905,null))[_0x13ad('0x21')](function(_0x989a1b){if(_0x989a1b){return _0x989a1b[_0x13ad('0x51')](_0x56d09e[_0x13ad('0x49')][_0x13ad('0x52')]||[]);}return null;})['then'](respondWithResult(_0x2f4905,null))[_0x13ad('0x44')](handleError(_0x2f4905,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index d01871e..bd12d37 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 _0x351d=['../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x5d0c1e,_0x132dd6){var _0x3ad7b0=function(_0x18703e){while(--_0x18703e){_0x5d0c1e['push'](_0x5d0c1e['shift']());}};_0x3ad7b0(++_0x132dd6);}(_0x351d,0x90));var _0xd351=function(_0x1d1161,_0x39bc97){_0x1d1161=_0x1d1161-0x0;var _0x21641c=_0x351d[_0x1d1161];return _0x21641c;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var logger=require(_0xd351('0x1'))(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var rp=require(_0xd351('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xd351('0x7')]=function(_0x45e9e5,_0x88bd2b){return _0x45e9e5['define'](_0xd351('0x8'),attributes,{'tableName':_0xd351('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcbb=['rimraf','../../config/environment','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x297a0f,_0x45bf24){var _0xe371e1=function(_0x4c8725){while(--_0x4c8725){_0x297a0f['push'](_0x297a0f['shift']());}};_0xe371e1(++_0x45bf24);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x1ada38,_0x3f8fdf){_0x1ada38=_0x1ada38-0x0;var _0x480505=_0xfcbb[_0x1ada38];return _0x480505;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var logger=require(_0xbfcb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbfcb('0x3'));var rp=require(_0xbfcb('0x4'));var fs=require('fs');var path=require(_0xbfcb('0x5'));var rimraf=require(_0xbfcb('0x6'));var config=require(_0xbfcb('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x32c2aa,_0x4990c){return _0x32c2aa[_0xbfcb('0x8')](_0xbfcb('0x9'),attributes,{'tableName':_0xbfcb('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 5bc6cf8..a9e2d0b 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 _0x931b=['http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x931b,0x83));var _0xb931=function(_0x4e081c,_0x3d85f0){_0x4e081c=_0x4e081c-0x0;var _0x560336=_0x931b[_0x4e081c];return _0x560336;};'use strict';var _=require(_0xb931('0x0'));var util=require(_0xb931('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb931('0x2'));var fs=require('fs');var Redis=require(_0xb931('0x3'));var db=require(_0xb931('0x4'))['db'];var utils=require(_0xb931('0x5'));var logger=require('../../config/logger')(_0xb931('0x6'));var config=require(_0xb931('0x7'));var jayson=require(_0xb931('0x8'));var client=jayson['client'][_0xb931('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38d8b1,_0x2043a7,_0xb83189){return new BPromise(function(_0x3f7e0b,_0x23e337){return client[_0xb931('0xa')](_0x38d8b1,_0xb83189)[_0xb931('0xb')](function(_0x2eb490){logger[_0xb931('0xc')](_0xb931('0xd'),_0x2043a7,_0xb931('0xe'));logger['debug'](_0xb931('0xf'),_0x2043a7,_0xb931('0xe'),JSON['stringify'](_0x2eb490));if(_0x2eb490[_0xb931('0x10')]){if(_0x2eb490[_0xb931('0x10')]['code']===0x1f4){logger[_0xb931('0x10')](_0xb931('0xd'),_0x2043a7,_0x2eb490[_0xb931('0x10')][_0xb931('0x11')]);return _0x23e337(_0x2eb490[_0xb931('0x10')][_0xb931('0x11')]);}logger[_0xb931('0x10')](_0xb931('0xd'),_0x2043a7,_0x2eb490[_0xb931('0x10')][_0xb931('0x11')]);return _0x3f7e0b(_0x2eb490[_0xb931('0x10')][_0xb931('0x11')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x2043a7,_0xb931('0xe'));_0x3f7e0b(_0x2eb490[_0xb931('0x12')][_0xb931('0x11')]);}})[_0xb931('0x13')](function(_0x533041){logger[_0xb931('0x10')](_0xb931('0xd'),_0x2043a7,_0x533041);_0x23e337(_0x533041);});});} \ No newline at end of file +var _0xf7c2=['../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ZendeskConfiguration,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x48e52c,_0x8853){var _0x2f4eee=function(_0x50b5a3){while(--_0x50b5a3){_0x48e52c['push'](_0x48e52c['shift']());}};_0x2f4eee(++_0x8853);}(_0xf7c2,0xea));var _0x2f7c=function(_0x1f8223,_0x2e2b29){_0x1f8223=_0x1f8223-0x0;var _0x4aa535=_0xf7c2[_0x1f8223];return _0x4aa535;};'use strict';var _=require(_0x2f7c('0x0'));var util=require(_0x2f7c('0x1'));var moment=require('moment');var BPromise=require(_0x2f7c('0x2'));var rs=require(_0x2f7c('0x3'));var fs=require('fs');var Redis=require(_0x2f7c('0x4'));var db=require(_0x2f7c('0x5'))['db'];var utils=require(_0x2f7c('0x6'));var logger=require('../../config/logger')(_0x2f7c('0x7'));var config=require(_0x2f7c('0x8'));var jayson=require(_0x2f7c('0x9'));var client=jayson[_0x2f7c('0xa')][_0x2f7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x571214,_0x582e61,_0x42b31a){return new BPromise(function(_0x5e6a58,_0x2f125f){return client[_0x2f7c('0xc')](_0x571214,_0x42b31a)[_0x2f7c('0xd')](function(_0x3f7778){logger[_0x2f7c('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x582e61,'request\x20sent');logger['debug'](_0x2f7c('0xf'),_0x582e61,_0x2f7c('0x10'),JSON[_0x2f7c('0x11')](_0x3f7778));if(_0x3f7778[_0x2f7c('0x12')]){if(_0x3f7778['error']['code']===0x1f4){logger[_0x2f7c('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x582e61,_0x3f7778[_0x2f7c('0x12')][_0x2f7c('0x13')]);return _0x2f125f(_0x3f7778['error'][_0x2f7c('0x13')]);}logger[_0x2f7c('0x12')](_0x2f7c('0x14'),_0x582e61,_0x3f7778[_0x2f7c('0x12')][_0x2f7c('0x13')]);return _0x5e6a58(_0x3f7778['error']['message']);}else{logger[_0x2f7c('0xe')](_0x2f7c('0x14'),_0x582e61,'request\x20sent');_0x5e6a58(_0x3f7778['result'][_0x2f7c('0x13')]);}})[_0x2f7c('0x15')](function(_0x3b2d65){logger[_0x2f7c('0x12')](_0x2f7c('0x14'),_0x582e61,_0x3b2d65);_0x2f125f(_0x3b2d65);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index a3e7cad..bea22df 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 _0x0cb8=['show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','get','/:id'];(function(_0x261fc1,_0x46a683){var _0xa7aefe=function(_0x143b2a){while(--_0x143b2a){_0x261fc1['push'](_0x261fc1['shift']());}};_0xa7aefe(++_0x46a683);}(_0x0cb8,0x123));var _0x80cb=function(_0x13cbff,_0x217a30){_0x13cbff=_0x13cbff-0x0;var _0xd755a8=_0x0cb8[_0x13cbff];return _0xd755a8;};'use strict';var multer=require(_0x80cb('0x0'));var util=require(_0x80cb('0x1'));var path=require(_0x80cb('0x2'));var timeout=require(_0x80cb('0x3'));var express=require(_0x80cb('0x4'));var router=express[_0x80cb('0x5')]();var fs_extra=require(_0x80cb('0x6'));var auth=require(_0x80cb('0x7'));var interaction=require(_0x80cb('0x8'));var config=require('../../config/environment');var controller=require(_0x80cb('0x9'));router['get']('/',auth[_0x80cb('0xa')](),controller['index']);router[_0x80cb('0xb')](_0x80cb('0xc'),auth[_0x80cb('0xa')](),controller[_0x80cb('0xd')]);router[_0x80cb('0xe')]('/',auth[_0x80cb('0xa')](),controller[_0x80cb('0xf')]);router['put'](_0x80cb('0xc'),auth[_0x80cb('0xa')](),controller[_0x80cb('0x10')]);router[_0x80cb('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x80cb('0x12')]=router; \ No newline at end of file +var _0xcf39=['multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x276a1b,_0x20f64d){var _0x4ed500=function(_0x4f3de1){while(--_0x4f3de1){_0x276a1b['push'](_0x276a1b['shift']());}};_0x4ed500(++_0x20f64d);}(_0xcf39,0x6c));var _0x9cf3=function(_0x347d10,_0x2d798f){_0x347d10=_0x347d10-0x0;var _0x1154c5=_0xcf39[_0x347d10];return _0x1154c5;};'use strict';var multer=require(_0x9cf3('0x0'));var util=require(_0x9cf3('0x1'));var path=require(_0x9cf3('0x2'));var timeout=require('connect-timeout');var express=require(_0x9cf3('0x3'));var router=express['Router']();var fs_extra=require(_0x9cf3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9cf3('0x5'));var config=require(_0x9cf3('0x6'));var controller=require(_0x9cf3('0x7'));router[_0x9cf3('0x8')]('/',auth['isAuthenticated'](),controller[_0x9cf3('0x9')]);router[_0x9cf3('0x8')](_0x9cf3('0xa'),auth[_0x9cf3('0xb')](),controller[_0x9cf3('0xc')]);router[_0x9cf3('0xd')]('/',auth[_0x9cf3('0xb')](),controller[_0x9cf3('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9cf3('0xf')]);router[_0x9cf3('0x10')](_0x9cf3('0xa'),auth[_0x9cf3('0xb')](),controller[_0x9cf3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index dcbb504..9e09d91 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 _0x6f19=['STRING','BOOLEAN','exports','ENUM','variable','keyValue','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f19,0x121));var _0x96f1=function(_0x242992,_0xeef96f){_0x242992=_0x242992-0x0;var _0xe6ff5c=_0x6f19[_0x242992];return _0xe6ff5c;};'use strict';var Sequelize=require('sequelize');module[_0x96f1('0x0')]={'type':{'type':Sequelize[_0x96f1('0x1')]('string',_0x96f1('0x2'),'customVariable',_0x96f1('0x3'),'picklist'),'defaultValue':_0x96f1('0x4')},'content':{'type':Sequelize[_0x96f1('0x5')]},'key':{'type':Sequelize[_0x96f1('0x5')]},'keyType':{'type':Sequelize[_0x96f1('0x1')](_0x96f1('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x96f1('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x96f1('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd15e=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0x22b35d,_0x3f167a){var _0x22e0b7=function(_0x17145e){while(--_0x17145e){_0x22b35d['push'](_0x22b35d['shift']());}};_0x22e0b7(++_0x3f167a);}(_0xd15e,0x1cc));var _0xed15=function(_0x2743ff,_0xd0d899){_0x2743ff=_0x2743ff-0x0;var _0x4fe1ed=_0xd15e[_0x2743ff];return _0x4fe1ed;};'use strict';var Sequelize=require(_0xed15('0x0'));module[_0xed15('0x1')]={'type':{'type':Sequelize[_0xed15('0x2')](_0xed15('0x3'),_0xed15('0x4'),'customVariable',_0xed15('0x5'),_0xed15('0x6')),'defaultValue':_0xed15('0x3')},'content':{'type':Sequelize[_0xed15('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xed15('0x2')]('string',_0xed15('0x4'),_0xed15('0x8'))},'keyContent':{'type':Sequelize[_0xed15('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xed15('0x7')]},'customField':{'type':Sequelize[_0xed15('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xed15('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index f9a6641..e3887ec 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 _0x3f18=['eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZendeskField','findAll','rows','catch','params','includeAll','include','create','body','find'];(function(_0x4c0243,_0x24e6ce){var _0x20f111=function(_0x239418){while(--_0x239418){_0x4c0243['push'](_0x4c0243['shift']());}};_0x20f111(++_0x24e6ce);}(_0x3f18,0x1aa));var _0x83f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f18[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x83f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83f1('0x2'));var moment=require(_0x83f1('0x3'));var BPromise=require(_0x83f1('0x4'));var Mustache=require(_0x83f1('0x5'));var util=require('util');var path=require(_0x83f1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83f1('0x7'));var _=require('lodash');var squel=require(_0x83f1('0x8'));var crypto=require(_0x83f1('0x9'));var jsforce=require(_0x83f1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x83f1('0xb'));var querystring=require(_0x83f1('0xc'));var Papa=require('papaparse');var Redis=require(_0x83f1('0xd'));var authService=require(_0x83f1('0xe'));var qs=require(_0x83f1('0xf'));var as=require(_0x83f1('0x10'));var hardwareService=require(_0x83f1('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x83f1('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x522f13,_0x4cea36){_0x4cea36=_0x4cea36||0xcc;return function(_0x365c56){if(_0x365c56){return _0x522f13[_0x83f1('0x13')](_0x4cea36);}return _0x522f13[_0x83f1('0x14')](_0x4cea36)[_0x83f1('0x15')]();};}function respondWithResult(_0xf32b97,_0x1f5c5f){_0x1f5c5f=_0x1f5c5f||0xc8;return function(_0x5826b9){if(_0x5826b9){return _0xf32b97['status'](_0x1f5c5f)[_0x83f1('0x16')](_0x5826b9);}};}function respondWithFilteredResult(_0x13f5b5,_0x3150bc){return function(_0x1004bc){if(_0x1004bc){var _0x4ad72b=typeof _0x3150bc[_0x83f1('0x17')]===_0x83f1('0x18')&&typeof _0x3150bc['limit']===_0x83f1('0x18');var _0x34bf1e=_0x1004bc[_0x83f1('0x19')];var _0x100301=_0x4ad72b?0x0:_0x3150bc[_0x83f1('0x17')];var _0x4ae872=_0x4ad72b?_0x1004bc[_0x83f1('0x19')]:_0x3150bc['offset']+_0x3150bc[_0x83f1('0x1a')];var _0xcc89a5;if(_0x4ae872>=_0x34bf1e){_0x4ae872=_0x34bf1e;_0xcc89a5=0xc8;}else{_0xcc89a5=0xce;}_0x13f5b5[_0x83f1('0x14')](_0xcc89a5);return _0x13f5b5[_0x83f1('0x1b')](_0x83f1('0x1c'),_0x100301+'-'+_0x4ae872+'/'+_0x34bf1e)[_0x83f1('0x16')](_0x1004bc);}return null;};}function patchUpdates(_0x1fb5c7){return function(_0x379827){try{jsonpatch[_0x83f1('0x1d')](_0x379827,_0x1fb5c7,!![]);}catch(_0x48b6ee){return BPromise[_0x83f1('0x1e')](_0x48b6ee);}return _0x379827[_0x83f1('0x1f')]();};}function saveUpdates(_0x497def,_0x9abc7c){return function(_0x4f1ba3){if(_0x4f1ba3){return _0x4f1ba3[_0x83f1('0x20')](_0x497def)['then'](function(_0x374844){return _0x374844;});}return null;};}function removeEntity(_0x375972,_0x1a3915){return function(_0x3e5db4){if(_0x3e5db4){return _0x3e5db4[_0x83f1('0x21')]()[_0x83f1('0x22')](function(){_0x375972['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x413b37,_0x2012ce){return function(_0x369e20){if(!_0x369e20){_0x413b37['sendStatus'](0x194);}return _0x369e20;};}function handleError(_0xb8b300,_0x4361ad){_0x4361ad=_0x4361ad||0x1f4;return function(_0x41794c){logger['error'](_0x41794c[_0x83f1('0x23')]);if(_0x41794c[_0x83f1('0x24')]){delete _0x41794c[_0x83f1('0x24')];}_0xb8b300[_0x83f1('0x14')](_0x4361ad)[_0x83f1('0x25')](_0x41794c);};}exports['index']=function(_0x327908,_0x22f43a){var _0x46c96f={},_0x4fd526={},_0x5a2e04={'count':0x0,'rows':[]};var _0x66d05=_[_0x83f1('0x26')](db['ZendeskField'][_0x83f1('0x27')],function(_0x1abd01){return{'name':_0x1abd01[_0x83f1('0x28')],'type':_0x1abd01[_0x83f1('0x29')][_0x83f1('0x2a')]};});_0x4fd526[_0x83f1('0x2b')]=_[_0x83f1('0x26')](_0x66d05,_0x83f1('0x24'));_0x4fd526['query']=_[_0x83f1('0x2c')](_0x327908[_0x83f1('0x2d')]);_0x4fd526['filters']=_[_0x83f1('0x2e')](_0x4fd526[_0x83f1('0x2b')],_0x4fd526[_0x83f1('0x2d')]);_0x46c96f['attributes']=_[_0x83f1('0x2e')](_0x4fd526['model'],qs[_0x83f1('0x2f')](_0x327908[_0x83f1('0x2d')]['fields']));_0x46c96f[_0x83f1('0x30')]=_0x46c96f['attributes'][_0x83f1('0x31')]?_0x46c96f[_0x83f1('0x30')]:_0x4fd526[_0x83f1('0x2b')];if(!_0x327908['query'][_0x83f1('0x32')](_0x83f1('0x33'))){_0x46c96f[_0x83f1('0x1a')]=qs[_0x83f1('0x1a')](_0x327908[_0x83f1('0x2d')][_0x83f1('0x1a')]);_0x46c96f[_0x83f1('0x17')]=qs['offset'](_0x327908['query'][_0x83f1('0x17')]);}_0x46c96f[_0x83f1('0x34')]=qs[_0x83f1('0x35')](_0x327908[_0x83f1('0x2d')][_0x83f1('0x35')]);_0x46c96f[_0x83f1('0x36')]=qs[_0x83f1('0x37')](_[_0x83f1('0x38')](_0x327908[_0x83f1('0x2d')],_0x4fd526['filters']),_0x66d05);if(_0x327908['query'][_0x83f1('0x39')]){_0x46c96f[_0x83f1('0x36')]=_[_0x83f1('0x3a')](_0x46c96f[_0x83f1('0x36')],{'$or':_[_0x83f1('0x26')](_0x66d05,function(_0x5bcb22){if(_0x5bcb22['type']!==_0x83f1('0x3b')){var _0x20e3ad={};_0x20e3ad[_0x5bcb22[_0x83f1('0x24')]]={'$like':'%'+_0x327908[_0x83f1('0x2d')][_0x83f1('0x39')]+'%'};return _0x20e3ad;}})});}_0x46c96f=_[_0x83f1('0x3a')]({},_0x46c96f,_0x327908[_0x83f1('0x3c')]);var _0x58215e={'where':_0x46c96f[_0x83f1('0x36')]};return db[_0x83f1('0x3d')][_0x83f1('0x19')](_0x58215e)[_0x83f1('0x22')](function(_0x20560e){_0x5a2e04['count']=_0x20560e;if(_0x327908[_0x83f1('0x2d')]['includeAll']){_0x46c96f['include']=[{'all':!![]}];}return db[_0x83f1('0x3d')][_0x83f1('0x3e')](_0x46c96f);})[_0x83f1('0x22')](function(_0x268f8d){_0x5a2e04[_0x83f1('0x3f')]=_0x268f8d;return _0x5a2e04;})[_0x83f1('0x22')](respondWithFilteredResult(_0x22f43a,_0x46c96f))[_0x83f1('0x40')](handleError(_0x22f43a,null));};exports['show']=function(_0x5aa41b,_0xdf18cb){var _0x1fb614={'raw':!![],'where':{'id':_0x5aa41b[_0x83f1('0x41')]['id']}},_0x225a07={};_0x225a07[_0x83f1('0x2b')]=_[_0x83f1('0x2c')](db[_0x83f1('0x3d')]['rawAttributes']);_0x225a07[_0x83f1('0x2d')]=_[_0x83f1('0x2c')](_0x5aa41b[_0x83f1('0x2d')]);_0x225a07[_0x83f1('0x37')]=_[_0x83f1('0x2e')](_0x225a07[_0x83f1('0x2b')],_0x225a07['query']);_0x1fb614[_0x83f1('0x30')]=_[_0x83f1('0x2e')](_0x225a07[_0x83f1('0x2b')],qs[_0x83f1('0x2f')](_0x5aa41b[_0x83f1('0x2d')]['fields']));_0x1fb614[_0x83f1('0x30')]=_0x1fb614[_0x83f1('0x30')]['length']?_0x1fb614[_0x83f1('0x30')]:_0x225a07[_0x83f1('0x2b')];if(_0x5aa41b['query'][_0x83f1('0x42')]){_0x1fb614[_0x83f1('0x43')]=[{'all':!![]}];}_0x1fb614=_[_0x83f1('0x3a')]({},_0x1fb614,_0x5aa41b['options']);return db[_0x83f1('0x3d')]['find'](_0x1fb614)['then'](handleEntityNotFound(_0xdf18cb,null))[_0x83f1('0x22')](respondWithResult(_0xdf18cb,null))['catch'](handleError(_0xdf18cb,null));};exports['create']=function(_0x463127,_0x330587){return db[_0x83f1('0x3d')][_0x83f1('0x44')](_0x463127['body'],{})[_0x83f1('0x22')](respondWithResult(_0x330587,0xc9))[_0x83f1('0x40')](handleError(_0x330587,null));};exports[_0x83f1('0x20')]=function(_0x27a9c0,_0x58b359){if(_0x27a9c0[_0x83f1('0x45')]['id']){delete _0x27a9c0[_0x83f1('0x45')]['id'];}return db['ZendeskField'][_0x83f1('0x46')]({'where':{'id':_0x27a9c0[_0x83f1('0x41')]['id']}})[_0x83f1('0x22')](handleEntityNotFound(_0x58b359,null))[_0x83f1('0x22')](saveUpdates(_0x27a9c0[_0x83f1('0x45')],null))['then'](respondWithResult(_0x58b359,null))['catch'](handleError(_0x58b359,null));};exports[_0x83f1('0x21')]=function(_0x215b2b,_0x53460f){return db[_0x83f1('0x3d')][_0x83f1('0x46')]({'where':{'id':_0x215b2b[_0x83f1('0x41')]['id']}})[_0x83f1('0x22')](handleEntityNotFound(_0x53460f,null))[_0x83f1('0x22')](removeEntity(_0x53460f,null))[_0x83f1('0x40')](handleError(_0x53460f,null));}; \ No newline at end of file +var _0xa4fa=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','sendStatus','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model'];(function(_0x8f51ff,_0x562aa6){var _0x2c8509=function(_0x95066e){while(--_0x95066e){_0x8f51ff['push'](_0x8f51ff['shift']());}};_0x2c8509(++_0x562aa6);}(_0xa4fa,0x1ca));var _0xaa4f=function(_0x4dafe6,_0x232a91){_0x4dafe6=_0x4dafe6-0x0;var _0x2fa0dc=_0xa4fa[_0x4dafe6];return _0x2fa0dc;};'use strict';var emlformat=require(_0xaa4f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaa4f('0x1'));var rp=require(_0xaa4f('0x2'));var moment=require('moment');var BPromise=require(_0xaa4f('0x3'));var Mustache=require(_0xaa4f('0x4'));var util=require('util');var path=require(_0xaa4f('0x5'));var sox=require('sox');var csv=require(_0xaa4f('0x6'));var ejs=require(_0xaa4f('0x7'));var fs=require('fs');var fs_extra=require(_0xaa4f('0x8'));var _=require(_0xaa4f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaa4f('0xa'));var deskjs=require(_0xaa4f('0xb'));var toCsv=require(_0xaa4f('0x6'));var querystring=require(_0xaa4f('0xc'));var Papa=require(_0xaa4f('0xd'));var Redis=require(_0xaa4f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa4f('0xf'));var logger=require('../../config/logger')(_0xaa4f('0x10'));var utils=require(_0xaa4f('0x11'));var config=require(_0xaa4f('0x12'));var licenseUtil=require(_0xaa4f('0x13'));var db=require(_0xaa4f('0x14'))['db'];function respondWithStatusCode(_0x5eb032,_0x2199e2){_0x2199e2=_0x2199e2||0xcc;return function(_0x4ad2f4){if(_0x4ad2f4){return _0x5eb032['sendStatus'](_0x2199e2);}return _0x5eb032[_0xaa4f('0x15')](_0x2199e2)['end']();};}function respondWithResult(_0x7848b1,_0x5ad081){_0x5ad081=_0x5ad081||0xc8;return function(_0x3626d1){if(_0x3626d1){return _0x7848b1[_0xaa4f('0x15')](_0x5ad081)[_0xaa4f('0x16')](_0x3626d1);}};}function respondWithFilteredResult(_0x14d6c6,_0x37241f){return function(_0x4b441b){if(_0x4b441b){var _0x548e38=typeof _0x37241f[_0xaa4f('0x17')]===_0xaa4f('0x18')&&typeof _0x37241f[_0xaa4f('0x19')]===_0xaa4f('0x18');var _0x5350d1=_0x4b441b[_0xaa4f('0x1a')];var _0x37d842=_0x548e38?0x0:_0x37241f[_0xaa4f('0x17')];var _0x40316d=_0x548e38?_0x4b441b[_0xaa4f('0x1a')]:_0x37241f['offset']+_0x37241f['limit'];var _0xb6b639;if(_0x40316d>=_0x5350d1){_0x40316d=_0x5350d1;_0xb6b639=0xc8;}else{_0xb6b639=0xce;}_0x14d6c6['status'](_0xb6b639);return _0x14d6c6[_0xaa4f('0x1b')](_0xaa4f('0x1c'),_0x37d842+'-'+_0x40316d+'/'+_0x5350d1)[_0xaa4f('0x16')](_0x4b441b);}return null;};}function patchUpdates(_0xa6f9f5){return function(_0x1e72a7){try{jsonpatch['apply'](_0x1e72a7,_0xa6f9f5,!![]);}catch(_0x41d160){return BPromise[_0xaa4f('0x1d')](_0x41d160);}return _0x1e72a7[_0xaa4f('0x1e')]();};}function saveUpdates(_0x2e9424,_0x32cb4f){return function(_0x50e03d){if(_0x50e03d){return _0x50e03d['update'](_0x2e9424)[_0xaa4f('0x1f')](function(_0x155220){return _0x155220;});}return null;};}function removeEntity(_0x1293fe,_0x14bdc9){return function(_0x2256d6){if(_0x2256d6){return _0x2256d6[_0xaa4f('0x20')]()[_0xaa4f('0x1f')](function(){_0x1293fe[_0xaa4f('0x15')](0xcc)[_0xaa4f('0x21')]();});}};}function handleEntityNotFound(_0x3de504,_0x3bfe9d){return function(_0x383e79){if(!_0x383e79){_0x3de504[_0xaa4f('0x22')](0x194);}return _0x383e79;};}function handleError(_0x1594da,_0x59bb12){_0x59bb12=_0x59bb12||0x1f4;return function(_0x48d089){logger['error'](_0x48d089[_0xaa4f('0x23')]);if(_0x48d089['name']){delete _0x48d089[_0xaa4f('0x24')];}_0x1594da[_0xaa4f('0x15')](_0x59bb12)[_0xaa4f('0x25')](_0x48d089);};}exports[_0xaa4f('0x26')]=function(_0x49ec43,_0x354566){var _0x37b018={},_0x2dd902={},_0x40a379={'count':0x0,'rows':[]};var _0x173d7e=_[_0xaa4f('0x27')](db[_0xaa4f('0x28')][_0xaa4f('0x29')],function(_0x5c5fa3){return{'name':_0x5c5fa3[_0xaa4f('0x2a')],'type':_0x5c5fa3[_0xaa4f('0x2b')][_0xaa4f('0x2c')]};});_0x2dd902[_0xaa4f('0x2d')]=_[_0xaa4f('0x27')](_0x173d7e,_0xaa4f('0x24'));_0x2dd902[_0xaa4f('0x2e')]=_['keys'](_0x49ec43[_0xaa4f('0x2e')]);_0x2dd902[_0xaa4f('0x2f')]=_[_0xaa4f('0x30')](_0x2dd902[_0xaa4f('0x2d')],_0x2dd902[_0xaa4f('0x2e')]);_0x37b018[_0xaa4f('0x31')]=_[_0xaa4f('0x30')](_0x2dd902[_0xaa4f('0x2d')],qs[_0xaa4f('0x32')](_0x49ec43[_0xaa4f('0x2e')]['fields']));_0x37b018[_0xaa4f('0x31')]=_0x37b018[_0xaa4f('0x31')][_0xaa4f('0x33')]?_0x37b018[_0xaa4f('0x31')]:_0x2dd902['model'];if(!_0x49ec43[_0xaa4f('0x2e')][_0xaa4f('0x34')](_0xaa4f('0x35'))){_0x37b018[_0xaa4f('0x19')]=qs['limit'](_0x49ec43[_0xaa4f('0x2e')]['limit']);_0x37b018[_0xaa4f('0x17')]=qs[_0xaa4f('0x17')](_0x49ec43[_0xaa4f('0x2e')]['offset']);}_0x37b018[_0xaa4f('0x36')]=qs['sort'](_0x49ec43[_0xaa4f('0x2e')][_0xaa4f('0x37')]);_0x37b018[_0xaa4f('0x38')]=qs[_0xaa4f('0x2f')](_['pick'](_0x49ec43[_0xaa4f('0x2e')],_0x2dd902[_0xaa4f('0x2f')]),_0x173d7e);if(_0x49ec43[_0xaa4f('0x2e')][_0xaa4f('0x39')]){_0x37b018[_0xaa4f('0x38')]=_[_0xaa4f('0x3a')](_0x37b018['where'],{'$or':_['map'](_0x173d7e,function(_0xa5933b){if(_0xa5933b[_0xaa4f('0x2b')]!==_0xaa4f('0x3b')){var _0x5bf4bf={};_0x5bf4bf[_0xa5933b[_0xaa4f('0x24')]]={'$like':'%'+_0x49ec43[_0xaa4f('0x2e')]['filter']+'%'};return _0x5bf4bf;}})});}_0x37b018=_['merge']({},_0x37b018,_0x49ec43[_0xaa4f('0x3c')]);var _0x1d065f={'where':_0x37b018[_0xaa4f('0x38')]};return db['ZendeskField'][_0xaa4f('0x1a')](_0x1d065f)['then'](function(_0x4511d4){_0x40a379[_0xaa4f('0x1a')]=_0x4511d4;if(_0x49ec43[_0xaa4f('0x2e')][_0xaa4f('0x3d')]){_0x37b018[_0xaa4f('0x3e')]=[{'all':!![]}];}return db[_0xaa4f('0x28')][_0xaa4f('0x3f')](_0x37b018);})[_0xaa4f('0x1f')](function(_0x2479ab){_0x40a379[_0xaa4f('0x40')]=_0x2479ab;return _0x40a379;})[_0xaa4f('0x1f')](respondWithFilteredResult(_0x354566,_0x37b018))[_0xaa4f('0x41')](handleError(_0x354566,null));};exports[_0xaa4f('0x42')]=function(_0xdaa410,_0x372275){var _0x598b81={'raw':!![],'where':{'id':_0xdaa410[_0xaa4f('0x43')]['id']}},_0x5dbcbe={};_0x5dbcbe[_0xaa4f('0x2d')]=_[_0xaa4f('0x44')](db[_0xaa4f('0x28')][_0xaa4f('0x29')]);_0x5dbcbe[_0xaa4f('0x2e')]=_['keys'](_0xdaa410[_0xaa4f('0x2e')]);_0x5dbcbe[_0xaa4f('0x2f')]=_['intersection'](_0x5dbcbe[_0xaa4f('0x2d')],_0x5dbcbe[_0xaa4f('0x2e')]);_0x598b81[_0xaa4f('0x31')]=_[_0xaa4f('0x30')](_0x5dbcbe['model'],qs[_0xaa4f('0x32')](_0xdaa410[_0xaa4f('0x2e')][_0xaa4f('0x32')]));_0x598b81['attributes']=_0x598b81[_0xaa4f('0x31')]['length']?_0x598b81[_0xaa4f('0x31')]:_0x5dbcbe[_0xaa4f('0x2d')];if(_0xdaa410['query'][_0xaa4f('0x3d')]){_0x598b81[_0xaa4f('0x3e')]=[{'all':!![]}];}_0x598b81=_[_0xaa4f('0x3a')]({},_0x598b81,_0xdaa410['options']);return db[_0xaa4f('0x28')][_0xaa4f('0x45')](_0x598b81)[_0xaa4f('0x1f')](handleEntityNotFound(_0x372275,null))['then'](respondWithResult(_0x372275,null))['catch'](handleError(_0x372275,null));};exports[_0xaa4f('0x46')]=function(_0x24e379,_0x7f4713){return db['ZendeskField']['create'](_0x24e379[_0xaa4f('0x47')],{})['then'](respondWithResult(_0x7f4713,0xc9))['catch'](handleError(_0x7f4713,null));};exports['update']=function(_0x456449,_0x33ebcc){if(_0x456449['body']['id']){delete _0x456449[_0xaa4f('0x47')]['id'];}return db[_0xaa4f('0x28')][_0xaa4f('0x45')]({'where':{'id':_0x456449[_0xaa4f('0x43')]['id']}})[_0xaa4f('0x1f')](handleEntityNotFound(_0x33ebcc,null))[_0xaa4f('0x1f')](saveUpdates(_0x456449['body'],null))[_0xaa4f('0x1f')](respondWithResult(_0x33ebcc,null))[_0xaa4f('0x41')](handleError(_0x33ebcc,null));};exports[_0xaa4f('0x20')]=function(_0x3a4753,_0x2f6039){return db[_0xaa4f('0x28')]['find']({'where':{'id':_0x3a4753[_0xaa4f('0x43')]['id']}})[_0xaa4f('0x1f')](handleEntityNotFound(_0x2f6039,null))[_0xaa4f('0x1f')](removeEntity(_0x2f6039,null))[_0xaa4f('0x41')](handleError(_0x2f6039,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8c20f32..a0ac805 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 _0x28ee=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x28ee,0x148));var _0xe28e=function(_0x23e02e,_0x4d26cb){_0x23e02e=_0x23e02e-0x0;var _0x2a6db8=_0x28ee[_0x23e02e];return _0x2a6db8;};'use strict';var _=require(_0xe28e('0x0'));var util=require(_0xe28e('0x1'));var logger=require(_0xe28e('0x2'))(_0xe28e('0x3'));var moment=require(_0xe28e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe28e('0x5'));var fs=require('fs');var path=require(_0xe28e('0x6'));var rimraf=require(_0xe28e('0x7'));var config=require(_0xe28e('0x8'));var attributes=require(_0xe28e('0x9'));module[_0xe28e('0xa')]=function(_0x482383,_0x1b14c9){return _0x482383['define'](_0xe28e('0xb'),attributes,{'tableName':_0xe28e('0xc'),'paranoid':![],'indexes':[{'name':_0xe28e('0xd'),'fields':[_0xe28e('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc8bf=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId'];(function(_0x2744a4,_0x50f773){var _0x18c5d4=function(_0x55b5ac){while(--_0x55b5ac){_0x2744a4['push'](_0x2744a4['shift']());}};_0x18c5d4(++_0x50f773);}(_0xc8bf,0xd0));var _0xfc8b=function(_0x47cb4c,_0x24e098){_0x47cb4c=_0x47cb4c-0x0;var _0x1b7a54=_0xc8bf[_0x47cb4c];return _0x1b7a54;};'use strict';var _=require(_0xfc8b('0x0'));var util=require(_0xfc8b('0x1'));var logger=require(_0xfc8b('0x2'))(_0xfc8b('0x3'));var moment=require(_0xfc8b('0x4'));var BPromise=require('bluebird');var rp=require(_0xfc8b('0x5'));var fs=require('fs');var path=require(_0xfc8b('0x6'));var rimraf=require(_0xfc8b('0x7'));var config=require(_0xfc8b('0x8'));var attributes=require(_0xfc8b('0x9'));module[_0xfc8b('0xa')]=function(_0x3f6e67,_0x1591a6){return _0x3f6e67[_0xfc8b('0xb')](_0xfc8b('0xc'),attributes,{'tableName':_0xfc8b('0xd'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xfc8b('0xe'),_0xfc8b('0xf')],'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 5a85112..6c46abf 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 _0x6801=['info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6801,0x17e));var _0x1680=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6801[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1680('0x0'));var util=require(_0x1680('0x1'));var moment=require(_0x1680('0x2'));var BPromise=require(_0x1680('0x3'));var rs=require(_0x1680('0x4'));var fs=require('fs');var Redis=require(_0x1680('0x5'));var db=require(_0x1680('0x6'))['db'];var utils=require(_0x1680('0x7'));var logger=require('../../config/logger')(_0x1680('0x8'));var config=require(_0x1680('0x9'));var jayson=require(_0x1680('0xa'));var client=jayson[_0x1680('0xb')][_0x1680('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8e1338,_0x11caa7,_0x165bdc){return new BPromise(function(_0x4333fb,_0x4f7e2e){return client[_0x1680('0xd')](_0x8e1338,_0x165bdc)['then'](function(_0x5470cc){logger[_0x1680('0xe')](_0x1680('0xf'),_0x11caa7,'request\x20sent');logger[_0x1680('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x11caa7,_0x1680('0x11'),JSON['stringify'](_0x5470cc));if(_0x5470cc[_0x1680('0x12')]){if(_0x5470cc[_0x1680('0x12')]['code']===0x1f4){logger[_0x1680('0x12')](_0x1680('0xf'),_0x11caa7,_0x5470cc['error'][_0x1680('0x13')]);return _0x4f7e2e(_0x5470cc[_0x1680('0x12')]['message']);}logger[_0x1680('0x12')](_0x1680('0xf'),_0x11caa7,_0x5470cc[_0x1680('0x12')]['message']);return _0x4333fb(_0x5470cc[_0x1680('0x12')][_0x1680('0x13')]);}else{logger[_0x1680('0xe')]('ZendeskField,\x20%s,\x20%s',_0x11caa7,_0x1680('0x11'));_0x4333fb(_0x5470cc[_0x1680('0x14')][_0x1680('0x13')]);}})[_0x1680('0x15')](function(_0x5161c4){logger[_0x1680('0x12')](_0x1680('0xf'),_0x11caa7,_0x5161c4);_0x4f7e2e(_0x5161c4);});});} \ No newline at end of file +var _0x8798=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result'];(function(_0x36888d,_0x22988e){var _0x14f524=function(_0x5cdbfe){while(--_0x5cdbfe){_0x36888d['push'](_0x36888d['shift']());}};_0x14f524(++_0x22988e);}(_0x8798,0x180));var _0x8879=function(_0x3e6644,_0x31b39b){_0x3e6644=_0x3e6644-0x0;var _0x483ed4=_0x8798[_0x3e6644];return _0x483ed4;};'use strict';var _=require('lodash');var util=require(_0x8879('0x0'));var moment=require(_0x8879('0x1'));var BPromise=require('bluebird');var rs=require(_0x8879('0x2'));var fs=require('fs');var Redis=require(_0x8879('0x3'));var db=require(_0x8879('0x4'))['db'];var utils=require(_0x8879('0x5'));var logger=require(_0x8879('0x6'))(_0x8879('0x7'));var config=require(_0x8879('0x8'));var jayson=require(_0x8879('0x9'));var client=jayson[_0x8879('0xa')][_0x8879('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24103a,_0x4d2653,_0x2fc957){return new BPromise(function(_0x4f5e6f,_0x296916){return client[_0x8879('0xc')](_0x24103a,_0x2fc957)[_0x8879('0xd')](function(_0x110db6){logger[_0x8879('0xe')]('ZendeskField,\x20%s,\x20%s',_0x4d2653,_0x8879('0xf'));logger[_0x8879('0x10')](_0x8879('0x11'),_0x4d2653,'request\x20sent',JSON[_0x8879('0x12')](_0x110db6));if(_0x110db6[_0x8879('0x13')]){if(_0x110db6[_0x8879('0x13')][_0x8879('0x14')]===0x1f4){logger['error'](_0x8879('0x15'),_0x4d2653,_0x110db6[_0x8879('0x13')]['message']);return _0x296916(_0x110db6['error'][_0x8879('0x16')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x4d2653,_0x110db6['error'][_0x8879('0x16')]);return _0x4f5e6f(_0x110db6[_0x8879('0x13')][_0x8879('0x16')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x4d2653,_0x8879('0xf'));_0x4f5e6f(_0x110db6[_0x8879('0x17')][_0x8879('0x16')]);}})['catch'](function(_0x4c496e){logger[_0x8879('0x13')](_0x8879('0x15'),_0x4d2653,_0x4c496e);_0x296916(_0x4c496e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index d8f92b8..1d9f61b 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 _0x3e99=['addConfiguration','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x2d1dac,_0xa8a71){var _0x31d5f8=function(_0x532e19){while(--_0x532e19){_0x2d1dac['push'](_0x2d1dac['shift']());}};_0x31d5f8(++_0xa8a71);}(_0x3e99,0xdd));var _0x93e9=function(_0x6f443c,_0x49ea9d){_0x6f443c=_0x6f443c-0x0;var _0x35b14a=_0x3e99[_0x6f443c];return _0x35b14a;};'use strict';var multer=require(_0x93e9('0x0'));var util=require(_0x93e9('0x1'));var path=require(_0x93e9('0x2'));var timeout=require('connect-timeout');var express=require(_0x93e9('0x3'));var router=express[_0x93e9('0x4')]();var fs_extra=require(_0x93e9('0x5'));var auth=require(_0x93e9('0x6'));var interaction=require(_0x93e9('0x7'));var config=require(_0x93e9('0x8'));var controller=require('./intZohoAccount.controller');router[_0x93e9('0x9')]('/',auth[_0x93e9('0xa')](),controller[_0x93e9('0xb')]);router[_0x93e9('0x9')](_0x93e9('0xc'),auth[_0x93e9('0xa')](),controller[_0x93e9('0xd')]);router[_0x93e9('0x9')](_0x93e9('0xe'),auth['isAuthenticated'](),controller[_0x93e9('0xf')]);router[_0x93e9('0x9')](_0x93e9('0x10'),auth[_0x93e9('0xa')](),controller[_0x93e9('0x11')]);router[_0x93e9('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x93e9('0x12')](_0x93e9('0xe'),auth[_0x93e9('0xa')](),controller[_0x93e9('0x13')]);router[_0x93e9('0x14')](_0x93e9('0xc'),auth[_0x93e9('0xa')](),controller[_0x93e9('0x15')]);router['delete'](_0x93e9('0xc'),auth[_0x93e9('0xa')](),controller[_0x93e9('0x16')]);module[_0x93e9('0x17')]=router; \ No newline at end of file +var _0xb0c7=['update','destroy','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xb0c7,0x1bb));var _0x7b0c=function(_0x3f29bc,_0x102fa1){_0x3f29bc=_0x3f29bc-0x0;var _0x253de9=_0xb0c7[_0x3f29bc];return _0x253de9;};'use strict';var multer=require(_0x7b0c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7b0c('0x1'));var express=require(_0x7b0c('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7b0c('0x3'));var interaction=require(_0x7b0c('0x4'));var config=require(_0x7b0c('0x5'));var controller=require(_0x7b0c('0x6'));router[_0x7b0c('0x7')]('/',auth[_0x7b0c('0x8')](),controller[_0x7b0c('0x9')]);router[_0x7b0c('0x7')](_0x7b0c('0xa'),auth[_0x7b0c('0x8')](),controller[_0x7b0c('0xb')]);router['get'](_0x7b0c('0xc'),auth['isAuthenticated'](),controller[_0x7b0c('0xd')]);router[_0x7b0c('0x7')](_0x7b0c('0xe'),auth[_0x7b0c('0x8')](),controller[_0x7b0c('0xf')]);router[_0x7b0c('0x10')]('/',auth['isAuthenticated'](),controller[_0x7b0c('0x11')]);router[_0x7b0c('0x10')](_0x7b0c('0xc'),auth[_0x7b0c('0x8')](),controller[_0x7b0c('0x12')]);router['put'](_0x7b0c('0xa'),auth['isAuthenticated'](),controller[_0x7b0c('0x13')]);router['delete'](_0x7b0c('0xa'),auth[_0x7b0c('0x8')](),controller[_0x7b0c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9d0450d..fcb0534 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 _0xcb91=['STRING'];(function(_0x36cd94,_0x35fc01){var _0x47c580=function(_0x2779f2){while(--_0x2779f2){_0x36cd94['push'](_0x36cd94['shift']());}};_0x47c580(++_0x35fc01);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0xcb91[_0x29d2d2];return _0x3f6476;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1cb9('0x0')]},'description':{'type':Sequelize[_0x1cb9('0x0')]},'host':{'type':Sequelize[_0x1cb9('0x0')]},'zone':{'type':Sequelize[_0x1cb9('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1cb9('0x0')]},'serverUrl':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x1cb9('0x0')]}}; \ No newline at end of file +var _0xdace=['STRING','sequelize'];(function(_0x15a380,_0x1a4143){var _0x492282=function(_0x207bbb){while(--_0x207bbb){_0x15a380['push'](_0x15a380['shift']());}};_0x492282(++_0x1a4143);}(_0xdace,0xc5));var _0xedac=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0xdace[_0x4ded65];return _0x5864fb;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'description':{'type':Sequelize[_0xedac('0x1')]},'host':{'type':Sequelize[_0xedac('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xedac('0x1')]},'clientSecret':{'type':Sequelize[_0xedac('0x1')]},'serverUrl':{'type':Sequelize[_0xedac('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xedac('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index ec3ec80..3842c7b 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 _0xa59e=['ZohoConfiguration','rawAttributes','addConfiguration','findOne','Subjects','getSubjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','refreshToken','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoAccount','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','length','find','create','params','body','getConfigurations'];(function(_0x674647,_0xc4075d){var _0x17b027=function(_0x2ea30b){while(--_0x2ea30b){_0x674647['push'](_0x674647['shift']());}};_0x17b027(++_0xc4075d);}(_0xa59e,0x143));var _0xea59=function(_0x8df613,_0x14f158){_0x8df613=_0x8df613-0x0;var _0x2c34e1=_0xa59e[_0x8df613];return _0x2c34e1;};'use strict';var emlformat=require(_0xea59('0x0'));var rimraf=require(_0xea59('0x1'));var zipdir=require(_0xea59('0x2'));var jsonpatch=require(_0xea59('0x3'));var rp=require(_0xea59('0x4'));var moment=require(_0xea59('0x5'));var BPromise=require(_0xea59('0x6'));var Mustache=require(_0xea59('0x7'));var util=require(_0xea59('0x8'));var path=require(_0xea59('0x9'));var sox=require(_0xea59('0xa'));var csv=require(_0xea59('0xb'));var ejs=require(_0xea59('0xc'));var fs=require('fs');var fs_extra=require(_0xea59('0xd'));var _=require(_0xea59('0xe'));var squel=require(_0xea59('0xf'));var crypto=require(_0xea59('0x10'));var jsforce=require(_0xea59('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea59('0x12'));var Redis=require(_0xea59('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea59('0x14'));var hardwareService=require(_0xea59('0x15'));var logger=require(_0xea59('0x16'))(_0xea59('0x17'));var utils=require(_0xea59('0x18'));var config=require(_0xea59('0x19'));var licenseUtil=require(_0xea59('0x1a'));var db=require(_0xea59('0x1b'))['db'];var integrations=require(_0xea59('0x1c'));function respondWithStatusCode(_0x4c7a30,_0x465fb2){_0x465fb2=_0x465fb2||0xcc;return function(_0x421bec){if(_0x421bec){return _0x4c7a30['sendStatus'](_0x465fb2);}return _0x4c7a30[_0xea59('0x1d')](_0x465fb2)[_0xea59('0x1e')]();};}function respondWithResult(_0x167df8,_0x1e9e8c){_0x1e9e8c=_0x1e9e8c||0xc8;return function(_0x38e666){if(_0x38e666){return _0x167df8[_0xea59('0x1d')](_0x1e9e8c)['json'](_0x38e666);}};}function respondWithFilteredResult(_0x4b11fe,_0x1b01c0){return function(_0x2f1084){if(_0x2f1084){var _0x4a8838=typeof _0x1b01c0[_0xea59('0x1f')]==='undefined'&&typeof _0x1b01c0[_0xea59('0x20')]===_0xea59('0x21');var _0x4111fd=_0x2f1084[_0xea59('0x22')];var _0x3570b8=_0x4a8838?0x0:_0x1b01c0[_0xea59('0x1f')];var _0x2f41ac=_0x4a8838?_0x2f1084[_0xea59('0x22')]:_0x1b01c0['offset']+_0x1b01c0[_0xea59('0x20')];var _0x226790;if(_0x2f41ac>=_0x4111fd){_0x2f41ac=_0x4111fd;_0x226790=0xc8;}else{_0x226790=0xce;}_0x4b11fe[_0xea59('0x1d')](_0x226790);return _0x4b11fe[_0xea59('0x23')](_0xea59('0x24'),_0x3570b8+'-'+_0x2f41ac+'/'+_0x4111fd)[_0xea59('0x25')](_0x2f1084);}return null;};}function patchUpdates(_0x321888){return function(_0x45343a){try{jsonpatch[_0xea59('0x26')](_0x45343a,_0x321888,!![]);}catch(_0xa441d0){return BPromise[_0xea59('0x27')](_0xa441d0);}return _0x45343a[_0xea59('0x28')]();};}function saveUpdates(_0x52155a,_0x169090){return function(_0x4f8011){if(_0x4f8011){return _0x4f8011[_0xea59('0x29')](_0x52155a)[_0xea59('0x2a')](function(_0x24fd9b){return _0x24fd9b;});}return null;};}function removeEntity(_0x2cd6d9,_0x178bf5){return function(_0x1469ba){if(_0x1469ba){return _0x1469ba['destroy']()[_0xea59('0x2a')](function(){_0x2cd6d9[_0xea59('0x1d')](0xcc)[_0xea59('0x1e')]();});}};}function handleEntityNotFound(_0x3ca038,_0x3268e9){return function(_0x291ade){if(!_0x291ade){_0x3ca038[_0xea59('0x2b')](0x194);}return _0x291ade;};}function handleError(_0x3b8b50,_0x512dc0){_0x512dc0=_0x512dc0||0x1f4;return function(_0x3d2c7f){logger[_0xea59('0x2c')](_0x3d2c7f[_0xea59('0x2d')]);if(_0x3d2c7f[_0xea59('0x2e')]){delete _0x3d2c7f['name'];}_0x3b8b50[_0xea59('0x1d')](_0x512dc0)[_0xea59('0x2f')](_0x3d2c7f);};}exports[_0xea59('0x30')]=function(_0x43096c,_0x3c2c30){var _0xe84fef={},_0x27ae03={},_0x1a0ddb={'count':0x0,'rows':[]};var _0x53bd75=_[_0xea59('0x31')](db[_0xea59('0x32')]['rawAttributes'],function(_0x3c10f5){return{'name':_0x3c10f5[_0xea59('0x33')],'type':_0x3c10f5['type'][_0xea59('0x34')]};});_0x27ae03[_0xea59('0x35')]=_[_0xea59('0x31')](_0x53bd75,'name');_0x27ae03[_0xea59('0x36')]=_[_0xea59('0x37')](_0x43096c[_0xea59('0x36')]);_0x27ae03['filters']=_[_0xea59('0x38')](_0x27ae03[_0xea59('0x35')],_0x27ae03[_0xea59('0x36')]);_0xe84fef[_0xea59('0x39')]=_[_0xea59('0x38')](_0x27ae03['model'],qs[_0xea59('0x3a')](_0x43096c[_0xea59('0x36')][_0xea59('0x3a')]));_0xe84fef[_0xea59('0x39')]=_0xe84fef[_0xea59('0x39')]['length']?_0xe84fef[_0xea59('0x39')]:_0x27ae03['model'];if(!_0x43096c[_0xea59('0x36')][_0xea59('0x3b')](_0xea59('0x3c'))){_0xe84fef['limit']=qs[_0xea59('0x20')](_0x43096c[_0xea59('0x36')][_0xea59('0x20')]);_0xe84fef[_0xea59('0x1f')]=qs['offset'](_0x43096c['query'][_0xea59('0x1f')]);}_0xe84fef[_0xea59('0x3d')]=qs['sort'](_0x43096c['query'][_0xea59('0x3e')]);_0xe84fef[_0xea59('0x3f')]=qs['filters'](_[_0xea59('0x40')](_0x43096c['query'],_0x27ae03[_0xea59('0x41')]),_0x53bd75);if(_0x43096c[_0xea59('0x36')][_0xea59('0x42')]){_0xe84fef[_0xea59('0x3f')]=_[_0xea59('0x43')](_0xe84fef[_0xea59('0x3f')],{'$or':_[_0xea59('0x31')](_0x53bd75,function(_0x15e7b0){if(_0x15e7b0[_0xea59('0x44')]!==_0xea59('0x45')){var _0x58aa68={};_0x58aa68[_0x15e7b0[_0xea59('0x2e')]]={'$like':'%'+_0x43096c[_0xea59('0x36')]['filter']+'%'};return _0x58aa68;}})});}_0xe84fef=_[_0xea59('0x43')]({},_0xe84fef,_0x43096c[_0xea59('0x46')]);var _0x416af3={'where':_0xe84fef[_0xea59('0x3f')]};return db[_0xea59('0x32')][_0xea59('0x22')](_0x416af3)[_0xea59('0x2a')](function(_0x13627a){_0x1a0ddb[_0xea59('0x22')]=_0x13627a;if(_0x43096c[_0xea59('0x36')][_0xea59('0x47')]){_0xe84fef[_0xea59('0x48')]=[{'all':!![]}];}return db[_0xea59('0x32')][_0xea59('0x49')](_0xe84fef);})[_0xea59('0x2a')](function(_0x161ae4){_0x1a0ddb['rows']=_0x161ae4;return _0x1a0ddb;})[_0xea59('0x2a')](respondWithFilteredResult(_0x3c2c30,_0xe84fef))[_0xea59('0x4a')](handleError(_0x3c2c30,null));};exports[_0xea59('0x4b')]=function(_0xcadf3b,_0x278939){var _0x459385={'raw':![],'where':{'id':_0xcadf3b['params']['id']}},_0x181770={};_0x181770['model']=_['keys'](db['ZohoAccount']['rawAttributes']);_0x181770['query']=_['keys'](_0xcadf3b[_0xea59('0x36')]);_0x181770[_0xea59('0x41')]=_[_0xea59('0x38')](_0x181770[_0xea59('0x35')],_0x181770[_0xea59('0x36')]);_0x459385[_0xea59('0x39')]=_[_0xea59('0x38')](_0x181770[_0xea59('0x35')],qs[_0xea59('0x3a')](_0xcadf3b['query'][_0xea59('0x3a')]));_0x459385[_0xea59('0x39')]=_0x459385[_0xea59('0x39')][_0xea59('0x4c')]?_0x459385[_0xea59('0x39')]:_0x181770[_0xea59('0x35')];if(_0xcadf3b['query']['includeAll']){_0x459385[_0xea59('0x48')]=[{'all':!![]}];}_0x459385=_[_0xea59('0x43')]({},_0x459385,_0xcadf3b[_0xea59('0x46')]);return db[_0xea59('0x32')][_0xea59('0x4d')](_0x459385)['then'](handleEntityNotFound(_0x278939,null))[_0xea59('0x2a')](respondWithResult(_0x278939,null))[_0xea59('0x4a')](handleError(_0x278939,null));};exports[_0xea59('0x4e')]=function(_0x1ef1e4,_0x2ce640){return db['ZohoAccount'][_0xea59('0x4e')](_0x1ef1e4['body'],{})[_0xea59('0x2a')](respondWithResult(_0x2ce640,0xc9))['catch'](handleError(_0x2ce640,null));};exports['update']=function(_0x5f4d1e,_0xe0d63c){if(_0x5f4d1e['body']['id']){delete _0x5f4d1e['body']['id'];}return db[_0xea59('0x32')][_0xea59('0x4d')]({'where':{'id':_0x5f4d1e[_0xea59('0x4f')]['id']}})[_0xea59('0x2a')](handleEntityNotFound(_0xe0d63c,null))[_0xea59('0x2a')](saveUpdates(_0x5f4d1e[_0xea59('0x50')],null))[_0xea59('0x2a')](respondWithResult(_0xe0d63c,null))[_0xea59('0x4a')](handleError(_0xe0d63c,null));};exports['destroy']=function(_0xed7b56,_0x20fa69){return db['ZohoAccount'][_0xea59('0x4d')]({'where':{'id':_0xed7b56[_0xea59('0x4f')]['id']}})[_0xea59('0x2a')](handleEntityNotFound(_0x20fa69,null))[_0xea59('0x2a')](removeEntity(_0x20fa69,null))[_0xea59('0x4a')](handleError(_0x20fa69,null));};exports[_0xea59('0x51')]=function(_0x14fe95,_0x5a0d76,_0x361924){var _0x59065c={};var _0x37586e={};var _0x597fe1;var _0x4c2a15;return db[_0xea59('0x32')]['findOne']({'where':{'id':_0x14fe95['params']['id']}})['then'](handleEntityNotFound(_0x5a0d76,null))[_0xea59('0x2a')](function(_0x2d59e9){if(_0x2d59e9){_0x597fe1=_0x2d59e9;_0x37586e[_0xea59('0x35')]=_[_0xea59('0x37')](db[_0xea59('0x52')][_0xea59('0x53')]);_0x37586e[_0xea59('0x36')]=_[_0xea59('0x37')](_0x14fe95['query']);_0x37586e[_0xea59('0x41')]=_['intersection'](_0x37586e[_0xea59('0x35')],_0x37586e[_0xea59('0x36')]);_0x59065c[_0xea59('0x39')]=_['intersection'](_0x37586e[_0xea59('0x35')],qs[_0xea59('0x3a')](_0x14fe95[_0xea59('0x36')][_0xea59('0x3a')]));_0x59065c[_0xea59('0x39')]=_0x59065c['attributes'][_0xea59('0x4c')]?_0x59065c[_0xea59('0x39')]:_0x37586e[_0xea59('0x35')];_0x59065c[_0xea59('0x3d')]=qs['sort'](_0x14fe95[_0xea59('0x36')]['sort']);_0x59065c[_0xea59('0x3f')]=qs[_0xea59('0x41')](_[_0xea59('0x40')](_0x14fe95[_0xea59('0x36')],_0x37586e[_0xea59('0x41')]));if(_0x14fe95[_0xea59('0x36')]['filter']){_0x59065c[_0xea59('0x3f')]=_['merge'](_0x59065c[_0xea59('0x3f')],{'$or':_[_0xea59('0x31')](_0x59065c[_0xea59('0x39')],function(_0xca4989){var _0x5a43bf={};_0x5a43bf[_0xca4989]={'$like':'%'+_0x14fe95[_0xea59('0x36')][_0xea59('0x42')]+'%'};return _0x5a43bf;})});}_0x59065c=_[_0xea59('0x43')]({},_0x59065c,_0x14fe95[_0xea59('0x46')]);return _0x597fe1[_0xea59('0x51')](_0x59065c);}})[_0xea59('0x2a')](function(_0x50ceac){if(_0x50ceac){_0x4c2a15=_0x50ceac['length'];if(!_0x14fe95[_0xea59('0x36')]['hasOwnProperty'](_0xea59('0x3c'))){_0x59065c['limit']=qs[_0xea59('0x20')](_0x14fe95['query']['limit']);_0x59065c[_0xea59('0x1f')]=qs['offset'](_0x14fe95[_0xea59('0x36')][_0xea59('0x1f')]);}return _0x597fe1[_0xea59('0x51')](_0x59065c);}})[_0xea59('0x2a')](function(_0x467efe){if(_0x467efe){return _0x467efe?{'count':_0x4c2a15,'rows':_0x467efe}:null;}})['then'](respondWithResult(_0x5a0d76,null))[_0xea59('0x4a')](handleError(_0x5a0d76,null));};exports[_0xea59('0x54')]=function(_0x2fc75d,_0x18c5f7,_0x23c35e){if(_0x2fc75d['body']['id']){delete _0x2fc75d['body']['id'];}return db[_0xea59('0x32')][_0xea59('0x55')]({'where':{'id':_0x2fc75d[_0xea59('0x4f')]['id']}})[_0xea59('0x2a')](handleEntityNotFound(_0x18c5f7,null))[_0xea59('0x2a')](function(_0x277ed5){if(_0x277ed5){_0x2fc75d[_0xea59('0x50')]['AccountId']=_0x277ed5['id'];_0x2fc75d[_0xea59('0x50')][_0xea59('0x56')]=integrations[_0xea59('0x57')](_0x2fc75d[_0xea59('0x50')][_0xea59('0x58')],_0x2fc75d[_0xea59('0x50')][_0xea59('0x44')]);_0x2fc75d['body']['Descriptions']=integrations['getDescriptions'](_0x2fc75d[_0xea59('0x50')][_0xea59('0x58')],_0x2fc75d['body']['type']);return db[_0xea59('0x52')][_0xea59('0x4e')](_0x2fc75d[_0xea59('0x50')],{'include':[{'model':db[_0xea59('0x59')],'as':_0xea59('0x56')},{'model':db[_0xea59('0x59')],'as':_0xea59('0x5a')}]});}return null;})[_0xea59('0x2a')](respondWithResult(_0x18c5f7,null))[_0xea59('0x4a')](handleError(_0x18c5f7,null));};function getAccessToken(_0xc64cb9){return new Promise(function(_0x245798,_0x275d96){var _0x4767e8;switch(_0xc64cb9[_0xea59('0x5b')]){case'US':_0x4767e8='https://accounts.zoho.com';break;case'AU':_0x4767e8=_0xea59('0x5c');break;case'EU':_0x4767e8=_0xea59('0x5d');break;case'IN':_0x4767e8=_0xea59('0x5e');break;case'CN':_0x4767e8=_0xea59('0x5f');break;default:_0x4767e8=_0xea59('0x5d');break;}var _0x1e2149={'method':'POST','uri':_0x4767e8+_0xea59('0x60'),'qs':{'refresh_token':_0xc64cb9['refreshToken'],'client_id':_0xc64cb9[_0xea59('0x61')],'client_secret':_0xc64cb9[_0xea59('0x62')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1e2149)[_0xea59('0x2a')](function(_0x29eefe){if(_0x29eefe['access_token']){_0x245798(_0x29eefe[_0xea59('0x63')]);}else{_0x275d96(_0xea59('0x64'));}})[_0xea59('0x4a')](function(_0x162ed7){_0x275d96(_0x162ed7);});});}exports[_0xea59('0x65')]=function(_0x2ad5a9,_0x405da9,_0x4a977d){var _0x150341,_0x152a39,_0xf8a6bf,_0x1cd7d4,_0x38150e;return db['ZohoAccount'][_0xea59('0x55')]({'where':{'id':_0x2ad5a9[_0xea59('0x4f')]['id']},'attributes':['id',_0xea59('0x66'),'zone',_0xea59('0x61'),_0xea59('0x62'),'serverUrl',_0xea59('0x67'),_0xea59('0x68')]})[_0xea59('0x2a')](handleEntityNotFound(_0x405da9,null))[_0xea59('0x2a')](function(_0x145497){_0x38150e=_0x145497;_0x150341=_0x38150e[_0xea59('0x66')];_0x152a39=_0x150341==='zoho.eu'?'eu':_0xea59('0x69');_0xf8a6bf=_0x38150e[_0xea59('0x6a')];var _0x126878=_0xf8a6bf[_0xea59('0x6b')](-0x1);if(_0x126878==='/'||_0x126878==='\x5c'||_0x126878===':'){_0xf8a6bf=_0xf8a6bf[_0xea59('0x6c')](0x0,_0xf8a6bf[_0xea59('0x6d')](_0x126878));}if(!_0x38150e[_0xea59('0x68')]){throw new Error(_0xea59('0x6e'));}return getAccessToken(_0x38150e);})[_0xea59('0x2a')](function(_0x4aaf98){if(_0x4aaf98){return rp({'method':_0xea59('0x6f'),'uri':util[_0xea59('0x70')](_0xea59('0x71'),_0x152a39),'qs':{'module':_0xea59('0x72')},'headers':{'Authorization':_0xea59('0x73')+_0x4aaf98},'json':!![]});}})[_0xea59('0x2a')](function(_0x22ba3b){if(_0x22ba3b){if(_0x22ba3b[_0xea59('0x74')]&&_0x22ba3b[_0xea59('0x74')][_0xea59('0x2c')]){throw new Error(_0x22ba3b['response']['error']['message']);}var _0x56c23e=[];var _0xd48026=[];var _0x371780=[_0xea59('0x75'),_0xea59('0x76'),_0xea59('0x77'),_0xea59('0x78'),_0xea59('0x79'),_0xea59('0x7a'),_0xea59('0x7b'),_0xea59('0x7c')];_0xd48026=_['remove'](_0x22ba3b[_0xea59('0x3a')],function(_0x3b6279){return _0x371780[_0xea59('0x7d')](_0x3b6279[_0xea59('0x7e')]);});for(var _0x1717c3=0x0;_0x1717c3<_0xd48026['length'];_0x1717c3++){if(_0xd48026[_0x1717c3][_0xea59('0x7f')]===![]){_0x56c23e[_0xea59('0x80')]({'id':_0xd48026[_0x1717c3]['id'],'name':_0xd48026[_0x1717c3]['display_label'],'custom':_0xd48026[_0x1717c3]['custom_field'],'options':_0xd48026[_0x1717c3]['data_type']===_0xea59('0x81')&&_0xd48026[_0x1717c3][_0xea59('0x82')][_0xea59('0x4c')]>-0x1?_[_0xea59('0x31')](_0xd48026[_0x1717c3][_0xea59('0x82')],function(_0x4730d6){return{'name':_0x4730d6,'value':_0x4730d6};}):[]});}}return{'count':_0x56c23e[_0xea59('0x4c')],'rows':_0x56c23e};}else{return{'count':0x0,'rows':[]};}})[_0xea59('0x2a')](respondWithResult(_0x405da9,null))['catch'](function(_0x12f3c5){var _0x58bfbd=_0x2ad5a9[_0xea59('0x36')][_0xea59('0x83')]?0x1f4:_0x12f3c5[_0xea59('0x84')]||0x1f4;logger['error'](_0xea59('0x85'),_0xea59('0x65'),_0x58bfbd,JSON['stringify'](_0x12f3c5));delete _0x12f3c5[_0xea59('0x2e')];if(_0x58bfbd===0x191){_0x58bfbd=0x190;}_0x405da9['status'](_0x58bfbd)[_0xea59('0x2f')](_0x2ad5a9[_0xea59('0x36')][_0xea59('0x83')]?{'message':_0xea59('0x86'),'statusCode':_0x12f3c5['statusCode']}:_0x12f3c5);});}; \ No newline at end of file +var _0x8b2a=['show','params','include','find','catch','create','body','ZohoConfiguration','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','refreshToken','zoho.eu','com','serverUrl','slice','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','WhoId','Call_Duration','Call_Start_Time','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows'];(function(_0x3ad4a5,_0xb54726){var _0x5d2a70=function(_0x263ae2){while(--_0x263ae2){_0x3ad4a5['push'](_0x3ad4a5['shift']());}};_0x5d2a70(++_0xb54726);}(_0x8b2a,0x1ce));var _0xa8b2=function(_0x390e6c,_0x4d7d42){_0x390e6c=_0x390e6c-0x0;var _0x596b05=_0x8b2a[_0x390e6c];return _0x596b05;};'use strict';var emlformat=require(_0xa8b2('0x0'));var rimraf=require(_0xa8b2('0x1'));var zipdir=require(_0xa8b2('0x2'));var jsonpatch=require(_0xa8b2('0x3'));var rp=require(_0xa8b2('0x4'));var moment=require(_0xa8b2('0x5'));var BPromise=require(_0xa8b2('0x6'));var Mustache=require(_0xa8b2('0x7'));var util=require(_0xa8b2('0x8'));var path=require('path');var sox=require(_0xa8b2('0x9'));var csv=require(_0xa8b2('0xa'));var ejs=require(_0xa8b2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa8b2('0xc'));var crypto=require(_0xa8b2('0xd'));var jsforce=require(_0xa8b2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa8b2('0xa'));var querystring=require('querystring');var Papa=require(_0xa8b2('0xf'));var Redis=require(_0xa8b2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa8b2('0x11'));var as=require(_0xa8b2('0x12'));var hardwareService=require(_0xa8b2('0x13'));var logger=require(_0xa8b2('0x14'))(_0xa8b2('0x15'));var utils=require(_0xa8b2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa8b2('0x17'))['db'];var integrations=require(_0xa8b2('0x18'));function respondWithStatusCode(_0x36d628,_0x2524c3){_0x2524c3=_0x2524c3||0xcc;return function(_0x1f9431){if(_0x1f9431){return _0x36d628['sendStatus'](_0x2524c3);}return _0x36d628[_0xa8b2('0x19')](_0x2524c3)[_0xa8b2('0x1a')]();};}function respondWithResult(_0x3c0fa8,_0x209014){_0x209014=_0x209014||0xc8;return function(_0x468e20){if(_0x468e20){return _0x3c0fa8['status'](_0x209014)['json'](_0x468e20);}};}function respondWithFilteredResult(_0x22ec9b,_0x50850f){return function(_0x3a5378){if(_0x3a5378){var _0x24990b=typeof _0x50850f[_0xa8b2('0x1b')]==='undefined'&&typeof _0x50850f[_0xa8b2('0x1c')]===_0xa8b2('0x1d');var _0x12c910=_0x3a5378['count'];var _0x1bc343=_0x24990b?0x0:_0x50850f[_0xa8b2('0x1b')];var _0x36c31b=_0x24990b?_0x3a5378[_0xa8b2('0x1e')]:_0x50850f['offset']+_0x50850f[_0xa8b2('0x1c')];var _0x1dced1;if(_0x36c31b>=_0x12c910){_0x36c31b=_0x12c910;_0x1dced1=0xc8;}else{_0x1dced1=0xce;}_0x22ec9b[_0xa8b2('0x19')](_0x1dced1);return _0x22ec9b['set'](_0xa8b2('0x1f'),_0x1bc343+'-'+_0x36c31b+'/'+_0x12c910)[_0xa8b2('0x20')](_0x3a5378);}return null;};}function patchUpdates(_0x455b2f){return function(_0x5c6e7c){try{jsonpatch['apply'](_0x5c6e7c,_0x455b2f,!![]);}catch(_0x50fcd6){return BPromise[_0xa8b2('0x21')](_0x50fcd6);}return _0x5c6e7c[_0xa8b2('0x22')]();};}function saveUpdates(_0x498cdc,_0x468890){return function(_0x6fd746){if(_0x6fd746){return _0x6fd746[_0xa8b2('0x23')](_0x498cdc)['then'](function(_0x58d154){return _0x58d154;});}return null;};}function removeEntity(_0x232ada,_0x57f277){return function(_0x3240f8){if(_0x3240f8){return _0x3240f8[_0xa8b2('0x24')]()[_0xa8b2('0x25')](function(){_0x232ada['status'](0xcc)[_0xa8b2('0x1a')]();});}};}function handleEntityNotFound(_0x36eb8a,_0x13d45f){return function(_0x1458fe){if(!_0x1458fe){_0x36eb8a[_0xa8b2('0x26')](0x194);}return _0x1458fe;};}function handleError(_0x52f0b6,_0x127041){_0x127041=_0x127041||0x1f4;return function(_0x338fc0){logger[_0xa8b2('0x27')](_0x338fc0[_0xa8b2('0x28')]);if(_0x338fc0[_0xa8b2('0x29')]){delete _0x338fc0['name'];}_0x52f0b6['status'](_0x127041)[_0xa8b2('0x2a')](_0x338fc0);};}exports[_0xa8b2('0x2b')]=function(_0x11c465,_0x5c119){var _0x33f28a={},_0x187735={},_0x1826c2={'count':0x0,'rows':[]};var _0x2a150a=_[_0xa8b2('0x2c')](db[_0xa8b2('0x2d')][_0xa8b2('0x2e')],function(_0x3480a0){return{'name':_0x3480a0[_0xa8b2('0x2f')],'type':_0x3480a0[_0xa8b2('0x30')][_0xa8b2('0x31')]};});_0x187735[_0xa8b2('0x32')]=_[_0xa8b2('0x2c')](_0x2a150a,_0xa8b2('0x29'));_0x187735['query']=_[_0xa8b2('0x33')](_0x11c465[_0xa8b2('0x34')]);_0x187735[_0xa8b2('0x35')]=_[_0xa8b2('0x36')](_0x187735[_0xa8b2('0x32')],_0x187735[_0xa8b2('0x34')]);_0x33f28a[_0xa8b2('0x37')]=_[_0xa8b2('0x36')](_0x187735[_0xa8b2('0x32')],qs[_0xa8b2('0x38')](_0x11c465['query']['fields']));_0x33f28a[_0xa8b2('0x37')]=_0x33f28a[_0xa8b2('0x37')][_0xa8b2('0x39')]?_0x33f28a[_0xa8b2('0x37')]:_0x187735[_0xa8b2('0x32')];if(!_0x11c465['query'][_0xa8b2('0x3a')](_0xa8b2('0x3b'))){_0x33f28a[_0xa8b2('0x1c')]=qs['limit'](_0x11c465[_0xa8b2('0x34')][_0xa8b2('0x1c')]);_0x33f28a[_0xa8b2('0x1b')]=qs[_0xa8b2('0x1b')](_0x11c465[_0xa8b2('0x34')][_0xa8b2('0x1b')]);}_0x33f28a[_0xa8b2('0x3c')]=qs[_0xa8b2('0x3d')](_0x11c465['query'][_0xa8b2('0x3d')]);_0x33f28a[_0xa8b2('0x3e')]=qs[_0xa8b2('0x35')](_[_0xa8b2('0x3f')](_0x11c465[_0xa8b2('0x34')],_0x187735[_0xa8b2('0x35')]),_0x2a150a);if(_0x11c465['query'][_0xa8b2('0x40')]){_0x33f28a[_0xa8b2('0x3e')]=_['merge'](_0x33f28a[_0xa8b2('0x3e')],{'$or':_[_0xa8b2('0x2c')](_0x2a150a,function(_0x5c07ed){if(_0x5c07ed[_0xa8b2('0x30')]!==_0xa8b2('0x41')){var _0x4a02f9={};_0x4a02f9[_0x5c07ed[_0xa8b2('0x29')]]={'$like':'%'+_0x11c465[_0xa8b2('0x34')][_0xa8b2('0x40')]+'%'};return _0x4a02f9;}})});}_0x33f28a=_[_0xa8b2('0x42')]({},_0x33f28a,_0x11c465[_0xa8b2('0x43')]);var _0x4674fa={'where':_0x33f28a[_0xa8b2('0x3e')]};return db['ZohoAccount'][_0xa8b2('0x1e')](_0x4674fa)[_0xa8b2('0x25')](function(_0x288d4b){_0x1826c2[_0xa8b2('0x1e')]=_0x288d4b;if(_0x11c465[_0xa8b2('0x34')][_0xa8b2('0x44')]){_0x33f28a['include']=[{'all':!![]}];}return db[_0xa8b2('0x2d')]['findAll'](_0x33f28a);})[_0xa8b2('0x25')](function(_0x26f74f){_0x1826c2[_0xa8b2('0x45')]=_0x26f74f;return _0x1826c2;})[_0xa8b2('0x25')](respondWithFilteredResult(_0x5c119,_0x33f28a))['catch'](handleError(_0x5c119,null));};exports[_0xa8b2('0x46')]=function(_0x1777e5,_0x527ae6){var _0x278585={'raw':![],'where':{'id':_0x1777e5[_0xa8b2('0x47')]['id']}},_0x2434c5={};_0x2434c5['model']=_[_0xa8b2('0x33')](db['ZohoAccount'][_0xa8b2('0x2e')]);_0x2434c5['query']=_[_0xa8b2('0x33')](_0x1777e5[_0xa8b2('0x34')]);_0x2434c5['filters']=_[_0xa8b2('0x36')](_0x2434c5['model'],_0x2434c5[_0xa8b2('0x34')]);_0x278585[_0xa8b2('0x37')]=_[_0xa8b2('0x36')](_0x2434c5[_0xa8b2('0x32')],qs[_0xa8b2('0x38')](_0x1777e5[_0xa8b2('0x34')][_0xa8b2('0x38')]));_0x278585[_0xa8b2('0x37')]=_0x278585[_0xa8b2('0x37')]['length']?_0x278585['attributes']:_0x2434c5[_0xa8b2('0x32')];if(_0x1777e5[_0xa8b2('0x34')][_0xa8b2('0x44')]){_0x278585[_0xa8b2('0x48')]=[{'all':!![]}];}_0x278585=_['merge']({},_0x278585,_0x1777e5[_0xa8b2('0x43')]);return db['ZohoAccount'][_0xa8b2('0x49')](_0x278585)[_0xa8b2('0x25')](handleEntityNotFound(_0x527ae6,null))[_0xa8b2('0x25')](respondWithResult(_0x527ae6,null))[_0xa8b2('0x4a')](handleError(_0x527ae6,null));};exports[_0xa8b2('0x4b')]=function(_0x678d0,_0xe68208){return db[_0xa8b2('0x2d')][_0xa8b2('0x4b')](_0x678d0[_0xa8b2('0x4c')],{})[_0xa8b2('0x25')](respondWithResult(_0xe68208,0xc9))[_0xa8b2('0x4a')](handleError(_0xe68208,null));};exports[_0xa8b2('0x23')]=function(_0x8657cd,_0x5b3da6){if(_0x8657cd['body']['id']){delete _0x8657cd[_0xa8b2('0x4c')]['id'];}return db['ZohoAccount'][_0xa8b2('0x49')]({'where':{'id':_0x8657cd['params']['id']}})[_0xa8b2('0x25')](handleEntityNotFound(_0x5b3da6,null))[_0xa8b2('0x25')](saveUpdates(_0x8657cd[_0xa8b2('0x4c')],null))[_0xa8b2('0x25')](respondWithResult(_0x5b3da6,null))[_0xa8b2('0x4a')](handleError(_0x5b3da6,null));};exports['destroy']=function(_0x3c6629,_0x32797a){return db['ZohoAccount']['find']({'where':{'id':_0x3c6629[_0xa8b2('0x47')]['id']}})[_0xa8b2('0x25')](handleEntityNotFound(_0x32797a,null))[_0xa8b2('0x25')](removeEntity(_0x32797a,null))[_0xa8b2('0x4a')](handleError(_0x32797a,null));};exports['getConfigurations']=function(_0x41b527,_0x3a8270,_0x2c0b90){var _0x3ed973={};var _0x21601d={};var _0x348dd9;var _0x2a3e85;return db[_0xa8b2('0x2d')]['findOne']({'where':{'id':_0x41b527[_0xa8b2('0x47')]['id']}})[_0xa8b2('0x25')](handleEntityNotFound(_0x3a8270,null))[_0xa8b2('0x25')](function(_0x18637a){if(_0x18637a){_0x348dd9=_0x18637a;_0x21601d[_0xa8b2('0x32')]=_[_0xa8b2('0x33')](db[_0xa8b2('0x4d')]['rawAttributes']);_0x21601d[_0xa8b2('0x34')]=_[_0xa8b2('0x33')](_0x41b527[_0xa8b2('0x34')]);_0x21601d['filters']=_['intersection'](_0x21601d[_0xa8b2('0x32')],_0x21601d['query']);_0x3ed973[_0xa8b2('0x37')]=_[_0xa8b2('0x36')](_0x21601d[_0xa8b2('0x32')],qs[_0xa8b2('0x38')](_0x41b527['query'][_0xa8b2('0x38')]));_0x3ed973[_0xa8b2('0x37')]=_0x3ed973[_0xa8b2('0x37')][_0xa8b2('0x39')]?_0x3ed973['attributes']:_0x21601d[_0xa8b2('0x32')];_0x3ed973[_0xa8b2('0x3c')]=qs[_0xa8b2('0x3d')](_0x41b527[_0xa8b2('0x34')]['sort']);_0x3ed973['where']=qs[_0xa8b2('0x35')](_[_0xa8b2('0x3f')](_0x41b527[_0xa8b2('0x34')],_0x21601d[_0xa8b2('0x35')]));if(_0x41b527['query'][_0xa8b2('0x40')]){_0x3ed973[_0xa8b2('0x3e')]=_[_0xa8b2('0x42')](_0x3ed973[_0xa8b2('0x3e')],{'$or':_[_0xa8b2('0x2c')](_0x3ed973[_0xa8b2('0x37')],function(_0x1ff332){var _0x337d57={};_0x337d57[_0x1ff332]={'$like':'%'+_0x41b527[_0xa8b2('0x34')][_0xa8b2('0x40')]+'%'};return _0x337d57;})});}_0x3ed973=_['merge']({},_0x3ed973,_0x41b527[_0xa8b2('0x43')]);return _0x348dd9[_0xa8b2('0x4e')](_0x3ed973);}})[_0xa8b2('0x25')](function(_0x17e613){if(_0x17e613){_0x2a3e85=_0x17e613[_0xa8b2('0x39')];if(!_0x41b527[_0xa8b2('0x34')]['hasOwnProperty'](_0xa8b2('0x3b'))){_0x3ed973[_0xa8b2('0x1c')]=qs['limit'](_0x41b527[_0xa8b2('0x34')][_0xa8b2('0x1c')]);_0x3ed973[_0xa8b2('0x1b')]=qs[_0xa8b2('0x1b')](_0x41b527[_0xa8b2('0x34')][_0xa8b2('0x1b')]);}return _0x348dd9[_0xa8b2('0x4e')](_0x3ed973);}})['then'](function(_0x612d7e){if(_0x612d7e){return _0x612d7e?{'count':_0x2a3e85,'rows':_0x612d7e}:null;}})[_0xa8b2('0x25')](respondWithResult(_0x3a8270,null))['catch'](handleError(_0x3a8270,null));};exports['addConfiguration']=function(_0x3d7770,_0x4b0686,_0x527f51){if(_0x3d7770[_0xa8b2('0x4c')]['id']){delete _0x3d7770[_0xa8b2('0x4c')]['id'];}return db[_0xa8b2('0x2d')][_0xa8b2('0x4f')]({'where':{'id':_0x3d7770[_0xa8b2('0x47')]['id']}})[_0xa8b2('0x25')](handleEntityNotFound(_0x4b0686,null))[_0xa8b2('0x25')](function(_0x26109a){if(_0x26109a){_0x3d7770[_0xa8b2('0x4c')][_0xa8b2('0x50')]=_0x26109a['id'];_0x3d7770['body'][_0xa8b2('0x51')]=integrations[_0xa8b2('0x52')](_0x3d7770[_0xa8b2('0x4c')][_0xa8b2('0x53')],_0x3d7770[_0xa8b2('0x4c')][_0xa8b2('0x30')]);_0x3d7770[_0xa8b2('0x4c')][_0xa8b2('0x54')]=integrations[_0xa8b2('0x55')](_0x3d7770[_0xa8b2('0x4c')]['channel'],_0x3d7770['body'][_0xa8b2('0x30')]);return db[_0xa8b2('0x4d')][_0xa8b2('0x4b')](_0x3d7770[_0xa8b2('0x4c')],{'include':[{'model':db['ZohoField'],'as':_0xa8b2('0x51')},{'model':db[_0xa8b2('0x56')],'as':_0xa8b2('0x54')}]});}return null;})[_0xa8b2('0x25')](respondWithResult(_0x4b0686,null))[_0xa8b2('0x4a')](handleError(_0x4b0686,null));};function getAccessToken(_0x18c29c){return new Promise(function(_0x300857,_0x4edc39){var _0x44a7a6;switch(_0x18c29c[_0xa8b2('0x57')]){case'US':_0x44a7a6=_0xa8b2('0x58');break;case'AU':_0x44a7a6=_0xa8b2('0x59');break;case'EU':_0x44a7a6=_0xa8b2('0x5a');break;case'IN':_0x44a7a6=_0xa8b2('0x5b');break;case'CN':_0x44a7a6=_0xa8b2('0x5c');break;default:_0x44a7a6=_0xa8b2('0x5a');break;}var _0x130709={'method':_0xa8b2('0x5d'),'uri':_0x44a7a6+_0xa8b2('0x5e'),'qs':{'refresh_token':_0x18c29c['refreshToken'],'client_id':_0x18c29c[_0xa8b2('0x5f')],'client_secret':_0x18c29c[_0xa8b2('0x60')],'grant_type':_0xa8b2('0x61')},'json':!![]};return rp(_0x130709)[_0xa8b2('0x25')](function(_0x57acfb){if(_0x57acfb[_0xa8b2('0x62')]){_0x300857(_0x57acfb[_0xa8b2('0x62')]);}else{_0x4edc39(_0xa8b2('0x63'));}})['catch'](function(_0x370c68){_0x4edc39(_0x370c68);});});}exports[_0xa8b2('0x64')]=function(_0x59e2a6,_0x321f3c,_0x1b94e0){var _0x584197,_0x4f4cd0,_0x3af14a,_0x5aee22,_0x1421a0;return db[_0xa8b2('0x2d')][_0xa8b2('0x4f')]({'where':{'id':_0x59e2a6['params']['id']},'attributes':['id',_0xa8b2('0x65'),_0xa8b2('0x57'),_0xa8b2('0x5f'),'clientSecret','serverUrl',_0xa8b2('0x66'),_0xa8b2('0x67')]})[_0xa8b2('0x25')](handleEntityNotFound(_0x321f3c,null))[_0xa8b2('0x25')](function(_0x248a2c){_0x1421a0=_0x248a2c;_0x584197=_0x1421a0[_0xa8b2('0x65')];_0x4f4cd0=_0x584197===_0xa8b2('0x68')?'eu':_0xa8b2('0x69');_0x3af14a=_0x1421a0[_0xa8b2('0x6a')];var _0x2b3971=_0x3af14a[_0xa8b2('0x6b')](-0x1);if(_0x2b3971==='/'||_0x2b3971==='\x5c'||_0x2b3971===':'){_0x3af14a=_0x3af14a['substring'](0x0,_0x3af14a['lastIndexOf'](_0x2b3971));}if(!_0x1421a0[_0xa8b2('0x67')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1421a0);})[_0xa8b2('0x25')](function(_0xdd4f68){if(_0xdd4f68){return rp({'method':_0xa8b2('0x6c'),'uri':util[_0xa8b2('0x6d')](_0xa8b2('0x6e'),_0x4f4cd0),'qs':{'module':_0xa8b2('0x6f')},'headers':{'Authorization':_0xa8b2('0x70')+_0xdd4f68},'json':!![]});}})['then'](function(_0x564d0c){if(_0x564d0c){if(_0x564d0c[_0xa8b2('0x71')]&&_0x564d0c['response'][_0xa8b2('0x27')]){throw new Error(_0x564d0c[_0xa8b2('0x71')][_0xa8b2('0x27')]['message']);}var _0x384e78=[];var _0x41379e=[];var _0x3da77c=[_0xa8b2('0x72'),_0xa8b2('0x73'),'Description',_0xa8b2('0x74'),_0xa8b2('0x75'),'Call_Result',_0xa8b2('0x76'),'Call_Type'];_0x41379e=_[_0xa8b2('0x77')](_0x564d0c[_0xa8b2('0x38')],function(_0x25ce42){return _0x3da77c[_0xa8b2('0x78')](_0x25ce42[_0xa8b2('0x79')]);});for(var _0x436c91=0x0;_0x436c91<_0x41379e[_0xa8b2('0x39')];_0x436c91++){if(_0x41379e[_0x436c91][_0xa8b2('0x7a')]===![]){_0x384e78[_0xa8b2('0x7b')]({'id':_0x41379e[_0x436c91]['id'],'name':_0x41379e[_0x436c91]['display_label'],'custom':_0x41379e[_0x436c91][_0xa8b2('0x7c')],'options':_0x41379e[_0x436c91][_0xa8b2('0x7d')]===_0xa8b2('0x7e')&&_0x41379e[_0x436c91][_0xa8b2('0x7f')][_0xa8b2('0x39')]>-0x1?_[_0xa8b2('0x2c')](_0x41379e[_0x436c91][_0xa8b2('0x7f')],function(_0xdf474e){return{'name':_0xdf474e,'value':_0xdf474e};}):[]});}}return{'count':_0x384e78[_0xa8b2('0x39')],'rows':_0x384e78};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x321f3c,null))[_0xa8b2('0x4a')](function(_0x139b26){var _0x199ba6=_0x59e2a6[_0xa8b2('0x34')][_0xa8b2('0x80')]?0x1f4:_0x139b26['statusCode']||0x1f4;logger[_0xa8b2('0x27')](_0xa8b2('0x81'),'getFields',_0x199ba6,JSON[_0xa8b2('0x82')](_0x139b26));delete _0x139b26['name'];if(_0x199ba6===0x191){_0x199ba6=0x190;}_0x321f3c['status'](_0x199ba6)['send'](_0x59e2a6['query'][_0xa8b2('0x80')]?{'message':_0xa8b2('0x83'),'statusCode':_0x139b26[_0xa8b2('0x84')]}:_0x139b26);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f9c1710..1896d13 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 _0x061b=['slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','name','inspect','catch','format','authorization_code','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','util','../../config/logger','api','bluebird','request-promise','path','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','host'];(function(_0x247602,_0x2c97b4){var _0x5185af=function(_0x2ca57e){while(--_0x2ca57e){_0x247602['push'](_0x247602['shift']());}};_0x5185af(++_0x2c97b4);}(_0x061b,0x6e));var _0xb061=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x061b[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0xb061('0x0'));var logger=require(_0xb061('0x1'))(_0xb061('0x2'));var moment=require('moment');var BPromise=require(_0xb061('0x3'));var rp=require(_0xb061('0x4'));var fs=require('fs');var path=require(_0xb061('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb061('0x6'));var integrations=require(_0xb061('0x7'));module['exports']=function(_0x2f1edd,_0x2837fb){return _0x2f1edd[_0xb061('0x8')](_0xb061('0x9'),attributes,{'tableName':_0xb061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x23be9f,_0x2bd837,_0x17471e){if(_0x23be9f[_0xb061('0xb')](_0xb061('0xc'))||_0x23be9f['changed'](_0xb061('0xd'))||_0x23be9f[_0xb061('0xb')]('clientId')||_0x23be9f[_0xb061('0xb')](_0xb061('0xe'))||_0x23be9f[_0xb061('0xb')]('code')||_0x23be9f[_0xb061('0xb')](_0xb061('0xf'))){var _0x451a3d,_0xe8fb4e;_0x451a3d=_0x23be9f[_0xb061('0xd')];var _0x41da02=_0x451a3d[_0xb061('0x10')](-0x1);if(_0x41da02==='/'||_0x41da02==='\x5c'||_0x41da02===':'){_0x451a3d=_0x451a3d[_0xb061('0x11')](0x0,_0x451a3d[_0xb061('0x12')](_0x41da02));}switch(_0x23be9f['zone']){case'US':_0xe8fb4e=_0xb061('0x13');break;case'AU':_0xe8fb4e=_0xb061('0x14');break;case'IN':_0xe8fb4e=_0xb061('0x15');break;case'CN':_0xe8fb4e=_0xb061('0x16');break;default:_0xe8fb4e=_0xb061('0x17');break;}var _0x233026={'method':_0xb061('0x18'),'uri':_0xe8fb4e+_0xb061('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x23be9f[_0xb061('0x1a')],'client_secret':_0x23be9f[_0xb061('0xe')],'redirect_uri':_0x23be9f['serverUrl'],'code':_0x23be9f[_0xb061('0x1b')]},'headers':{'Content-Type':_0xb061('0x1c')}};return rp(_0x233026)[_0xb061('0x1d')](function(_0x4b9668){var _0x37e01b=JSON[_0xb061('0x1e')](_0x4b9668);if(_0x37e01b['refresh_token']){_0x23be9f[_0xb061('0x1f')]=_0x37e01b[_0xb061('0x20')];logger[_0xb061('0x21')](util['format'](_0xb061('0x22'),_0x23be9f['name'],_0x23be9f['id']));}else{logger[_0xb061('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x23be9f[_0xb061('0x24')],_0x23be9f['id']),util[_0xb061('0x25')](_0x37e01b,{'showHidden':![],'depth':null}));}return _0x17471e(null,_0x2bd837);})[_0xb061('0x26')](function(_0x3d33df){logger['error'](util[_0xb061('0x27')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x23be9f[_0xb061('0x24')],_0x23be9f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x17471e(_0x3d33df);});}else{return _0x17471e(null,_0x2bd837);}},'beforeUpdate':function(_0x41c6dd,_0x5c0bde,_0x1eb7d4){if(_0x41c6dd['changed'](_0xb061('0xc'))||_0x41c6dd[_0xb061('0xb')](_0xb061('0xd'))||_0x41c6dd['changed'](_0xb061('0x1a'))||_0x41c6dd['changed'](_0xb061('0xe'))||_0x41c6dd['changed'](_0xb061('0x1b'))||_0x41c6dd['changed'](_0xb061('0xf'))){var _0xf6b09a,_0x4e441d;_0xf6b09a=_0x41c6dd[_0xb061('0xd')];var _0x121cff=_0xf6b09a[_0xb061('0x10')](-0x1);if(_0x121cff==='/'||_0x121cff==='\x5c'||_0x121cff===':'){_0xf6b09a=_0xf6b09a[_0xb061('0x11')](0x0,_0xf6b09a[_0xb061('0x12')](_0x121cff));}switch(_0x41c6dd[_0xb061('0xc')]){case'US':_0x4e441d=_0xb061('0x13');break;case'AU':_0x4e441d=_0xb061('0x14');break;case'IN':_0x4e441d=_0xb061('0x15');break;case'CN':_0x4e441d='https://accounts.zoho.com.cn';break;default:_0x4e441d=_0xb061('0x17');break;}var _0x2b1a20={'method':_0xb061('0x18'),'uri':_0x4e441d+_0xb061('0x19'),'form':{'grant_type':_0xb061('0x28'),'client_id':_0x41c6dd[_0xb061('0x1a')],'client_secret':_0x41c6dd[_0xb061('0xe')],'redirect_uri':_0x41c6dd[_0xb061('0xd')],'code':_0x41c6dd[_0xb061('0x1b')]},'headers':{'Content-Type':_0xb061('0x1c')}};return rp(_0x2b1a20)[_0xb061('0x1d')](function(_0x3448db){var _0x32a2ae=JSON[_0xb061('0x1e')](_0x3448db);if(_0x32a2ae[_0xb061('0x20')]){_0x41c6dd[_0xb061('0x1f')]=_0x32a2ae['refresh_token'];logger[_0xb061('0x21')](util[_0xb061('0x27')](_0xb061('0x22'),_0x41c6dd[_0xb061('0x24')],_0x41c6dd['id']));}else{logger[_0xb061('0x23')](util[_0xb061('0x27')](_0xb061('0x29'),_0x41c6dd[_0xb061('0x24')],_0x41c6dd['id']),util['inspect'](_0x32a2ae,{'showHidden':![],'depth':null}));}return _0x1eb7d4(null,_0x5c0bde);})[_0xb061('0x26')](function(_0x56bfe7){logger[_0xb061('0x23')](util[_0xb061('0x27')](_0xb061('0x29'),_0x41c6dd[_0xb061('0x24')],_0x41c6dd['id']),util[_0xb061('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1eb7d4(_0x56bfe7);});}else{return _0x1eb7d4(null,_0x5c0bde);}}}});}; \ No newline at end of file +var _0x420b=['refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','POST','then','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse'];(function(_0x103b2e,_0x4293f1){var _0x14a460=function(_0x592c76){while(--_0x592c76){_0x103b2e['push'](_0x103b2e['shift']());}};_0x14a460(++_0x4293f1);}(_0x420b,0x93));var _0xb420=function(_0x28595,_0x1c552f){_0x28595=_0x28595-0x0;var _0x21125e=_0x420b[_0x28595];return _0x21125e;};'use strict';var _=require(_0xb420('0x0'));var util=require(_0xb420('0x1'));var logger=require(_0xb420('0x2'))(_0xb420('0x3'));var moment=require(_0xb420('0x4'));var BPromise=require('bluebird');var rp=require(_0xb420('0x5'));var fs=require('fs');var path=require(_0xb420('0x6'));var rimraf=require(_0xb420('0x7'));var config=require(_0xb420('0x8'));var attributes=require(_0xb420('0x9'));var integrations=require(_0xb420('0xa'));module['exports']=function(_0x4a7143,_0x4601b2){return _0x4a7143[_0xb420('0xb')](_0xb420('0xc'),attributes,{'tableName':_0xb420('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2876ab,_0x1b158f,_0x38360e){if(_0x2876ab[_0xb420('0xe')](_0xb420('0xf'))||_0x2876ab[_0xb420('0xe')](_0xb420('0x10'))||_0x2876ab['changed'](_0xb420('0x11'))||_0x2876ab['changed'](_0xb420('0x12'))||_0x2876ab[_0xb420('0xe')](_0xb420('0x13'))||_0x2876ab[_0xb420('0xe')](_0xb420('0x14'))){var _0x47124b,_0x48f980;_0x47124b=_0x2876ab[_0xb420('0x10')];var _0x26e84f=_0x47124b[_0xb420('0x15')](-0x1);if(_0x26e84f==='/'||_0x26e84f==='\x5c'||_0x26e84f===':'){_0x47124b=_0x47124b[_0xb420('0x16')](0x0,_0x47124b[_0xb420('0x17')](_0x26e84f));}switch(_0x2876ab[_0xb420('0xf')]){case'US':_0x48f980=_0xb420('0x18');break;case'AU':_0x48f980=_0xb420('0x19');break;case'IN':_0x48f980=_0xb420('0x1a');break;case'CN':_0x48f980=_0xb420('0x1b');break;default:_0x48f980=_0xb420('0x1c');break;}var _0x5b20f8={'method':'POST','uri':_0x48f980+_0xb420('0x1d'),'form':{'grant_type':_0xb420('0x1e'),'client_id':_0x2876ab[_0xb420('0x11')],'client_secret':_0x2876ab[_0xb420('0x12')],'redirect_uri':_0x2876ab['serverUrl'],'code':_0x2876ab['code']},'headers':{'Content-Type':_0xb420('0x1f')}};return rp(_0x5b20f8)['then'](function(_0x5337b0){var _0xa9dbf2=JSON[_0xb420('0x20')](_0x5337b0);if(_0xa9dbf2[_0xb420('0x21')]){_0x2876ab[_0xb420('0x22')]=_0xa9dbf2[_0xb420('0x21')];logger[_0xb420('0x23')](util[_0xb420('0x24')](_0xb420('0x25'),_0x2876ab['name'],_0x2876ab['id']));}else{logger[_0xb420('0x26')](util[_0xb420('0x24')](_0xb420('0x27'),_0x2876ab[_0xb420('0x28')],_0x2876ab['id']),util[_0xb420('0x29')](_0xa9dbf2,{'showHidden':![],'depth':null}));}return _0x38360e(null,_0x1b158f);})[_0xb420('0x2a')](function(_0xa7e3b4){logger[_0xb420('0x26')](util[_0xb420('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2876ab['name'],_0x2876ab['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x38360e(_0xa7e3b4);});}else{return _0x38360e(null,_0x1b158f);}},'beforeUpdate':function(_0x3756ad,_0xc0c265,_0x42c3fe){if(_0x3756ad[_0xb420('0xe')](_0xb420('0xf'))||_0x3756ad['changed'](_0xb420('0x10'))||_0x3756ad['changed'](_0xb420('0x11'))||_0x3756ad['changed']('clientSecret')||_0x3756ad['changed'](_0xb420('0x13'))||_0x3756ad[_0xb420('0xe')](_0xb420('0x14'))){var _0x124f4c,_0x2854dd;_0x124f4c=_0x3756ad[_0xb420('0x10')];var _0x221b74=_0x124f4c[_0xb420('0x15')](-0x1);if(_0x221b74==='/'||_0x221b74==='\x5c'||_0x221b74===':'){_0x124f4c=_0x124f4c[_0xb420('0x16')](0x0,_0x124f4c[_0xb420('0x17')](_0x221b74));}switch(_0x3756ad[_0xb420('0xf')]){case'US':_0x2854dd=_0xb420('0x18');break;case'AU':_0x2854dd=_0xb420('0x19');break;case'IN':_0x2854dd=_0xb420('0x1a');break;case'CN':_0x2854dd='https://accounts.zoho.com.cn';break;default:_0x2854dd=_0xb420('0x1c');break;}var _0x599f6c={'method':_0xb420('0x2b'),'uri':_0x2854dd+_0xb420('0x1d'),'form':{'grant_type':_0xb420('0x1e'),'client_id':_0x3756ad[_0xb420('0x11')],'client_secret':_0x3756ad[_0xb420('0x12')],'redirect_uri':_0x3756ad[_0xb420('0x10')],'code':_0x3756ad[_0xb420('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x599f6c)[_0xb420('0x2c')](function(_0x3c9e39){var _0x46a979=JSON['parse'](_0x3c9e39);if(_0x46a979[_0xb420('0x21')]){_0x3756ad[_0xb420('0x22')]=_0x46a979[_0xb420('0x21')];logger['info'](util[_0xb420('0x24')](_0xb420('0x25'),_0x3756ad['name'],_0x3756ad['id']));}else{logger[_0xb420('0x26')](util[_0xb420('0x24')](_0xb420('0x27'),_0x3756ad[_0xb420('0x28')],_0x3756ad['id']),util[_0xb420('0x29')](_0x46a979,{'showHidden':![],'depth':null}));}return _0x42c3fe(null,_0xc0c265);})['catch'](function(_0x5d8f1d){logger[_0xb420('0x26')](util[_0xb420('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3756ad['name'],_0x3756ad['id']),util[_0xb420('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x42c3fe(_0x5d8f1d);});}else{return _0x42c3fe(null,_0xc0c265);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index dd38345..50a8bef 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 _0x63d4=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','error','code','message','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','map','model','include','then','debug','stringify','catch','ShowZohoAccount','find','lodash'];(function(_0x72a6b3,_0x3b37c1){var _0x50c385=function(_0x396760){while(--_0x396760){_0x72a6b3['push'](_0x72a6b3['shift']());}};_0x50c385(++_0x3b37c1);}(_0x63d4,0x117));var _0x463d=function(_0x84c0a1,_0x509a86){_0x84c0a1=_0x84c0a1-0x0;var _0x2c8f06=_0x63d4[_0x84c0a1];return _0x2c8f06;};'use strict';var _=require(_0x463d('0x0'));var util=require(_0x463d('0x1'));var moment=require(_0x463d('0x2'));var BPromise=require('bluebird');var rs=require(_0x463d('0x3'));var fs=require('fs');var Redis=require(_0x463d('0x4'));var db=require(_0x463d('0x5'))['db'];var utils=require(_0x463d('0x6'));var logger=require(_0x463d('0x7'))('rpc');var config=require(_0x463d('0x8'));var jayson=require(_0x463d('0x9'));var client=jayson['client'][_0x463d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb5e1b1,_0x2635aa,_0x41dc01){return new BPromise(function(_0x218286,_0x4d32fb){return client[_0x463d('0xb')](_0xb5e1b1,_0x41dc01)['then'](function(_0x42b27e){logger[_0x463d('0xc')](_0x463d('0xd'),_0x2635aa,_0x463d('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2635aa,_0x463d('0xe'),JSON['stringify'](_0x42b27e));if(_0x42b27e[_0x463d('0xf')]){if(_0x42b27e[_0x463d('0xf')][_0x463d('0x10')]===0x1f4){logger[_0x463d('0xf')](_0x463d('0xd'),_0x2635aa,_0x42b27e[_0x463d('0xf')][_0x463d('0x11')]);return _0x4d32fb(_0x42b27e['error'][_0x463d('0x11')]);}logger[_0x463d('0xf')](_0x463d('0xd'),_0x2635aa,_0x42b27e['error'][_0x463d('0x11')]);return _0x218286(_0x42b27e[_0x463d('0xf')][_0x463d('0x11')]);}else{logger[_0x463d('0xc')](_0x463d('0xd'),_0x2635aa,_0x463d('0xe'));_0x218286(_0x42b27e['result'][_0x463d('0x11')]);}})['catch'](function(_0x10008f){logger[_0x463d('0xf')](_0x463d('0xd'),_0x2635aa,_0x10008f);_0x4d32fb(_0x10008f);});});}exports[_0x463d('0x12')]=function(_0x408f47){var _0x36ea11=this;return new Promise(function(_0x48df3c,_0x15a1b4){return db[_0x463d('0x13')][_0x463d('0x14')]({'raw':_0x408f47[_0x463d('0x15')]?_0x408f47[_0x463d('0x15')][_0x463d('0x16')]===undefined?!![]:![]:!![],'where':_0x408f47[_0x463d('0x15')]?_0x408f47[_0x463d('0x15')][_0x463d('0x17')]||null:null,'attributes':_0x408f47[_0x463d('0x15')]?_0x408f47[_0x463d('0x15')][_0x463d('0x18')]||null:null,'limit':_0x408f47[_0x463d('0x15')]?_0x408f47[_0x463d('0x15')][_0x463d('0x19')]||null:null,'include':_0x408f47['options']?_0x408f47[_0x463d('0x15')]['include']?_[_0x463d('0x1a')](_0x408f47[_0x463d('0x15')]['include'],function(_0x5d16ad){return{'model':db[_0x5d16ad[_0x463d('0x1b')]],'as':_0x5d16ad['as'],'attributes':_0x5d16ad[_0x463d('0x18')],'include':_0x5d16ad['include']?_[_0x463d('0x1a')](_0x5d16ad['include'],function(_0x1379ef){return{'model':db[_0x1379ef[_0x463d('0x1b')]],'as':_0x1379ef['as'],'attributes':_0x1379ef[_0x463d('0x18')],'include':_0x1379ef['include']?_[_0x463d('0x1a')](_0x1379ef[_0x463d('0x1c')],function(_0x3763a2){return{'model':db[_0x3763a2[_0x463d('0x1b')]],'as':_0x3763a2['as'],'attributes':_0x3763a2[_0x463d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x463d('0x1d')](function(_0xbff8e0){logger['info']('GetZohoAccount',_0x408f47);logger[_0x463d('0x1e')]('GetZohoAccount',_0x408f47,JSON[_0x463d('0x1f')](_0xbff8e0));_0x48df3c(_0xbff8e0);})[_0x463d('0x20')](function(_0x33305d){logger[_0x463d('0xf')]('GetZohoAccount',_0x33305d[_0x463d('0x11')],_0x408f47);_0x15a1b4(_0x36ea11[_0x463d('0xf')](0x1f4,_0x33305d[_0x463d('0x11')]));});});};exports[_0x463d('0x21')]=function(_0x3a9fb1){var _0x587b2f=this;return new Promise(function(_0x2e621f,_0x2a3c7a){return db['ZohoAccount'][_0x463d('0x22')]({'raw':_0x3a9fb1['options']?_0x3a9fb1[_0x463d('0x15')][_0x463d('0x16')]===undefined?!![]:![]:!![],'where':_0x3a9fb1[_0x463d('0x15')]?_0x3a9fb1[_0x463d('0x15')][_0x463d('0x17')]||null:null,'attributes':_0x3a9fb1['options']?_0x3a9fb1[_0x463d('0x15')][_0x463d('0x18')]||null:null,'include':_0x3a9fb1[_0x463d('0x15')]?_0x3a9fb1[_0x463d('0x15')][_0x463d('0x1c')]?_[_0x463d('0x1a')](_0x3a9fb1[_0x463d('0x15')][_0x463d('0x1c')],function(_0x2e007f){return{'model':db[_0x2e007f[_0x463d('0x1b')]],'as':_0x2e007f['as'],'attributes':_0x2e007f[_0x463d('0x18')],'include':_0x2e007f[_0x463d('0x1c')]?_[_0x463d('0x1a')](_0x2e007f[_0x463d('0x1c')],function(_0x471ee4){return{'model':db[_0x471ee4['model']],'as':_0x471ee4['as'],'attributes':_0x471ee4[_0x463d('0x18')],'include':_0x471ee4[_0x463d('0x1c')]?_[_0x463d('0x1a')](_0x471ee4[_0x463d('0x1c')],function(_0x2e144e){return{'model':db[_0x2e144e[_0x463d('0x1b')]],'as':_0x2e144e['as'],'attributes':_0x2e144e[_0x463d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x463d('0x1d')](function(_0x3a252e){logger[_0x463d('0xc')](_0x463d('0x21'),_0x3a9fb1);logger['debug']('ShowZohoAccount',_0x3a9fb1,JSON[_0x463d('0x1f')](_0x3a252e));_0x2e621f(_0x3a252e);})[_0x463d('0x20')](function(_0x4d6513){logger[_0x463d('0xf')]('ShowZohoAccount',_0x4d6513['message'],_0x3a9fb1);_0x2a3c7a(_0x587b2f[_0x463d('0xf')](0x1f4,_0x4d6513['message']));});});}; \ No newline at end of file +var _0x160c=['ShowZohoAccount','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','info'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x160c,0x181));var _0xc160=function(_0x1ae53f,_0x45645f){_0x1ae53f=_0x1ae53f-0x0;var _0x1cfb04=_0x160c[_0x1ae53f];return _0x1cfb04;};'use strict';var _=require('lodash');var util=require(_0xc160('0x0'));var moment=require(_0xc160('0x1'));var BPromise=require(_0xc160('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc160('0x3'));var logger=require('../../config/logger')(_0xc160('0x4'));var config=require(_0xc160('0x5'));var jayson=require(_0xc160('0x6'));var client=jayson['client'][_0xc160('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5dfb45,_0x26e1f4,_0x549651){return new BPromise(function(_0x359ac9,_0x30c90e){return client['request'](_0x5dfb45,_0x549651)[_0xc160('0x8')](function(_0x208643){logger['info'](_0xc160('0x9'),_0x26e1f4,_0xc160('0xa'));logger[_0xc160('0xb')](_0xc160('0xc'),_0x26e1f4,_0xc160('0xa'),JSON[_0xc160('0xd')](_0x208643));if(_0x208643[_0xc160('0xe')]){if(_0x208643[_0xc160('0xe')][_0xc160('0xf')]===0x1f4){logger['error'](_0xc160('0x9'),_0x26e1f4,_0x208643[_0xc160('0xe')]['message']);return _0x30c90e(_0x208643[_0xc160('0xe')][_0xc160('0x10')]);}logger[_0xc160('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x26e1f4,_0x208643[_0xc160('0xe')]['message']);return _0x359ac9(_0x208643[_0xc160('0xe')][_0xc160('0x10')]);}else{logger['info'](_0xc160('0x9'),_0x26e1f4,'request\x20sent');_0x359ac9(_0x208643[_0xc160('0x11')][_0xc160('0x10')]);}})[_0xc160('0x12')](function(_0x5bb074){logger['error'](_0xc160('0x9'),_0x26e1f4,_0x5bb074);_0x30c90e(_0x5bb074);});});}exports[_0xc160('0x13')]=function(_0x6120d5){var _0x54e6e0=this;return new Promise(function(_0x3b7b55,_0x36011c){return db[_0xc160('0x14')][_0xc160('0x15')]({'raw':_0x6120d5['options']?_0x6120d5[_0xc160('0x16')][_0xc160('0x17')]===undefined?!![]:![]:!![],'where':_0x6120d5['options']?_0x6120d5[_0xc160('0x16')][_0xc160('0x18')]||null:null,'attributes':_0x6120d5[_0xc160('0x16')]?_0x6120d5[_0xc160('0x16')][_0xc160('0x19')]||null:null,'limit':_0x6120d5['options']?_0x6120d5[_0xc160('0x16')][_0xc160('0x1a')]||null:null,'include':_0x6120d5[_0xc160('0x16')]?_0x6120d5[_0xc160('0x16')][_0xc160('0x1b')]?_[_0xc160('0x1c')](_0x6120d5[_0xc160('0x16')][_0xc160('0x1b')],function(_0x417ac1){return{'model':db[_0x417ac1[_0xc160('0x1d')]],'as':_0x417ac1['as'],'attributes':_0x417ac1['attributes'],'include':_0x417ac1['include']?_[_0xc160('0x1c')](_0x417ac1['include'],function(_0x7d235e){return{'model':db[_0x7d235e[_0xc160('0x1d')]],'as':_0x7d235e['as'],'attributes':_0x7d235e[_0xc160('0x19')],'include':_0x7d235e['include']?_[_0xc160('0x1c')](_0x7d235e[_0xc160('0x1b')],function(_0x2542f1){return{'model':db[_0x2542f1[_0xc160('0x1d')]],'as':_0x2542f1['as'],'attributes':_0x2542f1[_0xc160('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xba4803){logger[_0xc160('0x1e')](_0xc160('0x13'),_0x6120d5);logger[_0xc160('0xb')](_0xc160('0x13'),_0x6120d5,JSON[_0xc160('0xd')](_0xba4803));_0x3b7b55(_0xba4803);})[_0xc160('0x12')](function(_0x56a004){logger[_0xc160('0xe')](_0xc160('0x13'),_0x56a004[_0xc160('0x10')],_0x6120d5);_0x36011c(_0x54e6e0['error'](0x1f4,_0x56a004['message']));});});};exports[_0xc160('0x1f')]=function(_0x5b0a81){var _0x233cb2=this;return new Promise(function(_0x2ba357,_0x2ba69){return db['ZohoAccount']['find']({'raw':_0x5b0a81['options']?_0x5b0a81['options'][_0xc160('0x17')]===undefined?!![]:![]:!![],'where':_0x5b0a81[_0xc160('0x16')]?_0x5b0a81[_0xc160('0x16')]['where']||null:null,'attributes':_0x5b0a81[_0xc160('0x16')]?_0x5b0a81['options']['attributes']||null:null,'include':_0x5b0a81[_0xc160('0x16')]?_0x5b0a81[_0xc160('0x16')]['include']?_[_0xc160('0x1c')](_0x5b0a81[_0xc160('0x16')][_0xc160('0x1b')],function(_0x16e8e3){return{'model':db[_0x16e8e3[_0xc160('0x1d')]],'as':_0x16e8e3['as'],'attributes':_0x16e8e3[_0xc160('0x19')],'include':_0x16e8e3[_0xc160('0x1b')]?_['map'](_0x16e8e3['include'],function(_0x15cde0){return{'model':db[_0x15cde0['model']],'as':_0x15cde0['as'],'attributes':_0x15cde0[_0xc160('0x19')],'include':_0x15cde0[_0xc160('0x1b')]?_[_0xc160('0x1c')](_0x15cde0[_0xc160('0x1b')],function(_0x631967){return{'model':db[_0x631967['model']],'as':_0x631967['as'],'attributes':_0x631967['attributes']};}):[]};}):[]};}):[]:[]})[_0xc160('0x8')](function(_0x22a295){logger[_0xc160('0x1e')](_0xc160('0x1f'),_0x5b0a81);logger['debug']('ShowZohoAccount',_0x5b0a81,JSON['stringify'](_0x22a295));_0x2ba357(_0x22a295);})[_0xc160('0x12')](function(_0x2e1ca3){logger[_0xc160('0xe')](_0xc160('0x1f'),_0x2e1ca3['message'],_0x5b0a81);_0x2ba69(_0x233cb2[_0xc160('0xe')](0x1f4,_0x2e1ca3[_0xc160('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ba3aaa6..de7606a 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 _0x11c9=['multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','update','delete','destroy','exports'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x11c9,0x7e));var _0x911c=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0x11c9[_0x30f5bb];return _0x1cfc00;};'use strict';var multer=require(_0x911c('0x0'));var util=require(_0x911c('0x1'));var path=require(_0x911c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x911c('0x3'));var interaction=require(_0x911c('0x4'));var config=require(_0x911c('0x5'));var controller=require(_0x911c('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x911c('0x7')](_0x911c('0x8'),auth[_0x911c('0x9')](),controller[_0x911c('0xa')]);router[_0x911c('0x7')](_0x911c('0xb'),auth[_0x911c('0x9')](),controller[_0x911c('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x911c('0xd')]);router[_0x911c('0x7')](_0x911c('0xe'),auth[_0x911c('0x9')](),controller['getDescriptions']);router[_0x911c('0xf')]('/',auth['isAuthenticated'](),controller[_0x911c('0x10')]);router['put'](_0x911c('0x8'),auth[_0x911c('0x9')](),controller[_0x911c('0x11')]);router[_0x911c('0x12')](_0x911c('0x8'),auth[_0x911c('0x9')](),controller[_0x911c('0x13')]);module[_0x911c('0x14')]=router; \ No newline at end of file +var _0x79a0=['show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x79a0,0x1d8));var _0x079a=function(_0x5d8acf,_0x1438db){_0x5d8acf=_0x5d8acf-0x0;var _0xfc78f1=_0x79a0[_0x5d8acf];return _0xfc78f1;};'use strict';var multer=require(_0x079a('0x0'));var util=require(_0x079a('0x1'));var path=require(_0x079a('0x2'));var timeout=require(_0x079a('0x3'));var express=require(_0x079a('0x4'));var router=express['Router']();var fs_extra=require(_0x079a('0x5'));var auth=require(_0x079a('0x6'));var interaction=require(_0x079a('0x7'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x079a('0x8')]('/',auth[_0x079a('0x9')](),controller[_0x079a('0xa')]);router['get'](_0x079a('0xb'),auth['isAuthenticated'](),controller[_0x079a('0xc')]);router[_0x079a('0x8')](_0x079a('0xd'),auth[_0x079a('0x9')](),controller['getFields']);router['get'](_0x079a('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x079a('0x8')](_0x079a('0xf'),auth[_0x079a('0x9')](),controller[_0x079a('0x10')]);router[_0x079a('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x079a('0x12')]('/:id',auth[_0x079a('0x9')](),controller[_0x079a('0x13')]);router[_0x079a('0x14')](_0x079a('0xb'),auth[_0x079a('0x9')](),controller[_0x079a('0x15')]);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 55b7eb2..fccb64d 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 _0x264f=['lead','contact','nothing','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0xabd460,_0x2bb00a){var _0x4ad7bc=function(_0x2221bf){while(--_0x2221bf){_0xabd460['push'](_0xabd460['shift']());}};_0x4ad7bc(++_0x2bb00a);}(_0x264f,0x184));var _0xf264=function(_0x4cb423,_0x5d0224){_0x4cb423=_0x4cb423-0x0;var _0x57d4c7=_0x264f[_0x4cb423];return _0x57d4c7;};'use strict';var Sequelize=require(_0xf264('0x0'));module[_0xf264('0x1')]={'name':{'type':Sequelize[_0xf264('0x2')]},'moduleCreate':{'type':Sequelize[_0xf264('0x3')](_0xf264('0x4'),_0xf264('0x5'),_0xf264('0x6')),'defaultValue':_0xf264('0x4')},'moduleSearch':{'type':Sequelize[_0xf264('0x3')](_0xf264('0x7'),_0xf264('0x5'),_0xf264('0x4')),'defaultValue':_0xf264('0x7')},'description':{'type':Sequelize[_0xf264('0x2')]}}; \ No newline at end of file +var _0x343e=['ENUM','lead','contact','nothing','sequelize','STRING'];(function(_0x2c4f0d,_0x548b92){var _0xdd0a84=function(_0x37ef15){while(--_0x37ef15){_0x2c4f0d['push'](_0x2c4f0d['shift']());}};_0xdd0a84(++_0x548b92);}(_0x343e,0x9a));var _0xe343=function(_0x51ceb2,_0x57bc0d){_0x51ceb2=_0x51ceb2-0x0;var _0x5dd621=_0x343e[_0x51ceb2];return _0x5dd621;};'use strict';var Sequelize=require(_0xe343('0x0'));module['exports']={'name':{'type':Sequelize[_0xe343('0x1')]},'moduleCreate':{'type':Sequelize[_0xe343('0x2')](_0xe343('0x3'),_0xe343('0x4'),_0xe343('0x5')),'defaultValue':_0xe343('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xe343('0x4'),_0xe343('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xe343('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 9577a40..49adfde 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 _0x310f=['reject','save','update','then','destroy','end','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','params','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','set','Content-Range','apply'];(function(_0x167021,_0x362edd){var _0x5386fb=function(_0x5b86c0){while(--_0x5b86c0){_0x167021['push'](_0x167021['shift']());}};_0x5386fb(++_0x362edd);}(_0x310f,0x1b5));var _0xf310=function(_0x1a5eb0,_0x12e6c8){_0x1a5eb0=_0x1a5eb0-0x0;var _0x12c788=_0x310f[_0x1a5eb0];return _0x12c788;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf310('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf310('0x1'));var rp=require(_0xf310('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf310('0x3'));var util=require(_0xf310('0x4'));var path=require(_0xf310('0x5'));var sox=require(_0xf310('0x6'));var csv=require(_0xf310('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf310('0x8'));var _=require(_0xf310('0x9'));var squel=require(_0xf310('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf310('0x7'));var querystring=require(_0xf310('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf310('0xc'));var qs=require(_0xf310('0xd'));var as=require(_0xf310('0xe'));var hardwareService=require(_0xf310('0xf'));var logger=require(_0xf310('0x10'))(_0xf310('0x11'));var utils=require(_0xf310('0x12'));var config=require(_0xf310('0x13'));var licenseUtil=require(_0xf310('0x14'));var db=require(_0xf310('0x15'))['db'];function respondWithStatusCode(_0x5a51de,_0x12a042){_0x12a042=_0x12a042||0xcc;return function(_0x3d9da8){if(_0x3d9da8){return _0x5a51de[_0xf310('0x16')](_0x12a042);}return _0x5a51de[_0xf310('0x17')](_0x12a042)['end']();};}function respondWithResult(_0x5e50a7,_0x3f1139){_0x3f1139=_0x3f1139||0xc8;return function(_0xd2d66c){if(_0xd2d66c){return _0x5e50a7[_0xf310('0x17')](_0x3f1139)[_0xf310('0x18')](_0xd2d66c);}};}function respondWithFilteredResult(_0x1fc34e,_0x2ccf56){return function(_0x1ae154){if(_0x1ae154){var _0x1f4919=typeof _0x2ccf56['offset']==='undefined'&&typeof _0x2ccf56[_0xf310('0x19')]==='undefined';var _0x4f3861=_0x1ae154[_0xf310('0x1a')];var _0x323194=_0x1f4919?0x0:_0x2ccf56[_0xf310('0x1b')];var _0x30eec9=_0x1f4919?_0x1ae154['count']:_0x2ccf56[_0xf310('0x1b')]+_0x2ccf56[_0xf310('0x19')];var _0x3bf30d;if(_0x30eec9>=_0x4f3861){_0x30eec9=_0x4f3861;_0x3bf30d=0xc8;}else{_0x3bf30d=0xce;}_0x1fc34e[_0xf310('0x17')](_0x3bf30d);return _0x1fc34e[_0xf310('0x1c')](_0xf310('0x1d'),_0x323194+'-'+_0x30eec9+'/'+_0x4f3861)[_0xf310('0x18')](_0x1ae154);}return null;};}function patchUpdates(_0x19dea9){return function(_0x3b721d){try{jsonpatch[_0xf310('0x1e')](_0x3b721d,_0x19dea9,!![]);}catch(_0x101424){return BPromise[_0xf310('0x1f')](_0x101424);}return _0x3b721d[_0xf310('0x20')]();};}function saveUpdates(_0x2b3ded,_0x5afdbd){return function(_0x3aeb74){if(_0x3aeb74){return _0x3aeb74[_0xf310('0x21')](_0x2b3ded)[_0xf310('0x22')](function(_0x39909a){return _0x39909a;});}return null;};}function removeEntity(_0x29661b,_0x2eed20){return function(_0x414bb8){if(_0x414bb8){return _0x414bb8[_0xf310('0x23')]()[_0xf310('0x22')](function(){_0x29661b[_0xf310('0x17')](0xcc)[_0xf310('0x24')]();});}};}function handleEntityNotFound(_0x38f9f0,_0x111e22){return function(_0x2bd98f){if(!_0x2bd98f){_0x38f9f0['sendStatus'](0x194);}return _0x2bd98f;};}function handleError(_0x15fb76,_0x40ba1a){_0x40ba1a=_0x40ba1a||0x1f4;return function(_0x3dfc1c){logger[_0xf310('0x25')](_0x3dfc1c['stack']);if(_0x3dfc1c[_0xf310('0x26')]){delete _0x3dfc1c[_0xf310('0x26')];}_0x15fb76[_0xf310('0x17')](_0x40ba1a)[_0xf310('0x27')](_0x3dfc1c);};}exports[_0xf310('0x28')]=function(_0xe63fb1,_0x3608e3){var _0x5d586d={},_0x4de744={},_0x45eca6={'count':0x0,'rows':[]};var _0x2fdcc3=_[_0xf310('0x29')](db[_0xf310('0x2a')][_0xf310('0x2b')],function(_0x1ab7b1){return{'name':_0x1ab7b1[_0xf310('0x2c')],'type':_0x1ab7b1[_0xf310('0x2d')]['key']};});_0x4de744['model']=_[_0xf310('0x29')](_0x2fdcc3,_0xf310('0x26'));_0x4de744[_0xf310('0x2e')]=_[_0xf310('0x2f')](_0xe63fb1[_0xf310('0x2e')]);_0x4de744[_0xf310('0x30')]=_[_0xf310('0x31')](_0x4de744[_0xf310('0x32')],_0x4de744[_0xf310('0x2e')]);_0x5d586d[_0xf310('0x33')]=_[_0xf310('0x31')](_0x4de744[_0xf310('0x32')],qs[_0xf310('0x34')](_0xe63fb1['query'][_0xf310('0x34')]));_0x5d586d[_0xf310('0x33')]=_0x5d586d['attributes'][_0xf310('0x35')]?_0x5d586d['attributes']:_0x4de744[_0xf310('0x32')];if(!_0xe63fb1['query'][_0xf310('0x36')](_0xf310('0x37'))){_0x5d586d[_0xf310('0x19')]=qs['limit'](_0xe63fb1[_0xf310('0x2e')][_0xf310('0x19')]);_0x5d586d[_0xf310('0x1b')]=qs[_0xf310('0x1b')](_0xe63fb1[_0xf310('0x2e')][_0xf310('0x1b')]);}_0x5d586d[_0xf310('0x38')]=qs[_0xf310('0x39')](_0xe63fb1[_0xf310('0x2e')][_0xf310('0x39')]);_0x5d586d[_0xf310('0x3a')]=qs[_0xf310('0x30')](_['pick'](_0xe63fb1[_0xf310('0x2e')],_0x4de744[_0xf310('0x30')]),_0x2fdcc3);if(_0xe63fb1['query'][_0xf310('0x3b')]){_0x5d586d[_0xf310('0x3a')]=_[_0xf310('0x3c')](_0x5d586d[_0xf310('0x3a')],{'$or':_[_0xf310('0x29')](_0x2fdcc3,function(_0x4b399e){if(_0x4b399e[_0xf310('0x2d')]!==_0xf310('0x3d')){var _0x4f98d0={};_0x4f98d0[_0x4b399e[_0xf310('0x26')]]={'$like':'%'+_0xe63fb1[_0xf310('0x2e')][_0xf310('0x3b')]+'%'};return _0x4f98d0;}})});}_0x5d586d=_[_0xf310('0x3c')]({},_0x5d586d,_0xe63fb1[_0xf310('0x3e')]);var _0x357f50={'where':_0x5d586d[_0xf310('0x3a')]};return db[_0xf310('0x2a')][_0xf310('0x1a')](_0x357f50)['then'](function(_0xd1ecbc){_0x45eca6[_0xf310('0x1a')]=_0xd1ecbc;if(_0xe63fb1[_0xf310('0x2e')]['includeAll']){_0x5d586d[_0xf310('0x3f')]=[{'all':!![]}];}return db[_0xf310('0x2a')]['findAll'](_0x5d586d);})['then'](function(_0x164506){_0x45eca6[_0xf310('0x40')]=_0x164506;return _0x45eca6;})[_0xf310('0x22')](respondWithFilteredResult(_0x3608e3,_0x5d586d))[_0xf310('0x41')](handleError(_0x3608e3,null));};exports[_0xf310('0x42')]=function(_0x395693,_0x5cb0cf){var _0x1f680b={'raw':![],'where':{'id':_0x395693['params']['id']}},_0x4d2005={};_0x4d2005[_0xf310('0x32')]=_[_0xf310('0x2f')](db[_0xf310('0x2a')]['rawAttributes']);_0x4d2005['query']=_[_0xf310('0x2f')](_0x395693[_0xf310('0x2e')]);_0x4d2005['filters']=_['intersection'](_0x4d2005[_0xf310('0x32')],_0x4d2005[_0xf310('0x2e')]);_0x1f680b[_0xf310('0x33')]=_[_0xf310('0x31')](_0x4d2005[_0xf310('0x32')],qs['fields'](_0x395693['query'][_0xf310('0x34')]));_0x1f680b[_0xf310('0x33')]=_0x1f680b[_0xf310('0x33')]['length']?_0x1f680b['attributes']:_0x4d2005[_0xf310('0x32')];if(_0x395693[_0xf310('0x2e')][_0xf310('0x43')]){_0x1f680b[_0xf310('0x3f')]=[{'all':!![]}];}_0x1f680b=_['merge']({},_0x1f680b,_0x395693['options']);return db['ZohoConfiguration'][_0xf310('0x44')](_0x1f680b)[_0xf310('0x22')](handleEntityNotFound(_0x5cb0cf,null))[_0xf310('0x22')](respondWithResult(_0x5cb0cf,null))['catch'](handleError(_0x5cb0cf,null));};exports[_0xf310('0x45')]=function(_0x5c2335,_0x4c674c){return db[_0xf310('0x2a')][_0xf310('0x45')](_0x5c2335[_0xf310('0x46')],{})[_0xf310('0x22')](respondWithResult(_0x4c674c,0xc9))[_0xf310('0x41')](handleError(_0x4c674c,null));};exports[_0xf310('0x21')]=function(_0x463590,_0xf8e288){if(_0x463590[_0xf310('0x46')]['id']){delete _0x463590['body']['id'];}return db[_0xf310('0x2a')]['find']({'where':{'id':_0x463590[_0xf310('0x47')]['id']}})[_0xf310('0x22')](handleEntityNotFound(_0xf8e288,null))['then'](saveUpdates(_0x463590[_0xf310('0x46')],null))[_0xf310('0x22')](respondWithResult(_0xf8e288,null))[_0xf310('0x41')](handleError(_0xf8e288,null));};exports[_0xf310('0x23')]=function(_0x2244de,_0xcc7986){return db[_0xf310('0x2a')]['find']({'where':{'id':_0x2244de[_0xf310('0x47')]['id']}})[_0xf310('0x22')](handleEntityNotFound(_0xcc7986,null))['then'](removeEntity(_0xcc7986,null))[_0xf310('0x41')](handleError(_0xcc7986,null));};exports[_0xf310('0x48')]=function(_0x49d77f,_0x526fb5,_0x55f643){var _0x3639ce={};var _0xeec0c1={};var _0x47e528;var _0x3cc1f9;return db[_0xf310('0x2a')][_0xf310('0x49')]({'where':{'id':_0x49d77f[_0xf310('0x47')]['id']}})[_0xf310('0x22')](handleEntityNotFound(_0x526fb5,null))[_0xf310('0x22')](function(_0x4cba9d){if(_0x4cba9d){_0x47e528=_0x4cba9d;_0xeec0c1['model']=_[_0xf310('0x2f')](db[_0xf310('0x4a')]['rawAttributes']);_0xeec0c1['query']=_[_0xf310('0x2f')](_0x49d77f[_0xf310('0x2e')]);_0xeec0c1[_0xf310('0x30')]=_['intersection'](_0xeec0c1[_0xf310('0x32')],_0xeec0c1[_0xf310('0x2e')]);_0x3639ce[_0xf310('0x33')]=_[_0xf310('0x31')](_0xeec0c1['model'],qs[_0xf310('0x34')](_0x49d77f['query'][_0xf310('0x34')]));_0x3639ce[_0xf310('0x33')]=_0x3639ce[_0xf310('0x33')][_0xf310('0x35')]?_0x3639ce['attributes']:_0xeec0c1[_0xf310('0x32')];_0x3639ce[_0xf310('0x38')]=qs['sort'](_0x49d77f['query']['sort']);_0x3639ce[_0xf310('0x3a')]=qs['filters'](_['pick'](_0x49d77f['query'],_0xeec0c1[_0xf310('0x30')]));if(_0x49d77f['query'][_0xf310('0x3b')]){_0x3639ce['where']=_[_0xf310('0x3c')](_0x3639ce['where'],{'$or':_[_0xf310('0x29')](_0x3639ce[_0xf310('0x33')],function(_0x50b3c2){var _0x248d15={};_0x248d15[_0x50b3c2]={'$like':'%'+_0x49d77f[_0xf310('0x2e')][_0xf310('0x3b')]+'%'};return _0x248d15;})});}_0x3639ce=_['merge']({},_0x3639ce,_0x49d77f[_0xf310('0x3e')]);return _0x47e528['getFields'](_0x3639ce);}})[_0xf310('0x22')](function(_0x153175){if(_0x153175){_0x3cc1f9=_0x153175[_0xf310('0x35')];if(!_0x49d77f[_0xf310('0x2e')]['hasOwnProperty'](_0xf310('0x37'))){_0x3639ce['limit']=qs[_0xf310('0x19')](_0x49d77f[_0xf310('0x2e')][_0xf310('0x19')]);_0x3639ce[_0xf310('0x1b')]=qs[_0xf310('0x1b')](_0x49d77f['query'][_0xf310('0x1b')]);}return _0x47e528[_0xf310('0x48')](_0x3639ce);}})['then'](function(_0x2ee79f){if(_0x2ee79f){return _0x2ee79f?{'count':_0x3cc1f9,'rows':_0x2ee79f}:null;}})['then'](respondWithResult(_0x526fb5,null))[_0xf310('0x41')](handleError(_0x526fb5,null));};exports['getSubjects']=function(_0x298efb,_0x336e99,_0x29008f){var _0x5c2b42={};var _0x1294b2={};var _0x3b7155;var _0x15c480;return db[_0xf310('0x2a')]['findOne']({'where':{'id':_0x298efb['params']['id']}})[_0xf310('0x22')](handleEntityNotFound(_0x336e99,null))[_0xf310('0x22')](function(_0x446885){if(_0x446885){_0x3b7155=_0x446885;_0x1294b2['model']=_[_0xf310('0x2f')](db[_0xf310('0x4a')][_0xf310('0x2b')]);_0x1294b2[_0xf310('0x2e')]=_[_0xf310('0x2f')](_0x298efb['query']);_0x1294b2[_0xf310('0x30')]=_[_0xf310('0x31')](_0x1294b2[_0xf310('0x32')],_0x1294b2[_0xf310('0x2e')]);_0x5c2b42['attributes']=_['intersection'](_0x1294b2['model'],qs['fields'](_0x298efb[_0xf310('0x2e')][_0xf310('0x34')]));_0x5c2b42[_0xf310('0x33')]=_0x5c2b42['attributes'][_0xf310('0x35')]?_0x5c2b42[_0xf310('0x33')]:_0x1294b2[_0xf310('0x32')];_0x5c2b42['order']=qs['sort'](_0x298efb['query']['sort']);_0x5c2b42[_0xf310('0x3a')]=qs[_0xf310('0x30')](_[_0xf310('0x4b')](_0x298efb[_0xf310('0x2e')],_0x1294b2[_0xf310('0x30')]));if(_0x298efb['query']['filter']){_0x5c2b42[_0xf310('0x3a')]=_[_0xf310('0x3c')](_0x5c2b42['where'],{'$or':_[_0xf310('0x29')](_0x5c2b42[_0xf310('0x33')],function(_0x482f15){var _0xcf6013={};_0xcf6013[_0x482f15]={'$like':'%'+_0x298efb[_0xf310('0x2e')][_0xf310('0x3b')]+'%'};return _0xcf6013;})});}_0x5c2b42=_['merge']({},_0x5c2b42,_0x298efb[_0xf310('0x3e')]);return _0x3b7155[_0xf310('0x4c')](_0x5c2b42);}})[_0xf310('0x22')](function(_0x33e2af){if(_0x33e2af){_0x15c480=_0x33e2af[_0xf310('0x35')];if(!_0x298efb[_0xf310('0x2e')][_0xf310('0x36')](_0xf310('0x37'))){_0x5c2b42[_0xf310('0x19')]=qs['limit'](_0x298efb[_0xf310('0x2e')][_0xf310('0x19')]);_0x5c2b42['offset']=qs[_0xf310('0x1b')](_0x298efb[_0xf310('0x2e')]['offset']);}return _0x3b7155[_0xf310('0x4c')](_0x5c2b42);}})[_0xf310('0x22')](function(_0x117a0a){if(_0x117a0a){return _0x117a0a?{'count':_0x15c480,'rows':_0x117a0a}:null;}})[_0xf310('0x22')](respondWithResult(_0x336e99,null))[_0xf310('0x41')](handleError(_0x336e99,null));};exports[_0xf310('0x4d')]=function(_0x4f445d,_0xc52340,_0x3205da){var _0x4ac0df={};var _0x514b92={};var _0x3b67b3;var _0x28cf9d;return db[_0xf310('0x2a')][_0xf310('0x49')]({'where':{'id':_0x4f445d[_0xf310('0x47')]['id']}})[_0xf310('0x22')](handleEntityNotFound(_0xc52340,null))[_0xf310('0x22')](function(_0x2dcb3b){if(_0x2dcb3b){_0x3b67b3=_0x2dcb3b;_0x514b92[_0xf310('0x32')]=_['keys'](db['ZohoField'][_0xf310('0x2b')]);_0x514b92[_0xf310('0x2e')]=_[_0xf310('0x2f')](_0x4f445d[_0xf310('0x2e')]);_0x514b92['filters']=_[_0xf310('0x31')](_0x514b92[_0xf310('0x32')],_0x514b92[_0xf310('0x2e')]);_0x4ac0df['attributes']=_[_0xf310('0x31')](_0x514b92['model'],qs['fields'](_0x4f445d[_0xf310('0x2e')][_0xf310('0x34')]));_0x4ac0df['attributes']=_0x4ac0df[_0xf310('0x33')][_0xf310('0x35')]?_0x4ac0df[_0xf310('0x33')]:_0x514b92[_0xf310('0x32')];_0x4ac0df[_0xf310('0x38')]=qs[_0xf310('0x39')](_0x4f445d[_0xf310('0x2e')][_0xf310('0x39')]);_0x4ac0df[_0xf310('0x3a')]=qs[_0xf310('0x30')](_['pick'](_0x4f445d[_0xf310('0x2e')],_0x514b92[_0xf310('0x30')]));if(_0x4f445d[_0xf310('0x2e')][_0xf310('0x3b')]){_0x4ac0df['where']=_[_0xf310('0x3c')](_0x4ac0df[_0xf310('0x3a')],{'$or':_['map'](_0x4ac0df[_0xf310('0x33')],function(_0x2afa01){var _0x24d46b={};_0x24d46b[_0x2afa01]={'$like':'%'+_0x4f445d['query'][_0xf310('0x3b')]+'%'};return _0x24d46b;})});}_0x4ac0df=_[_0xf310('0x3c')]({},_0x4ac0df,_0x4f445d[_0xf310('0x3e')]);return _0x3b67b3[_0xf310('0x4d')](_0x4ac0df);}})[_0xf310('0x22')](function(_0x47e855){if(_0x47e855){_0x28cf9d=_0x47e855[_0xf310('0x35')];if(!_0x4f445d[_0xf310('0x2e')][_0xf310('0x36')]('nolimit')){_0x4ac0df[_0xf310('0x19')]=qs['limit'](_0x4f445d[_0xf310('0x2e')][_0xf310('0x19')]);_0x4ac0df[_0xf310('0x1b')]=qs[_0xf310('0x1b')](_0x4f445d['query']['offset']);}return _0x3b67b3[_0xf310('0x4d')](_0x4ac0df);}})[_0xf310('0x22')](function(_0x2b164c){if(_0x2b164c){return _0x2b164c?{'count':_0x28cf9d,'rows':_0x2b164c}:null;}})[_0xf310('0x22')](respondWithResult(_0xc52340,null))[_0xf310('0x41')](handleError(_0xc52340,null));}; \ No newline at end of file +var _0x86c0=['fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','findOne','ZohoField','filter','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x86c0,0x186));var _0x086c=function(_0x1eb712,_0x304d08){_0x1eb712=_0x1eb712-0x0;var _0xdf43e7=_0x86c0[_0x1eb712];return _0xdf43e7;};'use strict';var emlformat=require(_0x086c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x086c('0x1'));var jsonpatch=require(_0x086c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x086c('0x3'));var Mustache=require(_0x086c('0x4'));var util=require(_0x086c('0x5'));var path=require(_0x086c('0x6'));var sox=require(_0x086c('0x7'));var csv=require(_0x086c('0x8'));var ejs=require(_0x086c('0x9'));var fs=require('fs');var fs_extra=require(_0x086c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x086c('0xb'));var jsforce=require(_0x086c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x086c('0xd'));var Papa=require(_0x086c('0xe'));var Redis=require('ioredis');var authService=require(_0x086c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x086c('0x10'));var hardwareService=require(_0x086c('0x11'));var logger=require(_0x086c('0x12'))(_0x086c('0x13'));var utils=require(_0x086c('0x14'));var config=require(_0x086c('0x15'));var licenseUtil=require(_0x086c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb3cfba,_0x5dbb40){_0x5dbb40=_0x5dbb40||0xcc;return function(_0x478056){if(_0x478056){return _0xb3cfba['sendStatus'](_0x5dbb40);}return _0xb3cfba[_0x086c('0x17')](_0x5dbb40)[_0x086c('0x18')]();};}function respondWithResult(_0x15a30a,_0x59db2a){_0x59db2a=_0x59db2a||0xc8;return function(_0x526183){if(_0x526183){return _0x15a30a['status'](_0x59db2a)[_0x086c('0x19')](_0x526183);}};}function respondWithFilteredResult(_0x49fd93,_0x19e7e6){return function(_0xf363fd){if(_0xf363fd){var _0x5749e1=typeof _0x19e7e6[_0x086c('0x1a')]===_0x086c('0x1b')&&typeof _0x19e7e6['limit']===_0x086c('0x1b');var _0x1f622f=_0xf363fd[_0x086c('0x1c')];var _0x588d2d=_0x5749e1?0x0:_0x19e7e6[_0x086c('0x1a')];var _0x40f922=_0x5749e1?_0xf363fd[_0x086c('0x1c')]:_0x19e7e6['offset']+_0x19e7e6['limit'];var _0x26bc95;if(_0x40f922>=_0x1f622f){_0x40f922=_0x1f622f;_0x26bc95=0xc8;}else{_0x26bc95=0xce;}_0x49fd93[_0x086c('0x17')](_0x26bc95);return _0x49fd93[_0x086c('0x1d')](_0x086c('0x1e'),_0x588d2d+'-'+_0x40f922+'/'+_0x1f622f)[_0x086c('0x19')](_0xf363fd);}return null;};}function patchUpdates(_0x589260){return function(_0x1e75e3){try{jsonpatch[_0x086c('0x1f')](_0x1e75e3,_0x589260,!![]);}catch(_0x1f36b0){return BPromise[_0x086c('0x20')](_0x1f36b0);}return _0x1e75e3['save']();};}function saveUpdates(_0x51c230,_0x52d152){return function(_0x208298){if(_0x208298){return _0x208298[_0x086c('0x21')](_0x51c230)['then'](function(_0x2a80e9){return _0x2a80e9;});}return null;};}function removeEntity(_0x57d386,_0x77c667){return function(_0x27055b){if(_0x27055b){return _0x27055b[_0x086c('0x22')]()[_0x086c('0x23')](function(){_0x57d386[_0x086c('0x17')](0xcc)[_0x086c('0x18')]();});}};}function handleEntityNotFound(_0x5f1767,_0x1c5b02){return function(_0x2d7825){if(!_0x2d7825){_0x5f1767[_0x086c('0x24')](0x194);}return _0x2d7825;};}function handleError(_0x26f597,_0x50b7f6){_0x50b7f6=_0x50b7f6||0x1f4;return function(_0x6ccc6c){logger[_0x086c('0x25')](_0x6ccc6c[_0x086c('0x26')]);if(_0x6ccc6c[_0x086c('0x27')]){delete _0x6ccc6c[_0x086c('0x27')];}_0x26f597['status'](_0x50b7f6)[_0x086c('0x28')](_0x6ccc6c);};}exports[_0x086c('0x29')]=function(_0x42bbb4,_0xc20e53){var _0x18d420={},_0x54c1ff={},_0x27df46={'count':0x0,'rows':[]};var _0x475853=_[_0x086c('0x2a')](db[_0x086c('0x2b')][_0x086c('0x2c')],function(_0x4c488f){return{'name':_0x4c488f[_0x086c('0x2d')],'type':_0x4c488f[_0x086c('0x2e')][_0x086c('0x2f')]};});_0x54c1ff[_0x086c('0x30')]=_[_0x086c('0x2a')](_0x475853,_0x086c('0x27'));_0x54c1ff[_0x086c('0x31')]=_[_0x086c('0x32')](_0x42bbb4['query']);_0x54c1ff[_0x086c('0x33')]=_['intersection'](_0x54c1ff[_0x086c('0x30')],_0x54c1ff[_0x086c('0x31')]);_0x18d420[_0x086c('0x34')]=_[_0x086c('0x35')](_0x54c1ff[_0x086c('0x30')],qs[_0x086c('0x36')](_0x42bbb4[_0x086c('0x31')][_0x086c('0x36')]));_0x18d420[_0x086c('0x34')]=_0x18d420[_0x086c('0x34')][_0x086c('0x37')]?_0x18d420[_0x086c('0x34')]:_0x54c1ff[_0x086c('0x30')];if(!_0x42bbb4[_0x086c('0x31')][_0x086c('0x38')](_0x086c('0x39'))){_0x18d420[_0x086c('0x3a')]=qs[_0x086c('0x3a')](_0x42bbb4['query'][_0x086c('0x3a')]);_0x18d420['offset']=qs[_0x086c('0x1a')](_0x42bbb4[_0x086c('0x31')][_0x086c('0x1a')]);}_0x18d420[_0x086c('0x3b')]=qs[_0x086c('0x3c')](_0x42bbb4[_0x086c('0x31')][_0x086c('0x3c')]);_0x18d420[_0x086c('0x3d')]=qs[_0x086c('0x33')](_[_0x086c('0x3e')](_0x42bbb4['query'],_0x54c1ff['filters']),_0x475853);if(_0x42bbb4[_0x086c('0x31')]['filter']){_0x18d420[_0x086c('0x3d')]=_[_0x086c('0x3f')](_0x18d420[_0x086c('0x3d')],{'$or':_[_0x086c('0x2a')](_0x475853,function(_0x1e8928){if(_0x1e8928['type']!==_0x086c('0x40')){var _0x583f95={};_0x583f95[_0x1e8928[_0x086c('0x27')]]={'$like':'%'+_0x42bbb4[_0x086c('0x31')]['filter']+'%'};return _0x583f95;}})});}_0x18d420=_['merge']({},_0x18d420,_0x42bbb4[_0x086c('0x41')]);var _0xb22998={'where':_0x18d420['where']};return db[_0x086c('0x2b')][_0x086c('0x1c')](_0xb22998)[_0x086c('0x23')](function(_0x47ac50){_0x27df46[_0x086c('0x1c')]=_0x47ac50;if(_0x42bbb4[_0x086c('0x31')][_0x086c('0x42')]){_0x18d420[_0x086c('0x43')]=[{'all':!![]}];}return db[_0x086c('0x2b')]['findAll'](_0x18d420);})[_0x086c('0x23')](function(_0x9bfbf2){_0x27df46[_0x086c('0x44')]=_0x9bfbf2;return _0x27df46;})[_0x086c('0x23')](respondWithFilteredResult(_0xc20e53,_0x18d420))[_0x086c('0x45')](handleError(_0xc20e53,null));};exports[_0x086c('0x46')]=function(_0x2b90eb,_0x4b16d4){var _0x1a8bca={'raw':![],'where':{'id':_0x2b90eb[_0x086c('0x47')]['id']}},_0xb701db={};_0xb701db['model']=_[_0x086c('0x32')](db[_0x086c('0x2b')]['rawAttributes']);_0xb701db['query']=_[_0x086c('0x32')](_0x2b90eb['query']);_0xb701db[_0x086c('0x33')]=_[_0x086c('0x35')](_0xb701db[_0x086c('0x30')],_0xb701db[_0x086c('0x31')]);_0x1a8bca[_0x086c('0x34')]=_[_0x086c('0x35')](_0xb701db['model'],qs[_0x086c('0x36')](_0x2b90eb[_0x086c('0x31')][_0x086c('0x36')]));_0x1a8bca[_0x086c('0x34')]=_0x1a8bca['attributes'][_0x086c('0x37')]?_0x1a8bca['attributes']:_0xb701db['model'];if(_0x2b90eb[_0x086c('0x31')]['includeAll']){_0x1a8bca[_0x086c('0x43')]=[{'all':!![]}];}_0x1a8bca=_[_0x086c('0x3f')]({},_0x1a8bca,_0x2b90eb['options']);return db[_0x086c('0x2b')][_0x086c('0x48')](_0x1a8bca)[_0x086c('0x23')](handleEntityNotFound(_0x4b16d4,null))[_0x086c('0x23')](respondWithResult(_0x4b16d4,null))['catch'](handleError(_0x4b16d4,null));};exports['create']=function(_0x12992c,_0x42efa1){return db['ZohoConfiguration']['create'](_0x12992c[_0x086c('0x49')],{})['then'](respondWithResult(_0x42efa1,0xc9))['catch'](handleError(_0x42efa1,null));};exports[_0x086c('0x21')]=function(_0x2d757a,_0xa33e36){if(_0x2d757a[_0x086c('0x49')]['id']){delete _0x2d757a[_0x086c('0x49')]['id'];}return db[_0x086c('0x2b')]['find']({'where':{'id':_0x2d757a[_0x086c('0x47')]['id']}})[_0x086c('0x23')](handleEntityNotFound(_0xa33e36,null))[_0x086c('0x23')](saveUpdates(_0x2d757a[_0x086c('0x49')],null))[_0x086c('0x23')](respondWithResult(_0xa33e36,null))['catch'](handleError(_0xa33e36,null));};exports[_0x086c('0x22')]=function(_0x27d15a,_0x187275){return db[_0x086c('0x2b')][_0x086c('0x48')]({'where':{'id':_0x27d15a['params']['id']}})[_0x086c('0x23')](handleEntityNotFound(_0x187275,null))[_0x086c('0x23')](removeEntity(_0x187275,null))[_0x086c('0x45')](handleError(_0x187275,null));};exports['getFields']=function(_0x3be484,_0x58580b,_0x4cf8af){var _0x1f3e1d={};var _0x19faed={};var _0x386dab;var _0x3968bc;return db[_0x086c('0x2b')][_0x086c('0x4a')]({'where':{'id':_0x3be484[_0x086c('0x47')]['id']}})[_0x086c('0x23')](handleEntityNotFound(_0x58580b,null))[_0x086c('0x23')](function(_0x22e8bd){if(_0x22e8bd){_0x386dab=_0x22e8bd;_0x19faed['model']=_[_0x086c('0x32')](db[_0x086c('0x4b')][_0x086c('0x2c')]);_0x19faed[_0x086c('0x31')]=_[_0x086c('0x32')](_0x3be484[_0x086c('0x31')]);_0x19faed[_0x086c('0x33')]=_[_0x086c('0x35')](_0x19faed[_0x086c('0x30')],_0x19faed['query']);_0x1f3e1d[_0x086c('0x34')]=_['intersection'](_0x19faed[_0x086c('0x30')],qs[_0x086c('0x36')](_0x3be484[_0x086c('0x31')]['fields']));_0x1f3e1d[_0x086c('0x34')]=_0x1f3e1d[_0x086c('0x34')][_0x086c('0x37')]?_0x1f3e1d['attributes']:_0x19faed[_0x086c('0x30')];_0x1f3e1d[_0x086c('0x3b')]=qs[_0x086c('0x3c')](_0x3be484[_0x086c('0x31')]['sort']);_0x1f3e1d[_0x086c('0x3d')]=qs['filters'](_['pick'](_0x3be484['query'],_0x19faed['filters']));if(_0x3be484[_0x086c('0x31')][_0x086c('0x4c')]){_0x1f3e1d[_0x086c('0x3d')]=_['merge'](_0x1f3e1d[_0x086c('0x3d')],{'$or':_[_0x086c('0x2a')](_0x1f3e1d[_0x086c('0x34')],function(_0x468c05){var _0x35a318={};_0x35a318[_0x468c05]={'$like':'%'+_0x3be484[_0x086c('0x31')][_0x086c('0x4c')]+'%'};return _0x35a318;})});}_0x1f3e1d=_[_0x086c('0x3f')]({},_0x1f3e1d,_0x3be484[_0x086c('0x41')]);return _0x386dab['getFields'](_0x1f3e1d);}})['then'](function(_0x16760c){if(_0x16760c){_0x3968bc=_0x16760c[_0x086c('0x37')];if(!_0x3be484[_0x086c('0x31')]['hasOwnProperty'](_0x086c('0x39'))){_0x1f3e1d[_0x086c('0x3a')]=qs[_0x086c('0x3a')](_0x3be484[_0x086c('0x31')][_0x086c('0x3a')]);_0x1f3e1d[_0x086c('0x1a')]=qs[_0x086c('0x1a')](_0x3be484[_0x086c('0x31')]['offset']);}return _0x386dab[_0x086c('0x4d')](_0x1f3e1d);}})[_0x086c('0x23')](function(_0x482594){if(_0x482594){return _0x482594?{'count':_0x3968bc,'rows':_0x482594}:null;}})[_0x086c('0x23')](respondWithResult(_0x58580b,null))['catch'](handleError(_0x58580b,null));};exports[_0x086c('0x4e')]=function(_0x405435,_0x41409c,_0x27bb97){var _0x54bf82={};var _0x416c65={};var _0x52cf47;var _0x502d32;return db[_0x086c('0x2b')][_0x086c('0x4a')]({'where':{'id':_0x405435[_0x086c('0x47')]['id']}})['then'](handleEntityNotFound(_0x41409c,null))[_0x086c('0x23')](function(_0x46876e){if(_0x46876e){_0x52cf47=_0x46876e;_0x416c65['model']=_[_0x086c('0x32')](db[_0x086c('0x4b')][_0x086c('0x2c')]);_0x416c65[_0x086c('0x31')]=_[_0x086c('0x32')](_0x405435[_0x086c('0x31')]);_0x416c65[_0x086c('0x33')]=_[_0x086c('0x35')](_0x416c65['model'],_0x416c65[_0x086c('0x31')]);_0x54bf82[_0x086c('0x34')]=_[_0x086c('0x35')](_0x416c65[_0x086c('0x30')],qs[_0x086c('0x36')](_0x405435[_0x086c('0x31')][_0x086c('0x36')]));_0x54bf82[_0x086c('0x34')]=_0x54bf82[_0x086c('0x34')]['length']?_0x54bf82[_0x086c('0x34')]:_0x416c65[_0x086c('0x30')];_0x54bf82[_0x086c('0x3b')]=qs['sort'](_0x405435['query'][_0x086c('0x3c')]);_0x54bf82[_0x086c('0x3d')]=qs[_0x086c('0x33')](_[_0x086c('0x3e')](_0x405435['query'],_0x416c65['filters']));if(_0x405435[_0x086c('0x31')][_0x086c('0x4c')]){_0x54bf82[_0x086c('0x3d')]=_[_0x086c('0x3f')](_0x54bf82[_0x086c('0x3d')],{'$or':_['map'](_0x54bf82[_0x086c('0x34')],function(_0x2c515e){var _0x24c83b={};_0x24c83b[_0x2c515e]={'$like':'%'+_0x405435[_0x086c('0x31')][_0x086c('0x4c')]+'%'};return _0x24c83b;})});}_0x54bf82=_[_0x086c('0x3f')]({},_0x54bf82,_0x405435['options']);return _0x52cf47[_0x086c('0x4e')](_0x54bf82);}})[_0x086c('0x23')](function(_0x1f00b1){if(_0x1f00b1){_0x502d32=_0x1f00b1[_0x086c('0x37')];if(!_0x405435[_0x086c('0x31')][_0x086c('0x38')]('nolimit')){_0x54bf82['limit']=qs[_0x086c('0x3a')](_0x405435[_0x086c('0x31')][_0x086c('0x3a')]);_0x54bf82[_0x086c('0x1a')]=qs['offset'](_0x405435[_0x086c('0x31')][_0x086c('0x1a')]);}return _0x52cf47[_0x086c('0x4e')](_0x54bf82);}})[_0x086c('0x23')](function(_0x380116){if(_0x380116){return _0x380116?{'count':_0x502d32,'rows':_0x380116}:null;}})[_0x086c('0x23')](respondWithResult(_0x41409c,null))['catch'](handleError(_0x41409c,null));};exports[_0x086c('0x4f')]=function(_0x3efd71,_0x3186ac,_0x59df25){var _0x57f2d2={};var _0x2cc282={};var _0x2cf515;var _0x2e8e94;return db[_0x086c('0x2b')][_0x086c('0x4a')]({'where':{'id':_0x3efd71[_0x086c('0x47')]['id']}})[_0x086c('0x23')](handleEntityNotFound(_0x3186ac,null))[_0x086c('0x23')](function(_0x3ddaae){if(_0x3ddaae){_0x2cf515=_0x3ddaae;_0x2cc282[_0x086c('0x30')]=_[_0x086c('0x32')](db[_0x086c('0x4b')][_0x086c('0x2c')]);_0x2cc282[_0x086c('0x31')]=_['keys'](_0x3efd71['query']);_0x2cc282['filters']=_[_0x086c('0x35')](_0x2cc282[_0x086c('0x30')],_0x2cc282[_0x086c('0x31')]);_0x57f2d2[_0x086c('0x34')]=_[_0x086c('0x35')](_0x2cc282[_0x086c('0x30')],qs[_0x086c('0x36')](_0x3efd71[_0x086c('0x31')][_0x086c('0x36')]));_0x57f2d2[_0x086c('0x34')]=_0x57f2d2['attributes'][_0x086c('0x37')]?_0x57f2d2['attributes']:_0x2cc282[_0x086c('0x30')];_0x57f2d2[_0x086c('0x3b')]=qs[_0x086c('0x3c')](_0x3efd71['query'][_0x086c('0x3c')]);_0x57f2d2[_0x086c('0x3d')]=qs[_0x086c('0x33')](_['pick'](_0x3efd71[_0x086c('0x31')],_0x2cc282[_0x086c('0x33')]));if(_0x3efd71[_0x086c('0x31')][_0x086c('0x4c')]){_0x57f2d2[_0x086c('0x3d')]=_['merge'](_0x57f2d2[_0x086c('0x3d')],{'$or':_['map'](_0x57f2d2[_0x086c('0x34')],function(_0x115e23){var _0x11215e={};_0x11215e[_0x115e23]={'$like':'%'+_0x3efd71['query']['filter']+'%'};return _0x11215e;})});}_0x57f2d2=_['merge']({},_0x57f2d2,_0x3efd71[_0x086c('0x41')]);return _0x2cf515[_0x086c('0x4f')](_0x57f2d2);}})['then'](function(_0x1b0b17){if(_0x1b0b17){_0x2e8e94=_0x1b0b17['length'];if(!_0x3efd71['query']['hasOwnProperty']('nolimit')){_0x57f2d2[_0x086c('0x3a')]=qs['limit'](_0x3efd71['query'][_0x086c('0x3a')]);_0x57f2d2['offset']=qs['offset'](_0x3efd71[_0x086c('0x31')][_0x086c('0x1a')]);}return _0x2cf515['getDescriptions'](_0x57f2d2);}})[_0x086c('0x23')](function(_0x430ccb){if(_0x430ccb){return _0x430ccb?{'count':_0x2e8e94,'rows':_0x430ccb}:null;}})['then'](respondWithResult(_0x3186ac,null))[_0x086c('0x45')](handleError(_0x3186ac,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 893767e..bfcaede 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 _0xeb83=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x30375c,_0x4747a6){var _0x219b4d=function(_0x97adbb){while(--_0x97adbb){_0x30375c['push'](_0x30375c['shift']());}};_0x219b4d(++_0x4747a6);}(_0xeb83,0x177));var _0x3eb8=function(_0x155f72,_0x4dad8f){_0x155f72=_0x155f72-0x0;var _0xa796f7=_0xeb83[_0x155f72];return _0xa796f7;};'use strict';var _=require(_0x3eb8('0x0'));var util=require(_0x3eb8('0x1'));var logger=require(_0x3eb8('0x2'))(_0x3eb8('0x3'));var moment=require(_0x3eb8('0x4'));var BPromise=require(_0x3eb8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3eb8('0x6'));var rimraf=require(_0x3eb8('0x7'));var config=require(_0x3eb8('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0x3eb8('0x9')]=function(_0x559bf9,_0x283386){return _0x559bf9[_0x3eb8('0xa')](_0x3eb8('0xb'),attributes,{'tableName':_0x3eb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb3e=['util','../../config/logger','api','moment','request-promise','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0xbb3e,0x190));var _0xebb3=function(_0xf3da2a,_0x58aaa0){_0xf3da2a=_0xf3da2a-0x0;var _0x5e649a=_0xbb3e[_0xf3da2a];return _0x5e649a;};'use strict';var _=require('lodash');var util=require(_0xebb3('0x0'));var logger=require(_0xebb3('0x1'))(_0xebb3('0x2'));var moment=require(_0xebb3('0x3'));var BPromise=require('bluebird');var rp=require(_0xebb3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xebb3('0x5'));module[_0xebb3('0x6')]=function(_0x5f0d6c,_0x2dd987){return _0x5f0d6c[_0xebb3('0x7')](_0xebb3('0x8'),attributes,{'tableName':_0xebb3('0x9'),'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 de97989..80e1e90 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 _0xb039=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','catch','util','moment','bluebird'];(function(_0x4e3292,_0x2e25ae){var _0x151ea7=function(_0x456edb){while(--_0x456edb){_0x4e3292['push'](_0x4e3292['shift']());}};_0x151ea7(++_0x2e25ae);}(_0xb039,0x1e0));var _0x9b03=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0xb039[_0x4c73ac];return _0x9839ee;};'use strict';var _=require('lodash');var util=require(_0x9b03('0x0'));var moment=require(_0x9b03('0x1'));var BPromise=require(_0x9b03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b03('0x3'));var logger=require(_0x9b03('0x4'))(_0x9b03('0x5'));var config=require('../../config/environment');var jayson=require(_0x9b03('0x6'));var client=jayson[_0x9b03('0x7')][_0x9b03('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9743dc,_0xd8774d,_0x4b83a7){return new BPromise(function(_0x325d04,_0x56bc2c){return client[_0x9b03('0x9')](_0x9743dc,_0x4b83a7)[_0x9b03('0xa')](function(_0x45605e){logger[_0x9b03('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0xd8774d,_0x9b03('0xc'));logger[_0x9b03('0xd')](_0x9b03('0xe'),_0xd8774d,'request\x20sent',JSON[_0x9b03('0xf')](_0x45605e));if(_0x45605e[_0x9b03('0x10')]){if(_0x45605e[_0x9b03('0x10')][_0x9b03('0x11')]===0x1f4){logger[_0x9b03('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0xd8774d,_0x45605e[_0x9b03('0x10')][_0x9b03('0x12')]);return _0x56bc2c(_0x45605e[_0x9b03('0x10')]['message']);}logger[_0x9b03('0x10')](_0x9b03('0x13'),_0xd8774d,_0x45605e[_0x9b03('0x10')]['message']);return _0x325d04(_0x45605e[_0x9b03('0x10')][_0x9b03('0x12')]);}else{logger['info'](_0x9b03('0x13'),_0xd8774d,_0x9b03('0xc'));_0x325d04(_0x45605e['result'][_0x9b03('0x12')]);}})[_0x9b03('0x14')](function(_0x1f1607){logger[_0x9b03('0x10')](_0x9b03('0x13'),_0xd8774d,_0x1f1607);_0x56bc2c(_0x1f1607);});});} \ No newline at end of file +var _0xb08b=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5c660e,_0x46ce61){var _0x4bc794=function(_0x25a100){while(--_0x25a100){_0x5c660e['push'](_0x5c660e['shift']());}};_0x4bc794(++_0x46ce61);}(_0xb08b,0x156));var _0xbb08=function(_0x5b5ecd,_0x187236){_0x5b5ecd=_0x5b5ecd-0x0;var _0x142ad6=_0xb08b[_0x5b5ecd];return _0x142ad6;};'use strict';var _=require(_0xbb08('0x0'));var util=require(_0xbb08('0x1'));var moment=require(_0xbb08('0x2'));var BPromise=require(_0xbb08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb08('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbb08('0x5'));var config=require(_0xbb08('0x6'));var jayson=require(_0xbb08('0x7'));var client=jayson[_0xbb08('0x8')][_0xbb08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49b638,_0x5e7c51,_0x1ead34){return new BPromise(function(_0x3bef98,_0x39ed9e){return client[_0xbb08('0xa')](_0x49b638,_0x1ead34)[_0xbb08('0xb')](function(_0x1e0fcb){logger[_0xbb08('0xc')](_0xbb08('0xd'),_0x5e7c51,'request\x20sent');logger[_0xbb08('0xe')](_0xbb08('0xf'),_0x5e7c51,_0xbb08('0x10'),JSON[_0xbb08('0x11')](_0x1e0fcb));if(_0x1e0fcb['error']){if(_0x1e0fcb[_0xbb08('0x12')]['code']===0x1f4){logger[_0xbb08('0x12')](_0xbb08('0xd'),_0x5e7c51,_0x1e0fcb[_0xbb08('0x12')][_0xbb08('0x13')]);return _0x39ed9e(_0x1e0fcb[_0xbb08('0x12')][_0xbb08('0x13')]);}logger['error'](_0xbb08('0xd'),_0x5e7c51,_0x1e0fcb[_0xbb08('0x12')][_0xbb08('0x13')]);return _0x3bef98(_0x1e0fcb[_0xbb08('0x12')]['message']);}else{logger[_0xbb08('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x5e7c51,_0xbb08('0x10'));_0x3bef98(_0x1e0fcb[_0xbb08('0x14')][_0xbb08('0x13')]);}})[_0xbb08('0x15')](function(_0x4fd651){logger[_0xbb08('0x12')](_0xbb08('0xd'),_0x5e7c51,_0x4fd651);_0x39ed9e(_0x4fd651);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 6b54f70..4ddb417 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 _0xd3e0=['../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1a4b34,_0x478844){var _0x33d5f7=function(_0x504ef8){while(--_0x504ef8){_0x1a4b34['push'](_0x1a4b34['shift']());}};_0x33d5f7(++_0x478844);}(_0xd3e0,0x12b));var _0x0d3e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd3e0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x0d3e('0x0'));var util=require(_0x0d3e('0x1'));var path=require(_0x0d3e('0x2'));var timeout=require(_0x0d3e('0x3'));var express=require(_0x0d3e('0x4'));var router=express[_0x0d3e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0d3e('0x6'));var interaction=require(_0x0d3e('0x7'));var config=require(_0x0d3e('0x8'));var controller=require(_0x0d3e('0x9'));router[_0x0d3e('0xa')]('/',auth[_0x0d3e('0xb')](),controller[_0x0d3e('0xc')]);router[_0x0d3e('0xa')](_0x0d3e('0xd'),auth[_0x0d3e('0xb')](),controller[_0x0d3e('0xe')]);router[_0x0d3e('0xf')]('/',auth[_0x0d3e('0xb')](),controller[_0x0d3e('0x10')]);router['put']('/:id',auth[_0x0d3e('0xb')](),controller['update']);router[_0x0d3e('0x11')](_0x0d3e('0xd'),auth[_0x0d3e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbea3=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x97a055,_0x2a0846){var _0xcbd7b7=function(_0x30007e){while(--_0x30007e){_0x97a055['push'](_0x97a055['shift']());}};_0xcbd7b7(++_0x2a0846);}(_0xbea3,0x1a6));var _0x3bea=function(_0xc0feef,_0x104170){_0xc0feef=_0xc0feef-0x0;var _0x1c1eae=_0xbea3[_0xc0feef];return _0x1c1eae;};'use strict';var multer=require(_0x3bea('0x0'));var util=require(_0x3bea('0x1'));var path=require(_0x3bea('0x2'));var timeout=require(_0x3bea('0x3'));var express=require(_0x3bea('0x4'));var router=express[_0x3bea('0x5')]();var fs_extra=require(_0x3bea('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3bea('0x7'));var config=require(_0x3bea('0x8'));var controller=require(_0x3bea('0x9'));router[_0x3bea('0xa')]('/',auth[_0x3bea('0xb')](),controller[_0x3bea('0xc')]);router['get'](_0x3bea('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x3bea('0xe')]('/',auth[_0x3bea('0xb')](),controller[_0x3bea('0xf')]);router[_0x3bea('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3bea('0x11')]);router['delete']('/:id',auth[_0x3bea('0xb')](),controller[_0x3bea('0x12')]);module[_0x3bea('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index fdcceab..05e3eb6 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 _0x1b47=['keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x5b3e90,_0x5a3dfe){var _0x282d9d=function(_0x4878c2){while(--_0x4878c2){_0x5b3e90['push'](_0x5b3e90['shift']());}};_0x282d9d(++_0x5a3dfe);}(_0x1b47,0x1e5));var _0x71b4=function(_0x3933b3,_0x3d6b90){_0x3933b3=_0x3933b3-0x0;var _0x241a71=_0x1b47[_0x3933b3];return _0x241a71;};'use strict';var Sequelize=require(_0x71b4('0x0'));module[_0x71b4('0x1')]={'type':{'type':Sequelize[_0x71b4('0x2')](_0x71b4('0x3'),_0x71b4('0x4'),'customVariable',_0x71b4('0x5'),_0x71b4('0x6')),'defaultValue':_0x71b4('0x3')},'content':{'type':Sequelize[_0x71b4('0x7')]},'key':{'type':Sequelize[_0x71b4('0x7')]},'keyType':{'type':Sequelize[_0x71b4('0x2')](_0x71b4('0x3'),_0x71b4('0x4'),_0x71b4('0x8'))},'keyContent':{'type':Sequelize[_0x71b4('0x7')]},'idField':{'type':Sequelize[_0x71b4('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x71b4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x71b4('0x7')]}}; \ No newline at end of file +var _0x2026=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','exports'];(function(_0x5e8612,_0x5aa18d){var _0xf3bf4c=function(_0x1692b3){while(--_0x1692b3){_0x5e8612['push'](_0x5e8612['shift']());}};_0xf3bf4c(++_0x5aa18d);}(_0x2026,0x127));var _0x6202=function(_0x23b58b,_0x25f978){_0x23b58b=_0x23b58b-0x0;var _0x30ad19=_0x2026[_0x23b58b];return _0x30ad19;};'use strict';var Sequelize=require('sequelize');module[_0x6202('0x0')]={'type':{'type':Sequelize[_0x6202('0x1')](_0x6202('0x2'),_0x6202('0x3'),_0x6202('0x4'),_0x6202('0x5'),_0x6202('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6202('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6202('0x1')](_0x6202('0x2'),_0x6202('0x3'),_0x6202('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6202('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6202('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b3efab6..352ff57 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 _0x943a=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ZohoField','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x943a,0x84));var _0xa943=function(_0x49a72f,_0x30ae91){_0x49a72f=_0x49a72f-0x0;var _0x4d2408=_0x943a[_0x49a72f];return _0x4d2408;};'use strict';var emlformat=require(_0xa943('0x0'));var rimraf=require(_0xa943('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa943('0x2'));var moment=require(_0xa943('0x3'));var BPromise=require(_0xa943('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa943('0x5'));var sox=require(_0xa943('0x6'));var csv=require(_0xa943('0x7'));var ejs=require(_0xa943('0x8'));var fs=require('fs');var fs_extra=require(_0xa943('0x9'));var _=require('lodash');var squel=require(_0xa943('0xa'));var crypto=require(_0xa943('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa943('0x7'));var querystring=require(_0xa943('0xc'));var Papa=require(_0xa943('0xd'));var Redis=require(_0xa943('0xe'));var authService=require(_0xa943('0xf'));var qs=require(_0xa943('0x10'));var as=require(_0xa943('0x11'));var hardwareService=require(_0xa943('0x12'));var logger=require(_0xa943('0x13'))(_0xa943('0x14'));var utils=require(_0xa943('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa943('0x16'));var db=require(_0xa943('0x17'))['db'];function respondWithStatusCode(_0x5e47d3,_0x6b798b){_0x6b798b=_0x6b798b||0xcc;return function(_0x34b110){if(_0x34b110){return _0x5e47d3[_0xa943('0x18')](_0x6b798b);}return _0x5e47d3[_0xa943('0x19')](_0x6b798b)[_0xa943('0x1a')]();};}function respondWithResult(_0x24800c,_0x3ff1cd){_0x3ff1cd=_0x3ff1cd||0xc8;return function(_0x601447){if(_0x601447){return _0x24800c[_0xa943('0x19')](_0x3ff1cd)[_0xa943('0x1b')](_0x601447);}};}function respondWithFilteredResult(_0x2021aa,_0x678501){return function(_0x2d3c48){if(_0x2d3c48){var _0x429ec0=typeof _0x678501[_0xa943('0x1c')]===_0xa943('0x1d')&&typeof _0x678501[_0xa943('0x1e')]===_0xa943('0x1d');var _0xb3927d=_0x2d3c48[_0xa943('0x1f')];var _0x5ef666=_0x429ec0?0x0:_0x678501[_0xa943('0x1c')];var _0x50c45d=_0x429ec0?_0x2d3c48['count']:_0x678501[_0xa943('0x1c')]+_0x678501[_0xa943('0x1e')];var _0x5a73c0;if(_0x50c45d>=_0xb3927d){_0x50c45d=_0xb3927d;_0x5a73c0=0xc8;}else{_0x5a73c0=0xce;}_0x2021aa['status'](_0x5a73c0);return _0x2021aa[_0xa943('0x20')](_0xa943('0x21'),_0x5ef666+'-'+_0x50c45d+'/'+_0xb3927d)[_0xa943('0x1b')](_0x2d3c48);}return null;};}function patchUpdates(_0x33c75e){return function(_0x4a04f8){try{jsonpatch[_0xa943('0x22')](_0x4a04f8,_0x33c75e,!![]);}catch(_0x880c6f){return BPromise['reject'](_0x880c6f);}return _0x4a04f8[_0xa943('0x23')]();};}function saveUpdates(_0x2b81d7,_0x423baa){return function(_0x1862f0){if(_0x1862f0){return _0x1862f0[_0xa943('0x24')](_0x2b81d7)[_0xa943('0x25')](function(_0x2ad2f1){return _0x2ad2f1;});}return null;};}function removeEntity(_0x2633f1,_0x3a6d98){return function(_0x3cf135){if(_0x3cf135){return _0x3cf135['destroy']()[_0xa943('0x25')](function(){_0x2633f1[_0xa943('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fad8,_0x4cb2c3){return function(_0x2480eb){if(!_0x2480eb){_0x39fad8[_0xa943('0x18')](0x194);}return _0x2480eb;};}function handleError(_0xe67607,_0x48bb04){_0x48bb04=_0x48bb04||0x1f4;return function(_0x398174){logger[_0xa943('0x26')](_0x398174[_0xa943('0x27')]);if(_0x398174['name']){delete _0x398174[_0xa943('0x28')];}_0xe67607[_0xa943('0x19')](_0x48bb04)[_0xa943('0x29')](_0x398174);};}exports[_0xa943('0x2a')]=function(_0x3abad6,_0x399cdf){var _0x26634a={},_0x4dacdf={},_0x45db17={'count':0x0,'rows':[]};var _0xdfc2cf=_[_0xa943('0x2b')](db[_0xa943('0x2c')][_0xa943('0x2d')],function(_0x218a65){return{'name':_0x218a65['fieldName'],'type':_0x218a65[_0xa943('0x2e')][_0xa943('0x2f')]};});_0x4dacdf['model']=_[_0xa943('0x2b')](_0xdfc2cf,_0xa943('0x28'));_0x4dacdf[_0xa943('0x30')]=_[_0xa943('0x31')](_0x3abad6['query']);_0x4dacdf[_0xa943('0x32')]=_[_0xa943('0x33')](_0x4dacdf[_0xa943('0x34')],_0x4dacdf[_0xa943('0x30')]);_0x26634a['attributes']=_[_0xa943('0x33')](_0x4dacdf[_0xa943('0x34')],qs[_0xa943('0x35')](_0x3abad6[_0xa943('0x30')][_0xa943('0x35')]));_0x26634a[_0xa943('0x36')]=_0x26634a['attributes']['length']?_0x26634a[_0xa943('0x36')]:_0x4dacdf[_0xa943('0x34')];if(!_0x3abad6['query'][_0xa943('0x37')](_0xa943('0x38'))){_0x26634a['limit']=qs[_0xa943('0x1e')](_0x3abad6['query'][_0xa943('0x1e')]);_0x26634a['offset']=qs[_0xa943('0x1c')](_0x3abad6[_0xa943('0x30')]['offset']);}_0x26634a[_0xa943('0x39')]=qs['sort'](_0x3abad6['query'][_0xa943('0x3a')]);_0x26634a['where']=qs[_0xa943('0x32')](_['pick'](_0x3abad6[_0xa943('0x30')],_0x4dacdf[_0xa943('0x32')]),_0xdfc2cf);if(_0x3abad6[_0xa943('0x30')][_0xa943('0x3b')]){_0x26634a[_0xa943('0x3c')]=_[_0xa943('0x3d')](_0x26634a[_0xa943('0x3c')],{'$or':_[_0xa943('0x2b')](_0xdfc2cf,function(_0xbb48f4){if(_0xbb48f4[_0xa943('0x2e')]!==_0xa943('0x3e')){var _0x2abb94={};_0x2abb94[_0xbb48f4[_0xa943('0x28')]]={'$like':'%'+_0x3abad6[_0xa943('0x30')]['filter']+'%'};return _0x2abb94;}})});}_0x26634a=_[_0xa943('0x3d')]({},_0x26634a,_0x3abad6[_0xa943('0x3f')]);var _0x5dd8fd={'where':_0x26634a[_0xa943('0x3c')]};return db['ZohoField'][_0xa943('0x1f')](_0x5dd8fd)['then'](function(_0x226c3b){_0x45db17[_0xa943('0x1f')]=_0x226c3b;if(_0x3abad6[_0xa943('0x30')][_0xa943('0x40')]){_0x26634a[_0xa943('0x41')]=[{'all':!![]}];}return db[_0xa943('0x2c')][_0xa943('0x42')](_0x26634a);})[_0xa943('0x25')](function(_0x3557bc){_0x45db17[_0xa943('0x43')]=_0x3557bc;return _0x45db17;})[_0xa943('0x25')](respondWithFilteredResult(_0x399cdf,_0x26634a))[_0xa943('0x44')](handleError(_0x399cdf,null));};exports[_0xa943('0x45')]=function(_0x435994,_0x2ed781){var _0x399a19={'raw':!![],'where':{'id':_0x435994[_0xa943('0x46')]['id']}},_0x3af5db={};_0x3af5db['model']=_[_0xa943('0x31')](db['ZohoField'][_0xa943('0x2d')]);_0x3af5db[_0xa943('0x30')]=_[_0xa943('0x31')](_0x435994[_0xa943('0x30')]);_0x3af5db[_0xa943('0x32')]=_['intersection'](_0x3af5db[_0xa943('0x34')],_0x3af5db[_0xa943('0x30')]);_0x399a19['attributes']=_[_0xa943('0x33')](_0x3af5db[_0xa943('0x34')],qs[_0xa943('0x35')](_0x435994[_0xa943('0x30')][_0xa943('0x35')]));_0x399a19[_0xa943('0x36')]=_0x399a19[_0xa943('0x36')][_0xa943('0x47')]?_0x399a19[_0xa943('0x36')]:_0x3af5db['model'];if(_0x435994['query'][_0xa943('0x40')]){_0x399a19[_0xa943('0x41')]=[{'all':!![]}];}_0x399a19=_[_0xa943('0x3d')]({},_0x399a19,_0x435994['options']);return db[_0xa943('0x2c')][_0xa943('0x48')](_0x399a19)[_0xa943('0x25')](handleEntityNotFound(_0x2ed781,null))[_0xa943('0x25')](respondWithResult(_0x2ed781,null))[_0xa943('0x44')](handleError(_0x2ed781,null));};exports[_0xa943('0x49')]=function(_0x3f80f7,_0x179a26){return db[_0xa943('0x2c')][_0xa943('0x49')](_0x3f80f7[_0xa943('0x4a')],{})[_0xa943('0x25')](respondWithResult(_0x179a26,0xc9))[_0xa943('0x44')](handleError(_0x179a26,null));};exports[_0xa943('0x24')]=function(_0x19ebc3,_0x5c0097){if(_0x19ebc3[_0xa943('0x4a')]['id']){delete _0x19ebc3[_0xa943('0x4a')]['id'];}return db[_0xa943('0x2c')][_0xa943('0x48')]({'where':{'id':_0x19ebc3['params']['id']}})[_0xa943('0x25')](handleEntityNotFound(_0x5c0097,null))[_0xa943('0x25')](saveUpdates(_0x19ebc3[_0xa943('0x4a')],null))[_0xa943('0x25')](respondWithResult(_0x5c0097,null))[_0xa943('0x44')](handleError(_0x5c0097,null));};exports['destroy']=function(_0x2865dd,_0x2a7967){return db[_0xa943('0x2c')][_0xa943('0x48')]({'where':{'id':_0x2865dd['params']['id']}})['then'](handleEntityNotFound(_0x2a7967,null))[_0xa943('0x25')](removeEntity(_0x2a7967,null))[_0xa943('0x44')](handleError(_0x2a7967,null));}; \ No newline at end of file +var _0x52e4=['to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','includeAll','findAll','rows','catch','params','fields','length','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel'];(function(_0x4f8e06,_0x3226b1){var _0x327dad=function(_0x4dced3){while(--_0x4dced3){_0x4f8e06['push'](_0x4f8e06['shift']());}};_0x327dad(++_0x3226b1);}(_0x52e4,0xc9));var _0x452e=function(_0x319532,_0x1bf047){_0x319532=_0x319532-0x0;var _0x2b6eab=_0x52e4[_0x319532];return _0x2b6eab;};'use strict';var emlformat=require(_0x452e('0x0'));var rimraf=require(_0x452e('0x1'));var zipdir=require(_0x452e('0x2'));var jsonpatch=require(_0x452e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x452e('0x4'));var Mustache=require(_0x452e('0x5'));var util=require(_0x452e('0x6'));var path=require(_0x452e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x452e('0x8'));var fs=require('fs');var fs_extra=require(_0x452e('0x9'));var _=require(_0x452e('0xa'));var squel=require(_0x452e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x452e('0xc'));var querystring=require('querystring');var Papa=require(_0x452e('0xd'));var Redis=require(_0x452e('0xe'));var authService=require(_0x452e('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x452e('0x10'));var logger=require(_0x452e('0x11'))(_0x452e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x452e('0x13'))['db'];function respondWithStatusCode(_0x453510,_0x36b2d1){_0x36b2d1=_0x36b2d1||0xcc;return function(_0x3225d0){if(_0x3225d0){return _0x453510['sendStatus'](_0x36b2d1);}return _0x453510['status'](_0x36b2d1)[_0x452e('0x14')]();};}function respondWithResult(_0x1a7357,_0x5de41d){_0x5de41d=_0x5de41d||0xc8;return function(_0xbe818b){if(_0xbe818b){return _0x1a7357['status'](_0x5de41d)[_0x452e('0x15')](_0xbe818b);}};}function respondWithFilteredResult(_0x5da7ba,_0x235b6d){return function(_0x34d43e){if(_0x34d43e){var _0x14b602=typeof _0x235b6d[_0x452e('0x16')]===_0x452e('0x17')&&typeof _0x235b6d[_0x452e('0x18')]===_0x452e('0x17');var _0x4323fe=_0x34d43e[_0x452e('0x19')];var _0x39a9bd=_0x14b602?0x0:_0x235b6d[_0x452e('0x16')];var _0x70aed=_0x14b602?_0x34d43e[_0x452e('0x19')]:_0x235b6d[_0x452e('0x16')]+_0x235b6d['limit'];var _0x467965;if(_0x70aed>=_0x4323fe){_0x70aed=_0x4323fe;_0x467965=0xc8;}else{_0x467965=0xce;}_0x5da7ba[_0x452e('0x1a')](_0x467965);return _0x5da7ba[_0x452e('0x1b')](_0x452e('0x1c'),_0x39a9bd+'-'+_0x70aed+'/'+_0x4323fe)['json'](_0x34d43e);}return null;};}function patchUpdates(_0x41d834){return function(_0x49367a){try{jsonpatch[_0x452e('0x1d')](_0x49367a,_0x41d834,!![]);}catch(_0x3bcabc){return BPromise[_0x452e('0x1e')](_0x3bcabc);}return _0x49367a[_0x452e('0x1f')]();};}function saveUpdates(_0x145a15,_0x42eca6){return function(_0x23441a){if(_0x23441a){return _0x23441a[_0x452e('0x20')](_0x145a15)[_0x452e('0x21')](function(_0x1fbd97){return _0x1fbd97;});}return null;};}function removeEntity(_0x4339f8,_0x54aeb8){return function(_0xb025da){if(_0xb025da){return _0xb025da['destroy']()['then'](function(){_0x4339f8[_0x452e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4caeb5,_0x8d1e9d){return function(_0x56f7be){if(!_0x56f7be){_0x4caeb5[_0x452e('0x22')](0x194);}return _0x56f7be;};}function handleError(_0x2f1bef,_0xd5a404){_0xd5a404=_0xd5a404||0x1f4;return function(_0x29b443){logger[_0x452e('0x23')](_0x29b443[_0x452e('0x24')]);if(_0x29b443['name']){delete _0x29b443[_0x452e('0x25')];}_0x2f1bef[_0x452e('0x1a')](_0xd5a404)[_0x452e('0x26')](_0x29b443);};}exports['index']=function(_0x520359,_0x449f4d){var _0x413353={},_0x4364da={},_0xb6e6de={'count':0x0,'rows':[]};var _0x598df1=_[_0x452e('0x27')](db[_0x452e('0x28')][_0x452e('0x29')],function(_0x3d337f){return{'name':_0x3d337f[_0x452e('0x2a')],'type':_0x3d337f[_0x452e('0x2b')][_0x452e('0x2c')]};});_0x4364da[_0x452e('0x2d')]=_[_0x452e('0x27')](_0x598df1,_0x452e('0x25'));_0x4364da[_0x452e('0x2e')]=_[_0x452e('0x2f')](_0x520359[_0x452e('0x2e')]);_0x4364da['filters']=_[_0x452e('0x30')](_0x4364da[_0x452e('0x2d')],_0x4364da[_0x452e('0x2e')]);_0x413353[_0x452e('0x31')]=_[_0x452e('0x30')](_0x4364da[_0x452e('0x2d')],qs['fields'](_0x520359[_0x452e('0x2e')]['fields']));_0x413353[_0x452e('0x31')]=_0x413353['attributes']['length']?_0x413353[_0x452e('0x31')]:_0x4364da[_0x452e('0x2d')];if(!_0x520359['query'][_0x452e('0x32')](_0x452e('0x33'))){_0x413353[_0x452e('0x18')]=qs['limit'](_0x520359[_0x452e('0x2e')][_0x452e('0x18')]);_0x413353[_0x452e('0x16')]=qs[_0x452e('0x16')](_0x520359['query'][_0x452e('0x16')]);}_0x413353['order']=qs[_0x452e('0x34')](_0x520359[_0x452e('0x2e')]['sort']);_0x413353['where']=qs[_0x452e('0x35')](_[_0x452e('0x36')](_0x520359['query'],_0x4364da[_0x452e('0x35')]),_0x598df1);if(_0x520359[_0x452e('0x2e')][_0x452e('0x37')]){_0x413353[_0x452e('0x38')]=_[_0x452e('0x39')](_0x413353[_0x452e('0x38')],{'$or':_[_0x452e('0x27')](_0x598df1,function(_0x415123){if(_0x415123[_0x452e('0x2b')]!=='VIRTUAL'){var _0x4f2acf={};_0x4f2acf[_0x415123[_0x452e('0x25')]]={'$like':'%'+_0x520359['query']['filter']+'%'};return _0x4f2acf;}})});}_0x413353=_['merge']({},_0x413353,_0x520359['options']);var _0x284096={'where':_0x413353[_0x452e('0x38')]};return db['ZohoField']['count'](_0x284096)[_0x452e('0x21')](function(_0x8201e5){_0xb6e6de[_0x452e('0x19')]=_0x8201e5;if(_0x520359['query'][_0x452e('0x3a')]){_0x413353['include']=[{'all':!![]}];}return db[_0x452e('0x28')][_0x452e('0x3b')](_0x413353);})[_0x452e('0x21')](function(_0x57acab){_0xb6e6de[_0x452e('0x3c')]=_0x57acab;return _0xb6e6de;})[_0x452e('0x21')](respondWithFilteredResult(_0x449f4d,_0x413353))[_0x452e('0x3d')](handleError(_0x449f4d,null));};exports['show']=function(_0x6b62a3,_0xdead1c){var _0xa59835={'raw':!![],'where':{'id':_0x6b62a3[_0x452e('0x3e')]['id']}},_0x57296a={};_0x57296a['model']=_['keys'](db['ZohoField'][_0x452e('0x29')]);_0x57296a[_0x452e('0x2e')]=_[_0x452e('0x2f')](_0x6b62a3[_0x452e('0x2e')]);_0x57296a[_0x452e('0x35')]=_['intersection'](_0x57296a['model'],_0x57296a[_0x452e('0x2e')]);_0xa59835[_0x452e('0x31')]=_[_0x452e('0x30')](_0x57296a[_0x452e('0x2d')],qs[_0x452e('0x3f')](_0x6b62a3[_0x452e('0x2e')][_0x452e('0x3f')]));_0xa59835[_0x452e('0x31')]=_0xa59835['attributes'][_0x452e('0x40')]?_0xa59835[_0x452e('0x31')]:_0x57296a[_0x452e('0x2d')];if(_0x6b62a3[_0x452e('0x2e')][_0x452e('0x3a')]){_0xa59835[_0x452e('0x41')]=[{'all':!![]}];}_0xa59835=_[_0x452e('0x39')]({},_0xa59835,_0x6b62a3[_0x452e('0x42')]);return db[_0x452e('0x28')][_0x452e('0x43')](_0xa59835)['then'](handleEntityNotFound(_0xdead1c,null))['then'](respondWithResult(_0xdead1c,null))[_0x452e('0x3d')](handleError(_0xdead1c,null));};exports[_0x452e('0x44')]=function(_0x2e241,_0x287a71){return db[_0x452e('0x28')][_0x452e('0x44')](_0x2e241[_0x452e('0x45')],{})[_0x452e('0x21')](respondWithResult(_0x287a71,0xc9))['catch'](handleError(_0x287a71,null));};exports[_0x452e('0x20')]=function(_0x3f9d5e,_0x91c40b){if(_0x3f9d5e[_0x452e('0x45')]['id']){delete _0x3f9d5e[_0x452e('0x45')]['id'];}return db[_0x452e('0x28')][_0x452e('0x43')]({'where':{'id':_0x3f9d5e[_0x452e('0x3e')]['id']}})[_0x452e('0x21')](handleEntityNotFound(_0x91c40b,null))[_0x452e('0x21')](saveUpdates(_0x3f9d5e[_0x452e('0x45')],null))[_0x452e('0x21')](respondWithResult(_0x91c40b,null))[_0x452e('0x3d')](handleError(_0x91c40b,null));};exports[_0x452e('0x46')]=function(_0x318565,_0x14b33d){return db[_0x452e('0x28')][_0x452e('0x43')]({'where':{'id':_0x318565[_0x452e('0x3e')]['id']}})[_0x452e('0x21')](handleEntityNotFound(_0x14b33d,null))[_0x452e('0x21')](removeEntity(_0x14b33d,null))[_0x452e('0x3d')](handleError(_0x14b33d,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 6a5d35c..2d987d7 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 _0x1a85=['rimraf','../../config/environment','exports','ZohoField','int_zoho_fields','idField','../../config/logger','api','moment','path'];(function(_0x34d49a,_0x47b8e7){var _0x409431=function(_0x3952c3){while(--_0x3952c3){_0x34d49a['push'](_0x34d49a['shift']());}};_0x409431(++_0x47b8e7);}(_0x1a85,0x178));var _0x51a8=function(_0xe44b1,_0x242100){_0xe44b1=_0xe44b1-0x0;var _0x368147=_0x1a85[_0xe44b1];return _0x368147;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./intZohoField.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x51a8('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8aad=['request-promise','../../config/environment','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','bluebird'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x8aad,0x146));var _0xd8aa=function(_0x25e33f,_0x2ae685){_0x25e33f=_0x25e33f-0x0;var _0x2c37bb=_0x8aad[_0x25e33f];return _0x2c37bb;};'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 diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 3ebafde..ae6ba17 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 _0x58fe=['then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3d1b32,_0x2e0770){var _0x3614dc=function(_0x3bebee){while(--_0x3bebee){_0x3d1b32['push'](_0x3d1b32['shift']());}};_0x3614dc(++_0x2e0770);}(_0x58fe,0x142));var _0xe58f=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0x58fe[_0x46ec32];return _0x338f60;};'use strict';var _=require(_0xe58f('0x0'));var util=require(_0xe58f('0x1'));var moment=require(_0xe58f('0x2'));var BPromise=require(_0xe58f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe58f('0x4'));var db=require(_0xe58f('0x5'))['db'];var utils=require(_0xe58f('0x6'));var logger=require(_0xe58f('0x7'))(_0xe58f('0x8'));var config=require(_0xe58f('0x9'));var jayson=require(_0xe58f('0xa'));var client=jayson[_0xe58f('0xb')][_0xe58f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x503a75,_0x2be86f,_0x261172){return new BPromise(function(_0x59c48a,_0x1cbfff){return client[_0xe58f('0xd')](_0x503a75,_0x261172)[_0xe58f('0xe')](function(_0x4e4427){logger[_0xe58f('0xf')](_0xe58f('0x10'),_0x2be86f,_0xe58f('0x11'));logger[_0xe58f('0x12')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x2be86f,'request\x20sent',JSON[_0xe58f('0x13')](_0x4e4427));if(_0x4e4427[_0xe58f('0x14')]){if(_0x4e4427[_0xe58f('0x14')]['code']===0x1f4){logger[_0xe58f('0x14')](_0xe58f('0x10'),_0x2be86f,_0x4e4427[_0xe58f('0x14')][_0xe58f('0x15')]);return _0x1cbfff(_0x4e4427[_0xe58f('0x14')][_0xe58f('0x15')]);}logger['error'](_0xe58f('0x10'),_0x2be86f,_0x4e4427['error'][_0xe58f('0x15')]);return _0x59c48a(_0x4e4427[_0xe58f('0x14')]['message']);}else{logger[_0xe58f('0xf')](_0xe58f('0x10'),_0x2be86f,_0xe58f('0x11'));_0x59c48a(_0x4e4427[_0xe58f('0x16')][_0xe58f('0x15')]);}})[_0xe58f('0x17')](function(_0x2c287b){logger['error']('ZohoField,\x20%s,\x20%s',_0x2be86f,_0x2c287b);_0x1cbfff(_0x2c287b);});});} \ No newline at end of file +var _0x755a=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','request\x20sent','catch'];(function(_0x1d0e8e,_0x599a5c){var _0x20151c=function(_0x4dbf78){while(--_0x4dbf78){_0x1d0e8e['push'](_0x1d0e8e['shift']());}};_0x20151c(++_0x599a5c);}(_0x755a,0x64));var _0xa755=function(_0x3cd0ff,_0x493f68){_0x3cd0ff=_0x3cd0ff-0x0;var _0x9ae758=_0x755a[_0x3cd0ff];return _0x9ae758;};'use strict';var _=require('lodash');var util=require(_0xa755('0x0'));var moment=require(_0xa755('0x1'));var BPromise=require(_0xa755('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa755('0x3'));var logger=require(_0xa755('0x4'))(_0xa755('0x5'));var config=require(_0xa755('0x6'));var jayson=require(_0xa755('0x7'));var client=jayson[_0xa755('0x8')][_0xa755('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x434870,_0x460252,_0x1be148){return new BPromise(function(_0x103724,_0x13893e){return client['request'](_0x434870,_0x1be148)['then'](function(_0x3a18bf){logger[_0xa755('0xa')]('ZohoField,\x20%s,\x20%s',_0x460252,'request\x20sent');logger[_0xa755('0xb')](_0xa755('0xc'),_0x460252,'request\x20sent',JSON[_0xa755('0xd')](_0x3a18bf));if(_0x3a18bf[_0xa755('0xe')]){if(_0x3a18bf[_0xa755('0xe')][_0xa755('0xf')]===0x1f4){logger[_0xa755('0xe')](_0xa755('0x10'),_0x460252,_0x3a18bf['error'][_0xa755('0x11')]);return _0x13893e(_0x3a18bf['error']['message']);}logger[_0xa755('0xe')](_0xa755('0x10'),_0x460252,_0x3a18bf[_0xa755('0xe')][_0xa755('0x11')]);return _0x103724(_0x3a18bf[_0xa755('0xe')][_0xa755('0x11')]);}else{logger[_0xa755('0xa')]('ZohoField,\x20%s,\x20%s',_0x460252,_0xa755('0x12'));_0x103724(_0x3a18bf['result'][_0xa755('0x11')]);}})[_0xa755('0x13')](function(_0x3a3296){logger[_0xa755('0xe')](_0xa755('0x10'),_0x460252,_0x3a3296);_0x13893e(_0x3a3296);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 821b9e1..27569fe 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(_0x526ee6,_0x3a1b72){var _0x3c3df1=function(_0x2a5466){while(--_0x2a5466){_0x526ee6['push'](_0x526ee6['shift']());}};_0x3c3df1(++_0x3a1b72);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xc874ac,_0x34e49b){var _0x5e1ff3=function(_0x127f02){while(--_0x127f02){_0xc874ac['push'](_0xc874ac['shift']());}};_0x5e1ff3(++_0x34e49b);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f0bcf,_0x5ec36f){_0x1f0bcf=_0x1f0bcf-0x0;var _0x27c1f2=_0xedd9[_0x1f0bcf];return _0x27c1f2;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index fae12ec..ff0a611 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 _0x2a18=['unique_name_and_version','app.js','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0xb57c09,_0x53f40e){var _0x1e21d4=function(_0x2a2935){while(--_0x2a2935){_0xb57c09['push'](_0xb57c09['shift']());}};_0x1e21d4(++_0x53f40e);}(_0x2a18,0x64));var _0x82a1=function(_0x514038,_0x450ef3){_0x514038=_0x514038-0x0;var _0x589720=_0x2a18[_0x514038];return _0x589720;};'use strict';var Sequelize=require(_0x82a1('0x0'));module['exports']={'name':{'type':Sequelize[_0x82a1('0x1')],'allowNull':![],'unique':_0x82a1('0x2')},'version':{'type':Sequelize[_0x82a1('0x1')],'allowNull':![],'unique':_0x82a1('0x2')},'main':{'type':Sequelize[_0x82a1('0x1')],'defaultValue':_0x82a1('0x3')},'filename':{'type':Sequelize[_0x82a1('0x1')]},'path':{'type':Sequelize[_0x82a1('0x1')]},'type':{'type':Sequelize[_0x82a1('0x1')]},'size':{'type':Sequelize[_0x82a1('0x4')]},'active':{'type':Sequelize[_0x82a1('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x82a1('0x1')]},'logo':{'type':Sequelize[_0x82a1('0x1')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x82a1('0x1')]},'link':{'type':Sequelize[_0x82a1('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0cfa=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x0cfa,0x73));var _0xa0cf=function(_0x79c1ad,_0x36f4f6){_0x79c1ad=_0x79c1ad-0x0;var _0x25ca82=_0x0cfa[_0x79c1ad];return _0x25ca82;};'use strict';var Sequelize=require(_0xa0cf('0x0'));module[_0xa0cf('0x1')]={'name':{'type':Sequelize[_0xa0cf('0x2')],'allowNull':![],'unique':_0xa0cf('0x3')},'version':{'type':Sequelize[_0xa0cf('0x2')],'allowNull':![],'unique':_0xa0cf('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xa0cf('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xa0cf('0x2')]},'type':{'type':Sequelize[_0xa0cf('0x2')]},'size':{'type':Sequelize[_0xa0cf('0x5')]},'active':{'type':Sequelize[_0xa0cf('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xa0cf('0x2')]},'logo':{'type':Sequelize[_0xa0cf('0x2')]},'state':{'type':Sequelize[_0xa0cf('0x2')],'unique':_0xa0cf('0x7')},'description':{'type':Sequelize[_0xa0cf('0x2')]},'title':{'type':Sequelize[_0xa0cf('0x2')]},'remoteUri':{'type':Sequelize[_0xa0cf('0x2')]},'link':{'type':Sequelize[_0xa0cf('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 10e8f5a..e41ff2a 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 _0x90b1=['map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','Integration','includeAll','rows','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index'];(function(_0x38ff8f,_0x420d98){var _0x13b3d4=function(_0x4f0b09){while(--_0x4f0b09){_0x38ff8f['push'](_0x38ff8f['shift']());}};_0x13b3d4(++_0x420d98);}(_0x90b1,0x1bb));var _0x190b=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x90b1[_0x2f1114];return _0x2fe856;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('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(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['Integration'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['Integration'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));}; \ No newline at end of file +var _0x4137=['map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index'];(function(_0xd4e763,_0x2f16b4){var _0x8e6d8b=function(_0x4e6c2){while(--_0x4e6c2){_0xd4e763['push'](_0xd4e763['shift']());}};_0x8e6d8b(++_0x2f16b4);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['Integration'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['Integration']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 954aad0..8b1391d 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 _0x43d8=['rimraf','../../config/environment','./integration.attributes','exports','Integration','integrations','util','moment','request-promise','path'];(function(_0x46185c,_0x49edad){var _0x200d32=function(_0x152a02){while(--_0x152a02){_0x46185c['push'](_0x46185c['shift']());}};_0x200d32(++_0x49edad);}(_0x43d8,0x1d2));var _0x843d=function(_0x490c02,_0x2faa1b){_0x490c02=_0x490c02-0x0;var _0x4604ab=_0x43d8[_0x490c02];return _0x4604ab;};'use strict';var _=require('lodash');var util=require(_0x843d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x843d('0x1'));var BPromise=require('bluebird');var rp=require(_0x843d('0x2'));var fs=require('fs');var path=require(_0x843d('0x3'));var rimraf=require(_0x843d('0x4'));var config=require(_0x843d('0x5'));var attributes=require(_0x843d('0x6'));module[_0x843d('0x7')]=function(_0x34bbef,_0x3b5634){return _0x34bbef['define'](_0x843d('0x8'),attributes,{'tableName':_0x843d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb321=['bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb321,0xf8));var _0x1b32=function(_0x42855b,_0x12e20d){_0x42855b=_0x42855b-0x0;var _0x27bffb=_0xb321[_0x42855b];return _0x27bffb;};'use strict';var _=require(_0x1b32('0x0'));var util=require('util');var logger=require(_0x1b32('0x1'))(_0x1b32('0x2'));var moment=require(_0x1b32('0x3'));var BPromise=require(_0x1b32('0x4'));var rp=require(_0x1b32('0x5'));var fs=require('fs');var path=require(_0x1b32('0x6'));var rimraf=require(_0x1b32('0x7'));var config=require(_0x1b32('0x8'));var attributes=require(_0x1b32('0x9'));module[_0x1b32('0xa')]=function(_0x45370b,_0x59667f){return _0x45370b[_0x1b32('0xb')](_0x1b32('0xc'),attributes,{'tableName':_0x1b32('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 22d9bed..0b17099 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x36f5b1,_0x5803e8){var _0x31712c=function(_0x2c51ee){while(--_0x2c51ee){_0x36f5b1['push'](_0x36f5b1['shift']());}};_0x31712c(++_0x5803e8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Integration,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\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(_0x4669a3,_0x3793e8){var _0x2b9096=function(_0x3185f7){while(--_0x3185f7){_0x4669a3['push'](_0x4669a3['shift']());}};_0x2b9096(++_0x3793e8);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x14166d,_0xa2de51){_0x14166d=_0x14166d-0x0;var _0x4e181f=_0xc6ac[_0x14166d];return _0x4e181f;};'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']('Integration,\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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 3c27e4b..f455929 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 _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x3db412,_0xb24fec){var _0x1c7519=function(_0x591caf){while(--_0x591caf){_0x3db412['push'](_0x3db412['shift']());}};_0x1c7519(++_0xb24fec);}(_0x955f,0x1eb));var _0xf955=function(_0x39b3c8,_0x397039){_0x39b3c8=_0x39b3c8-0x0;var _0x48a3f7=_0x955f[_0x39b3c8];return _0x48a3f7;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x0295,0x1f0));var _0x5029=function(_0x1b7d3e,_0xa4cadf){_0x1b7d3e=_0x1b7d3e-0x0;var _0xe9147f=_0x0295[_0x1b7d3e];return _0xe9147f;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index f0b0431..5d407fe 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 _0x28d5=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28d5,0xc5));var _0x528d=function(_0x55deec,_0x130e1f){_0x55deec=_0x55deec-0x0;var _0x2a071a=_0x28d5[_0x55deec];return _0x2a071a;};'use strict';var Sequelize=require(_0x528d('0x0'));module['exports']={'integration':{'type':Sequelize[_0x528d('0x1')]},'eventChannel':{'type':Sequelize[_0x528d('0x1')]},'exitStatus':{'type':Sequelize[_0x528d('0x1')]},'ticketId':{'type':Sequelize[_0x528d('0x1')]},'integrationId':{'type':Sequelize[_0x528d('0x2')]},'contacts':{'type':Sequelize[_0x528d('0x1')]},'uniqueid':{'type':Sequelize[_0x528d('0x1')]},'calleridnum':{'type':Sequelize[_0x528d('0x1')]},'calleridname':{'type':Sequelize[_0x528d('0x1')]},'queue':{'type':Sequelize[_0x528d('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x528d('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x528d('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x528d('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x528d('0x2')]},'reason':{'type':Sequelize[_0x528d('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x528d('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x528d('0x3')]},'lastevent':{'type':Sequelize[_0x528d('0x1')]},'channel':{'type':Sequelize[_0x528d('0x1')]},'channelstate':{'type':Sequelize[_0x528d('0x2')]},'channelstatedesc':{'type':Sequelize[_0x528d('0x1')]},'connectedlinenum':{'type':Sequelize[_0x528d('0x1')]},'connectedlinename':{'type':Sequelize[_0x528d('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x528d('0x1')]},'context':{'type':Sequelize[_0x528d('0x1')]},'exten':{'type':Sequelize[_0x528d('0x1')]},'priority':{'type':Sequelize[_0x528d('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x528d('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x528d('0x1')]},'destcalleridnum':{'type':Sequelize[_0x528d('0x1')]},'destcalleridname':{'type':Sequelize[_0x528d('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x528d('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x528d('0x1')]},'destlanguage':{'type':Sequelize[_0x528d('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x528d('0x1')]},'destexten':{'type':Sequelize[_0x528d('0x1')]},'destpriority':{'type':Sequelize[_0x528d('0x1')]},'destuniqueid':{'type':Sequelize[_0x528d('0x1')]},'messageId':{'type':Sequelize[_0x528d('0x1')]},'inReplyTo':{'type':Sequelize[_0x528d('0x1')]},'subject':{'type':Sequelize[_0x528d('0x1')]},'from':{'type':Sequelize[_0x528d('0x1')]},'to':{'type':Sequelize[_0x528d('0x1')]},'cc':{'type':Sequelize[_0x528d('0x1')]},'attachment':{'type':Sequelize[_0x528d('0x5')]},'html':{'type':Sequelize[_0x528d('0x5')]},'text':{'type':Sequelize[_0x528d('0x5')]},'status':{'type':Sequelize[_0x528d('0x6')](_0x528d('0x7'),_0x528d('0x8'),_0x528d('0x9'),_0x528d('0xa'))},'url':{'type':Sequelize[_0x528d('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x528d('0x1')]},'projectId':{'type':Sequelize[_0x528d('0x2')]}}; \ No newline at end of file +var _0xb2bf=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0xb2bf,0x1d1));var _0xfb2b=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0xb2bf[_0xfb0281];return _0x408dd3;};'use strict';var Sequelize=require(_0xfb2b('0x0'));module[_0xfb2b('0x1')]={'integration':{'type':Sequelize[_0xfb2b('0x2')]},'eventChannel':{'type':Sequelize[_0xfb2b('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xfb2b('0x2')]},'integrationId':{'type':Sequelize[_0xfb2b('0x3')]},'contacts':{'type':Sequelize[_0xfb2b('0x2')]},'uniqueid':{'type':Sequelize[_0xfb2b('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfb2b('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xfb2b('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xfb2b('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xfb2b('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfb2b('0x3')]},'reason':{'type':Sequelize[_0xfb2b('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xfb2b('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xfb2b('0x4')]},'agentdump':{'type':Sequelize[_0xfb2b('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfb2b('0x2')]},'channelstate':{'type':Sequelize[_0xfb2b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xfb2b('0x2')]},'connectedlinename':{'type':Sequelize[_0xfb2b('0x2')]},'language':{'type':Sequelize[_0xfb2b('0x2')]},'accountcode':{'type':Sequelize[_0xfb2b('0x2')]},'context':{'type':Sequelize[_0xfb2b('0x2')]},'exten':{'type':Sequelize[_0xfb2b('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xfb2b('0x2')]},'destchannelstate':{'type':Sequelize[_0xfb2b('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xfb2b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xfb2b('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xfb2b('0x2')]},'destaccountcode':{'type':Sequelize[_0xfb2b('0x2')]},'destcontext':{'type':Sequelize[_0xfb2b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xfb2b('0x2')]},'destuniqueid':{'type':Sequelize[_0xfb2b('0x2')]},'messageId':{'type':Sequelize[_0xfb2b('0x2')]},'inReplyTo':{'type':Sequelize[_0xfb2b('0x2')]},'subject':{'type':Sequelize[_0xfb2b('0x2')]},'from':{'type':Sequelize[_0xfb2b('0x2')]},'to':{'type':Sequelize[_0xfb2b('0x2')]},'cc':{'type':Sequelize[_0xfb2b('0x2')]},'attachment':{'type':Sequelize[_0xfb2b('0x6')]},'html':{'type':Sequelize[_0xfb2b('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xfb2b('0x7')](_0xfb2b('0x8'),_0xfb2b('0x9'),_0xfb2b('0xa'),_0xfb2b('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xfb2b('0x2')]},'appdata':{'type':Sequelize[_0xfb2b('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index ebd4b3a..9db5723 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 _0xb84a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','map','IntegrationReport','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','rows','catch','show','params','length','includeAll','include','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xb84a,0xc3));var _0xab84=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb84a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xab84('0x0'));var rimraf=require(_0xab84('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab84('0x2'));var BPromise=require(_0xab84('0x3'));var Mustache=require(_0xab84('0x4'));var util=require(_0xab84('0x5'));var path=require('path');var sox=require(_0xab84('0x6'));var csv=require(_0xab84('0x7'));var ejs=require(_0xab84('0x8'));var fs=require('fs');var fs_extra=require(_0xab84('0x9'));var _=require('lodash');var squel=require(_0xab84('0xa'));var crypto=require(_0xab84('0xb'));var jsforce=require(_0xab84('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab84('0xd'));var Papa=require(_0xab84('0xe'));var Redis=require('ioredis');var authService=require(_0xab84('0xf'));var qs=require(_0xab84('0x10'));var as=require(_0xab84('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab84('0x12'))(_0xab84('0x13'));var utils=require('../../config/utils');var config=require(_0xab84('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xab84('0x15'))['db'];function respondWithStatusCode(_0x2cdbe2,_0x5d03d3){_0x5d03d3=_0x5d03d3||0xcc;return function(_0x3fc60d){if(_0x3fc60d){return _0x2cdbe2['sendStatus'](_0x5d03d3);}return _0x2cdbe2[_0xab84('0x16')](_0x5d03d3)[_0xab84('0x17')]();};}function respondWithResult(_0x4ca7be,_0x19d647){_0x19d647=_0x19d647||0xc8;return function(_0xbd0097){if(_0xbd0097){return _0x4ca7be[_0xab84('0x16')](_0x19d647)[_0xab84('0x18')](_0xbd0097);}};}function respondWithFilteredResult(_0x4fc164,_0x802931){return function(_0x17de5f){if(_0x17de5f){var _0x16b69a=typeof _0x802931[_0xab84('0x19')]===_0xab84('0x1a')&&typeof _0x802931[_0xab84('0x1b')]===_0xab84('0x1a');var _0x4eb260=_0x17de5f[_0xab84('0x1c')];var _0x4306e3=_0x16b69a?0x0:_0x802931[_0xab84('0x19')];var _0x6a4639=_0x16b69a?_0x17de5f['count']:_0x802931[_0xab84('0x19')]+_0x802931[_0xab84('0x1b')];var _0x398916;if(_0x6a4639>=_0x4eb260){_0x6a4639=_0x4eb260;_0x398916=0xc8;}else{_0x398916=0xce;}_0x4fc164[_0xab84('0x16')](_0x398916);return _0x4fc164[_0xab84('0x1d')](_0xab84('0x1e'),_0x4306e3+'-'+_0x6a4639+'/'+_0x4eb260)[_0xab84('0x18')](_0x17de5f);}return null;};}function patchUpdates(_0xa6e915){return function(_0x48b7b2){try{jsonpatch[_0xab84('0x1f')](_0x48b7b2,_0xa6e915,!![]);}catch(_0x1aa52a){return BPromise[_0xab84('0x20')](_0x1aa52a);}return _0x48b7b2[_0xab84('0x21')]();};}function saveUpdates(_0x33d3cb,_0x203f7c){return function(_0x295291){if(_0x295291){return _0x295291[_0xab84('0x22')](_0x33d3cb)[_0xab84('0x23')](function(_0xf6343c){return _0xf6343c;});}return null;};}function removeEntity(_0x532508,_0x80d671){return function(_0x5e0964){if(_0x5e0964){return _0x5e0964[_0xab84('0x24')]()[_0xab84('0x23')](function(){_0x532508[_0xab84('0x16')](0xcc)[_0xab84('0x17')]();});}};}function handleEntityNotFound(_0x917476,_0x54c50a){return function(_0x4f3d27){if(!_0x4f3d27){_0x917476[_0xab84('0x25')](0x194);}return _0x4f3d27;};}function handleError(_0x3366cc,_0x260fe0){_0x260fe0=_0x260fe0||0x1f4;return function(_0x11f4b1){logger['error'](_0x11f4b1['stack']);if(_0x11f4b1[_0xab84('0x26')]){delete _0x11f4b1[_0xab84('0x26')];}_0x3366cc['status'](_0x260fe0)[_0xab84('0x27')](_0x11f4b1);};}exports['index']=function(_0x93b19b,_0xc53055){var _0x5b6ca6={},_0x10196e={},_0x423e96={'count':0x0,'rows':[]};var _0xf6675=_[_0xab84('0x28')](db[_0xab84('0x29')]['rawAttributes'],function(_0x1dc25a){return{'name':_0x1dc25a['fieldName'],'type':_0x1dc25a['type']['key']};});_0x10196e[_0xab84('0x2a')]=_[_0xab84('0x28')](_0xf6675,_0xab84('0x26'));_0x10196e[_0xab84('0x2b')]=_[_0xab84('0x2c')](_0x93b19b[_0xab84('0x2b')]);_0x10196e[_0xab84('0x2d')]=_[_0xab84('0x2e')](_0x10196e[_0xab84('0x2a')],_0x10196e[_0xab84('0x2b')]);_0x5b6ca6['attributes']=_['intersection'](_0x10196e['model'],qs[_0xab84('0x2f')](_0x93b19b[_0xab84('0x2b')][_0xab84('0x2f')]));_0x5b6ca6[_0xab84('0x30')]=_0x5b6ca6[_0xab84('0x30')]['length']?_0x5b6ca6[_0xab84('0x30')]:_0x10196e[_0xab84('0x2a')];if(!_0x93b19b['query'][_0xab84('0x31')](_0xab84('0x32'))){_0x5b6ca6[_0xab84('0x1b')]=qs['limit'](_0x93b19b[_0xab84('0x2b')][_0xab84('0x1b')]);_0x5b6ca6[_0xab84('0x19')]=qs[_0xab84('0x19')](_0x93b19b[_0xab84('0x2b')][_0xab84('0x19')]);}_0x5b6ca6[_0xab84('0x33')]=qs['sort'](_0x93b19b[_0xab84('0x2b')][_0xab84('0x34')]);_0x5b6ca6[_0xab84('0x35')]=qs[_0xab84('0x2d')](_[_0xab84('0x36')](_0x93b19b[_0xab84('0x2b')],_0x10196e[_0xab84('0x2d')]),_0xf6675);if(_0x93b19b[_0xab84('0x2b')]['filter']){_0x5b6ca6[_0xab84('0x35')]=_[_0xab84('0x37')](_0x5b6ca6['where'],{'$or':_[_0xab84('0x28')](_0xf6675,function(_0x1be7c8){if(_0x1be7c8[_0xab84('0x38')]!==_0xab84('0x39')){var _0x2acd34={};_0x2acd34[_0x1be7c8[_0xab84('0x26')]]={'$like':'%'+_0x93b19b[_0xab84('0x2b')]['filter']+'%'};return _0x2acd34;}})});}_0x5b6ca6=_[_0xab84('0x37')]({},_0x5b6ca6,_0x93b19b[_0xab84('0x3a')]);var _0x9ceda5={'where':_0x5b6ca6['where']};return db[_0xab84('0x29')]['count'](_0x9ceda5)[_0xab84('0x23')](function(_0x390ac6){_0x423e96[_0xab84('0x1c')]=_0x390ac6;if(_0x93b19b[_0xab84('0x2b')]['includeAll']){_0x5b6ca6['include']=[{'all':!![]}];}return db[_0xab84('0x29')]['findAll'](_0x5b6ca6);})[_0xab84('0x23')](function(_0x41758a){_0x423e96[_0xab84('0x3b')]=_0x41758a;return _0x423e96;})[_0xab84('0x23')](respondWithFilteredResult(_0xc53055,_0x5b6ca6))[_0xab84('0x3c')](handleError(_0xc53055,null));};exports[_0xab84('0x3d')]=function(_0x58338c,_0x9a2c08){var _0x2e6f16={'raw':![],'where':{'id':_0x58338c[_0xab84('0x3e')]['id']}},_0x19a543={};_0x19a543[_0xab84('0x2a')]=_['keys'](db[_0xab84('0x29')]['rawAttributes']);_0x19a543[_0xab84('0x2b')]=_[_0xab84('0x2c')](_0x58338c['query']);_0x19a543[_0xab84('0x2d')]=_[_0xab84('0x2e')](_0x19a543[_0xab84('0x2a')],_0x19a543[_0xab84('0x2b')]);_0x2e6f16['attributes']=_['intersection'](_0x19a543[_0xab84('0x2a')],qs[_0xab84('0x2f')](_0x58338c[_0xab84('0x2b')]['fields']));_0x2e6f16['attributes']=_0x2e6f16[_0xab84('0x30')][_0xab84('0x3f')]?_0x2e6f16[_0xab84('0x30')]:_0x19a543[_0xab84('0x2a')];if(_0x58338c[_0xab84('0x2b')][_0xab84('0x40')]){_0x2e6f16[_0xab84('0x41')]=[{'all':!![]}];}_0x2e6f16=_['merge']({},_0x2e6f16,_0x58338c['options']);return db['IntegrationReport']['find'](_0x2e6f16)[_0xab84('0x23')](handleEntityNotFound(_0x9a2c08,null))[_0xab84('0x23')](respondWithResult(_0x9a2c08,null))[_0xab84('0x3c')](handleError(_0x9a2c08,null));};exports[_0xab84('0x42')]=function(_0x4a0fbc,_0x4e0920){return db[_0xab84('0x29')][_0xab84('0x42')](_0x4a0fbc[_0xab84('0x43')],{})['then'](respondWithResult(_0x4e0920,0xc9))[_0xab84('0x3c')](handleError(_0x4e0920,null));};exports[_0xab84('0x22')]=function(_0x3bc03b,_0x49881a){if(_0x3bc03b[_0xab84('0x43')]['id']){delete _0x3bc03b[_0xab84('0x43')]['id'];}return db[_0xab84('0x29')][_0xab84('0x44')]({'where':{'id':_0x3bc03b['params']['id']}})[_0xab84('0x23')](handleEntityNotFound(_0x49881a,null))[_0xab84('0x23')](saveUpdates(_0x3bc03b['body'],null))[_0xab84('0x23')](respondWithResult(_0x49881a,null))[_0xab84('0x3c')](handleError(_0x49881a,null));};exports[_0xab84('0x24')]=function(_0x15126d,_0x295bda){return db['IntegrationReport'][_0xab84('0x44')]({'where':{'id':_0x15126d[_0xab84('0x3e')]['id']}})[_0xab84('0x23')](handleEntityNotFound(_0x295bda,null))[_0xab84('0x23')](removeEntity(_0x295bda,null))[_0xab84('0x3c')](handleError(_0x295bda,null));};exports[_0xab84('0x45')]=function(_0x2871b2,_0x2c52f9){return db[_0xab84('0x29')]['describe']()[_0xab84('0x23')](respondWithResult(_0x2c52f9,null))[_0xab84('0x3c')](handleError(_0x2c52f9,null));}; \ No newline at end of file +var _0x88a2=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','IntegrationReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','map','VIRTUAL','filter','include','findAll','rows','show','includeAll','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x3651c1,_0x38a1fa){var _0x3f608f=function(_0x445dce){while(--_0x445dce){_0x3651c1['push'](_0x3651c1['shift']());}};_0x3f608f(++_0x38a1fa);}(_0x88a2,0x1aa));var _0x288a=function(_0xaab427,_0x46fede){_0xaab427=_0xaab427-0x0;var _0x5041f3=_0x88a2[_0xaab427];return _0x5041f3;};'use strict';var emlformat=require(_0x288a('0x0'));var rimraf=require(_0x288a('0x1'));var zipdir=require(_0x288a('0x2'));var jsonpatch=require(_0x288a('0x3'));var rp=require('request-promise');var moment=require(_0x288a('0x4'));var BPromise=require(_0x288a('0x5'));var Mustache=require('mustache');var util=require(_0x288a('0x6'));var path=require(_0x288a('0x7'));var sox=require(_0x288a('0x8'));var csv=require(_0x288a('0x9'));var ejs=require(_0x288a('0xa'));var fs=require('fs');var fs_extra=require(_0x288a('0xb'));var _=require(_0x288a('0xc'));var squel=require(_0x288a('0xd'));var crypto=require(_0x288a('0xe'));var jsforce=require(_0x288a('0xf'));var deskjs=require(_0x288a('0x10'));var toCsv=require(_0x288a('0x9'));var querystring=require('querystring');var Papa=require(_0x288a('0x11'));var Redis=require(_0x288a('0x12'));var authService=require(_0x288a('0x13'));var qs=require(_0x288a('0x14'));var as=require(_0x288a('0x15'));var hardwareService=require(_0x288a('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x288a('0x17'));var licenseUtil=require(_0x288a('0x18'));var db=require(_0x288a('0x19'))['db'];function respondWithStatusCode(_0x3482bb,_0x582e26){_0x582e26=_0x582e26||0xcc;return function(_0x5d2cd5){if(_0x5d2cd5){return _0x3482bb['sendStatus'](_0x582e26);}return _0x3482bb[_0x288a('0x1a')](_0x582e26)[_0x288a('0x1b')]();};}function respondWithResult(_0x1afe72,_0x3e36d8){_0x3e36d8=_0x3e36d8||0xc8;return function(_0x38d4ef){if(_0x38d4ef){return _0x1afe72['status'](_0x3e36d8)[_0x288a('0x1c')](_0x38d4ef);}};}function respondWithFilteredResult(_0x255548,_0x1641d1){return function(_0x3041b5){if(_0x3041b5){var _0xc8bc40=typeof _0x1641d1[_0x288a('0x1d')]===_0x288a('0x1e')&&typeof _0x1641d1[_0x288a('0x1f')]===_0x288a('0x1e');var _0x2f4561=_0x3041b5['count'];var _0x3837da=_0xc8bc40?0x0:_0x1641d1[_0x288a('0x1d')];var _0x629030=_0xc8bc40?_0x3041b5[_0x288a('0x20')]:_0x1641d1['offset']+_0x1641d1[_0x288a('0x1f')];var _0x3db9ad;if(_0x629030>=_0x2f4561){_0x629030=_0x2f4561;_0x3db9ad=0xc8;}else{_0x3db9ad=0xce;}_0x255548[_0x288a('0x1a')](_0x3db9ad);return _0x255548['set'](_0x288a('0x21'),_0x3837da+'-'+_0x629030+'/'+_0x2f4561)['json'](_0x3041b5);}return null;};}function patchUpdates(_0x2da5a9){return function(_0x253b5f){try{jsonpatch[_0x288a('0x22')](_0x253b5f,_0x2da5a9,!![]);}catch(_0x39d261){return BPromise[_0x288a('0x23')](_0x39d261);}return _0x253b5f['save']();};}function saveUpdates(_0x488c11,_0x4a318b){return function(_0x20b0ec){if(_0x20b0ec){return _0x20b0ec[_0x288a('0x24')](_0x488c11)[_0x288a('0x25')](function(_0x27ca7f){return _0x27ca7f;});}return null;};}function removeEntity(_0x21bb50,_0x4aeb30){return function(_0x4fc211){if(_0x4fc211){return _0x4fc211[_0x288a('0x26')]()[_0x288a('0x25')](function(){_0x21bb50[_0x288a('0x1a')](0xcc)[_0x288a('0x1b')]();});}};}function handleEntityNotFound(_0xfb1d54,_0x2b27c2){return function(_0xb509fe){if(!_0xb509fe){_0xfb1d54['sendStatus'](0x194);}return _0xb509fe;};}function handleError(_0x5721a0,_0x300bd8){_0x300bd8=_0x300bd8||0x1f4;return function(_0x1bfb84){logger[_0x288a('0x27')](_0x1bfb84[_0x288a('0x28')]);if(_0x1bfb84[_0x288a('0x29')]){delete _0x1bfb84[_0x288a('0x29')];}_0x5721a0[_0x288a('0x1a')](_0x300bd8)['send'](_0x1bfb84);};}exports['index']=function(_0x369c99,_0x1010d6){var _0x4702fb={},_0x3352c0={},_0x58ddb4={'count':0x0,'rows':[]};var _0x5bb97e=_['map'](db[_0x288a('0x2a')][_0x288a('0x2b')],function(_0x3fe0a4){return{'name':_0x3fe0a4['fieldName'],'type':_0x3fe0a4[_0x288a('0x2c')][_0x288a('0x2d')]};});_0x3352c0[_0x288a('0x2e')]=_['map'](_0x5bb97e,_0x288a('0x29'));_0x3352c0[_0x288a('0x2f')]=_[_0x288a('0x30')](_0x369c99[_0x288a('0x2f')]);_0x3352c0[_0x288a('0x31')]=_['intersection'](_0x3352c0['model'],_0x3352c0[_0x288a('0x2f')]);_0x4702fb['attributes']=_[_0x288a('0x32')](_0x3352c0[_0x288a('0x2e')],qs[_0x288a('0x33')](_0x369c99['query'][_0x288a('0x33')]));_0x4702fb['attributes']=_0x4702fb[_0x288a('0x34')][_0x288a('0x35')]?_0x4702fb[_0x288a('0x34')]:_0x3352c0[_0x288a('0x2e')];if(!_0x369c99[_0x288a('0x2f')][_0x288a('0x36')]('nolimit')){_0x4702fb['limit']=qs[_0x288a('0x1f')](_0x369c99[_0x288a('0x2f')][_0x288a('0x1f')]);_0x4702fb[_0x288a('0x1d')]=qs[_0x288a('0x1d')](_0x369c99[_0x288a('0x2f')]['offset']);}_0x4702fb[_0x288a('0x37')]=qs[_0x288a('0x38')](_0x369c99[_0x288a('0x2f')][_0x288a('0x38')]);_0x4702fb['where']=qs[_0x288a('0x31')](_[_0x288a('0x39')](_0x369c99[_0x288a('0x2f')],_0x3352c0['filters']),_0x5bb97e);if(_0x369c99['query']['filter']){_0x4702fb[_0x288a('0x3a')]=_[_0x288a('0x3b')](_0x4702fb[_0x288a('0x3a')],{'$or':_[_0x288a('0x3c')](_0x5bb97e,function(_0x3d925c){if(_0x3d925c[_0x288a('0x2c')]!==_0x288a('0x3d')){var _0x3a8075={};_0x3a8075[_0x3d925c[_0x288a('0x29')]]={'$like':'%'+_0x369c99[_0x288a('0x2f')][_0x288a('0x3e')]+'%'};return _0x3a8075;}})});}_0x4702fb=_[_0x288a('0x3b')]({},_0x4702fb,_0x369c99['options']);var _0xf28835={'where':_0x4702fb[_0x288a('0x3a')]};return db['IntegrationReport']['count'](_0xf28835)[_0x288a('0x25')](function(_0x1da086){_0x58ddb4[_0x288a('0x20')]=_0x1da086;if(_0x369c99[_0x288a('0x2f')]['includeAll']){_0x4702fb[_0x288a('0x3f')]=[{'all':!![]}];}return db[_0x288a('0x2a')][_0x288a('0x40')](_0x4702fb);})['then'](function(_0x24730f){_0x58ddb4[_0x288a('0x41')]=_0x24730f;return _0x58ddb4;})[_0x288a('0x25')](respondWithFilteredResult(_0x1010d6,_0x4702fb))['catch'](handleError(_0x1010d6,null));};exports[_0x288a('0x42')]=function(_0x195cfa,_0x902c5c){var _0x5e6620={'raw':![],'where':{'id':_0x195cfa['params']['id']}},_0x4b4ea7={};_0x4b4ea7[_0x288a('0x2e')]=_[_0x288a('0x30')](db[_0x288a('0x2a')][_0x288a('0x2b')]);_0x4b4ea7['query']=_[_0x288a('0x30')](_0x195cfa[_0x288a('0x2f')]);_0x4b4ea7[_0x288a('0x31')]=_[_0x288a('0x32')](_0x4b4ea7[_0x288a('0x2e')],_0x4b4ea7['query']);_0x5e6620[_0x288a('0x34')]=_[_0x288a('0x32')](_0x4b4ea7['model'],qs[_0x288a('0x33')](_0x195cfa[_0x288a('0x2f')][_0x288a('0x33')]));_0x5e6620[_0x288a('0x34')]=_0x5e6620[_0x288a('0x34')][_0x288a('0x35')]?_0x5e6620['attributes']:_0x4b4ea7[_0x288a('0x2e')];if(_0x195cfa[_0x288a('0x2f')][_0x288a('0x43')]){_0x5e6620['include']=[{'all':!![]}];}_0x5e6620=_['merge']({},_0x5e6620,_0x195cfa[_0x288a('0x44')]);return db[_0x288a('0x2a')]['find'](_0x5e6620)[_0x288a('0x25')](handleEntityNotFound(_0x902c5c,null))[_0x288a('0x25')](respondWithResult(_0x902c5c,null))[_0x288a('0x45')](handleError(_0x902c5c,null));};exports[_0x288a('0x46')]=function(_0x386d11,_0x3c0c49){return db[_0x288a('0x2a')][_0x288a('0x46')](_0x386d11[_0x288a('0x47')],{})['then'](respondWithResult(_0x3c0c49,0xc9))[_0x288a('0x45')](handleError(_0x3c0c49,null));};exports[_0x288a('0x24')]=function(_0x236bd1,_0x463ec2){if(_0x236bd1[_0x288a('0x47')]['id']){delete _0x236bd1[_0x288a('0x47')]['id'];}return db['IntegrationReport'][_0x288a('0x48')]({'where':{'id':_0x236bd1['params']['id']}})['then'](handleEntityNotFound(_0x463ec2,null))[_0x288a('0x25')](saveUpdates(_0x236bd1['body'],null))['then'](respondWithResult(_0x463ec2,null))[_0x288a('0x45')](handleError(_0x463ec2,null));};exports[_0x288a('0x26')]=function(_0x29a35d,_0x43103d){return db[_0x288a('0x2a')][_0x288a('0x48')]({'where':{'id':_0x29a35d['params']['id']}})[_0x288a('0x25')](handleEntityNotFound(_0x43103d,null))[_0x288a('0x25')](removeEntity(_0x43103d,null))[_0x288a('0x45')](handleError(_0x43103d,null));};exports[_0x288a('0x49')]=function(_0x36eb,_0x3eea8c){return db[_0x288a('0x2a')]['describe']()[_0x288a('0x25')](respondWithResult(_0x3eea8c,null))[_0x288a('0x45')](handleError(_0x3eea8c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e5c791d..0c7d7cb 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 _0x81f4=['./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x45d64d,_0x3a8673){var _0x3911b9=function(_0x132ff7){while(--_0x132ff7){_0x45d64d['push'](_0x45d64d['shift']());}};_0x3911b9(++_0x3a8673);}(_0x81f4,0x10f));var _0x481f=function(_0x37399f,_0x261038){_0x37399f=_0x37399f-0x0;var _0x281eb5=_0x81f4[_0x37399f];return _0x281eb5;};'use strict';var _=require(_0x481f('0x0'));var util=require(_0x481f('0x1'));var logger=require(_0x481f('0x2'))(_0x481f('0x3'));var moment=require('moment');var BPromise=require(_0x481f('0x4'));var rp=require(_0x481f('0x5'));var fs=require('fs');var path=require(_0x481f('0x6'));var rimraf=require(_0x481f('0x7'));var config=require(_0x481f('0x8'));var attributes=require(_0x481f('0x9'));module[_0x481f('0xa')]=function(_0x4608d7,_0x503ee8){return _0x4608d7[_0x481f('0xb')](_0x481f('0xc'),attributes,{'tableName':_0x481f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3936=['define','report_integration','lodash','api','moment','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x261951,_0x543068){var _0x126dda=function(_0x402bd2){while(--_0x402bd2){_0x261951['push'](_0x261951['shift']());}};_0x126dda(++_0x543068);}(_0x3936,0x11a));var _0x6393=function(_0x252834,_0x55f763){_0x252834=_0x252834-0x0;var _0x58c864=_0x3936[_0x252834];return _0x58c864;};'use strict';var _=require(_0x6393('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6393('0x1'));var moment=require(_0x6393('0x2'));var BPromise=require('bluebird');var rp=require(_0x6393('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6393('0x4'));var config=require(_0x6393('0x5'));var attributes=require(_0x6393('0x6'));module[_0x6393('0x7')]=function(_0x198377,_0x1b1436){return _0x198377[_0x6393('0x8')]('IntegrationReport',attributes,{'tableName':_0x6393('0x9'),'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 a25d205..71912f2 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x187113,_0x3d8f5a){var _0x47c5da=function(_0x515389){while(--_0x515389){_0x187113['push'](_0x187113['shift']());}};_0x47c5da(++_0x3d8f5a);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4975,0x86));var _0x5497=function(_0x325eaf,_0x4d4895){_0x325eaf=_0x325eaf-0x0;var _0x405467=_0x4975[_0x325eaf];return _0x405467;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 428e4d9..666f226 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 _0xa0a1=['isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addIntervals','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./interval.controller','get','index','/:id'];(function(_0x1e9ac0,_0x554574){var _0x40ce36=function(_0x286fcf){while(--_0x286fcf){_0x1e9ac0['push'](_0x1e9ac0['shift']());}};_0x40ce36(++_0x554574);}(_0xa0a1,0x15b));var _0x1a0a=function(_0xbb727d,_0x11dce6){_0xbb727d=_0xbb727d-0x0;var _0xa5142e=_0xa0a1[_0xbb727d];return _0xa5142e;};'use strict';var multer=require(_0x1a0a('0x0'));var util=require('util');var path=require(_0x1a0a('0x1'));var timeout=require(_0x1a0a('0x2'));var express=require(_0x1a0a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1a0a('0x4'));var interaction=require(_0x1a0a('0x5'));var config=require('../../config/environment');var controller=require(_0x1a0a('0x6'));router[_0x1a0a('0x7')]('/',auth['isAuthenticated'](),controller[_0x1a0a('0x8')]);router[_0x1a0a('0x7')](_0x1a0a('0x9'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0xb')]);router['get'](_0x1a0a('0xc'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1a0a('0xe')](_0x1a0a('0xc'),auth[_0x1a0a('0xa')](),controller['addInterval']);router[_0x1a0a('0xe')]('/:id/sub_intervals/create_many',auth[_0x1a0a('0xa')](),controller[_0x1a0a('0xf')]);router[_0x1a0a('0x10')](_0x1a0a('0x9'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0x11')]);router[_0x1a0a('0x12')]('/:id',auth[_0x1a0a('0xa')](),controller[_0x1a0a('0x13')]);module[_0x1a0a('0x14')]=router; \ No newline at end of file +var _0x3946=['getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','isAuthenticated','index','/:id','show','get','/:id/sub_intervals'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0x3946,0x10e));var _0x6394=function(_0x5e671f,_0x41e305){_0x5e671f=_0x5e671f-0x0;var _0x4d105a=_0x3946[_0x5e671f];return _0x4d105a;};'use strict';var multer=require(_0x6394('0x0'));var util=require(_0x6394('0x1'));var path=require(_0x6394('0x2'));var timeout=require(_0x6394('0x3'));var express=require(_0x6394('0x4'));var router=express[_0x6394('0x5')]();var fs_extra=require(_0x6394('0x6'));var auth=require(_0x6394('0x7'));var interaction=require(_0x6394('0x8'));var config=require('../../config/environment');var controller=require(_0x6394('0x9'));router['get']('/',auth[_0x6394('0xa')](),controller[_0x6394('0xb')]);router['get'](_0x6394('0xc'),auth[_0x6394('0xa')](),controller[_0x6394('0xd')]);router[_0x6394('0xe')](_0x6394('0xf'),auth[_0x6394('0xa')](),controller[_0x6394('0x10')]);router[_0x6394('0x11')]('/',auth[_0x6394('0xa')](),controller[_0x6394('0x12')]);router[_0x6394('0x11')]('/:id/sub_intervals',auth[_0x6394('0xa')](),controller[_0x6394('0x13')]);router['post'](_0x6394('0x14'),auth[_0x6394('0xa')](),controller[_0x6394('0x15')]);router[_0x6394('0x16')](_0x6394('0xc'),auth[_0x6394('0xa')](),controller['update']);router[_0x6394('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x6394('0x18')]);module[_0x6394('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 89d3e1e..687c7ae 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 _0x42f0=['STRING','sequelize','exports'];(function(_0x4b33ff,_0x34193c){var _0x24c2f7=function(_0x2e4e49){while(--_0x2e4e49){_0x4b33ff['push'](_0x4b33ff['shift']());}};_0x24c2f7(++_0x34193c);}(_0x42f0,0x73));var _0x042f=function(_0x4b9f55,_0x30aaed){_0x4b9f55=_0x4b9f55-0x0;var _0x2d98bb=_0x42f0[_0x4b9f55];return _0x2d98bb;};'use strict';var Sequelize=require(_0x042f('0x0'));module[_0x042f('0x1')]={'name':{'type':Sequelize[_0x042f('0x2')]},'description':{'type':Sequelize[_0x042f('0x2')]},'interval':{'type':Sequelize[_0x042f('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x9333=['STRING','sequelize'];(function(_0x1620b4,_0x2e8f1d){var _0x511d36=function(_0x1425f9){while(--_0x1425f9){_0x1620b4['push'](_0x1620b4['shift']());}};_0x511d36(++_0x2e8f1d);}(_0x9333,0x1d5));var _0x3933=function(_0x36d34c,_0x5b644a){_0x36d34c=_0x36d34c-0x0;var _0x37b589=_0x9333[_0x36d34c];return _0x37b589;};'use strict';var Sequelize=require(_0x3933('0x0'));module['exports']={'name':{'type':Sequelize[_0x3933('0x1')]},'description':{'type':Sequelize[_0x3933('0x1')]},'interval':{'type':Sequelize[_0x3933('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 ff28981..838ee55 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 _0x2b62=['filter','merge','VIRTUAL','includeAll','include','Interval','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','IntervalId','getIntervals','rawAttributes','options','addIntervals','findOne','transaction','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','get','Intervals','UserProfileResource','destroy','then','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x556c27,_0x431755){var _0x3d6cb3=function(_0x2ea7fd){while(--_0x2ea7fd){_0x556c27['push'](_0x556c27['shift']());}};_0x3d6cb3(++_0x431755);}(_0x2b62,0x121));var _0x22b6=function(_0x24a61f,_0x3ff66d){_0x24a61f=_0x24a61f-0x0;var _0xa3f88a=_0x2b62[_0x24a61f];return _0xa3f88a;};'use strict';var emlformat=require(_0x22b6('0x0'));var rimraf=require(_0x22b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x22b6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x22b6('0x3'));var Mustache=require(_0x22b6('0x4'));var util=require(_0x22b6('0x5'));var path=require(_0x22b6('0x6'));var sox=require(_0x22b6('0x7'));var csv=require(_0x22b6('0x8'));var ejs=require(_0x22b6('0x9'));var fs=require('fs');var fs_extra=require(_0x22b6('0xa'));var _=require(_0x22b6('0xb'));var squel=require(_0x22b6('0xc'));var crypto=require(_0x22b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x22b6('0xe'));var toCsv=require(_0x22b6('0x8'));var querystring=require(_0x22b6('0xf'));var Papa=require(_0x22b6('0x10'));var Redis=require(_0x22b6('0x11'));var authService=require(_0x22b6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22b6('0x13'));var logger=require('../../config/logger')(_0x22b6('0x14'));var utils=require(_0x22b6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x22b6('0x16'));var db=require(_0x22b6('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5ceff5,_0x1449d9){_0x1449d9=_0x1449d9||0xcc;return function(_0x51052f){if(_0x51052f){return _0x5ceff5[_0x22b6('0x18')](_0x1449d9);}return _0x5ceff5[_0x22b6('0x19')](_0x1449d9)[_0x22b6('0x1a')]();};}function respondWithResult(_0x19e731,_0x4b7b96){_0x4b7b96=_0x4b7b96||0xc8;return function(_0x2451ab){if(_0x2451ab){return _0x19e731[_0x22b6('0x19')](_0x4b7b96)[_0x22b6('0x1b')](_0x2451ab);}};}function respondWithFilteredResult(_0x328551,_0x504701){return function(_0x3cf56b){if(_0x3cf56b){var _0x3d38b9=typeof _0x504701[_0x22b6('0x1c')]===_0x22b6('0x1d')&&typeof _0x504701['limit']==='undefined';var _0x13eda7=_0x3cf56b[_0x22b6('0x1e')];var _0x42a0b8=_0x3d38b9?0x0:_0x504701[_0x22b6('0x1c')];var _0x140449=_0x3d38b9?_0x3cf56b[_0x22b6('0x1e')]:_0x504701[_0x22b6('0x1c')]+_0x504701[_0x22b6('0x1f')];var _0x38b30f;if(_0x140449>=_0x13eda7){_0x140449=_0x13eda7;_0x38b30f=0xc8;}else{_0x38b30f=0xce;}_0x328551[_0x22b6('0x19')](_0x38b30f);return _0x328551[_0x22b6('0x20')](_0x22b6('0x21'),_0x42a0b8+'-'+_0x140449+'/'+_0x13eda7)[_0x22b6('0x1b')](_0x3cf56b);}return null;};}function patchUpdates(_0x26a57d){return function(_0x52a84f){try{jsonpatch[_0x22b6('0x22')](_0x52a84f,_0x26a57d,!![]);}catch(_0x124965){return BPromise['reject'](_0x124965);}return _0x52a84f['save']();};}function saveUpdates(_0x23d5da,_0x500e56){return function(_0x54826f){if(_0x54826f){return _0x54826f[_0x22b6('0x23')](_0x23d5da)['then'](function(_0x351403){return _0x351403;});}return null;};}function removeEntity(_0x2a5bc6,_0x513bf1){return function(_0x54ac28){if(_0x54ac28){return _0x54ac28['destroy']()['then'](function(){var _0x2f1d02=_0x54ac28[_0x22b6('0x24')]({'plain':!![]});var _0x4e5c18=_0x22b6('0x25');return db[_0x22b6('0x26')][_0x22b6('0x27')]({'where':{'type':_0x4e5c18,'resourceId':_0x2f1d02['id']}})[_0x22b6('0x28')](function(){return _0x54ac28;});})[_0x22b6('0x28')](function(){_0x2a5bc6['status'](0xcc)[_0x22b6('0x1a')]();});}};}function handleEntityNotFound(_0x2c2cf7,_0x2c9fc2){return function(_0x8cc172){if(!_0x8cc172){_0x2c2cf7['sendStatus'](0x194);}return _0x8cc172;};}function handleError(_0x4fcd5e,_0x56e6d3){_0x56e6d3=_0x56e6d3||0x1f4;return function(_0x2998ea){logger[_0x22b6('0x29')](_0x2998ea[_0x22b6('0x2a')]);if(_0x2998ea['name']){delete _0x2998ea[_0x22b6('0x2b')];}_0x4fcd5e[_0x22b6('0x19')](_0x56e6d3)[_0x22b6('0x2c')](_0x2998ea);};}exports[_0x22b6('0x2d')]=function(_0x49e122,_0x1c2cf5){var _0x563155={},_0x5ade49={},_0x4d8f06={'count':0x0,'rows':[]};var _0x173d7d=_[_0x22b6('0x2e')](db['Interval']['rawAttributes'],function(_0x30fdb8){return{'name':_0x30fdb8['fieldName'],'type':_0x30fdb8[_0x22b6('0x2f')][_0x22b6('0x30')]};});_0x5ade49[_0x22b6('0x31')]=_[_0x22b6('0x2e')](_0x173d7d,_0x22b6('0x2b'));_0x5ade49[_0x22b6('0x32')]=_[_0x22b6('0x33')](_0x49e122[_0x22b6('0x32')]);_0x5ade49[_0x22b6('0x34')]=_[_0x22b6('0x35')](_0x5ade49[_0x22b6('0x31')],_0x5ade49[_0x22b6('0x32')]);_0x563155['attributes']=_[_0x22b6('0x35')](_0x5ade49[_0x22b6('0x31')],qs[_0x22b6('0x36')](_0x49e122[_0x22b6('0x32')]['fields']));_0x563155[_0x22b6('0x37')]=_0x563155['attributes'][_0x22b6('0x38')]?_0x563155[_0x22b6('0x37')]:_0x5ade49['model'];if(!_0x49e122['query'][_0x22b6('0x39')](_0x22b6('0x3a'))){_0x563155[_0x22b6('0x1f')]=qs[_0x22b6('0x1f')](_0x49e122[_0x22b6('0x32')][_0x22b6('0x1f')]);_0x563155[_0x22b6('0x1c')]=qs[_0x22b6('0x1c')](_0x49e122[_0x22b6('0x32')]['offset']);}_0x563155[_0x22b6('0x3b')]=qs['sort'](_0x49e122[_0x22b6('0x32')][_0x22b6('0x3c')]);_0x563155[_0x22b6('0x3d')]=qs[_0x22b6('0x34')](_[_0x22b6('0x3e')](_0x49e122[_0x22b6('0x32')],_0x5ade49[_0x22b6('0x34')]),_0x173d7d);if(_0x49e122['query'][_0x22b6('0x3f')]){_0x563155[_0x22b6('0x3d')]=_[_0x22b6('0x40')](_0x563155['where'],{'$or':_['map'](_0x173d7d,function(_0x5c4b05){if(_0x5c4b05[_0x22b6('0x2f')]!==_0x22b6('0x41')){var _0x4469ba={};_0x4469ba[_0x5c4b05[_0x22b6('0x2b')]]={'$like':'%'+_0x49e122[_0x22b6('0x32')][_0x22b6('0x3f')]+'%'};return _0x4469ba;}})});}_0x563155=_['merge']({},_0x563155,_0x49e122['options']);var _0x21a088={'where':_0x563155['where']};return db['Interval']['count'](_0x21a088)[_0x22b6('0x28')](function(_0x1a882e){_0x4d8f06['count']=_0x1a882e;if(_0x49e122[_0x22b6('0x32')][_0x22b6('0x42')]){_0x563155[_0x22b6('0x43')]=[{'all':!![]}];}return db[_0x22b6('0x44')]['findAll'](_0x563155);})['then'](function(_0x2f085c){_0x4d8f06[_0x22b6('0x45')]=_0x2f085c;return _0x4d8f06;})[_0x22b6('0x28')](respondWithFilteredResult(_0x1c2cf5,_0x563155))['catch'](handleError(_0x1c2cf5,null));};exports['show']=function(_0x243020,_0x3e14d4){var _0x1adef3={'raw':!![],'where':{'id':_0x243020[_0x22b6('0x46')]['id']}},_0x5cf1bc={};_0x5cf1bc[_0x22b6('0x31')]=_[_0x22b6('0x33')](db[_0x22b6('0x44')]['rawAttributes']);_0x5cf1bc[_0x22b6('0x32')]=_[_0x22b6('0x33')](_0x243020[_0x22b6('0x32')]);_0x5cf1bc[_0x22b6('0x34')]=_[_0x22b6('0x35')](_0x5cf1bc['model'],_0x5cf1bc[_0x22b6('0x32')]);_0x1adef3[_0x22b6('0x37')]=_[_0x22b6('0x35')](_0x5cf1bc[_0x22b6('0x31')],qs[_0x22b6('0x36')](_0x243020['query'][_0x22b6('0x36')]));_0x1adef3[_0x22b6('0x37')]=_0x1adef3['attributes']['length']?_0x1adef3['attributes']:_0x5cf1bc[_0x22b6('0x31')];if(_0x243020[_0x22b6('0x32')][_0x22b6('0x42')]){_0x1adef3[_0x22b6('0x43')]=[{'all':!![]}];}_0x1adef3=_[_0x22b6('0x40')]({},_0x1adef3,_0x243020['options']);return db[_0x22b6('0x44')][_0x22b6('0x47')](_0x1adef3)[_0x22b6('0x28')](handleEntityNotFound(_0x3e14d4,null))[_0x22b6('0x28')](respondWithResult(_0x3e14d4,null))[_0x22b6('0x48')](handleError(_0x3e14d4,null));};exports[_0x22b6('0x49')]=function(_0x1ee637,_0x347c02){return db[_0x22b6('0x44')][_0x22b6('0x49')](_0x1ee637[_0x22b6('0x4a')],{})[_0x22b6('0x28')](function(_0x2bf2f0){var _0x1c49d3=_0x1ee637[_0x22b6('0x4b')][_0x22b6('0x24')]({'plain':!![]});if(!_0x1c49d3)throw new Error(_0x22b6('0x4c'));if(_0x1c49d3[_0x22b6('0x4d')]===_0x22b6('0x4b')){var _0x1269a9=_0x2bf2f0[_0x22b6('0x24')]({'plain':!![]});var _0x222b8b=_0x22b6('0x25');return db[_0x22b6('0x4e')][_0x22b6('0x47')]({'where':{'name':_0x222b8b,'userProfileId':_0x1c49d3[_0x22b6('0x4f')]},'raw':!![]})[_0x22b6('0x28')](function(_0x190227){if(_0x190227&&_0x190227[_0x22b6('0x50')]===0x0){return db[_0x22b6('0x26')]['create']({'name':_0x1269a9[_0x22b6('0x2b')],'resourceId':_0x1269a9['id'],'type':_0x190227[_0x22b6('0x2b')],'sectionId':_0x190227['id']},{})['then'](function(){return _0x2bf2f0;});}else{return _0x2bf2f0;}})[_0x22b6('0x48')](function(_0x394190){logger[_0x22b6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x394190);throw _0x394190;});}return _0x2bf2f0;})[_0x22b6('0x28')](respondWithResult(_0x347c02,0xc9))[_0x22b6('0x48')](handleError(_0x347c02,null));};exports[_0x22b6('0x23')]=function(_0x4a4071,_0x1281c5){if(_0x4a4071[_0x22b6('0x4a')]['id']){delete _0x4a4071[_0x22b6('0x4a')]['id'];}return db[_0x22b6('0x44')][_0x22b6('0x47')]({'where':{'id':_0x4a4071[_0x22b6('0x46')]['id']}})[_0x22b6('0x28')](handleEntityNotFound(_0x1281c5,null))[_0x22b6('0x28')](saveUpdates(_0x4a4071['body'],null))[_0x22b6('0x28')](respondWithResult(_0x1281c5,null))[_0x22b6('0x48')](handleError(_0x1281c5,null));};exports['destroy']=function(_0x45ed8a,_0x5e4e43){return db[_0x22b6('0x44')]['find']({'where':{'id':_0x45ed8a[_0x22b6('0x46')]['id']}})[_0x22b6('0x28')](handleEntityNotFound(_0x5e4e43,null))[_0x22b6('0x28')](removeEntity(_0x5e4e43,null))[_0x22b6('0x48')](handleError(_0x5e4e43,null));};exports['addInterval']=function(_0x3787c7,_0x536841,_0x546945){if(_0x3787c7[_0x22b6('0x4a')]['id']){delete _0x3787c7[_0x22b6('0x4a')]['id'];}return db['Interval'][_0x22b6('0x47')]({'where':{'id':_0x3787c7[_0x22b6('0x46')]['id']}})[_0x22b6('0x28')](handleEntityNotFound(_0x536841,null))['then'](function(_0x9099ff){if(_0x9099ff){_0x3787c7['body'][_0x22b6('0x51')]=_0x9099ff['id'];return db[_0x22b6('0x44')]['create'](_0x3787c7['body']);}})['then'](respondWithResult(_0x536841,null))[_0x22b6('0x48')](handleError(_0x536841,null));};exports[_0x22b6('0x52')]=function(_0x5ea076,_0x53cbf4,_0x4767c8){var _0x5b4c31={};var _0x324e0a={};var _0x2c8e69;var _0x1aef53;return db[_0x22b6('0x44')]['findOne']({'where':{'id':_0x5ea076[_0x22b6('0x46')]['id']}})[_0x22b6('0x28')](handleEntityNotFound(_0x53cbf4,null))[_0x22b6('0x28')](function(_0x5475f3){if(_0x5475f3){_0x2c8e69=_0x5475f3;_0x324e0a['model']=_[_0x22b6('0x33')](db[_0x22b6('0x44')][_0x22b6('0x53')]);_0x324e0a[_0x22b6('0x32')]=_[_0x22b6('0x33')](_0x5ea076['query']);_0x324e0a['filters']=_[_0x22b6('0x35')](_0x324e0a[_0x22b6('0x31')],_0x324e0a[_0x22b6('0x32')]);_0x5b4c31['attributes']=_[_0x22b6('0x35')](_0x324e0a[_0x22b6('0x31')],qs['fields'](_0x5ea076[_0x22b6('0x32')]['fields']));_0x5b4c31[_0x22b6('0x37')]=_0x5b4c31[_0x22b6('0x37')][_0x22b6('0x38')]?_0x5b4c31[_0x22b6('0x37')]:_0x324e0a[_0x22b6('0x31')];_0x5b4c31[_0x22b6('0x3b')]=qs[_0x22b6('0x3c')](_0x5ea076[_0x22b6('0x32')][_0x22b6('0x3c')]);_0x5b4c31[_0x22b6('0x3d')]=qs[_0x22b6('0x34')](_['pick'](_0x5ea076[_0x22b6('0x32')],_0x324e0a[_0x22b6('0x34')]));if(_0x5ea076['query'][_0x22b6('0x3f')]){_0x5b4c31[_0x22b6('0x3d')]=_[_0x22b6('0x40')](_0x5b4c31[_0x22b6('0x3d')],{'$or':_[_0x22b6('0x2e')](_0x5b4c31[_0x22b6('0x37')],function(_0x5c5a7b){var _0x137cee={};_0x137cee[_0x5c5a7b]={'$like':'%'+_0x5ea076[_0x22b6('0x32')][_0x22b6('0x3f')]+'%'};return _0x137cee;})});}_0x5b4c31=_[_0x22b6('0x40')]({},_0x5b4c31,_0x5ea076[_0x22b6('0x54')]);return _0x2c8e69[_0x22b6('0x52')](_0x5b4c31);}})[_0x22b6('0x28')](function(_0x3f19b1){if(_0x3f19b1){_0x1aef53=_0x3f19b1['length'];if(!_0x5ea076['query']['hasOwnProperty'](_0x22b6('0x3a'))){_0x5b4c31[_0x22b6('0x1f')]=qs[_0x22b6('0x1f')](_0x5ea076[_0x22b6('0x32')][_0x22b6('0x1f')]);_0x5b4c31[_0x22b6('0x1c')]=qs[_0x22b6('0x1c')](_0x5ea076[_0x22b6('0x32')]['offset']);}return _0x2c8e69['getIntervals'](_0x5b4c31);}})[_0x22b6('0x28')](function(_0x2ed5ec){if(_0x2ed5ec){return _0x2ed5ec?{'count':_0x1aef53,'rows':_0x2ed5ec}:null;}})[_0x22b6('0x28')](respondWithResult(_0x53cbf4,null))[_0x22b6('0x48')](handleError(_0x53cbf4,null));};exports[_0x22b6('0x55')]=function(_0x1f8a7d,_0x407c18,_0x24c010){return db[_0x22b6('0x44')][_0x22b6('0x56')]({'where':{'id':_0x1f8a7d['params']['id']}})['then'](handleEntityNotFound(_0x407c18,null))[_0x22b6('0x28')](function(_0x5dc1eb){if(_0x5dc1eb){return db['sequelize'][_0x22b6('0x57')](function(_0x24dd52){return db[_0x22b6('0x44')][_0x22b6('0x27')]({'where':{'IntervalId':_0x1f8a7d[_0x22b6('0x46')]['id']},'transaction':_0x24dd52})[_0x22b6('0x28')](function(_0x3407cc){var _0x32dacb=_['map'](_0x1f8a7d['body'],function(_0xca37d1){delete _0xca37d1['id'];_0xca37d1[_0x22b6('0x51')]=_0x1f8a7d['params']['id'];return _0xca37d1;});return db['Interval']['bulkCreate'](_0x32dacb,{'transaction':_0x24dd52});});})[_0x22b6('0x28')](function(){return db[_0x22b6('0x44')]['findAll']({'where':{'IntervalId':_0x1f8a7d[_0x22b6('0x46')]['id']}});});}})[_0x22b6('0x28')](respondWithResult(_0x407c18,null))[_0x22b6('0x48')](handleError(_0x407c18,null));}; \ No newline at end of file +var _0xa9d0=['../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','map','Interval','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','includeAll','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1404df,_0x55dcfa){var _0x5b0e7d=function(_0x19a4f6){while(--_0x19a4f6){_0x1404df['push'](_0x1404df['shift']());}};_0x5b0e7d(++_0x55dcfa);}(_0xa9d0,0x105));var _0x0a9d=function(_0x41cf6d,_0x209ffd){_0x41cf6d=_0x41cf6d-0x0;var _0x5bc60c=_0xa9d0[_0x41cf6d];return _0x5bc60c;};'use strict';var emlformat=require(_0x0a9d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a9d('0x1'));var jsonpatch=require(_0x0a9d('0x2'));var rp=require(_0x0a9d('0x3'));var moment=require(_0x0a9d('0x4'));var BPromise=require(_0x0a9d('0x5'));var Mustache=require(_0x0a9d('0x6'));var util=require(_0x0a9d('0x7'));var path=require(_0x0a9d('0x8'));var sox=require(_0x0a9d('0x9'));var csv=require(_0x0a9d('0xa'));var ejs=require(_0x0a9d('0xb'));var fs=require('fs');var fs_extra=require(_0x0a9d('0xc'));var _=require(_0x0a9d('0xd'));var squel=require(_0x0a9d('0xe'));var crypto=require(_0x0a9d('0xf'));var jsforce=require(_0x0a9d('0x10'));var deskjs=require(_0x0a9d('0x11'));var toCsv=require(_0x0a9d('0xa'));var querystring=require('querystring');var Papa=require(_0x0a9d('0x12'));var Redis=require(_0x0a9d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0a9d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a9d('0x15'));var logger=require(_0x0a9d('0x16'))(_0x0a9d('0x17'));var utils=require(_0x0a9d('0x18'));var config=require(_0x0a9d('0x19'));var licenseUtil=require(_0x0a9d('0x1a'));var db=require(_0x0a9d('0x1b'))['db'];var extensions=require(_0x0a9d('0x1c'));function respondWithStatusCode(_0xa1e0d9,_0x1f61e8){_0x1f61e8=_0x1f61e8||0xcc;return function(_0x4ba4bd){if(_0x4ba4bd){return _0xa1e0d9[_0x0a9d('0x1d')](_0x1f61e8);}return _0xa1e0d9[_0x0a9d('0x1e')](_0x1f61e8)['end']();};}function respondWithResult(_0x11d66d,_0x278d95){_0x278d95=_0x278d95||0xc8;return function(_0x4128d9){if(_0x4128d9){return _0x11d66d[_0x0a9d('0x1e')](_0x278d95)[_0x0a9d('0x1f')](_0x4128d9);}};}function respondWithFilteredResult(_0x4a6d8b,_0x200e50){return function(_0x368920){if(_0x368920){var _0x3240af=typeof _0x200e50['offset']===_0x0a9d('0x20')&&typeof _0x200e50[_0x0a9d('0x21')]===_0x0a9d('0x20');var _0x3f9c92=_0x368920[_0x0a9d('0x22')];var _0x46797a=_0x3240af?0x0:_0x200e50[_0x0a9d('0x23')];var _0x5cc0e4=_0x3240af?_0x368920[_0x0a9d('0x22')]:_0x200e50[_0x0a9d('0x23')]+_0x200e50[_0x0a9d('0x21')];var _0x36a2b3;if(_0x5cc0e4>=_0x3f9c92){_0x5cc0e4=_0x3f9c92;_0x36a2b3=0xc8;}else{_0x36a2b3=0xce;}_0x4a6d8b['status'](_0x36a2b3);return _0x4a6d8b[_0x0a9d('0x24')](_0x0a9d('0x25'),_0x46797a+'-'+_0x5cc0e4+'/'+_0x3f9c92)['json'](_0x368920);}return null;};}function patchUpdates(_0x598893){return function(_0x302908){try{jsonpatch[_0x0a9d('0x26')](_0x302908,_0x598893,!![]);}catch(_0x282930){return BPromise[_0x0a9d('0x27')](_0x282930);}return _0x302908['save']();};}function saveUpdates(_0x1dd1f1,_0x125691){return function(_0x21ad31){if(_0x21ad31){return _0x21ad31[_0x0a9d('0x28')](_0x1dd1f1)[_0x0a9d('0x29')](function(_0x4cecc8){return _0x4cecc8;});}return null;};}function removeEntity(_0x357029,_0x351750){return function(_0x4be49f){if(_0x4be49f){return _0x4be49f[_0x0a9d('0x2a')]()['then'](function(){var _0x17f873=_0x4be49f['get']({'plain':!![]});var _0x3aef7d='Intervals';return db[_0x0a9d('0x2b')][_0x0a9d('0x2a')]({'where':{'type':_0x3aef7d,'resourceId':_0x17f873['id']}})[_0x0a9d('0x29')](function(){return _0x4be49f;});})[_0x0a9d('0x29')](function(){_0x357029[_0x0a9d('0x1e')](0xcc)[_0x0a9d('0x2c')]();});}};}function handleEntityNotFound(_0x3b7e15,_0x41698d){return function(_0x552fb8){if(!_0x552fb8){_0x3b7e15[_0x0a9d('0x1d')](0x194);}return _0x552fb8;};}function handleError(_0x561b59,_0x1bb57b){_0x1bb57b=_0x1bb57b||0x1f4;return function(_0x4922e7){logger[_0x0a9d('0x2d')](_0x4922e7[_0x0a9d('0x2e')]);if(_0x4922e7[_0x0a9d('0x2f')]){delete _0x4922e7['name'];}_0x561b59[_0x0a9d('0x1e')](_0x1bb57b)[_0x0a9d('0x30')](_0x4922e7);};}exports[_0x0a9d('0x31')]=function(_0x4ab1bd,_0x28185b){var _0x28ba42={},_0x380a2f={},_0x58905a={'count':0x0,'rows':[]};var _0x39fcd4=_[_0x0a9d('0x32')](db[_0x0a9d('0x33')][_0x0a9d('0x34')],function(_0x25e87c){return{'name':_0x25e87c['fieldName'],'type':_0x25e87c[_0x0a9d('0x35')][_0x0a9d('0x36')]};});_0x380a2f[_0x0a9d('0x37')]=_[_0x0a9d('0x32')](_0x39fcd4,_0x0a9d('0x2f'));_0x380a2f[_0x0a9d('0x38')]=_[_0x0a9d('0x39')](_0x4ab1bd[_0x0a9d('0x38')]);_0x380a2f[_0x0a9d('0x3a')]=_[_0x0a9d('0x3b')](_0x380a2f[_0x0a9d('0x37')],_0x380a2f[_0x0a9d('0x38')]);_0x28ba42[_0x0a9d('0x3c')]=_['intersection'](_0x380a2f['model'],qs[_0x0a9d('0x3d')](_0x4ab1bd[_0x0a9d('0x38')]['fields']));_0x28ba42['attributes']=_0x28ba42[_0x0a9d('0x3c')][_0x0a9d('0x3e')]?_0x28ba42[_0x0a9d('0x3c')]:_0x380a2f[_0x0a9d('0x37')];if(!_0x4ab1bd[_0x0a9d('0x38')]['hasOwnProperty']('nolimit')){_0x28ba42[_0x0a9d('0x21')]=qs[_0x0a9d('0x21')](_0x4ab1bd[_0x0a9d('0x38')][_0x0a9d('0x21')]);_0x28ba42[_0x0a9d('0x23')]=qs['offset'](_0x4ab1bd[_0x0a9d('0x38')]['offset']);}_0x28ba42['order']=qs[_0x0a9d('0x3f')](_0x4ab1bd['query'][_0x0a9d('0x3f')]);_0x28ba42[_0x0a9d('0x40')]=qs[_0x0a9d('0x3a')](_[_0x0a9d('0x41')](_0x4ab1bd[_0x0a9d('0x38')],_0x380a2f['filters']),_0x39fcd4);if(_0x4ab1bd[_0x0a9d('0x38')][_0x0a9d('0x42')]){_0x28ba42[_0x0a9d('0x40')]=_['merge'](_0x28ba42['where'],{'$or':_[_0x0a9d('0x32')](_0x39fcd4,function(_0x543eca){if(_0x543eca['type']!==_0x0a9d('0x43')){var _0x368940={};_0x368940[_0x543eca[_0x0a9d('0x2f')]]={'$like':'%'+_0x4ab1bd['query'][_0x0a9d('0x42')]+'%'};return _0x368940;}})});}_0x28ba42=_[_0x0a9d('0x44')]({},_0x28ba42,_0x4ab1bd[_0x0a9d('0x45')]);var _0x76080a={'where':_0x28ba42[_0x0a9d('0x40')]};return db[_0x0a9d('0x33')][_0x0a9d('0x22')](_0x76080a)[_0x0a9d('0x29')](function(_0x1ae277){_0x58905a['count']=_0x1ae277;if(_0x4ab1bd[_0x0a9d('0x38')]['includeAll']){_0x28ba42[_0x0a9d('0x46')]=[{'all':!![]}];}return db[_0x0a9d('0x33')]['findAll'](_0x28ba42);})[_0x0a9d('0x29')](function(_0x2ceb48){_0x58905a[_0x0a9d('0x47')]=_0x2ceb48;return _0x58905a;})[_0x0a9d('0x29')](respondWithFilteredResult(_0x28185b,_0x28ba42))['catch'](handleError(_0x28185b,null));};exports[_0x0a9d('0x48')]=function(_0x3af8dc,_0x460b43){var _0xe20132={'raw':!![],'where':{'id':_0x3af8dc['params']['id']}},_0x4b0cc9={};_0x4b0cc9[_0x0a9d('0x37')]=_[_0x0a9d('0x39')](db[_0x0a9d('0x33')][_0x0a9d('0x34')]);_0x4b0cc9[_0x0a9d('0x38')]=_[_0x0a9d('0x39')](_0x3af8dc[_0x0a9d('0x38')]);_0x4b0cc9[_0x0a9d('0x3a')]=_['intersection'](_0x4b0cc9['model'],_0x4b0cc9[_0x0a9d('0x38')]);_0xe20132[_0x0a9d('0x3c')]=_[_0x0a9d('0x3b')](_0x4b0cc9[_0x0a9d('0x37')],qs[_0x0a9d('0x3d')](_0x3af8dc['query'][_0x0a9d('0x3d')]));_0xe20132[_0x0a9d('0x3c')]=_0xe20132[_0x0a9d('0x3c')][_0x0a9d('0x3e')]?_0xe20132[_0x0a9d('0x3c')]:_0x4b0cc9[_0x0a9d('0x37')];if(_0x3af8dc[_0x0a9d('0x38')][_0x0a9d('0x49')]){_0xe20132[_0x0a9d('0x46')]=[{'all':!![]}];}_0xe20132=_[_0x0a9d('0x44')]({},_0xe20132,_0x3af8dc[_0x0a9d('0x45')]);return db[_0x0a9d('0x33')][_0x0a9d('0x4a')](_0xe20132)[_0x0a9d('0x29')](handleEntityNotFound(_0x460b43,null))[_0x0a9d('0x29')](respondWithResult(_0x460b43,null))[_0x0a9d('0x4b')](handleError(_0x460b43,null));};exports[_0x0a9d('0x4c')]=function(_0x54a2bc,_0xcdbe86){return db[_0x0a9d('0x33')]['create'](_0x54a2bc['body'],{})[_0x0a9d('0x29')](function(_0x3a6dcc){var _0x11f433=_0x54a2bc[_0x0a9d('0x4d')][_0x0a9d('0x4e')]({'plain':!![]});if(!_0x11f433)throw new Error(_0x0a9d('0x4f'));if(_0x11f433['role']==='user'){var _0x5cb1b4=_0x3a6dcc[_0x0a9d('0x4e')]({'plain':!![]});var _0x47c867=_0x0a9d('0x50');return db[_0x0a9d('0x51')][_0x0a9d('0x4a')]({'where':{'name':_0x47c867,'userProfileId':_0x11f433[_0x0a9d('0x52')]},'raw':!![]})[_0x0a9d('0x29')](function(_0xe5c525){if(_0xe5c525&&_0xe5c525[_0x0a9d('0x53')]===0x0){return db[_0x0a9d('0x2b')][_0x0a9d('0x4c')]({'name':_0x5cb1b4[_0x0a9d('0x2f')],'resourceId':_0x5cb1b4['id'],'type':_0xe5c525[_0x0a9d('0x2f')],'sectionId':_0xe5c525['id']},{})[_0x0a9d('0x29')](function(){return _0x3a6dcc;});}else{return _0x3a6dcc;}})[_0x0a9d('0x4b')](function(_0x175de4){logger['error'](_0x0a9d('0x54'),_0x175de4);throw _0x175de4;});}return _0x3a6dcc;})[_0x0a9d('0x29')](respondWithResult(_0xcdbe86,0xc9))[_0x0a9d('0x4b')](handleError(_0xcdbe86,null));};exports[_0x0a9d('0x28')]=function(_0x35c67f,_0xa894cd){if(_0x35c67f[_0x0a9d('0x55')]['id']){delete _0x35c67f[_0x0a9d('0x55')]['id'];}return db[_0x0a9d('0x33')][_0x0a9d('0x4a')]({'where':{'id':_0x35c67f[_0x0a9d('0x56')]['id']}})[_0x0a9d('0x29')](handleEntityNotFound(_0xa894cd,null))[_0x0a9d('0x29')](saveUpdates(_0x35c67f[_0x0a9d('0x55')],null))[_0x0a9d('0x29')](respondWithResult(_0xa894cd,null))[_0x0a9d('0x4b')](handleError(_0xa894cd,null));};exports[_0x0a9d('0x2a')]=function(_0x5b4d72,_0x35f599){return db['Interval'][_0x0a9d('0x4a')]({'where':{'id':_0x5b4d72[_0x0a9d('0x56')]['id']}})['then'](handleEntityNotFound(_0x35f599,null))[_0x0a9d('0x29')](removeEntity(_0x35f599,null))[_0x0a9d('0x4b')](handleError(_0x35f599,null));};exports[_0x0a9d('0x57')]=function(_0x51767b,_0x122b78,_0x307546){if(_0x51767b[_0x0a9d('0x55')]['id']){delete _0x51767b['body']['id'];}return db[_0x0a9d('0x33')][_0x0a9d('0x4a')]({'where':{'id':_0x51767b[_0x0a9d('0x56')]['id']}})[_0x0a9d('0x29')](handleEntityNotFound(_0x122b78,null))[_0x0a9d('0x29')](function(_0x4a3207){if(_0x4a3207){_0x51767b[_0x0a9d('0x55')][_0x0a9d('0x58')]=_0x4a3207['id'];return db[_0x0a9d('0x33')][_0x0a9d('0x4c')](_0x51767b[_0x0a9d('0x55')]);}})[_0x0a9d('0x29')](respondWithResult(_0x122b78,null))[_0x0a9d('0x4b')](handleError(_0x122b78,null));};exports[_0x0a9d('0x59')]=function(_0x304bfd,_0xdd13b8,_0x54cb1e){var _0x3b7449={};var _0x2c13b7={};var _0xb962fd;var _0x45bd6f;return db[_0x0a9d('0x33')][_0x0a9d('0x5a')]({'where':{'id':_0x304bfd['params']['id']}})['then'](handleEntityNotFound(_0xdd13b8,null))[_0x0a9d('0x29')](function(_0x264526){if(_0x264526){_0xb962fd=_0x264526;_0x2c13b7['model']=_[_0x0a9d('0x39')](db[_0x0a9d('0x33')][_0x0a9d('0x34')]);_0x2c13b7[_0x0a9d('0x38')]=_[_0x0a9d('0x39')](_0x304bfd[_0x0a9d('0x38')]);_0x2c13b7[_0x0a9d('0x3a')]=_[_0x0a9d('0x3b')](_0x2c13b7[_0x0a9d('0x37')],_0x2c13b7['query']);_0x3b7449[_0x0a9d('0x3c')]=_['intersection'](_0x2c13b7[_0x0a9d('0x37')],qs['fields'](_0x304bfd[_0x0a9d('0x38')]['fields']));_0x3b7449['attributes']=_0x3b7449['attributes'][_0x0a9d('0x3e')]?_0x3b7449['attributes']:_0x2c13b7[_0x0a9d('0x37')];_0x3b7449[_0x0a9d('0x5b')]=qs[_0x0a9d('0x3f')](_0x304bfd[_0x0a9d('0x38')][_0x0a9d('0x3f')]);_0x3b7449['where']=qs[_0x0a9d('0x3a')](_[_0x0a9d('0x41')](_0x304bfd[_0x0a9d('0x38')],_0x2c13b7['filters']));if(_0x304bfd[_0x0a9d('0x38')][_0x0a9d('0x42')]){_0x3b7449['where']=_[_0x0a9d('0x44')](_0x3b7449['where'],{'$or':_['map'](_0x3b7449[_0x0a9d('0x3c')],function(_0x5b6d39){var _0xa56902={};_0xa56902[_0x5b6d39]={'$like':'%'+_0x304bfd[_0x0a9d('0x38')][_0x0a9d('0x42')]+'%'};return _0xa56902;})});}_0x3b7449=_[_0x0a9d('0x44')]({},_0x3b7449,_0x304bfd[_0x0a9d('0x45')]);return _0xb962fd[_0x0a9d('0x59')](_0x3b7449);}})['then'](function(_0x11d478){if(_0x11d478){_0x45bd6f=_0x11d478[_0x0a9d('0x3e')];if(!_0x304bfd[_0x0a9d('0x38')]['hasOwnProperty']('nolimit')){_0x3b7449[_0x0a9d('0x21')]=qs[_0x0a9d('0x21')](_0x304bfd[_0x0a9d('0x38')][_0x0a9d('0x21')]);_0x3b7449[_0x0a9d('0x23')]=qs[_0x0a9d('0x23')](_0x304bfd[_0x0a9d('0x38')][_0x0a9d('0x23')]);}return _0xb962fd[_0x0a9d('0x59')](_0x3b7449);}})[_0x0a9d('0x29')](function(_0x38b0ab){if(_0x38b0ab){return _0x38b0ab?{'count':_0x45bd6f,'rows':_0x38b0ab}:null;}})[_0x0a9d('0x29')](respondWithResult(_0xdd13b8,null))['catch'](handleError(_0xdd13b8,null));};exports[_0x0a9d('0x5c')]=function(_0x449444,_0xe6310d,_0x1f1343){return db[_0x0a9d('0x33')][_0x0a9d('0x5a')]({'where':{'id':_0x449444[_0x0a9d('0x56')]['id']}})[_0x0a9d('0x29')](handleEntityNotFound(_0xe6310d,null))[_0x0a9d('0x29')](function(_0xa69228){if(_0xa69228){return db[_0x0a9d('0x5d')][_0x0a9d('0x5e')](function(_0x14eb54){return db['Interval']['destroy']({'where':{'IntervalId':_0x449444['params']['id']},'transaction':_0x14eb54})[_0x0a9d('0x29')](function(_0x39b2cf){var _0x30e600=_['map'](_0x449444[_0x0a9d('0x55')],function(_0x5b79cb){delete _0x5b79cb['id'];_0x5b79cb['IntervalId']=_0x449444[_0x0a9d('0x56')]['id'];return _0x5b79cb;});return db[_0x0a9d('0x33')][_0x0a9d('0x5f')](_0x30e600,{'transaction':_0x14eb54});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x449444[_0x0a9d('0x56')]['id']}});});}})[_0x0a9d('0x29')](respondWithResult(_0xe6310d,null))['catch'](handleError(_0xe6310d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 7b484cb..8d1ee11 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 _0x2bda=['rewrite','lodash','util','../../config/logger','api','moment','path','exports','Interval','tools_intervals'];(function(_0xc5263c,_0x1fc1f8){var _0x4e47e9=function(_0x11841f){while(--_0x11841f){_0xc5263c['push'](_0xc5263c['shift']());}};_0x4e47e9(++_0x1fc1f8);}(_0x2bda,0x137));var _0xa2bd=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0x2bda[_0x460fd7];return _0x44d1c2;};'use strict';var _=require(_0xa2bd('0x0'));var util=require(_0xa2bd('0x1'));var logger=require(_0xa2bd('0x2'))(_0xa2bd('0x3'));var moment=require(_0xa2bd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2bd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0xa2bd('0x6')]=function(_0x18afb4,_0x5243af){return _0x18afb4['define'](_0xa2bd('0x7'),attributes,{'tableName':_0xa2bd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x45f2de,_0x1bbff4){extensions['rewrite'](_0x18afb4,_0x45f2de);},'afterBulkCreate':function(_0x102e28,_0x566808,_0x4d00b0){_0x4d00b0();extensions[_0xa2bd('0x9')](_0x18afb4,_0x102e28[0x0]);},'afterUpdate':function(_0x12732f,_0x2554a5){extensions[_0xa2bd('0x9')](_0x18afb4,_0x12732f);},'afterDestroy':function(_0x3b04f9,_0x3a99cf){extensions[_0xa2bd('0x9')](_0x18afb4,_0x3b04f9);}}});}; \ No newline at end of file +var _0x62cf=['bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash','../../config/logger','moment'];(function(_0x216687,_0x22dc4c){var _0xd1a759=function(_0x47fa38){while(--_0x47fa38){_0x216687['push'](_0x216687['shift']());}};_0xd1a759(++_0x22dc4c);}(_0x62cf,0x81));var _0xf62c=function(_0x516683,_0x3cb370){_0x516683=_0x516683-0x0;var _0x17a972=_0x62cf[_0x516683];return _0x17a972;};'use strict';var _=require(_0xf62c('0x0'));var util=require('util');var logger=require(_0xf62c('0x1'))('api');var moment=require(_0xf62c('0x2'));var BPromise=require(_0xf62c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf62c('0x4'));var config=require(_0xf62c('0x5'));var attributes=require(_0xf62c('0x6'));var extensions=require(_0xf62c('0x7'));module[_0xf62c('0x8')]=function(_0x40487e,_0x45749c){return _0x40487e[_0xf62c('0x9')](_0xf62c('0xa'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x181f87,_0x4e0655){extensions[_0xf62c('0xb')](_0x40487e,_0x181f87);},'afterBulkCreate':function(_0x8038ed,_0x9b92cb,_0x424bf6){_0x424bf6();extensions[_0xf62c('0xb')](_0x40487e,_0x8038ed[0x0]);},'afterUpdate':function(_0x250c8c,_0x336122){extensions[_0xf62c('0xb')](_0x40487e,_0x250c8c);},'afterDestroy':function(_0x3b1b62,_0x9a583f){extensions[_0xf62c('0xb')](_0x40487e,_0x3b1b62);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 1beed38..ccd5b40 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 84187a1..498be85 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x4173c5,_0x2f06b3){var _0x2c18c5=function(_0x52caa6){while(--_0x52caa6){_0x4173c5['push'](_0x4173c5['shift']());}};_0x2c18c5(++_0x2f06b3);}(_0x2ef3,0xba));var _0x32ef=function(_0x51bf04,_0x4ed515){_0x51bf04=_0x51bf04-0x0;var _0x545ea6=_0x2ef3[_0x51bf04];return _0x545ea6;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x28a500,_0x2b82e9){var _0x33338a=function(_0x28130f){while(--_0x28130f){_0x28a500['push'](_0x28a500['shift']());}};_0x33338a(++_0x2b82e9);}(_0x2ef3,0xba));var _0x32ef=function(_0x4b2b4a,_0x58766b){_0x4b2b4a=_0x4b2b4a-0x0;var _0xcc251b=_0x2ef3[_0x4b2b4a];return _0xcc251b;};'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 385c2d1..1c74b8c 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 _0x9479=['summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','setEncoding','utf8','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','headers','connection','remoteAddress','socket','body','https','../../config/logger','api','support','3eAmWpBVP0'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x9479,0x9f));var _0x9947=function(_0x297acf,_0x530d6c){_0x297acf=_0x297acf-0x0;var _0x2dd757=_0x9479[_0x297acf];return _0x2dd757;};'use strict';var BPromise=require('bluebird');var https=require(_0x9947('0x0'));var logger=require(_0x9947('0x1'))(_0x9947('0x2'));var USERNAME=_0x9947('0x3');var PASSWORD=_0x9947('0x4');function openIssue(_0x4b1291,_0x3a94a6){var _0x2d22c2={'fields':{'project':{'key':_0x4b1291['key']||'MOTGUI'},'summary':(_0x4b1291[_0x9947('0x5')]||'Report')+_0x9947('0x6')+_0x4b1291['ip'],'description':_0x4b1291[_0x9947('0x7')]||JSON[_0x9947('0x8')](_0x4b1291),'issuetype':{'name':_0x4b1291[_0x9947('0x9')]||_0x9947('0xa')}}};_0x2d22c2[_0x9947('0xb')][_0x9947('0xc')]=_0x4b1291['email'];_0x2d22c2[_0x9947('0xb')]['customfield_11501']=_0x4b1291[_0x9947('0xd')];_0x2d22c2[_0x9947('0xb')][_0x9947('0xe')]=_0x4b1291[_0x9947('0xf')];_0x2d22c2['fields']['customfield_11503']=_0x4b1291[_0x9947('0x10')];_0x2d22c2['fields'][_0x9947('0x11')]=_0x4b1291[_0x9947('0x12')];_0x2d22c2['fields'][_0x9947('0x13')]=_0x4b1291['ip'];var _0x4d0ec8={'host':_0x9947('0x14'),'port':0x1bb,'path':_0x9947('0x15'),'method':_0x9947('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x9947('0x17'),'Authorization':_0x9947('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x9947('0x19')]('base64')}};var _0x49c8d9=JSON[_0x9947('0x8')](_0x2d22c2);var _0x2e038d=https['request'](_0x4d0ec8,function(_0x5e947c){_0x5e947c[_0x9947('0x1a')](_0x9947('0x1b'));var _0x6af3dd='';_0x5e947c['on']('data',function(_0x3c2f41){_0x6af3dd+=_0x3c2f41;});_0x5e947c['on'](_0x9947('0x1c'),function(){if(_0x3a94a6){return _0x3a94a6[_0x9947('0x1d')](_0x5e947c['statusCode'])[_0x9947('0x1e')](JSON[_0x9947('0x1f')](_0x6af3dd));}});});_0x2e038d['on'](_0x9947('0x20'),function(_0x2db2f9){if(_0x3a94a6){return _0x3a94a6[_0x9947('0x1d')](0x1f4)[_0x9947('0x1e')]({'errors':[{'message':_0x9947('0x21'),'type':'api.jira'}]});}});_0x2e038d['write'](_0x49c8d9);_0x2e038d[_0x9947('0x1c')]();}exports[_0x9947('0x22')]=openIssue;exports[_0x9947('0x23')]=function(_0x285795,_0x15620c){_0x285795['body']['ip']=_0x285795[_0x9947('0x24')]['x-forwarded-for']||_0x285795[_0x9947('0x25')][_0x9947('0x26')]||_0x285795[_0x9947('0x27')][_0x9947('0x26')]||_0x285795[_0x9947('0x25')][_0x9947('0x27')][_0x9947('0x26')];return openIssue(_0x285795[_0x9947('0x28')],_0x15620c);}; \ No newline at end of file +var _0x425a=['bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket'];(function(_0x4e368c,_0x31a76d){var _0x423ca3=function(_0x4d7629){while(--_0x4d7629){_0x4e368c['push'](_0x4e368c['shift']());}};_0x423ca3(++_0x31a76d);}(_0x425a,0xe1));var _0xa425=function(_0x3f97a7,_0x4732e9){_0x3f97a7=_0x3f97a7-0x0;var _0x4cead3=_0x425a[_0x3f97a7];return _0x4cead3;};'use strict';var BPromise=require(_0xa425('0x0'));var https=require(_0xa425('0x1'));var logger=require(_0xa425('0x2'))(_0xa425('0x3'));var USERNAME=_0xa425('0x4');var PASSWORD=_0xa425('0x5');function openIssue(_0x32ed7a,_0x2fadd1){var _0x54c372={'fields':{'project':{'key':_0x32ed7a['key']||_0xa425('0x6')},'summary':(_0x32ed7a[_0xa425('0x7')]||'Report')+'\x20from\x20'+_0x32ed7a['ip'],'description':_0x32ed7a['description']||JSON[_0xa425('0x8')](_0x32ed7a),'issuetype':{'name':_0x32ed7a[_0xa425('0x9')]||_0xa425('0xa')}}};_0x54c372[_0xa425('0xb')]['customfield_11500']=_0x32ed7a[_0xa425('0xc')];_0x54c372[_0xa425('0xb')][_0xa425('0xd')]=_0x32ed7a[_0xa425('0xe')];_0x54c372['fields'][_0xa425('0xf')]=_0x32ed7a[_0xa425('0x10')];_0x54c372[_0xa425('0xb')][_0xa425('0x11')]=_0x32ed7a[_0xa425('0x12')];_0x54c372['fields'][_0xa425('0x13')]=_0x32ed7a['reason'];_0x54c372[_0xa425('0xb')]['customfield_10102']=_0x32ed7a['ip'];var _0x318901={'host':_0xa425('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xa425('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xa425('0x16'),'Authorization':_0xa425('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0xa425('0x18')](_0xa425('0x19'))}};var _0x4463b4=JSON[_0xa425('0x8')](_0x54c372);var _0x163964=https['request'](_0x318901,function(_0x1b4df4){_0x1b4df4[_0xa425('0x1a')](_0xa425('0x1b'));var _0x5e4d5f='';_0x1b4df4['on'](_0xa425('0x1c'),function(_0x46b4a7){_0x5e4d5f+=_0x46b4a7;});_0x1b4df4['on'](_0xa425('0x1d'),function(){if(_0x2fadd1){return _0x2fadd1[_0xa425('0x1e')](_0x1b4df4['statusCode'])[_0xa425('0x1f')](JSON[_0xa425('0x20')](_0x5e4d5f));}});});_0x163964['on'](_0xa425('0x21'),function(_0x2c3c72){if(_0x2fadd1){return _0x2fadd1[_0xa425('0x1e')](0x1f4)['json']({'errors':[{'message':_0xa425('0x22'),'type':_0xa425('0x23')}]});}});_0x163964[_0xa425('0x24')](_0x4463b4);_0x163964[_0xa425('0x1d')]();}exports[_0xa425('0x25')]=openIssue;exports[_0xa425('0x26')]=function(_0x35ee66,_0x31387c){_0x35ee66[_0xa425('0x27')]['ip']=_0x35ee66[_0xa425('0x28')][_0xa425('0x29')]||_0x35ee66[_0xa425('0x2a')][_0xa425('0x2b')]||_0x35ee66[_0xa425('0x2c')][_0xa425('0x2b')]||_0x35ee66[_0xa425('0x2a')][_0xa425('0x2c')][_0xa425('0x2b')];return openIssue(_0x35ee66[_0xa425('0x27')],_0x31387c);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 4523f09..a6f4727 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 _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated'];(function(_0x31f2e3,_0x411c43){var _0x414786=function(_0x2b9f4c){while(--_0x2b9f4c){_0x31f2e3['push'](_0x31f2e3['shift']());}};_0x414786(++_0x411c43);}(_0xbec5,0xe5));var _0x5bec=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0xbec5[_0x51cc1d];return _0x2eb9f2;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('0x15')]=router; \ No newline at end of file +var _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x48fdee,_0x23b462){var _0x39bb04=function(_0x4320a5){while(--_0x4320a5){_0x48fdee['push'](_0x48fdee['shift']());}};_0x39bb04(++_0x23b462);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xcb91[_0x2de0a7];return _0x429437;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index d5fc62a..036fb99 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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x383b25,_0x3f09b2){_0x383b25=_0x383b25-0x0;var _0x56c39e=_0x7a54[_0x383b25];return _0x56c39e;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x9c8122,_0x1df740){_0x9c8122=_0x9c8122-0x0;var _0x20de16=_0x7a54[_0x9c8122];return _0x20de16;};'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 8954a5d..9b6440a 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 _0x16a6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4e4c4e,_0x24e8d6){var _0x5d04d7=function(_0x285b0d){while(--_0x285b0d){_0x4e4c4e['push'](_0x4e4c4e['shift']());}};_0x5d04d7(++_0x24e8d6);}(_0x16a6,0x15c));var _0x616a=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0x16a6[_0x4aba15];return _0x1c8122;};'use strict';var emlformat=require(_0x616a('0x0'));var rimraf=require(_0x616a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x616a('0x2'));var rp=require(_0x616a('0x3'));var moment=require(_0x616a('0x4'));var BPromise=require(_0x616a('0x5'));var Mustache=require(_0x616a('0x6'));var util=require(_0x616a('0x7'));var path=require('path');var sox=require(_0x616a('0x8'));var csv=require(_0x616a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x616a('0xa'));var squel=require(_0x616a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x616a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x616a('0xd'));var Papa=require('papaparse');var Redis=require(_0x616a('0xe'));var authService=require(_0x616a('0xf'));var qs=require(_0x616a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x616a('0x11'));var logger=require(_0x616a('0x12'))(_0x616a('0x13'));var utils=require(_0x616a('0x14'));var config=require(_0x616a('0x15'));var licenseUtil=require(_0x616a('0x16'));var db=require(_0x616a('0x17'))['db'];function respondWithStatusCode(_0x4122b7,_0x5755c7){_0x5755c7=_0x5755c7||0xcc;return function(_0x318dfe){if(_0x318dfe){return _0x4122b7[_0x616a('0x18')](_0x5755c7);}return _0x4122b7[_0x616a('0x19')](_0x5755c7)[_0x616a('0x1a')]();};}function respondWithResult(_0x295fc2,_0x4a33d5){_0x4a33d5=_0x4a33d5||0xc8;return function(_0x1399c1){if(_0x1399c1){return _0x295fc2[_0x616a('0x19')](_0x4a33d5)[_0x616a('0x1b')](_0x1399c1);}};}function respondWithFilteredResult(_0x18b6dc,_0x3bcf20){return function(_0x53f228){if(_0x53f228){var _0x204e68=typeof _0x3bcf20[_0x616a('0x1c')]==='undefined'&&typeof _0x3bcf20['limit']===_0x616a('0x1d');var _0x4768b2=_0x53f228[_0x616a('0x1e')];var _0x4d59e7=_0x204e68?0x0:_0x3bcf20[_0x616a('0x1c')];var _0x1f3241=_0x204e68?_0x53f228['count']:_0x3bcf20['offset']+_0x3bcf20[_0x616a('0x1f')];var _0x27e95c;if(_0x1f3241>=_0x4768b2){_0x1f3241=_0x4768b2;_0x27e95c=0xc8;}else{_0x27e95c=0xce;}_0x18b6dc[_0x616a('0x19')](_0x27e95c);return _0x18b6dc[_0x616a('0x20')]('Content-Range',_0x4d59e7+'-'+_0x1f3241+'/'+_0x4768b2)['json'](_0x53f228);}return null;};}function patchUpdates(_0x5568fd){return function(_0x5f2e80){try{jsonpatch['apply'](_0x5f2e80,_0x5568fd,!![]);}catch(_0x5ee3f2){return BPromise[_0x616a('0x21')](_0x5ee3f2);}return _0x5f2e80['save']();};}function saveUpdates(_0xb8ceeb,_0x137974){return function(_0x4f5594){if(_0x4f5594){return _0x4f5594[_0x616a('0x22')](_0xb8ceeb)[_0x616a('0x23')](function(_0x3d484b){return _0x3d484b;});}return null;};}function removeEntity(_0x100c98,_0x500c22){return function(_0x2db2bb){if(_0x2db2bb){return _0x2db2bb[_0x616a('0x24')]()[_0x616a('0x23')](function(){_0x100c98[_0x616a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e11f2,_0x4be8a8){return function(_0x30c1a){if(!_0x30c1a){_0x3e11f2[_0x616a('0x18')](0x194);}return _0x30c1a;};}function handleError(_0x5f1e6a,_0x55abc8){_0x55abc8=_0x55abc8||0x1f4;return function(_0x50c6b8){logger[_0x616a('0x25')](_0x50c6b8[_0x616a('0x26')]);if(_0x50c6b8[_0x616a('0x27')]){delete _0x50c6b8[_0x616a('0x27')];}_0x5f1e6a['status'](_0x55abc8)[_0x616a('0x28')](_0x50c6b8);};}exports[_0x616a('0x29')]=function(_0x195b73,_0x163fd0){var _0x28ca50={},_0x87db00={},_0x41a22d={'count':0x0,'rows':[]};var _0x5f3a59=_[_0x616a('0x2a')](db[_0x616a('0x2b')]['rawAttributes'],function(_0x41f722){return{'name':_0x41f722['fieldName'],'type':_0x41f722['type'][_0x616a('0x2c')]};});_0x87db00[_0x616a('0x2d')]=_[_0x616a('0x2a')](_0x5f3a59,'name');_0x87db00[_0x616a('0x2e')]=_[_0x616a('0x2f')](_0x195b73[_0x616a('0x2e')]);_0x87db00[_0x616a('0x30')]=_[_0x616a('0x31')](_0x87db00[_0x616a('0x2d')],_0x87db00['query']);_0x28ca50[_0x616a('0x32')]=_['intersection'](_0x87db00[_0x616a('0x2d')],qs[_0x616a('0x33')](_0x195b73[_0x616a('0x2e')]['fields']));_0x28ca50[_0x616a('0x32')]=_0x28ca50[_0x616a('0x32')]['length']?_0x28ca50['attributes']:_0x87db00[_0x616a('0x2d')];if(!_0x195b73[_0x616a('0x2e')][_0x616a('0x34')](_0x616a('0x35'))){_0x28ca50['limit']=qs['limit'](_0x195b73['query'][_0x616a('0x1f')]);_0x28ca50[_0x616a('0x1c')]=qs[_0x616a('0x1c')](_0x195b73[_0x616a('0x2e')][_0x616a('0x1c')]);}_0x28ca50[_0x616a('0x36')]=qs[_0x616a('0x37')](_0x195b73[_0x616a('0x2e')][_0x616a('0x37')]);_0x28ca50[_0x616a('0x38')]=qs['filters'](_[_0x616a('0x39')](_0x195b73['query'],_0x87db00[_0x616a('0x30')]),_0x5f3a59);if(_0x195b73[_0x616a('0x2e')][_0x616a('0x3a')]){_0x28ca50[_0x616a('0x38')]=_[_0x616a('0x3b')](_0x28ca50[_0x616a('0x38')],{'$or':_[_0x616a('0x2a')](_0x5f3a59,function(_0x220c32){if(_0x220c32[_0x616a('0x3c')]!=='VIRTUAL'){var _0x304e27={};_0x304e27[_0x220c32[_0x616a('0x27')]]={'$like':'%'+_0x195b73[_0x616a('0x2e')][_0x616a('0x3a')]+'%'};return _0x304e27;}})});}_0x28ca50=_['merge']({},_0x28ca50,_0x195b73[_0x616a('0x3d')]);var _0x4c6a76={'where':_0x28ca50[_0x616a('0x38')]};return db['JscriptyAnswerReport'][_0x616a('0x1e')](_0x4c6a76)[_0x616a('0x23')](function(_0x598085){_0x41a22d[_0x616a('0x1e')]=_0x598085;if(_0x195b73['query'][_0x616a('0x3e')]){_0x28ca50[_0x616a('0x3f')]=[{'all':!![]}];}return db[_0x616a('0x2b')][_0x616a('0x40')](_0x28ca50);})[_0x616a('0x23')](function(_0x21fd2b){_0x41a22d[_0x616a('0x41')]=_0x21fd2b;return _0x41a22d;})['then'](respondWithFilteredResult(_0x163fd0,_0x28ca50))[_0x616a('0x42')](handleError(_0x163fd0,null));};exports['show']=function(_0x409689,_0x35e3e3){var _0x199140={'raw':!![],'where':{'id':_0x409689[_0x616a('0x43')]['id']}},_0x4dbb8b={};_0x4dbb8b[_0x616a('0x2d')]=_[_0x616a('0x2f')](db[_0x616a('0x2b')][_0x616a('0x44')]);_0x4dbb8b['query']=_[_0x616a('0x2f')](_0x409689[_0x616a('0x2e')]);_0x4dbb8b[_0x616a('0x30')]=_['intersection'](_0x4dbb8b[_0x616a('0x2d')],_0x4dbb8b[_0x616a('0x2e')]);_0x199140[_0x616a('0x32')]=_[_0x616a('0x31')](_0x4dbb8b[_0x616a('0x2d')],qs[_0x616a('0x33')](_0x409689[_0x616a('0x2e')]['fields']));_0x199140[_0x616a('0x32')]=_0x199140[_0x616a('0x32')]['length']?_0x199140['attributes']:_0x4dbb8b[_0x616a('0x2d')];if(_0x409689[_0x616a('0x2e')][_0x616a('0x3e')]){_0x199140[_0x616a('0x3f')]=[{'all':!![]}];}_0x199140=_[_0x616a('0x3b')]({},_0x199140,_0x409689[_0x616a('0x3d')]);return db['JscriptyAnswerReport'][_0x616a('0x45')](_0x199140)[_0x616a('0x23')](handleEntityNotFound(_0x35e3e3,null))[_0x616a('0x23')](respondWithResult(_0x35e3e3,null))['catch'](handleError(_0x35e3e3,null));};exports[_0x616a('0x46')]=function(_0x507efa,_0x52d38){return db[_0x616a('0x2b')][_0x616a('0x46')](_0x507efa[_0x616a('0x47')],{})['then'](respondWithResult(_0x52d38,0xc9))[_0x616a('0x42')](handleError(_0x52d38,null));};exports[_0x616a('0x22')]=function(_0x3bea90,_0x3d42fc){if(_0x3bea90[_0x616a('0x47')]['id']){delete _0x3bea90['body']['id'];}return db[_0x616a('0x2b')][_0x616a('0x45')]({'where':{'id':_0x3bea90[_0x616a('0x43')]['id']}})[_0x616a('0x23')](handleEntityNotFound(_0x3d42fc,null))[_0x616a('0x23')](saveUpdates(_0x3bea90[_0x616a('0x47')],null))['then'](respondWithResult(_0x3d42fc,null))[_0x616a('0x42')](handleError(_0x3d42fc,null));};exports[_0x616a('0x24')]=function(_0x349cd0,_0x16e6c2){return db['JscriptyAnswerReport'][_0x616a('0x45')]({'where':{'id':_0x349cd0['params']['id']}})[_0x616a('0x23')](handleEntityNotFound(_0x16e6c2,null))[_0x616a('0x23')](removeEntity(_0x16e6c2,null))['catch'](handleError(_0x16e6c2,null));};exports[_0x616a('0x48')]=function(_0x1ea086,_0x30a48e){return db['JscriptyAnswerReport'][_0x616a('0x48')]()[_0x616a('0x23')](respondWithResult(_0x30a48e,null))[_0x616a('0x42')](handleError(_0x30a48e,null));}; \ No newline at end of file +var _0xe647=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','then','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','length','include','create','body','update','find','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs'];(function(_0x5b1130,_0x7b86db){var _0x4bb0c8=function(_0x1361ed){while(--_0x1361ed){_0x5b1130['push'](_0x5b1130['shift']());}};_0x4bb0c8(++_0x7b86db);}(_0xe647,0x16d));var _0x7e64=function(_0x127c89,_0x5d4977){_0x127c89=_0x127c89-0x0;var _0x389573=_0xe647[_0x127c89];return _0x389573;};'use strict';var emlformat=require(_0x7e64('0x0'));var rimraf=require(_0x7e64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e64('0x2'));var rp=require(_0x7e64('0x3'));var moment=require(_0x7e64('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7e64('0x5'));var path=require(_0x7e64('0x6'));var sox=require(_0x7e64('0x7'));var csv=require(_0x7e64('0x8'));var ejs=require(_0x7e64('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e64('0xa'));var squel=require(_0x7e64('0xb'));var crypto=require(_0x7e64('0xc'));var jsforce=require(_0x7e64('0xd'));var deskjs=require(_0x7e64('0xe'));var toCsv=require(_0x7e64('0x8'));var querystring=require(_0x7e64('0xf'));var Papa=require(_0x7e64('0x10'));var Redis=require(_0x7e64('0x11'));var authService=require(_0x7e64('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e64('0x13'))(_0x7e64('0x14'));var utils=require(_0x7e64('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7e64('0x16'));var db=require(_0x7e64('0x17'))['db'];function respondWithStatusCode(_0x592018,_0x501326){_0x501326=_0x501326||0xcc;return function(_0x16322e){if(_0x16322e){return _0x592018[_0x7e64('0x18')](_0x501326);}return _0x592018[_0x7e64('0x19')](_0x501326)[_0x7e64('0x1a')]();};}function respondWithResult(_0x5a24f0,_0x4af048){_0x4af048=_0x4af048||0xc8;return function(_0x26d64b){if(_0x26d64b){return _0x5a24f0[_0x7e64('0x19')](_0x4af048)[_0x7e64('0x1b')](_0x26d64b);}};}function respondWithFilteredResult(_0x35df8c,_0x266b34){return function(_0x30de16){if(_0x30de16){var _0x570787=typeof _0x266b34[_0x7e64('0x1c')]==='undefined'&&typeof _0x266b34[_0x7e64('0x1d')]===_0x7e64('0x1e');var _0x3bf9a4=_0x30de16['count'];var _0x483c40=_0x570787?0x0:_0x266b34[_0x7e64('0x1c')];var _0x290822=_0x570787?_0x30de16[_0x7e64('0x1f')]:_0x266b34[_0x7e64('0x1c')]+_0x266b34['limit'];var _0x423fce;if(_0x290822>=_0x3bf9a4){_0x290822=_0x3bf9a4;_0x423fce=0xc8;}else{_0x423fce=0xce;}_0x35df8c['status'](_0x423fce);return _0x35df8c[_0x7e64('0x20')](_0x7e64('0x21'),_0x483c40+'-'+_0x290822+'/'+_0x3bf9a4)[_0x7e64('0x1b')](_0x30de16);}return null;};}function patchUpdates(_0x4618cd){return function(_0x1444cb){try{jsonpatch[_0x7e64('0x22')](_0x1444cb,_0x4618cd,!![]);}catch(_0x384a92){return BPromise['reject'](_0x384a92);}return _0x1444cb['save']();};}function saveUpdates(_0x356283,_0x19884d){return function(_0x384757){if(_0x384757){return _0x384757['update'](_0x356283)[_0x7e64('0x23')](function(_0x3fe293){return _0x3fe293;});}return null;};}function removeEntity(_0x47f91b,_0x525f72){return function(_0x292b5c){if(_0x292b5c){return _0x292b5c['destroy']()['then'](function(){_0x47f91b[_0x7e64('0x19')](0xcc)[_0x7e64('0x1a')]();});}};}function handleEntityNotFound(_0x5d16ad,_0x46a53c){return function(_0xabf947){if(!_0xabf947){_0x5d16ad[_0x7e64('0x18')](0x194);}return _0xabf947;};}function handleError(_0x42f3f1,_0x2c1be6){_0x2c1be6=_0x2c1be6||0x1f4;return function(_0x8a743e){logger[_0x7e64('0x24')](_0x8a743e['stack']);if(_0x8a743e[_0x7e64('0x25')]){delete _0x8a743e['name'];}_0x42f3f1['status'](_0x2c1be6)[_0x7e64('0x26')](_0x8a743e);};}exports[_0x7e64('0x27')]=function(_0x44ec65,_0x5e7fac){var _0x482aad={},_0x2a9852={},_0x1d0153={'count':0x0,'rows':[]};var _0x2c67ae=_[_0x7e64('0x28')](db[_0x7e64('0x29')][_0x7e64('0x2a')],function(_0x12c6ac){return{'name':_0x12c6ac[_0x7e64('0x2b')],'type':_0x12c6ac[_0x7e64('0x2c')]['key']};});_0x2a9852['model']=_[_0x7e64('0x28')](_0x2c67ae,_0x7e64('0x25'));_0x2a9852[_0x7e64('0x2d')]=_[_0x7e64('0x2e')](_0x44ec65[_0x7e64('0x2d')]);_0x2a9852[_0x7e64('0x2f')]=_[_0x7e64('0x30')](_0x2a9852[_0x7e64('0x31')],_0x2a9852[_0x7e64('0x2d')]);_0x482aad['attributes']=_[_0x7e64('0x30')](_0x2a9852[_0x7e64('0x31')],qs[_0x7e64('0x32')](_0x44ec65[_0x7e64('0x2d')][_0x7e64('0x32')]));_0x482aad[_0x7e64('0x33')]=_0x482aad['attributes']['length']?_0x482aad[_0x7e64('0x33')]:_0x2a9852['model'];if(!_0x44ec65[_0x7e64('0x2d')][_0x7e64('0x34')](_0x7e64('0x35'))){_0x482aad[_0x7e64('0x1d')]=qs['limit'](_0x44ec65[_0x7e64('0x2d')]['limit']);_0x482aad[_0x7e64('0x1c')]=qs[_0x7e64('0x1c')](_0x44ec65[_0x7e64('0x2d')]['offset']);}_0x482aad[_0x7e64('0x36')]=qs[_0x7e64('0x37')](_0x44ec65[_0x7e64('0x2d')]['sort']);_0x482aad[_0x7e64('0x38')]=qs[_0x7e64('0x2f')](_[_0x7e64('0x39')](_0x44ec65['query'],_0x2a9852[_0x7e64('0x2f')]),_0x2c67ae);if(_0x44ec65['query'][_0x7e64('0x3a')]){_0x482aad[_0x7e64('0x38')]=_[_0x7e64('0x3b')](_0x482aad[_0x7e64('0x38')],{'$or':_['map'](_0x2c67ae,function(_0x570f61){if(_0x570f61[_0x7e64('0x2c')]!=='VIRTUAL'){var _0x5f12e6={};_0x5f12e6[_0x570f61['name']]={'$like':'%'+_0x44ec65[_0x7e64('0x2d')][_0x7e64('0x3a')]+'%'};return _0x5f12e6;}})});}_0x482aad=_[_0x7e64('0x3b')]({},_0x482aad,_0x44ec65[_0x7e64('0x3c')]);var _0x3c1b84={'where':_0x482aad[_0x7e64('0x38')]};return db['JscriptyAnswerReport'][_0x7e64('0x1f')](_0x3c1b84)[_0x7e64('0x23')](function(_0x363efb){_0x1d0153[_0x7e64('0x1f')]=_0x363efb;if(_0x44ec65[_0x7e64('0x2d')][_0x7e64('0x3d')]){_0x482aad['include']=[{'all':!![]}];}return db[_0x7e64('0x29')][_0x7e64('0x3e')](_0x482aad);})[_0x7e64('0x23')](function(_0x4230de){_0x1d0153[_0x7e64('0x3f')]=_0x4230de;return _0x1d0153;})[_0x7e64('0x23')](respondWithFilteredResult(_0x5e7fac,_0x482aad))[_0x7e64('0x40')](handleError(_0x5e7fac,null));};exports[_0x7e64('0x41')]=function(_0x2590cf,_0x4e6d0c){var _0x177946={'raw':!![],'where':{'id':_0x2590cf['params']['id']}},_0x530cda={};_0x530cda['model']=_['keys'](db[_0x7e64('0x29')][_0x7e64('0x2a')]);_0x530cda[_0x7e64('0x2d')]=_[_0x7e64('0x2e')](_0x2590cf['query']);_0x530cda['filters']=_[_0x7e64('0x30')](_0x530cda['model'],_0x530cda[_0x7e64('0x2d')]);_0x177946[_0x7e64('0x33')]=_[_0x7e64('0x30')](_0x530cda[_0x7e64('0x31')],qs['fields'](_0x2590cf[_0x7e64('0x2d')][_0x7e64('0x32')]));_0x177946['attributes']=_0x177946[_0x7e64('0x33')][_0x7e64('0x42')]?_0x177946[_0x7e64('0x33')]:_0x530cda['model'];if(_0x2590cf['query'][_0x7e64('0x3d')]){_0x177946[_0x7e64('0x43')]=[{'all':!![]}];}_0x177946=_[_0x7e64('0x3b')]({},_0x177946,_0x2590cf[_0x7e64('0x3c')]);return db[_0x7e64('0x29')]['find'](_0x177946)['then'](handleEntityNotFound(_0x4e6d0c,null))[_0x7e64('0x23')](respondWithResult(_0x4e6d0c,null))[_0x7e64('0x40')](handleError(_0x4e6d0c,null));};exports[_0x7e64('0x44')]=function(_0x27dc6b,_0x3ee444){return db[_0x7e64('0x29')][_0x7e64('0x44')](_0x27dc6b[_0x7e64('0x45')],{})[_0x7e64('0x23')](respondWithResult(_0x3ee444,0xc9))['catch'](handleError(_0x3ee444,null));};exports[_0x7e64('0x46')]=function(_0x18bbf1,_0x59b895){if(_0x18bbf1['body']['id']){delete _0x18bbf1[_0x7e64('0x45')]['id'];}return db[_0x7e64('0x29')][_0x7e64('0x47')]({'where':{'id':_0x18bbf1[_0x7e64('0x48')]['id']}})[_0x7e64('0x23')](handleEntityNotFound(_0x59b895,null))[_0x7e64('0x23')](saveUpdates(_0x18bbf1[_0x7e64('0x45')],null))[_0x7e64('0x23')](respondWithResult(_0x59b895,null))[_0x7e64('0x40')](handleError(_0x59b895,null));};exports[_0x7e64('0x49')]=function(_0x224c59,_0x4e9703){return db[_0x7e64('0x29')][_0x7e64('0x47')]({'where':{'id':_0x224c59[_0x7e64('0x48')]['id']}})[_0x7e64('0x23')](handleEntityNotFound(_0x4e9703,null))[_0x7e64('0x23')](removeEntity(_0x4e9703,null))['catch'](handleError(_0x4e9703,null));};exports[_0x7e64('0x4a')]=function(_0x35c38c,_0x6e7e8){return db[_0x7e64('0x29')][_0x7e64('0x4a')]()[_0x7e64('0x23')](respondWithResult(_0x6e7e8,null))[_0x7e64('0x40')](handleError(_0x6e7e8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 7b39456..0744c6c 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 _0x82c2=['JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0x82c2,0x17a));var _0x282c=function(_0x35eea6,_0x195b2a){_0x35eea6=_0x35eea6-0x0;var _0x23c5c5=_0x82c2[_0x35eea6];return _0x23c5c5;};'use strict';var _=require(_0x282c('0x0'));var util=require(_0x282c('0x1'));var logger=require(_0x282c('0x2'))(_0x282c('0x3'));var moment=require(_0x282c('0x4'));var BPromise=require(_0x282c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x282c('0x6'));var rimraf=require(_0x282c('0x7'));var config=require(_0x282c('0x8'));var attributes=require(_0x282c('0x9'));module[_0x282c('0xa')]=function(_0x5818b3,_0x4b55ef){return _0x5818b3[_0x282c('0xb')](_0x282c('0xc'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c9f=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','api','bluebird','request-promise','rimraf'];(function(_0x1e97c4,_0x4da9d8){var _0x13f515=function(_0x4a69c2){while(--_0x4a69c2){_0x1e97c4['push'](_0x1e97c4['shift']());}};_0x13f515(++_0x4da9d8);}(_0x6c9f,0x1db));var _0xf6c9=function(_0x7b41,_0x48da28){_0x7b41=_0x7b41-0x0;var _0x411ecc=_0x6c9f[_0x7b41];return _0x411ecc;};'use strict';var _=require(_0xf6c9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf6c9('0x1'));var moment=require('moment');var BPromise=require(_0xf6c9('0x2'));var rp=require(_0xf6c9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6c9('0x4'));var config=require(_0xf6c9('0x5'));var attributes=require(_0xf6c9('0x6'));module[_0xf6c9('0x7')]=function(_0x200514,_0x28b4d2){return _0x200514[_0xf6c9('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0xf6c9('0x9'),'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 e8af61a..5dc5283 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 _0x8947=['catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8947,0x14b));var _0x7894=function(_0x17b2a2,_0x355a07){_0x17b2a2=_0x17b2a2-0x0;var _0x25be00=_0x8947[_0x17b2a2];return _0x25be00;};'use strict';var _=require(_0x7894('0x0'));var util=require('util');var moment=require(_0x7894('0x1'));var BPromise=require(_0x7894('0x2'));var rs=require(_0x7894('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7894('0x4'));var logger=require('../../config/logger')(_0x7894('0x5'));var config=require(_0x7894('0x6'));var jayson=require(_0x7894('0x7'));var client=jayson[_0x7894('0x8')][_0x7894('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17bc98,_0xe68368,_0x3ddc7c){return new BPromise(function(_0x5565e3,_0x1176a2){return client[_0x7894('0xa')](_0x17bc98,_0x3ddc7c)[_0x7894('0xb')](function(_0x4454e2){logger[_0x7894('0xc')](_0x7894('0xd'),_0xe68368,_0x7894('0xe'));logger[_0x7894('0xf')](_0x7894('0x10'),_0xe68368,'request\x20sent',JSON[_0x7894('0x11')](_0x4454e2));if(_0x4454e2['error']){if(_0x4454e2[_0x7894('0x12')][_0x7894('0x13')]===0x1f4){logger[_0x7894('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xe68368,_0x4454e2['error'][_0x7894('0x14')]);return _0x1176a2(_0x4454e2[_0x7894('0x12')][_0x7894('0x14')]);}logger[_0x7894('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xe68368,_0x4454e2['error'][_0x7894('0x14')]);return _0x5565e3(_0x4454e2['error'][_0x7894('0x14')]);}else{logger[_0x7894('0xc')](_0x7894('0xd'),_0xe68368,_0x7894('0xe'));_0x5565e3(_0x4454e2['result'][_0x7894('0x14')]);}})[_0x7894('0x15')](function(_0x20e7fb){logger['error'](_0x7894('0xd'),_0xe68368,_0x20e7fb);_0x1176a2(_0x20e7fb);});});} \ No newline at end of file +var _0x2b29=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','randomstring','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2b29,0x14c));var _0x92b2=function(_0x2727b9,_0x16d954){_0x2727b9=_0x2727b9-0x0;var _0x17383a=_0x2b29[_0x2727b9];return _0x17383a;};'use strict';var _=require(_0x92b2('0x0'));var util=require('util');var moment=require(_0x92b2('0x1'));var BPromise=require('bluebird');var rs=require(_0x92b2('0x2'));var fs=require('fs');var Redis=require(_0x92b2('0x3'));var db=require(_0x92b2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x92b2('0x5'))(_0x92b2('0x6'));var config=require('../../config/environment');var jayson=require(_0x92b2('0x7'));var client=jayson[_0x92b2('0x8')][_0x92b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2010d1,_0x54fe38,_0x242ab8){return new BPromise(function(_0x5b517c,_0x5a997f){return client[_0x92b2('0xa')](_0x2010d1,_0x242ab8)[_0x92b2('0xb')](function(_0x309cf0){logger['info'](_0x92b2('0xc'),_0x54fe38,_0x92b2('0xd'));logger[_0x92b2('0xe')](_0x92b2('0xf'),_0x54fe38,_0x92b2('0xd'),JSON[_0x92b2('0x10')](_0x309cf0));if(_0x309cf0[_0x92b2('0x11')]){if(_0x309cf0[_0x92b2('0x11')][_0x92b2('0x12')]===0x1f4){logger[_0x92b2('0x11')](_0x92b2('0xc'),_0x54fe38,_0x309cf0[_0x92b2('0x11')][_0x92b2('0x13')]);return _0x5a997f(_0x309cf0['error'][_0x92b2('0x13')]);}logger[_0x92b2('0x11')](_0x92b2('0xc'),_0x54fe38,_0x309cf0[_0x92b2('0x11')][_0x92b2('0x13')]);return _0x5b517c(_0x309cf0['error']['message']);}else{logger[_0x92b2('0x14')](_0x92b2('0xc'),_0x54fe38,_0x92b2('0xd'));_0x5b517c(_0x309cf0['result'][_0x92b2('0x13')]);}})['catch'](function(_0x242bbd){logger[_0x92b2('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x54fe38,_0x242bbd);_0x5a997f(_0x242bbd);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index a0033f4..41bfaa1 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 _0x65ff=['create','/:id/clone','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','post'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x65ff,0xcb));var _0xf65f=function(_0x3074f1,_0x4901aa){_0x3074f1=_0x3074f1-0x0;var _0x149af8=_0x65ff[_0x3074f1];return _0x149af8;};'use strict';var multer=require(_0xf65f('0x0'));var util=require(_0xf65f('0x1'));var path=require(_0xf65f('0x2'));var timeout=require('connect-timeout');var express=require(_0xf65f('0x3'));var router=express[_0xf65f('0x4')]();var fs_extra=require(_0xf65f('0x5'));var auth=require(_0xf65f('0x6'));var interaction=require(_0xf65f('0x7'));var config=require(_0xf65f('0x8'));var controller=require('./jscriptyProject.controller');router[_0xf65f('0x9')]('/',auth[_0xf65f('0xa')](),controller[_0xf65f('0xb')]);router[_0xf65f('0x9')](_0xf65f('0xc'),auth[_0xf65f('0xa')](),controller[_0xf65f('0xd')]);router[_0xf65f('0x9')](_0xf65f('0xe'),auth[_0xf65f('0xa')](),controller[_0xf65f('0xf')]);router['get']('/:id/answers',auth['isAuthenticated'](),controller[_0xf65f('0x10')]);router[_0xf65f('0x9')](_0xf65f('0x11'),auth[_0xf65f('0xa')](),timeout(_0xf65f('0x12')),controller[_0xf65f('0x13')]);router[_0xf65f('0x14')]('/',auth[_0xf65f('0xa')](),controller[_0xf65f('0x15')]);router[_0xf65f('0x14')](_0xf65f('0x16'),auth[_0xf65f('0xa')](),controller['clone']);router[_0xf65f('0x17')]('/:id',auth[_0xf65f('0xa')](),controller[_0xf65f('0x18')]);router[_0xf65f('0x19')](_0xf65f('0xc'),auth[_0xf65f('0xa')](),controller[_0xf65f('0x1a')]);module[_0xf65f('0x1b')]=router; \ No newline at end of file +var _0x2ed0=['express','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','isAuthenticated','index','/:id','show','get','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','post','/:id/clone','clone','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x478a60,_0x43cfc5){var _0x4021b7=function(_0x26d7de){while(--_0x26d7de){_0x478a60['push'](_0x478a60['shift']());}};_0x4021b7(++_0x43cfc5);}(_0x2ed0,0x1a6));var _0x02ed=function(_0x42f393,_0x60ba21){_0x42f393=_0x42f393-0x0;var _0x4b28d5=_0x2ed0[_0x42f393];return _0x4b28d5;};'use strict';var multer=require('multer');var util=require(_0x02ed('0x0'));var path=require(_0x02ed('0x1'));var timeout=require(_0x02ed('0x2'));var express=require(_0x02ed('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x02ed('0x4'));var interaction=require(_0x02ed('0x5'));var config=require('../../config/environment');var controller=require(_0x02ed('0x6'));router['get']('/',auth[_0x02ed('0x7')](),controller[_0x02ed('0x8')]);router['get'](_0x02ed('0x9'),auth[_0x02ed('0x7')](),controller[_0x02ed('0xa')]);router[_0x02ed('0xb')](_0x02ed('0xc'),auth[_0x02ed('0x7')](),controller[_0x02ed('0xd')]);router['get'](_0x02ed('0xe'),auth[_0x02ed('0x7')](),controller[_0x02ed('0xf')]);router[_0x02ed('0xb')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x02ed('0x10')),controller['getSummary']);router[_0x02ed('0x11')]('/',auth[_0x02ed('0x7')](),controller['create']);router['post'](_0x02ed('0x12'),auth[_0x02ed('0x7')](),controller[_0x02ed('0x13')]);router[_0x02ed('0x14')](_0x02ed('0x9'),auth[_0x02ed('0x7')](),controller[_0x02ed('0x15')]);router[_0x02ed('0x16')]('/:id',auth[_0x02ed('0x7')](),controller[_0x02ed('0x17')]);module[_0x02ed('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index ff8b977..b464e24 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 _0x3da6=['BOOLEAN','sequelize','lodash','exports','STRING','TEXT','long','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','getDataValue','description'];(function(_0x2ef1bc,_0x354fab){var _0x1aa2f7=function(_0x334c18){while(--_0x334c18){_0x2ef1bc['push'](_0x2ef1bc['shift']());}};_0x1aa2f7(++_0x354fab);}(_0x3da6,0x1d2));var _0x63da=function(_0x2b9358,_0x5a9e10){_0x2b9358=_0x2b9358-0x0;var _0x73cce8=_0x3da6[_0x2b9358];return _0x73cce8;};'use strict';var Sequelize=require(_0x63da('0x0'));var _=require(_0x63da('0x1'));var util=require('util');module[_0x63da('0x2')]={'name':{'type':Sequelize[_0x63da('0x3')],'unique':'name'},'description':{'type':Sequelize[_0x63da('0x3')]},'formData':{'type':Sequelize[_0x63da('0x4')](_0x63da('0x5')),'set':function(_0x3dcd47){if(_['isObjectLike'](_0x3dcd47)){this[_0x63da('0x6')](_0x63da('0x7'),JSON[_0x63da('0x8')](_0x3dcd47));}else if(_['isString'](_0x3dcd47)){this[_0x63da('0x6')](_0x63da('0x7'),_0x3dcd47);}else{this[_0x63da('0x6')](_0x63da('0x7'),util[_0x63da('0x9')](_0x63da('0xa'),this['getDataValue'](_0x63da('0xb'))||'',this[_0x63da('0xc')](_0x63da('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x63da('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x63da('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xb5d4=['formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike'];(function(_0x179607,_0x3e7bf7){var _0x3084f0=function(_0x1563ab){while(--_0x1563ab){_0x179607['push'](_0x179607['shift']());}};_0x3084f0(++_0x3e7bf7);}(_0xb5d4,0x148));var _0x4b5d=function(_0x36c08,_0x4a4021){_0x36c08=_0x36c08-0x0;var _0x5499e7=_0xb5d4[_0x36c08];return _0x5499e7;};'use strict';var Sequelize=require(_0x4b5d('0x0'));var _=require('lodash');var util=require(_0x4b5d('0x1'));module[_0x4b5d('0x2')]={'name':{'type':Sequelize[_0x4b5d('0x3')],'unique':_0x4b5d('0x4')},'description':{'type':Sequelize[_0x4b5d('0x3')]},'formData':{'type':Sequelize[_0x4b5d('0x5')](_0x4b5d('0x6')),'set':function(_0x4bafdc){if(_[_0x4b5d('0x7')](_0x4bafdc)){this['setDataValue'](_0x4b5d('0x8'),JSON['stringify'](_0x4bafdc));}else if(_[_0x4b5d('0x9')](_0x4bafdc)){this['setDataValue']('formData',_0x4bafdc);}else{this[_0x4b5d('0xa')]('formData',util[_0x4b5d('0xb')](_0x4b5d('0xc'),this[_0x4b5d('0xd')]('name')||'',this[_0x4b5d('0xd')](_0x4b5d('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4b5d('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 6ace328..aa3032d 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 _0xd8a2=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','body','role','getSessions','findOne','JscriptySessionReport','nolimit','order','findAll','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','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','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','stack','name','index','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','JscriptyProject','includeAll','rows','show','include','catch'];(function(_0x585634,_0x397896){var _0x342969=function(_0x2376cd){while(--_0x2376cd){_0x585634['push'](_0x585634['shift']());}};_0x342969(++_0x397896);}(_0xd8a2,0x128));var _0x2d8a=function(_0x14cddd,_0xd110fd){_0x14cddd=_0x14cddd-0x0;var _0x5e0bf8=_0xd8a2[_0x14cddd];return _0x5e0bf8;};'use strict';var emlformat=require(_0x2d8a('0x0'));var rimraf=require(_0x2d8a('0x1'));var zipdir=require(_0x2d8a('0x2'));var jsonpatch=require(_0x2d8a('0x3'));var rp=require(_0x2d8a('0x4'));var moment=require(_0x2d8a('0x5'));var BPromise=require(_0x2d8a('0x6'));var Mustache=require('mustache');var util=require(_0x2d8a('0x7'));var path=require(_0x2d8a('0x8'));var sox=require('sox');var csv=require(_0x2d8a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d8a('0xa'));var _=require('lodash');var squel=require(_0x2d8a('0xb'));var crypto=require(_0x2d8a('0xc'));var jsforce=require(_0x2d8a('0xd'));var deskjs=require(_0x2d8a('0xe'));var toCsv=require(_0x2d8a('0x9'));var querystring=require(_0x2d8a('0xf'));var Papa=require(_0x2d8a('0x10'));var Redis=require(_0x2d8a('0x11'));var authService=require(_0x2d8a('0x12'));var qs=require(_0x2d8a('0x13'));var as=require(_0x2d8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d8a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2d8a('0x16'));var licenseUtil=require(_0x2d8a('0x17'));var db=require(_0x2d8a('0x18'))['db'];function respondWithStatusCode(_0x406eb2,_0x2c698b){_0x2c698b=_0x2c698b||0xcc;return function(_0x12f819){if(_0x12f819){return _0x406eb2[_0x2d8a('0x19')](_0x2c698b);}return _0x406eb2[_0x2d8a('0x1a')](_0x2c698b)[_0x2d8a('0x1b')]();};}function respondWithResult(_0xdac34c,_0x63f53){_0x63f53=_0x63f53||0xc8;return function(_0x2c6e94){if(_0x2c6e94){return _0xdac34c['status'](_0x63f53)[_0x2d8a('0x1c')](_0x2c6e94);}};}function respondWithFilteredResult(_0x1763d6,_0x5bc042){return function(_0x5c7f74){if(_0x5c7f74){var _0x45218a=typeof _0x5bc042[_0x2d8a('0x1d')]===_0x2d8a('0x1e')&&typeof _0x5bc042[_0x2d8a('0x1f')]==='undefined';var _0x2aa33d=_0x5c7f74['count'];var _0x3147b9=_0x45218a?0x0:_0x5bc042['offset'];var _0x2b0291=_0x45218a?_0x5c7f74[_0x2d8a('0x20')]:_0x5bc042[_0x2d8a('0x1d')]+_0x5bc042[_0x2d8a('0x1f')];var _0xab6753;if(_0x2b0291>=_0x2aa33d){_0x2b0291=_0x2aa33d;_0xab6753=0xc8;}else{_0xab6753=0xce;}_0x1763d6['status'](_0xab6753);return _0x1763d6[_0x2d8a('0x21')](_0x2d8a('0x22'),_0x3147b9+'-'+_0x2b0291+'/'+_0x2aa33d)[_0x2d8a('0x1c')](_0x5c7f74);}return null;};}function patchUpdates(_0x2d5830){return function(_0x10e836){try{jsonpatch[_0x2d8a('0x23')](_0x10e836,_0x2d5830,!![]);}catch(_0x45f97b){return BPromise[_0x2d8a('0x24')](_0x45f97b);}return _0x10e836[_0x2d8a('0x25')]();};}function saveUpdates(_0x333298,_0x3b8e0e){return function(_0x15567f){if(_0x15567f){return _0x15567f[_0x2d8a('0x26')](_0x333298)[_0x2d8a('0x27')](function(_0x463774){return _0x463774;});}return null;};}function removeEntity(_0x5c622b,_0x137c4d){return function(_0x31a036){if(_0x31a036){return _0x31a036[_0x2d8a('0x28')]()['then'](function(){var _0x414626=_0x31a036[_0x2d8a('0x29')]({'plain':!![]});var _0x3574e0=_0x2d8a('0x2a');return db[_0x2d8a('0x2b')]['destroy']({'where':{'type':_0x3574e0,'resourceId':_0x414626['id']}})[_0x2d8a('0x27')](function(){return _0x31a036;});})[_0x2d8a('0x27')](function(){_0x5c622b[_0x2d8a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2568de,_0x4584de){return function(_0x2d9033){if(!_0x2d9033){_0x2568de[_0x2d8a('0x19')](0x194);}return _0x2d9033;};}function handleError(_0xa33158,_0x144d07){_0x144d07=_0x144d07||0x1f4;return function(_0x1a4750){logger['error'](_0x1a4750[_0x2d8a('0x2c')]);if(_0x1a4750[_0x2d8a('0x2d')]){delete _0x1a4750[_0x2d8a('0x2d')];}_0xa33158[_0x2d8a('0x1a')](_0x144d07)['send'](_0x1a4750);};}exports[_0x2d8a('0x2e')]=function(_0x426f48,_0x5beac0){var _0x41ad20={},_0x362e32={},_0x3d191d={'count':0x0,'rows':[]};var _0x429091=_['map'](db['JscriptyProject'][_0x2d8a('0x2f')],function(_0x66424a){return{'name':_0x66424a['fieldName'],'type':_0x66424a[_0x2d8a('0x30')][_0x2d8a('0x31')]};});_0x362e32[_0x2d8a('0x32')]=_['map'](_0x429091,_0x2d8a('0x2d'));_0x362e32['query']=_[_0x2d8a('0x33')](_0x426f48[_0x2d8a('0x34')]);_0x362e32[_0x2d8a('0x35')]=_[_0x2d8a('0x36')](_0x362e32[_0x2d8a('0x32')],_0x362e32[_0x2d8a('0x34')]);_0x41ad20[_0x2d8a('0x37')]=_[_0x2d8a('0x36')](_0x362e32['model'],qs[_0x2d8a('0x38')](_0x426f48['query'][_0x2d8a('0x38')]));_0x41ad20[_0x2d8a('0x37')]=_0x41ad20[_0x2d8a('0x37')][_0x2d8a('0x39')]?_0x41ad20[_0x2d8a('0x37')]:_0x362e32[_0x2d8a('0x32')];if(!_0x426f48['query'][_0x2d8a('0x3a')]('nolimit')){_0x41ad20[_0x2d8a('0x1f')]=qs[_0x2d8a('0x1f')](_0x426f48[_0x2d8a('0x34')][_0x2d8a('0x1f')]);_0x41ad20[_0x2d8a('0x1d')]=qs[_0x2d8a('0x1d')](_0x426f48[_0x2d8a('0x34')][_0x2d8a('0x1d')]);}_0x41ad20['order']=qs[_0x2d8a('0x3b')](_0x426f48[_0x2d8a('0x34')][_0x2d8a('0x3b')]);_0x41ad20[_0x2d8a('0x3c')]=qs[_0x2d8a('0x35')](_[_0x2d8a('0x3d')](_0x426f48[_0x2d8a('0x34')],_0x362e32['filters']),_0x429091);if(_0x426f48['query'][_0x2d8a('0x3e')]){_0x41ad20[_0x2d8a('0x3c')]=_[_0x2d8a('0x3f')](_0x41ad20[_0x2d8a('0x3c')],{'$or':_[_0x2d8a('0x40')](_0x429091,function(_0xf9fd9c){if(_0xf9fd9c[_0x2d8a('0x30')]!==_0x2d8a('0x41')){var _0x49dea2={};_0x49dea2[_0xf9fd9c['name']]={'$like':'%'+_0x426f48[_0x2d8a('0x34')][_0x2d8a('0x3e')]+'%'};return _0x49dea2;}})});}_0x41ad20=_['merge']({},_0x41ad20,_0x426f48[_0x2d8a('0x42')]);var _0x2e0ca1={'where':_0x41ad20[_0x2d8a('0x3c')]};return db[_0x2d8a('0x43')][_0x2d8a('0x20')](_0x2e0ca1)[_0x2d8a('0x27')](function(_0xcbb2ef){_0x3d191d[_0x2d8a('0x20')]=_0xcbb2ef;if(_0x426f48[_0x2d8a('0x34')][_0x2d8a('0x44')]){_0x41ad20['include']=[{'all':!![]}];}return db[_0x2d8a('0x43')]['findAll'](_0x41ad20);})[_0x2d8a('0x27')](function(_0x3107b3){_0x3d191d[_0x2d8a('0x45')]=_0x3107b3;return _0x3d191d;})[_0x2d8a('0x27')](respondWithFilteredResult(_0x5beac0,_0x41ad20))['catch'](handleError(_0x5beac0,null));};exports[_0x2d8a('0x46')]=function(_0x41549a,_0x2efbb9){var _0x4401f6={'raw':![],'where':{'id':_0x41549a['params']['id']}},_0x4c7568={};_0x4c7568[_0x2d8a('0x32')]=_[_0x2d8a('0x33')](db[_0x2d8a('0x43')][_0x2d8a('0x2f')]);_0x4c7568['query']=_['keys'](_0x41549a['query']);_0x4c7568[_0x2d8a('0x35')]=_[_0x2d8a('0x36')](_0x4c7568[_0x2d8a('0x32')],_0x4c7568[_0x2d8a('0x34')]);_0x4401f6['attributes']=_[_0x2d8a('0x36')](_0x4c7568[_0x2d8a('0x32')],qs[_0x2d8a('0x38')](_0x41549a[_0x2d8a('0x34')][_0x2d8a('0x38')]));_0x4401f6[_0x2d8a('0x37')]=_0x4401f6['attributes'][_0x2d8a('0x39')]?_0x4401f6[_0x2d8a('0x37')]:_0x4c7568['model'];if(_0x41549a['query'][_0x2d8a('0x44')]){_0x4401f6[_0x2d8a('0x47')]=[{'all':!![]}];}_0x4401f6=_['merge']({},_0x4401f6,_0x41549a['options']);return db[_0x2d8a('0x43')]['find'](_0x4401f6)[_0x2d8a('0x27')](handleEntityNotFound(_0x2efbb9,null))[_0x2d8a('0x27')](respondWithResult(_0x2efbb9,null))[_0x2d8a('0x48')](handleError(_0x2efbb9,null));};exports[_0x2d8a('0x49')]=function(_0x4a3732,_0x426205){return db[_0x2d8a('0x43')][_0x2d8a('0x49')](_0x4a3732['body'],{})[_0x2d8a('0x27')](function(_0x160c2e){var _0x3d5af4=_0x4a3732[_0x2d8a('0x4a')][_0x2d8a('0x29')]({'plain':!![]});if(!_0x3d5af4)throw new Error(_0x2d8a('0x4b'));if(_0x3d5af4['role']===_0x2d8a('0x4a')){var _0x3b5324=_0x160c2e[_0x2d8a('0x29')]({'plain':!![]});var _0x235dc7=_0x2d8a('0x2a');return db['UserProfileSection'][_0x2d8a('0x4c')]({'where':{'name':_0x235dc7,'userProfileId':_0x3d5af4[_0x2d8a('0x4d')]},'raw':!![]})[_0x2d8a('0x27')](function(_0x576542){if(_0x576542&&_0x576542[_0x2d8a('0x4e')]===0x0){return db[_0x2d8a('0x2b')][_0x2d8a('0x49')]({'name':_0x3b5324[_0x2d8a('0x2d')],'resourceId':_0x3b5324['id'],'type':_0x576542[_0x2d8a('0x2d')],'sectionId':_0x576542['id']},{})[_0x2d8a('0x27')](function(){return _0x160c2e;});}else{return _0x160c2e;}})[_0x2d8a('0x48')](function(_0x1f2f7d){logger[_0x2d8a('0x4f')](_0x2d8a('0x50'),_0x1f2f7d);throw _0x1f2f7d;});}return _0x160c2e;})[_0x2d8a('0x27')](respondWithResult(_0x426205,0xc9))[_0x2d8a('0x48')](handleError(_0x426205,null));};exports['clone']=function(_0x4bfaef,_0x12e67b){var _0x410ad2={'where':{'id':_0x4bfaef[_0x2d8a('0x51')]['id']}},_0x13edba={};_0x13edba[_0x2d8a('0x32')]=_['keys'](db[_0x2d8a('0x43')]['rawAttributes']);_0x410ad2[_0x2d8a('0x37')]=_[_0x2d8a('0x36')](_0x13edba[_0x2d8a('0x32')],qs[_0x2d8a('0x38')](_0x4bfaef[_0x2d8a('0x34')][_0x2d8a('0x38')]));_0x410ad2[_0x2d8a('0x37')]=_0x410ad2[_0x2d8a('0x37')][_0x2d8a('0x39')]?_0x410ad2[_0x2d8a('0x37')]:_0x13edba[_0x2d8a('0x32')];if(_0x4bfaef[_0x2d8a('0x34')][_0x2d8a('0x44')]){_0x410ad2[_0x2d8a('0x47')]=[{'all':!![]}];}_0x410ad2=_['merge']({},_0x410ad2,_0x4bfaef[_0x2d8a('0x42')]);return db[_0x2d8a('0x43')][_0x2d8a('0x4c')](_0x410ad2)['then'](handleEntityNotFound(_0x12e67b,null))[_0x2d8a('0x27')](function(_0x32d9a8){if(_0x32d9a8){var _0x3b6b70=_0x32d9a8[_0x2d8a('0x29')]({'plain':!![]});_0x3b6b70=qs[_0x2d8a('0x52')](_0x3b6b70,['id',_0x2d8a('0x53'),_0x2d8a('0x54')]);_0x4bfaef[_0x2d8a('0x55')]=_['omit'](_0x4bfaef[_0x2d8a('0x55')],['id',_0x2d8a('0x53'),_0x2d8a('0x54')]);return db[_0x2d8a('0x43')][_0x2d8a('0x49')](_[_0x2d8a('0x3f')](_0x3b6b70,_0x4bfaef[_0x2d8a('0x55')]),{'include':_0x4bfaef[_0x2d8a('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x2d8a('0x27')](function(_0x7996e8){var _0x495aa9=_0x4bfaef[_0x2d8a('0x4a')][_0x2d8a('0x29')]({'plain':!![]});if(!_0x495aa9)throw new Error(_0x2d8a('0x4b'));if(_0x495aa9[_0x2d8a('0x56')]===_0x2d8a('0x4a')){var _0x1ea2ef=_0x7996e8[_0x2d8a('0x29')]({'plain':!![]});var _0x5e01b0=_0x2d8a('0x2a');return db['UserProfileSection'][_0x2d8a('0x4c')]({'where':{'name':_0x5e01b0,'userProfileId':_0x495aa9[_0x2d8a('0x4d')]},'raw':!![]})[_0x2d8a('0x27')](function(_0x4519ce){if(_0x4519ce&&_0x4519ce[_0x2d8a('0x4e')]===0x0){return db['UserProfileResource'][_0x2d8a('0x49')]({'name':_0x1ea2ef['name'],'resourceId':_0x1ea2ef['id'],'type':_0x4519ce[_0x2d8a('0x2d')],'sectionId':_0x4519ce['id']},{})[_0x2d8a('0x27')](function(){return _0x7996e8;});}else{return _0x7996e8;}})[_0x2d8a('0x48')](function(_0x55ede2){logger['error'](_0x2d8a('0x50'),_0x55ede2);throw _0x55ede2;});}return _0x7996e8;});}})[_0x2d8a('0x27')](respondWithResult(_0x12e67b,0xc9))['catch'](handleError(_0x12e67b,null));};exports['update']=function(_0xa98cc3,_0x2e5f08){if(_0xa98cc3[_0x2d8a('0x55')]['id']){delete _0xa98cc3['body']['id'];}return db[_0x2d8a('0x43')][_0x2d8a('0x4c')]({'where':{'id':_0xa98cc3[_0x2d8a('0x51')]['id']}})[_0x2d8a('0x27')](handleEntityNotFound(_0x2e5f08,null))[_0x2d8a('0x27')](saveUpdates(_0xa98cc3[_0x2d8a('0x55')],null))[_0x2d8a('0x27')](respondWithResult(_0x2e5f08,null))['catch'](handleError(_0x2e5f08,null));};exports[_0x2d8a('0x28')]=function(_0x58004c,_0x100283){return db[_0x2d8a('0x43')]['find']({'where':{'id':_0x58004c[_0x2d8a('0x51')]['id']}})[_0x2d8a('0x27')](handleEntityNotFound(_0x100283,null))[_0x2d8a('0x27')](removeEntity(_0x100283,null))['catch'](handleError(_0x100283,null));};exports[_0x2d8a('0x57')]=function(_0x180dee,_0x519f71,_0x3b3e3e){var _0x20c168={'raw':!![],'where':{}};var _0x1d7f91={};var _0x50ac65={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2d8a('0x58')]({'where':{'id':_0x180dee['params']['id']}})[_0x2d8a('0x27')](handleEntityNotFound(_0x519f71,null))[_0x2d8a('0x27')](function(_0x4199e3){if(_0x4199e3){_0x1d7f91[_0x2d8a('0x32')]=_[_0x2d8a('0x33')](db[_0x2d8a('0x59')][_0x2d8a('0x2f')]);_0x1d7f91['query']=_[_0x2d8a('0x33')](_0x180dee['query']);_0x1d7f91[_0x2d8a('0x35')]=_[_0x2d8a('0x36')](_0x1d7f91[_0x2d8a('0x32')],_0x1d7f91[_0x2d8a('0x34')]);_0x20c168[_0x2d8a('0x37')]=_['intersection'](_0x1d7f91[_0x2d8a('0x32')],qs[_0x2d8a('0x38')](_0x180dee['query'][_0x2d8a('0x38')]));_0x20c168[_0x2d8a('0x37')]=_0x20c168[_0x2d8a('0x37')]['length']?_0x20c168[_0x2d8a('0x37')]:_0x1d7f91['model'];if(!_0x180dee[_0x2d8a('0x34')][_0x2d8a('0x3a')](_0x2d8a('0x5a'))){_0x20c168['limit']=qs['limit'](_0x180dee['query'][_0x2d8a('0x1f')]);_0x20c168[_0x2d8a('0x1d')]=qs[_0x2d8a('0x1d')](_0x180dee['query']['offset']);}_0x20c168[_0x2d8a('0x5b')]=qs['sort'](_0x180dee[_0x2d8a('0x34')]['sort']);_0x20c168[_0x2d8a('0x3c')]=qs['filters'](_[_0x2d8a('0x3d')](_0x180dee[_0x2d8a('0x34')],_0x1d7f91[_0x2d8a('0x35')]));_0x20c168[_0x2d8a('0x3c')]['ProjectId']=_0x4199e3['id'];if(_0x180dee[_0x2d8a('0x34')][_0x2d8a('0x3e')]){_0x20c168[_0x2d8a('0x3c')]=_[_0x2d8a('0x3f')](_0x20c168['where'],{'$or':_[_0x2d8a('0x40')](_0x20c168['attributes'],function(_0x47b1d7){var _0x54ce18={};_0x54ce18[_0x47b1d7]={'$like':'%'+_0x180dee[_0x2d8a('0x34')]['filter']+'%'};return _0x54ce18;})});}_0x20c168=_[_0x2d8a('0x3f')]({},_0x20c168,_0x180dee[_0x2d8a('0x42')]);return db[_0x2d8a('0x59')][_0x2d8a('0x20')]({'where':_0x20c168[_0x2d8a('0x3c')]})['then'](function(_0x1b0db4){_0x50ac65['count']=_0x1b0db4;if(_0x180dee[_0x2d8a('0x34')]['includeAll']){_0x20c168[_0x2d8a('0x47')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2d8a('0x5c')](_0x20c168);})[_0x2d8a('0x27')](function(_0x424a23){_0x50ac65['rows']=_0x424a23;return _0x50ac65;});}})[_0x2d8a('0x27')](respondWithFilteredResult(_0x519f71,_0x20c168))[_0x2d8a('0x48')](handleError(_0x519f71,null));};exports[_0x2d8a('0x5d')]=function(_0x580e86,_0x3277ba,_0x3e7131){var _0x3043f1={'raw':!![],'where':{}};var _0xbccff0={};var _0x1619d9={'count':0x0,'rows':[]};return db[_0x2d8a('0x43')]['findOne']({'where':{'id':_0x580e86[_0x2d8a('0x51')]['id']}})[_0x2d8a('0x27')](handleEntityNotFound(_0x3277ba,null))['then'](function(_0x521fcb){if(_0x521fcb){_0xbccff0[_0x2d8a('0x32')]=_['keys'](db[_0x2d8a('0x5e')][_0x2d8a('0x2f')]);_0xbccff0[_0x2d8a('0x34')]=_[_0x2d8a('0x33')](_0x580e86['query']);_0xbccff0[_0x2d8a('0x35')]=_['intersection'](_0xbccff0[_0x2d8a('0x32')],_0xbccff0[_0x2d8a('0x34')]);_0x3043f1[_0x2d8a('0x37')]=_[_0x2d8a('0x36')](_0xbccff0[_0x2d8a('0x32')],qs[_0x2d8a('0x38')](_0x580e86[_0x2d8a('0x34')][_0x2d8a('0x38')]));_0x3043f1[_0x2d8a('0x37')]=_0x3043f1[_0x2d8a('0x37')]['length']?_0x3043f1[_0x2d8a('0x37')]:_0xbccff0[_0x2d8a('0x32')];if(!_0x580e86['query'][_0x2d8a('0x3a')](_0x2d8a('0x5a'))){_0x3043f1[_0x2d8a('0x1f')]=qs['limit'](_0x580e86[_0x2d8a('0x34')][_0x2d8a('0x1f')]);_0x3043f1[_0x2d8a('0x1d')]=qs['offset'](_0x580e86[_0x2d8a('0x34')]['offset']);}_0x3043f1[_0x2d8a('0x5b')]=qs[_0x2d8a('0x3b')](_0x580e86['query'][_0x2d8a('0x3b')]);_0x3043f1[_0x2d8a('0x3c')]=qs[_0x2d8a('0x35')](_['pick'](_0x580e86[_0x2d8a('0x34')],_0xbccff0['filters']));_0x3043f1[_0x2d8a('0x3c')][_0x2d8a('0x5f')]=_0x521fcb['id'];if(_0x580e86['query'][_0x2d8a('0x3e')]){_0x3043f1[_0x2d8a('0x3c')]=_[_0x2d8a('0x3f')](_0x3043f1[_0x2d8a('0x3c')],{'$or':_['map'](_0x3043f1[_0x2d8a('0x37')],function(_0x5b13af){var _0x4a433={};_0x4a433[_0x5b13af]={'$like':'%'+_0x580e86[_0x2d8a('0x34')][_0x2d8a('0x3e')]+'%'};return _0x4a433;})});}_0x3043f1=_[_0x2d8a('0x3f')]({},_0x3043f1,_0x580e86[_0x2d8a('0x42')]);return db[_0x2d8a('0x5e')]['count']({'where':_0x3043f1[_0x2d8a('0x3c')]})['then'](function(_0xdc860c){_0x1619d9[_0x2d8a('0x20')]=_0xdc860c;if(_0x580e86[_0x2d8a('0x34')]['includeAll']){_0x3043f1[_0x2d8a('0x47')]=[{'all':!![]}];}return db[_0x2d8a('0x5e')][_0x2d8a('0x5c')](_0x3043f1);})[_0x2d8a('0x27')](function(_0x4311bc){_0x1619d9['rows']=_0x4311bc;return _0x1619d9;});}})[_0x2d8a('0x27')](respondWithFilteredResult(_0x3277ba,_0x3043f1))[_0x2d8a('0x48')](handleError(_0x3277ba,null));};function char(_0x32e035){return _0x2d8a('0x60')===typeof _0x32e035?String[_0x2d8a('0x61')]['apply'](null,arguments):_0x32e035;}function needsEncapsulation(_0x161b05){return!!_0x161b05&&(_0x161b05['toString']()[_0x2d8a('0x62')](char(0xd))>=0x0||_0x161b05[_0x2d8a('0x63')]()[_0x2d8a('0x62')](char(0xa))>=0x0||_0x161b05[_0x2d8a('0x63')]()[_0x2d8a('0x62')](char(0x2c))>=0x0||_0x161b05['toString']()[_0x2d8a('0x62')](char(0x22))>=0x0);}function encapsulate(_0xd067c1){var _0x3b0db4=char(0x22),_0x31f3f8='\x5c'+char(0x22),_0x2d656d=_0xd067c1[_0x2d8a('0x63')]()[_0x2d8a('0x64')](new RegExp(_0x3b0db4,'g'),_0x31f3f8);return _0x3b0db4+_0x2d656d+_0x3b0db4;}exports[_0x2d8a('0x65')]=function(_0xe684ff,_0x11ae1c,_0x3f6d75){var _0x2a8da6,_0x505b51;var _0x1b63b0={'where':{'ProjectId':_0xe684ff['params']['id']}};if(_0xe684ff[_0x2d8a('0x34')][_0x2d8a('0x66')]){_0x1b63b0[_0x2d8a('0x3c')][_0x2d8a('0x67')]=JSON[_0x2d8a('0x68')](_0xe684ff[_0x2d8a('0x34')][_0x2d8a('0x66')]);}return db[_0x2d8a('0x59')][_0x2d8a('0x5c')](_0x1b63b0)[_0x2d8a('0x27')](handleEntityNotFound(_0x11ae1c,null))[_0x2d8a('0x27')](function(_0x3649cc){if(_0x3649cc){_0x2a8da6=_0x3649cc;return db[_0x2d8a('0x69')][_0x2d8a('0x5c')]({'where':{'SessionId':{'$in':_[_0x2d8a('0x40')](_0x2a8da6,'id')},'ProjectId':_0xe684ff[_0x2d8a('0x51')]['id']},'order':_0x2d8a('0x6a')});}})[_0x2d8a('0x27')](handleEntityNotFound(_0x11ae1c,null))['then'](function(_0x3326b4){if(_0x3326b4){_0x505b51=_0x3326b4;var _0x269ac4={};for(var _0x73b571=0x0,_0x49e1c3=_0x505b51[_0x2d8a('0x39')];_0x73b571<_0x49e1c3;_0x73b571++){if(!_0x269ac4[_0x2d8a('0x3a')](_0x505b51[_0x73b571][_0x2d8a('0x6b')])){_0x269ac4[_0x505b51[_0x73b571][_0x2d8a('0x6b')]]=needsEncapsulation(_0x505b51[_0x73b571][_0x2d8a('0x6c')])?encapsulate(_0x505b51[_0x73b571][_0x2d8a('0x6c')]):_0x505b51[_0x73b571]['question'];}}var _0x5c72cf=[],_0x57227e={};for(var _0xc0f1ac=0x0,_0x52c8d6=_0x2a8da6['length'];_0xc0f1ac<_0x52c8d6;_0xc0f1ac++){_0x57227e={'ProjectId':_0xe684ff['params']['id'],'SessionId':_0x2a8da6[_0xc0f1ac]['id'],'StartTime':moment(_0x2a8da6[_0xc0f1ac][_0x2d8a('0x67')])[_0x2d8a('0x6d')](_0x2d8a('0x6e'))};for(var _0x212351=0x0,_0x498a74=_0x505b51['length'];_0x212351<_0x498a74;_0x212351++){if(_0x505b51[_0x212351][_0x2d8a('0x6f')]==_0x2a8da6[_0xc0f1ac]['id']&&_0x269ac4[_0x2d8a('0x3a')](_0x505b51[_0x212351][_0x2d8a('0x6b')])){_0x57227e[_0x269ac4[_0x505b51[_0x212351][_0x2d8a('0x6b')]]]=_0x505b51[_0x212351][_0x2d8a('0x70')];}}for(var _0x44ddca in _0x269ac4){if(!_0x57227e[_0x2d8a('0x3a')](_0x269ac4[_0x44ddca])){_0x57227e[_0x269ac4[_0x44ddca]]=null;}}_0x5c72cf[_0x2d8a('0x71')](_0x57227e);}return _0x5c72cf;}})[_0x2d8a('0x27')](function(_0x3cc7a6){if(!_[_0x2d8a('0x72')](_0x3cc7a6)){var _0x5705d8=toCsv(_0x3cc7a6);var _0x3f3c9a=Date[_0x2d8a('0x73')]();fs[_0x2d8a('0x74')](util[_0x2d8a('0x6d')](_0x2d8a('0x75'),_0xe684ff[_0x2d8a('0x51')]['id'],_0x3f3c9a),_0x5705d8);_0x11ae1c[_0x2d8a('0x76')]('Content-disposition',_0x2d8a('0x77')+util[_0x2d8a('0x6d')](_0x2d8a('0x78'),_0xe684ff[_0x2d8a('0x51')]['id'],_0x3f3c9a));_0x11ae1c[_0x2d8a('0x76')](_0x2d8a('0x79'),_0x2d8a('0x7a'));return _0x11ae1c['download'](util['format'](_0x2d8a('0x75'),_0xe684ff[_0x2d8a('0x51')]['id'],_0x3f3c9a));}else{return _0x11ae1c[_0x2d8a('0x19')](0xcc);}})[_0x2d8a('0x48')](handleError(_0x11ae1c,null));}; \ No newline at end of file +var _0x8237=['userProfileId','autoAssociation','UserProfileResource','JscriptySessionReport','order','ProjectId','findAll','getAnswers','JscriptyAnswerReport','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','text/csv','download','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','stack','name','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role'];(function(_0x59049f,_0x2b26b4){var _0xcb0b4e=function(_0x21750d){while(--_0x21750d){_0x59049f['push'](_0x59049f['shift']());}};_0xcb0b4e(++_0x2b26b4);}(_0x8237,0x96));var _0x7823=function(_0x5e3fca,_0x1e214f){_0x5e3fca=_0x5e3fca-0x0;var _0x4c168f=_0x8237[_0x5e3fca];return _0x4c168f;};'use strict';var emlformat=require(_0x7823('0x0'));var rimraf=require(_0x7823('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7823('0x2'));var moment=require(_0x7823('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7823('0x4'));var util=require('util');var path=require('path');var sox=require(_0x7823('0x5'));var csv=require(_0x7823('0x6'));var ejs=require(_0x7823('0x7'));var fs=require('fs');var fs_extra=require(_0x7823('0x8'));var _=require(_0x7823('0x9'));var squel=require(_0x7823('0xa'));var crypto=require(_0x7823('0xb'));var jsforce=require(_0x7823('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7823('0x6'));var querystring=require(_0x7823('0xd'));var Papa=require('papaparse');var Redis=require(_0x7823('0xe'));var authService=require(_0x7823('0xf'));var qs=require(_0x7823('0x10'));var as=require(_0x7823('0x11'));var hardwareService=require(_0x7823('0x12'));var logger=require(_0x7823('0x13'))(_0x7823('0x14'));var utils=require(_0x7823('0x15'));var config=require(_0x7823('0x16'));var licenseUtil=require(_0x7823('0x17'));var db=require(_0x7823('0x18'))['db'];function respondWithStatusCode(_0x211eef,_0x1e8724){_0x1e8724=_0x1e8724||0xcc;return function(_0x1ea1e0){if(_0x1ea1e0){return _0x211eef[_0x7823('0x19')](_0x1e8724);}return _0x211eef[_0x7823('0x1a')](_0x1e8724)[_0x7823('0x1b')]();};}function respondWithResult(_0x5f5091,_0x2e769d){_0x2e769d=_0x2e769d||0xc8;return function(_0x42c7c3){if(_0x42c7c3){return _0x5f5091[_0x7823('0x1a')](_0x2e769d)[_0x7823('0x1c')](_0x42c7c3);}};}function respondWithFilteredResult(_0x1d4794,_0x5e9ecc){return function(_0x5e0082){if(_0x5e0082){var _0x37f5da=typeof _0x5e9ecc['offset']===_0x7823('0x1d')&&typeof _0x5e9ecc[_0x7823('0x1e')]===_0x7823('0x1d');var _0x1a1a64=_0x5e0082[_0x7823('0x1f')];var _0x543ba9=_0x37f5da?0x0:_0x5e9ecc['offset'];var _0xa852d2=_0x37f5da?_0x5e0082[_0x7823('0x1f')]:_0x5e9ecc[_0x7823('0x20')]+_0x5e9ecc[_0x7823('0x1e')];var _0xc91b19;if(_0xa852d2>=_0x1a1a64){_0xa852d2=_0x1a1a64;_0xc91b19=0xc8;}else{_0xc91b19=0xce;}_0x1d4794['status'](_0xc91b19);return _0x1d4794[_0x7823('0x21')](_0x7823('0x22'),_0x543ba9+'-'+_0xa852d2+'/'+_0x1a1a64)[_0x7823('0x1c')](_0x5e0082);}return null;};}function patchUpdates(_0x180ed0){return function(_0x350931){try{jsonpatch[_0x7823('0x23')](_0x350931,_0x180ed0,!![]);}catch(_0x2c7c8c){return BPromise[_0x7823('0x24')](_0x2c7c8c);}return _0x350931[_0x7823('0x25')]();};}function saveUpdates(_0x44499a,_0x454907){return function(_0x203a17){if(_0x203a17){return _0x203a17[_0x7823('0x26')](_0x44499a)[_0x7823('0x27')](function(_0x449dfb){return _0x449dfb;});}return null;};}function removeEntity(_0x14b9a6,_0x29a3e0){return function(_0x1f185a){if(_0x1f185a){return _0x1f185a[_0x7823('0x28')]()[_0x7823('0x27')](function(){var _0x454a5b=_0x1f185a[_0x7823('0x29')]({'plain':!![]});var _0x509d1f=_0x7823('0x2a');return db['UserProfileResource'][_0x7823('0x28')]({'where':{'type':_0x509d1f,'resourceId':_0x454a5b['id']}})[_0x7823('0x27')](function(){return _0x1f185a;});})[_0x7823('0x27')](function(){_0x14b9a6['status'](0xcc)[_0x7823('0x1b')]();});}};}function handleEntityNotFound(_0x36595e,_0x4f638c){return function(_0x5a64b0){if(!_0x5a64b0){_0x36595e[_0x7823('0x19')](0x194);}return _0x5a64b0;};}function handleError(_0x566885,_0x4fedd9){_0x4fedd9=_0x4fedd9||0x1f4;return function(_0x123f72){logger['error'](_0x123f72[_0x7823('0x2b')]);if(_0x123f72[_0x7823('0x2c')]){delete _0x123f72[_0x7823('0x2c')];}_0x566885[_0x7823('0x1a')](_0x4fedd9)['send'](_0x123f72);};}exports['index']=function(_0x212e1f,_0x4f76dc){var _0x559ff9={},_0x536785={},_0x3c431b={'count':0x0,'rows':[]};var _0x32569b=_[_0x7823('0x2d')](db[_0x7823('0x2e')][_0x7823('0x2f')],function(_0x504c8b){return{'name':_0x504c8b[_0x7823('0x30')],'type':_0x504c8b[_0x7823('0x31')][_0x7823('0x32')]};});_0x536785[_0x7823('0x33')]=_[_0x7823('0x2d')](_0x32569b,_0x7823('0x2c'));_0x536785[_0x7823('0x34')]=_[_0x7823('0x35')](_0x212e1f[_0x7823('0x34')]);_0x536785[_0x7823('0x36')]=_['intersection'](_0x536785[_0x7823('0x33')],_0x536785['query']);_0x559ff9['attributes']=_[_0x7823('0x37')](_0x536785[_0x7823('0x33')],qs[_0x7823('0x38')](_0x212e1f[_0x7823('0x34')][_0x7823('0x38')]));_0x559ff9[_0x7823('0x39')]=_0x559ff9['attributes'][_0x7823('0x3a')]?_0x559ff9[_0x7823('0x39')]:_0x536785['model'];if(!_0x212e1f[_0x7823('0x34')][_0x7823('0x3b')](_0x7823('0x3c'))){_0x559ff9[_0x7823('0x1e')]=qs[_0x7823('0x1e')](_0x212e1f[_0x7823('0x34')][_0x7823('0x1e')]);_0x559ff9[_0x7823('0x20')]=qs[_0x7823('0x20')](_0x212e1f[_0x7823('0x34')]['offset']);}_0x559ff9['order']=qs[_0x7823('0x3d')](_0x212e1f[_0x7823('0x34')][_0x7823('0x3d')]);_0x559ff9[_0x7823('0x3e')]=qs['filters'](_[_0x7823('0x3f')](_0x212e1f[_0x7823('0x34')],_0x536785[_0x7823('0x36')]),_0x32569b);if(_0x212e1f['query'][_0x7823('0x40')]){_0x559ff9['where']=_[_0x7823('0x41')](_0x559ff9[_0x7823('0x3e')],{'$or':_[_0x7823('0x2d')](_0x32569b,function(_0x1b1130){if(_0x1b1130[_0x7823('0x31')]!=='VIRTUAL'){var _0x50d54d={};_0x50d54d[_0x1b1130[_0x7823('0x2c')]]={'$like':'%'+_0x212e1f[_0x7823('0x34')][_0x7823('0x40')]+'%'};return _0x50d54d;}})});}_0x559ff9=_['merge']({},_0x559ff9,_0x212e1f[_0x7823('0x42')]);var _0x5454c6={'where':_0x559ff9[_0x7823('0x3e')]};return db[_0x7823('0x2e')][_0x7823('0x1f')](_0x5454c6)[_0x7823('0x27')](function(_0x1523cb){_0x3c431b[_0x7823('0x1f')]=_0x1523cb;if(_0x212e1f[_0x7823('0x34')][_0x7823('0x43')]){_0x559ff9[_0x7823('0x44')]=[{'all':!![]}];}return db[_0x7823('0x2e')]['findAll'](_0x559ff9);})[_0x7823('0x27')](function(_0x259801){_0x3c431b[_0x7823('0x45')]=_0x259801;return _0x3c431b;})[_0x7823('0x27')](respondWithFilteredResult(_0x4f76dc,_0x559ff9))[_0x7823('0x46')](handleError(_0x4f76dc,null));};exports['show']=function(_0x23a506,_0x41726c){var _0x164972={'raw':![],'where':{'id':_0x23a506['params']['id']}},_0x5553aa={};_0x5553aa[_0x7823('0x33')]=_[_0x7823('0x35')](db[_0x7823('0x2e')][_0x7823('0x2f')]);_0x5553aa[_0x7823('0x34')]=_[_0x7823('0x35')](_0x23a506[_0x7823('0x34')]);_0x5553aa[_0x7823('0x36')]=_[_0x7823('0x37')](_0x5553aa[_0x7823('0x33')],_0x5553aa[_0x7823('0x34')]);_0x164972['attributes']=_['intersection'](_0x5553aa[_0x7823('0x33')],qs['fields'](_0x23a506[_0x7823('0x34')][_0x7823('0x38')]));_0x164972[_0x7823('0x39')]=_0x164972[_0x7823('0x39')]['length']?_0x164972['attributes']:_0x5553aa['model'];if(_0x23a506[_0x7823('0x34')][_0x7823('0x43')]){_0x164972[_0x7823('0x44')]=[{'all':!![]}];}_0x164972=_[_0x7823('0x41')]({},_0x164972,_0x23a506[_0x7823('0x42')]);return db['JscriptyProject'][_0x7823('0x47')](_0x164972)[_0x7823('0x27')](handleEntityNotFound(_0x41726c,null))['then'](respondWithResult(_0x41726c,null))[_0x7823('0x46')](handleError(_0x41726c,null));};exports[_0x7823('0x48')]=function(_0x2feb6a,_0x4b15b7){return db[_0x7823('0x2e')][_0x7823('0x48')](_0x2feb6a[_0x7823('0x49')],{})[_0x7823('0x27')](function(_0x4c53d7){var _0x5a492c=_0x2feb6a[_0x7823('0x4a')]['get']({'plain':!![]});if(!_0x5a492c)throw new Error(_0x7823('0x4b'));if(_0x5a492c['role']==='user'){var _0x59bb58=_0x4c53d7[_0x7823('0x29')]({'plain':!![]});var _0x3c4bc4=_0x7823('0x2a');return db[_0x7823('0x4c')][_0x7823('0x47')]({'where':{'name':_0x3c4bc4,'userProfileId':_0x5a492c['userProfileId']},'raw':!![]})['then'](function(_0xfb5a0e){if(_0xfb5a0e&&_0xfb5a0e['autoAssociation']===0x0){return db['UserProfileResource'][_0x7823('0x48')]({'name':_0x59bb58[_0x7823('0x2c')],'resourceId':_0x59bb58['id'],'type':_0xfb5a0e[_0x7823('0x2c')],'sectionId':_0xfb5a0e['id']},{})[_0x7823('0x27')](function(){return _0x4c53d7;});}else{return _0x4c53d7;}})['catch'](function(_0x1119fb){logger['error'](_0x7823('0x4d'),_0x1119fb);throw _0x1119fb;});}return _0x4c53d7;})[_0x7823('0x27')](respondWithResult(_0x4b15b7,0xc9))[_0x7823('0x46')](handleError(_0x4b15b7,null));};exports[_0x7823('0x4e')]=function(_0x570c32,_0x3bfcf7){var _0x4d5537={'where':{'id':_0x570c32[_0x7823('0x4f')]['id']}},_0x5811b5={};_0x5811b5['model']=_[_0x7823('0x35')](db[_0x7823('0x2e')][_0x7823('0x2f')]);_0x4d5537[_0x7823('0x39')]=_[_0x7823('0x37')](_0x5811b5[_0x7823('0x33')],qs[_0x7823('0x38')](_0x570c32[_0x7823('0x34')][_0x7823('0x38')]));_0x4d5537[_0x7823('0x39')]=_0x4d5537[_0x7823('0x39')][_0x7823('0x3a')]?_0x4d5537['attributes']:_0x5811b5[_0x7823('0x33')];if(_0x570c32[_0x7823('0x34')][_0x7823('0x43')]){_0x4d5537[_0x7823('0x44')]=[{'all':!![]}];}_0x4d5537=_[_0x7823('0x41')]({},_0x4d5537,_0x570c32[_0x7823('0x42')]);return db[_0x7823('0x2e')]['find'](_0x4d5537)[_0x7823('0x27')](handleEntityNotFound(_0x3bfcf7,null))[_0x7823('0x27')](function(_0x2b5c28){if(_0x2b5c28){var _0x556a1f=_0x2b5c28['get']({'plain':!![]});_0x556a1f=qs[_0x7823('0x50')](_0x556a1f,['id',_0x7823('0x51'),'updatedAt']);_0x570c32[_0x7823('0x49')]=_[_0x7823('0x50')](_0x570c32['body'],['id',_0x7823('0x51'),_0x7823('0x52')]);return db[_0x7823('0x2e')]['create'](_[_0x7823('0x41')](_0x556a1f,_0x570c32[_0x7823('0x49')]),{'include':_0x570c32['query']['includeAll']?[{'all':!![]}]:undefined})[_0x7823('0x27')](function(_0x2f521d){var _0x12aaf5=_0x570c32[_0x7823('0x4a')]['get']({'plain':!![]});if(!_0x12aaf5)throw new Error(_0x7823('0x4b'));if(_0x12aaf5[_0x7823('0x53')]===_0x7823('0x4a')){var _0x2c9e39=_0x2f521d[_0x7823('0x29')]({'plain':!![]});var _0x27543f=_0x7823('0x2a');return db[_0x7823('0x4c')]['find']({'where':{'name':_0x27543f,'userProfileId':_0x12aaf5[_0x7823('0x54')]},'raw':!![]})['then'](function(_0x27e32c){if(_0x27e32c&&_0x27e32c[_0x7823('0x55')]===0x0){return db[_0x7823('0x56')][_0x7823('0x48')]({'name':_0x2c9e39[_0x7823('0x2c')],'resourceId':_0x2c9e39['id'],'type':_0x27e32c[_0x7823('0x2c')],'sectionId':_0x27e32c['id']},{})[_0x7823('0x27')](function(){return _0x2f521d;});}else{return _0x2f521d;}})[_0x7823('0x46')](function(_0x59cad0){logger['error'](_0x7823('0x4d'),_0x59cad0);throw _0x59cad0;});}return _0x2f521d;});}})[_0x7823('0x27')](respondWithResult(_0x3bfcf7,0xc9))['catch'](handleError(_0x3bfcf7,null));};exports[_0x7823('0x26')]=function(_0x4b85e1,_0x3fc4e8){if(_0x4b85e1['body']['id']){delete _0x4b85e1[_0x7823('0x49')]['id'];}return db['JscriptyProject'][_0x7823('0x47')]({'where':{'id':_0x4b85e1[_0x7823('0x4f')]['id']}})[_0x7823('0x27')](handleEntityNotFound(_0x3fc4e8,null))['then'](saveUpdates(_0x4b85e1[_0x7823('0x49')],null))[_0x7823('0x27')](respondWithResult(_0x3fc4e8,null))[_0x7823('0x46')](handleError(_0x3fc4e8,null));};exports['destroy']=function(_0x3d1f94,_0x4d2873){return db[_0x7823('0x2e')][_0x7823('0x47')]({'where':{'id':_0x3d1f94[_0x7823('0x4f')]['id']}})[_0x7823('0x27')](handleEntityNotFound(_0x4d2873,null))[_0x7823('0x27')](removeEntity(_0x4d2873,null))[_0x7823('0x46')](handleError(_0x4d2873,null));};exports['getSessions']=function(_0x8a4d61,_0x4681f1,_0x3548ff){var _0x571ba4={'raw':!![],'where':{}};var _0x7d1207={};var _0xfe6db5={'count':0x0,'rows':[]};return db[_0x7823('0x2e')]['findOne']({'where':{'id':_0x8a4d61[_0x7823('0x4f')]['id']}})[_0x7823('0x27')](handleEntityNotFound(_0x4681f1,null))['then'](function(_0x5bf8d6){if(_0x5bf8d6){_0x7d1207['model']=_['keys'](db[_0x7823('0x57')][_0x7823('0x2f')]);_0x7d1207[_0x7823('0x34')]=_[_0x7823('0x35')](_0x8a4d61[_0x7823('0x34')]);_0x7d1207[_0x7823('0x36')]=_[_0x7823('0x37')](_0x7d1207[_0x7823('0x33')],_0x7d1207[_0x7823('0x34')]);_0x571ba4[_0x7823('0x39')]=_[_0x7823('0x37')](_0x7d1207[_0x7823('0x33')],qs[_0x7823('0x38')](_0x8a4d61[_0x7823('0x34')][_0x7823('0x38')]));_0x571ba4[_0x7823('0x39')]=_0x571ba4[_0x7823('0x39')][_0x7823('0x3a')]?_0x571ba4[_0x7823('0x39')]:_0x7d1207['model'];if(!_0x8a4d61[_0x7823('0x34')][_0x7823('0x3b')](_0x7823('0x3c'))){_0x571ba4[_0x7823('0x1e')]=qs[_0x7823('0x1e')](_0x8a4d61['query']['limit']);_0x571ba4['offset']=qs[_0x7823('0x20')](_0x8a4d61['query'][_0x7823('0x20')]);}_0x571ba4[_0x7823('0x58')]=qs['sort'](_0x8a4d61['query'][_0x7823('0x3d')]);_0x571ba4['where']=qs[_0x7823('0x36')](_[_0x7823('0x3f')](_0x8a4d61[_0x7823('0x34')],_0x7d1207[_0x7823('0x36')]));_0x571ba4['where'][_0x7823('0x59')]=_0x5bf8d6['id'];if(_0x8a4d61[_0x7823('0x34')][_0x7823('0x40')]){_0x571ba4[_0x7823('0x3e')]=_[_0x7823('0x41')](_0x571ba4[_0x7823('0x3e')],{'$or':_['map'](_0x571ba4[_0x7823('0x39')],function(_0x5a95e7){var _0x28ac06={};_0x28ac06[_0x5a95e7]={'$like':'%'+_0x8a4d61['query']['filter']+'%'};return _0x28ac06;})});}_0x571ba4=_[_0x7823('0x41')]({},_0x571ba4,_0x8a4d61[_0x7823('0x42')]);return db['JscriptySessionReport']['count']({'where':_0x571ba4[_0x7823('0x3e')]})[_0x7823('0x27')](function(_0x376353){_0xfe6db5['count']=_0x376353;if(_0x8a4d61[_0x7823('0x34')][_0x7823('0x43')]){_0x571ba4[_0x7823('0x44')]=[{'all':!![]}];}return db[_0x7823('0x57')][_0x7823('0x5a')](_0x571ba4);})[_0x7823('0x27')](function(_0x1cfee6){_0xfe6db5[_0x7823('0x45')]=_0x1cfee6;return _0xfe6db5;});}})[_0x7823('0x27')](respondWithFilteredResult(_0x4681f1,_0x571ba4))[_0x7823('0x46')](handleError(_0x4681f1,null));};exports[_0x7823('0x5b')]=function(_0x3a5507,_0x39565e,_0x364581){var _0x522a6f={'raw':!![],'where':{}};var _0x202609={};var _0x289a3e={'count':0x0,'rows':[]};return db[_0x7823('0x2e')]['findOne']({'where':{'id':_0x3a5507[_0x7823('0x4f')]['id']}})[_0x7823('0x27')](handleEntityNotFound(_0x39565e,null))['then'](function(_0x1deb13){if(_0x1deb13){_0x202609['model']=_[_0x7823('0x35')](db[_0x7823('0x5c')][_0x7823('0x2f')]);_0x202609[_0x7823('0x34')]=_[_0x7823('0x35')](_0x3a5507[_0x7823('0x34')]);_0x202609[_0x7823('0x36')]=_[_0x7823('0x37')](_0x202609[_0x7823('0x33')],_0x202609['query']);_0x522a6f[_0x7823('0x39')]=_[_0x7823('0x37')](_0x202609['model'],qs[_0x7823('0x38')](_0x3a5507[_0x7823('0x34')][_0x7823('0x38')]));_0x522a6f[_0x7823('0x39')]=_0x522a6f[_0x7823('0x39')][_0x7823('0x3a')]?_0x522a6f['attributes']:_0x202609[_0x7823('0x33')];if(!_0x3a5507['query'][_0x7823('0x3b')](_0x7823('0x3c'))){_0x522a6f['limit']=qs[_0x7823('0x1e')](_0x3a5507[_0x7823('0x34')][_0x7823('0x1e')]);_0x522a6f[_0x7823('0x20')]=qs[_0x7823('0x20')](_0x3a5507[_0x7823('0x34')][_0x7823('0x20')]);}_0x522a6f[_0x7823('0x58')]=qs[_0x7823('0x3d')](_0x3a5507[_0x7823('0x34')][_0x7823('0x3d')]);_0x522a6f[_0x7823('0x3e')]=qs[_0x7823('0x36')](_[_0x7823('0x3f')](_0x3a5507['query'],_0x202609[_0x7823('0x36')]));_0x522a6f['where'][_0x7823('0x59')]=_0x1deb13['id'];if(_0x3a5507['query'][_0x7823('0x40')]){_0x522a6f[_0x7823('0x3e')]=_[_0x7823('0x41')](_0x522a6f[_0x7823('0x3e')],{'$or':_['map'](_0x522a6f[_0x7823('0x39')],function(_0x12d0d4){var _0xa9a200={};_0xa9a200[_0x12d0d4]={'$like':'%'+_0x3a5507[_0x7823('0x34')]['filter']+'%'};return _0xa9a200;})});}_0x522a6f=_[_0x7823('0x41')]({},_0x522a6f,_0x3a5507[_0x7823('0x42')]);return db[_0x7823('0x5c')][_0x7823('0x1f')]({'where':_0x522a6f[_0x7823('0x3e')]})[_0x7823('0x27')](function(_0xa7211b){_0x289a3e['count']=_0xa7211b;if(_0x3a5507['query'][_0x7823('0x43')]){_0x522a6f[_0x7823('0x44')]=[{'all':!![]}];}return db[_0x7823('0x5c')][_0x7823('0x5a')](_0x522a6f);})[_0x7823('0x27')](function(_0x93e965){_0x289a3e['rows']=_0x93e965;return _0x289a3e;});}})[_0x7823('0x27')](respondWithFilteredResult(_0x39565e,_0x522a6f))[_0x7823('0x46')](handleError(_0x39565e,null));};function char(_0x2597b9){return'number'===typeof _0x2597b9?String['fromCharCode'][_0x7823('0x23')](null,arguments):_0x2597b9;}function needsEncapsulation(_0x4e7ae0){return!!_0x4e7ae0&&(_0x4e7ae0[_0x7823('0x5d')]()[_0x7823('0x5e')](char(0xd))>=0x0||_0x4e7ae0[_0x7823('0x5d')]()[_0x7823('0x5e')](char(0xa))>=0x0||_0x4e7ae0[_0x7823('0x5d')]()[_0x7823('0x5e')](char(0x2c))>=0x0||_0x4e7ae0[_0x7823('0x5d')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x380b2b){var _0x219967=char(0x22),_0x51e13e='\x5c'+char(0x22),_0x1761c4=_0x380b2b[_0x7823('0x5d')]()[_0x7823('0x5f')](new RegExp(_0x219967,'g'),_0x51e13e);return _0x219967+_0x1761c4+_0x219967;}exports[_0x7823('0x60')]=function(_0x235b72,_0x9af3c8,_0x404b2a){var _0x47d963,_0x3c389f;var _0x5add97={'where':{'ProjectId':_0x235b72['params']['id']}};if(_0x235b72[_0x7823('0x34')][_0x7823('0x61')]){_0x5add97[_0x7823('0x3e')][_0x7823('0x62')]=JSON[_0x7823('0x63')](_0x235b72[_0x7823('0x34')]['startTime']);}return db[_0x7823('0x57')][_0x7823('0x5a')](_0x5add97)[_0x7823('0x27')](handleEntityNotFound(_0x9af3c8,null))[_0x7823('0x27')](function(_0x2ea88b){if(_0x2ea88b){_0x47d963=_0x2ea88b;return db[_0x7823('0x64')][_0x7823('0x5a')]({'where':{'SessionId':{'$in':_[_0x7823('0x2d')](_0x47d963,'id')},'ProjectId':_0x235b72[_0x7823('0x4f')]['id']},'order':_0x7823('0x65')});}})['then'](handleEntityNotFound(_0x9af3c8,null))[_0x7823('0x27')](function(_0x22537e){if(_0x22537e){_0x3c389f=_0x22537e;var _0x91af76={};for(var _0x1f0417=0x0,_0xff42d3=_0x3c389f[_0x7823('0x3a')];_0x1f0417<_0xff42d3;_0x1f0417++){if(!_0x91af76[_0x7823('0x3b')](_0x3c389f[_0x1f0417]['questionId'])){_0x91af76[_0x3c389f[_0x1f0417][_0x7823('0x66')]]=needsEncapsulation(_0x3c389f[_0x1f0417][_0x7823('0x67')])?encapsulate(_0x3c389f[_0x1f0417]['question']):_0x3c389f[_0x1f0417]['question'];}}var _0x45bf08=[],_0x25724d={};for(var _0x54fdb9=0x0,_0x4b04c3=_0x47d963['length'];_0x54fdb9<_0x4b04c3;_0x54fdb9++){_0x25724d={'ProjectId':_0x235b72[_0x7823('0x4f')]['id'],'SessionId':_0x47d963[_0x54fdb9]['id'],'StartTime':moment(_0x47d963[_0x54fdb9][_0x7823('0x62')])[_0x7823('0x68')](_0x7823('0x69'))};for(var _0x1c2064=0x0,_0x5304f5=_0x3c389f['length'];_0x1c2064<_0x5304f5;_0x1c2064++){if(_0x3c389f[_0x1c2064][_0x7823('0x6a')]==_0x47d963[_0x54fdb9]['id']&&_0x91af76['hasOwnProperty'](_0x3c389f[_0x1c2064][_0x7823('0x66')])){_0x25724d[_0x91af76[_0x3c389f[_0x1c2064][_0x7823('0x66')]]]=_0x3c389f[_0x1c2064][_0x7823('0x6b')];}}for(var _0x3d48df in _0x91af76){if(!_0x25724d[_0x7823('0x3b')](_0x91af76[_0x3d48df])){_0x25724d[_0x91af76[_0x3d48df]]=null;}}_0x45bf08['push'](_0x25724d);}return _0x45bf08;}})[_0x7823('0x27')](function(_0x39cea5){if(!_[_0x7823('0x6c')](_0x39cea5)){var _0x3b44c4=toCsv(_0x39cea5);var _0x534d7b=Date[_0x7823('0x6d')]();fs[_0x7823('0x6e')](util[_0x7823('0x68')](_0x7823('0x6f'),_0x235b72[_0x7823('0x4f')]['id'],_0x534d7b),_0x3b44c4);_0x9af3c8['setHeader'](_0x7823('0x70'),_0x7823('0x71')+util[_0x7823('0x68')]('Jscripty_Project_%d_Summary_%s.csv',_0x235b72[_0x7823('0x4f')]['id'],_0x534d7b));_0x9af3c8[_0x7823('0x72')]('Content-type',_0x7823('0x73'));return _0x9af3c8[_0x7823('0x74')](util['format'](_0x7823('0x6f'),_0x235b72[_0x7823('0x4f')]['id'],_0x534d7b));}else{return _0x9af3c8['sendStatus'](0xcc);}})[_0x7823('0x46')](handleError(_0x9af3c8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4edf1c8..b818473 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 _0xd51f=['lodash','util','api','moment','request-promise','path','../../config/environment','./jscriptyProject.attributes','JscriptyProject','jscripty_projects'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xd51f,0xf0));var _0xfd51=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd51f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var logger=require('../../config/logger')(_0xfd51('0x2'));var moment=require(_0xfd51('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd51('0x4'));var fs=require('fs');var path=require(_0xfd51('0x5'));var rimraf=require('rimraf');var config=require(_0xfd51('0x6'));var attributes=require(_0xfd51('0x7'));module['exports']=function(_0x3e3517,_0x3a2cd4){return _0x3e3517['define'](_0xfd51('0x8'),attributes,{'tableName':_0xfd51('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab86=['util','../../config/logger','bluebird','path','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash'];(function(_0x1a7446,_0x4bd8be){var _0x21af95=function(_0x358704){while(--_0x358704){_0x1a7446['push'](_0x1a7446['shift']());}};_0x21af95(++_0x4bd8be);}(_0xab86,0x13e));var _0x6ab8=function(_0x3e9c17,_0x2a84a9){_0x3e9c17=_0x3e9c17-0x0;var _0x24c41d=_0xab86[_0x3e9c17];return _0x24c41d;};'use strict';var _=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var logger=require(_0x6ab8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6ab8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ab8('0x4'));var rimraf=require('rimraf');var config=require(_0x6ab8('0x5'));var attributes=require(_0x6ab8('0x6'));module[_0x6ab8('0x7')]=function(_0x154d17,_0x6f41f){return _0x154d17[_0x6ab8('0x8')](_0x6ab8('0x9'),attributes,{'tableName':_0x6ab8('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 8df94e5..29506f9 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 _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4f3611,_0x47a970){var _0x3b85d9=function(_0x3a855f){while(--_0x3a855f){_0x4f3611['push'](_0x4f3611['shift']());}};_0x3b85d9(++_0x47a970);}(_0x9bde,0xe1));var _0xe9bd=function(_0x24528c,_0x2df153){_0x24528c=_0x24528c-0x0;var _0x485be4=_0x9bde[_0x24528c];return _0x485be4;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x5d72da,_0xb7ce32){var _0x43ebe7=function(_0x503755){while(--_0x503755){_0x5d72da['push'](_0x5d72da['shift']());}};_0x43ebe7(++_0xb7ce32);}(_0xda3f,0xec));var _0xfda3=function(_0x1c4092,_0x34d67b){_0x1c4092=_0x1c4092-0x0;var _0x1ea3f=_0xda3f[_0x1c4092];return _0x1ea3f;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 63c17ee..e0fd077 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 _0x7027=['update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0x7027,0x169));var _0x7702=function(_0x5152c0,_0x8e7b0b){_0x5152c0=_0x5152c0-0x0;var _0x364a0e=_0x7027[_0x5152c0];return _0x364a0e;};'use strict';var multer=require('multer');var util=require(_0x7702('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7702('0x1')]();var fs_extra=require(_0x7702('0x2'));var auth=require(_0x7702('0x3'));var interaction=require(_0x7702('0x4'));var config=require(_0x7702('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0x7702('0x6')]('/',auth[_0x7702('0x7')](),controller['index']);router[_0x7702('0x6')]('/describe',auth[_0x7702('0x7')](),controller[_0x7702('0x8')]);router[_0x7702('0x6')](_0x7702('0x9'),auth[_0x7702('0x7')](),controller[_0x7702('0xa')]);router[_0x7702('0xb')]('/',auth['isAuthenticated'](),controller[_0x7702('0xc')]);router['put'](_0x7702('0x9'),auth['isAuthenticated'](),controller[_0x7702('0xd')]);router[_0x7702('0xe')](_0x7702('0x9'),auth[_0x7702('0x7')](),controller[_0x7702('0xf')]);module[_0x7702('0x10')]=router; \ No newline at end of file +var _0x2a49=['show','post','create','update','/:id','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a49,0x17c));var _0x92a4=function(_0x3f6928,_0x478491){_0x3f6928=_0x3f6928-0x0;var _0x1b6db8=_0x2a49[_0x3f6928];return _0x1b6db8;};'use strict';var multer=require(_0x92a4('0x0'));var util=require(_0x92a4('0x1'));var path=require('path');var timeout=require(_0x92a4('0x2'));var express=require('express');var router=express[_0x92a4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x92a4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x92a4('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0x92a4('0x6')]('/',auth[_0x92a4('0x7')](),controller[_0x92a4('0x8')]);router[_0x92a4('0x6')](_0x92a4('0x9'),auth['isAuthenticated'](),controller[_0x92a4('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x92a4('0xb')]);router[_0x92a4('0xc')]('/',auth[_0x92a4('0x7')](),controller[_0x92a4('0xd')]);router['put']('/:id',auth[_0x92a4('0x7')](),controller[_0x92a4('0xe')]);router['delete'](_0x92a4('0xf'),auth['isAuthenticated'](),controller[_0x92a4('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 7d1746c..97ea4f9 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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7a54,0x106));var _0x47a5=function(_0x2dda32,_0x4ebc4b){_0x2dda32=_0x2dda32-0x0;var _0x33fec7=_0x7a54[_0x2dda32];return _0x33fec7;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x1831a6,_0x90b4ec){_0x1831a6=_0x1831a6-0x0;var _0x5a1345=_0x7a54[_0x1831a6];return _0x5a1345;};'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 1a91733..6386fed 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 _0x29fc=['undefined','count','offset','set','apply','reject','update','then','destroy','sendStatus','error','name','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','catch','params','JscriptyQuestionReport','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x498d31,_0x55f860){var _0x44a554=function(_0xb94d27){while(--_0xb94d27){_0x498d31['push'](_0x498d31['shift']());}};_0x44a554(++_0x55f860);}(_0x29fc,0xba));var _0xc29f=function(_0x12dbe5,_0x1631b8){_0x12dbe5=_0x12dbe5-0x0;var _0x126778=_0x29fc[_0x12dbe5];return _0x126778;};'use strict';var emlformat=require(_0xc29f('0x0'));var rimraf=require(_0xc29f('0x1'));var zipdir=require(_0xc29f('0x2'));var jsonpatch=require(_0xc29f('0x3'));var rp=require(_0xc29f('0x4'));var moment=require(_0xc29f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc29f('0x6'));var util=require(_0xc29f('0x7'));var path=require(_0xc29f('0x8'));var sox=require('sox');var csv=require(_0xc29f('0x9'));var ejs=require(_0xc29f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc29f('0xb'));var squel=require(_0xc29f('0xc'));var crypto=require(_0xc29f('0xd'));var jsforce=require(_0xc29f('0xe'));var deskjs=require(_0xc29f('0xf'));var toCsv=require(_0xc29f('0x9'));var querystring=require(_0xc29f('0x10'));var Papa=require(_0xc29f('0x11'));var Redis=require('ioredis');var authService=require(_0xc29f('0x12'));var qs=require(_0xc29f('0x13'));var as=require(_0xc29f('0x14'));var hardwareService=require(_0xc29f('0x15'));var logger=require(_0xc29f('0x16'))(_0xc29f('0x17'));var utils=require('../../config/utils');var config=require(_0xc29f('0x18'));var licenseUtil=require(_0xc29f('0x19'));var db=require(_0xc29f('0x1a'))['db'];function respondWithStatusCode(_0x32212d,_0x18a0f3){_0x18a0f3=_0x18a0f3||0xcc;return function(_0x1b8223){if(_0x1b8223){return _0x32212d['sendStatus'](_0x18a0f3);}return _0x32212d[_0xc29f('0x1b')](_0x18a0f3)[_0xc29f('0x1c')]();};}function respondWithResult(_0x546e41,_0x3584cf){_0x3584cf=_0x3584cf||0xc8;return function(_0x973118){if(_0x973118){return _0x546e41[_0xc29f('0x1b')](_0x3584cf)[_0xc29f('0x1d')](_0x973118);}};}function respondWithFilteredResult(_0x297edc,_0x27aa3e){return function(_0x255eb3){if(_0x255eb3){var _0x3d4857=typeof _0x27aa3e['offset']==='undefined'&&typeof _0x27aa3e['limit']===_0xc29f('0x1e');var _0x58a695=_0x255eb3[_0xc29f('0x1f')];var _0xa5410d=_0x3d4857?0x0:_0x27aa3e[_0xc29f('0x20')];var _0x11f0c5=_0x3d4857?_0x255eb3[_0xc29f('0x1f')]:_0x27aa3e[_0xc29f('0x20')]+_0x27aa3e['limit'];var _0x4ead24;if(_0x11f0c5>=_0x58a695){_0x11f0c5=_0x58a695;_0x4ead24=0xc8;}else{_0x4ead24=0xce;}_0x297edc[_0xc29f('0x1b')](_0x4ead24);return _0x297edc[_0xc29f('0x21')]('Content-Range',_0xa5410d+'-'+_0x11f0c5+'/'+_0x58a695)['json'](_0x255eb3);}return null;};}function patchUpdates(_0x4dc32e){return function(_0x2dc42e){try{jsonpatch[_0xc29f('0x22')](_0x2dc42e,_0x4dc32e,!![]);}catch(_0x43e031){return BPromise[_0xc29f('0x23')](_0x43e031);}return _0x2dc42e['save']();};}function saveUpdates(_0x142290,_0x4849e7){return function(_0x568fc0){if(_0x568fc0){return _0x568fc0[_0xc29f('0x24')](_0x142290)[_0xc29f('0x25')](function(_0x41df62){return _0x41df62;});}return null;};}function removeEntity(_0xccdf77,_0x1be644){return function(_0x6fe734){if(_0x6fe734){return _0x6fe734[_0xc29f('0x26')]()[_0xc29f('0x25')](function(){_0xccdf77[_0xc29f('0x1b')](0xcc)[_0xc29f('0x1c')]();});}};}function handleEntityNotFound(_0x58dfb4,_0x4a65e2){return function(_0x1e1b13){if(!_0x1e1b13){_0x58dfb4[_0xc29f('0x27')](0x194);}return _0x1e1b13;};}function handleError(_0x4db697,_0x2d34e2){_0x2d34e2=_0x2d34e2||0x1f4;return function(_0xc04f43){logger[_0xc29f('0x28')](_0xc04f43['stack']);if(_0xc04f43[_0xc29f('0x29')]){delete _0xc04f43[_0xc29f('0x29')];}_0x4db697[_0xc29f('0x1b')](_0x2d34e2)['send'](_0xc04f43);};}exports[_0xc29f('0x2a')]=function(_0x426d33,_0x5e780e){var _0xdc508b={},_0x1622f7={},_0x101325={'count':0x0,'rows':[]};var _0x2aa962=_[_0xc29f('0x2b')](db['JscriptyQuestionReport'][_0xc29f('0x2c')],function(_0x48da54){return{'name':_0x48da54['fieldName'],'type':_0x48da54[_0xc29f('0x2d')][_0xc29f('0x2e')]};});_0x1622f7[_0xc29f('0x2f')]=_['map'](_0x2aa962,_0xc29f('0x29'));_0x1622f7[_0xc29f('0x30')]=_['keys'](_0x426d33[_0xc29f('0x30')]);_0x1622f7[_0xc29f('0x31')]=_[_0xc29f('0x32')](_0x1622f7['model'],_0x1622f7[_0xc29f('0x30')]);_0xdc508b['attributes']=_[_0xc29f('0x32')](_0x1622f7[_0xc29f('0x2f')],qs[_0xc29f('0x33')](_0x426d33[_0xc29f('0x30')]['fields']));_0xdc508b[_0xc29f('0x34')]=_0xdc508b['attributes'][_0xc29f('0x35')]?_0xdc508b[_0xc29f('0x34')]:_0x1622f7['model'];if(!_0x426d33[_0xc29f('0x30')]['hasOwnProperty']('nolimit')){_0xdc508b['limit']=qs[_0xc29f('0x36')](_0x426d33[_0xc29f('0x30')][_0xc29f('0x36')]);_0xdc508b[_0xc29f('0x20')]=qs[_0xc29f('0x20')](_0x426d33[_0xc29f('0x30')]['offset']);}_0xdc508b[_0xc29f('0x37')]=qs[_0xc29f('0x38')](_0x426d33[_0xc29f('0x30')][_0xc29f('0x38')]);_0xdc508b[_0xc29f('0x39')]=qs[_0xc29f('0x31')](_[_0xc29f('0x3a')](_0x426d33[_0xc29f('0x30')],_0x1622f7[_0xc29f('0x31')]),_0x2aa962);if(_0x426d33['query']['filter']){_0xdc508b[_0xc29f('0x39')]=_[_0xc29f('0x3b')](_0xdc508b[_0xc29f('0x39')],{'$or':_[_0xc29f('0x2b')](_0x2aa962,function(_0x11fce9){if(_0x11fce9[_0xc29f('0x2d')]!==_0xc29f('0x3c')){var _0x2e8011={};_0x2e8011[_0x11fce9[_0xc29f('0x29')]]={'$like':'%'+_0x426d33[_0xc29f('0x30')][_0xc29f('0x3d')]+'%'};return _0x2e8011;}})});}_0xdc508b=_[_0xc29f('0x3b')]({},_0xdc508b,_0x426d33['options']);var _0x249d5b={'where':_0xdc508b[_0xc29f('0x39')]};return db['JscriptyQuestionReport'][_0xc29f('0x1f')](_0x249d5b)['then'](function(_0x5c6340){_0x101325[_0xc29f('0x1f')]=_0x5c6340;if(_0x426d33[_0xc29f('0x30')][_0xc29f('0x3e')]){_0xdc508b['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0xdc508b);})[_0xc29f('0x25')](function(_0x5ed595){_0x101325[_0xc29f('0x3f')]=_0x5ed595;return _0x101325;})[_0xc29f('0x25')](respondWithFilteredResult(_0x5e780e,_0xdc508b))[_0xc29f('0x40')](handleError(_0x5e780e,null));};exports['show']=function(_0x1a5974,_0x152d3f){var _0x4e219e={'raw':!![],'where':{'id':_0x1a5974[_0xc29f('0x41')]['id']}},_0x22f075={};_0x22f075[_0xc29f('0x2f')]=_['keys'](db[_0xc29f('0x42')][_0xc29f('0x2c')]);_0x22f075[_0xc29f('0x30')]=_['keys'](_0x1a5974[_0xc29f('0x30')]);_0x22f075[_0xc29f('0x31')]=_['intersection'](_0x22f075[_0xc29f('0x2f')],_0x22f075[_0xc29f('0x30')]);_0x4e219e[_0xc29f('0x34')]=_[_0xc29f('0x32')](_0x22f075[_0xc29f('0x2f')],qs[_0xc29f('0x33')](_0x1a5974[_0xc29f('0x30')][_0xc29f('0x33')]));_0x4e219e[_0xc29f('0x34')]=_0x4e219e[_0xc29f('0x34')][_0xc29f('0x35')]?_0x4e219e[_0xc29f('0x34')]:_0x22f075[_0xc29f('0x2f')];if(_0x1a5974[_0xc29f('0x30')][_0xc29f('0x3e')]){_0x4e219e['include']=[{'all':!![]}];}_0x4e219e=_[_0xc29f('0x3b')]({},_0x4e219e,_0x1a5974[_0xc29f('0x43')]);return db[_0xc29f('0x42')][_0xc29f('0x44')](_0x4e219e)['then'](handleEntityNotFound(_0x152d3f,null))[_0xc29f('0x25')](respondWithResult(_0x152d3f,null))[_0xc29f('0x40')](handleError(_0x152d3f,null));};exports[_0xc29f('0x45')]=function(_0x52f927,_0xda4ec7){return db[_0xc29f('0x42')]['create'](_0x52f927[_0xc29f('0x46')],{})[_0xc29f('0x25')](respondWithResult(_0xda4ec7,0xc9))[_0xc29f('0x40')](handleError(_0xda4ec7,null));};exports[_0xc29f('0x24')]=function(_0x114b92,_0x1f9ca0){if(_0x114b92[_0xc29f('0x46')]['id']){delete _0x114b92[_0xc29f('0x46')]['id'];}return db[_0xc29f('0x42')][_0xc29f('0x44')]({'where':{'id':_0x114b92[_0xc29f('0x41')]['id']}})[_0xc29f('0x25')](handleEntityNotFound(_0x1f9ca0,null))[_0xc29f('0x25')](saveUpdates(_0x114b92[_0xc29f('0x46')],null))['then'](respondWithResult(_0x1f9ca0,null))[_0xc29f('0x40')](handleError(_0x1f9ca0,null));};exports[_0xc29f('0x26')]=function(_0xa34964,_0x555a1f){return db[_0xc29f('0x42')][_0xc29f('0x44')]({'where':{'id':_0xa34964[_0xc29f('0x41')]['id']}})[_0xc29f('0x25')](handleEntityNotFound(_0x555a1f,null))['then'](removeEntity(_0x555a1f,null))['catch'](handleError(_0x555a1f,null));};exports[_0xc29f('0x47')]=function(_0x3f4bf7,_0x24914d){return db[_0xc29f('0x42')][_0xc29f('0x47')]()[_0xc29f('0x25')](respondWithResult(_0x24914d,null))['catch'](handleError(_0x24914d,null));}; \ No newline at end of file +var _0x6f92=['offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x3920cd,_0x2cd659){var _0x38671b=function(_0x28722f){while(--_0x28722f){_0x3920cd['push'](_0x3920cd['shift']());}};_0x38671b(++_0x2cd659);}(_0x6f92,0x1e4));var _0x26f9=function(_0x5d6c35,_0xca0395){_0x5d6c35=_0x5d6c35-0x0;var _0x180455=_0x6f92[_0x5d6c35];return _0x180455;};'use strict';var emlformat=require(_0x26f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26f9('0x2'));var moment=require(_0x26f9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x26f9('0x4'));var util=require(_0x26f9('0x5'));var path=require(_0x26f9('0x6'));var sox=require(_0x26f9('0x7'));var csv=require(_0x26f9('0x8'));var ejs=require(_0x26f9('0x9'));var fs=require('fs');var fs_extra=require(_0x26f9('0xa'));var _=require(_0x26f9('0xb'));var squel=require(_0x26f9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x26f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x26f9('0xe'));var Papa=require(_0x26f9('0xf'));var Redis=require('ioredis');var authService=require(_0x26f9('0x10'));var qs=require(_0x26f9('0x11'));var as=require(_0x26f9('0x12'));var hardwareService=require(_0x26f9('0x13'));var logger=require(_0x26f9('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x26f9('0x15'));var licenseUtil=require(_0x26f9('0x16'));var db=require(_0x26f9('0x17'))['db'];function respondWithStatusCode(_0x57720d,_0x315f48){_0x315f48=_0x315f48||0xcc;return function(_0x129376){if(_0x129376){return _0x57720d[_0x26f9('0x18')](_0x315f48);}return _0x57720d['status'](_0x315f48)[_0x26f9('0x19')]();};}function respondWithResult(_0x1bc694,_0xbcb6){_0xbcb6=_0xbcb6||0xc8;return function(_0x3c5c3c){if(_0x3c5c3c){return _0x1bc694[_0x26f9('0x1a')](_0xbcb6)['json'](_0x3c5c3c);}};}function respondWithFilteredResult(_0xca418c,_0x3206cf){return function(_0x1f83d7){if(_0x1f83d7){var _0x263ef0=typeof _0x3206cf[_0x26f9('0x1b')]==='undefined'&&typeof _0x3206cf[_0x26f9('0x1c')]===_0x26f9('0x1d');var _0x1d84d8=_0x1f83d7[_0x26f9('0x1e')];var _0x2770a6=_0x263ef0?0x0:_0x3206cf['offset'];var _0x246b2e=_0x263ef0?_0x1f83d7[_0x26f9('0x1e')]:_0x3206cf[_0x26f9('0x1b')]+_0x3206cf[_0x26f9('0x1c')];var _0x304e6f;if(_0x246b2e>=_0x1d84d8){_0x246b2e=_0x1d84d8;_0x304e6f=0xc8;}else{_0x304e6f=0xce;}_0xca418c[_0x26f9('0x1a')](_0x304e6f);return _0xca418c[_0x26f9('0x1f')]('Content-Range',_0x2770a6+'-'+_0x246b2e+'/'+_0x1d84d8)[_0x26f9('0x20')](_0x1f83d7);}return null;};}function patchUpdates(_0x27e398){return function(_0x3d1888){try{jsonpatch[_0x26f9('0x21')](_0x3d1888,_0x27e398,!![]);}catch(_0xd61159){return BPromise[_0x26f9('0x22')](_0xd61159);}return _0x3d1888['save']();};}function saveUpdates(_0x34e1e0,_0x7ac365){return function(_0x3043ad){if(_0x3043ad){return _0x3043ad[_0x26f9('0x23')](_0x34e1e0)[_0x26f9('0x24')](function(_0x518568){return _0x518568;});}return null;};}function removeEntity(_0x2fa040,_0x4e20e5){return function(_0x114f2c){if(_0x114f2c){return _0x114f2c[_0x26f9('0x25')]()['then'](function(){_0x2fa040[_0x26f9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d81d6,_0x4fc700){return function(_0x3c4cc7){if(!_0x3c4cc7){_0x3d81d6[_0x26f9('0x18')](0x194);}return _0x3c4cc7;};}function handleError(_0x3f268f,_0x249507){_0x249507=_0x249507||0x1f4;return function(_0x18cf39){logger['error'](_0x18cf39['stack']);if(_0x18cf39['name']){delete _0x18cf39[_0x26f9('0x26')];}_0x3f268f[_0x26f9('0x1a')](_0x249507)[_0x26f9('0x27')](_0x18cf39);};}exports[_0x26f9('0x28')]=function(_0x1c8033,_0x1a6b31){var _0x534f38={},_0x415075={},_0x4244d8={'count':0x0,'rows':[]};var _0x4ac3ba=_[_0x26f9('0x29')](db[_0x26f9('0x2a')][_0x26f9('0x2b')],function(_0x4dbda1){return{'name':_0x4dbda1[_0x26f9('0x2c')],'type':_0x4dbda1[_0x26f9('0x2d')]['key']};});_0x415075[_0x26f9('0x2e')]=_['map'](_0x4ac3ba,_0x26f9('0x26'));_0x415075[_0x26f9('0x2f')]=_[_0x26f9('0x30')](_0x1c8033[_0x26f9('0x2f')]);_0x415075[_0x26f9('0x31')]=_[_0x26f9('0x32')](_0x415075[_0x26f9('0x2e')],_0x415075[_0x26f9('0x2f')]);_0x534f38[_0x26f9('0x33')]=_[_0x26f9('0x32')](_0x415075[_0x26f9('0x2e')],qs[_0x26f9('0x34')](_0x1c8033[_0x26f9('0x2f')][_0x26f9('0x34')]));_0x534f38[_0x26f9('0x33')]=_0x534f38[_0x26f9('0x33')][_0x26f9('0x35')]?_0x534f38[_0x26f9('0x33')]:_0x415075[_0x26f9('0x2e')];if(!_0x1c8033[_0x26f9('0x2f')]['hasOwnProperty'](_0x26f9('0x36'))){_0x534f38[_0x26f9('0x1c')]=qs[_0x26f9('0x1c')](_0x1c8033['query'][_0x26f9('0x1c')]);_0x534f38['offset']=qs[_0x26f9('0x1b')](_0x1c8033[_0x26f9('0x2f')][_0x26f9('0x1b')]);}_0x534f38[_0x26f9('0x37')]=qs['sort'](_0x1c8033[_0x26f9('0x2f')][_0x26f9('0x38')]);_0x534f38['where']=qs[_0x26f9('0x31')](_[_0x26f9('0x39')](_0x1c8033[_0x26f9('0x2f')],_0x415075['filters']),_0x4ac3ba);if(_0x1c8033[_0x26f9('0x2f')][_0x26f9('0x3a')]){_0x534f38[_0x26f9('0x3b')]=_[_0x26f9('0x3c')](_0x534f38['where'],{'$or':_[_0x26f9('0x29')](_0x4ac3ba,function(_0x363e8f){if(_0x363e8f[_0x26f9('0x2d')]!==_0x26f9('0x3d')){var _0x5c453c={};_0x5c453c[_0x363e8f[_0x26f9('0x26')]]={'$like':'%'+_0x1c8033[_0x26f9('0x2f')]['filter']+'%'};return _0x5c453c;}})});}_0x534f38=_[_0x26f9('0x3c')]({},_0x534f38,_0x1c8033[_0x26f9('0x3e')]);var _0x4a2138={'where':_0x534f38[_0x26f9('0x3b')]};return db[_0x26f9('0x2a')][_0x26f9('0x1e')](_0x4a2138)[_0x26f9('0x24')](function(_0x4c3352){_0x4244d8[_0x26f9('0x1e')]=_0x4c3352;if(_0x1c8033[_0x26f9('0x2f')][_0x26f9('0x3f')]){_0x534f38[_0x26f9('0x40')]=[{'all':!![]}];}return db[_0x26f9('0x2a')]['findAll'](_0x534f38);})[_0x26f9('0x24')](function(_0xbec5ec){_0x4244d8[_0x26f9('0x41')]=_0xbec5ec;return _0x4244d8;})[_0x26f9('0x24')](respondWithFilteredResult(_0x1a6b31,_0x534f38))[_0x26f9('0x42')](handleError(_0x1a6b31,null));};exports[_0x26f9('0x43')]=function(_0x34367e,_0xfddf3e){var _0x5d77b7={'raw':!![],'where':{'id':_0x34367e[_0x26f9('0x44')]['id']}},_0x3882a8={};_0x3882a8[_0x26f9('0x2e')]=_[_0x26f9('0x30')](db['JscriptyQuestionReport']['rawAttributes']);_0x3882a8[_0x26f9('0x2f')]=_[_0x26f9('0x30')](_0x34367e[_0x26f9('0x2f')]);_0x3882a8[_0x26f9('0x31')]=_['intersection'](_0x3882a8[_0x26f9('0x2e')],_0x3882a8[_0x26f9('0x2f')]);_0x5d77b7[_0x26f9('0x33')]=_[_0x26f9('0x32')](_0x3882a8['model'],qs['fields'](_0x34367e[_0x26f9('0x2f')][_0x26f9('0x34')]));_0x5d77b7[_0x26f9('0x33')]=_0x5d77b7['attributes'][_0x26f9('0x35')]?_0x5d77b7[_0x26f9('0x33')]:_0x3882a8[_0x26f9('0x2e')];if(_0x34367e['query'][_0x26f9('0x3f')]){_0x5d77b7[_0x26f9('0x40')]=[{'all':!![]}];}_0x5d77b7=_['merge']({},_0x5d77b7,_0x34367e[_0x26f9('0x3e')]);return db['JscriptyQuestionReport'][_0x26f9('0x45')](_0x5d77b7)[_0x26f9('0x24')](handleEntityNotFound(_0xfddf3e,null))[_0x26f9('0x24')](respondWithResult(_0xfddf3e,null))[_0x26f9('0x42')](handleError(_0xfddf3e,null));};exports[_0x26f9('0x46')]=function(_0x1ad5a0,_0x1c806d){return db['JscriptyQuestionReport'][_0x26f9('0x46')](_0x1ad5a0[_0x26f9('0x47')],{})[_0x26f9('0x24')](respondWithResult(_0x1c806d,0xc9))[_0x26f9('0x42')](handleError(_0x1c806d,null));};exports[_0x26f9('0x23')]=function(_0x142828,_0x5aa229){if(_0x142828[_0x26f9('0x47')]['id']){delete _0x142828['body']['id'];}return db[_0x26f9('0x2a')][_0x26f9('0x45')]({'where':{'id':_0x142828[_0x26f9('0x44')]['id']}})[_0x26f9('0x24')](handleEntityNotFound(_0x5aa229,null))[_0x26f9('0x24')](saveUpdates(_0x142828[_0x26f9('0x47')],null))['then'](respondWithResult(_0x5aa229,null))[_0x26f9('0x42')](handleError(_0x5aa229,null));};exports[_0x26f9('0x25')]=function(_0x5eafce,_0x5ccf02){return db[_0x26f9('0x2a')][_0x26f9('0x45')]({'where':{'id':_0x5eafce['params']['id']}})[_0x26f9('0x24')](handleEntityNotFound(_0x5ccf02,null))['then'](removeEntity(_0x5ccf02,null))['catch'](handleError(_0x5ccf02,null));};exports[_0x26f9('0x48')]=function(_0x5aa8f4,_0x4e04ec){return db[_0x26f9('0x2a')]['describe']()[_0x26f9('0x24')](respondWithResult(_0x4e04ec,null))[_0x26f9('0x42')](handleError(_0x4e04ec,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index afd83e3..b59a95f 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 _0xf5de=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_questions','lodash','util','moment'];(function(_0xe48e28,_0x24f6a1){var _0x38c669=function(_0x209fa2){while(--_0x209fa2){_0xe48e28['push'](_0xe48e28['shift']());}};_0x38c669(++_0x24f6a1);}(_0xf5de,0xad));var _0xef5d=function(_0xce0e99,_0x1d37c7){_0xce0e99=_0xce0e99-0x0;var _0x41539e=_0xf5de[_0xce0e99];return _0x41539e;};'use strict';var _=require(_0xef5d('0x0'));var util=require(_0xef5d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xef5d('0x2'));var BPromise=require(_0xef5d('0x3'));var rp=require(_0xef5d('0x4'));var fs=require('fs');var path=require(_0xef5d('0x5'));var rimraf=require(_0xef5d('0x6'));var config=require(_0xef5d('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xef5d('0x8')]=function(_0x4a0871,_0x409ccb){return _0x4a0871[_0xef5d('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0xef5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d0c=['define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x3e9279,_0x401e38){var _0x35abf4=function(_0xed0852){while(--_0xed0852){_0x3e9279['push'](_0x3e9279['shift']());}};_0x35abf4(++_0x401e38);}(_0x7d0c,0x6f));var _0xc7d0=function(_0x5ce2a4,_0x50f5cb){_0x5ce2a4=_0x5ce2a4-0x0;var _0x1c8bc2=_0x7d0c[_0x5ce2a4];return _0x1c8bc2;};'use strict';var _=require('lodash');var util=require(_0xc7d0('0x0'));var logger=require(_0xc7d0('0x1'))(_0xc7d0('0x2'));var moment=require(_0xc7d0('0x3'));var BPromise=require('bluebird');var rp=require(_0xc7d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7d0('0x5'));var config=require(_0xc7d0('0x6'));var attributes=require(_0xc7d0('0x7'));module[_0xc7d0('0x8')]=function(_0x514250,_0x3c247c){return _0x514250[_0xc7d0('0x9')](_0xc7d0('0xa'),attributes,{'tableName':_0xc7d0('0xb'),'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 761c074..0fc62d5 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 _0xc081=['client','http','request','then','info','request\x20sent','debug','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0xc471d2,_0x26ab16){var _0x334c68=function(_0x2deae4){while(--_0x2deae4){_0xc471d2['push'](_0xc471d2['shift']());}};_0x334c68(++_0x26ab16);}(_0xc081,0x1d9));var _0x1c08=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0xc081[_0x4653f7];return _0x5454da;};'use strict';var _=require(_0x1c08('0x0'));var util=require(_0x1c08('0x1'));var moment=require(_0x1c08('0x2'));var BPromise=require('bluebird');var rs=require(_0x1c08('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1c08('0x4'));var logger=require('../../config/logger')(_0x1c08('0x5'));var config=require(_0x1c08('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1c08('0x7')][_0x1c08('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1503ee,_0x58aa79,_0x31de54){return new BPromise(function(_0x334d91,_0x1d5ece){return client[_0x1c08('0x9')](_0x1503ee,_0x31de54)[_0x1c08('0xa')](function(_0xb9a469){logger[_0x1c08('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x58aa79,_0x1c08('0xc'));logger[_0x1c08('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x58aa79,_0x1c08('0xc'),JSON[_0x1c08('0xe')](_0xb9a469));if(_0xb9a469[_0x1c08('0xf')]){if(_0xb9a469[_0x1c08('0xf')]['code']===0x1f4){logger[_0x1c08('0xf')](_0x1c08('0x10'),_0x58aa79,_0xb9a469[_0x1c08('0xf')][_0x1c08('0x11')]);return _0x1d5ece(_0xb9a469[_0x1c08('0xf')][_0x1c08('0x11')]);}logger['error'](_0x1c08('0x10'),_0x58aa79,_0xb9a469[_0x1c08('0xf')]['message']);return _0x334d91(_0xb9a469['error']['message']);}else{logger[_0x1c08('0xb')](_0x1c08('0x10'),_0x58aa79,_0x1c08('0xc'));_0x334d91(_0xb9a469[_0x1c08('0x12')]['message']);}})[_0x1c08('0x13')](function(_0x38b392){logger[_0x1c08('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x58aa79,_0x38b392);_0x1d5ece(_0x38b392);});});} \ No newline at end of file +var _0x044b=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x044b,0x17a));var _0xb044=function(_0x4f8c3e,_0x4152a2){_0x4f8c3e=_0x4f8c3e-0x0;var _0x1c050d=_0x044b[_0x4f8c3e];return _0x1c050d;};'use strict';var _=require(_0xb044('0x0'));var util=require(_0xb044('0x1'));var moment=require(_0xb044('0x2'));var BPromise=require(_0xb044('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb044('0x4'))['db'];var utils=require(_0xb044('0x5'));var logger=require('../../config/logger')(_0xb044('0x6'));var config=require(_0xb044('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb044('0x8')][_0xb044('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c4cd5,_0x4aa24a,_0x127942){return new BPromise(function(_0x2dd27b,_0x3ef8b9){return client[_0xb044('0xa')](_0x5c4cd5,_0x127942)[_0xb044('0xb')](function(_0x3be35a){logger['info'](_0xb044('0xc'),_0x4aa24a,'request\x20sent');logger[_0xb044('0xd')](_0xb044('0xe'),_0x4aa24a,'request\x20sent',JSON['stringify'](_0x3be35a));if(_0x3be35a[_0xb044('0xf')]){if(_0x3be35a[_0xb044('0xf')]['code']===0x1f4){logger['error'](_0xb044('0xc'),_0x4aa24a,_0x3be35a[_0xb044('0xf')][_0xb044('0x10')]);return _0x3ef8b9(_0x3be35a[_0xb044('0xf')]['message']);}logger['error'](_0xb044('0xc'),_0x4aa24a,_0x3be35a['error'][_0xb044('0x10')]);return _0x2dd27b(_0x3be35a[_0xb044('0xf')][_0xb044('0x10')]);}else{logger[_0xb044('0x11')](_0xb044('0xc'),_0x4aa24a,_0xb044('0x12'));_0x2dd27b(_0x3be35a[_0xb044('0x13')][_0xb044('0x10')]);}})['catch'](function(_0x49df1b){logger[_0xb044('0xf')](_0xb044('0xc'),_0x4aa24a,_0x49df1b);_0x3ef8b9(_0x49df1b);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 860c5e8..9aa6d3f 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 _0xa641=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','put','update','delete','destroy','exports','util','path'];(function(_0x529b9a,_0x3ddafe){var _0x15b1f2=function(_0x584921){while(--_0x584921){_0x529b9a['push'](_0x529b9a['shift']());}};_0x15b1f2(++_0x3ddafe);}(_0xa641,0x1e1));var _0x1a64=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xa641[_0x40220a];return _0x3903cc;};'use strict';var multer=require('multer');var util=require(_0x1a64('0x0'));var path=require(_0x1a64('0x1'));var timeout=require(_0x1a64('0x2'));var express=require(_0x1a64('0x3'));var router=express[_0x1a64('0x4')]();var fs_extra=require(_0x1a64('0x5'));var auth=require(_0x1a64('0x6'));var interaction=require(_0x1a64('0x7'));var config=require(_0x1a64('0x8'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1a64('0x9')]);router[_0x1a64('0xa')](_0x1a64('0xb'),auth[_0x1a64('0xc')](),controller[_0x1a64('0xd')]);router['get'](_0x1a64('0xe'),auth['isAuthenticated'](),controller[_0x1a64('0xf')]);router[_0x1a64('0xa')](_0x1a64('0x10'),auth[_0x1a64('0xc')](),controller[_0x1a64('0x11')]);router['post']('/',auth[_0x1a64('0xc')](),controller['create']);router[_0x1a64('0x12')](_0x1a64('0xe'),auth[_0x1a64('0xc')](),controller[_0x1a64('0x13')]);router[_0x1a64('0x14')](_0x1a64('0xe'),auth[_0x1a64('0xc')](),controller[_0x1a64('0x15')]);module[_0x1a64('0x16')]=router; \ No newline at end of file +var _0x9cd1=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/questions','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x947b71,_0x47e08d){var _0x1134ac=function(_0x2fd051){while(--_0x2fd051){_0x947b71['push'](_0x947b71['shift']());}};_0x1134ac(++_0x47e08d);}(_0x9cd1,0x1de));var _0x19cd=function(_0x1e7bbc,_0x46c4f8){_0x1e7bbc=_0x1e7bbc-0x0;var _0x5c3d04=_0x9cd1[_0x1e7bbc];return _0x5c3d04;};'use strict';var multer=require(_0x19cd('0x0'));var util=require(_0x19cd('0x1'));var path=require(_0x19cd('0x2'));var timeout=require('connect-timeout');var express=require(_0x19cd('0x3'));var router=express[_0x19cd('0x4')]();var fs_extra=require(_0x19cd('0x5'));var auth=require(_0x19cd('0x6'));var interaction=require(_0x19cd('0x7'));var config=require(_0x19cd('0x8'));var controller=require(_0x19cd('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x19cd('0xa')]);router[_0x19cd('0xb')](_0x19cd('0xc'),auth[_0x19cd('0xd')](),controller['describe']);router[_0x19cd('0xb')](_0x19cd('0xe'),auth['isAuthenticated'](),controller[_0x19cd('0xf')]);router[_0x19cd('0xb')](_0x19cd('0x10'),auth[_0x19cd('0xd')](),controller['getQuestions']);router[_0x19cd('0x11')]('/',auth[_0x19cd('0xd')](),controller[_0x19cd('0x12')]);router[_0x19cd('0x13')](_0x19cd('0xe'),auth[_0x19cd('0xd')](),controller[_0x19cd('0x14')]);router[_0x19cd('0x15')]('/:id',auth[_0x19cd('0xd')](),controller[_0x19cd('0x16')]);module[_0x19cd('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 274be77..28e1b01 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 _0xbdb8=['sequelize','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN'];(function(_0x15923a,_0x14ee0b){var _0x4a29ac=function(_0x2a5b4f){while(--_0x2a5b4f){_0x15923a['push'](_0x15923a['shift']());}};_0x4a29ac(++_0x14ee0b);}(_0xbdb8,0xf0));var _0x8bdb=function(_0x3724e2,_0x41d318){_0x3724e2=_0x3724e2-0x0;var _0x5c5ab2=_0xbdb8[_0x3724e2];return _0x5c5ab2;};'use strict';var moment=require('moment');var Sequelize=require(_0x8bdb('0x0'));module[_0x8bdb('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x15e50c){this[_0x8bdb('0x2')](_0x8bdb('0x3'),_0x15e50c);this[_0x8bdb('0x2')](_0x8bdb('0x4'),moment()[_0x8bdb('0x5')](_0x8bdb('0x6')));}},'endtime':{'type':Sequelize[_0x8bdb('0x7')]},'membername':{'type':Sequelize[_0x8bdb('0x8')]},'projectname':{'type':Sequelize[_0x8bdb('0x8')]},'queue':{'type':Sequelize[_0x8bdb('0x8')]},'uniqueid':{'type':Sequelize[_0x8bdb('0x8')]},'calleridname':{'type':Sequelize[_0x8bdb('0x8')]},'calleridnum':{'type':Sequelize[_0x8bdb('0x8')]},'completed':{'type':Sequelize[_0x8bdb('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xb098=['format','DATE','STRING','BOOLEAN','moment','sequelize','setDataValue','starttime'];(function(_0x4acfb,_0x25d9a7){var _0x3c0ad7=function(_0x1daf66){while(--_0x1daf66){_0x4acfb['push'](_0x4acfb['shift']());}};_0x3c0ad7(++_0x25d9a7);}(_0xb098,0x1c4));var _0x8b09=function(_0x14c9cf,_0x379185){_0x14c9cf=_0x14c9cf-0x0;var _0x2664b5=_0xb098[_0x14c9cf];return _0x2664b5;};'use strict';var moment=require(_0x8b09('0x0'));var Sequelize=require(_0x8b09('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x41afa7){this[_0x8b09('0x2')](_0x8b09('0x3'),_0x41afa7);this[_0x8b09('0x2')]('endtime',moment()[_0x8b09('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x8b09('0x5')]},'membername':{'type':Sequelize[_0x8b09('0x6')]},'projectname':{'type':Sequelize[_0x8b09('0x6')]},'queue':{'type':Sequelize[_0x8b09('0x6')]},'uniqueid':{'type':Sequelize[_0x8b09('0x6')]},'calleridname':{'type':Sequelize[_0x8b09('0x6')]},'calleridnum':{'type':Sequelize[_0x8b09('0x6')]},'completed':{'type':Sequelize[_0x8b09('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 3512793..38e7e49 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 _0x4aab=['hasOwnProperty','nolimit','SessionId','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','rows','show','params','length','find','catch','create','body','describe','getQuestions','JscriptyQuestionReport'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4aab,0xa6));var _0xb4aa=function(_0x12db5b,_0x17dec0){_0x12db5b=_0x12db5b-0x0;var _0xf0f483=_0x4aab[_0x12db5b];return _0xf0f483;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4aa('0x0'));var zipdir=require(_0xb4aa('0x1'));var jsonpatch=require(_0xb4aa('0x2'));var rp=require(_0xb4aa('0x3'));var moment=require(_0xb4aa('0x4'));var BPromise=require(_0xb4aa('0x5'));var Mustache=require(_0xb4aa('0x6'));var util=require(_0xb4aa('0x7'));var path=require('path');var sox=require(_0xb4aa('0x8'));var csv=require(_0xb4aa('0x9'));var ejs=require(_0xb4aa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb4aa('0xb'));var crypto=require('crypto');var jsforce=require(_0xb4aa('0xc'));var deskjs=require(_0xb4aa('0xd'));var toCsv=require(_0xb4aa('0x9'));var querystring=require(_0xb4aa('0xe'));var Papa=require(_0xb4aa('0xf'));var Redis=require(_0xb4aa('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb4aa('0x11'));var hardwareService=require(_0xb4aa('0x12'));var logger=require(_0xb4aa('0x13'))(_0xb4aa('0x14'));var utils=require(_0xb4aa('0x15'));var config=require(_0xb4aa('0x16'));var licenseUtil=require(_0xb4aa('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x142ae7,_0x40a6eb){_0x40a6eb=_0x40a6eb||0xcc;return function(_0x58da17){if(_0x58da17){return _0x142ae7[_0xb4aa('0x18')](_0x40a6eb);}return _0x142ae7[_0xb4aa('0x19')](_0x40a6eb)[_0xb4aa('0x1a')]();};}function respondWithResult(_0x3e6fea,_0x4f283e){_0x4f283e=_0x4f283e||0xc8;return function(_0x2d8ef0){if(_0x2d8ef0){return _0x3e6fea[_0xb4aa('0x19')](_0x4f283e)[_0xb4aa('0x1b')](_0x2d8ef0);}};}function respondWithFilteredResult(_0x292627,_0x50c2fb){return function(_0x369b8c){if(_0x369b8c){var _0x22e556=typeof _0x50c2fb['offset']==='undefined'&&typeof _0x50c2fb['limit']===_0xb4aa('0x1c');var _0x22957a=_0x369b8c[_0xb4aa('0x1d')];var _0x13d1eb=_0x22e556?0x0:_0x50c2fb['offset'];var _0x3be9e9=_0x22e556?_0x369b8c['count']:_0x50c2fb[_0xb4aa('0x1e')]+_0x50c2fb[_0xb4aa('0x1f')];var _0xfde46c;if(_0x3be9e9>=_0x22957a){_0x3be9e9=_0x22957a;_0xfde46c=0xc8;}else{_0xfde46c=0xce;}_0x292627[_0xb4aa('0x19')](_0xfde46c);return _0x292627['set'](_0xb4aa('0x20'),_0x13d1eb+'-'+_0x3be9e9+'/'+_0x22957a)['json'](_0x369b8c);}return null;};}function patchUpdates(_0x35827c){return function(_0x37d3af){try{jsonpatch['apply'](_0x37d3af,_0x35827c,!![]);}catch(_0x49270e){return BPromise[_0xb4aa('0x21')](_0x49270e);}return _0x37d3af[_0xb4aa('0x22')]();};}function saveUpdates(_0x29ee27,_0x3d1718){return function(_0xfdd92a){if(_0xfdd92a){return _0xfdd92a[_0xb4aa('0x23')](_0x29ee27)[_0xb4aa('0x24')](function(_0x40e1b8){return _0x40e1b8;});}return null;};}function removeEntity(_0x3c18d0,_0x2d3de9){return function(_0x2674ea){if(_0x2674ea){return _0x2674ea[_0xb4aa('0x25')]()[_0xb4aa('0x24')](function(){_0x3c18d0[_0xb4aa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x891560,_0x3ad8e2){return function(_0x270a7a){if(!_0x270a7a){_0x891560['sendStatus'](0x194);}return _0x270a7a;};}function handleError(_0x2058fe,_0x39fdca){_0x39fdca=_0x39fdca||0x1f4;return function(_0x5d3004){logger[_0xb4aa('0x26')](_0x5d3004[_0xb4aa('0x27')]);if(_0x5d3004[_0xb4aa('0x28')]){delete _0x5d3004['name'];}_0x2058fe[_0xb4aa('0x19')](_0x39fdca)[_0xb4aa('0x29')](_0x5d3004);};}exports[_0xb4aa('0x2a')]=function(_0x56b2a3,_0x4d1b89){var _0x22689e={},_0x4bc7f7={},_0x10398c={'count':0x0,'rows':[]};var _0x49a08f=_['map'](db[_0xb4aa('0x2b')][_0xb4aa('0x2c')],function(_0x50ab5b){return{'name':_0x50ab5b[_0xb4aa('0x2d')],'type':_0x50ab5b[_0xb4aa('0x2e')][_0xb4aa('0x2f')]};});_0x4bc7f7[_0xb4aa('0x30')]=_['map'](_0x49a08f,'name');_0x4bc7f7[_0xb4aa('0x31')]=_[_0xb4aa('0x32')](_0x56b2a3[_0xb4aa('0x31')]);_0x4bc7f7[_0xb4aa('0x33')]=_['intersection'](_0x4bc7f7[_0xb4aa('0x30')],_0x4bc7f7[_0xb4aa('0x31')]);_0x22689e[_0xb4aa('0x34')]=_[_0xb4aa('0x35')](_0x4bc7f7[_0xb4aa('0x30')],qs[_0xb4aa('0x36')](_0x56b2a3[_0xb4aa('0x31')][_0xb4aa('0x36')]));_0x22689e[_0xb4aa('0x34')]=_0x22689e['attributes']['length']?_0x22689e['attributes']:_0x4bc7f7[_0xb4aa('0x30')];if(!_0x56b2a3['query']['hasOwnProperty']('nolimit')){_0x22689e[_0xb4aa('0x1f')]=qs[_0xb4aa('0x1f')](_0x56b2a3[_0xb4aa('0x31')]['limit']);_0x22689e[_0xb4aa('0x1e')]=qs[_0xb4aa('0x1e')](_0x56b2a3[_0xb4aa('0x31')][_0xb4aa('0x1e')]);}_0x22689e[_0xb4aa('0x37')]=qs['sort'](_0x56b2a3['query'][_0xb4aa('0x38')]);_0x22689e[_0xb4aa('0x39')]=qs[_0xb4aa('0x33')](_[_0xb4aa('0x3a')](_0x56b2a3[_0xb4aa('0x31')],_0x4bc7f7[_0xb4aa('0x33')]),_0x49a08f);if(_0x56b2a3[_0xb4aa('0x31')][_0xb4aa('0x3b')]){_0x22689e[_0xb4aa('0x39')]=_['merge'](_0x22689e['where'],{'$or':_[_0xb4aa('0x3c')](_0x49a08f,function(_0x4c0133){if(_0x4c0133[_0xb4aa('0x2e')]!==_0xb4aa('0x3d')){var _0x4dc39a={};_0x4dc39a[_0x4c0133['name']]={'$like':'%'+_0x56b2a3[_0xb4aa('0x31')]['filter']+'%'};return _0x4dc39a;}})});}_0x22689e=_[_0xb4aa('0x3e')]({},_0x22689e,_0x56b2a3[_0xb4aa('0x3f')]);var _0x484047={'where':_0x22689e[_0xb4aa('0x39')]};return db[_0xb4aa('0x2b')][_0xb4aa('0x1d')](_0x484047)[_0xb4aa('0x24')](function(_0x2215ea){_0x10398c[_0xb4aa('0x1d')]=_0x2215ea;if(_0x56b2a3[_0xb4aa('0x31')][_0xb4aa('0x40')]){_0x22689e[_0xb4aa('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x22689e);})['then'](function(_0xa2911c){_0x10398c[_0xb4aa('0x42')]=_0xa2911c;return _0x10398c;})[_0xb4aa('0x24')](respondWithFilteredResult(_0x4d1b89,_0x22689e))['catch'](handleError(_0x4d1b89,null));};exports[_0xb4aa('0x43')]=function(_0x628a2a,_0x1bb874){var _0x3e4f37={'raw':!![],'where':{'id':_0x628a2a[_0xb4aa('0x44')]['id']}},_0x51c595={};_0x51c595[_0xb4aa('0x30')]=_[_0xb4aa('0x32')](db[_0xb4aa('0x2b')][_0xb4aa('0x2c')]);_0x51c595['query']=_['keys'](_0x628a2a['query']);_0x51c595[_0xb4aa('0x33')]=_[_0xb4aa('0x35')](_0x51c595[_0xb4aa('0x30')],_0x51c595[_0xb4aa('0x31')]);_0x3e4f37['attributes']=_[_0xb4aa('0x35')](_0x51c595[_0xb4aa('0x30')],qs['fields'](_0x628a2a[_0xb4aa('0x31')][_0xb4aa('0x36')]));_0x3e4f37[_0xb4aa('0x34')]=_0x3e4f37[_0xb4aa('0x34')][_0xb4aa('0x45')]?_0x3e4f37['attributes']:_0x51c595['model'];if(_0x628a2a[_0xb4aa('0x31')][_0xb4aa('0x40')]){_0x3e4f37[_0xb4aa('0x41')]=[{'all':!![]}];}_0x3e4f37=_[_0xb4aa('0x3e')]({},_0x3e4f37,_0x628a2a['options']);return db[_0xb4aa('0x2b')][_0xb4aa('0x46')](_0x3e4f37)[_0xb4aa('0x24')](handleEntityNotFound(_0x1bb874,null))['then'](respondWithResult(_0x1bb874,null))[_0xb4aa('0x47')](handleError(_0x1bb874,null));};exports[_0xb4aa('0x48')]=function(_0x43974a,_0x76d4af){return db[_0xb4aa('0x2b')][_0xb4aa('0x48')](_0x43974a[_0xb4aa('0x49')],{})[_0xb4aa('0x24')](respondWithResult(_0x76d4af,0xc9))[_0xb4aa('0x47')](handleError(_0x76d4af,null));};exports[_0xb4aa('0x23')]=function(_0x39164f,_0x14f727){if(_0x39164f[_0xb4aa('0x49')]['id']){delete _0x39164f[_0xb4aa('0x49')]['id'];}return db[_0xb4aa('0x2b')]['find']({'where':{'id':_0x39164f[_0xb4aa('0x44')]['id']}})[_0xb4aa('0x24')](handleEntityNotFound(_0x14f727,null))[_0xb4aa('0x24')](saveUpdates(_0x39164f[_0xb4aa('0x49')],null))[_0xb4aa('0x24')](respondWithResult(_0x14f727,null))[_0xb4aa('0x47')](handleError(_0x14f727,null));};exports[_0xb4aa('0x25')]=function(_0x4deb52,_0x4f633e){return db[_0xb4aa('0x2b')][_0xb4aa('0x46')]({'where':{'id':_0x4deb52[_0xb4aa('0x44')]['id']}})[_0xb4aa('0x24')](handleEntityNotFound(_0x4f633e,null))[_0xb4aa('0x24')](removeEntity(_0x4f633e,null))[_0xb4aa('0x47')](handleError(_0x4f633e,null));};exports[_0xb4aa('0x4a')]=function(_0x5c13f6,_0x41d088){return db[_0xb4aa('0x2b')][_0xb4aa('0x4a')]()[_0xb4aa('0x24')](respondWithResult(_0x41d088,null))[_0xb4aa('0x47')](handleError(_0x41d088,null));};exports[_0xb4aa('0x4b')]=function(_0x48f1d8,_0x2dd2b9,_0x35eac2){var _0x39d943={'raw':!![],'where':{}};var _0x31713e={};var _0x5cca1e={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x48f1d8[_0xb4aa('0x44')]['id']}})[_0xb4aa('0x24')](handleEntityNotFound(_0x2dd2b9,null))[_0xb4aa('0x24')](function(_0x398055){if(_0x398055){_0x31713e[_0xb4aa('0x30')]=_[_0xb4aa('0x32')](db[_0xb4aa('0x4c')][_0xb4aa('0x2c')]);_0x31713e[_0xb4aa('0x31')]=_[_0xb4aa('0x32')](_0x48f1d8[_0xb4aa('0x31')]);_0x31713e[_0xb4aa('0x33')]=_['intersection'](_0x31713e[_0xb4aa('0x30')],_0x31713e[_0xb4aa('0x31')]);_0x39d943['attributes']=_[_0xb4aa('0x35')](_0x31713e['model'],qs[_0xb4aa('0x36')](_0x48f1d8[_0xb4aa('0x31')]['fields']));_0x39d943[_0xb4aa('0x34')]=_0x39d943[_0xb4aa('0x34')][_0xb4aa('0x45')]?_0x39d943[_0xb4aa('0x34')]:_0x31713e[_0xb4aa('0x30')];if(!_0x48f1d8[_0xb4aa('0x31')][_0xb4aa('0x4d')](_0xb4aa('0x4e'))){_0x39d943[_0xb4aa('0x1f')]=qs['limit'](_0x48f1d8['query'][_0xb4aa('0x1f')]);_0x39d943[_0xb4aa('0x1e')]=qs[_0xb4aa('0x1e')](_0x48f1d8[_0xb4aa('0x31')]['offset']);}_0x39d943['order']=qs[_0xb4aa('0x38')](_0x48f1d8[_0xb4aa('0x31')][_0xb4aa('0x38')]);_0x39d943[_0xb4aa('0x39')]=qs[_0xb4aa('0x33')](_[_0xb4aa('0x3a')](_0x48f1d8[_0xb4aa('0x31')],_0x31713e[_0xb4aa('0x33')]));_0x39d943[_0xb4aa('0x39')][_0xb4aa('0x4f')]=_0x398055['id'];if(_0x48f1d8[_0xb4aa('0x31')][_0xb4aa('0x3b')]){_0x39d943['where']=_[_0xb4aa('0x3e')](_0x39d943['where'],{'$or':_[_0xb4aa('0x3c')](_0x39d943['attributes'],function(_0x3f86c9){var _0xd1c413={};_0xd1c413[_0x3f86c9]={'$like':'%'+_0x48f1d8[_0xb4aa('0x31')]['filter']+'%'};return _0xd1c413;})});}_0x39d943=_['merge']({},_0x39d943,_0x48f1d8[_0xb4aa('0x3f')]);return db['JscriptyQuestionReport'][_0xb4aa('0x1d')]({'where':_0x39d943[_0xb4aa('0x39')]})[_0xb4aa('0x24')](function(_0x3db8dc){_0x5cca1e[_0xb4aa('0x1d')]=_0x3db8dc;if(_0x48f1d8[_0xb4aa('0x31')][_0xb4aa('0x40')]){_0x39d943['include']=[{'all':!![]}];}return db[_0xb4aa('0x4c')][_0xb4aa('0x50')](_0x39d943);})[_0xb4aa('0x24')](function(_0x5cec19){_0x5cca1e[_0xb4aa('0x42')]=_0x5cec19;return _0x5cca1e;});}})['then'](respondWithFilteredResult(_0x2dd2b9,_0x39d943))[_0xb4aa('0x47')](handleError(_0x2dd2b9,null));}; \ No newline at end of file +var _0xaa35=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','filters','filter','VIRTUAL','options','where','include','rows','params','merge','find','catch','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','length','order','includeAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x4b92f4,_0x16215f){var _0x3a056f=function(_0x187f44){while(--_0x187f44){_0x4b92f4['push'](_0x4b92f4['shift']());}};_0x3a056f(++_0x16215f);}(_0xaa35,0x176));var _0x5aa3=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xaa35[_0x2de0a7];return _0x429437;};'use strict';var emlformat=require(_0x5aa3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5aa3('0x1'));var jsonpatch=require(_0x5aa3('0x2'));var rp=require(_0x5aa3('0x3'));var moment=require(_0x5aa3('0x4'));var BPromise=require(_0x5aa3('0x5'));var Mustache=require(_0x5aa3('0x6'));var util=require(_0x5aa3('0x7'));var path=require(_0x5aa3('0x8'));var sox=require(_0x5aa3('0x9'));var csv=require(_0x5aa3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5aa3('0xb'));var _=require(_0x5aa3('0xc'));var squel=require(_0x5aa3('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5aa3('0xe'));var toCsv=require(_0x5aa3('0xa'));var querystring=require(_0x5aa3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5aa3('0x10'));var as=require(_0x5aa3('0x11'));var hardwareService=require(_0x5aa3('0x12'));var logger=require(_0x5aa3('0x13'))('api');var utils=require(_0x5aa3('0x14'));var config=require(_0x5aa3('0x15'));var licenseUtil=require(_0x5aa3('0x16'));var db=require(_0x5aa3('0x17'))['db'];function respondWithStatusCode(_0xb6c1dc,_0x494fde){_0x494fde=_0x494fde||0xcc;return function(_0x1b5e92){if(_0x1b5e92){return _0xb6c1dc[_0x5aa3('0x18')](_0x494fde);}return _0xb6c1dc['status'](_0x494fde)['end']();};}function respondWithResult(_0x484dae,_0x1fbff3){_0x1fbff3=_0x1fbff3||0xc8;return function(_0x1947dd){if(_0x1947dd){return _0x484dae[_0x5aa3('0x19')](_0x1fbff3)[_0x5aa3('0x1a')](_0x1947dd);}};}function respondWithFilteredResult(_0x111dd0,_0x508ad6){return function(_0x72dd6a){if(_0x72dd6a){var _0x260dcf=typeof _0x508ad6[_0x5aa3('0x1b')]===_0x5aa3('0x1c')&&typeof _0x508ad6[_0x5aa3('0x1d')]===_0x5aa3('0x1c');var _0x789219=_0x72dd6a[_0x5aa3('0x1e')];var _0x3ea3e1=_0x260dcf?0x0:_0x508ad6[_0x5aa3('0x1b')];var _0x2b7c38=_0x260dcf?_0x72dd6a[_0x5aa3('0x1e')]:_0x508ad6['offset']+_0x508ad6['limit'];var _0x37f099;if(_0x2b7c38>=_0x789219){_0x2b7c38=_0x789219;_0x37f099=0xc8;}else{_0x37f099=0xce;}_0x111dd0[_0x5aa3('0x19')](_0x37f099);return _0x111dd0[_0x5aa3('0x1f')](_0x5aa3('0x20'),_0x3ea3e1+'-'+_0x2b7c38+'/'+_0x789219)['json'](_0x72dd6a);}return null;};}function patchUpdates(_0x406971){return function(_0x76be98){try{jsonpatch[_0x5aa3('0x21')](_0x76be98,_0x406971,!![]);}catch(_0x40ba37){return BPromise[_0x5aa3('0x22')](_0x40ba37);}return _0x76be98['save']();};}function saveUpdates(_0x5e5815,_0x14b135){return function(_0x276067){if(_0x276067){return _0x276067[_0x5aa3('0x23')](_0x5e5815)[_0x5aa3('0x24')](function(_0x567978){return _0x567978;});}return null;};}function removeEntity(_0x517025,_0x38a234){return function(_0x37f5a8){if(_0x37f5a8){return _0x37f5a8[_0x5aa3('0x25')]()['then'](function(){_0x517025['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b31ae,_0x3b0d50){return function(_0x241f47){if(!_0x241f47){_0x4b31ae['sendStatus'](0x194);}return _0x241f47;};}function handleError(_0x20572b,_0x4a9cc1){_0x4a9cc1=_0x4a9cc1||0x1f4;return function(_0x5eaf9d){logger[_0x5aa3('0x26')](_0x5eaf9d[_0x5aa3('0x27')]);if(_0x5eaf9d['name']){delete _0x5eaf9d[_0x5aa3('0x28')];}_0x20572b[_0x5aa3('0x19')](_0x4a9cc1)[_0x5aa3('0x29')](_0x5eaf9d);};}exports[_0x5aa3('0x2a')]=function(_0x112487,_0x31ed4a){var _0x333bbc={},_0x545f5c={},_0x552ca9={'count':0x0,'rows':[]};var _0x10784a=_[_0x5aa3('0x2b')](db[_0x5aa3('0x2c')][_0x5aa3('0x2d')],function(_0x17fb89){return{'name':_0x17fb89[_0x5aa3('0x2e')],'type':_0x17fb89[_0x5aa3('0x2f')][_0x5aa3('0x30')]};});_0x545f5c['model']=_[_0x5aa3('0x2b')](_0x10784a,_0x5aa3('0x28'));_0x545f5c[_0x5aa3('0x31')]=_[_0x5aa3('0x32')](_0x112487['query']);_0x545f5c['filters']=_[_0x5aa3('0x33')](_0x545f5c[_0x5aa3('0x34')],_0x545f5c[_0x5aa3('0x31')]);_0x333bbc['attributes']=_['intersection'](_0x545f5c[_0x5aa3('0x34')],qs[_0x5aa3('0x35')](_0x112487[_0x5aa3('0x31')][_0x5aa3('0x35')]));_0x333bbc[_0x5aa3('0x36')]=_0x333bbc[_0x5aa3('0x36')]['length']?_0x333bbc[_0x5aa3('0x36')]:_0x545f5c['model'];if(!_0x112487[_0x5aa3('0x31')][_0x5aa3('0x37')](_0x5aa3('0x38'))){_0x333bbc[_0x5aa3('0x1d')]=qs[_0x5aa3('0x1d')](_0x112487[_0x5aa3('0x31')]['limit']);_0x333bbc['offset']=qs[_0x5aa3('0x1b')](_0x112487[_0x5aa3('0x31')]['offset']);}_0x333bbc['order']=qs[_0x5aa3('0x39')](_0x112487[_0x5aa3('0x31')][_0x5aa3('0x39')]);_0x333bbc['where']=qs['filters'](_[_0x5aa3('0x3a')](_0x112487[_0x5aa3('0x31')],_0x545f5c[_0x5aa3('0x3b')]),_0x10784a);if(_0x112487[_0x5aa3('0x31')][_0x5aa3('0x3c')]){_0x333bbc['where']=_['merge'](_0x333bbc['where'],{'$or':_[_0x5aa3('0x2b')](_0x10784a,function(_0x18e4bc){if(_0x18e4bc['type']!==_0x5aa3('0x3d')){var _0x30490e={};_0x30490e[_0x18e4bc[_0x5aa3('0x28')]]={'$like':'%'+_0x112487[_0x5aa3('0x31')]['filter']+'%'};return _0x30490e;}})});}_0x333bbc=_['merge']({},_0x333bbc,_0x112487[_0x5aa3('0x3e')]);var _0x370c62={'where':_0x333bbc[_0x5aa3('0x3f')]};return db[_0x5aa3('0x2c')][_0x5aa3('0x1e')](_0x370c62)[_0x5aa3('0x24')](function(_0x1270b2){_0x552ca9[_0x5aa3('0x1e')]=_0x1270b2;if(_0x112487[_0x5aa3('0x31')]['includeAll']){_0x333bbc[_0x5aa3('0x40')]=[{'all':!![]}];}return db[_0x5aa3('0x2c')]['findAll'](_0x333bbc);})[_0x5aa3('0x24')](function(_0x2fb6c4){_0x552ca9[_0x5aa3('0x41')]=_0x2fb6c4;return _0x552ca9;})[_0x5aa3('0x24')](respondWithFilteredResult(_0x31ed4a,_0x333bbc))['catch'](handleError(_0x31ed4a,null));};exports['show']=function(_0x3fd6ad,_0x3d0a6f){var _0x5f0c31={'raw':!![],'where':{'id':_0x3fd6ad[_0x5aa3('0x42')]['id']}},_0x1411c8={};_0x1411c8['model']=_[_0x5aa3('0x32')](db[_0x5aa3('0x2c')]['rawAttributes']);_0x1411c8['query']=_[_0x5aa3('0x32')](_0x3fd6ad[_0x5aa3('0x31')]);_0x1411c8[_0x5aa3('0x3b')]=_[_0x5aa3('0x33')](_0x1411c8[_0x5aa3('0x34')],_0x1411c8['query']);_0x5f0c31[_0x5aa3('0x36')]=_[_0x5aa3('0x33')](_0x1411c8[_0x5aa3('0x34')],qs[_0x5aa3('0x35')](_0x3fd6ad['query']['fields']));_0x5f0c31[_0x5aa3('0x36')]=_0x5f0c31[_0x5aa3('0x36')]['length']?_0x5f0c31['attributes']:_0x1411c8[_0x5aa3('0x34')];if(_0x3fd6ad[_0x5aa3('0x31')]['includeAll']){_0x5f0c31[_0x5aa3('0x40')]=[{'all':!![]}];}_0x5f0c31=_[_0x5aa3('0x43')]({},_0x5f0c31,_0x3fd6ad[_0x5aa3('0x3e')]);return db[_0x5aa3('0x2c')][_0x5aa3('0x44')](_0x5f0c31)[_0x5aa3('0x24')](handleEntityNotFound(_0x3d0a6f,null))['then'](respondWithResult(_0x3d0a6f,null))[_0x5aa3('0x45')](handleError(_0x3d0a6f,null));};exports['create']=function(_0x14a9b3,_0x1a7b06){return db['JscriptySessionReport'][_0x5aa3('0x46')](_0x14a9b3['body'],{})['then'](respondWithResult(_0x1a7b06,0xc9))[_0x5aa3('0x45')](handleError(_0x1a7b06,null));};exports['update']=function(_0x42bed2,_0x22e175){if(_0x42bed2[_0x5aa3('0x47')]['id']){delete _0x42bed2[_0x5aa3('0x47')]['id'];}return db['JscriptySessionReport'][_0x5aa3('0x44')]({'where':{'id':_0x42bed2['params']['id']}})[_0x5aa3('0x24')](handleEntityNotFound(_0x22e175,null))[_0x5aa3('0x24')](saveUpdates(_0x42bed2[_0x5aa3('0x47')],null))[_0x5aa3('0x24')](respondWithResult(_0x22e175,null))[_0x5aa3('0x45')](handleError(_0x22e175,null));};exports[_0x5aa3('0x25')]=function(_0x3badac,_0x5e2b8a){return db[_0x5aa3('0x2c')][_0x5aa3('0x44')]({'where':{'id':_0x3badac[_0x5aa3('0x42')]['id']}})[_0x5aa3('0x24')](handleEntityNotFound(_0x5e2b8a,null))[_0x5aa3('0x24')](removeEntity(_0x5e2b8a,null))[_0x5aa3('0x45')](handleError(_0x5e2b8a,null));};exports[_0x5aa3('0x48')]=function(_0xc47d05,_0x2eaae5){return db['JscriptySessionReport']['describe']()[_0x5aa3('0x24')](respondWithResult(_0x2eaae5,null))[_0x5aa3('0x45')](handleError(_0x2eaae5,null));};exports[_0x5aa3('0x49')]=function(_0x5ac4c0,_0x1a3dea,_0x3dd40a){var _0x2f535d={'raw':!![],'where':{}};var _0x2ad6e5={};var _0x422042={'count':0x0,'rows':[]};return db[_0x5aa3('0x2c')][_0x5aa3('0x4a')]({'where':{'id':_0x5ac4c0[_0x5aa3('0x42')]['id']}})[_0x5aa3('0x24')](handleEntityNotFound(_0x1a3dea,null))[_0x5aa3('0x24')](function(_0x554d41){if(_0x554d41){_0x2ad6e5[_0x5aa3('0x34')]=_[_0x5aa3('0x32')](db[_0x5aa3('0x4b')][_0x5aa3('0x2d')]);_0x2ad6e5['query']=_[_0x5aa3('0x32')](_0x5ac4c0[_0x5aa3('0x31')]);_0x2ad6e5['filters']=_[_0x5aa3('0x33')](_0x2ad6e5[_0x5aa3('0x34')],_0x2ad6e5[_0x5aa3('0x31')]);_0x2f535d['attributes']=_['intersection'](_0x2ad6e5[_0x5aa3('0x34')],qs['fields'](_0x5ac4c0['query']['fields']));_0x2f535d[_0x5aa3('0x36')]=_0x2f535d['attributes'][_0x5aa3('0x4c')]?_0x2f535d[_0x5aa3('0x36')]:_0x2ad6e5[_0x5aa3('0x34')];if(!_0x5ac4c0[_0x5aa3('0x31')][_0x5aa3('0x37')](_0x5aa3('0x38'))){_0x2f535d['limit']=qs['limit'](_0x5ac4c0[_0x5aa3('0x31')][_0x5aa3('0x1d')]);_0x2f535d[_0x5aa3('0x1b')]=qs[_0x5aa3('0x1b')](_0x5ac4c0[_0x5aa3('0x31')][_0x5aa3('0x1b')]);}_0x2f535d[_0x5aa3('0x4d')]=qs[_0x5aa3('0x39')](_0x5ac4c0[_0x5aa3('0x31')][_0x5aa3('0x39')]);_0x2f535d[_0x5aa3('0x3f')]=qs[_0x5aa3('0x3b')](_[_0x5aa3('0x3a')](_0x5ac4c0[_0x5aa3('0x31')],_0x2ad6e5['filters']));_0x2f535d[_0x5aa3('0x3f')]['SessionId']=_0x554d41['id'];if(_0x5ac4c0[_0x5aa3('0x31')][_0x5aa3('0x3c')]){_0x2f535d[_0x5aa3('0x3f')]=_[_0x5aa3('0x43')](_0x2f535d['where'],{'$or':_[_0x5aa3('0x2b')](_0x2f535d[_0x5aa3('0x36')],function(_0x3dc1f2){var _0x3bf5ba={};_0x3bf5ba[_0x3dc1f2]={'$like':'%'+_0x5ac4c0[_0x5aa3('0x31')][_0x5aa3('0x3c')]+'%'};return _0x3bf5ba;})});}_0x2f535d=_[_0x5aa3('0x43')]({},_0x2f535d,_0x5ac4c0[_0x5aa3('0x3e')]);return db['JscriptyQuestionReport']['count']({'where':_0x2f535d[_0x5aa3('0x3f')]})[_0x5aa3('0x24')](function(_0x1f720f){_0x422042[_0x5aa3('0x1e')]=_0x1f720f;if(_0x5ac4c0[_0x5aa3('0x31')][_0x5aa3('0x4e')]){_0x2f535d[_0x5aa3('0x40')]=[{'all':!![]}];}return db[_0x5aa3('0x4b')]['findAll'](_0x2f535d);})[_0x5aa3('0x24')](function(_0x2d35d7){_0x422042[_0x5aa3('0x41')]=_0x2d35d7;return _0x422042;});}})[_0x5aa3('0x24')](respondWithFilteredResult(_0x1a3dea,_0x2f535d))[_0x5aa3('0x45')](handleError(_0x1a3dea,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 685d31e..dff0273 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 _0x4819=['report_jscripty_sessions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','JscriptySessionReport'];(function(_0x4ae3b5,_0x18e248){var _0x2977e1=function(_0x459498){while(--_0x459498){_0x4ae3b5['push'](_0x4ae3b5['shift']());}};_0x2977e1(++_0x18e248);}(_0x4819,0xcd));var _0x9481=function(_0x1a87a8,_0x127bc9){_0x1a87a8=_0x1a87a8-0x0;var _0x51b8b7=_0x4819[_0x1a87a8];return _0x51b8b7;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a6b=['request-promise','path','rimraf','./jscriptySessionReport.attributes','JscriptySessionReport','report_jscripty_sessions','lodash','moment'];(function(_0x101fac,_0x4d006d){var _0x5d982a=function(_0x5b2df0){while(--_0x5b2df0){_0x101fac['push'](_0x101fac['shift']());}};_0x5d982a(++_0x4d006d);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x493a95,_0x4cfccb){_0x493a95=_0x493a95-0x0;var _0x1cac44=_0x0a6b[_0x493a95];return _0x1cac44;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index e683bfc..005c143 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 _0xb145=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message'];(function(_0x36d729,_0x59dab5){var _0x2445a5=function(_0x4fd5c6){while(--_0x4fd5c6){_0x36d729['push'](_0x36d729['shift']());}};_0x2445a5(++_0x59dab5);}(_0xb145,0xa3));var _0x5b14=function(_0x601329,_0x9b6d64){_0x601329=_0x601329-0x0;var _0xe799f0=_0xb145[_0x601329];return _0xe799f0;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});} \ No newline at end of file +var _0x323f=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xa3c3e4,_0x54c4cd){var _0x35f753=function(_0x5b27d1){while(--_0x5b27d1){_0xa3c3e4['push'](_0xa3c3e4['shift']());}};_0x35f753(++_0x54c4cd);}(_0x323f,0x1ee));var _0xf323=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x323f[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 08dc802..73076ed 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 _0xcc9d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','isAuthenticated','/download_log_file','downloadLogFile','exports'];(function(_0x1f058b,_0x4a47cf){var _0x5c5232=function(_0x11eee8){while(--_0x11eee8){_0x1f058b['push'](_0x1f058b['shift']());}};_0x5c5232(++_0x4a47cf);}(_0xcc9d,0x180));var _0xdcc9=function(_0x286ca2,_0x2583ed){_0x286ca2=_0x286ca2-0x0;var _0x14a18b=_0xcc9d[_0x286ca2];return _0x14a18b;};'use strict';var multer=require(_0xdcc9('0x0'));var util=require(_0xdcc9('0x1'));var path=require('path');var timeout=require(_0xdcc9('0x2'));var express=require(_0xdcc9('0x3'));var router=express[_0xdcc9('0x4')]();var fs_extra=require(_0xdcc9('0x5'));var auth=require(_0xdcc9('0x6'));var interaction=require(_0xdcc9('0x7'));var config=require('../../config/environment');var controller=require(_0xdcc9('0x8'));router[_0xdcc9('0x9')]('/',controller[_0xdcc9('0xa')]);router[_0xdcc9('0xb')]('/:id',auth[_0xdcc9('0xc')](),controller['update']);router[_0xdcc9('0x9')](_0xdcc9('0xd'),auth[_0xdcc9('0xc')](),controller[_0xdcc9('0xe')]);module[_0xdcc9('0xf')]=router; \ No newline at end of file +var _0xb9a5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','update','exports','path','connect-timeout','express'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xb9a5,0xd5));var _0x5b9a=function(_0x4e5e92,_0x4e657e){_0x4e5e92=_0x4e5e92-0x0;var _0x486c68=_0xb9a5[_0x4e5e92];return _0x486c68;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5b9a('0x0'));var timeout=require(_0x5b9a('0x1'));var express=require(_0x5b9a('0x2'));var router=express[_0x5b9a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5b9a('0x4'));var interaction=require(_0x5b9a('0x5'));var config=require(_0x5b9a('0x6'));var controller=require('./license.controller');router[_0x5b9a('0x7')]('/',controller[_0x5b9a('0x8')]);router['put']('/:id',auth[_0x5b9a('0x9')](),controller[_0x5b9a('0xa')]);router['get']('/download_log_file',auth[_0x5b9a('0x9')](),controller['downloadLogFile']);module[_0x5b9a('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index d233577..df3412c 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 _0x5e61=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x1c4dfe,_0x4dc31b){var _0x2fde12=function(_0x326609){while(--_0x326609){_0x1c4dfe['push'](_0x1c4dfe['shift']());}};_0x2fde12(++_0x4dc31b);}(_0x5e61,0x14d));var _0x15e6=function(_0xffdd08,_0x5cfdbc){_0xffdd08=_0xffdd08-0x0;var _0x2cb77f=_0x5e61[_0xffdd08];return _0x2cb77f;};'use strict';var Sequelize=require(_0x15e6('0x0'));module[_0x15e6('0x1')]={'license':{'type':Sequelize[_0x15e6('0x2')]},'data1':{'type':Sequelize[_0x15e6('0x3')]},'data2':{'type':Sequelize[_0x15e6('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x15e6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x116c=['sequelize','exports','TEXT','STRING'];(function(_0x3f8a38,_0x274364){var _0xab48c=function(_0xc507e3){while(--_0xc507e3){_0x3f8a38['push'](_0x3f8a38['shift']());}};_0xab48c(++_0x274364);}(_0x116c,0xc4));var _0xc116=function(_0x8df524,_0x4f014c){_0x8df524=_0x8df524-0x0;var _0x334b46=_0x116c[_0x8df524];return _0x334b46;};'use strict';var Sequelize=require(_0xc116('0x0'));module[_0xc116('0x1')]={'license':{'type':Sequelize[_0xc116('0x2')]},'data1':{'type':Sequelize[_0xc116('0x3')]},'data2':{'type':Sequelize[_0xc116('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 c41dbb9..d20446a 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 _0x9c95=['attributes','merge','options','getLicense','catch','update','body','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','setHeader','Content-disposition','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','apply','reject','then','destroy','error','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','fields'];(function(_0x4c41f4,_0x20cbc5){var _0x154630=function(_0x4d7049){while(--_0x4d7049){_0x4c41f4['push'](_0x4c41f4['shift']());}};_0x154630(++_0x20cbc5);}(_0x9c95,0x1a7));var _0x59c9=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x9c95[_0x5cb1af];return _0x8d7940;};'use strict';var emlformat=require(_0x59c9('0x0'));var rimraf=require(_0x59c9('0x1'));var zipdir=require(_0x59c9('0x2'));var jsonpatch=require(_0x59c9('0x3'));var rp=require(_0x59c9('0x4'));var moment=require(_0x59c9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x59c9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x59c9('0x7'));var csv=require(_0x59c9('0x8'));var ejs=require(_0x59c9('0x9'));var fs=require('fs');var fs_extra=require(_0x59c9('0xa'));var _=require('lodash');var squel=require(_0x59c9('0xb'));var crypto=require(_0x59c9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x59c9('0xd'));var toCsv=require(_0x59c9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x59c9('0xe'));var authService=require(_0x59c9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x59c9('0x10'));var hardwareService=require(_0x59c9('0x11'));var logger=require('../../config/logger')(_0x59c9('0x12'));var utils=require(_0x59c9('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x59c9('0x14'))['db'];function respondWithStatusCode(_0x391cfd,_0x3f56c4){_0x3f56c4=_0x3f56c4||0xcc;return function(_0x88a6d1){if(_0x88a6d1){return _0x391cfd[_0x59c9('0x15')](_0x3f56c4);}return _0x391cfd[_0x59c9('0x16')](_0x3f56c4)[_0x59c9('0x17')]();};}function respondWithResult(_0xec3d66,_0x523bd6){_0x523bd6=_0x523bd6||0xc8;return function(_0xf55b71){if(_0xf55b71){return _0xec3d66[_0x59c9('0x16')](_0x523bd6)[_0x59c9('0x18')](_0xf55b71);}};}function respondWithFilteredResult(_0x204551,_0x2a9a1c){return function(_0x3e70eb){if(_0x3e70eb){var _0x116e04=typeof _0x2a9a1c['offset']===_0x59c9('0x19')&&typeof _0x2a9a1c['limit']===_0x59c9('0x19');var _0x3c67d8=_0x3e70eb['count'];var _0x248211=_0x116e04?0x0:_0x2a9a1c['offset'];var _0xba66d0=_0x116e04?_0x3e70eb['count']:_0x2a9a1c[_0x59c9('0x1a')]+_0x2a9a1c[_0x59c9('0x1b')];var _0x1a86d3;if(_0xba66d0>=_0x3c67d8){_0xba66d0=_0x3c67d8;_0x1a86d3=0xc8;}else{_0x1a86d3=0xce;}_0x204551[_0x59c9('0x16')](_0x1a86d3);return _0x204551[_0x59c9('0x1c')]('Content-Range',_0x248211+'-'+_0xba66d0+'/'+_0x3c67d8)[_0x59c9('0x18')](_0x3e70eb);}return null;};}function patchUpdates(_0x4cc14c){return function(_0x1bf898){try{jsonpatch[_0x59c9('0x1d')](_0x1bf898,_0x4cc14c,!![]);}catch(_0xecb664){return BPromise[_0x59c9('0x1e')](_0xecb664);}return _0x1bf898['save']();};}function saveUpdates(_0x21551c,_0x5d2bde){return function(_0x387646){if(_0x387646){return _0x387646['update'](_0x21551c)[_0x59c9('0x1f')](function(_0x5a233f){return _0x5a233f;});}return null;};}function removeEntity(_0x121683,_0x179ff2){return function(_0x11104a){if(_0x11104a){return _0x11104a[_0x59c9('0x20')]()[_0x59c9('0x1f')](function(){_0x121683[_0x59c9('0x16')](0xcc)[_0x59c9('0x17')]();});}};}function handleEntityNotFound(_0x3d3e88,_0x255ed9){return function(_0x387b24){if(!_0x387b24){_0x3d3e88[_0x59c9('0x15')](0x194);}return _0x387b24;};}function handleError(_0x125665,_0x57b286){_0x57b286=_0x57b286||0x1f4;return function(_0x4078c0){logger[_0x59c9('0x21')](_0x4078c0['stack']);if(_0x4078c0[_0x59c9('0x22')]){delete _0x4078c0['name'];}_0x125665[_0x59c9('0x16')](_0x57b286)[_0x59c9('0x23')](_0x4078c0);};}var utilLicense=require(_0x59c9('0x24'));exports[_0x59c9('0x25')]=function(_0x56d055,_0x239986){var _0x598b37={'raw':!![],'where':{'id':0x1}},_0x4450a1={};_0x4450a1[_0x59c9('0x26')]=_[_0x59c9('0x27')](db[_0x59c9('0x28')][_0x59c9('0x29')]);_0x4450a1[_0x59c9('0x2a')]=_[_0x59c9('0x27')](_0x56d055['query']);_0x4450a1[_0x59c9('0x2b')]=_[_0x59c9('0x2c')](_0x4450a1[_0x59c9('0x26')],_0x4450a1[_0x59c9('0x2a')]);_0x598b37['attributes']=_['intersection'](_0x4450a1[_0x59c9('0x26')],qs[_0x59c9('0x2d')](_0x56d055[_0x59c9('0x2a')]['fields']));_0x598b37[_0x59c9('0x2e')]=_0x598b37[_0x59c9('0x2e')]['length']?_0x598b37[_0x59c9('0x2e')]:_0x4450a1['model'];_0x598b37=_[_0x59c9('0x2f')]({},_0x598b37,_0x56d055[_0x59c9('0x30')]);return utilLicense[_0x59c9('0x31')](_0x598b37)[_0x59c9('0x1f')](respondWithResult(_0x239986,null))[_0x59c9('0x32')](handleError(_0x239986,null));};exports[_0x59c9('0x33')]=function(_0x51a8ff,_0x5560db){if(_0x51a8ff[_0x59c9('0x34')]['id']){delete _0x51a8ff['body']['id'];}return db[_0x59c9('0x28')]['find']({'where':{'id':_0x51a8ff[_0x59c9('0x35')]['id']}})[_0x59c9('0x1f')](handleEntityNotFound(_0x5560db,null))[_0x59c9('0x1f')](function(_0x266793){var _0x352f65=_0x266793[_0x59c9('0x36')]({'plain':!![]});return utilLicense[_0x59c9('0x37')](_0x352f65,_0x51a8ff['body'][_0x59c9('0x38')]);})[_0x59c9('0x1f')](function(_0x156142){if(!_0x156142[_0x59c9('0x39')]){return saveUpdates(_0x51a8ff[_0x59c9('0x34')],null);}return _0x156142;})['then'](respondWithResult(_0x5560db,null))['catch'](handleError(_0x5560db,null));};exports[_0x59c9('0x3a')]=function(_0xd6ec40,_0x378781){var _0x532a27=_0x59c9('0x3b');var _0x14f2e6=path[_0x59c9('0x3c')](_0x59c9('0x3d'),'log','xcally',_0x532a27);_0x378781[_0x59c9('0x3e')](_0x59c9('0x3f'),'attachment;\x20filename='+_0x532a27);_0x378781[_0x59c9('0x1c')](_0x59c9('0x40'),_0x59c9('0x41'));_0x378781[_0x59c9('0x42')](_0x14f2e6);}; \ No newline at end of file +var _0xf3f9=['Content-Range','apply','reject','save','update','then','end','stack','name','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','catch','body','find','key','demo','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-disposition','Content-Type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','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','json','offset','undefined','limit','count','set'];(function(_0x3c1a4e,_0x36dabf){var _0x155a91=function(_0x367f0d){while(--_0x367f0d){_0x3c1a4e['push'](_0x3c1a4e['shift']());}};_0x155a91(++_0x36dabf);}(_0xf3f9,0x6c));var _0x9f3f=function(_0x9a92d9,_0x4c3cb2){_0x9a92d9=_0x9a92d9-0x0;var _0x27cd2e=_0xf3f9[_0x9a92d9];return _0x27cd2e;};'use strict';var emlformat=require(_0x9f3f('0x0'));var rimraf=require(_0x9f3f('0x1'));var zipdir=require(_0x9f3f('0x2'));var jsonpatch=require(_0x9f3f('0x3'));var rp=require(_0x9f3f('0x4'));var moment=require(_0x9f3f('0x5'));var BPromise=require(_0x9f3f('0x6'));var Mustache=require(_0x9f3f('0x7'));var util=require(_0x9f3f('0x8'));var path=require('path');var sox=require(_0x9f3f('0x9'));var csv=require(_0x9f3f('0xa'));var ejs=require(_0x9f3f('0xb'));var fs=require('fs');var fs_extra=require(_0x9f3f('0xc'));var _=require(_0x9f3f('0xd'));var squel=require(_0x9f3f('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9f3f('0xf'));var toCsv=require(_0x9f3f('0xa'));var querystring=require(_0x9f3f('0x10'));var Papa=require('papaparse');var Redis=require(_0x9f3f('0x11'));var authService=require(_0x9f3f('0x12'));var qs=require(_0x9f3f('0x13'));var as=require(_0x9f3f('0x14'));var hardwareService=require(_0x9f3f('0x15'));var logger=require(_0x9f3f('0x16'))(_0x9f3f('0x17'));var utils=require(_0x9f3f('0x18'));var config=require(_0x9f3f('0x19'));var licenseUtil=require(_0x9f3f('0x1a'));var db=require(_0x9f3f('0x1b'))['db'];function respondWithStatusCode(_0x42cac3,_0x3e0f91){_0x3e0f91=_0x3e0f91||0xcc;return function(_0x369309){if(_0x369309){return _0x42cac3[_0x9f3f('0x1c')](_0x3e0f91);}return _0x42cac3['status'](_0x3e0f91)['end']();};}function respondWithResult(_0x24f486,_0x340519){_0x340519=_0x340519||0xc8;return function(_0x253f86){if(_0x253f86){return _0x24f486[_0x9f3f('0x1d')](_0x340519)[_0x9f3f('0x1e')](_0x253f86);}};}function respondWithFilteredResult(_0x3b7f8f,_0x5284e9){return function(_0x4df190){if(_0x4df190){var _0x430e88=typeof _0x5284e9[_0x9f3f('0x1f')]===_0x9f3f('0x20')&&typeof _0x5284e9[_0x9f3f('0x21')]===_0x9f3f('0x20');var _0x4d839a=_0x4df190[_0x9f3f('0x22')];var _0x5e6a34=_0x430e88?0x0:_0x5284e9['offset'];var _0x2f30d7=_0x430e88?_0x4df190[_0x9f3f('0x22')]:_0x5284e9[_0x9f3f('0x1f')]+_0x5284e9[_0x9f3f('0x21')];var _0x31d8f4;if(_0x2f30d7>=_0x4d839a){_0x2f30d7=_0x4d839a;_0x31d8f4=0xc8;}else{_0x31d8f4=0xce;}_0x3b7f8f[_0x9f3f('0x1d')](_0x31d8f4);return _0x3b7f8f[_0x9f3f('0x23')](_0x9f3f('0x24'),_0x5e6a34+'-'+_0x2f30d7+'/'+_0x4d839a)[_0x9f3f('0x1e')](_0x4df190);}return null;};}function patchUpdates(_0x276fd6){return function(_0x660248){try{jsonpatch[_0x9f3f('0x25')](_0x660248,_0x276fd6,!![]);}catch(_0x3fe9ff){return BPromise[_0x9f3f('0x26')](_0x3fe9ff);}return _0x660248[_0x9f3f('0x27')]();};}function saveUpdates(_0x29b302,_0x2e4452){return function(_0x271cfc){if(_0x271cfc){return _0x271cfc[_0x9f3f('0x28')](_0x29b302)['then'](function(_0x267b85){return _0x267b85;});}return null;};}function removeEntity(_0x30618,_0x2ddb25){return function(_0x15933a){if(_0x15933a){return _0x15933a['destroy']()[_0x9f3f('0x29')](function(){_0x30618['status'](0xcc)[_0x9f3f('0x2a')]();});}};}function handleEntityNotFound(_0x1b8796,_0x19c3dd){return function(_0x5b167a){if(!_0x5b167a){_0x1b8796[_0x9f3f('0x1c')](0x194);}return _0x5b167a;};}function handleError(_0x53b9fc,_0x4eef0){_0x4eef0=_0x4eef0||0x1f4;return function(_0x5717d1){logger['error'](_0x5717d1[_0x9f3f('0x2b')]);if(_0x5717d1['name']){delete _0x5717d1[_0x9f3f('0x2c')];}_0x53b9fc[_0x9f3f('0x1d')](_0x4eef0)['send'](_0x5717d1);};}var utilLicense=require(_0x9f3f('0x1a'));exports[_0x9f3f('0x2d')]=function(_0xb6ecc2,_0xd24469){var _0x16955c={'raw':!![],'where':{'id':0x1}},_0x4e0117={};_0x4e0117[_0x9f3f('0x2e')]=_[_0x9f3f('0x2f')](db[_0x9f3f('0x30')][_0x9f3f('0x31')]);_0x4e0117[_0x9f3f('0x32')]=_['keys'](_0xb6ecc2['query']);_0x4e0117[_0x9f3f('0x33')]=_['intersection'](_0x4e0117['model'],_0x4e0117[_0x9f3f('0x32')]);_0x16955c['attributes']=_[_0x9f3f('0x34')](_0x4e0117[_0x9f3f('0x2e')],qs[_0x9f3f('0x35')](_0xb6ecc2[_0x9f3f('0x32')]['fields']));_0x16955c[_0x9f3f('0x36')]=_0x16955c[_0x9f3f('0x36')][_0x9f3f('0x37')]?_0x16955c['attributes']:_0x4e0117[_0x9f3f('0x2e')];_0x16955c=_[_0x9f3f('0x38')]({},_0x16955c,_0xb6ecc2[_0x9f3f('0x39')]);return utilLicense['getLicense'](_0x16955c)[_0x9f3f('0x29')](respondWithResult(_0xd24469,null))[_0x9f3f('0x3a')](handleError(_0xd24469,null));};exports[_0x9f3f('0x28')]=function(_0x576d8b,_0x466ed8){if(_0x576d8b[_0x9f3f('0x3b')]['id']){delete _0x576d8b[_0x9f3f('0x3b')]['id'];}return db[_0x9f3f('0x30')][_0x9f3f('0x3c')]({'where':{'id':_0x576d8b['params']['id']}})[_0x9f3f('0x29')](handleEntityNotFound(_0x466ed8,null))[_0x9f3f('0x29')](function(_0x5a26f9){var _0x2ea858=_0x5a26f9['get']({'plain':!![]});return utilLicense['checkLicense'](_0x2ea858,_0x576d8b['body'][_0x9f3f('0x3d')]);})['then'](function(_0x1901f0){if(!_0x1901f0[_0x9f3f('0x3e')]){return saveUpdates(_0x576d8b[_0x9f3f('0x3b')],null);}return _0x1901f0;})[_0x9f3f('0x29')](respondWithResult(_0x466ed8,null))['catch'](handleError(_0x466ed8,null));};exports[_0x9f3f('0x3f')]=function(_0xb99c42,_0x3d6b3e){var _0x45eaf4=_0x9f3f('0x40');var _0x38feb5=path[_0x9f3f('0x41')](_0x9f3f('0x42'),_0x9f3f('0x43'),'xcally',_0x45eaf4);_0x3d6b3e[_0x9f3f('0x44')](_0x9f3f('0x45'),'attachment;\x20filename='+_0x45eaf4);_0x3d6b3e[_0x9f3f('0x23')](_0x9f3f('0x46'),'text/plain');_0x3d6b3e[_0x9f3f('0x47')](_0x38feb5);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index ef1d95c..70673cb 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 _0xc93e=['../../config/environment','License','license','bluebird','request-promise','path','rimraf'];(function(_0x37b851,_0x469969){var _0x574599=function(_0x4e6ab8){while(--_0x4e6ab8){_0x37b851['push'](_0x37b851['shift']());}};_0x574599(++_0x469969);}(_0xc93e,0x11b));var _0xec93=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0xc93e[_0x4c3070];return _0x536a44;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xec93('0x0'));var rp=require(_0xec93('0x1'));var fs=require('fs');var path=require(_0xec93('0x2'));var rimraf=require(_0xec93('0x3'));var config=require(_0xec93('0x4'));var attributes=require('./license.attributes');module['exports']=function(_0x4e6f8b,_0x2de490){return _0x4e6f8b['define'](_0xec93('0x5'),attributes,{'tableName':_0xec93('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6ba=['License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xe6ba,0xc5));var _0xae6b=function(_0x1c13a9,_0x23f447){_0x1c13a9=_0x1c13a9-0x0;var _0x3a3da7=_0xe6ba[_0x1c13a9];return _0x3a3da7;};'use strict';var _=require(_0xae6b('0x0'));var util=require(_0xae6b('0x1'));var logger=require(_0xae6b('0x2'))(_0xae6b('0x3'));var moment=require(_0xae6b('0x4'));var BPromise=require(_0xae6b('0x5'));var rp=require(_0xae6b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae6b('0x7'));var config=require(_0xae6b('0x8'));var attributes=require('./license.attributes');module[_0xae6b('0x9')]=function(_0x463bbb,_0x2dd853){return _0x463bbb[_0xae6b('0xa')](_0xae6b('0xb'),attributes,{'tableName':_0xae6b('0xc'),'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 7885f46..ebda041 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 _0x03ad=['../../mysqldb','../../config/environment','jayson/promise','client','http','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x30853f,_0x4aa320){var _0x3c416d=function(_0x15d3d2){while(--_0x15d3d2){_0x30853f['push'](_0x30853f['shift']());}};_0x3c416d(++_0x4aa320);}(_0x03ad,0x127));var _0xd03a=function(_0x3062cb,_0x44ca12){_0x3062cb=_0x3062cb-0x0;var _0xf29731=_0x03ad[_0x3062cb];return _0xf29731;};'use strict';var _=require('lodash');var util=require(_0xd03a('0x0'));var moment=require(_0xd03a('0x1'));var BPromise=require(_0xd03a('0x2'));var rs=require(_0xd03a('0x3'));var fs=require('fs');var Redis=require(_0xd03a('0x4'));var db=require(_0xd03a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd03a('0x6'));var jayson=require(_0xd03a('0x7'));var client=jayson[_0xd03a('0x8')][_0xd03a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x157cda,_0x4fde3b,_0x5ded07){return new BPromise(function(_0x513419,_0x4021c4){return client['request'](_0x157cda,_0x5ded07)['then'](function(_0x143225){logger[_0xd03a('0xa')]('License,\x20%s,\x20%s',_0x4fde3b,'request\x20sent');logger[_0xd03a('0xb')](_0xd03a('0xc'),_0x4fde3b,'request\x20sent',JSON[_0xd03a('0xd')](_0x143225));if(_0x143225[_0xd03a('0xe')]){if(_0x143225['error'][_0xd03a('0xf')]===0x1f4){logger[_0xd03a('0xe')](_0xd03a('0x10'),_0x4fde3b,_0x143225[_0xd03a('0xe')]['message']);return _0x4021c4(_0x143225[_0xd03a('0xe')][_0xd03a('0x11')]);}logger['error'](_0xd03a('0x10'),_0x4fde3b,_0x143225[_0xd03a('0xe')]['message']);return _0x513419(_0x143225[_0xd03a('0xe')][_0xd03a('0x11')]);}else{logger[_0xd03a('0xa')](_0xd03a('0x10'),_0x4fde3b,_0xd03a('0x12'));_0x513419(_0x143225['result'][_0xd03a('0x11')]);}})[_0xd03a('0x13')](function(_0xd121bd){logger[_0xd03a('0xe')](_0xd03a('0x10'),_0x4fde3b,_0xd121bd);_0x4021c4(_0xd121bd);});});} \ No newline at end of file +var _0xfedc=['moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x537596,_0x1cd439){var _0x10b3b0=function(_0x233d88){while(--_0x233d88){_0x537596['push'](_0x537596['shift']());}};_0x10b3b0(++_0x1cd439);}(_0xfedc,0x174));var _0xcfed=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xfedc[_0x235482];return _0x5f5bea;};'use strict';var _=require(_0xcfed('0x0'));var util=require(_0xcfed('0x1'));var moment=require(_0xcfed('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(_0xcfed('0x3'));var logger=require(_0xcfed('0x4'))(_0xcfed('0x5'));var config=require(_0xcfed('0x6'));var jayson=require(_0xcfed('0x7'));var client=jayson[_0xcfed('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x165c63,_0x2362d4,_0x4fa30e){return new BPromise(function(_0x2bf465,_0x59192b){return client[_0xcfed('0x9')](_0x165c63,_0x4fa30e)[_0xcfed('0xa')](function(_0xd65b42){logger[_0xcfed('0xb')](_0xcfed('0xc'),_0x2362d4,_0xcfed('0xd'));logger[_0xcfed('0xe')](_0xcfed('0xf'),_0x2362d4,_0xcfed('0xd'),JSON[_0xcfed('0x10')](_0xd65b42));if(_0xd65b42[_0xcfed('0x11')]){if(_0xd65b42[_0xcfed('0x11')][_0xcfed('0x12')]===0x1f4){logger[_0xcfed('0x11')](_0xcfed('0xc'),_0x2362d4,_0xd65b42['error'][_0xcfed('0x13')]);return _0x59192b(_0xd65b42[_0xcfed('0x11')]['message']);}logger[_0xcfed('0x11')](_0xcfed('0xc'),_0x2362d4,_0xd65b42['error'][_0xcfed('0x13')]);return _0x2bf465(_0xd65b42['error'][_0xcfed('0x13')]);}else{logger[_0xcfed('0xb')](_0xcfed('0xc'),_0x2362d4,_0xcfed('0xd'));_0x2bf465(_0xd65b42[_0xcfed('0x14')][_0xcfed('0x13')]);}})[_0xcfed('0x15')](function(_0x50a228){logger[_0xcfed('0x11')](_0xcfed('0xc'),_0x2362d4,_0x50a228);_0x59192b(_0x50a228);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index c8f3c5f..9d72bae 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 _0x2a87=['/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','create','addImap','addInteraction','addApplications','/:id/send','send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index'];(function(_0xa2d95a,_0x3ebdaf){var _0x36767f=function(_0x1035fc){while(--_0x1035fc){_0xa2d95a['push'](_0xa2d95a['shift']());}};_0x36767f(++_0x3ebdaf);}(_0x2a87,0x16e));var _0x72a8=function(_0x4d30c0,_0x3a0ae7){_0x4d30c0=_0x4d30c0-0x0;var _0x5b0c2e=_0x2a87[_0x4d30c0];return _0x5b0c2e;};'use strict';var multer=require('multer');var util=require(_0x72a8('0x0'));var path=require(_0x72a8('0x1'));var timeout=require(_0x72a8('0x2'));var express=require(_0x72a8('0x3'));var router=express[_0x72a8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x72a8('0x5'));var config=require(_0x72a8('0x6'));var controller=require(_0x72a8('0x7'));router[_0x72a8('0x8')]('/',auth['isAuthenticated'](),controller[_0x72a8('0x9')]);router[_0x72a8('0x8')](_0x72a8('0xa'),auth[_0x72a8('0xb')](),controller['describe']);router[_0x72a8('0x8')](_0x72a8('0xc'),auth[_0x72a8('0xb')](),controller[_0x72a8('0xd')]);router[_0x72a8('0x8')](_0x72a8('0xe'),auth['isAuthenticated'](),controller[_0x72a8('0xf')]);router[_0x72a8('0x8')](_0x72a8('0x10'),auth[_0x72a8('0xb')](),controller['getAnswers']);router[_0x72a8('0x8')](_0x72a8('0x11'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x12')]);router[_0x72a8('0x8')](_0x72a8('0x13'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x14')]);router[_0x72a8('0x8')](_0x72a8('0x15'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x16')]);router[_0x72a8('0x8')](_0x72a8('0x17'),auth[_0x72a8('0xb')](),controller['getApplications']);router['get'](_0x72a8('0x18'),auth[_0x72a8('0xb')](),controller['getMessages']);router['get'](_0x72a8('0x19'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x1a')]);router[_0x72a8('0x8')](_0x72a8('0x1b'),auth['isAuthenticated'](),controller[_0x72a8('0x1c')]);router['post'](_0x72a8('0xe'),auth[_0x72a8('0xb')](),controller['addDisposition']);router[_0x72a8('0x1d')](_0x72a8('0x10'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x1e')]);router[_0x72a8('0x1d')]('/',auth[_0x72a8('0xb')](),controller[_0x72a8('0x1f')]);router[_0x72a8('0x1d')](_0x72a8('0x11'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x20')]);router[_0x72a8('0x1d')](_0x72a8('0x13'),auth[_0x72a8('0xb')](),controller['addSmtp']);router[_0x72a8('0x1d')](_0x72a8('0x15'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x21')]);router[_0x72a8('0x1d')]('/:id/applications',auth[_0x72a8('0xb')](),controller[_0x72a8('0x22')]);router[_0x72a8('0x1d')](_0x72a8('0x23'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x24')]);router['post']('/:id/users',auth[_0x72a8('0xb')](),controller[_0x72a8('0x25')]);router[_0x72a8('0x26')](_0x72a8('0xc'),auth[_0x72a8('0xb')](),controller['update']);router[_0x72a8('0x27')](_0x72a8('0xe'),auth['isAuthenticated'](),controller[_0x72a8('0x28')]);router[_0x72a8('0x27')]('/:id/canned_answers',auth[_0x72a8('0xb')](),controller[_0x72a8('0x29')]);router[_0x72a8('0x27')](_0x72a8('0x11'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x2a')]);router[_0x72a8('0x27')](_0x72a8('0x13'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x2b')]);router[_0x72a8('0x27')](_0x72a8('0xc'),auth[_0x72a8('0xb')](),controller[_0x72a8('0x2c')]);router[_0x72a8('0x27')](_0x72a8('0x1b'),auth['isAuthenticated'](),controller[_0x72a8('0x2d')]);module[_0x72a8('0x2e')]=router; \ No newline at end of file +var _0xbed8=['addImap','addSmtp','addApplications','/:id/users','addAgents','put','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addDisposition','addAnswer','create'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xbed8,0x1c4));var _0x8bed=function(_0x1d116b,_0x4924ec){_0x1d116b=_0x1d116b-0x0;var _0x13db0c=_0xbed8[_0x1d116b];return _0x13db0c;};'use strict';var multer=require('multer');var util=require(_0x8bed('0x0'));var path=require(_0x8bed('0x1'));var timeout=require(_0x8bed('0x2'));var express=require('express');var router=express[_0x8bed('0x3')]();var fs_extra=require(_0x8bed('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8bed('0x5'));var config=require(_0x8bed('0x6'));var controller=require(_0x8bed('0x7'));router[_0x8bed('0x8')]('/',auth[_0x8bed('0x9')](),controller[_0x8bed('0xa')]);router[_0x8bed('0x8')](_0x8bed('0xb'),auth[_0x8bed('0x9')](),controller[_0x8bed('0xc')]);router[_0x8bed('0x8')](_0x8bed('0xd'),auth['isAuthenticated'](),controller[_0x8bed('0xe')]);router[_0x8bed('0x8')](_0x8bed('0xf'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x10')]);router[_0x8bed('0x8')](_0x8bed('0x11'),auth['isAuthenticated'](),controller[_0x8bed('0x12')]);router[_0x8bed('0x8')](_0x8bed('0x13'),auth[_0x8bed('0x9')](),controller['getImap']);router[_0x8bed('0x8')](_0x8bed('0x14'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x15')]);router['get'](_0x8bed('0x16'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x17')]);router[_0x8bed('0x8')]('/:id/applications',auth[_0x8bed('0x9')](),controller['getApplications']);router[_0x8bed('0x8')](_0x8bed('0x18'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x19')]);router[_0x8bed('0x8')](_0x8bed('0x1a'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x1b')]);router[_0x8bed('0x8')]('/:id/users',auth[_0x8bed('0x9')](),controller['getAgents']);router[_0x8bed('0x1c')](_0x8bed('0xf'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x1d')]);router[_0x8bed('0x1c')](_0x8bed('0x11'),auth['isAuthenticated'](),controller[_0x8bed('0x1e')]);router[_0x8bed('0x1c')]('/',auth[_0x8bed('0x9')](),controller[_0x8bed('0x1f')]);router[_0x8bed('0x1c')](_0x8bed('0x13'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x20')]);router[_0x8bed('0x1c')](_0x8bed('0x14'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x21')]);router[_0x8bed('0x1c')]('/:id/interactions',auth[_0x8bed('0x9')](),controller['addInteraction']);router[_0x8bed('0x1c')]('/:id/applications',auth[_0x8bed('0x9')](),controller[_0x8bed('0x22')]);router[_0x8bed('0x1c')]('/:id/send',auth[_0x8bed('0x9')](),controller['send']);router['post'](_0x8bed('0x23'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x24')]);router[_0x8bed('0x25')](_0x8bed('0xd'),auth[_0x8bed('0x9')](),controller['update']);router[_0x8bed('0x26')](_0x8bed('0xf'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x27')]);router[_0x8bed('0x26')](_0x8bed('0x11'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x28')]);router[_0x8bed('0x26')](_0x8bed('0x13'),auth[_0x8bed('0x9')](),controller['removeImap']);router[_0x8bed('0x26')](_0x8bed('0x14'),auth[_0x8bed('0x9')](),controller[_0x8bed('0x29')]);router[_0x8bed('0x26')](_0x8bed('0xd'),auth['isAuthenticated'](),controller[_0x8bed('0x2a')]);router['delete'](_0x8bed('0x23'),auth['isAuthenticated'](),controller[_0x8bed('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 6c88d1d..1b98098 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 _0x1278=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1278,0x100));var _0x8127=function(_0x5c55dd,_0x3cd260){_0x5c55dd=_0x5c55dd-0x0;var _0x3521fc=_0x1278[_0x5c55dd];return _0x3521fc;};'use strict';var Sequelize=require(_0x8127('0x0'));module[_0x8127('0x1')]={'description':{'type':Sequelize[_0x8127('0x2')]},'name':{'type':Sequelize[_0x8127('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x8127('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8127('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x8127('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8127('0x2')],'allowNull':![],'defaultValue':_0x8127('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x8127('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8127('0x4')],'defaultValue':function(){return _0x8127('0x7');}},'notificationSound':{'type':Sequelize[_0x8127('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8127('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8127('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8127('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8127('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8127('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8127('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x8127('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x8127('0x3')],'defaultValue':![],'comment':_0x8127('0xa'),'set':function(_0x322c86){if(!_0x322c86)this['setDataValue'](_0x8127('0xb'),null);this['setDataValue'](_0x8127('0xc'),_0x322c86);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x8127('0xd'),_0x8127('0xe'),_0x8127('0xf')),'defaultValue':null,'get':function(){if(!this[_0x8127('0x10')](_0x8127('0x11')))return _0x8127('0x12');return this[_0x8127('0x10')](_0x8127('0x11'));},'set':function(_0x3a54c9){if(_0x3a54c9===_0x8127('0x12'))_0x3a54c9=null;return this['setDataValue']('provider',_0x3a54c9);}}}; \ No newline at end of file +var _0x5fb6=['INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fb6,0x1c6));var _0x65fb=function(_0x16d722,_0x5e7bd6){_0x16d722=_0x16d722-0x0;var _0x254536=_0x5fb6[_0x16d722];return _0x254536;};'use strict';var Sequelize=require(_0x65fb('0x0'));module[_0x65fb('0x1')]={'description':{'type':Sequelize[_0x65fb('0x2')]},'name':{'type':Sequelize[_0x65fb('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x65fb('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x65fb('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x65fb('0x4')]},'markAsUnread':{'type':Sequelize[_0x65fb('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x65fb('0x2')],'allowNull':![],'defaultValue':_0x65fb('0x5')},'fontSize':{'type':Sequelize[_0x65fb('0x6')](0x2)[_0x65fb('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x65fb('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x65fb('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x65fb('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x65fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x65fb('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x65fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x65fb('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x65fb('0x3')],'defaultValue':![],'comment':_0x65fb('0x9'),'set':function(_0x3cc773){if(!_0x3cc773)this[_0x65fb('0xa')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x65fb('0xb'),_0x3cc773);}},'provider':{'type':Sequelize[_0x65fb('0xc')](_0x65fb('0xd'),_0x65fb('0xe'),_0x65fb('0xf'),_0x65fb('0x10')),'defaultValue':null,'get':function(){if(!this[_0x65fb('0x11')]('provider'))return _0x65fb('0x12');return this['getDataValue'](_0x65fb('0x13'));},'set':function(_0x55edf2){if(_0x55edf2===_0x65fb('0x12'))_0x55edf2=null;return this[_0x65fb('0xa')](_0x65fb('0x13'),_0x55edf2);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 338ef5d..41448f6 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 _0x90e3=['MailAccountId','Disposition','create','order','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','email','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','finally','getApplications','MailMessage','rawAttributes','$gte','split','format','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','undefined','limit','count','update','get','MailAccounts','destroy','sendStatus','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','Unknown\x20email\x20service\x20provider','gmail','smtp.mail.yahoo.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','Pause','mandatoryDispositionPause','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','where','pick','merge','type','VIRTUAL','filter','rows','show','params','MailServerIn','MailServerOut','MailAccount','length','includeAll','options','body','provider','custom','find','Mail\x20Account\x20not\x20found','describe'];(function(_0x5d5177,_0x24d3c8){var _0x195c11=function(_0x5e4f32){while(--_0x5e4f32){_0x5d5177['push'](_0x5d5177['shift']());}};_0x195c11(++_0x24d3c8);}(_0x90e3,0x11b));var _0x390e=function(_0x1d9d12,_0x2c7d98){_0x1d9d12=_0x1d9d12-0x0;var _0x4f680e=_0x90e3[_0x1d9d12];return _0x4f680e;};'use strict';var moment=require(_0x390e('0x0'));var BPromise=require(_0x390e('0x1'));var util=require('util');var path=require(_0x390e('0x2'));var _=require(_0x390e('0x3'));var juice=require('juice');var Redis=require(_0x390e('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x390e('0x5'));var config=require(_0x390e('0x6'));var db=require(_0x390e('0x7'))['db'];config[_0x390e('0x8')]=_[_0x390e('0x9')](config['redis'],{'host':_0x390e('0xa'),'port':0x18eb});var socket=require(_0x390e('0xb'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x390e('0xc')](socket);var jayson=require(_0x390e('0xd'));var client=jayson[_0x390e('0xe')][_0x390e('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x5865e9,_0x5ed6dd,_0x294776,_0x2c08a5){return new BPromise(function(_0x1b76f4,_0x8eab35){var _0x4e7ce5=_0x2c08a5||client;return _0x4e7ce5['request'](_0x5865e9,_0x294776)[_0x390e('0x10')](function(_0x35af34){logger[_0x390e('0x11')](_0x390e('0x12'),_0x5ed6dd,_0x390e('0x13'));logger[_0x390e('0x14')](_0x390e('0x15'),_0x5ed6dd,_0x390e('0x13'),JSON[_0x390e('0x16')](_0x35af34));if(_0x35af34[_0x390e('0x17')]){if(_0x35af34['error']['code']===0x1f4){logger[_0x390e('0x17')](_0x390e('0x12'),_0x5ed6dd,_0x35af34[_0x390e('0x17')][_0x390e('0x18')]);return _0x8eab35(_0x35af34['error'][_0x390e('0x18')]);}logger[_0x390e('0x17')]('MailAccount,\x20%s,\x20%s',_0x5ed6dd,_0x35af34[_0x390e('0x17')][_0x390e('0x18')]);return _0x1b76f4(_0x35af34[_0x390e('0x17')][_0x390e('0x18')]);}else{logger[_0x390e('0x11')](_0x390e('0x12'),_0x5ed6dd,_0x390e('0x13'));_0x1b76f4(_0x35af34[_0x390e('0x19')][_0x390e('0x18')]);}})[_0x390e('0x1a')](function(_0x411227){logger[_0x390e('0x17')](_0x390e('0x12'),_0x5ed6dd,_0x411227);_0x8eab35(_0x411227);});});}function respondWithStatusCode(_0x579cf3,_0x44c0ef){_0x44c0ef=_0x44c0ef||0xcc;return function(_0x2919d9){if(_0x2919d9){return _0x579cf3['sendStatus'](_0x44c0ef);}return _0x579cf3[_0x390e('0x1b')](_0x44c0ef)[_0x390e('0x1c')]();};}function respondWithResult(_0x282c37,_0x13aed5){_0x13aed5=_0x13aed5||0xc8;return function(_0x4b4a0a){if(_0x4b4a0a){return _0x282c37['status'](_0x13aed5)[_0x390e('0x1d')](_0x4b4a0a);}};}function respondWithFilteredResult(_0x1b39b8,_0x4bbf81){return function(_0x1f1b45){if(_0x1f1b45){var _0x20b700=typeof _0x4bbf81['offset']===_0x390e('0x1e')&&typeof _0x4bbf81[_0x390e('0x1f')]==='undefined';var _0x3e9b5f=_0x1f1b45[_0x390e('0x20')];var _0x34734c=_0x20b700?0x0:_0x4bbf81['offset'];var _0x4edd12=_0x20b700?_0x1f1b45[_0x390e('0x20')]:_0x4bbf81['offset']+_0x4bbf81['limit'];var _0x52615a;if(_0x4edd12>=_0x3e9b5f){_0x4edd12=_0x3e9b5f;_0x52615a=0xc8;}else{_0x52615a=0xce;}_0x1b39b8[_0x390e('0x1b')](_0x52615a);return _0x1b39b8['set']('Content-Range',_0x34734c+'-'+_0x4edd12+'/'+_0x3e9b5f)[_0x390e('0x1d')](_0x1f1b45);}return null;};}function saveUpdates(_0x2915c9){return function(_0x27d896){if(_0x27d896){return _0x27d896[_0x390e('0x21')](_0x2915c9)[_0x390e('0x10')](function(_0x3ca23d){return _0x3ca23d;});}return null;};}function removeEntity(_0x26f2b8){return function(_0x547879){if(_0x547879){return _0x547879['destroy']()[_0x390e('0x10')](function(){var _0x238889=_0x547879[_0x390e('0x22')]({'plain':!![]});var _0x3483e7=_0x390e('0x23');return db['UserProfileResource'][_0x390e('0x24')]({'where':{'type':_0x3483e7,'resourceId':_0x238889['id']}})[_0x390e('0x10')](function(){return _0x547879;});})['then'](function(){_0x26f2b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a0fac){return function(_0xf7521e){if(!_0xf7521e){_0x5a0fac[_0x390e('0x25')](0x194);}return _0xf7521e;};}function handleError(_0x124cca,_0x4af245){_0x4af245=_0x4af245||0x1f4;return function(_0xcbde83){logger[_0x390e('0x17')](_0xcbde83[_0x390e('0x26')]);if(_0xcbde83[_0x390e('0x27')]){delete _0xcbde83[_0x390e('0x27')];}_0x124cca[_0x390e('0x1b')](_0x4af245)[_0x390e('0x28')](_0xcbde83);};}function getImapHost(_0x2ed0db){switch(_0x2ed0db){case'gmail':return _0x390e('0x29');case _0x390e('0x2a'):return _0x390e('0x2b');case _0x390e('0x2c'):return'imap-mail.outlook.com';case _0x390e('0x2d'):return'outlook.office365.com';}throw new Error(_0x390e('0x2e'),_0x2ed0db);}function getSmtpHost(_0x6b653c){switch(_0x6b653c){case _0x390e('0x2f'):return'smtp.gmail.com';case _0x390e('0x2a'):return _0x390e('0x30');case _0x390e('0x2c'):return'smtp-mail.outlook.com';case _0x390e('0x2d'):return _0x390e('0x31');}throw new Error('Unknown\x20email\x20service\x20provider',_0x6b653c);}function getAuthenticationOptions(_0x349376,_0x1e9e26){var _0x4c429f={};var _0x4479cc={};if(_0x349376){_0x4c429f['user']=_0x4479cc[_0x390e('0x32')]=_0x1e9e26[_0x390e('0x33')];_0x4c429f[_0x390e('0x34')]=_0x4479cc[_0x390e('0x35')]=_0x1e9e26[_0x390e('0x34')];if(_0x1e9e26[_0x390e('0x36')]){_0x4c429f[_0x390e('0x36')]=_0x4479cc[_0x390e('0x36')]=!![];_0x4c429f[_0x390e('0x37')]=_0x4479cc[_0x390e('0x37')]=_0x1e9e26[_0x390e('0x37')];_0x4c429f[_0x390e('0x34')]=_0x4479cc[_0x390e('0x35')]=null;}else{_0x4c429f[_0x390e('0x37')]=_0x4479cc[_0x390e('0x37')]=null;}_0x4c429f[_0x390e('0x38')]=getImapHost(_0x349376);_0x4c429f[_0x390e('0x39')]=0x3e1;_0x4479cc[_0x390e('0x38')]=getSmtpHost(_0x349376);_0x4479cc[_0x390e('0x39')]=0x24b;_0x4479cc[_0x390e('0x3a')]=![];_0x4c429f[_0x390e('0x3b')]=_0x4479cc[_0x390e('0x3b')]=null;}else{if(_0x1e9e26[_0x390e('0x3c')]){_0x4c429f['user']=_0x4479cc[_0x390e('0x32')]=_0x1e9e26[_0x390e('0x33')];_0x4c429f[_0x390e('0x34')]=_0x4479cc['pass']=_0x1e9e26[_0x390e('0x34')];}else{_0x4c429f['authentication']=_0x4479cc['authentication']=![];_0x4c429f['user']=_0x4479cc[_0x390e('0x32')]=null;_0x4c429f['password']=_0x4479cc[_0x390e('0x35')]=null;}_0x4c429f['host']=_0x1e9e26['Imap'][_0x390e('0x38')];_0x4c429f[_0x390e('0x39')]=_0x1e9e26[_0x390e('0x3d')]['port'];_0x4479cc[_0x390e('0x38')]=_0x1e9e26[_0x390e('0x3e')][_0x390e('0x38')];_0x4479cc[_0x390e('0x39')]=_0x1e9e26[_0x390e('0x3e')]['port'];}return{'Imap':_0x4c429f,'Smtp':_0x4479cc};}exports[_0x390e('0x3f')]=function(_0x584419,_0x206fe6){var _0x24bfad={'include':[{'model':db['MailServerIn'],'as':_0x390e('0x3d')},{'model':db['MailServerOut'],'as':_0x390e('0x3e')},{'model':db[_0x390e('0x40')],'as':_0x390e('0x41')}]},_0xaf163b={},_0x5a30ec={'count':0x0,'rows':[]};var _0x456e04=_[_0x390e('0x42')](db['MailAccount']['rawAttributes'],function(_0x56e71e){return{'name':_0x56e71e[_0x390e('0x43')],'type':_0x56e71e['type'][_0x390e('0x44')]};});_0xaf163b[_0x390e('0x45')]=_[_0x390e('0x42')](_0x456e04,'name');_0xaf163b[_0x390e('0x46')]=_[_0x390e('0x47')](_0x584419[_0x390e('0x46')]);_0xaf163b[_0x390e('0x48')]=_['intersection'](_0xaf163b[_0x390e('0x45')],_0xaf163b[_0x390e('0x46')]);_0x24bfad[_0x390e('0x49')]=_[_0x390e('0x4a')](_0xaf163b['model'],qs[_0x390e('0x4b')](_0x584419[_0x390e('0x46')]['fields']));_0x24bfad[_0x390e('0x49')]=_0x24bfad[_0x390e('0x49')]['length']?_0x24bfad['attributes']:_0xaf163b[_0x390e('0x45')];if(!_0x584419[_0x390e('0x46')][_0x390e('0x4c')](_0x390e('0x4d'))){_0x24bfad['limit']=qs[_0x390e('0x1f')](_0x584419[_0x390e('0x46')]['limit']);_0x24bfad[_0x390e('0x4e')]=qs[_0x390e('0x4e')](_0x584419[_0x390e('0x46')][_0x390e('0x4e')]);}_0x24bfad['order']=qs[_0x390e('0x4f')](_0x584419[_0x390e('0x46')][_0x390e('0x4f')]);_0x24bfad[_0x390e('0x50')]=qs[_0x390e('0x48')](_[_0x390e('0x51')](_0x584419[_0x390e('0x46')],_0xaf163b[_0x390e('0x48')]),_0x456e04);if(_0x584419['query']['filter']){_0x24bfad[_0x390e('0x50')]=_[_0x390e('0x52')](_0x24bfad[_0x390e('0x50')],{'$or':_[_0x390e('0x42')](_0x456e04,function(_0x14b2ab){if(_0x14b2ab[_0x390e('0x53')]!==_0x390e('0x54')){var _0x404213={};_0x404213[_0x14b2ab[_0x390e('0x27')]]={'$like':'%'+_0x584419[_0x390e('0x46')][_0x390e('0x55')]+'%'};return _0x404213;}})});}_0x24bfad=_['merge']({},_0x24bfad,_0x584419['options']);var _0x2fe64c={'where':_0x24bfad[_0x390e('0x50')]};return db['MailAccount'][_0x390e('0x20')](_0x2fe64c)[_0x390e('0x10')](function(_0x4f5c1d){_0x5a30ec['count']=_0x4f5c1d;if(_0x584419[_0x390e('0x46')]['includeAll']){_0x24bfad['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x24bfad);})[_0x390e('0x10')](function(_0x4c0e59){_0x5a30ec[_0x390e('0x56')]=_0x4c0e59;return _0x5a30ec;})[_0x390e('0x10')](respondWithFilteredResult(_0x206fe6,_0x24bfad))['catch'](handleError(_0x206fe6,null));};exports[_0x390e('0x57')]=function(_0x3e517b,_0x2ebadb){var _0x4c0fe0={'raw':![],'where':{'id':_0x3e517b[_0x390e('0x58')]['id']},'include':[{'model':db[_0x390e('0x59')],'as':_0x390e('0x3d')},{'model':db[_0x390e('0x5a')],'as':_0x390e('0x3e')},{'model':db[_0x390e('0x40')],'as':_0x390e('0x41')}]},_0x375898={};_0x375898[_0x390e('0x45')]=_[_0x390e('0x47')](db[_0x390e('0x5b')]['rawAttributes']);_0x375898[_0x390e('0x46')]=_[_0x390e('0x47')](_0x3e517b['query']);_0x375898[_0x390e('0x48')]=_['intersection'](_0x375898[_0x390e('0x45')],_0x375898[_0x390e('0x46')]);_0x4c0fe0[_0x390e('0x49')]=_[_0x390e('0x4a')](_0x375898['model'],qs[_0x390e('0x4b')](_0x3e517b[_0x390e('0x46')][_0x390e('0x4b')]));_0x4c0fe0[_0x390e('0x49')]=_0x4c0fe0[_0x390e('0x49')][_0x390e('0x5c')]?_0x4c0fe0[_0x390e('0x49')]:_0x375898['model'];if(_0x3e517b[_0x390e('0x46')][_0x390e('0x5d')]){_0x4c0fe0['include']=[{'all':!![]}];}_0x4c0fe0=_[_0x390e('0x52')]({},_0x4c0fe0,_0x3e517b[_0x390e('0x5e')]);return db['MailAccount']['find'](_0x4c0fe0)['then'](handleEntityNotFound(_0x2ebadb,null))['then'](respondWithResult(_0x2ebadb,null))[_0x390e('0x1a')](handleError(_0x2ebadb,null));};exports[_0x390e('0x21')]=function(_0x2ba578,_0x17af39){if(_0x2ba578[_0x390e('0x5f')]['id']){delete _0x2ba578[_0x390e('0x5f')]['id'];}var _0x45e996=_0x2ba578[_0x390e('0x5f')][_0x390e('0x60')]===_0x390e('0x61')?null:_0x2ba578[_0x390e('0x5f')]['provider'];var _0x4012a1=_0x2ba578[_0x390e('0x5f')]['Imap']||{};var _0x414b8e=_0x2ba578[_0x390e('0x5f')][_0x390e('0x3e')]||{};if(_0x45e996){_0x4012a1[_0x390e('0x38')]=getImapHost(_0x45e996);_0x4012a1[_0x390e('0x39')]=0x3e1;_0x414b8e['host']=getSmtpHost(_0x45e996);_0x414b8e[_0x390e('0x39')]=0x24b;_0x414b8e['secure']=![];}if(_0x414b8e[_0x390e('0x36')]){_0x414b8e[_0x390e('0x3a')]=![];}else{_0x414b8e[_0x390e('0x37')]=null;}if(!_0x4012a1[_0x390e('0x36')])_0x4012a1[_0x390e('0x37')]=null;_0x2ba578['body'][_0x390e('0x3d')]=_0x4012a1;_0x2ba578[_0x390e('0x5f')][_0x390e('0x3e')]=_0x414b8e;return db[_0x390e('0x5b')][_0x390e('0x62')]({'where':{'id':_0x2ba578[_0x390e('0x58')]['id']},'include':[{'model':db[_0x390e('0x59')],'as':'Imap'},{'model':db[_0x390e('0x5a')],'as':_0x390e('0x3e')},{'model':db[_0x390e('0x40')],'as':_0x390e('0x41')}]})[_0x390e('0x10')](handleEntityNotFound(_0x17af39,null))[_0x390e('0x10')](function(_0x58b64e){if(!_0x58b64e)throw new Error(_0x390e('0x63'));if(_0x58b64e[_0x390e('0x3b')])delete _0x2ba578[_0x390e('0x5f')][_0x390e('0x3d')];return _0x58b64e;})[_0x390e('0x10')](saveUpdates(_0x2ba578[_0x390e('0x5f')],null))[_0x390e('0x10')](function(_0x2dea57){if(!_0x2ba578[_0x390e('0x5f')]['Imap'])return _0x2dea57;return db[_0x390e('0x59')][_0x390e('0x21')](_0x2ba578['body'][_0x390e('0x3d')],{'where':{'MailAccountId':_0x2dea57['id']}})[_0x390e('0x10')](function(){return _0x2dea57;});})[_0x390e('0x10')](function(_0x1fb04e){if(!_0x2ba578[_0x390e('0x5f')][_0x390e('0x3e')])return _0x1fb04e;return db[_0x390e('0x5a')][_0x390e('0x21')](_0x2ba578[_0x390e('0x5f')]['Smtp'],{'where':{'MailAccountId':_0x1fb04e['id']}})[_0x390e('0x10')](function(){return _0x1fb04e;});})[_0x390e('0x10')](respondWithResult(_0x17af39,null))['catch'](handleError(_0x17af39,null));};exports[_0x390e('0x64')]=function(_0x551d0f,_0x4709b4){return db[_0x390e('0x5b')][_0x390e('0x64')]()[_0x390e('0x10')](respondWithResult(_0x4709b4,null))[_0x390e('0x1a')](handleError(_0x4709b4,null));};exports['addDisposition']=function(_0x245ec3,_0x5bd401){if(_0x245ec3[_0x390e('0x5f')]['id']){delete _0x245ec3[_0x390e('0x5f')]['id'];}return db[_0x390e('0x5b')]['find']({'where':{'id':_0x245ec3[_0x390e('0x58')]['id']}})['then'](handleEntityNotFound(_0x5bd401,null))[_0x390e('0x10')](function(_0x599ba8){if(_0x599ba8){_0x245ec3[_0x390e('0x5f')][_0x390e('0x65')]=_0x599ba8['id'];return db[_0x390e('0x66')][_0x390e('0x67')](_0x245ec3[_0x390e('0x5f')]);}})[_0x390e('0x10')](respondWithResult(_0x5bd401,null))[_0x390e('0x1a')](handleError(_0x5bd401,null));};exports['getDispositions']=function(_0x8caef,_0x15bbda){var _0x2b31ba={'raw':![],'where':{}};var _0xb9681b={};var _0x415541={'count':0x0,'rows':[]};return db[_0x390e('0x5b')]['findOne']({'where':{'id':_0x8caef[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x15bbda,null))[_0x390e('0x10')](function(_0x3c0139){if(_0x3c0139){_0xb9681b[_0x390e('0x45')]=_[_0x390e('0x47')](db[_0x390e('0x66')]['rawAttributes']);_0xb9681b['query']=_[_0x390e('0x47')](_0x8caef[_0x390e('0x46')]);_0xb9681b[_0x390e('0x48')]=_[_0x390e('0x4a')](_0xb9681b['model'],_0xb9681b[_0x390e('0x46')]);_0x2b31ba['attributes']=_[_0x390e('0x4a')](_0xb9681b[_0x390e('0x45')],qs[_0x390e('0x4b')](_0x8caef[_0x390e('0x46')][_0x390e('0x4b')]));_0x2b31ba[_0x390e('0x49')]=_0x2b31ba['attributes'][_0x390e('0x5c')]?_0x2b31ba[_0x390e('0x49')]:_0xb9681b['model'];if(!_0x8caef[_0x390e('0x46')][_0x390e('0x4c')]('nolimit')){_0x2b31ba['limit']=qs['limit'](_0x8caef['query'][_0x390e('0x1f')]);_0x2b31ba['offset']=qs[_0x390e('0x4e')](_0x8caef['query'][_0x390e('0x4e')]);}_0x2b31ba[_0x390e('0x68')]=qs[_0x390e('0x4f')](_0x8caef['query'][_0x390e('0x4f')]);_0x2b31ba[_0x390e('0x50')]=qs['filters'](_[_0x390e('0x51')](_0x8caef['query'],_0xb9681b[_0x390e('0x48')]));_0x2b31ba[_0x390e('0x50')][_0x390e('0x65')]=_0x3c0139['id'];if(_0x8caef[_0x390e('0x46')][_0x390e('0x55')]){_0x2b31ba[_0x390e('0x50')]=_[_0x390e('0x52')](_0x2b31ba[_0x390e('0x50')],{'$or':_['map'](_0x2b31ba[_0x390e('0x49')],function(_0x546801){var _0x485148={};_0x485148[_0x546801]={'$like':'%'+_0x8caef[_0x390e('0x46')][_0x390e('0x55')]+'%'};return _0x485148;})});}_0x2b31ba=_[_0x390e('0x52')]({},_0x2b31ba,_0x8caef[_0x390e('0x5e')]);return db[_0x390e('0x66')]['count']({'where':_0x2b31ba[_0x390e('0x50')]})[_0x390e('0x10')](function(_0x15c3e2){_0x415541['count']=_0x15c3e2;if(_0x8caef['query'][_0x390e('0x5d')]){_0x2b31ba[_0x390e('0x69')]=[{'all':!![]}];}return db[_0x390e('0x66')]['findAll'](_0x2b31ba);})[_0x390e('0x10')](function(_0xb72b33){_0x415541[_0x390e('0x56')]=_0xb72b33;return _0x415541;});}})[_0x390e('0x10')](respondWithFilteredResult(_0x15bbda,_0x2b31ba))['catch'](handleError(_0x15bbda,null));};exports[_0x390e('0x6a')]=function(_0x5dc7de,_0x4b25fc){return db['MailAccount'][_0x390e('0x62')]({'where':{'id':_0x5dc7de['params']['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x4b25fc,null))[_0x390e('0x10')](function(_0x36d59d){if(_0x36d59d){return _0x36d59d[_0x390e('0x6a')](_0x5dc7de[_0x390e('0x46')][_0x390e('0x6b')]);}})[_0x390e('0x10')](respondWithStatusCode(_0x4b25fc,null))[_0x390e('0x1a')](handleError(_0x4b25fc,null));};exports[_0x390e('0x6c')]=function(_0x1a111c,_0x2bd872){if(_0x1a111c[_0x390e('0x5f')]['id']){delete _0x1a111c['body']['id'];}return db['MailAccount'][_0x390e('0x62')]({'where':{'id':_0x1a111c['params']['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x2bd872,null))['then'](function(_0x5047a9){if(_0x5047a9){_0x1a111c[_0x390e('0x5f')][_0x390e('0x65')]=_0x5047a9['id'];return db[_0x390e('0x6d')][_0x390e('0x67')](_0x1a111c[_0x390e('0x5f')]);}})[_0x390e('0x10')](respondWithResult(_0x2bd872,null))['catch'](handleError(_0x2bd872,null));};exports[_0x390e('0x6e')]=function(_0x1477eb,_0x5863ad){var _0x12bd5b={'raw':![],'where':{}};var _0x41499={};var _0x2a6da2={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x1477eb[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x5863ad,null))[_0x390e('0x10')](function(_0x38637a){if(_0x38637a){_0x41499[_0x390e('0x45')]=_['keys'](db[_0x390e('0x6d')]['rawAttributes']);_0x41499[_0x390e('0x46')]=_[_0x390e('0x47')](_0x1477eb[_0x390e('0x46')]);_0x41499[_0x390e('0x48')]=_[_0x390e('0x4a')](_0x41499['model'],_0x41499[_0x390e('0x46')]);_0x12bd5b[_0x390e('0x49')]=_['intersection'](_0x41499[_0x390e('0x45')],qs[_0x390e('0x4b')](_0x1477eb['query']['fields']));_0x12bd5b[_0x390e('0x49')]=_0x12bd5b['attributes'][_0x390e('0x5c')]?_0x12bd5b[_0x390e('0x49')]:_0x41499[_0x390e('0x45')];if(!_0x1477eb[_0x390e('0x46')][_0x390e('0x4c')](_0x390e('0x4d'))){_0x12bd5b[_0x390e('0x1f')]=qs['limit'](_0x1477eb[_0x390e('0x46')][_0x390e('0x1f')]);_0x12bd5b[_0x390e('0x4e')]=qs[_0x390e('0x4e')](_0x1477eb[_0x390e('0x46')][_0x390e('0x4e')]);}_0x12bd5b[_0x390e('0x68')]=qs[_0x390e('0x4f')](_0x1477eb['query']['sort']);_0x12bd5b['where']=qs[_0x390e('0x48')](_[_0x390e('0x51')](_0x1477eb[_0x390e('0x46')],_0x41499['filters']));_0x12bd5b['where'][_0x390e('0x65')]=_0x38637a['id'];if(_0x1477eb[_0x390e('0x46')]['filter']){_0x12bd5b[_0x390e('0x50')]=_['merge'](_0x12bd5b[_0x390e('0x50')],{'$or':_[_0x390e('0x42')](_0x12bd5b[_0x390e('0x49')],function(_0x56cb83){var _0x2751b5={};_0x2751b5[_0x56cb83]={'$like':'%'+_0x1477eb['query'][_0x390e('0x55')]+'%'};return _0x2751b5;})});}_0x12bd5b=_[_0x390e('0x52')]({},_0x12bd5b,_0x1477eb['options']);return db[_0x390e('0x6d')][_0x390e('0x20')]({'where':_0x12bd5b[_0x390e('0x50')]})[_0x390e('0x10')](function(_0xf6962c){_0x2a6da2['count']=_0xf6962c;if(_0x1477eb[_0x390e('0x46')]['includeAll']){_0x12bd5b['include']=[{'all':!![]}];}return db[_0x390e('0x6d')][_0x390e('0x6f')](_0x12bd5b);})['then'](function(_0x55b076){_0x2a6da2['rows']=_0x55b076;return _0x2a6da2;});}})[_0x390e('0x10')](respondWithFilteredResult(_0x5863ad,_0x12bd5b))[_0x390e('0x1a')](handleError(_0x5863ad,null));};exports['removeAnswers']=function(_0x2865c9,_0x60653b){return db[_0x390e('0x5b')][_0x390e('0x62')]({'where':{'id':_0x2865c9[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x60653b,null))[_0x390e('0x10')](function(_0x41c09b){if(_0x41c09b){return _0x41c09b[_0x390e('0x70')](_0x2865c9[_0x390e('0x46')][_0x390e('0x6b')]);}})[_0x390e('0x10')](respondWithStatusCode(_0x60653b,null))['catch'](handleError(_0x60653b,null));};exports[_0x390e('0x67')]=function(_0x892cd7,_0x20a0b3){var _0x5c76ff={'name':_0x892cd7[_0x390e('0x5f')][_0x390e('0x27')],'key':_0x892cd7[_0x390e('0x5f')][_0x390e('0x44')],'provider':_0x892cd7['body'][_0x390e('0x60')]===_0x390e('0x61')?null:_0x892cd7[_0x390e('0x5f')]['provider'],'email':_0x892cd7[_0x390e('0x5f')][_0x390e('0x71')],'ListId':_0x892cd7['body']['ListId'],'active':!_[_0x390e('0x72')](_0x892cd7[_0x390e('0x5f')]['active'])?_0x892cd7[_0x390e('0x5f')][_0x390e('0x73')]:!![],'description':_0x892cd7['body']['description']||null};var _0x513b72=getAuthenticationOptions(_0x5c76ff['provider'],_0x892cd7[_0x390e('0x5f')]);_0x5c76ff['Imap']=_0x513b72[_0x390e('0x3d')];_0x5c76ff[_0x390e('0x3e')]=_0x513b72['Smtp'];return db[_0x390e('0x5b')]['create'](_0x5c76ff,{'include':[{'model':db[_0x390e('0x5a')],'as':'Smtp'},{'model':db[_0x390e('0x59')],'as':_0x390e('0x3d')}]})[_0x390e('0x10')](function(_0x368294){var _0x2b7179=_0x892cd7[_0x390e('0x32')][_0x390e('0x22')]({'plain':!![]});if(!_0x2b7179)throw new Error(_0x390e('0x74'));if(_0x2b7179['role']==='user'){var _0x176920=_0x368294['get']({'plain':!![]});return db[_0x390e('0x75')]['find']({'where':{'name':_0x390e('0x23'),'userProfileId':_0x2b7179[_0x390e('0x76')]},'raw':!![]})[_0x390e('0x10')](function(_0x7ceb68){if(_0x7ceb68&&_0x7ceb68['autoAssociation']===0x0){return db[_0x390e('0x77')][_0x390e('0x67')]({'name':_0x176920[_0x390e('0x27')],'resourceId':_0x176920['id'],'type':_0x7ceb68[_0x390e('0x27')],'sectionId':_0x7ceb68['id']},{})[_0x390e('0x10')](function(){return _0x368294;});}else{return _0x368294;}})['catch'](function(_0x22dcbb){logger[_0x390e('0x17')](_0x390e('0x78'),_0x22dcbb);throw _0x22dcbb;});}return _0x368294;})[_0x390e('0x10')](respondWithResult(_0x20a0b3,0xc9))[_0x390e('0x1a')](handleError(_0x20a0b3,null));};exports[_0x390e('0x79')]=function(_0x189359,_0xa1b20b){return db[_0x390e('0x5b')][_0x390e('0x7a')]({'where':{'id':_0x189359[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0xa1b20b,null))[_0x390e('0x10')](function(_0x361039){if(_0x361039){return _0x361039['getImap']();}return null;})[_0x390e('0x10')](respondWithResult(_0xa1b20b,null))[_0x390e('0x1a')](handleError(_0xa1b20b,null));};exports[_0x390e('0x7b')]=function(_0x573749,_0x2277ed){if(_0x573749['body']['id']){delete _0x573749[_0x390e('0x5f')]['id'];}return db[_0x390e('0x5b')][_0x390e('0x62')]({'where':{'id':_0x573749[_0x390e('0x58')]['id']}})['then'](handleEntityNotFound(_0x2277ed,null))['then'](function(_0x46012b){if(_0x46012b){_0x573749[_0x390e('0x5f')][_0x390e('0x65')]=_0x46012b['id'];return db[_0x390e('0x59')][_0x390e('0x67')](_0x573749[_0x390e('0x5f')]);}})[_0x390e('0x10')](respondWithResult(_0x2277ed,null))[_0x390e('0x1a')](handleError(_0x2277ed,null));};exports[_0x390e('0x7c')]=function(_0x54517e,_0x21fc6b){return db[_0x390e('0x5b')]['findOne']({'where':{'id':_0x54517e['params']['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x21fc6b,null))[_0x390e('0x10')](function(_0x4dee9b){if(_0x4dee9b){return _0x4dee9b[_0x390e('0x7d')](null);}return null;})[_0x390e('0x10')](respondWithStatusCode(_0x21fc6b,null))[_0x390e('0x1a')](handleError(_0x21fc6b,null));};exports[_0x390e('0x7e')]=function(_0x245e9d,_0x2bc9ab){return db[_0x390e('0x5b')][_0x390e('0x7a')]({'where':{'id':_0x245e9d[_0x390e('0x58')]['id']}})['then'](handleEntityNotFound(_0x2bc9ab,null))[_0x390e('0x10')](function(_0x50d3d5){if(_0x50d3d5){return _0x50d3d5['getSmtp']();}return null;})[_0x390e('0x10')](respondWithResult(_0x2bc9ab,null))[_0x390e('0x1a')](handleError(_0x2bc9ab,null));};exports[_0x390e('0x7f')]=function(_0xd695b3,_0xfa792d){if(_0xd695b3[_0x390e('0x5f')]['id']){delete _0xd695b3[_0x390e('0x5f')]['id'];}return db['MailAccount'][_0x390e('0x62')]({'where':{'id':_0xd695b3[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0xfa792d,null))[_0x390e('0x10')](function(_0x1c342b){if(_0x1c342b){_0xd695b3['body'][_0x390e('0x65')]=_0x1c342b['id'];return db[_0x390e('0x5a')]['create'](_0xd695b3[_0x390e('0x5f')]);}})[_0x390e('0x10')](respondWithResult(_0xfa792d,null))[_0x390e('0x1a')](handleError(_0xfa792d,null));};exports[_0x390e('0x80')]=function(_0x4665c5,_0x4cfe5c){return db[_0x390e('0x5b')][_0x390e('0x7a')]({'where':{'id':_0x4665c5[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x4cfe5c,null))['then'](function(_0x5bcda0){if(_0x5bcda0){return _0x5bcda0['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x4cfe5c,null))[_0x390e('0x1a')](handleError(_0x4cfe5c,null));};exports['addInteraction']=function(_0x2575fb,_0x2e0996){return db[_0x390e('0x81')][_0x390e('0x62')]({'where':{'id':_0x2575fb['params']['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x2e0996,null))[_0x390e('0x10')](function(_0xd31a){if(_0xd31a){return _0xd31a[_0x390e('0x82')](_0x2575fb['body'][_0x390e('0x6b')],_[_0x390e('0x83')](_0x2575fb[_0x390e('0x5f')],[_0x390e('0x6b'),'id'])||{});}})[_0x390e('0x10')](respondWithResult(_0x2e0996,null))['catch'](handleError(_0x2e0996,null));};exports['getInteractions']=function(_0x485ef8,_0x542272){var _0x5034b1={'raw':![],'where':{}};var _0x2b4684={};var _0x4fdeb5={'count':0x0,'rows':[]};return db['MailAccount'][_0x390e('0x7a')]({'where':{'id':_0x485ef8[_0x390e('0x58')]['id']}})['then'](handleEntityNotFound(_0x542272,null))[_0x390e('0x10')](function(_0x472735){if(_0x472735){_0x2b4684[_0x390e('0x45')]=_[_0x390e('0x47')](db[_0x390e('0x81')]['rawAttributes']);_0x2b4684[_0x390e('0x46')]=_[_0x390e('0x47')](_0x485ef8[_0x390e('0x46')]);_0x2b4684[_0x390e('0x48')]=_[_0x390e('0x4a')](_0x2b4684[_0x390e('0x45')],_0x2b4684['query']);_0x5034b1['attributes']=_['intersection'](_0x2b4684[_0x390e('0x45')],qs['fields'](_0x485ef8[_0x390e('0x46')][_0x390e('0x4b')]));_0x5034b1[_0x390e('0x49')]=_0x5034b1['attributes'][_0x390e('0x5c')]?_0x5034b1[_0x390e('0x49')]:_0x2b4684[_0x390e('0x45')];if(!_0x485ef8['query'][_0x390e('0x4c')](_0x390e('0x4d'))){_0x5034b1[_0x390e('0x1f')]=qs[_0x390e('0x1f')](_0x485ef8[_0x390e('0x46')][_0x390e('0x1f')]);_0x5034b1[_0x390e('0x4e')]=qs[_0x390e('0x4e')](_0x485ef8[_0x390e('0x46')][_0x390e('0x4e')]);}_0x5034b1[_0x390e('0x68')]=qs[_0x390e('0x4f')](_0x485ef8[_0x390e('0x46')][_0x390e('0x4f')]);_0x5034b1[_0x390e('0x50')]=qs['filters'](_['pick'](_0x485ef8[_0x390e('0x46')],_0x2b4684[_0x390e('0x48')]));_0x5034b1[_0x390e('0x50')][_0x390e('0x65')]=_0x472735['id'];if(_0x485ef8[_0x390e('0x46')][_0x390e('0x55')]){_0x5034b1[_0x390e('0x50')]=_['merge'](_0x5034b1[_0x390e('0x50')],{'$or':_['map'](_0x5034b1[_0x390e('0x49')],function(_0x33d403){var _0x1e70b3={};_0x1e70b3[_0x33d403]={'$like':'%'+_0x485ef8[_0x390e('0x46')][_0x390e('0x55')]+'%'};return _0x1e70b3;})});}_0x5034b1=_[_0x390e('0x52')]({},_0x5034b1,_0x485ef8[_0x390e('0x5e')]);return db[_0x390e('0x81')][_0x390e('0x20')]({'where':_0x5034b1[_0x390e('0x50')]})['then'](function(_0x32790b){_0x4fdeb5['count']=_0x32790b;if(_0x485ef8[_0x390e('0x46')][_0x390e('0x5d')]){_0x5034b1[_0x390e('0x69')]=[{'model':db[_0x390e('0x84')],'as':_0x390e('0x85'),'required':![]},{'model':db[_0x390e('0x86')],'as':_0x390e('0x87'),'attributes':[_0x390e('0x27'),_0x390e('0x88'),'internal'],'required':![]},{'model':db[_0x390e('0x89')],'as':_0x390e('0x8a'),'attributes':['id',_0x390e('0x27'),_0x390e('0x8b')],'where':_0x485ef8[_0x390e('0x46')][_0x390e('0x8c')]?{'id':_0x485ef8[_0x390e('0x46')][_0x390e('0x8c')]}:undefined,'required':_0x485ef8[_0x390e('0x46')]['tag']?!![]:![]}];}return db[_0x390e('0x81')][_0x390e('0x6f')](_0x5034b1);})['then'](function(_0x4af598){_0x4fdeb5[_0x390e('0x56')]=_0x4af598;return _0x4fdeb5;});}})[_0x390e('0x10')](respondWithFilteredResult(_0x542272,_0x5034b1))[_0x390e('0x1a')](handleError(_0x542272,null));};exports[_0x390e('0x8d')]=function addApplications(_0x17c6d7,_0x3e1e40){var _0x1e9ebf=_0x17c6d7[_0x390e('0x58')]['id'];var _0x298b87=_0x17c6d7['body'];var _0x42df56=0xc8;var _0x3778cd=null;return db['sequelize'][_0x390e('0x8e')]({'isolationLevel':db[_0x390e('0x8f')][_0x390e('0x90')][_0x390e('0x91')][_0x390e('0x92')]},function(_0xbb3ac){return db[_0x390e('0x5b')][_0x390e('0x7a')]({'where':{'id':_0x1e9ebf},'transaction':_0xbb3ac})[_0x390e('0x10')](function(_0x146ed7){if(_0x146ed7){return db[_0x390e('0x93')][_0x390e('0x24')]({'where':{'MailAccountId':_0x1e9ebf},'transaction':_0xbb3ac})[_0x390e('0x10')](function(){var _0x429ff2=_[_0x390e('0x42')](_0x298b87,function(_0x1ab264){_0x1ab264['MailAccountId']=_0x1e9ebf;return _0x1ab264;});return db[_0x390e('0x93')]['bulkCreate'](_0x429ff2,{'transaction':_0xbb3ac});});}else{_0x42df56=0x194;_0x3778cd=[];}});})[_0x390e('0x10')](function(){if(_0x42df56!==0x194){return db[_0x390e('0x93')]['findAndCountAll']({'where':{'MailAccountId':_0x1e9ebf},'order':_0x390e('0x94')})[_0x390e('0x10')](function(_0x176b72){_0x3778cd=_0x176b72;});}})[_0x390e('0x1a')](function(_0x544b36){_0x42df56=0x1f4;logger[_0x390e('0x17')](_0x544b36[_0x390e('0x26')]);if(_0x544b36[_0x390e('0x27')]){delete _0x544b36[_0x390e('0x27')];}_0x3778cd=_0x544b36;})[_0x390e('0x95')](function(){if(_0x3778cd===null){_0x3e1e40[_0x390e('0x25')](_0x42df56);}else{if(_0x42df56===0x1f4){_0x3e1e40[_0x390e('0x1b')](_0x42df56)[_0x390e('0x28')](_0x3778cd);}else{_0x3e1e40[_0x390e('0x1b')](_0x42df56)[_0x390e('0x1d')](_0x3778cd);}}});};exports[_0x390e('0x96')]=function(_0x1c82d4,_0x27f5b8){var _0x433e66={};var _0x540a46={};var _0x1a965d;var _0x2c24a5;return db[_0x390e('0x5b')][_0x390e('0x7a')]({'where':{'id':_0x1c82d4[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x27f5b8,null))[_0x390e('0x10')](function(_0x3ca87e){if(_0x3ca87e){_0x1a965d=_0x3ca87e;_0x540a46[_0x390e('0x45')]=_[_0x390e('0x47')](db[_0x390e('0x93')]['rawAttributes']);_0x540a46[_0x390e('0x46')]=_[_0x390e('0x47')](_0x1c82d4[_0x390e('0x46')]);_0x540a46[_0x390e('0x48')]=_['intersection'](_0x540a46[_0x390e('0x45')],_0x540a46[_0x390e('0x46')]);_0x433e66[_0x390e('0x49')]=_['intersection'](_0x540a46[_0x390e('0x45')],qs[_0x390e('0x4b')](_0x1c82d4[_0x390e('0x46')][_0x390e('0x4b')]));_0x433e66[_0x390e('0x49')]=_0x433e66['attributes'][_0x390e('0x5c')]?_0x433e66[_0x390e('0x49')]:_0x540a46[_0x390e('0x45')];_0x433e66[_0x390e('0x68')]=qs[_0x390e('0x4f')](_0x1c82d4['query'][_0x390e('0x4f')]);_0x433e66[_0x390e('0x50')]=qs['filters'](_[_0x390e('0x51')](_0x1c82d4[_0x390e('0x46')],_0x540a46[_0x390e('0x48')]));if(_0x1c82d4[_0x390e('0x46')][_0x390e('0x55')]){_0x433e66['where']=_[_0x390e('0x52')](_0x433e66[_0x390e('0x50')],{'$or':_['map'](_0x433e66[_0x390e('0x49')],function(_0x2fde01){var _0x3dc474={};_0x3dc474[_0x2fde01]={'$like':'%'+_0x1c82d4['query'][_0x390e('0x55')]+'%'};return _0x3dc474;})});}_0x433e66=_[_0x390e('0x52')]({},_0x433e66,_0x1c82d4[_0x390e('0x5e')]);return _0x1a965d[_0x390e('0x96')](_0x433e66);}})[_0x390e('0x10')](function(_0x5b5dda){if(_0x5b5dda){_0x2c24a5=_0x5b5dda[_0x390e('0x5c')];if(!_0x1c82d4[_0x390e('0x46')][_0x390e('0x4c')](_0x390e('0x4d'))){_0x433e66[_0x390e('0x1f')]=qs[_0x390e('0x1f')](_0x1c82d4['query'][_0x390e('0x1f')]);_0x433e66[_0x390e('0x4e')]=qs[_0x390e('0x4e')](_0x1c82d4[_0x390e('0x46')][_0x390e('0x4e')]);}return _0x1a965d[_0x390e('0x96')](_0x433e66);}})[_0x390e('0x10')](function(_0x5657c3){if(_0x5657c3){return _0x5657c3?{'count':_0x2c24a5,'rows':_0x5657c3}:null;}})[_0x390e('0x10')](respondWithResult(_0x27f5b8,null))[_0x390e('0x1a')](handleError(_0x27f5b8,null));};exports['getMessages']=function(_0x1acd4e,_0x2ec401){var _0x3cf72c={'raw':!![],'where':{}};var _0x2c1c1d={};var _0x38ec6a={'count':0x0,'rows':[]};return db[_0x390e('0x5b')]['findOne']({'where':{'id':_0x1acd4e['params']['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x2ec401,null))['then'](function(_0x453ddf){if(_0x453ddf){_0x2c1c1d[_0x390e('0x45')]=_[_0x390e('0x47')](db[_0x390e('0x97')][_0x390e('0x98')]);_0x2c1c1d['query']=_[_0x390e('0x47')](_0x1acd4e[_0x390e('0x46')]);_0x2c1c1d['filters']=_[_0x390e('0x4a')](_0x2c1c1d[_0x390e('0x45')],_0x2c1c1d[_0x390e('0x46')]);_0x3cf72c[_0x390e('0x49')]=_[_0x390e('0x4a')](_0x2c1c1d[_0x390e('0x45')],qs[_0x390e('0x4b')](_0x1acd4e['query']['fields']));_0x3cf72c[_0x390e('0x49')]=_0x3cf72c[_0x390e('0x49')][_0x390e('0x5c')]?_0x3cf72c[_0x390e('0x49')]:_0x2c1c1d[_0x390e('0x45')];if(!_0x1acd4e[_0x390e('0x46')][_0x390e('0x4c')]('nolimit')){_0x3cf72c[_0x390e('0x1f')]=qs[_0x390e('0x1f')](_0x1acd4e[_0x390e('0x46')][_0x390e('0x1f')]);_0x3cf72c[_0x390e('0x4e')]=qs[_0x390e('0x4e')](_0x1acd4e['query'][_0x390e('0x4e')]);}_0x3cf72c[_0x390e('0x68')]=qs[_0x390e('0x4f')](_0x1acd4e[_0x390e('0x46')]['sort']);_0x3cf72c[_0x390e('0x50')]=qs[_0x390e('0x48')](_[_0x390e('0x51')](_0x1acd4e[_0x390e('0x46')],_0x2c1c1d[_0x390e('0x48')]));_0x3cf72c['where'][_0x390e('0x65')]=_0x453ddf['id'];if(_0x1acd4e[_0x390e('0x46')]['filter']){_0x3cf72c['where']=_['merge'](_0x3cf72c['where'],{'$or':_[_0x390e('0x42')](_0x3cf72c[_0x390e('0x49')],function(_0x5788e2){var _0xbf6db={};_0xbf6db[_0x5788e2]={'$like':'%'+_0x1acd4e[_0x390e('0x46')]['filter']+'%'};return _0xbf6db;})});}if(_0x1acd4e[_0x390e('0x46')]['$gte']){var _0x1ec7f1=_0x1acd4e['query'][_0x390e('0x99')][_0x390e('0x9a')](',');var _0x13c1cc={};_0x13c1cc[_0x1ec7f1[0x0]]={'$gte':moment(_0x1ec7f1[0x1])[_0x390e('0x9b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3cf72c['where']=_[_0x390e('0x52')](_0x3cf72c['where'],_0x13c1cc);}_0x3cf72c=_['merge']({},_0x3cf72c,_0x1acd4e[_0x390e('0x5e')]);return db[_0x390e('0x97')]['count']({'where':_0x3cf72c[_0x390e('0x50')]})[_0x390e('0x10')](function(_0x665e90){_0x38ec6a[_0x390e('0x20')]=_0x665e90;if(_0x1acd4e['query'][_0x390e('0x5d')]){_0x3cf72c['include']=[{'all':!![]}];}return db[_0x390e('0x97')]['findAll'](_0x3cf72c);})[_0x390e('0x10')](function(_0x22a3b2){if(_0x1acd4e['query'][_0x390e('0x9c')]===_0x390e('0x9d')){for(var _0x1275e5=0x0;_0x1275e5<_0x22a3b2['length'];_0x1275e5++){_0x22a3b2[_0x1275e5][_0x390e('0x5f')]=juice(_0x22a3b2[_0x1275e5][_0x390e('0x5f')]);}}_0x38ec6a[_0x390e('0x56')]=_0x22a3b2;return _0x38ec6a;});}})[_0x390e('0x10')](respondWithFilteredResult(_0x2ec401,_0x3cf72c))[_0x390e('0x1a')](handleError(_0x2ec401,null));};exports[_0x390e('0x28')]=function(_0x9f1d7d,_0x73fbbf){var _0x3c8a7a,_0x29275d={},_0xda870f;if(_0x9f1d7d['body']['to']){_0xda870f=_0x9f1d7d[_0x390e('0x5f')]['to'][_0x390e('0x9a')](',')[0x0];}return db['MailAccount'][_0x390e('0x62')]({'where':{'id':_0x9f1d7d[_0x390e('0x58')]['id']},'include':[{'model':db[_0x390e('0x9e')],'as':_0x390e('0x9f'),'include':[{'model':db[_0x390e('0x84')],'as':_0x390e('0xa0'),'where':{'email':_0xda870f},'limit':0x1,'order':[[_0x390e('0xa1'),_0x390e('0xa2')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x390e('0xa3'),'raw':!![]}]}]})[_0x390e('0x10')](handleEntityNotFound(_0x73fbbf,null))[_0x390e('0x10')](function(_0x295bb8){if(!_0x295bb8)return;_0x3c8a7a=_0x295bb8;if(!_0x295bb8[_0x390e('0x3e')])throw new Error(_0x390e('0xa4'));if(_[_0x390e('0x72')](_0x9f1d7d[_0x390e('0x5f')]['from'])){_0x9f1d7d[_0x390e('0x5f')][_0x390e('0xa5')]=util[_0x390e('0x9b')](_0x390e('0xa6'),_0x295bb8['name'],_0x295bb8[_0x390e('0x71')]||_0x295bb8[_0x390e('0x3e')][_0x390e('0x32')]);}if(_0x9f1d7d[_0x390e('0x5f')][_0x390e('0xa7')]&&_0x9f1d7d[_0x390e('0x5f')][_0x390e('0xa7')][_0x390e('0x5c')]){for(var _0xcc713e=0x0;_0xcc713e<_0x9f1d7d['body'][_0x390e('0xa7')][_0x390e('0x5c')];_0xcc713e+=0x1){_0x9f1d7d[_0x390e('0x5f')][_0x390e('0xa7')][_0xcc713e]={'filename':_0x9f1d7d[_0x390e('0x5f')][_0x390e('0xa7')][_0xcc713e]['name'],'path':path[_0x390e('0xa8')](config['root'],_0x390e('0xa9'),_0x9f1d7d['body'][_0x390e('0xa7')][_0xcc713e][_0x390e('0xaa')])};}}var _0xdc7702=_0x295bb8[_0x390e('0xab')]();return respondWithRpcPromise(_0x390e('0xac'),_0x390e('0xad'),{'account':_0xdc7702,'message':_0x9f1d7d['body']});})['then'](function(_0x567047){if(!_0x567047)return;_0x29275d=_0x567047;if(!_0x3c8a7a[_0x390e('0x9f')])throw new Error(_0x390e('0xae'));if(_0x3c8a7a['List']['Contacts'][_0x390e('0x5c')])return _0x3c8a7a[_0x390e('0x9f')][_0x390e('0xa0')][0x0];return db[_0x390e('0x84')]['create'](_[_0x390e('0x9')](_0x9f1d7d['body'],{'firstName':_0x9f1d7d[_0x390e('0x5f')]['to'],'email':_0x9f1d7d['body']['to'],'phone':_0x9f1d7d[_0x390e('0x5f')]['to'],'ListId':_0x3c8a7a['ListId']}));})[_0x390e('0x10')](function(_0x51fcec){if(!_0x51fcec)return;var _0x5de88a={'UserId':_0x9f1d7d[_0x390e('0x32')]['id'],'ContactId':_0x51fcec['id'],'MailAccountId':_0x3c8a7a['id'],'inReplyTo':_0x29275d[_0x390e('0xaf')],'to':_0x9f1d7d['body']['from'],'cc':_0x9f1d7d[_0x390e('0x5f')]['cc'],'subject':_0x9f1d7d[_0x390e('0x5f')][_0x390e('0xb0')],'attach':_0x9f1d7d[_0x390e('0x5f')][_0x390e('0xb1')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x390e('0x9b')](_0x390e('0xb2')),'lastMsgDirection':_0x390e('0xb3'),'Messages':[_[_0x390e('0x52')](_0x9f1d7d[_0x390e('0x5f')],{'messageId':_0x29275d[_0x390e('0xaf')],'sentAt':moment()[_0x390e('0x9b')](_0x390e('0xb2')),'read':!![],'MailAccountId':_0x3c8a7a['id'],'UserId':_0x9f1d7d[_0x390e('0x32')]['id'],'ContactId':_0x51fcec['id']})]};if(_0x9f1d7d[_0x390e('0x5f')]['Interaction']){_0x5de88a=_[_0x390e('0x52')](_0x5de88a,_0x9f1d7d[_0x390e('0x5f')][_0x390e('0xb4')]);}return db['MailInteraction'][_0x390e('0x67')](_0x5de88a,{'include':[{'model':db[_0x390e('0x97')],'as':_0x390e('0xb5')}]});})[_0x390e('0x10')](respondWithResult(_0x73fbbf,null))[_0x390e('0x1a')](handleError(_0x73fbbf,null));};exports[_0x390e('0xb6')]=function(_0x8c8ac0,_0x31fc89){return db['MailAccount'][_0x390e('0x62')]({'where':{'id':_0x8c8ac0[_0x390e('0x58')]['id']},'include':[{'model':db[_0x390e('0x5a')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x390e('0xa3')],'as':'CloudProvider','raw':!![]}]}]})[_0x390e('0x10')](handleEntityNotFound(_0x31fc89,null))[_0x390e('0x10')](function(_0x30f698){if(!_0x30f698['Smtp'])return;var _0x4ad659=_0x30f698[_0x390e('0xab')]();return respondWithRpcPromise('VerifySmtp',_0x390e('0xb6'),{'account':_0x4ad659});})[_0x390e('0x10')](respondWithResult(_0x31fc89,null))[_0x390e('0x1a')](handleError(_0x31fc89,null));};exports['destroy']=function(_0x2e5741,_0x4a440d){return db[_0x390e('0x5b')][_0x390e('0x62')]({'where':{'id':_0x2e5741[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x4a440d,null))[_0x390e('0x10')](function(_0x320e79){if(_0x320e79&&_0x320e79[_0x390e('0x3b')]){throw new db[(_0x390e('0xb7'))][(_0x390e('0xb8'))](_0x390e('0xb9'));}return _0x320e79;})[_0x390e('0x10')](removeEntity(_0x4a440d,null))[_0x390e('0x1a')](handleError(_0x4a440d,null));};exports[_0x390e('0xba')]=function(_0x26ffe8,_0x33fa04){return db[_0x390e('0x5b')][_0x390e('0x62')]({'where':{'id':_0x26ffe8['params']['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x33fa04,null))[_0x390e('0x10')](function(_0x54b063){if(_0x54b063){return _0x54b063[_0x390e('0xba')](_0x26ffe8[_0x390e('0x5f')]['ids'],_['omit'](_0x26ffe8['body'],[_0x390e('0x6b'),'id'])||{})[_0x390e('0xbb')](function(_0x2d15de){for(var _0x149013=0x0;_0x149013<_0x26ffe8[_0x390e('0x5f')][_0x390e('0x6b')][_0x390e('0x5c')];_0x149013+=0x1){socket[_0x390e('0xbc')]('userMailAccount:save',{'UserId':Number(_0x26ffe8[_0x390e('0x5f')][_0x390e('0x6b')][_0x149013]),'MailAccountId':Number(_0x26ffe8['params']['id'])});}return _0x2d15de;});}})[_0x390e('0x10')](respondWithResult(_0x33fa04,null))[_0x390e('0x1a')](handleError(_0x33fa04,null));};exports[_0x390e('0xbd')]=function(_0xf19dee,_0x4a8d45){return db[_0x390e('0x5b')][_0x390e('0x62')]({'where':{'id':_0xf19dee[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x4a8d45,null))[_0x390e('0x10')](function(_0x37fbbb){if(_0x37fbbb){return _0x37fbbb[_0x390e('0xbd')](_0xf19dee[_0x390e('0x46')][_0x390e('0x6b')])[_0x390e('0x10')](function(){if(_['isArray'](_0xf19dee[_0x390e('0x46')][_0x390e('0x6b')])){for(var _0xb6047a=0x0;_0xb6047a<_0xf19dee[_0x390e('0x46')][_0x390e('0x6b')][_0x390e('0x5c')];_0xb6047a+=0x1){socket['emit'](_0x390e('0xbe'),{'UserId':Number(_0xf19dee[_0x390e('0x46')]['ids'][_0xb6047a]),'MailAccountId':Number(_0xf19dee[_0x390e('0x58')]['id'])});}}else{socket[_0x390e('0xbc')]('userMailAccount:remove',{'UserId':Number(_0xf19dee['query'][_0x390e('0x6b')]),'MailAccountId':Number(_0xf19dee[_0x390e('0x58')]['id'])});}});}})[_0x390e('0x10')](respondWithStatusCode(_0x4a8d45,null))[_0x390e('0x1a')](handleError(_0x4a8d45,null));};exports[_0x390e('0xbf')]=function(_0x5d79ae,_0x5831f6){var _0x14103f={};var _0x2c1899={};var _0x397560;var _0x14c3f3;return db['MailAccount']['findOne']({'where':{'id':_0x5d79ae[_0x390e('0x58')]['id']}})[_0x390e('0x10')](handleEntityNotFound(_0x5831f6,null))[_0x390e('0x10')](function(_0x371523){if(_0x371523){_0x397560=_0x371523;_0x2c1899[_0x390e('0x45')]=_['keys'](db['User'][_0x390e('0x98')]);_0x2c1899[_0x390e('0x46')]=_[_0x390e('0x47')](_0x5d79ae[_0x390e('0x46')]);_0x2c1899[_0x390e('0x48')]=_[_0x390e('0x4a')](_0x2c1899[_0x390e('0x45')],_0x2c1899['query']);_0x14103f[_0x390e('0x49')]=_[_0x390e('0x4a')](_0x2c1899[_0x390e('0x45')],qs[_0x390e('0x4b')](_0x5d79ae[_0x390e('0x46')]['fields']));_0x14103f[_0x390e('0x49')]=_0x14103f[_0x390e('0x49')]['length']?_0x14103f[_0x390e('0x49')]:_0x2c1899[_0x390e('0x45')];_0x14103f['order']=qs[_0x390e('0x4f')](_0x5d79ae['query'][_0x390e('0x4f')]);_0x14103f[_0x390e('0x50')]=qs[_0x390e('0x48')](_[_0x390e('0x51')](_0x5d79ae[_0x390e('0x46')],_0x2c1899['filters']));if(_0x5d79ae[_0x390e('0x46')][_0x390e('0x55')]){_0x14103f[_0x390e('0x50')]=_[_0x390e('0x52')](_0x14103f[_0x390e('0x50')],{'$or':_['map'](_0x14103f[_0x390e('0x49')],function(_0x30a691){var _0x166e62={};_0x166e62[_0x30a691]={'$like':'%'+_0x5d79ae[_0x390e('0x46')][_0x390e('0x55')]+'%'};return _0x166e62;})});}_0x14103f=_[_0x390e('0x52')]({},_0x14103f,_0x5d79ae[_0x390e('0x5e')]);return _0x397560[_0x390e('0xbf')](_0x14103f);}})[_0x390e('0x10')](function(_0x414ecb){if(_0x414ecb){_0x14c3f3=_0x414ecb[_0x390e('0x5c')];if(!_0x5d79ae[_0x390e('0x46')][_0x390e('0x4c')](_0x390e('0x4d'))){_0x14103f[_0x390e('0x1f')]=qs[_0x390e('0x1f')](_0x5d79ae['query'][_0x390e('0x1f')]);_0x14103f[_0x390e('0x4e')]=qs[_0x390e('0x4e')](_0x5d79ae[_0x390e('0x46')][_0x390e('0x4e')]);}return _0x397560[_0x390e('0xbf')](_0x14103f);}})[_0x390e('0x10')](function(_0x3501cd){if(_0x3501cd){return _0x3501cd?{'count':_0x14c3f3,'rows':_0x3501cd}:null;}})[_0x390e('0x10')](respondWithResult(_0x5831f6,null))[_0x390e('0x1a')](handleError(_0x5831f6,null));}; \ No newline at end of file +var _0xba86=['%s\x20<%s>','attachments','root','basename','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','ListId','attach','out','messageId','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','userMailAccount:save','removeAgents','emit','getAgents','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','destroy','UserProfileResource','stack','name','gmail','yahoo','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','MailServerIn','Imap','MailServerOut','Pause','map','MailAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','mandatoryDispositionPause','keys','rawAttributes','include','find','body','provider','custom','describe','addDisposition','MailAccountId','create','findOne','order','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','isNil','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','send','json','getApplications','getMessages','MailMessage','$gte','format','inlineCss','true','split','CmList','Contacts','updatedAt','CloudProvider','from'];(function(_0x569fc4,_0x1be938){var _0x100166=function(_0x57be21){while(--_0x57be21){_0x569fc4['push'](_0x569fc4['shift']());}};_0x100166(++_0x1be938);}(_0xba86,0xdc));var _0x6ba8=function(_0x12ac45,_0xeb2f08){_0x12ac45=_0x12ac45-0x0;var _0x72a550=_0xba86[_0x12ac45];return _0x72a550;};'use strict';var moment=require(_0x6ba8('0x0'));var BPromise=require(_0x6ba8('0x1'));var util=require(_0x6ba8('0x2'));var path=require(_0x6ba8('0x3'));var _=require('lodash');var juice=require(_0x6ba8('0x4'));var Redis=require(_0x6ba8('0x5'));var qs=require(_0x6ba8('0x6'));var logger=require('../../config/logger')(_0x6ba8('0x7'));var config=require(_0x6ba8('0x8'));var db=require(_0x6ba8('0x9'))['db'];config[_0x6ba8('0xa')]=_[_0x6ba8('0xb')](config[_0x6ba8('0xa')],{'host':_0x6ba8('0xc'),'port':0x18eb});var socket=require(_0x6ba8('0xd'))(new Redis(config[_0x6ba8('0xa')]));require(_0x6ba8('0xe'))[_0x6ba8('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6ba8('0x10')][_0x6ba8('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x21f44d,_0x38b26d,_0xfcaeef,_0x5d79ed){return new BPromise(function(_0x2eaf62,_0x4682d7){var _0x48201c=_0x5d79ed||client;return _0x48201c[_0x6ba8('0x12')](_0x21f44d,_0xfcaeef)[_0x6ba8('0x13')](function(_0xe2ca92){logger['info'](_0x6ba8('0x14'),_0x38b26d,'request\x20sent');logger[_0x6ba8('0x15')](_0x6ba8('0x16'),_0x38b26d,_0x6ba8('0x17'),JSON[_0x6ba8('0x18')](_0xe2ca92));if(_0xe2ca92['error']){if(_0xe2ca92[_0x6ba8('0x19')][_0x6ba8('0x1a')]===0x1f4){logger[_0x6ba8('0x19')](_0x6ba8('0x14'),_0x38b26d,_0xe2ca92[_0x6ba8('0x19')][_0x6ba8('0x1b')]);return _0x4682d7(_0xe2ca92[_0x6ba8('0x19')][_0x6ba8('0x1b')]);}logger[_0x6ba8('0x19')](_0x6ba8('0x14'),_0x38b26d,_0xe2ca92['error']['message']);return _0x2eaf62(_0xe2ca92[_0x6ba8('0x19')][_0x6ba8('0x1b')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x38b26d,_0x6ba8('0x17'));_0x2eaf62(_0xe2ca92[_0x6ba8('0x1c')][_0x6ba8('0x1b')]);}})[_0x6ba8('0x1d')](function(_0x5a867c){logger['error'](_0x6ba8('0x14'),_0x38b26d,_0x5a867c);_0x4682d7(_0x5a867c);});});}function respondWithStatusCode(_0x4ee001,_0x14fb35){_0x14fb35=_0x14fb35||0xcc;return function(_0x3ab049){if(_0x3ab049){return _0x4ee001[_0x6ba8('0x1e')](_0x14fb35);}return _0x4ee001[_0x6ba8('0x1f')](_0x14fb35)[_0x6ba8('0x20')]();};}function respondWithResult(_0x724666,_0x5ede53){_0x5ede53=_0x5ede53||0xc8;return function(_0x4ef5b5){if(_0x4ef5b5){return _0x724666[_0x6ba8('0x1f')](_0x5ede53)['json'](_0x4ef5b5);}};}function respondWithFilteredResult(_0x31bd08,_0x32bd99){return function(_0x317855){if(_0x317855){var _0x132b4b=typeof _0x32bd99[_0x6ba8('0x21')]===_0x6ba8('0x22')&&typeof _0x32bd99[_0x6ba8('0x23')]==='undefined';var _0x433df6=_0x317855[_0x6ba8('0x24')];var _0x4a1336=_0x132b4b?0x0:_0x32bd99[_0x6ba8('0x21')];var _0x12280f=_0x132b4b?_0x317855[_0x6ba8('0x24')]:_0x32bd99[_0x6ba8('0x21')]+_0x32bd99['limit'];var _0x83ae63;if(_0x12280f>=_0x433df6){_0x12280f=_0x433df6;_0x83ae63=0xc8;}else{_0x83ae63=0xce;}_0x31bd08[_0x6ba8('0x1f')](_0x83ae63);return _0x31bd08[_0x6ba8('0x25')](_0x6ba8('0x26'),_0x4a1336+'-'+_0x12280f+'/'+_0x433df6)['json'](_0x317855);}return null;};}function saveUpdates(_0x491ee8){return function(_0xf1e618){if(_0xf1e618){return _0xf1e618[_0x6ba8('0x27')](_0x491ee8)[_0x6ba8('0x13')](function(_0x58935e){return _0x58935e;});}return null;};}function removeEntity(_0x4bdea7){return function(_0x242a14){if(_0x242a14){return _0x242a14[_0x6ba8('0x28')]()[_0x6ba8('0x13')](function(){var _0x3d13a2=_0x242a14['get']({'plain':!![]});var _0x4be068='MailAccounts';return db[_0x6ba8('0x29')][_0x6ba8('0x28')]({'where':{'type':_0x4be068,'resourceId':_0x3d13a2['id']}})[_0x6ba8('0x13')](function(){return _0x242a14;});})['then'](function(){_0x4bdea7[_0x6ba8('0x1f')](0xcc)[_0x6ba8('0x20')]();});}};}function handleEntityNotFound(_0x33eab9){return function(_0x3d009e){if(!_0x3d009e){_0x33eab9[_0x6ba8('0x1e')](0x194);}return _0x3d009e;};}function handleError(_0x3a0a9d,_0xc377f3){_0xc377f3=_0xc377f3||0x1f4;return function(_0x1cec33){logger[_0x6ba8('0x19')](_0x1cec33[_0x6ba8('0x2a')]);if(_0x1cec33[_0x6ba8('0x2b')]){delete _0x1cec33[_0x6ba8('0x2b')];}_0x3a0a9d[_0x6ba8('0x1f')](_0xc377f3)['send'](_0x1cec33);};}function getImapHost(_0xde7040){switch(_0xde7040){case _0x6ba8('0x2c'):return'imap.gmail.com';case _0x6ba8('0x2d'):return'imap.mail.yahoo.com';case'hotmail':return _0x6ba8('0x2e');case _0x6ba8('0x2f'):return _0x6ba8('0x30');}throw new Error(_0x6ba8('0x31'),_0xde7040);}function getSmtpHost(_0x2930e8){switch(_0x2930e8){case _0x6ba8('0x2c'):return _0x6ba8('0x32');case _0x6ba8('0x2d'):return _0x6ba8('0x33');case _0x6ba8('0x34'):return _0x6ba8('0x35');case'outlook365':return _0x6ba8('0x36');}throw new Error('Unknown\x20email\x20service\x20provider',_0x2930e8);}function getAuthenticationOptions(_0x44f6ef,_0x402718){var _0x898a34={};var _0x111471={};if(_0x44f6ef){_0x898a34[_0x6ba8('0x37')]=_0x111471['user']=_0x402718[_0x6ba8('0x38')];_0x898a34[_0x6ba8('0x39')]=_0x111471[_0x6ba8('0x3a')]=_0x402718[_0x6ba8('0x39')];if(_0x402718['modernAuthentication']){_0x898a34[_0x6ba8('0x3b')]=_0x111471['modernAuthentication']=!![];_0x898a34['CloudProviderId']=_0x111471['CloudProviderId']=_0x402718[_0x6ba8('0x3c')];_0x898a34[_0x6ba8('0x39')]=_0x111471['pass']=null;}else{_0x898a34[_0x6ba8('0x3c')]=_0x111471[_0x6ba8('0x3c')]=null;}_0x898a34[_0x6ba8('0x3d')]=getImapHost(_0x44f6ef);_0x898a34[_0x6ba8('0x3e')]=0x3e1;_0x111471[_0x6ba8('0x3d')]=getSmtpHost(_0x44f6ef);_0x111471[_0x6ba8('0x3e')]=0x24b;_0x111471[_0x6ba8('0x3f')]=![];_0x898a34['service']=_0x111471[_0x6ba8('0x40')]=null;}else{if(_0x402718['authentication']){_0x898a34[_0x6ba8('0x37')]=_0x111471[_0x6ba8('0x37')]=_0x402718['username'];_0x898a34[_0x6ba8('0x39')]=_0x111471[_0x6ba8('0x3a')]=_0x402718['password'];}else{_0x898a34[_0x6ba8('0x41')]=_0x111471[_0x6ba8('0x41')]=![];_0x898a34[_0x6ba8('0x37')]=_0x111471['user']=null;_0x898a34['password']=_0x111471[_0x6ba8('0x3a')]=null;}_0x898a34[_0x6ba8('0x3d')]=_0x402718['Imap'][_0x6ba8('0x3d')];_0x898a34['port']=_0x402718['Imap'][_0x6ba8('0x3e')];_0x111471[_0x6ba8('0x3d')]=_0x402718['Smtp'][_0x6ba8('0x3d')];_0x111471['port']=_0x402718[_0x6ba8('0x42')]['port'];}return{'Imap':_0x898a34,'Smtp':_0x111471};}exports['index']=function(_0x4d0f48,_0x1ec243){var _0x2ab8ab={'include':[{'model':db[_0x6ba8('0x43')],'as':_0x6ba8('0x44')},{'model':db[_0x6ba8('0x45')],'as':_0x6ba8('0x42')},{'model':db[_0x6ba8('0x46')],'as':'mandatoryDispositionPause'}]},_0x3b85c5={},_0x3d075d={'count':0x0,'rows':[]};var _0x367925=_[_0x6ba8('0x47')](db[_0x6ba8('0x48')]['rawAttributes'],function(_0x1bd7cd){return{'name':_0x1bd7cd[_0x6ba8('0x49')],'type':_0x1bd7cd[_0x6ba8('0x4a')][_0x6ba8('0x4b')]};});_0x3b85c5[_0x6ba8('0x4c')]=_[_0x6ba8('0x47')](_0x367925,_0x6ba8('0x2b'));_0x3b85c5['query']=_['keys'](_0x4d0f48[_0x6ba8('0x4d')]);_0x3b85c5[_0x6ba8('0x4e')]=_['intersection'](_0x3b85c5[_0x6ba8('0x4c')],_0x3b85c5['query']);_0x2ab8ab['attributes']=_[_0x6ba8('0x4f')](_0x3b85c5[_0x6ba8('0x4c')],qs[_0x6ba8('0x50')](_0x4d0f48[_0x6ba8('0x4d')][_0x6ba8('0x50')]));_0x2ab8ab['attributes']=_0x2ab8ab[_0x6ba8('0x51')][_0x6ba8('0x52')]?_0x2ab8ab['attributes']:_0x3b85c5[_0x6ba8('0x4c')];if(!_0x4d0f48[_0x6ba8('0x4d')][_0x6ba8('0x53')](_0x6ba8('0x54'))){_0x2ab8ab[_0x6ba8('0x23')]=qs[_0x6ba8('0x23')](_0x4d0f48['query'][_0x6ba8('0x23')]);_0x2ab8ab[_0x6ba8('0x21')]=qs['offset'](_0x4d0f48['query'][_0x6ba8('0x21')]);}_0x2ab8ab['order']=qs[_0x6ba8('0x55')](_0x4d0f48[_0x6ba8('0x4d')][_0x6ba8('0x55')]);_0x2ab8ab['where']=qs[_0x6ba8('0x4e')](_[_0x6ba8('0x56')](_0x4d0f48[_0x6ba8('0x4d')],_0x3b85c5['filters']),_0x367925);if(_0x4d0f48[_0x6ba8('0x4d')][_0x6ba8('0x57')]){_0x2ab8ab[_0x6ba8('0x58')]=_[_0x6ba8('0x59')](_0x2ab8ab['where'],{'$or':_[_0x6ba8('0x47')](_0x367925,function(_0x3b3cd9){if(_0x3b3cd9[_0x6ba8('0x4a')]!==_0x6ba8('0x5a')){var _0xcaac87={};_0xcaac87[_0x3b3cd9['name']]={'$like':'%'+_0x4d0f48[_0x6ba8('0x4d')][_0x6ba8('0x57')]+'%'};return _0xcaac87;}})});}_0x2ab8ab=_[_0x6ba8('0x59')]({},_0x2ab8ab,_0x4d0f48[_0x6ba8('0x5b')]);var _0x151fc2={'where':_0x2ab8ab[_0x6ba8('0x58')]};return db[_0x6ba8('0x48')][_0x6ba8('0x24')](_0x151fc2)[_0x6ba8('0x13')](function(_0x3763ea){_0x3d075d[_0x6ba8('0x24')]=_0x3763ea;if(_0x4d0f48[_0x6ba8('0x4d')][_0x6ba8('0x5c')]){_0x2ab8ab['include']=[{'all':!![]}];}return db[_0x6ba8('0x48')][_0x6ba8('0x5d')](_0x2ab8ab);})[_0x6ba8('0x13')](function(_0x15091f){_0x3d075d[_0x6ba8('0x5e')]=_0x15091f;return _0x3d075d;})['then'](respondWithFilteredResult(_0x1ec243,_0x2ab8ab))[_0x6ba8('0x1d')](handleError(_0x1ec243,null));};exports['show']=function(_0x370f6b,_0x31e3fe){var _0x42d468={'raw':![],'where':{'id':_0x370f6b[_0x6ba8('0x5f')]['id']},'include':[{'model':db[_0x6ba8('0x43')],'as':_0x6ba8('0x44')},{'model':db[_0x6ba8('0x45')],'as':_0x6ba8('0x42')},{'model':db[_0x6ba8('0x46')],'as':_0x6ba8('0x60')}]},_0x113397={};_0x113397[_0x6ba8('0x4c')]=_[_0x6ba8('0x61')](db['MailAccount'][_0x6ba8('0x62')]);_0x113397[_0x6ba8('0x4d')]=_['keys'](_0x370f6b[_0x6ba8('0x4d')]);_0x113397[_0x6ba8('0x4e')]=_['intersection'](_0x113397[_0x6ba8('0x4c')],_0x113397[_0x6ba8('0x4d')]);_0x42d468['attributes']=_['intersection'](_0x113397['model'],qs['fields'](_0x370f6b[_0x6ba8('0x4d')][_0x6ba8('0x50')]));_0x42d468['attributes']=_0x42d468[_0x6ba8('0x51')][_0x6ba8('0x52')]?_0x42d468[_0x6ba8('0x51')]:_0x113397[_0x6ba8('0x4c')];if(_0x370f6b['query'][_0x6ba8('0x5c')]){_0x42d468[_0x6ba8('0x63')]=[{'all':!![]}];}_0x42d468=_[_0x6ba8('0x59')]({},_0x42d468,_0x370f6b[_0x6ba8('0x5b')]);return db['MailAccount'][_0x6ba8('0x64')](_0x42d468)['then'](handleEntityNotFound(_0x31e3fe,null))[_0x6ba8('0x13')](respondWithResult(_0x31e3fe,null))[_0x6ba8('0x1d')](handleError(_0x31e3fe,null));};exports[_0x6ba8('0x27')]=function(_0x24ee02,_0x1b0511){if(_0x24ee02[_0x6ba8('0x65')]['id']){delete _0x24ee02[_0x6ba8('0x65')]['id'];}var _0x44036d=_0x24ee02[_0x6ba8('0x65')][_0x6ba8('0x66')]===_0x6ba8('0x67')?null:_0x24ee02[_0x6ba8('0x65')][_0x6ba8('0x66')];var _0x10a4c5=_0x24ee02[_0x6ba8('0x65')][_0x6ba8('0x44')]||{};var _0x559077=_0x24ee02['body']['Smtp']||{};if(_0x44036d){_0x10a4c5[_0x6ba8('0x3d')]=getImapHost(_0x44036d);_0x10a4c5[_0x6ba8('0x3e')]=0x3e1;_0x559077[_0x6ba8('0x3d')]=getSmtpHost(_0x44036d);_0x559077['port']=0x24b;_0x559077[_0x6ba8('0x3f')]=![];}if(_0x559077[_0x6ba8('0x3b')]){_0x559077[_0x6ba8('0x3f')]=![];}else{_0x559077['CloudProviderId']=null;}if(!_0x10a4c5[_0x6ba8('0x3b')])_0x10a4c5[_0x6ba8('0x3c')]=null;_0x24ee02[_0x6ba8('0x65')]['Imap']=_0x10a4c5;_0x24ee02['body'][_0x6ba8('0x42')]=_0x559077;return db['MailAccount'][_0x6ba8('0x64')]({'where':{'id':_0x24ee02[_0x6ba8('0x5f')]['id']},'include':[{'model':db[_0x6ba8('0x43')],'as':_0x6ba8('0x44')},{'model':db[_0x6ba8('0x45')],'as':_0x6ba8('0x42')},{'model':db[_0x6ba8('0x46')],'as':_0x6ba8('0x60')}]})[_0x6ba8('0x13')](handleEntityNotFound(_0x1b0511,null))[_0x6ba8('0x13')](function(_0x47f11c){if(!_0x47f11c)throw new Error('Mail\x20Account\x20not\x20found');if(_0x47f11c[_0x6ba8('0x40')])delete _0x24ee02[_0x6ba8('0x65')][_0x6ba8('0x44')];return _0x47f11c;})['then'](saveUpdates(_0x24ee02[_0x6ba8('0x65')],null))['then'](function(_0x525a9b){if(!_0x24ee02[_0x6ba8('0x65')]['Imap'])return _0x525a9b;return db['MailServerIn']['update'](_0x24ee02[_0x6ba8('0x65')][_0x6ba8('0x44')],{'where':{'MailAccountId':_0x525a9b['id']}})[_0x6ba8('0x13')](function(){return _0x525a9b;});})[_0x6ba8('0x13')](function(_0x7faa8b){if(!_0x24ee02[_0x6ba8('0x65')]['Smtp'])return _0x7faa8b;return db['MailServerOut']['update'](_0x24ee02[_0x6ba8('0x65')][_0x6ba8('0x42')],{'where':{'MailAccountId':_0x7faa8b['id']}})[_0x6ba8('0x13')](function(){return _0x7faa8b;});})[_0x6ba8('0x13')](respondWithResult(_0x1b0511,null))[_0x6ba8('0x1d')](handleError(_0x1b0511,null));};exports[_0x6ba8('0x68')]=function(_0x1b8852,_0x3602c6){return db[_0x6ba8('0x48')][_0x6ba8('0x68')]()[_0x6ba8('0x13')](respondWithResult(_0x3602c6,null))[_0x6ba8('0x1d')](handleError(_0x3602c6,null));};exports[_0x6ba8('0x69')]=function(_0xbaff37,_0x49e25d){if(_0xbaff37[_0x6ba8('0x65')]['id']){delete _0xbaff37[_0x6ba8('0x65')]['id'];}return db[_0x6ba8('0x48')][_0x6ba8('0x64')]({'where':{'id':_0xbaff37[_0x6ba8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x49e25d,null))[_0x6ba8('0x13')](function(_0x10a706){if(_0x10a706){_0xbaff37[_0x6ba8('0x65')][_0x6ba8('0x6a')]=_0x10a706['id'];return db['Disposition'][_0x6ba8('0x6b')](_0xbaff37['body']);}})[_0x6ba8('0x13')](respondWithResult(_0x49e25d,null))[_0x6ba8('0x1d')](handleError(_0x49e25d,null));};exports['getDispositions']=function(_0x3998db,_0x2c862a){var _0x28d829={'raw':![],'where':{}};var _0x3960ce={};var _0x2cfa3e={'count':0x0,'rows':[]};return db['MailAccount'][_0x6ba8('0x6c')]({'where':{'id':_0x3998db[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x2c862a,null))[_0x6ba8('0x13')](function(_0x531366){if(_0x531366){_0x3960ce[_0x6ba8('0x4c')]=_[_0x6ba8('0x61')](db['Disposition'][_0x6ba8('0x62')]);_0x3960ce[_0x6ba8('0x4d')]=_['keys'](_0x3998db['query']);_0x3960ce[_0x6ba8('0x4e')]=_[_0x6ba8('0x4f')](_0x3960ce[_0x6ba8('0x4c')],_0x3960ce[_0x6ba8('0x4d')]);_0x28d829[_0x6ba8('0x51')]=_[_0x6ba8('0x4f')](_0x3960ce['model'],qs[_0x6ba8('0x50')](_0x3998db[_0x6ba8('0x4d')][_0x6ba8('0x50')]));_0x28d829[_0x6ba8('0x51')]=_0x28d829[_0x6ba8('0x51')][_0x6ba8('0x52')]?_0x28d829[_0x6ba8('0x51')]:_0x3960ce[_0x6ba8('0x4c')];if(!_0x3998db['query'][_0x6ba8('0x53')](_0x6ba8('0x54'))){_0x28d829[_0x6ba8('0x23')]=qs['limit'](_0x3998db['query']['limit']);_0x28d829[_0x6ba8('0x21')]=qs[_0x6ba8('0x21')](_0x3998db[_0x6ba8('0x4d')][_0x6ba8('0x21')]);}_0x28d829[_0x6ba8('0x6d')]=qs[_0x6ba8('0x55')](_0x3998db['query'][_0x6ba8('0x55')]);_0x28d829['where']=qs[_0x6ba8('0x4e')](_[_0x6ba8('0x56')](_0x3998db[_0x6ba8('0x4d')],_0x3960ce['filters']));_0x28d829['where'][_0x6ba8('0x6a')]=_0x531366['id'];if(_0x3998db[_0x6ba8('0x4d')]['filter']){_0x28d829['where']=_['merge'](_0x28d829['where'],{'$or':_[_0x6ba8('0x47')](_0x28d829[_0x6ba8('0x51')],function(_0x39805b){var _0x76eb23={};_0x76eb23[_0x39805b]={'$like':'%'+_0x3998db[_0x6ba8('0x4d')][_0x6ba8('0x57')]+'%'};return _0x76eb23;})});}_0x28d829=_[_0x6ba8('0x59')]({},_0x28d829,_0x3998db['options']);return db[_0x6ba8('0x6e')][_0x6ba8('0x24')]({'where':_0x28d829[_0x6ba8('0x58')]})['then'](function(_0x3451eb){_0x2cfa3e[_0x6ba8('0x24')]=_0x3451eb;if(_0x3998db[_0x6ba8('0x4d')]['includeAll']){_0x28d829[_0x6ba8('0x63')]=[{'all':!![]}];}return db['Disposition'][_0x6ba8('0x5d')](_0x28d829);})[_0x6ba8('0x13')](function(_0x573711){_0x2cfa3e['rows']=_0x573711;return _0x2cfa3e;});}})[_0x6ba8('0x13')](respondWithFilteredResult(_0x2c862a,_0x28d829))[_0x6ba8('0x1d')](handleError(_0x2c862a,null));};exports['removeDispositions']=function(_0x19ca93,_0x4ac639){return db[_0x6ba8('0x48')][_0x6ba8('0x64')]({'where':{'id':_0x19ca93['params']['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x4ac639,null))[_0x6ba8('0x13')](function(_0x3cb0cf){if(_0x3cb0cf){return _0x3cb0cf[_0x6ba8('0x6f')](_0x19ca93[_0x6ba8('0x4d')][_0x6ba8('0x70')]);}})['then'](respondWithStatusCode(_0x4ac639,null))['catch'](handleError(_0x4ac639,null));};exports[_0x6ba8('0x71')]=function(_0x31c130,_0x906644){if(_0x31c130[_0x6ba8('0x65')]['id']){delete _0x31c130['body']['id'];}return db[_0x6ba8('0x48')][_0x6ba8('0x64')]({'where':{'id':_0x31c130[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x906644,null))[_0x6ba8('0x13')](function(_0x93aa21){if(_0x93aa21){_0x31c130[_0x6ba8('0x65')][_0x6ba8('0x6a')]=_0x93aa21['id'];return db[_0x6ba8('0x72')]['create'](_0x31c130[_0x6ba8('0x65')]);}})[_0x6ba8('0x13')](respondWithResult(_0x906644,null))[_0x6ba8('0x1d')](handleError(_0x906644,null));};exports[_0x6ba8('0x73')]=function(_0x37b4b5,_0x3a4fda){var _0x586480={'raw':![],'where':{}};var _0x164d91={};var _0x4e98c={'count':0x0,'rows':[]};return db[_0x6ba8('0x48')]['findOne']({'where':{'id':_0x37b4b5[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x3a4fda,null))[_0x6ba8('0x13')](function(_0x4816f4){if(_0x4816f4){_0x164d91[_0x6ba8('0x4c')]=_[_0x6ba8('0x61')](db[_0x6ba8('0x72')][_0x6ba8('0x62')]);_0x164d91[_0x6ba8('0x4d')]=_[_0x6ba8('0x61')](_0x37b4b5[_0x6ba8('0x4d')]);_0x164d91[_0x6ba8('0x4e')]=_[_0x6ba8('0x4f')](_0x164d91[_0x6ba8('0x4c')],_0x164d91[_0x6ba8('0x4d')]);_0x586480[_0x6ba8('0x51')]=_['intersection'](_0x164d91[_0x6ba8('0x4c')],qs['fields'](_0x37b4b5[_0x6ba8('0x4d')]['fields']));_0x586480[_0x6ba8('0x51')]=_0x586480[_0x6ba8('0x51')][_0x6ba8('0x52')]?_0x586480[_0x6ba8('0x51')]:_0x164d91[_0x6ba8('0x4c')];if(!_0x37b4b5['query']['hasOwnProperty'](_0x6ba8('0x54'))){_0x586480[_0x6ba8('0x23')]=qs[_0x6ba8('0x23')](_0x37b4b5['query'][_0x6ba8('0x23')]);_0x586480[_0x6ba8('0x21')]=qs['offset'](_0x37b4b5['query']['offset']);}_0x586480[_0x6ba8('0x6d')]=qs['sort'](_0x37b4b5[_0x6ba8('0x4d')][_0x6ba8('0x55')]);_0x586480[_0x6ba8('0x58')]=qs['filters'](_[_0x6ba8('0x56')](_0x37b4b5[_0x6ba8('0x4d')],_0x164d91[_0x6ba8('0x4e')]));_0x586480[_0x6ba8('0x58')][_0x6ba8('0x6a')]=_0x4816f4['id'];if(_0x37b4b5['query'][_0x6ba8('0x57')]){_0x586480[_0x6ba8('0x58')]=_[_0x6ba8('0x59')](_0x586480[_0x6ba8('0x58')],{'$or':_[_0x6ba8('0x47')](_0x586480[_0x6ba8('0x51')],function(_0x26720e){var _0x39dc0e={};_0x39dc0e[_0x26720e]={'$like':'%'+_0x37b4b5[_0x6ba8('0x4d')][_0x6ba8('0x57')]+'%'};return _0x39dc0e;})});}_0x586480=_[_0x6ba8('0x59')]({},_0x586480,_0x37b4b5[_0x6ba8('0x5b')]);return db[_0x6ba8('0x72')][_0x6ba8('0x24')]({'where':_0x586480[_0x6ba8('0x58')]})[_0x6ba8('0x13')](function(_0xf1f2c5){_0x4e98c[_0x6ba8('0x24')]=_0xf1f2c5;if(_0x37b4b5[_0x6ba8('0x4d')][_0x6ba8('0x5c')]){_0x586480[_0x6ba8('0x63')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x586480);})['then'](function(_0x105b3b){_0x4e98c[_0x6ba8('0x5e')]=_0x105b3b;return _0x4e98c;});}})[_0x6ba8('0x13')](respondWithFilteredResult(_0x3a4fda,_0x586480))[_0x6ba8('0x1d')](handleError(_0x3a4fda,null));};exports[_0x6ba8('0x74')]=function(_0x41e340,_0x395e24){return db[_0x6ba8('0x48')][_0x6ba8('0x64')]({'where':{'id':_0x41e340['params']['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x395e24,null))[_0x6ba8('0x13')](function(_0x2f386c){if(_0x2f386c){return _0x2f386c['removeAnswers'](_0x41e340['query']['ids']);}})[_0x6ba8('0x13')](respondWithStatusCode(_0x395e24,null))[_0x6ba8('0x1d')](handleError(_0x395e24,null));};exports[_0x6ba8('0x6b')]=function(_0x3d278f,_0x38afa6){var _0x1e1c40={'name':_0x3d278f[_0x6ba8('0x65')]['name'],'key':_0x3d278f[_0x6ba8('0x65')][_0x6ba8('0x4b')],'provider':_0x3d278f['body']['provider']===_0x6ba8('0x67')?null:_0x3d278f[_0x6ba8('0x65')][_0x6ba8('0x66')],'email':_0x3d278f['body'][_0x6ba8('0x75')],'ListId':_0x3d278f[_0x6ba8('0x65')]['ListId'],'active':!_[_0x6ba8('0x76')](_0x3d278f[_0x6ba8('0x65')]['active'])?_0x3d278f[_0x6ba8('0x65')]['active']:!![],'description':_0x3d278f[_0x6ba8('0x65')][_0x6ba8('0x77')]||null};var _0x195ae9=getAuthenticationOptions(_0x1e1c40['provider'],_0x3d278f['body']);_0x1e1c40[_0x6ba8('0x44')]=_0x195ae9['Imap'];_0x1e1c40[_0x6ba8('0x42')]=_0x195ae9[_0x6ba8('0x42')];return db['MailAccount'][_0x6ba8('0x6b')](_0x1e1c40,{'include':[{'model':db[_0x6ba8('0x45')],'as':_0x6ba8('0x42')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x6ba8('0x13')](function(_0x52d77d){var _0x24da5b=_0x3d278f[_0x6ba8('0x37')][_0x6ba8('0x78')]({'plain':!![]});if(!_0x24da5b)throw new Error(_0x6ba8('0x79'));if(_0x24da5b['role']===_0x6ba8('0x37')){var _0x155000=_0x52d77d[_0x6ba8('0x78')]({'plain':!![]});return db[_0x6ba8('0x7a')][_0x6ba8('0x64')]({'where':{'name':_0x6ba8('0x7b'),'userProfileId':_0x24da5b['userProfileId']},'raw':!![]})[_0x6ba8('0x13')](function(_0xc68c66){if(_0xc68c66&&_0xc68c66[_0x6ba8('0x7c')]===0x0){return db['UserProfileResource'][_0x6ba8('0x6b')]({'name':_0x155000[_0x6ba8('0x2b')],'resourceId':_0x155000['id'],'type':_0xc68c66['name'],'sectionId':_0xc68c66['id']},{})['then'](function(){return _0x52d77d;});}else{return _0x52d77d;}})[_0x6ba8('0x1d')](function(_0x15cf63){logger[_0x6ba8('0x19')](_0x6ba8('0x7d'),_0x15cf63);throw _0x15cf63;});}return _0x52d77d;})[_0x6ba8('0x13')](respondWithResult(_0x38afa6,0xc9))[_0x6ba8('0x1d')](handleError(_0x38afa6,null));};exports[_0x6ba8('0x7e')]=function(_0x3439a8,_0x336d0d){return db[_0x6ba8('0x48')][_0x6ba8('0x6c')]({'where':{'id':_0x3439a8[_0x6ba8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x336d0d,null))['then'](function(_0x5b95da){if(_0x5b95da){return _0x5b95da[_0x6ba8('0x7e')]();}return null;})[_0x6ba8('0x13')](respondWithResult(_0x336d0d,null))[_0x6ba8('0x1d')](handleError(_0x336d0d,null));};exports[_0x6ba8('0x7f')]=function(_0x4e5ca3,_0xc3bde8){if(_0x4e5ca3[_0x6ba8('0x65')]['id']){delete _0x4e5ca3[_0x6ba8('0x65')]['id'];}return db['MailAccount'][_0x6ba8('0x64')]({'where':{'id':_0x4e5ca3[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0xc3bde8,null))[_0x6ba8('0x13')](function(_0x9cf701){if(_0x9cf701){_0x4e5ca3['body']['MailAccountId']=_0x9cf701['id'];return db[_0x6ba8('0x43')][_0x6ba8('0x6b')](_0x4e5ca3[_0x6ba8('0x65')]);}})[_0x6ba8('0x13')](respondWithResult(_0xc3bde8,null))['catch'](handleError(_0xc3bde8,null));};exports[_0x6ba8('0x80')]=function(_0x5007bf,_0x50f426){return db[_0x6ba8('0x48')][_0x6ba8('0x6c')]({'where':{'id':_0x5007bf[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x50f426,null))[_0x6ba8('0x13')](function(_0x264ec3){if(_0x264ec3){return _0x264ec3[_0x6ba8('0x81')](null);}return null;})[_0x6ba8('0x13')](respondWithStatusCode(_0x50f426,null))[_0x6ba8('0x1d')](handleError(_0x50f426,null));};exports['getSmtp']=function(_0x15d7b3,_0x235496){return db[_0x6ba8('0x48')][_0x6ba8('0x6c')]({'where':{'id':_0x15d7b3['params']['id']}})['then'](handleEntityNotFound(_0x235496,null))['then'](function(_0x1ce85a){if(_0x1ce85a){return _0x1ce85a['getSmtp']();}return null;})['then'](respondWithResult(_0x235496,null))[_0x6ba8('0x1d')](handleError(_0x235496,null));};exports['addSmtp']=function(_0x236838,_0x1bd6f0){if(_0x236838[_0x6ba8('0x65')]['id']){delete _0x236838[_0x6ba8('0x65')]['id'];}return db[_0x6ba8('0x48')][_0x6ba8('0x64')]({'where':{'id':_0x236838[_0x6ba8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1bd6f0,null))[_0x6ba8('0x13')](function(_0x1a254a){if(_0x1a254a){_0x236838[_0x6ba8('0x65')]['MailAccountId']=_0x1a254a['id'];return db[_0x6ba8('0x45')][_0x6ba8('0x6b')](_0x236838['body']);}})[_0x6ba8('0x13')](respondWithResult(_0x1bd6f0,null))[_0x6ba8('0x1d')](handleError(_0x1bd6f0,null));};exports[_0x6ba8('0x82')]=function(_0x3f6a4a,_0x57113a){return db[_0x6ba8('0x48')][_0x6ba8('0x6c')]({'where':{'id':_0x3f6a4a[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x57113a,null))[_0x6ba8('0x13')](function(_0x4aa341){if(_0x4aa341){return _0x4aa341[_0x6ba8('0x83')](null);}return null;})[_0x6ba8('0x13')](respondWithStatusCode(_0x57113a,null))[_0x6ba8('0x1d')](handleError(_0x57113a,null));};exports[_0x6ba8('0x84')]=function(_0x898e74,_0x26182a){return db[_0x6ba8('0x85')]['find']({'where':{'id':_0x898e74['params']['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x26182a,null))[_0x6ba8('0x13')](function(_0x2eb0b7){if(_0x2eb0b7){return _0x2eb0b7['addInteraction'](_0x898e74['body'][_0x6ba8('0x70')],_[_0x6ba8('0x86')](_0x898e74[_0x6ba8('0x65')],[_0x6ba8('0x70'),'id'])||{});}})['then'](respondWithResult(_0x26182a,null))[_0x6ba8('0x1d')](handleError(_0x26182a,null));};exports[_0x6ba8('0x87')]=function(_0x10e900,_0x23c015){var _0x318a4f={'raw':![],'where':{}};var _0x544053={};var _0x4ff681={'count':0x0,'rows':[]};return db[_0x6ba8('0x48')][_0x6ba8('0x6c')]({'where':{'id':_0x10e900['params']['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x23c015,null))['then'](function(_0x245680){if(_0x245680){_0x544053[_0x6ba8('0x4c')]=_[_0x6ba8('0x61')](db[_0x6ba8('0x85')][_0x6ba8('0x62')]);_0x544053[_0x6ba8('0x4d')]=_[_0x6ba8('0x61')](_0x10e900[_0x6ba8('0x4d')]);_0x544053[_0x6ba8('0x4e')]=_[_0x6ba8('0x4f')](_0x544053[_0x6ba8('0x4c')],_0x544053[_0x6ba8('0x4d')]);_0x318a4f[_0x6ba8('0x51')]=_[_0x6ba8('0x4f')](_0x544053[_0x6ba8('0x4c')],qs[_0x6ba8('0x50')](_0x10e900[_0x6ba8('0x4d')]['fields']));_0x318a4f[_0x6ba8('0x51')]=_0x318a4f[_0x6ba8('0x51')][_0x6ba8('0x52')]?_0x318a4f[_0x6ba8('0x51')]:_0x544053['model'];if(!_0x10e900[_0x6ba8('0x4d')][_0x6ba8('0x53')]('nolimit')){_0x318a4f[_0x6ba8('0x23')]=qs[_0x6ba8('0x23')](_0x10e900[_0x6ba8('0x4d')]['limit']);_0x318a4f[_0x6ba8('0x21')]=qs[_0x6ba8('0x21')](_0x10e900[_0x6ba8('0x4d')][_0x6ba8('0x21')]);}_0x318a4f[_0x6ba8('0x6d')]=qs['sort'](_0x10e900[_0x6ba8('0x4d')][_0x6ba8('0x55')]);_0x318a4f[_0x6ba8('0x58')]=qs[_0x6ba8('0x4e')](_[_0x6ba8('0x56')](_0x10e900[_0x6ba8('0x4d')],_0x544053[_0x6ba8('0x4e')]));_0x318a4f[_0x6ba8('0x58')]['MailAccountId']=_0x245680['id'];if(_0x10e900[_0x6ba8('0x4d')][_0x6ba8('0x57')]){_0x318a4f[_0x6ba8('0x58')]=_[_0x6ba8('0x59')](_0x318a4f[_0x6ba8('0x58')],{'$or':_[_0x6ba8('0x47')](_0x318a4f[_0x6ba8('0x51')],function(_0x4c92d3){var _0x4c9d41={};_0x4c9d41[_0x4c92d3]={'$like':'%'+_0x10e900[_0x6ba8('0x4d')][_0x6ba8('0x57')]+'%'};return _0x4c9d41;})});}_0x318a4f=_['merge']({},_0x318a4f,_0x10e900[_0x6ba8('0x5b')]);return db['MailInteraction'][_0x6ba8('0x24')]({'where':_0x318a4f['where']})[_0x6ba8('0x13')](function(_0x1e1f25){_0x4ff681['count']=_0x1e1f25;if(_0x10e900[_0x6ba8('0x4d')][_0x6ba8('0x5c')]){_0x318a4f[_0x6ba8('0x63')]=[{'model':db[_0x6ba8('0x88')],'as':_0x6ba8('0x89'),'required':![]},{'model':db[_0x6ba8('0x8a')],'as':_0x6ba8('0x8b'),'attributes':[_0x6ba8('0x2b'),_0x6ba8('0x8c'),'internal'],'required':![]},{'model':db[_0x6ba8('0x8d')],'as':_0x6ba8('0x8e'),'attributes':['id','name',_0x6ba8('0x8f')],'where':_0x10e900[_0x6ba8('0x4d')][_0x6ba8('0x90')]?{'id':_0x10e900[_0x6ba8('0x4d')][_0x6ba8('0x90')]}:undefined,'required':_0x10e900['query']['tag']?!![]:![]}];}return db[_0x6ba8('0x85')][_0x6ba8('0x5d')](_0x318a4f);})[_0x6ba8('0x13')](function(_0x2fba59){_0x4ff681[_0x6ba8('0x5e')]=_0x2fba59;return _0x4ff681;});}})[_0x6ba8('0x13')](respondWithFilteredResult(_0x23c015,_0x318a4f))[_0x6ba8('0x1d')](handleError(_0x23c015,null));};exports[_0x6ba8('0x91')]=function addApplications(_0x30fa77,_0x99f88){var _0x1a7795=_0x30fa77['params']['id'];var _0x26760d=_0x30fa77[_0x6ba8('0x65')];var _0x103aa5=0xc8;var _0x1c43a0=null;return db[_0x6ba8('0x92')][_0x6ba8('0x93')]({'isolationLevel':db[_0x6ba8('0x92')]['Transaction'][_0x6ba8('0x94')][_0x6ba8('0x95')]},function(_0xe43371){return db[_0x6ba8('0x48')][_0x6ba8('0x6c')]({'where':{'id':_0x1a7795},'transaction':_0xe43371})[_0x6ba8('0x13')](function(_0x4be2f5){if(_0x4be2f5){return db[_0x6ba8('0x96')]['destroy']({'where':{'MailAccountId':_0x1a7795},'transaction':_0xe43371})[_0x6ba8('0x13')](function(){var _0x302ff9=_[_0x6ba8('0x47')](_0x26760d,function(_0x35bf62){_0x35bf62[_0x6ba8('0x6a')]=_0x1a7795;return _0x35bf62;});return db[_0x6ba8('0x96')][_0x6ba8('0x97')](_0x302ff9,{'transaction':_0xe43371});});}else{_0x103aa5=0x194;_0x1c43a0=[];}});})['then'](function(){if(_0x103aa5!==0x194){return db[_0x6ba8('0x96')][_0x6ba8('0x98')]({'where':{'MailAccountId':_0x1a7795},'order':_0x6ba8('0x99')})[_0x6ba8('0x13')](function(_0x148296){_0x1c43a0=_0x148296;});}})[_0x6ba8('0x1d')](function(_0x34e289){_0x103aa5=0x1f4;logger['error'](_0x34e289[_0x6ba8('0x2a')]);if(_0x34e289[_0x6ba8('0x2b')]){delete _0x34e289[_0x6ba8('0x2b')];}_0x1c43a0=_0x34e289;})[_0x6ba8('0x9a')](function(){if(_0x1c43a0===null){_0x99f88['sendStatus'](_0x103aa5);}else{if(_0x103aa5===0x1f4){_0x99f88[_0x6ba8('0x1f')](_0x103aa5)[_0x6ba8('0x9b')](_0x1c43a0);}else{_0x99f88[_0x6ba8('0x1f')](_0x103aa5)[_0x6ba8('0x9c')](_0x1c43a0);}}});};exports[_0x6ba8('0x9d')]=function(_0x825ca8,_0x178569){var _0x3b8e86={};var _0x51c6eb={};var _0x2ad9a3;var _0xfeb222;return db[_0x6ba8('0x48')]['findOne']({'where':{'id':_0x825ca8[_0x6ba8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x178569,null))[_0x6ba8('0x13')](function(_0x581451){if(_0x581451){_0x2ad9a3=_0x581451;_0x51c6eb['model']=_['keys'](db[_0x6ba8('0x96')][_0x6ba8('0x62')]);_0x51c6eb[_0x6ba8('0x4d')]=_[_0x6ba8('0x61')](_0x825ca8[_0x6ba8('0x4d')]);_0x51c6eb[_0x6ba8('0x4e')]=_[_0x6ba8('0x4f')](_0x51c6eb[_0x6ba8('0x4c')],_0x51c6eb[_0x6ba8('0x4d')]);_0x3b8e86['attributes']=_['intersection'](_0x51c6eb[_0x6ba8('0x4c')],qs[_0x6ba8('0x50')](_0x825ca8[_0x6ba8('0x4d')][_0x6ba8('0x50')]));_0x3b8e86[_0x6ba8('0x51')]=_0x3b8e86[_0x6ba8('0x51')]['length']?_0x3b8e86['attributes']:_0x51c6eb['model'];_0x3b8e86['order']=qs[_0x6ba8('0x55')](_0x825ca8[_0x6ba8('0x4d')][_0x6ba8('0x55')]);_0x3b8e86[_0x6ba8('0x58')]=qs[_0x6ba8('0x4e')](_['pick'](_0x825ca8[_0x6ba8('0x4d')],_0x51c6eb[_0x6ba8('0x4e')]));if(_0x825ca8[_0x6ba8('0x4d')][_0x6ba8('0x57')]){_0x3b8e86[_0x6ba8('0x58')]=_['merge'](_0x3b8e86[_0x6ba8('0x58')],{'$or':_[_0x6ba8('0x47')](_0x3b8e86[_0x6ba8('0x51')],function(_0x153c8e){var _0x26bc6b={};_0x26bc6b[_0x153c8e]={'$like':'%'+_0x825ca8[_0x6ba8('0x4d')][_0x6ba8('0x57')]+'%'};return _0x26bc6b;})});}_0x3b8e86=_['merge']({},_0x3b8e86,_0x825ca8[_0x6ba8('0x5b')]);return _0x2ad9a3[_0x6ba8('0x9d')](_0x3b8e86);}})['then'](function(_0x5ab104){if(_0x5ab104){_0xfeb222=_0x5ab104[_0x6ba8('0x52')];if(!_0x825ca8[_0x6ba8('0x4d')][_0x6ba8('0x53')]('nolimit')){_0x3b8e86[_0x6ba8('0x23')]=qs[_0x6ba8('0x23')](_0x825ca8[_0x6ba8('0x4d')]['limit']);_0x3b8e86[_0x6ba8('0x21')]=qs[_0x6ba8('0x21')](_0x825ca8[_0x6ba8('0x4d')][_0x6ba8('0x21')]);}return _0x2ad9a3[_0x6ba8('0x9d')](_0x3b8e86);}})['then'](function(_0x5a3675){if(_0x5a3675){return _0x5a3675?{'count':_0xfeb222,'rows':_0x5a3675}:null;}})[_0x6ba8('0x13')](respondWithResult(_0x178569,null))['catch'](handleError(_0x178569,null));};exports[_0x6ba8('0x9e')]=function(_0x1252c8,_0x1b881c){var _0x1664f9={'raw':!![],'where':{}};var _0x27e143={};var _0x10ac0b={'count':0x0,'rows':[]};return db[_0x6ba8('0x48')][_0x6ba8('0x6c')]({'where':{'id':_0x1252c8[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x1b881c,null))[_0x6ba8('0x13')](function(_0x56ec1c){if(_0x56ec1c){_0x27e143[_0x6ba8('0x4c')]=_['keys'](db[_0x6ba8('0x9f')][_0x6ba8('0x62')]);_0x27e143[_0x6ba8('0x4d')]=_[_0x6ba8('0x61')](_0x1252c8[_0x6ba8('0x4d')]);_0x27e143['filters']=_[_0x6ba8('0x4f')](_0x27e143[_0x6ba8('0x4c')],_0x27e143[_0x6ba8('0x4d')]);_0x1664f9[_0x6ba8('0x51')]=_[_0x6ba8('0x4f')](_0x27e143[_0x6ba8('0x4c')],qs[_0x6ba8('0x50')](_0x1252c8['query'][_0x6ba8('0x50')]));_0x1664f9['attributes']=_0x1664f9['attributes'][_0x6ba8('0x52')]?_0x1664f9['attributes']:_0x27e143[_0x6ba8('0x4c')];if(!_0x1252c8[_0x6ba8('0x4d')][_0x6ba8('0x53')]('nolimit')){_0x1664f9[_0x6ba8('0x23')]=qs['limit'](_0x1252c8[_0x6ba8('0x4d')]['limit']);_0x1664f9['offset']=qs[_0x6ba8('0x21')](_0x1252c8['query']['offset']);}_0x1664f9[_0x6ba8('0x6d')]=qs[_0x6ba8('0x55')](_0x1252c8[_0x6ba8('0x4d')][_0x6ba8('0x55')]);_0x1664f9[_0x6ba8('0x58')]=qs[_0x6ba8('0x4e')](_[_0x6ba8('0x56')](_0x1252c8[_0x6ba8('0x4d')],_0x27e143[_0x6ba8('0x4e')]));_0x1664f9['where'][_0x6ba8('0x6a')]=_0x56ec1c['id'];if(_0x1252c8['query'][_0x6ba8('0x57')]){_0x1664f9[_0x6ba8('0x58')]=_[_0x6ba8('0x59')](_0x1664f9[_0x6ba8('0x58')],{'$or':_[_0x6ba8('0x47')](_0x1664f9['attributes'],function(_0x59e1b6){var _0x4d73a3={};_0x4d73a3[_0x59e1b6]={'$like':'%'+_0x1252c8[_0x6ba8('0x4d')][_0x6ba8('0x57')]+'%'};return _0x4d73a3;})});}if(_0x1252c8[_0x6ba8('0x4d')]['$gte']){var _0x2595ef=_0x1252c8[_0x6ba8('0x4d')][_0x6ba8('0xa0')]['split'](',');var _0x470368={};_0x470368[_0x2595ef[0x0]]={'$gte':moment(_0x2595ef[0x1])[_0x6ba8('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1664f9[_0x6ba8('0x58')]=_['merge'](_0x1664f9['where'],_0x470368);}_0x1664f9=_[_0x6ba8('0x59')]({},_0x1664f9,_0x1252c8['options']);return db['MailMessage'][_0x6ba8('0x24')]({'where':_0x1664f9[_0x6ba8('0x58')]})['then'](function(_0xff4da5){_0x10ac0b[_0x6ba8('0x24')]=_0xff4da5;if(_0x1252c8[_0x6ba8('0x4d')]['includeAll']){_0x1664f9[_0x6ba8('0x63')]=[{'all':!![]}];}return db['MailMessage'][_0x6ba8('0x5d')](_0x1664f9);})['then'](function(_0x330e73){if(_0x1252c8[_0x6ba8('0x4d')][_0x6ba8('0xa2')]===_0x6ba8('0xa3')){for(var _0x5dd3c8=0x0;_0x5dd3c8<_0x330e73[_0x6ba8('0x52')];_0x5dd3c8++){_0x330e73[_0x5dd3c8][_0x6ba8('0x65')]=juice(_0x330e73[_0x5dd3c8][_0x6ba8('0x65')]);}}_0x10ac0b[_0x6ba8('0x5e')]=_0x330e73;return _0x10ac0b;});}})[_0x6ba8('0x13')](respondWithFilteredResult(_0x1b881c,_0x1664f9))[_0x6ba8('0x1d')](handleError(_0x1b881c,null));};exports[_0x6ba8('0x9b')]=function(_0x52398c,_0xb2e538){var _0x103a02,_0x2bf76c={},_0x507958;if(_0x52398c[_0x6ba8('0x65')]['to']){_0x507958=_0x52398c[_0x6ba8('0x65')]['to'][_0x6ba8('0xa4')](',')[0x0];}return db['MailAccount'][_0x6ba8('0x64')]({'where':{'id':_0x52398c[_0x6ba8('0x5f')]['id']},'include':[{'model':db[_0x6ba8('0xa5')],'as':'List','include':[{'model':db[_0x6ba8('0x88')],'as':_0x6ba8('0xa6'),'where':{'email':_0x507958},'limit':0x1,'order':[[_0x6ba8('0xa7'),'DESC']]}]},{'model':db[_0x6ba8('0x45')],'as':_0x6ba8('0x42'),'raw':!![],'include':[{'model':db[_0x6ba8('0xa8')],'as':_0x6ba8('0xa8'),'raw':!![]}]}]})[_0x6ba8('0x13')](handleEntityNotFound(_0xb2e538,null))[_0x6ba8('0x13')](function(_0x39abe5){if(!_0x39abe5)return;_0x103a02=_0x39abe5;if(!_0x39abe5['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x6ba8('0x76')](_0x52398c[_0x6ba8('0x65')][_0x6ba8('0xa9')])){_0x52398c[_0x6ba8('0x65')][_0x6ba8('0xa9')]=util[_0x6ba8('0xa1')](_0x6ba8('0xaa'),_0x39abe5[_0x6ba8('0x2b')],_0x39abe5[_0x6ba8('0x75')]||_0x39abe5[_0x6ba8('0x42')]['user']);}if(_0x52398c['body']['attachments']&&_0x52398c['body'][_0x6ba8('0xab')][_0x6ba8('0x52')]){for(var _0x33520e=0x0;_0x33520e<_0x52398c[_0x6ba8('0x65')][_0x6ba8('0xab')][_0x6ba8('0x52')];_0x33520e+=0x1){_0x52398c[_0x6ba8('0x65')][_0x6ba8('0xab')][_0x33520e]={'filename':_0x52398c['body'][_0x6ba8('0xab')][_0x33520e]['name'],'path':path['join'](config[_0x6ba8('0xac')],'server/files/attachments',_0x52398c[_0x6ba8('0x65')][_0x6ba8('0xab')][_0x33520e][_0x6ba8('0xad')])};}}var _0x3402da=_0x39abe5[_0x6ba8('0xae')]();return respondWithRpcPromise(_0x6ba8('0xaf'),_0x6ba8('0xb0'),{'account':_0x3402da,'message':_0x52398c['body']});})[_0x6ba8('0x13')](function(_0x4b12da){if(!_0x4b12da)return;_0x2bf76c=_0x4b12da;if(!_0x103a02[_0x6ba8('0xb1')])throw new Error(_0x6ba8('0xb2'));if(_0x103a02[_0x6ba8('0xb1')][_0x6ba8('0xa6')][_0x6ba8('0x52')])return _0x103a02[_0x6ba8('0xb1')][_0x6ba8('0xa6')][0x0];return db['CmContact'][_0x6ba8('0x6b')](_[_0x6ba8('0xb')](_0x52398c[_0x6ba8('0x65')],{'firstName':_0x52398c[_0x6ba8('0x65')]['to'],'email':_0x52398c[_0x6ba8('0x65')]['to'],'phone':_0x52398c[_0x6ba8('0x65')]['to'],'ListId':_0x103a02[_0x6ba8('0xb3')]}));})[_0x6ba8('0x13')](function(_0xeb38b2){if(!_0xeb38b2)return;var _0x62684c={'UserId':_0x52398c[_0x6ba8('0x37')]['id'],'ContactId':_0xeb38b2['id'],'MailAccountId':_0x103a02['id'],'inReplyTo':_0x2bf76c['messageId'],'to':_0x52398c[_0x6ba8('0x65')][_0x6ba8('0xa9')],'cc':_0x52398c[_0x6ba8('0x65')]['cc'],'subject':_0x52398c[_0x6ba8('0x65')]['subject'],'attach':_0x52398c[_0x6ba8('0x65')][_0x6ba8('0xb4')],'firstMsgDirection':_0x6ba8('0xb5'),'lastMsgAt':moment()[_0x6ba8('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x6ba8('0xb5'),'Messages':[_['merge'](_0x52398c['body'],{'messageId':_0x2bf76c[_0x6ba8('0xb6')],'sentAt':moment()[_0x6ba8('0xa1')](_0x6ba8('0xb7')),'read':!![],'MailAccountId':_0x103a02['id'],'UserId':_0x52398c['user']['id'],'ContactId':_0xeb38b2['id']})]};if(_0x52398c[_0x6ba8('0x65')][_0x6ba8('0xb8')]){_0x62684c=_[_0x6ba8('0x59')](_0x62684c,_0x52398c['body']['Interaction']);}return db[_0x6ba8('0x85')][_0x6ba8('0x6b')](_0x62684c,{'include':[{'model':db['MailMessage'],'as':_0x6ba8('0xb9')}]});})['then'](respondWithResult(_0xb2e538,null))[_0x6ba8('0x1d')](handleError(_0xb2e538,null));};exports['verifySmtp']=function(_0x1b1f74,_0x352cef){return db['MailAccount'][_0x6ba8('0x64')]({'where':{'id':_0x1b1f74[_0x6ba8('0x5f')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x6ba8('0x42'),'raw':!![],'include':[{'model':db[_0x6ba8('0xa8')],'as':_0x6ba8('0xa8'),'raw':!![]}]}]})[_0x6ba8('0x13')](handleEntityNotFound(_0x352cef,null))['then'](function(_0x13e780){if(!_0x13e780[_0x6ba8('0x42')])return;var _0x3be0ad=_0x13e780[_0x6ba8('0xae')]();return respondWithRpcPromise(_0x6ba8('0xba'),_0x6ba8('0xbb'),{'account':_0x3be0ad});})[_0x6ba8('0x13')](respondWithResult(_0x352cef,null))[_0x6ba8('0x1d')](handleError(_0x352cef,null));};exports[_0x6ba8('0x28')]=function(_0x3672d2,_0x26d2ed){return db['MailAccount']['find']({'where':{'id':_0x3672d2[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x26d2ed,null))[_0x6ba8('0x13')](function(_0x272bbf){if(_0x272bbf&&_0x272bbf[_0x6ba8('0x40')]){throw new db['Sequelize'][(_0x6ba8('0xbc'))](_0x6ba8('0xbd'));}return _0x272bbf;})[_0x6ba8('0x13')](removeEntity(_0x26d2ed,null))[_0x6ba8('0x1d')](handleError(_0x26d2ed,null));};exports[_0x6ba8('0xbe')]=function(_0x1c4cfb,_0x4708e4){return db['MailAccount'][_0x6ba8('0x64')]({'where':{'id':_0x1c4cfb[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x4708e4,null))[_0x6ba8('0x13')](function(_0x10adb1){if(_0x10adb1){return _0x10adb1['addAgents'](_0x1c4cfb[_0x6ba8('0x65')][_0x6ba8('0x70')],_[_0x6ba8('0x86')](_0x1c4cfb[_0x6ba8('0x65')],['ids','id'])||{})['spread'](function(_0x542634){for(var _0x31c912=0x0;_0x31c912<_0x1c4cfb[_0x6ba8('0x65')]['ids'][_0x6ba8('0x52')];_0x31c912+=0x1){socket['emit'](_0x6ba8('0xbf'),{'UserId':Number(_0x1c4cfb['body']['ids'][_0x31c912]),'MailAccountId':Number(_0x1c4cfb[_0x6ba8('0x5f')]['id'])});}return _0x542634;});}})[_0x6ba8('0x13')](respondWithResult(_0x4708e4,null))['catch'](handleError(_0x4708e4,null));};exports[_0x6ba8('0xc0')]=function(_0x6cdbc8,_0x497c33){return db[_0x6ba8('0x48')][_0x6ba8('0x64')]({'where':{'id':_0x6cdbc8[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x497c33,null))[_0x6ba8('0x13')](function(_0x43482e){if(_0x43482e){return _0x43482e['removeAgents'](_0x6cdbc8[_0x6ba8('0x4d')]['ids'])[_0x6ba8('0x13')](function(){if(_['isArray'](_0x6cdbc8[_0x6ba8('0x4d')][_0x6ba8('0x70')])){for(var _0x3859bd=0x0;_0x3859bd<_0x6cdbc8[_0x6ba8('0x4d')][_0x6ba8('0x70')][_0x6ba8('0x52')];_0x3859bd+=0x1){socket[_0x6ba8('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x6cdbc8[_0x6ba8('0x4d')]['ids'][_0x3859bd]),'MailAccountId':Number(_0x6cdbc8[_0x6ba8('0x5f')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x6cdbc8[_0x6ba8('0x4d')]['ids']),'MailAccountId':Number(_0x6cdbc8['params']['id'])});}});}})[_0x6ba8('0x13')](respondWithStatusCode(_0x497c33,null))[_0x6ba8('0x1d')](handleError(_0x497c33,null));};exports[_0x6ba8('0xc2')]=function(_0x51f14d,_0x161eeb){var _0x2ccfaf={};var _0x2532b8={};var _0x425561;var _0x38345f;return db[_0x6ba8('0x48')][_0x6ba8('0x6c')]({'where':{'id':_0x51f14d[_0x6ba8('0x5f')]['id']}})[_0x6ba8('0x13')](handleEntityNotFound(_0x161eeb,null))[_0x6ba8('0x13')](function(_0x48a3fd){if(_0x48a3fd){_0x425561=_0x48a3fd;_0x2532b8['model']=_[_0x6ba8('0x61')](db[_0x6ba8('0x8a')]['rawAttributes']);_0x2532b8[_0x6ba8('0x4d')]=_['keys'](_0x51f14d['query']);_0x2532b8[_0x6ba8('0x4e')]=_[_0x6ba8('0x4f')](_0x2532b8['model'],_0x2532b8[_0x6ba8('0x4d')]);_0x2ccfaf[_0x6ba8('0x51')]=_[_0x6ba8('0x4f')](_0x2532b8['model'],qs[_0x6ba8('0x50')](_0x51f14d[_0x6ba8('0x4d')][_0x6ba8('0x50')]));_0x2ccfaf[_0x6ba8('0x51')]=_0x2ccfaf[_0x6ba8('0x51')]['length']?_0x2ccfaf[_0x6ba8('0x51')]:_0x2532b8[_0x6ba8('0x4c')];_0x2ccfaf[_0x6ba8('0x6d')]=qs['sort'](_0x51f14d[_0x6ba8('0x4d')][_0x6ba8('0x55')]);_0x2ccfaf['where']=qs['filters'](_[_0x6ba8('0x56')](_0x51f14d[_0x6ba8('0x4d')],_0x2532b8['filters']));if(_0x51f14d['query'][_0x6ba8('0x57')]){_0x2ccfaf[_0x6ba8('0x58')]=_['merge'](_0x2ccfaf[_0x6ba8('0x58')],{'$or':_[_0x6ba8('0x47')](_0x2ccfaf[_0x6ba8('0x51')],function(_0x258200){var _0x1e6d20={};_0x1e6d20[_0x258200]={'$like':'%'+_0x51f14d['query'][_0x6ba8('0x57')]+'%'};return _0x1e6d20;})});}_0x2ccfaf=_[_0x6ba8('0x59')]({},_0x2ccfaf,_0x51f14d[_0x6ba8('0x5b')]);return _0x425561['getAgents'](_0x2ccfaf);}})['then'](function(_0x405b67){if(_0x405b67){_0x38345f=_0x405b67[_0x6ba8('0x52')];if(!_0x51f14d['query'][_0x6ba8('0x53')](_0x6ba8('0x54'))){_0x2ccfaf[_0x6ba8('0x23')]=qs[_0x6ba8('0x23')](_0x51f14d['query'][_0x6ba8('0x23')]);_0x2ccfaf[_0x6ba8('0x21')]=qs['offset'](_0x51f14d[_0x6ba8('0x4d')][_0x6ba8('0x21')]);}return _0x425561['getAgents'](_0x2ccfaf);}})['then'](function(_0x35d2e8){if(_0x35d2e8){return _0x35d2e8?{'count':_0x38345f,'rows':_0x35d2e8}:null;}})[_0x6ba8('0x13')](respondWithResult(_0x161eeb,null))[_0x6ba8('0x1d')](handleError(_0x161eeb,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5fb4b4d..5e13652 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 _0x6334=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1738bc,_0x4d8664){var _0x17f8b4=function(_0x213534){while(--_0x213534){_0x1738bc['push'](_0x1738bc['shift']());}};_0x17f8b4(++_0x4d8664);}(_0x6334,0x168));var _0x4633=function(_0x1d128e,_0x2c87de){_0x1d128e=_0x1d128e-0x0;var _0x3d5236=_0x6334[_0x1d128e];return _0x3d5236;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4633('0x0'))['db'][_0x4633('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4633('0x2')](0x0);var events={'afterCreate':_0x4633('0x3'),'afterUpdate':_0x4633('0x4'),'afterDestroy':_0x4633('0x5')};function emitEvent(_0x3b493f){return function(_0x1cbc11,_0x47d758,_0x43bf3a){MailAccountEvents[_0x4633('0x6')](_0x3b493f+':'+_0x1cbc11['id'],_0x1cbc11);MailAccountEvents[_0x4633('0x6')](_0x3b493f,_0x1cbc11);_0x43bf3a(null);};}for(var e in events){if(events[_0x4633('0x7')](e)){var event=events[e];MailAccount[_0x4633('0x8')](e,emitEvent(event));}}module[_0x4633('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xa647=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x61e635,_0x16f4df){var _0x13e7c4=function(_0x465f33){while(--_0x465f33){_0x61e635['push'](_0x61e635['shift']());}};_0x13e7c4(++_0x16f4df);}(_0xa647,0x81));var _0x7a64=function(_0x22bf9a,_0x2aa3f4){_0x22bf9a=_0x22bf9a-0x0;var _0x14d467=_0xa647[_0x22bf9a];return _0x14d467;};'use strict';var EventEmitter=require(_0x7a64('0x0'));var MailAccount=require(_0x7a64('0x1'))['db'][_0x7a64('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7a64('0x3')](0x0);var events={'afterCreate':_0x7a64('0x4'),'afterUpdate':_0x7a64('0x5'),'afterDestroy':_0x7a64('0x6')};function emitEvent(_0x30b8b7){return function(_0x1c7a04,_0x2e1029,_0x46b8b0){MailAccountEvents[_0x7a64('0x7')](_0x30b8b7+':'+_0x1c7a04['id'],_0x1c7a04);MailAccountEvents['emit'](_0x30b8b7,_0x1c7a04);_0x46b8b0(null);};}for(var e in events){if(events[_0x7a64('0x8')](e)){var event=events[e];MailAccount[_0x7a64('0x9')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index cad46f4..5c5640e 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 _0x0ddf=['define','MailAccount','provider','custom','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports'];(function(_0x3175a9,_0x5907ec){var _0x21728b=function(_0x15dac7){while(--_0x15dac7){_0x3175a9['push'](_0x3175a9['shift']());}};_0x21728b(++_0x5907ec);}(_0x0ddf,0xe8));var _0xf0dd=function(_0x5d6b32,_0x2e3c54){_0x5d6b32=_0x5d6b32-0x0;var _0x4be46b=_0x0ddf[_0x5d6b32];return _0x4be46b;};'use strict';var attributes=require(_0xf0dd('0x0'));module[_0xf0dd('0x1')]=function(_0x579451){return _0x579451[_0xf0dd('0x2')](_0xf0dd('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x52e6a0=this;var _0x2cbf6f={'id':_0x52e6a0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x52e6a0[_0xf0dd('0x4')]!==_0xf0dd('0x5')){_0x2cbf6f['service']=_0x52e6a0[_0xf0dd('0x4')];}else{_0x2cbf6f[_0xf0dd('0x6')]=_0x52e6a0[_0xf0dd('0x7')][_0xf0dd('0x6')];_0x2cbf6f[_0xf0dd('0x8')]=_0x52e6a0[_0xf0dd('0x7')]['port'];_0x2cbf6f[_0xf0dd('0x9')]=_0x52e6a0[_0xf0dd('0x7')]['secure'];}if(_0x52e6a0[_0xf0dd('0x7')][_0xf0dd('0xa')]){if(_0x52e6a0['Smtp'][_0xf0dd('0xb')]){if(!_0x52e6a0[_0xf0dd('0x7')][_0xf0dd('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x2cbf6f[_0xf0dd('0xd')]={'type':_0xf0dd('0xe'),'user':_0x52e6a0[_0xf0dd('0x7')][_0xf0dd('0xf')],'accessToken':_0x52e6a0[_0xf0dd('0x7')][_0xf0dd('0xc')][_0xf0dd('0x10')]};}else{_0x2cbf6f[_0xf0dd('0xd')]={'user':_0x52e6a0[_0xf0dd('0x7')]['user'],'pass':_0x52e6a0[_0xf0dd('0x7')][_0xf0dd('0x11')]};}}return _0x2cbf6f;}}});}; \ No newline at end of file +var _0x5293=['define','MailAccount','mail_accounts','provider','custom','host','port','secure','Smtp','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','./mailAccount.attributes','exports'];(function(_0x1f843d,_0x25136b){var _0x5d698a=function(_0x54e2e6){while(--_0x54e2e6){_0x1f843d['push'](_0x1f843d['shift']());}};_0x5d698a(++_0x25136b);}(_0x5293,0x1e4));var _0x3529=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0x5293[_0x3c81b5];return _0x5888c4;};'use strict';var attributes=require(_0x3529('0x0'));module[_0x3529('0x1')]=function(_0xe0f62f){return _0xe0f62f[_0x3529('0x2')](_0x3529('0x3'),attributes,{'tableName':_0x3529('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5c4c33=this;var _0x5edad0={'id':_0x5c4c33['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5c4c33[_0x3529('0x5')]!==_0x3529('0x6')){_0x5edad0['service']=_0x5c4c33[_0x3529('0x5')];}else{_0x5edad0[_0x3529('0x7')]=_0x5c4c33['Smtp'][_0x3529('0x7')];_0x5edad0[_0x3529('0x8')]=_0x5c4c33['Smtp'][_0x3529('0x8')];_0x5edad0[_0x3529('0x9')]=_0x5c4c33[_0x3529('0xa')][_0x3529('0x9')];}if(_0x5c4c33[_0x3529('0xa')][_0x3529('0xb')]){if(_0x5c4c33[_0x3529('0xa')]['modernAuthentication']){if(!_0x5c4c33['Smtp'][_0x3529('0xc')])throw new Error(_0x3529('0xd'));_0x5edad0[_0x3529('0xe')]={'type':_0x3529('0xf'),'user':_0x5c4c33['Smtp'][_0x3529('0x10')],'accessToken':_0x5c4c33['Smtp'][_0x3529('0xc')]['data5']};}else{_0x5edad0[_0x3529('0xe')]={'user':_0x5c4c33[_0x3529('0xa')][_0x3529('0x10')],'pass':_0x5c4c33['Smtp'][_0x3529('0x11')]};}}return _0x5edad0;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 006e379..49330de 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 _0x7a54=['CloudProvider','get','omit','Applications','smtpOptions','list','applications','orderBy','priority','autoclose','push','length','close','*,*,*,*','Contacts','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','inReplyTo','MailInteraction','create','Contact\x20not\x20found','update','interaction','created','MailMessage','contact','subject','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowMailAccount','MailAccount','smtp','setDataValue','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','updatedAt','DESC','MailServerOut'];(function(_0x2a9548,_0x2742f6){var _0xf55c55=function(_0x2862d8){while(--_0x2862d8){_0x2a9548['push'](_0x2a9548['shift']());}};_0xf55c55(++_0x2742f6);}(_0x7a54,0x106));var _0x47a5=function(_0x7c556b,_0x49de5f){_0x7c556b=_0x7c556b-0x0;var _0x20d2a9=_0x7a54[_0x7c556b];return _0x20d2a9;};'use strict';var _=require(_0x47a5('0x0'));var moment=require(_0x47a5('0x1'));var BPromise=require(_0x47a5('0x2'));var rs=require('randomstring');var Redis=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var jayson=require(_0x47a5('0x7'));var client=jayson[_0x47a5('0x8')][_0x47a5('0x9')]({'port':0x232c});config['redis']=_[_0x47a5('0xa')](config['redis'],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require(_0x47a5('0xc'))(new Redis(config['redis']));require(_0x47a5('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d90b3,_0x582352,_0x2a0e98){return new BPromise(function(_0x2baee7,_0x5e31dd){return client[_0x47a5('0xe')](_0x5d90b3,_0x2a0e98)['then'](function(_0x5de6d7){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x582352,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x582352,_0x47a5('0x11'),JSON[_0x47a5('0x14')](_0x5de6d7));if(_0x5de6d7['error']){if(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x582352,_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x5e31dd(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);}logger['error'](_0x47a5('0x10'),_0x582352,_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2baee7(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x582352,_0x47a5('0x11'));_0x2baee7(_0x5de6d7['result']['message']);}})[_0x47a5('0x18')](function(_0xaf70a6){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x582352,_0xaf70a6);_0x5e31dd(_0xaf70a6);});});}exports[_0x47a5('0x19')]=function(_0x12b98e){var _0x2763d6=this;return new Promise(function(_0xe3c618,_0x3aed38){return db['MailAccount'][_0x47a5('0x1a')]({'raw':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e[_0x47a5('0x1b')]['where']||null:null,'attributes':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e[_0x47a5('0x1b')][_0x47a5('0x1d')]||null:null,'limit':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1e')]||null:null,'include':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x12b98e[_0x47a5('0x1b')][_0x47a5('0x1f')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1f')]?_['map'](_0x3abd6a[_0x47a5('0x1f')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x21')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1d')],'include':_0x5b6c4e[_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x5b6c4e[_0x47a5('0x1f')],function(_0x3ba0b7){return{'model':db[_0x3ba0b7[_0x47a5('0x21')]],'as':_0x3ba0b7['as'],'attributes':_0x3ba0b7[_0x47a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x22')](function(_0x361bfa){logger[_0x47a5('0xf')](_0x47a5('0x19'),_0x12b98e);logger[_0x47a5('0x12')]('GetMailAccount',_0x12b98e,JSON[_0x47a5('0x14')](_0x361bfa));_0xe3c618(_0x361bfa);})['catch'](function(_0x2ef875){logger[_0x47a5('0x15')](_0x47a5('0x19'),_0x2ef875['message'],_0x12b98e);_0x3aed38(_0x2763d6[_0x47a5('0x15')](0x1f4,_0x2ef875[_0x47a5('0x17')]));});});};exports[_0x47a5('0x23')]=function(_0x1f1c68){var _0x51cc81=this;return new Promise(function(_0x50d875,_0x6f9a12){return db[_0x47a5('0x24')]['find']({'raw':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')][_0x47a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')]['where']||null:null,'attributes':_0x1f1c68[_0x47a5('0x1b')]?_0x1f1c68[_0x47a5('0x1b')]['attributes']||null:null,'include':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')]['include']?_[_0x47a5('0x20')](_0x1f1c68[_0x47a5('0x1b')][_0x47a5('0x1f')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x21')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x20')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1d')],'include':_0x25cce0[_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x25cce0[_0x47a5('0x1f')],function(_0x36add5){return{'model':db[_0x36add5[_0x47a5('0x21')]],'as':_0x36add5['as'],'attributes':_0x36add5[_0x47a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x22')](function(_0x1a0d23){if(_0x1f1c68['options'][_0x47a5('0x25')]===!![])_0x1a0d23[_0x47a5('0x26')]('smtpOptions',_0x1a0d23[_0x47a5('0x27')]());logger[_0x47a5('0xf')](_0x47a5('0x23'),_0x1f1c68);logger['debug'](_0x47a5('0x23'),_0x1f1c68,JSON[_0x47a5('0x14')](_0x1a0d23));_0x50d875(_0x1a0d23);})['catch'](function(_0x2ebba0){logger[_0x47a5('0x15')]('ShowMailAccount',_0x2ebba0['message'],_0x1f1c68);_0x6f9a12(_0x51cc81['error'](0x1f4,_0x2ebba0[_0x47a5('0x17')]));});});};exports['NotifyMailAccount']=function(_0x9b5eaf){var _0x1f9631=this;return new Promise(function(_0x301a85,_0x111f0d){var _0x1b2c80={'body':_0x9b5eaf[_0x47a5('0x28')],'channel':_0x47a5('0x29')};var _0x1f3d01=_[_0x47a5('0x2a')](_[_0x47a5('0x2b')](db[_0x47a5('0x2c')][_0x47a5('0x2d')]),[_0x47a5('0x2e'),'updatedAt',_0x47a5('0x2f'),_0x47a5('0x30')]);var _0x331474=![];if(_0x9b5eaf[_0x47a5('0x28')]['id']){delete _0x9b5eaf['body']['id'];}if(_[_0x47a5('0x31')](_0x9b5eaf['body']['from'])){return _0x111f0d(_0x1f9631['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x47a5('0x31')](_0x9b5eaf['body'][_0x47a5('0x28')])||_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x28')]===''){return _0x111f0d(_0x1f9631['error'](0x1f4,_0x47a5('0x32')));}if(_[_0x47a5('0x31')](_0x9b5eaf['body']['mapKey'])){return _0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f3d01));}if(!_[_0x47a5('0x33')](_0x1f3d01,_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x34')])){return _0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,_0x47a5('0x35')+_0x1f3d01));}var _0xf0edbb={};_0xf0edbb[_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x34')]]=_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')];return db[_0x47a5('0x24')][_0x47a5('0x37')]({'where':{'id':_0x9b5eaf[_0x47a5('0x38')]['id']},'include':[{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a'),'include':[{'model':db[_0x47a5('0x2c')],'as':'Contacts','where':_0xf0edbb,'limit':0x1,'order':[[_0x47a5('0x3b'),_0x47a5('0x3c')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x47a5('0x3d')],'as':'Smtp','include':[{'model':db[_0x47a5('0x3e')],'as':_0x47a5('0x3e')}]}]})['then'](function(_0x4f62d3){if(_0x4f62d3&&_0x4f62d3[_0x47a5('0x3a')]){var _0x52d409=_0x4f62d3[_0x47a5('0x3f')]({'plain':!![]});_0x1b2c80[_0x47a5('0x38')]=_[_0x47a5('0x40')](_0x52d409,[_0x47a5('0x41'),_0x47a5('0x3a')]);_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x42')]=_0x4f62d3['getSmtpOptions']();_0x1b2c80['applications']=_0x52d409[_0x47a5('0x41')];_0x1b2c80[_0x47a5('0x43')]=_0x52d409[_0x47a5('0x3a')];_0x1b2c80[_0x47a5('0x44')]=_[_0x47a5('0x45')](_0x1b2c80[_0x47a5('0x44')],[_0x47a5('0x46')],['asc']);if(_0x1b2c80[_0x47a5('0x38')]&&_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x47')]){_0x1b2c80['applications'][_0x47a5('0x48')]({'id':0x0,'priority':_0x1b2c80['applications'][_0x47a5('0x49')]+0x1,'app':_0x47a5('0x4a'),'appdata':_0x47a5('0x47'),'interval':_0x47a5('0x4b')});}if(_0x1b2c80['account'][_0x47a5('0x41')]){delete _0x1b2c80[_0x47a5('0x38')][_0x47a5('0x41')];}if(_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x3a')]){delete _0x1b2c80[_0x47a5('0x38')][_0x47a5('0x3a')];}if(_0x52d409['List'][_0x47a5('0x4c')][_0x47a5('0x49')]){return _0x52d409[_0x47a5('0x3a')][_0x47a5('0x4c')][0x0];}var _0x3329aa=_[_0x47a5('0xa')](_0x9b5eaf['body'],{'firstName':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')],'ListId':_0x52d409[_0x47a5('0x30')]});_0x3329aa[_0x9b5eaf['body'][_0x47a5('0x34')]]=_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')];return db['CmContact']['create'](_0x3329aa);}else{throw new Error(_0x47a5('0x4d'));}})[_0x47a5('0x22')](function(_0x4fa1da){_0x1b2c80['contact']=_0x4fa1da;if(_0x4fa1da){if(!_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x4e')]){_0x9b5eaf['body']['message'][_0x47a5('0x4e')]=rs[_0x47a5('0x4f')]()+'\x20'+_0x9b5eaf['body'][_0x47a5('0x17')][_0x47a5('0x36')];}var _0x4b706a={'ContactId':_0x4fa1da['id'],'MailAccountId':_0x9b5eaf['account']['id'],'inReplyTo':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x4e')],'to':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x36')],'cc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['cc'],'subject':_0x9b5eaf['body'][_0x47a5('0x17')]['subject'],'attach':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x50')],'lastMsgAt':moment()[_0x47a5('0x51')](_0x47a5('0x52')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x47a5('0x37')]({'where':{'closed':![],'MailAccountId':_0x9b5eaf['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x53')]}}]})['then'](function(_0x4d3db1){if(_0x4d3db1){return[_0x4d3db1,![]];}return db[_0x47a5('0x54')][_0x47a5('0x55')](_0x4b706a)[_0x47a5('0x22')](function(_0x3c2b46){return[_0x3c2b46,!![]];});});}else{throw new Error(_0x47a5('0x56'));}})['spread'](function(_0x3474b7,_0x519e9e){if(_0x3474b7){_0x331474=_0x519e9e;if(!_0x519e9e){return _0x3474b7[_0x47a5('0x57')]({'inReplyTo':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x4e')],'to':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x36')],'cc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['cc'],'subject':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['subject'],'attach':_0x3474b7[_0x47a5('0x50')]?_0x3474b7[_0x47a5('0x50')]:_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x50')],'substatus':null,'substatusAt':moment()['format'](_0x47a5('0x52')),'lastMsgAt':moment()[_0x47a5('0x51')](_0x47a5('0x52')),'lastMsgDirection':'in'});}else{return _0x3474b7;}}})[_0x47a5('0x22')](function(_0x4228a3){_0x1b2c80[_0x47a5('0x58')]=_0x4228a3[_0x47a5('0x3f')]({'plain':!![]});_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x59')]=_0x331474;return db[_0x47a5('0x5a')][_0x47a5('0x55')]({'body':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x28')],'MailAccountId':_0x9b5eaf[_0x47a5('0x38')]['id'],'MailInteractionId':_0x4228a3['id'],'direction':'in','ContactId':_0x1b2c80[_0x47a5('0x5b')]['id'],'messageId':_0x9b5eaf['body'][_0x47a5('0x17')][_0x47a5('0x4e')],'from':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x36')],'to':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['to'],'cc':_0x9b5eaf[_0x47a5('0x28')]['message']['cc'],'subject':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x5c')],'attach':_0x9b5eaf['body'][_0x47a5('0x17')]['attach'],'Attachments':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x5d')],'originTo':_0x9b5eaf['body']['message']['originTo'],'originCc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x5e')],'bcc':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x5f')],'ChatWebsiteId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x60')]||null,'originChannel':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x61')]||_0x47a5('0x62'),'ChatOfflineMessageId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x63')]||null},{'include':[{'model':db[_0x47a5('0x64')],'as':'Attachments'}]});})[_0x47a5('0x22')](function(_0x4833be){_0x1b2c80[_0x47a5('0x17')]=_0x4833be;if(_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x65')]){return db[_0x47a5('0x66')][_0x47a5('0x37')]({'attributes':['id',_0x47a5('0x67')],'where':{'id':_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x65')]}})[_0x47a5('0x22')](function(_0x254049){if(_0x254049){_0x1b2c80[_0x47a5('0x44')][_0x47a5('0x68')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x69'),'appdata':_0x254049[_0x47a5('0x67')]+','+(_0x1b2c80[_0x47a5('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x1b2c80);});}return respondWithRpcPromise(_0x47a5('0x6a'),_0x47a5('0x6b'),_0x1b2c80);})['then'](function(_0x732e00){_0x301a85(_0x732e00);})[_0x47a5('0x18')](function(_0x1baa5a){_0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,_0x1baa5a[_0x47a5('0x17')]));});});}; \ No newline at end of file +var _0x66fa=['ShowMailAccount','smtp','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','Applications','MailServerOut','Smtp','List','get','omit','smtpOptions','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','catch'];(function(_0x4bb566,_0x25a8a6){var _0x20376f=function(_0x4a4465){while(--_0x4a4465){_0x4bb566['push'](_0x4bb566['shift']());}};_0x20376f(++_0x25a8a6);}(_0x66fa,0x117));var _0xa66f=function(_0x42f30e,_0x389beb){_0x42f30e=_0x42f30e-0x0;var _0x128d6a=_0x66fa[_0x42f30e];return _0x128d6a;};'use strict';var _=require(_0xa66f('0x0'));var moment=require(_0xa66f('0x1'));var BPromise=require('bluebird');var rs=require(_0xa66f('0x2'));var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var logger=require(_0xa66f('0x5'))(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var jayson=require(_0xa66f('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0xa66f('0x9')]=_[_0xa66f('0xa')](config[_0xa66f('0x9')],{'host':_0xa66f('0xb'),'port':0x18eb});var socket=require(_0xa66f('0xc'))(new Redis(config['redis']));require(_0xa66f('0xd'))['register'](socket);function respondWithRpcPromise(_0x46c788,_0x597c7c,_0x101e10){return new BPromise(function(_0x53ca76,_0x52d802){return client['request'](_0x46c788,_0x101e10)[_0xa66f('0xe')](function(_0x825868){logger['info'](_0xa66f('0xf'),_0x597c7c,'request\x20sent');logger[_0xa66f('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x597c7c,_0xa66f('0x11'),JSON[_0xa66f('0x12')](_0x825868));if(_0x825868[_0xa66f('0x13')]){if(_0x825868['error']['code']===0x1f4){logger[_0xa66f('0x13')]('MailAccount,\x20%s,\x20%s',_0x597c7c,_0x825868['error']['message']);return _0x52d802(_0x825868[_0xa66f('0x13')][_0xa66f('0x14')]);}logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x825868[_0xa66f('0x13')]['message']);return _0x53ca76(_0x825868['error'][_0xa66f('0x14')]);}else{logger[_0xa66f('0x15')](_0xa66f('0xf'),_0x597c7c,_0xa66f('0x11'));_0x53ca76(_0x825868['result'][_0xa66f('0x14')]);}})['catch'](function(_0x4a28d4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x4a28d4);_0x52d802(_0x4a28d4);});});}exports[_0xa66f('0x16')]=function(_0x355ddc){var _0x2c5b76=this;return new Promise(function(_0x408bc7,_0x251f60){return db[_0xa66f('0x17')][_0xa66f('0x18')]({'raw':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x355ddc['options']?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'limit':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')]['limit']||null:null,'include':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x355ddc['options']['include'],function(_0xed98b9){return{'model':db[_0xed98b9['model']],'as':_0xed98b9['as'],'attributes':_0xed98b9[_0xa66f('0x1c')],'include':_0xed98b9[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0xed98b9['include'],function(_0x4683c7){return{'model':db[_0x4683c7[_0xa66f('0x1f')]],'as':_0x4683c7['as'],'attributes':_0x4683c7[_0xa66f('0x1c')],'include':_0x4683c7[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x4683c7[_0xa66f('0x1d')],function(_0x1eb86a){return{'model':db[_0x1eb86a[_0xa66f('0x1f')]],'as':_0x1eb86a['as'],'attributes':_0x1eb86a[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xe')](function(_0x45f71c){logger[_0xa66f('0x15')](_0xa66f('0x16'),_0x355ddc);logger[_0xa66f('0x10')]('GetMailAccount',_0x355ddc,JSON['stringify'](_0x45f71c));_0x408bc7(_0x45f71c);})[_0xa66f('0x20')](function(_0x27ceae){logger['error'](_0xa66f('0x16'),_0x27ceae[_0xa66f('0x14')],_0x355ddc);_0x251f60(_0x2c5b76['error'](0x1f4,_0x27ceae[_0xa66f('0x14')]));});});};exports[_0xa66f('0x21')]=function(_0x9d78d5){var _0x2c2ace=this;return new Promise(function(_0x395623,_0x548add){return db[_0xa66f('0x17')]['find']({'raw':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'include':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')],function(_0x35ef27){return{'model':db[_0x35ef27[_0xa66f('0x1f')]],'as':_0x35ef27['as'],'attributes':_0x35ef27['attributes'],'include':_0x35ef27[_0xa66f('0x1d')]?_['map'](_0x35ef27[_0xa66f('0x1d')],function(_0x46f6cc){return{'model':db[_0x46f6cc[_0xa66f('0x1f')]],'as':_0x46f6cc['as'],'attributes':_0x46f6cc[_0xa66f('0x1c')],'include':_0x46f6cc[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x46f6cc[_0xa66f('0x1d')],function(_0xcee582){return{'model':db[_0xcee582['model']],'as':_0xcee582['as'],'attributes':_0xcee582[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4477cf){if(_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x22')]===!![])_0x4477cf['setDataValue']('smtpOptions',_0x4477cf[_0xa66f('0x23')]());logger[_0xa66f('0x15')](_0xa66f('0x21'),_0x9d78d5);logger[_0xa66f('0x10')](_0xa66f('0x21'),_0x9d78d5,JSON['stringify'](_0x4477cf));_0x395623(_0x4477cf);})['catch'](function(_0x49b869){logger[_0xa66f('0x13')]('ShowMailAccount',_0x49b869['message'],_0x9d78d5);_0x548add(_0x2c2ace['error'](0x1f4,_0x49b869[_0xa66f('0x14')]));});});};exports['NotifyMailAccount']=function(_0x8965d3){var _0x17d942=this;return new Promise(function(_0x23a546,_0x1647a0){var _0xd65c5d={'body':_0x8965d3[_0xa66f('0x24')],'channel':_0xa66f('0x25')};var _0x261089=_[_0xa66f('0x26')](_[_0xa66f('0x27')](db[_0xa66f('0x28')][_0xa66f('0x29')]),[_0xa66f('0x2a'),_0xa66f('0x2b'),'CompanyId',_0xa66f('0x2c')]);var _0x25c2cb=![];if(_0x8965d3['body']['id']){delete _0x8965d3[_0xa66f('0x24')]['id'];}if(_['isNil'](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')])){return _0x1647a0(_0x17d942['error'](0x1f4,_0xa66f('0x2e')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')]['body'])||_0x8965d3[_0xa66f('0x24')]['body']===''){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x30')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x32')+_0x261089));}if(!_['includes'](_0x261089,_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x33')+_0x261089));}var _0x374e53={};_0x374e53[_0x8965d3['body']['mapKey']]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x17')][_0xa66f('0x34')]({'where':{'id':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x36')],'as':'List','include':[{'model':db[_0xa66f('0x28')],'as':_0xa66f('0x37'),'where':_0x374e53,'limit':0x1,'order':[[_0xa66f('0x2b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xa66f('0x38')},{'model':db[_0xa66f('0x39')],'as':_0xa66f('0x3a'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x19e7ce){if(_0x19e7ce&&_0x19e7ce[_0xa66f('0x3b')]){var _0x40d3b6=_0x19e7ce[_0xa66f('0x3c')]({'plain':!![]});_0xd65c5d[_0xa66f('0x35')]=_[_0xa66f('0x3d')](_0x40d3b6,[_0xa66f('0x38'),_0xa66f('0x3b')]);_0xd65c5d['account'][_0xa66f('0x3e')]=_0x19e7ce[_0xa66f('0x23')]();_0xd65c5d[_0xa66f('0x3f')]=_0x40d3b6[_0xa66f('0x38')];_0xd65c5d[_0xa66f('0x40')]=_0x40d3b6[_0xa66f('0x3b')];_0xd65c5d['applications']=_[_0xa66f('0x41')](_0xd65c5d[_0xa66f('0x3f')],[_0xa66f('0x42')],[_0xa66f('0x43')]);if(_0xd65c5d[_0xa66f('0x35')]&&_0xd65c5d['account'][_0xa66f('0x44')]){_0xd65c5d['applications'][_0xa66f('0x45')]({'id':0x0,'priority':_0xd65c5d['applications']['length']+0x1,'app':_0xa66f('0x46'),'appdata':_0xa66f('0x44'),'interval':_0xa66f('0x47')});}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x38')]){delete _0xd65c5d[_0xa66f('0x35')]['Applications'];}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')]){delete _0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')];}if(_0x40d3b6['List'][_0xa66f('0x37')]['length']){return _0x40d3b6[_0xa66f('0x3b')][_0xa66f('0x37')][0x0];}var _0x21482f=_[_0xa66f('0xa')](_0x8965d3[_0xa66f('0x24')],{'firstName':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')],'ListId':_0x40d3b6['ListId']});_0x21482f[_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')]]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x28')][_0xa66f('0x48')](_0x21482f);}else{throw new Error(_0xa66f('0x49'));}})[_0xa66f('0xe')](function(_0x350fce){_0xd65c5d['contact']=_0x350fce;if(_0x350fce){if(!_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')]){_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')]=rs[_0xa66f('0x4b')]()+'\x20'+_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x2d')];}var _0x11c89e={'ContactId':_0x350fce['id'],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'inReplyTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x4a')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3['body']['message'][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['attach'],'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'};return db[_0xa66f('0x4f')][_0xa66f('0x34')]({'where':{'closed':![],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x50')],'as':_0xa66f('0x51'),'attributes':[_0xa66f('0x4a')],'where':{'messageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x52')]}}]})[_0xa66f('0xe')](function(_0x235e4f){if(_0x235e4f){return[_0x235e4f,![]];}return db[_0xa66f('0x4f')][_0xa66f('0x48')](_0x11c89e)[_0xa66f('0xe')](function(_0x41ffa7){return[_0x41ffa7,!![]];});});}else{throw new Error(_0xa66f('0x53'));}})['spread'](function(_0x52f22d,_0x46327d){if(_0x52f22d){_0x25c2cb=_0x46327d;if(!_0x46327d){return _0x52f22d[_0xa66f('0x54')]({'inReplyTo':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')],'to':_0x8965d3['body'][_0xa66f('0x14')]['from'],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['subject'],'attach':_0x52f22d[_0xa66f('0x55')]?_0x52f22d[_0xa66f('0x55')]:_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x55')],'substatus':null,'substatusAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'});}else{return _0x52f22d;}}})[_0xa66f('0xe')](function(_0x290323){_0xd65c5d[_0xa66f('0x56')]=_0x290323['get']({'plain':!![]});_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x57')]=_0x25c2cb;return db[_0xa66f('0x50')][_0xa66f('0x48')]({'body':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x24')],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'MailInteractionId':_0x290323['id'],'direction':'in','ContactId':_0xd65c5d[_0xa66f('0x58')]['id'],'messageId':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')],'from':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['to'],'cc':_0x8965d3[_0xa66f('0x24')]['message']['cc'],'subject':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')]['message']['attach'],'Attachments':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x59')],'originTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5a')],'originCc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5b')],'bcc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5c')],'ChatWebsiteId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5d')]||null,'originChannel':_0x8965d3[_0xa66f('0x24')]['message']['originChannel']||_0xa66f('0x5e'),'ChatOfflineMessageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0xa66f('0x60')}]});})['then'](function(_0x4feda0){_0xd65c5d['message']=_0x4feda0;if(_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]){return db[_0xa66f('0x62')][_0xa66f('0x34')]({'attributes':['id',_0xa66f('0x63')],'where':{'id':_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]}})[_0xa66f('0xe')](function(_0x1ee6e0){if(_0x1ee6e0){_0xd65c5d[_0xa66f('0x3f')][_0xa66f('0x64')]({'id':0x0,'priority':0x0,'app':_0xa66f('0x65'),'appdata':_0x1ee6e0[_0xa66f('0x63')]+','+(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x66')]||0xa),'interval':_0xa66f('0x47')});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);})['then'](function(_0xc4b32b){_0x23a546(_0xc4b32b);})[_0xa66f('0x20')](function(_0x2bb4e5){_0x1647a0(_0x17d942['error'](0x1f4,_0x2bb4e5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 054ba5c..224bdbd 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 _0xf4b6=['update','emit','register','length','mailAccount:','./mailAccount.events','remove'];(function(_0x466be3,_0x2e3a59){var _0x2bcc73=function(_0x49d6ec){while(--_0x49d6ec){_0x466be3['push'](_0x466be3['shift']());}};_0x2bcc73(++_0x2e3a59);}(_0xf4b6,0x1a9));var _0x6f4b=function(_0x4414af,_0xb3054a){_0x4414af=_0x4414af-0x0;var _0x5dcee7=_0xf4b6[_0x4414af];return _0x5dcee7;};'use strict';var MailAccountEvents=require(_0x6f4b('0x0'));var events=['save',_0x6f4b('0x1'),_0x6f4b('0x2')];function createListener(_0x535c98,_0x5f0639){return function(_0x22837d){_0x5f0639[_0x6f4b('0x3')](_0x535c98,_0x22837d);};}function removeListener(_0x336034,_0x1d4255){return function(){MailAccountEvents['removeListener'](_0x336034,_0x1d4255);};}exports[_0x6f4b('0x4')]=function(_0xb42118){for(var _0x3f6ca7=0x0,_0x161cc9=events[_0x6f4b('0x5')];_0x3f6ca7<_0x161cc9;_0x3f6ca7++){var _0x59d2fe=events[_0x3f6ca7];var _0x25ad8f=createListener(_0x6f4b('0x6')+_0x59d2fe,_0xb42118);MailAccountEvents['on'](_0x59d2fe,_0x25ad8f);}}; \ No newline at end of file +var _0xaaff=['remove','update','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x1f7e1c,_0xe59846){var _0x5d099c=function(_0x5c32bd){while(--_0x5c32bd){_0x1f7e1c['push'](_0x1f7e1c['shift']());}};_0x5d099c(++_0xe59846);}(_0xaaff,0x155));var _0xfaaf=function(_0x5cc556,_0x158710){_0x5cc556=_0x5cc556-0x0;var _0x12103b=_0xaaff[_0x5cc556];return _0x12103b;};'use strict';var MailAccountEvents=require(_0xfaaf('0x0'));var events=[_0xfaaf('0x1'),_0xfaaf('0x2'),_0xfaaf('0x3')];function createListener(_0x3f7bfb,_0x4e0ad2){return function(_0x571665){_0x4e0ad2['emit'](_0x3f7bfb,_0x571665);};}function removeListener(_0xe9d5f4,_0x5f028f){return function(){MailAccountEvents['removeListener'](_0xe9d5f4,_0x5f028f);};}exports[_0xfaaf('0x4')]=function(_0x485aa){for(var _0x1ca679=0x0,_0x33b611=events[_0xfaaf('0x5')];_0x1ca679<_0x33b611;_0x1ca679++){var _0x281de1=events[_0x1ca679];var _0x4a95ee=createListener(_0xfaaf('0x6')+_0x281de1,_0x485aa);MailAccountEvents['on'](_0x281de1,_0x4a95ee);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index e8b9cce..5f229e0 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 _0xcbb7=['put','update','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated'];(function(_0x2fec51,_0x4e6663){var _0x5f42be=function(_0x51aa84){while(--_0x51aa84){_0x2fec51['push'](_0x2fec51['shift']());}};_0x5f42be(++_0x4e6663);}(_0xcbb7,0x19a));var _0x7cbb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcbb7[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7cbb('0x0'));var timeout=require(_0x7cbb('0x1'));var express=require('express');var router=express[_0x7cbb('0x2')]();var fs_extra=require(_0x7cbb('0x3'));var auth=require(_0x7cbb('0x4'));var interaction=require(_0x7cbb('0x5'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router['get'](_0x7cbb('0x6'),auth[_0x7cbb('0x7')](),controller['show']);router[_0x7cbb('0x8')](_0x7cbb('0x6'),auth['isAuthenticated'](),controller[_0x7cbb('0x9')]);router['delete'](_0x7cbb('0x6'),auth[_0x7cbb('0x7')](),controller[_0x7cbb('0xa')]);module['exports']=router; \ No newline at end of file +var _0x7fe3=['get','/:id','isAuthenticated','show','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller'];(function(_0xeb91bf,_0x31ca53){var _0x12ef4b=function(_0x46ff22){while(--_0x46ff22){_0xeb91bf['push'](_0xeb91bf['shift']());}};_0x12ef4b(++_0x31ca53);}(_0x7fe3,0x9b));var _0x37fe=function(_0x4cb4d5,_0x2dd6aa){_0x4cb4d5=_0x4cb4d5-0x0;var _0x5123af=_0x7fe3[_0x4cb4d5];return _0x5123af;};'use strict';var multer=require(_0x37fe('0x0'));var util=require(_0x37fe('0x1'));var path=require(_0x37fe('0x2'));var timeout=require(_0x37fe('0x3'));var express=require(_0x37fe('0x4'));var router=express[_0x37fe('0x5')]();var fs_extra=require(_0x37fe('0x6'));var auth=require(_0x37fe('0x7'));var interaction=require(_0x37fe('0x8'));var config=require('../../config/environment');var controller=require(_0x37fe('0x9'));router[_0x37fe('0xa')](_0x37fe('0xb'),auth[_0x37fe('0xc')](),controller[_0x37fe('0xd')]);router[_0x37fe('0xe')](_0x37fe('0xb'),auth[_0x37fe('0xc')](),controller['update']);router['delete'](_0x37fe('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ef81209..4a5ad04 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 _0xbf64=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xbf64,0x76));var _0x4bf6=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xbf64[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require('sequelize');module[_0x4bf6('0x0')]={'priority':{'type':Sequelize[_0x4bf6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4bf6('0x2')],'allowNull':![],'defaultValue':_0x4bf6('0x3')},'appdata':{'type':Sequelize[_0x4bf6('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4bf6('0x2')],'defaultValue':_0x4bf6('0x5')}}; \ No newline at end of file +var _0x470f=['*,*,*,*','sequelize','STRING'];(function(_0x133086,_0x5e5ae5){var _0x48bd1c=function(_0x522d37){while(--_0x522d37){_0x133086['push'](_0x133086['shift']());}};_0x48bd1c(++_0x5e5ae5);}(_0x470f,0x115));var _0xf470=function(_0x138387,_0x2a16ac){_0x138387=_0x138387-0x0;var _0x45b15a=_0x470f[_0x138387];return _0x45b15a;};'use strict';var Sequelize=require(_0xf470('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf470('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf470('0x1')],'defaultValue':_0xf470('0x2')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 73c220a..1cc6a77 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e9e4e,_0x2d6e3b){_0x4e9e4e=_0x4e9e4e-0x0;var _0x1bd82d=_0xedd9[_0x4e9e4e];return _0x1bd82d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2d9070,_0x3b1653){var _0x1d918f=function(_0x2ab903){while(--_0x2ab903){_0x2d9070['push'](_0x2d9070['shift']());}};_0x1d918f(++_0x3b1653);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 5b70cc4..51b29ae 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 _0xa7ca=['api','moment','bluebird','path','./mailApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x4681b1,_0x3823f5){var _0x581865=function(_0x2f8b1f){while(--_0x2f8b1f){_0x4681b1['push'](_0x4681b1['shift']());}};_0x581865(++_0x3823f5);}(_0xa7ca,0x1b6));var _0xaa7c=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0xa7ca[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0xaa7c('0x0'));var util=require('util');var logger=require(_0xaa7c('0x1'))(_0xaa7c('0x2'));var moment=require(_0xaa7c('0x3'));var BPromise=require(_0xaa7c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa7c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaa7c('0x6'));module[_0xaa7c('0x7')]=function(_0x216bb4,_0xdf35b1){return _0x216bb4[_0xaa7c('0x8')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaa7c('0x9'),'collate':_0xaa7c('0xa')});}; \ No newline at end of file +var _0xd659=['rimraf','mail_applications','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x295245,_0x110169){var _0x3d166a=function(_0x361a6c){while(--_0x361a6c){_0x295245['push'](_0x295245['shift']());}};_0x3d166a(++_0x110169);}(_0xd659,0x157));var _0x9d65=function(_0x3c1c3a,_0x55a5a3){_0x3c1c3a=_0x3c1c3a-0x0;var _0x1be683=_0xd659[_0x3c1c3a];return _0x1be683;};'use strict';var _=require('lodash');var util=require(_0x9d65('0x0'));var logger=require(_0x9d65('0x1'))(_0x9d65('0x2'));var moment=require(_0x9d65('0x3'));var BPromise=require(_0x9d65('0x4'));var rp=require(_0x9d65('0x5'));var fs=require('fs');var path=require(_0x9d65('0x6'));var rimraf=require(_0x9d65('0x7'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x32c26a,_0x3a73f1){return _0x32c26a['define']('MailApplication',attributes,{'tableName':_0x9d65('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d65('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f0afa79..1fb3302 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 _0x240e=['result','catch','UpdateMailApplication','MailApplication','update','options','raw','where','attributes','limit','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35f156,_0x5d5640){var _0xbf03ad=function(_0x2d59e4){while(--_0x2d59e4){_0x35f156['push'](_0x35f156['shift']());}};_0xbf03ad(++_0x5d5640);}(_0x240e,0x12b));var _0xe240=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x240e[_0xc67528];return _0x38e26d;};'use strict';var _=require('lodash');var util=require(_0xe240('0x0'));var moment=require(_0xe240('0x1'));var BPromise=require(_0xe240('0x2'));var rs=require(_0xe240('0x3'));var fs=require('fs');var Redis=require(_0xe240('0x4'));var db=require(_0xe240('0x5'))['db'];var utils=require(_0xe240('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe240('0x7'));var jayson=require(_0xe240('0x8'));var client=jayson[_0xe240('0x9')][_0xe240('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d25e,_0x480ae4,_0x1f34ee){return new BPromise(function(_0x38b619,_0x42278f){return client[_0xe240('0xb')](_0x56d25e,_0x1f34ee)[_0xe240('0xc')](function(_0x4c0d54){logger[_0xe240('0xd')](_0xe240('0xe'),_0x480ae4,_0xe240('0xf'));logger['debug'](_0xe240('0x10'),_0x480ae4,'request\x20sent',JSON[_0xe240('0x11')](_0x4c0d54));if(_0x4c0d54[_0xe240('0x12')]){if(_0x4c0d54['error'][_0xe240('0x13')]===0x1f4){logger[_0xe240('0x12')](_0xe240('0xe'),_0x480ae4,_0x4c0d54[_0xe240('0x12')][_0xe240('0x14')]);return _0x42278f(_0x4c0d54[_0xe240('0x12')][_0xe240('0x14')]);}logger['error'](_0xe240('0xe'),_0x480ae4,_0x4c0d54[_0xe240('0x12')]['message']);return _0x38b619(_0x4c0d54[_0xe240('0x12')][_0xe240('0x14')]);}else{logger[_0xe240('0xd')]('MailApplication,\x20%s,\x20%s',_0x480ae4,_0xe240('0xf'));_0x38b619(_0x4c0d54[_0xe240('0x15')][_0xe240('0x14')]);}})[_0xe240('0x16')](function(_0x2cead6){logger[_0xe240('0x12')]('MailApplication,\x20%s,\x20%s',_0x480ae4,_0x2cead6);_0x42278f(_0x2cead6);});});}exports[_0xe240('0x17')]=function(_0x433d14){var _0x75f249=this;return new Promise(function(_0x4e9817,_0x58069d){return db[_0xe240('0x18')][_0xe240('0x19')](_0x433d14['body'],{'raw':_0x433d14['options']?_0x433d14[_0xe240('0x1a')][_0xe240('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x433d14['options']?_0x433d14[_0xe240('0x1a')][_0xe240('0x1c')]||null:null,'attributes':_0x433d14[_0xe240('0x1a')]?_0x433d14[_0xe240('0x1a')][_0xe240('0x1d')]||null:null,'limit':_0x433d14[_0xe240('0x1a')]?_0x433d14[_0xe240('0x1a')][_0xe240('0x1e')]||null:null})[_0xe240('0xc')](function(_0x27efe2){logger[_0xe240('0xd')](_0xe240('0x17'),_0x433d14);logger[_0xe240('0x1f')](_0xe240('0x17'),_0x433d14,JSON['stringify'](_0x27efe2));_0x4e9817(_0x27efe2);})['catch'](function(_0x4e5542){logger['error'](_0xe240('0x17'),_0x4e5542[_0xe240('0x14')],_0x433d14);_0x58069d(_0x75f249[_0xe240('0x12')](0x1f4,_0x4e5542[_0xe240('0x14')]));});});}; \ No newline at end of file +var _0x9b03=['UpdateMailApplication','update','body','options','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch'];(function(_0x38d98e,_0x57c90e){var _0x34f48d=function(_0x4220b7){while(--_0x4220b7){_0x38d98e['push'](_0x38d98e['shift']());}};_0x34f48d(++_0x57c90e);}(_0x9b03,0x102));var _0x39b0=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x9b03[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x39b0('0x0'));var util=require(_0x39b0('0x1'));var moment=require('moment');var BPromise=require(_0x39b0('0x2'));var rs=require(_0x39b0('0x3'));var fs=require('fs');var Redis=require(_0x39b0('0x4'));var db=require(_0x39b0('0x5'))['db'];var utils=require(_0x39b0('0x6'));var logger=require('../../config/logger')(_0x39b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x39b0('0x8'));var client=jayson[_0x39b0('0x9')][_0x39b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c3671,_0x37bc0c,_0x3634c9){return new BPromise(function(_0x4b0e3e,_0x3ecfd8){return client[_0x39b0('0xb')](_0x3c3671,_0x3634c9)[_0x39b0('0xc')](function(_0x3b74bf){logger['info']('MailApplication,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'));logger[_0x39b0('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'),JSON[_0x39b0('0xf')](_0x3b74bf));if(_0x3b74bf[_0x39b0('0x10')]){if(_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x11')]===0x1f4){logger[_0x39b0('0x10')](_0x39b0('0x12'),_0x37bc0c,_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);return _0x3ecfd8(_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);}logger[_0x39b0('0x10')](_0x39b0('0x12'),_0x37bc0c,_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);return _0x4b0e3e(_0x3b74bf['error'][_0x39b0('0x13')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'));_0x4b0e3e(_0x3b74bf[_0x39b0('0x14')][_0x39b0('0x13')]);}})[_0x39b0('0x15')](function(_0x159543){logger['error'](_0x39b0('0x12'),_0x37bc0c,_0x159543);_0x3ecfd8(_0x159543);});});}exports[_0x39b0('0x16')]=function(_0x32fd46){var _0x2ff45f=this;return new Promise(function(_0x551678,_0x475b40){return db['MailApplication'][_0x39b0('0x17')](_0x32fd46[_0x39b0('0x18')],{'raw':_0x32fd46[_0x39b0('0x19')]?_0x32fd46[_0x39b0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32fd46['options']?_0x32fd46[_0x39b0('0x19')]['where']||null:null,'attributes':_0x32fd46[_0x39b0('0x19')]?_0x32fd46[_0x39b0('0x19')][_0x39b0('0x1a')]||null:null,'limit':_0x32fd46[_0x39b0('0x19')]?_0x32fd46[_0x39b0('0x19')][_0x39b0('0x1b')]||null:null})[_0x39b0('0xc')](function(_0x328409){logger['info'](_0x39b0('0x16'),_0x32fd46);logger['debug'](_0x39b0('0x16'),_0x32fd46,JSON[_0x39b0('0xf')](_0x328409));_0x551678(_0x328409);})['catch'](function(_0x3f9f0c){logger['error'](_0x39b0('0x16'),_0x3f9f0c[_0x39b0('0x13')],_0x32fd46);_0x475b40(_0x2ff45f[_0x39b0('0x10')](0x1f4,_0x3f9f0c[_0x39b0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 3b41085..eb66d77 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 _0x067e=['/:id','show','/:id/messages','getMessages','download','create','addMessage','post','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x067e,0x172));var _0xe067=function(_0x12cca4,_0x1c8e3d){_0x12cca4=_0x12cca4-0x0;var _0x5bf019=_0x067e[_0x12cca4];return _0x5bf019;};'use strict';var express=require('express');var router=express[_0xe067('0x0')]();var auth=require(_0xe067('0x1'));var interaction=require(_0xe067('0x2'));var controller=require('./mailInteraction.controller');router[_0xe067('0x3')]('/',auth[_0xe067('0x4')](),controller[_0xe067('0x5')]);router['get'](_0xe067('0x6'),auth[_0xe067('0x4')](),controller[_0xe067('0x7')]);router[_0xe067('0x3')](_0xe067('0x8'),auth[_0xe067('0x4')](),controller[_0xe067('0x9')]);router[_0xe067('0x3')](_0xe067('0xa'),auth[_0xe067('0x4')](),controller[_0xe067('0xb')]);router[_0xe067('0x3')]('/:id/download',auth[_0xe067('0x4')](),controller[_0xe067('0xc')]);router['post']('/',auth[_0xe067('0x4')](),controller[_0xe067('0xd')]);router['post'](_0xe067('0xa'),auth[_0xe067('0x4')](),controller[_0xe067('0xe')]);router[_0xe067('0xf')](_0xe067('0x10'),auth[_0xe067('0x4')](),interaction[_0xe067('0x11')](_0xe067('0x12'),_0xe067('0x13')),controller['addTags']);router[_0xe067('0x14')](_0xe067('0x8'),auth['isAuthenticated'](),interaction[_0xe067('0x11')](_0xe067('0x12'),_0xe067('0x15')),controller['update']);router[_0xe067('0x16')](_0xe067('0x8'),auth['isAuthenticated'](),interaction[_0xe067('0x11')]('mail',_0xe067('0x17')),controller[_0xe067('0x18')]);router[_0xe067('0x16')](_0xe067('0x10'),auth[_0xe067('0x4')](),controller[_0xe067('0x19')]);module[_0xe067('0x1a')]=router; \ No newline at end of file +var _0xa743=['download','post','addTags','put','/:id','tracked','mailinteraction:update','update','mail','mailinteraction:destroy','destroy','delete','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download'];(function(_0x5b61a6,_0x224238){var _0x231578=function(_0x59e192){while(--_0x59e192){_0x5b61a6['push'](_0x5b61a6['shift']());}};_0x231578(++_0x224238);}(_0xa743,0x152));var _0x3a74=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0xa743[_0x2becba];return _0x90b5dd;};'use strict';var express=require(_0x3a74('0x0'));var router=express[_0x3a74('0x1')]();var auth=require(_0x3a74('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x3a74('0x3'));router[_0x3a74('0x4')]('/',auth[_0x3a74('0x5')](),controller[_0x3a74('0x6')]);router[_0x3a74('0x4')](_0x3a74('0x7'),auth[_0x3a74('0x5')](),controller[_0x3a74('0x8')]);router[_0x3a74('0x4')]('/:id',auth[_0x3a74('0x5')](),controller[_0x3a74('0x9')]);router[_0x3a74('0x4')](_0x3a74('0xa'),auth['isAuthenticated'](),controller[_0x3a74('0xb')]);router['get'](_0x3a74('0xc'),auth[_0x3a74('0x5')](),controller[_0x3a74('0xd')]);router[_0x3a74('0xe')]('/',auth[_0x3a74('0x5')](),controller['create']);router['post'](_0x3a74('0xa'),auth[_0x3a74('0x5')](),controller['addMessage']);router[_0x3a74('0xe')]('/:id/tags',auth[_0x3a74('0x5')](),interaction['tracked']('mail','mailinteraction:addtags'),controller[_0x3a74('0xf')]);router[_0x3a74('0x10')](_0x3a74('0x11'),auth[_0x3a74('0x5')](),interaction[_0x3a74('0x12')]('mail',_0x3a74('0x13')),controller[_0x3a74('0x14')]);router['delete'](_0x3a74('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0x3a74('0x15'),_0x3a74('0x16')),controller[_0x3a74('0x17')]);router[_0x3a74('0x18')]('/:id/tags',auth[_0x3a74('0x5')](),controller[_0x3a74('0x19')]);module[_0x3a74('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 8175eb1..c1ca77a 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 _0xc986=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','sequelize'];(function(_0x4d5bcf,_0x4ad477){var _0x2f9af9=function(_0x5d87fd){while(--_0x5d87fd){_0x4d5bcf['push'](_0x4d5bcf['shift']());}};_0x2f9af9(++_0x4ad477);}(_0xc986,0xce));var _0x6c98=function(_0x44eeef,_0x22bfe8){_0x44eeef=_0x44eeef-0x0;var _0x5a6d40=_0xc986[_0x44eeef];return _0x5a6d40;};'use strict';var Sequelize=require(_0x6c98('0x0'));var iconv=require(_0x6c98('0x1'));module[_0x6c98('0x2')]={'closed':{'type':Sequelize[_0x6c98('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6c98('0x4')]},'disposition':{'type':Sequelize[_0x6c98('0x5')]},'secondDisposition':{'type':Sequelize[_0x6c98('0x5')]},'thirdDisposition':{'type':Sequelize[_0x6c98('0x5')]},'note':{'type':Sequelize[_0x6c98('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x6c98('0x5')]},'cc':{'type':Sequelize[_0x6c98('0x6')](_0x6c98('0x7'))},'subject':{'type':Sequelize[_0x6c98('0x6')]()},'attach':{'type':Sequelize[_0x6c98('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6c98('0x4')]},'substatus':{'type':Sequelize[_0x6c98('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x6c98('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6c98('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6c98('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6c98('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6c98('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1050=['long','TEXT','DATE','ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x1050,0x1ef));var _0x0105=function(_0x5e9658,_0xc588e9){_0x5e9658=_0x5e9658-0x0;var _0x2b833a=_0x1050[_0x5e9658];return _0x2b833a;};'use strict';var Sequelize=require(_0x0105('0x0'));var iconv=require(_0x0105('0x1'));module[_0x0105('0x2')]={'closed':{'type':Sequelize[_0x0105('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0105('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0105('0x4')]},'note':{'type':Sequelize[_0x0105('0x4')]},'inReplyTo':{'type':Sequelize[_0x0105('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x0105('0x5'))},'subject':{'type':Sequelize[_0x0105('0x6')]()},'attach':{'type':Sequelize[_0x0105('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0105('0x7')]},'substatus':{'type':Sequelize[_0x0105('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x0105('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x0105('0x8')]('in',_0x0105('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0105('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0105('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 6c23bcb..bf2f343 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 _0x9485=['emit','removeTags','download','unix','toString','join','root','server','files','attachments','push','Attachment','Attachments','from','bcc','createdAt','Messages','get','mkdirSync','each','decode','headers','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','defaults','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','error','stack','name','send','index','map','MailInteraction','type','key','getOptions','query','then','show','params','rawAttributes','filters','intersection','model','attributes','length','includeAll','include','merge','options','find','catch','create','body','describe','MailMessage','addMessage','ids','getMessages','keys','fields','hasOwnProperty','order','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','true','addTags','omit','Tag'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0x9485,0x8b));var _0x5948=function(_0x2fc76c,_0x564b9b){_0x2fc76c=_0x2fc76c-0x0;var _0x22a1d6=_0x9485[_0x2fc76c];return _0x22a1d6;};'use strict';var emlformat=require(_0x5948('0x0'));var rimraf=require(_0x5948('0x1'));var zipdir=require(_0x5948('0x2'));var moment=require(_0x5948('0x3'));var BPromise=require('bluebird');var util=require(_0x5948('0x4'));var path=require(_0x5948('0x5'));var fs=require('fs');var _=require(_0x5948('0x6'));var juice=require('juice');var Redis=require(_0x5948('0x7'));var interaction=require(_0x5948('0x8'));var qs=require(_0x5948('0x9'));var logger=require(_0x5948('0xa'))(_0x5948('0xb'));var config=require(_0x5948('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x5948('0xd'));config['redis']=_[_0x5948('0xe')](config[_0x5948('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x5948('0x10'))(new Redis(config[_0x5948('0xf')]));require('./mailInteraction.socket')[_0x5948('0x11')](socket);function respondWithStatusCode(_0x31cfe4,_0x34e3bb){_0x34e3bb=_0x34e3bb||0xcc;return function(_0x3c83ea){if(_0x3c83ea){return _0x31cfe4[_0x5948('0x12')](_0x34e3bb);}return _0x31cfe4[_0x5948('0x13')](_0x34e3bb)[_0x5948('0x14')]();};}function respondWithResult(_0xb1d570,_0x233d7e){_0x233d7e=_0x233d7e||0xc8;return function(_0x35af62){if(_0x35af62){return _0xb1d570[_0x5948('0x13')](_0x233d7e)['json'](_0x35af62);}};}function respondWithFilteredResult(_0x2592df,_0x13654a){return function(_0x1028a6){if(_0x1028a6){var _0x23a656=typeof _0x13654a[_0x5948('0x15')]===_0x5948('0x16')&&typeof _0x13654a[_0x5948('0x17')]===_0x5948('0x16');var _0x4691fc=_0x1028a6[_0x5948('0x18')];var _0x281324=_0x23a656?0x0:_0x13654a[_0x5948('0x15')];var _0x1cc566=_0x23a656?_0x1028a6[_0x5948('0x18')]:_0x13654a[_0x5948('0x15')]+_0x13654a['limit'];var _0x4d711a;if(_0x1cc566>=_0x4691fc){_0x1cc566=_0x4691fc;_0x4d711a=0xc8;}else{_0x4d711a=0xce;}_0x2592df['status'](_0x4d711a);return _0x2592df[_0x5948('0x19')](_0x5948('0x1a'),_0x281324+'-'+_0x1cc566+'/'+_0x4691fc)[_0x5948('0x1b')](_0x1028a6);}return null;};}function saveUpdates(_0x190b50){return function(_0x22cc28){if(_0x22cc28){return _0x22cc28[_0x5948('0x1c')](_0x190b50)['then'](function(_0xacffa2){return _0xacffa2;});}return null;};}function removeEntity(_0x1c7419){return function(_0x21f9fa){if(_0x21f9fa){return _0x21f9fa[_0x5948('0x1d')]()['then'](function(){_0x1c7419[_0x5948('0x13')](0xcc)[_0x5948('0x14')]();});}};}function handleEntityNotFound(_0xfd26da){return function(_0x7a4ed5){if(!_0x7a4ed5){_0xfd26da[_0x5948('0x12')](0x194);}return _0x7a4ed5;};}function handleError(_0x416e76,_0x31110a){_0x31110a=_0x31110a||0x1f4;return function(_0x319876){logger[_0x5948('0x1e')](_0x319876[_0x5948('0x1f')]);if(_0x319876['name']){delete _0x319876[_0x5948('0x20')];}_0x416e76['status'](_0x31110a)[_0x5948('0x21')](_0x319876);};}exports[_0x5948('0x22')]=function(_0x47374f,_0x2cd86e){var _0x385821={};var _0x4164bf=_[_0x5948('0x23')](db[_0x5948('0x24')]['rawAttributes'],function(_0x570e2e){return{'name':_0x570e2e['fieldName'],'type':_0x570e2e[_0x5948('0x25')][_0x5948('0x26')]};});_0x385821=qs[_0x5948('0x27')](_0x4164bf,_0x47374f);return interaction['findAll']('mail',_0x47374f[_0x5948('0x28')],_0x47374f['user'],_0x385821,_0x4164bf)[_0x5948('0x29')](respondWithFilteredResult(_0x2cd86e,_0x385821))['catch'](handleError(_0x2cd86e,null));};exports[_0x5948('0x2a')]=function(_0x2d1f6c,_0x3c66e7){var _0x1ad0af={'raw':![],'where':{'id':_0x2d1f6c[_0x5948('0x2b')]['id']}},_0x3a57e2={};_0x3a57e2['model']=_['keys'](db[_0x5948('0x24')][_0x5948('0x2c')]);_0x3a57e2['query']=_['keys'](_0x2d1f6c['query']);_0x3a57e2[_0x5948('0x2d')]=_[_0x5948('0x2e')](_0x3a57e2[_0x5948('0x2f')],_0x3a57e2[_0x5948('0x28')]);_0x1ad0af['attributes']=_['intersection'](_0x3a57e2[_0x5948('0x2f')],qs['fields'](_0x2d1f6c[_0x5948('0x28')]['fields']));_0x1ad0af[_0x5948('0x30')]=_0x1ad0af[_0x5948('0x30')][_0x5948('0x31')]?_0x1ad0af[_0x5948('0x30')]:_0x3a57e2[_0x5948('0x2f')];if(_0x2d1f6c[_0x5948('0x28')][_0x5948('0x32')]){_0x1ad0af[_0x5948('0x33')]=[{'all':!![]}];}_0x1ad0af=_[_0x5948('0x34')]({},_0x1ad0af,_0x2d1f6c[_0x5948('0x35')]);return db['MailInteraction'][_0x5948('0x36')](_0x1ad0af)[_0x5948('0x29')](handleEntityNotFound(_0x3c66e7,null))['then'](respondWithResult(_0x3c66e7,null))[_0x5948('0x37')](handleError(_0x3c66e7,null));};exports['create']=function(_0x42be11,_0x4240da){return db['MailInteraction'][_0x5948('0x38')](_0x42be11['body'],{})[_0x5948('0x29')](respondWithResult(_0x4240da,0xc9))[_0x5948('0x37')](handleError(_0x4240da,null));};exports[_0x5948('0x1c')]=function(_0x3a7b77,_0x2bfb28){if(_0x3a7b77[_0x5948('0x39')]['id']){delete _0x3a7b77[_0x5948('0x39')]['id'];}return db[_0x5948('0x24')][_0x5948('0x36')]({'where':{'id':_0x3a7b77[_0x5948('0x2b')]['id']}})[_0x5948('0x29')](handleEntityNotFound(_0x2bfb28,null))['then'](saveUpdates(_0x3a7b77['body'],null))['then'](respondWithResult(_0x2bfb28,null))['catch'](handleError(_0x2bfb28,null));};exports['destroy']=function(_0x45c940,_0x26e175){return db[_0x5948('0x24')]['find']({'where':{'id':_0x45c940[_0x5948('0x2b')]['id']}})[_0x5948('0x29')](handleEntityNotFound(_0x26e175,null))['then'](removeEntity(_0x26e175,null))[_0x5948('0x37')](handleError(_0x26e175,null));};exports['describe']=function(_0x1ae7a4,_0x34b36f){return db[_0x5948('0x24')][_0x5948('0x3a')]()['then'](respondWithResult(_0x34b36f,null))[_0x5948('0x37')](handleError(_0x34b36f,null));};exports['addMessage']=function(_0x1490ad,_0xb87f4f){return db[_0x5948('0x3b')][_0x5948('0x36')]({'where':{'id':_0x1490ad[_0x5948('0x2b')]['id']}})[_0x5948('0x29')](handleEntityNotFound(_0xb87f4f,null))[_0x5948('0x29')](function(_0x30f1b6){if(_0x30f1b6){return _0x30f1b6[_0x5948('0x3c')](_0x1490ad[_0x5948('0x39')][_0x5948('0x3d')],_['omit'](_0x1490ad[_0x5948('0x39')],[_0x5948('0x3d'),'id'])||{});}})[_0x5948('0x29')](respondWithResult(_0xb87f4f,null))[_0x5948('0x37')](handleError(_0xb87f4f,null));};exports[_0x5948('0x3e')]=function(_0x12e390,_0x196e26){var _0x271c43={'raw':![],'where':{}};var _0x369c6d={};var _0x389f24={'count':0x0,'rows':[]};return db[_0x5948('0x24')]['findOne']({'where':{'id':_0x12e390[_0x5948('0x2b')]['id']}})[_0x5948('0x29')](handleEntityNotFound(_0x196e26,null))[_0x5948('0x29')](function(_0x3de140){if(_0x3de140){_0x369c6d['model']=_['keys'](db[_0x5948('0x3b')][_0x5948('0x2c')]);_0x369c6d['query']=_[_0x5948('0x3f')](_0x12e390['query']);_0x369c6d[_0x5948('0x2d')]=_[_0x5948('0x2e')](_0x369c6d[_0x5948('0x2f')],_0x369c6d[_0x5948('0x28')]);_0x271c43['attributes']=_[_0x5948('0x2e')](_0x369c6d[_0x5948('0x2f')],qs[_0x5948('0x40')](_0x12e390['query'][_0x5948('0x40')]));_0x271c43[_0x5948('0x30')]=_0x271c43['attributes'][_0x5948('0x31')]?_0x271c43[_0x5948('0x30')]:_0x369c6d[_0x5948('0x2f')];if(!_0x12e390[_0x5948('0x28')][_0x5948('0x41')]('nolimit')){_0x271c43[_0x5948('0x17')]=qs['limit'](_0x12e390[_0x5948('0x28')]['limit']);_0x271c43[_0x5948('0x15')]=qs[_0x5948('0x15')](_0x12e390[_0x5948('0x28')][_0x5948('0x15')]);}_0x271c43[_0x5948('0x42')]=qs[_0x5948('0x43')](_0x12e390[_0x5948('0x28')][_0x5948('0x43')]);_0x271c43[_0x5948('0x44')]=qs[_0x5948('0x2d')](_[_0x5948('0x45')](_0x12e390[_0x5948('0x28')],_0x369c6d[_0x5948('0x2d')]));_0x271c43[_0x5948('0x44')][_0x5948('0x46')]=_0x3de140['id'];if(_0x12e390[_0x5948('0x28')][_0x5948('0x47')]){_0x271c43[_0x5948('0x44')]=_[_0x5948('0x34')](_0x271c43[_0x5948('0x44')],{'$or':_[_0x5948('0x23')](_0x271c43[_0x5948('0x30')],function(_0x2be4b4){var _0x298ea2={};_0x298ea2[_0x2be4b4]={'$like':'%'+_0x12e390['query'][_0x5948('0x47')]+'%'};return _0x298ea2;})});}if(_0x12e390[_0x5948('0x28')]['$gte']){var _0xb2dafe=_0x12e390['query'][_0x5948('0x48')][_0x5948('0x49')](',');var _0x5224f3={};_0x5224f3[_0xb2dafe[0x0]]={'$gte':moment(_0xb2dafe[0x1])[_0x5948('0x4a')](_0x5948('0x4b'))};_0x271c43['where']=_[_0x5948('0x34')](_0x271c43[_0x5948('0x44')],_0x5224f3);}_0x271c43=_[_0x5948('0x34')]({},_0x271c43,_0x12e390[_0x5948('0x35')]);return db[_0x5948('0x3b')][_0x5948('0x18')]({'where':_0x271c43['where']})['then'](function(_0x1188f7){_0x389f24[_0x5948('0x18')]=_0x1188f7;if(_0x12e390['query'][_0x5948('0x32')]){_0x271c43[_0x5948('0x33')]=[{'all':!![]}];}return db['MailMessage'][_0x5948('0x4c')](_0x271c43);})[_0x5948('0x29')](function(_0xd8c023){if(_0x12e390[_0x5948('0x28')]['inlineCss']===_0x5948('0x4d')){for(var _0x2360c0=0x0;_0x2360c0<_0xd8c023[_0x5948('0x31')];_0x2360c0++){_0xd8c023[_0x2360c0][_0x5948('0x39')]=juice(_0xd8c023[_0x2360c0][_0x5948('0x39')]);}}_0x389f24['rows']=_0xd8c023;return _0x389f24;});}})[_0x5948('0x29')](respondWithFilteredResult(_0x196e26,_0x271c43))[_0x5948('0x37')](handleError(_0x196e26,null));};exports[_0x5948('0x4e')]=function(_0x16184a,_0x243c2f){return db[_0x5948('0x24')][_0x5948('0x36')]({'where':{'id':_0x16184a[_0x5948('0x2b')]['id']}})['then'](handleEntityNotFound(_0x243c2f,null))['then'](function(_0x126eae){if(_0x126eae){return _0x126eae['setTags'](_0x16184a[_0x5948('0x39')]['ids'],_[_0x5948('0x4f')](_0x16184a[_0x5948('0x39')],[_0x5948('0x3d'),'id'])||{})['spread'](function(){return db[_0x5948('0x50')][_0x5948('0x4c')]({'attributes':['id',_0x5948('0x20'),'color'],'where':{'id':_0x16184a[_0x5948('0x39')][_0x5948('0x3d')]}});})['then'](function(_0x2e3277){socket[_0x5948('0x51')]('mailInteractionTags:save',{'id':Number(_0x16184a[_0x5948('0x2b')]['id']),'tags':_0x2e3277||[]});return{'id':Number(_0x16184a[_0x5948('0x2b')]['id']),'tags':_0x2e3277||[]};});}})[_0x5948('0x29')](respondWithResult(_0x243c2f,null))[_0x5948('0x37')](handleError(_0x243c2f,null));};exports[_0x5948('0x52')]=function(_0x3419d8,_0x5e5f18){return db[_0x5948('0x24')]['find']({'where':{'id':_0x3419d8[_0x5948('0x2b')]['id']}})[_0x5948('0x29')](handleEntityNotFound(_0x5e5f18,null))['then'](function(_0x51e47a){if(_0x51e47a){return _0x51e47a['removeTags'](_0x3419d8['query'][_0x5948('0x3d')]);}})[_0x5948('0x29')](respondWithStatusCode(_0x5e5f18,null))['catch'](handleError(_0x5e5f18,null));};exports[_0x5948('0x53')]=function(_0x4ac5b8,_0x47a5de){var _0x2b9ace=moment()[_0x5948('0x54')]()[_0x5948('0x55')]();var _0x45fa24=path[_0x5948('0x56')](config[_0x5948('0x57')],_0x5948('0x58'),_0x5948('0x59'),'tmp');var _0x36dfa8=path[_0x5948('0x56')](config['root'],'server',_0x5948('0x59'),'attachments');var _0x183a03=path[_0x5948('0x56')](_0x45fa24,_0x2b9ace);var _0x18ac87=util[_0x5948('0x4a')]('transcript-%d-%s.zip',_0x4ac5b8['params']['id'],_0x2b9ace);var _0x4f1fb0=path[_0x5948('0x56')](_0x45fa24,_0x18ac87);var _0x1b73d1=[];if(_0x4ac5b8[_0x5948('0x28')][_0x5948('0x5a')]){_0x1b73d1[_0x5948('0x5b')]({'model':db[_0x5948('0x5c')],'as':_0x5948('0x5d'),'raw':!![]});}var _0x364c26=[{'model':db[_0x5948('0x3b')],'as':'Messages','attributes':['id',_0x5948('0x39'),_0x5948('0x5e'),'to','cc',_0x5948('0x5f'),'subject',_0x5948('0x60')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x1b73d1}];return db[_0x5948('0x24')]['find']({'where':{'id':_0x4ac5b8['params']['id']},'include':_0x364c26})['then'](handleEntityNotFound(_0x47a5de,null))['then'](function(_0x4a97a2){if(_0x4a97a2&&_0x4a97a2[_0x5948('0x61')]){var _0x1c862a=_0x4a97a2[_0x5948('0x62')]({'plain':!![]});fs[_0x5948('0x63')](_0x183a03);return BPromise[_0x5948('0x64')](_0x1c862a[_0x5948('0x61')],function(_0x164821,_0x5dc7fe){var _0xe91f14={'from':_0x164821[_0x5948('0x5e')],'to':_0x164821['to'],'subject':_0x164821['subject'],'html':htmlEntities[_0x5948('0x65')](_0x164821[_0x5948('0x39')]),'headers':{'Date':moment(_0x164821[_0x5948('0x60')])[_0x5948('0x4a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x164821['cc']){_0xe91f14[_0x5948('0x66')]['Cc']=_0x164821['cc'];}if(_0x164821['bcc']){_0xe91f14[_0x5948('0x66')][_0x5948('0x67')]=_0x164821[_0x5948('0x5f')];}return new BPromise(function(_0x4741cc,_0x24cf24){if(_0x164821['Attachments']){for(var _0x508181=0x0;_0x508181<_0x164821[_0x5948('0x5d')]['length'];_0x508181++){var _0x52dd2a=_0x164821[_0x5948('0x5d')][_0x508181];var _0x268f88=path[_0x5948('0x56')](_0x36dfa8,_0x52dd2a[_0x5948('0x68')]);if(fs[_0x5948('0x69')](_0x268f88)){_0xe91f14[_0x5948('0x5a')][_0x5948('0x5b')]({'name':_0x52dd2a[_0x5948('0x20')],'contentType':_0x52dd2a[_0x5948('0x25')],'data':fs['readFileSync'](_0x268f88)});}}}emlformat[_0x5948('0x6a')](_0xe91f14,function(_0x2dc0b8,_0xaff242){if(_0x2dc0b8)return _0x24cf24(_0x2dc0b8);fs[_0x5948('0x6b')](path[_0x5948('0x56')](_0x183a03,util[_0x5948('0x4a')](_0x5948('0x6c'),_0x5dc7fe)),_0xaff242);return _0x4741cc(_0xaff242);});});})[_0x5948('0x29')](function(){return new BPromise(function(_0x1a5d35,_0x5a37a0){zipdir(_0x183a03,{'saveTo':_0x4f1fb0},function(_0x2b12d6,_0x12dbe7){if(_0x2b12d6)return _0x5a37a0(_0x2b12d6);return _0x1a5d35(_0x12dbe7);});})['then'](function(){return new BPromise(function(_0x10c33,_0x847109){rimraf(_0x183a03,function(_0x204bfa){if(_0x204bfa)_0x847109(_0x204bfa);return _0x10c33();});});})[_0x5948('0x29')](function(){return _0x47a5de[_0x5948('0x53')](_0x4f1fb0,_0x18ac87,function(_0x509751){if(!_0x509751)fs[_0x5948('0x6d')](_0x4f1fb0);});});});}else{return _0x47a5de[_0x5948('0x12')](0xc8);}})[_0x5948('0x37')](handleError(_0x47a5de,null));}; \ No newline at end of file +var _0x1b69=['Attachments','from','bcc','createdAt','get','mkdirSync','each','Messages','subject','decode','headers','Bcc','build','writeFileSync','message%d.eml','unlinkSync','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','getOptions','findAll','mail','query','catch','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','MailMessage','ids','omit','findOne','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','rows','addTags','setTags','spread','color','mailInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','push'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x1b69,0x1d0));var _0x91b6=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x1b69[_0x2fc012];return _0x2891f9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x91b6('0x0'));var BPromise=require(_0x91b6('0x1'));var util=require(_0x91b6('0x2'));var path=require(_0x91b6('0x3'));var fs=require('fs');var _=require('lodash');var juice=require(_0x91b6('0x4'));var Redis=require(_0x91b6('0x5'));var interaction=require(_0x91b6('0x6'));var qs=require(_0x91b6('0x7'));var logger=require(_0x91b6('0x8'))(_0x91b6('0x9'));var config=require(_0x91b6('0xa'));var db=require(_0x91b6('0xb'))['db'];var htmlEntities=require(_0x91b6('0xc'));config[_0x91b6('0xd')]=_[_0x91b6('0xe')](config[_0x91b6('0xd')],{'host':_0x91b6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91b6('0xd')]));require(_0x91b6('0x10'))[_0x91b6('0x11')](socket);function respondWithStatusCode(_0x295156,_0x14e5a9){_0x14e5a9=_0x14e5a9||0xcc;return function(_0x31288c){if(_0x31288c){return _0x295156[_0x91b6('0x12')](_0x14e5a9);}return _0x295156['status'](_0x14e5a9)['end']();};}function respondWithResult(_0x4d20f0,_0x1934bb){_0x1934bb=_0x1934bb||0xc8;return function(_0x21c4d6){if(_0x21c4d6){return _0x4d20f0[_0x91b6('0x13')](_0x1934bb)[_0x91b6('0x14')](_0x21c4d6);}};}function respondWithFilteredResult(_0x2d2331,_0x4758e7){return function(_0x2d6ebf){if(_0x2d6ebf){var _0x204fd9=typeof _0x4758e7[_0x91b6('0x15')]===_0x91b6('0x16')&&typeof _0x4758e7[_0x91b6('0x17')]==='undefined';var _0x40cd55=_0x2d6ebf[_0x91b6('0x18')];var _0x2359f3=_0x204fd9?0x0:_0x4758e7[_0x91b6('0x15')];var _0x10baaa=_0x204fd9?_0x2d6ebf[_0x91b6('0x18')]:_0x4758e7[_0x91b6('0x15')]+_0x4758e7[_0x91b6('0x17')];var _0x8654be;if(_0x10baaa>=_0x40cd55){_0x10baaa=_0x40cd55;_0x8654be=0xc8;}else{_0x8654be=0xce;}_0x2d2331['status'](_0x8654be);return _0x2d2331[_0x91b6('0x19')](_0x91b6('0x1a'),_0x2359f3+'-'+_0x10baaa+'/'+_0x40cd55)['json'](_0x2d6ebf);}return null;};}function saveUpdates(_0x35d21a){return function(_0x2883fe){if(_0x2883fe){return _0x2883fe[_0x91b6('0x1b')](_0x35d21a)[_0x91b6('0x1c')](function(_0x226781){return _0x226781;});}return null;};}function removeEntity(_0x2647b1){return function(_0x93c927){if(_0x93c927){return _0x93c927['destroy']()[_0x91b6('0x1c')](function(){_0x2647b1[_0x91b6('0x13')](0xcc)[_0x91b6('0x1d')]();});}};}function handleEntityNotFound(_0x472897){return function(_0x5cf320){if(!_0x5cf320){_0x472897[_0x91b6('0x12')](0x194);}return _0x5cf320;};}function handleError(_0x337679,_0x4b7038){_0x4b7038=_0x4b7038||0x1f4;return function(_0xf30fcb){logger['error'](_0xf30fcb[_0x91b6('0x1e')]);if(_0xf30fcb[_0x91b6('0x1f')]){delete _0xf30fcb[_0x91b6('0x1f')];}_0x337679[_0x91b6('0x13')](_0x4b7038)[_0x91b6('0x20')](_0xf30fcb);};}exports[_0x91b6('0x21')]=function(_0x21eec3,_0x2d6f7e){var _0x3c4e27={};var _0xf16195=_[_0x91b6('0x22')](db[_0x91b6('0x23')][_0x91b6('0x24')],function(_0x5e699e){return{'name':_0x5e699e[_0x91b6('0x25')],'type':_0x5e699e[_0x91b6('0x26')]['key']};});_0x3c4e27=qs[_0x91b6('0x27')](_0xf16195,_0x21eec3);return interaction[_0x91b6('0x28')](_0x91b6('0x29'),_0x21eec3[_0x91b6('0x2a')],_0x21eec3['user'],_0x3c4e27,_0xf16195)[_0x91b6('0x1c')](respondWithFilteredResult(_0x2d6f7e,_0x3c4e27))[_0x91b6('0x2b')](handleError(_0x2d6f7e,null));};exports[_0x91b6('0x2c')]=function(_0x261635,_0x133d83){var _0x2955d8={'raw':![],'where':{'id':_0x261635[_0x91b6('0x2d')]['id']}},_0x931be0={};_0x931be0[_0x91b6('0x2e')]=_[_0x91b6('0x2f')](db['MailInteraction']['rawAttributes']);_0x931be0[_0x91b6('0x2a')]=_[_0x91b6('0x2f')](_0x261635['query']);_0x931be0[_0x91b6('0x30')]=_['intersection'](_0x931be0[_0x91b6('0x2e')],_0x931be0[_0x91b6('0x2a')]);_0x2955d8[_0x91b6('0x31')]=_[_0x91b6('0x32')](_0x931be0[_0x91b6('0x2e')],qs['fields'](_0x261635[_0x91b6('0x2a')][_0x91b6('0x33')]));_0x2955d8['attributes']=_0x2955d8['attributes'][_0x91b6('0x34')]?_0x2955d8[_0x91b6('0x31')]:_0x931be0[_0x91b6('0x2e')];if(_0x261635[_0x91b6('0x2a')][_0x91b6('0x35')]){_0x2955d8[_0x91b6('0x36')]=[{'all':!![]}];}_0x2955d8=_[_0x91b6('0x37')]({},_0x2955d8,_0x261635[_0x91b6('0x38')]);return db[_0x91b6('0x23')][_0x91b6('0x39')](_0x2955d8)[_0x91b6('0x1c')](handleEntityNotFound(_0x133d83,null))[_0x91b6('0x1c')](respondWithResult(_0x133d83,null))[_0x91b6('0x2b')](handleError(_0x133d83,null));};exports[_0x91b6('0x3a')]=function(_0xdefc10,_0xa64752){return db[_0x91b6('0x23')]['create'](_0xdefc10['body'],{})[_0x91b6('0x1c')](respondWithResult(_0xa64752,0xc9))['catch'](handleError(_0xa64752,null));};exports[_0x91b6('0x1b')]=function(_0x52228b,_0x18477b){if(_0x52228b[_0x91b6('0x3b')]['id']){delete _0x52228b[_0x91b6('0x3b')]['id'];}return db[_0x91b6('0x23')][_0x91b6('0x39')]({'where':{'id':_0x52228b[_0x91b6('0x2d')]['id']}})[_0x91b6('0x1c')](handleEntityNotFound(_0x18477b,null))[_0x91b6('0x1c')](saveUpdates(_0x52228b[_0x91b6('0x3b')],null))[_0x91b6('0x1c')](respondWithResult(_0x18477b,null))[_0x91b6('0x2b')](handleError(_0x18477b,null));};exports[_0x91b6('0x3c')]=function(_0x1692a5,_0x419355){return db['MailInteraction'][_0x91b6('0x39')]({'where':{'id':_0x1692a5[_0x91b6('0x2d')]['id']}})[_0x91b6('0x1c')](handleEntityNotFound(_0x419355,null))['then'](removeEntity(_0x419355,null))[_0x91b6('0x2b')](handleError(_0x419355,null));};exports[_0x91b6('0x3d')]=function(_0x1ed417,_0xd7d6a8){return db['MailInteraction'][_0x91b6('0x3d')]()[_0x91b6('0x1c')](respondWithResult(_0xd7d6a8,null))[_0x91b6('0x2b')](handleError(_0xd7d6a8,null));};exports[_0x91b6('0x3e')]=function(_0x5c4651,_0x35a10c){return db[_0x91b6('0x3f')][_0x91b6('0x39')]({'where':{'id':_0x5c4651['params']['id']}})[_0x91b6('0x1c')](handleEntityNotFound(_0x35a10c,null))[_0x91b6('0x1c')](function(_0x29c724){if(_0x29c724){return _0x29c724[_0x91b6('0x3e')](_0x5c4651['body'][_0x91b6('0x40')],_[_0x91b6('0x41')](_0x5c4651['body'],[_0x91b6('0x40'),'id'])||{});}})[_0x91b6('0x1c')](respondWithResult(_0x35a10c,null))[_0x91b6('0x2b')](handleError(_0x35a10c,null));};exports['getMessages']=function(_0x7e3657,_0x22b67c){var _0x3e77f5={'raw':![],'where':{}};var _0x1940f2={};var _0x1c1513={'count':0x0,'rows':[]};return db['MailInteraction'][_0x91b6('0x42')]({'where':{'id':_0x7e3657[_0x91b6('0x2d')]['id']}})['then'](handleEntityNotFound(_0x22b67c,null))[_0x91b6('0x1c')](function(_0x2f7ebd){if(_0x2f7ebd){_0x1940f2[_0x91b6('0x2e')]=_['keys'](db[_0x91b6('0x3f')]['rawAttributes']);_0x1940f2['query']=_[_0x91b6('0x2f')](_0x7e3657[_0x91b6('0x2a')]);_0x1940f2[_0x91b6('0x30')]=_[_0x91b6('0x32')](_0x1940f2['model'],_0x1940f2['query']);_0x3e77f5[_0x91b6('0x31')]=_[_0x91b6('0x32')](_0x1940f2[_0x91b6('0x2e')],qs['fields'](_0x7e3657['query'][_0x91b6('0x33')]));_0x3e77f5['attributes']=_0x3e77f5[_0x91b6('0x31')][_0x91b6('0x34')]?_0x3e77f5[_0x91b6('0x31')]:_0x1940f2['model'];if(!_0x7e3657[_0x91b6('0x2a')]['hasOwnProperty'](_0x91b6('0x43'))){_0x3e77f5[_0x91b6('0x17')]=qs[_0x91b6('0x17')](_0x7e3657[_0x91b6('0x2a')][_0x91b6('0x17')]);_0x3e77f5[_0x91b6('0x15')]=qs[_0x91b6('0x15')](_0x7e3657[_0x91b6('0x2a')][_0x91b6('0x15')]);}_0x3e77f5[_0x91b6('0x44')]=qs[_0x91b6('0x45')](_0x7e3657['query'][_0x91b6('0x45')]);_0x3e77f5[_0x91b6('0x46')]=qs[_0x91b6('0x30')](_['pick'](_0x7e3657[_0x91b6('0x2a')],_0x1940f2[_0x91b6('0x30')]));_0x3e77f5['where'][_0x91b6('0x47')]=_0x2f7ebd['id'];if(_0x7e3657[_0x91b6('0x2a')][_0x91b6('0x48')]){_0x3e77f5[_0x91b6('0x46')]=_[_0x91b6('0x37')](_0x3e77f5['where'],{'$or':_[_0x91b6('0x22')](_0x3e77f5[_0x91b6('0x31')],function(_0x36e2bb){var _0x195d11={};_0x195d11[_0x36e2bb]={'$like':'%'+_0x7e3657[_0x91b6('0x2a')]['filter']+'%'};return _0x195d11;})});}if(_0x7e3657[_0x91b6('0x2a')]['$gte']){var _0x3ea1a5=_0x7e3657[_0x91b6('0x2a')][_0x91b6('0x49')][_0x91b6('0x4a')](',');var _0x48a1c9={};_0x48a1c9[_0x3ea1a5[0x0]]={'$gte':moment(_0x3ea1a5[0x1])[_0x91b6('0x4b')](_0x91b6('0x4c'))};_0x3e77f5[_0x91b6('0x46')]=_[_0x91b6('0x37')](_0x3e77f5[_0x91b6('0x46')],_0x48a1c9);}_0x3e77f5=_[_0x91b6('0x37')]({},_0x3e77f5,_0x7e3657['options']);return db['MailMessage'][_0x91b6('0x18')]({'where':_0x3e77f5['where']})[_0x91b6('0x1c')](function(_0x1fafb9){_0x1c1513[_0x91b6('0x18')]=_0x1fafb9;if(_0x7e3657['query'][_0x91b6('0x35')]){_0x3e77f5[_0x91b6('0x36')]=[{'all':!![]}];}return db[_0x91b6('0x3f')][_0x91b6('0x28')](_0x3e77f5);})[_0x91b6('0x1c')](function(_0x2a2e9c){if(_0x7e3657[_0x91b6('0x2a')]['inlineCss']===_0x91b6('0x4d')){for(var _0x3d825d=0x0;_0x3d825d<_0x2a2e9c['length'];_0x3d825d++){_0x2a2e9c[_0x3d825d][_0x91b6('0x3b')]=juice(_0x2a2e9c[_0x3d825d][_0x91b6('0x3b')]);}}_0x1c1513[_0x91b6('0x4e')]=_0x2a2e9c;return _0x1c1513;});}})['then'](respondWithFilteredResult(_0x22b67c,_0x3e77f5))['catch'](handleError(_0x22b67c,null));};exports[_0x91b6('0x4f')]=function(_0x31439d,_0x53bb78){return db['MailInteraction'][_0x91b6('0x39')]({'where':{'id':_0x31439d[_0x91b6('0x2d')]['id']}})[_0x91b6('0x1c')](handleEntityNotFound(_0x53bb78,null))[_0x91b6('0x1c')](function(_0x55e649){if(_0x55e649){return _0x55e649[_0x91b6('0x50')](_0x31439d[_0x91b6('0x3b')][_0x91b6('0x40')],_[_0x91b6('0x41')](_0x31439d[_0x91b6('0x3b')],['ids','id'])||{})[_0x91b6('0x51')](function(){return db['Tag'][_0x91b6('0x28')]({'attributes':['id',_0x91b6('0x1f'),_0x91b6('0x52')],'where':{'id':_0x31439d[_0x91b6('0x3b')]['ids']}});})[_0x91b6('0x1c')](function(_0x4f71c7){socket['emit'](_0x91b6('0x53'),{'id':Number(_0x31439d[_0x91b6('0x2d')]['id']),'tags':_0x4f71c7||[]});return{'id':Number(_0x31439d[_0x91b6('0x2d')]['id']),'tags':_0x4f71c7||[]};});}})[_0x91b6('0x1c')](respondWithResult(_0x53bb78,null))[_0x91b6('0x2b')](handleError(_0x53bb78,null));};exports['removeTags']=function(_0x594b8a,_0x54e7ee){return db[_0x91b6('0x23')][_0x91b6('0x39')]({'where':{'id':_0x594b8a[_0x91b6('0x2d')]['id']}})[_0x91b6('0x1c')](handleEntityNotFound(_0x54e7ee,null))['then'](function(_0xdada17){if(_0xdada17){return _0xdada17[_0x91b6('0x54')](_0x594b8a[_0x91b6('0x2a')]['ids']);}})[_0x91b6('0x1c')](respondWithStatusCode(_0x54e7ee,null))[_0x91b6('0x2b')](handleError(_0x54e7ee,null));};exports[_0x91b6('0x55')]=function(_0x229062,_0x4ee862){var _0x11d73a=moment()[_0x91b6('0x56')]()[_0x91b6('0x57')]();var _0x20b720=path['join'](config[_0x91b6('0x58')],_0x91b6('0x59'),_0x91b6('0x5a'),_0x91b6('0x5b'));var _0x419572=path['join'](config[_0x91b6('0x58')],_0x91b6('0x59'),_0x91b6('0x5a'),_0x91b6('0x5c'));var _0x2ba37b=path[_0x91b6('0x5d')](_0x20b720,_0x11d73a);var _0x486ad8=util[_0x91b6('0x4b')](_0x91b6('0x5e'),_0x229062[_0x91b6('0x2d')]['id'],_0x11d73a);var _0x2867db=path[_0x91b6('0x5d')](_0x20b720,_0x486ad8);var _0x456634=[];if(_0x229062[_0x91b6('0x2a')][_0x91b6('0x5c')]){_0x456634[_0x91b6('0x5f')]({'model':db['Attachment'],'as':_0x91b6('0x60'),'raw':!![]});}var _0x11eb4c=[{'model':db[_0x91b6('0x3f')],'as':'Messages','attributes':['id',_0x91b6('0x3b'),_0x91b6('0x61'),'to','cc',_0x91b6('0x62'),'subject',_0x91b6('0x63')],'where':{'secret':![]},'order':qs[_0x91b6('0x45')]('id'),'include':_0x456634}];return db[_0x91b6('0x23')][_0x91b6('0x39')]({'where':{'id':_0x229062[_0x91b6('0x2d')]['id']},'include':_0x11eb4c})[_0x91b6('0x1c')](handleEntityNotFound(_0x4ee862,null))[_0x91b6('0x1c')](function(_0x40cfcb){if(_0x40cfcb&&_0x40cfcb['Messages']){var _0x1b27d1=_0x40cfcb[_0x91b6('0x64')]({'plain':!![]});fs[_0x91b6('0x65')](_0x2ba37b);return BPromise[_0x91b6('0x66')](_0x1b27d1[_0x91b6('0x67')],function(_0x1001f2,_0x22f219){var _0xc565ff={'from':_0x1001f2['from'],'to':_0x1001f2['to'],'subject':_0x1001f2[_0x91b6('0x68')],'html':htmlEntities[_0x91b6('0x69')](_0x1001f2[_0x91b6('0x3b')]),'headers':{'Date':moment(_0x1001f2[_0x91b6('0x63')])[_0x91b6('0x4b')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1001f2['cc']){_0xc565ff[_0x91b6('0x6a')]['Cc']=_0x1001f2['cc'];}if(_0x1001f2[_0x91b6('0x62')]){_0xc565ff[_0x91b6('0x6a')][_0x91b6('0x6b')]=_0x1001f2[_0x91b6('0x62')];}return new BPromise(function(_0x441722,_0x3de6c5){if(_0x1001f2['Attachments']){for(var _0x1aebd2=0x0;_0x1aebd2<_0x1001f2[_0x91b6('0x60')][_0x91b6('0x34')];_0x1aebd2++){var _0x282799=_0x1001f2['Attachments'][_0x1aebd2];var _0x1c346b=path[_0x91b6('0x5d')](_0x419572,_0x282799['basename']);if(fs['existsSync'](_0x1c346b)){_0xc565ff[_0x91b6('0x5c')][_0x91b6('0x5f')]({'name':_0x282799['name'],'contentType':_0x282799[_0x91b6('0x26')],'data':fs['readFileSync'](_0x1c346b)});}}}emlformat[_0x91b6('0x6c')](_0xc565ff,function(_0x59684d,_0x1c3b04){if(_0x59684d)return _0x3de6c5(_0x59684d);fs[_0x91b6('0x6d')](path[_0x91b6('0x5d')](_0x2ba37b,util[_0x91b6('0x4b')](_0x91b6('0x6e'),_0x22f219)),_0x1c3b04);return _0x441722(_0x1c3b04);});});})['then'](function(){return new BPromise(function(_0x4f20b4,_0x2af367){zipdir(_0x2ba37b,{'saveTo':_0x2867db},function(_0x319f8f,_0x1008a1){if(_0x319f8f)return _0x2af367(_0x319f8f);return _0x4f20b4(_0x1008a1);});})[_0x91b6('0x1c')](function(){return new BPromise(function(_0x489072,_0x37003b){rimraf(_0x2ba37b,function(_0x192bd5){if(_0x192bd5)_0x37003b(_0x192bd5);return _0x489072();});});})['then'](function(){return _0x4ee862['download'](_0x2867db,_0x486ad8,function(_0x4a954c){if(!_0x4a954c)fs[_0x91b6('0x6f')](_0x2867db);});});});}else{return _0x4ee862[_0x91b6('0x12')](0xc8);}})['catch'](handleError(_0x4ee862,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 9f09760..a51246d 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 _0x656c=['remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x656c,0x6a));var _0xc656=function(_0x23cf71,_0x1bf670){_0x23cf71=_0x23cf71-0x0;var _0x450797=_0x656c[_0x23cf71];return _0x450797;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xc656('0x0'))['db'][_0xc656('0x1')];var MailMessage=require(_0xc656('0x0'))['db'][_0xc656('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc656('0x3')](0x0);var events={'afterCreate':_0xc656('0x4'),'afterUpdate':_0xc656('0x5'),'afterDestroy':_0xc656('0x6')};function emitEvent(_0x354b5c){return function(_0x3b2090,_0x19cd32,_0x671c15){_0x3b2090[_0xc656('0x7')]({'attributes':['id'],'raw':!![]})[_0xc656('0x8')](function(_0x299fe6){_0x3b2090[_0xc656('0x9')](_0xc656('0xa'),_0x299fe6['map'](function(_0x58056f){return{'id':_0x58056f['id']};}));return MailMessage[_0xc656('0xb')]({'where':{'MailInteractionId':_0x3b2090['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x22ffa8){_0x3b2090[_0xc656('0x9')](_0xc656('0xc'),_0x22ffa8[_0xc656('0xd')]);MailInteractionEvents[_0xc656('0xe')](_0x354b5c+':'+_0x3b2090['id'],_0x3b2090);MailInteractionEvents['emit'](_0x354b5c,_0x3b2090);_0x671c15(null);})['catch'](_0x671c15(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xc656('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xe854=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xe854,0x105));var _0x4e85=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xe854[_0x1911ed];return _0x11edaa;};'use strict';var EventEmitter=require(_0x4e85('0x0'));var MailInteraction=require(_0x4e85('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x4e85('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4e85('0x3')](0x0);var events={'afterCreate':_0x4e85('0x4'),'afterUpdate':_0x4e85('0x5'),'afterDestroy':_0x4e85('0x6')};function emitEvent(_0x407c61){return function(_0x4df690,_0x40634b,_0x4fcc9a){_0x4df690[_0x4e85('0x7')]({'attributes':['id'],'raw':!![]})[_0x4e85('0x8')](function(_0xe157fb){_0x4df690[_0x4e85('0x9')](_0x4e85('0xa'),_0xe157fb[_0x4e85('0xb')](function(_0x14e352){return{'id':_0x14e352['id']};}));return MailMessage[_0x4e85('0xc')]({'where':{'MailInteractionId':_0x4df690['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4e85('0x8')](function(_0x567562){_0x4df690[_0x4e85('0x9')](_0x4e85('0xd'),_0x567562['length']);MailInteractionEvents[_0x4e85('0xe')](_0x407c61+':'+_0x4df690['id'],_0x4df690);MailInteractionEvents[_0x4e85('0xe')](_0x407c61,_0x4df690);_0x4fcc9a(null);})[_0x4e85('0xf')](_0x4fcc9a(null));};}for(var e in events){if(events[_0x4e85('0x10')](e)){var event=events[e];MailInteraction[_0x4e85('0x11')](e,emitEvent(event));}}module[_0x4e85('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 0c4af13..1dc588e 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 _0x6bd7=['closedAt','substatus','substatusAt','models','MailMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','subject','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x11acd3,_0x1e4f92){var _0x598a60=function(_0x591e03){while(--_0x591e03){_0x11acd3['push'](_0x11acd3['shift']());}};_0x598a60(++_0x1e4f92);}(_0x6bd7,0x1e7));var _0x76bd=function(_0xa25862,_0x27f1a4){_0xa25862=_0xa25862-0x0;var _0x5b9b0a=_0x6bd7[_0xa25862];return _0x5b9b0a;};'use strict';var _=require(_0x76bd('0x0'));var util=require('util');var logger=require(_0x76bd('0x1'))(_0x76bd('0x2'));var moment=require(_0x76bd('0x3'));var BPromise=require(_0x76bd('0x4'));var rp=require(_0x76bd('0x5'));var fs=require('fs');var path=require(_0x76bd('0x6'));var rimraf=require(_0x76bd('0x7'));var config=require(_0x76bd('0x8'));var attributes=require(_0x76bd('0x9'));module[_0x76bd('0xa')]=function(_0xc64183,_0x58b3c0){return _0xc64183[_0x76bd('0xb')](_0x76bd('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x76bd('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c779d,_0x38fdc7,_0x35633f){if(_0x2c779d['substatus']){_0x2c779d['substatusAt']=moment()[_0x76bd('0xe')](_0x76bd('0xf'));}if(_0x2c779d[_0x76bd('0x10')]){_0x2c779d[_0x76bd('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x35633f(null,_0x38fdc7);},'beforeUpdate':function(_0x4f001d,_0x3ed125,_0x24b295){if(_0x4f001d['changed'](_0x76bd('0x12'))){_0x4f001d[_0x76bd('0x13')]=_0x4f001d[_0x76bd('0x12')]?moment()['format'](_0x76bd('0xf')):null;}if(_0x4f001d['changed'](_0x76bd('0x10'))){_0x4f001d[_0x76bd('0x11')]=moment()[_0x76bd('0xe')](_0x76bd('0xf'));_0x4f001d[_0x76bd('0x12')]=null;_0x4f001d[_0x76bd('0x13')]=null;}_0x24b295(null,_0x4f001d);},'afterUpdate':function(_0x59c080,_0x3c7d27,_0x418fc3){var _0x313c86=_0xc64183[_0x76bd('0x14')];var _0x5a49f9=_0x59c080['get']({'plain':!![]});if(_0x5a49f9[_0x76bd('0x10')]){return _0x313c86[_0x76bd('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x5a49f9['id']}})['then'](function(){_0x418fc3();})['catch'](function(_0x36b139){_0x418fc3(_0x36b139);});}else{_0x418fc3();}}},'charset':_0x76bd('0x16'),'collate':_0x76bd('0x17')});}; \ No newline at end of file +var _0xd49d=['catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','MailMessage','update','then'];(function(_0x19d688,_0x5487a3){var _0x32c737=function(_0x83651d){while(--_0x83651d){_0x19d688['push'](_0x19d688['shift']());}};_0x32c737(++_0x5487a3);}(_0xd49d,0x84));var _0xdd49=function(_0x4e8612,_0x4baba5){_0x4e8612=_0x4e8612-0x0;var _0x3c3f59=_0xd49d[_0x4e8612];return _0x3c3f59;};'use strict';var _=require(_0xdd49('0x0'));var util=require(_0xdd49('0x1'));var logger=require(_0xdd49('0x2'))(_0xdd49('0x3'));var moment=require(_0xdd49('0x4'));var BPromise=require(_0xdd49('0x5'));var rp=require(_0xdd49('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd49('0x7'));var config=require(_0xdd49('0x8'));var attributes=require(_0xdd49('0x9'));module['exports']=function(_0x2c225e,_0x3277a7){return _0x2c225e['define']('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xdd49('0xa'),'fields':[_0xdd49('0xb'),'to'],'type':_0xdd49('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c9ce1,_0x1d94d8,_0x135cb2){if(_0x5c9ce1[_0xdd49('0xd')]){_0x5c9ce1[_0xdd49('0xe')]=moment()[_0xdd49('0xf')](_0xdd49('0x10'));}if(_0x5c9ce1[_0xdd49('0x11')]){_0x5c9ce1[_0xdd49('0x12')]=moment()[_0xdd49('0xf')](_0xdd49('0x10'));}_0x135cb2(null,_0x1d94d8);},'beforeUpdate':function(_0x589859,_0x2f0c2e,_0x4035d2){if(_0x589859[_0xdd49('0x13')](_0xdd49('0xd'))){_0x589859[_0xdd49('0xe')]=_0x589859[_0xdd49('0xd')]?moment()[_0xdd49('0xf')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x589859[_0xdd49('0x13')](_0xdd49('0x11'))){_0x589859[_0xdd49('0x12')]=moment()[_0xdd49('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x589859[_0xdd49('0xd')]=null;_0x589859['substatusAt']=null;}_0x4035d2(null,_0x589859);},'afterUpdate':function(_0x4ad88b,_0x35e055,_0x14f13c){var _0x4182a7=_0x2c225e[_0xdd49('0x14')];var _0x47a58f=_0x4ad88b['get']({'plain':!![]});if(_0x47a58f[_0xdd49('0x11')]){return _0x4182a7[_0xdd49('0x15')][_0xdd49('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x47a58f['id']}})[_0xdd49('0x17')](function(){_0x14f13c();})[_0xdd49('0x18')](function(_0x35bef5){_0x14f13c(_0x35bef5);});}else{_0x14f13c();}}},'charset':_0xdd49('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 9933cb5..1f5bc92 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 _0xbd4a=['code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x10e4a4,_0x1574b8){var _0x1dd2c2=function(_0x1189eb){while(--_0x1189eb){_0x10e4a4['push'](_0x10e4a4['shift']());}};_0x1dd2c2(++_0x1574b8);}(_0xbd4a,0xbf));var _0xabd4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbd4a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xabd4('0x0'));var util=require(_0xabd4('0x1'));var moment=require('moment');var BPromise=require(_0xabd4('0x2'));var rs=require(_0xabd4('0x3'));var fs=require('fs');var Redis=require(_0xabd4('0x4'));var db=require(_0xabd4('0x5'))['db'];var utils=require(_0xabd4('0x6'));var logger=require('../../config/logger')(_0xabd4('0x7'));var config=require(_0xabd4('0x8'));var jayson=require(_0xabd4('0x9'));var client=jayson['client'][_0xabd4('0xa')]({'port':0x232a});config[_0xabd4('0xb')]=_[_0xabd4('0xc')](config[_0xabd4('0xb')],{'host':_0xabd4('0xd'),'port':0x18eb});var socket=require(_0xabd4('0xe'))(new Redis(config[_0xabd4('0xb')]));require(_0xabd4('0xf'))[_0xabd4('0x10')](socket);function respondWithRpcPromise(_0x304719,_0x60a203,_0x228e00){return new BPromise(function(_0xacbf1a,_0x3072cd){return client[_0xabd4('0x11')](_0x304719,_0x228e00)[_0xabd4('0x12')](function(_0x3a35e5){logger['info'](_0xabd4('0x13'),_0x60a203,_0xabd4('0x14'));logger[_0xabd4('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x60a203,'request\x20sent',JSON[_0xabd4('0x16')](_0x3a35e5));if(_0x3a35e5[_0xabd4('0x17')]){if(_0x3a35e5[_0xabd4('0x17')][_0xabd4('0x18')]===0x1f4){logger[_0xabd4('0x17')]('MailInteraction,\x20%s,\x20%s',_0x60a203,_0x3a35e5[_0xabd4('0x17')][_0xabd4('0x19')]);return _0x3072cd(_0x3a35e5[_0xabd4('0x17')]['message']);}logger[_0xabd4('0x17')](_0xabd4('0x13'),_0x60a203,_0x3a35e5[_0xabd4('0x17')][_0xabd4('0x19')]);return _0xacbf1a(_0x3a35e5[_0xabd4('0x17')][_0xabd4('0x19')]);}else{logger[_0xabd4('0x1a')](_0xabd4('0x13'),_0x60a203,_0xabd4('0x14'));_0xacbf1a(_0x3a35e5[_0xabd4('0x1b')]['message']);}})[_0xabd4('0x1c')](function(_0x5e8b13){logger[_0xabd4('0x17')](_0xabd4('0x13'),_0x60a203,_0x5e8b13);_0x3072cd(_0x5e8b13);});});}exports[_0xabd4('0x1d')]=function(_0x58b7eb){var _0x56a180=this;return new Promise(function(_0x5510bd,_0xdc4278){return db[_0xabd4('0x1e')][_0xabd4('0x1f')](_0x58b7eb[_0xabd4('0x20')],{'raw':_0x58b7eb[_0xabd4('0x21')]?_0x58b7eb[_0xabd4('0x21')][_0xabd4('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58b7eb[_0xabd4('0x21')]?_0x58b7eb[_0xabd4('0x21')][_0xabd4('0x23')]||null:null,'attributes':_0x58b7eb['options']?_0x58b7eb['options'][_0xabd4('0x24')]||null:null,'limit':_0x58b7eb[_0xabd4('0x21')]?_0x58b7eb[_0xabd4('0x21')][_0xabd4('0x25')]||null:null})['then'](function(_0x57aa52){logger[_0xabd4('0x1a')](_0xabd4('0x1d'),_0x58b7eb);logger[_0xabd4('0x15')](_0xabd4('0x1d'),_0x58b7eb,JSON[_0xabd4('0x16')](_0x57aa52));_0x5510bd(_0x57aa52);})['catch'](function(_0x2734f2){logger[_0xabd4('0x17')](_0xabd4('0x1d'),_0x2734f2[_0xabd4('0x19')],_0x58b7eb);_0xdc4278(_0x56a180['error'](0x1f4,_0x2734f2['message']));});});};exports[_0xabd4('0x26')]=function(_0x394b68){return new Promise(function(_0x18cc6b,_0x51344c){return db['MailInteraction']['find']({'where':_0x394b68[_0xabd4('0x21')]?_0x394b68[_0xabd4('0x21')][_0xabd4('0x23')]||null:null})[_0xabd4('0x12')](function(_0x2dcee1){if(_0x2dcee1){return _0x2dcee1[_0xabd4('0x27')](_0x394b68[_0xabd4('0x20')][_0xabd4('0x28')],_[_0xabd4('0x29')](_0x394b68['body'],[_0xabd4('0x28'),'id'])||{});}})['spread'](function(_0x554c1d){logger[_0xabd4('0x1a')](_0xabd4('0x2a'),_0x394b68);logger[_0xabd4('0x15')](_0xabd4('0x2a'),_0x394b68,JSON[_0xabd4('0x16')](_0x554c1d));_0x18cc6b(_0x554c1d);})[_0xabd4('0x1c')](function(_0x39fe97){logger['error'](_0xabd4('0x2a'),_0x39fe97[_0xabd4('0x19')],_0x394b68);_0x51344c(_this[_0xabd4('0x17')](0x1f4,_0x39fe97[_0xabd4('0x19')]));});});}; \ No newline at end of file +var _0x7b92=['spread','AddTags','lodash','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','error','message','MailInteraction,\x20%s,\x20%s','result','catch','MailInteraction','update','body','options','where','attributes','limit','stringify','AddTagsToMailInteraction','find','ids','omit'];(function(_0x40c142,_0x2eaa99){var _0x4f221d=function(_0x2256e5){while(--_0x2256e5){_0x40c142['push'](_0x40c142['shift']());}};_0x4f221d(++_0x2eaa99);}(_0x7b92,0x1e3));var _0x27b9=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0x7b92[_0x176d14];return _0x89522c;};'use strict';var _=require(_0x27b9('0x0'));var util=require('util');var moment=require(_0x27b9('0x1'));var BPromise=require(_0x27b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27b9('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x27b9('0x4'));var config=require(_0x27b9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x27b9('0x6')][_0x27b9('0x7')]({'port':0x232a});config['redis']=_[_0x27b9('0x8')](config[_0x27b9('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x27b9('0xa'))(new Redis(config[_0x27b9('0x9')]));require(_0x27b9('0xb'))[_0x27b9('0xc')](socket);function respondWithRpcPromise(_0x2e887a,_0x25516b,_0xd48777){return new BPromise(function(_0x5a2dc1,_0x393a22){return client[_0x27b9('0xd')](_0x2e887a,_0xd48777)[_0x27b9('0xe')](function(_0x36be32){logger[_0x27b9('0xf')]('MailInteraction,\x20%s,\x20%s',_0x25516b,_0x27b9('0x10'));logger[_0x27b9('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x25516b,_0x27b9('0x10'),JSON['stringify'](_0x36be32));if(_0x36be32['error']){if(_0x36be32[_0x27b9('0x12')]['code']===0x1f4){logger[_0x27b9('0x12')]('MailInteraction,\x20%s,\x20%s',_0x25516b,_0x36be32[_0x27b9('0x12')][_0x27b9('0x13')]);return _0x393a22(_0x36be32[_0x27b9('0x12')][_0x27b9('0x13')]);}logger['error'](_0x27b9('0x14'),_0x25516b,_0x36be32[_0x27b9('0x12')][_0x27b9('0x13')]);return _0x5a2dc1(_0x36be32[_0x27b9('0x12')]['message']);}else{logger['info'](_0x27b9('0x14'),_0x25516b,_0x27b9('0x10'));_0x5a2dc1(_0x36be32[_0x27b9('0x15')][_0x27b9('0x13')]);}})[_0x27b9('0x16')](function(_0xa46fa6){logger['error']('MailInteraction,\x20%s,\x20%s',_0x25516b,_0xa46fa6);_0x393a22(_0xa46fa6);});});}exports['UpdateMailInteraction']=function(_0x340a9f){var _0x461642=this;return new Promise(function(_0x3a0279,_0x443e4b){return db[_0x27b9('0x17')][_0x27b9('0x18')](_0x340a9f[_0x27b9('0x19')],{'raw':_0x340a9f[_0x27b9('0x1a')]?_0x340a9f[_0x27b9('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x340a9f[_0x27b9('0x1a')]?_0x340a9f[_0x27b9('0x1a')][_0x27b9('0x1b')]||null:null,'attributes':_0x340a9f[_0x27b9('0x1a')]?_0x340a9f[_0x27b9('0x1a')][_0x27b9('0x1c')]||null:null,'limit':_0x340a9f[_0x27b9('0x1a')]?_0x340a9f[_0x27b9('0x1a')][_0x27b9('0x1d')]||null:null})['then'](function(_0x4a1b52){logger[_0x27b9('0xf')]('UpdateMailInteraction',_0x340a9f);logger[_0x27b9('0x11')]('UpdateMailInteraction',_0x340a9f,JSON[_0x27b9('0x1e')](_0x4a1b52));_0x3a0279(_0x4a1b52);})[_0x27b9('0x16')](function(_0x4d09f0){logger['error']('UpdateMailInteraction',_0x4d09f0[_0x27b9('0x13')],_0x340a9f);_0x443e4b(_0x461642[_0x27b9('0x12')](0x1f4,_0x4d09f0[_0x27b9('0x13')]));});});};exports[_0x27b9('0x1f')]=function(_0x46d63f){return new Promise(function(_0x1fb2b,_0x36ae8b){return db[_0x27b9('0x17')][_0x27b9('0x20')]({'where':_0x46d63f[_0x27b9('0x1a')]?_0x46d63f[_0x27b9('0x1a')][_0x27b9('0x1b')]||null:null})[_0x27b9('0xe')](function(_0x29da77){if(_0x29da77){return _0x29da77['addTags'](_0x46d63f[_0x27b9('0x19')][_0x27b9('0x21')],_[_0x27b9('0x22')](_0x46d63f[_0x27b9('0x19')],[_0x27b9('0x21'),'id'])||{});}})[_0x27b9('0x23')](function(_0x43cc26){logger[_0x27b9('0xf')](_0x27b9('0x24'),_0x46d63f);logger[_0x27b9('0x11')](_0x27b9('0x24'),_0x46d63f,JSON['stringify'](_0x43cc26));_0x1fb2b(_0x43cc26);})[_0x27b9('0x16')](function(_0x4c08f7){logger[_0x27b9('0x12')]('AddTags',_0x4c08f7[_0x27b9('0x13')],_0x46d63f);_0x36ae8b(_this[_0x27b9('0x12')](0x1f4,_0x4c08f7['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index fc11479..3535c94 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 _0x0680=['mailInteraction:','./mailInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x3b0fc7,_0x1e2344){var _0x5c0c47=function(_0x2dee64){while(--_0x2dee64){_0x3b0fc7['push'](_0x3b0fc7['shift']());}};_0x5c0c47(++_0x1e2344);}(_0x0680,0x129));var _0x0068=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0680[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0x0068('0x0'));var events=['save',_0x0068('0x1'),_0x0068('0x2')];function createListener(_0x3601c2,_0x2f5d04){return function(_0x53e935){_0x2f5d04[_0x0068('0x3')](_0x3601c2,_0x53e935);};}function removeListener(_0xda0ed7,_0x33c13d){return function(){MailInteractionEvents[_0x0068('0x4')](_0xda0ed7,_0x33c13d);};}exports[_0x0068('0x5')]=function(_0x2ed3bf){for(var _0x2f8374=0x0,_0x352fab=events[_0x0068('0x6')];_0x2f8374<_0x352fab;_0x2f8374++){var _0x303b8b=events[_0x2f8374];var _0x4cd527=createListener(_0x0068('0x7')+_0x303b8b,_0x2ed3bf);MailInteractionEvents['on'](_0x303b8b,_0x4cd527);}}; \ No newline at end of file +var _0x1d7d=['length','mailInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x1d7d,0x14a));var _0xd1d7=function(_0xb70a50,_0x20a2e8){_0xb70a50=_0xb70a50-0x0;var _0x304483=_0x1d7d[_0xb70a50];return _0x304483;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xd1d7('0x0'),_0xd1d7('0x1'),_0xd1d7('0x2')];function createListener(_0x2d92b4,_0x1f0b38){return function(_0x4b168c){_0x1f0b38[_0xd1d7('0x3')](_0x2d92b4,_0x4b168c);};}function removeListener(_0x5b4761,_0x882856){return function(){MailInteractionEvents[_0xd1d7('0x4')](_0x5b4761,_0x882856);};}exports[_0xd1d7('0x5')]=function(_0x50c807){for(var _0x3d261a=0x0,_0x27f750=events[_0xd1d7('0x6')];_0x3d261a<_0x27f750;_0x3d261a++){var _0x3638c5=events[_0x3d261a];var _0x39f429=createListener(_0xd1d7('0x7')+_0x3638c5,_0x50c807);MailInteractionEvents['on'](_0x3638c5,_0x39f429);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index da65633..bc0f575 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 _0xa195=['delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','show','/:id/download','download','post','mail','mailmessage:create','create','/:id','update','put','accept','/:id/reject','reject'];(function(_0x3e47c6,_0x4079ed){var _0x241832=function(_0x6edf25){while(--_0x6edf25){_0x3e47c6['push'](_0x3e47c6['shift']());}};_0x241832(++_0x4079ed);}(_0xa195,0x1b2));var _0x5a19=function(_0x10f586,_0x450bce){_0x10f586=_0x10f586-0x0;var _0x2eec3c=_0xa195[_0x10f586];return _0x2eec3c;};'use strict';var multer=require(_0x5a19('0x0'));var util=require(_0x5a19('0x1'));var path=require('path');var timeout=require(_0x5a19('0x2'));var express=require(_0x5a19('0x3'));var router=express['Router']();var fs_extra=require(_0x5a19('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5a19('0x5'));var config=require('../../config/environment');var controller=require(_0x5a19('0x6'));router[_0x5a19('0x7')]('/',auth['isAuthenticated'](),controller[_0x5a19('0x8')]);router[_0x5a19('0x7')](_0x5a19('0x9'),auth[_0x5a19('0xa')](),controller[_0x5a19('0xb')]);router[_0x5a19('0x7')]('/:id',auth[_0x5a19('0xa')](),controller[_0x5a19('0xc')]);router[_0x5a19('0x7')](_0x5a19('0xd'),auth[_0x5a19('0xa')](),controller[_0x5a19('0xe')]);router[_0x5a19('0xf')]('/',auth[_0x5a19('0xa')](),interaction['tracked'](_0x5a19('0x10'),_0x5a19('0x11')),controller[_0x5a19('0x12')]);router['put'](_0x5a19('0x13'),auth['isAuthenticated'](),controller[_0x5a19('0x14')]);router[_0x5a19('0x15')]('/:id/accept',auth[_0x5a19('0xa')](),controller[_0x5a19('0x16')]);router[_0x5a19('0x15')](_0x5a19('0x17'),auth['isAuthenticated'](),controller[_0x5a19('0x18')]);router[_0x5a19('0x19')](_0x5a19('0x13'),auth[_0x5a19('0xa')](),controller[_0x5a19('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xe26e=['update','/:id/accept','accept','destroy','exports','multer','path','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create','put'];(function(_0x291a50,_0x148e37){var _0x2c3510=function(_0x129dbb){while(--_0x129dbb){_0x291a50['push'](_0x291a50['shift']());}};_0x2c3510(++_0x148e37);}(_0xe26e,0x1e9));var _0xee26=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe26e[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xee26('0x0'));var util=require('util');var path=require(_0xee26('0x1'));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(_0xee26('0x2'));var config=require(_0xee26('0x3'));var controller=require(_0xee26('0x4'));router[_0xee26('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xee26('0x5')](_0xee26('0x6'),auth[_0xee26('0x7')](),controller[_0xee26('0x8')]);router[_0xee26('0x5')](_0xee26('0x9'),auth[_0xee26('0x7')](),controller[_0xee26('0xa')]);router[_0xee26('0x5')](_0xee26('0xb'),auth['isAuthenticated'](),controller[_0xee26('0xc')]);router[_0xee26('0xd')]('/',auth[_0xee26('0x7')](),interaction[_0xee26('0xe')]('mail',_0xee26('0xf')),controller['create']);router[_0xee26('0x10')]('/:id',auth[_0xee26('0x7')](),controller[_0xee26('0x11')]);router['put'](_0xee26('0x12'),auth[_0xee26('0x7')](),controller[_0xee26('0x13')]);router[_0xee26('0x10')]('/:id/reject',auth[_0xee26('0x7')](),controller['reject']);router['delete']('/:id',auth[_0xee26('0x7')](),controller[_0xee26('0x14')]);module[_0xee26('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 9ffa523..5eb916f 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 _0x97d0=['BOOLEAN','STRING','long','DATE','ENUM','Email','Chat','lodash','exports','TEXT','medium'];(function(_0x4b105e,_0x4aa1e8){var _0x3c545c=function(_0x3d291d){while(--_0x3d291d){_0x4b105e['push'](_0x4b105e['shift']());}};_0x3c545c(++_0x4aa1e8);}(_0x97d0,0x172));var _0x097d=function(_0x2b6609,_0x17cb80){_0x2b6609=_0x2b6609-0x0;var _0x4b1823=_0x97d0[_0x2b6609];return _0x4b1823;};'use strict';var Sequelize=require('sequelize');var _=require(_0x097d('0x0'));module[_0x097d('0x1')]={'body':{'type':Sequelize[_0x097d('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x097d('0x2')](_0x097d('0x3'))},'read':{'type':Sequelize[_0x097d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x097d('0x5')](0x1fe)},'from':{'type':Sequelize[_0x097d('0x5')]},'to':{'type':Sequelize[_0x097d('0x2')](_0x097d('0x6'))},'cc':{'type':Sequelize[_0x097d('0x2')](_0x097d('0x6'))},'bcc':{'type':Sequelize[_0x097d('0x2')](_0x097d('0x6'))},'subject':{'type':Sequelize[_0x097d('0x2')]},'sentAt':{'type':Sequelize[_0x097d('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x097d('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x097d('0x7')]},'originTo':{'type':Sequelize[_0x097d('0x2')](_0x097d('0x6'))},'originCc':{'type':Sequelize[_0x097d('0x2')]('long')},'originChannel':{'type':Sequelize[_0x097d('0x8')](_0x097d('0x9'),_0x097d('0xa')),'defaultValue':_0x097d('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0x2ad5=['sequelize','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat'];(function(_0x237edc,_0x239587){var _0x869659=function(_0x5a3f0c){while(--_0x5a3f0c){_0x237edc['push'](_0x237edc['shift']());}};_0x869659(++_0x239587);}(_0x2ad5,0x8f));var _0x52ad=function(_0xd1340d,_0x5451c1){_0xd1340d=_0xd1340d-0x0;var _0x2c33f9=_0x2ad5[_0xd1340d];return _0x2c33f9;};'use strict';var Sequelize=require(_0x52ad('0x0'));var _=require('lodash');module[_0x52ad('0x1')]={'body':{'type':Sequelize[_0x52ad('0x2')](_0x52ad('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x52ad('0x4'))},'read':{'type':Sequelize[_0x52ad('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x52ad('0x6')]('in','out'),'defaultValue':_0x52ad('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x52ad('0x8')]},'to':{'type':Sequelize[_0x52ad('0x2')](_0x52ad('0x3'))},'cc':{'type':Sequelize['TEXT'](_0x52ad('0x3'))},'bcc':{'type':Sequelize[_0x52ad('0x2')](_0x52ad('0x3'))},'subject':{'type':Sequelize[_0x52ad('0x2')]},'sentAt':{'type':Sequelize[_0x52ad('0x9')]},'attach':{'type':Sequelize[_0x52ad('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x52ad('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x52ad('0x9')]},'originTo':{'type':Sequelize[_0x52ad('0x2')](_0x52ad('0x3'))},'originCc':{'type':Sequelize[_0x52ad('0x2')]('long')},'originChannel':{'type':Sequelize[_0x52ad('0x6')](_0x52ad('0xb'),_0x52ad('0xc')),'defaultValue':_0x52ad('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 c9949f9..429b688 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 _0x156a=['count','set','Content-Range','update','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','show','includeAll','include','find','body','params','describe','create','direction','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','root','server/files/attachments','basename','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail','read','readAt','user','agent','UserId','MailInteraction','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','MailInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','event','reject','fromString','toString','join','files','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','type','readFileSync','build','writeFileSync','download','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','code','MailMessage,\x20%s,\x20%s','message','error','info','result','catch','status','json','offset','undefined','limit'];(function(_0x214c16,_0x5abbca){var _0x5a5bd9=function(_0x1f392d){while(--_0x1f392d){_0x214c16['push'](_0x214c16['shift']());}};_0x5a5bd9(++_0x5abbca);}(_0x156a,0x7e));var _0xa156=function(_0x457d3a,_0x1efbed){_0x457d3a=_0x457d3a-0x0;var _0x1af5e1=_0x156a[_0x457d3a];return _0x1af5e1;};'use strict';var emlformat=require(_0xa156('0x0'));var moment=require(_0xa156('0x1'));var BPromise=require(_0xa156('0x2'));var util=require(_0xa156('0x3'));var path=require(_0xa156('0x4'));var fs=require('fs');var _=require(_0xa156('0x5'));var Redis=require(_0xa156('0x6'));var htmlToText=require(_0xa156('0x7'));var qs=require(_0xa156('0x8'));var logger=require(_0xa156('0x9'))(_0xa156('0xa'));var interaction_log=require(_0xa156('0x9'))(_0xa156('0xb'));var config=require(_0xa156('0xc'));var db=require(_0xa156('0xd'))['db'];config['redis']=_[_0xa156('0xe')](config[_0xa156('0xf')],{'host':_0xa156('0x10'),'port':0x18eb});var socket=require(_0xa156('0x11'))(new Redis(config[_0xa156('0xf')]));var htmlEntities=require(_0xa156('0x12'));require(_0xa156('0x13'))[_0xa156('0x14')](socket);var jayson=require(_0xa156('0x15'));var client=jayson[_0xa156('0x16')][_0xa156('0x17')]({'port':0x232c});var client9003=jayson['client'][_0xa156('0x17')]({'port':0x232b});var client9002=jayson[_0xa156('0x16')][_0xa156('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3fe6f7,_0x2ebb3d,_0x13e2fe,_0x5d9d4a){return new BPromise(function(_0x5652e9,_0x44aaf8){var _0x4aba44=_0x5d9d4a||client;return _0x4aba44[_0xa156('0x18')](_0x3fe6f7,_0x13e2fe)[_0xa156('0x19')](function(_0x32150a){logger['info']('MailMessage,\x20%s,\x20%s',_0x2ebb3d,_0xa156('0x1a'));logger[_0xa156('0x1b')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2ebb3d,_0xa156('0x1a'),JSON['stringify'](_0x32150a));if(_0x32150a['error']){if(_0x32150a['error'][_0xa156('0x1c')]===0x1f4){logger['error'](_0xa156('0x1d'),_0x2ebb3d,_0x32150a['error'][_0xa156('0x1e')]);return _0x44aaf8(_0x32150a[_0xa156('0x1f')][_0xa156('0x1e')]);}logger[_0xa156('0x1f')](_0xa156('0x1d'),_0x2ebb3d,_0x32150a[_0xa156('0x1f')][_0xa156('0x1e')]);return _0x5652e9(_0x32150a[_0xa156('0x1f')][_0xa156('0x1e')]);}else{logger[_0xa156('0x20')](_0xa156('0x1d'),_0x2ebb3d,_0xa156('0x1a'));_0x5652e9(_0x32150a[_0xa156('0x21')][_0xa156('0x1e')]);}})[_0xa156('0x22')](function(_0x38086d){logger[_0xa156('0x1f')](_0xa156('0x1d'),_0x2ebb3d,_0x38086d);_0x44aaf8(_0x38086d);});});}function respondWithResult(_0x5b2405,_0x337000){_0x337000=_0x337000||0xc8;return function(_0x1b8dd2){if(_0x1b8dd2){return _0x5b2405[_0xa156('0x23')](_0x337000)[_0xa156('0x24')](_0x1b8dd2);}};}function respondWithFilteredResult(_0x22729c,_0x472ab6){return function(_0xf7777e){if(_0xf7777e){var _0x88a5a1=typeof _0x472ab6[_0xa156('0x25')]===_0xa156('0x26')&&typeof _0x472ab6[_0xa156('0x27')]===_0xa156('0x26');var _0x13ddfd=_0xf7777e[_0xa156('0x28')];var _0x4d705d=_0x88a5a1?0x0:_0x472ab6[_0xa156('0x25')];var _0x2aa5e3=_0x88a5a1?_0xf7777e[_0xa156('0x28')]:_0x472ab6[_0xa156('0x25')]+_0x472ab6[_0xa156('0x27')];var _0x12dd59;if(_0x2aa5e3>=_0x13ddfd){_0x2aa5e3=_0x13ddfd;_0x12dd59=0xc8;}else{_0x12dd59=0xce;}_0x22729c[_0xa156('0x23')](_0x12dd59);return _0x22729c[_0xa156('0x29')](_0xa156('0x2a'),_0x4d705d+'-'+_0x2aa5e3+'/'+_0x13ddfd)['json'](_0xf7777e);}return null;};}function saveUpdates(_0x16fec8){return function(_0x12900c){if(_0x12900c){return _0x12900c[_0xa156('0x2b')](_0x16fec8)['then'](function(_0x30ba8c){return _0x30ba8c;});}return null;};}function removeEntity(_0x1e363e){return function(_0x44362a){if(_0x44362a){return _0x44362a[_0xa156('0x2c')]()[_0xa156('0x19')](function(){_0x1e363e[_0xa156('0x23')](0xcc)[_0xa156('0x2d')]();});}};}function handleEntityNotFound(_0x52f22c){return function(_0x14604c){if(!_0x14604c){_0x52f22c['sendStatus'](0x194);}return _0x14604c;};}function handleError(_0x3cbf1b,_0x3385b8){_0x3385b8=_0x3385b8||0x1f4;return function(_0x40fc59){logger['error'](_0x40fc59[_0xa156('0x2e')]);if(_0x40fc59['name']){delete _0x40fc59[_0xa156('0x2f')];}_0x3cbf1b['status'](_0x3385b8)[_0xa156('0x30')](_0x40fc59);};}exports[_0xa156('0x31')]=function(_0x451e33,_0x2f2b57){var _0x7ed53b={},_0x3f2ec5={},_0x38c621={'count':0x0,'rows':[]};var _0x2b50f5=_[_0xa156('0x32')](db[_0xa156('0x33')][_0xa156('0x34')],function(_0x503a9e){return{'name':_0x503a9e[_0xa156('0x35')],'type':_0x503a9e['type'][_0xa156('0x36')]};});_0x3f2ec5[_0xa156('0x37')]=_[_0xa156('0x32')](_0x2b50f5,_0xa156('0x2f'));_0x3f2ec5[_0xa156('0x38')]=_[_0xa156('0x39')](_0x451e33[_0xa156('0x38')]);_0x3f2ec5[_0xa156('0x3a')]=_[_0xa156('0x3b')](_0x3f2ec5[_0xa156('0x37')],_0x3f2ec5[_0xa156('0x38')]);_0x7ed53b[_0xa156('0x3c')]=_[_0xa156('0x3b')](_0x3f2ec5[_0xa156('0x37')],qs[_0xa156('0x3d')](_0x451e33[_0xa156('0x38')][_0xa156('0x3d')]));_0x7ed53b[_0xa156('0x3c')]=_0x7ed53b[_0xa156('0x3c')][_0xa156('0x3e')]?_0x7ed53b['attributes']:_0x3f2ec5['model'];if(!_0x451e33[_0xa156('0x38')][_0xa156('0x3f')](_0xa156('0x40'))){_0x7ed53b[_0xa156('0x27')]=qs['limit'](_0x451e33[_0xa156('0x38')][_0xa156('0x27')]);_0x7ed53b[_0xa156('0x25')]=qs[_0xa156('0x25')](_0x451e33[_0xa156('0x38')]['offset']);}_0x7ed53b[_0xa156('0x41')]=qs[_0xa156('0x42')](_0x451e33[_0xa156('0x38')][_0xa156('0x42')]);_0x7ed53b[_0xa156('0x43')]=qs['filters'](_[_0xa156('0x44')](_0x451e33[_0xa156('0x38')],_0x3f2ec5[_0xa156('0x3a')]),_0x2b50f5);if(_0x451e33[_0xa156('0x38')][_0xa156('0x45')]){_0x7ed53b[_0xa156('0x43')]=_['merge'](_0x7ed53b[_0xa156('0x43')],{'$or':_[_0xa156('0x32')](_0x2b50f5,function(_0x49a5a4){if(_0x49a5a4['type']!==_0xa156('0x46')){var _0x5deda5={};_0x5deda5[_0x49a5a4[_0xa156('0x2f')]]={'$like':'%'+_0x451e33['query']['filter']+'%'};return _0x5deda5;}})});}_0x7ed53b=_[_0xa156('0x47')]({},_0x7ed53b,_0x451e33[_0xa156('0x48')]);var _0x44bdb3={'where':_0x7ed53b[_0xa156('0x43')]};return db['MailMessage'][_0xa156('0x28')](_0x44bdb3)[_0xa156('0x19')](function(_0x20f6e0){_0x38c621[_0xa156('0x28')]=_0x20f6e0;if(_0x451e33[_0xa156('0x38')]['includeAll']){_0x7ed53b['include']=[{'all':!![]}];}return db['MailMessage'][_0xa156('0x49')](_0x7ed53b);})[_0xa156('0x19')](function(_0xebf906){_0x38c621['rows']=_0xebf906;return _0x38c621;})[_0xa156('0x19')](respondWithFilteredResult(_0x2f2b57,_0x7ed53b))[_0xa156('0x22')](handleError(_0x2f2b57,null));};exports[_0xa156('0x4a')]=function(_0x37f34b,_0x11084c){var _0x10ae78={'raw':!![],'where':{'id':_0x37f34b['params']['id']}},_0x1112d2={};_0x1112d2[_0xa156('0x37')]=_[_0xa156('0x39')](db[_0xa156('0x33')]['rawAttributes']);_0x1112d2[_0xa156('0x38')]=_[_0xa156('0x39')](_0x37f34b[_0xa156('0x38')]);_0x1112d2[_0xa156('0x3a')]=_[_0xa156('0x3b')](_0x1112d2[_0xa156('0x37')],_0x1112d2['query']);_0x10ae78[_0xa156('0x3c')]=_[_0xa156('0x3b')](_0x1112d2['model'],qs[_0xa156('0x3d')](_0x37f34b[_0xa156('0x38')][_0xa156('0x3d')]));_0x10ae78[_0xa156('0x3c')]=_0x10ae78[_0xa156('0x3c')][_0xa156('0x3e')]?_0x10ae78[_0xa156('0x3c')]:_0x1112d2['model'];if(_0x37f34b[_0xa156('0x38')][_0xa156('0x4b')]){_0x10ae78[_0xa156('0x4c')]=[{'all':!![]}];}_0x10ae78=_[_0xa156('0x47')]({},_0x10ae78,_0x37f34b['options']);return db[_0xa156('0x33')][_0xa156('0x4d')](_0x10ae78)['then'](handleEntityNotFound(_0x11084c,null))['then'](respondWithResult(_0x11084c,null))[_0xa156('0x22')](handleError(_0x11084c,null));};exports[_0xa156('0x2b')]=function(_0x45af9d,_0x378704){if(_0x45af9d['body']['id']){delete _0x45af9d[_0xa156('0x4e')]['id'];}return db[_0xa156('0x33')]['find']({'where':{'id':_0x45af9d[_0xa156('0x4f')]['id']}})[_0xa156('0x19')](handleEntityNotFound(_0x378704,null))[_0xa156('0x19')](saveUpdates(_0x45af9d[_0xa156('0x4e')],null))['then'](respondWithResult(_0x378704,null))[_0xa156('0x22')](handleError(_0x378704,null));};exports[_0xa156('0x2c')]=function(_0x2bc834,_0x2a00c4){return db[_0xa156('0x33')][_0xa156('0x4d')]({'where':{'id':_0x2bc834[_0xa156('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2a00c4,null))[_0xa156('0x19')](removeEntity(_0x2a00c4,null))[_0xa156('0x22')](handleError(_0x2a00c4,null));};exports[_0xa156('0x50')]=function(_0x54e8fd,_0x56bd77){return db[_0xa156('0x33')]['describe']()[_0xa156('0x19')](respondWithResult(_0x56bd77,null))['catch'](handleError(_0x56bd77,null));};exports[_0xa156('0x51')]=function(_0x1c6975,_0x1d7171){return db['MailMessage'][_0xa156('0x51')](_0x1c6975[_0xa156('0x4e')])[_0xa156('0x19')](function(_0x56d679){if(_0x56d679){if(_0x56d679[_0xa156('0x52')]==='out'&&!_0x56d679['secret']){var _0x3e6658,_0x5756ab,_0x3bbbb5;if(_0x1c6975[_0xa156('0x4e')]['to']){_0x5756ab=_0x1c6975[_0xa156('0x4e')]['to'][_0xa156('0x53')](',')[0x0];}return db[_0xa156('0x54')][_0xa156('0x55')]({'where':{'id':_0x56d679[_0xa156('0x56')]},'include':[{'model':db[_0xa156('0x57')],'as':_0xa156('0x58'),'include':[{'model':db[_0xa156('0x59')],'as':_0xa156('0x5a'),'where':{'email':_0x5756ab},'limit':0x1,'order':[['updatedAt',_0xa156('0x5b')]]}]},{'model':db[_0xa156('0x5c')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa156('0x5d')],'as':_0xa156('0x5d'),'raw':!![]}]}]})['then'](function(_0x4a899a){_0x3e6658=_0x4a899a;if(!_0x3e6658||!_0x3e6658[_0xa156('0x5e')])return;var _0x416db5=_0x3e6658[_0xa156('0x5f')]();if(_0x1c6975[_0xa156('0x4e')][_0xa156('0x60')]&&_0x1c6975[_0xa156('0x4e')]['attachments'][_0xa156('0x3e')]){for(var _0x12b8f3=0x0;_0x12b8f3<_0x1c6975['body'][_0xa156('0x60')][_0xa156('0x3e')];_0x12b8f3+=0x1){_0x1c6975[_0xa156('0x4e')][_0xa156('0x60')][_0x12b8f3]={'filename':_0x1c6975[_0xa156('0x4e')][_0xa156('0x60')][_0x12b8f3]['name'],'path':path['join'](config[_0xa156('0x61')],_0xa156('0x62'),_0x1c6975[_0xa156('0x4e')][_0xa156('0x60')][_0x12b8f3][_0xa156('0x63')])};}}_0x3bbbb5={'account':_0x416db5,'message':_0x1c6975[_0xa156('0x4e')]};return;})[_0xa156('0x19')](function(){if(_0x3e6658[_0xa156('0x58')]){if(_0x3e6658['List'][_0xa156('0x5a')]['length']){return _0x3e6658[_0xa156('0x58')][_0xa156('0x5a')][0x0];}else{return db[_0xa156('0x59')][_0xa156('0x51')](_['defaults'](_0x1c6975[_0xa156('0x4e')],{'firstName':_0x1c6975[_0xa156('0x4e')]['to'],'email':_0x1c6975[_0xa156('0x4e')]['to'],'phone':_0x1c6975['body']['to'],'ListId':_0x3e6658['ListId']}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x3bbbb5){return respondWithRpcPromise(_0xa156('0x64'),_0xa156('0x65'),_0x3bbbb5,client9003)['then'](function(_0x6e394d){return _0x56d679[_0xa156('0x2b')]({'read':!![],'messageId':_0x6e394d['messageId'],'sentAt':moment()[_0xa156('0x66')](_0xa156('0x67'))});})[_0xa156('0x22')](function(_0x34d503){logger[_0xa156('0x1f')]('%s',JSON[_0xa156('0x68')](_0x34d503));return _0x56d679;});}return _0x56d679;});}return _0x56d679;}})['then'](respondWithResult(_0x1d7171,0xc9))[_0xa156('0x22')](handleError(_0x1d7171,null));};exports['accept']=function(_0x2f0180,_0x4f404b){var _0x52e7a1={'agent':{},'channel':_0xa156('0x69')};if(_0x2f0180[_0xa156('0x4e')]['id']){delete _0x2f0180[_0xa156('0x4e')]['id'];}_0x2f0180[_0xa156('0x4e')][_0xa156('0x6a')]=!![];_0x2f0180['body'][_0xa156('0x6b')]=moment()[_0xa156('0x66')](_0xa156('0x67'));_0x2f0180[_0xa156('0x4e')]['UserId']=_0x2f0180[_0xa156('0x4e')]['UserId']||_0x2f0180[_0xa156('0x6c')]['id'];_0x52e7a1[_0xa156('0x6d')]['id']=_0x2f0180[_0xa156('0x4e')][_0xa156('0x6e')];return db[_0xa156('0x33')]['find']({'where':{'id':_0x2f0180['params']['id'],'UserId':null}})[_0xa156('0x19')](handleEntityNotFound(_0x4f404b,null))[_0xa156('0x19')](saveUpdates(_0x2f0180[_0xa156('0x4e')],null))[_0xa156('0x19')](function(_0x92009b){if(_0x92009b){_0x52e7a1[_0xa156('0x1e')]=_0x92009b['get']({'plain':!![]});return db[_0xa156('0x6f')][_0xa156('0x4d')]({'where':{'id':_0x92009b['MailInteractionId']}});}return null;})[_0xa156('0x19')](handleEntityNotFound(_0x4f404b,null))[_0xa156('0x19')](function(_0x42ba95){if(_0x42ba95){return _0x42ba95['update']({'UserId':_0x2f0180['body'][_0xa156('0x6e')],'read1stAt':_[_0xa156('0x70')](_0x42ba95[_0xa156('0x71')])?moment()['format'](_0xa156('0x67')):undefined});}return null;})[_0xa156('0x19')](function(_0x20fbfb){if(_0x20fbfb){_0x52e7a1[_0xa156('0x72')]=_0x20fbfb[_0xa156('0x73')]({'plain':!![]});interaction_log[_0xa156('0x20')](_0xa156('0x74'),_0x2f0180[_0xa156('0x6c')]['id'],_0x2f0180[_0xa156('0x6c')][_0xa156('0x2f')],_0x2f0180['user'][_0xa156('0x75')],_0x52e7a1['interaction']['id'],_0x2f0180[_0xa156('0x4e')]?JSON[_0xa156('0x68')](_0x2f0180['body']):_0xa156('0x76'));return respondWithRpcPromise(_0xa156('0x77'),_0xa156('0x78'),_0x52e7a1);}return null;})['then'](function(_0x481a25){var _0x5a0f6a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x481a25[_0xa156('0x1e')][_0xa156('0x79')];return db[_0xa156('0x7a')][_0xa156('0x38')](_0x5a0f6a,{'type':db[_0xa156('0x7b')][_0xa156('0x7c')][_0xa156('0x7d')],'raw':!![]})[_0xa156('0x19')](function(_0x176d40){return _0x176d40;});})[_0xa156('0x19')](function(_0x2b9f07){if(_0x2b9f07){_0x52e7a1[_0xa156('0x1e')][_0xa156('0x7e')]=_0x2b9f07[0x0];if(!_0x2f0180[_0xa156('0x4e')]['UserId'])return;return db[_0xa156('0x7f')]['find']({'where':{'id':_0x2f0180[_0xa156('0x4e')][_0xa156('0x6e')],'role':_0xa156('0x6d')},'attributes':['id',_0xa156('0x2f'),_0xa156('0x80'),_0xa156('0x81'),_0xa156('0x82')],'raw':!![]});}return null;})['then'](function(_0x4531de){if(!_0x4531de)return null;_0x52e7a1[_0xa156('0x1e')]['agent']=_0x4531de;return _0x52e7a1;})[_0xa156('0x19')](function(_0x48ee84){if(_0x48ee84){if(_0x2f0180[_0xa156('0x4e')][_0xa156('0x83')]){_0x52e7a1[_0xa156('0x1e')][_0xa156('0x84')]=util[_0xa156('0x66')](_0xa156('0x85'),_0x2f0180[_0xa156('0x6c')][_0xa156('0x2f')]);_0x52e7a1[_0xa156('0x1e')][_0xa156('0x86')]=_0x52e7a1[_0xa156('0x86')];_0x52e7a1[_0xa156('0x1e')][_0xa156('0x87')]=_0x52e7a1[_0xa156('0x86')];_0x52e7a1['message']['event']=_0xa156('0x88');_0x52e7a1[_0xa156('0x1e')][_0xa156('0x4e')]=htmlToText['fromString'](_0x52e7a1[_0xa156('0x1e')]['body']);return respondWithRpcPromise(_0xa156('0x89'),'EventManager',{'event':'acceptmessage','message':_0x52e7a1[_0xa156('0x1e')]},client9002)[_0xa156('0x19')](function(){return _0x52e7a1;});}return _0x52e7a1;}return null;})['then'](respondWithResult(_0x4f404b,null))[_0xa156('0x22')](handleError(_0x4f404b,null));};exports['reject']=function(_0x613a9,_0xb3e176){var _0x2b010c={'agent':{},'channel':'mail'};if(_0x613a9[_0xa156('0x4e')]['id']){delete _0x613a9[_0xa156('0x4e')]['id'];}_0x613a9[_0xa156('0x4e')][_0xa156('0x6e')]=_0x613a9['body'][_0xa156('0x6e')]||_0x613a9[_0xa156('0x6c')]['id'];_0x2b010c['agent']['id']=_0x613a9[_0xa156('0x4e')][_0xa156('0x6e')];return db[_0xa156('0x33')][_0xa156('0x4d')]({'where':{'id':_0x613a9['params']['id'],'UserId':null}})[_0xa156('0x19')](handleEntityNotFound(_0xb3e176,null))[_0xa156('0x19')](function(_0x2bcec3){if(_0x2bcec3){_0x2b010c[_0xa156('0x1e')]=_0x2bcec3['get']({'plain':!![]});return db[_0xa156('0x6f')][_0xa156('0x4d')]({'where':{'id':_0x2bcec3[_0xa156('0x8a')]}});}return null;})[_0xa156('0x19')](handleEntityNotFound(_0xb3e176,null))[_0xa156('0x19')](function(_0x2b009a){if(_0x2b009a){_0x2b010c[_0xa156('0x72')]=_0x2b009a[_0xa156('0x73')]({'plain':!![]});interaction_log[_0xa156('0x20')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x613a9[_0xa156('0x6c')]['id'],_0x613a9[_0xa156('0x6c')]['name'],_0x613a9[_0xa156('0x6c')][_0xa156('0x75')],_0x2b010c['interaction']['id'],_0x613a9[_0xa156('0x4e')]?JSON[_0xa156('0x68')](_0x613a9['body']):_0xa156('0x76'));return respondWithRpcPromise(_0xa156('0x8b'),_0xa156('0x8c'),_0x2b010c);}return null;})[_0xa156('0x19')](function(_0x303eb6){var _0x4adbbf=_0xa156('0x8d')+_0x303eb6[_0xa156('0x1e')][_0xa156('0x79')];return db[_0xa156('0x7a')]['query'](_0x4adbbf,{'type':db[_0xa156('0x7b')][_0xa156('0x7c')]['SELECT'],'raw':!![]})[_0xa156('0x19')](function(_0x28defb){return _0x28defb;});})[_0xa156('0x19')](function(_0x3bc163){if(_0x3bc163){_0x2b010c[_0xa156('0x1e')][_0xa156('0x7e')]=_0x3bc163[0x0];if(!_0x613a9[_0xa156('0x4e')][_0xa156('0x6e')])return;return db[_0xa156('0x7f')][_0xa156('0x4d')]({'where':{'id':_0x613a9[_0xa156('0x4e')][_0xa156('0x6e')],'role':_0xa156('0x6d')},'attributes':['id',_0xa156('0x2f'),_0xa156('0x80'),'email',_0xa156('0x82')],'raw':!![]});}return null;})[_0xa156('0x19')](function(_0x44d371){if(!_0x44d371)return null;_0x2b010c[_0xa156('0x1e')][_0xa156('0x6d')]=_0x44d371;return _0x2b010c;})['then'](function(_0x21cc5f){if(_0x21cc5f){_0x21cc5f['message'][_0xa156('0x84')]=util[_0xa156('0x66')](_0xa156('0x85'),_0x613a9['user'][_0xa156('0x2f')]);_0x21cc5f[_0xa156('0x1e')][_0xa156('0x86')]=_0x2b010c['channel'];_0x21cc5f[_0xa156('0x1e')][_0xa156('0x87')]=_0x2b010c[_0xa156('0x86')];_0x21cc5f[_0xa156('0x1e')][_0xa156('0x8e')]=_0xa156('0x8f');_0x21cc5f['message'][_0xa156('0x4e')]=htmlToText[_0xa156('0x90')](_0x2b010c[_0xa156('0x1e')][_0xa156('0x4e')]);respondWithRpcPromise(_0xa156('0x89'),_0xa156('0x89'),{'event':'rejectmessage','message':_0x21cc5f[_0xa156('0x1e')]},client9002);return _0x2b010c;}return null;})[_0xa156('0x19')](respondWithResult(_0xb3e176,null))[_0xa156('0x22')](handleError(_0xb3e176,null));};exports['download']=function(_0x4983a4,_0x1a0b0a){var _0x58eb9d=moment()['unix']()[_0xa156('0x91')]();var _0x1ecdbf=path[_0xa156('0x92')](config[_0xa156('0x61')],'server',_0xa156('0x93'),'tmp');var _0xa38084=path[_0xa156('0x92')](config[_0xa156('0x61')],_0xa156('0x94'),'files',_0xa156('0x60'));var _0x754c98=util[_0xa156('0x66')](_0xa156('0x95'),_0x58eb9d);return db['MailMessage'][_0xa156('0x4d')]({'where':{'id':_0x4983a4[_0xa156('0x4f')]['id']},'attributes':['id','body',_0xa156('0x96'),'to','cc',_0xa156('0x97'),_0xa156('0x98'),_0xa156('0x99')],'include':_0x4983a4[_0xa156('0x38')]['attachments']?[{'model':db[_0xa156('0x9a')],'as':_0xa156('0x9b')}]:undefined})[_0xa156('0x19')](handleEntityNotFound(_0x1a0b0a,null))[_0xa156('0x19')](function(_0x469b11){if(_0x469b11){var _0x3daaae=_0x469b11;var _0x417b7a={'from':_0x3daaae[_0xa156('0x96')],'to':_0x3daaae['to'],'subject':_0x3daaae[_0xa156('0x98')],'html':htmlEntities[_0xa156('0x9c')](_0x3daaae[_0xa156('0x4e')]),'headers':{'Date':moment(_0x3daaae[_0xa156('0x99')])[_0xa156('0x66')](_0xa156('0x9d'))},'attachments':[]};if(_0x469b11['cc']){_0x417b7a['headers']['Cc']=_0x469b11['cc'];}if(_0x469b11[_0xa156('0x97')]){_0x417b7a[_0xa156('0x9e')]['Bcc']=_0x469b11[_0xa156('0x97')];}return new BPromise(function(_0x3c8f42,_0x52ae37){if(_0x469b11[_0xa156('0x9b')]){for(var _0x4b2e0e=0x0;_0x4b2e0e<_0x469b11['Attachments'][_0xa156('0x3e')];_0x4b2e0e++){var _0x1fa305=_0x469b11[_0xa156('0x9b')][_0x4b2e0e];var _0x550913=path[_0xa156('0x92')](_0xa38084,_0x1fa305[_0xa156('0x63')]);if(fs[_0xa156('0x9f')](_0x550913)){_0x417b7a[_0xa156('0x60')][_0xa156('0xa0')]({'name':_0x1fa305[_0xa156('0x2f')],'contentType':_0x1fa305[_0xa156('0xa1')],'data':fs[_0xa156('0xa2')](_0x550913)});}}}emlformat[_0xa156('0xa3')](_0x417b7a,function(_0x29e07a,_0x48ec2e){if(_0x29e07a)return _0x52ae37(_0x29e07a);fs[_0xa156('0xa4')](path[_0xa156('0x92')](_0x1ecdbf,_0x754c98),_0x48ec2e);return _0x3c8f42(_0x48ec2e);});});}})['then'](function(_0x170bd4){if(_0x170bd4){return _0x1a0b0a[_0xa156('0xa5')](path[_0xa156('0x92')](_0x1ecdbf,_0x754c98),_0x754c98,function(_0x577ee1){if(!_0x577ee1)fs['unlinkSync'](path['join'](_0x1ecdbf,_0x754c98));});}})[_0xa156('0x22')](handleError(_0x1a0b0a,null));}; \ No newline at end of file +var _0x42ec=['interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','User','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','contact','fullname','rejectmessage','unix','toString','files','tmp','server','message-%s.eml','bcc','subject','createdAt','Attachment','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','writeFileSync','download','eml-format','moment','util','path','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','./mailMessage.socket','register','client','http','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','status','json','offset','count','set','then','end','stack','send','index','MailMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','show','params','include','update','body','find','destroy','describe','create','out','secret','MailAccount','findOne','MailAccountId','CmList','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','List','ListId','List\x20not\x20found','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42ec,0x15e));var _0xc42e=function(_0x5b30f5,_0x37d1ef){_0x5b30f5=_0x5b30f5-0x0;var _0x501542=_0x42ec[_0x5b30f5];return _0x501542;};'use strict';var emlformat=require(_0xc42e('0x0'));var moment=require(_0xc42e('0x1'));var BPromise=require('bluebird');var util=require(_0xc42e('0x2'));var path=require(_0xc42e('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xc42e('0x4'));var qs=require(_0xc42e('0x5'));var logger=require(_0xc42e('0x6'))('api');var interaction_log=require('../../config/logger')(_0xc42e('0x7'));var config=require(_0xc42e('0x8'));var db=require(_0xc42e('0x9'))['db'];config[_0xc42e('0xa')]=_[_0xc42e('0xb')](config[_0xc42e('0xa')],{'host':_0xc42e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0xc42e('0xd'));require(_0xc42e('0xe'))[_0xc42e('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc42e('0x10')][_0xc42e('0x11')]({'port':0x232c});var client9003=jayson['client'][_0xc42e('0x11')]({'port':0x232b});var client9002=jayson[_0xc42e('0x10')][_0xc42e('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x5c1927,_0x26a84f,_0x1ba74a,_0x2d0b2f){return new BPromise(function(_0x399e8b,_0xaf139d){var _0x4f096d=_0x2d0b2f||client;return _0x4f096d[_0xc42e('0x12')](_0x5c1927,_0x1ba74a)['then'](function(_0x1a94cd){logger[_0xc42e('0x13')]('MailMessage,\x20%s,\x20%s',_0x26a84f,_0xc42e('0x14'));logger[_0xc42e('0x15')](_0xc42e('0x16'),_0x26a84f,_0xc42e('0x14'),JSON[_0xc42e('0x17')](_0x1a94cd));if(_0x1a94cd['error']){if(_0x1a94cd[_0xc42e('0x18')][_0xc42e('0x19')]===0x1f4){logger[_0xc42e('0x18')]('MailMessage,\x20%s,\x20%s',_0x26a84f,_0x1a94cd[_0xc42e('0x18')][_0xc42e('0x1a')]);return _0xaf139d(_0x1a94cd['error']['message']);}logger[_0xc42e('0x18')](_0xc42e('0x1b'),_0x26a84f,_0x1a94cd[_0xc42e('0x18')]['message']);return _0x399e8b(_0x1a94cd[_0xc42e('0x18')][_0xc42e('0x1a')]);}else{logger['info'](_0xc42e('0x1b'),_0x26a84f,_0xc42e('0x14'));_0x399e8b(_0x1a94cd[_0xc42e('0x1c')][_0xc42e('0x1a')]);}})[_0xc42e('0x1d')](function(_0x2a2de2){logger['error']('MailMessage,\x20%s,\x20%s',_0x26a84f,_0x2a2de2);_0xaf139d(_0x2a2de2);});});}function respondWithResult(_0x285e26,_0x1fcfe7){_0x1fcfe7=_0x1fcfe7||0xc8;return function(_0x438d6a){if(_0x438d6a){return _0x285e26[_0xc42e('0x1e')](_0x1fcfe7)[_0xc42e('0x1f')](_0x438d6a);}};}function respondWithFilteredResult(_0x2dcd27,_0x4ec7b1){return function(_0x41a4cd){if(_0x41a4cd){var _0x46dde6=typeof _0x4ec7b1[_0xc42e('0x20')]==='undefined'&&typeof _0x4ec7b1['limit']==='undefined';var _0x234d58=_0x41a4cd[_0xc42e('0x21')];var _0xdc748a=_0x46dde6?0x0:_0x4ec7b1[_0xc42e('0x20')];var _0x1ef673=_0x46dde6?_0x41a4cd[_0xc42e('0x21')]:_0x4ec7b1[_0xc42e('0x20')]+_0x4ec7b1['limit'];var _0x5053c5;if(_0x1ef673>=_0x234d58){_0x1ef673=_0x234d58;_0x5053c5=0xc8;}else{_0x5053c5=0xce;}_0x2dcd27[_0xc42e('0x1e')](_0x5053c5);return _0x2dcd27[_0xc42e('0x22')]('Content-Range',_0xdc748a+'-'+_0x1ef673+'/'+_0x234d58)['json'](_0x41a4cd);}return null;};}function saveUpdates(_0x4aabf5){return function(_0x22abac){if(_0x22abac){return _0x22abac['update'](_0x4aabf5)['then'](function(_0x2eae7b){return _0x2eae7b;});}return null;};}function removeEntity(_0x139ce7){return function(_0x1f67f0){if(_0x1f67f0){return _0x1f67f0['destroy']()[_0xc42e('0x23')](function(){_0x139ce7[_0xc42e('0x1e')](0xcc)[_0xc42e('0x24')]();});}};}function handleEntityNotFound(_0x587767){return function(_0x348f83){if(!_0x348f83){_0x587767['sendStatus'](0x194);}return _0x348f83;};}function handleError(_0x5ad044,_0x1e482a){_0x1e482a=_0x1e482a||0x1f4;return function(_0x4381aa){logger[_0xc42e('0x18')](_0x4381aa[_0xc42e('0x25')]);if(_0x4381aa['name']){delete _0x4381aa['name'];}_0x5ad044['status'](_0x1e482a)[_0xc42e('0x26')](_0x4381aa);};}exports[_0xc42e('0x27')]=function(_0x15961f,_0x7a902e){var _0x24ce18={},_0x2f1a38={},_0x2a9d30={'count':0x0,'rows':[]};var _0x514546=_['map'](db[_0xc42e('0x28')][_0xc42e('0x29')],function(_0x1f70ec){return{'name':_0x1f70ec[_0xc42e('0x2a')],'type':_0x1f70ec[_0xc42e('0x2b')][_0xc42e('0x2c')]};});_0x2f1a38[_0xc42e('0x2d')]=_['map'](_0x514546,_0xc42e('0x2e'));_0x2f1a38[_0xc42e('0x2f')]=_[_0xc42e('0x30')](_0x15961f['query']);_0x2f1a38[_0xc42e('0x31')]=_[_0xc42e('0x32')](_0x2f1a38[_0xc42e('0x2d')],_0x2f1a38['query']);_0x24ce18['attributes']=_[_0xc42e('0x32')](_0x2f1a38[_0xc42e('0x2d')],qs['fields'](_0x15961f['query'][_0xc42e('0x33')]));_0x24ce18[_0xc42e('0x34')]=_0x24ce18[_0xc42e('0x34')][_0xc42e('0x35')]?_0x24ce18['attributes']:_0x2f1a38[_0xc42e('0x2d')];if(!_0x15961f[_0xc42e('0x2f')][_0xc42e('0x36')](_0xc42e('0x37'))){_0x24ce18['limit']=qs[_0xc42e('0x38')](_0x15961f['query']['limit']);_0x24ce18[_0xc42e('0x20')]=qs[_0xc42e('0x20')](_0x15961f[_0xc42e('0x2f')][_0xc42e('0x20')]);}_0x24ce18[_0xc42e('0x39')]=qs[_0xc42e('0x3a')](_0x15961f[_0xc42e('0x2f')][_0xc42e('0x3a')]);_0x24ce18[_0xc42e('0x3b')]=qs['filters'](_[_0xc42e('0x3c')](_0x15961f[_0xc42e('0x2f')],_0x2f1a38[_0xc42e('0x31')]),_0x514546);if(_0x15961f['query'][_0xc42e('0x3d')]){_0x24ce18[_0xc42e('0x3b')]=_[_0xc42e('0x3e')](_0x24ce18[_0xc42e('0x3b')],{'$or':_[_0xc42e('0x3f')](_0x514546,function(_0xd2ceb2){if(_0xd2ceb2[_0xc42e('0x2b')]!==_0xc42e('0x40')){var _0xa6356={};_0xa6356[_0xd2ceb2[_0xc42e('0x2e')]]={'$like':'%'+_0x15961f[_0xc42e('0x2f')][_0xc42e('0x3d')]+'%'};return _0xa6356;}})});}_0x24ce18=_['merge']({},_0x24ce18,_0x15961f[_0xc42e('0x41')]);var _0xbf306e={'where':_0x24ce18[_0xc42e('0x3b')]};return db['MailMessage'][_0xc42e('0x21')](_0xbf306e)['then'](function(_0x18a4f4){_0x2a9d30[_0xc42e('0x21')]=_0x18a4f4;if(_0x15961f[_0xc42e('0x2f')][_0xc42e('0x42')]){_0x24ce18['include']=[{'all':!![]}];}return db[_0xc42e('0x28')]['findAll'](_0x24ce18);})[_0xc42e('0x23')](function(_0x55dfbc){_0x2a9d30['rows']=_0x55dfbc;return _0x2a9d30;})[_0xc42e('0x23')](respondWithFilteredResult(_0x7a902e,_0x24ce18))['catch'](handleError(_0x7a902e,null));};exports[_0xc42e('0x43')]=function(_0x3d1ee1,_0x27e5f5){var _0x48dfc7={'raw':!![],'where':{'id':_0x3d1ee1[_0xc42e('0x44')]['id']}},_0xb0a66a={};_0xb0a66a[_0xc42e('0x2d')]=_[_0xc42e('0x30')](db[_0xc42e('0x28')][_0xc42e('0x29')]);_0xb0a66a[_0xc42e('0x2f')]=_[_0xc42e('0x30')](_0x3d1ee1[_0xc42e('0x2f')]);_0xb0a66a[_0xc42e('0x31')]=_[_0xc42e('0x32')](_0xb0a66a[_0xc42e('0x2d')],_0xb0a66a[_0xc42e('0x2f')]);_0x48dfc7[_0xc42e('0x34')]=_[_0xc42e('0x32')](_0xb0a66a[_0xc42e('0x2d')],qs[_0xc42e('0x33')](_0x3d1ee1[_0xc42e('0x2f')][_0xc42e('0x33')]));_0x48dfc7[_0xc42e('0x34')]=_0x48dfc7[_0xc42e('0x34')]['length']?_0x48dfc7[_0xc42e('0x34')]:_0xb0a66a[_0xc42e('0x2d')];if(_0x3d1ee1[_0xc42e('0x2f')][_0xc42e('0x42')]){_0x48dfc7[_0xc42e('0x45')]=[{'all':!![]}];}_0x48dfc7=_[_0xc42e('0x3e')]({},_0x48dfc7,_0x3d1ee1[_0xc42e('0x41')]);return db[_0xc42e('0x28')]['find'](_0x48dfc7)[_0xc42e('0x23')](handleEntityNotFound(_0x27e5f5,null))[_0xc42e('0x23')](respondWithResult(_0x27e5f5,null))['catch'](handleError(_0x27e5f5,null));};exports[_0xc42e('0x46')]=function(_0x2601d4,_0x225cac){if(_0x2601d4[_0xc42e('0x47')]['id']){delete _0x2601d4['body']['id'];}return db['MailMessage'][_0xc42e('0x48')]({'where':{'id':_0x2601d4[_0xc42e('0x44')]['id']}})[_0xc42e('0x23')](handleEntityNotFound(_0x225cac,null))[_0xc42e('0x23')](saveUpdates(_0x2601d4[_0xc42e('0x47')],null))[_0xc42e('0x23')](respondWithResult(_0x225cac,null))['catch'](handleError(_0x225cac,null));};exports[_0xc42e('0x49')]=function(_0x28dd2a,_0x2cf623){return db['MailMessage'][_0xc42e('0x48')]({'where':{'id':_0x28dd2a[_0xc42e('0x44')]['id']}})[_0xc42e('0x23')](handleEntityNotFound(_0x2cf623,null))[_0xc42e('0x23')](removeEntity(_0x2cf623,null))[_0xc42e('0x1d')](handleError(_0x2cf623,null));};exports[_0xc42e('0x4a')]=function(_0x1c859e,_0x5c4015){return db[_0xc42e('0x28')][_0xc42e('0x4a')]()['then'](respondWithResult(_0x5c4015,null))[_0xc42e('0x1d')](handleError(_0x5c4015,null));};exports[_0xc42e('0x4b')]=function(_0x406c8e,_0x30855a){return db[_0xc42e('0x28')][_0xc42e('0x4b')](_0x406c8e[_0xc42e('0x47')])[_0xc42e('0x23')](function(_0x4f14fc){if(_0x4f14fc){if(_0x4f14fc['direction']===_0xc42e('0x4c')&&!_0x4f14fc[_0xc42e('0x4d')]){var _0x4430a4,_0xa72456,_0x535a25;if(_0x406c8e[_0xc42e('0x47')]['to']){_0xa72456=_0x406c8e['body']['to']['split'](',')[0x0];}return db[_0xc42e('0x4e')][_0xc42e('0x4f')]({'where':{'id':_0x4f14fc[_0xc42e('0x50')]},'include':[{'model':db[_0xc42e('0x51')],'as':'List','include':[{'model':db['CmContact'],'as':_0xc42e('0x52'),'where':{'email':_0xa72456},'limit':0x1,'order':[[_0xc42e('0x53'),_0xc42e('0x54')]]}]},{'model':db[_0xc42e('0x55')],'as':_0xc42e('0x56'),'raw':!![],'include':[{'model':db[_0xc42e('0x57')],'as':_0xc42e('0x57'),'raw':!![]}]}]})[_0xc42e('0x23')](function(_0x2403b4){_0x4430a4=_0x2403b4;if(!_0x4430a4||!_0x4430a4[_0xc42e('0x56')])return;var _0x4b9aa5=_0x4430a4[_0xc42e('0x58')]();if(_0x406c8e[_0xc42e('0x47')][_0xc42e('0x59')]&&_0x406c8e[_0xc42e('0x47')][_0xc42e('0x59')]['length']){for(var _0xb1e758=0x0;_0xb1e758<_0x406c8e[_0xc42e('0x47')][_0xc42e('0x59')][_0xc42e('0x35')];_0xb1e758+=0x1){_0x406c8e[_0xc42e('0x47')]['attachments'][_0xb1e758]={'filename':_0x406c8e['body'][_0xc42e('0x59')][_0xb1e758][_0xc42e('0x2e')],'path':path[_0xc42e('0x5a')](config[_0xc42e('0x5b')],_0xc42e('0x5c'),_0x406c8e[_0xc42e('0x47')][_0xc42e('0x59')][_0xb1e758]['basename'])};}}_0x535a25={'account':_0x4b9aa5,'message':_0x406c8e[_0xc42e('0x47')]};return;})[_0xc42e('0x23')](function(){if(_0x4430a4[_0xc42e('0x5d')]){if(_0x4430a4['List']['Contacts'][_0xc42e('0x35')]){return _0x4430a4[_0xc42e('0x5d')]['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0xc42e('0xb')](_0x406c8e[_0xc42e('0x47')],{'firstName':_0x406c8e['body']['to'],'email':_0x406c8e[_0xc42e('0x47')]['to'],'phone':_0x406c8e[_0xc42e('0x47')]['to'],'ListId':_0x4430a4[_0xc42e('0x5e')]}));}}else{throw new Error(_0xc42e('0x5f'));}})[_0xc42e('0x23')](function(){if(_0x535a25){return respondWithRpcPromise('SendMail','sendMail',_0x535a25,client9003)[_0xc42e('0x23')](function(_0x273233){return _0x4f14fc[_0xc42e('0x46')]({'read':!![],'messageId':_0x273233['messageId'],'sentAt':moment()[_0xc42e('0x60')](_0xc42e('0x61'))});})[_0xc42e('0x1d')](function(_0x3bf0b9){logger[_0xc42e('0x18')]('%s',JSON[_0xc42e('0x17')](_0x3bf0b9));return _0x4f14fc;});}return _0x4f14fc;});}return _0x4f14fc;}})[_0xc42e('0x23')](respondWithResult(_0x30855a,0xc9))[_0xc42e('0x1d')](handleError(_0x30855a,null));};exports[_0xc42e('0x62')]=function(_0x4940d2,_0x5bf241){var _0x26fbe7={'agent':{},'channel':_0xc42e('0x63')};if(_0x4940d2[_0xc42e('0x47')]['id']){delete _0x4940d2['body']['id'];}_0x4940d2['body'][_0xc42e('0x64')]=!![];_0x4940d2['body'][_0xc42e('0x65')]=moment()[_0xc42e('0x60')](_0xc42e('0x61'));_0x4940d2['body'][_0xc42e('0x66')]=_0x4940d2[_0xc42e('0x47')]['UserId']||_0x4940d2[_0xc42e('0x67')]['id'];_0x26fbe7[_0xc42e('0x68')]['id']=_0x4940d2['body'][_0xc42e('0x66')];return db['MailMessage'][_0xc42e('0x48')]({'where':{'id':_0x4940d2[_0xc42e('0x44')]['id'],'UserId':null}})[_0xc42e('0x23')](handleEntityNotFound(_0x5bf241,null))[_0xc42e('0x23')](saveUpdates(_0x4940d2[_0xc42e('0x47')],null))[_0xc42e('0x23')](function(_0x4d96a5){if(_0x4d96a5){_0x26fbe7[_0xc42e('0x1a')]=_0x4d96a5[_0xc42e('0x69')]({'plain':!![]});return db[_0xc42e('0x6a')][_0xc42e('0x48')]({'where':{'id':_0x4d96a5[_0xc42e('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x5bf241,null))[_0xc42e('0x23')](function(_0x14bda0){if(_0x14bda0){return _0x14bda0['update']({'UserId':_0x4940d2[_0xc42e('0x47')][_0xc42e('0x66')],'read1stAt':_['isNil'](_0x14bda0['read1stAt'])?moment()[_0xc42e('0x60')](_0xc42e('0x61')):undefined});}return null;})[_0xc42e('0x23')](function(_0x135d79){if(_0x135d79){_0x26fbe7['interaction']=_0x135d79['get']({'plain':!![]});interaction_log[_0xc42e('0x13')](_0xc42e('0x6c'),_0x4940d2[_0xc42e('0x67')]['id'],_0x4940d2[_0xc42e('0x67')][_0xc42e('0x2e')],_0x4940d2[_0xc42e('0x67')]['role'],_0x26fbe7[_0xc42e('0x6d')]['id'],_0x4940d2['body']?JSON[_0xc42e('0x17')](_0x4940d2['body']):_0xc42e('0x6e'));return respondWithRpcPromise(_0xc42e('0x6f'),_0xc42e('0x70'),_0x26fbe7);}return null;})[_0xc42e('0x23')](function(_0xf1c01){var _0xc390f9=_0xc42e('0x71')+_0xf1c01[_0xc42e('0x1a')][_0xc42e('0x72')];return db['sequelize']['query'](_0xc390f9,{'type':db[_0xc42e('0x73')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x24355f){return _0x24355f;});})[_0xc42e('0x23')](function(_0x5c3186){if(_0x5c3186){_0x26fbe7[_0xc42e('0x1a')]['contact']=_0x5c3186[0x0];if(!_0x4940d2[_0xc42e('0x47')][_0xc42e('0x66')])return;return db[_0xc42e('0x74')][_0xc42e('0x48')]({'where':{'id':_0x4940d2[_0xc42e('0x47')][_0xc42e('0x66')],'role':_0xc42e('0x68')},'attributes':['id',_0xc42e('0x2e'),'fullname',_0xc42e('0x75'),_0xc42e('0x76')],'raw':!![]});}return null;})[_0xc42e('0x23')](function(_0x25a1da){if(!_0x25a1da)return null;_0x26fbe7[_0xc42e('0x1a')]['agent']=_0x25a1da;return _0x26fbe7;})[_0xc42e('0x23')](function(_0x20a1eb){if(_0x20a1eb){if(_0x4940d2[_0xc42e('0x47')][_0xc42e('0x77')]){_0x26fbe7[_0xc42e('0x1a')][_0xc42e('0x78')]=util['format']('SIP/%s',_0x4940d2['user'][_0xc42e('0x2e')]);_0x26fbe7[_0xc42e('0x1a')][_0xc42e('0x79')]=_0x26fbe7['channel'];_0x26fbe7[_0xc42e('0x1a')][_0xc42e('0x7a')]=_0x26fbe7[_0xc42e('0x79')];_0x26fbe7[_0xc42e('0x1a')][_0xc42e('0x7b')]=_0xc42e('0x62');_0x26fbe7[_0xc42e('0x1a')][_0xc42e('0x47')]=htmlToText[_0xc42e('0x7c')](_0x26fbe7[_0xc42e('0x1a')]['body']);return respondWithRpcPromise('EventManager',_0xc42e('0x7d'),{'event':_0xc42e('0x7e'),'message':_0x26fbe7['message']},client9002)['then'](function(){return _0x26fbe7;});}return _0x26fbe7;}return null;})['then'](respondWithResult(_0x5bf241,null))[_0xc42e('0x1d')](handleError(_0x5bf241,null));};exports[_0xc42e('0x7f')]=function(_0x145df5,_0x35ac10){var _0x48779c={'agent':{},'channel':_0xc42e('0x63')};if(_0x145df5[_0xc42e('0x47')]['id']){delete _0x145df5[_0xc42e('0x47')]['id'];}_0x145df5[_0xc42e('0x47')][_0xc42e('0x66')]=_0x145df5['body'][_0xc42e('0x66')]||_0x145df5['user']['id'];_0x48779c[_0xc42e('0x68')]['id']=_0x145df5[_0xc42e('0x47')][_0xc42e('0x66')];return db[_0xc42e('0x28')]['find']({'where':{'id':_0x145df5[_0xc42e('0x44')]['id'],'UserId':null}})[_0xc42e('0x23')](handleEntityNotFound(_0x35ac10,null))['then'](function(_0x290853){if(_0x290853){_0x48779c[_0xc42e('0x1a')]=_0x290853[_0xc42e('0x69')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x290853['MailInteractionId']}});}return null;})[_0xc42e('0x23')](handleEntityNotFound(_0x35ac10,null))[_0xc42e('0x23')](function(_0x149f19){if(_0x149f19){_0x48779c[_0xc42e('0x6d')]=_0x149f19[_0xc42e('0x69')]({'plain':!![]});interaction_log[_0xc42e('0x13')](_0xc42e('0x80'),_0x145df5['user']['id'],_0x145df5[_0xc42e('0x67')][_0xc42e('0x2e')],_0x145df5[_0xc42e('0x67')]['role'],_0x48779c['interaction']['id'],_0x145df5['body']?JSON[_0xc42e('0x17')](_0x145df5[_0xc42e('0x47')]):_0xc42e('0x6e'));return respondWithRpcPromise(_0xc42e('0x81'),'rejectMessage',_0x48779c);}return null;})[_0xc42e('0x23')](function(_0x351fef){var _0x4dd02b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x351fef[_0xc42e('0x1a')]['ContactId'];return db['sequelize']['query'](_0x4dd02b,{'type':db[_0xc42e('0x73')][_0xc42e('0x82')]['SELECT'],'raw':!![]})[_0xc42e('0x23')](function(_0x4d8f5b){return _0x4d8f5b;});})[_0xc42e('0x23')](function(_0x1cb3f8){if(_0x1cb3f8){_0x48779c[_0xc42e('0x1a')][_0xc42e('0x83')]=_0x1cb3f8[0x0];if(!_0x145df5[_0xc42e('0x47')][_0xc42e('0x66')])return;return db[_0xc42e('0x74')][_0xc42e('0x48')]({'where':{'id':_0x145df5[_0xc42e('0x47')]['UserId'],'role':_0xc42e('0x68')},'attributes':['id','name',_0xc42e('0x84'),_0xc42e('0x75'),'internal'],'raw':!![]});}return null;})[_0xc42e('0x23')](function(_0x5dc75e){if(!_0x5dc75e)return null;_0x48779c[_0xc42e('0x1a')]['agent']=_0x5dc75e;return _0x48779c;})[_0xc42e('0x23')](function(_0x3f1f9f){if(_0x3f1f9f){_0x3f1f9f[_0xc42e('0x1a')][_0xc42e('0x78')]=util[_0xc42e('0x60')]('SIP/%s',_0x145df5[_0xc42e('0x67')]['name']);_0x3f1f9f[_0xc42e('0x1a')][_0xc42e('0x79')]=_0x48779c[_0xc42e('0x79')];_0x3f1f9f[_0xc42e('0x1a')][_0xc42e('0x7a')]=_0x48779c[_0xc42e('0x79')];_0x3f1f9f[_0xc42e('0x1a')][_0xc42e('0x7b')]=_0xc42e('0x7f');_0x3f1f9f['message']['body']=htmlToText[_0xc42e('0x7c')](_0x48779c[_0xc42e('0x1a')][_0xc42e('0x47')]);respondWithRpcPromise(_0xc42e('0x7d'),_0xc42e('0x7d'),{'event':_0xc42e('0x85'),'message':_0x3f1f9f[_0xc42e('0x1a')]},client9002);return _0x48779c;}return null;})[_0xc42e('0x23')](respondWithResult(_0x35ac10,null))[_0xc42e('0x1d')](handleError(_0x35ac10,null));};exports['download']=function(_0x236a48,_0x2e0ee2){var _0x51f321=moment()[_0xc42e('0x86')]()[_0xc42e('0x87')]();var _0x581030=path[_0xc42e('0x5a')](config[_0xc42e('0x5b')],'server',_0xc42e('0x88'),_0xc42e('0x89'));var _0x5f0f45=path[_0xc42e('0x5a')](config[_0xc42e('0x5b')],_0xc42e('0x8a'),_0xc42e('0x88'),_0xc42e('0x59'));var _0x489d43=util[_0xc42e('0x60')](_0xc42e('0x8b'),_0x51f321);return db[_0xc42e('0x28')][_0xc42e('0x48')]({'where':{'id':_0x236a48[_0xc42e('0x44')]['id']},'attributes':['id',_0xc42e('0x47'),'from','to','cc',_0xc42e('0x8c'),_0xc42e('0x8d'),_0xc42e('0x8e')],'include':_0x236a48['query']['attachments']?[{'model':db[_0xc42e('0x8f')],'as':'Attachments'}]:undefined})[_0xc42e('0x23')](handleEntityNotFound(_0x2e0ee2,null))['then'](function(_0x176bea){if(_0x176bea){var _0xa13c33=_0x176bea;var _0x5d428d={'from':_0xa13c33[_0xc42e('0x90')],'to':_0xa13c33['to'],'subject':_0xa13c33[_0xc42e('0x8d')],'html':htmlEntities['decode'](_0xa13c33[_0xc42e('0x47')]),'headers':{'Date':moment(_0xa13c33[_0xc42e('0x8e')])[_0xc42e('0x60')](_0xc42e('0x91'))},'attachments':[]};if(_0x176bea['cc']){_0x5d428d[_0xc42e('0x92')]['Cc']=_0x176bea['cc'];}if(_0x176bea[_0xc42e('0x8c')]){_0x5d428d[_0xc42e('0x92')][_0xc42e('0x93')]=_0x176bea[_0xc42e('0x8c')];}return new BPromise(function(_0x462fbd,_0x5ca042){if(_0x176bea[_0xc42e('0x94')]){for(var _0xe1b529=0x0;_0xe1b529<_0x176bea[_0xc42e('0x94')]['length'];_0xe1b529++){var _0x409929=_0x176bea[_0xc42e('0x94')][_0xe1b529];var _0x4d82b4=path[_0xc42e('0x5a')](_0x5f0f45,_0x409929[_0xc42e('0x95')]);if(fs[_0xc42e('0x96')](_0x4d82b4)){_0x5d428d[_0xc42e('0x59')]['push']({'name':_0x409929[_0xc42e('0x2e')],'contentType':_0x409929[_0xc42e('0x2b')],'data':fs['readFileSync'](_0x4d82b4)});}}}emlformat['build'](_0x5d428d,function(_0x16d754,_0x423b29){if(_0x16d754)return _0x5ca042(_0x16d754);fs[_0xc42e('0x97')](path[_0xc42e('0x5a')](_0x581030,_0x489d43),_0x423b29);return _0x462fbd(_0x423b29);});});}})[_0xc42e('0x23')](function(_0x2ca3b2){if(_0x2ca3b2){return _0x2e0ee2[_0xc42e('0x98')](path[_0xc42e('0x5a')](_0x581030,_0x489d43),_0x489d43,function(_0x4ea8e3){if(!_0x4ea8e3)fs['unlinkSync'](path[_0xc42e('0x5a')](_0x581030,_0x489d43));});}})[_0xc42e('0x1d')](handleError(_0x2e0ee2,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index ef14630..fb2d595 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 _0x3513=['MailMessage','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x320e33,_0x2c6591){var _0x376b50=function(_0x58632f){while(--_0x58632f){_0x320e33['push'](_0x320e33['shift']());}};_0x376b50(++_0x2c6591);}(_0x3513,0x7f));var _0x3351=function(_0x384cee,_0x2da19c){_0x384cee=_0x384cee-0x0;var _0x49e044=_0x3513[_0x384cee];return _0x49e044;};'use strict';var EventEmitter=require(_0x3351('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x3351('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3351('0x2'),'afterUpdate':_0x3351('0x3'),'afterDestroy':_0x3351('0x4')};function emitEvent(_0x1e46c3){return function(_0x2467a8,_0x58d592,_0x5a791b){MailMessageEvents['emit'](_0x1e46c3+':'+_0x2467a8['id'],_0x2467a8);MailMessageEvents[_0x3351('0x5')](_0x1e46c3,_0x2467a8);_0x5a791b(null);};}for(var e in events){if(events[_0x3351('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x3351('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x255c=['../../mysqldb','MailMessage','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x255c,0x8f));var _0xc255=function(_0x4ef0d6,_0x369467){_0x4ef0d6=_0x4ef0d6-0x0;var _0x1fb961=_0x255c[_0x4ef0d6];return _0x1fb961;};'use strict';var EventEmitter=require(_0xc255('0x0'));var MailMessage=require(_0xc255('0x1'))['db'][_0xc255('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc255('0x3'),'afterDestroy':_0xc255('0x4')};function emitEvent(_0x1d0f31){return function(_0x5cce6d,_0xe8dc15,_0x1aab91){MailMessageEvents[_0xc255('0x5')](_0x1d0f31+':'+_0x5cce6d['id'],_0x5cce6d);MailMessageEvents[_0xc255('0x5')](_0x1d0f31,_0x5cce6d);_0x1aab91(null);};}for(var e in events){if(events[_0xc255('0x6')](e)){var event=events[e];MailMessage[_0xc255('0x7')](e,emitEvent(event));}}module[_0xc255('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index ee28ce6..d84f1ba 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 _0xf373=['models','get','direction','toLowerCase','out','secret','UserId','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','body','fromString'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xf373,0x138));var _0x3f37=function(_0x4a8e44,_0x3f0f77){_0x4a8e44=_0x4a8e44-0x0;var _0x2590a1=_0xf373[_0x4a8e44];return _0x2590a1;};'use strict';var _=require(_0x3f37('0x0'));var util=require(_0x3f37('0x1'));var logger=require(_0x3f37('0x2'))(_0x3f37('0x3'));var moment=require('moment');var BPromise=require(_0x3f37('0x4'));var rp=require(_0x3f37('0x5'));var htmlToText=require(_0x3f37('0x6'));var fs=require('fs');var path=require(_0x3f37('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3f37('0x8'));module[_0x3f37('0x9')]=function(_0x2e94de,_0x2bcbbe){return _0x2e94de[_0x3f37('0xa')](_0x3f37('0xb'),attributes,{'tableName':_0x3f37('0xc'),'paranoid':![],'indexes':[{'name':_0x3f37('0xd'),'fields':[_0x3f37('0xd')]},{'name':'fti_mail_messages','fields':[_0x3f37('0xe'),_0x3f37('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52fc26,_0x3fff36,_0x1a8dd5){if(_0x52fc26[_0x3f37('0x10')]){_0x52fc26[_0x3f37('0xe')]=htmlToText[_0x3f37('0x11')](_0x52fc26[_0x3f37('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1a8dd5(null,_0x3fff36);},'afterCreate':function(_0x202e63,_0x18efdd,_0x5924d6){var _0x4726e0=_0x2e94de[_0x3f37('0x12')];var _0x28eb81=_0x202e63[_0x3f37('0x13')]({'plain':!![]});if(_0x28eb81[_0x3f37('0x14')][_0x3f37('0x15')]()==='in'||_0x28eb81[_0x3f37('0x14')][_0x3f37('0x15')]()===_0x3f37('0x16')&&!_0x28eb81[_0x3f37('0x17')]&&!_['isNil'](_0x28eb81[_0x3f37('0x18')])){_0x4726e0['MailInteraction'][_0x3f37('0x19')]({'where':{'id':_0x28eb81[_0x3f37('0x1a')]}})[_0x3f37('0x1b')](function(_0x1b387e){if(_0x1b387e){_0x1b387e[_0x3f37('0x1c')]({'lastMsgAt':_0x28eb81[_0x3f37('0x1d')],'lastMsgDirection':_0x28eb81[_0x3f37('0x14')]['toLowerCase']()});}})['catch'](function(_0x84be42){console[_0x3f37('0x1e')](_0x84be42);});}_0x5924d6();}},'charset':_0x3f37('0x1f'),'collate':_0x3f37('0x20')});}; \ No newline at end of file +var _0x5d64=['FULLTEXT','body','fromString','models','direction','toLowerCase','secret','isNil','MailInteraction','findOne','MailInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject'];(function(_0xbdf03f,_0x595215){var _0x2bbe9e=function(_0x59fbd4){while(--_0x59fbd4){_0xbdf03f['push'](_0xbdf03f['shift']());}};_0x2bbe9e(++_0x595215);}(_0x5d64,0x87));var _0x45d6=function(_0x4a551d,_0x316a5f){_0x4a551d=_0x4a551d-0x0;var _0x56d057=_0x5d64[_0x4a551d];return _0x56d057;};'use strict';var _=require('lodash');var util=require(_0x45d6('0x0'));var logger=require('../../config/logger')(_0x45d6('0x1'));var moment=require(_0x45d6('0x2'));var BPromise=require(_0x45d6('0x3'));var rp=require(_0x45d6('0x4'));var htmlToText=require(_0x45d6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45d6('0x6'));var config=require(_0x45d6('0x7'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x5dae68,_0x23fa19){return _0x5dae68[_0x45d6('0x8')](_0x45d6('0x9'),attributes,{'tableName':_0x45d6('0xa'),'paranoid':![],'indexes':[{'name':_0x45d6('0xb'),'fields':[_0x45d6('0xb')]},{'name':_0x45d6('0xc'),'fields':[_0x45d6('0xd'),_0x45d6('0xe')],'type':_0x45d6('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d69fe,_0x459701,_0x1e52ce){if(_0x5d69fe[_0x45d6('0x10')]){_0x5d69fe[_0x45d6('0xd')]=htmlToText[_0x45d6('0x11')](_0x5d69fe[_0x45d6('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1e52ce(null,_0x459701);},'afterCreate':function(_0x26061b,_0x1794cb,_0x3ebfab){var _0x4f90a7=_0x5dae68[_0x45d6('0x12')];var _0x269d2e=_0x26061b['get']({'plain':!![]});if(_0x269d2e[_0x45d6('0x13')][_0x45d6('0x14')]()==='in'||_0x269d2e[_0x45d6('0x13')][_0x45d6('0x14')]()==='out'&&!_0x269d2e[_0x45d6('0x15')]&&!_[_0x45d6('0x16')](_0x269d2e['UserId'])){_0x4f90a7[_0x45d6('0x17')][_0x45d6('0x18')]({'where':{'id':_0x269d2e[_0x45d6('0x19')]}})[_0x45d6('0x1a')](function(_0x512e6b){if(_0x512e6b){_0x512e6b['update']({'lastMsgAt':_0x269d2e['createdAt'],'lastMsgDirection':_0x269d2e[_0x45d6('0x13')][_0x45d6('0x14')]()});}})[_0x45d6('0x1b')](function(_0x333ddc){console['error'](_0x333ddc);});}_0x3ebfab();}},'charset':_0x45d6('0x1c'),'collate':_0x45d6('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 9a20e48..e406ca6 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 _0x0abf=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x46d43f,_0x16ec5e){var _0x21d4c0=function(_0x5620f6){while(--_0x5620f6){_0x46d43f['push'](_0x46d43f['shift']());}};_0x21d4c0(++_0x16ec5e);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./mailMessage.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});}exports[_0xf0ab('0x1a')]=function(_0x715579){var _0xdfcfb2=this;return new Promise(function(_0xf43bc4,_0x22a205){return db[_0xf0ab('0x1b')][_0xf0ab('0x1c')](_0x715579['body'],{'raw':_0x715579[_0xf0ab('0x1d')]?_0x715579[_0xf0ab('0x1d')][_0xf0ab('0x1e')]===undefined?!![]:![]:!![]})[_0xf0ab('0xe')](function(_0x3bf6a1){logger[_0xf0ab('0xf')](_0xf0ab('0x1a'),_0x715579);logger[_0xf0ab('0x12')](_0xf0ab('0x1a'),_0x715579,JSON[_0xf0ab('0x14')](_0x3bf6a1));_0xf43bc4(_0x3bf6a1);})[_0xf0ab('0x19')](function(_0x5645b2){logger['error']('CreateMailMessage',_0x5645b2[_0xf0ab('0x17')],_0x715579);_0x22a205(_0xdfcfb2['error'](0x1f4,_0x5645b2[_0xf0ab('0x17')]));});});}; \ No newline at end of file +var _0x351d=['rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','create','body','options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x35c00a,_0x2ec94e){var _0x42f9f6=function(_0x2ddcb4){while(--_0x2ddcb4){_0x35c00a['push'](_0x35c00a['shift']());}};_0x42f9f6(++_0x2ec94e);}(_0x351d,0x90));var _0xd351=function(_0x11153e,_0x37f102){_0x11153e=_0x11153e-0x0;var _0x11467f=_0x351d[_0x11153e];return _0x11467f;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});config['redis']=_[_0xd351('0xa')](config[_0xd351('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd351('0xc'))(new Redis(config[_0xd351('0xb')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x44bf81,_0x4904b4,_0x34cfc7){return new BPromise(function(_0x39b8c8,_0x5949a4){return client[_0xd351('0xd')](_0x44bf81,_0x34cfc7)[_0xd351('0xe')](function(_0x4ebca1){logger[_0xd351('0xf')]('MailMessage,\x20%s,\x20%s',_0x4904b4,'request\x20sent');logger[_0xd351('0x10')](_0xd351('0x11'),_0x4904b4,_0xd351('0x12'),JSON[_0xd351('0x13')](_0x4ebca1));if(_0x4ebca1['error']){if(_0x4ebca1[_0xd351('0x14')][_0xd351('0x15')]===0x1f4){logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);return _0x5949a4(_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);}logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1['error']['message']);return _0x39b8c8(_0x4ebca1[_0xd351('0x14')]['message']);}else{logger[_0xd351('0xf')](_0xd351('0x16'),_0x4904b4,_0xd351('0x12'));_0x39b8c8(_0x4ebca1['result'][_0xd351('0x17')]);}})[_0xd351('0x18')](function(_0x77985a){logger[_0xd351('0x14')]('MailMessage,\x20%s,\x20%s',_0x4904b4,_0x77985a);_0x5949a4(_0x77985a);});});}exports[_0xd351('0x19')]=function(_0x4abbed){var _0x48fa9b=this;return new Promise(function(_0x37d3ac,_0x4a427b){return db[_0xd351('0x1a')][_0xd351('0x1b')](_0x4abbed[_0xd351('0x1c')],{'raw':_0x4abbed[_0xd351('0x1d')]?_0x4abbed[_0xd351('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xd351('0xe')](function(_0xbbc58){logger[_0xd351('0xf')]('CreateMailMessage',_0x4abbed);logger[_0xd351('0x10')](_0xd351('0x19'),_0x4abbed,JSON[_0xd351('0x13')](_0xbbc58));_0x37d3ac(_0xbbc58);})['catch'](function(_0x1ce279){logger[_0xd351('0x14')](_0xd351('0x19'),_0x1ce279[_0xd351('0x17')],_0x4abbed);_0x4a427b(_0x48fa9b['error'](0x1f4,_0x1ce279[_0xd351('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index c6c27a7..3d665fc 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 _0xed59=['length','./mailMessage.events','save','remove','emit','removeListener','register'];(function(_0x5ce894,_0x2ad0c4){var _0x27a65b=function(_0x309b07){while(--_0x309b07){_0x5ce894['push'](_0x5ce894['shift']());}};_0x27a65b(++_0x2ad0c4);}(_0xed59,0x112));var _0x9ed5=function(_0x28336a,_0x3e5194){_0x28336a=_0x28336a-0x0;var _0x4ac38d=_0xed59[_0x28336a];return _0x4ac38d;};'use strict';var MailMessageEvents=require(_0x9ed5('0x0'));var events=[_0x9ed5('0x1'),_0x9ed5('0x2'),'update'];function createListener(_0x1c993d,_0x16575d){return function(_0x2bda96){_0x16575d[_0x9ed5('0x3')](_0x1c993d,_0x2bda96);};}function removeListener(_0x38a13d,_0x1ac1a4){return function(){MailMessageEvents[_0x9ed5('0x4')](_0x38a13d,_0x1ac1a4);};}exports[_0x9ed5('0x5')]=function(_0x711df9){for(var _0xe3f447=0x0,_0x30dd85=events[_0x9ed5('0x6')];_0xe3f447<_0x30dd85;_0xe3f447++){var _0x15d9b1=events[_0xe3f447];var _0x108ae4=createListener('mailMessage:'+_0x15d9b1,_0x711df9);MailMessageEvents['on'](_0x15d9b1,_0x108ae4);}}; \ No newline at end of file +var _0xc3b0=['remove','update','emit','removeListener','register','length','./mailMessage.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc3b0,0x166));var _0x0c3b=function(_0x3a4aad,_0x3c44c3){_0x3a4aad=_0x3a4aad-0x0;var _0x11bef7=_0xc3b0[_0x3a4aad];return _0x11bef7;};'use strict';var MailMessageEvents=require(_0x0c3b('0x0'));var events=[_0x0c3b('0x1'),_0x0c3b('0x2'),_0x0c3b('0x3')];function createListener(_0x5348c4,_0x5af7d8){return function(_0x2f8bb7){_0x5af7d8[_0x0c3b('0x4')](_0x5348c4,_0x2f8bb7);};}function removeListener(_0x508b38,_0x2b13c6){return function(){MailMessageEvents[_0x0c3b('0x5')](_0x508b38,_0x2b13c6);};}exports[_0x0c3b('0x6')]=function(_0x5ba7f1){for(var _0x408fd8=0x0,_0x3e2305=events[_0x0c3b('0x7')];_0x408fd8<_0x3e2305;_0x408fd8++){var _0x4e7c4f=events[_0x408fd8];var _0x5c4e3a=createListener('mailMessage:'+_0x4e7c4f,_0x5ba7f1);MailMessageEvents['on'](_0x4e7c4f,_0x5c4e3a);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 3e32b3c..3ad50b7 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 _0x5cbc=['get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','/:id/teams','post','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x53f539,_0x4b348a){var _0x5114ce=function(_0x3c027b){while(--_0x3c027b){_0x53f539['push'](_0x53f539['shift']());}};_0x5114ce(++_0x4b348a);}(_0x5cbc,0x137));var _0xc5cb=function(_0x6f827d,_0x13e8d4){_0x6f827d=_0x6f827d-0x0;var _0x5bbc09=_0x5cbc[_0x6f827d];return _0x5bbc09;};'use strict';var multer=require(_0xc5cb('0x0'));var util=require(_0xc5cb('0x1'));var path=require(_0xc5cb('0x2'));var timeout=require(_0xc5cb('0x3'));var express=require('express');var router=express[_0xc5cb('0x4')]();var fs_extra=require(_0xc5cb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc5cb('0x6'));var config=require(_0xc5cb('0x7'));var controller=require('./mailQueue.controller');router[_0xc5cb('0x8')]('/',auth[_0xc5cb('0x9')](),controller[_0xc5cb('0xa')]);router[_0xc5cb('0x8')](_0xc5cb('0xb'),auth[_0xc5cb('0x9')](),controller['describe']);router[_0xc5cb('0x8')](_0xc5cb('0xc'),auth[_0xc5cb('0x9')](),controller[_0xc5cb('0xd')]);router[_0xc5cb('0x8')](_0xc5cb('0xe'),auth[_0xc5cb('0x9')](),controller[_0xc5cb('0xf')]);router[_0xc5cb('0x8')]('/:id/teams',auth[_0xc5cb('0x9')](),controller[_0xc5cb('0x10')]);router[_0xc5cb('0x8')](_0xc5cb('0x11'),auth[_0xc5cb('0x9')](),controller[_0xc5cb('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc5cb('0x13')]);router['post'](_0xc5cb('0x14'),auth[_0xc5cb('0x9')](),controller['addTeams']);router[_0xc5cb('0x15')]('/:id/users',auth[_0xc5cb('0x9')](),controller['addAgents']);router[_0xc5cb('0x16')]('/:id',auth[_0xc5cb('0x9')](),controller[_0xc5cb('0x17')]);router[_0xc5cb('0x18')](_0xc5cb('0xc'),auth[_0xc5cb('0x9')](),controller[_0xc5cb('0x19')]);router[_0xc5cb('0x18')]('/:id/teams',auth[_0xc5cb('0x9')](),controller[_0xc5cb('0x1a')]);router[_0xc5cb('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xc5cb('0x1b')]);module[_0xc5cb('0x1c')]=router; \ No newline at end of file +var _0xc1f1=['/:id','update','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','put'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xc1f1,0x17f));var _0x1c1f=function(_0x2fb28c,_0x458fc5){_0x2fb28c=_0x2fb28c-0x0;var _0x22ee82=_0xc1f1[_0x2fb28c];return _0x22ee82;};'use strict';var multer=require(_0x1c1f('0x0'));var util=require('util');var path=require(_0x1c1f('0x1'));var timeout=require(_0x1c1f('0x2'));var express=require(_0x1c1f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1c1f('0x4'));var interaction=require(_0x1c1f('0x5'));var config=require('../../config/environment');var controller=require(_0x1c1f('0x6'));router[_0x1c1f('0x7')]('/',auth[_0x1c1f('0x8')](),controller[_0x1c1f('0x9')]);router[_0x1c1f('0x7')](_0x1c1f('0xa'),auth['isAuthenticated'](),controller[_0x1c1f('0xb')]);router[_0x1c1f('0x7')]('/:id',auth[_0x1c1f('0x8')](),controller['show']);router[_0x1c1f('0x7')](_0x1c1f('0xc'),auth[_0x1c1f('0x8')](),controller[_0x1c1f('0xd')]);router['get']('/:id/teams',auth[_0x1c1f('0x8')](),controller[_0x1c1f('0xe')]);router[_0x1c1f('0x7')](_0x1c1f('0xf'),auth['isAuthenticated'](),controller[_0x1c1f('0x10')]);router[_0x1c1f('0x11')]('/',auth[_0x1c1f('0x8')](),controller[_0x1c1f('0x12')]);router[_0x1c1f('0x11')](_0x1c1f('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0x1c1f('0x11')](_0x1c1f('0xf'),auth['isAuthenticated'](),controller[_0x1c1f('0x14')]);router[_0x1c1f('0x15')](_0x1c1f('0x16'),auth['isAuthenticated'](),controller[_0x1c1f('0x17')]);router[_0x1c1f('0x18')]('/:id',auth[_0x1c1f('0x8')](),controller['destroy']);router[_0x1c1f('0x18')](_0x1c1f('0x13'),auth['isAuthenticated'](),controller[_0x1c1f('0x19')]);router[_0x1c1f('0x18')](_0x1c1f('0xf'),auth['isAuthenticated'](),controller[_0x1c1f('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 2680051..d61d020 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 _0x7501=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x7501,0x9a));var _0x1750=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x7501[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0x1750('0x0'));module[_0x1750('0x1')]={'name':{'type':Sequelize[_0x1750('0x2')],'unique':_0x1750('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1750('0x2')]},'timeout':{'type':Sequelize[_0x1750('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1750('0x5')]('rrmemory',_0x1750('0x6'),_0x1750('0x7'))}}; \ No newline at end of file +var _0x1f4f=['ENUM','rrmemory','roundrobin','exports','STRING','name','INTEGER'];(function(_0x57b443,_0x5145b4){var _0x1a763d=function(_0x513b90){while(--_0x513b90){_0x57b443['push'](_0x57b443['shift']());}};_0x1a763d(++_0x5145b4);}(_0x1f4f,0x10d));var _0xf1f4=function(_0x52b677,_0x5ad4f0){_0x52b677=_0x52b677-0x0;var _0x311b3b=_0x1f4f[_0x52b677];return _0x311b3b;};'use strict';var Sequelize=require('sequelize');module[_0xf1f4('0x0')]={'name':{'type':Sequelize[_0xf1f4('0x1')],'unique':_0xf1f4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf1f4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf1f4('0x4')](_0xf1f4('0x5'),'beepall',_0xf1f4('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 8c95b09..1b19252 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 _0x3bc8=['MailQueue','rawAttributes','fieldName','type','key','query','filters','intersection','fields','attributes','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','keys','find','create','role','user','get','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','pick','findAll','User','findAndCountAll','UserId','agent','mailPause','createdAt','%s/%s','SIP','getTeams','Team','Agents','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','clone','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','MailQueues','stack','name','send','map'];(function(_0x569a67,_0x591807){var _0x22b50f=function(_0x4a5da9){while(--_0x4a5da9){_0x569a67['push'](_0x569a67['shift']());}};_0x22b50f(++_0x591807);}(_0x3bc8,0x1f3));var _0x83bc=function(_0x3f7855,_0x535342){_0x3f7855=_0x3f7855-0x0;var _0x301fb7=_0x3bc8[_0x3f7855];return _0x301fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83bc('0x0'));var zipdir=require(_0x83bc('0x1'));var jsonpatch=require(_0x83bc('0x2'));var rp=require('request-promise');var moment=require(_0x83bc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x83bc('0x4'));var path=require(_0x83bc('0x5'));var sox=require(_0x83bc('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83bc('0x7'));var _=require('lodash');var squel=require(_0x83bc('0x8'));var crypto=require('crypto');var jsforce=require(_0x83bc('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x83bc('0xa'));var Papa=require(_0x83bc('0xb'));var Redis=require('ioredis');var authService=require(_0x83bc('0xc'));var qs=require(_0x83bc('0xd'));var as=require(_0x83bc('0xe'));var hardwareService=require(_0x83bc('0xf'));var logger=require('../../config/logger')(_0x83bc('0x10'));var utils=require(_0x83bc('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x83bc('0x12'));var db=require(_0x83bc('0x13'))['db'];config[_0x83bc('0x14')]=_[_0x83bc('0x15')](config[_0x83bc('0x14')],{'host':_0x83bc('0x16'),'port':0x18eb});var socket=require(_0x83bc('0x17'))(new Redis(config['redis']));require(_0x83bc('0x18'))[_0x83bc('0x19')](socket);function respondWithStatusCode(_0x2477e3,_0x103dfd){_0x103dfd=_0x103dfd||0xcc;return function(_0x19dc3d){if(_0x19dc3d){return _0x2477e3[_0x83bc('0x1a')](_0x103dfd);}return _0x2477e3[_0x83bc('0x1b')](_0x103dfd)[_0x83bc('0x1c')]();};}function respondWithResult(_0x26bec5,_0x5644ed){_0x5644ed=_0x5644ed||0xc8;return function(_0x1c7173){if(_0x1c7173){return _0x26bec5[_0x83bc('0x1b')](_0x5644ed)[_0x83bc('0x1d')](_0x1c7173);}};}function respondWithFilteredResult(_0xaf5c7e,_0xbcc4b7){return function(_0x1b9955){if(_0x1b9955){var _0xec1d21=typeof _0xbcc4b7[_0x83bc('0x1e')]===_0x83bc('0x1f')&&typeof _0xbcc4b7[_0x83bc('0x20')]===_0x83bc('0x1f');var _0x274454=_0x1b9955['count'];var _0x3d29d7=_0xec1d21?0x0:_0xbcc4b7[_0x83bc('0x1e')];var _0x247529=_0xec1d21?_0x1b9955['count']:_0xbcc4b7[_0x83bc('0x1e')]+_0xbcc4b7[_0x83bc('0x20')];var _0x327c36;if(_0x247529>=_0x274454){_0x247529=_0x274454;_0x327c36=0xc8;}else{_0x327c36=0xce;}_0xaf5c7e[_0x83bc('0x1b')](_0x327c36);return _0xaf5c7e[_0x83bc('0x21')](_0x83bc('0x22'),_0x3d29d7+'-'+_0x247529+'/'+_0x274454)['json'](_0x1b9955);}return null;};}function patchUpdates(_0x50c2fc){return function(_0x58fa22){try{jsonpatch[_0x83bc('0x23')](_0x58fa22,_0x50c2fc,!![]);}catch(_0x14db2d){return BPromise[_0x83bc('0x24')](_0x14db2d);}return _0x58fa22[_0x83bc('0x25')]();};}function saveUpdates(_0x32b308,_0x5d8b59){return function(_0x3cf002){if(_0x3cf002){return _0x3cf002['update'](_0x32b308)[_0x83bc('0x26')](function(_0x564703){return _0x564703;});}return null;};}function removeEntity(_0x19993b,_0x59f635){return function(_0x854084){if(_0x854084){return _0x854084[_0x83bc('0x27')]()[_0x83bc('0x26')](function(){var _0x4e6ce2=_0x854084['get']({'plain':!![]});var _0x5d99c4=_0x83bc('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x5d99c4,'resourceId':_0x4e6ce2['id']}})[_0x83bc('0x26')](function(){return _0x854084;});})[_0x83bc('0x26')](function(){_0x19993b[_0x83bc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51825,_0x40f740){return function(_0x2d0506){if(!_0x2d0506){_0x51825['sendStatus'](0x194);}return _0x2d0506;};}function handleError(_0x260163,_0x28256a){_0x28256a=_0x28256a||0x1f4;return function(_0x328c40){logger['error'](_0x328c40[_0x83bc('0x29')]);if(_0x328c40[_0x83bc('0x2a')]){delete _0x328c40[_0x83bc('0x2a')];}_0x260163['status'](_0x28256a)[_0x83bc('0x2b')](_0x328c40);};}exports['index']=function(_0x165e67,_0x61c5c3){var _0x52afb9={},_0x2e66e7={},_0x55fc23={'count':0x0,'rows':[]};var _0x183b0c=_[_0x83bc('0x2c')](db[_0x83bc('0x2d')][_0x83bc('0x2e')],function(_0x285f1f){return{'name':_0x285f1f[_0x83bc('0x2f')],'type':_0x285f1f[_0x83bc('0x30')][_0x83bc('0x31')]};});_0x2e66e7['model']=_[_0x83bc('0x2c')](_0x183b0c,_0x83bc('0x2a'));_0x2e66e7[_0x83bc('0x32')]=_['keys'](_0x165e67[_0x83bc('0x32')]);_0x2e66e7[_0x83bc('0x33')]=_['intersection'](_0x2e66e7['model'],_0x2e66e7[_0x83bc('0x32')]);_0x52afb9['attributes']=_[_0x83bc('0x34')](_0x2e66e7['model'],qs[_0x83bc('0x35')](_0x165e67['query'][_0x83bc('0x35')]));_0x52afb9[_0x83bc('0x36')]=_0x52afb9[_0x83bc('0x36')][_0x83bc('0x37')]?_0x52afb9[_0x83bc('0x36')]:_0x2e66e7[_0x83bc('0x38')];if(!_0x165e67['query']['hasOwnProperty'](_0x83bc('0x39'))){_0x52afb9[_0x83bc('0x20')]=qs[_0x83bc('0x20')](_0x165e67[_0x83bc('0x32')][_0x83bc('0x20')]);_0x52afb9[_0x83bc('0x1e')]=qs[_0x83bc('0x1e')](_0x165e67[_0x83bc('0x32')][_0x83bc('0x1e')]);}_0x52afb9[_0x83bc('0x3a')]=qs[_0x83bc('0x3b')](_0x165e67['query'][_0x83bc('0x3b')]);_0x52afb9[_0x83bc('0x3c')]=qs[_0x83bc('0x33')](_['pick'](_0x165e67[_0x83bc('0x32')],_0x2e66e7[_0x83bc('0x33')]),_0x183b0c);if(_0x165e67['query'][_0x83bc('0x3d')]){_0x52afb9['where']=_[_0x83bc('0x3e')](_0x52afb9[_0x83bc('0x3c')],{'$or':_[_0x83bc('0x2c')](_0x183b0c,function(_0x3869b5){if(_0x3869b5['type']!==_0x83bc('0x3f')){var _0x41b06e={};_0x41b06e[_0x3869b5[_0x83bc('0x2a')]]={'$like':'%'+_0x165e67[_0x83bc('0x32')][_0x83bc('0x3d')]+'%'};return _0x41b06e;}})});}_0x52afb9=_[_0x83bc('0x3e')]({},_0x52afb9,_0x165e67[_0x83bc('0x40')]);var _0x3c1fb5={'where':_0x52afb9[_0x83bc('0x3c')]};return db[_0x83bc('0x2d')]['count'](_0x3c1fb5)[_0x83bc('0x26')](function(_0x4d1d1f){_0x55fc23[_0x83bc('0x41')]=_0x4d1d1f;if(_0x165e67[_0x83bc('0x32')][_0x83bc('0x42')]){_0x52afb9[_0x83bc('0x43')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x52afb9);})[_0x83bc('0x26')](function(_0x1434d9){_0x55fc23[_0x83bc('0x44')]=_0x1434d9;return _0x55fc23;})[_0x83bc('0x26')](respondWithFilteredResult(_0x61c5c3,_0x52afb9))[_0x83bc('0x45')](handleError(_0x61c5c3,null));};exports[_0x83bc('0x46')]=function(_0x168082,_0x1388c6){var _0xb673b={'raw':!![],'where':{'id':_0x168082['params']['id']}},_0x44fe15={};_0x44fe15[_0x83bc('0x38')]=_[_0x83bc('0x47')](db['MailQueue'][_0x83bc('0x2e')]);_0x44fe15['query']=_[_0x83bc('0x47')](_0x168082['query']);_0x44fe15['filters']=_['intersection'](_0x44fe15[_0x83bc('0x38')],_0x44fe15['query']);_0xb673b[_0x83bc('0x36')]=_[_0x83bc('0x34')](_0x44fe15['model'],qs[_0x83bc('0x35')](_0x168082[_0x83bc('0x32')][_0x83bc('0x35')]));_0xb673b[_0x83bc('0x36')]=_0xb673b[_0x83bc('0x36')]['length']?_0xb673b[_0x83bc('0x36')]:_0x44fe15[_0x83bc('0x38')];if(_0x168082['query'][_0x83bc('0x42')]){_0xb673b[_0x83bc('0x43')]=[{'all':!![]}];}_0xb673b=_[_0x83bc('0x3e')]({},_0xb673b,_0x168082['options']);return db[_0x83bc('0x2d')][_0x83bc('0x48')](_0xb673b)[_0x83bc('0x26')](handleEntityNotFound(_0x1388c6,null))[_0x83bc('0x26')](respondWithResult(_0x1388c6,null))[_0x83bc('0x45')](handleError(_0x1388c6,null));};exports[_0x83bc('0x49')]=function(_0x24a687,_0x163503){return db[_0x83bc('0x2d')]['create'](_0x24a687['body'],{})[_0x83bc('0x26')](function(_0x263820){var _0x167baa=_0x24a687['user']['get']({'plain':!![]});if(!_0x167baa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x167baa[_0x83bc('0x4a')]===_0x83bc('0x4b')){var _0x38bcb9=_0x263820[_0x83bc('0x4c')]({'plain':!![]});var _0x568ad7=_0x83bc('0x28');return db[_0x83bc('0x4d')][_0x83bc('0x48')]({'where':{'name':_0x568ad7,'userProfileId':_0x167baa[_0x83bc('0x4e')]},'raw':!![]})['then'](function(_0x10763e){if(_0x10763e&&_0x10763e['autoAssociation']===0x0){return db['UserProfileResource'][_0x83bc('0x49')]({'name':_0x38bcb9[_0x83bc('0x2a')],'resourceId':_0x38bcb9['id'],'type':_0x10763e['name'],'sectionId':_0x10763e['id']},{})['then'](function(){return _0x263820;});}else{return _0x263820;}})['catch'](function(_0x1f8979){logger[_0x83bc('0x4f')](_0x83bc('0x50'),_0x1f8979);throw _0x1f8979;});}return _0x263820;})[_0x83bc('0x26')](respondWithResult(_0x163503,0xc9))['catch'](handleError(_0x163503,null));};exports[_0x83bc('0x51')]=function(_0x1dee77,_0x5a8364){if(_0x1dee77['body']['id']){delete _0x1dee77[_0x83bc('0x52')]['id'];}return db[_0x83bc('0x2d')][_0x83bc('0x48')]({'where':{'id':_0x1dee77['params']['id']}})[_0x83bc('0x26')](handleEntityNotFound(_0x5a8364,null))[_0x83bc('0x26')](saveUpdates(_0x1dee77[_0x83bc('0x52')],null))[_0x83bc('0x26')](respondWithResult(_0x5a8364,null))[_0x83bc('0x45')](handleError(_0x5a8364,null));};exports[_0x83bc('0x27')]=function(_0x46e239,_0x4b18e9){return db[_0x83bc('0x2d')][_0x83bc('0x48')]({'where':{'id':_0x46e239[_0x83bc('0x53')]['id']}})['then'](handleEntityNotFound(_0x4b18e9,null))[_0x83bc('0x26')](removeEntity(_0x4b18e9,null))['catch'](handleError(_0x4b18e9,null));};exports[_0x83bc('0x54')]=function(_0x3c9f00,_0x3682fd){return db[_0x83bc('0x2d')]['describe']()[_0x83bc('0x26')](respondWithResult(_0x3682fd,null))[_0x83bc('0x45')](handleError(_0x3682fd,null));};exports[_0x83bc('0x55')]=function(_0x3a397f,_0x25f018,_0x28ce82){var _0x345c01={'raw':!![],'where':{}},_0x4a376e={},_0x19bbb1;return db['MailQueue'][_0x83bc('0x56')]({'where':{'id':_0x3a397f['params']['id']}})[_0x83bc('0x26')](handleEntityNotFound(_0x25f018,null))['then'](function(_0x2b3e8f){if(_0x2b3e8f){_0x19bbb1=_0x2b3e8f[_0x83bc('0x4c')]({'plain':!![]});_0x4a376e[_0x83bc('0x38')]=_[_0x83bc('0x47')](db[_0x83bc('0x57')][_0x83bc('0x2e')]);_0x4a376e['query']=_[_0x83bc('0x47')](_0x3a397f[_0x83bc('0x32')]);_0x4a376e[_0x83bc('0x33')]=_['intersection'](_0x4a376e['model'],_0x4a376e[_0x83bc('0x32')]);_0x345c01[_0x83bc('0x36')]=_[_0x83bc('0x34')](_0x4a376e[_0x83bc('0x38')],qs[_0x83bc('0x35')](_0x3a397f[_0x83bc('0x32')]['fields']));_0x345c01['attributes']=_0x345c01[_0x83bc('0x36')]['length']?_0x345c01[_0x83bc('0x36')]:_0x4a376e[_0x83bc('0x38')];if(!_0x3a397f[_0x83bc('0x32')][_0x83bc('0x58')]('nolimit')){_0x345c01[_0x83bc('0x20')]=qs[_0x83bc('0x20')](_0x3a397f['query'][_0x83bc('0x20')]);_0x345c01[_0x83bc('0x1e')]=qs[_0x83bc('0x1e')](_0x3a397f['query'][_0x83bc('0x1e')]);}_0x345c01[_0x83bc('0x3a')]=qs[_0x83bc('0x3b')](_0x3a397f[_0x83bc('0x32')][_0x83bc('0x3b')]);_0x345c01['where']=qs['filters'](_[_0x83bc('0x59')](_0x3a397f[_0x83bc('0x32')],_0x4a376e['filters']));_0x345c01[_0x83bc('0x3c')]['MailQueueId']=_0x2b3e8f['id'];if(_0x3a397f['query'][_0x83bc('0x3d')]){_0x345c01[_0x83bc('0x3c')]=_[_0x83bc('0x3e')](_0x345c01[_0x83bc('0x3c')],{'$or':_[_0x83bc('0x2c')](_0x345c01[_0x83bc('0x36')],function(_0x566cd6){var _0x2de942={};_0x2de942[_0x566cd6]={'$like':'%'+_0x3a397f[_0x83bc('0x32')][_0x83bc('0x3d')]+'%'};return _0x2de942;})});}_0x345c01=_[_0x83bc('0x3e')]({},_0x345c01,_0x3a397f['options']);return db[_0x83bc('0x57')][_0x83bc('0x5a')](_0x345c01);}})[_0x83bc('0x26')](function(_0x25c6e0){if(_0x25c6e0){return db[_0x83bc('0x5b')][_0x83bc('0x5c')]({'where':{'id':_[_0x83bc('0x2c')](_0x25c6e0,_0x83bc('0x5d')),'role':_0x83bc('0x5e')},'attributes':['id',_0x83bc('0x2a'),_0x83bc('0x5f'),'updatedAt',_0x83bc('0x60')]});}})[_0x83bc('0x26')](function(_0x50465c){if(_0x50465c){return{'count':_0x50465c['count'],'rows':_[_0x83bc('0x2c')](_0x50465c[_0x83bc('0x44')],function(_0x1c0015){return{'membername':_0x1c0015['name'],'UserId':_0x1c0015['id'],'queue_name':_0x19bbb1[_0x83bc('0x2a')],'MailQueueId':_0x19bbb1['id'],'interface':util['format'](_0x83bc('0x61'),_0x83bc('0x62'),_0x1c0015[_0x83bc('0x2a')]),'penalty':0x0,'paused':_0x1c0015['mailPause'],'createdAt':_0x1c0015[_0x83bc('0x60')],'updatedAt':_0x1c0015['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x83bc('0x26')](respondWithFilteredResult(_0x25f018,_0x345c01))[_0x83bc('0x45')](handleError(_0x25f018,null));};exports[_0x83bc('0x63')]=function(_0x2539be,_0x5e603c,_0x565d8b){var _0x5cdbf8={};var _0x7c426b={};var _0x63ad87;var _0x24e240;return db[_0x83bc('0x2d')][_0x83bc('0x56')]({'where':{'id':_0x2539be['params']['id']}})['then'](handleEntityNotFound(_0x5e603c,null))['then'](function(_0x3c905e){if(_0x3c905e){_0x63ad87=_0x3c905e;_0x7c426b[_0x83bc('0x38')]=_[_0x83bc('0x47')](db[_0x83bc('0x64')]['rawAttributes']);_0x7c426b[_0x83bc('0x32')]=_[_0x83bc('0x47')](_0x2539be[_0x83bc('0x32')]);_0x7c426b['filters']=_[_0x83bc('0x34')](_0x7c426b[_0x83bc('0x38')],_0x7c426b[_0x83bc('0x32')]);_0x5cdbf8[_0x83bc('0x36')]=_['intersection'](_0x7c426b[_0x83bc('0x38')],qs['fields'](_0x2539be['query'][_0x83bc('0x35')]));_0x5cdbf8['attributes']=_0x5cdbf8['attributes']['length']?_0x5cdbf8[_0x83bc('0x36')]:_0x7c426b[_0x83bc('0x38')];_0x5cdbf8[_0x83bc('0x3a')]=qs[_0x83bc('0x3b')](_0x2539be['query']['sort']);_0x5cdbf8[_0x83bc('0x3c')]=qs['filters'](_['pick'](_0x2539be[_0x83bc('0x32')],_0x7c426b[_0x83bc('0x33')]));if(_0x2539be[_0x83bc('0x32')]['filter']){_0x5cdbf8[_0x83bc('0x3c')]=_[_0x83bc('0x3e')](_0x5cdbf8['where'],{'$or':_[_0x83bc('0x2c')](_0x5cdbf8[_0x83bc('0x36')],function(_0xbadde5){var _0x304d27={};_0x304d27[_0xbadde5]={'$like':'%'+_0x2539be['query'][_0x83bc('0x3d')]+'%'};return _0x304d27;})});}_0x5cdbf8=_[_0x83bc('0x3e')]({},_0x5cdbf8,_0x2539be[_0x83bc('0x40')]);return _0x63ad87['getTeams'](_0x5cdbf8);}})[_0x83bc('0x26')](function(_0x191b23){if(_0x191b23){_0x24e240=_0x191b23[_0x83bc('0x37')];if(!_0x2539be[_0x83bc('0x32')][_0x83bc('0x58')]('nolimit')){_0x5cdbf8['limit']=qs['limit'](_0x2539be[_0x83bc('0x32')][_0x83bc('0x20')]);_0x5cdbf8['offset']=qs[_0x83bc('0x1e')](_0x2539be[_0x83bc('0x32')][_0x83bc('0x1e')]);}return _0x63ad87[_0x83bc('0x63')](_0x5cdbf8);}})[_0x83bc('0x26')](function(_0x56b122){if(_0x56b122){return _0x56b122?{'count':_0x24e240,'rows':_0x56b122}:null;}})[_0x83bc('0x26')](respondWithResult(_0x5e603c,null))[_0x83bc('0x45')](handleError(_0x5e603c,null));};exports['addTeams']=function(_0x143bb8,_0x4bb800,_0x22635a){var _0x51551e=_0x143bb8[_0x83bc('0x52')]['ids'];return db['Team'][_0x83bc('0x5a')]({'where':{'id':_0x51551e},'attributes':['id'],'include':[{'model':db[_0x83bc('0x5b')],'as':_0x83bc('0x65'),'attributes':['id','name','online','voicePause',_0x83bc('0x66')],'raw':!![]}]})[_0x83bc('0x26')](function(_0x831b0f){if(_0x831b0f){var _0x1bd8c2=_[_0x83bc('0x67')](_0x831b0f,function(_0x3f6e32){var _0xf3c069=_0x3f6e32[_0x83bc('0x4c')]({'plain':!![]});return _0xf3c069['Agents'];});return db[_0x83bc('0x2d')][_0x83bc('0x48')]({'where':{'id':_0x143bb8['params']['id']}})[_0x83bc('0x26')](function(_0x1786b3){return db[_0x83bc('0x68')][_0x83bc('0x69')](function(_0x10d38d){return _0x1786b3[_0x83bc('0x6a')](_0x51551e,{'transaction':_0x10d38d})['then'](function(){return BPromise[_0x83bc('0x6b')](_0x1bd8c2,function(_0xee1efd){return db[_0x83bc('0x57')][_0x83bc('0x6c')]({'where':{'UserId':_0xee1efd['id'],'MailQueueId':_0x143bb8[_0x83bc('0x53')]['id']},'transaction':_0x10d38d});});})[_0x83bc('0x26')](function(){_0x1bd8c2[_0x83bc('0x6d')](function(_0x2112a7){socket[_0x83bc('0x6e')](_0x83bc('0x6f'),{'UserId':_0x2112a7['id'],'MailQueueId':_0x1786b3['id']});});});});});}})[_0x83bc('0x26')](respondWithStatusCode(_0x4bb800,null))[_0x83bc('0x45')](handleError(_0x4bb800,null));};exports[_0x83bc('0x70')]=function(_0x4db112,_0x4bf3bc,_0x5b07d1){return db[_0x83bc('0x64')]['findAll']({'where':{'id':_0x4db112[_0x83bc('0x32')][_0x83bc('0x71')]},'attributes':['id'],'include':[{'model':db[_0x83bc('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x83bc('0x26')](handleEntityNotFound(_0x4bf3bc,null))['then'](function(_0x39ddf2){var _0x3166f6=_[_0x83bc('0x2c')](_0x39ddf2,'id');var _0x318346=[];var _0x525a03=[];var _0x5198a1=squel[_0x83bc('0x72')]();_0x5198a1[_0x83bc('0x73')](_0x83bc('0x74'))[_0x83bc('0x75')](_0x83bc('0x76'),'tq')['join']('user_has_teams','ut',_0x83bc('0x77'))[_0x83bc('0x3c')]('MailQueueId\x20=\x20?',_0x4db112[_0x83bc('0x53')]['id']);for(var _0xc30962=0x0;_0xc30962<_0x39ddf2['length'];_0xc30962+=0x1){let _0x375224=_0x39ddf2[_0xc30962];for(var _0x3fd676=0x0;_0x3fd676<_0x375224[_0x83bc('0x65')][_0x83bc('0x37')];_0x3fd676+=0x1){let _0x5d8023=_0x375224[_0x83bc('0x65')][_0x3fd676];var _0x535f18=_0x5198a1[_0x83bc('0x78')]();_0x535f18[_0x83bc('0x3c')]('ut.UserId\x20=\x20?',_0x5d8023['id']);_0x525a03['push'](db[_0x83bc('0x68')]['query'](_0x535f18[_0x83bc('0x79')](),{'type':db[_0x83bc('0x68')]['QueryTypes'][_0x83bc('0x7a')]})['then'](function(_0x4c32dd){if(_0x4c32dd['length']===0x1){return _0x5d8023['id'];}else{var _0x4d03e8=_[_0x83bc('0x7b')](_['map'](_0x4c32dd,_0x83bc('0x7c')),function(_0x3b205b){return _['includes'](_0x3166f6,_0x3b205b);});if(_0x4d03e8){return _0x5d8023['id'];}}}));}}return BPromise[_0x83bc('0x7d')](_0x525a03)[_0x83bc('0x26')](function(_0x1a6538){_0x318346=_(_0x318346)[_0x83bc('0x7e')](_0x1a6538)[_0x83bc('0x7f')]()[_0x83bc('0x80')]();return db[_0x83bc('0x2d')][_0x83bc('0x48')]({'where':{'id':_0x4db112['params']['id']}})[_0x83bc('0x26')](function(_0x592e9b){return db['sequelize'][_0x83bc('0x69')](function(_0x4848e6){return _0x592e9b[_0x83bc('0x70')](_0x4db112[_0x83bc('0x32')][_0x83bc('0x71')],{'transaction':_0x4848e6})[_0x83bc('0x26')](function(){if(!_[_0x83bc('0x81')](_0x318346)){return _0x592e9b['removeAgents'](_0x318346,{'transaction':_0x4848e6});}})[_0x83bc('0x26')](function(){_0x318346[_0x83bc('0x6d')](function(_0x433a16){socket[_0x83bc('0x6e')](_0x83bc('0x82'),{'UserId':_0x433a16,'MailQueueId':_0x592e9b['id']});});});});});});})[_0x83bc('0x26')](respondWithStatusCode(_0x4bf3bc,null))['catch'](handleError(_0x4bf3bc,null));};exports[_0x83bc('0x83')]=function(_0x2eb1b6,_0x5df9fd,_0x59c7b2){return db[_0x83bc('0x2d')][_0x83bc('0x48')]({'where':{'id':_0x2eb1b6[_0x83bc('0x53')]['id']}})['then'](handleEntityNotFound(_0x5df9fd,null))['then'](function(_0x31aad8){if(_0x31aad8){return _0x31aad8[_0x83bc('0x83')](_0x2eb1b6[_0x83bc('0x52')][_0x83bc('0x71')],_[_0x83bc('0x84')](_0x2eb1b6['body'],[_0x83bc('0x71'),'id'])||{})['spread'](function(_0x568290){for(var _0x3a949e=0x0;_0x3a949e<_0x2eb1b6[_0x83bc('0x52')][_0x83bc('0x71')][_0x83bc('0x37')];_0x3a949e+=0x1){socket[_0x83bc('0x6e')]('userMailQueue:save',{'UserId':Number(_0x2eb1b6[_0x83bc('0x52')]['ids'][_0x3a949e]),'MailQueueId':Number(_0x2eb1b6['params']['id'])});}return _0x568290;});}})[_0x83bc('0x26')](respondWithResult(_0x5df9fd,null))[_0x83bc('0x45')](handleError(_0x5df9fd,null));};exports[_0x83bc('0x85')]=function(_0x479f77,_0x446834,_0x11b1b6){return db[_0x83bc('0x2d')]['find']({'where':{'id':_0x479f77[_0x83bc('0x53')]['id']}})[_0x83bc('0x26')](handleEntityNotFound(_0x446834,null))['then'](function(_0x57b676){if(_0x57b676){return _0x57b676[_0x83bc('0x85')](_0x479f77[_0x83bc('0x32')][_0x83bc('0x71')])[_0x83bc('0x26')](function(){if(_[_0x83bc('0x86')](_0x479f77[_0x83bc('0x32')][_0x83bc('0x71')])){for(var _0x2fe1cd=0x0;_0x2fe1cd<_0x479f77[_0x83bc('0x32')][_0x83bc('0x71')][_0x83bc('0x37')];_0x2fe1cd+=0x1){socket[_0x83bc('0x6e')](_0x83bc('0x82'),{'UserId':Number(_0x479f77['query'][_0x83bc('0x71')][_0x2fe1cd]),'MailQueueId':Number(_0x479f77[_0x83bc('0x53')]['id'])});}}else{socket['emit'](_0x83bc('0x82'),{'UserId':Number(_0x479f77[_0x83bc('0x32')][_0x83bc('0x71')]),'MailQueueId':Number(_0x479f77[_0x83bc('0x53')]['id'])});}});}})[_0x83bc('0x26')](respondWithStatusCode(_0x446834,null))['catch'](handleError(_0x446834,null));};exports[_0x83bc('0x87')]=function(_0x3c0b0e,_0x6a9e5f,_0x213b0f){var _0x557dd2={};var _0x878891={};var _0x1808e8;var _0x2260c9;return db['MailQueue'][_0x83bc('0x56')]({'where':{'id':_0x3c0b0e[_0x83bc('0x53')]['id']}})[_0x83bc('0x26')](handleEntityNotFound(_0x6a9e5f,null))[_0x83bc('0x26')](function(_0x4281d7){if(_0x4281d7){_0x1808e8=_0x4281d7;_0x878891['model']=_[_0x83bc('0x47')](db[_0x83bc('0x5b')][_0x83bc('0x2e')]);_0x878891[_0x83bc('0x32')]=_['keys'](_0x3c0b0e[_0x83bc('0x32')]);_0x878891['filters']=_['intersection'](_0x878891[_0x83bc('0x38')],_0x878891[_0x83bc('0x32')]);_0x557dd2['attributes']=_[_0x83bc('0x34')](_0x878891[_0x83bc('0x38')],qs[_0x83bc('0x35')](_0x3c0b0e[_0x83bc('0x32')][_0x83bc('0x35')]));_0x557dd2[_0x83bc('0x36')]=_0x557dd2[_0x83bc('0x36')][_0x83bc('0x37')]?_0x557dd2[_0x83bc('0x36')]:_0x878891[_0x83bc('0x38')];_0x557dd2[_0x83bc('0x3a')]=qs[_0x83bc('0x3b')](_0x3c0b0e[_0x83bc('0x32')][_0x83bc('0x3b')]);_0x557dd2[_0x83bc('0x3c')]=qs[_0x83bc('0x33')](_[_0x83bc('0x59')](_0x3c0b0e[_0x83bc('0x32')],_0x878891['filters']));if(_0x3c0b0e[_0x83bc('0x32')][_0x83bc('0x3d')]){_0x557dd2['where']=_[_0x83bc('0x3e')](_0x557dd2[_0x83bc('0x3c')],{'$or':_[_0x83bc('0x2c')](_0x557dd2[_0x83bc('0x36')],function(_0x4ea159){var _0x1c4c67={};_0x1c4c67[_0x4ea159]={'$like':'%'+_0x3c0b0e[_0x83bc('0x32')]['filter']+'%'};return _0x1c4c67;})});}_0x557dd2=_[_0x83bc('0x3e')]({},_0x557dd2,_0x3c0b0e['options']);return _0x1808e8['getAgents'](_0x557dd2);}})[_0x83bc('0x26')](function(_0x3a9849){if(_0x3a9849){_0x2260c9=_0x3a9849[_0x83bc('0x37')];if(!_0x3c0b0e[_0x83bc('0x32')][_0x83bc('0x58')]('nolimit')){_0x557dd2['limit']=qs[_0x83bc('0x20')](_0x3c0b0e[_0x83bc('0x32')][_0x83bc('0x20')]);_0x557dd2[_0x83bc('0x1e')]=qs[_0x83bc('0x1e')](_0x3c0b0e['query'][_0x83bc('0x1e')]);}return _0x1808e8[_0x83bc('0x87')](_0x557dd2);}})['then'](function(_0x43fd07){if(_0x43fd07){return _0x43fd07?{'count':_0x2260c9,'rows':_0x43fd07}:null;}})[_0x83bc('0x26')](respondWithResult(_0x6a9e5f,null))[_0x83bc('0x45')](handleError(_0x6a9e5f,null));}; \ No newline at end of file +var _0xbe31=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','MailQueues','UserProfileResource','destroy','error','stack','name','send','map','MailQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','MailQueueId','merge','User','findAndCountAll','agent','mailPause','updatedAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','forEach','emit','userMailQueue:save','select','field','from','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','removeTeams','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x1e0070,_0x545b6a){var _0x46003b=function(_0x1c64b9){while(--_0x1c64b9){_0x1e0070['push'](_0x1e0070['shift']());}};_0x46003b(++_0x545b6a);}(_0xbe31,0x83));var _0x1be3=function(_0xf699a2,_0x4b6421){_0xf699a2=_0xf699a2-0x0;var _0x17f686=_0xbe31[_0xf699a2];return _0x17f686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1be3('0x0'));var zipdir=require(_0x1be3('0x1'));var jsonpatch=require(_0x1be3('0x2'));var rp=require(_0x1be3('0x3'));var moment=require(_0x1be3('0x4'));var BPromise=require(_0x1be3('0x5'));var Mustache=require(_0x1be3('0x6'));var util=require(_0x1be3('0x7'));var path=require(_0x1be3('0x8'));var sox=require('sox');var csv=require(_0x1be3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1be3('0xa'));var _=require(_0x1be3('0xb'));var squel=require(_0x1be3('0xc'));var crypto=require(_0x1be3('0xd'));var jsforce=require(_0x1be3('0xe'));var deskjs=require(_0x1be3('0xf'));var toCsv=require(_0x1be3('0x9'));var querystring=require(_0x1be3('0x10'));var Papa=require(_0x1be3('0x11'));var Redis=require(_0x1be3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1be3('0x13'));var as=require(_0x1be3('0x14'));var hardwareService=require(_0x1be3('0x15'));var logger=require(_0x1be3('0x16'))(_0x1be3('0x17'));var utils=require(_0x1be3('0x18'));var config=require(_0x1be3('0x19'));var licenseUtil=require(_0x1be3('0x1a'));var db=require(_0x1be3('0x1b'))['db'];config['redis']=_[_0x1be3('0x1c')](config['redis'],{'host':_0x1be3('0x1d'),'port':0x18eb});var socket=require(_0x1be3('0x1e'))(new Redis(config['redis']));require(_0x1be3('0x1f'))['register'](socket);function respondWithStatusCode(_0xc7cc3,_0x39c80e){_0x39c80e=_0x39c80e||0xcc;return function(_0x3658ce){if(_0x3658ce){return _0xc7cc3[_0x1be3('0x20')](_0x39c80e);}return _0xc7cc3[_0x1be3('0x21')](_0x39c80e)[_0x1be3('0x22')]();};}function respondWithResult(_0x567919,_0x53a9d7){_0x53a9d7=_0x53a9d7||0xc8;return function(_0x5b8971){if(_0x5b8971){return _0x567919['status'](_0x53a9d7)[_0x1be3('0x23')](_0x5b8971);}};}function respondWithFilteredResult(_0x4ebba6,_0x31754b){return function(_0x6b7edf){if(_0x6b7edf){var _0xaa1d7b=typeof _0x31754b[_0x1be3('0x24')]===_0x1be3('0x25')&&typeof _0x31754b[_0x1be3('0x26')]===_0x1be3('0x25');var _0x41c2af=_0x6b7edf[_0x1be3('0x27')];var _0x118b5a=_0xaa1d7b?0x0:_0x31754b[_0x1be3('0x24')];var _0x207697=_0xaa1d7b?_0x6b7edf['count']:_0x31754b['offset']+_0x31754b[_0x1be3('0x26')];var _0x4cacb9;if(_0x207697>=_0x41c2af){_0x207697=_0x41c2af;_0x4cacb9=0xc8;}else{_0x4cacb9=0xce;}_0x4ebba6[_0x1be3('0x21')](_0x4cacb9);return _0x4ebba6[_0x1be3('0x28')](_0x1be3('0x29'),_0x118b5a+'-'+_0x207697+'/'+_0x41c2af)[_0x1be3('0x23')](_0x6b7edf);}return null;};}function patchUpdates(_0x3c0564){return function(_0xc2d08c){try{jsonpatch[_0x1be3('0x2a')](_0xc2d08c,_0x3c0564,!![]);}catch(_0x57c192){return BPromise[_0x1be3('0x2b')](_0x57c192);}return _0xc2d08c['save']();};}function saveUpdates(_0x237a6c,_0x3f277a){return function(_0x579461){if(_0x579461){return _0x579461[_0x1be3('0x2c')](_0x237a6c)['then'](function(_0x134d79){return _0x134d79;});}return null;};}function removeEntity(_0x12023d,_0x393f98){return function(_0x152e49){if(_0x152e49){return _0x152e49['destroy']()[_0x1be3('0x2d')](function(){var _0x8d1f58=_0x152e49['get']({'plain':!![]});var _0x113cc4=_0x1be3('0x2e');return db[_0x1be3('0x2f')][_0x1be3('0x30')]({'where':{'type':_0x113cc4,'resourceId':_0x8d1f58['id']}})[_0x1be3('0x2d')](function(){return _0x152e49;});})[_0x1be3('0x2d')](function(){_0x12023d['status'](0xcc)[_0x1be3('0x22')]();});}};}function handleEntityNotFound(_0x49f0e0,_0x25ed26){return function(_0x4be26f){if(!_0x4be26f){_0x49f0e0[_0x1be3('0x20')](0x194);}return _0x4be26f;};}function handleError(_0x11a193,_0x569e40){_0x569e40=_0x569e40||0x1f4;return function(_0x5426aa){logger[_0x1be3('0x31')](_0x5426aa[_0x1be3('0x32')]);if(_0x5426aa[_0x1be3('0x33')]){delete _0x5426aa[_0x1be3('0x33')];}_0x11a193[_0x1be3('0x21')](_0x569e40)[_0x1be3('0x34')](_0x5426aa);};}exports['index']=function(_0x564f99,_0x55c0cc){var _0x585e5a={},_0x12fbb3={},_0x429aa3={'count':0x0,'rows':[]};var _0x61a3c0=_[_0x1be3('0x35')](db[_0x1be3('0x36')][_0x1be3('0x37')],function(_0x20dd33){return{'name':_0x20dd33['fieldName'],'type':_0x20dd33[_0x1be3('0x38')][_0x1be3('0x39')]};});_0x12fbb3[_0x1be3('0x3a')]=_[_0x1be3('0x35')](_0x61a3c0,_0x1be3('0x33'));_0x12fbb3[_0x1be3('0x3b')]=_[_0x1be3('0x3c')](_0x564f99['query']);_0x12fbb3[_0x1be3('0x3d')]=_[_0x1be3('0x3e')](_0x12fbb3[_0x1be3('0x3a')],_0x12fbb3['query']);_0x585e5a['attributes']=_[_0x1be3('0x3e')](_0x12fbb3[_0x1be3('0x3a')],qs[_0x1be3('0x3f')](_0x564f99['query']['fields']));_0x585e5a['attributes']=_0x585e5a[_0x1be3('0x40')][_0x1be3('0x41')]?_0x585e5a[_0x1be3('0x40')]:_0x12fbb3['model'];if(!_0x564f99[_0x1be3('0x3b')]['hasOwnProperty'](_0x1be3('0x42'))){_0x585e5a[_0x1be3('0x26')]=qs['limit'](_0x564f99[_0x1be3('0x3b')][_0x1be3('0x26')]);_0x585e5a[_0x1be3('0x24')]=qs[_0x1be3('0x24')](_0x564f99[_0x1be3('0x3b')]['offset']);}_0x585e5a[_0x1be3('0x43')]=qs[_0x1be3('0x44')](_0x564f99[_0x1be3('0x3b')]['sort']);_0x585e5a['where']=qs[_0x1be3('0x3d')](_[_0x1be3('0x45')](_0x564f99['query'],_0x12fbb3[_0x1be3('0x3d')]),_0x61a3c0);if(_0x564f99['query'][_0x1be3('0x46')]){_0x585e5a[_0x1be3('0x47')]=_['merge'](_0x585e5a['where'],{'$or':_['map'](_0x61a3c0,function(_0x1166b8){if(_0x1166b8[_0x1be3('0x38')]!==_0x1be3('0x48')){var _0x41b2fb={};_0x41b2fb[_0x1166b8[_0x1be3('0x33')]]={'$like':'%'+_0x564f99['query'][_0x1be3('0x46')]+'%'};return _0x41b2fb;}})});}_0x585e5a=_['merge']({},_0x585e5a,_0x564f99[_0x1be3('0x49')]);var _0x3ecc9b={'where':_0x585e5a[_0x1be3('0x47')]};return db[_0x1be3('0x36')][_0x1be3('0x27')](_0x3ecc9b)['then'](function(_0x31ad7e){_0x429aa3['count']=_0x31ad7e;if(_0x564f99[_0x1be3('0x3b')][_0x1be3('0x4a')]){_0x585e5a[_0x1be3('0x4b')]=[{'all':!![]}];}return db['MailQueue'][_0x1be3('0x4c')](_0x585e5a);})[_0x1be3('0x2d')](function(_0x3718c9){_0x429aa3[_0x1be3('0x4d')]=_0x3718c9;return _0x429aa3;})['then'](respondWithFilteredResult(_0x55c0cc,_0x585e5a))['catch'](handleError(_0x55c0cc,null));};exports[_0x1be3('0x4e')]=function(_0x1e4f14,_0x1f397f){var _0x35deec={'raw':!![],'where':{'id':_0x1e4f14['params']['id']}},_0x46d5d7={};_0x46d5d7[_0x1be3('0x3a')]=_['keys'](db[_0x1be3('0x36')][_0x1be3('0x37')]);_0x46d5d7['query']=_['keys'](_0x1e4f14[_0x1be3('0x3b')]);_0x46d5d7['filters']=_['intersection'](_0x46d5d7[_0x1be3('0x3a')],_0x46d5d7[_0x1be3('0x3b')]);_0x35deec[_0x1be3('0x40')]=_[_0x1be3('0x3e')](_0x46d5d7[_0x1be3('0x3a')],qs['fields'](_0x1e4f14[_0x1be3('0x3b')][_0x1be3('0x3f')]));_0x35deec[_0x1be3('0x40')]=_0x35deec['attributes'][_0x1be3('0x41')]?_0x35deec[_0x1be3('0x40')]:_0x46d5d7[_0x1be3('0x3a')];if(_0x1e4f14['query'][_0x1be3('0x4a')]){_0x35deec[_0x1be3('0x4b')]=[{'all':!![]}];}_0x35deec=_['merge']({},_0x35deec,_0x1e4f14['options']);return db['MailQueue']['find'](_0x35deec)[_0x1be3('0x2d')](handleEntityNotFound(_0x1f397f,null))[_0x1be3('0x2d')](respondWithResult(_0x1f397f,null))[_0x1be3('0x4f')](handleError(_0x1f397f,null));};exports[_0x1be3('0x50')]=function(_0x3baf5e,_0x392a61){return db[_0x1be3('0x36')][_0x1be3('0x50')](_0x3baf5e[_0x1be3('0x51')],{})[_0x1be3('0x2d')](function(_0x55514e){var _0x4578eb=_0x3baf5e[_0x1be3('0x52')][_0x1be3('0x53')]({'plain':!![]});if(!_0x4578eb)throw new Error(_0x1be3('0x54'));if(_0x4578eb[_0x1be3('0x55')]===_0x1be3('0x52')){var _0x4c6df3=_0x55514e[_0x1be3('0x53')]({'plain':!![]});var _0x50a137=_0x1be3('0x2e');return db[_0x1be3('0x56')][_0x1be3('0x57')]({'where':{'name':_0x50a137,'userProfileId':_0x4578eb[_0x1be3('0x58')]},'raw':!![]})['then'](function(_0x537fd2){if(_0x537fd2&&_0x537fd2[_0x1be3('0x59')]===0x0){return db[_0x1be3('0x2f')][_0x1be3('0x50')]({'name':_0x4c6df3[_0x1be3('0x33')],'resourceId':_0x4c6df3['id'],'type':_0x537fd2[_0x1be3('0x33')],'sectionId':_0x537fd2['id']},{})['then'](function(){return _0x55514e;});}else{return _0x55514e;}})[_0x1be3('0x4f')](function(_0x17df1f){logger[_0x1be3('0x31')](_0x1be3('0x5a'),_0x17df1f);throw _0x17df1f;});}return _0x55514e;})[_0x1be3('0x2d')](respondWithResult(_0x392a61,0xc9))['catch'](handleError(_0x392a61,null));};exports[_0x1be3('0x2c')]=function(_0x54b513,_0x323d41){if(_0x54b513[_0x1be3('0x51')]['id']){delete _0x54b513[_0x1be3('0x51')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x54b513[_0x1be3('0x5b')]['id']}})[_0x1be3('0x2d')](handleEntityNotFound(_0x323d41,null))[_0x1be3('0x2d')](saveUpdates(_0x54b513['body'],null))[_0x1be3('0x2d')](respondWithResult(_0x323d41,null))[_0x1be3('0x4f')](handleError(_0x323d41,null));};exports['destroy']=function(_0x19c9b8,_0x4b6cb5){return db[_0x1be3('0x36')][_0x1be3('0x57')]({'where':{'id':_0x19c9b8[_0x1be3('0x5b')]['id']}})[_0x1be3('0x2d')](handleEntityNotFound(_0x4b6cb5,null))[_0x1be3('0x2d')](removeEntity(_0x4b6cb5,null))[_0x1be3('0x4f')](handleError(_0x4b6cb5,null));};exports[_0x1be3('0x5c')]=function(_0x11ca23,_0x3536ae){return db[_0x1be3('0x36')]['describe']()[_0x1be3('0x2d')](respondWithResult(_0x3536ae,null))[_0x1be3('0x4f')](handleError(_0x3536ae,null));};exports[_0x1be3('0x5d')]=function(_0xf1b220,_0x3c97ed,_0x3c4941){var _0x206a6c={'raw':!![],'where':{}},_0xd7f700={},_0x541509;return db[_0x1be3('0x36')][_0x1be3('0x5e')]({'where':{'id':_0xf1b220['params']['id']}})['then'](handleEntityNotFound(_0x3c97ed,null))[_0x1be3('0x2d')](function(_0x45ff1c){if(_0x45ff1c){_0x541509=_0x45ff1c[_0x1be3('0x53')]({'plain':!![]});_0xd7f700['model']=_[_0x1be3('0x3c')](db[_0x1be3('0x5f')][_0x1be3('0x37')]);_0xd7f700[_0x1be3('0x3b')]=_[_0x1be3('0x3c')](_0xf1b220[_0x1be3('0x3b')]);_0xd7f700[_0x1be3('0x3d')]=_['intersection'](_0xd7f700['model'],_0xd7f700[_0x1be3('0x3b')]);_0x206a6c[_0x1be3('0x40')]=_[_0x1be3('0x3e')](_0xd7f700['model'],qs['fields'](_0xf1b220[_0x1be3('0x3b')]['fields']));_0x206a6c[_0x1be3('0x40')]=_0x206a6c[_0x1be3('0x40')][_0x1be3('0x41')]?_0x206a6c[_0x1be3('0x40')]:_0xd7f700[_0x1be3('0x3a')];if(!_0xf1b220[_0x1be3('0x3b')][_0x1be3('0x60')](_0x1be3('0x42'))){_0x206a6c['limit']=qs[_0x1be3('0x26')](_0xf1b220[_0x1be3('0x3b')][_0x1be3('0x26')]);_0x206a6c[_0x1be3('0x24')]=qs[_0x1be3('0x24')](_0xf1b220['query'][_0x1be3('0x24')]);}_0x206a6c[_0x1be3('0x43')]=qs[_0x1be3('0x44')](_0xf1b220[_0x1be3('0x3b')][_0x1be3('0x44')]);_0x206a6c[_0x1be3('0x47')]=qs[_0x1be3('0x3d')](_[_0x1be3('0x45')](_0xf1b220[_0x1be3('0x3b')],_0xd7f700[_0x1be3('0x3d')]));_0x206a6c[_0x1be3('0x47')][_0x1be3('0x61')]=_0x45ff1c['id'];if(_0xf1b220[_0x1be3('0x3b')][_0x1be3('0x46')]){_0x206a6c['where']=_['merge'](_0x206a6c[_0x1be3('0x47')],{'$or':_[_0x1be3('0x35')](_0x206a6c[_0x1be3('0x40')],function(_0x25d489){var _0x18eb6f={};_0x18eb6f[_0x25d489]={'$like':'%'+_0xf1b220[_0x1be3('0x3b')][_0x1be3('0x46')]+'%'};return _0x18eb6f;})});}_0x206a6c=_[_0x1be3('0x62')]({},_0x206a6c,_0xf1b220[_0x1be3('0x49')]);return db[_0x1be3('0x5f')][_0x1be3('0x4c')](_0x206a6c);}})[_0x1be3('0x2d')](function(_0x905832){if(_0x905832){return db[_0x1be3('0x63')][_0x1be3('0x64')]({'where':{'id':_[_0x1be3('0x35')](_0x905832,'UserId'),'role':_0x1be3('0x65')},'attributes':['id',_0x1be3('0x33'),_0x1be3('0x66'),'updatedAt','createdAt']});}})[_0x1be3('0x2d')](function(_0x45f545){if(_0x45f545){return{'count':_0x45f545['count'],'rows':_['map'](_0x45f545['rows'],function(_0x230275){return{'membername':_0x230275[_0x1be3('0x33')],'UserId':_0x230275['id'],'queue_name':_0x541509[_0x1be3('0x33')],'MailQueueId':_0x541509['id'],'interface':util['format']('%s/%s','SIP',_0x230275[_0x1be3('0x33')]),'penalty':0x0,'paused':_0x230275[_0x1be3('0x66')],'createdAt':_0x230275['createdAt'],'updatedAt':_0x230275[_0x1be3('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3c97ed,_0x206a6c))[_0x1be3('0x4f')](handleError(_0x3c97ed,null));};exports['getTeams']=function(_0x14b2ce,_0x2c3c76,_0x4b805f){var _0x596055={};var _0x2cb6b1={};var _0x675b02;var _0x1de55e;return db[_0x1be3('0x36')][_0x1be3('0x5e')]({'where':{'id':_0x14b2ce[_0x1be3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2c3c76,null))['then'](function(_0x8b9b25){if(_0x8b9b25){_0x675b02=_0x8b9b25;_0x2cb6b1[_0x1be3('0x3a')]=_[_0x1be3('0x3c')](db[_0x1be3('0x68')]['rawAttributes']);_0x2cb6b1[_0x1be3('0x3b')]=_[_0x1be3('0x3c')](_0x14b2ce[_0x1be3('0x3b')]);_0x2cb6b1['filters']=_['intersection'](_0x2cb6b1[_0x1be3('0x3a')],_0x2cb6b1['query']);_0x596055[_0x1be3('0x40')]=_[_0x1be3('0x3e')](_0x2cb6b1[_0x1be3('0x3a')],qs['fields'](_0x14b2ce[_0x1be3('0x3b')][_0x1be3('0x3f')]));_0x596055['attributes']=_0x596055[_0x1be3('0x40')][_0x1be3('0x41')]?_0x596055[_0x1be3('0x40')]:_0x2cb6b1[_0x1be3('0x3a')];_0x596055[_0x1be3('0x43')]=qs[_0x1be3('0x44')](_0x14b2ce[_0x1be3('0x3b')][_0x1be3('0x44')]);_0x596055[_0x1be3('0x47')]=qs[_0x1be3('0x3d')](_['pick'](_0x14b2ce['query'],_0x2cb6b1[_0x1be3('0x3d')]));if(_0x14b2ce[_0x1be3('0x3b')]['filter']){_0x596055[_0x1be3('0x47')]=_[_0x1be3('0x62')](_0x596055[_0x1be3('0x47')],{'$or':_[_0x1be3('0x35')](_0x596055['attributes'],function(_0x1c969d){var _0xab7550={};_0xab7550[_0x1c969d]={'$like':'%'+_0x14b2ce[_0x1be3('0x3b')][_0x1be3('0x46')]+'%'};return _0xab7550;})});}_0x596055=_[_0x1be3('0x62')]({},_0x596055,_0x14b2ce['options']);return _0x675b02['getTeams'](_0x596055);}})[_0x1be3('0x2d')](function(_0x156cd7){if(_0x156cd7){_0x1de55e=_0x156cd7[_0x1be3('0x41')];if(!_0x14b2ce[_0x1be3('0x3b')][_0x1be3('0x60')](_0x1be3('0x42'))){_0x596055[_0x1be3('0x26')]=qs['limit'](_0x14b2ce[_0x1be3('0x3b')][_0x1be3('0x26')]);_0x596055[_0x1be3('0x24')]=qs[_0x1be3('0x24')](_0x14b2ce[_0x1be3('0x3b')][_0x1be3('0x24')]);}return _0x675b02[_0x1be3('0x69')](_0x596055);}})[_0x1be3('0x2d')](function(_0x19619f){if(_0x19619f){return _0x19619f?{'count':_0x1de55e,'rows':_0x19619f}:null;}})[_0x1be3('0x2d')](respondWithResult(_0x2c3c76,null))['catch'](handleError(_0x2c3c76,null));};exports[_0x1be3('0x6a')]=function(_0x1cb108,_0xff80f3,_0x1ae350){var _0x4b7f70=_0x1cb108[_0x1be3('0x51')][_0x1be3('0x6b')];return db[_0x1be3('0x68')][_0x1be3('0x4c')]({'where':{'id':_0x4b7f70},'attributes':['id'],'include':[{'model':db[_0x1be3('0x63')],'as':_0x1be3('0x6c'),'attributes':['id',_0x1be3('0x33'),_0x1be3('0x6d'),_0x1be3('0x6e'),_0x1be3('0x6f')],'raw':!![]}]})[_0x1be3('0x2d')](function(_0x4ee551){if(_0x4ee551){var _0x161d18=_[_0x1be3('0x70')](_0x4ee551,function(_0x5e719c){var _0x51e822=_0x5e719c[_0x1be3('0x53')]({'plain':!![]});return _0x51e822['Agents'];});return db[_0x1be3('0x36')][_0x1be3('0x57')]({'where':{'id':_0x1cb108[_0x1be3('0x5b')]['id']}})[_0x1be3('0x2d')](function(_0x3affdf){return db['sequelize']['transaction'](function(_0x20e5fa){return _0x3affdf[_0x1be3('0x6a')](_0x4b7f70,{'transaction':_0x20e5fa})[_0x1be3('0x2d')](function(){return BPromise['each'](_0x161d18,function(_0x54eaf2){return db[_0x1be3('0x5f')]['findOrCreate']({'where':{'UserId':_0x54eaf2['id'],'MailQueueId':_0x1cb108[_0x1be3('0x5b')]['id']},'transaction':_0x20e5fa});});})[_0x1be3('0x2d')](function(){_0x161d18[_0x1be3('0x71')](function(_0x51c13a){socket[_0x1be3('0x72')](_0x1be3('0x73'),{'UserId':_0x51c13a['id'],'MailQueueId':_0x3affdf['id']});});});});});}})[_0x1be3('0x2d')](respondWithStatusCode(_0xff80f3,null))[_0x1be3('0x4f')](handleError(_0xff80f3,null));};exports['removeTeams']=function(_0x1b4ae5,_0x41abf1,_0x2487af){return db[_0x1be3('0x68')][_0x1be3('0x4c')]({'where':{'id':_0x1b4ae5[_0x1be3('0x3b')][_0x1be3('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x1be3('0x63')],'as':_0x1be3('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x1be3('0x2d')](handleEntityNotFound(_0x41abf1,null))[_0x1be3('0x2d')](function(_0x557a45){var _0x50fca7=_[_0x1be3('0x35')](_0x557a45,'id');var _0x3217a5=[];var _0x35f144=[];var _0x15f5a3=squel[_0x1be3('0x74')]();_0x15f5a3[_0x1be3('0x75')]('tq.TeamId')[_0x1be3('0x76')](_0x1be3('0x77'),'tq')['join'](_0x1be3('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x1be3('0x79'),_0x1b4ae5[_0x1be3('0x5b')]['id']);for(var _0x36becd=0x0;_0x36becd<_0x557a45[_0x1be3('0x41')];_0x36becd+=0x1){let _0x28a795=_0x557a45[_0x36becd];for(var _0x3db82b=0x0;_0x3db82b<_0x28a795[_0x1be3('0x6c')][_0x1be3('0x41')];_0x3db82b+=0x1){let _0x668301=_0x28a795['Agents'][_0x3db82b];var _0x5efe5a=_0x15f5a3[_0x1be3('0x7a')]();_0x5efe5a[_0x1be3('0x47')](_0x1be3('0x7b'),_0x668301['id']);_0x35f144['push'](db[_0x1be3('0x7c')]['query'](_0x5efe5a[_0x1be3('0x7d')](),{'type':db['sequelize'][_0x1be3('0x7e')][_0x1be3('0x7f')]})[_0x1be3('0x2d')](function(_0x3257fb){if(_0x3257fb[_0x1be3('0x41')]===0x1){return _0x668301['id'];}else{var _0x4316e0=_['every'](_[_0x1be3('0x35')](_0x3257fb,_0x1be3('0x80')),function(_0x11b2e4){return _['includes'](_0x50fca7,_0x11b2e4);});if(_0x4316e0){return _0x668301['id'];}}}));}}return BPromise[_0x1be3('0x81')](_0x35f144)[_0x1be3('0x2d')](function(_0x2b0a1b){_0x3217a5=_(_0x3217a5)[_0x1be3('0x82')](_0x2b0a1b)[_0x1be3('0x83')]()[_0x1be3('0x84')]();return db['MailQueue']['find']({'where':{'id':_0x1b4ae5[_0x1be3('0x5b')]['id']}})[_0x1be3('0x2d')](function(_0x2250ca){return db['sequelize']['transaction'](function(_0x348881){return _0x2250ca[_0x1be3('0x85')](_0x1b4ae5[_0x1be3('0x3b')][_0x1be3('0x6b')],{'transaction':_0x348881})[_0x1be3('0x2d')](function(){if(!_['isEmpty'](_0x3217a5)){return _0x2250ca[_0x1be3('0x86')](_0x3217a5,{'transaction':_0x348881});}})[_0x1be3('0x2d')](function(){_0x3217a5['forEach'](function(_0x36129b){socket[_0x1be3('0x72')](_0x1be3('0x87'),{'UserId':_0x36129b,'MailQueueId':_0x2250ca['id']});});});});});});})['then'](respondWithStatusCode(_0x41abf1,null))[_0x1be3('0x4f')](handleError(_0x41abf1,null));};exports[_0x1be3('0x88')]=function(_0x440fe4,_0xa6c6c6,_0x6eb149){return db[_0x1be3('0x36')][_0x1be3('0x57')]({'where':{'id':_0x440fe4['params']['id']}})['then'](handleEntityNotFound(_0xa6c6c6,null))[_0x1be3('0x2d')](function(_0x2cc3a2){if(_0x2cc3a2){return _0x2cc3a2[_0x1be3('0x88')](_0x440fe4[_0x1be3('0x51')]['ids'],_[_0x1be3('0x89')](_0x440fe4['body'],['ids','id'])||{})[_0x1be3('0x8a')](function(_0x3a439c){for(var _0x520bdb=0x0;_0x520bdb<_0x440fe4['body'][_0x1be3('0x6b')]['length'];_0x520bdb+=0x1){socket['emit'](_0x1be3('0x73'),{'UserId':Number(_0x440fe4[_0x1be3('0x51')][_0x1be3('0x6b')][_0x520bdb]),'MailQueueId':Number(_0x440fe4[_0x1be3('0x5b')]['id'])});}return _0x3a439c;});}})[_0x1be3('0x2d')](respondWithResult(_0xa6c6c6,null))[_0x1be3('0x4f')](handleError(_0xa6c6c6,null));};exports['removeAgents']=function(_0x2808fa,_0x4617de,_0x3a1a2f){return db[_0x1be3('0x36')]['find']({'where':{'id':_0x2808fa[_0x1be3('0x5b')]['id']}})[_0x1be3('0x2d')](handleEntityNotFound(_0x4617de,null))[_0x1be3('0x2d')](function(_0x55f9ec){if(_0x55f9ec){return _0x55f9ec[_0x1be3('0x86')](_0x2808fa['query'][_0x1be3('0x6b')])[_0x1be3('0x2d')](function(){if(_[_0x1be3('0x8b')](_0x2808fa[_0x1be3('0x3b')][_0x1be3('0x6b')])){for(var _0x15871d=0x0;_0x15871d<_0x2808fa[_0x1be3('0x3b')][_0x1be3('0x6b')][_0x1be3('0x41')];_0x15871d+=0x1){socket['emit'](_0x1be3('0x87'),{'UserId':Number(_0x2808fa['query'][_0x1be3('0x6b')][_0x15871d]),'MailQueueId':Number(_0x2808fa[_0x1be3('0x5b')]['id'])});}}else{socket['emit'](_0x1be3('0x87'),{'UserId':Number(_0x2808fa['query'][_0x1be3('0x6b')]),'MailQueueId':Number(_0x2808fa[_0x1be3('0x5b')]['id'])});}});}})[_0x1be3('0x2d')](respondWithStatusCode(_0x4617de,null))[_0x1be3('0x4f')](handleError(_0x4617de,null));};exports[_0x1be3('0x8c')]=function(_0x14588b,_0x5cee37,_0x51821f){var _0x5d48ea={};var _0x41a582={};var _0x548b9f;var _0x591744;return db['MailQueue'][_0x1be3('0x5e')]({'where':{'id':_0x14588b[_0x1be3('0x5b')]['id']}})[_0x1be3('0x2d')](handleEntityNotFound(_0x5cee37,null))[_0x1be3('0x2d')](function(_0x289a6f){if(_0x289a6f){_0x548b9f=_0x289a6f;_0x41a582[_0x1be3('0x3a')]=_['keys'](db[_0x1be3('0x63')]['rawAttributes']);_0x41a582['query']=_[_0x1be3('0x3c')](_0x14588b[_0x1be3('0x3b')]);_0x41a582['filters']=_[_0x1be3('0x3e')](_0x41a582[_0x1be3('0x3a')],_0x41a582[_0x1be3('0x3b')]);_0x5d48ea[_0x1be3('0x40')]=_[_0x1be3('0x3e')](_0x41a582[_0x1be3('0x3a')],qs[_0x1be3('0x3f')](_0x14588b[_0x1be3('0x3b')][_0x1be3('0x3f')]));_0x5d48ea[_0x1be3('0x40')]=_0x5d48ea[_0x1be3('0x40')][_0x1be3('0x41')]?_0x5d48ea[_0x1be3('0x40')]:_0x41a582['model'];_0x5d48ea['order']=qs[_0x1be3('0x44')](_0x14588b[_0x1be3('0x3b')][_0x1be3('0x44')]);_0x5d48ea['where']=qs[_0x1be3('0x3d')](_[_0x1be3('0x45')](_0x14588b[_0x1be3('0x3b')],_0x41a582[_0x1be3('0x3d')]));if(_0x14588b['query'][_0x1be3('0x46')]){_0x5d48ea[_0x1be3('0x47')]=_[_0x1be3('0x62')](_0x5d48ea[_0x1be3('0x47')],{'$or':_[_0x1be3('0x35')](_0x5d48ea[_0x1be3('0x40')],function(_0x2441c9){var _0x1f595c={};_0x1f595c[_0x2441c9]={'$like':'%'+_0x14588b['query'][_0x1be3('0x46')]+'%'};return _0x1f595c;})});}_0x5d48ea=_[_0x1be3('0x62')]({},_0x5d48ea,_0x14588b[_0x1be3('0x49')]);return _0x548b9f[_0x1be3('0x8c')](_0x5d48ea);}})[_0x1be3('0x2d')](function(_0xa2d3dc){if(_0xa2d3dc){_0x591744=_0xa2d3dc[_0x1be3('0x41')];if(!_0x14588b[_0x1be3('0x3b')]['hasOwnProperty'](_0x1be3('0x42'))){_0x5d48ea[_0x1be3('0x26')]=qs[_0x1be3('0x26')](_0x14588b[_0x1be3('0x3b')][_0x1be3('0x26')]);_0x5d48ea['offset']=qs[_0x1be3('0x24')](_0x14588b[_0x1be3('0x3b')][_0x1be3('0x24')]);}return _0x548b9f[_0x1be3('0x8c')](_0x5d48ea);}})[_0x1be3('0x2d')](function(_0x2bde47){if(_0x2bde47){return _0x2bde47?{'count':_0x591744,'rows':_0x2bde47}:null;}})[_0x1be3('0x2d')](respondWithResult(_0x5cee37,null))[_0x1be3('0x4f')](handleError(_0x5cee37,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 1774350..c7726e1 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 _0x88ac=['exports','events','../../mysqldb','MailQueue','remove','emit','hook'];(function(_0x3fd662,_0x53df4d){var _0x1ccb01=function(_0x405c60){while(--_0x405c60){_0x3fd662['push'](_0x3fd662['shift']());}};_0x1ccb01(++_0x53df4d);}(_0x88ac,0x78));var _0xc88a=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0x88ac[_0x28f1de];return _0x5b5dad;};'use strict';var EventEmitter=require(_0xc88a('0x0'));var MailQueue=require(_0xc88a('0x1'))['db'][_0xc88a('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc88a('0x3')};function emitEvent(_0x21c39a){return function(_0x3bdc03,_0x3c03ba,_0x3b9b52){MailQueueEvents[_0xc88a('0x4')](_0x21c39a+':'+_0x3bdc03['id'],_0x3bdc03);MailQueueEvents[_0xc88a('0x4')](_0x21c39a,_0x3bdc03);_0x3b9b52(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xc88a('0x5')](e,emitEvent(event));}}module[_0xc88a('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x8142=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x361a63,_0x2142f8){var _0x491b4c=function(_0x7b0567){while(--_0x7b0567){_0x361a63['push'](_0x361a63['shift']());}};_0x491b4c(++_0x2142f8);}(_0x8142,0x7b));var _0x2814=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x8142[_0x1cb18a];return _0x22442e;};'use strict';var EventEmitter=require(_0x2814('0x0'));var MailQueue=require(_0x2814('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2814('0x2')](0x0);var events={'afterCreate':_0x2814('0x3'),'afterUpdate':_0x2814('0x4'),'afterDestroy':_0x2814('0x5')};function emitEvent(_0x444710){return function(_0x55c5e3,_0x11264b,_0x3201cb){MailQueueEvents[_0x2814('0x6')](_0x444710+':'+_0x55c5e3['id'],_0x55c5e3);MailQueueEvents[_0x2814('0x6')](_0x444710,_0x55c5e3);_0x3201cb(null);};}for(var e in events){if(events[_0x2814('0x7')](e)){var event=events[e];MailQueue[_0x2814('0x8')](e,emitEvent(event));}}module[_0x2814('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f95a151..053ed20 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 _0xbaf7=['./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x31d16e,_0x256a9e){var _0x292053=function(_0x5e30d6){while(--_0x5e30d6){_0x31d16e['push'](_0x31d16e['shift']());}};_0x292053(++_0x256a9e);}(_0xbaf7,0xf4));var _0x7baf=function(_0x527d05,_0x1eccc3){_0x527d05=_0x527d05-0x0;var _0x453afd=_0xbaf7[_0x527d05];return _0x453afd;};'use strict';var _=require(_0x7baf('0x0'));var util=require('util');var logger=require(_0x7baf('0x1'))(_0x7baf('0x2'));var moment=require(_0x7baf('0x3'));var BPromise=require('bluebird');var rp=require(_0x7baf('0x4'));var fs=require('fs');var path=require(_0x7baf('0x5'));var rimraf=require(_0x7baf('0x6'));var config=require(_0x7baf('0x7'));var attributes=require(_0x7baf('0x8'));module[_0x7baf('0x9')]=function(_0x4de142,_0x1b0c18){return _0x4de142['define'](_0x7baf('0xa'),attributes,{'tableName':_0x7baf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd655=['mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailQueue'];(function(_0xb165e9,_0x181646){var _0x58d69f=function(_0x50c3f4){while(--_0x50c3f4){_0xb165e9['push'](_0xb165e9['shift']());}};_0x58d69f(++_0x181646);}(_0xd655,0xb5));var _0x5d65=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0xd655[_0x119cd8];return _0x7072a3;};'use strict';var _=require(_0x5d65('0x0'));var util=require(_0x5d65('0x1'));var logger=require('../../config/logger')(_0x5d65('0x2'));var moment=require(_0x5d65('0x3'));var BPromise=require(_0x5d65('0x4'));var rp=require(_0x5d65('0x5'));var fs=require('fs');var path=require(_0x5d65('0x6'));var rimraf=require(_0x5d65('0x7'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x5d65('0x8')]=function(_0x394cc5,_0x58bad7){return _0x394cc5[_0x5d65('0x9')](_0x5d65('0xa'),attributes,{'tableName':_0x5d65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 151f7be..bb9551c 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 _0x7799=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailQueue','options','where','limit','include','map','model','attributes','catch','ShowMailQueue','find','raw','lodash','moment'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x7799,0xbc));var _0x9779=function(_0x4bfb87,_0x2ed356){_0x4bfb87=_0x4bfb87-0x0;var _0x2b4e25=_0x7799[_0x4bfb87];return _0x2b4e25;};'use strict';var _=require(_0x9779('0x0'));var util=require('util');var moment=require(_0x9779('0x1'));var BPromise=require(_0x9779('0x2'));var rs=require(_0x9779('0x3'));var fs=require('fs');var Redis=require(_0x9779('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9779('0x5'));var logger=require(_0x9779('0x6'))(_0x9779('0x7'));var config=require(_0x9779('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9779('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9779('0xa')],{'host':_0x9779('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9779('0xa')]));require(_0x9779('0xc'))[_0x9779('0xd')](socket);function respondWithRpcPromise(_0x2ab8c8,_0x2bed54,_0x307663){return new BPromise(function(_0xa66a3b,_0x1987f1){return client[_0x9779('0xe')](_0x2ab8c8,_0x307663)[_0x9779('0xf')](function(_0x18f48a){logger[_0x9779('0x10')](_0x9779('0x11'),_0x2bed54,_0x9779('0x12'));logger[_0x9779('0x13')](_0x9779('0x14'),_0x2bed54,_0x9779('0x12'),JSON[_0x9779('0x15')](_0x18f48a));if(_0x18f48a[_0x9779('0x16')]){if(_0x18f48a[_0x9779('0x16')][_0x9779('0x17')]===0x1f4){logger[_0x9779('0x16')](_0x9779('0x11'),_0x2bed54,_0x18f48a[_0x9779('0x16')]['message']);return _0x1987f1(_0x18f48a['error'][_0x9779('0x18')]);}logger['error'](_0x9779('0x11'),_0x2bed54,_0x18f48a[_0x9779('0x16')][_0x9779('0x18')]);return _0xa66a3b(_0x18f48a[_0x9779('0x16')][_0x9779('0x18')]);}else{logger['info'](_0x9779('0x11'),_0x2bed54,_0x9779('0x12'));_0xa66a3b(_0x18f48a[_0x9779('0x19')][_0x9779('0x18')]);}})['catch'](function(_0x15dbcc){logger['error']('MailQueue,\x20%s,\x20%s',_0x2bed54,_0x15dbcc);_0x1987f1(_0x15dbcc);});});}exports[_0x9779('0x1a')]=function(_0x45b47a){var _0x1caba2=this;return new Promise(function(_0x141ff3,_0x247556){return db['MailQueue']['findAll']({'raw':_0x45b47a[_0x9779('0x1b')]?_0x45b47a['options']['raw']===undefined?!![]:![]:!![],'where':_0x45b47a[_0x9779('0x1b')]?_0x45b47a['options'][_0x9779('0x1c')]||null:null,'attributes':_0x45b47a[_0x9779('0x1b')]?_0x45b47a[_0x9779('0x1b')]['attributes']||null:null,'limit':_0x45b47a[_0x9779('0x1b')]?_0x45b47a['options'][_0x9779('0x1d')]||null:null,'include':_0x45b47a[_0x9779('0x1b')]?_0x45b47a[_0x9779('0x1b')][_0x9779('0x1e')]?_[_0x9779('0x1f')](_0x45b47a['options'][_0x9779('0x1e')],function(_0x2215db){return{'model':db[_0x2215db[_0x9779('0x20')]],'as':_0x2215db['as'],'attributes':_0x2215db[_0x9779('0x21')],'include':_0x2215db[_0x9779('0x1e')]?_[_0x9779('0x1f')](_0x2215db[_0x9779('0x1e')],function(_0x1bdfd9){return{'model':db[_0x1bdfd9[_0x9779('0x20')]],'as':_0x1bdfd9['as'],'attributes':_0x1bdfd9[_0x9779('0x21')],'include':_0x1bdfd9[_0x9779('0x1e')]?_[_0x9779('0x1f')](_0x1bdfd9[_0x9779('0x1e')],function(_0x4a4370){return{'model':db[_0x4a4370[_0x9779('0x20')]],'as':_0x4a4370['as'],'attributes':_0x4a4370['attributes']};}):[]};}):[]};}):[]:[]})[_0x9779('0xf')](function(_0x284fb5){logger[_0x9779('0x10')](_0x9779('0x1a'),_0x45b47a);logger[_0x9779('0x13')](_0x9779('0x1a'),_0x45b47a,JSON['stringify'](_0x284fb5));_0x141ff3(_0x284fb5);})[_0x9779('0x22')](function(_0x14b8d1){logger[_0x9779('0x16')](_0x9779('0x1a'),_0x14b8d1[_0x9779('0x18')],_0x45b47a);_0x247556(_0x1caba2[_0x9779('0x16')](0x1f4,_0x14b8d1[_0x9779('0x18')]));});});};exports[_0x9779('0x23')]=function(_0x40e3f8){var _0x57569d=this;return new Promise(function(_0x1ee991,_0x3b1e45){return db['MailQueue'][_0x9779('0x24')]({'raw':_0x40e3f8[_0x9779('0x1b')]?_0x40e3f8[_0x9779('0x1b')][_0x9779('0x25')]===undefined?!![]:![]:!![],'where':_0x40e3f8[_0x9779('0x1b')]?_0x40e3f8[_0x9779('0x1b')]['where']||null:null,'attributes':_0x40e3f8['options']?_0x40e3f8[_0x9779('0x1b')][_0x9779('0x21')]||null:null,'include':_0x40e3f8[_0x9779('0x1b')]?_0x40e3f8[_0x9779('0x1b')][_0x9779('0x1e')]?_[_0x9779('0x1f')](_0x40e3f8['options']['include'],function(_0x421c58){return{'model':db[_0x421c58[_0x9779('0x20')]],'as':_0x421c58['as'],'attributes':_0x421c58[_0x9779('0x21')],'include':_0x421c58[_0x9779('0x1e')]?_['map'](_0x421c58[_0x9779('0x1e')],function(_0x174004){return{'model':db[_0x174004[_0x9779('0x20')]],'as':_0x174004['as'],'attributes':_0x174004['attributes'],'include':_0x174004[_0x9779('0x1e')]?_['map'](_0x174004['include'],function(_0x23d055){return{'model':db[_0x23d055['model']],'as':_0x23d055['as'],'attributes':_0x23d055[_0x9779('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9779('0xf')](function(_0x1bd91b){logger[_0x9779('0x10')](_0x9779('0x23'),_0x40e3f8);logger[_0x9779('0x13')](_0x9779('0x23'),_0x40e3f8,JSON[_0x9779('0x15')](_0x1bd91b));_0x1ee991(_0x1bd91b);})['catch'](function(_0x56b55a){logger['error'](_0x9779('0x23'),_0x56b55a['message'],_0x40e3f8);_0x3b1e45(_0x57569d[_0x9779('0x16')](0x1f4,_0x56b55a[_0x9779('0x18')]));});});}; \ No newline at end of file +var _0x6224=['findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue'];(function(_0x48f692,_0x3c118f){var _0xe1d492=function(_0x3e756d){while(--_0x3e756d){_0x48f692['push'](_0x48f692['shift']());}};_0xe1d492(++_0x3c118f);}(_0x6224,0xd3));var _0x4622=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x6224[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require(_0x4622('0x0'));var util=require(_0x4622('0x1'));var moment=require('moment');var BPromise=require(_0x4622('0x2'));var rs=require(_0x4622('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4622('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4622('0x5'))(_0x4622('0x6'));var config=require(_0x4622('0x7'));var jayson=require(_0x4622('0x8'));var client=jayson[_0x4622('0x9')]['http']({'port':0x232a});config['redis']=_[_0x4622('0xa')](config['redis'],{'host':_0x4622('0xb'),'port':0x18eb});var socket=require(_0x4622('0xc'))(new Redis(config[_0x4622('0xd')]));require('./mailQueue.socket')[_0x4622('0xe')](socket);function respondWithRpcPromise(_0x391106,_0x91e89c,_0x295af7){return new BPromise(function(_0x52b791,_0x3951d5){return client['request'](_0x391106,_0x295af7)[_0x4622('0xf')](function(_0x1f7166){logger[_0x4622('0x10')](_0x4622('0x11'),_0x91e89c,_0x4622('0x12'));logger[_0x4622('0x13')](_0x4622('0x14'),_0x91e89c,_0x4622('0x12'),JSON[_0x4622('0x15')](_0x1f7166));if(_0x1f7166[_0x4622('0x16')]){if(_0x1f7166[_0x4622('0x16')][_0x4622('0x17')]===0x1f4){logger[_0x4622('0x16')](_0x4622('0x11'),_0x91e89c,_0x1f7166['error'][_0x4622('0x18')]);return _0x3951d5(_0x1f7166[_0x4622('0x16')][_0x4622('0x18')]);}logger[_0x4622('0x16')](_0x4622('0x11'),_0x91e89c,_0x1f7166[_0x4622('0x16')][_0x4622('0x18')]);return _0x52b791(_0x1f7166['error']['message']);}else{logger[_0x4622('0x10')](_0x4622('0x11'),_0x91e89c,_0x4622('0x12'));_0x52b791(_0x1f7166[_0x4622('0x19')]['message']);}})[_0x4622('0x1a')](function(_0x339d24){logger[_0x4622('0x16')](_0x4622('0x11'),_0x91e89c,_0x339d24);_0x3951d5(_0x339d24);});});}exports[_0x4622('0x1b')]=function(_0x3783d8){var _0x6e93d5=this;return new Promise(function(_0x43ac4d,_0x508b89){return db[_0x4622('0x1c')][_0x4622('0x1d')]({'raw':_0x3783d8[_0x4622('0x1e')]?_0x3783d8[_0x4622('0x1e')][_0x4622('0x1f')]===undefined?!![]:![]:!![],'where':_0x3783d8[_0x4622('0x1e')]?_0x3783d8[_0x4622('0x1e')][_0x4622('0x20')]||null:null,'attributes':_0x3783d8['options']?_0x3783d8['options'][_0x4622('0x21')]||null:null,'limit':_0x3783d8['options']?_0x3783d8[_0x4622('0x1e')][_0x4622('0x22')]||null:null,'include':_0x3783d8['options']?_0x3783d8[_0x4622('0x1e')][_0x4622('0x23')]?_[_0x4622('0x24')](_0x3783d8['options'][_0x4622('0x23')],function(_0x474631){return{'model':db[_0x474631[_0x4622('0x25')]],'as':_0x474631['as'],'attributes':_0x474631[_0x4622('0x21')],'include':_0x474631[_0x4622('0x23')]?_['map'](_0x474631[_0x4622('0x23')],function(_0x2b290a){return{'model':db[_0x2b290a[_0x4622('0x25')]],'as':_0x2b290a['as'],'attributes':_0x2b290a['attributes'],'include':_0x2b290a['include']?_[_0x4622('0x24')](_0x2b290a[_0x4622('0x23')],function(_0x23f3e7){return{'model':db[_0x23f3e7[_0x4622('0x25')]],'as':_0x23f3e7['as'],'attributes':_0x23f3e7[_0x4622('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4622('0xf')](function(_0xef1400){logger[_0x4622('0x10')]('GetMailQueue',_0x3783d8);logger[_0x4622('0x13')](_0x4622('0x1b'),_0x3783d8,JSON[_0x4622('0x15')](_0xef1400));_0x43ac4d(_0xef1400);})[_0x4622('0x1a')](function(_0x5d0ee9){logger[_0x4622('0x16')](_0x4622('0x1b'),_0x5d0ee9[_0x4622('0x18')],_0x3783d8);_0x508b89(_0x6e93d5['error'](0x1f4,_0x5d0ee9['message']));});});};exports[_0x4622('0x26')]=function(_0x255f8b){var _0x2a2901=this;return new Promise(function(_0x47175f,_0x1584fb){return db[_0x4622('0x1c')][_0x4622('0x27')]({'raw':_0x255f8b[_0x4622('0x1e')]?_0x255f8b[_0x4622('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x255f8b[_0x4622('0x1e')]?_0x255f8b[_0x4622('0x1e')][_0x4622('0x20')]||null:null,'attributes':_0x255f8b[_0x4622('0x1e')]?_0x255f8b['options'][_0x4622('0x21')]||null:null,'include':_0x255f8b[_0x4622('0x1e')]?_0x255f8b[_0x4622('0x1e')][_0x4622('0x23')]?_[_0x4622('0x24')](_0x255f8b[_0x4622('0x1e')]['include'],function(_0x30695d){return{'model':db[_0x30695d[_0x4622('0x25')]],'as':_0x30695d['as'],'attributes':_0x30695d[_0x4622('0x21')],'include':_0x30695d[_0x4622('0x23')]?_[_0x4622('0x24')](_0x30695d[_0x4622('0x23')],function(_0x4c26aa){return{'model':db[_0x4c26aa[_0x4622('0x25')]],'as':_0x4c26aa['as'],'attributes':_0x4c26aa['attributes'],'include':_0x4c26aa[_0x4622('0x23')]?_[_0x4622('0x24')](_0x4c26aa[_0x4622('0x23')],function(_0xc6a87){return{'model':db[_0xc6a87[_0x4622('0x25')]],'as':_0xc6a87['as'],'attributes':_0xc6a87['attributes']};}):[]};}):[]};}):[]:[]})[_0x4622('0xf')](function(_0x282dc3){logger['info'](_0x4622('0x26'),_0x255f8b);logger[_0x4622('0x13')](_0x4622('0x26'),_0x255f8b,JSON[_0x4622('0x15')](_0x282dc3));_0x47175f(_0x282dc3);})[_0x4622('0x1a')](function(_0x19aab){logger[_0x4622('0x16')](_0x4622('0x26'),_0x19aab[_0x4622('0x18')],_0x255f8b);_0x1584fb(_0x2a2901[_0x4622('0x16')](0x1f4,_0x19aab[_0x4622('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index cda5984..6134b97 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 _0x132a=['remove','update','mailQueue:','save'];(function(_0x126b2e,_0x3e94e4){var _0x347419=function(_0xa688e1){while(--_0xa688e1){_0x126b2e['push'](_0x126b2e['shift']());}};_0x347419(++_0x3e94e4);}(_0x132a,0xe7));var _0xa132=function(_0x53ece6,_0x3a6200){_0x53ece6=_0x53ece6-0x0;var _0x5ae2a9=_0x132a[_0x53ece6];return _0x5ae2a9;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xa132('0x0'),_0xa132('0x1'),_0xa132('0x2')];function createListener(_0x1ce083,_0x12300f){return function(_0x8eb0a1){_0x12300f['emit'](_0x1ce083,_0x8eb0a1);};}function removeListener(_0x3b9a43,_0x4241ec){return function(){MailQueueEvents['removeListener'](_0x3b9a43,_0x4241ec);};}exports['register']=function(_0x41c813){for(var _0x560124=0x0,_0x58eda0=events['length'];_0x560124<_0x58eda0;_0x560124++){var _0x522d70=events[_0x560124];var _0xebba4e=createListener(_0xa132('0x3')+_0x522d70,_0x41c813);MailQueueEvents['on'](_0x522d70,_0xebba4e);}}; \ No newline at end of file +var _0x85f5=['register','mailQueue:','./mailQueue.events','remove','update','emit','removeListener'];(function(_0x125441,_0x122e17){var _0x140762=function(_0x59ea04){while(--_0x59ea04){_0x125441['push'](_0x125441['shift']());}};_0x140762(++_0x122e17);}(_0x85f5,0xfe));var _0x585f=function(_0x5c27b6,_0x4a3c28){_0x5c27b6=_0x5c27b6-0x0;var _0x284ce4=_0x85f5[_0x5c27b6];return _0x284ce4;};'use strict';var MailQueueEvents=require(_0x585f('0x0'));var events=['save',_0x585f('0x1'),_0x585f('0x2')];function createListener(_0x145aa7,_0x130070){return function(_0x53db44){_0x130070[_0x585f('0x3')](_0x145aa7,_0x53db44);};}function removeListener(_0xaf4b04,_0x701c1d){return function(){MailQueueEvents[_0x585f('0x4')](_0xaf4b04,_0x701c1d);};}exports[_0x585f('0x5')]=function(_0x49343e){for(var _0x188cd8=0x0,_0x66f882=events['length'];_0x188cd8<_0x66f882;_0x188cd8++){var _0x34c0e9=events[_0x188cd8];var _0x393764=createListener(_0x585f('0x6')+_0x34c0e9,_0x49343e);MailQueueEvents['on'](_0x34c0e9,_0x393764);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f008f20..d96dc23 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 _0xfdad=['../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xfdad,0xea));var _0xdfda=function(_0x344596,_0x4b07b1){_0x344596=_0x344596-0x0;var _0x888f0b=_0xfdad[_0x344596];return _0x888f0b;};'use strict';var multer=require(_0xdfda('0x0'));var util=require(_0xdfda('0x1'));var path=require('path');var timeout=require(_0xdfda('0x2'));var express=require(_0xdfda('0x3'));var router=express[_0xdfda('0x4')]();var fs_extra=require(_0xdfda('0x5'));var auth=require(_0xdfda('0x6'));var interaction=require(_0xdfda('0x7'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0xdfda('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdfda('0x8')](_0xdfda('0x9'),auth[_0xdfda('0xa')](),controller[_0xdfda('0xb')]);router[_0xdfda('0x8')]('/:id',auth[_0xdfda('0xa')](),controller[_0xdfda('0xc')]);router[_0xdfda('0xd')]('/',auth[_0xdfda('0xa')](),controller[_0xdfda('0xe')]);router[_0xdfda('0xf')](_0xdfda('0x10'),auth['isAuthenticated'](),controller[_0xdfda('0x11')]);router[_0xdfda('0x12')](_0xdfda('0x10'),auth['isAuthenticated'](),controller[_0xdfda('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0987=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x57a6ce,_0x3d7316){var _0x38de7e=function(_0x18499b){while(--_0x18499b){_0x57a6ce['push'](_0x57a6ce['shift']());}};_0x38de7e(++_0x3d7316);}(_0x0987,0xa6));var _0x7098=function(_0x4baada,_0x7b80ac){_0x4baada=_0x4baada-0x0;var _0x1d88b7=_0x0987[_0x4baada];return _0x1d88b7;};'use strict';var multer=require(_0x7098('0x0'));var util=require(_0x7098('0x1'));var path=require(_0x7098('0x2'));var timeout=require(_0x7098('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7098('0x4'));var auth=require(_0x7098('0x5'));var interaction=require(_0x7098('0x6'));var config=require(_0x7098('0x7'));var controller=require('./mailQueueReport.controller');router[_0x7098('0x8')]('/',auth[_0x7098('0x9')](),controller[_0x7098('0xa')]);router[_0x7098('0x8')](_0x7098('0xb'),auth[_0x7098('0x9')](),controller[_0x7098('0xc')]);router['get'](_0x7098('0xd'),auth[_0x7098('0x9')](),controller[_0x7098('0xe')]);router['post']('/',auth[_0x7098('0x9')](),controller[_0x7098('0xf')]);router[_0x7098('0x10')]('/:id',auth[_0x7098('0x9')](),controller[_0x7098('0x11')]);router[_0x7098('0x12')](_0x7098('0xd'),auth[_0x7098('0x9')](),controller[_0x7098('0x13')]);module[_0x7098('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 0d5d429..ba91a43 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 _0xddcf=['STRING','DATE','sequelize','exports'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0xddcf,0xce));var _0xfddc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xddcf[_0x57b54c];return _0x59cc19;};'use strict';var moment=require('moment');var Sequelize=require(_0xfddc('0x0'));module[_0xfddc('0x1')]={'uniqueid':{'type':Sequelize[_0xfddc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfddc('0x2')]},'joinAt':{'type':Sequelize[_0xfddc('0x3')]},'leaveAt':{'type':Sequelize[_0xfddc('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfddc('0x2')]}}; \ No newline at end of file +var _0x6510=['sequelize','exports','STRING','DATE','moment'];(function(_0x252f61,_0x3607ee){var _0xbdfcd5=function(_0x177dcf){while(--_0x177dcf){_0x252f61['push'](_0x252f61['shift']());}};_0xbdfcd5(++_0x3607ee);}(_0x6510,0x77));var _0x0651=function(_0x9759e3,_0x48d04d){_0x9759e3=_0x9759e3-0x0;var _0x19923d=_0x6510[_0x9759e3];return _0x19923d;};'use strict';var moment=require(_0x0651('0x0'));var Sequelize=require(_0x0651('0x1'));module[_0x0651('0x2')]={'uniqueid':{'type':Sequelize[_0x0651('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0651('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0651('0x4')]},'acceptAt':{'type':Sequelize[_0x0651('0x4')]},'exitAt':{'type':Sequelize[_0x0651('0x4')]},'reason':{'type':Sequelize[_0x0651('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index accd8a6..fb971c9 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 _0x2a07=['index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','describe','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a07,0x74));var _0x72a0=function(_0x36d8d9,_0x17b58a){_0x36d8d9=_0x36d8d9-0x0;var _0x1ac3a2=_0x2a07[_0x36d8d9];return _0x1ac3a2;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['MailQueueReport'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['MailQueueReport']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));}; \ No newline at end of file +var _0x323f=['model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','rows','catch','show','params','keys','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key'];(function(_0x49de54,_0x235da0){var _0x5513da=function(_0x3e321e){while(--_0x3e321e){_0x49de54['push'](_0x49de54['shift']());}};_0x5513da(++_0x235da0);}(_0x323f,0x1ee));var _0xf323=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x323f[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf323('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf323('0x1'));var rp=require(_0xf323('0x2'));var moment=require(_0xf323('0x3'));var BPromise=require(_0xf323('0x4'));var Mustache=require(_0xf323('0x5'));var util=require(_0xf323('0x6'));var path=require(_0xf323('0x7'));var sox=require(_0xf323('0x8'));var csv=require(_0xf323('0x9'));var ejs=require(_0xf323('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf323('0xb'));var squel=require(_0xf323('0xc'));var crypto=require(_0xf323('0xd'));var jsforce=require(_0xf323('0xe'));var deskjs=require(_0xf323('0xf'));var toCsv=require(_0xf323('0x9'));var querystring=require(_0xf323('0x10'));var Papa=require(_0xf323('0x11'));var Redis=require(_0xf323('0x12'));var authService=require(_0xf323('0x13'));var qs=require(_0xf323('0x14'));var as=require(_0xf323('0x15'));var hardwareService=require(_0xf323('0x16'));var logger=require(_0xf323('0x17'))(_0xf323('0x18'));var utils=require(_0xf323('0x19'));var config=require(_0xf323('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf323('0x1b'))['db'];function respondWithStatusCode(_0x7dbd26,_0x26eddb){_0x26eddb=_0x26eddb||0xcc;return function(_0x56b916){if(_0x56b916){return _0x7dbd26[_0xf323('0x1c')](_0x26eddb);}return _0x7dbd26[_0xf323('0x1d')](_0x26eddb)[_0xf323('0x1e')]();};}function respondWithResult(_0x3a829f,_0x22672e){_0x22672e=_0x22672e||0xc8;return function(_0x144db9){if(_0x144db9){return _0x3a829f['status'](_0x22672e)['json'](_0x144db9);}};}function respondWithFilteredResult(_0x874219,_0x447517){return function(_0x38fd4c){if(_0x38fd4c){var _0x3858ee=typeof _0x447517[_0xf323('0x1f')]==='undefined'&&typeof _0x447517[_0xf323('0x20')]===_0xf323('0x21');var _0xb9859f=_0x38fd4c[_0xf323('0x22')];var _0x49b115=_0x3858ee?0x0:_0x447517[_0xf323('0x1f')];var _0x272aec=_0x3858ee?_0x38fd4c[_0xf323('0x22')]:_0x447517[_0xf323('0x1f')]+_0x447517['limit'];var _0x409b16;if(_0x272aec>=_0xb9859f){_0x272aec=_0xb9859f;_0x409b16=0xc8;}else{_0x409b16=0xce;}_0x874219[_0xf323('0x1d')](_0x409b16);return _0x874219['set'](_0xf323('0x23'),_0x49b115+'-'+_0x272aec+'/'+_0xb9859f)[_0xf323('0x24')](_0x38fd4c);}return null;};}function patchUpdates(_0x32a942){return function(_0x183ce0){try{jsonpatch['apply'](_0x183ce0,_0x32a942,!![]);}catch(_0xdc7891){return BPromise[_0xf323('0x25')](_0xdc7891);}return _0x183ce0[_0xf323('0x26')]();};}function saveUpdates(_0x52305d,_0x43e467){return function(_0x375473){if(_0x375473){return _0x375473[_0xf323('0x27')](_0x52305d)[_0xf323('0x28')](function(_0x13ec1f){return _0x13ec1f;});}return null;};}function removeEntity(_0xa3362c,_0x189b23){return function(_0x43bc05){if(_0x43bc05){return _0x43bc05[_0xf323('0x29')]()['then'](function(){_0xa3362c[_0xf323('0x1d')](0xcc)[_0xf323('0x1e')]();});}};}function handleEntityNotFound(_0x33dc52,_0x292ce0){return function(_0x87ec45){if(!_0x87ec45){_0x33dc52[_0xf323('0x1c')](0x194);}return _0x87ec45;};}function handleError(_0x4d737d,_0x30ed93){_0x30ed93=_0x30ed93||0x1f4;return function(_0x56ce33){logger[_0xf323('0x2a')](_0x56ce33[_0xf323('0x2b')]);if(_0x56ce33['name']){delete _0x56ce33[_0xf323('0x2c')];}_0x4d737d[_0xf323('0x1d')](_0x30ed93)[_0xf323('0x2d')](_0x56ce33);};}exports[_0xf323('0x2e')]=function(_0x46e3b1,_0x5b8b60){var _0x44c944={},_0x34b536={},_0x12c7d5={'count':0x0,'rows':[]};var _0x30a5d7=_[_0xf323('0x2f')](db[_0xf323('0x30')][_0xf323('0x31')],function(_0x1723b7){return{'name':_0x1723b7[_0xf323('0x32')],'type':_0x1723b7['type'][_0xf323('0x33')]};});_0x34b536[_0xf323('0x34')]=_[_0xf323('0x2f')](_0x30a5d7,_0xf323('0x2c'));_0x34b536[_0xf323('0x35')]=_['keys'](_0x46e3b1[_0xf323('0x35')]);_0x34b536[_0xf323('0x36')]=_[_0xf323('0x37')](_0x34b536[_0xf323('0x34')],_0x34b536[_0xf323('0x35')]);_0x44c944['attributes']=_[_0xf323('0x37')](_0x34b536[_0xf323('0x34')],qs[_0xf323('0x38')](_0x46e3b1[_0xf323('0x35')]['fields']));_0x44c944[_0xf323('0x39')]=_0x44c944['attributes'][_0xf323('0x3a')]?_0x44c944[_0xf323('0x39')]:_0x34b536['model'];if(!_0x46e3b1[_0xf323('0x35')]['hasOwnProperty'](_0xf323('0x3b'))){_0x44c944['limit']=qs[_0xf323('0x20')](_0x46e3b1['query'][_0xf323('0x20')]);_0x44c944[_0xf323('0x1f')]=qs['offset'](_0x46e3b1['query']['offset']);}_0x44c944[_0xf323('0x3c')]=qs[_0xf323('0x3d')](_0x46e3b1[_0xf323('0x35')][_0xf323('0x3d')]);_0x44c944[_0xf323('0x3e')]=qs['filters'](_['pick'](_0x46e3b1['query'],_0x34b536[_0xf323('0x36')]),_0x30a5d7);if(_0x46e3b1['query'][_0xf323('0x3f')]){_0x44c944['where']=_[_0xf323('0x40')](_0x44c944[_0xf323('0x3e')],{'$or':_[_0xf323('0x2f')](_0x30a5d7,function(_0x325fa9){if(_0x325fa9[_0xf323('0x41')]!=='VIRTUAL'){var _0x3d8ddb={};_0x3d8ddb[_0x325fa9[_0xf323('0x2c')]]={'$like':'%'+_0x46e3b1[_0xf323('0x35')][_0xf323('0x3f')]+'%'};return _0x3d8ddb;}})});}_0x44c944=_[_0xf323('0x40')]({},_0x44c944,_0x46e3b1[_0xf323('0x42')]);var _0x288428={'where':_0x44c944[_0xf323('0x3e')]};return db[_0xf323('0x30')][_0xf323('0x22')](_0x288428)[_0xf323('0x28')](function(_0x45287b){_0x12c7d5[_0xf323('0x22')]=_0x45287b;if(_0x46e3b1[_0xf323('0x35')][_0xf323('0x43')]){_0x44c944[_0xf323('0x44')]=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x44c944);})[_0xf323('0x28')](function(_0x16ac6d){_0x12c7d5[_0xf323('0x45')]=_0x16ac6d;return _0x12c7d5;})[_0xf323('0x28')](respondWithFilteredResult(_0x5b8b60,_0x44c944))[_0xf323('0x46')](handleError(_0x5b8b60,null));};exports[_0xf323('0x47')]=function(_0x2746e3,_0x125047){var _0x1c0136={'raw':!![],'where':{'id':_0x2746e3[_0xf323('0x48')]['id']}},_0x320592={};_0x320592[_0xf323('0x34')]=_[_0xf323('0x49')](db['MailQueueReport'][_0xf323('0x31')]);_0x320592['query']=_['keys'](_0x2746e3[_0xf323('0x35')]);_0x320592['filters']=_['intersection'](_0x320592[_0xf323('0x34')],_0x320592[_0xf323('0x35')]);_0x1c0136[_0xf323('0x39')]=_[_0xf323('0x37')](_0x320592[_0xf323('0x34')],qs[_0xf323('0x38')](_0x2746e3[_0xf323('0x35')][_0xf323('0x38')]));_0x1c0136[_0xf323('0x39')]=_0x1c0136[_0xf323('0x39')][_0xf323('0x3a')]?_0x1c0136['attributes']:_0x320592[_0xf323('0x34')];if(_0x2746e3['query'][_0xf323('0x43')]){_0x1c0136[_0xf323('0x44')]=[{'all':!![]}];}_0x1c0136=_[_0xf323('0x40')]({},_0x1c0136,_0x2746e3[_0xf323('0x42')]);return db['MailQueueReport']['find'](_0x1c0136)[_0xf323('0x28')](handleEntityNotFound(_0x125047,null))['then'](respondWithResult(_0x125047,null))[_0xf323('0x46')](handleError(_0x125047,null));};exports['create']=function(_0x2204f5,_0x8980f){return db['MailQueueReport'][_0xf323('0x4a')](_0x2204f5[_0xf323('0x4b')],{})[_0xf323('0x28')](respondWithResult(_0x8980f,0xc9))[_0xf323('0x46')](handleError(_0x8980f,null));};exports[_0xf323('0x27')]=function(_0x950009,_0x34268e){if(_0x950009[_0xf323('0x4b')]['id']){delete _0x950009[_0xf323('0x4b')]['id'];}return db[_0xf323('0x30')][_0xf323('0x4c')]({'where':{'id':_0x950009[_0xf323('0x48')]['id']}})[_0xf323('0x28')](handleEntityNotFound(_0x34268e,null))['then'](saveUpdates(_0x950009[_0xf323('0x4b')],null))[_0xf323('0x28')](respondWithResult(_0x34268e,null))[_0xf323('0x46')](handleError(_0x34268e,null));};exports[_0xf323('0x29')]=function(_0x190e85,_0x1288b3){return db['MailQueueReport'][_0xf323('0x4c')]({'where':{'id':_0x190e85[_0xf323('0x48')]['id']}})['then'](handleEntityNotFound(_0x1288b3,null))[_0xf323('0x28')](removeEntity(_0x1288b3,null))[_0xf323('0x46')](handleError(_0x1288b3,null));};exports['describe']=function(_0x55754e,_0x46d8fc){return db[_0xf323('0x30')][_0xf323('0x4d')]()[_0xf323('0x28')](respondWithResult(_0x46d8fc,null))[_0xf323('0x46')](handleError(_0x46d8fc,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 46c2911..2f470ba 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 _0x0b62=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x5902d3,_0x56299f){var _0x30079e=function(_0x28bbaf){while(--_0x28bbaf){_0x5902d3['push'](_0x5902d3['shift']());}};_0x30079e(++_0x56299f);}(_0x0b62,0x177));var _0x20b6=function(_0xdb7fab,_0x381abd){_0xdb7fab=_0xdb7fab-0x0;var _0x2af57b=_0x0b62[_0xdb7fab];return _0x2af57b;};'use strict';var _=require(_0x20b6('0x0'));var util=require(_0x20b6('0x1'));var logger=require('../../config/logger')(_0x20b6('0x2'));var moment=require('moment');var BPromise=require(_0x20b6('0x3'));var rp=require(_0x20b6('0x4'));var fs=require('fs');var path=require(_0x20b6('0x5'));var rimraf=require(_0x20b6('0x6'));var config=require(_0x20b6('0x7'));var attributes=require(_0x20b6('0x8'));module['exports']=function(_0x2237df,_0x2838c9){return _0x2237df[_0x20b6('0x9')](_0x20b6('0xa'),attributes,{'tableName':_0x20b6('0xb'),'paranoid':![],'indexes':[{'name':_0x20b6('0xc'),'fields':[_0x20b6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fef=['path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fef,0x110));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf7fe('0x0'));var util=require('util');var logger=require(_0xf7fe('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7fe('0x2'));var fs=require('fs');var path=require(_0xf7fe('0x3'));var rimraf=require('rimraf');var config=require(_0xf7fe('0x4'));var attributes=require(_0xf7fe('0x5'));module[_0xf7fe('0x6')]=function(_0x31ec15,_0x5ad22b){return _0x31ec15[_0xf7fe('0x7')](_0xf7fe('0x8'),attributes,{'tableName':_0xf7fe('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf7fe('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 65ca7b6..f75c063 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf80283,_0x52d282){var _0x25f90d=function(_0x3571f3){while(--_0x3571f3){_0xf80283['push'](_0xf80283['shift']());}};_0x25f90d(++_0x52d282);}(_0x1261,0x144));var _0x1126=function(_0x369cf2,_0x47e28c){_0x369cf2=_0x369cf2-0x0;var _0x5c7d3e=_0x1261[_0x369cf2];return _0x5c7d3e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x38b816,_0x2ee0a4){var _0x59aa08=function(_0x2a872a){while(--_0x2a872a){_0x38b816['push'](_0x38b816['shift']());}};_0x59aa08(++_0x2ee0a4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 2ea5913..17cb809 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4f1373,_0xe2641a){var _0x542a34=function(_0x239b42){while(--_0x239b42){_0x4f1373['push'](_0x4f1373['shift']());}};_0x542a34(++_0xe2641a);}(_0x70e0,0x17b));var _0x070e=function(_0x2a507c,_0x4357dc){_0x2a507c=_0x2a507c-0x0;var _0x24b93d=_0x70e0[_0x2a507c];return _0x24b93d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2ece52,_0x538ee5){var _0x585ea8=function(_0x528662){while(--_0x528662){_0x2ece52['push'](_0x2ece52['shift']());}};_0x585ea8(++_0x538ee5);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 7ee3ecf..34c60b2 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 _0x7624=['exports','STRING','INTEGER','INBOX','BOOLEAN','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7624,0x191));var _0x4762=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7624[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x4762('0x0'));module[_0x4762('0x1')]={'description':{'type':Sequelize[_0x4762('0x2')]},'host':{'type':Sequelize[_0x4762('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x4762('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4762('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4762('0x2')],'defaultValue':_0x4762('0x4')},'connTimeout':{'type':Sequelize[_0x4762('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4762('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4762('0x2')]},'modernAuthentication':{'type':Sequelize[_0x4762('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x2ae2=['exports','STRING','BOOLEAN','INBOX','INTEGER'];(function(_0x36582e,_0x50c731){var _0x5a8e6d=function(_0x16e210){while(--_0x16e210){_0x36582e['push'](_0x36582e['shift']());}};_0x5a8e6d(++_0x50c731);}(_0x2ae2,0x73));var _0x22ae=function(_0x496918,_0x22b207){_0x496918=_0x496918-0x0;var _0x5c875d=_0x2ae2[_0x496918];return _0x5c875d;};'use strict';var Sequelize=require('sequelize');module[_0x22ae('0x0')]={'description':{'type':Sequelize[_0x22ae('0x1')]},'host':{'type':Sequelize[_0x22ae('0x1')]},'authentication':{'type':Sequelize[_0x22ae('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x22ae('0x1')]},'password':{'type':Sequelize[_0x22ae('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x22ae('0x1')],'defaultValue':_0x22ae('0x3')},'connTimeout':{'type':Sequelize[_0x22ae('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x22ae('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x22ae('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ec334b6..bc0659a 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 _0xb6ab=['lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in'];(function(_0x120848,_0x5584af){var _0x2e410f=function(_0x5a244d){while(--_0x5a244d){_0x120848['push'](_0x120848['shift']());}};_0x2e410f(++_0x5584af);}(_0xb6ab,0x1e4));var _0xbb6a=function(_0x63de62,_0xe5cc89){_0x63de62=_0x63de62-0x0;var _0x3daddf=_0xb6ab[_0x63de62];return _0x3daddf;};'use strict';var _=require(_0xbb6a('0x0'));var util=require(_0xbb6a('0x1'));var logger=require(_0xbb6a('0x2'))(_0xbb6a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbb6a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb6a('0x5'));var config=require(_0xbb6a('0x6'));var attributes=require(_0xbb6a('0x7'));module[_0xbb6a('0x8')]=function(_0x39189e,_0x52d231){return _0x39189e['define'](_0xbb6a('0x9'),attributes,{'tableName':_0xbb6a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa6d=['exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xaa6d,0x170));var _0xdaa6=function(_0x1e042f,_0x4ce4e3){_0x1e042f=_0x1e042f-0x0;var _0x173d9f=_0xaa6d[_0x1e042f];return _0x173d9f;};'use strict';var _=require(_0xdaa6('0x0'));var util=require(_0xdaa6('0x1'));var logger=require(_0xdaa6('0x2'))('api');var moment=require(_0xdaa6('0x3'));var BPromise=require(_0xdaa6('0x4'));var rp=require(_0xdaa6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaa6('0x6'));var config=require(_0xdaa6('0x7'));var attributes=require(_0xdaa6('0x8'));module[_0xdaa6('0x9')]=function(_0x428089,_0x16b045){return _0x428089[_0xdaa6('0xa')](_0xdaa6('0xb'),attributes,{'tableName':_0xdaa6('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 4af9f08..95ce039 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 _0xaaa2=['where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','GetMailServerIn','findAll','options','raw'];(function(_0x2fa966,_0xc4726){var _0x4ebac1=function(_0x437f59){while(--_0x437f59){_0x2fa966['push'](_0x2fa966['shift']());}};_0x4ebac1(++_0xc4726);}(_0xaaa2,0xac));var _0x2aaa=function(_0x45f9d0,_0x1521bd){_0x45f9d0=_0x45f9d0-0x0;var _0x21ff09=_0xaaa2[_0x45f9d0];return _0x21ff09;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('MailServerIn,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('MailServerIn,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});}exports[_0x2aaa('0x16')]=function(_0x3b94bf){var _0x1cae3e=this;return new Promise(function(_0xdaa445,_0x38a049){return db['MailServerIn'][_0x2aaa('0x17')]({'raw':_0x3b94bf[_0x2aaa('0x18')]?_0x3b94bf['options'][_0x2aaa('0x19')]===undefined?!![]:![]:!![],'where':_0x3b94bf['options']?_0x3b94bf['options'][_0x2aaa('0x1a')]||null:null,'attributes':_0x3b94bf[_0x2aaa('0x18')]?_0x3b94bf[_0x2aaa('0x18')][_0x2aaa('0x1b')]||null:null,'limit':_0x3b94bf[_0x2aaa('0x18')]?_0x3b94bf[_0x2aaa('0x18')][_0x2aaa('0x1c')]||null:null,'include':_0x3b94bf[_0x2aaa('0x18')]?_0x3b94bf['options'][_0x2aaa('0x1d')]?_[_0x2aaa('0x1e')](_0x3b94bf['options']['include'],function(_0x19153e){return{'model':db[_0x19153e['model']],'as':_0x19153e['as'],'attributes':_0x19153e[_0x2aaa('0x1b')],'include':_0x19153e[_0x2aaa('0x1d')]?_['map'](_0x19153e[_0x2aaa('0x1d')],function(_0x3b99d8){return{'model':db[_0x3b99d8['model']],'as':_0x3b99d8['as'],'attributes':_0x3b99d8[_0x2aaa('0x1b')],'include':_0x3b99d8[_0x2aaa('0x1d')]?_[_0x2aaa('0x1e')](_0x3b99d8['include'],function(_0x1f626b){return{'model':db[_0x1f626b[_0x2aaa('0x1f')]],'as':_0x1f626b['as'],'attributes':_0x1f626b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3af929){logger[_0x2aaa('0x14')](_0x2aaa('0x16'),_0x3b94bf);logger[_0x2aaa('0xe')](_0x2aaa('0x16'),_0x3b94bf,JSON[_0x2aaa('0xf')](_0x3af929));_0xdaa445(_0x3af929);})[_0x2aaa('0x20')](function(_0x166dc0){logger[_0x2aaa('0x10')](_0x2aaa('0x16'),_0x166dc0[_0x2aaa('0x13')],_0x3b94bf);_0x38a049(_0x1cae3e[_0x2aaa('0x10')](0x1f4,_0x166dc0['message']));});});}; \ No newline at end of file +var _0x1d90=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','options','where','attributes','limit','map','include','model','lodash'];(function(_0x3091d4,_0x33c6b6){var _0x2766ea=function(_0x59a805){while(--_0x59a805){_0x3091d4['push'](_0x3091d4['shift']());}};_0x2766ea(++_0x33c6b6);}(_0x1d90,0x13e));var _0x01d9=function(_0x42e7ce,_0x375d2e){_0x42e7ce=_0x42e7ce-0x0;var _0x3d5428=_0x1d90[_0x42e7ce];return _0x3d5428;};'use strict';var _=require(_0x01d9('0x0'));var util=require('util');var moment=require(_0x01d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x01d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01d9('0x3'))['db'];var utils=require(_0x01d9('0x4'));var logger=require('../../config/logger')(_0x01d9('0x5'));var config=require(_0x01d9('0x6'));var jayson=require(_0x01d9('0x7'));var client=jayson['client'][_0x01d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1664eb,_0x31c11d,_0x598409){return new BPromise(function(_0xef9d5b,_0x479447){return client['request'](_0x1664eb,_0x598409)[_0x01d9('0x9')](function(_0x2b8e06){logger[_0x01d9('0xa')]('MailServerIn,\x20%s,\x20%s',_0x31c11d,_0x01d9('0xb'));logger[_0x01d9('0xc')](_0x01d9('0xd'),_0x31c11d,'request\x20sent',JSON[_0x01d9('0xe')](_0x2b8e06));if(_0x2b8e06[_0x01d9('0xf')]){if(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x10')]===0x1f4){logger[_0x01d9('0xf')](_0x01d9('0x11'),_0x31c11d,_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);return _0x479447(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);}logger[_0x01d9('0xf')](_0x01d9('0x11'),_0x31c11d,_0x2b8e06['error'][_0x01d9('0x12')]);return _0xef9d5b(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);}else{logger[_0x01d9('0xa')]('MailServerIn,\x20%s,\x20%s',_0x31c11d,_0x01d9('0xb'));_0xef9d5b(_0x2b8e06[_0x01d9('0x13')][_0x01d9('0x12')]);}})[_0x01d9('0x14')](function(_0x147911){logger['error'](_0x01d9('0x11'),_0x31c11d,_0x147911);_0x479447(_0x147911);});});}exports[_0x01d9('0x15')]=function(_0x51ebb3){var _0x1b31b3=this;return new Promise(function(_0x2789e9,_0x19a3de){return db['MailServerIn']['findAll']({'raw':_0x51ebb3[_0x01d9('0x16')]?_0x51ebb3['options']['raw']===undefined?!![]:![]:!![],'where':_0x51ebb3[_0x01d9('0x16')]?_0x51ebb3[_0x01d9('0x16')][_0x01d9('0x17')]||null:null,'attributes':_0x51ebb3[_0x01d9('0x16')]?_0x51ebb3['options'][_0x01d9('0x18')]||null:null,'limit':_0x51ebb3[_0x01d9('0x16')]?_0x51ebb3['options'][_0x01d9('0x19')]||null:null,'include':_0x51ebb3[_0x01d9('0x16')]?_0x51ebb3[_0x01d9('0x16')]['include']?_[_0x01d9('0x1a')](_0x51ebb3[_0x01d9('0x16')][_0x01d9('0x1b')],function(_0x399d25){return{'model':db[_0x399d25['model']],'as':_0x399d25['as'],'attributes':_0x399d25[_0x01d9('0x18')],'include':_0x399d25['include']?_[_0x01d9('0x1a')](_0x399d25[_0x01d9('0x1b')],function(_0x125ecb){return{'model':db[_0x125ecb[_0x01d9('0x1c')]],'as':_0x125ecb['as'],'attributes':_0x125ecb[_0x01d9('0x18')],'include':_0x125ecb[_0x01d9('0x1b')]?_[_0x01d9('0x1a')](_0x125ecb[_0x01d9('0x1b')],function(_0xb731ba){return{'model':db[_0xb731ba[_0x01d9('0x1c')]],'as':_0xb731ba['as'],'attributes':_0xb731ba[_0x01d9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x01d9('0x9')](function(_0x4ea9a6){logger[_0x01d9('0xa')](_0x01d9('0x15'),_0x51ebb3);logger[_0x01d9('0xc')](_0x01d9('0x15'),_0x51ebb3,JSON['stringify'](_0x4ea9a6));_0x2789e9(_0x4ea9a6);})['catch'](function(_0x35a817){logger[_0x01d9('0xf')]('GetMailServerIn',_0x35a817[_0x01d9('0x12')],_0x51ebb3);_0x19a3de(_0x1b31b3['error'](0x1f4,_0x35a817[_0x01d9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4f7c144..b2c25d1 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(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x7a54,0x106));var _0x47a5=function(_0x5d32cf,_0x570da8){_0x5d32cf=_0x5d32cf-0x0;var _0x3561ef=_0x7a54[_0x5d32cf];return _0x3561ef;};'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(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x7a54,0x106));var _0x47a5=function(_0x34e7ba,_0x16bfc9){_0x34e7ba=_0x34e7ba-0x0;var _0x264f8d=_0x7a54[_0x34e7ba];return _0x264f8d;};'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 8874afd..46e71de 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 _0xb9a7=['BOOLEAN','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9a7,0x112));var _0x7b9a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb9a7[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x7b9a('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x7b9a('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x7b9a('0x1')]},'authentication':{'type':Sequelize[_0x7b9a('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x7b9a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf7b4=['STRING','BOOLEAN','sequelize'];(function(_0x312ec1,_0x4ee54d){var _0x5e685f=function(_0x1c772c){while(--_0x1c772c){_0x312ec1['push'](_0x312ec1['shift']());}};_0x5e685f(++_0x4ee54d);}(_0xf7b4,0x152));var _0x4f7b=function(_0xc11e96,_0x2f0502){_0xc11e96=_0xc11e96-0x0;var _0x25e1ae=_0xf7b4[_0xc11e96];return _0x25e1ae;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4f7b('0x1')]},'user':{'type':Sequelize[_0x4f7b('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4f7b('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x4f7b('0x1')]},'authentication':{'type':Sequelize[_0x4f7b('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4f7b('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index b685f6c..6626a9a 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 _0xed21=['body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','update','then','stack','name','send','index','map','MailServerOut','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','count','include','findAll','rows','catch','show','rawAttributes','find'];(function(_0x4fb792,_0x490010){var _0x4bda16=function(_0x2649f9){while(--_0x2649f9){_0x4fb792['push'](_0x4fb792['shift']());}};_0x4bda16(++_0x490010);}(_0xed21,0x11f));var _0x1ed2=function(_0x17d2cc,_0xed435){_0x17d2cc=_0x17d2cc-0x0;var _0x3e27ed=_0xed21[_0x17d2cc];return _0x3e27ed;};'use strict';var emlformat=require(_0x1ed2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ed2('0x1'));var jsonpatch=require(_0x1ed2('0x2'));var rp=require(_0x1ed2('0x3'));var moment=require(_0x1ed2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1ed2('0x5'));var sox=require(_0x1ed2('0x6'));var csv=require(_0x1ed2('0x7'));var ejs=require(_0x1ed2('0x8'));var fs=require('fs');var fs_extra=require(_0x1ed2('0x9'));var _=require('lodash');var squel=require(_0x1ed2('0xa'));var crypto=require(_0x1ed2('0xb'));var jsforce=require(_0x1ed2('0xc'));var deskjs=require(_0x1ed2('0xd'));var toCsv=require(_0x1ed2('0x7'));var querystring=require('querystring');var Papa=require(_0x1ed2('0xe'));var Redis=require(_0x1ed2('0xf'));var authService=require(_0x1ed2('0x10'));var qs=require(_0x1ed2('0x11'));var as=require(_0x1ed2('0x12'));var hardwareService=require(_0x1ed2('0x13'));var logger=require(_0x1ed2('0x14'))(_0x1ed2('0x15'));var utils=require('../../config/utils');var config=require(_0x1ed2('0x16'));var licenseUtil=require(_0x1ed2('0x17'));var db=require(_0x1ed2('0x18'))['db'];function respondWithStatusCode(_0x298071,_0x88ca50){_0x88ca50=_0x88ca50||0xcc;return function(_0x59954e){if(_0x59954e){return _0x298071[_0x1ed2('0x19')](_0x88ca50);}return _0x298071[_0x1ed2('0x1a')](_0x88ca50)[_0x1ed2('0x1b')]();};}function respondWithResult(_0x304046,_0x56c762){_0x56c762=_0x56c762||0xc8;return function(_0x419d3a){if(_0x419d3a){return _0x304046[_0x1ed2('0x1a')](_0x56c762)[_0x1ed2('0x1c')](_0x419d3a);}};}function respondWithFilteredResult(_0x2e1c98,_0x176e67){return function(_0x4937d1){if(_0x4937d1){var _0x1819f6=typeof _0x176e67[_0x1ed2('0x1d')]===_0x1ed2('0x1e')&&typeof _0x176e67[_0x1ed2('0x1f')]==='undefined';var _0x4f6ea5=_0x4937d1['count'];var _0x58d908=_0x1819f6?0x0:_0x176e67[_0x1ed2('0x1d')];var _0x1360b0=_0x1819f6?_0x4937d1['count']:_0x176e67[_0x1ed2('0x1d')]+_0x176e67['limit'];var _0x1259a7;if(_0x1360b0>=_0x4f6ea5){_0x1360b0=_0x4f6ea5;_0x1259a7=0xc8;}else{_0x1259a7=0xce;}_0x2e1c98['status'](_0x1259a7);return _0x2e1c98[_0x1ed2('0x20')]('Content-Range',_0x58d908+'-'+_0x1360b0+'/'+_0x4f6ea5)[_0x1ed2('0x1c')](_0x4937d1);}return null;};}function patchUpdates(_0x2068bb){return function(_0x13cf05){try{jsonpatch['apply'](_0x13cf05,_0x2068bb,!![]);}catch(_0x39a63e){return BPromise[_0x1ed2('0x21')](_0x39a63e);}return _0x13cf05[_0x1ed2('0x22')]();};}function saveUpdates(_0x559990,_0x202c24){return function(_0x2cfdcb){if(_0x2cfdcb){return _0x2cfdcb[_0x1ed2('0x23')](_0x559990)[_0x1ed2('0x24')](function(_0x550e1d){return _0x550e1d;});}return null;};}function removeEntity(_0xdef69d,_0x3b99f0){return function(_0x1e2534){if(_0x1e2534){return _0x1e2534['destroy']()[_0x1ed2('0x24')](function(){_0xdef69d['status'](0xcc)[_0x1ed2('0x1b')]();});}};}function handleEntityNotFound(_0x1aa353,_0x14f1f9){return function(_0x12d1fb){if(!_0x12d1fb){_0x1aa353[_0x1ed2('0x19')](0x194);}return _0x12d1fb;};}function handleError(_0x5e3fbc,_0x483960){_0x483960=_0x483960||0x1f4;return function(_0x16b0b3){logger['error'](_0x16b0b3[_0x1ed2('0x25')]);if(_0x16b0b3['name']){delete _0x16b0b3[_0x1ed2('0x26')];}_0x5e3fbc[_0x1ed2('0x1a')](_0x483960)[_0x1ed2('0x27')](_0x16b0b3);};}exports[_0x1ed2('0x28')]=function(_0x881d24,_0x2581e1){var _0x5a0f81={},_0x1d6e9c={},_0x12f826={'count':0x0,'rows':[]};var _0x233c6f=_[_0x1ed2('0x29')](db[_0x1ed2('0x2a')]['rawAttributes'],function(_0x299121){return{'name':_0x299121[_0x1ed2('0x2b')],'type':_0x299121['type']['key']};});_0x1d6e9c[_0x1ed2('0x2c')]=_[_0x1ed2('0x29')](_0x233c6f,_0x1ed2('0x26'));_0x1d6e9c[_0x1ed2('0x2d')]=_[_0x1ed2('0x2e')](_0x881d24[_0x1ed2('0x2d')]);_0x1d6e9c[_0x1ed2('0x2f')]=_[_0x1ed2('0x30')](_0x1d6e9c[_0x1ed2('0x2c')],_0x1d6e9c['query']);_0x5a0f81[_0x1ed2('0x31')]=_['intersection'](_0x1d6e9c[_0x1ed2('0x2c')],qs[_0x1ed2('0x32')](_0x881d24[_0x1ed2('0x2d')]['fields']));_0x5a0f81[_0x1ed2('0x31')]=_0x5a0f81['attributes'][_0x1ed2('0x33')]?_0x5a0f81['attributes']:_0x1d6e9c[_0x1ed2('0x2c')];if(!_0x881d24['query'][_0x1ed2('0x34')](_0x1ed2('0x35'))){_0x5a0f81['limit']=qs[_0x1ed2('0x1f')](_0x881d24['query'][_0x1ed2('0x1f')]);_0x5a0f81['offset']=qs[_0x1ed2('0x1d')](_0x881d24[_0x1ed2('0x2d')][_0x1ed2('0x1d')]);}_0x5a0f81[_0x1ed2('0x36')]=qs[_0x1ed2('0x37')](_0x881d24[_0x1ed2('0x2d')][_0x1ed2('0x37')]);_0x5a0f81['where']=qs[_0x1ed2('0x2f')](_['pick'](_0x881d24[_0x1ed2('0x2d')],_0x1d6e9c['filters']),_0x233c6f);if(_0x881d24[_0x1ed2('0x2d')][_0x1ed2('0x38')]){_0x5a0f81[_0x1ed2('0x39')]=_[_0x1ed2('0x3a')](_0x5a0f81['where'],{'$or':_[_0x1ed2('0x29')](_0x233c6f,function(_0x2dbb37){if(_0x2dbb37['type']!=='VIRTUAL'){var _0x5135ff={};_0x5135ff[_0x2dbb37['name']]={'$like':'%'+_0x881d24[_0x1ed2('0x2d')][_0x1ed2('0x38')]+'%'};return _0x5135ff;}})});}_0x5a0f81=_[_0x1ed2('0x3a')]({},_0x5a0f81,_0x881d24[_0x1ed2('0x3b')]);var _0x1f454f={'where':_0x5a0f81['where']};return db['MailServerOut'][_0x1ed2('0x3c')](_0x1f454f)[_0x1ed2('0x24')](function(_0x449335){_0x12f826[_0x1ed2('0x3c')]=_0x449335;if(_0x881d24[_0x1ed2('0x2d')]['includeAll']){_0x5a0f81[_0x1ed2('0x3d')]=[{'all':!![]}];}return db[_0x1ed2('0x2a')][_0x1ed2('0x3e')](_0x5a0f81);})[_0x1ed2('0x24')](function(_0x4a8efa){_0x12f826[_0x1ed2('0x3f')]=_0x4a8efa;return _0x12f826;})[_0x1ed2('0x24')](respondWithFilteredResult(_0x2581e1,_0x5a0f81))[_0x1ed2('0x40')](handleError(_0x2581e1,null));};exports[_0x1ed2('0x41')]=function(_0x51d29b,_0x3f30ad){var _0x2bef13={'raw':!![],'where':{'id':_0x51d29b['params']['id']}},_0x11d56a={};_0x11d56a[_0x1ed2('0x2c')]=_[_0x1ed2('0x2e')](db[_0x1ed2('0x2a')][_0x1ed2('0x42')]);_0x11d56a[_0x1ed2('0x2d')]=_['keys'](_0x51d29b['query']);_0x11d56a[_0x1ed2('0x2f')]=_[_0x1ed2('0x30')](_0x11d56a[_0x1ed2('0x2c')],_0x11d56a[_0x1ed2('0x2d')]);_0x2bef13[_0x1ed2('0x31')]=_[_0x1ed2('0x30')](_0x11d56a[_0x1ed2('0x2c')],qs[_0x1ed2('0x32')](_0x51d29b['query'][_0x1ed2('0x32')]));_0x2bef13[_0x1ed2('0x31')]=_0x2bef13[_0x1ed2('0x31')][_0x1ed2('0x33')]?_0x2bef13['attributes']:_0x11d56a[_0x1ed2('0x2c')];if(_0x51d29b[_0x1ed2('0x2d')]['includeAll']){_0x2bef13[_0x1ed2('0x3d')]=[{'all':!![]}];}_0x2bef13=_[_0x1ed2('0x3a')]({},_0x2bef13,_0x51d29b[_0x1ed2('0x3b')]);return db[_0x1ed2('0x2a')][_0x1ed2('0x43')](_0x2bef13)[_0x1ed2('0x24')](handleEntityNotFound(_0x3f30ad,null))[_0x1ed2('0x24')](respondWithResult(_0x3f30ad,null))['catch'](handleError(_0x3f30ad,null));};exports['create']=function(_0x50eb84,_0x4bb124){return db['MailServerOut']['create'](_0x50eb84[_0x1ed2('0x44')],{})[_0x1ed2('0x24')](respondWithResult(_0x4bb124,0xc9))['catch'](handleError(_0x4bb124,null));};exports[_0x1ed2('0x23')]=function(_0x21dd99,_0x875a2d){if(_0x21dd99[_0x1ed2('0x44')]['id']){delete _0x21dd99[_0x1ed2('0x44')]['id'];}return db[_0x1ed2('0x2a')][_0x1ed2('0x43')]({'where':{'id':_0x21dd99[_0x1ed2('0x45')]['id']}})[_0x1ed2('0x24')](handleEntityNotFound(_0x875a2d,null))[_0x1ed2('0x24')](saveUpdates(_0x21dd99[_0x1ed2('0x44')],null))[_0x1ed2('0x24')](respondWithResult(_0x875a2d,null))['catch'](handleError(_0x875a2d,null));};exports[_0x1ed2('0x46')]=function(_0x423613,_0x423d3a){return db[_0x1ed2('0x2a')][_0x1ed2('0x43')]({'where':{'id':_0x423613[_0x1ed2('0x45')]['id']}})[_0x1ed2('0x24')](handleEntityNotFound(_0x423d3a,null))[_0x1ed2('0x24')](removeEntity(_0x423d3a,null))['catch'](handleError(_0x423d3a,null));}; \ No newline at end of file +var _0x2bf4=['where','pick','VIRTUAL','merge','options','rows','catch','show','params','keys','includeAll','create','body','find','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','MailServerOut','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1edb3f,_0x54222c){var _0x1c538f=function(_0x5047c2){while(--_0x5047c2){_0x1edb3f['push'](_0x1edb3f['shift']());}};_0x1c538f(++_0x54222c);}(_0x2bf4,0xdd));var _0x42bf=function(_0x3e750b,_0x2070d9){_0x3e750b=_0x3e750b-0x0;var _0x1e2ac3=_0x2bf4[_0x3e750b];return _0x1e2ac3;};'use strict';var emlformat=require(_0x42bf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42bf('0x1'));var rp=require(_0x42bf('0x2'));var moment=require('moment');var BPromise=require(_0x42bf('0x3'));var Mustache=require(_0x42bf('0x4'));var util=require('util');var path=require(_0x42bf('0x5'));var sox=require(_0x42bf('0x6'));var csv=require(_0x42bf('0x7'));var ejs=require(_0x42bf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x42bf('0x9'));var crypto=require(_0x42bf('0xa'));var jsforce=require(_0x42bf('0xb'));var deskjs=require(_0x42bf('0xc'));var toCsv=require('to-csv');var querystring=require(_0x42bf('0xd'));var Papa=require(_0x42bf('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x42bf('0xf'));var logger=require(_0x42bf('0x10'))('api');var utils=require(_0x42bf('0x11'));var config=require(_0x42bf('0x12'));var licenseUtil=require(_0x42bf('0x13'));var db=require(_0x42bf('0x14'))['db'];function respondWithStatusCode(_0x4dd8d3,_0x46cf75){_0x46cf75=_0x46cf75||0xcc;return function(_0x137d5c){if(_0x137d5c){return _0x4dd8d3[_0x42bf('0x15')](_0x46cf75);}return _0x4dd8d3[_0x42bf('0x16')](_0x46cf75)[_0x42bf('0x17')]();};}function respondWithResult(_0xcc1a41,_0x55b55d){_0x55b55d=_0x55b55d||0xc8;return function(_0x57af2f){if(_0x57af2f){return _0xcc1a41[_0x42bf('0x16')](_0x55b55d)[_0x42bf('0x18')](_0x57af2f);}};}function respondWithFilteredResult(_0x13e3f6,_0xcf0553){return function(_0x17545d){if(_0x17545d){var _0x38cea4=typeof _0xcf0553[_0x42bf('0x19')]===_0x42bf('0x1a')&&typeof _0xcf0553[_0x42bf('0x1b')]==='undefined';var _0x5de1d1=_0x17545d[_0x42bf('0x1c')];var _0x1a7ca0=_0x38cea4?0x0:_0xcf0553[_0x42bf('0x19')];var _0x1194d2=_0x38cea4?_0x17545d[_0x42bf('0x1c')]:_0xcf0553[_0x42bf('0x19')]+_0xcf0553[_0x42bf('0x1b')];var _0x1d7987;if(_0x1194d2>=_0x5de1d1){_0x1194d2=_0x5de1d1;_0x1d7987=0xc8;}else{_0x1d7987=0xce;}_0x13e3f6[_0x42bf('0x16')](_0x1d7987);return _0x13e3f6[_0x42bf('0x1d')]('Content-Range',_0x1a7ca0+'-'+_0x1194d2+'/'+_0x5de1d1)[_0x42bf('0x18')](_0x17545d);}return null;};}function patchUpdates(_0x92487a){return function(_0x253863){try{jsonpatch[_0x42bf('0x1e')](_0x253863,_0x92487a,!![]);}catch(_0x54abf0){return BPromise[_0x42bf('0x1f')](_0x54abf0);}return _0x253863[_0x42bf('0x20')]();};}function saveUpdates(_0x6472c5,_0x12926b){return function(_0x1bccdd){if(_0x1bccdd){return _0x1bccdd[_0x42bf('0x21')](_0x6472c5)[_0x42bf('0x22')](function(_0x418bdd){return _0x418bdd;});}return null;};}function removeEntity(_0x3fe377,_0xc58a4f){return function(_0x2df14d){if(_0x2df14d){return _0x2df14d[_0x42bf('0x23')]()['then'](function(){_0x3fe377['status'](0xcc)[_0x42bf('0x17')]();});}};}function handleEntityNotFound(_0x211bf0,_0x478e60){return function(_0x13e0a){if(!_0x13e0a){_0x211bf0[_0x42bf('0x15')](0x194);}return _0x13e0a;};}function handleError(_0x4eed3f,_0x4d034b){_0x4d034b=_0x4d034b||0x1f4;return function(_0x1f696d){logger[_0x42bf('0x24')](_0x1f696d['stack']);if(_0x1f696d[_0x42bf('0x25')]){delete _0x1f696d['name'];}_0x4eed3f[_0x42bf('0x16')](_0x4d034b)[_0x42bf('0x26')](_0x1f696d);};}exports[_0x42bf('0x27')]=function(_0x23bc55,_0x370e18){var _0x5d9639={},_0x57632f={},_0x160659={'count':0x0,'rows':[]};var _0x47ca70=_[_0x42bf('0x28')](db[_0x42bf('0x29')][_0x42bf('0x2a')],function(_0xe93174){return{'name':_0xe93174['fieldName'],'type':_0xe93174[_0x42bf('0x2b')]['key']};});_0x57632f[_0x42bf('0x2c')]=_['map'](_0x47ca70,'name');_0x57632f['query']=_['keys'](_0x23bc55[_0x42bf('0x2d')]);_0x57632f[_0x42bf('0x2e')]=_[_0x42bf('0x2f')](_0x57632f[_0x42bf('0x2c')],_0x57632f['query']);_0x5d9639[_0x42bf('0x30')]=_['intersection'](_0x57632f[_0x42bf('0x2c')],qs['fields'](_0x23bc55[_0x42bf('0x2d')][_0x42bf('0x31')]));_0x5d9639['attributes']=_0x5d9639[_0x42bf('0x30')][_0x42bf('0x32')]?_0x5d9639[_0x42bf('0x30')]:_0x57632f['model'];if(!_0x23bc55[_0x42bf('0x2d')][_0x42bf('0x33')](_0x42bf('0x34'))){_0x5d9639[_0x42bf('0x1b')]=qs[_0x42bf('0x1b')](_0x23bc55[_0x42bf('0x2d')][_0x42bf('0x1b')]);_0x5d9639['offset']=qs[_0x42bf('0x19')](_0x23bc55[_0x42bf('0x2d')][_0x42bf('0x19')]);}_0x5d9639[_0x42bf('0x35')]=qs['sort'](_0x23bc55['query'][_0x42bf('0x36')]);_0x5d9639[_0x42bf('0x37')]=qs[_0x42bf('0x2e')](_[_0x42bf('0x38')](_0x23bc55[_0x42bf('0x2d')],_0x57632f[_0x42bf('0x2e')]),_0x47ca70);if(_0x23bc55['query']['filter']){_0x5d9639[_0x42bf('0x37')]=_['merge'](_0x5d9639[_0x42bf('0x37')],{'$or':_[_0x42bf('0x28')](_0x47ca70,function(_0x89c26f){if(_0x89c26f[_0x42bf('0x2b')]!==_0x42bf('0x39')){var _0x5dd5c2={};_0x5dd5c2[_0x89c26f[_0x42bf('0x25')]]={'$like':'%'+_0x23bc55[_0x42bf('0x2d')]['filter']+'%'};return _0x5dd5c2;}})});}_0x5d9639=_[_0x42bf('0x3a')]({},_0x5d9639,_0x23bc55[_0x42bf('0x3b')]);var _0x8bdfbe={'where':_0x5d9639[_0x42bf('0x37')]};return db[_0x42bf('0x29')][_0x42bf('0x1c')](_0x8bdfbe)['then'](function(_0xb6879c){_0x160659[_0x42bf('0x1c')]=_0xb6879c;if(_0x23bc55[_0x42bf('0x2d')]['includeAll']){_0x5d9639['include']=[{'all':!![]}];}return db[_0x42bf('0x29')]['findAll'](_0x5d9639);})[_0x42bf('0x22')](function(_0x1ecdca){_0x160659[_0x42bf('0x3c')]=_0x1ecdca;return _0x160659;})[_0x42bf('0x22')](respondWithFilteredResult(_0x370e18,_0x5d9639))[_0x42bf('0x3d')](handleError(_0x370e18,null));};exports[_0x42bf('0x3e')]=function(_0x12f13f,_0xa5be73){var _0x271c80={'raw':!![],'where':{'id':_0x12f13f[_0x42bf('0x3f')]['id']}},_0x45cae0={};_0x45cae0[_0x42bf('0x2c')]=_[_0x42bf('0x40')](db[_0x42bf('0x29')][_0x42bf('0x2a')]);_0x45cae0[_0x42bf('0x2d')]=_[_0x42bf('0x40')](_0x12f13f['query']);_0x45cae0[_0x42bf('0x2e')]=_['intersection'](_0x45cae0[_0x42bf('0x2c')],_0x45cae0[_0x42bf('0x2d')]);_0x271c80['attributes']=_[_0x42bf('0x2f')](_0x45cae0['model'],qs[_0x42bf('0x31')](_0x12f13f[_0x42bf('0x2d')][_0x42bf('0x31')]));_0x271c80[_0x42bf('0x30')]=_0x271c80['attributes'][_0x42bf('0x32')]?_0x271c80[_0x42bf('0x30')]:_0x45cae0[_0x42bf('0x2c')];if(_0x12f13f['query'][_0x42bf('0x41')]){_0x271c80['include']=[{'all':!![]}];}_0x271c80=_[_0x42bf('0x3a')]({},_0x271c80,_0x12f13f['options']);return db[_0x42bf('0x29')]['find'](_0x271c80)['then'](handleEntityNotFound(_0xa5be73,null))[_0x42bf('0x22')](respondWithResult(_0xa5be73,null))[_0x42bf('0x3d')](handleError(_0xa5be73,null));};exports['create']=function(_0x28c385,_0x37f184){return db[_0x42bf('0x29')][_0x42bf('0x42')](_0x28c385[_0x42bf('0x43')],{})[_0x42bf('0x22')](respondWithResult(_0x37f184,0xc9))[_0x42bf('0x3d')](handleError(_0x37f184,null));};exports[_0x42bf('0x21')]=function(_0x1c8140,_0x441ff7){if(_0x1c8140[_0x42bf('0x43')]['id']){delete _0x1c8140['body']['id'];}return db['MailServerOut'][_0x42bf('0x44')]({'where':{'id':_0x1c8140[_0x42bf('0x3f')]['id']}})[_0x42bf('0x22')](handleEntityNotFound(_0x441ff7,null))[_0x42bf('0x22')](saveUpdates(_0x1c8140[_0x42bf('0x43')],null))[_0x42bf('0x22')](respondWithResult(_0x441ff7,null))[_0x42bf('0x3d')](handleError(_0x441ff7,null));};exports[_0x42bf('0x23')]=function(_0x25ce99,_0x6d951d){return db[_0x42bf('0x29')]['find']({'where':{'id':_0x25ce99[_0x42bf('0x3f')]['id']}})['then'](handleEntityNotFound(_0x6d951d,null))[_0x42bf('0x22')](removeEntity(_0x6d951d,null))[_0x42bf('0x3d')](handleError(_0x6d951d,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 3eaf967..e5e9bf1 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 _0x4711=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger','api'];(function(_0x568888,_0x3de4f8){var _0x335dea=function(_0x231999){while(--_0x231999){_0x568888['push'](_0x568888['shift']());}};_0x335dea(++_0x3de4f8);}(_0x4711,0x114));var _0x1471=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4711[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1471('0x0'));var util=require(_0x1471('0x1'));var logger=require(_0x1471('0x2'))(_0x1471('0x3'));var moment=require(_0x1471('0x4'));var BPromise=require(_0x1471('0x5'));var rp=require(_0x1471('0x6'));var fs=require('fs');var path=require(_0x1471('0x7'));var rimraf=require(_0x1471('0x8'));var config=require(_0x1471('0x9'));var attributes=require(_0x1471('0xa'));module[_0x1471('0xb')]=function(_0x445782,_0x4f8871){return _0x445782[_0x1471('0xc')](_0x1471('0xd'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25f3=['./mailServerOut.attributes','exports','mail_servers_out','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a7389,_0xa99bd9){var _0x246ee8=function(_0x29cbb0){while(--_0x29cbb0){_0x4a7389['push'](_0x4a7389['shift']());}};_0x246ee8(++_0xa99bd9);}(_0x25f3,0x19b));var _0x325f=function(_0x920f4f,_0x1fa813){_0x920f4f=_0x920f4f-0x0;var _0x3e06f6=_0x25f3[_0x920f4f];return _0x3e06f6;};'use strict';var _=require(_0x325f('0x0'));var util=require(_0x325f('0x1'));var logger=require('../../config/logger')(_0x325f('0x2'));var moment=require(_0x325f('0x3'));var BPromise=require(_0x325f('0x4'));var rp=require(_0x325f('0x5'));var fs=require('fs');var path=require(_0x325f('0x6'));var rimraf=require(_0x325f('0x7'));var config=require(_0x325f('0x8'));var attributes=require(_0x325f('0x9'));module[_0x325f('0xa')]=function(_0x49158f,_0xa85e13){return _0x49158f['define']('MailServerOut',attributes,{'tableName':_0x325f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 8b8c558..67e17bf 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3efade,_0x48eda9){var _0x21018f=function(_0x36d2b3){while(--_0x36d2b3){_0x3efade['push'](_0x3efade['shift']());}};_0x21018f(++_0x48eda9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53ffcd,_0x163a75){_0x53ffcd=_0x53ffcd-0x0;var _0x5efe68=_0x5f2f[_0x53ffcd];return _0x5efe68;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x294aef,_0x378f98){var _0x4d235d=function(_0x105d6c){while(--_0x105d6c){_0x294aef['push'](_0x294aef['shift']());}};_0x4d235d(++_0x378f98);}(_0x2ef3,0xba));var _0x32ef=function(_0x69e74e,_0x8ec573){_0x69e74e=_0x69e74e-0x0;var _0x4d9bc2=_0x2ef3[_0x69e74e];return _0x4d9bc2;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c75b130..a5683d6 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 _0xcb3f=['put','update','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/:id','show','create'];(function(_0x479d46,_0x49a822){var _0x5809c0=function(_0x2a412c){while(--_0x2a412c){_0x479d46['push'](_0x479d46['shift']());}};_0x5809c0(++_0x49a822);}(_0xcb3f,0x1a2));var _0xfcb3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xcb3f[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcb3('0x0'));var timeout=require(_0xfcb3('0x1'));var express=require(_0xfcb3('0x2'));var router=express[_0xfcb3('0x3')]();var fs_extra=require(_0xfcb3('0x4'));var auth=require(_0xfcb3('0x5'));var interaction=require(_0xfcb3('0x6'));var config=require(_0xfcb3('0x7'));var controller=require(_0xfcb3('0x8'));router[_0xfcb3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfcb3('0x9')]('/describe',auth[_0xfcb3('0xa')](),controller['describe']);router['get'](_0xfcb3('0xb'),auth[_0xfcb3('0xa')](),controller[_0xfcb3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfcb3('0xd')]);router[_0xfcb3('0xe')]('/:id',auth[_0xfcb3('0xa')](),controller[_0xfcb3('0xf')]);router['delete'](_0xfcb3('0xb'),auth[_0xfcb3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7c11=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','create','put'];(function(_0x236e98,_0x3c93cc){var _0x4d0037=function(_0x422b03){while(--_0x422b03){_0x236e98['push'](_0x236e98['shift']());}};_0x4d0037(++_0x3c93cc);}(_0x7c11,0x1bb));var _0x17c1=function(_0x9c1765,_0x39a960){_0x9c1765=_0x9c1765-0x0;var _0x229f37=_0x7c11[_0x9c1765];return _0x229f37;};'use strict';var multer=require(_0x17c1('0x0'));var util=require(_0x17c1('0x1'));var path=require(_0x17c1('0x2'));var timeout=require(_0x17c1('0x3'));var express=require(_0x17c1('0x4'));var router=express[_0x17c1('0x5')]();var fs_extra=require(_0x17c1('0x6'));var auth=require(_0x17c1('0x7'));var interaction=require(_0x17c1('0x8'));var config=require(_0x17c1('0x9'));var controller=require('./mailSubstatus.controller');router[_0x17c1('0xa')]('/',auth[_0x17c1('0xb')](),controller['index']);router[_0x17c1('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x17c1('0xc')]);router[_0x17c1('0xa')](_0x17c1('0xd'),auth[_0x17c1('0xb')](),controller[_0x17c1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x17c1('0xf')]);router[_0x17c1('0x10')](_0x17c1('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x17c1('0x11')]('/:id',auth[_0x17c1('0xb')](),controller[_0x17c1('0x12')]);module[_0x17c1('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index e2f48de..09de455 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e0e=['STRING','sequelize','exports','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5e0e,0x89));var _0xe5e0=function(_0x38300c,_0x4618b9){_0x38300c=_0x38300c-0x0;var _0x591bf6=_0x5e0e[_0x38300c];return _0x591bf6;};'use strict';var Sequelize=require(_0xe5e0('0x0'));module[_0xe5e0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe5e0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe5e0('0x3')]}}; \ No newline at end of file +var _0xae30=['exports','STRING','sequelize'];(function(_0x4f2bea,_0x31c82c){var _0x1dc4ab=function(_0x29fb01){while(--_0x29fb01){_0x4f2bea['push'](_0x4f2bea['shift']());}};_0x1dc4ab(++_0x31c82c);}(_0xae30,0x10a));var _0x0ae3=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xae30[_0x57975f];return _0x4793b8;};'use strict';var Sequelize=require(_0x0ae3('0x0'));module[_0x0ae3('0x1')]={'name':{'type':Sequelize[_0x0ae3('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0ae3('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index b9c8601..aabdcbd 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 _0x01b9=['show','params','rawAttributes','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','index','MailSubstatus','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x45ff96,_0x112ccb){var _0x35fa6a=function(_0x1a4edd){while(--_0x1a4edd){_0x45ff96['push'](_0x45ff96['shift']());}};_0x35fa6a(++_0x112ccb);}(_0x01b9,0xde));var _0x901b=function(_0x285dc0,_0x5d6d04){_0x285dc0=_0x285dc0-0x0;var _0x5c26f5=_0x01b9[_0x285dc0];return _0x5c26f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x901b('0x0'));var zipdir=require(_0x901b('0x1'));var jsonpatch=require(_0x901b('0x2'));var rp=require(_0x901b('0x3'));var moment=require('moment');var BPromise=require(_0x901b('0x4'));var Mustache=require(_0x901b('0x5'));var util=require(_0x901b('0x6'));var path=require(_0x901b('0x7'));var sox=require(_0x901b('0x8'));var csv=require(_0x901b('0x9'));var ejs=require(_0x901b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x901b('0xb'));var crypto=require(_0x901b('0xc'));var jsforce=require(_0x901b('0xd'));var deskjs=require(_0x901b('0xe'));var toCsv=require(_0x901b('0x9'));var querystring=require('querystring');var Papa=require(_0x901b('0xf'));var Redis=require(_0x901b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x901b('0x11'));var as=require(_0x901b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901b('0x13'))(_0x901b('0x14'));var utils=require(_0x901b('0x15'));var config=require(_0x901b('0x16'));var licenseUtil=require(_0x901b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7ba30d,_0x3a8a50){_0x3a8a50=_0x3a8a50||0xcc;return function(_0x51c7c4){if(_0x51c7c4){return _0x7ba30d[_0x901b('0x18')](_0x3a8a50);}return _0x7ba30d['status'](_0x3a8a50)[_0x901b('0x19')]();};}function respondWithResult(_0x5dc5fc,_0x282304){_0x282304=_0x282304||0xc8;return function(_0x1d2f58){if(_0x1d2f58){return _0x5dc5fc[_0x901b('0x1a')](_0x282304)[_0x901b('0x1b')](_0x1d2f58);}};}function respondWithFilteredResult(_0x7401fd,_0x1186ec){return function(_0x272c14){if(_0x272c14){var _0x4941f8=typeof _0x1186ec[_0x901b('0x1c')]===_0x901b('0x1d')&&typeof _0x1186ec[_0x901b('0x1e')]===_0x901b('0x1d');var _0x4f766f=_0x272c14[_0x901b('0x1f')];var _0x490d5e=_0x4941f8?0x0:_0x1186ec[_0x901b('0x1c')];var _0x1fdbfb=_0x4941f8?_0x272c14[_0x901b('0x1f')]:_0x1186ec[_0x901b('0x1c')]+_0x1186ec[_0x901b('0x1e')];var _0x556dc7;if(_0x1fdbfb>=_0x4f766f){_0x1fdbfb=_0x4f766f;_0x556dc7=0xc8;}else{_0x556dc7=0xce;}_0x7401fd[_0x901b('0x1a')](_0x556dc7);return _0x7401fd[_0x901b('0x20')](_0x901b('0x21'),_0x490d5e+'-'+_0x1fdbfb+'/'+_0x4f766f)['json'](_0x272c14);}return null;};}function patchUpdates(_0x27995f){return function(_0x28111b){try{jsonpatch['apply'](_0x28111b,_0x27995f,!![]);}catch(_0x176d48){return BPromise['reject'](_0x176d48);}return _0x28111b['save']();};}function saveUpdates(_0x3d1c25,_0x731c89){return function(_0x356bb4){if(_0x356bb4){return _0x356bb4[_0x901b('0x22')](_0x3d1c25)[_0x901b('0x23')](function(_0x32f93c){return _0x32f93c;});}return null;};}function removeEntity(_0x26daf1,_0x55bc09){return function(_0x3e0521){if(_0x3e0521){return _0x3e0521['destroy']()[_0x901b('0x23')](function(){_0x26daf1[_0x901b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa137a0,_0x46f117){return function(_0x291859){if(!_0x291859){_0xa137a0[_0x901b('0x18')](0x194);}return _0x291859;};}function handleError(_0x35348b,_0x572643){_0x572643=_0x572643||0x1f4;return function(_0x39367d){logger[_0x901b('0x24')](_0x39367d[_0x901b('0x25')]);if(_0x39367d[_0x901b('0x26')]){delete _0x39367d[_0x901b('0x26')];}_0x35348b[_0x901b('0x1a')](_0x572643)[_0x901b('0x27')](_0x39367d);};}exports[_0x901b('0x28')]=function(_0x436c32,_0x5cecef){var _0x4d4e1d={},_0x4b0926={},_0x55e2c3={'count':0x0,'rows':[]};var _0x4eca4d=_['map'](db[_0x901b('0x29')]['rawAttributes'],function(_0x573813){return{'name':_0x573813[_0x901b('0x2a')],'type':_0x573813[_0x901b('0x2b')][_0x901b('0x2c')]};});_0x4b0926[_0x901b('0x2d')]=_[_0x901b('0x2e')](_0x4eca4d,_0x901b('0x26'));_0x4b0926['query']=_[_0x901b('0x2f')](_0x436c32[_0x901b('0x30')]);_0x4b0926[_0x901b('0x31')]=_[_0x901b('0x32')](_0x4b0926['model'],_0x4b0926[_0x901b('0x30')]);_0x4d4e1d[_0x901b('0x33')]=_[_0x901b('0x32')](_0x4b0926['model'],qs[_0x901b('0x34')](_0x436c32[_0x901b('0x30')][_0x901b('0x34')]));_0x4d4e1d[_0x901b('0x33')]=_0x4d4e1d[_0x901b('0x33')]['length']?_0x4d4e1d[_0x901b('0x33')]:_0x4b0926['model'];if(!_0x436c32['query'][_0x901b('0x35')](_0x901b('0x36'))){_0x4d4e1d[_0x901b('0x1e')]=qs[_0x901b('0x1e')](_0x436c32[_0x901b('0x30')][_0x901b('0x1e')]);_0x4d4e1d[_0x901b('0x1c')]=qs[_0x901b('0x1c')](_0x436c32[_0x901b('0x30')][_0x901b('0x1c')]);}_0x4d4e1d[_0x901b('0x37')]=qs[_0x901b('0x38')](_0x436c32[_0x901b('0x30')][_0x901b('0x38')]);_0x4d4e1d[_0x901b('0x39')]=qs[_0x901b('0x31')](_['pick'](_0x436c32[_0x901b('0x30')],_0x4b0926[_0x901b('0x31')]),_0x4eca4d);if(_0x436c32['query'][_0x901b('0x3a')]){_0x4d4e1d[_0x901b('0x39')]=_[_0x901b('0x3b')](_0x4d4e1d[_0x901b('0x39')],{'$or':_[_0x901b('0x2e')](_0x4eca4d,function(_0x44f47d){if(_0x44f47d[_0x901b('0x2b')]!=='VIRTUAL'){var _0x364a43={};_0x364a43[_0x44f47d[_0x901b('0x26')]]={'$like':'%'+_0x436c32[_0x901b('0x30')][_0x901b('0x3a')]+'%'};return _0x364a43;}})});}_0x4d4e1d=_[_0x901b('0x3b')]({},_0x4d4e1d,_0x436c32[_0x901b('0x3c')]);var _0x114ba5={'where':_0x4d4e1d[_0x901b('0x39')]};return db[_0x901b('0x29')]['count'](_0x114ba5)['then'](function(_0x574229){_0x55e2c3[_0x901b('0x1f')]=_0x574229;if(_0x436c32[_0x901b('0x30')][_0x901b('0x3d')]){_0x4d4e1d[_0x901b('0x3e')]=[{'all':!![]}];}return db[_0x901b('0x29')][_0x901b('0x3f')](_0x4d4e1d);})[_0x901b('0x23')](function(_0x51b434){_0x55e2c3[_0x901b('0x40')]=_0x51b434;return _0x55e2c3;})['then'](respondWithFilteredResult(_0x5cecef,_0x4d4e1d))[_0x901b('0x41')](handleError(_0x5cecef,null));};exports[_0x901b('0x42')]=function(_0x493468,_0x15b74e){var _0x13369b={'raw':!![],'where':{'id':_0x493468[_0x901b('0x43')]['id']}},_0x5e1129={};_0x5e1129[_0x901b('0x2d')]=_[_0x901b('0x2f')](db[_0x901b('0x29')][_0x901b('0x44')]);_0x5e1129[_0x901b('0x30')]=_['keys'](_0x493468[_0x901b('0x30')]);_0x5e1129[_0x901b('0x31')]=_['intersection'](_0x5e1129[_0x901b('0x2d')],_0x5e1129[_0x901b('0x30')]);_0x13369b[_0x901b('0x33')]=_[_0x901b('0x32')](_0x5e1129[_0x901b('0x2d')],qs[_0x901b('0x34')](_0x493468['query']['fields']));_0x13369b['attributes']=_0x13369b[_0x901b('0x33')]['length']?_0x13369b[_0x901b('0x33')]:_0x5e1129[_0x901b('0x2d')];if(_0x493468[_0x901b('0x30')]['includeAll']){_0x13369b['include']=[{'all':!![]}];}_0x13369b=_['merge']({},_0x13369b,_0x493468[_0x901b('0x3c')]);return db[_0x901b('0x29')]['find'](_0x13369b)[_0x901b('0x23')](handleEntityNotFound(_0x15b74e,null))['then'](respondWithResult(_0x15b74e,null))[_0x901b('0x41')](handleError(_0x15b74e,null));};exports[_0x901b('0x45')]=function(_0x5a3d3f,_0x31203e){return db['MailSubstatus'][_0x901b('0x45')](_0x5a3d3f[_0x901b('0x46')],{})[_0x901b('0x23')](respondWithResult(_0x31203e,0xc9))[_0x901b('0x41')](handleError(_0x31203e,null));};exports[_0x901b('0x22')]=function(_0x7e66ab,_0x40c888){if(_0x7e66ab['body']['id']){delete _0x7e66ab[_0x901b('0x46')]['id'];}return db['MailSubstatus'][_0x901b('0x47')]({'where':{'id':_0x7e66ab[_0x901b('0x43')]['id']}})[_0x901b('0x23')](handleEntityNotFound(_0x40c888,null))[_0x901b('0x23')](saveUpdates(_0x7e66ab['body'],null))[_0x901b('0x23')](respondWithResult(_0x40c888,null))[_0x901b('0x41')](handleError(_0x40c888,null));};exports['destroy']=function(_0x71bb1c,_0x416504){return db[_0x901b('0x29')]['find']({'where':{'id':_0x71bb1c[_0x901b('0x43')]['id']}})[_0x901b('0x23')](handleEntityNotFound(_0x416504,null))['then'](removeEntity(_0x416504,null))[_0x901b('0x41')](handleError(_0x416504,null));};exports['describe']=function(_0x5c87ac,_0x3b7852){return db[_0x901b('0x29')]['describe']()[_0x901b('0x23')](respondWithResult(_0x3b7852,null))[_0x901b('0x41')](handleError(_0x3b7852,null));}; \ No newline at end of file +var _0x6ca3=['then','destroy','error','name','send','MailSubstatus','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6ca3,0x72));var _0x36ca=function(_0x2c3201,_0x1f76ff){_0x2c3201=_0x2c3201-0x0;var _0x564fc4=_0x6ca3[_0x2c3201];return _0x564fc4;};'use strict';var emlformat=require(_0x36ca('0x0'));var rimraf=require(_0x36ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36ca('0x2'));var rp=require(_0x36ca('0x3'));var moment=require(_0x36ca('0x4'));var BPromise=require(_0x36ca('0x5'));var Mustache=require(_0x36ca('0x6'));var util=require('util');var path=require('path');var sox=require(_0x36ca('0x7'));var csv=require(_0x36ca('0x8'));var ejs=require(_0x36ca('0x9'));var fs=require('fs');var fs_extra=require(_0x36ca('0xa'));var _=require(_0x36ca('0xb'));var squel=require(_0x36ca('0xc'));var crypto=require(_0x36ca('0xd'));var jsforce=require(_0x36ca('0xe'));var deskjs=require(_0x36ca('0xf'));var toCsv=require(_0x36ca('0x8'));var querystring=require('querystring');var Papa=require(_0x36ca('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x36ca('0x11'));var as=require(_0x36ca('0x12'));var hardwareService=require(_0x36ca('0x13'));var logger=require('../../config/logger')(_0x36ca('0x14'));var utils=require(_0x36ca('0x15'));var config=require(_0x36ca('0x16'));var licenseUtil=require(_0x36ca('0x17'));var db=require(_0x36ca('0x18'))['db'];function respondWithStatusCode(_0x3f1998,_0x545cbd){_0x545cbd=_0x545cbd||0xcc;return function(_0x28f057){if(_0x28f057){return _0x3f1998[_0x36ca('0x19')](_0x545cbd);}return _0x3f1998[_0x36ca('0x1a')](_0x545cbd)[_0x36ca('0x1b')]();};}function respondWithResult(_0x4c4339,_0x1abb2f){_0x1abb2f=_0x1abb2f||0xc8;return function(_0x40012f){if(_0x40012f){return _0x4c4339[_0x36ca('0x1a')](_0x1abb2f)[_0x36ca('0x1c')](_0x40012f);}};}function respondWithFilteredResult(_0x3a905a,_0x33fc81){return function(_0x2feee4){if(_0x2feee4){var _0x1adf2c=typeof _0x33fc81['offset']===_0x36ca('0x1d')&&typeof _0x33fc81[_0x36ca('0x1e')]===_0x36ca('0x1d');var _0x41b029=_0x2feee4[_0x36ca('0x1f')];var _0x1f42cf=_0x1adf2c?0x0:_0x33fc81[_0x36ca('0x20')];var _0x378b9e=_0x1adf2c?_0x2feee4[_0x36ca('0x1f')]:_0x33fc81[_0x36ca('0x20')]+_0x33fc81[_0x36ca('0x1e')];var _0x3884ce;if(_0x378b9e>=_0x41b029){_0x378b9e=_0x41b029;_0x3884ce=0xc8;}else{_0x3884ce=0xce;}_0x3a905a[_0x36ca('0x1a')](_0x3884ce);return _0x3a905a[_0x36ca('0x21')](_0x36ca('0x22'),_0x1f42cf+'-'+_0x378b9e+'/'+_0x41b029)[_0x36ca('0x1c')](_0x2feee4);}return null;};}function patchUpdates(_0x5b89a9){return function(_0x4b5ae6){try{jsonpatch[_0x36ca('0x23')](_0x4b5ae6,_0x5b89a9,!![]);}catch(_0x3da8cf){return BPromise['reject'](_0x3da8cf);}return _0x4b5ae6[_0x36ca('0x24')]();};}function saveUpdates(_0x3985e7,_0x42d980){return function(_0x5160ec){if(_0x5160ec){return _0x5160ec[_0x36ca('0x25')](_0x3985e7)[_0x36ca('0x26')](function(_0x4208d5){return _0x4208d5;});}return null;};}function removeEntity(_0x5516a4,_0x24038c){return function(_0x4fb228){if(_0x4fb228){return _0x4fb228[_0x36ca('0x27')]()['then'](function(){_0x5516a4[_0x36ca('0x1a')](0xcc)[_0x36ca('0x1b')]();});}};}function handleEntityNotFound(_0x1df7da,_0x5f17d7){return function(_0x293147){if(!_0x293147){_0x1df7da['sendStatus'](0x194);}return _0x293147;};}function handleError(_0xbdee57,_0x390912){_0x390912=_0x390912||0x1f4;return function(_0x508d07){logger[_0x36ca('0x28')](_0x508d07['stack']);if(_0x508d07[_0x36ca('0x29')]){delete _0x508d07[_0x36ca('0x29')];}_0xbdee57['status'](_0x390912)[_0x36ca('0x2a')](_0x508d07);};}exports['index']=function(_0x59163d,_0x48cc57){var _0x1d6eb9={},_0x3e9552={},_0x2e6186={'count':0x0,'rows':[]};var _0x535c5f=_['map'](db[_0x36ca('0x2b')][_0x36ca('0x2c')],function(_0x8d2f8f){return{'name':_0x8d2f8f[_0x36ca('0x2d')],'type':_0x8d2f8f[_0x36ca('0x2e')][_0x36ca('0x2f')]};});_0x3e9552['model']=_[_0x36ca('0x30')](_0x535c5f,_0x36ca('0x29'));_0x3e9552[_0x36ca('0x31')]=_[_0x36ca('0x32')](_0x59163d[_0x36ca('0x31')]);_0x3e9552[_0x36ca('0x33')]=_[_0x36ca('0x34')](_0x3e9552['model'],_0x3e9552[_0x36ca('0x31')]);_0x1d6eb9[_0x36ca('0x35')]=_[_0x36ca('0x34')](_0x3e9552[_0x36ca('0x36')],qs[_0x36ca('0x37')](_0x59163d['query']['fields']));_0x1d6eb9['attributes']=_0x1d6eb9[_0x36ca('0x35')][_0x36ca('0x38')]?_0x1d6eb9[_0x36ca('0x35')]:_0x3e9552[_0x36ca('0x36')];if(!_0x59163d[_0x36ca('0x31')][_0x36ca('0x39')](_0x36ca('0x3a'))){_0x1d6eb9[_0x36ca('0x1e')]=qs[_0x36ca('0x1e')](_0x59163d[_0x36ca('0x31')][_0x36ca('0x1e')]);_0x1d6eb9['offset']=qs['offset'](_0x59163d[_0x36ca('0x31')][_0x36ca('0x20')]);}_0x1d6eb9['order']=qs[_0x36ca('0x3b')](_0x59163d['query'][_0x36ca('0x3b')]);_0x1d6eb9[_0x36ca('0x3c')]=qs['filters'](_[_0x36ca('0x3d')](_0x59163d[_0x36ca('0x31')],_0x3e9552[_0x36ca('0x33')]),_0x535c5f);if(_0x59163d[_0x36ca('0x31')][_0x36ca('0x3e')]){_0x1d6eb9[_0x36ca('0x3c')]=_[_0x36ca('0x3f')](_0x1d6eb9[_0x36ca('0x3c')],{'$or':_[_0x36ca('0x30')](_0x535c5f,function(_0x20095a){if(_0x20095a[_0x36ca('0x2e')]!=='VIRTUAL'){var _0x5a2a4f={};_0x5a2a4f[_0x20095a[_0x36ca('0x29')]]={'$like':'%'+_0x59163d['query']['filter']+'%'};return _0x5a2a4f;}})});}_0x1d6eb9=_[_0x36ca('0x3f')]({},_0x1d6eb9,_0x59163d[_0x36ca('0x40')]);var _0x1eb718={'where':_0x1d6eb9[_0x36ca('0x3c')]};return db['MailSubstatus'][_0x36ca('0x1f')](_0x1eb718)[_0x36ca('0x26')](function(_0x119a1f){_0x2e6186[_0x36ca('0x1f')]=_0x119a1f;if(_0x59163d[_0x36ca('0x31')][_0x36ca('0x41')]){_0x1d6eb9[_0x36ca('0x42')]=[{'all':!![]}];}return db['MailSubstatus'][_0x36ca('0x43')](_0x1d6eb9);})[_0x36ca('0x26')](function(_0x1947c4){_0x2e6186[_0x36ca('0x44')]=_0x1947c4;return _0x2e6186;})[_0x36ca('0x26')](respondWithFilteredResult(_0x48cc57,_0x1d6eb9))[_0x36ca('0x45')](handleError(_0x48cc57,null));};exports[_0x36ca('0x46')]=function(_0xfc390e,_0x51846a){var _0x4613ce={'raw':!![],'where':{'id':_0xfc390e[_0x36ca('0x47')]['id']}},_0x2f3b14={};_0x2f3b14[_0x36ca('0x36')]=_[_0x36ca('0x32')](db['MailSubstatus'][_0x36ca('0x2c')]);_0x2f3b14[_0x36ca('0x31')]=_[_0x36ca('0x32')](_0xfc390e['query']);_0x2f3b14[_0x36ca('0x33')]=_[_0x36ca('0x34')](_0x2f3b14[_0x36ca('0x36')],_0x2f3b14[_0x36ca('0x31')]);_0x4613ce[_0x36ca('0x35')]=_[_0x36ca('0x34')](_0x2f3b14[_0x36ca('0x36')],qs[_0x36ca('0x37')](_0xfc390e['query']['fields']));_0x4613ce[_0x36ca('0x35')]=_0x4613ce[_0x36ca('0x35')][_0x36ca('0x38')]?_0x4613ce[_0x36ca('0x35')]:_0x2f3b14[_0x36ca('0x36')];if(_0xfc390e[_0x36ca('0x31')]['includeAll']){_0x4613ce[_0x36ca('0x42')]=[{'all':!![]}];}_0x4613ce=_[_0x36ca('0x3f')]({},_0x4613ce,_0xfc390e[_0x36ca('0x40')]);return db[_0x36ca('0x2b')][_0x36ca('0x48')](_0x4613ce)[_0x36ca('0x26')](handleEntityNotFound(_0x51846a,null))[_0x36ca('0x26')](respondWithResult(_0x51846a,null))[_0x36ca('0x45')](handleError(_0x51846a,null));};exports[_0x36ca('0x49')]=function(_0x10e7fa,_0x23fef7){return db[_0x36ca('0x2b')][_0x36ca('0x49')](_0x10e7fa[_0x36ca('0x4a')],{})[_0x36ca('0x26')](respondWithResult(_0x23fef7,0xc9))[_0x36ca('0x45')](handleError(_0x23fef7,null));};exports['update']=function(_0x33e9ae,_0xe217d6){if(_0x33e9ae[_0x36ca('0x4a')]['id']){delete _0x33e9ae[_0x36ca('0x4a')]['id'];}return db[_0x36ca('0x2b')][_0x36ca('0x48')]({'where':{'id':_0x33e9ae['params']['id']}})[_0x36ca('0x26')](handleEntityNotFound(_0xe217d6,null))[_0x36ca('0x26')](saveUpdates(_0x33e9ae['body'],null))['then'](respondWithResult(_0xe217d6,null))[_0x36ca('0x45')](handleError(_0xe217d6,null));};exports[_0x36ca('0x27')]=function(_0x4ae8cb,_0x45b209){return db[_0x36ca('0x2b')][_0x36ca('0x48')]({'where':{'id':_0x4ae8cb[_0x36ca('0x47')]['id']}})['then'](handleEntityNotFound(_0x45b209,null))[_0x36ca('0x26')](removeEntity(_0x45b209,null))[_0x36ca('0x45')](handleError(_0x45b209,null));};exports[_0x36ca('0x4b')]=function(_0x2373c5,_0x41d0bd){return db[_0x36ca('0x2b')][_0x36ca('0x4b')]()[_0x36ca('0x26')](respondWithResult(_0x41d0bd,null))['catch'](handleError(_0x41d0bd,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index c9cab89..b69dabe 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 _0x56d6=['../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x2e6c8d,_0x17c7ef){var _0x259c0f=function(_0x97387a){while(--_0x97387a){_0x2e6c8d['push'](_0x2e6c8d['shift']());}};_0x259c0f(++_0x17c7ef);}(_0x56d6,0x68));var _0x656d=function(_0x307aa8,_0x462387){_0x307aa8=_0x307aa8-0x0;var _0x1ffb73=_0x56d6[_0x307aa8];return _0x1ffb73;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x656d('0x0'))['db'][_0x656d('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x656d('0x2')](0x0);var events={'afterUpdate':_0x656d('0x3')};function emitEvent(_0x32e755){return function(_0x57bef4,_0x2ad741,_0xa347bb){MailSubstatusEvents['emit'](_0x32e755+':'+_0x57bef4['id'],_0x57bef4);MailSubstatusEvents[_0x656d('0x4')](_0x32e755,_0x57bef4);_0xa347bb(null);};}for(var e in events){if(events[_0x656d('0x5')](e)){var event=events[e];MailSubstatus[_0x656d('0x6')](e,emitEvent(event));}}module[_0x656d('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x3ad2=['update','emit','hasOwnProperty','hook','exports','events','MailSubstatus'];(function(_0x180f71,_0x16393a){var _0x1e6bb9=function(_0x41f87f){while(--_0x41f87f){_0x180f71['push'](_0x180f71['shift']());}};_0x1e6bb9(++_0x16393a);}(_0x3ad2,0x1e8));var _0x23ad=function(_0x35f7c8,_0x4808eb){_0x35f7c8=_0x35f7c8-0x0;var _0x30bda5=_0x3ad2[_0x35f7c8];return _0x30bda5;};'use strict';var EventEmitter=require(_0x23ad('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x23ad('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x23ad('0x2')};function emitEvent(_0x20f69a){return function(_0x249b66,_0x4b2e5c,_0x9319a1){MailSubstatusEvents['emit'](_0x20f69a+':'+_0x249b66['id'],_0x249b66);MailSubstatusEvents[_0x23ad('0x3')](_0x20f69a,_0x249b66);_0x9319a1(null);};}for(var e in events){if(events[_0x23ad('0x4')](e)){var event=events[e];MailSubstatus[_0x23ad('0x5')](e,emitEvent(event));}}module[_0x23ad('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 2189a8c..3bfcbc1 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 _0x70b7=['catch','exports','models','define','MailSubstatus','mail_substatuses','Condition','name'];(function(_0x52ed93,_0x55cdc6){var _0x51f31f=function(_0x26dc19){while(--_0x26dc19){_0x52ed93['push'](_0x52ed93['shift']());}};_0x51f31f(++_0x55cdc6);}(_0x70b7,0x1e9));var _0x770b=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0x70b7[_0x382e89];return _0x3a1318;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x770b('0x0')]=function(_0x4e0920){var _0x46c950=_0x4e0920[_0x770b('0x1')];return _0x4e0920[_0x770b('0x2')](_0x770b('0x3'),attributes,{'tableName':_0x770b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x51dfe9,_0x50d706,_0x2ec80c){return _0x46c950[_0x770b('0x5')]['update']({'value':_0x51dfe9[_0x770b('0x6')]},{'where':{'field':'mailSubstatus','value':_0x51dfe9['_previousDataValues'][_0x770b('0x6')]}})['then'](function(){_0x2ec80c();})[_0x770b('0x7')](function(_0x4533d4){_0x2ec80c(_0x4533d4);});}}});}; \ No newline at end of file +var _0x2b4c=['MailSubstatus','Condition','update','name','mailSubstatus','_previousDataValues','./mailSubstatus.attributes','exports','models','define'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2b4c,0xc4));var _0xc2b4=function(_0x2e8601,_0x14cc63){_0x2e8601=_0x2e8601-0x0;var _0x35a21a=_0x2b4c[_0x2e8601];return _0x35a21a;};'use strict';var attributes=require(_0xc2b4('0x0'));module[_0xc2b4('0x1')]=function(_0x6d3a8c){var _0x1867be=_0x6d3a8c[_0xc2b4('0x2')];return _0x6d3a8c[_0xc2b4('0x3')](_0xc2b4('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2e4802,_0x1da17f,_0x306371){return _0x1867be[_0xc2b4('0x5')][_0xc2b4('0x6')]({'value':_0x2e4802[_0xc2b4('0x7')]},{'where':{'field':_0xc2b4('0x8'),'value':_0x2e4802[_0xc2b4('0x9')][_0xc2b4('0x7')]}})['then'](function(){_0x306371();})['catch'](function(_0x37f031){_0x306371(_0x37f031);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 9686610..55624be 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 _0xb7d0=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb7d0,0x1ce));var _0x0b7d=function(_0x1ee477,_0xe2f0a2){_0x1ee477=_0x1ee477-0x0;var _0x33ce18=_0xb7d0[_0x1ee477];return _0x33ce18;};'use strict';var _=require(_0x0b7d('0x0'));var util=require(_0x0b7d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0b7d('0x2'));var fs=require('fs');var Redis=require(_0x0b7d('0x3'));var db=require(_0x0b7d('0x4'))['db'];var utils=require(_0x0b7d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0b7d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0b7d('0x7')][_0x0b7d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26c15c,_0x577e05,_0x467375){return new BPromise(function(_0x2d2cc,_0x2471c5){return client[_0x0b7d('0x9')](_0x26c15c,_0x467375)[_0x0b7d('0xa')](function(_0x1f4bdf){logger[_0x0b7d('0xb')](_0x0b7d('0xc'),_0x577e05,_0x0b7d('0xd'));logger[_0x0b7d('0xe')](_0x0b7d('0xf'),_0x577e05,_0x0b7d('0xd'),JSON[_0x0b7d('0x10')](_0x1f4bdf));if(_0x1f4bdf[_0x0b7d('0x11')]){if(_0x1f4bdf[_0x0b7d('0x11')][_0x0b7d('0x12')]===0x1f4){logger[_0x0b7d('0x11')](_0x0b7d('0xc'),_0x577e05,_0x1f4bdf[_0x0b7d('0x11')][_0x0b7d('0x13')]);return _0x2471c5(_0x1f4bdf[_0x0b7d('0x11')][_0x0b7d('0x13')]);}logger[_0x0b7d('0x11')](_0x0b7d('0xc'),_0x577e05,_0x1f4bdf['error'][_0x0b7d('0x13')]);return _0x2d2cc(_0x1f4bdf[_0x0b7d('0x11')][_0x0b7d('0x13')]);}else{logger[_0x0b7d('0xb')](_0x0b7d('0xc'),_0x577e05,'request\x20sent');_0x2d2cc(_0x1f4bdf[_0x0b7d('0x14')][_0x0b7d('0x13')]);}})[_0x0b7d('0x15')](function(_0x55162d){logger[_0x0b7d('0x11')](_0x0b7d('0xc'),_0x577e05,_0x55162d);_0x2471c5(_0x55162d);});});} \ No newline at end of file +var _0xe588=['info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','lodash','util','randomstring','ioredis','../../config/utils','client','http','request','then'];(function(_0x11503f,_0x30de86){var _0x34caab=function(_0x16e6a6){while(--_0x16e6a6){_0x11503f['push'](_0x11503f['shift']());}};_0x34caab(++_0x30de86);}(_0xe588,0xe1));var _0x8e58=function(_0x195208,_0x2d9f85){_0x195208=_0x195208-0x0;var _0x469052=_0xe588[_0x195208];return _0x469052;};'use strict';var _=require(_0x8e58('0x0'));var util=require(_0x8e58('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e58('0x2'));var fs=require('fs');var Redis=require(_0x8e58('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e58('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8e58('0x5')][_0x8e58('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xac6241,_0x24c037,_0x27e960){return new BPromise(function(_0x47e53a,_0x23e27c){return client[_0x8e58('0x7')](_0xac6241,_0x27e960)[_0x8e58('0x8')](function(_0x5eddde){logger[_0x8e58('0x9')]('MailSubstatus,\x20%s,\x20%s',_0x24c037,_0x8e58('0xa'));logger[_0x8e58('0xb')](_0x8e58('0xc'),_0x24c037,'request\x20sent',JSON[_0x8e58('0xd')](_0x5eddde));if(_0x5eddde[_0x8e58('0xe')]){if(_0x5eddde[_0x8e58('0xe')][_0x8e58('0xf')]===0x1f4){logger[_0x8e58('0xe')](_0x8e58('0x10'),_0x24c037,_0x5eddde[_0x8e58('0xe')][_0x8e58('0x11')]);return _0x23e27c(_0x5eddde[_0x8e58('0xe')][_0x8e58('0x11')]);}logger[_0x8e58('0xe')](_0x8e58('0x10'),_0x24c037,_0x5eddde[_0x8e58('0xe')][_0x8e58('0x11')]);return _0x47e53a(_0x5eddde[_0x8e58('0xe')][_0x8e58('0x11')]);}else{logger['info'](_0x8e58('0x10'),_0x24c037,_0x8e58('0xa'));_0x47e53a(_0x5eddde['result']['message']);}})['catch'](function(_0x17048e){logger[_0x8e58('0xe')](_0x8e58('0x10'),_0x24c037,_0x17048e);_0x23e27c(_0x17048e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 90a8465..dc6249c 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 _0xb836=['multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy','exports'];(function(_0x13bbcb,_0x1aa88b){var _0x19f15f=function(_0x8fac5b){while(--_0x8fac5b){_0x13bbcb['push'](_0x13bbcb['shift']());}};_0x19f15f(++_0x1aa88b);}(_0xb836,0x72));var _0x6b83=function(_0x31c41c,_0x3d739a){_0x31c41c=_0x31c41c-0x0;var _0x174733=_0xb836[_0x31c41c];return _0x174733;};'use strict';var multer=require(_0x6b83('0x0'));var util=require('util');var path=require(_0x6b83('0x1'));var timeout=require('connect-timeout');var express=require(_0x6b83('0x2'));var router=express[_0x6b83('0x3')]();var fs_extra=require(_0x6b83('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6b83('0x5'));var config=require(_0x6b83('0x6'));var controller=require(_0x6b83('0x7'));router[_0x6b83('0x8')]('/',auth[_0x6b83('0x9')](),controller[_0x6b83('0xa')]);router[_0x6b83('0x8')](_0x6b83('0xb'),auth[_0x6b83('0x9')](),controller[_0x6b83('0xc')]);router[_0x6b83('0x8')](_0x6b83('0xd'),auth[_0x6b83('0x9')](),controller[_0x6b83('0xe')]);router[_0x6b83('0xf')]('/',auth[_0x6b83('0x9')](),controller[_0x6b83('0x10')]);router['put'](_0x6b83('0xd'),auth[_0x6b83('0x9')](),controller['update']);router['delete'](_0x6b83('0xd'),auth[_0x6b83('0x9')](),controller[_0x6b83('0x11')]);module[_0x6b83('0x12')]=router; \ No newline at end of file +var _0xf377=['Router','fs-extra','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','/:id','delete','destroy','exports','util','connect-timeout'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xf377,0x7e));var _0x7f37=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xf377[_0x139a3c];return _0x2b375b;};'use strict';var multer=require('multer');var util=require(_0x7f37('0x0'));var path=require('path');var timeout=require(_0x7f37('0x1'));var express=require('express');var router=express[_0x7f37('0x2')]();var fs_extra=require(_0x7f37('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7f37('0x4'));var config=require('../../config/environment');var controller=require(_0x7f37('0x5'));router[_0x7f37('0x6')]('/',auth[_0x7f37('0x7')](),controller['index']);router[_0x7f37('0x6')](_0x7f37('0x8'),auth[_0x7f37('0x7')](),controller[_0x7f37('0x9')]);router[_0x7f37('0x6')]('/:id',auth[_0x7f37('0x7')](),controller[_0x7f37('0xa')]);router[_0x7f37('0xb')]('/',auth[_0x7f37('0x7')](),controller['create']);router['put'](_0x7f37('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x7f37('0xd')](_0x7f37('0xc'),auth[_0x7f37('0x7')](),controller[_0x7f37('0xe')]);module[_0x7f37('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 0a25312..43c1d81 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x194a08,_0x547d43){var _0x520f4e=function(_0x2e9b2a){while(--_0x2e9b2a){_0x194a08['push'](_0x194a08['shift']());}};_0x520f4e(++_0x547d43);}(_0x00bb,0x1d8));var _0xb00b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00bb[_0x311c35];return _0x5cc50c;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3efaae,_0x30d973){var _0x353398=function(_0x95165c){while(--_0x95165c){_0x3efaae['push'](_0x3efaae['shift']());}};_0x353398(++_0x30d973);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 592959d..e73fa6e 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 _0xef83=['VIRTUAL','merge','options','MailTransferReport','include','findAll','catch','keys','includeAll','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xef83,0x1be));var _0x3ef8=function(_0x458c52,_0x5e3fb4){_0x458c52=_0x458c52-0x0;var _0x43f43b=_0xef83[_0x458c52];return _0x43f43b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ef8('0x0'));var zipdir=require(_0x3ef8('0x1'));var jsonpatch=require(_0x3ef8('0x2'));var rp=require(_0x3ef8('0x3'));var moment=require(_0x3ef8('0x4'));var BPromise=require(_0x3ef8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ef8('0x6'));var sox=require('sox');var csv=require(_0x3ef8('0x7'));var ejs=require(_0x3ef8('0x8'));var fs=require('fs');var fs_extra=require(_0x3ef8('0x9'));var _=require(_0x3ef8('0xa'));var squel=require(_0x3ef8('0xb'));var crypto=require(_0x3ef8('0xc'));var jsforce=require(_0x3ef8('0xd'));var deskjs=require(_0x3ef8('0xe'));var toCsv=require(_0x3ef8('0x7'));var querystring=require(_0x3ef8('0xf'));var Papa=require('papaparse');var Redis=require(_0x3ef8('0x10'));var authService=require(_0x3ef8('0x11'));var qs=require(_0x3ef8('0x12'));var as=require(_0x3ef8('0x13'));var hardwareService=require(_0x3ef8('0x14'));var logger=require('../../config/logger')(_0x3ef8('0x15'));var utils=require('../../config/utils');var config=require(_0x3ef8('0x16'));var licenseUtil=require(_0x3ef8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b4c92,_0x37af53){_0x37af53=_0x37af53||0xcc;return function(_0x2e54da){if(_0x2e54da){return _0x5b4c92['sendStatus'](_0x37af53);}return _0x5b4c92[_0x3ef8('0x18')](_0x37af53)['end']();};}function respondWithResult(_0x4304ea,_0x3cc2df){_0x3cc2df=_0x3cc2df||0xc8;return function(_0x3168b7){if(_0x3168b7){return _0x4304ea[_0x3ef8('0x18')](_0x3cc2df)[_0x3ef8('0x19')](_0x3168b7);}};}function respondWithFilteredResult(_0x4978a2,_0x39e711){return function(_0x28146a){if(_0x28146a){var _0x42b36f=typeof _0x39e711[_0x3ef8('0x1a')]===_0x3ef8('0x1b')&&typeof _0x39e711[_0x3ef8('0x1c')]===_0x3ef8('0x1b');var _0x4f05ca=_0x28146a[_0x3ef8('0x1d')];var _0x7a8211=_0x42b36f?0x0:_0x39e711[_0x3ef8('0x1a')];var _0x26faf5=_0x42b36f?_0x28146a[_0x3ef8('0x1d')]:_0x39e711[_0x3ef8('0x1a')]+_0x39e711[_0x3ef8('0x1c')];var _0xeb02ce;if(_0x26faf5>=_0x4f05ca){_0x26faf5=_0x4f05ca;_0xeb02ce=0xc8;}else{_0xeb02ce=0xce;}_0x4978a2[_0x3ef8('0x18')](_0xeb02ce);return _0x4978a2[_0x3ef8('0x1e')](_0x3ef8('0x1f'),_0x7a8211+'-'+_0x26faf5+'/'+_0x4f05ca)['json'](_0x28146a);}return null;};}function patchUpdates(_0x21e0fe){return function(_0x6ed9b){try{jsonpatch['apply'](_0x6ed9b,_0x21e0fe,!![]);}catch(_0x4ff6d2){return BPromise['reject'](_0x4ff6d2);}return _0x6ed9b[_0x3ef8('0x20')]();};}function saveUpdates(_0x54c08a,_0x835da3){return function(_0x17a6c0){if(_0x17a6c0){return _0x17a6c0[_0x3ef8('0x21')](_0x54c08a)[_0x3ef8('0x22')](function(_0x2c72b6){return _0x2c72b6;});}return null;};}function removeEntity(_0x200abd,_0x348439){return function(_0x46a7a3){if(_0x46a7a3){return _0x46a7a3[_0x3ef8('0x23')]()['then'](function(){_0x200abd['status'](0xcc)[_0x3ef8('0x24')]();});}};}function handleEntityNotFound(_0x186a72,_0x352b29){return function(_0x11bc8d){if(!_0x11bc8d){_0x186a72['sendStatus'](0x194);}return _0x11bc8d;};}function handleError(_0x284364,_0x3c27c7){_0x3c27c7=_0x3c27c7||0x1f4;return function(_0x5f5561){logger[_0x3ef8('0x25')](_0x5f5561[_0x3ef8('0x26')]);if(_0x5f5561[_0x3ef8('0x27')]){delete _0x5f5561[_0x3ef8('0x27')];}_0x284364[_0x3ef8('0x18')](_0x3c27c7)[_0x3ef8('0x28')](_0x5f5561);};}exports[_0x3ef8('0x29')]=function(_0x459cd2,_0x41da99){var _0x22bee8={},_0x140f17={},_0x1556f2={'count':0x0,'rows':[]};var _0x3e3fcf=_[_0x3ef8('0x2a')](db['MailTransferReport'][_0x3ef8('0x2b')],function(_0x33ad91){return{'name':_0x33ad91[_0x3ef8('0x2c')],'type':_0x33ad91[_0x3ef8('0x2d')]['key']};});_0x140f17[_0x3ef8('0x2e')]=_[_0x3ef8('0x2a')](_0x3e3fcf,'name');_0x140f17[_0x3ef8('0x2f')]=_['keys'](_0x459cd2[_0x3ef8('0x2f')]);_0x140f17[_0x3ef8('0x30')]=_[_0x3ef8('0x31')](_0x140f17[_0x3ef8('0x2e')],_0x140f17['query']);_0x22bee8[_0x3ef8('0x32')]=_[_0x3ef8('0x31')](_0x140f17[_0x3ef8('0x2e')],qs[_0x3ef8('0x33')](_0x459cd2[_0x3ef8('0x2f')][_0x3ef8('0x33')]));_0x22bee8['attributes']=_0x22bee8[_0x3ef8('0x32')][_0x3ef8('0x34')]?_0x22bee8['attributes']:_0x140f17['model'];if(!_0x459cd2['query']['hasOwnProperty'](_0x3ef8('0x35'))){_0x22bee8[_0x3ef8('0x1c')]=qs[_0x3ef8('0x1c')](_0x459cd2[_0x3ef8('0x2f')][_0x3ef8('0x1c')]);_0x22bee8[_0x3ef8('0x1a')]=qs[_0x3ef8('0x1a')](_0x459cd2[_0x3ef8('0x2f')]['offset']);}_0x22bee8['order']=qs[_0x3ef8('0x36')](_0x459cd2[_0x3ef8('0x2f')]['sort']);_0x22bee8[_0x3ef8('0x37')]=qs[_0x3ef8('0x30')](_[_0x3ef8('0x38')](_0x459cd2['query'],_0x140f17[_0x3ef8('0x30')]),_0x3e3fcf);if(_0x459cd2[_0x3ef8('0x2f')][_0x3ef8('0x39')]){_0x22bee8[_0x3ef8('0x37')]=_['merge'](_0x22bee8[_0x3ef8('0x37')],{'$or':_[_0x3ef8('0x2a')](_0x3e3fcf,function(_0x14cbe1){if(_0x14cbe1[_0x3ef8('0x2d')]!==_0x3ef8('0x3a')){var _0xfa5b42={};_0xfa5b42[_0x14cbe1[_0x3ef8('0x27')]]={'$like':'%'+_0x459cd2[_0x3ef8('0x2f')][_0x3ef8('0x39')]+'%'};return _0xfa5b42;}})});}_0x22bee8=_[_0x3ef8('0x3b')]({},_0x22bee8,_0x459cd2[_0x3ef8('0x3c')]);var _0x2b2661={'where':_0x22bee8[_0x3ef8('0x37')]};return db[_0x3ef8('0x3d')][_0x3ef8('0x1d')](_0x2b2661)[_0x3ef8('0x22')](function(_0x24864b){_0x1556f2['count']=_0x24864b;if(_0x459cd2[_0x3ef8('0x2f')]['includeAll']){_0x22bee8[_0x3ef8('0x3e')]=[{'all':!![]}];}return db[_0x3ef8('0x3d')][_0x3ef8('0x3f')](_0x22bee8);})[_0x3ef8('0x22')](function(_0xd5b1cb){_0x1556f2['rows']=_0xd5b1cb;return _0x1556f2;})[_0x3ef8('0x22')](respondWithFilteredResult(_0x41da99,_0x22bee8))[_0x3ef8('0x40')](handleError(_0x41da99,null));};exports['show']=function(_0x2140e4,_0x579ebd){var _0x5b5884={'raw':!![],'where':{'id':_0x2140e4['params']['id']}},_0x303099={};_0x303099['model']=_[_0x3ef8('0x41')](db[_0x3ef8('0x3d')][_0x3ef8('0x2b')]);_0x303099[_0x3ef8('0x2f')]=_['keys'](_0x2140e4[_0x3ef8('0x2f')]);_0x303099[_0x3ef8('0x30')]=_['intersection'](_0x303099[_0x3ef8('0x2e')],_0x303099[_0x3ef8('0x2f')]);_0x5b5884[_0x3ef8('0x32')]=_['intersection'](_0x303099['model'],qs[_0x3ef8('0x33')](_0x2140e4['query'][_0x3ef8('0x33')]));_0x5b5884[_0x3ef8('0x32')]=_0x5b5884[_0x3ef8('0x32')]['length']?_0x5b5884[_0x3ef8('0x32')]:_0x303099['model'];if(_0x2140e4['query'][_0x3ef8('0x42')]){_0x5b5884[_0x3ef8('0x3e')]=[{'all':!![]}];}_0x5b5884=_[_0x3ef8('0x3b')]({},_0x5b5884,_0x2140e4['options']);return db[_0x3ef8('0x3d')][_0x3ef8('0x43')](_0x5b5884)[_0x3ef8('0x22')](handleEntityNotFound(_0x579ebd,null))[_0x3ef8('0x22')](respondWithResult(_0x579ebd,null))[_0x3ef8('0x40')](handleError(_0x579ebd,null));};exports[_0x3ef8('0x44')]=function(_0x5070bb,_0x22a0d0){return db['MailTransferReport'][_0x3ef8('0x44')](_0x5070bb[_0x3ef8('0x45')],{})[_0x3ef8('0x22')](respondWithResult(_0x22a0d0,0xc9))[_0x3ef8('0x40')](handleError(_0x22a0d0,null));};exports[_0x3ef8('0x21')]=function(_0xea4b3b,_0x3b0185){if(_0xea4b3b[_0x3ef8('0x45')]['id']){delete _0xea4b3b[_0x3ef8('0x45')]['id'];}return db[_0x3ef8('0x3d')][_0x3ef8('0x43')]({'where':{'id':_0xea4b3b['params']['id']}})[_0x3ef8('0x22')](handleEntityNotFound(_0x3b0185,null))['then'](saveUpdates(_0xea4b3b[_0x3ef8('0x45')],null))[_0x3ef8('0x22')](respondWithResult(_0x3b0185,null))[_0x3ef8('0x40')](handleError(_0x3b0185,null));};exports[_0x3ef8('0x23')]=function(_0xbfcef8,_0x1847a4){return db[_0x3ef8('0x3d')]['find']({'where':{'id':_0xbfcef8[_0x3ef8('0x46')]['id']}})[_0x3ef8('0x22')](handleEntityNotFound(_0x1847a4,null))[_0x3ef8('0x22')](removeEntity(_0x1847a4,null))[_0x3ef8('0x40')](handleError(_0x1847a4,null));};exports[_0x3ef8('0x47')]=function(_0x30e39a,_0x4fbce4){return db[_0x3ef8('0x3d')]['describe']()[_0x3ef8('0x22')](respondWithResult(_0x4fbce4,null))[_0x3ef8('0x40')](handleError(_0x4fbce4,null));}; \ No newline at end of file +var _0x0595=['end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MailTransferReport','fieldName','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x3da7a1,_0x151473){var _0x3b7290=function(_0x28746c){while(--_0x28746c){_0x3da7a1['push'](_0x3da7a1['shift']());}};_0x3b7290(++_0x151473);}(_0x0595,0x148));var _0x5059=function(_0x276ade,_0x2c58b3){_0x276ade=_0x276ade-0x0;var _0x1f01b3=_0x0595[_0x276ade];return _0x1f01b3;};'use strict';var emlformat=require(_0x5059('0x0'));var rimraf=require(_0x5059('0x1'));var zipdir=require(_0x5059('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5059('0x3'));var moment=require(_0x5059('0x4'));var BPromise=require(_0x5059('0x5'));var Mustache=require('mustache');var util=require(_0x5059('0x6'));var path=require(_0x5059('0x7'));var sox=require(_0x5059('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5059('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5059('0xa'));var jsforce=require(_0x5059('0xb'));var deskjs=require(_0x5059('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5059('0xd'));var Papa=require('papaparse');var Redis=require(_0x5059('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5059('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5059('0x10'))('api');var utils=require(_0x5059('0x11'));var config=require(_0x5059('0x12'));var licenseUtil=require(_0x5059('0x13'));var db=require(_0x5059('0x14'))['db'];function respondWithStatusCode(_0x488952,_0x514834){_0x514834=_0x514834||0xcc;return function(_0x1d5144){if(_0x1d5144){return _0x488952['sendStatus'](_0x514834);}return _0x488952[_0x5059('0x15')](_0x514834)[_0x5059('0x16')]();};}function respondWithResult(_0x378fd9,_0x1d2fbf){_0x1d2fbf=_0x1d2fbf||0xc8;return function(_0x4cae12){if(_0x4cae12){return _0x378fd9[_0x5059('0x15')](_0x1d2fbf)[_0x5059('0x17')](_0x4cae12);}};}function respondWithFilteredResult(_0x13bb1a,_0x16ab18){return function(_0x561efc){if(_0x561efc){var _0x22638e=typeof _0x16ab18[_0x5059('0x18')]===_0x5059('0x19')&&typeof _0x16ab18['limit']===_0x5059('0x19');var _0x50f7a9=_0x561efc[_0x5059('0x1a')];var _0x4b9ae5=_0x22638e?0x0:_0x16ab18['offset'];var _0x2c4697=_0x22638e?_0x561efc[_0x5059('0x1a')]:_0x16ab18[_0x5059('0x18')]+_0x16ab18[_0x5059('0x1b')];var _0x14b98c;if(_0x2c4697>=_0x50f7a9){_0x2c4697=_0x50f7a9;_0x14b98c=0xc8;}else{_0x14b98c=0xce;}_0x13bb1a[_0x5059('0x15')](_0x14b98c);return _0x13bb1a[_0x5059('0x1c')]('Content-Range',_0x4b9ae5+'-'+_0x2c4697+'/'+_0x50f7a9)[_0x5059('0x17')](_0x561efc);}return null;};}function patchUpdates(_0x17ad21){return function(_0x130fd0){try{jsonpatch[_0x5059('0x1d')](_0x130fd0,_0x17ad21,!![]);}catch(_0x3e035a){return BPromise[_0x5059('0x1e')](_0x3e035a);}return _0x130fd0[_0x5059('0x1f')]();};}function saveUpdates(_0x1ddf44,_0x42152a){return function(_0x56ae0e){if(_0x56ae0e){return _0x56ae0e[_0x5059('0x20')](_0x1ddf44)[_0x5059('0x21')](function(_0x45f973){return _0x45f973;});}return null;};}function removeEntity(_0x22e40e,_0x57bb01){return function(_0x2558d9){if(_0x2558d9){return _0x2558d9[_0x5059('0x22')]()[_0x5059('0x21')](function(){_0x22e40e[_0x5059('0x15')](0xcc)[_0x5059('0x16')]();});}};}function handleEntityNotFound(_0x2df6c4,_0x227767){return function(_0x5bd809){if(!_0x5bd809){_0x2df6c4[_0x5059('0x23')](0x194);}return _0x5bd809;};}function handleError(_0x543ec1,_0x619a57){_0x619a57=_0x619a57||0x1f4;return function(_0x211c2b){logger['error'](_0x211c2b[_0x5059('0x24')]);if(_0x211c2b['name']){delete _0x211c2b['name'];}_0x543ec1[_0x5059('0x15')](_0x619a57)[_0x5059('0x25')](_0x211c2b);};}exports[_0x5059('0x26')]=function(_0x41cb0e,_0x43f777){var _0x407dda={},_0x26d45f={},_0x174594={'count':0x0,'rows':[]};var _0x22f756=_[_0x5059('0x27')](db[_0x5059('0x28')]['rawAttributes'],function(_0x430e8e){return{'name':_0x430e8e[_0x5059('0x29')],'type':_0x430e8e['type'][_0x5059('0x2a')]};});_0x26d45f['model']=_[_0x5059('0x27')](_0x22f756,_0x5059('0x2b'));_0x26d45f[_0x5059('0x2c')]=_[_0x5059('0x2d')](_0x41cb0e[_0x5059('0x2c')]);_0x26d45f[_0x5059('0x2e')]=_[_0x5059('0x2f')](_0x26d45f[_0x5059('0x30')],_0x26d45f[_0x5059('0x2c')]);_0x407dda[_0x5059('0x31')]=_[_0x5059('0x2f')](_0x26d45f['model'],qs[_0x5059('0x32')](_0x41cb0e[_0x5059('0x2c')][_0x5059('0x32')]));_0x407dda[_0x5059('0x31')]=_0x407dda[_0x5059('0x31')][_0x5059('0x33')]?_0x407dda[_0x5059('0x31')]:_0x26d45f['model'];if(!_0x41cb0e[_0x5059('0x2c')][_0x5059('0x34')](_0x5059('0x35'))){_0x407dda[_0x5059('0x1b')]=qs['limit'](_0x41cb0e[_0x5059('0x2c')]['limit']);_0x407dda['offset']=qs[_0x5059('0x18')](_0x41cb0e[_0x5059('0x2c')]['offset']);}_0x407dda['order']=qs[_0x5059('0x36')](_0x41cb0e[_0x5059('0x2c')][_0x5059('0x36')]);_0x407dda[_0x5059('0x37')]=qs[_0x5059('0x2e')](_['pick'](_0x41cb0e['query'],_0x26d45f['filters']),_0x22f756);if(_0x41cb0e[_0x5059('0x2c')][_0x5059('0x38')]){_0x407dda[_0x5059('0x37')]=_[_0x5059('0x39')](_0x407dda[_0x5059('0x37')],{'$or':_['map'](_0x22f756,function(_0x3e3101){if(_0x3e3101['type']!=='VIRTUAL'){var _0xe781ee={};_0xe781ee[_0x3e3101[_0x5059('0x2b')]]={'$like':'%'+_0x41cb0e[_0x5059('0x2c')][_0x5059('0x38')]+'%'};return _0xe781ee;}})});}_0x407dda=_[_0x5059('0x39')]({},_0x407dda,_0x41cb0e['options']);var _0xb3ac63={'where':_0x407dda[_0x5059('0x37')]};return db['MailTransferReport'][_0x5059('0x1a')](_0xb3ac63)[_0x5059('0x21')](function(_0x721d0){_0x174594[_0x5059('0x1a')]=_0x721d0;if(_0x41cb0e[_0x5059('0x2c')][_0x5059('0x3a')]){_0x407dda['include']=[{'all':!![]}];}return db[_0x5059('0x28')][_0x5059('0x3b')](_0x407dda);})[_0x5059('0x21')](function(_0x2dca56){_0x174594['rows']=_0x2dca56;return _0x174594;})[_0x5059('0x21')](respondWithFilteredResult(_0x43f777,_0x407dda))[_0x5059('0x3c')](handleError(_0x43f777,null));};exports[_0x5059('0x3d')]=function(_0x269a63,_0x1d228f){var _0x3e31b1={'raw':!![],'where':{'id':_0x269a63[_0x5059('0x3e')]['id']}},_0x26e881={};_0x26e881[_0x5059('0x30')]=_[_0x5059('0x2d')](db[_0x5059('0x28')][_0x5059('0x3f')]);_0x26e881[_0x5059('0x2c')]=_[_0x5059('0x2d')](_0x269a63['query']);_0x26e881[_0x5059('0x2e')]=_[_0x5059('0x2f')](_0x26e881['model'],_0x26e881['query']);_0x3e31b1['attributes']=_[_0x5059('0x2f')](_0x26e881[_0x5059('0x30')],qs['fields'](_0x269a63[_0x5059('0x2c')][_0x5059('0x32')]));_0x3e31b1[_0x5059('0x31')]=_0x3e31b1[_0x5059('0x31')]['length']?_0x3e31b1['attributes']:_0x26e881['model'];if(_0x269a63['query']['includeAll']){_0x3e31b1[_0x5059('0x40')]=[{'all':!![]}];}_0x3e31b1=_[_0x5059('0x39')]({},_0x3e31b1,_0x269a63[_0x5059('0x41')]);return db['MailTransferReport'][_0x5059('0x42')](_0x3e31b1)[_0x5059('0x21')](handleEntityNotFound(_0x1d228f,null))[_0x5059('0x21')](respondWithResult(_0x1d228f,null))['catch'](handleError(_0x1d228f,null));};exports[_0x5059('0x43')]=function(_0x220048,_0x10f181){return db['MailTransferReport'][_0x5059('0x43')](_0x220048[_0x5059('0x44')],{})[_0x5059('0x21')](respondWithResult(_0x10f181,0xc9))[_0x5059('0x3c')](handleError(_0x10f181,null));};exports[_0x5059('0x20')]=function(_0x49a694,_0x45011e){if(_0x49a694[_0x5059('0x44')]['id']){delete _0x49a694[_0x5059('0x44')]['id'];}return db[_0x5059('0x28')][_0x5059('0x42')]({'where':{'id':_0x49a694['params']['id']}})['then'](handleEntityNotFound(_0x45011e,null))[_0x5059('0x21')](saveUpdates(_0x49a694[_0x5059('0x44')],null))[_0x5059('0x21')](respondWithResult(_0x45011e,null))[_0x5059('0x3c')](handleError(_0x45011e,null));};exports[_0x5059('0x22')]=function(_0x2231f1,_0x34938b){return db[_0x5059('0x28')][_0x5059('0x42')]({'where':{'id':_0x2231f1['params']['id']}})['then'](handleEntityNotFound(_0x34938b,null))['then'](removeEntity(_0x34938b,null))[_0x5059('0x3c')](handleError(_0x34938b,null));};exports['describe']=function(_0x4f4c3e,_0x3c855a){return db[_0x5059('0x28')][_0x5059('0x45')]()[_0x5059('0x21')](respondWithResult(_0x3c855a,null))[_0x5059('0x3c')](handleError(_0x3c855a,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 340a5a7..1a4ac35 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 _0xe14b=['bluebird','path','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','lodash','util','moment'];(function(_0x446763,_0x36a718){var _0x1d2b69=function(_0x9fab8){while(--_0x9fab8){_0x446763['push'](_0x446763['shift']());}};_0x1d2b69(++_0x36a718);}(_0xe14b,0x93));var _0xbe14=function(_0x2a23db,_0x23dbc1){_0x2a23db=_0x2a23db-0x0;var _0x37e1cf=_0xe14b[_0x2a23db];return _0x37e1cf;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6fad=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','uniqueid'];(function(_0x657e65,_0x307cb8){var _0x24c8ea=function(_0x5e1b88){while(--_0x5e1b88){_0x657e65['push'](_0x657e65['shift']());}};_0x24c8ea(++_0x307cb8);}(_0x6fad,0x174));var _0xd6fa=function(_0x517db2,_0x22e5f6){_0x517db2=_0x517db2-0x0;var _0x636271=_0x6fad[_0x517db2];return _0x636271;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var logger=require(_0xd6fa('0x2'))(_0xd6fa('0x3'));var moment=require('moment');var BPromise=require(_0xd6fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6fa('0x5'));var rimraf=require(_0xd6fa('0x6'));var config=require(_0xd6fa('0x7'));var attributes=require(_0xd6fa('0x8'));module['exports']=function(_0x45dad4,_0x329390){return _0x45dad4[_0xd6fa('0x9')](_0xd6fa('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xd6fa('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index a6530e2..c00419b 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 _0x4581=['randomstring','ioredis','../../mysqldb','rpc','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x35c6df,_0x53ddc5){var _0x4ceda3=function(_0x33b932){while(--_0x33b932){_0x35c6df['push'](_0x35c6df['shift']());}};_0x4ceda3(++_0x53ddc5);}(_0x4581,0x129));var _0x1458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4581[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1458('0x0'));var util=require(_0x1458('0x1'));var moment=require('moment');var BPromise=require(_0x1458('0x2'));var rs=require(_0x1458('0x3'));var fs=require('fs');var Redis=require(_0x1458('0x4'));var db=require(_0x1458('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1458('0x6'));var config=require('../../config/environment');var jayson=require(_0x1458('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3910de,_0x2f7a41,_0x16fdbe){return new BPromise(function(_0x104bc1,_0x314656){return client[_0x1458('0x8')](_0x3910de,_0x16fdbe)[_0x1458('0x9')](function(_0x2319be){logger[_0x1458('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x2f7a41,_0x1458('0xb'));logger[_0x1458('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2f7a41,_0x1458('0xb'),JSON[_0x1458('0xd')](_0x2319be));if(_0x2319be['error']){if(_0x2319be[_0x1458('0xe')][_0x1458('0xf')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2f7a41,_0x2319be[_0x1458('0xe')]['message']);return _0x314656(_0x2319be[_0x1458('0xe')][_0x1458('0x10')]);}logger[_0x1458('0xe')](_0x1458('0x11'),_0x2f7a41,_0x2319be['error']['message']);return _0x104bc1(_0x2319be[_0x1458('0xe')][_0x1458('0x10')]);}else{logger[_0x1458('0xa')](_0x1458('0x11'),_0x2f7a41,_0x1458('0xb'));_0x104bc1(_0x2319be[_0x1458('0x12')][_0x1458('0x10')]);}})[_0x1458('0x13')](function(_0x33a120){logger[_0x1458('0xe')](_0x1458('0x11'),_0x2f7a41,_0x33a120);_0x314656(_0x33a120);});});} \ No newline at end of file +var _0x6bb7=['catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info'];(function(_0x3c4bbb,_0x11def9){var _0x2cdc7e=function(_0x21b261){while(--_0x21b261){_0x3c4bbb['push'](_0x3c4bbb['shift']());}};_0x2cdc7e(++_0x11def9);}(_0x6bb7,0xfd));var _0x76bb=function(_0x373c5a,_0x3bac92){_0x373c5a=_0x373c5a-0x0;var _0x58e8a9=_0x6bb7[_0x373c5a];return _0x58e8a9;};'use strict';var _=require('lodash');var util=require(_0x76bb('0x0'));var moment=require(_0x76bb('0x1'));var BPromise=require(_0x76bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76bb('0x3'))['db'];var utils=require(_0x76bb('0x4'));var logger=require(_0x76bb('0x5'))(_0x76bb('0x6'));var config=require(_0x76bb('0x7'));var jayson=require(_0x76bb('0x8'));var client=jayson[_0x76bb('0x9')][_0x76bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c8a4e,_0x1a9f74,_0x48f80a){return new BPromise(function(_0x585e20,_0x1bb0b2){return client['request'](_0x3c8a4e,_0x48f80a)[_0x76bb('0xb')](function(_0x33c2ac){logger['info'](_0x76bb('0xc'),_0x1a9f74,_0x76bb('0xd'));logger['debug'](_0x76bb('0xe'),_0x1a9f74,_0x76bb('0xd'),JSON[_0x76bb('0xf')](_0x33c2ac));if(_0x33c2ac['error']){if(_0x33c2ac['error'][_0x76bb('0x10')]===0x1f4){logger[_0x76bb('0x11')](_0x76bb('0xc'),_0x1a9f74,_0x33c2ac['error']['message']);return _0x1bb0b2(_0x33c2ac[_0x76bb('0x11')][_0x76bb('0x12')]);}logger[_0x76bb('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x1a9f74,_0x33c2ac[_0x76bb('0x11')][_0x76bb('0x12')]);return _0x585e20(_0x33c2ac[_0x76bb('0x11')][_0x76bb('0x12')]);}else{logger[_0x76bb('0x13')](_0x76bb('0xc'),_0x1a9f74,_0x76bb('0xd'));_0x585e20(_0x33c2ac['result'][_0x76bb('0x12')]);}})[_0x76bb('0x14')](function(_0x181dca){logger['error'](_0x76bb('0xc'),_0x1a9f74,_0x181dca);_0x1bb0b2(_0x181dca);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index fdccc94..80ffbcc 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 _0x062d=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','create'];(function(_0x5c7b94,_0x571d6b){var _0x3d21c2=function(_0x270460){while(--_0x270460){_0x5c7b94['push'](_0x5c7b94['shift']());}};_0x3d21c2(++_0x571d6b);}(_0x062d,0x90));var _0xd062=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0x062d[_0xe4bb3d];return _0xd9e51;};'use strict';var multer=require(_0xd062('0x0'));var util=require(_0xd062('0x1'));var path=require(_0xd062('0x2'));var timeout=require(_0xd062('0x3'));var express=require(_0xd062('0x4'));var router=express[_0xd062('0x5')]();var fs_extra=require(_0xd062('0x6'));var auth=require(_0xd062('0x7'));var interaction=require(_0xd062('0x8'));var config=require(_0xd062('0x9'));var controller=require('./memberReport.controller');router[_0xd062('0xa')]('/',auth[_0xd062('0xb')](),controller['index']);router['get'](_0xd062('0xc'),auth[_0xd062('0xb')](),controller['describe']);router['get'](_0xd062('0xd'),auth[_0xd062('0xb')](),controller[_0xd062('0xe')]);router['post']('/',auth[_0xd062('0xb')](),controller[_0xd062('0xf')]);router[_0xd062('0x10')](_0xd062('0xd'),auth[_0xd062('0xb')](),controller['update']);router[_0xd062('0x11')]('/:id',auth[_0xd062('0xb')](),controller[_0xd062('0x12')]);module[_0xd062('0x13')]=router; \ No newline at end of file +var _0xd9d3=['update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id'];(function(_0x1c688b,_0x4df102){var _0x4d4577=function(_0x29a41b){while(--_0x29a41b){_0x1c688b['push'](_0x1c688b['shift']());}};_0x4d4577(++_0x4df102);}(_0xd9d3,0x168));var _0x3d9d=function(_0x3a0c5e,_0x2c284f){_0x3a0c5e=_0x3a0c5e-0x0;var _0x893893=_0xd9d3[_0x3a0c5e];return _0x893893;};'use strict';var multer=require('multer');var util=require(_0x3d9d('0x0'));var path=require(_0x3d9d('0x1'));var timeout=require(_0x3d9d('0x2'));var express=require(_0x3d9d('0x3'));var router=express[_0x3d9d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3d9d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3d9d('0x6'));var controller=require(_0x3d9d('0x7'));router[_0x3d9d('0x8')]('/',auth['isAuthenticated'](),controller[_0x3d9d('0x9')]);router['get'](_0x3d9d('0xa'),auth[_0x3d9d('0xb')](),controller[_0x3d9d('0xc')]);router[_0x3d9d('0x8')]('/:id',auth[_0x3d9d('0xb')](),controller[_0x3d9d('0xd')]);router[_0x3d9d('0xe')]('/',auth[_0x3d9d('0xb')](),controller[_0x3d9d('0xf')]);router[_0x3d9d('0x10')](_0x3d9d('0x11'),auth[_0x3d9d('0xb')](),controller[_0x3d9d('0x12')]);router['delete'](_0x3d9d('0x11'),auth[_0x3d9d('0xb')](),controller[_0x3d9d('0x13')]);module[_0x3d9d('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 626bcfe..4393d2b 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 _0xb28e=['talk:[start]','talk:[destination]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','enterAt','setDataValue','exitAt','duration'];(function(_0x37909b,_0xbd548c){var _0x1a949b=function(_0x1bceb8){while(--_0x1bceb8){_0x37909b['push'](_0x37909b['shift']());}};_0x1a949b(++_0xbd548c);}(_0xb28e,0x113));var _0xeb28=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb28e[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xeb28('0x0'));var moment=require(_0xeb28('0x1'));module[_0xeb28('0x2')]={'channel':{'type':Sequelize[_0xeb28('0x3')]},'membername':{'type':Sequelize[_0xeb28('0x3')]},'interface':{'type':Sequelize[_0xeb28('0x3')]},'type':{'type':Sequelize[_0xeb28('0x3')],'defaultValue':_0xeb28('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xeb28('0x5')]},'enterAt':{'type':Sequelize[_0xeb28('0x6')]},'exitAt':{'type':Sequelize[_0xeb28('0x6')],'set':function(_0x274ad1){var _0x3216f8=moment(_0x274ad1);var _0x42b5cd=moment(this['getDataValue'](_0xeb28('0x7')));var _0x488b20=_0x3216f8['diff'](_0x42b5cd,'seconds');this[_0xeb28('0x8')](_0xeb28('0x9'),_0x274ad1);this[_0xeb28('0x8')](_0xeb28('0xa'),_0x488b20>=0x0?_0x488b20:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xeb28('0x3')],'comment':_0xeb28('0xb')},'data3':{'type':Sequelize[_0xeb28('0x3')],'comment':_0xeb28('0xc')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xeb28('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xeb28('0x3')]},'internal':{'type':Sequelize[_0xeb28('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6ba2=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','exitAt','duration'];(function(_0x48056d,_0x69e2dc){var _0x7c0e7b=function(_0x103bab){while(--_0x103bab){_0x48056d['push'](_0x48056d['shift']());}};_0x7c0e7b(++_0x69e2dc);}(_0x6ba2,0x14f));var _0x26ba=function(_0x3b3489,_0x1da252){_0x3b3489=_0x3b3489-0x0;var _0x2a70a3=_0x6ba2[_0x3b3489];return _0x2a70a3;};'use strict';var Sequelize=require(_0x26ba('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x26ba('0x1')]},'membername':{'type':Sequelize[_0x26ba('0x1')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x26ba('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x26ba('0x2')},'duration':{'type':Sequelize[_0x26ba('0x3')]},'enterAt':{'type':Sequelize[_0x26ba('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4c0808){var _0x45eaf6=moment(_0x4c0808);var _0xff848f=moment(this[_0x26ba('0x5')](_0x26ba('0x6')));var _0x56edda=_0x45eaf6['diff'](_0xff848f,_0x26ba('0x7'));this['setDataValue'](_0x26ba('0x8'),_0x4c0808);this['setDataValue'](_0x26ba('0x9'),_0x56edda>=0x0?_0x56edda:null);}},'data1':{'type':Sequelize[_0x26ba('0x1')],'comment':_0x26ba('0xa')},'data2':{'type':Sequelize[_0x26ba('0x1')],'comment':_0x26ba('0xb')},'data3':{'type':Sequelize[_0x26ba('0x1')],'comment':_0x26ba('0xc')},'data4':{'type':Sequelize[_0x26ba('0x1')],'comment':_0x26ba('0xd')},'data5':{'type':Sequelize[_0x26ba('0x1')],'comment':_0x26ba('0xe')},'role':{'type':Sequelize[_0x26ba('0x1')]},'internal':{'type':Sequelize[_0x26ba('0x3')]},'uniqueid':{'type':Sequelize[_0x26ba('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index f588fd6..7798b3b 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x21dd4e,_0x2ac351){var _0x2fb0f4=function(_0x3670c8){while(--_0x3670c8){_0x21dd4e['push'](_0x21dd4e['shift']());}};_0x2fb0f4(++_0x2ac351);}(_0x3e74,0x175));var _0x43e7=function(_0x43573f,_0x14a545){_0x43573f=_0x43573f-0x0;var _0x16ae98=_0x3e74[_0x43573f];return _0x16ae98;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0x34e8=['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','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x34e8,0x12c));var _0x834e=function(_0x21b454,_0x2b29cb){_0x21b454=_0x21b454-0x0;var _0x42d434=_0x34e8[_0x21b454];return _0x42d434;};'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'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 84790eb..f957e7b 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 _0x8887=['exports','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x372a0a,_0x35182d){var _0x30ae0e=function(_0x158402){while(--_0x158402){_0x372a0a['push'](_0x372a0a['shift']());}};_0x30ae0e(++_0x35182d);}(_0x8887,0x1c6));var _0x7888=function(_0x1c7943,_0x643ced){_0x1c7943=_0x1c7943-0x0;var _0x281841=_0x8887[_0x1c7943];return _0x281841;};'use strict';var _=require(_0x7888('0x0'));var util=require(_0x7888('0x1'));var logger=require(_0x7888('0x2'))(_0x7888('0x3'));var moment=require('moment');var BPromise=require(_0x7888('0x4'));var rp=require(_0x7888('0x5'));var fs=require('fs');var path=require(_0x7888('0x6'));var rimraf=require(_0x7888('0x7'));var config=require(_0x7888('0x8'));var attributes=require(_0x7888('0x9'));module[_0x7888('0xa')]=function(_0xf86186,_0x15a0af){return _0xf86186['define'](_0x7888('0xb'),attributes,{'tableName':_0x7888('0xc'),'paranoid':![],'indexes':[{'name':_0x7888('0xd'),'fields':[_0x7888('0xe'),_0x7888('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8bf3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x8bf3,0x130));var _0x38bf=function(_0x37b7c8,_0x49de43){_0x37b7c8=_0x37b7c8-0x0;var _0x11815f=_0x8bf3[_0x37b7c8];return _0x11815f;};'use strict';var _=require(_0x38bf('0x0'));var util=require(_0x38bf('0x1'));var logger=require(_0x38bf('0x2'))(_0x38bf('0x3'));var moment=require(_0x38bf('0x4'));var BPromise=require(_0x38bf('0x5'));var rp=require(_0x38bf('0x6'));var fs=require('fs');var path=require(_0x38bf('0x7'));var rimraf=require(_0x38bf('0x8'));var config=require('../../config/environment');var attributes=require(_0x38bf('0x9'));module[_0x38bf('0xa')]=function(_0x461b55,_0x509028){return _0x461b55[_0x38bf('0xb')]('MemberReport',attributes,{'tableName':_0x38bf('0xc'),'paranoid':![],'indexes':[{'name':_0x38bf('0xd'),'fields':[_0x38bf('0xe'),_0x38bf('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index dc4bfcd..dda63f3 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 _0x4e83=['bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','map','include','model','create','body','raw','CreateMemberReport','UpdateMemberReport','update','limit','lodash','moment'];(function(_0x3d03e3,_0x4bd174){var _0x5b732d=function(_0x552780){while(--_0x552780){_0x3d03e3['push'](_0x3d03e3['shift']());}};_0x5b732d(++_0x4bd174);}(_0x4e83,0x1ae));var _0x34e8=function(_0x1158e1,_0x31b137){_0x1158e1=_0x1158e1-0x0;var _0x22ff3d=_0x4e83[_0x1158e1];return _0x22ff3d;};'use strict';var _=require(_0x34e8('0x0'));var util=require('util');var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require(_0x34e8('0x4'));var db=require(_0x34e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34e8('0x6'));var client=jayson[_0x34e8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30a3c4,_0x4567bd,_0x28677c){return new BPromise(function(_0x5b5ddc,_0x44d3bf){return client[_0x34e8('0x8')](_0x30a3c4,_0x28677c)[_0x34e8('0x9')](function(_0x5cb792){logger[_0x34e8('0xa')](_0x34e8('0xb'),_0x4567bd,_0x34e8('0xc'));logger[_0x34e8('0xd')](_0x34e8('0xe'),_0x4567bd,_0x34e8('0xc'),JSON[_0x34e8('0xf')](_0x5cb792));if(_0x5cb792[_0x34e8('0x10')]){if(_0x5cb792[_0x34e8('0x10')]['code']===0x1f4){logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x5cb792['error'][_0x34e8('0x11')]);return _0x44d3bf(_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);}logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);return _0x5b5ddc(_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);}else{logger['info'](_0x34e8('0xb'),_0x4567bd,_0x34e8('0xc'));_0x5b5ddc(_0x5cb792[_0x34e8('0x12')][_0x34e8('0x11')]);}})[_0x34e8('0x13')](function(_0x4a4d17){logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x4a4d17);_0x44d3bf(_0x4a4d17);});});}exports[_0x34e8('0x14')]=function(_0x708dd4){var _0x381484=this;return new Promise(function(_0x11543c,_0x1f3d4d){return db[_0x34e8('0x15')][_0x34e8('0x16')]({'raw':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')][_0x34e8('0x18')]||null:null,'attributes':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')][_0x34e8('0x19')]||null:null,'limit':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')]['limit']||null:null,'include':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')]['include']?_[_0x34e8('0x1a')](_0x708dd4['options'][_0x34e8('0x1b')],function(_0x381d0e){return{'model':db[_0x381d0e[_0x34e8('0x1c')]],'as':_0x381d0e['as'],'attributes':_0x381d0e['attributes'],'include':_0x381d0e['include']?_[_0x34e8('0x1a')](_0x381d0e[_0x34e8('0x1b')],function(_0xb8c9f){return{'model':db[_0xb8c9f[_0x34e8('0x1c')]],'as':_0xb8c9f['as'],'attributes':_0xb8c9f[_0x34e8('0x19')],'include':_0xb8c9f[_0x34e8('0x1b')]?_[_0x34e8('0x1a')](_0xb8c9f['include'],function(_0x29be75){return{'model':db[_0x29be75[_0x34e8('0x1c')]],'as':_0x29be75['as'],'attributes':_0x29be75[_0x34e8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x34e8('0x9')](function(_0xe77c9e){logger[_0x34e8('0xa')](_0x34e8('0x14'),_0x708dd4);logger[_0x34e8('0xd')](_0x34e8('0x14'),_0x708dd4,JSON[_0x34e8('0xf')](_0xe77c9e));_0x11543c(_0xe77c9e);})[_0x34e8('0x13')](function(_0x6f4428){logger[_0x34e8('0x10')](_0x34e8('0x14'),_0x6f4428[_0x34e8('0x11')],_0x708dd4);_0x1f3d4d(_0x381484[_0x34e8('0x10')](0x1f4,_0x6f4428[_0x34e8('0x11')]));});});};exports['CreateMemberReport']=function(_0x3e7e42){var _0x1a3146=this;return new Promise(function(_0x5b951f,_0x461c32){return db[_0x34e8('0x15')][_0x34e8('0x1d')](_0x3e7e42[_0x34e8('0x1e')],{'raw':_0x3e7e42[_0x34e8('0x17')]?_0x3e7e42[_0x34e8('0x17')][_0x34e8('0x1f')]===undefined?!![]:![]:!![]})[_0x34e8('0x9')](function(_0x5e2fef){logger[_0x34e8('0xa')](_0x34e8('0x20'),_0x3e7e42);logger[_0x34e8('0xd')](_0x34e8('0x20'),_0x3e7e42,JSON[_0x34e8('0xf')](_0x5e2fef));_0x5b951f(_0x5e2fef);})[_0x34e8('0x13')](function(_0x5594d0){logger[_0x34e8('0x10')]('CreateMemberReport',_0x5594d0[_0x34e8('0x11')],_0x3e7e42);_0x461c32(_0x1a3146[_0x34e8('0x10')](0x1f4,_0x5594d0['message']));});});};exports[_0x34e8('0x21')]=function(_0x38a525){var _0x1fb985=this;return new Promise(function(_0xde0d37,_0x13ca19){return db[_0x34e8('0x15')][_0x34e8('0x22')](_0x38a525['body'],{'raw':_0x38a525['options']?_0x38a525[_0x34e8('0x17')][_0x34e8('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38a525[_0x34e8('0x17')]?_0x38a525['options'][_0x34e8('0x18')]||null:null,'attributes':_0x38a525[_0x34e8('0x17')]?_0x38a525[_0x34e8('0x17')][_0x34e8('0x19')]||null:null,'limit':_0x38a525[_0x34e8('0x17')]?_0x38a525[_0x34e8('0x17')][_0x34e8('0x23')]||null:null})[_0x34e8('0x9')](function(_0x50a32c){logger[_0x34e8('0xa')](_0x34e8('0x21'),_0x38a525);logger[_0x34e8('0xd')]('UpdateMemberReport',_0x38a525,JSON[_0x34e8('0xf')](_0x50a32c));_0xde0d37(_0x50a32c);})[_0x34e8('0x13')](function(_0x5349e2){logger['error'](_0x34e8('0x21'),_0x5349e2[_0x34e8('0x11')],_0x38a525);_0x13ca19(_0x1fb985['error'](0x1f4,_0x5349e2[_0x34e8('0x11')]));});});}; \ No newline at end of file +var _0x1cb9=['UpdateMemberReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','options','attributes','limit','include','map','model','create','body','then','CreateMemberReport','raw','where'];(function(_0x15603b,_0x3e397c){var _0x5d887a=function(_0x5a1241){while(--_0x5a1241){_0x15603b['push'](_0x15603b['shift']());}};_0x5d887a(++_0x3e397c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x34c112,_0x5ec851){_0x34c112=_0x34c112-0x0;var _0x401643=_0x1cb9[_0x34c112];return _0x401643;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('MemberReport,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['findAll']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'limit':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]||null:null,'include':_0x1cd34b['options']?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1b')]?_[_0x91cb('0x1c')](_0x1cd34b['options'][_0x91cb('0x1b')],function(_0x1a7a54){return{'model':db[_0x1a7a54[_0x91cb('0x1d')]],'as':_0x1a7a54['as'],'attributes':_0x1a7a54[_0x91cb('0x19')],'include':_0x1a7a54[_0x91cb('0x1b')]?_[_0x91cb('0x1c')](_0x1a7a54[_0x91cb('0x1b')],function(_0x423c4f){return{'model':db[_0x423c4f[_0x91cb('0x1d')]],'as':_0x423c4f['as'],'attributes':_0x423c4f['attributes'],'include':_0x423c4f['include']?_[_0x91cb('0x1c')](_0x423c4f['include'],function(_0x1c67d2){return{'model':db[_0x1c67d2[_0x91cb('0x1d')]],'as':_0x1c67d2['as'],'attributes':_0x1c67d2[_0x91cb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9b26a6){logger['info'](_0x91cb('0x16'),_0x1cd34b);logger[_0x91cb('0xf')](_0x91cb('0x16'),_0x1cd34b,JSON[_0x91cb('0x11')](_0x9b26a6));_0x5cc1c3(_0x9b26a6);})[_0x91cb('0x15')](function(_0x504275){logger[_0x91cb('0x12')]('GetMemberReport',_0x504275[_0x91cb('0x13')],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x504275[_0x91cb('0x13')]));});});};exports['CreateMemberReport']=function(_0x775c25){var _0x146e1f=this;return new Promise(function(_0x25bbf9,_0x361e4c){return db[_0x91cb('0x17')][_0x91cb('0x1e')](_0x775c25[_0x91cb('0x1f')],{'raw':_0x775c25[_0x91cb('0x18')]?_0x775c25[_0x91cb('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x91cb('0x20')](function(_0x474a15){logger[_0x91cb('0xc')](_0x91cb('0x21'),_0x775c25);logger[_0x91cb('0xf')]('CreateMemberReport',_0x775c25,JSON[_0x91cb('0x11')](_0x474a15));_0x25bbf9(_0x474a15);})[_0x91cb('0x15')](function(_0x2e317c){logger[_0x91cb('0x12')](_0x91cb('0x21'),_0x2e317c['message'],_0x775c25);_0x361e4c(_0x146e1f[_0x91cb('0x12')](0x1f4,_0x2e317c['message']));});});};exports['UpdateMemberReport']=function(_0x479968){var _0x2011fc=this;return new Promise(function(_0x4bba88,_0x341ebe){return db['MemberReport']['update'](_0x479968[_0x91cb('0x1f')],{'raw':_0x479968[_0x91cb('0x18')]?_0x479968[_0x91cb('0x18')][_0x91cb('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x479968[_0x91cb('0x18')]?_0x479968['options'][_0x91cb('0x23')]||null:null,'attributes':_0x479968[_0x91cb('0x18')]?_0x479968[_0x91cb('0x18')][_0x91cb('0x19')]||null:null,'limit':_0x479968['options']?_0x479968['options'][_0x91cb('0x1a')]||null:null})[_0x91cb('0x20')](function(_0x56d614){logger[_0x91cb('0xc')](_0x91cb('0x24'),_0x479968);logger['debug'](_0x91cb('0x24'),_0x479968,JSON[_0x91cb('0x11')](_0x56d614));_0x4bba88(_0x56d614);})['catch'](function(_0x43d4fe){logger['error'](_0x91cb('0x24'),_0x43d4fe[_0x91cb('0x13')],_0x479968);_0x341ebe(_0x2011fc[_0x91cb('0x12')](0x1f4,_0x43d4fe[_0x91cb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6c04ecd..1adf429 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 _0x7fc4=['../../config/environment','get','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x46d120,_0x12161b){var _0xdde6b7=function(_0x381fd7){while(--_0x381fd7){_0x46d120['push'](_0x46d120['shift']());}};_0xdde6b7(++_0x12161b);}(_0x7fc4,0x8f));var _0x47fc=function(_0x285839,_0x50e23a){_0x285839=_0x285839-0x0;var _0x4dbeac=_0x7fc4[_0x285839];return _0x4dbeac;};'use strict';var multer=require(_0x47fc('0x0'));var util=require(_0x47fc('0x1'));var path=require(_0x47fc('0x2'));var timeout=require(_0x47fc('0x3'));var express=require('express');var router=express[_0x47fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47fc('0x5'));var interaction=require(_0x47fc('0x6'));var config=require(_0x47fc('0x7'));var controller=require('./migration.controller');router[_0x47fc('0x8')]('/',controller['index']);module[_0x47fc('0x9')]=router; \ No newline at end of file +var _0x361b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','connect-timeout','Router'];(function(_0xeac1b5,_0x1da5c4){var _0x34e0f6=function(_0x496243){while(--_0x496243){_0xeac1b5['push'](_0xeac1b5['shift']());}};_0x34e0f6(++_0x1da5c4);}(_0x361b,0x97));var _0xb361=function(_0x2530af,_0x3c3185){_0x2530af=_0x2530af-0x0;var _0x5bd85e=_0x361b[_0x2530af];return _0x5bd85e;};'use strict';var multer=require(_0xb361('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb361('0x1'));var express=require('express');var router=express[_0xb361('0x2')]();var fs_extra=require(_0xb361('0x3'));var auth=require(_0xb361('0x4'));var interaction=require(_0xb361('0x5'));var config=require(_0xb361('0x6'));var controller=require(_0xb361('0x7'));router[_0xb361('0x8')]('/',controller[_0xb361('0x9')]);module[_0xb361('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 6738d37..f1cd897 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 _0x001c=['version','sequelize','STRING'];(function(_0x9e9a8e,_0x2334c1){var _0xdca4a2=function(_0xb09e88){while(--_0xb09e88){_0x9e9a8e['push'](_0x9e9a8e['shift']());}};_0xdca4a2(++_0x2334c1);}(_0x001c,0x181));var _0xc001=function(_0x57eeef,_0x4bc59c){_0x57eeef=_0x57eeef-0x0;var _0x48b347=_0x001c[_0x57eeef];return _0x48b347;};'use strict';var Sequelize=require(_0xc001('0x0'));module['exports']={'version':{'type':Sequelize[_0xc001('0x1')],'unique':_0xc001('0x2')}}; \ No newline at end of file +var _0x0700=['STRING','version','sequelize','exports'];(function(_0x1847a4,_0x5c4371){var _0x207731=function(_0x56244c){while(--_0x56244c){_0x1847a4['push'](_0x1847a4['shift']());}};_0x207731(++_0x5c4371);}(_0x0700,0x112));var _0x0070=function(_0x3d980a,_0x5b1758){_0x3d980a=_0x3d980a-0x0;var _0x2dce0d=_0x0700[_0x3d980a];return _0x2dce0d;};'use strict';var Sequelize=require(_0x0070('0x0'));module[_0x0070('0x1')]={'version':{'type':Sequelize[_0x0070('0x2')],'unique':_0x0070('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 2a2f9df..4a66199 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 _0xb077=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','set','Content-Range','apply','reject','update','then','error','name','index','Migration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','rimraf','fast-json-patch','request-promise','moment','mustache'];(function(_0x537c6,_0x977e51){var _0x26ae3e=function(_0xb3cba1){while(--_0xb3cba1){_0x537c6['push'](_0x537c6['shift']());}};_0x26ae3e(++_0x977e51);}(_0xb077,0x7f));var _0x7b07=function(_0x2e875f,_0x10afa0){_0x2e875f=_0x2e875f-0x0;var _0x21c6e9=_0xb077[_0x2e875f];return _0x21c6e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b07('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b07('0x1'));var rp=require(_0x7b07('0x2'));var moment=require(_0x7b07('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b07('0x4'));var util=require(_0x7b07('0x5'));var path=require(_0x7b07('0x6'));var sox=require(_0x7b07('0x7'));var csv=require(_0x7b07('0x8'));var ejs=require(_0x7b07('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b07('0xa'));var squel=require(_0x7b07('0xb'));var crypto=require(_0x7b07('0xc'));var jsforce=require(_0x7b07('0xd'));var deskjs=require(_0x7b07('0xe'));var toCsv=require(_0x7b07('0x8'));var querystring=require(_0x7b07('0xf'));var Papa=require('papaparse');var Redis=require(_0x7b07('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7b07('0x11'));var as=require(_0x7b07('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b07('0x13'))(_0x7b07('0x14'));var utils=require(_0x7b07('0x15'));var config=require(_0x7b07('0x16'));var licenseUtil=require(_0x7b07('0x17'));var db=require(_0x7b07('0x18'))['db'];function respondWithStatusCode(_0x4aa887,_0x3f24bd){_0x3f24bd=_0x3f24bd||0xcc;return function(_0x5985ba){if(_0x5985ba){return _0x4aa887[_0x7b07('0x19')](_0x3f24bd);}return _0x4aa887['status'](_0x3f24bd)[_0x7b07('0x1a')]();};}function respondWithResult(_0x163b2a,_0x377316){_0x377316=_0x377316||0xc8;return function(_0x2ff4f5){if(_0x2ff4f5){return _0x163b2a['status'](_0x377316)['json'](_0x2ff4f5);}};}function respondWithFilteredResult(_0x3ef92c,_0x4b90bf){return function(_0xcd70f3){if(_0xcd70f3){var _0x3b6a27=typeof _0x4b90bf['offset']===_0x7b07('0x1b')&&typeof _0x4b90bf['limit']==='undefined';var _0x5bde74=_0xcd70f3['count'];var _0x1e4839=_0x3b6a27?0x0:_0x4b90bf['offset'];var _0x31c96a=_0x3b6a27?_0xcd70f3[_0x7b07('0x1c')]:_0x4b90bf[_0x7b07('0x1d')]+_0x4b90bf[_0x7b07('0x1e')];var _0x31935e;if(_0x31c96a>=_0x5bde74){_0x31c96a=_0x5bde74;_0x31935e=0xc8;}else{_0x31935e=0xce;}_0x3ef92c[_0x7b07('0x1f')](_0x31935e);return _0x3ef92c[_0x7b07('0x20')](_0x7b07('0x21'),_0x1e4839+'-'+_0x31c96a+'/'+_0x5bde74)['json'](_0xcd70f3);}return null;};}function patchUpdates(_0x18a672){return function(_0x4d06aa){try{jsonpatch[_0x7b07('0x22')](_0x4d06aa,_0x18a672,!![]);}catch(_0x5526bd){return BPromise[_0x7b07('0x23')](_0x5526bd);}return _0x4d06aa['save']();};}function saveUpdates(_0x35b06d,_0x240e60){return function(_0x155d1b){if(_0x155d1b){return _0x155d1b[_0x7b07('0x24')](_0x35b06d)[_0x7b07('0x25')](function(_0x5a00df){return _0x5a00df;});}return null;};}function removeEntity(_0x43e501,_0x346043){return function(_0x285a63){if(_0x285a63){return _0x285a63['destroy']()[_0x7b07('0x25')](function(){_0x43e501[_0x7b07('0x1f')](0xcc)[_0x7b07('0x1a')]();});}};}function handleEntityNotFound(_0x12c208,_0x5dd89e){return function(_0x47a5d6){if(!_0x47a5d6){_0x12c208[_0x7b07('0x19')](0x194);}return _0x47a5d6;};}function handleError(_0x9806db,_0x57f56d){_0x57f56d=_0x57f56d||0x1f4;return function(_0x3f6a5c){logger[_0x7b07('0x26')](_0x3f6a5c['stack']);if(_0x3f6a5c[_0x7b07('0x27')]){delete _0x3f6a5c[_0x7b07('0x27')];}_0x9806db[_0x7b07('0x1f')](_0x57f56d)['send'](_0x3f6a5c);};}exports[_0x7b07('0x28')]=function(_0x728da8,_0x5d3fa6){var _0x10efcb={},_0x58cb00={},_0x4234fa={'count':0x0,'rows':[]};var _0x3e9483=_['map'](db[_0x7b07('0x29')][_0x7b07('0x2a')],function(_0x182319){return{'name':_0x182319[_0x7b07('0x2b')],'type':_0x182319[_0x7b07('0x2c')][_0x7b07('0x2d')]};});_0x58cb00[_0x7b07('0x2e')]=_[_0x7b07('0x2f')](_0x3e9483,_0x7b07('0x27'));_0x58cb00[_0x7b07('0x30')]=_['keys'](_0x728da8[_0x7b07('0x30')]);_0x58cb00[_0x7b07('0x31')]=_[_0x7b07('0x32')](_0x58cb00[_0x7b07('0x2e')],_0x58cb00[_0x7b07('0x30')]);_0x10efcb['attributes']=_['intersection'](_0x58cb00[_0x7b07('0x2e')],qs[_0x7b07('0x33')](_0x728da8[_0x7b07('0x30')][_0x7b07('0x33')]));_0x10efcb[_0x7b07('0x34')]=_0x10efcb['attributes']['length']?_0x10efcb['attributes']:_0x58cb00[_0x7b07('0x2e')];if(!_0x728da8[_0x7b07('0x30')][_0x7b07('0x35')](_0x7b07('0x36'))){_0x10efcb[_0x7b07('0x1e')]=qs[_0x7b07('0x1e')](_0x728da8[_0x7b07('0x30')][_0x7b07('0x1e')]);_0x10efcb[_0x7b07('0x1d')]=qs[_0x7b07('0x1d')](_0x728da8[_0x7b07('0x30')][_0x7b07('0x1d')]);}_0x10efcb[_0x7b07('0x37')]=qs[_0x7b07('0x38')](_0x728da8[_0x7b07('0x30')][_0x7b07('0x38')]);_0x10efcb[_0x7b07('0x39')]=qs[_0x7b07('0x31')](_[_0x7b07('0x3a')](_0x728da8[_0x7b07('0x30')],_0x58cb00[_0x7b07('0x31')]),_0x3e9483);if(_0x728da8[_0x7b07('0x30')]['filter']){_0x10efcb[_0x7b07('0x39')]=_[_0x7b07('0x3b')](_0x10efcb[_0x7b07('0x39')],{'$or':_[_0x7b07('0x2f')](_0x3e9483,function(_0x54a689){if(_0x54a689[_0x7b07('0x2c')]!==_0x7b07('0x3c')){var _0x1ff844={};_0x1ff844[_0x54a689[_0x7b07('0x27')]]={'$like':'%'+_0x728da8[_0x7b07('0x30')]['filter']+'%'};return _0x1ff844;}})});}_0x10efcb=_['merge']({},_0x10efcb,_0x728da8[_0x7b07('0x3d')]);var _0x24f8b0={'where':_0x10efcb[_0x7b07('0x39')]};return db[_0x7b07('0x29')][_0x7b07('0x1c')](_0x24f8b0)[_0x7b07('0x25')](function(_0x3d35a5){_0x4234fa[_0x7b07('0x1c')]=_0x3d35a5;if(_0x728da8[_0x7b07('0x30')][_0x7b07('0x3e')]){_0x10efcb[_0x7b07('0x3f')]=[{'all':!![]}];}return db[_0x7b07('0x29')][_0x7b07('0x40')](_0x10efcb);})[_0x7b07('0x25')](function(_0x3b1fc9){_0x4234fa[_0x7b07('0x41')]=_0x3b1fc9;return _0x4234fa;})[_0x7b07('0x25')](respondWithFilteredResult(_0x5d3fa6,_0x10efcb))['catch'](handleError(_0x5d3fa6,null));}; \ No newline at end of file +var _0xdfa6=['set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Migration','includeAll','include','findAll','rows','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0xdfa6,0xb2));var _0x6dfa=function(_0x5680a6,_0x1edd9e){_0x5680a6=_0x5680a6-0x0;var _0x4ed89b=_0xdfa6[_0x5680a6];return _0x4ed89b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6dfa('0x0'));var zipdir=require(_0x6dfa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dfa('0x2'));var moment=require(_0x6dfa('0x3'));var BPromise=require(_0x6dfa('0x4'));var Mustache=require(_0x6dfa('0x5'));var util=require(_0x6dfa('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6dfa('0x7'));var ejs=require(_0x6dfa('0x8'));var fs=require('fs');var fs_extra=require(_0x6dfa('0x9'));var _=require(_0x6dfa('0xa'));var squel=require(_0x6dfa('0xb'));var crypto=require(_0x6dfa('0xc'));var jsforce=require(_0x6dfa('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6dfa('0xe'));var Papa=require('papaparse');var Redis=require(_0x6dfa('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6dfa('0x10'));var hardwareService=require(_0x6dfa('0x11'));var logger=require(_0x6dfa('0x12'))('api');var utils=require(_0x6dfa('0x13'));var config=require(_0x6dfa('0x14'));var licenseUtil=require(_0x6dfa('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44961e,_0x2cc179){_0x2cc179=_0x2cc179||0xcc;return function(_0x1dbd20){if(_0x1dbd20){return _0x44961e['sendStatus'](_0x2cc179);}return _0x44961e[_0x6dfa('0x16')](_0x2cc179)[_0x6dfa('0x17')]();};}function respondWithResult(_0x3b8a3e,_0x4bf55d){_0x4bf55d=_0x4bf55d||0xc8;return function(_0x39bd26){if(_0x39bd26){return _0x3b8a3e[_0x6dfa('0x16')](_0x4bf55d)[_0x6dfa('0x18')](_0x39bd26);}};}function respondWithFilteredResult(_0x5464e4,_0x522ea5){return function(_0x5cf6bc){if(_0x5cf6bc){var _0xf2a907=typeof _0x522ea5['offset']===_0x6dfa('0x19')&&typeof _0x522ea5[_0x6dfa('0x1a')]===_0x6dfa('0x19');var _0x2474d3=_0x5cf6bc[_0x6dfa('0x1b')];var _0x1b973c=_0xf2a907?0x0:_0x522ea5['offset'];var _0x573874=_0xf2a907?_0x5cf6bc[_0x6dfa('0x1b')]:_0x522ea5[_0x6dfa('0x1c')]+_0x522ea5[_0x6dfa('0x1a')];var _0x3a4d30;if(_0x573874>=_0x2474d3){_0x573874=_0x2474d3;_0x3a4d30=0xc8;}else{_0x3a4d30=0xce;}_0x5464e4[_0x6dfa('0x16')](_0x3a4d30);return _0x5464e4[_0x6dfa('0x1d')](_0x6dfa('0x1e'),_0x1b973c+'-'+_0x573874+'/'+_0x2474d3)[_0x6dfa('0x18')](_0x5cf6bc);}return null;};}function patchUpdates(_0x1c0135){return function(_0x4ac383){try{jsonpatch[_0x6dfa('0x1f')](_0x4ac383,_0x1c0135,!![]);}catch(_0x4403f4){return BPromise[_0x6dfa('0x20')](_0x4403f4);}return _0x4ac383[_0x6dfa('0x21')]();};}function saveUpdates(_0x15c558,_0x7ab568){return function(_0x266898){if(_0x266898){return _0x266898[_0x6dfa('0x22')](_0x15c558)[_0x6dfa('0x23')](function(_0x307846){return _0x307846;});}return null;};}function removeEntity(_0x332b68,_0x319926){return function(_0x8d722b){if(_0x8d722b){return _0x8d722b[_0x6dfa('0x24')]()[_0x6dfa('0x23')](function(){_0x332b68[_0x6dfa('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ab18,_0x157f7a){return function(_0x2d6590){if(!_0x2d6590){_0x55ab18[_0x6dfa('0x25')](0x194);}return _0x2d6590;};}function handleError(_0x4b8a6e,_0xc653a4){_0xc653a4=_0xc653a4||0x1f4;return function(_0x235e14){logger[_0x6dfa('0x26')](_0x235e14[_0x6dfa('0x27')]);if(_0x235e14[_0x6dfa('0x28')]){delete _0x235e14[_0x6dfa('0x28')];}_0x4b8a6e[_0x6dfa('0x16')](_0xc653a4)[_0x6dfa('0x29')](_0x235e14);};}exports[_0x6dfa('0x2a')]=function(_0x110ba8,_0x36daf3){var _0x3db1f6={},_0x1643c3={},_0x203796={'count':0x0,'rows':[]};var _0x5a5e69=_[_0x6dfa('0x2b')](db['Migration'][_0x6dfa('0x2c')],function(_0x43508b){return{'name':_0x43508b[_0x6dfa('0x2d')],'type':_0x43508b[_0x6dfa('0x2e')][_0x6dfa('0x2f')]};});_0x1643c3['model']=_[_0x6dfa('0x2b')](_0x5a5e69,_0x6dfa('0x28'));_0x1643c3['query']=_[_0x6dfa('0x30')](_0x110ba8['query']);_0x1643c3[_0x6dfa('0x31')]=_[_0x6dfa('0x32')](_0x1643c3[_0x6dfa('0x33')],_0x1643c3[_0x6dfa('0x34')]);_0x3db1f6[_0x6dfa('0x35')]=_['intersection'](_0x1643c3[_0x6dfa('0x33')],qs['fields'](_0x110ba8[_0x6dfa('0x34')][_0x6dfa('0x36')]));_0x3db1f6[_0x6dfa('0x35')]=_0x3db1f6[_0x6dfa('0x35')]['length']?_0x3db1f6[_0x6dfa('0x35')]:_0x1643c3[_0x6dfa('0x33')];if(!_0x110ba8[_0x6dfa('0x34')]['hasOwnProperty'](_0x6dfa('0x37'))){_0x3db1f6[_0x6dfa('0x1a')]=qs['limit'](_0x110ba8['query'][_0x6dfa('0x1a')]);_0x3db1f6[_0x6dfa('0x1c')]=qs[_0x6dfa('0x1c')](_0x110ba8['query'][_0x6dfa('0x1c')]);}_0x3db1f6[_0x6dfa('0x38')]=qs['sort'](_0x110ba8[_0x6dfa('0x34')][_0x6dfa('0x39')]);_0x3db1f6[_0x6dfa('0x3a')]=qs[_0x6dfa('0x31')](_[_0x6dfa('0x3b')](_0x110ba8[_0x6dfa('0x34')],_0x1643c3['filters']),_0x5a5e69);if(_0x110ba8['query'][_0x6dfa('0x3c')]){_0x3db1f6[_0x6dfa('0x3a')]=_[_0x6dfa('0x3d')](_0x3db1f6[_0x6dfa('0x3a')],{'$or':_[_0x6dfa('0x2b')](_0x5a5e69,function(_0x16149c){if(_0x16149c[_0x6dfa('0x2e')]!==_0x6dfa('0x3e')){var _0x31e123={};_0x31e123[_0x16149c[_0x6dfa('0x28')]]={'$like':'%'+_0x110ba8[_0x6dfa('0x34')][_0x6dfa('0x3c')]+'%'};return _0x31e123;}})});}_0x3db1f6=_[_0x6dfa('0x3d')]({},_0x3db1f6,_0x110ba8['options']);var _0x356d3f={'where':_0x3db1f6[_0x6dfa('0x3a')]};return db[_0x6dfa('0x3f')][_0x6dfa('0x1b')](_0x356d3f)[_0x6dfa('0x23')](function(_0x29a0ab){_0x203796[_0x6dfa('0x1b')]=_0x29a0ab;if(_0x110ba8[_0x6dfa('0x34')][_0x6dfa('0x40')]){_0x3db1f6[_0x6dfa('0x41')]=[{'all':!![]}];}return db[_0x6dfa('0x3f')][_0x6dfa('0x42')](_0x3db1f6);})[_0x6dfa('0x23')](function(_0x189cb2){_0x203796[_0x6dfa('0x43')]=_0x189cb2;return _0x203796;})[_0x6dfa('0x23')](respondWithFilteredResult(_0x36daf3,_0x3db1f6))[_0x6dfa('0x44')](handleError(_0x36daf3,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index bd22ef9..c6cadd4 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 _0x589d=['./migration.attributes','exports','Migration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x589d,0x1b0));var _0xd589=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x589d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd589('0x0'));var util=require(_0xd589('0x1'));var logger=require(_0xd589('0x2'))(_0xd589('0x3'));var moment=require(_0xd589('0x4'));var BPromise=require(_0xd589('0x5'));var rp=require(_0xd589('0x6'));var fs=require('fs');var path=require(_0xd589('0x7'));var rimraf=require(_0xd589('0x8'));var config=require(_0xd589('0x9'));var attributes=require(_0xd589('0xa'));module[_0xd589('0xb')]=function(_0x4c2f95,_0x5798b2){return _0x4c2f95['define'](_0xd589('0xc'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9907=['define','migrations','lodash','util','../../config/logger','moment','path','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9907,0x8a));var _0x7990=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x9907[_0x2a5b3b];return _0xae665a;};'use strict';var _=require(_0x7990('0x0'));var util=require(_0x7990('0x1'));var logger=require(_0x7990('0x2'))('api');var moment=require(_0x7990('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7990('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x7990('0x5')]=function(_0x41aad2,_0x52cbd8){return _0x41aad2[_0x7990('0x6')]('Migration',attributes,{'tableName':_0x7990('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 961a3f8..340b529 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 _0xd353=['lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x3489dc,_0x5c9f11){var _0x53b272=function(_0x465420){while(--_0x465420){_0x3489dc['push'](_0x3489dc['shift']());}};_0x53b272(++_0x5c9f11);}(_0xd353,0x7e));var _0x3d35=function(_0x3cf103,_0x35ec24){_0x3cf103=_0x3cf103-0x0;var _0x47c346=_0xd353[_0x3cf103];return _0x47c346;};'use strict';var _=require(_0x3d35('0x0'));var util=require(_0x3d35('0x1'));var moment=require('moment');var BPromise=require(_0x3d35('0x2'));var rs=require(_0x3d35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d35('0x4'));var logger=require('../../config/logger')(_0x3d35('0x5'));var config=require(_0x3d35('0x6'));var jayson=require(_0x3d35('0x7'));var client=jayson[_0x3d35('0x8')][_0x3d35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x174b6b,_0x1cf467,_0x5db879){return new BPromise(function(_0x2dd75b,_0x15e0d9){return client[_0x3d35('0xa')](_0x174b6b,_0x5db879)[_0x3d35('0xb')](function(_0x49c42d){logger[_0x3d35('0xc')](_0x3d35('0xd'),_0x1cf467,_0x3d35('0xe'));logger[_0x3d35('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x1cf467,'request\x20sent',JSON[_0x3d35('0x10')](_0x49c42d));if(_0x49c42d['error']){if(_0x49c42d['error']['code']===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x1cf467,_0x49c42d[_0x3d35('0x11')]['message']);return _0x15e0d9(_0x49c42d[_0x3d35('0x11')][_0x3d35('0x12')]);}logger[_0x3d35('0x11')](_0x3d35('0xd'),_0x1cf467,_0x49c42d['error'][_0x3d35('0x12')]);return _0x2dd75b(_0x49c42d[_0x3d35('0x11')]['message']);}else{logger[_0x3d35('0xc')](_0x3d35('0xd'),_0x1cf467,'request\x20sent');_0x2dd75b(_0x49c42d[_0x3d35('0x13')][_0x3d35('0x12')]);}})[_0x3d35('0x14')](function(_0xdf29b0){logger[_0x3d35('0x11')](_0x3d35('0xd'),_0x1cf467,_0xdf29b0);_0x15e0d9(_0xdf29b0);});});} \ No newline at end of file +var _0x8db0=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x59bf72,_0x4cee59){var _0x480154=function(_0x554913){while(--_0x554913){_0x59bf72['push'](_0x59bf72['shift']());}};_0x480154(++_0x4cee59);}(_0x8db0,0x65));var _0x08db=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x8db0[_0x52085a];return _0x5afc1a;};'use strict';var _=require(_0x08db('0x0'));var util=require(_0x08db('0x1'));var moment=require('moment');var BPromise=require(_0x08db('0x2'));var rs=require(_0x08db('0x3'));var fs=require('fs');var Redis=require(_0x08db('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x08db('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x08db('0x6'));var client=jayson['client'][_0x08db('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x528139,_0x41b4bf,_0x1ca3d1){return new BPromise(function(_0x16bcc0,_0x338674){return client[_0x08db('0x8')](_0x528139,_0x1ca3d1)['then'](function(_0x5d2772){logger[_0x08db('0x9')](_0x08db('0xa'),_0x41b4bf,_0x08db('0xb'));logger[_0x08db('0xc')](_0x08db('0xd'),_0x41b4bf,_0x08db('0xb'),JSON[_0x08db('0xe')](_0x5d2772));if(_0x5d2772[_0x08db('0xf')]){if(_0x5d2772[_0x08db('0xf')][_0x08db('0x10')]===0x1f4){logger[_0x08db('0xf')](_0x08db('0xa'),_0x41b4bf,_0x5d2772[_0x08db('0xf')][_0x08db('0x11')]);return _0x338674(_0x5d2772[_0x08db('0xf')][_0x08db('0x11')]);}logger[_0x08db('0xf')]('Migration,\x20%s,\x20%s',_0x41b4bf,_0x5d2772['error']['message']);return _0x16bcc0(_0x5d2772[_0x08db('0xf')][_0x08db('0x11')]);}else{logger[_0x08db('0x9')](_0x08db('0xa'),_0x41b4bf,'request\x20sent');_0x16bcc0(_0x5d2772[_0x08db('0x12')]['message']);}})[_0x08db('0x13')](function(_0x4f0e49){logger[_0x08db('0xf')](_0x08db('0xa'),_0x41b4bf,_0x4f0e49);_0x338674(_0x4f0e49);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 2190fdc..652db0b 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 _0xf954=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./network.controller','get','isAuthenticated','/:id','show','create','put','destroy','exports','multer','util'];(function(_0xa99f90,_0x283f3a){var _0x2c67e9=function(_0xff0156){while(--_0xff0156){_0xa99f90['push'](_0xa99f90['shift']());}};_0x2c67e9(++_0x283f3a);}(_0xf954,0x10e));var _0x4f95=function(_0x3638d3,_0x445d09){_0x3638d3=_0x3638d3-0x0;var _0x50802a=_0xf954[_0x3638d3];return _0x50802a;};'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('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4f95('0x7'));var controller=require(_0x4f95('0x8'));router[_0x4f95('0x9')]('/',auth[_0x4f95('0xa')](),controller['index']);router[_0x4f95('0x9')](_0x4f95('0xb'),auth[_0x4f95('0xa')](),controller[_0x4f95('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f95('0xd')]);router[_0x4f95('0xe')](_0x4f95('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4f95('0xb'),auth[_0x4f95('0xa')](),controller[_0x4f95('0xf')]);module[_0x4f95('0x10')]=router; \ No newline at end of file +var _0xab00=['./network.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x11133b,_0x4c0e3a){var _0x2f788a=function(_0x2c8547){while(--_0x2c8547){_0x11133b['push'](_0x11133b['shift']());}};_0x2f788a(++_0x4c0e3a);}(_0xab00,0x1b9));var _0x0ab0=function(_0x1dd782,_0x498a33){_0x1dd782=_0x1dd782-0x0;var _0x41a44c=_0xab00[_0x1dd782];return _0x41a44c;};'use strict';var multer=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var path=require(_0x0ab0('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ab0('0x3'));var router=express[_0x0ab0('0x4')]();var fs_extra=require(_0x0ab0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ab0('0x6'));var config=require('../../config/environment');var controller=require(_0x0ab0('0x7'));router[_0x0ab0('0x8')]('/',auth[_0x0ab0('0x9')](),controller[_0x0ab0('0xa')]);router[_0x0ab0('0x8')](_0x0ab0('0xb'),auth['isAuthenticated'](),controller[_0x0ab0('0xc')]);router[_0x0ab0('0xd')]('/',auth['isAuthenticated'](),controller[_0x0ab0('0xe')]);router['put'](_0x0ab0('0xb'),auth[_0x0ab0('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0ab0('0xf')]);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 e789afd..0abcebc 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 _0xbcdd=['exports','ENUM','stun','STRING'];(function(_0x2faaba,_0x3f2b50){var _0x7099d9=function(_0xffe9fb){while(--_0xffe9fb){_0x2faaba['push'](_0x2faaba['shift']());}};_0x7099d9(++_0x3f2b50);}(_0xbcdd,0x1f4));var _0xdbcd=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0xbcdd[_0x810025];return _0x4dbc81;};'use strict';var Sequelize=require('sequelize');module[_0xdbcd('0x0')]={'type':{'type':Sequelize[_0xdbcd('0x1')]('localnet','externip',_0xdbcd('0x2'),'turn')},'value':{'type':Sequelize[_0xdbcd('0x3')]},'username':{'type':Sequelize[_0xdbcd('0x3')]},'password':{'type':Sequelize[_0xdbcd('0x3')]}}; \ No newline at end of file +var _0xb03b=['turn','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0x28876d,_0x46f49d){var _0x1eb326=function(_0x47666f){while(--_0x47666f){_0x28876d['push'](_0x28876d['shift']());}};_0x1eb326(++_0x46f49d);}(_0xb03b,0x80));var _0xbb03=function(_0x60f1e8,_0xc73c1){_0x60f1e8=_0x60f1e8-0x0;var _0x58aba8=_0xb03b[_0x60f1e8];return _0x58aba8;};'use strict';var Sequelize=require(_0xbb03('0x0'));module[_0xbb03('0x1')]={'type':{'type':Sequelize[_0xbb03('0x2')](_0xbb03('0x3'),_0xbb03('0x4'),'stun',_0xbb03('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbb03('0x6')]},'password':{'type':Sequelize[_0xbb03('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 6db1279..907f91c 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 _0x9021=['toLowerCase','update','params','server/files/templates/stun_multiple.ejs','chan_sip.so','TURN','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','includeAll','include','findAll','rows','show','keys','options','find','create','body','toUpperCase','STUN','readFileSync','join','root','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf'];(function(_0x1d2b66,_0x256c6e){var _0x445a66=function(_0x2e5845){while(--_0x2e5845){_0x1d2b66['push'](_0x1d2b66['shift']());}};_0x445a66(++_0x256c6e);}(_0x9021,0x1a0));var _0x1902=function(_0x69ede,_0x3f8e97){_0x69ede=_0x69ede-0x0;var _0x13e7e1=_0x9021[_0x69ede];return _0x13e7e1;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0x1902('0x0'));var fs=require('fs');var _=require('lodash');var qs=require(_0x1902('0x1'));var logger=require(_0x1902('0x2'))(_0x1902('0x3'));var config=require(_0x1902('0x4'));var db=require(_0x1902('0x5'))['db'];var jayson=require(_0x1902('0x6'));var client=jayson['client'][_0x1902('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xdbbf77,_0x134f69,_0x4fcd7a,_0x37fb66){return new Promise(function(_0x47752c,_0x29b0d0){var _0x1f0498=_0x37fb66||client;return _0x1f0498[_0x1902('0x8')](_0xdbbf77,_0x4fcd7a)[_0x1902('0x9')](function(_0xa521dd){logger[_0x1902('0xa')](_0x1902('0xb'),_0x134f69,_0x1902('0xc'));logger[_0x1902('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x134f69,'request\x20sent',JSON[_0x1902('0xe')](_0xa521dd));if(_0xa521dd[_0x1902('0xf')]){if(_0xa521dd[_0x1902('0xf')]['code']===0x1f4){logger[_0x1902('0xf')](_0x1902('0xb'),_0x134f69,_0xa521dd[_0x1902('0xf')][_0x1902('0x10')]);return _0x29b0d0(_0xa521dd[_0x1902('0xf')]['message']);}logger[_0x1902('0xf')]('Network,\x20%s,\x20%s',_0x134f69,_0xa521dd['error'][_0x1902('0x10')]);return _0x47752c(_0xa521dd[_0x1902('0xf')]['message']);}else{logger['info'](_0x1902('0xb'),_0x134f69,_0x1902('0xc'));_0x47752c(_0xa521dd['result']['message']);}})[_0x1902('0x11')](function(_0xc79473){logger[_0x1902('0xf')](_0x1902('0xb'),_0x134f69,_0xc79473);_0x29b0d0(_0xc79473);});});}function respondWithResult(_0x1f6bbf,_0x4e9311){_0x4e9311=_0x4e9311||0xc8;return function(_0x105e54){if(_0x105e54){return _0x1f6bbf[_0x1902('0x12')](_0x4e9311)[_0x1902('0x13')](_0x105e54);}};}function respondWithFilteredResult(_0x345d3f,_0x49a306){return function(_0x36c056){if(_0x36c056){var _0x4caf78=typeof _0x49a306[_0x1902('0x14')]===_0x1902('0x15')&&typeof _0x49a306[_0x1902('0x16')]===_0x1902('0x15');var _0x2e85e4=_0x36c056[_0x1902('0x17')];var _0x5b81d0=_0x4caf78?0x0:_0x49a306[_0x1902('0x14')];var _0x38b482=_0x4caf78?_0x36c056[_0x1902('0x17')]:_0x49a306['offset']+_0x49a306[_0x1902('0x16')];var _0x38295f;if(_0x38b482>=_0x2e85e4){_0x38b482=_0x2e85e4;_0x38295f=0xc8;}else{_0x38295f=0xce;}_0x345d3f[_0x1902('0x12')](_0x38295f);return _0x345d3f[_0x1902('0x18')](_0x1902('0x19'),_0x5b81d0+'-'+_0x38b482+'/'+_0x2e85e4)[_0x1902('0x13')](_0x36c056);}return null;};}function saveUpdates(_0x2c2bac){return function(_0x22f65a){if(_0x22f65a){return _0x22f65a['update'](_0x2c2bac)[_0x1902('0x9')](function(_0x1da796){return _0x1da796;});}return null;};}function removeEntity(_0x157c7f){return function(_0x202ea2){if(_0x202ea2){return _0x202ea2[_0x1902('0x1a')]()['then'](function(){_0x157c7f[_0x1902('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x570dc7){return function(_0x59a6fb){if(!_0x59a6fb){_0x570dc7['sendStatus'](0x194);}return _0x59a6fb;};}function handleError(_0xdb67d5,_0x238c57){_0x238c57=_0x238c57||0x1f4;return function(_0x2eddad){logger[_0x1902('0xf')](_0x2eddad[_0x1902('0x1b')]);if(_0x2eddad[_0x1902('0x1c')]){delete _0x2eddad['name'];}_0xdb67d5[_0x1902('0x12')](_0x238c57)[_0x1902('0x1d')](_0x2eddad);};}exports[_0x1902('0x1e')]=function(_0x563138,_0x38c6b5){var _0x2f3c3f={},_0x3dc548={},_0x4ea397={'count':0x0,'rows':[]};var _0x3d8854=_[_0x1902('0x1f')](db[_0x1902('0x20')][_0x1902('0x21')],function(_0x25dc4e){return{'name':_0x25dc4e[_0x1902('0x22')],'type':_0x25dc4e[_0x1902('0x23')][_0x1902('0x24')]};});_0x3dc548[_0x1902('0x25')]=_['map'](_0x3d8854,_0x1902('0x1c'));_0x3dc548[_0x1902('0x26')]=_['keys'](_0x563138[_0x1902('0x26')]);_0x3dc548['filters']=_[_0x1902('0x27')](_0x3dc548[_0x1902('0x25')],_0x3dc548['query']);_0x2f3c3f['attributes']=_[_0x1902('0x27')](_0x3dc548['model'],qs['fields'](_0x563138[_0x1902('0x26')][_0x1902('0x28')]));_0x2f3c3f['attributes']=_0x2f3c3f[_0x1902('0x29')][_0x1902('0x2a')]?_0x2f3c3f[_0x1902('0x29')]:_0x3dc548[_0x1902('0x25')];if(!_0x563138[_0x1902('0x26')][_0x1902('0x2b')](_0x1902('0x2c'))){_0x2f3c3f[_0x1902('0x16')]=qs[_0x1902('0x16')](_0x563138[_0x1902('0x26')][_0x1902('0x16')]);_0x2f3c3f[_0x1902('0x14')]=qs[_0x1902('0x14')](_0x563138[_0x1902('0x26')][_0x1902('0x14')]);}_0x2f3c3f['order']=qs['sort'](_0x563138['query']['sort']);_0x2f3c3f[_0x1902('0x2d')]=qs[_0x1902('0x2e')](_[_0x1902('0x2f')](_0x563138['query'],_0x3dc548[_0x1902('0x2e')]),_0x3d8854);if(_0x563138[_0x1902('0x26')][_0x1902('0x30')]){_0x2f3c3f[_0x1902('0x2d')]=_[_0x1902('0x31')](_0x2f3c3f[_0x1902('0x2d')],{'$or':_[_0x1902('0x1f')](_0x3d8854,function(_0x3496d3){if(_0x3496d3[_0x1902('0x23')]!=='VIRTUAL'){var _0x31df3e={};_0x31df3e[_0x3496d3[_0x1902('0x1c')]]={'$like':'%'+_0x563138[_0x1902('0x26')][_0x1902('0x30')]+'%'};return _0x31df3e;}})});}_0x2f3c3f=_[_0x1902('0x31')]({},_0x2f3c3f,_0x563138['options']);var _0x1e6bbb={'where':_0x2f3c3f['where']};return db['Network']['count'](_0x1e6bbb)[_0x1902('0x9')](function(_0x4af4e9){_0x4ea397[_0x1902('0x17')]=_0x4af4e9;if(_0x563138[_0x1902('0x26')][_0x1902('0x32')]){_0x2f3c3f[_0x1902('0x33')]=[{'all':!![]}];}return db['Network'][_0x1902('0x34')](_0x2f3c3f);})[_0x1902('0x9')](function(_0xac7928){_0x4ea397[_0x1902('0x35')]=_0xac7928;return _0x4ea397;})[_0x1902('0x9')](respondWithFilteredResult(_0x38c6b5,_0x2f3c3f))[_0x1902('0x11')](handleError(_0x38c6b5,null));};exports[_0x1902('0x36')]=function(_0x299b6d,_0x1c8b3c){var _0x4007ab={'raw':!![],'where':{'id':_0x299b6d['params']['id']}},_0xa3672d={};_0xa3672d[_0x1902('0x25')]=_['keys'](db[_0x1902('0x20')][_0x1902('0x21')]);_0xa3672d[_0x1902('0x26')]=_[_0x1902('0x37')](_0x299b6d[_0x1902('0x26')]);_0xa3672d[_0x1902('0x2e')]=_[_0x1902('0x27')](_0xa3672d[_0x1902('0x25')],_0xa3672d[_0x1902('0x26')]);_0x4007ab[_0x1902('0x29')]=_[_0x1902('0x27')](_0xa3672d['model'],qs[_0x1902('0x28')](_0x299b6d[_0x1902('0x26')][_0x1902('0x28')]));_0x4007ab[_0x1902('0x29')]=_0x4007ab['attributes'][_0x1902('0x2a')]?_0x4007ab['attributes']:_0xa3672d[_0x1902('0x25')];if(_0x299b6d[_0x1902('0x26')][_0x1902('0x32')]){_0x4007ab['include']=[{'all':!![]}];}_0x4007ab=_['merge']({},_0x4007ab,_0x299b6d[_0x1902('0x38')]);return db[_0x1902('0x20')][_0x1902('0x39')](_0x4007ab)[_0x1902('0x9')](handleEntityNotFound(_0x1c8b3c,null))[_0x1902('0x9')](respondWithResult(_0x1c8b3c,null))[_0x1902('0x11')](handleError(_0x1c8b3c,null));};exports[_0x1902('0x3a')]=function(_0x2a4819,_0x5d23e9){var _0x24d4b1;return db[_0x1902('0x20')]['create'](_0x2a4819[_0x1902('0x3b')],{'raw':!![]})[_0x1902('0x9')](function(_0x443705){_0x24d4b1=_0x443705;return db[_0x1902('0x20')][_0x1902('0x34')]({'where':{'type':_0x2a4819[_0x1902('0x3b')][_0x1902('0x23')]},'raw':!![]});})[_0x1902('0x9')](function(_0x3bbadd){if(_0x24d4b1[_0x1902('0x23')][_0x1902('0x3c')]()==_0x1902('0x3d')){var _0x257f6d=fs[_0x1902('0x3e')](path[_0x1902('0x3f')](config[_0x1902('0x40')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x1b4679=ejs[_0x1902('0x41')](_0x257f6d,{'networks':_0x3bbadd||[]});fs[_0x1902('0x42')](_0x1902('0x43'),_0x1b4679);return respondWithRpcPromise(_0x1902('0x44'),_0x1902('0x3a'),{'module':_0x1902('0x45')});}else if(_0x24d4b1[_0x1902('0x23')][_0x1902('0x3c')]()=='TURN'){var _0x5751a6=fs[_0x1902('0x3e')](path[_0x1902('0x3f')](config['root'],_0x1902('0x46')),_0x1902('0x47'));var _0x436097=ejs[_0x1902('0x41')](_0x5751a6,{'networks':_0x3bbadd||[]});fs[_0x1902('0x42')](_0x1902('0x48'),_0x436097);return respondWithRpcPromise(_0x1902('0x44'),_0x1902('0x3a'),{'module':'res_stun_monitor.so'});}else{var _0x56281c=fs[_0x1902('0x3e')](path[_0x1902('0x3f')](config[_0x1902('0x40')],_0x1902('0x49')),'utf8');var _0x1c7f98=ejs[_0x1902('0x41')](_0x56281c,{'networks':_0x3bbadd||[]});fs[_0x1902('0x42')](util[_0x1902('0x4a')](_0x1902('0x4b'),_0x2a4819[_0x1902('0x3b')][_0x1902('0x23')][_0x1902('0x4c')]()),_0x1c7f98);return respondWithRpcPromise(_0x1902('0x44'),_0x1902('0x3a'),{'module':'chan_sip.so'});}})[_0x1902('0x9')](function(){return _0x24d4b1;})[_0x1902('0x9')](respondWithResult(_0x5d23e9,0xc9))[_0x1902('0x11')](handleError(_0x5d23e9,null));};exports[_0x1902('0x4d')]=function(_0x1ee4a4,_0x5bc4ce){var _0x25f8f5;return db[_0x1902('0x20')][_0x1902('0x39')]({'where':{'id':_0x1ee4a4[_0x1902('0x4e')]['id']}})[_0x1902('0x9')](handleEntityNotFound(_0x5bc4ce,null))[_0x1902('0x9')](saveUpdates(_0x1ee4a4[_0x1902('0x3b')],null))['then'](function(_0x5ab28a){if(_0x5ab28a){_0x25f8f5=_0x5ab28a;return db[_0x1902('0x20')][_0x1902('0x34')]({'where':{'type':_0x25f8f5[_0x1902('0x23')]},'raw':!![]});}return null;})[_0x1902('0x9')](function(_0x4220ba){if(_0x25f8f5[_0x1902('0x23')][_0x1902('0x3c')]()==_0x1902('0x3d')){var _0x23596e=fs['readFileSync'](path[_0x1902('0x3f')](config['root'],_0x1902('0x4f')),_0x1902('0x47'));var _0x330326=ejs['render'](_0x23596e,{'networks':_0x4220ba||[]});fs[_0x1902('0x42')](_0x1902('0x43'),_0x330326);return respondWithRpcPromise(_0x1902('0x44'),_0x1902('0x4d'),{'module':_0x1902('0x45')});}else if(_0x25f8f5[_0x1902('0x23')]['toUpperCase']()=='TURN'){var _0x25a0ff=fs[_0x1902('0x3e')](path[_0x1902('0x3f')](config[_0x1902('0x40')],_0x1902('0x46')),_0x1902('0x47'));var _0x3cd6ad=ejs[_0x1902('0x41')](_0x25a0ff,{'networks':_0x4220ba||[]});fs[_0x1902('0x42')](_0x1902('0x48'),_0x3cd6ad);return respondWithRpcPromise(_0x1902('0x44'),_0x1902('0x4d'),{'module':_0x1902('0x45')});}else{var _0xa34fdc=fs['readFileSync'](path[_0x1902('0x3f')](config[_0x1902('0x40')],_0x1902('0x49')),_0x1902('0x47'));var _0x40bb4c=ejs[_0x1902('0x41')](_0xa34fdc,{'networks':_0x4220ba||[]});fs[_0x1902('0x42')](util[_0x1902('0x4a')](_0x1902('0x4b'),_0x1ee4a4[_0x1902('0x3b')][_0x1902('0x23')][_0x1902('0x4c')]()),_0x40bb4c);return respondWithRpcPromise(_0x1902('0x44'),_0x1902('0x4d'),{'module':_0x1902('0x50')});}})[_0x1902('0x9')](function(_0x3512f9){if(_0x3512f9){return _0x25f8f5;}return null;})[_0x1902('0x9')](respondWithResult(_0x5bc4ce,null))[_0x1902('0x11')](handleError(_0x5bc4ce,null));};exports[_0x1902('0x1a')]=function(_0x5d9764,_0x10c8fa){var _0x397c4b;return db[_0x1902('0x20')]['find']({'where':{'id':_0x5d9764[_0x1902('0x4e')]['id']}})['then'](function(_0x402861){_0x397c4b=_0x402861;return _0x402861;})[_0x1902('0x9')](handleEntityNotFound(_0x10c8fa,null))['then'](removeEntity(_0x10c8fa,null))[_0x1902('0x9')](function(){if(_0x397c4b){return db[_0x1902('0x20')][_0x1902('0x34')]({'where':{'type':_0x397c4b[_0x1902('0x23')]},'raw':!![]});}})[_0x1902('0x9')](function(_0xd17ba7){if(_0x397c4b[_0x1902('0x23')][_0x1902('0x3c')]()==_0x1902('0x3d')){var _0x7431ed=fs[_0x1902('0x3e')](path['join'](config[_0x1902('0x40')],_0x1902('0x4f')),_0x1902('0x47'));var _0x811f1=ejs[_0x1902('0x41')](_0x7431ed,{'networks':_0xd17ba7||[]});fs[_0x1902('0x42')](_0x1902('0x43'),_0x811f1);return respondWithRpcPromise('Reload',_0x1902('0x1a'),{'module':_0x1902('0x45')});}else if(_0x397c4b['type'][_0x1902('0x3c')]()==_0x1902('0x51')){var _0x5f3efa=fs[_0x1902('0x3e')](path[_0x1902('0x3f')](config[_0x1902('0x40')],_0x1902('0x46')),_0x1902('0x47'));var _0x52d22f=ejs[_0x1902('0x41')](_0x5f3efa,{'networks':_0xd17ba7||[]});fs[_0x1902('0x42')](_0x1902('0x48'),_0x52d22f);return respondWithRpcPromise(_0x1902('0x44'),'destroy',{'module':_0x1902('0x45')});}else{var _0x2af0b8=fs[_0x1902('0x3e')](path['join'](config[_0x1902('0x40')],'server/files/templates/network.ejs'),_0x1902('0x47'));var _0x1361ee=ejs[_0x1902('0x41')](_0x2af0b8,{'networks':_0xd17ba7||[]});fs[_0x1902('0x42')](util[_0x1902('0x4a')]('/etc/asterisk/sip_xcally_%s.conf',_0x397c4b['type'][_0x1902('0x4c')]()),_0x1361ee);return respondWithRpcPromise(_0x1902('0x44'),'destroy',{'module':_0x1902('0x50')});}})[_0x1902('0x11')](handleError(_0x10c8fa,null));}; \ No newline at end of file +var _0x2ca9=['request\x20sent','stringify','error','code','message','Network,\x20%s,\x20%s','result','status','undefined','offset','limit','set','json','update','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Network','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','format','path','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s,\x20%s'];(function(_0x52e238,_0xa8a17a){var _0x357003=function(_0x5e2239){while(--_0x5e2239){_0x52e238['push'](_0x52e238['shift']());}};_0x357003(++_0xa8a17a);}(_0x2ca9,0x19d));var _0x92ca=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x2ca9[_0x515afd];return _0x536d53;};'use strict';var util=require('util');var path=require(_0x92ca('0x0'));var ejs=require(_0x92ca('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0x92ca('0x2'));var logger=require(_0x92ca('0x3'))(_0x92ca('0x4'));var config=require(_0x92ca('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0x92ca('0x6'));var client=jayson[_0x92ca('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54c0b8,_0x12f6e5,_0x488cca,_0x5e07b0){return new Promise(function(_0x152c55,_0x174239){var _0x283882=_0x5e07b0||client;return _0x283882[_0x92ca('0x8')](_0x54c0b8,_0x488cca)[_0x92ca('0x9')](function(_0x248406){logger[_0x92ca('0xa')]('Network,\x20%s,\x20%s',_0x12f6e5,'request\x20sent');logger['debug'](_0x92ca('0xb'),_0x12f6e5,_0x92ca('0xc'),JSON[_0x92ca('0xd')](_0x248406));if(_0x248406[_0x92ca('0xe')]){if(_0x248406[_0x92ca('0xe')][_0x92ca('0xf')]===0x1f4){logger[_0x92ca('0xe')]('Network,\x20%s,\x20%s',_0x12f6e5,_0x248406['error'][_0x92ca('0x10')]);return _0x174239(_0x248406[_0x92ca('0xe')][_0x92ca('0x10')]);}logger['error'](_0x92ca('0x11'),_0x12f6e5,_0x248406[_0x92ca('0xe')][_0x92ca('0x10')]);return _0x152c55(_0x248406[_0x92ca('0xe')]['message']);}else{logger[_0x92ca('0xa')]('Network,\x20%s,\x20%s',_0x12f6e5,_0x92ca('0xc'));_0x152c55(_0x248406[_0x92ca('0x12')]['message']);}})['catch'](function(_0x570bf0){logger['error'](_0x92ca('0x11'),_0x12f6e5,_0x570bf0);_0x174239(_0x570bf0);});});}function respondWithResult(_0x663d27,_0xf67005){_0xf67005=_0xf67005||0xc8;return function(_0x4aa00b){if(_0x4aa00b){return _0x663d27[_0x92ca('0x13')](_0xf67005)['json'](_0x4aa00b);}};}function respondWithFilteredResult(_0x4dbf7e,_0x58fb80){return function(_0x1de50e){if(_0x1de50e){var _0x259692=typeof _0x58fb80['offset']===_0x92ca('0x14')&&typeof _0x58fb80['limit']==='undefined';var _0x56bb1b=_0x1de50e['count'];var _0xc8ab87=_0x259692?0x0:_0x58fb80[_0x92ca('0x15')];var _0x19d989=_0x259692?_0x1de50e['count']:_0x58fb80[_0x92ca('0x15')]+_0x58fb80[_0x92ca('0x16')];var _0x496abb;if(_0x19d989>=_0x56bb1b){_0x19d989=_0x56bb1b;_0x496abb=0xc8;}else{_0x496abb=0xce;}_0x4dbf7e[_0x92ca('0x13')](_0x496abb);return _0x4dbf7e[_0x92ca('0x17')]('Content-Range',_0xc8ab87+'-'+_0x19d989+'/'+_0x56bb1b)[_0x92ca('0x18')](_0x1de50e);}return null;};}function saveUpdates(_0x32d3b1){return function(_0x54415a){if(_0x54415a){return _0x54415a[_0x92ca('0x19')](_0x32d3b1)[_0x92ca('0x9')](function(_0x2fedea){return _0x2fedea;});}return null;};}function removeEntity(_0x41922d){return function(_0x470f49){if(_0x470f49){return _0x470f49[_0x92ca('0x1a')]()[_0x92ca('0x9')](function(){_0x41922d[_0x92ca('0x13')](0xcc)[_0x92ca('0x1b')]();});}};}function handleEntityNotFound(_0x584408){return function(_0x194499){if(!_0x194499){_0x584408[_0x92ca('0x1c')](0x194);}return _0x194499;};}function handleError(_0x477e18,_0x51b37b){_0x51b37b=_0x51b37b||0x1f4;return function(_0x478955){logger[_0x92ca('0xe')](_0x478955['stack']);if(_0x478955[_0x92ca('0x1d')]){delete _0x478955[_0x92ca('0x1d')];}_0x477e18['status'](_0x51b37b)[_0x92ca('0x1e')](_0x478955);};}exports[_0x92ca('0x1f')]=function(_0x586eb6,_0x2211fe){var _0x3649c3={},_0xab43c4={},_0x95d2ec={'count':0x0,'rows':[]};var _0x1cb19b=_[_0x92ca('0x20')](db['Network'][_0x92ca('0x21')],function(_0x3e9cb3){return{'name':_0x3e9cb3[_0x92ca('0x22')],'type':_0x3e9cb3[_0x92ca('0x23')][_0x92ca('0x24')]};});_0xab43c4[_0x92ca('0x25')]=_[_0x92ca('0x20')](_0x1cb19b,_0x92ca('0x1d'));_0xab43c4[_0x92ca('0x26')]=_['keys'](_0x586eb6[_0x92ca('0x26')]);_0xab43c4[_0x92ca('0x27')]=_[_0x92ca('0x28')](_0xab43c4[_0x92ca('0x25')],_0xab43c4['query']);_0x3649c3[_0x92ca('0x29')]=_['intersection'](_0xab43c4[_0x92ca('0x25')],qs[_0x92ca('0x2a')](_0x586eb6['query'][_0x92ca('0x2a')]));_0x3649c3[_0x92ca('0x29')]=_0x3649c3[_0x92ca('0x29')][_0x92ca('0x2b')]?_0x3649c3[_0x92ca('0x29')]:_0xab43c4['model'];if(!_0x586eb6[_0x92ca('0x26')][_0x92ca('0x2c')]('nolimit')){_0x3649c3[_0x92ca('0x16')]=qs[_0x92ca('0x16')](_0x586eb6[_0x92ca('0x26')][_0x92ca('0x16')]);_0x3649c3[_0x92ca('0x15')]=qs[_0x92ca('0x15')](_0x586eb6[_0x92ca('0x26')][_0x92ca('0x15')]);}_0x3649c3[_0x92ca('0x2d')]=qs[_0x92ca('0x2e')](_0x586eb6[_0x92ca('0x26')]['sort']);_0x3649c3[_0x92ca('0x2f')]=qs['filters'](_[_0x92ca('0x30')](_0x586eb6[_0x92ca('0x26')],_0xab43c4[_0x92ca('0x27')]),_0x1cb19b);if(_0x586eb6['query']['filter']){_0x3649c3[_0x92ca('0x2f')]=_[_0x92ca('0x31')](_0x3649c3['where'],{'$or':_['map'](_0x1cb19b,function(_0x2e7a06){if(_0x2e7a06[_0x92ca('0x23')]!==_0x92ca('0x32')){var _0x75446d={};_0x75446d[_0x2e7a06[_0x92ca('0x1d')]]={'$like':'%'+_0x586eb6[_0x92ca('0x26')][_0x92ca('0x33')]+'%'};return _0x75446d;}})});}_0x3649c3=_[_0x92ca('0x31')]({},_0x3649c3,_0x586eb6[_0x92ca('0x34')]);var _0xa0eb78={'where':_0x3649c3[_0x92ca('0x2f')]};return db[_0x92ca('0x35')][_0x92ca('0x36')](_0xa0eb78)['then'](function(_0x43dd77){_0x95d2ec[_0x92ca('0x36')]=_0x43dd77;if(_0x586eb6['query'][_0x92ca('0x37')]){_0x3649c3[_0x92ca('0x38')]=[{'all':!![]}];}return db[_0x92ca('0x35')][_0x92ca('0x39')](_0x3649c3);})[_0x92ca('0x9')](function(_0x373807){_0x95d2ec[_0x92ca('0x3a')]=_0x373807;return _0x95d2ec;})[_0x92ca('0x9')](respondWithFilteredResult(_0x2211fe,_0x3649c3))[_0x92ca('0x3b')](handleError(_0x2211fe,null));};exports[_0x92ca('0x3c')]=function(_0x1678ac,_0x363a16){var _0x174a41={'raw':!![],'where':{'id':_0x1678ac[_0x92ca('0x3d')]['id']}},_0x4ff33c={};_0x4ff33c['model']=_[_0x92ca('0x3e')](db['Network']['rawAttributes']);_0x4ff33c[_0x92ca('0x26')]=_[_0x92ca('0x3e')](_0x1678ac[_0x92ca('0x26')]);_0x4ff33c[_0x92ca('0x27')]=_[_0x92ca('0x28')](_0x4ff33c['model'],_0x4ff33c['query']);_0x174a41[_0x92ca('0x29')]=_[_0x92ca('0x28')](_0x4ff33c[_0x92ca('0x25')],qs[_0x92ca('0x2a')](_0x1678ac[_0x92ca('0x26')][_0x92ca('0x2a')]));_0x174a41[_0x92ca('0x29')]=_0x174a41[_0x92ca('0x29')][_0x92ca('0x2b')]?_0x174a41[_0x92ca('0x29')]:_0x4ff33c[_0x92ca('0x25')];if(_0x1678ac[_0x92ca('0x26')][_0x92ca('0x37')]){_0x174a41[_0x92ca('0x38')]=[{'all':!![]}];}_0x174a41=_[_0x92ca('0x31')]({},_0x174a41,_0x1678ac[_0x92ca('0x34')]);return db['Network'][_0x92ca('0x3f')](_0x174a41)['then'](handleEntityNotFound(_0x363a16,null))[_0x92ca('0x9')](respondWithResult(_0x363a16,null))['catch'](handleError(_0x363a16,null));};exports[_0x92ca('0x40')]=function(_0x23d505,_0x4d7ff4){var _0x25ecd9;return db['Network']['create'](_0x23d505[_0x92ca('0x41')],{'raw':!![]})['then'](function(_0x5c383f){_0x25ecd9=_0x5c383f;return db[_0x92ca('0x35')][_0x92ca('0x39')]({'where':{'type':_0x23d505[_0x92ca('0x41')][_0x92ca('0x23')]},'raw':!![]});})[_0x92ca('0x9')](function(_0x102563){if(_0x25ecd9['type'][_0x92ca('0x42')]()==_0x92ca('0x43')){var _0x139991=fs[_0x92ca('0x44')](path[_0x92ca('0x45')](config[_0x92ca('0x46')],_0x92ca('0x47')),_0x92ca('0x48'));var _0x17b10b=ejs[_0x92ca('0x49')](_0x139991,{'networks':_0x102563||[]});fs[_0x92ca('0x4a')]('/etc/asterisk/stun_xcally.conf',_0x17b10b);return respondWithRpcPromise(_0x92ca('0x4b'),_0x92ca('0x40'),{'module':_0x92ca('0x4c')});}else if(_0x25ecd9[_0x92ca('0x23')][_0x92ca('0x42')]()=='TURN'){var _0x481cb9=fs[_0x92ca('0x44')](path['join'](config[_0x92ca('0x46')],_0x92ca('0x4d')),_0x92ca('0x48'));var _0x4dad1a=ejs[_0x92ca('0x49')](_0x481cb9,{'networks':_0x102563||[]});fs['writeFileSync'](_0x92ca('0x4e'),_0x4dad1a);return respondWithRpcPromise(_0x92ca('0x4b'),_0x92ca('0x40'),{'module':_0x92ca('0x4c')});}else{var _0x3f1ca7=fs[_0x92ca('0x44')](path['join'](config['root'],_0x92ca('0x4f')),_0x92ca('0x48'));var _0x3c376f=ejs[_0x92ca('0x49')](_0x3f1ca7,{'networks':_0x102563||[]});fs[_0x92ca('0x4a')](util['format'](_0x92ca('0x50'),_0x23d505[_0x92ca('0x41')][_0x92ca('0x23')][_0x92ca('0x51')]()),_0x3c376f);return respondWithRpcPromise(_0x92ca('0x4b'),_0x92ca('0x40'),{'module':_0x92ca('0x52')});}})['then'](function(){return _0x25ecd9;})['then'](respondWithResult(_0x4d7ff4,0xc9))[_0x92ca('0x3b')](handleError(_0x4d7ff4,null));};exports[_0x92ca('0x19')]=function(_0x28e868,_0x8cdf62){var _0x1012b5;return db[_0x92ca('0x35')][_0x92ca('0x3f')]({'where':{'id':_0x28e868[_0x92ca('0x3d')]['id']}})['then'](handleEntityNotFound(_0x8cdf62,null))[_0x92ca('0x9')](saveUpdates(_0x28e868[_0x92ca('0x41')],null))['then'](function(_0x3b74bf){if(_0x3b74bf){_0x1012b5=_0x3b74bf;return db['Network'][_0x92ca('0x39')]({'where':{'type':_0x1012b5[_0x92ca('0x23')]},'raw':!![]});}return null;})[_0x92ca('0x9')](function(_0x18e4cd){if(_0x1012b5['type'][_0x92ca('0x42')]()==_0x92ca('0x43')){var _0x4b7d9a=fs[_0x92ca('0x44')](path[_0x92ca('0x45')](config[_0x92ca('0x46')],_0x92ca('0x47')),_0x92ca('0x48'));var _0x45f6fc=ejs[_0x92ca('0x49')](_0x4b7d9a,{'networks':_0x18e4cd||[]});fs[_0x92ca('0x4a')]('/etc/asterisk/stun_xcally.conf',_0x45f6fc);return respondWithRpcPromise('Reload',_0x92ca('0x19'),{'module':_0x92ca('0x4c')});}else if(_0x1012b5[_0x92ca('0x23')]['toUpperCase']()==_0x92ca('0x53')){var _0x3c07e7=fs[_0x92ca('0x44')](path['join'](config[_0x92ca('0x46')],_0x92ca('0x4d')),_0x92ca('0x48'));var _0x488891=ejs[_0x92ca('0x49')](_0x3c07e7,{'networks':_0x18e4cd||[]});fs['writeFileSync'](_0x92ca('0x4e'),_0x488891);return respondWithRpcPromise(_0x92ca('0x4b'),_0x92ca('0x19'),{'module':_0x92ca('0x4c')});}else{var _0x1dd350=fs[_0x92ca('0x44')](path['join'](config['root'],'server/files/templates/network.ejs'),_0x92ca('0x48'));var _0xa6e5e0=ejs['render'](_0x1dd350,{'networks':_0x18e4cd||[]});fs['writeFileSync'](util[_0x92ca('0x54')](_0x92ca('0x50'),_0x28e868[_0x92ca('0x41')][_0x92ca('0x23')][_0x92ca('0x51')]()),_0xa6e5e0);return respondWithRpcPromise(_0x92ca('0x4b'),_0x92ca('0x19'),{'module':_0x92ca('0x52')});}})[_0x92ca('0x9')](function(_0xf28848){if(_0xf28848){return _0x1012b5;}return null;})[_0x92ca('0x9')](respondWithResult(_0x8cdf62,null))[_0x92ca('0x3b')](handleError(_0x8cdf62,null));};exports[_0x92ca('0x1a')]=function(_0x284d8f,_0x569e9f){var _0x89c477;return db[_0x92ca('0x35')]['find']({'where':{'id':_0x284d8f['params']['id']}})[_0x92ca('0x9')](function(_0x28b1f4){_0x89c477=_0x28b1f4;return _0x28b1f4;})[_0x92ca('0x9')](handleEntityNotFound(_0x569e9f,null))[_0x92ca('0x9')](removeEntity(_0x569e9f,null))['then'](function(){if(_0x89c477){return db[_0x92ca('0x35')]['findAll']({'where':{'type':_0x89c477['type']},'raw':!![]});}})[_0x92ca('0x9')](function(_0x4495d3){if(_0x89c477[_0x92ca('0x23')][_0x92ca('0x42')]()==_0x92ca('0x43')){var _0x1dcffc=fs[_0x92ca('0x44')](path[_0x92ca('0x45')](config[_0x92ca('0x46')],'server/files/templates/stun_multiple.ejs'),_0x92ca('0x48'));var _0xb88ada=ejs[_0x92ca('0x49')](_0x1dcffc,{'networks':_0x4495d3||[]});fs[_0x92ca('0x4a')]('/etc/asterisk/stun_xcally.conf',_0xb88ada);return respondWithRpcPromise(_0x92ca('0x4b'),'destroy',{'module':_0x92ca('0x4c')});}else if(_0x89c477['type'][_0x92ca('0x42')]()==_0x92ca('0x53')){var _0x44b474=fs[_0x92ca('0x44')](path[_0x92ca('0x45')](config[_0x92ca('0x46')],_0x92ca('0x4d')),_0x92ca('0x48'));var _0x3d5b86=ejs[_0x92ca('0x49')](_0x44b474,{'networks':_0x4495d3||[]});fs['writeFileSync'](_0x92ca('0x4e'),_0x3d5b86);return respondWithRpcPromise('Reload',_0x92ca('0x1a'),{'module':_0x92ca('0x4c')});}else{var _0xabd33f=fs[_0x92ca('0x44')](path[_0x92ca('0x45')](config[_0x92ca('0x46')],_0x92ca('0x4f')),_0x92ca('0x48'));var _0x5dd060=ejs[_0x92ca('0x49')](_0xabd33f,{'networks':_0x4495d3||[]});fs[_0x92ca('0x4a')](util[_0x92ca('0x54')](_0x92ca('0x50'),_0x89c477['type']['toLowerCase']()),_0x5dd060);return respondWithRpcPromise('Reload',_0x92ca('0x1a'),{'module':_0x92ca('0x52')});}})['catch'](handleError(_0x569e9f,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 7b6ab2c..b2b876e 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 _0x85b5=['network','lodash','util','api','bluebird','rimraf','./network.attributes','exports','define'];(function(_0x324444,_0x5ca9e6){var _0x4d96c2=function(_0x11f82b){while(--_0x11f82b){_0x324444['push'](_0x324444['shift']());}};_0x4d96c2(++_0x5ca9e6);}(_0x85b5,0x7f));var _0x585b=function(_0x4b8f62,_0x2ad5f4){_0x4b8f62=_0x4b8f62-0x0;var _0x4ff246=_0x85b5[_0x4b8f62];return _0x4ff246;};'use strict';var _=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var logger=require('../../config/logger')(_0x585b('0x2'));var moment=require('moment');var BPromise=require(_0x585b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x585b('0x4'));var config=require('../../config/environment');var attributes=require(_0x585b('0x5'));module[_0x585b('0x6')]=function(_0x9ccfca,_0x5b9e48){return _0x9ccfca[_0x585b('0x7')]('Network',attributes,{'tableName':_0x585b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x131e=['request-promise','path','rimraf','./network.attributes','exports','define','api','moment','bluebird'];(function(_0x24618a,_0x2cd0f4){var _0x2e3d64=function(_0x28c59c){while(--_0x28c59c){_0x24618a['push'](_0x24618a['shift']());}};_0x2e3d64(++_0x2cd0f4);}(_0x131e,0x1ec));var _0xe131=function(_0x4736e9,_0x45ecf8){_0x4736e9=_0x4736e9-0x0;var _0x50d161=_0x131e[_0x4736e9];return _0x50d161;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe131('0x0'));var moment=require(_0xe131('0x1'));var BPromise=require(_0xe131('0x2'));var rp=require(_0xe131('0x3'));var fs=require('fs');var path=require(_0xe131('0x4'));var rimraf=require(_0xe131('0x5'));var config=require('../../config/environment');var attributes=require(_0xe131('0x6'));module[_0xe131('0x7')]=function(_0x2de969,_0x1eb0df){return _0x2de969[_0xe131('0x8')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 2874422..47509bf 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x5e8322,_0x32a73b){_0x5e8322=_0x5e8322-0x0;var _0x51856d=_0x7a54[_0x5e8322];return _0x51856d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x347da4,_0x135125){var _0x2b2e79=function(_0x3552b2){while(--_0x3552b2){_0x347da4['push'](_0x347da4['shift']());}};_0x2b2e79(++_0x135125);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index e3d44a8..8a0d872 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 _0xa071=['isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','/:id/canned_answers','addAnswer','/:id/notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','/:id/dispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0x247817,_0x273208){var _0x5b7ae7=function(_0x977541){while(--_0x977541){_0x247817['push'](_0x247817['shift']());}};_0x5b7ae7(++_0x273208);}(_0xa071,0x171));var _0x1a07=function(_0x28cae4,_0x444da3){_0x28cae4=_0x28cae4-0x0;var _0x2d8c20=_0xa071[_0x28cae4];return _0x2d8c20;};'use strict';var multer=require(_0x1a07('0x0'));var util=require(_0x1a07('0x1'));var path=require('path');var timeout=require(_0x1a07('0x2'));var express=require(_0x1a07('0x3'));var router=express[_0x1a07('0x4')]();var fs_extra=require(_0x1a07('0x5'));var auth=require(_0x1a07('0x6'));var interaction=require(_0x1a07('0x7'));var config=require(_0x1a07('0x8'));var controller=require(_0x1a07('0x9'));router[_0x1a07('0xa')]('/',auth[_0x1a07('0xb')](),controller['index']);router[_0x1a07('0xa')](_0x1a07('0xc'),auth[_0x1a07('0xb')](),controller[_0x1a07('0xd')]);router['get'](_0x1a07('0xe'),auth[_0x1a07('0xb')](),controller[_0x1a07('0xf')]);router[_0x1a07('0xa')]('/:id/dispositions',auth[_0x1a07('0xb')](),controller[_0x1a07('0x10')]);router[_0x1a07('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x1a07('0xa')](_0x1a07('0x11'),auth[_0x1a07('0xb')](),controller[_0x1a07('0x12')]);router['get'](_0x1a07('0x13'),auth[_0x1a07('0xb')](),controller[_0x1a07('0x14')]);router[_0x1a07('0xa')](_0x1a07('0x15'),auth[_0x1a07('0xb')](),controller['getAgents']);router['post']('/',auth[_0x1a07('0xb')](),controller['create']);router[_0x1a07('0x16')]('/:id/dispositions',auth[_0x1a07('0xb')](),controller['addDisposition']);router[_0x1a07('0x16')](_0x1a07('0x17'),auth[_0x1a07('0xb')](),controller[_0x1a07('0x18')]);router[_0x1a07('0x16')](_0x1a07('0x19'),controller['notify']);router[_0x1a07('0x16')](_0x1a07('0x11'),auth[_0x1a07('0xb')](),controller[_0x1a07('0x1a')]);router[_0x1a07('0x16')](_0x1a07('0x15'),auth['isAuthenticated'](),controller[_0x1a07('0x1b')]);router[_0x1a07('0x16')](_0x1a07('0x1c'),auth[_0x1a07('0xb')](),controller[_0x1a07('0x1d')]);router[_0x1a07('0x1e')](_0x1a07('0xe'),auth[_0x1a07('0xb')](),controller[_0x1a07('0x1f')]);router[_0x1a07('0x20')](_0x1a07('0xe'),auth['isAuthenticated'](),controller[_0x1a07('0x21')]);router[_0x1a07('0x20')](_0x1a07('0x22'),auth[_0x1a07('0xb')](),controller['removeDispositions']);router[_0x1a07('0x20')](_0x1a07('0x17'),auth[_0x1a07('0xb')](),controller[_0x1a07('0x23')]);router[_0x1a07('0x20')](_0x1a07('0x15'),auth[_0x1a07('0xb')](),controller[_0x1a07('0x24')]);module[_0x1a07('0x25')]=router; \ No newline at end of file +var _0xd355=['/:id/notify','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addAnswer'];(function(_0x4722ec,_0x5a706a){var _0x301f80=function(_0x4a1d49){while(--_0x4a1d49){_0x4722ec['push'](_0x4722ec['shift']());}};_0x301f80(++_0x5a706a);}(_0xd355,0x10f));var _0x5d35=function(_0x4e2198,_0x399d54){_0x4e2198=_0x4e2198-0x0;var _0x22fdd7=_0xd355[_0x4e2198];return _0x22fdd7;};'use strict';var multer=require(_0x5d35('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5d35('0x1'));var express=require(_0x5d35('0x2'));var router=express[_0x5d35('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5d35('0x4'));var interaction=require(_0x5d35('0x5'));var config=require(_0x5d35('0x6'));var controller=require(_0x5d35('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5d35('0x8')]);router[_0x5d35('0x9')](_0x5d35('0xa'),auth[_0x5d35('0xb')](),controller['describe']);router[_0x5d35('0x9')](_0x5d35('0xc'),auth['isAuthenticated'](),controller[_0x5d35('0xd')]);router[_0x5d35('0x9')](_0x5d35('0xe'),auth[_0x5d35('0xb')](),controller[_0x5d35('0xf')]);router['get'](_0x5d35('0x10'),auth[_0x5d35('0xb')](),controller['getAnswers']);router[_0x5d35('0x9')](_0x5d35('0x11'),auth['isAuthenticated'](),controller[_0x5d35('0x12')]);router[_0x5d35('0x9')](_0x5d35('0x13'),auth[_0x5d35('0xb')](),controller[_0x5d35('0x14')]);router[_0x5d35('0x9')](_0x5d35('0x15'),auth[_0x5d35('0xb')](),controller[_0x5d35('0x16')]);router[_0x5d35('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5d35('0x17')](_0x5d35('0xe'),auth[_0x5d35('0xb')](),controller['addDisposition']);router[_0x5d35('0x17')](_0x5d35('0x10'),auth['isAuthenticated'](),controller[_0x5d35('0x18')]);router['post'](_0x5d35('0x19'),controller[_0x5d35('0x1a')]);router[_0x5d35('0x17')](_0x5d35('0x11'),auth[_0x5d35('0xb')](),controller[_0x5d35('0x1b')]);router['post'](_0x5d35('0x15'),auth[_0x5d35('0xb')](),controller['addAgents']);router['post'](_0x5d35('0x1c'),auth['isAuthenticated'](),controller[_0x5d35('0x1d')]);router[_0x5d35('0x1e')]('/:id',auth[_0x5d35('0xb')](),controller[_0x5d35('0x1f')]);router[_0x5d35('0x20')](_0x5d35('0xc'),auth[_0x5d35('0xb')](),controller[_0x5d35('0x21')]);router[_0x5d35('0x20')](_0x5d35('0xe'),auth['isAuthenticated'](),controller[_0x5d35('0x22')]);router[_0x5d35('0x20')]('/:id/canned_answers',auth[_0x5d35('0xb')](),controller['removeAnswers']);router['delete'](_0x5d35('0x15'),auth[_0x5d35('0xb')](),controller[_0x5d35('0x23')]);module[_0x5d35('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index bc9f18c..b96a6da 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 _0x2cf2=['STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x3aa630,_0x206526){var _0x693e15=function(_0x480a89){while(--_0x480a89){_0x3aa630['push'](_0x3aa630['shift']());}};_0x693e15(++_0x206526);}(_0x2cf2,0x1c5));var _0x22cf=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2cf2[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x22cf('0x0'));var rs=require(_0x22cf('0x1'));module['exports']={'name':{'type':Sequelize[_0x22cf('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x22cf('0x2')]},'token':{'type':Sequelize[_0x22cf('0x2')],'defaultValue':function(){return rs[_0x22cf('0x3')]();}},'replyUri':{'type':Sequelize[_0x22cf('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x22cf('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x22cf('0x4')],'defaultValue':function(){return _0x22cf('0x5');}},'notificationSound':{'type':Sequelize[_0x22cf('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x22cf('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x22cf('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x22cf('0x2')]},'queueTransfer':{'type':Sequelize[_0x22cf('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x22cf('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x22cf('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x22cf('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x22cf('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x22cf('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x22cf('0x6')],'defaultValue':![],'comment':_0x22cf('0x9'),'set':function(_0xe3dcd0){if(!_0xe3dcd0)this[_0x22cf('0xa')](_0x22cf('0xb'),null);this[_0x22cf('0xa')](_0x22cf('0xc'),_0xe3dcd0);}}}; \ No newline at end of file +var _0xf699=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate'];(function(_0x23d2a0,_0x516174){var _0x409e80=function(_0x432940){while(--_0x432940){_0x23d2a0['push'](_0x23d2a0['shift']());}};_0x409e80(++_0x516174);}(_0xf699,0x6b));var _0x9f69=function(_0x1d9e36,_0x1064b6){_0x1d9e36=_0x1d9e36-0x0;var _0x14bb48=_0xf699[_0x1d9e36];return _0x14bb48;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9f69('0x0'));module[_0x9f69('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9f69('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9f69('0x3')]},'token':{'type':Sequelize[_0x9f69('0x3')],'defaultValue':function(){return rs[_0x9f69('0x4')]();}},'replyUri':{'type':Sequelize[_0x9f69('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9f69('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9f69('0x5')],'defaultValue':function(){return _0x9f69('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f69('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9f69('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9f69('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f69('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f69('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9f69('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x9f69('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x9f69('0x7')],'defaultValue':![],'comment':_0x9f69('0xa'),'set':function(_0x4f5fe2){if(!_0x4f5fe2)this[_0x9f69('0xb')](_0x9f69('0xc'),null);this[_0x9f69('0xb')](_0x9f69('0xd'),_0x4f5fe2);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 68ecddc..5d2bb42 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 _0x8aef=['omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','defaults','out','Messages','dataValues','push','eml-format','zip-dir','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','Disposition','getDispositions','findOne','order','options','includeAll','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','OpenchannelApplication','Applications','List','account','applications','priority','asc','Contacts','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','messageId','created','interaction','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','send','getApplications','Contact','fullname','internal','Tag','Tags','tag','addAgents'];(function(_0x30d520,_0x24314c){var _0x5409ab=function(_0x283646){while(--_0x283646){_0x30d520['push'](_0x30d520['shift']());}};_0x5409ab(++_0x24314c);}(_0x8aef,0x189));var _0xf8ae=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8aef[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xf8ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf8ae('0x2'));var Mustache=require(_0xf8ae('0x3'));var util=require(_0xf8ae('0x4'));var path=require(_0xf8ae('0x5'));var sox=require(_0xf8ae('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8ae('0x7'));var _=require(_0xf8ae('0x8'));var squel=require('squel');var crypto=require(_0xf8ae('0x9'));var jsforce=require(_0xf8ae('0xa'));var deskjs=require(_0xf8ae('0xb'));var toCsv=require(_0xf8ae('0xc'));var querystring=require('querystring');var Papa=require(_0xf8ae('0xd'));var Redis=require(_0xf8ae('0xe'));var authService=require(_0xf8ae('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8ae('0x10'))(_0xf8ae('0x11'));var utils=require(_0xf8ae('0x12'));var config=require(_0xf8ae('0x13'));var licenseUtil=require(_0xf8ae('0x14'));var db=require(_0xf8ae('0x15'))['db'];config[_0xf8ae('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf8ae('0x17'))(new Redis(config[_0xf8ae('0x16')]));require('./openchannelAccount.socket')[_0xf8ae('0x18')](socket);var jayson=require(_0xf8ae('0x19'));var client=jayson[_0xf8ae('0x1a')][_0xf8ae('0x1b')]({'port':0x232c});var client9002=jayson[_0xf8ae('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4db56b,_0x1f1b3c,_0x32beb5,_0x52dc7f){return new BPromise(function(_0x6bb428,_0x44bd6f){var _0x8b15f2=_0x52dc7f||client;return _0x8b15f2[_0xf8ae('0x1c')](_0x4db56b,_0x32beb5)['then'](function(_0x323678){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1f1b3c,'request\x20sent');logger[_0xf8ae('0x1d')](_0xf8ae('0x1e'),_0x1f1b3c,_0xf8ae('0x1f'),JSON[_0xf8ae('0x20')](_0x323678));if(_0x323678[_0xf8ae('0x21')]){if(_0x323678[_0xf8ae('0x21')][_0xf8ae('0x22')]===0x1f4){logger[_0xf8ae('0x21')](_0xf8ae('0x23'),_0x1f1b3c,_0x323678[_0xf8ae('0x21')]['message']);return _0x44bd6f(_0x323678[_0xf8ae('0x21')][_0xf8ae('0x24')]);}logger[_0xf8ae('0x21')](_0xf8ae('0x23'),_0x1f1b3c,_0x323678[_0xf8ae('0x21')][_0xf8ae('0x24')]);return _0x6bb428(_0x323678['error'][_0xf8ae('0x24')]);}else{logger[_0xf8ae('0x25')](_0xf8ae('0x23'),_0x1f1b3c,'request\x20sent');_0x6bb428(_0x323678[_0xf8ae('0x26')][_0xf8ae('0x24')]);}})[_0xf8ae('0x27')](function(_0x3fd4e4){logger['error'](_0xf8ae('0x23'),_0x1f1b3c,_0x3fd4e4);_0x44bd6f(_0x3fd4e4);});});}function respondWithStatusCode(_0x190e11,_0x46f702){_0x46f702=_0x46f702||0xcc;return function(_0x18c686){if(_0x18c686){return _0x190e11[_0xf8ae('0x28')](_0x46f702);}return _0x190e11[_0xf8ae('0x29')](_0x46f702)[_0xf8ae('0x2a')]();};}function respondWithResult(_0x505148,_0x292aae){_0x292aae=_0x292aae||0xc8;return function(_0x4aaf5e){if(_0x4aaf5e){return _0x505148['status'](_0x292aae)[_0xf8ae('0x2b')](_0x4aaf5e);}};}function respondWithFilteredResult(_0x502b6a,_0x52fce4){return function(_0x25169d){if(_0x25169d){var _0x593af6=typeof _0x52fce4[_0xf8ae('0x2c')]===_0xf8ae('0x2d')&&typeof _0x52fce4[_0xf8ae('0x2e')]==='undefined';var _0x54e09a=_0x25169d[_0xf8ae('0x2f')];var _0x450559=_0x593af6?0x0:_0x52fce4['offset'];var _0x190a5d=_0x593af6?_0x25169d['count']:_0x52fce4[_0xf8ae('0x2c')]+_0x52fce4[_0xf8ae('0x2e')];var _0x54827d;if(_0x190a5d>=_0x54e09a){_0x190a5d=_0x54e09a;_0x54827d=0xc8;}else{_0x54827d=0xce;}_0x502b6a[_0xf8ae('0x29')](_0x54827d);return _0x502b6a['set'](_0xf8ae('0x30'),_0x450559+'-'+_0x190a5d+'/'+_0x54e09a)[_0xf8ae('0x2b')](_0x25169d);}return null;};}function patchUpdates(_0x8c6a1){return function(_0x1030a1){try{jsonpatch[_0xf8ae('0x31')](_0x1030a1,_0x8c6a1,!![]);}catch(_0x4fad2e){return BPromise['reject'](_0x4fad2e);}return _0x1030a1[_0xf8ae('0x32')]();};}function saveUpdates(_0x404fad,_0x1c2c2e){return function(_0x144e93){if(_0x144e93){return _0x144e93[_0xf8ae('0x33')](_0x404fad)[_0xf8ae('0x34')](function(_0x2b7455){return _0x2b7455;});}return null;};}function removeEntity(_0x593ae0,_0x104f8f){return function(_0x1e348d){if(_0x1e348d){return _0x1e348d[_0xf8ae('0x35')]()[_0xf8ae('0x34')](function(){var _0x20b060=_0x1e348d['get']({'plain':!![]});var _0xe286f=_0xf8ae('0x36');return db[_0xf8ae('0x37')]['destroy']({'where':{'type':_0xe286f,'resourceId':_0x20b060['id']}})[_0xf8ae('0x34')](function(){return _0x1e348d;});})[_0xf8ae('0x34')](function(){_0x593ae0[_0xf8ae('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52aa0a,_0x177d9b){return function(_0x403a77){if(!_0x403a77){_0x52aa0a[_0xf8ae('0x28')](0x194);}return _0x403a77;};}function handleError(_0x4ee64b,_0xb5508f){_0xb5508f=_0xb5508f||0x1f4;return function(_0x3fef7d){logger['error'](_0x3fef7d[_0xf8ae('0x38')]);if(_0x3fef7d['name']){delete _0x3fef7d[_0xf8ae('0x39')];}_0x4ee64b[_0xf8ae('0x29')](_0xb5508f)['send'](_0x3fef7d);};}exports[_0xf8ae('0x3a')]=function(_0x499eed,_0x1714e4){var _0x7b9f10={'include':[{'model':db[_0xf8ae('0x3b')],'as':_0xf8ae('0x3c')}]},_0x426f3a={},_0x4f94d6={'count':0x0,'rows':[]};var _0x3e9d58=_[_0xf8ae('0x3d')](db[_0xf8ae('0x3e')][_0xf8ae('0x3f')],function(_0x317148){return{'name':_0x317148[_0xf8ae('0x40')],'type':_0x317148[_0xf8ae('0x41')][_0xf8ae('0x42')]};});_0x426f3a[_0xf8ae('0x43')]=_[_0xf8ae('0x3d')](_0x3e9d58,_0xf8ae('0x39'));_0x426f3a[_0xf8ae('0x44')]=_['keys'](_0x499eed[_0xf8ae('0x44')]);_0x426f3a[_0xf8ae('0x45')]=_[_0xf8ae('0x46')](_0x426f3a[_0xf8ae('0x43')],_0x426f3a['query']);_0x7b9f10[_0xf8ae('0x47')]=_[_0xf8ae('0x46')](_0x426f3a[_0xf8ae('0x43')],qs[_0xf8ae('0x48')](_0x499eed['query']['fields']));_0x7b9f10[_0xf8ae('0x47')]=_0x7b9f10[_0xf8ae('0x47')][_0xf8ae('0x49')]?_0x7b9f10[_0xf8ae('0x47')]:_0x426f3a[_0xf8ae('0x43')];if(!_0x499eed['query'][_0xf8ae('0x4a')](_0xf8ae('0x4b'))){_0x7b9f10[_0xf8ae('0x2e')]=qs['limit'](_0x499eed[_0xf8ae('0x44')][_0xf8ae('0x2e')]);_0x7b9f10[_0xf8ae('0x2c')]=qs[_0xf8ae('0x2c')](_0x499eed[_0xf8ae('0x44')][_0xf8ae('0x2c')]);}_0x7b9f10['order']=qs[_0xf8ae('0x4c')](_0x499eed[_0xf8ae('0x44')][_0xf8ae('0x4c')]);_0x7b9f10[_0xf8ae('0x4d')]=qs[_0xf8ae('0x45')](_[_0xf8ae('0x4e')](_0x499eed[_0xf8ae('0x44')],_0x426f3a['filters']),_0x3e9d58);if(_0x499eed[_0xf8ae('0x44')][_0xf8ae('0x4f')]){_0x7b9f10[_0xf8ae('0x4d')]=_[_0xf8ae('0x50')](_0x7b9f10['where'],{'$or':_['map'](_0x3e9d58,function(_0x5715e4){if(_0x5715e4['type']!==_0xf8ae('0x51')){var _0x2adfd3={};_0x2adfd3[_0x5715e4[_0xf8ae('0x39')]]={'$like':'%'+_0x499eed[_0xf8ae('0x44')]['filter']+'%'};return _0x2adfd3;}})});}_0x7b9f10=_['merge']({},_0x7b9f10,_0x499eed['options']);var _0x7b4656={'where':_0x7b9f10[_0xf8ae('0x4d')]};return db['OpenchannelAccount'][_0xf8ae('0x2f')](_0x7b4656)[_0xf8ae('0x34')](function(_0x26585f){_0x4f94d6[_0xf8ae('0x2f')]=_0x26585f;if(_0x499eed[_0xf8ae('0x44')]['includeAll']){_0x7b9f10[_0xf8ae('0x52')]=[{'all':!![]}];}return db[_0xf8ae('0x3e')][_0xf8ae('0x53')](_0x7b9f10);})[_0xf8ae('0x34')](function(_0x3a9f6e){_0x4f94d6[_0xf8ae('0x54')]=_0x3a9f6e;return _0x4f94d6;})[_0xf8ae('0x34')](respondWithFilteredResult(_0x1714e4,_0x7b9f10))[_0xf8ae('0x27')](handleError(_0x1714e4,null));};exports[_0xf8ae('0x55')]=function(_0x4c00c6,_0x26bd7a){var _0x365875={'raw':![],'where':{'id':_0x4c00c6['params']['id']},'include':[{'model':db[_0xf8ae('0x3b')],'as':'mandatoryDispositionPause'}]},_0xa4c90d={};_0xa4c90d[_0xf8ae('0x43')]=_[_0xf8ae('0x56')](db[_0xf8ae('0x3e')][_0xf8ae('0x3f')]);_0xa4c90d[_0xf8ae('0x44')]=_['keys'](_0x4c00c6[_0xf8ae('0x44')]);_0xa4c90d['filters']=_[_0xf8ae('0x46')](_0xa4c90d[_0xf8ae('0x43')],_0xa4c90d['query']);_0x365875[_0xf8ae('0x47')]=_[_0xf8ae('0x46')](_0xa4c90d['model'],qs[_0xf8ae('0x48')](_0x4c00c6[_0xf8ae('0x44')][_0xf8ae('0x48')]));_0x365875[_0xf8ae('0x47')]=_0x365875[_0xf8ae('0x47')]['length']?_0x365875[_0xf8ae('0x47')]:_0xa4c90d[_0xf8ae('0x43')];if(_0x4c00c6[_0xf8ae('0x44')]['includeAll']){_0x365875['include']=[{'all':!![]}];}_0x365875=_['merge']({},_0x365875,_0x4c00c6['options']);return db[_0xf8ae('0x3e')][_0xf8ae('0x57')](_0x365875)[_0xf8ae('0x34')](handleEntityNotFound(_0x26bd7a,null))[_0xf8ae('0x34')](respondWithResult(_0x26bd7a,null))[_0xf8ae('0x27')](handleError(_0x26bd7a,null));};exports[_0xf8ae('0x58')]=function(_0x344c6b,_0x4aeb23){return db[_0xf8ae('0x3e')]['create'](_0x344c6b[_0xf8ae('0x59')],{})[_0xf8ae('0x34')](function(_0x68ac06){var _0x443ea7=_0x344c6b[_0xf8ae('0x5a')]['get']({'plain':!![]});if(!_0x443ea7)throw new Error(_0xf8ae('0x5b'));if(_0x443ea7[_0xf8ae('0x5c')]==='user'){var _0x238a65=_0x68ac06[_0xf8ae('0x5d')]({'plain':!![]});var _0xdd384=_0xf8ae('0x36');return db[_0xf8ae('0x5e')][_0xf8ae('0x57')]({'where':{'name':_0xdd384,'userProfileId':_0x443ea7[_0xf8ae('0x5f')]},'raw':!![]})[_0xf8ae('0x34')](function(_0xd33aa6){if(_0xd33aa6&&_0xd33aa6[_0xf8ae('0x60')]===0x0){return db[_0xf8ae('0x37')][_0xf8ae('0x58')]({'name':_0x238a65[_0xf8ae('0x39')],'resourceId':_0x238a65['id'],'type':_0xd33aa6[_0xf8ae('0x39')],'sectionId':_0xd33aa6['id']},{})[_0xf8ae('0x34')](function(){return _0x68ac06;});}else{return _0x68ac06;}})[_0xf8ae('0x27')](function(_0x5527a1){logger['error'](_0xf8ae('0x61'),_0x5527a1);throw _0x5527a1;});}return _0x68ac06;})[_0xf8ae('0x34')](respondWithResult(_0x4aeb23,0xc9))[_0xf8ae('0x27')](handleError(_0x4aeb23,null));};exports[_0xf8ae('0x33')]=function(_0x1ce34c,_0x4b8af5){if(_0x1ce34c[_0xf8ae('0x59')]['id']){delete _0x1ce34c[_0xf8ae('0x59')]['id'];}return db['OpenchannelAccount'][_0xf8ae('0x57')]({'where':{'id':_0x1ce34c['params']['id']},'include':[{'model':db[_0xf8ae('0x3b')],'as':_0xf8ae('0x3c')}]})[_0xf8ae('0x34')](handleEntityNotFound(_0x4b8af5,null))[_0xf8ae('0x34')](saveUpdates(_0x1ce34c[_0xf8ae('0x59')],null))[_0xf8ae('0x34')](respondWithResult(_0x4b8af5,null))['catch'](handleError(_0x4b8af5,null));};exports[_0xf8ae('0x35')]=function(_0x5c1fa3,_0x3335e0){return db[_0xf8ae('0x3e')][_0xf8ae('0x57')]({'where':{'id':_0x5c1fa3[_0xf8ae('0x62')]['id']}})['then'](handleEntityNotFound(_0x3335e0,null))['then'](removeEntity(_0x3335e0,null))[_0xf8ae('0x27')](handleError(_0x3335e0,null));};exports[_0xf8ae('0x63')]=function(_0x1af55b,_0x3afe6c){return db[_0xf8ae('0x3e')][_0xf8ae('0x63')]()[_0xf8ae('0x34')](respondWithResult(_0x3afe6c,null))[_0xf8ae('0x27')](handleError(_0x3afe6c,null));};exports['addDisposition']=function(_0x1cc444,_0x24bb68,_0x374d50){if(_0x1cc444[_0xf8ae('0x59')]['id']){delete _0x1cc444[_0xf8ae('0x59')]['id'];}return db[_0xf8ae('0x3e')][_0xf8ae('0x57')]({'where':{'id':_0x1cc444['params']['id']}})[_0xf8ae('0x34')](handleEntityNotFound(_0x24bb68,null))[_0xf8ae('0x34')](function(_0x3a980b){if(_0x3a980b){_0x1cc444['body']['OpenchannelAccountId']=_0x3a980b['id'];return db[_0xf8ae('0x64')][_0xf8ae('0x58')](_0x1cc444[_0xf8ae('0x59')]);}})['then'](respondWithResult(_0x24bb68,null))['catch'](handleError(_0x24bb68,null));};exports[_0xf8ae('0x65')]=function(_0x587274,_0x334da4,_0x3d8f9d){var _0x1477a7={'raw':![],'where':{}};var _0x198a4f={};var _0x132902={'count':0x0,'rows':[]};return db[_0xf8ae('0x3e')][_0xf8ae('0x66')]({'where':{'id':_0x587274[_0xf8ae('0x62')]['id']}})[_0xf8ae('0x34')](handleEntityNotFound(_0x334da4,null))[_0xf8ae('0x34')](function(_0xeecada){if(_0xeecada){_0x198a4f['model']=_[_0xf8ae('0x56')](db[_0xf8ae('0x64')][_0xf8ae('0x3f')]);_0x198a4f[_0xf8ae('0x44')]=_[_0xf8ae('0x56')](_0x587274[_0xf8ae('0x44')]);_0x198a4f[_0xf8ae('0x45')]=_[_0xf8ae('0x46')](_0x198a4f[_0xf8ae('0x43')],_0x198a4f['query']);_0x1477a7[_0xf8ae('0x47')]=_['intersection'](_0x198a4f[_0xf8ae('0x43')],qs[_0xf8ae('0x48')](_0x587274['query'][_0xf8ae('0x48')]));_0x1477a7['attributes']=_0x1477a7['attributes'][_0xf8ae('0x49')]?_0x1477a7[_0xf8ae('0x47')]:_0x198a4f[_0xf8ae('0x43')];if(!_0x587274[_0xf8ae('0x44')]['hasOwnProperty'](_0xf8ae('0x4b'))){_0x1477a7['limit']=qs[_0xf8ae('0x2e')](_0x587274[_0xf8ae('0x44')]['limit']);_0x1477a7['offset']=qs[_0xf8ae('0x2c')](_0x587274[_0xf8ae('0x44')][_0xf8ae('0x2c')]);}_0x1477a7[_0xf8ae('0x67')]=qs[_0xf8ae('0x4c')](_0x587274[_0xf8ae('0x44')][_0xf8ae('0x4c')]);_0x1477a7[_0xf8ae('0x4d')]=qs[_0xf8ae('0x45')](_['pick'](_0x587274['query'],_0x198a4f[_0xf8ae('0x45')]));_0x1477a7[_0xf8ae('0x4d')]['OpenchannelAccountId']=_0xeecada['id'];if(_0x587274[_0xf8ae('0x44')]['filter']){_0x1477a7[_0xf8ae('0x4d')]=_[_0xf8ae('0x50')](_0x1477a7[_0xf8ae('0x4d')],{'$or':_['map'](_0x1477a7[_0xf8ae('0x47')],function(_0x482923){var _0x894a36={};_0x894a36[_0x482923]={'$like':'%'+_0x587274['query'][_0xf8ae('0x4f')]+'%'};return _0x894a36;})});}_0x1477a7=_[_0xf8ae('0x50')]({},_0x1477a7,_0x587274[_0xf8ae('0x68')]);return db[_0xf8ae('0x64')][_0xf8ae('0x2f')]({'where':_0x1477a7[_0xf8ae('0x4d')]})['then'](function(_0x26b3bf){_0x132902[_0xf8ae('0x2f')]=_0x26b3bf;if(_0x587274[_0xf8ae('0x44')][_0xf8ae('0x69')]){_0x1477a7[_0xf8ae('0x52')]=[{'all':!![]}];}return db[_0xf8ae('0x64')][_0xf8ae('0x53')](_0x1477a7);})[_0xf8ae('0x34')](function(_0x471b37){_0x132902['rows']=_0x471b37;return _0x132902;});}})['then'](respondWithFilteredResult(_0x334da4,_0x1477a7))[_0xf8ae('0x27')](handleError(_0x334da4,null));};exports[_0xf8ae('0x6a')]=function(_0x1a2252,_0x1ff2dc,_0x5b4799){return db['OpenchannelAccount'][_0xf8ae('0x57')]({'where':{'id':_0x1a2252['params']['id']}})[_0xf8ae('0x34')](handleEntityNotFound(_0x1ff2dc,null))[_0xf8ae('0x34')](function(_0x2db91a){if(_0x2db91a){return _0x2db91a[_0xf8ae('0x6a')](_0x1a2252['query'][_0xf8ae('0x6b')]);}})[_0xf8ae('0x34')](respondWithStatusCode(_0x1ff2dc,null))[_0xf8ae('0x27')](handleError(_0x1ff2dc,null));};exports[_0xf8ae('0x6c')]=function(_0x53e58b,_0x5cf0fb,_0x56c0d5){if(_0x53e58b[_0xf8ae('0x59')]['id']){delete _0x53e58b[_0xf8ae('0x59')]['id'];}return db[_0xf8ae('0x3e')][_0xf8ae('0x57')]({'where':{'id':_0x53e58b[_0xf8ae('0x62')]['id']}})['then'](handleEntityNotFound(_0x5cf0fb,null))['then'](function(_0x3a112e){if(_0x3a112e){_0x53e58b['body'][_0xf8ae('0x6d')]=_0x3a112e['id'];return db[_0xf8ae('0x6e')][_0xf8ae('0x58')](_0x53e58b[_0xf8ae('0x59')]);}})[_0xf8ae('0x34')](respondWithResult(_0x5cf0fb,null))[_0xf8ae('0x27')](handleError(_0x5cf0fb,null));};exports['getAnswers']=function(_0x1c8a17,_0x1c1a01,_0x1eecb2){var _0x5ccddb={'raw':![],'where':{}};var _0x2c4ddb={};var _0x5f560f={'count':0x0,'rows':[]};return db[_0xf8ae('0x3e')][_0xf8ae('0x66')]({'where':{'id':_0x1c8a17[_0xf8ae('0x62')]['id']}})['then'](handleEntityNotFound(_0x1c1a01,null))[_0xf8ae('0x34')](function(_0x2ac240){if(_0x2ac240){_0x2c4ddb[_0xf8ae('0x43')]=_[_0xf8ae('0x56')](db[_0xf8ae('0x6e')]['rawAttributes']);_0x2c4ddb[_0xf8ae('0x44')]=_[_0xf8ae('0x56')](_0x1c8a17[_0xf8ae('0x44')]);_0x2c4ddb[_0xf8ae('0x45')]=_[_0xf8ae('0x46')](_0x2c4ddb[_0xf8ae('0x43')],_0x2c4ddb[_0xf8ae('0x44')]);_0x5ccddb[_0xf8ae('0x47')]=_[_0xf8ae('0x46')](_0x2c4ddb[_0xf8ae('0x43')],qs['fields'](_0x1c8a17['query'][_0xf8ae('0x48')]));_0x5ccddb['attributes']=_0x5ccddb[_0xf8ae('0x47')][_0xf8ae('0x49')]?_0x5ccddb[_0xf8ae('0x47')]:_0x2c4ddb[_0xf8ae('0x43')];if(!_0x1c8a17[_0xf8ae('0x44')][_0xf8ae('0x4a')](_0xf8ae('0x4b'))){_0x5ccddb[_0xf8ae('0x2e')]=qs[_0xf8ae('0x2e')](_0x1c8a17[_0xf8ae('0x44')][_0xf8ae('0x2e')]);_0x5ccddb[_0xf8ae('0x2c')]=qs[_0xf8ae('0x2c')](_0x1c8a17['query'][_0xf8ae('0x2c')]);}_0x5ccddb['order']=qs['sort'](_0x1c8a17['query'][_0xf8ae('0x4c')]);_0x5ccddb[_0xf8ae('0x4d')]=qs[_0xf8ae('0x45')](_[_0xf8ae('0x4e')](_0x1c8a17[_0xf8ae('0x44')],_0x2c4ddb[_0xf8ae('0x45')]));_0x5ccddb[_0xf8ae('0x4d')][_0xf8ae('0x6d')]=_0x2ac240['id'];if(_0x1c8a17[_0xf8ae('0x44')][_0xf8ae('0x4f')]){_0x5ccddb[_0xf8ae('0x4d')]=_[_0xf8ae('0x50')](_0x5ccddb[_0xf8ae('0x4d')],{'$or':_['map'](_0x5ccddb[_0xf8ae('0x47')],function(_0x5ec23b){var _0x31549c={};_0x31549c[_0x5ec23b]={'$like':'%'+_0x1c8a17[_0xf8ae('0x44')][_0xf8ae('0x4f')]+'%'};return _0x31549c;})});}_0x5ccddb=_['merge']({},_0x5ccddb,_0x1c8a17[_0xf8ae('0x68')]);return db[_0xf8ae('0x6e')][_0xf8ae('0x2f')]({'where':_0x5ccddb[_0xf8ae('0x4d')]})[_0xf8ae('0x34')](function(_0x22a4cd){_0x5f560f[_0xf8ae('0x2f')]=_0x22a4cd;if(_0x1c8a17[_0xf8ae('0x44')][_0xf8ae('0x69')]){_0x5ccddb[_0xf8ae('0x52')]=[{'all':!![]}];}return db[_0xf8ae('0x6e')]['findAll'](_0x5ccddb);})[_0xf8ae('0x34')](function(_0x2bb563){_0x5f560f[_0xf8ae('0x54')]=_0x2bb563;return _0x5f560f;});}})[_0xf8ae('0x34')](respondWithFilteredResult(_0x1c1a01,_0x5ccddb))['catch'](handleError(_0x1c1a01,null));};exports[_0xf8ae('0x6f')]=function(_0x2c271e,_0x10ae10,_0x415025){return db['OpenchannelAccount'][_0xf8ae('0x57')]({'where':{'id':_0x2c271e[_0xf8ae('0x62')]['id']}})['then'](handleEntityNotFound(_0x10ae10,null))[_0xf8ae('0x34')](function(_0x59683f){if(_0x59683f){return _0x59683f[_0xf8ae('0x6f')](_0x2c271e[_0xf8ae('0x44')][_0xf8ae('0x6b')]);}})[_0xf8ae('0x34')](respondWithStatusCode(_0x10ae10,null))[_0xf8ae('0x27')](handleError(_0x10ae10,null));};exports[_0xf8ae('0x70')]=function(_0x5aaf7f,_0x47631d,_0xd4a82b){var _0x26d5ad={'body':_0x5aaf7f['body'],'channel':_0xf8ae('0x71')};var _0xdb0b39=[];var _0x321c79=[];var _0x2d729e={};var _0x1574f0=![];return db[_0xf8ae('0x72')][_0xf8ae('0x63')]()['then'](function(_0x23ae56){if(!_0x23ae56){throw new db['Sequelize'][(_0xf8ae('0x73'))](_0xf8ae('0x74'));}_0xdb0b39=_[_0xf8ae('0x75')](_['keys'](_0x23ae56),['createdAt',_0xf8ae('0x76')]);_0x321c79=_[_0xf8ae('0x75')](_[_0xf8ae('0x56')](_0x23ae56),[_0xf8ae('0x77'),'updatedAt','CompanyId',_0xf8ae('0x78')]);if(_0x5aaf7f[_0xf8ae('0x59')]['id']){delete _0x5aaf7f[_0xf8ae('0x59')]['id'];}if(_[_0xf8ae('0x79')](_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x7a')])){throw new db[(_0xf8ae('0x7b'))][(_0xf8ae('0x73'))](_0xf8ae('0x7c'));}if(_['isNil'](_0x5aaf7f['body']['body'])||_0x5aaf7f[_0xf8ae('0x59')]['body']===''){throw new db[(_0xf8ae('0x7b'))][(_0xf8ae('0x73'))](_0xf8ae('0x7d'));}if(_[_0xf8ae('0x79')](_0x5aaf7f['body'][_0xf8ae('0x7e')])){throw new db[(_0xf8ae('0x7b'))]['ValidationError'](_0xf8ae('0x7f')+_0x321c79);}if(!_['includes'](_0x321c79,_0x5aaf7f[_0xf8ae('0x59')]['mapKey'])){throw new db[(_0xf8ae('0x7b'))][(_0xf8ae('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x321c79);}_0x2d729e[_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x7e')]]=_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x7a')];})[_0xf8ae('0x34')](function(){return db[_0xf8ae('0x3e')][_0xf8ae('0x57')]({'where':{'id':_0x5aaf7f['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xf8ae('0x72')],'as':'Contacts','where':_0x2d729e,'limit':0x1,'order':[[_0xf8ae('0x76'),_0xf8ae('0x80')]]}]},{'model':db[_0xf8ae('0x81')],'as':_0xf8ae('0x82')}]});})[_0xf8ae('0x34')](handleEntityNotFound(_0x47631d,null))['then'](function(_0x12784e){if(_0x12784e&&_0x12784e[_0xf8ae('0x83')]){_0x26d5ad[_0xf8ae('0x84')]=_0x12784e;_0x26d5ad[_0xf8ae('0x85')]=_0x12784e[_0xf8ae('0x82')];_0x26d5ad['list']=_0x12784e[_0xf8ae('0x83')];_0x26d5ad[_0xf8ae('0x85')]=_['orderBy'](_0x26d5ad['applications'],[_0xf8ae('0x86')],[_0xf8ae('0x87')]);if(_0x26d5ad[_0xf8ae('0x84')][_0xf8ae('0x82')]){delete _0x26d5ad[_0xf8ae('0x84')][_0xf8ae('0x82')];}if(_0x26d5ad[_0xf8ae('0x84')][_0xf8ae('0x83')]&&_0x26d5ad[_0xf8ae('0x84')][_0xf8ae('0x83')][_0xf8ae('0x88')][_0xf8ae('0x49')]){return _0x26d5ad[_0xf8ae('0x84')][_0xf8ae('0x83')][_0xf8ae('0x88')][0x0];}var _0x274e1e=_['defaults'](_0x5aaf7f[_0xf8ae('0x59')],{'firstName':_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x7a')],'ListId':_0x12784e[_0xf8ae('0x78')]});_0x274e1e[_0x5aaf7f['body'][_0xf8ae('0x7e')]]=_0x5aaf7f['body'][_0xf8ae('0x7a')];return db[_0xf8ae('0x72')][_0xf8ae('0x58')](_0x274e1e,{'fields':_0xdb0b39,'raw':!![]});}})['then'](handleEntityNotFound(_0x47631d,null))['then'](function(_0x5105e2){_0x26d5ad[_0xf8ae('0x89')]=_0x5105e2;if(_0x5105e2){var _0x190cf4={'ContactId':_0x5105e2['id'],'OpenchannelAccountId':_0x5aaf7f[_0xf8ae('0x62')]['id'],'from':(_0x5105e2['firstName']||'')+'\x20'+(_0x5105e2[_0xf8ae('0x8a')]||'')};var _0x40750b={'OpenchannelAccountId':_0x5aaf7f['params']['id'],'closed':![]};if(_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x8b')]){_0x40750b[_0xf8ae('0x8b')]=_0x5aaf7f['body']['threadId'];return db['OpenchannelInteraction'][_0xf8ae('0x57')]({'where':_0x40750b})[_0xf8ae('0x34')](function(_0x20a200){if(_0x20a200){return[_0x20a200,![]];}_0x190cf4[_0xf8ae('0x8b')]=_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x8b')];_0x190cf4[_0xf8ae('0x8c')]=_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x8c')];return db[_0xf8ae('0x8d')][_0xf8ae('0x58')](_0x190cf4)['then'](function(_0x4e1a1b){return[_0x4e1a1b,!![]];});});}else{_0x40750b[_0xf8ae('0x8b')]=null;}_0x40750b[_0xf8ae('0x8e')]=_0x5105e2['id'];return db['OpenchannelInteraction'][_0xf8ae('0x57')]({'where':_0x40750b})[_0xf8ae('0x34')](function(_0x2088f2){if(_0x2088f2){return[_0x2088f2,![]];}return db[_0xf8ae('0x8d')][_0xf8ae('0x58')](_0x190cf4)[_0xf8ae('0x34')](function(_0x1c6d3b){return[_0x1c6d3b,!![]];});});}})[_0xf8ae('0x8f')](function(_0x41a043,_0x39da35){if(_0x41a043){_0x1574f0=_0x39da35;if(!_0x39da35){var _0x1c2664={'from':(_0x26d5ad['contact'][_0xf8ae('0x90')]||'')+'\x20'+(_0x26d5ad[_0xf8ae('0x89')][_0xf8ae('0x8a')]||'')};if(_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x8b')]&&_0x5aaf7f[_0xf8ae('0x59')]['messageId']&&_0x5aaf7f['body']['threadId']!=_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x91')]){_0x1c2664['threadId']=_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x91')];}return _0x41a043['update'](_0x1c2664);}else{return _0x41a043;}}})['then'](function(_0x3c9f43){_0x26d5ad['interaction']=_0x3c9f43[_0xf8ae('0x5d')]({'plain':!![]});_0x26d5ad['interaction'][_0xf8ae('0x92')]=_0x1574f0;if(_0x26d5ad[_0xf8ae('0x93')][_0xf8ae('0x92')]){if(_0x26d5ad[_0xf8ae('0x84')][_0xf8ae('0x94')]){_0x26d5ad[_0xf8ae('0x85')]['push']({'id':0x0,'priority':_0x26d5ad[_0xf8ae('0x85')][_0xf8ae('0x49')]+0x1,'app':_0xf8ae('0x95'),'appdata':'unmanaged','interval':_0xf8ae('0x96')});}}return db[_0xf8ae('0x97')]['create']({'body':_0x5aaf7f['body'][_0xf8ae('0x59')],'OpenchannelAccountId':_0x5aaf7f['params']['id'],'OpenchannelInteractionId':_0x3c9f43['id'],'direction':'in','ContactId':_0x26d5ad[_0xf8ae('0x89')]['id'],'AttachmentId':_0x5aaf7f[_0xf8ae('0x59')][_0xf8ae('0x98')]});})[_0xf8ae('0x34')](function(_0x78ce90){_0x26d5ad[_0xf8ae('0x24')]=_0x78ce90;if(_0x26d5ad[_0xf8ae('0x93')][_0xf8ae('0x99')]){return db[_0xf8ae('0x9a')]['find']({'attributes':['id','name'],'where':{'id':_0x26d5ad[_0xf8ae('0x93')]['UserId']}})[_0xf8ae('0x34')](function(_0x75f736){if(_0x75f736){_0x26d5ad[_0xf8ae('0x85')][_0xf8ae('0x9b')]({'id':0x0,'priority':0x0,'app':_0xf8ae('0x9c'),'appdata':_0x75f736[_0xf8ae('0x39')]+','+(_0x26d5ad['account'][_0xf8ae('0x9d')]||0xa),'interval':'*,*,*,*'});_0x26d5ad['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0xf8ae('0x9e'),_0x26d5ad);});}return respondWithRpcPromise(_0xf8ae('0x9f'),'startRouting',_0x26d5ad);})['then'](function(_0x1abb7d){respondWithRpcPromise(_0xf8ae('0xa0'),_0xf8ae('0xa0'),{'event':_0xf8ae('0x70'),'message':_0x1abb7d},client9002);return _0x1abb7d;})[_0xf8ae('0x34')](respondWithResult(_0x47631d,null))['catch'](handleError(_0x47631d,null));};exports[_0xf8ae('0xa1')]=function(_0x1880c3,_0x16b4af){var _0x420599=_0x1880c3[_0xf8ae('0x62')]['id'];var _0xb78686=_0x1880c3[_0xf8ae('0x59')];var _0xaa9772=0xc8;var _0x4de638=null;return db[_0xf8ae('0xa2')][_0xf8ae('0xa3')]({'isolationLevel':db[_0xf8ae('0xa2')][_0xf8ae('0xa4')][_0xf8ae('0xa5')][_0xf8ae('0xa6')]},function(_0x25b09b){return db[_0xf8ae('0x3e')][_0xf8ae('0x66')]({'where':{'id':_0x420599},'transaction':_0x25b09b})[_0xf8ae('0x34')](function(_0x186bfb){if(_0x186bfb){return db[_0xf8ae('0x81')][_0xf8ae('0x35')]({'where':{'OpenchannelAccountId':_0x420599},'transaction':_0x25b09b})[_0xf8ae('0x34')](function(){var _0x5e50dd=_[_0xf8ae('0x3d')](_0xb78686,function(_0x2708ef){_0x2708ef[_0xf8ae('0x6d')]=_0x420599;return _0x2708ef;});return db['OpenchannelApplication']['bulkCreate'](_0x5e50dd,{'transaction':_0x25b09b});});}else{_0xaa9772=0x194;_0x4de638=[];}});})[_0xf8ae('0x34')](function(){if(_0xaa9772!==0x194){return db[_0xf8ae('0x81')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x420599},'order':_0xf8ae('0x86')})[_0xf8ae('0x34')](function(_0x49673){_0x4de638=_0x49673;});}})[_0xf8ae('0x27')](function(_0x1b5086){_0xaa9772=0x1f4;logger[_0xf8ae('0x21')](_0x1b5086[_0xf8ae('0x38')]);if(_0x1b5086[_0xf8ae('0x39')]){delete _0x1b5086[_0xf8ae('0x39')];}_0x4de638=_0x1b5086;})[_0xf8ae('0xa7')](function(){if(_0x4de638===null){_0x16b4af[_0xf8ae('0x28')](_0xaa9772);}else{if(_0xaa9772===0x1f4){_0x16b4af[_0xf8ae('0x29')](_0xaa9772)[_0xf8ae('0xa8')](_0x4de638);}else{_0x16b4af[_0xf8ae('0x29')](_0xaa9772)[_0xf8ae('0x2b')](_0x4de638);}}});};exports['getApplications']=function(_0x5290ae,_0x4b1140,_0x99aca8){var _0x40975a={};var _0x41e55c={};var _0x4c81eb;var _0x3fb9af;return db[_0xf8ae('0x3e')][_0xf8ae('0x66')]({'where':{'id':_0x5290ae[_0xf8ae('0x62')]['id']}})['then'](handleEntityNotFound(_0x4b1140,null))[_0xf8ae('0x34')](function(_0x96a11b){if(_0x96a11b){_0x4c81eb=_0x96a11b;_0x41e55c[_0xf8ae('0x43')]=_[_0xf8ae('0x56')](db[_0xf8ae('0x81')][_0xf8ae('0x3f')]);_0x41e55c['query']=_[_0xf8ae('0x56')](_0x5290ae[_0xf8ae('0x44')]);_0x41e55c[_0xf8ae('0x45')]=_[_0xf8ae('0x46')](_0x41e55c[_0xf8ae('0x43')],_0x41e55c[_0xf8ae('0x44')]);_0x40975a['attributes']=_[_0xf8ae('0x46')](_0x41e55c[_0xf8ae('0x43')],qs[_0xf8ae('0x48')](_0x5290ae['query'][_0xf8ae('0x48')]));_0x40975a[_0xf8ae('0x47')]=_0x40975a[_0xf8ae('0x47')][_0xf8ae('0x49')]?_0x40975a[_0xf8ae('0x47')]:_0x41e55c[_0xf8ae('0x43')];_0x40975a[_0xf8ae('0x67')]=qs['sort'](_0x5290ae[_0xf8ae('0x44')][_0xf8ae('0x4c')]);_0x40975a['where']=qs[_0xf8ae('0x45')](_[_0xf8ae('0x4e')](_0x5290ae[_0xf8ae('0x44')],_0x41e55c['filters']));if(_0x5290ae[_0xf8ae('0x44')][_0xf8ae('0x4f')]){_0x40975a['where']=_[_0xf8ae('0x50')](_0x40975a[_0xf8ae('0x4d')],{'$or':_[_0xf8ae('0x3d')](_0x40975a[_0xf8ae('0x47')],function(_0x54b4e4){var _0x345bb6={};_0x345bb6[_0x54b4e4]={'$like':'%'+_0x5290ae[_0xf8ae('0x44')][_0xf8ae('0x4f')]+'%'};return _0x345bb6;})});}_0x40975a=_['merge']({},_0x40975a,_0x5290ae[_0xf8ae('0x68')]);return _0x4c81eb['getApplications'](_0x40975a);}})['then'](function(_0x410f41){if(_0x410f41){_0x3fb9af=_0x410f41[_0xf8ae('0x49')];if(!_0x5290ae['query'][_0xf8ae('0x4a')]('nolimit')){_0x40975a['limit']=qs[_0xf8ae('0x2e')](_0x5290ae[_0xf8ae('0x44')][_0xf8ae('0x2e')]);_0x40975a['offset']=qs[_0xf8ae('0x2c')](_0x5290ae[_0xf8ae('0x44')][_0xf8ae('0x2c')]);}return _0x4c81eb[_0xf8ae('0xa9')](_0x40975a);}})[_0xf8ae('0x34')](function(_0x4ee3e0){if(_0x4ee3e0){return _0x4ee3e0?{'count':_0x3fb9af,'rows':_0x4ee3e0}:null;}})[_0xf8ae('0x34')](respondWithResult(_0x4b1140,null))[_0xf8ae('0x27')](handleError(_0x4b1140,null));};exports['getInteractions']=function(_0x7a89ef,_0x38d283,_0x4da5f9){var _0x3db8e4={'raw':![],'where':{}};var _0x4049de={};var _0x11a0d8={'count':0x0,'rows':[]};return db[_0xf8ae('0x3e')][_0xf8ae('0x66')]({'where':{'id':_0x7a89ef[_0xf8ae('0x62')]['id']}})[_0xf8ae('0x34')](handleEntityNotFound(_0x38d283,null))[_0xf8ae('0x34')](function(_0xce02ab){if(_0xce02ab){_0x4049de[_0xf8ae('0x43')]=_[_0xf8ae('0x56')](db['OpenchannelInteraction'][_0xf8ae('0x3f')]);_0x4049de[_0xf8ae('0x44')]=_['keys'](_0x7a89ef[_0xf8ae('0x44')]);_0x4049de[_0xf8ae('0x45')]=_[_0xf8ae('0x46')](_0x4049de[_0xf8ae('0x43')],_0x4049de[_0xf8ae('0x44')]);_0x3db8e4[_0xf8ae('0x47')]=_[_0xf8ae('0x46')](_0x4049de[_0xf8ae('0x43')],qs[_0xf8ae('0x48')](_0x7a89ef[_0xf8ae('0x44')][_0xf8ae('0x48')]));_0x3db8e4[_0xf8ae('0x47')]=_0x3db8e4[_0xf8ae('0x47')][_0xf8ae('0x49')]?_0x3db8e4['attributes']:_0x4049de['model'];if(!_0x7a89ef[_0xf8ae('0x44')][_0xf8ae('0x4a')]('nolimit')){_0x3db8e4[_0xf8ae('0x2e')]=qs['limit'](_0x7a89ef['query'][_0xf8ae('0x2e')]);_0x3db8e4[_0xf8ae('0x2c')]=qs[_0xf8ae('0x2c')](_0x7a89ef['query']['offset']);}_0x3db8e4[_0xf8ae('0x67')]=qs[_0xf8ae('0x4c')](_0x7a89ef[_0xf8ae('0x44')][_0xf8ae('0x4c')]);_0x3db8e4[_0xf8ae('0x4d')]=qs[_0xf8ae('0x45')](_[_0xf8ae('0x4e')](_0x7a89ef[_0xf8ae('0x44')],_0x4049de[_0xf8ae('0x45')]));_0x3db8e4[_0xf8ae('0x4d')][_0xf8ae('0x6d')]=_0xce02ab['id'];if(_0x7a89ef[_0xf8ae('0x44')][_0xf8ae('0x4f')]){_0x3db8e4['where']=_[_0xf8ae('0x50')](_0x3db8e4[_0xf8ae('0x4d')],{'$or':_[_0xf8ae('0x3d')](_0x3db8e4['attributes'],function(_0x431701){var _0x90a1f0={};_0x90a1f0[_0x431701]={'$like':'%'+_0x7a89ef[_0xf8ae('0x44')][_0xf8ae('0x4f')]+'%'};return _0x90a1f0;})});}_0x3db8e4=_[_0xf8ae('0x50')]({},_0x3db8e4,_0x7a89ef['options']);return db['OpenchannelInteraction']['count']({'where':_0x3db8e4['where']})[_0xf8ae('0x34')](function(_0x2d4d4f){_0x11a0d8['count']=_0x2d4d4f;if(_0x7a89ef[_0xf8ae('0x44')][_0xf8ae('0x69')]){_0x3db8e4[_0xf8ae('0x52')]=[{'model':db['CmContact'],'as':_0xf8ae('0xaa'),'required':![]},{'model':db[_0xf8ae('0x9a')],'as':'Owner','attributes':['name',_0xf8ae('0xab'),_0xf8ae('0xac')],'required':![]},{'model':db[_0xf8ae('0xad')],'as':_0xf8ae('0xae'),'attributes':['id',_0xf8ae('0x39'),'color'],'where':_0x7a89ef[_0xf8ae('0x44')][_0xf8ae('0xaf')]?{'id':_0x7a89ef[_0xf8ae('0x44')][_0xf8ae('0xaf')]}:undefined,'required':_0x7a89ef[_0xf8ae('0x44')]['tag']?!![]:![]}];}return db[_0xf8ae('0x8d')][_0xf8ae('0x53')](_0x3db8e4);})[_0xf8ae('0x34')](function(_0x3fa2cf){_0x11a0d8[_0xf8ae('0x54')]=_0x3fa2cf;return _0x11a0d8;});}})[_0xf8ae('0x34')](respondWithFilteredResult(_0x38d283,_0x3db8e4))[_0xf8ae('0x27')](handleError(_0x38d283,null));};exports['addAgents']=function(_0x4928e8,_0x1cc29b,_0x33d16e){return db[_0xf8ae('0x3e')][_0xf8ae('0x57')]({'where':{'id':_0x4928e8[_0xf8ae('0x62')]['id']}})[_0xf8ae('0x34')](handleEntityNotFound(_0x1cc29b,null))[_0xf8ae('0x34')](function(_0x3ea920){if(_0x3ea920){return _0x3ea920[_0xf8ae('0xb0')](_0x4928e8[_0xf8ae('0x59')][_0xf8ae('0x6b')],_[_0xf8ae('0xb1')](_0x4928e8['body'],[_0xf8ae('0x6b'),'id'])||{})[_0xf8ae('0x8f')](function(_0x270a8b){for(var _0x24e346=0x0;_0x24e346<_0x4928e8['body'][_0xf8ae('0x6b')][_0xf8ae('0x49')];_0x24e346+=0x1){socket[_0xf8ae('0xb2')](_0xf8ae('0xb3'),{'UserId':Number(_0x4928e8[_0xf8ae('0x59')][_0xf8ae('0x6b')][_0x24e346]),'OpenchannelAccountId':Number(_0x4928e8['params']['id'])});}return _0x270a8b;});}})[_0xf8ae('0x34')](respondWithResult(_0x1cc29b,null))[_0xf8ae('0x27')](handleError(_0x1cc29b,null));};exports['removeAgents']=function(_0x2d4d96,_0x365223,_0x19a2a5){return db[_0xf8ae('0x3e')][_0xf8ae('0x57')]({'where':{'id':_0x2d4d96['params']['id']}})[_0xf8ae('0x34')](handleEntityNotFound(_0x365223,null))[_0xf8ae('0x34')](function(_0x11c66e){if(_0x11c66e){return _0x11c66e[_0xf8ae('0xb4')](_0x2d4d96[_0xf8ae('0x44')][_0xf8ae('0x6b')])[_0xf8ae('0x34')](function(){if(_[_0xf8ae('0xb5')](_0x2d4d96['query']['ids'])){for(var _0xce0c57=0x0;_0xce0c57<_0x2d4d96[_0xf8ae('0x44')][_0xf8ae('0x6b')][_0xf8ae('0x49')];_0xce0c57+=0x1){socket[_0xf8ae('0xb2')](_0xf8ae('0xb6'),{'UserId':Number(_0x2d4d96['query']['ids'][_0xce0c57]),'OpenchannelAccountId':Number(_0x2d4d96[_0xf8ae('0x62')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x2d4d96[_0xf8ae('0x44')]['ids']),'OpenchannelAccountId':Number(_0x2d4d96[_0xf8ae('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x365223,null))['catch'](handleError(_0x365223,null));};exports[_0xf8ae('0xb7')]=function(_0x3efda6,_0x3f7833,_0x421877){var _0x4160ce={};var _0x85f718={};var _0x2e5a5a;var _0x44f9f6;return db[_0xf8ae('0x3e')][_0xf8ae('0x66')]({'where':{'id':_0x3efda6[_0xf8ae('0x62')]['id']}})['then'](handleEntityNotFound(_0x3f7833,null))[_0xf8ae('0x34')](function(_0x58b3c6){if(_0x58b3c6){_0x2e5a5a=_0x58b3c6;_0x85f718[_0xf8ae('0x43')]=_[_0xf8ae('0x56')](db['User']['rawAttributes']);_0x85f718[_0xf8ae('0x44')]=_[_0xf8ae('0x56')](_0x3efda6[_0xf8ae('0x44')]);_0x85f718[_0xf8ae('0x45')]=_['intersection'](_0x85f718[_0xf8ae('0x43')],_0x85f718[_0xf8ae('0x44')]);_0x4160ce[_0xf8ae('0x47')]=_[_0xf8ae('0x46')](_0x85f718[_0xf8ae('0x43')],qs[_0xf8ae('0x48')](_0x3efda6[_0xf8ae('0x44')][_0xf8ae('0x48')]));_0x4160ce[_0xf8ae('0x47')]=_0x4160ce['attributes']['length']?_0x4160ce[_0xf8ae('0x47')]:_0x85f718[_0xf8ae('0x43')];_0x4160ce['order']=qs[_0xf8ae('0x4c')](_0x3efda6[_0xf8ae('0x44')][_0xf8ae('0x4c')]);_0x4160ce[_0xf8ae('0x4d')]=qs[_0xf8ae('0x45')](_[_0xf8ae('0x4e')](_0x3efda6[_0xf8ae('0x44')],_0x85f718[_0xf8ae('0x45')]));if(_0x3efda6[_0xf8ae('0x44')]['filter']){_0x4160ce[_0xf8ae('0x4d')]=_[_0xf8ae('0x50')](_0x4160ce[_0xf8ae('0x4d')],{'$or':_['map'](_0x4160ce[_0xf8ae('0x47')],function(_0x8472d2){var _0x9e6bb0={};_0x9e6bb0[_0x8472d2]={'$like':'%'+_0x3efda6[_0xf8ae('0x44')][_0xf8ae('0x4f')]+'%'};return _0x9e6bb0;})});}_0x4160ce=_[_0xf8ae('0x50')]({},_0x4160ce,_0x3efda6[_0xf8ae('0x68')]);return _0x2e5a5a[_0xf8ae('0xb7')](_0x4160ce);}})[_0xf8ae('0x34')](function(_0x4286bb){if(_0x4286bb){_0x44f9f6=_0x4286bb[_0xf8ae('0x49')];if(!_0x3efda6['query'][_0xf8ae('0x4a')]('nolimit')){_0x4160ce['limit']=qs['limit'](_0x3efda6[_0xf8ae('0x44')][_0xf8ae('0x2e')]);_0x4160ce[_0xf8ae('0x2c')]=qs[_0xf8ae('0x2c')](_0x3efda6[_0xf8ae('0x44')][_0xf8ae('0x2c')]);}return _0x2e5a5a[_0xf8ae('0xb7')](_0x4160ce);}})['then'](function(_0x1d8f16){if(_0x1d8f16){return _0x1d8f16?{'count':_0x44f9f6,'rows':_0x1d8f16}:null;}})['then'](respondWithResult(_0x3f7833,null))['catch'](handleError(_0x3f7833,null));};exports[_0xf8ae('0xa8')]=function(_0x3fd4a9,_0x1fdf7a,_0xe72a27){var _0x4dc891,_0x48b1e5,_0x45f443;if(_[_0xf8ae('0x79')](_0x3fd4a9[_0xf8ae('0x59')][_0xf8ae('0x59')])||_0x3fd4a9['body'][_0xf8ae('0x59')]===''){throw new db[(_0xf8ae('0x7b'))][(_0xf8ae('0x73'))](_0xf8ae('0x7d'));}if(_[_0xf8ae('0x79')](_0x3fd4a9['body']['to'])){}_0x4dc891=_0x3fd4a9[_0xf8ae('0x59')]['to'];return db['OpenchannelAccount'][_0xf8ae('0x66')]({'where':{'id':_0x3fd4a9[_0xf8ae('0x62')]['id']}})[_0xf8ae('0x34')](handleEntityNotFound(_0x1fdf7a,null))[_0xf8ae('0x34')](function(_0x38b1af){if(_0x38b1af){return db[_0xf8ae('0x3e')]['find']({'where':{'id':_0x38b1af['id']},'include':[{'model':db[_0xf8ae('0xb8')],'as':_0xf8ae('0x83'),'include':[{'model':db[_0xf8ae('0x72')],'as':_0xf8ae('0x88'),'where':{[_0x38b1af[_0xf8ae('0x7e')]]:_0x4dc891},'limit':0x1,'order':[['updatedAt',_0xf8ae('0x80')]]}]}]})['then'](handleEntityNotFound(_0x1fdf7a,null))[_0xf8ae('0x34')](function(_0x4e284d){if(_0x4e284d&&_0x4e284d[_0xf8ae('0x83')]){_0x48b1e5=_0x4e284d['get']({'plain':!![]});if(_0x48b1e5['List']&&_0x48b1e5[_0xf8ae('0x83')][_0xf8ae('0x88')]['length']){return _0x48b1e5['List'][_0xf8ae('0x88')][0x0];}return db[_0xf8ae('0x72')][_0xf8ae('0x58')](_[_0xf8ae('0xb9')](_0x3fd4a9[_0xf8ae('0x59')],{'firstName':_0x4dc891,[_0x4e284d[_0xf8ae('0x7e')]]:_0x4dc891,'phone':_0x4dc891,'ListId':_0x48b1e5[_0xf8ae('0x78')]}));}})['then'](handleEntityNotFound(_0x1fdf7a,null))[_0xf8ae('0x34')](function(_0x27b786){if(_0x27b786){_0x45f443=_0x27b786;return db[_0xf8ae('0x8d')][_0xf8ae('0x57')]({'where':{'ContactId':_0x45f443['id'],'closed':![],'OpenchannelAccountId':_0x48b1e5['id']}})[_0xf8ae('0x34')](function(_0x41e063){if(_0x41e063){return[_0x41e063,![]];}return db[_0xf8ae('0x8d')][_0xf8ae('0x58')]({'UserId':_0x3fd4a9['user']['id'],'ContactId':_0x45f443['id'],'OpenchannelAccountId':_0x48b1e5['id'],'lastMsgDirection':_0xf8ae('0xba'),'firstMsgDirection':_0xf8ae('0xba'),'Messages':[_['merge'](_0x3fd4a9[_0xf8ae('0x59')],{'read':![],'body':_0x3fd4a9['body'][_0xf8ae('0x59')],'OpenchannelAccountId':_0x48b1e5['id'],'UserId':_0x3fd4a9[_0xf8ae('0x5a')]['id'],'ContactId':_0x45f443['id']})]},{'include':[{'model':db[_0xf8ae('0x97')],'as':_0xf8ae('0xbb')}]})[_0xf8ae('0x34')](function(_0xb75c04){return[_0xb75c04,!![]];});});}})['spread'](function(_0x5e7975,_0x14fb4d){if(_0x14fb4d){return _0x5e7975;}return db[_0xf8ae('0x97')][_0xf8ae('0x58')](_[_0xf8ae('0x50')](_0x3fd4a9[_0xf8ae('0x59')],{'read':![],'body':_0x3fd4a9[_0xf8ae('0x59')]['body'],'OpenchannelAccountId':_0x48b1e5['id'],'OpenchannelInteractionId':_0x5e7975['id'],'UserId':_0x3fd4a9[_0xf8ae('0x5a')]['id'],'ContactId':_0x45f443['id']}))[_0xf8ae('0x34')](function(_0x43c72e){_0x5e7975[_0xf8ae('0xbc')][_0xf8ae('0xbb')]=[];_0x5e7975[_0xf8ae('0xbc')][_0xf8ae('0xbb')][_0xf8ae('0xbd')](_0x43c72e[_0xf8ae('0xbc')]);return _0x5e7975;});});}})[_0xf8ae('0x34')](respondWithResult(_0x1fdf7a,null))['catch'](handleError(_0x1fdf7a,null));}; \ No newline at end of file +var _0x2367=['map','OpenchannelAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','orderBy','account','contact','firstName','lastName','OpenchannelInteraction','threadId','externalUrl','ContactId','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','unshift','agent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','sendStatus','getApplications','getInteractions','User','fullname','internal','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','undefined','count','offset','limit','Content-Range','apply','reject','then','get','OpenchannelAccounts','destroy','status','end','stack','name','send','index','Pause','mandatoryDispositionPause'];(function(_0x571714,_0x30d2b3){var _0x599a14=function(_0x3874fa){while(--_0x3874fa){_0x571714['push'](_0x571714['shift']());}};_0x599a14(++_0x30d2b3);}(_0x2367,0x7f));var _0x7236=function(_0x19865a,_0x376117){_0x19865a=_0x19865a-0x0;var _0x4d8440=_0x2367[_0x19865a];return _0x4d8440;};'use strict';var emlformat=require(_0x7236('0x0'));var rimraf=require(_0x7236('0x1'));var zipdir=require(_0x7236('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7236('0x3'));var moment=require(_0x7236('0x4'));var BPromise=require(_0x7236('0x5'));var Mustache=require(_0x7236('0x6'));var util=require(_0x7236('0x7'));var path=require(_0x7236('0x8'));var sox=require(_0x7236('0x9'));var csv=require(_0x7236('0xa'));var ejs=require(_0x7236('0xb'));var fs=require('fs');var fs_extra=require(_0x7236('0xc'));var _=require('lodash');var squel=require(_0x7236('0xd'));var crypto=require(_0x7236('0xe'));var jsforce=require(_0x7236('0xf'));var deskjs=require(_0x7236('0x10'));var toCsv=require(_0x7236('0xa'));var querystring=require(_0x7236('0x11'));var Papa=require('papaparse');var Redis=require(_0x7236('0x12'));var authService=require(_0x7236('0x13'));var qs=require(_0x7236('0x14'));var as=require(_0x7236('0x15'));var hardwareService=require(_0x7236('0x16'));var logger=require('../../config/logger')(_0x7236('0x17'));var utils=require('../../config/utils');var config=require(_0x7236('0x18'));var licenseUtil=require(_0x7236('0x19'));var db=require(_0x7236('0x1a'))['db'];config[_0x7236('0x1b')]=_[_0x7236('0x1c')](config['redis'],{'host':_0x7236('0x1d'),'port':0x18eb});var socket=require(_0x7236('0x1e'))(new Redis(config[_0x7236('0x1b')]));require(_0x7236('0x1f'))[_0x7236('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7236('0x21')][_0x7236('0x22')]({'port':0x232c});var client9002=jayson[_0x7236('0x21')][_0x7236('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1f7f0e,_0x3740e2,_0x234155,_0x130b81){return new BPromise(function(_0x1b8d11,_0x372a3c){var _0x259093=_0x130b81||client;return _0x259093[_0x7236('0x23')](_0x1f7f0e,_0x234155)['then'](function(_0xc728f3){logger[_0x7236('0x24')](_0x7236('0x25'),_0x3740e2,_0x7236('0x26'));logger['debug'](_0x7236('0x27'),_0x3740e2,_0x7236('0x26'),JSON[_0x7236('0x28')](_0xc728f3));if(_0xc728f3['error']){if(_0xc728f3[_0x7236('0x29')][_0x7236('0x2a')]===0x1f4){logger[_0x7236('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x3740e2,_0xc728f3['error'][_0x7236('0x2b')]);return _0x372a3c(_0xc728f3[_0x7236('0x29')][_0x7236('0x2b')]);}logger[_0x7236('0x29')](_0x7236('0x25'),_0x3740e2,_0xc728f3['error'][_0x7236('0x2b')]);return _0x1b8d11(_0xc728f3['error'][_0x7236('0x2b')]);}else{logger['info'](_0x7236('0x25'),_0x3740e2,_0x7236('0x26'));_0x1b8d11(_0xc728f3[_0x7236('0x2c')][_0x7236('0x2b')]);}})[_0x7236('0x2d')](function(_0x20d35f){logger[_0x7236('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x3740e2,_0x20d35f);_0x372a3c(_0x20d35f);});});}function respondWithStatusCode(_0xb593fd,_0x478b52){_0x478b52=_0x478b52||0xcc;return function(_0x14dfb1){if(_0x14dfb1){return _0xb593fd['sendStatus'](_0x478b52);}return _0xb593fd['status'](_0x478b52)['end']();};}function respondWithResult(_0x162362,_0x21393f){_0x21393f=_0x21393f||0xc8;return function(_0x4de702){if(_0x4de702){return _0x162362['status'](_0x21393f)[_0x7236('0x2e')](_0x4de702);}};}function respondWithFilteredResult(_0x3b8ebe,_0x1157c9){return function(_0x118231){if(_0x118231){var _0x242b22=typeof _0x1157c9['offset']==='undefined'&&typeof _0x1157c9['limit']===_0x7236('0x2f');var _0x23ed66=_0x118231[_0x7236('0x30')];var _0x7a134a=_0x242b22?0x0:_0x1157c9[_0x7236('0x31')];var _0x1160c2=_0x242b22?_0x118231[_0x7236('0x30')]:_0x1157c9['offset']+_0x1157c9[_0x7236('0x32')];var _0x1c4b5f;if(_0x1160c2>=_0x23ed66){_0x1160c2=_0x23ed66;_0x1c4b5f=0xc8;}else{_0x1c4b5f=0xce;}_0x3b8ebe['status'](_0x1c4b5f);return _0x3b8ebe['set'](_0x7236('0x33'),_0x7a134a+'-'+_0x1160c2+'/'+_0x23ed66)['json'](_0x118231);}return null;};}function patchUpdates(_0x12c918){return function(_0x437a0a){try{jsonpatch[_0x7236('0x34')](_0x437a0a,_0x12c918,!![]);}catch(_0xfd4ff2){return BPromise[_0x7236('0x35')](_0xfd4ff2);}return _0x437a0a['save']();};}function saveUpdates(_0x1e728d,_0x2be4e7){return function(_0x41ac33){if(_0x41ac33){return _0x41ac33['update'](_0x1e728d)[_0x7236('0x36')](function(_0x6c9fd5){return _0x6c9fd5;});}return null;};}function removeEntity(_0x100734,_0x2215e5){return function(_0x5e33e6){if(_0x5e33e6){return _0x5e33e6['destroy']()[_0x7236('0x36')](function(){var _0x228ade=_0x5e33e6[_0x7236('0x37')]({'plain':!![]});var _0x524803=_0x7236('0x38');return db['UserProfileResource'][_0x7236('0x39')]({'where':{'type':_0x524803,'resourceId':_0x228ade['id']}})[_0x7236('0x36')](function(){return _0x5e33e6;});})['then'](function(){_0x100734[_0x7236('0x3a')](0xcc)[_0x7236('0x3b')]();});}};}function handleEntityNotFound(_0x3ce92e,_0x201677){return function(_0xa07a40){if(!_0xa07a40){_0x3ce92e['sendStatus'](0x194);}return _0xa07a40;};}function handleError(_0x31cadd,_0x2a3da7){_0x2a3da7=_0x2a3da7||0x1f4;return function(_0x5dbf57){logger['error'](_0x5dbf57[_0x7236('0x3c')]);if(_0x5dbf57[_0x7236('0x3d')]){delete _0x5dbf57[_0x7236('0x3d')];}_0x31cadd[_0x7236('0x3a')](_0x2a3da7)[_0x7236('0x3e')](_0x5dbf57);};}exports[_0x7236('0x3f')]=function(_0x63ed1a,_0x3f9cc5){var _0x26b36e={'include':[{'model':db[_0x7236('0x40')],'as':_0x7236('0x41')}]},_0x481312={},_0x293e03={'count':0x0,'rows':[]};var _0x1aa34d=_[_0x7236('0x42')](db[_0x7236('0x43')][_0x7236('0x44')],function(_0x15dd4b){return{'name':_0x15dd4b['fieldName'],'type':_0x15dd4b[_0x7236('0x45')][_0x7236('0x46')]};});_0x481312[_0x7236('0x47')]=_[_0x7236('0x42')](_0x1aa34d,_0x7236('0x3d'));_0x481312['query']=_[_0x7236('0x48')](_0x63ed1a[_0x7236('0x49')]);_0x481312[_0x7236('0x4a')]=_[_0x7236('0x4b')](_0x481312['model'],_0x481312['query']);_0x26b36e['attributes']=_[_0x7236('0x4b')](_0x481312[_0x7236('0x47')],qs['fields'](_0x63ed1a['query'][_0x7236('0x4c')]));_0x26b36e['attributes']=_0x26b36e[_0x7236('0x4d')][_0x7236('0x4e')]?_0x26b36e[_0x7236('0x4d')]:_0x481312[_0x7236('0x47')];if(!_0x63ed1a['query']['hasOwnProperty'](_0x7236('0x4f'))){_0x26b36e[_0x7236('0x32')]=qs[_0x7236('0x32')](_0x63ed1a['query'][_0x7236('0x32')]);_0x26b36e[_0x7236('0x31')]=qs[_0x7236('0x31')](_0x63ed1a[_0x7236('0x49')][_0x7236('0x31')]);}_0x26b36e['order']=qs[_0x7236('0x50')](_0x63ed1a[_0x7236('0x49')][_0x7236('0x50')]);_0x26b36e[_0x7236('0x51')]=qs[_0x7236('0x4a')](_[_0x7236('0x52')](_0x63ed1a[_0x7236('0x49')],_0x481312['filters']),_0x1aa34d);if(_0x63ed1a[_0x7236('0x49')]['filter']){_0x26b36e['where']=_[_0x7236('0x53')](_0x26b36e[_0x7236('0x51')],{'$or':_[_0x7236('0x42')](_0x1aa34d,function(_0x32cba9){if(_0x32cba9[_0x7236('0x45')]!==_0x7236('0x54')){var _0x49fdaa={};_0x49fdaa[_0x32cba9['name']]={'$like':'%'+_0x63ed1a['query'][_0x7236('0x55')]+'%'};return _0x49fdaa;}})});}_0x26b36e=_['merge']({},_0x26b36e,_0x63ed1a[_0x7236('0x56')]);var _0x754e2b={'where':_0x26b36e[_0x7236('0x51')]};return db['OpenchannelAccount']['count'](_0x754e2b)['then'](function(_0xc27750){_0x293e03[_0x7236('0x30')]=_0xc27750;if(_0x63ed1a[_0x7236('0x49')][_0x7236('0x57')]){_0x26b36e[_0x7236('0x58')]=[{'all':!![]}];}return db[_0x7236('0x43')]['findAll'](_0x26b36e);})[_0x7236('0x36')](function(_0x338697){_0x293e03[_0x7236('0x59')]=_0x338697;return _0x293e03;})[_0x7236('0x36')](respondWithFilteredResult(_0x3f9cc5,_0x26b36e))[_0x7236('0x2d')](handleError(_0x3f9cc5,null));};exports[_0x7236('0x5a')]=function(_0x1dfc75,_0x486f10){var _0xc92dbf={'raw':![],'where':{'id':_0x1dfc75[_0x7236('0x5b')]['id']},'include':[{'model':db[_0x7236('0x40')],'as':'mandatoryDispositionPause'}]},_0xf61c7d={};_0xf61c7d[_0x7236('0x47')]=_[_0x7236('0x48')](db[_0x7236('0x43')]['rawAttributes']);_0xf61c7d[_0x7236('0x49')]=_['keys'](_0x1dfc75[_0x7236('0x49')]);_0xf61c7d[_0x7236('0x4a')]=_[_0x7236('0x4b')](_0xf61c7d[_0x7236('0x47')],_0xf61c7d['query']);_0xc92dbf[_0x7236('0x4d')]=_[_0x7236('0x4b')](_0xf61c7d[_0x7236('0x47')],qs[_0x7236('0x4c')](_0x1dfc75[_0x7236('0x49')][_0x7236('0x4c')]));_0xc92dbf[_0x7236('0x4d')]=_0xc92dbf[_0x7236('0x4d')][_0x7236('0x4e')]?_0xc92dbf[_0x7236('0x4d')]:_0xf61c7d[_0x7236('0x47')];if(_0x1dfc75[_0x7236('0x49')][_0x7236('0x57')]){_0xc92dbf[_0x7236('0x58')]=[{'all':!![]}];}_0xc92dbf=_['merge']({},_0xc92dbf,_0x1dfc75[_0x7236('0x56')]);return db[_0x7236('0x43')][_0x7236('0x5c')](_0xc92dbf)[_0x7236('0x36')](handleEntityNotFound(_0x486f10,null))[_0x7236('0x36')](respondWithResult(_0x486f10,null))[_0x7236('0x2d')](handleError(_0x486f10,null));};exports[_0x7236('0x5d')]=function(_0x1a452a,_0x463d45){return db['OpenchannelAccount'][_0x7236('0x5d')](_0x1a452a[_0x7236('0x5e')],{})[_0x7236('0x36')](function(_0x4bd5e2){var _0x2001a8=_0x1a452a['user'][_0x7236('0x37')]({'plain':!![]});if(!_0x2001a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2001a8[_0x7236('0x5f')]===_0x7236('0x60')){var _0x3aa428=_0x4bd5e2[_0x7236('0x37')]({'plain':!![]});var _0x383614='OpenchannelAccounts';return db[_0x7236('0x61')][_0x7236('0x5c')]({'where':{'name':_0x383614,'userProfileId':_0x2001a8[_0x7236('0x62')]},'raw':!![]})['then'](function(_0x5742dc){if(_0x5742dc&&_0x5742dc[_0x7236('0x63')]===0x0){return db[_0x7236('0x64')][_0x7236('0x5d')]({'name':_0x3aa428[_0x7236('0x3d')],'resourceId':_0x3aa428['id'],'type':_0x5742dc[_0x7236('0x3d')],'sectionId':_0x5742dc['id']},{})[_0x7236('0x36')](function(){return _0x4bd5e2;});}else{return _0x4bd5e2;}})[_0x7236('0x2d')](function(_0x5e8081){logger[_0x7236('0x29')](_0x7236('0x65'),_0x5e8081);throw _0x5e8081;});}return _0x4bd5e2;})[_0x7236('0x36')](respondWithResult(_0x463d45,0xc9))[_0x7236('0x2d')](handleError(_0x463d45,null));};exports[_0x7236('0x66')]=function(_0x5bfff8,_0xeea8a1){if(_0x5bfff8[_0x7236('0x5e')]['id']){delete _0x5bfff8[_0x7236('0x5e')]['id'];}return db[_0x7236('0x43')][_0x7236('0x5c')]({'where':{'id':_0x5bfff8['params']['id']},'include':[{'model':db[_0x7236('0x40')],'as':_0x7236('0x41')}]})[_0x7236('0x36')](handleEntityNotFound(_0xeea8a1,null))[_0x7236('0x36')](saveUpdates(_0x5bfff8[_0x7236('0x5e')],null))[_0x7236('0x36')](respondWithResult(_0xeea8a1,null))[_0x7236('0x2d')](handleError(_0xeea8a1,null));};exports[_0x7236('0x39')]=function(_0x32b253,_0x3a5a99){return db['OpenchannelAccount'][_0x7236('0x5c')]({'where':{'id':_0x32b253[_0x7236('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3a5a99,null))[_0x7236('0x36')](removeEntity(_0x3a5a99,null))[_0x7236('0x2d')](handleError(_0x3a5a99,null));};exports[_0x7236('0x67')]=function(_0x2f7cf7,_0x47e85d){return db[_0x7236('0x43')][_0x7236('0x67')]()[_0x7236('0x36')](respondWithResult(_0x47e85d,null))[_0x7236('0x2d')](handleError(_0x47e85d,null));};exports[_0x7236('0x68')]=function(_0x35e68d,_0x2467ef,_0x4a1d15){if(_0x35e68d[_0x7236('0x5e')]['id']){delete _0x35e68d[_0x7236('0x5e')]['id'];}return db[_0x7236('0x43')]['find']({'where':{'id':_0x35e68d[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x2467ef,null))[_0x7236('0x36')](function(_0x3d99be){if(_0x3d99be){_0x35e68d['body'][_0x7236('0x69')]=_0x3d99be['id'];return db[_0x7236('0x6a')][_0x7236('0x5d')](_0x35e68d[_0x7236('0x5e')]);}})[_0x7236('0x36')](respondWithResult(_0x2467ef,null))[_0x7236('0x2d')](handleError(_0x2467ef,null));};exports[_0x7236('0x6b')]=function(_0x3a63dd,_0x1c747b,_0x360e0f){var _0x42d01d={'raw':![],'where':{}};var _0x2c99ad={};var _0x123eef={'count':0x0,'rows':[]};return db[_0x7236('0x43')][_0x7236('0x6c')]({'where':{'id':_0x3a63dd[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x1c747b,null))[_0x7236('0x36')](function(_0x4d7803){if(_0x4d7803){_0x2c99ad[_0x7236('0x47')]=_[_0x7236('0x48')](db['Disposition']['rawAttributes']);_0x2c99ad[_0x7236('0x49')]=_[_0x7236('0x48')](_0x3a63dd[_0x7236('0x49')]);_0x2c99ad[_0x7236('0x4a')]=_[_0x7236('0x4b')](_0x2c99ad['model'],_0x2c99ad['query']);_0x42d01d['attributes']=_[_0x7236('0x4b')](_0x2c99ad[_0x7236('0x47')],qs['fields'](_0x3a63dd[_0x7236('0x49')][_0x7236('0x4c')]));_0x42d01d['attributes']=_0x42d01d[_0x7236('0x4d')][_0x7236('0x4e')]?_0x42d01d[_0x7236('0x4d')]:_0x2c99ad[_0x7236('0x47')];if(!_0x3a63dd['query'][_0x7236('0x6d')](_0x7236('0x4f'))){_0x42d01d[_0x7236('0x32')]=qs['limit'](_0x3a63dd[_0x7236('0x49')][_0x7236('0x32')]);_0x42d01d['offset']=qs[_0x7236('0x31')](_0x3a63dd['query'][_0x7236('0x31')]);}_0x42d01d[_0x7236('0x6e')]=qs['sort'](_0x3a63dd['query']['sort']);_0x42d01d[_0x7236('0x51')]=qs['filters'](_[_0x7236('0x52')](_0x3a63dd[_0x7236('0x49')],_0x2c99ad[_0x7236('0x4a')]));_0x42d01d[_0x7236('0x51')]['OpenchannelAccountId']=_0x4d7803['id'];if(_0x3a63dd[_0x7236('0x49')][_0x7236('0x55')]){_0x42d01d['where']=_[_0x7236('0x53')](_0x42d01d[_0x7236('0x51')],{'$or':_['map'](_0x42d01d['attributes'],function(_0x378c4e){var _0x1db585={};_0x1db585[_0x378c4e]={'$like':'%'+_0x3a63dd[_0x7236('0x49')][_0x7236('0x55')]+'%'};return _0x1db585;})});}_0x42d01d=_[_0x7236('0x53')]({},_0x42d01d,_0x3a63dd[_0x7236('0x56')]);return db[_0x7236('0x6a')][_0x7236('0x30')]({'where':_0x42d01d[_0x7236('0x51')]})[_0x7236('0x36')](function(_0x15178f){_0x123eef[_0x7236('0x30')]=_0x15178f;if(_0x3a63dd[_0x7236('0x49')][_0x7236('0x57')]){_0x42d01d['include']=[{'all':!![]}];}return db['Disposition'][_0x7236('0x6f')](_0x42d01d);})[_0x7236('0x36')](function(_0x5de7df){_0x123eef[_0x7236('0x59')]=_0x5de7df;return _0x123eef;});}})[_0x7236('0x36')](respondWithFilteredResult(_0x1c747b,_0x42d01d))['catch'](handleError(_0x1c747b,null));};exports['removeDispositions']=function(_0x30ba6c,_0x5662a3,_0xd0845d){return db[_0x7236('0x43')][_0x7236('0x5c')]({'where':{'id':_0x30ba6c[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x5662a3,null))[_0x7236('0x36')](function(_0x50cec6){if(_0x50cec6){return _0x50cec6[_0x7236('0x70')](_0x30ba6c[_0x7236('0x49')][_0x7236('0x71')]);}})[_0x7236('0x36')](respondWithStatusCode(_0x5662a3,null))[_0x7236('0x2d')](handleError(_0x5662a3,null));};exports[_0x7236('0x72')]=function(_0x3a73f1,_0x30e6a2,_0x3e7857){if(_0x3a73f1[_0x7236('0x5e')]['id']){delete _0x3a73f1[_0x7236('0x5e')]['id'];}return db[_0x7236('0x43')][_0x7236('0x5c')]({'where':{'id':_0x3a73f1[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x30e6a2,null))[_0x7236('0x36')](function(_0x3048cd){if(_0x3048cd){_0x3a73f1['body'][_0x7236('0x69')]=_0x3048cd['id'];return db[_0x7236('0x73')][_0x7236('0x5d')](_0x3a73f1[_0x7236('0x5e')]);}})[_0x7236('0x36')](respondWithResult(_0x30e6a2,null))[_0x7236('0x2d')](handleError(_0x30e6a2,null));};exports[_0x7236('0x74')]=function(_0x3b8bbc,_0x3c2d18,_0x1db94f){var _0x55ed38={'raw':![],'where':{}};var _0x3790e0={};var _0x5cd964={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x7236('0x6c')]({'where':{'id':_0x3b8bbc[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x3c2d18,null))[_0x7236('0x36')](function(_0x3b53da){if(_0x3b53da){_0x3790e0[_0x7236('0x47')]=_['keys'](db[_0x7236('0x73')]['rawAttributes']);_0x3790e0[_0x7236('0x49')]=_['keys'](_0x3b8bbc['query']);_0x3790e0[_0x7236('0x4a')]=_[_0x7236('0x4b')](_0x3790e0[_0x7236('0x47')],_0x3790e0[_0x7236('0x49')]);_0x55ed38['attributes']=_[_0x7236('0x4b')](_0x3790e0['model'],qs[_0x7236('0x4c')](_0x3b8bbc[_0x7236('0x49')][_0x7236('0x4c')]));_0x55ed38[_0x7236('0x4d')]=_0x55ed38[_0x7236('0x4d')]['length']?_0x55ed38[_0x7236('0x4d')]:_0x3790e0['model'];if(!_0x3b8bbc['query']['hasOwnProperty'](_0x7236('0x4f'))){_0x55ed38[_0x7236('0x32')]=qs['limit'](_0x3b8bbc[_0x7236('0x49')][_0x7236('0x32')]);_0x55ed38[_0x7236('0x31')]=qs[_0x7236('0x31')](_0x3b8bbc[_0x7236('0x49')][_0x7236('0x31')]);}_0x55ed38[_0x7236('0x6e')]=qs[_0x7236('0x50')](_0x3b8bbc[_0x7236('0x49')]['sort']);_0x55ed38[_0x7236('0x51')]=qs[_0x7236('0x4a')](_[_0x7236('0x52')](_0x3b8bbc[_0x7236('0x49')],_0x3790e0[_0x7236('0x4a')]));_0x55ed38['where'][_0x7236('0x69')]=_0x3b53da['id'];if(_0x3b8bbc[_0x7236('0x49')][_0x7236('0x55')]){_0x55ed38[_0x7236('0x51')]=_[_0x7236('0x53')](_0x55ed38[_0x7236('0x51')],{'$or':_['map'](_0x55ed38['attributes'],function(_0x5ce0a9){var _0x219b52={};_0x219b52[_0x5ce0a9]={'$like':'%'+_0x3b8bbc[_0x7236('0x49')]['filter']+'%'};return _0x219b52;})});}_0x55ed38=_[_0x7236('0x53')]({},_0x55ed38,_0x3b8bbc[_0x7236('0x56')]);return db[_0x7236('0x73')][_0x7236('0x30')]({'where':_0x55ed38['where']})['then'](function(_0x4b1eae){_0x5cd964[_0x7236('0x30')]=_0x4b1eae;if(_0x3b8bbc[_0x7236('0x49')][_0x7236('0x57')]){_0x55ed38['include']=[{'all':!![]}];}return db[_0x7236('0x73')]['findAll'](_0x55ed38);})[_0x7236('0x36')](function(_0x310661){_0x5cd964['rows']=_0x310661;return _0x5cd964;});}})[_0x7236('0x36')](respondWithFilteredResult(_0x3c2d18,_0x55ed38))[_0x7236('0x2d')](handleError(_0x3c2d18,null));};exports[_0x7236('0x75')]=function(_0x16c360,_0x3359fd,_0x360ab6){return db[_0x7236('0x43')][_0x7236('0x5c')]({'where':{'id':_0x16c360[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x3359fd,null))['then'](function(_0x12624d){if(_0x12624d){return _0x12624d[_0x7236('0x75')](_0x16c360[_0x7236('0x49')]['ids']);}})[_0x7236('0x36')](respondWithStatusCode(_0x3359fd,null))[_0x7236('0x2d')](handleError(_0x3359fd,null));};exports[_0x7236('0x76')]=function(_0x44d867,_0x24b0bc,_0x53eb88){var _0x5502b8={'body':_0x44d867[_0x7236('0x5e')],'channel':'openchannel'};var _0xf74118=[];var _0x5291ad=[];var _0xb58d64={};var _0x1592cc=![];return db[_0x7236('0x77')]['describe']()[_0x7236('0x36')](function(_0x5ae999){if(!_0x5ae999){throw new db['Sequelize']['ValidationError'](_0x7236('0x78'));}_0xf74118=_[_0x7236('0x79')](_['keys'](_0x5ae999),[_0x7236('0x7a'),_0x7236('0x7b')]);_0x5291ad=_[_0x7236('0x79')](_[_0x7236('0x48')](_0x5ae999),[_0x7236('0x7a'),_0x7236('0x7b'),'CompanyId',_0x7236('0x7c')]);if(_0x44d867[_0x7236('0x5e')]['id']){delete _0x44d867[_0x7236('0x5e')]['id'];}if(_[_0x7236('0x7d')](_0x44d867[_0x7236('0x5e')][_0x7236('0x7e')])){throw new db[(_0x7236('0x7f'))][(_0x7236('0x80'))](_0x7236('0x81'));}if(_[_0x7236('0x7d')](_0x44d867['body'][_0x7236('0x5e')])||_0x44d867[_0x7236('0x5e')][_0x7236('0x5e')]===''){throw new db[(_0x7236('0x7f'))][(_0x7236('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7236('0x7d')](_0x44d867['body'][_0x7236('0x82')])){throw new db[(_0x7236('0x7f'))][(_0x7236('0x80'))](_0x7236('0x83')+_0x5291ad);}if(!_[_0x7236('0x84')](_0x5291ad,_0x44d867['body'][_0x7236('0x82')])){throw new db[(_0x7236('0x7f'))][(_0x7236('0x80'))](_0x7236('0x85')+_0x5291ad);}_0xb58d64[_0x44d867['body'][_0x7236('0x82')]]=_0x44d867[_0x7236('0x5e')][_0x7236('0x7e')];})['then'](function(){return db[_0x7236('0x43')]['find']({'where':{'id':_0x44d867[_0x7236('0x5b')]['id']},'include':[{'model':db[_0x7236('0x86')],'as':_0x7236('0x87'),'include':[{'model':db[_0x7236('0x77')],'as':_0x7236('0x88'),'where':_0xb58d64,'limit':0x1,'order':[[_0x7236('0x7b'),_0x7236('0x89')]]}]},{'model':db[_0x7236('0x8a')],'as':_0x7236('0x8b')}]});})[_0x7236('0x36')](handleEntityNotFound(_0x24b0bc,null))[_0x7236('0x36')](function(_0x2e2730){if(_0x2e2730&&_0x2e2730[_0x7236('0x87')]){_0x5502b8['account']=_0x2e2730;_0x5502b8[_0x7236('0x8c')]=_0x2e2730['Applications'];_0x5502b8['list']=_0x2e2730[_0x7236('0x87')];_0x5502b8[_0x7236('0x8c')]=_[_0x7236('0x8d')](_0x5502b8[_0x7236('0x8c')],['priority'],['asc']);if(_0x5502b8[_0x7236('0x8e')][_0x7236('0x8b')]){delete _0x5502b8['account'][_0x7236('0x8b')];}if(_0x5502b8[_0x7236('0x8e')][_0x7236('0x87')]&&_0x5502b8[_0x7236('0x8e')]['List']['Contacts'][_0x7236('0x4e')]){return _0x5502b8[_0x7236('0x8e')][_0x7236('0x87')]['Contacts'][0x0];}var _0x31ef23=_[_0x7236('0x1c')](_0x44d867[_0x7236('0x5e')],{'firstName':_0x44d867[_0x7236('0x5e')][_0x7236('0x7e')],'ListId':_0x2e2730[_0x7236('0x7c')]});_0x31ef23[_0x44d867[_0x7236('0x5e')][_0x7236('0x82')]]=_0x44d867['body'][_0x7236('0x7e')];return db[_0x7236('0x77')][_0x7236('0x5d')](_0x31ef23,{'fields':_0xf74118,'raw':!![]});}})[_0x7236('0x36')](handleEntityNotFound(_0x24b0bc,null))[_0x7236('0x36')](function(_0x3e5099){_0x5502b8[_0x7236('0x8f')]=_0x3e5099;if(_0x3e5099){var _0x301a41={'ContactId':_0x3e5099['id'],'OpenchannelAccountId':_0x44d867['params']['id'],'from':(_0x3e5099[_0x7236('0x90')]||'')+'\x20'+(_0x3e5099[_0x7236('0x91')]||'')};var _0x34b620={'OpenchannelAccountId':_0x44d867['params']['id'],'closed':![]};if(_0x44d867[_0x7236('0x5e')]['threadId']){_0x34b620['threadId']=_0x44d867[_0x7236('0x5e')]['threadId'];return db[_0x7236('0x92')][_0x7236('0x5c')]({'where':_0x34b620})[_0x7236('0x36')](function(_0xee9d6f){if(_0xee9d6f){return[_0xee9d6f,![]];}_0x301a41['threadId']=_0x44d867['body'][_0x7236('0x93')];_0x301a41[_0x7236('0x94')]=_0x44d867[_0x7236('0x5e')][_0x7236('0x94')];return db[_0x7236('0x92')][_0x7236('0x5d')](_0x301a41)[_0x7236('0x36')](function(_0x4302bd){return[_0x4302bd,!![]];});});}else{_0x34b620[_0x7236('0x93')]=null;}_0x34b620[_0x7236('0x95')]=_0x3e5099['id'];return db[_0x7236('0x92')][_0x7236('0x5c')]({'where':_0x34b620})['then'](function(_0x3ba6ed){if(_0x3ba6ed){return[_0x3ba6ed,![]];}return db['OpenchannelInteraction'][_0x7236('0x5d')](_0x301a41)[_0x7236('0x36')](function(_0xaf7d9b){return[_0xaf7d9b,!![]];});});}})['spread'](function(_0x472f9e,_0xb9209d){if(_0x472f9e){_0x1592cc=_0xb9209d;if(!_0xb9209d){var _0x26e938={'from':(_0x5502b8[_0x7236('0x8f')]['firstName']||'')+'\x20'+(_0x5502b8[_0x7236('0x8f')]['lastName']||'')};if(_0x44d867['body'][_0x7236('0x93')]&&_0x44d867['body'][_0x7236('0x96')]&&_0x44d867[_0x7236('0x5e')]['threadId']!=_0x44d867[_0x7236('0x5e')][_0x7236('0x96')]){_0x26e938[_0x7236('0x93')]=_0x44d867[_0x7236('0x5e')][_0x7236('0x96')];}return _0x472f9e[_0x7236('0x66')](_0x26e938);}else{return _0x472f9e;}}})['then'](function(_0x25092a){_0x5502b8['interaction']=_0x25092a['get']({'plain':!![]});_0x5502b8[_0x7236('0x97')][_0x7236('0x98')]=_0x1592cc;if(_0x5502b8[_0x7236('0x97')][_0x7236('0x98')]){if(_0x5502b8[_0x7236('0x8e')][_0x7236('0x99')]){_0x5502b8[_0x7236('0x8c')][_0x7236('0x9a')]({'id':0x0,'priority':_0x5502b8['applications'][_0x7236('0x4e')]+0x1,'app':_0x7236('0x9b'),'appdata':_0x7236('0x9c'),'interval':_0x7236('0x9d')});}}return db['OpenchannelMessage'][_0x7236('0x5d')]({'body':_0x44d867['body']['body'],'OpenchannelAccountId':_0x44d867[_0x7236('0x5b')]['id'],'OpenchannelInteractionId':_0x25092a['id'],'direction':'in','ContactId':_0x5502b8[_0x7236('0x8f')]['id'],'AttachmentId':_0x44d867[_0x7236('0x5e')][_0x7236('0x9e')]});})[_0x7236('0x36')](function(_0x3da9a9){_0x5502b8[_0x7236('0x2b')]=_0x3da9a9;if(_0x5502b8['interaction']['UserId']){return db['User'][_0x7236('0x5c')]({'attributes':['id',_0x7236('0x3d')],'where':{'id':_0x5502b8[_0x7236('0x97')]['UserId']}})[_0x7236('0x36')](function(_0x4c0178){if(_0x4c0178){_0x5502b8[_0x7236('0x8c')][_0x7236('0x9f')]({'id':0x0,'priority':0x0,'app':_0x7236('0xa0'),'appdata':_0x4c0178['name']+','+(_0x5502b8[_0x7236('0x8e')]['waitForTheAssignedAgent']||0xa),'interval':_0x7236('0x9d')});_0x5502b8[_0x7236('0xa1')]=![];}return respondWithRpcPromise('Start',_0x7236('0xa2'),_0x5502b8);});}return respondWithRpcPromise('Start',_0x7236('0xa2'),_0x5502b8);})[_0x7236('0x36')](function(_0x2fe5ea){respondWithRpcPromise(_0x7236('0xa3'),_0x7236('0xa3'),{'event':'notify','message':_0x2fe5ea},client9002);return _0x2fe5ea;})['then'](respondWithResult(_0x24b0bc,null))[_0x7236('0x2d')](handleError(_0x24b0bc,null));};exports[_0x7236('0xa4')]=function(_0xa1a30e,_0x5596c9){var _0xdbc8f5=_0xa1a30e[_0x7236('0x5b')]['id'];var _0x3aab98=_0xa1a30e[_0x7236('0x5e')];var _0x5c09f5=0xc8;var _0xa8fcbc=null;return db[_0x7236('0xa5')][_0x7236('0xa6')]({'isolationLevel':db[_0x7236('0xa5')][_0x7236('0xa7')][_0x7236('0xa8')][_0x7236('0xa9')]},function(_0x585f83){return db[_0x7236('0x43')][_0x7236('0x6c')]({'where':{'id':_0xdbc8f5},'transaction':_0x585f83})[_0x7236('0x36')](function(_0x50dbbd){if(_0x50dbbd){return db['OpenchannelApplication'][_0x7236('0x39')]({'where':{'OpenchannelAccountId':_0xdbc8f5},'transaction':_0x585f83})[_0x7236('0x36')](function(){var _0x3b5fc2=_['map'](_0x3aab98,function(_0x55dd89){_0x55dd89[_0x7236('0x69')]=_0xdbc8f5;return _0x55dd89;});return db['OpenchannelApplication'][_0x7236('0xaa')](_0x3b5fc2,{'transaction':_0x585f83});});}else{_0x5c09f5=0x194;_0xa8fcbc=[];}});})['then'](function(){if(_0x5c09f5!==0x194){return db[_0x7236('0x8a')][_0x7236('0xab')]({'where':{'OpenchannelAccountId':_0xdbc8f5},'order':_0x7236('0xac')})['then'](function(_0x491f0b){_0xa8fcbc=_0x491f0b;});}})['catch'](function(_0x5e13de){_0x5c09f5=0x1f4;logger[_0x7236('0x29')](_0x5e13de[_0x7236('0x3c')]);if(_0x5e13de['name']){delete _0x5e13de[_0x7236('0x3d')];}_0xa8fcbc=_0x5e13de;})['finally'](function(){if(_0xa8fcbc===null){_0x5596c9[_0x7236('0xad')](_0x5c09f5);}else{if(_0x5c09f5===0x1f4){_0x5596c9[_0x7236('0x3a')](_0x5c09f5)['send'](_0xa8fcbc);}else{_0x5596c9[_0x7236('0x3a')](_0x5c09f5)['json'](_0xa8fcbc);}}});};exports[_0x7236('0xae')]=function(_0x146238,_0x36b965,_0x210241){var _0x45005f={};var _0x20d328={};var _0x2dc1e2;var _0x18c692;return db[_0x7236('0x43')][_0x7236('0x6c')]({'where':{'id':_0x146238[_0x7236('0x5b')]['id']}})['then'](handleEntityNotFound(_0x36b965,null))[_0x7236('0x36')](function(_0x306205){if(_0x306205){_0x2dc1e2=_0x306205;_0x20d328[_0x7236('0x47')]=_[_0x7236('0x48')](db[_0x7236('0x8a')][_0x7236('0x44')]);_0x20d328[_0x7236('0x49')]=_[_0x7236('0x48')](_0x146238[_0x7236('0x49')]);_0x20d328['filters']=_[_0x7236('0x4b')](_0x20d328[_0x7236('0x47')],_0x20d328[_0x7236('0x49')]);_0x45005f[_0x7236('0x4d')]=_[_0x7236('0x4b')](_0x20d328[_0x7236('0x47')],qs[_0x7236('0x4c')](_0x146238['query'][_0x7236('0x4c')]));_0x45005f[_0x7236('0x4d')]=_0x45005f['attributes'][_0x7236('0x4e')]?_0x45005f[_0x7236('0x4d')]:_0x20d328[_0x7236('0x47')];_0x45005f['order']=qs['sort'](_0x146238[_0x7236('0x49')][_0x7236('0x50')]);_0x45005f[_0x7236('0x51')]=qs['filters'](_[_0x7236('0x52')](_0x146238['query'],_0x20d328['filters']));if(_0x146238[_0x7236('0x49')]['filter']){_0x45005f[_0x7236('0x51')]=_[_0x7236('0x53')](_0x45005f[_0x7236('0x51')],{'$or':_[_0x7236('0x42')](_0x45005f['attributes'],function(_0x501cf9){var _0x1fb128={};_0x1fb128[_0x501cf9]={'$like':'%'+_0x146238['query']['filter']+'%'};return _0x1fb128;})});}_0x45005f=_[_0x7236('0x53')]({},_0x45005f,_0x146238[_0x7236('0x56')]);return _0x2dc1e2[_0x7236('0xae')](_0x45005f);}})[_0x7236('0x36')](function(_0x2951b5){if(_0x2951b5){_0x18c692=_0x2951b5[_0x7236('0x4e')];if(!_0x146238[_0x7236('0x49')][_0x7236('0x6d')]('nolimit')){_0x45005f[_0x7236('0x32')]=qs[_0x7236('0x32')](_0x146238[_0x7236('0x49')]['limit']);_0x45005f[_0x7236('0x31')]=qs[_0x7236('0x31')](_0x146238[_0x7236('0x49')][_0x7236('0x31')]);}return _0x2dc1e2[_0x7236('0xae')](_0x45005f);}})[_0x7236('0x36')](function(_0x38d9fe){if(_0x38d9fe){return _0x38d9fe?{'count':_0x18c692,'rows':_0x38d9fe}:null;}})['then'](respondWithResult(_0x36b965,null))[_0x7236('0x2d')](handleError(_0x36b965,null));};exports[_0x7236('0xaf')]=function(_0x1c7366,_0x3b4cd8,_0xcaacda){var _0x3471a2={'raw':![],'where':{}};var _0x5e0071={};var _0x4d9f88={'count':0x0,'rows':[]};return db[_0x7236('0x43')][_0x7236('0x6c')]({'where':{'id':_0x1c7366[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x3b4cd8,null))['then'](function(_0xa38058){if(_0xa38058){_0x5e0071[_0x7236('0x47')]=_[_0x7236('0x48')](db[_0x7236('0x92')][_0x7236('0x44')]);_0x5e0071['query']=_[_0x7236('0x48')](_0x1c7366[_0x7236('0x49')]);_0x5e0071[_0x7236('0x4a')]=_[_0x7236('0x4b')](_0x5e0071[_0x7236('0x47')],_0x5e0071[_0x7236('0x49')]);_0x3471a2[_0x7236('0x4d')]=_[_0x7236('0x4b')](_0x5e0071[_0x7236('0x47')],qs[_0x7236('0x4c')](_0x1c7366[_0x7236('0x49')][_0x7236('0x4c')]));_0x3471a2['attributes']=_0x3471a2[_0x7236('0x4d')][_0x7236('0x4e')]?_0x3471a2['attributes']:_0x5e0071[_0x7236('0x47')];if(!_0x1c7366[_0x7236('0x49')][_0x7236('0x6d')](_0x7236('0x4f'))){_0x3471a2['limit']=qs[_0x7236('0x32')](_0x1c7366[_0x7236('0x49')][_0x7236('0x32')]);_0x3471a2[_0x7236('0x31')]=qs[_0x7236('0x31')](_0x1c7366[_0x7236('0x49')][_0x7236('0x31')]);}_0x3471a2['order']=qs['sort'](_0x1c7366['query']['sort']);_0x3471a2['where']=qs[_0x7236('0x4a')](_[_0x7236('0x52')](_0x1c7366[_0x7236('0x49')],_0x5e0071['filters']));_0x3471a2['where'][_0x7236('0x69')]=_0xa38058['id'];if(_0x1c7366[_0x7236('0x49')][_0x7236('0x55')]){_0x3471a2[_0x7236('0x51')]=_[_0x7236('0x53')](_0x3471a2[_0x7236('0x51')],{'$or':_[_0x7236('0x42')](_0x3471a2[_0x7236('0x4d')],function(_0x193447){var _0x35128a={};_0x35128a[_0x193447]={'$like':'%'+_0x1c7366[_0x7236('0x49')][_0x7236('0x55')]+'%'};return _0x35128a;})});}_0x3471a2=_[_0x7236('0x53')]({},_0x3471a2,_0x1c7366[_0x7236('0x56')]);return db[_0x7236('0x92')][_0x7236('0x30')]({'where':_0x3471a2[_0x7236('0x51')]})[_0x7236('0x36')](function(_0x5d7baa){_0x4d9f88[_0x7236('0x30')]=_0x5d7baa;if(_0x1c7366[_0x7236('0x49')]['includeAll']){_0x3471a2[_0x7236('0x58')]=[{'model':db[_0x7236('0x77')],'as':'Contact','required':![]},{'model':db[_0x7236('0xb0')],'as':'Owner','attributes':['name',_0x7236('0xb1'),_0x7236('0xb2')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x7236('0x3d'),_0x7236('0xb3')],'where':_0x1c7366[_0x7236('0x49')][_0x7236('0xb4')]?{'id':_0x1c7366[_0x7236('0x49')][_0x7236('0xb4')]}:undefined,'required':_0x1c7366['query'][_0x7236('0xb4')]?!![]:![]}];}return db[_0x7236('0x92')]['findAll'](_0x3471a2);})[_0x7236('0x36')](function(_0x4bf43f){_0x4d9f88['rows']=_0x4bf43f;return _0x4d9f88;});}})[_0x7236('0x36')](respondWithFilteredResult(_0x3b4cd8,_0x3471a2))[_0x7236('0x2d')](handleError(_0x3b4cd8,null));};exports['addAgents']=function(_0x54a501,_0x4dc42f,_0x473f6b){return db[_0x7236('0x43')][_0x7236('0x5c')]({'where':{'id':_0x54a501[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x4dc42f,null))[_0x7236('0x36')](function(_0x1323d0){if(_0x1323d0){return _0x1323d0[_0x7236('0xb5')](_0x54a501[_0x7236('0x5e')]['ids'],_[_0x7236('0xb6')](_0x54a501[_0x7236('0x5e')],['ids','id'])||{})[_0x7236('0xb7')](function(_0x5b6cb4){for(var _0x625096=0x0;_0x625096<_0x54a501[_0x7236('0x5e')]['ids']['length'];_0x625096+=0x1){socket[_0x7236('0xb8')](_0x7236('0xb9'),{'UserId':Number(_0x54a501[_0x7236('0x5e')][_0x7236('0x71')][_0x625096]),'OpenchannelAccountId':Number(_0x54a501[_0x7236('0x5b')]['id'])});}return _0x5b6cb4;});}})['then'](respondWithResult(_0x4dc42f,null))[_0x7236('0x2d')](handleError(_0x4dc42f,null));};exports[_0x7236('0xba')]=function(_0x1798bf,_0x2e6b60,_0x96d875){return db[_0x7236('0x43')][_0x7236('0x5c')]({'where':{'id':_0x1798bf[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x2e6b60,null))['then'](function(_0x2535bb){if(_0x2535bb){return _0x2535bb[_0x7236('0xba')](_0x1798bf['query']['ids'])[_0x7236('0x36')](function(){if(_['isArray'](_0x1798bf[_0x7236('0x49')][_0x7236('0x71')])){for(var _0x18380c=0x0;_0x18380c<_0x1798bf['query'][_0x7236('0x71')][_0x7236('0x4e')];_0x18380c+=0x1){socket[_0x7236('0xb8')](_0x7236('0xbb'),{'UserId':Number(_0x1798bf['query'][_0x7236('0x71')][_0x18380c]),'OpenchannelAccountId':Number(_0x1798bf[_0x7236('0x5b')]['id'])});}}else{socket[_0x7236('0xb8')](_0x7236('0xbb'),{'UserId':Number(_0x1798bf[_0x7236('0x49')]['ids']),'OpenchannelAccountId':Number(_0x1798bf[_0x7236('0x5b')]['id'])});}});}})[_0x7236('0x36')](respondWithStatusCode(_0x2e6b60,null))[_0x7236('0x2d')](handleError(_0x2e6b60,null));};exports['getAgents']=function(_0x3485e4,_0x477c28,_0x4bdbdf){var _0x54d254={};var _0xdc8125={};var _0x3475c6;var _0x462d20;return db[_0x7236('0x43')][_0x7236('0x6c')]({'where':{'id':_0x3485e4[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x477c28,null))[_0x7236('0x36')](function(_0x4399d2){if(_0x4399d2){_0x3475c6=_0x4399d2;_0xdc8125[_0x7236('0x47')]=_['keys'](db[_0x7236('0xb0')][_0x7236('0x44')]);_0xdc8125[_0x7236('0x49')]=_['keys'](_0x3485e4[_0x7236('0x49')]);_0xdc8125[_0x7236('0x4a')]=_[_0x7236('0x4b')](_0xdc8125['model'],_0xdc8125[_0x7236('0x49')]);_0x54d254[_0x7236('0x4d')]=_[_0x7236('0x4b')](_0xdc8125[_0x7236('0x47')],qs[_0x7236('0x4c')](_0x3485e4['query'][_0x7236('0x4c')]));_0x54d254[_0x7236('0x4d')]=_0x54d254['attributes']['length']?_0x54d254[_0x7236('0x4d')]:_0xdc8125[_0x7236('0x47')];_0x54d254[_0x7236('0x6e')]=qs[_0x7236('0x50')](_0x3485e4[_0x7236('0x49')][_0x7236('0x50')]);_0x54d254[_0x7236('0x51')]=qs['filters'](_['pick'](_0x3485e4[_0x7236('0x49')],_0xdc8125[_0x7236('0x4a')]));if(_0x3485e4[_0x7236('0x49')][_0x7236('0x55')]){_0x54d254[_0x7236('0x51')]=_['merge'](_0x54d254[_0x7236('0x51')],{'$or':_[_0x7236('0x42')](_0x54d254[_0x7236('0x4d')],function(_0x29f7ad){var _0x4e61be={};_0x4e61be[_0x29f7ad]={'$like':'%'+_0x3485e4[_0x7236('0x49')][_0x7236('0x55')]+'%'};return _0x4e61be;})});}_0x54d254=_[_0x7236('0x53')]({},_0x54d254,_0x3485e4['options']);return _0x3475c6['getAgents'](_0x54d254);}})['then'](function(_0x2ac2fa){if(_0x2ac2fa){_0x462d20=_0x2ac2fa[_0x7236('0x4e')];if(!_0x3485e4[_0x7236('0x49')]['hasOwnProperty'](_0x7236('0x4f'))){_0x54d254['limit']=qs[_0x7236('0x32')](_0x3485e4['query'][_0x7236('0x32')]);_0x54d254[_0x7236('0x31')]=qs['offset'](_0x3485e4['query'][_0x7236('0x31')]);}return _0x3475c6[_0x7236('0xbc')](_0x54d254);}})[_0x7236('0x36')](function(_0x284fbe){if(_0x284fbe){return _0x284fbe?{'count':_0x462d20,'rows':_0x284fbe}:null;}})[_0x7236('0x36')](respondWithResult(_0x477c28,null))[_0x7236('0x2d')](handleError(_0x477c28,null));};exports[_0x7236('0x3e')]=function(_0x3bbab8,_0x381a05,_0x17131d){var _0x1d0495,_0x255c53,_0x594f0b;if(_[_0x7236('0x7d')](_0x3bbab8[_0x7236('0x5e')][_0x7236('0x5e')])||_0x3bbab8['body']['body']===''){throw new db[(_0x7236('0x7f'))][(_0x7236('0x80'))](_0x7236('0xbd'));}if(_[_0x7236('0x7d')](_0x3bbab8[_0x7236('0x5e')]['to'])){}_0x1d0495=_0x3bbab8[_0x7236('0x5e')]['to'];return db[_0x7236('0x43')][_0x7236('0x6c')]({'where':{'id':_0x3bbab8[_0x7236('0x5b')]['id']}})[_0x7236('0x36')](handleEntityNotFound(_0x381a05,null))[_0x7236('0x36')](function(_0x1bb580){if(_0x1bb580){return db[_0x7236('0x43')]['find']({'where':{'id':_0x1bb580['id']},'include':[{'model':db[_0x7236('0x86')],'as':_0x7236('0x87'),'include':[{'model':db['CmContact'],'as':_0x7236('0x88'),'where':{[_0x1bb580[_0x7236('0x82')]]:_0x1d0495},'limit':0x1,'order':[[_0x7236('0x7b'),_0x7236('0x89')]]}]}]})[_0x7236('0x36')](handleEntityNotFound(_0x381a05,null))[_0x7236('0x36')](function(_0x13505){if(_0x13505&&_0x13505[_0x7236('0x87')]){_0x255c53=_0x13505[_0x7236('0x37')]({'plain':!![]});if(_0x255c53[_0x7236('0x87')]&&_0x255c53[_0x7236('0x87')][_0x7236('0x88')]['length']){return _0x255c53[_0x7236('0x87')][_0x7236('0x88')][0x0];}return db['CmContact'][_0x7236('0x5d')](_[_0x7236('0x1c')](_0x3bbab8['body'],{'firstName':_0x1d0495,[_0x13505['mapKey']]:_0x1d0495,'phone':_0x1d0495,'ListId':_0x255c53['ListId']}));}})[_0x7236('0x36')](handleEntityNotFound(_0x381a05,null))[_0x7236('0x36')](function(_0x2de8e5){if(_0x2de8e5){_0x594f0b=_0x2de8e5;return db['OpenchannelInteraction'][_0x7236('0x5c')]({'where':{'ContactId':_0x594f0b['id'],'closed':![],'OpenchannelAccountId':_0x255c53['id']}})[_0x7236('0x36')](function(_0x148aec){if(_0x148aec){return[_0x148aec,![]];}return db['OpenchannelInteraction'][_0x7236('0x5d')]({'UserId':_0x3bbab8[_0x7236('0x60')]['id'],'ContactId':_0x594f0b['id'],'OpenchannelAccountId':_0x255c53['id'],'lastMsgDirection':_0x7236('0xbe'),'firstMsgDirection':'out','Messages':[_[_0x7236('0x53')](_0x3bbab8[_0x7236('0x5e')],{'read':![],'body':_0x3bbab8[_0x7236('0x5e')][_0x7236('0x5e')],'OpenchannelAccountId':_0x255c53['id'],'UserId':_0x3bbab8['user']['id'],'ContactId':_0x594f0b['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x7236('0xbf')}]})[_0x7236('0x36')](function(_0x3a8cd0){return[_0x3a8cd0,!![]];});});}})[_0x7236('0xb7')](function(_0x5d801e,_0x2666b2){if(_0x2666b2){return _0x5d801e;}return db['OpenchannelMessage'][_0x7236('0x5d')](_[_0x7236('0x53')](_0x3bbab8[_0x7236('0x5e')],{'read':![],'body':_0x3bbab8['body'][_0x7236('0x5e')],'OpenchannelAccountId':_0x255c53['id'],'OpenchannelInteractionId':_0x5d801e['id'],'UserId':_0x3bbab8[_0x7236('0x60')]['id'],'ContactId':_0x594f0b['id']}))[_0x7236('0x36')](function(_0x574aa0){_0x5d801e['dataValues']['Messages']=[];_0x5d801e[_0x7236('0xc0')][_0x7236('0xbf')]['push'](_0x574aa0['dataValues']);return _0x5d801e;});});}})[_0x7236('0x36')](respondWithResult(_0x381a05,null))[_0x7236('0x2d')](handleError(_0x381a05,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 7301f0a..4b38db3 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 _0xa571=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa571,0x107));var _0x1a57=function(_0x36aa79,_0x13d6f4){_0x36aa79=_0x36aa79-0x0;var _0x53c302=_0xa571[_0x36aa79];return _0x53c302;};'use strict';var EventEmitter=require(_0x1a57('0x0'));var OpenchannelAccount=require(_0x1a57('0x1'))['db'][_0x1a57('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1a57('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a57('0x4'),'afterDestroy':_0x1a57('0x5')};function emitEvent(_0x4d5f7a){return function(_0x5ec815,_0x1f2c44,_0x5067fa){OpenchannelAccountEvents[_0x1a57('0x6')](_0x4d5f7a+':'+_0x5ec815['id'],_0x5ec815);OpenchannelAccountEvents[_0x1a57('0x6')](_0x4d5f7a,_0x5ec815);_0x5067fa(null);};}for(var e in events){if(events[_0x1a57('0x7')](e)){var event=events[e];OpenchannelAccount[_0x1a57('0x8')](e,emitEvent(event));}}module[_0x1a57('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xac4a=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hook','events'];(function(_0x574bab,_0x5bc81d){var _0xba77bb=function(_0x3c68c2){while(--_0x3c68c2){_0x574bab['push'](_0x574bab['shift']());}};_0xba77bb(++_0x5bc81d);}(_0xac4a,0x13f));var _0xaac4=function(_0x558afc,_0x45d7c5){_0x558afc=_0x558afc-0x0;var _0x454d6d=_0xac4a[_0x558afc];return _0x454d6d;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var OpenchannelAccount=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){OpenchannelAccountEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);OpenchannelAccountEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 48d9c71..bf668a5 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(_0x43653f,_0x21a692){var _0x4712ad=function(_0xcbc411){while(--_0xcbc411){_0x43653f['push'](_0x43653f['shift']());}};_0x4712ad(++_0x21a692);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x39204b,_0x95a910){var _0x213ea8=function(_0x1b050c){while(--_0x1b050c){_0x39204b['push'](_0x39204b['shift']());}};_0x213ea8(++_0x95a910);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 a0f1ec0..314789c 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 _0x2e54=['client','http','defaults','localhost','redis','./openchannelAccount.socket','register','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2d3c17,_0x54e4f1){var _0x316218=function(_0x300c53){while(--_0x300c53){_0x2d3c17['push'](_0x2d3c17['shift']());}};_0x316218(++_0x54e4f1);}(_0x2e54,0x1dd));var _0x42e5=function(_0x302691,_0x1f14ab){_0x302691=_0x302691-0x0;var _0x10d80d=_0x2e54[_0x302691];return _0x10d80d;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42e5('0x1'));var rs=require(_0x42e5('0x2'));var fs=require('fs');var Redis=require(_0x42e5('0x3'));var db=require(_0x42e5('0x4'))['db'];var utils=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x42e5('0x8'));var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});config['redis']=_[_0x42e5('0xb')](config['redis'],{'host':_0x42e5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42e5('0xd')]));require(_0x42e5('0xe'))[_0x42e5('0xf')](socket);function respondWithRpcPromise(_0x15f9f1,_0x206bf3,_0x1e5d2d){return new BPromise(function(_0xe1ab4b,_0x2fa2f0){return client[_0x42e5('0x10')](_0x15f9f1,_0x1e5d2d)['then'](function(_0x456298){logger[_0x42e5('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x206bf3,_0x42e5('0x12'));logger[_0x42e5('0x13')](_0x42e5('0x14'),_0x206bf3,_0x42e5('0x12'),JSON[_0x42e5('0x15')](_0x456298));if(_0x456298[_0x42e5('0x16')]){if(_0x456298[_0x42e5('0x16')][_0x42e5('0x17')]===0x1f4){logger[_0x42e5('0x16')](_0x42e5('0x18'),_0x206bf3,_0x456298['error'][_0x42e5('0x19')]);return _0x2fa2f0(_0x456298[_0x42e5('0x16')][_0x42e5('0x19')]);}logger[_0x42e5('0x16')](_0x42e5('0x18'),_0x206bf3,_0x456298[_0x42e5('0x16')][_0x42e5('0x19')]);return _0xe1ab4b(_0x456298[_0x42e5('0x16')][_0x42e5('0x19')]);}else{logger[_0x42e5('0x11')](_0x42e5('0x18'),_0x206bf3,_0x42e5('0x12'));_0xe1ab4b(_0x456298[_0x42e5('0x1a')][_0x42e5('0x19')]);}})['catch'](function(_0x1460c0){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x206bf3,_0x1460c0);_0x2fa2f0(_0x1460c0);});});} \ No newline at end of file +var _0xee5b=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x888dc8,_0x3fabbd){var _0x400c40=function(_0x3e6643){while(--_0x3e6643){_0x888dc8['push'](_0x888dc8['shift']());}};_0x400c40(++_0x3fabbd);}(_0xee5b,0x1f4));var _0xbee5=function(_0x6a2956,_0x567b83){_0x6a2956=_0x6a2956-0x0;var _0x23a9d2=_0xee5b[_0x6a2956];return _0x23a9d2;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});config[_0xbee5('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbee5('0xb'))[_0xbee5('0xc')](socket);function respondWithRpcPromise(_0x45c2c7,_0x20f717,_0x4a15bf){return new BPromise(function(_0x143bd6,_0x305921){return client[_0xbee5('0xd')](_0x45c2c7,_0x4a15bf)[_0xbee5('0xe')](function(_0x16377d){logger[_0xbee5('0xf')](_0xbee5('0x10'),_0x20f717,_0xbee5('0x11'));logger[_0xbee5('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x20f717,_0xbee5('0x11'),JSON['stringify'](_0x16377d));if(_0x16377d[_0xbee5('0x13')]){if(_0x16377d[_0xbee5('0x13')][_0xbee5('0x14')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x20f717,_0x16377d[_0xbee5('0x13')]['message']);return _0x305921(_0x16377d[_0xbee5('0x13')]['message']);}logger[_0xbee5('0x13')](_0xbee5('0x10'),_0x20f717,_0x16377d[_0xbee5('0x13')]['message']);return _0x143bd6(_0x16377d[_0xbee5('0x13')][_0xbee5('0x15')]);}else{logger['info'](_0xbee5('0x10'),_0x20f717,_0xbee5('0x11'));_0x143bd6(_0x16377d[_0xbee5('0x16')][_0xbee5('0x15')]);}})[_0xbee5('0x17')](function(_0xac51f5){logger[_0xbee5('0x13')](_0xbee5('0x10'),_0x20f717,_0xac51f5);_0x305921(_0xac51f5);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index bee32ba..872d01e 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 _0xdb13=['length','openchannelAccount:','save','remove','update','removeListener','register'];(function(_0x340756,_0xad31ae){var _0x2ef745=function(_0x59ffde){while(--_0x59ffde){_0x340756['push'](_0x340756['shift']());}};_0x2ef745(++_0xad31ae);}(_0xdb13,0x10c));var _0x3db1=function(_0x460a4d,_0x619736){_0x460a4d=_0x460a4d-0x0;var _0x2421c4=_0xdb13[_0x460a4d];return _0x2421c4;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x3db1('0x0'),_0x3db1('0x1'),_0x3db1('0x2')];function createListener(_0x28e569,_0x32468d){return function(_0xd23f18){_0x32468d['emit'](_0x28e569,_0xd23f18);};}function removeListener(_0x3352e3,_0x41fb5d){return function(){OpenchannelAccountEvents[_0x3db1('0x3')](_0x3352e3,_0x41fb5d);};}exports[_0x3db1('0x4')]=function(_0x342b84){for(var _0x5a2345=0x0,_0x37ae52=events[_0x3db1('0x5')];_0x5a2345<_0x37ae52;_0x5a2345++){var _0x28e7b6=events[_0x5a2345];var _0x379cfb=createListener(_0x3db1('0x6')+_0x28e7b6,_0x342b84);OpenchannelAccountEvents['on'](_0x28e7b6,_0x379cfb);}}; \ No newline at end of file +var _0x5f6a=['length','./openchannelAccount.events','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x25b6c8,_0x48daf5){_0x25b6c8=_0x25b6c8-0x0;var _0x42afce=_0x5f6a[_0x25b6c8];return _0x42afce;};'use strict';var OpenchannelAccountEvents=require(_0xa5f6('0x0'));var events=['save','remove',_0xa5f6('0x1')];function createListener(_0x4be333,_0x2e23f3){return function(_0x1ec17a){_0x2e23f3['emit'](_0x4be333,_0x1ec17a);};}function removeListener(_0x2e8b33,_0x8e175a){return function(){OpenchannelAccountEvents[_0xa5f6('0x2')](_0x2e8b33,_0x8e175a);};}exports[_0xa5f6('0x3')]=function(_0xb6a42e){for(var _0x9c569c=0x0,_0x19ac7d=events[_0xa5f6('0x4')];_0x9c569c<_0x19ac7d;_0x9c569c++){var _0x2505d7=events[_0x9c569c];var _0x135782=createListener('openchannelAccount:'+_0x2505d7,_0xb6a42e);OpenchannelAccountEvents['on'](_0x2505d7,_0x135782);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 28e6831..0b6b91c 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 _0x340f=['/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index'];(function(_0x5b3a3c,_0x5a8e66){var _0x282066=function(_0x545e7d){while(--_0x545e7d){_0x5b3a3c['push'](_0x5b3a3c['shift']());}};_0x282066(++_0x5a8e66);}(_0x340f,0x169));var _0xf340=function(_0x4e3ee5,_0xb403b8){_0x4e3ee5=_0x4e3ee5-0x0;var _0x3c04d0=_0x340f[_0x4e3ee5];return _0x3c04d0;};'use strict';var multer=require(_0xf340('0x0'));var util=require(_0xf340('0x1'));var path=require(_0xf340('0x2'));var timeout=require(_0xf340('0x3'));var express=require(_0xf340('0x4'));var router=express[_0xf340('0x5')]();var fs_extra=require(_0xf340('0x6'));var auth=require(_0xf340('0x7'));var interaction=require(_0xf340('0x8'));var config=require(_0xf340('0x9'));var controller=require(_0xf340('0xa'));router[_0xf340('0xb')]('/',auth['isAuthenticated'](),controller[_0xf340('0xc')]);router[_0xf340('0xb')](_0xf340('0xd'),auth[_0xf340('0xe')](),controller[_0xf340('0xf')]);router[_0xf340('0x10')]('/',auth[_0xf340('0xe')](),controller[_0xf340('0x11')]);router[_0xf340('0x12')](_0xf340('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf340('0x13')](_0xf340('0xd'),auth[_0xf340('0xe')](),controller[_0xf340('0x14')]);module[_0xf340('0x15')]=router; \ No newline at end of file +var _0xa501=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x774f79,_0x289437){var _0x7166b0=function(_0x58c91c){while(--_0x58c91c){_0x774f79['push'](_0x774f79['shift']());}};_0x7166b0(++_0x289437);}(_0xa501,0xa4));var _0x1a50=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0xa501[_0x5ef55a];return _0x20ae40;};'use strict';var multer=require(_0x1a50('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1a50('0x1'));var express=require(_0x1a50('0x2'));var router=express[_0x1a50('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1a50('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1a50('0x5'));var controller=require(_0x1a50('0x6'));router[_0x1a50('0x7')]('/',auth[_0x1a50('0x8')](),controller[_0x1a50('0x9')]);router[_0x1a50('0x7')](_0x1a50('0xa'),auth[_0x1a50('0x8')](),controller[_0x1a50('0xb')]);router[_0x1a50('0xc')]('/',auth[_0x1a50('0x8')](),controller[_0x1a50('0xd')]);router[_0x1a50('0xe')]('/:id',auth[_0x1a50('0x8')](),controller[_0x1a50('0xf')]);router['delete'](_0x1a50('0xa'),auth['isAuthenticated'](),controller[_0x1a50('0x10')]);module[_0x1a50('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 40bfb0a..17efdd6 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 _0x64cd=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x139c11,_0x14d496){var _0x5545c1=function(_0xd3c71d){while(--_0xd3c71d){_0x139c11['push'](_0x139c11['shift']());}};_0x5545c1(++_0x14d496);}(_0x64cd,0x194));var _0xd64c=function(_0x4a34e0,_0x29ff2f){_0x4a34e0=_0x4a34e0-0x0;var _0xb5ce1d=_0x64cd[_0x4a34e0];return _0xb5ce1d;};'use strict';var Sequelize=require(_0xd64c('0x0'));module[_0xd64c('0x1')]={'priority':{'type':Sequelize[_0xd64c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd64c('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd64c('0x4')]},'interval':{'type':Sequelize[_0xd64c('0x4')],'defaultValue':_0xd64c('0x5')}}; \ No newline at end of file +var _0xb3a6=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb3a6,0x146));var _0x6b3a=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xb3a6[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x6b3a('0x0'));module[_0x6b3a('0x1')]={'priority':{'type':Sequelize[_0x6b3a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6b3a('0x3')],'allowNull':![],'defaultValue':_0x6b3a('0x4')},'appdata':{'type':Sequelize[_0x6b3a('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index bf735d7..3d1712f 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 _0x3426=['util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','map','OpenchannelApplication','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1042f7,_0x4650e4){var _0x1f4219=function(_0x1ff3a0){while(--_0x1ff3a0){_0x1042f7['push'](_0x1042f7['shift']());}};_0x1f4219(++_0x4650e4);}(_0x3426,0x1ae));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6342('0x0'));var rimraf=require(_0x6342('0x1'));var zipdir=require(_0x6342('0x2'));var jsonpatch=require(_0x6342('0x3'));var rp=require(_0x6342('0x4'));var moment=require(_0x6342('0x5'));var BPromise=require(_0x6342('0x6'));var Mustache=require(_0x6342('0x7'));var util=require(_0x6342('0x8'));var path=require('path');var sox=require(_0x6342('0x9'));var csv=require(_0x6342('0xa'));var ejs=require(_0x6342('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6342('0xc'));var crypto=require(_0x6342('0xd'));var jsforce=require(_0x6342('0xe'));var deskjs=require(_0x6342('0xf'));var toCsv=require(_0x6342('0xa'));var querystring=require(_0x6342('0x10'));var Papa=require('papaparse');var Redis=require(_0x6342('0x11'));var authService=require(_0x6342('0x12'));var qs=require(_0x6342('0x13'));var as=require(_0x6342('0x14'));var hardwareService=require(_0x6342('0x15'));var logger=require(_0x6342('0x16'))(_0x6342('0x17'));var utils=require('../../config/utils');var config=require(_0x6342('0x18'));var licenseUtil=require(_0x6342('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b92ef,_0x3894d1){_0x3894d1=_0x3894d1||0xcc;return function(_0x126e26){if(_0x126e26){return _0x3b92ef[_0x6342('0x1a')](_0x3894d1);}return _0x3b92ef[_0x6342('0x1b')](_0x3894d1)[_0x6342('0x1c')]();};}function respondWithResult(_0x328925,_0x38dd67){_0x38dd67=_0x38dd67||0xc8;return function(_0x26c60d){if(_0x26c60d){return _0x328925[_0x6342('0x1b')](_0x38dd67)[_0x6342('0x1d')](_0x26c60d);}};}function respondWithFilteredResult(_0x4a51bb,_0x2e8e7e){return function(_0xd6843a){if(_0xd6843a){var _0x242eb5=typeof _0x2e8e7e[_0x6342('0x1e')]===_0x6342('0x1f')&&typeof _0x2e8e7e['limit']==='undefined';var _0x40f823=_0xd6843a['count'];var _0x55f5f0=_0x242eb5?0x0:_0x2e8e7e[_0x6342('0x1e')];var _0x2de7c3=_0x242eb5?_0xd6843a[_0x6342('0x20')]:_0x2e8e7e['offset']+_0x2e8e7e[_0x6342('0x21')];var _0x180e1b;if(_0x2de7c3>=_0x40f823){_0x2de7c3=_0x40f823;_0x180e1b=0xc8;}else{_0x180e1b=0xce;}_0x4a51bb[_0x6342('0x1b')](_0x180e1b);return _0x4a51bb['set'](_0x6342('0x22'),_0x55f5f0+'-'+_0x2de7c3+'/'+_0x40f823)[_0x6342('0x1d')](_0xd6843a);}return null;};}function patchUpdates(_0x3e08bc){return function(_0x1fd240){try{jsonpatch[_0x6342('0x23')](_0x1fd240,_0x3e08bc,!![]);}catch(_0x4ed907){return BPromise[_0x6342('0x24')](_0x4ed907);}return _0x1fd240['save']();};}function saveUpdates(_0x86901e,_0x1845a7){return function(_0x14a360){if(_0x14a360){return _0x14a360[_0x6342('0x25')](_0x86901e)[_0x6342('0x26')](function(_0x3cba05){return _0x3cba05;});}return null;};}function removeEntity(_0x55a94c,_0x3f2693){return function(_0x59d6be){if(_0x59d6be){return _0x59d6be[_0x6342('0x27')]()[_0x6342('0x26')](function(){_0x55a94c[_0x6342('0x1b')](0xcc)[_0x6342('0x1c')]();});}};}function handleEntityNotFound(_0x1cfc77,_0x5a40b6){return function(_0x2e7f60){if(!_0x2e7f60){_0x1cfc77[_0x6342('0x1a')](0x194);}return _0x2e7f60;};}function handleError(_0x2bc688,_0x39664e){_0x39664e=_0x39664e||0x1f4;return function(_0x258a0b){logger[_0x6342('0x28')](_0x258a0b['stack']);if(_0x258a0b['name']){delete _0x258a0b['name'];}_0x2bc688['status'](_0x39664e)['send'](_0x258a0b);};}exports['index']=function(_0x231825,_0x122b53){var _0x442315={},_0x1d9461={},_0x127b99={'count':0x0,'rows':[]};var _0x11cfe7=_[_0x6342('0x29')](db[_0x6342('0x2a')]['rawAttributes'],function(_0x439de0){return{'name':_0x439de0[_0x6342('0x2b')],'type':_0x439de0[_0x6342('0x2c')]['key']};});_0x1d9461[_0x6342('0x2d')]=_[_0x6342('0x29')](_0x11cfe7,_0x6342('0x2e'));_0x1d9461[_0x6342('0x2f')]=_[_0x6342('0x30')](_0x231825[_0x6342('0x2f')]);_0x1d9461[_0x6342('0x31')]=_[_0x6342('0x32')](_0x1d9461['model'],_0x1d9461['query']);_0x442315[_0x6342('0x33')]=_[_0x6342('0x32')](_0x1d9461[_0x6342('0x2d')],qs[_0x6342('0x34')](_0x231825[_0x6342('0x2f')]['fields']));_0x442315[_0x6342('0x33')]=_0x442315[_0x6342('0x33')][_0x6342('0x35')]?_0x442315[_0x6342('0x33')]:_0x1d9461['model'];if(!_0x231825[_0x6342('0x2f')][_0x6342('0x36')](_0x6342('0x37'))){_0x442315[_0x6342('0x21')]=qs[_0x6342('0x21')](_0x231825['query'][_0x6342('0x21')]);_0x442315[_0x6342('0x1e')]=qs[_0x6342('0x1e')](_0x231825[_0x6342('0x2f')][_0x6342('0x1e')]);}_0x442315[_0x6342('0x38')]=qs[_0x6342('0x39')](_0x231825[_0x6342('0x2f')][_0x6342('0x39')]);_0x442315[_0x6342('0x3a')]=qs[_0x6342('0x31')](_['pick'](_0x231825[_0x6342('0x2f')],_0x1d9461['filters']),_0x11cfe7);if(_0x231825[_0x6342('0x2f')][_0x6342('0x3b')]){_0x442315['where']=_['merge'](_0x442315[_0x6342('0x3a')],{'$or':_[_0x6342('0x29')](_0x11cfe7,function(_0x130d3a){if(_0x130d3a[_0x6342('0x2c')]!=='VIRTUAL'){var _0x1582d1={};_0x1582d1[_0x130d3a['name']]={'$like':'%'+_0x231825[_0x6342('0x2f')][_0x6342('0x3b')]+'%'};return _0x1582d1;}})});}_0x442315=_[_0x6342('0x3c')]({},_0x442315,_0x231825[_0x6342('0x3d')]);var _0x37f685={'where':_0x442315[_0x6342('0x3a')]};return db[_0x6342('0x2a')][_0x6342('0x20')](_0x37f685)[_0x6342('0x26')](function(_0x237148){_0x127b99[_0x6342('0x20')]=_0x237148;if(_0x231825[_0x6342('0x2f')]['includeAll']){_0x442315[_0x6342('0x3e')]=[{'all':!![]}];}return db[_0x6342('0x2a')][_0x6342('0x3f')](_0x442315);})['then'](function(_0x54cbc1){_0x127b99[_0x6342('0x40')]=_0x54cbc1;return _0x127b99;})[_0x6342('0x26')](respondWithFilteredResult(_0x122b53,_0x442315))[_0x6342('0x41')](handleError(_0x122b53,null));};exports[_0x6342('0x42')]=function(_0x41e316,_0x42093b){var _0xfeee6a={'raw':!![],'where':{'id':_0x41e316[_0x6342('0x43')]['id']}},_0x3e46cb={};_0x3e46cb[_0x6342('0x2d')]=_[_0x6342('0x30')](db[_0x6342('0x2a')][_0x6342('0x44')]);_0x3e46cb[_0x6342('0x2f')]=_[_0x6342('0x30')](_0x41e316[_0x6342('0x2f')]);_0x3e46cb[_0x6342('0x31')]=_['intersection'](_0x3e46cb[_0x6342('0x2d')],_0x3e46cb['query']);_0xfeee6a[_0x6342('0x33')]=_[_0x6342('0x32')](_0x3e46cb[_0x6342('0x2d')],qs[_0x6342('0x34')](_0x41e316['query'][_0x6342('0x34')]));_0xfeee6a[_0x6342('0x33')]=_0xfeee6a[_0x6342('0x33')][_0x6342('0x35')]?_0xfeee6a[_0x6342('0x33')]:_0x3e46cb[_0x6342('0x2d')];if(_0x41e316['query'][_0x6342('0x45')]){_0xfeee6a[_0x6342('0x3e')]=[{'all':!![]}];}_0xfeee6a=_[_0x6342('0x3c')]({},_0xfeee6a,_0x41e316['options']);return db[_0x6342('0x2a')][_0x6342('0x46')](_0xfeee6a)[_0x6342('0x26')](handleEntityNotFound(_0x42093b,null))[_0x6342('0x26')](respondWithResult(_0x42093b,null))[_0x6342('0x41')](handleError(_0x42093b,null));};exports[_0x6342('0x47')]=function(_0x195945,_0x2ff16e){return db[_0x6342('0x2a')][_0x6342('0x47')](_0x195945[_0x6342('0x48')],{})[_0x6342('0x26')](respondWithResult(_0x2ff16e,0xc9))[_0x6342('0x41')](handleError(_0x2ff16e,null));};exports[_0x6342('0x25')]=function(_0x5ead58,_0x1663d9){if(_0x5ead58['body']['id']){delete _0x5ead58['body']['id'];}return db[_0x6342('0x2a')][_0x6342('0x46')]({'where':{'id':_0x5ead58['params']['id']}})[_0x6342('0x26')](handleEntityNotFound(_0x1663d9,null))[_0x6342('0x26')](saveUpdates(_0x5ead58[_0x6342('0x48')],null))[_0x6342('0x26')](respondWithResult(_0x1663d9,null))[_0x6342('0x41')](handleError(_0x1663d9,null));};exports[_0x6342('0x27')]=function(_0x41db3c,_0x335d04){return db[_0x6342('0x2a')][_0x6342('0x46')]({'where':{'id':_0x41db3c[_0x6342('0x43')]['id']}})['then'](handleEntityNotFound(_0x335d04,null))[_0x6342('0x26')](removeEntity(_0x335d04,null))[_0x6342('0x41')](handleError(_0x335d04,null));}; \ No newline at end of file +var _0xa503=['options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','update','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','error','stack','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge'];(function(_0x503713,_0x1dd8b3){var _0x298fe0=function(_0x423870){while(--_0x423870){_0x503713['push'](_0x503713['shift']());}};_0x298fe0(++_0x1dd8b3);}(_0xa503,0x1c9));var _0x3a50=function(_0x1de1c1,_0xb1090d){_0x1de1c1=_0x1de1c1-0x0;var _0x43fe24=_0xa503[_0x1de1c1];return _0x43fe24;};'use strict';var emlformat=require(_0x3a50('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a50('0x1'));var rp=require(_0x3a50('0x2'));var moment=require('moment');var BPromise=require(_0x3a50('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a50('0x4'));var sox=require(_0x3a50('0x5'));var csv=require(_0x3a50('0x6'));var ejs=require(_0x3a50('0x7'));var fs=require('fs');var fs_extra=require(_0x3a50('0x8'));var _=require(_0x3a50('0x9'));var squel=require(_0x3a50('0xa'));var crypto=require('crypto');var jsforce=require(_0x3a50('0xb'));var deskjs=require(_0x3a50('0xc'));var toCsv=require(_0x3a50('0x6'));var querystring=require(_0x3a50('0xd'));var Papa=require(_0x3a50('0xe'));var Redis=require(_0x3a50('0xf'));var authService=require(_0x3a50('0x10'));var qs=require(_0x3a50('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a50('0x12'));var logger=require('../../config/logger')(_0x3a50('0x13'));var utils=require(_0x3a50('0x14'));var config=require(_0x3a50('0x15'));var licenseUtil=require(_0x3a50('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x331da9,_0x5c98a8){_0x5c98a8=_0x5c98a8||0xcc;return function(_0x16631c){if(_0x16631c){return _0x331da9[_0x3a50('0x17')](_0x5c98a8);}return _0x331da9['status'](_0x5c98a8)[_0x3a50('0x18')]();};}function respondWithResult(_0x188e06,_0x44aab0){_0x44aab0=_0x44aab0||0xc8;return function(_0x53ca63){if(_0x53ca63){return _0x188e06[_0x3a50('0x19')](_0x44aab0)[_0x3a50('0x1a')](_0x53ca63);}};}function respondWithFilteredResult(_0x64925e,_0x3bdfc2){return function(_0x542f34){if(_0x542f34){var _0x18f868=typeof _0x3bdfc2[_0x3a50('0x1b')]===_0x3a50('0x1c')&&typeof _0x3bdfc2[_0x3a50('0x1d')]===_0x3a50('0x1c');var _0x1ce3ca=_0x542f34['count'];var _0xb56d50=_0x18f868?0x0:_0x3bdfc2['offset'];var _0x114ca5=_0x18f868?_0x542f34[_0x3a50('0x1e')]:_0x3bdfc2[_0x3a50('0x1b')]+_0x3bdfc2[_0x3a50('0x1d')];var _0x490bee;if(_0x114ca5>=_0x1ce3ca){_0x114ca5=_0x1ce3ca;_0x490bee=0xc8;}else{_0x490bee=0xce;}_0x64925e[_0x3a50('0x19')](_0x490bee);return _0x64925e['set'](_0x3a50('0x1f'),_0xb56d50+'-'+_0x114ca5+'/'+_0x1ce3ca)['json'](_0x542f34);}return null;};}function patchUpdates(_0x11aca6){return function(_0x467cfa){try{jsonpatch['apply'](_0x467cfa,_0x11aca6,!![]);}catch(_0x498ace){return BPromise[_0x3a50('0x20')](_0x498ace);}return _0x467cfa[_0x3a50('0x21')]();};}function saveUpdates(_0x8b7d8,_0x1f6359){return function(_0x20c8c5){if(_0x20c8c5){return _0x20c8c5['update'](_0x8b7d8)[_0x3a50('0x22')](function(_0x162f61){return _0x162f61;});}return null;};}function removeEntity(_0x59f82f,_0x4c6b97){return function(_0x353b49){if(_0x353b49){return _0x353b49[_0x3a50('0x23')]()['then'](function(){_0x59f82f[_0x3a50('0x19')](0xcc)[_0x3a50('0x18')]();});}};}function handleEntityNotFound(_0x1b9aec,_0x44811e){return function(_0x393e95){if(!_0x393e95){_0x1b9aec[_0x3a50('0x17')](0x194);}return _0x393e95;};}function handleError(_0x2bcc0e,_0xdf815f){_0xdf815f=_0xdf815f||0x1f4;return function(_0x3e6670){logger[_0x3a50('0x24')](_0x3e6670[_0x3a50('0x25')]);if(_0x3e6670['name']){delete _0x3e6670['name'];}_0x2bcc0e[_0x3a50('0x19')](_0xdf815f)[_0x3a50('0x26')](_0x3e6670);};}exports['index']=function(_0x179068,_0x3b8207){var _0x41b821={},_0x1e8fd6={},_0x86de10={'count':0x0,'rows':[]};var _0x4754f8=_[_0x3a50('0x27')](db[_0x3a50('0x28')][_0x3a50('0x29')],function(_0x5adc9){return{'name':_0x5adc9[_0x3a50('0x2a')],'type':_0x5adc9[_0x3a50('0x2b')][_0x3a50('0x2c')]};});_0x1e8fd6['model']=_[_0x3a50('0x27')](_0x4754f8,_0x3a50('0x2d'));_0x1e8fd6[_0x3a50('0x2e')]=_[_0x3a50('0x2f')](_0x179068['query']);_0x1e8fd6['filters']=_[_0x3a50('0x30')](_0x1e8fd6[_0x3a50('0x31')],_0x1e8fd6[_0x3a50('0x2e')]);_0x41b821[_0x3a50('0x32')]=_['intersection'](_0x1e8fd6[_0x3a50('0x31')],qs[_0x3a50('0x33')](_0x179068[_0x3a50('0x2e')][_0x3a50('0x33')]));_0x41b821[_0x3a50('0x32')]=_0x41b821[_0x3a50('0x32')]['length']?_0x41b821[_0x3a50('0x32')]:_0x1e8fd6[_0x3a50('0x31')];if(!_0x179068['query']['hasOwnProperty'](_0x3a50('0x34'))){_0x41b821['limit']=qs[_0x3a50('0x1d')](_0x179068[_0x3a50('0x2e')][_0x3a50('0x1d')]);_0x41b821['offset']=qs[_0x3a50('0x1b')](_0x179068[_0x3a50('0x2e')][_0x3a50('0x1b')]);}_0x41b821[_0x3a50('0x35')]=qs['sort'](_0x179068[_0x3a50('0x2e')][_0x3a50('0x36')]);_0x41b821['where']=qs[_0x3a50('0x37')](_[_0x3a50('0x38')](_0x179068[_0x3a50('0x2e')],_0x1e8fd6['filters']),_0x4754f8);if(_0x179068[_0x3a50('0x2e')][_0x3a50('0x39')]){_0x41b821[_0x3a50('0x3a')]=_['merge'](_0x41b821[_0x3a50('0x3a')],{'$or':_[_0x3a50('0x27')](_0x4754f8,function(_0x4b8438){if(_0x4b8438[_0x3a50('0x2b')]!==_0x3a50('0x3b')){var _0x2e2da4={};_0x2e2da4[_0x4b8438[_0x3a50('0x2d')]]={'$like':'%'+_0x179068[_0x3a50('0x2e')][_0x3a50('0x39')]+'%'};return _0x2e2da4;}})});}_0x41b821=_[_0x3a50('0x3c')]({},_0x41b821,_0x179068[_0x3a50('0x3d')]);var _0x5b88f5={'where':_0x41b821[_0x3a50('0x3a')]};return db[_0x3a50('0x28')]['count'](_0x5b88f5)[_0x3a50('0x22')](function(_0x527e91){_0x86de10['count']=_0x527e91;if(_0x179068['query']['includeAll']){_0x41b821[_0x3a50('0x3e')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x3a50('0x3f')](_0x41b821);})[_0x3a50('0x22')](function(_0x5b3bf2){_0x86de10[_0x3a50('0x40')]=_0x5b3bf2;return _0x86de10;})[_0x3a50('0x22')](respondWithFilteredResult(_0x3b8207,_0x41b821))['catch'](handleError(_0x3b8207,null));};exports[_0x3a50('0x41')]=function(_0x3adc9d,_0x46da67){var _0x22da6d={'raw':!![],'where':{'id':_0x3adc9d[_0x3a50('0x42')]['id']}},_0x27bb57={};_0x27bb57[_0x3a50('0x31')]=_[_0x3a50('0x2f')](db[_0x3a50('0x28')][_0x3a50('0x29')]);_0x27bb57[_0x3a50('0x2e')]=_[_0x3a50('0x2f')](_0x3adc9d[_0x3a50('0x2e')]);_0x27bb57[_0x3a50('0x37')]=_['intersection'](_0x27bb57['model'],_0x27bb57[_0x3a50('0x2e')]);_0x22da6d['attributes']=_[_0x3a50('0x30')](_0x27bb57[_0x3a50('0x31')],qs[_0x3a50('0x33')](_0x3adc9d['query'][_0x3a50('0x33')]));_0x22da6d[_0x3a50('0x32')]=_0x22da6d[_0x3a50('0x32')][_0x3a50('0x43')]?_0x22da6d[_0x3a50('0x32')]:_0x27bb57[_0x3a50('0x31')];if(_0x3adc9d[_0x3a50('0x2e')][_0x3a50('0x44')]){_0x22da6d['include']=[{'all':!![]}];}_0x22da6d=_[_0x3a50('0x3c')]({},_0x22da6d,_0x3adc9d[_0x3a50('0x3d')]);return db[_0x3a50('0x28')][_0x3a50('0x45')](_0x22da6d)[_0x3a50('0x22')](handleEntityNotFound(_0x46da67,null))[_0x3a50('0x22')](respondWithResult(_0x46da67,null))[_0x3a50('0x46')](handleError(_0x46da67,null));};exports[_0x3a50('0x47')]=function(_0x398d2a,_0xdb86b6){return db[_0x3a50('0x28')][_0x3a50('0x47')](_0x398d2a[_0x3a50('0x48')],{})[_0x3a50('0x22')](respondWithResult(_0xdb86b6,0xc9))[_0x3a50('0x46')](handleError(_0xdb86b6,null));};exports[_0x3a50('0x49')]=function(_0xae4eb8,_0x30bf34){if(_0xae4eb8[_0x3a50('0x48')]['id']){delete _0xae4eb8['body']['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0xae4eb8[_0x3a50('0x42')]['id']}})['then'](handleEntityNotFound(_0x30bf34,null))[_0x3a50('0x22')](saveUpdates(_0xae4eb8[_0x3a50('0x48')],null))[_0x3a50('0x22')](respondWithResult(_0x30bf34,null))[_0x3a50('0x46')](handleError(_0x30bf34,null));};exports[_0x3a50('0x23')]=function(_0x58a992,_0x53a08d){return db[_0x3a50('0x28')][_0x3a50('0x45')]({'where':{'id':_0x58a992[_0x3a50('0x42')]['id']}})[_0x3a50('0x22')](handleEntityNotFound(_0x53a08d,null))[_0x3a50('0x22')](removeEntity(_0x53a08d,null))['catch'](handleError(_0x53a08d,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 230d741..5708973 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 _0xb975=['../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf'];(function(_0x268d4d,_0x593f9b){var _0x18f5cd=function(_0x44593a){while(--_0x44593a){_0x268d4d['push'](_0x268d4d['shift']());}};_0x18f5cd(++_0x593f9b);}(_0xb975,0x173));var _0x5b97=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0xb975[_0x1a0daa];return _0x1dbe15;};'use strict';var _=require(_0x5b97('0x0'));var util=require(_0x5b97('0x1'));var logger=require('../../config/logger')(_0x5b97('0x2'));var moment=require('moment');var BPromise=require(_0x5b97('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b97('0x4'));var rimraf=require(_0x5b97('0x5'));var config=require(_0x5b97('0x6'));var attributes=require(_0x5b97('0x7'));module[_0x5b97('0x8')]=function(_0x261a14,_0x405680){return _0x261a14[_0x5b97('0x9')](_0x5b97('0xa'),attributes,{'tableName':_0x5b97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5b97('0xc')});}; \ No newline at end of file +var _0x7ac0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x2b31f5,_0x3c2d01){var _0x4f6aa9=function(_0x456d0d){while(--_0x456d0d){_0x2b31f5['push'](_0x2b31f5['shift']());}};_0x4f6aa9(++_0x3c2d01);}(_0x7ac0,0x6b));var _0x07ac=function(_0x3b1ce0,_0x259f76){_0x3b1ce0=_0x3b1ce0-0x0;var _0x319c0e=_0x7ac0[_0x3b1ce0];return _0x319c0e;};'use strict';var _=require('lodash');var util=require(_0x07ac('0x0'));var logger=require(_0x07ac('0x1'))('api');var moment=require(_0x07ac('0x2'));var BPromise=require(_0x07ac('0x3'));var rp=require(_0x07ac('0x4'));var fs=require('fs');var path=require(_0x07ac('0x5'));var rimraf=require(_0x07ac('0x6'));var config=require('../../config/environment');var attributes=require(_0x07ac('0x7'));module['exports']=function(_0x5546da,_0x328f84){return _0x5546da[_0x07ac('0x8')](_0x07ac('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x07ac('0xa'),'collate':_0x07ac('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 03db9e6..76e7ad0 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 _0x5902=['request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','update','options','raw','where','attributes','UpdateOpenchannelApplication','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x9641f8,_0x5c2372){var _0x3881b4=function(_0x45b7d9){while(--_0x45b7d9){_0x9641f8['push'](_0x9641f8['shift']());}};_0x3881b4(++_0x5c2372);}(_0x5902,0x187));var _0x2590=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5902[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x2590('0x0'));var util=require('util');var moment=require(_0x2590('0x1'));var BPromise=require(_0x2590('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2590('0x3'));var db=require(_0x2590('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2590('0x5'))(_0x2590('0x6'));var config=require(_0x2590('0x7'));var jayson=require(_0x2590('0x8'));var client=jayson['client'][_0x2590('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16d4ac,_0x280e76,_0x85f51c){return new BPromise(function(_0xc51d38,_0x38540b){return client[_0x2590('0xa')](_0x16d4ac,_0x85f51c)[_0x2590('0xb')](function(_0x5e5d30){logger[_0x2590('0xc')](_0x2590('0xd'),_0x280e76,_0x2590('0xe'));logger[_0x2590('0xf')](_0x2590('0x10'),_0x280e76,_0x2590('0xe'),JSON[_0x2590('0x11')](_0x5e5d30));if(_0x5e5d30['error']){if(_0x5e5d30['error']['code']===0x1f4){logger[_0x2590('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x280e76,_0x5e5d30[_0x2590('0x12')]['message']);return _0x38540b(_0x5e5d30['error'][_0x2590('0x13')]);}logger[_0x2590('0x12')](_0x2590('0xd'),_0x280e76,_0x5e5d30[_0x2590('0x12')]['message']);return _0xc51d38(_0x5e5d30[_0x2590('0x12')]['message']);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x280e76,_0x2590('0xe'));_0xc51d38(_0x5e5d30['result'][_0x2590('0x13')]);}})[_0x2590('0x14')](function(_0x2c51e8){logger[_0x2590('0x12')](_0x2590('0xd'),_0x280e76,_0x2c51e8);_0x38540b(_0x2c51e8);});});}exports['UpdateOpenchannelApplication']=function(_0x4310df){var _0x17d2be=this;return new Promise(function(_0xe39e0d,_0x2e7cb3){return db['OpenchannelApplication'][_0x2590('0x15')](_0x4310df['body'],{'raw':_0x4310df['options']?_0x4310df[_0x2590('0x16')][_0x2590('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4310df[_0x2590('0x16')]?_0x4310df[_0x2590('0x16')][_0x2590('0x18')]||null:null,'attributes':_0x4310df[_0x2590('0x16')]?_0x4310df['options'][_0x2590('0x19')]||null:null,'limit':_0x4310df['options']?_0x4310df['options']['limit']||null:null})[_0x2590('0xb')](function(_0x6ae12e){logger[_0x2590('0xc')](_0x2590('0x1a'),_0x4310df);logger['debug'](_0x2590('0x1a'),_0x4310df,JSON['stringify'](_0x6ae12e));_0xe39e0d(_0x6ae12e);})[_0x2590('0x14')](function(_0x3069ad){logger[_0x2590('0x12')](_0x2590('0x1a'),_0x3069ad[_0x2590('0x13')],_0x4310df);_0x2e7cb3(_0x17d2be['error'](0x1f4,_0x3069ad[_0x2590('0x13')]));});});}; \ No newline at end of file +var _0x44b3=['then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x44b3,0x1d2));var _0x344b=function(_0x20c8c2,_0x24fdc9){_0x20c8c2=_0x20c8c2-0x0;var _0x5d8945=_0x44b3[_0x20c8c2];return _0x5d8945;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x344b('0x0'));var rs=require(_0x344b('0x1'));var fs=require('fs');var Redis=require(_0x344b('0x2'));var db=require(_0x344b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x344b('0x4'))(_0x344b('0x5'));var config=require('../../config/environment');var jayson=require(_0x344b('0x6'));var client=jayson[_0x344b('0x7')][_0x344b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x132251,_0x1bf5e7,_0x37bc23){return new BPromise(function(_0x415328,_0x5ad35d){return client['request'](_0x132251,_0x37bc23)[_0x344b('0x9')](function(_0x205691){logger[_0x344b('0xa')](_0x344b('0xb'),_0x1bf5e7,_0x344b('0xc'));logger[_0x344b('0xd')](_0x344b('0xe'),_0x1bf5e7,_0x344b('0xc'),JSON[_0x344b('0xf')](_0x205691));if(_0x205691[_0x344b('0x10')]){if(_0x205691[_0x344b('0x10')]['code']===0x1f4){logger[_0x344b('0x10')](_0x344b('0xb'),_0x1bf5e7,_0x205691[_0x344b('0x10')]['message']);return _0x5ad35d(_0x205691[_0x344b('0x10')][_0x344b('0x11')]);}logger[_0x344b('0x10')](_0x344b('0xb'),_0x1bf5e7,_0x205691[_0x344b('0x10')][_0x344b('0x11')]);return _0x415328(_0x205691[_0x344b('0x10')][_0x344b('0x11')]);}else{logger[_0x344b('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x1bf5e7,_0x344b('0xc'));_0x415328(_0x205691['result']['message']);}})[_0x344b('0x12')](function(_0x47e50c){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x1bf5e7,_0x47e50c);_0x5ad35d(_0x47e50c);});});}exports[_0x344b('0x13')]=function(_0x39234a){var _0x3d7502=this;return new Promise(function(_0x2cc71b,_0xb01468){return db[_0x344b('0x14')][_0x344b('0x15')](_0x39234a[_0x344b('0x16')],{'raw':_0x39234a['options']?_0x39234a[_0x344b('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39234a['options']?_0x39234a[_0x344b('0x17')][_0x344b('0x18')]||null:null,'attributes':_0x39234a[_0x344b('0x17')]?_0x39234a[_0x344b('0x17')]['attributes']||null:null,'limit':_0x39234a[_0x344b('0x17')]?_0x39234a[_0x344b('0x17')]['limit']||null:null})[_0x344b('0x9')](function(_0xe11a0d){logger[_0x344b('0xa')](_0x344b('0x13'),_0x39234a);logger['debug'](_0x344b('0x13'),_0x39234a,JSON[_0x344b('0xf')](_0xe11a0d));_0x2cc71b(_0xe11a0d);})[_0x344b('0x12')](function(_0x5e1d49){logger[_0x344b('0x10')](_0x344b('0x13'),_0x5e1d49[_0x344b('0x11')],_0x39234a);_0xb01468(_0x3d7502[_0x344b('0x10')](0x1f4,_0x5e1d49[_0x344b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index e3ea2d7..f6427c8 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 _0x41b1=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x41b1,0xff));var _0x141b=function(_0x2ceba7,_0x451ce4){_0x2ceba7=_0x2ceba7-0x0;var _0x5348eb=_0x41b1[_0x2ceba7];return _0x5348eb;};'use strict';var multer=require(_0x141b('0x0'));var util=require(_0x141b('0x1'));var path=require('path');var timeout=require(_0x141b('0x2'));var express=require('express');var router=express[_0x141b('0x3')]();var fs_extra=require(_0x141b('0x4'));var auth=require(_0x141b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x141b('0x6'));var controller=require(_0x141b('0x7'));router[_0x141b('0x8')]('/',auth[_0x141b('0x9')](),controller[_0x141b('0xa')]);router['get'](_0x141b('0xb'),auth[_0x141b('0x9')](),controller[_0x141b('0xc')]);router[_0x141b('0x8')](_0x141b('0xd'),auth[_0x141b('0x9')](),controller['show']);router[_0x141b('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x141b('0xe')]);router[_0x141b('0x8')](_0x141b('0xf'),auth[_0x141b('0x9')](),controller[_0x141b('0x10')]);router[_0x141b('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x141b('0x11')](_0x141b('0x12'),auth[_0x141b('0x9')](),controller[_0x141b('0x13')]);router['post'](_0x141b('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x141b('0x15'),_0x141b('0x16')),controller[_0x141b('0x17')]);router[_0x141b('0x18')](_0x141b('0xd'),auth['isAuthenticated'](),interaction[_0x141b('0x19')](_0x141b('0x15'),_0x141b('0x1a')),controller[_0x141b('0x1b')]);router[_0x141b('0x1c')](_0x141b('0xd'),auth[_0x141b('0x9')](),interaction[_0x141b('0x19')](_0x141b('0x15'),_0x141b('0x1d')),controller['destroy']);router['delete']('/:id/tags',auth[_0x141b('0x9')](),controller[_0x141b('0x1e')]);module[_0x141b('0x1f')]=router; \ No newline at end of file +var _0xa1d1=['index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0xa1d1,0x196));var _0x1a1d=function(_0xe0f86c,_0x292900){_0xe0f86c=_0xe0f86c-0x0;var _0x5f25a6=_0xa1d1[_0xe0f86c];return _0x5f25a6;};'use strict';var multer=require(_0x1a1d('0x0'));var util=require('util');var path=require(_0x1a1d('0x1'));var timeout=require(_0x1a1d('0x2'));var express=require(_0x1a1d('0x3'));var router=express['Router']();var fs_extra=require(_0x1a1d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1a1d('0x5'));var config=require(_0x1a1d('0x6'));var controller=require(_0x1a1d('0x7'));router[_0x1a1d('0x8')]('/',auth[_0x1a1d('0x9')](),controller[_0x1a1d('0xa')]);router[_0x1a1d('0x8')](_0x1a1d('0xb'),auth[_0x1a1d('0x9')](),controller[_0x1a1d('0xc')]);router[_0x1a1d('0x8')](_0x1a1d('0xd'),auth[_0x1a1d('0x9')](),controller['show']);router[_0x1a1d('0x8')](_0x1a1d('0xe'),auth['isAuthenticated'](),controller[_0x1a1d('0xf')]);router['get'](_0x1a1d('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x1a1d('0x11')]('/',auth[_0x1a1d('0x9')](),controller[_0x1a1d('0x12')]);router[_0x1a1d('0x11')](_0x1a1d('0xe'),auth[_0x1a1d('0x9')](),controller[_0x1a1d('0x13')]);router[_0x1a1d('0x11')]('/:id/tags',auth[_0x1a1d('0x9')](),interaction[_0x1a1d('0x14')](_0x1a1d('0x15'),_0x1a1d('0x16')),controller[_0x1a1d('0x17')]);router['put'](_0x1a1d('0xd'),auth[_0x1a1d('0x9')](),interaction[_0x1a1d('0x14')](_0x1a1d('0x15'),_0x1a1d('0x18')),controller[_0x1a1d('0x19')]);router['delete']('/:id',auth[_0x1a1d('0x9')](),interaction[_0x1a1d('0x14')](_0x1a1d('0x15'),_0x1a1d('0x1a')),controller[_0x1a1d('0x1b')]);router[_0x1a1d('0x1c')](_0x1a1d('0x1d'),auth[_0x1a1d('0x9')](),controller[_0x1a1d('0x1e')]);module[_0x1a1d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index cedc62e..e7bb7d3 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 _0xb647=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x151086,_0x36ff2b){var _0x36c7c4=function(_0x39f1f4){while(--_0x39f1f4){_0x151086['push'](_0x151086['shift']());}};_0x36c7c4(++_0x36ff2b);}(_0xb647,0xdb));var _0x7b64=function(_0x1f7c27,_0x278125){_0x1f7c27=_0x1f7c27-0x0;var _0x5a068c=_0xb647[_0x1f7c27];return _0x5a068c;};'use strict';var Sequelize=require(_0x7b64('0x0'));module[_0x7b64('0x1')]={'closed':{'type':Sequelize[_0x7b64('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b64('0x3')]},'disposition':{'type':Sequelize[_0x7b64('0x4')]},'secondDisposition':{'type':Sequelize[_0x7b64('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7b64('0x4')]},'note':{'type':Sequelize[_0x7b64('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x7b64('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x7b64('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7b64('0x5')]('in',_0x7b64('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x7b64('0x5')]('in',_0x7b64('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7b64('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x7b64('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f10=['ENUM','out','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x4cb3cf,_0x438231){var _0x41cfef=function(_0xb51915){while(--_0xb51915){_0x4cb3cf['push'](_0x4cb3cf['shift']());}};_0x41cfef(++_0x438231);}(_0x5f10,0xd5));var _0x05f1=function(_0x16a7bc,_0x3ee4fb){_0x16a7bc=_0x16a7bc-0x0;var _0x54e51d=_0x5f10[_0x16a7bc];return _0x54e51d;};'use strict';var Sequelize=require(_0x05f1('0x0'));module[_0x05f1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x05f1('0x2')]},'thirdDisposition':{'type':Sequelize[_0x05f1('0x2')]},'note':{'type':Sequelize[_0x05f1('0x2')]},'read1stAt':{'type':Sequelize[_0x05f1('0x3')]},'threadId':{'type':Sequelize[_0x05f1('0x2')]},'externalUrl':{'type':Sequelize[_0x05f1('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x05f1('0x4')]('in',_0x05f1('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x05f1('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x05f1('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x05f1('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 11976de..ab1f87f 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 _0xd8eb=['findAll','openchannel','catch','show','query','from','params','model','keys','filters','attributes','intersection','fields','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','removeTags','download','toString','root','files','tmp','join','server','attachments','format','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','fullname','N.A.','closed','closedAt','Public','Private','basename','existsSync','pipe','createWriteStream','out','System','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','end','status','json','offset','undefined','limit','count','Content-Range','update','then','sendStatus','error','stack','name','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions'];(function(_0x565df7,_0x3060b7){var _0x4485b6=function(_0x1ca564){while(--_0x1ca564){_0x565df7['push'](_0x565df7['shift']());}};_0x4485b6(++_0x3060b7);}(_0xd8eb,0x163));var _0xbd8e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xd8eb[_0x1ccdf7];return _0x52a0ae;};'use strict';var rimraf=require(_0xbd8e('0x0'));var zipdir=require(_0xbd8e('0x1'));var moment=require(_0xbd8e('0x2'));var util=require(_0xbd8e('0x3'));var path=require(_0xbd8e('0x4'));var ejs=require(_0xbd8e('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xbd8e('0x6'));var qs=require(_0xbd8e('0x7'));var pdf=require(_0xbd8e('0x8'));var logger=require(_0xbd8e('0x9'))(_0xbd8e('0xa'));var config=require(_0xbd8e('0xb'));var db=require(_0xbd8e('0xc'))['db'];config[_0xbd8e('0xd')]=_[_0xbd8e('0xe')](config[_0xbd8e('0xd')],{'host':_0xbd8e('0xf'),'port':0x18eb});var socket=require(_0xbd8e('0x10'))(new Redis(config[_0xbd8e('0xd')]));require(_0xbd8e('0x11'))[_0xbd8e('0x12')](socket);function respondWithStatusCode(_0x326f5b,_0x3590d6){_0x3590d6=_0x3590d6||0xcc;return function(_0x5721bb){if(_0x5721bb){return _0x326f5b['sendStatus'](_0x3590d6);}return _0x326f5b['status'](_0x3590d6)[_0xbd8e('0x13')]();};}function respondWithResult(_0x59af1c,_0x5afe82){_0x5afe82=_0x5afe82||0xc8;return function(_0x385976){if(_0x385976){return _0x59af1c[_0xbd8e('0x14')](_0x5afe82)[_0xbd8e('0x15')](_0x385976);}};}function respondWithFilteredResult(_0x1807a8,_0x5e5a56){return function(_0x12dd54){if(_0x12dd54){var _0x178cc4=typeof _0x5e5a56[_0xbd8e('0x16')]===_0xbd8e('0x17')&&typeof _0x5e5a56[_0xbd8e('0x18')]===_0xbd8e('0x17');var _0xdfd239=_0x12dd54[_0xbd8e('0x19')];var _0x1712d1=_0x178cc4?0x0:_0x5e5a56[_0xbd8e('0x16')];var _0x4e246d=_0x178cc4?_0x12dd54[_0xbd8e('0x19')]:_0x5e5a56[_0xbd8e('0x16')]+_0x5e5a56[_0xbd8e('0x18')];var _0x4d4c2d;if(_0x4e246d>=_0xdfd239){_0x4e246d=_0xdfd239;_0x4d4c2d=0xc8;}else{_0x4d4c2d=0xce;}_0x1807a8[_0xbd8e('0x14')](_0x4d4c2d);return _0x1807a8['set'](_0xbd8e('0x1a'),_0x1712d1+'-'+_0x4e246d+'/'+_0xdfd239)[_0xbd8e('0x15')](_0x12dd54);}return null;};}function saveUpdates(_0x173773){return function(_0x3723ca){if(_0x3723ca){return _0x3723ca[_0xbd8e('0x1b')](_0x173773)[_0xbd8e('0x1c')](function(_0x384629){return _0x384629;});}return null;};}function removeEntity(_0x461c83){return function(_0x149a47){if(_0x149a47){return _0x149a47['destroy']()['then'](function(){_0x461c83[_0xbd8e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31568f){return function(_0x57b93f){if(!_0x57b93f){_0x31568f[_0xbd8e('0x1d')](0x194);}return _0x57b93f;};}function handleError(_0x306f6b,_0x576e89){_0x576e89=_0x576e89||0x1f4;return function(_0x4dfa0b){logger[_0xbd8e('0x1e')](_0x4dfa0b[_0xbd8e('0x1f')]);if(_0x4dfa0b[_0xbd8e('0x20')]){delete _0x4dfa0b[_0xbd8e('0x20')];}_0x306f6b[_0xbd8e('0x14')](_0x576e89)[_0xbd8e('0x21')](_0x4dfa0b);};}exports[_0xbd8e('0x22')]=function(_0x5b547d,_0x194c0c){var _0x4374c4={};var _0x107e74=_['map'](db[_0xbd8e('0x23')][_0xbd8e('0x24')],function(_0x7c0ae1){return{'name':_0x7c0ae1[_0xbd8e('0x25')],'type':_0x7c0ae1[_0xbd8e('0x26')][_0xbd8e('0x27')]};});_0x4374c4=qs[_0xbd8e('0x28')](_0x107e74,_0x5b547d);return interaction[_0xbd8e('0x29')](_0xbd8e('0x2a'),_0x5b547d['query'],_0x5b547d['user'],_0x4374c4,_0x107e74)['then'](respondWithFilteredResult(_0x194c0c,_0x4374c4))[_0xbd8e('0x2b')](handleError(_0x194c0c,null));};exports[_0xbd8e('0x2c')]=function(_0x221064,_0x3528e2){var _0x47bd6b={};if(_0x221064['query'][_0xbd8e('0x26')]&&_0x221064[_0xbd8e('0x2d')][_0xbd8e('0x26')]===_0xbd8e('0x2e')){_0x47bd6b['from']=_0x221064['params']['id'];}else{_0x47bd6b['id']=_0x221064[_0xbd8e('0x2f')]['id'];}var _0x16d3e1={'raw':![],'where':_0x47bd6b},_0x3bc799={};_0x3bc799[_0xbd8e('0x30')]=_[_0xbd8e('0x31')](db[_0xbd8e('0x23')]['rawAttributes']);_0x3bc799[_0xbd8e('0x2d')]=_[_0xbd8e('0x31')](_0x221064['query']);_0x3bc799[_0xbd8e('0x32')]=_['intersection'](_0x3bc799['model'],_0x3bc799[_0xbd8e('0x2d')]);_0x16d3e1[_0xbd8e('0x33')]=_[_0xbd8e('0x34')](_0x3bc799[_0xbd8e('0x30')],qs['fields'](_0x221064['query'][_0xbd8e('0x35')]));_0x16d3e1[_0xbd8e('0x33')]=_0x16d3e1[_0xbd8e('0x33')]['length']?_0x16d3e1[_0xbd8e('0x33')]:_0x3bc799[_0xbd8e('0x30')];if(_0x221064['query'][_0xbd8e('0x36')]){_0x16d3e1[_0xbd8e('0x37')]=[{'all':!![]}];}_0x16d3e1=_[_0xbd8e('0x38')]({},_0x16d3e1,_0x221064[_0xbd8e('0x39')]);return db[_0xbd8e('0x23')][_0xbd8e('0x3a')](_0x16d3e1)[_0xbd8e('0x1c')](handleEntityNotFound(_0x3528e2,null))[_0xbd8e('0x1c')](respondWithResult(_0x3528e2,null))[_0xbd8e('0x2b')](handleError(_0x3528e2,null));};exports[_0xbd8e('0x3b')]=function(_0x4cda21,_0x362556){return db[_0xbd8e('0x23')][_0xbd8e('0x3b')](_0x4cda21[_0xbd8e('0x3c')],{})[_0xbd8e('0x1c')](respondWithResult(_0x362556,0xc9))[_0xbd8e('0x2b')](handleError(_0x362556,null));};exports[_0xbd8e('0x1b')]=function(_0x2b27b4,_0x370932){if(_0x2b27b4[_0xbd8e('0x3c')]['id']){delete _0x2b27b4[_0xbd8e('0x3c')]['id'];}return db[_0xbd8e('0x23')][_0xbd8e('0x3a')]({'where':{'id':_0x2b27b4['params']['id']}})[_0xbd8e('0x1c')](handleEntityNotFound(_0x370932,null))[_0xbd8e('0x1c')](saveUpdates(_0x2b27b4['body'],null))[_0xbd8e('0x1c')](respondWithResult(_0x370932,null))[_0xbd8e('0x2b')](handleError(_0x370932,null));};exports[_0xbd8e('0x3d')]=function(_0x79433,_0x84b2da){return db[_0xbd8e('0x23')][_0xbd8e('0x3a')]({'where':{'id':_0x79433[_0xbd8e('0x2f')]['id']}})[_0xbd8e('0x1c')](handleEntityNotFound(_0x84b2da,null))['then'](removeEntity(_0x84b2da,null))[_0xbd8e('0x2b')](handleError(_0x84b2da,null));};exports[_0xbd8e('0x3e')]=function(_0x481b37,_0x501b23){return db['OpenchannelInteraction'][_0xbd8e('0x3e')]()[_0xbd8e('0x1c')](respondWithResult(_0x501b23,null))[_0xbd8e('0x2b')](handleError(_0x501b23,null));};exports[_0xbd8e('0x3f')]=function(_0x331bd2,_0x5d1691){return db['OpenchannelMessage'][_0xbd8e('0x3a')]({'where':{'id':_0x331bd2['params']['id']}})[_0xbd8e('0x1c')](handleEntityNotFound(_0x5d1691,null))[_0xbd8e('0x1c')](function(_0x4d891c){if(_0x4d891c){return _0x4d891c['addMessage'](_0x331bd2[_0xbd8e('0x3c')][_0xbd8e('0x40')],_['omit'](_0x331bd2[_0xbd8e('0x3c')],[_0xbd8e('0x40'),'id'])||{});}})[_0xbd8e('0x1c')](respondWithResult(_0x5d1691,null))[_0xbd8e('0x2b')](handleError(_0x5d1691,null));};exports[_0xbd8e('0x41')]=function(_0x275f9c,_0x1597b0){var _0x2419b6={'raw':![],'where':{}};var _0x4496f6={};var _0x15ced4={'count':0x0,'rows':[]};return db[_0xbd8e('0x23')][_0xbd8e('0x42')]({'where':{'id':_0x275f9c[_0xbd8e('0x2f')]['id']}})[_0xbd8e('0x1c')](handleEntityNotFound(_0x1597b0,null))[_0xbd8e('0x1c')](function(_0x30ab13){if(_0x30ab13){_0x4496f6['model']=_[_0xbd8e('0x31')](db[_0xbd8e('0x43')]['rawAttributes']);_0x4496f6[_0xbd8e('0x2d')]=_['keys'](_0x275f9c['query']);_0x4496f6[_0xbd8e('0x32')]=_[_0xbd8e('0x34')](_0x4496f6[_0xbd8e('0x30')],_0x4496f6[_0xbd8e('0x2d')]);_0x2419b6[_0xbd8e('0x33')]=_[_0xbd8e('0x34')](_0x4496f6[_0xbd8e('0x30')],qs[_0xbd8e('0x35')](_0x275f9c[_0xbd8e('0x2d')][_0xbd8e('0x35')]));_0x2419b6[_0xbd8e('0x33')]=_0x2419b6[_0xbd8e('0x33')][_0xbd8e('0x44')]?_0x2419b6[_0xbd8e('0x33')]:_0x4496f6['model'];if(!_0x275f9c[_0xbd8e('0x2d')][_0xbd8e('0x45')](_0xbd8e('0x46'))){_0x2419b6['limit']=qs[_0xbd8e('0x18')](_0x275f9c[_0xbd8e('0x2d')][_0xbd8e('0x18')]);_0x2419b6[_0xbd8e('0x16')]=qs[_0xbd8e('0x16')](_0x275f9c[_0xbd8e('0x2d')]['offset']);}_0x2419b6[_0xbd8e('0x47')]=qs['sort'](_0x275f9c[_0xbd8e('0x2d')][_0xbd8e('0x48')]);_0x2419b6[_0xbd8e('0x49')]=qs[_0xbd8e('0x32')](_[_0xbd8e('0x4a')](_0x275f9c[_0xbd8e('0x2d')],_0x4496f6[_0xbd8e('0x32')]));_0x2419b6[_0xbd8e('0x49')]['OpenchannelInteractionId']=_0x30ab13['id'];if(_0x275f9c[_0xbd8e('0x2d')][_0xbd8e('0x4b')]){_0x2419b6[_0xbd8e('0x49')]=_[_0xbd8e('0x38')](_0x2419b6[_0xbd8e('0x49')],{'$or':_[_0xbd8e('0x4c')](_0x2419b6[_0xbd8e('0x33')],function(_0x5013e6){var _0x4d8b9c={};_0x4d8b9c[_0x5013e6]={'$like':'%'+_0x275f9c[_0xbd8e('0x2d')][_0xbd8e('0x4b')]+'%'};return _0x4d8b9c;})});}if(_0x275f9c[_0xbd8e('0x2d')][_0xbd8e('0x4d')]){var _0x3bb770=_0x275f9c[_0xbd8e('0x2d')]['$gte']['split'](',');var _0x48bdaf={};_0x48bdaf[_0x3bb770[0x0]]={'$gte':moment(_0x3bb770[0x1])['format'](_0xbd8e('0x4e'))};_0x2419b6[_0xbd8e('0x49')]=_[_0xbd8e('0x38')](_0x2419b6[_0xbd8e('0x49')],_0x48bdaf);}_0x2419b6=_[_0xbd8e('0x38')]({},_0x2419b6,_0x275f9c[_0xbd8e('0x39')]);return db['OpenchannelMessage'][_0xbd8e('0x19')]({'where':_0x2419b6[_0xbd8e('0x49')]})[_0xbd8e('0x1c')](function(_0x3a4cb0){_0x15ced4['count']=_0x3a4cb0;if(_0x275f9c[_0xbd8e('0x2d')][_0xbd8e('0x36')]){_0x2419b6[_0xbd8e('0x37')]=[{'all':!![]}];}return db[_0xbd8e('0x43')][_0xbd8e('0x29')](_0x2419b6);})[_0xbd8e('0x1c')](function(_0x3aac41){_0x15ced4[_0xbd8e('0x4f')]=_0x3aac41;return _0x15ced4;});}})[_0xbd8e('0x1c')](respondWithFilteredResult(_0x1597b0,_0x2419b6))['catch'](handleError(_0x1597b0,null));};exports[_0xbd8e('0x50')]=function(_0x4fd3a8,_0x975a85){return db[_0xbd8e('0x23')][_0xbd8e('0x3a')]({'where':{'id':_0x4fd3a8['params']['id']}})[_0xbd8e('0x1c')](handleEntityNotFound(_0x975a85,null))[_0xbd8e('0x1c')](function(_0x161b2e){if(_0x161b2e){return _0x161b2e[_0xbd8e('0x51')](_0x4fd3a8[_0xbd8e('0x3c')][_0xbd8e('0x40')],_[_0xbd8e('0x52')](_0x4fd3a8[_0xbd8e('0x3c')],[_0xbd8e('0x40'),'id'])||{})[_0xbd8e('0x53')](function(){return db['Tag']['findAll']({'attributes':['id',_0xbd8e('0x20'),'color'],'where':{'id':_0x4fd3a8[_0xbd8e('0x3c')][_0xbd8e('0x40')]}});})[_0xbd8e('0x1c')](function(_0x34720d){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x4fd3a8['params']['id']),'tags':_0x34720d||[]});return{'id':Number(_0x4fd3a8[_0xbd8e('0x2f')]['id']),'tags':_0x34720d||[]};});}})['then'](respondWithResult(_0x975a85,null))[_0xbd8e('0x2b')](handleError(_0x975a85,null));};exports[_0xbd8e('0x54')]=function(_0x36fcbd,_0x13e3ae){return db[_0xbd8e('0x23')]['find']({'where':{'id':_0x36fcbd['params']['id']}})[_0xbd8e('0x1c')](handleEntityNotFound(_0x13e3ae,null))[_0xbd8e('0x1c')](function(_0x45b032){if(_0x45b032){return _0x45b032['removeTags'](_0x36fcbd[_0xbd8e('0x2d')]['ids']);}})[_0xbd8e('0x1c')](respondWithStatusCode(_0x13e3ae,null))[_0xbd8e('0x2b')](handleError(_0x13e3ae,null));};exports[_0xbd8e('0x55')]=function(_0x35f69a,_0x843f05){var _0x1612c5=moment()['unix']()[_0xbd8e('0x56')]();var _0x5f1a64=path['join'](config[_0xbd8e('0x57')],'server',_0xbd8e('0x58'),_0xbd8e('0x59'));var _0x1a3c33=path[_0xbd8e('0x5a')](config[_0xbd8e('0x57')],_0xbd8e('0x5b'),_0xbd8e('0x58'),_0xbd8e('0x5c'));var _0x166a85=path['join'](_0x5f1a64,_0x1612c5);var _0x580828=util[_0xbd8e('0x5d')](_0xbd8e('0x5e'),_0x35f69a[_0xbd8e('0x2f')]['id'],_0x1612c5);var _0x3e9a64=path[_0xbd8e('0x5a')](_0x5f1a64,_0x580828);var _0x203c2a=[];_0x203c2a[_0xbd8e('0x5f')]({'model':db[_0xbd8e('0x60')],'as':_0xbd8e('0x60'),'attributes':['id','fullname'],'raw':!![]});_0x203c2a[_0xbd8e('0x5f')]({'model':db[_0xbd8e('0x61')],'as':_0xbd8e('0x62'),'attributes':['id',_0xbd8e('0x63'),_0xbd8e('0x64')],'raw':!![]});if(_0x35f69a[_0xbd8e('0x2d')][_0xbd8e('0x5c')]){_0x203c2a[_0xbd8e('0x5f')]({'model':db[_0xbd8e('0x65')],'as':_0xbd8e('0x65'),'raw':!![]});}var _0x573314=[{'model':db[_0xbd8e('0x43')],'as':_0xbd8e('0x66'),'attributes':['id',_0xbd8e('0x3c'),_0xbd8e('0x67'),_0xbd8e('0x68'),_0xbd8e('0x69'),_0xbd8e('0x6a')],'include':_0x203c2a}];_0x573314[_0xbd8e('0x5f')]({'model':db[_0xbd8e('0x6b')],'as':'Account','attributes':['id',_0xbd8e('0x20')]});_0x573314[_0xbd8e('0x5f')]({'model':db[_0xbd8e('0x60')],'as':_0xbd8e('0x6c'),'attributes':['id','fullname']});return db[_0xbd8e('0x23')][_0xbd8e('0x3a')]({'where':{'id':_0x35f69a[_0xbd8e('0x2f')]['id']},'include':_0x573314})['then'](handleEntityNotFound(_0x843f05,null))[_0xbd8e('0x1c')](function(_0xa8b43f){if(_0xa8b43f){var _0x1ef4f1=_0xa8b43f['get']({'plain':!![]});fs[_0xbd8e('0x6d')](_0x166a85);var _0x473187={'channel':_0xbd8e('0x6e'),'account':_0x1ef4f1[_0xbd8e('0x6f')][_0xbd8e('0x20')],'agent':_0x1ef4f1['Owner']?_0x1ef4f1['Owner'][_0xbd8e('0x70')]:_0xbd8e('0x71'),'createdAt':moment(_0x1ef4f1[_0xbd8e('0x67')])[_0xbd8e('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbd8e('0x56')](),'closedAt':_0x1ef4f1[_0xbd8e('0x72')]?moment(_0x1ef4f1[_0xbd8e('0x73')])[_0xbd8e('0x5d')](_0xbd8e('0x4e'))[_0xbd8e('0x56')]():'','disposition':_0x1ef4f1['disposition'],'visibility':_0x1ef4f1['threadId']?_0xbd8e('0x74'):_0xbd8e('0x75'),'messages':_(_0x1ef4f1[_0xbd8e('0x66')])[_0xbd8e('0x4b')]({'secret':![]})[_0xbd8e('0x4c')](function(_0x19dc4c){if(_0x19dc4c[_0xbd8e('0x65')]){var _0x543144=path[_0xbd8e('0x5a')](_0x1a3c33,_0x19dc4c[_0xbd8e('0x65')][_0xbd8e('0x76')]);if(fs[_0xbd8e('0x77')](_0x543144)){fs['createReadStream'](_0x543144)[_0xbd8e('0x78')](fs[_0xbd8e('0x79')](path['join'](_0x166a85,_0x19dc4c[_0xbd8e('0x65')][_0xbd8e('0x76')])));}}return{'date':moment(_0x19dc4c[_0xbd8e('0x67')])[_0xbd8e('0x5d')](_0xbd8e('0x4e'))['toString'](),'sender':_0x19dc4c['direction']===_0xbd8e('0x7a')?_0x19dc4c['User']?_0x19dc4c[_0xbd8e('0x60')][_0xbd8e('0x70')]:_0xbd8e('0x7b'):_0x19dc4c[_0xbd8e('0x62')][_0xbd8e('0x63')]+(_0x19dc4c[_0xbd8e('0x62')][_0xbd8e('0x64')]?'\x20'+_0x19dc4c[_0xbd8e('0x62')]['lastName']:''),'body':_0x19dc4c['Attachment']?_0x19dc4c[_0xbd8e('0x65')][_0xbd8e('0x76')]:_0x19dc4c[_0xbd8e('0x3c')],'direction':_0x19dc4c[_0xbd8e('0x68')]==='out'?'A':'C','secret':_0x19dc4c[_0xbd8e('0x69')],'read':_0x19dc4c[_0xbd8e('0x6a')],'attachment':_0x19dc4c['Attachment']};})[_0xbd8e('0x7c')]()};return ejs[_0xbd8e('0x7d')](path[_0xbd8e('0x5a')](config['root'],_0xbd8e('0x5b'),_0xbd8e('0x7e'),_0xbd8e('0x7f')),{'interaction':_0x473187})[_0xbd8e('0x1c')](function(_0x312afe){var _0x10271e=path[_0xbd8e('0x5a')](_0x166a85,'transcript-'+_0x1ef4f1['id']+'-'+_0x1612c5+_0xbd8e('0x80'));var _0x353364={'path':_0x10271e,'channel':'Openchannel','interactionId':_0x1ef4f1['id']};return pdf[_0xbd8e('0x81')](_0x312afe,_0x353364);})['then'](function(){return new Promise(function(_0x361650,_0x4ba870){zipdir(_0x166a85,{'saveTo':_0x3e9a64},function(_0x18aed0,_0x25318a){if(_0x18aed0)return _0x4ba870(_0x18aed0);return _0x361650(_0x25318a);});})[_0xbd8e('0x1c')](function(){return new Promise(function(_0x3ba315,_0x30b357){rimraf(_0x166a85,function(_0x5ec636){if(_0x5ec636)_0x30b357(_0x5ec636);return _0x3ba315();});});})['then'](function(){return _0x843f05[_0xbd8e('0x55')](_0x3e9a64,_0x580828,function(_0x1e594b){if(_0x1e594b){logger[_0xbd8e('0x1e')](_0xbd8e('0x82'),_0x1e594b);}else{fs[_0xbd8e('0x83')](_0x3e9a64);}});});});}else{return _0x843f05[_0xbd8e('0x1d')](0xc8);}})['catch'](handleError(_0x843f05,null));}; \ No newline at end of file +var _0xe5b7=['Public','existsSync','createReadStream','pipe','basename','out','System','firstName','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','rimraf','moment','lodash','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','name','index','map','rawAttributes','fieldName','key','findAll','openchannel','query','user','catch','show','type','from','params','model','keys','OpenchannelInteraction','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','format','rows','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','root','server','files','join','attachments','transcript-%d-%s.zip','push','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','User','Owner','get','mkdirSync','Openchannel','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition'];(function(_0x24946f,_0x11bf4b){var _0x28ac69=function(_0x21e81a){while(--_0x21e81a){_0x24946f['push'](_0x24946f['shift']());}};_0x28ac69(++_0x11bf4b);}(_0xe5b7,0x1ed));var _0x7e5b=function(_0x3557ba,_0x3b664f){_0x3557ba=_0x3557ba-0x0;var _0x8131f2=_0xe5b7[_0x3557ba];return _0x8131f2;};'use strict';var rimraf=require(_0x7e5b('0x0'));var zipdir=require('zip-dir');var moment=require(_0x7e5b('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e5b('0x2'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x7e5b('0x3'));var logger=require(_0x7e5b('0x4'))(_0x7e5b('0x5'));var config=require(_0x7e5b('0x6'));var db=require(_0x7e5b('0x7'))['db'];config[_0x7e5b('0x8')]=_['defaults'](config[_0x7e5b('0x8')],{'host':_0x7e5b('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e5b('0x8')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x22fac8,_0x3b9674){_0x3b9674=_0x3b9674||0xcc;return function(_0x4c86fb){if(_0x4c86fb){return _0x22fac8[_0x7e5b('0xa')](_0x3b9674);}return _0x22fac8[_0x7e5b('0xb')](_0x3b9674)[_0x7e5b('0xc')]();};}function respondWithResult(_0x502c0d,_0x128bb1){_0x128bb1=_0x128bb1||0xc8;return function(_0x30bcdd){if(_0x30bcdd){return _0x502c0d[_0x7e5b('0xb')](_0x128bb1)[_0x7e5b('0xd')](_0x30bcdd);}};}function respondWithFilteredResult(_0x4370ca,_0x4382d3){return function(_0x4cce59){if(_0x4cce59){var _0x4df6ee=typeof _0x4382d3[_0x7e5b('0xe')]===_0x7e5b('0xf')&&typeof _0x4382d3[_0x7e5b('0x10')]===_0x7e5b('0xf');var _0x3c2701=_0x4cce59[_0x7e5b('0x11')];var _0x5670f9=_0x4df6ee?0x0:_0x4382d3['offset'];var _0x3da1b8=_0x4df6ee?_0x4cce59[_0x7e5b('0x11')]:_0x4382d3['offset']+_0x4382d3['limit'];var _0x44229e;if(_0x3da1b8>=_0x3c2701){_0x3da1b8=_0x3c2701;_0x44229e=0xc8;}else{_0x44229e=0xce;}_0x4370ca[_0x7e5b('0xb')](_0x44229e);return _0x4370ca['set'](_0x7e5b('0x12'),_0x5670f9+'-'+_0x3da1b8+'/'+_0x3c2701)[_0x7e5b('0xd')](_0x4cce59);}return null;};}function saveUpdates(_0x58777d){return function(_0x360a65){if(_0x360a65){return _0x360a65[_0x7e5b('0x13')](_0x58777d)[_0x7e5b('0x14')](function(_0xdaf545){return _0xdaf545;});}return null;};}function removeEntity(_0x2b4a52){return function(_0x5dd2ea){if(_0x5dd2ea){return _0x5dd2ea[_0x7e5b('0x15')]()[_0x7e5b('0x14')](function(){_0x2b4a52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c74b1){return function(_0xe02d8b){if(!_0xe02d8b){_0x3c74b1[_0x7e5b('0xa')](0x194);}return _0xe02d8b;};}function handleError(_0x6b86ec,_0x21fa89){_0x21fa89=_0x21fa89||0x1f4;return function(_0x5e279c){logger[_0x7e5b('0x16')](_0x5e279c['stack']);if(_0x5e279c[_0x7e5b('0x17')]){delete _0x5e279c[_0x7e5b('0x17')];}_0x6b86ec[_0x7e5b('0xb')](_0x21fa89)['send'](_0x5e279c);};}exports[_0x7e5b('0x18')]=function(_0x7d988,_0x3c0183){var _0x3e199b={};var _0x3e45f2=_[_0x7e5b('0x19')](db['OpenchannelInteraction'][_0x7e5b('0x1a')],function(_0x56490a){return{'name':_0x56490a[_0x7e5b('0x1b')],'type':_0x56490a['type'][_0x7e5b('0x1c')]};});_0x3e199b=qs['getOptions'](_0x3e45f2,_0x7d988);return interaction[_0x7e5b('0x1d')](_0x7e5b('0x1e'),_0x7d988[_0x7e5b('0x1f')],_0x7d988[_0x7e5b('0x20')],_0x3e199b,_0x3e45f2)[_0x7e5b('0x14')](respondWithFilteredResult(_0x3c0183,_0x3e199b))[_0x7e5b('0x21')](handleError(_0x3c0183,null));};exports[_0x7e5b('0x22')]=function(_0x54711c,_0x4274b0){var _0x53a92b={};if(_0x54711c[_0x7e5b('0x1f')][_0x7e5b('0x23')]&&_0x54711c[_0x7e5b('0x1f')][_0x7e5b('0x23')]===_0x7e5b('0x24')){_0x53a92b['from']=_0x54711c[_0x7e5b('0x25')]['id'];}else{_0x53a92b['id']=_0x54711c[_0x7e5b('0x25')]['id'];}var _0x53a2f3={'raw':![],'where':_0x53a92b},_0x9ec3af={};_0x9ec3af[_0x7e5b('0x26')]=_[_0x7e5b('0x27')](db[_0x7e5b('0x28')][_0x7e5b('0x1a')]);_0x9ec3af[_0x7e5b('0x1f')]=_[_0x7e5b('0x27')](_0x54711c['query']);_0x9ec3af[_0x7e5b('0x29')]=_[_0x7e5b('0x2a')](_0x9ec3af[_0x7e5b('0x26')],_0x9ec3af[_0x7e5b('0x1f')]);_0x53a2f3[_0x7e5b('0x2b')]=_[_0x7e5b('0x2a')](_0x9ec3af[_0x7e5b('0x26')],qs['fields'](_0x54711c[_0x7e5b('0x1f')][_0x7e5b('0x2c')]));_0x53a2f3['attributes']=_0x53a2f3[_0x7e5b('0x2b')][_0x7e5b('0x2d')]?_0x53a2f3[_0x7e5b('0x2b')]:_0x9ec3af[_0x7e5b('0x26')];if(_0x54711c['query'][_0x7e5b('0x2e')]){_0x53a2f3[_0x7e5b('0x2f')]=[{'all':!![]}];}_0x53a2f3=_[_0x7e5b('0x30')]({},_0x53a2f3,_0x54711c[_0x7e5b('0x31')]);return db[_0x7e5b('0x28')][_0x7e5b('0x32')](_0x53a2f3)[_0x7e5b('0x14')](handleEntityNotFound(_0x4274b0,null))[_0x7e5b('0x14')](respondWithResult(_0x4274b0,null))[_0x7e5b('0x21')](handleError(_0x4274b0,null));};exports[_0x7e5b('0x33')]=function(_0x465f23,_0x352a4b){return db[_0x7e5b('0x28')][_0x7e5b('0x33')](_0x465f23[_0x7e5b('0x34')],{})['then'](respondWithResult(_0x352a4b,0xc9))[_0x7e5b('0x21')](handleError(_0x352a4b,null));};exports[_0x7e5b('0x13')]=function(_0x2bb7a5,_0x349792){if(_0x2bb7a5[_0x7e5b('0x34')]['id']){delete _0x2bb7a5['body']['id'];}return db[_0x7e5b('0x28')][_0x7e5b('0x32')]({'where':{'id':_0x2bb7a5['params']['id']}})[_0x7e5b('0x14')](handleEntityNotFound(_0x349792,null))[_0x7e5b('0x14')](saveUpdates(_0x2bb7a5['body'],null))['then'](respondWithResult(_0x349792,null))[_0x7e5b('0x21')](handleError(_0x349792,null));};exports['destroy']=function(_0x6f225a,_0x11bffb){return db[_0x7e5b('0x28')]['find']({'where':{'id':_0x6f225a[_0x7e5b('0x25')]['id']}})['then'](handleEntityNotFound(_0x11bffb,null))['then'](removeEntity(_0x11bffb,null))['catch'](handleError(_0x11bffb,null));};exports[_0x7e5b('0x35')]=function(_0x1f464b,_0x110d38){return db[_0x7e5b('0x28')]['describe']()[_0x7e5b('0x14')](respondWithResult(_0x110d38,null))[_0x7e5b('0x21')](handleError(_0x110d38,null));};exports[_0x7e5b('0x36')]=function(_0x355da4,_0x47a5c0){return db[_0x7e5b('0x37')]['find']({'where':{'id':_0x355da4[_0x7e5b('0x25')]['id']}})[_0x7e5b('0x14')](handleEntityNotFound(_0x47a5c0,null))['then'](function(_0x3f3a4b){if(_0x3f3a4b){return _0x3f3a4b[_0x7e5b('0x36')](_0x355da4[_0x7e5b('0x34')]['ids'],_[_0x7e5b('0x38')](_0x355da4['body'],[_0x7e5b('0x39'),'id'])||{});}})[_0x7e5b('0x14')](respondWithResult(_0x47a5c0,null))[_0x7e5b('0x21')](handleError(_0x47a5c0,null));};exports[_0x7e5b('0x3a')]=function(_0x34915d,_0x5c36a1){var _0x10ab82={'raw':![],'where':{}};var _0x56f48b={};var _0x10dbd2={'count':0x0,'rows':[]};return db[_0x7e5b('0x28')]['findOne']({'where':{'id':_0x34915d[_0x7e5b('0x25')]['id']}})[_0x7e5b('0x14')](handleEntityNotFound(_0x5c36a1,null))[_0x7e5b('0x14')](function(_0xc1fcd6){if(_0xc1fcd6){_0x56f48b[_0x7e5b('0x26')]=_[_0x7e5b('0x27')](db['OpenchannelMessage'][_0x7e5b('0x1a')]);_0x56f48b[_0x7e5b('0x1f')]=_[_0x7e5b('0x27')](_0x34915d[_0x7e5b('0x1f')]);_0x56f48b[_0x7e5b('0x29')]=_[_0x7e5b('0x2a')](_0x56f48b[_0x7e5b('0x26')],_0x56f48b[_0x7e5b('0x1f')]);_0x10ab82[_0x7e5b('0x2b')]=_[_0x7e5b('0x2a')](_0x56f48b[_0x7e5b('0x26')],qs[_0x7e5b('0x2c')](_0x34915d[_0x7e5b('0x1f')][_0x7e5b('0x2c')]));_0x10ab82[_0x7e5b('0x2b')]=_0x10ab82['attributes'][_0x7e5b('0x2d')]?_0x10ab82[_0x7e5b('0x2b')]:_0x56f48b[_0x7e5b('0x26')];if(!_0x34915d[_0x7e5b('0x1f')][_0x7e5b('0x3b')](_0x7e5b('0x3c'))){_0x10ab82[_0x7e5b('0x10')]=qs[_0x7e5b('0x10')](_0x34915d['query']['limit']);_0x10ab82['offset']=qs[_0x7e5b('0xe')](_0x34915d[_0x7e5b('0x1f')]['offset']);}_0x10ab82[_0x7e5b('0x3d')]=qs[_0x7e5b('0x3e')](_0x34915d[_0x7e5b('0x1f')][_0x7e5b('0x3e')]);_0x10ab82['where']=qs[_0x7e5b('0x29')](_[_0x7e5b('0x3f')](_0x34915d[_0x7e5b('0x1f')],_0x56f48b[_0x7e5b('0x29')]));_0x10ab82[_0x7e5b('0x40')]['OpenchannelInteractionId']=_0xc1fcd6['id'];if(_0x34915d[_0x7e5b('0x1f')][_0x7e5b('0x41')]){_0x10ab82[_0x7e5b('0x40')]=_[_0x7e5b('0x30')](_0x10ab82['where'],{'$or':_[_0x7e5b('0x19')](_0x10ab82[_0x7e5b('0x2b')],function(_0x540460){var _0x672f3d={};_0x672f3d[_0x540460]={'$like':'%'+_0x34915d[_0x7e5b('0x1f')]['filter']+'%'};return _0x672f3d;})});}if(_0x34915d[_0x7e5b('0x1f')][_0x7e5b('0x42')]){var _0x59dac8=_0x34915d[_0x7e5b('0x1f')][_0x7e5b('0x42')]['split'](',');var _0x6a8d11={};_0x6a8d11[_0x59dac8[0x0]]={'$gte':moment(_0x59dac8[0x1])[_0x7e5b('0x43')]('YYYY-MM-DD\x20HH:mm:ss')};_0x10ab82['where']=_[_0x7e5b('0x30')](_0x10ab82['where'],_0x6a8d11);}_0x10ab82=_[_0x7e5b('0x30')]({},_0x10ab82,_0x34915d[_0x7e5b('0x31')]);return db[_0x7e5b('0x37')][_0x7e5b('0x11')]({'where':_0x10ab82[_0x7e5b('0x40')]})[_0x7e5b('0x14')](function(_0x492a04){_0x10dbd2[_0x7e5b('0x11')]=_0x492a04;if(_0x34915d['query'][_0x7e5b('0x2e')]){_0x10ab82[_0x7e5b('0x2f')]=[{'all':!![]}];}return db[_0x7e5b('0x37')][_0x7e5b('0x1d')](_0x10ab82);})[_0x7e5b('0x14')](function(_0x394446){_0x10dbd2[_0x7e5b('0x44')]=_0x394446;return _0x10dbd2;});}})[_0x7e5b('0x14')](respondWithFilteredResult(_0x5c36a1,_0x10ab82))[_0x7e5b('0x21')](handleError(_0x5c36a1,null));};exports[_0x7e5b('0x45')]=function(_0x14995c,_0x3da5ce){return db[_0x7e5b('0x28')]['find']({'where':{'id':_0x14995c[_0x7e5b('0x25')]['id']}})[_0x7e5b('0x14')](handleEntityNotFound(_0x3da5ce,null))['then'](function(_0x2fda8c){if(_0x2fda8c){return _0x2fda8c[_0x7e5b('0x46')](_0x14995c[_0x7e5b('0x34')][_0x7e5b('0x39')],_[_0x7e5b('0x38')](_0x14995c[_0x7e5b('0x34')],[_0x7e5b('0x39'),'id'])||{})[_0x7e5b('0x47')](function(){return db['Tag'][_0x7e5b('0x1d')]({'attributes':['id',_0x7e5b('0x17'),_0x7e5b('0x48')],'where':{'id':_0x14995c[_0x7e5b('0x34')][_0x7e5b('0x39')]}});})[_0x7e5b('0x14')](function(_0xa08771){socket[_0x7e5b('0x49')](_0x7e5b('0x4a'),{'id':Number(_0x14995c[_0x7e5b('0x25')]['id']),'tags':_0xa08771||[]});return{'id':Number(_0x14995c[_0x7e5b('0x25')]['id']),'tags':_0xa08771||[]};});}})['then'](respondWithResult(_0x3da5ce,null))['catch'](handleError(_0x3da5ce,null));};exports[_0x7e5b('0x4b')]=function(_0x5b7de0,_0x4a18e0){return db['OpenchannelInteraction']['find']({'where':{'id':_0x5b7de0[_0x7e5b('0x25')]['id']}})['then'](handleEntityNotFound(_0x4a18e0,null))[_0x7e5b('0x14')](function(_0x590e61){if(_0x590e61){return _0x590e61['removeTags'](_0x5b7de0[_0x7e5b('0x1f')][_0x7e5b('0x39')]);}})[_0x7e5b('0x14')](respondWithStatusCode(_0x4a18e0,null))[_0x7e5b('0x21')](handleError(_0x4a18e0,null));};exports['download']=function(_0x69d1be,_0x3878b0){var _0x4f970d=moment()[_0x7e5b('0x4c')]()[_0x7e5b('0x4d')]();var _0x1f3c9c=path['join'](config[_0x7e5b('0x4e')],_0x7e5b('0x4f'),_0x7e5b('0x50'),'tmp');var _0x280716=path[_0x7e5b('0x51')](config[_0x7e5b('0x4e')],_0x7e5b('0x4f'),'files',_0x7e5b('0x52'));var _0x8a8d0f=path[_0x7e5b('0x51')](_0x1f3c9c,_0x4f970d);var _0x54592c=util['format'](_0x7e5b('0x53'),_0x69d1be['params']['id'],_0x4f970d);var _0x315a65=path[_0x7e5b('0x51')](_0x1f3c9c,_0x54592c);var _0x103358=[];_0x103358[_0x7e5b('0x54')]({'model':db['User'],'as':'User','attributes':['id',_0x7e5b('0x55')],'raw':!![]});_0x103358[_0x7e5b('0x54')]({'model':db[_0x7e5b('0x56')],'as':_0x7e5b('0x57'),'attributes':['id','firstName',_0x7e5b('0x58')],'raw':!![]});if(_0x69d1be['query'][_0x7e5b('0x52')]){_0x103358[_0x7e5b('0x54')]({'model':db[_0x7e5b('0x59')],'as':_0x7e5b('0x59'),'raw':!![]});}var _0x12440c=[{'model':db['OpenchannelMessage'],'as':_0x7e5b('0x5a'),'attributes':['id',_0x7e5b('0x34'),_0x7e5b('0x5b'),_0x7e5b('0x5c'),_0x7e5b('0x5d'),_0x7e5b('0x5e')],'include':_0x103358}];_0x12440c[_0x7e5b('0x54')]({'model':db[_0x7e5b('0x5f')],'as':'Account','attributes':['id',_0x7e5b('0x17')]});_0x12440c[_0x7e5b('0x54')]({'model':db[_0x7e5b('0x60')],'as':_0x7e5b('0x61'),'attributes':['id','fullname']});return db[_0x7e5b('0x28')][_0x7e5b('0x32')]({'where':{'id':_0x69d1be[_0x7e5b('0x25')]['id']},'include':_0x12440c})[_0x7e5b('0x14')](handleEntityNotFound(_0x3878b0,null))[_0x7e5b('0x14')](function(_0x44c32a){if(_0x44c32a){var _0x533358=_0x44c32a[_0x7e5b('0x62')]({'plain':!![]});fs[_0x7e5b('0x63')](_0x8a8d0f);var _0x4bfe1e={'channel':_0x7e5b('0x64'),'account':_0x533358[_0x7e5b('0x65')]['name'],'agent':_0x533358[_0x7e5b('0x61')]?_0x533358[_0x7e5b('0x61')][_0x7e5b('0x55')]:_0x7e5b('0x66'),'createdAt':moment(_0x533358[_0x7e5b('0x5b')])[_0x7e5b('0x43')](_0x7e5b('0x67'))['toString'](),'closedAt':_0x533358[_0x7e5b('0x68')]?moment(_0x533358[_0x7e5b('0x69')])['format'](_0x7e5b('0x67'))['toString']():'','disposition':_0x533358[_0x7e5b('0x6a')],'visibility':_0x533358['threadId']?_0x7e5b('0x6b'):'Private','messages':_(_0x533358[_0x7e5b('0x5a')])[_0x7e5b('0x41')]({'secret':![]})[_0x7e5b('0x19')](function(_0x30b5b4){if(_0x30b5b4[_0x7e5b('0x59')]){var _0x1eeb12=path[_0x7e5b('0x51')](_0x280716,_0x30b5b4[_0x7e5b('0x59')]['basename']);if(fs[_0x7e5b('0x6c')](_0x1eeb12)){fs[_0x7e5b('0x6d')](_0x1eeb12)[_0x7e5b('0x6e')](fs['createWriteStream'](path['join'](_0x8a8d0f,_0x30b5b4['Attachment'][_0x7e5b('0x6f')])));}}return{'date':moment(_0x30b5b4[_0x7e5b('0x5b')])[_0x7e5b('0x43')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7e5b('0x4d')](),'sender':_0x30b5b4['direction']===_0x7e5b('0x70')?_0x30b5b4[_0x7e5b('0x60')]?_0x30b5b4['User']['fullname']:_0x7e5b('0x71'):_0x30b5b4[_0x7e5b('0x57')][_0x7e5b('0x72')]+(_0x30b5b4['Contact'][_0x7e5b('0x58')]?'\x20'+_0x30b5b4[_0x7e5b('0x57')][_0x7e5b('0x58')]:''),'body':_0x30b5b4[_0x7e5b('0x59')]?_0x30b5b4[_0x7e5b('0x59')]['basename']:_0x30b5b4[_0x7e5b('0x34')],'direction':_0x30b5b4[_0x7e5b('0x5c')]===_0x7e5b('0x70')?'A':'C','secret':_0x30b5b4[_0x7e5b('0x5d')],'read':_0x30b5b4['read'],'attachment':_0x30b5b4[_0x7e5b('0x59')]};})['value']()};return ejs[_0x7e5b('0x73')](path[_0x7e5b('0x51')](config[_0x7e5b('0x4e')],_0x7e5b('0x4f'),'views',_0x7e5b('0x74')),{'interaction':_0x4bfe1e})[_0x7e5b('0x14')](function(_0x35976a){var _0x5ad4af=path[_0x7e5b('0x51')](_0x8a8d0f,_0x7e5b('0x75')+_0x533358['id']+'-'+_0x4f970d+'.pdf');var _0x460e59={'path':_0x5ad4af,'channel':_0x7e5b('0x64'),'interactionId':_0x533358['id']};return pdf[_0x7e5b('0x76')](_0x35976a,_0x460e59);})[_0x7e5b('0x14')](function(){return new Promise(function(_0x408155,_0x426757){zipdir(_0x8a8d0f,{'saveTo':_0x315a65},function(_0x249d13,_0x6bed7d){if(_0x249d13)return _0x426757(_0x249d13);return _0x408155(_0x6bed7d);});})[_0x7e5b('0x14')](function(){return new Promise(function(_0x43e4b6,_0x3a5514){rimraf(_0x8a8d0f,function(_0x5d6108){if(_0x5d6108)_0x3a5514(_0x5d6108);return _0x43e4b6();});});})[_0x7e5b('0x14')](function(){return _0x3878b0[_0x7e5b('0x77')](_0x315a65,_0x54592c,function(_0x52b9e4){if(_0x52b9e4){logger[_0x7e5b('0x16')]('Unable\x20to\x20delete\x20zip\x20file',_0x52b9e4);}else{fs['unlinkSync'](_0x315a65);}});});});}else{return _0x3878b0[_0x7e5b('0xa')](0xc8);}})[_0x7e5b('0x21')](handleError(_0x3878b0,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 2d52cd4..075d635 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 _0x9937=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x9937,0x10b));var _0x7993=function(_0xd3d483,_0xe74da7){_0xd3d483=_0xd3d483-0x0;var _0xbc2c9=_0x9937[_0xd3d483];return _0xbc2c9;};'use strict';var EventEmitter=require(_0x7993('0x0'));var OpenchannelInteraction=require(_0x7993('0x1'))['db'][_0x7993('0x2')];var OpenchannelMessage=require(_0x7993('0x1'))['db'][_0x7993('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7993('0x4')](0x0);var events={'afterCreate':_0x7993('0x5'),'afterUpdate':_0x7993('0x6'),'afterDestroy':_0x7993('0x7')};function emitEvent(_0x45ebd1){return function(_0x1e8c43,_0x41bcc0,_0x270488){_0x1e8c43[_0x7993('0x8')]({'attributes':['id'],'raw':!![]})[_0x7993('0x9')](function(_0x117e21){_0x1e8c43[_0x7993('0xa')](_0x7993('0xb'),_0x117e21[_0x7993('0xc')](function(_0x267025){return{'id':_0x267025['id']};}));return OpenchannelMessage[_0x7993('0xd')]({'where':{'OpenchannelInteractionId':_0x1e8c43['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7993('0x9')](function(_0x21be36){_0x1e8c43[_0x7993('0xa')](_0x7993('0xe'),_0x21be36[_0x7993('0xf')]);OpenchannelInteractionEvents['emit'](_0x45ebd1+':'+_0x1e8c43['id'],_0x1e8c43);OpenchannelInteractionEvents[_0x7993('0x10')](_0x45ebd1,_0x1e8c43);_0x270488(null);})[_0x7993('0x11')](_0x270488(null));};}for(var e in events){if(events[_0x7993('0x12')](e)){var event=events[e];OpenchannelInteraction[_0x7993('0x13')](e,emitEvent(event));}}module[_0x7993('0x14')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1e7b=['then','setDataValue','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers'];(function(_0x43652d,_0x116ed4){var _0x391fb8=function(_0x4a1d8b){while(--_0x4a1d8b){_0x43652d['push'](_0x43652d['shift']());}};_0x391fb8(++_0x116ed4);}(_0x1e7b,0x1c9));var _0xb1e7=function(_0x2a0bc2,_0x33f79b){_0x2a0bc2=_0x2a0bc2-0x0;var _0x840555=_0x1e7b[_0x2a0bc2];return _0x840555;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xb1e7('0x0'))['db'][_0xb1e7('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xb1e7('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb1e7('0x3')](0x0);var events={'afterCreate':_0xb1e7('0x4'),'afterUpdate':_0xb1e7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x34f7fe){return function(_0x538b16,_0x214dbe,_0x7763a2){_0x538b16[_0xb1e7('0x6')]({'attributes':['id'],'raw':!![]})[_0xb1e7('0x7')](function(_0x52df36){_0x538b16[_0xb1e7('0x8')]('Users',_0x52df36[_0xb1e7('0x9')](function(_0x29cbf0){return{'id':_0x29cbf0['id']};}));return OpenchannelMessage[_0xb1e7('0xa')]({'where':{'OpenchannelInteractionId':_0x538b16['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x26ea0d){_0x538b16[_0xb1e7('0x8')](_0xb1e7('0xb'),_0x26ea0d[_0xb1e7('0xc')]);OpenchannelInteractionEvents[_0xb1e7('0xd')](_0x34f7fe+':'+_0x538b16['id'],_0x538b16);OpenchannelInteractionEvents['emit'](_0x34f7fe,_0x538b16);_0x7763a2(null);})['catch'](_0x7763a2(null));};}for(var e in events){if(events[_0xb1e7('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xb1e7('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 25db7e1..750eab9 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 _0xbb6b=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x2f62de,_0x5b93bd){var _0x352ae2=function(_0x4c0747){while(--_0x4c0747){_0x2f62de['push'](_0x2f62de['shift']());}};_0x352ae2(++_0x5b93bd);}(_0xbb6b,0xa9));var _0xbbb6=function(_0x1a9c3c,_0x2492ad){_0x1a9c3c=_0x1a9c3c-0x0;var _0x850ec3=_0xbb6b[_0x1a9c3c];return _0x850ec3;};'use strict';var _=require(_0xbbb6('0x0'));var util=require(_0xbbb6('0x1'));var logger=require(_0xbbb6('0x2'))(_0xbbb6('0x3'));var moment=require(_0xbbb6('0x4'));var BPromise=require('bluebird');var rp=require(_0xbbb6('0x5'));var fs=require('fs');var path=require(_0xbbb6('0x6'));var rimraf=require('rimraf');var config=require(_0xbbb6('0x7'));var attributes=require(_0xbbb6('0x8'));module[_0xbbb6('0x9')]=function(_0x2636df,_0xfc7e45){return _0x2636df[_0xbbb6('0xa')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbbb6('0xb'),'collate':_0xbbb6('0xc'),'hooks':{'beforeUpdate':function(_0x25c8c5,_0x395a92,_0x439bfd){if(_0x25c8c5['changed'](_0xbbb6('0xd'))){_0x25c8c5[_0xbbb6('0xe')]=moment()[_0xbbb6('0xf')](_0xbbb6('0x10'));}_0x439bfd(null,_0x25c8c5);}}});}; \ No newline at end of file +var _0xdf77=['bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x112147,_0x4e692e){var _0x3ba744=function(_0x191b87){while(--_0x191b87){_0x112147['push'](_0x112147['shift']());}};_0x3ba744(++_0x4e692e);}(_0xdf77,0x138));var _0x7df7=function(_0x3fc05c,_0x3fbfd8){_0x3fc05c=_0x3fc05c-0x0;var _0x1d63ac=_0xdf77[_0x3fc05c];return _0x1d63ac;};'use strict';var _=require(_0x7df7('0x0'));var util=require(_0x7df7('0x1'));var logger=require('../../config/logger')(_0x7df7('0x2'));var moment=require('moment');var BPromise=require(_0x7df7('0x3'));var rp=require(_0x7df7('0x4'));var fs=require('fs');var path=require(_0x7df7('0x5'));var rimraf=require(_0x7df7('0x6'));var config=require(_0x7df7('0x7'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x23ab2f,_0x3b1a34){return _0x23ab2f[_0x7df7('0x8')](_0x7df7('0x9'),attributes,{'tableName':_0x7df7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7df7('0xb'),'hooks':{'beforeUpdate':function(_0x20bc0c,_0x164a7b,_0x1bfde6){if(_0x20bc0c['changed'](_0x7df7('0xc'))){_0x20bc0c[_0x7df7('0xd')]=moment()['format'](_0x7df7('0xe'));}_0x1bfde6(null,_0x20bc0c);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 3ef1182..cf11055 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 _0xa9bb=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','then','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x10ca0f,_0x50bb79){var _0x5ca991=function(_0x33c295){while(--_0x33c295){_0x10ca0f['push'](_0x10ca0f['shift']());}};_0x5ca991(++_0x50bb79);}(_0xa9bb,0x126));var _0xba9b=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xa9bb[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xba9b('0x0'));var util=require(_0xba9b('0x1'));var moment=require(_0xba9b('0x2'));var BPromise=require('bluebird');var rs=require(_0xba9b('0x3'));var fs=require('fs');var Redis=require(_0xba9b('0x4'));var db=require(_0xba9b('0x5'))['db'];var utils=require(_0xba9b('0x6'));var logger=require('../../config/logger')(_0xba9b('0x7'));var config=require('../../config/environment');var jayson=require(_0xba9b('0x8'));var client=jayson[_0xba9b('0x9')][_0xba9b('0xa')]({'port':0x232a});config[_0xba9b('0xb')]=_[_0xba9b('0xc')](config['redis'],{'host':_0xba9b('0xd'),'port':0x18eb});var socket=require(_0xba9b('0xe'))(new Redis(config[_0xba9b('0xb')]));require(_0xba9b('0xf'))['register'](socket);function respondWithRpcPromise(_0x1eea74,_0x32cbe5,_0x2e800f){return new BPromise(function(_0x50e7d8,_0x295ec5){return client[_0xba9b('0x10')](_0x1eea74,_0x2e800f)['then'](function(_0x317833){logger[_0xba9b('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x32cbe5,_0xba9b('0x12'));logger[_0xba9b('0x13')](_0xba9b('0x14'),_0x32cbe5,_0xba9b('0x12'),JSON['stringify'](_0x317833));if(_0x317833[_0xba9b('0x15')]){if(_0x317833[_0xba9b('0x15')][_0xba9b('0x16')]===0x1f4){logger[_0xba9b('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x32cbe5,_0x317833[_0xba9b('0x15')][_0xba9b('0x17')]);return _0x295ec5(_0x317833['error']['message']);}logger[_0xba9b('0x15')](_0xba9b('0x18'),_0x32cbe5,_0x317833['error']['message']);return _0x50e7d8(_0x317833[_0xba9b('0x15')][_0xba9b('0x17')]);}else{logger[_0xba9b('0x11')](_0xba9b('0x18'),_0x32cbe5,'request\x20sent');_0x50e7d8(_0x317833[_0xba9b('0x19')][_0xba9b('0x17')]);}})['catch'](function(_0x13e151){logger[_0xba9b('0x15')](_0xba9b('0x18'),_0x32cbe5,_0x13e151);_0x295ec5(_0x13e151);});});}exports[_0xba9b('0x1a')]=function(_0x378263){var _0x4d428e=this;return new Promise(function(_0x5a4d37,_0x2c3a94){return db[_0xba9b('0x1b')][_0xba9b('0x1c')](_0x378263[_0xba9b('0x1d')],{'raw':_0x378263[_0xba9b('0x1e')]?_0x378263[_0xba9b('0x1e')][_0xba9b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378263['options']?_0x378263[_0xba9b('0x1e')][_0xba9b('0x20')]||null:null,'attributes':_0x378263[_0xba9b('0x1e')]?_0x378263[_0xba9b('0x1e')][_0xba9b('0x21')]||null:null,'limit':_0x378263[_0xba9b('0x1e')]?_0x378263[_0xba9b('0x1e')]['limit']||null:null})[_0xba9b('0x22')](function(_0x145bd3){logger[_0xba9b('0x11')](_0xba9b('0x1a'),_0x378263);logger[_0xba9b('0x13')](_0xba9b('0x1a'),_0x378263,JSON['stringify'](_0x145bd3));_0x5a4d37(_0x145bd3);})['catch'](function(_0x41a607){logger[_0xba9b('0x15')](_0xba9b('0x1a'),_0x41a607['message'],_0x378263);_0x2c3a94(_0x4d428e[_0xba9b('0x15')](0x1f4,_0x41a607['message']));});});};exports[_0xba9b('0x23')]=function(_0x34f1b5){return new Promise(function(_0x550287,_0x37f9de){return db[_0xba9b('0x1b')][_0xba9b('0x24')]({'where':_0x34f1b5[_0xba9b('0x1e')]?_0x34f1b5[_0xba9b('0x1e')][_0xba9b('0x20')]||null:null})['then'](function(_0x573819){if(_0x573819){return _0x573819[_0xba9b('0x25')](_0x34f1b5['body'][_0xba9b('0x26')],_[_0xba9b('0x27')](_0x34f1b5['body'],[_0xba9b('0x26'),'id'])||{});}})[_0xba9b('0x28')](function(_0x4d5df1){logger[_0xba9b('0x11')]('AddTags',_0x34f1b5);logger['debug'](_0xba9b('0x29'),_0x34f1b5,JSON[_0xba9b('0x2a')](_0x4d5df1));_0x550287(_0x4d5df1);})['catch'](function(_0xd10edb){logger[_0xba9b('0x15')](_0xba9b('0x29'),_0xd10edb[_0xba9b('0x17')],_0x34f1b5);_0x37f9de(_this[_0xba9b('0x15')](0x1f4,_0xd10edb[_0xba9b('0x17')]));});});}; \ No newline at end of file +var _0xa881=['./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','raw','options','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa881,0x6c));var _0x1a88=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa881[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1a88('0x0'));var util=require('util');var moment=require(_0x1a88('0x1'));var BPromise=require(_0x1a88('0x2'));var rs=require(_0x1a88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a88('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a88('0x5'))(_0x1a88('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a88('0x7'));var client=jayson[_0x1a88('0x8')][_0x1a88('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1a88('0xa')],{'host':_0x1a88('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a88('0xa')]));require(_0x1a88('0xc'))[_0x1a88('0xd')](socket);function respondWithRpcPromise(_0x94c6a9,_0xa1053a,_0x420cc0){return new BPromise(function(_0x515ce9,_0x4b62f6){return client[_0x1a88('0xe')](_0x94c6a9,_0x420cc0)[_0x1a88('0xf')](function(_0x1c10f2){logger[_0x1a88('0x10')](_0x1a88('0x11'),_0xa1053a,'request\x20sent');logger[_0x1a88('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xa1053a,_0x1a88('0x13'),JSON[_0x1a88('0x14')](_0x1c10f2));if(_0x1c10f2[_0x1a88('0x15')]){if(_0x1c10f2[_0x1a88('0x15')][_0x1a88('0x16')]===0x1f4){logger[_0x1a88('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0xa1053a,_0x1c10f2[_0x1a88('0x15')][_0x1a88('0x17')]);return _0x4b62f6(_0x1c10f2[_0x1a88('0x15')]['message']);}logger['error'](_0x1a88('0x11'),_0xa1053a,_0x1c10f2[_0x1a88('0x15')][_0x1a88('0x17')]);return _0x515ce9(_0x1c10f2[_0x1a88('0x15')][_0x1a88('0x17')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xa1053a,'request\x20sent');_0x515ce9(_0x1c10f2['result'][_0x1a88('0x17')]);}})[_0x1a88('0x18')](function(_0xf3d00e){logger['error'](_0x1a88('0x11'),_0xa1053a,_0xf3d00e);_0x4b62f6(_0xf3d00e);});});}exports[_0x1a88('0x19')]=function(_0x31bfba){var _0x19e2ea=this;return new Promise(function(_0x24ee1f,_0x1963da){return db[_0x1a88('0x1a')][_0x1a88('0x1b')](_0x31bfba[_0x1a88('0x1c')],{'raw':_0x31bfba['options']?_0x31bfba['options'][_0x1a88('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31bfba[_0x1a88('0x1e')]?_0x31bfba[_0x1a88('0x1e')][_0x1a88('0x1f')]||null:null,'attributes':_0x31bfba['options']?_0x31bfba[_0x1a88('0x1e')][_0x1a88('0x20')]||null:null,'limit':_0x31bfba[_0x1a88('0x1e')]?_0x31bfba[_0x1a88('0x1e')][_0x1a88('0x21')]||null:null})['then'](function(_0x2419a4){logger[_0x1a88('0x10')]('UpdateOpenchannelInteraction',_0x31bfba);logger['debug']('UpdateOpenchannelInteraction',_0x31bfba,JSON['stringify'](_0x2419a4));_0x24ee1f(_0x2419a4);})[_0x1a88('0x18')](function(_0xe477ea){logger[_0x1a88('0x15')](_0x1a88('0x19'),_0xe477ea[_0x1a88('0x17')],_0x31bfba);_0x1963da(_0x19e2ea[_0x1a88('0x15')](0x1f4,_0xe477ea[_0x1a88('0x17')]));});});};exports[_0x1a88('0x22')]=function(_0x4559b3){return new Promise(function(_0x4c62d1,_0x23e06d){return db[_0x1a88('0x1a')]['find']({'where':_0x4559b3[_0x1a88('0x1e')]?_0x4559b3[_0x1a88('0x1e')][_0x1a88('0x1f')]||null:null})['then'](function(_0x54b8fd){if(_0x54b8fd){return _0x54b8fd[_0x1a88('0x23')](_0x4559b3['body'][_0x1a88('0x24')],_[_0x1a88('0x25')](_0x4559b3['body'],[_0x1a88('0x24'),'id'])||{});}})[_0x1a88('0x26')](function(_0x510975){logger[_0x1a88('0x10')]('AddTags',_0x4559b3);logger['debug'](_0x1a88('0x27'),_0x4559b3,JSON[_0x1a88('0x14')](_0x510975));_0x4c62d1(_0x510975);})[_0x1a88('0x18')](function(_0x38c00e){logger[_0x1a88('0x15')](_0x1a88('0x27'),_0x38c00e[_0x1a88('0x17')],_0x4559b3);_0x23e06d(_this['error'](0x1f4,_0x38c00e[_0x1a88('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 52ee410..660cf92 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 _0x1c24=['removeListener','length','update','emit'];(function(_0x231750,_0xa66133){var _0x277283=function(_0x47e472){while(--_0x47e472){_0x231750['push'](_0x231750['shift']());}};_0x277283(++_0xa66133);}(_0x1c24,0xda));var _0x41c2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1c24[_0x3e5086];return _0xfeb102;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save','remove',_0x41c2('0x0')];function createListener(_0x1cfeed,_0x11c2a7){return function(_0x244b2f){_0x11c2a7[_0x41c2('0x1')](_0x1cfeed,_0x244b2f);};}function removeListener(_0x191e2f,_0x4e2e70){return function(){OpenchannelInteractionEvents[_0x41c2('0x2')](_0x191e2f,_0x4e2e70);};}exports['register']=function(_0x7ea8ca){for(var _0x33fd2b=0x0,_0x493297=events[_0x41c2('0x3')];_0x33fd2b<_0x493297;_0x33fd2b++){var _0x4ac03f=events[_0x33fd2b];var _0x578346=createListener('openchannelInteraction:'+_0x4ac03f,_0x7ea8ca);OpenchannelInteractionEvents['on'](_0x4ac03f,_0x578346);}}; \ No newline at end of file +var _0x7cc9=['openchannelInteraction:','save','update','emit','register','length'];(function(_0x36f580,_0x4599a1){var _0x133657=function(_0x2bef12){while(--_0x2bef12){_0x36f580['push'](_0x36f580['shift']());}};_0x133657(++_0x4599a1);}(_0x7cc9,0x67));var _0x97cc=function(_0x132b71,_0x25f23e){_0x132b71=_0x132b71-0x0;var _0x224664=_0x7cc9[_0x132b71];return _0x224664;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x97cc('0x0'),'remove',_0x97cc('0x1')];function createListener(_0x49a36b,_0x25a048){return function(_0x2e33db){_0x25a048[_0x97cc('0x2')](_0x49a36b,_0x2e33db);};}function removeListener(_0x23df2c,_0x38b69a){return function(){OpenchannelInteractionEvents['removeListener'](_0x23df2c,_0x38b69a);};}exports[_0x97cc('0x3')]=function(_0x386294){for(var _0x291de3=0x0,_0x583068=events[_0x97cc('0x4')];_0x291de3<_0x583068;_0x291de3++){var _0x360a09=events[_0x291de3];var _0x1490c1=createListener(_0x97cc('0x5')+_0x360a09,_0x386294);OpenchannelInteractionEvents['on'](_0x360a09,_0x1490c1);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index fe112e4..32b7a36 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(_0x318032,_0x5b4144){var _0x2023c1=function(_0xb08c45){while(--_0xb08c45){_0x318032['push'](_0x318032['shift']());}};_0x2023c1(++_0x5b4144);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x4f36be,_0x3a46ce){var _0x4995f0=function(_0x192a20){while(--_0x192a20){_0x4f36be['push'](_0x4f36be['shift']());}};_0x4995f0(++_0x3a46ce);}(_0xe706,0xa3));var _0x6e70=function(_0x112c0d,_0x5af795){_0x112c0d=_0x112c0d-0x0;var _0xcb9325=_0xe706[_0x112c0d];return _0xcb9325;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 84ab46f..4230bf8 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 _0xb5fb=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0xb5fb,0x172));var _0xbb5f=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xb5fb[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0xbb5f('0x0'));module[_0xbb5f('0x1')]={'body':{'type':Sequelize[_0xbb5f('0x2')](_0xbb5f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbb5f('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbb5f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbb5f('0x5')]('in',_0xbb5f('0x6')),'defaultValue':_0xbb5f('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbb5f('0x7')]},'providerName':{'type':Sequelize[_0xbb5f('0x8')]},'providerResponse':{'type':Sequelize[_0xbb5f('0x2')]}}; \ No newline at end of file +var _0x777d=['TEXT','medium','BOOLEAN','ENUM','STRING','exports'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x777d,0xe9));var _0xd777=function(_0x39cdb8,_0x15ee98){_0x39cdb8=_0x39cdb8-0x0;var _0x44bbc9=_0x777d[_0x39cdb8];return _0x44bbc9;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'body':{'type':Sequelize[_0xd777('0x1')](_0xd777('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd777('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd777('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd777('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 40c7c1f..e403861 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 _0x010a=['rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','stack','name','index','OpenchannelMessage','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','map','VIRTUAL','filter','includeAll','show','params','keys','include','find','create','body','destroy','describe','openchannel-interactions','readAt','format','UserId','user','get','OpenchannelInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','reject','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','event'];(function(_0x5c6bc5,_0x579fb4){var _0x5684e3=function(_0x42a768){while(--_0x42a768){_0x5c6bc5['push'](_0x5c6bc5['shift']());}};_0x5684e3(++_0x579fb4);}(_0x010a,0x1f4));var _0xa010=function(_0x56aa4c,_0x49168d){_0x56aa4c=_0x56aa4c-0x0;var _0x4338d0=_0x010a[_0x56aa4c];return _0x4338d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa010('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa010('0x1'));var rp=require(_0xa010('0x2'));var moment=require('moment');var BPromise=require(_0xa010('0x3'));var Mustache=require(_0xa010('0x4'));var util=require(_0xa010('0x5'));var path=require(_0xa010('0x6'));var sox=require(_0xa010('0x7'));var csv=require(_0xa010('0x8'));var ejs=require(_0xa010('0x9'));var fs=require('fs');var fs_extra=require(_0xa010('0xa'));var _=require(_0xa010('0xb'));var squel=require('squel');var crypto=require(_0xa010('0xc'));var jsforce=require(_0xa010('0xd'));var deskjs=require(_0xa010('0xe'));var toCsv=require(_0xa010('0x8'));var querystring=require('querystring');var Papa=require(_0xa010('0xf'));var Redis=require(_0xa010('0x10'));var authService=require(_0xa010('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa010('0x12'));var hardwareService=require(_0xa010('0x13'));var logger=require(_0xa010('0x14'))(_0xa010('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa010('0x16'));var db=require(_0xa010('0x17'))['db'];config['redis']=_[_0xa010('0x18')](config['redis'],{'host':_0xa010('0x19'),'port':0x18eb});var socket=require(_0xa010('0x1a'))(new Redis(config['redis']));require(_0xa010('0x1b'))[_0xa010('0x1c')](socket);var jayson=require(_0xa010('0x1d'));var client=jayson[_0xa010('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xa010('0x1e')][_0xa010('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2d72a8,_0x283a93,_0x1dd776,_0x4ffaba){return new BPromise(function(_0x1c9077,_0x33d453){var _0x121c2c=_0x4ffaba||client;return _0x121c2c['request'](_0x2d72a8,_0x1dd776)[_0xa010('0x20')](function(_0x507529){logger['info'](_0xa010('0x21'),_0x283a93,_0xa010('0x22'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x283a93,_0xa010('0x22'),JSON[_0xa010('0x23')](_0x507529));if(_0x507529[_0xa010('0x24')]){if(_0x507529[_0xa010('0x24')][_0xa010('0x25')]===0x1f4){logger[_0xa010('0x24')](_0xa010('0x21'),_0x283a93,_0x507529[_0xa010('0x24')][_0xa010('0x26')]);return _0x33d453(_0x507529[_0xa010('0x24')][_0xa010('0x26')]);}logger[_0xa010('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x283a93,_0x507529[_0xa010('0x24')]['message']);return _0x1c9077(_0x507529[_0xa010('0x24')][_0xa010('0x26')]);}else{logger[_0xa010('0x27')](_0xa010('0x21'),_0x283a93,_0xa010('0x22'));_0x1c9077(_0x507529[_0xa010('0x28')][_0xa010('0x26')]);}})[_0xa010('0x29')](function(_0x3fe373){logger[_0xa010('0x24')](_0xa010('0x21'),_0x283a93,_0x3fe373);_0x33d453(_0x3fe373);});});}function respondWithStatusCode(_0x1abd6a,_0x1984b0){_0x1984b0=_0x1984b0||0xcc;return function(_0x541d97){if(_0x541d97){return _0x1abd6a[_0xa010('0x2a')](_0x1984b0);}return _0x1abd6a[_0xa010('0x2b')](_0x1984b0)[_0xa010('0x2c')]();};}function respondWithResult(_0x33f23e,_0x3824b4){_0x3824b4=_0x3824b4||0xc8;return function(_0x2c55d7){if(_0x2c55d7){return _0x33f23e['status'](_0x3824b4)[_0xa010('0x2d')](_0x2c55d7);}};}function respondWithFilteredResult(_0x4e77ff,_0x1f02e3){return function(_0x10b210){if(_0x10b210){var _0x386018=typeof _0x1f02e3[_0xa010('0x2e')]===_0xa010('0x2f')&&typeof _0x1f02e3['limit']===_0xa010('0x2f');var _0x5dd93f=_0x10b210[_0xa010('0x30')];var _0x528bff=_0x386018?0x0:_0x1f02e3[_0xa010('0x2e')];var _0x5d0fa2=_0x386018?_0x10b210[_0xa010('0x30')]:_0x1f02e3['offset']+_0x1f02e3[_0xa010('0x31')];var _0x2a1757;if(_0x5d0fa2>=_0x5dd93f){_0x5d0fa2=_0x5dd93f;_0x2a1757=0xc8;}else{_0x2a1757=0xce;}_0x4e77ff['status'](_0x2a1757);return _0x4e77ff[_0xa010('0x32')]('Content-Range',_0x528bff+'-'+_0x5d0fa2+'/'+_0x5dd93f)['json'](_0x10b210);}return null;};}function patchUpdates(_0xf7fc95){return function(_0x5746ca){try{jsonpatch[_0xa010('0x33')](_0x5746ca,_0xf7fc95,!![]);}catch(_0x490319){return BPromise['reject'](_0x490319);}return _0x5746ca[_0xa010('0x34')]();};}function saveUpdates(_0x4fb2ba,_0x35b90b){return function(_0x413b65){if(_0x413b65){return _0x413b65[_0xa010('0x35')](_0x4fb2ba)['then'](function(_0x5665c1){return _0x5665c1;});}return null;};}function removeEntity(_0x34fbfc,_0x4a2fa2){return function(_0x2dfb5f){if(_0x2dfb5f){return _0x2dfb5f['destroy']()['then'](function(){_0x34fbfc[_0xa010('0x2b')](0xcc)[_0xa010('0x2c')]();});}};}function handleEntityNotFound(_0x253207,_0x5a9002){return function(_0x2df0a3){if(!_0x2df0a3){_0x253207['sendStatus'](0x194);}return _0x2df0a3;};}function handleError(_0x2ea131,_0x3c4434){_0x3c4434=_0x3c4434||0x1f4;return function(_0xe164db){logger[_0xa010('0x24')](_0xe164db[_0xa010('0x36')]);if(_0xe164db[_0xa010('0x37')]){delete _0xe164db[_0xa010('0x37')];}_0x2ea131[_0xa010('0x2b')](_0x3c4434)['send'](_0xe164db);};}exports[_0xa010('0x38')]=function(_0x21ca06,_0x289d96){var _0xf1764e={},_0x52faf1={},_0xc85d3d={'count':0x0,'rows':[]};var _0x411864=_['map'](db[_0xa010('0x39')][_0xa010('0x3a')],function(_0xabcc13){return{'name':_0xabcc13['fieldName'],'type':_0xabcc13['type'][_0xa010('0x3b')]};});_0x52faf1['model']=_['map'](_0x411864,_0xa010('0x37'));_0x52faf1['query']=_['keys'](_0x21ca06[_0xa010('0x3c')]);_0x52faf1[_0xa010('0x3d')]=_[_0xa010('0x3e')](_0x52faf1[_0xa010('0x3f')],_0x52faf1[_0xa010('0x3c')]);_0xf1764e[_0xa010('0x40')]=_[_0xa010('0x3e')](_0x52faf1[_0xa010('0x3f')],qs[_0xa010('0x41')](_0x21ca06[_0xa010('0x3c')][_0xa010('0x41')]));_0xf1764e[_0xa010('0x40')]=_0xf1764e[_0xa010('0x40')][_0xa010('0x42')]?_0xf1764e[_0xa010('0x40')]:_0x52faf1[_0xa010('0x3f')];if(!_0x21ca06['query'][_0xa010('0x43')](_0xa010('0x44'))){_0xf1764e[_0xa010('0x31')]=qs[_0xa010('0x31')](_0x21ca06[_0xa010('0x3c')][_0xa010('0x31')]);_0xf1764e[_0xa010('0x2e')]=qs[_0xa010('0x2e')](_0x21ca06['query'][_0xa010('0x2e')]);}_0xf1764e[_0xa010('0x45')]=qs['sort'](_0x21ca06['query']['sort']);_0xf1764e[_0xa010('0x46')]=qs[_0xa010('0x3d')](_['pick'](_0x21ca06[_0xa010('0x3c')],_0x52faf1[_0xa010('0x3d')]),_0x411864);if(_0x21ca06[_0xa010('0x3c')]['filter']){_0xf1764e[_0xa010('0x46')]=_[_0xa010('0x47')](_0xf1764e[_0xa010('0x46')],{'$or':_[_0xa010('0x48')](_0x411864,function(_0x534288){if(_0x534288['type']!==_0xa010('0x49')){var _0x2fef62={};_0x2fef62[_0x534288['name']]={'$like':'%'+_0x21ca06[_0xa010('0x3c')][_0xa010('0x4a')]+'%'};return _0x2fef62;}})});}_0xf1764e=_[_0xa010('0x47')]({},_0xf1764e,_0x21ca06['options']);var _0x334f6f={'where':_0xf1764e[_0xa010('0x46')]};return db[_0xa010('0x39')][_0xa010('0x30')](_0x334f6f)[_0xa010('0x20')](function(_0x27e971){_0xc85d3d['count']=_0x27e971;if(_0x21ca06[_0xa010('0x3c')][_0xa010('0x4b')]){_0xf1764e['include']=[{'all':!![]}];}return db[_0xa010('0x39')]['findAll'](_0xf1764e);})[_0xa010('0x20')](function(_0x298a34){_0xc85d3d['rows']=_0x298a34;return _0xc85d3d;})['then'](respondWithFilteredResult(_0x289d96,_0xf1764e))[_0xa010('0x29')](handleError(_0x289d96,null));};exports[_0xa010('0x4c')]=function(_0x22436b,_0xb0fac1){var _0x46879c={'raw':!![],'where':{'id':_0x22436b[_0xa010('0x4d')]['id']}},_0x36c1c6={};_0x36c1c6[_0xa010('0x3f')]=_[_0xa010('0x4e')](db['OpenchannelMessage'][_0xa010('0x3a')]);_0x36c1c6[_0xa010('0x3c')]=_['keys'](_0x22436b[_0xa010('0x3c')]);_0x36c1c6['filters']=_[_0xa010('0x3e')](_0x36c1c6['model'],_0x36c1c6[_0xa010('0x3c')]);_0x46879c[_0xa010('0x40')]=_[_0xa010('0x3e')](_0x36c1c6[_0xa010('0x3f')],qs[_0xa010('0x41')](_0x22436b[_0xa010('0x3c')][_0xa010('0x41')]));_0x46879c['attributes']=_0x46879c[_0xa010('0x40')][_0xa010('0x42')]?_0x46879c[_0xa010('0x40')]:_0x36c1c6[_0xa010('0x3f')];if(_0x22436b[_0xa010('0x3c')][_0xa010('0x4b')]){_0x46879c[_0xa010('0x4f')]=[{'all':!![]}];}_0x46879c=_['merge']({},_0x46879c,_0x22436b['options']);return db[_0xa010('0x39')][_0xa010('0x50')](_0x46879c)[_0xa010('0x20')](handleEntityNotFound(_0xb0fac1,null))[_0xa010('0x20')](respondWithResult(_0xb0fac1,null))[_0xa010('0x29')](handleError(_0xb0fac1,null));};exports[_0xa010('0x51')]=function(_0x2286a8,_0x1af429){return db[_0xa010('0x39')][_0xa010('0x51')](_0x2286a8[_0xa010('0x52')],{})[_0xa010('0x20')](respondWithResult(_0x1af429,0xc9))[_0xa010('0x29')](handleError(_0x1af429,null));};exports[_0xa010('0x35')]=function(_0x2763c1,_0x15c36c){if(_0x2763c1[_0xa010('0x52')]['id']){delete _0x2763c1[_0xa010('0x52')]['id'];}return db[_0xa010('0x39')][_0xa010('0x50')]({'where':{'id':_0x2763c1['params']['id']}})['then'](handleEntityNotFound(_0x15c36c,null))['then'](saveUpdates(_0x2763c1[_0xa010('0x52')],null))[_0xa010('0x20')](respondWithResult(_0x15c36c,null))['catch'](handleError(_0x15c36c,null));};exports[_0xa010('0x53')]=function(_0x33b275,_0x4ad5f5){return db[_0xa010('0x39')][_0xa010('0x50')]({'where':{'id':_0x33b275['params']['id']}})['then'](handleEntityNotFound(_0x4ad5f5,null))[_0xa010('0x20')](removeEntity(_0x4ad5f5,null))[_0xa010('0x29')](handleError(_0x4ad5f5,null));};exports[_0xa010('0x54')]=function(_0x207ac7,_0xb32e3c){return db[_0xa010('0x39')][_0xa010('0x54')]()['then'](respondWithResult(_0xb32e3c,null))['catch'](handleError(_0xb32e3c,null));};var interaction_log=require(_0xa010('0x14'))(_0xa010('0x55'));exports['accept']=function(_0x16a9cd,_0x5796c0,_0x288010){var _0x52f3dd={'agent':{},'channel':'openchannel'};if(_0x16a9cd[_0xa010('0x52')]['id']){delete _0x16a9cd[_0xa010('0x52')]['id'];}_0x16a9cd[_0xa010('0x52')]['read']=!![];_0x16a9cd[_0xa010('0x52')][_0xa010('0x56')]=moment()[_0xa010('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x16a9cd['body'][_0xa010('0x58')]=_0x16a9cd['body'][_0xa010('0x58')]||_0x16a9cd[_0xa010('0x59')]['id'];_0x52f3dd['agent']['id']=_0x16a9cd[_0xa010('0x52')][_0xa010('0x58')];return db['OpenchannelMessage'][_0xa010('0x50')]({'where':{'id':_0x16a9cd[_0xa010('0x4d')]['id'],'UserId':null}})[_0xa010('0x20')](handleEntityNotFound(_0x5796c0,null))[_0xa010('0x20')](saveUpdates(_0x16a9cd[_0xa010('0x52')],null))['then'](function(_0x20c72b){if(_0x20c72b){_0x52f3dd[_0xa010('0x26')]=_0x20c72b[_0xa010('0x5a')]({'plain':!![]});return db[_0xa010('0x5b')]['find']({'where':{'id':_0x20c72b['OpenchannelInteractionId']}});}return null;})[_0xa010('0x20')](handleEntityNotFound(_0x5796c0,null))['then'](function(_0x5dd56a){if(_0x5dd56a){return _0x5dd56a[_0xa010('0x35')]({'UserId':_0x16a9cd['body'][_0xa010('0x58')],'read1stAt':_['isNil'](_0x5dd56a[_0xa010('0x5c')])?moment()[_0xa010('0x57')](_0xa010('0x5d')):undefined});}return null;})['then'](function(_0x18ef41){if(_0x18ef41){_0x52f3dd[_0xa010('0x5e')]=_0x18ef41[_0xa010('0x5a')]({'plain':!![]});interaction_log[_0xa010('0x27')](_0xa010('0x5f'),_0x16a9cd[_0xa010('0x59')]['id'],_0x16a9cd['user']['name'],_0x16a9cd[_0xa010('0x59')]['role'],_0x52f3dd[_0xa010('0x5e')]['id'],_0x16a9cd[_0xa010('0x52')]?JSON[_0xa010('0x23')](_0x16a9cd[_0xa010('0x52')]):'null');return respondWithRpcPromise(_0xa010('0x60'),_0xa010('0x61'),_0x52f3dd);}return null;})[_0xa010('0x20')](function(_0x87a1bd){var _0x165c5b=_0xa010('0x62')+_0x87a1bd[_0xa010('0x26')][_0xa010('0x63')];return db[_0xa010('0x64')][_0xa010('0x3c')](_0x165c5b,{'type':db[_0xa010('0x65')][_0xa010('0x66')][_0xa010('0x67')],'raw':!![]})['then'](function(_0xc0ae78){return _0xc0ae78;});})[_0xa010('0x20')](function(_0x3c3263){if(_0x3c3263){_0x52f3dd[_0xa010('0x26')][_0xa010('0x68')]=_0x3c3263[0x0];if(!_0x16a9cd[_0xa010('0x52')][_0xa010('0x58')])return;return db[_0xa010('0x69')][_0xa010('0x50')]({'where':{'id':_0x16a9cd[_0xa010('0x52')][_0xa010('0x58')],'role':_0xa010('0x6a')},'attributes':['id','name',_0xa010('0x6b'),_0xa010('0x6c'),_0xa010('0x6d')],'raw':!![]});}return null;})[_0xa010('0x20')](function(_0x5c36ae){if(!_0x5c36ae)return null;_0x52f3dd[_0xa010('0x26')][_0xa010('0x6a')]=_0x5c36ae;return _0x52f3dd;})[_0xa010('0x20')](function(_0x3ca9a5){if(_0x3ca9a5){if(_0x16a9cd[_0xa010('0x52')]['manual']){_0x52f3dd['message'][_0xa010('0x6e')]=util[_0xa010('0x57')](_0xa010('0x6f'),_0x16a9cd[_0xa010('0x59')][_0xa010('0x37')]);_0x52f3dd[_0xa010('0x26')][_0xa010('0x70')]=_0x52f3dd[_0xa010('0x70')];_0x52f3dd[_0xa010('0x26')][_0xa010('0x71')]=_0x52f3dd[_0xa010('0x70')];_0x52f3dd[_0xa010('0x26')]['event']=_0xa010('0x72');return respondWithRpcPromise(_0xa010('0x73'),_0xa010('0x73'),{'event':_0xa010('0x74'),'message':_0x52f3dd['message']},client9002)[_0xa010('0x20')](function(){return _0x52f3dd;});}return _0x52f3dd;}return null;})[_0xa010('0x20')](respondWithResult(_0x5796c0,null))[_0xa010('0x29')](handleError(_0x5796c0,null));};var interaction_log=require(_0xa010('0x14'))(_0xa010('0x55'));exports[_0xa010('0x75')]=function(_0xc76c5a,_0x3a5b03,_0xbde39e){var _0x17724e={'agent':{},'channel':'openchannel'};if(_0xc76c5a['body']['id']){delete _0xc76c5a[_0xa010('0x52')]['id'];}_0xc76c5a[_0xa010('0x52')][_0xa010('0x58')]=_0xc76c5a[_0xa010('0x52')][_0xa010('0x58')]||_0xc76c5a[_0xa010('0x59')]['id'];_0x17724e['agent']['id']=_0xc76c5a[_0xa010('0x52')]['UserId'];return db[_0xa010('0x39')][_0xa010('0x50')]({'where':{'id':_0xc76c5a[_0xa010('0x4d')]['id'],'UserId':null}})[_0xa010('0x20')](handleEntityNotFound(_0x3a5b03,null))[_0xa010('0x20')](function(_0x198a1e){if(_0x198a1e){_0x17724e['message']=_0x198a1e[_0xa010('0x5a')]({'plain':!![]});return db[_0xa010('0x5b')][_0xa010('0x50')]({'where':{'id':_0x198a1e[_0xa010('0x76')]}});}return null;})[_0xa010('0x20')](handleEntityNotFound(_0x3a5b03,null))[_0xa010('0x20')](function(_0x586236){if(_0x586236){_0x17724e[_0xa010('0x5e')]=_0x586236[_0xa010('0x5a')]({'plain':!![]});interaction_log[_0xa010('0x27')](_0xa010('0x77'),_0xc76c5a[_0xa010('0x59')]['id'],_0xc76c5a['user'][_0xa010('0x37')],_0xc76c5a[_0xa010('0x59')][_0xa010('0x78')],_0x17724e['interaction']['id'],_0xc76c5a['body']?JSON[_0xa010('0x23')](_0xc76c5a[_0xa010('0x52')]):_0xa010('0x79'));return respondWithRpcPromise(_0xa010('0x7a'),_0xa010('0x7b'),_0x17724e);}return null;})[_0xa010('0x20')](function(_0x57ce84){var _0x431a1d=_0xa010('0x62')+_0x57ce84[_0xa010('0x26')][_0xa010('0x63')];return db[_0xa010('0x64')][_0xa010('0x3c')](_0x431a1d,{'type':db[_0xa010('0x65')]['QueryTypes'][_0xa010('0x67')],'raw':!![]})[_0xa010('0x20')](function(_0x2b5af1){return _0x2b5af1;});})['then'](function(_0x194c88){if(_0x194c88){_0x17724e[_0xa010('0x26')][_0xa010('0x68')]=_0x194c88[0x0];if(!_0xc76c5a['body']['UserId'])return;return db[_0xa010('0x69')][_0xa010('0x50')]({'where':{'id':_0xc76c5a['body'][_0xa010('0x58')],'role':_0xa010('0x6a')},'attributes':['id','name',_0xa010('0x6b'),_0xa010('0x6c'),_0xa010('0x6d')],'raw':!![]});}return null;})['then'](function(_0x12a204){if(!_0x12a204)return null;_0x17724e[_0xa010('0x26')]['agent']=_0x12a204;return _0x17724e;})['then'](function(_0x5330fc){if(_0x5330fc){_0x5330fc['message']['interface']=util[_0xa010('0x57')](_0xa010('0x6f'),_0xc76c5a[_0xa010('0x59')]['name']);_0x5330fc[_0xa010('0x26')]['channel']=_0x17724e[_0xa010('0x70')];_0x5330fc['message']['motionChannel']=_0x17724e['channel'];_0x5330fc[_0xa010('0x26')][_0xa010('0x7c')]=_0xa010('0x75');respondWithRpcPromise(_0xa010('0x73'),'EventManager',{'event':'rejectmessage','message':_0x5330fc[_0xa010('0x26')]},client9002);return _0x17724e;}return null;})['then'](respondWithResult(_0x3a5b03,null))[_0xa010('0x29')](handleError(_0x3a5b03,null));}; \ No newline at end of file +var _0x49ad=['send','map','OpenchannelMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','destroy','end','stack','name'];(function(_0x459573,_0x35679e){var _0x51ffcd=function(_0x37bb90){while(--_0x37bb90){_0x459573['push'](_0x459573['shift']());}};_0x51ffcd(++_0x35679e);}(_0x49ad,0x1e3));var _0xd49a=function(_0x5ada87,_0x596cfd){_0x5ada87=_0x5ada87-0x0;var _0x424d8e=_0x49ad[_0x5ada87];return _0x424d8e;};'use strict';var emlformat=require(_0xd49a('0x0'));var rimraf=require(_0xd49a('0x1'));var zipdir=require(_0xd49a('0x2'));var jsonpatch=require(_0xd49a('0x3'));var rp=require(_0xd49a('0x4'));var moment=require(_0xd49a('0x5'));var BPromise=require(_0xd49a('0x6'));var Mustache=require(_0xd49a('0x7'));var util=require(_0xd49a('0x8'));var path=require(_0xd49a('0x9'));var sox=require(_0xd49a('0xa'));var csv=require(_0xd49a('0xb'));var ejs=require(_0xd49a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd49a('0xd'));var crypto=require(_0xd49a('0xe'));var jsforce=require(_0xd49a('0xf'));var deskjs=require(_0xd49a('0x10'));var toCsv=require(_0xd49a('0xb'));var querystring=require(_0xd49a('0x11'));var Papa=require(_0xd49a('0x12'));var Redis=require(_0xd49a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd49a('0x14'));var as=require(_0xd49a('0x15'));var hardwareService=require(_0xd49a('0x16'));var logger=require(_0xd49a('0x17'))('api');var utils=require(_0xd49a('0x18'));var config=require(_0xd49a('0x19'));var licenseUtil=require(_0xd49a('0x1a'));var db=require(_0xd49a('0x1b'))['db'];config['redis']=_[_0xd49a('0x1c')](config['redis'],{'host':_0xd49a('0x1d'),'port':0x18eb});var socket=require(_0xd49a('0x1e'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0xd49a('0x1f')](socket);var jayson=require(_0xd49a('0x20'));var client=jayson[_0xd49a('0x21')][_0xd49a('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ef333,_0x594400,_0x16a4a2,_0x5e00e6){return new BPromise(function(_0x4f4603,_0x4a4a2d){var _0x1824aa=_0x5e00e6||client;return _0x1824aa[_0xd49a('0x23')](_0x1ef333,_0x16a4a2)[_0xd49a('0x24')](function(_0x5b5b2c){logger['info'](_0xd49a('0x25'),_0x594400,'request\x20sent');logger[_0xd49a('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x594400,_0xd49a('0x27'),JSON['stringify'](_0x5b5b2c));if(_0x5b5b2c[_0xd49a('0x28')]){if(_0x5b5b2c['error'][_0xd49a('0x29')]===0x1f4){logger[_0xd49a('0x28')](_0xd49a('0x25'),_0x594400,_0x5b5b2c['error'][_0xd49a('0x2a')]);return _0x4a4a2d(_0x5b5b2c['error'][_0xd49a('0x2a')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x594400,_0x5b5b2c[_0xd49a('0x28')][_0xd49a('0x2a')]);return _0x4f4603(_0x5b5b2c['error'][_0xd49a('0x2a')]);}else{logger[_0xd49a('0x2b')](_0xd49a('0x25'),_0x594400,_0xd49a('0x27'));_0x4f4603(_0x5b5b2c[_0xd49a('0x2c')][_0xd49a('0x2a')]);}})['catch'](function(_0x45a6ed){logger[_0xd49a('0x28')](_0xd49a('0x25'),_0x594400,_0x45a6ed);_0x4a4a2d(_0x45a6ed);});});}function respondWithStatusCode(_0x358c7b,_0x1bf7e8){_0x1bf7e8=_0x1bf7e8||0xcc;return function(_0x542e16){if(_0x542e16){return _0x358c7b[_0xd49a('0x2d')](_0x1bf7e8);}return _0x358c7b['status'](_0x1bf7e8)['end']();};}function respondWithResult(_0x2b449e,_0x35b2d2){_0x35b2d2=_0x35b2d2||0xc8;return function(_0x23c192){if(_0x23c192){return _0x2b449e['status'](_0x35b2d2)[_0xd49a('0x2e')](_0x23c192);}};}function respondWithFilteredResult(_0x4a9f3b,_0x35f1bd){return function(_0x428487){if(_0x428487){var _0x36f376=typeof _0x35f1bd[_0xd49a('0x2f')]===_0xd49a('0x30')&&typeof _0x35f1bd[_0xd49a('0x31')]===_0xd49a('0x30');var _0x2ded5b=_0x428487[_0xd49a('0x32')];var _0x585afd=_0x36f376?0x0:_0x35f1bd['offset'];var _0x310f70=_0x36f376?_0x428487[_0xd49a('0x32')]:_0x35f1bd['offset']+_0x35f1bd[_0xd49a('0x31')];var _0x51ec82;if(_0x310f70>=_0x2ded5b){_0x310f70=_0x2ded5b;_0x51ec82=0xc8;}else{_0x51ec82=0xce;}_0x4a9f3b[_0xd49a('0x33')](_0x51ec82);return _0x4a9f3b[_0xd49a('0x34')](_0xd49a('0x35'),_0x585afd+'-'+_0x310f70+'/'+_0x2ded5b)[_0xd49a('0x2e')](_0x428487);}return null;};}function patchUpdates(_0x126d6e){return function(_0x41bc31){try{jsonpatch[_0xd49a('0x36')](_0x41bc31,_0x126d6e,!![]);}catch(_0x54c282){return BPromise['reject'](_0x54c282);}return _0x41bc31[_0xd49a('0x37')]();};}function saveUpdates(_0x590123,_0x47f1d6){return function(_0x2fc237){if(_0x2fc237){return _0x2fc237[_0xd49a('0x38')](_0x590123)[_0xd49a('0x24')](function(_0x454980){return _0x454980;});}return null;};}function removeEntity(_0x5e2a16,_0x27eb56){return function(_0x454c24){if(_0x454c24){return _0x454c24[_0xd49a('0x39')]()[_0xd49a('0x24')](function(){_0x5e2a16['status'](0xcc)[_0xd49a('0x3a')]();});}};}function handleEntityNotFound(_0x249d91,_0x359cc2){return function(_0x407b01){if(!_0x407b01){_0x249d91[_0xd49a('0x2d')](0x194);}return _0x407b01;};}function handleError(_0x2586d1,_0x2a7d5e){_0x2a7d5e=_0x2a7d5e||0x1f4;return function(_0x1b7ef2){logger[_0xd49a('0x28')](_0x1b7ef2[_0xd49a('0x3b')]);if(_0x1b7ef2[_0xd49a('0x3c')]){delete _0x1b7ef2[_0xd49a('0x3c')];}_0x2586d1[_0xd49a('0x33')](_0x2a7d5e)[_0xd49a('0x3d')](_0x1b7ef2);};}exports['index']=function(_0xe021e,_0x2930cb){var _0x5b642e={},_0x1dfcc8={},_0x299cd1={'count':0x0,'rows':[]};var _0x144f6e=_[_0xd49a('0x3e')](db[_0xd49a('0x3f')]['rawAttributes'],function(_0xf6a06a){return{'name':_0xf6a06a['fieldName'],'type':_0xf6a06a[_0xd49a('0x40')][_0xd49a('0x41')]};});_0x1dfcc8[_0xd49a('0x42')]=_[_0xd49a('0x3e')](_0x144f6e,_0xd49a('0x3c'));_0x1dfcc8[_0xd49a('0x43')]=_[_0xd49a('0x44')](_0xe021e[_0xd49a('0x43')]);_0x1dfcc8[_0xd49a('0x45')]=_[_0xd49a('0x46')](_0x1dfcc8[_0xd49a('0x42')],_0x1dfcc8['query']);_0x5b642e[_0xd49a('0x47')]=_[_0xd49a('0x46')](_0x1dfcc8[_0xd49a('0x42')],qs[_0xd49a('0x48')](_0xe021e[_0xd49a('0x43')]['fields']));_0x5b642e['attributes']=_0x5b642e[_0xd49a('0x47')][_0xd49a('0x49')]?_0x5b642e[_0xd49a('0x47')]:_0x1dfcc8['model'];if(!_0xe021e[_0xd49a('0x43')]['hasOwnProperty']('nolimit')){_0x5b642e[_0xd49a('0x31')]=qs[_0xd49a('0x31')](_0xe021e[_0xd49a('0x43')][_0xd49a('0x31')]);_0x5b642e[_0xd49a('0x2f')]=qs['offset'](_0xe021e[_0xd49a('0x43')][_0xd49a('0x2f')]);}_0x5b642e[_0xd49a('0x4a')]=qs[_0xd49a('0x4b')](_0xe021e['query']['sort']);_0x5b642e[_0xd49a('0x4c')]=qs[_0xd49a('0x45')](_[_0xd49a('0x4d')](_0xe021e[_0xd49a('0x43')],_0x1dfcc8[_0xd49a('0x45')]),_0x144f6e);if(_0xe021e[_0xd49a('0x43')][_0xd49a('0x4e')]){_0x5b642e[_0xd49a('0x4c')]=_['merge'](_0x5b642e['where'],{'$or':_[_0xd49a('0x3e')](_0x144f6e,function(_0x50633f){if(_0x50633f[_0xd49a('0x40')]!=='VIRTUAL'){var _0x2b079c={};_0x2b079c[_0x50633f[_0xd49a('0x3c')]]={'$like':'%'+_0xe021e[_0xd49a('0x43')][_0xd49a('0x4e')]+'%'};return _0x2b079c;}})});}_0x5b642e=_[_0xd49a('0x4f')]({},_0x5b642e,_0xe021e[_0xd49a('0x50')]);var _0xcada8d={'where':_0x5b642e[_0xd49a('0x4c')]};return db[_0xd49a('0x3f')]['count'](_0xcada8d)[_0xd49a('0x24')](function(_0x3c0540){_0x299cd1[_0xd49a('0x32')]=_0x3c0540;if(_0xe021e['query']['includeAll']){_0x5b642e[_0xd49a('0x51')]=[{'all':!![]}];}return db[_0xd49a('0x3f')][_0xd49a('0x52')](_0x5b642e);})[_0xd49a('0x24')](function(_0x23837b){_0x299cd1[_0xd49a('0x53')]=_0x23837b;return _0x299cd1;})[_0xd49a('0x24')](respondWithFilteredResult(_0x2930cb,_0x5b642e))[_0xd49a('0x54')](handleError(_0x2930cb,null));};exports[_0xd49a('0x55')]=function(_0x2c7d2d,_0x5449d5){var _0x30c0eb={'raw':!![],'where':{'id':_0x2c7d2d[_0xd49a('0x56')]['id']}},_0x210c37={};_0x210c37[_0xd49a('0x42')]=_[_0xd49a('0x44')](db[_0xd49a('0x3f')][_0xd49a('0x57')]);_0x210c37[_0xd49a('0x43')]=_[_0xd49a('0x44')](_0x2c7d2d[_0xd49a('0x43')]);_0x210c37[_0xd49a('0x45')]=_[_0xd49a('0x46')](_0x210c37[_0xd49a('0x42')],_0x210c37[_0xd49a('0x43')]);_0x30c0eb[_0xd49a('0x47')]=_['intersection'](_0x210c37[_0xd49a('0x42')],qs[_0xd49a('0x48')](_0x2c7d2d[_0xd49a('0x43')][_0xd49a('0x48')]));_0x30c0eb[_0xd49a('0x47')]=_0x30c0eb[_0xd49a('0x47')][_0xd49a('0x49')]?_0x30c0eb[_0xd49a('0x47')]:_0x210c37[_0xd49a('0x42')];if(_0x2c7d2d['query'][_0xd49a('0x58')]){_0x30c0eb[_0xd49a('0x51')]=[{'all':!![]}];}_0x30c0eb=_[_0xd49a('0x4f')]({},_0x30c0eb,_0x2c7d2d[_0xd49a('0x50')]);return db[_0xd49a('0x3f')][_0xd49a('0x59')](_0x30c0eb)[_0xd49a('0x24')](handleEntityNotFound(_0x5449d5,null))['then'](respondWithResult(_0x5449d5,null))[_0xd49a('0x54')](handleError(_0x5449d5,null));};exports[_0xd49a('0x5a')]=function(_0x20497c,_0x4bd6cd){return db[_0xd49a('0x3f')]['create'](_0x20497c[_0xd49a('0x5b')],{})['then'](respondWithResult(_0x4bd6cd,0xc9))['catch'](handleError(_0x4bd6cd,null));};exports[_0xd49a('0x38')]=function(_0x19df92,_0x44906b){if(_0x19df92[_0xd49a('0x5b')]['id']){delete _0x19df92[_0xd49a('0x5b')]['id'];}return db[_0xd49a('0x3f')][_0xd49a('0x59')]({'where':{'id':_0x19df92[_0xd49a('0x56')]['id']}})['then'](handleEntityNotFound(_0x44906b,null))[_0xd49a('0x24')](saveUpdates(_0x19df92['body'],null))[_0xd49a('0x24')](respondWithResult(_0x44906b,null))[_0xd49a('0x54')](handleError(_0x44906b,null));};exports[_0xd49a('0x39')]=function(_0x5f2646,_0x1e8714){return db[_0xd49a('0x3f')][_0xd49a('0x59')]({'where':{'id':_0x5f2646[_0xd49a('0x56')]['id']}})[_0xd49a('0x24')](handleEntityNotFound(_0x1e8714,null))['then'](removeEntity(_0x1e8714,null))[_0xd49a('0x54')](handleError(_0x1e8714,null));};exports[_0xd49a('0x5c')]=function(_0x3d8120,_0xe5a94a){return db[_0xd49a('0x3f')]['describe']()['then'](respondWithResult(_0xe5a94a,null))[_0xd49a('0x54')](handleError(_0xe5a94a,null));};var interaction_log=require('../../config/logger')(_0xd49a('0x5d'));exports[_0xd49a('0x5e')]=function(_0x1cea42,_0x26078a,_0x407d14){var _0x4c562b={'agent':{},'channel':_0xd49a('0x5f')};if(_0x1cea42[_0xd49a('0x5b')]['id']){delete _0x1cea42[_0xd49a('0x5b')]['id'];}_0x1cea42[_0xd49a('0x5b')][_0xd49a('0x60')]=!![];_0x1cea42[_0xd49a('0x5b')][_0xd49a('0x61')]=moment()[_0xd49a('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x1cea42[_0xd49a('0x5b')]['UserId']=_0x1cea42[_0xd49a('0x5b')][_0xd49a('0x63')]||_0x1cea42[_0xd49a('0x64')]['id'];_0x4c562b[_0xd49a('0x65')]['id']=_0x1cea42[_0xd49a('0x5b')]['UserId'];return db[_0xd49a('0x3f')][_0xd49a('0x59')]({'where':{'id':_0x1cea42[_0xd49a('0x56')]['id'],'UserId':null}})[_0xd49a('0x24')](handleEntityNotFound(_0x26078a,null))[_0xd49a('0x24')](saveUpdates(_0x1cea42['body'],null))['then'](function(_0x4f3cbe){if(_0x4f3cbe){_0x4c562b[_0xd49a('0x2a')]=_0x4f3cbe[_0xd49a('0x66')]({'plain':!![]});return db[_0xd49a('0x67')]['find']({'where':{'id':_0x4f3cbe['OpenchannelInteractionId']}});}return null;})[_0xd49a('0x24')](handleEntityNotFound(_0x26078a,null))[_0xd49a('0x24')](function(_0x448003){if(_0x448003){return _0x448003[_0xd49a('0x38')]({'UserId':_0x1cea42['body'][_0xd49a('0x63')],'read1stAt':_[_0xd49a('0x68')](_0x448003['read1stAt'])?moment()[_0xd49a('0x62')](_0xd49a('0x69')):undefined});}return null;})['then'](function(_0x495a1e){if(_0x495a1e){_0x4c562b[_0xd49a('0x6a')]=_0x495a1e[_0xd49a('0x66')]({'plain':!![]});interaction_log[_0xd49a('0x2b')](_0xd49a('0x6b'),_0x1cea42[_0xd49a('0x64')]['id'],_0x1cea42[_0xd49a('0x64')][_0xd49a('0x3c')],_0x1cea42[_0xd49a('0x64')][_0xd49a('0x6c')],_0x4c562b[_0xd49a('0x6a')]['id'],_0x1cea42[_0xd49a('0x5b')]?JSON['stringify'](_0x1cea42[_0xd49a('0x5b')]):_0xd49a('0x6d'));return respondWithRpcPromise(_0xd49a('0x6e'),_0xd49a('0x6f'),_0x4c562b);}return null;})[_0xd49a('0x24')](function(_0x499dd8){var _0x30ce17=_0xd49a('0x70')+_0x499dd8[_0xd49a('0x2a')][_0xd49a('0x71')];return db[_0xd49a('0x72')][_0xd49a('0x43')](_0x30ce17,{'type':db['Sequelize'][_0xd49a('0x73')][_0xd49a('0x74')],'raw':!![]})['then'](function(_0x52b40e){return _0x52b40e;});})['then'](function(_0x5adfdf){if(_0x5adfdf){_0x4c562b['message'][_0xd49a('0x75')]=_0x5adfdf[0x0];if(!_0x1cea42[_0xd49a('0x5b')][_0xd49a('0x63')])return;return db[_0xd49a('0x76')]['find']({'where':{'id':_0x1cea42[_0xd49a('0x5b')][_0xd49a('0x63')],'role':_0xd49a('0x65')},'attributes':['id','name',_0xd49a('0x77'),_0xd49a('0x78'),'internal'],'raw':!![]});}return null;})[_0xd49a('0x24')](function(_0x4cde62){if(!_0x4cde62)return null;_0x4c562b[_0xd49a('0x2a')]['agent']=_0x4cde62;return _0x4c562b;})[_0xd49a('0x24')](function(_0x31fcb0){if(_0x31fcb0){if(_0x1cea42[_0xd49a('0x5b')][_0xd49a('0x79')]){_0x4c562b[_0xd49a('0x2a')][_0xd49a('0x7a')]=util[_0xd49a('0x62')](_0xd49a('0x7b'),_0x1cea42[_0xd49a('0x64')][_0xd49a('0x3c')]);_0x4c562b[_0xd49a('0x2a')][_0xd49a('0x7c')]=_0x4c562b['channel'];_0x4c562b[_0xd49a('0x2a')][_0xd49a('0x7d')]=_0x4c562b['channel'];_0x4c562b[_0xd49a('0x2a')][_0xd49a('0x7e')]=_0xd49a('0x5e');return respondWithRpcPromise(_0xd49a('0x7f'),_0xd49a('0x7f'),{'event':_0xd49a('0x80'),'message':_0x4c562b['message']},client9002)[_0xd49a('0x24')](function(){return _0x4c562b;});}return _0x4c562b;}return null;})[_0xd49a('0x24')](respondWithResult(_0x26078a,null))[_0xd49a('0x54')](handleError(_0x26078a,null));};var interaction_log=require(_0xd49a('0x17'))('openchannel-interactions');exports[_0xd49a('0x81')]=function(_0x3de754,_0x1a3e03,_0x6d8404){var _0x453916={'agent':{},'channel':_0xd49a('0x5f')};if(_0x3de754[_0xd49a('0x5b')]['id']){delete _0x3de754[_0xd49a('0x5b')]['id'];}_0x3de754[_0xd49a('0x5b')]['UserId']=_0x3de754[_0xd49a('0x5b')][_0xd49a('0x63')]||_0x3de754[_0xd49a('0x64')]['id'];_0x453916[_0xd49a('0x65')]['id']=_0x3de754[_0xd49a('0x5b')][_0xd49a('0x63')];return db[_0xd49a('0x3f')][_0xd49a('0x59')]({'where':{'id':_0x3de754[_0xd49a('0x56')]['id'],'UserId':null}})[_0xd49a('0x24')](handleEntityNotFound(_0x1a3e03,null))[_0xd49a('0x24')](function(_0x11d1e7){if(_0x11d1e7){_0x453916[_0xd49a('0x2a')]=_0x11d1e7[_0xd49a('0x66')]({'plain':!![]});return db[_0xd49a('0x67')][_0xd49a('0x59')]({'where':{'id':_0x11d1e7[_0xd49a('0x82')]}});}return null;})['then'](handleEntityNotFound(_0x1a3e03,null))['then'](function(_0x2076aa){if(_0x2076aa){_0x453916[_0xd49a('0x6a')]=_0x2076aa[_0xd49a('0x66')]({'plain':!![]});interaction_log['info'](_0xd49a('0x83'),_0x3de754['user']['id'],_0x3de754[_0xd49a('0x64')]['name'],_0x3de754['user'][_0xd49a('0x6c')],_0x453916[_0xd49a('0x6a')]['id'],_0x3de754[_0xd49a('0x5b')]?JSON[_0xd49a('0x84')](_0x3de754[_0xd49a('0x5b')]):_0xd49a('0x6d'));return respondWithRpcPromise(_0xd49a('0x85'),_0xd49a('0x86'),_0x453916);}return null;})['then'](function(_0x25cc64){var _0x17acef=_0xd49a('0x70')+_0x25cc64[_0xd49a('0x2a')][_0xd49a('0x71')];return db[_0xd49a('0x72')][_0xd49a('0x43')](_0x17acef,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x56fea2){return _0x56fea2;});})[_0xd49a('0x24')](function(_0xa728e2){if(_0xa728e2){_0x453916[_0xd49a('0x2a')][_0xd49a('0x75')]=_0xa728e2[0x0];if(!_0x3de754[_0xd49a('0x5b')][_0xd49a('0x63')])return;return db[_0xd49a('0x76')][_0xd49a('0x59')]({'where':{'id':_0x3de754[_0xd49a('0x5b')]['UserId'],'role':_0xd49a('0x65')},'attributes':['id',_0xd49a('0x3c'),_0xd49a('0x77'),_0xd49a('0x78'),'internal'],'raw':!![]});}return null;})[_0xd49a('0x24')](function(_0x398fc2){if(!_0x398fc2)return null;_0x453916[_0xd49a('0x2a')][_0xd49a('0x65')]=_0x398fc2;return _0x453916;})[_0xd49a('0x24')](function(_0x32c1e2){if(_0x32c1e2){_0x32c1e2[_0xd49a('0x2a')][_0xd49a('0x7a')]=util[_0xd49a('0x62')](_0xd49a('0x7b'),_0x3de754[_0xd49a('0x64')]['name']);_0x32c1e2[_0xd49a('0x2a')][_0xd49a('0x7c')]=_0x453916[_0xd49a('0x7c')];_0x32c1e2[_0xd49a('0x2a')][_0xd49a('0x7d')]=_0x453916[_0xd49a('0x7c')];_0x32c1e2[_0xd49a('0x2a')][_0xd49a('0x7e')]=_0xd49a('0x81');respondWithRpcPromise('EventManager','EventManager',{'event':_0xd49a('0x87'),'message':_0x32c1e2['message']},client9002);return _0x453916;}return null;})[_0xd49a('0x24')](respondWithResult(_0x1a3e03,null))[_0xd49a('0x54')](handleError(_0x1a3e03,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 52956ba..3e3ba1e 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 _0x6012=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x15c9bc,_0x8a33b9){var _0x507103=function(_0x2064f9){while(--_0x2064f9){_0x15c9bc['push'](_0x15c9bc['shift']());}};_0x507103(++_0x8a33b9);}(_0x6012,0x1a0));var _0x2601=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x6012[_0x1d87fc];return _0x492b56;};'use strict';var EventEmitter=require(_0x2601('0x0'));var OpenchannelMessage=require(_0x2601('0x1'))['db'][_0x2601('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2601('0x3')](0x0);var events={'afterCreate':_0x2601('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x203e39){return function(_0x2c4d12,_0x26785e,_0x47142b){OpenchannelMessageEvents[_0x2601('0x5')](_0x203e39+':'+_0x2c4d12['id'],_0x2c4d12);OpenchannelMessageEvents[_0x2601('0x5')](_0x203e39,_0x2c4d12);_0x47142b(null);};}for(var e in events){if(events[_0x2601('0x6')](e)){var event=events[e];OpenchannelMessage[_0x2601('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x8f91=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3762f2,_0x248e72){var _0x2acde6=function(_0x30bade){while(--_0x30bade){_0x3762f2['push'](_0x3762f2['shift']());}};_0x2acde6(++_0x248e72);}(_0x8f91,0x97));var _0x18f9=function(_0x19b0ef,_0x3a2fc8){_0x19b0ef=_0x19b0ef-0x0;var _0x23fe44=_0x8f91[_0x19b0ef];return _0x23fe44;};'use strict';var EventEmitter=require(_0x18f9('0x0'));var OpenchannelMessage=require(_0x18f9('0x1'))['db'][_0x18f9('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x18f9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x18f9('0x4'),'afterDestroy':_0x18f9('0x5')};function emitEvent(_0x503758){return function(_0x27cbec,_0x54d8a6,_0x1906d0){OpenchannelMessageEvents[_0x18f9('0x6')](_0x503758+':'+_0x27cbec['id'],_0x27cbec);OpenchannelMessageEvents[_0x18f9('0x6')](_0x503758,_0x27cbec);_0x1906d0(null);};}for(var e in events){if(events[_0x18f9('0x7')](e)){var event=events[e];OpenchannelMessage[_0x18f9('0x8')](e,emitEvent(event));}}module[_0x18f9('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index b4d92b2..da91d9d 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 _0xa5ff=['get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Contact','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Interactions','Interaction','omit','GET','POST','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models'];(function(_0xbb23d2,_0x221859){var _0x380c09=function(_0x5827b0){while(--_0x5827b0){_0xbb23d2['push'](_0xbb23d2['shift']());}};_0x380c09(++_0x221859);}(_0xa5ff,0x17a));var _0xfa5f=function(_0x1f6cba,_0x7b9d27){_0x1f6cba=_0x1f6cba-0x0;var _0x59bfef=_0xa5ff[_0x1f6cba];return _0x59bfef;};'use strict';var _=require(_0xfa5f('0x0'));var util=require(_0xfa5f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfa5f('0x2'));var BPromise=require(_0xfa5f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfa5f('0x4'));var attributes=require(_0xfa5f('0x5'));module[_0xfa5f('0x6')]=function(_0x108620,_0x545c3e){return _0x108620[_0xfa5f('0x7')](_0xfa5f('0x8'),attributes,{'tableName':_0xfa5f('0x9'),'paranoid':![],'indexes':[{'name':_0xfa5f('0xa'),'fields':[_0xfa5f('0xb')],'type':_0xfa5f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36b778,_0x149c59,_0x1098fb){var _0x5f446c=_0x108620[_0xfa5f('0xd')];var _0x41d72d=_0x36b778[_0xfa5f('0xe')]({'plain':!![]});if(_0x41d72d['direction'][_0xfa5f('0xf')]()==='in'||_0x41d72d[_0xfa5f('0x10')]['toLowerCase']()===_0xfa5f('0x11')&&!_0x41d72d[_0xfa5f('0x12')]&&!_[_0xfa5f('0x13')](_0x41d72d[_0xfa5f('0x14')])){_0x5f446c[_0xfa5f('0x15')]['findOne']({'where':{'id':_0x41d72d[_0xfa5f('0x16')]}})[_0xfa5f('0x17')](function(_0x540969){if(_0x540969){_0x540969[_0xfa5f('0x18')]({'lastMsgAt':_0x41d72d[_0xfa5f('0x19')],'lastMsgDirection':_0x41d72d[_0xfa5f('0x10')]['toLowerCase']()});}})[_0xfa5f('0x1a')](function(_0x482316){console[_0xfa5f('0x1b')](_0x482316);});}if(_0x41d72d['direction']===_0xfa5f('0x11')&&!_0x41d72d[_0xfa5f('0x12')]){var _0xa98852;_0x5f446c[_0xfa5f('0x1c')][_0xfa5f('0x1d')]()[_0xfa5f('0x17')](function(_0x9314e8){return _0x5f446c[_0xfa5f('0x1e')]['find']({'where':{'id':_0x41d72d[_0xfa5f('0x1f')]},'include':[{'model':_0x5f446c[_0xfa5f('0x15')],'as':'Interactions','where':{'id':_0x41d72d[_0xfa5f('0x16')]},'limit':0x1,'include':[{'model':_0x5f446c[_0xfa5f('0x1c')],'as':_0xfa5f('0x20'),'attributes':_['keys'](_0x9314e8)}]}]});})['then'](function(_0x2c0645){_0xa98852=_0x2c0645[_0xfa5f('0xe')]({'plain':!![]});if(_0xa98852&&_0xa98852[_0xfa5f('0x21')]){logger['info'](_0xfa5f('0x22'),'afterCreate',util[_0xfa5f('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x41d72d['id'],_0xa98852[_0xfa5f('0x21')]));if(_0xa98852[_0xfa5f('0x24')]&&_0xa98852['Interactions']['length']){_0x41d72d[_0xfa5f('0x25')]=_[_0xfa5f('0x26')](_0xa98852[_0xfa5f('0x24')][0x0],'Contact');_0x41d72d[_0xfa5f('0x20')]=_0xa98852[_0xfa5f('0x24')][0x0][_0xfa5f('0x20')];}var _0x149c59={'method':'POST','uri':encodeURI(_0xa98852[_0xfa5f('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x149c59['method']){case _0xfa5f('0x27'):_0x149c59['qs']=_0x41d72d;break;case _0xfa5f('0x28'):_0x149c59[_0xfa5f('0xb')]=_0x41d72d;break;}return rp(_0x149c59)['then'](function(_0xc6f9f6){logger[_0xfa5f('0x29')](_0xfa5f('0x22'),'afterCreate',util[_0xfa5f('0x23')](_0xfa5f('0x2a'),_0x41d72d['id'],_0xa98852[_0xfa5f('0x21')]));if(_0xc6f9f6[_0xfa5f('0xb')][_0xfa5f('0x2b')]&&_0xc6f9f6[_0xfa5f('0xb')][_0xfa5f('0x2b')]!=_0x41d72d['Interaction'][_0xfa5f('0x2b')]){return _0x5f446c['OpenchannelInteraction'][_0xfa5f('0x18')]({'threadId':_0xc6f9f6[_0xfa5f('0xb')][_0xfa5f('0x2b')]},{'where':{'id':_0x41d72d[_0xfa5f('0x25')]['id']}});}else{return;}})[_0xfa5f('0x17')](function(){return _0x36b778['update']({'read':!![]});})['catch'](function(_0xfa8672){logger['error'](_0xfa5f('0x22'),_0xfa5f('0x2c'),util[_0xfa5f('0x2d')](_0xfa8672,{'showHidden':![],'depth':null}));_0x1098fb();});}else{_0x1098fb();}})[_0xfa5f('0x2e')](function(){_0x1098fb();});}else{_0x1098fb();}}},'charset':_0xfa5f('0x2f'),'collate':_0xfa5f('0x30')});}; \ No newline at end of file +var _0x38ed=['POST','method','GET','threadId','inspect','utf8mb4','lodash','util','api','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit'];(function(_0x3599fc,_0x5455e8){var _0x5991c7=function(_0x82374f){while(--_0x82374f){_0x3599fc['push'](_0x3599fc['shift']());}};_0x5991c7(++_0x5455e8);}(_0x38ed,0x19e));var _0xd38e=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x38ed[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xd38e('0x0'));var util=require(_0xd38e('0x1'));var logger=require('../../config/logger')(_0xd38e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd38e('0x3'));var fs=require('fs');var path=require(_0xd38e('0x4'));var rimraf=require(_0xd38e('0x5'));var config=require(_0xd38e('0x6'));var attributes=require(_0xd38e('0x7'));module[_0xd38e('0x8')]=function(_0x5e8199,_0x20776c){return _0x5e8199['define'](_0xd38e('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xd38e('0xa'),'fields':[_0xd38e('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20e278,_0x1b6174,_0x587e89){var _0x508388=_0x5e8199[_0xd38e('0xc')];var _0x2ec9d6=_0x20e278[_0xd38e('0xd')]({'plain':!![]});if(_0x2ec9d6[_0xd38e('0xe')][_0xd38e('0xf')]()==='in'||_0x2ec9d6[_0xd38e('0xe')]['toLowerCase']()===_0xd38e('0x10')&&!_0x2ec9d6[_0xd38e('0x11')]&&!_[_0xd38e('0x12')](_0x2ec9d6[_0xd38e('0x13')])){_0x508388[_0xd38e('0x14')][_0xd38e('0x15')]({'where':{'id':_0x2ec9d6[_0xd38e('0x16')]}})[_0xd38e('0x17')](function(_0x54cb9a){if(_0x54cb9a){_0x54cb9a[_0xd38e('0x18')]({'lastMsgAt':_0x2ec9d6[_0xd38e('0x19')],'lastMsgDirection':_0x2ec9d6[_0xd38e('0xe')][_0xd38e('0xf')]()});}})[_0xd38e('0x1a')](function(_0x29f72f){console[_0xd38e('0x1b')](_0x29f72f);});}if(_0x2ec9d6[_0xd38e('0xe')]===_0xd38e('0x10')&&!_0x2ec9d6['secret']){var _0x401aae;_0x508388[_0xd38e('0x1c')][_0xd38e('0x1d')]()[_0xd38e('0x17')](function(_0x3cbe0c){return _0x508388[_0xd38e('0x1e')][_0xd38e('0x1f')]({'where':{'id':_0x2ec9d6[_0xd38e('0x20')]},'include':[{'model':_0x508388[_0xd38e('0x14')],'as':_0xd38e('0x21'),'where':{'id':_0x2ec9d6['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x508388[_0xd38e('0x1c')],'as':_0xd38e('0x22'),'attributes':_[_0xd38e('0x23')](_0x3cbe0c)}]}]});})[_0xd38e('0x17')](function(_0x229399){_0x401aae=_0x229399[_0xd38e('0xd')]({'plain':!![]});if(_0x401aae&&_0x401aae[_0xd38e('0x24')]){logger[_0xd38e('0x25')](_0xd38e('0x26'),_0xd38e('0x27'),util[_0xd38e('0x28')](_0xd38e('0x29'),_0x2ec9d6['id'],_0x401aae[_0xd38e('0x24')]));if(_0x401aae[_0xd38e('0x21')]&&_0x401aae[_0xd38e('0x21')][_0xd38e('0x2a')]){_0x2ec9d6[_0xd38e('0x2b')]=_[_0xd38e('0x2c')](_0x401aae[_0xd38e('0x21')][0x0],_0xd38e('0x22'));_0x2ec9d6[_0xd38e('0x22')]=_0x401aae[_0xd38e('0x21')][0x0][_0xd38e('0x22')];}var _0x1b6174={'method':_0xd38e('0x2d'),'uri':encodeURI(_0x401aae[_0xd38e('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1b6174[_0xd38e('0x2e')]){case _0xd38e('0x2f'):_0x1b6174['qs']=_0x2ec9d6;break;case _0xd38e('0x2d'):_0x1b6174[_0xd38e('0xb')]=_0x2ec9d6;break;}return rp(_0x1b6174)[_0xd38e('0x17')](function(_0x5e2bf1){logger['info'](_0xd38e('0x26'),_0xd38e('0x27'),util[_0xd38e('0x28')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x2ec9d6['id'],_0x401aae[_0xd38e('0x24')]));if(_0x5e2bf1[_0xd38e('0xb')][_0xd38e('0x30')]&&_0x5e2bf1['body'][_0xd38e('0x30')]!=_0x2ec9d6['Interaction'][_0xd38e('0x30')]){return _0x508388[_0xd38e('0x14')][_0xd38e('0x18')]({'threadId':_0x5e2bf1[_0xd38e('0xb')][_0xd38e('0x30')]},{'where':{'id':_0x2ec9d6[_0xd38e('0x2b')]['id']}});}else{return;}})[_0xd38e('0x17')](function(){return _0x20e278[_0xd38e('0x18')]({'read':!![]});})[_0xd38e('0x1a')](function(_0x205d80){logger[_0xd38e('0x1b')](_0xd38e('0x26'),_0xd38e('0x27'),util[_0xd38e('0x31')](_0x205d80,{'showHidden':![],'depth':null}));_0x587e89();});}else{_0x587e89();}})['finally'](function(){_0x587e89();});}else{_0x587e89();}}},'charset':_0xd38e('0x32'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 31db7d9..1e7cbbd 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 _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x44aed2,_0x1cdbe3){var _0x26bfac=function(_0x5e57f0){while(--_0x5e57f0){_0x44aed2['push'](_0x44aed2['shift']());}};_0x26bfac(++_0x1cdbe3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x359377,_0x1a63ef){_0x359377=_0x359377-0x0;var _0x8be18a=_0x0b0e[_0x359377];return _0x8be18a;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xfa9e4b,_0x15f6f6){var _0x379080=function(_0x21ce7e){while(--_0x21ce7e){_0xfa9e4b['push'](_0xfa9e4b['shift']());}};_0x379080(++_0x15f6f6);}(_0x2ef3,0xba));var _0x32ef=function(_0x3aab07,_0x4edf2d){_0x3aab07=_0x3aab07-0x0;var _0x1a7e33=_0x2ef3[_0x3aab07];return _0x1a7e33;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 9501be9..d6d03b9 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 _0x3c3e=['removeListener','register','./openchannelMessage.events','save','remove','emit'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0x3c3e,0x86));var _0xe3c3=function(_0x4a38c7,_0x5398cb){_0x4a38c7=_0x4a38c7-0x0;var _0x2eddec=_0x3c3e[_0x4a38c7];return _0x2eddec;};'use strict';var OpenchannelMessageEvents=require(_0xe3c3('0x0'));var events=[_0xe3c3('0x1'),_0xe3c3('0x2'),'update'];function createListener(_0x12a9ba,_0x516f92){return function(_0x2a3a29){_0x516f92[_0xe3c3('0x3')](_0x12a9ba,_0x2a3a29);};}function removeListener(_0x34fbb1,_0x15fbe8){return function(){OpenchannelMessageEvents[_0xe3c3('0x4')](_0x34fbb1,_0x15fbe8);};}exports[_0xe3c3('0x5')]=function(_0x21220e){for(var _0x4d9334=0x0,_0x2edc07=events['length'];_0x4d9334<_0x2edc07;_0x4d9334++){var _0x707486=events[_0x4d9334];var _0x5e0091=createListener('openchannelMessage:'+_0x707486,_0x21220e);OpenchannelMessageEvents['on'](_0x707486,_0x5e0091);}}; \ No newline at end of file +var _0x37c5=['remove','update','emit','removeListener','openchannelMessage:','save'];(function(_0x286e8e,_0x5ce692){var _0xbfe023=function(_0x561a17){while(--_0x561a17){_0x286e8e['push'](_0x286e8e['shift']());}};_0xbfe023(++_0x5ce692);}(_0x37c5,0xa7));var _0x537c=function(_0x2e3904,_0x33042a){_0x2e3904=_0x2e3904-0x0;var _0x249d02=_0x37c5[_0x2e3904];return _0x249d02;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x537c('0x0'),_0x537c('0x1'),_0x537c('0x2')];function createListener(_0x11f076,_0x1c5b5f){return function(_0x183b59){_0x1c5b5f[_0x537c('0x3')](_0x11f076,_0x183b59);};}function removeListener(_0x42bd15,_0x2c0854){return function(){OpenchannelMessageEvents[_0x537c('0x4')](_0x42bd15,_0x2c0854);};}exports['register']=function(_0x42c86a){for(var _0x1156f4=0x0,_0x336920=events['length'];_0x1156f4<_0x336920;_0x1156f4++){var _0x36bf4a=events[_0x1156f4];var _0x67f986=createListener(_0x537c('0x5')+_0x36bf4a,_0x42c86a);OpenchannelMessageEvents['on'](_0x36bf4a,_0x67f986);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 9fee6e4..ad3191d 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 _0x373b=['getAgents','create','post','addTeams','addAgents','destroy','delete','removeAgents','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x2584a0,_0x40e6d0){var _0x9deec9=function(_0x55b101){while(--_0x55b101){_0x2584a0['push'](_0x2584a0['shift']());}};_0x9deec9(++_0x40e6d0);}(_0x373b,0x127));var _0xb373=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x373b[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require('multer');var util=require(_0xb373('0x0'));var path=require('path');var timeout=require(_0xb373('0x1'));var express=require(_0xb373('0x2'));var router=express[_0xb373('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb373('0x4'));var config=require(_0xb373('0x5'));var controller=require(_0xb373('0x6'));router[_0xb373('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb373('0x7')](_0xb373('0x8'),auth[_0xb373('0x9')](),controller[_0xb373('0xa')]);router['get'](_0xb373('0xb'),auth['isAuthenticated'](),controller[_0xb373('0xc')]);router[_0xb373('0x7')](_0xb373('0xd'),auth[_0xb373('0x9')](),controller['getMembers']);router['get'](_0xb373('0xe'),auth[_0xb373('0x9')](),controller[_0xb373('0xf')]);router['get'](_0xb373('0x10'),auth['isAuthenticated'](),controller[_0xb373('0x11')]);router['post']('/',auth[_0xb373('0x9')](),controller[_0xb373('0x12')]);router[_0xb373('0x13')](_0xb373('0xe'),auth[_0xb373('0x9')](),controller[_0xb373('0x14')]);router['post'](_0xb373('0x10'),auth[_0xb373('0x9')](),controller[_0xb373('0x15')]);router['put'](_0xb373('0xb'),auth[_0xb373('0x9')](),controller['update']);router['delete'](_0xb373('0xb'),auth[_0xb373('0x9')](),controller[_0xb373('0x16')]);router[_0xb373('0x17')](_0xb373('0xe'),auth[_0xb373('0x9')](),controller['removeTeams']);router[_0xb373('0x17')](_0xb373('0x10'),auth['isAuthenticated'](),controller[_0xb373('0x18')]);module[_0xb373('0x19')]=router; \ No newline at end of file +var _0xf382=['../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14c686,_0x4944d5){var _0x3c5bb7=function(_0x2abdcf){while(--_0x2abdcf){_0x14c686['push'](_0x14c686['shift']());}};_0x3c5bb7(++_0x4944d5);}(_0xf382,0xab));var _0x2f38=function(_0x1b847f,_0x530924){_0x1b847f=_0x1b847f-0x0;var _0x4f80d9=_0xf382[_0x1b847f];return _0x4f80d9;};'use strict';var multer=require(_0x2f38('0x0'));var util=require(_0x2f38('0x1'));var path=require(_0x2f38('0x2'));var timeout=require(_0x2f38('0x3'));var express=require(_0x2f38('0x4'));var router=express[_0x2f38('0x5')]();var fs_extra=require(_0x2f38('0x6'));var auth=require(_0x2f38('0x7'));var interaction=require(_0x2f38('0x8'));var config=require(_0x2f38('0x9'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0x2f38('0xa')](),controller[_0x2f38('0xb')]);router[_0x2f38('0xc')]('/describe',auth[_0x2f38('0xa')](),controller[_0x2f38('0xd')]);router[_0x2f38('0xc')](_0x2f38('0xe'),auth[_0x2f38('0xa')](),controller[_0x2f38('0xf')]);router['get'](_0x2f38('0x10'),auth[_0x2f38('0xa')](),controller[_0x2f38('0x11')]);router[_0x2f38('0xc')](_0x2f38('0x12'),auth[_0x2f38('0xa')](),controller['getTeams']);router[_0x2f38('0xc')](_0x2f38('0x13'),auth['isAuthenticated'](),controller[_0x2f38('0x14')]);router[_0x2f38('0x15')]('/',auth[_0x2f38('0xa')](),controller['create']);router['post'](_0x2f38('0x12'),auth[_0x2f38('0xa')](),controller[_0x2f38('0x16')]);router[_0x2f38('0x15')](_0x2f38('0x13'),auth[_0x2f38('0xa')](),controller[_0x2f38('0x17')]);router[_0x2f38('0x18')](_0x2f38('0xe'),auth[_0x2f38('0xa')](),controller[_0x2f38('0x19')]);router[_0x2f38('0x1a')](_0x2f38('0xe'),auth[_0x2f38('0xa')](),controller[_0x2f38('0x1b')]);router[_0x2f38('0x1a')](_0x2f38('0x12'),auth[_0x2f38('0xa')](),controller['removeTeams']);router['delete'](_0x2f38('0x13'),auth[_0x2f38('0xa')](),controller[_0x2f38('0x1c')]);module[_0x2f38('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 3147949..66c0cca 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 _0xf563=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x5ea12c,_0x58685d){var _0x4e3711=function(_0x2aeb19){while(--_0x2aeb19){_0x5ea12c['push'](_0x5ea12c['shift']());}};_0x4e3711(++_0x58685d);}(_0xf563,0x11a));var _0x3f56=function(_0x290442,_0xbe799b){_0x290442=_0x290442-0x0;var _0x455eca=_0xf563[_0x290442];return _0x455eca;};'use strict';var Sequelize=require(_0x3f56('0x0'));module[_0x3f56('0x1')]={'name':{'type':Sequelize[_0x3f56('0x2')],'unique':_0x3f56('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3f56('0x2')]},'timeout':{'type':Sequelize[_0x3f56('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3f56('0x5'),'beepall',_0x3f56('0x6'))}}; \ No newline at end of file +var _0x72f9=['ENUM','rrmemory','roundrobin','exports','STRING'];(function(_0x3c4e12,_0x420280){var _0x583a16=function(_0x4da45f){while(--_0x4da45f){_0x3c4e12['push'](_0x3c4e12['shift']());}};_0x583a16(++_0x420280);}(_0x72f9,0x71));var _0x972f=function(_0x46b1c9,_0x169f87){_0x46b1c9=_0x46b1c9-0x0;var _0x17569c=_0x72f9[_0x46b1c9];return _0x17569c;};'use strict';var Sequelize=require('sequelize');module[_0x972f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x972f('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x972f('0x2')](_0x972f('0x3'),'beepall',_0x972f('0x4'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 674f6da..cd3ba01 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 _0x56bb=['addAgents','spread','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','set','update','then','destroy','OpenchannelQueues','status','error','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','hasOwnProperty','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','all','union','compact','value','forEach'];(function(_0x972b64,_0x143d1a){var _0x59904a=function(_0x3bce78){while(--_0x3bce78){_0x972b64['push'](_0x972b64['shift']());}};_0x59904a(++_0x143d1a);}(_0x56bb,0x12a));var _0xb56b=function(_0xa813b5,_0x494082){_0xa813b5=_0xa813b5-0x0;var _0x130f6b=_0x56bb[_0xa813b5];return _0x130f6b;};'use strict';var emlformat=require(_0xb56b('0x0'));var rimraf=require(_0xb56b('0x1'));var zipdir=require(_0xb56b('0x2'));var jsonpatch=require(_0xb56b('0x3'));var rp=require(_0xb56b('0x4'));var moment=require(_0xb56b('0x5'));var BPromise=require(_0xb56b('0x6'));var Mustache=require('mustache');var util=require(_0xb56b('0x7'));var path=require(_0xb56b('0x8'));var sox=require(_0xb56b('0x9'));var csv=require(_0xb56b('0xa'));var ejs=require(_0xb56b('0xb'));var fs=require('fs');var fs_extra=require(_0xb56b('0xc'));var _=require(_0xb56b('0xd'));var squel=require(_0xb56b('0xe'));var crypto=require(_0xb56b('0xf'));var jsforce=require(_0xb56b('0x10'));var deskjs=require(_0xb56b('0x11'));var toCsv=require(_0xb56b('0xa'));var querystring=require(_0xb56b('0x12'));var Papa=require(_0xb56b('0x13'));var Redis=require(_0xb56b('0x14'));var authService=require(_0xb56b('0x15'));var qs=require(_0xb56b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb56b('0x17'));var logger=require('../../config/logger')(_0xb56b('0x18'));var utils=require(_0xb56b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb56b('0x1a'));var db=require(_0xb56b('0x1b'))['db'];config[_0xb56b('0x1c')]=_[_0xb56b('0x1d')](config['redis'],{'host':_0xb56b('0x1e'),'port':0x18eb});var socket=require(_0xb56b('0x1f'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xb56b('0x20')](socket);function respondWithStatusCode(_0x44568d,_0x3c3ad7){_0x3c3ad7=_0x3c3ad7||0xcc;return function(_0x47d556){if(_0x47d556){return _0x44568d[_0xb56b('0x21')](_0x3c3ad7);}return _0x44568d['status'](_0x3c3ad7)[_0xb56b('0x22')]();};}function respondWithResult(_0x3aeda6,_0x4e62ac){_0x4e62ac=_0x4e62ac||0xc8;return function(_0xfc48f6){if(_0xfc48f6){return _0x3aeda6['status'](_0x4e62ac)[_0xb56b('0x23')](_0xfc48f6);}};}function respondWithFilteredResult(_0x84fff7,_0x2d49c1){return function(_0x1ef1fb){if(_0x1ef1fb){var _0x3c30da=typeof _0x2d49c1[_0xb56b('0x24')]===_0xb56b('0x25')&&typeof _0x2d49c1[_0xb56b('0x26')]===_0xb56b('0x25');var _0x369199=_0x1ef1fb['count'];var _0x225332=_0x3c30da?0x0:_0x2d49c1['offset'];var _0x375bef=_0x3c30da?_0x1ef1fb[_0xb56b('0x27')]:_0x2d49c1[_0xb56b('0x24')]+_0x2d49c1[_0xb56b('0x26')];var _0x392ddb;if(_0x375bef>=_0x369199){_0x375bef=_0x369199;_0x392ddb=0xc8;}else{_0x392ddb=0xce;}_0x84fff7['status'](_0x392ddb);return _0x84fff7[_0xb56b('0x28')]('Content-Range',_0x225332+'-'+_0x375bef+'/'+_0x369199)[_0xb56b('0x23')](_0x1ef1fb);}return null;};}function patchUpdates(_0x55b902){return function(_0x14bd00){try{jsonpatch['apply'](_0x14bd00,_0x55b902,!![]);}catch(_0x1c10d8){return BPromise['reject'](_0x1c10d8);}return _0x14bd00['save']();};}function saveUpdates(_0x158478,_0x29b362){return function(_0x4ace20){if(_0x4ace20){return _0x4ace20[_0xb56b('0x29')](_0x158478)[_0xb56b('0x2a')](function(_0x4faeec){return _0x4faeec;});}return null;};}function removeEntity(_0x55d017,_0x5bb14e){return function(_0x52f6e2){if(_0x52f6e2){return _0x52f6e2[_0xb56b('0x2b')]()['then'](function(){var _0x4d7d96=_0x52f6e2['get']({'plain':!![]});var _0x259bce=_0xb56b('0x2c');return db['UserProfileResource'][_0xb56b('0x2b')]({'where':{'type':_0x259bce,'resourceId':_0x4d7d96['id']}})[_0xb56b('0x2a')](function(){return _0x52f6e2;});})[_0xb56b('0x2a')](function(){_0x55d017[_0xb56b('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x507116,_0x4cc7a0){return function(_0x52e827){if(!_0x52e827){_0x507116[_0xb56b('0x21')](0x194);}return _0x52e827;};}function handleError(_0x55896c,_0x2e373d){_0x2e373d=_0x2e373d||0x1f4;return function(_0x530303){logger[_0xb56b('0x2e')](_0x530303[_0xb56b('0x2f')]);if(_0x530303[_0xb56b('0x30')]){delete _0x530303[_0xb56b('0x30')];}_0x55896c[_0xb56b('0x2d')](_0x2e373d)[_0xb56b('0x31')](_0x530303);};}exports['index']=function(_0xf871ee,_0x4d5665){var _0x34adf6={},_0x4a0180={},_0x2334a4={'count':0x0,'rows':[]};var _0x2ea56c=_[_0xb56b('0x32')](db[_0xb56b('0x33')][_0xb56b('0x34')],function(_0x55d03a){return{'name':_0x55d03a[_0xb56b('0x35')],'type':_0x55d03a[_0xb56b('0x36')][_0xb56b('0x37')]};});_0x4a0180['model']=_[_0xb56b('0x32')](_0x2ea56c,_0xb56b('0x30'));_0x4a0180[_0xb56b('0x38')]=_[_0xb56b('0x39')](_0xf871ee['query']);_0x4a0180[_0xb56b('0x3a')]=_[_0xb56b('0x3b')](_0x4a0180[_0xb56b('0x3c')],_0x4a0180[_0xb56b('0x38')]);_0x34adf6[_0xb56b('0x3d')]=_['intersection'](_0x4a0180['model'],qs['fields'](_0xf871ee[_0xb56b('0x38')][_0xb56b('0x3e')]));_0x34adf6['attributes']=_0x34adf6['attributes'][_0xb56b('0x3f')]?_0x34adf6['attributes']:_0x4a0180[_0xb56b('0x3c')];if(!_0xf871ee[_0xb56b('0x38')]['hasOwnProperty'](_0xb56b('0x40'))){_0x34adf6['limit']=qs[_0xb56b('0x26')](_0xf871ee[_0xb56b('0x38')][_0xb56b('0x26')]);_0x34adf6[_0xb56b('0x24')]=qs['offset'](_0xf871ee['query'][_0xb56b('0x24')]);}_0x34adf6[_0xb56b('0x41')]=qs[_0xb56b('0x42')](_0xf871ee[_0xb56b('0x38')]['sort']);_0x34adf6[_0xb56b('0x43')]=qs[_0xb56b('0x3a')](_[_0xb56b('0x44')](_0xf871ee[_0xb56b('0x38')],_0x4a0180[_0xb56b('0x3a')]),_0x2ea56c);if(_0xf871ee[_0xb56b('0x38')][_0xb56b('0x45')]){_0x34adf6[_0xb56b('0x43')]=_['merge'](_0x34adf6[_0xb56b('0x43')],{'$or':_[_0xb56b('0x32')](_0x2ea56c,function(_0x38eccc){if(_0x38eccc[_0xb56b('0x36')]!==_0xb56b('0x46')){var _0x41e824={};_0x41e824[_0x38eccc['name']]={'$like':'%'+_0xf871ee[_0xb56b('0x38')][_0xb56b('0x45')]+'%'};return _0x41e824;}})});}_0x34adf6=_[_0xb56b('0x47')]({},_0x34adf6,_0xf871ee[_0xb56b('0x48')]);var _0x23e7db={'where':_0x34adf6[_0xb56b('0x43')]};return db[_0xb56b('0x33')][_0xb56b('0x27')](_0x23e7db)['then'](function(_0x19268c){_0x2334a4[_0xb56b('0x27')]=_0x19268c;if(_0xf871ee['query'][_0xb56b('0x49')]){_0x34adf6[_0xb56b('0x4a')]=[{'all':!![]}];}return db[_0xb56b('0x33')][_0xb56b('0x4b')](_0x34adf6);})[_0xb56b('0x2a')](function(_0x32fcbe){_0x2334a4[_0xb56b('0x4c')]=_0x32fcbe;return _0x2334a4;})[_0xb56b('0x2a')](respondWithFilteredResult(_0x4d5665,_0x34adf6))['catch'](handleError(_0x4d5665,null));};exports[_0xb56b('0x4d')]=function(_0x9adf62,_0x36054d){var _0x4365ef={'raw':!![],'where':{'id':_0x9adf62[_0xb56b('0x4e')]['id']}},_0x24408d={};_0x24408d[_0xb56b('0x3c')]=_[_0xb56b('0x39')](db[_0xb56b('0x33')][_0xb56b('0x34')]);_0x24408d['query']=_[_0xb56b('0x39')](_0x9adf62['query']);_0x24408d[_0xb56b('0x3a')]=_[_0xb56b('0x3b')](_0x24408d['model'],_0x24408d['query']);_0x4365ef[_0xb56b('0x3d')]=_[_0xb56b('0x3b')](_0x24408d[_0xb56b('0x3c')],qs['fields'](_0x9adf62[_0xb56b('0x38')][_0xb56b('0x3e')]));_0x4365ef['attributes']=_0x4365ef[_0xb56b('0x3d')][_0xb56b('0x3f')]?_0x4365ef[_0xb56b('0x3d')]:_0x24408d[_0xb56b('0x3c')];if(_0x9adf62[_0xb56b('0x38')][_0xb56b('0x49')]){_0x4365ef[_0xb56b('0x4a')]=[{'all':!![]}];}_0x4365ef=_[_0xb56b('0x47')]({},_0x4365ef,_0x9adf62[_0xb56b('0x48')]);return db[_0xb56b('0x33')][_0xb56b('0x4f')](_0x4365ef)[_0xb56b('0x2a')](handleEntityNotFound(_0x36054d,null))[_0xb56b('0x2a')](respondWithResult(_0x36054d,null))[_0xb56b('0x50')](handleError(_0x36054d,null));};exports['create']=function(_0x5cbd74,_0xef3493){return db[_0xb56b('0x33')][_0xb56b('0x51')](_0x5cbd74[_0xb56b('0x52')],{})[_0xb56b('0x2a')](function(_0x4faf4b){var _0x5905b2=_0x5cbd74['user'][_0xb56b('0x53')]({'plain':!![]});if(!_0x5905b2)throw new Error(_0xb56b('0x54'));if(_0x5905b2[_0xb56b('0x55')]===_0xb56b('0x56')){var _0x569749=_0x4faf4b[_0xb56b('0x53')]({'plain':!![]});var _0x3b8061=_0xb56b('0x2c');return db[_0xb56b('0x57')][_0xb56b('0x4f')]({'where':{'name':_0x3b8061,'userProfileId':_0x5905b2[_0xb56b('0x58')]},'raw':!![]})[_0xb56b('0x2a')](function(_0x504720){if(_0x504720&&_0x504720[_0xb56b('0x59')]===0x0){return db[_0xb56b('0x5a')][_0xb56b('0x51')]({'name':_0x569749[_0xb56b('0x30')],'resourceId':_0x569749['id'],'type':_0x504720[_0xb56b('0x30')],'sectionId':_0x504720['id']},{})[_0xb56b('0x2a')](function(){return _0x4faf4b;});}else{return _0x4faf4b;}})[_0xb56b('0x50')](function(_0x357eef){logger[_0xb56b('0x2e')](_0xb56b('0x5b'),_0x357eef);throw _0x357eef;});}return _0x4faf4b;})[_0xb56b('0x2a')](respondWithResult(_0xef3493,0xc9))[_0xb56b('0x50')](handleError(_0xef3493,null));};exports[_0xb56b('0x29')]=function(_0x3ed97b,_0x2b914d){if(_0x3ed97b[_0xb56b('0x52')]['id']){delete _0x3ed97b[_0xb56b('0x52')]['id'];}return db['OpenchannelQueue'][_0xb56b('0x4f')]({'where':{'id':_0x3ed97b['params']['id']}})[_0xb56b('0x2a')](handleEntityNotFound(_0x2b914d,null))[_0xb56b('0x2a')](saveUpdates(_0x3ed97b[_0xb56b('0x52')],null))[_0xb56b('0x2a')](respondWithResult(_0x2b914d,null))[_0xb56b('0x50')](handleError(_0x2b914d,null));};exports['destroy']=function(_0x586f85,_0x4f805b){return db[_0xb56b('0x33')][_0xb56b('0x4f')]({'where':{'id':_0x586f85[_0xb56b('0x4e')]['id']}})[_0xb56b('0x2a')](handleEntityNotFound(_0x4f805b,null))[_0xb56b('0x2a')](removeEntity(_0x4f805b,null))[_0xb56b('0x50')](handleError(_0x4f805b,null));};exports[_0xb56b('0x5c')]=function(_0x3d847b,_0x5cda2c){return db[_0xb56b('0x33')]['describe']()[_0xb56b('0x2a')](respondWithResult(_0x5cda2c,null))['catch'](handleError(_0x5cda2c,null));};exports['getMembers']=function(_0x19f639,_0x14fdf1,_0x3a7d05){var _0x36de0f={'raw':!![],'where':{}},_0x2c9269={},_0x52961c;return db['OpenchannelQueue'][_0xb56b('0x5d')]({'where':{'id':_0x19f639[_0xb56b('0x4e')]['id']}})[_0xb56b('0x2a')](handleEntityNotFound(_0x14fdf1,null))[_0xb56b('0x2a')](function(_0x518a95){if(_0x518a95){_0x52961c=_0x518a95[_0xb56b('0x53')]({'plain':!![]});_0x2c9269[_0xb56b('0x3c')]=_[_0xb56b('0x39')](db['UserOpenchannelQueue'][_0xb56b('0x34')]);_0x2c9269[_0xb56b('0x38')]=_[_0xb56b('0x39')](_0x19f639[_0xb56b('0x38')]);_0x2c9269[_0xb56b('0x3a')]=_[_0xb56b('0x3b')](_0x2c9269[_0xb56b('0x3c')],_0x2c9269[_0xb56b('0x38')]);_0x36de0f[_0xb56b('0x3d')]=_[_0xb56b('0x3b')](_0x2c9269[_0xb56b('0x3c')],qs['fields'](_0x19f639[_0xb56b('0x38')][_0xb56b('0x3e')]));_0x36de0f['attributes']=_0x36de0f[_0xb56b('0x3d')]['length']?_0x36de0f['attributes']:_0x2c9269[_0xb56b('0x3c')];if(!_0x19f639[_0xb56b('0x38')][_0xb56b('0x5e')]('nolimit')){_0x36de0f[_0xb56b('0x26')]=qs[_0xb56b('0x26')](_0x19f639['query']['limit']);_0x36de0f[_0xb56b('0x24')]=qs[_0xb56b('0x24')](_0x19f639[_0xb56b('0x38')][_0xb56b('0x24')]);}_0x36de0f[_0xb56b('0x41')]=qs[_0xb56b('0x42')](_0x19f639[_0xb56b('0x38')][_0xb56b('0x42')]);_0x36de0f[_0xb56b('0x43')]=qs[_0xb56b('0x3a')](_[_0xb56b('0x44')](_0x19f639[_0xb56b('0x38')],_0x2c9269[_0xb56b('0x3a')]));_0x36de0f[_0xb56b('0x43')][_0xb56b('0x5f')]=_0x518a95['id'];if(_0x19f639['query']['filter']){_0x36de0f[_0xb56b('0x43')]=_['merge'](_0x36de0f[_0xb56b('0x43')],{'$or':_[_0xb56b('0x32')](_0x36de0f['attributes'],function(_0x57257e){var _0x4a7a6a={};_0x4a7a6a[_0x57257e]={'$like':'%'+_0x19f639[_0xb56b('0x38')]['filter']+'%'};return _0x4a7a6a;})});}_0x36de0f=_['merge']({},_0x36de0f,_0x19f639[_0xb56b('0x48')]);return db[_0xb56b('0x60')]['findAll'](_0x36de0f);}})[_0xb56b('0x2a')](function(_0x20c226){if(_0x20c226){return db[_0xb56b('0x61')][_0xb56b('0x62')]({'where':{'id':_[_0xb56b('0x32')](_0x20c226,'UserId'),'role':_0xb56b('0x63')},'attributes':['id',_0xb56b('0x30'),_0xb56b('0x64'),_0xb56b('0x65'),_0xb56b('0x66')]});}})[_0xb56b('0x2a')](function(_0x45bb4c){if(_0x45bb4c){return{'count':_0x45bb4c['count'],'rows':_['map'](_0x45bb4c[_0xb56b('0x4c')],function(_0x1f3cd2){return{'membername':_0x1f3cd2[_0xb56b('0x30')],'UserId':_0x1f3cd2['id'],'queue_name':_0x52961c[_0xb56b('0x30')],'OpenchannelQueueId':_0x52961c['id'],'interface':util[_0xb56b('0x67')](_0xb56b('0x68'),_0xb56b('0x69'),_0x1f3cd2[_0xb56b('0x30')]),'penalty':0x0,'paused':_0x1f3cd2[_0xb56b('0x64')],'createdAt':_0x1f3cd2[_0xb56b('0x66')],'updatedAt':_0x1f3cd2[_0xb56b('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb56b('0x2a')](respondWithFilteredResult(_0x14fdf1,_0x36de0f))[_0xb56b('0x50')](handleError(_0x14fdf1,null));};exports[_0xb56b('0x6a')]=function(_0x5d9858,_0x40cc64,_0x279440){var _0xef1cf={};var _0x549c6b={};var _0xeb6217;var _0x36f65c;return db[_0xb56b('0x33')][_0xb56b('0x5d')]({'where':{'id':_0x5d9858['params']['id']}})[_0xb56b('0x2a')](handleEntityNotFound(_0x40cc64,null))[_0xb56b('0x2a')](function(_0x47427e){if(_0x47427e){_0xeb6217=_0x47427e;_0x549c6b[_0xb56b('0x3c')]=_[_0xb56b('0x39')](db[_0xb56b('0x6b')][_0xb56b('0x34')]);_0x549c6b['query']=_[_0xb56b('0x39')](_0x5d9858[_0xb56b('0x38')]);_0x549c6b[_0xb56b('0x3a')]=_[_0xb56b('0x3b')](_0x549c6b[_0xb56b('0x3c')],_0x549c6b['query']);_0xef1cf[_0xb56b('0x3d')]=_[_0xb56b('0x3b')](_0x549c6b[_0xb56b('0x3c')],qs['fields'](_0x5d9858[_0xb56b('0x38')][_0xb56b('0x3e')]));_0xef1cf['attributes']=_0xef1cf['attributes'][_0xb56b('0x3f')]?_0xef1cf[_0xb56b('0x3d')]:_0x549c6b[_0xb56b('0x3c')];_0xef1cf[_0xb56b('0x41')]=qs['sort'](_0x5d9858[_0xb56b('0x38')][_0xb56b('0x42')]);_0xef1cf['where']=qs['filters'](_[_0xb56b('0x44')](_0x5d9858[_0xb56b('0x38')],_0x549c6b[_0xb56b('0x3a')]));if(_0x5d9858['query']['filter']){_0xef1cf['where']=_[_0xb56b('0x47')](_0xef1cf[_0xb56b('0x43')],{'$or':_[_0xb56b('0x32')](_0xef1cf[_0xb56b('0x3d')],function(_0xb7a485){var _0x4c11e3={};_0x4c11e3[_0xb7a485]={'$like':'%'+_0x5d9858[_0xb56b('0x38')][_0xb56b('0x45')]+'%'};return _0x4c11e3;})});}_0xef1cf=_[_0xb56b('0x47')]({},_0xef1cf,_0x5d9858[_0xb56b('0x48')]);return _0xeb6217[_0xb56b('0x6a')](_0xef1cf);}})[_0xb56b('0x2a')](function(_0x31b1ef){if(_0x31b1ef){_0x36f65c=_0x31b1ef[_0xb56b('0x3f')];if(!_0x5d9858['query']['hasOwnProperty'](_0xb56b('0x40'))){_0xef1cf[_0xb56b('0x26')]=qs[_0xb56b('0x26')](_0x5d9858[_0xb56b('0x38')]['limit']);_0xef1cf[_0xb56b('0x24')]=qs[_0xb56b('0x24')](_0x5d9858[_0xb56b('0x38')]['offset']);}return _0xeb6217['getTeams'](_0xef1cf);}})[_0xb56b('0x2a')](function(_0x22e40a){if(_0x22e40a){return _0x22e40a?{'count':_0x36f65c,'rows':_0x22e40a}:null;}})[_0xb56b('0x2a')](respondWithResult(_0x40cc64,null))[_0xb56b('0x50')](handleError(_0x40cc64,null));};exports[_0xb56b('0x6c')]=function(_0x34f6f7,_0x5d4570,_0x29676a){var _0x133cc9=_0x34f6f7[_0xb56b('0x52')]['ids'];return db[_0xb56b('0x6b')][_0xb56b('0x4b')]({'where':{'id':_0x133cc9},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb56b('0x30'),_0xb56b('0x6d'),'voicePause',_0xb56b('0x6e')],'raw':!![]}]})[_0xb56b('0x2a')](function(_0x3bb3f3){if(_0x3bb3f3){var _0x22ead6=_[_0xb56b('0x6f')](_0x3bb3f3,function(_0x923968){var _0xc03a90=_0x923968[_0xb56b('0x53')]({'plain':!![]});return _0xc03a90[_0xb56b('0x70')];});return db[_0xb56b('0x33')]['find']({'where':{'id':_0x34f6f7[_0xb56b('0x4e')]['id']}})[_0xb56b('0x2a')](function(_0x48f100){return db[_0xb56b('0x71')][_0xb56b('0x72')](function(_0x15ce98){return _0x48f100[_0xb56b('0x6c')](_0x133cc9,{'transaction':_0x15ce98})[_0xb56b('0x2a')](function(){return BPromise[_0xb56b('0x73')](_0x22ead6,function(_0x31e22c){return db[_0xb56b('0x60')][_0xb56b('0x74')]({'where':{'UserId':_0x31e22c['id'],'OpenchannelQueueId':_0x34f6f7[_0xb56b('0x4e')]['id']},'transaction':_0x15ce98});});})[_0xb56b('0x2a')](function(){_0x22ead6['forEach'](function(_0x4ccd3b){socket[_0xb56b('0x75')](_0xb56b('0x76'),{'UserId':_0x4ccd3b['id'],'OpenchannelQueueId':_0x48f100['id']});});});});});}})[_0xb56b('0x2a')](respondWithStatusCode(_0x5d4570,null))['catch'](handleError(_0x5d4570,null));};exports[_0xb56b('0x77')]=function(_0x1a9318,_0x12d337,_0xd4c2c){return db['Team'][_0xb56b('0x4b')]({'where':{'id':_0x1a9318[_0xb56b('0x38')][_0xb56b('0x78')]},'attributes':['id'],'include':[{'model':db[_0xb56b('0x61')],'as':_0xb56b('0x70'),'attributes':['id'],'raw':!![]}]})[_0xb56b('0x2a')](handleEntityNotFound(_0x12d337,null))['then'](function(_0x428af5){var _0x33852e=_[_0xb56b('0x32')](_0x428af5,'id');var _0x224596=[];var _0x30b849=[];var _0x21b40a=squel[_0xb56b('0x79')]();_0x21b40a[_0xb56b('0x7a')](_0xb56b('0x7b'))[_0xb56b('0x7c')](_0xb56b('0x7d'),'tq')[_0xb56b('0x7e')]('user_has_teams','ut',_0xb56b('0x7f'))[_0xb56b('0x43')](_0xb56b('0x80'),_0x1a9318['params']['id']);for(var _0x273b4c=0x0;_0x273b4c<_0x428af5[_0xb56b('0x3f')];_0x273b4c+=0x1){let _0x4bfa0d=_0x428af5[_0x273b4c];for(var _0x5cc3f3=0x0;_0x5cc3f3<_0x4bfa0d['Agents'][_0xb56b('0x3f')];_0x5cc3f3+=0x1){let _0x5ef03b=_0x4bfa0d[_0xb56b('0x70')][_0x5cc3f3];var _0x21e6b8=_0x21b40a[_0xb56b('0x81')]();_0x21e6b8[_0xb56b('0x43')]('ut.UserId\x20=\x20?',_0x5ef03b['id']);_0x30b849[_0xb56b('0x82')](db['sequelize'][_0xb56b('0x38')](_0x21e6b8[_0xb56b('0x83')](),{'type':db[_0xb56b('0x71')]['QueryTypes'][_0xb56b('0x84')]})[_0xb56b('0x2a')](function(_0x4337aa){if(_0x4337aa[_0xb56b('0x3f')]===0x1){return _0x5ef03b['id'];}else{var _0xade807=_[_0xb56b('0x85')](_['map'](_0x4337aa,_0xb56b('0x86')),function(_0xd772db){return _['includes'](_0x33852e,_0xd772db);});if(_0xade807){return _0x5ef03b['id'];}}}));}}return BPromise[_0xb56b('0x87')](_0x30b849)[_0xb56b('0x2a')](function(_0x5e1cb4){_0x224596=_(_0x224596)[_0xb56b('0x88')](_0x5e1cb4)[_0xb56b('0x89')]()[_0xb56b('0x8a')]();return db[_0xb56b('0x33')][_0xb56b('0x4f')]({'where':{'id':_0x1a9318[_0xb56b('0x4e')]['id']}})[_0xb56b('0x2a')](function(_0x3fb837){return db[_0xb56b('0x71')][_0xb56b('0x72')](function(_0xf9501d){return _0x3fb837[_0xb56b('0x77')](_0x1a9318['query']['ids'],{'transaction':_0xf9501d})[_0xb56b('0x2a')](function(){if(!_['isEmpty'](_0x224596)){return _0x3fb837['removeAgents'](_0x224596,{'transaction':_0xf9501d});}})[_0xb56b('0x2a')](function(){_0x224596[_0xb56b('0x8b')](function(_0x5a7785){socket[_0xb56b('0x75')]('userOpenchannelQueue:remove',{'UserId':_0x5a7785,'OpenchannelQueueId':_0x3fb837['id']});});});});});});})[_0xb56b('0x2a')](respondWithStatusCode(_0x12d337,null))[_0xb56b('0x50')](handleError(_0x12d337,null));};exports[_0xb56b('0x8c')]=function(_0x35514e,_0x14edb7,_0xbbcfb8){return db[_0xb56b('0x33')][_0xb56b('0x4f')]({'where':{'id':_0x35514e[_0xb56b('0x4e')]['id']}})[_0xb56b('0x2a')](handleEntityNotFound(_0x14edb7,null))[_0xb56b('0x2a')](function(_0x1657f9){if(_0x1657f9){return _0x1657f9['addAgents'](_0x35514e[_0xb56b('0x52')][_0xb56b('0x78')],_['omit'](_0x35514e[_0xb56b('0x52')],[_0xb56b('0x78'),'id'])||{})[_0xb56b('0x8d')](function(_0x42deb8){for(var _0x42980c=0x0;_0x42980c<_0x35514e['body'][_0xb56b('0x78')][_0xb56b('0x3f')];_0x42980c+=0x1){socket[_0xb56b('0x75')](_0xb56b('0x76'),{'UserId':Number(_0x35514e['body'][_0xb56b('0x78')][_0x42980c]),'OpenchannelQueueId':Number(_0x35514e[_0xb56b('0x4e')]['id'])});}return _0x42deb8;});}})[_0xb56b('0x2a')](respondWithResult(_0x14edb7,null))['catch'](handleError(_0x14edb7,null));};exports['removeAgents']=function(_0x29c36a,_0x535ea4,_0x139b76){return db[_0xb56b('0x33')]['find']({'where':{'id':_0x29c36a[_0xb56b('0x4e')]['id']}})[_0xb56b('0x2a')](handleEntityNotFound(_0x535ea4,null))[_0xb56b('0x2a')](function(_0x408e23){if(_0x408e23){return _0x408e23[_0xb56b('0x8e')](_0x29c36a[_0xb56b('0x38')]['ids'])[_0xb56b('0x2a')](function(){if(_[_0xb56b('0x8f')](_0x29c36a['query']['ids'])){for(var _0xe6f563=0x0;_0xe6f563<_0x29c36a[_0xb56b('0x38')][_0xb56b('0x78')][_0xb56b('0x3f')];_0xe6f563+=0x1){socket[_0xb56b('0x75')](_0xb56b('0x90'),{'UserId':Number(_0x29c36a[_0xb56b('0x38')][_0xb56b('0x78')][_0xe6f563]),'OpenchannelQueueId':Number(_0x29c36a[_0xb56b('0x4e')]['id'])});}}else{socket[_0xb56b('0x75')](_0xb56b('0x90'),{'UserId':Number(_0x29c36a['query']['ids']),'OpenchannelQueueId':Number(_0x29c36a[_0xb56b('0x4e')]['id'])});}});}})[_0xb56b('0x2a')](respondWithStatusCode(_0x535ea4,null))[_0xb56b('0x50')](handleError(_0x535ea4,null));};exports[_0xb56b('0x91')]=function(_0x5777c0,_0x5d25a4,_0x13f81b){var _0x222ca6={};var _0x9c06d6={};var _0x547006;var _0x98311e;return db[_0xb56b('0x33')][_0xb56b('0x5d')]({'where':{'id':_0x5777c0[_0xb56b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5d25a4,null))[_0xb56b('0x2a')](function(_0x4fd6b8){if(_0x4fd6b8){_0x547006=_0x4fd6b8;_0x9c06d6['model']=_[_0xb56b('0x39')](db[_0xb56b('0x61')][_0xb56b('0x34')]);_0x9c06d6[_0xb56b('0x38')]=_[_0xb56b('0x39')](_0x5777c0[_0xb56b('0x38')]);_0x9c06d6[_0xb56b('0x3a')]=_[_0xb56b('0x3b')](_0x9c06d6[_0xb56b('0x3c')],_0x9c06d6[_0xb56b('0x38')]);_0x222ca6[_0xb56b('0x3d')]=_[_0xb56b('0x3b')](_0x9c06d6['model'],qs[_0xb56b('0x3e')](_0x5777c0[_0xb56b('0x38')][_0xb56b('0x3e')]));_0x222ca6[_0xb56b('0x3d')]=_0x222ca6['attributes'][_0xb56b('0x3f')]?_0x222ca6[_0xb56b('0x3d')]:_0x9c06d6[_0xb56b('0x3c')];_0x222ca6[_0xb56b('0x41')]=qs[_0xb56b('0x42')](_0x5777c0[_0xb56b('0x38')][_0xb56b('0x42')]);_0x222ca6[_0xb56b('0x43')]=qs[_0xb56b('0x3a')](_[_0xb56b('0x44')](_0x5777c0[_0xb56b('0x38')],_0x9c06d6[_0xb56b('0x3a')]));if(_0x5777c0[_0xb56b('0x38')][_0xb56b('0x45')]){_0x222ca6[_0xb56b('0x43')]=_[_0xb56b('0x47')](_0x222ca6[_0xb56b('0x43')],{'$or':_[_0xb56b('0x32')](_0x222ca6['attributes'],function(_0xc26504){var _0xa9234={};_0xa9234[_0xc26504]={'$like':'%'+_0x5777c0['query'][_0xb56b('0x45')]+'%'};return _0xa9234;})});}_0x222ca6=_[_0xb56b('0x47')]({},_0x222ca6,_0x5777c0[_0xb56b('0x48')]);return _0x547006[_0xb56b('0x91')](_0x222ca6);}})[_0xb56b('0x2a')](function(_0x2c9d2c){if(_0x2c9d2c){_0x98311e=_0x2c9d2c['length'];if(!_0x5777c0[_0xb56b('0x38')]['hasOwnProperty'](_0xb56b('0x40'))){_0x222ca6[_0xb56b('0x26')]=qs['limit'](_0x5777c0[_0xb56b('0x38')]['limit']);_0x222ca6[_0xb56b('0x24')]=qs['offset'](_0x5777c0[_0xb56b('0x38')]['offset']);}return _0x547006['getAgents'](_0x222ca6);}})[_0xb56b('0x2a')](function(_0x5bbb73){if(_0x5bbb73){return _0x5bbb73?{'count':_0x98311e,'rows':_0x5bbb73}:null;}})[_0xb56b('0x2a')](respondWithResult(_0x5d25a4,null))['catch'](handleError(_0x5d25a4,null));}; \ No newline at end of file +var _0xddfb=['ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','destroy','then','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','get','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','Team','ids','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userOpenchannelQueue:save','Agents','select','field','tq.TeamId','clone'];(function(_0x40a07f,_0x35d50e){var _0x4b8246=function(_0x3ffb30){while(--_0x3ffb30){_0x40a07f['push'](_0x40a07f['shift']());}};_0x4b8246(++_0x35d50e);}(_0xddfb,0xaa));var _0xbddf=function(_0x528ebc,_0x644cc7){_0x528ebc=_0x528ebc-0x0;var _0x22c1cd=_0xddfb[_0x528ebc];return _0x22c1cd;};'use strict';var emlformat=require(_0xbddf('0x0'));var rimraf=require(_0xbddf('0x1'));var zipdir=require(_0xbddf('0x2'));var jsonpatch=require(_0xbddf('0x3'));var rp=require(_0xbddf('0x4'));var moment=require(_0xbddf('0x5'));var BPromise=require(_0xbddf('0x6'));var Mustache=require(_0xbddf('0x7'));var util=require(_0xbddf('0x8'));var path=require(_0xbddf('0x9'));var sox=require(_0xbddf('0xa'));var csv=require('to-csv');var ejs=require(_0xbddf('0xb'));var fs=require('fs');var fs_extra=require(_0xbddf('0xc'));var _=require('lodash');var squel=require(_0xbddf('0xd'));var crypto=require(_0xbddf('0xe'));var jsforce=require(_0xbddf('0xf'));var deskjs=require(_0xbddf('0x10'));var toCsv=require(_0xbddf('0x11'));var querystring=require(_0xbddf('0x12'));var Papa=require('papaparse');var Redis=require(_0xbddf('0x13'));var authService=require(_0xbddf('0x14'));var qs=require(_0xbddf('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbddf('0x16'));var logger=require(_0xbddf('0x17'))('api');var utils=require(_0xbddf('0x18'));var config=require(_0xbddf('0x19'));var licenseUtil=require(_0xbddf('0x1a'));var db=require(_0xbddf('0x1b'))['db'];config[_0xbddf('0x1c')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbddf('0x1d'))(new Redis(config[_0xbddf('0x1c')]));require(_0xbddf('0x1e'))['register'](socket);function respondWithStatusCode(_0x1d984c,_0x6687e2){_0x6687e2=_0x6687e2||0xcc;return function(_0x2b34cc){if(_0x2b34cc){return _0x1d984c['sendStatus'](_0x6687e2);}return _0x1d984c['status'](_0x6687e2)[_0xbddf('0x1f')]();};}function respondWithResult(_0x37a8c3,_0x37b9cf){_0x37b9cf=_0x37b9cf||0xc8;return function(_0x3a8d48){if(_0x3a8d48){return _0x37a8c3[_0xbddf('0x20')](_0x37b9cf)[_0xbddf('0x21')](_0x3a8d48);}};}function respondWithFilteredResult(_0x1d2906,_0x3f5288){return function(_0x497227){if(_0x497227){var _0x5ed8a3=typeof _0x3f5288['offset']===_0xbddf('0x22')&&typeof _0x3f5288[_0xbddf('0x23')]===_0xbddf('0x22');var _0x22682a=_0x497227['count'];var _0x28238c=_0x5ed8a3?0x0:_0x3f5288[_0xbddf('0x24')];var _0x12751a=_0x5ed8a3?_0x497227[_0xbddf('0x25')]:_0x3f5288[_0xbddf('0x24')]+_0x3f5288[_0xbddf('0x23')];var _0x2cad06;if(_0x12751a>=_0x22682a){_0x12751a=_0x22682a;_0x2cad06=0xc8;}else{_0x2cad06=0xce;}_0x1d2906[_0xbddf('0x20')](_0x2cad06);return _0x1d2906[_0xbddf('0x26')](_0xbddf('0x27'),_0x28238c+'-'+_0x12751a+'/'+_0x22682a)[_0xbddf('0x21')](_0x497227);}return null;};}function patchUpdates(_0x3d42e4){return function(_0x34cf6b){try{jsonpatch[_0xbddf('0x28')](_0x34cf6b,_0x3d42e4,!![]);}catch(_0x32b39f){return BPromise[_0xbddf('0x29')](_0x32b39f);}return _0x34cf6b['save']();};}function saveUpdates(_0xd7646b,_0x4ac8e3){return function(_0x18cfed){if(_0x18cfed){return _0x18cfed[_0xbddf('0x2a')](_0xd7646b)['then'](function(_0x144d3b){return _0x144d3b;});}return null;};}function removeEntity(_0x42eda9,_0x2b073b){return function(_0x586ad2){if(_0x586ad2){return _0x586ad2[_0xbddf('0x2b')]()[_0xbddf('0x2c')](function(){var _0xcc1a82=_0x586ad2['get']({'plain':!![]});var _0x2032f6=_0xbddf('0x2d');return db[_0xbddf('0x2e')][_0xbddf('0x2b')]({'where':{'type':_0x2032f6,'resourceId':_0xcc1a82['id']}})[_0xbddf('0x2c')](function(){return _0x586ad2;});})[_0xbddf('0x2c')](function(){_0x42eda9['status'](0xcc)[_0xbddf('0x1f')]();});}};}function handleEntityNotFound(_0x3d3374,_0x23518a){return function(_0x527e9d){if(!_0x527e9d){_0x3d3374[_0xbddf('0x2f')](0x194);}return _0x527e9d;};}function handleError(_0x4d4a7c,_0x2df192){_0x2df192=_0x2df192||0x1f4;return function(_0x4d1a08){logger[_0xbddf('0x30')](_0x4d1a08[_0xbddf('0x31')]);if(_0x4d1a08[_0xbddf('0x32')]){delete _0x4d1a08[_0xbddf('0x32')];}_0x4d4a7c['status'](_0x2df192)[_0xbddf('0x33')](_0x4d1a08);};}exports[_0xbddf('0x34')]=function(_0xe1342,_0x5ad083){var _0x5bc426={},_0x45773b={},_0xc92cf1={'count':0x0,'rows':[]};var _0x570cac=_[_0xbddf('0x35')](db[_0xbddf('0x36')][_0xbddf('0x37')],function(_0x1292c5){return{'name':_0x1292c5[_0xbddf('0x38')],'type':_0x1292c5[_0xbddf('0x39')]['key']};});_0x45773b['model']=_['map'](_0x570cac,_0xbddf('0x32'));_0x45773b['query']=_[_0xbddf('0x3a')](_0xe1342[_0xbddf('0x3b')]);_0x45773b[_0xbddf('0x3c')]=_[_0xbddf('0x3d')](_0x45773b[_0xbddf('0x3e')],_0x45773b[_0xbddf('0x3b')]);_0x5bc426[_0xbddf('0x3f')]=_[_0xbddf('0x3d')](_0x45773b[_0xbddf('0x3e')],qs[_0xbddf('0x40')](_0xe1342[_0xbddf('0x3b')][_0xbddf('0x40')]));_0x5bc426[_0xbddf('0x3f')]=_0x5bc426[_0xbddf('0x3f')][_0xbddf('0x41')]?_0x5bc426['attributes']:_0x45773b[_0xbddf('0x3e')];if(!_0xe1342['query'][_0xbddf('0x42')](_0xbddf('0x43'))){_0x5bc426[_0xbddf('0x23')]=qs[_0xbddf('0x23')](_0xe1342['query'][_0xbddf('0x23')]);_0x5bc426['offset']=qs[_0xbddf('0x24')](_0xe1342['query'][_0xbddf('0x24')]);}_0x5bc426[_0xbddf('0x44')]=qs['sort'](_0xe1342[_0xbddf('0x3b')][_0xbddf('0x45')]);_0x5bc426[_0xbddf('0x46')]=qs['filters'](_[_0xbddf('0x47')](_0xe1342['query'],_0x45773b[_0xbddf('0x3c')]),_0x570cac);if(_0xe1342[_0xbddf('0x3b')]['filter']){_0x5bc426[_0xbddf('0x46')]=_[_0xbddf('0x48')](_0x5bc426['where'],{'$or':_[_0xbddf('0x35')](_0x570cac,function(_0x12d3db){if(_0x12d3db[_0xbddf('0x39')]!==_0xbddf('0x49')){var _0x1ef8f6={};_0x1ef8f6[_0x12d3db[_0xbddf('0x32')]]={'$like':'%'+_0xe1342[_0xbddf('0x3b')][_0xbddf('0x4a')]+'%'};return _0x1ef8f6;}})});}_0x5bc426=_[_0xbddf('0x48')]({},_0x5bc426,_0xe1342[_0xbddf('0x4b')]);var _0x378935={'where':_0x5bc426[_0xbddf('0x46')]};return db[_0xbddf('0x36')][_0xbddf('0x25')](_0x378935)['then'](function(_0x2b980a){_0xc92cf1[_0xbddf('0x25')]=_0x2b980a;if(_0xe1342['query'][_0xbddf('0x4c')]){_0x5bc426[_0xbddf('0x4d')]=[{'all':!![]}];}return db[_0xbddf('0x36')][_0xbddf('0x4e')](_0x5bc426);})['then'](function(_0x4be46d){_0xc92cf1[_0xbddf('0x4f')]=_0x4be46d;return _0xc92cf1;})['then'](respondWithFilteredResult(_0x5ad083,_0x5bc426))['catch'](handleError(_0x5ad083,null));};exports[_0xbddf('0x50')]=function(_0x583b35,_0x47f7bd){var _0x4b2d37={'raw':!![],'where':{'id':_0x583b35[_0xbddf('0x51')]['id']}},_0x595775={};_0x595775[_0xbddf('0x3e')]=_[_0xbddf('0x3a')](db[_0xbddf('0x36')][_0xbddf('0x37')]);_0x595775[_0xbddf('0x3b')]=_['keys'](_0x583b35[_0xbddf('0x3b')]);_0x595775[_0xbddf('0x3c')]=_[_0xbddf('0x3d')](_0x595775[_0xbddf('0x3e')],_0x595775[_0xbddf('0x3b')]);_0x4b2d37[_0xbddf('0x3f')]=_[_0xbddf('0x3d')](_0x595775[_0xbddf('0x3e')],qs[_0xbddf('0x40')](_0x583b35['query'][_0xbddf('0x40')]));_0x4b2d37[_0xbddf('0x3f')]=_0x4b2d37[_0xbddf('0x3f')]['length']?_0x4b2d37[_0xbddf('0x3f')]:_0x595775[_0xbddf('0x3e')];if(_0x583b35[_0xbddf('0x3b')][_0xbddf('0x4c')]){_0x4b2d37[_0xbddf('0x4d')]=[{'all':!![]}];}_0x4b2d37=_[_0xbddf('0x48')]({},_0x4b2d37,_0x583b35['options']);return db[_0xbddf('0x36')][_0xbddf('0x52')](_0x4b2d37)[_0xbddf('0x2c')](handleEntityNotFound(_0x47f7bd,null))['then'](respondWithResult(_0x47f7bd,null))[_0xbddf('0x53')](handleError(_0x47f7bd,null));};exports[_0xbddf('0x54')]=function(_0x14b1ce,_0x2de1b9){return db['OpenchannelQueue'][_0xbddf('0x54')](_0x14b1ce['body'],{})[_0xbddf('0x2c')](function(_0x2444d9){var _0x1cda5e=_0x14b1ce[_0xbddf('0x55')]['get']({'plain':!![]});if(!_0x1cda5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cda5e[_0xbddf('0x56')]===_0xbddf('0x55')){var _0x2435e6=_0x2444d9['get']({'plain':!![]});var _0x2c756c=_0xbddf('0x2d');return db[_0xbddf('0x57')]['find']({'where':{'name':_0x2c756c,'userProfileId':_0x1cda5e[_0xbddf('0x58')]},'raw':!![]})[_0xbddf('0x2c')](function(_0x4da65e){if(_0x4da65e&&_0x4da65e[_0xbddf('0x59')]===0x0){return db[_0xbddf('0x2e')][_0xbddf('0x54')]({'name':_0x2435e6[_0xbddf('0x32')],'resourceId':_0x2435e6['id'],'type':_0x4da65e[_0xbddf('0x32')],'sectionId':_0x4da65e['id']},{})['then'](function(){return _0x2444d9;});}else{return _0x2444d9;}})[_0xbddf('0x53')](function(_0x1768fd){logger[_0xbddf('0x30')](_0xbddf('0x5a'),_0x1768fd);throw _0x1768fd;});}return _0x2444d9;})['then'](respondWithResult(_0x2de1b9,0xc9))['catch'](handleError(_0x2de1b9,null));};exports[_0xbddf('0x2a')]=function(_0x31ea99,_0x4408fd){if(_0x31ea99[_0xbddf('0x5b')]['id']){delete _0x31ea99['body']['id'];}return db[_0xbddf('0x36')][_0xbddf('0x52')]({'where':{'id':_0x31ea99['params']['id']}})[_0xbddf('0x2c')](handleEntityNotFound(_0x4408fd,null))[_0xbddf('0x2c')](saveUpdates(_0x31ea99[_0xbddf('0x5b')],null))[_0xbddf('0x2c')](respondWithResult(_0x4408fd,null))['catch'](handleError(_0x4408fd,null));};exports[_0xbddf('0x2b')]=function(_0x581a5f,_0x369eee){return db['OpenchannelQueue']['find']({'where':{'id':_0x581a5f[_0xbddf('0x51')]['id']}})[_0xbddf('0x2c')](handleEntityNotFound(_0x369eee,null))[_0xbddf('0x2c')](removeEntity(_0x369eee,null))[_0xbddf('0x53')](handleError(_0x369eee,null));};exports[_0xbddf('0x5c')]=function(_0x47ce89,_0x38b359){return db['OpenchannelQueue'][_0xbddf('0x5c')]()[_0xbddf('0x2c')](respondWithResult(_0x38b359,null))[_0xbddf('0x53')](handleError(_0x38b359,null));};exports[_0xbddf('0x5d')]=function(_0x2d9e03,_0x1b7ee4,_0x5d6b7e){var _0x3ce8a4={'raw':!![],'where':{}},_0x57b3fe={},_0x50268d;return db[_0xbddf('0x36')][_0xbddf('0x5e')]({'where':{'id':_0x2d9e03[_0xbddf('0x51')]['id']}})[_0xbddf('0x2c')](handleEntityNotFound(_0x1b7ee4,null))[_0xbddf('0x2c')](function(_0x43ac55){if(_0x43ac55){_0x50268d=_0x43ac55[_0xbddf('0x5f')]({'plain':!![]});_0x57b3fe['model']=_[_0xbddf('0x3a')](db[_0xbddf('0x60')]['rawAttributes']);_0x57b3fe['query']=_[_0xbddf('0x3a')](_0x2d9e03[_0xbddf('0x3b')]);_0x57b3fe[_0xbddf('0x3c')]=_['intersection'](_0x57b3fe['model'],_0x57b3fe[_0xbddf('0x3b')]);_0x3ce8a4[_0xbddf('0x3f')]=_[_0xbddf('0x3d')](_0x57b3fe[_0xbddf('0x3e')],qs['fields'](_0x2d9e03[_0xbddf('0x3b')][_0xbddf('0x40')]));_0x3ce8a4[_0xbddf('0x3f')]=_0x3ce8a4[_0xbddf('0x3f')][_0xbddf('0x41')]?_0x3ce8a4[_0xbddf('0x3f')]:_0x57b3fe[_0xbddf('0x3e')];if(!_0x2d9e03[_0xbddf('0x3b')]['hasOwnProperty'](_0xbddf('0x43'))){_0x3ce8a4[_0xbddf('0x23')]=qs[_0xbddf('0x23')](_0x2d9e03['query'][_0xbddf('0x23')]);_0x3ce8a4[_0xbddf('0x24')]=qs[_0xbddf('0x24')](_0x2d9e03[_0xbddf('0x3b')][_0xbddf('0x24')]);}_0x3ce8a4[_0xbddf('0x44')]=qs[_0xbddf('0x45')](_0x2d9e03['query']['sort']);_0x3ce8a4[_0xbddf('0x46')]=qs[_0xbddf('0x3c')](_[_0xbddf('0x47')](_0x2d9e03[_0xbddf('0x3b')],_0x57b3fe['filters']));_0x3ce8a4['where'][_0xbddf('0x61')]=_0x43ac55['id'];if(_0x2d9e03['query'][_0xbddf('0x4a')]){_0x3ce8a4[_0xbddf('0x46')]=_['merge'](_0x3ce8a4['where'],{'$or':_[_0xbddf('0x35')](_0x3ce8a4[_0xbddf('0x3f')],function(_0x4e8737){var _0x335504={};_0x335504[_0x4e8737]={'$like':'%'+_0x2d9e03[_0xbddf('0x3b')][_0xbddf('0x4a')]+'%'};return _0x335504;})});}_0x3ce8a4=_['merge']({},_0x3ce8a4,_0x2d9e03['options']);return db['UserOpenchannelQueue'][_0xbddf('0x4e')](_0x3ce8a4);}})['then'](function(_0x490b54){if(_0x490b54){return db[_0xbddf('0x62')]['findAndCountAll']({'where':{'id':_['map'](_0x490b54,_0xbddf('0x63')),'role':_0xbddf('0x64')},'attributes':['id',_0xbddf('0x32'),'openchannelPause',_0xbddf('0x65'),_0xbddf('0x66')]});}})[_0xbddf('0x2c')](function(_0x2e94cf){if(_0x2e94cf){return{'count':_0x2e94cf[_0xbddf('0x25')],'rows':_['map'](_0x2e94cf[_0xbddf('0x4f')],function(_0x59679e){return{'membername':_0x59679e[_0xbddf('0x32')],'UserId':_0x59679e['id'],'queue_name':_0x50268d[_0xbddf('0x32')],'OpenchannelQueueId':_0x50268d['id'],'interface':util[_0xbddf('0x67')](_0xbddf('0x68'),_0xbddf('0x69'),_0x59679e['name']),'penalty':0x0,'paused':_0x59679e[_0xbddf('0x6a')],'createdAt':_0x59679e[_0xbddf('0x66')],'updatedAt':_0x59679e[_0xbddf('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbddf('0x2c')](respondWithFilteredResult(_0x1b7ee4,_0x3ce8a4))[_0xbddf('0x53')](handleError(_0x1b7ee4,null));};exports[_0xbddf('0x6b')]=function(_0x191b23,_0xe7fc64,_0x289c1d){var _0xeba79d={};var _0xf1eb7e={};var _0x559572;var _0x1419f4;return db[_0xbddf('0x36')]['findOne']({'where':{'id':_0x191b23['params']['id']}})[_0xbddf('0x2c')](handleEntityNotFound(_0xe7fc64,null))['then'](function(_0xc8fc70){if(_0xc8fc70){_0x559572=_0xc8fc70;_0xf1eb7e['model']=_[_0xbddf('0x3a')](db[_0xbddf('0x6c')][_0xbddf('0x37')]);_0xf1eb7e[_0xbddf('0x3b')]=_[_0xbddf('0x3a')](_0x191b23[_0xbddf('0x3b')]);_0xf1eb7e[_0xbddf('0x3c')]=_[_0xbddf('0x3d')](_0xf1eb7e['model'],_0xf1eb7e[_0xbddf('0x3b')]);_0xeba79d[_0xbddf('0x3f')]=_[_0xbddf('0x3d')](_0xf1eb7e[_0xbddf('0x3e')],qs[_0xbddf('0x40')](_0x191b23[_0xbddf('0x3b')][_0xbddf('0x40')]));_0xeba79d[_0xbddf('0x3f')]=_0xeba79d['attributes'][_0xbddf('0x41')]?_0xeba79d[_0xbddf('0x3f')]:_0xf1eb7e[_0xbddf('0x3e')];_0xeba79d[_0xbddf('0x44')]=qs[_0xbddf('0x45')](_0x191b23[_0xbddf('0x3b')][_0xbddf('0x45')]);_0xeba79d[_0xbddf('0x46')]=qs[_0xbddf('0x3c')](_[_0xbddf('0x47')](_0x191b23[_0xbddf('0x3b')],_0xf1eb7e[_0xbddf('0x3c')]));if(_0x191b23['query'][_0xbddf('0x4a')]){_0xeba79d[_0xbddf('0x46')]=_[_0xbddf('0x48')](_0xeba79d['where'],{'$or':_[_0xbddf('0x35')](_0xeba79d['attributes'],function(_0x5cff6b){var _0x46c59c={};_0x46c59c[_0x5cff6b]={'$like':'%'+_0x191b23['query'][_0xbddf('0x4a')]+'%'};return _0x46c59c;})});}_0xeba79d=_[_0xbddf('0x48')]({},_0xeba79d,_0x191b23['options']);return _0x559572['getTeams'](_0xeba79d);}})['then'](function(_0xc441ce){if(_0xc441ce){_0x1419f4=_0xc441ce[_0xbddf('0x41')];if(!_0x191b23[_0xbddf('0x3b')][_0xbddf('0x42')](_0xbddf('0x43'))){_0xeba79d['limit']=qs[_0xbddf('0x23')](_0x191b23[_0xbddf('0x3b')][_0xbddf('0x23')]);_0xeba79d[_0xbddf('0x24')]=qs[_0xbddf('0x24')](_0x191b23[_0xbddf('0x3b')][_0xbddf('0x24')]);}return _0x559572[_0xbddf('0x6b')](_0xeba79d);}})[_0xbddf('0x2c')](function(_0x2e5278){if(_0x2e5278){return _0x2e5278?{'count':_0x1419f4,'rows':_0x2e5278}:null;}})[_0xbddf('0x2c')](respondWithResult(_0xe7fc64,null))[_0xbddf('0x53')](handleError(_0xe7fc64,null));};exports['addTeams']=function(_0x2a2372,_0x560bd8,_0x58eaab){var _0x934970=_0x2a2372[_0xbddf('0x5b')][_0xbddf('0x6d')];return db[_0xbddf('0x6c')][_0xbddf('0x4e')]({'where':{'id':_0x934970},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xbddf('0x32'),_0xbddf('0x6e'),_0xbddf('0x6f'),_0xbddf('0x70')],'raw':!![]}]})[_0xbddf('0x2c')](function(_0x5bef4c){if(_0x5bef4c){var _0xf318fc=_[_0xbddf('0x71')](_0x5bef4c,function(_0x355339){var _0x1ecb13=_0x355339['get']({'plain':!![]});return _0x1ecb13['Agents'];});return db[_0xbddf('0x36')][_0xbddf('0x52')]({'where':{'id':_0x2a2372[_0xbddf('0x51')]['id']}})[_0xbddf('0x2c')](function(_0x3f9e28){return db[_0xbddf('0x72')][_0xbddf('0x73')](function(_0x1a40b5){return _0x3f9e28[_0xbddf('0x74')](_0x934970,{'transaction':_0x1a40b5})[_0xbddf('0x2c')](function(){return BPromise[_0xbddf('0x75')](_0xf318fc,function(_0x50db4d){return db['UserOpenchannelQueue'][_0xbddf('0x76')]({'where':{'UserId':_0x50db4d['id'],'OpenchannelQueueId':_0x2a2372[_0xbddf('0x51')]['id']},'transaction':_0x1a40b5});});})[_0xbddf('0x2c')](function(){_0xf318fc[_0xbddf('0x77')](function(_0x596991){socket['emit'](_0xbddf('0x78'),{'UserId':_0x596991['id'],'OpenchannelQueueId':_0x3f9e28['id']});});});});});}})['then'](respondWithStatusCode(_0x560bd8,null))[_0xbddf('0x53')](handleError(_0x560bd8,null));};exports['removeTeams']=function(_0x401a12,_0x380573,_0xdb2d67){return db[_0xbddf('0x6c')][_0xbddf('0x4e')]({'where':{'id':_0x401a12['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xbddf('0x62')],'as':_0xbddf('0x79'),'attributes':['id'],'raw':!![]}]})[_0xbddf('0x2c')](handleEntityNotFound(_0x380573,null))[_0xbddf('0x2c')](function(_0x43ca6){var _0x104597=_['map'](_0x43ca6,'id');var _0x3d4bc8=[];var _0x5173aa=[];var _0x2b39fa=squel[_0xbddf('0x7a')]();_0x2b39fa[_0xbddf('0x7b')](_0xbddf('0x7c'))['from']('team_has_openchannel_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbddf('0x46')]('OpenchannelQueueId\x20=\x20?',_0x401a12[_0xbddf('0x51')]['id']);for(var _0x59c3a3=0x0;_0x59c3a3<_0x43ca6[_0xbddf('0x41')];_0x59c3a3+=0x1){let _0x33e3dc=_0x43ca6[_0x59c3a3];for(var _0x74fa6=0x0;_0x74fa6<_0x33e3dc[_0xbddf('0x79')][_0xbddf('0x41')];_0x74fa6+=0x1){let _0x25d257=_0x33e3dc[_0xbddf('0x79')][_0x74fa6];var _0x329692=_0x2b39fa[_0xbddf('0x7d')]();_0x329692[_0xbddf('0x46')](_0xbddf('0x7e'),_0x25d257['id']);_0x5173aa[_0xbddf('0x7f')](db[_0xbddf('0x72')][_0xbddf('0x3b')](_0x329692[_0xbddf('0x80')](),{'type':db[_0xbddf('0x72')][_0xbddf('0x81')][_0xbddf('0x82')]})[_0xbddf('0x2c')](function(_0x531ff2){if(_0x531ff2['length']===0x1){return _0x25d257['id'];}else{var _0x2bf993=_[_0xbddf('0x83')](_[_0xbddf('0x35')](_0x531ff2,_0xbddf('0x84')),function(_0x40d1d4){return _[_0xbddf('0x85')](_0x104597,_0x40d1d4);});if(_0x2bf993){return _0x25d257['id'];}}}));}}return BPromise[_0xbddf('0x86')](_0x5173aa)['then'](function(_0x2ee63b){_0x3d4bc8=_(_0x3d4bc8)[_0xbddf('0x87')](_0x2ee63b)[_0xbddf('0x88')]()[_0xbddf('0x89')]();return db[_0xbddf('0x36')][_0xbddf('0x52')]({'where':{'id':_0x401a12[_0xbddf('0x51')]['id']}})[_0xbddf('0x2c')](function(_0x4b18f2){return db[_0xbddf('0x72')][_0xbddf('0x73')](function(_0x342783){return _0x4b18f2[_0xbddf('0x8a')](_0x401a12[_0xbddf('0x3b')]['ids'],{'transaction':_0x342783})['then'](function(){if(!_[_0xbddf('0x8b')](_0x3d4bc8)){return _0x4b18f2[_0xbddf('0x8c')](_0x3d4bc8,{'transaction':_0x342783});}})['then'](function(){_0x3d4bc8[_0xbddf('0x77')](function(_0x56593f){socket[_0xbddf('0x8d')](_0xbddf('0x8e'),{'UserId':_0x56593f,'OpenchannelQueueId':_0x4b18f2['id']});});});});});});})[_0xbddf('0x2c')](respondWithStatusCode(_0x380573,null))['catch'](handleError(_0x380573,null));};exports[_0xbddf('0x8f')]=function(_0x14d45f,_0x42ade3,_0x19c99e){return db['OpenchannelQueue']['find']({'where':{'id':_0x14d45f[_0xbddf('0x51')]['id']}})['then'](handleEntityNotFound(_0x42ade3,null))['then'](function(_0x32136a){if(_0x32136a){return _0x32136a[_0xbddf('0x8f')](_0x14d45f[_0xbddf('0x5b')][_0xbddf('0x6d')],_[_0xbddf('0x90')](_0x14d45f['body'],['ids','id'])||{})[_0xbddf('0x91')](function(_0x5c3b08){for(var _0x52b05a=0x0;_0x52b05a<_0x14d45f['body'][_0xbddf('0x6d')][_0xbddf('0x41')];_0x52b05a+=0x1){socket['emit'](_0xbddf('0x78'),{'UserId':Number(_0x14d45f[_0xbddf('0x5b')][_0xbddf('0x6d')][_0x52b05a]),'OpenchannelQueueId':Number(_0x14d45f[_0xbddf('0x51')]['id'])});}return _0x5c3b08;});}})[_0xbddf('0x2c')](respondWithResult(_0x42ade3,null))[_0xbddf('0x53')](handleError(_0x42ade3,null));};exports[_0xbddf('0x8c')]=function(_0x33c0e7,_0x18f3da,_0x3aad14){return db[_0xbddf('0x36')]['find']({'where':{'id':_0x33c0e7[_0xbddf('0x51')]['id']}})[_0xbddf('0x2c')](handleEntityNotFound(_0x18f3da,null))[_0xbddf('0x2c')](function(_0x182c5d){if(_0x182c5d){return _0x182c5d['removeAgents'](_0x33c0e7[_0xbddf('0x3b')][_0xbddf('0x6d')])[_0xbddf('0x2c')](function(){if(_[_0xbddf('0x92')](_0x33c0e7[_0xbddf('0x3b')][_0xbddf('0x6d')])){for(var _0x5cb7d4=0x0;_0x5cb7d4<_0x33c0e7[_0xbddf('0x3b')][_0xbddf('0x6d')]['length'];_0x5cb7d4+=0x1){socket['emit'](_0xbddf('0x8e'),{'UserId':Number(_0x33c0e7['query'][_0xbddf('0x6d')][_0x5cb7d4]),'OpenchannelQueueId':Number(_0x33c0e7[_0xbddf('0x51')]['id'])});}}else{socket[_0xbddf('0x8d')](_0xbddf('0x8e'),{'UserId':Number(_0x33c0e7[_0xbddf('0x3b')][_0xbddf('0x6d')]),'OpenchannelQueueId':Number(_0x33c0e7[_0xbddf('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x18f3da,null))['catch'](handleError(_0x18f3da,null));};exports[_0xbddf('0x93')]=function(_0x1738cc,_0x55fd9b,_0x188866){var _0x48aa65={};var _0x25be3f={};var _0x1c28f5;var _0x464cd0;return db[_0xbddf('0x36')][_0xbddf('0x5e')]({'where':{'id':_0x1738cc[_0xbddf('0x51')]['id']}})[_0xbddf('0x2c')](handleEntityNotFound(_0x55fd9b,null))['then'](function(_0x5958ce){if(_0x5958ce){_0x1c28f5=_0x5958ce;_0x25be3f['model']=_[_0xbddf('0x3a')](db[_0xbddf('0x62')]['rawAttributes']);_0x25be3f[_0xbddf('0x3b')]=_['keys'](_0x1738cc[_0xbddf('0x3b')]);_0x25be3f[_0xbddf('0x3c')]=_[_0xbddf('0x3d')](_0x25be3f[_0xbddf('0x3e')],_0x25be3f[_0xbddf('0x3b')]);_0x48aa65[_0xbddf('0x3f')]=_['intersection'](_0x25be3f[_0xbddf('0x3e')],qs[_0xbddf('0x40')](_0x1738cc['query'][_0xbddf('0x40')]));_0x48aa65[_0xbddf('0x3f')]=_0x48aa65['attributes'][_0xbddf('0x41')]?_0x48aa65[_0xbddf('0x3f')]:_0x25be3f[_0xbddf('0x3e')];_0x48aa65[_0xbddf('0x44')]=qs[_0xbddf('0x45')](_0x1738cc[_0xbddf('0x3b')][_0xbddf('0x45')]);_0x48aa65[_0xbddf('0x46')]=qs[_0xbddf('0x3c')](_[_0xbddf('0x47')](_0x1738cc[_0xbddf('0x3b')],_0x25be3f[_0xbddf('0x3c')]));if(_0x1738cc[_0xbddf('0x3b')]['filter']){_0x48aa65[_0xbddf('0x46')]=_[_0xbddf('0x48')](_0x48aa65['where'],{'$or':_[_0xbddf('0x35')](_0x48aa65['attributes'],function(_0x2fd023){var _0xc6f534={};_0xc6f534[_0x2fd023]={'$like':'%'+_0x1738cc['query'][_0xbddf('0x4a')]+'%'};return _0xc6f534;})});}_0x48aa65=_[_0xbddf('0x48')]({},_0x48aa65,_0x1738cc['options']);return _0x1c28f5[_0xbddf('0x93')](_0x48aa65);}})[_0xbddf('0x2c')](function(_0x1ab01c){if(_0x1ab01c){_0x464cd0=_0x1ab01c[_0xbddf('0x41')];if(!_0x1738cc[_0xbddf('0x3b')][_0xbddf('0x42')](_0xbddf('0x43'))){_0x48aa65[_0xbddf('0x23')]=qs[_0xbddf('0x23')](_0x1738cc[_0xbddf('0x3b')][_0xbddf('0x23')]);_0x48aa65['offset']=qs[_0xbddf('0x24')](_0x1738cc[_0xbddf('0x3b')]['offset']);}return _0x1c28f5[_0xbddf('0x93')](_0x48aa65);}})[_0xbddf('0x2c')](function(_0x5d3ed8){if(_0x5d3ed8){return _0x5d3ed8?{'count':_0x464cd0,'rows':_0x5d3ed8}:null;}})[_0xbddf('0x2c')](respondWithResult(_0x55fd9b,null))[_0xbddf('0x53')](handleError(_0x55fd9b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1ea4598..90d144a 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 _0xfbd0=['hook','exports','../../mysqldb','OpenchannelQueue','update','remove','emit','hasOwnProperty'];(function(_0x4cc86c,_0x23bf4a){var _0x2cc3f0=function(_0x285f36){while(--_0x285f36){_0x4cc86c['push'](_0x4cc86c['shift']());}};_0x2cc3f0(++_0x23bf4a);}(_0xfbd0,0x11a));var _0x0fbd=function(_0x1fe7e4,_0x5d39a4){_0x1fe7e4=_0x1fe7e4-0x0;var _0x4b3e54=_0xfbd0[_0x1fe7e4];return _0x4b3e54;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x0fbd('0x0'))['db'][_0x0fbd('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0fbd('0x2'),'afterDestroy':_0x0fbd('0x3')};function emitEvent(_0xd994c3){return function(_0xcd15bf,_0x2d8f92,_0x503535){OpenchannelQueueEvents[_0x0fbd('0x4')](_0xd994c3+':'+_0xcd15bf['id'],_0xcd15bf);OpenchannelQueueEvents['emit'](_0xd994c3,_0xcd15bf);_0x503535(null);};}for(var e in events){if(events[_0x0fbd('0x5')](e)){var event=events[e];OpenchannelQueue[_0x0fbd('0x6')](e,emitEvent(event));}}module[_0x0fbd('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xc6a4=['update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelQueue','save'];(function(_0x41077f,_0x56642e){var _0x133d40=function(_0x34dd0c){while(--_0x34dd0c){_0x41077f['push'](_0x41077f['shift']());}};_0x133d40(++_0x56642e);}(_0xc6a4,0x69));var _0x4c6a=function(_0x2504cb,_0x3a6482){_0x2504cb=_0x2504cb-0x0;var _0x171ca3=_0xc6a4[_0x2504cb];return _0x171ca3;};'use strict';var EventEmitter=require(_0x4c6a('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x4c6a('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c6a('0x2'),'afterUpdate':_0x4c6a('0x3'),'afterDestroy':_0x4c6a('0x4')};function emitEvent(_0x280fcd){return function(_0x3fbf17,_0x5662f7,_0x1da446){OpenchannelQueueEvents[_0x4c6a('0x5')](_0x280fcd+':'+_0x3fbf17['id'],_0x3fbf17);OpenchannelQueueEvents[_0x4c6a('0x5')](_0x280fcd,_0x3fbf17);_0x1da446(null);};}for(var e in events){if(events[_0x4c6a('0x6')](e)){var event=events[e];OpenchannelQueue[_0x4c6a('0x7')](e,emitEvent(event));}}module[_0x4c6a('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 719c7a7..c582336 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 _0x686c=['./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x686c,0x68));var _0xc686=function(_0x67108e,_0x59a953){_0x67108e=_0x67108e-0x0;var _0x619071=_0x686c[_0x67108e];return _0x619071;};'use strict';var _=require(_0xc686('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc686('0x1'));var rp=require(_0xc686('0x2'));var fs=require('fs');var path=require(_0xc686('0x3'));var rimraf=require(_0xc686('0x4'));var config=require(_0xc686('0x5'));var attributes=require(_0xc686('0x6'));module[_0xc686('0x7')]=function(_0x15fed7,_0x1d1122){return _0x15fed7['define'](_0xc686('0x8'),attributes,{'tableName':_0xc686('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54f7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','api'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x54f7,0x177));var _0x754f=function(_0x23359c,_0x4d340a){_0x23359c=_0x23359c-0x0;var _0x1b8522=_0x54f7[_0x23359c];return _0x1b8522;};'use strict';var _=require('lodash');var util=require(_0x754f('0x0'));var logger=require(_0x754f('0x1'))(_0x754f('0x2'));var moment=require(_0x754f('0x3'));var BPromise=require(_0x754f('0x4'));var rp=require(_0x754f('0x5'));var fs=require('fs');var path=require(_0x754f('0x6'));var rimraf=require(_0x754f('0x7'));var config=require(_0x754f('0x8'));var attributes=require(_0x754f('0x9'));module[_0x754f('0xa')]=function(_0x4c1d0a,_0x58ab06){return _0x4c1d0a[_0x754f('0xb')](_0x754f('0xc'),attributes,{'tableName':_0x754f('0xd'),'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 1b5e927..fa30802 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 _0x347f=['error','code','message','request\x20sent','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','attributes','limit','include','map','model','ShowOpenchannelQueue','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','stringify'];(function(_0x17045c,_0x470ebe){var _0x844ac5=function(_0x1ce250){while(--_0x1ce250){_0x17045c['push'](_0x17045c['shift']());}};_0x844ac5(++_0x470ebe);}(_0x347f,0x167));var _0xf347=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x347f[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xf347('0x0'));var util=require(_0xf347('0x1'));var moment=require(_0xf347('0x2'));var BPromise=require(_0xf347('0x3'));var rs=require(_0xf347('0x4'));var fs=require('fs');var Redis=require(_0xf347('0x5'));var db=require(_0xf347('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf347('0x7'));var config=require('../../config/environment');var jayson=require(_0xf347('0x8'));var client=jayson[_0xf347('0x9')][_0xf347('0xa')]({'port':0x232a});config[_0xf347('0xb')]=_[_0xf347('0xc')](config[_0xf347('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf347('0xd'))(new Redis(config[_0xf347('0xb')]));require(_0xf347('0xe'))['register'](socket);function respondWithRpcPromise(_0x26c7c5,_0x1ca1dd,_0x491ef6){return new BPromise(function(_0x16314f,_0x553f8e){return client[_0xf347('0xf')](_0x26c7c5,_0x491ef6)[_0xf347('0x10')](function(_0x23417a){logger[_0xf347('0x11')](_0xf347('0x12'),_0x1ca1dd,'request\x20sent');logger[_0xf347('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1ca1dd,'request\x20sent',JSON[_0xf347('0x14')](_0x23417a));if(_0x23417a[_0xf347('0x15')]){if(_0x23417a[_0xf347('0x15')][_0xf347('0x16')]===0x1f4){logger[_0xf347('0x15')](_0xf347('0x12'),_0x1ca1dd,_0x23417a[_0xf347('0x15')][_0xf347('0x17')]);return _0x553f8e(_0x23417a['error'][_0xf347('0x17')]);}logger[_0xf347('0x15')](_0xf347('0x12'),_0x1ca1dd,_0x23417a['error'][_0xf347('0x17')]);return _0x16314f(_0x23417a[_0xf347('0x15')][_0xf347('0x17')]);}else{logger[_0xf347('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x1ca1dd,_0xf347('0x18'));_0x16314f(_0x23417a[_0xf347('0x19')][_0xf347('0x17')]);}})[_0xf347('0x1a')](function(_0x2b0352){logger[_0xf347('0x15')](_0xf347('0x12'),_0x1ca1dd,_0x2b0352);_0x553f8e(_0x2b0352);});});}exports[_0xf347('0x1b')]=function(_0x59ff55){var _0x33119d=this;return new Promise(function(_0x5c41bc,_0x1e633d){return db[_0xf347('0x1c')][_0xf347('0x1d')]({'raw':_0x59ff55[_0xf347('0x1e')]?_0x59ff55[_0xf347('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x59ff55[_0xf347('0x1e')]?_0x59ff55[_0xf347('0x1e')]['where']||null:null,'attributes':_0x59ff55[_0xf347('0x1e')]?_0x59ff55[_0xf347('0x1e')][_0xf347('0x1f')]||null:null,'limit':_0x59ff55['options']?_0x59ff55[_0xf347('0x1e')][_0xf347('0x20')]||null:null,'include':_0x59ff55['options']?_0x59ff55[_0xf347('0x1e')][_0xf347('0x21')]?_[_0xf347('0x22')](_0x59ff55['options'][_0xf347('0x21')],function(_0x588523){return{'model':db[_0x588523[_0xf347('0x23')]],'as':_0x588523['as'],'attributes':_0x588523[_0xf347('0x1f')],'include':_0x588523[_0xf347('0x21')]?_['map'](_0x588523[_0xf347('0x21')],function(_0x3ecfc0){return{'model':db[_0x3ecfc0[_0xf347('0x23')]],'as':_0x3ecfc0['as'],'attributes':_0x3ecfc0[_0xf347('0x1f')],'include':_0x3ecfc0['include']?_[_0xf347('0x22')](_0x3ecfc0['include'],function(_0x58db78){return{'model':db[_0x58db78[_0xf347('0x23')]],'as':_0x58db78['as'],'attributes':_0x58db78[_0xf347('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24e3b8){logger[_0xf347('0x11')](_0xf347('0x1b'),_0x59ff55);logger[_0xf347('0x13')](_0xf347('0x1b'),_0x59ff55,JSON[_0xf347('0x14')](_0x24e3b8));_0x5c41bc(_0x24e3b8);})[_0xf347('0x1a')](function(_0x1b609d){logger[_0xf347('0x15')](_0xf347('0x1b'),_0x1b609d[_0xf347('0x17')],_0x59ff55);_0x1e633d(_0x33119d[_0xf347('0x15')](0x1f4,_0x1b609d[_0xf347('0x17')]));});});};exports[_0xf347('0x24')]=function(_0x430e85){var _0x39215a=this;return new Promise(function(_0x34c70e,_0x111eaf){return db[_0xf347('0x1c')]['find']({'raw':_0x430e85[_0xf347('0x1e')]?_0x430e85[_0xf347('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x430e85[_0xf347('0x1e')]?_0x430e85[_0xf347('0x1e')][_0xf347('0x25')]||null:null,'attributes':_0x430e85[_0xf347('0x1e')]?_0x430e85['options']['attributes']||null:null,'include':_0x430e85[_0xf347('0x1e')]?_0x430e85[_0xf347('0x1e')]['include']?_['map'](_0x430e85[_0xf347('0x1e')][_0xf347('0x21')],function(_0x1e4711){return{'model':db[_0x1e4711[_0xf347('0x23')]],'as':_0x1e4711['as'],'attributes':_0x1e4711[_0xf347('0x1f')],'include':_0x1e4711[_0xf347('0x21')]?_[_0xf347('0x22')](_0x1e4711[_0xf347('0x21')],function(_0x54cca8){return{'model':db[_0x54cca8[_0xf347('0x23')]],'as':_0x54cca8['as'],'attributes':_0x54cca8['attributes'],'include':_0x54cca8[_0xf347('0x21')]?_['map'](_0x54cca8[_0xf347('0x21')],function(_0x26bb3d){return{'model':db[_0x26bb3d[_0xf347('0x23')]],'as':_0x26bb3d['as'],'attributes':_0x26bb3d['attributes']};}):[]};}):[]};}):[]:[]})[_0xf347('0x10')](function(_0xb02c07){logger[_0xf347('0x11')](_0xf347('0x24'),_0x430e85);logger[_0xf347('0x13')]('ShowOpenchannelQueue',_0x430e85,JSON[_0xf347('0x14')](_0xb02c07));_0x34c70e(_0xb02c07);})['catch'](function(_0x452ece){logger[_0xf347('0x15')](_0xf347('0x24'),_0x452ece[_0xf347('0x17')],_0x430e85);_0x111eaf(_0x39215a['error'](0x1f4,_0x452ece[_0xf347('0x17')]));});});}; \ No newline at end of file +var _0x1cff=['localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowOpenchannelQueue','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x58ffed,_0x5221da){var _0x3cf0a6=function(_0x49252a){while(--_0x49252a){_0x58ffed['push'](_0x58ffed['shift']());}};_0x3cf0a6(++_0x5221da);}(_0x1cff,0xef));var _0xf1cf=function(_0x1d7949,_0x23d727){_0x1d7949=_0x1d7949-0x0;var _0x279e40=_0x1cff[_0x1d7949];return _0x279e40;};'use strict';var _=require(_0xf1cf('0x0'));var util=require(_0xf1cf('0x1'));var moment=require(_0xf1cf('0x2'));var BPromise=require(_0xf1cf('0x3'));var rs=require(_0xf1cf('0x4'));var fs=require('fs');var Redis=require(_0xf1cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1cf('0x6'));var logger=require(_0xf1cf('0x7'))(_0xf1cf('0x8'));var config=require(_0xf1cf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf1cf('0xa')][_0xf1cf('0xb')]({'port':0x232a});config[_0xf1cf('0xc')]=_['defaults'](config[_0xf1cf('0xc')],{'host':_0xf1cf('0xd'),'port':0x18eb});var socket=require(_0xf1cf('0xe'))(new Redis(config['redis']));require(_0xf1cf('0xf'))[_0xf1cf('0x10')](socket);function respondWithRpcPromise(_0x2e1c9b,_0x176477,_0x4d198e){return new BPromise(function(_0x3a2f02,_0x170445){return client[_0xf1cf('0x11')](_0x2e1c9b,_0x4d198e)[_0xf1cf('0x12')](function(_0x4fd1cb){logger[_0xf1cf('0x13')](_0xf1cf('0x14'),_0x176477,'request\x20sent');logger[_0xf1cf('0x15')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x176477,_0xf1cf('0x16'),JSON['stringify'](_0x4fd1cb));if(_0x4fd1cb[_0xf1cf('0x17')]){if(_0x4fd1cb[_0xf1cf('0x17')][_0xf1cf('0x18')]===0x1f4){logger[_0xf1cf('0x17')](_0xf1cf('0x14'),_0x176477,_0x4fd1cb['error'][_0xf1cf('0x19')]);return _0x170445(_0x4fd1cb[_0xf1cf('0x17')][_0xf1cf('0x19')]);}logger['error'](_0xf1cf('0x14'),_0x176477,_0x4fd1cb[_0xf1cf('0x17')][_0xf1cf('0x19')]);return _0x3a2f02(_0x4fd1cb[_0xf1cf('0x17')][_0xf1cf('0x19')]);}else{logger[_0xf1cf('0x13')](_0xf1cf('0x14'),_0x176477,'request\x20sent');_0x3a2f02(_0x4fd1cb[_0xf1cf('0x1a')][_0xf1cf('0x19')]);}})[_0xf1cf('0x1b')](function(_0x464eb0){logger[_0xf1cf('0x17')](_0xf1cf('0x14'),_0x176477,_0x464eb0);_0x170445(_0x464eb0);});});}exports[_0xf1cf('0x1c')]=function(_0x17006c){var _0x1ae08f=this;return new Promise(function(_0x1906b3,_0x38613b){return db[_0xf1cf('0x1d')][_0xf1cf('0x1e')]({'raw':_0x17006c['options']?_0x17006c[_0xf1cf('0x1f')][_0xf1cf('0x20')]===undefined?!![]:![]:!![],'where':_0x17006c[_0xf1cf('0x1f')]?_0x17006c[_0xf1cf('0x1f')][_0xf1cf('0x21')]||null:null,'attributes':_0x17006c[_0xf1cf('0x1f')]?_0x17006c[_0xf1cf('0x1f')][_0xf1cf('0x22')]||null:null,'limit':_0x17006c[_0xf1cf('0x1f')]?_0x17006c['options'][_0xf1cf('0x23')]||null:null,'include':_0x17006c[_0xf1cf('0x1f')]?_0x17006c[_0xf1cf('0x1f')][_0xf1cf('0x24')]?_['map'](_0x17006c[_0xf1cf('0x1f')][_0xf1cf('0x24')],function(_0x3383ac){return{'model':db[_0x3383ac[_0xf1cf('0x25')]],'as':_0x3383ac['as'],'attributes':_0x3383ac['attributes'],'include':_0x3383ac['include']?_[_0xf1cf('0x26')](_0x3383ac['include'],function(_0x137dca){return{'model':db[_0x137dca['model']],'as':_0x137dca['as'],'attributes':_0x137dca[_0xf1cf('0x22')],'include':_0x137dca[_0xf1cf('0x24')]?_[_0xf1cf('0x26')](_0x137dca[_0xf1cf('0x24')],function(_0x9f5d68){return{'model':db[_0x9f5d68[_0xf1cf('0x25')]],'as':_0x9f5d68['as'],'attributes':_0x9f5d68[_0xf1cf('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xeaa15e){logger['info'](_0xf1cf('0x1c'),_0x17006c);logger[_0xf1cf('0x15')](_0xf1cf('0x1c'),_0x17006c,JSON['stringify'](_0xeaa15e));_0x1906b3(_0xeaa15e);})[_0xf1cf('0x1b')](function(_0x644470){logger['error']('GetOpenchannelQueue',_0x644470[_0xf1cf('0x19')],_0x17006c);_0x38613b(_0x1ae08f[_0xf1cf('0x17')](0x1f4,_0x644470[_0xf1cf('0x19')]));});});};exports[_0xf1cf('0x27')]=function(_0x50dc8c){var _0x555505=this;return new Promise(function(_0x32b808,_0x4d016f){return db[_0xf1cf('0x1d')][_0xf1cf('0x28')]({'raw':_0x50dc8c['options']?_0x50dc8c[_0xf1cf('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x50dc8c['options']?_0x50dc8c['options'][_0xf1cf('0x21')]||null:null,'attributes':_0x50dc8c[_0xf1cf('0x1f')]?_0x50dc8c[_0xf1cf('0x1f')][_0xf1cf('0x22')]||null:null,'include':_0x50dc8c[_0xf1cf('0x1f')]?_0x50dc8c['options'][_0xf1cf('0x24')]?_[_0xf1cf('0x26')](_0x50dc8c[_0xf1cf('0x1f')][_0xf1cf('0x24')],function(_0x58b3e1){return{'model':db[_0x58b3e1[_0xf1cf('0x25')]],'as':_0x58b3e1['as'],'attributes':_0x58b3e1['attributes'],'include':_0x58b3e1[_0xf1cf('0x24')]?_['map'](_0x58b3e1['include'],function(_0x34a8f8){return{'model':db[_0x34a8f8[_0xf1cf('0x25')]],'as':_0x34a8f8['as'],'attributes':_0x34a8f8[_0xf1cf('0x22')],'include':_0x34a8f8[_0xf1cf('0x24')]?_['map'](_0x34a8f8[_0xf1cf('0x24')],function(_0x158cfe){return{'model':db[_0x158cfe[_0xf1cf('0x25')]],'as':_0x158cfe['as'],'attributes':_0x158cfe[_0xf1cf('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf1cf('0x12')](function(_0x15fc42){logger[_0xf1cf('0x13')](_0xf1cf('0x27'),_0x50dc8c);logger[_0xf1cf('0x15')]('ShowOpenchannelQueue',_0x50dc8c,JSON[_0xf1cf('0x29')](_0x15fc42));_0x32b808(_0x15fc42);})[_0xf1cf('0x1b')](function(_0x32fe52){logger[_0xf1cf('0x17')](_0xf1cf('0x27'),_0x32fe52[_0xf1cf('0x19')],_0x50dc8c);_0x4d016f(_0x555505['error'](0x1f4,_0x32fe52[_0xf1cf('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 32190e7..36939e2 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 _0x8032=['openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener','register','length'];(function(_0x1e3f97,_0xf044fa){var _0x209dff=function(_0x10062a){while(--_0x10062a){_0x1e3f97['push'](_0x1e3f97['shift']());}};_0x209dff(++_0xf044fa);}(_0x8032,0xd9));var _0x2803=function(_0x1744e1,_0x1d5cd9){_0x1744e1=_0x1744e1-0x0;var _0x5166a0=_0x8032[_0x1744e1];return _0x5166a0;};'use strict';var OpenchannelQueueEvents=require(_0x2803('0x0'));var events=[_0x2803('0x1'),_0x2803('0x2'),'update'];function createListener(_0x4db278,_0xf004f7){return function(_0x4503b2){_0xf004f7[_0x2803('0x3')](_0x4db278,_0x4503b2);};}function removeListener(_0x4511f0,_0x59d7b0){return function(){OpenchannelQueueEvents[_0x2803('0x4')](_0x4511f0,_0x59d7b0);};}exports[_0x2803('0x5')]=function(_0x2bd5b3){for(var _0x5518af=0x0,_0x152b0a=events[_0x2803('0x6')];_0x5518af<_0x152b0a;_0x5518af++){var _0x597a1d=events[_0x5518af];var _0x1b7ee5=createListener(_0x2803('0x7')+_0x597a1d,_0x2bd5b3);OpenchannelQueueEvents['on'](_0x597a1d,_0x1b7ee5);}}; \ No newline at end of file +var _0x5802=['update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x4c02ad,_0x3fcdc1){var _0xe6de92=function(_0x4ba77d){while(--_0x4ba77d){_0x4c02ad['push'](_0x4c02ad['shift']());}};_0xe6de92(++_0x3fcdc1);}(_0x5802,0x11d));var _0x2580=function(_0x239904,_0x4b11e2){_0x239904=_0x239904-0x0;var _0x259609=_0x5802[_0x239904];return _0x259609;};'use strict';var OpenchannelQueueEvents=require(_0x2580('0x0'));var events=[_0x2580('0x1'),_0x2580('0x2'),_0x2580('0x3')];function createListener(_0x4c18a5,_0x4f20e3){return function(_0x28c386){_0x4f20e3[_0x2580('0x4')](_0x4c18a5,_0x28c386);};}function removeListener(_0x1b6609,_0x56d566){return function(){OpenchannelQueueEvents[_0x2580('0x5')](_0x1b6609,_0x56d566);};}exports[_0x2580('0x6')]=function(_0x4f9a94){for(var _0x2fb8bf=0x0,_0x3a652b=events[_0x2580('0x7')];_0x2fb8bf<_0x3a652b;_0x2fb8bf++){var _0x4935c6=events[_0x2fb8bf];var _0x40084f=createListener(_0x2580('0x8')+_0x4935c6,_0x4f9a94);OpenchannelQueueEvents['on'](_0x4935c6,_0x40084f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 35ecce3..6fd9019 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 _0xa262=['../../config/environment','get','index','/describe','isAuthenticated','describe','show','create','update','delete','/:id','destroy','multer','connect-timeout','express','Router'];(function(_0x5b5564,_0x280e1e){var _0x1c8bc6=function(_0x44860b){while(--_0x44860b){_0x5b5564['push'](_0x5b5564['shift']());}};_0x1c8bc6(++_0x280e1e);}(_0xa262,0x6c));var _0x2a26=function(_0x11956a,_0x121b94){_0x11956a=_0x11956a-0x0;var _0x2ba74c=_0xa262[_0x11956a];return _0x2ba74c;};'use strict';var multer=require(_0x2a26('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2a26('0x1'));var express=require(_0x2a26('0x2'));var router=express[_0x2a26('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2a26('0x4'));var controller=require('./openchannelQueueReport.controller');router[_0x2a26('0x5')]('/',auth['isAuthenticated'](),controller[_0x2a26('0x6')]);router[_0x2a26('0x5')](_0x2a26('0x7'),auth[_0x2a26('0x8')](),controller[_0x2a26('0x9')]);router[_0x2a26('0x5')]('/:id',auth[_0x2a26('0x8')](),controller[_0x2a26('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a26('0xb')]);router['put']('/:id',auth[_0x2a26('0x8')](),controller[_0x2a26('0xc')]);router[_0x2a26('0xd')](_0x2a26('0xe'),auth['isAuthenticated'](),controller[_0x2a26('0xf')]);module['exports']=router; \ No newline at end of file +var _0x46b1=['put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x5e6644,_0x2b2995){var _0x78f699=function(_0x4aa8fd){while(--_0x4aa8fd){_0x5e6644['push'](_0x5e6644['shift']());}};_0x78f699(++_0x2b2995);}(_0x46b1,0x143));var _0x146b=function(_0xe7d24e,_0x235022){_0xe7d24e=_0xe7d24e-0x0;var _0x42c6e3=_0x46b1[_0xe7d24e];return _0x42c6e3;};'use strict';var multer=require(_0x146b('0x0'));var util=require(_0x146b('0x1'));var path=require(_0x146b('0x2'));var timeout=require('connect-timeout');var express=require(_0x146b('0x3'));var router=express[_0x146b('0x4')]();var fs_extra=require(_0x146b('0x5'));var auth=require(_0x146b('0x6'));var interaction=require(_0x146b('0x7'));var config=require(_0x146b('0x8'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x146b('0x9')](),controller[_0x146b('0xa')]);router['get'](_0x146b('0xb'),auth['isAuthenticated'](),controller[_0x146b('0xc')]);router[_0x146b('0xd')](_0x146b('0xe'),auth[_0x146b('0x9')](),controller[_0x146b('0xf')]);router[_0x146b('0x10')]('/',auth[_0x146b('0x9')](),controller['create']);router[_0x146b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x146b('0x12')]);router['delete'](_0x146b('0xe'),auth[_0x146b('0x9')](),controller[_0x146b('0x13')]);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 7946c80..72773fa 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 _0xb840=['DATE','sequelize','exports','STRING'];(function(_0x4025df,_0x5bdc3a){var _0x3caeca=function(_0x394f34){while(--_0x394f34){_0x4025df['push'](_0x4025df['shift']());}};_0x3caeca(++_0x5bdc3a);}(_0xb840,0x16d));var _0x0b84=function(_0x231522,_0x1eebe1){_0x231522=_0x231522-0x0;var _0x1bab34=_0xb840[_0x231522];return _0x1bab34;};'use strict';var moment=require('moment');var Sequelize=require(_0x0b84('0x0'));module[_0x0b84('0x1')]={'uniqueid':{'type':Sequelize[_0x0b84('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0b84('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0b84('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0b84('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2b38=['DATE','moment','sequelize','exports','STRING'];(function(_0x19d3c0,_0x560544){var _0x56e32a=function(_0x423e3e){while(--_0x423e3e){_0x19d3c0['push'](_0x19d3c0['shift']());}};_0x56e32a(++_0x560544);}(_0x2b38,0xdd));var _0x82b3=function(_0x1a67d0,_0x4f2d0b){_0x1a67d0=_0x1a67d0-0x0;var _0x52bf04=_0x2b38[_0x1a67d0];return _0x52bf04;};'use strict';var moment=require(_0x82b3('0x0'));var Sequelize=require(_0x82b3('0x1'));module[_0x82b3('0x2')]={'uniqueid':{'type':Sequelize[_0x82b3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x82b3('0x3')]},'joinAt':{'type':Sequelize[_0x82b3('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x82b3('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b699b26..d14c875 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 _0x9cdf=['where','filters','pick','filter','merge','VIRTUAL','OpenchannelQueueReport','findAll','rows','show','params','rawAttributes','includeAll','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9cdf,0x147));var _0xf9cd=function(_0x212e71,_0x9e62ab){_0x212e71=_0x212e71-0x0;var _0x33faae=_0x9cdf[_0x212e71];return _0x33faae;};'use strict';var emlformat=require(_0xf9cd('0x0'));var rimraf=require(_0xf9cd('0x1'));var zipdir=require(_0xf9cd('0x2'));var jsonpatch=require(_0xf9cd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf9cd('0x4'));var Mustache=require(_0xf9cd('0x5'));var util=require(_0xf9cd('0x6'));var path=require(_0xf9cd('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf9cd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9cd('0x9'));var squel=require(_0xf9cd('0xa'));var crypto=require(_0xf9cd('0xb'));var jsforce=require(_0xf9cd('0xc'));var deskjs=require(_0xf9cd('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf9cd('0xe'));var Papa=require('papaparse');var Redis=require(_0xf9cd('0xf'));var authService=require(_0xf9cd('0x10'));var qs=require(_0xf9cd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9cd('0x12'));var logger=require('../../config/logger')(_0xf9cd('0x13'));var utils=require(_0xf9cd('0x14'));var config=require(_0xf9cd('0x15'));var licenseUtil=require(_0xf9cd('0x16'));var db=require(_0xf9cd('0x17'))['db'];function respondWithStatusCode(_0x25a3a9,_0xdf0526){_0xdf0526=_0xdf0526||0xcc;return function(_0x1eca90){if(_0x1eca90){return _0x25a3a9[_0xf9cd('0x18')](_0xdf0526);}return _0x25a3a9['status'](_0xdf0526)['end']();};}function respondWithResult(_0x534f5c,_0x1dff62){_0x1dff62=_0x1dff62||0xc8;return function(_0x5f910d){if(_0x5f910d){return _0x534f5c[_0xf9cd('0x19')](_0x1dff62)['json'](_0x5f910d);}};}function respondWithFilteredResult(_0x34e327,_0x3298ec){return function(_0xe7ed12){if(_0xe7ed12){var _0x2a959e=typeof _0x3298ec[_0xf9cd('0x1a')]===_0xf9cd('0x1b')&&typeof _0x3298ec[_0xf9cd('0x1c')]==='undefined';var _0x11faef=_0xe7ed12[_0xf9cd('0x1d')];var _0x4970e2=_0x2a959e?0x0:_0x3298ec[_0xf9cd('0x1a')];var _0x42d86b=_0x2a959e?_0xe7ed12[_0xf9cd('0x1d')]:_0x3298ec[_0xf9cd('0x1a')]+_0x3298ec[_0xf9cd('0x1c')];var _0x599d84;if(_0x42d86b>=_0x11faef){_0x42d86b=_0x11faef;_0x599d84=0xc8;}else{_0x599d84=0xce;}_0x34e327[_0xf9cd('0x19')](_0x599d84);return _0x34e327[_0xf9cd('0x1e')](_0xf9cd('0x1f'),_0x4970e2+'-'+_0x42d86b+'/'+_0x11faef)[_0xf9cd('0x20')](_0xe7ed12);}return null;};}function patchUpdates(_0x5e41d0){return function(_0x372e4b){try{jsonpatch[_0xf9cd('0x21')](_0x372e4b,_0x5e41d0,!![]);}catch(_0x1fee7e){return BPromise[_0xf9cd('0x22')](_0x1fee7e);}return _0x372e4b[_0xf9cd('0x23')]();};}function saveUpdates(_0x7ccfd6,_0x564fb6){return function(_0x3c73fb){if(_0x3c73fb){return _0x3c73fb[_0xf9cd('0x24')](_0x7ccfd6)[_0xf9cd('0x25')](function(_0x268753){return _0x268753;});}return null;};}function removeEntity(_0x50e21b,_0x3b7c6d){return function(_0x299cc5){if(_0x299cc5){return _0x299cc5[_0xf9cd('0x26')]()[_0xf9cd('0x25')](function(){_0x50e21b['status'](0xcc)[_0xf9cd('0x27')]();});}};}function handleEntityNotFound(_0x187305,_0x5d6b3c){return function(_0x651ebd){if(!_0x651ebd){_0x187305['sendStatus'](0x194);}return _0x651ebd;};}function handleError(_0x56410e,_0x337485){_0x337485=_0x337485||0x1f4;return function(_0x27bba5){logger['error'](_0x27bba5['stack']);if(_0x27bba5[_0xf9cd('0x28')]){delete _0x27bba5[_0xf9cd('0x28')];}_0x56410e[_0xf9cd('0x19')](_0x337485)[_0xf9cd('0x29')](_0x27bba5);};}exports[_0xf9cd('0x2a')]=function(_0x24c446,_0x3e043d){var _0x158622={},_0x20cc4b={},_0x4db12b={'count':0x0,'rows':[]};var _0x270581=_[_0xf9cd('0x2b')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x2722ce){return{'name':_0x2722ce[_0xf9cd('0x2c')],'type':_0x2722ce[_0xf9cd('0x2d')][_0xf9cd('0x2e')]};});_0x20cc4b[_0xf9cd('0x2f')]=_[_0xf9cd('0x2b')](_0x270581,_0xf9cd('0x28'));_0x20cc4b[_0xf9cd('0x30')]=_[_0xf9cd('0x31')](_0x24c446[_0xf9cd('0x30')]);_0x20cc4b['filters']=_[_0xf9cd('0x32')](_0x20cc4b[_0xf9cd('0x2f')],_0x20cc4b[_0xf9cd('0x30')]);_0x158622[_0xf9cd('0x33')]=_[_0xf9cd('0x32')](_0x20cc4b[_0xf9cd('0x2f')],qs[_0xf9cd('0x34')](_0x24c446['query']['fields']));_0x158622[_0xf9cd('0x33')]=_0x158622['attributes'][_0xf9cd('0x35')]?_0x158622[_0xf9cd('0x33')]:_0x20cc4b[_0xf9cd('0x2f')];if(!_0x24c446['query'][_0xf9cd('0x36')](_0xf9cd('0x37'))){_0x158622[_0xf9cd('0x1c')]=qs['limit'](_0x24c446[_0xf9cd('0x30')][_0xf9cd('0x1c')]);_0x158622[_0xf9cd('0x1a')]=qs['offset'](_0x24c446[_0xf9cd('0x30')][_0xf9cd('0x1a')]);}_0x158622[_0xf9cd('0x38')]=qs[_0xf9cd('0x39')](_0x24c446[_0xf9cd('0x30')][_0xf9cd('0x39')]);_0x158622[_0xf9cd('0x3a')]=qs[_0xf9cd('0x3b')](_[_0xf9cd('0x3c')](_0x24c446[_0xf9cd('0x30')],_0x20cc4b[_0xf9cd('0x3b')]),_0x270581);if(_0x24c446[_0xf9cd('0x30')][_0xf9cd('0x3d')]){_0x158622[_0xf9cd('0x3a')]=_[_0xf9cd('0x3e')](_0x158622[_0xf9cd('0x3a')],{'$or':_[_0xf9cd('0x2b')](_0x270581,function(_0x4efa1c){if(_0x4efa1c[_0xf9cd('0x2d')]!==_0xf9cd('0x3f')){var _0x4b4f06={};_0x4b4f06[_0x4efa1c[_0xf9cd('0x28')]]={'$like':'%'+_0x24c446[_0xf9cd('0x30')][_0xf9cd('0x3d')]+'%'};return _0x4b4f06;}})});}_0x158622=_[_0xf9cd('0x3e')]({},_0x158622,_0x24c446['options']);var _0x290621={'where':_0x158622[_0xf9cd('0x3a')]};return db['OpenchannelQueueReport']['count'](_0x290621)[_0xf9cd('0x25')](function(_0x50857c){_0x4db12b['count']=_0x50857c;if(_0x24c446['query']['includeAll']){_0x158622['include']=[{'all':!![]}];}return db[_0xf9cd('0x40')][_0xf9cd('0x41')](_0x158622);})[_0xf9cd('0x25')](function(_0x3e3571){_0x4db12b[_0xf9cd('0x42')]=_0x3e3571;return _0x4db12b;})['then'](respondWithFilteredResult(_0x3e043d,_0x158622))['catch'](handleError(_0x3e043d,null));};exports[_0xf9cd('0x43')]=function(_0x875388,_0x1baeb8){var _0x28e838={'raw':!![],'where':{'id':_0x875388[_0xf9cd('0x44')]['id']}},_0x5cb830={};_0x5cb830[_0xf9cd('0x2f')]=_[_0xf9cd('0x31')](db[_0xf9cd('0x40')][_0xf9cd('0x45')]);_0x5cb830[_0xf9cd('0x30')]=_['keys'](_0x875388['query']);_0x5cb830[_0xf9cd('0x3b')]=_[_0xf9cd('0x32')](_0x5cb830[_0xf9cd('0x2f')],_0x5cb830[_0xf9cd('0x30')]);_0x28e838[_0xf9cd('0x33')]=_[_0xf9cd('0x32')](_0x5cb830['model'],qs['fields'](_0x875388[_0xf9cd('0x30')]['fields']));_0x28e838[_0xf9cd('0x33')]=_0x28e838[_0xf9cd('0x33')]['length']?_0x28e838['attributes']:_0x5cb830[_0xf9cd('0x2f')];if(_0x875388[_0xf9cd('0x30')][_0xf9cd('0x46')]){_0x28e838['include']=[{'all':!![]}];}_0x28e838=_['merge']({},_0x28e838,_0x875388[_0xf9cd('0x47')]);return db['OpenchannelQueueReport'][_0xf9cd('0x48')](_0x28e838)[_0xf9cd('0x25')](handleEntityNotFound(_0x1baeb8,null))[_0xf9cd('0x25')](respondWithResult(_0x1baeb8,null))[_0xf9cd('0x49')](handleError(_0x1baeb8,null));};exports[_0xf9cd('0x4a')]=function(_0x439651,_0x5d780e){return db[_0xf9cd('0x40')][_0xf9cd('0x4a')](_0x439651[_0xf9cd('0x4b')],{})[_0xf9cd('0x25')](respondWithResult(_0x5d780e,0xc9))[_0xf9cd('0x49')](handleError(_0x5d780e,null));};exports[_0xf9cd('0x24')]=function(_0x3cb24c,_0x480f2e){if(_0x3cb24c[_0xf9cd('0x4b')]['id']){delete _0x3cb24c[_0xf9cd('0x4b')]['id'];}return db[_0xf9cd('0x40')][_0xf9cd('0x48')]({'where':{'id':_0x3cb24c['params']['id']}})[_0xf9cd('0x25')](handleEntityNotFound(_0x480f2e,null))[_0xf9cd('0x25')](saveUpdates(_0x3cb24c[_0xf9cd('0x4b')],null))['then'](respondWithResult(_0x480f2e,null))[_0xf9cd('0x49')](handleError(_0x480f2e,null));};exports[_0xf9cd('0x26')]=function(_0x261743,_0xf23b29){return db[_0xf9cd('0x40')][_0xf9cd('0x48')]({'where':{'id':_0x261743['params']['id']}})[_0xf9cd('0x25')](handleEntityNotFound(_0xf23b29,null))['then'](removeEntity(_0xf23b29,null))[_0xf9cd('0x49')](handleError(_0xf23b29,null));};exports[_0xf9cd('0x4c')]=function(_0x4cde6e,_0x6f7b1d){return db[_0xf9cd('0x40')][_0xf9cd('0x4c')]()[_0xf9cd('0x25')](respondWithResult(_0x6f7b1d,null))[_0xf9cd('0x49')](handleError(_0x6f7b1d,null));}; \ No newline at end of file +var _0x16f3=['error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','find','create','body','update','params','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','then'];(function(_0x3be951,_0x9d9eed){var _0x53e527=function(_0x483a9f){while(--_0x483a9f){_0x3be951['push'](_0x3be951['shift']());}};_0x53e527(++_0x9d9eed);}(_0x16f3,0x1f0));var _0x316f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16f3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x316f('0x0'));var rimraf=require(_0x316f('0x1'));var zipdir=require(_0x316f('0x2'));var jsonpatch=require(_0x316f('0x3'));var rp=require(_0x316f('0x4'));var moment=require(_0x316f('0x5'));var BPromise=require(_0x316f('0x6'));var Mustache=require(_0x316f('0x7'));var util=require(_0x316f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x316f('0x9'));var ejs=require(_0x316f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x316f('0xb'));var squel=require(_0x316f('0xc'));var crypto=require(_0x316f('0xd'));var jsforce=require(_0x316f('0xe'));var deskjs=require(_0x316f('0xf'));var toCsv=require(_0x316f('0x9'));var querystring=require(_0x316f('0x10'));var Papa=require('papaparse');var Redis=require(_0x316f('0x11'));var authService=require(_0x316f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x316f('0x13'));var logger=require(_0x316f('0x14'))(_0x316f('0x15'));var utils=require('../../config/utils');var config=require(_0x316f('0x16'));var licenseUtil=require(_0x316f('0x17'));var db=require(_0x316f('0x18'))['db'];function respondWithStatusCode(_0x15163a,_0x23a634){_0x23a634=_0x23a634||0xcc;return function(_0x3a35b3){if(_0x3a35b3){return _0x15163a[_0x316f('0x19')](_0x23a634);}return _0x15163a['status'](_0x23a634)[_0x316f('0x1a')]();};}function respondWithResult(_0x361ae2,_0x533fb7){_0x533fb7=_0x533fb7||0xc8;return function(_0x532243){if(_0x532243){return _0x361ae2[_0x316f('0x1b')](_0x533fb7)[_0x316f('0x1c')](_0x532243);}};}function respondWithFilteredResult(_0x4c838a,_0x28404c){return function(_0x53f01b){if(_0x53f01b){var _0x3350fd=typeof _0x28404c[_0x316f('0x1d')]===_0x316f('0x1e')&&typeof _0x28404c[_0x316f('0x1f')]===_0x316f('0x1e');var _0x50b91f=_0x53f01b[_0x316f('0x20')];var _0x46faba=_0x3350fd?0x0:_0x28404c[_0x316f('0x1d')];var _0x49374a=_0x3350fd?_0x53f01b[_0x316f('0x20')]:_0x28404c[_0x316f('0x1d')]+_0x28404c['limit'];var _0x16caa5;if(_0x49374a>=_0x50b91f){_0x49374a=_0x50b91f;_0x16caa5=0xc8;}else{_0x16caa5=0xce;}_0x4c838a['status'](_0x16caa5);return _0x4c838a['set'](_0x316f('0x21'),_0x46faba+'-'+_0x49374a+'/'+_0x50b91f)[_0x316f('0x1c')](_0x53f01b);}return null;};}function patchUpdates(_0x42ec89){return function(_0xa9fc3a){try{jsonpatch['apply'](_0xa9fc3a,_0x42ec89,!![]);}catch(_0x56c5b2){return BPromise[_0x316f('0x22')](_0x56c5b2);}return _0xa9fc3a['save']();};}function saveUpdates(_0x26b47c,_0x1df5dc){return function(_0x4ed175){if(_0x4ed175){return _0x4ed175['update'](_0x26b47c)[_0x316f('0x23')](function(_0x1051e5){return _0x1051e5;});}return null;};}function removeEntity(_0x5c3f64,_0x342f9b){return function(_0x82da3){if(_0x82da3){return _0x82da3['destroy']()[_0x316f('0x23')](function(){_0x5c3f64[_0x316f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1067c4,_0x575f54){return function(_0x4cf436){if(!_0x4cf436){_0x1067c4[_0x316f('0x19')](0x194);}return _0x4cf436;};}function handleError(_0x29be1a,_0x540b09){_0x540b09=_0x540b09||0x1f4;return function(_0x69e6b2){logger[_0x316f('0x24')](_0x69e6b2[_0x316f('0x25')]);if(_0x69e6b2[_0x316f('0x26')]){delete _0x69e6b2['name'];}_0x29be1a[_0x316f('0x1b')](_0x540b09)[_0x316f('0x27')](_0x69e6b2);};}exports[_0x316f('0x28')]=function(_0x1c8d60,_0x3c2bc3){var _0x449701={},_0x15f06f={},_0x5572c3={'count':0x0,'rows':[]};var _0x2f7183=_[_0x316f('0x29')](db[_0x316f('0x2a')][_0x316f('0x2b')],function(_0x4173f7){return{'name':_0x4173f7[_0x316f('0x2c')],'type':_0x4173f7[_0x316f('0x2d')]['key']};});_0x15f06f[_0x316f('0x2e')]=_[_0x316f('0x29')](_0x2f7183,_0x316f('0x26'));_0x15f06f['query']=_[_0x316f('0x2f')](_0x1c8d60[_0x316f('0x30')]);_0x15f06f[_0x316f('0x31')]=_[_0x316f('0x32')](_0x15f06f[_0x316f('0x2e')],_0x15f06f[_0x316f('0x30')]);_0x449701[_0x316f('0x33')]=_[_0x316f('0x32')](_0x15f06f[_0x316f('0x2e')],qs[_0x316f('0x34')](_0x1c8d60[_0x316f('0x30')][_0x316f('0x34')]));_0x449701['attributes']=_0x449701[_0x316f('0x33')][_0x316f('0x35')]?_0x449701[_0x316f('0x33')]:_0x15f06f[_0x316f('0x2e')];if(!_0x1c8d60[_0x316f('0x30')][_0x316f('0x36')](_0x316f('0x37'))){_0x449701['limit']=qs[_0x316f('0x1f')](_0x1c8d60[_0x316f('0x30')][_0x316f('0x1f')]);_0x449701['offset']=qs[_0x316f('0x1d')](_0x1c8d60[_0x316f('0x30')]['offset']);}_0x449701[_0x316f('0x38')]=qs[_0x316f('0x39')](_0x1c8d60['query'][_0x316f('0x39')]);_0x449701[_0x316f('0x3a')]=qs[_0x316f('0x31')](_[_0x316f('0x3b')](_0x1c8d60['query'],_0x15f06f[_0x316f('0x31')]),_0x2f7183);if(_0x1c8d60[_0x316f('0x30')][_0x316f('0x3c')]){_0x449701['where']=_['merge'](_0x449701[_0x316f('0x3a')],{'$or':_[_0x316f('0x29')](_0x2f7183,function(_0xbdb43c){if(_0xbdb43c[_0x316f('0x2d')]!=='VIRTUAL'){var _0x79126d={};_0x79126d[_0xbdb43c[_0x316f('0x26')]]={'$like':'%'+_0x1c8d60['query']['filter']+'%'};return _0x79126d;}})});}_0x449701=_[_0x316f('0x3d')]({},_0x449701,_0x1c8d60[_0x316f('0x3e')]);var _0x4dad10={'where':_0x449701[_0x316f('0x3a')]};return db[_0x316f('0x2a')][_0x316f('0x20')](_0x4dad10)[_0x316f('0x23')](function(_0xbfde9d){_0x5572c3[_0x316f('0x20')]=_0xbfde9d;if(_0x1c8d60['query'][_0x316f('0x3f')]){_0x449701[_0x316f('0x40')]=[{'all':!![]}];}return db[_0x316f('0x2a')][_0x316f('0x41')](_0x449701);})[_0x316f('0x23')](function(_0x5f0b16){_0x5572c3[_0x316f('0x42')]=_0x5f0b16;return _0x5572c3;})[_0x316f('0x23')](respondWithFilteredResult(_0x3c2bc3,_0x449701))['catch'](handleError(_0x3c2bc3,null));};exports[_0x316f('0x43')]=function(_0x5e80cb,_0x57ab8c){var _0x5d20ec={'raw':!![],'where':{'id':_0x5e80cb['params']['id']}},_0x33860a={};_0x33860a['model']=_['keys'](db[_0x316f('0x2a')][_0x316f('0x2b')]);_0x33860a[_0x316f('0x30')]=_[_0x316f('0x2f')](_0x5e80cb[_0x316f('0x30')]);_0x33860a[_0x316f('0x31')]=_[_0x316f('0x32')](_0x33860a['model'],_0x33860a[_0x316f('0x30')]);_0x5d20ec['attributes']=_[_0x316f('0x32')](_0x33860a[_0x316f('0x2e')],qs[_0x316f('0x34')](_0x5e80cb['query'][_0x316f('0x34')]));_0x5d20ec[_0x316f('0x33')]=_0x5d20ec[_0x316f('0x33')][_0x316f('0x35')]?_0x5d20ec['attributes']:_0x33860a[_0x316f('0x2e')];if(_0x5e80cb[_0x316f('0x30')][_0x316f('0x3f')]){_0x5d20ec[_0x316f('0x40')]=[{'all':!![]}];}_0x5d20ec=_[_0x316f('0x3d')]({},_0x5d20ec,_0x5e80cb[_0x316f('0x3e')]);return db[_0x316f('0x2a')][_0x316f('0x44')](_0x5d20ec)[_0x316f('0x23')](handleEntityNotFound(_0x57ab8c,null))[_0x316f('0x23')](respondWithResult(_0x57ab8c,null))['catch'](handleError(_0x57ab8c,null));};exports['create']=function(_0x26362b,_0x5bf5fe){return db['OpenchannelQueueReport'][_0x316f('0x45')](_0x26362b[_0x316f('0x46')],{})['then'](respondWithResult(_0x5bf5fe,0xc9))['catch'](handleError(_0x5bf5fe,null));};exports[_0x316f('0x47')]=function(_0x12de22,_0x165214){if(_0x12de22[_0x316f('0x46')]['id']){delete _0x12de22[_0x316f('0x46')]['id'];}return db[_0x316f('0x2a')][_0x316f('0x44')]({'where':{'id':_0x12de22[_0x316f('0x48')]['id']}})[_0x316f('0x23')](handleEntityNotFound(_0x165214,null))[_0x316f('0x23')](saveUpdates(_0x12de22[_0x316f('0x46')],null))[_0x316f('0x23')](respondWithResult(_0x165214,null))[_0x316f('0x49')](handleError(_0x165214,null));};exports[_0x316f('0x4a')]=function(_0x575bdd,_0x5082f0){return db[_0x316f('0x2a')][_0x316f('0x44')]({'where':{'id':_0x575bdd[_0x316f('0x48')]['id']}})[_0x316f('0x23')](handleEntityNotFound(_0x5082f0,null))[_0x316f('0x23')](removeEntity(_0x5082f0,null))['catch'](handleError(_0x5082f0,null));};exports['describe']=function(_0x27e274,_0x36ceb2){return db[_0x316f('0x2a')][_0x316f('0x4b')]()[_0x316f('0x23')](respondWithResult(_0x36ceb2,null))[_0x316f('0x49')](handleError(_0x36ceb2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index a11d17d..33f7388 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x479134,_0x5ef9e8){var _0x4ca3db=function(_0x399115){while(--_0x399115){_0x479134['push'](_0x479134['shift']());}};_0x4ca3db(++_0x5ef9e8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x2552e9,_0x4715e7){var _0x2428eb=function(_0x21d38b){while(--_0x21d38b){_0x2552e9['push'](_0x2552e9['shift']());}};_0x2428eb(++_0x4715e7);}(_0xe14b,0x93));var _0xbe14=function(_0x1d6531,_0x501e3c){_0x1d6531=_0x1d6531-0x0;var _0x5cb4cf=_0xe14b[_0x1d6531];return _0x5cb4cf;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index eaecfc3..db27b7b 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 _0x2272=['raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options'];(function(_0x1744a1,_0x272a4c){var _0x12afcb=function(_0x14c989){while(--_0x14c989){_0x1744a1['push'](_0x1744a1['shift']());}};_0x12afcb(++_0x272a4c);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2b26b7){logger[_0x2227('0xd')](_0x2227('0x18'),_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON[_0x2227('0x11')](_0x2b26b7));_0x620012(_0x2b26b7);})[_0x2227('0x17')](function(_0x10d9ca){logger[_0x2227('0x12')](_0x2227('0x18'),_0x10d9ca[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80['error'](0x1f4,_0x10d9ca[_0x2227('0x15')]));});});};exports[_0x2227('0x1e')]=function(_0x5b3a09){var _0x2cef4b=this;return new Promise(function(_0xbfdce1,_0x5ea1c3){return db['OpenchannelQueueReport'][_0x2227('0x1f')](_0x5b3a09[_0x2227('0x1b')],{'raw':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')][_0x2227('0x20')]||null:null,'attributes':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09['options'][_0x2227('0x21')]||null:null,'limit':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')][_0x2227('0x22')]||null:null})[_0x2227('0xc')](function(_0x4789eb){logger['info']('UpdateOpenchannelQueueReport',_0x5b3a09);logger[_0x2227('0xf')]('UpdateOpenchannelQueueReport',_0x5b3a09,JSON[_0x2227('0x11')](_0x4789eb));_0xbfdce1(_0x4789eb);})[_0x2227('0x17')](function(_0x58609e){logger['error'](_0x2227('0x1e'),_0x58609e[_0x2227('0x15')],_0x5b3a09);_0x5ea1c3(_0x2cef4b[_0x2227('0x12')](0x1f4,_0x58609e['message']));});});}; \ No newline at end of file +var _0xf7b4=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','OpenchannelQueueReport','create','body','options','then','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','raw','attributes','limit','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x594c2a,_0x30753a){var _0x3cc338=function(_0xc4dc08){while(--_0xc4dc08){_0x594c2a['push'](_0x594c2a['shift']());}};_0x3cc338(++_0x30753a);}(_0xf7b4,0x152));var _0x4f7b=function(_0x4337ef,_0x10f642){_0x4337ef=_0x4337ef-0x0;var _0x2ec836=_0xf7b4[_0x4337ef];return _0x2ec836;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ad135,_0x173784,_0x351036){return new BPromise(function(_0x36ea9c,_0x3ef6e1){return client[_0x4f7b('0xa')](_0x3ad135,_0x351036)['then'](function(_0x433563){logger[_0x4f7b('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x173784,_0x4f7b('0xc'));logger[_0x4f7b('0xd')](_0x4f7b('0xe'),_0x173784,_0x4f7b('0xc'),JSON[_0x4f7b('0xf')](_0x433563));if(_0x433563['error']){if(_0x433563[_0x4f7b('0x10')]['code']===0x1f4){logger['error'](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x3ef6e1(_0x433563[_0x4f7b('0x10')]['message']);}logger[_0x4f7b('0x10')](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x36ea9c(_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);}else{logger[_0x4f7b('0xb')](_0x4f7b('0x11'),_0x173784,_0x4f7b('0xc'));_0x36ea9c(_0x433563[_0x4f7b('0x13')][_0x4f7b('0x12')]);}})[_0x4f7b('0x14')](function(_0x50a161){logger[_0x4f7b('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x173784,_0x50a161);_0x3ef6e1(_0x50a161);});});}exports['CreateOpenchannelQueueReport']=function(_0x24e5cf){var _0x3813da=this;return new Promise(function(_0x519d90,_0x2b34c9){return db[_0x4f7b('0x15')][_0x4f7b('0x16')](_0x24e5cf[_0x4f7b('0x17')],{'raw':_0x24e5cf['options']?_0x24e5cf[_0x4f7b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4f7b('0x19')](function(_0x12374b){logger[_0x4f7b('0xb')](_0x4f7b('0x1a'),_0x24e5cf);logger[_0x4f7b('0xd')](_0x4f7b('0x1a'),_0x24e5cf,JSON[_0x4f7b('0xf')](_0x12374b));_0x519d90(_0x12374b);})[_0x4f7b('0x14')](function(_0x2a8b50){logger['error'](_0x4f7b('0x1a'),_0x2a8b50[_0x4f7b('0x12')],_0x24e5cf);_0x2b34c9(_0x3813da[_0x4f7b('0x10')](0x1f4,_0x2a8b50['message']));});});};exports[_0x4f7b('0x1b')]=function(_0x4610a4){var _0x5d22f4=this;return new Promise(function(_0x15dbec,_0x59ec24){return db[_0x4f7b('0x15')][_0x4f7b('0x1c')](_0x4610a4[_0x4f7b('0x17')],{'raw':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')]['where']||null:null,'attributes':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1e')]||null:null,'limit':_0x4610a4['options']?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1f')]||null:null})[_0x4f7b('0x19')](function(_0x3a56ff){logger[_0x4f7b('0xb')]('UpdateOpenchannelQueueReport',_0x4610a4);logger[_0x4f7b('0xd')](_0x4f7b('0x1b'),_0x4610a4,JSON[_0x4f7b('0xf')](_0x3a56ff));_0x15dbec(_0x3a56ff);})['catch'](function(_0x7de561){logger['error']('UpdateOpenchannelQueueReport',_0x7de561[_0x4f7b('0x12')],_0x4610a4);_0x59ec24(_0x5d22f4['error'](0x1f4,_0x7de561[_0x4f7b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 387786e..f842b58 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 _0xfbb5=['../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfbb5,0xa2));var _0x5fbb=function(_0x4575db,_0x411e57){_0x4575db=_0x4575db-0x0;var _0x12e811=_0xfbb5[_0x4575db];return _0x12e811;};'use strict';var multer=require(_0x5fbb('0x0'));var util=require(_0x5fbb('0x1'));var path=require(_0x5fbb('0x2'));var timeout=require('connect-timeout');var express=require(_0x5fbb('0x3'));var router=express[_0x5fbb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5fbb('0x5'));var interaction=require(_0x5fbb('0x6'));var config=require('../../config/environment');var controller=require(_0x5fbb('0x7'));router[_0x5fbb('0x8')]('/',auth[_0x5fbb('0x9')](),controller[_0x5fbb('0xa')]);router[_0x5fbb('0x8')](_0x5fbb('0xb'),auth[_0x5fbb('0x9')](),controller[_0x5fbb('0xc')]);router['get']('/:id',auth[_0x5fbb('0x9')](),controller[_0x5fbb('0xd')]);router[_0x5fbb('0xe')]('/',auth[_0x5fbb('0x9')](),controller[_0x5fbb('0xf')]);router[_0x5fbb('0x10')](_0x5fbb('0x11'),auth[_0x5fbb('0x9')](),controller[_0x5fbb('0x12')]);router[_0x5fbb('0x13')](_0x5fbb('0x11'),auth[_0x5fbb('0x9')](),controller[_0x5fbb('0x14')]);module['exports']=router; \ No newline at end of file +var _0xfcfd=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','put','delete'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0xfcfd,0x1e7));var _0xdfcf=function(_0x4cf572,_0x213a0f){_0x4cf572=_0x4cf572-0x0;var _0x5566a6=_0xfcfd[_0x4cf572];return _0x5566a6;};'use strict';var multer=require(_0xdfcf('0x0'));var util=require(_0xdfcf('0x1'));var path=require(_0xdfcf('0x2'));var timeout=require('connect-timeout');var express=require(_0xdfcf('0x3'));var router=express[_0xdfcf('0x4')]();var fs_extra=require(_0xdfcf('0x5'));var auth=require(_0xdfcf('0x6'));var interaction=require(_0xdfcf('0x7'));var config=require(_0xdfcf('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0xdfcf('0x9')]('/',auth[_0xdfcf('0xa')](),controller[_0xdfcf('0xb')]);router['get'](_0xdfcf('0xc'),auth[_0xdfcf('0xa')](),controller[_0xdfcf('0xd')]);router[_0xdfcf('0x9')](_0xdfcf('0xe'),auth[_0xdfcf('0xa')](),controller['show']);router['post']('/',auth[_0xdfcf('0xa')](),controller['create']);router[_0xdfcf('0xf')](_0xdfcf('0xe'),auth[_0xdfcf('0xa')](),controller['update']);router[_0xdfcf('0x10')](_0xdfcf('0xe'),auth[_0xdfcf('0xa')](),controller[_0xdfcf('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 5165c42..e60125f 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x23f288,_0xb54ee5){var _0x40bec9=function(_0x487745){while(--_0x487745){_0x23f288['push'](_0x23f288['shift']());}};_0x40bec9(++_0xb54ee5);}(_0x4b84,0x1cc));var _0x44b8=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x4b84[_0x43dc7e];return _0x21e12d;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x55409d,_0xad6432){var _0x4b2c0e=function(_0x168b82){while(--_0x168b82){_0x55409d['push'](_0x55409d['shift']());}};_0x4b2c0e(++_0xad6432);}(_0xaa88,0x137));var _0x8aa8=function(_0x3877c1,_0x238c29){_0x3877c1=_0x3877c1-0x0;var _0x59056a=_0xaa88[_0x3877c1];return _0x59056a;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index c466927..7df8c74 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 _0x4661=['find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','OpenchannelTransferReport','includeAll','include','findAll','rows','params'];(function(_0x9db82e,_0x339ae2){var _0x8c1fbb=function(_0x5bc78d){while(--_0x5bc78d){_0x9db82e['push'](_0x9db82e['shift']());}};_0x8c1fbb(++_0x339ae2);}(_0x4661,0xec));var _0x1466=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4661[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x1466('0x0'));var rimraf=require(_0x1466('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1466('0x2'));var rp=require(_0x1466('0x3'));var moment=require('moment');var BPromise=require(_0x1466('0x4'));var Mustache=require('mustache');var util=require(_0x1466('0x5'));var path=require(_0x1466('0x6'));var sox=require(_0x1466('0x7'));var csv=require(_0x1466('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1466('0x9'));var _=require(_0x1466('0xa'));var squel=require(_0x1466('0xb'));var crypto=require(_0x1466('0xc'));var jsforce=require(_0x1466('0xd'));var deskjs=require(_0x1466('0xe'));var toCsv=require(_0x1466('0x8'));var querystring=require('querystring');var Papa=require(_0x1466('0xf'));var Redis=require(_0x1466('0x10'));var authService=require(_0x1466('0x11'));var qs=require(_0x1466('0x12'));var as=require(_0x1466('0x13'));var hardwareService=require(_0x1466('0x14'));var logger=require(_0x1466('0x15'))(_0x1466('0x16'));var utils=require(_0x1466('0x17'));var config=require(_0x1466('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1466('0x19'))['db'];function respondWithStatusCode(_0x336d3f,_0x575d73){_0x575d73=_0x575d73||0xcc;return function(_0x4f7e87){if(_0x4f7e87){return _0x336d3f[_0x1466('0x1a')](_0x575d73);}return _0x336d3f[_0x1466('0x1b')](_0x575d73)['end']();};}function respondWithResult(_0x1d9c53,_0x1b918b){_0x1b918b=_0x1b918b||0xc8;return function(_0x2c2653){if(_0x2c2653){return _0x1d9c53[_0x1466('0x1b')](_0x1b918b)[_0x1466('0x1c')](_0x2c2653);}};}function respondWithFilteredResult(_0xb3f386,_0x539a4d){return function(_0x221d32){if(_0x221d32){var _0x4004ea=typeof _0x539a4d[_0x1466('0x1d')]===_0x1466('0x1e')&&typeof _0x539a4d[_0x1466('0x1f')]===_0x1466('0x1e');var _0x6271e3=_0x221d32[_0x1466('0x20')];var _0x262db1=_0x4004ea?0x0:_0x539a4d[_0x1466('0x1d')];var _0x5cd90c=_0x4004ea?_0x221d32['count']:_0x539a4d[_0x1466('0x1d')]+_0x539a4d[_0x1466('0x1f')];var _0x524529;if(_0x5cd90c>=_0x6271e3){_0x5cd90c=_0x6271e3;_0x524529=0xc8;}else{_0x524529=0xce;}_0xb3f386[_0x1466('0x1b')](_0x524529);return _0xb3f386[_0x1466('0x21')](_0x1466('0x22'),_0x262db1+'-'+_0x5cd90c+'/'+_0x6271e3)[_0x1466('0x1c')](_0x221d32);}return null;};}function patchUpdates(_0x3ebf43){return function(_0x2b1468){try{jsonpatch[_0x1466('0x23')](_0x2b1468,_0x3ebf43,!![]);}catch(_0x588b1d){return BPromise[_0x1466('0x24')](_0x588b1d);}return _0x2b1468['save']();};}function saveUpdates(_0x1180a3,_0x5974eb){return function(_0x25bc4e){if(_0x25bc4e){return _0x25bc4e[_0x1466('0x25')](_0x1180a3)[_0x1466('0x26')](function(_0x35512d){return _0x35512d;});}return null;};}function removeEntity(_0x36e021,_0x58b136){return function(_0x59dc5d){if(_0x59dc5d){return _0x59dc5d[_0x1466('0x27')]()[_0x1466('0x26')](function(){_0x36e021[_0x1466('0x1b')](0xcc)[_0x1466('0x28')]();});}};}function handleEntityNotFound(_0x5ab826,_0x37233c){return function(_0x56edad){if(!_0x56edad){_0x5ab826['sendStatus'](0x194);}return _0x56edad;};}function handleError(_0x1ee249,_0x27a1bb){_0x27a1bb=_0x27a1bb||0x1f4;return function(_0x3d30a2){logger[_0x1466('0x29')](_0x3d30a2[_0x1466('0x2a')]);if(_0x3d30a2[_0x1466('0x2b')]){delete _0x3d30a2['name'];}_0x1ee249[_0x1466('0x1b')](_0x27a1bb)[_0x1466('0x2c')](_0x3d30a2);};}exports[_0x1466('0x2d')]=function(_0x5a0f14,_0x32d1aa){var _0x132b06={},_0x28664f={},_0x385b03={'count':0x0,'rows':[]};var _0x47cd01=_[_0x1466('0x2e')](db['OpenchannelTransferReport'][_0x1466('0x2f')],function(_0x6e5dad){return{'name':_0x6e5dad[_0x1466('0x30')],'type':_0x6e5dad['type']['key']};});_0x28664f['model']=_[_0x1466('0x2e')](_0x47cd01,_0x1466('0x2b'));_0x28664f[_0x1466('0x31')]=_[_0x1466('0x32')](_0x5a0f14[_0x1466('0x31')]);_0x28664f[_0x1466('0x33')]=_[_0x1466('0x34')](_0x28664f[_0x1466('0x35')],_0x28664f[_0x1466('0x31')]);_0x132b06[_0x1466('0x36')]=_[_0x1466('0x34')](_0x28664f[_0x1466('0x35')],qs[_0x1466('0x37')](_0x5a0f14[_0x1466('0x31')][_0x1466('0x37')]));_0x132b06[_0x1466('0x36')]=_0x132b06['attributes'][_0x1466('0x38')]?_0x132b06['attributes']:_0x28664f[_0x1466('0x35')];if(!_0x5a0f14['query'][_0x1466('0x39')](_0x1466('0x3a'))){_0x132b06[_0x1466('0x1f')]=qs[_0x1466('0x1f')](_0x5a0f14[_0x1466('0x31')][_0x1466('0x1f')]);_0x132b06['offset']=qs[_0x1466('0x1d')](_0x5a0f14[_0x1466('0x31')]['offset']);}_0x132b06[_0x1466('0x3b')]=qs[_0x1466('0x3c')](_0x5a0f14[_0x1466('0x31')][_0x1466('0x3c')]);_0x132b06[_0x1466('0x3d')]=qs[_0x1466('0x33')](_[_0x1466('0x3e')](_0x5a0f14['query'],_0x28664f[_0x1466('0x33')]),_0x47cd01);if(_0x5a0f14[_0x1466('0x31')]['filter']){_0x132b06[_0x1466('0x3d')]=_[_0x1466('0x3f')](_0x132b06[_0x1466('0x3d')],{'$or':_[_0x1466('0x2e')](_0x47cd01,function(_0x117ee7){if(_0x117ee7['type']!==_0x1466('0x40')){var _0x36f611={};_0x36f611[_0x117ee7[_0x1466('0x2b')]]={'$like':'%'+_0x5a0f14[_0x1466('0x31')][_0x1466('0x41')]+'%'};return _0x36f611;}})});}_0x132b06=_['merge']({},_0x132b06,_0x5a0f14['options']);var _0x303be3={'where':_0x132b06[_0x1466('0x3d')]};return db[_0x1466('0x42')][_0x1466('0x20')](_0x303be3)[_0x1466('0x26')](function(_0x497a01){_0x385b03[_0x1466('0x20')]=_0x497a01;if(_0x5a0f14['query'][_0x1466('0x43')]){_0x132b06[_0x1466('0x44')]=[{'all':!![]}];}return db[_0x1466('0x42')][_0x1466('0x45')](_0x132b06);})[_0x1466('0x26')](function(_0xbe40b7){_0x385b03[_0x1466('0x46')]=_0xbe40b7;return _0x385b03;})['then'](respondWithFilteredResult(_0x32d1aa,_0x132b06))['catch'](handleError(_0x32d1aa,null));};exports['show']=function(_0x2285aa,_0x52912f){var _0x21a6c9={'raw':!![],'where':{'id':_0x2285aa[_0x1466('0x47')]['id']}},_0x2c5d6a={};_0x2c5d6a[_0x1466('0x35')]=_['keys'](db[_0x1466('0x42')][_0x1466('0x2f')]);_0x2c5d6a[_0x1466('0x31')]=_[_0x1466('0x32')](_0x2285aa[_0x1466('0x31')]);_0x2c5d6a[_0x1466('0x33')]=_['intersection'](_0x2c5d6a['model'],_0x2c5d6a[_0x1466('0x31')]);_0x21a6c9[_0x1466('0x36')]=_[_0x1466('0x34')](_0x2c5d6a[_0x1466('0x35')],qs[_0x1466('0x37')](_0x2285aa[_0x1466('0x31')][_0x1466('0x37')]));_0x21a6c9['attributes']=_0x21a6c9['attributes'][_0x1466('0x38')]?_0x21a6c9[_0x1466('0x36')]:_0x2c5d6a[_0x1466('0x35')];if(_0x2285aa['query'][_0x1466('0x43')]){_0x21a6c9[_0x1466('0x44')]=[{'all':!![]}];}_0x21a6c9=_[_0x1466('0x3f')]({},_0x21a6c9,_0x2285aa['options']);return db[_0x1466('0x42')][_0x1466('0x48')](_0x21a6c9)[_0x1466('0x26')](handleEntityNotFound(_0x52912f,null))[_0x1466('0x26')](respondWithResult(_0x52912f,null))[_0x1466('0x49')](handleError(_0x52912f,null));};exports[_0x1466('0x4a')]=function(_0xeb6372,_0x3035df){return db[_0x1466('0x42')][_0x1466('0x4a')](_0xeb6372['body'],{})[_0x1466('0x26')](respondWithResult(_0x3035df,0xc9))['catch'](handleError(_0x3035df,null));};exports[_0x1466('0x25')]=function(_0x156da7,_0x356327){if(_0x156da7['body']['id']){delete _0x156da7[_0x1466('0x4b')]['id'];}return db['OpenchannelTransferReport'][_0x1466('0x48')]({'where':{'id':_0x156da7['params']['id']}})[_0x1466('0x26')](handleEntityNotFound(_0x356327,null))[_0x1466('0x26')](saveUpdates(_0x156da7[_0x1466('0x4b')],null))[_0x1466('0x26')](respondWithResult(_0x356327,null))[_0x1466('0x49')](handleError(_0x356327,null));};exports[_0x1466('0x27')]=function(_0xde8f05,_0x4a43b1){return db[_0x1466('0x42')][_0x1466('0x48')]({'where':{'id':_0xde8f05[_0x1466('0x47')]['id']}})[_0x1466('0x26')](handleEntityNotFound(_0x4a43b1,null))[_0x1466('0x26')](removeEntity(_0x4a43b1,null))['catch'](handleError(_0x4a43b1,null));};exports[_0x1466('0x4c')]=function(_0x536dd4,_0x25049d){return db[_0x1466('0x42')][_0x1466('0x4c')]()['then'](respondWithResult(_0x25049d,null))[_0x1466('0x49')](handleError(_0x25049d,null));}; \ No newline at end of file +var _0x8a29=['save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','params','length','find','catch','create','body','update','describe','rimraf','zip-dir','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x4302ff,_0x5845a3){var _0x38dfb2=function(_0x5efe32){while(--_0x5efe32){_0x4302ff['push'](_0x4302ff['shift']());}};_0x38dfb2(++_0x5845a3);}(_0x8a29,0xfe));var _0x98a2=function(_0x5a1edd,_0x45f8bf){_0x5a1edd=_0x5a1edd-0x0;var _0x51264c=_0x8a29[_0x5a1edd];return _0x51264c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x98a2('0x0'));var zipdir=require(_0x98a2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98a2('0x2'));var BPromise=require(_0x98a2('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x98a2('0x4'));var sox=require(_0x98a2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98a2('0x6'));var _=require(_0x98a2('0x7'));var squel=require(_0x98a2('0x8'));var crypto=require(_0x98a2('0x9'));var jsforce=require(_0x98a2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x98a2('0xb'));var querystring=require(_0x98a2('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98a2('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x98a2('0xe'));var hardwareService=require(_0x98a2('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x98a2('0x10'));var licenseUtil=require(_0x98a2('0x11'));var db=require(_0x98a2('0x12'))['db'];function respondWithStatusCode(_0x51cf95,_0x4500a7){_0x4500a7=_0x4500a7||0xcc;return function(_0x448d4d){if(_0x448d4d){return _0x51cf95[_0x98a2('0x13')](_0x4500a7);}return _0x51cf95[_0x98a2('0x14')](_0x4500a7)['end']();};}function respondWithResult(_0x8b9575,_0x613975){_0x613975=_0x613975||0xc8;return function(_0x315515){if(_0x315515){return _0x8b9575[_0x98a2('0x14')](_0x613975)[_0x98a2('0x15')](_0x315515);}};}function respondWithFilteredResult(_0x4c9d84,_0x4161c7){return function(_0x5afd8f){if(_0x5afd8f){var _0x4c636e=typeof _0x4161c7[_0x98a2('0x16')]===_0x98a2('0x17')&&typeof _0x4161c7[_0x98a2('0x18')]==='undefined';var _0x47d986=_0x5afd8f[_0x98a2('0x19')];var _0x1a5d12=_0x4c636e?0x0:_0x4161c7[_0x98a2('0x16')];var _0x3ec685=_0x4c636e?_0x5afd8f[_0x98a2('0x19')]:_0x4161c7[_0x98a2('0x16')]+_0x4161c7[_0x98a2('0x18')];var _0xbf696b;if(_0x3ec685>=_0x47d986){_0x3ec685=_0x47d986;_0xbf696b=0xc8;}else{_0xbf696b=0xce;}_0x4c9d84[_0x98a2('0x14')](_0xbf696b);return _0x4c9d84[_0x98a2('0x1a')](_0x98a2('0x1b'),_0x1a5d12+'-'+_0x3ec685+'/'+_0x47d986)[_0x98a2('0x15')](_0x5afd8f);}return null;};}function patchUpdates(_0x12ccdd){return function(_0x25beda){try{jsonpatch[_0x98a2('0x1c')](_0x25beda,_0x12ccdd,!![]);}catch(_0x59be83){return BPromise[_0x98a2('0x1d')](_0x59be83);}return _0x25beda[_0x98a2('0x1e')]();};}function saveUpdates(_0x5c8965,_0x144911){return function(_0x853823){if(_0x853823){return _0x853823['update'](_0x5c8965)[_0x98a2('0x1f')](function(_0x210a74){return _0x210a74;});}return null;};}function removeEntity(_0xc1b081,_0x2d640e){return function(_0x15c02a){if(_0x15c02a){return _0x15c02a[_0x98a2('0x20')]()[_0x98a2('0x1f')](function(){_0xc1b081['status'](0xcc)[_0x98a2('0x21')]();});}};}function handleEntityNotFound(_0x2c75f4,_0x35fa5b){return function(_0x3043ae){if(!_0x3043ae){_0x2c75f4[_0x98a2('0x13')](0x194);}return _0x3043ae;};}function handleError(_0xa696f8,_0x29c50d){_0x29c50d=_0x29c50d||0x1f4;return function(_0x14a774){logger[_0x98a2('0x22')](_0x14a774[_0x98a2('0x23')]);if(_0x14a774['name']){delete _0x14a774[_0x98a2('0x24')];}_0xa696f8['status'](_0x29c50d)[_0x98a2('0x25')](_0x14a774);};}exports[_0x98a2('0x26')]=function(_0x1a9f88,_0x6a536d){var _0x9cce00={},_0x279db5={},_0x504221={'count':0x0,'rows':[]};var _0x1bd17b=_[_0x98a2('0x27')](db['OpenchannelTransferReport'][_0x98a2('0x28')],function(_0x5e7420){return{'name':_0x5e7420[_0x98a2('0x29')],'type':_0x5e7420[_0x98a2('0x2a')]['key']};});_0x279db5[_0x98a2('0x2b')]=_[_0x98a2('0x27')](_0x1bd17b,_0x98a2('0x24'));_0x279db5['query']=_[_0x98a2('0x2c')](_0x1a9f88[_0x98a2('0x2d')]);_0x279db5['filters']=_[_0x98a2('0x2e')](_0x279db5[_0x98a2('0x2b')],_0x279db5[_0x98a2('0x2d')]);_0x9cce00['attributes']=_[_0x98a2('0x2e')](_0x279db5['model'],qs[_0x98a2('0x2f')](_0x1a9f88[_0x98a2('0x2d')][_0x98a2('0x2f')]));_0x9cce00[_0x98a2('0x30')]=_0x9cce00[_0x98a2('0x30')]['length']?_0x9cce00[_0x98a2('0x30')]:_0x279db5[_0x98a2('0x2b')];if(!_0x1a9f88[_0x98a2('0x2d')][_0x98a2('0x31')]('nolimit')){_0x9cce00[_0x98a2('0x18')]=qs[_0x98a2('0x18')](_0x1a9f88[_0x98a2('0x2d')]['limit']);_0x9cce00[_0x98a2('0x16')]=qs['offset'](_0x1a9f88[_0x98a2('0x2d')]['offset']);}_0x9cce00[_0x98a2('0x32')]=qs[_0x98a2('0x33')](_0x1a9f88['query']['sort']);_0x9cce00[_0x98a2('0x34')]=qs[_0x98a2('0x35')](_[_0x98a2('0x36')](_0x1a9f88[_0x98a2('0x2d')],_0x279db5[_0x98a2('0x35')]),_0x1bd17b);if(_0x1a9f88['query'][_0x98a2('0x37')]){_0x9cce00[_0x98a2('0x34')]=_[_0x98a2('0x38')](_0x9cce00[_0x98a2('0x34')],{'$or':_[_0x98a2('0x27')](_0x1bd17b,function(_0x5b1ace){if(_0x5b1ace[_0x98a2('0x2a')]!==_0x98a2('0x39')){var _0x44f71f={};_0x44f71f[_0x5b1ace[_0x98a2('0x24')]]={'$like':'%'+_0x1a9f88[_0x98a2('0x2d')][_0x98a2('0x37')]+'%'};return _0x44f71f;}})});}_0x9cce00=_['merge']({},_0x9cce00,_0x1a9f88[_0x98a2('0x3a')]);var _0x55e1c6={'where':_0x9cce00[_0x98a2('0x34')]};return db[_0x98a2('0x3b')][_0x98a2('0x19')](_0x55e1c6)[_0x98a2('0x1f')](function(_0x2104c3){_0x504221[_0x98a2('0x19')]=_0x2104c3;if(_0x1a9f88[_0x98a2('0x2d')][_0x98a2('0x3c')]){_0x9cce00[_0x98a2('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x98a2('0x3e')](_0x9cce00);})[_0x98a2('0x1f')](function(_0x1a9b14){_0x504221['rows']=_0x1a9b14;return _0x504221;})['then'](respondWithFilteredResult(_0x6a536d,_0x9cce00))['catch'](handleError(_0x6a536d,null));};exports['show']=function(_0x8d9d65,_0x389176){var _0x427615={'raw':!![],'where':{'id':_0x8d9d65[_0x98a2('0x3f')]['id']}},_0x78ec19={};_0x78ec19[_0x98a2('0x2b')]=_[_0x98a2('0x2c')](db['OpenchannelTransferReport'][_0x98a2('0x28')]);_0x78ec19['query']=_['keys'](_0x8d9d65[_0x98a2('0x2d')]);_0x78ec19[_0x98a2('0x35')]=_['intersection'](_0x78ec19[_0x98a2('0x2b')],_0x78ec19[_0x98a2('0x2d')]);_0x427615[_0x98a2('0x30')]=_[_0x98a2('0x2e')](_0x78ec19['model'],qs[_0x98a2('0x2f')](_0x8d9d65[_0x98a2('0x2d')][_0x98a2('0x2f')]));_0x427615[_0x98a2('0x30')]=_0x427615[_0x98a2('0x30')][_0x98a2('0x40')]?_0x427615[_0x98a2('0x30')]:_0x78ec19['model'];if(_0x8d9d65[_0x98a2('0x2d')][_0x98a2('0x3c')]){_0x427615[_0x98a2('0x3d')]=[{'all':!![]}];}_0x427615=_[_0x98a2('0x38')]({},_0x427615,_0x8d9d65[_0x98a2('0x3a')]);return db['OpenchannelTransferReport'][_0x98a2('0x41')](_0x427615)[_0x98a2('0x1f')](handleEntityNotFound(_0x389176,null))[_0x98a2('0x1f')](respondWithResult(_0x389176,null))[_0x98a2('0x42')](handleError(_0x389176,null));};exports[_0x98a2('0x43')]=function(_0x4d1fd2,_0x3886a4){return db[_0x98a2('0x3b')]['create'](_0x4d1fd2[_0x98a2('0x44')],{})[_0x98a2('0x1f')](respondWithResult(_0x3886a4,0xc9))['catch'](handleError(_0x3886a4,null));};exports[_0x98a2('0x45')]=function(_0x54929b,_0x4706eb){if(_0x54929b[_0x98a2('0x44')]['id']){delete _0x54929b[_0x98a2('0x44')]['id'];}return db[_0x98a2('0x3b')][_0x98a2('0x41')]({'where':{'id':_0x54929b['params']['id']}})[_0x98a2('0x1f')](handleEntityNotFound(_0x4706eb,null))['then'](saveUpdates(_0x54929b[_0x98a2('0x44')],null))[_0x98a2('0x1f')](respondWithResult(_0x4706eb,null))[_0x98a2('0x42')](handleError(_0x4706eb,null));};exports[_0x98a2('0x20')]=function(_0x486310,_0x5902fb){return db[_0x98a2('0x3b')][_0x98a2('0x41')]({'where':{'id':_0x486310[_0x98a2('0x3f')]['id']}})[_0x98a2('0x1f')](handleEntityNotFound(_0x5902fb,null))[_0x98a2('0x1f')](removeEntity(_0x5902fb,null))['catch'](handleError(_0x5902fb,null));};exports[_0x98a2('0x46')]=function(_0x14efcf,_0x54d664){return db[_0x98a2('0x3b')]['describe']()[_0x98a2('0x1f')](respondWithResult(_0x54d664,null))[_0x98a2('0x42')](handleError(_0x54d664,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d1acec1..8fd9def 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 _0x4665=['bluebird','rimraf','../../config/environment','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x51eef8,_0x1f9c22){var _0x41608e=function(_0x584256){while(--_0x584256){_0x51eef8['push'](_0x51eef8['shift']());}};_0x41608e(++_0x1f9c22);}(_0x4665,0xcc));var _0x5466=function(_0x541543,_0x2b0271){_0x541543=_0x541543-0x0;var _0xdba6fb=_0x4665[_0x541543];return _0xdba6fb;};'use strict';var _=require(_0x5466('0x0'));var util=require(_0x5466('0x1'));var logger=require(_0x5466('0x2'))(_0x5466('0x3'));var moment=require(_0x5466('0x4'));var BPromise=require(_0x5466('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5466('0x6'));var config=require(_0x5466('0x7'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x249892,_0x14cb7c){return _0x249892['define'](_0x5466('0x8'),attributes,{'tableName':_0x5466('0x9'),'paranoid':![],'indexes':[{'name':_0x5466('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7545=['uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x3ec7c0,_0x289eb4){var _0x2787f0=function(_0x565c36){while(--_0x565c36){_0x3ec7c0['push'](_0x3ec7c0['shift']());}};_0x2787f0(++_0x289eb4);}(_0x7545,0x1e1));var _0x5754=function(_0xf9fa28,_0x461857){_0xf9fa28=_0xf9fa28-0x0;var _0x12f2ba=_0x7545[_0xf9fa28];return _0x12f2ba;};'use strict';var _=require(_0x5754('0x0'));var util=require(_0x5754('0x1'));var logger=require('../../config/logger')(_0x5754('0x2'));var moment=require(_0x5754('0x3'));var BPromise=require(_0x5754('0x4'));var rp=require(_0x5754('0x5'));var fs=require('fs');var path=require(_0x5754('0x6'));var rimraf=require('rimraf');var config=require(_0x5754('0x7'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x74227f,_0x1b8c03){return _0x74227f[_0x5754('0x8')](_0x5754('0x9'),attributes,{'tableName':_0x5754('0xa'),'paranoid':![],'indexes':[{'name':_0x5754('0xb'),'fields':[_0x5754('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 2c7fe4c..6d849df 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 _0x3fa4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','lodash','randomstring'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0x3fa4,0xf0));var _0x43fa=function(_0x3fb4f9,_0x31620d){_0x3fb4f9=_0x3fb4f9-0x0;var _0x4289f1=_0x3fa4[_0x3fb4f9];return _0x4289f1;};'use strict';var _=require(_0x43fa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43fa('0x1'));var fs=require('fs');var Redis=require(_0x43fa('0x2'));var db=require(_0x43fa('0x3'))['db'];var utils=require(_0x43fa('0x4'));var logger=require(_0x43fa('0x5'))(_0x43fa('0x6'));var config=require(_0x43fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43fa('0x8')][_0x43fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6df71c,_0x584209,_0x3dc891){return new BPromise(function(_0x46adc7,_0x1dc401){return client['request'](_0x6df71c,_0x3dc891)[_0x43fa('0xa')](function(_0x36d40d){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x584209,_0x43fa('0xb'));logger[_0x43fa('0xc')](_0x43fa('0xd'),_0x584209,_0x43fa('0xb'),JSON[_0x43fa('0xe')](_0x36d40d));if(_0x36d40d['error']){if(_0x36d40d[_0x43fa('0xf')][_0x43fa('0x10')]===0x1f4){logger[_0x43fa('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x584209,_0x36d40d[_0x43fa('0xf')][_0x43fa('0x11')]);return _0x1dc401(_0x36d40d[_0x43fa('0xf')]['message']);}logger[_0x43fa('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x584209,_0x36d40d['error']['message']);return _0x46adc7(_0x36d40d[_0x43fa('0xf')]['message']);}else{logger[_0x43fa('0x12')](_0x43fa('0x13'),_0x584209,'request\x20sent');_0x46adc7(_0x36d40d[_0x43fa('0x14')][_0x43fa('0x11')]);}})[_0x43fa('0x15')](function(_0x2439d4){logger[_0x43fa('0xf')](_0x43fa('0x13'),_0x584209,_0x2439d4);_0x1dc401(_0x2439d4);});});} \ No newline at end of file +var _0xf873=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0xf873,0xb2));var _0x3f87=function(_0x14d7fb,_0x2de704){_0x14d7fb=_0x14d7fb-0x0;var _0xf3b002=_0xf873[_0x14d7fb];return _0xf3b002;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var moment=require(_0x3f87('0x1'));var BPromise=require(_0x3f87('0x2'));var rs=require(_0x3f87('0x3'));var fs=require('fs');var Redis=require(_0x3f87('0x4'));var db=require(_0x3f87('0x5'))['db'];var utils=require(_0x3f87('0x6'));var logger=require(_0x3f87('0x7'))(_0x3f87('0x8'));var config=require('../../config/environment');var jayson=require(_0x3f87('0x9'));var client=jayson[_0x3f87('0xa')][_0x3f87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a5e37,_0x8bf89b,_0x2c7ccc){return new BPromise(function(_0x3b8e92,_0x41faf2){return client[_0x3f87('0xc')](_0x5a5e37,_0x2c7ccc)[_0x3f87('0xd')](function(_0x4c3ed4){logger[_0x3f87('0xe')](_0x3f87('0xf'),_0x8bf89b,_0x3f87('0x10'));logger[_0x3f87('0x11')](_0x3f87('0x12'),_0x8bf89b,_0x3f87('0x10'),JSON[_0x3f87('0x13')](_0x4c3ed4));if(_0x4c3ed4[_0x3f87('0x14')]){if(_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x15')]===0x1f4){logger[_0x3f87('0x14')](_0x3f87('0xf'),_0x8bf89b,_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);return _0x41faf2(_0x4c3ed4['error'][_0x3f87('0x16')]);}logger[_0x3f87('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8bf89b,_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);return _0x3b8e92(_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);}else{logger[_0x3f87('0xe')](_0x3f87('0xf'),_0x8bf89b,_0x3f87('0x10'));_0x3b8e92(_0x4c3ed4[_0x3f87('0x17')]['message']);}})[_0x3f87('0x18')](function(_0x3ac7a7){logger[_0x3f87('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8bf89b,_0x3ac7a7);_0x41faf2(_0x3ac7a7);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index da5c890..91a7052 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 _0x84bc=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x38c7ff,_0x4f1d26){var _0x1c7a9c=function(_0x2d0acd){while(--_0x2d0acd){_0x38c7ff['push'](_0x38c7ff['shift']());}};_0x1c7a9c(++_0x4f1d26);}(_0x84bc,0xee));var _0xc84b=function(_0x40903a,_0x386a39){_0x40903a=_0x40903a-0x0;var _0x1fcb8f=_0x84bc[_0x40903a];return _0x1fcb8f;};'use strict';var multer=require(_0xc84b('0x0'));var util=require(_0xc84b('0x1'));var path=require(_0xc84b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc84b('0x3'));var auth=require(_0xc84b('0x4'));var interaction=require(_0xc84b('0x5'));var config=require(_0xc84b('0x6'));var controller=require(_0xc84b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc84b('0x8')]);router[_0xc84b('0x9')](_0xc84b('0xa'),auth[_0xc84b('0xb')](),controller[_0xc84b('0xc')]);router[_0xc84b('0xd')]('/',auth[_0xc84b('0xb')](),controller[_0xc84b('0xe')]);router[_0xc84b('0xf')](_0xc84b('0xa'),auth[_0xc84b('0xb')](),controller[_0xc84b('0x10')]);router[_0xc84b('0x11')](_0xc84b('0xa'),auth[_0xc84b('0xb')](),controller[_0xc84b('0x12')]);module[_0xc84b('0x13')]=router; \ No newline at end of file +var _0x5bc4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x2dbac8,_0x1d8a38){var _0x55ea0b=function(_0x4533fe){while(--_0x4533fe){_0x2dbac8['push'](_0x2dbac8['shift']());}};_0x55ea0b(++_0x1d8a38);}(_0x5bc4,0x104));var _0x45bc=function(_0x164c7e,_0x17b8dc){_0x164c7e=_0x164c7e-0x0;var _0x33723c=_0x5bc4[_0x164c7e];return _0x33723c;};'use strict';var multer=require(_0x45bc('0x0'));var util=require(_0x45bc('0x1'));var path=require(_0x45bc('0x2'));var timeout=require(_0x45bc('0x3'));var express=require('express');var router=express[_0x45bc('0x4')]();var fs_extra=require(_0x45bc('0x5'));var auth=require(_0x45bc('0x6'));var interaction=require(_0x45bc('0x7'));var config=require(_0x45bc('0x8'));var controller=require(_0x45bc('0x9'));router[_0x45bc('0xa')]('/',auth[_0x45bc('0xb')](),controller[_0x45bc('0xc')]);router[_0x45bc('0xa')]('/:id',auth[_0x45bc('0xb')](),controller[_0x45bc('0xd')]);router[_0x45bc('0xe')]('/',auth[_0x45bc('0xb')](),controller[_0x45bc('0xf')]);router['put']('/:id',auth[_0x45bc('0xb')](),controller[_0x45bc('0x10')]);router[_0x45bc('0x11')](_0x45bc('0x12'),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 dfa147e..3335d95 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 _0xc318=['name','STRING'];(function(_0x1a7eaf,_0x331fe3){var _0x18c9aa=function(_0xf1516b){while(--_0xf1516b){_0x1a7eaf['push'](_0x1a7eaf['shift']());}};_0x18c9aa(++_0x331fe3);}(_0xc318,0x136));var _0x8c31=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc318[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8c31('0x0'),'allowNull':![]},'description':{'type':Sequelize[_0x8c31('0x1')]}}; \ No newline at end of file +var _0x39d8=['name','sequelize','STRING'];(function(_0x5ec1cc,_0x2d8fa7){var _0x434604=function(_0x4d6496){while(--_0x4d6496){_0x5ec1cc['push'](_0x5ec1cc['shift']());}};_0x434604(++_0x2d8fa7);}(_0x39d8,0x139));var _0x839d=function(_0xcd9ece,_0x33ff67){_0xcd9ece=_0xcd9ece-0x0;var _0x36f54f=_0x39d8[_0xcd9ece];return _0x36f54f;};'use strict';var Sequelize=require(_0x839d('0x0'));module['exports']={'name':{'type':Sequelize[_0x839d('0x1')],'unique':_0x839d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x839d('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 39babe4..1799819 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 _0x3d75=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','then','Pauses','destroy','error','stack','name','send','index','Pause','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','find','catch','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x3d75,0x177));var _0x53d7=function(_0x5bcc82,_0x3553cd){_0x5bcc82=_0x5bcc82-0x0;var _0x5daf18=_0x3d75[_0x5bcc82];return _0x5daf18;};'use strict';var emlformat=require(_0x53d7('0x0'));var rimraf=require(_0x53d7('0x1'));var zipdir=require(_0x53d7('0x2'));var jsonpatch=require(_0x53d7('0x3'));var rp=require(_0x53d7('0x4'));var moment=require(_0x53d7('0x5'));var BPromise=require(_0x53d7('0x6'));var Mustache=require(_0x53d7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x53d7('0x8'));var csv=require(_0x53d7('0x9'));var ejs=require(_0x53d7('0xa'));var fs=require('fs');var fs_extra=require(_0x53d7('0xb'));var _=require(_0x53d7('0xc'));var squel=require(_0x53d7('0xd'));var crypto=require('crypto');var jsforce=require(_0x53d7('0xe'));var deskjs=require(_0x53d7('0xf'));var toCsv=require(_0x53d7('0x9'));var querystring=require(_0x53d7('0x10'));var Papa=require(_0x53d7('0x11'));var Redis=require('ioredis');var authService=require(_0x53d7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x53d7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53d7('0x14'))(_0x53d7('0x15'));var utils=require(_0x53d7('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310259,_0x4fa80f){_0x4fa80f=_0x4fa80f||0xcc;return function(_0x163d67){if(_0x163d67){return _0x310259[_0x53d7('0x17')](_0x4fa80f);}return _0x310259['status'](_0x4fa80f)[_0x53d7('0x18')]();};}function respondWithResult(_0x3a8c85,_0x4d47aa){_0x4d47aa=_0x4d47aa||0xc8;return function(_0x58b960){if(_0x58b960){return _0x3a8c85[_0x53d7('0x19')](_0x4d47aa)['json'](_0x58b960);}};}function respondWithFilteredResult(_0x52e68e,_0x25f57d){return function(_0x47e418){if(_0x47e418){var _0x9fd643=typeof _0x25f57d['offset']==='undefined'&&typeof _0x25f57d['limit']===_0x53d7('0x1a');var _0x60105e=_0x47e418[_0x53d7('0x1b')];var _0x417257=_0x9fd643?0x0:_0x25f57d[_0x53d7('0x1c')];var _0x91091c=_0x9fd643?_0x47e418[_0x53d7('0x1b')]:_0x25f57d[_0x53d7('0x1c')]+_0x25f57d[_0x53d7('0x1d')];var _0xbaab92;if(_0x91091c>=_0x60105e){_0x91091c=_0x60105e;_0xbaab92=0xc8;}else{_0xbaab92=0xce;}_0x52e68e[_0x53d7('0x19')](_0xbaab92);return _0x52e68e['set'](_0x53d7('0x1e'),_0x417257+'-'+_0x91091c+'/'+_0x60105e)[_0x53d7('0x1f')](_0x47e418);}return null;};}function patchUpdates(_0x183785){return function(_0x28a327){try{jsonpatch[_0x53d7('0x20')](_0x28a327,_0x183785,!![]);}catch(_0x5ab09c){return BPromise[_0x53d7('0x21')](_0x5ab09c);}return _0x28a327['save']();};}function saveUpdates(_0x1dbef5,_0x4e9c87){return function(_0x1dd3a0){if(_0x1dd3a0){return _0x1dd3a0['update'](_0x1dbef5)[_0x53d7('0x22')](function(_0x4b8fa6){return _0x4b8fa6;});}return null;};}function removeEntity(_0x15b2c7,_0x164e73){return function(_0xc6c41e){if(_0xc6c41e){return _0xc6c41e['destroy']()[_0x53d7('0x22')](function(){var _0x2cee8e=_0xc6c41e['get']({'plain':!![]});var _0x1fb6ef=_0x53d7('0x23');return db['UserProfileResource'][_0x53d7('0x24')]({'where':{'type':_0x1fb6ef,'resourceId':_0x2cee8e['id']}})[_0x53d7('0x22')](function(){return _0xc6c41e;});})['then'](function(){_0x15b2c7[_0x53d7('0x19')](0xcc)[_0x53d7('0x18')]();});}};}function handleEntityNotFound(_0x59a07a,_0x187ef1){return function(_0x3d4900){if(!_0x3d4900){_0x59a07a[_0x53d7('0x17')](0x194);}return _0x3d4900;};}function handleError(_0x273901,_0x467cba){_0x467cba=_0x467cba||0x1f4;return function(_0x3f8def){logger[_0x53d7('0x25')](_0x3f8def[_0x53d7('0x26')]);if(_0x3f8def[_0x53d7('0x27')]){delete _0x3f8def[_0x53d7('0x27')];}_0x273901[_0x53d7('0x19')](_0x467cba)[_0x53d7('0x28')](_0x3f8def);};}exports[_0x53d7('0x29')]=function(_0x276c31,_0x48a766){var _0x510549={},_0x571da8={},_0x5611fc={'count':0x0,'rows':[]};var _0x3ca7e5=_['map'](db[_0x53d7('0x2a')][_0x53d7('0x2b')],function(_0x3c82c9){return{'name':_0x3c82c9[_0x53d7('0x2c')],'type':_0x3c82c9[_0x53d7('0x2d')]['key']};});_0x571da8[_0x53d7('0x2e')]=_[_0x53d7('0x2f')](_0x3ca7e5,'name');_0x571da8[_0x53d7('0x30')]=_[_0x53d7('0x31')](_0x276c31[_0x53d7('0x30')]);_0x571da8[_0x53d7('0x32')]=_['intersection'](_0x571da8[_0x53d7('0x2e')],_0x571da8['query']);_0x510549[_0x53d7('0x33')]=_[_0x53d7('0x34')](_0x571da8[_0x53d7('0x2e')],qs[_0x53d7('0x35')](_0x276c31['query'][_0x53d7('0x35')]));_0x510549[_0x53d7('0x33')]=_0x510549[_0x53d7('0x33')][_0x53d7('0x36')]?_0x510549[_0x53d7('0x33')]:_0x571da8[_0x53d7('0x2e')];if(!_0x276c31[_0x53d7('0x30')]['hasOwnProperty'](_0x53d7('0x37'))){_0x510549[_0x53d7('0x1d')]=qs[_0x53d7('0x1d')](_0x276c31[_0x53d7('0x30')]['limit']);_0x510549['offset']=qs['offset'](_0x276c31[_0x53d7('0x30')][_0x53d7('0x1c')]);}_0x510549['order']=qs[_0x53d7('0x38')](_0x276c31[_0x53d7('0x30')][_0x53d7('0x38')]);_0x510549[_0x53d7('0x39')]=qs[_0x53d7('0x32')](_[_0x53d7('0x3a')](_0x276c31[_0x53d7('0x30')],_0x571da8[_0x53d7('0x32')]),_0x3ca7e5);if(_0x276c31[_0x53d7('0x30')][_0x53d7('0x3b')]){_0x510549[_0x53d7('0x39')]=_[_0x53d7('0x3c')](_0x510549['where'],{'$or':_[_0x53d7('0x2f')](_0x3ca7e5,function(_0x1d8aea){if(_0x1d8aea[_0x53d7('0x2d')]!==_0x53d7('0x3d')){var _0x4fdc26={};_0x4fdc26[_0x1d8aea[_0x53d7('0x27')]]={'$like':'%'+_0x276c31['query']['filter']+'%'};return _0x4fdc26;}})});}_0x510549=_['merge']({},_0x510549,_0x276c31['options']);var _0x2b0d38={'where':_0x510549[_0x53d7('0x39')]};return db['Pause'][_0x53d7('0x1b')](_0x2b0d38)[_0x53d7('0x22')](function(_0x3bf8d9){_0x5611fc['count']=_0x3bf8d9;if(_0x276c31[_0x53d7('0x30')][_0x53d7('0x3e')]){_0x510549[_0x53d7('0x3f')]=[{'all':!![]}];}return db['Pause'][_0x53d7('0x40')](_0x510549);})[_0x53d7('0x22')](function(_0x56a89e){_0x5611fc['rows']=_0x56a89e;return _0x5611fc;})[_0x53d7('0x22')](respondWithFilteredResult(_0x48a766,_0x510549))['catch'](handleError(_0x48a766,null));};exports['show']=function(_0x5614e2,_0x1e5aa7){var _0x4443e3={'raw':!![],'where':{'id':_0x5614e2['params']['id']}},_0x4b5fc0={};_0x4b5fc0[_0x53d7('0x2e')]=_['keys'](db['Pause'][_0x53d7('0x2b')]);_0x4b5fc0['query']=_[_0x53d7('0x31')](_0x5614e2[_0x53d7('0x30')]);_0x4b5fc0['filters']=_[_0x53d7('0x34')](_0x4b5fc0['model'],_0x4b5fc0[_0x53d7('0x30')]);_0x4443e3[_0x53d7('0x33')]=_[_0x53d7('0x34')](_0x4b5fc0[_0x53d7('0x2e')],qs[_0x53d7('0x35')](_0x5614e2['query']['fields']));_0x4443e3[_0x53d7('0x33')]=_0x4443e3[_0x53d7('0x33')][_0x53d7('0x36')]?_0x4443e3[_0x53d7('0x33')]:_0x4b5fc0[_0x53d7('0x2e')];if(_0x5614e2[_0x53d7('0x30')][_0x53d7('0x3e')]){_0x4443e3['include']=[{'all':!![]}];}_0x4443e3=_['merge']({},_0x4443e3,_0x5614e2['options']);return db[_0x53d7('0x2a')][_0x53d7('0x41')](_0x4443e3)['then'](handleEntityNotFound(_0x1e5aa7,null))[_0x53d7('0x22')](respondWithResult(_0x1e5aa7,null))[_0x53d7('0x42')](handleError(_0x1e5aa7,null));};exports['create']=function(_0x10a2be,_0x13d875){return db[_0x53d7('0x2a')]['create'](_0x10a2be['body'],{})[_0x53d7('0x22')](function(_0x5a0d15){var _0x2d694f=_0x10a2be[_0x53d7('0x43')][_0x53d7('0x44')]({'plain':!![]});if(!_0x2d694f)throw new Error(_0x53d7('0x45'));if(_0x2d694f[_0x53d7('0x46')]===_0x53d7('0x43')){var _0x53267c=_0x5a0d15[_0x53d7('0x44')]({'plain':!![]});var _0x2ceb6d=_0x53d7('0x23');return db[_0x53d7('0x47')][_0x53d7('0x41')]({'where':{'name':_0x2ceb6d,'userProfileId':_0x2d694f[_0x53d7('0x48')]},'raw':!![]})[_0x53d7('0x22')](function(_0x43cad6){if(_0x43cad6&&_0x43cad6[_0x53d7('0x49')]===0x0){return db[_0x53d7('0x4a')]['create']({'name':_0x53267c[_0x53d7('0x27')],'resourceId':_0x53267c['id'],'type':_0x43cad6[_0x53d7('0x27')],'sectionId':_0x43cad6['id']},{})[_0x53d7('0x22')](function(){return _0x5a0d15;});}else{return _0x5a0d15;}})[_0x53d7('0x42')](function(_0x2a9ba7){logger['error'](_0x53d7('0x4b'),_0x2a9ba7);throw _0x2a9ba7;});}return _0x5a0d15;})['then'](respondWithResult(_0x13d875,0xc9))[_0x53d7('0x42')](handleError(_0x13d875,null));};exports['update']=function(_0x3d6a91,_0x285689){if(_0x3d6a91[_0x53d7('0x4c')]['id']){delete _0x3d6a91[_0x53d7('0x4c')]['id'];}return db['Pause'][_0x53d7('0x41')]({'where':{'id':_0x3d6a91[_0x53d7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x285689,null))['then'](saveUpdates(_0x3d6a91['body'],null))[_0x53d7('0x22')](respondWithResult(_0x285689,null))[_0x53d7('0x42')](handleError(_0x285689,null));};exports[_0x53d7('0x24')]=function(_0x517237,_0x4f4051){return db[_0x53d7('0x2a')][_0x53d7('0x41')]({'where':{'id':_0x517237[_0x53d7('0x4d')]['id']}})[_0x53d7('0x22')](handleEntityNotFound(_0x4f4051,null))[_0x53d7('0x22')](removeEntity(_0x4f4051,null))[_0x53d7('0x42')](handleError(_0x4f4051,null));}; \ No newline at end of file +var _0x843b=['rows','params','model','rawAttributes','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','end','error','stack','send','index','map','Pause','type','key','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x25f39c,_0x4f231a){var _0x19bb4a=function(_0x33feb5){while(--_0x33feb5){_0x25f39c['push'](_0x25f39c['shift']());}};_0x19bb4a(++_0x4f231a);}(_0x843b,0x1bd));var _0xb843=function(_0x481d0c,_0x23cadc){_0x481d0c=_0x481d0c-0x0;var _0x539a85=_0x843b[_0x481d0c];return _0x539a85;};'use strict';var emlformat=require(_0xb843('0x0'));var rimraf=require(_0xb843('0x1'));var zipdir=require(_0xb843('0x2'));var jsonpatch=require(_0xb843('0x3'));var rp=require(_0xb843('0x4'));var moment=require('moment');var BPromise=require(_0xb843('0x5'));var Mustache=require(_0xb843('0x6'));var util=require('util');var path=require(_0xb843('0x7'));var sox=require(_0xb843('0x8'));var csv=require(_0xb843('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb843('0xa'));var _=require(_0xb843('0xb'));var squel=require(_0xb843('0xc'));var crypto=require(_0xb843('0xd'));var jsforce=require(_0xb843('0xe'));var deskjs=require(_0xb843('0xf'));var toCsv=require(_0xb843('0x9'));var querystring=require('querystring');var Papa=require(_0xb843('0x10'));var Redis=require(_0xb843('0x11'));var authService=require(_0xb843('0x12'));var qs=require(_0xb843('0x13'));var as=require(_0xb843('0x14'));var hardwareService=require(_0xb843('0x15'));var logger=require('../../config/logger')(_0xb843('0x16'));var utils=require(_0xb843('0x17'));var config=require(_0xb843('0x18'));var licenseUtil=require(_0xb843('0x19'));var db=require(_0xb843('0x1a'))['db'];function respondWithStatusCode(_0x242dcf,_0x53a1b0){_0x53a1b0=_0x53a1b0||0xcc;return function(_0x22e0c1){if(_0x22e0c1){return _0x242dcf[_0xb843('0x1b')](_0x53a1b0);}return _0x242dcf[_0xb843('0x1c')](_0x53a1b0)['end']();};}function respondWithResult(_0x2aa9e5,_0x45c74e){_0x45c74e=_0x45c74e||0xc8;return function(_0x4aaae2){if(_0x4aaae2){return _0x2aa9e5[_0xb843('0x1c')](_0x45c74e)[_0xb843('0x1d')](_0x4aaae2);}};}function respondWithFilteredResult(_0x14e88d,_0x18a4c8){return function(_0x44d060){if(_0x44d060){var _0x481da2=typeof _0x18a4c8[_0xb843('0x1e')]===_0xb843('0x1f')&&typeof _0x18a4c8['limit']===_0xb843('0x1f');var _0xc1404a=_0x44d060['count'];var _0x1e4fed=_0x481da2?0x0:_0x18a4c8['offset'];var _0x3a3c67=_0x481da2?_0x44d060[_0xb843('0x20')]:_0x18a4c8[_0xb843('0x1e')]+_0x18a4c8[_0xb843('0x21')];var _0x30bb30;if(_0x3a3c67>=_0xc1404a){_0x3a3c67=_0xc1404a;_0x30bb30=0xc8;}else{_0x30bb30=0xce;}_0x14e88d[_0xb843('0x1c')](_0x30bb30);return _0x14e88d[_0xb843('0x22')]('Content-Range',_0x1e4fed+'-'+_0x3a3c67+'/'+_0xc1404a)['json'](_0x44d060);}return null;};}function patchUpdates(_0xcac0fd){return function(_0x115a85){try{jsonpatch[_0xb843('0x23')](_0x115a85,_0xcac0fd,!![]);}catch(_0x1105fd){return BPromise[_0xb843('0x24')](_0x1105fd);}return _0x115a85[_0xb843('0x25')]();};}function saveUpdates(_0x567f03,_0x1ec154){return function(_0x4c27ba){if(_0x4c27ba){return _0x4c27ba['update'](_0x567f03)[_0xb843('0x26')](function(_0x26b813){return _0x26b813;});}return null;};}function removeEntity(_0x15bb57,_0x59f2e1){return function(_0x2a5f61){if(_0x2a5f61){return _0x2a5f61[_0xb843('0x27')]()[_0xb843('0x26')](function(){var _0x4699a9=_0x2a5f61[_0xb843('0x28')]({'plain':!![]});var _0x42e1ec=_0xb843('0x29');return db[_0xb843('0x2a')][_0xb843('0x27')]({'where':{'type':_0x42e1ec,'resourceId':_0x4699a9['id']}})['then'](function(){return _0x2a5f61;});})[_0xb843('0x26')](function(){_0x15bb57['status'](0xcc)[_0xb843('0x2b')]();});}};}function handleEntityNotFound(_0x5ce13e,_0x3c6c00){return function(_0x4f6767){if(!_0x4f6767){_0x5ce13e['sendStatus'](0x194);}return _0x4f6767;};}function handleError(_0x473994,_0x5078ff){_0x5078ff=_0x5078ff||0x1f4;return function(_0x9a3961){logger[_0xb843('0x2c')](_0x9a3961[_0xb843('0x2d')]);if(_0x9a3961['name']){delete _0x9a3961['name'];}_0x473994['status'](_0x5078ff)[_0xb843('0x2e')](_0x9a3961);};}exports[_0xb843('0x2f')]=function(_0x24b0bb,_0x37e674){var _0x1ab878={},_0x142656={},_0x50abc7={'count':0x0,'rows':[]};var _0x4cebbf=_[_0xb843('0x30')](db[_0xb843('0x31')]['rawAttributes'],function(_0x3a7d5a){return{'name':_0x3a7d5a['fieldName'],'type':_0x3a7d5a[_0xb843('0x32')][_0xb843('0x33')]};});_0x142656['model']=_[_0xb843('0x30')](_0x4cebbf,_0xb843('0x34'));_0x142656[_0xb843('0x35')]=_[_0xb843('0x36')](_0x24b0bb[_0xb843('0x35')]);_0x142656[_0xb843('0x37')]=_[_0xb843('0x38')](_0x142656['model'],_0x142656[_0xb843('0x35')]);_0x1ab878[_0xb843('0x39')]=_[_0xb843('0x38')](_0x142656['model'],qs['fields'](_0x24b0bb[_0xb843('0x35')][_0xb843('0x3a')]));_0x1ab878[_0xb843('0x39')]=_0x1ab878[_0xb843('0x39')]['length']?_0x1ab878['attributes']:_0x142656['model'];if(!_0x24b0bb['query'][_0xb843('0x3b')](_0xb843('0x3c'))){_0x1ab878['limit']=qs[_0xb843('0x21')](_0x24b0bb[_0xb843('0x35')][_0xb843('0x21')]);_0x1ab878[_0xb843('0x1e')]=qs['offset'](_0x24b0bb[_0xb843('0x35')][_0xb843('0x1e')]);}_0x1ab878['order']=qs[_0xb843('0x3d')](_0x24b0bb[_0xb843('0x35')][_0xb843('0x3d')]);_0x1ab878['where']=qs[_0xb843('0x37')](_[_0xb843('0x3e')](_0x24b0bb[_0xb843('0x35')],_0x142656[_0xb843('0x37')]),_0x4cebbf);if(_0x24b0bb['query'][_0xb843('0x3f')]){_0x1ab878[_0xb843('0x40')]=_[_0xb843('0x41')](_0x1ab878[_0xb843('0x40')],{'$or':_[_0xb843('0x30')](_0x4cebbf,function(_0x918620){if(_0x918620[_0xb843('0x32')]!==_0xb843('0x42')){var _0x4d6013={};_0x4d6013[_0x918620['name']]={'$like':'%'+_0x24b0bb['query'][_0xb843('0x3f')]+'%'};return _0x4d6013;}})});}_0x1ab878=_[_0xb843('0x41')]({},_0x1ab878,_0x24b0bb[_0xb843('0x43')]);var _0xe80020={'where':_0x1ab878[_0xb843('0x40')]};return db[_0xb843('0x31')][_0xb843('0x20')](_0xe80020)['then'](function(_0x345779){_0x50abc7['count']=_0x345779;if(_0x24b0bb[_0xb843('0x35')][_0xb843('0x44')]){_0x1ab878[_0xb843('0x45')]=[{'all':!![]}];}return db[_0xb843('0x31')][_0xb843('0x46')](_0x1ab878);})['then'](function(_0xd097f1){_0x50abc7[_0xb843('0x47')]=_0xd097f1;return _0x50abc7;})['then'](respondWithFilteredResult(_0x37e674,_0x1ab878))['catch'](handleError(_0x37e674,null));};exports['show']=function(_0x34ee71,_0x124a48){var _0x148e50={'raw':!![],'where':{'id':_0x34ee71[_0xb843('0x48')]['id']}},_0x411cd1={};_0x411cd1[_0xb843('0x49')]=_[_0xb843('0x36')](db[_0xb843('0x31')][_0xb843('0x4a')]);_0x411cd1['query']=_[_0xb843('0x36')](_0x34ee71[_0xb843('0x35')]);_0x411cd1[_0xb843('0x37')]=_[_0xb843('0x38')](_0x411cd1[_0xb843('0x49')],_0x411cd1[_0xb843('0x35')]);_0x148e50[_0xb843('0x39')]=_['intersection'](_0x411cd1['model'],qs[_0xb843('0x3a')](_0x34ee71[_0xb843('0x35')][_0xb843('0x3a')]));_0x148e50[_0xb843('0x39')]=_0x148e50[_0xb843('0x39')][_0xb843('0x4b')]?_0x148e50['attributes']:_0x411cd1[_0xb843('0x49')];if(_0x34ee71[_0xb843('0x35')][_0xb843('0x44')]){_0x148e50[_0xb843('0x45')]=[{'all':!![]}];}_0x148e50=_[_0xb843('0x41')]({},_0x148e50,_0x34ee71[_0xb843('0x43')]);return db['Pause'][_0xb843('0x4c')](_0x148e50)[_0xb843('0x26')](handleEntityNotFound(_0x124a48,null))['then'](respondWithResult(_0x124a48,null))['catch'](handleError(_0x124a48,null));};exports[_0xb843('0x4d')]=function(_0x575780,_0x391123){return db[_0xb843('0x31')][_0xb843('0x4d')](_0x575780['body'],{})['then'](function(_0xbfdc9){var _0x5426f5=_0x575780[_0xb843('0x4e')][_0xb843('0x28')]({'plain':!![]});if(!_0x5426f5)throw new Error(_0xb843('0x4f'));if(_0x5426f5[_0xb843('0x50')]===_0xb843('0x4e')){var _0x10e948=_0xbfdc9[_0xb843('0x28')]({'plain':!![]});var _0x7ac24d='Pauses';return db[_0xb843('0x51')][_0xb843('0x4c')]({'where':{'name':_0x7ac24d,'userProfileId':_0x5426f5['userProfileId']},'raw':!![]})[_0xb843('0x26')](function(_0x38ac61){if(_0x38ac61&&_0x38ac61[_0xb843('0x52')]===0x0){return db[_0xb843('0x2a')]['create']({'name':_0x10e948[_0xb843('0x34')],'resourceId':_0x10e948['id'],'type':_0x38ac61[_0xb843('0x34')],'sectionId':_0x38ac61['id']},{})['then'](function(){return _0xbfdc9;});}else{return _0xbfdc9;}})[_0xb843('0x53')](function(_0x570e9d){logger[_0xb843('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x570e9d);throw _0x570e9d;});}return _0xbfdc9;})[_0xb843('0x26')](respondWithResult(_0x391123,0xc9))['catch'](handleError(_0x391123,null));};exports[_0xb843('0x54')]=function(_0x274670,_0x3e35c9){if(_0x274670[_0xb843('0x55')]['id']){delete _0x274670[_0xb843('0x55')]['id'];}return db[_0xb843('0x31')][_0xb843('0x4c')]({'where':{'id':_0x274670[_0xb843('0x48')]['id']}})[_0xb843('0x26')](handleEntityNotFound(_0x3e35c9,null))[_0xb843('0x26')](saveUpdates(_0x274670[_0xb843('0x55')],null))[_0xb843('0x26')](respondWithResult(_0x3e35c9,null))[_0xb843('0x53')](handleError(_0x3e35c9,null));};exports[_0xb843('0x27')]=function(_0x563f1d,_0x6eec3c){return db['Pause'][_0xb843('0x4c')]({'where':{'id':_0x563f1d['params']['id']}})[_0xb843('0x26')](handleEntityNotFound(_0x6eec3c,null))[_0xb843('0x26')](removeEntity(_0x6eec3c,null))[_0xb843('0x53')](handleError(_0x6eec3c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 2e88e87..2e4fd66 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 _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6aa7,0x178));var _0x76aa=function(_0xb0418b,_0x361e3f){_0xb0418b=_0xb0418b-0x0;var _0x59741c=_0x6aa7[_0xb0418b];return _0x59741c;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 7441cbf..62c0f35 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(_0xf3a270,_0x451676){var _0x202b57=function(_0x348a8e){while(--_0x348a8e){_0xf3a270['push'](_0xf3a270['shift']());}};_0x202b57(++_0x451676);}(_0x7a54,0x106));var _0x47a5=function(_0x25477b,_0x6380){_0x25477b=_0x25477b-0x0;var _0x20e367=_0x7a54[_0x25477b];return _0x20e367;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4e27d7,_0x125411){var _0x30d620=function(_0x5d990f){while(--_0x5d990f){_0x4e27d7['push'](_0x4e27d7['shift']());}};_0x30d620(++_0x125411);}(_0x7a54,0x106));var _0x47a5=function(_0x589622,_0x485fd3){_0x589622=_0x589622-0x0;var _0x359c94=_0x7a54[_0x589622];return _0x359c94;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 51560ec..4547375 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 _0x29d4=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','show','download','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','file','webhookPost','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x29d4,0x1a1));var _0x429d=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x29d4[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require(_0x429d('0x0'));var util=require('util');var path=require(_0x429d('0x1'));var timeout=require(_0x429d('0x2'));var express=require(_0x429d('0x3'));var router=express[_0x429d('0x4')]();var fs_extra=require(_0x429d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var controller=require(_0x429d('0x8'));router[_0x429d('0x9')]('/',auth[_0x429d('0xa')](),controller[_0x429d('0xb')]);router[_0x429d('0x9')](_0x429d('0xc'),controller['webhookGet']);router[_0x429d('0x9')]('/:id',auth[_0x429d('0xa')](),controller[_0x429d('0xd')]);router[_0x429d('0x9')]('/:id/download',auth[_0x429d('0xa')](),controller[_0x429d('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31ff87,_0x2fd1ca,_0x417f77){_0x417f77(null,path['join'](config[_0x429d('0xf')],_0x429d('0x10')));},'filename':function(_0x1d933b,_0x1cb1cf,_0x4843af){_0x1cb1cf[_0x429d('0x11')]=_0x1cb1cf[_0x429d('0x11')][_0x429d('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4843af(null,util['format'](_0x429d('0x13'),path[_0x429d('0x14')](_0x1cb1cf['originalname'],path[_0x429d('0x15')](_0x1cb1cf[_0x429d('0x11')])),Date[_0x429d('0x16')](),path[_0x429d('0x15')](_0x1cb1cf[_0x429d('0x11')])));}})});router[_0x429d('0x17')]('/',upload['single'](_0x429d('0x18')),controller['upload']);router[_0x429d('0x17')](_0x429d('0xc'),controller[_0x429d('0x19')]);router[_0x429d('0x1a')]('/:id',auth[_0x429d('0xa')](),controller[_0x429d('0x1b')]);router[_0x429d('0x1c')]('/:id',auth[_0x429d('0xa')](),controller[_0x429d('0x1c')]);module[_0x429d('0x1d')]=router; \ No newline at end of file +var _0xc978=['isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0xa3a2ce,_0x59fd36){var _0x2aeda4=function(_0x17e472){while(--_0x17e472){_0xa3a2ce['push'](_0xa3a2ce['shift']());}};_0x2aeda4(++_0x59fd36);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var path=require(_0x8c97('0x2'));var timeout=require(_0x8c97('0x3'));var express=require(_0x8c97('0x4'));var router=express[_0x8c97('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c97('0x6'));var interaction=require(_0x8c97('0x7'));var config=require(_0x8c97('0x8'));var controller=require(_0x8c97('0x9'));router[_0x8c97('0xa')]('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0xc')]);router['get'](_0x8c97('0xd'),controller[_0x8c97('0xe')]);router[_0x8c97('0xa')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x10')]);router[_0x8c97('0xa')]('/:id/download',auth[_0x8c97('0xb')](),controller[_0x8c97('0x11')]);var upload=multer({'storage':multer[_0x8c97('0x12')]({'destination':function(_0x3a34b2,_0x400eb6,_0x949a83){_0x949a83(null,path[_0x8c97('0x13')](config[_0x8c97('0x14')],_0x8c97('0x15')));},'filename':function(_0x5cf392,_0x44611a,_0x346274){_0x44611a['originalname']=_0x44611a[_0x8c97('0x16')][_0x8c97('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x346274(null,util['format'](_0x8c97('0x18'),path['basename'](_0x44611a['originalname'],path['extname'](_0x44611a[_0x8c97('0x16')])),Date[_0x8c97('0x19')](),path[_0x8c97('0x1a')](_0x44611a[_0x8c97('0x16')])));}})});router[_0x8c97('0x1b')]('/',upload[_0x8c97('0x1c')](_0x8c97('0x1d')),controller[_0x8c97('0x1e')]);router[_0x8c97('0x1b')]('/webhook',controller[_0x8c97('0x1f')]);router[_0x8c97('0x20')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x21')]);router[_0x8c97('0x22')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x22')]);module[_0x8c97('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index c67f0c5..b831ce9 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 _0x03ff=['STRING','sequelize','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x3b2a34,_0x55027c){var _0x3304cd=function(_0x22b55e){while(--_0x22b55e){_0x3b2a34['push'](_0x3b2a34['shift']());}};_0x3304cd(++_0x55027c);}(_0x03ff,0x91));var _0xf03f=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x03ff[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0xf03f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf03f('0x1')]('html',_0xf03f('0x2'))},'description':{'type':Sequelize[_0xf03f('0x3')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xf03f('0x4')},'active':{'type':Sequelize[_0xf03f('0x5')],'defaultValue':0x0,'comment':_0xf03f('0x6')},'sidebar':{'type':Sequelize[_0xf03f('0x1')](_0xf03f('0x7'),'agentOnly',_0xf03f('0x8'),_0xf03f('0x9')),'defaultValue':_0xf03f('0x8'),'comment':_0xf03f('0xa')},'icon':{'type':Sequelize[_0xf03f('0xb')]},'adminUrl':{'type':Sequelize[_0xf03f('0xb')]},'agentUrl':{'type':Sequelize[_0xf03f('0xb')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xf03f('0xb')]}}; \ No newline at end of file +var _0x21c0=['ENUM','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always'];(function(_0xfef3ae,_0x3b42bd){var _0x359233=function(_0x5a3aa4){while(--_0x5a3aa4){_0xfef3ae['push'](_0xfef3ae['shift']());}};_0x359233(++_0x3b42bd);}(_0x21c0,0x178));var _0x021c=function(_0x1d557d,_0xad4dce){_0x1d557d=_0x1d557d-0x0;var _0x3e9f09=_0x21c0[_0x1d557d];return _0x3e9f09;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x021c('0x0')]('html','script')},'description':{'type':Sequelize[_0x021c('0x1')]},'version':{'type':Sequelize[_0x021c('0x1')]},'path':{'type':Sequelize[_0x021c('0x2')],'comment':_0x021c('0x3')},'active':{'type':Sequelize[_0x021c('0x4')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x021c('0x0')](_0x021c('0x5'),_0x021c('0x6'),_0x021c('0x7'),'never'),'defaultValue':_0x021c('0x7'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x021c('0x2')]},'adminUrl':{'type':Sequelize[_0x021c('0x2')]},'agentUrl':{'type':Sequelize[_0x021c('0x2')]},'scriptName':{'type':Sequelize[_0x021c('0x2')]},'scriptPath':{'type':Sequelize[_0x021c('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index fd3d436..d29da92 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 _0x6135=['unlinkSync','Download\x20completed','Temporary\x20file\x20removed','filename','file','info','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','plugins','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','method','eml-format','rimraf','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','sendStatus','error','stack','send','map','Plugin','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','download','find','join','root','format','%s.zip','basename','path','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','close','Error','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin'];(function(_0x39bc06,_0x18d7ff){var _0x131143=function(_0x254f7f){while(--_0x254f7f){_0x39bc06['push'](_0x39bc06['shift']());}};_0x131143(++_0x18d7ff);}(_0x6135,0xec));var _0x5613=function(_0x13b7fd,_0x4eaf7f){_0x13b7fd=_0x13b7fd-0x0;var _0x32a74a=_0x6135[_0x13b7fd];return _0x32a74a;};'use strict';var emlformat=require(_0x5613('0x0'));var rimraf=require(_0x5613('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5613('0x2'));var moment=require(_0x5613('0x3'));var BPromise=require(_0x5613('0x4'));var Mustache=require(_0x5613('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5613('0x6'));var ejs=require(_0x5613('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5613('0x8'));var squel=require(_0x5613('0x9'));var crypto=require(_0x5613('0xa'));var jsforce=require(_0x5613('0xb'));var deskjs=require(_0x5613('0xc'));var toCsv=require(_0x5613('0x6'));var querystring=require(_0x5613('0xd'));var Papa=require('papaparse');var extract=require(_0x5613('0xe'));var rimraf=require(_0x5613('0x1'));var archiver=require(_0x5613('0xf'));var Redis=require(_0x5613('0x10'));var authService=require(_0x5613('0x11'));var qs=require(_0x5613('0x12'));var as=require(_0x5613('0x13'));var hardwareService=require(_0x5613('0x14'));var logger=require(_0x5613('0x15'))(_0x5613('0x16'));var utils=require(_0x5613('0x17'));var config=require(_0x5613('0x18'));var licenseUtil=require(_0x5613('0x19'));var db=require(_0x5613('0x1a'))['db'];config[_0x5613('0x1b')]=_[_0x5613('0x1c')](config[_0x5613('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5613('0x1d'))(new Redis(config['redis']));require('./plugin.socket')[_0x5613('0x1e')](socket);function respondWithStatusCode(_0xd45d4a,_0x57b296){_0x57b296=_0x57b296||0xcc;return function(_0x1dcd32){if(_0x1dcd32){return _0xd45d4a['sendStatus'](_0x57b296);}return _0xd45d4a[_0x5613('0x1f')](_0x57b296)[_0x5613('0x20')]();};}function respondWithResult(_0x1df674,_0x5ba712){_0x5ba712=_0x5ba712||0xc8;return function(_0x367f99){if(_0x367f99){return _0x1df674[_0x5613('0x1f')](_0x5ba712)[_0x5613('0x21')](_0x367f99);}};}function respondWithFilteredResult(_0x813b31,_0x1663a1){return function(_0x5c4790){if(_0x5c4790){var _0x132e78=typeof _0x1663a1[_0x5613('0x22')]===_0x5613('0x23')&&typeof _0x1663a1[_0x5613('0x24')]==='undefined';var _0x26afc2=_0x5c4790['count'];var _0x52d0c6=_0x132e78?0x0:_0x1663a1[_0x5613('0x22')];var _0x5f25a3=_0x132e78?_0x5c4790[_0x5613('0x25')]:_0x1663a1[_0x5613('0x22')]+_0x1663a1[_0x5613('0x24')];var _0x486357;if(_0x5f25a3>=_0x26afc2){_0x5f25a3=_0x26afc2;_0x486357=0xc8;}else{_0x486357=0xce;}_0x813b31[_0x5613('0x1f')](_0x486357);return _0x813b31[_0x5613('0x26')]('Content-Range',_0x52d0c6+'-'+_0x5f25a3+'/'+_0x26afc2)[_0x5613('0x21')](_0x5c4790);}return null;};}function patchUpdates(_0x3e7e02){return function(_0x4457a8){try{jsonpatch[_0x5613('0x27')](_0x4457a8,_0x3e7e02,!![]);}catch(_0x582e98){return BPromise[_0x5613('0x28')](_0x582e98);}return _0x4457a8[_0x5613('0x29')]();};}function saveUpdates(_0x47af08,_0x2a1922){return function(_0x55dd61){if(_0x55dd61){return _0x55dd61[_0x5613('0x2a')](_0x47af08)[_0x5613('0x2b')](function(_0x59b834){return _0x59b834;});}return null;};}function removeEntity(_0x6c0412,_0x5af2dd){return function(_0xb7fcde){if(_0xb7fcde){return _0xb7fcde[_0x5613('0x2c')]()['then'](function(){var _0x911f79=_0xb7fcde['get']({'plain':!![]});var _0xcb954f=_0x5613('0x2d');return db[_0x5613('0x2e')][_0x5613('0x2c')]({'where':{'type':_0xcb954f,'resourceId':_0x911f79['id']}})[_0x5613('0x2b')](function(){return _0xb7fcde;});})[_0x5613('0x2b')](function(){_0x6c0412[_0x5613('0x1f')](0xcc)[_0x5613('0x20')]();});}};}function handleEntityNotFound(_0x56682d,_0x589350){return function(_0xb36358){if(!_0xb36358){_0x56682d[_0x5613('0x2f')](0x194);}return _0xb36358;};}function handleError(_0x1d8148,_0x287101){_0x287101=_0x287101||0x1f4;return function(_0x10dd43){logger[_0x5613('0x30')](_0x10dd43[_0x5613('0x31')]);if(_0x10dd43['name']){delete _0x10dd43['name'];}_0x1d8148[_0x5613('0x1f')](_0x287101)[_0x5613('0x32')](_0x10dd43);};}exports['index']=function(_0xd9cb39,_0x1179c9){var _0xc37c7e={},_0x24ef08={},_0x3a78bd={'count':0x0,'rows':[]};var _0x37f4f3=_[_0x5613('0x33')](db[_0x5613('0x34')][_0x5613('0x35')],function(_0x4f9b0a){return{'name':_0x4f9b0a[_0x5613('0x36')],'type':_0x4f9b0a[_0x5613('0x37')]['key']};});_0x24ef08['model']=_[_0x5613('0x33')](_0x37f4f3,_0x5613('0x38'));_0x24ef08[_0x5613('0x39')]=_[_0x5613('0x3a')](_0xd9cb39[_0x5613('0x39')]);_0x24ef08[_0x5613('0x3b')]=_[_0x5613('0x3c')](_0x24ef08[_0x5613('0x3d')],_0x24ef08[_0x5613('0x39')]);_0xc37c7e['attributes']=_['intersection'](_0x24ef08['model'],qs[_0x5613('0x3e')](_0xd9cb39[_0x5613('0x39')][_0x5613('0x3e')]));_0xc37c7e[_0x5613('0x3f')]=_0xc37c7e[_0x5613('0x3f')][_0x5613('0x40')]?_0xc37c7e[_0x5613('0x3f')]:_0x24ef08[_0x5613('0x3d')];if(!_0xd9cb39[_0x5613('0x39')][_0x5613('0x41')](_0x5613('0x42'))){_0xc37c7e[_0x5613('0x24')]=qs[_0x5613('0x24')](_0xd9cb39[_0x5613('0x39')][_0x5613('0x24')]);_0xc37c7e[_0x5613('0x22')]=qs[_0x5613('0x22')](_0xd9cb39['query']['offset']);}_0xc37c7e[_0x5613('0x43')]=qs['sort'](_0xd9cb39[_0x5613('0x39')]['sort']);_0xc37c7e[_0x5613('0x44')]=qs[_0x5613('0x3b')](_[_0x5613('0x45')](_0xd9cb39[_0x5613('0x39')],_0x24ef08['filters']),_0x37f4f3);if(_0xd9cb39[_0x5613('0x39')][_0x5613('0x46')]){_0xc37c7e[_0x5613('0x44')]=_[_0x5613('0x47')](_0xc37c7e[_0x5613('0x44')],{'$or':_[_0x5613('0x33')](_0x37f4f3,function(_0x189754){if(_0x189754[_0x5613('0x37')]!==_0x5613('0x48')){var _0x2500f7={};_0x2500f7[_0x189754[_0x5613('0x38')]]={'$like':'%'+_0xd9cb39[_0x5613('0x39')][_0x5613('0x46')]+'%'};return _0x2500f7;}})});}_0xc37c7e=_[_0x5613('0x47')]({},_0xc37c7e,_0xd9cb39[_0x5613('0x49')]);var _0x39bbc6={'where':_0xc37c7e[_0x5613('0x44')]};return db[_0x5613('0x34')][_0x5613('0x25')](_0x39bbc6)[_0x5613('0x2b')](function(_0x4c8937){_0x3a78bd[_0x5613('0x25')]=_0x4c8937;if(_0xd9cb39[_0x5613('0x39')]['includeAll']){_0xc37c7e[_0x5613('0x4a')]=[{'all':!![]}];}return db[_0x5613('0x34')][_0x5613('0x4b')](_0xc37c7e);})['then'](function(_0x33d5e8){_0x3a78bd['rows']=_0x33d5e8;return _0x3a78bd;})[_0x5613('0x2b')](respondWithFilteredResult(_0x1179c9,_0xc37c7e))[_0x5613('0x4c')](handleError(_0x1179c9,null));};exports[_0x5613('0x4d')]=function(_0x298130,_0x7cea82){var _0xae908c={'raw':!![],'where':{'id':_0x298130[_0x5613('0x4e')]['id']}},_0x4e1818={};_0x4e1818[_0x5613('0x3d')]=_[_0x5613('0x3a')](db['Plugin']['rawAttributes']);_0x4e1818[_0x5613('0x39')]=_[_0x5613('0x3a')](_0x298130['query']);_0x4e1818[_0x5613('0x3b')]=_[_0x5613('0x3c')](_0x4e1818[_0x5613('0x3d')],_0x4e1818[_0x5613('0x39')]);_0xae908c[_0x5613('0x3f')]=_[_0x5613('0x3c')](_0x4e1818[_0x5613('0x3d')],qs[_0x5613('0x3e')](_0x298130[_0x5613('0x39')]['fields']));_0xae908c[_0x5613('0x3f')]=_0xae908c[_0x5613('0x3f')][_0x5613('0x40')]?_0xae908c['attributes']:_0x4e1818['model'];if(_0x298130[_0x5613('0x39')][_0x5613('0x4f')]){_0xae908c['include']=[{'all':!![]}];}_0xae908c=_[_0x5613('0x47')]({},_0xae908c,_0x298130[_0x5613('0x49')]);return db[_0x5613('0x34')]['find'](_0xae908c)[_0x5613('0x2b')](handleEntityNotFound(_0x7cea82,null))[_0x5613('0x2b')](respondWithResult(_0x7cea82,null))[_0x5613('0x4c')](handleError(_0x7cea82,null));};exports[_0x5613('0x50')]=function(_0xf78b5f,_0x312b2f,_0x37b168){return db['Plugin'][_0x5613('0x51')]({'where':{'id':_0xf78b5f[_0x5613('0x4e')]['id']},'attributes':['name','path'],'raw':!![]})[_0x5613('0x2b')](handleEntityNotFound(_0x312b2f,null))['then'](function(_0x4d88b4){if(_0x4d88b4){var _0x5d30d2=path[_0x5613('0x52')](config[_0x5613('0x53')],'server/files/plugins',util[_0x5613('0x54')](_0x5613('0x55'),path[_0x5613('0x56')](_0x4d88b4[_0x5613('0x57')])));var _0x42b726=fs[_0x5613('0x58')](_0x5d30d2);var _0x172bf6=archiver(_0x5613('0x59'),{'zlib':{'level':0x9}});_0x172bf6['on'](_0x5613('0x5a'),function(_0x43fc9d){if(_0x43fc9d[_0x5613('0x5b')]===_0x5613('0x5c')){logger[_0x5613('0x30')](_0x43fc9d);}else{throw new db[(_0x5613('0x5d'))]['Error'](_0x5613('0x5e'));}});_0x172bf6['on'](_0x5613('0x30'),function(_0x20cd5b){throw new db[(_0x5613('0x5d'))]['Error'](_0x5613('0x5e'));});_0x172bf6[_0x5613('0x5f')](_0x42b726);_0x172bf6[_0x5613('0x60')](_0x5613('0x61'),{'cwd':path['join'](config['root'],_0x5613('0x62'),path[_0x5613('0x63')](_0x4d88b4['path'])),'ignore':[path[_0x5613('0x52')](path[_0x5613('0x56')](_0x4d88b4[_0x5613('0x57')]),'node_modules/**/*'),path['join'](path[_0x5613('0x56')](_0x4d88b4[_0x5613('0x57')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x42b726['on'](_0x5613('0x64'),function(){if(!fs['existsSync'](_0x5d30d2)){throw new db[(_0x5613('0x5d'))][(_0x5613('0x65'))](_0x5613('0x66'));}return _0x312b2f[_0x5613('0x50')](_0x5d30d2,util[_0x5613('0x54')]('%s.zip',path[_0x5613('0x56')](_0x4d88b4[_0x5613('0x57')])),function(_0x523283){if(_0x523283){throw new db[(_0x5613('0x5d'))][(_0x5613('0x65'))](_0x5613('0x67'));}fs[_0x5613('0x68')](_0x5d30d2);logger['info'](_0x5613('0x69'));logger['info'](_0x5613('0x6a'));});});}return null;})[_0x5613('0x4c')](handleError(_0x312b2f,null));};exports['upload']=function(_0x16a529,_0x3dd051,_0x143d43){var _0x20b8d2=path[_0x5613('0x56')](_0x16a529['file'][_0x5613('0x6b')],path['extname'](_0x16a529['file']['filename']));var _0x55db1e=path[_0x5613('0x52')](config[_0x5613('0x53')],_0x5613('0x62'),_0x16a529[_0x5613('0x6c')][_0x5613('0x6b')]);var _0x236233=path[_0x5613('0x52')](config[_0x5613('0x53')],_0x5613('0x62'),_0x20b8d2);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x55db1e);logger[_0x5613('0x6d')](_0x5613('0x6e'),_0x236233);try{fs['chmodSync'](_0x55db1e,parseInt(_0x5613('0x6f'),0x8));extract(_0x55db1e,{'dir':_0x236233},function(_0x5c90cf){if(_0x5c90cf){logger[_0x5613('0x30')](_0x5c90cf);handleError(_0x5c90cf,!![]);};var _0x32d23f=fs[_0x5613('0x70')](_0x236233);if(_0x32d23f[_0x5613('0x40')]>0x1){removeReferences(_0x55db1e,_0x236233);logger[_0x5613('0x30')](_0x5613('0x71'));return _0x143d43(new Error(_0x5613('0x71')));}var _0x39ee17=fs[_0x5613('0x72')](path[_0x5613('0x52')](_0x236233,_0x32d23f[0x0]));if(_0x39ee17[_0x5613('0x73')]()){removeReferences(_0x55db1e,_0x236233);logger[_0x5613('0x30')]('Invalid\x20plugin\x20structure');return _0x143d43(new Error(_0x5613('0x71')));}if(_0x39ee17[_0x5613('0x74')]()){var _0x539e3c=fs[_0x5613('0x70')](path[_0x5613('0x52')](_0x236233,_0x32d23f[0x0]));if(_0x539e3c[_0x5613('0x40')]===0x0){removeReferences(_0x55db1e,_0x236233);logger['error'](_0x5613('0x71'));return _0x143d43(new Error(_0x5613('0x71')));}var _0x591aca=_0x539e3c['some'](function(_0x248d57){return _0x248d57===_0x5613('0x75');});if(!_0x591aca){return _0x143d43(new Error(_0x5613('0x76')));}var _0x17bf39=fs[_0x5613('0x77')](path['join'](_0x236233,_0x32d23f[0x0],'manifest.json'));var _0x3d3536=JSON[_0x5613('0x78')](_0x17bf39);if(_0x5613('0x23')==typeof _0x3d3536[_0x5613('0x38')]){return _0x143d43(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x5613('0x23')==typeof _0x3d3536[_0x5613('0x37')]){return _0x143d43(new Error(_0x5613('0x79')));}if(_0x5613('0x23')==typeof _0x3d3536['version']){return _0x143d43(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x5613('0x23')==typeof _0x3d3536[_0x5613('0x7a')]){return _0x143d43(new Error(_0x5613('0x7b')));}if(_0x3d3536[_0x5613('0x37')]===_0x5613('0x7c')){if(_0x5613('0x23')==typeof _0x3d3536['parameters'][_0x5613('0x7d')]){return _0x143d43(new Error(_0x5613('0x7e')));}if(_0x5613('0x23')==typeof _0x3d3536[_0x5613('0x7a')]['views'][_0x5613('0x7f')]&&_0x5613('0x23')==typeof _0x3d3536[_0x5613('0x7a')]['views'][_0x5613('0x80')]){return _0x143d43(new Error(_0x5613('0x81')));}}else if(_0x3d3536['type']===_0x5613('0x82')){if(_0x5613('0x23')==typeof _0x3d3536['parameters'][_0x5613('0x83')]){return _0x143d43(new Error(_0x5613('0x84')));}if(_0x5613('0x23')==typeof _0x3d3536['parameters'][_0x5613('0x85')]){return _0x143d43(new Error(_0x5613('0x86')));}}else{return _0x143d43(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x299682=_0x3d3536[_0x5613('0x38')];var _0x481ee6=_0x3d3536[_0x5613('0x87')];var _0x529762=_0x3d3536[_0x5613('0x37')];var _0x49c9ff=_0x3d3536[_0x5613('0x88')]?_0x3d3536['sidebar']:'always';var _0x2cd151=_0x3d3536[_0x5613('0x89')]?_0x3d3536[_0x5613('0x89')]:_0x5613('0x8a');var _0x548a3f='';var _0x4a6114='';var _0x1e9233='';var _0x94c523='';var _0x216c64=_0x3d3536[_0x5613('0x8b')];if(_0x529762===_0x5613('0x7c')){if('undefined'!=typeof _0x3d3536['parameters'][_0x5613('0x7d')][_0x5613('0x7f')]){var _0x5df3b5=_0x3d3536['parameters'][_0x5613('0x7d')][_0x5613('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x5613('0x8c')](_0x5df3b5)){_0x548a3f=path[_0x5613('0x52')]('plugins',_0x20b8d2,_0x32d23f[0x0],_0x5df3b5);}else{_0x548a3f=_0x5df3b5;}}else{logger[_0x5613('0x6d')](_0x5613('0x8d'));}if(_0x5613('0x23')!=typeof _0x3d3536[_0x5613('0x7a')]['views'][_0x5613('0x80')]){var _0x16f8d4=_0x3d3536[_0x5613('0x7a')][_0x5613('0x7d')][_0x5613('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x5613('0x8c')](_0x16f8d4)){_0x4a6114=path[_0x5613('0x52')]('plugins',_0x20b8d2,_0x32d23f[0x0],_0x16f8d4);}else{_0x4a6114=_0x16f8d4;}}else{logger[_0x5613('0x6d')](_0x5613('0x8e'));}}else if(_0x529762===_0x5613('0x82')){_0x1e9233=_0x3d3536['parameters']['scriptName'];_0x94c523=_0x3d3536[_0x5613('0x7a')][_0x5613('0x85')];if(_0x5613('0x23')!=typeof _0x3d3536[_0x5613('0x7a')]['views']){if(_0x5613('0x23')!=typeof _0x3d3536['parameters'][_0x5613('0x7d')][_0x5613('0x7f')]){var _0x5df3b5=_0x3d3536['parameters']['views'][_0x5613('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x5613('0x8c')](_0x5df3b5)){_0x548a3f=path['join'](_0x5613('0x8f'),_0x20b8d2,_0x32d23f[0x0],_0x5df3b5);}else{_0x548a3f=_0x5df3b5;}}if(_0x5613('0x23')!=typeof _0x3d3536[_0x5613('0x7a')][_0x5613('0x7d')][_0x5613('0x80')]){var _0x16f8d4=_0x3d3536[_0x5613('0x7a')][_0x5613('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x5613('0x8c')](_0x16f8d4)){_0x4a6114=path[_0x5613('0x52')]('plugins',_0x20b8d2,_0x32d23f[0x0],_0x16f8d4);}else{_0x4a6114=_0x16f8d4;}}}}var _0x4b0cd8={'name':_0x299682,'description':_0x481ee6,'path':path[_0x5613('0x52')](_0x20b8d2,_0x32d23f[0x0]),'type':_0x529762,'sidebar':_0x49c9ff,'icon':_0x2cd151,'adminUrl':_0x548a3f,'agentUrl':_0x4a6114,'scriptName':_0x1e9233,'scriptPath':_0x94c523,'version':_0x216c64};removeReferences(_0x55db1e,null);return db[_0x5613('0x34')][_0x5613('0x90')](_0x4b0cd8)[_0x5613('0x2b')](function(_0x55b774){var _0x188107={'role':_0x16a529[_0x5613('0x91')][_0x5613('0x92')],'userProfileId':_0x16a529[_0x5613('0x91')][_0x5613('0x93')]};if(!_0x188107)throw new Error(_0x5613('0x94'));if(_0x188107['role']===_0x5613('0x95')){var _0x3d039f=_0x55b774['get']({'plain':!![]});return db[_0x5613('0x96')][_0x5613('0x51')]({'where':{'name':'Plugins','userProfileId':_0x188107[_0x5613('0x93')]},'raw':!![]})[_0x5613('0x2b')](function(_0x4c4e5c){if(_0x4c4e5c&&_0x4c4e5c[_0x5613('0x97')]===0x0){return db[_0x5613('0x2e')][_0x5613('0x90')]({'name':_0x3d039f[_0x5613('0x38')],'resourceId':_0x3d039f['id'],'type':_0x4c4e5c[_0x5613('0x38')],'sectionId':_0x4c4e5c['id']},{})[_0x5613('0x2b')](function(){return _0x55b774;});}else{return _0x55b774;}})[_0x5613('0x4c')](function(_0x26a600){logger[_0x5613('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26a600);throw _0x26a600;});}return _0x55b774;})['then'](respondWithResult(_0x3dd051,null))[_0x5613('0x4c')](handleError(_0x3dd051,null));}});}catch(_0x4f1ad1){_0x3dd051['status'](0x1f4)[_0x5613('0x32')](_0x4f1ad1);}};function removeReferences(_0x1a0320,_0x55d7c9){try{if(_0x1a0320){fs[_0x5613('0x68')](_0x1a0320);logger[_0x5613('0x6d')](_0x5613('0x98'));}if(_0x55d7c9){rimraf(_0x55d7c9,function(){});logger[_0x5613('0x6d')](_0x5613('0x99'));}}catch(_0x34d628){logger['error'](_0x34d628);}}exports[_0x5613('0x2a')]=function(_0x1d21df,_0x46aee0,_0x369b15){return db[_0x5613('0x34')][_0x5613('0x51')]({'where':{'id':_0x1d21df['params']['id']}})[_0x5613('0x2b')](handleEntityNotFound(_0x46aee0,null))['then'](saveUpdates(_0x1d21df[_0x5613('0x91')],null))[_0x5613('0x2b')](respondWithResult(_0x46aee0,null))[_0x5613('0x4c')](handleError(_0x46aee0,null));};exports[_0x5613('0x9a')]=function(_0x318d58,_0x4a7aa3,_0x38c1ed){return db[_0x5613('0x34')]['find']({'where':{'id':_0x318d58['params']['id']}})[_0x5613('0x2b')](function(_0x5c1e60){if(_0x5c1e60){return _0x5c1e60[_0x5613('0x2c')]();}})['then'](function(_0x275d87){rimraf(path[_0x5613('0x52')](config[_0x5613('0x53')],_0x5613('0x62'),path[_0x5613('0x63')](_0x275d87['path'])),function(){});return _0x275d87;})[_0x5613('0x2b')](handleEntityNotFound(_0x4a7aa3,null))[_0x5613('0x2b')](respondWithStatusCode(_0x4a7aa3,null))[_0x5613('0x4c')](handleError(_0x4a7aa3,null));};exports['webhookGet']=function(_0x55dcc0,_0x1d61ba,_0x5d0682){return BPromise[_0x5613('0x9b')]()[_0x5613('0x2b')](function(){if(!_0x55dcc0[_0x5613('0x39')][_0x5613('0x57')]){throw new Error(_0x5613('0x9c'));}if(!_0x55dcc0[_0x5613('0x39')][_0x5613('0x9d')]){throw new Error(_0x5613('0x9e'));}var _0x4784a1=_0x55dcc0[_0x5613('0x39')][_0x5613('0x9f')]?_0x55dcc0[_0x5613('0x39')][_0x5613('0x9f')]+':'+_0x55dcc0[_0x5613('0x39')][_0x5613('0x9d')]:_0x5613('0xa0')+_0x55dcc0['query'][_0x5613('0x9d')];var _0x225818=_0x55dcc0[_0x5613('0x39')]['json']?_0x55dcc0[_0x5613('0x39')][_0x5613('0x21')]:!![];var _0x37cc62=_0x55dcc0['query'][_0x5613('0xa1')]?_0x55dcc0[_0x5613('0x39')][_0x5613('0xa1')]:null;var _0x34cc95={'method':_0x55dcc0['method'],'uri':util[_0x5613('0x54')](_0x5613('0xa2'),_0x4784a1,_0x55dcc0[_0x5613('0x39')][_0x5613('0x57')]),'json':_0x225818,'resolveWithFullResponse':!![],'encoding':_0x37cc62,'qs':_0x55dcc0[_0x5613('0x39')]};if(_0x55dcc0[_0x5613('0xa3')]){_0x34cc95[_0x5613('0xa3')]=_0x55dcc0[_0x5613('0xa3')];if(_0x34cc95[_0x5613('0xa3')][_0x5613('0xa4')]){delete _0x34cc95['headers'][_0x5613('0xa4')];}}if(_0x34cc95[_0x5613('0xa3')][_0x5613('0xa5')]){delete _0x34cc95[_0x5613('0xa3')][_0x5613('0xa5')];}return rp(_0x34cc95);})[_0x5613('0x2b')](function(_0x1bb4d9){if(_0x1bb4d9){_0x1d61ba[_0x5613('0x26')](_0x1bb4d9[_0x5613('0xa3')]);logger['info'](_0x1bb4d9[_0x5613('0x91')]);if(_[_0x5613('0xa6')](_0x55dcc0[_0x5613('0x39')][_0x5613('0x57')],_0x5613('0x50'))&&_0x1bb4d9[_0x5613('0xa7')]==0x1f4){return _0x1d61ba['sendStatus'](_0x1bb4d9[_0x5613('0xa7')]);}else{return _0x1d61ba[_0x5613('0x1f')](_0x1bb4d9[_0x5613('0xa7')])[_0x5613('0x32')](_0x1bb4d9[_0x5613('0x91')]);}}else{return _0x1d61ba['sendStatus'](0xc8);}})['catch'](handleError(_0x1d61ba,null));};exports[_0x5613('0xa8')]=function(_0x5249c4,_0x5b7522,_0x452e57){return BPromise['resolve']()[_0x5613('0x2b')](function(){if(!_0x5249c4['query'][_0x5613('0x57')]){throw new Error(_0x5613('0x9c'));}if(!_0x5249c4[_0x5613('0x39')][_0x5613('0x9d')]){throw new Error(_0x5613('0x9e'));}var _0x193796=_0x5249c4[_0x5613('0x39')][_0x5613('0x9f')]?_0x5249c4[_0x5613('0x39')][_0x5613('0x9f')]+':'+_0x5249c4['query'][_0x5613('0x9d')]:'http://localhost:'+_0x5249c4[_0x5613('0x39')]['port'];var _0x544286=_0x5249c4[_0x5613('0x39')]['json']?_0x5249c4[_0x5613('0x39')][_0x5613('0x21')]:!![];var _0x21177d=_0x5249c4[_0x5613('0x39')][_0x5613('0xa1')]?_0x5249c4[_0x5613('0x39')][_0x5613('0xa1')]:null;var _0x3195f8={'method':_0x5249c4[_0x5613('0xa9')],'uri':util[_0x5613('0x54')](_0x5613('0xa2'),_0x193796,_0x5249c4[_0x5613('0x39')][_0x5613('0x57')]),'json':_0x544286,'resolveWithFullResponse':!![],'encoding':_0x21177d,'body':_0x5249c4[_0x5613('0x91')]};if(_0x5249c4[_0x5613('0xa3')]){_0x3195f8[_0x5613('0xa3')]=_0x5249c4[_0x5613('0xa3')];if(_0x3195f8[_0x5613('0xa3')]['content-length']){delete _0x3195f8[_0x5613('0xa3')][_0x5613('0xa4')];}}if(_0x3195f8[_0x5613('0xa3')][_0x5613('0xa5')]){delete _0x3195f8[_0x5613('0xa3')][_0x5613('0xa5')];}return rp(_0x3195f8);})[_0x5613('0x2b')](function(_0x34873a){if(_0x34873a){_0x5b7522['set'](_0x34873a[_0x5613('0xa3')]);logger[_0x5613('0x6d')](_0x34873a[_0x5613('0x91')]);return _0x5b7522['status'](_0x34873a[_0x5613('0xa7')])['send'](_0x34873a[_0x5613('0x91')]);}else{return _0x5b7522[_0x5613('0x2f')](0xc8);}})[_0x5613('0x4c')](handleError(_0x5b7522,null));}; \ No newline at end of file +var _0xc974=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','find','server/files/plugins','format','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','download','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','isFile','isDirectory','readdirSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','get','Plugins','UserProfileResource','destroy','error','stack','name','send','index','map','Plugin','fieldName','key','query','keys','intersection'];(function(_0x1884cd,_0x3f80a4){var _0x576772=function(_0x387edb){while(--_0x387edb){_0x1884cd['push'](_0x1884cd['shift']());}};_0x576772(++_0x3f80a4);}(_0xc974,0x1cb));var _0x4c97=function(_0x10aca4,_0x48f809){_0x10aca4=_0x10aca4-0x0;var _0x1f5889=_0xc974[_0x10aca4];return _0x1f5889;};'use strict';var emlformat=require(_0x4c97('0x0'));var rimraf=require(_0x4c97('0x1'));var zipdir=require(_0x4c97('0x2'));var jsonpatch=require(_0x4c97('0x3'));var rp=require('request-promise');var moment=require(_0x4c97('0x4'));var BPromise=require(_0x4c97('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4c97('0x6'));var sox=require('sox');var csv=require(_0x4c97('0x7'));var ejs=require(_0x4c97('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c97('0x9'));var squel=require(_0x4c97('0xa'));var crypto=require(_0x4c97('0xb'));var jsforce=require(_0x4c97('0xc'));var deskjs=require(_0x4c97('0xd'));var toCsv=require(_0x4c97('0x7'));var querystring=require(_0x4c97('0xe'));var Papa=require('papaparse');var extract=require(_0x4c97('0xf'));var rimraf=require(_0x4c97('0x1'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x4c97('0x10'));var qs=require(_0x4c97('0x11'));var as=require(_0x4c97('0x12'));var hardwareService=require(_0x4c97('0x13'));var logger=require(_0x4c97('0x14'))('api');var utils=require(_0x4c97('0x15'));var config=require(_0x4c97('0x16'));var licenseUtil=require(_0x4c97('0x17'));var db=require(_0x4c97('0x18'))['db'];config['redis']=_[_0x4c97('0x19')](config[_0x4c97('0x1a')],{'host':_0x4c97('0x1b'),'port':0x18eb});var socket=require(_0x4c97('0x1c'))(new Redis(config[_0x4c97('0x1a')]));require(_0x4c97('0x1d'))[_0x4c97('0x1e')](socket);function respondWithStatusCode(_0x331daf,_0x53f7f9){_0x53f7f9=_0x53f7f9||0xcc;return function(_0x285b07){if(_0x285b07){return _0x331daf[_0x4c97('0x1f')](_0x53f7f9);}return _0x331daf[_0x4c97('0x20')](_0x53f7f9)[_0x4c97('0x21')]();};}function respondWithResult(_0x5bc317,_0x441c67){_0x441c67=_0x441c67||0xc8;return function(_0x4217f0){if(_0x4217f0){return _0x5bc317[_0x4c97('0x20')](_0x441c67)[_0x4c97('0x22')](_0x4217f0);}};}function respondWithFilteredResult(_0x570f60,_0x109e31){return function(_0x3ed88d){if(_0x3ed88d){var _0x495f2c=typeof _0x109e31['offset']===_0x4c97('0x23')&&typeof _0x109e31[_0x4c97('0x24')]===_0x4c97('0x23');var _0x213c0d=_0x3ed88d[_0x4c97('0x25')];var _0x174aa7=_0x495f2c?0x0:_0x109e31[_0x4c97('0x26')];var _0x51ce7b=_0x495f2c?_0x3ed88d[_0x4c97('0x25')]:_0x109e31[_0x4c97('0x26')]+_0x109e31[_0x4c97('0x24')];var _0x5b9cc3;if(_0x51ce7b>=_0x213c0d){_0x51ce7b=_0x213c0d;_0x5b9cc3=0xc8;}else{_0x5b9cc3=0xce;}_0x570f60[_0x4c97('0x20')](_0x5b9cc3);return _0x570f60[_0x4c97('0x27')]('Content-Range',_0x174aa7+'-'+_0x51ce7b+'/'+_0x213c0d)[_0x4c97('0x22')](_0x3ed88d);}return null;};}function patchUpdates(_0xf45a61){return function(_0x4a308b){try{jsonpatch['apply'](_0x4a308b,_0xf45a61,!![]);}catch(_0x48279c){return BPromise[_0x4c97('0x28')](_0x48279c);}return _0x4a308b[_0x4c97('0x29')]();};}function saveUpdates(_0x1623b1,_0x144a5d){return function(_0x14dbc2){if(_0x14dbc2){return _0x14dbc2[_0x4c97('0x2a')](_0x1623b1)[_0x4c97('0x2b')](function(_0x54bb12){return _0x54bb12;});}return null;};}function removeEntity(_0x208a15,_0x30c68a){return function(_0x63178a){if(_0x63178a){return _0x63178a['destroy']()[_0x4c97('0x2b')](function(){var _0x57e036=_0x63178a[_0x4c97('0x2c')]({'plain':!![]});var _0x33889a=_0x4c97('0x2d');return db[_0x4c97('0x2e')][_0x4c97('0x2f')]({'where':{'type':_0x33889a,'resourceId':_0x57e036['id']}})[_0x4c97('0x2b')](function(){return _0x63178a;});})[_0x4c97('0x2b')](function(){_0x208a15[_0x4c97('0x20')](0xcc)[_0x4c97('0x21')]();});}};}function handleEntityNotFound(_0x219db2,_0x54e6a9){return function(_0x4fbfa7){if(!_0x4fbfa7){_0x219db2[_0x4c97('0x1f')](0x194);}return _0x4fbfa7;};}function handleError(_0x19e3e8,_0x585b84){_0x585b84=_0x585b84||0x1f4;return function(_0x3e3c27){logger[_0x4c97('0x30')](_0x3e3c27[_0x4c97('0x31')]);if(_0x3e3c27[_0x4c97('0x32')]){delete _0x3e3c27[_0x4c97('0x32')];}_0x19e3e8['status'](_0x585b84)[_0x4c97('0x33')](_0x3e3c27);};}exports[_0x4c97('0x34')]=function(_0x4af2be,_0x4f4abb){var _0x31cf80={},_0x3315de={},_0x320668={'count':0x0,'rows':[]};var _0x34a22b=_[_0x4c97('0x35')](db[_0x4c97('0x36')]['rawAttributes'],function(_0x2422a0){return{'name':_0x2422a0[_0x4c97('0x37')],'type':_0x2422a0['type'][_0x4c97('0x38')]};});_0x3315de['model']=_['map'](_0x34a22b,'name');_0x3315de[_0x4c97('0x39')]=_[_0x4c97('0x3a')](_0x4af2be[_0x4c97('0x39')]);_0x3315de['filters']=_[_0x4c97('0x3b')](_0x3315de[_0x4c97('0x3c')],_0x3315de[_0x4c97('0x39')]);_0x31cf80[_0x4c97('0x3d')]=_['intersection'](_0x3315de['model'],qs[_0x4c97('0x3e')](_0x4af2be[_0x4c97('0x39')][_0x4c97('0x3e')]));_0x31cf80[_0x4c97('0x3d')]=_0x31cf80[_0x4c97('0x3d')][_0x4c97('0x3f')]?_0x31cf80[_0x4c97('0x3d')]:_0x3315de['model'];if(!_0x4af2be[_0x4c97('0x39')][_0x4c97('0x40')](_0x4c97('0x41'))){_0x31cf80[_0x4c97('0x24')]=qs[_0x4c97('0x24')](_0x4af2be[_0x4c97('0x39')][_0x4c97('0x24')]);_0x31cf80['offset']=qs[_0x4c97('0x26')](_0x4af2be[_0x4c97('0x39')][_0x4c97('0x26')]);}_0x31cf80[_0x4c97('0x42')]=qs['sort'](_0x4af2be[_0x4c97('0x39')][_0x4c97('0x43')]);_0x31cf80[_0x4c97('0x44')]=qs[_0x4c97('0x45')](_[_0x4c97('0x46')](_0x4af2be[_0x4c97('0x39')],_0x3315de['filters']),_0x34a22b);if(_0x4af2be['query'][_0x4c97('0x47')]){_0x31cf80[_0x4c97('0x44')]=_['merge'](_0x31cf80[_0x4c97('0x44')],{'$or':_['map'](_0x34a22b,function(_0x54fa1f){if(_0x54fa1f[_0x4c97('0x48')]!==_0x4c97('0x49')){var _0x2dda6e={};_0x2dda6e[_0x54fa1f[_0x4c97('0x32')]]={'$like':'%'+_0x4af2be[_0x4c97('0x39')]['filter']+'%'};return _0x2dda6e;}})});}_0x31cf80=_[_0x4c97('0x4a')]({},_0x31cf80,_0x4af2be['options']);var _0x498c0e={'where':_0x31cf80['where']};return db[_0x4c97('0x36')][_0x4c97('0x25')](_0x498c0e)['then'](function(_0x1a131b){_0x320668[_0x4c97('0x25')]=_0x1a131b;if(_0x4af2be[_0x4c97('0x39')][_0x4c97('0x4b')]){_0x31cf80[_0x4c97('0x4c')]=[{'all':!![]}];}return db['Plugin'][_0x4c97('0x4d')](_0x31cf80);})[_0x4c97('0x2b')](function(_0x634021){_0x320668[_0x4c97('0x4e')]=_0x634021;return _0x320668;})[_0x4c97('0x2b')](respondWithFilteredResult(_0x4f4abb,_0x31cf80))[_0x4c97('0x4f')](handleError(_0x4f4abb,null));};exports[_0x4c97('0x50')]=function(_0x299e78,_0x51b4e1){var _0x5dc868={'raw':!![],'where':{'id':_0x299e78[_0x4c97('0x51')]['id']}},_0x278e05={};_0x278e05[_0x4c97('0x3c')]=_['keys'](db[_0x4c97('0x36')]['rawAttributes']);_0x278e05['query']=_[_0x4c97('0x3a')](_0x299e78[_0x4c97('0x39')]);_0x278e05[_0x4c97('0x45')]=_[_0x4c97('0x3b')](_0x278e05[_0x4c97('0x3c')],_0x278e05[_0x4c97('0x39')]);_0x5dc868[_0x4c97('0x3d')]=_[_0x4c97('0x3b')](_0x278e05[_0x4c97('0x3c')],qs[_0x4c97('0x3e')](_0x299e78[_0x4c97('0x39')][_0x4c97('0x3e')]));_0x5dc868[_0x4c97('0x3d')]=_0x5dc868[_0x4c97('0x3d')][_0x4c97('0x3f')]?_0x5dc868['attributes']:_0x278e05[_0x4c97('0x3c')];if(_0x299e78['query'][_0x4c97('0x4b')]){_0x5dc868['include']=[{'all':!![]}];}_0x5dc868=_[_0x4c97('0x4a')]({},_0x5dc868,_0x299e78['options']);return db['Plugin']['find'](_0x5dc868)[_0x4c97('0x2b')](handleEntityNotFound(_0x51b4e1,null))[_0x4c97('0x2b')](respondWithResult(_0x51b4e1,null))[_0x4c97('0x4f')](handleError(_0x51b4e1,null));};exports['download']=function(_0x87ac96,_0xbe0a33,_0x466565){return db[_0x4c97('0x36')][_0x4c97('0x52')]({'where':{'id':_0x87ac96[_0x4c97('0x51')]['id']},'attributes':[_0x4c97('0x32'),'path'],'raw':!![]})[_0x4c97('0x2b')](handleEntityNotFound(_0xbe0a33,null))[_0x4c97('0x2b')](function(_0x2bcd6f){if(_0x2bcd6f){var _0x266e3a=path['join'](config['root'],_0x4c97('0x53'),util[_0x4c97('0x54')]('%s.zip',path[_0x4c97('0x55')](_0x2bcd6f[_0x4c97('0x6')])));var _0x1aed14=fs['createWriteStream'](_0x266e3a);var _0x530d87=archiver(_0x4c97('0x56'),{'zlib':{'level':0x9}});_0x530d87['on'](_0x4c97('0x57'),function(_0x592ef7){if(_0x592ef7[_0x4c97('0x58')]===_0x4c97('0x59')){logger[_0x4c97('0x30')](_0x592ef7);}else{throw new db[(_0x4c97('0x5a'))][(_0x4c97('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x530d87['on'](_0x4c97('0x30'),function(_0x37f023){throw new db[(_0x4c97('0x5a'))]['Error'](_0x4c97('0x5c'));});_0x530d87[_0x4c97('0x5d')](_0x1aed14);_0x530d87[_0x4c97('0x5e')](_0x4c97('0x5f'),{'cwd':path[_0x4c97('0x60')](config[_0x4c97('0x61')],_0x4c97('0x53'),path[_0x4c97('0x62')](_0x2bcd6f['path'])),'ignore':[path[_0x4c97('0x60')](path[_0x4c97('0x55')](_0x2bcd6f[_0x4c97('0x6')]),_0x4c97('0x63')),path['join'](path[_0x4c97('0x55')](_0x2bcd6f[_0x4c97('0x6')]),_0x4c97('0x64'))],'nodir':!![]})[_0x4c97('0x65')]();_0x1aed14['on'](_0x4c97('0x66'),function(){if(!fs['existsSync'](_0x266e3a)){throw new db['Sequelize']['Error'](_0x4c97('0x67'));}return _0xbe0a33[_0x4c97('0x68')](_0x266e3a,util[_0x4c97('0x54')](_0x4c97('0x69'),path['basename'](_0x2bcd6f['path'])),function(_0x4928ae){if(_0x4928ae){throw new db[(_0x4c97('0x5a'))][(_0x4c97('0x5b'))](_0x4c97('0x6a'));}fs[_0x4c97('0x6b')](_0x266e3a);logger[_0x4c97('0x6c')]('Download\x20completed');logger[_0x4c97('0x6c')](_0x4c97('0x6d'));});});}return null;})[_0x4c97('0x4f')](handleError(_0xbe0a33,null));};exports[_0x4c97('0x6e')]=function(_0x4570fd,_0xcf4043,_0x1e60e6){var _0x52ddd4=path[_0x4c97('0x55')](_0x4570fd[_0x4c97('0x6f')][_0x4c97('0x70')],path['extname'](_0x4570fd[_0x4c97('0x6f')][_0x4c97('0x70')]));var _0x11f79a=path[_0x4c97('0x60')](config[_0x4c97('0x61')],'server/files/plugins',_0x4570fd[_0x4c97('0x6f')]['filename']);var _0x35c327=path[_0x4c97('0x60')](config[_0x4c97('0x61')],_0x4c97('0x53'),_0x52ddd4);logger['info'](_0x4c97('0x71'),_0x11f79a);logger['info'](_0x4c97('0x72'),_0x35c327);try{fs[_0x4c97('0x73')](_0x11f79a,parseInt(_0x4c97('0x74'),0x8));extract(_0x11f79a,{'dir':_0x35c327},function(_0x1f2fc7){if(_0x1f2fc7){logger[_0x4c97('0x30')](_0x1f2fc7);handleError(_0x1f2fc7,!![]);};var _0x31dec9=fs['readdirSync'](_0x35c327);if(_0x31dec9['length']>0x1){removeReferences(_0x11f79a,_0x35c327);logger['error'](_0x4c97('0x75'));return _0x1e60e6(new Error(_0x4c97('0x75')));}var _0x131be1=fs['lstatSync'](path[_0x4c97('0x60')](_0x35c327,_0x31dec9[0x0]));if(_0x131be1[_0x4c97('0x76')]()){removeReferences(_0x11f79a,_0x35c327);logger['error'](_0x4c97('0x75'));return _0x1e60e6(new Error(_0x4c97('0x75')));}if(_0x131be1[_0x4c97('0x77')]()){var _0xb91f0c=fs[_0x4c97('0x78')](path[_0x4c97('0x60')](_0x35c327,_0x31dec9[0x0]));if(_0xb91f0c['length']===0x0){removeReferences(_0x11f79a,_0x35c327);logger[_0x4c97('0x30')](_0x4c97('0x75'));return _0x1e60e6(new Error(_0x4c97('0x75')));}var _0x12fb59=_0xb91f0c['some'](function(_0x2dc006){return _0x2dc006===_0x4c97('0x79');});if(!_0x12fb59){return _0x1e60e6(new Error(_0x4c97('0x7a')));}var _0x3d8c25=fs[_0x4c97('0x7b')](path['join'](_0x35c327,_0x31dec9[0x0],_0x4c97('0x79')));var _0x24bc1b=JSON[_0x4c97('0x7c')](_0x3d8c25);if('undefined'==typeof _0x24bc1b['name']){return _0x1e60e6(new Error(_0x4c97('0x7d')));}if(_0x4c97('0x23')==typeof _0x24bc1b[_0x4c97('0x48')]){return _0x1e60e6(new Error(_0x4c97('0x7e')));}if(_0x4c97('0x23')==typeof _0x24bc1b[_0x4c97('0x7f')]){return _0x1e60e6(new Error(_0x4c97('0x80')));}if(_0x4c97('0x23')==typeof _0x24bc1b[_0x4c97('0x81')]){return _0x1e60e6(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x24bc1b['type']===_0x4c97('0x82')){if(_0x4c97('0x23')==typeof _0x24bc1b[_0x4c97('0x81')]['views']){return _0x1e60e6(new Error(_0x4c97('0x83')));}if(_0x4c97('0x23')==typeof _0x24bc1b[_0x4c97('0x81')][_0x4c97('0x84')]['admin']&&'undefined'==typeof _0x24bc1b[_0x4c97('0x81')][_0x4c97('0x84')][_0x4c97('0x85')]){return _0x1e60e6(new Error(_0x4c97('0x86')));}}else if(_0x24bc1b[_0x4c97('0x48')]===_0x4c97('0x87')){if('undefined'==typeof _0x24bc1b['parameters'][_0x4c97('0x88')]){return _0x1e60e6(new Error(_0x4c97('0x89')));}if(_0x4c97('0x23')==typeof _0x24bc1b['parameters'][_0x4c97('0x8a')]){return _0x1e60e6(new Error(_0x4c97('0x8b')));}}else{return _0x1e60e6(new Error(_0x4c97('0x8c')));}var _0x40ff0e=_0x24bc1b[_0x4c97('0x32')];var _0x547ce4=_0x24bc1b['description'];var _0x49fb03=_0x24bc1b['type'];var _0xe9043c=_0x24bc1b[_0x4c97('0x8d')]?_0x24bc1b['sidebar']:_0x4c97('0x8e');var _0x14d5c3=_0x24bc1b[_0x4c97('0x8f')]?_0x24bc1b[_0x4c97('0x8f')]:_0x4c97('0x90');var _0x3b0136='';var _0x21d6c4='';var _0x224bd3='';var _0x54a91b='';var _0x265156=_0x24bc1b[_0x4c97('0x7f')];if(_0x49fb03===_0x4c97('0x82')){if(_0x4c97('0x23')!=typeof _0x24bc1b[_0x4c97('0x81')][_0x4c97('0x84')][_0x4c97('0x91')]){var _0x1610cf=_0x24bc1b['parameters'][_0x4c97('0x84')][_0x4c97('0x91')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1610cf)){_0x3b0136=path[_0x4c97('0x60')]('plugins',_0x52ddd4,_0x31dec9[0x0],_0x1610cf);}else{_0x3b0136=_0x1610cf;}}else{logger[_0x4c97('0x6c')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x24bc1b[_0x4c97('0x81')]['views'][_0x4c97('0x85')]){var _0x3c1516=_0x24bc1b[_0x4c97('0x81')][_0x4c97('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x4c97('0x92')](_0x3c1516)){_0x21d6c4=path['join'](_0x4c97('0x93'),_0x52ddd4,_0x31dec9[0x0],_0x3c1516);}else{_0x21d6c4=_0x3c1516;}}else{logger['info'](_0x4c97('0x94'));}}else if(_0x49fb03===_0x4c97('0x87')){_0x224bd3=_0x24bc1b[_0x4c97('0x81')]['scriptName'];_0x54a91b=_0x24bc1b[_0x4c97('0x81')][_0x4c97('0x8a')];if('undefined'!=typeof _0x24bc1b[_0x4c97('0x81')]['views']){if('undefined'!=typeof _0x24bc1b[_0x4c97('0x81')][_0x4c97('0x84')][_0x4c97('0x91')]){var _0x1610cf=_0x24bc1b[_0x4c97('0x81')][_0x4c97('0x84')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x4c97('0x92')](_0x1610cf)){_0x3b0136=path[_0x4c97('0x60')](_0x4c97('0x93'),_0x52ddd4,_0x31dec9[0x0],_0x1610cf);}else{_0x3b0136=_0x1610cf;}}if(_0x4c97('0x23')!=typeof _0x24bc1b[_0x4c97('0x81')][_0x4c97('0x84')][_0x4c97('0x85')]){var _0x3c1516=_0x24bc1b['parameters']['views'][_0x4c97('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x4c97('0x92')](_0x3c1516)){_0x21d6c4=path['join'](_0x4c97('0x93'),_0x52ddd4,_0x31dec9[0x0],_0x3c1516);}else{_0x21d6c4=_0x3c1516;}}}}var _0x25fae2={'name':_0x40ff0e,'description':_0x547ce4,'path':path['join'](_0x52ddd4,_0x31dec9[0x0]),'type':_0x49fb03,'sidebar':_0xe9043c,'icon':_0x14d5c3,'adminUrl':_0x3b0136,'agentUrl':_0x21d6c4,'scriptName':_0x224bd3,'scriptPath':_0x54a91b,'version':_0x265156};removeReferences(_0x11f79a,null);return db['Plugin'][_0x4c97('0x95')](_0x25fae2)[_0x4c97('0x2b')](function(_0x94e1ce){var _0x3ec1db={'role':_0x4570fd['body']['role'],'userProfileId':_0x4570fd[_0x4c97('0x96')][_0x4c97('0x97')]};if(!_0x3ec1db)throw new Error(_0x4c97('0x98'));if(_0x3ec1db[_0x4c97('0x99')]===_0x4c97('0x9a')){var _0x977cbe=_0x94e1ce[_0x4c97('0x2c')]({'plain':!![]});return db['UserProfileSection'][_0x4c97('0x52')]({'where':{'name':_0x4c97('0x2d'),'userProfileId':_0x3ec1db[_0x4c97('0x97')]},'raw':!![]})[_0x4c97('0x2b')](function(_0x15aa30){if(_0x15aa30&&_0x15aa30[_0x4c97('0x9b')]===0x0){return db['UserProfileResource']['create']({'name':_0x977cbe['name'],'resourceId':_0x977cbe['id'],'type':_0x15aa30[_0x4c97('0x32')],'sectionId':_0x15aa30['id']},{})['then'](function(){return _0x94e1ce;});}else{return _0x94e1ce;}})['catch'](function(_0x2de57f){logger[_0x4c97('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2de57f);throw _0x2de57f;});}return _0x94e1ce;})[_0x4c97('0x2b')](respondWithResult(_0xcf4043,null))[_0x4c97('0x4f')](handleError(_0xcf4043,null));}});}catch(_0xdb4703){_0xcf4043['status'](0x1f4)[_0x4c97('0x33')](_0xdb4703);}};function removeReferences(_0x35d459,_0x35d8ad){try{if(_0x35d459){fs['unlinkSync'](_0x35d459);logger[_0x4c97('0x6c')](_0x4c97('0x9c'));}if(_0x35d8ad){rimraf(_0x35d8ad,function(){});logger[_0x4c97('0x6c')](_0x4c97('0x9d'));}}catch(_0x2edf83){logger[_0x4c97('0x30')](_0x2edf83);}}exports[_0x4c97('0x2a')]=function(_0x1aa0a4,_0x3165cb,_0x31474b){return db[_0x4c97('0x36')][_0x4c97('0x52')]({'where':{'id':_0x1aa0a4[_0x4c97('0x51')]['id']}})[_0x4c97('0x2b')](handleEntityNotFound(_0x3165cb,null))[_0x4c97('0x2b')](saveUpdates(_0x1aa0a4[_0x4c97('0x96')],null))[_0x4c97('0x2b')](respondWithResult(_0x3165cb,null))[_0x4c97('0x4f')](handleError(_0x3165cb,null));};exports['delete']=function(_0x2a9c33,_0xa116e8,_0xea2b8d){return db[_0x4c97('0x36')][_0x4c97('0x52')]({'where':{'id':_0x2a9c33['params']['id']}})[_0x4c97('0x2b')](function(_0x2c3c7b){if(_0x2c3c7b){return _0x2c3c7b[_0x4c97('0x2f')]();}})[_0x4c97('0x2b')](function(_0x22c8e3){rimraf(path[_0x4c97('0x60')](config['root'],_0x4c97('0x53'),path[_0x4c97('0x62')](_0x22c8e3[_0x4c97('0x6')])),function(){});return _0x22c8e3;})[_0x4c97('0x2b')](handleEntityNotFound(_0xa116e8,null))[_0x4c97('0x2b')](respondWithStatusCode(_0xa116e8,null))['catch'](handleError(_0xa116e8,null));};exports['webhookGet']=function(_0x1f8c0e,_0x246580,_0x4e7c58){return BPromise[_0x4c97('0x9e')]()[_0x4c97('0x2b')](function(){if(!_0x1f8c0e[_0x4c97('0x39')][_0x4c97('0x6')]){throw new Error(_0x4c97('0x9f'));}if(!_0x1f8c0e['query'][_0x4c97('0xa0')]){throw new Error(_0x4c97('0xa1'));}var _0x3d132f=_0x1f8c0e[_0x4c97('0x39')]['hostname']?_0x1f8c0e[_0x4c97('0x39')][_0x4c97('0xa2')]+':'+_0x1f8c0e[_0x4c97('0x39')][_0x4c97('0xa0')]:_0x4c97('0xa3')+_0x1f8c0e[_0x4c97('0x39')][_0x4c97('0xa0')];var _0x58b428=_0x1f8c0e['query'][_0x4c97('0x22')]?_0x1f8c0e[_0x4c97('0x39')][_0x4c97('0x22')]:!![];var _0x3a95bd=_0x1f8c0e[_0x4c97('0x39')][_0x4c97('0xa4')]?_0x1f8c0e[_0x4c97('0x39')][_0x4c97('0xa4')]:null;var _0x19b3a2={'method':_0x1f8c0e[_0x4c97('0xa5')],'uri':util['format'](_0x4c97('0xa6'),_0x3d132f,_0x1f8c0e['query']['path']),'json':_0x58b428,'resolveWithFullResponse':!![],'encoding':_0x3a95bd,'qs':_0x1f8c0e[_0x4c97('0x39')]};if(_0x1f8c0e[_0x4c97('0xa7')]){_0x19b3a2[_0x4c97('0xa7')]=_0x1f8c0e[_0x4c97('0xa7')];if(_0x19b3a2[_0x4c97('0xa7')]['content-length']){delete _0x19b3a2['headers'][_0x4c97('0xa8')];}}if(_0x19b3a2[_0x4c97('0xa7')][_0x4c97('0xa9')]){delete _0x19b3a2[_0x4c97('0xa7')][_0x4c97('0xa9')];}return rp(_0x19b3a2);})['then'](function(_0xf428aa){if(_0xf428aa){_0x246580[_0x4c97('0x27')](_0xf428aa['headers']);logger[_0x4c97('0x6c')](_0xf428aa[_0x4c97('0x96')]);if(_[_0x4c97('0xaa')](_0x1f8c0e[_0x4c97('0x39')][_0x4c97('0x6')],_0x4c97('0x68'))&&_0xf428aa[_0x4c97('0xab')]==0x1f4){return _0x246580[_0x4c97('0x1f')](_0xf428aa['statusCode']);}else{return _0x246580['status'](_0xf428aa[_0x4c97('0xab')])[_0x4c97('0x33')](_0xf428aa[_0x4c97('0x96')]);}}else{return _0x246580[_0x4c97('0x1f')](0xc8);}})[_0x4c97('0x4f')](handleError(_0x246580,null));};exports[_0x4c97('0xac')]=function(_0x510ed3,_0x1351bb,_0x173141){return BPromise[_0x4c97('0x9e')]()[_0x4c97('0x2b')](function(){if(!_0x510ed3[_0x4c97('0x39')][_0x4c97('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x510ed3[_0x4c97('0x39')]['port']){throw new Error(_0x4c97('0xa1'));}var _0x42e473=_0x510ed3[_0x4c97('0x39')][_0x4c97('0xa2')]?_0x510ed3[_0x4c97('0x39')]['hostname']+':'+_0x510ed3[_0x4c97('0x39')][_0x4c97('0xa0')]:'http://localhost:'+_0x510ed3[_0x4c97('0x39')]['port'];var _0x58e2a8=_0x510ed3[_0x4c97('0x39')][_0x4c97('0x22')]?_0x510ed3[_0x4c97('0x39')][_0x4c97('0x22')]:!![];var _0x118ce8=_0x510ed3[_0x4c97('0x39')][_0x4c97('0xa4')]?_0x510ed3['query'][_0x4c97('0xa4')]:null;var _0x165054={'method':_0x510ed3[_0x4c97('0xa5')],'uri':util[_0x4c97('0x54')](_0x4c97('0xa6'),_0x42e473,_0x510ed3[_0x4c97('0x39')][_0x4c97('0x6')]),'json':_0x58e2a8,'resolveWithFullResponse':!![],'encoding':_0x118ce8,'body':_0x510ed3[_0x4c97('0x96')]};if(_0x510ed3[_0x4c97('0xa7')]){_0x165054[_0x4c97('0xa7')]=_0x510ed3['headers'];if(_0x165054[_0x4c97('0xa7')]['content-length']){delete _0x165054[_0x4c97('0xa7')]['content-length'];}}if(_0x165054[_0x4c97('0xa7')][_0x4c97('0xa9')]){delete _0x165054[_0x4c97('0xa7')][_0x4c97('0xa9')];}return rp(_0x165054);})['then'](function(_0x2fd442){if(_0x2fd442){_0x1351bb['set'](_0x2fd442['headers']);logger[_0x4c97('0x6c')](_0x2fd442[_0x4c97('0x96')]);return _0x1351bb[_0x4c97('0x20')](_0x2fd442[_0x4c97('0xab')])[_0x4c97('0x33')](_0x2fd442[_0x4c97('0x96')]);}else{return _0x1351bb[_0x4c97('0x1f')](0xc8);}})['catch'](handleError(_0x1351bb,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 13f567a..45fa303 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 _0xb1d3=['update','remove','emit','exports','events','save'];(function(_0x59adde,_0x2e6c68){var _0x2e3b17=function(_0x5c5d4b){while(--_0x5c5d4b){_0x59adde['push'](_0x59adde['shift']());}};_0x2e3b17(++_0x2e6c68);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x352f7f,_0x33249c){_0x352f7f=_0x352f7f-0x0;var _0x360a67=_0xb1d3[_0x352f7f];return _0x360a67;};'use strict';var EventEmitter=require(_0x3b1d('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3b1d('0x1'),'afterUpdate':_0x3b1d('0x2'),'afterDestroy':_0x3b1d('0x3')};function emitEvent(_0x22b67a){return function(_0x5b94ab,_0x18e301,_0x32cd1d){PluginEvents[_0x3b1d('0x4')](_0x22b67a+':'+_0x5b94ab['id'],_0x5b94ab);PluginEvents[_0x3b1d('0x4')](_0x22b67a,_0x5b94ab);_0x32cd1d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x3b1d('0x5')]=PluginEvents; \ No newline at end of file +var _0xbe2a=['events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xe43e89,_0x3acd39){var _0x1ab0aa=function(_0x537dcc){while(--_0x537dcc){_0xe43e89['push'](_0xe43e89['shift']());}};_0x1ab0aa(++_0x3acd39);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x17182b,_0x52d092){_0x17182b=_0x17182b-0x0;var _0x31cd3c=_0xbe2a[_0x17182b];return _0x31cd3c;};'use strict';var EventEmitter=require(_0xabe2('0x0'));var Plugin=require(_0xabe2('0x1'))['db'][_0xabe2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xabe2('0x3')](0x0);var events={'afterCreate':_0xabe2('0x4'),'afterUpdate':_0xabe2('0x5'),'afterDestroy':_0xabe2('0x6')};function emitEvent(_0x485cec){return function(_0x42fbad,_0x4f80bf,_0x472f4b){PluginEvents[_0xabe2('0x7')](_0x485cec+':'+_0x42fbad['id'],_0x42fbad);PluginEvents[_0xabe2('0x7')](_0x485cec,_0x42fbad);_0x472f4b(null);};}for(var e in events){if(events[_0xabe2('0x8')](e)){var event=events[e];Plugin[_0xabe2('0x9')](e,emitEvent(event));}}module[_0xabe2('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b6ec011..cde671b 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 _0x6367=['api','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','define','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6367,0x1d5));var _0x7636=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0x6367[_0x197185];return _0x2c8af1;};'use strict';var _=require('lodash');var util=require(_0x7636('0x0'));var logger=require('../../config/logger')(_0x7636('0x1'));var moment=require(_0x7636('0x2'));var BPromise=require(_0x7636('0x3'));var rp=require(_0x7636('0x4'));var fs=require('fs');var path=require(_0x7636('0x5'));var rimraf=require('rimraf');var config=require(_0x7636('0x6'));var attributes=require(_0x7636('0x7'));module[_0x7636('0x8')]=function(_0x1dee30,_0x5297d0){return _0x1dee30[_0x7636('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8ba=['plugins','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0xf8ba,0x1a5));var _0xaf8b=function(_0x14e20f,_0x336392){_0x14e20f=_0x14e20f-0x0;var _0x33f32e=_0xf8ba[_0x14e20f];return _0x33f32e;};'use strict';var _=require('lodash');var util=require(_0xaf8b('0x0'));var logger=require(_0xaf8b('0x1'))(_0xaf8b('0x2'));var moment=require('moment');var BPromise=require(_0xaf8b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf8b('0x4'));var rimraf=require(_0xaf8b('0x5'));var config=require(_0xaf8b('0x6'));var attributes=require(_0xaf8b('0x7'));module[_0xaf8b('0x8')]=function(_0x5075d5,_0x2a2654){return _0x5075d5[_0xaf8b('0x9')](_0xaf8b('0xa'),attributes,{'tableName':_0xaf8b('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 2520bd7..0898ff0 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 _0x5646=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','Plugin','create','body','options','CreatePlugin','lodash','util'];(function(_0x1476ba,_0x446421){var _0x5e7bc1=function(_0x4aa99c){while(--_0x4aa99c){_0x1476ba['push'](_0x1476ba['shift']());}};_0x5e7bc1(++_0x446421);}(_0x5646,0x132));var _0x6564=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0x5646[_0x20cb20];return _0x2fcf4b;};'use strict';var _=require(_0x6564('0x0'));var util=require(_0x6564('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6564('0x2'));var fs=require('fs');var Redis=require(_0x6564('0x3'));var db=require(_0x6564('0x4'))['db'];var utils=require(_0x6564('0x5'));var logger=require(_0x6564('0x6'))(_0x6564('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6564('0x8')]({'port':0x232a});config[_0x6564('0x9')]=_[_0x6564('0xa')](config[_0x6564('0x9')],{'host':_0x6564('0xb'),'port':0x18eb});var socket=require(_0x6564('0xc'))(new Redis(config[_0x6564('0x9')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x1b8d19,_0x1f609e,_0xa2ef84){return new BPromise(function(_0x481e5c,_0xed2cbc){return client[_0x6564('0xd')](_0x1b8d19,_0xa2ef84)[_0x6564('0xe')](function(_0x26ee2e){logger[_0x6564('0xf')](_0x6564('0x10'),_0x1f609e,'request\x20sent');logger[_0x6564('0x11')](_0x6564('0x12'),_0x1f609e,'request\x20sent',JSON[_0x6564('0x13')](_0x26ee2e));if(_0x26ee2e[_0x6564('0x14')]){if(_0x26ee2e[_0x6564('0x14')]['code']===0x1f4){logger[_0x6564('0x14')](_0x6564('0x10'),_0x1f609e,_0x26ee2e[_0x6564('0x14')]['message']);return _0xed2cbc(_0x26ee2e[_0x6564('0x14')]['message']);}logger[_0x6564('0x14')]('Plugin,\x20%s,\x20%s',_0x1f609e,_0x26ee2e[_0x6564('0x14')]['message']);return _0x481e5c(_0x26ee2e['error'][_0x6564('0x15')]);}else{logger[_0x6564('0xf')](_0x6564('0x10'),_0x1f609e,'request\x20sent');_0x481e5c(_0x26ee2e['result'][_0x6564('0x15')]);}})[_0x6564('0x16')](function(_0x4fabcf){logger['error'](_0x6564('0x10'),_0x1f609e,_0x4fabcf);_0xed2cbc(_0x4fabcf);});});}exports['CreatePlugin']=function(_0x84e64){var _0x1a54c8=this;return new Promise(function(_0x14e9fd,_0x5ce8d8){return db[_0x6564('0x17')][_0x6564('0x18')](_0x84e64[_0x6564('0x19')],{'raw':_0x84e64[_0x6564('0x1a')]?_0x84e64[_0x6564('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x270afd){logger['info'](_0x6564('0x1b'),_0x84e64);logger[_0x6564('0x11')](_0x6564('0x1b'),_0x84e64,JSON[_0x6564('0x13')](_0x270afd));_0x14e9fd(_0x270afd);})['catch'](function(_0x14c3eb){logger[_0x6564('0x14')](_0x6564('0x1b'),_0x14c3eb[_0x6564('0x15')],_0x84e64);_0x5ce8d8(_0x1a54c8[_0x6564('0x14')](0x1f4,_0x14c3eb['message']));});});}; \ No newline at end of file +var _0xd624=['client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','body','options','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4d7580,_0x171e26){var _0x50edc2=function(_0x2a10cf){while(--_0x2a10cf){_0x4d7580['push'](_0x4d7580['shift']());}};_0x50edc2(++_0x171e26);}(_0xd624,0x124));var _0x4d62=function(_0x9ce157,_0x16627d){_0x9ce157=_0x9ce157-0x0;var _0x3deb2f=_0xd624[_0x9ce157];return _0x3deb2f;};'use strict';var _=require(_0x4d62('0x0'));var util=require(_0x4d62('0x1'));var moment=require('moment');var BPromise=require(_0x4d62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d62('0x3'));var logger=require(_0x4d62('0x4'))(_0x4d62('0x5'));var config=require(_0x4d62('0x6'));var jayson=require(_0x4d62('0x7'));var client=jayson[_0x4d62('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4d62('0x9')](config[_0x4d62('0xa')],{'host':_0x4d62('0xb'),'port':0x18eb});var socket=require(_0x4d62('0xc'))(new Redis(config[_0x4d62('0xa')]));require('./plugin.socket')[_0x4d62('0xd')](socket);function respondWithRpcPromise(_0x62e82e,_0x1297dd,_0x2076db){return new BPromise(function(_0x5a7df6,_0x46e054){return client[_0x4d62('0xe')](_0x62e82e,_0x2076db)[_0x4d62('0xf')](function(_0x47044d){logger[_0x4d62('0x10')](_0x4d62('0x11'),_0x1297dd,_0x4d62('0x12'));logger[_0x4d62('0x13')](_0x4d62('0x14'),_0x1297dd,_0x4d62('0x12'),JSON[_0x4d62('0x15')](_0x47044d));if(_0x47044d[_0x4d62('0x16')]){if(_0x47044d['error'][_0x4d62('0x17')]===0x1f4){logger[_0x4d62('0x16')](_0x4d62('0x11'),_0x1297dd,_0x47044d['error'][_0x4d62('0x18')]);return _0x46e054(_0x47044d[_0x4d62('0x16')][_0x4d62('0x18')]);}logger[_0x4d62('0x16')](_0x4d62('0x11'),_0x1297dd,_0x47044d[_0x4d62('0x16')][_0x4d62('0x18')]);return _0x5a7df6(_0x47044d['error']['message']);}else{logger[_0x4d62('0x10')](_0x4d62('0x11'),_0x1297dd,'request\x20sent');_0x5a7df6(_0x47044d[_0x4d62('0x19')][_0x4d62('0x18')]);}})[_0x4d62('0x1a')](function(_0x1736f9){logger[_0x4d62('0x16')](_0x4d62('0x11'),_0x1297dd,_0x1736f9);_0x46e054(_0x1736f9);});});}exports[_0x4d62('0x1b')]=function(_0x3dae47){var _0x11a824=this;return new Promise(function(_0x3e656e,_0x494a8f){return db['Plugin']['create'](_0x3dae47[_0x4d62('0x1c')],{'raw':_0x3dae47[_0x4d62('0x1d')]?_0x3dae47[_0x4d62('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x4d62('0xf')](function(_0x16fa3a){logger[_0x4d62('0x10')]('CreatePlugin',_0x3dae47);logger[_0x4d62('0x13')](_0x4d62('0x1b'),_0x3dae47,JSON[_0x4d62('0x15')](_0x16fa3a));_0x3e656e(_0x16fa3a);})[_0x4d62('0x1a')](function(_0xf38665){logger[_0x4d62('0x16')]('CreatePlugin',_0xf38665[_0x4d62('0x18')],_0x3dae47);_0x494a8f(_0x11a824[_0x4d62('0x16')](0x1f4,_0xf38665[_0x4d62('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 972e31c..78e0eed 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 _0xb731=['./plugin.events','remove','update','emit','removeListener','register','length','plugin:'];(function(_0x48ac37,_0x3eaa66){var _0x312cd2=function(_0x4beea2){while(--_0x4beea2){_0x48ac37['push'](_0x48ac37['shift']());}};_0x312cd2(++_0x3eaa66);}(_0xb731,0x1a8));var _0x1b73=function(_0x22a333,_0xb6f8){_0x22a333=_0x22a333-0x0;var _0x109061=_0xb731[_0x22a333];return _0x109061;};'use strict';var PluginEvents=require(_0x1b73('0x0'));var events=['save',_0x1b73('0x1'),_0x1b73('0x2')];function createListener(_0x3899e6,_0x17848f){return function(_0x2b0f60){_0x17848f[_0x1b73('0x3')](_0x3899e6,_0x2b0f60);};}function removeListener(_0x4d2f2a,_0x27810d){return function(){PluginEvents[_0x1b73('0x4')](_0x4d2f2a,_0x27810d);};}exports[_0x1b73('0x5')]=function(_0x379526){for(var _0xbc95c4=0x0,_0x4f8d29=events[_0x1b73('0x6')];_0xbc95c4<_0x4f8d29;_0xbc95c4++){var _0x1bb6b4=events[_0xbc95c4];var _0x460a94=createListener(_0x1b73('0x7')+_0x1bb6b4,_0x379526);PluginEvents['on'](_0x1bb6b4,_0x460a94);}}; \ No newline at end of file +var _0xc9c7=['register','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x12ad90,_0x17b3ec){var _0x2925bf=function(_0x3034b3){while(--_0x3034b3){_0x12ad90['push'](_0x12ad90['shift']());}};_0x2925bf(++_0x17b3ec);}(_0xc9c7,0x191));var _0x7c9c=function(_0x4518a2,_0x3b4c62){_0x4518a2=_0x4518a2-0x0;var _0x44f410=_0xc9c7[_0x4518a2];return _0x44f410;};'use strict';var PluginEvents=require(_0x7c9c('0x0'));var events=[_0x7c9c('0x1'),_0x7c9c('0x2'),_0x7c9c('0x3')];function createListener(_0x273d17,_0xb0fbc3){return function(_0x2199ce){_0xb0fbc3[_0x7c9c('0x4')](_0x273d17,_0x2199ce);};}function removeListener(_0x2f5b52,_0x8b51fd){return function(){PluginEvents['removeListener'](_0x2f5b52,_0x8b51fd);};}exports[_0x7c9c('0x5')]=function(_0xa3ecb9){for(var _0x5ea0cd=0x0,_0x4e0ada=events['length'];_0x5ea0cd<_0x4e0ada;_0x5ea0cd++){var _0x3faba5=events[_0x5ea0cd];var _0x5a905b=createListener(_0x7c9c('0x6')+_0x3faba5,_0xa3ecb9);PluginEvents['on'](_0x3faba5,_0x5a905b);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index e2a20f2..3e8418f 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(_0x5a94e3,_0x40cca5){var _0x4c798a=function(_0x245258){while(--_0x245258){_0x5a94e3['push'](_0x5a94e3['shift']());}};_0x4c798a(++_0x40cca5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x4075b7,_0x2d69e1){var _0x280e7c=function(_0x2046ab){while(--_0x2046ab){_0x4075b7['push'](_0x4075b7['shift']());}};_0x280e7c(++_0x2d69e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 bd6b191..0831265 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 _0x6f0d=['../../files/plugins','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','send','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','bluebird','status','json','error','stack','name','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script'];(function(_0xe9de62,_0x5e9abd){var _0x26c359=function(_0x1590a8){while(--_0x1590a8){_0xe9de62['push'](_0xe9de62['shift']());}};_0x26c359(++_0x5e9abd);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xd0a2ea,_0x341745){_0xd0a2ea=_0xd0a2ea-0x0;var _0x5349a4=_0x6f0d[_0xd0a2ea];return _0x5349a4;};'use strict';var _=require('lodash');var pm2=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var path=require(_0xd6f0('0x3'));var exec=require('child_process')[_0xd6f0('0x4')];var BPromise=require(_0xd6f0('0x5'));function handleEntityNotFound(_0x2f78fb,_0x25344b){return function(_0x3a757f){if(!_0x3a757f){_0x2f78fb['sendStatus'](0x194);;}return _0x3a757f;};}function respondWithResult(_0x2d2ce6,_0x4a8b0c){_0x4a8b0c=_0x4a8b0c||0xc8;return function(_0xe21ac4){if(_0xe21ac4){return _0x2d2ce6[_0xd6f0('0x6')](_0x4a8b0c)[_0xd6f0('0x7')](_0xe21ac4);}return null;};}function handleError(_0x1a48a0,_0x4c4916){_0x4c4916=_0x4c4916||0x1f4;return function(_0x507048){logger[_0xd6f0('0x8')](_0x507048[_0xd6f0('0x9')]);if(_0x507048[_0xd6f0('0xa')]){delete _0x507048[_0xd6f0('0xa')];}_0x1a48a0[_0xd6f0('0x6')](_0x4c4916)['send'](_0x507048);};}function execChildProcess(){return new BPromise(function(_0x136eee,_0xee144c){exec(_0xd6f0('0xb'),function(_0x44bba6,_0x4d10a1,_0x1ce8d5){logger[_0xd6f0('0xc')](_0x4d10a1);logger[_0xd6f0('0xc')](_0x1ce8d5);if(_0x44bba6){logger[_0xd6f0('0x8')](_0x44bba6);return _0xee144c(_0x44bba6);}return _0x136eee(_0x4d10a1);});});}exports[_0xd6f0('0xd')]=function(_0x409549,_0x2bf5b8){return pm2[_0xd6f0('0xe')]()[_0xd6f0('0xf')](function(_0x4ab979){if(_0x4ab979){var _0x2b3f32=_[_0xd6f0('0x10')](_0x4ab979,function(_0x4c1559){return _0x4c1559[_0xd6f0('0xa')]==='express'||_0x4c1559[_0xd6f0('0xa')]===_0xd6f0('0x11');});return{'rows':_0x2b3f32,'count':_0x2b3f32[_0xd6f0('0x12')]};}return null;})[_0xd6f0('0xf')](respondWithResult(_0x2bf5b8,null))[_0xd6f0('0x13')](handleError(_0x2bf5b8,null));};exports[_0xd6f0('0x14')]=function(_0x25da0c,_0x29fbb9){return pm2[_0xd6f0('0x15')](_0x25da0c[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](respondWithResult(_0x29fbb9,null))[_0xd6f0('0xf')](handleEntityNotFound(_0x29fbb9,null))[_0xd6f0('0x13')](handleError(_0x29fbb9,null));};exports[_0xd6f0('0x17')]=function(_0x1f43d7,_0xde87d4){if(_0x1f43d7['body']['name']&&_0x1f43d7[_0xd6f0('0x18')][_0xd6f0('0x19')]){var _0x1158dc=path['join'](__dirname,_0xd6f0('0x1a'),_0x1f43d7[_0xd6f0('0x18')]['script']);var _0x86dde0=process['cwd']();process[_0xd6f0('0x1b')](path[_0xd6f0('0x1c')](_0x1158dc));return execChildProcess()['then'](function(_0xb9e820){process[_0xd6f0('0x1b')](_0x86dde0);return pm2['start']({'name':_0x1f43d7[_0xd6f0('0x18')][_0xd6f0('0xa')],'script':_0x1158dc});})[_0xd6f0('0xf')](function(_0x5b1a62){pm2[_0xd6f0('0x1d')]();return _0x5b1a62[0x0];})[_0xd6f0('0xf')](respondWithResult(_0xde87d4,0xc9))['catch'](handleError(_0xde87d4,null));}else{return _0xde87d4[_0xd6f0('0x6')](0x1f4)['send']({'message':_0xd6f0('0x1e')});}};exports[_0xd6f0('0x1f')]=function(_0x1630dc,_0x3c1bff){if(_0x1630dc[_0xd6f0('0x18')]['id']){delete _0x1630dc[_0xd6f0('0x18')]['id'];}var _0x12d6ec={'online':_0xd6f0('0x20'),'stopped':'stop'};if(_0x12d6ec[_0xd6f0('0x21')](_0x1630dc[_0xd6f0('0x18')]['status'])){return pm2[_0x12d6ec[_0x1630dc[_0xd6f0('0x18')][_0xd6f0('0x6')]]](_0x1630dc[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](respondWithResult(_0x3c1bff,0xc8))[_0xd6f0('0x13')](handleError(_0x3c1bff,null));}else{return _0x3c1bff[_0xd6f0('0x6')](0x1f4)[_0xd6f0('0x22')]({'message':_0xd6f0('0x23')});}};exports[_0xd6f0('0x24')]=function(_0x43f72f,_0x1dff9b){if(_0x43f72f[_0xd6f0('0x18')]['id']){delete _0x43f72f[_0xd6f0('0x18')]['id'];}if(_0x43f72f[_0xd6f0('0x16')]['id']){return pm2[_0xd6f0('0x25')](_0x43f72f[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](function(_0x376890){pm2[_0xd6f0('0x1d')]();return _0x376890[0x0];})[_0xd6f0('0xf')](respondWithResult(_0x1dff9b,null))[_0xd6f0('0x13')](handleError(_0x1dff9b,null));}else{return _0x1dff9b[_0xd6f0('0x6')](0x1f4)['send']({'message':_0xd6f0('0x26')});}}; \ No newline at end of file +var _0x4e81=['npm\x20install','info','index','then','express','length','catch','show','describe','params','create','body','script','join','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','exec','bluebird','sendStatus','status','json','error','stack','name','send'];(function(_0x12bae0,_0x266414){var _0x2024f9=function(_0x2d38da){while(--_0x2d38da){_0x12bae0['push'](_0x12bae0['shift']());}};_0x2024f9(++_0x266414);}(_0x4e81,0x1bc));var _0x14e8=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x4e81[_0x176329];return _0x31997c;};'use strict';var _=require(_0x14e8('0x0'));var pm2=require(_0x14e8('0x1'));var logger=require(_0x14e8('0x2'))('api');var path=require('path');var exec=require('child_process')[_0x14e8('0x3')];var BPromise=require(_0x14e8('0x4'));function handleEntityNotFound(_0x224121,_0x436444){return function(_0x325325){if(!_0x325325){_0x224121[_0x14e8('0x5')](0x194);;}return _0x325325;};}function respondWithResult(_0x56a266,_0x57c79b){_0x57c79b=_0x57c79b||0xc8;return function(_0x3e73d2){if(_0x3e73d2){return _0x56a266[_0x14e8('0x6')](_0x57c79b)[_0x14e8('0x7')](_0x3e73d2);}return null;};}function handleError(_0x3c1b93,_0x11ec3b){_0x11ec3b=_0x11ec3b||0x1f4;return function(_0x20f053){logger[_0x14e8('0x8')](_0x20f053[_0x14e8('0x9')]);if(_0x20f053[_0x14e8('0xa')]){delete _0x20f053['name'];}_0x3c1b93[_0x14e8('0x6')](_0x11ec3b)[_0x14e8('0xb')](_0x20f053);};}function execChildProcess(){return new BPromise(function(_0x43bfcd,_0x2906b3){exec(_0x14e8('0xc'),function(_0x3ce648,_0x3bed91,_0x30df66){logger['info'](_0x3bed91);logger[_0x14e8('0xd')](_0x30df66);if(_0x3ce648){logger['error'](_0x3ce648);return _0x2906b3(_0x3ce648);}return _0x43bfcd(_0x3bed91);});});}exports[_0x14e8('0xe')]=function(_0x341d40,_0x32a01d){return pm2['list']()[_0x14e8('0xf')](function(_0x4e1064){if(_0x4e1064){var _0x458e4a=_['reject'](_0x4e1064,function(_0x347216){return _0x347216[_0x14e8('0xa')]===_0x14e8('0x10')||_0x347216[_0x14e8('0xa')]==='motion2';});return{'rows':_0x458e4a,'count':_0x458e4a[_0x14e8('0x11')]};}return null;})[_0x14e8('0xf')](respondWithResult(_0x32a01d,null))[_0x14e8('0x12')](handleError(_0x32a01d,null));};exports[_0x14e8('0x13')]=function(_0xd4d6b2,_0x1f1a0d){return pm2[_0x14e8('0x14')](_0xd4d6b2[_0x14e8('0x15')]['id'])['then'](respondWithResult(_0x1f1a0d,null))[_0x14e8('0xf')](handleEntityNotFound(_0x1f1a0d,null))[_0x14e8('0x12')](handleError(_0x1f1a0d,null));};exports[_0x14e8('0x16')]=function(_0x7b10f2,_0x246c5d){if(_0x7b10f2['body'][_0x14e8('0xa')]&&_0x7b10f2[_0x14e8('0x17')][_0x14e8('0x18')]){var _0x48e30a=path[_0x14e8('0x19')](__dirname,'../../files/plugins',_0x7b10f2[_0x14e8('0x17')][_0x14e8('0x18')]);var _0x3e8d5c=process[_0x14e8('0x1a')]();process[_0x14e8('0x1b')](path['dirname'](_0x48e30a));return execChildProcess()[_0x14e8('0xf')](function(_0x5b11f9){process[_0x14e8('0x1b')](_0x3e8d5c);return pm2[_0x14e8('0x1c')]({'name':_0x7b10f2['body']['name'],'script':_0x48e30a});})['then'](function(_0x4a758c){pm2[_0x14e8('0x1d')]();return _0x4a758c[0x0];})[_0x14e8('0xf')](respondWithResult(_0x246c5d,0xc9))[_0x14e8('0x12')](handleError(_0x246c5d,null));}else{return _0x246c5d[_0x14e8('0x6')](0x1f4)['send']({'message':_0x14e8('0x1e')});}};exports[_0x14e8('0x1f')]=function(_0x3c09cb,_0x2f5818){if(_0x3c09cb[_0x14e8('0x17')]['id']){delete _0x3c09cb[_0x14e8('0x17')]['id'];}var _0x2813ae={'online':'restart','stopped':_0x14e8('0x20')};if(_0x2813ae[_0x14e8('0x21')](_0x3c09cb[_0x14e8('0x17')]['status'])){return pm2[_0x2813ae[_0x3c09cb['body']['status']]](_0x3c09cb[_0x14e8('0x15')]['id'])[_0x14e8('0xf')](respondWithResult(_0x2f5818,0xc8))['catch'](handleError(_0x2f5818,null));}else{return _0x2f5818[_0x14e8('0x6')](0x1f4)[_0x14e8('0xb')]({'message':_0x14e8('0x22')});}};exports[_0x14e8('0x23')]=function(_0x5c2635,_0x1f1259){if(_0x5c2635[_0x14e8('0x17')]['id']){delete _0x5c2635[_0x14e8('0x17')]['id'];}if(_0x5c2635[_0x14e8('0x15')]['id']){return pm2[_0x14e8('0x24')](_0x5c2635['params']['id'])[_0x14e8('0xf')](function(_0x29ee7a){pm2[_0x14e8('0x1d')]();return _0x29ee7a[0x0];})[_0x14e8('0xf')](respondWithResult(_0x1f1259,null))['catch'](handleError(_0x1f1259,null));}else{return _0x1f1259[_0x14e8('0x6')](0x1f4)['send']({'message':_0x14e8('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 501e1c4..f345a6c 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 _0xb27f=['Router','../../components/auth/service','./realtime.controller','/agents','isAuthenticated','getAgents','get','/queues','getQueues','exports'];(function(_0x3b3127,_0x51cdc5){var _0x19c58f=function(_0x4653f8){while(--_0x4653f8){_0x3b3127['push'](_0x3b3127['shift']());}};_0x19c58f(++_0x51cdc5);}(_0xb27f,0x1cc));var _0xfb27=function(_0x2b3228,_0x2cc114){_0x2b3228=_0x2b3228-0x0;var _0x3ee782=_0xb27f[_0x2b3228];return _0x3ee782;};'use strict';var express=require('express');var router=express[_0xfb27('0x0')]();var auth=require(_0xfb27('0x1'));var controller=require(_0xfb27('0x2'));router['get'](_0xfb27('0x3'),auth[_0xfb27('0x4')](),controller[_0xfb27('0x5')]);router[_0xfb27('0x6')](_0xfb27('0x7'),auth[_0xfb27('0x4')](),controller[_0xfb27('0x8')]);module[_0xfb27('0x9')]=router; \ No newline at end of file +var _0xe490=['getQueues','express','Router','../../components/auth/service','./realtime.controller','get','/agents','getAgents','/queues'];(function(_0xdcfc82,_0x1c16ae){var _0xa8b222=function(_0x4b48ac){while(--_0x4b48ac){_0xdcfc82['push'](_0xdcfc82['shift']());}};_0xa8b222(++_0x1c16ae);}(_0xe490,0x1b1));var _0x0e49=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe490[_0x550d12];return _0x12103d;};'use strict';var express=require(_0x0e49('0x0'));var router=express[_0x0e49('0x1')]();var auth=require(_0x0e49('0x2'));var controller=require(_0x0e49('0x3'));router[_0x0e49('0x4')](_0x0e49('0x5'),auth['isAuthenticated'](),controller[_0x0e49('0x6')]);router[_0x0e49('0x4')](_0x0e49('0x7'),auth['isAuthenticated'](),controller[_0x0e49('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index bba1c95..200faa6 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 _0x5a62=['toLowerCase','Invalid\x20channel','getChannels','query','globalQueueFilter','globalStatusFilter','*pause','resolve','channel','sort','globalStatus','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','rawAttributes','fieldName','key','role','agent','getOptions','sequelize','literal','FIELD(id,','forEach','where','user','userProfileId','Agents','UserProfile','getResources','findAndCountAll','map','pause','Status','sortAgentsByStatus','getQueues','type','filter','all','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','client','offset','undefined','limit','count','status','set','Content-Range','stack','name','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','error','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','waiting','talking','paused','outbound','push','pTalking','originated','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','available','busy','merge','queue','length','connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','online','User','Queue','Pause','findAll','QueueId','includes'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0x5a62,0x9d));var _0x25a6=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x5a62[_0xf2628e];return _0x13863a;};'use strict';var util=require(_0x25a6('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var rta=require('../../components/realtime/agents');var qs=require(_0x25a6('0x1'));var utils=require('../../config/utils');var logger=require(_0x25a6('0x2'))(_0x25a6('0x3'));var db=require(_0x25a6('0x4'))['db'];var amiClient=jayson['client'][_0x25a6('0x5')]({'port':0x232a});var routingClient=jayson[_0x25a6('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0x341ffa,_0x2c7bf6){return function(_0x1a6bab){if(_0x1a6bab){var _0x506167=typeof _0x2c7bf6[_0x25a6('0x7')]===_0x25a6('0x8')&&typeof _0x2c7bf6[_0x25a6('0x9')]===_0x25a6('0x8');var _0x39b72a=_0x1a6bab['count'];var _0xf270f2=_0x506167?0x0:_0x2c7bf6['offset'];var _0x555dab=_0x506167?_0x1a6bab[_0x25a6('0xa')]:_0x2c7bf6[_0x25a6('0x7')]+_0x2c7bf6[_0x25a6('0x9')];var _0x450fcf;if(_0x555dab>=_0x39b72a){_0x555dab=_0x39b72a;_0x450fcf=0xc8;}else{_0x450fcf=0xce;}_0x341ffa[_0x25a6('0xb')](_0x450fcf);return _0x341ffa[_0x25a6('0xc')](_0x25a6('0xd'),_0xf270f2+'-'+_0x555dab+'/'+_0x39b72a)['json'](_0x1a6bab);}return null;};}function handleError(_0x2205c1,_0x417f35){_0x417f35=_0x417f35||0x1f4;return function(_0x202620){logger['error'](_0x202620[_0x25a6('0xe')]);if(_0x202620[_0x25a6('0xf')]){delete _0x202620[_0x25a6('0xf')];}_0x2205c1[_0x25a6('0xb')](_0x417f35)['send'](_0x202620);};}function getRealtimeQueues(_0x233abb,_0x500a7f){return new Promise(function(_0x42c51e,_0x3e6126){var _0x1438a7=_0x500a7f===_0x25a6('0x10')?amiClient:routingClient;return _0x1438a7[_0x25a6('0x11')](_[_0x25a6('0x12')](_0x500a7f)+_0x25a6('0x13'),_0x233abb)[_0x25a6('0x14')](function(_0x277796){if(_0x277796['error'])throw new Error(util[_0x25a6('0x15')](_0x25a6('0x16'),_0x500a7f));return _0x42c51e(_0x277796[_0x25a6('0x17')]);})[_0x25a6('0x18')](function(_0x3bb8a1){_0x3e6126(_0x3bb8a1);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x60a2f3,_0x2ff87e){return amiClient['request'](_0x25a6('0x19'),{})[_0x25a6('0x14')](function(_0x339438){if(_0x339438[_0x25a6('0x1a')])throw new Error(_0x25a6('0x1b'));return _0x60a2f3(_0x339438[_0x25a6('0x17')]);})[_0x25a6('0x18')](function(_0x50089c){_0x2ff87e(_0x50089c);});});}function initializeQueues(_0x3fc5f9,_0x37a8e7,_0xec15d9,_0x59deb3){var _0x1ce539=[_0x25a6('0x1c'),'available',_0x25a6('0x1d'),_0x25a6('0x1e'),_0x25a6('0x1f')];if(_0xec15d9===_0x25a6('0x10')&&_0x59deb3===_0x25a6('0x20')){_0x1ce539[_0x25a6('0x21')](_0x25a6('0x22'),_0x25a6('0x23'),'message','dialActive',_0x25a6('0x24'),'Trunk',_0x25a6('0x25'),_0x25a6('0x26'),_0x25a6('0x27'),_0x25a6('0x28'),'erlangAbandonmentRate','erlangBusyFactor',_0x25a6('0x29'),_0x25a6('0x2a'),'dialPredictiveIntervalMinThreshold',_0x25a6('0x2b'),_0x25a6('0x2c'),_0x25a6('0x2d'),'predictiveIntervalDroppedCallsTimeout',_0x25a6('0x2e'),_0x25a6('0x2f'),_0x25a6('0x30'));}return _0x3fc5f9['map'](function(_0x317e93){var _0x3197eb=_0x317e93[_0x25a6('0x31')]({'plain':!![]});_0x3197eb[_0x25a6('0x32')]=[];_0x3197eb[_0x25a6('0x1f')]=0x0;_0x3197eb[_0x25a6('0x33')]=0x0;_0x3197eb[_0x25a6('0x1c')]=0x0;_0x3197eb[_0x25a6('0x34')]=0x0;_0x3197eb[_0x25a6('0x1d')]=0x0;if(_0xec15d9===_0x25a6('0x10')){_0x3197eb[_0x25a6('0x1e')]=0x0;_0x3197eb[_0x25a6('0x35')]=0x0;if(_0x59deb3===_0x25a6('0x20')){_0x3197eb[_0x25a6('0x22')]=0x0;_0x3197eb[_0x25a6('0x23')]=0x0;}}var _0x4e9d85=_['find'](_0x37a8e7,['id',_0x3197eb['id']]);if(_0x4e9d85)_[_0x25a6('0x36')](_0x3197eb,_['pick'](_0x4e9d85,_0x1ce539));return _0x3197eb;});}function updateAgentVoiceStatus(_0x2649d7,_0x3b5d92,_0x24cd19){var _0x29b551=_['filter'](_0x24cd19,[_0x25a6('0x37'),_0x3b5d92[_0x25a6('0xf')]]);if(_0x29b551[_0x25a6('0x38')]===0x0)return _0x2649d7[_0x25a6('0x35')]=!![];if(_['some'](_0x29b551,[_0x25a6('0x39'),_0x2649d7[_0x25a6('0x3a')][_0x25a6('0x3b')]()]))return _0x2649d7[_0x25a6('0x1e')]=!![];if(!_0x2649d7[_0x25a6('0x1e')])return _0x2649d7[_0x25a6('0x35')]=!![];}function getVoiceQueueAgents(_0x30e43d,_0x396a29,_0x1d7a3d,_0x30915d){var _0x6d712e=_[_0x25a6('0x3c')](_0x396a29,['id',_0x30e43d['id']]);if(!_0x6d712e)return _0x30e43d;return _0x6d712e[_0x25a6('0x3d')]({'raw':!![]})[_0x25a6('0x14')](function(_0x5f4c91){for(var _0x20fb4c=0x0;_0x20fb4c<_0x5f4c91[_0x25a6('0x38')];_0x20fb4c++){var _0x3110f8=_[_0x25a6('0x3c')](_0x1d7a3d,['id',_0x5f4c91[_0x20fb4c][_0x25a6('0x3e')]]);if(!_0x3110f8){_0x3110f8={'id':_0x5f4c91[_0x20fb4c][_0x25a6('0x3e')],'name':_0x5f4c91[_0x20fb4c]['UserId'],'accountcode':'','online':![]};}var _0x4eb410={'id':_0x3110f8['id'],'name':_0x3110f8[_0x25a6('0xf')],'internal':_0x3110f8[_0x25a6('0x3f')],'online':Boolean(_0x3110f8[_0x25a6('0x40')]),'paused':Boolean(_0x5f4c91[_0x20fb4c][_0x25a6('0x1f')])};if(_0x3110f8['voiceStatus']===_0x25a6('0x1e'))updateAgentVoiceStatus(_0x4eb410,_0x30e43d,_0x30915d);if(_0x4eb410[_0x25a6('0x40')])_0x30e43d[_0x25a6('0x33')]++;if(_0x4eb410[_0x25a6('0x35')])_0x30e43d['busy']++;if(_0x4eb410[_0x25a6('0x1f')]&&!_0x4eb410[_0x25a6('0x35')]&&!_0x4eb410[_0x25a6('0x1e')])_0x30e43d[_0x25a6('0x1f')]++;_0x30e43d['agents'][_0x25a6('0x21')](_0x4eb410);}return _0x30e43d;});}function getQueueAgents(_0x7ecdd8,_0x5ce886,_0x545660){var _0x27e806=_0x25a6('0x41')+_['startCase'](_0x545660)+_0x25a6('0x42');var _0x148814=_0x545660+_0x25a6('0x43');return db[_0x27e806][_0x25a6('0x44')]({'where':{[_[_0x25a6('0x12')](_0x545660)+_0x25a6('0x45')]:_0x7ecdd8['id']},'raw':!![]})[_0x25a6('0x14')](function(_0x154887){for(var _0x3b3961=0x0;_0x3b3961<_0x154887['length'];_0x3b3961++){var _0x538b26=_['find'](_0x5ce886,['id',_0x154887[_0x3b3961][_0x25a6('0x3e')]]);if(!_0x538b26){_0x538b26={'id':_0x154887[_0x3b3961][_0x25a6('0x3e')],'name':_0x154887[_0x3b3961][_0x25a6('0x3e')],'online':![],['pauseField']:![]};}var _0x1c9fa9={'id':_0x538b26['id'],'name':_0x538b26[_0x25a6('0xf')],'online':Boolean(_0x538b26[_0x25a6('0x40')]),'paused':Boolean(_0x538b26[_0x148814])};if(_0x1c9fa9[_0x25a6('0x40')])_0x7ecdd8['loggedInDb']++;_0x7ecdd8[_0x25a6('0x32')][_0x25a6('0x21')](_0x1c9fa9);}return _0x7ecdd8;});}function validateChannel(_0x59f7e2){var _0x52c3c0=utils['getChannels']();if(!_[_0x25a6('0x46')](_0x52c3c0,_0x59f7e2[_0x25a6('0x47')]()))throw new Error(_0x25a6('0x48'));return _0x59f7e2[_0x25a6('0x47')]();}exports['getAgents']=function(_0x5ac04c,_0x3ff086){var _0x13e01f={'count':0x0,'rows':[]};var _0x4e76e6={};var _0x571459;var _0x5e0eab;var _0x567a35;var _0x18691d;var _0x46d55f=utils[_0x25a6('0x49')]();var _0x1b91a6=_0x5ac04c[_0x25a6('0x4a')][_0x25a6('0x4b')];var _0x2a5a84=_0x5ac04c['query'][_0x25a6('0x4c')];var _0x446c21=_0x5ac04c[_0x25a6('0x4a')]['pauseTypeFilter'];var _0x448009=_0x2a5a84==='pause'||_0x2a5a84===_0x25a6('0x4d')?!![]:![];var _0x13d7b3=[];var _0x2077ef;Promise[_0x25a6('0x4e')]()[_0x25a6('0x14')](function(){if(_0x5ac04c[_0x25a6('0x4a')]['channel']){_0x571459=validateChannel(_0x5ac04c['query'][_0x25a6('0x4f')]);}if(!_0x5ac04c[_0x25a6('0x4a')][_0x25a6('0x50')]||!_0x5ac04c['query']['sort']['includes'](_0x25a6('0x51'))){_0x5ac04c[_0x25a6('0x4a')][_0x25a6('0x50')]=rta['validateSortParameter'](_0x5ac04c[_0x25a6('0x4a')][_0x25a6('0x50')]);return;}var _0x3581c6=rta[_0x25a6('0x52')](_0x5ac04c[_0x25a6('0x4a')][_0x25a6('0x50')]);_0x5ac04c[_0x25a6('0x4a')][_0x25a6('0x50')]=_0x3581c6[_0x25a6('0x53')]['join'](',');_0x5e0eab=_0x3581c6[_0x25a6('0x54')];})[_0x25a6('0x14')](function(){if(!_0x1b91a6){return[];}return rta[_0x25a6('0x55')](_0x1b91a6,_0x571459);})[_0x25a6('0x14')](function(_0x2c7bc2){_0x13d7b3=_0x2c7bc2;return rta[_0x25a6('0x56')]();})[_0x25a6('0x14')](function(_0x649558){_0x18691d=_0x649558[_0x25a6('0x57')];if((!_0x2a5a84||_0x448009)&&!_0x5e0eab){return _0x13d7b3;}if(_0x5e0eab&&!_0x2a5a84){return rta[_0x25a6('0x58')](_0x18691d,_0x13d7b3,_0x5e0eab);}else{return rta['getAgentIdsByStatus'](_0x18691d,_0x13d7b3,_0x2a5a84);}})[_0x25a6('0x14')](function(_0x3a508a){_0x13d7b3=_0x3a508a;var _0x213c81=![];if(_0x13d7b3['length']===0x0){if(_0x1b91a6||_0x2a5a84){_0x213c81=!![];}if(_0x448009){_0x213c81=![];}}if(_0x213c81){return _0x13e01f;}var _0x51743c=_['map'](db[_0x25a6('0x41')][_0x25a6('0x59')],function(_0x17af4c){return{'name':_0x17af4c[_0x25a6('0x5a')],'type':_0x17af4c['type'][_0x25a6('0x5b')]};});_0x5ac04c['query'][_0x25a6('0x5c')]=_0x25a6('0x5d');_0x5ac04c[_0x25a6('0x4a')][_0x25a6('0x40')]=!![];_0x4e76e6=qs[_0x25a6('0x5e')](_0x51743c,_0x5ac04c);_0x4e76e6['raw']=!![];var _0x22fda1=[];if(_0x13d7b3[_0x25a6('0x38')]>0x0){_0x22fda1[_0x25a6('0x21')]({'id':{'$in':_0x13d7b3}});if(_0x5e0eab&&!_0x2a5a84){_0x2077ef=[db[_0x25a6('0x5f')][_0x25a6('0x60')](_0x25a6('0x61')+_0x13d7b3+')')];_0x4e76e6['order']=_0x2077ef;}}if(_0x448009){_0x46d55f[_0x25a6('0x62')](function(_0x5057c1){var _0x5a5bbb=!![];if(_0x2a5a84===_0x25a6('0x4d')&&_0x571459!==_0x5057c1){_0x5a5bbb=![];}_0x22fda1[_0x25a6('0x21')]({[_0x5057c1+_0x25a6('0x43')]:_0x5a5bbb});});if(_0x446c21){_0x22fda1[_0x25a6('0x21')]({'pauseType':_0x446c21});}}else if(_0x2a5a84){_0x46d55f['forEach'](function(_0x572943){_0x22fda1[_0x25a6('0x21')]({[_0x572943+_0x25a6('0x43')]:![]});});}_0x4e76e6['where']=_[_0x25a6('0x36')](_0x4e76e6[_0x25a6('0x63')],{'$and':_0x22fda1});if(_0x5ac04c['user'][_0x25a6('0x5c')]===_0x25a6('0x64')){var _0x5bc416={'params':{'id':_0x5ac04c['user'][_0x25a6('0x65')]},'query':{'section':_0x25a6('0x66'),'role':_0x25a6('0x5d'),'online':!![],'raw':!![],'ids':_0x13d7b3,'customSorting':_0x2077ef}};if(_0x448009){_0x5bc416['query']['extraQueryConditions']=_0x22fda1;}_0x5bc416[_0x25a6('0x4a')]=Object['assign'](_0x5bc416[_0x25a6('0x4a')],_0x5ac04c['query']);delete _0x5bc416[_0x25a6('0x4a')]['id'];return db[_0x25a6('0x67')][_0x25a6('0x68')](_0x5bc416);}return db[_0x25a6('0x41')][_0x25a6('0x69')](_0x4e76e6);})[_0x25a6('0x14')](function(_0x21b22b){_0x13e01f['count']=_0x21b22b[_0x25a6('0xa')];_0x567a35=_0x21b22b[_0x25a6('0x57')];return _0x567a35[_0x25a6('0x6a')](function(_0x1db117){var _0x13ff18=_[_0x25a6('0x3c')](_0x18691d,['id',_0x1db117['id']]);if(_0x13ff18){var _0x247b7b=rta['filterAgentAttributes'](_0x13ff18);_[_0x25a6('0x36')](_0x1db117,_0x247b7b);}_0x1db117[_0x25a6('0x51')]=rta['getAgentStatus'](_0x1db117);if(_0x1db117[_0x25a6('0x51')][_0x25a6('0x46')](_0x25a6('0x6b'))){_0x46d55f[_0x25a6('0x62')](function(_0x80da3a){if(_0x1db117[_0x80da3a+_0x25a6('0x43')]){_0x1db117[_0x80da3a+_0x25a6('0x6c')]=_0x25a6('0x6b');}});}return _0x1db117;});})[_0x25a6('0x14')](function(_0x58a0a0){if(!_0x5e0eab||_0x2077ef){return _0x58a0a0;}return rta[_0x25a6('0x6d')](_0x58a0a0,_0x5e0eab);})[_0x25a6('0x14')](function(_0x40885c){_0x13e01f[_0x25a6('0x57')]=_0x40885c;return _0x13e01f;})['then'](respondWithFilteredResult(_0x3ff086,_0x4e76e6))[_0x25a6('0x18')](handleError(_0x3ff086,null));};exports[_0x25a6('0x6e')]=function(_0xdb944a,_0x5ca2c4){var _0x34d132={'count':0x0,'rows':[]},_0x3ecbb1={},_0x1a7ec6,_0x532275,_0x54a0da,_0x4ba1a2,_0x5b3772;Promise['resolve']()[_0x25a6('0x14')](function(){if(_0xdb944a[_0x25a6('0x4a')]['channel'])_0x1a7ec6=validateChannel(_0xdb944a[_0x25a6('0x4a')][_0x25a6('0x4f')]);var _0x4ab729=_['startCase'](_0x1a7ec6)+_0x25a6('0x42');var _0x1f9944=_[_0x25a6('0x6a')](db[_0x4ab729]['rawAttributes'],function(_0x40f06e){return{'name':_0x40f06e[_0x25a6('0x5a')],'type':_0x40f06e[_0x25a6('0x6f')]['key']};});_0x3ecbb1=qs[_0x25a6('0x5e')](_0x1f9944,_0xdb944a);if(_0xdb944a[_0x25a6('0x64')][_0x25a6('0x5c')]===_0x25a6('0x64')){var _0x3c49ea={'params':{'id':_0xdb944a[_0x25a6('0x64')][_0x25a6('0x65')]},'query':{'section':_0x1a7ec6===_0x25a6('0x10')&&_0xdb944a[_0x25a6('0x4a')][_0x25a6('0x6f')]===_0x25a6('0x20')?'QueueCampaigns':_['startCase'](_0x1a7ec6)+'Queues','type':_0xdb944a[_0x25a6('0x4a')][_0x25a6('0x6f')],'nolimit':!![],'sort':'name','filter':_0xdb944a[_0x25a6('0x4a')][_0x25a6('0x70')]}};return db[_0x25a6('0x67')][_0x25a6('0x68')](_0x3c49ea);}return db[_0x4ab729][_0x25a6('0x69')](_0x3ecbb1);})['then'](function(_0x2f5fbc){_0x34d132['count']=_0x2f5fbc['count'];_0x532275=_0x2f5fbc[_0x25a6('0x57')];return getRealtimeQueues(_0xdb944a,_0x1a7ec6);})[_0x25a6('0x14')](function(_0x273e34){_0x4ba1a2=_0x273e34[_0x25a6('0x57')];return rta[_0x25a6('0x56')]();})['then'](function(_0x2f61a7){_0x54a0da=_0x2f61a7[_0x25a6('0x57')];if(_0x1a7ec6!=_0x25a6('0x10'))return;return getRealtimeVoiceQueueChannels();})[_0x25a6('0x14')](function(_0x37caa4){_0x5b3772=_0x37caa4?_0x37caa4['rows']:[];return initializeQueues(_0x532275,_0x4ba1a2,_0x1a7ec6,_0xdb944a[_0x25a6('0x4a')][_0x25a6('0x6f')]);})['then'](function(_0x2aeb28){var _0x5367c3=_0x2aeb28[_0x25a6('0x6a')](function(_0x748cf9){if(_0x1a7ec6==='voice')return getVoiceQueueAgents(_0x748cf9,_0x532275,_0x54a0da,_0x5b3772);else return getQueueAgents(_0x748cf9,_0x54a0da,_0x1a7ec6);});return Promise[_0x25a6('0x71')](_0x5367c3);})['then'](function(_0x1300cb){_0x34d132[_0x25a6('0x57')]=_0x1300cb;return _0x34d132;})[_0x25a6('0x14')](respondWithFilteredResult(_0x5ca2c4,_0x3ecbb1))[_0x25a6('0x18')](handleError(_0x5ca2c4,null));}; \ No newline at end of file +var _0x066b=['all','lodash','../../components/parsers/qs','../../config/utils','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','json','error','stack','name','voice','request','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','then','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','talking','pTalking','originated','message','dialActive','Trunk','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','agents','paused','loggedInDb','loggedIn','available','waiting','busy','outbound','merge','pick','filter','queue','length','some','connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','voiceStatus','online','push','User','Pause','findAll','QueueId','getChannels','toLowerCase','getAgents','query','globalQueueFilter','pauseTypeFilter','*pause','channel','sort','includes','globalStatus','getUpdatedSortOptions','fields','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','fieldName','type','key','agent','getOptions','raw','sequelize','literal','FIELD(id,','forEach','where','user','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','Status','pause','sortAgentsByStatus','getQueues','resolve','Queue','role','userProfileId','QueueCampaigns'];(function(_0x23a392,_0x429739){var _0x57bdb9=function(_0x5430b8){while(--_0x5430b8){_0x23a392['push'](_0x23a392['shift']());}};_0x57bdb9(++_0x429739);}(_0x066b,0x15d));var _0xb066=function(_0x17b6fd,_0x1626ef){_0x17b6fd=_0x17b6fd-0x0;var _0x5f1089=_0x066b[_0x17b6fd];return _0x5f1089;};'use strict';var util=require('util');var _=require(_0xb066('0x0'));var jayson=require('jayson/promise');var rta=require('../../components/realtime/agents');var qs=require(_0xb066('0x1'));var utils=require(_0xb066('0x2'));var logger=require(_0xb066('0x3'))('api');var db=require(_0xb066('0x4'))['db'];var amiClient=jayson[_0xb066('0x5')][_0xb066('0x6')]({'port':0x232a});var routingClient=jayson[_0xb066('0x5')]['http']({'port':0x232c});function respondWithFilteredResult(_0x5d6005,_0x271d88){return function(_0x4f5550){if(_0x4f5550){var _0xf20c93=typeof _0x271d88[_0xb066('0x7')]===_0xb066('0x8')&&typeof _0x271d88[_0xb066('0x9')]===_0xb066('0x8');var _0x37d305=_0x4f5550['count'];var _0x264980=_0xf20c93?0x0:_0x271d88[_0xb066('0x7')];var _0x1d04f3=_0xf20c93?_0x4f5550[_0xb066('0xa')]:_0x271d88[_0xb066('0x7')]+_0x271d88[_0xb066('0x9')];var _0x312c1d;if(_0x1d04f3>=_0x37d305){_0x1d04f3=_0x37d305;_0x312c1d=0xc8;}else{_0x312c1d=0xce;}_0x5d6005[_0xb066('0xb')](_0x312c1d);return _0x5d6005['set']('Content-Range',_0x264980+'-'+_0x1d04f3+'/'+_0x37d305)[_0xb066('0xc')](_0x4f5550);}return null;};}function handleError(_0x596d91,_0x547f6a){_0x547f6a=_0x547f6a||0x1f4;return function(_0x97c7df){logger[_0xb066('0xd')](_0x97c7df[_0xb066('0xe')]);if(_0x97c7df['name']){delete _0x97c7df[_0xb066('0xf')];}_0x596d91[_0xb066('0xb')](_0x547f6a)['send'](_0x97c7df);};}function getRealtimeQueues(_0x2b5b23,_0x5a17c4){return new Promise(function(_0x53836b,_0x13d215){var _0x27cf66=_0x5a17c4===_0xb066('0x10')?amiClient:routingClient;return _0x27cf66[_0xb066('0x11')](_[_0xb066('0x12')](_0x5a17c4)+_0xb066('0x13'),_0x2b5b23)['then'](function(_0x1ca530){if(_0x1ca530[_0xb066('0xd')])throw new Error(util[_0xb066('0x14')](_0xb066('0x15'),_0x5a17c4));return _0x53836b(_0x1ca530[_0xb066('0x16')]);})[_0xb066('0x17')](function(_0x140e3f){_0x13d215(_0x140e3f);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x117613,_0x5f2576){return amiClient[_0xb066('0x11')]('VoiceQueuesChannels',{})[_0xb066('0x18')](function(_0x394489){if(_0x394489['error'])throw new Error(_0xb066('0x19'));return _0x117613(_0x394489[_0xb066('0x16')]);})[_0xb066('0x17')](function(_0x43e963){_0x5f2576(_0x43e963);});});}function initializeQueues(_0x1a24ae,_0x110d05,_0x5557d0,_0x3b6b8e){var _0x1b6846=['loggedIn','available','waiting',_0xb066('0x1a'),'paused'];if(_0x5557d0===_0xb066('0x10')&&_0x3b6b8e==='outbound'){_0x1b6846['push'](_0xb066('0x1b'),_0xb066('0x1c'),_0xb066('0x1d'),_0xb066('0x1e'),'dialMethod',_0xb066('0x1f'),'startPredictive','startProgressive',_0xb066('0x20'),_0xb066('0x21'),'erlangAbandonmentRate',_0xb066('0x22'),_0xb066('0x23'),'dialPredictiveIntervalMaxThreshold',_0xb066('0x24'),_0xb066('0x25'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0xb066('0x26'),_0xb066('0x27'),'predictiveIntervalAvgTalktime');}return _0x1a24ae[_0xb066('0x28')](function(_0x5860c9){var _0x24a0dd=_0x5860c9['get']({'plain':!![]});_0x24a0dd[_0xb066('0x29')]=[];_0x24a0dd[_0xb066('0x2a')]=0x0;_0x24a0dd[_0xb066('0x2b')]=0x0;_0x24a0dd[_0xb066('0x2c')]=0x0;_0x24a0dd[_0xb066('0x2d')]=0x0;_0x24a0dd[_0xb066('0x2e')]=0x0;if(_0x5557d0===_0xb066('0x10')){_0x24a0dd['talking']=0x0;_0x24a0dd[_0xb066('0x2f')]=0x0;if(_0x3b6b8e===_0xb066('0x30')){_0x24a0dd['pTalking']=0x0;_0x24a0dd['originated']=0x0;}}var _0x1d687a=_['find'](_0x110d05,['id',_0x24a0dd['id']]);if(_0x1d687a)_[_0xb066('0x31')](_0x24a0dd,_[_0xb066('0x32')](_0x1d687a,_0x1b6846));return _0x24a0dd;});}function updateAgentVoiceStatus(_0x1d46c2,_0x56ad35,_0x21a2b6){var _0xc8ab0d=_[_0xb066('0x33')](_0x21a2b6,[_0xb066('0x34'),_0x56ad35['name']]);if(_0xc8ab0d[_0xb066('0x35')]===0x0)return _0x1d46c2[_0xb066('0x2f')]=!![];if(_[_0xb066('0x36')](_0xc8ab0d,[_0xb066('0x37'),_0x1d46c2[_0xb066('0x38')][_0xb066('0x39')]()]))return _0x1d46c2[_0xb066('0x1a')]=!![];if(!_0x1d46c2[_0xb066('0x1a')])return _0x1d46c2[_0xb066('0x2f')]=!![];}function getVoiceQueueAgents(_0x1ce7f1,_0x59992c,_0x1528e6,_0xde2ad8){var _0x14e193=_[_0xb066('0x3a')](_0x59992c,['id',_0x1ce7f1['id']]);if(!_0x14e193)return _0x1ce7f1;return _0x14e193[_0xb066('0x3b')]({'raw':!![]})['then'](function(_0xdc061f){for(var _0x18849e=0x0;_0x18849e<_0xdc061f[_0xb066('0x35')];_0x18849e++){var _0x22c93e=_[_0xb066('0x3a')](_0x1528e6,['id',_0xdc061f[_0x18849e]['UserId']]);if(!_0x22c93e){_0x22c93e={'id':_0xdc061f[_0x18849e][_0xb066('0x3c')],'name':_0xdc061f[_0x18849e][_0xb066('0x3c')],'accountcode':'','online':![]};}var _0x3c637d={'id':_0x22c93e['id'],'name':_0x22c93e[_0xb066('0xf')],'internal':_0x22c93e[_0xb066('0x3d')],'online':Boolean(_0x22c93e['online']),'paused':Boolean(_0xdc061f[_0x18849e]['paused'])};if(_0x22c93e[_0xb066('0x3e')]===_0xb066('0x1a'))updateAgentVoiceStatus(_0x3c637d,_0x1ce7f1,_0xde2ad8);if(_0x3c637d[_0xb066('0x3f')])_0x1ce7f1[_0xb066('0x2b')]++;if(_0x3c637d[_0xb066('0x2f')])_0x1ce7f1['busy']++;if(_0x3c637d['paused']&&!_0x3c637d[_0xb066('0x2f')]&&!_0x3c637d[_0xb066('0x1a')])_0x1ce7f1[_0xb066('0x2a')]++;_0x1ce7f1[_0xb066('0x29')][_0xb066('0x40')](_0x3c637d);}return _0x1ce7f1;});}function getQueueAgents(_0x189c89,_0x2c060b,_0x51a0a4){var _0x15a037=_0xb066('0x41')+_['startCase'](_0x51a0a4)+'Queue';var _0xe029a1=_0x51a0a4+_0xb066('0x42');return db[_0x15a037][_0xb066('0x43')]({'where':{[_[_0xb066('0x12')](_0x51a0a4)+_0xb066('0x44')]:_0x189c89['id']},'raw':!![]})[_0xb066('0x18')](function(_0x3e2980){for(var _0x4ad522=0x0;_0x4ad522<_0x3e2980[_0xb066('0x35')];_0x4ad522++){var _0x1c948b=_['find'](_0x2c060b,['id',_0x3e2980[_0x4ad522][_0xb066('0x3c')]]);if(!_0x1c948b){_0x1c948b={'id':_0x3e2980[_0x4ad522][_0xb066('0x3c')],'name':_0x3e2980[_0x4ad522]['UserId'],'online':![],['pauseField']:![]};}var _0x151474={'id':_0x1c948b['id'],'name':_0x1c948b[_0xb066('0xf')],'online':Boolean(_0x1c948b[_0xb066('0x3f')]),'paused':Boolean(_0x1c948b[_0xe029a1])};if(_0x151474[_0xb066('0x3f')])_0x189c89[_0xb066('0x2b')]++;_0x189c89[_0xb066('0x29')][_0xb066('0x40')](_0x151474);}return _0x189c89;});}function validateChannel(_0x197d0a){var _0x3780b0=utils[_0xb066('0x45')]();if(!_['includes'](_0x3780b0,_0x197d0a[_0xb066('0x46')]()))throw new Error('Invalid\x20channel');return _0x197d0a[_0xb066('0x46')]();}exports[_0xb066('0x47')]=function(_0x3e447d,_0x128369){var _0x5238db={'count':0x0,'rows':[]};var _0x140c73={};var _0x433a03;var _0x308872;var _0x3ecd0d;var _0x41c645;var _0x445762=utils[_0xb066('0x45')]();var _0x3d1495=_0x3e447d[_0xb066('0x48')][_0xb066('0x49')];var _0x2c9192=_0x3e447d['query']['globalStatusFilter'];var _0x48977c=_0x3e447d[_0xb066('0x48')][_0xb066('0x4a')];var _0x3f41e2=_0x2c9192==='pause'||_0x2c9192===_0xb066('0x4b')?!![]:![];var _0x1e32be=[];var _0x246ece;Promise['resolve']()['then'](function(){if(_0x3e447d[_0xb066('0x48')][_0xb066('0x4c')]){_0x433a03=validateChannel(_0x3e447d[_0xb066('0x48')][_0xb066('0x4c')]);}if(!_0x3e447d['query'][_0xb066('0x4d')]||!_0x3e447d['query'][_0xb066('0x4d')][_0xb066('0x4e')](_0xb066('0x4f'))){_0x3e447d[_0xb066('0x48')][_0xb066('0x4d')]=rta['validateSortParameter'](_0x3e447d['query']['sort']);return;}var _0x44259f=rta[_0xb066('0x50')](_0x3e447d['query'][_0xb066('0x4d')]);_0x3e447d[_0xb066('0x48')][_0xb066('0x4d')]=_0x44259f[_0xb066('0x51')]['join'](',');_0x308872=_0x44259f['order'];})[_0xb066('0x18')](function(){if(!_0x3d1495){return[];}return rta[_0xb066('0x52')](_0x3d1495,_0x433a03);})['then'](function(_0x3a8bd6){_0x1e32be=_0x3a8bd6;return rta[_0xb066('0x53')]();})[_0xb066('0x18')](function(_0x404028){_0x41c645=_0x404028[_0xb066('0x54')];if((!_0x2c9192||_0x3f41e2)&&!_0x308872){return _0x1e32be;}if(_0x308872&&!_0x2c9192){return rta[_0xb066('0x55')](_0x41c645,_0x1e32be,_0x308872);}else{return rta[_0xb066('0x56')](_0x41c645,_0x1e32be,_0x2c9192);}})['then'](function(_0x4fb6fc){_0x1e32be=_0x4fb6fc;var _0x2e8dfe=![];if(_0x1e32be[_0xb066('0x35')]===0x0){if(_0x3d1495||_0x2c9192){_0x2e8dfe=!![];}if(_0x3f41e2){_0x2e8dfe=![];}}if(_0x2e8dfe){return _0x5238db;}var _0x500f32=_[_0xb066('0x28')](db[_0xb066('0x41')][_0xb066('0x57')],function(_0x3f69b2){return{'name':_0x3f69b2[_0xb066('0x58')],'type':_0x3f69b2[_0xb066('0x59')][_0xb066('0x5a')]};});_0x3e447d['query']['role']=_0xb066('0x5b');_0x3e447d[_0xb066('0x48')][_0xb066('0x3f')]=!![];_0x140c73=qs[_0xb066('0x5c')](_0x500f32,_0x3e447d);_0x140c73[_0xb066('0x5d')]=!![];var _0x5e0881=[];if(_0x1e32be[_0xb066('0x35')]>0x0){_0x5e0881['push']({'id':{'$in':_0x1e32be}});if(_0x308872&&!_0x2c9192){_0x246ece=[db[_0xb066('0x5e')][_0xb066('0x5f')](_0xb066('0x60')+_0x1e32be+')')];_0x140c73['order']=_0x246ece;}}if(_0x3f41e2){_0x445762[_0xb066('0x61')](function(_0x2658c1){var _0x32c71b=!![];if(_0x2c9192===_0xb066('0x4b')&&_0x433a03!==_0x2658c1){_0x32c71b=![];}_0x5e0881[_0xb066('0x40')]({[_0x2658c1+_0xb066('0x42')]:_0x32c71b});});if(_0x48977c){_0x5e0881[_0xb066('0x40')]({'pauseType':_0x48977c});}}else if(_0x2c9192){_0x445762['forEach'](function(_0x1d3694){_0x5e0881[_0xb066('0x40')]({[_0x1d3694+_0xb066('0x42')]:![]});});}_0x140c73[_0xb066('0x62')]=_[_0xb066('0x31')](_0x140c73['where'],{'$and':_0x5e0881});if(_0x3e447d['user']['role']===_0xb066('0x63')){var _0x97bc67={'params':{'id':_0x3e447d[_0xb066('0x63')]['userProfileId']},'query':{'section':_0xb066('0x64'),'role':_0xb066('0x5b'),'online':!![],'raw':!![],'ids':_0x1e32be,'customSorting':_0x246ece}};if(_0x3f41e2){_0x97bc67['query'][_0xb066('0x65')]=_0x5e0881;}_0x97bc67[_0xb066('0x48')]=Object[_0xb066('0x66')](_0x97bc67['query'],_0x3e447d['query']);delete _0x97bc67['query']['id'];return db[_0xb066('0x67')][_0xb066('0x68')](_0x97bc67);}return db[_0xb066('0x41')][_0xb066('0x69')](_0x140c73);})['then'](function(_0x129a76){_0x5238db[_0xb066('0xa')]=_0x129a76[_0xb066('0xa')];_0x3ecd0d=_0x129a76[_0xb066('0x54')];return _0x3ecd0d['map'](function(_0x4ca48e){var _0x338ebd=_[_0xb066('0x3a')](_0x41c645,['id',_0x4ca48e['id']]);if(_0x338ebd){var _0x33e71f=rta['filterAgentAttributes'](_0x338ebd);_[_0xb066('0x31')](_0x4ca48e,_0x33e71f);}_0x4ca48e[_0xb066('0x4f')]=rta['getAgentStatus'](_0x4ca48e);if(_0x4ca48e[_0xb066('0x4f')][_0xb066('0x4e')]('pause')){_0x445762[_0xb066('0x61')](function(_0x51c9c1){if(_0x4ca48e[_0x51c9c1+'Pause']){_0x4ca48e[_0x51c9c1+_0xb066('0x6a')]=_0xb066('0x6b');}});}return _0x4ca48e;});})[_0xb066('0x18')](function(_0xed20f8){if(!_0x308872||_0x246ece){return _0xed20f8;}return rta[_0xb066('0x6c')](_0xed20f8,_0x308872);})[_0xb066('0x18')](function(_0x1e018f){_0x5238db[_0xb066('0x54')]=_0x1e018f;return _0x5238db;})[_0xb066('0x18')](respondWithFilteredResult(_0x128369,_0x140c73))[_0xb066('0x17')](handleError(_0x128369,null));};exports[_0xb066('0x6d')]=function(_0x879ad5,_0x3341b1){var _0x22d393={'count':0x0,'rows':[]},_0x5830f0={},_0x584cfb,_0x48fab1,_0x4cf5cd,_0xc7f6e8,_0x2c407d;Promise[_0xb066('0x6e')]()[_0xb066('0x18')](function(){if(_0x879ad5[_0xb066('0x48')][_0xb066('0x4c')])_0x584cfb=validateChannel(_0x879ad5[_0xb066('0x48')]['channel']);var _0x44540c=_[_0xb066('0x12')](_0x584cfb)+_0xb066('0x6f');var _0x5cd99e=_[_0xb066('0x28')](db[_0x44540c]['rawAttributes'],function(_0x57a731){return{'name':_0x57a731['fieldName'],'type':_0x57a731[_0xb066('0x59')]['key']};});_0x5830f0=qs[_0xb066('0x5c')](_0x5cd99e,_0x879ad5);if(_0x879ad5['user'][_0xb066('0x70')]===_0xb066('0x63')){var _0x3cf4f5={'params':{'id':_0x879ad5[_0xb066('0x63')][_0xb066('0x71')]},'query':{'section':_0x584cfb===_0xb066('0x10')&&_0x879ad5[_0xb066('0x48')][_0xb066('0x59')]===_0xb066('0x30')?_0xb066('0x72'):_[_0xb066('0x12')](_0x584cfb)+_0xb066('0x13'),'type':_0x879ad5[_0xb066('0x48')]['type'],'nolimit':!![],'sort':'name','filter':_0x879ad5[_0xb066('0x48')][_0xb066('0x33')]}};return db[_0xb066('0x67')][_0xb066('0x68')](_0x3cf4f5);}return db[_0x44540c][_0xb066('0x69')](_0x5830f0);})[_0xb066('0x18')](function(_0x382223){_0x22d393[_0xb066('0xa')]=_0x382223['count'];_0x48fab1=_0x382223['rows'];return getRealtimeQueues(_0x879ad5,_0x584cfb);})['then'](function(_0x49a76a){_0xc7f6e8=_0x49a76a['rows'];return rta[_0xb066('0x53')]();})['then'](function(_0x6fae8f){_0x4cf5cd=_0x6fae8f[_0xb066('0x54')];if(_0x584cfb!=_0xb066('0x10'))return;return getRealtimeVoiceQueueChannels();})[_0xb066('0x18')](function(_0x499f20){_0x2c407d=_0x499f20?_0x499f20[_0xb066('0x54')]:[];return initializeQueues(_0x48fab1,_0xc7f6e8,_0x584cfb,_0x879ad5[_0xb066('0x48')]['type']);})[_0xb066('0x18')](function(_0x198da1){var _0x525b5f=_0x198da1[_0xb066('0x28')](function(_0x225a63){if(_0x584cfb===_0xb066('0x10'))return getVoiceQueueAgents(_0x225a63,_0x48fab1,_0x4cf5cd,_0x2c407d);else return getQueueAgents(_0x225a63,_0x4cf5cd,_0x584cfb);});return Promise[_0xb066('0x73')](_0x525b5f);})[_0xb066('0x18')](function(_0x350a4b){_0x22d393[_0xb066('0x54')]=_0x350a4b;return _0x22d393;})['then'](respondWithFilteredResult(_0x3341b1,_0x5830f0))[_0xb066('0x17')](handleError(_0x3341b1,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 0104d31..8c61987 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1b27ef,_0x1a58d8){var _0x35a4ef=function(_0x1f0b36){while(--_0x1f0b36){_0x1b27ef['push'](_0x1b27ef['shift']());}};_0x35a4ef(++_0x1a58d8);}(_0xe706,0xa3));var _0x6e70=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xe706[_0x4de586];return _0x46baf5;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x27b39d,_0x50a67d){var _0x3bfb3a=function(_0x22f451){while(--_0x22f451){_0x27b39d['push'](_0x27b39d['shift']());}};_0x3bfb3a(++_0x50a67d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xcb91[_0x215dc8];return _0x583ea3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index f85d601..c5f2002 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 _0x323f=['DATE','INTEGER','exports','STRING'];(function(_0x13c238,_0x56caa3){var _0x7331e8=function(_0x4b40af){while(--_0x4b40af){_0x13c238['push'](_0x13c238['shift']());}};_0x7331e8(++_0x56caa3);}(_0x323f,0x1ee));var _0xf323=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x323f[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require('sequelize');module[_0xf323('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf323('0x1')]},'scheduledat':{'type':Sequelize[_0xf323('0x2')]},'uniqueid':{'type':Sequelize[_0xf323('0x1')]},'starttime':{'type':Sequelize[_0xf323('0x2')]},'responsetime':{'type':Sequelize[_0xf323('0x2')]},'ringtime':{'type':Sequelize[_0xf323('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf323('0x1')]},'campaigntype':{'type':Sequelize[_0xf323('0x1')]},'membername':{'type':Sequelize[_0xf323('0x1')]}}; \ No newline at end of file +var _0x9300=['sequelize','STRING','DATE'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9300,0x153));var _0x0930=function(_0x34c3ac,_0x40a7f4){_0x34c3ac=_0x34c3ac-0x0;var _0x6661a1=_0x9300[_0x34c3ac];return _0x6661a1;};'use strict';var Sequelize=require(_0x0930('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0930('0x1')]},'scheduledat':{'type':Sequelize[_0x0930('0x2')]},'uniqueid':{'type':Sequelize[_0x0930('0x1')]},'starttime':{'type':Sequelize[_0x0930('0x2')]},'responsetime':{'type':Sequelize[_0x0930('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0930('0x1')]},'campaigntype':{'type':Sequelize[_0x0930('0x1')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index bc060fd..1fce8ff 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 _0x0c89=['../../config/logger','moment','bluebird','path','rimraf','define','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x0c89,0x155));var _0x90c8=function(_0x2ae96e,_0x1dfc61){_0x2ae96e=_0x2ae96e-0x0;var _0x3565fe=_0x0c89[_0x2ae96e];return _0x3565fe;};'use strict';var _=require(_0x90c8('0x0'));var util=require('util');var logger=require(_0x90c8('0x1'))('api');var moment=require(_0x90c8('0x2'));var BPromise=require(_0x90c8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90c8('0x4'));var rimraf=require(_0x90c8('0x5'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x665a6b,_0x340a69){return _0x665a6b[_0x90c8('0x6')](_0x90c8('0x7'),attributes,{'tableName':_0x90c8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82f4=['define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0x4a232c,_0x4db76b){var _0xb5807f=function(_0x2e1e16){while(--_0x2e1e16){_0x4a232c['push'](_0x4a232c['shift']());}};_0xb5807f(++_0x4db76b);}(_0x82f4,0x1d4));var _0x482f=function(_0x29a398,_0x1fcb02){_0x29a398=_0x29a398-0x0;var _0x24d3ed=_0x82f4[_0x29a398];return _0x24d3ed;};'use strict';var _=require(_0x482f('0x0'));var util=require(_0x482f('0x1'));var logger=require(_0x482f('0x2'))(_0x482f('0x3'));var moment=require(_0x482f('0x4'));var BPromise=require(_0x482f('0x5'));var rp=require(_0x482f('0x6'));var fs=require('fs');var path=require(_0x482f('0x7'));var rimraf=require(_0x482f('0x8'));var config=require(_0x482f('0x9'));var attributes=require(_0x482f('0xa'));module[_0x482f('0xb')]=function(_0x4228e6,_0xa8bd0b){return _0x4228e6[_0x482f('0xc')](_0x482f('0xd'),attributes,{'tableName':_0x482f('0xe'),'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 7e7f276..b940584 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 _0xbefa=['../../config/environment','client','then','info','request\x20sent','stringify','code','error','ReportAgentPreview,\x20%s,\x20%s','message','ReportAgentPreview','create','options','CreateReportAgentPreview','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbefa,0xa6));var _0xabef=function(_0x1c0eda,_0x16355c){_0x1c0eda=_0x1c0eda-0x0;var _0x53b8bc=_0xbefa[_0x1c0eda];return _0x53b8bc;};'use strict';var _=require('lodash');var util=require(_0xabef('0x0'));var moment=require(_0xabef('0x1'));var BPromise=require(_0xabef('0x2'));var rs=require(_0xabef('0x3'));var fs=require('fs');var Redis=require(_0xabef('0x4'));var db=require(_0xabef('0x5'))['db'];var utils=require(_0xabef('0x6'));var logger=require(_0xabef('0x7'))(_0xabef('0x8'));var config=require(_0xabef('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xabef('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f1b47,_0x5eef32,_0x55d510){return new BPromise(function(_0x28401b,_0x306e8e){return client['request'](_0x3f1b47,_0x55d510)[_0xabef('0xb')](function(_0x1785fe){logger[_0xabef('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x5eef32,_0xabef('0xd'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x5eef32,_0xabef('0xd'),JSON[_0xabef('0xe')](_0x1785fe));if(_0x1785fe['error']){if(_0x1785fe['error'][_0xabef('0xf')]===0x1f4){logger[_0xabef('0x10')](_0xabef('0x11'),_0x5eef32,_0x1785fe['error'][_0xabef('0x12')]);return _0x306e8e(_0x1785fe[_0xabef('0x10')][_0xabef('0x12')]);}logger[_0xabef('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x5eef32,_0x1785fe[_0xabef('0x10')][_0xabef('0x12')]);return _0x28401b(_0x1785fe['error']['message']);}else{logger[_0xabef('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x5eef32,_0xabef('0xd'));_0x28401b(_0x1785fe['result'][_0xabef('0x12')]);}})['catch'](function(_0x1e499e){logger['error'](_0xabef('0x11'),_0x5eef32,_0x1e499e);_0x306e8e(_0x1e499e);});});}exports['CreateReportAgentPreview']=function(_0xf37878){var _0x505b4a=this;return new Promise(function(_0x540100,_0x7b2db3){return db[_0xabef('0x13')][_0xabef('0x14')](_0xf37878['body'],{'raw':_0xf37878[_0xabef('0x15')]?_0xf37878[_0xabef('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4dd72c){logger[_0xabef('0xc')](_0xabef('0x16'),_0xf37878);logger[_0xabef('0x17')](_0xabef('0x16'),_0xf37878,JSON[_0xabef('0xe')](_0x4dd72c));_0x540100(_0x4dd72c);})[_0xabef('0x18')](function(_0x4b1826){logger[_0xabef('0x10')]('CreateReportAgentPreview',_0x4b1826[_0xabef('0x12')],_0xf37878);_0x7b2db3(_0x505b4a['error'](0x1f4,_0x4b1826['message']));});});}; \ No newline at end of file +var _0xf0d3=['code','message','info','request\x20sent','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf0d3,0xba));var _0x3f0d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf0d3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f0d('0x0'));var util=require(_0x3f0d('0x1'));var moment=require('moment');var BPromise=require(_0x3f0d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f0d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f0d('0x4'));var logger=require('../../config/logger')(_0x3f0d('0x5'));var config=require(_0x3f0d('0x6'));var jayson=require(_0x3f0d('0x7'));var client=jayson[_0x3f0d('0x8')][_0x3f0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481868,_0x4ed5e3,_0x48ba3e){return new BPromise(function(_0x1b77af,_0x4191f5){return client[_0x3f0d('0xa')](_0x481868,_0x48ba3e)[_0x3f0d('0xb')](function(_0x13ae82){logger['info'](_0x3f0d('0xc'),_0x4ed5e3,'request\x20sent');logger[_0x3f0d('0xd')](_0x3f0d('0xe'),_0x4ed5e3,'request\x20sent',JSON[_0x3f0d('0xf')](_0x13ae82));if(_0x13ae82[_0x3f0d('0x10')]){if(_0x13ae82[_0x3f0d('0x10')][_0x3f0d('0x11')]===0x1f4){logger['error'](_0x3f0d('0xc'),_0x4ed5e3,_0x13ae82[_0x3f0d('0x10')][_0x3f0d('0x12')]);return _0x4191f5(_0x13ae82[_0x3f0d('0x10')][_0x3f0d('0x12')]);}logger[_0x3f0d('0x10')](_0x3f0d('0xc'),_0x4ed5e3,_0x13ae82['error']['message']);return _0x1b77af(_0x13ae82['error'][_0x3f0d('0x12')]);}else{logger[_0x3f0d('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x4ed5e3,_0x3f0d('0x14'));_0x1b77af(_0x13ae82[_0x3f0d('0x15')][_0x3f0d('0x12')]);}})[_0x3f0d('0x16')](function(_0x30dfb7){logger['error'](_0x3f0d('0xc'),_0x4ed5e3,_0x30dfb7);_0x4191f5(_0x30dfb7);});});}exports[_0x3f0d('0x17')]=function(_0x44054a){var _0x50b677=this;return new Promise(function(_0x5dc9b7,_0x1e2a1e){return db[_0x3f0d('0x18')][_0x3f0d('0x19')](_0x44054a[_0x3f0d('0x1a')],{'raw':_0x44054a[_0x3f0d('0x1b')]?_0x44054a['options'][_0x3f0d('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x112f19){logger[_0x3f0d('0x13')](_0x3f0d('0x17'),_0x44054a);logger[_0x3f0d('0xd')]('CreateReportAgentPreview',_0x44054a,JSON[_0x3f0d('0xf')](_0x112f19));_0x5dc9b7(_0x112f19);})[_0x3f0d('0x16')](function(_0x300aea){logger[_0x3f0d('0x10')]('CreateReportAgentPreview',_0x300aea[_0x3f0d('0x12')],_0x44054a);_0x1e2a1e(_0x50b677[_0x3f0d('0x10')](0x1f4,_0x300aea[_0x3f0d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 24e1a1e..aef2918 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 _0x161a=['chat','/chat/queues/:id','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','path','express','../../components/auth/service','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x161a,0x140));var _0xa161=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x161a[_0x13b392];return _0x39db24;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa161('0x0'));var express=require(_0xa161('0x1'));var router=express['Router']();var auth=require(_0xa161('0x2'));var controller=require('./rpc.controller');router[_0xa161('0x3')](_0xa161('0x4'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0xa161('0x3')](_0xa161('0x5'),auth[_0xa161('0x6')](),controller[_0xa161('0x7')]);router[_0xa161('0x3')](_0xa161('0x8'),auth[_0xa161('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0xa161('0x3')](_0xa161('0x9'),auth[_0xa161('0x6')](),controller[_0xa161('0xa')]);router[_0xa161('0x3')](_0xa161('0xb'),auth[_0xa161('0x6')](),controller[_0xa161('0xc')]);router[_0xa161('0x3')](_0xa161('0xd'),auth[_0xa161('0x6')](),controller[_0xa161('0xe')]);router[_0xa161('0x3')]('/mail/accounts',auth[_0xa161('0x6')](),controller[_0xa161('0xf')]);router[_0xa161('0x3')](_0xa161('0x10'),auth['isAuthenticated'](),controller[_0xa161('0x11')]);router[_0xa161('0x3')]('/sms/queues',auth[_0xa161('0x6')](),controller[_0xa161('0x12')]);router['get'](_0xa161('0x13'),auth[_0xa161('0x6')](),controller[_0xa161('0x14')]);router['get'](_0xa161('0x15'),auth[_0xa161('0x6')](),controller[_0xa161('0x16')]);router[_0xa161('0x3')](_0xa161('0x17'),auth[_0xa161('0x6')](),controller[_0xa161('0x18')]);router['get'](_0xa161('0x19'),auth[_0xa161('0x6')](),controller['voiceQueuesChannels']);router[_0xa161('0x3')]('/voice/queues/channels/:uniqueid',auth[_0xa161('0x6')](),controller[_0xa161('0x1a')]);router[_0xa161('0x3')](_0xa161('0x1b'),auth[_0xa161('0x6')](),controller['voiceQueuesChannelHangup']);router[_0xa161('0x3')](_0xa161('0x1c'),auth[_0xa161('0x6')](),controller[_0xa161('0x1d')]);router[_0xa161('0x3')](_0xa161('0x1e'),auth[_0xa161('0x6')](),controller[_0xa161('0x1f')]);router[_0xa161('0x20')](_0xa161('0x1e'),auth[_0xa161('0x6')](),controller['updateVoiceQueue']);router[_0xa161('0x3')](_0xa161('0x21'),auth[_0xa161('0x6')](),controller[_0xa161('0x22')]);router[_0xa161('0x3')](_0xa161('0x23'),auth[_0xa161('0x6')](),controller[_0xa161('0x24')]);router[_0xa161('0x3')](_0xa161('0x25'),auth[_0xa161('0x6')](),controller['agents']);router[_0xa161('0x20')]('/agents/:id/capacity',auth[_0xa161('0x6')](),controller[_0xa161('0x26')]);router[_0xa161('0x3')](_0xa161('0x27'),auth[_0xa161('0x6')](),controller[_0xa161('0x28')]);router[_0xa161('0x3')](_0xa161('0x29'),auth[_0xa161('0x6')](),controller[_0xa161('0x2a')]);router[_0xa161('0x3')](_0xa161('0x2b'),auth[_0xa161('0x6')](),controller[_0xa161('0x2c')]);router[_0xa161('0x3')]('/fax/accounts',auth[_0xa161('0x6')](),controller['faxAccounts']);router[_0xa161('0x3')]('/chat/queues/waitinginteractions',auth[_0xa161('0x6')](),controller[_0xa161('0x2d')]);router[_0xa161('0x3')](_0xa161('0x2e'),auth[_0xa161('0x6')](),controller[_0xa161('0x2f')]);router[_0xa161('0x3')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xa161('0x30')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xa161('0x31')]);router[_0xa161('0x3')](_0xa161('0x32'),auth[_0xa161('0x6')](),controller[_0xa161('0x33')]);router[_0xa161('0x3')]('/whatsapp/queues/waitinginteractions',auth[_0xa161('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0xa161('0x3')](_0xa161('0x34'),auth['isAuthenticated'](),controller[_0xa161('0x35')]);router[_0xa161('0x36')](_0xa161('0x37'),auth['isAuthenticated'](),controller[_0xa161('0x38')](_0xa161('0x39')));router[_0xa161('0x3')](_0xa161('0x3a'),auth[_0xa161('0x6')](),controller[_0xa161('0x3b')]);router[_0xa161('0x36')]('/chat/queues/:id/notify',auth[_0xa161('0x6')](),controller['queueNotify'](_0xa161('0x3c')));router['get'](_0xa161('0x3d'),auth[_0xa161('0x6')](),controller['showChatQueues']);router['post']('/fax/queues/:id/notify',auth[_0xa161('0x6')](),controller[_0xa161('0x38')](_0xa161('0x3e')));router['get'](_0xa161('0x3f'),auth[_0xa161('0x6')](),controller[_0xa161('0x40')]);router[_0xa161('0x36')](_0xa161('0x41'),auth[_0xa161('0x6')](),controller[_0xa161('0x38')](_0xa161('0x42')));router[_0xa161('0x3')](_0xa161('0x43'),auth[_0xa161('0x6')](),controller[_0xa161('0x44')]);router[_0xa161('0x36')](_0xa161('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0xa161('0x46')));router['post']('/whatsapp/queues/:id/notify',auth[_0xa161('0x6')](),controller[_0xa161('0x38')]('whatsapp'));router[_0xa161('0x3')](_0xa161('0x47'),auth[_0xa161('0x6')](),controller['showSmsQueues']);router[_0xa161('0x3')](_0xa161('0x48'),auth[_0xa161('0x6')](),controller[_0xa161('0x49')]);router[_0xa161('0x36')](_0xa161('0x4a'),auth[_0xa161('0x6')](),controller[_0xa161('0x4b')]);module['exports']=router; \ No newline at end of file +var _0xd6c5=['/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions'];(function(_0xac4196,_0x3f58aa){var _0x97704a=function(_0xcadbde){while(--_0xcadbde){_0xac4196['push'](_0xac4196['shift']());}};_0x97704a(++_0x3f58aa);}(_0xd6c5,0x11e));var _0x5d6c=function(_0x1c138a,_0x33fd13){_0x1c138a=_0x1c138a-0x0;var _0xd22ce8=_0xd6c5[_0x1c138a];return _0xd22ce8;};'use strict';var multer=require(_0x5d6c('0x0'));var util=require('util');var path=require(_0x5d6c('0x1'));var express=require(_0x5d6c('0x2'));var router=express[_0x5d6c('0x3')]();var auth=require(_0x5d6c('0x4'));var controller=require(_0x5d6c('0x5'));router[_0x5d6c('0x6')](_0x5d6c('0x7'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x9')]);router['get'](_0x5d6c('0xa'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0xb')]);router[_0x5d6c('0x6')](_0x5d6c('0xc'),auth[_0x5d6c('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x5d6c('0x6')]('/voice/queues',auth[_0x5d6c('0x8')](),controller[_0x5d6c('0xd')]);router[_0x5d6c('0x6')](_0x5d6c('0xe'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0xf')]);router[_0x5d6c('0x6')]('/mail/queues',auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x10')]);router['get']('/mail/accounts',auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x11')]);router['get'](_0x5d6c('0x12'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x13')]);router[_0x5d6c('0x6')](_0x5d6c('0x14'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x15')]);router[_0x5d6c('0x6')]('/whatsapp/queues',auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x16')]);router[_0x5d6c('0x6')]('/fax/queues',auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x17')]);router[_0x5d6c('0x6')](_0x5d6c('0x18'),auth[_0x5d6c('0x8')](),controller['voiceQueuesPreview']);router['get'](_0x5d6c('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x5d6c('0x6')](_0x5d6c('0x1a'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x1b')]);router[_0x5d6c('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x5d6c('0x1c')]);router[_0x5d6c('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0x5d6c('0x1d')]);router[_0x5d6c('0x6')](_0x5d6c('0x1e'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x1f')]);router[_0x5d6c('0x20')](_0x5d6c('0x1e'),auth['isAuthenticated'](),controller[_0x5d6c('0x21')]);router[_0x5d6c('0x6')](_0x5d6c('0x22'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x23')]);router['get'](_0x5d6c('0x24'),auth[_0x5d6c('0x8')](),controller['outboundChannels']);router[_0x5d6c('0x6')](_0x5d6c('0x25'),auth[_0x5d6c('0x8')](),controller['agents']);router['put'](_0x5d6c('0x26'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x27')]);router[_0x5d6c('0x6')](_0x5d6c('0x28'),auth['isAuthenticated'](),controller[_0x5d6c('0x29')]);router['get'](_0x5d6c('0x2a'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x2b')]);router['get'](_0x5d6c('0x2c'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x2d')]);router[_0x5d6c('0x6')](_0x5d6c('0x2e'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x5d6c('0x6')]('/chat/queues/waitinginteractions',auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x2f')]);router[_0x5d6c('0x6')](_0x5d6c('0x30'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x31')]);router[_0x5d6c('0x6')](_0x5d6c('0x32'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x33')]);router[_0x5d6c('0x6')](_0x5d6c('0x34'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x35')]);router['get'](_0x5d6c('0x36'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x37')]);router[_0x5d6c('0x6')](_0x5d6c('0x38'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x39')]);router[_0x5d6c('0x6')](_0x5d6c('0x3a'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x3b')]);router[_0x5d6c('0x3c')](_0x5d6c('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x5d6c('0x3e')));router[_0x5d6c('0x6')](_0x5d6c('0x3f'),auth['isAuthenticated'](),controller[_0x5d6c('0x40')]);router['post'](_0x5d6c('0x41'),auth['isAuthenticated'](),controller[_0x5d6c('0x42')](_0x5d6c('0x43')));router[_0x5d6c('0x6')](_0x5d6c('0x44'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x45')]);router['post'](_0x5d6c('0x46'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x42')](_0x5d6c('0x47')));router[_0x5d6c('0x6')](_0x5d6c('0x48'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x49')]);router[_0x5d6c('0x3c')](_0x5d6c('0x4a'),auth['isAuthenticated'](),controller[_0x5d6c('0x42')](_0x5d6c('0x4b')));router['get'](_0x5d6c('0x4c'),auth[_0x5d6c('0x8')](),controller[_0x5d6c('0x4d')]);router['post'](_0x5d6c('0x4e'),auth['isAuthenticated'](),controller[_0x5d6c('0x42')](_0x5d6c('0x4f')));router['post'](_0x5d6c('0x50'),auth['isAuthenticated'](),controller['queueNotify']('whatsapp'));router['get'](_0x5d6c('0x51'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x5d6c('0x6')](_0x5d6c('0x52'),auth[_0x5d6c('0x8')](),controller['showWhatsappQueues']);router[_0x5d6c('0x3c')](_0x5d6c('0x53'),auth['isAuthenticated'](),controller[_0x5d6c('0x54')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index b9197e6..270bb3f 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 _0xeec6=['YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','queue','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','\x20Message\x20not\x20found','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','message','result','status','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','catch','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','INTERACTION','length','format','SIP/%s','interface'];(function(_0x20e94b,_0x4d64d1){var _0x5ab9b9=function(_0x2b1b72){while(--_0x2b1b72){_0x20e94b['push'](_0x20e94b['shift']());}};_0x5ab9b9(++_0x4d64d1);}(_0xeec6,0x1c2));var _0x6eec=function(_0x13fd59,_0x2e05b1){_0x13fd59=_0x13fd59-0x0;var _0x2e6ce7=_0xeec6[_0x13fd59];return _0x2e6ce7;};'use strict';var BPromise=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var _=require(_0x6eec('0x2'));var util=require(_0x6eec('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6eec('0x4'))(_0x6eec('0x5'));var jayson=require(_0x6eec('0x6'));var amiClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232a});var mailClient=jayson[_0x6eec('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){var _0x56e849=_0x1c810e?_0x1c810e:amiClient;return _0x56e849[_0x6eec('0x9')](_0x48064a,_0x5a5e47)[_0x6eec('0xa')](function(_0x1c774d){if(_0x1c774d['error']){if(_0x1c774d['error']['code']===0x1f4){return _0x834c2(_0x1c774d[_0x6eec('0xb')][_0x6eec('0xc')]);}return _0x3443c2(_0x1c774d['error']['message']);}else{_0x3443c2(_0x1c774d[_0x6eec('0xd')]);}})['catch'](function(_0x3091d0){_0x834c2(_0x3091d0);});});}function respondWithResult(_0x3387c2,_0x162db1){_0x162db1=_0x162db1||0xc8;return function(_0x3fe94b){if(_0x3fe94b){return _0x3387c2[_0x6eec('0xe')](_0x162db1)['json'](_0x3fe94b);}return _0x3387c2[_0x6eec('0xf')](0x194);};}function handleError(_0x3b2972,_0x462dbb){_0x462dbb=_0x462dbb||0x1f4;return function(_0xc35914){logger[_0x6eec('0xb')](_0xc35914[_0x6eec('0x10')]);if(_0xc35914[_0x6eec('0x11')]){delete _0xc35914[_0x6eec('0x11')];}_0x3b2972[_0x6eec('0xe')](_0x462dbb)[_0x6eec('0x12')](_0xc35914);};}function findById(_0x5e2a9b){return function(_0x3c0c1b){if(!_['isNil'](_0x5e2a9b)&&!_[_0x6eec('0x13')](_0x3c0c1b)&&!_[_0x6eec('0x13')](_0x3c0c1b['rows'])){return _[_0x6eec('0x14')](_0x3c0c1b[_0x6eec('0x15')],function(_0xb1eab7){return _0xb1eab7['id']==_0x5e2a9b;});}return null;};}exports['voiceChannels']=function(_0x87f3be,_0x1ed94c){return respondWithRpcPromise(_0x6eec('0x16'),_0x87f3be[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1ed94c,null))[_0x6eec('0x18')](handleError(_0x1ed94c,null));};exports['voiceChannelMixMonitor']=function(_0x328693,_0x2f843e){return respondWithRpcPromise(_0x6eec('0x19'),_[_0x6eec('0x1a')](_0x328693[_0x6eec('0x17')],_0x328693[_0x6eec('0x1b')]))['then'](respondWithResult(_0x2f843e,null))[_0x6eec('0x18')](handleError(_0x2f843e,null));};exports[_0x6eec('0x1c')]=function(_0x285d41,_0x27785a){return respondWithRpcPromise(_0x6eec('0x1d'),_[_0x6eec('0x1a')](_0x285d41['query'],_0x285d41[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x27785a,null))[_0x6eec('0x18')](handleError(_0x27785a,null));};exports[_0x6eec('0x1e')]=function(_0x1d2be9,_0x1f386c){return respondWithRpcPromise(_0x6eec('0x1f'),_0x1d2be9[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1f386c,null))['catch'](handleError(_0x1f386c,null));};exports[_0x6eec('0x20')]=function(_0x44b31c,_0x30eb98){return respondWithRpcPromise(_0x6eec('0x1f'),_0x44b31c['query'])[_0x6eec('0xa')](findById(_0x44b31c[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0x30eb98,null))['catch'](handleError(_0x30eb98,null));};exports[_0x6eec('0x21')]=function(_0x47ed95,_0x20a130){return respondWithRpcPromise(_0x6eec('0x22'),_[_0x6eec('0x1a')](_0x47ed95[_0x6eec('0x23')],_0x47ed95[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x20a130,null))[_0x6eec('0x18')](handleError(_0x20a130,null));};exports[_0x6eec('0x24')]=function(_0x1abd19,_0x414f5b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x6eec('0x1a')](_0x1abd19['query'],_0x1abd19[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x414f5b,null))[_0x6eec('0x18')](handleError(_0x414f5b,null));};exports['voiceQueuesChannels']=function(_0x57b40b,_0x508735){return respondWithRpcPromise(_0x6eec('0x25'),_0x57b40b[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x508735,null))[_0x6eec('0x18')](handleError(_0x508735,null));};exports[_0x6eec('0x26')]=function(_0x23547d,_0x22e0cb){return respondWithRpcPromise(_0x6eec('0x27'),_[_0x6eec('0x1a')](_0x23547d[_0x6eec('0x17')],_0x23547d[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x22e0cb,null))['catch'](handleError(_0x22e0cb,null));};exports[_0x6eec('0x28')]=function(_0x361ab7,_0x2c83d1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x6eec('0x1a')](_0x361ab7[_0x6eec('0x17')],_0x361ab7[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x2c83d1,null))[_0x6eec('0x18')](handleError(_0x2c83d1,null));};exports[_0x6eec('0x29')]=function(_0x4a7699,_0x45cfb6){return respondWithRpcPromise(_0x6eec('0x2a'),_[_0x6eec('0x1a')](_0x4a7699['query'],_0x4a7699['params']))[_0x6eec('0xa')](respondWithResult(_0x45cfb6,null))[_0x6eec('0x18')](handleError(_0x45cfb6,null));};exports[_0x6eec('0x2b')]=function(_0x3f79d1,_0x402bac){return respondWithRpcPromise('Outbound',_0x3f79d1[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x402bac,null))[_0x6eec('0x18')](handleError(_0x402bac,null));};exports[_0x6eec('0x2c')]=function(_0x15918c,_0x2be999){return respondWithRpcPromise(_0x6eec('0x2d'),_0x15918c[_0x6eec('0x17')])['then'](respondWithResult(_0x2be999,null))[_0x6eec('0x18')](handleError(_0x2be999,null));};exports[_0x6eec('0x2e')]=function(_0x4d30c9,_0x5b3283){var _0x160fc0;return respondWithRpcPromise(_0x6eec('0x2f'),_0x4d30c9[_0x6eec('0x17')])[_0x6eec('0xa')](function(_0x4cb50e){_0x160fc0=_0x4cb50e;return respondWithRpcPromise('Agents',_0x4d30c9[_0x6eec('0x17')],routingClient);})['then'](function(_0x5ac8b2){return _[_0x6eec('0x1a')]({},_0x5ac8b2,_0x160fc0);})[_0x6eec('0xa')](respondWithResult(_0x5b3283,null))[_0x6eec('0x18')](handleError(_0x5b3283,null));};exports[_0x6eec('0x30')]=function(_0x25d3f3,_0x58dfe7){if(_0x25d3f3[_0x6eec('0x23')]&&_0x25d3f3[_0x6eec('0x23')]['interaction']&&_0x25d3f3[_0x6eec('0x31')]&&_0x25d3f3[_0x6eec('0x31')]['name']){for(var _0x2d39bf in _0x25d3f3[_0x6eec('0x23')]['interaction']){if(_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x6eec('0x33')](_0x2d39bf)){db[_0x6eec('0x34')]['findAll']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'type':_0x6eec('0x35'),'exitAt':null,'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]&&_0x25d3f3['body']['interaction'][_0x2d39bf][_0x6eec('0x36')]?{'$notIn':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]}:{'$ne':null}}})[_0x6eec('0xa')](function(_0x44c7b8){var _0x59d7a7=moment()[_0x6eec('0x37')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x20524a=0x0,_0x408295=_0x44c7b8[_0x6eec('0x36')];_0x20524a<_0x408295;_0x20524a+=0x1){_0x44c7b8[_0x20524a]['updateAttributes']({'exitAt':_0x59d7a7});}});for(var _0x2b83f2=0x0;_0x2b83f2<_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x6eec('0x36')];_0x2b83f2+=0x1){db[_0x6eec('0x34')]['findOrCreate']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')]['name'],'type':'INTERACTION','uniqueid':_0x25d3f3[_0x6eec('0x23')]['interaction'][_0x2d39bf][_0x2b83f2],'exitAt':null},'defaults':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'interface':_[_0x6eec('0x13')](_0x25d3f3['user']['interface'])?util[_0x6eec('0x37')](_0x6eec('0x38'),_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')]):_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x39')],'type':_0x6eec('0x35'),'enterAt':moment()[_0x6eec('0x37')](_0x6eec('0x3a')),'role':_0x6eec('0x3b'),'internal':_0x25d3f3['user']['internal'],'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x2b83f2]}});}}}}return respondWithRpcPromise(_0x6eec('0x3c'),{'id':_0x25d3f3['params']['id'],'capacity':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x3d')]},routingClient)[_0x6eec('0xa')](respondWithResult(_0x58dfe7,null))[_0x6eec('0x18')](handleError(_0x58dfe7,null));};exports[_0x6eec('0x3e')]=function(_0x43f77a,_0x10c10a){return respondWithRpcPromise(_0x6eec('0x3f'),_0x43f77a['query'])[_0x6eec('0xa')](respondWithResult(_0x10c10a,null))[_0x6eec('0x18')](handleError(_0x10c10a,null));};exports[_0x6eec('0x40')]=function(_0x3e77f3,_0x490d27){return respondWithRpcPromise('Trunks',_0x3e77f3['query'])[_0x6eec('0xa')](respondWithResult(_0x490d27,null))[_0x6eec('0x18')](handleError(_0x490d27,null));};exports[_0x6eec('0x41')]=function(_0x1de626,_0x5178f5){return respondWithRpcPromise('Campaigns',_0x1de626[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x5178f5,null))[_0x6eec('0x18')](handleError(_0x5178f5,null));};exports['chatQueues']=function(_0x238605,_0x35f411){return respondWithRpcPromise(_0x6eec('0x42'),_0x238605[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x35f411,null))[_0x6eec('0x18')](handleError(_0x35f411,null));};exports[_0x6eec('0x43')]=function(_0x19fe55,_0x45fed3){return respondWithRpcPromise('ChatQueues',_0x19fe55[_0x6eec('0x17')],routingClient)['then'](findById(_0x19fe55[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x45fed3,null))[_0x6eec('0x18')](handleError(_0x45fed3,null));};exports[_0x6eec('0x44')]=function(_0x248d76,_0x360176){return respondWithRpcPromise(_0x6eec('0x45'),_0x248d76['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x360176,null))['catch'](handleError(_0x360176,null));};exports[_0x6eec('0x46')]=function(_0x5c905f,_0x237324){return respondWithRpcPromise(_0x6eec('0x45'),_0x5c905f[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5c905f[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x237324,null))[_0x6eec('0x18')](handleError(_0x237324,null));};exports[_0x6eec('0x47')]=function(_0x130002,_0x4114d1){return respondWithRpcPromise('MailAccounts',_0x130002['query'],mailClient)[_0x6eec('0xa')](respondWithResult(_0x4114d1,null))[_0x6eec('0x18')](handleError(_0x4114d1,null));};exports[_0x6eec('0x48')]=function(_0x2c0644,_0x20b040){return respondWithRpcPromise('OpenchannelQueues',_0x2c0644[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x20b040,null))['catch'](handleError(_0x20b040,null));};exports['showOpenchannelQueues']=function(_0x5dc8b3,_0xaa2a15){return respondWithRpcPromise(_0x6eec('0x49'),_0x5dc8b3['query'],routingClient)[_0x6eec('0xa')](findById(_0x5dc8b3[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0xaa2a15,null))[_0x6eec('0x18')](handleError(_0xaa2a15,null));};exports[_0x6eec('0x4a')]=function(_0xc852b3,_0x3c1f77){return respondWithRpcPromise('SmsQueues',_0xc852b3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x3c1f77,null))[_0x6eec('0x18')](handleError(_0x3c1f77,null));};exports[_0x6eec('0x4b')]=function(_0x19ca46,_0x34c4b4){return respondWithRpcPromise(_0x6eec('0x4c'),_0x19ca46[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x19ca46[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x34c4b4,null))[_0x6eec('0x18')](handleError(_0x34c4b4,null));};exports[_0x6eec('0x4d')]=function(_0x2799ca,_0x386a67){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2799ca[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x386a67,null))['catch'](handleError(_0x386a67,null));};exports[_0x6eec('0x4f')]=function(_0x2236f7,_0x48bb52){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2236f7[_0x6eec('0x17')],routingClient)['then'](findById(_0x2236f7[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x48bb52,null))[_0x6eec('0x18')](handleError(_0x48bb52,null));};exports[_0x6eec('0x50')]=function(_0x4c73f2,_0x40a81a){return respondWithRpcPromise(_0x6eec('0x51'),_0x4c73f2[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x40a81a,null))[_0x6eec('0x18')](handleError(_0x40a81a,null));};exports[_0x6eec('0x52')]=function(_0x5ae0a0,_0x1ed47e){return respondWithRpcPromise('FaxQueues',_0x5ae0a0[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5ae0a0[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x1ed47e,null))[_0x6eec('0x18')](handleError(_0x1ed47e,null));};exports[_0x6eec('0x53')]=function(_0x404b64,_0x2ea7fe){return respondWithRpcPromise(_0x6eec('0x54'),_0x404b64['query'])[_0x6eec('0xa')](respondWithResult(_0x2ea7fe,null))[_0x6eec('0x18')](handleError(_0x2ea7fe,null));};exports[_0x6eec('0x55')]=function(_0x4eef6e,_0x19f8e2){return respondWithRpcPromise(_0x6eec('0x56'),_0x4eef6e['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x19f8e2,null))[_0x6eec('0x18')](handleError(_0x19f8e2,null));};exports[_0x6eec('0x57')]=function(_0x18e62b,_0x266689){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x18e62b[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x266689,null))[_0x6eec('0x18')](handleError(_0x266689,null));};exports[_0x6eec('0x58')]=function(_0x3894dc,_0x56483b){return respondWithRpcPromise(_0x6eec('0x59'),_0x3894dc[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x56483b,null))[_0x6eec('0x18')](handleError(_0x56483b,null));};exports[_0x6eec('0x5a')]=function(_0x232b3a,_0x7dd5d1){return respondWithRpcPromise(_0x6eec('0x59'),_0x232b3a['query'],routingClient)[_0x6eec('0xa')](function(_0x59341a){if(_0x232b3a[_0x6eec('0x17')][_0x6eec('0x5b')]!==undefined){var _0x7a7288=_(_0x59341a[_0x6eec('0x15')])['filter']([_0x232b3a[_0x6eec('0x17')]['type'],_0x232b3a[_0x6eec('0x1b')]['id']])[_0x6eec('0x5c')](_0x6eec('0x5d'))[_0x6eec('0x5e')]()['value']();return _0x59341a['rows']['filter'](function(_0x1158b1){return _0x7a7288[_0x6eec('0x5f')](_0x1158b1[_0x6eec('0x5d')])>-0x1;});}else{return _0x59341a[_0x6eec('0x15')]['filter'](function(_0x44302a){return _0x44302a['queue_id']===parseInt(_0x232b3a[_0x6eec('0x1b')]['id']);});}})[_0x6eec('0xa')](respondWithResult(_0x7dd5d1,null))['catch'](handleError(_0x7dd5d1,null));};exports[_0x6eec('0x60')]=function(_0x2f9e8a,_0x333280){return respondWithRpcPromise(_0x6eec('0x61'),_0x2f9e8a[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x333280,null))['catch'](handleError(_0x333280,null));};exports[_0x6eec('0x62')]=function(_0x5aa2f3,_0x64c2ef){return respondWithRpcPromise(_0x6eec('0x63'),_0x5aa2f3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x64c2ef,null))['catch'](handleError(_0x64c2ef,null));};exports[_0x6eec('0x64')]=function(_0x1d1683,_0x8a4166){return respondWithRpcPromise(_0x6eec('0x65'),_0x1d1683['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x8a4166,null))['catch'](handleError(_0x8a4166,null));};exports[_0x6eec('0x66')]=function(_0x2c0a85){return function(_0x51560c,_0x3dcf9d){var _0x435562,_0x3a90cd;var _0x328f28=_[_0x6eec('0x67')](_0x2c0a85);var _0x514e15=_0x2c0a85===_0x6eec('0x68')?_0x6eec('0x69'):_0x6eec('0x6a');return db[_0x328f28+_0x6eec('0x6b')][_0x6eec('0x6c')]({'raw':!![],'where':{'id':_0x51560c[_0x6eec('0x1b')]['id']}})['then'](function(_0x4a3af3){if(_[_0x6eec('0x13')](_0x4a3af3)){throw new Error(_0x328f28+_0x6eec('0x6d'));}_0x435562=_0x4a3af3;return db[_0x328f28+'Message']['findOne']({'where':{'id':_0x51560c[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0x328f28+'Interaction'],'as':_0x6eec('0x6f')},{'model':db[_0x328f28+_0x514e15],'as':_0x6eec('0x6a')}]});})[_0x6eec('0xa')](function(_0x5042a0){if(_[_0x6eec('0x13')](_0x5042a0)){throw new Error(_0x328f28+'\x20Message\x20not\x20found');}_0x3a90cd=_0x5042a0;return _0x5042a0[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6eec('0xa')](function(){var _0x585432={'uniqueid':_0x2c0a85+'.'+_0x3a90cd['id']+'.'+_0x3a90cd[_0x6eec('0x6f')]['id'],'FromUserId':_0x51560c[_0x6eec('0x31')]['id'],'type':_0x6eec('0x71')};_0x585432[_0x328f28+'MessageId']=_0x3a90cd['id'];_0x585432[_0x328f28+_0x6eec('0x72')]=_0x3a90cd[_0x6eec('0x6f')]['id'];_0x585432[_0x6eec('0x73')+_0x328f28+_0x514e15+'Id']=_0x3a90cd[_0x6eec('0x6a')]['id'];_0x585432['To'+_0x328f28+_0x6eec('0x74')]=_0x435562['id'];return db[_0x328f28+_0x6eec('0x75')]['create'](_0x585432);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0x2c0a85,'interaction':_0x3a90cd[_0x6eec('0x6f')],'message':_0x3a90cd,'account':_0x3a90cd[_0x6eec('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6eec('0x71'),'appdata':_0x435562[_0x6eec('0x11')]+','+(_0x3a90cd[_0x6eec('0x6a')][_0x6eec('0x77')]||0x12c),'interval':_0x6eec('0x78')}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x3dcf9d,null))[_0x6eec('0x18')](handleError(_0x3dcf9d,null));};};exports[_0x6eec('0x79')]=function(_0x56043a,_0x1419e0){var _0x1d6604,_0x10fad1;if(_[_0x6eec('0x13')](_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')])){throw new Error(_0x6eec('0x7b'));}var _0xa94ada=_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')];var _0xaddba4=_[_0x6eec('0x67')](_0xa94ada);var _0x89aace=_0xa94ada===_0x6eec('0x68')?_0x6eec('0x69'):'Account';return db[_0x6eec('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x56043a[_0x6eec('0x1b')]['id'],'role':_0x6eec('0x3b')}})[_0x6eec('0xa')](function(_0x2607ca){if(_['isNil'](_0x2607ca)){throw new Error(_0x6eec('0x7d'));}_0x1d6604=_0x2607ca;return db[_0xaddba4+'Message'][_0x6eec('0x6c')]({'where':{'id':_0x56043a[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0xaddba4+_0x6eec('0x6f')],'as':_0x6eec('0x6f')},{'model':db[_0xaddba4+_0x89aace],'as':_0x6eec('0x6a')}]});})['then'](function(_0x2888f4){if(_[_0x6eec('0x13')](_0x2888f4)){throw new Error(_0xaddba4+_0x6eec('0x7e'));}_0x10fad1=_0x2888f4;return _0x2888f4[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5229db={'uniqueid':_0xa94ada+'.'+_0x10fad1['id']+'.'+_0x10fad1[_0x6eec('0x6f')]['id'],'FromUserId':_0x56043a[_0x6eec('0x31')]['id'],'type':'queue','ToUserId':_0x1d6604['id']};_0x5229db[_0xaddba4+'MessageId']=_0x10fad1['id'];_0x5229db[_0xaddba4+_0x6eec('0x72')]=_0x10fad1[_0x6eec('0x6f')]['id'];_0x5229db['From'+_0xaddba4+_0x89aace+'Id']=_0x10fad1[_0x6eec('0x6a')]['id'];return db[_0xaddba4+_0x6eec('0x75')]['create'](_0x5229db);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0xa94ada,'interaction':_0x10fad1[_0x6eec('0x6f')],'message':_0x10fad1,'account':_0x10fad1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1d6604['name']+','+(_0x10fad1[_0x6eec('0x6a')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x1419e0,null))['catch'](handleError(_0x1419e0,null));}; \ No newline at end of file +var _0xdc97=['agents','Agents','agentCapacity','user','interaction','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','rows','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','TransferReport','create','Start','queue','*,*,*,*','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','InteractionId','bluebird','moment','lodash','../../mysqldb','api','jayson/promise','http','client','request','then','error','code','message','json','sendStatus','name','status','send','isNil','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels'];(function(_0x21dc45,_0x4aa61f){var _0xf5d790=function(_0x26fab7){while(--_0x26fab7){_0x21dc45['push'](_0x21dc45['shift']());}};_0xf5d790(++_0x4aa61f);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1c1223,_0x5068ad){_0x1c1223=_0x1c1223-0x0;var _0xe5010a=_0xdc97[_0x1c1223];return _0xe5010a;};'use strict';var BPromise=require(_0x7dc9('0x0'));var moment=require(_0x7dc9('0x1'));var _=require(_0x7dc9('0x2'));var util=require('util');var db=require(_0x7dc9('0x3'))['db'];var logger=require('../../config/logger')(_0x7dc9('0x4'));var jayson=require(_0x7dc9('0x5'));var amiClient=jayson['client'][_0x7dc9('0x6')]({'port':0x232a});var mailClient=jayson[_0x7dc9('0x7')][_0x7dc9('0x6')]({'port':0x232b});var routingClient=jayson[_0x7dc9('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){var _0x3318ea=_0x4b3229?_0x4b3229:amiClient;return _0x3318ea[_0x7dc9('0x8')](_0x2636ef,_0x4f91c7)[_0x7dc9('0x9')](function(_0x5ca05b){if(_0x5ca05b[_0x7dc9('0xa')]){if(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xb')]===0x1f4){return _0x23737d(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xc')]);}return _0x2ff923(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xc')]);}else{_0x2ff923(_0x5ca05b['result']);}})['catch'](function(_0x4be1c8){_0x23737d(_0x4be1c8);});});}function respondWithResult(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xc8;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['status'](_0x94c75a)[_0x7dc9('0xd')](_0x14e5db);}return _0x599ef1[_0x7dc9('0xe')](0x194);};}function handleError(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0x1f4;return function(_0x31d43d){logger[_0x7dc9('0xa')](_0x31d43d['stack']);if(_0x31d43d[_0x7dc9('0xf')]){delete _0x31d43d[_0x7dc9('0xf')];}_0xaadf2[_0x7dc9('0x10')](_0xf37bc7)[_0x7dc9('0x11')](_0x31d43d);};}function findById(_0x11606f){return function(_0xbe0437){if(!_[_0x7dc9('0x12')](_0x11606f)&&!_[_0x7dc9('0x12')](_0xbe0437)&&!_[_0x7dc9('0x12')](_0xbe0437['rows'])){return _[_0x7dc9('0x13')](_0xbe0437['rows'],function(_0x1f5906){return _0x1f5906['id']==_0x11606f;});}return null;};}exports[_0x7dc9('0x14')]=function(_0x5d61d7,_0x41f66e){return respondWithRpcPromise(_0x7dc9('0x15'),_0x5d61d7[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x41f66e,null))[_0x7dc9('0x17')](handleError(_0x41f66e,null));};exports[_0x7dc9('0x18')]=function(_0x2dad65,_0x2895f5){return respondWithRpcPromise(_0x7dc9('0x19'),_[_0x7dc9('0x1a')](_0x2dad65['query'],_0x2dad65['params']))[_0x7dc9('0x9')](respondWithResult(_0x2895f5,null))[_0x7dc9('0x17')](handleError(_0x2895f5,null));};exports['voiceChannelStopMixMonitor']=function(_0x349001,_0x27f7fa){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x7dc9('0x1a')](_0x349001[_0x7dc9('0x16')],_0x349001[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x27f7fa,null))[_0x7dc9('0x17')](handleError(_0x27f7fa,null));};exports[_0x7dc9('0x1c')]=function(_0xf95336,_0x55a482){return respondWithRpcPromise('VoiceQueues',_0xf95336['query'])[_0x7dc9('0x9')](respondWithResult(_0x55a482,null))[_0x7dc9('0x17')](handleError(_0x55a482,null));};exports['showVoiceQueues']=function(_0x585eef,_0x47771b){return respondWithRpcPromise('VoiceQueues',_0x585eef[_0x7dc9('0x16')])[_0x7dc9('0x9')](findById(_0x585eef[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x47771b,null))[_0x7dc9('0x17')](handleError(_0x47771b,null));};exports[_0x7dc9('0x1d')]=function(_0x236d42,_0x229f8e){return respondWithRpcPromise(_0x7dc9('0x1e'),_[_0x7dc9('0x1a')](_0x236d42[_0x7dc9('0x1f')],_0x236d42[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x229f8e,null))['catch'](handleError(_0x229f8e,null));};exports['voiceQueuesPreview']=function(_0x49a4a5,_0x4a68f0){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x49a4a5['query'],_0x49a4a5[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x4a68f0,null))[_0x7dc9('0x17')](handleError(_0x4a68f0,null));};exports[_0x7dc9('0x20')]=function(_0x3300ff,_0x154e22){return respondWithRpcPromise('VoiceQueuesChannels',_0x3300ff['query'])['then'](respondWithResult(_0x154e22,null))[_0x7dc9('0x17')](handleError(_0x154e22,null));};exports['voiceQueuesChannel']=function(_0x2b9ca0,_0x448e46){return respondWithRpcPromise(_0x7dc9('0x21'),_[_0x7dc9('0x1a')](_0x2b9ca0[_0x7dc9('0x16')],_0x2b9ca0[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x448e46,null))[_0x7dc9('0x17')](handleError(_0x448e46,null));};exports['voiceQueuesChannelHangup']=function(_0x2b56d7,_0x4cdec4){return respondWithRpcPromise(_0x7dc9('0x22'),_[_0x7dc9('0x1a')](_0x2b56d7[_0x7dc9('0x16')],_0x2b56d7[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x4cdec4,null))[_0x7dc9('0x17')](handleError(_0x4cdec4,null));};exports['voiceQueuesChannelRedirect']=function(_0x289560,_0x4f47af){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x7dc9('0x1a')](_0x289560[_0x7dc9('0x16')],_0x289560[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x4f47af,null))['catch'](handleError(_0x4f47af,null));};exports[_0x7dc9('0x23')]=function(_0x183d87,_0x138f33){return respondWithRpcPromise(_0x7dc9('0x24'),_0x183d87[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x138f33,null))[_0x7dc9('0x17')](handleError(_0x138f33,null));};exports[_0x7dc9('0x25')]=function(_0x166906,_0x21bcfc){return respondWithRpcPromise(_0x7dc9('0x26'),_0x166906[_0x7dc9('0x16')])['then'](respondWithResult(_0x21bcfc,null))[_0x7dc9('0x17')](handleError(_0x21bcfc,null));};exports[_0x7dc9('0x27')]=function(_0x466b02,_0xfd2612){var _0x4bcdce;return respondWithRpcPromise(_0x7dc9('0x28'),_0x466b02[_0x7dc9('0x16')])[_0x7dc9('0x9')](function(_0x3876b6){_0x4bcdce=_0x3876b6;return respondWithRpcPromise(_0x7dc9('0x28'),_0x466b02[_0x7dc9('0x16')],routingClient);})['then'](function(_0x553230){return _[_0x7dc9('0x1a')]({},_0x553230,_0x4bcdce);})[_0x7dc9('0x9')](respondWithResult(_0xfd2612,null))['catch'](handleError(_0xfd2612,null));};exports[_0x7dc9('0x29')]=function(_0x4a37ec,_0x315d65){if(_0x4a37ec[_0x7dc9('0x1f')]&&_0x4a37ec[_0x7dc9('0x1f')]['interaction']&&_0x4a37ec[_0x7dc9('0x2a')]&&_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')]){for(var _0x95513c in _0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')]){if(_0x4a37ec[_0x7dc9('0x1f')]['interaction'][_0x7dc9('0x2c')](_0x95513c)){db['MemberReport']['findAll']({'where':{'channel':_0x95513c,'membername':_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')],'type':_0x7dc9('0x2d'),'exitAt':null,'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c]&&_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x7dc9('0x2e')]?{'$notIn':_0x4a37ec[_0x7dc9('0x1f')]['interaction'][_0x95513c]}:{'$ne':null}}})[_0x7dc9('0x9')](function(_0x1971c7){var _0x3c4d4c=moment()[_0x7dc9('0x2f')](_0x7dc9('0x30'));for(var _0x19957f=0x0,_0x575393=_0x1971c7[_0x7dc9('0x2e')];_0x19957f<_0x575393;_0x19957f+=0x1){_0x1971c7[_0x19957f][_0x7dc9('0x31')]({'exitAt':_0x3c4d4c});}});for(var _0x49bffe=0x0;_0x49bffe<_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x7dc9('0x2e')];_0x49bffe+=0x1){db['MemberReport'][_0x7dc9('0x32')]({'where':{'channel':_0x95513c,'membername':_0x4a37ec['user']['name'],'type':_0x7dc9('0x2d'),'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x49bffe],'exitAt':null},'defaults':{'channel':_0x95513c,'membername':_0x4a37ec['user']['name'],'interface':_[_0x7dc9('0x12')](_0x4a37ec['user'][_0x7dc9('0x33')])?util[_0x7dc9('0x2f')]('SIP/%s',_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')]):_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0x33')],'type':_0x7dc9('0x2d'),'enterAt':moment()[_0x7dc9('0x2f')](_0x7dc9('0x30')),'role':_0x7dc9('0x34'),'internal':_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0x35')],'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x49bffe]}});}}}}return respondWithRpcPromise(_0x7dc9('0x36'),{'id':_0x4a37ec['params']['id'],'capacity':_0x4a37ec[_0x7dc9('0x1f')]['capacity']},routingClient)['then'](respondWithResult(_0x315d65,null))[_0x7dc9('0x17')](handleError(_0x315d65,null));};exports[_0x7dc9('0x37')]=function(_0x40e382,_0x3902aa){return respondWithRpcPromise(_0x7dc9('0x38'),_0x40e382['query'])[_0x7dc9('0x9')](respondWithResult(_0x3902aa,null))[_0x7dc9('0x17')](handleError(_0x3902aa,null));};exports[_0x7dc9('0x39')]=function(_0x4a9b75,_0x341909){return respondWithRpcPromise(_0x7dc9('0x3a'),_0x4a9b75[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x341909,null))[_0x7dc9('0x17')](handleError(_0x341909,null));};exports[_0x7dc9('0x3b')]=function(_0x593132,_0x366b8b){return respondWithRpcPromise(_0x7dc9('0x3c'),_0x593132[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x17')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x3d')]=function(_0x31baf1,_0x24abb6){return respondWithRpcPromise(_0x7dc9('0x3e'),_0x31baf1[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x24abb6,null))[_0x7dc9('0x17')](handleError(_0x24abb6,null));};exports['showChatQueues']=function(_0x1767b6,_0x39be46){return respondWithRpcPromise(_0x7dc9('0x3e'),_0x1767b6[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x1767b6['params']['id']))[_0x7dc9('0x9')](respondWithResult(_0x39be46,null))[_0x7dc9('0x17')](handleError(_0x39be46,null));};exports[_0x7dc9('0x3f')]=function(_0x17ed6c,_0x2a1db8){return respondWithRpcPromise(_0x7dc9('0x40'),_0x17ed6c['query'],routingClient)['then'](respondWithResult(_0x2a1db8,null))['catch'](handleError(_0x2a1db8,null));};exports[_0x7dc9('0x41')]=function(_0x3daf33,_0x32a64f){return respondWithRpcPromise(_0x7dc9('0x40'),_0x3daf33['query'],routingClient)['then'](findById(_0x3daf33[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x32a64f,null))[_0x7dc9('0x17')](handleError(_0x32a64f,null));};exports[_0x7dc9('0x42')]=function(_0x2caf7f,_0x2272ef){return respondWithRpcPromise(_0x7dc9('0x43'),_0x2caf7f['query'],mailClient)[_0x7dc9('0x9')](respondWithResult(_0x2272ef,null))[_0x7dc9('0x17')](handleError(_0x2272ef,null));};exports[_0x7dc9('0x44')]=function(_0x1dad95,_0x4683b3){return respondWithRpcPromise('OpenchannelQueues',_0x1dad95[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x4683b3,null))[_0x7dc9('0x17')](handleError(_0x4683b3,null));};exports[_0x7dc9('0x45')]=function(_0x2454d7,_0x3a93c4){return respondWithRpcPromise(_0x7dc9('0x46'),_0x2454d7[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x2454d7[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x3a93c4,null))[_0x7dc9('0x17')](handleError(_0x3a93c4,null));};exports[_0x7dc9('0x47')]=function(_0x5eee27,_0x3485b6){return respondWithRpcPromise('SmsQueues',_0x5eee27[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3485b6,null))['catch'](handleError(_0x3485b6,null));};exports[_0x7dc9('0x48')]=function(_0x24d2c7,_0x50e9a9){return respondWithRpcPromise(_0x7dc9('0x49'),_0x24d2c7[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x24d2c7['params']['id']))['then'](respondWithResult(_0x50e9a9,null))[_0x7dc9('0x17')](handleError(_0x50e9a9,null));};exports[_0x7dc9('0x4a')]=function(_0x4ed60e,_0x3aba59){return respondWithRpcPromise(_0x7dc9('0x4b'),_0x4ed60e[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3aba59,null))[_0x7dc9('0x17')](handleError(_0x3aba59,null));};exports[_0x7dc9('0x4c')]=function(_0x51b834,_0x35f31e){return respondWithRpcPromise(_0x7dc9('0x4b'),_0x51b834[_0x7dc9('0x16')],routingClient)['then'](findById(_0x51b834['params']['id']))[_0x7dc9('0x9')](respondWithResult(_0x35f31e,null))[_0x7dc9('0x17')](handleError(_0x35f31e,null));};exports[_0x7dc9('0x4d')]=function(_0x2cf485,_0x59f3bd){return respondWithRpcPromise('FaxQueues',_0x2cf485[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x59f3bd,null))[_0x7dc9('0x17')](handleError(_0x59f3bd,null));};exports[_0x7dc9('0x4e')]=function(_0x5d211b,_0xea1728){return respondWithRpcPromise(_0x7dc9('0x4f'),_0x5d211b[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x5d211b[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0xea1728,null))[_0x7dc9('0x17')](handleError(_0xea1728,null));};exports['faxAccounts']=function(_0x2d7c33,_0x2cde0c){return respondWithRpcPromise('FaxAccounts',_0x2d7c33['query'])[_0x7dc9('0x9')](respondWithResult(_0x2cde0c,null))['catch'](handleError(_0x2cde0c,null));};exports[_0x7dc9('0x50')]=function(_0x466602,_0xd99a2){return respondWithRpcPromise(_0x7dc9('0x51'),_0x466602[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0xd99a2,null))[_0x7dc9('0x17')](handleError(_0xd99a2,null));};exports[_0x7dc9('0x52')]=function(_0x25f970,_0x30ce2f){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x25f970[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x30ce2f,null))[_0x7dc9('0x17')](handleError(_0x30ce2f,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x45c1b3,_0x585e42){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x45c1b3[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x585e42,null))['catch'](handleError(_0x585e42,null));};exports[_0x7dc9('0x53')]=function(_0x533738,_0x5a585a){return respondWithRpcPromise(_0x7dc9('0x54'),_0x533738[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](function(_0xb8be9){if(_0x533738['query'][_0x7dc9('0x55')]!==undefined){var _0xe944a4=_(_0xb8be9[_0x7dc9('0x56')])[_0x7dc9('0x57')]([_0x533738[_0x7dc9('0x16')][_0x7dc9('0x55')],_0x533738[_0x7dc9('0x1b')]['id']])[_0x7dc9('0x58')]('queue_id')['uniq']()[_0x7dc9('0x59')]();return _0xb8be9['rows'][_0x7dc9('0x57')](function(_0x1da142){return _0xe944a4[_0x7dc9('0x5a')](_0x1da142[_0x7dc9('0x5b')])>-0x1;});}else{return _0xb8be9['rows'][_0x7dc9('0x57')](function(_0x51a7e5){return _0x51a7e5['queue_id']===parseInt(_0x533738[_0x7dc9('0x1b')]['id']);});}})[_0x7dc9('0x9')](respondWithResult(_0x5a585a,null))[_0x7dc9('0x17')](handleError(_0x5a585a,null));};exports[_0x7dc9('0x5c')]=function(_0x5bc1c3,_0x2c3434){return respondWithRpcPromise(_0x7dc9('0x5d'),_0x5bc1c3['query'],routingClient)['then'](respondWithResult(_0x2c3434,null))[_0x7dc9('0x17')](handleError(_0x2c3434,null));};exports[_0x7dc9('0x5e')]=function(_0x49d7ef,_0x114078){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x49d7ef[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x114078,null))[_0x7dc9('0x17')](handleError(_0x114078,null));};exports['faxQueuesWaitingInteractions']=function(_0x33d68c,_0x3c7daf){return respondWithRpcPromise(_0x7dc9('0x5f'),_0x33d68c['query'],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3c7daf,null))['catch'](handleError(_0x3c7daf,null));};exports['queueNotify']=function(_0xa899){return function(_0x26244a,_0x31faa4){var _0x3657b6,_0x26d94e;var _0x56a00d=_[_0x7dc9('0x60')](_0xa899);var _0x1daf80=_0xa899===_0x7dc9('0x61')?_0x7dc9('0x62'):_0x7dc9('0x63');return db[_0x56a00d+'Queue'][_0x7dc9('0x64')]({'raw':!![],'where':{'id':_0x26244a[_0x7dc9('0x1b')]['id']}})[_0x7dc9('0x9')](function(_0x200df7){if(_['isNil'](_0x200df7)){throw new Error(_0x56a00d+_0x7dc9('0x65'));}_0x3657b6=_0x200df7;return db[_0x56a00d+'Message']['findOne']({'where':{'id':_0x26244a[_0x7dc9('0x1f')]['messageId']},'include':[{'model':db[_0x56a00d+_0x7dc9('0x66')],'as':_0x7dc9('0x66')},{'model':db[_0x56a00d+_0x1daf80],'as':_0x7dc9('0x63')}]});})[_0x7dc9('0x9')](function(_0x38dccc){if(_[_0x7dc9('0x12')](_0x38dccc)){throw new Error(_0x56a00d+'\x20Message\x20not\x20found');}_0x26d94e=_0x38dccc;return _0x38dccc[_0x7dc9('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7dc9('0x9')](function(){var _0x1a4bfb={'uniqueid':_0xa899+'.'+_0x26d94e['id']+'.'+_0x26d94e[_0x7dc9('0x66')]['id'],'FromUserId':_0x26244a[_0x7dc9('0x2a')]['id'],'type':'queue'};_0x1a4bfb[_0x56a00d+_0x7dc9('0x68')]=_0x26d94e['id'];_0x1a4bfb[_0x56a00d+'InteractionId']=_0x26d94e[_0x7dc9('0x66')]['id'];_0x1a4bfb[_0x7dc9('0x69')+_0x56a00d+_0x1daf80+'Id']=_0x26d94e[_0x7dc9('0x63')]['id'];_0x1a4bfb['To'+_0x56a00d+'QueueId']=_0x3657b6['id'];return db[_0x56a00d+_0x7dc9('0x6a')][_0x7dc9('0x6b')](_0x1a4bfb);})['then'](function(){return respondWithRpcPromise(_0x7dc9('0x6c'),{'channel':_0xa899,'interaction':_0x26d94e[_0x7dc9('0x66')],'message':_0x26d94e,'account':_0x26d94e[_0x7dc9('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7dc9('0x6d'),'appdata':_0x3657b6['name']+','+(_0x26d94e[_0x7dc9('0x63')]['queueTransferTimeout']||0x12c),'interval':_0x7dc9('0x6e')}]},routingClient);})[_0x7dc9('0x9')](respondWithResult(_0x31faa4,null))[_0x7dc9('0x17')](handleError(_0x31faa4,null));};};exports['agentNotify']=function(_0x160bf0,_0x4588a7){var _0x23da2e,_0x568705;if(_['isNil'](_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x6f')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x573fa9=_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x6f')];var _0x5f3487=_[_0x7dc9('0x60')](_0x573fa9);var _0x5a44a1=_0x573fa9===_0x7dc9('0x61')?_0x7dc9('0x62'):_0x7dc9('0x63');return db[_0x7dc9('0x70')][_0x7dc9('0x64')]({'raw':!![],'where':{'id':_0x160bf0[_0x7dc9('0x1b')]['id'],'role':'agent'}})[_0x7dc9('0x9')](function(_0x3fb268){if(_[_0x7dc9('0x12')](_0x3fb268)){throw new Error(_0x7dc9('0x71'));}_0x23da2e=_0x3fb268;return db[_0x5f3487+_0x7dc9('0x72')]['findOne']({'where':{'id':_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x73')]},'include':[{'model':db[_0x5f3487+_0x7dc9('0x66')],'as':_0x7dc9('0x66')},{'model':db[_0x5f3487+_0x5a44a1],'as':'Account'}]});})[_0x7dc9('0x9')](function(_0x54bd64){if(_['isNil'](_0x54bd64)){throw new Error(_0x5f3487+_0x7dc9('0x74'));}_0x568705=_0x54bd64;return _0x54bd64['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7dc9('0x9')](function(){var _0x19c880={'uniqueid':_0x573fa9+'.'+_0x568705['id']+'.'+_0x568705[_0x7dc9('0x66')]['id'],'FromUserId':_0x160bf0[_0x7dc9('0x2a')]['id'],'type':_0x7dc9('0x6d'),'ToUserId':_0x23da2e['id']};_0x19c880[_0x5f3487+_0x7dc9('0x68')]=_0x568705['id'];_0x19c880[_0x5f3487+_0x7dc9('0x75')]=_0x568705[_0x7dc9('0x66')]['id'];_0x19c880['From'+_0x5f3487+_0x5a44a1+'Id']=_0x568705[_0x7dc9('0x63')]['id'];return db[_0x5f3487+_0x7dc9('0x6a')][_0x7dc9('0x6b')](_0x19c880);})[_0x7dc9('0x9')](function(){return respondWithRpcPromise(_0x7dc9('0x6c'),{'channel':_0x573fa9,'interaction':_0x568705['Interaction'],'message':_0x568705,'account':_0x568705[_0x7dc9('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7dc9('0x34'),'appdata':_0x23da2e[_0x7dc9('0xf')]+','+(_0x568705[_0x7dc9('0x63')]['agentTransferTimeout']||0x12c),'interval':_0x7dc9('0x6e')}]},routingClient);})['then'](respondWithResult(_0x4588a7,null))[_0x7dc9('0x17')](handleError(_0x4588a7,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index c6797f8..52cb38a 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 _0xfb1a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xfb1a,0x1c8));var _0xafb1=function(_0xcb9f3,_0x2593e0){_0xcb9f3=_0xcb9f3-0x0;var _0x5b615a=_0xfb1a[_0xcb9f3];return _0x5b615a;};'use strict';var multer=require(_0xafb1('0x0'));var util=require(_0xafb1('0x1'));var path=require('path');var timeout=require(_0xafb1('0x2'));var express=require(_0xafb1('0x3'));var router=express[_0xafb1('0x4')]();var fs_extra=require(_0xafb1('0x5'));var auth=require(_0xafb1('0x6'));var interaction=require(_0xafb1('0x7'));var config=require(_0xafb1('0x8'));var controller=require(_0xafb1('0x9'));router[_0xafb1('0xa')]('/',auth[_0xafb1('0xb')](),controller[_0xafb1('0xc')]);router[_0xafb1('0xa')](_0xafb1('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xafb1('0xe'),auth[_0xafb1('0xb')](),controller[_0xafb1('0xf')]);router['post']('/',auth[_0xafb1('0xb')](),controller[_0xafb1('0x10')]);router[_0xafb1('0x11')](_0xafb1('0xd'),auth[_0xafb1('0xb')](),controller[_0xafb1('0x12')]);router[_0xafb1('0x13')]('/:id',auth[_0xafb1('0xb')](),controller[_0xafb1('0x14')]);module[_0xafb1('0x15')]=router; \ No newline at end of file +var _0xab14=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xab14,0xcb));var _0x4ab1=function(_0x55479a,_0x1527b7){_0x55479a=_0x55479a-0x0;var _0x19ad51=_0xab14[_0x55479a];return _0x19ad51;};'use strict';var multer=require(_0x4ab1('0x0'));var util=require(_0x4ab1('0x1'));var path=require(_0x4ab1('0x2'));var timeout=require(_0x4ab1('0x3'));var express=require(_0x4ab1('0x4'));var router=express[_0x4ab1('0x5')]();var fs_extra=require(_0x4ab1('0x6'));var auth=require(_0x4ab1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4ab1('0x8'));var controller=require(_0x4ab1('0x9'));router[_0x4ab1('0xa')]('/',auth['isAuthenticated'](),controller[_0x4ab1('0xb')]);router[_0x4ab1('0xa')](_0x4ab1('0xc'),auth[_0x4ab1('0xd')](),controller[_0x4ab1('0xe')]);router['get'](_0x4ab1('0xf'),auth[_0x4ab1('0xd')](),controller[_0x4ab1('0x10')]);router[_0x4ab1('0x11')]('/',auth[_0x4ab1('0xd')](),controller[_0x4ab1('0x12')]);router[_0x4ab1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4ab1('0x14')]);router[_0x4ab1('0x15')](_0x4ab1('0xc'),auth[_0x4ab1('0xd')](),controller['destroy']);module[_0x4ab1('0x16')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 5882462..71ea1ad 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 _0xaf2b=['custom','default','TEXT','BOOLEAN','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','days','minutes','pdf','xlsx','csv'];(function(_0x5a645b,_0x381237){var _0x3f0088=function(_0x27474d){while(--_0x27474d){_0x5a645b['push'](_0x5a645b['shift']());}};_0x3f0088(++_0x381237);}(_0xaf2b,0x1d4));var _0xbaf2=function(_0x6c9b2c,_0x2e1e98){_0x6c9b2c=_0x6c9b2c-0x0;var _0x2dbb9c=_0xaf2b[_0x6c9b2c];return _0x2dbb9c;};'use strict';var Sequelize=require(_0xbaf2('0x0'));module['exports']={'name':{'type':Sequelize[_0xbaf2('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xbaf2('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xbaf2('0x1')],'allowNull':![],'defaultValue':_0xbaf2('0x2')},'startAt':{'type':Sequelize[_0xbaf2('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xbaf2('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xbaf2('0x4')]('years',_0xbaf2('0x5'),_0xbaf2('0x6'),'weeks',_0xbaf2('0x7'),'hours',_0xbaf2('0x8')),'allowNull':![],'defaultValue':_0xbaf2('0x7')},'output':{'type':Sequelize[_0xbaf2('0x4')]('csv',_0xbaf2('0x9'),_0xbaf2('0xa')),'allowNull':![],'defaultValue':_0xbaf2('0xb')},'type':{'type':Sequelize[_0xbaf2('0x4')](_0xbaf2('0xc'),_0xbaf2('0xd')),'allowNull':![],'defaultValue':_0xbaf2('0xc')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xbaf2('0x1')]},'cc':{'type':Sequelize[_0xbaf2('0xe')]},'bcc':{'type':Sequelize[_0xbaf2('0xe')]},'sendIfEmpty':{'type':Sequelize[_0xbaf2('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb102=['xlsx','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours','minutes','pdf'];(function(_0x3bfedf,_0x2264fa){var _0xa69fe4=function(_0x6204d2){while(--_0x6204d2){_0x3bfedf['push'](_0x3bfedf['shift']());}};_0xa69fe4(++_0x2264fa);}(_0xb102,0x147));var _0x2b10=function(_0x5d9eaa,_0x167a02){_0x5d9eaa=_0x5d9eaa-0x0;var _0x15db37=_0xb102[_0x5d9eaa];return _0x15db37;};'use strict';var Sequelize=require(_0x2b10('0x0'));module[_0x2b10('0x1')]={'name':{'type':Sequelize[_0x2b10('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2b10('0x2')]},'active':{'type':Sequelize[_0x2b10('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2b10('0x4')},'startAt':{'type':Sequelize[_0x2b10('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2b10('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2b10('0x7')](_0x2b10('0x8'),_0x2b10('0x9'),_0x2b10('0xa'),_0x2b10('0xb'),'days',_0x2b10('0xc'),_0x2b10('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x2b10('0x7')]('csv',_0x2b10('0xe'),_0x2b10('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x2b10('0x7')]('custom',_0x2b10('0x10')),'allowNull':![],'defaultValue':_0x2b10('0x11')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x2b10('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x2b10('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index cb852b5..4824e11 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 _0x5527=['mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','Schedule','fieldName','type','key','model','map','query','intersection','fields','attributes','offset','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','rawAttributes','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x486ec6,_0xdaacda){var _0x417267=function(_0x67dc1e){while(--_0x67dc1e){_0x486ec6['push'](_0x486ec6['shift']());}};_0x417267(++_0xdaacda);}(_0x5527,0xf7));var _0x7552=function(_0x2ad3d4,_0x501b84){_0x2ad3d4=_0x2ad3d4-0x0;var _0x150037=_0x5527[_0x2ad3d4];return _0x150037;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7552('0x0'));var zipdir=require(_0x7552('0x1'));var jsonpatch=require(_0x7552('0x2'));var rp=require('request-promise');var moment=require(_0x7552('0x3'));var BPromise=require(_0x7552('0x4'));var Mustache=require(_0x7552('0x5'));var util=require('util');var path=require(_0x7552('0x6'));var sox=require(_0x7552('0x7'));var csv=require(_0x7552('0x8'));var ejs=require(_0x7552('0x9'));var fs=require('fs');var fs_extra=require(_0x7552('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7552('0xb'));var jsforce=require(_0x7552('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7552('0x8'));var querystring=require(_0x7552('0xd'));var Papa=require(_0x7552('0xe'));var Redis=require(_0x7552('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7552('0x10'));var as=require(_0x7552('0x11'));var hardwareService=require(_0x7552('0x12'));var logger=require(_0x7552('0x13'))(_0x7552('0x14'));var utils=require('../../config/utils');var config=require(_0x7552('0x15'));var licenseUtil=require(_0x7552('0x16'));var db=require(_0x7552('0x17'))['db'];function respondWithStatusCode(_0x576870,_0x208ee5){_0x208ee5=_0x208ee5||0xcc;return function(_0xf2c764){if(_0xf2c764){return _0x576870['sendStatus'](_0x208ee5);}return _0x576870[_0x7552('0x18')](_0x208ee5)[_0x7552('0x19')]();};}function respondWithResult(_0x229173,_0x411df2){_0x411df2=_0x411df2||0xc8;return function(_0x4e64e4){if(_0x4e64e4){return _0x229173[_0x7552('0x18')](_0x411df2)[_0x7552('0x1a')](_0x4e64e4);}};}function respondWithFilteredResult(_0x1fb61a,_0x2c4f7d){return function(_0x3f7e0e){if(_0x3f7e0e){var _0x38fe36=typeof _0x2c4f7d['offset']===_0x7552('0x1b')&&typeof _0x2c4f7d[_0x7552('0x1c')]==='undefined';var _0x3fe8a6=_0x3f7e0e[_0x7552('0x1d')];var _0x35b6ec=_0x38fe36?0x0:_0x2c4f7d['offset'];var _0x5f26c9=_0x38fe36?_0x3f7e0e[_0x7552('0x1d')]:_0x2c4f7d['offset']+_0x2c4f7d['limit'];var _0x3fcfb0;if(_0x5f26c9>=_0x3fe8a6){_0x5f26c9=_0x3fe8a6;_0x3fcfb0=0xc8;}else{_0x3fcfb0=0xce;}_0x1fb61a['status'](_0x3fcfb0);return _0x1fb61a[_0x7552('0x1e')]('Content-Range',_0x35b6ec+'-'+_0x5f26c9+'/'+_0x3fe8a6)['json'](_0x3f7e0e);}return null;};}function patchUpdates(_0x23b86c){return function(_0x4eece7){try{jsonpatch[_0x7552('0x1f')](_0x4eece7,_0x23b86c,!![]);}catch(_0x1c34d7){return BPromise[_0x7552('0x20')](_0x1c34d7);}return _0x4eece7[_0x7552('0x21')]();};}function saveUpdates(_0x54996f,_0x318005){return function(_0xf20a1e){if(_0xf20a1e){return _0xf20a1e[_0x7552('0x22')](_0x54996f)['then'](function(_0x165fa4){return _0x165fa4;});}return null;};}function removeEntity(_0x650bd,_0x2e333c){return function(_0x3a1210){if(_0x3a1210){return _0x3a1210[_0x7552('0x23')]()[_0x7552('0x24')](function(){var _0x4415be=_0x3a1210[_0x7552('0x25')]({'plain':!![]});var _0x3faf39=_0x7552('0x26');return db[_0x7552('0x27')][_0x7552('0x23')]({'where':{'type':_0x3faf39,'resourceId':_0x4415be['id']}})['then'](function(){return _0x3a1210;});})[_0x7552('0x24')](function(){_0x650bd[_0x7552('0x18')](0xcc)[_0x7552('0x19')]();});}};}function handleEntityNotFound(_0x4b9bed,_0x4f2971){return function(_0x37a2c9){if(!_0x37a2c9){_0x4b9bed[_0x7552('0x28')](0x194);}return _0x37a2c9;};}function handleError(_0xbdab85,_0x1b6cf6){_0x1b6cf6=_0x1b6cf6||0x1f4;return function(_0x3f3102){logger[_0x7552('0x29')](_0x3f3102[_0x7552('0x2a')]);if(_0x3f3102[_0x7552('0x2b')]){delete _0x3f3102['name'];}_0xbdab85[_0x7552('0x18')](_0x1b6cf6)[_0x7552('0x2c')](_0x3f3102);};}exports[_0x7552('0x2d')]=function(_0x302a17,_0x415b09){var _0x2b57e7={},_0x6db2c5={},_0x592c1f={'count':0x0,'rows':[]};var _0x3eded5=_['map'](db[_0x7552('0x2e')]['rawAttributes'],function(_0x28309e){return{'name':_0x28309e[_0x7552('0x2f')],'type':_0x28309e[_0x7552('0x30')][_0x7552('0x31')]};});_0x6db2c5[_0x7552('0x32')]=_[_0x7552('0x33')](_0x3eded5,_0x7552('0x2b'));_0x6db2c5[_0x7552('0x34')]=_['keys'](_0x302a17[_0x7552('0x34')]);_0x6db2c5['filters']=_[_0x7552('0x35')](_0x6db2c5[_0x7552('0x32')],_0x6db2c5['query']);_0x2b57e7['attributes']=_[_0x7552('0x35')](_0x6db2c5[_0x7552('0x32')],qs[_0x7552('0x36')](_0x302a17[_0x7552('0x34')][_0x7552('0x36')]));_0x2b57e7[_0x7552('0x37')]=_0x2b57e7['attributes']['length']?_0x2b57e7[_0x7552('0x37')]:_0x6db2c5[_0x7552('0x32')];if(!_0x302a17[_0x7552('0x34')]['hasOwnProperty']('nolimit')){_0x2b57e7[_0x7552('0x1c')]=qs[_0x7552('0x1c')](_0x302a17['query'][_0x7552('0x1c')]);_0x2b57e7['offset']=qs['offset'](_0x302a17[_0x7552('0x34')][_0x7552('0x38')]);}_0x2b57e7['order']=qs['sort'](_0x302a17['query'][_0x7552('0x39')]);_0x2b57e7[_0x7552('0x3a')]=qs[_0x7552('0x3b')](_[_0x7552('0x3c')](_0x302a17['query'],_0x6db2c5[_0x7552('0x3b')]),_0x3eded5);if(_0x302a17[_0x7552('0x34')][_0x7552('0x3d')]){_0x2b57e7['where']=_['merge'](_0x2b57e7['where'],{'$or':_[_0x7552('0x33')](_0x3eded5,function(_0x3744b2){if(_0x3744b2[_0x7552('0x30')]!==_0x7552('0x3e')){var _0xd28e27={};_0xd28e27[_0x3744b2['name']]={'$like':'%'+_0x302a17[_0x7552('0x34')][_0x7552('0x3d')]+'%'};return _0xd28e27;}})});}_0x2b57e7=_[_0x7552('0x3f')]({},_0x2b57e7,_0x302a17[_0x7552('0x40')]);var _0x3f183a={'where':_0x2b57e7['where']};return db[_0x7552('0x2e')][_0x7552('0x1d')](_0x3f183a)[_0x7552('0x24')](function(_0x29aa31){_0x592c1f['count']=_0x29aa31;if(_0x302a17[_0x7552('0x34')][_0x7552('0x41')]){_0x2b57e7[_0x7552('0x42')]=[{'all':!![]}];}return db[_0x7552('0x2e')][_0x7552('0x43')](_0x2b57e7);})[_0x7552('0x24')](function(_0x429e96){_0x592c1f[_0x7552('0x44')]=_0x429e96;return _0x592c1f;})[_0x7552('0x24')](respondWithFilteredResult(_0x415b09,_0x2b57e7))['catch'](handleError(_0x415b09,null));};exports['show']=function(_0x16cc85,_0x339621){var _0x1c13e6={'raw':![],'where':{'id':_0x16cc85['params']['id']}},_0x20994a={};_0x20994a['model']=_['keys'](db['Schedule'][_0x7552('0x45')]);_0x20994a[_0x7552('0x34')]=_[_0x7552('0x46')](_0x16cc85[_0x7552('0x34')]);_0x20994a['filters']=_[_0x7552('0x35')](_0x20994a['model'],_0x20994a[_0x7552('0x34')]);_0x1c13e6[_0x7552('0x37')]=_[_0x7552('0x35')](_0x20994a['model'],qs[_0x7552('0x36')](_0x16cc85['query']['fields']));_0x1c13e6['attributes']=_0x1c13e6[_0x7552('0x37')][_0x7552('0x47')]?_0x1c13e6['attributes']:_0x20994a[_0x7552('0x32')];if(_0x16cc85[_0x7552('0x34')][_0x7552('0x41')]){_0x1c13e6['include']=[{'all':!![]}];}_0x1c13e6=_['merge']({},_0x1c13e6,_0x16cc85[_0x7552('0x40')]);return db[_0x7552('0x2e')][_0x7552('0x48')](_0x1c13e6)[_0x7552('0x24')](handleEntityNotFound(_0x339621,null))[_0x7552('0x24')](respondWithResult(_0x339621,null))[_0x7552('0x49')](handleError(_0x339621,null));};exports[_0x7552('0x4a')]=function(_0x3782e1,_0x3f7585){return db[_0x7552('0x2e')][_0x7552('0x4a')](_0x3782e1[_0x7552('0x4b')],{})[_0x7552('0x24')](function(_0x5abfbf){var _0x372770=_0x3782e1[_0x7552('0x4c')][_0x7552('0x25')]({'plain':!![]});if(!_0x372770)throw new Error(_0x7552('0x4d'));if(_0x372770[_0x7552('0x4e')]===_0x7552('0x4c')){var _0x32a4b7=_0x5abfbf['get']({'plain':!![]});var _0x5f335b=_0x7552('0x26');return db[_0x7552('0x4f')][_0x7552('0x48')]({'where':{'name':_0x5f335b,'userProfileId':_0x372770['userProfileId']},'raw':!![]})[_0x7552('0x24')](function(_0x1826c4){if(_0x1826c4&&_0x1826c4['autoAssociation']===0x0){return db[_0x7552('0x27')][_0x7552('0x4a')]({'name':_0x32a4b7['name'],'resourceId':_0x32a4b7['id'],'type':_0x1826c4[_0x7552('0x2b')],'sectionId':_0x1826c4['id']},{})[_0x7552('0x24')](function(){return _0x5abfbf;});}else{return _0x5abfbf;}})[_0x7552('0x49')](function(_0x3e4c47){logger[_0x7552('0x29')](_0x7552('0x50'),_0x3e4c47);throw _0x3e4c47;});}return _0x5abfbf;})['then'](respondWithResult(_0x3f7585,0xc9))[_0x7552('0x49')](handleError(_0x3f7585,null));};exports[_0x7552('0x22')]=function(_0xbb82c6,_0x158d3a){if(_0xbb82c6[_0x7552('0x4b')]['id']){delete _0xbb82c6[_0x7552('0x4b')]['id'];}return db[_0x7552('0x2e')][_0x7552('0x48')]({'where':{'id':_0xbb82c6['params']['id']}})[_0x7552('0x24')](handleEntityNotFound(_0x158d3a,null))[_0x7552('0x24')](saveUpdates(_0xbb82c6[_0x7552('0x4b')],null))[_0x7552('0x24')](respondWithResult(_0x158d3a,null))['catch'](handleError(_0x158d3a,null));};exports['destroy']=function(_0x5b5174,_0x5246c8){return db[_0x7552('0x2e')][_0x7552('0x48')]({'where':{'id':_0x5b5174[_0x7552('0x51')]['id']}})[_0x7552('0x24')](handleEntityNotFound(_0x5246c8,null))['then'](removeEntity(_0x5246c8,null))[_0x7552('0x49')](handleError(_0x5246c8,null));};exports[_0x7552('0x52')]=function(_0x119442,_0x437e31,_0x4141c0){var _0x34a92b=require(_0x7552('0x53'));return db['Schedule'][_0x7552('0x48')]({'where':{'id':_0x119442[_0x7552('0x51')]['id']},'raw':!![]})[_0x7552('0x24')](handleEntityNotFound(_0x437e31,null))['then'](function(){_0x34a92b[_0x7552('0x52')](_0x119442[_0x7552('0x51')]['id']);})[_0x7552('0x24')](respondWithStatusCode(_0x437e31,null))[_0x7552('0x49')](handleError(_0x437e31,null));}; \ No newline at end of file +var _0x9b98=['status','send','map','Schedule','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','findAll','catch','show','params','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','get','destroy','then','sendStatus','error','stack','name'];(function(_0x33235b,_0x4c2666){var _0x175980=function(_0x3eb0f2){while(--_0x3eb0f2){_0x33235b['push'](_0x33235b['shift']());}};_0x175980(++_0x4c2666);}(_0x9b98,0x1d9));var _0x89b9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9b98[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89b9('0x0'));var zipdir=require(_0x89b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89b9('0x2'));var moment=require('moment');var BPromise=require(_0x89b9('0x3'));var Mustache=require(_0x89b9('0x4'));var util=require(_0x89b9('0x5'));var path=require(_0x89b9('0x6'));var sox=require(_0x89b9('0x7'));var csv=require(_0x89b9('0x8'));var ejs=require(_0x89b9('0x9'));var fs=require('fs');var fs_extra=require(_0x89b9('0xa'));var _=require('lodash');var squel=require(_0x89b9('0xb'));var crypto=require(_0x89b9('0xc'));var jsforce=require(_0x89b9('0xd'));var deskjs=require(_0x89b9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x89b9('0xf'));var Redis=require(_0x89b9('0x10'));var authService=require(_0x89b9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x89b9('0x12'));var hardwareService=require(_0x89b9('0x13'));var logger=require(_0x89b9('0x14'))(_0x89b9('0x15'));var utils=require(_0x89b9('0x16'));var config=require(_0x89b9('0x17'));var licenseUtil=require(_0x89b9('0x18'));var db=require(_0x89b9('0x19'))['db'];function respondWithStatusCode(_0x583c18,_0x2fe077){_0x2fe077=_0x2fe077||0xcc;return function(_0x2dfcad){if(_0x2dfcad){return _0x583c18['sendStatus'](_0x2fe077);}return _0x583c18['status'](_0x2fe077)[_0x89b9('0x1a')]();};}function respondWithResult(_0x12da3a,_0x11f560){_0x11f560=_0x11f560||0xc8;return function(_0x7ff5e7){if(_0x7ff5e7){return _0x12da3a['status'](_0x11f560)[_0x89b9('0x1b')](_0x7ff5e7);}};}function respondWithFilteredResult(_0x5da26c,_0x16a196){return function(_0x18ffbb){if(_0x18ffbb){var _0x5a7e9a=typeof _0x16a196[_0x89b9('0x1c')]===_0x89b9('0x1d')&&typeof _0x16a196[_0x89b9('0x1e')]===_0x89b9('0x1d');var _0x36d4fe=_0x18ffbb['count'];var _0x47a551=_0x5a7e9a?0x0:_0x16a196[_0x89b9('0x1c')];var _0x113803=_0x5a7e9a?_0x18ffbb[_0x89b9('0x1f')]:_0x16a196['offset']+_0x16a196[_0x89b9('0x1e')];var _0x3eb2ff;if(_0x113803>=_0x36d4fe){_0x113803=_0x36d4fe;_0x3eb2ff=0xc8;}else{_0x3eb2ff=0xce;}_0x5da26c['status'](_0x3eb2ff);return _0x5da26c['set'](_0x89b9('0x20'),_0x47a551+'-'+_0x113803+'/'+_0x36d4fe)['json'](_0x18ffbb);}return null;};}function patchUpdates(_0x2fbb1f){return function(_0x41ad1c){try{jsonpatch[_0x89b9('0x21')](_0x41ad1c,_0x2fbb1f,!![]);}catch(_0x23a02a){return BPromise['reject'](_0x23a02a);}return _0x41ad1c[_0x89b9('0x22')]();};}function saveUpdates(_0x31a9d0,_0x24c6a5){return function(_0x489bb3){if(_0x489bb3){return _0x489bb3[_0x89b9('0x23')](_0x31a9d0)['then'](function(_0x39dcc3){return _0x39dcc3;});}return null;};}function removeEntity(_0xba3377,_0x10a84f){return function(_0x5e7f36){if(_0x5e7f36){return _0x5e7f36['destroy']()['then'](function(){var _0x2e302f=_0x5e7f36[_0x89b9('0x24')]({'plain':!![]});var _0x256d45='Scheduler';return db['UserProfileResource'][_0x89b9('0x25')]({'where':{'type':_0x256d45,'resourceId':_0x2e302f['id']}})[_0x89b9('0x26')](function(){return _0x5e7f36;});})[_0x89b9('0x26')](function(){_0xba3377['status'](0xcc)[_0x89b9('0x1a')]();});}};}function handleEntityNotFound(_0x30cb67,_0x4b6cd7){return function(_0x555241){if(!_0x555241){_0x30cb67[_0x89b9('0x27')](0x194);}return _0x555241;};}function handleError(_0x2da86d,_0x3140a6){_0x3140a6=_0x3140a6||0x1f4;return function(_0x21172f){logger[_0x89b9('0x28')](_0x21172f[_0x89b9('0x29')]);if(_0x21172f['name']){delete _0x21172f[_0x89b9('0x2a')];}_0x2da86d[_0x89b9('0x2b')](_0x3140a6)[_0x89b9('0x2c')](_0x21172f);};}exports['index']=function(_0x898660,_0xde07c4){var _0x40bd24={},_0x8e7e22={},_0xe6fa15={'count':0x0,'rows':[]};var _0x38de6b=_[_0x89b9('0x2d')](db[_0x89b9('0x2e')]['rawAttributes'],function(_0x333bad){return{'name':_0x333bad[_0x89b9('0x2f')],'type':_0x333bad[_0x89b9('0x30')][_0x89b9('0x31')]};});_0x8e7e22[_0x89b9('0x32')]=_['map'](_0x38de6b,_0x89b9('0x2a'));_0x8e7e22['query']=_[_0x89b9('0x33')](_0x898660[_0x89b9('0x34')]);_0x8e7e22[_0x89b9('0x35')]=_[_0x89b9('0x36')](_0x8e7e22['model'],_0x8e7e22['query']);_0x40bd24[_0x89b9('0x37')]=_['intersection'](_0x8e7e22['model'],qs[_0x89b9('0x38')](_0x898660[_0x89b9('0x34')][_0x89b9('0x38')]));_0x40bd24['attributes']=_0x40bd24[_0x89b9('0x37')]['length']?_0x40bd24[_0x89b9('0x37')]:_0x8e7e22[_0x89b9('0x32')];if(!_0x898660[_0x89b9('0x34')]['hasOwnProperty'](_0x89b9('0x39'))){_0x40bd24[_0x89b9('0x1e')]=qs[_0x89b9('0x1e')](_0x898660[_0x89b9('0x34')][_0x89b9('0x1e')]);_0x40bd24[_0x89b9('0x1c')]=qs[_0x89b9('0x1c')](_0x898660[_0x89b9('0x34')][_0x89b9('0x1c')]);}_0x40bd24[_0x89b9('0x3a')]=qs[_0x89b9('0x3b')](_0x898660['query'][_0x89b9('0x3b')]);_0x40bd24[_0x89b9('0x3c')]=qs['filters'](_['pick'](_0x898660['query'],_0x8e7e22[_0x89b9('0x35')]),_0x38de6b);if(_0x898660['query']['filter']){_0x40bd24[_0x89b9('0x3c')]=_['merge'](_0x40bd24[_0x89b9('0x3c')],{'$or':_[_0x89b9('0x2d')](_0x38de6b,function(_0x5cf077){if(_0x5cf077['type']!==_0x89b9('0x3d')){var _0xaa9b42={};_0xaa9b42[_0x5cf077[_0x89b9('0x2a')]]={'$like':'%'+_0x898660['query'][_0x89b9('0x3e')]+'%'};return _0xaa9b42;}})});}_0x40bd24=_[_0x89b9('0x3f')]({},_0x40bd24,_0x898660['options']);var _0x1cff5a={'where':_0x40bd24[_0x89b9('0x3c')]};return db[_0x89b9('0x2e')][_0x89b9('0x1f')](_0x1cff5a)['then'](function(_0x359a9b){_0xe6fa15[_0x89b9('0x1f')]=_0x359a9b;if(_0x898660['query'][_0x89b9('0x40')]){_0x40bd24['include']=[{'all':!![]}];}return db[_0x89b9('0x2e')][_0x89b9('0x41')](_0x40bd24);})[_0x89b9('0x26')](function(_0x54e9ed){_0xe6fa15['rows']=_0x54e9ed;return _0xe6fa15;})[_0x89b9('0x26')](respondWithFilteredResult(_0xde07c4,_0x40bd24))[_0x89b9('0x42')](handleError(_0xde07c4,null));};exports[_0x89b9('0x43')]=function(_0x2be6cd,_0x17a186){var _0x4c2c0a={'raw':![],'where':{'id':_0x2be6cd[_0x89b9('0x44')]['id']}},_0x4f8922={};_0x4f8922[_0x89b9('0x32')]=_[_0x89b9('0x33')](db[_0x89b9('0x2e')][_0x89b9('0x45')]);_0x4f8922[_0x89b9('0x34')]=_[_0x89b9('0x33')](_0x2be6cd[_0x89b9('0x34')]);_0x4f8922[_0x89b9('0x35')]=_['intersection'](_0x4f8922[_0x89b9('0x32')],_0x4f8922['query']);_0x4c2c0a[_0x89b9('0x37')]=_[_0x89b9('0x36')](_0x4f8922[_0x89b9('0x32')],qs[_0x89b9('0x38')](_0x2be6cd[_0x89b9('0x34')][_0x89b9('0x38')]));_0x4c2c0a[_0x89b9('0x37')]=_0x4c2c0a[_0x89b9('0x37')][_0x89b9('0x46')]?_0x4c2c0a[_0x89b9('0x37')]:_0x4f8922['model'];if(_0x2be6cd[_0x89b9('0x34')][_0x89b9('0x40')]){_0x4c2c0a['include']=[{'all':!![]}];}_0x4c2c0a=_[_0x89b9('0x3f')]({},_0x4c2c0a,_0x2be6cd[_0x89b9('0x47')]);return db[_0x89b9('0x2e')][_0x89b9('0x48')](_0x4c2c0a)[_0x89b9('0x26')](handleEntityNotFound(_0x17a186,null))[_0x89b9('0x26')](respondWithResult(_0x17a186,null))[_0x89b9('0x42')](handleError(_0x17a186,null));};exports[_0x89b9('0x49')]=function(_0x481674,_0x1bf4f6){return db[_0x89b9('0x2e')]['create'](_0x481674[_0x89b9('0x4a')],{})[_0x89b9('0x26')](function(_0x87b4e2){var _0x3886a2=_0x481674[_0x89b9('0x4b')][_0x89b9('0x24')]({'plain':!![]});if(!_0x3886a2)throw new Error(_0x89b9('0x4c'));if(_0x3886a2[_0x89b9('0x4d')]==='user'){var _0xe6f62b=_0x87b4e2[_0x89b9('0x24')]({'plain':!![]});var _0x65d81=_0x89b9('0x4e');return db[_0x89b9('0x4f')][_0x89b9('0x48')]({'where':{'name':_0x65d81,'userProfileId':_0x3886a2[_0x89b9('0x50')]},'raw':!![]})[_0x89b9('0x26')](function(_0x3a1167){if(_0x3a1167&&_0x3a1167[_0x89b9('0x51')]===0x0){return db[_0x89b9('0x52')][_0x89b9('0x49')]({'name':_0xe6f62b[_0x89b9('0x2a')],'resourceId':_0xe6f62b['id'],'type':_0x3a1167[_0x89b9('0x2a')],'sectionId':_0x3a1167['id']},{})['then'](function(){return _0x87b4e2;});}else{return _0x87b4e2;}})[_0x89b9('0x42')](function(_0x4e12e1){logger[_0x89b9('0x28')](_0x89b9('0x53'),_0x4e12e1);throw _0x4e12e1;});}return _0x87b4e2;})['then'](respondWithResult(_0x1bf4f6,0xc9))[_0x89b9('0x42')](handleError(_0x1bf4f6,null));};exports['update']=function(_0x1f5df8,_0x39686b){if(_0x1f5df8[_0x89b9('0x4a')]['id']){delete _0x1f5df8[_0x89b9('0x4a')]['id'];}return db[_0x89b9('0x2e')][_0x89b9('0x48')]({'where':{'id':_0x1f5df8[_0x89b9('0x44')]['id']}})[_0x89b9('0x26')](handleEntityNotFound(_0x39686b,null))[_0x89b9('0x26')](saveUpdates(_0x1f5df8[_0x89b9('0x4a')],null))[_0x89b9('0x26')](respondWithResult(_0x39686b,null))[_0x89b9('0x42')](handleError(_0x39686b,null));};exports[_0x89b9('0x25')]=function(_0x50ed9b,_0xdc307){return db['Schedule'][_0x89b9('0x48')]({'where':{'id':_0x50ed9b['params']['id']}})[_0x89b9('0x26')](handleEntityNotFound(_0xdc307,null))['then'](removeEntity(_0xdc307,null))[_0x89b9('0x42')](handleError(_0xdc307,null));};exports['run']=function(_0x25494a,_0x4a05ab,_0x2e199e){var _0x2c260c=require(_0x89b9('0x54'));return db[_0x89b9('0x2e')][_0x89b9('0x48')]({'where':{'id':_0x25494a[_0x89b9('0x44')]['id']},'raw':!![]})[_0x89b9('0x26')](handleEntityNotFound(_0x4a05ab,null))[_0x89b9('0x26')](function(){_0x2c260c[_0x89b9('0x55')](_0x25494a[_0x89b9('0x44')]['id']);})[_0x89b9('0x26')](respondWithStatusCode(_0x4a05ab,null))[_0x89b9('0x42')](handleError(_0x4a05ab,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 7ee242f..db93bcd 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 _0x8f35=['./schedule.attributes','define','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x15ed84,_0x589521){var _0x426d2b=function(_0x5d294a){while(--_0x5d294a){_0x15ed84['push'](_0x15ed84['shift']());}};_0x426d2b(++_0x589521);}(_0x8f35,0x19a));var _0x58f3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f35[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x58f3('0x0'));var util=require(_0x58f3('0x1'));var logger=require(_0x58f3('0x2'))(_0x58f3('0x3'));var moment=require(_0x58f3('0x4'));var BPromise=require(_0x58f3('0x5'));var rp=require(_0x58f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58f3('0x7'));var config=require('../../config/environment');var attributes=require(_0x58f3('0x8'));module['exports']=function(_0xdb4c89,_0x30b0ba){return _0xdb4c89[_0x58f3('0x9')]('Schedule',attributes,{'tableName':_0x58f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x878c=['rimraf','./schedule.attributes','exports','Schedule','tools_schedules','../../config/logger','bluebird','request-promise','path'];(function(_0x157cf9,_0x124acd){var _0x12ca0e=function(_0x7a0c41){while(--_0x7a0c41){_0x157cf9['push'](_0x157cf9['shift']());}};_0x12ca0e(++_0x124acd);}(_0x878c,0x137));var _0xc878=function(_0x10e4c7,_0x1444c2){_0x10e4c7=_0x10e4c7-0x0;var _0x332033=_0x878c[_0x10e4c7];return _0x332033;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc878('0x0'))('api');var moment=require('moment');var BPromise=require(_0xc878('0x1'));var rp=require(_0xc878('0x2'));var fs=require('fs');var path=require(_0xc878('0x3'));var rimraf=require(_0xc878('0x4'));var config=require('../../config/environment');var attributes=require(_0xc878('0x5'));module[_0xc878('0x6')]=function(_0x39972e,_0x313e65){return _0x39972e['define'](_0xc878('0x7'),attributes,{'tableName':_0xc878('0x8'),'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 5d9d620..d190e96 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 _0xaf29=['jayson/promise','client','http','then','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','Schedule,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaf29,0x1b1));var _0x9af2=function(_0x1ba144,_0x157555){_0x1ba144=_0x1ba144-0x0;var _0xc3b592=_0xaf29[_0x1ba144];return _0xc3b592;};'use strict';var _=require('lodash');var util=require(_0x9af2('0x0'));var moment=require('moment');var BPromise=require(_0x9af2('0x1'));var rs=require(_0x9af2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9af2('0x3'));var logger=require(_0x9af2('0x4'))(_0x9af2('0x5'));var config=require(_0x9af2('0x6'));var jayson=require(_0x9af2('0x7'));var client=jayson[_0x9af2('0x8')][_0x9af2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f65b3,_0x57d35c,_0x3bf89e){return new BPromise(function(_0x4735b7,_0x3b6f62){return client['request'](_0x3f65b3,_0x3bf89e)[_0x9af2('0xa')](function(_0x2211d1){logger['info']('Schedule,\x20%s,\x20%s',_0x57d35c,_0x9af2('0xb'));logger['debug'](_0x9af2('0xc'),_0x57d35c,_0x9af2('0xb'),JSON[_0x9af2('0xd')](_0x2211d1));if(_0x2211d1[_0x9af2('0xe')]){if(_0x2211d1[_0x9af2('0xe')]['code']===0x1f4){logger['error'](_0x9af2('0xf'),_0x57d35c,_0x2211d1[_0x9af2('0xe')][_0x9af2('0x10')]);return _0x3b6f62(_0x2211d1[_0x9af2('0xe')][_0x9af2('0x10')]);}logger['error'](_0x9af2('0xf'),_0x57d35c,_0x2211d1['error']['message']);return _0x4735b7(_0x2211d1['error']['message']);}else{logger[_0x9af2('0x11')](_0x9af2('0xf'),_0x57d35c,_0x9af2('0xb'));_0x4735b7(_0x2211d1[_0x9af2('0x12')][_0x9af2('0x10')]);}})[_0x9af2('0x13')](function(_0x34d3ef){logger[_0x9af2('0xe')](_0x9af2('0xf'),_0x57d35c,_0x34d3ef);_0x3b6f62(_0x34d3ef);});});} \ No newline at end of file +var _0xa0c0=['Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x36f99f,_0x10dfa2){var _0x85cb3b=function(_0x26d6b7){while(--_0x26d6b7){_0x36f99f['push'](_0x36f99f['shift']());}};_0x85cb3b(++_0x10dfa2);}(_0xa0c0,0x110));var _0x0a0c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa0c0[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x0a0c('0x0'));var util=require('util');var moment=require(_0x0a0c('0x1'));var BPromise=require(_0x0a0c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a0c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0a0c('0x4'))(_0x0a0c('0x5'));var config=require(_0x0a0c('0x6'));var jayson=require(_0x0a0c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x404fef,_0x30afc7,_0x3840c8){return new BPromise(function(_0x36132b,_0x3af4a5){return client[_0x0a0c('0x8')](_0x404fef,_0x3840c8)[_0x0a0c('0x9')](function(_0x1eb1ac){logger['info'](_0x0a0c('0xa'),_0x30afc7,_0x0a0c('0xb'));logger[_0x0a0c('0xc')](_0x0a0c('0xd'),_0x30afc7,_0x0a0c('0xb'),JSON['stringify'](_0x1eb1ac));if(_0x1eb1ac['error']){if(_0x1eb1ac[_0x0a0c('0xe')][_0x0a0c('0xf')]===0x1f4){logger[_0x0a0c('0xe')](_0x0a0c('0xa'),_0x30afc7,_0x1eb1ac['error']['message']);return _0x3af4a5(_0x1eb1ac[_0x0a0c('0xe')][_0x0a0c('0x10')]);}logger[_0x0a0c('0xe')](_0x0a0c('0xa'),_0x30afc7,_0x1eb1ac[_0x0a0c('0xe')][_0x0a0c('0x10')]);return _0x36132b(_0x1eb1ac[_0x0a0c('0xe')][_0x0a0c('0x10')]);}else{logger['info'](_0x0a0c('0xa'),_0x30afc7,_0x0a0c('0xb'));_0x36132b(_0x1eb1ac[_0x0a0c('0x11')][_0x0a0c('0x10')]);}})[_0x0a0c('0x12')](function(_0x4e65c9){logger[_0x0a0c('0xe')](_0x0a0c('0xa'),_0x30afc7,_0x4e65c9);_0x3af4a5(_0x4e65c9);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 23544db..2093e16 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 _0x30d9=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/download','download','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0x30d9,0x1c7));var _0x930d=function(_0x331151,_0x1c46f7){_0x331151=_0x331151-0x0;var _0x13cf48=_0x30d9[_0x331151];return _0x13cf48;};'use strict';var multer=require(_0x930d('0x0'));var util=require(_0x930d('0x1'));var path=require(_0x930d('0x2'));var timeout=require(_0x930d('0x3'));var express=require(_0x930d('0x4'));var router=express[_0x930d('0x5')]();var fs_extra=require(_0x930d('0x6'));var auth=require(_0x930d('0x7'));var interaction=require(_0x930d('0x8'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x930d('0x9')]('/',auth[_0x930d('0xa')](),controller[_0x930d('0xb')]);router[_0x930d('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x930d('0xc')]);router['get']('/:id',auth[_0x930d('0xa')](),controller[_0x930d('0xd')]);router['get'](_0x930d('0xe'),auth[_0x930d('0xa')](),controller[_0x930d('0xf')]);router['post']('/',auth[_0x930d('0xa')](),controller[_0x930d('0x10')]);router[_0x930d('0x11')](_0x930d('0x12'),auth[_0x930d('0xa')](),controller[_0x930d('0x13')]);router[_0x930d('0x14')]('/:id',auth[_0x930d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd93f=['update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','/describe','/:id','show','/:id/download','download','post','create','put'];(function(_0x3710dc,_0x53fa5f){var _0x3f7af3=function(_0x243d44){while(--_0x243d44){_0x3710dc['push'](_0x3710dc['shift']());}};_0x3f7af3(++_0x53fa5f);}(_0xd93f,0x81));var _0xfd93=function(_0x336f33,_0x43cc91){_0x336f33=_0x336f33-0x0;var _0x3ea123=_0xd93f[_0x336f33];return _0x3ea123;};'use strict';var multer=require(_0xfd93('0x0'));var util=require(_0xfd93('0x1'));var path=require(_0xfd93('0x2'));var timeout=require(_0xfd93('0x3'));var express=require(_0xfd93('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfd93('0x5'));var config=require(_0xfd93('0x6'));var controller=require(_0xfd93('0x7'));router['get']('/',auth[_0xfd93('0x8')](),controller['index']);router[_0xfd93('0x9')](_0xfd93('0xa'),auth[_0xfd93('0x8')](),controller['describe']);router[_0xfd93('0x9')](_0xfd93('0xb'),auth[_0xfd93('0x8')](),controller[_0xfd93('0xc')]);router['get'](_0xfd93('0xd'),auth[_0xfd93('0x8')](),controller[_0xfd93('0xe')]);router[_0xfd93('0xf')]('/',auth[_0xfd93('0x8')](),controller[_0xfd93('0x10')]);router[_0xfd93('0x11')](_0xfd93('0xb'),auth[_0xfd93('0x8')](),controller[_0xfd93('0x12')]);router['delete']('/:id',auth[_0xfd93('0x8')](),controller[_0xfd93('0x13')]);module[_0xfd93('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index ffee3c4..fdeb735 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 _0x390a=['createdAt','toString','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','INTEGER','setDataValue','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4cd2c7,_0x215c96){var _0x576dcd=function(_0x251c35){while(--_0x251c35){_0x4cd2c7['push'](_0x4cd2c7['shift']());}};_0x576dcd(++_0x215c96);}(_0x390a,0xc9));var _0xa390=function(_0x58b7c8,_0xb2dcb4){_0x58b7c8=_0x58b7c8-0x0;var _0x129f8b=_0x390a[_0x58b7c8];return _0x129f8b;};'use strict';var Sequelize=require(_0xa390('0x0'));var moment=require(_0xa390('0x1'));var path=require(_0xa390('0x2'));var config=require(_0xa390('0x3'));module['exports']={'format':{'type':Sequelize[_0xa390('0x4')],'get':function(){return this[_0xa390('0x5')](_0xa390('0x6'))?path[_0xa390('0x7')](this['getDataValue'](_0xa390('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xa390('0x8')]},'channel':{'type':Sequelize[_0xa390('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x2d49cc){var _0x1f9de0=_0x2d49cc['replace'](/\\/g,'/');this['setDataValue'](_0xa390('0x6'),_0x1f9de0);}},'rating':{'type':Sequelize[_0xa390('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa390('0x9')],'set':function(_0x226003){this[_0xa390('0xa')]('startedAt',moment()['subtract'](_0x226003,'ms'));this[_0xa390('0xa')](_0xa390('0xb'),moment());this[_0xa390('0xa')]('duration',_0x226003);}},'startedAt':{'type':Sequelize[_0xa390('0xc')],'get':function(){return moment(this[_0xa390('0x5')]('startedAt'))[_0xa390('0xd')](_0xa390('0xe'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa390('0x5')](_0xa390('0xb')))['format'](_0xa390('0xe'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xa390('0xf')))['format'](_0xa390('0xe'))[_0xa390('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa390('0x5')](_0xa390('0x11')))['format'](_0xa390('0xe'))['toString']();}}}; \ No newline at end of file +var _0x47d6=['INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue'];(function(_0x57aad4,_0x108f28){var _0x26b886=function(_0x222c41){while(--_0x222c41){_0x57aad4['push'](_0x57aad4['shift']());}};_0x26b886(++_0x108f28);}(_0x47d6,0x13f));var _0x647d=function(_0xeefb2b,_0xafcae3){_0xeefb2b=_0xeefb2b-0x0;var _0x31dfc5=_0x47d6[_0xeefb2b];return _0x31dfc5;};'use strict';var Sequelize=require(_0x647d('0x0'));var moment=require(_0x647d('0x1'));var path=require(_0x647d('0x2'));var config=require(_0x647d('0x3'));module[_0x647d('0x4')]={'format':{'type':Sequelize[_0x647d('0x5')],'get':function(){return this[_0x647d('0x6')](_0x647d('0x7'))?path[_0x647d('0x8')](this[_0x647d('0x6')](_0x647d('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x647d('0x9')]},'channel':{'type':Sequelize[_0x647d('0x9')]},'value':{'type':Sequelize[_0x647d('0x9')],'set':function(_0x1db1db){var _0x1c6a88=_0x1db1db['replace'](/\\/g,'/');this[_0x647d('0xa')](_0x647d('0x7'),_0x1c6a88);}},'rating':{'type':Sequelize[_0x647d('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x647d('0xb')],'set':function(_0x414518){this[_0x647d('0xa')](_0x647d('0xc'),moment()[_0x647d('0xd')](_0x414518,'ms'));this[_0x647d('0xa')](_0x647d('0xe'),moment());this[_0x647d('0xa')](_0x647d('0xf'),_0x414518);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x647d('0xc')))[_0x647d('0x10')](_0x647d('0x11'))[_0x647d('0x12')]();}},'closedAt':{'type':Sequelize[_0x647d('0x13')],'get':function(){return moment(this[_0x647d('0x6')](_0x647d('0xe')))[_0x647d('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x647d('0x12')]();}},'createdAt':{'type':Sequelize[_0x647d('0x13')],'get':function(){return moment(this['getDataValue'](_0x647d('0x14')))[_0x647d('0x10')](_0x647d('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x647d('0x6')](_0x647d('0x15')))[_0x647d('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x647d('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 7f03ed4..199c184 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4fdd64,_0x4ec5d4){_0x4fdd64=_0x4fdd64-0x0;var _0x1e9ae1=_0xd0bb[_0x4fdd64];return _0x1e9ae1;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require(_0xbd0b('0x1'));var zipdir=require(_0xbd0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0b('0x3'));var moment=require('moment');var BPromise=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var util=require('util');var path=require(_0xbd0b('0x6'));var sox=require('sox');var csv=require(_0xbd0b('0x7'));var ejs=require(_0xbd0b('0x8'));var fs=require('fs');var fs_extra=require(_0xbd0b('0x9'));var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x7'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var licenseUtil=require(_0xbd0b('0x15'));var db=require(_0xbd0b('0x16'))['db'];function respondWithStatusCode(_0x315ed9,_0x2621bf){_0x2621bf=_0x2621bf||0xcc;return function(_0x42a96b){if(_0x42a96b){return _0x315ed9[_0xbd0b('0x17')](_0x2621bf);}return _0x315ed9[_0xbd0b('0x18')](_0x2621bf)[_0xbd0b('0x19')]();};}function respondWithResult(_0x1c10c1,_0x2d4664){_0x2d4664=_0x2d4664||0xc8;return function(_0x57077a){if(_0x57077a){return _0x1c10c1[_0xbd0b('0x18')](_0x2d4664)['json'](_0x57077a);}};}function respondWithFilteredResult(_0x4a8014,_0x36d1ca){return function(_0x4c0e52){if(_0x4c0e52){var _0x3183cf=typeof _0x36d1ca[_0xbd0b('0x1a')]===_0xbd0b('0x1b')&&typeof _0x36d1ca['limit']==='undefined';var _0x2136ef=_0x4c0e52[_0xbd0b('0x1c')];var _0x1f2a6e=_0x3183cf?0x0:_0x36d1ca[_0xbd0b('0x1a')];var _0x1c0a7c=_0x3183cf?_0x4c0e52[_0xbd0b('0x1c')]:_0x36d1ca['offset']+_0x36d1ca[_0xbd0b('0x1d')];var _0x49499f;if(_0x1c0a7c>=_0x2136ef){_0x1c0a7c=_0x2136ef;_0x49499f=0xc8;}else{_0x49499f=0xce;}_0x4a8014[_0xbd0b('0x18')](_0x49499f);return _0x4a8014[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x1f2a6e+'-'+_0x1c0a7c+'/'+_0x2136ef)[_0xbd0b('0x20')](_0x4c0e52);}return null;};}function patchUpdates(_0x4b312d){return function(_0x403c91){try{jsonpatch[_0xbd0b('0x21')](_0x403c91,_0x4b312d,!![]);}catch(_0x40b021){return BPromise['reject'](_0x40b021);}return _0x403c91[_0xbd0b('0x22')]();};}function saveUpdates(_0x560db4,_0xc66b8){return function(_0x3c4938){if(_0x3c4938){return _0x3c4938[_0xbd0b('0x23')](_0x560db4)[_0xbd0b('0x24')](function(_0x297c85){return _0x297c85;});}return null;};}function removeEntity(_0x539359,_0x75909f){return function(_0x58a721){if(_0x58a721){return _0x58a721[_0xbd0b('0x25')]()[_0xbd0b('0x24')](function(){_0x539359[_0xbd0b('0x18')](0xcc)[_0xbd0b('0x19')]();});}};}function handleEntityNotFound(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(!_0x4fe9ed){_0xfd9f82[_0xbd0b('0x17')](0x194);}return _0x4fe9ed;};}function handleError(_0x1b46a3,_0x33b752){_0x33b752=_0x33b752||0x1f4;return function(_0x1b5a00){logger[_0xbd0b('0x26')](_0x1b5a00[_0xbd0b('0x27')]);if(_0x1b5a00['name']){delete _0x1b5a00[_0xbd0b('0x28')];}_0x1b46a3[_0xbd0b('0x18')](_0x33b752)[_0xbd0b('0x29')](_0x1b5a00);};}exports['index']=function(_0x4dfe76,_0x2187a5){var _0x684b09={},_0x14e5a3={},_0xf4ba04={'count':0x0,'rows':[]};var _0x4e2149=_[_0xbd0b('0x2a')](db[_0xbd0b('0x2b')]['rawAttributes'],function(_0x45f7d6){return{'name':_0x45f7d6[_0xbd0b('0x2c')],'type':_0x45f7d6['type']['key']};});_0x14e5a3[_0xbd0b('0x2d')]=_[_0xbd0b('0x2e')](_['map'](_0x4e2149,_0xbd0b('0x28')),[_0xbd0b('0x2f')]);_0x14e5a3[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x4dfe76[_0xbd0b('0x30')]);_0x14e5a3[_0xbd0b('0x32')]=_['intersection'](_0x14e5a3[_0xbd0b('0x2d')],_0x14e5a3[_0xbd0b('0x30')]);_0x684b09[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x14e5a3[_0xbd0b('0x2d')],qs[_0xbd0b('0x35')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x684b09[_0xbd0b('0x33')]=_0x684b09[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x684b09[_0xbd0b('0x33')]:_0x14e5a3[_0xbd0b('0x2d')];if(!_0x4dfe76[_0xbd0b('0x30')]['hasOwnProperty'](_0xbd0b('0x37'))){_0x684b09[_0xbd0b('0x1d')]=qs['limit'](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1d')]);_0x684b09[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1a')]);}_0x684b09['order']=qs[_0xbd0b('0x38')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x38')]);_0x684b09[_0xbd0b('0x39')]=qs[_0xbd0b('0x32')](_['pick'](_0x4dfe76['query'],_0x14e5a3[_0xbd0b('0x32')]),_0x4e2149);if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]){_0x684b09[_0xbd0b('0x39')]=_['merge'](_0x684b09['where'],{'$or':_[_0xbd0b('0x2a')](_0x4e2149,function(_0x4d8237){if(_0x4d8237[_0xbd0b('0x3b')]!==_0xbd0b('0x3c')){var _0x3f34dc={};_0x3f34dc[_0x4d8237[_0xbd0b('0x28')]]={'$like':'%'+_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]+'%'};return _0x3f34dc;}})});}_0x684b09=_[_0xbd0b('0x3d')]({},_0x684b09,_0x4dfe76[_0xbd0b('0x3e')]);var _0x2acc9f={'where':_0x684b09[_0xbd0b('0x39')]};return db[_0xbd0b('0x2b')][_0xbd0b('0x1c')](_0x2acc9f)[_0xbd0b('0x24')](function(_0x425c8a){_0xf4ba04[_0xbd0b('0x1c')]=_0x425c8a;if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x684b09[_0xbd0b('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0xbd0b('0x41')](_0x684b09);})[_0xbd0b('0x24')](function(_0x89b5ea){_0xf4ba04[_0xbd0b('0x42')]=_0x89b5ea;return _0xf4ba04;})[_0xbd0b('0x24')](respondWithFilteredResult(_0x2187a5,_0x684b09))[_0xbd0b('0x43')](handleError(_0x2187a5,null));};exports[_0xbd0b('0x44')]=function(_0x1b4497,_0x2a1a1d){var _0x4d72f={'raw':![],'where':{'id':_0x1b4497[_0xbd0b('0x45')]['id']}},_0xa252a2={};_0xa252a2['model']=_[_0xbd0b('0x31')](db['ScreenRecording']['rawAttributes']);_0xa252a2[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x1b4497[_0xbd0b('0x30')]);_0xa252a2['filters']=_[_0xbd0b('0x34')](_0xa252a2[_0xbd0b('0x2d')],_0xa252a2[_0xbd0b('0x30')]);_0x4d72f[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0xa252a2['model'],qs[_0xbd0b('0x35')](_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x4d72f[_0xbd0b('0x33')]=_0x4d72f[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x4d72f['attributes']:_0xa252a2[_0xbd0b('0x2d')];if(_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x4d72f[_0xbd0b('0x40')]=[{'all':!![]}];}_0x4d72f=_[_0xbd0b('0x3d')]({},_0x4d72f,_0x1b4497[_0xbd0b('0x3e')]);return db[_0xbd0b('0x2b')][_0xbd0b('0x46')](_0x4d72f)[_0xbd0b('0x24')](handleEntityNotFound(_0x2a1a1d,null))[_0xbd0b('0x24')](respondWithResult(_0x2a1a1d,null))[_0xbd0b('0x43')](handleError(_0x2a1a1d,null));};exports[_0xbd0b('0x47')]=function(_0x222ee1,_0x30f77e){return db[_0xbd0b('0x2b')][_0xbd0b('0x47')](_0x222ee1[_0xbd0b('0x48')],{})[_0xbd0b('0x24')](respondWithResult(_0x30f77e,0xc9))[_0xbd0b('0x43')](handleError(_0x30f77e,null));};exports[_0xbd0b('0x23')]=function(_0x3cfb52,_0xbd64e2){if(_0x3cfb52[_0xbd0b('0x48')]['id']){delete _0x3cfb52['body']['id'];}delete _0x3cfb52[_0xbd0b('0x48')][_0xbd0b('0x49')];delete _0x3cfb52['body']['createdAt'];delete _0x3cfb52['body'][_0xbd0b('0x4a')];delete _0x3cfb52['body'][_0xbd0b('0x4b')];return db[_0xbd0b('0x2b')][_0xbd0b('0x46')]({'where':{'id':_0x3cfb52[_0xbd0b('0x45')]['id']}})['then'](handleEntityNotFound(_0xbd64e2,null))[_0xbd0b('0x24')](saveUpdates(_0x3cfb52['body'],null))[_0xbd0b('0x24')](respondWithResult(_0xbd64e2,null))['catch'](handleError(_0xbd64e2,null));};exports['describe']=function(_0x80d89a,_0x22f741){return db[_0xbd0b('0x2b')][_0xbd0b('0x4c')]()[_0xbd0b('0x24')](respondWithResult(_0x22f741,null))[_0xbd0b('0x43')](handleError(_0x22f741,null));};exports[_0xbd0b('0x4d')]=function(_0x2a7252,_0x4cc013,_0x48a78c){var _0x2d13fd=require(_0xbd0b('0x4e'));var _0x5094bd=![];var _0x514985={};if(_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]&&_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]==='uniqueid'){_0x514985[_0xbd0b('0x4f')]=_0x2a7252[_0xbd0b('0x45')]['id'];}else{_0x514985['id']=_0x2a7252[_0xbd0b('0x45')]['id'];}return db[_0xbd0b('0x2b')]['find']({'where':_0x514985,'attributes':['id',_0xbd0b('0x4b')],'raw':!![]})[_0xbd0b('0x24')](handleEntityNotFound(_0x4cc013,null))['then'](function(_0x122a19){if(_0x122a19){var _0x1ea443=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],_0xbd0b('0x52'),_0x122a19[_0xbd0b('0x4b')]);var _0x3a526a=util[_0xbd0b('0x2f')]('%s.cypher',_0x1ea443);if(fs[_0xbd0b('0x53')](_0x3a526a)){_0x5094bd=!![];return _0x2d13fd[_0xbd0b('0x54')](_0x3a526a,_0x1ea443,config[_0xbd0b('0x55')][_0xbd0b('0x56')])[_0xbd0b('0x24')](function(){return _0x122a19;});}return _0x122a19;}})[_0xbd0b('0x24')](function(_0x49b7a6){if(_0x49b7a6){var _0x570648=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x49b7a6[_0xbd0b('0x4b')]);if(!fs[_0xbd0b('0x53')](_0x570648)){throw new db[(_0xbd0b('0x57'))][(_0xbd0b('0x58'))](_0xbd0b('0x59'));}if(_0x49b7a6['filename']){return _0x4cc013[_0xbd0b('0x4d')](_0x570648,_0x49b7a6[_0xbd0b('0x5a')]+path[_0xbd0b('0x5b')](_0x570648),function(){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}else{return _0x4cc013[_0xbd0b('0x4d')](_0x570648,function(_0xa08f72){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}}})[_0xbd0b('0x43')](function(_0x429534){if(_0x429534[_0xbd0b('0x5d')]===_0xbd0b('0x59')){_0x4cc013[_0xbd0b('0x18')](0x194)[_0xbd0b('0x29')](_0xbd0b('0x5e'));}else{return handleError(_0x4cc013,null);}});};exports[_0xbd0b('0x25')]=function(_0x1fefd5,_0x1e0beb){return db['ScreenRecording'][_0xbd0b('0x46')]({'where':{'id':_0x1fefd5[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x24')](function(_0x2c935c){if(_['isNil'](_0x2c935c)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2c935c;})[_0xbd0b('0x24')](function(_0x45c6b5){var _0x4317f0=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x45c6b5[_0xbd0b('0x4b')]);logger['info'](_0xbd0b('0x5f'),_0x4317f0);if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs[_0xbd0b('0x53')](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbd0b('0x63')](_0x4317f0);}_0x4317f0=_0x4317f0+_0xbd0b('0x64');if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs['existsSync'](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+_0xbd0b('0x65'));fs[_0xbd0b('0x63')](_0x4317f0);}return _0x45c6b5;})[_0xbd0b('0x24')](function(_0x4df3df){if(!_0x4df3df)throw new InternalError();return _0x4df3df['destroy']();})[_0xbd0b('0x24')](function(){_0x1e0beb['status'](0xcc)[_0xbd0b('0x19')]();})[_0xbd0b('0x43')](handleError(_0x1e0beb,null));}; \ No newline at end of file +var _0x008c=['papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','sendStatus','send','index','ScreenRecording','rawAttributes','key','model','differenceBy','map','name','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','decryptFile','secrets','recording','existsSync','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x008c,0x188));var _0xc008=function(_0x212fcc,_0x1a8867){_0x212fcc=_0x212fcc-0x0;var _0x4d8190=_0x008c[_0x212fcc];return _0x4d8190;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_[_0xc008('0x2b')](_0x2a7d4f,_0xc008('0x2c')),[_0xc008('0x2d')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x25eae4[_0xc008('0x2e')]);_0x32390d[_0xc008('0x30')]=_[_0xc008('0x31')](_0x32390d[_0xc008('0x29')],_0x32390d['query']);_0x24c14c[_0xc008('0x32')]=_[_0xc008('0x31')](_0x32390d['model'],qs[_0xc008('0x33')](_0x25eae4[_0xc008('0x2e')][_0xc008('0x33')]));_0x24c14c[_0xc008('0x32')]=_0x24c14c[_0xc008('0x32')][_0xc008('0x34')]?_0x24c14c[_0xc008('0x32')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2e')]['hasOwnProperty'](_0xc008('0x35'))){_0x24c14c[_0xc008('0x1d')]=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2e')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4['query'][_0xc008('0x1b')]);}_0x24c14c[_0xc008('0x36')]=qs['sort'](_0x25eae4[_0xc008('0x2e')][_0xc008('0x37')]);_0x24c14c['where']=qs[_0xc008('0x30')](_[_0xc008('0x38')](_0x25eae4[_0xc008('0x2e')],_0x32390d['filters']),_0x2a7d4f);if(_0x25eae4['query']['filter']){_0x24c14c[_0xc008('0x39')]=_['merge'](_0x24c14c[_0xc008('0x39')],{'$or':_[_0xc008('0x2b')](_0x2a7d4f,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x3a')]!==_0xc008('0x3b')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x2c')]]={'$like':'%'+_0x25eae4[_0xc008('0x2e')][_0xc008('0x3c')]+'%'};return _0xa381d1;}})});}_0x24c14c=_[_0xc008('0x3d')]({},_0x24c14c,_0x25eae4[_0xc008('0x3e')]);var _0xdfca2e={'where':_0x24c14c[_0xc008('0x39')]};return db[_0xc008('0x26')]['count'](_0xdfca2e)[_0xc008('0x21')](function(_0x23c4db){_0x209591[_0xc008('0x1e')]=_0x23c4db;if(_0x25eae4[_0xc008('0x2e')]['includeAll']){_0x24c14c[_0xc008('0x3f')]=[{'all':!![]}];}return db[_0xc008('0x26')][_0xc008('0x40')](_0x24c14c);})[_0xc008('0x21')](function(_0x2d142d){_0x209591['rows']=_0x2d142d;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))[_0xc008('0x41')](handleError(_0x529961,null));};exports[_0xc008('0x42')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':![],'where':{'id':_0x3e9a99[_0xc008('0x43')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x29')]=_[_0xc008('0x2f')](db['ScreenRecording'][_0xc008('0x27')]);_0xf4cc4b[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x30')]=_['intersection'](_0xf4cc4b[_0xc008('0x29')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x32')]=_[_0xc008('0x31')](_0xf4cc4b['model'],qs[_0xc008('0x33')](_0x3e9a99[_0xc008('0x2e')][_0xc008('0x33')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x32')][_0xc008('0x34')]?_0x4f93a4[_0xc008('0x32')]:_0xf4cc4b[_0xc008('0x29')];if(_0x3e9a99[_0xc008('0x2e')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x26')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x21')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x21')](respondWithResult(_0x7279e8,null))[_0xc008('0x41')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['ScreenRecording']['create'](_0x2cf641['body'],{})[_0xc008('0x21')](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x41')](handleError(_0x33be4f,null));};exports[_0xc008('0x20')]=function(_0x511383,_0x28bc33){if(_0x511383[_0xc008('0x47')]['id']){delete _0x511383[_0xc008('0x47')]['id'];}delete _0x511383[_0xc008('0x47')][_0xc008('0x48')];delete _0x511383[_0xc008('0x47')][_0xc008('0x49')];delete _0x511383[_0xc008('0x47')][_0xc008('0x4a')];delete _0x511383[_0xc008('0x47')]['value'];return db['ScreenRecording'][_0xc008('0x45')]({'where':{'id':_0x511383['params']['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x28bc33,null))[_0xc008('0x21')](saveUpdates(_0x511383[_0xc008('0x47')],null))['then'](respondWithResult(_0x28bc33,null))[_0xc008('0x41')](handleError(_0x28bc33,null));};exports[_0xc008('0x4b')]=function(_0xee64,_0x8b9775){return db[_0xc008('0x26')]['describe']()[_0xc008('0x21')](respondWithResult(_0x8b9775,null))[_0xc008('0x41')](handleError(_0x8b9775,null));};exports['download']=function(_0x24f775,_0xfd6d1d,_0x5b5fbf){var _0x51d3dc=require(_0xc008('0x4c'));var _0xd47b74=![];var _0x20947b={};if(_0x24f775[_0xc008('0x2e')][_0xc008('0x3a')]&&_0x24f775['query']['type']===_0xc008('0x4d')){_0x20947b['uniqueid']=_0x24f775[_0xc008('0x43')]['id'];}else{_0x20947b['id']=_0x24f775[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x45')]({'where':_0x20947b,'attributes':['id',_0xc008('0x4e')],'raw':!![]})[_0xc008('0x21')](handleEntityNotFound(_0xfd6d1d,null))['then'](function(_0x2ea742){if(_0x2ea742){var _0xbd7422=path[_0xc008('0x4f')](config[_0xc008('0x50')],_0xc008('0x51'),_0x2ea742['value']);var _0x41fae3=util['format']('%s.cypher',_0xbd7422);if(fs['existsSync'](_0x41fae3)){_0xd47b74=!![];return _0x51d3dc[_0xc008('0x52')](_0x41fae3,_0xbd7422,config[_0xc008('0x53')][_0xc008('0x54')])['then'](function(){return _0x2ea742;});}return _0x2ea742;}})[_0xc008('0x21')](function(_0x2d8361){if(_0x2d8361){var _0x3dda82=path['join'](config[_0xc008('0x50')],_0xc008('0x51'),_0x2d8361[_0xc008('0x4e')]);if(!fs[_0xc008('0x55')](_0x3dda82)){throw new db['Sequelize'][(_0xc008('0x56'))]('ScreenRecording\x20not\x20found');}if(_0x2d8361[_0xc008('0x57')]){return _0xfd6d1d[_0xc008('0x58')](_0x3dda82,_0x2d8361[_0xc008('0x57')]+path[_0xc008('0x59')](_0x3dda82),function(){if(_0xd47b74){fs[_0xc008('0x5a')](_0x3dda82);}});}else{return _0xfd6d1d[_0xc008('0x58')](_0x3dda82,function(_0x4818c7){if(_0xd47b74){fs[_0xc008('0x5a')](_0x3dda82);}});}}})['catch'](function(_0x5bf4a9){if(_0x5bf4a9[_0xc008('0x5b')]===_0xc008('0x5c')){_0xfd6d1d['status'](0x194)[_0xc008('0x24')](_0xc008('0x5d'));}else{return handleError(_0xfd6d1d,null);}});};exports[_0xc008('0x22')]=function(_0x4517c0,_0x21ee6d){return db[_0xc008('0x26')][_0xc008('0x45')]({'where':{'id':_0x4517c0['params']['id']}})[_0xc008('0x21')](function(_0x462e1e){if(_[_0xc008('0x5e')](_0x462e1e)){throw new ReferenceError(_0xc008('0x5f'));}return _0x462e1e;})[_0xc008('0x21')](function(_0x167425){var _0x249898=path[_0xc008('0x4f')](config[_0xc008('0x50')],_0xc008('0x51'),_0x167425[_0xc008('0x4e')]);logger[_0xc008('0x60')](_0xc008('0x61'),_0x249898);if(!_[_0xc008('0x5e')](_0x167425['value'])&&fs[_0xc008('0x55')](_0x249898)){logger[_0xc008('0x60')](_0xc008('0x62')+_0x249898+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc008('0x63')](_0x249898);}_0x249898=_0x249898+_0xc008('0x64');if(!_['isNil'](_0x167425['value'])&&fs[_0xc008('0x55')](_0x249898)){logger[_0xc008('0x60')](_0xc008('0x62')+_0x249898+_0xc008('0x65'));fs[_0xc008('0x63')](_0x249898);}return _0x167425;})[_0xc008('0x21')](function(_0x238852){if(!_0x238852)throw new InternalError();return _0x238852[_0xc008('0x22')]();})[_0xc008('0x21')](function(){_0x21ee6d[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();})['catch'](handleError(_0x21ee6d,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 6c38a3e..7093a03 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 _0x0fde=['ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise','rimraf','./screenRecording.attributes','exports','define'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x0fde,0x162));var _0xe0fd=function(_0x512eb0,_0x5e8fed){_0x512eb0=_0x512eb0-0x0;var _0x2fd328=_0x0fde[_0x512eb0];return _0x2fd328;};'use strict';var _=require(_0xe0fd('0x0'));var util=require(_0xe0fd('0x1'));var logger=require('../../config/logger')(_0xe0fd('0x2'));var moment=require(_0xe0fd('0x3'));var BPromise=require(_0xe0fd('0x4'));var rp=require(_0xe0fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0fd('0x6'));var config=require('../../config/environment');var attributes=require(_0xe0fd('0x7'));module[_0xe0fd('0x8')]=function(_0x449286,_0x376847){return _0x449286[_0xe0fd('0x9')](_0xe0fd('0xa'),attributes,{'tableName':_0xe0fd('0xb'),'paranoid':![],'indexes':[{'name':_0xe0fd('0xc'),'fields':[_0xe0fd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe447=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','interactionid','lodash','util'];(function(_0x399a7b,_0x2f7543){var _0x10d73a=function(_0x117540){while(--_0x117540){_0x399a7b['push'](_0x399a7b['shift']());}};_0x10d73a(++_0x2f7543);}(_0xe447,0x140));var _0x7e44=function(_0x49579b,_0x528f4e){_0x49579b=_0x49579b-0x0;var _0x1a2d45=_0xe447[_0x49579b];return _0x1a2d45;};'use strict';var _=require(_0x7e44('0x0'));var util=require(_0x7e44('0x1'));var logger=require(_0x7e44('0x2'))(_0x7e44('0x3'));var moment=require(_0x7e44('0x4'));var BPromise=require(_0x7e44('0x5'));var rp=require(_0x7e44('0x6'));var fs=require('fs');var path=require(_0x7e44('0x7'));var rimraf=require(_0x7e44('0x8'));var config=require(_0x7e44('0x9'));var attributes=require(_0x7e44('0xa'));module[_0x7e44('0xb')]=function(_0xff3403,_0x2f5651){return _0xff3403[_0x7e44('0xc')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x7e44('0xd'),'fields':[_0x7e44('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 46222a6..2d45523 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 _0xeaa7=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x4ebbf0,_0x3336de){var _0x578b39=function(_0x13bf73){while(--_0x13bf73){_0x4ebbf0['push'](_0x4ebbf0['shift']());}};_0x578b39(++_0x3336de);}(_0xeaa7,0x98));var _0x7eaa=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xeaa7[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x7eaa('0x0'));var util=require('util');var moment=require(_0x7eaa('0x1'));var BPromise=require(_0x7eaa('0x2'));var rs=require(_0x7eaa('0x3'));var fs=require('fs');var Redis=require(_0x7eaa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7eaa('0x5'));var logger=require('../../config/logger')(_0x7eaa('0x6'));var config=require(_0x7eaa('0x7'));var jayson=require(_0x7eaa('0x8'));var client=jayson[_0x7eaa('0x9')][_0x7eaa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa22d86,_0x4ac50f,_0x227566){return new BPromise(function(_0x5f4599,_0x358eb6){return client[_0x7eaa('0xb')](_0xa22d86,_0x227566)[_0x7eaa('0xc')](function(_0x234820){logger['info'](_0x7eaa('0xd'),_0x4ac50f,_0x7eaa('0xe'));logger[_0x7eaa('0xf')](_0x7eaa('0x10'),_0x4ac50f,'request\x20sent',JSON[_0x7eaa('0x11')](_0x234820));if(_0x234820[_0x7eaa('0x12')]){if(_0x234820[_0x7eaa('0x12')]['code']===0x1f4){logger[_0x7eaa('0x12')](_0x7eaa('0xd'),_0x4ac50f,_0x234820[_0x7eaa('0x12')][_0x7eaa('0x13')]);return _0x358eb6(_0x234820[_0x7eaa('0x12')][_0x7eaa('0x13')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4ac50f,_0x234820[_0x7eaa('0x12')]['message']);return _0x5f4599(_0x234820[_0x7eaa('0x12')]['message']);}else{logger['info'](_0x7eaa('0xd'),_0x4ac50f,_0x7eaa('0xe'));_0x5f4599(_0x234820[_0x7eaa('0x14')][_0x7eaa('0x13')]);}})[_0x7eaa('0x15')](function(_0x28f261){logger['error'](_0x7eaa('0xd'),_0x4ac50f,_0x28f261);_0x358eb6(_0x28f261);});});} \ No newline at end of file +var _0x2682=['error','code','ScreenRecording,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','debug','request\x20sent','stringify'];(function(_0x3e261c,_0x38299d){var _0x1c232c=function(_0x406e59){while(--_0x406e59){_0x3e261c['push'](_0x3e261c['shift']());}};_0x1c232c(++_0x38299d);}(_0x2682,0x1cd));var _0x2268=function(_0x1945db,_0x51245d){_0x1945db=_0x1945db-0x0;var _0x397be3=_0x2682[_0x1945db];return _0x397be3;};'use strict';var _=require(_0x2268('0x0'));var util=require(_0x2268('0x1'));var moment=require('moment');var BPromise=require(_0x2268('0x2'));var rs=require(_0x2268('0x3'));var fs=require('fs');var Redis=require(_0x2268('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2268('0x5'));var logger=require(_0x2268('0x6'))('rpc');var config=require(_0x2268('0x7'));var jayson=require(_0x2268('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33699d,_0x2a05c1,_0x1e7442){return new BPromise(function(_0x315b94,_0x37b0e7){return client[_0x2268('0x9')](_0x33699d,_0x1e7442)['then'](function(_0x477d4f){logger[_0x2268('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x2a05c1,'request\x20sent');logger[_0x2268('0xb')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2a05c1,_0x2268('0xc'),JSON[_0x2268('0xd')](_0x477d4f));if(_0x477d4f[_0x2268('0xe')]){if(_0x477d4f[_0x2268('0xe')][_0x2268('0xf')]===0x1f4){logger['error'](_0x2268('0x10'),_0x2a05c1,_0x477d4f[_0x2268('0xe')][_0x2268('0x11')]);return _0x37b0e7(_0x477d4f[_0x2268('0xe')]['message']);}logger[_0x2268('0xe')](_0x2268('0x10'),_0x2a05c1,_0x477d4f[_0x2268('0xe')]['message']);return _0x315b94(_0x477d4f[_0x2268('0xe')]['message']);}else{logger[_0x2268('0xa')](_0x2268('0x10'),_0x2a05c1,_0x2268('0xc'));_0x315b94(_0x477d4f['result'][_0x2268('0x11')]);}})[_0x2268('0x12')](function(_0x3434aa){logger['error'](_0x2268('0x10'),_0x2a05c1,_0x3434aa);_0x37b0e7(_0x3434aa);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 302fa2b..1e1eb4d 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 _0xaa3d=['index','getDate','show','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','/:id/logo','single','file','addLogo','format','logologin','originalname','post','addLogoLogin','preferred','addPreferred','put','/:id','update','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated'];(function(_0x2d85a5,_0x26861c){var _0x27d75b=function(_0x46c938){while(--_0x46c938){_0x2d85a5['push'](_0x2d85a5['shift']());}};_0x27d75b(++_0x26861c);}(_0xaa3d,0xcc));var _0xdaa3=function(_0x4e6fbc,_0x5c95ec){_0x4e6fbc=_0x4e6fbc-0x0;var _0xd44dc1=_0xaa3d[_0x4e6fbc];return _0xd44dc1;};'use strict';var multer=require('multer');var util=require(_0xdaa3('0x0'));var path=require(_0xdaa3('0x1'));var timeout=require(_0xdaa3('0x2'));var express=require(_0xdaa3('0x3'));var router=express[_0xdaa3('0x4')]();var fs_extra=require(_0xdaa3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdaa3('0x6'));var config=require(_0xdaa3('0x7'));var controller=require(_0xdaa3('0x8'));router[_0xdaa3('0x9')]('/',auth[_0xdaa3('0xa')](),controller[_0xdaa3('0xb')]);router['get']('/now',controller[_0xdaa3('0xc')]);router[_0xdaa3('0x9')]('/:id',controller[_0xdaa3('0xd')]);router['get']('/:id/logo',controller[_0xdaa3('0xe')]);router['get'](_0xdaa3('0xf'),controller['getLogoLogin']);router[_0xdaa3('0x9')](_0xdaa3('0x10'),controller[_0xdaa3('0x11')]);router['get'](_0xdaa3('0x12'),controller[_0xdaa3('0x13')]);router[_0xdaa3('0x9')](_0xdaa3('0x14'),controller[_0xdaa3('0x15')]);var upload=multer({'storage':multer[_0xdaa3('0x16')]({'destination':function(_0x184666,_0x56f6c9,_0x148c0b){_0x148c0b(null,path[_0xdaa3('0x17')](config[_0xdaa3('0x18')],_0xdaa3('0x19')));},'filename':function(_0x339cd3,_0x28a48c,_0x316600){_0x316600(null,util['format'](_0xdaa3('0x1a'),_0xdaa3('0x1b'),path[_0xdaa3('0x1c')](_0x28a48c['originalname'])));}})});router['post'](_0xdaa3('0x1d'),upload[_0xdaa3('0x1e')](_0xdaa3('0x1f')),controller[_0xdaa3('0x20')]);var upload=multer({'storage':multer[_0xdaa3('0x16')]({'destination':function(_0x5832b2,_0xf6df41,_0x25b6de){_0x25b6de(null,path['join'](config[_0xdaa3('0x18')],'server/files/images/logos/'));},'filename':function(_0x23cf8d,_0x1e6805,_0x4afe0f){_0x4afe0f(null,util[_0xdaa3('0x21')](_0xdaa3('0x1a'),_0xdaa3('0x22'),path[_0xdaa3('0x1c')](_0x1e6805[_0xdaa3('0x23')])));}})});router[_0xdaa3('0x24')](_0xdaa3('0xf'),upload[_0xdaa3('0x1e')]('file'),controller[_0xdaa3('0x25')]);var upload=multer({'storage':multer[_0xdaa3('0x16')]({'destination':function(_0x12b6d4,_0x4afbf8,_0xa98f78){_0xa98f78(null,path[_0xdaa3('0x17')](config[_0xdaa3('0x18')],_0xdaa3('0x19')));},'filename':function(_0x40bf03,_0x378b6a,_0x46606b){_0x46606b(null,util['format'](_0xdaa3('0x1a'),_0xdaa3('0x26'),path[_0xdaa3('0x1c')](_0x378b6a['originalname'])));}})});router['post'](_0xdaa3('0x12'),upload['single']('file'),controller[_0xdaa3('0x27')]);var upload=multer({'storage':multer[_0xdaa3('0x16')]({'destination':function(_0x985565,_0x3143ba,_0x311e80){_0x311e80(null,path[_0xdaa3('0x17')](config[_0xdaa3('0x18')],_0xdaa3('0x19')));},'filename':function(_0x2b932b,_0x30d4b3,_0x5fa894){_0x5fa894(null,util[_0xdaa3('0x21')]('%s%s','favicon',path['extname'](_0x30d4b3['originalname'])));}})});router[_0xdaa3('0x24')](_0xdaa3('0x14'),upload[_0xdaa3('0x1e')]('file'),controller['addFavicon']);router[_0xdaa3('0x28')](_0xdaa3('0x29'),auth[_0xdaa3('0xa')](),controller[_0xdaa3('0x2a')]);module['exports']=router; \ No newline at end of file +var _0xb27f=['./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','%s%s','logo','extname','originalname','post','addLogo','join','server/files/images/logos/','format','single','addLogoLogin','file','addPreferred','favicon','addFavicon','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4beb08,_0x38a1e4){var _0x56a591=function(_0x26d077){while(--_0x26d077){_0x4beb08['push'](_0x4beb08['shift']());}};_0x56a591(++_0x38a1e4);}(_0xb27f,0xdd));var _0xfb27=function(_0x2b99e5,_0xf965b0){_0x2b99e5=_0x2b99e5-0x0;var _0x19e344=_0xb27f[_0x2b99e5];return _0x19e344;};'use strict';var multer=require(_0xfb27('0x0'));var util=require(_0xfb27('0x1'));var path=require(_0xfb27('0x2'));var timeout=require(_0xfb27('0x3'));var express=require(_0xfb27('0x4'));var router=express[_0xfb27('0x5')]();var fs_extra=require(_0xfb27('0x6'));var auth=require(_0xfb27('0x7'));var interaction=require(_0xfb27('0x8'));var config=require('../../config/environment');var controller=require(_0xfb27('0x9'));router['get']('/',auth[_0xfb27('0xa')](),controller[_0xfb27('0xb')]);router[_0xfb27('0xc')](_0xfb27('0xd'),controller[_0xfb27('0xe')]);router[_0xfb27('0xc')](_0xfb27('0xf'),controller[_0xfb27('0x10')]);router['get'](_0xfb27('0x11'),controller[_0xfb27('0x12')]);router[_0xfb27('0xc')](_0xfb27('0x13'),controller[_0xfb27('0x14')]);router[_0xfb27('0xc')](_0xfb27('0x15'),controller[_0xfb27('0x16')]);router[_0xfb27('0xc')](_0xfb27('0x17'),controller[_0xfb27('0x18')]);router['get'](_0xfb27('0x19'),controller[_0xfb27('0x1a')]);var upload=multer({'storage':multer[_0xfb27('0x1b')]({'destination':function(_0x1ef66a,_0x51dec5,_0x4782ea){_0x4782ea(null,path['join'](config[_0xfb27('0x1c')],'server/files/images/logos/'));},'filename':function(_0x317108,_0x575224,_0x3f8359){_0x3f8359(null,util['format'](_0xfb27('0x1d'),_0xfb27('0x1e'),path[_0xfb27('0x1f')](_0x575224[_0xfb27('0x20')])));}})});router[_0xfb27('0x21')]('/:id/logo',upload['single']('file'),controller[_0xfb27('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4a8716,_0xe3b6e4,_0x2e5b7d){_0x2e5b7d(null,path[_0xfb27('0x23')](config[_0xfb27('0x1c')],_0xfb27('0x24')));},'filename':function(_0x62c5e9,_0x26ad99,_0x3636c9){_0x3636c9(null,util[_0xfb27('0x25')](_0xfb27('0x1d'),'logologin',path['extname'](_0x26ad99[_0xfb27('0x20')])));}})});router['post'](_0xfb27('0x13'),upload[_0xfb27('0x26')]('file'),controller[_0xfb27('0x27')]);var upload=multer({'storage':multer[_0xfb27('0x1b')]({'destination':function(_0x1efbeb,_0x47077e,_0x358c18){_0x358c18(null,path[_0xfb27('0x23')](config[_0xfb27('0x1c')],'server/files/images/logos/'));},'filename':function(_0x224b72,_0x560e95,_0x573420){_0x573420(null,util[_0xfb27('0x25')](_0xfb27('0x1d'),'preferred',path[_0xfb27('0x1f')](_0x560e95[_0xfb27('0x20')])));}})});router[_0xfb27('0x21')]('/:id/preferred',upload[_0xfb27('0x26')](_0xfb27('0x28')),controller[_0xfb27('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45cc9e,_0x293ac3,_0x3a08ba){_0x3a08ba(null,path[_0xfb27('0x23')](config[_0xfb27('0x1c')],_0xfb27('0x24')));},'filename':function(_0x6041c7,_0x57b836,_0x2381b4){_0x2381b4(null,util[_0xfb27('0x25')](_0xfb27('0x1d'),_0xfb27('0x2a'),path['extname'](_0x57b836[_0xfb27('0x20')])));}})});router[_0xfb27('0x21')](_0xfb27('0x19'),upload['single']('file'),controller[_0xfb27('0x2b')]);router[_0xfb27('0x2c')](_0xfb27('0xf'),auth[_0xfb27('0xa')](),controller[_0xfb27('0x2d')]);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 4fb9a8e..98802c4 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(_0x481d57,_0x259636){var _0x36c8a6=function(_0x5bddbe){while(--_0x5bddbe){_0x481d57['push'](_0x481d57['shift']());}};_0x36c8a6(++_0x259636);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x41ed31,_0xef7ab5){var _0xcf9179=function(_0x8e26df){while(--_0x8e26df){_0x41ed31['push'](_0x41ed31['shift']());}};_0xcf9179(++_0xef7ab5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 35ddf1f..7f61c9c 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 _0x819c=['format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','end','name','index','map','Setting','rawAttributes','type','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','body','find','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','download','gdpr','securePassword','getPreferred','defaultLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x819c,0x168));var _0xc819=function(_0x209ebf,_0x1e7821){_0x209ebf=_0x209ebf-0x0;var _0x484631=_0x819c[_0x209ebf];return _0x484631;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc819('0x0'));var zipdir=require(_0xc819('0x1'));var jsonpatch=require(_0xc819('0x2'));var rp=require(_0xc819('0x3'));var moment=require(_0xc819('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc819('0x5'));var util=require(_0xc819('0x6'));var path=require(_0xc819('0x7'));var sox=require('sox');var csv=require(_0xc819('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc819('0x9'));var _=require(_0xc819('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc819('0xb'));var deskjs=require(_0xc819('0xc'));var toCsv=require(_0xc819('0x8'));var querystring=require(_0xc819('0xd'));var Papa=require(_0xc819('0xe'));var Redis=require('ioredis');var authService=require(_0xc819('0xf'));var qs=require(_0xc819('0x10'));var as=require(_0xc819('0x11'));var hardwareService=require(_0xc819('0x12'));var logger=require(_0xc819('0x13'))(_0xc819('0x14'));var utils=require(_0xc819('0x15'));var config=require(_0xc819('0x16'));var licenseUtil=require(_0xc819('0x17'));var db=require(_0xc819('0x18'))['db'];var jayson=require(_0xc819('0x19'));var client=jayson[_0xc819('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bc6a7,_0x4c2ecb,_0xeb49b8,_0x338c1b){return new BPromise(function(_0x400e5f,_0x17b0d5){var _0x29b327=_0x338c1b||client;return _0x29b327['request'](_0x5bc6a7,_0xeb49b8)[_0xc819('0x1b')](function(_0x2ddbe7){logger['info'](_0xc819('0x1c'),_0x4c2ecb,_0xc819('0x1d'));logger[_0xc819('0x1e')](_0xc819('0x1f'),_0x4c2ecb,_0xc819('0x1d'),JSON[_0xc819('0x20')](_0x2ddbe7));if(_0x2ddbe7[_0xc819('0x21')]){if(_0x2ddbe7[_0xc819('0x21')][_0xc819('0x22')]===0x1f4){logger[_0xc819('0x21')](_0xc819('0x1c'),_0x4c2ecb,_0x2ddbe7[_0xc819('0x21')][_0xc819('0x23')]);return _0x17b0d5(_0x2ddbe7[_0xc819('0x21')]['message']);}logger['error'](_0xc819('0x1c'),_0x4c2ecb,_0x2ddbe7[_0xc819('0x21')]['message']);return _0x400e5f(_0x2ddbe7[_0xc819('0x21')][_0xc819('0x23')]);}else{logger['info'](_0xc819('0x1c'),_0x4c2ecb,_0xc819('0x1d'));_0x400e5f(_0x2ddbe7[_0xc819('0x24')][_0xc819('0x23')]);}})['catch'](function(_0x4a149e){logger[_0xc819('0x21')]('Setting,\x20%s,\x20%s',_0x4c2ecb,_0x4a149e);_0x17b0d5(_0x4a149e);});});}function respondWithStatusCode(_0x2b4c93,_0x202a95){_0x202a95=_0x202a95||0xcc;return function(_0x6851e2){if(_0x6851e2){return _0x2b4c93[_0xc819('0x25')](_0x202a95);}return _0x2b4c93[_0xc819('0x26')](_0x202a95)['end']();};}function respondWithResult(_0x1e0d32,_0x38ee2b){_0x38ee2b=_0x38ee2b||0xc8;return function(_0x36089b){if(_0x36089b){return _0x1e0d32[_0xc819('0x26')](_0x38ee2b)[_0xc819('0x27')](_0x36089b);}};}function respondWithFilteredResult(_0x4a1f3e,_0x19cc79){return function(_0x3acb0e){if(_0x3acb0e){var _0x318184=typeof _0x19cc79[_0xc819('0x28')]===_0xc819('0x29')&&typeof _0x19cc79['limit']==='undefined';var _0x4662de=_0x3acb0e[_0xc819('0x2a')];var _0x26c3d7=_0x318184?0x0:_0x19cc79[_0xc819('0x28')];var _0x32f6f8=_0x318184?_0x3acb0e[_0xc819('0x2a')]:_0x19cc79[_0xc819('0x28')]+_0x19cc79[_0xc819('0x2b')];var _0x5e69bc;if(_0x32f6f8>=_0x4662de){_0x32f6f8=_0x4662de;_0x5e69bc=0xc8;}else{_0x5e69bc=0xce;}_0x4a1f3e[_0xc819('0x26')](_0x5e69bc);return _0x4a1f3e[_0xc819('0x2c')](_0xc819('0x2d'),_0x26c3d7+'-'+_0x32f6f8+'/'+_0x4662de)[_0xc819('0x27')](_0x3acb0e);}return null;};}function patchUpdates(_0x2d87a3){return function(_0x340dc3){try{jsonpatch['apply'](_0x340dc3,_0x2d87a3,!![]);}catch(_0x8438b9){return BPromise[_0xc819('0x2e')](_0x8438b9);}return _0x340dc3[_0xc819('0x2f')]();};}function saveUpdates(_0x2db743,_0x499187){return function(_0x594577){if(_0x594577){return _0x594577[_0xc819('0x30')](_0x2db743)['then'](function(_0x1eca0c){return _0x1eca0c;});}return null;};}function removeEntity(_0x4e83e2,_0x24beb1){return function(_0x1b2661){if(_0x1b2661){return _0x1b2661['destroy']()[_0xc819('0x1b')](function(){_0x4e83e2[_0xc819('0x26')](0xcc)[_0xc819('0x31')]();});}};}function handleEntityNotFound(_0x323b5b,_0x402175){return function(_0x56552f){if(!_0x56552f){_0x323b5b['sendStatus'](0x194);}return _0x56552f;};}function handleError(_0x5ddaec,_0x529efc){_0x529efc=_0x529efc||0x1f4;return function(_0x43e50b){logger['error'](_0x43e50b['stack']);if(_0x43e50b['name']){delete _0x43e50b[_0xc819('0x32')];}_0x5ddaec['status'](_0x529efc)['send'](_0x43e50b);};}exports[_0xc819('0x33')]=function(_0x17e39,_0x437095){var _0x5a619b={},_0x4081cf={},_0xc6117e={'count':0x0,'rows':[]};var _0x663127=_[_0xc819('0x34')](db[_0xc819('0x35')][_0xc819('0x36')],function(_0x5b09f7){return{'name':_0x5b09f7['fieldName'],'type':_0x5b09f7[_0xc819('0x37')]['key']};});_0x4081cf[_0xc819('0x38')]=_[_0xc819('0x34')](_0x663127,'name');_0x4081cf[_0xc819('0x39')]=_['keys'](_0x17e39[_0xc819('0x39')]);_0x4081cf['filters']=_['intersection'](_0x4081cf[_0xc819('0x38')],_0x4081cf[_0xc819('0x39')]);_0x5a619b[_0xc819('0x3a')]=_[_0xc819('0x3b')](_0x4081cf[_0xc819('0x38')],qs[_0xc819('0x3c')](_0x17e39['query']['fields']));_0x5a619b[_0xc819('0x3a')]=_0x5a619b[_0xc819('0x3a')][_0xc819('0x3d')]?_0x5a619b[_0xc819('0x3a')]:_0x4081cf[_0xc819('0x38')];if(!_0x17e39['query'][_0xc819('0x3e')]('nolimit')){_0x5a619b['limit']=qs[_0xc819('0x2b')](_0x17e39['query'][_0xc819('0x2b')]);_0x5a619b[_0xc819('0x28')]=qs[_0xc819('0x28')](_0x17e39[_0xc819('0x39')][_0xc819('0x28')]);}_0x5a619b['order']=qs[_0xc819('0x3f')](_0x17e39[_0xc819('0x39')][_0xc819('0x3f')]);_0x5a619b[_0xc819('0x40')]=qs[_0xc819('0x41')](_['pick'](_0x17e39[_0xc819('0x39')],_0x4081cf['filters']),_0x663127);if(_0x17e39[_0xc819('0x39')]['filter']){_0x5a619b['where']=_[_0xc819('0x42')](_0x5a619b['where'],{'$or':_[_0xc819('0x34')](_0x663127,function(_0x2b1b41){if(_0x2b1b41[_0xc819('0x37')]!==_0xc819('0x43')){var _0x4ac59d={};_0x4ac59d[_0x2b1b41[_0xc819('0x32')]]={'$like':'%'+_0x17e39[_0xc819('0x39')]['filter']+'%'};return _0x4ac59d;}})});}_0x5a619b=_[_0xc819('0x42')]({},_0x5a619b,_0x17e39[_0xc819('0x44')]);var _0x44aad8={'where':_0x5a619b[_0xc819('0x40')]};return db['Setting'][_0xc819('0x2a')](_0x44aad8)['then'](function(_0x8aee1a){_0xc6117e[_0xc819('0x2a')]=_0x8aee1a;if(_0x17e39['query'][_0xc819('0x45')]){_0x5a619b[_0xc819('0x46')]=[{'all':!![]}];}return db[_0xc819('0x35')][_0xc819('0x47')](_0x5a619b);})[_0xc819('0x1b')](function(_0x395862){_0xc6117e[_0xc819('0x48')]=_0x395862;return _0xc6117e;})[_0xc819('0x1b')](respondWithFilteredResult(_0x437095,_0x5a619b))['catch'](handleError(_0x437095,null));};exports[_0xc819('0x49')]=function(_0x4beaba,_0x4fdac1){var _0xf56a27={'raw':![],'where':{'id':_0x4beaba[_0xc819('0x4a')]['id']}},_0xb44ac8={};_0xb44ac8[_0xc819('0x38')]=_[_0xc819('0x4b')](db['Setting']['rawAttributes']);_0xb44ac8[_0xc819('0x39')]=_[_0xc819('0x4b')](_0x4beaba[_0xc819('0x39')]);_0xb44ac8[_0xc819('0x41')]=_[_0xc819('0x3b')](_0xb44ac8[_0xc819('0x38')],_0xb44ac8['query']);_0xf56a27['attributes']=_[_0xc819('0x3b')](_0xb44ac8['model'],qs[_0xc819('0x3c')](_0x4beaba['query'][_0xc819('0x3c')]));_0xf56a27[_0xc819('0x3a')]=_0xf56a27[_0xc819('0x3a')][_0xc819('0x3d')]?_0xf56a27[_0xc819('0x3a')]:_0xb44ac8[_0xc819('0x38')];if(_0x4beaba['query'][_0xc819('0x45')]){_0xf56a27[_0xc819('0x46')]=[{'all':!![]}];}_0xf56a27=_[_0xc819('0x42')]({},_0xf56a27,_0x4beaba[_0xc819('0x44')]);return db['Setting']['find'](_0xf56a27)[_0xc819('0x1b')](handleEntityNotFound(_0x4fdac1,null))[_0xc819('0x1b')](respondWithResult(_0x4fdac1,null))[_0xc819('0x4c')](handleError(_0x4fdac1,null));};exports['update']=function(_0x1ee67d,_0x2cf93c){if(_0x1ee67d[_0xc819('0x4d')]['id']){delete _0x1ee67d[_0xc819('0x4d')]['id'];}return db[_0xc819('0x35')][_0xc819('0x4e')]({'where':{'id':_0x1ee67d[_0xc819('0x4a')]['id']}})[_0xc819('0x1b')](handleEntityNotFound(_0x2cf93c,null))[_0xc819('0x1b')](saveUpdates(_0x1ee67d[_0xc819('0x4d')],null))[_0xc819('0x1b')](respondWithResult(_0x2cf93c,null))[_0xc819('0x4c')](handleError(_0x2cf93c,null));};exports[_0xc819('0x4f')]=function(_0x2da986,_0xfcd667,_0x3a4095){if(_0x2da986[_0xc819('0x50')]&&_0x2da986['file']['filename']){_0x2da986[_0xc819('0x4d')]['logo']=_0x2da986[_0xc819('0x50')][_0xc819('0x51')];}return db['Setting'][_0xc819('0x4e')]({'where':{'id':_0x2da986[_0xc819('0x4a')]['id']}})['then'](handleEntityNotFound(_0xfcd667,null))[_0xc819('0x1b')](saveUpdates(_0x2da986[_0xc819('0x4d')],null))[_0xc819('0x1b')](respondWithResult(_0xfcd667,null))[_0xc819('0x4c')](handleError(_0xfcd667,null));};exports[_0xc819('0x52')]=function(_0x3ab160,_0x23b3ca,_0x1c5f2e){if(_0x3ab160[_0xc819('0x50')]&&_0x3ab160['file'][_0xc819('0x51')]){_0x3ab160[_0xc819('0x4d')][_0xc819('0x53')]=_0x3ab160[_0xc819('0x50')][_0xc819('0x51')];}return db['Setting'][_0xc819('0x4e')]({'where':{'id':_0x3ab160[_0xc819('0x4a')]['id']}})[_0xc819('0x1b')](handleEntityNotFound(_0x23b3ca,null))[_0xc819('0x1b')](saveUpdates(_0x3ab160[_0xc819('0x4d')],null))['then'](respondWithResult(_0x23b3ca,null))['catch'](handleError(_0x23b3ca,null));};var utilLicense=require('../../config/license/util');exports[_0xc819('0x54')]=function(_0xf94097,_0x4827f7,_0x5bb55d){var _0x31bc0e=_0xc819('0x55');var _0x2d80a8={'custom':![]};return utilLicense[_0xc819('0x56')]()[_0xc819('0x1b')](function(_0x272988){if(_0x272988){_0x2d80a8=_0x272988;}return db['Setting'][_0xc819('0x4e')]({'where':{'id':_0xf94097[_0xc819('0x4a')]['id']},'attributes':[_0xc819('0x57'),_0xc819('0x53'),_0xc819('0x58'),_0xc819('0x59'),'defaultLogo',_0xc819('0x5a'),_0xc819('0x5b'),_0xc819('0x5c')],'raw':!![]});})[_0xc819('0x1b')](handleEntityNotFound(_0x4827f7,null))[_0xc819('0x1b')](function(_0x190d6d){if(_0x190d6d){var _0x598933=_0x190d6d['logo']&&fs[_0xc819('0x5d')](path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x31bc0e,_[_0xc819('0x60')](_0x190d6d[_0xc819('0x57')])))?path['join'](config['root'],_0x31bc0e,_[_0xc819('0x60')](_0x190d6d[_0xc819('0x57')])):path['join'](config['root'],_0x31bc0e,_[_0xc819('0x60')]('default_logo.svg'));var _0x1c6e9b=_0xc819('0x61')+_[_0xc819('0x62')](_0xc819('0x57'));if(_0x190d6d[_0x1c6e9b]||!_0x2d80a8[_0xc819('0x63')]){_0x598933=path[_0xc819('0x5e')](config['root'],_0x31bc0e,_[_0xc819('0x60')]('default_logo.svg'));}if(!fs[_0xc819('0x5d')](_0x598933)){throw new db[(_0xc819('0x64'))][(_0xc819('0x65'))](_[_0xc819('0x62')]('logo')+_0xc819('0x66'));}return _0x4827f7['download'](_0x598933);}})[_0xc819('0x4c')](handleError(_0x4827f7,null));};var utilLicense=require(_0xc819('0x17'));exports[_0xc819('0x67')]=function(_0x15525a,_0x780b6d,_0x4bd5f0){var _0x23cfe9=_0xc819('0x55');var _0x5568cd={'custom':![]};return utilLicense[_0xc819('0x56')]()[_0xc819('0x1b')](function(_0x5b7b82){if(_0x5b7b82){_0x5568cd=_0x5b7b82;}return db[_0xc819('0x35')][_0xc819('0x4e')]({'where':{'id':_0x15525a[_0xc819('0x4a')]['id']},'attributes':[_0xc819('0x57'),_0xc819('0x53'),_0xc819('0x58'),'favicon','defaultLogo',_0xc819('0x5a'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xc819('0x1b')](handleEntityNotFound(_0x780b6d,null))['then'](function(_0x3f453d){if(_0x3f453d){var _0x5018c8=_0x3f453d[_0xc819('0x53')]&&fs[_0xc819('0x5d')](path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x23cfe9,_[_0xc819('0x60')](_0x3f453d[_0xc819('0x53')])))?path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x23cfe9,_[_0xc819('0x60')](_0x3f453d[_0xc819('0x53')])):path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x23cfe9,_[_0xc819('0x60')]('default_loginLogo.svg'));var _0x2ec5a4='default'+_['upperFirst'](_0xc819('0x53'));if(_0x3f453d[_0x2ec5a4]||!_0x5568cd[_0xc819('0x63')]){_0x5018c8=path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x23cfe9,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xc819('0x5d')](_0x5018c8)){throw new db[(_0xc819('0x64'))][(_0xc819('0x65'))](_[_0xc819('0x62')](_0xc819('0x53'))+_0xc819('0x66'));}return _0x780b6d[_0xc819('0x68')](_0x5018c8);}})[_0xc819('0x4c')](handleError(_0x780b6d,null));};exports[_0xc819('0x69')]=function(_0x4c369f,_0x272d80){return db[_0xc819('0x35')][_0xc819('0x4e')]({'where':{'id':_0x4c369f[_0xc819('0x4a')]['id']},'attributes':[_0xc819('0x6a')]})[_0xc819('0x1b')](respondWithResult(_0x272d80,null))[_0xc819('0x4c')](handleError(_0x272d80,null));};exports['addPreferred']=function(_0xd12dcd,_0x417a8f,_0x124a26){if(_0xd12dcd[_0xc819('0x50')]&&_0xd12dcd['file']['filename']){_0xd12dcd[_0xc819('0x4d')][_0xc819('0x58')]=_0xd12dcd['file'][_0xc819('0x51')];}return db[_0xc819('0x35')][_0xc819('0x4e')]({'where':{'id':_0xd12dcd[_0xc819('0x4a')]['id']}})[_0xc819('0x1b')](handleEntityNotFound(_0x417a8f,null))[_0xc819('0x1b')](saveUpdates(_0xd12dcd[_0xc819('0x4d')],null))[_0xc819('0x1b')](respondWithResult(_0x417a8f,null))[_0xc819('0x4c')](handleError(_0x417a8f,null));};var utilLicense=require(_0xc819('0x17'));exports[_0xc819('0x6b')]=function(_0x1d3e53,_0x597c7f,_0x1139c5){var _0x38f459=_0xc819('0x55');var _0x102cc1={'custom':![]};return utilLicense[_0xc819('0x56')]()['then'](function(_0x47d286){if(_0x47d286){_0x102cc1=_0x47d286;}return db[_0xc819('0x35')][_0xc819('0x4e')]({'where':{'id':_0x1d3e53[_0xc819('0x4a')]['id']},'attributes':[_0xc819('0x57'),_0xc819('0x53'),_0xc819('0x58'),_0xc819('0x59'),_0xc819('0x6c'),_0xc819('0x5a'),_0xc819('0x5b'),_0xc819('0x5c')],'raw':!![]});})[_0xc819('0x1b')](handleEntityNotFound(_0x597c7f,null))['then'](function(_0x5cf5bb){if(_0x5cf5bb){var _0x1db7f7=_0x5cf5bb[_0xc819('0x58')]&&fs[_0xc819('0x5d')](path[_0xc819('0x5e')](config['root'],_0x38f459,_[_0xc819('0x60')](_0x5cf5bb[_0xc819('0x58')])))?path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x38f459,_[_0xc819('0x60')](_0x5cf5bb[_0xc819('0x58')])):path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x38f459,_[_0xc819('0x60')](_0xc819('0x6d')));var _0xf9141f=_0xc819('0x61')+_[_0xc819('0x62')](_0xc819('0x58'));if(_0x5cf5bb[_0xf9141f]||!_0x102cc1['custom']||!_0x102cc1[_0xc819('0x58')]){_0x1db7f7=path[_0xc819('0x5e')](config['root'],_0x38f459,_['toLower'](_0xc819('0x6d')));}if(!fs[_0xc819('0x5d')](_0x1db7f7)){throw new db[(_0xc819('0x64'))][(_0xc819('0x65'))](_[_0xc819('0x62')](_0xc819('0x58'))+_0xc819('0x66'));}return _0x597c7f[_0xc819('0x68')](_0x1db7f7);}})[_0xc819('0x4c')](handleError(_0x597c7f,null));};exports[_0xc819('0x6e')]=function(_0x4661c5,_0x4a5a55,_0x23eb9){if(_0x4661c5['file']&&_0x4661c5[_0xc819('0x50')][_0xc819('0x51')]){_0x4661c5[_0xc819('0x4d')][_0xc819('0x59')]=_0x4661c5[_0xc819('0x50')][_0xc819('0x51')];}return db[_0xc819('0x35')][_0xc819('0x4e')]({'where':{'id':_0x4661c5['params']['id']}})[_0xc819('0x1b')](handleEntityNotFound(_0x4a5a55,null))[_0xc819('0x1b')](saveUpdates(_0x4661c5[_0xc819('0x4d')],null))[_0xc819('0x1b')](respondWithResult(_0x4a5a55,null))[_0xc819('0x4c')](handleError(_0x4a5a55,null));};var utilLicense=require(_0xc819('0x17'));exports[_0xc819('0x6f')]=function(_0x476040,_0x68252d,_0x4a1c97){var _0x1c9238='server/files/images/logos';var _0x4ed387={'custom':![]};return utilLicense[_0xc819('0x56')]()[_0xc819('0x1b')](function(_0x2080e6){if(_0x2080e6){_0x4ed387=_0x2080e6;}return db[_0xc819('0x35')][_0xc819('0x4e')]({'where':{'id':_0x476040[_0xc819('0x4a')]['id']},'attributes':['logo','loginLogo','preferred','favicon',_0xc819('0x6c'),_0xc819('0x5a'),_0xc819('0x5b'),_0xc819('0x5c')],'raw':!![]});})[_0xc819('0x1b')](handleEntityNotFound(_0x68252d,null))[_0xc819('0x1b')](function(_0x8995e5){if(_0x8995e5){var _0x4323a8=_0x8995e5[_0xc819('0x59')]&&fs[_0xc819('0x5d')](path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x1c9238,_[_0xc819('0x60')](_0x8995e5['favicon'])))?path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x1c9238,_[_0xc819('0x60')](_0x8995e5[_0xc819('0x59')])):path[_0xc819('0x5e')](config[_0xc819('0x5f')],_0x1c9238,_[_0xc819('0x60')](_0xc819('0x70')));var _0x5438b3=_0xc819('0x61')+_['upperFirst'](_0xc819('0x59'));if(_0x8995e5[_0x5438b3]||!_0x4ed387[_0xc819('0x63')]){_0x4323a8=path[_0xc819('0x5e')](config['root'],_0x1c9238,_[_0xc819('0x60')](_0xc819('0x70')));}if(!fs[_0xc819('0x5d')](_0x4323a8)){throw new db[(_0xc819('0x64'))][(_0xc819('0x65'))](_[_0xc819('0x62')](_0xc819('0x59'))+_0xc819('0x66'));}return _0x68252d['download'](_0x4323a8);}})[_0xc819('0x4c')](handleError(_0x68252d,null));};exports[_0xc819('0x71')]=function(_0x1b6892,_0x29c246){var _0x5c13d9={'offset':moment()[_0xc819('0x72')]()};_0x5c13d9[_0xc819('0x73')]=moment()['utcOffset'](_0x5c13d9[_0xc819('0x28')])[_0xc819('0x74')](_0xc819('0x75'));return _0x29c246[_0xc819('0x26')](0xc8)[_0xc819('0x76')](_0x5c13d9);}; \ No newline at end of file +var _0xf84a=['catch','sendStatus','status','end','limit','count','offset','Content-Range','json','apply','reject','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Setting','includeAll','include','findAll','rows','show','keys','find','update','body','params','addLogo','file','filename','addLogoLogin','getLicense','logo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','loginLogo','defaultLoginLogo','default','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','result','message'];(function(_0x428117,_0x28ebc3){var _0x12c89e=function(_0xb35635){while(--_0xb35635){_0x428117['push'](_0x428117['shift']());}};_0x12c89e(++_0x28ebc3);}(_0xf84a,0x1c7));var _0xaf84=function(_0x16a3f5,_0x362e94){_0x16a3f5=_0x16a3f5-0x0;var _0x137ae2=_0xf84a[_0x16a3f5];return _0x137ae2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf84('0x0'));var zipdir=require(_0xaf84('0x1'));var jsonpatch=require(_0xaf84('0x2'));var rp=require(_0xaf84('0x3'));var moment=require(_0xaf84('0x4'));var BPromise=require(_0xaf84('0x5'));var Mustache=require(_0xaf84('0x6'));var util=require('util');var path=require('path');var sox=require(_0xaf84('0x7'));var csv=require(_0xaf84('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf84('0x9'));var squel=require(_0xaf84('0xa'));var crypto=require(_0xaf84('0xb'));var jsforce=require(_0xaf84('0xc'));var deskjs=require(_0xaf84('0xd'));var toCsv=require(_0xaf84('0x8'));var querystring=require('querystring');var Papa=require(_0xaf84('0xe'));var Redis=require('ioredis');var authService=require(_0xaf84('0xf'));var qs=require(_0xaf84('0x10'));var as=require(_0xaf84('0x11'));var hardwareService=require(_0xaf84('0x12'));var logger=require(_0xaf84('0x13'))(_0xaf84('0x14'));var utils=require(_0xaf84('0x15'));var config=require(_0xaf84('0x16'));var licenseUtil=require(_0xaf84('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xaf84('0x18'));var client=jayson[_0xaf84('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484397,_0x2879ad,_0x593e4f,_0x58a74d){return new BPromise(function(_0x5783c9,_0x223f2c){var _0x5f4408=_0x58a74d||client;return _0x5f4408[_0xaf84('0x1a')](_0x484397,_0x593e4f)[_0xaf84('0x1b')](function(_0x3f77eb){logger[_0xaf84('0x1c')](_0xaf84('0x1d'),_0x2879ad,_0xaf84('0x1e'));logger[_0xaf84('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x2879ad,_0xaf84('0x1e'),JSON[_0xaf84('0x20')](_0x3f77eb));if(_0x3f77eb[_0xaf84('0x21')]){if(_0x3f77eb[_0xaf84('0x21')][_0xaf84('0x22')]===0x1f4){logger[_0xaf84('0x21')](_0xaf84('0x1d'),_0x2879ad,_0x3f77eb['error']['message']);return _0x223f2c(_0x3f77eb[_0xaf84('0x21')]['message']);}logger['error'](_0xaf84('0x1d'),_0x2879ad,_0x3f77eb['error']['message']);return _0x5783c9(_0x3f77eb[_0xaf84('0x21')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x2879ad,_0xaf84('0x1e'));_0x5783c9(_0x3f77eb[_0xaf84('0x23')][_0xaf84('0x24')]);}})[_0xaf84('0x25')](function(_0x540b99){logger['error'](_0xaf84('0x1d'),_0x2879ad,_0x540b99);_0x223f2c(_0x540b99);});});}function respondWithStatusCode(_0x1b67ac,_0x5c2894){_0x5c2894=_0x5c2894||0xcc;return function(_0x32e612){if(_0x32e612){return _0x1b67ac[_0xaf84('0x26')](_0x5c2894);}return _0x1b67ac[_0xaf84('0x27')](_0x5c2894)[_0xaf84('0x28')]();};}function respondWithResult(_0x4634bb,_0x5cdad1){_0x5cdad1=_0x5cdad1||0xc8;return function(_0x2b173c){if(_0x2b173c){return _0x4634bb[_0xaf84('0x27')](_0x5cdad1)['json'](_0x2b173c);}};}function respondWithFilteredResult(_0x1f8d47,_0x58b8c9){return function(_0x46b26d){if(_0x46b26d){var _0x9de7ef=typeof _0x58b8c9['offset']==='undefined'&&typeof _0x58b8c9[_0xaf84('0x29')]==='undefined';var _0x125590=_0x46b26d[_0xaf84('0x2a')];var _0x38fe68=_0x9de7ef?0x0:_0x58b8c9[_0xaf84('0x2b')];var _0x380549=_0x9de7ef?_0x46b26d[_0xaf84('0x2a')]:_0x58b8c9['offset']+_0x58b8c9['limit'];var _0x2273b5;if(_0x380549>=_0x125590){_0x380549=_0x125590;_0x2273b5=0xc8;}else{_0x2273b5=0xce;}_0x1f8d47[_0xaf84('0x27')](_0x2273b5);return _0x1f8d47['set'](_0xaf84('0x2c'),_0x38fe68+'-'+_0x380549+'/'+_0x125590)[_0xaf84('0x2d')](_0x46b26d);}return null;};}function patchUpdates(_0x2802ee){return function(_0x4c7e1e){try{jsonpatch[_0xaf84('0x2e')](_0x4c7e1e,_0x2802ee,!![]);}catch(_0x13055a){return BPromise[_0xaf84('0x2f')](_0x13055a);}return _0x4c7e1e['save']();};}function saveUpdates(_0x2554b4,_0x1e302e){return function(_0xcc1032){if(_0xcc1032){return _0xcc1032['update'](_0x2554b4)[_0xaf84('0x1b')](function(_0x344cca){return _0x344cca;});}return null;};}function removeEntity(_0x382a5e,_0x145ce3){return function(_0x343fe8){if(_0x343fe8){return _0x343fe8['destroy']()[_0xaf84('0x1b')](function(){_0x382a5e[_0xaf84('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e6147,_0x5607fd){return function(_0x5cebc9){if(!_0x5cebc9){_0x5e6147[_0xaf84('0x26')](0x194);}return _0x5cebc9;};}function handleError(_0x5dbc43,_0x5592e4){_0x5592e4=_0x5592e4||0x1f4;return function(_0x4dd023){logger[_0xaf84('0x21')](_0x4dd023[_0xaf84('0x30')]);if(_0x4dd023[_0xaf84('0x31')]){delete _0x4dd023[_0xaf84('0x31')];}_0x5dbc43['status'](_0x5592e4)[_0xaf84('0x32')](_0x4dd023);};}exports[_0xaf84('0x33')]=function(_0x4b6ba1,_0x56f013){var _0x18ac16={},_0x3e7989={},_0x43c1a3={'count':0x0,'rows':[]};var _0xebc0d8=_['map'](db['Setting'][_0xaf84('0x34')],function(_0x55e6c2){return{'name':_0x55e6c2['fieldName'],'type':_0x55e6c2[_0xaf84('0x35')][_0xaf84('0x36')]};});_0x3e7989[_0xaf84('0x37')]=_[_0xaf84('0x38')](_0xebc0d8,'name');_0x3e7989[_0xaf84('0x39')]=_['keys'](_0x4b6ba1[_0xaf84('0x39')]);_0x3e7989[_0xaf84('0x3a')]=_[_0xaf84('0x3b')](_0x3e7989[_0xaf84('0x37')],_0x3e7989[_0xaf84('0x39')]);_0x18ac16[_0xaf84('0x3c')]=_[_0xaf84('0x3b')](_0x3e7989['model'],qs[_0xaf84('0x3d')](_0x4b6ba1['query'][_0xaf84('0x3d')]));_0x18ac16[_0xaf84('0x3c')]=_0x18ac16[_0xaf84('0x3c')][_0xaf84('0x3e')]?_0x18ac16['attributes']:_0x3e7989[_0xaf84('0x37')];if(!_0x4b6ba1['query']['hasOwnProperty'](_0xaf84('0x3f'))){_0x18ac16[_0xaf84('0x29')]=qs[_0xaf84('0x29')](_0x4b6ba1[_0xaf84('0x39')]['limit']);_0x18ac16[_0xaf84('0x2b')]=qs['offset'](_0x4b6ba1[_0xaf84('0x39')][_0xaf84('0x2b')]);}_0x18ac16[_0xaf84('0x40')]=qs[_0xaf84('0x41')](_0x4b6ba1[_0xaf84('0x39')]['sort']);_0x18ac16['where']=qs[_0xaf84('0x3a')](_['pick'](_0x4b6ba1['query'],_0x3e7989[_0xaf84('0x3a')]),_0xebc0d8);if(_0x4b6ba1[_0xaf84('0x39')]['filter']){_0x18ac16[_0xaf84('0x42')]=_[_0xaf84('0x43')](_0x18ac16[_0xaf84('0x42')],{'$or':_[_0xaf84('0x38')](_0xebc0d8,function(_0x1198d6){if(_0x1198d6['type']!==_0xaf84('0x44')){var _0x77708={};_0x77708[_0x1198d6[_0xaf84('0x31')]]={'$like':'%'+_0x4b6ba1['query'][_0xaf84('0x45')]+'%'};return _0x77708;}})});}_0x18ac16=_['merge']({},_0x18ac16,_0x4b6ba1[_0xaf84('0x46')]);var _0x32ecbb={'where':_0x18ac16[_0xaf84('0x42')]};return db[_0xaf84('0x47')]['count'](_0x32ecbb)[_0xaf84('0x1b')](function(_0x885e0){_0x43c1a3[_0xaf84('0x2a')]=_0x885e0;if(_0x4b6ba1[_0xaf84('0x39')][_0xaf84('0x48')]){_0x18ac16[_0xaf84('0x49')]=[{'all':!![]}];}return db['Setting'][_0xaf84('0x4a')](_0x18ac16);})['then'](function(_0x3d07a3){_0x43c1a3[_0xaf84('0x4b')]=_0x3d07a3;return _0x43c1a3;})['then'](respondWithFilteredResult(_0x56f013,_0x18ac16))[_0xaf84('0x25')](handleError(_0x56f013,null));};exports[_0xaf84('0x4c')]=function(_0x4d8783,_0x3462ab){var _0x54ae8b={'raw':![],'where':{'id':_0x4d8783['params']['id']}},_0x267acd={};_0x267acd[_0xaf84('0x37')]=_['keys'](db[_0xaf84('0x47')][_0xaf84('0x34')]);_0x267acd[_0xaf84('0x39')]=_[_0xaf84('0x4d')](_0x4d8783['query']);_0x267acd[_0xaf84('0x3a')]=_[_0xaf84('0x3b')](_0x267acd[_0xaf84('0x37')],_0x267acd[_0xaf84('0x39')]);_0x54ae8b[_0xaf84('0x3c')]=_['intersection'](_0x267acd[_0xaf84('0x37')],qs[_0xaf84('0x3d')](_0x4d8783[_0xaf84('0x39')]['fields']));_0x54ae8b[_0xaf84('0x3c')]=_0x54ae8b[_0xaf84('0x3c')][_0xaf84('0x3e')]?_0x54ae8b[_0xaf84('0x3c')]:_0x267acd[_0xaf84('0x37')];if(_0x4d8783[_0xaf84('0x39')][_0xaf84('0x48')]){_0x54ae8b[_0xaf84('0x49')]=[{'all':!![]}];}_0x54ae8b=_[_0xaf84('0x43')]({},_0x54ae8b,_0x4d8783[_0xaf84('0x46')]);return db['Setting'][_0xaf84('0x4e')](_0x54ae8b)[_0xaf84('0x1b')](handleEntityNotFound(_0x3462ab,null))[_0xaf84('0x1b')](respondWithResult(_0x3462ab,null))[_0xaf84('0x25')](handleError(_0x3462ab,null));};exports[_0xaf84('0x4f')]=function(_0xf8b553,_0x55c9fc){if(_0xf8b553['body']['id']){delete _0xf8b553[_0xaf84('0x50')]['id'];}return db[_0xaf84('0x47')]['find']({'where':{'id':_0xf8b553[_0xaf84('0x51')]['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x55c9fc,null))[_0xaf84('0x1b')](saveUpdates(_0xf8b553['body'],null))['then'](respondWithResult(_0x55c9fc,null))['catch'](handleError(_0x55c9fc,null));};exports[_0xaf84('0x52')]=function(_0x282bf0,_0x11ff5f,_0x282807){if(_0x282bf0[_0xaf84('0x53')]&&_0x282bf0[_0xaf84('0x53')][_0xaf84('0x54')]){_0x282bf0[_0xaf84('0x50')]['logo']=_0x282bf0[_0xaf84('0x53')][_0xaf84('0x54')];}return db['Setting'][_0xaf84('0x4e')]({'where':{'id':_0x282bf0['params']['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x11ff5f,null))['then'](saveUpdates(_0x282bf0[_0xaf84('0x50')],null))[_0xaf84('0x1b')](respondWithResult(_0x11ff5f,null))[_0xaf84('0x25')](handleError(_0x11ff5f,null));};exports[_0xaf84('0x55')]=function(_0xd6e140,_0x881f25,_0x1ea8ff){if(_0xd6e140[_0xaf84('0x53')]&&_0xd6e140[_0xaf84('0x53')]['filename']){_0xd6e140[_0xaf84('0x50')]['loginLogo']=_0xd6e140[_0xaf84('0x53')][_0xaf84('0x54')];}return db[_0xaf84('0x47')]['find']({'where':{'id':_0xd6e140[_0xaf84('0x51')]['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x881f25,null))['then'](saveUpdates(_0xd6e140[_0xaf84('0x50')],null))['then'](respondWithResult(_0x881f25,null))['catch'](handleError(_0x881f25,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x332c45,_0x1f6ada,_0x49a677){var _0x2d5ab3='server/files/images/logos';var _0x7256f7={'custom':![]};return utilLicense[_0xaf84('0x56')]()[_0xaf84('0x1b')](function(_0x13feaf){if(_0x13feaf){_0x7256f7=_0x13feaf;}return db['Setting'][_0xaf84('0x4e')]({'where':{'id':_0x332c45['params']['id']},'attributes':[_0xaf84('0x57'),'loginLogo',_0xaf84('0x58'),_0xaf84('0x59'),_0xaf84('0x5a'),'defaultLoginLogo','defaultPreferred',_0xaf84('0x5b')],'raw':!![]});})[_0xaf84('0x1b')](handleEntityNotFound(_0x1f6ada,null))['then'](function(_0x191a7d){if(_0x191a7d){var _0x2b7826=_0x191a7d[_0xaf84('0x57')]&&fs[_0xaf84('0x5c')](path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x2d5ab3,_[_0xaf84('0x5f')](_0x191a7d[_0xaf84('0x57')])))?path['join'](config['root'],_0x2d5ab3,_[_0xaf84('0x5f')](_0x191a7d[_0xaf84('0x57')])):path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x2d5ab3,_[_0xaf84('0x5f')]('default_logo.svg'));var _0xab55dc='default'+_[_0xaf84('0x60')](_0xaf84('0x57'));if(_0x191a7d[_0xab55dc]||!_0x7256f7[_0xaf84('0x61')]){_0x2b7826=path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x2d5ab3,_[_0xaf84('0x5f')](_0xaf84('0x62')));}if(!fs['existsSync'](_0x2b7826)){throw new db[(_0xaf84('0x63'))][(_0xaf84('0x64'))](_[_0xaf84('0x60')]('logo')+_0xaf84('0x65'));}return _0x1f6ada[_0xaf84('0x66')](_0x2b7826);}})[_0xaf84('0x25')](handleError(_0x1f6ada,null));};var utilLicense=require(_0xaf84('0x17'));exports[_0xaf84('0x67')]=function(_0x13d6fc,_0x264431,_0x2656db){var _0x55ce87=_0xaf84('0x68');var _0x47586a={'custom':![]};return utilLicense[_0xaf84('0x56')]()[_0xaf84('0x1b')](function(_0x3e86ea){if(_0x3e86ea){_0x47586a=_0x3e86ea;}return db[_0xaf84('0x47')][_0xaf84('0x4e')]({'where':{'id':_0x13d6fc[_0xaf84('0x51')]['id']},'attributes':[_0xaf84('0x57'),_0xaf84('0x69'),_0xaf84('0x58'),'favicon',_0xaf84('0x5a'),_0xaf84('0x6a'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xaf84('0x1b')](handleEntityNotFound(_0x264431,null))['then'](function(_0x800770){if(_0x800770){var _0x25dbf6=_0x800770['loginLogo']&&fs[_0xaf84('0x5c')](path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x55ce87,_[_0xaf84('0x5f')](_0x800770['loginLogo'])))?path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x55ce87,_[_0xaf84('0x5f')](_0x800770[_0xaf84('0x69')])):path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x55ce87,_[_0xaf84('0x5f')]('default_loginLogo.svg'));var _0xde9b58=_0xaf84('0x6b')+_[_0xaf84('0x60')](_0xaf84('0x69'));if(_0x800770[_0xde9b58]||!_0x47586a[_0xaf84('0x61')]){_0x25dbf6=path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x55ce87,_[_0xaf84('0x5f')](_0xaf84('0x6c')));}if(!fs['existsSync'](_0x25dbf6)){throw new db[(_0xaf84('0x63'))][(_0xaf84('0x64'))](_[_0xaf84('0x60')](_0xaf84('0x69'))+'\x20not\x20found');}return _0x264431[_0xaf84('0x66')](_0x25dbf6);}})[_0xaf84('0x25')](handleError(_0x264431,null));};exports[_0xaf84('0x6d')]=function(_0xdb6977,_0x55b3ed){return db[_0xaf84('0x47')][_0xaf84('0x4e')]({'where':{'id':_0xdb6977['params']['id']},'attributes':[_0xaf84('0x6e')]})[_0xaf84('0x1b')](respondWithResult(_0x55b3ed,null))[_0xaf84('0x25')](handleError(_0x55b3ed,null));};exports[_0xaf84('0x6f')]=function(_0x3c086a,_0x179881,_0xad4ac9){if(_0x3c086a[_0xaf84('0x53')]&&_0x3c086a[_0xaf84('0x53')][_0xaf84('0x54')]){_0x3c086a[_0xaf84('0x50')][_0xaf84('0x58')]=_0x3c086a[_0xaf84('0x53')]['filename'];}return db['Setting'][_0xaf84('0x4e')]({'where':{'id':_0x3c086a['params']['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x179881,null))['then'](saveUpdates(_0x3c086a[_0xaf84('0x50')],null))['then'](respondWithResult(_0x179881,null))['catch'](handleError(_0x179881,null));};var utilLicense=require(_0xaf84('0x17'));exports[_0xaf84('0x70')]=function(_0x609210,_0x49ac99,_0x6250c9){var _0x10dd8b=_0xaf84('0x68');var _0x41e307={'custom':![]};return utilLicense[_0xaf84('0x56')]()['then'](function(_0x4042a8){if(_0x4042a8){_0x41e307=_0x4042a8;}return db['Setting'][_0xaf84('0x4e')]({'where':{'id':_0x609210['params']['id']},'attributes':[_0xaf84('0x57'),_0xaf84('0x69'),_0xaf84('0x58'),_0xaf84('0x59'),'defaultLogo',_0xaf84('0x6a'),_0xaf84('0x71'),_0xaf84('0x5b')],'raw':!![]});})[_0xaf84('0x1b')](handleEntityNotFound(_0x49ac99,null))[_0xaf84('0x1b')](function(_0x260f6c){if(_0x260f6c){var _0x34a41e=_0x260f6c['preferred']&&fs[_0xaf84('0x5c')](path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x10dd8b,_['toLower'](_0x260f6c['preferred'])))?path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x10dd8b,_[_0xaf84('0x5f')](_0x260f6c[_0xaf84('0x58')])):path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x10dd8b,_[_0xaf84('0x5f')](_0xaf84('0x72')));var _0x1ff642=_0xaf84('0x6b')+_[_0xaf84('0x60')](_0xaf84('0x58'));if(_0x260f6c[_0x1ff642]||!_0x41e307[_0xaf84('0x61')]||!_0x41e307[_0xaf84('0x58')]){_0x34a41e=path['join'](config[_0xaf84('0x5e')],_0x10dd8b,_[_0xaf84('0x5f')](_0xaf84('0x72')));}if(!fs[_0xaf84('0x5c')](_0x34a41e)){throw new db[(_0xaf84('0x63'))][(_0xaf84('0x64'))](_[_0xaf84('0x60')](_0xaf84('0x58'))+_0xaf84('0x65'));}return _0x49ac99['download'](_0x34a41e);}})[_0xaf84('0x25')](handleError(_0x49ac99,null));};exports[_0xaf84('0x73')]=function(_0x36c50d,_0x100c98,_0x180eef){if(_0x36c50d[_0xaf84('0x53')]&&_0x36c50d[_0xaf84('0x53')][_0xaf84('0x54')]){_0x36c50d['body'][_0xaf84('0x59')]=_0x36c50d[_0xaf84('0x53')]['filename'];}return db[_0xaf84('0x47')]['find']({'where':{'id':_0x36c50d[_0xaf84('0x51')]['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x100c98,null))['then'](saveUpdates(_0x36c50d['body'],null))[_0xaf84('0x1b')](respondWithResult(_0x100c98,null))[_0xaf84('0x25')](handleError(_0x100c98,null));};var utilLicense=require(_0xaf84('0x17'));exports[_0xaf84('0x74')]=function(_0x140918,_0x83601,_0x3a601e){var _0x260988=_0xaf84('0x68');var _0x10b9da={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x4450fe){if(_0x4450fe){_0x10b9da=_0x4450fe;}return db[_0xaf84('0x47')][_0xaf84('0x4e')]({'where':{'id':_0x140918[_0xaf84('0x51')]['id']},'attributes':['logo',_0xaf84('0x69'),_0xaf84('0x58'),_0xaf84('0x59'),_0xaf84('0x5a'),_0xaf84('0x6a'),_0xaf84('0x71'),'defaultFavicon'],'raw':!![]});})[_0xaf84('0x1b')](handleEntityNotFound(_0x83601,null))[_0xaf84('0x1b')](function(_0x2bad7f){if(_0x2bad7f){var _0x287086=_0x2bad7f[_0xaf84('0x59')]&&fs[_0xaf84('0x5c')](path[_0xaf84('0x5d')](config['root'],_0x260988,_[_0xaf84('0x5f')](_0x2bad7f[_0xaf84('0x59')])))?path['join'](config[_0xaf84('0x5e')],_0x260988,_['toLower'](_0x2bad7f[_0xaf84('0x59')])):path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x260988,_[_0xaf84('0x5f')](_0xaf84('0x75')));var _0x2e9539=_0xaf84('0x6b')+_['upperFirst'](_0xaf84('0x59'));if(_0x2bad7f[_0x2e9539]||!_0x10b9da[_0xaf84('0x61')]){_0x287086=path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x260988,_['toLower']('default_favicon.ico'));}if(!fs[_0xaf84('0x5c')](_0x287086)){throw new db[(_0xaf84('0x63'))]['ValidationError'](_[_0xaf84('0x60')](_0xaf84('0x59'))+_0xaf84('0x65'));}return _0x83601['download'](_0x287086);}})[_0xaf84('0x25')](handleError(_0x83601,null));};exports[_0xaf84('0x76')]=function(_0x530800,_0x2c0bf1){var _0x5e2a61={'offset':moment()[_0xaf84('0x77')]()};_0x5e2a61[_0xaf84('0x78')]=moment()[_0xaf84('0x77')](_0x5e2a61[_0xaf84('0x2b')])[_0xaf84('0x79')](_0xaf84('0x7a'));return _0x2c0bf1[_0xaf84('0x27')](0xc8)[_0xaf84('0x32')](_0x5e2a61);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index c108bc1..627ac54 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x419560,_0x16a92c){var _0x52a0a9=function(_0x1cdc67){while(--_0x1cdc67){_0x419560['push'](_0x419560['shift']());}};_0x52a0a9(++_0x16a92c);}(_0x3e74,0x175));var _0x43e7=function(_0x23ec25,_0x52a58a){_0x23ec25=_0x23ec25-0x0;var _0x540a7b=_0x3e74[_0x23ec25];return _0x540a7b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x347071,_0x518531){var _0x9a8c93=function(_0x163013){while(--_0x163013){_0x347071['push'](_0x347071['shift']());}};_0x9a8c93(++_0x518531);}(_0x34e8,0x12c));var _0x834e=function(_0x2f1f8f,_0xcad7b9){_0x2f1f8f=_0x2f1f8f-0x0;var _0x45c1df=_0x34e8[_0x2f1f8f];return _0x45c1df;};'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 3dbd70c..1ff2c1e 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 _0x67e6=['../../mysqldb','../../config/environment','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','options','raw','attributes','map','include','model','lodash','util','moment','bluebird','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67e6,0x124));var _0x667e=function(_0x50431f,_0x4fb9ce){_0x50431f=_0x50431f-0x0;var _0x3fc147=_0x67e6[_0x50431f];return _0x3fc147;};'use strict';var _=require(_0x667e('0x0'));var util=require(_0x667e('0x1'));var moment=require(_0x667e('0x2'));var BPromise=require(_0x667e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x667e('0x4'));var db=require(_0x667e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x667e('0x6'));var jayson=require(_0x667e('0x7'));var client=jayson[_0x667e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524615,_0x754efe,_0x30f762){return new BPromise(function(_0xa32805,_0x469eac){return client['request'](_0x524615,_0x30f762)[_0x667e('0x9')](function(_0x47a133){logger[_0x667e('0xa')](_0x667e('0xb'),_0x754efe,'request\x20sent');logger[_0x667e('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x754efe,_0x667e('0xd'),JSON[_0x667e('0xe')](_0x47a133));if(_0x47a133['error']){if(_0x47a133[_0x667e('0xf')][_0x667e('0x10')]===0x1f4){logger['error'](_0x667e('0xb'),_0x754efe,_0x47a133[_0x667e('0xf')][_0x667e('0x11')]);return _0x469eac(_0x47a133[_0x667e('0xf')][_0x667e('0x11')]);}logger[_0x667e('0xf')](_0x667e('0xb'),_0x754efe,_0x47a133[_0x667e('0xf')][_0x667e('0x11')]);return _0xa32805(_0x47a133[_0x667e('0xf')][_0x667e('0x11')]);}else{logger['info'](_0x667e('0xb'),_0x754efe,_0x667e('0xd'));_0xa32805(_0x47a133[_0x667e('0x12')]['message']);}})[_0x667e('0x13')](function(_0x3d1ee5){logger[_0x667e('0xf')](_0x667e('0xb'),_0x754efe,_0x3d1ee5);_0x469eac(_0x3d1ee5);});});}exports[_0x667e('0x14')]=function(_0x43cec4){var _0xe9d963=this;return new Promise(function(_0x5964c2,_0x3a8067){return db['Setting']['find']({'raw':_0x43cec4[_0x667e('0x15')]?_0x43cec4[_0x667e('0x15')][_0x667e('0x16')]===undefined?!![]:![]:!![],'where':_0x43cec4[_0x667e('0x15')]?_0x43cec4[_0x667e('0x15')]['where']||null:null,'attributes':_0x43cec4[_0x667e('0x15')]?_0x43cec4['options'][_0x667e('0x17')]||null:null,'include':_0x43cec4[_0x667e('0x15')]?_0x43cec4['options']['include']?_[_0x667e('0x18')](_0x43cec4[_0x667e('0x15')][_0x667e('0x19')],function(_0x43ae69){return{'model':db[_0x43ae69['model']],'as':_0x43ae69['as'],'attributes':_0x43ae69[_0x667e('0x17')],'include':_0x43ae69[_0x667e('0x19')]?_[_0x667e('0x18')](_0x43ae69[_0x667e('0x19')],function(_0x3229cd){return{'model':db[_0x3229cd[_0x667e('0x1a')]],'as':_0x3229cd['as'],'attributes':_0x3229cd['attributes'],'include':_0x3229cd['include']?_['map'](_0x3229cd[_0x667e('0x19')],function(_0x511021){return{'model':db[_0x511021[_0x667e('0x1a')]],'as':_0x511021['as'],'attributes':_0x511021['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f73fb){logger['info'](_0x667e('0x14'),_0x43cec4);logger['debug'](_0x667e('0x14'),_0x43cec4,JSON[_0x667e('0xe')](_0x1f73fb));_0x5964c2(_0x1f73fb);})[_0x667e('0x13')](function(_0x590a73){logger[_0x667e('0xf')](_0x667e('0x14'),_0x590a73[_0x667e('0x11')],_0x43cec4);_0x3a8067(_0xe9d963[_0x667e('0xf')](0x1f4,_0x590a73[_0x667e('0x11')]));});});}; \ No newline at end of file +var _0x3316=['result','catch','Setting','find','options','where','attributes','map','include','model','then','ShowSetting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x3316,0x1dd));var _0x6331=function(_0x3f3b53,_0x3d035f){_0x3f3b53=_0x3f3b53-0x0;var _0x3fa180=_0x3316[_0x3f3b53];return _0x3fa180;};'use strict';var _=require(_0x6331('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6331('0x1'));var rs=require(_0x6331('0x2'));var fs=require('fs');var Redis=require(_0x6331('0x3'));var db=require(_0x6331('0x4'))['db'];var utils=require(_0x6331('0x5'));var logger=require(_0x6331('0x6'))(_0x6331('0x7'));var config=require('../../config/environment');var jayson=require(_0x6331('0x8'));var client=jayson['client'][_0x6331('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x474841,_0xa25bd,_0x422a27){return new BPromise(function(_0x441534,_0x58cb7b){return client[_0x6331('0xa')](_0x474841,_0x422a27)['then'](function(_0xeab31c){logger[_0x6331('0xb')](_0x6331('0xc'),_0xa25bd,_0x6331('0xd'));logger[_0x6331('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0xa25bd,_0x6331('0xd'),JSON[_0x6331('0xf')](_0xeab31c));if(_0xeab31c[_0x6331('0x10')]){if(_0xeab31c['error'][_0x6331('0x11')]===0x1f4){logger['error'](_0x6331('0xc'),_0xa25bd,_0xeab31c['error'][_0x6331('0x12')]);return _0x58cb7b(_0xeab31c[_0x6331('0x10')][_0x6331('0x12')]);}logger[_0x6331('0x10')]('Setting,\x20%s,\x20%s',_0xa25bd,_0xeab31c[_0x6331('0x10')][_0x6331('0x12')]);return _0x441534(_0xeab31c[_0x6331('0x10')][_0x6331('0x12')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0xa25bd,_0x6331('0xd'));_0x441534(_0xeab31c[_0x6331('0x13')]['message']);}})[_0x6331('0x14')](function(_0x50367b){logger[_0x6331('0x10')]('Setting,\x20%s,\x20%s',_0xa25bd,_0x50367b);_0x58cb7b(_0x50367b);});});}exports['ShowSetting']=function(_0x5a5d9f){var _0x485f1f=this;return new Promise(function(_0x366f32,_0x11b53d){return db[_0x6331('0x15')][_0x6331('0x16')]({'raw':_0x5a5d9f[_0x6331('0x17')]?_0x5a5d9f[_0x6331('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5a5d9f['options']?_0x5a5d9f['options'][_0x6331('0x18')]||null:null,'attributes':_0x5a5d9f['options']?_0x5a5d9f[_0x6331('0x17')][_0x6331('0x19')]||null:null,'include':_0x5a5d9f[_0x6331('0x17')]?_0x5a5d9f[_0x6331('0x17')]['include']?_[_0x6331('0x1a')](_0x5a5d9f[_0x6331('0x17')]['include'],function(_0x3a2426){return{'model':db[_0x3a2426['model']],'as':_0x3a2426['as'],'attributes':_0x3a2426[_0x6331('0x19')],'include':_0x3a2426['include']?_[_0x6331('0x1a')](_0x3a2426[_0x6331('0x1b')],function(_0x32be61){return{'model':db[_0x32be61[_0x6331('0x1c')]],'as':_0x32be61['as'],'attributes':_0x32be61[_0x6331('0x19')],'include':_0x32be61['include']?_['map'](_0x32be61[_0x6331('0x1b')],function(_0x3b17d0){return{'model':db[_0x3b17d0[_0x6331('0x1c')]],'as':_0x3b17d0['as'],'attributes':_0x3b17d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x6331('0x1d')](function(_0xaf858c){logger[_0x6331('0xb')]('ShowSetting',_0x5a5d9f);logger[_0x6331('0xe')](_0x6331('0x1e'),_0x5a5d9f,JSON[_0x6331('0xf')](_0xaf858c));_0x366f32(_0xaf858c);})[_0x6331('0x14')](function(_0x5528f5){logger['error'](_0x6331('0x1e'),_0x5528f5[_0x6331('0x12')],_0x5a5d9f);_0x11b53d(_0x485f1f[_0x6331('0x10')](0x1f4,_0x5528f5[_0x6331('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 6786946..0507ce8 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 _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x2d41b9,_0xc4ceef){var _0x3709d3=function(_0xdfef4){while(--_0xdfef4){_0x2d41b9['push'](_0x2d41b9['shift']());}};_0x3709d3(++_0xc4ceef);}(_0x5fab,0x177));var _0xb5fa=function(_0x58bf72,_0x270672){_0x58bf72=_0x58bf72-0x0;var _0x5ac3aa=_0x5fab[_0x58bf72];return _0x5ac3aa;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router; \ No newline at end of file +var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0xe1b2a8,_0x38f786){var _0x554804=function(_0x412030){while(--_0x412030){_0xe1b2a8['push'](_0xe1b2a8['shift']());}};_0x554804(++_0x38f786);}(_0xe14b,0x93));var _0xbe14=function(_0x2afbc9,_0x21d12b){_0x2afbc9=_0x2afbc9-0x0;var _0x4150a7=_0xe14b[_0x2afbc9];return _0x4150a7;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);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 3cafa43..f55d693 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 _0x679d=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','infobip','intelepeer','BOOLEAN'];(function(_0x3d387c,_0x37779f){var _0x261cd4=function(_0x311404){while(--_0x311404){_0x3d387c['push'](_0x3d387c['shift']());}};_0x261cd4(++_0x37779f);}(_0x679d,0x15c));var _0xd679=function(_0xe280c3,_0x573dda){_0xe280c3=_0xe280c3-0x0;var _0x45964d=_0x679d[_0xe280c3];return _0x45964d;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xd679('0x0')]={'name':{'type':Sequelize[_0xd679('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xd679('0x1')],'defaultValue':function(){return rs[_0xd679('0x2')]();}},'phone':{'type':Sequelize[_0xd679('0x1')]},'type':{'type':Sequelize[_0xd679('0x3')](_0xd679('0x4'),_0xd679('0x5'),_0xd679('0x6'),_0xd679('0x7'),_0xd679('0x8'),_0xd679('0x9'),'bandwidth','csc',_0xd679('0xa'),_0xd679('0xb'))},'accountSid':{'type':Sequelize[_0xd679('0x1')]},'authId':{'type':Sequelize[_0xd679('0x1')]},'authToken':{'type':Sequelize[_0xd679('0x1')]},'smsMethod':{'type':Sequelize[_0xd679('0x3')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd679('0x1')]},'apiKey':{'type':Sequelize[_0xd679('0x1')]},'applicationId':{'type':Sequelize[_0xd679('0x1')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xd679('0x1')]},'deliveryReport':{'type':Sequelize[_0xd679('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xd679('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd679('0xd');}},'notificationSound':{'type':Sequelize[_0xd679('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd679('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd679('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd679('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd679('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd679('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd679('0xe')],'comment':_0xd679('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xd679('0xc')],'defaultValue':![],'comment':_0xd679('0x10'),'set':function(_0x6a00b9){if(!_0x6a00b9)this[_0xd679('0x11')]('mandatoryDispositionPauseId',null);this[_0xd679('0x11')](_0xd679('0x12'),_0x6a00b9);}}}; \ No newline at end of file +var _0x898a=['mandatoryDisposition','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDispositionPauseId'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x898a,0x1e1));var _0xa898=function(_0x158597,_0x4e6656){_0x158597=_0x158597-0x0;var _0xcbc1e0=_0x898a[_0x158597];return _0xcbc1e0;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xa898('0x0')]={'name':{'type':Sequelize[_0xa898('0x1')],'unique':_0xa898('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xa898('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xa898('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xa898('0x1')],'defaultValue':function(){return rs[_0xa898('0x3')]();}},'phone':{'type':Sequelize[_0xa898('0x1')]},'type':{'type':Sequelize[_0xa898('0x4')](_0xa898('0x5'),_0xa898('0x6'),_0xa898('0x7'),'clicksend',_0xa898('0x8'),_0xa898('0x9'),_0xa898('0xa'),_0xa898('0xb'),'infobip',_0xa898('0xc'))},'accountSid':{'type':Sequelize[_0xa898('0x1')]},'authId':{'type':Sequelize[_0xa898('0x1')]},'authToken':{'type':Sequelize[_0xa898('0x1')]},'smsMethod':{'type':Sequelize[_0xa898('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa898('0x1')]},'password':{'type':Sequelize[_0xa898('0x1')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xa898('0x1')]},'accountId':{'type':Sequelize[_0xa898('0x1')]},'senderString':{'type':Sequelize[_0xa898('0x1')]},'deliveryReport':{'type':Sequelize[_0xa898('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xa898('0x1')]},'notificationTemplate':{'type':Sequelize[_0xa898('0xe')],'defaultValue':function(){return _0xa898('0xf');}},'notificationSound':{'type':Sequelize[_0xa898('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa898('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa898('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa898('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa898('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa898('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa898('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa898('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x328284){if(!_0x328284)this[_0xa898('0x11')](_0xa898('0x12'),null);this['setDataValue'](_0xa898('0x13'),_0x328284);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index f3c12e8..6b2a959 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 _0x7775=['receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','debug','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','count','set','apply','reject','get','SmsAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','key','query','keys','filters','attributes','fields','model','hasOwnProperty','order','sort','where','pick','type','filter','merge','includeAll','include','findAll','rows','params','intersection','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','update','body','destroy','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','applications','orderBy','Applications','priority','asc','account','CmContact','ValidationError','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','From','results','csc','clickatell','fromNumber','bandwidth','refid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','autoclose','push','unmanaged','*,*,*,*','created','SmsMessage','ContactId','UserId','User','agent','waitForTheAssignedAgent','Start'];(function(_0x55b92e,_0xaa8883){var _0x4ea7c4=function(_0x18c24f){while(--_0x18c24f){_0x55b92e['push'](_0x55b92e['shift']());}};_0x4ea7c4(++_0xaa8883);}(_0x7775,0x11a));var _0x5777=function(_0x15a996,_0x2fda19){_0x15a996=_0x15a996-0x0;var _0xccb501=_0x7775[_0x15a996];return _0xccb501;};'use strict';var emlformat=require(_0x5777('0x0'));var rimraf=require(_0x5777('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5777('0x2'));var rp=require(_0x5777('0x3'));var moment=require('moment');var BPromise=require(_0x5777('0x4'));var Mustache=require(_0x5777('0x5'));var util=require(_0x5777('0x6'));var path=require(_0x5777('0x7'));var sox=require(_0x5777('0x8'));var csv=require(_0x5777('0x9'));var ejs=require(_0x5777('0xa'));var fs=require('fs');var fs_extra=require(_0x5777('0xb'));var _=require(_0x5777('0xc'));var squel=require(_0x5777('0xd'));var crypto=require(_0x5777('0xe'));var jsforce=require(_0x5777('0xf'));var deskjs=require(_0x5777('0x10'));var toCsv=require(_0x5777('0x9'));var querystring=require(_0x5777('0x11'));var Papa=require(_0x5777('0x12'));var Redis=require(_0x5777('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5777('0x14'));var as=require(_0x5777('0x15'));var hardwareService=require(_0x5777('0x16'));var logger=require('../../config/logger')(_0x5777('0x17'));var utils=require(_0x5777('0x18'));var config=require(_0x5777('0x19'));var licenseUtil=require(_0x5777('0x1a'));var db=require(_0x5777('0x1b'))['db'];config[_0x5777('0x1c')]=_[_0x5777('0x1d')](config[_0x5777('0x1c')],{'host':_0x5777('0x1e'),'port':0x18eb});var socket=require(_0x5777('0x1f'))(new Redis(config[_0x5777('0x1c')]));require(_0x5777('0x20'))['register'](socket);var jayson=require(_0x5777('0x21'));var client=jayson[_0x5777('0x22')][_0x5777('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1aa225,_0x5ce629,_0x305e40,_0x56d6b4){return new BPromise(function(_0x342fe1,_0x57e954){var _0x4c33d0=_0x56d6b4||client;return _0x4c33d0[_0x5777('0x24')](_0x1aa225,_0x305e40)[_0x5777('0x25')](function(_0x1d82d2){logger['info'](_0x5777('0x26'),_0x5ce629,'request\x20sent');logger['debug'](_0x5777('0x27'),_0x5ce629,_0x5777('0x28'),JSON['stringify'](_0x1d82d2));if(_0x1d82d2['error']){if(_0x1d82d2[_0x5777('0x29')][_0x5777('0x2a')]===0x1f4){logger['error'](_0x5777('0x26'),_0x5ce629,_0x1d82d2[_0x5777('0x29')][_0x5777('0x2b')]);return _0x57e954(_0x1d82d2[_0x5777('0x29')][_0x5777('0x2b')]);}logger[_0x5777('0x29')](_0x5777('0x26'),_0x5ce629,_0x1d82d2[_0x5777('0x29')]['message']);return _0x342fe1(_0x1d82d2[_0x5777('0x29')][_0x5777('0x2b')]);}else{logger[_0x5777('0x2c')]('SmsAccount,\x20%s,\x20%s',_0x5ce629,_0x5777('0x28'));_0x342fe1(_0x1d82d2[_0x5777('0x2d')][_0x5777('0x2b')]);}})[_0x5777('0x2e')](function(_0x4b1be3){logger['error'](_0x5777('0x26'),_0x5ce629,_0x4b1be3);_0x57e954(_0x4b1be3);});});}function respondWithStatusCode(_0x59a4b1,_0x4a7a8d){_0x4a7a8d=_0x4a7a8d||0xcc;return function(_0x502153){if(_0x502153){return _0x59a4b1[_0x5777('0x2f')](_0x4a7a8d);}return _0x59a4b1[_0x5777('0x30')](_0x4a7a8d)['end']();};}function respondWithResult(_0x3fddb6,_0x20a36f){_0x20a36f=_0x20a36f||0xc8;return function(_0x3a2ca5){if(_0x3a2ca5){return _0x3fddb6[_0x5777('0x30')](_0x20a36f)[_0x5777('0x31')](_0x3a2ca5);}};}function respondWithFilteredResult(_0x4c2a7d,_0x3b2e7d){return function(_0x56d3ec){if(_0x56d3ec){var _0x303c2b=typeof _0x3b2e7d[_0x5777('0x32')]==='undefined'&&typeof _0x3b2e7d[_0x5777('0x33')]==='undefined';var _0xac6f93=_0x56d3ec[_0x5777('0x34')];var _0x19d155=_0x303c2b?0x0:_0x3b2e7d[_0x5777('0x32')];var _0x1dc054=_0x303c2b?_0x56d3ec[_0x5777('0x34')]:_0x3b2e7d[_0x5777('0x32')]+_0x3b2e7d['limit'];var _0x48e6a3;if(_0x1dc054>=_0xac6f93){_0x1dc054=_0xac6f93;_0x48e6a3=0xc8;}else{_0x48e6a3=0xce;}_0x4c2a7d['status'](_0x48e6a3);return _0x4c2a7d[_0x5777('0x35')]('Content-Range',_0x19d155+'-'+_0x1dc054+'/'+_0xac6f93)[_0x5777('0x31')](_0x56d3ec);}return null;};}function patchUpdates(_0xaf9507){return function(_0x2a32d3){try{jsonpatch[_0x5777('0x36')](_0x2a32d3,_0xaf9507,!![]);}catch(_0x20c8b7){return BPromise[_0x5777('0x37')](_0x20c8b7);}return _0x2a32d3['save']();};}function saveUpdates(_0x101cd5,_0x44da8d){return function(_0x2145e7){if(_0x2145e7){return _0x2145e7['update'](_0x101cd5)[_0x5777('0x25')](function(_0x245ca3){return _0x245ca3;});}return null;};}function removeEntity(_0x5a9d7f,_0x381fe3){return function(_0x218e18){if(_0x218e18){return _0x218e18['destroy']()[_0x5777('0x25')](function(){var _0x13e124=_0x218e18[_0x5777('0x38')]({'plain':!![]});var _0x4c3e4b=_0x5777('0x39');return db[_0x5777('0x3a')]['destroy']({'where':{'type':_0x4c3e4b,'resourceId':_0x13e124['id']}})[_0x5777('0x25')](function(){return _0x218e18;});})[_0x5777('0x25')](function(){_0x5a9d7f[_0x5777('0x30')](0xcc)[_0x5777('0x3b')]();});}};}function handleEntityNotFound(_0x28ca32,_0x235b38){return function(_0x232144){if(!_0x232144){_0x28ca32[_0x5777('0x2f')](0x194);}return _0x232144;};}function handleError(_0x1742b6,_0x408a7f){_0x408a7f=_0x408a7f||0x1f4;return function(_0x66bd9f){logger[_0x5777('0x29')](_0x66bd9f[_0x5777('0x3c')]);if(_0x66bd9f['name']){delete _0x66bd9f[_0x5777('0x3d')];}_0x1742b6[_0x5777('0x30')](_0x408a7f)[_0x5777('0x3e')](_0x66bd9f);};}exports[_0x5777('0x3f')]=function(_0x211582,_0x56e96b){var _0x2fe04b={'include':[{'model':db[_0x5777('0x40')],'as':_0x5777('0x41')}]},_0xfa1ae8={},_0x3c7c9e={'count':0x0,'rows':[]};var _0xa71ee4=_[_0x5777('0x42')](db[_0x5777('0x43')][_0x5777('0x44')],function(_0x38b4a2){return{'name':_0x38b4a2['fieldName'],'type':_0x38b4a2['type'][_0x5777('0x45')]};});_0xfa1ae8['model']=_[_0x5777('0x42')](_0xa71ee4,_0x5777('0x3d'));_0xfa1ae8[_0x5777('0x46')]=_[_0x5777('0x47')](_0x211582['query']);_0xfa1ae8[_0x5777('0x48')]=_['intersection'](_0xfa1ae8['model'],_0xfa1ae8[_0x5777('0x46')]);_0x2fe04b[_0x5777('0x49')]=_['intersection'](_0xfa1ae8['model'],qs[_0x5777('0x4a')](_0x211582[_0x5777('0x46')][_0x5777('0x4a')]));_0x2fe04b['attributes']=_0x2fe04b['attributes']['length']?_0x2fe04b[_0x5777('0x49')]:_0xfa1ae8[_0x5777('0x4b')];if(!_0x211582['query'][_0x5777('0x4c')]('nolimit')){_0x2fe04b[_0x5777('0x33')]=qs['limit'](_0x211582['query'][_0x5777('0x33')]);_0x2fe04b['offset']=qs[_0x5777('0x32')](_0x211582[_0x5777('0x46')][_0x5777('0x32')]);}_0x2fe04b[_0x5777('0x4d')]=qs[_0x5777('0x4e')](_0x211582[_0x5777('0x46')][_0x5777('0x4e')]);_0x2fe04b[_0x5777('0x4f')]=qs[_0x5777('0x48')](_[_0x5777('0x50')](_0x211582[_0x5777('0x46')],_0xfa1ae8['filters']),_0xa71ee4);if(_0x211582[_0x5777('0x46')]['filter']){_0x2fe04b[_0x5777('0x4f')]=_['merge'](_0x2fe04b[_0x5777('0x4f')],{'$or':_['map'](_0xa71ee4,function(_0x44aa2a){if(_0x44aa2a[_0x5777('0x51')]!=='VIRTUAL'){var _0x3784da={};_0x3784da[_0x44aa2a['name']]={'$like':'%'+_0x211582[_0x5777('0x46')][_0x5777('0x52')]+'%'};return _0x3784da;}})});}_0x2fe04b=_[_0x5777('0x53')]({},_0x2fe04b,_0x211582['options']);var _0x4c4d60={'where':_0x2fe04b['where']};return db[_0x5777('0x43')][_0x5777('0x34')](_0x4c4d60)['then'](function(_0x1c97e9){_0x3c7c9e[_0x5777('0x34')]=_0x1c97e9;if(_0x211582['query'][_0x5777('0x54')]){_0x2fe04b[_0x5777('0x55')]=[{'all':!![]}];}return db[_0x5777('0x43')][_0x5777('0x56')](_0x2fe04b);})[_0x5777('0x25')](function(_0x17c9d5){_0x3c7c9e[_0x5777('0x57')]=_0x17c9d5;return _0x3c7c9e;})[_0x5777('0x25')](respondWithFilteredResult(_0x56e96b,_0x2fe04b))['catch'](handleError(_0x56e96b,null));};exports['show']=function(_0x12df07,_0x46d63f){var _0x44c492={'raw':![],'where':{'id':_0x12df07[_0x5777('0x58')]['id']},'include':[{'model':db[_0x5777('0x40')],'as':_0x5777('0x41')}]},_0xd2404={};_0xd2404['model']=_[_0x5777('0x47')](db[_0x5777('0x43')][_0x5777('0x44')]);_0xd2404[_0x5777('0x46')]=_['keys'](_0x12df07[_0x5777('0x46')]);_0xd2404[_0x5777('0x48')]=_['intersection'](_0xd2404['model'],_0xd2404[_0x5777('0x46')]);_0x44c492[_0x5777('0x49')]=_[_0x5777('0x59')](_0xd2404[_0x5777('0x4b')],qs[_0x5777('0x4a')](_0x12df07[_0x5777('0x46')]['fields']));_0x44c492[_0x5777('0x49')]=_0x44c492['attributes'][_0x5777('0x5a')]?_0x44c492[_0x5777('0x49')]:_0xd2404[_0x5777('0x4b')];if(_0x12df07[_0x5777('0x46')][_0x5777('0x54')]){_0x44c492[_0x5777('0x55')]=[{'all':!![]}];}_0x44c492=_[_0x5777('0x53')]({},_0x44c492,_0x12df07[_0x5777('0x5b')]);return db[_0x5777('0x43')][_0x5777('0x5c')](_0x44c492)[_0x5777('0x25')](handleEntityNotFound(_0x46d63f,null))[_0x5777('0x25')](respondWithResult(_0x46d63f,null))[_0x5777('0x2e')](handleError(_0x46d63f,null));};exports[_0x5777('0x5d')]=function(_0x36e6f7,_0x2e6c6d){return db['SmsAccount']['create'](_0x36e6f7['body'],{})[_0x5777('0x25')](function(_0x13a240){var _0x8e3637=_0x36e6f7['user'][_0x5777('0x38')]({'plain':!![]});if(!_0x8e3637)throw new Error(_0x5777('0x5e'));if(_0x8e3637[_0x5777('0x5f')]===_0x5777('0x60')){var _0x1bf65d=_0x13a240[_0x5777('0x38')]({'plain':!![]});var _0x574f66='SmsAccounts';return db['UserProfileSection'][_0x5777('0x5c')]({'where':{'name':_0x574f66,'userProfileId':_0x8e3637[_0x5777('0x61')]},'raw':!![]})['then'](function(_0xa15853){if(_0xa15853&&_0xa15853['autoAssociation']===0x0){return db['UserProfileResource'][_0x5777('0x5d')]({'name':_0x1bf65d[_0x5777('0x3d')],'resourceId':_0x1bf65d['id'],'type':_0xa15853[_0x5777('0x3d')],'sectionId':_0xa15853['id']},{})[_0x5777('0x25')](function(){return _0x13a240;});}else{return _0x13a240;}})['catch'](function(_0x59eea7){logger[_0x5777('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59eea7);throw _0x59eea7;});}return _0x13a240;})[_0x5777('0x25')](respondWithResult(_0x2e6c6d,0xc9))[_0x5777('0x2e')](handleError(_0x2e6c6d,null));};exports[_0x5777('0x62')]=function(_0xdc3f95,_0x36f9a8){if(_0xdc3f95[_0x5777('0x63')]['id']){delete _0xdc3f95[_0x5777('0x63')]['id'];}return db[_0x5777('0x43')]['find']({'where':{'id':_0xdc3f95[_0x5777('0x58')]['id']},'include':[{'model':db[_0x5777('0x40')],'as':_0x5777('0x41')}]})[_0x5777('0x25')](handleEntityNotFound(_0x36f9a8,null))[_0x5777('0x25')](saveUpdates(_0xdc3f95['body'],null))[_0x5777('0x25')](respondWithResult(_0x36f9a8,null))[_0x5777('0x2e')](handleError(_0x36f9a8,null));};exports[_0x5777('0x64')]=function(_0x1718c2,_0x25e713){return db['SmsAccount'][_0x5777('0x5c')]({'where':{'id':_0x1718c2['params']['id']}})[_0x5777('0x25')](handleEntityNotFound(_0x25e713,null))[_0x5777('0x25')](removeEntity(_0x25e713,null))[_0x5777('0x2e')](handleError(_0x25e713,null));};exports[_0x5777('0x65')]=function(_0x646c36,_0x3c4211){return db[_0x5777('0x43')][_0x5777('0x65')]()[_0x5777('0x25')](respondWithResult(_0x3c4211,null))[_0x5777('0x2e')](handleError(_0x3c4211,null));};exports[_0x5777('0x66')]=function(_0xb5b3a6,_0x2a123c,_0x56891b){if(_0xb5b3a6[_0x5777('0x63')]['id']){delete _0xb5b3a6[_0x5777('0x63')]['id'];}return db[_0x5777('0x43')][_0x5777('0x5c')]({'where':{'id':_0xb5b3a6[_0x5777('0x58')]['id']}})['then'](handleEntityNotFound(_0x2a123c,null))[_0x5777('0x25')](function(_0x192616){if(_0x192616){_0xb5b3a6[_0x5777('0x63')][_0x5777('0x67')]=_0x192616['id'];return db[_0x5777('0x68')][_0x5777('0x5d')](_0xb5b3a6['body']);}})[_0x5777('0x25')](respondWithResult(_0x2a123c,null))[_0x5777('0x2e')](handleError(_0x2a123c,null));};exports[_0x5777('0x69')]=function(_0x4e43b0,_0x1884a2,_0x149f85){var _0x46fe56={'raw':![],'where':{}};var _0x285013={};var _0x4de1f9={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5777('0x6a')]({'where':{'id':_0x4e43b0[_0x5777('0x58')]['id']}})['then'](handleEntityNotFound(_0x1884a2,null))[_0x5777('0x25')](function(_0x2c0573){if(_0x2c0573){_0x285013[_0x5777('0x4b')]=_[_0x5777('0x47')](db[_0x5777('0x68')]['rawAttributes']);_0x285013['query']=_[_0x5777('0x47')](_0x4e43b0[_0x5777('0x46')]);_0x285013[_0x5777('0x48')]=_[_0x5777('0x59')](_0x285013[_0x5777('0x4b')],_0x285013[_0x5777('0x46')]);_0x46fe56[_0x5777('0x49')]=_[_0x5777('0x59')](_0x285013['model'],qs['fields'](_0x4e43b0['query']['fields']));_0x46fe56[_0x5777('0x49')]=_0x46fe56[_0x5777('0x49')][_0x5777('0x5a')]?_0x46fe56[_0x5777('0x49')]:_0x285013[_0x5777('0x4b')];if(!_0x4e43b0[_0x5777('0x46')][_0x5777('0x4c')](_0x5777('0x6b'))){_0x46fe56['limit']=qs['limit'](_0x4e43b0[_0x5777('0x46')][_0x5777('0x33')]);_0x46fe56['offset']=qs[_0x5777('0x32')](_0x4e43b0[_0x5777('0x46')][_0x5777('0x32')]);}_0x46fe56['order']=qs[_0x5777('0x4e')](_0x4e43b0[_0x5777('0x46')][_0x5777('0x4e')]);_0x46fe56['where']=qs[_0x5777('0x48')](_['pick'](_0x4e43b0[_0x5777('0x46')],_0x285013[_0x5777('0x48')]));_0x46fe56[_0x5777('0x4f')][_0x5777('0x67')]=_0x2c0573['id'];if(_0x4e43b0[_0x5777('0x46')]['filter']){_0x46fe56[_0x5777('0x4f')]=_[_0x5777('0x53')](_0x46fe56[_0x5777('0x4f')],{'$or':_[_0x5777('0x42')](_0x46fe56[_0x5777('0x49')],function(_0x46e317){var _0x3cdb81={};_0x3cdb81[_0x46e317]={'$like':'%'+_0x4e43b0[_0x5777('0x46')][_0x5777('0x52')]+'%'};return _0x3cdb81;})});}_0x46fe56=_[_0x5777('0x53')]({},_0x46fe56,_0x4e43b0[_0x5777('0x5b')]);return db['Disposition'][_0x5777('0x34')]({'where':_0x46fe56[_0x5777('0x4f')]})[_0x5777('0x25')](function(_0x39bec4){_0x4de1f9['count']=_0x39bec4;if(_0x4e43b0[_0x5777('0x46')][_0x5777('0x54')]){_0x46fe56['include']=[{'all':!![]}];}return db[_0x5777('0x68')][_0x5777('0x56')](_0x46fe56);})[_0x5777('0x25')](function(_0x2470ec){_0x4de1f9[_0x5777('0x57')]=_0x2470ec;return _0x4de1f9;});}})['then'](respondWithFilteredResult(_0x1884a2,_0x46fe56))[_0x5777('0x2e')](handleError(_0x1884a2,null));};exports[_0x5777('0x6c')]=function(_0x383ff9,_0x1ac547,_0x219e07){return db[_0x5777('0x43')][_0x5777('0x5c')]({'where':{'id':_0x383ff9[_0x5777('0x58')]['id']}})['then'](handleEntityNotFound(_0x1ac547,null))['then'](function(_0x4c5a99){if(_0x4c5a99){return _0x4c5a99[_0x5777('0x6c')](_0x383ff9[_0x5777('0x46')][_0x5777('0x6d')]);}})[_0x5777('0x25')](respondWithStatusCode(_0x1ac547,null))[_0x5777('0x2e')](handleError(_0x1ac547,null));};exports[_0x5777('0x6e')]=function(_0x59188e,_0x565cb3,_0x1d93b1){if(_0x59188e['body']['id']){delete _0x59188e['body']['id'];}return db[_0x5777('0x43')][_0x5777('0x5c')]({'where':{'id':_0x59188e[_0x5777('0x58')]['id']}})[_0x5777('0x25')](handleEntityNotFound(_0x565cb3,null))[_0x5777('0x25')](function(_0x4479e5){if(_0x4479e5){_0x59188e[_0x5777('0x63')]['SmsAccountId']=_0x4479e5['id'];return db[_0x5777('0x6f')][_0x5777('0x5d')](_0x59188e[_0x5777('0x63')]);}})[_0x5777('0x25')](respondWithResult(_0x565cb3,null))['catch'](handleError(_0x565cb3,null));};exports[_0x5777('0x70')]=function(_0x48d0c2,_0x2cce3c,_0x1c5186){var _0x3ee5e5={'raw':![],'where':{}};var _0x1896a1={};var _0x2bfac8={'count':0x0,'rows':[]};return db[_0x5777('0x43')]['findOne']({'where':{'id':_0x48d0c2[_0x5777('0x58')]['id']}})[_0x5777('0x25')](handleEntityNotFound(_0x2cce3c,null))['then'](function(_0xa27b4a){if(_0xa27b4a){_0x1896a1[_0x5777('0x4b')]=_[_0x5777('0x47')](db[_0x5777('0x6f')]['rawAttributes']);_0x1896a1[_0x5777('0x46')]=_['keys'](_0x48d0c2[_0x5777('0x46')]);_0x1896a1[_0x5777('0x48')]=_[_0x5777('0x59')](_0x1896a1[_0x5777('0x4b')],_0x1896a1[_0x5777('0x46')]);_0x3ee5e5[_0x5777('0x49')]=_['intersection'](_0x1896a1[_0x5777('0x4b')],qs[_0x5777('0x4a')](_0x48d0c2[_0x5777('0x46')]['fields']));_0x3ee5e5[_0x5777('0x49')]=_0x3ee5e5[_0x5777('0x49')][_0x5777('0x5a')]?_0x3ee5e5['attributes']:_0x1896a1[_0x5777('0x4b')];if(!_0x48d0c2[_0x5777('0x46')][_0x5777('0x4c')]('nolimit')){_0x3ee5e5[_0x5777('0x33')]=qs[_0x5777('0x33')](_0x48d0c2['query'][_0x5777('0x33')]);_0x3ee5e5[_0x5777('0x32')]=qs[_0x5777('0x32')](_0x48d0c2['query'][_0x5777('0x32')]);}_0x3ee5e5[_0x5777('0x4d')]=qs[_0x5777('0x4e')](_0x48d0c2[_0x5777('0x46')][_0x5777('0x4e')]);_0x3ee5e5[_0x5777('0x4f')]=qs['filters'](_[_0x5777('0x50')](_0x48d0c2['query'],_0x1896a1[_0x5777('0x48')]));_0x3ee5e5[_0x5777('0x4f')][_0x5777('0x67')]=_0xa27b4a['id'];if(_0x48d0c2[_0x5777('0x46')][_0x5777('0x52')]){_0x3ee5e5[_0x5777('0x4f')]=_[_0x5777('0x53')](_0x3ee5e5[_0x5777('0x4f')],{'$or':_['map'](_0x3ee5e5[_0x5777('0x49')],function(_0x36cf3b){var _0x281d44={};_0x281d44[_0x36cf3b]={'$like':'%'+_0x48d0c2[_0x5777('0x46')]['filter']+'%'};return _0x281d44;})});}_0x3ee5e5=_['merge']({},_0x3ee5e5,_0x48d0c2['options']);return db[_0x5777('0x6f')][_0x5777('0x34')]({'where':_0x3ee5e5[_0x5777('0x4f')]})[_0x5777('0x25')](function(_0x1b69a8){_0x2bfac8[_0x5777('0x34')]=_0x1b69a8;if(_0x48d0c2[_0x5777('0x46')][_0x5777('0x54')]){_0x3ee5e5[_0x5777('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3ee5e5);})[_0x5777('0x25')](function(_0x129af8){_0x2bfac8[_0x5777('0x57')]=_0x129af8;return _0x2bfac8;});}})['then'](respondWithFilteredResult(_0x2cce3c,_0x3ee5e5))[_0x5777('0x2e')](handleError(_0x2cce3c,null));};exports[_0x5777('0x71')]=function(_0x4522eb,_0x25623c,_0x376e37){return db[_0x5777('0x43')][_0x5777('0x5c')]({'where':{'id':_0x4522eb['params']['id']}})[_0x5777('0x25')](handleEntityNotFound(_0x25623c,null))['then'](function(_0x548694){if(_0x548694){return _0x548694[_0x5777('0x71')](_0x4522eb['query'][_0x5777('0x6d')]);}})[_0x5777('0x25')](respondWithStatusCode(_0x25623c,null))[_0x5777('0x2e')](handleError(_0x25623c,null));};exports[_0x5777('0x72')]=function(_0xfcdbb5,_0x174c24,_0x4c9960){var _0x4beb0f={'channel':_0x5777('0x73')};var _0x482f42=[];var _0x7dd290=[];var _0x5ab4d8={};return db[_0x5777('0x43')]['find']({'where':{'id':_0xfcdbb5['params']['id']},'include':[{'model':db[_0x5777('0x74')],'as':'Applications'}]})[_0x5777('0x25')](handleEntityNotFound(_0x174c24,null))[_0x5777('0x25')](function(_0x3e3b5f){_0x4beb0f['account']=_0x3e3b5f;_0x4beb0f[_0x5777('0x75')]=_[_0x5777('0x76')](_0x3e3b5f[_0x5777('0x77')],[_0x5777('0x78')],[_0x5777('0x79')]);if(_0x4beb0f[_0x5777('0x7a')][_0x5777('0x77')]){delete _0x4beb0f[_0x5777('0x7a')][_0x5777('0x77')];}return db[_0x5777('0x7b')][_0x5777('0x65')]();})[_0x5777('0x25')](function(_0x31ebd7){if(!_0x31ebd7){throw new db['Sequelize'][(_0x5777('0x7c'))]('no\x20available\x20attributes');}_0x482f42=_['difference'](_[_0x5777('0x47')](_0x31ebd7),[_0x5777('0x7d'),_0x5777('0x7e')]);_0x7dd290=_[_0x5777('0x7f')](_[_0x5777('0x47')](_0x31ebd7),['createdAt',_0x5777('0x7e'),_0x5777('0x80'),'ListId']);_0x4beb0f[_0x5777('0x63')]={'mapKey':_0x5777('0x81')};if(_0x4beb0f[_0x5777('0x7a')][_0x5777('0x51')]){switch(_0x4beb0f[_0x5777('0x7a')][_0x5777('0x51')]){case _0x5777('0x82'):_0x4beb0f[_0x5777('0x63')][_0x5777('0x83')]=_0xfcdbb5[_0x5777('0x63')]['From'];_0x4beb0f[_0x5777('0x63')][_0x5777('0x63')]=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x84')];_0x4beb0f['body'][_0x5777('0x85')]=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x86')];break;case _0x5777('0x87'):_0x4beb0f[_0x5777('0x63')]['from']='+'+_0xfcdbb5[_0x5777('0x63')]['sender'];_0x4beb0f[_0x5777('0x63')][_0x5777('0x63')]=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x88')];break;case _0x5777('0x89'):_0x4beb0f[_0x5777('0x63')][_0x5777('0x83')]=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x83')];_0x4beb0f[_0x5777('0x63')][_0x5777('0x63')]=_0xfcdbb5[_0x5777('0x63')]['message'];break;case _0x5777('0x8a'):_0x4beb0f[_0x5777('0x63')][_0x5777('0x83')]=_0xfcdbb5[_0x5777('0x63')]['from'];_0x4beb0f[_0x5777('0x63')][_0x5777('0x63')]=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x63')];_0x4beb0f[_0x5777('0x63')][_0x5777('0x85')]=_0xfcdbb5['body'][_0x5777('0x8b')];break;case _0x5777('0x8c'):_0x4beb0f[_0x5777('0x63')][_0x5777('0x83')]=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x8d')];_0x4beb0f['body']['body']=_0xfcdbb5[_0x5777('0x63')]['Text'];_0x4beb0f[_0x5777('0x63')][_0x5777('0x85')]=_0xfcdbb5[_0x5777('0x63')]['MessageUUID'];break;case'infobip':_0x4beb0f[_0x5777('0x63')][_0x5777('0x83')]='+'+_0xfcdbb5[_0x5777('0x63')][_0x5777('0x8e')][0x0][_0x5777('0x83')];_0x4beb0f[_0x5777('0x63')]['body']=_0xfcdbb5['body'][_0x5777('0x8e')][0x0][_0x5777('0x88')];_0x4beb0f[_0x5777('0x63')][_0x5777('0x85')]=_0xfcdbb5[_0x5777('0x63')]['results'][0x0][_0x5777('0x85')];break;case _0x5777('0x8f'):_0x4beb0f[_0x5777('0x63')]['from']=_0xfcdbb5[_0x5777('0x63')]['originatingAddress'];_0x4beb0f[_0x5777('0x63')][_0x5777('0x63')]=_0xfcdbb5[_0x5777('0x63')]['segmentedMessage'][_0x5777('0x2b')];break;case _0x5777('0x90'):_0x4beb0f[_0x5777('0x63')]['from']=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x91')];_0x4beb0f['body'][_0x5777('0x63')]=_0xfcdbb5['body']['text'];_0x4beb0f[_0x5777('0x63')][_0x5777('0x85')]=_0xfcdbb5[_0x5777('0x63')]['replyMessageId'];break;case _0x5777('0x92'):_0x4beb0f[_0x5777('0x63')][_0x5777('0x85')]=_0xfcdbb5[_0x5777('0x63')][0x0][_0x5777('0x2b')]['id'];_0x4beb0f['body'][_0x5777('0x83')]=_0xfcdbb5[_0x5777('0x63')][0x0][_0x5777('0x2b')]['from'];_0x4beb0f['body']['body']=_0xfcdbb5[_0x5777('0x63')][0x0][_0x5777('0x2b')][_0x5777('0x88')];break;case'intelepeer':_0x4beb0f['body']['from']=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x83')];_0x4beb0f[_0x5777('0x63')][_0x5777('0x63')]=_0xfcdbb5['body'][_0x5777('0x2b')];_0x4beb0f['body'][_0x5777('0x85')]=_0xfcdbb5[_0x5777('0x63')][_0x5777('0x93')];break;}}if(_0x4beb0f['body']['id']){delete _0x4beb0f[_0x5777('0x63')]['id'];}if(_['isNil'](_0x4beb0f[_0x5777('0x63')][_0x5777('0x83')])){throw new db['Sequelize'][(_0x5777('0x7c'))]('from\x20is\x20mandatory');}if(_[_0x5777('0x94')](_0x4beb0f['body'][_0x5777('0x63')])||_0x4beb0f[_0x5777('0x63')][_0x5777('0x63')]===''){throw new db[(_0x5777('0x95'))][(_0x5777('0x7c'))](_0x5777('0x96'));}if(_[_0x5777('0x94')](_0x4beb0f[_0x5777('0x63')]['mapKey'])){throw new db[(_0x5777('0x95'))][(_0x5777('0x7c'))](_0x5777('0x97')+_0x7dd290);}if(!_[_0x5777('0x98')](_0x7dd290,_0x4beb0f[_0x5777('0x63')][_0x5777('0x99')])){throw new db[(_0x5777('0x95'))][(_0x5777('0x7c'))](_0x5777('0x9a')+_0x7dd290);}_0x5ab4d8[_0x4beb0f[_0x5777('0x63')][_0x5777('0x99')]]=_0x4beb0f[_0x5777('0x63')]['from'];return db[_0x5777('0x9b')]['find']({'where':{'id':_0x4beb0f[_0x5777('0x7a')][_0x5777('0x9c')]},'include':[{'model':db[_0x5777('0x7b')],'as':_0x5777('0x9d'),'where':_0x5ab4d8,'limit':0x1,'order':[['updatedAt',_0x5777('0x9e')]]}]});})[_0x5777('0x25')](handleEntityNotFound(_0x174c24,null))[_0x5777('0x25')](function(_0x23063a){if(_0x23063a){_0x4beb0f['list']=_[_0x5777('0x9f')](_0x23063a,[_0x5777('0x9d')]);if(_0x23063a[_0x5777('0x9d')]['length']){return _0x23063a[_0x5777('0x9d')][0x0];}var _0x344d01=_['defaults'](_0x4beb0f[_0x5777('0x63')],{'firstName':_0x4beb0f[_0x5777('0x63')][_0x5777('0x83')],'ListId':_0x23063a['id']});_0x344d01[_0x4beb0f[_0x5777('0x63')]['mapKey']]=_0x4beb0f[_0x5777('0x63')][_0x5777('0x83')];return db['CmContact'][_0x5777('0x5d')](_0x344d01,{'fields':_0x482f42,'raw':!![]});}})[_0x5777('0x25')](handleEntityNotFound(_0x174c24,null))[_0x5777('0x25')](function(_0x3648e7){if(_0x3648e7){_0x4beb0f[_0x5777('0xa0')]=_0x3648e7;var _0x44d159={'ContactId':_0x3648e7['id'],'phone':_0x4beb0f['body'][_0x5777('0x83')],'SmsAccountId':_0xfcdbb5['params']['id']};var _0x483afa={'ContactId':_0x3648e7['id'],'SmsAccountId':_0xfcdbb5['params']['id'],'closed':![]};return db[_0x5777('0xa1')][_0x5777('0x5c')]({'where':_0x483afa})[_0x5777('0x25')](function(_0x108c28){if(_0x108c28){return[_0x108c28,![]];}return db[_0x5777('0xa1')][_0x5777('0x5d')](_0x44d159)[_0x5777('0x25')](function(_0x35a6a6){return[_0x35a6a6,!![]];});});}})[_0x5777('0xa2')](function(_0x2d112b,_0x52a53e){_0x4beb0f[_0x5777('0xa3')]=_0x2d112b['get']({'plain':!![]});_0x4beb0f['interaction']['created']=![];if(_0x52a53e){if(_0x4beb0f['account'][_0x5777('0xa4')]){_0x4beb0f[_0x5777('0x75')][_0x5777('0xa5')]({'id':0x0,'priority':_0x4beb0f[_0x5777('0x75')][_0x5777('0x5a')]+0x1,'app':'close','appdata':_0x5777('0xa6'),'interval':_0x5777('0xa7')});}_0x4beb0f[_0x5777('0xa3')][_0x5777('0xa8')]=!![];}return db[_0x5777('0xa9')][_0x5777('0x5d')]({'phone':_0x4beb0f['body']['from'],'messageId':_0x4beb0f[_0x5777('0x63')][_0x5777('0x85')],'body':_0x4beb0f['body'][_0x5777('0x63')],'SmsAccountId':_0xfcdbb5[_0x5777('0x58')]['id'],'SmsInteractionId':_0x2d112b['id'],'direction':'in','ContactId':_0x2d112b[_0x5777('0xaa')],'AttachmentId':_0x4beb0f[_0x5777('0x63')]['AttachmentId']});})[_0x5777('0x25')](function(_0xd14b3b){_0x4beb0f[_0x5777('0x2b')]=_0xd14b3b;if(_0x4beb0f[_0x5777('0xa3')][_0x5777('0xab')]){return db[_0x5777('0xac')][_0x5777('0x5c')]({'attributes':['id','name'],'where':{'id':_0x4beb0f[_0x5777('0xa3')][_0x5777('0xab')]}})[_0x5777('0x25')](function(_0x343056){if(_0x343056){_0x4beb0f[_0x5777('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5777('0xad'),'appdata':_0x343056[_0x5777('0x3d')]+','+(_0x4beb0f['account'][_0x5777('0xae')]||0xa),'interval':_0x5777('0xa7')});}return respondWithRpcPromise(_0x5777('0xaf'),'startRouting',_0x4beb0f);});}return respondWithRpcPromise(_0x5777('0xaf'),'startRouting',_0x4beb0f);})['then'](function(_0x2bbab8){if(_0x2bbab8){var _0x5b3c42=0xc8;var _0x51a8b1=_0x5777('0xb0');logger[_0x5777('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x51a8b1,_0x5b3c42,_0x5777('0xb1'));logger['debug'](_0x5777('0xb2'),_0x51a8b1,_0x5b3c42,_0x5777('0xb1'),JSON['stringify'](_0x2bbab8));if(_0x4beb0f[_0x5777('0x7a')]['type']===_0x5777('0x82')){return _0x174c24[_0x5777('0x30')](_0x5b3c42)[_0x5777('0x35')](_0x5777('0xb3'),_0x5777('0xb4'))[_0x5777('0x3e')](_0x5777('0xb5'));}else{return _0x174c24[_0x5777('0x30')](_0x5b3c42)[_0x5777('0x31')](_0x2bbab8);}}})[_0x5777('0x2e')](handleError(_0x174c24,null));};exports[_0x5777('0xb6')]=function(_0xcd515c,_0x2afaf7){var _0x39af17=_0xcd515c[_0x5777('0x58')]['id'];var _0x17b228=_0xcd515c[_0x5777('0x63')];var _0x5a846e=0xc8;var _0x262ebe=null;return db['sequelize'][_0x5777('0xb7')]({'isolationLevel':db['sequelize'][_0x5777('0xb8')]['ISOLATION_LEVELS'][_0x5777('0xb9')]},function(_0x8954ca){return db[_0x5777('0x43')][_0x5777('0x6a')]({'where':{'id':_0x39af17},'transaction':_0x8954ca})[_0x5777('0x25')](function(_0x29c72a){if(_0x29c72a){return db[_0x5777('0x74')][_0x5777('0x64')]({'where':{'SmsAccountId':_0x39af17},'transaction':_0x8954ca})['then'](function(){var _0x30d3a3=_[_0x5777('0x42')](_0x17b228,function(_0x426b22){_0x426b22['SmsAccountId']=_0x39af17;return _0x426b22;});return db[_0x5777('0x74')][_0x5777('0xba')](_0x30d3a3,{'transaction':_0x8954ca});});}else{_0x5a846e=0x194;_0x262ebe=[];}});})[_0x5777('0x25')](function(){if(_0x5a846e!==0x194){return db[_0x5777('0x74')][_0x5777('0xbb')]({'where':{'SmsAccountId':_0x39af17},'order':_0x5777('0x78')})[_0x5777('0x25')](function(_0x28cfd1){_0x262ebe=_0x28cfd1;});}})[_0x5777('0x2e')](function(_0x51040e){_0x5a846e=0x1f4;logger[_0x5777('0x29')](_0x51040e[_0x5777('0x3c')]);if(_0x51040e[_0x5777('0x3d')]){delete _0x51040e['name'];}_0x262ebe=_0x51040e;})[_0x5777('0xbc')](function(){if(_0x262ebe===null){_0x2afaf7[_0x5777('0x2f')](_0x5a846e);}else{if(_0x5a846e===0x1f4){_0x2afaf7[_0x5777('0x30')](_0x5a846e)[_0x5777('0x3e')](_0x262ebe);}else{_0x2afaf7['status'](_0x5a846e)[_0x5777('0x31')](_0x262ebe);}}});};exports[_0x5777('0xbd')]=function(_0xbe369e,_0x391aef,_0x3ce3fa){var _0x43e825={};var _0x2f2e36={};var _0x40e565;var _0x15aab1;return db[_0x5777('0x43')][_0x5777('0x6a')]({'where':{'id':_0xbe369e[_0x5777('0x58')]['id']}})[_0x5777('0x25')](handleEntityNotFound(_0x391aef,null))[_0x5777('0x25')](function(_0x9379e9){if(_0x9379e9){_0x40e565=_0x9379e9;_0x2f2e36[_0x5777('0x4b')]=_['keys'](db[_0x5777('0x74')][_0x5777('0x44')]);_0x2f2e36[_0x5777('0x46')]=_[_0x5777('0x47')](_0xbe369e[_0x5777('0x46')]);_0x2f2e36[_0x5777('0x48')]=_[_0x5777('0x59')](_0x2f2e36[_0x5777('0x4b')],_0x2f2e36[_0x5777('0x46')]);_0x43e825[_0x5777('0x49')]=_[_0x5777('0x59')](_0x2f2e36[_0x5777('0x4b')],qs[_0x5777('0x4a')](_0xbe369e[_0x5777('0x46')]['fields']));_0x43e825['attributes']=_0x43e825[_0x5777('0x49')][_0x5777('0x5a')]?_0x43e825[_0x5777('0x49')]:_0x2f2e36[_0x5777('0x4b')];_0x43e825[_0x5777('0x4d')]=qs[_0x5777('0x4e')](_0xbe369e['query'][_0x5777('0x4e')]);_0x43e825[_0x5777('0x4f')]=qs[_0x5777('0x48')](_[_0x5777('0x50')](_0xbe369e[_0x5777('0x46')],_0x2f2e36[_0x5777('0x48')]));if(_0xbe369e[_0x5777('0x46')][_0x5777('0x52')]){_0x43e825[_0x5777('0x4f')]=_[_0x5777('0x53')](_0x43e825['where'],{'$or':_[_0x5777('0x42')](_0x43e825[_0x5777('0x49')],function(_0x27b9b6){var _0x442f28={};_0x442f28[_0x27b9b6]={'$like':'%'+_0xbe369e[_0x5777('0x46')][_0x5777('0x52')]+'%'};return _0x442f28;})});}_0x43e825=_[_0x5777('0x53')]({},_0x43e825,_0xbe369e[_0x5777('0x5b')]);return _0x40e565['getApplications'](_0x43e825);}})['then'](function(_0x4ef260){if(_0x4ef260){_0x15aab1=_0x4ef260[_0x5777('0x5a')];if(!_0xbe369e['query']['hasOwnProperty'](_0x5777('0x6b'))){_0x43e825['limit']=qs['limit'](_0xbe369e[_0x5777('0x46')]['limit']);_0x43e825[_0x5777('0x32')]=qs[_0x5777('0x32')](_0xbe369e[_0x5777('0x46')]['offset']);}return _0x40e565[_0x5777('0xbd')](_0x43e825);}})[_0x5777('0x25')](function(_0x16dfe3){if(_0x16dfe3){return _0x16dfe3?{'count':_0x15aab1,'rows':_0x16dfe3}:null;}})[_0x5777('0x25')](respondWithResult(_0x391aef,null))[_0x5777('0x2e')](handleError(_0x391aef,null));};exports[_0x5777('0xbe')]=function(_0x4c6cd2,_0x2fe407,_0x37385f){var _0x157afb={'raw':![],'where':{}};var _0x4b5cac={};var _0x198c60={'count':0x0,'rows':[]};return db[_0x5777('0x43')][_0x5777('0x6a')]({'where':{'id':_0x4c6cd2['params']['id']}})[_0x5777('0x25')](handleEntityNotFound(_0x2fe407,null))['then'](function(_0x1e3715){if(_0x1e3715){_0x4b5cac[_0x5777('0x4b')]=_['keys'](db[_0x5777('0xa1')][_0x5777('0x44')]);_0x4b5cac[_0x5777('0x46')]=_['keys'](_0x4c6cd2[_0x5777('0x46')]);_0x4b5cac[_0x5777('0x48')]=_['intersection'](_0x4b5cac[_0x5777('0x4b')],_0x4b5cac[_0x5777('0x46')]);_0x157afb[_0x5777('0x49')]=_['intersection'](_0x4b5cac[_0x5777('0x4b')],qs['fields'](_0x4c6cd2[_0x5777('0x46')][_0x5777('0x4a')]));_0x157afb[_0x5777('0x49')]=_0x157afb[_0x5777('0x49')]['length']?_0x157afb[_0x5777('0x49')]:_0x4b5cac[_0x5777('0x4b')];if(!_0x4c6cd2[_0x5777('0x46')]['hasOwnProperty']('nolimit')){_0x157afb['limit']=qs['limit'](_0x4c6cd2[_0x5777('0x46')][_0x5777('0x33')]);_0x157afb[_0x5777('0x32')]=qs['offset'](_0x4c6cd2[_0x5777('0x46')]['offset']);}_0x157afb[_0x5777('0x4d')]=qs['sort'](_0x4c6cd2[_0x5777('0x46')]['sort']);_0x157afb[_0x5777('0x4f')]=qs[_0x5777('0x48')](_[_0x5777('0x50')](_0x4c6cd2[_0x5777('0x46')],_0x4b5cac[_0x5777('0x48')]));_0x157afb[_0x5777('0x4f')]['SmsAccountId']=_0x1e3715['id'];if(_0x4c6cd2[_0x5777('0x46')][_0x5777('0x52')]){_0x157afb[_0x5777('0x4f')]=_['merge'](_0x157afb[_0x5777('0x4f')],{'$or':_[_0x5777('0x42')](_0x157afb[_0x5777('0x49')],function(_0x207fdb){var _0x483944={};_0x483944[_0x207fdb]={'$like':'%'+_0x4c6cd2[_0x5777('0x46')][_0x5777('0x52')]+'%'};return _0x483944;})});}_0x157afb=_[_0x5777('0x53')]({},_0x157afb,_0x4c6cd2[_0x5777('0x5b')]);return db[_0x5777('0xa1')][_0x5777('0x34')]({'where':_0x157afb[_0x5777('0x4f')]})['then'](function(_0x1c2bd3){_0x198c60[_0x5777('0x34')]=_0x1c2bd3;if(_0x4c6cd2[_0x5777('0x46')]['includeAll']){_0x157afb['include']=[{'model':db[_0x5777('0x7b')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x5777('0xbf'),'attributes':['name',_0x5777('0xc0'),_0x5777('0xc1')],'required':![]},{'model':db[_0x5777('0xc2')],'as':_0x5777('0xc3'),'attributes':['id',_0x5777('0x3d'),_0x5777('0xc4')],'where':_0x4c6cd2[_0x5777('0x46')][_0x5777('0xc5')]?{'id':_0x4c6cd2[_0x5777('0x46')][_0x5777('0xc5')]}:undefined,'required':_0x4c6cd2['query'][_0x5777('0xc5')]?!![]:![]}];}return db['SmsInteraction'][_0x5777('0x56')](_0x157afb);})[_0x5777('0x25')](function(_0x3dc3bb){_0x198c60['rows']=_0x3dc3bb;return _0x198c60;});}})[_0x5777('0x25')](respondWithFilteredResult(_0x2fe407,_0x157afb))[_0x5777('0x2e')](handleError(_0x2fe407,null));};exports[_0x5777('0x3e')]=function(_0x3101e9,_0x28165c,_0x4d77dc){var _0x2079a3,_0x3da30e,_0x58e415;if(_[_0x5777('0x94')](_0x3101e9['body'][_0x5777('0x63')])||_0x3101e9['body'][_0x5777('0x63')]===''){throw new db[(_0x5777('0x95'))][(_0x5777('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3101e9[_0x5777('0x63')]['to'])){throw new db['Sequelize'][(_0x5777('0x7c'))](_0x5777('0xc6'));}_0x2079a3=_0x3101e9[_0x5777('0x63')]['to'];return db[_0x5777('0x43')][_0x5777('0x5c')]({'where':{'id':_0x3101e9[_0x5777('0x58')]['id']},'include':[{'model':db[_0x5777('0x9b')],'as':'List','include':[{'model':db[_0x5777('0x7b')],'as':'Contacts','where':{'mobile':_0x2079a3},'limit':0x1,'order':[[_0x5777('0x7e'),_0x5777('0x9e')]]}]}]})['then'](handleEntityNotFound(_0x28165c,null))[_0x5777('0x25')](function(_0x215d5a){if(_0x215d5a&&_0x215d5a[_0x5777('0xc7')]){_0x3da30e=_0x215d5a['get']({'plain':!![]});if(_0x3da30e['List']&&_0x3da30e['List'][_0x5777('0x9d')][_0x5777('0x5a')]){return _0x3da30e[_0x5777('0xc7')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x5777('0x1d')](_0x3101e9['body'],{'firstName':_0x2079a3,'mobile':_0x2079a3,'phone':_0x2079a3,'ListId':_0x3da30e[_0x5777('0x9c')]}));}})[_0x5777('0x25')](handleEntityNotFound(_0x28165c,null))[_0x5777('0x25')](function(_0x344057){if(_0x344057){_0x58e415=_0x344057;return db[_0x5777('0xa1')]['find']({'where':{'ContactId':_0x58e415['id'],'closed':![],'SmsAccountId':_0x3da30e['id']}})['then'](function(_0xc480b5){if(_0xc480b5){return[_0xc480b5,![]];}return db['SmsInteraction'][_0x5777('0x5d')]({'UserId':_0x3101e9[_0x5777('0x60')]['id'],'ContactId':_0x58e415['id'],'SmsAccountId':_0x3da30e['id'],'phone':_0x2079a3,'firstMsgDirection':_0x5777('0xc8'),'Messages':[_[_0x5777('0x53')](_0x3101e9['body'],{'read':![],'body':_0x3101e9['body'][_0x5777('0x63')],'phone':_0x2079a3,'SmsAccountId':_0x3da30e['id'],'UserId':_0x3101e9[_0x5777('0x60')]['id'],'ContactId':_0x58e415['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x5777('0x25')](function(_0x5dbc62){return[_0x5dbc62,!![]];});});}})[_0x5777('0xa2')](function(_0x235e43,_0xb0796d){if(_0xb0796d){return _0x235e43;}return db[_0x5777('0xa9')][_0x5777('0x5d')](_[_0x5777('0x53')](_0x3101e9['body'],{'read':![],'body':_0x3101e9[_0x5777('0x63')][_0x5777('0x63')],'phone':_0x2079a3,'SmsAccountId':_0x3da30e['id'],'SmsInteractionId':_0x235e43['id'],'UserId':_0x3101e9[_0x5777('0x60')]['id'],'ContactId':_0x58e415['id']}))[_0x5777('0x25')](function(_0x311fae){_0x235e43[_0x5777('0xc9')][_0x5777('0xca')]=[];_0x235e43[_0x5777('0xc9')][_0x5777('0xca')][_0x5777('0xa5')](_0x311fae[_0x5777('0xc9')]);return _0x235e43;});})['then'](respondWithResult(_0x28165c,null))['catch'](handleError(_0x28165c,null));};exports[_0x5777('0x30')]=function(_0x44727c,_0x128066,_0x3dd777){if(_0x44727c[_0x5777('0x63')]['id']){delete _0x44727c['body']['id'];}var _0x1f96a0,_0x592c6d,_0x4c64f3;return db[_0x5777('0x43')][_0x5777('0x5c')]({'where':{'id':_0x44727c[_0x5777('0x58')]['id']}})['then'](handleEntityNotFound(_0x128066,null))[_0x5777('0x25')](function(_0x50a40e){if(_0x50a40e){_0x4c64f3=_0x50a40e;logger[_0x5777('0xcb')](_0x5777('0x27'),_0x5777('0x30'),_0x5777('0xcc'),_0x50a40e[_0x5777('0x51')],util[_0x5777('0xcd')](_0x44727c[_0x5777('0x63')],{'showHidden':![],'depth':null}));switch(_0x50a40e[_0x5777('0x51')]){case'skebby':if(_0x44727c[_0x5777('0x63')]['skebby_dispatch_id']&&_0x44727c[_0x5777('0x63')][_0x5777('0x30')]){_0x592c6d=_0x44727c[_0x5777('0x63')][_0x5777('0x30')];return db['SmsMessage']['find']({'where':{'messageId':_0x44727c[_0x5777('0x63')][_0x5777('0xce')]}});}break;case _0x5777('0x89'):if(_0x44727c[_0x5777('0x63')][_0x5777('0xcf')]&&_0x44727c['body'][_0x5777('0xd0')]){_0x592c6d=_0x44727c[_0x5777('0x63')][_0x5777('0xd0')];return db[_0x5777('0xa9')][_0x5777('0x5c')]({'where':{'messageId':_0x44727c[_0x5777('0x63')][_0x5777('0xcf')]}});}break;case _0x5777('0x8a'):if(_0x44727c[_0x5777('0x63')]['message_id']&&_0x44727c[_0x5777('0x63')][_0x5777('0xd1')]){_0x592c6d=_0x44727c[_0x5777('0x63')]['status_code'];return db['SmsMessage'][_0x5777('0x5c')]({'where':{'messageId':_0x44727c[_0x5777('0x63')]['message_id']}});}break;case _0x5777('0xd2'):var _0x2c8e33=_0x44727c[_0x5777('0x63')]['results'][0x0];if(_0x2c8e33[_0x5777('0x85')]&&_0x2c8e33['status'][_0x5777('0xd3')]===_0x5777('0xd4')){_0x592c6d=_0x2c8e33['status'][_0x5777('0xd3')];return db[_0x5777('0xa9')][_0x5777('0x5c')]({'where':{'messageId':_0x2c8e33[_0x5777('0x85')]}});}break;case _0x5777('0x90'):if(_0x44727c[_0x5777('0x63')]['messageId']&&_0x44727c[_0x5777('0x63')][_0x5777('0x30')]){_0x592c6d=_0x44727c[_0x5777('0x63')][_0x5777('0x30')];return db[_0x5777('0xa9')][_0x5777('0x5c')]({'where':{'messageId':_0x44727c['body']['messageId']}});}break;case _0x5777('0x92'):if(_0x44727c[_0x5777('0x63')][0x0]['message']['id']){_0x592c6d=_0x44727c[_0x5777('0x63')][0x0]['type'];return db[_0x5777('0xa9')]['find']({'where':{'messageId':_0x44727c[_0x5777('0x63')][0x0][_0x5777('0x2b')]['id']}});}break;case _0x5777('0xd5'):if(_0x44727c[_0x5777('0x63')][_0x5777('0xd6')]&&_0x44727c[_0x5777('0x63')]['status']){_0x592c6d=_0x44727c[_0x5777('0x63')][_0x5777('0x30')];return db[_0x5777('0xa9')]['find']({'where':{'messageId':_0x44727c[_0x5777('0x63')][_0x5777('0xd6')]}});}break;}}})[_0x5777('0x25')](handleEntityNotFound(_0x128066,null))[_0x5777('0x25')](function(_0x3f6e63){if(_0x3f6e63){_0x1f96a0=_0x3f6e63;switch(_0x4c64f3[_0x5777('0x51')]){case _0x5777('0x87'):if(_0x592c6d===_0x5777('0xd4')){return _0x1f96a0[_0x5777('0x62')]({'read':!![]});}else{logger[_0x5777('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5777('0x30'),_0x5777('0x87'),util[_0x5777('0xcd')](_0x44727c['body'],{'showHidden':![],'depth':null}));}break;case _0x5777('0x89'):if(_0x592c6d==='1'){return _0x1f96a0[_0x5777('0x62')]({'read':!![]});}else{logger[_0x5777('0x29')](_0x5777('0x27'),_0x5777('0x30'),_0x5777('0x87'),util['inspect'](_0x44727c[_0x5777('0x63')],{'showHidden':![],'depth':null}));}break;case _0x5777('0x8a'):if(!_0x44727c[_0x5777('0x63')][_0x5777('0xd7')]&&_0x592c6d>=0xc8&&_0x592c6d<=0xce){return _0x1f96a0[_0x5777('0x62')]({'read':!![]});}else{logger['error'](_0x5777('0x27'),_0x5777('0x30'),'clicksend',util[_0x5777('0xcd')](_0x44727c[_0x5777('0x63')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x169508=_0x44727c['body']['results'][0x0];if(_0x169508['status']['groupName']===_0x5777('0xd4')){return _0x1f96a0[_0x5777('0x62')]({'read':!![]});}else{logger[_0x5777('0x29')](_0x5777('0x27'),_0x5777('0x30'),'infobip',util[_0x5777('0xcd')](_0x44727c[_0x5777('0x63')],{'showHidden':![],'depth':null}));}break;case _0x5777('0x90'):if(_0x592c6d==_0x5777('0xd8')||_0x592c6d==_0x5777('0xd9')){return _0x1f96a0[_0x5777('0x62')]({'read':!![]});}else{logger[_0x5777('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5777('0x30'),'clickatell',util[_0x5777('0xcd')](_0x44727c[_0x5777('0x63')],{'showHidden':![],'depth':null}));}break;case _0x5777('0x92'):if(_0x592c6d=='message-delivered'){return _0x1f96a0['update']({'read':!![]});}else{logger[_0x5777('0x29')](_0x5777('0x27'),_0x5777('0x30'),'bandwidth',util['inspect'](_0x44727c[_0x5777('0x63')],{'showHidden':![],'depth':null}));}break;case _0x5777('0xd5'):if(_0x592c6d==='DELIVRD'||_0x592c6d===_0x5777('0xda')){return _0x1f96a0[_0x5777('0x62')]({'read':!![]});}else{logger['error'](_0x5777('0x27'),'status',_0x5777('0xd5'),util[_0x5777('0xcd')](_0x44727c[_0x5777('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x1f96a0;}})[_0x5777('0x25')](respondWithResult(_0x128066,null))[_0x5777('0x2e')](handleError(_0x128066,null));};exports[_0x5777('0xdb')]=function(_0x4df6de,_0x2c09dc,_0x1ab190){var _0xbf61cc,_0x1909d2,_0x1dc1c6;return db[_0x5777('0x43')][_0x5777('0x5c')]({'where':{'id':_0x4df6de['params']['id']}})[_0x5777('0x25')](handleEntityNotFound(_0x2c09dc,null))[_0x5777('0x25')](function(_0x5c7583){if(_0x5c7583){_0x1dc1c6=_0x5c7583;logger[_0x5777('0xcb')](_0x5777('0x27'),_0x5777('0x30'),_0x5777('0xcc'),_0x5c7583['type'],util[_0x5777('0xcd')](_0x4df6de[_0x5777('0x46')],{'showHidden':![],'depth':null}));switch(_0x5c7583[_0x5777('0x51')]){case _0x5777('0x8f'):if(_0x4df6de[_0x5777('0x46')][_0x5777('0xdc')]&&_0x4df6de['query'][_0x5777('0xdd')]){_0x1909d2=_0x4df6de['query'][_0x5777('0xdd')];return db['SmsMessage'][_0x5777('0x5c')]({'where':{'messageId':_0x4df6de['query'][_0x5777('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x2c09dc,null))[_0x5777('0x25')](function(_0x5e314e){if(_0x5e314e){_0xbf61cc=_0x5e314e;switch(_0x1dc1c6[_0x5777('0x51')]){case'csc':if(_0x1909d2==='2'||_0x1909d2==='6'){return _0xbf61cc[_0x5777('0x62')]({'read':!![]});}else{logger[_0x5777('0x29')](_0x5777('0x27'),_0x5777('0x30'),'csc',util['inspect'](_0x4df6de[_0x5777('0x46')],{'showHidden':![],'depth':null}));};break;}return _0xbf61cc;}})[_0x5777('0x25')](respondWithResult(_0x2c09dc,null))['catch'](handleError(_0x2c09dc,null));};exports[_0x5777('0xde')]=function(_0x20c762,_0x332b81,_0x17e39b){return db[_0x5777('0x43')][_0x5777('0x5c')]({'where':{'id':_0x20c762['params']['id']}})['then'](handleEntityNotFound(_0x332b81,null))[_0x5777('0x25')](function(_0x2f191c){if(_0x2f191c){return _0x2f191c[_0x5777('0xde')](_0x20c762[_0x5777('0x63')][_0x5777('0x6d')],_['omit'](_0x20c762[_0x5777('0x63')],['ids','id'])||{})[_0x5777('0xa2')](function(_0x59b6b9){for(var _0xf4279b=0x0;_0xf4279b<_0x20c762[_0x5777('0x63')][_0x5777('0x6d')][_0x5777('0x5a')];_0xf4279b+=0x1){socket[_0x5777('0xdf')](_0x5777('0xe0'),{'UserId':Number(_0x20c762[_0x5777('0x63')][_0x5777('0x6d')][_0xf4279b]),'SmsAccountId':Number(_0x20c762['params']['id'])});}return _0x59b6b9;});}})['then'](respondWithResult(_0x332b81,null))[_0x5777('0x2e')](handleError(_0x332b81,null));};exports['removeAgents']=function(_0x51d08a,_0x151c39,_0x541038){return db['SmsAccount']['find']({'where':{'id':_0x51d08a[_0x5777('0x58')]['id']}})['then'](handleEntityNotFound(_0x151c39,null))['then'](function(_0x101f0e){if(_0x101f0e){return _0x101f0e[_0x5777('0xe1')](_0x51d08a[_0x5777('0x46')][_0x5777('0x6d')])[_0x5777('0x25')](function(){if(_[_0x5777('0xe2')](_0x51d08a['query']['ids'])){for(var _0x25e475=0x0;_0x25e475<_0x51d08a[_0x5777('0x46')][_0x5777('0x6d')][_0x5777('0x5a')];_0x25e475+=0x1){socket[_0x5777('0xdf')](_0x5777('0xe3'),{'UserId':Number(_0x51d08a[_0x5777('0x46')][_0x5777('0x6d')][_0x25e475]),'SmsAccountId':Number(_0x51d08a[_0x5777('0x58')]['id'])});}}else{socket[_0x5777('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x51d08a[_0x5777('0x46')]['ids']),'SmsAccountId':Number(_0x51d08a[_0x5777('0x58')]['id'])});}});}})[_0x5777('0x25')](respondWithStatusCode(_0x151c39,null))[_0x5777('0x2e')](handleError(_0x151c39,null));};exports['getAgents']=function(_0x127bf3,_0x475001,_0x5b63e9){var _0x5d272d={};var _0x4a6548={};var _0x10ddae;var _0x40e5cd;return db['SmsAccount'][_0x5777('0x6a')]({'where':{'id':_0x127bf3[_0x5777('0x58')]['id']}})[_0x5777('0x25')](handleEntityNotFound(_0x475001,null))['then'](function(_0x168ca8){if(_0x168ca8){_0x10ddae=_0x168ca8;_0x4a6548[_0x5777('0x4b')]=_[_0x5777('0x47')](db[_0x5777('0xac')]['rawAttributes']);_0x4a6548[_0x5777('0x46')]=_[_0x5777('0x47')](_0x127bf3[_0x5777('0x46')]);_0x4a6548['filters']=_[_0x5777('0x59')](_0x4a6548['model'],_0x4a6548[_0x5777('0x46')]);_0x5d272d[_0x5777('0x49')]=_[_0x5777('0x59')](_0x4a6548[_0x5777('0x4b')],qs[_0x5777('0x4a')](_0x127bf3[_0x5777('0x46')]['fields']));_0x5d272d[_0x5777('0x49')]=_0x5d272d[_0x5777('0x49')][_0x5777('0x5a')]?_0x5d272d[_0x5777('0x49')]:_0x4a6548[_0x5777('0x4b')];_0x5d272d['order']=qs['sort'](_0x127bf3[_0x5777('0x46')]['sort']);_0x5d272d[_0x5777('0x4f')]=qs[_0x5777('0x48')](_[_0x5777('0x50')](_0x127bf3[_0x5777('0x46')],_0x4a6548[_0x5777('0x48')]));if(_0x127bf3['query']['filter']){_0x5d272d[_0x5777('0x4f')]=_[_0x5777('0x53')](_0x5d272d[_0x5777('0x4f')],{'$or':_[_0x5777('0x42')](_0x5d272d[_0x5777('0x49')],function(_0x276256){var _0x1ac4b3={};_0x1ac4b3[_0x276256]={'$like':'%'+_0x127bf3['query'][_0x5777('0x52')]+'%'};return _0x1ac4b3;})});}_0x5d272d=_[_0x5777('0x53')]({},_0x5d272d,_0x127bf3['options']);return _0x10ddae[_0x5777('0xe4')](_0x5d272d);}})['then'](function(_0x1b8927){if(_0x1b8927){_0x40e5cd=_0x1b8927[_0x5777('0x5a')];if(!_0x127bf3[_0x5777('0x46')][_0x5777('0x4c')](_0x5777('0x6b'))){_0x5d272d[_0x5777('0x33')]=qs[_0x5777('0x33')](_0x127bf3['query'][_0x5777('0x33')]);_0x5d272d['offset']=qs['offset'](_0x127bf3['query']['offset']);}return _0x10ddae[_0x5777('0xe4')](_0x5d272d);}})['then'](function(_0x6378eb){if(_0x6378eb){return _0x6378eb?{'count':_0x40e5cd,'rows':_0x6378eb}:null;}})[_0x5777('0x25')](respondWithResult(_0x475001,null))['catch'](handleError(_0x475001,null));}; \ No newline at end of file +var _0x896a=['bulkCreate','findAndCountAll','getApplications','User','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','clickatell','redif','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','save','destroy','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','SmsAccount','includeAll','include','rows','show','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','params','describe','SmsAccountId','Disposition','getDispositions','findOne','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','text','connectel','clicksend','message_id','plivo','Text','results','csc','originatingAddress','segmentedMessage','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','SmsInteraction','spread','interaction','created','push','*,*,*,*','SmsMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','Content-Type','text/xml','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x896a,0x1e5));var _0xa896=function(_0x4cab62,_0xe5c97){_0x4cab62=_0x4cab62-0x0;var _0x300fc6=_0x896a[_0x4cab62];return _0x300fc6;};'use strict';var emlformat=require(_0xa896('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa896('0x1'));var rp=require('request-promise');var moment=require(_0xa896('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa896('0x3'));var util=require(_0xa896('0x4'));var path=require('path');var sox=require(_0xa896('0x5'));var csv=require(_0xa896('0x6'));var ejs=require(_0xa896('0x7'));var fs=require('fs');var fs_extra=require(_0xa896('0x8'));var _=require(_0xa896('0x9'));var squel=require(_0xa896('0xa'));var crypto=require('crypto');var jsforce=require(_0xa896('0xb'));var deskjs=require(_0xa896('0xc'));var toCsv=require(_0xa896('0x6'));var querystring=require('querystring');var Papa=require(_0xa896('0xd'));var Redis=require(_0xa896('0xe'));var authService=require(_0xa896('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa896('0x10'));var hardwareService=require(_0xa896('0x11'));var logger=require(_0xa896('0x12'))('api');var utils=require(_0xa896('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa896('0x14'));var db=require('../../mysqldb')['db'];config[_0xa896('0x15')]=_[_0xa896('0x16')](config[_0xa896('0x15')],{'host':_0xa896('0x17'),'port':0x18eb});var socket=require(_0xa896('0x18'))(new Redis(config['redis']));require(_0xa896('0x19'))[_0xa896('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa896('0x1b')][_0xa896('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x282f8f,_0x1f3544,_0x299787,_0x4a33c3){return new BPromise(function(_0x3c41ba,_0x56f44c){var _0x3660d2=_0x4a33c3||client;return _0x3660d2[_0xa896('0x1d')](_0x282f8f,_0x299787)[_0xa896('0x1e')](function(_0x3c531){logger[_0xa896('0x1f')](_0xa896('0x20'),_0x1f3544,_0xa896('0x21'));logger[_0xa896('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1f3544,_0xa896('0x21'),JSON['stringify'](_0x3c531));if(_0x3c531[_0xa896('0x23')]){if(_0x3c531[_0xa896('0x23')][_0xa896('0x24')]===0x1f4){logger[_0xa896('0x23')](_0xa896('0x20'),_0x1f3544,_0x3c531[_0xa896('0x23')][_0xa896('0x25')]);return _0x56f44c(_0x3c531[_0xa896('0x23')][_0xa896('0x25')]);}logger[_0xa896('0x23')](_0xa896('0x20'),_0x1f3544,_0x3c531[_0xa896('0x23')][_0xa896('0x25')]);return _0x3c41ba(_0x3c531['error']['message']);}else{logger[_0xa896('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x1f3544,'request\x20sent');_0x3c41ba(_0x3c531[_0xa896('0x26')]['message']);}})[_0xa896('0x27')](function(_0x5499cf){logger[_0xa896('0x23')]('SmsAccount,\x20%s,\x20%s',_0x1f3544,_0x5499cf);_0x56f44c(_0x5499cf);});});}function respondWithStatusCode(_0x2b8b5a,_0xa4fa7d){_0xa4fa7d=_0xa4fa7d||0xcc;return function(_0x371d4f){if(_0x371d4f){return _0x2b8b5a['sendStatus'](_0xa4fa7d);}return _0x2b8b5a[_0xa896('0x28')](_0xa4fa7d)[_0xa896('0x29')]();};}function respondWithResult(_0x16e8b3,_0x52c484){_0x52c484=_0x52c484||0xc8;return function(_0x28ae38){if(_0x28ae38){return _0x16e8b3[_0xa896('0x28')](_0x52c484)[_0xa896('0x2a')](_0x28ae38);}};}function respondWithFilteredResult(_0x37dc89,_0x11788c){return function(_0x356312){if(_0x356312){var _0x15f935=typeof _0x11788c[_0xa896('0x2b')]===_0xa896('0x2c')&&typeof _0x11788c[_0xa896('0x2d')]===_0xa896('0x2c');var _0x21bf27=_0x356312[_0xa896('0x2e')];var _0x3cfe69=_0x15f935?0x0:_0x11788c[_0xa896('0x2b')];var _0x448c74=_0x15f935?_0x356312[_0xa896('0x2e')]:_0x11788c[_0xa896('0x2b')]+_0x11788c['limit'];var _0x22a882;if(_0x448c74>=_0x21bf27){_0x448c74=_0x21bf27;_0x22a882=0xc8;}else{_0x22a882=0xce;}_0x37dc89[_0xa896('0x28')](_0x22a882);return _0x37dc89[_0xa896('0x2f')](_0xa896('0x30'),_0x3cfe69+'-'+_0x448c74+'/'+_0x21bf27)[_0xa896('0x2a')](_0x356312);}return null;};}function patchUpdates(_0x8ff2bb){return function(_0x116a18){try{jsonpatch['apply'](_0x116a18,_0x8ff2bb,!![]);}catch(_0x3dd227){return BPromise['reject'](_0x3dd227);}return _0x116a18[_0xa896('0x31')]();};}function saveUpdates(_0x467dbb,_0x2e10a5){return function(_0x12e919){if(_0x12e919){return _0x12e919['update'](_0x467dbb)[_0xa896('0x1e')](function(_0x1a641){return _0x1a641;});}return null;};}function removeEntity(_0x9a80f,_0x42bcb1){return function(_0x33912a){if(_0x33912a){return _0x33912a[_0xa896('0x32')]()[_0xa896('0x1e')](function(){var _0x23a5df=_0x33912a[_0xa896('0x33')]({'plain':!![]});var _0x2bf10f=_0xa896('0x34');return db[_0xa896('0x35')][_0xa896('0x32')]({'where':{'type':_0x2bf10f,'resourceId':_0x23a5df['id']}})['then'](function(){return _0x33912a;});})['then'](function(){_0x9a80f[_0xa896('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c922f,_0x82e462){return function(_0x44eeb9){if(!_0x44eeb9){_0x1c922f[_0xa896('0x36')](0x194);}return _0x44eeb9;};}function handleError(_0x10f076,_0x1bc340){_0x1bc340=_0x1bc340||0x1f4;return function(_0x24074c){logger[_0xa896('0x23')](_0x24074c[_0xa896('0x37')]);if(_0x24074c[_0xa896('0x38')]){delete _0x24074c[_0xa896('0x38')];}_0x10f076[_0xa896('0x28')](_0x1bc340)[_0xa896('0x39')](_0x24074c);};}exports[_0xa896('0x3a')]=function(_0x1da6d3,_0x40cdec){var _0x30d861={'include':[{'model':db[_0xa896('0x3b')],'as':_0xa896('0x3c')}]},_0x504e78={},_0x463ca7={'count':0x0,'rows':[]};var _0x2f5f62=_['map'](db['SmsAccount'][_0xa896('0x3d')],function(_0x33286b){return{'name':_0x33286b[_0xa896('0x3e')],'type':_0x33286b[_0xa896('0x3f')]['key']};});_0x504e78['model']=_[_0xa896('0x40')](_0x2f5f62,'name');_0x504e78['query']=_[_0xa896('0x41')](_0x1da6d3[_0xa896('0x42')]);_0x504e78[_0xa896('0x43')]=_[_0xa896('0x44')](_0x504e78[_0xa896('0x45')],_0x504e78[_0xa896('0x42')]);_0x30d861[_0xa896('0x46')]=_[_0xa896('0x44')](_0x504e78[_0xa896('0x45')],qs[_0xa896('0x47')](_0x1da6d3['query'][_0xa896('0x47')]));_0x30d861['attributes']=_0x30d861['attributes']['length']?_0x30d861[_0xa896('0x46')]:_0x504e78[_0xa896('0x45')];if(!_0x1da6d3['query'][_0xa896('0x48')](_0xa896('0x49'))){_0x30d861[_0xa896('0x2d')]=qs[_0xa896('0x2d')](_0x1da6d3[_0xa896('0x42')][_0xa896('0x2d')]);_0x30d861[_0xa896('0x2b')]=qs[_0xa896('0x2b')](_0x1da6d3[_0xa896('0x42')][_0xa896('0x2b')]);}_0x30d861['order']=qs[_0xa896('0x4a')](_0x1da6d3[_0xa896('0x42')][_0xa896('0x4a')]);_0x30d861['where']=qs[_0xa896('0x43')](_[_0xa896('0x4b')](_0x1da6d3[_0xa896('0x42')],_0x504e78[_0xa896('0x43')]),_0x2f5f62);if(_0x1da6d3[_0xa896('0x42')]['filter']){_0x30d861[_0xa896('0x4c')]=_[_0xa896('0x4d')](_0x30d861[_0xa896('0x4c')],{'$or':_['map'](_0x2f5f62,function(_0x3dfbfc){if(_0x3dfbfc[_0xa896('0x3f')]!==_0xa896('0x4e')){var _0x2f8af6={};_0x2f8af6[_0x3dfbfc[_0xa896('0x38')]]={'$like':'%'+_0x1da6d3[_0xa896('0x42')][_0xa896('0x4f')]+'%'};return _0x2f8af6;}})});}_0x30d861=_[_0xa896('0x4d')]({},_0x30d861,_0x1da6d3['options']);var _0x1573d7={'where':_0x30d861[_0xa896('0x4c')]};return db[_0xa896('0x50')][_0xa896('0x2e')](_0x1573d7)[_0xa896('0x1e')](function(_0x2a480a){_0x463ca7[_0xa896('0x2e')]=_0x2a480a;if(_0x1da6d3[_0xa896('0x42')][_0xa896('0x51')]){_0x30d861[_0xa896('0x52')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x30d861);})[_0xa896('0x1e')](function(_0x1a72bf){_0x463ca7[_0xa896('0x53')]=_0x1a72bf;return _0x463ca7;})[_0xa896('0x1e')](respondWithFilteredResult(_0x40cdec,_0x30d861))[_0xa896('0x27')](handleError(_0x40cdec,null));};exports[_0xa896('0x54')]=function(_0x2c57d2,_0x430b97){var _0x241b40={'raw':![],'where':{'id':_0x2c57d2['params']['id']},'include':[{'model':db[_0xa896('0x3b')],'as':_0xa896('0x3c')}]},_0x41125f={};_0x41125f[_0xa896('0x45')]=_[_0xa896('0x41')](db[_0xa896('0x50')][_0xa896('0x3d')]);_0x41125f[_0xa896('0x42')]=_[_0xa896('0x41')](_0x2c57d2['query']);_0x41125f['filters']=_['intersection'](_0x41125f[_0xa896('0x45')],_0x41125f[_0xa896('0x42')]);_0x241b40[_0xa896('0x46')]=_[_0xa896('0x44')](_0x41125f[_0xa896('0x45')],qs[_0xa896('0x47')](_0x2c57d2[_0xa896('0x42')][_0xa896('0x47')]));_0x241b40[_0xa896('0x46')]=_0x241b40['attributes'][_0xa896('0x55')]?_0x241b40['attributes']:_0x41125f[_0xa896('0x45')];if(_0x2c57d2[_0xa896('0x42')]['includeAll']){_0x241b40['include']=[{'all':!![]}];}_0x241b40=_[_0xa896('0x4d')]({},_0x241b40,_0x2c57d2[_0xa896('0x56')]);return db['SmsAccount'][_0xa896('0x57')](_0x241b40)[_0xa896('0x1e')](handleEntityNotFound(_0x430b97,null))[_0xa896('0x1e')](respondWithResult(_0x430b97,null))[_0xa896('0x27')](handleError(_0x430b97,null));};exports[_0xa896('0x58')]=function(_0x227a19,_0x1b2e21){return db['SmsAccount'][_0xa896('0x58')](_0x227a19[_0xa896('0x59')],{})[_0xa896('0x1e')](function(_0x1085f1){var _0x868ec5=_0x227a19[_0xa896('0x5a')][_0xa896('0x33')]({'plain':!![]});if(!_0x868ec5)throw new Error(_0xa896('0x5b'));if(_0x868ec5[_0xa896('0x5c')]===_0xa896('0x5a')){var _0x1834f1=_0x1085f1[_0xa896('0x33')]({'plain':!![]});var _0x5d8d30='SmsAccounts';return db['UserProfileSection'][_0xa896('0x57')]({'where':{'name':_0x5d8d30,'userProfileId':_0x868ec5[_0xa896('0x5d')]},'raw':!![]})[_0xa896('0x1e')](function(_0x19b2a1){if(_0x19b2a1&&_0x19b2a1[_0xa896('0x5e')]===0x0){return db['UserProfileResource'][_0xa896('0x58')]({'name':_0x1834f1[_0xa896('0x38')],'resourceId':_0x1834f1['id'],'type':_0x19b2a1['name'],'sectionId':_0x19b2a1['id']},{})[_0xa896('0x1e')](function(){return _0x1085f1;});}else{return _0x1085f1;}})[_0xa896('0x27')](function(_0x4c20a6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c20a6);throw _0x4c20a6;});}return _0x1085f1;})['then'](respondWithResult(_0x1b2e21,0xc9))['catch'](handleError(_0x1b2e21,null));};exports[_0xa896('0x5f')]=function(_0x40d511,_0xf7861a){if(_0x40d511[_0xa896('0x59')]['id']){delete _0x40d511['body']['id'];}return db['SmsAccount'][_0xa896('0x57')]({'where':{'id':_0x40d511[_0xa896('0x60')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xa896('0x1e')](handleEntityNotFound(_0xf7861a,null))[_0xa896('0x1e')](saveUpdates(_0x40d511[_0xa896('0x59')],null))[_0xa896('0x1e')](respondWithResult(_0xf7861a,null))['catch'](handleError(_0xf7861a,null));};exports[_0xa896('0x32')]=function(_0x1d046a,_0x38638d){return db[_0xa896('0x50')]['find']({'where':{'id':_0x1d046a['params']['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x38638d,null))['then'](removeEntity(_0x38638d,null))['catch'](handleError(_0x38638d,null));};exports[_0xa896('0x61')]=function(_0x5a3b54,_0x6706f6){return db['SmsAccount'][_0xa896('0x61')]()['then'](respondWithResult(_0x6706f6,null))[_0xa896('0x27')](handleError(_0x6706f6,null));};exports['addDisposition']=function(_0x21a0aa,_0x40e673,_0x266678){if(_0x21a0aa[_0xa896('0x59')]['id']){delete _0x21a0aa[_0xa896('0x59')]['id'];}return db['SmsAccount'][_0xa896('0x57')]({'where':{'id':_0x21a0aa[_0xa896('0x60')]['id']}})['then'](handleEntityNotFound(_0x40e673,null))[_0xa896('0x1e')](function(_0x50b752){if(_0x50b752){_0x21a0aa[_0xa896('0x59')][_0xa896('0x62')]=_0x50b752['id'];return db[_0xa896('0x63')][_0xa896('0x58')](_0x21a0aa[_0xa896('0x59')]);}})[_0xa896('0x1e')](respondWithResult(_0x40e673,null))['catch'](handleError(_0x40e673,null));};exports[_0xa896('0x64')]=function(_0xb6efd2,_0x20d73c,_0x510d31){var _0x1d92c1={'raw':![],'where':{}};var _0x41b06f={};var _0x18f9bf={'count':0x0,'rows':[]};return db[_0xa896('0x50')][_0xa896('0x65')]({'where':{'id':_0xb6efd2['params']['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x20d73c,null))[_0xa896('0x1e')](function(_0x426c9e){if(_0x426c9e){_0x41b06f[_0xa896('0x45')]=_[_0xa896('0x41')](db[_0xa896('0x63')]['rawAttributes']);_0x41b06f[_0xa896('0x42')]=_['keys'](_0xb6efd2[_0xa896('0x42')]);_0x41b06f[_0xa896('0x43')]=_[_0xa896('0x44')](_0x41b06f['model'],_0x41b06f[_0xa896('0x42')]);_0x1d92c1[_0xa896('0x46')]=_[_0xa896('0x44')](_0x41b06f['model'],qs[_0xa896('0x47')](_0xb6efd2[_0xa896('0x42')][_0xa896('0x47')]));_0x1d92c1[_0xa896('0x46')]=_0x1d92c1[_0xa896('0x46')][_0xa896('0x55')]?_0x1d92c1[_0xa896('0x46')]:_0x41b06f[_0xa896('0x45')];if(!_0xb6efd2[_0xa896('0x42')][_0xa896('0x48')](_0xa896('0x49'))){_0x1d92c1['limit']=qs[_0xa896('0x2d')](_0xb6efd2[_0xa896('0x42')][_0xa896('0x2d')]);_0x1d92c1[_0xa896('0x2b')]=qs['offset'](_0xb6efd2['query'][_0xa896('0x2b')]);}_0x1d92c1[_0xa896('0x66')]=qs[_0xa896('0x4a')](_0xb6efd2[_0xa896('0x42')]['sort']);_0x1d92c1['where']=qs[_0xa896('0x43')](_[_0xa896('0x4b')](_0xb6efd2[_0xa896('0x42')],_0x41b06f[_0xa896('0x43')]));_0x1d92c1[_0xa896('0x4c')][_0xa896('0x62')]=_0x426c9e['id'];if(_0xb6efd2['query'][_0xa896('0x4f')]){_0x1d92c1[_0xa896('0x4c')]=_[_0xa896('0x4d')](_0x1d92c1[_0xa896('0x4c')],{'$or':_[_0xa896('0x40')](_0x1d92c1[_0xa896('0x46')],function(_0x509f58){var _0x154fb9={};_0x154fb9[_0x509f58]={'$like':'%'+_0xb6efd2[_0xa896('0x42')][_0xa896('0x4f')]+'%'};return _0x154fb9;})});}_0x1d92c1=_[_0xa896('0x4d')]({},_0x1d92c1,_0xb6efd2['options']);return db['Disposition'][_0xa896('0x2e')]({'where':_0x1d92c1[_0xa896('0x4c')]})['then'](function(_0x480e04){_0x18f9bf['count']=_0x480e04;if(_0xb6efd2['query'][_0xa896('0x51')]){_0x1d92c1[_0xa896('0x52')]=[{'all':!![]}];}return db[_0xa896('0x63')][_0xa896('0x67')](_0x1d92c1);})['then'](function(_0x1d86ef){_0x18f9bf['rows']=_0x1d86ef;return _0x18f9bf;});}})[_0xa896('0x1e')](respondWithFilteredResult(_0x20d73c,_0x1d92c1))[_0xa896('0x27')](handleError(_0x20d73c,null));};exports[_0xa896('0x68')]=function(_0x197248,_0x2cc589,_0x273fd9){return db['SmsAccount'][_0xa896('0x57')]({'where':{'id':_0x197248[_0xa896('0x60')]['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x2cc589,null))['then'](function(_0x39e7b3){if(_0x39e7b3){return _0x39e7b3[_0xa896('0x68')](_0x197248[_0xa896('0x42')][_0xa896('0x69')]);}})[_0xa896('0x1e')](respondWithStatusCode(_0x2cc589,null))[_0xa896('0x27')](handleError(_0x2cc589,null));};exports[_0xa896('0x6a')]=function(_0x53e365,_0x3e0c42,_0x38b4e5){if(_0x53e365[_0xa896('0x59')]['id']){delete _0x53e365[_0xa896('0x59')]['id'];}return db[_0xa896('0x50')][_0xa896('0x57')]({'where':{'id':_0x53e365['params']['id']}})['then'](handleEntityNotFound(_0x3e0c42,null))['then'](function(_0x434d1d){if(_0x434d1d){_0x53e365['body'][_0xa896('0x62')]=_0x434d1d['id'];return db['CannedAnswer'][_0xa896('0x58')](_0x53e365[_0xa896('0x59')]);}})['then'](respondWithResult(_0x3e0c42,null))[_0xa896('0x27')](handleError(_0x3e0c42,null));};exports['getAnswers']=function(_0x55729e,_0x2b9319,_0x49c816){var _0x16bc34={'raw':![],'where':{}};var _0x4dd16e={};var _0x253f9f={'count':0x0,'rows':[]};return db[_0xa896('0x50')][_0xa896('0x65')]({'where':{'id':_0x55729e['params']['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x2b9319,null))['then'](function(_0x1bb830){if(_0x1bb830){_0x4dd16e[_0xa896('0x45')]=_[_0xa896('0x41')](db[_0xa896('0x6b')][_0xa896('0x3d')]);_0x4dd16e['query']=_[_0xa896('0x41')](_0x55729e[_0xa896('0x42')]);_0x4dd16e[_0xa896('0x43')]=_['intersection'](_0x4dd16e['model'],_0x4dd16e[_0xa896('0x42')]);_0x16bc34[_0xa896('0x46')]=_[_0xa896('0x44')](_0x4dd16e[_0xa896('0x45')],qs[_0xa896('0x47')](_0x55729e[_0xa896('0x42')][_0xa896('0x47')]));_0x16bc34[_0xa896('0x46')]=_0x16bc34[_0xa896('0x46')]['length']?_0x16bc34[_0xa896('0x46')]:_0x4dd16e[_0xa896('0x45')];if(!_0x55729e[_0xa896('0x42')][_0xa896('0x48')](_0xa896('0x49'))){_0x16bc34[_0xa896('0x2d')]=qs[_0xa896('0x2d')](_0x55729e['query'][_0xa896('0x2d')]);_0x16bc34[_0xa896('0x2b')]=qs['offset'](_0x55729e[_0xa896('0x42')][_0xa896('0x2b')]);}_0x16bc34['order']=qs[_0xa896('0x4a')](_0x55729e[_0xa896('0x42')][_0xa896('0x4a')]);_0x16bc34[_0xa896('0x4c')]=qs[_0xa896('0x43')](_['pick'](_0x55729e[_0xa896('0x42')],_0x4dd16e['filters']));_0x16bc34[_0xa896('0x4c')][_0xa896('0x62')]=_0x1bb830['id'];if(_0x55729e[_0xa896('0x42')]['filter']){_0x16bc34[_0xa896('0x4c')]=_[_0xa896('0x4d')](_0x16bc34[_0xa896('0x4c')],{'$or':_[_0xa896('0x40')](_0x16bc34[_0xa896('0x46')],function(_0x20301f){var _0x358803={};_0x358803[_0x20301f]={'$like':'%'+_0x55729e[_0xa896('0x42')][_0xa896('0x4f')]+'%'};return _0x358803;})});}_0x16bc34=_['merge']({},_0x16bc34,_0x55729e[_0xa896('0x56')]);return db[_0xa896('0x6b')][_0xa896('0x2e')]({'where':_0x16bc34[_0xa896('0x4c')]})['then'](function(_0x3a97c9){_0x253f9f[_0xa896('0x2e')]=_0x3a97c9;if(_0x55729e['query'][_0xa896('0x51')]){_0x16bc34[_0xa896('0x52')]=[{'all':!![]}];}return db[_0xa896('0x6b')][_0xa896('0x67')](_0x16bc34);})[_0xa896('0x1e')](function(_0x17b367){_0x253f9f[_0xa896('0x53')]=_0x17b367;return _0x253f9f;});}})[_0xa896('0x1e')](respondWithFilteredResult(_0x2b9319,_0x16bc34))[_0xa896('0x27')](handleError(_0x2b9319,null));};exports[_0xa896('0x6c')]=function(_0x45e52b,_0x3619f5,_0x2bee0c){return db['SmsAccount'][_0xa896('0x57')]({'where':{'id':_0x45e52b[_0xa896('0x60')]['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x3619f5,null))[_0xa896('0x1e')](function(_0x18a5c0){if(_0x18a5c0){return _0x18a5c0[_0xa896('0x6c')](_0x45e52b['query'][_0xa896('0x69')]);}})[_0xa896('0x1e')](respondWithStatusCode(_0x3619f5,null))[_0xa896('0x27')](handleError(_0x3619f5,null));};exports[_0xa896('0x6d')]=function(_0x1f1951,_0x59a33e,_0x21a6f6){var _0x5645b3={'channel':_0xa896('0x6e')};var _0x597a=[];var _0x1ba0a4=[];var _0x382fd5={};return db[_0xa896('0x50')][_0xa896('0x57')]({'where':{'id':_0x1f1951['params']['id']},'include':[{'model':db[_0xa896('0x6f')],'as':_0xa896('0x70')}]})[_0xa896('0x1e')](handleEntityNotFound(_0x59a33e,null))['then'](function(_0x429e31){_0x5645b3[_0xa896('0x71')]=_0x429e31;_0x5645b3[_0xa896('0x72')]=_[_0xa896('0x73')](_0x429e31[_0xa896('0x70')],[_0xa896('0x74')],[_0xa896('0x75')]);if(_0x5645b3[_0xa896('0x71')][_0xa896('0x70')]){delete _0x5645b3[_0xa896('0x71')][_0xa896('0x70')];}return db[_0xa896('0x76')][_0xa896('0x61')]();})[_0xa896('0x1e')](function(_0x2525ba){if(!_0x2525ba){throw new db[(_0xa896('0x77'))][(_0xa896('0x78'))](_0xa896('0x79'));}_0x597a=_['difference'](_['keys'](_0x2525ba),['createdAt',_0xa896('0x7a')]);_0x1ba0a4=_[_0xa896('0x7b')](_['keys'](_0x2525ba),[_0xa896('0x7c'),'updatedAt',_0xa896('0x7d'),_0xa896('0x7e')]);_0x5645b3[_0xa896('0x59')]={'mapKey':_0xa896('0x7f')};if(_0x5645b3[_0xa896('0x71')][_0xa896('0x3f')]){switch(_0x5645b3[_0xa896('0x71')][_0xa896('0x3f')]){case _0xa896('0x80'):_0x5645b3[_0xa896('0x59')][_0xa896('0x81')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x82')];_0x5645b3['body'][_0xa896('0x59')]=_0x1f1951['body'][_0xa896('0x83')];_0x5645b3['body'][_0xa896('0x84')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x85')];break;case'skebby':_0x5645b3[_0xa896('0x59')][_0xa896('0x81')]='+'+_0x1f1951[_0xa896('0x59')][_0xa896('0x86')];_0x5645b3[_0xa896('0x59')]['body']=_0x1f1951[_0xa896('0x59')][_0xa896('0x87')];break;case _0xa896('0x88'):_0x5645b3[_0xa896('0x59')]['from']=_0x1f1951[_0xa896('0x59')][_0xa896('0x81')];_0x5645b3[_0xa896('0x59')][_0xa896('0x59')]=_0x1f1951['body']['message'];break;case _0xa896('0x89'):_0x5645b3['body']['from']=_0x1f1951[_0xa896('0x59')]['from'];_0x5645b3[_0xa896('0x59')][_0xa896('0x59')]=_0x1f1951['body'][_0xa896('0x59')];_0x5645b3[_0xa896('0x59')][_0xa896('0x84')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x8a')];break;case _0xa896('0x8b'):_0x5645b3[_0xa896('0x59')][_0xa896('0x81')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x82')];_0x5645b3[_0xa896('0x59')][_0xa896('0x59')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x8c')];_0x5645b3[_0xa896('0x59')][_0xa896('0x84')]=_0x1f1951['body']['MessageUUID'];break;case'infobip':_0x5645b3[_0xa896('0x59')][_0xa896('0x81')]='+'+_0x1f1951[_0xa896('0x59')]['results'][0x0][_0xa896('0x81')];_0x5645b3[_0xa896('0x59')]['body']=_0x1f1951[_0xa896('0x59')][_0xa896('0x8d')][0x0][_0xa896('0x87')];_0x5645b3['body'][_0xa896('0x84')]=_0x1f1951[_0xa896('0x59')]['results'][0x0][_0xa896('0x84')];break;case _0xa896('0x8e'):_0x5645b3[_0xa896('0x59')][_0xa896('0x81')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x8f')];_0x5645b3[_0xa896('0x59')][_0xa896('0x59')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x90')]['message'];break;case'clickatell':_0x5645b3[_0xa896('0x59')][_0xa896('0x81')]=_0x1f1951[_0xa896('0x59')]['fromNumber'];_0x5645b3[_0xa896('0x59')][_0xa896('0x59')]=_0x1f1951['body'][_0xa896('0x87')];_0x5645b3[_0xa896('0x59')]['messageId']=_0x1f1951[_0xa896('0x59')][_0xa896('0x91')];break;case _0xa896('0x92'):_0x5645b3['body'][_0xa896('0x84')]=_0x1f1951[_0xa896('0x59')][0x0][_0xa896('0x25')]['id'];_0x5645b3[_0xa896('0x59')]['from']=_0x1f1951['body'][0x0][_0xa896('0x25')][_0xa896('0x81')];_0x5645b3[_0xa896('0x59')][_0xa896('0x59')]=_0x1f1951[_0xa896('0x59')][0x0][_0xa896('0x25')]['text'];break;case _0xa896('0x93'):_0x5645b3[_0xa896('0x59')][_0xa896('0x81')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x81')];_0x5645b3[_0xa896('0x59')][_0xa896('0x59')]=_0x1f1951[_0xa896('0x59')][_0xa896('0x25')];_0x5645b3[_0xa896('0x59')][_0xa896('0x84')]=_0x1f1951[_0xa896('0x59')]['refid'];break;}}if(_0x5645b3[_0xa896('0x59')]['id']){delete _0x5645b3[_0xa896('0x59')]['id'];}if(_[_0xa896('0x94')](_0x5645b3[_0xa896('0x59')][_0xa896('0x81')])){throw new db[(_0xa896('0x77'))]['ValidationError'](_0xa896('0x95'));}if(_[_0xa896('0x94')](_0x5645b3['body'][_0xa896('0x59')])||_0x5645b3[_0xa896('0x59')]['body']===''){throw new db[(_0xa896('0x77'))][(_0xa896('0x78'))](_0xa896('0x96'));}if(_[_0xa896('0x94')](_0x5645b3[_0xa896('0x59')][_0xa896('0x97')])){throw new db['Sequelize'][(_0xa896('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ba0a4);}if(!_[_0xa896('0x98')](_0x1ba0a4,_0x5645b3[_0xa896('0x59')]['mapKey'])){throw new db[(_0xa896('0x77'))][(_0xa896('0x78'))](_0xa896('0x99')+_0x1ba0a4);}_0x382fd5[_0x5645b3[_0xa896('0x59')][_0xa896('0x97')]]=_0x5645b3[_0xa896('0x59')][_0xa896('0x81')];return db[_0xa896('0x9a')][_0xa896('0x57')]({'where':{'id':_0x5645b3[_0xa896('0x71')][_0xa896('0x7e')]},'include':[{'model':db['CmContact'],'as':_0xa896('0x9b'),'where':_0x382fd5,'limit':0x1,'order':[['updatedAt',_0xa896('0x9c')]]}]});})[_0xa896('0x1e')](handleEntityNotFound(_0x59a33e,null))[_0xa896('0x1e')](function(_0x29e8da){if(_0x29e8da){_0x5645b3[_0xa896('0x9d')]=_['omit'](_0x29e8da,[_0xa896('0x9b')]);if(_0x29e8da[_0xa896('0x9b')][_0xa896('0x55')]){return _0x29e8da[_0xa896('0x9b')][0x0];}var _0x19e01d=_[_0xa896('0x16')](_0x5645b3[_0xa896('0x59')],{'firstName':_0x5645b3['body'][_0xa896('0x81')],'ListId':_0x29e8da['id']});_0x19e01d[_0x5645b3['body'][_0xa896('0x97')]]=_0x5645b3[_0xa896('0x59')]['from'];return db[_0xa896('0x76')][_0xa896('0x58')](_0x19e01d,{'fields':_0x597a,'raw':!![]});}})['then'](handleEntityNotFound(_0x59a33e,null))[_0xa896('0x1e')](function(_0x242374){if(_0x242374){_0x5645b3['contact']=_0x242374;var _0x283cea={'ContactId':_0x242374['id'],'phone':_0x5645b3['body'][_0xa896('0x81')],'SmsAccountId':_0x1f1951[_0xa896('0x60')]['id']};var _0x58d6fc={'ContactId':_0x242374['id'],'SmsAccountId':_0x1f1951[_0xa896('0x60')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x58d6fc})[_0xa896('0x1e')](function(_0x5a96ad){if(_0x5a96ad){return[_0x5a96ad,![]];}return db[_0xa896('0x9e')][_0xa896('0x58')](_0x283cea)['then'](function(_0x228f3c){return[_0x228f3c,!![]];});});}})[_0xa896('0x9f')](function(_0x255e76,_0x2f08ee){_0x5645b3[_0xa896('0xa0')]=_0x255e76[_0xa896('0x33')]({'plain':!![]});_0x5645b3[_0xa896('0xa0')][_0xa896('0xa1')]=![];if(_0x2f08ee){if(_0x5645b3[_0xa896('0x71')]['autoclose']){_0x5645b3[_0xa896('0x72')][_0xa896('0xa2')]({'id':0x0,'priority':_0x5645b3[_0xa896('0x72')][_0xa896('0x55')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xa896('0xa3')});}_0x5645b3[_0xa896('0xa0')][_0xa896('0xa1')]=!![];}return db[_0xa896('0xa4')][_0xa896('0x58')]({'phone':_0x5645b3[_0xa896('0x59')][_0xa896('0x81')],'messageId':_0x5645b3[_0xa896('0x59')][_0xa896('0x84')],'body':_0x5645b3[_0xa896('0x59')][_0xa896('0x59')],'SmsAccountId':_0x1f1951[_0xa896('0x60')]['id'],'SmsInteractionId':_0x255e76['id'],'direction':'in','ContactId':_0x255e76['ContactId'],'AttachmentId':_0x5645b3[_0xa896('0x59')][_0xa896('0xa5')]});})['then'](function(_0x366a94){_0x5645b3[_0xa896('0x25')]=_0x366a94;if(_0x5645b3[_0xa896('0xa0')][_0xa896('0xa6')]){return db['User'][_0xa896('0x57')]({'attributes':['id',_0xa896('0x38')],'where':{'id':_0x5645b3[_0xa896('0xa0')][_0xa896('0xa6')]}})['then'](function(_0x7289ef){if(_0x7289ef){_0x5645b3[_0xa896('0x72')][_0xa896('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x7289ef['name']+','+(_0x5645b3['account'][_0xa896('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa896('0xa9'),'startRouting',_0x5645b3);});}return respondWithRpcPromise(_0xa896('0xa9'),_0xa896('0xaa'),_0x5645b3);})[_0xa896('0x1e')](function(_0x3918be){if(_0x3918be){var _0x239b3f=0xc8;var _0x3c1eeb='receiveMessage';logger['info'](_0xa896('0xab'),_0x3c1eeb,_0x239b3f,_0xa896('0xac'));logger[_0xa896('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3c1eeb,_0x239b3f,_0xa896('0xac'),JSON[_0xa896('0xad')](_0x3918be));if(_0x5645b3['account']['type']===_0xa896('0x80')){return _0x59a33e[_0xa896('0x28')](_0x239b3f)[_0xa896('0x2f')](_0xa896('0xae'),_0xa896('0xaf'))[_0xa896('0x39')]('\x0a');}else{return _0x59a33e[_0xa896('0x28')](_0x239b3f)['json'](_0x3918be);}}})['catch'](handleError(_0x59a33e,null));};exports[_0xa896('0xb0')]=function(_0x2b5965,_0xe2113d){var _0x506431=_0x2b5965[_0xa896('0x60')]['id'];var _0x5afcdc=_0x2b5965[_0xa896('0x59')];var _0xe8e355=0xc8;var _0x3eccae=null;return db['sequelize'][_0xa896('0xb1')]({'isolationLevel':db[_0xa896('0xb2')]['Transaction'][_0xa896('0xb3')][_0xa896('0xb4')]},function(_0x231926){return db[_0xa896('0x50')]['findOne']({'where':{'id':_0x506431},'transaction':_0x231926})['then'](function(_0x544c05){if(_0x544c05){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x506431},'transaction':_0x231926})['then'](function(){var _0x4d822a=_[_0xa896('0x40')](_0x5afcdc,function(_0x437c4a){_0x437c4a[_0xa896('0x62')]=_0x506431;return _0x437c4a;});return db[_0xa896('0x6f')][_0xa896('0xb5')](_0x4d822a,{'transaction':_0x231926});});}else{_0xe8e355=0x194;_0x3eccae=[];}});})[_0xa896('0x1e')](function(){if(_0xe8e355!==0x194){return db[_0xa896('0x6f')][_0xa896('0xb6')]({'where':{'SmsAccountId':_0x506431},'order':_0xa896('0x74')})[_0xa896('0x1e')](function(_0x389b29){_0x3eccae=_0x389b29;});}})[_0xa896('0x27')](function(_0x2e1e10){_0xe8e355=0x1f4;logger[_0xa896('0x23')](_0x2e1e10[_0xa896('0x37')]);if(_0x2e1e10[_0xa896('0x38')]){delete _0x2e1e10[_0xa896('0x38')];}_0x3eccae=_0x2e1e10;})['finally'](function(){if(_0x3eccae===null){_0xe2113d[_0xa896('0x36')](_0xe8e355);}else{if(_0xe8e355===0x1f4){_0xe2113d[_0xa896('0x28')](_0xe8e355)[_0xa896('0x39')](_0x3eccae);}else{_0xe2113d[_0xa896('0x28')](_0xe8e355)[_0xa896('0x2a')](_0x3eccae);}}});};exports[_0xa896('0xb7')]=function(_0x58b94b,_0x149092,_0x16807c){var _0x187568={};var _0x53641b={};var _0x33ab0d;var _0x54f8ee;return db[_0xa896('0x50')][_0xa896('0x65')]({'where':{'id':_0x58b94b[_0xa896('0x60')]['id']}})['then'](handleEntityNotFound(_0x149092,null))[_0xa896('0x1e')](function(_0x17e5f4){if(_0x17e5f4){_0x33ab0d=_0x17e5f4;_0x53641b[_0xa896('0x45')]=_[_0xa896('0x41')](db['SmsApplication'][_0xa896('0x3d')]);_0x53641b['query']=_[_0xa896('0x41')](_0x58b94b[_0xa896('0x42')]);_0x53641b[_0xa896('0x43')]=_[_0xa896('0x44')](_0x53641b['model'],_0x53641b[_0xa896('0x42')]);_0x187568['attributes']=_[_0xa896('0x44')](_0x53641b[_0xa896('0x45')],qs['fields'](_0x58b94b['query'][_0xa896('0x47')]));_0x187568['attributes']=_0x187568['attributes'][_0xa896('0x55')]?_0x187568[_0xa896('0x46')]:_0x53641b[_0xa896('0x45')];_0x187568[_0xa896('0x66')]=qs[_0xa896('0x4a')](_0x58b94b[_0xa896('0x42')]['sort']);_0x187568[_0xa896('0x4c')]=qs['filters'](_[_0xa896('0x4b')](_0x58b94b[_0xa896('0x42')],_0x53641b[_0xa896('0x43')]));if(_0x58b94b[_0xa896('0x42')][_0xa896('0x4f')]){_0x187568[_0xa896('0x4c')]=_[_0xa896('0x4d')](_0x187568[_0xa896('0x4c')],{'$or':_[_0xa896('0x40')](_0x187568['attributes'],function(_0x23d54a){var _0x2ef999={};_0x2ef999[_0x23d54a]={'$like':'%'+_0x58b94b['query'][_0xa896('0x4f')]+'%'};return _0x2ef999;})});}_0x187568=_[_0xa896('0x4d')]({},_0x187568,_0x58b94b[_0xa896('0x56')]);return _0x33ab0d[_0xa896('0xb7')](_0x187568);}})[_0xa896('0x1e')](function(_0xe46fbb){if(_0xe46fbb){_0x54f8ee=_0xe46fbb[_0xa896('0x55')];if(!_0x58b94b[_0xa896('0x42')][_0xa896('0x48')](_0xa896('0x49'))){_0x187568[_0xa896('0x2d')]=qs[_0xa896('0x2d')](_0x58b94b[_0xa896('0x42')]['limit']);_0x187568[_0xa896('0x2b')]=qs[_0xa896('0x2b')](_0x58b94b[_0xa896('0x42')][_0xa896('0x2b')]);}return _0x33ab0d[_0xa896('0xb7')](_0x187568);}})['then'](function(_0x666f9){if(_0x666f9){return _0x666f9?{'count':_0x54f8ee,'rows':_0x666f9}:null;}})[_0xa896('0x1e')](respondWithResult(_0x149092,null))[_0xa896('0x27')](handleError(_0x149092,null));};exports['getInteractions']=function(_0x542ac3,_0x2dd809,_0x111e5d){var _0x386d75={'raw':![],'where':{}};var _0x43355f={};var _0x296bac={'count':0x0,'rows':[]};return db[_0xa896('0x50')][_0xa896('0x65')]({'where':{'id':_0x542ac3[_0xa896('0x60')]['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x2dd809,null))['then'](function(_0x269a51){if(_0x269a51){_0x43355f['model']=_[_0xa896('0x41')](db[_0xa896('0x9e')][_0xa896('0x3d')]);_0x43355f[_0xa896('0x42')]=_['keys'](_0x542ac3[_0xa896('0x42')]);_0x43355f[_0xa896('0x43')]=_[_0xa896('0x44')](_0x43355f[_0xa896('0x45')],_0x43355f[_0xa896('0x42')]);_0x386d75[_0xa896('0x46')]=_['intersection'](_0x43355f[_0xa896('0x45')],qs[_0xa896('0x47')](_0x542ac3[_0xa896('0x42')][_0xa896('0x47')]));_0x386d75[_0xa896('0x46')]=_0x386d75[_0xa896('0x46')][_0xa896('0x55')]?_0x386d75[_0xa896('0x46')]:_0x43355f['model'];if(!_0x542ac3[_0xa896('0x42')][_0xa896('0x48')](_0xa896('0x49'))){_0x386d75['limit']=qs[_0xa896('0x2d')](_0x542ac3[_0xa896('0x42')][_0xa896('0x2d')]);_0x386d75[_0xa896('0x2b')]=qs[_0xa896('0x2b')](_0x542ac3[_0xa896('0x42')][_0xa896('0x2b')]);}_0x386d75[_0xa896('0x66')]=qs[_0xa896('0x4a')](_0x542ac3[_0xa896('0x42')][_0xa896('0x4a')]);_0x386d75['where']=qs['filters'](_[_0xa896('0x4b')](_0x542ac3[_0xa896('0x42')],_0x43355f[_0xa896('0x43')]));_0x386d75[_0xa896('0x4c')][_0xa896('0x62')]=_0x269a51['id'];if(_0x542ac3[_0xa896('0x42')]['filter']){_0x386d75['where']=_[_0xa896('0x4d')](_0x386d75[_0xa896('0x4c')],{'$or':_[_0xa896('0x40')](_0x386d75['attributes'],function(_0xc15e74){var _0x1fef58={};_0x1fef58[_0xc15e74]={'$like':'%'+_0x542ac3[_0xa896('0x42')]['filter']+'%'};return _0x1fef58;})});}_0x386d75=_[_0xa896('0x4d')]({},_0x386d75,_0x542ac3['options']);return db[_0xa896('0x9e')][_0xa896('0x2e')]({'where':_0x386d75[_0xa896('0x4c')]})[_0xa896('0x1e')](function(_0x1afcd2){_0x296bac['count']=_0x1afcd2;if(_0x542ac3[_0xa896('0x42')][_0xa896('0x51')]){_0x386d75[_0xa896('0x52')]=[{'model':db[_0xa896('0x76')],'as':'Contact','required':![]},{'model':db[_0xa896('0xb8')],'as':_0xa896('0xb9'),'attributes':[_0xa896('0x38'),_0xa896('0xba'),_0xa896('0xbb')],'required':![]},{'model':db[_0xa896('0xbc')],'as':_0xa896('0xbd'),'attributes':['id',_0xa896('0x38'),_0xa896('0xbe')],'where':_0x542ac3[_0xa896('0x42')][_0xa896('0xbf')]?{'id':_0x542ac3[_0xa896('0x42')][_0xa896('0xbf')]}:undefined,'required':_0x542ac3['query'][_0xa896('0xbf')]?!![]:![]}];}return db[_0xa896('0x9e')][_0xa896('0x67')](_0x386d75);})['then'](function(_0x54ab7f){_0x296bac[_0xa896('0x53')]=_0x54ab7f;return _0x296bac;});}})[_0xa896('0x1e')](respondWithFilteredResult(_0x2dd809,_0x386d75))[_0xa896('0x27')](handleError(_0x2dd809,null));};exports[_0xa896('0x39')]=function(_0x57ff75,_0x1ead26,_0x5e254a){var _0x34a4d7,_0xe89f06,_0x4777af;if(_[_0xa896('0x94')](_0x57ff75['body']['body'])||_0x57ff75[_0xa896('0x59')][_0xa896('0x59')]===''){throw new db[(_0xa896('0x77'))][(_0xa896('0x78'))](_0xa896('0x96'));}if(_[_0xa896('0x94')](_0x57ff75[_0xa896('0x59')]['to'])){throw new db[(_0xa896('0x77'))][(_0xa896('0x78'))](_0xa896('0xc0'));}_0x34a4d7=_0x57ff75['body']['to'];return db['SmsAccount'][_0xa896('0x57')]({'where':{'id':_0x57ff75[_0xa896('0x60')]['id']},'include':[{'model':db[_0xa896('0x9a')],'as':_0xa896('0xc1'),'include':[{'model':db[_0xa896('0x76')],'as':_0xa896('0x9b'),'where':{'mobile':_0x34a4d7},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xa896('0x1e')](handleEntityNotFound(_0x1ead26,null))[_0xa896('0x1e')](function(_0x3dd32e){if(_0x3dd32e&&_0x3dd32e[_0xa896('0xc1')]){_0xe89f06=_0x3dd32e[_0xa896('0x33')]({'plain':!![]});if(_0xe89f06[_0xa896('0xc1')]&&_0xe89f06[_0xa896('0xc1')]['Contacts'][_0xa896('0x55')]){return _0xe89f06[_0xa896('0xc1')]['Contacts'][0x0];}return db[_0xa896('0x76')][_0xa896('0x58')](_[_0xa896('0x16')](_0x57ff75[_0xa896('0x59')],{'firstName':_0x34a4d7,'mobile':_0x34a4d7,'phone':_0x34a4d7,'ListId':_0xe89f06['ListId']}));}})[_0xa896('0x1e')](handleEntityNotFound(_0x1ead26,null))[_0xa896('0x1e')](function(_0x3ae6a6){if(_0x3ae6a6){_0x4777af=_0x3ae6a6;return db[_0xa896('0x9e')][_0xa896('0x57')]({'where':{'ContactId':_0x4777af['id'],'closed':![],'SmsAccountId':_0xe89f06['id']}})[_0xa896('0x1e')](function(_0x537aaf){if(_0x537aaf){return[_0x537aaf,![]];}return db[_0xa896('0x9e')][_0xa896('0x58')]({'UserId':_0x57ff75[_0xa896('0x5a')]['id'],'ContactId':_0x4777af['id'],'SmsAccountId':_0xe89f06['id'],'phone':_0x34a4d7,'firstMsgDirection':_0xa896('0xc2'),'Messages':[_[_0xa896('0x4d')](_0x57ff75['body'],{'read':![],'body':_0x57ff75[_0xa896('0x59')][_0xa896('0x59')],'phone':_0x34a4d7,'SmsAccountId':_0xe89f06['id'],'UserId':_0x57ff75['user']['id'],'ContactId':_0x4777af['id']})]},{'include':[{'model':db[_0xa896('0xa4')],'as':_0xa896('0xc3')}]})['then'](function(_0x7ec3c4){return[_0x7ec3c4,!![]];});});}})[_0xa896('0x9f')](function(_0x306364,_0x33e9f5){if(_0x33e9f5){return _0x306364;}return db['SmsMessage']['create'](_[_0xa896('0x4d')](_0x57ff75[_0xa896('0x59')],{'read':![],'body':_0x57ff75[_0xa896('0x59')][_0xa896('0x59')],'phone':_0x34a4d7,'SmsAccountId':_0xe89f06['id'],'SmsInteractionId':_0x306364['id'],'UserId':_0x57ff75[_0xa896('0x5a')]['id'],'ContactId':_0x4777af['id']}))[_0xa896('0x1e')](function(_0x5dedca){_0x306364[_0xa896('0xc4')][_0xa896('0xc3')]=[];_0x306364[_0xa896('0xc4')][_0xa896('0xc3')]['push'](_0x5dedca[_0xa896('0xc4')]);return _0x306364;});})[_0xa896('0x1e')](respondWithResult(_0x1ead26,null))[_0xa896('0x27')](handleError(_0x1ead26,null));};exports[_0xa896('0x28')]=function(_0x209aa2,_0x45cc9d,_0x569323){if(_0x209aa2['body']['id']){delete _0x209aa2['body']['id'];}var _0x1b289b,_0x5c34cc,_0x1d7f56;return db[_0xa896('0x50')][_0xa896('0x57')]({'where':{'id':_0x209aa2['params']['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x45cc9d,null))[_0xa896('0x1e')](function(_0x250276){if(_0x250276){_0x1d7f56=_0x250276;logger[_0xa896('0x22')](_0xa896('0xab'),_0xa896('0x28'),_0xa896('0xc5'),_0x250276['type'],util[_0xa896('0xc6')](_0x209aa2[_0xa896('0x59')],{'showHidden':![],'depth':null}));switch(_0x250276['type']){case _0xa896('0xc7'):if(_0x209aa2['body'][_0xa896('0xc8')]&&_0x209aa2[_0xa896('0x59')]['status']){_0x5c34cc=_0x209aa2[_0xa896('0x59')][_0xa896('0x28')];return db[_0xa896('0xa4')][_0xa896('0x57')]({'where':{'messageId':_0x209aa2['body']['skebby_dispatch_id']}});}break;case _0xa896('0x88'):if(_0x209aa2['body'][_0xa896('0xc9')]&&_0x209aa2[_0xa896('0x59')][_0xa896('0xca')]){_0x5c34cc=_0x209aa2[_0xa896('0x59')][_0xa896('0xca')];return db[_0xa896('0xa4')][_0xa896('0x57')]({'where':{'messageId':_0x209aa2[_0xa896('0x59')][_0xa896('0xc9')]}});}break;case _0xa896('0x89'):if(_0x209aa2[_0xa896('0x59')][_0xa896('0x8a')]&&_0x209aa2[_0xa896('0x59')][_0xa896('0xcb')]){_0x5c34cc=_0x209aa2[_0xa896('0x59')][_0xa896('0xcb')];return db[_0xa896('0xa4')][_0xa896('0x57')]({'where':{'messageId':_0x209aa2['body'][_0xa896('0x8a')]}});}break;case'infobip':var _0x26b8e6=_0x209aa2[_0xa896('0x59')][_0xa896('0x8d')][0x0];if(_0x26b8e6[_0xa896('0x84')]&&_0x26b8e6[_0xa896('0x28')]['groupName']===_0xa896('0xcc')){_0x5c34cc=_0x26b8e6['status'][_0xa896('0xcd')];return db[_0xa896('0xa4')]['find']({'where':{'messageId':_0x26b8e6[_0xa896('0x84')]}});}break;case _0xa896('0xce'):if(_0x209aa2[_0xa896('0x59')][_0xa896('0x84')]&&_0x209aa2['body'][_0xa896('0x28')]){_0x5c34cc=_0x209aa2[_0xa896('0x59')][_0xa896('0x28')];return db['SmsMessage'][_0xa896('0x57')]({'where':{'messageId':_0x209aa2['body'][_0xa896('0x84')]}});}break;case _0xa896('0x92'):if(_0x209aa2[_0xa896('0x59')][0x0]['message']['id']){_0x5c34cc=_0x209aa2[_0xa896('0x59')][0x0][_0xa896('0x3f')];return db[_0xa896('0xa4')][_0xa896('0x57')]({'where':{'messageId':_0x209aa2[_0xa896('0x59')][0x0][_0xa896('0x25')]['id']}});}break;case _0xa896('0x93'):if(_0x209aa2[_0xa896('0x59')][_0xa896('0xcf')]&&_0x209aa2['body'][_0xa896('0x28')]){_0x5c34cc=_0x209aa2[_0xa896('0x59')][_0xa896('0x28')];return db[_0xa896('0xa4')][_0xa896('0x57')]({'where':{'messageId':_0x209aa2[_0xa896('0x59')][_0xa896('0xcf')]}});}break;}}})[_0xa896('0x1e')](handleEntityNotFound(_0x45cc9d,null))[_0xa896('0x1e')](function(_0x291252){if(_0x291252){_0x1b289b=_0x291252;switch(_0x1d7f56['type']){case _0xa896('0xc7'):if(_0x5c34cc===_0xa896('0xcc')){return _0x1b289b[_0xa896('0x5f')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa896('0x28'),_0xa896('0xc7'),util[_0xa896('0xc6')](_0x209aa2['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x5c34cc==='1'){return _0x1b289b[_0xa896('0x5f')]({'read':!![]});}else{logger[_0xa896('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa896('0x28'),'skebby',util[_0xa896('0xc6')](_0x209aa2[_0xa896('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa896('0x89'):if(!_0x209aa2['body'][_0xa896('0xd0')]&&_0x5c34cc>=0xc8&&_0x5c34cc<=0xce){return _0x1b289b[_0xa896('0x5f')]({'read':!![]});}else{logger['error'](_0xa896('0xab'),_0xa896('0x28'),_0xa896('0x89'),util[_0xa896('0xc6')](_0x209aa2[_0xa896('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa896('0xd1'):var _0x1f0991=_0x209aa2['body'][_0xa896('0x8d')][0x0];if(_0x1f0991[_0xa896('0x28')][_0xa896('0xcd')]==='DELIVERED'){return _0x1b289b['update']({'read':!![]});}else{logger[_0xa896('0x23')](_0xa896('0xab'),_0xa896('0x28'),'infobip',util[_0xa896('0xc6')](_0x209aa2[_0xa896('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa896('0xce'):if(_0x5c34cc==_0xa896('0xd2')||_0x5c34cc==_0xa896('0xd3')){return _0x1b289b[_0xa896('0x5f')]({'read':!![]});}else{logger[_0xa896('0x23')](_0xa896('0xab'),'status',_0xa896('0xce'),util[_0xa896('0xc6')](_0x209aa2['body'],{'showHidden':![],'depth':null}));}break;case _0xa896('0x92'):if(_0x5c34cc=='message-delivered'){return _0x1b289b[_0xa896('0x5f')]({'read':!![]});}else{logger[_0xa896('0x23')](_0xa896('0xab'),_0xa896('0x28'),_0xa896('0x92'),util[_0xa896('0xc6')](_0x209aa2[_0xa896('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa896('0x93'):if(_0x5c34cc===_0xa896('0xd4')||_0x5c34cc==='ACCEPTD'){return _0x1b289b[_0xa896('0x5f')]({'read':!![]});}else{logger['error'](_0xa896('0xab'),_0xa896('0x28'),_0xa896('0x93'),util[_0xa896('0xc6')](_0x209aa2[_0xa896('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1b289b;}})['then'](respondWithResult(_0x45cc9d,null))[_0xa896('0x27')](handleError(_0x45cc9d,null));};exports[_0xa896('0xd5')]=function(_0x1658a0,_0xc9aa06,_0x44fc62){var _0x5e660e,_0x5486fc,_0xc3514d;return db[_0xa896('0x50')][_0xa896('0x57')]({'where':{'id':_0x1658a0[_0xa896('0x60')]['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0xc9aa06,null))[_0xa896('0x1e')](function(_0x34f5b9){if(_0x34f5b9){_0xc3514d=_0x34f5b9;logger[_0xa896('0x22')](_0xa896('0xab'),_0xa896('0x28'),_0xa896('0xc5'),_0x34f5b9[_0xa896('0x3f')],util[_0xa896('0xc6')](_0x1658a0[_0xa896('0x42')],{'showHidden':![],'depth':null}));switch(_0x34f5b9[_0xa896('0x3f')]){case _0xa896('0x8e'):if(_0x1658a0['query'][_0xa896('0xd6')]&&_0x1658a0[_0xa896('0x42')][_0xa896('0xd7')]){_0x5486fc=_0x1658a0[_0xa896('0x42')][_0xa896('0xd7')];return db[_0xa896('0xa4')][_0xa896('0x57')]({'where':{'messageId':_0x1658a0[_0xa896('0x42')][_0xa896('0xd6')]}});}break;}}})[_0xa896('0x1e')](handleEntityNotFound(_0xc9aa06,null))[_0xa896('0x1e')](function(_0x4d60e2){if(_0x4d60e2){_0x5e660e=_0x4d60e2;switch(_0xc3514d[_0xa896('0x3f')]){case _0xa896('0x8e'):if(_0x5486fc==='2'||_0x5486fc==='6'){return _0x5e660e[_0xa896('0x5f')]({'read':!![]});}else{logger[_0xa896('0x23')](_0xa896('0xab'),'status','csc',util[_0xa896('0xc6')](_0x1658a0['query'],{'showHidden':![],'depth':null}));};break;}return _0x5e660e;}})['then'](respondWithResult(_0xc9aa06,null))['catch'](handleError(_0xc9aa06,null));};exports[_0xa896('0xd8')]=function(_0x45d0ac,_0x86cb47,_0x516bc1){return db[_0xa896('0x50')]['find']({'where':{'id':_0x45d0ac[_0xa896('0x60')]['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x86cb47,null))[_0xa896('0x1e')](function(_0x29c11b){if(_0x29c11b){return _0x29c11b['addAgents'](_0x45d0ac[_0xa896('0x59')][_0xa896('0x69')],_['omit'](_0x45d0ac[_0xa896('0x59')],['ids','id'])||{})['spread'](function(_0x4b2aae){for(var _0x2e5045=0x0;_0x2e5045<_0x45d0ac[_0xa896('0x59')][_0xa896('0x69')][_0xa896('0x55')];_0x2e5045+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x45d0ac['body'][_0xa896('0x69')][_0x2e5045]),'SmsAccountId':Number(_0x45d0ac[_0xa896('0x60')]['id'])});}return _0x4b2aae;});}})[_0xa896('0x1e')](respondWithResult(_0x86cb47,null))[_0xa896('0x27')](handleError(_0x86cb47,null));};exports[_0xa896('0xd9')]=function(_0x4acc37,_0x56f5cd,_0x3a6661){return db[_0xa896('0x50')][_0xa896('0x57')]({'where':{'id':_0x4acc37[_0xa896('0x60')]['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x56f5cd,null))[_0xa896('0x1e')](function(_0x5e95e2){if(_0x5e95e2){return _0x5e95e2[_0xa896('0xd9')](_0x4acc37[_0xa896('0x42')]['ids'])[_0xa896('0x1e')](function(){if(_[_0xa896('0xda')](_0x4acc37[_0xa896('0x42')][_0xa896('0x69')])){for(var _0x37088a=0x0;_0x37088a<_0x4acc37['query']['ids'][_0xa896('0x55')];_0x37088a+=0x1){socket[_0xa896('0xdb')](_0xa896('0xdc'),{'UserId':Number(_0x4acc37[_0xa896('0x42')][_0xa896('0x69')][_0x37088a]),'SmsAccountId':Number(_0x4acc37[_0xa896('0x60')]['id'])});}}else{socket[_0xa896('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x4acc37['query']['ids']),'SmsAccountId':Number(_0x4acc37[_0xa896('0x60')]['id'])});}});}})[_0xa896('0x1e')](respondWithStatusCode(_0x56f5cd,null))[_0xa896('0x27')](handleError(_0x56f5cd,null));};exports[_0xa896('0xdd')]=function(_0xeb5c1a,_0x1248c8,_0x5f1d6a){var _0xebd80d={};var _0x1c1935={};var _0x59ca3e;var _0x3f879f;return db[_0xa896('0x50')][_0xa896('0x65')]({'where':{'id':_0xeb5c1a[_0xa896('0x60')]['id']}})[_0xa896('0x1e')](handleEntityNotFound(_0x1248c8,null))[_0xa896('0x1e')](function(_0x1a20d1){if(_0x1a20d1){_0x59ca3e=_0x1a20d1;_0x1c1935[_0xa896('0x45')]=_['keys'](db[_0xa896('0xb8')][_0xa896('0x3d')]);_0x1c1935['query']=_[_0xa896('0x41')](_0xeb5c1a[_0xa896('0x42')]);_0x1c1935['filters']=_[_0xa896('0x44')](_0x1c1935['model'],_0x1c1935[_0xa896('0x42')]);_0xebd80d[_0xa896('0x46')]=_[_0xa896('0x44')](_0x1c1935[_0xa896('0x45')],qs[_0xa896('0x47')](_0xeb5c1a[_0xa896('0x42')][_0xa896('0x47')]));_0xebd80d[_0xa896('0x46')]=_0xebd80d['attributes'][_0xa896('0x55')]?_0xebd80d[_0xa896('0x46')]:_0x1c1935[_0xa896('0x45')];_0xebd80d[_0xa896('0x66')]=qs[_0xa896('0x4a')](_0xeb5c1a['query'][_0xa896('0x4a')]);_0xebd80d[_0xa896('0x4c')]=qs[_0xa896('0x43')](_[_0xa896('0x4b')](_0xeb5c1a[_0xa896('0x42')],_0x1c1935[_0xa896('0x43')]));if(_0xeb5c1a[_0xa896('0x42')][_0xa896('0x4f')]){_0xebd80d[_0xa896('0x4c')]=_[_0xa896('0x4d')](_0xebd80d[_0xa896('0x4c')],{'$or':_[_0xa896('0x40')](_0xebd80d[_0xa896('0x46')],function(_0x129f8a){var _0x24a9fa={};_0x24a9fa[_0x129f8a]={'$like':'%'+_0xeb5c1a[_0xa896('0x42')][_0xa896('0x4f')]+'%'};return _0x24a9fa;})});}_0xebd80d=_[_0xa896('0x4d')]({},_0xebd80d,_0xeb5c1a['options']);return _0x59ca3e['getAgents'](_0xebd80d);}})[_0xa896('0x1e')](function(_0x4ab9cf){if(_0x4ab9cf){_0x3f879f=_0x4ab9cf[_0xa896('0x55')];if(!_0xeb5c1a[_0xa896('0x42')][_0xa896('0x48')]('nolimit')){_0xebd80d[_0xa896('0x2d')]=qs[_0xa896('0x2d')](_0xeb5c1a[_0xa896('0x42')][_0xa896('0x2d')]);_0xebd80d[_0xa896('0x2b')]=qs['offset'](_0xeb5c1a[_0xa896('0x42')]['offset']);}return _0x59ca3e['getAgents'](_0xebd80d);}})['then'](function(_0x27920d){if(_0x27920d){return _0x27920d?{'count':_0x3f879f,'rows':_0x27920d}:null;}})[_0xa896('0x1e')](respondWithResult(_0x1248c8,null))[_0xa896('0x27')](handleError(_0x1248c8,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 45dab26..fbb5657 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 _0x157d=['emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x56fcf2,_0x126205){var _0x55137e=function(_0xb2535a){while(--_0xb2535a){_0x56fcf2['push'](_0x56fcf2['shift']());}};_0x55137e(++_0x126205);}(_0x157d,0x1ce));var _0xd157=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x157d[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0xd157('0x0'));var SmsAccount=require(_0xd157('0x1'))['db'][_0xd157('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xd157('0x3')](0x0);var events={'afterCreate':_0xd157('0x4'),'afterUpdate':_0xd157('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2ce9f4){return function(_0x324244,_0x5d4cb3,_0x591648){SmsAccountEvents[_0xd157('0x6')](_0x2ce9f4+':'+_0x324244['id'],_0x324244);SmsAccountEvents[_0xd157('0x6')](_0x2ce9f4,_0x324244);_0x591648(null);};}for(var e in events){if(events[_0xd157('0x7')](e)){var event=events[e];SmsAccount[_0xd157('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xa5c1=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x5bcd23,_0x1242f1){var _0x17ec3c=function(_0x4e117f){while(--_0x4e117f){_0x5bcd23['push'](_0x5bcd23['shift']());}};_0x17ec3c(++_0x1242f1);}(_0xa5c1,0x1b2));var _0x1a5c=function(_0x2379d3,_0x54cde6){_0x2379d3=_0x2379d3-0x0;var _0x5db0cc=_0xa5c1[_0x2379d3];return _0x5db0cc;};'use strict';var EventEmitter=require(_0x1a5c('0x0'));var SmsAccount=require(_0x1a5c('0x1'))['db'][_0x1a5c('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1a5c('0x3')](0x0);var events={'afterCreate':_0x1a5c('0x4'),'afterUpdate':_0x1a5c('0x5'),'afterDestroy':_0x1a5c('0x6')};function emitEvent(_0x25780f){return function(_0x21dcd8,_0x5b37dc,_0x3f6abd){SmsAccountEvents[_0x1a5c('0x7')](_0x25780f+':'+_0x21dcd8['id'],_0x21dcd8);SmsAccountEvents['emit'](_0x25780f,_0x21dcd8);_0x3f6abd(null);};}for(var e in events){if(events[_0x1a5c('0x8')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x1a5c('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 0f80534..47e2c26 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 _0xeb49=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0xa92af3,_0x55e080){var _0x447132=function(_0x3a72ea){while(--_0x3a72ea){_0xa92af3['push'](_0xa92af3['shift']());}};_0x447132(++_0x55e080);}(_0xeb49,0x89));var _0x9eb4=function(_0x567773,_0x51d8ef){_0x567773=_0x567773-0x0;var _0x2504f7=_0xeb49[_0x567773];return _0x2504f7;};'use strict';var _=require(_0x9eb4('0x0'));var util=require(_0x9eb4('0x1'));var logger=require(_0x9eb4('0x2'))(_0x9eb4('0x3'));var moment=require(_0x9eb4('0x4'));var BPromise=require(_0x9eb4('0x5'));var rp=require(_0x9eb4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9eb4('0x7'));var config=require(_0x9eb4('0x8'));var attributes=require(_0x9eb4('0x9'));module[_0x9eb4('0xa')]=function(_0x406ba2,_0x5df136){return _0x406ba2[_0x9eb4('0xb')](_0x9eb4('0xc'),attributes,{'tableName':_0x9eb4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61d4=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x5bccbf,_0x547e42){var _0x2158c6=function(_0x40f28a){while(--_0x40f28a){_0x5bccbf['push'](_0x5bccbf['shift']());}};_0x2158c6(++_0x547e42);}(_0x61d4,0xf9));var _0x461d=function(_0x1344cc,_0x19667f){_0x1344cc=_0x1344cc-0x0;var _0x4b7296=_0x61d4[_0x1344cc];return _0x4b7296;};'use strict';var _=require(_0x461d('0x0'));var util=require(_0x461d('0x1'));var logger=require(_0x461d('0x2'))(_0x461d('0x3'));var moment=require(_0x461d('0x4'));var BPromise=require('bluebird');var rp=require(_0x461d('0x5'));var fs=require('fs');var path=require(_0x461d('0x6'));var rimraf=require('rimraf');var config=require(_0x461d('0x7'));var attributes=require(_0x461d('0x8'));module[_0x461d('0x9')]=function(_0x472019,_0x2dd0af){return _0x472019[_0x461d('0xa')](_0x461d('0xb'),attributes,{'tableName':_0x461d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 37f49b8..5074820 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 _0xabd2=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9b8919,_0x160027){var _0xa1b74b=function(_0x4b9790){while(--_0x4b9790){_0x9b8919['push'](_0x9b8919['shift']());}};_0xa1b74b(++_0x160027);}(_0xabd2,0x116));var _0x2abd=function(_0x572274,_0xdb1094){_0x572274=_0x572274-0x0;var _0x1f0e07=_0xabd2[_0x572274];return _0x1f0e07;};'use strict';var _=require(_0x2abd('0x0'));var util=require(_0x2abd('0x1'));var moment=require(_0x2abd('0x2'));var BPromise=require(_0x2abd('0x3'));var rs=require(_0x2abd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2abd('0x5'))['db'];var utils=require(_0x2abd('0x6'));var logger=require(_0x2abd('0x7'))(_0x2abd('0x8'));var config=require(_0x2abd('0x9'));var jayson=require(_0x2abd('0xa'));var client=jayson[_0x2abd('0xb')][_0x2abd('0xc')]({'port':0x232a});config[_0x2abd('0xd')]=_[_0x2abd('0xe')](config[_0x2abd('0xd')],{'host':_0x2abd('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2abd('0xd')]));require(_0x2abd('0x10'))[_0x2abd('0x11')](socket);function respondWithRpcPromise(_0x2abccb,_0x2d2257,_0x31776d){return new BPromise(function(_0x274c15,_0x4493c2){return client[_0x2abd('0x12')](_0x2abccb,_0x31776d)[_0x2abd('0x13')](function(_0x3e539d){logger[_0x2abd('0x14')]('SmsAccount,\x20%s,\x20%s',_0x2d2257,_0x2abd('0x15'));logger[_0x2abd('0x16')](_0x2abd('0x17'),_0x2d2257,_0x2abd('0x15'),JSON[_0x2abd('0x18')](_0x3e539d));if(_0x3e539d[_0x2abd('0x19')]){if(_0x3e539d['error'][_0x2abd('0x1a')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2d2257,_0x3e539d[_0x2abd('0x19')][_0x2abd('0x1b')]);return _0x4493c2(_0x3e539d[_0x2abd('0x19')]['message']);}logger['error'](_0x2abd('0x1c'),_0x2d2257,_0x3e539d[_0x2abd('0x19')]['message']);return _0x274c15(_0x3e539d['error'][_0x2abd('0x1b')]);}else{logger[_0x2abd('0x14')](_0x2abd('0x1c'),_0x2d2257,_0x2abd('0x15'));_0x274c15(_0x3e539d[_0x2abd('0x1d')][_0x2abd('0x1b')]);}})[_0x2abd('0x1e')](function(_0x448430){logger[_0x2abd('0x19')](_0x2abd('0x1c'),_0x2d2257,_0x448430);_0x4493c2(_0x448430);});});}exports[_0x2abd('0x1f')]=function(_0x42b997){var _0x5a0461=this;return new Promise(function(_0x3a6dff,_0x26c190){return db[_0x2abd('0x20')][_0x2abd('0x21')]({'raw':_0x42b997[_0x2abd('0x22')]?_0x42b997[_0x2abd('0x22')][_0x2abd('0x23')]===undefined?!![]:![]:!![],'where':_0x42b997[_0x2abd('0x22')]?_0x42b997[_0x2abd('0x22')][_0x2abd('0x24')]||null:null,'attributes':_0x42b997[_0x2abd('0x22')]?_0x42b997[_0x2abd('0x22')][_0x2abd('0x25')]||null:null,'include':_0x42b997[_0x2abd('0x22')]?_0x42b997['options'][_0x2abd('0x26')]?_[_0x2abd('0x27')](_0x42b997['options'][_0x2abd('0x26')],function(_0x3a28bc){return{'model':db[_0x3a28bc[_0x2abd('0x28')]],'as':_0x3a28bc['as'],'attributes':_0x3a28bc[_0x2abd('0x25')],'include':_0x3a28bc[_0x2abd('0x26')]?_[_0x2abd('0x27')](_0x3a28bc[_0x2abd('0x26')],function(_0x42aea0){return{'model':db[_0x42aea0[_0x2abd('0x28')]],'as':_0x42aea0['as'],'attributes':_0x42aea0[_0x2abd('0x25')],'include':_0x42aea0[_0x2abd('0x26')]?_['map'](_0x42aea0['include'],function(_0x311245){return{'model':db[_0x311245[_0x2abd('0x28')]],'as':_0x311245['as'],'attributes':_0x311245[_0x2abd('0x25')]};}):[]};}):[]};}):[]:[]})[_0x2abd('0x13')](function(_0x13b5b5){logger[_0x2abd('0x14')](_0x2abd('0x1f'),_0x42b997);logger[_0x2abd('0x16')]('ShowSmsAccount',_0x42b997,JSON['stringify'](_0x13b5b5));_0x3a6dff(_0x13b5b5);})[_0x2abd('0x1e')](function(_0x167ac9){logger['error'](_0x2abd('0x1f'),_0x167ac9[_0x2abd('0x1b')],_0x42b997);_0x26c190(_0x5a0461[_0x2abd('0x19')](0x1f4,_0x167ac9[_0x2abd('0x1b')]));});});}; \ No newline at end of file +var _0x333b=['ShowSmsAccount','find','options','raw','where','attributes','include','map','model','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x333b,0xa4));var _0xb333=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x333b[_0x587fb5];return _0x551105;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb333('0x0'));var BPromise=require('bluebird');var rs=require(_0xb333('0x1'));var fs=require('fs');var Redis=require(_0xb333('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb333('0x3'));var logger=require(_0xb333('0x4'))(_0xb333('0x5'));var config=require(_0xb333('0x6'));var jayson=require(_0xb333('0x7'));var client=jayson['client'][_0xb333('0x8')]({'port':0x232a});config[_0xb333('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb333('0xa'))(new Redis(config[_0xb333('0x9')]));require(_0xb333('0xb'))[_0xb333('0xc')](socket);function respondWithRpcPromise(_0x43d8af,_0x4f7c35,_0x5b675c){return new BPromise(function(_0x1a18b7,_0xcfca61){return client['request'](_0x43d8af,_0x5b675c)[_0xb333('0xd')](function(_0x140e6f){logger[_0xb333('0xe')](_0xb333('0xf'),_0x4f7c35,_0xb333('0x10'));logger['debug'](_0xb333('0x11'),_0x4f7c35,'request\x20sent',JSON[_0xb333('0x12')](_0x140e6f));if(_0x140e6f['error']){if(_0x140e6f['error']['code']===0x1f4){logger[_0xb333('0x13')](_0xb333('0xf'),_0x4f7c35,_0x140e6f[_0xb333('0x13')]['message']);return _0xcfca61(_0x140e6f['error'][_0xb333('0x14')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x4f7c35,_0x140e6f[_0xb333('0x13')][_0xb333('0x14')]);return _0x1a18b7(_0x140e6f[_0xb333('0x13')][_0xb333('0x14')]);}else{logger['info'](_0xb333('0xf'),_0x4f7c35,'request\x20sent');_0x1a18b7(_0x140e6f['result']['message']);}})[_0xb333('0x15')](function(_0x28d084){logger[_0xb333('0x13')](_0xb333('0xf'),_0x4f7c35,_0x28d084);_0xcfca61(_0x28d084);});});}exports[_0xb333('0x16')]=function(_0x47d77b){var _0x24311e=this;return new Promise(function(_0x21333a,_0x36a06f){return db['SmsAccount'][_0xb333('0x17')]({'raw':_0x47d77b[_0xb333('0x18')]?_0x47d77b[_0xb333('0x18')][_0xb333('0x19')]===undefined?!![]:![]:!![],'where':_0x47d77b['options']?_0x47d77b[_0xb333('0x18')][_0xb333('0x1a')]||null:null,'attributes':_0x47d77b[_0xb333('0x18')]?_0x47d77b[_0xb333('0x18')][_0xb333('0x1b')]||null:null,'include':_0x47d77b[_0xb333('0x18')]?_0x47d77b[_0xb333('0x18')][_0xb333('0x1c')]?_[_0xb333('0x1d')](_0x47d77b[_0xb333('0x18')]['include'],function(_0xbc1708){return{'model':db[_0xbc1708[_0xb333('0x1e')]],'as':_0xbc1708['as'],'attributes':_0xbc1708['attributes'],'include':_0xbc1708[_0xb333('0x1c')]?_[_0xb333('0x1d')](_0xbc1708[_0xb333('0x1c')],function(_0x3b9db7){return{'model':db[_0x3b9db7[_0xb333('0x1e')]],'as':_0x3b9db7['as'],'attributes':_0x3b9db7[_0xb333('0x1b')],'include':_0x3b9db7[_0xb333('0x1c')]?_['map'](_0x3b9db7[_0xb333('0x1c')],function(_0x555042){return{'model':db[_0x555042[_0xb333('0x1e')]],'as':_0x555042['as'],'attributes':_0x555042['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x54e3fc){logger['info']('ShowSmsAccount',_0x47d77b);logger['debug']('ShowSmsAccount',_0x47d77b,JSON[_0xb333('0x12')](_0x54e3fc));_0x21333a(_0x54e3fc);})[_0xb333('0x15')](function(_0x2bb654){logger[_0xb333('0x13')]('ShowSmsAccount',_0x2bb654[_0xb333('0x14')],_0x47d77b);_0x36a06f(_0x24311e['error'](0x1f4,_0x2bb654[_0xb333('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f672bc9..d1aa937 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 71e8e76..18e8145 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 _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x11f3b0,_0x1fa534){var _0x45d633=function(_0x2ad2df){while(--_0x2ad2df){_0x11f3b0['push'](_0x11f3b0['shift']());}};_0x45d633(++_0x1fa534);}(_0xe14b,0x93));var _0xbe14=function(_0x54fdcb,_0x3b2045){_0x54fdcb=_0x54fdcb-0x0;var _0x5f1208=_0xe14b[_0x54fdcb];return _0x5f1208;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2cb245,_0x3c0ec2){var _0x256144=function(_0x3e3fa8){while(--_0x3e3fa8){_0x2cb245['push'](_0x2cb245['shift']());}};_0x256144(++_0x3c0ec2);}(_0xedd9,0xfc));var _0x9edd=function(_0x12afbc,_0x54a78f){_0x12afbc=_0x12afbc-0x0;var _0x5952bf=_0xedd9[_0x12afbc];return _0x5952bf;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 217feff..3b66647 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 _0xabbf=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3358b9,_0x3ebb8e){var _0xfffc9f=function(_0x30679e){while(--_0x30679e){_0x3358b9['push'](_0x3358b9['shift']());}};_0xfffc9f(++_0x3ebb8e);}(_0xabbf,0x89));var _0xfabb=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0xabbf[_0x152fe3];return _0xc5bb39;};'use strict';var Sequelize=require('sequelize');module[_0xfabb('0x0')]={'priority':{'type':Sequelize[_0xfabb('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfabb('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfabb('0x3')]()},'description':{'type':Sequelize[_0xfabb('0x2')]},'interval':{'type':Sequelize[_0xfabb('0x2')],'defaultValue':_0xfabb('0x4')}}; \ No newline at end of file +var _0x869d=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x869d,0xad));var _0xd869=function(_0x10f826,_0x186f29){_0x10f826=_0x10f826-0x0;var _0xc674dd=_0x869d[_0x10f826];return _0xc674dd;};'use strict';var Sequelize=require(_0xd869('0x0'));module[_0xd869('0x1')]={'priority':{'type':Sequelize[_0xd869('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd869('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd869('0x4')]()},'description':{'type':Sequelize[_0xd869('0x3')]},'interval':{'type':Sequelize[_0xd869('0x3')],'defaultValue':_0xd869('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index b0caf33..a097005 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 _0x00ae=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../mysqldb','sendStatus','end','status'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x00ae,0x81));var _0xe00a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x00ae[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0xe00a('0x0'));var rimraf=require(_0xe00a('0x1'));var zipdir=require(_0xe00a('0x2'));var jsonpatch=require(_0xe00a('0x3'));var rp=require(_0xe00a('0x4'));var moment=require(_0xe00a('0x5'));var BPromise=require(_0xe00a('0x6'));var Mustache=require(_0xe00a('0x7'));var util=require(_0xe00a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xe00a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe00a('0xa'));var _=require('lodash');var squel=require(_0xe00a('0xb'));var crypto=require(_0xe00a('0xc'));var jsforce=require(_0xe00a('0xd'));var deskjs=require(_0xe00a('0xe'));var toCsv=require(_0xe00a('0x9'));var querystring=require(_0xe00a('0xf'));var Papa=require(_0xe00a('0x10'));var Redis=require(_0xe00a('0x11'));var authService=require(_0xe00a('0x12'));var qs=require(_0xe00a('0x13'));var as=require(_0xe00a('0x14'));var hardwareService=require(_0xe00a('0x15'));var logger=require(_0xe00a('0x16'))(_0xe00a('0x17'));var utils=require(_0xe00a('0x18'));var config=require(_0xe00a('0x19'));var licenseUtil=require(_0xe00a('0x1a'));var db=require(_0xe00a('0x1b'))['db'];function respondWithStatusCode(_0x33996c,_0x2b2f24){_0x2b2f24=_0x2b2f24||0xcc;return function(_0x2fe7b5){if(_0x2fe7b5){return _0x33996c[_0xe00a('0x1c')](_0x2b2f24);}return _0x33996c['status'](_0x2b2f24)[_0xe00a('0x1d')]();};}function respondWithResult(_0xb4e78d,_0x254cd9){_0x254cd9=_0x254cd9||0xc8;return function(_0x25587d){if(_0x25587d){return _0xb4e78d[_0xe00a('0x1e')](_0x254cd9)[_0xe00a('0x1f')](_0x25587d);}};}function respondWithFilteredResult(_0x392e6b,_0x4e5c66){return function(_0x74b5){if(_0x74b5){var _0x42da8f=typeof _0x4e5c66[_0xe00a('0x20')]==='undefined'&&typeof _0x4e5c66[_0xe00a('0x21')]===_0xe00a('0x22');var _0x517271=_0x74b5[_0xe00a('0x23')];var _0x4f7393=_0x42da8f?0x0:_0x4e5c66[_0xe00a('0x20')];var _0x2b858b=_0x42da8f?_0x74b5[_0xe00a('0x23')]:_0x4e5c66[_0xe00a('0x20')]+_0x4e5c66[_0xe00a('0x21')];var _0x54318a;if(_0x2b858b>=_0x517271){_0x2b858b=_0x517271;_0x54318a=0xc8;}else{_0x54318a=0xce;}_0x392e6b[_0xe00a('0x1e')](_0x54318a);return _0x392e6b[_0xe00a('0x24')](_0xe00a('0x25'),_0x4f7393+'-'+_0x2b858b+'/'+_0x517271)[_0xe00a('0x1f')](_0x74b5);}return null;};}function patchUpdates(_0x1f3789){return function(_0x41c791){try{jsonpatch[_0xe00a('0x26')](_0x41c791,_0x1f3789,!![]);}catch(_0x4dcebb){return BPromise['reject'](_0x4dcebb);}return _0x41c791['save']();};}function saveUpdates(_0x2560ab,_0x56a709){return function(_0x55d28b){if(_0x55d28b){return _0x55d28b[_0xe00a('0x27')](_0x2560ab)[_0xe00a('0x28')](function(_0x3a0c47){return _0x3a0c47;});}return null;};}function removeEntity(_0x23317f,_0x25f723){return function(_0x3c217c){if(_0x3c217c){return _0x3c217c['destroy']()[_0xe00a('0x28')](function(){_0x23317f[_0xe00a('0x1e')](0xcc)[_0xe00a('0x1d')]();});}};}function handleEntityNotFound(_0x584abf,_0x2befc5){return function(_0x284244){if(!_0x284244){_0x584abf[_0xe00a('0x1c')](0x194);}return _0x284244;};}function handleError(_0x21bc06,_0x3f7c16){_0x3f7c16=_0x3f7c16||0x1f4;return function(_0x39bd3c){logger[_0xe00a('0x29')](_0x39bd3c[_0xe00a('0x2a')]);if(_0x39bd3c[_0xe00a('0x2b')]){delete _0x39bd3c['name'];}_0x21bc06[_0xe00a('0x1e')](_0x3f7c16)[_0xe00a('0x2c')](_0x39bd3c);};}exports[_0xe00a('0x2d')]=function(_0x49ffb0,_0x5e299e){var _0x4a08f6={},_0x9e5046={},_0x190751={'count':0x0,'rows':[]};var _0x4d63c1=_['map'](db[_0xe00a('0x2e')][_0xe00a('0x2f')],function(_0xdff9fc){return{'name':_0xdff9fc[_0xe00a('0x30')],'type':_0xdff9fc[_0xe00a('0x31')][_0xe00a('0x32')]};});_0x9e5046['model']=_['map'](_0x4d63c1,_0xe00a('0x2b'));_0x9e5046['query']=_[_0xe00a('0x33')](_0x49ffb0[_0xe00a('0x34')]);_0x9e5046[_0xe00a('0x35')]=_[_0xe00a('0x36')](_0x9e5046[_0xe00a('0x37')],_0x9e5046[_0xe00a('0x34')]);_0x4a08f6[_0xe00a('0x38')]=_[_0xe00a('0x36')](_0x9e5046[_0xe00a('0x37')],qs[_0xe00a('0x39')](_0x49ffb0['query'][_0xe00a('0x39')]));_0x4a08f6[_0xe00a('0x38')]=_0x4a08f6['attributes'][_0xe00a('0x3a')]?_0x4a08f6[_0xe00a('0x38')]:_0x9e5046['model'];if(!_0x49ffb0[_0xe00a('0x34')][_0xe00a('0x3b')](_0xe00a('0x3c'))){_0x4a08f6['limit']=qs[_0xe00a('0x21')](_0x49ffb0[_0xe00a('0x34')][_0xe00a('0x21')]);_0x4a08f6['offset']=qs[_0xe00a('0x20')](_0x49ffb0['query'][_0xe00a('0x20')]);}_0x4a08f6[_0xe00a('0x3d')]=qs[_0xe00a('0x3e')](_0x49ffb0[_0xe00a('0x34')]['sort']);_0x4a08f6['where']=qs[_0xe00a('0x35')](_[_0xe00a('0x3f')](_0x49ffb0['query'],_0x9e5046[_0xe00a('0x35')]),_0x4d63c1);if(_0x49ffb0[_0xe00a('0x34')][_0xe00a('0x40')]){_0x4a08f6[_0xe00a('0x41')]=_[_0xe00a('0x42')](_0x4a08f6['where'],{'$or':_[_0xe00a('0x43')](_0x4d63c1,function(_0x15c138){if(_0x15c138[_0xe00a('0x31')]!==_0xe00a('0x44')){var _0x1cf41f={};_0x1cf41f[_0x15c138[_0xe00a('0x2b')]]={'$like':'%'+_0x49ffb0['query'][_0xe00a('0x40')]+'%'};return _0x1cf41f;}})});}_0x4a08f6=_[_0xe00a('0x42')]({},_0x4a08f6,_0x49ffb0[_0xe00a('0x45')]);var _0x173869={'where':_0x4a08f6[_0xe00a('0x41')]};return db['SmsApplication'][_0xe00a('0x23')](_0x173869)[_0xe00a('0x28')](function(_0x2bedab){_0x190751[_0xe00a('0x23')]=_0x2bedab;if(_0x49ffb0['query'][_0xe00a('0x46')]){_0x4a08f6[_0xe00a('0x47')]=[{'all':!![]}];}return db['SmsApplication'][_0xe00a('0x48')](_0x4a08f6);})[_0xe00a('0x28')](function(_0x4ee7dd){_0x190751[_0xe00a('0x49')]=_0x4ee7dd;return _0x190751;})[_0xe00a('0x28')](respondWithFilteredResult(_0x5e299e,_0x4a08f6))[_0xe00a('0x4a')](handleError(_0x5e299e,null));};exports[_0xe00a('0x4b')]=function(_0x337443,_0x507a5b){var _0x3b43aa={'raw':!![],'where':{'id':_0x337443[_0xe00a('0x4c')]['id']}},_0x5f05f4={};_0x5f05f4[_0xe00a('0x37')]=_[_0xe00a('0x33')](db[_0xe00a('0x2e')][_0xe00a('0x2f')]);_0x5f05f4[_0xe00a('0x34')]=_[_0xe00a('0x33')](_0x337443[_0xe00a('0x34')]);_0x5f05f4[_0xe00a('0x35')]=_['intersection'](_0x5f05f4[_0xe00a('0x37')],_0x5f05f4['query']);_0x3b43aa[_0xe00a('0x38')]=_['intersection'](_0x5f05f4['model'],qs[_0xe00a('0x39')](_0x337443['query'][_0xe00a('0x39')]));_0x3b43aa[_0xe00a('0x38')]=_0x3b43aa[_0xe00a('0x38')][_0xe00a('0x3a')]?_0x3b43aa[_0xe00a('0x38')]:_0x5f05f4[_0xe00a('0x37')];if(_0x337443[_0xe00a('0x34')][_0xe00a('0x46')]){_0x3b43aa[_0xe00a('0x47')]=[{'all':!![]}];}_0x3b43aa=_['merge']({},_0x3b43aa,_0x337443[_0xe00a('0x45')]);return db[_0xe00a('0x2e')][_0xe00a('0x4d')](_0x3b43aa)['then'](handleEntityNotFound(_0x507a5b,null))[_0xe00a('0x28')](respondWithResult(_0x507a5b,null))[_0xe00a('0x4a')](handleError(_0x507a5b,null));};exports[_0xe00a('0x4e')]=function(_0x282895,_0x4440ce){return db[_0xe00a('0x2e')][_0xe00a('0x4e')](_0x282895['body'],{})[_0xe00a('0x28')](respondWithResult(_0x4440ce,0xc9))[_0xe00a('0x4a')](handleError(_0x4440ce,null));};exports[_0xe00a('0x27')]=function(_0x4d5aff,_0x560bfc){if(_0x4d5aff[_0xe00a('0x4f')]['id']){delete _0x4d5aff[_0xe00a('0x4f')]['id'];}return db[_0xe00a('0x2e')]['find']({'where':{'id':_0x4d5aff[_0xe00a('0x4c')]['id']}})[_0xe00a('0x28')](handleEntityNotFound(_0x560bfc,null))[_0xe00a('0x28')](saveUpdates(_0x4d5aff['body'],null))[_0xe00a('0x28')](respondWithResult(_0x560bfc,null))[_0xe00a('0x4a')](handleError(_0x560bfc,null));};exports['destroy']=function(_0x9993e0,_0x699130){return db[_0xe00a('0x2e')][_0xe00a('0x4d')]({'where':{'id':_0x9993e0[_0xe00a('0x4c')]['id']}})[_0xe00a('0x28')](handleEntityNotFound(_0x699130,null))[_0xe00a('0x28')](removeEntity(_0x699130,null))[_0xe00a('0x4a')](handleError(_0x699130,null));}; \ No newline at end of file +var _0xb12c=['keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy','then','error','stack','send','index','map','SmsApplication','name','query'];(function(_0x176436,_0x297dfa){var _0x250916=function(_0x4ade88){while(--_0x4ade88){_0x176436['push'](_0x176436['shift']());}};_0x250916(++_0x297dfa);}(_0xb12c,0x192));var _0xcb12=function(_0x5452ec,_0x4b22bd){_0x5452ec=_0x5452ec-0x0;var _0x2a26ba=_0xb12c[_0x5452ec];return _0x2a26ba;};'use strict';var emlformat=require(_0xcb12('0x0'));var rimraf=require(_0xcb12('0x1'));var zipdir=require(_0xcb12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb12('0x3'));var moment=require(_0xcb12('0x4'));var BPromise=require(_0xcb12('0x5'));var Mustache=require(_0xcb12('0x6'));var util=require(_0xcb12('0x7'));var path=require(_0xcb12('0x8'));var sox=require(_0xcb12('0x9'));var csv=require(_0xcb12('0xa'));var ejs=require(_0xcb12('0xb'));var fs=require('fs');var fs_extra=require(_0xcb12('0xc'));var _=require(_0xcb12('0xd'));var squel=require(_0xcb12('0xe'));var crypto=require('crypto');var jsforce=require(_0xcb12('0xf'));var deskjs=require(_0xcb12('0x10'));var toCsv=require(_0xcb12('0xa'));var querystring=require('querystring');var Papa=require(_0xcb12('0x11'));var Redis=require(_0xcb12('0x12'));var authService=require(_0xcb12('0x13'));var qs=require(_0xcb12('0x14'));var as=require(_0xcb12('0x15'));var hardwareService=require(_0xcb12('0x16'));var logger=require('../../config/logger')(_0xcb12('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcb12('0x18'));var db=require(_0xcb12('0x19'))['db'];function respondWithStatusCode(_0x243e8a,_0x4a3a1f){_0x4a3a1f=_0x4a3a1f||0xcc;return function(_0x1d1bb0){if(_0x1d1bb0){return _0x243e8a[_0xcb12('0x1a')](_0x4a3a1f);}return _0x243e8a[_0xcb12('0x1b')](_0x4a3a1f)[_0xcb12('0x1c')]();};}function respondWithResult(_0x2ae0e5,_0x268a44){_0x268a44=_0x268a44||0xc8;return function(_0x331bce){if(_0x331bce){return _0x2ae0e5[_0xcb12('0x1b')](_0x268a44)['json'](_0x331bce);}};}function respondWithFilteredResult(_0x1bd38a,_0x3f2710){return function(_0x4dfad7){if(_0x4dfad7){var _0x5ce55e=typeof _0x3f2710[_0xcb12('0x1d')]===_0xcb12('0x1e')&&typeof _0x3f2710[_0xcb12('0x1f')]==='undefined';var _0x4cc08b=_0x4dfad7[_0xcb12('0x20')];var _0x564c94=_0x5ce55e?0x0:_0x3f2710[_0xcb12('0x1d')];var _0x282573=_0x5ce55e?_0x4dfad7[_0xcb12('0x20')]:_0x3f2710[_0xcb12('0x1d')]+_0x3f2710[_0xcb12('0x1f')];var _0x3f9efd;if(_0x282573>=_0x4cc08b){_0x282573=_0x4cc08b;_0x3f9efd=0xc8;}else{_0x3f9efd=0xce;}_0x1bd38a[_0xcb12('0x1b')](_0x3f9efd);return _0x1bd38a[_0xcb12('0x21')](_0xcb12('0x22'),_0x564c94+'-'+_0x282573+'/'+_0x4cc08b)[_0xcb12('0x23')](_0x4dfad7);}return null;};}function patchUpdates(_0x542684){return function(_0x11475c){try{jsonpatch[_0xcb12('0x24')](_0x11475c,_0x542684,!![]);}catch(_0x171c72){return BPromise[_0xcb12('0x25')](_0x171c72);}return _0x11475c['save']();};}function saveUpdates(_0x44b9a2,_0xc85a81){return function(_0x3aad8c){if(_0x3aad8c){return _0x3aad8c['update'](_0x44b9a2)['then'](function(_0x24dc3d){return _0x24dc3d;});}return null;};}function removeEntity(_0x38ad75,_0x3ce46d){return function(_0xe5965e){if(_0xe5965e){return _0xe5965e[_0xcb12('0x26')]()[_0xcb12('0x27')](function(){_0x38ad75[_0xcb12('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x173210,_0x211b57){return function(_0x43b2bd){if(!_0x43b2bd){_0x173210['sendStatus'](0x194);}return _0x43b2bd;};}function handleError(_0x3c4fe5,_0x4ead7f){_0x4ead7f=_0x4ead7f||0x1f4;return function(_0x4c02d8){logger[_0xcb12('0x28')](_0x4c02d8[_0xcb12('0x29')]);if(_0x4c02d8['name']){delete _0x4c02d8['name'];}_0x3c4fe5[_0xcb12('0x1b')](_0x4ead7f)[_0xcb12('0x2a')](_0x4c02d8);};}exports[_0xcb12('0x2b')]=function(_0x3c46ae,_0x45377f){var _0xadcd18={},_0x79c6db={},_0x389a3f={'count':0x0,'rows':[]};var _0x3f4908=_[_0xcb12('0x2c')](db[_0xcb12('0x2d')]['rawAttributes'],function(_0x5e9a3b){return{'name':_0x5e9a3b['fieldName'],'type':_0x5e9a3b['type']['key']};});_0x79c6db['model']=_[_0xcb12('0x2c')](_0x3f4908,_0xcb12('0x2e'));_0x79c6db[_0xcb12('0x2f')]=_[_0xcb12('0x30')](_0x3c46ae['query']);_0x79c6db[_0xcb12('0x31')]=_[_0xcb12('0x32')](_0x79c6db[_0xcb12('0x33')],_0x79c6db[_0xcb12('0x2f')]);_0xadcd18['attributes']=_['intersection'](_0x79c6db[_0xcb12('0x33')],qs[_0xcb12('0x34')](_0x3c46ae['query']['fields']));_0xadcd18[_0xcb12('0x35')]=_0xadcd18[_0xcb12('0x35')][_0xcb12('0x36')]?_0xadcd18['attributes']:_0x79c6db['model'];if(!_0x3c46ae[_0xcb12('0x2f')]['hasOwnProperty'](_0xcb12('0x37'))){_0xadcd18[_0xcb12('0x1f')]=qs[_0xcb12('0x1f')](_0x3c46ae[_0xcb12('0x2f')]['limit']);_0xadcd18[_0xcb12('0x1d')]=qs[_0xcb12('0x1d')](_0x3c46ae[_0xcb12('0x2f')][_0xcb12('0x1d')]);}_0xadcd18[_0xcb12('0x38')]=qs[_0xcb12('0x39')](_0x3c46ae[_0xcb12('0x2f')][_0xcb12('0x39')]);_0xadcd18[_0xcb12('0x3a')]=qs[_0xcb12('0x31')](_['pick'](_0x3c46ae['query'],_0x79c6db[_0xcb12('0x31')]),_0x3f4908);if(_0x3c46ae[_0xcb12('0x2f')][_0xcb12('0x3b')]){_0xadcd18[_0xcb12('0x3a')]=_[_0xcb12('0x3c')](_0xadcd18[_0xcb12('0x3a')],{'$or':_[_0xcb12('0x2c')](_0x3f4908,function(_0x1a8e46){if(_0x1a8e46[_0xcb12('0x3d')]!==_0xcb12('0x3e')){var _0x1f7cd8={};_0x1f7cd8[_0x1a8e46[_0xcb12('0x2e')]]={'$like':'%'+_0x3c46ae['query'][_0xcb12('0x3b')]+'%'};return _0x1f7cd8;}})});}_0xadcd18=_[_0xcb12('0x3c')]({},_0xadcd18,_0x3c46ae['options']);var _0x367b4f={'where':_0xadcd18['where']};return db[_0xcb12('0x2d')][_0xcb12('0x20')](_0x367b4f)[_0xcb12('0x27')](function(_0x5bd7bf){_0x389a3f[_0xcb12('0x20')]=_0x5bd7bf;if(_0x3c46ae[_0xcb12('0x2f')][_0xcb12('0x3f')]){_0xadcd18[_0xcb12('0x40')]=[{'all':!![]}];}return db[_0xcb12('0x2d')][_0xcb12('0x41')](_0xadcd18);})[_0xcb12('0x27')](function(_0x5be473){_0x389a3f[_0xcb12('0x42')]=_0x5be473;return _0x389a3f;})[_0xcb12('0x27')](respondWithFilteredResult(_0x45377f,_0xadcd18))[_0xcb12('0x43')](handleError(_0x45377f,null));};exports[_0xcb12('0x44')]=function(_0x1c384f,_0x38ca89){var _0x5692ed={'raw':!![],'where':{'id':_0x1c384f['params']['id']}},_0x480096={};_0x480096['model']=_[_0xcb12('0x30')](db[_0xcb12('0x2d')]['rawAttributes']);_0x480096['query']=_[_0xcb12('0x30')](_0x1c384f[_0xcb12('0x2f')]);_0x480096[_0xcb12('0x31')]=_[_0xcb12('0x32')](_0x480096[_0xcb12('0x33')],_0x480096['query']);_0x5692ed[_0xcb12('0x35')]=_[_0xcb12('0x32')](_0x480096[_0xcb12('0x33')],qs[_0xcb12('0x34')](_0x1c384f[_0xcb12('0x2f')]['fields']));_0x5692ed[_0xcb12('0x35')]=_0x5692ed[_0xcb12('0x35')][_0xcb12('0x36')]?_0x5692ed['attributes']:_0x480096[_0xcb12('0x33')];if(_0x1c384f[_0xcb12('0x2f')]['includeAll']){_0x5692ed['include']=[{'all':!![]}];}_0x5692ed=_[_0xcb12('0x3c')]({},_0x5692ed,_0x1c384f[_0xcb12('0x45')]);return db[_0xcb12('0x2d')][_0xcb12('0x46')](_0x5692ed)[_0xcb12('0x27')](handleEntityNotFound(_0x38ca89,null))[_0xcb12('0x27')](respondWithResult(_0x38ca89,null))[_0xcb12('0x43')](handleError(_0x38ca89,null));};exports[_0xcb12('0x47')]=function(_0x24b832,_0x2fa8f7){return db[_0xcb12('0x2d')][_0xcb12('0x47')](_0x24b832['body'],{})[_0xcb12('0x27')](respondWithResult(_0x2fa8f7,0xc9))[_0xcb12('0x43')](handleError(_0x2fa8f7,null));};exports[_0xcb12('0x48')]=function(_0x48c67e,_0x5f37a4){if(_0x48c67e[_0xcb12('0x49')]['id']){delete _0x48c67e[_0xcb12('0x49')]['id'];}return db[_0xcb12('0x2d')][_0xcb12('0x46')]({'where':{'id':_0x48c67e[_0xcb12('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f37a4,null))['then'](saveUpdates(_0x48c67e['body'],null))[_0xcb12('0x27')](respondWithResult(_0x5f37a4,null))[_0xcb12('0x43')](handleError(_0x5f37a4,null));};exports[_0xcb12('0x26')]=function(_0x890714,_0x189278){return db['SmsApplication'][_0xcb12('0x46')]({'where':{'id':_0x890714[_0xcb12('0x4a')]['id']}})['then'](handleEntityNotFound(_0x189278,null))[_0xcb12('0x27')](removeEntity(_0x189278,null))[_0xcb12('0x43')](handleError(_0x189278,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index b6b4f18..9084ef8 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 _0x0dba=['../../config/environment','define','SmsApplication','sms_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3e901f,_0x41294f){var _0x4ae6a9=function(_0x14e34d){while(--_0x14e34d){_0x3e901f['push'](_0x3e901f['shift']());}};_0x4ae6a9(++_0x41294f);}(_0x0dba,0xc7));var _0xa0db=function(_0x5c6034,_0x3e5bfe){_0x5c6034=_0x5c6034-0x0;var _0x417c68=_0x0dba[_0x5c6034];return _0x417c68;};'use strict';var _=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var logger=require(_0xa0db('0x2'))(_0xa0db('0x3'));var moment=require(_0xa0db('0x4'));var BPromise=require(_0xa0db('0x5'));var rp=require(_0xa0db('0x6'));var fs=require('fs');var path=require(_0xa0db('0x7'));var rimraf=require(_0xa0db('0x8'));var config=require(_0xa0db('0x9'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0xacee01,_0x2c664e){return _0xacee01[_0xa0db('0xa')](_0xa0db('0xb'),attributes,{'tableName':_0xa0db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa61a=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x369a51,_0x54d3bd){var _0x10bafe=function(_0x5c3828){while(--_0x5c3828){_0x369a51['push'](_0x369a51['shift']());}};_0x10bafe(++_0x54d3bd);}(_0xa61a,0xc8));var _0xaa61=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa61a[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xaa61('0x0'));var util=require(_0xaa61('0x1'));var logger=require(_0xaa61('0x2'))(_0xaa61('0x3'));var moment=require('moment');var BPromise=require(_0xaa61('0x4'));var rp=require(_0xaa61('0x5'));var fs=require('fs');var path=require(_0xaa61('0x6'));var rimraf=require('rimraf');var config=require(_0xaa61('0x7'));var attributes=require('./smsApplication.attributes');module[_0xaa61('0x8')]=function(_0x7ebf94,_0x1959a7){return _0x7ebf94[_0xaa61('0x9')](_0xaa61('0xa'),attributes,{'tableName':_0xaa61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaa61('0xc'),'collate':_0xaa61('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0bf98e2..c90d681 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 _0x4813=['lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x17a881,_0x174f16){var _0x4f4c0d=function(_0x548861){while(--_0x548861){_0x17a881['push'](_0x17a881['shift']());}};_0x4f4c0d(++_0x174f16);}(_0x4813,0xdc));var _0x3481=function(_0x5c7395,_0x282813){_0x5c7395=_0x5c7395-0x0;var _0x5c98a9=_0x4813[_0x5c7395];return _0x5c98a9;};'use strict';var _=require(_0x3481('0x0'));var util=require('util');var moment=require(_0x3481('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3481('0x2'));var db=require(_0x3481('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3481('0x4'))(_0x3481('0x5'));var config=require(_0x3481('0x6'));var jayson=require(_0x3481('0x7'));var client=jayson[_0x3481('0x8')][_0x3481('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x369c3b,_0x54a2c8,_0x4d23ef){return new BPromise(function(_0x41592f,_0x527c3c){return client[_0x3481('0xa')](_0x369c3b,_0x4d23ef)[_0x3481('0xb')](function(_0x39b6c4){logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));logger[_0x3481('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x54a2c8,'request\x20sent',JSON[_0x3481('0x10')](_0x39b6c4));if(_0x39b6c4[_0x3481('0x11')]){if(_0x39b6c4[_0x3481('0x11')][_0x3481('0x12')]===0x1f4){logger[_0x3481('0x11')]('SmsApplication,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);return _0x527c3c(_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);}logger[_0x3481('0x11')]('SmsApplication,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4['error'][_0x3481('0x13')]);return _0x41592f(_0x39b6c4[_0x3481('0x11')]['message']);}else{logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));_0x41592f(_0x39b6c4[_0x3481('0x14')][_0x3481('0x13')]);}})[_0x3481('0x15')](function(_0x2a3981){logger['error'](_0x3481('0xd'),_0x54a2c8,_0x2a3981);_0x527c3c(_0x2a3981);});});} \ No newline at end of file +var _0x75dc=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','SmsApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent'];(function(_0x46d326,_0x358e38){var _0x5d50fa=function(_0x2c22e1){while(--_0x2c22e1){_0x46d326['push'](_0x46d326['shift']());}};_0x5d50fa(++_0x358e38);}(_0x75dc,0x1d7));var _0xc75d=function(_0x4f484c,_0x9bccb4){_0x4f484c=_0x4f484c-0x0;var _0x276e95=_0x75dc[_0x4f484c];return _0x276e95;};'use strict';var _=require(_0xc75d('0x0'));var util=require(_0xc75d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc75d('0x2'));var db=require(_0xc75d('0x3'))['db'];var utils=require(_0xc75d('0x4'));var logger=require(_0xc75d('0x5'))(_0xc75d('0x6'));var config=require(_0xc75d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc75d('0x8')][_0xc75d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x928edc,_0x5d75a9,_0x1ed94f){return new BPromise(function(_0x182591,_0x645b48){return client[_0xc75d('0xa')](_0x928edc,_0x1ed94f)['then'](function(_0x264fcb){logger['info']('SmsApplication,\x20%s,\x20%s',_0x5d75a9,_0xc75d('0xb'));logger[_0xc75d('0xc')](_0xc75d('0xd'),_0x5d75a9,_0xc75d('0xb'),JSON['stringify'](_0x264fcb));if(_0x264fcb[_0xc75d('0xe')]){if(_0x264fcb[_0xc75d('0xe')][_0xc75d('0xf')]===0x1f4){logger[_0xc75d('0xe')](_0xc75d('0x10'),_0x5d75a9,_0x264fcb[_0xc75d('0xe')][_0xc75d('0x11')]);return _0x645b48(_0x264fcb['error'][_0xc75d('0x11')]);}logger[_0xc75d('0xe')](_0xc75d('0x10'),_0x5d75a9,_0x264fcb[_0xc75d('0xe')]['message']);return _0x182591(_0x264fcb['error'][_0xc75d('0x11')]);}else{logger[_0xc75d('0x12')](_0xc75d('0x10'),_0x5d75a9,_0xc75d('0xb'));_0x182591(_0x264fcb[_0xc75d('0x13')][_0xc75d('0x11')]);}})[_0xc75d('0x14')](function(_0x4b8552){logger[_0xc75d('0xe')](_0xc75d('0x10'),_0x5d75a9,_0x4b8552);_0x645b48(_0x4b8552);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f2edef3..f95ba8a 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 _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(_0x22fb16,_0x2f909e){var _0x274f04=function(_0x5613e5){while(--_0x5613e5){_0x22fb16['push'](_0x22fb16['shift']());}};_0x274f04(++_0x2f909e);}(_0xb62e,0x1de));var _0xeb62=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb62e[_0x3bf83f];return _0x22c4a9;};'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 +var _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x2b47ed,_0x17fcad){var _0x397f91=function(_0x32a4dc){while(--_0x32a4dc){_0x2b47ed['push'](_0x2b47ed['shift']());}};_0x397f91(++_0x17fcad);}(_0xea28,0x13a));var _0x8ea2=function(_0x18ed4f,_0x3a7d40){_0x18ed4f=_0x18ed4f-0x0;var _0x349bb1=_0xea28[_0x18ed4f];return _0x349bb1;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 3c813a2..69b4d59 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 _0x7f27=['ENUM','BOOLEAN','sequelize','moment','DATE','STRING'];(function(_0x37a40d,_0x2d9303){var _0x49c89f=function(_0x2f4b43){while(--_0x2f4b43){_0x37a40d['push'](_0x37a40d['shift']());}};_0x49c89f(++_0x2d9303);}(_0x7f27,0x12e));var _0x77f2=function(_0x5ad18c,_0x4ee0d3){_0x5ad18c=_0x5ad18c-0x0;var _0x470c74=_0x7f27[_0x5ad18c];return _0x470c74;};'use strict';var Sequelize=require(_0x77f2('0x0'));var moment=require(_0x77f2('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x77f2('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x77f2('0x3')]},'note':{'type':Sequelize[_0x77f2('0x3')]},'phone':{'type':Sequelize[_0x77f2('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x77f2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x77f2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x77f2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x77f2('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xe55d=['sequelize','moment','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x1ae661,_0x3a7e42){var _0x11edfb=function(_0xe8870f){while(--_0xe8870f){_0x1ae661['push'](_0x1ae661['shift']());}};_0x11edfb(++_0x3a7e42);}(_0xe55d,0x126));var _0xde55=function(_0xaddf10,_0x2fd1de){_0xaddf10=_0xaddf10-0x0;var _0x747733=_0xe55d[_0xaddf10];return _0x747733;};'use strict';var Sequelize=require(_0xde55('0x0'));var moment=require(_0xde55('0x1'));module['exports']={'closed':{'type':Sequelize[_0xde55('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xde55('0x3')]},'disposition':{'type':Sequelize[_0xde55('0x4')]},'secondDisposition':{'type':Sequelize[_0xde55('0x4')]},'thirdDisposition':{'type':Sequelize[_0xde55('0x4')]},'note':{'type':Sequelize[_0xde55('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xde55('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xde55('0x5')]('in',_0xde55('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xde55('0x5')]('in',_0xde55('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xde55('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 9218bd1..4e92b83 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 _0xf3f9=['getOptions','findAll','sms','catch','show','model','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','create','body','update','find','params','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','split','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','smsInteractionTags:save','removeTags','unix','toString','files','tmp','join','format','transcript-%d-%s.zip','User','CmContact','Contact','Messages','direction','secret','read','push','Owner','fullname','mkdirSync','Sms','Account','N.A.','createdAt','closedAt','disposition','System','firstName','lastName','out','value','renderFile','root','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','redis','localhost','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','error','stack','name','send','map','SmsInteraction','rawAttributes','type','key'];(function(_0x2b3ae6,_0x3b17be){var _0x266f3c=function(_0x163fe7){while(--_0x163fe7){_0x2b3ae6['push'](_0x2b3ae6['shift']());}};_0x266f3c(++_0x3b17be);}(_0xf3f9,0xc7));var _0x9f3f=function(_0x389395,_0xf7b449){_0x389395=_0x389395-0x0;var _0x7b9ea7=_0xf3f9[_0x389395];return _0x7b9ea7;};'use strict';var rimraf=require(_0x9f3f('0x0'));var zipdir=require(_0x9f3f('0x1'));var moment=require('moment');var BPromise=require(_0x9f3f('0x2'));var util=require(_0x9f3f('0x3'));var path=require(_0x9f3f('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f3f('0x5'));var Redis=require(_0x9f3f('0x6'));var interaction=require(_0x9f3f('0x7'));var qs=require(_0x9f3f('0x8'));var pdf=require(_0x9f3f('0x9'));var logger=require(_0x9f3f('0xa'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x9f3f('0xb')],{'host':_0x9f3f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f3f('0xb')]));require('./smsInteraction.socket')[_0x9f3f('0xd')](socket);function respondWithStatusCode(_0x3aa3fc,_0x4d37af){_0x4d37af=_0x4d37af||0xcc;return function(_0x3b2de2){if(_0x3b2de2){return _0x3aa3fc[_0x9f3f('0xe')](_0x4d37af);}return _0x3aa3fc['status'](_0x4d37af)[_0x9f3f('0xf')]();};}function respondWithResult(_0x264fec,_0x25c40f){_0x25c40f=_0x25c40f||0xc8;return function(_0x228adf){if(_0x228adf){return _0x264fec['status'](_0x25c40f)[_0x9f3f('0x10')](_0x228adf);}};}function respondWithFilteredResult(_0x3b966b,_0xf36c58){return function(_0x5c803f){if(_0x5c803f){var _0x18ff95=typeof _0xf36c58[_0x9f3f('0x11')]===_0x9f3f('0x12')&&typeof _0xf36c58[_0x9f3f('0x13')]===_0x9f3f('0x12');var _0x4695df=_0x5c803f[_0x9f3f('0x14')];var _0x7cafa9=_0x18ff95?0x0:_0xf36c58[_0x9f3f('0x11')];var _0x5b656e=_0x18ff95?_0x5c803f['count']:_0xf36c58[_0x9f3f('0x11')]+_0xf36c58[_0x9f3f('0x13')];var _0x51048a;if(_0x5b656e>=_0x4695df){_0x5b656e=_0x4695df;_0x51048a=0xc8;}else{_0x51048a=0xce;}_0x3b966b[_0x9f3f('0x15')](_0x51048a);return _0x3b966b[_0x9f3f('0x16')](_0x9f3f('0x17'),_0x7cafa9+'-'+_0x5b656e+'/'+_0x4695df)[_0x9f3f('0x10')](_0x5c803f);}return null;};}function saveUpdates(_0x401a71){return function(_0x463f17){if(_0x463f17){return _0x463f17['update'](_0x401a71)[_0x9f3f('0x18')](function(_0x860259){return _0x860259;});}return null;};}function removeEntity(_0x46ffdb){return function(_0x255f10){if(_0x255f10){return _0x255f10[_0x9f3f('0x19')]()['then'](function(){_0x46ffdb[_0x9f3f('0x15')](0xcc)[_0x9f3f('0xf')]();});}};}function handleEntityNotFound(_0xe10d88){return function(_0x158a86){if(!_0x158a86){_0xe10d88[_0x9f3f('0xe')](0x194);}return _0x158a86;};}function handleError(_0x3d92db,_0x440b43){_0x440b43=_0x440b43||0x1f4;return function(_0x3bb632){logger[_0x9f3f('0x1a')](_0x3bb632[_0x9f3f('0x1b')]);if(_0x3bb632[_0x9f3f('0x1c')]){delete _0x3bb632['name'];}_0x3d92db[_0x9f3f('0x15')](_0x440b43)[_0x9f3f('0x1d')](_0x3bb632);};}exports['index']=function(_0x52e85d,_0xebb386){var _0x8999fb={};var _0x1dfe3c=_[_0x9f3f('0x1e')](db[_0x9f3f('0x1f')][_0x9f3f('0x20')],function(_0xedc06e){return{'name':_0xedc06e['fieldName'],'type':_0xedc06e[_0x9f3f('0x21')][_0x9f3f('0x22')]};});_0x8999fb=qs[_0x9f3f('0x23')](_0x1dfe3c,_0x52e85d);return interaction[_0x9f3f('0x24')](_0x9f3f('0x25'),_0x52e85d['query'],_0x52e85d['user'],_0x8999fb,_0x1dfe3c)[_0x9f3f('0x18')](respondWithFilteredResult(_0xebb386,_0x8999fb))[_0x9f3f('0x26')](handleError(_0xebb386,null));};exports[_0x9f3f('0x27')]=function(_0x18b5bb,_0x2419ec){var _0x2999de={'raw':![],'where':{'id':_0x18b5bb['params']['id']}},_0x16276c={};_0x16276c[_0x9f3f('0x28')]=_['keys'](db[_0x9f3f('0x1f')][_0x9f3f('0x20')]);_0x16276c[_0x9f3f('0x29')]=_[_0x9f3f('0x2a')](_0x18b5bb[_0x9f3f('0x29')]);_0x16276c[_0x9f3f('0x2b')]=_[_0x9f3f('0x2c')](_0x16276c[_0x9f3f('0x28')],_0x16276c[_0x9f3f('0x29')]);_0x2999de[_0x9f3f('0x2d')]=_['intersection'](_0x16276c['model'],qs[_0x9f3f('0x2e')](_0x18b5bb[_0x9f3f('0x29')][_0x9f3f('0x2e')]));_0x2999de[_0x9f3f('0x2d')]=_0x2999de[_0x9f3f('0x2d')][_0x9f3f('0x2f')]?_0x2999de[_0x9f3f('0x2d')]:_0x16276c[_0x9f3f('0x28')];if(_0x18b5bb['query'][_0x9f3f('0x30')]){_0x2999de[_0x9f3f('0x31')]=[{'all':!![]}];}_0x2999de=_['merge']({},_0x2999de,_0x18b5bb[_0x9f3f('0x32')]);return db[_0x9f3f('0x1f')]['find'](_0x2999de)[_0x9f3f('0x18')](handleEntityNotFound(_0x2419ec,null))[_0x9f3f('0x18')](respondWithResult(_0x2419ec,null))['catch'](handleError(_0x2419ec,null));};exports[_0x9f3f('0x33')]=function(_0x2691c3,_0x1bdd08){return db[_0x9f3f('0x1f')][_0x9f3f('0x33')](_0x2691c3[_0x9f3f('0x34')],{})['then'](respondWithResult(_0x1bdd08,0xc9))[_0x9f3f('0x26')](handleError(_0x1bdd08,null));};exports[_0x9f3f('0x35')]=function(_0x5141fb,_0x529dfc){if(_0x5141fb['body']['id']){delete _0x5141fb[_0x9f3f('0x34')]['id'];}return db[_0x9f3f('0x1f')][_0x9f3f('0x36')]({'where':{'id':_0x5141fb['params']['id']}})[_0x9f3f('0x18')](handleEntityNotFound(_0x529dfc,null))[_0x9f3f('0x18')](saveUpdates(_0x5141fb['body'],null))[_0x9f3f('0x18')](respondWithResult(_0x529dfc,null))['catch'](handleError(_0x529dfc,null));};exports[_0x9f3f('0x19')]=function(_0x5a4873,_0xa2bbba){return db[_0x9f3f('0x1f')][_0x9f3f('0x36')]({'where':{'id':_0x5a4873[_0x9f3f('0x37')]['id']}})[_0x9f3f('0x18')](handleEntityNotFound(_0xa2bbba,null))[_0x9f3f('0x18')](removeEntity(_0xa2bbba,null))[_0x9f3f('0x26')](handleError(_0xa2bbba,null));};exports['describe']=function(_0x19fc38,_0x165e9c){return db[_0x9f3f('0x1f')][_0x9f3f('0x38')]()[_0x9f3f('0x18')](respondWithResult(_0x165e9c,null))[_0x9f3f('0x26')](handleError(_0x165e9c,null));};exports['addMessage']=function(_0x576ed5,_0x408559){return db['SmsMessage']['find']({'where':{'id':_0x576ed5[_0x9f3f('0x37')]['id']}})['then'](handleEntityNotFound(_0x408559,null))['then'](function(_0x5aa510){if(_0x5aa510){return _0x5aa510[_0x9f3f('0x39')](_0x576ed5[_0x9f3f('0x34')][_0x9f3f('0x3a')],_[_0x9f3f('0x3b')](_0x576ed5[_0x9f3f('0x34')],['ids','id'])||{});}})['then'](respondWithResult(_0x408559,null))[_0x9f3f('0x26')](handleError(_0x408559,null));};exports[_0x9f3f('0x3c')]=function(_0x10df65,_0x14aa4e){var _0xd54709={'raw':![],'where':{}};var _0x1ba8a7={};var _0xae178={'count':0x0,'rows':[]};return db[_0x9f3f('0x1f')][_0x9f3f('0x3d')]({'where':{'id':_0x10df65['params']['id']}})[_0x9f3f('0x18')](handleEntityNotFound(_0x14aa4e,null))[_0x9f3f('0x18')](function(_0x5f7d8d){if(_0x5f7d8d){_0x1ba8a7[_0x9f3f('0x28')]=_[_0x9f3f('0x2a')](db[_0x9f3f('0x3e')]['rawAttributes']);_0x1ba8a7[_0x9f3f('0x29')]=_[_0x9f3f('0x2a')](_0x10df65[_0x9f3f('0x29')]);_0x1ba8a7[_0x9f3f('0x2b')]=_[_0x9f3f('0x2c')](_0x1ba8a7[_0x9f3f('0x28')],_0x1ba8a7[_0x9f3f('0x29')]);_0xd54709[_0x9f3f('0x2d')]=_['intersection'](_0x1ba8a7[_0x9f3f('0x28')],qs['fields'](_0x10df65[_0x9f3f('0x29')][_0x9f3f('0x2e')]));_0xd54709[_0x9f3f('0x2d')]=_0xd54709[_0x9f3f('0x2d')][_0x9f3f('0x2f')]?_0xd54709[_0x9f3f('0x2d')]:_0x1ba8a7[_0x9f3f('0x28')];if(!_0x10df65[_0x9f3f('0x29')][_0x9f3f('0x3f')](_0x9f3f('0x40'))){_0xd54709[_0x9f3f('0x13')]=qs['limit'](_0x10df65[_0x9f3f('0x29')][_0x9f3f('0x13')]);_0xd54709[_0x9f3f('0x11')]=qs[_0x9f3f('0x11')](_0x10df65['query'][_0x9f3f('0x11')]);}_0xd54709[_0x9f3f('0x41')]=qs[_0x9f3f('0x42')](_0x10df65['query']['sort']);_0xd54709[_0x9f3f('0x43')]=qs[_0x9f3f('0x2b')](_[_0x9f3f('0x44')](_0x10df65['query'],_0x1ba8a7[_0x9f3f('0x2b')]));_0xd54709['where']['SmsInteractionId']=_0x5f7d8d['id'];if(_0x10df65['query'][_0x9f3f('0x45')]){_0xd54709[_0x9f3f('0x43')]=_[_0x9f3f('0x46')](_0xd54709[_0x9f3f('0x43')],{'$or':_[_0x9f3f('0x1e')](_0xd54709['attributes'],function(_0x3f0037){var _0x188de4={};_0x188de4[_0x3f0037]={'$like':'%'+_0x10df65[_0x9f3f('0x29')][_0x9f3f('0x45')]+'%'};return _0x188de4;})});}if(_0x10df65[_0x9f3f('0x29')]['$gte']){var _0x16f36c=_0x10df65[_0x9f3f('0x29')]['$gte'][_0x9f3f('0x47')](',');var _0x78801b={};_0x78801b[_0x16f36c[0x0]]={'$gte':moment(_0x16f36c[0x1])['format'](_0x9f3f('0x48'))};_0xd54709['where']=_['merge'](_0xd54709[_0x9f3f('0x43')],_0x78801b);}_0xd54709=_[_0x9f3f('0x46')]({},_0xd54709,_0x10df65[_0x9f3f('0x32')]);return db[_0x9f3f('0x3e')]['count']({'where':_0xd54709['where']})[_0x9f3f('0x18')](function(_0x3f044c){_0xae178[_0x9f3f('0x14')]=_0x3f044c;if(_0x10df65[_0x9f3f('0x29')]['includeAll']){_0xd54709[_0x9f3f('0x31')]=[{'all':!![]}];}return db['SmsMessage'][_0x9f3f('0x24')](_0xd54709);})[_0x9f3f('0x18')](function(_0x5495a0){_0xae178['rows']=_0x5495a0;return _0xae178;});}})[_0x9f3f('0x18')](respondWithFilteredResult(_0x14aa4e,_0xd54709))[_0x9f3f('0x26')](handleError(_0x14aa4e,null));};exports[_0x9f3f('0x49')]=function(_0x117ffd,_0x143db0){return db[_0x9f3f('0x1f')][_0x9f3f('0x36')]({'where':{'id':_0x117ffd['params']['id']}})[_0x9f3f('0x18')](handleEntityNotFound(_0x143db0,null))['then'](function(_0x2f58bb){if(_0x2f58bb){return _0x2f58bb['setTags'](_0x117ffd[_0x9f3f('0x34')]['ids'],_[_0x9f3f('0x3b')](_0x117ffd['body'],['ids','id'])||{})[_0x9f3f('0x4a')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0x117ffd[_0x9f3f('0x34')][_0x9f3f('0x3a')]}});})['then'](function(_0x2dcfe6){socket['emit'](_0x9f3f('0x4b'),{'id':Number(_0x117ffd[_0x9f3f('0x37')]['id']),'tags':_0x2dcfe6||[]});return{'id':Number(_0x117ffd[_0x9f3f('0x37')]['id']),'tags':_0x2dcfe6||[]};});}})[_0x9f3f('0x18')](respondWithResult(_0x143db0,null))['catch'](handleError(_0x143db0,null));};exports[_0x9f3f('0x4c')]=function(_0x267ee2,_0x2dfcc8){return db[_0x9f3f('0x1f')][_0x9f3f('0x36')]({'where':{'id':_0x267ee2[_0x9f3f('0x37')]['id']}})[_0x9f3f('0x18')](handleEntityNotFound(_0x2dfcc8,null))['then'](function(_0xe24607){if(_0xe24607){return _0xe24607['removeTags'](_0x267ee2['query'][_0x9f3f('0x3a')]);}})[_0x9f3f('0x18')](respondWithStatusCode(_0x2dfcc8,null))[_0x9f3f('0x26')](handleError(_0x2dfcc8,null));};exports['download']=function(_0x11cae9,_0x43da91){var _0x42323b=moment()[_0x9f3f('0x4d')]()[_0x9f3f('0x4e')]();var _0x571a74=path['join'](config['root'],'server',_0x9f3f('0x4f'),_0x9f3f('0x50'));var _0x199f69=path[_0x9f3f('0x51')](_0x571a74,_0x42323b);var _0x4e50e4=util[_0x9f3f('0x52')](_0x9f3f('0x53'),_0x11cae9[_0x9f3f('0x37')]['id'],_0x42323b);var _0x53b76a=path[_0x9f3f('0x51')](_0x571a74,_0x4e50e4);var _0x3edccd=[];_0x3edccd['push']({'model':db[_0x9f3f('0x54')],'as':_0x9f3f('0x54'),'attributes':['id','fullname'],'raw':!![]});_0x3edccd['push']({'model':db[_0x9f3f('0x55')],'as':_0x9f3f('0x56'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x5e855b=[{'model':db[_0x9f3f('0x3e')],'as':_0x9f3f('0x57'),'attributes':['id',_0x9f3f('0x34'),'createdAt',_0x9f3f('0x58'),_0x9f3f('0x59'),_0x9f3f('0x5a')],'include':_0x3edccd}];_0x5e855b[_0x9f3f('0x5b')]({'model':db['SmsAccount'],'as':'Account','attributes':['id','name']});_0x5e855b[_0x9f3f('0x5b')]({'model':db['User'],'as':_0x9f3f('0x5c'),'attributes':['id',_0x9f3f('0x5d')]});return db[_0x9f3f('0x1f')]['find']({'where':{'id':_0x11cae9[_0x9f3f('0x37')]['id']},'include':_0x5e855b})['then'](handleEntityNotFound(_0x43da91,null))[_0x9f3f('0x18')](function(_0x48b045){if(_0x48b045){var _0x312861=_0x48b045['get']({'plain':!![]});fs[_0x9f3f('0x5e')](_0x199f69);var _0x3cc763={'channel':_0x9f3f('0x5f'),'account':_0x312861[_0x9f3f('0x60')][_0x9f3f('0x1c')],'agent':_0x312861[_0x9f3f('0x5c')]?_0x312861[_0x9f3f('0x5c')][_0x9f3f('0x5d')]:_0x9f3f('0x61'),'createdAt':moment(_0x312861[_0x9f3f('0x62')])[_0x9f3f('0x52')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9f3f('0x4e')](),'closedAt':_0x312861['closed']?moment(_0x312861[_0x9f3f('0x63')])[_0x9f3f('0x52')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9f3f('0x4e')]():'','disposition':_0x312861[_0x9f3f('0x64')],'messages':_(_0x312861[_0x9f3f('0x57')])[_0x9f3f('0x45')]({'secret':![]})[_0x9f3f('0x1e')](function(_0x137b2a){return{'date':moment(_0x137b2a[_0x9f3f('0x62')])[_0x9f3f('0x52')](_0x9f3f('0x48'))[_0x9f3f('0x4e')](),'sender':_0x137b2a['direction']==='out'?_0x137b2a[_0x9f3f('0x54')]?_0x137b2a[_0x9f3f('0x54')][_0x9f3f('0x5d')]:_0x9f3f('0x65'):_0x137b2a[_0x9f3f('0x56')][_0x9f3f('0x66')]+(_0x137b2a['Contact'][_0x9f3f('0x67')]?'\x20'+_0x137b2a['Contact'][_0x9f3f('0x67')]:''),'body':_0x137b2a[_0x9f3f('0x34')],'direction':_0x137b2a['direction']===_0x9f3f('0x68')?'A':'C','secret':_0x137b2a['secret'],'read':_0x137b2a[_0x9f3f('0x5a')]};})[_0x9f3f('0x69')]()};return ejs[_0x9f3f('0x6a')](path[_0x9f3f('0x51')](config[_0x9f3f('0x6b')],_0x9f3f('0x6c'),_0x9f3f('0x6d'),_0x9f3f('0x6e')),{'interaction':_0x3cc763})[_0x9f3f('0x18')](function(_0x4cfcff){var _0x46e1aa=path['join'](_0x199f69,_0x9f3f('0x6f')+_0x312861['id']+'-'+_0x42323b+_0x9f3f('0x70'));var _0x17313b={'path':_0x46e1aa,'channel':_0x9f3f('0x5f'),'interactionId':_0x312861['id']};return pdf[_0x9f3f('0x71')](_0x4cfcff,_0x17313b);})[_0x9f3f('0x18')](function(){return new BPromise(function(_0x37e6ed,_0x1906e5){zipdir(_0x199f69,{'saveTo':_0x53b76a},function(_0x2d9d8b,_0x19b212){if(_0x2d9d8b)return _0x1906e5(_0x2d9d8b);return _0x37e6ed(_0x19b212);});})[_0x9f3f('0x18')](function(){return new BPromise(function(_0x511ba6,_0x32a831){rimraf(_0x199f69,function(_0x3a023b){if(_0x3a023b)_0x32a831(_0x3a023b);return _0x511ba6();});});})['then'](function(){return _0x43da91[_0x9f3f('0x72')](_0x53b76a,_0x4e50e4,function(_0x41041a){if(_0x41041a){console[_0x9f3f('0x73')](_0x9f3f('0x74'),_0x41041a);}else{fs['unlinkSync'](_0x53b76a);}});});});}else{return _0x43da91[_0x9f3f('0xe')](0xc8);}})[_0x9f3f('0x26')](handleError(_0x43da91,null));}; \ No newline at end of file +var _0xedc5=['fullname','CmContact','Contact','firstName','lastName','Messages','direction','secret','read','SmsAccount','Owner','get','mkdirSync','Sms','Account','createdAt','format','toString','closed','closedAt','disposition','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','catch','create','body','find','params','destroy','describe','SmsMessage','addMessage','ids','omit','getMessages','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','Tag','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','join','transcript-%d-%s.zip','push','User'];(function(_0x135bf8,_0x729662){var _0x13d41c=function(_0x117587){while(--_0x117587){_0x135bf8['push'](_0x135bf8['shift']());}};_0x13d41c(++_0x729662);}(_0xedc5,0x9a));var _0x5edc=function(_0x4baac8,_0x5f1dc7){_0x4baac8=_0x4baac8-0x0;var _0x56ebc5=_0xedc5[_0x4baac8];return _0x56ebc5;};'use strict';var rimraf=require(_0x5edc('0x0'));var zipdir=require(_0x5edc('0x1'));var moment=require(_0x5edc('0x2'));var BPromise=require(_0x5edc('0x3'));var util=require(_0x5edc('0x4'));var path=require(_0x5edc('0x5'));var ejs=require(_0x5edc('0x6'));var fs=require('fs');var _=require(_0x5edc('0x7'));var Redis=require(_0x5edc('0x8'));var interaction=require(_0x5edc('0x9'));var qs=require(_0x5edc('0xa'));var pdf=require(_0x5edc('0xb'));var logger=require(_0x5edc('0xc'))('api');var config=require(_0x5edc('0xd'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5edc('0xe')](config[_0x5edc('0xf')],{'host':_0x5edc('0x10'),'port':0x18eb});var socket=require(_0x5edc('0x11'))(new Redis(config[_0x5edc('0xf')]));require(_0x5edc('0x12'))['register'](socket);function respondWithStatusCode(_0x2c1f18,_0x11b879){_0x11b879=_0x11b879||0xcc;return function(_0x32f15c){if(_0x32f15c){return _0x2c1f18[_0x5edc('0x13')](_0x11b879);}return _0x2c1f18[_0x5edc('0x14')](_0x11b879)[_0x5edc('0x15')]();};}function respondWithResult(_0x3a372f,_0x2564fe){_0x2564fe=_0x2564fe||0xc8;return function(_0x22c176){if(_0x22c176){return _0x3a372f[_0x5edc('0x14')](_0x2564fe)['json'](_0x22c176);}};}function respondWithFilteredResult(_0x49d1cb,_0x5204af){return function(_0x5134a1){if(_0x5134a1){var _0x1f4713=typeof _0x5204af[_0x5edc('0x16')]==='undefined'&&typeof _0x5204af[_0x5edc('0x17')]===_0x5edc('0x18');var _0x4e92fd=_0x5134a1[_0x5edc('0x19')];var _0x4ae17b=_0x1f4713?0x0:_0x5204af[_0x5edc('0x16')];var _0x19672a=_0x1f4713?_0x5134a1['count']:_0x5204af[_0x5edc('0x16')]+_0x5204af[_0x5edc('0x17')];var _0xcbccf1;if(_0x19672a>=_0x4e92fd){_0x19672a=_0x4e92fd;_0xcbccf1=0xc8;}else{_0xcbccf1=0xce;}_0x49d1cb[_0x5edc('0x14')](_0xcbccf1);return _0x49d1cb[_0x5edc('0x1a')](_0x5edc('0x1b'),_0x4ae17b+'-'+_0x19672a+'/'+_0x4e92fd)['json'](_0x5134a1);}return null;};}function saveUpdates(_0x3f611f){return function(_0x5848e6){if(_0x5848e6){return _0x5848e6[_0x5edc('0x1c')](_0x3f611f)['then'](function(_0x3b8daa){return _0x3b8daa;});}return null;};}function removeEntity(_0x1a48ab){return function(_0x225f66){if(_0x225f66){return _0x225f66['destroy']()[_0x5edc('0x1d')](function(){_0x1a48ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x289298){return function(_0x136e62){if(!_0x136e62){_0x289298[_0x5edc('0x13')](0x194);}return _0x136e62;};}function handleError(_0x209a1f,_0x1b3b52){_0x1b3b52=_0x1b3b52||0x1f4;return function(_0x3bf0e6){logger[_0x5edc('0x1e')](_0x3bf0e6[_0x5edc('0x1f')]);if(_0x3bf0e6[_0x5edc('0x20')]){delete _0x3bf0e6[_0x5edc('0x20')];}_0x209a1f['status'](_0x1b3b52)[_0x5edc('0x21')](_0x3bf0e6);};}exports['index']=function(_0x55d5df,_0x31f019){var _0x2a3b6f={};var _0x5166d7=_[_0x5edc('0x22')](db[_0x5edc('0x23')][_0x5edc('0x24')],function(_0x497f59){return{'name':_0x497f59[_0x5edc('0x25')],'type':_0x497f59[_0x5edc('0x26')][_0x5edc('0x27')]};});_0x2a3b6f=qs[_0x5edc('0x28')](_0x5166d7,_0x55d5df);return interaction[_0x5edc('0x29')]('sms',_0x55d5df[_0x5edc('0x2a')],_0x55d5df[_0x5edc('0x2b')],_0x2a3b6f,_0x5166d7)[_0x5edc('0x1d')](respondWithFilteredResult(_0x31f019,_0x2a3b6f))['catch'](handleError(_0x31f019,null));};exports[_0x5edc('0x2c')]=function(_0x2539f7,_0x43247c){var _0x5d8dbd={'raw':![],'where':{'id':_0x2539f7['params']['id']}},_0x3da070={};_0x3da070[_0x5edc('0x2d')]=_[_0x5edc('0x2e')](db[_0x5edc('0x23')][_0x5edc('0x24')]);_0x3da070['query']=_[_0x5edc('0x2e')](_0x2539f7[_0x5edc('0x2a')]);_0x3da070[_0x5edc('0x2f')]=_[_0x5edc('0x30')](_0x3da070['model'],_0x3da070[_0x5edc('0x2a')]);_0x5d8dbd[_0x5edc('0x31')]=_[_0x5edc('0x30')](_0x3da070[_0x5edc('0x2d')],qs[_0x5edc('0x32')](_0x2539f7[_0x5edc('0x2a')]['fields']));_0x5d8dbd[_0x5edc('0x31')]=_0x5d8dbd['attributes'][_0x5edc('0x33')]?_0x5d8dbd['attributes']:_0x3da070[_0x5edc('0x2d')];if(_0x2539f7[_0x5edc('0x2a')][_0x5edc('0x34')]){_0x5d8dbd[_0x5edc('0x35')]=[{'all':!![]}];}_0x5d8dbd=_[_0x5edc('0x36')]({},_0x5d8dbd,_0x2539f7[_0x5edc('0x37')]);return db[_0x5edc('0x23')]['find'](_0x5d8dbd)['then'](handleEntityNotFound(_0x43247c,null))[_0x5edc('0x1d')](respondWithResult(_0x43247c,null))[_0x5edc('0x38')](handleError(_0x43247c,null));};exports[_0x5edc('0x39')]=function(_0x43189c,_0x3d11b6){return db[_0x5edc('0x23')][_0x5edc('0x39')](_0x43189c['body'],{})[_0x5edc('0x1d')](respondWithResult(_0x3d11b6,0xc9))[_0x5edc('0x38')](handleError(_0x3d11b6,null));};exports[_0x5edc('0x1c')]=function(_0x639c35,_0x48c562){if(_0x639c35[_0x5edc('0x3a')]['id']){delete _0x639c35['body']['id'];}return db[_0x5edc('0x23')][_0x5edc('0x3b')]({'where':{'id':_0x639c35[_0x5edc('0x3c')]['id']}})[_0x5edc('0x1d')](handleEntityNotFound(_0x48c562,null))[_0x5edc('0x1d')](saveUpdates(_0x639c35['body'],null))[_0x5edc('0x1d')](respondWithResult(_0x48c562,null))[_0x5edc('0x38')](handleError(_0x48c562,null));};exports[_0x5edc('0x3d')]=function(_0x3c9937,_0x61b880){return db['SmsInteraction'][_0x5edc('0x3b')]({'where':{'id':_0x3c9937[_0x5edc('0x3c')]['id']}})[_0x5edc('0x1d')](handleEntityNotFound(_0x61b880,null))['then'](removeEntity(_0x61b880,null))[_0x5edc('0x38')](handleError(_0x61b880,null));};exports[_0x5edc('0x3e')]=function(_0x309191,_0x46faa4){return db['SmsInteraction'][_0x5edc('0x3e')]()['then'](respondWithResult(_0x46faa4,null))[_0x5edc('0x38')](handleError(_0x46faa4,null));};exports['addMessage']=function(_0x1e5de1,_0x58a592){return db[_0x5edc('0x3f')][_0x5edc('0x3b')]({'where':{'id':_0x1e5de1[_0x5edc('0x3c')]['id']}})[_0x5edc('0x1d')](handleEntityNotFound(_0x58a592,null))[_0x5edc('0x1d')](function(_0x914f84){if(_0x914f84){return _0x914f84[_0x5edc('0x40')](_0x1e5de1[_0x5edc('0x3a')][_0x5edc('0x41')],_[_0x5edc('0x42')](_0x1e5de1[_0x5edc('0x3a')],[_0x5edc('0x41'),'id'])||{});}})[_0x5edc('0x1d')](respondWithResult(_0x58a592,null))[_0x5edc('0x38')](handleError(_0x58a592,null));};exports[_0x5edc('0x43')]=function(_0xac1e44,_0x469144){var _0xed202c={'raw':![],'where':{}};var _0x421f48={};var _0x22cf8f={'count':0x0,'rows':[]};return db[_0x5edc('0x23')]['findOne']({'where':{'id':_0xac1e44['params']['id']}})[_0x5edc('0x1d')](handleEntityNotFound(_0x469144,null))[_0x5edc('0x1d')](function(_0x493b00){if(_0x493b00){_0x421f48['model']=_[_0x5edc('0x2e')](db[_0x5edc('0x3f')][_0x5edc('0x24')]);_0x421f48[_0x5edc('0x2a')]=_[_0x5edc('0x2e')](_0xac1e44['query']);_0x421f48[_0x5edc('0x2f')]=_[_0x5edc('0x30')](_0x421f48['model'],_0x421f48[_0x5edc('0x2a')]);_0xed202c['attributes']=_[_0x5edc('0x30')](_0x421f48[_0x5edc('0x2d')],qs[_0x5edc('0x32')](_0xac1e44[_0x5edc('0x2a')][_0x5edc('0x32')]));_0xed202c[_0x5edc('0x31')]=_0xed202c[_0x5edc('0x31')][_0x5edc('0x33')]?_0xed202c[_0x5edc('0x31')]:_0x421f48[_0x5edc('0x2d')];if(!_0xac1e44[_0x5edc('0x2a')]['hasOwnProperty'](_0x5edc('0x44'))){_0xed202c[_0x5edc('0x17')]=qs[_0x5edc('0x17')](_0xac1e44[_0x5edc('0x2a')][_0x5edc('0x17')]);_0xed202c[_0x5edc('0x16')]=qs['offset'](_0xac1e44[_0x5edc('0x2a')]['offset']);}_0xed202c['order']=qs[_0x5edc('0x45')](_0xac1e44['query'][_0x5edc('0x45')]);_0xed202c[_0x5edc('0x46')]=qs['filters'](_[_0x5edc('0x47')](_0xac1e44[_0x5edc('0x2a')],_0x421f48['filters']));_0xed202c[_0x5edc('0x46')][_0x5edc('0x48')]=_0x493b00['id'];if(_0xac1e44[_0x5edc('0x2a')][_0x5edc('0x49')]){_0xed202c[_0x5edc('0x46')]=_[_0x5edc('0x36')](_0xed202c[_0x5edc('0x46')],{'$or':_[_0x5edc('0x22')](_0xed202c[_0x5edc('0x31')],function(_0x3eba16){var _0x5794c4={};_0x5794c4[_0x3eba16]={'$like':'%'+_0xac1e44[_0x5edc('0x2a')][_0x5edc('0x49')]+'%'};return _0x5794c4;})});}if(_0xac1e44['query'][_0x5edc('0x4a')]){var _0x1205c1=_0xac1e44['query']['$gte'][_0x5edc('0x4b')](',');var _0x5c2608={};_0x5c2608[_0x1205c1[0x0]]={'$gte':moment(_0x1205c1[0x1])['format'](_0x5edc('0x4c'))};_0xed202c[_0x5edc('0x46')]=_[_0x5edc('0x36')](_0xed202c['where'],_0x5c2608);}_0xed202c=_['merge']({},_0xed202c,_0xac1e44[_0x5edc('0x37')]);return db[_0x5edc('0x3f')]['count']({'where':_0xed202c[_0x5edc('0x46')]})['then'](function(_0x4e2ee1){_0x22cf8f[_0x5edc('0x19')]=_0x4e2ee1;if(_0xac1e44['query'][_0x5edc('0x34')]){_0xed202c[_0x5edc('0x35')]=[{'all':!![]}];}return db[_0x5edc('0x3f')]['findAll'](_0xed202c);})[_0x5edc('0x1d')](function(_0x2c7401){_0x22cf8f['rows']=_0x2c7401;return _0x22cf8f;});}})[_0x5edc('0x1d')](respondWithFilteredResult(_0x469144,_0xed202c))[_0x5edc('0x38')](handleError(_0x469144,null));};exports[_0x5edc('0x4d')]=function(_0x139225,_0x36924d){return db[_0x5edc('0x23')]['find']({'where':{'id':_0x139225[_0x5edc('0x3c')]['id']}})[_0x5edc('0x1d')](handleEntityNotFound(_0x36924d,null))['then'](function(_0x509067){if(_0x509067){return _0x509067[_0x5edc('0x4e')](_0x139225[_0x5edc('0x3a')]['ids'],_[_0x5edc('0x42')](_0x139225[_0x5edc('0x3a')],[_0x5edc('0x41'),'id'])||{})['spread'](function(){return db[_0x5edc('0x4f')][_0x5edc('0x29')]({'attributes':['id','name','color'],'where':{'id':_0x139225['body']['ids']}});})[_0x5edc('0x1d')](function(_0x1dbd14){socket[_0x5edc('0x50')](_0x5edc('0x51'),{'id':Number(_0x139225[_0x5edc('0x3c')]['id']),'tags':_0x1dbd14||[]});return{'id':Number(_0x139225[_0x5edc('0x3c')]['id']),'tags':_0x1dbd14||[]};});}})[_0x5edc('0x1d')](respondWithResult(_0x36924d,null))['catch'](handleError(_0x36924d,null));};exports['removeTags']=function(_0x2c91d0,_0x1a1f1c){return db[_0x5edc('0x23')][_0x5edc('0x3b')]({'where':{'id':_0x2c91d0[_0x5edc('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1a1f1c,null))[_0x5edc('0x1d')](function(_0x14a3e1){if(_0x14a3e1){return _0x14a3e1[_0x5edc('0x52')](_0x2c91d0[_0x5edc('0x2a')]['ids']);}})['then'](respondWithStatusCode(_0x1a1f1c,null))[_0x5edc('0x38')](handleError(_0x1a1f1c,null));};exports[_0x5edc('0x53')]=function(_0x138c88,_0x49442b){var _0x1dee7b=moment()[_0x5edc('0x54')]()['toString']();var _0x13a1ad=path['join'](config[_0x5edc('0x55')],_0x5edc('0x56'),_0x5edc('0x57'),'tmp');var _0xce47c1=path[_0x5edc('0x58')](_0x13a1ad,_0x1dee7b);var _0x893c44=util['format'](_0x5edc('0x59'),_0x138c88['params']['id'],_0x1dee7b);var _0x1b9d34=path[_0x5edc('0x58')](_0x13a1ad,_0x893c44);var _0x5e0222=[];_0x5e0222[_0x5edc('0x5a')]({'model':db['User'],'as':_0x5edc('0x5b'),'attributes':['id',_0x5edc('0x5c')],'raw':!![]});_0x5e0222[_0x5edc('0x5a')]({'model':db[_0x5edc('0x5d')],'as':_0x5edc('0x5e'),'attributes':['id',_0x5edc('0x5f'),_0x5edc('0x60')],'raw':!![]});var _0x356ec0=[{'model':db[_0x5edc('0x3f')],'as':_0x5edc('0x61'),'attributes':['id','body','createdAt',_0x5edc('0x62'),_0x5edc('0x63'),_0x5edc('0x64')],'include':_0x5e0222}];_0x356ec0[_0x5edc('0x5a')]({'model':db[_0x5edc('0x65')],'as':'Account','attributes':['id',_0x5edc('0x20')]});_0x356ec0[_0x5edc('0x5a')]({'model':db[_0x5edc('0x5b')],'as':_0x5edc('0x66'),'attributes':['id',_0x5edc('0x5c')]});return db[_0x5edc('0x23')][_0x5edc('0x3b')]({'where':{'id':_0x138c88[_0x5edc('0x3c')]['id']},'include':_0x356ec0})[_0x5edc('0x1d')](handleEntityNotFound(_0x49442b,null))[_0x5edc('0x1d')](function(_0x15eaef){if(_0x15eaef){var _0x16ad26=_0x15eaef[_0x5edc('0x67')]({'plain':!![]});fs[_0x5edc('0x68')](_0xce47c1);var _0x40cc69={'channel':_0x5edc('0x69'),'account':_0x16ad26[_0x5edc('0x6a')][_0x5edc('0x20')],'agent':_0x16ad26[_0x5edc('0x66')]?_0x16ad26[_0x5edc('0x66')]['fullname']:'N.A.','createdAt':moment(_0x16ad26[_0x5edc('0x6b')])[_0x5edc('0x6c')](_0x5edc('0x4c'))[_0x5edc('0x6d')](),'closedAt':_0x16ad26[_0x5edc('0x6e')]?moment(_0x16ad26[_0x5edc('0x6f')])[_0x5edc('0x6c')](_0x5edc('0x4c'))[_0x5edc('0x6d')]():'','disposition':_0x16ad26[_0x5edc('0x70')],'messages':_(_0x16ad26['Messages'])[_0x5edc('0x49')]({'secret':![]})[_0x5edc('0x22')](function(_0x5b7ea2){return{'date':moment(_0x5b7ea2[_0x5edc('0x6b')])['format'](_0x5edc('0x4c'))[_0x5edc('0x6d')](),'sender':_0x5b7ea2['direction']===_0x5edc('0x71')?_0x5b7ea2[_0x5edc('0x5b')]?_0x5b7ea2[_0x5edc('0x5b')][_0x5edc('0x5c')]:_0x5edc('0x72'):_0x5b7ea2[_0x5edc('0x5e')][_0x5edc('0x5f')]+(_0x5b7ea2[_0x5edc('0x5e')][_0x5edc('0x60')]?'\x20'+_0x5b7ea2['Contact']['lastName']:''),'body':_0x5b7ea2[_0x5edc('0x3a')],'direction':_0x5b7ea2[_0x5edc('0x62')]===_0x5edc('0x71')?'A':'C','secret':_0x5b7ea2['secret'],'read':_0x5b7ea2[_0x5edc('0x64')]};})[_0x5edc('0x73')]()};return ejs[_0x5edc('0x74')](path[_0x5edc('0x58')](config[_0x5edc('0x55')],_0x5edc('0x56'),_0x5edc('0x75'),_0x5edc('0x76')),{'interaction':_0x40cc69})['then'](function(_0x2a35ff){var _0x4210ac=path[_0x5edc('0x58')](_0xce47c1,_0x5edc('0x77')+_0x16ad26['id']+'-'+_0x1dee7b+_0x5edc('0x78'));var _0x411cd0={'path':_0x4210ac,'channel':_0x5edc('0x69'),'interactionId':_0x16ad26['id']};return pdf[_0x5edc('0x79')](_0x2a35ff,_0x411cd0);})[_0x5edc('0x1d')](function(){return new BPromise(function(_0x659249,_0x258757){zipdir(_0xce47c1,{'saveTo':_0x1b9d34},function(_0x291cfe,_0x21cfdc){if(_0x291cfe)return _0x258757(_0x291cfe);return _0x659249(_0x21cfdc);});})['then'](function(){return new BPromise(function(_0x2d9d3a,_0x126e17){rimraf(_0xce47c1,function(_0x10f49b){if(_0x10f49b)_0x126e17(_0x10f49b);return _0x2d9d3a();});});})[_0x5edc('0x1d')](function(){return _0x49442b[_0x5edc('0x53')](_0x1b9d34,_0x893c44,function(_0x22caca){if(_0x22caca){console[_0x5edc('0x7a')]('err',_0x22caca);}else{fs['unlinkSync'](_0x1b9d34);}});});});}else{return _0x49442b['sendStatus'](0xc8);}})[_0x5edc('0x38')](handleError(_0x49442b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 9deb568..f2b968c 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 _0x1eba=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','update'];(function(_0x36ccb5,_0x5f4603){var _0x52ecf6=function(_0x25a09f){while(--_0x25a09f){_0x36ccb5['push'](_0x36ccb5['shift']());}};_0x52ecf6(++_0x5f4603);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1eba[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xa1eb('0x0'));var SmsInteraction=require(_0xa1eb('0x1'))['db'][_0xa1eb('0x2')];var SmsMessage=require(_0xa1eb('0x1'))['db'][_0xa1eb('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa1eb('0x4'),'afterDestroy':_0xa1eb('0x5')};function emitEvent(_0x16a13a){return function(_0xf9d704,_0x138789,_0x2933d0){_0xf9d704[_0xa1eb('0x6')]({'attributes':['id'],'raw':!![]})[_0xa1eb('0x7')](function(_0x39a5a3){_0xf9d704[_0xa1eb('0x8')](_0xa1eb('0x9'),_0x39a5a3[_0xa1eb('0xa')](function(_0x54d235){return{'id':_0x54d235['id']};}));return SmsMessage[_0xa1eb('0xb')]({'where':{'SmsInteractionId':_0xf9d704['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x219802){_0xf9d704['setDataValue'](_0xa1eb('0xc'),_0x219802['length']);SmsInteractionEvents[_0xa1eb('0xd')](_0x16a13a+':'+_0xf9d704['id'],_0xf9d704);SmsInteractionEvents['emit'](_0x16a13a,_0xf9d704);_0x2933d0(null);})[_0xa1eb('0xe')](_0x2933d0(null));};}for(var e in events){if(events[_0xa1eb('0xf')](e)){var event=events[e];SmsInteraction[_0xa1eb('0x10')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x205a0e,_0x155795){var _0x1bf100=function(_0x21a5d0){while(--_0x21a5d0){_0x205a0e['push'](_0x205a0e['shift']());}};_0x1bf100(++_0x155795);}(_0xadb5,0xad));var _0x5adb=function(_0x452b77,_0x472344){_0x452b77=_0x452b77-0x0;var _0x175a01=_0xadb5[_0x452b77];return _0x175a01;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x5adb('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return SmsMessage[_0x5adb('0xa')]({'where':{'SmsInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);SmsInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);SmsInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 41c4324..b3e504f 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 _0x5f62=['moment','bluebird','path','../../config/environment','exports','define','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger'];(function(_0x5c5684,_0x54de2a){var _0x287132=function(_0x3ea34f){while(--_0x3ea34f){_0x5c5684['push'](_0x5c5684['shift']());}};_0x287132(++_0x54de2a);}(_0x5f62,0x111));var _0x25f6=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x5f62[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x25f6('0x0'));var util=require('util');var logger=require(_0x25f6('0x1'))('api');var moment=require(_0x25f6('0x2'));var BPromise=require(_0x25f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25f6('0x4'));var rimraf=require('rimraf');var config=require(_0x25f6('0x5'));var attributes=require('./smsInteraction.attributes');module[_0x25f6('0x6')]=function(_0x2f31e8,_0x5d72d8){return _0x2f31e8[_0x25f6('0x7')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50433c,_0x2600c8,_0x5c60b5){if(_0x50433c[_0x25f6('0x8')]('closed')){_0x50433c[_0x25f6('0x9')]=moment()['format'](_0x25f6('0xa'));}_0x5c60b5(null,_0x50433c);}}});}; \ No newline at end of file +var _0x1317=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','./smsInteraction.attributes','exports','sms_interactions','changed','closed'];(function(_0x5d1b25,_0x5d2743){var _0x1f6834=function(_0xc66ee2){while(--_0xc66ee2){_0x5d1b25['push'](_0x5d1b25['shift']());}};_0x1f6834(++_0x5d2743);}(_0x1317,0x1d4));var _0x7131=function(_0xafc41c,_0x7064f0){_0xafc41c=_0xafc41c-0x0;var _0x53039d=_0x1317[_0xafc41c];return _0x53039d;};'use strict';var _=require(_0x7131('0x0'));var util=require(_0x7131('0x1'));var logger=require(_0x7131('0x2'))(_0x7131('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7131('0x4'));var fs=require('fs');var path=require(_0x7131('0x5'));var rimraf=require(_0x7131('0x6'));var config=require('../../config/environment');var attributes=require(_0x7131('0x7'));module[_0x7131('0x8')]=function(_0x463902,_0x5f56d3){return _0x463902['define']('SmsInteraction',attributes,{'tableName':_0x7131('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36566c,_0x376c63,_0x14b5c2){if(_0x36566c[_0x7131('0xa')](_0x7131('0xb'))){_0x36566c[_0x7131('0xc')]=moment()[_0x7131('0xd')](_0x7131('0xe'));}_0x14b5c2(null,_0x36566c);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a4549fd..8e3a8b4 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 _0xac65=['client','http','redis','defaults','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','limit','AddTagsToSmsInteraction','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17860d,_0x196353){var _0x3124a1=function(_0x447399){while(--_0x447399){_0x17860d['push'](_0x17860d['shift']());}};_0x3124a1(++_0x196353);}(_0xac65,0x103));var _0x5ac6=function(_0x3f999c,_0x44cd14){_0x3f999c=_0x3f999c-0x0;var _0xf56ef9=_0xac65[_0x3f999c];return _0xf56ef9;};'use strict';var _=require(_0x5ac6('0x0'));var util=require(_0x5ac6('0x1'));var moment=require(_0x5ac6('0x2'));var BPromise=require(_0x5ac6('0x3'));var rs=require(_0x5ac6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ac6('0x5'))['db'];var utils=require(_0x5ac6('0x6'));var logger=require(_0x5ac6('0x7'))(_0x5ac6('0x8'));var config=require(_0x5ac6('0x9'));var jayson=require(_0x5ac6('0xa'));var client=jayson[_0x5ac6('0xb')][_0x5ac6('0xc')]({'port':0x232a});config[_0x5ac6('0xd')]=_[_0x5ac6('0xe')](config[_0x5ac6('0xd')],{'host':_0x5ac6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ac6('0xd')]));require(_0x5ac6('0x10'))[_0x5ac6('0x11')](socket);function respondWithRpcPromise(_0x2eb553,_0x5999f3,_0x369dfd){return new BPromise(function(_0x53774a,_0x218955){return client[_0x5ac6('0x12')](_0x2eb553,_0x369dfd)[_0x5ac6('0x13')](function(_0xea29ca){logger[_0x5ac6('0x14')](_0x5ac6('0x15'),_0x5999f3,'request\x20sent');logger[_0x5ac6('0x16')](_0x5ac6('0x17'),_0x5999f3,_0x5ac6('0x18'),JSON[_0x5ac6('0x19')](_0xea29ca));if(_0xea29ca['error']){if(_0xea29ca[_0x5ac6('0x1a')][_0x5ac6('0x1b')]===0x1f4){logger[_0x5ac6('0x1a')](_0x5ac6('0x15'),_0x5999f3,_0xea29ca[_0x5ac6('0x1a')][_0x5ac6('0x1c')]);return _0x218955(_0xea29ca[_0x5ac6('0x1a')][_0x5ac6('0x1c')]);}logger[_0x5ac6('0x1a')](_0x5ac6('0x15'),_0x5999f3,_0xea29ca[_0x5ac6('0x1a')][_0x5ac6('0x1c')]);return _0x53774a(_0xea29ca[_0x5ac6('0x1a')]['message']);}else{logger[_0x5ac6('0x14')](_0x5ac6('0x15'),_0x5999f3,_0x5ac6('0x18'));_0x53774a(_0xea29ca[_0x5ac6('0x1d')][_0x5ac6('0x1c')]);}})[_0x5ac6('0x1e')](function(_0x311e14){logger[_0x5ac6('0x1a')](_0x5ac6('0x15'),_0x5999f3,_0x311e14);_0x218955(_0x311e14);});});}exports[_0x5ac6('0x1f')]=function(_0x3819df){var _0xba1d77=this;return new Promise(function(_0x4d4c63,_0x5c1a46){return db[_0x5ac6('0x20')][_0x5ac6('0x21')](_0x3819df[_0x5ac6('0x22')],{'raw':_0x3819df[_0x5ac6('0x23')]?_0x3819df[_0x5ac6('0x23')][_0x5ac6('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3819df[_0x5ac6('0x23')]?_0x3819df[_0x5ac6('0x23')]['where']||null:null,'attributes':_0x3819df[_0x5ac6('0x23')]?_0x3819df[_0x5ac6('0x23')][_0x5ac6('0x25')]||null:null,'limit':_0x3819df['options']?_0x3819df[_0x5ac6('0x23')][_0x5ac6('0x26')]||null:null})['then'](function(_0x31e0d6){logger[_0x5ac6('0x14')](_0x5ac6('0x1f'),_0x3819df);logger[_0x5ac6('0x16')](_0x5ac6('0x1f'),_0x3819df,JSON[_0x5ac6('0x19')](_0x31e0d6));_0x4d4c63(_0x31e0d6);})[_0x5ac6('0x1e')](function(_0x43a63a){logger[_0x5ac6('0x1a')](_0x5ac6('0x1f'),_0x43a63a[_0x5ac6('0x1c')],_0x3819df);_0x5c1a46(_0xba1d77[_0x5ac6('0x1a')](0x1f4,_0x43a63a[_0x5ac6('0x1c')]));});});};exports[_0x5ac6('0x27')]=function(_0x30aff9){return new Promise(function(_0x3e066a,_0x469312){return db[_0x5ac6('0x20')]['find']({'where':_0x30aff9[_0x5ac6('0x23')]?_0x30aff9['options'][_0x5ac6('0x28')]||null:null})['then'](function(_0xd764cc){if(_0xd764cc){return _0xd764cc[_0x5ac6('0x29')](_0x30aff9[_0x5ac6('0x22')][_0x5ac6('0x2a')],_['omit'](_0x30aff9[_0x5ac6('0x22')],[_0x5ac6('0x2a'),'id'])||{});}})[_0x5ac6('0x2b')](function(_0x29a9bb){logger[_0x5ac6('0x14')](_0x5ac6('0x2c'),_0x30aff9);logger[_0x5ac6('0x16')](_0x5ac6('0x2c'),_0x30aff9,JSON[_0x5ac6('0x19')](_0x29a9bb));_0x3e066a(_0x29a9bb);})['catch'](function(_0x8ed9fe){logger[_0x5ac6('0x1a')](_0x5ac6('0x2c'),_0x8ed9fe['message'],_0x30aff9);_0x469312(_this['error'](0x1f4,_0x8ed9fe['message']));});});}; \ No newline at end of file +var _0x89aa=['limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','update','body','options','where','attributes'];(function(_0x59877a,_0x345a41){var _0xc116eb=function(_0x30ca9c){while(--_0x30ca9c){_0x59877a['push'](_0x59877a['shift']());}};_0xc116eb(++_0x345a41);}(_0x89aa,0xdc));var _0xa89a=function(_0x1453b0,_0x3fb8d6){_0x1453b0=_0x1453b0-0x0;var _0x1b439c=_0x89aa[_0x1453b0];return _0x1b439c;};'use strict';var _=require(_0xa89a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa89a('0x1'));var rs=require(_0xa89a('0x2'));var fs=require('fs');var Redis=require(_0xa89a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa89a('0x4'));var logger=require(_0xa89a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xa89a('0x6')]=_[_0xa89a('0x7')](config['redis'],{'host':_0xa89a('0x8'),'port':0x18eb});var socket=require(_0xa89a('0x9'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xa89a('0xa')](socket);function respondWithRpcPromise(_0x23d696,_0x433b51,_0xe8a4df){return new BPromise(function(_0x2015f1,_0x35cccf){return client['request'](_0x23d696,_0xe8a4df)[_0xa89a('0xb')](function(_0x46135c){logger[_0xa89a('0xc')](_0xa89a('0xd'),_0x433b51,_0xa89a('0xe'));logger[_0xa89a('0xf')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x433b51,_0xa89a('0xe'),JSON[_0xa89a('0x10')](_0x46135c));if(_0x46135c[_0xa89a('0x11')]){if(_0x46135c[_0xa89a('0x11')][_0xa89a('0x12')]===0x1f4){logger['error'](_0xa89a('0xd'),_0x433b51,_0x46135c[_0xa89a('0x11')][_0xa89a('0x13')]);return _0x35cccf(_0x46135c[_0xa89a('0x11')][_0xa89a('0x13')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x433b51,_0x46135c[_0xa89a('0x11')][_0xa89a('0x13')]);return _0x2015f1(_0x46135c[_0xa89a('0x11')][_0xa89a('0x13')]);}else{logger[_0xa89a('0xc')](_0xa89a('0xd'),_0x433b51,_0xa89a('0xe'));_0x2015f1(_0x46135c['result']['message']);}})['catch'](function(_0x596588){logger[_0xa89a('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x433b51,_0x596588);_0x35cccf(_0x596588);});});}exports['UpdateSmsInteraction']=function(_0x545692){var _0x786a1f=this;return new Promise(function(_0x480a6f,_0x15439c){return db['SmsInteraction'][_0xa89a('0x14')](_0x545692[_0xa89a('0x15')],{'raw':_0x545692[_0xa89a('0x16')]?_0x545692['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x545692[_0xa89a('0x16')]?_0x545692['options'][_0xa89a('0x17')]||null:null,'attributes':_0x545692[_0xa89a('0x16')]?_0x545692[_0xa89a('0x16')][_0xa89a('0x18')]||null:null,'limit':_0x545692[_0xa89a('0x16')]?_0x545692[_0xa89a('0x16')][_0xa89a('0x19')]||null:null})['then'](function(_0x7b73b0){logger[_0xa89a('0xc')](_0xa89a('0x1a'),_0x545692);logger[_0xa89a('0xf')]('UpdateSmsInteraction',_0x545692,JSON[_0xa89a('0x10')](_0x7b73b0));_0x480a6f(_0x7b73b0);})['catch'](function(_0x357739){logger[_0xa89a('0x11')](_0xa89a('0x1a'),_0x357739['message'],_0x545692);_0x15439c(_0x786a1f['error'](0x1f4,_0x357739['message']));});});};exports[_0xa89a('0x1b')]=function(_0x45d7a7){return new Promise(function(_0x2b6339,_0x4f6bd3){return db['SmsInteraction'][_0xa89a('0x1c')]({'where':_0x45d7a7[_0xa89a('0x16')]?_0x45d7a7[_0xa89a('0x16')][_0xa89a('0x17')]||null:null})[_0xa89a('0xb')](function(_0x5b2bbc){if(_0x5b2bbc){return _0x5b2bbc[_0xa89a('0x1d')](_0x45d7a7[_0xa89a('0x15')][_0xa89a('0x1e')],_[_0xa89a('0x1f')](_0x45d7a7['body'],['ids','id'])||{});}})[_0xa89a('0x20')](function(_0x48c03c){logger[_0xa89a('0xc')](_0xa89a('0x21'),_0x45d7a7);logger[_0xa89a('0xf')](_0xa89a('0x21'),_0x45d7a7,JSON[_0xa89a('0x10')](_0x48c03c));_0x2b6339(_0x48c03c);})[_0xa89a('0x22')](function(_0x5ed0f1){logger['error']('AddTags',_0x5ed0f1[_0xa89a('0x13')],_0x45d7a7);_0x4f6bd3(_this[_0xa89a('0x11')](0x1f4,_0x5ed0f1[_0xa89a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a34efb9..287b330 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 _0xa6ed=['remove','update','emit','register','smsInteraction:'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0xa6ed,0x154));var _0xda6e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa6ed[_0x59ee6f];return _0x4c0979;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xda6e('0x0'),_0xda6e('0x1')];function createListener(_0xc2f22,_0x409dcf){return function(_0x8b43ca){_0x409dcf[_0xda6e('0x2')](_0xc2f22,_0x8b43ca);};}function removeListener(_0xd18fcb,_0x1e1a75){return function(){SmsInteractionEvents['removeListener'](_0xd18fcb,_0x1e1a75);};}exports[_0xda6e('0x3')]=function(_0x31ad26){for(var _0x5902cd=0x0,_0x4686e1=events['length'];_0x5902cd<_0x4686e1;_0x5902cd++){var _0x101384=events[_0x5902cd];var _0x418234=createListener(_0xda6e('0x4')+_0x101384,_0x31ad26);SmsInteractionEvents['on'](_0x101384,_0x418234);}}; \ No newline at end of file +var _0xeb00=['length','smsInteraction:','./smsInteraction.events','save'];(function(_0x31bf2e,_0x52490a){var _0x51d982=function(_0x3bf666){while(--_0x3bf666){_0x31bf2e['push'](_0x31bf2e['shift']());}};_0x51d982(++_0x52490a);}(_0xeb00,0xce));var _0x0eb0=function(_0x311f56,_0x53a367){_0x311f56=_0x311f56-0x0;var _0x324f32=_0xeb00[_0x311f56];return _0x324f32;};'use strict';var SmsInteractionEvents=require(_0x0eb0('0x0'));var events=[_0x0eb0('0x1'),'remove','update'];function createListener(_0x101cde,_0x31806a){return function(_0x4b92ca){_0x31806a['emit'](_0x101cde,_0x4b92ca);};}function removeListener(_0x36ae72,_0x4b7450){return function(){SmsInteractionEvents['removeListener'](_0x36ae72,_0x4b7450);};}exports['register']=function(_0x446fe4){for(var _0x2353e5=0x0,_0xb0a2a5=events[_0x0eb0('0x2')];_0x2353e5<_0xb0a2a5;_0x2353e5++){var _0x12e813=events[_0x2353e5];var _0x3edc87=createListener(_0x0eb0('0x3')+_0x12e813,_0x446fe4);SmsInteractionEvents['on'](_0x12e813,_0x3edc87);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 9230add..025d8c9 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 _0xa693=['/describe','describe','post','tracked','sms','smsmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsMessage.controller','get','isAuthenticated','index'];(function(_0x230d62,_0x4dbfd2){var _0x394840=function(_0x3fae63){while(--_0x3fae63){_0x230d62['push'](_0x230d62['shift']());}};_0x394840(++_0x4dbfd2);}(_0xa693,0xf1));var _0x3a69=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0xa693[_0x5b1c50];return _0x2d379b;};'use strict';var multer=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var path=require(_0x3a69('0x2'));var timeout=require(_0x3a69('0x3'));var express=require(_0x3a69('0x4'));var router=express[_0x3a69('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a69('0x6'));var controller=require(_0x3a69('0x7'));router[_0x3a69('0x8')]('/',auth[_0x3a69('0x9')](),controller[_0x3a69('0xa')]);router[_0x3a69('0x8')](_0x3a69('0xb'),auth['isAuthenticated'](),controller[_0x3a69('0xc')]);router[_0x3a69('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3a69('0xd')]('/',auth['isAuthenticated'](),interaction[_0x3a69('0xe')](_0x3a69('0xf'),_0x3a69('0x10')),controller[_0x3a69('0x11')]);router[_0x3a69('0xd')]('/:id/status',controller[_0x3a69('0x12')]);router[_0x3a69('0x13')]('/:id',auth[_0x3a69('0x9')](),controller[_0x3a69('0x14')]);router[_0x3a69('0x13')](_0x3a69('0x15'),auth[_0x3a69('0x9')](),controller[_0x3a69('0x16')]);router[_0x3a69('0x13')](_0x3a69('0x17'),auth[_0x3a69('0x9')](),controller[_0x3a69('0x18')]);router[_0x3a69('0x19')](_0x3a69('0x1a'),auth['isAuthenticated'](),controller['destroy']);module[_0x3a69('0x1b')]=router; \ No newline at end of file +var _0x0659=['/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','show','post','tracked','sms','smsmessage:create','create'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x0659,0x122));var _0x9065=function(_0x359627,_0x3902b3){_0x359627=_0x359627-0x0;var _0x2a2f5d=_0x0659[_0x359627];return _0x2a2f5d;};'use strict';var multer=require(_0x9065('0x0'));var util=require(_0x9065('0x1'));var path=require(_0x9065('0x2'));var timeout=require(_0x9065('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9065('0x4'));var auth=require(_0x9065('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9065('0x6'));var controller=require(_0x9065('0x7'));router[_0x9065('0x8')]('/',auth['isAuthenticated'](),controller[_0x9065('0x9')]);router['get'](_0x9065('0xa'),auth[_0x9065('0xb')](),controller['describe']);router[_0x9065('0x8')]('/:id',auth[_0x9065('0xb')](),controller[_0x9065('0xc')]);router[_0x9065('0xd')]('/',auth[_0x9065('0xb')](),interaction[_0x9065('0xe')](_0x9065('0xf'),_0x9065('0x10')),controller[_0x9065('0x11')]);router[_0x9065('0xd')](_0x9065('0x12'),controller['status']);router[_0x9065('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x9065('0x14')]);router['put'](_0x9065('0x15'),auth['isAuthenticated'](),controller[_0x9065('0x16')]);router[_0x9065('0x13')](_0x9065('0x17'),auth['isAuthenticated'](),controller[_0x9065('0x18')]);router[_0x9065('0x19')](_0x9065('0x1a'),auth['isAuthenticated'](),controller[_0x9065('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index f20c0c2..2216e04 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 _0x8966=['ENUM','out','STRING','TEXT','exports','BOOLEAN'];(function(_0x16b992,_0x43d74c){var _0x385c78=function(_0x5c904){while(--_0x5c904){_0x16b992['push'](_0x16b992['shift']());}};_0x385c78(++_0x43d74c);}(_0x8966,0x184));var _0x6896=function(_0x4b96e1,_0x163df5){_0x4b96e1=_0x4b96e1-0x0;var _0x5ce9f5=_0x8966[_0x4b96e1];return _0x5ce9f5;};'use strict';var Sequelize=require('sequelize');module[_0x6896('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6896('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6896('0x2')]('in',_0x6896('0x3')),'defaultValue':_0x6896('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x6896('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x6896('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6896('0x5')]}}; \ No newline at end of file +var _0x160c=['STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x160c,0x122));var _0xc160=function(_0x337094,_0x21a371){_0x337094=_0x337094-0x0;var _0x264dc6=_0x160c[_0x337094];return _0x264dc6;};'use strict';var Sequelize=require(_0xc160('0x0'));module[_0xc160('0x1')]={'body':{'type':Sequelize[_0xc160('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc160('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc160('0x4')]('in',_0xc160('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xc160('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc160('0x6')]},'readAt':{'type':Sequelize[_0xc160('0x7')]},'secret':{'type':Sequelize[_0xc160('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc160('0x6')]},'providerResponse':{'type':Sequelize[_0xc160('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8b9f637..0a36463 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 _0x8fcd=['twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','delivered','Status','plivio','inspect','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','stack','name','send','map','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsMessage','includeAll','include','findAll','rows','params','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','agent','manual','SIP/%s','channel','EventManager','acceptmessage','sms-interactions','reject','sms','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','interface','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from'];(function(_0x565b4f,_0x103122){var _0x20b808=function(_0x463f6b){while(--_0x463f6b){_0x565b4f['push'](_0x565b4f['shift']());}};_0x20b808(++_0x103122);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x2f90c0,_0x5d162a){_0x2f90c0=_0x2f90c0-0x0;var _0x2e3552=_0x8fcd[_0x2f90c0];return _0x2e3552;};'use strict';var emlformat=require(_0xd8fc('0x0'));var rimraf=require(_0xd8fc('0x1'));var zipdir=require(_0xd8fc('0x2'));var jsonpatch=require(_0xd8fc('0x3'));var rp=require(_0xd8fc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd8fc('0x5'));var util=require(_0xd8fc('0x6'));var path=require(_0xd8fc('0x7'));var sox=require(_0xd8fc('0x8'));var csv=require(_0xd8fc('0x9'));var ejs=require(_0xd8fc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd8fc('0xb'));var crypto=require('crypto');var jsforce=require(_0xd8fc('0xc'));var deskjs=require(_0xd8fc('0xd'));var toCsv=require(_0xd8fc('0x9'));var querystring=require(_0xd8fc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd8fc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8fc('0x10'));var logger=require(_0xd8fc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd8fc('0x12'));var licenseUtil=require(_0xd8fc('0x13'));var db=require('../../mysqldb')['db'];config[_0xd8fc('0x14')]=_[_0xd8fc('0x15')](config[_0xd8fc('0x14')],{'host':_0xd8fc('0x16'),'port':0x18eb});var socket=require(_0xd8fc('0x17'))(new Redis(config['redis']));require(_0xd8fc('0x18'))['register'](socket);var jayson=require(_0xd8fc('0x19'));var client=jayson[_0xd8fc('0x1a')][_0xd8fc('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xd8fc('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x233c7e,_0x57838b,_0x49c450,_0x234cfd){return new BPromise(function(_0x234b4d,_0x111c5b){var _0x4daf69=_0x234cfd||client;return _0x4daf69[_0xd8fc('0x1c')](_0x233c7e,_0x49c450)[_0xd8fc('0x1d')](function(_0x461f85){logger[_0xd8fc('0x1e')](_0xd8fc('0x1f'),_0x57838b,_0xd8fc('0x20'));logger[_0xd8fc('0x21')](_0xd8fc('0x22'),_0x57838b,_0xd8fc('0x20'),JSON['stringify'](_0x461f85));if(_0x461f85[_0xd8fc('0x23')]){if(_0x461f85[_0xd8fc('0x23')][_0xd8fc('0x24')]===0x1f4){logger[_0xd8fc('0x23')](_0xd8fc('0x1f'),_0x57838b,_0x461f85[_0xd8fc('0x23')]['message']);return _0x111c5b(_0x461f85[_0xd8fc('0x23')][_0xd8fc('0x25')]);}logger['error'](_0xd8fc('0x1f'),_0x57838b,_0x461f85['error'][_0xd8fc('0x25')]);return _0x234b4d(_0x461f85[_0xd8fc('0x23')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x57838b,_0xd8fc('0x20'));_0x234b4d(_0x461f85[_0xd8fc('0x26')][_0xd8fc('0x25')]);}})[_0xd8fc('0x27')](function(_0x495bd2){logger[_0xd8fc('0x23')](_0xd8fc('0x1f'),_0x57838b,_0x495bd2);_0x111c5b(_0x495bd2);});});}function respondWithStatusCode(_0x54f1a5,_0x270204){_0x270204=_0x270204||0xcc;return function(_0x5e50c4){if(_0x5e50c4){return _0x54f1a5[_0xd8fc('0x28')](_0x270204);}return _0x54f1a5[_0xd8fc('0x29')](_0x270204)[_0xd8fc('0x2a')]();};}function respondWithResult(_0xb4077f,_0x58718b){_0x58718b=_0x58718b||0xc8;return function(_0x9d29b4){if(_0x9d29b4){return _0xb4077f['status'](_0x58718b)[_0xd8fc('0x2b')](_0x9d29b4);}};}function respondWithFilteredResult(_0x1692d0,_0x4e823d){return function(_0x4a5383){if(_0x4a5383){var _0x56a980=typeof _0x4e823d[_0xd8fc('0x2c')]===_0xd8fc('0x2d')&&typeof _0x4e823d[_0xd8fc('0x2e')]===_0xd8fc('0x2d');var _0x28c80d=_0x4a5383[_0xd8fc('0x2f')];var _0x55bfcc=_0x56a980?0x0:_0x4e823d[_0xd8fc('0x2c')];var _0x446609=_0x56a980?_0x4a5383['count']:_0x4e823d[_0xd8fc('0x2c')]+_0x4e823d[_0xd8fc('0x2e')];var _0x58f6c6;if(_0x446609>=_0x28c80d){_0x446609=_0x28c80d;_0x58f6c6=0xc8;}else{_0x58f6c6=0xce;}_0x1692d0[_0xd8fc('0x29')](_0x58f6c6);return _0x1692d0[_0xd8fc('0x30')](_0xd8fc('0x31'),_0x55bfcc+'-'+_0x446609+'/'+_0x28c80d)['json'](_0x4a5383);}return null;};}function patchUpdates(_0xf77e6b){return function(_0x180417){try{jsonpatch[_0xd8fc('0x32')](_0x180417,_0xf77e6b,!![]);}catch(_0x59e131){return BPromise['reject'](_0x59e131);}return _0x180417['save']();};}function saveUpdates(_0x343462,_0x2e112a){return function(_0x3cad77){if(_0x3cad77){return _0x3cad77[_0xd8fc('0x33')](_0x343462)[_0xd8fc('0x1d')](function(_0x441c59){return _0x441c59;});}return null;};}function removeEntity(_0x2d517d,_0x2b24a0){return function(_0x19b020){if(_0x19b020){return _0x19b020[_0xd8fc('0x34')]()['then'](function(){_0x2d517d[_0xd8fc('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x946e76,_0x567bdf){return function(_0x500d5a){if(!_0x500d5a){_0x946e76[_0xd8fc('0x28')](0x194);}return _0x500d5a;};}function handleError(_0x429281,_0x6e3d5c){_0x6e3d5c=_0x6e3d5c||0x1f4;return function(_0x41035b){logger[_0xd8fc('0x23')](_0x41035b[_0xd8fc('0x35')]);if(_0x41035b['name']){delete _0x41035b[_0xd8fc('0x36')];}_0x429281[_0xd8fc('0x29')](_0x6e3d5c)[_0xd8fc('0x37')](_0x41035b);};}exports['index']=function(_0x1fae3e,_0x356edf){var _0x563a41={},_0x4d39f6={},_0x1a9d66={'count':0x0,'rows':[]};var _0x4acf14=_[_0xd8fc('0x38')](db['SmsMessage'][_0xd8fc('0x39')],function(_0x2cd726){return{'name':_0x2cd726[_0xd8fc('0x3a')],'type':_0x2cd726['type'][_0xd8fc('0x3b')]};});_0x4d39f6['model']=_[_0xd8fc('0x38')](_0x4acf14,_0xd8fc('0x36'));_0x4d39f6['query']=_[_0xd8fc('0x3c')](_0x1fae3e[_0xd8fc('0x3d')]);_0x4d39f6[_0xd8fc('0x3e')]=_[_0xd8fc('0x3f')](_0x4d39f6['model'],_0x4d39f6[_0xd8fc('0x3d')]);_0x563a41[_0xd8fc('0x40')]=_[_0xd8fc('0x3f')](_0x4d39f6['model'],qs['fields'](_0x1fae3e['query'][_0xd8fc('0x41')]));_0x563a41[_0xd8fc('0x40')]=_0x563a41[_0xd8fc('0x40')][_0xd8fc('0x42')]?_0x563a41['attributes']:_0x4d39f6[_0xd8fc('0x43')];if(!_0x1fae3e[_0xd8fc('0x3d')][_0xd8fc('0x44')](_0xd8fc('0x45'))){_0x563a41[_0xd8fc('0x2e')]=qs[_0xd8fc('0x2e')](_0x1fae3e[_0xd8fc('0x3d')]['limit']);_0x563a41[_0xd8fc('0x2c')]=qs[_0xd8fc('0x2c')](_0x1fae3e['query'][_0xd8fc('0x2c')]);}_0x563a41[_0xd8fc('0x46')]=qs[_0xd8fc('0x47')](_0x1fae3e[_0xd8fc('0x3d')][_0xd8fc('0x47')]);_0x563a41[_0xd8fc('0x48')]=qs[_0xd8fc('0x3e')](_[_0xd8fc('0x49')](_0x1fae3e[_0xd8fc('0x3d')],_0x4d39f6[_0xd8fc('0x3e')]),_0x4acf14);if(_0x1fae3e[_0xd8fc('0x3d')][_0xd8fc('0x4a')]){_0x563a41[_0xd8fc('0x48')]=_[_0xd8fc('0x4b')](_0x563a41['where'],{'$or':_['map'](_0x4acf14,function(_0x498c5c){if(_0x498c5c[_0xd8fc('0x4c')]!==_0xd8fc('0x4d')){var _0x6b462={};_0x6b462[_0x498c5c[_0xd8fc('0x36')]]={'$like':'%'+_0x1fae3e['query'][_0xd8fc('0x4a')]+'%'};return _0x6b462;}})});}_0x563a41=_[_0xd8fc('0x4b')]({},_0x563a41,_0x1fae3e[_0xd8fc('0x4e')]);var _0x41708e={'where':_0x563a41[_0xd8fc('0x48')]};return db[_0xd8fc('0x4f')][_0xd8fc('0x2f')](_0x41708e)['then'](function(_0x484a75){_0x1a9d66['count']=_0x484a75;if(_0x1fae3e[_0xd8fc('0x3d')][_0xd8fc('0x50')]){_0x563a41[_0xd8fc('0x51')]=[{'all':!![]}];}return db[_0xd8fc('0x4f')][_0xd8fc('0x52')](_0x563a41);})[_0xd8fc('0x1d')](function(_0x1fd555){_0x1a9d66[_0xd8fc('0x53')]=_0x1fd555;return _0x1a9d66;})[_0xd8fc('0x1d')](respondWithFilteredResult(_0x356edf,_0x563a41))['catch'](handleError(_0x356edf,null));};exports['show']=function(_0x2c3295,_0x5363c5){var _0xae7f7d={'raw':!![],'where':{'id':_0x2c3295[_0xd8fc('0x54')]['id']}},_0x4f5f4b={};_0x4f5f4b[_0xd8fc('0x43')]=_['keys'](db[_0xd8fc('0x4f')][_0xd8fc('0x39')]);_0x4f5f4b[_0xd8fc('0x3d')]=_[_0xd8fc('0x3c')](_0x2c3295[_0xd8fc('0x3d')]);_0x4f5f4b[_0xd8fc('0x3e')]=_[_0xd8fc('0x3f')](_0x4f5f4b['model'],_0x4f5f4b[_0xd8fc('0x3d')]);_0xae7f7d[_0xd8fc('0x40')]=_['intersection'](_0x4f5f4b['model'],qs[_0xd8fc('0x41')](_0x2c3295['query'][_0xd8fc('0x41')]));_0xae7f7d[_0xd8fc('0x40')]=_0xae7f7d[_0xd8fc('0x40')][_0xd8fc('0x42')]?_0xae7f7d[_0xd8fc('0x40')]:_0x4f5f4b[_0xd8fc('0x43')];if(_0x2c3295[_0xd8fc('0x3d')]['includeAll']){_0xae7f7d[_0xd8fc('0x51')]=[{'all':!![]}];}_0xae7f7d=_[_0xd8fc('0x4b')]({},_0xae7f7d,_0x2c3295['options']);return db[_0xd8fc('0x4f')][_0xd8fc('0x55')](_0xae7f7d)[_0xd8fc('0x1d')](handleEntityNotFound(_0x5363c5,null))['then'](respondWithResult(_0x5363c5,null))[_0xd8fc('0x27')](handleError(_0x5363c5,null));};exports[_0xd8fc('0x56')]=function(_0x3f4616,_0x4c1137){return db[_0xd8fc('0x4f')][_0xd8fc('0x56')](_0x3f4616['body'],{})['then'](respondWithResult(_0x4c1137,0xc9))[_0xd8fc('0x27')](handleError(_0x4c1137,null));};exports[_0xd8fc('0x33')]=function(_0x4269c7,_0xe01656){if(_0x4269c7[_0xd8fc('0x57')]['id']){delete _0x4269c7['body']['id'];}return db['SmsMessage'][_0xd8fc('0x55')]({'where':{'id':_0x4269c7[_0xd8fc('0x54')]['id']}})[_0xd8fc('0x1d')](handleEntityNotFound(_0xe01656,null))['then'](saveUpdates(_0x4269c7['body'],null))[_0xd8fc('0x1d')](respondWithResult(_0xe01656,null))[_0xd8fc('0x27')](handleError(_0xe01656,null));};exports['destroy']=function(_0x235c66,_0x49b8de){return db['SmsMessage'][_0xd8fc('0x55')]({'where':{'id':_0x235c66[_0xd8fc('0x54')]['id']}})[_0xd8fc('0x1d')](handleEntityNotFound(_0x49b8de,null))[_0xd8fc('0x1d')](removeEntity(_0x49b8de,null))[_0xd8fc('0x27')](handleError(_0x49b8de,null));};exports[_0xd8fc('0x58')]=function(_0x50434a,_0x24b5f7){return db['SmsMessage'][_0xd8fc('0x58')]()[_0xd8fc('0x1d')](respondWithResult(_0x24b5f7,null))[_0xd8fc('0x27')](handleError(_0x24b5f7,null));};var interaction_log=require(_0xd8fc('0x11'))('sms-interactions');exports[_0xd8fc('0x59')]=function(_0x15f761,_0x153c44,_0x2e02bc){var _0x3e70e6={'agent':{},'channel':'sms'};if(_0x15f761[_0xd8fc('0x57')]['id']){delete _0x15f761[_0xd8fc('0x57')]['id'];}_0x15f761[_0xd8fc('0x57')][_0xd8fc('0x5a')]=!![];_0x15f761[_0xd8fc('0x57')][_0xd8fc('0x5b')]=moment()[_0xd8fc('0x5c')](_0xd8fc('0x5d'));_0x15f761[_0xd8fc('0x57')][_0xd8fc('0x5e')]=_0x15f761['body']['UserId']||_0x15f761[_0xd8fc('0x5f')]['id'];_0x3e70e6['agent']['id']=_0x15f761[_0xd8fc('0x57')][_0xd8fc('0x5e')];return db[_0xd8fc('0x4f')][_0xd8fc('0x55')]({'where':{'id':_0x15f761[_0xd8fc('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x153c44,null))['then'](saveUpdates(_0x15f761[_0xd8fc('0x57')],null))[_0xd8fc('0x1d')](function(_0xc59639){if(_0xc59639){_0x3e70e6[_0xd8fc('0x25')]=_0xc59639[_0xd8fc('0x60')]({'plain':!![]});return db[_0xd8fc('0x61')][_0xd8fc('0x55')]({'where':{'id':_0xc59639['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x153c44,null))[_0xd8fc('0x1d')](function(_0x3e45b5){if(_0x3e45b5){return _0x3e45b5[_0xd8fc('0x33')]({'UserId':_0x15f761[_0xd8fc('0x57')][_0xd8fc('0x5e')],'read1stAt':_[_0xd8fc('0x62')](_0x3e45b5[_0xd8fc('0x63')])?moment()[_0xd8fc('0x5c')](_0xd8fc('0x5d')):undefined});}return null;})[_0xd8fc('0x1d')](function(_0x434a3b){if(_0x434a3b){_0x3e70e6['interaction']=_0x434a3b[_0xd8fc('0x60')]({'plain':!![]});interaction_log['info'](_0xd8fc('0x64'),_0x15f761[_0xd8fc('0x5f')]['id'],_0x15f761[_0xd8fc('0x5f')]['name'],_0x15f761[_0xd8fc('0x5f')]['role'],_0x3e70e6[_0xd8fc('0x65')]['id'],_0x15f761[_0xd8fc('0x57')]?JSON[_0xd8fc('0x66')](_0x15f761[_0xd8fc('0x57')]):'null');return respondWithRpcPromise(_0xd8fc('0x67'),_0xd8fc('0x68'),_0x3e70e6);}return null;})[_0xd8fc('0x1d')](function(_0x1719c5){var _0x54d9fd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1719c5[_0xd8fc('0x25')][_0xd8fc('0x69')];return db[_0xd8fc('0x6a')]['query'](_0x54d9fd,{'type':db[_0xd8fc('0x6b')][_0xd8fc('0x6c')][_0xd8fc('0x6d')],'raw':!![]})[_0xd8fc('0x1d')](function(_0x45848f){return _0x45848f;});})[_0xd8fc('0x1d')](function(_0x1a8ca6){if(_0x1a8ca6){_0x3e70e6[_0xd8fc('0x25')][_0xd8fc('0x6e')]=_0x1a8ca6[0x0];if(!_0x15f761['body'][_0xd8fc('0x5e')])return;return db['User'][_0xd8fc('0x55')]({'where':{'id':_0x15f761[_0xd8fc('0x57')][_0xd8fc('0x5e')],'role':'agent'},'attributes':['id',_0xd8fc('0x36'),_0xd8fc('0x6f'),_0xd8fc('0x70'),_0xd8fc('0x71')],'raw':!![]});}return null;})[_0xd8fc('0x1d')](function(_0x5df319){if(!_0x5df319)return null;_0x3e70e6[_0xd8fc('0x25')][_0xd8fc('0x72')]=_0x5df319;return _0x3e70e6;})[_0xd8fc('0x1d')](function(_0x3474ec){if(_0x3474ec){if(_0x15f761[_0xd8fc('0x57')][_0xd8fc('0x73')]){_0x3e70e6['message']['interface']=util[_0xd8fc('0x5c')](_0xd8fc('0x74'),_0x15f761[_0xd8fc('0x5f')][_0xd8fc('0x36')]);_0x3e70e6['message']['channel']=_0x3e70e6[_0xd8fc('0x75')];_0x3e70e6[_0xd8fc('0x25')]['motionChannel']=_0x3e70e6[_0xd8fc('0x75')];_0x3e70e6['message']['event']=_0xd8fc('0x59');return respondWithRpcPromise(_0xd8fc('0x76'),_0xd8fc('0x76'),{'event':_0xd8fc('0x77'),'message':_0x3e70e6[_0xd8fc('0x25')]},client9002)[_0xd8fc('0x1d')](function(){return _0x3e70e6;});}return _0x3e70e6;}return null;})[_0xd8fc('0x1d')](respondWithResult(_0x153c44,null))[_0xd8fc('0x27')](handleError(_0x153c44,null));};var interaction_log=require('../../config/logger')(_0xd8fc('0x78'));exports[_0xd8fc('0x79')]=function(_0x14f443,_0x1d33e4,_0x49dbab){var _0x34c10a={'agent':{},'channel':_0xd8fc('0x7a')};if(_0x14f443['body']['id']){delete _0x14f443[_0xd8fc('0x57')]['id'];}_0x14f443[_0xd8fc('0x57')][_0xd8fc('0x5e')]=_0x14f443[_0xd8fc('0x57')]['UserId']||_0x14f443['user']['id'];_0x34c10a[_0xd8fc('0x72')]['id']=_0x14f443['body'][_0xd8fc('0x5e')];return db['SmsMessage'][_0xd8fc('0x55')]({'where':{'id':_0x14f443['params']['id'],'UserId':null}})[_0xd8fc('0x1d')](handleEntityNotFound(_0x1d33e4,null))[_0xd8fc('0x1d')](function(_0x34c406){if(_0x34c406){_0x34c10a[_0xd8fc('0x25')]=_0x34c406[_0xd8fc('0x60')]({'plain':!![]});return db[_0xd8fc('0x61')][_0xd8fc('0x55')]({'where':{'id':_0x34c406[_0xd8fc('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x1d33e4,null))[_0xd8fc('0x1d')](function(_0x20e3f5){if(_0x20e3f5){_0x34c10a[_0xd8fc('0x65')]=_0x20e3f5['get']({'plain':!![]});interaction_log['info'](_0xd8fc('0x7c'),_0x14f443[_0xd8fc('0x5f')]['id'],_0x14f443[_0xd8fc('0x5f')][_0xd8fc('0x36')],_0x14f443[_0xd8fc('0x5f')][_0xd8fc('0x7d')],_0x34c10a[_0xd8fc('0x65')]['id'],_0x14f443['body']?JSON['stringify'](_0x14f443[_0xd8fc('0x57')]):_0xd8fc('0x7e'));return respondWithRpcPromise(_0xd8fc('0x7f'),_0xd8fc('0x80'),_0x34c10a);}return null;})[_0xd8fc('0x1d')](function(_0x36ec78){var _0x16385f=_0xd8fc('0x81')+_0x36ec78['message'][_0xd8fc('0x69')];return db[_0xd8fc('0x6a')][_0xd8fc('0x3d')](_0x16385f,{'type':db[_0xd8fc('0x6b')]['QueryTypes'][_0xd8fc('0x6d')],'raw':!![]})[_0xd8fc('0x1d')](function(_0x55038a){return _0x55038a;});})[_0xd8fc('0x1d')](function(_0x7b06de){if(_0x7b06de){_0x34c10a[_0xd8fc('0x25')]['contact']=_0x7b06de[0x0];if(!_0x14f443[_0xd8fc('0x57')][_0xd8fc('0x5e')])return;return db[_0xd8fc('0x82')][_0xd8fc('0x55')]({'where':{'id':_0x14f443['body']['UserId'],'role':_0xd8fc('0x72')},'attributes':['id',_0xd8fc('0x36'),'fullname',_0xd8fc('0x70'),_0xd8fc('0x71')],'raw':!![]});}return null;})['then'](function(_0x53a43c){if(!_0x53a43c)return null;_0x34c10a[_0xd8fc('0x25')][_0xd8fc('0x72')]=_0x53a43c;return _0x34c10a;})[_0xd8fc('0x1d')](function(_0x1c3289){if(_0x1c3289){_0x1c3289[_0xd8fc('0x25')][_0xd8fc('0x83')]=util[_0xd8fc('0x5c')](_0xd8fc('0x74'),_0x14f443['user']['name']);_0x1c3289[_0xd8fc('0x25')][_0xd8fc('0x75')]=_0x34c10a[_0xd8fc('0x75')];_0x1c3289[_0xd8fc('0x25')][_0xd8fc('0x84')]=_0x34c10a[_0xd8fc('0x75')];_0x1c3289[_0xd8fc('0x25')]['event']=_0xd8fc('0x79');respondWithRpcPromise('EventManager',_0xd8fc('0x76'),{'event':_0xd8fc('0x85'),'message':_0x1c3289[_0xd8fc('0x25')]},client9002);return _0x34c10a;}return null;})[_0xd8fc('0x1d')](respondWithResult(_0x1d33e4,null))[_0xd8fc('0x27')](handleError(_0x1d33e4,null));};exports['status']=function(_0x495a53,_0xbffb4c,_0x30cf0c){if(_0x495a53[_0xd8fc('0x57')]['id']){delete _0x495a53[_0xd8fc('0x57')]['id'];}var _0x291554;return db['SmsMessage'][_0xd8fc('0x55')]({'where':{'id':_0x495a53[_0xd8fc('0x54')]['id']}})[_0xd8fc('0x1d')](handleEntityNotFound(_0xbffb4c,null))[_0xd8fc('0x1d')](function(_0x482617){if(_0x482617){_0x291554=_0x482617;return db[_0xd8fc('0x86')]['find']({'where':{'id':_0x482617[_0xd8fc('0x87')]}});}})[_0xd8fc('0x1d')](handleEntityNotFound(_0xbffb4c,null))[_0xd8fc('0x1d')](function(_0x576204){if(_0x576204){logger[_0xd8fc('0x21')](_0xd8fc('0x22'),'status',_0xd8fc('0x88'),_0x576204['type'],util['inspect'](_0x495a53['body'],{'showHidden':![],'depth':null}));switch(_0x576204[_0xd8fc('0x4c')]){case _0xd8fc('0x89'):if(_0x495a53[_0xd8fc('0x57')][_0xd8fc('0x8a')]&&_0x495a53[_0xd8fc('0x57')]['MessageSid']===_0x291554['messageId']){return _0x291554['update']({'read':!![]});}else{logger[_0xd8fc('0x23')](_0xd8fc('0x8b'),'status',_0xd8fc('0x89'),util['inspect'](_0x495a53[_0xd8fc('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x495a53[_0xd8fc('0x57')][_0xd8fc('0x8c')]&&_0x495a53['body']['MessageUUID']===_0x291554['messageId']&&_[_0xd8fc('0x8d')](['sent',_0xd8fc('0x8e')],_0x495a53[_0xd8fc('0x57')][_0xd8fc('0x8f')])>=0x0){return _0x291554['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd8fc('0x29'),_0xd8fc('0x90'),util[_0xd8fc('0x91')](_0x495a53[_0xd8fc('0x57')],{'showHidden':![],'depth':null}));}break;case _0xd8fc('0x92'):var _0x1fc903=_0x495a53['body'][_0xd8fc('0x93')][0x0];if(_0x1fc903[_0xd8fc('0x29')]['groupName']===_0xd8fc('0x94')){return _0x291554[_0xd8fc('0x33')]({'read':!![]});}else{logger[_0xd8fc('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd8fc('0x29'),_0xd8fc('0x92'),util[_0xd8fc('0x91')](_0x495a53['body'],{'showHidden':![],'depth':null}));}break;}return _0x291554;}})[_0xd8fc('0x1d')](respondWithResult(_0xbffb4c,null))[_0xd8fc('0x27')](handleError(_0xbffb4c,null));}; \ No newline at end of file +var _0x639a=['acceptMessage','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','interface','channel','motionChannel','accept','EventManager','sms','SmsInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','contact','User','SIP/%s','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','findAll','show','params','length','includeAll','include','find','create','update','body','describe','sms-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteractionId','isNil','read1stAt','get','role','null','AcceptMessage'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x639a,0x1e8));var _0xa639=function(_0x94eadb,_0x4cdc44){_0x94eadb=_0x94eadb-0x0;var _0x505603=_0x639a[_0x94eadb];return _0x505603;};'use strict';var emlformat=require(_0xa639('0x0'));var rimraf=require(_0xa639('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa639('0x2'));var moment=require(_0xa639('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa639('0x4'));var util=require(_0xa639('0x5'));var path=require(_0xa639('0x6'));var sox=require(_0xa639('0x7'));var csv=require('to-csv');var ejs=require(_0xa639('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa639('0x9'));var squel=require(_0xa639('0xa'));var crypto=require(_0xa639('0xb'));var jsforce=require(_0xa639('0xc'));var deskjs=require(_0xa639('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa639('0xe'));var Papa=require(_0xa639('0xf'));var Redis=require(_0xa639('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa639('0x11'));var as=require(_0xa639('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa639('0x13'))(_0xa639('0x14'));var utils=require('../../config/utils');var config=require(_0xa639('0x15'));var licenseUtil=require(_0xa639('0x16'));var db=require('../../mysqldb')['db'];config[_0xa639('0x17')]=_[_0xa639('0x18')](config[_0xa639('0x17')],{'host':_0xa639('0x19'),'port':0x18eb});var socket=require(_0xa639('0x1a'))(new Redis(config[_0xa639('0x17')]));require(_0xa639('0x1b'))['register'](socket);var jayson=require(_0xa639('0x1c'));var client=jayson[_0xa639('0x1d')][_0xa639('0x1e')]({'port':0x232c});var client9002=jayson[_0xa639('0x1d')][_0xa639('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x7ec7ce,_0x10c096,_0x134e42,_0x41adc7){return new BPromise(function(_0x58eded,_0x3a894c){var _0x1d4f47=_0x41adc7||client;return _0x1d4f47['request'](_0x7ec7ce,_0x134e42)[_0xa639('0x1f')](function(_0x2a27a5){logger[_0xa639('0x20')](_0xa639('0x21'),_0x10c096,'request\x20sent');logger[_0xa639('0x22')](_0xa639('0x23'),_0x10c096,_0xa639('0x24'),JSON[_0xa639('0x25')](_0x2a27a5));if(_0x2a27a5['error']){if(_0x2a27a5[_0xa639('0x26')][_0xa639('0x27')]===0x1f4){logger[_0xa639('0x26')](_0xa639('0x21'),_0x10c096,_0x2a27a5[_0xa639('0x26')]['message']);return _0x3a894c(_0x2a27a5[_0xa639('0x26')][_0xa639('0x28')]);}logger[_0xa639('0x26')](_0xa639('0x21'),_0x10c096,_0x2a27a5['error'][_0xa639('0x28')]);return _0x58eded(_0x2a27a5['error'][_0xa639('0x28')]);}else{logger[_0xa639('0x20')](_0xa639('0x21'),_0x10c096,'request\x20sent');_0x58eded(_0x2a27a5[_0xa639('0x29')]['message']);}})[_0xa639('0x2a')](function(_0x127fa9){logger[_0xa639('0x26')](_0xa639('0x21'),_0x10c096,_0x127fa9);_0x3a894c(_0x127fa9);});});}function respondWithStatusCode(_0x56cb39,_0x3e4b0b){_0x3e4b0b=_0x3e4b0b||0xcc;return function(_0x176dcf){if(_0x176dcf){return _0x56cb39[_0xa639('0x2b')](_0x3e4b0b);}return _0x56cb39[_0xa639('0x2c')](_0x3e4b0b)['end']();};}function respondWithResult(_0x2f6533,_0xb3dbe2){_0xb3dbe2=_0xb3dbe2||0xc8;return function(_0xa7bffc){if(_0xa7bffc){return _0x2f6533[_0xa639('0x2c')](_0xb3dbe2)[_0xa639('0x2d')](_0xa7bffc);}};}function respondWithFilteredResult(_0x343360,_0x4cf740){return function(_0x4cbf18){if(_0x4cbf18){var _0x43c236=typeof _0x4cf740[_0xa639('0x2e')]===_0xa639('0x2f')&&typeof _0x4cf740[_0xa639('0x30')]===_0xa639('0x2f');var _0x561103=_0x4cbf18['count'];var _0x280f4b=_0x43c236?0x0:_0x4cf740['offset'];var _0x2c1143=_0x43c236?_0x4cbf18['count']:_0x4cf740[_0xa639('0x2e')]+_0x4cf740[_0xa639('0x30')];var _0x3edd09;if(_0x2c1143>=_0x561103){_0x2c1143=_0x561103;_0x3edd09=0xc8;}else{_0x3edd09=0xce;}_0x343360[_0xa639('0x2c')](_0x3edd09);return _0x343360[_0xa639('0x31')](_0xa639('0x32'),_0x280f4b+'-'+_0x2c1143+'/'+_0x561103)[_0xa639('0x2d')](_0x4cbf18);}return null;};}function patchUpdates(_0x443599){return function(_0x515dbc){try{jsonpatch[_0xa639('0x33')](_0x515dbc,_0x443599,!![]);}catch(_0x4ad14e){return BPromise[_0xa639('0x34')](_0x4ad14e);}return _0x515dbc[_0xa639('0x35')]();};}function saveUpdates(_0x5606da,_0x82b1aa){return function(_0x21643a){if(_0x21643a){return _0x21643a['update'](_0x5606da)['then'](function(_0x3a53a9){return _0x3a53a9;});}return null;};}function removeEntity(_0xca6d1a,_0x19b3d2){return function(_0x443340){if(_0x443340){return _0x443340[_0xa639('0x36')]()[_0xa639('0x1f')](function(){_0xca6d1a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x440d13,_0x348145){return function(_0x5bf392){if(!_0x5bf392){_0x440d13[_0xa639('0x2b')](0x194);}return _0x5bf392;};}function handleError(_0x246f75,_0x36ff83){_0x36ff83=_0x36ff83||0x1f4;return function(_0x2f15ac){logger['error'](_0x2f15ac[_0xa639('0x37')]);if(_0x2f15ac[_0xa639('0x38')]){delete _0x2f15ac[_0xa639('0x38')];}_0x246f75[_0xa639('0x2c')](_0x36ff83)['send'](_0x2f15ac);};}exports[_0xa639('0x39')]=function(_0x31deb8,_0xdfc5ab){var _0x2ec9d0={},_0x3b8737={},_0x317677={'count':0x0,'rows':[]};var _0x202183=_[_0xa639('0x3a')](db[_0xa639('0x3b')][_0xa639('0x3c')],function(_0x1256a1){return{'name':_0x1256a1[_0xa639('0x3d')],'type':_0x1256a1[_0xa639('0x3e')][_0xa639('0x3f')]};});_0x3b8737[_0xa639('0x40')]=_[_0xa639('0x3a')](_0x202183,'name');_0x3b8737[_0xa639('0x41')]=_[_0xa639('0x42')](_0x31deb8[_0xa639('0x41')]);_0x3b8737['filters']=_[_0xa639('0x43')](_0x3b8737[_0xa639('0x40')],_0x3b8737[_0xa639('0x41')]);_0x2ec9d0[_0xa639('0x44')]=_[_0xa639('0x43')](_0x3b8737[_0xa639('0x40')],qs[_0xa639('0x45')](_0x31deb8['query'][_0xa639('0x45')]));_0x2ec9d0[_0xa639('0x44')]=_0x2ec9d0[_0xa639('0x44')]['length']?_0x2ec9d0['attributes']:_0x3b8737['model'];if(!_0x31deb8[_0xa639('0x41')][_0xa639('0x46')](_0xa639('0x47'))){_0x2ec9d0['limit']=qs['limit'](_0x31deb8[_0xa639('0x41')][_0xa639('0x30')]);_0x2ec9d0['offset']=qs[_0xa639('0x2e')](_0x31deb8['query']['offset']);}_0x2ec9d0[_0xa639('0x48')]=qs[_0xa639('0x49')](_0x31deb8['query'][_0xa639('0x49')]);_0x2ec9d0[_0xa639('0x4a')]=qs[_0xa639('0x4b')](_[_0xa639('0x4c')](_0x31deb8[_0xa639('0x41')],_0x3b8737[_0xa639('0x4b')]),_0x202183);if(_0x31deb8[_0xa639('0x41')][_0xa639('0x4d')]){_0x2ec9d0[_0xa639('0x4a')]=_[_0xa639('0x4e')](_0x2ec9d0[_0xa639('0x4a')],{'$or':_['map'](_0x202183,function(_0x132ea0){if(_0x132ea0['type']!==_0xa639('0x4f')){var _0x20a809={};_0x20a809[_0x132ea0[_0xa639('0x38')]]={'$like':'%'+_0x31deb8[_0xa639('0x41')][_0xa639('0x4d')]+'%'};return _0x20a809;}})});}_0x2ec9d0=_[_0xa639('0x4e')]({},_0x2ec9d0,_0x31deb8[_0xa639('0x50')]);var _0x48cc80={'where':_0x2ec9d0['where']};return db['SmsMessage'][_0xa639('0x51')](_0x48cc80)[_0xa639('0x1f')](function(_0x21d84c){_0x317677['count']=_0x21d84c;if(_0x31deb8[_0xa639('0x41')]['includeAll']){_0x2ec9d0['include']=[{'all':!![]}];}return db[_0xa639('0x3b')][_0xa639('0x52')](_0x2ec9d0);})[_0xa639('0x1f')](function(_0x4a3857){_0x317677['rows']=_0x4a3857;return _0x317677;})['then'](respondWithFilteredResult(_0xdfc5ab,_0x2ec9d0))['catch'](handleError(_0xdfc5ab,null));};exports[_0xa639('0x53')]=function(_0x4cec20,_0x134438){var _0x348829={'raw':!![],'where':{'id':_0x4cec20[_0xa639('0x54')]['id']}},_0x40f701={};_0x40f701[_0xa639('0x40')]=_[_0xa639('0x42')](db[_0xa639('0x3b')][_0xa639('0x3c')]);_0x40f701['query']=_[_0xa639('0x42')](_0x4cec20[_0xa639('0x41')]);_0x40f701[_0xa639('0x4b')]=_[_0xa639('0x43')](_0x40f701[_0xa639('0x40')],_0x40f701['query']);_0x348829[_0xa639('0x44')]=_[_0xa639('0x43')](_0x40f701['model'],qs[_0xa639('0x45')](_0x4cec20[_0xa639('0x41')][_0xa639('0x45')]));_0x348829['attributes']=_0x348829[_0xa639('0x44')][_0xa639('0x55')]?_0x348829[_0xa639('0x44')]:_0x40f701[_0xa639('0x40')];if(_0x4cec20[_0xa639('0x41')][_0xa639('0x56')]){_0x348829[_0xa639('0x57')]=[{'all':!![]}];}_0x348829=_[_0xa639('0x4e')]({},_0x348829,_0x4cec20[_0xa639('0x50')]);return db[_0xa639('0x3b')][_0xa639('0x58')](_0x348829)[_0xa639('0x1f')](handleEntityNotFound(_0x134438,null))[_0xa639('0x1f')](respondWithResult(_0x134438,null))[_0xa639('0x2a')](handleError(_0x134438,null));};exports[_0xa639('0x59')]=function(_0x4d8292,_0xd959ba){return db['SmsMessage'][_0xa639('0x59')](_0x4d8292['body'],{})['then'](respondWithResult(_0xd959ba,0xc9))[_0xa639('0x2a')](handleError(_0xd959ba,null));};exports[_0xa639('0x5a')]=function(_0x5d869b,_0x3c9e5a){if(_0x5d869b[_0xa639('0x5b')]['id']){delete _0x5d869b[_0xa639('0x5b')]['id'];}return db[_0xa639('0x3b')][_0xa639('0x58')]({'where':{'id':_0x5d869b['params']['id']}})[_0xa639('0x1f')](handleEntityNotFound(_0x3c9e5a,null))[_0xa639('0x1f')](saveUpdates(_0x5d869b[_0xa639('0x5b')],null))[_0xa639('0x1f')](respondWithResult(_0x3c9e5a,null))[_0xa639('0x2a')](handleError(_0x3c9e5a,null));};exports['destroy']=function(_0x31c0f9,_0x1a126a){return db[_0xa639('0x3b')][_0xa639('0x58')]({'where':{'id':_0x31c0f9['params']['id']}})[_0xa639('0x1f')](handleEntityNotFound(_0x1a126a,null))[_0xa639('0x1f')](removeEntity(_0x1a126a,null))['catch'](handleError(_0x1a126a,null));};exports[_0xa639('0x5c')]=function(_0x3cac2,_0x116c51){return db[_0xa639('0x3b')]['describe']()[_0xa639('0x1f')](respondWithResult(_0x116c51,null))[_0xa639('0x2a')](handleError(_0x116c51,null));};var interaction_log=require(_0xa639('0x13'))(_0xa639('0x5d'));exports['accept']=function(_0xcd2480,_0x3b91dc,_0x50d609){var _0x235423={'agent':{},'channel':'sms'};if(_0xcd2480['body']['id']){delete _0xcd2480[_0xa639('0x5b')]['id'];}_0xcd2480[_0xa639('0x5b')][_0xa639('0x5e')]=!![];_0xcd2480[_0xa639('0x5b')][_0xa639('0x5f')]=moment()[_0xa639('0x60')](_0xa639('0x61'));_0xcd2480[_0xa639('0x5b')][_0xa639('0x62')]=_0xcd2480[_0xa639('0x5b')]['UserId']||_0xcd2480[_0xa639('0x63')]['id'];_0x235423[_0xa639('0x64')]['id']=_0xcd2480[_0xa639('0x5b')]['UserId'];return db['SmsMessage'][_0xa639('0x58')]({'where':{'id':_0xcd2480[_0xa639('0x54')]['id'],'UserId':null}})[_0xa639('0x1f')](handleEntityNotFound(_0x3b91dc,null))['then'](saveUpdates(_0xcd2480['body'],null))['then'](function(_0x5854dc){if(_0x5854dc){_0x235423['message']=_0x5854dc['get']({'plain':!![]});return db['SmsInteraction'][_0xa639('0x58')]({'where':{'id':_0x5854dc[_0xa639('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3b91dc,null))[_0xa639('0x1f')](function(_0x3e03ab){if(_0x3e03ab){return _0x3e03ab[_0xa639('0x5a')]({'UserId':_0xcd2480[_0xa639('0x5b')]['UserId'],'read1stAt':_[_0xa639('0x66')](_0x3e03ab[_0xa639('0x67')])?moment()[_0xa639('0x60')](_0xa639('0x61')):undefined});}return null;})[_0xa639('0x1f')](function(_0x56f771){if(_0x56f771){_0x235423['interaction']=_0x56f771[_0xa639('0x68')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xcd2480['user']['id'],_0xcd2480[_0xa639('0x63')][_0xa639('0x38')],_0xcd2480['user'][_0xa639('0x69')],_0x235423['interaction']['id'],_0xcd2480[_0xa639('0x5b')]?JSON[_0xa639('0x25')](_0xcd2480['body']):_0xa639('0x6a'));return respondWithRpcPromise(_0xa639('0x6b'),_0xa639('0x6c'),_0x235423);}return null;})['then'](function(_0x33cc96){var _0x5338d6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x33cc96[_0xa639('0x28')][_0xa639('0x6d')];return db[_0xa639('0x6e')][_0xa639('0x41')](_0x5338d6,{'type':db['Sequelize'][_0xa639('0x6f')][_0xa639('0x70')],'raw':!![]})[_0xa639('0x1f')](function(_0xb4817f){return _0xb4817f;});})[_0xa639('0x1f')](function(_0xd49540){if(_0xd49540){_0x235423[_0xa639('0x28')]['contact']=_0xd49540[0x0];if(!_0xcd2480['body'][_0xa639('0x62')])return;return db['User'][_0xa639('0x58')]({'where':{'id':_0xcd2480[_0xa639('0x5b')][_0xa639('0x62')],'role':_0xa639('0x64')},'attributes':['id',_0xa639('0x38'),_0xa639('0x71'),_0xa639('0x72'),_0xa639('0x73')],'raw':!![]});}return null;})['then'](function(_0x31f8be){if(!_0x31f8be)return null;_0x235423[_0xa639('0x28')][_0xa639('0x64')]=_0x31f8be;return _0x235423;})[_0xa639('0x1f')](function(_0x5ae998){if(_0x5ae998){if(_0xcd2480['body']['manual']){_0x235423[_0xa639('0x28')][_0xa639('0x74')]=util[_0xa639('0x60')]('SIP/%s',_0xcd2480[_0xa639('0x63')][_0xa639('0x38')]);_0x235423[_0xa639('0x28')][_0xa639('0x75')]=_0x235423[_0xa639('0x75')];_0x235423[_0xa639('0x28')][_0xa639('0x76')]=_0x235423[_0xa639('0x75')];_0x235423[_0xa639('0x28')]['event']=_0xa639('0x77');return respondWithRpcPromise(_0xa639('0x78'),_0xa639('0x78'),{'event':'acceptmessage','message':_0x235423[_0xa639('0x28')]},client9002)[_0xa639('0x1f')](function(){return _0x235423;});}return _0x235423;}return null;})[_0xa639('0x1f')](respondWithResult(_0x3b91dc,null))['catch'](handleError(_0x3b91dc,null));};var interaction_log=require(_0xa639('0x13'))(_0xa639('0x5d'));exports['reject']=function(_0x5d531f,_0x30f817,_0x43cb0f){var _0x542bb={'agent':{},'channel':_0xa639('0x79')};if(_0x5d531f['body']['id']){delete _0x5d531f[_0xa639('0x5b')]['id'];}_0x5d531f[_0xa639('0x5b')][_0xa639('0x62')]=_0x5d531f[_0xa639('0x5b')][_0xa639('0x62')]||_0x5d531f[_0xa639('0x63')]['id'];_0x542bb[_0xa639('0x64')]['id']=_0x5d531f[_0xa639('0x5b')]['UserId'];return db[_0xa639('0x3b')]['find']({'where':{'id':_0x5d531f[_0xa639('0x54')]['id'],'UserId':null}})[_0xa639('0x1f')](handleEntityNotFound(_0x30f817,null))[_0xa639('0x1f')](function(_0x29e99d){if(_0x29e99d){_0x542bb['message']=_0x29e99d[_0xa639('0x68')]({'plain':!![]});return db[_0xa639('0x7a')]['find']({'where':{'id':_0x29e99d[_0xa639('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x30f817,null))[_0xa639('0x1f')](function(_0x4bdeab){if(_0x4bdeab){_0x542bb['interaction']=_0x4bdeab[_0xa639('0x68')]({'plain':!![]});interaction_log[_0xa639('0x20')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d531f['user']['id'],_0x5d531f[_0xa639('0x63')]['name'],_0x5d531f[_0xa639('0x63')]['role'],_0x542bb['interaction']['id'],_0x5d531f[_0xa639('0x5b')]?JSON[_0xa639('0x25')](_0x5d531f['body']):'null');return respondWithRpcPromise(_0xa639('0x7b'),_0xa639('0x7c'),_0x542bb);}return null;})[_0xa639('0x1f')](function(_0x37b238){var _0x7d776b=_0xa639('0x7d')+_0x37b238[_0xa639('0x28')][_0xa639('0x6d')];return db['sequelize'][_0xa639('0x41')](_0x7d776b,{'type':db[_0xa639('0x7e')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x54bb05){return _0x54bb05;});})[_0xa639('0x1f')](function(_0x5f35fe){if(_0x5f35fe){_0x542bb[_0xa639('0x28')][_0xa639('0x7f')]=_0x5f35fe[0x0];if(!_0x5d531f[_0xa639('0x5b')]['UserId'])return;return db[_0xa639('0x80')][_0xa639('0x58')]({'where':{'id':_0x5d531f[_0xa639('0x5b')][_0xa639('0x62')],'role':_0xa639('0x64')},'attributes':['id',_0xa639('0x38'),'fullname','email',_0xa639('0x73')],'raw':!![]});}return null;})[_0xa639('0x1f')](function(_0x3b7d7c){if(!_0x3b7d7c)return null;_0x542bb[_0xa639('0x28')][_0xa639('0x64')]=_0x3b7d7c;return _0x542bb;})['then'](function(_0x2d1bba){if(_0x2d1bba){_0x2d1bba['message'][_0xa639('0x74')]=util['format'](_0xa639('0x81'),_0x5d531f['user'][_0xa639('0x38')]);_0x2d1bba['message'][_0xa639('0x75')]=_0x542bb[_0xa639('0x75')];_0x2d1bba[_0xa639('0x28')][_0xa639('0x76')]=_0x542bb['channel'];_0x2d1bba[_0xa639('0x28')][_0xa639('0x82')]=_0xa639('0x34');respondWithRpcPromise('EventManager',_0xa639('0x78'),{'event':_0xa639('0x83'),'message':_0x2d1bba[_0xa639('0x28')]},client9002);return _0x542bb;}return null;})[_0xa639('0x1f')](respondWithResult(_0x30f817,null))[_0xa639('0x2a')](handleError(_0x30f817,null));};exports[_0xa639('0x2c')]=function(_0x2bf1e6,_0x44a098,_0x168873){if(_0x2bf1e6[_0xa639('0x5b')]['id']){delete _0x2bf1e6['body']['id'];}var _0x33d81f;return db[_0xa639('0x3b')][_0xa639('0x58')]({'where':{'id':_0x2bf1e6[_0xa639('0x54')]['id']}})[_0xa639('0x1f')](handleEntityNotFound(_0x44a098,null))[_0xa639('0x1f')](function(_0x10fedc){if(_0x10fedc){_0x33d81f=_0x10fedc;return db[_0xa639('0x84')]['find']({'where':{'id':_0x10fedc[_0xa639('0x85')]}});}})['then'](handleEntityNotFound(_0x44a098,null))[_0xa639('0x1f')](function(_0xef7612){if(_0xef7612){logger[_0xa639('0x22')](_0xa639('0x23'),'status',_0xa639('0x86'),_0xef7612[_0xa639('0x3e')],util['inspect'](_0x2bf1e6[_0xa639('0x5b')],{'showHidden':![],'depth':null}));switch(_0xef7612[_0xa639('0x3e')]){case _0xa639('0x87'):if(_0x2bf1e6[_0xa639('0x5b')]['MessageSid']&&_0x2bf1e6[_0xa639('0x5b')][_0xa639('0x88')]===_0x33d81f[_0xa639('0x89')]){return _0x33d81f[_0xa639('0x5a')]({'read':!![]});}else{logger[_0xa639('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa639('0x87'),util[_0xa639('0x8a')](_0x2bf1e6[_0xa639('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xa639('0x8b'):if(_0x2bf1e6['body'][_0xa639('0x8c')]&&_0x2bf1e6[_0xa639('0x5b')][_0xa639('0x8c')]===_0x33d81f[_0xa639('0x89')]&&_['indexOf'](['sent',_0xa639('0x8d')],_0x2bf1e6['body'][_0xa639('0x8e')])>=0x0){return _0x33d81f[_0xa639('0x5a')]({'read':!![]});}else{logger[_0xa639('0x26')](_0xa639('0x8f'),'status',_0xa639('0x90'),util[_0xa639('0x8a')](_0x2bf1e6['body'],{'showHidden':![],'depth':null}));}break;case _0xa639('0x91'):var _0x578c1c=_0x2bf1e6[_0xa639('0x5b')][_0xa639('0x92')][0x0];if(_0x578c1c[_0xa639('0x2c')][_0xa639('0x93')]===_0xa639('0x94')){return _0x33d81f['update']({'read':!![]});}else{logger[_0xa639('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa639('0x2c'),_0xa639('0x91'),util['inspect'](_0x2bf1e6[_0xa639('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x33d81f;}})[_0xa639('0x1f')](respondWithResult(_0x44a098,null))[_0xa639('0x2a')](handleError(_0x44a098,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 3d769fc..cbced98 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 _0x75fb=['SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x75fb,0x1d4));var _0xb75f=function(_0x5b8710,_0x4bb94b){_0x5b8710=_0x5b8710-0x0;var _0xbb7ccc=_0x75fb[_0x5b8710];return _0xbb7ccc;};'use strict';var EventEmitter=require(_0xb75f('0x0'));var SmsMessage=require(_0xb75f('0x1'))['db'][_0xb75f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb75f('0x3')](0x0);var events={'afterCreate':_0xb75f('0x4'),'afterUpdate':_0xb75f('0x5'),'afterDestroy':_0xb75f('0x6')};function emitEvent(_0xea6e82){return function(_0x9d5945,_0x397187,_0x44a7cb){SmsMessageEvents[_0xb75f('0x7')](_0xea6e82+':'+_0x9d5945['id'],_0x9d5945);SmsMessageEvents[_0xb75f('0x7')](_0xea6e82,_0x9d5945);_0x44a7cb(null);};}for(var e in events){if(events[_0xb75f('0x8')](e)){var event=events[e];SmsMessage[_0xb75f('0x9')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xff1d=['exports','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2fc8b8,_0x95c9d4){var _0x373a47=function(_0x1db381){while(--_0x1db381){_0x2fc8b8['push'](_0x2fc8b8['shift']());}};_0x373a47(++_0x95c9d4);}(_0xff1d,0x19b));var _0xdff1=function(_0x4fc9cc,_0x422e4f){_0x4fc9cc=_0x4fc9cc-0x0;var _0x2d1ea9=_0xff1d[_0x4fc9cc];return _0x2d1ea9;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xdff1('0x0'))['db'][_0xdff1('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdff1('0x2')](0x0);var events={'afterCreate':_0xdff1('0x3'),'afterUpdate':_0xdff1('0x4'),'afterDestroy':_0xdff1('0x5')};function emitEvent(_0x56480e){return function(_0x883020,_0xe3230,_0x2996cd){SmsMessageEvents[_0xdff1('0x6')](_0x56480e+':'+_0x883020['id'],_0x883020);SmsMessageEvents[_0xdff1('0x6')](_0x56480e,_0x883020);_0x2996cd(null);};}for(var e in events){if(events[_0xdff1('0x7')](e)){var event=events[e];SmsMessage[_0xdff1('0x8')](e,emitEvent(event));}}module[_0xdff1('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 9a4f3e9..80bd9c0 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 _0x228c=['smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','/auth/1/session','baseUrl','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','UserId','SmsInteraction','SmsInteractionId','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x228c,0xc6));var _0xc228=function(_0x2b25f2,_0x3d98e6){_0x2b25f2=_0x2b25f2-0x0;var _0x215ba9=_0x228c[_0x2b25f2];return _0x215ba9;};'use strict';var _=require(_0xc228('0x0'));var util=require(_0xc228('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc228('0x2'));var BPromise=require(_0xc228('0x3'));var rp=require(_0xc228('0x4'));var fs=require('fs');var path=require(_0xc228('0x5'));var rimraf=require('rimraf');var config=require(_0xc228('0x6'));var attributes=require('./smsMessage.attributes');module[_0xc228('0x7')]=function(_0x2f090f,_0x1d1371){return _0x2f090f[_0xc228('0x8')](_0xc228('0x9'),attributes,{'tableName':_0xc228('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc228('0xb')]},{'name':_0xc228('0xc'),'fields':[_0xc228('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f356b,_0x43c92d,_0x485e0f){var _0x68fea8=_0x2f090f[_0xc228('0xe')];var _0x441bb9=_0x4f356b[_0xc228('0xf')]({'plain':!![]});if(_0x441bb9[_0xc228('0x10')][_0xc228('0x11')]()==='in'||_0x441bb9[_0xc228('0x10')][_0xc228('0x11')]()===_0xc228('0x12')&&!_0x441bb9[_0xc228('0x13')]&&!_['isNil'](_0x441bb9[_0xc228('0x14')])&&!_['isNil'](_0x441bb9['SmsInteractionId'])){_0x68fea8[_0xc228('0x15')]['findOne']({'where':{'id':_0x441bb9[_0xc228('0x16')]}})['then'](function(_0x4bdfb1){if(_0x4bdfb1){_0x4bdfb1[_0xc228('0x17')]({'lastMsgAt':_0x441bb9[_0xc228('0x18')],'lastMsgDirection':_0x441bb9[_0xc228('0x10')]['toLowerCase']()});}})[_0xc228('0x19')](function(_0x2a1089){console[_0xc228('0x1a')](_0x2a1089);});}if(_0x441bb9[_0xc228('0x10')]===_0xc228('0x12')&&!_0x441bb9[_0xc228('0x13')]){var _0x15b429;_0x68fea8[_0xc228('0x1b')][_0xc228('0x1c')]({'where':{'id':_0x441bb9[_0xc228('0x1d')]},'raw':!![]})[_0xc228('0x1e')](function(_0x2a3ccf){_0x15b429=_0x2a3ccf;if(_0x15b429&&_0x15b429['type']){switch(_0x15b429[_0xc228('0x1f')]){case'twilio':var _0x521c6a=require(_0xc228('0x20'));if(_0x15b429[_0xc228('0x21')]&&_0x15b429[_0xc228('0x22')]&&_0x15b429[_0xc228('0x23')]){var _0x1825cf=new _0x521c6a(_0x15b429['accountSid'],_0x15b429[_0xc228('0x22')]);_0x1825cf[_0xc228('0x24')]['create']({'body':_0x441bb9[_0xc228('0xd')],'to':_0x441bb9[_0xc228('0x23')],'from':_0x15b429[_0xc228('0x23')],'statusCallback':_0x15b429[_0xc228('0x25')]+_0xc228('0x26')+_0x441bb9['id']+_0xc228('0x27')+_0x15b429[_0xc228('0x28')]})[_0xc228('0x1e')](function(_0x5af2a0){if(_0x5af2a0['sid']){return _0x4f356b[_0xc228('0x17')]({'messageId':_0x5af2a0[_0xc228('0x29')]});}})[_0xc228('0x19')](function(_0xf20fd){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc228('0x2a'),_0xc228('0x20'),util[_0xc228('0x2b')](_0xf20fd,{'showHidden':![],'depth':null}));});}else{logger[_0xc228('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc228('0x20'),_0xc228('0x2c'));}break;case'skebby':var _0x9883e0=_0xc228('0x2d');if(_0x15b429[_0xc228('0x2e')]&&_0x15b429[_0xc228('0x2f')]){var _0x17fad9={'recipient':[_0x441bb9['phone']],'message':_0x441bb9[_0xc228('0xd')],'message_type':_0x15b429[_0xc228('0x30')]};if(_0x15b429[_0xc228('0x30')]&&_0x15b429['smsMethod']!=='SI'){_0x17fad9[_0xc228('0x31')]=_0x15b429[_0xc228('0x23')];}var _0x15d53c={'url':_0x9883e0+_0xc228('0x32')+_0x15b429[_0xc228('0x2e')]+_0xc228('0x33')+_0x15b429[_0xc228('0x2f')],'method':_0xc228('0x34')};rp(_0x15d53c)['then'](function(_0x2a8ddd){var _0x18d2f2=_0x2a8ddd[_0xc228('0x35')](';');var _0x56768b={'user_key':_0x18d2f2[0x0],'session_key':_0x18d2f2[0x1]};_0x15d53c={'url':_0x9883e0+_0xc228('0x36'),'method':_0xc228('0x37'),'headers':{'user_key':_0x56768b[_0xc228('0x38')],'Session_key':_0x56768b[_0xc228('0x39')]},'json':!![],'body':_0x17fad9};return rp(_0x15d53c);})[_0xc228('0x1e')](function(_0x309d74){if(_0x309d74[_0xc228('0x3a')]>=0x1){var _0x8bab19={'messageId':_0x309d74['internal_order_id']};if(_0x15b429[_0xc228('0x30')]!=='GP'||!_0x15b429[_0xc228('0x3b')]){_0x8bab19[_0xc228('0x3c')]=!![];}return _0x4f356b[_0xc228('0x17')](_0x8bab19);}else{return logger['error'](_0xc228('0x3d'),'afterCreate','skebby',util['inspect'](_0x309d74,{'showHidden':![],'depth':null}));}})[_0xc228('0x19')](function(_0x22a2b1){return logger[_0xc228('0x1a')](_0xc228('0x3d'),'afterCreate','skebby',util[_0xc228('0x2b')](_0x22a2b1,{'showHidden':![],'depth':null}));});}else{logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x3e'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x15b429['authToken']){var _0x5b3a63={'recipient':_0x441bb9['phone'],'message':_0x441bb9[_0xc228('0xd')],'sender':_0x15b429[_0xc228('0x3f')]||_0x15b429[_0xc228('0x23')],'authorization':_0x15b429['authToken']};var _0x43c92d={'method':_0xc228('0x37'),'uri':_0xc228('0x40'),'body':_0x5b3a63,'json':!![]};rp(_0x43c92d)[_0xc228('0x1e')](function(_0x6cc842){var _0x58a1a7={'messageId':_0x6cc842[_0xc228('0x41')]};if(!_0x15b429['deliveryReport']){_0x58a1a7[_0xc228('0x3c')]=!![];}return _0x4f356b[_0xc228('0x17')](_0x58a1a7);})[_0xc228('0x19')](function(_0x112d9d){logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x42'),util['inspect'](_0x112d9d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x42'),_0xc228('0x43'));}break;case _0xc228('0x44'):if(_0x15b429[_0xc228('0x2e')]&&_0x15b429[_0xc228('0x2f')]){var _0x5b3a63={'messages':[{'source':'xCALLY\x20Motion','to':_0x441bb9[_0xc228('0x23')],'body':_0x441bb9[_0xc228('0xd')],'from':_0x15b429[_0xc228('0x3f')]||_0x15b429['phone']}]};var _0x243f9d=util[_0xc228('0x45')](_0xc228('0x46'),_0x15b429['username'],_0x15b429['password']);var _0x43c92d={'method':_0xc228('0x37'),'uri':_0xc228('0x47'),'body':_0x5b3a63,'headers':{'Authorization':util[_0xc228('0x45')](_0xc228('0x48'),new Buffer(_0x243f9d)[_0xc228('0x49')](_0xc228('0x4a')))},'json':!![]};rp(_0x43c92d)[_0xc228('0x1e')](function(_0x38b855){if(_0x38b855[_0xc228('0x4b')]>=0xc8&&_0x38b855[_0xc228('0x4b')]<=0xce){if(_0x38b855[_0xc228('0x4c')]&&_0x38b855['data'][_0xc228('0x4d')]>0x0){var _0x2c1885=_[_0xc228('0x4e')](_0x38b855[_0xc228('0x4c')]['messages']);var _0x89f702={'messageId':_0x2c1885[_0xc228('0x4f')]};if(!_0x15b429[_0xc228('0x3b')]){_0x89f702[_0xc228('0x3c')]=!![];}return _0x4f356b[_0xc228('0x17')](_0x89f702);}else{logger['error'](_0xc228('0x3d'),'afterCreate',_0xc228('0x50'),util[_0xc228('0x2b')](_0x38b855,{'showHidden':![],'depth':null}));}}else{logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x50'),util[_0xc228('0x2b')](_0x38b855,{'showHidden':![],'depth':null}));}})[_0xc228('0x19')](function(_0x48f982){logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x50'),util['inspect'](_0x48f982,{'showHidden':![],'depth':null}));});}else{logger[_0xc228('0x1a')](_0xc228('0x3d'),'afterCreate','clickSend',_0xc228('0x51'));}break;case'plivo':if(_0x15b429[_0xc228('0x52')]&&_0x15b429[_0xc228('0x22')]){var _0x5b3a63={'dst':_0x441bb9['phone'],'text':_0x441bb9['body'],'src':_0x15b429[_0xc228('0x3f')]||_0x15b429[_0xc228('0x23')],'url':_0x15b429['remote']+'/api/sms/messages/'+_0x441bb9['id']+_0xc228('0x27')+_0x15b429['token']};var _0x243f9d=util[_0xc228('0x45')](_0xc228('0x46'),_0x15b429[_0xc228('0x52')],_0x15b429[_0xc228('0x22')]);var _0x43c92d={'method':_0xc228('0x37'),'uri':util[_0xc228('0x45')](_0xc228('0x53'),_0x15b429[_0xc228('0x52')]),'body':_0x5b3a63,'headers':{'Authorization':util[_0xc228('0x45')](_0xc228('0x48'),new Buffer(_0x243f9d)[_0xc228('0x49')](_0xc228('0x4a')))},'json':!![]};rp(_0x43c92d)['then'](function(_0x2098a5){var _0x2e9fab={'messageId':_0x2098a5[_0xc228('0x54')][0x0]};return _0x4f356b['update'](_0x2e9fab);})[_0xc228('0x19')](function(_0x603b13){logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x55'),util['inspect'](_0x603b13,{'showHidden':![],'depth':null}));});}else{logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x55'),_0xc228('0x56'));}break;case _0xc228('0x57'):if(_0x15b429['username']&&_0x15b429[_0xc228('0x2f')]){if(_0x15b429['baseUrl']){var _0xbda93b={'method':'POST','uri':_0x15b429['baseUrl']+_0xc228('0x58'),'body':{'username':_0x15b429[_0xc228('0x2e')],'password':_0x15b429[_0xc228('0x2f')]},'json':!![]};return rp(_0xbda93b)[_0xc228('0x1e')](function(_0x2e441f){var _0x3a954f={'method':'POST','uri':_0x15b429[_0xc228('0x59')]+_0xc228('0x5a'),'body':{'messages':[{'from':_0x15b429['phone'],'destinations':[{'to':_0x441bb9['phone']}],'text':_0x441bb9[_0xc228('0xd')],'notifyUrl':_0x15b429[_0xc228('0x25')]+_0xc228('0x26')+_0x441bb9['id']+_0xc228('0x27')+_0x15b429['token'],'notifyContentType':_0xc228('0x5b'),'callbackData':_0x15b429['phone']+';'+_0x441bb9[_0xc228('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x2e441f['token']},'json':!![]};return rp(_0x3a954f)[_0xc228('0x1e')](function(_0x5a5ccd){if(_0x5a5ccd[_0xc228('0x24')]){var _0xb21486={'messageId':_0x5a5ccd[_0xc228('0x24')][0x0][_0xc228('0xb')]};if(!_0x15b429[_0xc228('0x3b')]){_0xb21486[_0xc228('0x3c')]=!![];}return _0x4f356b[_0xc228('0x17')](_0xb21486);}else{return logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x57'),util[_0xc228('0x2b')](_0x5a5ccd,{'showHidden':![],'depth':null}));}});})[_0xc228('0x19')](function(_0x4c7c4c){return logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x57'),util[_0xc228('0x2b')](_0x4c7c4c,{'showHidden':![],'depth':null}));});}else{logger[_0xc228('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0xc228('0x5c'));}}else{logger['error'](_0xc228('0x3d'),_0xc228('0x2a'),'infobip',_0xc228('0x51'));}break;case _0xc228('0x5d'):var _0x406744=require(_0xc228('0x5e'));if(_0x15b429[_0xc228('0x5f')]){var _0x19f05f={};_0x19f05f[_0xc228('0x60')]=_0x15b429[_0xc228('0x2e')];_0x19f05f[_0xc228('0x23')]=_0x441bb9[_0xc228('0x23')];_0x19f05f[_0xc228('0x31')]=_0x15b429['phone'];_0x19f05f[_0xc228('0x61')]=_0x441bb9[_0xc228('0xd')];_0x19f05f['timestamp']=+new Date();var _0x4b57ee='';var _0x4bae48='';var _0x253622=Object['keys'](_0x19f05f);_0x253622[_0xc228('0x62')]();for(var _0x2d3ac4=0x0;_0x2d3ac4<_0x253622[_0xc228('0x63')];_0x2d3ac4++){if(_0x4b57ee!=''){_0x4b57ee+='&';}_0x4b57ee+=_0x253622[_0x2d3ac4]+'='+encodeURIComponent(_0x19f05f[_0x253622[_0x2d3ac4]]);_0x4bae48+=_0x19f05f[_0x253622[_0x2d3ac4]];}_0x4bae48+=_0x15b429[_0xc228('0x5f')];_0x4bae48=_0x406744[_0xc228('0x64')](_0xc228('0x65'))[_0xc228('0x17')](_0x4bae48)[_0xc228('0x66')]('hex');if(_0x4b57ee!==''){_0x4b57ee+='&';}_0x4b57ee+=_0xc228('0x67')+_0x4bae48;var _0x15d53c={'method':_0xc228('0x34'),'uri':_0x15b429['baseUrl']+_0xc228('0x68')+_0x4b57ee,'json':!![]};return rp(_0x15d53c)[_0xc228('0x1e')](function(_0x4d7344){var _0xa279fa=Object[_0xc228('0x69')](_0x4d7344);if(_0x4d7344[_0xa279fa[0x0]][_0xc228('0x1a')]&&parseInt(_0x4d7344[_0xa279fa[0x0]][_0xc228('0x1a')])===0x0){var _0x15034c={'messageId':_0x4d7344[_0xa279fa[0x0]][_0xc228('0x6a')]};if(!_0x15b429['deliveryReport']){_0x15034c[_0xc228('0x3c')]=!![];}return _0x4f356b['update'](_0x15034c);}else{return logger['error'](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x5d'),util['inspect'](_0x4d7344['error'],{'showHidden':![],'depth':null}));}})[_0xc228('0x19')](function(_0x39ce77){return logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x5d'),util['inspect'](_0x39ce77,{'showHidden':![],'depth':null}));});}else{logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),'csc',_0xc228('0x6b'));}break;case _0xc228('0x6c'):if(_0x15b429[_0xc228('0x5f')]){var _0x53bf5d={'method':_0xc228('0x37'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x15b429[_0xc228('0x5f')]},'body':{'content':_0x441bb9['body'],'to':[_0x441bb9[_0xc228('0x23')]],'from':_0x15b429[_0xc228('0x23')],'binary':![],'clientMessageId':'uuid','charset':_0xc228('0x6d')},'json':!![]};rp(_0x53bf5d)[_0xc228('0x1e')](function(_0x4d3ea3){if(!_0x4d3ea3[_0xc228('0x1a')]){var _0x226a38={'messageId':_0x4d3ea3[_0xc228('0x24')][0x0]['apiMessageId']};if(!_0x15b429[_0xc228('0x3b')]){_0x226a38[_0xc228('0x3c')]=!![];}return _0x4f356b[_0xc228('0x17')](_0x226a38);}else{return logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x6c'),util['inspect'](_0x4d3ea3[_0xc228('0x1a')],{'showHidden':![],'depth':null}));}})[_0xc228('0x19')](function(_0x18fb25){return logger['error'](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x6c'),util[_0xc228('0x2b')](_0x18fb25,{'showHidden':![],'depth':null}));});}else{logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x6c'),_0xc228('0x6b'));}break;case'bandwidth':if(_0x15b429['username']&&_0x15b429[_0xc228('0x2f')]){var _0x243f9d=util[_0xc228('0x45')](_0xc228('0x46'),_0x15b429['username'],_0x15b429[_0xc228('0x2f')]);var _0x43c92d={'method':_0xc228('0x37'),'uri':_0xc228('0x6e')+_0x15b429['accountId']+_0xc228('0x6f'),'body':{'to':[_0x441bb9['phone']],'text':_0x441bb9[_0xc228('0xd')],'from':_0x15b429[_0xc228('0x23')],'applicationId':_0x15b429[_0xc228('0x70')]},'headers':{'Authorization':util[_0xc228('0x45')](_0xc228('0x48'),new Buffer(_0x243f9d)[_0xc228('0x49')](_0xc228('0x4a')))},'json':!![]};rp(_0x43c92d)[_0xc228('0x1e')](function(_0x30cfbb){if(_0x30cfbb['id']){var _0x343be5={'messageId':_0x30cfbb['id']};return _0x4f356b[_0xc228('0x17')](_0x343be5);}else{logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),'bandwidth',util[_0xc228('0x2b')](_0x30cfbb,{'showHidden':![],'depth':null}));}})[_0xc228('0x19')](function(_0x18a80b){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc228('0x2a'),_0xc228('0x71'),util[_0xc228('0x2b')](_0x18a80b,{'showHidden':![],'depth':null}));});}else{logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x71'),_0xc228('0x51'));}break;case _0xc228('0x72'):if(_0x15b429['apiKey']){var _0x9d97a3={};var _0x15d53c={'method':'POST','uri':_0xc228('0x73'),'headers':{'Authorization':_0xc228('0x74')+_0x15b429[_0xc228('0x5f')],'Content-Type':_0xc228('0x5b')},'body':{'from':_0x15b429[_0xc228('0x23')],'to':_0x441bb9[_0xc228('0x23')],'text':_0x441bb9[_0xc228('0xd')]},'json':!![]};return rp(_0x15d53c)['then'](function(_0x2d9942){if(_0x2d9942[_0xc228('0x75')]==0xca){_0x9d97a3['message']=_0x2d9942;var _0x2a720b={'method':_0xc228('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xc228('0x74')+_0x15b429[_0xc228('0x5f')],'Content-Type':'application/json'},'body':{'refid':_0x9d97a3['message']['refid']},'json':!![]};return rp(_0x2a720b)['then'](function(_0x29a36c){_0x9d97a3['status']=_0x29a36c;var _0x39f35c={'messageId':_0x9d97a3['message'][_0xc228('0x76')],'read':!![]};return _0x4f356b[_0xc228('0x17')](_0x39f35c);});}else{return logger['error'](_0xc228('0x3d'),_0xc228('0x2a'),'intelepeer',util[_0xc228('0x2b')](_0x2d9942,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3553da){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc228('0x2a'),'intelepeer',util['inspect'](_0x3553da,{'showHidden':![],'depth':null}));});}else{return logger[_0xc228('0x1a')](_0xc228('0x3d'),_0xc228('0x2a'),_0xc228('0x72'),_0xc228('0x77'));}break;}}})[_0xc228('0x78')](function(){_0x485e0f();});}else{_0x485e0f();}}},'charset':_0xc228('0x79'),'collate':_0xc228('0x7a')});}; \ No newline at end of file +var _0x42f2=['utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','SmsInteractionId','findOne','then','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','username','split','sms','POST','session_key','total_sent','internal_order_id','read','connectel','requestid','deliveryReport','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','/api/sms/messages/','token','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','sort','length','createHash','digest','hex','signature=','GET','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x42f2,0x166));var _0x242f=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x42f2[_0x172133];return _0x2460e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x242f('0x0'))(_0x242f('0x1'));var moment=require(_0x242f('0x2'));var BPromise=require(_0x242f('0x3'));var rp=require(_0x242f('0x4'));var fs=require('fs');var path=require(_0x242f('0x5'));var rimraf=require(_0x242f('0x6'));var config=require(_0x242f('0x7'));var attributes=require(_0x242f('0x8'));module[_0x242f('0x9')]=function(_0x5a83ac,_0xb9423a){return _0x5a83ac['define'](_0x242f('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x242f('0xb')]},{'name':_0x242f('0xc'),'fields':[_0x242f('0xd')],'type':_0x242f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f7120,_0x1dcec9,_0x39095f){var _0x499832=_0x5a83ac['models'];var _0x362069=_0x2f7120['get']({'plain':!![]});if(_0x362069[_0x242f('0xf')][_0x242f('0x10')]()==='in'||_0x362069[_0x242f('0xf')][_0x242f('0x10')]()===_0x242f('0x11')&&!_0x362069[_0x242f('0x12')]&&!_[_0x242f('0x13')](_0x362069['UserId'])&&!_[_0x242f('0x13')](_0x362069[_0x242f('0x14')])){_0x499832['SmsInteraction'][_0x242f('0x15')]({'where':{'id':_0x362069[_0x242f('0x14')]}})[_0x242f('0x16')](function(_0x2ee042){if(_0x2ee042){_0x2ee042['update']({'lastMsgAt':_0x362069[_0x242f('0x17')],'lastMsgDirection':_0x362069[_0x242f('0xf')][_0x242f('0x10')]()});}})[_0x242f('0x18')](function(_0x22d654){console[_0x242f('0x19')](_0x22d654);});}if(_0x362069[_0x242f('0xf')]===_0x242f('0x11')&&!_0x362069[_0x242f('0x12')]){var _0x494fe2;_0x499832[_0x242f('0x1a')]['find']({'where':{'id':_0x362069[_0x242f('0x1b')]},'raw':!![]})[_0x242f('0x16')](function(_0x2b1bdb){_0x494fe2=_0x2b1bdb;if(_0x494fe2&&_0x494fe2[_0x242f('0x1c')]){switch(_0x494fe2[_0x242f('0x1c')]){case _0x242f('0x1d'):var _0x611535=require(_0x242f('0x1d'));if(_0x494fe2[_0x242f('0x1e')]&&_0x494fe2[_0x242f('0x1f')]&&_0x494fe2[_0x242f('0x20')]){var _0x4c48ee=new _0x611535(_0x494fe2[_0x242f('0x1e')],_0x494fe2[_0x242f('0x1f')]);_0x4c48ee[_0x242f('0x21')]['create']({'body':_0x362069[_0x242f('0xd')],'to':_0x362069['phone'],'from':_0x494fe2['phone'],'statusCallback':_0x494fe2[_0x242f('0x22')]+'/api/sms/messages/'+_0x362069['id']+'/status?token='+_0x494fe2['token']})[_0x242f('0x16')](function(_0x3c88be){if(_0x3c88be[_0x242f('0x23')]){return _0x2f7120[_0x242f('0x24')]({'messageId':_0x3c88be['sid']});}})[_0x242f('0x18')](function(_0x554eff){logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),'twilio',util[_0x242f('0x27')](_0x554eff,{'showHidden':![],'depth':null}));});}else{logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x1d'),_0x242f('0x28'));}break;case _0x242f('0x29'):var _0x599594=_0x242f('0x2a');if(_0x494fe2['username']&&_0x494fe2[_0x242f('0x2b')]){var _0x1ffc89={'recipient':[_0x362069[_0x242f('0x20')]],'message':_0x362069[_0x242f('0xd')],'message_type':_0x494fe2[_0x242f('0x2c')]};if(_0x494fe2[_0x242f('0x2c')]&&_0x494fe2[_0x242f('0x2c')]!=='SI'){_0x1ffc89[_0x242f('0x2d')]=_0x494fe2[_0x242f('0x20')];}var _0xadd4f1={'url':_0x599594+'login?username='+_0x494fe2[_0x242f('0x2e')]+'&password='+_0x494fe2[_0x242f('0x2b')],'method':'GET'};rp(_0xadd4f1)[_0x242f('0x16')](function(_0x1bb36d){var _0xec71bc=_0x1bb36d[_0x242f('0x2f')](';');var _0x24542e={'user_key':_0xec71bc[0x0],'session_key':_0xec71bc[0x1]};_0xadd4f1={'url':_0x599594+_0x242f('0x30'),'method':_0x242f('0x31'),'headers':{'user_key':_0x24542e['user_key'],'Session_key':_0x24542e[_0x242f('0x32')]},'json':!![],'body':_0x1ffc89};return rp(_0xadd4f1);})['then'](function(_0x4dfe0b){if(_0x4dfe0b[_0x242f('0x33')]>=0x1){var _0x200991={'messageId':_0x4dfe0b[_0x242f('0x34')]};if(_0x494fe2[_0x242f('0x2c')]!=='GP'||!_0x494fe2['deliveryReport']){_0x200991[_0x242f('0x35')]=!![];}return _0x2f7120['update'](_0x200991);}else{return logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x29'),util[_0x242f('0x27')](_0x4dfe0b,{'showHidden':![],'depth':null}));}})[_0x242f('0x18')](function(_0x2e9399){return logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x29'),util[_0x242f('0x27')](_0x2e9399,{'showHidden':![],'depth':null}));});}else{logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x242f('0x36'):if(_0x494fe2[_0x242f('0x1f')]){var _0x21f956={'recipient':_0x362069[_0x242f('0x20')],'message':_0x362069['body'],'sender':_0x494fe2['senderString']||_0x494fe2['phone'],'authorization':_0x494fe2[_0x242f('0x1f')]};var _0x1dcec9={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x21f956,'json':!![]};rp(_0x1dcec9)[_0x242f('0x16')](function(_0x1cecc4){var _0x5de3a0={'messageId':_0x1cecc4[_0x242f('0x37')]};if(!_0x494fe2[_0x242f('0x38')]){_0x5de3a0[_0x242f('0x35')]=!![];}return _0x2f7120[_0x242f('0x24')](_0x5de3a0);})[_0x242f('0x18')](function(_0x328771){logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),'connectel',util[_0x242f('0x27')](_0x328771,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x242f('0x36'),'Missing\x20parameters:\x20authToken');}break;case _0x242f('0x39'):if(_0x494fe2[_0x242f('0x2e')]&&_0x494fe2[_0x242f('0x2b')]){var _0x21f956={'messages':[{'source':_0x242f('0x3a'),'to':_0x362069[_0x242f('0x20')],'body':_0x362069[_0x242f('0xd')],'from':_0x494fe2[_0x242f('0x3b')]||_0x494fe2[_0x242f('0x20')]}]};var _0x2e30df=util[_0x242f('0x3c')](_0x242f('0x3d'),_0x494fe2['username'],_0x494fe2[_0x242f('0x2b')]);var _0x1dcec9={'method':_0x242f('0x31'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x21f956,'headers':{'Authorization':util[_0x242f('0x3c')](_0x242f('0x3e'),new Buffer(_0x2e30df)['toString'](_0x242f('0x3f')))},'json':!![]};rp(_0x1dcec9)[_0x242f('0x16')](function(_0x1bc893){if(_0x1bc893[_0x242f('0x40')]>=0xc8&&_0x1bc893['http_code']<=0xce){if(_0x1bc893[_0x242f('0x41')]&&_0x1bc893[_0x242f('0x41')][_0x242f('0x42')]>0x0){var _0x268438=_[_0x242f('0x43')](_0x1bc893[_0x242f('0x41')][_0x242f('0x21')]);var _0x4cd26d={'messageId':_0x268438['message_id']};if(!_0x494fe2[_0x242f('0x38')]){_0x4cd26d[_0x242f('0x35')]=!![];}return _0x2f7120[_0x242f('0x24')](_0x4cd26d);}else{logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x44'),util['inspect'](_0x1bc893,{'showHidden':![],'depth':null}));}}else{logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x44'),util[_0x242f('0x27')](_0x1bc893,{'showHidden':![],'depth':null}));}})[_0x242f('0x18')](function(_0xa4b481){logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x44'),util[_0x242f('0x27')](_0xa4b481,{'showHidden':![],'depth':null}));});}else{logger[_0x242f('0x19')](_0x242f('0x25'),'afterCreate',_0x242f('0x44'),_0x242f('0x45'));}break;case _0x242f('0x46'):if(_0x494fe2[_0x242f('0x47')]&&_0x494fe2['authToken']){var _0x21f956={'dst':_0x362069[_0x242f('0x20')],'text':_0x362069[_0x242f('0xd')],'src':_0x494fe2[_0x242f('0x3b')]||_0x494fe2[_0x242f('0x20')],'url':_0x494fe2[_0x242f('0x22')]+_0x242f('0x48')+_0x362069['id']+'/status?token='+_0x494fe2[_0x242f('0x49')]};var _0x2e30df=util[_0x242f('0x3c')](_0x242f('0x3d'),_0x494fe2[_0x242f('0x47')],_0x494fe2[_0x242f('0x1f')]);var _0x1dcec9={'method':_0x242f('0x31'),'uri':util[_0x242f('0x3c')](_0x242f('0x4a'),_0x494fe2[_0x242f('0x47')]),'body':_0x21f956,'headers':{'Authorization':util[_0x242f('0x3c')](_0x242f('0x3e'),new Buffer(_0x2e30df)[_0x242f('0x4b')]('base64'))},'json':!![]};rp(_0x1dcec9)[_0x242f('0x16')](function(_0x1b74ec){var _0xbea9ec={'messageId':_0x1b74ec[_0x242f('0x4c')][0x0]};return _0x2f7120['update'](_0xbea9ec);})[_0x242f('0x18')](function(_0x2ce228){logger['error'](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x46'),util['inspect'](_0x2ce228,{'showHidden':![],'depth':null}));});}else{logger[_0x242f('0x19')](_0x242f('0x25'),'afterCreate','plivo',_0x242f('0x4d'));}break;case'infobip':if(_0x494fe2[_0x242f('0x2e')]&&_0x494fe2[_0x242f('0x2b')]){if(_0x494fe2[_0x242f('0x4e')]){var _0x4743d8={'method':_0x242f('0x31'),'uri':_0x494fe2[_0x242f('0x4e')]+_0x242f('0x4f'),'body':{'username':_0x494fe2[_0x242f('0x2e')],'password':_0x494fe2['password']},'json':!![]};return rp(_0x4743d8)['then'](function(_0x16af65){var _0x510c27={'method':_0x242f('0x31'),'uri':_0x494fe2['baseUrl']+_0x242f('0x50'),'body':{'messages':[{'from':_0x494fe2[_0x242f('0x20')],'destinations':[{'to':_0x362069[_0x242f('0x20')]}],'text':_0x362069[_0x242f('0xd')],'notifyUrl':_0x494fe2['remote']+_0x242f('0x48')+_0x362069['id']+'/status?token='+_0x494fe2[_0x242f('0x49')],'notifyContentType':_0x242f('0x51'),'callbackData':_0x494fe2[_0x242f('0x20')]+';'+_0x362069['body']}]},'headers':{'Authorization':_0x242f('0x52')+_0x16af65[_0x242f('0x49')]},'json':!![]};return rp(_0x510c27)[_0x242f('0x16')](function(_0x3cc5d5){if(_0x3cc5d5[_0x242f('0x21')]){var _0x5f10de={'messageId':_0x3cc5d5[_0x242f('0x21')][0x0][_0x242f('0xb')]};if(!_0x494fe2[_0x242f('0x38')]){_0x5f10de[_0x242f('0x35')]=!![];}return _0x2f7120['update'](_0x5f10de);}else{return logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util[_0x242f('0x27')](_0x3cc5d5,{'showHidden':![],'depth':null}));}});})[_0x242f('0x18')](function(_0x304277){return logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x53'),util[_0x242f('0x27')](_0x304277,{'showHidden':![],'depth':null}));});}else{logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x53'),_0x242f('0x54'));}}else{logger['error'](_0x242f('0x25'),'afterCreate',_0x242f('0x53'),_0x242f('0x45'));}break;case _0x242f('0x55'):var _0x310e38=require(_0x242f('0x56'));if(_0x494fe2[_0x242f('0x57')]){var _0x5d2d5c={};_0x5d2d5c[_0x242f('0x58')]=_0x494fe2['username'];_0x5d2d5c[_0x242f('0x20')]=_0x362069[_0x242f('0x20')];_0x5d2d5c[_0x242f('0x2d')]=_0x494fe2[_0x242f('0x20')];_0x5d2d5c[_0x242f('0x59')]=_0x362069[_0x242f('0xd')];_0x5d2d5c['timestamp']=+new Date();var _0x50c2de='';var _0x2cfd58='';var _0x510906=Object['keys'](_0x5d2d5c);_0x510906[_0x242f('0x5a')]();for(var _0x2714d6=0x0;_0x2714d6<_0x510906[_0x242f('0x5b')];_0x2714d6++){if(_0x50c2de!=''){_0x50c2de+='&';}_0x50c2de+=_0x510906[_0x2714d6]+'='+encodeURIComponent(_0x5d2d5c[_0x510906[_0x2714d6]]);_0x2cfd58+=_0x5d2d5c[_0x510906[_0x2714d6]];}_0x2cfd58+=_0x494fe2[_0x242f('0x57')];_0x2cfd58=_0x310e38[_0x242f('0x5c')]('md5')['update'](_0x2cfd58)[_0x242f('0x5d')](_0x242f('0x5e'));if(_0x50c2de!==''){_0x50c2de+='&';}_0x50c2de+=_0x242f('0x5f')+_0x2cfd58;var _0xadd4f1={'method':_0x242f('0x60'),'uri':_0x494fe2[_0x242f('0x4e')]+_0x242f('0x61')+_0x50c2de,'json':!![]};return rp(_0xadd4f1)[_0x242f('0x16')](function(_0x2b9e59){var _0x2b5f78=Object[_0x242f('0x62')](_0x2b9e59);if(_0x2b9e59[_0x2b5f78[0x0]][_0x242f('0x19')]&&parseInt(_0x2b9e59[_0x2b5f78[0x0]]['error'])===0x0){var _0x174582={'messageId':_0x2b9e59[_0x2b5f78[0x0]][_0x242f('0x63')]};if(!_0x494fe2['deliveryReport']){_0x174582[_0x242f('0x35')]=!![];}return _0x2f7120['update'](_0x174582);}else{return logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x55'),util[_0x242f('0x27')](_0x2b9e59[_0x242f('0x19')],{'showHidden':![],'depth':null}));}})[_0x242f('0x18')](function(_0x57182a){return logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x55'),util[_0x242f('0x27')](_0x57182a,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x55'),_0x242f('0x64'));}break;case'clickatell':if(_0x494fe2[_0x242f('0x57')]){var _0x229d5e={'method':'POST','uri':_0x242f('0x65'),'headers':{'Authorization':_0x494fe2[_0x242f('0x57')]},'body':{'content':_0x362069['body'],'to':[_0x362069[_0x242f('0x20')]],'from':_0x494fe2[_0x242f('0x20')],'binary':![],'clientMessageId':'uuid','charset':_0x242f('0x66')},'json':!![]};rp(_0x229d5e)['then'](function(_0x31d89c){if(!_0x31d89c[_0x242f('0x19')]){var _0x573bfa={'messageId':_0x31d89c[_0x242f('0x21')][0x0]['apiMessageId']};if(!_0x494fe2['deliveryReport']){_0x573bfa[_0x242f('0x35')]=!![];}return _0x2f7120[_0x242f('0x24')](_0x573bfa);}else{return logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x67'),util[_0x242f('0x27')](_0x31d89c[_0x242f('0x19')],{'showHidden':![],'depth':null}));}})[_0x242f('0x18')](function(_0x110d0f){return logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),'clickatell',util[_0x242f('0x27')](_0x110d0f,{'showHidden':![],'depth':null}));});}else{logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x67'),_0x242f('0x64'));}break;case _0x242f('0x68'):if(_0x494fe2[_0x242f('0x2e')]&&_0x494fe2[_0x242f('0x2b')]){var _0x2e30df=util['format']('%s:%s',_0x494fe2[_0x242f('0x2e')],_0x494fe2[_0x242f('0x2b')]);var _0x1dcec9={'method':_0x242f('0x31'),'uri':_0x242f('0x69')+_0x494fe2[_0x242f('0x6a')]+_0x242f('0x6b'),'body':{'to':[_0x362069[_0x242f('0x20')]],'text':_0x362069[_0x242f('0xd')],'from':_0x494fe2[_0x242f('0x20')],'applicationId':_0x494fe2[_0x242f('0x6c')]},'headers':{'Authorization':util[_0x242f('0x3c')](_0x242f('0x3e'),new Buffer(_0x2e30df)[_0x242f('0x4b')](_0x242f('0x3f')))},'json':!![]};rp(_0x1dcec9)[_0x242f('0x16')](function(_0x42e9a1){if(_0x42e9a1['id']){var _0x195ced={'messageId':_0x42e9a1['id']};return _0x2f7120[_0x242f('0x24')](_0x195ced);}else{logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x68'),util['inspect'](_0x42e9a1,{'showHidden':![],'depth':null}));}})[_0x242f('0x18')](function(_0x4e4fc0){logger['error'](_0x242f('0x25'),_0x242f('0x26'),_0x242f('0x68'),util[_0x242f('0x27')](_0x4e4fc0,{'showHidden':![],'depth':null}));});}else{logger[_0x242f('0x19')](_0x242f('0x25'),'afterCreate',_0x242f('0x68'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x242f('0x6d'):if(_0x494fe2[_0x242f('0x57')]){var _0x1d383b={};var _0xadd4f1={'method':_0x242f('0x31'),'uri':_0x242f('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x494fe2[_0x242f('0x57')],'Content-Type':'application/json'},'body':{'from':_0x494fe2[_0x242f('0x20')],'to':_0x362069[_0x242f('0x20')],'text':_0x362069[_0x242f('0xd')]},'json':!![]};return rp(_0xadd4f1)['then'](function(_0x4e5d97){if(_0x4e5d97['code']==0xca){_0x1d383b[_0x242f('0x6f')]=_0x4e5d97;var _0x59f7d9={'method':_0x242f('0x31'),'uri':_0x242f('0x70'),'headers':{'Authorization':_0x242f('0x71')+_0x494fe2[_0x242f('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x1d383b[_0x242f('0x6f')][_0x242f('0x72')]},'json':!![]};return rp(_0x59f7d9)[_0x242f('0x16')](function(_0x1a8764){_0x1d383b[_0x242f('0x73')]=_0x1a8764;var _0x589101={'messageId':_0x1d383b[_0x242f('0x6f')][_0x242f('0x72')],'read':!![]};return _0x2f7120[_0x242f('0x24')](_0x589101);});}else{return logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),'intelepeer',util[_0x242f('0x27')](_0x4e5d97,{'showHidden':![],'depth':null}));}})[_0x242f('0x18')](function(_0x2b2178){return logger[_0x242f('0x19')](_0x242f('0x25'),_0x242f('0x26'),'intelepeer',util[_0x242f('0x27')](_0x2b2178,{'showHidden':![],'depth':null}));});}else{return logger[_0x242f('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x242f('0x26'),_0x242f('0x6d'),_0x242f('0x74'));}break;}}})[_0x242f('0x75')](function(){_0x39095f();});}else{_0x39095f();}}},'charset':_0x242f('0x76'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 2f0b7ba..a4d5f2d 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 _0x8dfe=['SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','lodash','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info'];(function(_0x26f380,_0x5959d4){var _0x265011=function(_0x1f5a25){while(--_0x1f5a25){_0x26f380['push'](_0x26f380['shift']());}};_0x265011(++_0x5959d4);}(_0x8dfe,0xf6));var _0xe8df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8dfe[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe8df('0x0'));var util=require(_0xe8df('0x1'));var moment=require(_0xe8df('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8df('0x3'))['db'];var utils=require(_0xe8df('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe8df('0x5'));var jayson=require(_0xe8df('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xe8df('0x7')]=_[_0xe8df('0x8')](config[_0xe8df('0x7')],{'host':_0xe8df('0x9'),'port':0x18eb});var socket=require(_0xe8df('0xa'))(new Redis(config[_0xe8df('0x7')]));require(_0xe8df('0xb'))[_0xe8df('0xc')](socket);function respondWithRpcPromise(_0xf89538,_0xa0f220,_0x1d8f41){return new BPromise(function(_0x18ec56,_0x1f2290){return client['request'](_0xf89538,_0x1d8f41)[_0xe8df('0xd')](function(_0x3c32a9){logger[_0xe8df('0xe')](_0xe8df('0xf'),_0xa0f220,_0xe8df('0x10'));logger[_0xe8df('0x11')](_0xe8df('0x12'),_0xa0f220,_0xe8df('0x10'),JSON[_0xe8df('0x13')](_0x3c32a9));if(_0x3c32a9[_0xe8df('0x14')]){if(_0x3c32a9[_0xe8df('0x14')]['code']===0x1f4){logger[_0xe8df('0x14')]('SmsMessage,\x20%s,\x20%s',_0xa0f220,_0x3c32a9[_0xe8df('0x14')][_0xe8df('0x15')]);return _0x1f2290(_0x3c32a9[_0xe8df('0x14')][_0xe8df('0x15')]);}logger[_0xe8df('0x14')](_0xe8df('0xf'),_0xa0f220,_0x3c32a9[_0xe8df('0x14')]['message']);return _0x18ec56(_0x3c32a9[_0xe8df('0x14')][_0xe8df('0x15')]);}else{logger[_0xe8df('0xe')](_0xe8df('0xf'),_0xa0f220,_0xe8df('0x10'));_0x18ec56(_0x3c32a9[_0xe8df('0x16')]['message']);}})[_0xe8df('0x17')](function(_0x7e657b){logger[_0xe8df('0x14')](_0xe8df('0xf'),_0xa0f220,_0x7e657b);_0x1f2290(_0x7e657b);});});}exports[_0xe8df('0x18')]=function(_0x4a7519){var _0xd5c9e0=this;return new Promise(function(_0x36fe85,_0x5bb0dc){return db[_0xe8df('0x19')][_0xe8df('0x1a')](_0x4a7519['body'],{'raw':_0x4a7519[_0xe8df('0x1b')]?_0x4a7519[_0xe8df('0x1b')][_0xe8df('0x1c')]===undefined?!![]:![]:!![]})[_0xe8df('0xd')](function(_0xa79ba3){logger[_0xe8df('0xe')]('CreateSmsMessage',_0x4a7519);logger[_0xe8df('0x11')](_0xe8df('0x18'),_0x4a7519,JSON['stringify'](_0xa79ba3));_0x36fe85(_0xa79ba3);})[_0xe8df('0x17')](function(_0x5dee92){logger[_0xe8df('0x14')](_0xe8df('0x18'),_0x5dee92[_0xe8df('0x15')],_0x4a7519);_0x5bb0dc(_0xd5c9e0[_0xe8df('0x14')](0x1f4,_0x5dee92[_0xe8df('0x15')]));});});}; \ No newline at end of file +var _0x6572=['request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSmsMessage','create','options','info','catch','lodash','util','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s'];(function(_0x3419b0,_0x255acd){var _0x2fddb6=function(_0x3de0a1){while(--_0x3de0a1){_0x3419b0['push'](_0x3419b0['shift']());}};_0x2fddb6(++_0x255acd);}(_0x6572,0xdc));var _0x2657=function(_0x30d056,_0x33dadf){_0x30d056=_0x30d056-0x0;var _0x2ac901=_0x6572[_0x30d056];return _0x2ac901;};'use strict';var _=require(_0x2657('0x0'));var util=require(_0x2657('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('../../config/utils');var logger=require(_0x2657('0x2'))(_0x2657('0x3'));var config=require(_0x2657('0x4'));var jayson=require(_0x2657('0x5'));var client=jayson[_0x2657('0x6')]['http']({'port':0x232a});config[_0x2657('0x7')]=_['defaults'](config[_0x2657('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x2657('0x8'))(new Redis(config[_0x2657('0x7')]));require(_0x2657('0x9'))[_0x2657('0xa')](socket);function respondWithRpcPromise(_0x5b28f4,_0xb65f7a,_0x5d71f6){return new BPromise(function(_0x4855b4,_0x2b5050){return client[_0x2657('0xb')](_0x5b28f4,_0x5d71f6)[_0x2657('0xc')](function(_0x2b0337){logger['info'](_0x2657('0xd'),_0xb65f7a,_0x2657('0xe'));logger[_0x2657('0xf')](_0x2657('0x10'),_0xb65f7a,'request\x20sent',JSON[_0x2657('0x11')](_0x2b0337));if(_0x2b0337[_0x2657('0x12')]){if(_0x2b0337['error']['code']===0x1f4){logger[_0x2657('0x12')]('SmsMessage,\x20%s,\x20%s',_0xb65f7a,_0x2b0337[_0x2657('0x12')][_0x2657('0x13')]);return _0x2b5050(_0x2b0337[_0x2657('0x12')]['message']);}logger['error'](_0x2657('0xd'),_0xb65f7a,_0x2b0337[_0x2657('0x12')][_0x2657('0x13')]);return _0x4855b4(_0x2b0337['error'][_0x2657('0x13')]);}else{logger['info'](_0x2657('0xd'),_0xb65f7a,_0x2657('0xe'));_0x4855b4(_0x2b0337[_0x2657('0x14')][_0x2657('0x13')]);}})['catch'](function(_0x3d6ba8){logger[_0x2657('0x12')](_0x2657('0xd'),_0xb65f7a,_0x3d6ba8);_0x2b5050(_0x3d6ba8);});});}exports[_0x2657('0x15')]=function(_0x3b8d69){var _0x4033bc=this;return new Promise(function(_0x1024b8,_0x561338){return db['SmsMessage'][_0x2657('0x16')](_0x3b8d69['body'],{'raw':_0x3b8d69['options']?_0x3b8d69[_0x2657('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x2657('0xc')](function(_0x34e9df){logger[_0x2657('0x18')]('CreateSmsMessage',_0x3b8d69);logger[_0x2657('0xf')]('CreateSmsMessage',_0x3b8d69,JSON['stringify'](_0x34e9df));_0x1024b8(_0x34e9df);})[_0x2657('0x19')](function(_0x1adf12){logger[_0x2657('0x12')]('CreateSmsMessage',_0x1adf12[_0x2657('0x13')],_0x3b8d69);_0x561338(_0x4033bc[_0x2657('0x12')](0x1f4,_0x1adf12[_0x2657('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d687cb2..c1411a3 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 _0xa532=['length','save','emit'];(function(_0x5da955,_0x32d5cd){var _0x5450d6=function(_0x540565){while(--_0x540565){_0x5da955['push'](_0x5da955['shift']());}};_0x5450d6(++_0x32d5cd);}(_0xa532,0x130));var _0x2a53=function(_0x2170fd,_0x29808a){_0x2170fd=_0x2170fd-0x0;var _0x3a16ec=_0xa532[_0x2170fd];return _0x3a16ec;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x2a53('0x0'),'remove','update'];function createListener(_0x3e87c9,_0x48f0b7){return function(_0x8a8c8){_0x48f0b7[_0x2a53('0x1')](_0x3e87c9,_0x8a8c8);};}function removeListener(_0x38f923,_0x2ac06d){return function(){SmsMessageEvents['removeListener'](_0x38f923,_0x2ac06d);};}exports['register']=function(_0x3c68a2){for(var _0xa9eb48=0x0,_0x482400=events[_0x2a53('0x2')];_0xa9eb48<_0x482400;_0xa9eb48++){var _0x2c8402=events[_0xa9eb48];var _0x2b0223=createListener('smsMessage:'+_0x2c8402,_0x3c68a2);SmsMessageEvents['on'](_0x2c8402,_0x2b0223);}}; \ No newline at end of file +var _0x62d2=['update','emit','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0xf96b54,_0xfb0731){var _0xfbd184=function(_0x2da546){while(--_0x2da546){_0xf96b54['push'](_0xf96b54['shift']());}};_0xfbd184(++_0xfb0731);}(_0x62d2,0xdd));var _0x262d=function(_0x4ceb13,_0x5e70f7){_0x4ceb13=_0x4ceb13-0x0;var _0x11f6e7=_0x62d2[_0x4ceb13];return _0x11f6e7;};'use strict';var SmsMessageEvents=require(_0x262d('0x0'));var events=[_0x262d('0x1'),_0x262d('0x2'),_0x262d('0x3')];function createListener(_0x392f70,_0x4af386){return function(_0x7fc039){_0x4af386[_0x262d('0x4')](_0x392f70,_0x7fc039);};}function removeListener(_0xa427f4,_0x31c9ac){return function(){SmsMessageEvents['removeListener'](_0xa427f4,_0x31c9ac);};}exports[_0x262d('0x5')]=function(_0x37d02f){for(var _0x4dfb78=0x0,_0x2ba41b=events[_0x262d('0x6')];_0x4dfb78<_0x2ba41b;_0x4dfb78++){var _0x13b3af=events[_0x4dfb78];var _0x54482a=createListener(_0x262d('0x7')+_0x13b3af,_0x37d02f);SmsMessageEvents['on'](_0x13b3af,_0x54482a);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5d9a790..1f79fd7 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 _0xfc70=['delete','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy'];(function(_0x4134f4,_0x26ad97){var _0x3ab724=function(_0x9d61c6){while(--_0x9d61c6){_0x4134f4['push'](_0x4134f4['shift']());}};_0x3ab724(++_0x26ad97);}(_0xfc70,0x108));var _0x0fc7=function(_0x4d5841,_0x44b82a){_0x4d5841=_0x4d5841-0x0;var _0x537c09=_0xfc70[_0x4d5841];return _0x537c09;};'use strict';var multer=require(_0x0fc7('0x0'));var util=require(_0x0fc7('0x1'));var path=require('path');var timeout=require(_0x0fc7('0x2'));var express=require(_0x0fc7('0x3'));var router=express[_0x0fc7('0x4')]();var fs_extra=require(_0x0fc7('0x5'));var auth=require(_0x0fc7('0x6'));var interaction=require(_0x0fc7('0x7'));var config=require(_0x0fc7('0x8'));var controller=require('./smsQueue.controller');router[_0x0fc7('0x9')]('/',auth[_0x0fc7('0xa')](),controller[_0x0fc7('0xb')]);router['get'](_0x0fc7('0xc'),auth['isAuthenticated'](),controller[_0x0fc7('0xd')]);router[_0x0fc7('0x9')](_0x0fc7('0xe'),auth[_0x0fc7('0xa')](),controller['show']);router[_0x0fc7('0x9')]('/:id/members',auth[_0x0fc7('0xa')](),controller[_0x0fc7('0xf')]);router[_0x0fc7('0x9')](_0x0fc7('0x10'),auth[_0x0fc7('0xa')](),controller[_0x0fc7('0x11')]);router[_0x0fc7('0x9')](_0x0fc7('0x12'),auth[_0x0fc7('0xa')](),controller[_0x0fc7('0x13')]);router[_0x0fc7('0x14')]('/',auth['isAuthenticated'](),controller[_0x0fc7('0x15')]);router[_0x0fc7('0x14')]('/:id/teams',auth[_0x0fc7('0xa')](),controller['addTeams']);router[_0x0fc7('0x14')](_0x0fc7('0x12'),auth['isAuthenticated'](),controller[_0x0fc7('0x16')]);router[_0x0fc7('0x17')](_0x0fc7('0xe'),auth[_0x0fc7('0xa')](),controller[_0x0fc7('0x18')]);router['delete'](_0x0fc7('0xe'),auth[_0x0fc7('0xa')](),controller[_0x0fc7('0x19')]);router[_0x0fc7('0x1a')](_0x0fc7('0x10'),auth[_0x0fc7('0xa')](),controller[_0x0fc7('0x1b')]);router[_0x0fc7('0x1a')](_0x0fc7('0x12'),auth[_0x0fc7('0xa')](),controller[_0x0fc7('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x2847=['isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getAgents','post','create','/:id/users','put','/:id','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get'];(function(_0x1c8cb8,_0x686e09){var _0xff658=function(_0x598cc3){while(--_0x598cc3){_0x1c8cb8['push'](_0x1c8cb8['shift']());}};_0xff658(++_0x686e09);}(_0x2847,0x11f));var _0x7284=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0x2847[_0x57d671];return _0x450dfe;};'use strict';var multer=require(_0x7284('0x0'));var util=require(_0x7284('0x1'));var path=require(_0x7284('0x2'));var timeout=require(_0x7284('0x3'));var express=require(_0x7284('0x4'));var router=express['Router']();var fs_extra=require(_0x7284('0x5'));var auth=require(_0x7284('0x6'));var interaction=require(_0x7284('0x7'));var config=require('../../config/environment');var controller=require(_0x7284('0x8'));router[_0x7284('0x9')]('/',auth[_0x7284('0xa')](),controller[_0x7284('0xb')]);router[_0x7284('0x9')](_0x7284('0xc'),auth['isAuthenticated'](),controller[_0x7284('0xd')]);router[_0x7284('0x9')]('/:id',auth[_0x7284('0xa')](),controller['show']);router['get'](_0x7284('0xe'),auth[_0x7284('0xa')](),controller[_0x7284('0xf')]);router[_0x7284('0x9')](_0x7284('0x10'),auth[_0x7284('0xa')](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7284('0x11')]);router[_0x7284('0x12')]('/',auth[_0x7284('0xa')](),controller[_0x7284('0x13')]);router[_0x7284('0x12')]('/:id/teams',auth[_0x7284('0xa')](),controller['addTeams']);router[_0x7284('0x12')](_0x7284('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7284('0x15')](_0x7284('0x16'),auth[_0x7284('0xa')](),controller[_0x7284('0x17')]);router['delete'](_0x7284('0x16'),auth[_0x7284('0xa')](),controller['destroy']);router[_0x7284('0x18')]('/:id/teams',auth[_0x7284('0xa')](),controller['removeTeams']);router[_0x7284('0x18')](_0x7284('0x14'),auth['isAuthenticated'](),controller[_0x7284('0x19')]);module[_0x7284('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 5569079..aaf5244 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 _0xda88=['exports','STRING','name','roundrobin','sequelize'];(function(_0x33a3dc,_0x47ef76){var _0x52fd55=function(_0xaddde4){while(--_0xaddde4){_0x33a3dc['push'](_0x33a3dc['shift']());}};_0x52fd55(++_0x47ef76);}(_0xda88,0x171));var _0x8da8=function(_0x376bfb,_0x445d09){_0x376bfb=_0x376bfb-0x0;var _0x18b33a=_0xda88[_0x376bfb];return _0x18b33a;};'use strict';var Sequelize=require(_0x8da8('0x0'));module[_0x8da8('0x1')]={'name':{'type':Sequelize[_0x8da8('0x2')],'unique':_0x8da8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8da8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x8da8('0x4'))}}; \ No newline at end of file +var _0x1e92=['sequelize','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x1e92,0xc0));var _0x21e9=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x1e92[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require(_0x21e9('0x0'));module['exports']={'name':{'type':Sequelize[_0x21e9('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x21e9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x21e9('0x3')](_0x21e9('0x4'),'beepall',_0x21e9('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index f24e7ab..d7cb43c 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 _0x94cc=['register','status','end','undefined','limit','count','offset','json','reject','save','update','then','get','destroy','sendStatus','name','index','SmsQueue','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','options','find','create','body','role','user','UserProfileSection','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','getTeams','pick','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Team','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsQueue.socket'];(function(_0x105736,_0x141625){var _0x55178c=function(_0x49bdc9){while(--_0x49bdc9){_0x105736['push'](_0x105736['shift']());}};_0x55178c(++_0x141625);}(_0x94cc,0xf0));var _0xc94c=function(_0xc8eb09,_0x3de36d){_0xc8eb09=_0xc8eb09-0x0;var _0x3931cb=_0x94cc[_0xc8eb09];return _0x3931cb;};'use strict';var emlformat=require(_0xc94c('0x0'));var rimraf=require(_0xc94c('0x1'));var zipdir=require(_0xc94c('0x2'));var jsonpatch=require(_0xc94c('0x3'));var rp=require(_0xc94c('0x4'));var moment=require(_0xc94c('0x5'));var BPromise=require(_0xc94c('0x6'));var Mustache=require('mustache');var util=require(_0xc94c('0x7'));var path=require(_0xc94c('0x8'));var sox=require(_0xc94c('0x9'));var csv=require(_0xc94c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc94c('0xb'));var _=require(_0xc94c('0xc'));var squel=require('squel');var crypto=require(_0xc94c('0xd'));var jsforce=require(_0xc94c('0xe'));var deskjs=require(_0xc94c('0xf'));var toCsv=require(_0xc94c('0xa'));var querystring=require(_0xc94c('0x10'));var Papa=require(_0xc94c('0x11'));var Redis=require('ioredis');var authService=require(_0xc94c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc94c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc94c('0x14'))('api');var utils=require(_0xc94c('0x15'));var config=require(_0xc94c('0x16'));var licenseUtil=require(_0xc94c('0x17'));var db=require(_0xc94c('0x18'))['db'];config[_0xc94c('0x19')]=_[_0xc94c('0x1a')](config[_0xc94c('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc94c('0x1b'))[_0xc94c('0x1c')](socket);function respondWithStatusCode(_0x364e5e,_0x52c3a5){_0x52c3a5=_0x52c3a5||0xcc;return function(_0x3702b2){if(_0x3702b2){return _0x364e5e['sendStatus'](_0x52c3a5);}return _0x364e5e[_0xc94c('0x1d')](_0x52c3a5)[_0xc94c('0x1e')]();};}function respondWithResult(_0xb0816f,_0x20a1ac){_0x20a1ac=_0x20a1ac||0xc8;return function(_0x579e7a){if(_0x579e7a){return _0xb0816f[_0xc94c('0x1d')](_0x20a1ac)['json'](_0x579e7a);}};}function respondWithFilteredResult(_0x4256ba,_0x5a1030){return function(_0x3c75a7){if(_0x3c75a7){var _0x1f61e1=typeof _0x5a1030['offset']===_0xc94c('0x1f')&&typeof _0x5a1030[_0xc94c('0x20')]===_0xc94c('0x1f');var _0x1b8cfb=_0x3c75a7[_0xc94c('0x21')];var _0x21be23=_0x1f61e1?0x0:_0x5a1030[_0xc94c('0x22')];var _0x5c7ced=_0x1f61e1?_0x3c75a7['count']:_0x5a1030['offset']+_0x5a1030[_0xc94c('0x20')];var _0x560c11;if(_0x5c7ced>=_0x1b8cfb){_0x5c7ced=_0x1b8cfb;_0x560c11=0xc8;}else{_0x560c11=0xce;}_0x4256ba[_0xc94c('0x1d')](_0x560c11);return _0x4256ba['set']('Content-Range',_0x21be23+'-'+_0x5c7ced+'/'+_0x1b8cfb)[_0xc94c('0x23')](_0x3c75a7);}return null;};}function patchUpdates(_0x26509a){return function(_0xd90826){try{jsonpatch['apply'](_0xd90826,_0x26509a,!![]);}catch(_0xb39f4b){return BPromise[_0xc94c('0x24')](_0xb39f4b);}return _0xd90826[_0xc94c('0x25')]();};}function saveUpdates(_0x476140,_0x200f0a){return function(_0x38a616){if(_0x38a616){return _0x38a616[_0xc94c('0x26')](_0x476140)[_0xc94c('0x27')](function(_0x592564){return _0x592564;});}return null;};}function removeEntity(_0x4c135b,_0x5af346){return function(_0x50d6c8){if(_0x50d6c8){return _0x50d6c8['destroy']()[_0xc94c('0x27')](function(){var _0x1fcc34=_0x50d6c8[_0xc94c('0x28')]({'plain':!![]});var _0x18a46a='SmsQueues';return db['UserProfileResource'][_0xc94c('0x29')]({'where':{'type':_0x18a46a,'resourceId':_0x1fcc34['id']}})['then'](function(){return _0x50d6c8;});})['then'](function(){_0x4c135b[_0xc94c('0x1d')](0xcc)[_0xc94c('0x1e')]();});}};}function handleEntityNotFound(_0x55eb39,_0x3b255b){return function(_0x25096e){if(!_0x25096e){_0x55eb39[_0xc94c('0x2a')](0x194);}return _0x25096e;};}function handleError(_0x3b050a,_0x1d1028){_0x1d1028=_0x1d1028||0x1f4;return function(_0x22a0e6){logger['error'](_0x22a0e6['stack']);if(_0x22a0e6[_0xc94c('0x2b')]){delete _0x22a0e6['name'];}_0x3b050a[_0xc94c('0x1d')](_0x1d1028)['send'](_0x22a0e6);};}exports[_0xc94c('0x2c')]=function(_0x287b58,_0x552f68){var _0x1c06a9={},_0x4d42df={},_0x35703f={'count':0x0,'rows':[]};var _0x47b85f=_['map'](db[_0xc94c('0x2d')]['rawAttributes'],function(_0x1b6d3c){return{'name':_0x1b6d3c[_0xc94c('0x2e')],'type':_0x1b6d3c[_0xc94c('0x2f')][_0xc94c('0x30')]};});_0x4d42df['model']=_[_0xc94c('0x31')](_0x47b85f,_0xc94c('0x2b'));_0x4d42df[_0xc94c('0x32')]=_['keys'](_0x287b58[_0xc94c('0x32')]);_0x4d42df[_0xc94c('0x33')]=_[_0xc94c('0x34')](_0x4d42df[_0xc94c('0x35')],_0x4d42df[_0xc94c('0x32')]);_0x1c06a9[_0xc94c('0x36')]=_[_0xc94c('0x34')](_0x4d42df[_0xc94c('0x35')],qs[_0xc94c('0x37')](_0x287b58[_0xc94c('0x32')][_0xc94c('0x37')]));_0x1c06a9[_0xc94c('0x36')]=_0x1c06a9[_0xc94c('0x36')][_0xc94c('0x38')]?_0x1c06a9[_0xc94c('0x36')]:_0x4d42df[_0xc94c('0x35')];if(!_0x287b58[_0xc94c('0x32')][_0xc94c('0x39')](_0xc94c('0x3a'))){_0x1c06a9[_0xc94c('0x20')]=qs['limit'](_0x287b58[_0xc94c('0x32')][_0xc94c('0x20')]);_0x1c06a9['offset']=qs[_0xc94c('0x22')](_0x287b58[_0xc94c('0x32')]['offset']);}_0x1c06a9['order']=qs[_0xc94c('0x3b')](_0x287b58['query'][_0xc94c('0x3b')]);_0x1c06a9[_0xc94c('0x3c')]=qs[_0xc94c('0x33')](_['pick'](_0x287b58[_0xc94c('0x32')],_0x4d42df['filters']),_0x47b85f);if(_0x287b58['query'][_0xc94c('0x3d')]){_0x1c06a9[_0xc94c('0x3c')]=_['merge'](_0x1c06a9['where'],{'$or':_[_0xc94c('0x31')](_0x47b85f,function(_0x546e5f){if(_0x546e5f[_0xc94c('0x2f')]!==_0xc94c('0x3e')){var _0x2f5729={};_0x2f5729[_0x546e5f[_0xc94c('0x2b')]]={'$like':'%'+_0x287b58['query'][_0xc94c('0x3d')]+'%'};return _0x2f5729;}})});}_0x1c06a9=_[_0xc94c('0x3f')]({},_0x1c06a9,_0x287b58['options']);var _0x47c29f={'where':_0x1c06a9[_0xc94c('0x3c')]};return db['SmsQueue'][_0xc94c('0x21')](_0x47c29f)[_0xc94c('0x27')](function(_0x2328ed){_0x35703f[_0xc94c('0x21')]=_0x2328ed;if(_0x287b58[_0xc94c('0x32')][_0xc94c('0x40')]){_0x1c06a9[_0xc94c('0x41')]=[{'all':!![]}];}return db['SmsQueue'][_0xc94c('0x42')](_0x1c06a9);})['then'](function(_0x483ce2){_0x35703f[_0xc94c('0x43')]=_0x483ce2;return _0x35703f;})[_0xc94c('0x27')](respondWithFilteredResult(_0x552f68,_0x1c06a9))[_0xc94c('0x44')](handleError(_0x552f68,null));};exports['show']=function(_0x19adaa,_0x439447){var _0x4d41e5={'raw':!![],'where':{'id':_0x19adaa[_0xc94c('0x45')]['id']}},_0x4e2f78={};_0x4e2f78[_0xc94c('0x35')]=_['keys'](db[_0xc94c('0x2d')][_0xc94c('0x46')]);_0x4e2f78['query']=_[_0xc94c('0x47')](_0x19adaa[_0xc94c('0x32')]);_0x4e2f78['filters']=_[_0xc94c('0x34')](_0x4e2f78[_0xc94c('0x35')],_0x4e2f78['query']);_0x4d41e5['attributes']=_[_0xc94c('0x34')](_0x4e2f78[_0xc94c('0x35')],qs[_0xc94c('0x37')](_0x19adaa[_0xc94c('0x32')][_0xc94c('0x37')]));_0x4d41e5[_0xc94c('0x36')]=_0x4d41e5[_0xc94c('0x36')][_0xc94c('0x38')]?_0x4d41e5['attributes']:_0x4e2f78['model'];if(_0x19adaa[_0xc94c('0x32')][_0xc94c('0x40')]){_0x4d41e5[_0xc94c('0x41')]=[{'all':!![]}];}_0x4d41e5=_[_0xc94c('0x3f')]({},_0x4d41e5,_0x19adaa[_0xc94c('0x48')]);return db[_0xc94c('0x2d')][_0xc94c('0x49')](_0x4d41e5)[_0xc94c('0x27')](handleEntityNotFound(_0x439447,null))[_0xc94c('0x27')](respondWithResult(_0x439447,null))[_0xc94c('0x44')](handleError(_0x439447,null));};exports[_0xc94c('0x4a')]=function(_0x143b18,_0x18238d){return db[_0xc94c('0x2d')][_0xc94c('0x4a')](_0x143b18[_0xc94c('0x4b')],{})['then'](function(_0x4c81a9){var _0xa0d917=_0x143b18['user'][_0xc94c('0x28')]({'plain':!![]});if(!_0xa0d917)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa0d917[_0xc94c('0x4c')]===_0xc94c('0x4d')){var _0x23daa7=_0x4c81a9[_0xc94c('0x28')]({'plain':!![]});var _0x201449='SmsQueues';return db[_0xc94c('0x4e')][_0xc94c('0x49')]({'where':{'name':_0x201449,'userProfileId':_0xa0d917['userProfileId']},'raw':!![]})['then'](function(_0x3ad187){if(_0x3ad187&&_0x3ad187['autoAssociation']===0x0){return db[_0xc94c('0x4f')][_0xc94c('0x4a')]({'name':_0x23daa7['name'],'resourceId':_0x23daa7['id'],'type':_0x3ad187['name'],'sectionId':_0x3ad187['id']},{})[_0xc94c('0x27')](function(){return _0x4c81a9;});}else{return _0x4c81a9;}})[_0xc94c('0x44')](function(_0x10fe20){logger[_0xc94c('0x50')](_0xc94c('0x51'),_0x10fe20);throw _0x10fe20;});}return _0x4c81a9;})[_0xc94c('0x27')](respondWithResult(_0x18238d,0xc9))[_0xc94c('0x44')](handleError(_0x18238d,null));};exports[_0xc94c('0x26')]=function(_0x33dede,_0x21e3c3){if(_0x33dede['body']['id']){delete _0x33dede[_0xc94c('0x4b')]['id'];}return db['SmsQueue'][_0xc94c('0x49')]({'where':{'id':_0x33dede[_0xc94c('0x45')]['id']}})[_0xc94c('0x27')](handleEntityNotFound(_0x21e3c3,null))[_0xc94c('0x27')](saveUpdates(_0x33dede[_0xc94c('0x4b')],null))[_0xc94c('0x27')](respondWithResult(_0x21e3c3,null))[_0xc94c('0x44')](handleError(_0x21e3c3,null));};exports[_0xc94c('0x29')]=function(_0x4421a2,_0x55a98b){return db[_0xc94c('0x2d')][_0xc94c('0x49')]({'where':{'id':_0x4421a2['params']['id']}})[_0xc94c('0x27')](handleEntityNotFound(_0x55a98b,null))[_0xc94c('0x27')](removeEntity(_0x55a98b,null))[_0xc94c('0x44')](handleError(_0x55a98b,null));};exports[_0xc94c('0x52')]=function(_0x8dad98,_0x40cd14){return db[_0xc94c('0x2d')]['describe']()[_0xc94c('0x27')](respondWithResult(_0x40cd14,null))[_0xc94c('0x44')](handleError(_0x40cd14,null));};exports[_0xc94c('0x53')]=function(_0x490dd0,_0x43fc23,_0x523ce5){var _0x53d17c={'raw':!![],'where':{}},_0x44f235={},_0x107d71;return db[_0xc94c('0x2d')][_0xc94c('0x54')]({'where':{'id':_0x490dd0[_0xc94c('0x45')]['id']}})[_0xc94c('0x27')](handleEntityNotFound(_0x43fc23,null))[_0xc94c('0x27')](function(_0x2d8350){if(_0x2d8350){_0x107d71=_0x2d8350['get']({'plain':!![]});_0x44f235['model']=_['keys'](db[_0xc94c('0x55')][_0xc94c('0x46')]);_0x44f235[_0xc94c('0x32')]=_[_0xc94c('0x47')](_0x490dd0[_0xc94c('0x32')]);_0x44f235[_0xc94c('0x33')]=_[_0xc94c('0x34')](_0x44f235['model'],_0x44f235['query']);_0x53d17c[_0xc94c('0x36')]=_[_0xc94c('0x34')](_0x44f235['model'],qs[_0xc94c('0x37')](_0x490dd0['query'][_0xc94c('0x37')]));_0x53d17c[_0xc94c('0x36')]=_0x53d17c['attributes']['length']?_0x53d17c['attributes']:_0x44f235['model'];if(!_0x490dd0['query'][_0xc94c('0x39')](_0xc94c('0x3a'))){_0x53d17c[_0xc94c('0x20')]=qs[_0xc94c('0x20')](_0x490dd0[_0xc94c('0x32')][_0xc94c('0x20')]);_0x53d17c[_0xc94c('0x22')]=qs[_0xc94c('0x22')](_0x490dd0[_0xc94c('0x32')][_0xc94c('0x22')]);}_0x53d17c[_0xc94c('0x56')]=qs['sort'](_0x490dd0[_0xc94c('0x32')]['sort']);_0x53d17c[_0xc94c('0x3c')]=qs[_0xc94c('0x33')](_['pick'](_0x490dd0[_0xc94c('0x32')],_0x44f235[_0xc94c('0x33')]));_0x53d17c[_0xc94c('0x3c')][_0xc94c('0x57')]=_0x2d8350['id'];if(_0x490dd0['query'][_0xc94c('0x3d')]){_0x53d17c[_0xc94c('0x3c')]=_['merge'](_0x53d17c[_0xc94c('0x3c')],{'$or':_['map'](_0x53d17c[_0xc94c('0x36')],function(_0x59db4e){var _0x26fd54={};_0x26fd54[_0x59db4e]={'$like':'%'+_0x490dd0[_0xc94c('0x32')]['filter']+'%'};return _0x26fd54;})});}_0x53d17c=_[_0xc94c('0x3f')]({},_0x53d17c,_0x490dd0[_0xc94c('0x48')]);return db[_0xc94c('0x55')][_0xc94c('0x42')](_0x53d17c);}})['then'](function(_0xafa847){if(_0xafa847){return db[_0xc94c('0x58')][_0xc94c('0x59')]({'where':{'id':_[_0xc94c('0x31')](_0xafa847,_0xc94c('0x5a')),'role':_0xc94c('0x5b')},'attributes':['id','name',_0xc94c('0x5c'),_0xc94c('0x5d'),_0xc94c('0x5e')]});}})[_0xc94c('0x27')](function(_0x463de4){if(_0x463de4){return{'count':_0x463de4[_0xc94c('0x21')],'rows':_[_0xc94c('0x31')](_0x463de4[_0xc94c('0x43')],function(_0x105f3b){return{'membername':_0x105f3b[_0xc94c('0x2b')],'UserId':_0x105f3b['id'],'queue_name':_0x107d71[_0xc94c('0x2b')],'SmsQueueId':_0x107d71['id'],'interface':util['format'](_0xc94c('0x5f'),'SIP',_0x105f3b[_0xc94c('0x2b')]),'penalty':0x0,'paused':_0x105f3b[_0xc94c('0x5c')],'createdAt':_0x105f3b[_0xc94c('0x5e')],'updatedAt':_0x105f3b[_0xc94c('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc94c('0x27')](respondWithFilteredResult(_0x43fc23,_0x53d17c))['catch'](handleError(_0x43fc23,null));};exports[_0xc94c('0x60')]=function(_0x24c46f,_0x40b87e,_0x1029b8){var _0x376b3b={};var _0x33084b={};var _0x5612b0;var _0x3c8e7e;return db[_0xc94c('0x2d')][_0xc94c('0x54')]({'where':{'id':_0x24c46f[_0xc94c('0x45')]['id']}})[_0xc94c('0x27')](handleEntityNotFound(_0x40b87e,null))[_0xc94c('0x27')](function(_0x2ee1e3){if(_0x2ee1e3){_0x5612b0=_0x2ee1e3;_0x33084b[_0xc94c('0x35')]=_[_0xc94c('0x47')](db['Team']['rawAttributes']);_0x33084b[_0xc94c('0x32')]=_[_0xc94c('0x47')](_0x24c46f[_0xc94c('0x32')]);_0x33084b[_0xc94c('0x33')]=_[_0xc94c('0x34')](_0x33084b[_0xc94c('0x35')],_0x33084b['query']);_0x376b3b['attributes']=_[_0xc94c('0x34')](_0x33084b[_0xc94c('0x35')],qs[_0xc94c('0x37')](_0x24c46f[_0xc94c('0x32')][_0xc94c('0x37')]));_0x376b3b['attributes']=_0x376b3b[_0xc94c('0x36')][_0xc94c('0x38')]?_0x376b3b[_0xc94c('0x36')]:_0x33084b[_0xc94c('0x35')];_0x376b3b[_0xc94c('0x56')]=qs['sort'](_0x24c46f[_0xc94c('0x32')][_0xc94c('0x3b')]);_0x376b3b[_0xc94c('0x3c')]=qs['filters'](_[_0xc94c('0x61')](_0x24c46f[_0xc94c('0x32')],_0x33084b[_0xc94c('0x33')]));if(_0x24c46f[_0xc94c('0x32')]['filter']){_0x376b3b['where']=_['merge'](_0x376b3b[_0xc94c('0x3c')],{'$or':_[_0xc94c('0x31')](_0x376b3b[_0xc94c('0x36')],function(_0x4e19a6){var _0x354df6={};_0x354df6[_0x4e19a6]={'$like':'%'+_0x24c46f[_0xc94c('0x32')][_0xc94c('0x3d')]+'%'};return _0x354df6;})});}_0x376b3b=_[_0xc94c('0x3f')]({},_0x376b3b,_0x24c46f[_0xc94c('0x48')]);return _0x5612b0['getTeams'](_0x376b3b);}})[_0xc94c('0x27')](function(_0x45016b){if(_0x45016b){_0x3c8e7e=_0x45016b[_0xc94c('0x38')];if(!_0x24c46f['query']['hasOwnProperty'](_0xc94c('0x3a'))){_0x376b3b[_0xc94c('0x20')]=qs[_0xc94c('0x20')](_0x24c46f[_0xc94c('0x32')][_0xc94c('0x20')]);_0x376b3b['offset']=qs['offset'](_0x24c46f[_0xc94c('0x32')]['offset']);}return _0x5612b0[_0xc94c('0x60')](_0x376b3b);}})[_0xc94c('0x27')](function(_0x5e5f5a){if(_0x5e5f5a){return _0x5e5f5a?{'count':_0x3c8e7e,'rows':_0x5e5f5a}:null;}})[_0xc94c('0x27')](respondWithResult(_0x40b87e,null))[_0xc94c('0x44')](handleError(_0x40b87e,null));};exports['addTeams']=function(_0x318dcc,_0x2123c4,_0x126f95){var _0x4d96e5=_0x318dcc[_0xc94c('0x4b')][_0xc94c('0x62')];return db['Team'][_0xc94c('0x42')]({'where':{'id':_0x4d96e5},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc94c('0x63'),'attributes':['id',_0xc94c('0x2b'),'online',_0xc94c('0x64'),_0xc94c('0x65')],'raw':!![]}]})['then'](function(_0x13860e){if(_0x13860e){var _0x2a6c52=_[_0xc94c('0x66')](_0x13860e,function(_0x487e86){var _0x21a1c2=_0x487e86['get']({'plain':!![]});return _0x21a1c2[_0xc94c('0x63')];});return db[_0xc94c('0x2d')]['find']({'where':{'id':_0x318dcc[_0xc94c('0x45')]['id']}})[_0xc94c('0x27')](function(_0x4d9d25){return db[_0xc94c('0x67')][_0xc94c('0x68')](function(_0x4c0a44){return _0x4d9d25['addTeams'](_0x4d96e5,{'transaction':_0x4c0a44})[_0xc94c('0x27')](function(){return BPromise['each'](_0x2a6c52,function(_0x586f9d){return db[_0xc94c('0x55')][_0xc94c('0x69')]({'where':{'UserId':_0x586f9d['id'],'SmsQueueId':_0x318dcc['params']['id']},'transaction':_0x4c0a44});});})[_0xc94c('0x27')](function(){_0x2a6c52[_0xc94c('0x6a')](function(_0x2ad864){socket[_0xc94c('0x6b')](_0xc94c('0x6c'),{'UserId':_0x2ad864['id'],'SmsQueueId':_0x4d9d25['id']});});});});});}})[_0xc94c('0x27')](respondWithStatusCode(_0x2123c4,null))[_0xc94c('0x44')](handleError(_0x2123c4,null));};exports[_0xc94c('0x6d')]=function(_0x1db54e,_0x53543c,_0x22bb3f){return db[_0xc94c('0x6e')]['findAll']({'where':{'id':_0x1db54e[_0xc94c('0x32')][_0xc94c('0x62')]},'attributes':['id'],'include':[{'model':db[_0xc94c('0x58')],'as':_0xc94c('0x63'),'attributes':['id'],'raw':!![]}]})[_0xc94c('0x27')](handleEntityNotFound(_0x53543c,null))['then'](function(_0x51b37d){var _0x3c9b7a=_['map'](_0x51b37d,'id');var _0x1aedda=[];var _0x12014d=[];var _0x267b6f=squel[_0xc94c('0x6f')]();_0x267b6f[_0xc94c('0x70')](_0xc94c('0x71'))['from'](_0xc94c('0x72'),'tq')[_0xc94c('0x73')](_0xc94c('0x74'),'ut',_0xc94c('0x75'))['where'](_0xc94c('0x76'),_0x1db54e[_0xc94c('0x45')]['id']);for(var _0x556f9c=0x0;_0x556f9c<_0x51b37d[_0xc94c('0x38')];_0x556f9c+=0x1){let _0xf39ae=_0x51b37d[_0x556f9c];for(var _0x102c29=0x0;_0x102c29<_0xf39ae[_0xc94c('0x63')][_0xc94c('0x38')];_0x102c29+=0x1){let _0xc6188f=_0xf39ae['Agents'][_0x102c29];var _0x475c6a=_0x267b6f['clone']();_0x475c6a['where'](_0xc94c('0x77'),_0xc6188f['id']);_0x12014d[_0xc94c('0x78')](db['sequelize']['query'](_0x475c6a[_0xc94c('0x79')](),{'type':db[_0xc94c('0x67')][_0xc94c('0x7a')]['SELECT']})[_0xc94c('0x27')](function(_0x4cec79){if(_0x4cec79[_0xc94c('0x38')]===0x1){return _0xc6188f['id'];}else{var _0x13fc51=_[_0xc94c('0x7b')](_['map'](_0x4cec79,'TeamId'),function(_0x2c91ba){return _[_0xc94c('0x7c')](_0x3c9b7a,_0x2c91ba);});if(_0x13fc51){return _0xc6188f['id'];}}}));}}return BPromise['all'](_0x12014d)[_0xc94c('0x27')](function(_0x328f7d){_0x1aedda=_(_0x1aedda)['union'](_0x328f7d)[_0xc94c('0x7d')]()[_0xc94c('0x7e')]();return db[_0xc94c('0x2d')][_0xc94c('0x49')]({'where':{'id':_0x1db54e[_0xc94c('0x45')]['id']}})['then'](function(_0x5aa3f3){return db[_0xc94c('0x67')]['transaction'](function(_0x4040c4){return _0x5aa3f3[_0xc94c('0x6d')](_0x1db54e['query'][_0xc94c('0x62')],{'transaction':_0x4040c4})[_0xc94c('0x27')](function(){if(!_[_0xc94c('0x7f')](_0x1aedda)){return _0x5aa3f3[_0xc94c('0x80')](_0x1aedda,{'transaction':_0x4040c4});}})[_0xc94c('0x27')](function(){_0x1aedda[_0xc94c('0x6a')](function(_0x45e6e7){socket[_0xc94c('0x6b')](_0xc94c('0x81'),{'UserId':_0x45e6e7,'SmsQueueId':_0x5aa3f3['id']});});});});});});})[_0xc94c('0x27')](respondWithStatusCode(_0x53543c,null))[_0xc94c('0x44')](handleError(_0x53543c,null));};exports[_0xc94c('0x82')]=function(_0x5d97c8,_0x8bd7c2,_0xaa4fa2){return db[_0xc94c('0x2d')]['find']({'where':{'id':_0x5d97c8[_0xc94c('0x45')]['id']}})[_0xc94c('0x27')](handleEntityNotFound(_0x8bd7c2,null))[_0xc94c('0x27')](function(_0x2254e4){if(_0x2254e4){return _0x2254e4['addAgents'](_0x5d97c8[_0xc94c('0x4b')][_0xc94c('0x62')],_['omit'](_0x5d97c8[_0xc94c('0x4b')],[_0xc94c('0x62'),'id'])||{})[_0xc94c('0x83')](function(_0x9c8113){for(var _0x3290b7=0x0;_0x3290b7<_0x5d97c8[_0xc94c('0x4b')][_0xc94c('0x62')][_0xc94c('0x38')];_0x3290b7+=0x1){socket[_0xc94c('0x6b')](_0xc94c('0x6c'),{'UserId':Number(_0x5d97c8[_0xc94c('0x4b')][_0xc94c('0x62')][_0x3290b7]),'SmsQueueId':Number(_0x5d97c8[_0xc94c('0x45')]['id'])});}return _0x9c8113;});}})[_0xc94c('0x27')](respondWithResult(_0x8bd7c2,null))[_0xc94c('0x44')](handleError(_0x8bd7c2,null));};exports[_0xc94c('0x80')]=function(_0x372686,_0x384f67,_0x54961b){return db[_0xc94c('0x2d')][_0xc94c('0x49')]({'where':{'id':_0x372686[_0xc94c('0x45')]['id']}})[_0xc94c('0x27')](handleEntityNotFound(_0x384f67,null))['then'](function(_0x564df2){if(_0x564df2){return _0x564df2['removeAgents'](_0x372686[_0xc94c('0x32')][_0xc94c('0x62')])[_0xc94c('0x27')](function(){if(_[_0xc94c('0x84')](_0x372686[_0xc94c('0x32')][_0xc94c('0x62')])){for(var _0x525f30=0x0;_0x525f30<_0x372686[_0xc94c('0x32')][_0xc94c('0x62')]['length'];_0x525f30+=0x1){socket[_0xc94c('0x6b')]('userSmsQueue:remove',{'UserId':Number(_0x372686['query'][_0xc94c('0x62')][_0x525f30]),'SmsQueueId':Number(_0x372686['params']['id'])});}}else{socket[_0xc94c('0x6b')]('userSmsQueue:remove',{'UserId':Number(_0x372686[_0xc94c('0x32')][_0xc94c('0x62')]),'SmsQueueId':Number(_0x372686['params']['id'])});}});}})[_0xc94c('0x27')](respondWithStatusCode(_0x384f67,null))[_0xc94c('0x44')](handleError(_0x384f67,null));};exports[_0xc94c('0x85')]=function(_0x4ae777,_0x4523b9,_0x2a7711){var _0x32a57f={};var _0xcd6ea9={};var _0x275ac6;var _0x1e9685;return db[_0xc94c('0x2d')][_0xc94c('0x54')]({'where':{'id':_0x4ae777[_0xc94c('0x45')]['id']}})[_0xc94c('0x27')](handleEntityNotFound(_0x4523b9,null))[_0xc94c('0x27')](function(_0x362f63){if(_0x362f63){_0x275ac6=_0x362f63;_0xcd6ea9[_0xc94c('0x35')]=_[_0xc94c('0x47')](db[_0xc94c('0x58')][_0xc94c('0x46')]);_0xcd6ea9['query']=_[_0xc94c('0x47')](_0x4ae777[_0xc94c('0x32')]);_0xcd6ea9[_0xc94c('0x33')]=_['intersection'](_0xcd6ea9[_0xc94c('0x35')],_0xcd6ea9[_0xc94c('0x32')]);_0x32a57f[_0xc94c('0x36')]=_[_0xc94c('0x34')](_0xcd6ea9[_0xc94c('0x35')],qs[_0xc94c('0x37')](_0x4ae777['query'][_0xc94c('0x37')]));_0x32a57f[_0xc94c('0x36')]=_0x32a57f['attributes'][_0xc94c('0x38')]?_0x32a57f['attributes']:_0xcd6ea9[_0xc94c('0x35')];_0x32a57f['order']=qs[_0xc94c('0x3b')](_0x4ae777[_0xc94c('0x32')][_0xc94c('0x3b')]);_0x32a57f[_0xc94c('0x3c')]=qs['filters'](_['pick'](_0x4ae777['query'],_0xcd6ea9[_0xc94c('0x33')]));if(_0x4ae777[_0xc94c('0x32')][_0xc94c('0x3d')]){_0x32a57f[_0xc94c('0x3c')]=_['merge'](_0x32a57f[_0xc94c('0x3c')],{'$or':_['map'](_0x32a57f[_0xc94c('0x36')],function(_0x394db4){var _0x31a6d6={};_0x31a6d6[_0x394db4]={'$like':'%'+_0x4ae777[_0xc94c('0x32')][_0xc94c('0x3d')]+'%'};return _0x31a6d6;})});}_0x32a57f=_['merge']({},_0x32a57f,_0x4ae777[_0xc94c('0x48')]);return _0x275ac6[_0xc94c('0x85')](_0x32a57f);}})[_0xc94c('0x27')](function(_0x23b87d){if(_0x23b87d){_0x1e9685=_0x23b87d['length'];if(!_0x4ae777[_0xc94c('0x32')][_0xc94c('0x39')](_0xc94c('0x3a'))){_0x32a57f[_0xc94c('0x20')]=qs[_0xc94c('0x20')](_0x4ae777[_0xc94c('0x32')][_0xc94c('0x20')]);_0x32a57f['offset']=qs[_0xc94c('0x22')](_0x4ae777[_0xc94c('0x32')]['offset']);}return _0x275ac6[_0xc94c('0x85')](_0x32a57f);}})[_0xc94c('0x27')](function(_0x373d51){if(_0x373d51){return _0x373d51?{'count':_0x1e9685,'rows':_0x373d51}:null;}})['then'](respondWithResult(_0x4523b9,null))[_0xc94c('0x44')](handleError(_0x4523b9,null));}; \ No newline at end of file +var _0xed9b=['merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','SmsQueueId','options','UserSmsQueue','User','UserId','updatedAt','%s/%s','smsPause','createdAt','getTeams','findOne','Team','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','emit','addAgents','spread','userSmsQueue:remove','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x5688b4,_0x1f3004){var _0xedbb0d=function(_0x2a8794){while(--_0x2a8794){_0x5688b4['push'](_0x5688b4['shift']());}};_0xedbb0d(++_0x1f3004);}(_0xed9b,0xd2));var _0xbed9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xed9b[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbed9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbed9('0x1'));var moment=require(_0xbed9('0x2'));var BPromise=require(_0xbed9('0x3'));var Mustache=require(_0xbed9('0x4'));var util=require(_0xbed9('0x5'));var path=require(_0xbed9('0x6'));var sox=require(_0xbed9('0x7'));var csv=require(_0xbed9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbed9('0x9'));var _=require(_0xbed9('0xa'));var squel=require('squel');var crypto=require(_0xbed9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbed9('0xc'));var toCsv=require(_0xbed9('0x8'));var querystring=require(_0xbed9('0xd'));var Papa=require(_0xbed9('0xe'));var Redis=require(_0xbed9('0xf'));var authService=require(_0xbed9('0x10'));var qs=require(_0xbed9('0x11'));var as=require(_0xbed9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbed9('0x13'));var utils=require(_0xbed9('0x14'));var config=require(_0xbed9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbed9('0x16'))['db'];config[_0xbed9('0x17')]=_[_0xbed9('0x18')](config[_0xbed9('0x17')],{'host':_0xbed9('0x19'),'port':0x18eb});var socket=require(_0xbed9('0x1a'))(new Redis(config[_0xbed9('0x17')]));require(_0xbed9('0x1b'))[_0xbed9('0x1c')](socket);function respondWithStatusCode(_0xacc19e,_0x22a338){_0x22a338=_0x22a338||0xcc;return function(_0x396383){if(_0x396383){return _0xacc19e[_0xbed9('0x1d')](_0x22a338);}return _0xacc19e[_0xbed9('0x1e')](_0x22a338)[_0xbed9('0x1f')]();};}function respondWithResult(_0x2c18ab,_0x2b4a08){_0x2b4a08=_0x2b4a08||0xc8;return function(_0x297ca1){if(_0x297ca1){return _0x2c18ab['status'](_0x2b4a08)[_0xbed9('0x20')](_0x297ca1);}};}function respondWithFilteredResult(_0xc0fb44,_0x414040){return function(_0x3486be){if(_0x3486be){var _0x1f6e81=typeof _0x414040[_0xbed9('0x21')]===_0xbed9('0x22')&&typeof _0x414040[_0xbed9('0x23')]===_0xbed9('0x22');var _0x2c071f=_0x3486be[_0xbed9('0x24')];var _0x1e5773=_0x1f6e81?0x0:_0x414040[_0xbed9('0x21')];var _0x35dcd1=_0x1f6e81?_0x3486be[_0xbed9('0x24')]:_0x414040['offset']+_0x414040[_0xbed9('0x23')];var _0x14532b;if(_0x35dcd1>=_0x2c071f){_0x35dcd1=_0x2c071f;_0x14532b=0xc8;}else{_0x14532b=0xce;}_0xc0fb44[_0xbed9('0x1e')](_0x14532b);return _0xc0fb44[_0xbed9('0x25')](_0xbed9('0x26'),_0x1e5773+'-'+_0x35dcd1+'/'+_0x2c071f)[_0xbed9('0x20')](_0x3486be);}return null;};}function patchUpdates(_0xc43b66){return function(_0x74fa4b){try{jsonpatch[_0xbed9('0x27')](_0x74fa4b,_0xc43b66,!![]);}catch(_0x3512e1){return BPromise['reject'](_0x3512e1);}return _0x74fa4b[_0xbed9('0x28')]();};}function saveUpdates(_0x35cdbd,_0x4a71fa){return function(_0x4999d9){if(_0x4999d9){return _0x4999d9[_0xbed9('0x29')](_0x35cdbd)[_0xbed9('0x2a')](function(_0x4a460f){return _0x4a460f;});}return null;};}function removeEntity(_0x468d61,_0x4bdf39){return function(_0x5aaf3b){if(_0x5aaf3b){return _0x5aaf3b['destroy']()[_0xbed9('0x2a')](function(){var _0x5a56b0=_0x5aaf3b[_0xbed9('0x2b')]({'plain':!![]});var _0x472229=_0xbed9('0x2c');return db[_0xbed9('0x2d')][_0xbed9('0x2e')]({'where':{'type':_0x472229,'resourceId':_0x5a56b0['id']}})[_0xbed9('0x2a')](function(){return _0x5aaf3b;});})[_0xbed9('0x2a')](function(){_0x468d61['status'](0xcc)[_0xbed9('0x1f')]();});}};}function handleEntityNotFound(_0x2a7aff,_0x31d7a6){return function(_0x1b7c9d){if(!_0x1b7c9d){_0x2a7aff[_0xbed9('0x1d')](0x194);}return _0x1b7c9d;};}function handleError(_0x5f33a1,_0x3da174){_0x3da174=_0x3da174||0x1f4;return function(_0x28b17d){logger[_0xbed9('0x2f')](_0x28b17d[_0xbed9('0x30')]);if(_0x28b17d['name']){delete _0x28b17d['name'];}_0x5f33a1['status'](_0x3da174)[_0xbed9('0x31')](_0x28b17d);};}exports[_0xbed9('0x32')]=function(_0x32a420,_0x3cb47d){var _0x41ce7b={},_0x38ac83={},_0x272dcf={'count':0x0,'rows':[]};var _0x69403c=_[_0xbed9('0x33')](db[_0xbed9('0x34')][_0xbed9('0x35')],function(_0x5a9930){return{'name':_0x5a9930[_0xbed9('0x36')],'type':_0x5a9930[_0xbed9('0x37')][_0xbed9('0x38')]};});_0x38ac83[_0xbed9('0x39')]=_[_0xbed9('0x33')](_0x69403c,_0xbed9('0x3a'));_0x38ac83[_0xbed9('0x3b')]=_[_0xbed9('0x3c')](_0x32a420[_0xbed9('0x3b')]);_0x38ac83[_0xbed9('0x3d')]=_[_0xbed9('0x3e')](_0x38ac83[_0xbed9('0x39')],_0x38ac83[_0xbed9('0x3b')]);_0x41ce7b[_0xbed9('0x3f')]=_[_0xbed9('0x3e')](_0x38ac83['model'],qs['fields'](_0x32a420[_0xbed9('0x3b')][_0xbed9('0x40')]));_0x41ce7b['attributes']=_0x41ce7b['attributes'][_0xbed9('0x41')]?_0x41ce7b[_0xbed9('0x3f')]:_0x38ac83[_0xbed9('0x39')];if(!_0x32a420[_0xbed9('0x3b')][_0xbed9('0x42')]('nolimit')){_0x41ce7b[_0xbed9('0x23')]=qs['limit'](_0x32a420[_0xbed9('0x3b')][_0xbed9('0x23')]);_0x41ce7b[_0xbed9('0x21')]=qs[_0xbed9('0x21')](_0x32a420[_0xbed9('0x3b')]['offset']);}_0x41ce7b[_0xbed9('0x43')]=qs[_0xbed9('0x44')](_0x32a420[_0xbed9('0x3b')][_0xbed9('0x44')]);_0x41ce7b[_0xbed9('0x45')]=qs[_0xbed9('0x3d')](_[_0xbed9('0x46')](_0x32a420['query'],_0x38ac83['filters']),_0x69403c);if(_0x32a420[_0xbed9('0x3b')][_0xbed9('0x47')]){_0x41ce7b[_0xbed9('0x45')]=_[_0xbed9('0x48')](_0x41ce7b[_0xbed9('0x45')],{'$or':_[_0xbed9('0x33')](_0x69403c,function(_0x3bb351){if(_0x3bb351[_0xbed9('0x37')]!==_0xbed9('0x49')){var _0x35e31e={};_0x35e31e[_0x3bb351[_0xbed9('0x3a')]]={'$like':'%'+_0x32a420[_0xbed9('0x3b')][_0xbed9('0x47')]+'%'};return _0x35e31e;}})});}_0x41ce7b=_[_0xbed9('0x48')]({},_0x41ce7b,_0x32a420['options']);var _0x1d5fbc={'where':_0x41ce7b[_0xbed9('0x45')]};return db[_0xbed9('0x34')][_0xbed9('0x24')](_0x1d5fbc)[_0xbed9('0x2a')](function(_0x59d873){_0x272dcf[_0xbed9('0x24')]=_0x59d873;if(_0x32a420[_0xbed9('0x3b')]['includeAll']){_0x41ce7b[_0xbed9('0x4a')]=[{'all':!![]}];}return db[_0xbed9('0x34')][_0xbed9('0x4b')](_0x41ce7b);})[_0xbed9('0x2a')](function(_0x3c4cff){_0x272dcf[_0xbed9('0x4c')]=_0x3c4cff;return _0x272dcf;})['then'](respondWithFilteredResult(_0x3cb47d,_0x41ce7b))[_0xbed9('0x4d')](handleError(_0x3cb47d,null));};exports[_0xbed9('0x4e')]=function(_0x39a9ed,_0x57f72d){var _0x757af4={'raw':!![],'where':{'id':_0x39a9ed[_0xbed9('0x4f')]['id']}},_0x2e5d1d={};_0x2e5d1d[_0xbed9('0x39')]=_['keys'](db[_0xbed9('0x34')][_0xbed9('0x35')]);_0x2e5d1d['query']=_[_0xbed9('0x3c')](_0x39a9ed[_0xbed9('0x3b')]);_0x2e5d1d[_0xbed9('0x3d')]=_['intersection'](_0x2e5d1d[_0xbed9('0x39')],_0x2e5d1d[_0xbed9('0x3b')]);_0x757af4[_0xbed9('0x3f')]=_['intersection'](_0x2e5d1d[_0xbed9('0x39')],qs[_0xbed9('0x40')](_0x39a9ed[_0xbed9('0x3b')][_0xbed9('0x40')]));_0x757af4[_0xbed9('0x3f')]=_0x757af4[_0xbed9('0x3f')]['length']?_0x757af4[_0xbed9('0x3f')]:_0x2e5d1d[_0xbed9('0x39')];if(_0x39a9ed['query'][_0xbed9('0x50')]){_0x757af4[_0xbed9('0x4a')]=[{'all':!![]}];}_0x757af4=_[_0xbed9('0x48')]({},_0x757af4,_0x39a9ed['options']);return db[_0xbed9('0x34')]['find'](_0x757af4)['then'](handleEntityNotFound(_0x57f72d,null))[_0xbed9('0x2a')](respondWithResult(_0x57f72d,null))[_0xbed9('0x4d')](handleError(_0x57f72d,null));};exports[_0xbed9('0x51')]=function(_0x52b025,_0x1147fc){return db[_0xbed9('0x34')][_0xbed9('0x51')](_0x52b025[_0xbed9('0x52')],{})[_0xbed9('0x2a')](function(_0x5d82ff){var _0x13be5f=_0x52b025['user']['get']({'plain':!![]});if(!_0x13be5f)throw new Error(_0xbed9('0x53'));if(_0x13be5f[_0xbed9('0x54')]===_0xbed9('0x55')){var _0x3ab97f=_0x5d82ff[_0xbed9('0x2b')]({'plain':!![]});var _0x41f2a8=_0xbed9('0x2c');return db['UserProfileSection'][_0xbed9('0x56')]({'where':{'name':_0x41f2a8,'userProfileId':_0x13be5f[_0xbed9('0x57')]},'raw':!![]})[_0xbed9('0x2a')](function(_0x4a1d4c){if(_0x4a1d4c&&_0x4a1d4c[_0xbed9('0x58')]===0x0){return db['UserProfileResource'][_0xbed9('0x51')]({'name':_0x3ab97f[_0xbed9('0x3a')],'resourceId':_0x3ab97f['id'],'type':_0x4a1d4c[_0xbed9('0x3a')],'sectionId':_0x4a1d4c['id']},{})[_0xbed9('0x2a')](function(){return _0x5d82ff;});}else{return _0x5d82ff;}})[_0xbed9('0x4d')](function(_0x51d936){logger[_0xbed9('0x2f')](_0xbed9('0x59'),_0x51d936);throw _0x51d936;});}return _0x5d82ff;})['then'](respondWithResult(_0x1147fc,0xc9))[_0xbed9('0x4d')](handleError(_0x1147fc,null));};exports[_0xbed9('0x29')]=function(_0x3e0bb6,_0x481c0e){if(_0x3e0bb6['body']['id']){delete _0x3e0bb6[_0xbed9('0x52')]['id'];}return db['SmsQueue'][_0xbed9('0x56')]({'where':{'id':_0x3e0bb6[_0xbed9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x481c0e,null))[_0xbed9('0x2a')](saveUpdates(_0x3e0bb6['body'],null))[_0xbed9('0x2a')](respondWithResult(_0x481c0e,null))[_0xbed9('0x4d')](handleError(_0x481c0e,null));};exports[_0xbed9('0x2e')]=function(_0x2462ef,_0x49fd60){return db['SmsQueue'][_0xbed9('0x56')]({'where':{'id':_0x2462ef[_0xbed9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49fd60,null))[_0xbed9('0x2a')](removeEntity(_0x49fd60,null))[_0xbed9('0x4d')](handleError(_0x49fd60,null));};exports[_0xbed9('0x5a')]=function(_0x250731,_0x4a8e04){return db[_0xbed9('0x34')]['describe']()[_0xbed9('0x2a')](respondWithResult(_0x4a8e04,null))[_0xbed9('0x4d')](handleError(_0x4a8e04,null));};exports[_0xbed9('0x5b')]=function(_0x3ce1e3,_0xff70a,_0x1e0032){var _0x1fc9b6={'raw':!![],'where':{}},_0x26e2ab={},_0x3ba4e2;return db['SmsQueue']['findOne']({'where':{'id':_0x3ce1e3['params']['id']}})[_0xbed9('0x2a')](handleEntityNotFound(_0xff70a,null))[_0xbed9('0x2a')](function(_0x445252){if(_0x445252){_0x3ba4e2=_0x445252['get']({'plain':!![]});_0x26e2ab[_0xbed9('0x39')]=_['keys'](db['UserSmsQueue'][_0xbed9('0x35')]);_0x26e2ab[_0xbed9('0x3b')]=_[_0xbed9('0x3c')](_0x3ce1e3[_0xbed9('0x3b')]);_0x26e2ab['filters']=_[_0xbed9('0x3e')](_0x26e2ab[_0xbed9('0x39')],_0x26e2ab['query']);_0x1fc9b6['attributes']=_[_0xbed9('0x3e')](_0x26e2ab[_0xbed9('0x39')],qs[_0xbed9('0x40')](_0x3ce1e3['query'][_0xbed9('0x40')]));_0x1fc9b6[_0xbed9('0x3f')]=_0x1fc9b6[_0xbed9('0x3f')][_0xbed9('0x41')]?_0x1fc9b6['attributes']:_0x26e2ab[_0xbed9('0x39')];if(!_0x3ce1e3['query'][_0xbed9('0x42')]('nolimit')){_0x1fc9b6[_0xbed9('0x23')]=qs[_0xbed9('0x23')](_0x3ce1e3[_0xbed9('0x3b')][_0xbed9('0x23')]);_0x1fc9b6['offset']=qs[_0xbed9('0x21')](_0x3ce1e3[_0xbed9('0x3b')]['offset']);}_0x1fc9b6[_0xbed9('0x43')]=qs[_0xbed9('0x44')](_0x3ce1e3['query'][_0xbed9('0x44')]);_0x1fc9b6[_0xbed9('0x45')]=qs['filters'](_[_0xbed9('0x46')](_0x3ce1e3[_0xbed9('0x3b')],_0x26e2ab[_0xbed9('0x3d')]));_0x1fc9b6['where'][_0xbed9('0x5c')]=_0x445252['id'];if(_0x3ce1e3[_0xbed9('0x3b')][_0xbed9('0x47')]){_0x1fc9b6[_0xbed9('0x45')]=_['merge'](_0x1fc9b6[_0xbed9('0x45')],{'$or':_[_0xbed9('0x33')](_0x1fc9b6[_0xbed9('0x3f')],function(_0x28c9c7){var _0x40905={};_0x40905[_0x28c9c7]={'$like':'%'+_0x3ce1e3[_0xbed9('0x3b')][_0xbed9('0x47')]+'%'};return _0x40905;})});}_0x1fc9b6=_['merge']({},_0x1fc9b6,_0x3ce1e3[_0xbed9('0x5d')]);return db[_0xbed9('0x5e')][_0xbed9('0x4b')](_0x1fc9b6);}})[_0xbed9('0x2a')](function(_0x3df9fe){if(_0x3df9fe){return db[_0xbed9('0x5f')]['findAndCountAll']({'where':{'id':_['map'](_0x3df9fe,_0xbed9('0x60')),'role':'agent'},'attributes':['id',_0xbed9('0x3a'),'smsPause',_0xbed9('0x61'),'createdAt']});}})[_0xbed9('0x2a')](function(_0x53cdd0){if(_0x53cdd0){return{'count':_0x53cdd0[_0xbed9('0x24')],'rows':_[_0xbed9('0x33')](_0x53cdd0[_0xbed9('0x4c')],function(_0x5428a9){return{'membername':_0x5428a9[_0xbed9('0x3a')],'UserId':_0x5428a9['id'],'queue_name':_0x3ba4e2[_0xbed9('0x3a')],'SmsQueueId':_0x3ba4e2['id'],'interface':util['format'](_0xbed9('0x62'),'SIP',_0x5428a9['name']),'penalty':0x0,'paused':_0x5428a9[_0xbed9('0x63')],'createdAt':_0x5428a9[_0xbed9('0x64')],'updatedAt':_0x5428a9[_0xbed9('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbed9('0x2a')](respondWithFilteredResult(_0xff70a,_0x1fc9b6))[_0xbed9('0x4d')](handleError(_0xff70a,null));};exports[_0xbed9('0x65')]=function(_0x1bd65d,_0x3625a0,_0x1e88e4){var _0x2b0eaf={};var _0x272354={};var _0x2cb447;var _0x2d801c;return db[_0xbed9('0x34')][_0xbed9('0x66')]({'where':{'id':_0x1bd65d[_0xbed9('0x4f')]['id']}})[_0xbed9('0x2a')](handleEntityNotFound(_0x3625a0,null))[_0xbed9('0x2a')](function(_0x5c9b07){if(_0x5c9b07){_0x2cb447=_0x5c9b07;_0x272354[_0xbed9('0x39')]=_[_0xbed9('0x3c')](db[_0xbed9('0x67')][_0xbed9('0x35')]);_0x272354[_0xbed9('0x3b')]=_['keys'](_0x1bd65d['query']);_0x272354[_0xbed9('0x3d')]=_[_0xbed9('0x3e')](_0x272354['model'],_0x272354[_0xbed9('0x3b')]);_0x2b0eaf[_0xbed9('0x3f')]=_[_0xbed9('0x3e')](_0x272354['model'],qs[_0xbed9('0x40')](_0x1bd65d[_0xbed9('0x3b')]['fields']));_0x2b0eaf[_0xbed9('0x3f')]=_0x2b0eaf[_0xbed9('0x3f')][_0xbed9('0x41')]?_0x2b0eaf[_0xbed9('0x3f')]:_0x272354[_0xbed9('0x39')];_0x2b0eaf['order']=qs[_0xbed9('0x44')](_0x1bd65d['query'][_0xbed9('0x44')]);_0x2b0eaf[_0xbed9('0x45')]=qs[_0xbed9('0x3d')](_[_0xbed9('0x46')](_0x1bd65d[_0xbed9('0x3b')],_0x272354[_0xbed9('0x3d')]));if(_0x1bd65d[_0xbed9('0x3b')][_0xbed9('0x47')]){_0x2b0eaf[_0xbed9('0x45')]=_[_0xbed9('0x48')](_0x2b0eaf[_0xbed9('0x45')],{'$or':_[_0xbed9('0x33')](_0x2b0eaf['attributes'],function(_0x2524fc){var _0x43338a={};_0x43338a[_0x2524fc]={'$like':'%'+_0x1bd65d['query']['filter']+'%'};return _0x43338a;})});}_0x2b0eaf=_[_0xbed9('0x48')]({},_0x2b0eaf,_0x1bd65d[_0xbed9('0x5d')]);return _0x2cb447[_0xbed9('0x65')](_0x2b0eaf);}})[_0xbed9('0x2a')](function(_0x76b575){if(_0x76b575){_0x2d801c=_0x76b575[_0xbed9('0x41')];if(!_0x1bd65d[_0xbed9('0x3b')][_0xbed9('0x42')](_0xbed9('0x68'))){_0x2b0eaf[_0xbed9('0x23')]=qs[_0xbed9('0x23')](_0x1bd65d['query'][_0xbed9('0x23')]);_0x2b0eaf[_0xbed9('0x21')]=qs['offset'](_0x1bd65d['query'][_0xbed9('0x21')]);}return _0x2cb447['getTeams'](_0x2b0eaf);}})[_0xbed9('0x2a')](function(_0x116206){if(_0x116206){return _0x116206?{'count':_0x2d801c,'rows':_0x116206}:null;}})[_0xbed9('0x2a')](respondWithResult(_0x3625a0,null))['catch'](handleError(_0x3625a0,null));};exports[_0xbed9('0x69')]=function(_0xb48bc4,_0x5ad925,_0x58b4fa){var _0xa1e4c3=_0xb48bc4[_0xbed9('0x52')][_0xbed9('0x6a')];return db['Team'][_0xbed9('0x4b')]({'where':{'id':_0xa1e4c3},'attributes':['id'],'include':[{'model':db[_0xbed9('0x5f')],'as':_0xbed9('0x6b'),'attributes':['id',_0xbed9('0x3a'),_0xbed9('0x6c'),_0xbed9('0x6d'),_0xbed9('0x6e')],'raw':!![]}]})[_0xbed9('0x2a')](function(_0x400861){if(_0x400861){var _0x98a21d=_[_0xbed9('0x6f')](_0x400861,function(_0x1b951a){var _0x171ce0=_0x1b951a[_0xbed9('0x2b')]({'plain':!![]});return _0x171ce0[_0xbed9('0x6b')];});return db[_0xbed9('0x34')][_0xbed9('0x56')]({'where':{'id':_0xb48bc4[_0xbed9('0x4f')]['id']}})[_0xbed9('0x2a')](function(_0xe81be8){return db[_0xbed9('0x70')][_0xbed9('0x71')](function(_0x24d61d){return _0xe81be8[_0xbed9('0x69')](_0xa1e4c3,{'transaction':_0x24d61d})[_0xbed9('0x2a')](function(){return BPromise[_0xbed9('0x72')](_0x98a21d,function(_0x335745){return db['UserSmsQueue'][_0xbed9('0x73')]({'where':{'UserId':_0x335745['id'],'SmsQueueId':_0xb48bc4[_0xbed9('0x4f')]['id']},'transaction':_0x24d61d});});})[_0xbed9('0x2a')](function(){_0x98a21d[_0xbed9('0x74')](function(_0x54f1e3){socket['emit'](_0xbed9('0x75'),{'UserId':_0x54f1e3['id'],'SmsQueueId':_0xe81be8['id']});});});});});}})[_0xbed9('0x2a')](respondWithStatusCode(_0x5ad925,null))['catch'](handleError(_0x5ad925,null));};exports[_0xbed9('0x76')]=function(_0x5f129b,_0x8447c0,_0x2931c8){return db[_0xbed9('0x67')][_0xbed9('0x4b')]({'where':{'id':_0x5f129b[_0xbed9('0x3b')][_0xbed9('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xbed9('0x5f')],'as':_0xbed9('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xbed9('0x2a')](handleEntityNotFound(_0x8447c0,null))[_0xbed9('0x2a')](function(_0xca4018){var _0x22e23d=_[_0xbed9('0x33')](_0xca4018,'id');var _0x24d3ba=[];var _0x349c2c=[];var _0x382146=squel['select']();_0x382146['field']('tq.TeamId')[_0xbed9('0x77')](_0xbed9('0x78'),'tq')[_0xbed9('0x79')]('user_has_teams','ut',_0xbed9('0x7a'))[_0xbed9('0x45')](_0xbed9('0x7b'),_0x5f129b[_0xbed9('0x4f')]['id']);for(var _0x10249d=0x0;_0x10249d<_0xca4018[_0xbed9('0x41')];_0x10249d+=0x1){let _0x43a39d=_0xca4018[_0x10249d];for(var _0x50d61c=0x0;_0x50d61c<_0x43a39d[_0xbed9('0x6b')][_0xbed9('0x41')];_0x50d61c+=0x1){let _0x2324bd=_0x43a39d['Agents'][_0x50d61c];var _0x3c5b70=_0x382146[_0xbed9('0x7c')]();_0x3c5b70[_0xbed9('0x45')]('ut.UserId\x20=\x20?',_0x2324bd['id']);_0x349c2c['push'](db[_0xbed9('0x70')][_0xbed9('0x3b')](_0x3c5b70[_0xbed9('0x7d')](),{'type':db['sequelize'][_0xbed9('0x7e')][_0xbed9('0x7f')]})[_0xbed9('0x2a')](function(_0x52ebc1){if(_0x52ebc1['length']===0x1){return _0x2324bd['id'];}else{var _0x366188=_[_0xbed9('0x80')](_['map'](_0x52ebc1,_0xbed9('0x81')),function(_0x2fe251){return _[_0xbed9('0x82')](_0x22e23d,_0x2fe251);});if(_0x366188){return _0x2324bd['id'];}}}));}}return BPromise[_0xbed9('0x83')](_0x349c2c)['then'](function(_0x4b3a51){_0x24d3ba=_(_0x24d3ba)[_0xbed9('0x84')](_0x4b3a51)['compact']()[_0xbed9('0x85')]();return db[_0xbed9('0x34')][_0xbed9('0x56')]({'where':{'id':_0x5f129b[_0xbed9('0x4f')]['id']}})[_0xbed9('0x2a')](function(_0x153de8){return db['sequelize'][_0xbed9('0x71')](function(_0x1efbb1){return _0x153de8[_0xbed9('0x76')](_0x5f129b['query'][_0xbed9('0x6a')],{'transaction':_0x1efbb1})[_0xbed9('0x2a')](function(){if(!_[_0xbed9('0x86')](_0x24d3ba)){return _0x153de8[_0xbed9('0x87')](_0x24d3ba,{'transaction':_0x1efbb1});}})['then'](function(){_0x24d3ba[_0xbed9('0x74')](function(_0x50889b){socket[_0xbed9('0x88')]('userSmsQueue:remove',{'UserId':_0x50889b,'SmsQueueId':_0x153de8['id']});});});});});});})[_0xbed9('0x2a')](respondWithStatusCode(_0x8447c0,null))[_0xbed9('0x4d')](handleError(_0x8447c0,null));};exports['addAgents']=function(_0x2f8d08,_0x4bd7d3,_0x576a65){return db[_0xbed9('0x34')][_0xbed9('0x56')]({'where':{'id':_0x2f8d08[_0xbed9('0x4f')]['id']}})[_0xbed9('0x2a')](handleEntityNotFound(_0x4bd7d3,null))[_0xbed9('0x2a')](function(_0x1a8e3b){if(_0x1a8e3b){return _0x1a8e3b[_0xbed9('0x89')](_0x2f8d08[_0xbed9('0x52')][_0xbed9('0x6a')],_['omit'](_0x2f8d08[_0xbed9('0x52')],[_0xbed9('0x6a'),'id'])||{})[_0xbed9('0x8a')](function(_0x351033){for(var _0x7ff487=0x0;_0x7ff487<_0x2f8d08[_0xbed9('0x52')][_0xbed9('0x6a')][_0xbed9('0x41')];_0x7ff487+=0x1){socket[_0xbed9('0x88')](_0xbed9('0x75'),{'UserId':Number(_0x2f8d08[_0xbed9('0x52')][_0xbed9('0x6a')][_0x7ff487]),'SmsQueueId':Number(_0x2f8d08[_0xbed9('0x4f')]['id'])});}return _0x351033;});}})['then'](respondWithResult(_0x4bd7d3,null))[_0xbed9('0x4d')](handleError(_0x4bd7d3,null));};exports['removeAgents']=function(_0x34fc0a,_0x2e2827,_0x165331){return db[_0xbed9('0x34')]['find']({'where':{'id':_0x34fc0a['params']['id']}})['then'](handleEntityNotFound(_0x2e2827,null))['then'](function(_0x503c54){if(_0x503c54){return _0x503c54['removeAgents'](_0x34fc0a['query']['ids'])[_0xbed9('0x2a')](function(){if(_['isArray'](_0x34fc0a[_0xbed9('0x3b')]['ids'])){for(var _0x1eb430=0x0;_0x1eb430<_0x34fc0a[_0xbed9('0x3b')][_0xbed9('0x6a')][_0xbed9('0x41')];_0x1eb430+=0x1){socket['emit'](_0xbed9('0x8b'),{'UserId':Number(_0x34fc0a[_0xbed9('0x3b')][_0xbed9('0x6a')][_0x1eb430]),'SmsQueueId':Number(_0x34fc0a[_0xbed9('0x4f')]['id'])});}}else{socket['emit'](_0xbed9('0x8b'),{'UserId':Number(_0x34fc0a[_0xbed9('0x3b')][_0xbed9('0x6a')]),'SmsQueueId':Number(_0x34fc0a[_0xbed9('0x4f')]['id'])});}});}})[_0xbed9('0x2a')](respondWithStatusCode(_0x2e2827,null))[_0xbed9('0x4d')](handleError(_0x2e2827,null));};exports[_0xbed9('0x8c')]=function(_0x3569e5,_0x57095e,_0x2f05f3){var _0x4d850b={};var _0xa43088={};var _0x51b00c;var _0x4c05ea;return db[_0xbed9('0x34')]['findOne']({'where':{'id':_0x3569e5[_0xbed9('0x4f')]['id']}})[_0xbed9('0x2a')](handleEntityNotFound(_0x57095e,null))['then'](function(_0xbe30d0){if(_0xbe30d0){_0x51b00c=_0xbe30d0;_0xa43088[_0xbed9('0x39')]=_[_0xbed9('0x3c')](db[_0xbed9('0x5f')][_0xbed9('0x35')]);_0xa43088[_0xbed9('0x3b')]=_[_0xbed9('0x3c')](_0x3569e5[_0xbed9('0x3b')]);_0xa43088['filters']=_['intersection'](_0xa43088[_0xbed9('0x39')],_0xa43088[_0xbed9('0x3b')]);_0x4d850b[_0xbed9('0x3f')]=_[_0xbed9('0x3e')](_0xa43088[_0xbed9('0x39')],qs[_0xbed9('0x40')](_0x3569e5[_0xbed9('0x3b')][_0xbed9('0x40')]));_0x4d850b[_0xbed9('0x3f')]=_0x4d850b[_0xbed9('0x3f')][_0xbed9('0x41')]?_0x4d850b[_0xbed9('0x3f')]:_0xa43088['model'];_0x4d850b['order']=qs[_0xbed9('0x44')](_0x3569e5[_0xbed9('0x3b')]['sort']);_0x4d850b[_0xbed9('0x45')]=qs[_0xbed9('0x3d')](_['pick'](_0x3569e5[_0xbed9('0x3b')],_0xa43088['filters']));if(_0x3569e5[_0xbed9('0x3b')]['filter']){_0x4d850b['where']=_['merge'](_0x4d850b[_0xbed9('0x45')],{'$or':_[_0xbed9('0x33')](_0x4d850b[_0xbed9('0x3f')],function(_0x8c2166){var _0x39809f={};_0x39809f[_0x8c2166]={'$like':'%'+_0x3569e5[_0xbed9('0x3b')][_0xbed9('0x47')]+'%'};return _0x39809f;})});}_0x4d850b=_[_0xbed9('0x48')]({},_0x4d850b,_0x3569e5['options']);return _0x51b00c['getAgents'](_0x4d850b);}})[_0xbed9('0x2a')](function(_0x3c0138){if(_0x3c0138){_0x4c05ea=_0x3c0138['length'];if(!_0x3569e5[_0xbed9('0x3b')][_0xbed9('0x42')](_0xbed9('0x68'))){_0x4d850b[_0xbed9('0x23')]=qs[_0xbed9('0x23')](_0x3569e5['query'][_0xbed9('0x23')]);_0x4d850b['offset']=qs[_0xbed9('0x21')](_0x3569e5['query'][_0xbed9('0x21')]);}return _0x51b00c[_0xbed9('0x8c')](_0x4d850b);}})[_0xbed9('0x2a')](function(_0x50a800){if(_0x50a800){return _0x50a800?{'count':_0x4c05ea,'rows':_0x50a800}:null;}})[_0xbed9('0x2a')](respondWithResult(_0x57095e,null))['catch'](handleError(_0x57095e,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index cc03cd4..46da5e7 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 _0x6f95=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f95,0x138));var _0x56f9=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x6f95[_0x47aa64];return _0x549c7a;};'use strict';var EventEmitter=require(_0x56f9('0x0'));var SmsQueue=require(_0x56f9('0x1'))['db'][_0x56f9('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x56f9('0x3'),'afterUpdate':_0x56f9('0x4'),'afterDestroy':_0x56f9('0x5')};function emitEvent(_0x5e35f8){return function(_0x368357,_0x11da7a,_0x46d331){SmsQueueEvents[_0x56f9('0x6')](_0x5e35f8+':'+_0x368357['id'],_0x368357);SmsQueueEvents[_0x56f9('0x6')](_0x5e35f8,_0x368357);_0x46d331(null);};}for(var e in events){if(events[_0x56f9('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x56f9('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x070e=['remove','emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners','save'];(function(_0x266b92,_0xe11ec9){var _0xdb1f25=function(_0x2756b8){while(--_0x2756b8){_0x266b92['push'](_0x266b92['shift']());}};_0xdb1f25(++_0xe11ec9);}(_0x070e,0xcb));var _0xe070=function(_0x5cb9cf,_0x140cf2){_0x5cb9cf=_0x5cb9cf-0x0;var _0x21544d=_0x070e[_0x5cb9cf];return _0x21544d;};'use strict';var EventEmitter=require(_0xe070('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xe070('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe070('0x2')](0x0);var events={'afterCreate':_0xe070('0x3'),'afterUpdate':'update','afterDestroy':_0xe070('0x4')};function emitEvent(_0x3a22d4){return function(_0x1fbdd1,_0x17eea2,_0x367bb9){SmsQueueEvents[_0xe070('0x5')](_0x3a22d4+':'+_0x1fbdd1['id'],_0x1fbdd1);SmsQueueEvents['emit'](_0x3a22d4,_0x1fbdd1);_0x367bb9(null);};}for(var e in events){if(events[_0xe070('0x6')](e)){var event=events[e];SmsQueue[_0xe070('0x7')](e,emitEvent(event));}}module[_0xe070('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 20aa27d..d86e8a6 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 _0x2850=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util'];(function(_0x199753,_0xe841a9){var _0x28c9ee=function(_0x3ea3f7){while(--_0x3ea3f7){_0x199753['push'](_0x199753['shift']());}};_0x28c9ee(++_0xe841a9);}(_0x2850,0x132));var _0x0285=function(_0x329aa3,_0x5e7401){_0x329aa3=_0x329aa3-0x0;var _0x4450f9=_0x2850[_0x329aa3];return _0x4450f9;};'use strict';var _=require(_0x0285('0x0'));var util=require(_0x0285('0x1'));var logger=require('../../config/logger')(_0x0285('0x2'));var moment=require(_0x0285('0x3'));var BPromise=require(_0x0285('0x4'));var rp=require(_0x0285('0x5'));var fs=require('fs');var path=require(_0x0285('0x6'));var rimraf=require(_0x0285('0x7'));var config=require(_0x0285('0x8'));var attributes=require(_0x0285('0x9'));module[_0x0285('0xa')]=function(_0x79bf5f,_0x35207b){return _0x79bf5f[_0x0285('0xb')](_0x0285('0xc'),attributes,{'tableName':_0x0285('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cdb=['path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','lodash','util','../../config/logger','moment','bluebird'];(function(_0xc50565,_0x393a58){var _0x18dc24=function(_0x51ad7c){while(--_0x51ad7c){_0xc50565['push'](_0xc50565['shift']());}};_0x18dc24(++_0x393a58);}(_0x2cdb,0x15b));var _0xb2cd=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2cdb[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xb2cd('0x0'));var util=require(_0xb2cd('0x1'));var logger=require(_0xb2cd('0x2'))('api');var moment=require(_0xb2cd('0x3'));var BPromise=require(_0xb2cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2cd('0x5'));var rimraf=require(_0xb2cd('0x6'));var config=require(_0xb2cd('0x7'));var attributes=require(_0xb2cd('0x8'));module['exports']=function(_0x5a38e6,_0x518350){return _0x5a38e6[_0xb2cd('0x9')](_0xb2cd('0xa'),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 df4b22f..465fab1 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 _0x038b=['SmsQueue','raw','options','attributes','limit','include','map','model','then','stringify','ShowSmsQueue','find','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSmsQueue'];(function(_0x2ae8c0,_0x4972c8){var _0x313ae1=function(_0xb56667){while(--_0xb56667){_0x2ae8c0['push'](_0x2ae8c0['shift']());}};_0x313ae1(++_0x4972c8);}(_0x038b,0x1db));var _0xb038=function(_0x27f571,_0x149034){_0x27f571=_0x27f571-0x0;var _0x47ff0d=_0x038b[_0x27f571];return _0x47ff0d;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var moment=require(_0xb038('0x1'));var BPromise=require(_0xb038('0x2'));var rs=require(_0xb038('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb038('0x4'))['db'];var utils=require(_0xb038('0x5'));var logger=require(_0xb038('0x6'))(_0xb038('0x7'));var config=require(_0xb038('0x8'));var jayson=require(_0xb038('0x9'));var client=jayson[_0xb038('0xa')]['http']({'port':0x232a});config['redis']=_[_0xb038('0xb')](config[_0xb038('0xc')],{'host':_0xb038('0xd'),'port':0x18eb});var socket=require(_0xb038('0xe'))(new Redis(config[_0xb038('0xc')]));require(_0xb038('0xf'))[_0xb038('0x10')](socket);function respondWithRpcPromise(_0x17d173,_0x3f461d,_0x1827b6){return new BPromise(function(_0x2b3966,_0x3558fe){return client[_0xb038('0x11')](_0x17d173,_0x1827b6)['then'](function(_0x2eb699){logger[_0xb038('0x12')](_0xb038('0x13'),_0x3f461d,'request\x20sent');logger[_0xb038('0x14')](_0xb038('0x15'),_0x3f461d,_0xb038('0x16'),JSON['stringify'](_0x2eb699));if(_0x2eb699[_0xb038('0x17')]){if(_0x2eb699[_0xb038('0x17')][_0xb038('0x18')]===0x1f4){logger['error'](_0xb038('0x13'),_0x3f461d,_0x2eb699['error'][_0xb038('0x19')]);return _0x3558fe(_0x2eb699['error']['message']);}logger[_0xb038('0x17')](_0xb038('0x13'),_0x3f461d,_0x2eb699[_0xb038('0x17')][_0xb038('0x19')]);return _0x2b3966(_0x2eb699['error'][_0xb038('0x19')]);}else{logger[_0xb038('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3f461d,_0xb038('0x16'));_0x2b3966(_0x2eb699[_0xb038('0x1a')]['message']);}})[_0xb038('0x1b')](function(_0x113e76){logger['error'](_0xb038('0x13'),_0x3f461d,_0x113e76);_0x3558fe(_0x113e76);});});}exports[_0xb038('0x1c')]=function(_0x46b345){var _0x3fafae=this;return new Promise(function(_0xa083a2,_0xe90711){return db[_0xb038('0x1d')]['findAll']({'raw':_0x46b345['options']?_0x46b345['options'][_0xb038('0x1e')]===undefined?!![]:![]:!![],'where':_0x46b345[_0xb038('0x1f')]?_0x46b345['options']['where']||null:null,'attributes':_0x46b345['options']?_0x46b345['options'][_0xb038('0x20')]||null:null,'limit':_0x46b345[_0xb038('0x1f')]?_0x46b345[_0xb038('0x1f')][_0xb038('0x21')]||null:null,'include':_0x46b345[_0xb038('0x1f')]?_0x46b345[_0xb038('0x1f')][_0xb038('0x22')]?_[_0xb038('0x23')](_0x46b345[_0xb038('0x1f')][_0xb038('0x22')],function(_0x4fb6c0){return{'model':db[_0x4fb6c0[_0xb038('0x24')]],'as':_0x4fb6c0['as'],'attributes':_0x4fb6c0[_0xb038('0x20')],'include':_0x4fb6c0[_0xb038('0x22')]?_[_0xb038('0x23')](_0x4fb6c0[_0xb038('0x22')],function(_0x4db981){return{'model':db[_0x4db981[_0xb038('0x24')]],'as':_0x4db981['as'],'attributes':_0x4db981[_0xb038('0x20')],'include':_0x4db981[_0xb038('0x22')]?_[_0xb038('0x23')](_0x4db981[_0xb038('0x22')],function(_0x50c8f7){return{'model':db[_0x50c8f7['model']],'as':_0x50c8f7['as'],'attributes':_0x50c8f7[_0xb038('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb038('0x25')](function(_0x541609){logger[_0xb038('0x12')](_0xb038('0x1c'),_0x46b345);logger[_0xb038('0x14')]('GetSmsQueue',_0x46b345,JSON[_0xb038('0x26')](_0x541609));_0xa083a2(_0x541609);})[_0xb038('0x1b')](function(_0x4515ca){logger[_0xb038('0x17')](_0xb038('0x1c'),_0x4515ca[_0xb038('0x19')],_0x46b345);_0xe90711(_0x3fafae[_0xb038('0x17')](0x1f4,_0x4515ca[_0xb038('0x19')]));});});};exports[_0xb038('0x27')]=function(_0x49b1d3){var _0x3e4976=this;return new Promise(function(_0x220cdc,_0xe31187){return db[_0xb038('0x1d')][_0xb038('0x28')]({'raw':_0x49b1d3['options']?_0x49b1d3[_0xb038('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x49b1d3[_0xb038('0x1f')]?_0x49b1d3[_0xb038('0x1f')][_0xb038('0x29')]||null:null,'attributes':_0x49b1d3[_0xb038('0x1f')]?_0x49b1d3[_0xb038('0x1f')]['attributes']||null:null,'include':_0x49b1d3[_0xb038('0x1f')]?_0x49b1d3['options'][_0xb038('0x22')]?_[_0xb038('0x23')](_0x49b1d3[_0xb038('0x1f')][_0xb038('0x22')],function(_0x31fcbc){return{'model':db[_0x31fcbc[_0xb038('0x24')]],'as':_0x31fcbc['as'],'attributes':_0x31fcbc[_0xb038('0x20')],'include':_0x31fcbc[_0xb038('0x22')]?_['map'](_0x31fcbc[_0xb038('0x22')],function(_0x34c3fb){return{'model':db[_0x34c3fb[_0xb038('0x24')]],'as':_0x34c3fb['as'],'attributes':_0x34c3fb[_0xb038('0x20')],'include':_0x34c3fb['include']?_[_0xb038('0x23')](_0x34c3fb['include'],function(_0xaea3e2){return{'model':db[_0xaea3e2['model']],'as':_0xaea3e2['as'],'attributes':_0xaea3e2[_0xb038('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb038('0x25')](function(_0x231efa){logger[_0xb038('0x12')](_0xb038('0x27'),_0x49b1d3);logger[_0xb038('0x14')](_0xb038('0x27'),_0x49b1d3,JSON[_0xb038('0x26')](_0x231efa));_0x220cdc(_0x231efa);})[_0xb038('0x1b')](function(_0x39aab6){logger['error']('ShowSmsQueue',_0x39aab6[_0xb038('0x19')],_0x49b1d3);_0xe31187(_0x3e4976[_0xb038('0x17')](0x1f4,_0x39aab6[_0xb038('0x19')]));});});}; \ No newline at end of file +var _0xb38e=['find','where','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','result','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','include','map','model','catch'];(function(_0x291f91,_0x394903){var _0x4d1bb9=function(_0x3f296c){while(--_0x3f296c){_0x291f91['push'](_0x291f91['shift']());}};_0x4d1bb9(++_0x394903);}(_0xb38e,0xed));var _0xeb38=function(_0x21a7b1,_0x2513fa){_0x21a7b1=_0x21a7b1-0x0;var _0x1616bb=_0xb38e[_0x21a7b1];return _0x1616bb;};'use strict';var _=require(_0xeb38('0x0'));var util=require(_0xeb38('0x1'));var moment=require(_0xeb38('0x2'));var BPromise=require(_0xeb38('0x3'));var rs=require(_0xeb38('0x4'));var fs=require('fs');var Redis=require(_0xeb38('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb38('0x6'));var logger=require(_0xeb38('0x7'))(_0xeb38('0x8'));var config=require(_0xeb38('0x9'));var jayson=require(_0xeb38('0xa'));var client=jayson[_0xeb38('0xb')][_0xeb38('0xc')]({'port':0x232a});config[_0xeb38('0xd')]=_['defaults'](config[_0xeb38('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb38('0xe'))(new Redis(config[_0xeb38('0xd')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4e85a7,_0x173909,_0x3a8ab7){return new BPromise(function(_0x2c3800,_0x3d3dba){return client['request'](_0x4e85a7,_0x3a8ab7)[_0xeb38('0xf')](function(_0x4b0387){logger['info']('SmsQueue,\x20%s,\x20%s',_0x173909,'request\x20sent');logger[_0xeb38('0x10')](_0xeb38('0x11'),_0x173909,_0xeb38('0x12'),JSON[_0xeb38('0x13')](_0x4b0387));if(_0x4b0387[_0xeb38('0x14')]){if(_0x4b0387[_0xeb38('0x14')][_0xeb38('0x15')]===0x1f4){logger[_0xeb38('0x14')](_0xeb38('0x16'),_0x173909,_0x4b0387[_0xeb38('0x14')]['message']);return _0x3d3dba(_0x4b0387[_0xeb38('0x14')][_0xeb38('0x17')]);}logger[_0xeb38('0x14')](_0xeb38('0x16'),_0x173909,_0x4b0387[_0xeb38('0x14')]['message']);return _0x2c3800(_0x4b0387[_0xeb38('0x14')]['message']);}else{logger[_0xeb38('0x18')]('SmsQueue,\x20%s,\x20%s',_0x173909,_0xeb38('0x12'));_0x2c3800(_0x4b0387[_0xeb38('0x19')]['message']);}})['catch'](function(_0x2df5d9){logger[_0xeb38('0x14')](_0xeb38('0x16'),_0x173909,_0x2df5d9);_0x3d3dba(_0x2df5d9);});});}exports[_0xeb38('0x1a')]=function(_0x2f5dae){var _0xe71f68=this;return new Promise(function(_0x6668e8,_0x380878){return db[_0xeb38('0x1b')][_0xeb38('0x1c')]({'raw':_0x2f5dae[_0xeb38('0x1d')]?_0x2f5dae['options'][_0xeb38('0x1e')]===undefined?!![]:![]:!![],'where':_0x2f5dae[_0xeb38('0x1d')]?_0x2f5dae['options']['where']||null:null,'attributes':_0x2f5dae[_0xeb38('0x1d')]?_0x2f5dae['options'][_0xeb38('0x1f')]||null:null,'limit':_0x2f5dae['options']?_0x2f5dae[_0xeb38('0x1d')]['limit']||null:null,'include':_0x2f5dae['options']?_0x2f5dae[_0xeb38('0x1d')][_0xeb38('0x20')]?_[_0xeb38('0x21')](_0x2f5dae['options'][_0xeb38('0x20')],function(_0x1dd5e6){return{'model':db[_0x1dd5e6[_0xeb38('0x22')]],'as':_0x1dd5e6['as'],'attributes':_0x1dd5e6[_0xeb38('0x1f')],'include':_0x1dd5e6[_0xeb38('0x20')]?_[_0xeb38('0x21')](_0x1dd5e6[_0xeb38('0x20')],function(_0x4a04a5){return{'model':db[_0x4a04a5['model']],'as':_0x4a04a5['as'],'attributes':_0x4a04a5['attributes'],'include':_0x4a04a5['include']?_['map'](_0x4a04a5[_0xeb38('0x20')],function(_0x5ae549){return{'model':db[_0x5ae549[_0xeb38('0x22')]],'as':_0x5ae549['as'],'attributes':_0x5ae549['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d1909){logger[_0xeb38('0x18')]('GetSmsQueue',_0x2f5dae);logger[_0xeb38('0x10')](_0xeb38('0x1a'),_0x2f5dae,JSON[_0xeb38('0x13')](_0x3d1909));_0x6668e8(_0x3d1909);})[_0xeb38('0x23')](function(_0x104146){logger[_0xeb38('0x14')](_0xeb38('0x1a'),_0x104146['message'],_0x2f5dae);_0x380878(_0xe71f68['error'](0x1f4,_0x104146[_0xeb38('0x17')]));});});};exports['ShowSmsQueue']=function(_0x4d42ca){var _0x2af24a=this;return new Promise(function(_0xe2f3e9,_0xaf3159){return db['SmsQueue'][_0xeb38('0x24')]({'raw':_0x4d42ca['options']?_0x4d42ca[_0xeb38('0x1d')][_0xeb38('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d42ca[_0xeb38('0x1d')]?_0x4d42ca[_0xeb38('0x1d')][_0xeb38('0x25')]||null:null,'attributes':_0x4d42ca[_0xeb38('0x1d')]?_0x4d42ca[_0xeb38('0x1d')][_0xeb38('0x1f')]||null:null,'include':_0x4d42ca[_0xeb38('0x1d')]?_0x4d42ca['options'][_0xeb38('0x20')]?_['map'](_0x4d42ca[_0xeb38('0x1d')][_0xeb38('0x20')],function(_0x51dc9e){return{'model':db[_0x51dc9e['model']],'as':_0x51dc9e['as'],'attributes':_0x51dc9e[_0xeb38('0x1f')],'include':_0x51dc9e[_0xeb38('0x20')]?_[_0xeb38('0x21')](_0x51dc9e[_0xeb38('0x20')],function(_0x24f832){return{'model':db[_0x24f832[_0xeb38('0x22')]],'as':_0x24f832['as'],'attributes':_0x24f832[_0xeb38('0x1f')],'include':_0x24f832['include']?_[_0xeb38('0x21')](_0x24f832[_0xeb38('0x20')],function(_0x5b5efb){return{'model':db[_0x5b5efb[_0xeb38('0x22')]],'as':_0x5b5efb['as'],'attributes':_0x5b5efb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x24b0aa){logger[_0xeb38('0x18')](_0xeb38('0x26'),_0x4d42ca);logger['debug'](_0xeb38('0x26'),_0x4d42ca,JSON[_0xeb38('0x13')](_0x24b0aa));_0xe2f3e9(_0x24b0aa);})[_0xeb38('0x23')](function(_0x18493f){logger[_0xeb38('0x14')](_0xeb38('0x26'),_0x18493f[_0xeb38('0x17')],_0x4d42ca);_0xaf3159(_0x2af24a[_0xeb38('0x14')](0x1f4,_0x18493f[_0xeb38('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 7c4b41d..8bfcdc3 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 _0x5a91=['emit','removeListener','register','length','smsQueue:','save','remove','update'];(function(_0x4efd8d,_0x4a3166){var _0x391f8a=function(_0x127917){while(--_0x127917){_0x4efd8d['push'](_0x4efd8d['shift']());}};_0x391f8a(++_0x4a3166);}(_0x5a91,0x145));var _0x15a9=function(_0x5f469f,_0x11f007){_0x5f469f=_0x5f469f-0x0;var _0x57ea64=_0x5a91[_0x5f469f];return _0x57ea64;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x15a9('0x0'),_0x15a9('0x1'),_0x15a9('0x2')];function createListener(_0x2c2106,_0x51e426){return function(_0x187ce4){_0x51e426[_0x15a9('0x3')](_0x2c2106,_0x187ce4);};}function removeListener(_0x22739a,_0x4bbf8c){return function(){SmsQueueEvents[_0x15a9('0x4')](_0x22739a,_0x4bbf8c);};}exports[_0x15a9('0x5')]=function(_0x370790){for(var _0x487727=0x0,_0x1437c4=events[_0x15a9('0x6')];_0x487727<_0x1437c4;_0x487727++){var _0x2cf2a0=events[_0x487727];var _0x50286d=createListener(_0x15a9('0x7')+_0x2cf2a0,_0x370790);SmsQueueEvents['on'](_0x2cf2a0,_0x50286d);}}; \ No newline at end of file +var _0x27e2=['update','removeListener','register','smsQueue:','./smsQueue.events','save','remove'];(function(_0x5779a5,_0x16fec3){var _0x239c18=function(_0x331cb9){while(--_0x331cb9){_0x5779a5['push'](_0x5779a5['shift']());}};_0x239c18(++_0x16fec3);}(_0x27e2,0x170));var _0x227e=function(_0x53562e,_0x1d6903){_0x53562e=_0x53562e-0x0;var _0x465434=_0x27e2[_0x53562e];return _0x465434;};'use strict';var SmsQueueEvents=require(_0x227e('0x0'));var events=[_0x227e('0x1'),_0x227e('0x2'),_0x227e('0x3')];function createListener(_0x490e2b,_0x3780a8){return function(_0x4ed9c1){_0x3780a8['emit'](_0x490e2b,_0x4ed9c1);};}function removeListener(_0xca7cfb,_0x2debd5){return function(){SmsQueueEvents[_0x227e('0x4')](_0xca7cfb,_0x2debd5);};}exports[_0x227e('0x5')]=function(_0x37c918){for(var _0x1f8da4=0x0,_0x595352=events['length'];_0x1f8da4<_0x595352;_0x1f8da4++){var _0x4062c7=events[_0x1f8da4];var _0x5db22c=createListener(_0x227e('0x6')+_0x4062c7,_0x37c918);SmsQueueEvents['on'](_0x4062c7,_0x5db22c);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 1106037..a2f84d3 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 _0x9417=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','create','put','/:id','update','delete','destroy'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x9417,0xb4));var _0x7941=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0x9417[_0xe51596];return _0x22c705;};'use strict';var multer=require(_0x7941('0x0'));var util=require(_0x7941('0x1'));var path=require(_0x7941('0x2'));var timeout=require(_0x7941('0x3'));var express=require('express');var router=express[_0x7941('0x4')]();var fs_extra=require(_0x7941('0x5'));var auth=require(_0x7941('0x6'));var interaction=require(_0x7941('0x7'));var config=require(_0x7941('0x8'));var controller=require(_0x7941('0x9'));router[_0x7941('0xa')]('/',auth[_0x7941('0xb')](),controller[_0x7941('0xc')]);router[_0x7941('0xa')]('/describe',auth[_0x7941('0xb')](),controller[_0x7941('0xd')]);router[_0x7941('0xa')]('/:id',auth[_0x7941('0xb')](),controller['show']);router['post']('/',auth[_0x7941('0xb')](),controller[_0x7941('0xe')]);router[_0x7941('0xf')](_0x7941('0x10'),auth[_0x7941('0xb')](),controller[_0x7941('0x11')]);router[_0x7941('0x12')](_0x7941('0x10'),auth['isAuthenticated'](),controller[_0x7941('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9a20=['describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x46a2fd,_0x132f3d){var _0x39e487=function(_0x49f7e9){while(--_0x49f7e9){_0x46a2fd['push'](_0x46a2fd['shift']());}};_0x39e487(++_0x132f3d);}(_0x9a20,0x153));var _0x09a2=function(_0x5a5d41,_0x2edeb7){_0x5a5d41=_0x5a5d41-0x0;var _0x4f31b9=_0x9a20[_0x5a5d41];return _0x4f31b9;};'use strict';var multer=require(_0x09a2('0x0'));var util=require(_0x09a2('0x1'));var path=require(_0x09a2('0x2'));var timeout=require(_0x09a2('0x3'));var express=require(_0x09a2('0x4'));var router=express[_0x09a2('0x5')]();var fs_extra=require(_0x09a2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x09a2('0x7'));var config=require(_0x09a2('0x8'));var controller=require('./smsQueueReport.controller');router[_0x09a2('0x9')]('/',auth[_0x09a2('0xa')](),controller[_0x09a2('0xb')]);router['get'](_0x09a2('0xc'),auth[_0x09a2('0xa')](),controller[_0x09a2('0xd')]);router[_0x09a2('0x9')](_0x09a2('0xe'),auth[_0x09a2('0xa')](),controller[_0x09a2('0xf')]);router[_0x09a2('0x10')]('/',auth[_0x09a2('0xa')](),controller[_0x09a2('0x11')]);router['put'](_0x09a2('0xe'),auth[_0x09a2('0xa')](),controller[_0x09a2('0x12')]);router[_0x09a2('0x13')](_0x09a2('0xe'),auth[_0x09a2('0xa')](),controller[_0x09a2('0x14')]);module[_0x09a2('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 5ac3be9..a07b530 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 _0x5ad6=['DATE','moment','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5ad6,0xfd));var _0x65ad=function(_0x332c1b,_0x28d711){_0x332c1b=_0x332c1b-0x0;var _0x21b49b=_0x5ad6[_0x332c1b];return _0x21b49b;};'use strict';var moment=require(_0x65ad('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x65ad('0x1')]},'joinAt':{'type':Sequelize[_0x65ad('0x2')]},'leaveAt':{'type':Sequelize[_0x65ad('0x2')]},'acceptAt':{'type':Sequelize[_0x65ad('0x2')]},'exitAt':{'type':Sequelize[_0x65ad('0x2')]},'reason':{'type':Sequelize[_0x65ad('0x1')]}}; \ No newline at end of file +var _0x36dc=['sequelize','exports','STRING','DATE'];(function(_0x82f8ad,_0x499c2d){var _0x63fbeb=function(_0x22f5f0){while(--_0x22f5f0){_0x82f8ad['push'](_0x82f8ad['shift']());}};_0x63fbeb(++_0x499c2d);}(_0x36dc,0x8c));var _0xc36d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x36dc[_0x2641f9];return _0x585741;};'use strict';var moment=require('moment');var Sequelize=require(_0xc36d('0x0'));module[_0xc36d('0x1')]={'uniqueid':{'type':Sequelize[_0xc36d('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc36d('0x3')]},'leaveAt':{'type':Sequelize[_0xc36d('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc36d('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 56c489c..b2970f9 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 _0x5a3d=['rawAttributes','intersection','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','query','filters','attributes','fields','length','order','sort','pick','filter','merge','VIRTUAL','options','where','include','findAll','rows','catch','keys'];(function(_0x3c8f26,_0x453699){var _0x5a4dd7=function(_0xd5c4b9){while(--_0xd5c4b9){_0x3c8f26['push'](_0x3c8f26['shift']());}};_0x5a4dd7(++_0x453699);}(_0x5a3d,0x12c));var _0xd5a3=function(_0x1fe4f2,_0xba736b){_0x1fe4f2=_0x1fe4f2-0x0;var _0x5d9333=_0x5a3d[_0x1fe4f2];return _0x5d9333;};'use strict';var emlformat=require(_0xd5a3('0x0'));var rimraf=require(_0xd5a3('0x1'));var zipdir=require(_0xd5a3('0x2'));var jsonpatch=require(_0xd5a3('0x3'));var rp=require(_0xd5a3('0x4'));var moment=require('moment');var BPromise=require(_0xd5a3('0x5'));var Mustache=require(_0xd5a3('0x6'));var util=require('util');var path=require(_0xd5a3('0x7'));var sox=require('sox');var csv=require(_0xd5a3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd5a3('0x9'));var _=require(_0xd5a3('0xa'));var squel=require(_0xd5a3('0xb'));var crypto=require(_0xd5a3('0xc'));var jsforce=require(_0xd5a3('0xd'));var deskjs=require(_0xd5a3('0xe'));var toCsv=require(_0xd5a3('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd5a3('0xf'));var authService=require(_0xd5a3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd5a3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5a3('0x12'))('api');var utils=require(_0xd5a3('0x13'));var config=require(_0xd5a3('0x14'));var licenseUtil=require(_0xd5a3('0x15'));var db=require(_0xd5a3('0x16'))['db'];function respondWithStatusCode(_0x59ea1f,_0x539002){_0x539002=_0x539002||0xcc;return function(_0x382390){if(_0x382390){return _0x59ea1f['sendStatus'](_0x539002);}return _0x59ea1f[_0xd5a3('0x17')](_0x539002)['end']();};}function respondWithResult(_0x4c7330,_0x11042b){_0x11042b=_0x11042b||0xc8;return function(_0x27f440){if(_0x27f440){return _0x4c7330[_0xd5a3('0x17')](_0x11042b)[_0xd5a3('0x18')](_0x27f440);}};}function respondWithFilteredResult(_0xc20d27,_0xd5f47){return function(_0xb9002b){if(_0xb9002b){var _0x5c9f3c=typeof _0xd5f47[_0xd5a3('0x19')]===_0xd5a3('0x1a')&&typeof _0xd5f47[_0xd5a3('0x1b')]==='undefined';var _0x350bb1=_0xb9002b[_0xd5a3('0x1c')];var _0x3074d2=_0x5c9f3c?0x0:_0xd5f47['offset'];var _0x40fb61=_0x5c9f3c?_0xb9002b[_0xd5a3('0x1c')]:_0xd5f47[_0xd5a3('0x19')]+_0xd5f47[_0xd5a3('0x1b')];var _0x151a86;if(_0x40fb61>=_0x350bb1){_0x40fb61=_0x350bb1;_0x151a86=0xc8;}else{_0x151a86=0xce;}_0xc20d27[_0xd5a3('0x17')](_0x151a86);return _0xc20d27[_0xd5a3('0x1d')](_0xd5a3('0x1e'),_0x3074d2+'-'+_0x40fb61+'/'+_0x350bb1)[_0xd5a3('0x18')](_0xb9002b);}return null;};}function patchUpdates(_0x18bdad){return function(_0x1d6bdf){try{jsonpatch[_0xd5a3('0x1f')](_0x1d6bdf,_0x18bdad,!![]);}catch(_0x7322d2){return BPromise[_0xd5a3('0x20')](_0x7322d2);}return _0x1d6bdf[_0xd5a3('0x21')]();};}function saveUpdates(_0x1ff2de,_0x35f5eb){return function(_0x242165){if(_0x242165){return _0x242165[_0xd5a3('0x22')](_0x1ff2de)['then'](function(_0x2ec901){return _0x2ec901;});}return null;};}function removeEntity(_0x4c9461,_0x46ffa9){return function(_0x4e5d68){if(_0x4e5d68){return _0x4e5d68[_0xd5a3('0x23')]()[_0xd5a3('0x24')](function(){_0x4c9461[_0xd5a3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x350686,_0x4b30cb){return function(_0x5c8ef1){if(!_0x5c8ef1){_0x350686['sendStatus'](0x194);}return _0x5c8ef1;};}function handleError(_0x24bbd8,_0x452d51){_0x452d51=_0x452d51||0x1f4;return function(_0x165f52){logger['error'](_0x165f52[_0xd5a3('0x25')]);if(_0x165f52[_0xd5a3('0x26')]){delete _0x165f52[_0xd5a3('0x26')];}_0x24bbd8[_0xd5a3('0x17')](_0x452d51)[_0xd5a3('0x27')](_0x165f52);};}exports[_0xd5a3('0x28')]=function(_0x412755,_0x5806d7){var _0x4472dd={},_0xd7abd1={},_0x119344={'count':0x0,'rows':[]};var _0x5216ef=_[_0xd5a3('0x29')](db[_0xd5a3('0x2a')]['rawAttributes'],function(_0x49dae1){return{'name':_0x49dae1[_0xd5a3('0x2b')],'type':_0x49dae1[_0xd5a3('0x2c')][_0xd5a3('0x2d')]};});_0xd7abd1[_0xd5a3('0x2e')]=_['map'](_0x5216ef,_0xd5a3('0x26'));_0xd7abd1[_0xd5a3('0x2f')]=_['keys'](_0x412755['query']);_0xd7abd1[_0xd5a3('0x30')]=_['intersection'](_0xd7abd1['model'],_0xd7abd1[_0xd5a3('0x2f')]);_0x4472dd[_0xd5a3('0x31')]=_['intersection'](_0xd7abd1['model'],qs[_0xd5a3('0x32')](_0x412755[_0xd5a3('0x2f')][_0xd5a3('0x32')]));_0x4472dd[_0xd5a3('0x31')]=_0x4472dd[_0xd5a3('0x31')][_0xd5a3('0x33')]?_0x4472dd['attributes']:_0xd7abd1[_0xd5a3('0x2e')];if(!_0x412755[_0xd5a3('0x2f')]['hasOwnProperty']('nolimit')){_0x4472dd[_0xd5a3('0x1b')]=qs['limit'](_0x412755[_0xd5a3('0x2f')][_0xd5a3('0x1b')]);_0x4472dd[_0xd5a3('0x19')]=qs[_0xd5a3('0x19')](_0x412755[_0xd5a3('0x2f')]['offset']);}_0x4472dd[_0xd5a3('0x34')]=qs['sort'](_0x412755[_0xd5a3('0x2f')][_0xd5a3('0x35')]);_0x4472dd['where']=qs[_0xd5a3('0x30')](_[_0xd5a3('0x36')](_0x412755['query'],_0xd7abd1[_0xd5a3('0x30')]),_0x5216ef);if(_0x412755[_0xd5a3('0x2f')][_0xd5a3('0x37')]){_0x4472dd['where']=_[_0xd5a3('0x38')](_0x4472dd['where'],{'$or':_['map'](_0x5216ef,function(_0x348e50){if(_0x348e50[_0xd5a3('0x2c')]!==_0xd5a3('0x39')){var _0xcbde74={};_0xcbde74[_0x348e50['name']]={'$like':'%'+_0x412755[_0xd5a3('0x2f')][_0xd5a3('0x37')]+'%'};return _0xcbde74;}})});}_0x4472dd=_[_0xd5a3('0x38')]({},_0x4472dd,_0x412755[_0xd5a3('0x3a')]);var _0x3a1342={'where':_0x4472dd[_0xd5a3('0x3b')]};return db[_0xd5a3('0x2a')][_0xd5a3('0x1c')](_0x3a1342)[_0xd5a3('0x24')](function(_0x5c28ad){_0x119344[_0xd5a3('0x1c')]=_0x5c28ad;if(_0x412755[_0xd5a3('0x2f')]['includeAll']){_0x4472dd[_0xd5a3('0x3c')]=[{'all':!![]}];}return db[_0xd5a3('0x2a')][_0xd5a3('0x3d')](_0x4472dd);})[_0xd5a3('0x24')](function(_0x163352){_0x119344[_0xd5a3('0x3e')]=_0x163352;return _0x119344;})[_0xd5a3('0x24')](respondWithFilteredResult(_0x5806d7,_0x4472dd))[_0xd5a3('0x3f')](handleError(_0x5806d7,null));};exports['show']=function(_0x250368,_0x45d01f){var _0xa0d131={'raw':!![],'where':{'id':_0x250368['params']['id']}},_0x1e578b={};_0x1e578b[_0xd5a3('0x2e')]=_[_0xd5a3('0x40')](db[_0xd5a3('0x2a')][_0xd5a3('0x41')]);_0x1e578b['query']=_[_0xd5a3('0x40')](_0x250368['query']);_0x1e578b[_0xd5a3('0x30')]=_[_0xd5a3('0x42')](_0x1e578b[_0xd5a3('0x2e')],_0x1e578b[_0xd5a3('0x2f')]);_0xa0d131[_0xd5a3('0x31')]=_['intersection'](_0x1e578b['model'],qs[_0xd5a3('0x32')](_0x250368['query'][_0xd5a3('0x32')]));_0xa0d131['attributes']=_0xa0d131[_0xd5a3('0x31')][_0xd5a3('0x33')]?_0xa0d131[_0xd5a3('0x31')]:_0x1e578b[_0xd5a3('0x2e')];if(_0x250368[_0xd5a3('0x2f')][_0xd5a3('0x43')]){_0xa0d131[_0xd5a3('0x3c')]=[{'all':!![]}];}_0xa0d131=_[_0xd5a3('0x38')]({},_0xa0d131,_0x250368[_0xd5a3('0x3a')]);return db[_0xd5a3('0x2a')][_0xd5a3('0x44')](_0xa0d131)[_0xd5a3('0x24')](handleEntityNotFound(_0x45d01f,null))['then'](respondWithResult(_0x45d01f,null))[_0xd5a3('0x3f')](handleError(_0x45d01f,null));};exports[_0xd5a3('0x45')]=function(_0x337bd4,_0x1413cf){return db['SmsQueueReport'][_0xd5a3('0x45')](_0x337bd4[_0xd5a3('0x46')],{})[_0xd5a3('0x24')](respondWithResult(_0x1413cf,0xc9))[_0xd5a3('0x3f')](handleError(_0x1413cf,null));};exports[_0xd5a3('0x22')]=function(_0xfeac76,_0x2dfe79){if(_0xfeac76['body']['id']){delete _0xfeac76[_0xd5a3('0x46')]['id'];}return db['SmsQueueReport'][_0xd5a3('0x44')]({'where':{'id':_0xfeac76[_0xd5a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x2dfe79,null))[_0xd5a3('0x24')](saveUpdates(_0xfeac76[_0xd5a3('0x46')],null))[_0xd5a3('0x24')](respondWithResult(_0x2dfe79,null))[_0xd5a3('0x3f')](handleError(_0x2dfe79,null));};exports['destroy']=function(_0x10d85c,_0x57fcd4){return db['SmsQueueReport'][_0xd5a3('0x44')]({'where':{'id':_0x10d85c['params']['id']}})[_0xd5a3('0x24')](handleEntityNotFound(_0x57fcd4,null))['then'](removeEntity(_0x57fcd4,null))[_0xd5a3('0x3f')](handleError(_0x57fcd4,null));};exports[_0xd5a3('0x48')]=function(_0x44cc46,_0x34cae3){return db[_0xd5a3('0x2a')][_0xd5a3('0x48')]()[_0xd5a3('0x24')](respondWithResult(_0x34cae3,null))[_0xd5a3('0x3f')](handleError(_0x34cae3,null));}; \ No newline at end of file +var _0x4599=['params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','include','catch','show'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x4599,0x1d4));var _0x9459=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4599[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x9459('0x0'));var rimraf=require(_0x9459('0x1'));var zipdir=require(_0x9459('0x2'));var jsonpatch=require(_0x9459('0x3'));var rp=require(_0x9459('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9459('0x5'));var util=require(_0x9459('0x6'));var path=require(_0x9459('0x7'));var sox=require(_0x9459('0x8'));var csv=require(_0x9459('0x9'));var ejs=require(_0x9459('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9459('0xb'));var crypto=require(_0x9459('0xc'));var jsforce=require(_0x9459('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9459('0x9'));var querystring=require(_0x9459('0xe'));var Papa=require(_0x9459('0xf'));var Redis=require(_0x9459('0x10'));var authService=require(_0x9459('0x11'));var qs=require(_0x9459('0x12'));var as=require(_0x9459('0x13'));var hardwareService=require(_0x9459('0x14'));var logger=require(_0x9459('0x15'))(_0x9459('0x16'));var utils=require(_0x9459('0x17'));var config=require(_0x9459('0x18'));var licenseUtil=require(_0x9459('0x19'));var db=require(_0x9459('0x1a'))['db'];function respondWithStatusCode(_0x3dbf5e,_0x3b23ad){_0x3b23ad=_0x3b23ad||0xcc;return function(_0x3173ab){if(_0x3173ab){return _0x3dbf5e[_0x9459('0x1b')](_0x3b23ad);}return _0x3dbf5e[_0x9459('0x1c')](_0x3b23ad)[_0x9459('0x1d')]();};}function respondWithResult(_0x459591,_0x5db018){_0x5db018=_0x5db018||0xc8;return function(_0x36bfc9){if(_0x36bfc9){return _0x459591[_0x9459('0x1c')](_0x5db018)[_0x9459('0x1e')](_0x36bfc9);}};}function respondWithFilteredResult(_0x58efc6,_0x5cda44){return function(_0x28002b){if(_0x28002b){var _0x447f37=typeof _0x5cda44['offset']===_0x9459('0x1f')&&typeof _0x5cda44['limit']===_0x9459('0x1f');var _0x553c71=_0x28002b[_0x9459('0x20')];var _0x3278ef=_0x447f37?0x0:_0x5cda44[_0x9459('0x21')];var _0x4aed55=_0x447f37?_0x28002b[_0x9459('0x20')]:_0x5cda44[_0x9459('0x21')]+_0x5cda44['limit'];var _0xe93f19;if(_0x4aed55>=_0x553c71){_0x4aed55=_0x553c71;_0xe93f19=0xc8;}else{_0xe93f19=0xce;}_0x58efc6['status'](_0xe93f19);return _0x58efc6['set'](_0x9459('0x22'),_0x3278ef+'-'+_0x4aed55+'/'+_0x553c71)['json'](_0x28002b);}return null;};}function patchUpdates(_0x1760ee){return function(_0x49116e){try{jsonpatch[_0x9459('0x23')](_0x49116e,_0x1760ee,!![]);}catch(_0xdd8a5b){return BPromise['reject'](_0xdd8a5b);}return _0x49116e['save']();};}function saveUpdates(_0x454f97,_0x527c8e){return function(_0x2df75b){if(_0x2df75b){return _0x2df75b[_0x9459('0x24')](_0x454f97)[_0x9459('0x25')](function(_0x1cf956){return _0x1cf956;});}return null;};}function removeEntity(_0xdd875b,_0x3e5f57){return function(_0x5c1a1a){if(_0x5c1a1a){return _0x5c1a1a[_0x9459('0x26')]()['then'](function(){_0xdd875b[_0x9459('0x1c')](0xcc)[_0x9459('0x1d')]();});}};}function handleEntityNotFound(_0x495a34,_0x70088c){return function(_0x44455e){if(!_0x44455e){_0x495a34['sendStatus'](0x194);}return _0x44455e;};}function handleError(_0xa45316,_0x37d62c){_0x37d62c=_0x37d62c||0x1f4;return function(_0x59e128){logger[_0x9459('0x27')](_0x59e128[_0x9459('0x28')]);if(_0x59e128[_0x9459('0x29')]){delete _0x59e128[_0x9459('0x29')];}_0xa45316['status'](_0x37d62c)[_0x9459('0x2a')](_0x59e128);};}exports[_0x9459('0x2b')]=function(_0x143e42,_0x546963){var _0x3e9392={},_0x2dbe1f={},_0x3d3e5b={'count':0x0,'rows':[]};var _0x2151ec=_[_0x9459('0x2c')](db[_0x9459('0x2d')][_0x9459('0x2e')],function(_0x1623bc){return{'name':_0x1623bc[_0x9459('0x2f')],'type':_0x1623bc[_0x9459('0x30')][_0x9459('0x31')]};});_0x2dbe1f[_0x9459('0x32')]=_[_0x9459('0x2c')](_0x2151ec,'name');_0x2dbe1f[_0x9459('0x33')]=_[_0x9459('0x34')](_0x143e42['query']);_0x2dbe1f[_0x9459('0x35')]=_['intersection'](_0x2dbe1f['model'],_0x2dbe1f[_0x9459('0x33')]);_0x3e9392[_0x9459('0x36')]=_[_0x9459('0x37')](_0x2dbe1f[_0x9459('0x32')],qs['fields'](_0x143e42[_0x9459('0x33')][_0x9459('0x38')]));_0x3e9392[_0x9459('0x36')]=_0x3e9392['attributes'][_0x9459('0x39')]?_0x3e9392['attributes']:_0x2dbe1f[_0x9459('0x32')];if(!_0x143e42[_0x9459('0x33')][_0x9459('0x3a')](_0x9459('0x3b'))){_0x3e9392[_0x9459('0x3c')]=qs[_0x9459('0x3c')](_0x143e42[_0x9459('0x33')]['limit']);_0x3e9392[_0x9459('0x21')]=qs[_0x9459('0x21')](_0x143e42[_0x9459('0x33')]['offset']);}_0x3e9392['order']=qs[_0x9459('0x3d')](_0x143e42[_0x9459('0x33')][_0x9459('0x3d')]);_0x3e9392['where']=qs[_0x9459('0x35')](_[_0x9459('0x3e')](_0x143e42[_0x9459('0x33')],_0x2dbe1f[_0x9459('0x35')]),_0x2151ec);if(_0x143e42[_0x9459('0x33')][_0x9459('0x3f')]){_0x3e9392[_0x9459('0x40')]=_[_0x9459('0x41')](_0x3e9392['where'],{'$or':_['map'](_0x2151ec,function(_0x5d9415){if(_0x5d9415[_0x9459('0x30')]!==_0x9459('0x42')){var _0x29d470={};_0x29d470[_0x5d9415[_0x9459('0x29')]]={'$like':'%'+_0x143e42[_0x9459('0x33')][_0x9459('0x3f')]+'%'};return _0x29d470;}})});}_0x3e9392=_[_0x9459('0x41')]({},_0x3e9392,_0x143e42[_0x9459('0x43')]);var _0x260902={'where':_0x3e9392[_0x9459('0x40')]};return db[_0x9459('0x2d')]['count'](_0x260902)[_0x9459('0x25')](function(_0x1cac18){_0x3d3e5b[_0x9459('0x20')]=_0x1cac18;if(_0x143e42[_0x9459('0x33')]['includeAll']){_0x3e9392[_0x9459('0x44')]=[{'all':!![]}];}return db[_0x9459('0x2d')]['findAll'](_0x3e9392);})['then'](function(_0xcdd98){_0x3d3e5b['rows']=_0xcdd98;return _0x3d3e5b;})[_0x9459('0x25')](respondWithFilteredResult(_0x546963,_0x3e9392))[_0x9459('0x45')](handleError(_0x546963,null));};exports[_0x9459('0x46')]=function(_0x5ea0c4,_0x3e7533){var _0x202489={'raw':!![],'where':{'id':_0x5ea0c4[_0x9459('0x47')]['id']}},_0x3014e3={};_0x3014e3['model']=_[_0x9459('0x34')](db[_0x9459('0x2d')][_0x9459('0x2e')]);_0x3014e3[_0x9459('0x33')]=_[_0x9459('0x34')](_0x5ea0c4[_0x9459('0x33')]);_0x3014e3[_0x9459('0x35')]=_[_0x9459('0x37')](_0x3014e3[_0x9459('0x32')],_0x3014e3[_0x9459('0x33')]);_0x202489['attributes']=_[_0x9459('0x37')](_0x3014e3['model'],qs['fields'](_0x5ea0c4[_0x9459('0x33')][_0x9459('0x38')]));_0x202489[_0x9459('0x36')]=_0x202489[_0x9459('0x36')][_0x9459('0x39')]?_0x202489[_0x9459('0x36')]:_0x3014e3[_0x9459('0x32')];if(_0x5ea0c4[_0x9459('0x33')][_0x9459('0x48')]){_0x202489[_0x9459('0x44')]=[{'all':!![]}];}_0x202489=_[_0x9459('0x41')]({},_0x202489,_0x5ea0c4[_0x9459('0x43')]);return db[_0x9459('0x2d')][_0x9459('0x49')](_0x202489)[_0x9459('0x25')](handleEntityNotFound(_0x3e7533,null))[_0x9459('0x25')](respondWithResult(_0x3e7533,null))[_0x9459('0x45')](handleError(_0x3e7533,null));};exports[_0x9459('0x4a')]=function(_0x3fa002,_0x3ee9cd){return db[_0x9459('0x2d')]['create'](_0x3fa002[_0x9459('0x4b')],{})['then'](respondWithResult(_0x3ee9cd,0xc9))['catch'](handleError(_0x3ee9cd,null));};exports[_0x9459('0x24')]=function(_0x20cbcc,_0x1c23fa){if(_0x20cbcc['body']['id']){delete _0x20cbcc[_0x9459('0x4b')]['id'];}return db['SmsQueueReport'][_0x9459('0x49')]({'where':{'id':_0x20cbcc[_0x9459('0x47')]['id']}})[_0x9459('0x25')](handleEntityNotFound(_0x1c23fa,null))['then'](saveUpdates(_0x20cbcc[_0x9459('0x4b')],null))[_0x9459('0x25')](respondWithResult(_0x1c23fa,null))[_0x9459('0x45')](handleError(_0x1c23fa,null));};exports[_0x9459('0x26')]=function(_0x5e7ed7,_0xb10dc0){return db['SmsQueueReport'][_0x9459('0x49')]({'where':{'id':_0x5e7ed7['params']['id']}})[_0x9459('0x25')](handleEntityNotFound(_0xb10dc0,null))[_0x9459('0x25')](removeEntity(_0xb10dc0,null))[_0x9459('0x45')](handleError(_0xb10dc0,null));};exports[_0x9459('0x4c')]=function(_0x2b1a2d,_0x2f081f){return db[_0x9459('0x2d')][_0x9459('0x4c')]()[_0x9459('0x25')](respondWithResult(_0x2f081f,null))['catch'](handleError(_0x2f081f,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 123ef32..2181d51 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1e476f,_0x42bbd9){var _0x5699db=function(_0x60311e){while(--_0x60311e){_0x1e476f['push'](_0x1e476f['shift']());}};_0x5699db(++_0x42bbd9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xcb91[_0x80d733];return _0x435868;};'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 1293b3e..6cc7537 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 _0x64b1=['error','code','message','result','catch','CreateSmsQueueReport','options','UpdateSmsQueueReport','SmsQueueReport','update','raw','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x266db6,_0x395981){var _0xab3177=function(_0x59f3bd){while(--_0x59f3bd){_0x266db6['push'](_0x266db6['shift']());}};_0xab3177(++_0x395981);}(_0x64b1,0x1b1));var _0x164b=function(_0xf9a6ba,_0x5c1324){_0xf9a6ba=_0xf9a6ba-0x0;var _0x473b9c=_0x64b1[_0xf9a6ba];return _0x473b9c;};'use strict';var _=require('lodash');var util=require(_0x164b('0x0'));var moment=require(_0x164b('0x1'));var BPromise=require(_0x164b('0x2'));var rs=require(_0x164b('0x3'));var fs=require('fs');var Redis=require(_0x164b('0x4'));var db=require(_0x164b('0x5'))['db'];var utils=require(_0x164b('0x6'));var logger=require(_0x164b('0x7'))(_0x164b('0x8'));var config=require('../../config/environment');var jayson=require(_0x164b('0x9'));var client=jayson['client'][_0x164b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x84d210,_0x408558,_0x225325){return new BPromise(function(_0x515245,_0x53c9e3){return client[_0x164b('0xb')](_0x84d210,_0x225325)[_0x164b('0xc')](function(_0x17dc6b){logger[_0x164b('0xd')](_0x164b('0xe'),_0x408558,_0x164b('0xf'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x408558,_0x164b('0xf'),JSON[_0x164b('0x10')](_0x17dc6b));if(_0x17dc6b['error']){if(_0x17dc6b[_0x164b('0x11')][_0x164b('0x12')]===0x1f4){logger[_0x164b('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x408558,_0x17dc6b[_0x164b('0x11')][_0x164b('0x13')]);return _0x53c9e3(_0x17dc6b[_0x164b('0x11')][_0x164b('0x13')]);}logger[_0x164b('0x11')](_0x164b('0xe'),_0x408558,_0x17dc6b['error'][_0x164b('0x13')]);return _0x515245(_0x17dc6b[_0x164b('0x11')][_0x164b('0x13')]);}else{logger['info'](_0x164b('0xe'),_0x408558,_0x164b('0xf'));_0x515245(_0x17dc6b[_0x164b('0x14')][_0x164b('0x13')]);}})[_0x164b('0x15')](function(_0x24a490){logger[_0x164b('0x11')](_0x164b('0xe'),_0x408558,_0x24a490);_0x53c9e3(_0x24a490);});});}exports[_0x164b('0x16')]=function(_0x46d846){var _0x3c797d=this;return new Promise(function(_0x896907,_0x2f5255){return db['SmsQueueReport']['create'](_0x46d846['body'],{'raw':_0x46d846[_0x164b('0x17')]?_0x46d846[_0x164b('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x27295e){logger['info'](_0x164b('0x16'),_0x46d846);logger['debug'](_0x164b('0x16'),_0x46d846,JSON[_0x164b('0x10')](_0x27295e));_0x896907(_0x27295e);})[_0x164b('0x15')](function(_0x3f9751){logger[_0x164b('0x11')](_0x164b('0x16'),_0x3f9751[_0x164b('0x13')],_0x46d846);_0x2f5255(_0x3c797d[_0x164b('0x11')](0x1f4,_0x3f9751[_0x164b('0x13')]));});});};exports[_0x164b('0x18')]=function(_0x267ddb){var _0x4a33d4=this;return new Promise(function(_0x155200,_0x8a248d){return db[_0x164b('0x19')][_0x164b('0x1a')](_0x267ddb['body'],{'raw':_0x267ddb[_0x164b('0x17')]?_0x267ddb[_0x164b('0x17')][_0x164b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x267ddb[_0x164b('0x17')]?_0x267ddb['options']['where']||null:null,'attributes':_0x267ddb[_0x164b('0x17')]?_0x267ddb[_0x164b('0x17')][_0x164b('0x1c')]||null:null,'limit':_0x267ddb[_0x164b('0x17')]?_0x267ddb[_0x164b('0x17')][_0x164b('0x1d')]||null:null})[_0x164b('0xc')](function(_0x2c73ad){logger[_0x164b('0xd')](_0x164b('0x18'),_0x267ddb);logger['debug'](_0x164b('0x18'),_0x267ddb,JSON[_0x164b('0x10')](_0x2c73ad));_0x155200(_0x2c73ad);})['catch'](function(_0x41e9f5){logger[_0x164b('0x11')]('UpdateSmsQueueReport',_0x41e9f5[_0x164b('0x13')],_0x267ddb);_0x8a248d(_0x4a33d4[_0x164b('0x11')](0x1f4,_0x41e9f5[_0x164b('0x13')]));});});}; \ No newline at end of file +var _0xca8d=['SmsQueueReport','create','body','options','stringify','update','raw','where','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','SmsQueueReport,\x20%s,\x20%s','debug','error','code','message','info','result','catch','CreateSmsQueueReport'];(function(_0x307911,_0xa7cf0f){var _0x4cb3cf=function(_0x127dd2){while(--_0x127dd2){_0x307911['push'](_0x307911['shift']());}};_0x4cb3cf(++_0xa7cf0f);}(_0xca8d,0xc4));var _0xdca8=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xca8d[_0x44c768];return _0x55daf5;};'use strict';var _=require(_0xdca8('0x0'));var util=require(_0xdca8('0x1'));var moment=require(_0xdca8('0x2'));var BPromise=require(_0xdca8('0x3'));var rs=require(_0xdca8('0x4'));var fs=require('fs');var Redis=require(_0xdca8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdca8('0x6'));var logger=require(_0xdca8('0x7'))('rpc');var config=require(_0xdca8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdca8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x342146,_0x129999,_0x1fb6ce){return new BPromise(function(_0x3990a1,_0x591f9b){return client[_0xdca8('0xa')](_0x342146,_0x1fb6ce)[_0xdca8('0xb')](function(_0x2e5e24){logger['info'](_0xdca8('0xc'),_0x129999,'request\x20sent');logger[_0xdca8('0xd')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x129999,'request\x20sent',JSON['stringify'](_0x2e5e24));if(_0x2e5e24[_0xdca8('0xe')]){if(_0x2e5e24['error'][_0xdca8('0xf')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x129999,_0x2e5e24[_0xdca8('0xe')]['message']);return _0x591f9b(_0x2e5e24['error'][_0xdca8('0x10')]);}logger[_0xdca8('0xe')](_0xdca8('0xc'),_0x129999,_0x2e5e24['error']['message']);return _0x3990a1(_0x2e5e24[_0xdca8('0xe')][_0xdca8('0x10')]);}else{logger[_0xdca8('0x11')](_0xdca8('0xc'),_0x129999,'request\x20sent');_0x3990a1(_0x2e5e24[_0xdca8('0x12')][_0xdca8('0x10')]);}})[_0xdca8('0x13')](function(_0x5a5d2e){logger[_0xdca8('0xe')](_0xdca8('0xc'),_0x129999,_0x5a5d2e);_0x591f9b(_0x5a5d2e);});});}exports[_0xdca8('0x14')]=function(_0x3f50f3){var _0x3d073e=this;return new Promise(function(_0x360398,_0x474228){return db[_0xdca8('0x15')][_0xdca8('0x16')](_0x3f50f3[_0xdca8('0x17')],{'raw':_0x3f50f3[_0xdca8('0x18')]?_0x3f50f3[_0xdca8('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xdca8('0xb')](function(_0x4f52d9){logger[_0xdca8('0x11')](_0xdca8('0x14'),_0x3f50f3);logger[_0xdca8('0xd')](_0xdca8('0x14'),_0x3f50f3,JSON[_0xdca8('0x19')](_0x4f52d9));_0x360398(_0x4f52d9);})[_0xdca8('0x13')](function(_0x5805e2){logger['error'](_0xdca8('0x14'),_0x5805e2['message'],_0x3f50f3);_0x474228(_0x3d073e['error'](0x1f4,_0x5805e2['message']));});});};exports['UpdateSmsQueueReport']=function(_0x316429){var _0x349da4=this;return new Promise(function(_0x30d817,_0x4b7843){return db[_0xdca8('0x15')][_0xdca8('0x1a')](_0x316429[_0xdca8('0x17')],{'raw':_0x316429['options']?_0x316429[_0xdca8('0x18')][_0xdca8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316429[_0xdca8('0x18')]?_0x316429[_0xdca8('0x18')][_0xdca8('0x1c')]||null:null,'attributes':_0x316429['options']?_0x316429['options']['attributes']||null:null,'limit':_0x316429['options']?_0x316429[_0xdca8('0x18')][_0xdca8('0x1d')]||null:null})[_0xdca8('0xb')](function(_0x10f0c4){logger['info']('UpdateSmsQueueReport',_0x316429);logger[_0xdca8('0xd')](_0xdca8('0x1e'),_0x316429,JSON[_0xdca8('0x19')](_0x10f0c4));_0x30d817(_0x10f0c4);})[_0xdca8('0x13')](function(_0x4bdcc9){logger[_0xdca8('0xe')](_0xdca8('0x1e'),_0x4bdcc9[_0xdca8('0x10')],_0x316429);_0x4b7843(_0x349da4[_0xdca8('0xe')](0x1f4,_0x4bdcc9[_0xdca8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 00d19a4..c5740b3 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 _0xf987=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x22fdcb,_0x2fdbcd){var _0x262dcc=function(_0x48fade){while(--_0x48fade){_0x22fdcb['push'](_0x22fdcb['shift']());}};_0x262dcc(++_0x2fdbcd);}(_0xf987,0x18a));var _0x7f98=function(_0x324444,_0xd48479){_0x324444=_0x324444-0x0;var _0x3dae3b=_0xf987[_0x324444];return _0x3dae3b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7f98('0x0'));var timeout=require(_0x7f98('0x1'));var express=require('express');var router=express[_0x7f98('0x2')]();var fs_extra=require(_0x7f98('0x3'));var auth=require(_0x7f98('0x4'));var interaction=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var controller=require(_0x7f98('0x7'));router[_0x7f98('0x8')]('/',auth[_0x7f98('0x9')](),controller[_0x7f98('0xa')]);router[_0x7f98('0x8')](_0x7f98('0xb'),auth[_0x7f98('0x9')](),controller['describe']);router[_0x7f98('0x8')](_0x7f98('0xc'),auth[_0x7f98('0x9')](),controller[_0x7f98('0xd')]);router[_0x7f98('0xe')]('/',auth['isAuthenticated'](),controller[_0x7f98('0xf')]);router['put']('/:id',auth[_0x7f98('0x9')](),controller[_0x7f98('0x10')]);router[_0x7f98('0x11')](_0x7f98('0xc'),auth['isAuthenticated'](),controller[_0x7f98('0x12')]);module['exports']=router; \ No newline at end of file +var _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0xca9e,0x136));var _0xeca9=function(_0x1278cd,_0x3e68f2){_0x1278cd=_0x1278cd-0x0;var _0x4c1911=_0xca9e[_0x1278cd];return _0x4c1911;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 281db5f..72487fa 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x362d6a,_0x253e0d){var _0x2af49e=function(_0x4a43f8){while(--_0x4a43f8){_0x362d6a['push'](_0x362d6a['shift']());}};_0x2af49e(++_0x253e0d);}(_0x54ef,0x112));var _0xf54e=function(_0x24c8ac,_0x59adab){_0x24c8ac=_0x24c8ac-0x0;var _0x3bf0e0=_0x54ef[_0x24c8ac];return _0x3bf0e0;};'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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x1dc07d,_0x23b299){var _0x329bdc=function(_0x4a9a60){while(--_0x4a9a60){_0x1dc07d['push'](_0x1dc07d['shift']());}};_0x329bdc(++_0x23b299);}(_0xe706,0xa3));var _0x6e70=function(_0x566760,_0x1f7104){_0x566760=_0x566760-0x0;var _0x30ca6d=_0xe706[_0x566760];return _0x30ca6d;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index cb63877..09ad0ce 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 _0x9328=['includeAll','findAll','rows','catch','show','params','include','find','create','body','update','destroy','describe','eml-format','rimraf','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','end','error','stack','name','send','SmsTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x27e008,_0x1829e1){var _0x4d293a=function(_0x4b9271){while(--_0x4b9271){_0x27e008['push'](_0x27e008['shift']());}};_0x4d293a(++_0x1829e1);}(_0x9328,0x19d));var _0x8932=function(_0x4d6180,_0x1d986d){_0x4d6180=_0x4d6180-0x0;var _0x20dc6c=_0x9328[_0x4d6180];return _0x20dc6c;};'use strict';var emlformat=require(_0x8932('0x0'));var rimraf=require(_0x8932('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8932('0x2'));var rp=require(_0x8932('0x3'));var moment=require(_0x8932('0x4'));var BPromise=require(_0x8932('0x5'));var Mustache=require(_0x8932('0x6'));var util=require(_0x8932('0x7'));var path=require(_0x8932('0x8'));var sox=require(_0x8932('0x9'));var csv=require(_0x8932('0xa'));var ejs=require(_0x8932('0xb'));var fs=require('fs');var fs_extra=require(_0x8932('0xc'));var _=require(_0x8932('0xd'));var squel=require(_0x8932('0xe'));var crypto=require('crypto');var jsforce=require(_0x8932('0xf'));var deskjs=require(_0x8932('0x10'));var toCsv=require(_0x8932('0xa'));var querystring=require(_0x8932('0x11'));var Papa=require(_0x8932('0x12'));var Redis=require(_0x8932('0x13'));var authService=require(_0x8932('0x14'));var qs=require(_0x8932('0x15'));var as=require(_0x8932('0x16'));var hardwareService=require(_0x8932('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x8932('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8932('0x19'));var db=require(_0x8932('0x1a'))['db'];function respondWithStatusCode(_0x38c757,_0x52e8af){_0x52e8af=_0x52e8af||0xcc;return function(_0x425d9d){if(_0x425d9d){return _0x38c757[_0x8932('0x1b')](_0x52e8af);}return _0x38c757[_0x8932('0x1c')](_0x52e8af)['end']();};}function respondWithResult(_0x1b7e3f,_0x2217fc){_0x2217fc=_0x2217fc||0xc8;return function(_0x284256){if(_0x284256){return _0x1b7e3f['status'](_0x2217fc)['json'](_0x284256);}};}function respondWithFilteredResult(_0x5bd13d,_0x50e000){return function(_0xc0762d){if(_0xc0762d){var _0x55c19b=typeof _0x50e000[_0x8932('0x1d')]===_0x8932('0x1e')&&typeof _0x50e000['limit']===_0x8932('0x1e');var _0xff42d5=_0xc0762d['count'];var _0x3495af=_0x55c19b?0x0:_0x50e000['offset'];var _0x51082d=_0x55c19b?_0xc0762d[_0x8932('0x1f')]:_0x50e000[_0x8932('0x1d')]+_0x50e000[_0x8932('0x20')];var _0x19dbea;if(_0x51082d>=_0xff42d5){_0x51082d=_0xff42d5;_0x19dbea=0xc8;}else{_0x19dbea=0xce;}_0x5bd13d['status'](_0x19dbea);return _0x5bd13d[_0x8932('0x21')](_0x8932('0x22'),_0x3495af+'-'+_0x51082d+'/'+_0xff42d5)[_0x8932('0x23')](_0xc0762d);}return null;};}function patchUpdates(_0x781e2f){return function(_0x30682b){try{jsonpatch[_0x8932('0x24')](_0x30682b,_0x781e2f,!![]);}catch(_0x3cf286){return BPromise['reject'](_0x3cf286);}return _0x30682b[_0x8932('0x25')]();};}function saveUpdates(_0x401366,_0x34b54b){return function(_0x456f91){if(_0x456f91){return _0x456f91['update'](_0x401366)[_0x8932('0x26')](function(_0x31a038){return _0x31a038;});}return null;};}function removeEntity(_0x26e02d,_0x5ab93b){return function(_0x16a184){if(_0x16a184){return _0x16a184['destroy']()[_0x8932('0x26')](function(){_0x26e02d[_0x8932('0x1c')](0xcc)[_0x8932('0x27')]();});}};}function handleEntityNotFound(_0x1d3924,_0x3dd74a){return function(_0x45fc8d){if(!_0x45fc8d){_0x1d3924[_0x8932('0x1b')](0x194);}return _0x45fc8d;};}function handleError(_0x30a3f3,_0x20d5e1){_0x20d5e1=_0x20d5e1||0x1f4;return function(_0x2f79bb){logger[_0x8932('0x28')](_0x2f79bb[_0x8932('0x29')]);if(_0x2f79bb[_0x8932('0x2a')]){delete _0x2f79bb[_0x8932('0x2a')];}_0x30a3f3[_0x8932('0x1c')](_0x20d5e1)[_0x8932('0x2b')](_0x2f79bb);};}exports['index']=function(_0x21fca9,_0xcd7869){var _0x32bcae={},_0x53d9c7={},_0x303305={'count':0x0,'rows':[]};var _0x5c9e36=_['map'](db[_0x8932('0x2c')][_0x8932('0x2d')],function(_0x1d13d0){return{'name':_0x1d13d0[_0x8932('0x2e')],'type':_0x1d13d0['type'][_0x8932('0x2f')]};});_0x53d9c7[_0x8932('0x30')]=_[_0x8932('0x31')](_0x5c9e36,'name');_0x53d9c7[_0x8932('0x32')]=_[_0x8932('0x33')](_0x21fca9[_0x8932('0x32')]);_0x53d9c7[_0x8932('0x34')]=_[_0x8932('0x35')](_0x53d9c7[_0x8932('0x30')],_0x53d9c7[_0x8932('0x32')]);_0x32bcae[_0x8932('0x36')]=_['intersection'](_0x53d9c7[_0x8932('0x30')],qs[_0x8932('0x37')](_0x21fca9[_0x8932('0x32')][_0x8932('0x37')]));_0x32bcae[_0x8932('0x36')]=_0x32bcae[_0x8932('0x36')][_0x8932('0x38')]?_0x32bcae[_0x8932('0x36')]:_0x53d9c7[_0x8932('0x30')];if(!_0x21fca9['query'][_0x8932('0x39')](_0x8932('0x3a'))){_0x32bcae[_0x8932('0x20')]=qs['limit'](_0x21fca9[_0x8932('0x32')][_0x8932('0x20')]);_0x32bcae['offset']=qs['offset'](_0x21fca9[_0x8932('0x32')][_0x8932('0x1d')]);}_0x32bcae['order']=qs[_0x8932('0x3b')](_0x21fca9['query']['sort']);_0x32bcae[_0x8932('0x3c')]=qs[_0x8932('0x34')](_[_0x8932('0x3d')](_0x21fca9[_0x8932('0x32')],_0x53d9c7[_0x8932('0x34')]),_0x5c9e36);if(_0x21fca9[_0x8932('0x32')][_0x8932('0x3e')]){_0x32bcae['where']=_[_0x8932('0x3f')](_0x32bcae[_0x8932('0x3c')],{'$or':_[_0x8932('0x31')](_0x5c9e36,function(_0x967303){if(_0x967303[_0x8932('0x40')]!==_0x8932('0x41')){var _0x27934d={};_0x27934d[_0x967303[_0x8932('0x2a')]]={'$like':'%'+_0x21fca9[_0x8932('0x32')][_0x8932('0x3e')]+'%'};return _0x27934d;}})});}_0x32bcae=_['merge']({},_0x32bcae,_0x21fca9[_0x8932('0x42')]);var _0x57ccec={'where':_0x32bcae[_0x8932('0x3c')]};return db['SmsTransferReport'][_0x8932('0x1f')](_0x57ccec)[_0x8932('0x26')](function(_0x5c0d8f){_0x303305[_0x8932('0x1f')]=_0x5c0d8f;if(_0x21fca9[_0x8932('0x32')][_0x8932('0x43')]){_0x32bcae['include']=[{'all':!![]}];}return db[_0x8932('0x2c')][_0x8932('0x44')](_0x32bcae);})[_0x8932('0x26')](function(_0x1ecd5e){_0x303305[_0x8932('0x45')]=_0x1ecd5e;return _0x303305;})[_0x8932('0x26')](respondWithFilteredResult(_0xcd7869,_0x32bcae))[_0x8932('0x46')](handleError(_0xcd7869,null));};exports[_0x8932('0x47')]=function(_0x2e08c4,_0x3787ab){var _0x1d49a5={'raw':!![],'where':{'id':_0x2e08c4[_0x8932('0x48')]['id']}},_0x2d8f3d={};_0x2d8f3d[_0x8932('0x30')]=_[_0x8932('0x33')](db[_0x8932('0x2c')][_0x8932('0x2d')]);_0x2d8f3d[_0x8932('0x32')]=_[_0x8932('0x33')](_0x2e08c4[_0x8932('0x32')]);_0x2d8f3d[_0x8932('0x34')]=_['intersection'](_0x2d8f3d[_0x8932('0x30')],_0x2d8f3d[_0x8932('0x32')]);_0x1d49a5[_0x8932('0x36')]=_[_0x8932('0x35')](_0x2d8f3d['model'],qs[_0x8932('0x37')](_0x2e08c4['query'][_0x8932('0x37')]));_0x1d49a5[_0x8932('0x36')]=_0x1d49a5[_0x8932('0x36')][_0x8932('0x38')]?_0x1d49a5[_0x8932('0x36')]:_0x2d8f3d[_0x8932('0x30')];if(_0x2e08c4[_0x8932('0x32')][_0x8932('0x43')]){_0x1d49a5[_0x8932('0x49')]=[{'all':!![]}];}_0x1d49a5=_[_0x8932('0x3f')]({},_0x1d49a5,_0x2e08c4[_0x8932('0x42')]);return db[_0x8932('0x2c')][_0x8932('0x4a')](_0x1d49a5)[_0x8932('0x26')](handleEntityNotFound(_0x3787ab,null))[_0x8932('0x26')](respondWithResult(_0x3787ab,null))[_0x8932('0x46')](handleError(_0x3787ab,null));};exports[_0x8932('0x4b')]=function(_0xa29c33,_0x33c9ef){return db[_0x8932('0x2c')][_0x8932('0x4b')](_0xa29c33[_0x8932('0x4c')],{})[_0x8932('0x26')](respondWithResult(_0x33c9ef,0xc9))[_0x8932('0x46')](handleError(_0x33c9ef,null));};exports[_0x8932('0x4d')]=function(_0x1af01a,_0x548b7e){if(_0x1af01a['body']['id']){delete _0x1af01a[_0x8932('0x4c')]['id'];}return db[_0x8932('0x2c')][_0x8932('0x4a')]({'where':{'id':_0x1af01a['params']['id']}})[_0x8932('0x26')](handleEntityNotFound(_0x548b7e,null))[_0x8932('0x26')](saveUpdates(_0x1af01a['body'],null))['then'](respondWithResult(_0x548b7e,null))[_0x8932('0x46')](handleError(_0x548b7e,null));};exports[_0x8932('0x4e')]=function(_0x141d9c,_0x49df22){return db[_0x8932('0x2c')][_0x8932('0x4a')]({'where':{'id':_0x141d9c['params']['id']}})[_0x8932('0x26')](handleEntityNotFound(_0x49df22,null))[_0x8932('0x26')](removeEntity(_0x49df22,null))[_0x8932('0x46')](handleError(_0x49df22,null));};exports[_0x8932('0x4f')]=function(_0x110d00,_0xf22277){return db[_0x8932('0x2c')][_0x8932('0x4f')]()[_0x8932('0x26')](respondWithResult(_0xf22277,null))[_0x8932('0x46')](handleError(_0xf22277,null));}; \ No newline at end of file +var _0x9128=['rawAttributes','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x2f5829,_0x26d545){var _0x58d434=function(_0x34747b){while(--_0x34747b){_0x2f5829['push'](_0x2f5829['shift']());}};_0x58d434(++_0x26d545);}(_0x9128,0x9e));var _0x8912=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x9128[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8912('0x0'));var zipdir=require(_0x8912('0x1'));var jsonpatch=require(_0x8912('0x2'));var rp=require(_0x8912('0x3'));var moment=require(_0x8912('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8912('0x5'));var util=require(_0x8912('0x6'));var path=require(_0x8912('0x7'));var sox=require(_0x8912('0x8'));var csv=require(_0x8912('0x9'));var ejs=require(_0x8912('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8912('0xb'));var squel=require(_0x8912('0xc'));var crypto=require(_0x8912('0xd'));var jsforce=require(_0x8912('0xe'));var deskjs=require(_0x8912('0xf'));var toCsv=require(_0x8912('0x9'));var querystring=require(_0x8912('0x10'));var Papa=require(_0x8912('0x11'));var Redis=require(_0x8912('0x12'));var authService=require(_0x8912('0x13'));var qs=require(_0x8912('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8912('0x15'));var logger=require(_0x8912('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8912('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8912('0x18'))['db'];function respondWithStatusCode(_0xd6c399,_0x2848ce){_0x2848ce=_0x2848ce||0xcc;return function(_0x112b25){if(_0x112b25){return _0xd6c399[_0x8912('0x19')](_0x2848ce);}return _0xd6c399[_0x8912('0x1a')](_0x2848ce)['end']();};}function respondWithResult(_0x1fb5c9,_0x315b8f){_0x315b8f=_0x315b8f||0xc8;return function(_0x48f8b6){if(_0x48f8b6){return _0x1fb5c9['status'](_0x315b8f)[_0x8912('0x1b')](_0x48f8b6);}};}function respondWithFilteredResult(_0x19f3a1,_0x8de6f0){return function(_0x2b2e7a){if(_0x2b2e7a){var _0x206419=typeof _0x8de6f0['offset']===_0x8912('0x1c')&&typeof _0x8de6f0[_0x8912('0x1d')]===_0x8912('0x1c');var _0x4f39b8=_0x2b2e7a['count'];var _0x222ea5=_0x206419?0x0:_0x8de6f0[_0x8912('0x1e')];var _0x336db2=_0x206419?_0x2b2e7a['count']:_0x8de6f0[_0x8912('0x1e')]+_0x8de6f0['limit'];var _0x5bd116;if(_0x336db2>=_0x4f39b8){_0x336db2=_0x4f39b8;_0x5bd116=0xc8;}else{_0x5bd116=0xce;}_0x19f3a1[_0x8912('0x1a')](_0x5bd116);return _0x19f3a1[_0x8912('0x1f')]('Content-Range',_0x222ea5+'-'+_0x336db2+'/'+_0x4f39b8)[_0x8912('0x1b')](_0x2b2e7a);}return null;};}function patchUpdates(_0x191435){return function(_0x58c362){try{jsonpatch[_0x8912('0x20')](_0x58c362,_0x191435,!![]);}catch(_0x47506a){return BPromise[_0x8912('0x21')](_0x47506a);}return _0x58c362[_0x8912('0x22')]();};}function saveUpdates(_0x49693a,_0x6d4d97){return function(_0x23299e){if(_0x23299e){return _0x23299e[_0x8912('0x23')](_0x49693a)[_0x8912('0x24')](function(_0x2d8c88){return _0x2d8c88;});}return null;};}function removeEntity(_0x577aa6,_0x57c997){return function(_0x11244e){if(_0x11244e){return _0x11244e[_0x8912('0x25')]()[_0x8912('0x24')](function(){_0x577aa6[_0x8912('0x1a')](0xcc)[_0x8912('0x26')]();});}};}function handleEntityNotFound(_0xcaf5a9,_0x250fcd){return function(_0x13759d){if(!_0x13759d){_0xcaf5a9[_0x8912('0x19')](0x194);}return _0x13759d;};}function handleError(_0x3fe92a,_0x356c0e){_0x356c0e=_0x356c0e||0x1f4;return function(_0x1292ae){logger[_0x8912('0x27')](_0x1292ae[_0x8912('0x28')]);if(_0x1292ae[_0x8912('0x29')]){delete _0x1292ae[_0x8912('0x29')];}_0x3fe92a[_0x8912('0x1a')](_0x356c0e)[_0x8912('0x2a')](_0x1292ae);};}exports[_0x8912('0x2b')]=function(_0x32de4d,_0x56ed2c){var _0x5d107f={},_0x5f17ed={},_0x142364={'count':0x0,'rows':[]};var _0x70deb=_[_0x8912('0x2c')](db[_0x8912('0x2d')]['rawAttributes'],function(_0x5e9fb6){return{'name':_0x5e9fb6[_0x8912('0x2e')],'type':_0x5e9fb6[_0x8912('0x2f')][_0x8912('0x30')]};});_0x5f17ed[_0x8912('0x31')]=_['map'](_0x70deb,_0x8912('0x29'));_0x5f17ed[_0x8912('0x32')]=_[_0x8912('0x33')](_0x32de4d['query']);_0x5f17ed[_0x8912('0x34')]=_[_0x8912('0x35')](_0x5f17ed[_0x8912('0x31')],_0x5f17ed[_0x8912('0x32')]);_0x5d107f[_0x8912('0x36')]=_['intersection'](_0x5f17ed[_0x8912('0x31')],qs[_0x8912('0x37')](_0x32de4d['query']['fields']));_0x5d107f['attributes']=_0x5d107f[_0x8912('0x36')][_0x8912('0x38')]?_0x5d107f[_0x8912('0x36')]:_0x5f17ed[_0x8912('0x31')];if(!_0x32de4d[_0x8912('0x32')]['hasOwnProperty'](_0x8912('0x39'))){_0x5d107f['limit']=qs[_0x8912('0x1d')](_0x32de4d['query']['limit']);_0x5d107f[_0x8912('0x1e')]=qs[_0x8912('0x1e')](_0x32de4d[_0x8912('0x32')][_0x8912('0x1e')]);}_0x5d107f['order']=qs[_0x8912('0x3a')](_0x32de4d[_0x8912('0x32')][_0x8912('0x3a')]);_0x5d107f[_0x8912('0x3b')]=qs[_0x8912('0x34')](_[_0x8912('0x3c')](_0x32de4d['query'],_0x5f17ed[_0x8912('0x34')]),_0x70deb);if(_0x32de4d[_0x8912('0x32')][_0x8912('0x3d')]){_0x5d107f[_0x8912('0x3b')]=_[_0x8912('0x3e')](_0x5d107f[_0x8912('0x3b')],{'$or':_[_0x8912('0x2c')](_0x70deb,function(_0x2dae96){if(_0x2dae96['type']!==_0x8912('0x3f')){var _0x4fac79={};_0x4fac79[_0x2dae96[_0x8912('0x29')]]={'$like':'%'+_0x32de4d['query'][_0x8912('0x3d')]+'%'};return _0x4fac79;}})});}_0x5d107f=_[_0x8912('0x3e')]({},_0x5d107f,_0x32de4d[_0x8912('0x40')]);var _0x304053={'where':_0x5d107f[_0x8912('0x3b')]};return db[_0x8912('0x2d')]['count'](_0x304053)[_0x8912('0x24')](function(_0x3a29f5){_0x142364['count']=_0x3a29f5;if(_0x32de4d[_0x8912('0x32')][_0x8912('0x41')]){_0x5d107f[_0x8912('0x42')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x5d107f);})[_0x8912('0x24')](function(_0x2d53e3){_0x142364[_0x8912('0x43')]=_0x2d53e3;return _0x142364;})[_0x8912('0x24')](respondWithFilteredResult(_0x56ed2c,_0x5d107f))[_0x8912('0x44')](handleError(_0x56ed2c,null));};exports[_0x8912('0x45')]=function(_0x23e241,_0x463597){var _0x2b7451={'raw':!![],'where':{'id':_0x23e241['params']['id']}},_0x38c099={};_0x38c099[_0x8912('0x31')]=_['keys'](db['SmsTransferReport'][_0x8912('0x46')]);_0x38c099['query']=_[_0x8912('0x33')](_0x23e241['query']);_0x38c099[_0x8912('0x34')]=_['intersection'](_0x38c099[_0x8912('0x31')],_0x38c099[_0x8912('0x32')]);_0x2b7451['attributes']=_[_0x8912('0x35')](_0x38c099[_0x8912('0x31')],qs[_0x8912('0x37')](_0x23e241['query'][_0x8912('0x37')]));_0x2b7451[_0x8912('0x36')]=_0x2b7451[_0x8912('0x36')][_0x8912('0x38')]?_0x2b7451[_0x8912('0x36')]:_0x38c099['model'];if(_0x23e241['query'][_0x8912('0x41')]){_0x2b7451[_0x8912('0x42')]=[{'all':!![]}];}_0x2b7451=_[_0x8912('0x3e')]({},_0x2b7451,_0x23e241['options']);return db[_0x8912('0x2d')]['find'](_0x2b7451)[_0x8912('0x24')](handleEntityNotFound(_0x463597,null))[_0x8912('0x24')](respondWithResult(_0x463597,null))[_0x8912('0x44')](handleError(_0x463597,null));};exports[_0x8912('0x47')]=function(_0x509aad,_0x4276d8){return db[_0x8912('0x2d')][_0x8912('0x47')](_0x509aad[_0x8912('0x48')],{})[_0x8912('0x24')](respondWithResult(_0x4276d8,0xc9))[_0x8912('0x44')](handleError(_0x4276d8,null));};exports[_0x8912('0x23')]=function(_0x4d440e,_0x230370){if(_0x4d440e['body']['id']){delete _0x4d440e[_0x8912('0x48')]['id'];}return db[_0x8912('0x2d')][_0x8912('0x49')]({'where':{'id':_0x4d440e['params']['id']}})['then'](handleEntityNotFound(_0x230370,null))[_0x8912('0x24')](saveUpdates(_0x4d440e[_0x8912('0x48')],null))[_0x8912('0x24')](respondWithResult(_0x230370,null))[_0x8912('0x44')](handleError(_0x230370,null));};exports[_0x8912('0x25')]=function(_0x5c3782,_0x1e92c2){return db[_0x8912('0x2d')][_0x8912('0x49')]({'where':{'id':_0x5c3782[_0x8912('0x4a')]['id']}})[_0x8912('0x24')](handleEntityNotFound(_0x1e92c2,null))[_0x8912('0x24')](removeEntity(_0x1e92c2,null))[_0x8912('0x44')](handleError(_0x1e92c2,null));};exports[_0x8912('0x4b')]=function(_0x2e0dc2,_0x1387a3){return db[_0x8912('0x2d')][_0x8912('0x4b')]()[_0x8912('0x24')](respondWithResult(_0x1387a3,null))['catch'](handleError(_0x1387a3,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 10c7b39..4cb5a0e 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 _0x65e9=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x65e9,0x15e));var _0x965e=function(_0x8ba771,_0x2f4eae){_0x8ba771=_0x8ba771-0x0;var _0x55741e=_0x65e9[_0x8ba771];return _0x55741e;};'use strict';var _=require(_0x965e('0x0'));var util=require(_0x965e('0x1'));var logger=require('../../config/logger')(_0x965e('0x2'));var moment=require(_0x965e('0x3'));var BPromise=require(_0x965e('0x4'));var rp=require(_0x965e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x965e('0x6'));var config=require(_0x965e('0x7'));var attributes=require(_0x965e('0x8'));module[_0x965e('0x9')]=function(_0x32e6ad,_0x363e45){return _0x32e6ad[_0x965e('0xa')](_0x965e('0xb'),attributes,{'tableName':_0x965e('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x965e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5645=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','uniqueid','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5645,0x19e));var _0x5564=function(_0x47bc60,_0xd72b8c){_0x47bc60=_0x47bc60-0x0;var _0x3949ea=_0x5645[_0x47bc60];return _0x3949ea;};'use strict';var _=require(_0x5564('0x0'));var util=require(_0x5564('0x1'));var logger=require(_0x5564('0x2'))(_0x5564('0x3'));var moment=require(_0x5564('0x4'));var BPromise=require('bluebird');var rp=require(_0x5564('0x5'));var fs=require('fs');var path=require(_0x5564('0x6'));var rimraf=require(_0x5564('0x7'));var config=require(_0x5564('0x8'));var attributes=require(_0x5564('0x9'));module[_0x5564('0xa')]=function(_0x6d7911,_0x196e16){return _0x6d7911[_0x5564('0xb')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x5564('0xc'),'fields':[_0x5564('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 39e9cfa..bf52ea2 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 _0x8743=['ioredis','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x8743,0x7a));var _0x3874=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8743[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x3874('0x0'));var util=require(_0x3874('0x1'));var moment=require(_0x3874('0x2'));var BPromise=require('bluebird');var rs=require(_0x3874('0x3'));var fs=require('fs');var Redis=require(_0x3874('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3874('0x5'))(_0x3874('0x6'));var config=require(_0x3874('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3874('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8f890a,_0x5977b8,_0x2dee29){return new BPromise(function(_0x3ecd70,_0x10c22e){return client['request'](_0x8f890a,_0x2dee29)['then'](function(_0x581ed2){logger[_0x3874('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x5977b8,_0x3874('0xa'));logger[_0x3874('0xb')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5977b8,'request\x20sent',JSON[_0x3874('0xc')](_0x581ed2));if(_0x581ed2[_0x3874('0xd')]){if(_0x581ed2[_0x3874('0xd')][_0x3874('0xe')]===0x1f4){logger[_0x3874('0xd')](_0x3874('0xf'),_0x5977b8,_0x581ed2['error'][_0x3874('0x10')]);return _0x10c22e(_0x581ed2[_0x3874('0xd')][_0x3874('0x10')]);}logger[_0x3874('0xd')](_0x3874('0xf'),_0x5977b8,_0x581ed2[_0x3874('0xd')]['message']);return _0x3ecd70(_0x581ed2[_0x3874('0xd')][_0x3874('0x10')]);}else{logger[_0x3874('0x9')](_0x3874('0xf'),_0x5977b8,_0x3874('0xa'));_0x3ecd70(_0x581ed2['result'][_0x3874('0x10')]);}})[_0x3874('0x11')](function(_0x4b2bf0){logger[_0x3874('0xd')](_0x3874('0xf'),_0x5977b8,_0x4b2bf0);_0x10c22e(_0x4b2bf0);});});} \ No newline at end of file +var _0x2208=['client','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x558f0b,_0xe4152b){var _0x12731e=function(_0x1d9f31){while(--_0x1d9f31){_0x558f0b['push'](_0x558f0b['shift']());}};_0x12731e(++_0xe4152b);}(_0x2208,0x11e));var _0x8220=function(_0x45136f,_0xa0aedb){_0x45136f=_0x45136f-0x0;var _0x10aecc=_0x2208[_0x45136f];return _0x10aecc;};'use strict';var _=require('lodash');var util=require(_0x8220('0x0'));var moment=require('moment');var BPromise=require(_0x8220('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8220('0x2'));var db=require(_0x8220('0x3'))['db'];var utils=require(_0x8220('0x4'));var logger=require(_0x8220('0x5'))(_0x8220('0x6'));var config=require(_0x8220('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8220('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc5e293,_0x4161c3,_0x113b44){return new BPromise(function(_0xe507a8,_0xf7f3){return client[_0x8220('0x9')](_0xc5e293,_0x113b44)['then'](function(_0x1c2d2a){logger[_0x8220('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x4161c3,_0x8220('0xb'));logger[_0x8220('0xc')](_0x8220('0xd'),_0x4161c3,_0x8220('0xb'),JSON[_0x8220('0xe')](_0x1c2d2a));if(_0x1c2d2a['error']){if(_0x1c2d2a['error'][_0x8220('0xf')]===0x1f4){logger[_0x8220('0x10')](_0x8220('0x11'),_0x4161c3,_0x1c2d2a[_0x8220('0x10')][_0x8220('0x12')]);return _0xf7f3(_0x1c2d2a[_0x8220('0x10')][_0x8220('0x12')]);}logger[_0x8220('0x10')](_0x8220('0x11'),_0x4161c3,_0x1c2d2a[_0x8220('0x10')][_0x8220('0x12')]);return _0xe507a8(_0x1c2d2a[_0x8220('0x10')][_0x8220('0x12')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x4161c3,_0x8220('0xb'));_0xe507a8(_0x1c2d2a[_0x8220('0x13')][_0x8220('0x12')]);}})[_0x8220('0x14')](function(_0x689dcf){logger[_0x8220('0x10')](_0x8220('0x11'),_0x4161c3,_0x689dcf);_0xf7f3(_0x689dcf);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f4ac910..4d685bf 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 _0x8e8f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','get','/:id','show','/:id/download','download','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','delete','exports','multer','path','connect-timeout'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0x8e8f,0x1cd));var _0xf8e8=function(_0x377f96,_0x59814b){_0x377f96=_0x377f96-0x0;var _0x242ae2=_0x8e8f[_0x377f96];return _0x242ae2;};'use strict';var multer=require(_0xf8e8('0x0'));var util=require('util');var path=require(_0xf8e8('0x1'));var timeout=require(_0xf8e8('0x2'));var express=require('express');var router=express[_0xf8e8('0x3')]();var fs_extra=require(_0xf8e8('0x4'));var auth=require(_0xf8e8('0x5'));var interaction=require(_0xf8e8('0x6'));var config=require(_0xf8e8('0x7'));var controller=require(_0xf8e8('0x8'));router['get']('/',auth[_0xf8e8('0x9')](),controller['index']);router[_0xf8e8('0xa')](_0xf8e8('0xb'),auth[_0xf8e8('0x9')](),controller[_0xf8e8('0xc')]);router[_0xf8e8('0xa')](_0xf8e8('0xd'),auth['isAuthenticated'](),controller[_0xf8e8('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15a8e6,_0x157b6e,_0x5be749){_0x5be749(null,path['join'](config[_0xf8e8('0xf')],_0xf8e8('0x10')));},'filename':function(_0x2d882a,_0x1dae65,_0x4ecd50){_0x1dae65[_0xf8e8('0x11')]=_0x1dae65[_0xf8e8('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4ecd50(null,util[_0xf8e8('0x12')](_0xf8e8('0x13'),path[_0xf8e8('0x14')](_0x1dae65[_0xf8e8('0x11')],path[_0xf8e8('0x15')](_0x1dae65[_0xf8e8('0x11')])),Date[_0xf8e8('0x16')](),path[_0xf8e8('0x15')](_0x1dae65['originalname'])));}})});router[_0xf8e8('0x17')]('/',upload[_0xf8e8('0x18')](_0xf8e8('0x19')),controller[_0xf8e8('0x1a')]);router['put'](_0xf8e8('0xb'),auth[_0xf8e8('0x9')](),controller['update']);router['delete'](_0xf8e8('0xb'),auth['isAuthenticated'](),controller[_0xf8e8('0x1b')]);module[_0xf8e8('0x1c')]=router; \ No newline at end of file +var _0x5dbb=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','single','create','delete','exports'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x5dbb,0x1a4));var _0xb5db=function(_0x252805,_0x1d1e8e){_0x252805=_0x252805-0x0;var _0x3e74b9=_0x5dbb[_0x252805];return _0x3e74b9;};'use strict';var multer=require(_0xb5db('0x0'));var util=require(_0xb5db('0x1'));var path=require('path');var timeout=require(_0xb5db('0x2'));var express=require(_0xb5db('0x3'));var router=express[_0xb5db('0x4')]();var fs_extra=require(_0xb5db('0x5'));var auth=require(_0xb5db('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb5db('0x7'));var controller=require(_0xb5db('0x8'));router[_0xb5db('0x9')]('/',auth[_0xb5db('0xa')](),controller[_0xb5db('0xb')]);router[_0xb5db('0x9')](_0xb5db('0xc'),auth[_0xb5db('0xa')](),controller['show']);router[_0xb5db('0x9')](_0xb5db('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x65bc2c,_0x525190,_0x173124){_0x173124(null,path[_0xb5db('0xe')](config[_0xb5db('0xf')],_0xb5db('0x10')));},'filename':function(_0x247901,_0x46acec,_0x574766){_0x46acec[_0xb5db('0x11')]=_0x46acec[_0xb5db('0x11')][_0xb5db('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x574766(null,util[_0xb5db('0x13')](_0xb5db('0x14'),path[_0xb5db('0x15')](_0x46acec[_0xb5db('0x11')],path[_0xb5db('0x16')](_0x46acec['originalname'])),Date[_0xb5db('0x17')](),path['extname'](_0x46acec[_0xb5db('0x11')])));}})});router['post']('/',upload[_0xb5db('0x18')]('file'),controller[_0xb5db('0x19')]);router['put'](_0xb5db('0xc'),auth[_0xb5db('0xa')](),controller['update']);router['delete']('/:id',auth[_0xb5db('0xa')](),controller[_0xb5db('0x1a')]);module[_0xb5db('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index cf3e6dd..d77f5d9 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 _0xf718=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xf718,0x122));var _0x8f71=function(_0x291d70,_0x285301){_0x291d70=_0x291d70-0x0;var _0x2412ff=_0xf718[_0x291d70];return _0x2412ff;};'use strict';var Sequelize=require(_0x8f71('0x0'));module[_0x8f71('0x1')]={'name':{'type':Sequelize[_0x8f71('0x2')],'unique':_0x8f71('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x8f71('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x8f71('0x2')]},'original_duration':{'type':Sequelize[_0x8f71('0x4')]},'original_sampleCount':{'type':Sequelize[_0x8f71('0x5')]},'original_channelCount':{'type':Sequelize[_0x8f71('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x8f71('0x2')]},'converted_duration':{'type':Sequelize[_0x8f71('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x8f71('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x32c4=['STRING','name','FLOAT','BIGINT','INTEGER','exports'];(function(_0x4e0c67,_0xeb0a8b){var _0x311730=function(_0x14ac18){while(--_0x14ac18){_0x4e0c67['push'](_0x4e0c67['shift']());}};_0x311730(++_0xeb0a8b);}(_0x32c4,0x71));var _0x432c=function(_0x3d0e12,_0x41e165){_0x3d0e12=_0x3d0e12-0x0;var _0x22da51=_0x32c4[_0x3d0e12];return _0x22da51;};'use strict';var Sequelize=require('sequelize');module[_0x432c('0x0')]={'name':{'type':Sequelize[_0x432c('0x1')],'unique':_0x432c('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x432c('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x432c('0x1')]},'original_duration':{'type':Sequelize[_0x432c('0x3')]},'original_sampleCount':{'type':Sequelize[_0x432c('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x432c('0x4')]},'original_sampleRate':{'type':Sequelize[_0x432c('0x5')]},'converted_format':{'type':Sequelize[_0x432c('0x1')]},'converted_duration':{'type':Sequelize[_0x432c('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x432c('0x4')]},'converted_channelCount':{'type':Sequelize[_0x432c('0x5')]},'converted_bitRate':{'type':Sequelize[_0x432c('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 1d4e7e6..677d4b5 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 _0x706c=['mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../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','get','Sounds','error','stack','name','send','index','map','Sound','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','include','find','save_name','converted_format','existsSync','join','ValidationError','Sound\x20not\x20found','download','server/files/sounds/converted','format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','root','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','pick','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x200932,_0x4fa1bc){var _0x2caf6a=function(_0x539bdd){while(--_0x539bdd){_0x200932['push'](_0x200932['shift']());}};_0x2caf6a(++_0x4fa1bc);}(_0x706c,0x1d7));var _0xc706=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x706c[_0x54ccd7];return _0x4e667b;};'use strict';var emlformat=require(_0xc706('0x0'));var rimraf=require(_0xc706('0x1'));var zipdir=require(_0xc706('0x2'));var jsonpatch=require(_0xc706('0x3'));var rp=require('request-promise');var moment=require(_0xc706('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc706('0x5'));var util=require(_0xc706('0x6'));var path=require('path');var sox=require(_0xc706('0x7'));var csv=require(_0xc706('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc706('0x9'));var _=require('lodash');var squel=require(_0xc706('0xa'));var crypto=require(_0xc706('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc706('0xc'));var toCsv=require(_0xc706('0x8'));var querystring=require('querystring');var Papa=require(_0xc706('0xd'));var Redis=require(_0xc706('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc706('0xf'));var logger=require(_0xc706('0x10'))(_0xc706('0x11'));var utils=require(_0xc706('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc706('0x13'));var db=require(_0xc706('0x14'))['db'];function respondWithStatusCode(_0x4bb305,_0x5e2f5b){_0x5e2f5b=_0x5e2f5b||0xcc;return function(_0xc6e18d){if(_0xc6e18d){return _0x4bb305[_0xc706('0x15')](_0x5e2f5b);}return _0x4bb305[_0xc706('0x16')](_0x5e2f5b)[_0xc706('0x17')]();};}function respondWithResult(_0x3127d6,_0x1fa0ce){_0x1fa0ce=_0x1fa0ce||0xc8;return function(_0x4c8259){if(_0x4c8259){return _0x3127d6[_0xc706('0x16')](_0x1fa0ce)[_0xc706('0x18')](_0x4c8259);}};}function respondWithFilteredResult(_0x530da9,_0x479869){return function(_0xdbb36a){if(_0xdbb36a){var _0x240673=typeof _0x479869[_0xc706('0x19')]===_0xc706('0x1a')&&typeof _0x479869[_0xc706('0x1b')]==='undefined';var _0x44024d=_0xdbb36a[_0xc706('0x1c')];var _0x46d9f9=_0x240673?0x0:_0x479869[_0xc706('0x19')];var _0x6cd7e4=_0x240673?_0xdbb36a[_0xc706('0x1c')]:_0x479869['offset']+_0x479869['limit'];var _0x5ec2d6;if(_0x6cd7e4>=_0x44024d){_0x6cd7e4=_0x44024d;_0x5ec2d6=0xc8;}else{_0x5ec2d6=0xce;}_0x530da9[_0xc706('0x16')](_0x5ec2d6);return _0x530da9[_0xc706('0x1d')](_0xc706('0x1e'),_0x46d9f9+'-'+_0x6cd7e4+'/'+_0x44024d)[_0xc706('0x18')](_0xdbb36a);}return null;};}function patchUpdates(_0x41f24f){return function(_0x257d42){try{jsonpatch[_0xc706('0x1f')](_0x257d42,_0x41f24f,!![]);}catch(_0x4124d3){return BPromise[_0xc706('0x20')](_0x4124d3);}return _0x257d42[_0xc706('0x21')]();};}function saveUpdates(_0x17f3c4,_0x3dc098){return function(_0x3c0a7f){if(_0x3c0a7f){return _0x3c0a7f[_0xc706('0x22')](_0x17f3c4)[_0xc706('0x23')](function(_0x4c2522){return _0x4c2522;});}return null;};}function removeEntity(_0x7a83f9,_0x233325){return function(_0xdb0b0a){if(_0xdb0b0a){return _0xdb0b0a[_0xc706('0x24')]()[_0xc706('0x23')](function(){var _0x1ff9dd=_0xdb0b0a[_0xc706('0x25')]({'plain':!![]});var _0x37539d=_0xc706('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x37539d,'resourceId':_0x1ff9dd['id']}})[_0xc706('0x23')](function(){return _0xdb0b0a;});})[_0xc706('0x23')](function(){_0x7a83f9[_0xc706('0x16')](0xcc)[_0xc706('0x17')]();});}};}function handleEntityNotFound(_0x215f47,_0x3f27d5){return function(_0x42e03c){if(!_0x42e03c){_0x215f47['sendStatus'](0x194);}return _0x42e03c;};}function handleError(_0x399e34,_0x4e9f5b){_0x4e9f5b=_0x4e9f5b||0x1f4;return function(_0x193d8e){logger[_0xc706('0x27')](_0x193d8e[_0xc706('0x28')]);if(_0x193d8e[_0xc706('0x29')]){delete _0x193d8e['name'];}_0x399e34['status'](_0x4e9f5b)[_0xc706('0x2a')](_0x193d8e);};}exports[_0xc706('0x2b')]=function(_0x330b77,_0xe46397){var _0x2e6321={},_0x47c1cb={},_0x73496b={'count':0x0,'rows':[]};var _0x523a47=_[_0xc706('0x2c')](db[_0xc706('0x2d')]['rawAttributes'],function(_0x11ee69){return{'name':_0x11ee69[_0xc706('0x2e')],'type':_0x11ee69['type'][_0xc706('0x2f')]};});_0x47c1cb[_0xc706('0x30')]=_[_0xc706('0x2c')](_0x523a47,'name');_0x47c1cb[_0xc706('0x31')]=_[_0xc706('0x32')](_0x330b77[_0xc706('0x31')]);_0x47c1cb['filters']=_[_0xc706('0x33')](_0x47c1cb[_0xc706('0x30')],_0x47c1cb[_0xc706('0x31')]);_0x2e6321['attributes']=_[_0xc706('0x33')](_0x47c1cb[_0xc706('0x30')],qs[_0xc706('0x34')](_0x330b77[_0xc706('0x31')]['fields']));_0x2e6321[_0xc706('0x35')]=_0x2e6321[_0xc706('0x35')][_0xc706('0x36')]?_0x2e6321['attributes']:_0x47c1cb['model'];if(!_0x330b77[_0xc706('0x31')][_0xc706('0x37')]('nolimit')){_0x2e6321[_0xc706('0x1b')]=qs[_0xc706('0x1b')](_0x330b77[_0xc706('0x31')][_0xc706('0x1b')]);_0x2e6321[_0xc706('0x19')]=qs[_0xc706('0x19')](_0x330b77['query']['offset']);}_0x2e6321[_0xc706('0x38')]=qs['sort'](_0x330b77[_0xc706('0x31')]['sort']);_0x2e6321[_0xc706('0x39')]=qs['filters'](_['pick'](_0x330b77[_0xc706('0x31')],_0x47c1cb[_0xc706('0x3a')]),_0x523a47);if(_0x330b77['query']['filter']){_0x2e6321[_0xc706('0x39')]=_[_0xc706('0x3b')](_0x2e6321[_0xc706('0x39')],{'$or':_[_0xc706('0x2c')](_0x523a47,function(_0x1836b9){if(_0x1836b9[_0xc706('0x3c')]!==_0xc706('0x3d')){var _0xca922c={};_0xca922c[_0x1836b9[_0xc706('0x29')]]={'$like':'%'+_0x330b77['query']['filter']+'%'};return _0xca922c;}})});}_0x2e6321=_[_0xc706('0x3b')]({},_0x2e6321,_0x330b77[_0xc706('0x3e')]);var _0x4ecf5e={'where':_0x2e6321['where']};return db['Sound'][_0xc706('0x1c')](_0x4ecf5e)[_0xc706('0x23')](function(_0x56a415){_0x73496b[_0xc706('0x1c')]=_0x56a415;if(_0x330b77[_0xc706('0x31')][_0xc706('0x3f')]){_0x2e6321['include']=[{'all':!![]}];}return db[_0xc706('0x2d')][_0xc706('0x40')](_0x2e6321);})[_0xc706('0x23')](function(_0x53ed2c){_0x73496b['rows']=_0x53ed2c;return _0x73496b;})[_0xc706('0x23')](respondWithFilteredResult(_0xe46397,_0x2e6321))[_0xc706('0x41')](handleError(_0xe46397,null));};exports['show']=function(_0xd4eb96,_0x1af1c3){var _0x5ca87d={'raw':!![],'where':{'id':_0xd4eb96[_0xc706('0x42')]['id']}},_0x454fc1={};_0x454fc1[_0xc706('0x30')]=_[_0xc706('0x32')](db[_0xc706('0x2d')][_0xc706('0x43')]);_0x454fc1[_0xc706('0x31')]=_[_0xc706('0x32')](_0xd4eb96['query']);_0x454fc1['filters']=_[_0xc706('0x33')](_0x454fc1[_0xc706('0x30')],_0x454fc1['query']);_0x5ca87d[_0xc706('0x35')]=_[_0xc706('0x33')](_0x454fc1[_0xc706('0x30')],qs['fields'](_0xd4eb96[_0xc706('0x31')]['fields']));_0x5ca87d['attributes']=_0x5ca87d[_0xc706('0x35')][_0xc706('0x36')]?_0x5ca87d[_0xc706('0x35')]:_0x454fc1['model'];if(_0xd4eb96[_0xc706('0x31')][_0xc706('0x3f')]){_0x5ca87d[_0xc706('0x44')]=[{'all':!![]}];}_0x5ca87d=_['merge']({},_0x5ca87d,_0xd4eb96[_0xc706('0x3e')]);return db[_0xc706('0x2d')][_0xc706('0x45')](_0x5ca87d)['then'](handleEntityNotFound(_0x1af1c3,null))[_0xc706('0x23')](respondWithResult(_0x1af1c3,null))['catch'](handleError(_0x1af1c3,null));};exports['download']=function(_0x12c473,_0x1667f2,_0x1890d7){return db[_0xc706('0x2d')][_0xc706('0x45')]({'where':{'id':_0x12c473['params']['id']},'attributes':[_0xc706('0x29'),_0xc706('0x46'),_0xc706('0x47')],'raw':!![]})[_0xc706('0x23')](handleEntityNotFound(_0x1667f2,null))[_0xc706('0x23')](function(_0x23931e){if(_0x23931e){if(!fs[_0xc706('0x48')](path[_0xc706('0x49')](config['root'],'server/files/sounds/converted',_0x23931e[_0xc706('0x46')]+'.'+_0x23931e['converted_format']))){throw new db['Sequelize'][(_0xc706('0x4a'))](_0xc706('0x4b'));}return _0x1667f2[_0xc706('0x4c')](path['join'](config['root'],_0xc706('0x4d'),util[_0xc706('0x4e')]('%s.%s',_0x23931e['save_name'],_0x23931e['converted_format'])),util['format'](_0xc706('0x4f'),_0x23931e[_0xc706('0x29')],_0x23931e[_0xc706('0x47')]));}return null;})[_0xc706('0x41')](handleError(_0x1667f2,null));};exports[_0xc706('0x50')]=function(_0x2088c5,_0x1ae70e,_0x3df562){var _0x103365={'name':path[_0xc706('0x51')](_0x2088c5['file']['originalname'],path[_0xc706('0x52')](_0x2088c5[_0xc706('0x53')][_0xc706('0x54')])),'save_name':path[_0xc706('0x51')](_0x2088c5[_0xc706('0x53')]['filename'],path[_0xc706('0x52')](_0x2088c5['file'][_0xc706('0x55')])),'original_format':path[_0xc706('0x52')](_0x2088c5['file'][_0xc706('0x54')])[_0xc706('0x56')](0x1),'converted_format':_0xc706('0x57')};var _0x52f6d0=path['join'](config[_0xc706('0x58')],'server/files/sounds/original',_0x2088c5[_0xc706('0x53')]['filename']);var _0x507e4d=path[_0xc706('0x49')](config['root'],'server/files/sounds/converted',util[_0xc706('0x4e')]('%s.%s',path[_0xc706('0x51')](_0x2088c5[_0xc706('0x53')]['filename'],path[_0xc706('0x52')](_0x2088c5[_0xc706('0x53')]['filename'])),_0x103365[_0xc706('0x47')]));logger[_0xc706('0x59')](_0xc706('0x5a'),_0x52f6d0);logger['info'](_0xc706('0x5b'),_0x507e4d);try{fs['chmodSync'](_0x52f6d0,parseInt(_0xc706('0x5c'),0x8));var _0x442dca=sox[_0xc706('0x5d')](_0x52f6d0,_0x507e4d,{'sampleRate':0x1f40,'format':_0xc706('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x442dca['on'](_0xc706('0x27'),function(_0x364466){fs[_0xc706('0x5e')](_0x52f6d0);_0x1ae70e[_0xc706('0x16')](0x1f4)[_0xc706('0x2a')](_0x364466);});_0x442dca['on'](_0xc706('0x5f'),function(_0x566525){_0x103365['original_duration']=isNaN(_0x566525[_0xc706('0x60')])?null:_0x566525[_0xc706('0x60')]*0x3e8;_0x103365[_0xc706('0x61')]=isNaN(_0x566525[_0xc706('0x62')])?null:_0x566525[_0xc706('0x62')];_0x103365['original_channelCount']=isNaN(_0x566525[_0xc706('0x63')])?null:_0x566525[_0xc706('0x63')];_0x103365[_0xc706('0x64')]=isNaN(_0x566525[_0xc706('0x65')])?null:_0x566525[_0xc706('0x65')];_0x103365['original_sampleRate']=isNaN(_0x566525['sampleRate'])?null:_0x566525[_0xc706('0x66')];});_0x442dca['on'](_0xc706('0x67'),function(_0x1e52d9){_0x103365[_0xc706('0x68')]=isNaN(_0x1e52d9['duration'])?null:_0x1e52d9['duration']*0x3e8;_0x103365[_0xc706('0x69')]=isNaN(_0x1e52d9[_0xc706('0x62')])?null:_0x1e52d9['sampleCount'];_0x103365[_0xc706('0x6a')]=isNaN(_0x1e52d9['channelCount'])?null:_0x1e52d9[_0xc706('0x63')];_0x103365['converted_bitRate']=isNaN(_0x1e52d9[_0xc706('0x65')])?null:_0x1e52d9['bitRate'];_0x103365[_0xc706('0x6b')]=isNaN(_0x1e52d9[_0xc706('0x66')])?null:_0x1e52d9[_0xc706('0x66')];});_0x442dca['on']('end',function(){fs['chmodSync'](_0x507e4d,parseInt('0777',0x8));return db[_0xc706('0x2d')]['create'](_0x103365)['then'](function(_0x54370d){var _0x54159e={'role':_0x2088c5['body'][_0xc706('0x6c')],'userProfileId':_0x2088c5[_0xc706('0x6d')][_0xc706('0x6e')]};if(!_0x54159e)throw new Error(_0xc706('0x6f'));if(_0x54159e[_0xc706('0x6c')]==='user'){var _0x1f4a70=_0x54370d[_0xc706('0x25')]({'plain':!![]});return db['UserProfileSection'][_0xc706('0x45')]({'where':{'name':_0xc706('0x26'),'userProfileId':_0x54159e[_0xc706('0x6e')]},'raw':!![]})[_0xc706('0x23')](function(_0x541dfa){if(_0x541dfa&&_0x541dfa[_0xc706('0x70')]===0x0){return db[_0xc706('0x71')][_0xc706('0x50')]({'name':_0x1f4a70['name'],'resourceId':_0x1f4a70['id'],'type':_0x541dfa[_0xc706('0x29')],'sectionId':_0x541dfa['id']},{})['then'](function(){return _0x54370d;});}else{return _0x54370d;}})[_0xc706('0x41')](function(_0x2e6bc5){logger[_0xc706('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e6bc5);throw _0x2e6bc5;});}return _0x54370d;})[_0xc706('0x23')](respondWithResult(_0x1ae70e,null))[_0xc706('0x41')](handleError(_0x1ae70e,null));});_0x442dca['start']();}catch(_0x5678c7){_0x1ae70e[_0xc706('0x16')](0x1f4)['send'](_0x5678c7);}};exports[_0xc706('0x22')]=function(_0x4a7bd3,_0x51c286,_0x4f83cb){return db[_0xc706('0x2d')]['find']({'where':{'id':_0x4a7bd3[_0xc706('0x42')]['id']}})[_0xc706('0x23')](handleEntityNotFound(_0x51c286,null))[_0xc706('0x23')](saveUpdates(_[_0xc706('0x72')](_0x4a7bd3['body'],[_0xc706('0x29'),_0xc706('0x73')]),null))['then'](respondWithResult(_0x51c286,null))['catch'](handleError(_0x51c286,null));};exports[_0xc706('0x74')]=function(_0x18e17b,_0x119fab,_0x4c9c33){return db[_0xc706('0x2d')][_0xc706('0x45')]({'where':{'id':_0x18e17b[_0xc706('0x42')]['id']}})[_0xc706('0x23')](function(_0x58950b){if(_0x58950b){return _0x58950b[_0xc706('0x24')]();}})[_0xc706('0x23')](function(_0x5a2687){var _0x34b11f=path[_0xc706('0x49')](config[_0xc706('0x58')],_0xc706('0x75'),util[_0xc706('0x4e')](_0xc706('0x4f'),_0x5a2687[_0xc706('0x46')],_0x5a2687[_0xc706('0x76')]));var _0x3d9819=path[_0xc706('0x49')](config[_0xc706('0x58')],_0xc706('0x4d'),util[_0xc706('0x4e')](_0xc706('0x4f'),_0x5a2687[_0xc706('0x46')],_0x5a2687[_0xc706('0x47')]));fs[_0xc706('0x5e')](_0x34b11f);fs[_0xc706('0x5e')](_0x3d9819);return _0x5a2687;})[_0xc706('0x23')](function(_0x3bf02f){if(_0x3bf02f){return _0x119fab[_0xc706('0x16')](0xcc)[_0xc706('0x17')]();}})[_0xc706('0x23')](handleEntityNotFound(_0x119fab,null))[_0xc706('0x41')](handleError(_0x119fab,null));}; \ No newline at end of file +var _0xc1b8=['attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','find','download','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','src','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','delete','original_format','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','then','get','Sounds','UserProfileResource','error','stack','name','send','map','Sound','key','model','query','filters','intersection','fields','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1b8,0x133));var _0x8c1b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xc1b8[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x8c1b('0x0'));var rimraf=require(_0x8c1b('0x1'));var zipdir=require(_0x8c1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c1b('0x3'));var moment=require('moment');var BPromise=require(_0x8c1b('0x4'));var Mustache=require(_0x8c1b('0x5'));var util=require(_0x8c1b('0x6'));var path=require('path');var sox=require(_0x8c1b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c1b('0x8'));var _=require(_0x8c1b('0x9'));var squel=require(_0x8c1b('0xa'));var crypto=require(_0x8c1b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8c1b('0xc'));var toCsv=require(_0x8c1b('0xd'));var querystring=require(_0x8c1b('0xe'));var Papa=require(_0x8c1b('0xf'));var Redis=require(_0x8c1b('0x10'));var authService=require(_0x8c1b('0x11'));var qs=require(_0x8c1b('0x12'));var as=require(_0x8c1b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c1b('0x14'))('api');var utils=require(_0x8c1b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8c1b('0x16'));var db=require(_0x8c1b('0x17'))['db'];function respondWithStatusCode(_0x4aa83d,_0x19a879){_0x19a879=_0x19a879||0xcc;return function(_0x5e1a5e){if(_0x5e1a5e){return _0x4aa83d[_0x8c1b('0x18')](_0x19a879);}return _0x4aa83d[_0x8c1b('0x19')](_0x19a879)[_0x8c1b('0x1a')]();};}function respondWithResult(_0x3a28be,_0x18f146){_0x18f146=_0x18f146||0xc8;return function(_0x1bb733){if(_0x1bb733){return _0x3a28be[_0x8c1b('0x19')](_0x18f146)[_0x8c1b('0x1b')](_0x1bb733);}};}function respondWithFilteredResult(_0x115500,_0x12b50f){return function(_0x23ba07){if(_0x23ba07){var _0x147f3a=typeof _0x12b50f[_0x8c1b('0x1c')]===_0x8c1b('0x1d')&&typeof _0x12b50f[_0x8c1b('0x1e')]===_0x8c1b('0x1d');var _0x5ad80d=_0x23ba07[_0x8c1b('0x1f')];var _0x468fdc=_0x147f3a?0x0:_0x12b50f[_0x8c1b('0x1c')];var _0x21ad39=_0x147f3a?_0x23ba07[_0x8c1b('0x1f')]:_0x12b50f['offset']+_0x12b50f[_0x8c1b('0x1e')];var _0x6d1afb;if(_0x21ad39>=_0x5ad80d){_0x21ad39=_0x5ad80d;_0x6d1afb=0xc8;}else{_0x6d1afb=0xce;}_0x115500[_0x8c1b('0x19')](_0x6d1afb);return _0x115500['set']('Content-Range',_0x468fdc+'-'+_0x21ad39+'/'+_0x5ad80d)[_0x8c1b('0x1b')](_0x23ba07);}return null;};}function patchUpdates(_0x3b5a3c){return function(_0x45cbc8){try{jsonpatch[_0x8c1b('0x20')](_0x45cbc8,_0x3b5a3c,!![]);}catch(_0x2b4c4a){return BPromise[_0x8c1b('0x21')](_0x2b4c4a);}return _0x45cbc8[_0x8c1b('0x22')]();};}function saveUpdates(_0x347554,_0x1f5f6a){return function(_0x242675){if(_0x242675){return _0x242675['update'](_0x347554)['then'](function(_0xcaaa44){return _0xcaaa44;});}return null;};}function removeEntity(_0xb23f14,_0x374f58){return function(_0x53cbaf){if(_0x53cbaf){return _0x53cbaf[_0x8c1b('0x23')]()[_0x8c1b('0x24')](function(){var _0x31e2aa=_0x53cbaf[_0x8c1b('0x25')]({'plain':!![]});var _0x28d24a=_0x8c1b('0x26');return db[_0x8c1b('0x27')][_0x8c1b('0x23')]({'where':{'type':_0x28d24a,'resourceId':_0x31e2aa['id']}})['then'](function(){return _0x53cbaf;});})[_0x8c1b('0x24')](function(){_0xb23f14[_0x8c1b('0x19')](0xcc)[_0x8c1b('0x1a')]();});}};}function handleEntityNotFound(_0x63fea5,_0x179fd5){return function(_0x1aa15c){if(!_0x1aa15c){_0x63fea5[_0x8c1b('0x18')](0x194);}return _0x1aa15c;};}function handleError(_0x50ff26,_0x3e5c54){_0x3e5c54=_0x3e5c54||0x1f4;return function(_0x121639){logger[_0x8c1b('0x28')](_0x121639[_0x8c1b('0x29')]);if(_0x121639[_0x8c1b('0x2a')]){delete _0x121639[_0x8c1b('0x2a')];}_0x50ff26[_0x8c1b('0x19')](_0x3e5c54)[_0x8c1b('0x2b')](_0x121639);};}exports['index']=function(_0x59395d,_0x1a0cd3){var _0x11988e={},_0x49933b={},_0x2659ab={'count':0x0,'rows':[]};var _0x4269d2=_[_0x8c1b('0x2c')](db[_0x8c1b('0x2d')]['rawAttributes'],function(_0xc51115){return{'name':_0xc51115['fieldName'],'type':_0xc51115['type'][_0x8c1b('0x2e')]};});_0x49933b[_0x8c1b('0x2f')]=_[_0x8c1b('0x2c')](_0x4269d2,_0x8c1b('0x2a'));_0x49933b[_0x8c1b('0x30')]=_['keys'](_0x59395d[_0x8c1b('0x30')]);_0x49933b[_0x8c1b('0x31')]=_[_0x8c1b('0x32')](_0x49933b[_0x8c1b('0x2f')],_0x49933b[_0x8c1b('0x30')]);_0x11988e['attributes']=_['intersection'](_0x49933b[_0x8c1b('0x2f')],qs['fields'](_0x59395d[_0x8c1b('0x30')][_0x8c1b('0x33')]));_0x11988e['attributes']=_0x11988e['attributes'][_0x8c1b('0x34')]?_0x11988e[_0x8c1b('0x35')]:_0x49933b[_0x8c1b('0x2f')];if(!_0x59395d[_0x8c1b('0x30')][_0x8c1b('0x36')](_0x8c1b('0x37'))){_0x11988e[_0x8c1b('0x1e')]=qs['limit'](_0x59395d[_0x8c1b('0x30')][_0x8c1b('0x1e')]);_0x11988e['offset']=qs[_0x8c1b('0x1c')](_0x59395d[_0x8c1b('0x30')][_0x8c1b('0x1c')]);}_0x11988e[_0x8c1b('0x38')]=qs['sort'](_0x59395d[_0x8c1b('0x30')]['sort']);_0x11988e[_0x8c1b('0x39')]=qs[_0x8c1b('0x31')](_[_0x8c1b('0x3a')](_0x59395d['query'],_0x49933b[_0x8c1b('0x31')]),_0x4269d2);if(_0x59395d['query'][_0x8c1b('0x3b')]){_0x11988e[_0x8c1b('0x39')]=_[_0x8c1b('0x3c')](_0x11988e[_0x8c1b('0x39')],{'$or':_['map'](_0x4269d2,function(_0x246d3c){if(_0x246d3c[_0x8c1b('0x3d')]!==_0x8c1b('0x3e')){var _0x1c034f={};_0x1c034f[_0x246d3c[_0x8c1b('0x2a')]]={'$like':'%'+_0x59395d[_0x8c1b('0x30')]['filter']+'%'};return _0x1c034f;}})});}_0x11988e=_['merge']({},_0x11988e,_0x59395d[_0x8c1b('0x3f')]);var _0x285890={'where':_0x11988e[_0x8c1b('0x39')]};return db[_0x8c1b('0x2d')][_0x8c1b('0x1f')](_0x285890)[_0x8c1b('0x24')](function(_0x374672){_0x2659ab[_0x8c1b('0x1f')]=_0x374672;if(_0x59395d[_0x8c1b('0x30')]['includeAll']){_0x11988e['include']=[{'all':!![]}];}return db[_0x8c1b('0x2d')][_0x8c1b('0x40')](_0x11988e);})[_0x8c1b('0x24')](function(_0x49ee0c){_0x2659ab['rows']=_0x49ee0c;return _0x2659ab;})['then'](respondWithFilteredResult(_0x1a0cd3,_0x11988e))[_0x8c1b('0x41')](handleError(_0x1a0cd3,null));};exports[_0x8c1b('0x42')]=function(_0x46c101,_0x1d308b){var _0xe1d871={'raw':!![],'where':{'id':_0x46c101[_0x8c1b('0x43')]['id']}},_0x39880d={};_0x39880d[_0x8c1b('0x2f')]=_['keys'](db[_0x8c1b('0x2d')]['rawAttributes']);_0x39880d[_0x8c1b('0x30')]=_['keys'](_0x46c101[_0x8c1b('0x30')]);_0x39880d[_0x8c1b('0x31')]=_[_0x8c1b('0x32')](_0x39880d[_0x8c1b('0x2f')],_0x39880d[_0x8c1b('0x30')]);_0xe1d871[_0x8c1b('0x35')]=_[_0x8c1b('0x32')](_0x39880d[_0x8c1b('0x2f')],qs[_0x8c1b('0x33')](_0x46c101[_0x8c1b('0x30')][_0x8c1b('0x33')]));_0xe1d871[_0x8c1b('0x35')]=_0xe1d871[_0x8c1b('0x35')][_0x8c1b('0x34')]?_0xe1d871['attributes']:_0x39880d[_0x8c1b('0x2f')];if(_0x46c101[_0x8c1b('0x30')]['includeAll']){_0xe1d871['include']=[{'all':!![]}];}_0xe1d871=_[_0x8c1b('0x3c')]({},_0xe1d871,_0x46c101[_0x8c1b('0x3f')]);return db[_0x8c1b('0x2d')][_0x8c1b('0x44')](_0xe1d871)[_0x8c1b('0x24')](handleEntityNotFound(_0x1d308b,null))['then'](respondWithResult(_0x1d308b,null))[_0x8c1b('0x41')](handleError(_0x1d308b,null));};exports[_0x8c1b('0x45')]=function(_0x5786eb,_0x5b15a2,_0x1a5ec8){return db['Sound'][_0x8c1b('0x44')]({'where':{'id':_0x5786eb['params']['id']},'attributes':['name',_0x8c1b('0x46'),_0x8c1b('0x47')],'raw':!![]})[_0x8c1b('0x24')](handleEntityNotFound(_0x5b15a2,null))[_0x8c1b('0x24')](function(_0x388eab){if(_0x388eab){if(!fs[_0x8c1b('0x48')](path['join'](config[_0x8c1b('0x49')],_0x8c1b('0x4a'),_0x388eab[_0x8c1b('0x46')]+'.'+_0x388eab['converted_format']))){throw new db[(_0x8c1b('0x4b'))][(_0x8c1b('0x4c'))](_0x8c1b('0x4d'));}return _0x5b15a2[_0x8c1b('0x45')](path[_0x8c1b('0x4e')](config[_0x8c1b('0x49')],_0x8c1b('0x4a'),util[_0x8c1b('0x4f')](_0x8c1b('0x50'),_0x388eab[_0x8c1b('0x46')],_0x388eab[_0x8c1b('0x47')])),util[_0x8c1b('0x4f')](_0x8c1b('0x50'),_0x388eab[_0x8c1b('0x2a')],_0x388eab[_0x8c1b('0x47')]));}return null;})[_0x8c1b('0x41')](handleError(_0x5b15a2,null));};exports[_0x8c1b('0x51')]=function(_0x2a3950,_0x2cb06e,_0x2f6d37){var _0x409990={'name':path[_0x8c1b('0x52')](_0x2a3950[_0x8c1b('0x53')][_0x8c1b('0x54')],path[_0x8c1b('0x55')](_0x2a3950['file'][_0x8c1b('0x54')])),'save_name':path[_0x8c1b('0x52')](_0x2a3950['file'][_0x8c1b('0x56')],path[_0x8c1b('0x55')](_0x2a3950[_0x8c1b('0x53')][_0x8c1b('0x56')])),'original_format':path['extname'](_0x2a3950[_0x8c1b('0x53')][_0x8c1b('0x54')])['substring'](0x1),'converted_format':_0x8c1b('0x57')};var _0x4304bc=path[_0x8c1b('0x4e')](config[_0x8c1b('0x49')],_0x8c1b('0x58'),_0x2a3950['file']['filename']);var _0x1a6d27=path[_0x8c1b('0x4e')](config['root'],_0x8c1b('0x4a'),util[_0x8c1b('0x4f')](_0x8c1b('0x50'),path[_0x8c1b('0x52')](_0x2a3950[_0x8c1b('0x53')][_0x8c1b('0x56')],path[_0x8c1b('0x55')](_0x2a3950[_0x8c1b('0x53')][_0x8c1b('0x56')])),_0x409990[_0x8c1b('0x47')]));logger[_0x8c1b('0x59')](_0x8c1b('0x5a'),_0x4304bc);logger[_0x8c1b('0x59')](_0x8c1b('0x5b'),_0x1a6d27);try{fs['chmodSync'](_0x4304bc,parseInt(_0x8c1b('0x5c'),0x8));var _0x38f847=sox['transcode'](_0x4304bc,_0x1a6d27,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x38f847['on'](_0x8c1b('0x28'),function(_0xdc26ce){fs['unlinkSync'](_0x4304bc);_0x2cb06e[_0x8c1b('0x19')](0x1f4)[_0x8c1b('0x2b')](_0xdc26ce);});_0x38f847['on'](_0x8c1b('0x5d'),function(_0xba4b85){_0x409990['original_duration']=isNaN(_0xba4b85[_0x8c1b('0x5e')])?null:_0xba4b85[_0x8c1b('0x5e')]*0x3e8;_0x409990['original_sampleCount']=isNaN(_0xba4b85[_0x8c1b('0x5f')])?null:_0xba4b85[_0x8c1b('0x5f')];_0x409990[_0x8c1b('0x60')]=isNaN(_0xba4b85[_0x8c1b('0x61')])?null:_0xba4b85[_0x8c1b('0x61')];_0x409990['original_bitRate']=isNaN(_0xba4b85[_0x8c1b('0x62')])?null:_0xba4b85[_0x8c1b('0x62')];_0x409990[_0x8c1b('0x63')]=isNaN(_0xba4b85[_0x8c1b('0x64')])?null:_0xba4b85[_0x8c1b('0x64')];});_0x38f847['on'](_0x8c1b('0x65'),function(_0x74daa9){_0x409990[_0x8c1b('0x66')]=isNaN(_0x74daa9[_0x8c1b('0x5e')])?null:_0x74daa9[_0x8c1b('0x5e')]*0x3e8;_0x409990[_0x8c1b('0x67')]=isNaN(_0x74daa9['sampleCount'])?null:_0x74daa9[_0x8c1b('0x5f')];_0x409990[_0x8c1b('0x68')]=isNaN(_0x74daa9['channelCount'])?null:_0x74daa9[_0x8c1b('0x61')];_0x409990[_0x8c1b('0x69')]=isNaN(_0x74daa9[_0x8c1b('0x62')])?null:_0x74daa9['bitRate'];_0x409990[_0x8c1b('0x6a')]=isNaN(_0x74daa9[_0x8c1b('0x64')])?null:_0x74daa9[_0x8c1b('0x64')];});_0x38f847['on']('end',function(){fs[_0x8c1b('0x6b')](_0x1a6d27,parseInt(_0x8c1b('0x5c'),0x8));return db['Sound'][_0x8c1b('0x51')](_0x409990)['then'](function(_0x198bce){var _0x5e6f8e={'role':_0x2a3950[_0x8c1b('0x6c')][_0x8c1b('0x6d')],'userProfileId':_0x2a3950[_0x8c1b('0x6c')][_0x8c1b('0x6e')]};if(!_0x5e6f8e)throw new Error(_0x8c1b('0x6f'));if(_0x5e6f8e[_0x8c1b('0x6d')]===_0x8c1b('0x70')){var _0x2324c6=_0x198bce[_0x8c1b('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x8c1b('0x44')]({'where':{'name':_0x8c1b('0x26'),'userProfileId':_0x5e6f8e['userProfileId']},'raw':!![]})[_0x8c1b('0x24')](function(_0x4cddc5){if(_0x4cddc5&&_0x4cddc5[_0x8c1b('0x71')]===0x0){return db['UserProfileResource'][_0x8c1b('0x51')]({'name':_0x2324c6[_0x8c1b('0x2a')],'resourceId':_0x2324c6['id'],'type':_0x4cddc5['name'],'sectionId':_0x4cddc5['id']},{})[_0x8c1b('0x24')](function(){return _0x198bce;});}else{return _0x198bce;}})[_0x8c1b('0x41')](function(_0x5df41b){logger[_0x8c1b('0x28')](_0x8c1b('0x72'),_0x5df41b);throw _0x5df41b;});}return _0x198bce;})[_0x8c1b('0x24')](respondWithResult(_0x2cb06e,null))[_0x8c1b('0x41')](handleError(_0x2cb06e,null));});_0x38f847[_0x8c1b('0x73')]();}catch(_0x27b7bf){_0x2cb06e['status'](0x1f4)[_0x8c1b('0x2b')](_0x27b7bf);}};exports[_0x8c1b('0x74')]=function(_0x303bf5,_0x195c59,_0x22b110){return db[_0x8c1b('0x2d')][_0x8c1b('0x44')]({'where':{'id':_0x303bf5[_0x8c1b('0x43')]['id']}})['then'](handleEntityNotFound(_0x195c59,null))['then'](saveUpdates(_[_0x8c1b('0x3a')](_0x303bf5[_0x8c1b('0x6c')],[_0x8c1b('0x2a'),'description']),null))[_0x8c1b('0x24')](respondWithResult(_0x195c59,null))[_0x8c1b('0x41')](handleError(_0x195c59,null));};exports[_0x8c1b('0x75')]=function(_0x4f426c,_0x3766ed,_0x5be518){return db['Sound'][_0x8c1b('0x44')]({'where':{'id':_0x4f426c['params']['id']}})[_0x8c1b('0x24')](function(_0x241525){if(_0x241525){return _0x241525['destroy']();}})['then'](function(_0x401202){var _0x1838dd=path['join'](config[_0x8c1b('0x49')],_0x8c1b('0x58'),util['format'](_0x8c1b('0x50'),_0x401202[_0x8c1b('0x46')],_0x401202[_0x8c1b('0x76')]));var _0x3d80db=path[_0x8c1b('0x4e')](config['root'],_0x8c1b('0x4a'),util['format'](_0x8c1b('0x50'),_0x401202[_0x8c1b('0x46')],_0x401202[_0x8c1b('0x47')]));fs[_0x8c1b('0x77')](_0x1838dd);fs[_0x8c1b('0x77')](_0x3d80db);return _0x401202;})[_0x8c1b('0x24')](function(_0x2093c2){if(_0x2093c2){return _0x3766ed[_0x8c1b('0x19')](0xcc)[_0x8c1b('0x1a')]();}})[_0x8c1b('0x24')](handleEntityNotFound(_0x3766ed,null))[_0x8c1b('0x41')](handleError(_0x3766ed,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e8122b5..cd2e1b1 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 _0x6a04=['Sound','tools_sounds','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./sound.attributes','exports','define'];(function(_0x23db18,_0x24670f){var _0x3c2f9a=function(_0x1a382e){while(--_0x1a382e){_0x23db18['push'](_0x23db18['shift']());}};_0x3c2f9a(++_0x24670f);}(_0x6a04,0xd2));var _0x46a0=function(_0x55151f,_0x46227c){_0x55151f=_0x55151f-0x0;var _0x5a4dc7=_0x6a04[_0x55151f];return _0x5a4dc7;};'use strict';var _=require(_0x46a0('0x0'));var util=require(_0x46a0('0x1'));var logger=require('../../config/logger')(_0x46a0('0x2'));var moment=require(_0x46a0('0x3'));var BPromise=require(_0x46a0('0x4'));var rp=require(_0x46a0('0x5'));var fs=require('fs');var path=require(_0x46a0('0x6'));var rimraf=require(_0x46a0('0x7'));var config=require('../../config/environment');var attributes=require(_0x46a0('0x8'));module[_0x46a0('0x9')]=function(_0x1b43d5,_0x469b90){return _0x1b43d5[_0x46a0('0xa')](_0x46a0('0xb'),attributes,{'tableName':_0x46a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc16e=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','exports','tools_sounds'];(function(_0x46a141,_0x2d063f){var _0x1c1631=function(_0x5ead16){while(--_0x5ead16){_0x46a141['push'](_0x46a141['shift']());}};_0x1c1631(++_0x2d063f);}(_0xc16e,0x1b8));var _0xec16=function(_0x1d6aa3,_0x372b31){_0x1d6aa3=_0x1d6aa3-0x0;var _0xe4c8c4=_0xc16e[_0x1d6aa3];return _0xe4c8c4;};'use strict';var _=require('lodash');var util=require(_0xec16('0x0'));var logger=require(_0xec16('0x1'))('api');var moment=require(_0xec16('0x2'));var BPromise=require(_0xec16('0x3'));var rp=require(_0xec16('0x4'));var fs=require('fs');var path=require(_0xec16('0x5'));var rimraf=require('rimraf');var config=require(_0xec16('0x6'));var attributes=require(_0xec16('0x7'));module[_0xec16('0x8')]=function(_0x6171be,_0x11d6fb){return _0x6171be['define']('Sound',attributes,{'tableName':_0xec16('0x9'),'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 7bee2e4..bcea5fd 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 _0x7819=['Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0x7819,0x19b));var _0x9781=function(_0x415e62,_0x5cefe9){_0x415e62=_0x415e62-0x0;var _0x31ef09=_0x7819[_0x415e62];return _0x31ef09;};'use strict';var _=require(_0x9781('0x0'));var util=require('util');var moment=require(_0x9781('0x1'));var BPromise=require(_0x9781('0x2'));var rs=require(_0x9781('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9781('0x4'))['db'];var utils=require(_0x9781('0x5'));var logger=require('../../config/logger')(_0x9781('0x6'));var config=require(_0x9781('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9781('0x8')][_0x9781('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x522693,_0x57f99b,_0x40d373){return new BPromise(function(_0x5af4d8,_0x2bb297){return client[_0x9781('0xa')](_0x522693,_0x40d373)[_0x9781('0xb')](function(_0x37fc66){logger[_0x9781('0xc')]('Sound,\x20%s,\x20%s',_0x57f99b,_0x9781('0xd'));logger[_0x9781('0xe')](_0x9781('0xf'),_0x57f99b,'request\x20sent',JSON['stringify'](_0x37fc66));if(_0x37fc66[_0x9781('0x10')]){if(_0x37fc66[_0x9781('0x10')][_0x9781('0x11')]===0x1f4){logger['error'](_0x9781('0x12'),_0x57f99b,_0x37fc66[_0x9781('0x10')][_0x9781('0x13')]);return _0x2bb297(_0x37fc66[_0x9781('0x10')][_0x9781('0x13')]);}logger[_0x9781('0x10')]('Sound,\x20%s,\x20%s',_0x57f99b,_0x37fc66['error']['message']);return _0x5af4d8(_0x37fc66[_0x9781('0x10')]['message']);}else{logger[_0x9781('0xc')]('Sound,\x20%s,\x20%s',_0x57f99b,'request\x20sent');_0x5af4d8(_0x37fc66[_0x9781('0x14')][_0x9781('0x13')]);}})[_0x9781('0x15')](function(_0x26498f){logger['error'](_0x9781('0x12'),_0x57f99b,_0x26498f);_0x2bb297(_0x26498f);});});}exports[_0x9781('0x16')]=function(_0x1b0850){var _0x16a98a=this;return new Promise(function(_0x4eb375,_0x3711b4){return db[_0x9781('0x17')][_0x9781('0x18')]({'raw':_0x1b0850[_0x9781('0x19')]?_0x1b0850['options'][_0x9781('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b0850[_0x9781('0x19')]?_0x1b0850[_0x9781('0x19')][_0x9781('0x1b')]||null:null,'attributes':_0x1b0850[_0x9781('0x19')]?_0x1b0850[_0x9781('0x19')][_0x9781('0x1c')]||null:null,'include':_0x1b0850['options']?_0x1b0850[_0x9781('0x19')][_0x9781('0x1d')]?_[_0x9781('0x1e')](_0x1b0850[_0x9781('0x19')][_0x9781('0x1d')],function(_0x2aca15){return{'model':db[_0x2aca15[_0x9781('0x1f')]],'as':_0x2aca15['as'],'attributes':_0x2aca15[_0x9781('0x1c')],'include':_0x2aca15[_0x9781('0x1d')]?_[_0x9781('0x1e')](_0x2aca15[_0x9781('0x1d')],function(_0x1aed0b){return{'model':db[_0x1aed0b[_0x9781('0x1f')]],'as':_0x1aed0b['as'],'attributes':_0x1aed0b[_0x9781('0x1c')],'include':_0x1aed0b['include']?_['map'](_0x1aed0b['include'],function(_0xdb4d76){return{'model':db[_0xdb4d76['model']],'as':_0xdb4d76['as'],'attributes':_0xdb4d76[_0x9781('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9781('0xb')](function(_0x329bda){logger[_0x9781('0xc')](_0x9781('0x16'),_0x1b0850);logger[_0x9781('0xe')](_0x9781('0x16'),_0x1b0850,JSON[_0x9781('0x20')](_0x329bda));_0x4eb375(_0x329bda);})[_0x9781('0x15')](function(_0x1387a2){logger[_0x9781('0x10')](_0x9781('0x16'),_0x1387a2[_0x9781('0x13')],_0x1b0850);_0x3711b4(_0x16a98a['error'](0x1f4,_0x1387a2['message']));});});}; \ No newline at end of file +var _0x2196=['message','result','catch','Sound','find','options','raw','where','attributes','include','map','model','ShowSound','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x155e0f,_0x130f70){var _0x22c0cc=function(_0x521861){while(--_0x521861){_0x155e0f['push'](_0x155e0f['shift']());}};_0x22c0cc(++_0x130f70);}(_0x2196,0x95));var _0x6219=function(_0x545586,_0x5f20ec){_0x545586=_0x545586-0x0;var _0x4f40e4=_0x2196[_0x545586];return _0x4f40e4;};'use strict';var _=require('lodash');var util=require(_0x6219('0x0'));var moment=require('moment');var BPromise=require(_0x6219('0x1'));var rs=require(_0x6219('0x2'));var fs=require('fs');var Redis=require(_0x6219('0x3'));var db=require(_0x6219('0x4'))['db'];var utils=require(_0x6219('0x5'));var logger=require(_0x6219('0x6'))(_0x6219('0x7'));var config=require(_0x6219('0x8'));var jayson=require(_0x6219('0x9'));var client=jayson[_0x6219('0xa')][_0x6219('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c3c73,_0x454423,_0x17cc16){return new BPromise(function(_0x500778,_0x4a55b6){return client[_0x6219('0xc')](_0x2c3c73,_0x17cc16)[_0x6219('0xd')](function(_0x117092){logger[_0x6219('0xe')](_0x6219('0xf'),_0x454423,_0x6219('0x10'));logger[_0x6219('0x11')]('Sound,\x20%s,\x20%s,\x20%s',_0x454423,'request\x20sent',JSON[_0x6219('0x12')](_0x117092));if(_0x117092['error']){if(_0x117092[_0x6219('0x13')][_0x6219('0x14')]===0x1f4){logger[_0x6219('0x13')](_0x6219('0xf'),_0x454423,_0x117092['error'][_0x6219('0x15')]);return _0x4a55b6(_0x117092[_0x6219('0x13')][_0x6219('0x15')]);}logger['error'](_0x6219('0xf'),_0x454423,_0x117092[_0x6219('0x13')][_0x6219('0x15')]);return _0x500778(_0x117092[_0x6219('0x13')][_0x6219('0x15')]);}else{logger['info'](_0x6219('0xf'),_0x454423,_0x6219('0x10'));_0x500778(_0x117092[_0x6219('0x16')][_0x6219('0x15')]);}})[_0x6219('0x17')](function(_0x386ed0){logger[_0x6219('0x13')]('Sound,\x20%s,\x20%s',_0x454423,_0x386ed0);_0x4a55b6(_0x386ed0);});});}exports['ShowSound']=function(_0x15442c){var _0x6db565=this;return new Promise(function(_0x23ce4c,_0x3804c4){return db[_0x6219('0x18')][_0x6219('0x19')]({'raw':_0x15442c[_0x6219('0x1a')]?_0x15442c[_0x6219('0x1a')][_0x6219('0x1b')]===undefined?!![]:![]:!![],'where':_0x15442c[_0x6219('0x1a')]?_0x15442c[_0x6219('0x1a')][_0x6219('0x1c')]||null:null,'attributes':_0x15442c[_0x6219('0x1a')]?_0x15442c['options'][_0x6219('0x1d')]||null:null,'include':_0x15442c[_0x6219('0x1a')]?_0x15442c[_0x6219('0x1a')][_0x6219('0x1e')]?_[_0x6219('0x1f')](_0x15442c[_0x6219('0x1a')][_0x6219('0x1e')],function(_0x1349ba){return{'model':db[_0x1349ba[_0x6219('0x20')]],'as':_0x1349ba['as'],'attributes':_0x1349ba['attributes'],'include':_0x1349ba['include']?_[_0x6219('0x1f')](_0x1349ba['include'],function(_0x12db3a){return{'model':db[_0x12db3a[_0x6219('0x20')]],'as':_0x12db3a['as'],'attributes':_0x12db3a[_0x6219('0x1d')],'include':_0x12db3a[_0x6219('0x1e')]?_['map'](_0x12db3a[_0x6219('0x1e')],function(_0x19d31d){return{'model':db[_0x19d31d[_0x6219('0x20')]],'as':_0x19d31d['as'],'attributes':_0x19d31d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c54ff){logger[_0x6219('0xe')](_0x6219('0x21'),_0x15442c);logger[_0x6219('0x11')](_0x6219('0x21'),_0x15442c,JSON[_0x6219('0x12')](_0x3c54ff));_0x23ce4c(_0x3c54ff);})[_0x6219('0x17')](function(_0x1f28d5){logger[_0x6219('0x13')](_0x6219('0x21'),_0x1f28d5['message'],_0x15442c);_0x3804c4(_0x6db565[_0x6219('0x13')](0x1f4,_0x1f28d5[_0x6219('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index fba53cd..9118256 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(_0x3cff6c,_0x107a6c){var _0x442fb7=function(_0x40221c){while(--_0x40221c){_0x3cff6c['push'](_0x3cff6c['shift']());}};_0x442fb7(++_0x107a6c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x0b0e[_0x492af5];return _0x59f529;};'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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x2ed7df,_0x322394){var _0xd2b472=function(_0x53d346){while(--_0x53d346){_0x2ed7df['push'](_0x2ed7df['shift']());}};_0xd2b472(++_0x322394);}(_0x2032,0xd9));var _0x2203=function(_0x14581e,_0xe9802e){_0x14581e=_0x14581e-0x0;var _0xec5e47=_0x2032[_0x14581e];return _0xec5e47;};'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/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 528afba..07a90b8 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 _0x538a=['exports','STRING','TEXT','medium','ENUM','sequelize'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x538a,0x1cd));var _0xa538=function(_0x421a4b,_0x37d468){_0x421a4b=_0x421a4b-0x0;var _0x4dc53e=_0x538a[_0x421a4b];return _0x4dc53e;};'use strict';var Sequelize=require(_0xa538('0x0'));module[_0xa538('0x1')]={'uniqueid':{'type':Sequelize[_0xa538('0x2')]},'body':{'type':Sequelize[_0xa538('0x3')](_0xa538('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xa538('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xa538('0x2')]},'providerResponse':{'type':Sequelize[_0xa538('0x3')]}}; \ No newline at end of file +var _0xcf1d=['STRING','ENUM','out','sequelize'];(function(_0x457028,_0x182a97){var _0x36d5c1=function(_0x1d4e55){while(--_0x1d4e55){_0x457028['push'](_0x457028['shift']());}};_0x36d5c1(++_0x182a97);}(_0xcf1d,0x127));var _0xdcf1=function(_0x3a94d8,_0x25334b){_0x3a94d8=_0x3a94d8-0x0;var _0x5c74da=_0xcf1d[_0x3a94d8];return _0x5c74da;};'use strict';var Sequelize=require(_0xdcf1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdcf1('0x1')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xdcf1('0x2')]('in',_0xdcf1('0x3')),'defaultValue':_0xdcf1('0x3'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 6035fb4..54779fc 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 _0xf8cd=['map','SquareMessage','fieldName','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send'];(function(_0x58dc37,_0x567578){var _0x5c4f65=function(_0x301d81){while(--_0x301d81){_0x58dc37['push'](_0x58dc37['shift']());}};_0x5c4f65(++_0x567578);}(_0xf8cd,0xf7));var _0xdf8c=function(_0x635ee8,_0x3e3259){_0x635ee8=_0x635ee8-0x0;var _0x1ef0ca=_0xf8cd[_0x635ee8];return _0x1ef0ca;};'use strict';var emlformat=require(_0xdf8c('0x0'));var rimraf=require(_0xdf8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf8c('0x2'));var rp=require(_0xdf8c('0x3'));var moment=require(_0xdf8c('0x4'));var BPromise=require(_0xdf8c('0x5'));var Mustache=require(_0xdf8c('0x6'));var util=require(_0xdf8c('0x7'));var path=require(_0xdf8c('0x8'));var sox=require(_0xdf8c('0x9'));var csv=require(_0xdf8c('0xa'));var ejs=require(_0xdf8c('0xb'));var fs=require('fs');var fs_extra=require(_0xdf8c('0xc'));var _=require('lodash');var squel=require(_0xdf8c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdf8c('0xa'));var querystring=require(_0xdf8c('0xe'));var Papa=require(_0xdf8c('0xf'));var Redis=require('ioredis');var authService=require(_0xdf8c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf8c('0x11'));var logger=require(_0xdf8c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xdf8c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x437dab,_0x471e65){_0x471e65=_0x471e65||0xcc;return function(_0x30e72d){if(_0x30e72d){return _0x437dab[_0xdf8c('0x14')](_0x471e65);}return _0x437dab[_0xdf8c('0x15')](_0x471e65)['end']();};}function respondWithResult(_0x212799,_0x130fcc){_0x130fcc=_0x130fcc||0xc8;return function(_0x19d354){if(_0x19d354){return _0x212799[_0xdf8c('0x15')](_0x130fcc)[_0xdf8c('0x16')](_0x19d354);}};}function respondWithFilteredResult(_0x159daf,_0x38b89d){return function(_0x35664c){if(_0x35664c){var _0x3ea73b=typeof _0x38b89d[_0xdf8c('0x17')]===_0xdf8c('0x18')&&typeof _0x38b89d['limit']===_0xdf8c('0x18');var _0x3288bb=_0x35664c[_0xdf8c('0x19')];var _0x161105=_0x3ea73b?0x0:_0x38b89d[_0xdf8c('0x17')];var _0xf3300b=_0x3ea73b?_0x35664c['count']:_0x38b89d[_0xdf8c('0x17')]+_0x38b89d['limit'];var _0x51c9ce;if(_0xf3300b>=_0x3288bb){_0xf3300b=_0x3288bb;_0x51c9ce=0xc8;}else{_0x51c9ce=0xce;}_0x159daf[_0xdf8c('0x15')](_0x51c9ce);return _0x159daf[_0xdf8c('0x1a')](_0xdf8c('0x1b'),_0x161105+'-'+_0xf3300b+'/'+_0x3288bb)[_0xdf8c('0x16')](_0x35664c);}return null;};}function patchUpdates(_0x52291c){return function(_0x1be954){try{jsonpatch[_0xdf8c('0x1c')](_0x1be954,_0x52291c,!![]);}catch(_0x39eace){return BPromise[_0xdf8c('0x1d')](_0x39eace);}return _0x1be954[_0xdf8c('0x1e')]();};}function saveUpdates(_0x542801,_0x486262){return function(_0x55b962){if(_0x55b962){return _0x55b962[_0xdf8c('0x1f')](_0x542801)[_0xdf8c('0x20')](function(_0x573e85){return _0x573e85;});}return null;};}function removeEntity(_0x4c2f9d,_0x5b9ebc){return function(_0x4b5964){if(_0x4b5964){return _0x4b5964[_0xdf8c('0x21')]()[_0xdf8c('0x20')](function(){_0x4c2f9d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d3146,_0x4f8ff0){return function(_0x314004){if(!_0x314004){_0x4d3146['sendStatus'](0x194);}return _0x314004;};}function handleError(_0xd64009,_0x2248cd){_0x2248cd=_0x2248cd||0x1f4;return function(_0x2afa60){logger[_0xdf8c('0x22')](_0x2afa60[_0xdf8c('0x23')]);if(_0x2afa60['name']){delete _0x2afa60['name'];}_0xd64009[_0xdf8c('0x15')](_0x2248cd)[_0xdf8c('0x24')](_0x2afa60);};}exports['index']=function(_0x33c843,_0x56e50f){var _0x19d11a={},_0x24918b={},_0x2fd874={'count':0x0,'rows':[]};var _0x17ad91=_[_0xdf8c('0x25')](db[_0xdf8c('0x26')]['rawAttributes'],function(_0xf56f02){return{'name':_0xf56f02[_0xdf8c('0x27')],'type':_0xf56f02['type'][_0xdf8c('0x28')]};});_0x24918b[_0xdf8c('0x29')]=_[_0xdf8c('0x25')](_0x17ad91,_0xdf8c('0x2a'));_0x24918b[_0xdf8c('0x2b')]=_[_0xdf8c('0x2c')](_0x33c843[_0xdf8c('0x2b')]);_0x24918b['filters']=_['intersection'](_0x24918b[_0xdf8c('0x29')],_0x24918b['query']);_0x19d11a[_0xdf8c('0x2d')]=_[_0xdf8c('0x2e')](_0x24918b[_0xdf8c('0x29')],qs[_0xdf8c('0x2f')](_0x33c843[_0xdf8c('0x2b')][_0xdf8c('0x2f')]));_0x19d11a[_0xdf8c('0x2d')]=_0x19d11a[_0xdf8c('0x2d')][_0xdf8c('0x30')]?_0x19d11a['attributes']:_0x24918b[_0xdf8c('0x29')];if(!_0x33c843[_0xdf8c('0x2b')][_0xdf8c('0x31')](_0xdf8c('0x32'))){_0x19d11a[_0xdf8c('0x33')]=qs[_0xdf8c('0x33')](_0x33c843[_0xdf8c('0x2b')][_0xdf8c('0x33')]);_0x19d11a[_0xdf8c('0x17')]=qs[_0xdf8c('0x17')](_0x33c843[_0xdf8c('0x2b')][_0xdf8c('0x17')]);}_0x19d11a['order']=qs['sort'](_0x33c843['query'][_0xdf8c('0x34')]);_0x19d11a[_0xdf8c('0x35')]=qs[_0xdf8c('0x36')](_['pick'](_0x33c843[_0xdf8c('0x2b')],_0x24918b[_0xdf8c('0x36')]),_0x17ad91);if(_0x33c843['query'][_0xdf8c('0x37')]){_0x19d11a['where']=_[_0xdf8c('0x38')](_0x19d11a['where'],{'$or':_[_0xdf8c('0x25')](_0x17ad91,function(_0x4737a5){if(_0x4737a5[_0xdf8c('0x39')]!==_0xdf8c('0x3a')){var _0x10c5e3={};_0x10c5e3[_0x4737a5[_0xdf8c('0x2a')]]={'$like':'%'+_0x33c843[_0xdf8c('0x2b')][_0xdf8c('0x37')]+'%'};return _0x10c5e3;}})});}_0x19d11a=_[_0xdf8c('0x38')]({},_0x19d11a,_0x33c843['options']);var _0xa7a253={'where':_0x19d11a[_0xdf8c('0x35')]};return db[_0xdf8c('0x26')][_0xdf8c('0x19')](_0xa7a253)[_0xdf8c('0x20')](function(_0x31cdb3){_0x2fd874[_0xdf8c('0x19')]=_0x31cdb3;if(_0x33c843[_0xdf8c('0x2b')][_0xdf8c('0x3b')]){_0x19d11a['include']=[{'all':!![]}];}return db['SquareMessage'][_0xdf8c('0x3c')](_0x19d11a);})[_0xdf8c('0x20')](function(_0x14f97e){_0x2fd874[_0xdf8c('0x3d')]=_0x14f97e;return _0x2fd874;})[_0xdf8c('0x20')](respondWithFilteredResult(_0x56e50f,_0x19d11a))[_0xdf8c('0x3e')](handleError(_0x56e50f,null));};exports[_0xdf8c('0x3f')]=function(_0x3d0555,_0x4010f2){var _0x2fc0e8={'raw':!![],'where':{'id':_0x3d0555[_0xdf8c('0x40')]['id']}},_0x166844={};_0x166844[_0xdf8c('0x29')]=_[_0xdf8c('0x2c')](db[_0xdf8c('0x26')][_0xdf8c('0x41')]);_0x166844[_0xdf8c('0x2b')]=_['keys'](_0x3d0555[_0xdf8c('0x2b')]);_0x166844[_0xdf8c('0x36')]=_[_0xdf8c('0x2e')](_0x166844['model'],_0x166844[_0xdf8c('0x2b')]);_0x2fc0e8['attributes']=_[_0xdf8c('0x2e')](_0x166844['model'],qs[_0xdf8c('0x2f')](_0x3d0555['query']['fields']));_0x2fc0e8['attributes']=_0x2fc0e8[_0xdf8c('0x2d')][_0xdf8c('0x30')]?_0x2fc0e8[_0xdf8c('0x2d')]:_0x166844['model'];if(_0x3d0555[_0xdf8c('0x2b')][_0xdf8c('0x3b')]){_0x2fc0e8[_0xdf8c('0x42')]=[{'all':!![]}];}_0x2fc0e8=_[_0xdf8c('0x38')]({},_0x2fc0e8,_0x3d0555[_0xdf8c('0x43')]);return db[_0xdf8c('0x26')]['find'](_0x2fc0e8)[_0xdf8c('0x20')](handleEntityNotFound(_0x4010f2,null))['then'](respondWithResult(_0x4010f2,null))['catch'](handleError(_0x4010f2,null));};exports[_0xdf8c('0x44')]=function(_0x53b228,_0x358cbf){return db[_0xdf8c('0x26')][_0xdf8c('0x44')](_0x53b228['body'],{})[_0xdf8c('0x20')](respondWithResult(_0x358cbf,0xc9))[_0xdf8c('0x3e')](handleError(_0x358cbf,null));};exports[_0xdf8c('0x1f')]=function(_0x4b09fa,_0x471df2){if(_0x4b09fa[_0xdf8c('0x45')]['id']){delete _0x4b09fa['body']['id'];}return db['SquareMessage'][_0xdf8c('0x46')]({'where':{'id':_0x4b09fa[_0xdf8c('0x40')]['id']}})[_0xdf8c('0x20')](handleEntityNotFound(_0x471df2,null))[_0xdf8c('0x20')](saveUpdates(_0x4b09fa['body'],null))[_0xdf8c('0x20')](respondWithResult(_0x471df2,null))[_0xdf8c('0x3e')](handleError(_0x471df2,null));};exports[_0xdf8c('0x21')]=function(_0x20c5d8,_0x525163){return db['SquareMessage'][_0xdf8c('0x46')]({'where':{'id':_0x20c5d8[_0xdf8c('0x40')]['id']}})[_0xdf8c('0x20')](handleEntityNotFound(_0x525163,null))[_0xdf8c('0x20')](removeEntity(_0x525163,null))[_0xdf8c('0x3e')](handleError(_0x525163,null));}; \ No newline at end of file +var _0x383b=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','findAll','show','params','include','find','catch','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x40c0d5,_0x36d720){var _0x81c640=function(_0x78a988){while(--_0x78a988){_0x40c0d5['push'](_0x40c0d5['shift']());}};_0x81c640(++_0x36d720);}(_0x383b,0x89));var _0xb383=function(_0x436019,_0x3030a5){_0x436019=_0x436019-0x0;var _0x387dda=_0x383b[_0x436019];return _0x387dda;};'use strict';var emlformat=require(_0xb383('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb383('0x1'));var jsonpatch=require(_0xb383('0x2'));var rp=require(_0xb383('0x3'));var moment=require('moment');var BPromise=require(_0xb383('0x4'));var Mustache=require('mustache');var util=require(_0xb383('0x5'));var path=require(_0xb383('0x6'));var sox=require(_0xb383('0x7'));var csv=require(_0xb383('0x8'));var ejs=require(_0xb383('0x9'));var fs=require('fs');var fs_extra=require(_0xb383('0xa'));var _=require('lodash');var squel=require(_0xb383('0xb'));var crypto=require(_0xb383('0xc'));var jsforce=require(_0xb383('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb383('0xe'));var Papa=require(_0xb383('0xf'));var Redis=require(_0xb383('0x10'));var authService=require(_0xb383('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb383('0x12'));var hardwareService=require(_0xb383('0x13'));var logger=require(_0xb383('0x14'))(_0xb383('0x15'));var utils=require(_0xb383('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb383('0x17'));var db=require(_0xb383('0x18'))['db'];function respondWithStatusCode(_0x590783,_0x22001f){_0x22001f=_0x22001f||0xcc;return function(_0x16091f){if(_0x16091f){return _0x590783[_0xb383('0x19')](_0x22001f);}return _0x590783[_0xb383('0x1a')](_0x22001f)[_0xb383('0x1b')]();};}function respondWithResult(_0x1e8107,_0x41f716){_0x41f716=_0x41f716||0xc8;return function(_0x5f1c6e){if(_0x5f1c6e){return _0x1e8107[_0xb383('0x1a')](_0x41f716)[_0xb383('0x1c')](_0x5f1c6e);}};}function respondWithFilteredResult(_0x1cdcb7,_0xfbc68f){return function(_0x4b3cb5){if(_0x4b3cb5){var _0x41cf3f=typeof _0xfbc68f[_0xb383('0x1d')]===_0xb383('0x1e')&&typeof _0xfbc68f['limit']===_0xb383('0x1e');var _0x24a72e=_0x4b3cb5[_0xb383('0x1f')];var _0x11d0ed=_0x41cf3f?0x0:_0xfbc68f[_0xb383('0x1d')];var _0x421a36=_0x41cf3f?_0x4b3cb5['count']:_0xfbc68f[_0xb383('0x1d')]+_0xfbc68f['limit'];var _0x151642;if(_0x421a36>=_0x24a72e){_0x421a36=_0x24a72e;_0x151642=0xc8;}else{_0x151642=0xce;}_0x1cdcb7[_0xb383('0x1a')](_0x151642);return _0x1cdcb7[_0xb383('0x20')](_0xb383('0x21'),_0x11d0ed+'-'+_0x421a36+'/'+_0x24a72e)[_0xb383('0x1c')](_0x4b3cb5);}return null;};}function patchUpdates(_0x58bedb){return function(_0x1c9b4f){try{jsonpatch[_0xb383('0x22')](_0x1c9b4f,_0x58bedb,!![]);}catch(_0x1c0246){return BPromise['reject'](_0x1c0246);}return _0x1c9b4f[_0xb383('0x23')]();};}function saveUpdates(_0x45158e,_0x3c354c){return function(_0x571f83){if(_0x571f83){return _0x571f83['update'](_0x45158e)[_0xb383('0x24')](function(_0x127d1b){return _0x127d1b;});}return null;};}function removeEntity(_0x306dd7,_0x38d029){return function(_0xb0d2a8){if(_0xb0d2a8){return _0xb0d2a8[_0xb383('0x25')]()[_0xb383('0x24')](function(){_0x306dd7[_0xb383('0x1a')](0xcc)[_0xb383('0x1b')]();});}};}function handleEntityNotFound(_0x48ceef,_0x30f704){return function(_0x509ea6){if(!_0x509ea6){_0x48ceef[_0xb383('0x19')](0x194);}return _0x509ea6;};}function handleError(_0xbab0f6,_0xa5c39a){_0xa5c39a=_0xa5c39a||0x1f4;return function(_0x39f1fb){logger[_0xb383('0x26')](_0x39f1fb[_0xb383('0x27')]);if(_0x39f1fb[_0xb383('0x28')]){delete _0x39f1fb['name'];}_0xbab0f6[_0xb383('0x1a')](_0xa5c39a)[_0xb383('0x29')](_0x39f1fb);};}exports[_0xb383('0x2a')]=function(_0x2d304c,_0x4daf45){var _0x3797b7={},_0x10ea31={},_0x4ccb9c={'count':0x0,'rows':[]};var _0x1178db=_[_0xb383('0x2b')](db[_0xb383('0x2c')][_0xb383('0x2d')],function(_0x5d0a58){return{'name':_0x5d0a58[_0xb383('0x2e')],'type':_0x5d0a58[_0xb383('0x2f')]['key']};});_0x10ea31[_0xb383('0x30')]=_[_0xb383('0x2b')](_0x1178db,_0xb383('0x28'));_0x10ea31[_0xb383('0x31')]=_[_0xb383('0x32')](_0x2d304c[_0xb383('0x31')]);_0x10ea31['filters']=_[_0xb383('0x33')](_0x10ea31[_0xb383('0x30')],_0x10ea31[_0xb383('0x31')]);_0x3797b7[_0xb383('0x34')]=_[_0xb383('0x33')](_0x10ea31[_0xb383('0x30')],qs[_0xb383('0x35')](_0x2d304c[_0xb383('0x31')]['fields']));_0x3797b7[_0xb383('0x34')]=_0x3797b7[_0xb383('0x34')][_0xb383('0x36')]?_0x3797b7['attributes']:_0x10ea31[_0xb383('0x30')];if(!_0x2d304c[_0xb383('0x31')]['hasOwnProperty'](_0xb383('0x37'))){_0x3797b7[_0xb383('0x38')]=qs[_0xb383('0x38')](_0x2d304c['query'][_0xb383('0x38')]);_0x3797b7[_0xb383('0x1d')]=qs[_0xb383('0x1d')](_0x2d304c[_0xb383('0x31')][_0xb383('0x1d')]);}_0x3797b7[_0xb383('0x39')]=qs['sort'](_0x2d304c[_0xb383('0x31')][_0xb383('0x3a')]);_0x3797b7[_0xb383('0x3b')]=qs['filters'](_[_0xb383('0x3c')](_0x2d304c[_0xb383('0x31')],_0x10ea31[_0xb383('0x3d')]),_0x1178db);if(_0x2d304c[_0xb383('0x31')][_0xb383('0x3e')]){_0x3797b7[_0xb383('0x3b')]=_[_0xb383('0x3f')](_0x3797b7['where'],{'$or':_['map'](_0x1178db,function(_0x354295){if(_0x354295[_0xb383('0x2f')]!==_0xb383('0x40')){var _0x9fa900={};_0x9fa900[_0x354295[_0xb383('0x28')]]={'$like':'%'+_0x2d304c[_0xb383('0x31')][_0xb383('0x3e')]+'%'};return _0x9fa900;}})});}_0x3797b7=_[_0xb383('0x3f')]({},_0x3797b7,_0x2d304c['options']);var _0x232598={'where':_0x3797b7[_0xb383('0x3b')]};return db[_0xb383('0x2c')][_0xb383('0x1f')](_0x232598)['then'](function(_0x20c0c4){_0x4ccb9c[_0xb383('0x1f')]=_0x20c0c4;if(_0x2d304c['query'][_0xb383('0x41')]){_0x3797b7['include']=[{'all':!![]}];}return db[_0xb383('0x2c')][_0xb383('0x42')](_0x3797b7);})[_0xb383('0x24')](function(_0x1d50ea){_0x4ccb9c['rows']=_0x1d50ea;return _0x4ccb9c;})[_0xb383('0x24')](respondWithFilteredResult(_0x4daf45,_0x3797b7))['catch'](handleError(_0x4daf45,null));};exports[_0xb383('0x43')]=function(_0x4bb0ee,_0x282fd2){var _0x118b25={'raw':!![],'where':{'id':_0x4bb0ee[_0xb383('0x44')]['id']}},_0x272b35={};_0x272b35[_0xb383('0x30')]=_[_0xb383('0x32')](db[_0xb383('0x2c')][_0xb383('0x2d')]);_0x272b35[_0xb383('0x31')]=_[_0xb383('0x32')](_0x4bb0ee[_0xb383('0x31')]);_0x272b35['filters']=_[_0xb383('0x33')](_0x272b35[_0xb383('0x30')],_0x272b35[_0xb383('0x31')]);_0x118b25['attributes']=_[_0xb383('0x33')](_0x272b35[_0xb383('0x30')],qs[_0xb383('0x35')](_0x4bb0ee['query']['fields']));_0x118b25[_0xb383('0x34')]=_0x118b25[_0xb383('0x34')]['length']?_0x118b25[_0xb383('0x34')]:_0x272b35[_0xb383('0x30')];if(_0x4bb0ee[_0xb383('0x31')][_0xb383('0x41')]){_0x118b25[_0xb383('0x45')]=[{'all':!![]}];}_0x118b25=_[_0xb383('0x3f')]({},_0x118b25,_0x4bb0ee['options']);return db[_0xb383('0x2c')][_0xb383('0x46')](_0x118b25)['then'](handleEntityNotFound(_0x282fd2,null))['then'](respondWithResult(_0x282fd2,null))[_0xb383('0x47')](handleError(_0x282fd2,null));};exports['create']=function(_0x43cd23,_0x10d814){return db['SquareMessage'][_0xb383('0x48')](_0x43cd23[_0xb383('0x49')],{})[_0xb383('0x24')](respondWithResult(_0x10d814,0xc9))[_0xb383('0x47')](handleError(_0x10d814,null));};exports[_0xb383('0x4a')]=function(_0x4292c4,_0x4d7ddd){if(_0x4292c4['body']['id']){delete _0x4292c4[_0xb383('0x49')]['id'];}return db['SquareMessage'][_0xb383('0x46')]({'where':{'id':_0x4292c4[_0xb383('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d7ddd,null))[_0xb383('0x24')](saveUpdates(_0x4292c4['body'],null))['then'](respondWithResult(_0x4d7ddd,null))['catch'](handleError(_0x4d7ddd,null));};exports[_0xb383('0x25')]=function(_0x4e2b7c,_0x451947){return db['SquareMessage'][_0xb383('0x46')]({'where':{'id':_0x4e2b7c[_0xb383('0x44')]['id']}})['then'](handleEntityNotFound(_0x451947,null))['then'](removeEntity(_0x451947,null))[_0xb383('0x47')](handleError(_0x451947,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index a631ba1..a99aca6 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 _0x6636=['square_messages','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x4660b9,_0x172664){var _0x3d0b6b=function(_0x3632e1){while(--_0x3632e1){_0x4660b9['push'](_0x4660b9['shift']());}};_0x3d0b6b(++_0x172664);}(_0x6636,0x1d5));var _0x6663=function(_0x197f70,_0x5e4837){_0x197f70=_0x197f70-0x0;var _0x167c3c=_0x6636[_0x197f70];return _0x167c3c;};'use strict';var _=require(_0x6663('0x0'));var util=require('util');var logger=require(_0x6663('0x1'))('api');var moment=require(_0x6663('0x2'));var BPromise=require(_0x6663('0x3'));var rp=require(_0x6663('0x4'));var fs=require('fs');var path=require(_0x6663('0x5'));var rimraf=require(_0x6663('0x6'));var config=require(_0x6663('0x7'));var attributes=require(_0x6663('0x8'));module[_0x6663('0x9')]=function(_0x336e16,_0xce71dd){return _0x336e16[_0x6663('0xa')](_0x6663('0xb'),attributes,{'tableName':_0x6663('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe429=['lodash','moment','request-promise','path','rimraf','exports','define'];(function(_0x153e7d,_0x10a35f){var _0x3c22dd=function(_0x4d33f6){while(--_0x4d33f6){_0x153e7d['push'](_0x153e7d['shift']());}};_0x3c22dd(++_0x10a35f);}(_0xe429,0x69));var _0x9e42=function(_0x24fb53,_0x50b89a){_0x24fb53=_0x24fb53-0x0;var _0x3f027b=_0xe429[_0x24fb53];return _0x3f027b;};'use strict';var _=require(_0x9e42('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9e42('0x1'));var BPromise=require('bluebird');var rp=require(_0x9e42('0x2'));var fs=require('fs');var path=require(_0x9e42('0x3'));var rimraf=require(_0x9e42('0x4'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x9e42('0x5')]=function(_0x1b2f47,_0x1ca9d0){return _0x1b2f47[_0x9e42('0x6')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index bb7cd21..fc1d9e5 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 _0x5303=['create','body','options','then','debug','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','request\x20sent','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','result','CreateSquareMessage','SquareMessage'];(function(_0x4a9d5c,_0x5a040c){var _0x231e2a=function(_0x5152e0){while(--_0x5152e0){_0x4a9d5c['push'](_0x4a9d5c['shift']());}};_0x231e2a(++_0x5a040c);}(_0x5303,0x72));var _0x3530=function(_0x323289,_0x32b2d1){_0x323289=_0x323289-0x0;var _0x1be9ae=_0x5303[_0x323289];return _0x1be9ae;};'use strict';var _=require(_0x3530('0x0'));var util=require(_0x3530('0x1'));var moment=require(_0x3530('0x2'));var BPromise=require(_0x3530('0x3'));var rs=require(_0x3530('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3530('0x5'))['db'];var utils=require(_0x3530('0x6'));var logger=require(_0x3530('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3530('0x8')][_0x3530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x82fd94,_0x29d694,_0x45ed79){return new BPromise(function(_0x2c34df,_0x338b53){return client[_0x3530('0xa')](_0x82fd94,_0x45ed79)['then'](function(_0x9a42be){logger[_0x3530('0xb')]('SquareMessage,\x20%s,\x20%s',_0x29d694,_0x3530('0xc'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x29d694,_0x3530('0xc'),JSON[_0x3530('0xd')](_0x9a42be));if(_0x9a42be[_0x3530('0xe')]){if(_0x9a42be[_0x3530('0xe')][_0x3530('0xf')]===0x1f4){logger[_0x3530('0xe')]('SquareMessage,\x20%s,\x20%s',_0x29d694,_0x9a42be[_0x3530('0xe')][_0x3530('0x10')]);return _0x338b53(_0x9a42be[_0x3530('0xe')][_0x3530('0x10')]);}logger[_0x3530('0xe')](_0x3530('0x11'),_0x29d694,_0x9a42be['error'][_0x3530('0x10')]);return _0x2c34df(_0x9a42be[_0x3530('0xe')][_0x3530('0x10')]);}else{logger['info'](_0x3530('0x11'),_0x29d694,'request\x20sent');_0x2c34df(_0x9a42be[_0x3530('0x12')][_0x3530('0x10')]);}})['catch'](function(_0x36f1a8){logger[_0x3530('0xe')](_0x3530('0x11'),_0x29d694,_0x36f1a8);_0x338b53(_0x36f1a8);});});}exports[_0x3530('0x13')]=function(_0x3034f7){var _0x54abda=this;return new Promise(function(_0x337375,_0x314501){return db[_0x3530('0x14')][_0x3530('0x15')](_0x3034f7[_0x3530('0x16')],{'raw':_0x3034f7[_0x3530('0x17')]?_0x3034f7[_0x3530('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3530('0x18')](function(_0x1c67a0){logger[_0x3530('0xb')](_0x3530('0x13'),_0x3034f7);logger[_0x3530('0x19')]('CreateSquareMessage',_0x3034f7,JSON[_0x3530('0xd')](_0x1c67a0));_0x337375(_0x1c67a0);})[_0x3530('0x1a')](function(_0x432e1c){logger[_0x3530('0xe')](_0x3530('0x13'),_0x432e1c[_0x3530('0x10')],_0x3034f7);_0x314501(_0x54abda['error'](0x1f4,_0x432e1c[_0x3530('0x10')]));});});}; \ No newline at end of file +var _0x7659=['SquareMessage','create','body','options','raw','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','CreateSquareMessage'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x7659,0x8d));var _0x9765=function(_0x399a2a,_0x5125cb){_0x399a2a=_0x399a2a-0x0;var _0x3d2ac5=_0x7659[_0x399a2a];return _0x3d2ac5;};'use strict';var _=require(_0x9765('0x0'));var util=require('util');var moment=require(_0x9765('0x1'));var BPromise=require(_0x9765('0x2'));var rs=require(_0x9765('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9765('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9765('0x5'));var config=require(_0x9765('0x6'));var jayson=require(_0x9765('0x7'));var client=jayson[_0x9765('0x8')][_0x9765('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5808f0,_0x1247d5,_0x2f6d29){return new BPromise(function(_0x7e280a,_0x38ca29){return client[_0x9765('0xa')](_0x5808f0,_0x2f6d29)[_0x9765('0xb')](function(_0x32ca83){logger[_0x9765('0xc')](_0x9765('0xd'),_0x1247d5,'request\x20sent');logger[_0x9765('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x1247d5,_0x9765('0xf'),JSON['stringify'](_0x32ca83));if(_0x32ca83['error']){if(_0x32ca83[_0x9765('0x10')][_0x9765('0x11')]===0x1f4){logger[_0x9765('0x10')](_0x9765('0xd'),_0x1247d5,_0x32ca83[_0x9765('0x10')]['message']);return _0x38ca29(_0x32ca83[_0x9765('0x10')][_0x9765('0x12')]);}logger[_0x9765('0x10')]('SquareMessage,\x20%s,\x20%s',_0x1247d5,_0x32ca83[_0x9765('0x10')][_0x9765('0x12')]);return _0x7e280a(_0x32ca83['error'][_0x9765('0x12')]);}else{logger['info'](_0x9765('0xd'),_0x1247d5,_0x9765('0xf'));_0x7e280a(_0x32ca83[_0x9765('0x13')][_0x9765('0x12')]);}})['catch'](function(_0x56be91){logger[_0x9765('0x10')]('SquareMessage,\x20%s,\x20%s',_0x1247d5,_0x56be91);_0x38ca29(_0x56be91);});});}exports[_0x9765('0x14')]=function(_0x3a1fb2){var _0x1a1b09=this;return new Promise(function(_0x1c6c4a,_0xe7f797){return db[_0x9765('0x15')][_0x9765('0x16')](_0x3a1fb2[_0x9765('0x17')],{'raw':_0x3a1fb2[_0x9765('0x18')]?_0x3a1fb2[_0x9765('0x18')][_0x9765('0x19')]===undefined?!![]:![]:!![]})[_0x9765('0xb')](function(_0x4f7337){logger['info']('CreateSquareMessage',_0x3a1fb2);logger[_0x9765('0xe')]('CreateSquareMessage',_0x3a1fb2,JSON['stringify'](_0x4f7337));_0x1c6c4a(_0x4f7337);})[_0x9765('0x1a')](function(_0x272a02){logger[_0x9765('0x10')](_0x9765('0x14'),_0x272a02[_0x9765('0x12')],_0x3a1fb2);_0xe7f797(_0x1a1b09[_0x9765('0x10')](0x1f4,_0x272a02[_0x9765('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1e85558..96edbb5 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 _0x71aa=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/test','15s','create','put','/:id','update','exports','multer','util'];(function(_0x54ceda,_0x43e7d3){var _0x383f70=function(_0x34d0f1){while(--_0x34d0f1){_0x54ceda['push'](_0x54ceda['shift']());}};_0x383f70(++_0x43e7d3);}(_0x71aa,0x124));var _0xa71a=function(_0x76b00b,_0x26e939){_0x76b00b=_0x76b00b-0x0;var _0xc8e4a=_0x71aa[_0x76b00b];return _0xc8e4a;};'use strict';var multer=require(_0xa71a('0x0'));var util=require(_0xa71a('0x1'));var path=require(_0xa71a('0x2'));var timeout=require(_0xa71a('0x3'));var express=require(_0xa71a('0x4'));var router=express[_0xa71a('0x5')]();var fs_extra=require(_0xa71a('0x6'));var auth=require(_0xa71a('0x7'));var interaction=require(_0xa71a('0x8'));var config=require(_0xa71a('0x9'));var controller=require('./squareOdbc.controller');router[_0xa71a('0xa')]('/',auth[_0xa71a('0xb')](),controller[_0xa71a('0xc')]);router[_0xa71a('0xa')]('/:id',auth[_0xa71a('0xb')](),controller[_0xa71a('0xd')]);router[_0xa71a('0xa')](_0xa71a('0xe'),auth['isAuthenticated'](),timeout(_0xa71a('0xf')),controller['test']);router['post']('/',auth[_0xa71a('0xb')](),controller[_0xa71a('0x10')]);router[_0xa71a('0x11')](_0xa71a('0x12'),auth[_0xa71a('0xb')](),controller[_0xa71a('0x13')]);router['delete'](_0xa71a('0x12'),auth[_0xa71a('0xb')](),controller['destroy']);module[_0xa71a('0x14')]=router; \ No newline at end of file +var _0x1302=['update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5ce348,_0x2c50fa){var _0x87839c=function(_0x2aa3db){while(--_0x2aa3db){_0x5ce348['push'](_0x5ce348['shift']());}};_0x87839c(++_0x2c50fa);}(_0x1302,0x1f0));var _0x2130=function(_0xc72e71,_0x10d040){_0xc72e71=_0xc72e71-0x0;var _0x329425=_0x1302[_0xc72e71];return _0x329425;};'use strict';var multer=require(_0x2130('0x0'));var util=require(_0x2130('0x1'));var path=require('path');var timeout=require(_0x2130('0x2'));var express=require(_0x2130('0x3'));var router=express[_0x2130('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2130('0x5'));var interaction=require(_0x2130('0x6'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x2130('0x7')]('/',auth[_0x2130('0x8')](),controller[_0x2130('0x9')]);router[_0x2130('0x7')](_0x2130('0xa'),auth[_0x2130('0x8')](),controller[_0x2130('0xb')]);router['get']('/:id/test',auth['isAuthenticated'](),timeout('15s'),controller['test']);router[_0x2130('0xc')]('/',auth[_0x2130('0x8')](),controller[_0x2130('0xd')]);router['put'](_0x2130('0xa'),auth['isAuthenticated'](),controller[_0x2130('0xe')]);router['delete'](_0x2130('0xa'),auth['isAuthenticated'](),controller[_0x2130('0xf')]);module[_0x2130('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 a48e430..e9e74a0 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 _0x5b88=['STRING','name'];(function(_0x17f8fb,_0x1a195b){var _0x111178=function(_0x14f334){while(--_0x14f334){_0x17f8fb['push'](_0x17f8fb['shift']());}};_0x111178(++_0x1a195b);}(_0x5b88,0xf2));var _0x85b8=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x5b88[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x85b8('0x0')],'unique':_0x85b8('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x85b8('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5eba=['STRING','sequelize','exports'];(function(_0x11b53b,_0x188564){var _0x529666=function(_0x54ef3a){while(--_0x54ef3a){_0x11b53b['push'](_0x11b53b['shift']());}};_0x529666(++_0x188564);}(_0x5eba,0x18d));var _0xa5eb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5eba[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xa5eb('0x0'));module[_0xa5eb('0x1')]={'name':{'type':Sequelize[_0xa5eb('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xa5eb('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 5a3fad3..a92fcba 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 _0x3295=['set','Content-Range','reject','update','then','get','ODBC','UserProfileResource','destroy','error','name','index','map','SquareOdbc','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','count','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','odbc','dsn','closeSync','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status'];(function(_0x421752,_0x20f492){var _0x23ed3e=function(_0x3a9e19){while(--_0x3a9e19){_0x421752['push'](_0x421752['shift']());}};_0x23ed3e(++_0x20f492);}(_0x3295,0x138));var _0x5329=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x3295[_0x1a7550];return _0x426e22;};'use strict';var emlformat=require(_0x5329('0x0'));var rimraf=require(_0x5329('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5329('0x2'));var rp=require('request-promise');var moment=require(_0x5329('0x3'));var BPromise=require(_0x5329('0x4'));var Mustache=require(_0x5329('0x5'));var util=require('util');var path=require(_0x5329('0x6'));var sox=require(_0x5329('0x7'));var csv=require(_0x5329('0x8'));var ejs=require(_0x5329('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5329('0xa'));var squel=require(_0x5329('0xb'));var crypto=require(_0x5329('0xc'));var jsforce=require(_0x5329('0xd'));var deskjs=require(_0x5329('0xe'));var toCsv=require(_0x5329('0x8'));var querystring=require(_0x5329('0xf'));var Papa=require(_0x5329('0x10'));var Redis=require(_0x5329('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5329('0x12'));var as=require(_0x5329('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5329('0x14'));var utils=require(_0x5329('0x15'));var config=require(_0x5329('0x16'));var licenseUtil=require(_0x5329('0x17'));var db=require(_0x5329('0x18'))['db'];function respondWithStatusCode(_0x21ea60,_0x206557){_0x206557=_0x206557||0xcc;return function(_0x1aa6fb){if(_0x1aa6fb){return _0x21ea60[_0x5329('0x19')](_0x206557);}return _0x21ea60['status'](_0x206557)[_0x5329('0x1a')]();};}function respondWithResult(_0x28a343,_0x893b36){_0x893b36=_0x893b36||0xc8;return function(_0xa204bd){if(_0xa204bd){return _0x28a343['status'](_0x893b36)[_0x5329('0x1b')](_0xa204bd);}};}function respondWithFilteredResult(_0x4984be,_0x1a70ce){return function(_0x11f516){if(_0x11f516){var _0x15a073=typeof _0x1a70ce[_0x5329('0x1c')]===_0x5329('0x1d')&&typeof _0x1a70ce['limit']===_0x5329('0x1d');var _0x306a10=_0x11f516['count'];var _0x646559=_0x15a073?0x0:_0x1a70ce[_0x5329('0x1c')];var _0x177d2b=_0x15a073?_0x11f516['count']:_0x1a70ce[_0x5329('0x1c')]+_0x1a70ce[_0x5329('0x1e')];var _0x42a093;if(_0x177d2b>=_0x306a10){_0x177d2b=_0x306a10;_0x42a093=0xc8;}else{_0x42a093=0xce;}_0x4984be[_0x5329('0x1f')](_0x42a093);return _0x4984be[_0x5329('0x20')](_0x5329('0x21'),_0x646559+'-'+_0x177d2b+'/'+_0x306a10)[_0x5329('0x1b')](_0x11f516);}return null;};}function patchUpdates(_0x47cb96){return function(_0x32e412){try{jsonpatch['apply'](_0x32e412,_0x47cb96,!![]);}catch(_0x51fb2b){return BPromise[_0x5329('0x22')](_0x51fb2b);}return _0x32e412['save']();};}function saveUpdates(_0x4536f9,_0x1451fe){return function(_0x5540c4){if(_0x5540c4){return _0x5540c4[_0x5329('0x23')](_0x4536f9)['then'](function(_0x15a3d4){return _0x15a3d4;});}return null;};}function removeEntity(_0x2a8d65,_0x403d2){return function(_0x2edd7c){if(_0x2edd7c){return _0x2edd7c['destroy']()[_0x5329('0x24')](function(){var _0x5f0c1f=_0x2edd7c[_0x5329('0x25')]({'plain':!![]});var _0x2854f4=_0x5329('0x26');return db[_0x5329('0x27')][_0x5329('0x28')]({'where':{'type':_0x2854f4,'resourceId':_0x5f0c1f['id']}})['then'](function(){return _0x2edd7c;});})[_0x5329('0x24')](function(){_0x2a8d65[_0x5329('0x1f')](0xcc)[_0x5329('0x1a')]();});}};}function handleEntityNotFound(_0x314a4f,_0x340734){return function(_0x3f5e90){if(!_0x3f5e90){_0x314a4f[_0x5329('0x19')](0x194);}return _0x3f5e90;};}function handleError(_0x550211,_0x49d8c1){_0x49d8c1=_0x49d8c1||0x1f4;return function(_0x4f961a){logger[_0x5329('0x29')](_0x4f961a['stack']);if(_0x4f961a[_0x5329('0x2a')]){delete _0x4f961a['name'];}_0x550211['status'](_0x49d8c1)['send'](_0x4f961a);};}exports[_0x5329('0x2b')]=function(_0x3040e,_0x23e974){var _0x4bca31={},_0x20f296={},_0x4e74fe={'count':0x0,'rows':[]};var _0x2b3ed5=_[_0x5329('0x2c')](db[_0x5329('0x2d')]['rawAttributes'],function(_0x101aff){return{'name':_0x101aff['fieldName'],'type':_0x101aff[_0x5329('0x2e')][_0x5329('0x2f')]};});_0x20f296['model']=_[_0x5329('0x2c')](_0x2b3ed5,_0x5329('0x2a'));_0x20f296[_0x5329('0x30')]=_['keys'](_0x3040e['query']);_0x20f296[_0x5329('0x31')]=_[_0x5329('0x32')](_0x20f296[_0x5329('0x33')],_0x20f296[_0x5329('0x30')]);_0x4bca31[_0x5329('0x34')]=_[_0x5329('0x32')](_0x20f296[_0x5329('0x33')],qs[_0x5329('0x35')](_0x3040e[_0x5329('0x30')]['fields']));_0x4bca31[_0x5329('0x34')]=_0x4bca31[_0x5329('0x34')][_0x5329('0x36')]?_0x4bca31['attributes']:_0x20f296['model'];if(!_0x3040e[_0x5329('0x30')][_0x5329('0x37')](_0x5329('0x38'))){_0x4bca31['limit']=qs[_0x5329('0x1e')](_0x3040e[_0x5329('0x30')][_0x5329('0x1e')]);_0x4bca31[_0x5329('0x1c')]=qs[_0x5329('0x1c')](_0x3040e['query'][_0x5329('0x1c')]);}_0x4bca31[_0x5329('0x39')]=qs[_0x5329('0x3a')](_0x3040e['query'][_0x5329('0x3a')]);_0x4bca31['where']=qs['filters'](_[_0x5329('0x3b')](_0x3040e[_0x5329('0x30')],_0x20f296['filters']),_0x2b3ed5);if(_0x3040e[_0x5329('0x30')][_0x5329('0x3c')]){_0x4bca31['where']=_[_0x5329('0x3d')](_0x4bca31['where'],{'$or':_[_0x5329('0x2c')](_0x2b3ed5,function(_0x1ea472){if(_0x1ea472[_0x5329('0x2e')]!==_0x5329('0x3e')){var _0x2373ee={};_0x2373ee[_0x1ea472[_0x5329('0x2a')]]={'$like':'%'+_0x3040e[_0x5329('0x30')][_0x5329('0x3c')]+'%'};return _0x2373ee;}})});}_0x4bca31=_[_0x5329('0x3d')]({},_0x4bca31,_0x3040e['options']);var _0x4f1684={'where':_0x4bca31[_0x5329('0x3f')]};return db[_0x5329('0x2d')]['count'](_0x4f1684)[_0x5329('0x24')](function(_0x5873ff){_0x4e74fe[_0x5329('0x40')]=_0x5873ff;if(_0x3040e[_0x5329('0x30')]['includeAll']){_0x4bca31[_0x5329('0x41')]=[{'all':!![]}];}return db['SquareOdbc'][_0x5329('0x42')](_0x4bca31);})['then'](function(_0x1cbc0a){_0x4e74fe[_0x5329('0x43')]=_0x1cbc0a;return _0x4e74fe;})['then'](respondWithFilteredResult(_0x23e974,_0x4bca31))[_0x5329('0x44')](handleError(_0x23e974,null));};exports[_0x5329('0x45')]=function(_0x99424d,_0x3f6039){var _0x2bfbb3={'raw':!![],'where':{'id':_0x99424d[_0x5329('0x46')]['id']}},_0x2fa3cc={};_0x2fa3cc['model']=_['keys'](db[_0x5329('0x2d')][_0x5329('0x47')]);_0x2fa3cc[_0x5329('0x30')]=_['keys'](_0x99424d['query']);_0x2fa3cc[_0x5329('0x31')]=_['intersection'](_0x2fa3cc[_0x5329('0x33')],_0x2fa3cc[_0x5329('0x30')]);_0x2bfbb3[_0x5329('0x34')]=_[_0x5329('0x32')](_0x2fa3cc[_0x5329('0x33')],qs[_0x5329('0x35')](_0x99424d[_0x5329('0x30')][_0x5329('0x35')]));_0x2bfbb3['attributes']=_0x2bfbb3[_0x5329('0x34')][_0x5329('0x36')]?_0x2bfbb3['attributes']:_0x2fa3cc[_0x5329('0x33')];if(_0x99424d[_0x5329('0x30')][_0x5329('0x48')]){_0x2bfbb3['include']=[{'all':!![]}];}_0x2bfbb3=_[_0x5329('0x3d')]({},_0x2bfbb3,_0x99424d[_0x5329('0x49')]);return db['SquareOdbc'][_0x5329('0x4a')](_0x2bfbb3)[_0x5329('0x24')](handleEntityNotFound(_0x3f6039,null))[_0x5329('0x24')](respondWithResult(_0x3f6039,null))[_0x5329('0x44')](handleError(_0x3f6039,null));};exports[_0x5329('0x4b')]=function(_0xc48332,_0x4d009e){return db[_0x5329('0x2d')][_0x5329('0x4b')](_0xc48332['body'],{})[_0x5329('0x24')](function(_0x2f6190){var _0x5a5a46=_0xc48332[_0x5329('0x4c')][_0x5329('0x25')]({'plain':!![]});if(!_0x5a5a46)throw new Error(_0x5329('0x4d'));if(_0x5a5a46[_0x5329('0x4e')]==='user'){var _0x24d470=_0x2f6190[_0x5329('0x25')]({'plain':!![]});var _0x3605cb=_0x5329('0x26');return db[_0x5329('0x4f')][_0x5329('0x4a')]({'where':{'name':_0x3605cb,'userProfileId':_0x5a5a46[_0x5329('0x50')]},'raw':!![]})['then'](function(_0x194e64){if(_0x194e64&&_0x194e64['autoAssociation']===0x0){return db[_0x5329('0x27')]['create']({'name':_0x24d470[_0x5329('0x2a')],'resourceId':_0x24d470['id'],'type':_0x194e64[_0x5329('0x2a')],'sectionId':_0x194e64['id']},{})[_0x5329('0x24')](function(){return _0x2f6190;});}else{return _0x2f6190;}})[_0x5329('0x44')](function(_0x36753c){logger['error'](_0x5329('0x51'),_0x36753c);throw _0x36753c;});}return _0x2f6190;})[_0x5329('0x24')](respondWithResult(_0x4d009e,0xc9))[_0x5329('0x44')](handleError(_0x4d009e,null));};exports[_0x5329('0x23')]=function(_0x505333,_0x55f184){if(_0x505333[_0x5329('0x52')]['id']){delete _0x505333[_0x5329('0x52')]['id'];}return db[_0x5329('0x2d')][_0x5329('0x4a')]({'where':{'id':_0x505333[_0x5329('0x46')]['id']}})[_0x5329('0x24')](handleEntityNotFound(_0x55f184,null))[_0x5329('0x24')](saveUpdates(_0x505333[_0x5329('0x52')],null))['then'](respondWithResult(_0x55f184,null))[_0x5329('0x44')](handleError(_0x55f184,null));};exports[_0x5329('0x28')]=function(_0x3f9749,_0x59854d){return db['SquareOdbc']['find']({'where':{'id':_0x3f9749['params']['id']}})['then'](handleEntityNotFound(_0x59854d,null))[_0x5329('0x24')](removeEntity(_0x59854d,null))[_0x5329('0x44')](handleError(_0x59854d,null));};exports['test']=function(_0x241e0d,_0x3a941f,_0x5b51cf){var _0x3b3db2;return db[_0x5329('0x2d')][_0x5329('0x4a')]({'where':{'id':_0x241e0d[_0x5329('0x46')]['id']},'attributes':['id','dsn']})[_0x5329('0x24')](handleEntityNotFound(_0x3a941f,null))[_0x5329('0x24')](function(_0x312279){if(_0x312279){var _0x39382c=require(_0x5329('0x53'))();_0x39382c['openSync'](_0x312279[_0x5329('0x54')]);_0x39382c[_0x5329('0x55')]();return _0x312279;}})[_0x5329('0x24')](respondWithResult(_0x3a941f,null))[_0x5329('0x44')](handleError(_0x3a941f,null));}; \ No newline at end of file +var _0xc9e4=['ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','SquareOdbc','rawAttributes','create','body','user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','odbc','openSync','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x4b4ea7,_0x55f349){var _0x1b076e=function(_0x4c2a50){while(--_0x4c2a50){_0x4b4ea7['push'](_0x4b4ea7['shift']());}};_0x1b076e(++_0x55f349);}(_0xc9e4,0xeb));var _0x4c9e=function(_0x4e808c,_0x3ebb84){_0x4e808c=_0x4e808c-0x0;var _0x1db4c6=_0xc9e4[_0x4e808c];return _0x1db4c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c9e('0x0'));var zipdir=require(_0x4c9e('0x1'));var jsonpatch=require(_0x4c9e('0x2'));var rp=require(_0x4c9e('0x3'));var moment=require(_0x4c9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c9e('0x5'));var util=require(_0x4c9e('0x6'));var path=require(_0x4c9e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4c9e('0x8'));var fs=require('fs');var fs_extra=require(_0x4c9e('0x9'));var _=require('lodash');var squel=require(_0x4c9e('0xa'));var crypto=require(_0x4c9e('0xb'));var jsforce=require(_0x4c9e('0xc'));var deskjs=require(_0x4c9e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4c9e('0xe'));var qs=require(_0x4c9e('0xf'));var as=require(_0x4c9e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4c9e('0x11'));var utils=require(_0x4c9e('0x12'));var config=require(_0x4c9e('0x13'));var licenseUtil=require(_0x4c9e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c0633,_0x11f812){_0x11f812=_0x11f812||0xcc;return function(_0x176324){if(_0x176324){return _0x1c0633[_0x4c9e('0x15')](_0x11f812);}return _0x1c0633[_0x4c9e('0x16')](_0x11f812)[_0x4c9e('0x17')]();};}function respondWithResult(_0x36a34,_0x5f27ff){_0x5f27ff=_0x5f27ff||0xc8;return function(_0x29c070){if(_0x29c070){return _0x36a34['status'](_0x5f27ff)[_0x4c9e('0x18')](_0x29c070);}};}function respondWithFilteredResult(_0x22adf0,_0x1356e5){return function(_0x10b01f){if(_0x10b01f){var _0x4c0c44=typeof _0x1356e5['offset']===_0x4c9e('0x19')&&typeof _0x1356e5['limit']===_0x4c9e('0x19');var _0x2c7af5=_0x10b01f['count'];var _0x1db91e=_0x4c0c44?0x0:_0x1356e5['offset'];var _0x2c7e82=_0x4c0c44?_0x10b01f[_0x4c9e('0x1a')]:_0x1356e5[_0x4c9e('0x1b')]+_0x1356e5[_0x4c9e('0x1c')];var _0x18e267;if(_0x2c7e82>=_0x2c7af5){_0x2c7e82=_0x2c7af5;_0x18e267=0xc8;}else{_0x18e267=0xce;}_0x22adf0['status'](_0x18e267);return _0x22adf0[_0x4c9e('0x1d')](_0x4c9e('0x1e'),_0x1db91e+'-'+_0x2c7e82+'/'+_0x2c7af5)['json'](_0x10b01f);}return null;};}function patchUpdates(_0x3e01b4){return function(_0xd1074){try{jsonpatch['apply'](_0xd1074,_0x3e01b4,!![]);}catch(_0x2e0e4b){return BPromise[_0x4c9e('0x1f')](_0x2e0e4b);}return _0xd1074[_0x4c9e('0x20')]();};}function saveUpdates(_0x306923,_0x476ffb){return function(_0x56d1df){if(_0x56d1df){return _0x56d1df[_0x4c9e('0x21')](_0x306923)['then'](function(_0x4de00d){return _0x4de00d;});}return null;};}function removeEntity(_0x1b329a,_0x1e69dc){return function(_0x4cd46d){if(_0x4cd46d){return _0x4cd46d[_0x4c9e('0x22')]()[_0x4c9e('0x23')](function(){var _0x1d1981=_0x4cd46d[_0x4c9e('0x24')]({'plain':!![]});var _0x2b446e='ODBC';return db[_0x4c9e('0x25')][_0x4c9e('0x22')]({'where':{'type':_0x2b446e,'resourceId':_0x1d1981['id']}})[_0x4c9e('0x23')](function(){return _0x4cd46d;});})['then'](function(){_0x1b329a[_0x4c9e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1957e3,_0x2b17eb){return function(_0x4c63f1){if(!_0x4c63f1){_0x1957e3[_0x4c9e('0x15')](0x194);}return _0x4c63f1;};}function handleError(_0x623c92,_0x183a21){_0x183a21=_0x183a21||0x1f4;return function(_0x4e11a3){logger[_0x4c9e('0x26')](_0x4e11a3['stack']);if(_0x4e11a3[_0x4c9e('0x27')]){delete _0x4e11a3['name'];}_0x623c92[_0x4c9e('0x16')](_0x183a21)[_0x4c9e('0x28')](_0x4e11a3);};}exports['index']=function(_0x5ceb64,_0x361ff1){var _0xdbc80d={},_0x3403a1={},_0x3beb96={'count':0x0,'rows':[]};var _0x5f1697=_['map'](db['SquareOdbc']['rawAttributes'],function(_0x5ef69b){return{'name':_0x5ef69b[_0x4c9e('0x29')],'type':_0x5ef69b['type'][_0x4c9e('0x2a')]};});_0x3403a1[_0x4c9e('0x2b')]=_[_0x4c9e('0x2c')](_0x5f1697,_0x4c9e('0x27'));_0x3403a1[_0x4c9e('0x2d')]=_[_0x4c9e('0x2e')](_0x5ceb64['query']);_0x3403a1[_0x4c9e('0x2f')]=_[_0x4c9e('0x30')](_0x3403a1[_0x4c9e('0x2b')],_0x3403a1[_0x4c9e('0x2d')]);_0xdbc80d[_0x4c9e('0x31')]=_[_0x4c9e('0x30')](_0x3403a1[_0x4c9e('0x2b')],qs[_0x4c9e('0x32')](_0x5ceb64[_0x4c9e('0x2d')][_0x4c9e('0x32')]));_0xdbc80d[_0x4c9e('0x31')]=_0xdbc80d[_0x4c9e('0x31')]['length']?_0xdbc80d[_0x4c9e('0x31')]:_0x3403a1[_0x4c9e('0x2b')];if(!_0x5ceb64[_0x4c9e('0x2d')]['hasOwnProperty'](_0x4c9e('0x33'))){_0xdbc80d['limit']=qs[_0x4c9e('0x1c')](_0x5ceb64[_0x4c9e('0x2d')][_0x4c9e('0x1c')]);_0xdbc80d[_0x4c9e('0x1b')]=qs[_0x4c9e('0x1b')](_0x5ceb64['query'][_0x4c9e('0x1b')]);}_0xdbc80d[_0x4c9e('0x34')]=qs[_0x4c9e('0x35')](_0x5ceb64['query'][_0x4c9e('0x35')]);_0xdbc80d[_0x4c9e('0x36')]=qs[_0x4c9e('0x2f')](_[_0x4c9e('0x37')](_0x5ceb64[_0x4c9e('0x2d')],_0x3403a1[_0x4c9e('0x2f')]),_0x5f1697);if(_0x5ceb64['query'][_0x4c9e('0x38')]){_0xdbc80d[_0x4c9e('0x36')]=_[_0x4c9e('0x39')](_0xdbc80d[_0x4c9e('0x36')],{'$or':_['map'](_0x5f1697,function(_0x5439aa){if(_0x5439aa[_0x4c9e('0x3a')]!==_0x4c9e('0x3b')){var _0x1c3af0={};_0x1c3af0[_0x5439aa[_0x4c9e('0x27')]]={'$like':'%'+_0x5ceb64[_0x4c9e('0x2d')]['filter']+'%'};return _0x1c3af0;}})});}_0xdbc80d=_[_0x4c9e('0x39')]({},_0xdbc80d,_0x5ceb64[_0x4c9e('0x3c')]);var _0x41326e={'where':_0xdbc80d[_0x4c9e('0x36')]};return db['SquareOdbc']['count'](_0x41326e)[_0x4c9e('0x23')](function(_0x385912){_0x3beb96['count']=_0x385912;if(_0x5ceb64[_0x4c9e('0x2d')][_0x4c9e('0x3d')]){_0xdbc80d[_0x4c9e('0x3e')]=[{'all':!![]}];}return db['SquareOdbc'][_0x4c9e('0x3f')](_0xdbc80d);})[_0x4c9e('0x23')](function(_0x210c1e){_0x3beb96[_0x4c9e('0x40')]=_0x210c1e;return _0x3beb96;})['then'](respondWithFilteredResult(_0x361ff1,_0xdbc80d))[_0x4c9e('0x41')](handleError(_0x361ff1,null));};exports['show']=function(_0x2e0b84,_0x16a3da){var _0x1fd331={'raw':!![],'where':{'id':_0x2e0b84['params']['id']}},_0x59e280={};_0x59e280[_0x4c9e('0x2b')]=_['keys'](db[_0x4c9e('0x42')][_0x4c9e('0x43')]);_0x59e280[_0x4c9e('0x2d')]=_[_0x4c9e('0x2e')](_0x2e0b84['query']);_0x59e280['filters']=_[_0x4c9e('0x30')](_0x59e280[_0x4c9e('0x2b')],_0x59e280[_0x4c9e('0x2d')]);_0x1fd331[_0x4c9e('0x31')]=_[_0x4c9e('0x30')](_0x59e280[_0x4c9e('0x2b')],qs['fields'](_0x2e0b84[_0x4c9e('0x2d')][_0x4c9e('0x32')]));_0x1fd331[_0x4c9e('0x31')]=_0x1fd331['attributes']['length']?_0x1fd331[_0x4c9e('0x31')]:_0x59e280[_0x4c9e('0x2b')];if(_0x2e0b84['query']['includeAll']){_0x1fd331[_0x4c9e('0x3e')]=[{'all':!![]}];}_0x1fd331=_[_0x4c9e('0x39')]({},_0x1fd331,_0x2e0b84[_0x4c9e('0x3c')]);return db[_0x4c9e('0x42')]['find'](_0x1fd331)['then'](handleEntityNotFound(_0x16a3da,null))[_0x4c9e('0x23')](respondWithResult(_0x16a3da,null))[_0x4c9e('0x41')](handleError(_0x16a3da,null));};exports[_0x4c9e('0x44')]=function(_0x2c719e,_0x32c830){return db['SquareOdbc'][_0x4c9e('0x44')](_0x2c719e[_0x4c9e('0x45')],{})[_0x4c9e('0x23')](function(_0x4cd9d2){var _0x5a7a8e=_0x2c719e[_0x4c9e('0x46')][_0x4c9e('0x24')]({'plain':!![]});if(!_0x5a7a8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a7a8e[_0x4c9e('0x47')]===_0x4c9e('0x46')){var _0x32cef4=_0x4cd9d2[_0x4c9e('0x24')]({'plain':!![]});var _0x16ec78='ODBC';return db[_0x4c9e('0x48')][_0x4c9e('0x49')]({'where':{'name':_0x16ec78,'userProfileId':_0x5a7a8e['userProfileId']},'raw':!![]})[_0x4c9e('0x23')](function(_0x55e7f6){if(_0x55e7f6&&_0x55e7f6['autoAssociation']===0x0){return db['UserProfileResource'][_0x4c9e('0x44')]({'name':_0x32cef4[_0x4c9e('0x27')],'resourceId':_0x32cef4['id'],'type':_0x55e7f6[_0x4c9e('0x27')],'sectionId':_0x55e7f6['id']},{})[_0x4c9e('0x23')](function(){return _0x4cd9d2;});}else{return _0x4cd9d2;}})[_0x4c9e('0x41')](function(_0x5f124c){logger[_0x4c9e('0x26')](_0x4c9e('0x4a'),_0x5f124c);throw _0x5f124c;});}return _0x4cd9d2;})['then'](respondWithResult(_0x32c830,0xc9))[_0x4c9e('0x41')](handleError(_0x32c830,null));};exports[_0x4c9e('0x21')]=function(_0x1c5ef2,_0x29ed7c){if(_0x1c5ef2[_0x4c9e('0x45')]['id']){delete _0x1c5ef2[_0x4c9e('0x45')]['id'];}return db[_0x4c9e('0x42')][_0x4c9e('0x49')]({'where':{'id':_0x1c5ef2[_0x4c9e('0x4b')]['id']}})[_0x4c9e('0x23')](handleEntityNotFound(_0x29ed7c,null))[_0x4c9e('0x23')](saveUpdates(_0x1c5ef2[_0x4c9e('0x45')],null))[_0x4c9e('0x23')](respondWithResult(_0x29ed7c,null))[_0x4c9e('0x41')](handleError(_0x29ed7c,null));};exports[_0x4c9e('0x22')]=function(_0x479416,_0x10cf52){return db['SquareOdbc'][_0x4c9e('0x49')]({'where':{'id':_0x479416[_0x4c9e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10cf52,null))[_0x4c9e('0x23')](removeEntity(_0x10cf52,null))[_0x4c9e('0x41')](handleError(_0x10cf52,null));};exports[_0x4c9e('0x4c')]=function(_0x3d33ea,_0x368e8c,_0x50b231){var _0x1af80b;return db[_0x4c9e('0x42')]['find']({'where':{'id':_0x3d33ea['params']['id']},'attributes':['id','dsn']})[_0x4c9e('0x23')](handleEntityNotFound(_0x368e8c,null))['then'](function(_0x1ee20d){if(_0x1ee20d){var _0x3bb5f6=require(_0x4c9e('0x4d'))();_0x3bb5f6[_0x4c9e('0x4e')](_0x1ee20d[_0x4c9e('0x4f')]);_0x3bb5f6[_0x4c9e('0x50')]();return _0x1ee20d;}})[_0x4c9e('0x23')](respondWithResult(_0x368e8c,null))[_0x4c9e('0x41')](handleError(_0x368e8c,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 05b6a63..218863a 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 _0x30c2=['util','../../config/logger','api','bluebird','rimraf','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash'];(function(_0x1516a5,_0x12d3f8){var _0x132521=function(_0x2515cf){while(--_0x2515cf){_0x1516a5['push'](_0x1516a5['shift']());}};_0x132521(++_0x12d3f8);}(_0x30c2,0xd1));var _0x230c=function(_0xcde186,_0x1d0e5b){_0xcde186=_0xcde186-0x0;var _0x1d6208=_0x30c2[_0xcde186];return _0x1d6208;};'use strict';var _=require(_0x230c('0x0'));var util=require(_0x230c('0x1'));var logger=require(_0x230c('0x2'))(_0x230c('0x3'));var moment=require('moment');var BPromise=require(_0x230c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x230c('0x5'));var config=require('../../config/environment');var attributes=require(_0x230c('0x6'));module[_0x230c('0x7')]=function(_0x31eaef,_0x2b7cfa){return _0x31eaef['define'](_0x230c('0x8'),attributes,{'tableName':_0x230c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f7=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc'];(function(_0x3a3153,_0x3e6466){var _0x1460d6=function(_0x95ae73){while(--_0x95ae73){_0x3a3153['push'](_0x3a3153['shift']());}};_0x1460d6(++_0x3e6466);}(_0xb3f7,0x118));var _0x7b3f=function(_0x240772,_0x1bc642){_0x240772=_0x240772-0x0;var _0x4ff039=_0xb3f7[_0x240772];return _0x4ff039;};'use strict';var _=require(_0x7b3f('0x0'));var util=require(_0x7b3f('0x1'));var logger=require(_0x7b3f('0x2'))(_0x7b3f('0x3'));var moment=require(_0x7b3f('0x4'));var BPromise=require(_0x7b3f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b3f('0x6'));var rimraf=require(_0x7b3f('0x7'));var config=require(_0x7b3f('0x8'));var attributes=require(_0x7b3f('0x9'));module[_0x7b3f('0xa')]=function(_0x48bcb8,_0x298f41){return _0x48bcb8[_0x7b3f('0xb')](_0x7b3f('0xc'),attributes,{'tableName':_0x7b3f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index b4d3b2c..4910b02 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 _0xd618=['then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','catch','ShowSquareOdbc','SquareOdbc','options','where','attributes','map','include','model','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x56ca3a,_0x414937){var _0x3ab95d=function(_0x4fab6c){while(--_0x4fab6c){_0x56ca3a['push'](_0x56ca3a['shift']());}};_0x3ab95d(++_0x414937);}(_0xd618,0xc1));var _0x8d61=function(_0x234732,_0x2dc38b){_0x234732=_0x234732-0x0;var _0xed5bc7=_0xd618[_0x234732];return _0xed5bc7;};'use strict';var _=require(_0x8d61('0x0'));var util=require(_0x8d61('0x1'));var moment=require('moment');var BPromise=require(_0x8d61('0x2'));var rs=require(_0x8d61('0x3'));var fs=require('fs');var Redis=require(_0x8d61('0x4'));var db=require(_0x8d61('0x5'))['db'];var utils=require(_0x8d61('0x6'));var logger=require(_0x8d61('0x7'))(_0x8d61('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8d61('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2912c4,_0x155d82,_0x252f49){return new BPromise(function(_0x56d897,_0x97f990){return client['request'](_0x2912c4,_0x252f49)[_0x8d61('0xa')](function(_0x341521){logger[_0x8d61('0xb')](_0x8d61('0xc'),_0x155d82,'request\x20sent');logger[_0x8d61('0xd')](_0x8d61('0xe'),_0x155d82,_0x8d61('0xf'),JSON['stringify'](_0x341521));if(_0x341521['error']){if(_0x341521['error'][_0x8d61('0x10')]===0x1f4){logger[_0x8d61('0x11')](_0x8d61('0xc'),_0x155d82,_0x341521['error'][_0x8d61('0x12')]);return _0x97f990(_0x341521[_0x8d61('0x11')][_0x8d61('0x12')]);}logger[_0x8d61('0x11')](_0x8d61('0xc'),_0x155d82,_0x341521[_0x8d61('0x11')]['message']);return _0x56d897(_0x341521['error'][_0x8d61('0x12')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x155d82,_0x8d61('0xf'));_0x56d897(_0x341521['result'][_0x8d61('0x12')]);}})[_0x8d61('0x13')](function(_0x3ed432){logger[_0x8d61('0x11')](_0x8d61('0xc'),_0x155d82,_0x3ed432);_0x97f990(_0x3ed432);});});}exports[_0x8d61('0x14')]=function(_0x3d556a){var _0x30ba10=this;return new Promise(function(_0x2a9dc4,_0x1221e0){return db[_0x8d61('0x15')]['find']({'raw':_0x3d556a[_0x8d61('0x16')]?_0x3d556a['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d556a['options']?_0x3d556a['options'][_0x8d61('0x17')]||null:null,'attributes':_0x3d556a[_0x8d61('0x16')]?_0x3d556a[_0x8d61('0x16')][_0x8d61('0x18')]||null:null,'include':_0x3d556a[_0x8d61('0x16')]?_0x3d556a[_0x8d61('0x16')]['include']?_[_0x8d61('0x19')](_0x3d556a[_0x8d61('0x16')][_0x8d61('0x1a')],function(_0x4ddba3){return{'model':db[_0x4ddba3['model']],'as':_0x4ddba3['as'],'attributes':_0x4ddba3['attributes'],'include':_0x4ddba3[_0x8d61('0x1a')]?_[_0x8d61('0x19')](_0x4ddba3[_0x8d61('0x1a')],function(_0x20bdf1){return{'model':db[_0x20bdf1[_0x8d61('0x1b')]],'as':_0x20bdf1['as'],'attributes':_0x20bdf1[_0x8d61('0x18')],'include':_0x20bdf1['include']?_[_0x8d61('0x19')](_0x20bdf1['include'],function(_0x3265d9){return{'model':db[_0x3265d9['model']],'as':_0x3265d9['as'],'attributes':_0x3265d9[_0x8d61('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8d61('0xa')](function(_0x502f02){logger[_0x8d61('0xb')](_0x8d61('0x14'),_0x3d556a);logger['debug']('ShowSquareOdbc',_0x3d556a,JSON[_0x8d61('0x1c')](_0x502f02));_0x2a9dc4(_0x502f02);})[_0x8d61('0x13')](function(_0x583253){logger[_0x8d61('0x11')](_0x8d61('0x14'),_0x583253[_0x8d61('0x12')],_0x3d556a);_0x1221e0(_0x30ba10[_0x8d61('0x11')](0x1f4,_0x583253['message']));});});}; \ No newline at end of file +var _0xb7ec=['find','raw','options','where','map','model','attributes','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSquareOdbc'];(function(_0x2043b4,_0x200a72){var _0x300c14=function(_0x3cb84b){while(--_0x3cb84b){_0x2043b4['push'](_0x2043b4['shift']());}};_0x300c14(++_0x200a72);}(_0xb7ec,0x152));var _0xcb7e=function(_0x34c403,_0x341b70){_0x34c403=_0x34c403-0x0;var _0x5bf2b9=_0xb7ec[_0x34c403];return _0x5bf2b9;};'use strict';var _=require(_0xcb7e('0x0'));var util=require(_0xcb7e('0x1'));var moment=require(_0xcb7e('0x2'));var BPromise=require(_0xcb7e('0x3'));var rs=require(_0xcb7e('0x4'));var fs=require('fs');var Redis=require(_0xcb7e('0x5'));var db=require(_0xcb7e('0x6'))['db'];var utils=require(_0xcb7e('0x7'));var logger=require(_0xcb7e('0x8'))(_0xcb7e('0x9'));var config=require(_0xcb7e('0xa'));var jayson=require(_0xcb7e('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1abb32,_0x380f4d,_0x2f5f67){return new BPromise(function(_0x58ca36,_0x64d30e){return client[_0xcb7e('0xc')](_0x1abb32,_0x2f5f67)[_0xcb7e('0xd')](function(_0x42544b){logger[_0xcb7e('0xe')](_0xcb7e('0xf'),_0x380f4d,'request\x20sent');logger[_0xcb7e('0x10')](_0xcb7e('0x11'),_0x380f4d,_0xcb7e('0x12'),JSON[_0xcb7e('0x13')](_0x42544b));if(_0x42544b[_0xcb7e('0x14')]){if(_0x42544b[_0xcb7e('0x14')][_0xcb7e('0x15')]===0x1f4){logger[_0xcb7e('0x14')](_0xcb7e('0xf'),_0x380f4d,_0x42544b[_0xcb7e('0x14')]['message']);return _0x64d30e(_0x42544b[_0xcb7e('0x14')][_0xcb7e('0x16')]);}logger['error'](_0xcb7e('0xf'),_0x380f4d,_0x42544b[_0xcb7e('0x14')][_0xcb7e('0x16')]);return _0x58ca36(_0x42544b[_0xcb7e('0x14')][_0xcb7e('0x16')]);}else{logger['info'](_0xcb7e('0xf'),_0x380f4d,'request\x20sent');_0x58ca36(_0x42544b['result'][_0xcb7e('0x16')]);}})[_0xcb7e('0x17')](function(_0x33622f){logger[_0xcb7e('0x14')](_0xcb7e('0xf'),_0x380f4d,_0x33622f);_0x64d30e(_0x33622f);});});}exports[_0xcb7e('0x18')]=function(_0x450281){var _0x2be4e0=this;return new Promise(function(_0x1e0a75,_0x270eee){return db['SquareOdbc'][_0xcb7e('0x19')]({'raw':_0x450281['options']?_0x450281['options'][_0xcb7e('0x1a')]===undefined?!![]:![]:!![],'where':_0x450281[_0xcb7e('0x1b')]?_0x450281['options'][_0xcb7e('0x1c')]||null:null,'attributes':_0x450281[_0xcb7e('0x1b')]?_0x450281['options']['attributes']||null:null,'include':_0x450281[_0xcb7e('0x1b')]?_0x450281[_0xcb7e('0x1b')]['include']?_[_0xcb7e('0x1d')](_0x450281[_0xcb7e('0x1b')]['include'],function(_0x1250f7){return{'model':db[_0x1250f7[_0xcb7e('0x1e')]],'as':_0x1250f7['as'],'attributes':_0x1250f7[_0xcb7e('0x1f')],'include':_0x1250f7[_0xcb7e('0x20')]?_['map'](_0x1250f7[_0xcb7e('0x20')],function(_0x42fac3){return{'model':db[_0x42fac3[_0xcb7e('0x1e')]],'as':_0x42fac3['as'],'attributes':_0x42fac3[_0xcb7e('0x1f')],'include':_0x42fac3[_0xcb7e('0x20')]?_[_0xcb7e('0x1d')](_0x42fac3[_0xcb7e('0x20')],function(_0x41ca0a){return{'model':db[_0x41ca0a[_0xcb7e('0x1e')]],'as':_0x41ca0a['as'],'attributes':_0x41ca0a[_0xcb7e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b6138){logger[_0xcb7e('0xe')](_0xcb7e('0x18'),_0x450281);logger['debug']('ShowSquareOdbc',_0x450281,JSON['stringify'](_0x1b6138));_0x1e0a75(_0x1b6138);})[_0xcb7e('0x17')](function(_0x461ec8){logger[_0xcb7e('0x14')]('ShowSquareOdbc',_0x461ec8[_0xcb7e('0x16')],_0x450281);_0x270eee(_0x2be4e0[_0xcb7e('0x14')](0x1f4,_0x461ec8[_0xcb7e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9f81a12..fcae5ad 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 _0x8ae2=['/:id','destroy','removeUsers','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/users','getUsers','post','create','addUsers','update','delete'];(function(_0x31caff,_0xb839c2){var _0x20048a=function(_0x308fda){while(--_0x308fda){_0x31caff['push'](_0x31caff['shift']());}};_0x20048a(++_0xb839c2);}(_0x8ae2,0x143));var _0x28ae=function(_0x47ad96,_0x2a9d2e){_0x47ad96=_0x47ad96-0x0;var _0x1bca3b=_0x8ae2[_0x47ad96];return _0x1bca3b;};'use strict';var multer=require(_0x28ae('0x0'));var util=require(_0x28ae('0x1'));var path=require('path');var timeout=require(_0x28ae('0x2'));var express=require('express');var router=express[_0x28ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x28ae('0x4'));var interaction=require(_0x28ae('0x5'));var config=require(_0x28ae('0x6'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x28ae('0x7')](),controller[_0x28ae('0x8')]);router[_0x28ae('0x9')]('/:id',auth[_0x28ae('0x7')](),controller['show']);router[_0x28ae('0x9')](_0x28ae('0xa'),auth[_0x28ae('0x7')](),controller[_0x28ae('0xb')]);router[_0x28ae('0xc')]('/',auth[_0x28ae('0x7')](),controller[_0x28ae('0xd')]);router[_0x28ae('0xc')]('/:id/users',auth[_0x28ae('0x7')](),controller[_0x28ae('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x28ae('0xf')]);router[_0x28ae('0x10')](_0x28ae('0x11'),auth['isAuthenticated'](),controller[_0x28ae('0x12')]);router[_0x28ae('0x10')]('/:id/users',auth[_0x28ae('0x7')](),controller[_0x28ae('0x13')]);module['exports']=router; \ No newline at end of file +var _0x087b=['../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x18ce49,_0x5ae15a){var _0x2d642a=function(_0x4387bd){while(--_0x4387bd){_0x18ce49['push'](_0x18ce49['shift']());}};_0x2d642a(++_0x5ae15a);}(_0x087b,0x11a));var _0xb087=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x087b[_0x4a3898];return _0x25ceb0;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0xf')]('/',auth['isAuthenticated'](),controller[_0xb087('0x10')]);router[_0xb087('0xf')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x12')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x13')]);router[_0xb087('0x14')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x15')]);router[_0xb087('0x14')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);module[_0xb087('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 4880f51..0dfa788 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 _0xc205=['BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','name','STRING','TEXT'];(function(_0x2c9d8d,_0x305abd){var _0x41448d=function(_0x16364d){while(--_0x16364d){_0x2c9d8d['push'](_0x2c9d8d['shift']());}};_0x41448d(++_0x305abd);}(_0xc205,0xcb));var _0x5c20=function(_0x33f476,_0x2c9465){_0x33f476=_0x33f476-0x0;var _0x4c42cb=_0xc205[_0x33f476];return _0x4c42cb;};'use strict';var Sequelize=require(_0x5c20('0x0'));module[_0x5c20('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5c20('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5c20('0x3')]},'notes':{'type':Sequelize[_0x5c20('0x4')]},'preproduction':{'type':Sequelize[_0x5c20('0x5')](_0x5c20('0x6')),'get':function(){if(this[_0x5c20('0x7')](_0x5c20('0x8'))){return this[_0x5c20('0x7')](_0x5c20('0x8'))[_0x5c20('0x9')](_0x5c20('0xa'));}}},'production':{'type':Sequelize['BLOB'](_0x5c20('0x6')),'get':function(){if(this['getDataValue'](_0x5c20('0xb'))){return this['getDataValue'](_0x5c20('0xb'))[_0x5c20('0x9')](_0x5c20('0xa'));}}},'savedAt':{'type':Sequelize[_0x5c20('0xc')]},'publishedAt':{'type':Sequelize[_0x5c20('0xc')]}}; \ No newline at end of file +var _0xdc3f=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','BLOB'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc3f,0xaf));var _0xfdc3=function(_0x37160b,_0x11e6e5){_0x37160b=_0x37160b-0x0;var _0x7f9d63=_0xdc3f[_0x37160b];return _0x7f9d63;};'use strict';var Sequelize=require(_0xfdc3('0x0'));module[_0xfdc3('0x1')]={'name':{'type':Sequelize[_0xfdc3('0x2')],'unique':_0xfdc3('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfdc3('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xfdc3('0x4')](_0xfdc3('0x5')),'get':function(){if(this[_0xfdc3('0x6')]('preproduction')){return this[_0xfdc3('0x6')](_0xfdc3('0x7'))[_0xfdc3('0x8')](_0xfdc3('0x9'));}}},'production':{'type':Sequelize[_0xfdc3('0x4')]('long'),'get':function(){if(this[_0xfdc3('0x6')](_0xfdc3('0xa'))){return this[_0xfdc3('0x6')]('production')[_0xfdc3('0x8')](_0xfdc3('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xfdc3('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index b782766..f8fdf9c 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 _0x7a54=['include','rows','catch','show','params','filters','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','agi','production','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','User','merge','getUsers','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','json','offset','undefined','limit','count','status','Content-Range','update','then','get','SquareProjects','UserProfileResource','destroy','publish','stringify','error','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','filter','options'];(function(_0x171121,_0x5040b0){var _0x3d9d15=function(_0x3bc283){while(--_0x3bc283){_0x171121['push'](_0x171121['shift']());}};_0x3d9d15(++_0x5040b0);}(_0x7a54,0x106));var _0x47a5=function(_0x2971eb,_0x187565){_0x2971eb=_0x2971eb-0x0;var _0x46f165=_0x7a54[_0x2971eb];return _0x46f165;};'use strict';var _=require(_0x47a5('0x0'));var Redis=require(_0x47a5('0x1'));var qs=require(_0x47a5('0x2'));var logger=require('../../config/logger')(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];config[_0x47a5('0x5')]=_[_0x47a5('0x6')](config[_0x47a5('0x5')],{'host':_0x47a5('0x7'),'port':0x18eb});var socket=require(_0x47a5('0x8'))(new Redis(config['redis']));require(_0x47a5('0x9'))['register'](socket);function respondWithStatusCode(_0x343372,_0x30e405){_0x30e405=_0x30e405||0xcc;return function(_0x506eda){if(_0x506eda){return _0x343372[_0x47a5('0xa')](_0x30e405);}return _0x343372['status'](_0x30e405)['end']();};}function respondWithResult(_0x582352,_0x2a0e98){_0x2a0e98=_0x2a0e98||0xc8;return function(_0x2baee7){if(_0x2baee7){return _0x582352['status'](_0x2a0e98)[_0x47a5('0xb')](_0x2baee7);}};}function respondWithFilteredResult(_0x49e844,_0x5de6d7){return function(_0x1f47f4){if(_0x1f47f4){var _0x69e4d4=typeof _0x5de6d7[_0x47a5('0xc')]===_0x47a5('0xd')&&typeof _0x5de6d7[_0x47a5('0xe')]===_0x47a5('0xd');var _0x1eae59=_0x1f47f4['count'];var _0x44bd3e=_0x69e4d4?0x0:_0x5de6d7[_0x47a5('0xc')];var _0x1cf309=_0x69e4d4?_0x1f47f4[_0x47a5('0xf')]:_0x5de6d7[_0x47a5('0xc')]+_0x5de6d7[_0x47a5('0xe')];var _0x3c6c46;if(_0x1cf309>=_0x1eae59){_0x1cf309=_0x1eae59;_0x3c6c46=0xc8;}else{_0x3c6c46=0xce;}_0x49e844[_0x47a5('0x10')](_0x3c6c46);return _0x49e844['set'](_0x47a5('0x11'),_0x44bd3e+'-'+_0x1cf309+'/'+_0x1eae59)[_0x47a5('0xb')](_0x1f47f4);}return null;};}function saveUpdates(_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){return _0x2a2cbb[_0x47a5('0x12')](_0x3b001e)['then'](function(_0x549de3){return _0x549de3;});}return null;};}function removeEntity(_0x138bc0){return function(_0x4b966e){if(_0x4b966e){return _0x4b966e['destroy']()[_0x47a5('0x13')](function(){var _0xaf70a6=_0x4b966e[_0x47a5('0x14')]({'plain':!![]});var _0x1ef371=_0x47a5('0x15');return db[_0x47a5('0x16')][_0x47a5('0x17')]({'where':{'type':_0x1ef371,'resourceId':_0xaf70a6['id']}})[_0x47a5('0x13')](function(){return _0x4b966e;});})[_0x47a5('0x13')](function(){var _0x4a9fcb=new Redis(config[_0x47a5('0x5')]);_0x4a9fcb[_0x47a5('0x18')]('agi',JSON[_0x47a5('0x19')]({'id':_0x4b966e['id'],'deleted':!![]}));})[_0x47a5('0x13')](function(){_0x138bc0[_0x47a5('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb8ae6c){return function(_0x2f142b){if(!_0x2f142b){_0xb8ae6c[_0x47a5('0xa')](0x194);}return _0x2f142b;};}function handleError(_0x7a9f9e,_0x5ef1b1){_0x5ef1b1=_0x5ef1b1||0x1f4;return function(_0xe2dea9){logger[_0x47a5('0x1a')](_0xe2dea9['stack']);if(_0xe2dea9[_0x47a5('0x1b')]){delete _0xe2dea9[_0x47a5('0x1b')];}_0x7a9f9e[_0x47a5('0x10')](_0x5ef1b1)[_0x47a5('0x1c')](_0xe2dea9);};}exports[_0x47a5('0x1d')]=function(_0x50bf17,_0x53078a){var _0x136745={},_0x5686db={},_0x1ea9c8={'count':0x0,'rows':[]};var _0x5b6c4e=_[_0x47a5('0x1e')](db[_0x47a5('0x1f')][_0x47a5('0x20')],function(_0x1dac65){return{'name':_0x1dac65[_0x47a5('0x21')],'type':_0x1dac65[_0x47a5('0x22')][_0x47a5('0x23')]};});_0x5686db[_0x47a5('0x24')]=_[_0x47a5('0x1e')](_0x5b6c4e,_0x47a5('0x1b'));_0x5686db[_0x47a5('0x25')]=_[_0x47a5('0x26')](_0x50bf17[_0x47a5('0x25')]);_0x5686db['filters']=_[_0x47a5('0x27')](_0x5686db['model'],_0x5686db[_0x47a5('0x25')]);_0x136745[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x5686db['model'],qs[_0x47a5('0x29')](_0x50bf17[_0x47a5('0x25')][_0x47a5('0x29')]));_0x136745[_0x47a5('0x28')]=_0x136745['attributes']['length']?_0x136745[_0x47a5('0x28')]:_0x5686db[_0x47a5('0x24')];if(!_0x50bf17['query']['hasOwnProperty'](_0x47a5('0x2a'))){_0x136745[_0x47a5('0xe')]=qs['limit'](_0x50bf17[_0x47a5('0x25')]['limit']);_0x136745[_0x47a5('0xc')]=qs[_0x47a5('0xc')](_0x50bf17['query']['offset']);}_0x136745[_0x47a5('0x2b')]=qs['sort'](_0x50bf17[_0x47a5('0x25')][_0x47a5('0x2c')]);_0x136745[_0x47a5('0x2d')]=qs['filters'](_[_0x47a5('0x2e')](_0x50bf17['query'],_0x5686db['filters']),_0x5b6c4e);if(_0x50bf17[_0x47a5('0x25')]['filter']){_0x136745[_0x47a5('0x2d')]=_['merge'](_0x136745[_0x47a5('0x2d')],{'$or':_[_0x47a5('0x1e')](_0x5b6c4e,function(_0x38c8d4){if(_0x38c8d4[_0x47a5('0x22')]!==_0x47a5('0x2f')){var _0xed6320={};_0xed6320[_0x38c8d4[_0x47a5('0x1b')]]={'$like':'%'+_0x50bf17[_0x47a5('0x25')][_0x47a5('0x30')]+'%'};return _0xed6320;}})});}_0x136745=_['merge']({},_0x136745,_0x50bf17[_0x47a5('0x31')]);var _0x10f136={'where':_0x136745['where']};return db[_0x47a5('0x1f')][_0x47a5('0xf')](_0x10f136)[_0x47a5('0x13')](function(_0x49c4b5){_0x1ea9c8[_0x47a5('0xf')]=_0x49c4b5;if(_0x50bf17[_0x47a5('0x25')]['includeAll']){_0x136745[_0x47a5('0x32')]=[{'all':!![]}];}return db[_0x47a5('0x1f')]['findAll'](_0x136745);})['then'](function(_0x5ebd8c){_0x1ea9c8[_0x47a5('0x33')]=_0x5ebd8c;return _0x1ea9c8;})['then'](respondWithFilteredResult(_0x53078a,_0x136745))[_0x47a5('0x34')](handleError(_0x53078a,null));};exports[_0x47a5('0x35')]=function(_0x301a85,_0x111f0d){var _0x1b2c80={'raw':![],'where':{'id':_0x301a85[_0x47a5('0x36')]['id']}},_0xcb5243={};_0xcb5243[_0x47a5('0x24')]=_[_0x47a5('0x26')](db[_0x47a5('0x1f')][_0x47a5('0x20')]);_0xcb5243[_0x47a5('0x25')]=_[_0x47a5('0x26')](_0x301a85['query']);_0xcb5243[_0x47a5('0x37')]=_[_0x47a5('0x27')](_0xcb5243[_0x47a5('0x24')],_0xcb5243[_0x47a5('0x25')]);_0x1b2c80['attributes']=_[_0x47a5('0x27')](_0xcb5243['model'],qs['fields'](_0x301a85['query']['fields']));_0x1b2c80[_0x47a5('0x28')]=_0x1b2c80['attributes'][_0x47a5('0x38')]?_0x1b2c80[_0x47a5('0x28')]:_0xcb5243[_0x47a5('0x24')];if(_0x301a85['query'][_0x47a5('0x39')]){_0x1b2c80[_0x47a5('0x32')]=[{'all':!![]}];}_0x1b2c80=_['merge']({},_0x1b2c80,_0x301a85['options']);return db[_0x47a5('0x1f')]['find'](_0x1b2c80)[_0x47a5('0x13')](handleEntityNotFound(_0x111f0d,null))[_0x47a5('0x13')](respondWithResult(_0x111f0d,null))[_0x47a5('0x34')](handleError(_0x111f0d,null));};exports[_0x47a5('0x3a')]=function(_0x34a9ae,_0xf0edbb){return db[_0x47a5('0x1f')][_0x47a5('0x3a')](_0x34a9ae[_0x47a5('0x3b')],{})[_0x47a5('0x13')](function(_0x24ecb1){var _0x3c3ebf=_0x34a9ae[_0x47a5('0x3c')][_0x47a5('0x14')]({'plain':!![]});if(!_0x3c3ebf)throw new Error(_0x47a5('0x3d'));if(_0x3c3ebf[_0x47a5('0x3e')]==='user'){var _0x2d38de=_0x24ecb1[_0x47a5('0x14')]({'plain':!![]});var _0x49eab1='SquareProjects';return db[_0x47a5('0x3f')]['find']({'where':{'name':_0x49eab1,'userProfileId':_0x3c3ebf[_0x47a5('0x40')]},'raw':!![]})[_0x47a5('0x13')](function(_0x54c35f){if(_0x54c35f&&_0x54c35f['autoAssociation']===0x0){return db[_0x47a5('0x16')]['create']({'name':_0x2d38de[_0x47a5('0x1b')],'resourceId':_0x2d38de['id'],'type':_0x54c35f[_0x47a5('0x1b')],'sectionId':_0x54c35f['id']},{})[_0x47a5('0x13')](function(){return _0x24ecb1;});}else{return _0x24ecb1;}})[_0x47a5('0x34')](function(_0x44fe8a){logger[_0x47a5('0x1a')](_0x47a5('0x41'),_0x44fe8a);throw _0x44fe8a;});}return _0x24ecb1;})['then'](respondWithResult(_0xf0edbb,0xc9))['catch'](handleError(_0xf0edbb,null));};exports[_0x47a5('0x12')]=function(_0x411230,_0x1163e3){if(_0x411230[_0x47a5('0x3b')]['id']){delete _0x411230[_0x47a5('0x3b')]['id'];}return db[_0x47a5('0x1f')][_0x47a5('0x42')]({'where':{'id':_0x411230['params']['id']}})[_0x47a5('0x13')](handleEntityNotFound(_0x1163e3,null))[_0x47a5('0x13')](saveUpdates(_0x411230[_0x47a5('0x3b')],null))['then'](function(_0x12ca40){if(!_0x12ca40)return;var _0x54bd83=_0x12ca40[_0x47a5('0x14')]({'plain':!![]});return _0x54bd83;})[_0x47a5('0x13')](function(_0x46e90b){var _0xf03bd5=new Redis(config['redis']);_0xf03bd5[_0x47a5('0x18')](_0x47a5('0x43'),JSON[_0x47a5('0x19')](_[_0x47a5('0x2e')](_0x46e90b,['id',_0x47a5('0x1b'),_0x47a5('0x44')])));return _0x46e90b;})[_0x47a5('0x13')](respondWithResult(_0x1163e3,null))['catch'](handleError(_0x1163e3,null));};exports[_0x47a5('0x17')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x1f')][_0x47a5('0x42')]({'where':{'id':_0x43721b[_0x47a5('0x36')]['id']}})['then'](handleEntityNotFound(_0x187d7e,null))[_0x47a5('0x13')](removeEntity(_0x187d7e,null))[_0x47a5('0x34')](handleError(_0x187d7e,null));};exports[_0x47a5('0x45')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x1f')][_0x47a5('0x42')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x13')](function(_0x376e1d){if(_0x376e1d){return _0x376e1d['addUsers'](_0x53871e['body'][_0x47a5('0x46')],_['omit'](_0x53871e[_0x47a5('0x3b')],['ids','id'])||{});}})['then'](respondWithResult(_0x4c5ed,null))[_0x47a5('0x34')](handleError(_0x4c5ed,null));};exports[_0x47a5('0x47')]=function(_0x53eedf,_0x1b958b){return db[_0x47a5('0x1f')]['find']({'where':{'id':_0x53eedf['params']['id']}})[_0x47a5('0x13')](handleEntityNotFound(_0x1b958b,null))[_0x47a5('0x13')](function(_0x867da0){if(_0x867da0){return _0x867da0[_0x47a5('0x47')](_0x53eedf['query'][_0x47a5('0x46')])[_0x47a5('0x13')](function(){if(_[_0x47a5('0x48')](_0x53eedf['query'][_0x47a5('0x46')])){for(var _0x4db625=0x0;_0x4db625<_0x53eedf[_0x47a5('0x25')][_0x47a5('0x46')][_0x47a5('0x38')];_0x4db625+=0x1){socket[_0x47a5('0x49')](_0x47a5('0x4a'),{'UserId':Number(_0x53eedf['query'][_0x47a5('0x46')][_0x4db625]),'SquareProjectId':Number(_0x53eedf['params']['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x53eedf['query'][_0x47a5('0x46')]),'SquareProjectId':Number(_0x53eedf[_0x47a5('0x36')]['id'])});}});}})[_0x47a5('0x13')](respondWithStatusCode(_0x1b958b,null))['catch'](handleError(_0x1b958b,null));};exports['getUsers']=function(_0x139229,_0x23020b){var _0x45d4b6={};var _0x3c2b46={};var _0xc45e25;var _0x4b5d0c;return db[_0x47a5('0x1f')]['findOne']({'where':{'id':_0x139229[_0x47a5('0x36')]['id']}})[_0x47a5('0x13')](handleEntityNotFound(_0x23020b,null))['then'](function(_0x32b4de){if(_0x32b4de){_0xc45e25=_0x32b4de;_0x3c2b46[_0x47a5('0x24')]=_[_0x47a5('0x26')](db[_0x47a5('0x4b')][_0x47a5('0x20')]);_0x3c2b46[_0x47a5('0x25')]=_[_0x47a5('0x26')](_0x139229[_0x47a5('0x25')]);_0x3c2b46['filters']=_[_0x47a5('0x27')](_0x3c2b46[_0x47a5('0x24')],_0x3c2b46[_0x47a5('0x25')]);_0x45d4b6[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x3c2b46['model'],qs[_0x47a5('0x29')](_0x139229[_0x47a5('0x25')][_0x47a5('0x29')]));_0x45d4b6[_0x47a5('0x28')]=_0x45d4b6[_0x47a5('0x28')][_0x47a5('0x38')]?_0x45d4b6[_0x47a5('0x28')]:_0x3c2b46[_0x47a5('0x24')];_0x45d4b6[_0x47a5('0x2b')]=qs[_0x47a5('0x2c')](_0x139229[_0x47a5('0x25')][_0x47a5('0x2c')]);_0x45d4b6[_0x47a5('0x2d')]=qs[_0x47a5('0x37')](_[_0x47a5('0x2e')](_0x139229['query'],_0x3c2b46[_0x47a5('0x37')]));if(_0x139229[_0x47a5('0x25')][_0x47a5('0x30')]){_0x45d4b6['where']=_[_0x47a5('0x4c')](_0x45d4b6[_0x47a5('0x2d')],{'$or':_[_0x47a5('0x1e')](_0x45d4b6[_0x47a5('0x28')],function(_0x5d9822){var _0x3ac402={};_0x3ac402[_0x5d9822]={'$like':'%'+_0x139229['query'][_0x47a5('0x30')]+'%'};return _0x3ac402;})});}_0x45d4b6=_['merge']({},_0x45d4b6,_0x139229[_0x47a5('0x31')]);return _0xc45e25['getUsers'](_0x45d4b6);}})[_0x47a5('0x13')](function(_0x2f27c3){if(_0x2f27c3){_0x4b5d0c=_0x2f27c3[_0x47a5('0x38')];if(!_0x139229['query']['hasOwnProperty']('nolimit')){_0x45d4b6[_0x47a5('0xe')]=qs[_0x47a5('0xe')](_0x139229[_0x47a5('0x25')][_0x47a5('0xe')]);_0x45d4b6['offset']=qs[_0x47a5('0xc')](_0x139229[_0x47a5('0x25')][_0x47a5('0xc')]);}return _0xc45e25[_0x47a5('0x4d')](_0x45d4b6);}})[_0x47a5('0x13')](function(_0xb9f589){if(_0xb9f589){return _0xb9f589?{'count':_0x4b5d0c,'rows':_0xb9f589}:null;}})[_0x47a5('0x13')](respondWithResult(_0x23020b,null))[_0x47a5('0x34')](handleError(_0x23020b,null));}; \ No newline at end of file +var _0xe3da=['rawAttributes','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','filters','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','fields','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','ids','omit','emit','userSquareProject:remove','getUsers','findOne','User','sort','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','SquareProjects','UserProfileResource','publish','agi','stringify','end','error','stack','name','send','index','map','SquareProject'];(function(_0x3eb21a,_0x5ce351){var _0x263c8a=function(_0x1e320c){while(--_0x1e320c){_0x3eb21a['push'](_0x3eb21a['shift']());}};_0x263c8a(++_0x5ce351);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae3d('0x0'));var Redis=require(_0xae3d('0x1'));var qs=require(_0xae3d('0x2'));var logger=require(_0xae3d('0x3'))(_0xae3d('0x4'));var config=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];config[_0xae3d('0x7')]=_[_0xae3d('0x8')](config[_0xae3d('0x7')],{'host':_0xae3d('0x9'),'port':0x18eb});var socket=require(_0xae3d('0xa'))(new Redis(config[_0xae3d('0x7')]));require(_0xae3d('0xb'))[_0xae3d('0xc')](socket);function respondWithStatusCode(_0x33c089,_0x583b98){_0x583b98=_0x583b98||0xcc;return function(_0x2a5c45){if(_0x2a5c45){return _0x33c089[_0xae3d('0xd')](_0x583b98);}return _0x33c089['status'](_0x583b98)['end']();};}function respondWithResult(_0x459592,_0x157a3e){_0x157a3e=_0x157a3e||0xc8;return function(_0x420e28){if(_0x420e28){return _0x459592[_0xae3d('0xe')](_0x157a3e)[_0xae3d('0xf')](_0x420e28);}};}function respondWithFilteredResult(_0x15d6da,_0x4bd4ec){return function(_0x145762){if(_0x145762){var _0x49fe58=typeof _0x4bd4ec[_0xae3d('0x10')]===_0xae3d('0x11')&&typeof _0x4bd4ec[_0xae3d('0x12')]===_0xae3d('0x11');var _0x48aa74=_0x145762[_0xae3d('0x13')];var _0x27561c=_0x49fe58?0x0:_0x4bd4ec[_0xae3d('0x10')];var _0x1605ac=_0x49fe58?_0x145762[_0xae3d('0x13')]:_0x4bd4ec[_0xae3d('0x10')]+_0x4bd4ec[_0xae3d('0x12')];var _0x4e646f;if(_0x1605ac>=_0x48aa74){_0x1605ac=_0x48aa74;_0x4e646f=0xc8;}else{_0x4e646f=0xce;}_0x15d6da[_0xae3d('0xe')](_0x4e646f);return _0x15d6da[_0xae3d('0x14')](_0xae3d('0x15'),_0x27561c+'-'+_0x1605ac+'/'+_0x48aa74)[_0xae3d('0xf')](_0x145762);}return null;};}function saveUpdates(_0x192c13){return function(_0x2da957){if(_0x2da957){return _0x2da957['update'](_0x192c13)[_0xae3d('0x16')](function(_0x33449a){return _0x33449a;});}return null;};}function removeEntity(_0x2e31f1){return function(_0x5303c2){if(_0x5303c2){return _0x5303c2[_0xae3d('0x17')]()[_0xae3d('0x16')](function(){var _0x558e42=_0x5303c2['get']({'plain':!![]});var _0x8a37cc=_0xae3d('0x18');return db[_0xae3d('0x19')][_0xae3d('0x17')]({'where':{'type':_0x8a37cc,'resourceId':_0x558e42['id']}})[_0xae3d('0x16')](function(){return _0x5303c2;});})['then'](function(){var _0x121024=new Redis(config['redis']);_0x121024[_0xae3d('0x1a')](_0xae3d('0x1b'),JSON[_0xae3d('0x1c')]({'id':_0x5303c2['id'],'deleted':!![]}));})[_0xae3d('0x16')](function(){_0x2e31f1[_0xae3d('0xe')](0xcc)[_0xae3d('0x1d')]();});}};}function handleEntityNotFound(_0x26c419){return function(_0x155099){if(!_0x155099){_0x26c419[_0xae3d('0xd')](0x194);}return _0x155099;};}function handleError(_0x11ecf7,_0x300be8){_0x300be8=_0x300be8||0x1f4;return function(_0x9bf34a){logger[_0xae3d('0x1e')](_0x9bf34a[_0xae3d('0x1f')]);if(_0x9bf34a[_0xae3d('0x20')]){delete _0x9bf34a[_0xae3d('0x20')];}_0x11ecf7[_0xae3d('0xe')](_0x300be8)[_0xae3d('0x21')](_0x9bf34a);};}exports[_0xae3d('0x22')]=function(_0x1b1217,_0x5d45db){var _0x16c014={},_0x185e71={},_0xb5940={'count':0x0,'rows':[]};var _0x52df0f=_[_0xae3d('0x23')](db[_0xae3d('0x24')][_0xae3d('0x25')],function(_0x54c1e1){return{'name':_0x54c1e1['fieldName'],'type':_0x54c1e1[_0xae3d('0x26')][_0xae3d('0x27')]};});_0x185e71[_0xae3d('0x28')]=_[_0xae3d('0x23')](_0x52df0f,_0xae3d('0x20'));_0x185e71['query']=_[_0xae3d('0x29')](_0x1b1217[_0xae3d('0x2a')]);_0x185e71['filters']=_[_0xae3d('0x2b')](_0x185e71[_0xae3d('0x28')],_0x185e71[_0xae3d('0x2a')]);_0x16c014[_0xae3d('0x2c')]=_[_0xae3d('0x2b')](_0x185e71[_0xae3d('0x28')],qs['fields'](_0x1b1217['query']['fields']));_0x16c014[_0xae3d('0x2c')]=_0x16c014[_0xae3d('0x2c')][_0xae3d('0x2d')]?_0x16c014[_0xae3d('0x2c')]:_0x185e71['model'];if(!_0x1b1217[_0xae3d('0x2a')][_0xae3d('0x2e')](_0xae3d('0x2f'))){_0x16c014[_0xae3d('0x12')]=qs[_0xae3d('0x12')](_0x1b1217[_0xae3d('0x2a')][_0xae3d('0x12')]);_0x16c014['offset']=qs[_0xae3d('0x10')](_0x1b1217['query']['offset']);}_0x16c014[_0xae3d('0x30')]=qs['sort'](_0x1b1217[_0xae3d('0x2a')]['sort']);_0x16c014['where']=qs[_0xae3d('0x31')](_[_0xae3d('0x32')](_0x1b1217[_0xae3d('0x2a')],_0x185e71['filters']),_0x52df0f);if(_0x1b1217[_0xae3d('0x2a')]['filter']){_0x16c014[_0xae3d('0x33')]=_[_0xae3d('0x34')](_0x16c014[_0xae3d('0x33')],{'$or':_[_0xae3d('0x23')](_0x52df0f,function(_0x18c469){if(_0x18c469[_0xae3d('0x26')]!==_0xae3d('0x35')){var _0x21d84d={};_0x21d84d[_0x18c469[_0xae3d('0x20')]]={'$like':'%'+_0x1b1217[_0xae3d('0x2a')][_0xae3d('0x36')]+'%'};return _0x21d84d;}})});}_0x16c014=_['merge']({},_0x16c014,_0x1b1217['options']);var _0x3992eb={'where':_0x16c014['where']};return db[_0xae3d('0x24')][_0xae3d('0x13')](_0x3992eb)[_0xae3d('0x16')](function(_0x1581b2){_0xb5940[_0xae3d('0x13')]=_0x1581b2;if(_0x1b1217[_0xae3d('0x2a')][_0xae3d('0x37')]){_0x16c014[_0xae3d('0x38')]=[{'all':!![]}];}return db[_0xae3d('0x24')][_0xae3d('0x39')](_0x16c014);})[_0xae3d('0x16')](function(_0x549db8){_0xb5940[_0xae3d('0x3a')]=_0x549db8;return _0xb5940;})[_0xae3d('0x16')](respondWithFilteredResult(_0x5d45db,_0x16c014))[_0xae3d('0x3b')](handleError(_0x5d45db,null));};exports['show']=function(_0x4df102,_0x99184f){var _0x190dd4={'raw':![],'where':{'id':_0x4df102[_0xae3d('0x3c')]['id']}},_0x524cf2={};_0x524cf2[_0xae3d('0x28')]=_[_0xae3d('0x29')](db[_0xae3d('0x24')][_0xae3d('0x25')]);_0x524cf2[_0xae3d('0x2a')]=_['keys'](_0x4df102[_0xae3d('0x2a')]);_0x524cf2[_0xae3d('0x31')]=_[_0xae3d('0x2b')](_0x524cf2[_0xae3d('0x28')],_0x524cf2[_0xae3d('0x2a')]);_0x190dd4['attributes']=_[_0xae3d('0x2b')](_0x524cf2['model'],qs[_0xae3d('0x3d')](_0x4df102[_0xae3d('0x2a')][_0xae3d('0x3d')]));_0x190dd4[_0xae3d('0x2c')]=_0x190dd4['attributes']['length']?_0x190dd4['attributes']:_0x524cf2[_0xae3d('0x28')];if(_0x4df102[_0xae3d('0x2a')]['includeAll']){_0x190dd4['include']=[{'all':!![]}];}_0x190dd4=_['merge']({},_0x190dd4,_0x4df102[_0xae3d('0x3e')]);return db[_0xae3d('0x24')][_0xae3d('0x3f')](_0x190dd4)[_0xae3d('0x16')](handleEntityNotFound(_0x99184f,null))[_0xae3d('0x16')](respondWithResult(_0x99184f,null))[_0xae3d('0x3b')](handleError(_0x99184f,null));};exports[_0xae3d('0x40')]=function(_0x5c621e,_0x566e31){return db['SquareProject'][_0xae3d('0x40')](_0x5c621e['body'],{})[_0xae3d('0x16')](function(_0x14fad3){var _0x41cb63=_0x5c621e[_0xae3d('0x41')][_0xae3d('0x42')]({'plain':!![]});if(!_0x41cb63)throw new Error(_0xae3d('0x43'));if(_0x41cb63[_0xae3d('0x44')]===_0xae3d('0x41')){var _0x38f92d=_0x14fad3[_0xae3d('0x42')]({'plain':!![]});var _0x49b8df='SquareProjects';return db['UserProfileSection']['find']({'where':{'name':_0x49b8df,'userProfileId':_0x41cb63[_0xae3d('0x45')]},'raw':!![]})[_0xae3d('0x16')](function(_0x39f213){if(_0x39f213&&_0x39f213[_0xae3d('0x46')]===0x0){return db['UserProfileResource']['create']({'name':_0x38f92d[_0xae3d('0x20')],'resourceId':_0x38f92d['id'],'type':_0x39f213[_0xae3d('0x20')],'sectionId':_0x39f213['id']},{})[_0xae3d('0x16')](function(){return _0x14fad3;});}else{return _0x14fad3;}})[_0xae3d('0x3b')](function(_0x58e918){logger[_0xae3d('0x1e')](_0xae3d('0x47'),_0x58e918);throw _0x58e918;});}return _0x14fad3;})[_0xae3d('0x16')](respondWithResult(_0x566e31,0xc9))[_0xae3d('0x3b')](handleError(_0x566e31,null));};exports[_0xae3d('0x48')]=function(_0x38ccf1,_0x3e30ea){if(_0x38ccf1[_0xae3d('0x49')]['id']){delete _0x38ccf1[_0xae3d('0x49')]['id'];}return db[_0xae3d('0x24')][_0xae3d('0x3f')]({'where':{'id':_0x38ccf1[_0xae3d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3e30ea,null))['then'](saveUpdates(_0x38ccf1['body'],null))[_0xae3d('0x16')](function(_0x447d20){if(!_0x447d20)return;var _0x5f40b2=_0x447d20[_0xae3d('0x42')]({'plain':!![]});return _0x5f40b2;})['then'](function(_0x5d2bcc){var _0xc19da7=new Redis(config[_0xae3d('0x7')]);_0xc19da7[_0xae3d('0x1a')](_0xae3d('0x1b'),JSON[_0xae3d('0x1c')](_[_0xae3d('0x32')](_0x5d2bcc,['id',_0xae3d('0x20'),'production'])));return _0x5d2bcc;})[_0xae3d('0x16')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x3b')](handleError(_0x3e30ea,null));};exports[_0xae3d('0x17')]=function(_0xd5e300,_0x486682){return db[_0xae3d('0x24')][_0xae3d('0x3f')]({'where':{'id':_0xd5e300[_0xae3d('0x3c')]['id']}})[_0xae3d('0x16')](handleEntityNotFound(_0x486682,null))['then'](removeEntity(_0x486682,null))['catch'](handleError(_0x486682,null));};exports['addUsers']=function(_0x395e34,_0x479983){return db['SquareProject'][_0xae3d('0x3f')]({'where':{'id':_0x395e34[_0xae3d('0x3c')]['id']}})[_0xae3d('0x16')](handleEntityNotFound(_0x479983,null))[_0xae3d('0x16')](function(_0xb9ddc0){if(_0xb9ddc0){return _0xb9ddc0[_0xae3d('0x4a')](_0x395e34['body'][_0xae3d('0x4b')],_[_0xae3d('0x4c')](_0x395e34[_0xae3d('0x49')],[_0xae3d('0x4b'),'id'])||{});}})[_0xae3d('0x16')](respondWithResult(_0x479983,null))[_0xae3d('0x3b')](handleError(_0x479983,null));};exports['removeUsers']=function(_0x3cb7bd,_0x2c1e5e){return db[_0xae3d('0x24')]['find']({'where':{'id':_0x3cb7bd['params']['id']}})['then'](handleEntityNotFound(_0x2c1e5e,null))[_0xae3d('0x16')](function(_0x44e369){if(_0x44e369){return _0x44e369['removeUsers'](_0x3cb7bd[_0xae3d('0x2a')][_0xae3d('0x4b')])[_0xae3d('0x16')](function(){if(_['isArray'](_0x3cb7bd[_0xae3d('0x2a')][_0xae3d('0x4b')])){for(var _0x253ee4=0x0;_0x253ee4<_0x3cb7bd[_0xae3d('0x2a')][_0xae3d('0x4b')][_0xae3d('0x2d')];_0x253ee4+=0x1){socket[_0xae3d('0x4d')](_0xae3d('0x4e'),{'UserId':Number(_0x3cb7bd['query']['ids'][_0x253ee4]),'SquareProjectId':Number(_0x3cb7bd[_0xae3d('0x3c')]['id'])});}}else{socket[_0xae3d('0x4d')](_0xae3d('0x4e'),{'UserId':Number(_0x3cb7bd['query']['ids']),'SquareProjectId':Number(_0x3cb7bd[_0xae3d('0x3c')]['id'])});}});}})[_0xae3d('0x16')](respondWithStatusCode(_0x2c1e5e,null))[_0xae3d('0x3b')](handleError(_0x2c1e5e,null));};exports[_0xae3d('0x4f')]=function(_0x4dd2f4,_0xd1951){var _0xc9fcc9={};var _0x51d7e6={};var _0x19aab4;var _0x2c221b;return db[_0xae3d('0x24')][_0xae3d('0x50')]({'where':{'id':_0x4dd2f4[_0xae3d('0x3c')]['id']}})[_0xae3d('0x16')](handleEntityNotFound(_0xd1951,null))[_0xae3d('0x16')](function(_0x551269){if(_0x551269){_0x19aab4=_0x551269;_0x51d7e6[_0xae3d('0x28')]=_[_0xae3d('0x29')](db[_0xae3d('0x51')][_0xae3d('0x25')]);_0x51d7e6[_0xae3d('0x2a')]=_['keys'](_0x4dd2f4[_0xae3d('0x2a')]);_0x51d7e6[_0xae3d('0x31')]=_[_0xae3d('0x2b')](_0x51d7e6[_0xae3d('0x28')],_0x51d7e6[_0xae3d('0x2a')]);_0xc9fcc9[_0xae3d('0x2c')]=_['intersection'](_0x51d7e6[_0xae3d('0x28')],qs[_0xae3d('0x3d')](_0x4dd2f4['query'][_0xae3d('0x3d')]));_0xc9fcc9[_0xae3d('0x2c')]=_0xc9fcc9[_0xae3d('0x2c')]['length']?_0xc9fcc9['attributes']:_0x51d7e6[_0xae3d('0x28')];_0xc9fcc9[_0xae3d('0x30')]=qs[_0xae3d('0x52')](_0x4dd2f4[_0xae3d('0x2a')][_0xae3d('0x52')]);_0xc9fcc9[_0xae3d('0x33')]=qs[_0xae3d('0x31')](_['pick'](_0x4dd2f4[_0xae3d('0x2a')],_0x51d7e6[_0xae3d('0x31')]));if(_0x4dd2f4['query'][_0xae3d('0x36')]){_0xc9fcc9['where']=_[_0xae3d('0x34')](_0xc9fcc9[_0xae3d('0x33')],{'$or':_[_0xae3d('0x23')](_0xc9fcc9[_0xae3d('0x2c')],function(_0x21923a){var _0x52c24a={};_0x52c24a[_0x21923a]={'$like':'%'+_0x4dd2f4[_0xae3d('0x2a')][_0xae3d('0x36')]+'%'};return _0x52c24a;})});}_0xc9fcc9=_[_0xae3d('0x34')]({},_0xc9fcc9,_0x4dd2f4['options']);return _0x19aab4['getUsers'](_0xc9fcc9);}})[_0xae3d('0x16')](function(_0x3b6fee){if(_0x3b6fee){_0x2c221b=_0x3b6fee['length'];if(!_0x4dd2f4['query'][_0xae3d('0x2e')]('nolimit')){_0xc9fcc9[_0xae3d('0x12')]=qs['limit'](_0x4dd2f4['query']['limit']);_0xc9fcc9['offset']=qs[_0xae3d('0x10')](_0x4dd2f4[_0xae3d('0x2a')]['offset']);}return _0x19aab4['getUsers'](_0xc9fcc9);}})[_0xae3d('0x16')](function(_0x3be0e7){if(_0x3be0e7){return _0x3be0e7?{'count':_0x2c221b,'rows':_0x3be0e7}:null;}})[_0xae3d('0x16')](respondWithResult(_0xd1951,null))[_0xae3d('0x3b')](handleError(_0xd1951,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index ef6a56f..46d1121 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 _0x8b29=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xfc55e2,_0x45bf6b){var _0x2edfcd=function(_0x13eaeb){while(--_0x13eaeb){_0xfc55e2['push'](_0xfc55e2['shift']());}};_0x2edfcd(++_0x45bf6b);}(_0x8b29,0x143));var _0x98b2=function(_0x189a30,_0x49f412){_0x189a30=_0x189a30-0x0;var _0x1021d9=_0x8b29[_0x189a30];return _0x1021d9;};'use strict';var EventEmitter=require(_0x98b2('0x0'));var SquareProject=require(_0x98b2('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x98b2('0x2')](0x0);var events={'afterCreate':_0x98b2('0x3'),'afterUpdate':_0x98b2('0x4'),'afterDestroy':_0x98b2('0x5')};function emitEvent(_0x2e227a){return function(_0x3442c5,_0x4df6ff,_0x51514d){SquareProjectEvents[_0x98b2('0x6')](_0x2e227a+':'+_0x3442c5['id'],_0x3442c5);SquareProjectEvents[_0x98b2('0x6')](_0x2e227a,_0x3442c5);_0x51514d(null);};}for(var e in events){if(events[_0x98b2('0x7')](e)){var event=events[e];SquareProject[_0x98b2('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x55c2=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x55c2,0xeb));var _0x255c=function(_0x454017,_0x4c2948){_0x454017=_0x454017-0x0;var _0x22d946=_0x55c2[_0x454017];return _0x22d946;};'use strict';var EventEmitter=require(_0x255c('0x0'));var SquareProject=require(_0x255c('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x255c('0x2')](0x0);var events={'afterCreate':_0x255c('0x3'),'afterUpdate':_0x255c('0x4'),'afterDestroy':_0x255c('0x5')};function emitEvent(_0x308fdc){return function(_0x49adfa,_0x16b24e,_0x4904b0){SquareProjectEvents[_0x255c('0x6')](_0x308fdc+':'+_0x49adfa['id'],_0x49adfa);SquareProjectEvents[_0x255c('0x6')](_0x308fdc,_0x49adfa);_0x4904b0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x255c('0x7')](e,emitEvent(event));}}module[_0x255c('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e18ec8c..fb0812c 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 _0x59ed=['exports','define','square_projects','changed','preproduction','savedAt','format','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./squareProject.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x59ed,0x14c));var _0xd59e=function(_0x152e48,_0x25f775){_0x152e48=_0x152e48-0x0;var _0x30b1a4=_0x59ed[_0x152e48];return _0x30b1a4;};'use strict';var _=require(_0xd59e('0x0'));var util=require('util');var logger=require(_0xd59e('0x1'))(_0xd59e('0x2'));var moment=require(_0xd59e('0x3'));var BPromise=require(_0xd59e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd59e('0x5'));var rimraf=require(_0xd59e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd59e('0x7'));module[_0xd59e('0x8')]=function(_0x58fe0b,_0xe77c73){return _0x58fe0b[_0xd59e('0x9')]('SquareProject',attributes,{'tableName':_0xd59e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x160523,_0xdedd9f,_0x49bdf1){if(_0x160523[_0xd59e('0xb')](_0xd59e('0xc'))){_0x160523[_0xd59e('0xd')]=moment()[_0xd59e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x160523[_0xd59e('0xb')]('production')){_0x160523[_0xd59e('0xf')]=moment()['format'](_0xd59e('0x10'));}_0x49bdf1(null,_0x160523);}}});}; \ No newline at end of file +var _0xb4b9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','preproduction','savedAt','changed','production','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x28a685,_0x54e1a5){var _0x28d952=function(_0x25914c){while(--_0x25914c){_0x28a685['push'](_0x28a685['shift']());}};_0x28d952(++_0x54e1a5);}(_0xb4b9,0x178));var _0x9b4b=function(_0x4ff81f,_0x24f784){_0x4ff81f=_0x4ff81f-0x0;var _0x5473bd=_0xb4b9[_0x4ff81f];return _0x5473bd;};'use strict';var _=require(_0x9b4b('0x0'));var util=require(_0x9b4b('0x1'));var logger=require(_0x9b4b('0x2'))(_0x9b4b('0x3'));var moment=require(_0x9b4b('0x4'));var BPromise=require(_0x9b4b('0x5'));var rp=require(_0x9b4b('0x6'));var fs=require('fs');var path=require(_0x9b4b('0x7'));var rimraf=require(_0x9b4b('0x8'));var config=require(_0x9b4b('0x9'));var attributes=require(_0x9b4b('0xa'));module['exports']=function(_0x21a979,_0x4e0d7b){return _0x21a979[_0x9b4b('0xb')](_0x9b4b('0xc'),attributes,{'tableName':_0x9b4b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6d4301,_0x197833,_0x134eba){if(_0x6d4301['changed'](_0x9b4b('0xe'))){_0x6d4301[_0x9b4b('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x6d4301[_0x9b4b('0x10')](_0x9b4b('0x11'))){_0x6d4301['publishedAt']=moment()['format'](_0x9b4b('0x12'));}_0x134eba(null,_0x6d4301);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0763346..4803de6 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 _0x8219=['ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','where','limit','include','map','model','attributes','then','info','debug','stringify','message','ShowSquareProject','find','catch','error','lodash'];(function(_0x197640,_0x230330){var _0x44aec4=function(_0x5dc5c9){while(--_0x5dc5c9){_0x197640['push'](_0x197640['shift']());}};_0x44aec4(++_0x230330);}(_0x8219,0x90));var _0x9821=function(_0xae5e3c,_0x1a07bf){_0xae5e3c=_0xae5e3c-0x0;var _0x5c87b8=_0x8219[_0xae5e3c];return _0x5c87b8;};'use strict';var _=require(_0x9821('0x0'));var Redis=require(_0x9821('0x1'));var db=require(_0x9821('0x2'))['db'];var logger=require('../../config/logger')(_0x9821('0x3'));var config=require(_0x9821('0x4'));config[_0x9821('0x5')]=_[_0x9821('0x6')](config[_0x9821('0x5')],{'host':_0x9821('0x7'),'port':0x18eb});var socket=require(_0x9821('0x8'))(new Redis(config[_0x9821('0x5')]));require(_0x9821('0x9'))['register'](socket);exports[_0x9821('0xa')]=function(_0x43a364){var _0x1ce3a0=this;return new Promise(function(_0x57f776,_0x6d63f8){return db[_0x9821('0xb')][_0x9821('0xc')]({'raw':_0x43a364[_0x9821('0xd')]?_0x43a364[_0x9821('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x43a364[_0x9821('0xd')]?_0x43a364[_0x9821('0xd')][_0x9821('0xe')]||null:null,'attributes':_0x43a364[_0x9821('0xd')]?_0x43a364[_0x9821('0xd')]['attributes']||null:null,'limit':_0x43a364['options']?_0x43a364[_0x9821('0xd')][_0x9821('0xf')]||null:null,'include':_0x43a364['options']?_0x43a364['options'][_0x9821('0x10')]?_[_0x9821('0x11')](_0x43a364[_0x9821('0xd')][_0x9821('0x10')],function(_0x162fe6){return{'model':db[_0x162fe6[_0x9821('0x12')]],'as':_0x162fe6['as'],'attributes':_0x162fe6[_0x9821('0x13')],'include':_0x162fe6[_0x9821('0x10')]?_[_0x9821('0x11')](_0x162fe6[_0x9821('0x10')],function(_0x5772bc){return{'model':db[_0x5772bc[_0x9821('0x12')]],'as':_0x5772bc['as'],'attributes':_0x5772bc[_0x9821('0x13')],'include':_0x5772bc[_0x9821('0x10')]?_['map'](_0x5772bc[_0x9821('0x10')],function(_0xf47916){return{'model':db[_0xf47916[_0x9821('0x12')]],'as':_0xf47916['as'],'attributes':_0xf47916[_0x9821('0x13')]};}):[]};}):[]};}):[]:[]})[_0x9821('0x14')](function(_0x279536){logger[_0x9821('0x15')]('GetSquareProjects',_0x43a364);logger[_0x9821('0x16')](_0x9821('0xa'),_0x43a364,JSON[_0x9821('0x17')](_0x279536));_0x57f776(_0x279536);})['catch'](function(_0x411674){logger['error'](_0x9821('0xa'),_0x411674[_0x9821('0x18')],_0x43a364);_0x6d63f8(_0x1ce3a0['error'](0x1f4,_0x411674[_0x9821('0x18')]));});});};exports[_0x9821('0x19')]=function(_0x4af9c4){var _0x12881f=this;return new Promise(function(_0xbfd1ac,_0x4413d0){return db[_0x9821('0xb')][_0x9821('0x1a')]({'raw':_0x4af9c4['options']?_0x4af9c4['options']['raw']===undefined?!![]:![]:!![],'where':_0x4af9c4[_0x9821('0xd')]?_0x4af9c4[_0x9821('0xd')][_0x9821('0xe')]||null:null,'attributes':_0x4af9c4['options']?_0x4af9c4[_0x9821('0xd')][_0x9821('0x13')]||null:null,'include':_0x4af9c4[_0x9821('0xd')]?_0x4af9c4[_0x9821('0xd')]['include']?_[_0x9821('0x11')](_0x4af9c4['options']['include'],function(_0x2fcb3f){return{'model':db[_0x2fcb3f[_0x9821('0x12')]],'as':_0x2fcb3f['as'],'attributes':_0x2fcb3f['attributes'],'include':_0x2fcb3f[_0x9821('0x10')]?_[_0x9821('0x11')](_0x2fcb3f[_0x9821('0x10')],function(_0x5984c0){return{'model':db[_0x5984c0['model']],'as':_0x5984c0['as'],'attributes':_0x5984c0[_0x9821('0x13')],'include':_0x5984c0[_0x9821('0x10')]?_['map'](_0x5984c0['include'],function(_0x1b47e1){return{'model':db[_0x1b47e1[_0x9821('0x12')]],'as':_0x1b47e1['as'],'attributes':_0x1b47e1[_0x9821('0x13')]};}):[]};}):[]};}):[]:[]})[_0x9821('0x14')](function(_0x2b1f7c){logger[_0x9821('0x15')]('ShowSquareProject',_0x4af9c4);logger[_0x9821('0x16')](_0x9821('0x19'),_0x4af9c4,JSON['stringify'](_0x2b1f7c));_0xbfd1ac(_0x2b1f7c);})[_0x9821('0x1b')](function(_0xd0b316){logger[_0x9821('0x1c')](_0x9821('0x19'),_0xd0b316[_0x9821('0x18')],_0x4af9c4);_0x4413d0(_0x12881f[_0x9821('0x1c')](0x1f4,_0xd0b316['message']));});});}; \ No newline at end of file +var _0x0217=['ShowSquareProject','SquareProject','find','where','debug','lodash','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','findAll','options','raw','attributes','limit','include','map','model','then','info','stringify','catch','message','error'];(function(_0x2fc196,_0x5a0c9b){var _0x2ac5ed=function(_0xf481dd){while(--_0xf481dd){_0x2fc196['push'](_0x2fc196['shift']());}};_0x2ac5ed(++_0x5a0c9b);}(_0x0217,0xb9));var _0x7021=function(_0x4987f9,_0x524822){_0x4987f9=_0x4987f9-0x0;var _0x5a1f49=_0x0217[_0x4987f9];return _0x5a1f49;};'use strict';var _=require(_0x7021('0x0'));var Redis=require('ioredis');var db=require(_0x7021('0x1'))['db'];var logger=require(_0x7021('0x2'))(_0x7021('0x3'));var config=require('../../config/environment');config[_0x7021('0x4')]=_[_0x7021('0x5')](config[_0x7021('0x4')],{'host':_0x7021('0x6'),'port':0x18eb});var socket=require(_0x7021('0x7'))(new Redis(config[_0x7021('0x4')]));require(_0x7021('0x8'))[_0x7021('0x9')](socket);exports[_0x7021('0xa')]=function(_0x403127){var _0x51231b=this;return new Promise(function(_0x122ea6,_0x6614fc){return db['SquareProject'][_0x7021('0xb')]({'raw':_0x403127['options']?_0x403127[_0x7021('0xc')][_0x7021('0xd')]===undefined?!![]:![]:!![],'where':_0x403127['options']?_0x403127[_0x7021('0xc')]['where']||null:null,'attributes':_0x403127[_0x7021('0xc')]?_0x403127['options'][_0x7021('0xe')]||null:null,'limit':_0x403127[_0x7021('0xc')]?_0x403127[_0x7021('0xc')][_0x7021('0xf')]||null:null,'include':_0x403127[_0x7021('0xc')]?_0x403127[_0x7021('0xc')][_0x7021('0x10')]?_[_0x7021('0x11')](_0x403127[_0x7021('0xc')][_0x7021('0x10')],function(_0x46f295){return{'model':db[_0x46f295[_0x7021('0x12')]],'as':_0x46f295['as'],'attributes':_0x46f295[_0x7021('0xe')],'include':_0x46f295[_0x7021('0x10')]?_[_0x7021('0x11')](_0x46f295[_0x7021('0x10')],function(_0xdac6fc){return{'model':db[_0xdac6fc[_0x7021('0x12')]],'as':_0xdac6fc['as'],'attributes':_0xdac6fc[_0x7021('0xe')],'include':_0xdac6fc['include']?_[_0x7021('0x11')](_0xdac6fc['include'],function(_0x3628c9){return{'model':db[_0x3628c9['model']],'as':_0x3628c9['as'],'attributes':_0x3628c9[_0x7021('0xe')]};}):[]};}):[]};}):[]:[]})[_0x7021('0x13')](function(_0x11515c){logger[_0x7021('0x14')]('GetSquareProjects',_0x403127);logger['debug'](_0x7021('0xa'),_0x403127,JSON[_0x7021('0x15')](_0x11515c));_0x122ea6(_0x11515c);})[_0x7021('0x16')](function(_0x59cdd1){logger['error']('GetSquareProjects',_0x59cdd1[_0x7021('0x17')],_0x403127);_0x6614fc(_0x51231b[_0x7021('0x18')](0x1f4,_0x59cdd1[_0x7021('0x17')]));});});};exports[_0x7021('0x19')]=function(_0x429f01){var _0x4e5101=this;return new Promise(function(_0x170d57,_0x50e53b){return db[_0x7021('0x1a')][_0x7021('0x1b')]({'raw':_0x429f01[_0x7021('0xc')]?_0x429f01['options']['raw']===undefined?!![]:![]:!![],'where':_0x429f01['options']?_0x429f01['options'][_0x7021('0x1c')]||null:null,'attributes':_0x429f01[_0x7021('0xc')]?_0x429f01[_0x7021('0xc')]['attributes']||null:null,'include':_0x429f01['options']?_0x429f01[_0x7021('0xc')][_0x7021('0x10')]?_[_0x7021('0x11')](_0x429f01[_0x7021('0xc')][_0x7021('0x10')],function(_0x3792e3){return{'model':db[_0x3792e3['model']],'as':_0x3792e3['as'],'attributes':_0x3792e3[_0x7021('0xe')],'include':_0x3792e3['include']?_['map'](_0x3792e3[_0x7021('0x10')],function(_0x496fd9){return{'model':db[_0x496fd9[_0x7021('0x12')]],'as':_0x496fd9['as'],'attributes':_0x496fd9[_0x7021('0xe')],'include':_0x496fd9[_0x7021('0x10')]?_['map'](_0x496fd9[_0x7021('0x10')],function(_0x9b96f4){return{'model':db[_0x9b96f4[_0x7021('0x12')]],'as':_0x9b96f4['as'],'attributes':_0x9b96f4[_0x7021('0xe')]};}):[]};}):[]};}):[]:[]})[_0x7021('0x13')](function(_0x5d951e){logger['info']('ShowSquareProject',_0x429f01);logger[_0x7021('0x1d')]('ShowSquareProject',_0x429f01,JSON[_0x7021('0x15')](_0x5d951e));_0x170d57(_0x5d951e);})[_0x7021('0x16')](function(_0x2f37ad){logger['error'](_0x7021('0x19'),_0x2f37ad['message'],_0x429f01);_0x50e53b(_0x4e5101[_0x7021('0x18')](0x1f4,_0x2f37ad['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 83ccb64..4d95e1f 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 _0x16dc=['length','./squareProject.events','update','register'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0x16dc,0x181));var _0xc16d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16dc[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0xc16d('0x0'));var events=['save','remove',_0xc16d('0x1')];function createListener(_0x2380ba,_0x234c0c){return function(_0x590eb3){_0x234c0c['emit'](_0x2380ba,_0x590eb3);};}function removeListener(_0x1decac,_0x44b5d5){return function(){SquareProjectEvents['removeListener'](_0x1decac,_0x44b5d5);};}exports[_0xc16d('0x2')]=function(_0x5d6959){for(var _0x3f8fa4=0x0,_0x1205a8=events[_0xc16d('0x3')];_0x3f8fa4<_0x1205a8;_0x3f8fa4++){var _0x3b3b3c=events[_0x3f8fa4];var _0x8bd245=createListener('squareProject:'+_0x3b3b3c,_0x5d6959);SquareProjectEvents['on'](_0x3b3b3c,_0x8bd245);}}; \ No newline at end of file +var _0xd7b1=['emit','removeListener','./squareProject.events','remove','update'];(function(_0x5b657e,_0x2bfdba){var _0x4d2e51=function(_0x4634b0){while(--_0x4634b0){_0x5b657e['push'](_0x5b657e['shift']());}};_0x4d2e51(++_0x2bfdba);}(_0xd7b1,0x101));var _0x1d7b=function(_0x5a8fe5,_0x22b676){_0x5a8fe5=_0x5a8fe5-0x0;var _0x1b9baf=_0xd7b1[_0x5a8fe5];return _0x1b9baf;};'use strict';var SquareProjectEvents=require(_0x1d7b('0x0'));var events=['save',_0x1d7b('0x1'),_0x1d7b('0x2')];function createListener(_0x5e1a26,_0x1c5892){return function(_0x4ac08b){_0x1c5892[_0x1d7b('0x3')](_0x5e1a26,_0x4ac08b);};}function removeListener(_0x56801e,_0x504fb7){return function(){SquareProjectEvents[_0x1d7b('0x4')](_0x56801e,_0x504fb7);};}exports['register']=function(_0x35e395){for(var _0x2d348a=0x0,_0x494bcc=events['length'];_0x2d348a<_0x494bcc;_0x2d348a++){var _0x457b59=events[_0x2d348a];var _0x4977c9=createListener('squareProject:'+_0x457b59,_0x35e395);SquareProjectEvents['on'](_0x457b59,_0x4977c9);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 9f52cf8..4748ce9 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 _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x5cc136,_0x4bd1de){var _0x5c4703=function(_0xb4ea84){while(--_0xb4ea84){_0x5cc136['push'](_0x5cc136['shift']());}};_0x5c4703(++_0x4bd1de);}(_0x1261,0x144));var _0x1126=function(_0x5f5c34,_0x23e89){_0x5f5c34=_0x5f5c34-0x0;var _0x48c0a7=_0x1261[_0x5f5c34];return _0x48c0a7;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x3d7cc7,_0x4c2e12){var _0x2b1bf1=function(_0x2ae8f5){while(--_0x2ae8f5){_0x3d7cc7['push'](_0x3d7cc7['shift']());}};_0x2b1bf1(++_0x4c2e12);}(_0xe14b,0x93));var _0xbe14=function(_0x448431,_0x5256d6){_0x448431=_0x448431-0x0;var _0x37f204=_0xe14b[_0x448431];return _0x37f204;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index e39e637..194d562 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 _0xbd51=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','STRING'];(function(_0x2a9ab8,_0x295cfc){var _0x412de0=function(_0x28c015){while(--_0x28c015){_0x2a9ab8['push'](_0x2a9ab8['shift']());}};_0x412de0(++_0x295cfc);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x135c9c,_0x412a94){_0x135c9c=_0x135c9c-0x0;var _0x38a8a8=_0xbd51[_0x135c9c];return _0x38a8a8;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1bd5('0x1')]},'callerid':{'type':Sequelize[_0x1bd5('0x1')]},'calleridname':{'type':Sequelize[_0x1bd5('0x1')]},'context':{'type':Sequelize[_0x1bd5('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x1bd5('0x1')]},'saveName':{'type':Sequelize[_0x1bd5('0x1')]},'filename':{'type':Sequelize[_0x1bd5('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1bd5('0x2')],'get':function(){var _0x30a385='';var _0x19077c=this[_0x1bd5('0x3')](_0x1bd5('0x4'));if(_0x19077c){_0x30a385=_0x19077c['substring'](_0x19077c[_0x1bd5('0x5')]('.'));}return _0x30a385;}}}; \ No newline at end of file +var _0xee14=['VIRTUAL','getDataValue','savePath','substring','STRING'];(function(_0x3d1cdc,_0x4c395e){var _0x317490=function(_0x44b0f2){while(--_0x44b0f2){_0x3d1cdc['push'](_0x3d1cdc['shift']());}};_0x317490(++_0x4c395e);}(_0xee14,0x13a));var _0x4ee1=function(_0x1f5349,_0x43c34d){_0x1f5349=_0x1f5349-0x0;var _0x29165d=_0xee14[_0x1f5349];return _0x29165d;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'callerid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'extension':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'dnid':{'type':Sequelize[_0x4ee1('0x0')]},'projectName':{'type':Sequelize[_0x4ee1('0x0')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4ee1('0x0')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4ee1('0x1')],'get':function(){var _0x3a45a3='';var _0x187656=this[_0x4ee1('0x2')](_0x4ee1('0x3'));if(_0x187656){_0x3a45a3=_0x187656[_0x4ee1('0x4')](_0x187656['lastIndexOf']('.'));}return _0x3a45a3;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index fa91c2b..44bbd74 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 _0x5e64=['set','apply','reject','update','then','destroy','end','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','show','fields','include','find','catch','create','body','download','../../components/encryptor','uniqueid','params','savePath','filename','format','existsSync','secrets','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit'];(function(_0x4f1c14,_0x37b0c9){var _0xc40a33=function(_0x2c6317){while(--_0x2c6317){_0x4f1c14['push'](_0x4f1c14['shift']());}};_0xc40a33(++_0x37b0c9);}(_0x5e64,0x15d));var _0x45e6=function(_0x37e848,_0x418405){_0x37e848=_0x37e848-0x0;var _0x512fe7=_0x5e64[_0x37e848];return _0x512fe7;};'use strict';var emlformat=require(_0x45e6('0x0'));var rimraf=require(_0x45e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x45e6('0x2'));var moment=require(_0x45e6('0x3'));var BPromise=require(_0x45e6('0x4'));var Mustache=require(_0x45e6('0x5'));var util=require('util');var path=require(_0x45e6('0x6'));var sox=require(_0x45e6('0x7'));var csv=require('to-csv');var ejs=require(_0x45e6('0x8'));var fs=require('fs');var fs_extra=require(_0x45e6('0x9'));var _=require('lodash');var squel=require(_0x45e6('0xa'));var crypto=require(_0x45e6('0xb'));var jsforce=require(_0x45e6('0xc'));var deskjs=require(_0x45e6('0xd'));var toCsv=require(_0x45e6('0xe'));var querystring=require(_0x45e6('0xf'));var Papa=require(_0x45e6('0x10'));var Redis=require('ioredis');var authService=require(_0x45e6('0x11'));var qs=require(_0x45e6('0x12'));var as=require(_0x45e6('0x13'));var hardwareService=require(_0x45e6('0x14'));var logger=require(_0x45e6('0x15'))('api');var utils=require(_0x45e6('0x16'));var config=require(_0x45e6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x45e6('0x18'))['db'];function respondWithStatusCode(_0x1764eb,_0x2a563f){_0x2a563f=_0x2a563f||0xcc;return function(_0x107625){if(_0x107625){return _0x1764eb['sendStatus'](_0x2a563f);}return _0x1764eb[_0x45e6('0x19')](_0x2a563f)['end']();};}function respondWithResult(_0x3ab4b5,_0x3e5de7){_0x3e5de7=_0x3e5de7||0xc8;return function(_0x474d58){if(_0x474d58){return _0x3ab4b5[_0x45e6('0x19')](_0x3e5de7)[_0x45e6('0x1a')](_0x474d58);}};}function respondWithFilteredResult(_0x135b38,_0x3bea5d){return function(_0x3ab2fc){if(_0x3ab2fc){var _0x57572d=typeof _0x3bea5d[_0x45e6('0x1b')]===_0x45e6('0x1c')&&typeof _0x3bea5d['limit']===_0x45e6('0x1c');var _0x18b800=_0x3ab2fc[_0x45e6('0x1d')];var _0x1074fb=_0x57572d?0x0:_0x3bea5d[_0x45e6('0x1b')];var _0xd9a2e9=_0x57572d?_0x3ab2fc[_0x45e6('0x1d')]:_0x3bea5d[_0x45e6('0x1b')]+_0x3bea5d[_0x45e6('0x1e')];var _0x7b90ef;if(_0xd9a2e9>=_0x18b800){_0xd9a2e9=_0x18b800;_0x7b90ef=0xc8;}else{_0x7b90ef=0xce;}_0x135b38['status'](_0x7b90ef);return _0x135b38[_0x45e6('0x1f')]('Content-Range',_0x1074fb+'-'+_0xd9a2e9+'/'+_0x18b800)[_0x45e6('0x1a')](_0x3ab2fc);}return null;};}function patchUpdates(_0x10e685){return function(_0x20f5c9){try{jsonpatch[_0x45e6('0x20')](_0x20f5c9,_0x10e685,!![]);}catch(_0x2c79fa){return BPromise[_0x45e6('0x21')](_0x2c79fa);}return _0x20f5c9['save']();};}function saveUpdates(_0x4bfb5e,_0x113daf){return function(_0x327f82){if(_0x327f82){return _0x327f82[_0x45e6('0x22')](_0x4bfb5e)[_0x45e6('0x23')](function(_0x817f48){return _0x817f48;});}return null;};}function removeEntity(_0x253187,_0x4fc215){return function(_0x2cba6c){if(_0x2cba6c){return _0x2cba6c[_0x45e6('0x24')]()['then'](function(){_0x253187['status'](0xcc)[_0x45e6('0x25')]();});}};}function handleEntityNotFound(_0xb7793,_0x311034){return function(_0x4bbefe){if(!_0x4bbefe){_0xb7793['sendStatus'](0x194);}return _0x4bbefe;};}function handleError(_0x29053a,_0xdaf6ea){_0xdaf6ea=_0xdaf6ea||0x1f4;return function(_0x4d62ae){logger[_0x45e6('0x26')](_0x4d62ae[_0x45e6('0x27')]);if(_0x4d62ae[_0x45e6('0x28')]){delete _0x4d62ae['name'];}_0x29053a[_0x45e6('0x19')](_0xdaf6ea)[_0x45e6('0x29')](_0x4d62ae);};}exports[_0x45e6('0x2a')]=function(_0x3484f0,_0x10f707){var _0x414f1f={},_0x2e96c6={},_0xc5ba3={'count':0x0,'rows':[]};var _0x55650b=_['map'](db[_0x45e6('0x2b')][_0x45e6('0x2c')],function(_0x1aec06){return{'name':_0x1aec06[_0x45e6('0x2d')],'type':_0x1aec06['type']['key']};});_0x2e96c6[_0x45e6('0x2e')]=_[_0x45e6('0x2f')](_0x55650b,_0x45e6('0x28'));_0x2e96c6['query']=_[_0x45e6('0x30')](_0x3484f0[_0x45e6('0x31')]);_0x2e96c6[_0x45e6('0x32')]=_[_0x45e6('0x33')](_0x2e96c6[_0x45e6('0x2e')],_0x2e96c6[_0x45e6('0x31')]);_0x414f1f['attributes']=_['intersection'](_0x2e96c6[_0x45e6('0x2e')],qs['fields'](_0x3484f0[_0x45e6('0x31')]['fields']));_0x414f1f[_0x45e6('0x34')]=_0x414f1f['attributes'][_0x45e6('0x35')]?_0x414f1f['attributes']:_0x2e96c6[_0x45e6('0x2e')];if(!_0x3484f0[_0x45e6('0x31')][_0x45e6('0x36')](_0x45e6('0x37'))){_0x414f1f[_0x45e6('0x1e')]=qs[_0x45e6('0x1e')](_0x3484f0[_0x45e6('0x31')][_0x45e6('0x1e')]);_0x414f1f[_0x45e6('0x1b')]=qs[_0x45e6('0x1b')](_0x3484f0[_0x45e6('0x31')][_0x45e6('0x1b')]);}_0x414f1f[_0x45e6('0x38')]=qs[_0x45e6('0x39')](_0x3484f0[_0x45e6('0x31')][_0x45e6('0x39')]);_0x414f1f[_0x45e6('0x3a')]=qs[_0x45e6('0x32')](_[_0x45e6('0x3b')](_0x3484f0[_0x45e6('0x31')],_0x2e96c6[_0x45e6('0x32')]),_0x55650b);if(_0x3484f0[_0x45e6('0x31')]['filter']){_0x414f1f[_0x45e6('0x3a')]=_[_0x45e6('0x3c')](_0x414f1f['where'],{'$or':_[_0x45e6('0x2f')](_0x55650b,function(_0x4f6990){if(_0x4f6990[_0x45e6('0x3d')]!==_0x45e6('0x3e')){var _0x251d25={};_0x251d25[_0x4f6990[_0x45e6('0x28')]]={'$like':'%'+_0x3484f0['query'][_0x45e6('0x3f')]+'%'};return _0x251d25;}})});}_0x414f1f=_[_0x45e6('0x3c')]({},_0x414f1f,_0x3484f0['options']);var _0x53388e={'where':_0x414f1f[_0x45e6('0x3a')]};return db[_0x45e6('0x2b')][_0x45e6('0x1d')](_0x53388e)[_0x45e6('0x23')](function(_0x4f1f47){_0xc5ba3[_0x45e6('0x1d')]=_0x4f1f47;if(_0x3484f0['query'][_0x45e6('0x40')]){_0x414f1f['include']=[{'all':!![]}];}return db[_0x45e6('0x2b')][_0x45e6('0x41')](_0x414f1f);})[_0x45e6('0x23')](function(_0x50c29b){_0xc5ba3[_0x45e6('0x42')]=_0x50c29b;return _0xc5ba3;})[_0x45e6('0x23')](respondWithFilteredResult(_0x10f707,_0x414f1f))['catch'](handleError(_0x10f707,null));};exports[_0x45e6('0x43')]=function(_0x4d10e6,_0x101f86){var _0x2c56e3={'raw':!![],'where':{'id':_0x4d10e6['params']['id']}},_0x409ad6={};_0x409ad6[_0x45e6('0x2e')]=_[_0x45e6('0x30')](db[_0x45e6('0x2b')][_0x45e6('0x2c')]);_0x409ad6[_0x45e6('0x31')]=_[_0x45e6('0x30')](_0x4d10e6[_0x45e6('0x31')]);_0x409ad6[_0x45e6('0x32')]=_[_0x45e6('0x33')](_0x409ad6[_0x45e6('0x2e')],_0x409ad6['query']);_0x2c56e3[_0x45e6('0x34')]=_[_0x45e6('0x33')](_0x409ad6[_0x45e6('0x2e')],qs[_0x45e6('0x44')](_0x4d10e6[_0x45e6('0x31')]['fields']));_0x2c56e3[_0x45e6('0x34')]=_0x2c56e3[_0x45e6('0x34')][_0x45e6('0x35')]?_0x2c56e3[_0x45e6('0x34')]:_0x409ad6['model'];if(_0x4d10e6[_0x45e6('0x31')][_0x45e6('0x40')]){_0x2c56e3[_0x45e6('0x45')]=[{'all':!![]}];}_0x2c56e3=_[_0x45e6('0x3c')]({},_0x2c56e3,_0x4d10e6['options']);return db['SquareRecording'][_0x45e6('0x46')](_0x2c56e3)['then'](handleEntityNotFound(_0x101f86,null))[_0x45e6('0x23')](respondWithResult(_0x101f86,null))[_0x45e6('0x47')](handleError(_0x101f86,null));};exports[_0x45e6('0x48')]=function(_0x1d489f,_0x475438){return db['SquareRecording']['create'](_0x1d489f['body'],{})['then'](respondWithResult(_0x475438,0xc9))[_0x45e6('0x47')](handleError(_0x475438,null));};exports[_0x45e6('0x22')]=function(_0x1a70f8,_0x5da3e2){if(_0x1a70f8['body']['id']){delete _0x1a70f8[_0x45e6('0x49')]['id'];}return db[_0x45e6('0x2b')][_0x45e6('0x46')]({'where':{'id':_0x1a70f8['params']['id']}})[_0x45e6('0x23')](handleEntityNotFound(_0x5da3e2,null))[_0x45e6('0x23')](saveUpdates(_0x1a70f8['body'],null))[_0x45e6('0x23')](respondWithResult(_0x5da3e2,null))[_0x45e6('0x47')](handleError(_0x5da3e2,null));};exports[_0x45e6('0x4a')]=function(_0xd14406,_0x4b5237,_0x509835){var _0x54999c=require(_0x45e6('0x4b'));var _0x2f0730=![];var _0x42b9f6={};if(_0xd14406[_0x45e6('0x31')][_0x45e6('0x3d')]&&_0xd14406[_0x45e6('0x31')][_0x45e6('0x3d')]===_0x45e6('0x4c')){_0x42b9f6[_0x45e6('0x4c')]=_0xd14406['params']['id'];}else{_0x42b9f6['id']=_0xd14406[_0x45e6('0x4d')]['id'];}return db[_0x45e6('0x2b')][_0x45e6('0x46')]({'where':_0x42b9f6,'attributes':['id',_0x45e6('0x4e'),_0x45e6('0x4f')],'raw':!![]})[_0x45e6('0x23')](handleEntityNotFound(_0x4b5237,null))[_0x45e6('0x23')](function(_0x2afa6e){if(_0x2afa6e){var _0x23dd7f=_0x2afa6e[_0x45e6('0x4e')];var _0x149a21=util[_0x45e6('0x50')]('%s.cypher',_0x23dd7f);if(fs[_0x45e6('0x51')](_0x149a21)){_0x2f0730=!![];return _0x54999c['decryptFile'](_0x149a21,_0x23dd7f,config[_0x45e6('0x52')]['recording'])['then'](function(){return _0x2afa6e;});}return _0x2afa6e;}})[_0x45e6('0x23')](function(_0x3c8c5a){if(_0x3c8c5a){var _0x10eb19=_0x3c8c5a['savePath'];if(!fs[_0x45e6('0x51')](_0x10eb19)){throw new db['Sequelize'][(_0x45e6('0x53'))]('SquareRecording\x20not\x20found');}if(_0x3c8c5a[_0x45e6('0x4f')]){return _0x4b5237[_0x45e6('0x4a')](_0x10eb19,_0x3c8c5a['filename']+path[_0x45e6('0x54')](_0x10eb19),function(){if(_0x2f0730){fs[_0x45e6('0x55')](_0x10eb19);}});}else{return _0x4b5237[_0x45e6('0x4a')](_0x10eb19,function(_0x5358c1){if(_0x2f0730){fs[_0x45e6('0x55')](_0x10eb19);}});}}})[_0x45e6('0x47')](function(_0xe76e5d){if(_0xe76e5d[_0x45e6('0x56')]===_0x45e6('0x57')){_0x4b5237['status'](0x194)[_0x45e6('0x29')](_0x45e6('0x58'));}else{return handleError(_0x4b5237,null);}});};exports[_0x45e6('0x24')]=function(_0x37552d,_0xbeeb04){return db[_0x45e6('0x2b')][_0x45e6('0x46')]({'where':{'id':_0x37552d[_0x45e6('0x4d')]['id']}})[_0x45e6('0x23')](function(_0x1a7336){if(_['isNil'](_0x1a7336)){throw new ReferenceError(_0x45e6('0x59'));}return _0x1a7336;})[_0x45e6('0x23')](function(_0xc2bdb4){var _0x744f4c=_0xc2bdb4[_0x45e6('0x4e')];logger[_0x45e6('0x5a')](_0x45e6('0x5b'),_0x744f4c);if(!_[_0x45e6('0x5c')](_0xc2bdb4[_0x45e6('0x4e')])&&fs[_0x45e6('0x51')](_0x744f4c)){logger[_0x45e6('0x5a')]('File:\x20\x22'+_0x744f4c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x45e6('0x5d')](_0x744f4c);}_0x744f4c=_0x744f4c+'.cypher';if(!_['isNil'](_0xc2bdb4['savePath'])&&fs[_0x45e6('0x51')](_0x744f4c)){logger[_0x45e6('0x5a')]('File:\x20\x22'+_0x744f4c+_0x45e6('0x5e'));fs[_0x45e6('0x5d')](_0x744f4c);}return _0xc2bdb4;})['then'](function(_0x19bc4d){if(!_0x19bc4d)throw new InternalError();return _0x19bc4d[_0x45e6('0x24')]();})[_0x45e6('0x23')](function(){_0xbeeb04[_0x45e6('0x19')](0xcc)[_0x45e6('0x25')]();})[_0x45e6('0x47')](handleError(_0xbeeb04,null));}; \ No newline at end of file +var _0x9f06=['index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','filter','where','merge','options','SquareRecording','then','include','findAll','catch','includeAll','find','create','body','download','uniqueid','params','savePath','filename','%s.cypher','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','error','stack','name','send'];(function(_0x2f9eac,_0x4a7560){var _0x58da00=function(_0xc03490){while(--_0xc03490){_0x2f9eac['push'](_0x2f9eac['shift']());}};_0x58da00(++_0x4a7560);}(_0x9f06,0x92));var _0x69f0=function(_0x444b13,_0x41bb97){_0x444b13=_0x444b13-0x0;var _0x2cf2bb=_0x9f06[_0x444b13];return _0x2cf2bb;};'use strict';var emlformat=require(_0x69f0('0x0'));var rimraf=require(_0x69f0('0x1'));var zipdir=require(_0x69f0('0x2'));var jsonpatch=require(_0x69f0('0x3'));var rp=require(_0x69f0('0x4'));var moment=require(_0x69f0('0x5'));var BPromise=require(_0x69f0('0x6'));var Mustache=require('mustache');var util=require(_0x69f0('0x7'));var path=require(_0x69f0('0x8'));var sox=require(_0x69f0('0x9'));var csv=require(_0x69f0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69f0('0xb'));var _=require(_0x69f0('0xc'));var squel=require(_0x69f0('0xd'));var crypto=require(_0x69f0('0xe'));var jsforce=require(_0x69f0('0xf'));var deskjs=require(_0x69f0('0x10'));var toCsv=require(_0x69f0('0xa'));var querystring=require(_0x69f0('0x11'));var Papa=require(_0x69f0('0x12'));var Redis=require(_0x69f0('0x13'));var authService=require(_0x69f0('0x14'));var qs=require(_0x69f0('0x15'));var as=require(_0x69f0('0x16'));var hardwareService=require(_0x69f0('0x17'));var logger=require(_0x69f0('0x18'))(_0x69f0('0x19'));var utils=require('../../config/utils');var config=require(_0x69f0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x69f0('0x1b'))['db'];function respondWithStatusCode(_0xa21525,_0x5d9855){_0x5d9855=_0x5d9855||0xcc;return function(_0x56cc63){if(_0x56cc63){return _0xa21525[_0x69f0('0x1c')](_0x5d9855);}return _0xa21525[_0x69f0('0x1d')](_0x5d9855)[_0x69f0('0x1e')]();};}function respondWithResult(_0x112eb4,_0x196a1c){_0x196a1c=_0x196a1c||0xc8;return function(_0x10c2cd){if(_0x10c2cd){return _0x112eb4['status'](_0x196a1c)['json'](_0x10c2cd);}};}function respondWithFilteredResult(_0x1d4d5c,_0x130321){return function(_0x47dbdb){if(_0x47dbdb){var _0x3ce27d=typeof _0x130321[_0x69f0('0x1f')]===_0x69f0('0x20')&&typeof _0x130321['limit']===_0x69f0('0x20');var _0x5a9f52=_0x47dbdb[_0x69f0('0x21')];var _0x5979bb=_0x3ce27d?0x0:_0x130321['offset'];var _0x55ab72=_0x3ce27d?_0x47dbdb[_0x69f0('0x21')]:_0x130321[_0x69f0('0x1f')]+_0x130321['limit'];var _0x35a27e;if(_0x55ab72>=_0x5a9f52){_0x55ab72=_0x5a9f52;_0x35a27e=0xc8;}else{_0x35a27e=0xce;}_0x1d4d5c[_0x69f0('0x1d')](_0x35a27e);return _0x1d4d5c[_0x69f0('0x22')](_0x69f0('0x23'),_0x5979bb+'-'+_0x55ab72+'/'+_0x5a9f52)[_0x69f0('0x24')](_0x47dbdb);}return null;};}function patchUpdates(_0x502242){return function(_0x4cd95f){try{jsonpatch['apply'](_0x4cd95f,_0x502242,!![]);}catch(_0x4f0d22){return BPromise[_0x69f0('0x25')](_0x4f0d22);}return _0x4cd95f[_0x69f0('0x26')]();};}function saveUpdates(_0x43f943,_0x4f2158){return function(_0x303ebd){if(_0x303ebd){return _0x303ebd[_0x69f0('0x27')](_0x43f943)['then'](function(_0x3a0645){return _0x3a0645;});}return null;};}function removeEntity(_0x3350a2,_0x42eec7){return function(_0x21a623){if(_0x21a623){return _0x21a623['destroy']()['then'](function(){_0x3350a2[_0x69f0('0x1d')](0xcc)[_0x69f0('0x1e')]();});}};}function handleEntityNotFound(_0x45cc45,_0x5efbcb){return function(_0x154a04){if(!_0x154a04){_0x45cc45[_0x69f0('0x1c')](0x194);}return _0x154a04;};}function handleError(_0x3e2051,_0x5b47f6){_0x5b47f6=_0x5b47f6||0x1f4;return function(_0x381534){logger[_0x69f0('0x28')](_0x381534[_0x69f0('0x29')]);if(_0x381534[_0x69f0('0x2a')]){delete _0x381534[_0x69f0('0x2a')];}_0x3e2051[_0x69f0('0x1d')](_0x5b47f6)[_0x69f0('0x2b')](_0x381534);};}exports[_0x69f0('0x2c')]=function(_0x2b12f7,_0x19ee96){var _0x467ab5={},_0x3b5fdc={},_0x2b1a4d={'count':0x0,'rows':[]};var _0x2d70d9=_[_0x69f0('0x2d')](db['SquareRecording'][_0x69f0('0x2e')],function(_0x4a10b6){return{'name':_0x4a10b6[_0x69f0('0x2f')],'type':_0x4a10b6[_0x69f0('0x30')][_0x69f0('0x31')]};});_0x3b5fdc['model']=_[_0x69f0('0x2d')](_0x2d70d9,_0x69f0('0x2a'));_0x3b5fdc['query']=_[_0x69f0('0x32')](_0x2b12f7[_0x69f0('0x33')]);_0x3b5fdc[_0x69f0('0x34')]=_[_0x69f0('0x35')](_0x3b5fdc[_0x69f0('0x36')],_0x3b5fdc[_0x69f0('0x33')]);_0x467ab5['attributes']=_[_0x69f0('0x35')](_0x3b5fdc['model'],qs['fields'](_0x2b12f7[_0x69f0('0x33')][_0x69f0('0x37')]));_0x467ab5[_0x69f0('0x38')]=_0x467ab5[_0x69f0('0x38')][_0x69f0('0x39')]?_0x467ab5['attributes']:_0x3b5fdc[_0x69f0('0x36')];if(!_0x2b12f7[_0x69f0('0x33')]['hasOwnProperty'](_0x69f0('0x3a'))){_0x467ab5['limit']=qs['limit'](_0x2b12f7[_0x69f0('0x33')][_0x69f0('0x3b')]);_0x467ab5[_0x69f0('0x1f')]=qs[_0x69f0('0x1f')](_0x2b12f7[_0x69f0('0x33')][_0x69f0('0x1f')]);}_0x467ab5[_0x69f0('0x3c')]=qs[_0x69f0('0x3d')](_0x2b12f7[_0x69f0('0x33')][_0x69f0('0x3d')]);_0x467ab5['where']=qs[_0x69f0('0x34')](_['pick'](_0x2b12f7['query'],_0x3b5fdc[_0x69f0('0x34')]),_0x2d70d9);if(_0x2b12f7[_0x69f0('0x33')][_0x69f0('0x3e')]){_0x467ab5[_0x69f0('0x3f')]=_[_0x69f0('0x40')](_0x467ab5[_0x69f0('0x3f')],{'$or':_[_0x69f0('0x2d')](_0x2d70d9,function(_0x380d25){if(_0x380d25[_0x69f0('0x30')]!=='VIRTUAL'){var _0x4a7bad={};_0x4a7bad[_0x380d25[_0x69f0('0x2a')]]={'$like':'%'+_0x2b12f7[_0x69f0('0x33')][_0x69f0('0x3e')]+'%'};return _0x4a7bad;}})});}_0x467ab5=_[_0x69f0('0x40')]({},_0x467ab5,_0x2b12f7[_0x69f0('0x41')]);var _0x4eeb8c={'where':_0x467ab5[_0x69f0('0x3f')]};return db[_0x69f0('0x42')][_0x69f0('0x21')](_0x4eeb8c)[_0x69f0('0x43')](function(_0x32b146){_0x2b1a4d['count']=_0x32b146;if(_0x2b12f7[_0x69f0('0x33')]['includeAll']){_0x467ab5[_0x69f0('0x44')]=[{'all':!![]}];}return db[_0x69f0('0x42')][_0x69f0('0x45')](_0x467ab5);})['then'](function(_0x581dfa){_0x2b1a4d['rows']=_0x581dfa;return _0x2b1a4d;})[_0x69f0('0x43')](respondWithFilteredResult(_0x19ee96,_0x467ab5))[_0x69f0('0x46')](handleError(_0x19ee96,null));};exports['show']=function(_0x3127a5,_0x115727){var _0x158274={'raw':!![],'where':{'id':_0x3127a5['params']['id']}},_0x8c5f4={};_0x8c5f4[_0x69f0('0x36')]=_[_0x69f0('0x32')](db[_0x69f0('0x42')]['rawAttributes']);_0x8c5f4[_0x69f0('0x33')]=_[_0x69f0('0x32')](_0x3127a5['query']);_0x8c5f4[_0x69f0('0x34')]=_[_0x69f0('0x35')](_0x8c5f4['model'],_0x8c5f4[_0x69f0('0x33')]);_0x158274['attributes']=_[_0x69f0('0x35')](_0x8c5f4[_0x69f0('0x36')],qs['fields'](_0x3127a5['query'][_0x69f0('0x37')]));_0x158274[_0x69f0('0x38')]=_0x158274[_0x69f0('0x38')][_0x69f0('0x39')]?_0x158274['attributes']:_0x8c5f4[_0x69f0('0x36')];if(_0x3127a5[_0x69f0('0x33')][_0x69f0('0x47')]){_0x158274[_0x69f0('0x44')]=[{'all':!![]}];}_0x158274=_[_0x69f0('0x40')]({},_0x158274,_0x3127a5['options']);return db[_0x69f0('0x42')][_0x69f0('0x48')](_0x158274)['then'](handleEntityNotFound(_0x115727,null))[_0x69f0('0x43')](respondWithResult(_0x115727,null))['catch'](handleError(_0x115727,null));};exports[_0x69f0('0x49')]=function(_0x36a792,_0x5b1ae8){return db[_0x69f0('0x42')][_0x69f0('0x49')](_0x36a792[_0x69f0('0x4a')],{})[_0x69f0('0x43')](respondWithResult(_0x5b1ae8,0xc9))[_0x69f0('0x46')](handleError(_0x5b1ae8,null));};exports['update']=function(_0xd3e80,_0x1e392c){if(_0xd3e80[_0x69f0('0x4a')]['id']){delete _0xd3e80[_0x69f0('0x4a')]['id'];}return db[_0x69f0('0x42')][_0x69f0('0x48')]({'where':{'id':_0xd3e80['params']['id']}})[_0x69f0('0x43')](handleEntityNotFound(_0x1e392c,null))[_0x69f0('0x43')](saveUpdates(_0xd3e80[_0x69f0('0x4a')],null))[_0x69f0('0x43')](respondWithResult(_0x1e392c,null))[_0x69f0('0x46')](handleError(_0x1e392c,null));};exports[_0x69f0('0x4b')]=function(_0x5b50d4,_0xd8c890,_0xae00ba){var _0xddd43b=require('../../components/encryptor');var _0x1a30b9=![];var _0x39249a={};if(_0x5b50d4[_0x69f0('0x33')][_0x69f0('0x30')]&&_0x5b50d4[_0x69f0('0x33')]['type']===_0x69f0('0x4c')){_0x39249a['uniqueid']=_0x5b50d4['params']['id'];}else{_0x39249a['id']=_0x5b50d4[_0x69f0('0x4d')]['id'];}return db['SquareRecording'][_0x69f0('0x48')]({'where':_0x39249a,'attributes':['id',_0x69f0('0x4e'),_0x69f0('0x4f')],'raw':!![]})[_0x69f0('0x43')](handleEntityNotFound(_0xd8c890,null))[_0x69f0('0x43')](function(_0x13942d){if(_0x13942d){var _0x56ce7b=_0x13942d[_0x69f0('0x4e')];var _0x3a2d64=util['format'](_0x69f0('0x50'),_0x56ce7b);if(fs['existsSync'](_0x3a2d64)){_0x1a30b9=!![];return _0xddd43b[_0x69f0('0x51')](_0x3a2d64,_0x56ce7b,config['secrets'][_0x69f0('0x52')])[_0x69f0('0x43')](function(){return _0x13942d;});}return _0x13942d;}})[_0x69f0('0x43')](function(_0x53460c){if(_0x53460c){var _0x1fb3ca=_0x53460c['savePath'];if(!fs['existsSync'](_0x1fb3ca)){throw new db[(_0x69f0('0x53'))][(_0x69f0('0x54'))](_0x69f0('0x55'));}if(_0x53460c['filename']){return _0xd8c890[_0x69f0('0x4b')](_0x1fb3ca,_0x53460c[_0x69f0('0x4f')]+path[_0x69f0('0x56')](_0x1fb3ca),function(){if(_0x1a30b9){fs['unlink'](_0x1fb3ca);}});}else{return _0xd8c890['download'](_0x1fb3ca,function(_0x4c2e4e){if(_0x1a30b9){fs['unlink'](_0x1fb3ca);}});}}})[_0x69f0('0x46')](function(_0x109b93){if(_0x109b93['message']===_0x69f0('0x55')){_0xd8c890[_0x69f0('0x1d')](0x194)[_0x69f0('0x2b')](_0x69f0('0x57'));}else{return handleError(_0xd8c890,null);}});};exports['destroy']=function(_0x18c908,_0x33adbc){return db[_0x69f0('0x42')][_0x69f0('0x48')]({'where':{'id':_0x18c908['params']['id']}})['then'](function(_0x44164f){if(_[_0x69f0('0x58')](_0x44164f)){throw new ReferenceError(_0x69f0('0x59'));}return _0x44164f;})['then'](function(_0xf20933){var _0x32075f=_0xf20933[_0x69f0('0x4e')];logger[_0x69f0('0x5a')](_0x69f0('0x5b'),_0x32075f);if(!_[_0x69f0('0x58')](_0xf20933[_0x69f0('0x4e')])&&fs[_0x69f0('0x5c')](_0x32075f)){logger['info']('File:\x20\x22'+_0x32075f+_0x69f0('0x5d'));fs['unlinkSync'](_0x32075f);}_0x32075f=_0x32075f+_0x69f0('0x5e');if(!_[_0x69f0('0x58')](_0xf20933[_0x69f0('0x4e')])&&fs[_0x69f0('0x5c')](_0x32075f)){logger['info']('File:\x20\x22'+_0x32075f+_0x69f0('0x5d'));fs['unlinkSync'](_0x32075f);}return _0xf20933;})['then'](function(_0x264bbe){if(!_0x264bbe)throw new InternalError();return _0x264bbe['destroy']();})[_0x69f0('0x43')](function(){_0x33adbc[_0x69f0('0x1d')](0xcc)[_0x69f0('0x1e')]();})[_0x69f0('0x46')](handleError(_0x33adbc,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index cae4c53..0733f1b 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 _0x3cb7=['define','SquareRecording','square_recordings','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x41fb3d,_0x443c18){var _0x3e2314=function(_0x5eeb02){while(--_0x5eeb02){_0x41fb3d['push'](_0x41fb3d['shift']());}};_0x3e2314(++_0x443c18);}(_0x3cb7,0xcf));var _0x73cb=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0x3cb7[_0x1b2255];return _0x33e57d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x73cb('0x0'))('api');var moment=require(_0x73cb('0x1'));var BPromise=require(_0x73cb('0x2'));var rp=require(_0x73cb('0x3'));var fs=require('fs');var path=require(_0x73cb('0x4'));var rimraf=require(_0x73cb('0x5'));var config=require(_0x73cb('0x6'));var attributes=require(_0x73cb('0x7'));module[_0x73cb('0x8')]=function(_0x574e69,_0x28a10b){return _0x574e69[_0x73cb('0x9')](_0x73cb('0xa'),attributes,{'tableName':_0x73cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87f1=['path','../../config/environment','exports','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36280c,_0x212f07){var _0x59e914=function(_0x1c4384){while(--_0x1c4384){_0x36280c['push'](_0x36280c['shift']());}};_0x59e914(++_0x212f07);}(_0x87f1,0x170));var _0x187f=function(_0x20f108,_0x3228e7){_0x20f108=_0x20f108-0x0;var _0x25ba1a=_0x87f1[_0x20f108];return _0x25ba1a;};'use strict';var _=require('lodash');var util=require(_0x187f('0x0'));var logger=require(_0x187f('0x1'))(_0x187f('0x2'));var moment=require(_0x187f('0x3'));var BPromise=require(_0x187f('0x4'));var rp=require(_0x187f('0x5'));var fs=require('fs');var path=require(_0x187f('0x6'));var rimraf=require('rimraf');var config=require(_0x187f('0x7'));var attributes=require('./squareRecording.attributes');module[_0x187f('0x8')]=function(_0x591147,_0x1115d1){return _0x591147['define'](_0x187f('0x9'),attributes,{'tableName':_0x187f('0xa'),'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 5e4a967..c31e8db 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 _0x25ad=['http','then','SquareRecording,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','SquareRecording','create','body','options','raw','debug','CreateSquareRecording','stringify','util','bluebird','../../config/utils','jayson/promise','client'];(function(_0x336f7e,_0x4237d8){var _0x207b21=function(_0x51c89f){while(--_0x51c89f){_0x336f7e['push'](_0x336f7e['shift']());}};_0x207b21(++_0x4237d8);}(_0x25ad,0x1b3));var _0xd25a=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x25ad[_0x53c256];return _0x25feb6;};'use strict';var _=require('lodash');var util=require(_0xd25a('0x0'));var moment=require('moment');var BPromise=require(_0xd25a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd25a('0x2'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd25a('0x3'));var client=jayson[_0xd25a('0x4')][_0xd25a('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3bf53f,_0x172af3,_0x236e26){return new BPromise(function(_0x4d63d1,_0x3f626b){return client['request'](_0x3bf53f,_0x236e26)[_0xd25a('0x6')](function(_0x3ed8e7){logger['info'](_0xd25a('0x7'),_0x172af3,_0xd25a('0x8'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x172af3,_0xd25a('0x8'),JSON['stringify'](_0x3ed8e7));if(_0x3ed8e7[_0xd25a('0x9')]){if(_0x3ed8e7[_0xd25a('0x9')][_0xd25a('0xa')]===0x1f4){logger[_0xd25a('0x9')](_0xd25a('0x7'),_0x172af3,_0x3ed8e7['error'][_0xd25a('0xb')]);return _0x3f626b(_0x3ed8e7['error'][_0xd25a('0xb')]);}logger[_0xd25a('0x9')](_0xd25a('0x7'),_0x172af3,_0x3ed8e7[_0xd25a('0x9')][_0xd25a('0xb')]);return _0x4d63d1(_0x3ed8e7[_0xd25a('0x9')][_0xd25a('0xb')]);}else{logger[_0xd25a('0xc')](_0xd25a('0x7'),_0x172af3,'request\x20sent');_0x4d63d1(_0x3ed8e7['result'][_0xd25a('0xb')]);}})[_0xd25a('0xd')](function(_0x5c5072){logger[_0xd25a('0x9')](_0xd25a('0x7'),_0x172af3,_0x5c5072);_0x3f626b(_0x5c5072);});});}exports['CreateSquareRecording']=function(_0x1279a6){var _0x5c7f87=this;return new Promise(function(_0x4f2baa,_0x1b52c1){return db[_0xd25a('0xe')][_0xd25a('0xf')](_0x1279a6[_0xd25a('0x10')],{'raw':_0x1279a6[_0xd25a('0x11')]?_0x1279a6[_0xd25a('0x11')][_0xd25a('0x12')]===undefined?!![]:![]:!![]})[_0xd25a('0x6')](function(_0x479c52){logger['info']('CreateSquareRecording',_0x1279a6);logger[_0xd25a('0x13')](_0xd25a('0x14'),_0x1279a6,JSON[_0xd25a('0x15')](_0x479c52));_0x4f2baa(_0x479c52);})['catch'](function(_0x16f3cb){logger[_0xd25a('0x9')](_0xd25a('0x14'),_0x16f3cb[_0xd25a('0xb')],_0x1279a6);_0x1b52c1(_0x5c7f87['error'](0x1f4,_0x16f3cb[_0xd25a('0xb')]));});});}; \ No newline at end of file +var _0x6207=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','CreateSquareRecording','SquareRecording','options','raw'];(function(_0x3de10f,_0x2e0019){var _0x495ff2=function(_0x2f87b4){while(--_0x2f87b4){_0x3de10f['push'](_0x3de10f['shift']());}};_0x495ff2(++_0x2e0019);}(_0x6207,0x15f));var _0x7620=function(_0x2b406c,_0x4730ca){_0x2b406c=_0x2b406c-0x0;var _0x40680e=_0x6207[_0x2b406c];return _0x40680e;};'use strict';var _=require(_0x7620('0x0'));var util=require(_0x7620('0x1'));var moment=require('moment');var BPromise=require(_0x7620('0x2'));var rs=require(_0x7620('0x3'));var fs=require('fs');var Redis=require(_0x7620('0x4'));var db=require(_0x7620('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7620('0x6'))(_0x7620('0x7'));var config=require(_0x7620('0x8'));var jayson=require(_0x7620('0x9'));var client=jayson[_0x7620('0xa')][_0x7620('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594228,_0x8f2a56,_0x4babfc){return new BPromise(function(_0x2e389c,_0x372913){return client[_0x7620('0xc')](_0x594228,_0x4babfc)[_0x7620('0xd')](function(_0x1e844b){logger[_0x7620('0xe')](_0x7620('0xf'),_0x8f2a56,'request\x20sent');logger[_0x7620('0x10')](_0x7620('0x11'),_0x8f2a56,_0x7620('0x12'),JSON[_0x7620('0x13')](_0x1e844b));if(_0x1e844b['error']){if(_0x1e844b['error'][_0x7620('0x14')]===0x1f4){logger[_0x7620('0x15')](_0x7620('0xf'),_0x8f2a56,_0x1e844b['error'][_0x7620('0x16')]);return _0x372913(_0x1e844b[_0x7620('0x15')][_0x7620('0x16')]);}logger['error'](_0x7620('0xf'),_0x8f2a56,_0x1e844b[_0x7620('0x15')][_0x7620('0x16')]);return _0x2e389c(_0x1e844b[_0x7620('0x15')][_0x7620('0x16')]);}else{logger[_0x7620('0xe')](_0x7620('0xf'),_0x8f2a56,_0x7620('0x12'));_0x2e389c(_0x1e844b['result']['message']);}})['catch'](function(_0x49edef){logger[_0x7620('0x15')](_0x7620('0xf'),_0x8f2a56,_0x49edef);_0x372913(_0x49edef);});});}exports[_0x7620('0x17')]=function(_0xf8d32d){var _0x6b2de5=this;return new Promise(function(_0x582935,_0x19f82c){return db[_0x7620('0x18')]['create'](_0xf8d32d['body'],{'raw':_0xf8d32d[_0x7620('0x19')]?_0xf8d32d[_0x7620('0x19')][_0x7620('0x1a')]===undefined?!![]:![]:!![]})[_0x7620('0xd')](function(_0x55d529){logger['info'](_0x7620('0x17'),_0xf8d32d);logger['debug'](_0x7620('0x17'),_0xf8d32d,JSON[_0x7620('0x13')](_0x55d529));_0x582935(_0x55d529);})['catch'](function(_0x5a722e){logger[_0x7620('0x15')](_0x7620('0x17'),_0x5a722e[_0x7620('0x16')],_0xf8d32d);_0x19f82c(_0x6b2de5[_0x7620('0x15')](0x1f4,_0x5a722e[_0x7620('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6ffebbe..368cb63 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0xaab643,_0x14df40){var _0x7bab9d=function(_0x2162f4){while(--_0x2162f4){_0xaab643['push'](_0xaab643['shift']());}};_0x7bab9d(++_0x14df40);}(_0xe706,0xa3));var _0x6e70=function(_0x2a566f,_0x19a56a){_0x2a566f=_0x2a566f-0x0;var _0x298923=_0xe706[_0x2a566f];return _0x298923;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _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(_0x17d947,_0x29d325){var _0x1c36f5=function(_0x521d47){while(--_0x521d47){_0x17d947['push'](_0x17d947['shift']());}};_0x1c36f5(++_0x29d325);}(_0xe706,0xa3));var _0x6e70=function(_0x269b97,_0x10d133){_0x269b97=_0x269b97-0x0;var _0x120efa=_0xe706[_0x269b97];return _0x120efa;};'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 e2a1cca..497b71a 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 _0x456f=['DATE','BOOLEAN','exports','STRING'];(function(_0x575959,_0x33eea6){var _0x23906d=function(_0x1dd0aa){while(--_0x1dd0aa){_0x575959['push'](_0x575959['shift']());}};_0x23906d(++_0x33eea6);}(_0x456f,0x112));var _0xf456=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x456f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf456('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xf456('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf456('0x1')]},'language':{'type':Sequelize[_0xf456('0x1')]},'type':{'type':Sequelize[_0xf456('0x1')]},'uniqueid':{'type':Sequelize[_0xf456('0x1')]},'version':{'type':Sequelize[_0xf456('0x1')]},'callerid':{'type':Sequelize[_0xf456('0x1')]},'calleridname':{'type':Sequelize[_0xf456('0x1')]},'callingpres':{'type':Sequelize[_0xf456('0x1')]},'callingani2':{'type':Sequelize[_0xf456('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xf456('0x1')]},'dnid':{'type':Sequelize[_0xf456('0x1')]},'rdnis':{'type':Sequelize[_0xf456('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xf456('0x1')]},'priority':{'type':Sequelize[_0xf456('0x1')]},'enhanced':{'type':Sequelize[_0xf456('0x1')]},'accountcode':{'type':Sequelize[_0xf456('0x1')]},'threadid':{'type':Sequelize[_0xf456('0x1')]},'project_name':{'type':Sequelize[_0xf456('0x1')]},'joinAt':{'type':Sequelize[_0xf456('0x2')]},'leaveAt':{'type':Sequelize[_0xf456('0x2')]},'bot':{'type':Sequelize[_0xf456('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x42a8=['sequelize','STRING','DATE'];(function(_0x155a5a,_0x1e57c7){var _0x17c330=function(_0x29822b){while(--_0x29822b){_0x155a5a['push'](_0x155a5a['shift']());}};_0x17c330(++_0x1e57c7);}(_0x42a8,0x12c));var _0x842a=function(_0x39f6a8,_0x47a635){_0x39f6a8=_0x39f6a8-0x0;var _0x26ed2c=_0x42a8[_0x39f6a8];return _0x26ed2c;};'use strict';var Sequelize=require(_0x842a('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x842a('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x842a('0x1')]},'language':{'type':Sequelize[_0x842a('0x1')]},'type':{'type':Sequelize[_0x842a('0x1')]},'uniqueid':{'type':Sequelize[_0x842a('0x1')]},'version':{'type':Sequelize[_0x842a('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x842a('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x842a('0x1')]},'callington':{'type':Sequelize[_0x842a('0x1')]},'callingtns':{'type':Sequelize[_0x842a('0x1')]},'dnid':{'type':Sequelize[_0x842a('0x1')]},'rdnis':{'type':Sequelize[_0x842a('0x1')]},'context':{'type':Sequelize[_0x842a('0x1')]},'extension':{'type':Sequelize[_0x842a('0x1')]},'priority':{'type':Sequelize[_0x842a('0x1')]},'enhanced':{'type':Sequelize[_0x842a('0x1')]},'accountcode':{'type':Sequelize[_0x842a('0x1')]},'threadid':{'type':Sequelize[_0x842a('0x1')]},'project_name':{'type':Sequelize[_0x842a('0x1')]},'joinAt':{'type':Sequelize[_0x842a('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'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 52d3a6c..e3a7a02 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 _0xa79b=['hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','include','findAll','show','params','keys','create','body','find','catch','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','model','query','intersection','attributes','fields','length'];(function(_0xbef11,_0x1d3004){var _0x227e3a=function(_0x47489b){while(--_0x47489b){_0xbef11['push'](_0xbef11['shift']());}};_0x227e3a(++_0x1d3004);}(_0xa79b,0xa5));var _0xba79=function(_0x68fc4b,_0x4c239c){_0x68fc4b=_0x68fc4b-0x0;var _0x206e4f=_0xa79b[_0x68fc4b];return _0x206e4f;};'use strict';var emlformat=require(_0xba79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba79('0x1'));var jsonpatch=require(_0xba79('0x2'));var rp=require(_0xba79('0x3'));var moment=require(_0xba79('0x4'));var BPromise=require(_0xba79('0x5'));var Mustache=require('mustache');var util=require(_0xba79('0x6'));var path=require(_0xba79('0x7'));var sox=require(_0xba79('0x8'));var csv=require(_0xba79('0x9'));var ejs=require(_0xba79('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xba79('0xb'));var crypto=require(_0xba79('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xba79('0xd'));var toCsv=require(_0xba79('0x9'));var querystring=require(_0xba79('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba79('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xba79('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xba79('0x11'));var utils=require(_0xba79('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xba79('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb1b58a,_0xe41620){_0xe41620=_0xe41620||0xcc;return function(_0x5a3e2c){if(_0x5a3e2c){return _0xb1b58a[_0xba79('0x14')](_0xe41620);}return _0xb1b58a['status'](_0xe41620)['end']();};}function respondWithResult(_0x35ceab,_0x18b65a){_0x18b65a=_0x18b65a||0xc8;return function(_0x3da828){if(_0x3da828){return _0x35ceab[_0xba79('0x15')](_0x18b65a)[_0xba79('0x16')](_0x3da828);}};}function respondWithFilteredResult(_0x6401a0,_0x2fd8b0){return function(_0x388919){if(_0x388919){var _0x32399b=typeof _0x2fd8b0['offset']===_0xba79('0x17')&&typeof _0x2fd8b0[_0xba79('0x18')]===_0xba79('0x17');var _0x3e2733=_0x388919[_0xba79('0x19')];var _0x5346f0=_0x32399b?0x0:_0x2fd8b0['offset'];var _0x3addb6=_0x32399b?_0x388919[_0xba79('0x19')]:_0x2fd8b0[_0xba79('0x1a')]+_0x2fd8b0['limit'];var _0x58ae3d;if(_0x3addb6>=_0x3e2733){_0x3addb6=_0x3e2733;_0x58ae3d=0xc8;}else{_0x58ae3d=0xce;}_0x6401a0[_0xba79('0x15')](_0x58ae3d);return _0x6401a0[_0xba79('0x1b')](_0xba79('0x1c'),_0x5346f0+'-'+_0x3addb6+'/'+_0x3e2733)[_0xba79('0x16')](_0x388919);}return null;};}function patchUpdates(_0x3bea4f){return function(_0x3ad0ce){try{jsonpatch[_0xba79('0x1d')](_0x3ad0ce,_0x3bea4f,!![]);}catch(_0x347b4e){return BPromise[_0xba79('0x1e')](_0x347b4e);}return _0x3ad0ce['save']();};}function saveUpdates(_0x30fcfa,_0x18e6a7){return function(_0x35ad36){if(_0x35ad36){return _0x35ad36[_0xba79('0x1f')](_0x30fcfa)[_0xba79('0x20')](function(_0x3f8af1){return _0x3f8af1;});}return null;};}function removeEntity(_0x166fd1,_0x272d06){return function(_0x5e75d0){if(_0x5e75d0){return _0x5e75d0['destroy']()[_0xba79('0x20')](function(){_0x166fd1['status'](0xcc)[_0xba79('0x21')]();});}};}function handleEntityNotFound(_0x42b026,_0x305f16){return function(_0x5e7c47){if(!_0x5e7c47){_0x42b026[_0xba79('0x14')](0x194);}return _0x5e7c47;};}function handleError(_0x5b35d8,_0x5f0481){_0x5f0481=_0x5f0481||0x1f4;return function(_0x5cca36){logger[_0xba79('0x22')](_0x5cca36[_0xba79('0x23')]);if(_0x5cca36[_0xba79('0x24')]){delete _0x5cca36['name'];}_0x5b35d8['status'](_0x5f0481)['send'](_0x5cca36);};}exports[_0xba79('0x25')]=function(_0x29ffe2,_0x4ece7d){var _0xfc04c4={},_0x263429={},_0x230c5b={'count':0x0,'rows':[]};var _0x29ed55=_[_0xba79('0x26')](db[_0xba79('0x27')][_0xba79('0x28')],function(_0x1e0f83){return{'name':_0x1e0f83[_0xba79('0x29')],'type':_0x1e0f83['type']['key']};});_0x263429[_0xba79('0x2a')]=_['map'](_0x29ed55,_0xba79('0x24'));_0x263429[_0xba79('0x2b')]=_['keys'](_0x29ffe2[_0xba79('0x2b')]);_0x263429['filters']=_[_0xba79('0x2c')](_0x263429[_0xba79('0x2a')],_0x263429[_0xba79('0x2b')]);_0xfc04c4[_0xba79('0x2d')]=_[_0xba79('0x2c')](_0x263429['model'],qs['fields'](_0x29ffe2[_0xba79('0x2b')][_0xba79('0x2e')]));_0xfc04c4[_0xba79('0x2d')]=_0xfc04c4['attributes'][_0xba79('0x2f')]?_0xfc04c4[_0xba79('0x2d')]:_0x263429['model'];if(!_0x29ffe2[_0xba79('0x2b')][_0xba79('0x30')](_0xba79('0x31'))){_0xfc04c4['limit']=qs[_0xba79('0x18')](_0x29ffe2[_0xba79('0x2b')][_0xba79('0x18')]);_0xfc04c4[_0xba79('0x1a')]=qs[_0xba79('0x1a')](_0x29ffe2[_0xba79('0x2b')][_0xba79('0x1a')]);}_0xfc04c4[_0xba79('0x32')]=qs[_0xba79('0x33')](_0x29ffe2[_0xba79('0x2b')][_0xba79('0x33')]);_0xfc04c4[_0xba79('0x34')]=qs[_0xba79('0x35')](_[_0xba79('0x36')](_0x29ffe2[_0xba79('0x2b')],_0x263429[_0xba79('0x35')]),_0x29ed55);if(_0x29ffe2[_0xba79('0x2b')]['filter']){_0xfc04c4[_0xba79('0x34')]=_[_0xba79('0x37')](_0xfc04c4['where'],{'$or':_[_0xba79('0x26')](_0x29ed55,function(_0x5097fc){if(_0x5097fc[_0xba79('0x38')]!==_0xba79('0x39')){var _0xa4806a={};_0xa4806a[_0x5097fc[_0xba79('0x24')]]={'$like':'%'+_0x29ffe2[_0xba79('0x2b')][_0xba79('0x3a')]+'%'};return _0xa4806a;}})});}_0xfc04c4=_[_0xba79('0x37')]({},_0xfc04c4,_0x29ffe2[_0xba79('0x3b')]);var _0x2ae6c9={'where':_0xfc04c4[_0xba79('0x34')]};return db[_0xba79('0x27')][_0xba79('0x19')](_0x2ae6c9)[_0xba79('0x20')](function(_0xa51201){_0x230c5b['count']=_0xa51201;if(_0x29ffe2[_0xba79('0x2b')]['includeAll']){_0xfc04c4[_0xba79('0x3c')]=[{'all':!![]}];}return db[_0xba79('0x27')][_0xba79('0x3d')](_0xfc04c4);})[_0xba79('0x20')](function(_0x2edeec){_0x230c5b['rows']=_0x2edeec;return _0x230c5b;})[_0xba79('0x20')](respondWithFilteredResult(_0x4ece7d,_0xfc04c4))['catch'](handleError(_0x4ece7d,null));};exports[_0xba79('0x3e')]=function(_0x29b03b,_0x21f85f){var _0x4d98ac={'raw':!![],'where':{'id':_0x29b03b[_0xba79('0x3f')]['id']}},_0x157f5e={};_0x157f5e[_0xba79('0x2a')]=_[_0xba79('0x40')](db[_0xba79('0x27')]['rawAttributes']);_0x157f5e[_0xba79('0x2b')]=_[_0xba79('0x40')](_0x29b03b[_0xba79('0x2b')]);_0x157f5e[_0xba79('0x35')]=_[_0xba79('0x2c')](_0x157f5e[_0xba79('0x2a')],_0x157f5e[_0xba79('0x2b')]);_0x4d98ac['attributes']=_[_0xba79('0x2c')](_0x157f5e['model'],qs[_0xba79('0x2e')](_0x29b03b['query'][_0xba79('0x2e')]));_0x4d98ac[_0xba79('0x2d')]=_0x4d98ac[_0xba79('0x2d')][_0xba79('0x2f')]?_0x4d98ac[_0xba79('0x2d')]:_0x157f5e[_0xba79('0x2a')];if(_0x29b03b[_0xba79('0x2b')]['includeAll']){_0x4d98ac[_0xba79('0x3c')]=[{'all':!![]}];}_0x4d98ac=_['merge']({},_0x4d98ac,_0x29b03b[_0xba79('0x3b')]);return db[_0xba79('0x27')]['find'](_0x4d98ac)[_0xba79('0x20')](handleEntityNotFound(_0x21f85f,null))[_0xba79('0x20')](respondWithResult(_0x21f85f,null))['catch'](handleError(_0x21f85f,null));};exports[_0xba79('0x41')]=function(_0xca7d32,_0x12b05b){return db[_0xba79('0x27')][_0xba79('0x41')](_0xca7d32[_0xba79('0x42')],{})[_0xba79('0x20')](respondWithResult(_0x12b05b,0xc9))['catch'](handleError(_0x12b05b,null));};exports[_0xba79('0x1f')]=function(_0x156a90,_0x92ee79){if(_0x156a90[_0xba79('0x42')]['id']){delete _0x156a90[_0xba79('0x42')]['id'];}return db[_0xba79('0x27')][_0xba79('0x43')]({'where':{'id':_0x156a90[_0xba79('0x3f')]['id']}})[_0xba79('0x20')](handleEntityNotFound(_0x92ee79,null))[_0xba79('0x20')](saveUpdates(_0x156a90['body'],null))[_0xba79('0x20')](respondWithResult(_0x92ee79,null))[_0xba79('0x44')](handleError(_0x92ee79,null));};exports[_0xba79('0x45')]=function(_0x131a7a,_0x4b5526){return db[_0xba79('0x27')][_0xba79('0x43')]({'where':{'id':_0x131a7a['params']['id']}})[_0xba79('0x20')](handleEntityNotFound(_0x4b5526,null))['then'](removeEntity(_0x4b5526,null))[_0xba79('0x44')](handleError(_0x4b5526,null));};exports[_0xba79('0x46')]=function(_0x5935b2,_0x394dad){return db[_0xba79('0x27')]['describe']()[_0xba79('0x20')](respondWithResult(_0x394dad,null))[_0xba79('0x44')](handleError(_0x394dad,null));}; \ No newline at end of file +var _0x8192=['destroy','name','index','map','SquareReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x8192,0xf9));var _0x2819=function(_0xd3cfb7,_0x13cb3f){_0xd3cfb7=_0xd3cfb7-0x0;var _0x1ff0a3=_0x8192[_0xd3cfb7];return _0x1ff0a3;};'use strict';var emlformat=require(_0x2819('0x0'));var rimraf=require(_0x2819('0x1'));var zipdir=require(_0x2819('0x2'));var jsonpatch=require(_0x2819('0x3'));var rp=require(_0x2819('0x4'));var moment=require(_0x2819('0x5'));var BPromise=require(_0x2819('0x6'));var Mustache=require(_0x2819('0x7'));var util=require(_0x2819('0x8'));var path=require(_0x2819('0x9'));var sox=require(_0x2819('0xa'));var csv=require(_0x2819('0xb'));var ejs=require(_0x2819('0xc'));var fs=require('fs');var fs_extra=require(_0x2819('0xd'));var _=require('lodash');var squel=require(_0x2819('0xe'));var crypto=require(_0x2819('0xf'));var jsforce=require(_0x2819('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2819('0xb'));var querystring=require('querystring');var Papa=require(_0x2819('0x11'));var Redis=require(_0x2819('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2819('0x13'));var as=require(_0x2819('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2819('0x15'));var config=require(_0x2819('0x16'));var licenseUtil=require(_0x2819('0x17'));var db=require(_0x2819('0x18'))['db'];function respondWithStatusCode(_0x5561a4,_0x1b211f){_0x1b211f=_0x1b211f||0xcc;return function(_0x59bbd4){if(_0x59bbd4){return _0x5561a4[_0x2819('0x19')](_0x1b211f);}return _0x5561a4[_0x2819('0x1a')](_0x1b211f)[_0x2819('0x1b')]();};}function respondWithResult(_0x235532,_0x3436e7){_0x3436e7=_0x3436e7||0xc8;return function(_0x34f012){if(_0x34f012){return _0x235532[_0x2819('0x1a')](_0x3436e7)[_0x2819('0x1c')](_0x34f012);}};}function respondWithFilteredResult(_0x28fbeb,_0x353769){return function(_0x11f10c){if(_0x11f10c){var _0x1878d0=typeof _0x353769[_0x2819('0x1d')]===_0x2819('0x1e')&&typeof _0x353769['limit']===_0x2819('0x1e');var _0x1317ac=_0x11f10c[_0x2819('0x1f')];var _0x18d629=_0x1878d0?0x0:_0x353769[_0x2819('0x1d')];var _0x524445=_0x1878d0?_0x11f10c['count']:_0x353769[_0x2819('0x1d')]+_0x353769[_0x2819('0x20')];var _0x1c8754;if(_0x524445>=_0x1317ac){_0x524445=_0x1317ac;_0x1c8754=0xc8;}else{_0x1c8754=0xce;}_0x28fbeb[_0x2819('0x1a')](_0x1c8754);return _0x28fbeb['set'](_0x2819('0x21'),_0x18d629+'-'+_0x524445+'/'+_0x1317ac)[_0x2819('0x1c')](_0x11f10c);}return null;};}function patchUpdates(_0x319181){return function(_0xdc9fed){try{jsonpatch[_0x2819('0x22')](_0xdc9fed,_0x319181,!![]);}catch(_0x20af7a){return BPromise[_0x2819('0x23')](_0x20af7a);}return _0xdc9fed[_0x2819('0x24')]();};}function saveUpdates(_0x5e1e0a,_0x380dd0){return function(_0x5b4bd7){if(_0x5b4bd7){return _0x5b4bd7[_0x2819('0x25')](_0x5e1e0a)[_0x2819('0x26')](function(_0x2e63cd){return _0x2e63cd;});}return null;};}function removeEntity(_0x44d376,_0x1197e3){return function(_0x543480){if(_0x543480){return _0x543480[_0x2819('0x27')]()[_0x2819('0x26')](function(){_0x44d376[_0x2819('0x1a')](0xcc)[_0x2819('0x1b')]();});}};}function handleEntityNotFound(_0x356231,_0x590488){return function(_0x3f0c43){if(!_0x3f0c43){_0x356231[_0x2819('0x19')](0x194);}return _0x3f0c43;};}function handleError(_0x40fe5d,_0x11eedc){_0x11eedc=_0x11eedc||0x1f4;return function(_0x374f94){logger['error'](_0x374f94['stack']);if(_0x374f94[_0x2819('0x28')]){delete _0x374f94[_0x2819('0x28')];}_0x40fe5d['status'](_0x11eedc)['send'](_0x374f94);};}exports[_0x2819('0x29')]=function(_0x1c5374,_0x2f386d){var _0xa853b={},_0x1629eb={},_0x988113={'count':0x0,'rows':[]};var _0x8359c4=_[_0x2819('0x2a')](db[_0x2819('0x2b')][_0x2819('0x2c')],function(_0x454dc8){return{'name':_0x454dc8[_0x2819('0x2d')],'type':_0x454dc8[_0x2819('0x2e')]['key']};});_0x1629eb[_0x2819('0x2f')]=_[_0x2819('0x2a')](_0x8359c4,_0x2819('0x28'));_0x1629eb[_0x2819('0x30')]=_[_0x2819('0x31')](_0x1c5374[_0x2819('0x30')]);_0x1629eb[_0x2819('0x32')]=_[_0x2819('0x33')](_0x1629eb[_0x2819('0x2f')],_0x1629eb[_0x2819('0x30')]);_0xa853b[_0x2819('0x34')]=_[_0x2819('0x33')](_0x1629eb['model'],qs[_0x2819('0x35')](_0x1c5374[_0x2819('0x30')][_0x2819('0x35')]));_0xa853b[_0x2819('0x34')]=_0xa853b[_0x2819('0x34')][_0x2819('0x36')]?_0xa853b[_0x2819('0x34')]:_0x1629eb['model'];if(!_0x1c5374[_0x2819('0x30')]['hasOwnProperty'](_0x2819('0x37'))){_0xa853b[_0x2819('0x20')]=qs[_0x2819('0x20')](_0x1c5374[_0x2819('0x30')][_0x2819('0x20')]);_0xa853b[_0x2819('0x1d')]=qs[_0x2819('0x1d')](_0x1c5374['query'][_0x2819('0x1d')]);}_0xa853b[_0x2819('0x38')]=qs[_0x2819('0x39')](_0x1c5374[_0x2819('0x30')][_0x2819('0x39')]);_0xa853b[_0x2819('0x3a')]=qs[_0x2819('0x32')](_[_0x2819('0x3b')](_0x1c5374[_0x2819('0x30')],_0x1629eb[_0x2819('0x32')]),_0x8359c4);if(_0x1c5374['query'][_0x2819('0x3c')]){_0xa853b['where']=_[_0x2819('0x3d')](_0xa853b[_0x2819('0x3a')],{'$or':_['map'](_0x8359c4,function(_0x17ec65){if(_0x17ec65[_0x2819('0x2e')]!=='VIRTUAL'){var _0x1479f7={};_0x1479f7[_0x17ec65[_0x2819('0x28')]]={'$like':'%'+_0x1c5374[_0x2819('0x30')][_0x2819('0x3c')]+'%'};return _0x1479f7;}})});}_0xa853b=_[_0x2819('0x3d')]({},_0xa853b,_0x1c5374[_0x2819('0x3e')]);var _0x27ff85={'where':_0xa853b['where']};return db[_0x2819('0x2b')][_0x2819('0x1f')](_0x27ff85)[_0x2819('0x26')](function(_0x2f0875){_0x988113['count']=_0x2f0875;if(_0x1c5374[_0x2819('0x30')]['includeAll']){_0xa853b[_0x2819('0x3f')]=[{'all':!![]}];}return db[_0x2819('0x2b')]['findAll'](_0xa853b);})[_0x2819('0x26')](function(_0x1340bc){_0x988113[_0x2819('0x40')]=_0x1340bc;return _0x988113;})[_0x2819('0x26')](respondWithFilteredResult(_0x2f386d,_0xa853b))['catch'](handleError(_0x2f386d,null));};exports[_0x2819('0x41')]=function(_0x720fbc,_0x50cc28){var _0x1ed055={'raw':!![],'where':{'id':_0x720fbc[_0x2819('0x42')]['id']}},_0x195ad4={};_0x195ad4['model']=_[_0x2819('0x31')](db[_0x2819('0x2b')][_0x2819('0x2c')]);_0x195ad4[_0x2819('0x30')]=_[_0x2819('0x31')](_0x720fbc[_0x2819('0x30')]);_0x195ad4['filters']=_[_0x2819('0x33')](_0x195ad4[_0x2819('0x2f')],_0x195ad4[_0x2819('0x30')]);_0x1ed055[_0x2819('0x34')]=_[_0x2819('0x33')](_0x195ad4[_0x2819('0x2f')],qs[_0x2819('0x35')](_0x720fbc[_0x2819('0x30')]['fields']));_0x1ed055[_0x2819('0x34')]=_0x1ed055[_0x2819('0x34')]['length']?_0x1ed055[_0x2819('0x34')]:_0x195ad4['model'];if(_0x720fbc[_0x2819('0x30')]['includeAll']){_0x1ed055['include']=[{'all':!![]}];}_0x1ed055=_['merge']({},_0x1ed055,_0x720fbc[_0x2819('0x3e')]);return db[_0x2819('0x2b')][_0x2819('0x43')](_0x1ed055)[_0x2819('0x26')](handleEntityNotFound(_0x50cc28,null))[_0x2819('0x26')](respondWithResult(_0x50cc28,null))[_0x2819('0x44')](handleError(_0x50cc28,null));};exports[_0x2819('0x45')]=function(_0x559bd0,_0x1d9370){return db[_0x2819('0x2b')]['create'](_0x559bd0[_0x2819('0x46')],{})[_0x2819('0x26')](respondWithResult(_0x1d9370,0xc9))[_0x2819('0x44')](handleError(_0x1d9370,null));};exports[_0x2819('0x25')]=function(_0x4c0b91,_0x5ae5bc){if(_0x4c0b91[_0x2819('0x46')]['id']){delete _0x4c0b91[_0x2819('0x46')]['id'];}return db[_0x2819('0x2b')][_0x2819('0x43')]({'where':{'id':_0x4c0b91[_0x2819('0x42')]['id']}})[_0x2819('0x26')](handleEntityNotFound(_0x5ae5bc,null))[_0x2819('0x26')](saveUpdates(_0x4c0b91[_0x2819('0x46')],null))[_0x2819('0x26')](respondWithResult(_0x5ae5bc,null))[_0x2819('0x44')](handleError(_0x5ae5bc,null));};exports[_0x2819('0x27')]=function(_0x3f5459,_0x21d35c){return db[_0x2819('0x2b')][_0x2819('0x43')]({'where':{'id':_0x3f5459['params']['id']}})[_0x2819('0x26')](handleEntityNotFound(_0x21d35c,null))['then'](removeEntity(_0x21d35c,null))[_0x2819('0x44')](handleError(_0x21d35c,null));};exports['describe']=function(_0x2e4e9a,_0x2d15f3){return db['SquareReport'][_0x2819('0x47')]()[_0x2819('0x26')](respondWithResult(_0x2d15f3,null))['catch'](handleError(_0x2d15f3,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a8ce75b..67f0831 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 _0xd707=['../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b1c4f,_0x91fe11){var _0x179e79=function(_0x7370e9){while(--_0x7370e9){_0x5b1c4f['push'](_0x5b1c4f['shift']());}};_0x179e79(++_0x91fe11);}(_0xd707,0x1a1));var _0x7d70=function(_0x4de702,_0x266801){_0x4de702=_0x4de702-0x0;var _0x149340=_0xd707[_0x4de702];return _0x149340;};'use strict';var _=require(_0x7d70('0x0'));var util=require(_0x7d70('0x1'));var logger=require(_0x7d70('0x2'))(_0x7d70('0x3'));var moment=require(_0x7d70('0x4'));var BPromise=require(_0x7d70('0x5'));var rp=require(_0x7d70('0x6'));var fs=require('fs');var path=require(_0x7d70('0x7'));var rimraf=require('rimraf');var config=require(_0x7d70('0x8'));var attributes=require(_0x7d70('0x9'));module['exports']=function(_0x23a433,_0x5c0ee9){return _0x23a433[_0x7d70('0xa')](_0x7d70('0xb'),attributes,{'tableName':_0x7d70('0xc'),'paranoid':![],'indexes':[{'name':_0x7d70('0xd'),'fields':[_0x7d70('0xe'),_0x7d70('0xf')]},{'name':_0x7d70('0x10'),'fields':[_0x7d70('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd69=['api','request-promise','rimraf','../../config/environment','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x506d2f,_0x5ab76e){var _0x101255=function(_0x1596b1){while(--_0x1596b1){_0x506d2f['push'](_0x506d2f['shift']());}};_0x101255(++_0x5ab76e);}(_0xfd69,0xcf));var _0x9fd6=function(_0x36bb36,_0x2fb41b){_0x36bb36=_0x36bb36-0x0;var _0x5d79fd=_0xfd69[_0x36bb36];return _0x5d79fd;};'use strict';var _=require(_0x9fd6('0x0'));var util=require(_0x9fd6('0x1'));var logger=require(_0x9fd6('0x2'))(_0x9fd6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9fd6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fd6('0x5'));var config=require(_0x9fd6('0x6'));var attributes=require('./squareReport.attributes');module[_0x9fd6('0x7')]=function(_0x344094,_0x5c8b6c){return _0x344094['define'](_0x9fd6('0x8'),attributes,{'tableName':_0x9fd6('0x9'),'paranoid':![],'indexes':[{'name':_0x9fd6('0xa'),'fields':[_0x9fd6('0xb'),_0x9fd6('0xc')]},{'name':_0x9fd6('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d7cac63..36a73b8 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 _0xab57=['options','update','raw','attributes','limit','UpdateSquareReport','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareReport','SquareReport','create','body'];(function(_0x13a3e5,_0x5ad805){var _0x39c378=function(_0x449249){while(--_0x449249){_0x13a3e5['push'](_0x13a3e5['shift']());}};_0x39c378(++_0x5ad805);}(_0xab57,0x11f));var _0x7ab5=function(_0x38228b,_0x24d037){_0x38228b=_0x38228b-0x0;var _0x1966a3=_0xab57[_0x38228b];return _0x1966a3;};'use strict';var _=require(_0x7ab5('0x0'));var util=require(_0x7ab5('0x1'));var moment=require(_0x7ab5('0x2'));var BPromise=require(_0x7ab5('0x3'));var rs=require(_0x7ab5('0x4'));var fs=require('fs');var Redis=require(_0x7ab5('0x5'));var db=require(_0x7ab5('0x6'))['db'];var utils=require(_0x7ab5('0x7'));var logger=require(_0x7ab5('0x8'))(_0x7ab5('0x9'));var config=require(_0x7ab5('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7ab5('0xb')][_0x7ab5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x164bca,_0x412378,_0x10d99b){return new BPromise(function(_0x421188,_0x2d757b){return client[_0x7ab5('0xd')](_0x164bca,_0x10d99b)[_0x7ab5('0xe')](function(_0x12e28b){logger['info'](_0x7ab5('0xf'),_0x412378,_0x7ab5('0x10'));logger['debug'](_0x7ab5('0x11'),_0x412378,_0x7ab5('0x10'),JSON[_0x7ab5('0x12')](_0x12e28b));if(_0x12e28b[_0x7ab5('0x13')]){if(_0x12e28b[_0x7ab5('0x13')][_0x7ab5('0x14')]===0x1f4){logger[_0x7ab5('0x13')](_0x7ab5('0xf'),_0x412378,_0x12e28b[_0x7ab5('0x13')][_0x7ab5('0x15')]);return _0x2d757b(_0x12e28b[_0x7ab5('0x13')][_0x7ab5('0x15')]);}logger[_0x7ab5('0x13')]('SquareReport,\x20%s,\x20%s',_0x412378,_0x12e28b['error'][_0x7ab5('0x15')]);return _0x421188(_0x12e28b['error'][_0x7ab5('0x15')]);}else{logger[_0x7ab5('0x16')](_0x7ab5('0xf'),_0x412378,'request\x20sent');_0x421188(_0x12e28b['result'][_0x7ab5('0x15')]);}})[_0x7ab5('0x17')](function(_0x153ccb){logger[_0x7ab5('0x13')]('SquareReport,\x20%s,\x20%s',_0x412378,_0x153ccb);_0x2d757b(_0x153ccb);});});}exports[_0x7ab5('0x18')]=function(_0x4855a7){var _0x56bac6=this;return new Promise(function(_0x12387f,_0x3280ba){return db[_0x7ab5('0x19')][_0x7ab5('0x1a')](_0x4855a7[_0x7ab5('0x1b')],{'raw':_0x4855a7[_0x7ab5('0x1c')]?_0x4855a7[_0x7ab5('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x7ab5('0xe')](function(_0xfbe6b2){logger['info'](_0x7ab5('0x18'),_0x4855a7);logger['debug'](_0x7ab5('0x18'),_0x4855a7,JSON['stringify'](_0xfbe6b2));_0x12387f(_0xfbe6b2);})[_0x7ab5('0x17')](function(_0x174ac0){logger[_0x7ab5('0x13')](_0x7ab5('0x18'),_0x174ac0[_0x7ab5('0x15')],_0x4855a7);_0x3280ba(_0x56bac6[_0x7ab5('0x13')](0x1f4,_0x174ac0['message']));});});};exports['UpdateSquareReport']=function(_0x5bfffe){var _0x277967=this;return new Promise(function(_0x5ad9da,_0x54fb25){return db[_0x7ab5('0x19')][_0x7ab5('0x1d')](_0x5bfffe[_0x7ab5('0x1b')],{'raw':_0x5bfffe[_0x7ab5('0x1c')]?_0x5bfffe['options'][_0x7ab5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bfffe[_0x7ab5('0x1c')]?_0x5bfffe[_0x7ab5('0x1c')]['where']||null:null,'attributes':_0x5bfffe[_0x7ab5('0x1c')]?_0x5bfffe[_0x7ab5('0x1c')][_0x7ab5('0x1f')]||null:null,'limit':_0x5bfffe[_0x7ab5('0x1c')]?_0x5bfffe[_0x7ab5('0x1c')][_0x7ab5('0x20')]||null:null})[_0x7ab5('0xe')](function(_0xd4268f){logger['info'](_0x7ab5('0x21'),_0x5bfffe);logger[_0x7ab5('0x22')]('UpdateSquareReport',_0x5bfffe,JSON[_0x7ab5('0x12')](_0xd4268f));_0x5ad9da(_0xd4268f);})[_0x7ab5('0x17')](function(_0x2e4385){logger['error'](_0x7ab5('0x21'),_0x2e4385[_0x7ab5('0x15')],_0x5bfffe);_0x54fb25(_0x277967[_0x7ab5('0x13')](0x1f4,_0x2e4385[_0x7ab5('0x15')]));});});}; \ No newline at end of file +var _0x91f3=['info','SquareReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','SquareReport','create','body','options','raw','CreateSquareReport','stringify','UpdateSquareReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3be904,_0x2d8018){var _0xbded2c=function(_0x55763a){while(--_0x55763a){_0x3be904['push'](_0x3be904['shift']());}};_0xbded2c(++_0x2d8018);}(_0x91f3,0xbe));var _0x391f=function(_0x47e650,_0x5944de){_0x47e650=_0x47e650-0x0;var _0x5d5c6b=_0x91f3[_0x47e650];return _0x5d5c6b;};'use strict';var _=require('lodash');var util=require(_0x391f('0x0'));var moment=require(_0x391f('0x1'));var BPromise=require(_0x391f('0x2'));var rs=require(_0x391f('0x3'));var fs=require('fs');var Redis=require(_0x391f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x391f('0x5'));var logger=require(_0x391f('0x6'))(_0x391f('0x7'));var config=require(_0x391f('0x8'));var jayson=require(_0x391f('0x9'));var client=jayson[_0x391f('0xa')][_0x391f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435f49,_0x3cce05,_0x4c8ed3){return new BPromise(function(_0x2af07a,_0x760cee){return client[_0x391f('0xc')](_0x435f49,_0x4c8ed3)[_0x391f('0xd')](function(_0x43506a){logger[_0x391f('0xe')](_0x391f('0xf'),_0x3cce05,'request\x20sent');logger[_0x391f('0x10')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x3cce05,_0x391f('0x11'),JSON['stringify'](_0x43506a));if(_0x43506a[_0x391f('0x12')]){if(_0x43506a[_0x391f('0x12')][_0x391f('0x13')]===0x1f4){logger[_0x391f('0x12')]('SquareReport,\x20%s,\x20%s',_0x3cce05,_0x43506a[_0x391f('0x12')]['message']);return _0x760cee(_0x43506a['error'][_0x391f('0x14')]);}logger[_0x391f('0x12')](_0x391f('0xf'),_0x3cce05,_0x43506a[_0x391f('0x12')]['message']);return _0x2af07a(_0x43506a[_0x391f('0x12')][_0x391f('0x14')]);}else{logger[_0x391f('0xe')](_0x391f('0xf'),_0x3cce05,_0x391f('0x11'));_0x2af07a(_0x43506a[_0x391f('0x15')][_0x391f('0x14')]);}})[_0x391f('0x16')](function(_0x25b533){logger['error'](_0x391f('0xf'),_0x3cce05,_0x25b533);_0x760cee(_0x25b533);});});}exports['CreateSquareReport']=function(_0xb86bc0){var _0x39c226=this;return new Promise(function(_0x2cbd49,_0x50abcc){return db[_0x391f('0x17')][_0x391f('0x18')](_0xb86bc0[_0x391f('0x19')],{'raw':_0xb86bc0['options']?_0xb86bc0[_0x391f('0x1a')][_0x391f('0x1b')]===undefined?!![]:![]:!![]})[_0x391f('0xd')](function(_0x40b597){logger[_0x391f('0xe')](_0x391f('0x1c'),_0xb86bc0);logger[_0x391f('0x10')](_0x391f('0x1c'),_0xb86bc0,JSON[_0x391f('0x1d')](_0x40b597));_0x2cbd49(_0x40b597);})[_0x391f('0x16')](function(_0x2a148e){logger[_0x391f('0x12')](_0x391f('0x1c'),_0x2a148e[_0x391f('0x14')],_0xb86bc0);_0x50abcc(_0x39c226[_0x391f('0x12')](0x1f4,_0x2a148e[_0x391f('0x14')]));});});};exports[_0x391f('0x1e')]=function(_0x4cea82){var _0x219756=this;return new Promise(function(_0x901976,_0x51f741){return db[_0x391f('0x17')][_0x391f('0x1f')](_0x4cea82['body'],{'raw':_0x4cea82[_0x391f('0x1a')]?_0x4cea82['options'][_0x391f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cea82['options']?_0x4cea82[_0x391f('0x1a')][_0x391f('0x20')]||null:null,'attributes':_0x4cea82[_0x391f('0x1a')]?_0x4cea82[_0x391f('0x1a')]['attributes']||null:null,'limit':_0x4cea82[_0x391f('0x1a')]?_0x4cea82['options'][_0x391f('0x21')]||null:null})[_0x391f('0xd')](function(_0x1099ad){logger['info'](_0x391f('0x1e'),_0x4cea82);logger[_0x391f('0x10')](_0x391f('0x1e'),_0x4cea82,JSON[_0x391f('0x1d')](_0x1099ad));_0x901976(_0x1099ad);})[_0x391f('0x16')](function(_0x30c149){logger[_0x391f('0x12')](_0x391f('0x1e'),_0x30c149['message'],_0x4cea82);_0x51f741(_0x219756['error'](0x1f4,_0x30c149[_0x391f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 6611871..0160150 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 _0xd1d7=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x2361ee,_0x3fd30f){var _0x27c7be=function(_0x3bdd92){while(--_0x3bdd92){_0x2361ee['push'](_0x2361ee['shift']());}};_0x27c7be(++_0x3fd30f);}(_0xd1d7,0x1a7));var _0x7d1d=function(_0x5e1f0f,_0x45a0e7){_0x5e1f0f=_0x5e1f0f-0x0;var _0x99c34a=_0xd1d7[_0x5e1f0f];return _0x99c34a;};'use strict';var multer=require(_0x7d1d('0x0'));var util=require('util');var path=require(_0x7d1d('0x1'));var timeout=require(_0x7d1d('0x2'));var express=require(_0x7d1d('0x3'));var router=express[_0x7d1d('0x4')]();var fs_extra=require(_0x7d1d('0x5'));var auth=require(_0x7d1d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7d1d('0x7'));var controller=require(_0x7d1d('0x8'));router[_0x7d1d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7d1d('0x9')]('/describe',auth[_0x7d1d('0xa')](),controller[_0x7d1d('0xb')]);router[_0x7d1d('0x9')](_0x7d1d('0xc'),auth[_0x7d1d('0xa')](),controller[_0x7d1d('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7d1d('0xe')](_0x7d1d('0xc'),auth['isAuthenticated'](),controller[_0x7d1d('0xf')]);router[_0x7d1d('0x10')]('/:id',auth[_0x7d1d('0xa')](),controller[_0x7d1d('0x11')]);module[_0x7d1d('0x12')]=router; \ No newline at end of file +var _0xea24=['../../config/environment','./squareReportDetail.controller','isAuthenticated','get','/describe','describe','show','post','create','/:id','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xea24,0x70));var _0x4ea2=function(_0x8e8236,_0x4b128a){_0x8e8236=_0x8e8236-0x0;var _0x25d7b2=_0xea24[_0x8e8236];return _0x25d7b2;};'use strict';var multer=require('multer');var util=require(_0x4ea2('0x0'));var path=require(_0x4ea2('0x1'));var timeout=require(_0x4ea2('0x2'));var express=require(_0x4ea2('0x3'));var router=express[_0x4ea2('0x4')]();var fs_extra=require(_0x4ea2('0x5'));var auth=require(_0x4ea2('0x6'));var interaction=require(_0x4ea2('0x7'));var config=require(_0x4ea2('0x8'));var controller=require(_0x4ea2('0x9'));router['get']('/',auth[_0x4ea2('0xa')](),controller['index']);router[_0x4ea2('0xb')](_0x4ea2('0xc'),auth['isAuthenticated'](),controller[_0x4ea2('0xd')]);router['get']('/:id',auth[_0x4ea2('0xa')](),controller[_0x4ea2('0xe')]);router[_0x4ea2('0xf')]('/',auth[_0x4ea2('0xa')](),controller[_0x4ea2('0x10')]);router['put'](_0x4ea2('0x11'),auth[_0x4ea2('0xa')](),controller['update']);router[_0x4ea2('0x12')](_0x4ea2('0x11'),auth[_0x4ea2('0xa')](),controller[_0x4ea2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index d10a152..5c2df47 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 _0x9acd=['STRING','TEXT','sequelize','exports'];(function(_0x30249c,_0x17face){var _0x5cacc9=function(_0x46f8f3){while(--_0x46f8f3){_0x30249c['push'](_0x30249c['shift']());}};_0x5cacc9(++_0x17face);}(_0x9acd,0x82));var _0xd9ac=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9acd[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xd9ac('0x0'));module[_0xd9ac('0x1')]={'uniqueid':{'type':Sequelize[_0xd9ac('0x2')]},'node':{'type':Sequelize[_0xd9ac('0x2')]},'application':{'type':Sequelize[_0xd9ac('0x2')]},'data':{'type':Sequelize[_0xd9ac('0x3')]},'project_name':{'type':Sequelize[_0xd9ac('0x2')]},'callerid':{'type':Sequelize[_0xd9ac('0x2')]}}; \ No newline at end of file +var _0x68bd=['STRING','TEXT','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x68bd,0xca));var _0xd68b=function(_0x5d9f5c,_0x189d90){_0x5d9f5c=_0x5d9f5c-0x0;var _0x171fba=_0x68bd[_0x5d9f5c];return _0x171fba;};'use strict';var Sequelize=require(_0xd68b('0x0'));module[_0xd68b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xd68b('0x2')]},'application':{'type':Sequelize[_0xd68b('0x2')]},'data':{'type':Sequelize[_0xd68b('0x3')]},'project_name':{'type':Sequelize[_0xd68b('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 59fb6f3..cc957b0 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 _0xc6f6=['ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','send','map','SquareDetailsReport','rawAttributes','model','name','query','keys','attributes','fields','nolimit','order','pick','filters','where','merge','type','options','include','findAll','rows','show','params','intersection','length','includeAll','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv'];(function(_0x302272,_0x5739e4){var _0x4bf55c=function(_0x4130c3){while(--_0x4130c3){_0x302272['push'](_0x302272['shift']());}};_0x4bf55c(++_0x5739e4);}(_0xc6f6,0x1a1));var _0x6c6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc6f6[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c6f('0x0'));var zipdir=require(_0x6c6f('0x1'));var jsonpatch=require(_0x6c6f('0x2'));var rp=require(_0x6c6f('0x3'));var moment=require('moment');var BPromise=require(_0x6c6f('0x4'));var Mustache=require(_0x6c6f('0x5'));var util=require(_0x6c6f('0x6'));var path=require(_0x6c6f('0x7'));var sox=require('sox');var csv=require(_0x6c6f('0x8'));var ejs=require(_0x6c6f('0x9'));var fs=require('fs');var fs_extra=require(_0x6c6f('0xa'));var _=require(_0x6c6f('0xb'));var squel=require(_0x6c6f('0xc'));var crypto=require('crypto');var jsforce=require(_0x6c6f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6c6f('0x8'));var querystring=require('querystring');var Papa=require(_0x6c6f('0xe'));var Redis=require(_0x6c6f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6c6f('0x10'));var as=require(_0x6c6f('0x11'));var hardwareService=require(_0x6c6f('0x12'));var logger=require(_0x6c6f('0x13'))('api');var utils=require(_0x6c6f('0x14'));var config=require(_0x6c6f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c6f('0x16'))['db'];function respondWithStatusCode(_0x5eec2b,_0x2e8a01){_0x2e8a01=_0x2e8a01||0xcc;return function(_0x2e8096){if(_0x2e8096){return _0x5eec2b[_0x6c6f('0x17')](_0x2e8a01);}return _0x5eec2b[_0x6c6f('0x18')](_0x2e8a01)[_0x6c6f('0x19')]();};}function respondWithResult(_0x1c4f29,_0x2f977f){_0x2f977f=_0x2f977f||0xc8;return function(_0x2fd39f){if(_0x2fd39f){return _0x1c4f29[_0x6c6f('0x18')](_0x2f977f)[_0x6c6f('0x1a')](_0x2fd39f);}};}function respondWithFilteredResult(_0x1cc7dd,_0x4e784d){return function(_0x50df4f){if(_0x50df4f){var _0x777b81=typeof _0x4e784d[_0x6c6f('0x1b')]===_0x6c6f('0x1c')&&typeof _0x4e784d[_0x6c6f('0x1d')]===_0x6c6f('0x1c');var _0x31c881=_0x50df4f[_0x6c6f('0x1e')];var _0x737436=_0x777b81?0x0:_0x4e784d[_0x6c6f('0x1b')];var _0x4b4d65=_0x777b81?_0x50df4f[_0x6c6f('0x1e')]:_0x4e784d[_0x6c6f('0x1b')]+_0x4e784d['limit'];var _0x11e97d;if(_0x4b4d65>=_0x31c881){_0x4b4d65=_0x31c881;_0x11e97d=0xc8;}else{_0x11e97d=0xce;}_0x1cc7dd['status'](_0x11e97d);return _0x1cc7dd[_0x6c6f('0x1f')](_0x6c6f('0x20'),_0x737436+'-'+_0x4b4d65+'/'+_0x31c881)[_0x6c6f('0x1a')](_0x50df4f);}return null;};}function patchUpdates(_0x342fd8){return function(_0x5bb17f){try{jsonpatch[_0x6c6f('0x21')](_0x5bb17f,_0x342fd8,!![]);}catch(_0x109a41){return BPromise[_0x6c6f('0x22')](_0x109a41);}return _0x5bb17f[_0x6c6f('0x23')]();};}function saveUpdates(_0x2f8c50,_0x3ebb95){return function(_0x3c0dc1){if(_0x3c0dc1){return _0x3c0dc1[_0x6c6f('0x24')](_0x2f8c50)['then'](function(_0x267be2){return _0x267be2;});}return null;};}function removeEntity(_0x592c09,_0x12347c){return function(_0x4b3e7b){if(_0x4b3e7b){return _0x4b3e7b[_0x6c6f('0x25')]()[_0x6c6f('0x26')](function(){_0x592c09['status'](0xcc)[_0x6c6f('0x19')]();});}};}function handleEntityNotFound(_0x37f352,_0x1cef1a){return function(_0x165228){if(!_0x165228){_0x37f352[_0x6c6f('0x17')](0x194);}return _0x165228;};}function handleError(_0x2ed8b5,_0x191efa){_0x191efa=_0x191efa||0x1f4;return function(_0x36a04f){logger[_0x6c6f('0x27')](_0x36a04f['stack']);if(_0x36a04f['name']){delete _0x36a04f['name'];}_0x2ed8b5[_0x6c6f('0x18')](_0x191efa)[_0x6c6f('0x28')](_0x36a04f);};}exports['index']=function(_0x3fff5d,_0x579902){var _0x52047c={},_0x569f14={},_0x2e173a={'count':0x0,'rows':[]};var _0x1a33b6=_[_0x6c6f('0x29')](db[_0x6c6f('0x2a')][_0x6c6f('0x2b')],function(_0x1f39a5){return{'name':_0x1f39a5['fieldName'],'type':_0x1f39a5['type']['key']};});_0x569f14[_0x6c6f('0x2c')]=_['map'](_0x1a33b6,_0x6c6f('0x2d'));_0x569f14[_0x6c6f('0x2e')]=_[_0x6c6f('0x2f')](_0x3fff5d[_0x6c6f('0x2e')]);_0x569f14['filters']=_['intersection'](_0x569f14[_0x6c6f('0x2c')],_0x569f14[_0x6c6f('0x2e')]);_0x52047c[_0x6c6f('0x30')]=_['intersection'](_0x569f14[_0x6c6f('0x2c')],qs[_0x6c6f('0x31')](_0x3fff5d['query'][_0x6c6f('0x31')]));_0x52047c[_0x6c6f('0x30')]=_0x52047c[_0x6c6f('0x30')]['length']?_0x52047c[_0x6c6f('0x30')]:_0x569f14[_0x6c6f('0x2c')];if(!_0x3fff5d[_0x6c6f('0x2e')]['hasOwnProperty'](_0x6c6f('0x32'))){_0x52047c[_0x6c6f('0x1d')]=qs[_0x6c6f('0x1d')](_0x3fff5d[_0x6c6f('0x2e')][_0x6c6f('0x1d')]);_0x52047c[_0x6c6f('0x1b')]=qs['offset'](_0x3fff5d[_0x6c6f('0x2e')]['offset']);}_0x52047c[_0x6c6f('0x33')]=qs['sort'](_0x3fff5d[_0x6c6f('0x2e')]['sort']);_0x52047c['where']=qs['filters'](_[_0x6c6f('0x34')](_0x3fff5d[_0x6c6f('0x2e')],_0x569f14[_0x6c6f('0x35')]),_0x1a33b6);if(_0x3fff5d[_0x6c6f('0x2e')]['filter']){_0x52047c[_0x6c6f('0x36')]=_[_0x6c6f('0x37')](_0x52047c['where'],{'$or':_[_0x6c6f('0x29')](_0x1a33b6,function(_0x464036){if(_0x464036[_0x6c6f('0x38')]!=='VIRTUAL'){var _0x4dbc1b={};_0x4dbc1b[_0x464036['name']]={'$like':'%'+_0x3fff5d[_0x6c6f('0x2e')]['filter']+'%'};return _0x4dbc1b;}})});}_0x52047c=_[_0x6c6f('0x37')]({},_0x52047c,_0x3fff5d[_0x6c6f('0x39')]);var _0x516ee2={'where':_0x52047c[_0x6c6f('0x36')]};return db[_0x6c6f('0x2a')][_0x6c6f('0x1e')](_0x516ee2)['then'](function(_0xecbd8c){_0x2e173a[_0x6c6f('0x1e')]=_0xecbd8c;if(_0x3fff5d['query']['includeAll']){_0x52047c[_0x6c6f('0x3a')]=[{'all':!![]}];}return db[_0x6c6f('0x2a')][_0x6c6f('0x3b')](_0x52047c);})[_0x6c6f('0x26')](function(_0x432a23){_0x2e173a[_0x6c6f('0x3c')]=_0x432a23;return _0x2e173a;})[_0x6c6f('0x26')](respondWithFilteredResult(_0x579902,_0x52047c))['catch'](handleError(_0x579902,null));};exports[_0x6c6f('0x3d')]=function(_0x1da4e6,_0x95fdd9){var _0x5d1b77={'raw':!![],'where':{'id':_0x1da4e6[_0x6c6f('0x3e')]['id']}},_0x5ee116={};_0x5ee116[_0x6c6f('0x2c')]=_[_0x6c6f('0x2f')](db[_0x6c6f('0x2a')][_0x6c6f('0x2b')]);_0x5ee116[_0x6c6f('0x2e')]=_[_0x6c6f('0x2f')](_0x1da4e6['query']);_0x5ee116[_0x6c6f('0x35')]=_[_0x6c6f('0x3f')](_0x5ee116[_0x6c6f('0x2c')],_0x5ee116[_0x6c6f('0x2e')]);_0x5d1b77['attributes']=_[_0x6c6f('0x3f')](_0x5ee116[_0x6c6f('0x2c')],qs[_0x6c6f('0x31')](_0x1da4e6[_0x6c6f('0x2e')]['fields']));_0x5d1b77['attributes']=_0x5d1b77[_0x6c6f('0x30')][_0x6c6f('0x40')]?_0x5d1b77[_0x6c6f('0x30')]:_0x5ee116[_0x6c6f('0x2c')];if(_0x1da4e6[_0x6c6f('0x2e')][_0x6c6f('0x41')]){_0x5d1b77[_0x6c6f('0x3a')]=[{'all':!![]}];}_0x5d1b77=_[_0x6c6f('0x37')]({},_0x5d1b77,_0x1da4e6[_0x6c6f('0x39')]);return db[_0x6c6f('0x2a')][_0x6c6f('0x42')](_0x5d1b77)[_0x6c6f('0x26')](handleEntityNotFound(_0x95fdd9,null))[_0x6c6f('0x26')](respondWithResult(_0x95fdd9,null))[_0x6c6f('0x43')](handleError(_0x95fdd9,null));};exports['create']=function(_0x31e4f2,_0x192750){return db[_0x6c6f('0x2a')][_0x6c6f('0x44')](_0x31e4f2[_0x6c6f('0x45')],{})[_0x6c6f('0x26')](respondWithResult(_0x192750,0xc9))[_0x6c6f('0x43')](handleError(_0x192750,null));};exports[_0x6c6f('0x24')]=function(_0x33445d,_0x3f393d){if(_0x33445d[_0x6c6f('0x45')]['id']){delete _0x33445d['body']['id'];}return db[_0x6c6f('0x2a')][_0x6c6f('0x42')]({'where':{'id':_0x33445d['params']['id']}})[_0x6c6f('0x26')](handleEntityNotFound(_0x3f393d,null))[_0x6c6f('0x26')](saveUpdates(_0x33445d['body'],null))[_0x6c6f('0x26')](respondWithResult(_0x3f393d,null))['catch'](handleError(_0x3f393d,null));};exports[_0x6c6f('0x25')]=function(_0x2f8de6,_0x164e04){return db[_0x6c6f('0x2a')]['find']({'where':{'id':_0x2f8de6['params']['id']}})[_0x6c6f('0x26')](handleEntityNotFound(_0x164e04,null))[_0x6c6f('0x26')](removeEntity(_0x164e04,null))['catch'](handleError(_0x164e04,null));};exports[_0x6c6f('0x46')]=function(_0x3d185f,_0x1a2bb9){return db[_0x6c6f('0x2a')][_0x6c6f('0x46')]()[_0x6c6f('0x26')](respondWithResult(_0x1a2bb9,null))[_0x6c6f('0x43')](handleError(_0x1a2bb9,null));}; \ No newline at end of file +var _0x0da7=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','catch','create','update','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','apply','save','then','destroy','sendStatus','error','stack','name','send','index','SquareDetailsReport','fieldName','key','map','query','keys','filters'];(function(_0x35240f,_0x1ddf57){var _0x1d04d4=function(_0x47d402){while(--_0x47d402){_0x35240f['push'](_0x35240f['shift']());}};_0x1d04d4(++_0x1ddf57);}(_0x0da7,0x17a));var _0x70da=function(_0x280221,_0x2d0576){_0x280221=_0x280221-0x0;var _0x11abd3=_0x0da7[_0x280221];return _0x11abd3;};'use strict';var emlformat=require(_0x70da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70da('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x70da('0x2'));var moment=require(_0x70da('0x3'));var BPromise=require(_0x70da('0x4'));var Mustache=require(_0x70da('0x5'));var util=require(_0x70da('0x6'));var path=require(_0x70da('0x7'));var sox=require(_0x70da('0x8'));var csv=require(_0x70da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x70da('0xa'));var squel=require(_0x70da('0xb'));var crypto=require('crypto');var jsforce=require(_0x70da('0xc'));var deskjs=require(_0x70da('0xd'));var toCsv=require(_0x70da('0x9'));var querystring=require(_0x70da('0xe'));var Papa=require(_0x70da('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x70da('0x10'));var as=require(_0x70da('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70da('0x12'))('api');var utils=require(_0x70da('0x13'));var config=require(_0x70da('0x14'));var licenseUtil=require(_0x70da('0x15'));var db=require(_0x70da('0x16'))['db'];function respondWithStatusCode(_0x168ab8,_0x516b9e){_0x516b9e=_0x516b9e||0xcc;return function(_0x36293a){if(_0x36293a){return _0x168ab8['sendStatus'](_0x516b9e);}return _0x168ab8[_0x70da('0x17')](_0x516b9e)[_0x70da('0x18')]();};}function respondWithResult(_0x31b48d,_0x51b024){_0x51b024=_0x51b024||0xc8;return function(_0x163f4c){if(_0x163f4c){return _0x31b48d[_0x70da('0x17')](_0x51b024)[_0x70da('0x19')](_0x163f4c);}};}function respondWithFilteredResult(_0x4f4176,_0x40c9cb){return function(_0x245a6e){if(_0x245a6e){var _0x1fc831=typeof _0x40c9cb['offset']===_0x70da('0x1a')&&typeof _0x40c9cb[_0x70da('0x1b')]===_0x70da('0x1a');var _0x45204f=_0x245a6e['count'];var _0xfecf39=_0x1fc831?0x0:_0x40c9cb[_0x70da('0x1c')];var _0xff7605=_0x1fc831?_0x245a6e[_0x70da('0x1d')]:_0x40c9cb['offset']+_0x40c9cb[_0x70da('0x1b')];var _0x3e8b12;if(_0xff7605>=_0x45204f){_0xff7605=_0x45204f;_0x3e8b12=0xc8;}else{_0x3e8b12=0xce;}_0x4f4176[_0x70da('0x17')](_0x3e8b12);return _0x4f4176[_0x70da('0x1e')]('Content-Range',_0xfecf39+'-'+_0xff7605+'/'+_0x45204f)[_0x70da('0x19')](_0x245a6e);}return null;};}function patchUpdates(_0x26ea88){return function(_0xea28d8){try{jsonpatch[_0x70da('0x1f')](_0xea28d8,_0x26ea88,!![]);}catch(_0x38b006){return BPromise['reject'](_0x38b006);}return _0xea28d8[_0x70da('0x20')]();};}function saveUpdates(_0x453290,_0x11701e){return function(_0xb0b45b){if(_0xb0b45b){return _0xb0b45b['update'](_0x453290)[_0x70da('0x21')](function(_0x3b4e27){return _0x3b4e27;});}return null;};}function removeEntity(_0x5b6446,_0x24da74){return function(_0x477598){if(_0x477598){return _0x477598[_0x70da('0x22')]()[_0x70da('0x21')](function(){_0x5b6446['status'](0xcc)[_0x70da('0x18')]();});}};}function handleEntityNotFound(_0x315aef,_0x4dc408){return function(_0x3ad018){if(!_0x3ad018){_0x315aef[_0x70da('0x23')](0x194);}return _0x3ad018;};}function handleError(_0x3260b2,_0x180b51){_0x180b51=_0x180b51||0x1f4;return function(_0x262259){logger[_0x70da('0x24')](_0x262259[_0x70da('0x25')]);if(_0x262259[_0x70da('0x26')]){delete _0x262259[_0x70da('0x26')];}_0x3260b2[_0x70da('0x17')](_0x180b51)[_0x70da('0x27')](_0x262259);};}exports[_0x70da('0x28')]=function(_0x3ab392,_0x78728d){var _0x33f98e={},_0x101f17={},_0x2440b6={'count':0x0,'rows':[]};var _0x3b2563=_['map'](db[_0x70da('0x29')]['rawAttributes'],function(_0xbb84d6){return{'name':_0xbb84d6[_0x70da('0x2a')],'type':_0xbb84d6['type'][_0x70da('0x2b')]};});_0x101f17['model']=_[_0x70da('0x2c')](_0x3b2563,'name');_0x101f17[_0x70da('0x2d')]=_[_0x70da('0x2e')](_0x3ab392[_0x70da('0x2d')]);_0x101f17[_0x70da('0x2f')]=_[_0x70da('0x30')](_0x101f17[_0x70da('0x31')],_0x101f17['query']);_0x33f98e[_0x70da('0x32')]=_['intersection'](_0x101f17[_0x70da('0x31')],qs[_0x70da('0x33')](_0x3ab392[_0x70da('0x2d')]['fields']));_0x33f98e[_0x70da('0x32')]=_0x33f98e[_0x70da('0x32')][_0x70da('0x34')]?_0x33f98e[_0x70da('0x32')]:_0x101f17['model'];if(!_0x3ab392[_0x70da('0x2d')][_0x70da('0x35')](_0x70da('0x36'))){_0x33f98e[_0x70da('0x1b')]=qs[_0x70da('0x1b')](_0x3ab392[_0x70da('0x2d')]['limit']);_0x33f98e['offset']=qs[_0x70da('0x1c')](_0x3ab392[_0x70da('0x2d')][_0x70da('0x1c')]);}_0x33f98e[_0x70da('0x37')]=qs['sort'](_0x3ab392[_0x70da('0x2d')]['sort']);_0x33f98e[_0x70da('0x38')]=qs[_0x70da('0x2f')](_['pick'](_0x3ab392['query'],_0x101f17[_0x70da('0x2f')]),_0x3b2563);if(_0x3ab392[_0x70da('0x2d')][_0x70da('0x39')]){_0x33f98e[_0x70da('0x38')]=_[_0x70da('0x3a')](_0x33f98e['where'],{'$or':_[_0x70da('0x2c')](_0x3b2563,function(_0x3a5b60){if(_0x3a5b60['type']!==_0x70da('0x3b')){var _0x709a64={};_0x709a64[_0x3a5b60[_0x70da('0x26')]]={'$like':'%'+_0x3ab392[_0x70da('0x2d')][_0x70da('0x39')]+'%'};return _0x709a64;}})});}_0x33f98e=_['merge']({},_0x33f98e,_0x3ab392[_0x70da('0x3c')]);var _0x466f70={'where':_0x33f98e['where']};return db[_0x70da('0x29')][_0x70da('0x1d')](_0x466f70)[_0x70da('0x21')](function(_0x1fa4c7){_0x2440b6[_0x70da('0x1d')]=_0x1fa4c7;if(_0x3ab392[_0x70da('0x2d')][_0x70da('0x3d')]){_0x33f98e[_0x70da('0x3e')]=[{'all':!![]}];}return db[_0x70da('0x29')]['findAll'](_0x33f98e);})[_0x70da('0x21')](function(_0x5629d8){_0x2440b6['rows']=_0x5629d8;return _0x2440b6;})[_0x70da('0x21')](respondWithFilteredResult(_0x78728d,_0x33f98e))['catch'](handleError(_0x78728d,null));};exports[_0x70da('0x3f')]=function(_0x272d4a,_0x504423){var _0x3b59c7={'raw':!![],'where':{'id':_0x272d4a[_0x70da('0x40')]['id']}},_0x46914a={};_0x46914a[_0x70da('0x31')]=_[_0x70da('0x2e')](db[_0x70da('0x29')]['rawAttributes']);_0x46914a['query']=_[_0x70da('0x2e')](_0x272d4a[_0x70da('0x2d')]);_0x46914a['filters']=_[_0x70da('0x30')](_0x46914a[_0x70da('0x31')],_0x46914a['query']);_0x3b59c7[_0x70da('0x32')]=_[_0x70da('0x30')](_0x46914a['model'],qs[_0x70da('0x33')](_0x272d4a[_0x70da('0x2d')][_0x70da('0x33')]));_0x3b59c7['attributes']=_0x3b59c7[_0x70da('0x32')][_0x70da('0x34')]?_0x3b59c7['attributes']:_0x46914a['model'];if(_0x272d4a['query'][_0x70da('0x3d')]){_0x3b59c7[_0x70da('0x3e')]=[{'all':!![]}];}_0x3b59c7=_[_0x70da('0x3a')]({},_0x3b59c7,_0x272d4a['options']);return db['SquareDetailsReport']['find'](_0x3b59c7)[_0x70da('0x21')](handleEntityNotFound(_0x504423,null))[_0x70da('0x21')](respondWithResult(_0x504423,null))[_0x70da('0x41')](handleError(_0x504423,null));};exports[_0x70da('0x42')]=function(_0x1e1b2f,_0x266204){return db[_0x70da('0x29')]['create'](_0x1e1b2f['body'],{})[_0x70da('0x21')](respondWithResult(_0x266204,0xc9))[_0x70da('0x41')](handleError(_0x266204,null));};exports[_0x70da('0x43')]=function(_0x4faad5,_0x4dd3cd){if(_0x4faad5['body']['id']){delete _0x4faad5[_0x70da('0x44')]['id'];}return db[_0x70da('0x29')]['find']({'where':{'id':_0x4faad5[_0x70da('0x40')]['id']}})[_0x70da('0x21')](handleEntityNotFound(_0x4dd3cd,null))[_0x70da('0x21')](saveUpdates(_0x4faad5[_0x70da('0x44')],null))[_0x70da('0x21')](respondWithResult(_0x4dd3cd,null))[_0x70da('0x41')](handleError(_0x4dd3cd,null));};exports['destroy']=function(_0x14a9ea,_0x4ba6c1){return db[_0x70da('0x29')][_0x70da('0x45')]({'where':{'id':_0x14a9ea[_0x70da('0x40')]['id']}})[_0x70da('0x21')](handleEntityNotFound(_0x4ba6c1,null))[_0x70da('0x21')](removeEntity(_0x4ba6c1,null))['catch'](handleError(_0x4ba6c1,null));};exports[_0x70da('0x46')]=function(_0x3facec,_0x2b642b){return db['SquareDetailsReport']['describe']()[_0x70da('0x21')](respondWithResult(_0x2b642b,null))[_0x70da('0x41')](handleError(_0x2b642b,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index a912762..c448e5f 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 _0x281d=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4df1f8,_0x51db09){var _0x27ecc3=function(_0x42767a){while(--_0x42767a){_0x4df1f8['push'](_0x4df1f8['shift']());}};_0x27ecc3(++_0x51db09);}(_0x281d,0xbe));var _0xd281=function(_0x9652fc,_0x54d492){_0x9652fc=_0x9652fc-0x0;var _0x193274=_0x281d[_0x9652fc];return _0x193274;};'use strict';var _=require('lodash');var util=require(_0xd281('0x0'));var logger=require(_0xd281('0x1'))(_0xd281('0x2'));var moment=require(_0xd281('0x3'));var BPromise=require(_0xd281('0x4'));var rp=require(_0xd281('0x5'));var fs=require('fs');var path=require(_0xd281('0x6'));var rimraf=require(_0xd281('0x7'));var config=require(_0xd281('0x8'));var attributes=require(_0xd281('0x9'));module[_0xd281('0xa')]=function(_0x12739a,_0x20938b){return _0x12739a[_0xd281('0xb')](_0xd281('0xc'),attributes,{'tableName':_0xd281('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcd9=['report_square_details','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xbcd9,0x1d5));var _0x9bcd=function(_0x4e2a27,_0x4cb7c4){_0x4e2a27=_0x4e2a27-0x0;var _0x4d7ea4=_0xbcd9[_0x4e2a27];return _0x4d7ea4;};'use strict';var _=require(_0x9bcd('0x0'));var util=require('util');var logger=require(_0x9bcd('0x1'))('api');var moment=require(_0x9bcd('0x2'));var BPromise=require(_0x9bcd('0x3'));var rp=require(_0x9bcd('0x4'));var fs=require('fs');var path=require(_0x9bcd('0x5'));var rimraf=require(_0x9bcd('0x6'));var config=require('../../config/environment');var attributes=require(_0x9bcd('0x7'));module[_0x9bcd('0x8')]=function(_0x1434fd,_0x22c5ee){return _0x1434fd[_0x9bcd('0x9')](_0x9bcd('0xa'),attributes,{'tableName':_0x9bcd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 340ee62..f750ad5 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 _0x25e7=['SquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareDetailsReport'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x25e7,0x1d6));var _0x725e=function(_0x5a2c7b,_0x441265){_0x5a2c7b=_0x5a2c7b-0x0;var _0x3ad931=_0x25e7[_0x5a2c7b];return _0x3ad931;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});}exports[_0x725e('0x16')]=function(_0x397e33){var _0x268438=this;return new Promise(function(_0x2811e7,_0x528e7d){return db[_0x725e('0x17')][_0x725e('0x18')](_0x397e33[_0x725e('0x19')],{'raw':_0x397e33[_0x725e('0x1a')]?_0x397e33[_0x725e('0x1a')][_0x725e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2fc416){logger[_0x725e('0xd')](_0x725e('0x16'),_0x397e33);logger[_0x725e('0x10')](_0x725e('0x16'),_0x397e33,JSON[_0x725e('0x1c')](_0x2fc416));_0x2811e7(_0x2fc416);})[_0x725e('0x15')](function(_0x262b01){logger[_0x725e('0x12')]('CreateSquareDetailsReport',_0x262b01[_0x725e('0x13')],_0x397e33);_0x528e7d(_0x268438[_0x725e('0x12')](0x1f4,_0x262b01[_0x725e('0x13')]));});});}; \ No newline at end of file +var _0xd5fc=['SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','create','body','options','CreateSquareDetailsReport','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xd5fc,0xae));var _0xcd5f=function(_0x5d0f0b,_0xe6c0c0){_0x5d0f0b=_0x5d0f0b-0x0;var _0x5c8516=_0xd5fc[_0x5d0f0b];return _0x5c8516;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd5f('0x1'));var fs=require('fs');var Redis=require(_0xcd5f('0x2'));var db=require(_0xcd5f('0x3'))['db'];var utils=require(_0xcd5f('0x4'));var logger=require(_0xcd5f('0x5'))(_0xcd5f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd5f('0x7'));var client=jayson['client'][_0xcd5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x159b3f,_0x5af696,_0x58d65d){return new BPromise(function(_0x4e668e,_0x102ce9){return client['request'](_0x159b3f,_0x58d65d)[_0xcd5f('0x9')](function(_0x3e63d4){logger['info'](_0xcd5f('0xa'),_0x5af696,'request\x20sent');logger[_0xcd5f('0xb')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5af696,_0xcd5f('0xc'),JSON[_0xcd5f('0xd')](_0x3e63d4));if(_0x3e63d4[_0xcd5f('0xe')]){if(_0x3e63d4[_0xcd5f('0xe')]['code']===0x1f4){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x102ce9(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x4e668e(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}else{logger[_0xcd5f('0x10')](_0xcd5f('0xa'),_0x5af696,_0xcd5f('0xc'));_0x4e668e(_0x3e63d4[_0xcd5f('0x11')]['message']);}})[_0xcd5f('0x12')](function(_0x33ab1a){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x33ab1a);_0x102ce9(_0x33ab1a);});});}exports['CreateSquareDetailsReport']=function(_0x1a4cb6){var _0x56a874=this;return new Promise(function(_0xb23761,_0x36c60c){return db['SquareDetailsReport'][_0xcd5f('0x13')](_0x1a4cb6[_0xcd5f('0x14')],{'raw':_0x1a4cb6['options']?_0x1a4cb6[_0xcd5f('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xcd5f('0x9')](function(_0x5c3c9f){logger['info'](_0xcd5f('0x16'),_0x1a4cb6);logger['debug']('CreateSquareDetailsReport',_0x1a4cb6,JSON['stringify'](_0x5c3c9f));_0xb23761(_0x5c3c9f);})[_0xcd5f('0x12')](function(_0x5c03b9){logger[_0xcd5f('0xe')](_0xcd5f('0x16'),_0x5c03b9[_0xcd5f('0xf')],_0x1a4cb6);_0x36c60c(_0x56a874[_0xcd5f('0xe')](0x1f4,_0x5c03b9[_0xcd5f('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c13359c..38c0c2b 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 _0x3887=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports'];(function(_0x26402e,_0x346618){var _0x1dd7e6=function(_0x23c7d1){while(--_0x23c7d1){_0x26402e['push'](_0x26402e['shift']());}};_0x1dd7e6(++_0x346618);}(_0x3887,0x198));var _0x7388=function(_0x1777e4,_0x38b4f8){_0x1777e4=_0x1777e4-0x0;var _0x21ecac=_0x3887[_0x1777e4];return _0x21ecac;};'use strict';var express=require('express');var router=express[_0x7388('0x0')]();var auth=require(_0x7388('0x1'));var controller=require(_0x7388('0x2'));router[_0x7388('0x3')]('/',auth[_0x7388('0x4')](),controller['index']);router['get'](_0x7388('0x5'),auth[_0x7388('0x4')](),controller[_0x7388('0x6')]);module[_0x7388('0x7')]=router; \ No newline at end of file +var _0xdd76=['../../components/auth/service','get','index','isAuthenticated','killProcess','exports','Router'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0xdd76,0x180));var _0x6dd7=function(_0xb8239e,_0x13beda){_0xb8239e=_0xb8239e-0x0;var _0x49cf10=_0xdd76[_0xb8239e];return _0x49cf10;};'use strict';var express=require('express');var router=express[_0x6dd7('0x0')]();var auth=require(_0x6dd7('0x1'));var controller=require('./system.controller');router[_0x6dd7('0x2')]('/',auth['isAuthenticated'](),controller[_0x6dd7('0x3')]);router[_0x6dd7('0x2')]('/process/:pid/kill',auth[_0x6dd7('0x4')](),controller[_0x6dd7('0x5')]);module[_0x6dd7('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 2292384..a81cc50 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 _0x13a9=['api','util','bluebird','error','inspect','name','status','send','index','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger'];(function(_0x3dd23c,_0x18c32f){var _0x520bf8=function(_0x462f87){while(--_0x462f87){_0x3dd23c['push'](_0x3dd23c['shift']());}};_0x520bf8(++_0x18c32f);}(_0x13a9,0x1ad));var _0x913a=function(_0x1a95d0,_0x114738){_0x1a95d0=_0x1a95d0-0x0;var _0xe87ab5=_0x13a9[_0x1a95d0];return _0xe87ab5;};'use strict';var info=require(_0x913a('0x0'));var exec=require(_0x913a('0x1'))['exec'];var logger=require(_0x913a('0x2'))(_0x913a('0x3'));var util=require(_0x913a('0x4'));var BPromise=require(_0x913a('0x5'));var _=require('lodash');function handleError(_0x42bc91,_0x11e8c6,_0x3f8d03){_0x11e8c6=_0x11e8c6||0x1f4;return function(_0x5ed05f){logger[_0x913a('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3f8d03,_0x11e8c6,util[_0x913a('0x7')](_0x5ed05f,{'showHidden':![],'depth':null}));delete _0x5ed05f[_0x913a('0x8')];_0x42bc91[_0x913a('0x9')](_0x11e8c6)[_0x913a('0xa')](_0x5ed05f);};}exports[_0x913a('0xb')]=function(_0x2e1dfe,_0x545fd4){return info['getAllData']()[_0x913a('0xc')](function(_0x4f289b){return _0x545fd4[_0x913a('0x9')](0xc8)[_0x913a('0xd')](_0x4f289b);})[_0x913a('0xe')](function(_0xc9d6c){return _0x545fd4['status'](0x1f4)[_0x913a('0xd')](_0xc9d6c);});};exports[_0x913a('0xf')]=function(_0xd6a248,_0x3d103e){var _0x56db8a=['components/import/cm'];return new BPromise(function(_0x42ca4d,_0x388ff3){return exec(util[_0x913a('0x10')](_0x913a('0x11'),_0xd6a248[_0x913a('0x12')][_0x913a('0x13')]),function(_0x4fa3ae,_0x1b9962,_0x4cebb7){if(_0x4fa3ae){return _0x388ff3(_0x4fa3ae);}return _0x42ca4d(_0x1b9962);});})['then'](function(_0x57f6a0){var _0x3c5564=![];var _0x51840c=_0x57f6a0[_0x913a('0x14')](/\n/);for(var _0x18393d=0x0,_0x53e206=_0x56db8a[_0x913a('0x15')];_0x18393d<_0x53e206,_0x3c5564===![];_0x18393d+=0x1){if(_0x57f6a0[_0x913a('0x16')](_0x56db8a[_0x18393d])>=0x0){_0x3c5564=!![];}}if(!_0x3c5564){throw new Error(util[_0x913a('0x10')](_0x913a('0x17'),_0xd6a248[_0x913a('0x12')][_0x913a('0x13')]));}process[_0x913a('0x18')](_0xd6a248[_0x913a('0x12')][_0x913a('0x13')],_0x913a('0x19'));return _0x3d103e[_0x913a('0x9')](0xc8)[_0x913a('0xd')]({'message':util[_0x913a('0x10')](_0x913a('0x1a'),_0xd6a248[_0x913a('0x12')][_0x913a('0x13')])});})['catch'](handleError(_0x3d103e,null,_0x913a('0xf')));}; \ No newline at end of file +var _0x524d=['catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','index','getAllData','then'];(function(_0x19c26c,_0x2c8fb9){var _0x33cc5d=function(_0x4ddae1){while(--_0x4ddae1){_0x19c26c['push'](_0x19c26c['shift']());}};_0x33cc5d(++_0x2c8fb9);}(_0x524d,0xb0));var _0xd524=function(_0x57ff75,_0x11ed3e){_0x57ff75=_0x57ff75-0x0;var _0x132ff9=_0x524d[_0x57ff75];return _0x132ff9;};'use strict';var info=require(_0xd524('0x0'));var exec=require(_0xd524('0x1'))[_0xd524('0x2')];var logger=require('../../config/logger')(_0xd524('0x3'));var util=require(_0xd524('0x4'));var BPromise=require(_0xd524('0x5'));var _=require('lodash');function handleError(_0x2b87ec,_0xa24a99,_0x424657){_0xa24a99=_0xa24a99||0x1f4;return function(_0x596b94){logger[_0xd524('0x6')](_0xd524('0x7'),_0x424657,_0xa24a99,util['inspect'](_0x596b94,{'showHidden':![],'depth':null}));delete _0x596b94[_0xd524('0x8')];_0x2b87ec[_0xd524('0x9')](_0xa24a99)['send'](_0x596b94);};}exports[_0xd524('0xa')]=function(_0x28a034,_0x1c1946){return info[_0xd524('0xb')]()[_0xd524('0xc')](function(_0x3210e2){return _0x1c1946[_0xd524('0x9')](0xc8)['json'](_0x3210e2);})[_0xd524('0xd')](function(_0x9097b4){return _0x1c1946[_0xd524('0x9')](0x1f4)[_0xd524('0xe')](_0x9097b4);});};exports['killProcess']=function(_0xbe001a,_0x447c51){var _0x4901e5=[_0xd524('0xf')];return new BPromise(function(_0x2e52a6,_0x586df0){return exec(util[_0xd524('0x10')](_0xd524('0x11'),_0xbe001a[_0xd524('0x12')][_0xd524('0x13')]),function(_0x4e4f0b,_0x2bafdd,_0x4b2a2a){if(_0x4e4f0b){return _0x586df0(_0x4e4f0b);}return _0x2e52a6(_0x2bafdd);});})[_0xd524('0xc')](function(_0x1cd321){var _0x1df4bd=![];var _0x294ffc=_0x1cd321['split'](/\n/);for(var _0x1785ad=0x0,_0x1a86b5=_0x4901e5[_0xd524('0x14')];_0x1785ad<_0x1a86b5,_0x1df4bd===![];_0x1785ad+=0x1){if(_0x1cd321[_0xd524('0x15')](_0x4901e5[_0x1785ad])>=0x0){_0x1df4bd=!![];}}if(!_0x1df4bd){throw new Error(util['format'](_0xd524('0x16'),_0xbe001a[_0xd524('0x12')][_0xd524('0x13')]));}process[_0xd524('0x17')](_0xbe001a[_0xd524('0x12')][_0xd524('0x13')],_0xd524('0x18'));return _0x447c51['status'](0xc8)[_0xd524('0xe')]({'message':util[_0xd524('0x10')](_0xd524('0x19'),_0xbe001a[_0xd524('0x12')]['pid'])});})[_0xd524('0xd')](handleError(_0x447c51,null,_0xd524('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index e252d65..d295294 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 _0x7529=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer','util'];(function(_0x433324,_0x38cb6e){var _0x5d90cc=function(_0x3751e2){while(--_0x3751e2){_0x433324['push'](_0x433324['shift']());}};_0x5d90cc(++_0x38cb6e);}(_0x7529,0x1c6));var _0x9752=function(_0x1c72f1,_0xf91024){_0x1c72f1=_0x1c72f1-0x0;var _0x450889=_0x7529[_0x1c72f1];return _0x450889;};'use strict';var multer=require(_0x9752('0x0'));var util=require(_0x9752('0x1'));var path=require(_0x9752('0x2'));var timeout=require(_0x9752('0x3'));var express=require(_0x9752('0x4'));var router=express[_0x9752('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9752('0x6'));var interaction=require(_0x9752('0x7'));var config=require(_0x9752('0x8'));var controller=require('./tag.controller');router['get']('/',auth[_0x9752('0x9')](),controller[_0x9752('0xa')]);router[_0x9752('0xb')](_0x9752('0xc'),auth[_0x9752('0x9')](),controller[_0x9752('0xd')]);router[_0x9752('0xe')]('/',auth[_0x9752('0x9')](),controller[_0x9752('0xf')]);router['put'](_0x9752('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9752('0x10')](_0x9752('0xc'),auth[_0x9752('0x9')](),controller[_0x9752('0x11')]);module[_0x9752('0x12')]=router; \ No newline at end of file +var _0x34b7=['isAuthenticated','/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x55230c,_0x3bf48a){var _0x3a761c=function(_0xa96239){while(--_0xa96239){_0x55230c['push'](_0x55230c['shift']());}};_0x3a761c(++_0x3bf48a);}(_0x34b7,0x1b7));var _0x734b=function(_0x263b4c,_0x2820bf){_0x263b4c=_0x263b4c-0x0;var _0x149bb1=_0x34b7[_0x263b4c];return _0x149bb1;};'use strict';var multer=require(_0x734b('0x0'));var util=require(_0x734b('0x1'));var path=require(_0x734b('0x2'));var timeout=require(_0x734b('0x3'));var express=require(_0x734b('0x4'));var router=express['Router']();var fs_extra=require(_0x734b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x734b('0x6'));var config=require(_0x734b('0x7'));var controller=require('./tag.controller');router[_0x734b('0x8')]('/',auth[_0x734b('0x9')](),controller['index']);router[_0x734b('0x8')](_0x734b('0xa'),auth[_0x734b('0x9')](),controller['show']);router[_0x734b('0xb')]('/',auth[_0x734b('0x9')](),controller[_0x734b('0xc')]);router[_0x734b('0xd')]('/:id',auth[_0x734b('0x9')](),controller['update']);router[_0x734b('0xe')](_0x734b('0xa'),auth[_0x734b('0x9')](),controller['destroy']);module[_0x734b('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 17ca405..01eaeb3 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 _0x8b1a=['STRING','#0091EA','sequelize','exports'];(function(_0xa04235,_0x41ada4){var _0x16caff=function(_0x4d4e71){while(--_0x4d4e71){_0xa04235['push'](_0xa04235['shift']());}};_0x16caff(++_0x41ada4);}(_0x8b1a,0x152));var _0xa8b1=function(_0x2b8543,_0x188a8a){_0x2b8543=_0x2b8543-0x0;var _0x49ca24=_0x8b1a[_0x2b8543];return _0x49ca24;};'use strict';var Sequelize=require(_0xa8b1('0x0'));module[_0xa8b1('0x1')]={'name':{'type':Sequelize[_0xa8b1('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa8b1('0x2')],'defaultValue':_0xa8b1('0x3')},'description':{'type':Sequelize[_0xa8b1('0x2')]}}; \ No newline at end of file +var _0xa478=['sequelize','exports','STRING','name','#0091EA'];(function(_0x3102d1,_0x2b731a){var _0x149a50=function(_0x2b942f){while(--_0x2b942f){_0x3102d1['push'](_0x3102d1['shift']());}};_0x149a50(++_0x2b731a);}(_0xa478,0x136));var _0x8a47=function(_0x55d911,_0x2b768c){_0x55d911=_0x55d911-0x0;var _0x3104c2=_0xa478[_0x55d911];return _0x3104c2;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'name':{'type':Sequelize[_0x8a47('0x2')],'unique':_0x8a47('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8a47('0x2')],'defaultValue':_0x8a47('0x4')},'description':{'type':Sequelize[_0x8a47('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 197ee7e..1c99fdf 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 _0xf109=['save','update','destroy','then','Tags','UserProfileResource','sendStatus','error','stack','name','send','map','Tag','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','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/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xf109,0xce));var _0x9f10=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xf109[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require(_0x9f10('0x0'));var rimraf=require(_0x9f10('0x1'));var zipdir=require(_0x9f10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f10('0x3'));var Mustache=require(_0x9f10('0x4'));var util=require(_0x9f10('0x5'));var path=require(_0x9f10('0x6'));var sox=require(_0x9f10('0x7'));var csv=require(_0x9f10('0x8'));var ejs=require(_0x9f10('0x9'));var fs=require('fs');var fs_extra=require(_0x9f10('0xa'));var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x8'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var as=require(_0x9f10('0x13'));var hardwareService=require(_0x9f10('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9f10('0x15'));var config=require(_0x9f10('0x16'));var licenseUtil=require(_0x9f10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289164,_0x260606){_0x260606=_0x260606||0xcc;return function(_0x35c529){if(_0x35c529){return _0x289164['sendStatus'](_0x260606);}return _0x289164[_0x9f10('0x18')](_0x260606)[_0x9f10('0x19')]();};}function respondWithResult(_0x5be443,_0x40a48a){_0x40a48a=_0x40a48a||0xc8;return function(_0x236e28){if(_0x236e28){return _0x5be443['status'](_0x40a48a)['json'](_0x236e28);}};}function respondWithFilteredResult(_0x2b6c4c,_0x177918){return function(_0x549217){if(_0x549217){var _0x11154b=typeof _0x177918['offset']===_0x9f10('0x1a')&&typeof _0x177918[_0x9f10('0x1b')]==='undefined';var _0x11cc56=_0x549217[_0x9f10('0x1c')];var _0x509fba=_0x11154b?0x0:_0x177918[_0x9f10('0x1d')];var _0x53bfbd=_0x11154b?_0x549217[_0x9f10('0x1c')]:_0x177918['offset']+_0x177918[_0x9f10('0x1b')];var _0x56fb44;if(_0x53bfbd>=_0x11cc56){_0x53bfbd=_0x11cc56;_0x56fb44=0xc8;}else{_0x56fb44=0xce;}_0x2b6c4c['status'](_0x56fb44);return _0x2b6c4c[_0x9f10('0x1e')](_0x9f10('0x1f'),_0x509fba+'-'+_0x53bfbd+'/'+_0x11cc56)[_0x9f10('0x20')](_0x549217);}return null;};}function patchUpdates(_0x3a78be){return function(_0xa810c){try{jsonpatch[_0x9f10('0x21')](_0xa810c,_0x3a78be,!![]);}catch(_0x27843d){return BPromise['reject'](_0x27843d);}return _0xa810c[_0x9f10('0x22')]();};}function saveUpdates(_0x58e6ba,_0x293990){return function(_0x36ace4){if(_0x36ace4){return _0x36ace4[_0x9f10('0x23')](_0x58e6ba)['then'](function(_0x2f31fb){return _0x2f31fb;});}return null;};}function removeEntity(_0x3dde2e,_0x213567){return function(_0x4d21c5){if(_0x4d21c5){return _0x4d21c5[_0x9f10('0x24')]()[_0x9f10('0x25')](function(){var _0x44b99d=_0x4d21c5['get']({'plain':!![]});var _0x2ec07d=_0x9f10('0x26');return db[_0x9f10('0x27')][_0x9f10('0x24')]({'where':{'type':_0x2ec07d,'resourceId':_0x44b99d['id']}})['then'](function(){return _0x4d21c5;});})['then'](function(){_0x3dde2e['status'](0xcc)[_0x9f10('0x19')]();});}};}function handleEntityNotFound(_0x4a0407,_0x314794){return function(_0x1de75a){if(!_0x1de75a){_0x4a0407[_0x9f10('0x28')](0x194);}return _0x1de75a;};}function handleError(_0x2ed95b,_0x2e11b1){_0x2e11b1=_0x2e11b1||0x1f4;return function(_0x4f6b0c){logger[_0x9f10('0x29')](_0x4f6b0c[_0x9f10('0x2a')]);if(_0x4f6b0c[_0x9f10('0x2b')]){delete _0x4f6b0c[_0x9f10('0x2b')];}_0x2ed95b[_0x9f10('0x18')](_0x2e11b1)[_0x9f10('0x2c')](_0x4f6b0c);};}exports['index']=function(_0x358d3f,_0x501ee){var _0x44207f={},_0x1b03ee={},_0x49b3f4={'count':0x0,'rows':[]};var _0x44f0a0=_[_0x9f10('0x2d')](db[_0x9f10('0x2e')]['rawAttributes'],function(_0x434128){return{'name':_0x434128['fieldName'],'type':_0x434128[_0x9f10('0x2f')][_0x9f10('0x30')]};});_0x1b03ee[_0x9f10('0x31')]=_['map'](_0x44f0a0,_0x9f10('0x2b'));_0x1b03ee[_0x9f10('0x32')]=_[_0x9f10('0x33')](_0x358d3f[_0x9f10('0x32')]);_0x1b03ee[_0x9f10('0x34')]=_['intersection'](_0x1b03ee[_0x9f10('0x31')],_0x1b03ee['query']);_0x44207f[_0x9f10('0x35')]=_[_0x9f10('0x36')](_0x1b03ee[_0x9f10('0x31')],qs[_0x9f10('0x37')](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x37')]));_0x44207f['attributes']=_0x44207f[_0x9f10('0x35')][_0x9f10('0x38')]?_0x44207f[_0x9f10('0x35')]:_0x1b03ee['model'];if(!_0x358d3f[_0x9f10('0x32')][_0x9f10('0x39')]('nolimit')){_0x44207f[_0x9f10('0x1b')]=qs['limit'](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x1b')]);_0x44207f[_0x9f10('0x1d')]=qs[_0x9f10('0x1d')](_0x358d3f[_0x9f10('0x32')][_0x9f10('0x1d')]);}_0x44207f[_0x9f10('0x3a')]=qs[_0x9f10('0x3b')](_0x358d3f['query'][_0x9f10('0x3b')]);_0x44207f[_0x9f10('0x3c')]=qs[_0x9f10('0x34')](_['pick'](_0x358d3f[_0x9f10('0x32')],_0x1b03ee[_0x9f10('0x34')]),_0x44f0a0);if(_0x358d3f['query'][_0x9f10('0x3d')]){_0x44207f[_0x9f10('0x3c')]=_[_0x9f10('0x3e')](_0x44207f['where'],{'$or':_['map'](_0x44f0a0,function(_0x2e4e2d){if(_0x2e4e2d[_0x9f10('0x2f')]!==_0x9f10('0x3f')){var _0x433e70={};_0x433e70[_0x2e4e2d[_0x9f10('0x2b')]]={'$like':'%'+_0x358d3f[_0x9f10('0x32')][_0x9f10('0x3d')]+'%'};return _0x433e70;}})});}_0x44207f=_[_0x9f10('0x3e')]({},_0x44207f,_0x358d3f[_0x9f10('0x40')]);var _0x149f8f={'where':_0x44207f[_0x9f10('0x3c')]};return db[_0x9f10('0x2e')]['count'](_0x149f8f)['then'](function(_0x4bb805){_0x49b3f4[_0x9f10('0x1c')]=_0x4bb805;if(_0x358d3f['query'][_0x9f10('0x41')]){_0x44207f[_0x9f10('0x42')]=[{'all':!![]}];}return db[_0x9f10('0x2e')]['findAll'](_0x44207f);})[_0x9f10('0x25')](function(_0xf1164){_0x49b3f4[_0x9f10('0x43')]=_0xf1164;return _0x49b3f4;})[_0x9f10('0x25')](respondWithFilteredResult(_0x501ee,_0x44207f))[_0x9f10('0x44')](handleError(_0x501ee,null));};exports['show']=function(_0x578368,_0x542a22){var _0x44bb34={'raw':!![],'where':{'id':_0x578368[_0x9f10('0x45')]['id']}},_0x5d08fb={};_0x5d08fb['model']=_[_0x9f10('0x33')](db[_0x9f10('0x2e')][_0x9f10('0x46')]);_0x5d08fb[_0x9f10('0x32')]=_['keys'](_0x578368[_0x9f10('0x32')]);_0x5d08fb[_0x9f10('0x34')]=_['intersection'](_0x5d08fb[_0x9f10('0x31')],_0x5d08fb[_0x9f10('0x32')]);_0x44bb34[_0x9f10('0x35')]=_[_0x9f10('0x36')](_0x5d08fb[_0x9f10('0x31')],qs[_0x9f10('0x37')](_0x578368[_0x9f10('0x32')][_0x9f10('0x37')]));_0x44bb34[_0x9f10('0x35')]=_0x44bb34[_0x9f10('0x35')]['length']?_0x44bb34[_0x9f10('0x35')]:_0x5d08fb[_0x9f10('0x31')];if(_0x578368['query'][_0x9f10('0x41')]){_0x44bb34[_0x9f10('0x42')]=[{'all':!![]}];}_0x44bb34=_[_0x9f10('0x3e')]({},_0x44bb34,_0x578368[_0x9f10('0x40')]);return db['Tag'][_0x9f10('0x47')](_0x44bb34)[_0x9f10('0x25')](handleEntityNotFound(_0x542a22,null))[_0x9f10('0x25')](respondWithResult(_0x542a22,null))[_0x9f10('0x44')](handleError(_0x542a22,null));};exports[_0x9f10('0x48')]=function(_0x43cb31,_0x479b46){return db[_0x9f10('0x2e')][_0x9f10('0x48')](_0x43cb31[_0x9f10('0x49')],{})[_0x9f10('0x25')](function(_0x5c8d13){var _0x1d5436=_0x43cb31['user'][_0x9f10('0x4a')]({'plain':!![]});if(!_0x1d5436)throw new Error(_0x9f10('0x4b'));if(_0x1d5436[_0x9f10('0x4c')]===_0x9f10('0x4d')){var _0x39dae3=_0x5c8d13[_0x9f10('0x4a')]({'plain':!![]});var _0x2b6fe7=_0x9f10('0x26');return db['UserProfileSection'][_0x9f10('0x47')]({'where':{'name':_0x2b6fe7,'userProfileId':_0x1d5436['userProfileId']},'raw':!![]})[_0x9f10('0x25')](function(_0x532808){if(_0x532808&&_0x532808[_0x9f10('0x4e')]===0x0){return db[_0x9f10('0x27')][_0x9f10('0x48')]({'name':_0x39dae3[_0x9f10('0x2b')],'resourceId':_0x39dae3['id'],'type':_0x532808[_0x9f10('0x2b')],'sectionId':_0x532808['id']},{})['then'](function(){return _0x5c8d13;});}else{return _0x5c8d13;}})[_0x9f10('0x44')](function(_0x63abfb){logger[_0x9f10('0x29')](_0x9f10('0x4f'),_0x63abfb);throw _0x63abfb;});}return _0x5c8d13;})['then'](respondWithResult(_0x479b46,0xc9))['catch'](handleError(_0x479b46,null));};exports[_0x9f10('0x23')]=function(_0x22e236,_0x4bd874){if(_0x22e236['body']['id']){delete _0x22e236[_0x9f10('0x49')]['id'];}return db[_0x9f10('0x2e')][_0x9f10('0x47')]({'where':{'id':_0x22e236['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x4bd874,null))[_0x9f10('0x25')](saveUpdates(_0x22e236[_0x9f10('0x49')],null))['then'](respondWithResult(_0x4bd874,null))[_0x9f10('0x44')](handleError(_0x4bd874,null));};exports[_0x9f10('0x24')]=function(_0xe18852,_0x48a76e){return db[_0x9f10('0x2e')][_0x9f10('0x47')]({'where':{'id':_0xe18852['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x48a76e,null))[_0x9f10('0x25')](removeEntity(_0x48a76e,null))[_0x9f10('0x44')](handleError(_0x48a76e,null));}; \ No newline at end of file +var _0xcffe=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','Tags','UserProfileResource','destroy','stack','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','Tag','includeAll','include','findAll','catch','params','fields','find','create','body','user','get','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3072ee,_0x1f69f2){var _0x33110a=function(_0x37305d){while(--_0x37305d){_0x3072ee['push'](_0x3072ee['shift']());}};_0x33110a(++_0x1f69f2);}(_0xcffe,0x1a1));var _0xecff=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0xcffe[_0x591781];return _0x315bd9;};'use strict';var emlformat=require(_0xecff('0x0'));var rimraf=require(_0xecff('0x1'));var zipdir=require(_0xecff('0x2'));var jsonpatch=require(_0xecff('0x3'));var rp=require(_0xecff('0x4'));var moment=require(_0xecff('0x5'));var BPromise=require(_0xecff('0x6'));var Mustache=require(_0xecff('0x7'));var util=require(_0xecff('0x8'));var path=require(_0xecff('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xecff('0xa'));var fs=require('fs');var fs_extra=require(_0xecff('0xb'));var _=require(_0xecff('0xc'));var squel=require(_0xecff('0xd'));var crypto=require(_0xecff('0xe'));var jsforce=require(_0xecff('0xf'));var deskjs=require(_0xecff('0x10'));var toCsv=require('to-csv');var querystring=require(_0xecff('0x11'));var Papa=require(_0xecff('0x12'));var Redis=require(_0xecff('0x13'));var authService=require(_0xecff('0x14'));var qs=require(_0xecff('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xecff('0x16'));var logger=require(_0xecff('0x17'))(_0xecff('0x18'));var utils=require(_0xecff('0x19'));var config=require(_0xecff('0x1a'));var licenseUtil=require(_0xecff('0x1b'));var db=require(_0xecff('0x1c'))['db'];function respondWithStatusCode(_0x32627c,_0x3e907d){_0x3e907d=_0x3e907d||0xcc;return function(_0x151a79){if(_0x151a79){return _0x32627c[_0xecff('0x1d')](_0x3e907d);}return _0x32627c[_0xecff('0x1e')](_0x3e907d)[_0xecff('0x1f')]();};}function respondWithResult(_0xb8745f,_0x5495f9){_0x5495f9=_0x5495f9||0xc8;return function(_0x4b1893){if(_0x4b1893){return _0xb8745f[_0xecff('0x1e')](_0x5495f9)[_0xecff('0x20')](_0x4b1893);}};}function respondWithFilteredResult(_0x558ecd,_0x35ce1f){return function(_0x362ed0){if(_0x362ed0){var _0x3a7623=typeof _0x35ce1f['offset']==='undefined'&&typeof _0x35ce1f[_0xecff('0x21')]===_0xecff('0x22');var _0x53ff8e=_0x362ed0[_0xecff('0x23')];var _0x3adc81=_0x3a7623?0x0:_0x35ce1f[_0xecff('0x24')];var _0x2393db=_0x3a7623?_0x362ed0[_0xecff('0x23')]:_0x35ce1f[_0xecff('0x24')]+_0x35ce1f['limit'];var _0x229728;if(_0x2393db>=_0x53ff8e){_0x2393db=_0x53ff8e;_0x229728=0xc8;}else{_0x229728=0xce;}_0x558ecd[_0xecff('0x1e')](_0x229728);return _0x558ecd[_0xecff('0x25')](_0xecff('0x26'),_0x3adc81+'-'+_0x2393db+'/'+_0x53ff8e)['json'](_0x362ed0);}return null;};}function patchUpdates(_0x4bb94e){return function(_0x2e2bdd){try{jsonpatch[_0xecff('0x27')](_0x2e2bdd,_0x4bb94e,!![]);}catch(_0x333eb7){return BPromise[_0xecff('0x28')](_0x333eb7);}return _0x2e2bdd[_0xecff('0x29')]();};}function saveUpdates(_0x494754,_0x14378d){return function(_0x520d6d){if(_0x520d6d){return _0x520d6d['update'](_0x494754)[_0xecff('0x2a')](function(_0x4fdc8e){return _0x4fdc8e;});}return null;};}function removeEntity(_0x2447da,_0x49c0cd){return function(_0x389281){if(_0x389281){return _0x389281['destroy']()[_0xecff('0x2a')](function(){var _0x44f5f7=_0x389281['get']({'plain':!![]});var _0x9f173d=_0xecff('0x2b');return db[_0xecff('0x2c')][_0xecff('0x2d')]({'where':{'type':_0x9f173d,'resourceId':_0x44f5f7['id']}})[_0xecff('0x2a')](function(){return _0x389281;});})['then'](function(){_0x2447da['status'](0xcc)[_0xecff('0x1f')]();});}};}function handleEntityNotFound(_0x484415,_0x1281d8){return function(_0x3ef198){if(!_0x3ef198){_0x484415[_0xecff('0x1d')](0x194);}return _0x3ef198;};}function handleError(_0x1dfeb6,_0x5c2360){_0x5c2360=_0x5c2360||0x1f4;return function(_0x4e7afa){logger['error'](_0x4e7afa[_0xecff('0x2e')]);if(_0x4e7afa[_0xecff('0x2f')]){delete _0x4e7afa[_0xecff('0x2f')];}_0x1dfeb6[_0xecff('0x1e')](_0x5c2360)['send'](_0x4e7afa);};}exports[_0xecff('0x30')]=function(_0x46372c,_0x1926a5){var _0x5f3c5c={},_0x1c9757={},_0x2c80a7={'count':0x0,'rows':[]};var _0x266ef7=_[_0xecff('0x31')](db['Tag'][_0xecff('0x32')],function(_0x350297){return{'name':_0x350297['fieldName'],'type':_0x350297[_0xecff('0x33')][_0xecff('0x34')]};});_0x1c9757[_0xecff('0x35')]=_[_0xecff('0x31')](_0x266ef7,'name');_0x1c9757[_0xecff('0x36')]=_[_0xecff('0x37')](_0x46372c[_0xecff('0x36')]);_0x1c9757['filters']=_[_0xecff('0x38')](_0x1c9757[_0xecff('0x35')],_0x1c9757[_0xecff('0x36')]);_0x5f3c5c[_0xecff('0x39')]=_[_0xecff('0x38')](_0x1c9757[_0xecff('0x35')],qs['fields'](_0x46372c['query']['fields']));_0x5f3c5c[_0xecff('0x39')]=_0x5f3c5c['attributes'][_0xecff('0x3a')]?_0x5f3c5c[_0xecff('0x39')]:_0x1c9757['model'];if(!_0x46372c[_0xecff('0x36')][_0xecff('0x3b')](_0xecff('0x3c'))){_0x5f3c5c['limit']=qs[_0xecff('0x21')](_0x46372c[_0xecff('0x36')][_0xecff('0x21')]);_0x5f3c5c['offset']=qs[_0xecff('0x24')](_0x46372c[_0xecff('0x36')][_0xecff('0x24')]);}_0x5f3c5c[_0xecff('0x3d')]=qs[_0xecff('0x3e')](_0x46372c[_0xecff('0x36')][_0xecff('0x3e')]);_0x5f3c5c[_0xecff('0x3f')]=qs[_0xecff('0x40')](_[_0xecff('0x41')](_0x46372c[_0xecff('0x36')],_0x1c9757['filters']),_0x266ef7);if(_0x46372c[_0xecff('0x36')][_0xecff('0x42')]){_0x5f3c5c[_0xecff('0x3f')]=_[_0xecff('0x43')](_0x5f3c5c[_0xecff('0x3f')],{'$or':_[_0xecff('0x31')](_0x266ef7,function(_0x1753a0){if(_0x1753a0[_0xecff('0x33')]!=='VIRTUAL'){var _0x28141f={};_0x28141f[_0x1753a0['name']]={'$like':'%'+_0x46372c[_0xecff('0x36')][_0xecff('0x42')]+'%'};return _0x28141f;}})});}_0x5f3c5c=_[_0xecff('0x43')]({},_0x5f3c5c,_0x46372c[_0xecff('0x44')]);var _0x1803e0={'where':_0x5f3c5c[_0xecff('0x3f')]};return db[_0xecff('0x45')]['count'](_0x1803e0)[_0xecff('0x2a')](function(_0x3dc857){_0x2c80a7['count']=_0x3dc857;if(_0x46372c['query'][_0xecff('0x46')]){_0x5f3c5c[_0xecff('0x47')]=[{'all':!![]}];}return db[_0xecff('0x45')][_0xecff('0x48')](_0x5f3c5c);})[_0xecff('0x2a')](function(_0xb9117c){_0x2c80a7['rows']=_0xb9117c;return _0x2c80a7;})[_0xecff('0x2a')](respondWithFilteredResult(_0x1926a5,_0x5f3c5c))[_0xecff('0x49')](handleError(_0x1926a5,null));};exports['show']=function(_0x8b0f59,_0x376b25){var _0xbdb51b={'raw':!![],'where':{'id':_0x8b0f59[_0xecff('0x4a')]['id']}},_0x4402a0={};_0x4402a0[_0xecff('0x35')]=_['keys'](db[_0xecff('0x45')][_0xecff('0x32')]);_0x4402a0[_0xecff('0x36')]=_['keys'](_0x8b0f59[_0xecff('0x36')]);_0x4402a0[_0xecff('0x40')]=_[_0xecff('0x38')](_0x4402a0[_0xecff('0x35')],_0x4402a0['query']);_0xbdb51b[_0xecff('0x39')]=_[_0xecff('0x38')](_0x4402a0['model'],qs[_0xecff('0x4b')](_0x8b0f59[_0xecff('0x36')]['fields']));_0xbdb51b[_0xecff('0x39')]=_0xbdb51b['attributes'][_0xecff('0x3a')]?_0xbdb51b[_0xecff('0x39')]:_0x4402a0[_0xecff('0x35')];if(_0x8b0f59[_0xecff('0x36')][_0xecff('0x46')]){_0xbdb51b[_0xecff('0x47')]=[{'all':!![]}];}_0xbdb51b=_['merge']({},_0xbdb51b,_0x8b0f59['options']);return db[_0xecff('0x45')][_0xecff('0x4c')](_0xbdb51b)[_0xecff('0x2a')](handleEntityNotFound(_0x376b25,null))[_0xecff('0x2a')](respondWithResult(_0x376b25,null))[_0xecff('0x49')](handleError(_0x376b25,null));};exports[_0xecff('0x4d')]=function(_0x36c50f,_0x3ac749){return db['Tag'][_0xecff('0x4d')](_0x36c50f[_0xecff('0x4e')],{})['then'](function(_0x262b3d){var _0x576aa9=_0x36c50f[_0xecff('0x4f')][_0xecff('0x50')]({'plain':!![]});if(!_0x576aa9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x576aa9[_0xecff('0x51')]===_0xecff('0x4f')){var _0x3e79f9=_0x262b3d[_0xecff('0x50')]({'plain':!![]});var _0x27cc00='Tags';return db['UserProfileSection'][_0xecff('0x4c')]({'where':{'name':_0x27cc00,'userProfileId':_0x576aa9[_0xecff('0x52')]},'raw':!![]})[_0xecff('0x2a')](function(_0x403838){if(_0x403838&&_0x403838[_0xecff('0x53')]===0x0){return db[_0xecff('0x2c')][_0xecff('0x4d')]({'name':_0x3e79f9[_0xecff('0x2f')],'resourceId':_0x3e79f9['id'],'type':_0x403838[_0xecff('0x2f')],'sectionId':_0x403838['id']},{})['then'](function(){return _0x262b3d;});}else{return _0x262b3d;}})[_0xecff('0x49')](function(_0x56fed4){logger[_0xecff('0x54')](_0xecff('0x55'),_0x56fed4);throw _0x56fed4;});}return _0x262b3d;})[_0xecff('0x2a')](respondWithResult(_0x3ac749,0xc9))['catch'](handleError(_0x3ac749,null));};exports[_0xecff('0x56')]=function(_0x5ebe66,_0x3afcd0){if(_0x5ebe66['body']['id']){delete _0x5ebe66['body']['id'];}return db[_0xecff('0x45')]['find']({'where':{'id':_0x5ebe66[_0xecff('0x4a')]['id']}})[_0xecff('0x2a')](handleEntityNotFound(_0x3afcd0,null))['then'](saveUpdates(_0x5ebe66[_0xecff('0x4e')],null))[_0xecff('0x2a')](respondWithResult(_0x3afcd0,null))[_0xecff('0x49')](handleError(_0x3afcd0,null));};exports[_0xecff('0x2d')]=function(_0x181760,_0x162938){return db[_0xecff('0x45')][_0xecff('0x4c')]({'where':{'id':_0x181760['params']['id']}})[_0xecff('0x2a')](handleEntityNotFound(_0x162938,null))[_0xecff('0x2a')](removeEntity(_0x162938,null))[_0xecff('0x49')](handleError(_0x162938,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 28f19a7..a313d94 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 _0xcf8d=['moment','bluebird','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0xcf8d,0x1a0));var _0xdcf8=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0xcf8d[_0x12a554];return _0x244ba0;};'use strict';var _=require(_0xdcf8('0x0'));var util=require(_0xdcf8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdcf8('0x2'));var BPromise=require(_0xdcf8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdcf8('0x4'));var config=require(_0xdcf8('0x5'));var attributes=require(_0xdcf8('0x6'));module[_0xdcf8('0x7')]=function(_0x42256f,_0xc1405f){return _0x42256f[_0xdcf8('0x8')](_0xdcf8('0x9'),attributes,{'tableName':_0xdcf8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1c0=['define','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x58bb00,_0x26a4dc){var _0x5ccf75=function(_0x40f80a){while(--_0x40f80a){_0x58bb00['push'](_0x58bb00['shift']());}};_0x5ccf75(++_0x26a4dc);}(_0xa1c0,0x145));var _0x0a1c=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa1c0[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0a1c('0x0'));var logger=require(_0x0a1c('0x1'))(_0x0a1c('0x2'));var moment=require(_0x0a1c('0x3'));var BPromise=require(_0x0a1c('0x4'));var rp=require(_0x0a1c('0x5'));var fs=require('fs');var path=require(_0x0a1c('0x6'));var rimraf=require(_0x0a1c('0x7'));var config=require(_0x0a1c('0x8'));var attributes=require(_0x0a1c('0x9'));module[_0x0a1c('0xa')]=function(_0x335c0b,_0x3fc9e8){return _0x335c0b[_0x0a1c('0xb')](_0x0a1c('0xc'),attributes,{'tableName':_0x0a1c('0xd'),'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 05fbe71..0ac0126 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 _0xf0ba=['rpc','jayson/promise','then','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var moment=require(_0xaf0b('0x2'));var BPromise=require(_0xaf0b('0x3'));var rs=require(_0xaf0b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf0b('0x5'))['db'];var utils=require(_0xaf0b('0x6'));var logger=require('../../config/logger')(_0xaf0b('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf0b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53b32d,_0x1d260e,_0x17b6d5){return new BPromise(function(_0x3439d5,_0xd67a9){return client['request'](_0x53b32d,_0x17b6d5)[_0xaf0b('0x9')](function(_0x4242b1){logger[_0xaf0b('0xa')]('Tag,\x20%s,\x20%s',_0x1d260e,_0xaf0b('0xb'));logger['debug'](_0xaf0b('0xc'),_0x1d260e,_0xaf0b('0xb'),JSON[_0xaf0b('0xd')](_0x4242b1));if(_0x4242b1['error']){if(_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0xf')]===0x1f4){logger[_0xaf0b('0xe')](_0xaf0b('0x10'),_0x1d260e,_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0x11')]);return _0xd67a9(_0x4242b1['error'][_0xaf0b('0x11')]);}logger[_0xaf0b('0xe')](_0xaf0b('0x10'),_0x1d260e,_0x4242b1[_0xaf0b('0xe')]['message']);return _0x3439d5(_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0x11')]);}else{logger[_0xaf0b('0xa')](_0xaf0b('0x10'),_0x1d260e,_0xaf0b('0xb'));_0x3439d5(_0x4242b1[_0xaf0b('0x12')][_0xaf0b('0x11')]);}})[_0xaf0b('0x13')](function(_0x4885da){logger[_0xaf0b('0xe')]('Tag,\x20%s,\x20%s',_0x1d260e,_0x4885da);_0xd67a9(_0x4885da);});});} \ No newline at end of file +var _0x79a8=['message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x79a8,0x1d0));var _0x879a=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x79a8[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var moment=require(_0x879a('0x1'));var BPromise=require(_0x879a('0x2'));var rs=require(_0x879a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x879a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x879a('0x5'))(_0x879a('0x6'));var config=require(_0x879a('0x7'));var jayson=require(_0x879a('0x8'));var client=jayson[_0x879a('0x9')][_0x879a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d353e,_0x2427bf,_0x4bf3ab){return new BPromise(function(_0xe27fe6,_0x5cb5c9){return client[_0x879a('0xb')](_0x1d353e,_0x4bf3ab)[_0x879a('0xc')](function(_0x5eba04){logger[_0x879a('0xd')](_0x879a('0xe'),_0x2427bf,_0x879a('0xf'));logger['debug'](_0x879a('0x10'),_0x2427bf,_0x879a('0xf'),JSON['stringify'](_0x5eba04));if(_0x5eba04['error']){if(_0x5eba04[_0x879a('0x11')][_0x879a('0x12')]===0x1f4){logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x5eba04['error'][_0x879a('0x13')]);return _0x5cb5c9(_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);}logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);return _0xe27fe6(_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);}else{logger[_0x879a('0xd')]('Tag,\x20%s,\x20%s',_0x2427bf,'request\x20sent');_0xe27fe6(_0x5eba04[_0x879a('0x14')][_0x879a('0x13')]);}})['catch'](function(_0x119260){logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x119260);_0x5cb5c9(_0x119260);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index bd73955..2423f92 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 46b3378..7526dcb 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(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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 _0xb10b=['name','sequelize','STRING'];(function(_0x2c5cb3,_0x2813fd){var _0x336264=function(_0x52ea7c){while(--_0x52ea7c){_0x2c5cb3['push'](_0x2c5cb3['shift']());}};_0x336264(++_0x2813fd);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ee935,_0x293a98){_0x3ee935=_0x3ee935-0x0;var _0x586db7=_0xb10b[_0x3ee935];return _0x586db7;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 4e14ee5..03fc2fa 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 _0xaf13=['isNil','format','all','spread','Mail','Openchannel','removeAgents','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','error','stack','name','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','Team','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','send','channel','ValidationError','Unknown\x20channel','Queue','toLowerCase','addQueues','findOne','isValidChannel','add','capitalize','Queues','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Whatsapp','transaction','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','QueueId','online','voicePause','interface','UserVoiceQueueRt','upsert'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0xaf13,0xa3));var _0x3af1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xaf13[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3af1('0x0'));var jsonpatch=require(_0x3af1('0x1'));var rp=require(_0x3af1('0x2'));var moment=require(_0x3af1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3af1('0x4'));var util=require(_0x3af1('0x5'));var path=require(_0x3af1('0x6'));var sox=require(_0x3af1('0x7'));var csv=require(_0x3af1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3af1('0x9'));var _=require(_0x3af1('0xa'));var squel=require(_0x3af1('0xb'));var crypto=require(_0x3af1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3af1('0xd'));var toCsv=require(_0x3af1('0x8'));var querystring=require(_0x3af1('0xe'));var Papa=require(_0x3af1('0xf'));var Redis=require(_0x3af1('0x10'));var authService=require(_0x3af1('0x11'));var qs=require(_0x3af1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3af1('0x13'));var logger=require(_0x3af1('0x14'))(_0x3af1('0x15'));var utils=require(_0x3af1('0x16'));var config=require(_0x3af1('0x17'));var licenseUtil=require(_0x3af1('0x18'));var db=require(_0x3af1('0x19'))['db'];config[_0x3af1('0x1a')]=_[_0x3af1('0x1b')](config[_0x3af1('0x1a')],{'host':_0x3af1('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3af1('0x1a')]));require(_0x3af1('0x1d'))[_0x3af1('0x1e')](socket);function respondWithStatusCode(_0x7202d2,_0x96b2ce){_0x96b2ce=_0x96b2ce||0xcc;return function(_0x3eef81){if(_0x3eef81){return _0x7202d2[_0x3af1('0x1f')](_0x96b2ce);}return _0x7202d2[_0x3af1('0x20')](_0x96b2ce)[_0x3af1('0x21')]();};}function respondWithResult(_0x2087bc,_0x489237){_0x489237=_0x489237||0xc8;return function(_0xa0c6bd){if(_0xa0c6bd){return _0x2087bc[_0x3af1('0x20')](_0x489237)[_0x3af1('0x22')](_0xa0c6bd);}};}function respondWithFilteredResult(_0x55ba8e,_0x34bc8e){return function(_0xf1742d){if(_0xf1742d){var _0x50357d=typeof _0x34bc8e[_0x3af1('0x23')]===_0x3af1('0x24')&&typeof _0x34bc8e['limit']===_0x3af1('0x24');var _0x18083b=_0xf1742d[_0x3af1('0x25')];var _0x545ce8=_0x50357d?0x0:_0x34bc8e[_0x3af1('0x23')];var _0x273436=_0x50357d?_0xf1742d[_0x3af1('0x25')]:_0x34bc8e[_0x3af1('0x23')]+_0x34bc8e[_0x3af1('0x26')];var _0x2e47b4;if(_0x273436>=_0x18083b){_0x273436=_0x18083b;_0x2e47b4=0xc8;}else{_0x2e47b4=0xce;}_0x55ba8e[_0x3af1('0x20')](_0x2e47b4);return _0x55ba8e[_0x3af1('0x27')]('Content-Range',_0x545ce8+'-'+_0x273436+'/'+_0x18083b)[_0x3af1('0x22')](_0xf1742d);}return null;};}function patchUpdates(_0x401a68){return function(_0x1005fa){try{jsonpatch[_0x3af1('0x28')](_0x1005fa,_0x401a68,!![]);}catch(_0x3a791b){return BPromise['reject'](_0x3a791b);}return _0x1005fa['save']();};}function saveUpdates(_0x34a876,_0x2ddc2e){return function(_0x546a9b){if(_0x546a9b){return _0x546a9b[_0x3af1('0x29')](_0x34a876)[_0x3af1('0x2a')](function(_0x405615){return _0x405615;});}return null;};}function handleEntityNotFound(_0x411c15,_0x543e46){return function(_0x410549){if(!_0x410549){_0x411c15['sendStatus'](0x194);}return _0x410549;};}function handleError(_0x2b15e0,_0x27189d){_0x27189d=_0x27189d||0x1f4;return function(_0x5a76e9){logger[_0x3af1('0x2b')](_0x5a76e9[_0x3af1('0x2c')]);if(_0x5a76e9['name']){delete _0x5a76e9[_0x3af1('0x2d')];}_0x2b15e0[_0x3af1('0x20')](_0x27189d)['send'](_0x5a76e9);};}exports['index']=function(_0x3bd207,_0x1d5706){var _0xe0f4fc={},_0x352a5e={},_0x36e14e={'count':0x0,'rows':[]};var _0x3d01e1=_['map'](db['Team'][_0x3af1('0x2e')],function(_0x1ad216){return{'name':_0x1ad216[_0x3af1('0x2f')],'type':_0x1ad216[_0x3af1('0x30')]['key']};});_0x352a5e['model']=_[_0x3af1('0x31')](_0x3d01e1,_0x3af1('0x2d'));_0x352a5e[_0x3af1('0x32')]=_['keys'](_0x3bd207[_0x3af1('0x32')]);_0x352a5e[_0x3af1('0x33')]=_[_0x3af1('0x34')](_0x352a5e[_0x3af1('0x35')],_0x352a5e['query']);_0xe0f4fc[_0x3af1('0x36')]=_[_0x3af1('0x34')](_0x352a5e[_0x3af1('0x35')],qs[_0x3af1('0x37')](_0x3bd207[_0x3af1('0x32')]['fields']));_0xe0f4fc[_0x3af1('0x36')]=_0xe0f4fc[_0x3af1('0x36')][_0x3af1('0x38')]?_0xe0f4fc[_0x3af1('0x36')]:_0x352a5e['model'];if(!_0x3bd207[_0x3af1('0x32')][_0x3af1('0x39')]('nolimit')){_0xe0f4fc[_0x3af1('0x26')]=qs[_0x3af1('0x26')](_0x3bd207[_0x3af1('0x32')][_0x3af1('0x26')]);_0xe0f4fc[_0x3af1('0x23')]=qs[_0x3af1('0x23')](_0x3bd207['query'][_0x3af1('0x23')]);}_0xe0f4fc[_0x3af1('0x3a')]=qs[_0x3af1('0x3b')](_0x3bd207[_0x3af1('0x32')][_0x3af1('0x3b')]);_0xe0f4fc[_0x3af1('0x3c')]=qs[_0x3af1('0x33')](_[_0x3af1('0x3d')](_0x3bd207[_0x3af1('0x32')],_0x352a5e[_0x3af1('0x33')]),_0x3d01e1);if(_0x3bd207[_0x3af1('0x32')][_0x3af1('0x3e')]){_0xe0f4fc[_0x3af1('0x3c')]=_['merge'](_0xe0f4fc[_0x3af1('0x3c')],{'$or':_[_0x3af1('0x31')](_0x3d01e1,function(_0x3d68f1){if(_0x3d68f1[_0x3af1('0x30')]!==_0x3af1('0x3f')){var _0x267f41={};_0x267f41[_0x3d68f1['name']]={'$like':'%'+_0x3bd207[_0x3af1('0x32')][_0x3af1('0x3e')]+'%'};return _0x267f41;}})});}_0xe0f4fc=_[_0x3af1('0x40')]({},_0xe0f4fc,_0x3bd207[_0x3af1('0x41')]);var _0x4e9560={'where':_0xe0f4fc[_0x3af1('0x3c')]};return db[_0x3af1('0x42')][_0x3af1('0x25')](_0x4e9560)['then'](function(_0xd3f71b){_0x36e14e[_0x3af1('0x25')]=_0xd3f71b;if(_0x3bd207[_0x3af1('0x32')][_0x3af1('0x43')]){_0xe0f4fc['include']=[{'all':!![]}];}return db['Team'][_0x3af1('0x44')](_0xe0f4fc);})[_0x3af1('0x2a')](function(_0xa06361){_0x36e14e[_0x3af1('0x45')]=_0xa06361;return _0x36e14e;})[_0x3af1('0x2a')](respondWithFilteredResult(_0x1d5706,_0xe0f4fc))[_0x3af1('0x46')](handleError(_0x1d5706,null));};exports[_0x3af1('0x47')]=function(_0x574761,_0x999230){var _0x36d519={'raw':![],'where':{'id':_0x574761[_0x3af1('0x48')]['id']}},_0x25998e={};_0x25998e['model']=_[_0x3af1('0x49')](db[_0x3af1('0x42')][_0x3af1('0x2e')]);_0x25998e['query']=_['keys'](_0x574761[_0x3af1('0x32')]);_0x25998e[_0x3af1('0x33')]=_[_0x3af1('0x34')](_0x25998e[_0x3af1('0x35')],_0x25998e[_0x3af1('0x32')]);_0x36d519[_0x3af1('0x36')]=_[_0x3af1('0x34')](_0x25998e['model'],qs[_0x3af1('0x37')](_0x574761[_0x3af1('0x32')]['fields']));_0x36d519['attributes']=_0x36d519[_0x3af1('0x36')][_0x3af1('0x38')]?_0x36d519[_0x3af1('0x36')]:_0x25998e[_0x3af1('0x35')];if(_0x574761[_0x3af1('0x32')][_0x3af1('0x43')]){_0x36d519[_0x3af1('0x4a')]=[{'all':!![]}];}_0x36d519=_['merge']({},_0x36d519,_0x574761[_0x3af1('0x41')]);return db[_0x3af1('0x42')]['find'](_0x36d519)[_0x3af1('0x2a')](handleEntityNotFound(_0x999230,null))['then'](respondWithResult(_0x999230,null))[_0x3af1('0x46')](handleError(_0x999230,null));};exports[_0x3af1('0x4b')]=function(_0x1f8237,_0x4fb3bc){return db[_0x3af1('0x42')]['create'](_0x1f8237[_0x3af1('0x4c')],{})[_0x3af1('0x2a')](function(_0x1c305){var _0x371e5a=_0x1f8237[_0x3af1('0x4d')][_0x3af1('0x4e')]({'plain':!![]});if(!_0x371e5a)throw new Error(_0x3af1('0x4f'));if(_0x371e5a[_0x3af1('0x50')]==='user'){var _0x58ef26=_0x1c305[_0x3af1('0x4e')]({'plain':!![]});var _0x244c82='Teams';return db[_0x3af1('0x51')][_0x3af1('0x52')]({'where':{'name':_0x244c82,'userProfileId':_0x371e5a['userProfileId']},'raw':!![]})[_0x3af1('0x2a')](function(_0x12a907){if(_0x12a907&&_0x12a907[_0x3af1('0x53')]===0x0){return db['UserProfileResource'][_0x3af1('0x4b')]({'name':_0x58ef26[_0x3af1('0x2d')],'resourceId':_0x58ef26['id'],'type':_0x12a907['name'],'sectionId':_0x12a907['id']},{})[_0x3af1('0x2a')](function(){return _0x1c305;});}else{return _0x1c305;}})[_0x3af1('0x46')](function(_0x3ffcfa){logger['error'](_0x3af1('0x54'),_0x3ffcfa);throw _0x3ffcfa;});}return _0x1c305;})[_0x3af1('0x2a')](respondWithResult(_0x4fb3bc,0xc9))[_0x3af1('0x46')](handleError(_0x4fb3bc,null));};exports[_0x3af1('0x29')]=function(_0x5bbebe,_0x179d37){if(_0x5bbebe['body']['id']){delete _0x5bbebe['body']['id'];}return db[_0x3af1('0x42')][_0x3af1('0x52')]({'where':{'id':_0x5bbebe[_0x3af1('0x48')]['id']}})[_0x3af1('0x2a')](handleEntityNotFound(_0x179d37,null))[_0x3af1('0x2a')](saveUpdates(_0x5bbebe[_0x3af1('0x4c')],null))[_0x3af1('0x2a')](respondWithResult(_0x179d37,null))[_0x3af1('0x46')](handleError(_0x179d37,null));};exports[_0x3af1('0x55')]=function(_0x169003,_0x43505a){var _0x5cb058=_0x169003['params']['id'];var _0x4430ab=[];return db['sequelize']['transaction'](function(_0x1133c4){var _0x4ee7f5=_0x3af1('0x56')+_0x5cb058;return db['sequelize']['query'](_0x4ee7f5,{'type':db[_0x3af1('0x57')][_0x3af1('0x58')][_0x3af1('0x59')],'raw':!![],'transaction':_0x1133c4})[_0x3af1('0x2a')](function(_0x50466f){_0x4430ab=_['map'](_0x50466f,function(_0x502fa4){return Number(_0x502fa4['UserId']);});})[_0x3af1('0x2a')](function(){var _0x12a9a3=_0x3af1('0x5a')+_0x5cb058;return db['sequelize'][_0x3af1('0x32')](_0x12a9a3,{'type':db[_0x3af1('0x57')][_0x3af1('0x58')][_0x3af1('0x59')],'raw':!![],'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(_0x4f1739){var _0x51a88c=_[_0x3af1('0x31')](_0x4f1739,function(_0x1c85ae){return Number(_0x1c85ae[_0x3af1('0x5b')]);});return db['UserVoiceQueue'][_0x3af1('0x55')]({'where':{'UserId':{'$in':_0x4430ab},'VoiceQueueId':{'$in':_0x51a88c}},'transaction':_0x1133c4});})['then'](function(){var _0x5a4408=_0x3af1('0x5c')+_0x5cb058;return db[_0x3af1('0x5d')][_0x3af1('0x32')](_0x5a4408,{'type':db['Sequelize'][_0x3af1('0x58')][_0x3af1('0x59')],'raw':!![],'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(_0x2e33cb){var _0x29f065=_[_0x3af1('0x31')](_0x2e33cb,function(_0x327af3){return Number(_0x327af3[_0x3af1('0x5e')]);});return db[_0x3af1('0x5f')][_0x3af1('0x55')]({'where':{'UserId':{'$in':_0x4430ab},'MailQueueId':{'$in':_0x29f065}},'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(){var _0x1b84de=_0x3af1('0x60')+_0x5cb058;return db[_0x3af1('0x5d')][_0x3af1('0x32')](_0x1b84de,{'type':db[_0x3af1('0x57')][_0x3af1('0x58')][_0x3af1('0x59')],'raw':!![],'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(_0x4dbb29){var _0x3bcd55=_[_0x3af1('0x31')](_0x4dbb29,function(_0x26ae6){return Number(_0x26ae6[_0x3af1('0x61')]);});return db[_0x3af1('0x62')][_0x3af1('0x55')]({'where':{'UserId':{'$in':_0x4430ab},'SmsQueueId':{'$in':_0x3bcd55}},'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(){var _0x4b0c88=_0x3af1('0x63')+_0x5cb058;return db['sequelize']['query'](_0x4b0c88,{'type':db[_0x3af1('0x57')][_0x3af1('0x58')][_0x3af1('0x59')],'raw':!![],'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(_0x48de85){var _0x2da8fe=_[_0x3af1('0x31')](_0x48de85,function(_0xdabb14){return Number(_0xdabb14['ChatQueueId']);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x4430ab},'ChatQueueId':{'$in':_0x2da8fe}},'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(){var _0x48888a=_0x3af1('0x64')+_0x5cb058;return db[_0x3af1('0x5d')][_0x3af1('0x32')](_0x48888a,{'type':db['Sequelize'][_0x3af1('0x58')][_0x3af1('0x59')],'raw':!![],'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(_0x2ddc9c){var _0x2ceda7=_[_0x3af1('0x31')](_0x2ddc9c,function(_0x4a6f54){return Number(_0x4a6f54[_0x3af1('0x65')]);});return db[_0x3af1('0x66')][_0x3af1('0x55')]({'where':{'UserId':{'$in':_0x4430ab},'FaxQueueId':{'$in':_0x2ceda7}},'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(){var _0x4b1568=_0x3af1('0x67')+_0x5cb058;return db['sequelize'][_0x3af1('0x32')](_0x4b1568,{'type':db[_0x3af1('0x57')][_0x3af1('0x58')]['SELECT'],'raw':!![],'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(_0x579941){var _0x5c01b6=_['map'](_0x579941,function(_0xfac090){return Number(_0xfac090['OpenchannelQueueId']);});return db[_0x3af1('0x68')][_0x3af1('0x55')]({'where':{'UserId':{'$in':_0x4430ab},'OpenchannelQueueId':{'$in':_0x5c01b6}},'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(){var _0x17f9da=_0x3af1('0x69')+_0x5cb058;return db[_0x3af1('0x5d')][_0x3af1('0x32')](_0x17f9da,{'type':db['Sequelize'][_0x3af1('0x58')][_0x3af1('0x59')],'raw':!![],'transaction':_0x1133c4});})['then'](function(_0x1fcc3f){var _0x13879f=_[_0x3af1('0x31')](_0x1fcc3f,function(_0x54267c){return Number(_0x54267c[_0x3af1('0x6a')]);});return db[_0x3af1('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x4430ab},'WhatsappQueueId':{'$in':_0x13879f}},'transaction':_0x1133c4});})['then'](function(){return db[_0x3af1('0x6c')][_0x3af1('0x52')]({'where':{'TeamId':_0x5cb058}});})[_0x3af1('0x2a')](function(_0x2eda2a){if(_0x2eda2a===null){return;}return db[_0x3af1('0x6d')][_0x3af1('0x55')]({'where':{'UserId':{'$in':_0x4430ab},'VoicePrefixId':_0x2eda2a[_0x3af1('0x6e')]},'transaction':_0x1133c4});})['then'](function(){return db[_0x3af1('0x42')][_0x3af1('0x55')]({'where':{'id':_0x5cb058},'cascade':!![],'transaction':_0x1133c4});})[_0x3af1('0x2a')](function(_0x319273){if(_0x319273===0x0){_0x43505a[_0x3af1('0x1f')](0x194);}else{return db[_0x3af1('0x6f')]['destroy']({'where':{'type':'Teams','resourceId':_0x5cb058},'cascade':!![],'transaction':_0x1133c4})['then'](function(){_0x43505a['status'](0xcc)[_0x3af1('0x21')]();});}})[_0x3af1('0x46')](function(_0x1dfa24){_0x43505a[_0x3af1('0x20')](0x1f4)[_0x3af1('0x70')](_0x1dfa24);});});};exports['getQueues']=function(_0x21c2f3,_0x3bf5b6,_0x228ca4){return db[_0x3af1('0x42')]['findOne']({'where':{'id':_0x21c2f3[_0x3af1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bf5b6,null))['then'](function(_0xfdcf95){if(!_0x21c2f3[_0x3af1('0x32')][_0x3af1('0x71')]||!utils['isValidChannel'](_0x21c2f3[_0x3af1('0x32')][_0x3af1('0x71')])){throw new db['Sequelize'][(_0x3af1('0x72'))](_0x3af1('0x73'));}var _0x293f1e={};var _0xd33cca={};_0xd33cca['model']=_[_0x3af1('0x49')](db[_['capitalize'](_0x21c2f3[_0x3af1('0x32')][_0x3af1('0x71')]['toLowerCase']())+_0x3af1('0x74')][_0x3af1('0x2e')]);_0xd33cca[_0x3af1('0x32')]=_[_0x3af1('0x49')](_0x21c2f3[_0x3af1('0x32')]);_0xd33cca[_0x3af1('0x33')]=_['intersection'](_0xd33cca['model'],_0xd33cca['query']);_0x293f1e[_0x3af1('0x36')]=_[_0x3af1('0x34')](_0xd33cca[_0x3af1('0x35')],qs[_0x3af1('0x37')](_0x21c2f3['query'][_0x3af1('0x37')]));_0x293f1e[_0x3af1('0x36')]=_0x293f1e['attributes']['length']?_0x293f1e[_0x3af1('0x36')]:_0xd33cca['model'];_0x293f1e[_0x3af1('0x26')]=qs[_0x3af1('0x26')](_0x21c2f3[_0x3af1('0x32')][_0x3af1('0x26')]);_0x293f1e[_0x3af1('0x23')]=qs[_0x3af1('0x23')](_0x21c2f3[_0x3af1('0x32')]['offset']);_0x293f1e[_0x3af1('0x3a')]=qs[_0x3af1('0x3b')](_0x21c2f3[_0x3af1('0x32')]['sort']);_0x293f1e['where']=qs['filters'](_['pick'](_0x21c2f3[_0x3af1('0x32')],_0xd33cca['filters']));_0x293f1e=_[_0x3af1('0x40')]({},_0x293f1e,_0x21c2f3['options']);return _0xfdcf95[_0x3af1('0x4e')+_['capitalize'](_0x21c2f3[_0x3af1('0x32')][_0x3af1('0x71')][_0x3af1('0x75')]())+'Queues'](_0x293f1e);})[_0x3af1('0x2a')](respondWithResult(_0x3bf5b6,null))[_0x3af1('0x46')](handleError(_0x3bf5b6,null));};exports[_0x3af1('0x76')]=function(_0x154874,_0x3ebcf0,_0x31f551){return db[_0x3af1('0x42')][_0x3af1('0x77')]({'where':{'id':_0x154874[_0x3af1('0x48')]['id']}})[_0x3af1('0x2a')](function(_0x199b2e){if(_0x199b2e){if(!_0x154874[_0x3af1('0x4c')]['channel']||!utils[_0x3af1('0x78')](_0x154874[_0x3af1('0x4c')][_0x3af1('0x71')])){throw new db[(_0x3af1('0x57'))]['ValidationError'](_0x3af1('0x73'));}return _0x199b2e[_0x3af1('0x79')+_[_0x3af1('0x7a')](_0x154874['body'][_0x3af1('0x71')][_0x3af1('0x75')]())+_0x3af1('0x7b')](_0x154874['body'][_0x3af1('0x7c')]);}return null;})[_0x3af1('0x2a')](handleEntityNotFound(_0x3ebcf0,null))[_0x3af1('0x2a')](respondWithStatusCode(_0x3ebcf0,null))[_0x3af1('0x46')](handleError(_0x3ebcf0,null));};exports[_0x3af1('0x7d')]=function(_0x48082e,_0x3229d1,_0x19c86e){return db[_0x3af1('0x42')]['findOne']({'where':{'id':_0x48082e[_0x3af1('0x48')]['id']}})[_0x3af1('0x2a')](function(_0x2c38a3){if(_0x2c38a3){if(!_0x48082e['query'][_0x3af1('0x71')]||!utils['isValidChannel'](_0x48082e[_0x3af1('0x32')][_0x3af1('0x71')])){throw new db[(_0x3af1('0x57'))][(_0x3af1('0x72'))](_0x3af1('0x73'));}return _0x2c38a3[_0x3af1('0x7e')+_[_0x3af1('0x7a')](_0x48082e[_0x3af1('0x32')][_0x3af1('0x71')][_0x3af1('0x75')]())+_0x3af1('0x7b')](_0x48082e[_0x3af1('0x32')][_0x3af1('0x7c')]);}return null;})[_0x3af1('0x2a')](handleEntityNotFound(_0x3229d1,null))[_0x3af1('0x2a')](respondWithStatusCode(_0x3229d1,null))[_0x3af1('0x46')](handleError(_0x3229d1,null));};exports[_0x3af1('0x7f')]=function(_0x4c7b3d,_0x1a326f){var _0x1f3978=_[_0x3af1('0x80')](_0x4c7b3d[_0x3af1('0x4c')]['ids'])?_0x4c7b3d['body'][_0x3af1('0x7c')]:[_0x4c7b3d[_0x3af1('0x4c')]['ids']];var _0x17606f=_0x4c7b3d[_0x3af1('0x48')]['id'];return db[_0x3af1('0x42')][_0x3af1('0x52')]({'where':{'id':_0x17606f}})[_0x3af1('0x2a')](handleEntityNotFound(_0x1a326f,null))[_0x3af1('0x2a')](function(_0x499a31){if(_0x499a31){var _0xcf4877=[_0x3af1('0x81'),_0x3af1('0x82'),'Mail',_0x3af1('0x83'),_0x3af1('0x84'),'Openchannel',_0x3af1('0x85')];return db[_0x3af1('0x5d')][_0x3af1('0x86')](function(_0x183bec){var _0xe157c2=_[_0x3af1('0x31')](_0xcf4877,function(_0x32c2a6){var _0x82b598={'attributes':['id',_0x3af1('0x2d')]};if(_0x32c2a6===_0x3af1('0x81')){_0x82b598['through']={'attributes':[_0x3af1('0x87')]};}return _0x499a31[_0x3af1('0x4e')+_0x32c2a6+_0x3af1('0x7b')](_0x82b598)[_0x3af1('0x2a')](function(_0x174c56){var _0x101a65=_['map'](_0x174c56,function(_0x372653){var _0x54e352=_[_0x3af1('0x31')](_0x1f3978,function(_0x1ff685){var _0x31b5c3={'where':{'UserId':_0x1ff685,[_0x32c2a6+'QueueId']:_0x372653['id']},'transaction':_0x183bec};if(_0x32c2a6===_0x3af1('0x81')){_0x31b5c3[_0x3af1('0x1b')]={'penalty':_0x372653[_0x3af1('0x88')][_0x3af1('0x87')]};}return db[_0x3af1('0x89')+_0x32c2a6+_0x3af1('0x74')][_0x3af1('0x8a')](_0x31b5c3)[_0x3af1('0x2a')](function(){socket[_0x3af1('0x8b')](_0x3af1('0x4d')+_0x32c2a6+_0x3af1('0x8c'),{'UserId':_0x1ff685,[_0x32c2a6+_0x3af1('0x8d')]:_0x372653['id']});if(_0x32c2a6!==_0x3af1('0x81')){return;}return db[_0x3af1('0x89')][_0x3af1('0x44')]({'where':{'id':_0x1f3978,'online':0x1},'attributes':['id',_0x3af1('0x2d'),_0x3af1('0x8e'),_0x3af1('0x8f'),_0x3af1('0x90')],'raw':!![]})['then'](function(_0x8d024c){var _0x4ba61b=_[_0x3af1('0x31')](_0x8d024c,function(_0x48668f){return db[_0x3af1('0x91')][_0x3af1('0x92')]({'membername':_0x48668f[_0x3af1('0x2d')],'UserId':_0x48668f['id'],'queue_name':_0x372653[_0x3af1('0x2d')],'VoiceQueueId':_0x372653['id'],'interface':_[_0x3af1('0x93')](_0x48668f['interface'])?util[_0x3af1('0x94')]('SIP/%s',_0x48668f[_0x3af1('0x2d')]):_0x48668f[_0x3af1('0x90')],'paused':_0x48668f[_0x3af1('0x8f')]||![],'penalty':_0x372653[_0x3af1('0x88')][_0x3af1('0x87')]},{'transaction':_0x183bec});});return Promise['all'](_0x4ba61b);});});});return Promise[_0x3af1('0x95')](_0x54e352);});return Promise['all'](_0x101a65);})[_0x3af1('0x2a')](function(){return db['TeamVoicePrefix'][_0x3af1('0x77')]({'where':{'teamId':_0x17606f}})[_0x3af1('0x2a')](function(_0x198fc1){if(_0x198fc1){var _0x746110=_[_0x3af1('0x31')](_0x1f3978,function(_0x5cc896){db[_0x3af1('0x6d')]['upsert']({'UserId':_0x5cc896,'VoicePrefixId':_0x198fc1[_0x3af1('0x6e')]});});return Promise[_0x3af1('0x95')](_0x746110);}});});});return Promise['all'](_0xe157c2)[_0x3af1('0x2a')](function(){return _0x499a31[_0x3af1('0x7f')](_0x1f3978,{'transaction':_0x183bec})[_0x3af1('0x96')](function(_0x1ad7e6){return _0x1ad7e6;});});});}})[_0x3af1('0x2a')](respondWithResult(_0x1a326f,null))[_0x3af1('0x46')](handleError(_0x1a326f,null));};exports['removeAgents']=function(_0x28f158,_0x41a782){var _0x4b2173=_['isArray'](_0x28f158[_0x3af1('0x32')][_0x3af1('0x7c')])?_0x28f158[_0x3af1('0x32')][_0x3af1('0x7c')]:[_0x28f158['query'][_0x3af1('0x7c')]];var _0x5ba3dd=_0x28f158[_0x3af1('0x48')]['id'];return db[_0x3af1('0x42')][_0x3af1('0x52')]({'where':{'id':_0x5ba3dd}})[_0x3af1('0x2a')](handleEntityNotFound(_0x41a782,null))[_0x3af1('0x2a')](function(_0x3da047){if(_0x3da047){var _0x1b6968=[_0x3af1('0x81'),'Chat',_0x3af1('0x97'),'Sms','Fax',_0x3af1('0x98'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x97b26d){var _0x3089f1=_[_0x3af1('0x31')](_0x1b6968,function(_0x380d86){var _0x553d44={'attributes':['id',_0x3af1('0x2d')]};return _0x3da047[_0x3af1('0x4e')+_0x380d86+_0x3af1('0x7b')](_0x553d44)[_0x3af1('0x2a')](function(_0x2210ed){var _0x38892e=_[_0x3af1('0x31')](_0x2210ed,function(_0x2c7021){return _0x2c7021[_0x3af1('0x99')](_0x4b2173,{'transaction':_0x97b26d})[_0x3af1('0x2a')](function(){var _0x16a90f=_[_0x3af1('0x31')](_0x4b2173,function(_0x262573){socket[_0x3af1('0x8b')](_0x3af1('0x4d')+_0x380d86+'Queue:remove',{'UserId':Number(_0x262573),[_0x380d86+'QueueId']:_0x2c7021['id']});if(_0x380d86!==_0x3af1('0x81')){return;}return db[_0x3af1('0x91')]['destroy']({'where':{'VoiceQueueId':_0x2c7021['id'],'UserId':_0x262573},'transaction':_0x97b26d});});return Promise[_0x3af1('0x95')](_0x16a90f);});});return Promise[_0x3af1('0x95')](_0x38892e);});});return Promise['all'](_0x3089f1)[_0x3af1('0x2a')](function(){return _0x3da047[_0x3af1('0x99')](_0x4b2173,{'transaction':_0x97b26d});})[_0x3af1('0x2a')](function(){return db[_0x3af1('0x6c')][_0x3af1('0x77')]({'where':{'teamId':_0x5ba3dd}})[_0x3af1('0x2a')](function(_0x42665b){if(_0x42665b){var _0x4f8776=_[_0x3af1('0x31')](_0x4b2173,function(_0x3f8f86){db['UserVoicePrefix'][_0x3af1('0x55')]({'where':{'UserId':_0x3f8f86,'VoicePrefixId':_0x42665b['VoicePrefixId']}});});return Promise[_0x3af1('0x95')](_0x4f8776);}});});});}})[_0x3af1('0x2a')](respondWithStatusCode(_0x41a782,null))[_0x3af1('0x46')](handleError(_0x41a782,null));};exports['getAgents']=function(_0x39f117,_0x2973d4,_0x225ffc){var _0x3672b={};var _0x83d900={};var _0x70b426;var _0x7dd267;return db['Team'][_0x3af1('0x77')]({'where':{'id':_0x39f117[_0x3af1('0x48')]['id']}})[_0x3af1('0x2a')](handleEntityNotFound(_0x2973d4,null))[_0x3af1('0x2a')](function(_0x358134){if(_0x358134){_0x70b426=_0x358134;_0x83d900[_0x3af1('0x35')]=_[_0x3af1('0x49')](db[_0x3af1('0x89')][_0x3af1('0x2e')]);_0x83d900['query']=_['keys'](_0x39f117[_0x3af1('0x32')]);_0x83d900[_0x3af1('0x33')]=_['intersection'](_0x83d900[_0x3af1('0x35')],_0x83d900[_0x3af1('0x32')]);_0x3672b[_0x3af1('0x36')]=_[_0x3af1('0x34')](_0x83d900[_0x3af1('0x35')],qs['fields'](_0x39f117[_0x3af1('0x32')][_0x3af1('0x37')]));_0x3672b[_0x3af1('0x36')]=_0x3672b[_0x3af1('0x36')][_0x3af1('0x38')]?_0x3672b['attributes']:_0x83d900[_0x3af1('0x35')];_0x3672b[_0x3af1('0x3a')]=qs[_0x3af1('0x3b')](_0x39f117[_0x3af1('0x32')][_0x3af1('0x3b')]);_0x3672b[_0x3af1('0x3c')]=qs[_0x3af1('0x33')](_['pick'](_0x39f117['query'],_0x83d900[_0x3af1('0x33')]));if(_0x39f117[_0x3af1('0x32')]['filter']){_0x3672b[_0x3af1('0x3c')]=_[_0x3af1('0x40')](_0x3672b[_0x3af1('0x3c')],{'$or':_['map'](_0x3672b[_0x3af1('0x36')],function(_0x41bf89){var _0x1454e9={};_0x1454e9[_0x41bf89]={'$like':'%'+_0x39f117[_0x3af1('0x32')][_0x3af1('0x3e')]+'%'};return _0x1454e9;})});}_0x3672b=_[_0x3af1('0x40')]({},_0x3672b,_0x39f117[_0x3af1('0x41')]);return _0x70b426[_0x3af1('0x9a')](_0x3672b);}})[_0x3af1('0x2a')](function(_0x33512c){if(_0x33512c){_0x7dd267=_0x33512c['length'];if(!_0x39f117['query'][_0x3af1('0x39')]('nolimit')){_0x3672b[_0x3af1('0x26')]=qs[_0x3af1('0x26')](_0x39f117['query'][_0x3af1('0x26')]);_0x3672b[_0x3af1('0x23')]=qs['offset'](_0x39f117[_0x3af1('0x32')][_0x3af1('0x23')]);}return _0x70b426[_0x3af1('0x9a')](_0x3672b);}})[_0x3af1('0x2a')](function(_0x4b917f){if(_0x4b917f){return _0x4b917f?{'count':_0x7dd267,'rows':_0x4b917f}:null;}})['then'](respondWithResult(_0x2973d4,null))['catch'](handleError(_0x2973d4,null));}; \ No newline at end of file +var _0x399d=['Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','UserProfileResource','getQueues','findOne','isValidChannel','channel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','ValidationError','add','removeQueues','ids','addAgents','Chat','Mail','Sms','Openchannel','Whatsapp','Voice','through','User','findOrCreate','Queue:save','QueueId','online','voicePause','interface','upsert','isNil','format','SIP/%s','TeamVoiceQueue','penalty','all','VoicePrefixId','spread','removeAgents','isArray','Fax','Queue:remove','UserVoiceQueueRt','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','end','json','undefined','limit','offset','status','set','apply','reject','save','update','sendStatus','name','send','index','Team','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','count','includeAll','include','findAll','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction'];(function(_0x6c6c50,_0x51202c){var _0x188c84=function(_0xe68972){while(--_0xe68972){_0x6c6c50['push'](_0x6c6c50['shift']());}};_0x188c84(++_0x51202c);}(_0x399d,0xe4));var _0xd399=function(_0x79e33f,_0x3ca4a2){_0x79e33f=_0x79e33f-0x0;var _0x11fc46=_0x399d[_0x79e33f];return _0x11fc46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd399('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd399('0x1'));var rp=require(_0xd399('0x2'));var moment=require(_0xd399('0x3'));var BPromise=require(_0xd399('0x4'));var Mustache=require(_0xd399('0x5'));var util=require('util');var path=require(_0xd399('0x6'));var sox=require('sox');var csv=require(_0xd399('0x7'));var ejs=require(_0xd399('0x8'));var fs=require('fs');var fs_extra=require(_0xd399('0x9'));var _=require('lodash');var squel=require(_0xd399('0xa'));var crypto=require(_0xd399('0xb'));var jsforce=require(_0xd399('0xc'));var deskjs=require(_0xd399('0xd'));var toCsv=require(_0xd399('0x7'));var querystring=require(_0xd399('0xe'));var Papa=require(_0xd399('0xf'));var Redis=require(_0xd399('0x10'));var authService=require(_0xd399('0x11'));var qs=require(_0xd399('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd399('0x13'));var logger=require('../../config/logger')(_0xd399('0x14'));var utils=require(_0xd399('0x15'));var config=require(_0xd399('0x16'));var licenseUtil=require(_0xd399('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd399('0x18')](config[_0xd399('0x19')],{'host':_0xd399('0x1a'),'port':0x18eb});var socket=require(_0xd399('0x1b'))(new Redis(config[_0xd399('0x19')]));require(_0xd399('0x1c'))['register'](socket);function respondWithStatusCode(_0x3f9045,_0x117ab1){_0x117ab1=_0x117ab1||0xcc;return function(_0x4fa7ed){if(_0x4fa7ed){return _0x3f9045['sendStatus'](_0x117ab1);}return _0x3f9045['status'](_0x117ab1)[_0xd399('0x1d')]();};}function respondWithResult(_0x5c0c16,_0x4ccff6){_0x4ccff6=_0x4ccff6||0xc8;return function(_0x13e6fb){if(_0x13e6fb){return _0x5c0c16['status'](_0x4ccff6)[_0xd399('0x1e')](_0x13e6fb);}};}function respondWithFilteredResult(_0x3c435b,_0x206744){return function(_0x5b9fbc){if(_0x5b9fbc){var _0x19ce50=typeof _0x206744['offset']===_0xd399('0x1f')&&typeof _0x206744[_0xd399('0x20')]===_0xd399('0x1f');var _0x4871d1=_0x5b9fbc['count'];var _0x198ec4=_0x19ce50?0x0:_0x206744[_0xd399('0x21')];var _0x2e40d7=_0x19ce50?_0x5b9fbc['count']:_0x206744[_0xd399('0x21')]+_0x206744[_0xd399('0x20')];var _0x52504c;if(_0x2e40d7>=_0x4871d1){_0x2e40d7=_0x4871d1;_0x52504c=0xc8;}else{_0x52504c=0xce;}_0x3c435b[_0xd399('0x22')](_0x52504c);return _0x3c435b[_0xd399('0x23')]('Content-Range',_0x198ec4+'-'+_0x2e40d7+'/'+_0x4871d1)[_0xd399('0x1e')](_0x5b9fbc);}return null;};}function patchUpdates(_0x4e39ef){return function(_0x357117){try{jsonpatch[_0xd399('0x24')](_0x357117,_0x4e39ef,!![]);}catch(_0x179c49){return BPromise[_0xd399('0x25')](_0x179c49);}return _0x357117[_0xd399('0x26')]();};}function saveUpdates(_0x585e1c,_0x5ae181){return function(_0x164ac5){if(_0x164ac5){return _0x164ac5[_0xd399('0x27')](_0x585e1c)['then'](function(_0x3a8520){return _0x3a8520;});}return null;};}function handleEntityNotFound(_0x5d8cee,_0x3a729c){return function(_0x2ba64a){if(!_0x2ba64a){_0x5d8cee[_0xd399('0x28')](0x194);}return _0x2ba64a;};}function handleError(_0x106371,_0x538e26){_0x538e26=_0x538e26||0x1f4;return function(_0xbd443e){logger['error'](_0xbd443e['stack']);if(_0xbd443e['name']){delete _0xbd443e[_0xd399('0x29')];}_0x106371['status'](_0x538e26)[_0xd399('0x2a')](_0xbd443e);};}exports[_0xd399('0x2b')]=function(_0x30d50c,_0x564604){var _0x4bdcda={},_0xaf916d={},_0x218c99={'count':0x0,'rows':[]};var _0x3f2364=_['map'](db[_0xd399('0x2c')][_0xd399('0x2d')],function(_0x99dd93){return{'name':_0x99dd93[_0xd399('0x2e')],'type':_0x99dd93[_0xd399('0x2f')][_0xd399('0x30')]};});_0xaf916d['model']=_[_0xd399('0x31')](_0x3f2364,_0xd399('0x29'));_0xaf916d[_0xd399('0x32')]=_[_0xd399('0x33')](_0x30d50c['query']);_0xaf916d['filters']=_[_0xd399('0x34')](_0xaf916d[_0xd399('0x35')],_0xaf916d[_0xd399('0x32')]);_0x4bdcda['attributes']=_[_0xd399('0x34')](_0xaf916d[_0xd399('0x35')],qs['fields'](_0x30d50c[_0xd399('0x32')][_0xd399('0x36')]));_0x4bdcda[_0xd399('0x37')]=_0x4bdcda['attributes'][_0xd399('0x38')]?_0x4bdcda['attributes']:_0xaf916d[_0xd399('0x35')];if(!_0x30d50c['query'][_0xd399('0x39')](_0xd399('0x3a'))){_0x4bdcda[_0xd399('0x20')]=qs[_0xd399('0x20')](_0x30d50c[_0xd399('0x32')]['limit']);_0x4bdcda[_0xd399('0x21')]=qs['offset'](_0x30d50c['query']['offset']);}_0x4bdcda[_0xd399('0x3b')]=qs[_0xd399('0x3c')](_0x30d50c[_0xd399('0x32')][_0xd399('0x3c')]);_0x4bdcda[_0xd399('0x3d')]=qs[_0xd399('0x3e')](_[_0xd399('0x3f')](_0x30d50c[_0xd399('0x32')],_0xaf916d['filters']),_0x3f2364);if(_0x30d50c['query'][_0xd399('0x40')]){_0x4bdcda[_0xd399('0x3d')]=_[_0xd399('0x41')](_0x4bdcda[_0xd399('0x3d')],{'$or':_['map'](_0x3f2364,function(_0x1eb00c){if(_0x1eb00c[_0xd399('0x2f')]!==_0xd399('0x42')){var _0x3477bb={};_0x3477bb[_0x1eb00c[_0xd399('0x29')]]={'$like':'%'+_0x30d50c[_0xd399('0x32')][_0xd399('0x40')]+'%'};return _0x3477bb;}})});}_0x4bdcda=_[_0xd399('0x41')]({},_0x4bdcda,_0x30d50c[_0xd399('0x43')]);var _0x51e27d={'where':_0x4bdcda['where']};return db['Team']['count'](_0x51e27d)[_0xd399('0x44')](function(_0x3cab99){_0x218c99[_0xd399('0x45')]=_0x3cab99;if(_0x30d50c[_0xd399('0x32')][_0xd399('0x46')]){_0x4bdcda[_0xd399('0x47')]=[{'all':!![]}];}return db['Team'][_0xd399('0x48')](_0x4bdcda);})['then'](function(_0x332651){_0x218c99[_0xd399('0x49')]=_0x332651;return _0x218c99;})[_0xd399('0x44')](respondWithFilteredResult(_0x564604,_0x4bdcda))[_0xd399('0x4a')](handleError(_0x564604,null));};exports[_0xd399('0x4b')]=function(_0x335173,_0x3e25c7){var _0x2b038b={'raw':![],'where':{'id':_0x335173[_0xd399('0x4c')]['id']}},_0x148d0f={};_0x148d0f[_0xd399('0x35')]=_[_0xd399('0x33')](db[_0xd399('0x2c')][_0xd399('0x2d')]);_0x148d0f[_0xd399('0x32')]=_[_0xd399('0x33')](_0x335173[_0xd399('0x32')]);_0x148d0f[_0xd399('0x3e')]=_[_0xd399('0x34')](_0x148d0f[_0xd399('0x35')],_0x148d0f[_0xd399('0x32')]);_0x2b038b['attributes']=_[_0xd399('0x34')](_0x148d0f['model'],qs[_0xd399('0x36')](_0x335173[_0xd399('0x32')][_0xd399('0x36')]));_0x2b038b[_0xd399('0x37')]=_0x2b038b['attributes'][_0xd399('0x38')]?_0x2b038b[_0xd399('0x37')]:_0x148d0f[_0xd399('0x35')];if(_0x335173['query'][_0xd399('0x46')]){_0x2b038b[_0xd399('0x47')]=[{'all':!![]}];}_0x2b038b=_[_0xd399('0x41')]({},_0x2b038b,_0x335173[_0xd399('0x43')]);return db[_0xd399('0x2c')][_0xd399('0x4d')](_0x2b038b)[_0xd399('0x44')](handleEntityNotFound(_0x3e25c7,null))[_0xd399('0x44')](respondWithResult(_0x3e25c7,null))[_0xd399('0x4a')](handleError(_0x3e25c7,null));};exports[_0xd399('0x4e')]=function(_0x254289,_0xeed722){return db[_0xd399('0x2c')][_0xd399('0x4e')](_0x254289['body'],{})[_0xd399('0x44')](function(_0x5f513b){var _0x54d78c=_0x254289[_0xd399('0x4f')][_0xd399('0x50')]({'plain':!![]});if(!_0x54d78c)throw new Error(_0xd399('0x51'));if(_0x54d78c['role']===_0xd399('0x4f')){var _0x3ea585=_0x5f513b['get']({'plain':!![]});var _0x41469e=_0xd399('0x52');return db[_0xd399('0x53')][_0xd399('0x4d')]({'where':{'name':_0x41469e,'userProfileId':_0x54d78c[_0xd399('0x54')]},'raw':!![]})[_0xd399('0x44')](function(_0x4f05e5){if(_0x4f05e5&&_0x4f05e5[_0xd399('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x3ea585[_0xd399('0x29')],'resourceId':_0x3ea585['id'],'type':_0x4f05e5[_0xd399('0x29')],'sectionId':_0x4f05e5['id']},{})[_0xd399('0x44')](function(){return _0x5f513b;});}else{return _0x5f513b;}})['catch'](function(_0x4cb27c){logger[_0xd399('0x56')](_0xd399('0x57'),_0x4cb27c);throw _0x4cb27c;});}return _0x5f513b;})[_0xd399('0x44')](respondWithResult(_0xeed722,0xc9))[_0xd399('0x4a')](handleError(_0xeed722,null));};exports['update']=function(_0x228679,_0x4a287c){if(_0x228679[_0xd399('0x58')]['id']){delete _0x228679['body']['id'];}return db[_0xd399('0x2c')][_0xd399('0x4d')]({'where':{'id':_0x228679['params']['id']}})['then'](handleEntityNotFound(_0x4a287c,null))[_0xd399('0x44')](saveUpdates(_0x228679['body'],null))[_0xd399('0x44')](respondWithResult(_0x4a287c,null))[_0xd399('0x4a')](handleError(_0x4a287c,null));};exports[_0xd399('0x59')]=function(_0x1ea82e,_0x556388){var _0x2fe604=_0x1ea82e[_0xd399('0x4c')]['id'];var _0x58746a=[];return db[_0xd399('0x5a')][_0xd399('0x5b')](function(_0x13f43d){var _0x168c0e='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x2fe604;return db[_0xd399('0x5a')][_0xd399('0x32')](_0x168c0e,{'type':db[_0xd399('0x5c')][_0xd399('0x5d')][_0xd399('0x5e')],'raw':!![],'transaction':_0x13f43d})[_0xd399('0x44')](function(_0x4b589a){_0x58746a=_['map'](_0x4b589a,function(_0x10bb26){return Number(_0x10bb26[_0xd399('0x5f')]);});})[_0xd399('0x44')](function(){var _0x1ada90='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2fe604;return db[_0xd399('0x5a')]['query'](_0x1ada90,{'type':db[_0xd399('0x5c')][_0xd399('0x5d')]['SELECT'],'raw':!![],'transaction':_0x13f43d});})[_0xd399('0x44')](function(_0x3e827d){var _0x3e3ecb=_['map'](_0x3e827d,function(_0x28db27){return Number(_0x28db27[_0xd399('0x60')]);});return db[_0xd399('0x61')][_0xd399('0x59')]({'where':{'UserId':{'$in':_0x58746a},'VoiceQueueId':{'$in':_0x3e3ecb}},'transaction':_0x13f43d});})[_0xd399('0x44')](function(){var _0x51b0cd=_0xd399('0x62')+_0x2fe604;return db[_0xd399('0x5a')][_0xd399('0x32')](_0x51b0cd,{'type':db[_0xd399('0x5c')][_0xd399('0x5d')][_0xd399('0x5e')],'raw':!![],'transaction':_0x13f43d});})['then'](function(_0x3f9002){var _0x36fec0=_[_0xd399('0x31')](_0x3f9002,function(_0xfb8a3d){return Number(_0xfb8a3d[_0xd399('0x63')]);});return db[_0xd399('0x64')][_0xd399('0x59')]({'where':{'UserId':{'$in':_0x58746a},'MailQueueId':{'$in':_0x36fec0}},'transaction':_0x13f43d});})[_0xd399('0x44')](function(){var _0x63ef4b=_0xd399('0x65')+_0x2fe604;return db[_0xd399('0x5a')]['query'](_0x63ef4b,{'type':db['Sequelize'][_0xd399('0x5d')][_0xd399('0x5e')],'raw':!![],'transaction':_0x13f43d});})[_0xd399('0x44')](function(_0x4cd114){var _0x118f58=_['map'](_0x4cd114,function(_0x580623){return Number(_0x580623[_0xd399('0x66')]);});return db[_0xd399('0x67')][_0xd399('0x59')]({'where':{'UserId':{'$in':_0x58746a},'SmsQueueId':{'$in':_0x118f58}},'transaction':_0x13f43d});})[_0xd399('0x44')](function(){var _0x3c22d8=_0xd399('0x68')+_0x2fe604;return db[_0xd399('0x5a')][_0xd399('0x32')](_0x3c22d8,{'type':db[_0xd399('0x5c')][_0xd399('0x5d')][_0xd399('0x5e')],'raw':!![],'transaction':_0x13f43d});})[_0xd399('0x44')](function(_0x2db409){var _0x2c006c=_[_0xd399('0x31')](_0x2db409,function(_0x1ac2f2){return Number(_0x1ac2f2['ChatQueueId']);});return db[_0xd399('0x69')]['destroy']({'where':{'UserId':{'$in':_0x58746a},'ChatQueueId':{'$in':_0x2c006c}},'transaction':_0x13f43d});})['then'](function(){var _0x5e9ad7='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2fe604;return db[_0xd399('0x5a')][_0xd399('0x32')](_0x5e9ad7,{'type':db[_0xd399('0x5c')][_0xd399('0x5d')][_0xd399('0x5e')],'raw':!![],'transaction':_0x13f43d});})['then'](function(_0x17408f){var _0x3e0c37=_['map'](_0x17408f,function(_0xeb9b3c){return Number(_0xeb9b3c['FaxQueueId']);});return db[_0xd399('0x6a')][_0xd399('0x59')]({'where':{'UserId':{'$in':_0x58746a},'FaxQueueId':{'$in':_0x3e0c37}},'transaction':_0x13f43d});})[_0xd399('0x44')](function(){var _0x2bcbcd=_0xd399('0x6b')+_0x2fe604;return db[_0xd399('0x5a')][_0xd399('0x32')](_0x2bcbcd,{'type':db[_0xd399('0x5c')]['QueryTypes'][_0xd399('0x5e')],'raw':!![],'transaction':_0x13f43d});})['then'](function(_0x16926f){var _0x292325=_[_0xd399('0x31')](_0x16926f,function(_0x3d618a){return Number(_0x3d618a[_0xd399('0x6c')]);});return db[_0xd399('0x6d')][_0xd399('0x59')]({'where':{'UserId':{'$in':_0x58746a},'OpenchannelQueueId':{'$in':_0x292325}},'transaction':_0x13f43d});})[_0xd399('0x44')](function(){var _0x4a1ad0=_0xd399('0x6e')+_0x2fe604;return db['sequelize']['query'](_0x4a1ad0,{'type':db[_0xd399('0x5c')][_0xd399('0x5d')][_0xd399('0x5e')],'raw':!![],'transaction':_0x13f43d});})[_0xd399('0x44')](function(_0xf557ea){var _0x4e421a=_['map'](_0xf557ea,function(_0x40a96e){return Number(_0x40a96e[_0xd399('0x6f')]);});return db[_0xd399('0x70')][_0xd399('0x59')]({'where':{'UserId':{'$in':_0x58746a},'WhatsappQueueId':{'$in':_0x4e421a}},'transaction':_0x13f43d});})[_0xd399('0x44')](function(){return db[_0xd399('0x71')][_0xd399('0x4d')]({'where':{'TeamId':_0x2fe604}});})[_0xd399('0x44')](function(_0x130093){if(_0x130093===null){return;}return db[_0xd399('0x72')][_0xd399('0x59')]({'where':{'UserId':{'$in':_0x58746a},'VoicePrefixId':_0x130093['VoicePrefixId']},'transaction':_0x13f43d});})[_0xd399('0x44')](function(){return db['Team'][_0xd399('0x59')]({'where':{'id':_0x2fe604},'cascade':!![],'transaction':_0x13f43d});})[_0xd399('0x44')](function(_0x38bc9a){if(_0x38bc9a===0x0){_0x556388[_0xd399('0x28')](0x194);}else{return db[_0xd399('0x73')]['destroy']({'where':{'type':_0xd399('0x52'),'resourceId':_0x2fe604},'cascade':!![],'transaction':_0x13f43d})[_0xd399('0x44')](function(){_0x556388[_0xd399('0x22')](0xcc)[_0xd399('0x1d')]();});}})[_0xd399('0x4a')](function(_0x148196){_0x556388['status'](0x1f4)[_0xd399('0x2a')](_0x148196);});});};exports[_0xd399('0x74')]=function(_0x2d2c8a,_0x245063,_0x12336a){return db[_0xd399('0x2c')][_0xd399('0x75')]({'where':{'id':_0x2d2c8a[_0xd399('0x4c')]['id']}})['then'](handleEntityNotFound(_0x245063,null))[_0xd399('0x44')](function(_0xc307){if(!_0x2d2c8a[_0xd399('0x32')]['channel']||!utils[_0xd399('0x76')](_0x2d2c8a[_0xd399('0x32')][_0xd399('0x77')])){throw new db['Sequelize']['ValidationError'](_0xd399('0x78'));}var _0x2fc166={};var _0x5a0763={};_0x5a0763[_0xd399('0x35')]=_['keys'](db[_[_0xd399('0x79')](_0x2d2c8a[_0xd399('0x32')]['channel'][_0xd399('0x7a')]())+_0xd399('0x7b')][_0xd399('0x2d')]);_0x5a0763[_0xd399('0x32')]=_[_0xd399('0x33')](_0x2d2c8a[_0xd399('0x32')]);_0x5a0763[_0xd399('0x3e')]=_['intersection'](_0x5a0763['model'],_0x5a0763[_0xd399('0x32')]);_0x2fc166[_0xd399('0x37')]=_['intersection'](_0x5a0763['model'],qs['fields'](_0x2d2c8a[_0xd399('0x32')][_0xd399('0x36')]));_0x2fc166[_0xd399('0x37')]=_0x2fc166[_0xd399('0x37')][_0xd399('0x38')]?_0x2fc166[_0xd399('0x37')]:_0x5a0763[_0xd399('0x35')];_0x2fc166['limit']=qs[_0xd399('0x20')](_0x2d2c8a['query'][_0xd399('0x20')]);_0x2fc166[_0xd399('0x21')]=qs[_0xd399('0x21')](_0x2d2c8a[_0xd399('0x32')][_0xd399('0x21')]);_0x2fc166[_0xd399('0x3b')]=qs[_0xd399('0x3c')](_0x2d2c8a[_0xd399('0x32')][_0xd399('0x3c')]);_0x2fc166[_0xd399('0x3d')]=qs[_0xd399('0x3e')](_['pick'](_0x2d2c8a['query'],_0x5a0763[_0xd399('0x3e')]));_0x2fc166=_[_0xd399('0x41')]({},_0x2fc166,_0x2d2c8a[_0xd399('0x43')]);return _0xc307[_0xd399('0x50')+_['capitalize'](_0x2d2c8a['query'][_0xd399('0x77')]['toLowerCase']())+_0xd399('0x7c')](_0x2fc166);})['then'](respondWithResult(_0x245063,null))[_0xd399('0x4a')](handleError(_0x245063,null));};exports[_0xd399('0x7d')]=function(_0x4a7370,_0x39cc4a,_0x59cc86){return db[_0xd399('0x2c')][_0xd399('0x75')]({'where':{'id':_0x4a7370[_0xd399('0x4c')]['id']}})['then'](function(_0x940485){if(_0x940485){if(!_0x4a7370[_0xd399('0x58')][_0xd399('0x77')]||!utils[_0xd399('0x76')](_0x4a7370[_0xd399('0x58')][_0xd399('0x77')])){throw new db[(_0xd399('0x5c'))][(_0xd399('0x7e'))]('Unknown\x20channel');}return _0x940485[_0xd399('0x7f')+_[_0xd399('0x79')](_0x4a7370[_0xd399('0x58')]['channel'][_0xd399('0x7a')]())+_0xd399('0x7c')](_0x4a7370[_0xd399('0x58')]['ids']);}return null;})[_0xd399('0x44')](handleEntityNotFound(_0x39cc4a,null))[_0xd399('0x44')](respondWithStatusCode(_0x39cc4a,null))[_0xd399('0x4a')](handleError(_0x39cc4a,null));};exports[_0xd399('0x80')]=function(_0x28f6c5,_0x515632,_0x27f47b){return db['Team']['findOne']({'where':{'id':_0x28f6c5[_0xd399('0x4c')]['id']}})[_0xd399('0x44')](function(_0x2c12b0){if(_0x2c12b0){if(!_0x28f6c5[_0xd399('0x32')][_0xd399('0x77')]||!utils[_0xd399('0x76')](_0x28f6c5[_0xd399('0x32')][_0xd399('0x77')])){throw new db[(_0xd399('0x5c'))][(_0xd399('0x7e'))](_0xd399('0x78'));}return _0x2c12b0['remove'+_[_0xd399('0x79')](_0x28f6c5[_0xd399('0x32')][_0xd399('0x77')][_0xd399('0x7a')]())+'Queues'](_0x28f6c5[_0xd399('0x32')][_0xd399('0x81')]);}return null;})[_0xd399('0x44')](handleEntityNotFound(_0x515632,null))['then'](respondWithStatusCode(_0x515632,null))[_0xd399('0x4a')](handleError(_0x515632,null));};exports[_0xd399('0x82')]=function(_0x110c86,_0x3e2a2b){var _0x30c95f=_['isArray'](_0x110c86['body']['ids'])?_0x110c86[_0xd399('0x58')][_0xd399('0x81')]:[_0x110c86[_0xd399('0x58')][_0xd399('0x81')]];var _0x4cabe1=_0x110c86['params']['id'];return db[_0xd399('0x2c')][_0xd399('0x4d')]({'where':{'id':_0x4cabe1}})[_0xd399('0x44')](handleEntityNotFound(_0x3e2a2b,null))[_0xd399('0x44')](function(_0x2f8d3d){if(_0x2f8d3d){var _0x516f96=['Voice',_0xd399('0x83'),_0xd399('0x84'),_0xd399('0x85'),'Fax',_0xd399('0x86'),_0xd399('0x87')];return db[_0xd399('0x5a')]['transaction'](function(_0x2b49f1){var _0x2fcaa9=_[_0xd399('0x31')](_0x516f96,function(_0x4b6c3e){var _0x566913={'attributes':['id',_0xd399('0x29')]};if(_0x4b6c3e===_0xd399('0x88')){_0x566913[_0xd399('0x89')]={'attributes':['penalty']};}return _0x2f8d3d[_0xd399('0x50')+_0x4b6c3e+'Queues'](_0x566913)[_0xd399('0x44')](function(_0x49238f){var _0x3d5f84=_[_0xd399('0x31')](_0x49238f,function(_0x42cf95){var _0x47e327=_[_0xd399('0x31')](_0x30c95f,function(_0x105a28){var _0x304682={'where':{'UserId':_0x105a28,[_0x4b6c3e+'QueueId']:_0x42cf95['id']},'transaction':_0x2b49f1};if(_0x4b6c3e===_0xd399('0x88')){_0x304682['defaults']={'penalty':_0x42cf95['TeamVoiceQueue']['penalty']};}return db[_0xd399('0x8a')+_0x4b6c3e+'Queue'][_0xd399('0x8b')](_0x304682)['then'](function(){socket['emit'](_0xd399('0x4f')+_0x4b6c3e+_0xd399('0x8c'),{'UserId':_0x105a28,[_0x4b6c3e+_0xd399('0x8d')]:_0x42cf95['id']});if(_0x4b6c3e!==_0xd399('0x88')){return;}return db[_0xd399('0x8a')][_0xd399('0x48')]({'where':{'id':_0x30c95f,'online':0x1},'attributes':['id',_0xd399('0x29'),_0xd399('0x8e'),_0xd399('0x8f'),_0xd399('0x90')],'raw':!![]})['then'](function(_0x176307){var _0x3cc0bc=_[_0xd399('0x31')](_0x176307,function(_0x480786){return db['UserVoiceQueueRt'][_0xd399('0x91')]({'membername':_0x480786[_0xd399('0x29')],'UserId':_0x480786['id'],'queue_name':_0x42cf95['name'],'VoiceQueueId':_0x42cf95['id'],'interface':_[_0xd399('0x92')](_0x480786[_0xd399('0x90')])?util[_0xd399('0x93')](_0xd399('0x94'),_0x480786[_0xd399('0x29')]):_0x480786[_0xd399('0x90')],'paused':_0x480786['voicePause']||![],'penalty':_0x42cf95[_0xd399('0x95')][_0xd399('0x96')]},{'transaction':_0x2b49f1});});return Promise[_0xd399('0x97')](_0x3cc0bc);});});});return Promise[_0xd399('0x97')](_0x47e327);});return Promise['all'](_0x3d5f84);})[_0xd399('0x44')](function(){return db[_0xd399('0x71')][_0xd399('0x75')]({'where':{'teamId':_0x4cabe1}})[_0xd399('0x44')](function(_0xf53fda){if(_0xf53fda){var _0x4abbda=_[_0xd399('0x31')](_0x30c95f,function(_0x2df08e){db[_0xd399('0x72')][_0xd399('0x91')]({'UserId':_0x2df08e,'VoicePrefixId':_0xf53fda[_0xd399('0x98')]});});return Promise[_0xd399('0x97')](_0x4abbda);}});});});return Promise[_0xd399('0x97')](_0x2fcaa9)[_0xd399('0x44')](function(){return _0x2f8d3d[_0xd399('0x82')](_0x30c95f,{'transaction':_0x2b49f1})[_0xd399('0x99')](function(_0x78ef3a){return _0x78ef3a;});});});}})[_0xd399('0x44')](respondWithResult(_0x3e2a2b,null))[_0xd399('0x4a')](handleError(_0x3e2a2b,null));};exports[_0xd399('0x9a')]=function(_0x3ecf12,_0x378088){var _0x11ba55=_[_0xd399('0x9b')](_0x3ecf12[_0xd399('0x32')][_0xd399('0x81')])?_0x3ecf12['query'][_0xd399('0x81')]:[_0x3ecf12[_0xd399('0x32')][_0xd399('0x81')]];var _0x7ced96=_0x3ecf12[_0xd399('0x4c')]['id'];return db['Team'][_0xd399('0x4d')]({'where':{'id':_0x7ced96}})[_0xd399('0x44')](handleEntityNotFound(_0x378088,null))['then'](function(_0x34dba4){if(_0x34dba4){var _0x30690c=[_0xd399('0x88'),_0xd399('0x83'),_0xd399('0x84'),_0xd399('0x85'),_0xd399('0x9c'),_0xd399('0x86'),_0xd399('0x87')];return db['sequelize'][_0xd399('0x5b')](function(_0x12c327){var _0x1b8a28=_[_0xd399('0x31')](_0x30690c,function(_0x52c439){var _0x51fe62={'attributes':['id',_0xd399('0x29')]};return _0x34dba4[_0xd399('0x50')+_0x52c439+_0xd399('0x7c')](_0x51fe62)[_0xd399('0x44')](function(_0x281fd7){var _0x4c2554=_[_0xd399('0x31')](_0x281fd7,function(_0x25147d){return _0x25147d['removeAgents'](_0x11ba55,{'transaction':_0x12c327})['then'](function(){var _0x47ff30=_[_0xd399('0x31')](_0x11ba55,function(_0x5ba613){socket['emit'](_0xd399('0x4f')+_0x52c439+_0xd399('0x9d'),{'UserId':Number(_0x5ba613),[_0x52c439+_0xd399('0x8d')]:_0x25147d['id']});if(_0x52c439!==_0xd399('0x88')){return;}return db[_0xd399('0x9e')][_0xd399('0x59')]({'where':{'VoiceQueueId':_0x25147d['id'],'UserId':_0x5ba613},'transaction':_0x12c327});});return Promise[_0xd399('0x97')](_0x47ff30);});});return Promise[_0xd399('0x97')](_0x4c2554);});});return Promise['all'](_0x1b8a28)[_0xd399('0x44')](function(){return _0x34dba4['removeAgents'](_0x11ba55,{'transaction':_0x12c327});})[_0xd399('0x44')](function(){return db[_0xd399('0x71')][_0xd399('0x75')]({'where':{'teamId':_0x7ced96}})['then'](function(_0x237c51){if(_0x237c51){var _0x3df91f=_[_0xd399('0x31')](_0x11ba55,function(_0x49d30b){db[_0xd399('0x72')][_0xd399('0x59')]({'where':{'UserId':_0x49d30b,'VoicePrefixId':_0x237c51[_0xd399('0x98')]}});});return Promise[_0xd399('0x97')](_0x3df91f);}});});});}})[_0xd399('0x44')](respondWithStatusCode(_0x378088,null))['catch'](handleError(_0x378088,null));};exports[_0xd399('0x9f')]=function(_0x32cce3,_0x407239,_0x25958c){var _0x591af7={};var _0x3f2088={};var _0x57cf98;var _0x1bdb19;return db[_0xd399('0x2c')][_0xd399('0x75')]({'where':{'id':_0x32cce3[_0xd399('0x4c')]['id']}})[_0xd399('0x44')](handleEntityNotFound(_0x407239,null))[_0xd399('0x44')](function(_0x12cd2e){if(_0x12cd2e){_0x57cf98=_0x12cd2e;_0x3f2088[_0xd399('0x35')]=_[_0xd399('0x33')](db[_0xd399('0x8a')]['rawAttributes']);_0x3f2088['query']=_['keys'](_0x32cce3['query']);_0x3f2088[_0xd399('0x3e')]=_[_0xd399('0x34')](_0x3f2088['model'],_0x3f2088['query']);_0x591af7[_0xd399('0x37')]=_['intersection'](_0x3f2088[_0xd399('0x35')],qs[_0xd399('0x36')](_0x32cce3['query']['fields']));_0x591af7[_0xd399('0x37')]=_0x591af7['attributes']['length']?_0x591af7['attributes']:_0x3f2088[_0xd399('0x35')];_0x591af7['order']=qs['sort'](_0x32cce3[_0xd399('0x32')]['sort']);_0x591af7[_0xd399('0x3d')]=qs[_0xd399('0x3e')](_['pick'](_0x32cce3[_0xd399('0x32')],_0x3f2088[_0xd399('0x3e')]));if(_0x32cce3[_0xd399('0x32')][_0xd399('0x40')]){_0x591af7['where']=_['merge'](_0x591af7[_0xd399('0x3d')],{'$or':_['map'](_0x591af7[_0xd399('0x37')],function(_0x161584){var _0x563bf1={};_0x563bf1[_0x161584]={'$like':'%'+_0x32cce3[_0xd399('0x32')]['filter']+'%'};return _0x563bf1;})});}_0x591af7=_[_0xd399('0x41')]({},_0x591af7,_0x32cce3[_0xd399('0x43')]);return _0x57cf98['getAgents'](_0x591af7);}})[_0xd399('0x44')](function(_0x4dd9ab){if(_0x4dd9ab){_0x1bdb19=_0x4dd9ab[_0xd399('0x38')];if(!_0x32cce3['query']['hasOwnProperty'](_0xd399('0x3a'))){_0x591af7[_0xd399('0x20')]=qs[_0xd399('0x20')](_0x32cce3[_0xd399('0x32')]['limit']);_0x591af7['offset']=qs[_0xd399('0x21')](_0x32cce3[_0xd399('0x32')][_0xd399('0x21')]);}return _0x57cf98[_0xd399('0x9f')](_0x591af7);}})[_0xd399('0x44')](function(_0x34f997){if(_0x34f997){return _0x34f997?{'count':_0x1bdb19,'rows':_0x34f997}:null;}})[_0xd399('0x44')](respondWithResult(_0x407239,null))['catch'](handleError(_0x407239,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index bd53898..cbd94b5 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 _0x27ff=['hook','exports','../../mysqldb','Team','save','update','remove','emit','hasOwnProperty'];(function(_0x7e918f,_0x48cf10){var _0x5b35ab=function(_0x1455be){while(--_0x1455be){_0x7e918f['push'](_0x7e918f['shift']());}};_0x5b35ab(++_0x48cf10);}(_0x27ff,0x65));var _0xf27f=function(_0x1109eb,_0x68f359){_0x1109eb=_0x1109eb-0x0;var _0x120d4e=_0x27ff[_0x1109eb];return _0x120d4e;};'use strict';var EventEmitter=require('events');var Team=require(_0xf27f('0x0'))['db'][_0xf27f('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf27f('0x2'),'afterUpdate':_0xf27f('0x3'),'afterDestroy':_0xf27f('0x4')};function emitEvent(_0x2309bb){return function(_0x3cf8b0,_0x46bfa3,_0x4ad38e){TeamEvents[_0xf27f('0x5')](_0x2309bb+':'+_0x3cf8b0['id'],_0x3cf8b0);TeamEvents[_0xf27f('0x5')](_0x2309bb,_0x3cf8b0);_0x4ad38e(null);};}for(var e in events){if(events[_0xf27f('0x6')](e)){var event=events[e];Team[_0xf27f('0x7')](e,emitEvent(event));}}module[_0xf27f('0x8')]=TeamEvents; \ No newline at end of file +var _0x10e3=['Team','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2f2d14,_0x2d14c9){var _0x35a590=function(_0x431036){while(--_0x431036){_0x2f2d14['push'](_0x2f2d14['shift']());}};_0x35a590(++_0x2d14c9);}(_0x10e3,0xee));var _0x310e=function(_0x5c06fe,_0x12193a){_0x5c06fe=_0x5c06fe-0x0;var _0xf8ec9a=_0x10e3[_0x5c06fe];return _0xf8ec9a;};'use strict';var EventEmitter=require(_0x310e('0x0'));var Team=require(_0x310e('0x1'))['db'][_0x310e('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x310e('0x3')](0x0);var events={'afterCreate':_0x310e('0x4'),'afterUpdate':'update','afterDestroy':_0x310e('0x5')};function emitEvent(_0x4445eb){return function(_0x10c2a0,_0x3f4c6a,_0x43daab){TeamEvents[_0x310e('0x6')](_0x4445eb+':'+_0x10c2a0['id'],_0x10c2a0);TeamEvents[_0x310e('0x6')](_0x4445eb,_0x10c2a0);_0x43daab(null);};}for(var e in events){if(events[_0x310e('0x7')](e)){var event=events[e];Team[_0x310e('0x8')](e,emitEvent(event));}}module[_0x310e('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 69b5817..bb211a4 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 _0x9e7e=['channel','catch','define','Team','teams','Fax','Mail','Sms','Voice','Whatsapp','resolve','get','Queues','map'];(function(_0x4aa342,_0x470002){var _0x288052=function(_0x4be621){while(--_0x4be621){_0x4aa342['push'](_0x4aa342['shift']());}};_0x288052(++_0x470002);}(_0x9e7e,0x193));var _0xe9e7=function(_0xa1e7d7,_0x5714bb){_0xa1e7d7=_0xa1e7d7-0x0;var _0x287bee=_0x9e7e[_0xa1e7d7];return _0x287bee;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x1e34b3,_0x3118d0){var _0x8ada10=_0xe9e7('0x0')+_0x3118d0+_0xe9e7('0x1');return _0x1e34b3[_0x8ada10]()['then'](function(_0x25b04b){return _[_0xe9e7('0x2')](_0x25b04b,function(_0x4bb10a){_0x4bb10a['setDataValue'](_0xe9e7('0x3'),_0x3118d0);return _0x4bb10a;});})[_0xe9e7('0x4')](function(_0x550348){throw _0x550348;});}module['exports']=function(_0x35757b){return _0x35757b[_0xe9e7('0x5')](_0xe9e7('0x6'),attributes,{'tableName':_0xe9e7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x18b86d=this;var _0x5b1cec=['Chat',_0xe9e7('0x8'),_0xe9e7('0x9'),'Openchannel',_0xe9e7('0xa'),_0xe9e7('0xb'),_0xe9e7('0xc')];return Promise[_0xe9e7('0xd')]()['then'](function(){var _0x5f36a1=_[_0xe9e7('0x2')](_0x5b1cec,function(_0xbef199){return getQueuesByChannel(_0x18b86d,_0xbef199);});return Promise['all'](_0x5f36a1);})[_0xe9e7('0x4')](function(_0x524af5){throw _0x524af5;});}}});}; \ No newline at end of file +var _0xda0b=['Whatsapp','resolve','all','catch','lodash','get','then','map','setDataValue','channel','exports','define','Team','Chat','Fax','Mail','Openchannel'];(function(_0x1297cd,_0x591fc0){var _0x4682d9=function(_0x58de86){while(--_0x58de86){_0x1297cd['push'](_0x1297cd['shift']());}};_0x4682d9(++_0x591fc0);}(_0xda0b,0xf2));var _0xbda0=function(_0x4f5ec0,_0x45c0f4){_0x4f5ec0=_0x4f5ec0-0x0;var _0x34a982=_0xda0b[_0x4f5ec0];return _0x34a982;};'use strict';var _=require(_0xbda0('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x1ae786,_0x5804b6){var _0xfcf3d8=_0xbda0('0x1')+_0x5804b6+'Queues';return _0x1ae786[_0xfcf3d8]()[_0xbda0('0x2')](function(_0x14d4f6){return _[_0xbda0('0x3')](_0x14d4f6,function(_0x23ca92){_0x23ca92[_0xbda0('0x4')](_0xbda0('0x5'),_0x5804b6);return _0x23ca92;});})['catch'](function(_0x448a4b){throw _0x448a4b;});}module[_0xbda0('0x6')]=function(_0x554d98){return _0x554d98[_0xbda0('0x7')](_0xbda0('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1bd5f5=this;var _0x5a6ec7=[_0xbda0('0x9'),_0xbda0('0xa'),_0xbda0('0xb'),_0xbda0('0xc'),'Sms','Voice',_0xbda0('0xd')];return Promise[_0xbda0('0xe')]()[_0xbda0('0x2')](function(){var _0x1d4e30=_['map'](_0x5a6ec7,function(_0x82b49b){return getQueuesByChannel(_0x1bd5f5,_0x82b49b);});return Promise[_0xbda0('0xf')](_0x1d4e30);})[_0xbda0('0x10')](function(_0x5792bf){throw _0x5792bf;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index defbc59..b70dcb7 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 _0x7104=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment'];(function(_0xf61586,_0x56b0c4){var _0x2b6eb3=function(_0x47e12b){while(--_0x47e12b){_0xf61586['push'](_0xf61586['shift']());}};_0x2b6eb3(++_0x56b0c4);}(_0x7104,0x99));var _0x4710=function(_0x57ac47,_0x4b82c8){_0x57ac47=_0x57ac47-0x0;var _0x12adb4=_0x7104[_0x57ac47];return _0x12adb4;};'use strict';var _=require(_0x4710('0x0'));var util=require(_0x4710('0x1'));var moment=require(_0x4710('0x2'));var BPromise=require('bluebird');var rs=require(_0x4710('0x3'));var fs=require('fs');var Redis=require(_0x4710('0x4'));var db=require(_0x4710('0x5'))['db'];var utils=require(_0x4710('0x6'));var logger=require(_0x4710('0x7'))(_0x4710('0x8'));var config=require(_0x4710('0x9'));var jayson=require(_0x4710('0xa'));var client=jayson[_0x4710('0xb')]['http']({'port':0x232a});config[_0x4710('0xc')]=_[_0x4710('0xd')](config[_0x4710('0xc')],{'host':_0x4710('0xe'),'port':0x18eb});var socket=require(_0x4710('0xf'))(new Redis(config['redis']));require(_0x4710('0x10'))[_0x4710('0x11')](socket);function respondWithRpcPromise(_0x4f8685,_0x3f8a29,_0x5032b4){return new BPromise(function(_0x9b6406,_0x35b3b0){return client['request'](_0x4f8685,_0x5032b4)['then'](function(_0x4c9f14){logger[_0x4710('0x12')](_0x4710('0x13'),_0x3f8a29,_0x4710('0x14'));logger['debug'](_0x4710('0x15'),_0x3f8a29,_0x4710('0x14'),JSON[_0x4710('0x16')](_0x4c9f14));if(_0x4c9f14[_0x4710('0x17')]){if(_0x4c9f14['error'][_0x4710('0x18')]===0x1f4){logger[_0x4710('0x17')](_0x4710('0x13'),_0x3f8a29,_0x4c9f14[_0x4710('0x17')][_0x4710('0x19')]);return _0x35b3b0(_0x4c9f14[_0x4710('0x17')][_0x4710('0x19')]);}logger[_0x4710('0x17')](_0x4710('0x13'),_0x3f8a29,_0x4c9f14['error'][_0x4710('0x19')]);return _0x9b6406(_0x4c9f14['error']['message']);}else{logger[_0x4710('0x12')](_0x4710('0x13'),_0x3f8a29,_0x4710('0x14'));_0x9b6406(_0x4c9f14['result']['message']);}})['catch'](function(_0x22691b){logger[_0x4710('0x17')](_0x4710('0x13'),_0x3f8a29,_0x22691b);_0x35b3b0(_0x22691b);});});} \ No newline at end of file +var _0x01a5=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./team.socket','register','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2dd69c,_0x591d84){var _0x57deec=function(_0x296007){while(--_0x296007){_0x2dd69c['push'](_0x2dd69c['shift']());}};_0x57deec(++_0x591d84);}(_0x01a5,0x1a8));var _0x501a=function(_0x11cd7b,_0x2261e2){_0x11cd7b=_0x11cd7b-0x0;var _0x220bf7=_0x01a5[_0x11cd7b];return _0x220bf7;};'use strict';var _=require('lodash');var util=require(_0x501a('0x0'));var moment=require(_0x501a('0x1'));var BPromise=require(_0x501a('0x2'));var rs=require(_0x501a('0x3'));var fs=require('fs');var Redis=require(_0x501a('0x4'));var db=require(_0x501a('0x5'))['db'];var utils=require(_0x501a('0x6'));var logger=require(_0x501a('0x7'))(_0x501a('0x8'));var config=require(_0x501a('0x9'));var jayson=require(_0x501a('0xa'));var client=jayson[_0x501a('0xb')][_0x501a('0xc')]({'port':0x232a});config['redis']=_[_0x501a('0xd')](config[_0x501a('0xe')],{'host':_0x501a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x501a('0xe')]));require(_0x501a('0x10'))[_0x501a('0x11')](socket);function respondWithRpcPromise(_0x54bc46,_0x3289c3,_0x216619){return new BPromise(function(_0x117f7e,_0x3a1683){return client['request'](_0x54bc46,_0x216619)[_0x501a('0x12')](function(_0x2106f8){logger[_0x501a('0x13')](_0x501a('0x14'),_0x3289c3,'request\x20sent');logger[_0x501a('0x15')](_0x501a('0x16'),_0x3289c3,'request\x20sent',JSON['stringify'](_0x2106f8));if(_0x2106f8[_0x501a('0x17')]){if(_0x2106f8[_0x501a('0x17')][_0x501a('0x18')]===0x1f4){logger[_0x501a('0x17')]('Team,\x20%s,\x20%s',_0x3289c3,_0x2106f8[_0x501a('0x17')][_0x501a('0x19')]);return _0x3a1683(_0x2106f8[_0x501a('0x17')][_0x501a('0x19')]);}logger[_0x501a('0x17')](_0x501a('0x14'),_0x3289c3,_0x2106f8[_0x501a('0x17')][_0x501a('0x19')]);return _0x117f7e(_0x2106f8[_0x501a('0x17')][_0x501a('0x19')]);}else{logger[_0x501a('0x13')](_0x501a('0x14'),_0x3289c3,'request\x20sent');_0x117f7e(_0x2106f8['result']['message']);}})[_0x501a('0x1a')](function(_0x3334b3){logger['error']('Team,\x20%s,\x20%s',_0x3289c3,_0x3334b3);_0x3a1683(_0x3334b3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 14c9a06..de65868 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 _0xbd20=['./team.events','update','emit','removeListener','register','team:'];(function(_0x30134c,_0x52b596){var _0x7cdaa6=function(_0x46aedb){while(--_0x46aedb){_0x30134c['push'](_0x30134c['shift']());}};_0x7cdaa6(++_0x52b596);}(_0xbd20,0x14a));var _0x0bd2=function(_0x470ada,_0x453059){_0x470ada=_0x470ada-0x0;var _0x5a71e0=_0xbd20[_0x470ada];return _0x5a71e0;};'use strict';var TeamEvents=require(_0x0bd2('0x0'));var events=['save','remove',_0x0bd2('0x1')];function createListener(_0x2635f0,_0x46cde4){return function(_0x34986a){_0x46cde4[_0x0bd2('0x2')](_0x2635f0,_0x34986a);};}function removeListener(_0x5d701d,_0x231f0d){return function(){TeamEvents[_0x0bd2('0x3')](_0x5d701d,_0x231f0d);};}exports[_0x0bd2('0x4')]=function(_0x550f03){for(var _0xe39613=0x0,_0x45b631=events['length'];_0xe39613<_0x45b631;_0xe39613++){var _0x57dc02=events[_0xe39613];var _0x377853=createListener(_0x0bd2('0x5')+_0x57dc02,_0x550f03);TeamEvents['on'](_0x57dc02,_0x377853);}}; \ No newline at end of file +var _0x0b94=['./team.events','update','emit','removeListener','register','length','team:'];(function(_0xe1ce23,_0x5a7e17){var _0x1d4d18=function(_0xb87c1a){while(--_0xb87c1a){_0xe1ce23['push'](_0xe1ce23['shift']());}};_0x1d4d18(++_0x5a7e17);}(_0x0b94,0xaf));var _0x40b9=function(_0x220113,_0x3d2e32){_0x220113=_0x220113-0x0;var _0x1e69bd=_0x0b94[_0x220113];return _0x1e69bd;};'use strict';var TeamEvents=require(_0x40b9('0x0'));var events=['save','remove',_0x40b9('0x1')];function createListener(_0xac4bc3,_0x31c386){return function(_0x216979){_0x31c386[_0x40b9('0x2')](_0xac4bc3,_0x216979);};}function removeListener(_0x5aba5a,_0x48962d){return function(){TeamEvents[_0x40b9('0x3')](_0x5aba5a,_0x48962d);};}exports[_0x40b9('0x4')]=function(_0x155e57){for(var _0x5aa72c=0x0,_0x4625d1=events[_0x40b9('0x5')];_0x5aa72c<_0x4625d1;_0x5aa72c++){var _0x36f834=events[_0x5aa72c];var _0x230c1f=createListener(_0x40b9('0x6')+_0x36f834,_0x155e57);TeamEvents['on'](_0x36f834,_0x230c1f);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 3940131..2c84566 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 _0xbbc6=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbc6,0xa6));var _0x6bbc=function(_0x5503e4,_0x1f8bd6){_0x5503e4=_0x5503e4-0x0;var _0x9d5b84=_0xbbc6[_0x5503e4];return _0x9d5b84;};'use strict';var Sequelize=require(_0x6bbc('0x0'));module[_0x6bbc('0x1')]={'TeamId':{'type':Sequelize[_0x6bbc('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6bbc('0x2')]}}; \ No newline at end of file +var _0xb04a=['sequelize','exports','INTEGER'];(function(_0x4efe22,_0xd19b8e){var _0x31eace=function(_0x20a026){while(--_0x20a026){_0x4efe22['push'](_0x4efe22['shift']());}};_0x31eace(++_0xd19b8e);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xab04('0x0'));module[_0xab04('0x1')]={'TeamId':{'type':Sequelize[_0xab04('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xab04('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 4ebcacf..2d7fe6e 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 _0xd0a4=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','team_has_voice_prefixes','lodash','util'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xd0a4,0x166));var _0x4d0a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd0a4[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4d0a('0x0'));var util=require(_0x4d0a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4d0a('0x2'));var rp=require(_0x4d0a('0x3'));var fs=require('fs');var path=require(_0x4d0a('0x4'));var rimraf=require(_0x4d0a('0x5'));var config=require(_0x4d0a('0x6'));var attributes=require(_0x4d0a('0x7'));module[_0x4d0a('0x8')]=function(_0x25dfae,_0x330e38){return _0x25dfae['define']('TeamVoicePrefix',attributes,{'tableName':_0x4d0a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e34=['../../config/logger','api','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x37e521,_0x3a9edb){var _0x76cd78=function(_0x5424f5){while(--_0x5424f5){_0x37e521['push'](_0x37e521['shift']());}};_0x76cd78(++_0x3a9edb);}(_0x4e34,0x19e));var _0x44e3=function(_0x4eceae,_0x33edea){_0x4eceae=_0x4eceae-0x0;var _0x2a9886=_0x4e34[_0x4eceae];return _0x2a9886;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44e3('0x0'))(_0x44e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x44e3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44e3('0x3'));var config=require(_0x44e3('0x4'));var attributes=require(_0x44e3('0x5'));module['exports']=function(_0x50805a,_0x162bd9){return _0x50805a[_0x44e3('0x6')](_0x44e3('0x7'),attributes,{'tableName':_0x44e3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index f6078fe..8e85a6e 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x152b4a,_0x2c6fc9){var _0x5e5625=function(_0x410157){while(--_0x410157){_0x152b4a['push'](_0x152b4a['shift']());}};_0x5e5625(++_0x2c6fc9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x167b19,_0x56081a){var _0x1fcca2=function(_0x544ca4){while(--_0x544ca4){_0x167b19['push'](_0x167b19['shift']());}};_0x1fcca2(++_0x56081a);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 9d3644b..009dda8 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 _0x91f7=['sequelize','exports'];(function(_0x8ac6fb,_0x34a863){var _0x5a76aa=function(_0xce8b64){while(--_0xce8b64){_0x8ac6fb['push'](_0x8ac6fb['shift']());}};_0x5a76aa(++_0x34a863);}(_0x91f7,0x9c));var _0x791f=function(_0x312b03,_0x1e7b03){_0x312b03=_0x312b03-0x0;var _0x328fb1=_0x91f7[_0x312b03];return _0x328fb1;};'use strict';var Sequelize=require(_0x791f('0x0'));module[_0x791f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0be6=['INTEGER','sequelize'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0be6,0xff));var _0x60be=function(_0xbf488b,_0xec297b){_0xbf488b=_0xbf488b-0x0;var _0x50d59e=_0x0be6[_0xbf488b];return _0x50d59e;};'use strict';var Sequelize=require(_0x60be('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x60be('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 573e4da..0fb92f9 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 _0xa98d=['moment','bluebird','path','rimraf','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger'];(function(_0x12b7ac,_0xdb443d){var _0xd73f36=function(_0x30b443){while(--_0x30b443){_0x12b7ac['push'](_0x12b7ac['shift']());}};_0xd73f36(++_0xdb443d);}(_0xa98d,0xa3));var _0xda98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa98d[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xda98('0x0'));var util=require('util');var logger=require(_0xda98('0x1'))('api');var moment=require(_0xda98('0x2'));var BPromise=require(_0xda98('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda98('0x4'));var rimraf=require(_0xda98('0x5'));var config=require(_0xda98('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0xda98('0x7')]=function(_0x39acbf,_0x218e43){return _0x39acbf[_0xda98('0x8')](_0xda98('0x9'),attributes,{'tableName':_0xda98('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5178=['rimraf','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0x5178,0x171));var _0x8517=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5178[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var logger=require(_0x8517('0x1'))(_0x8517('0x2'));var moment=require(_0x8517('0x3'));var BPromise=require(_0x8517('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0x8517('0x7')]=function(_0x58ed7e,_0x13ba05){return _0x58ed7e[_0x8517('0x8')](_0x8517('0x9'),attributes,{'tableName':_0x8517('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index e03b160..45a0069 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 _0xd0e2=['rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xd0e2,0x1ad));var _0x2d0e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd0e2[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x2d0e('0x0'));var util=require(_0x2d0e('0x1'));var moment=require(_0x2d0e('0x2'));var BPromise=require(_0x2d0e('0x3'));var rs=require(_0x2d0e('0x4'));var fs=require('fs');var Redis=require(_0x2d0e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d0e('0x6'));var logger=require(_0x2d0e('0x7'))(_0x2d0e('0x8'));var config=require(_0x2d0e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2d0e('0xa')][_0x2d0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdd7b00,_0x5d361e,_0x25b17b){return new BPromise(function(_0x448617,_0x22f3fa){return client[_0x2d0e('0xc')](_0xdd7b00,_0x25b17b)[_0x2d0e('0xd')](function(_0x1b4ddd){logger[_0x2d0e('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5d361e,'request\x20sent');logger[_0x2d0e('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5d361e,_0x2d0e('0x10'),JSON[_0x2d0e('0x11')](_0x1b4ddd));if(_0x1b4ddd[_0x2d0e('0x12')]){if(_0x1b4ddd[_0x2d0e('0x12')][_0x2d0e('0x13')]===0x1f4){logger['error'](_0x2d0e('0x14'),_0x5d361e,_0x1b4ddd['error'][_0x2d0e('0x15')]);return _0x22f3fa(_0x1b4ddd[_0x2d0e('0x12')][_0x2d0e('0x15')]);}logger[_0x2d0e('0x12')](_0x2d0e('0x14'),_0x5d361e,_0x1b4ddd[_0x2d0e('0x12')][_0x2d0e('0x15')]);return _0x448617(_0x1b4ddd[_0x2d0e('0x12')][_0x2d0e('0x15')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x5d361e,'request\x20sent');_0x448617(_0x1b4ddd['result'][_0x2d0e('0x15')]);}})[_0x2d0e('0x16')](function(_0x53f834){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x5d361e,_0x53f834);_0x22f3fa(_0x53f834);});});} \ No newline at end of file +var _0xe3c8=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3427e7,_0x50b0c8){var _0x74cfee=function(_0x2d2031){while(--_0x2d2031){_0x3427e7['push'](_0x3427e7['shift']());}};_0x74cfee(++_0x50b0c8);}(_0xe3c8,0x145));var _0x8e3c=function(_0x3484b5,_0x1aaacc){_0x3484b5=_0x3484b5-0x0;var _0x3dc7b7=_0xe3c8[_0x3484b5];return _0x3dc7b7;};'use strict';var _=require(_0x8e3c('0x0'));var util=require(_0x8e3c('0x1'));var moment=require(_0x8e3c('0x2'));var BPromise=require(_0x8e3c('0x3'));var rs=require(_0x8e3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8e3c('0x5'));var logger=require('../../config/logger')(_0x8e3c('0x6'));var config=require(_0x8e3c('0x7'));var jayson=require(_0x8e3c('0x8'));var client=jayson[_0x8e3c('0x9')][_0x8e3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1a19,_0x3c6d0b,_0x29cdba){return new BPromise(function(_0x3d3a97,_0xadc123){return client[_0x8e3c('0xb')](_0x5c1a19,_0x29cdba)['then'](function(_0x5ee141){logger[_0x8e3c('0xc')](_0x8e3c('0xd'),_0x3c6d0b,_0x8e3c('0xe'));logger[_0x8e3c('0xf')](_0x8e3c('0x10'),_0x3c6d0b,_0x8e3c('0xe'),JSON[_0x8e3c('0x11')](_0x5ee141));if(_0x5ee141['error']){if(_0x5ee141[_0x8e3c('0x12')]['code']===0x1f4){logger[_0x8e3c('0x12')](_0x8e3c('0xd'),_0x3c6d0b,_0x5ee141['error'][_0x8e3c('0x13')]);return _0xadc123(_0x5ee141['error']['message']);}logger[_0x8e3c('0x12')](_0x8e3c('0xd'),_0x3c6d0b,_0x5ee141[_0x8e3c('0x12')]['message']);return _0x3d3a97(_0x5ee141[_0x8e3c('0x12')][_0x8e3c('0x13')]);}else{logger[_0x8e3c('0xc')](_0x8e3c('0xd'),_0x3c6d0b,'request\x20sent');_0x3d3a97(_0x5ee141['result'][_0x8e3c('0x13')]);}})['catch'](function(_0x18a073){logger[_0x8e3c('0x12')](_0x8e3c('0xd'),_0x3c6d0b,_0x18a073);_0xadc123(_0x18a073);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d521b5b..bf7116f 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 _0xa30a=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','get','/:id','post','create','put','destroy','exports','multer'];(function(_0xa6e4c8,_0x52e242){var _0x29e0c8=function(_0x2caaf2){while(--_0x2caaf2){_0xa6e4c8['push'](_0xa6e4c8['shift']());}};_0x29e0c8(++_0x52e242);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var path=require(_0xaa30('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa30('0x3'));var router=express[_0xaa30('0x4')]();var fs_extra=require(_0xaa30('0x5'));var auth=require(_0xaa30('0x6'));var interaction=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var controller=require(_0xaa30('0x9'));router['get']('/',auth[_0xaa30('0xa')](),controller['index']);router[_0xaa30('0xb')](_0xaa30('0xc'),auth[_0xaa30('0xa')](),controller['show']);router[_0xaa30('0xd')]('/',auth[_0xaa30('0xa')](),controller[_0xaa30('0xe')]);router[_0xaa30('0xf')](_0xaa30('0xc'),auth[_0xaa30('0xa')](),controller['update']);router['delete'](_0xaa30('0xc'),auth['isAuthenticated'](),controller[_0xaa30('0x10')]);module[_0xaa30('0x11')]=router; \ No newline at end of file +var _0xaaee=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index'];(function(_0x2ee6f6,_0x36c49b){var _0x29beec=function(_0xe53013){while(--_0xe53013){_0x2ee6f6['push'](_0x2ee6f6['shift']());}};_0x29beec(++_0x36c49b);}(_0xaaee,0xa9));var _0xeaae=function(_0x2d5c1b,_0x14acc5){_0x2d5c1b=_0x2d5c1b-0x0;var _0x182ec4=_0xaaee[_0x2d5c1b];return _0x182ec4;};'use strict';var multer=require(_0xeaae('0x0'));var util=require('util');var path=require(_0xeaae('0x1'));var timeout=require(_0xeaae('0x2'));var express=require('express');var router=express[_0xeaae('0x3')]();var fs_extra=require(_0xeaae('0x4'));var auth=require(_0xeaae('0x5'));var interaction=require(_0xeaae('0x6'));var config=require('../../config/environment');var controller=require(_0xeaae('0x7'));router[_0xeaae('0x8')]('/',auth[_0xeaae('0x9')](),controller[_0xeaae('0xa')]);router[_0xeaae('0x8')](_0xeaae('0xb'),auth['isAuthenticated'](),controller[_0xeaae('0xc')]);router[_0xeaae('0xd')]('/',auth[_0xeaae('0x9')](),controller[_0xeaae('0xe')]);router[_0xeaae('0xf')](_0xeaae('0xb'),auth[_0xeaae('0x9')](),controller[_0xeaae('0x10')]);router[_0xeaae('0x11')]('/:id',auth[_0xeaae('0x9')](),controller[_0xeaae('0x12')]);module[_0xeaae('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index ee0067f..7f49a90 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 _0x8544=['TEXT','exports','STRING'];(function(_0x243a8f,_0x2e82e7){var _0x3c109e=function(_0x404b94){while(--_0x404b94){_0x243a8f['push'](_0x243a8f['shift']());}};_0x3c109e(++_0x2e82e7);}(_0x8544,0x103));var _0x4854=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x8544[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require('sequelize');module[_0x4854('0x0')]={'name':{'type':Sequelize[_0x4854('0x1')]},'description':{'type':Sequelize[_0x4854('0x1')]},'html':{'type':Sequelize[_0x4854('0x2')]}}; \ No newline at end of file +var _0x7690=['TEXT','sequelize','STRING'];(function(_0x3c5e8b,_0x17513d){var _0x1784b6=function(_0x31cb23){while(--_0x31cb23){_0x3c5e8b['push'](_0x3c5e8b['shift']());}};_0x1784b6(++_0x17513d);}(_0x7690,0x1ba));var _0x0769=function(_0x16c2a4,_0x11afb6){_0x16c2a4=_0x16c2a4-0x0;var _0x5521a2=_0x7690[_0x16c2a4];return _0x5521a2;};'use strict';var Sequelize=require(_0x0769('0x0'));module['exports']={'name':{'type':Sequelize[_0x0769('0x1')]},'description':{'type':Sequelize[_0x0769('0x1')]},'html':{'type':Sequelize[_0x0769('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 02f8042..7a36016 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 _0xbe89=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','length','includeAll','include','find'];(function(_0x2eab64,_0x1e1644){var _0xbd6f45=function(_0x270f12){while(--_0x270f12){_0x2eab64['push'](_0x2eab64['shift']());}};_0xbd6f45(++_0x1e1644);}(_0xbe89,0x151));var _0x9be8=function(_0x5c220b,_0xe18b77){_0x5c220b=_0x5c220b-0x0;var _0x5df757=_0xbe89[_0x5c220b];return _0x5df757;};'use strict';var emlformat=require(_0x9be8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9be8('0x1'));var jsonpatch=require(_0x9be8('0x2'));var rp=require(_0x9be8('0x3'));var moment=require(_0x9be8('0x4'));var BPromise=require(_0x9be8('0x5'));var Mustache=require(_0x9be8('0x6'));var util=require('util');var path=require(_0x9be8('0x7'));var sox=require(_0x9be8('0x8'));var csv=require(_0x9be8('0x9'));var ejs=require(_0x9be8('0xa'));var fs=require('fs');var fs_extra=require(_0x9be8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9be8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9be8('0x9'));var querystring=require(_0x9be8('0xd'));var Papa=require(_0x9be8('0xe'));var Redis=require(_0x9be8('0xf'));var authService=require(_0x9be8('0x10'));var qs=require(_0x9be8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9be8('0x12'));var logger=require(_0x9be8('0x13'))(_0x9be8('0x14'));var utils=require(_0x9be8('0x15'));var config=require(_0x9be8('0x16'));var licenseUtil=require(_0x9be8('0x17'));var db=require(_0x9be8('0x18'))['db'];function respondWithStatusCode(_0x3f99fb,_0x2cb91e){_0x2cb91e=_0x2cb91e||0xcc;return function(_0x2a933c){if(_0x2a933c){return _0x3f99fb[_0x9be8('0x19')](_0x2cb91e);}return _0x3f99fb[_0x9be8('0x1a')](_0x2cb91e)[_0x9be8('0x1b')]();};}function respondWithResult(_0x2d10bf,_0x3afb2f){_0x3afb2f=_0x3afb2f||0xc8;return function(_0x2d79c3){if(_0x2d79c3){return _0x2d10bf['status'](_0x3afb2f)[_0x9be8('0x1c')](_0x2d79c3);}};}function respondWithFilteredResult(_0x40db02,_0x5bf757){return function(_0x8461cc){if(_0x8461cc){var _0x48813f=typeof _0x5bf757[_0x9be8('0x1d')]===_0x9be8('0x1e')&&typeof _0x5bf757[_0x9be8('0x1f')]===_0x9be8('0x1e');var _0x138653=_0x8461cc[_0x9be8('0x20')];var _0x162f35=_0x48813f?0x0:_0x5bf757[_0x9be8('0x1d')];var _0x55a040=_0x48813f?_0x8461cc['count']:_0x5bf757[_0x9be8('0x1d')]+_0x5bf757[_0x9be8('0x1f')];var _0x1ac032;if(_0x55a040>=_0x138653){_0x55a040=_0x138653;_0x1ac032=0xc8;}else{_0x1ac032=0xce;}_0x40db02[_0x9be8('0x1a')](_0x1ac032);return _0x40db02[_0x9be8('0x21')]('Content-Range',_0x162f35+'-'+_0x55a040+'/'+_0x138653)[_0x9be8('0x1c')](_0x8461cc);}return null;};}function patchUpdates(_0x16924b){return function(_0x2aeaf1){try{jsonpatch[_0x9be8('0x22')](_0x2aeaf1,_0x16924b,!![]);}catch(_0x313c7b){return BPromise['reject'](_0x313c7b);}return _0x2aeaf1['save']();};}function saveUpdates(_0x4f9ec5,_0x896697){return function(_0x58688c){if(_0x58688c){return _0x58688c[_0x9be8('0x23')](_0x4f9ec5)['then'](function(_0x262aaa){return _0x262aaa;});}return null;};}function removeEntity(_0x3506c8,_0x4cec89){return function(_0x578527){if(_0x578527){return _0x578527[_0x9be8('0x24')]()[_0x9be8('0x25')](function(){var _0x5cbf39=_0x578527[_0x9be8('0x26')]({'plain':!![]});var _0x14f496='Templates';return db[_0x9be8('0x27')]['destroy']({'where':{'type':_0x14f496,'resourceId':_0x5cbf39['id']}})['then'](function(){return _0x578527;});})['then'](function(){_0x3506c8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53d3f1,_0x38d87f){return function(_0x4f0143){if(!_0x4f0143){_0x53d3f1[_0x9be8('0x19')](0x194);}return _0x4f0143;};}function handleError(_0x26dacd,_0x2200a3){_0x2200a3=_0x2200a3||0x1f4;return function(_0x2d6d52){logger[_0x9be8('0x28')](_0x2d6d52[_0x9be8('0x29')]);if(_0x2d6d52[_0x9be8('0x2a')]){delete _0x2d6d52['name'];}_0x26dacd['status'](_0x2200a3)[_0x9be8('0x2b')](_0x2d6d52);};}exports[_0x9be8('0x2c')]=function(_0x38e1db,_0x5e27a8){var _0x5c8907={},_0x1b5523={},_0x44093f={'count':0x0,'rows':[]};var _0xe96d51=_[_0x9be8('0x2d')](db[_0x9be8('0x2e')][_0x9be8('0x2f')],function(_0xa38682){return{'name':_0xa38682[_0x9be8('0x30')],'type':_0xa38682[_0x9be8('0x31')]['key']};});_0x1b5523[_0x9be8('0x32')]=_['map'](_0xe96d51,_0x9be8('0x2a'));_0x1b5523[_0x9be8('0x33')]=_[_0x9be8('0x34')](_0x38e1db['query']);_0x1b5523[_0x9be8('0x35')]=_[_0x9be8('0x36')](_0x1b5523[_0x9be8('0x32')],_0x1b5523[_0x9be8('0x33')]);_0x5c8907[_0x9be8('0x37')]=_[_0x9be8('0x36')](_0x1b5523[_0x9be8('0x32')],qs['fields'](_0x38e1db['query'][_0x9be8('0x38')]));_0x5c8907[_0x9be8('0x37')]=_0x5c8907['attributes']['length']?_0x5c8907[_0x9be8('0x37')]:_0x1b5523[_0x9be8('0x32')];if(!_0x38e1db[_0x9be8('0x33')][_0x9be8('0x39')]('nolimit')){_0x5c8907[_0x9be8('0x1f')]=qs['limit'](_0x38e1db[_0x9be8('0x33')][_0x9be8('0x1f')]);_0x5c8907[_0x9be8('0x1d')]=qs[_0x9be8('0x1d')](_0x38e1db[_0x9be8('0x33')][_0x9be8('0x1d')]);}_0x5c8907['order']=qs[_0x9be8('0x3a')](_0x38e1db[_0x9be8('0x33')][_0x9be8('0x3a')]);_0x5c8907[_0x9be8('0x3b')]=qs[_0x9be8('0x35')](_[_0x9be8('0x3c')](_0x38e1db[_0x9be8('0x33')],_0x1b5523[_0x9be8('0x35')]),_0xe96d51);if(_0x38e1db['query'][_0x9be8('0x3d')]){_0x5c8907['where']=_[_0x9be8('0x3e')](_0x5c8907[_0x9be8('0x3b')],{'$or':_[_0x9be8('0x2d')](_0xe96d51,function(_0x225a95){if(_0x225a95[_0x9be8('0x31')]!==_0x9be8('0x3f')){var _0x18c0db={};_0x18c0db[_0x225a95[_0x9be8('0x2a')]]={'$like':'%'+_0x38e1db[_0x9be8('0x33')]['filter']+'%'};return _0x18c0db;}})});}_0x5c8907=_[_0x9be8('0x3e')]({},_0x5c8907,_0x38e1db[_0x9be8('0x40')]);var _0x29ef61={'where':_0x5c8907[_0x9be8('0x3b')]};return db[_0x9be8('0x2e')][_0x9be8('0x20')](_0x29ef61)[_0x9be8('0x25')](function(_0x2fd315){_0x44093f[_0x9be8('0x20')]=_0x2fd315;if(_0x38e1db[_0x9be8('0x33')]['includeAll']){_0x5c8907['include']=[{'all':!![]}];}return db[_0x9be8('0x2e')]['findAll'](_0x5c8907);})[_0x9be8('0x25')](function(_0x26e9a0){_0x44093f[_0x9be8('0x41')]=_0x26e9a0;return _0x44093f;})[_0x9be8('0x25')](respondWithFilteredResult(_0x5e27a8,_0x5c8907))[_0x9be8('0x42')](handleError(_0x5e27a8,null));};exports[_0x9be8('0x43')]=function(_0x282bc8,_0x403637){var _0x21ac28={'raw':!![],'where':{'id':_0x282bc8[_0x9be8('0x44')]['id']}},_0x318b20={};_0x318b20[_0x9be8('0x32')]=_['keys'](db[_0x9be8('0x2e')][_0x9be8('0x2f')]);_0x318b20[_0x9be8('0x33')]=_[_0x9be8('0x34')](_0x282bc8[_0x9be8('0x33')]);_0x318b20['filters']=_['intersection'](_0x318b20[_0x9be8('0x32')],_0x318b20[_0x9be8('0x33')]);_0x21ac28[_0x9be8('0x37')]=_[_0x9be8('0x36')](_0x318b20['model'],qs[_0x9be8('0x38')](_0x282bc8[_0x9be8('0x33')][_0x9be8('0x38')]));_0x21ac28[_0x9be8('0x37')]=_0x21ac28[_0x9be8('0x37')][_0x9be8('0x45')]?_0x21ac28[_0x9be8('0x37')]:_0x318b20[_0x9be8('0x32')];if(_0x282bc8[_0x9be8('0x33')][_0x9be8('0x46')]){_0x21ac28[_0x9be8('0x47')]=[{'all':!![]}];}_0x21ac28=_[_0x9be8('0x3e')]({},_0x21ac28,_0x282bc8[_0x9be8('0x40')]);return db['Template'][_0x9be8('0x48')](_0x21ac28)[_0x9be8('0x25')](handleEntityNotFound(_0x403637,null))[_0x9be8('0x25')](respondWithResult(_0x403637,null))[_0x9be8('0x42')](handleError(_0x403637,null));};exports[_0x9be8('0x49')]=function(_0x2ed256,_0x5b8ca9){return db[_0x9be8('0x2e')][_0x9be8('0x49')](_0x2ed256[_0x9be8('0x4a')],{})[_0x9be8('0x25')](function(_0x492806){var _0x2c5cfb=_0x2ed256[_0x9be8('0x4b')][_0x9be8('0x26')]({'plain':!![]});if(!_0x2c5cfb)throw new Error(_0x9be8('0x4c'));if(_0x2c5cfb[_0x9be8('0x4d')]===_0x9be8('0x4b')){var _0x5e3fa1=_0x492806[_0x9be8('0x26')]({'plain':!![]});var _0x45a986=_0x9be8('0x4e');return db[_0x9be8('0x4f')]['find']({'where':{'name':_0x45a986,'userProfileId':_0x2c5cfb[_0x9be8('0x50')]},'raw':!![]})[_0x9be8('0x25')](function(_0x4934c9){if(_0x4934c9&&_0x4934c9['autoAssociation']===0x0){return db[_0x9be8('0x27')][_0x9be8('0x49')]({'name':_0x5e3fa1['name'],'resourceId':_0x5e3fa1['id'],'type':_0x4934c9['name'],'sectionId':_0x4934c9['id']},{})['then'](function(){return _0x492806;});}else{return _0x492806;}})[_0x9be8('0x42')](function(_0x56e5da){logger['error'](_0x9be8('0x51'),_0x56e5da);throw _0x56e5da;});}return _0x492806;})[_0x9be8('0x25')](respondWithResult(_0x5b8ca9,0xc9))[_0x9be8('0x42')](handleError(_0x5b8ca9,null));};exports[_0x9be8('0x23')]=function(_0x378c6c,_0x46d8bb){if(_0x378c6c[_0x9be8('0x4a')]['id']){delete _0x378c6c['body']['id'];}return db[_0x9be8('0x2e')][_0x9be8('0x48')]({'where':{'id':_0x378c6c[_0x9be8('0x44')]['id']}})[_0x9be8('0x25')](handleEntityNotFound(_0x46d8bb,null))[_0x9be8('0x25')](saveUpdates(_0x378c6c[_0x9be8('0x4a')],null))[_0x9be8('0x25')](respondWithResult(_0x46d8bb,null))[_0x9be8('0x42')](handleError(_0x46d8bb,null));};exports[_0x9be8('0x24')]=function(_0x31e21e,_0x1bcfa6){return db['Template'][_0x9be8('0x48')]({'where':{'id':_0x31e21e[_0x9be8('0x44')]['id']}})[_0x9be8('0x25')](handleEntityNotFound(_0x1bcfa6,null))[_0x9be8('0x25')](removeEntity(_0x1bcfa6,null))[_0x9be8('0x42')](handleError(_0x1bcfa6,null));}; \ No newline at end of file +var _0x9e99=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','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','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','Templates','destroy','error','stack','name','send','index','map','Template','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','params','rawAttributes','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x9e99,0x103));var _0x99e9=function(_0x3d6f6b,_0x289a46){_0x3d6f6b=_0x3d6f6b-0x0;var _0x49cddb=_0x9e99[_0x3d6f6b];return _0x49cddb;};'use strict';var emlformat=require(_0x99e9('0x0'));var rimraf=require(_0x99e9('0x1'));var zipdir=require(_0x99e9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99e9('0x3'));var moment=require(_0x99e9('0x4'));var BPromise=require(_0x99e9('0x5'));var Mustache=require(_0x99e9('0x6'));var util=require(_0x99e9('0x7'));var path=require(_0x99e9('0x8'));var sox=require('sox');var csv=require(_0x99e9('0x9'));var ejs=require(_0x99e9('0xa'));var fs=require('fs');var fs_extra=require(_0x99e9('0xb'));var _=require(_0x99e9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x99e9('0xd'));var Papa=require(_0x99e9('0xe'));var Redis=require(_0x99e9('0xf'));var authService=require(_0x99e9('0x10'));var qs=require(_0x99e9('0x11'));var as=require(_0x99e9('0x12'));var hardwareService=require(_0x99e9('0x13'));var logger=require(_0x99e9('0x14'))(_0x99e9('0x15'));var utils=require('../../config/utils');var config=require(_0x99e9('0x16'));var licenseUtil=require(_0x99e9('0x17'));var db=require(_0x99e9('0x18'))['db'];function respondWithStatusCode(_0x5c8f7d,_0x332a16){_0x332a16=_0x332a16||0xcc;return function(_0x360ab2){if(_0x360ab2){return _0x5c8f7d[_0x99e9('0x19')](_0x332a16);}return _0x5c8f7d['status'](_0x332a16)[_0x99e9('0x1a')]();};}function respondWithResult(_0x2ed245,_0x366acd){_0x366acd=_0x366acd||0xc8;return function(_0x11bf0b){if(_0x11bf0b){return _0x2ed245[_0x99e9('0x1b')](_0x366acd)[_0x99e9('0x1c')](_0x11bf0b);}};}function respondWithFilteredResult(_0x2343d6,_0x10e00b){return function(_0x6a3548){if(_0x6a3548){var _0x4c9540=typeof _0x10e00b[_0x99e9('0x1d')]===_0x99e9('0x1e')&&typeof _0x10e00b[_0x99e9('0x1f')]===_0x99e9('0x1e');var _0x3826bf=_0x6a3548[_0x99e9('0x20')];var _0x181dba=_0x4c9540?0x0:_0x10e00b['offset'];var _0x304381=_0x4c9540?_0x6a3548[_0x99e9('0x20')]:_0x10e00b['offset']+_0x10e00b['limit'];var _0x22416b;if(_0x304381>=_0x3826bf){_0x304381=_0x3826bf;_0x22416b=0xc8;}else{_0x22416b=0xce;}_0x2343d6[_0x99e9('0x1b')](_0x22416b);return _0x2343d6[_0x99e9('0x21')](_0x99e9('0x22'),_0x181dba+'-'+_0x304381+'/'+_0x3826bf)[_0x99e9('0x1c')](_0x6a3548);}return null;};}function patchUpdates(_0x1787dd){return function(_0x3d7e17){try{jsonpatch[_0x99e9('0x23')](_0x3d7e17,_0x1787dd,!![]);}catch(_0x507de7){return BPromise['reject'](_0x507de7);}return _0x3d7e17[_0x99e9('0x24')]();};}function saveUpdates(_0x3d4f5d,_0xec5c4f){return function(_0x1bc199){if(_0x1bc199){return _0x1bc199['update'](_0x3d4f5d)[_0x99e9('0x25')](function(_0x12981b){return _0x12981b;});}return null;};}function removeEntity(_0xc920f9,_0x1b8159){return function(_0xf26ebd){if(_0xf26ebd){return _0xf26ebd['destroy']()[_0x99e9('0x25')](function(){var _0x313520=_0xf26ebd[_0x99e9('0x26')]({'plain':!![]});var _0x4f3456=_0x99e9('0x27');return db['UserProfileResource'][_0x99e9('0x28')]({'where':{'type':_0x4f3456,'resourceId':_0x313520['id']}})[_0x99e9('0x25')](function(){return _0xf26ebd;});})[_0x99e9('0x25')](function(){_0xc920f9[_0x99e9('0x1b')](0xcc)[_0x99e9('0x1a')]();});}};}function handleEntityNotFound(_0x4f188b,_0x1ff4dc){return function(_0x3ecb9b){if(!_0x3ecb9b){_0x4f188b['sendStatus'](0x194);}return _0x3ecb9b;};}function handleError(_0x20600d,_0x5f1896){_0x5f1896=_0x5f1896||0x1f4;return function(_0x24a814){logger[_0x99e9('0x29')](_0x24a814[_0x99e9('0x2a')]);if(_0x24a814[_0x99e9('0x2b')]){delete _0x24a814['name'];}_0x20600d['status'](_0x5f1896)[_0x99e9('0x2c')](_0x24a814);};}exports[_0x99e9('0x2d')]=function(_0x3e250f,_0x277c92){var _0x38b997={},_0x206d8a={},_0x1de8a4={'count':0x0,'rows':[]};var _0x2d1434=_[_0x99e9('0x2e')](db[_0x99e9('0x2f')]['rawAttributes'],function(_0x2fd6f8){return{'name':_0x2fd6f8[_0x99e9('0x30')],'type':_0x2fd6f8['type'][_0x99e9('0x31')]};});_0x206d8a['model']=_[_0x99e9('0x2e')](_0x2d1434,_0x99e9('0x2b'));_0x206d8a['query']=_[_0x99e9('0x32')](_0x3e250f[_0x99e9('0x33')]);_0x206d8a[_0x99e9('0x34')]=_[_0x99e9('0x35')](_0x206d8a['model'],_0x206d8a['query']);_0x38b997[_0x99e9('0x36')]=_[_0x99e9('0x35')](_0x206d8a[_0x99e9('0x37')],qs['fields'](_0x3e250f[_0x99e9('0x33')][_0x99e9('0x38')]));_0x38b997['attributes']=_0x38b997['attributes'][_0x99e9('0x39')]?_0x38b997['attributes']:_0x206d8a[_0x99e9('0x37')];if(!_0x3e250f[_0x99e9('0x33')][_0x99e9('0x3a')](_0x99e9('0x3b'))){_0x38b997[_0x99e9('0x1f')]=qs['limit'](_0x3e250f[_0x99e9('0x33')][_0x99e9('0x1f')]);_0x38b997[_0x99e9('0x1d')]=qs['offset'](_0x3e250f[_0x99e9('0x33')][_0x99e9('0x1d')]);}_0x38b997[_0x99e9('0x3c')]=qs[_0x99e9('0x3d')](_0x3e250f[_0x99e9('0x33')]['sort']);_0x38b997[_0x99e9('0x3e')]=qs['filters'](_[_0x99e9('0x3f')](_0x3e250f[_0x99e9('0x33')],_0x206d8a[_0x99e9('0x34')]),_0x2d1434);if(_0x3e250f[_0x99e9('0x33')][_0x99e9('0x40')]){_0x38b997[_0x99e9('0x3e')]=_[_0x99e9('0x41')](_0x38b997['where'],{'$or':_[_0x99e9('0x2e')](_0x2d1434,function(_0x356a5b){if(_0x356a5b[_0x99e9('0x42')]!=='VIRTUAL'){var _0xda7aa8={};_0xda7aa8[_0x356a5b['name']]={'$like':'%'+_0x3e250f[_0x99e9('0x33')][_0x99e9('0x40')]+'%'};return _0xda7aa8;}})});}_0x38b997=_[_0x99e9('0x41')]({},_0x38b997,_0x3e250f[_0x99e9('0x43')]);var _0x444e99={'where':_0x38b997[_0x99e9('0x3e')]};return db[_0x99e9('0x2f')]['count'](_0x444e99)[_0x99e9('0x25')](function(_0x467ce2){_0x1de8a4[_0x99e9('0x20')]=_0x467ce2;if(_0x3e250f['query']['includeAll']){_0x38b997[_0x99e9('0x44')]=[{'all':!![]}];}return db[_0x99e9('0x2f')][_0x99e9('0x45')](_0x38b997);})['then'](function(_0x22225f){_0x1de8a4['rows']=_0x22225f;return _0x1de8a4;})[_0x99e9('0x25')](respondWithFilteredResult(_0x277c92,_0x38b997))['catch'](handleError(_0x277c92,null));};exports['show']=function(_0x3f1166,_0x4a5137){var _0x4b8f87={'raw':!![],'where':{'id':_0x3f1166[_0x99e9('0x46')]['id']}},_0x30f45c={};_0x30f45c['model']=_[_0x99e9('0x32')](db[_0x99e9('0x2f')][_0x99e9('0x47')]);_0x30f45c['query']=_[_0x99e9('0x32')](_0x3f1166['query']);_0x30f45c[_0x99e9('0x34')]=_[_0x99e9('0x35')](_0x30f45c['model'],_0x30f45c['query']);_0x4b8f87['attributes']=_[_0x99e9('0x35')](_0x30f45c['model'],qs[_0x99e9('0x38')](_0x3f1166[_0x99e9('0x33')][_0x99e9('0x38')]));_0x4b8f87[_0x99e9('0x36')]=_0x4b8f87[_0x99e9('0x36')][_0x99e9('0x39')]?_0x4b8f87[_0x99e9('0x36')]:_0x30f45c[_0x99e9('0x37')];if(_0x3f1166[_0x99e9('0x33')][_0x99e9('0x48')]){_0x4b8f87['include']=[{'all':!![]}];}_0x4b8f87=_['merge']({},_0x4b8f87,_0x3f1166[_0x99e9('0x43')]);return db[_0x99e9('0x2f')][_0x99e9('0x49')](_0x4b8f87)[_0x99e9('0x25')](handleEntityNotFound(_0x4a5137,null))[_0x99e9('0x25')](respondWithResult(_0x4a5137,null))[_0x99e9('0x4a')](handleError(_0x4a5137,null));};exports[_0x99e9('0x4b')]=function(_0x10bbca,_0xd10edf){return db['Template'][_0x99e9('0x4b')](_0x10bbca[_0x99e9('0x4c')],{})[_0x99e9('0x25')](function(_0x12ba47){var _0x45b7c0=_0x10bbca[_0x99e9('0x4d')][_0x99e9('0x26')]({'plain':!![]});if(!_0x45b7c0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45b7c0[_0x99e9('0x4e')]===_0x99e9('0x4d')){var _0x3ec72a=_0x12ba47['get']({'plain':!![]});var _0x2ec5eb=_0x99e9('0x27');return db[_0x99e9('0x4f')]['find']({'where':{'name':_0x2ec5eb,'userProfileId':_0x45b7c0[_0x99e9('0x50')]},'raw':!![]})[_0x99e9('0x25')](function(_0x2216f8){if(_0x2216f8&&_0x2216f8[_0x99e9('0x51')]===0x0){return db[_0x99e9('0x52')][_0x99e9('0x4b')]({'name':_0x3ec72a[_0x99e9('0x2b')],'resourceId':_0x3ec72a['id'],'type':_0x2216f8[_0x99e9('0x2b')],'sectionId':_0x2216f8['id']},{})['then'](function(){return _0x12ba47;});}else{return _0x12ba47;}})[_0x99e9('0x4a')](function(_0x4f26ee){logger[_0x99e9('0x29')](_0x99e9('0x53'),_0x4f26ee);throw _0x4f26ee;});}return _0x12ba47;})[_0x99e9('0x25')](respondWithResult(_0xd10edf,0xc9))['catch'](handleError(_0xd10edf,null));};exports[_0x99e9('0x54')]=function(_0x4c9ff6,_0x3f9b1f){if(_0x4c9ff6[_0x99e9('0x4c')]['id']){delete _0x4c9ff6[_0x99e9('0x4c')]['id'];}return db[_0x99e9('0x2f')][_0x99e9('0x49')]({'where':{'id':_0x4c9ff6[_0x99e9('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f9b1f,null))[_0x99e9('0x25')](saveUpdates(_0x4c9ff6[_0x99e9('0x4c')],null))[_0x99e9('0x25')](respondWithResult(_0x3f9b1f,null))[_0x99e9('0x4a')](handleError(_0x3f9b1f,null));};exports[_0x99e9('0x28')]=function(_0x4c8ef7,_0x592722){return db[_0x99e9('0x2f')][_0x99e9('0x49')]({'where':{'id':_0x4c8ef7['params']['id']}})[_0x99e9('0x25')](handleEntityNotFound(_0x592722,null))[_0x99e9('0x25')](removeEntity(_0x592722,null))[_0x99e9('0x4a')](handleError(_0x592722,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 822e57b..faae24b 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 _0x0cce=['util','../../config/logger','api','moment','bluebird','request-promise','./template.attributes','define','Template','tools_templates','lodash'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x0cce,0x1ac));var _0xe0cc=function(_0x4496d4,_0x35a23c){_0x4496d4=_0x4496d4-0x0;var _0x549149=_0x0cce[_0x4496d4];return _0x549149;};'use strict';var _=require(_0xe0cc('0x0'));var util=require(_0xe0cc('0x1'));var logger=require(_0xe0cc('0x2'))(_0xe0cc('0x3'));var moment=require(_0xe0cc('0x4'));var BPromise=require(_0xe0cc('0x5'));var rp=require(_0xe0cc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe0cc('0x7'));module['exports']=function(_0xf4b5c2,_0x5e6f30){return _0xf4b5c2[_0xe0cc('0x8')](_0xe0cc('0x9'),attributes,{'tableName':_0xe0cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29ed=['define','Template','tools_templates','lodash','util','../../config/logger','api','exports'];(function(_0x460006,_0x36e834){var _0x54a152=function(_0x1de973){while(--_0x1de973){_0x460006['push'](_0x460006['shift']());}};_0x54a152(++_0x36e834);}(_0x29ed,0x1db));var _0xd29e=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x29ed[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xd29e('0x0'));var util=require(_0xd29e('0x1'));var logger=require(_0xd29e('0x2'))(_0xd29e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0xd29e('0x4')]=function(_0x54691f,_0x30ab8b){return _0x54691f[_0xd29e('0x5')](_0xd29e('0x6'),attributes,{'tableName':_0xd29e('0x7'),'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 06aaa2e..2182f4c 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 _0xf70a=['model','GetTemplate','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','Template','findAll','options','raw','attributes','include','map'];(function(_0x37c054,_0x1cf983){var _0x20e5ef=function(_0x159450){while(--_0x159450){_0x37c054['push'](_0x37c054['shift']());}};_0x20e5ef(++_0x1cf983);}(_0xf70a,0xea));var _0xaf70=function(_0x80544e,_0x37a3f3){_0x80544e=_0x80544e-0x0;var _0x4f9b90=_0xf70a[_0x80544e];return _0x4f9b90;};'use strict';var _=require(_0xaf70('0x0'));var util=require(_0xaf70('0x1'));var moment=require(_0xaf70('0x2'));var BPromise=require(_0xaf70('0x3'));var rs=require(_0xaf70('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf70('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaf70('0x6'));var config=require(_0xaf70('0x7'));var jayson=require(_0xaf70('0x8'));var client=jayson[_0xaf70('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40c694,_0x3f2288,_0x233f29){return new BPromise(function(_0x5222a3,_0x4546c9){return client['request'](_0x40c694,_0x233f29)['then'](function(_0x56e4c0){logger['info'](_0xaf70('0xa'),_0x3f2288,_0xaf70('0xb'));logger[_0xaf70('0xc')](_0xaf70('0xd'),_0x3f2288,_0xaf70('0xb'),JSON[_0xaf70('0xe')](_0x56e4c0));if(_0x56e4c0[_0xaf70('0xf')]){if(_0x56e4c0[_0xaf70('0xf')]['code']===0x1f4){logger[_0xaf70('0xf')](_0xaf70('0xa'),_0x3f2288,_0x56e4c0[_0xaf70('0xf')][_0xaf70('0x10')]);return _0x4546c9(_0x56e4c0[_0xaf70('0xf')][_0xaf70('0x10')]);}logger[_0xaf70('0xf')]('Template,\x20%s,\x20%s',_0x3f2288,_0x56e4c0['error']['message']);return _0x5222a3(_0x56e4c0[_0xaf70('0xf')]['message']);}else{logger[_0xaf70('0x11')](_0xaf70('0xa'),_0x3f2288,_0xaf70('0xb'));_0x5222a3(_0x56e4c0[_0xaf70('0x12')]['message']);}})[_0xaf70('0x13')](function(_0x463ee9){logger['error'](_0xaf70('0xa'),_0x3f2288,_0x463ee9);_0x4546c9(_0x463ee9);});});}exports['GetTemplate']=function(_0x19e62e){var _0xe71f70=this;return new Promise(function(_0x3ac655,_0x5d3dbd){return db[_0xaf70('0x14')][_0xaf70('0x15')]({'raw':_0x19e62e[_0xaf70('0x16')]?_0x19e62e['options'][_0xaf70('0x17')]===undefined?!![]:![]:!![],'where':_0x19e62e['options']?_0x19e62e[_0xaf70('0x16')]['where']||null:null,'attributes':_0x19e62e[_0xaf70('0x16')]?_0x19e62e[_0xaf70('0x16')][_0xaf70('0x18')]||null:null,'limit':_0x19e62e['options']?_0x19e62e[_0xaf70('0x16')]['limit']||null:null,'include':_0x19e62e['options']?_0x19e62e[_0xaf70('0x16')][_0xaf70('0x19')]?_[_0xaf70('0x1a')](_0x19e62e['options'][_0xaf70('0x19')],function(_0x4d9e7c){return{'model':db[_0x4d9e7c['model']],'as':_0x4d9e7c['as'],'attributes':_0x4d9e7c[_0xaf70('0x18')],'include':_0x4d9e7c[_0xaf70('0x19')]?_['map'](_0x4d9e7c[_0xaf70('0x19')],function(_0x3b5dee){return{'model':db[_0x3b5dee[_0xaf70('0x1b')]],'as':_0x3b5dee['as'],'attributes':_0x3b5dee[_0xaf70('0x18')],'include':_0x3b5dee[_0xaf70('0x19')]?_['map'](_0x3b5dee[_0xaf70('0x19')],function(_0xd8dedc){return{'model':db[_0xd8dedc['model']],'as':_0xd8dedc['as'],'attributes':_0xd8dedc[_0xaf70('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52591e){logger[_0xaf70('0x11')](_0xaf70('0x1c'),_0x19e62e);logger[_0xaf70('0xc')](_0xaf70('0x1c'),_0x19e62e,JSON[_0xaf70('0xe')](_0x52591e));_0x3ac655(_0x52591e);})['catch'](function(_0x212d4a){logger[_0xaf70('0xf')](_0xaf70('0x1c'),_0x212d4a['message'],_0x19e62e);_0x5d3dbd(_0xe71f70[_0xaf70('0xf')](0x1f4,_0x212d4a[_0xaf70('0x10')]));});});}; \ No newline at end of file +var _0x5c27=['attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','GetTemplate','Template','findAll','options','raw','where'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0x5c27,0x91));var _0x75c2=function(_0x59bed0,_0xad50a5){_0x59bed0=_0x59bed0-0x0;var _0x2e5d4c=_0x5c27[_0x59bed0];return _0x2e5d4c;};'use strict';var _=require(_0x75c2('0x0'));var util=require('util');var moment=require(_0x75c2('0x1'));var BPromise=require(_0x75c2('0x2'));var rs=require(_0x75c2('0x3'));var fs=require('fs');var Redis=require(_0x75c2('0x4'));var db=require(_0x75c2('0x5'))['db'];var utils=require(_0x75c2('0x6'));var logger=require(_0x75c2('0x7'))('rpc');var config=require(_0x75c2('0x8'));var jayson=require(_0x75c2('0x9'));var client=jayson[_0x75c2('0xa')][_0x75c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38b312,_0x388fab,_0x56fc79){return new BPromise(function(_0x42c7b2,_0x567b49){return client[_0x75c2('0xc')](_0x38b312,_0x56fc79)[_0x75c2('0xd')](function(_0x4e2d24){logger[_0x75c2('0xe')]('Template,\x20%s,\x20%s',_0x388fab,_0x75c2('0xf'));logger[_0x75c2('0x10')](_0x75c2('0x11'),_0x388fab,_0x75c2('0xf'),JSON[_0x75c2('0x12')](_0x4e2d24));if(_0x4e2d24['error']){if(_0x4e2d24[_0x75c2('0x13')][_0x75c2('0x14')]===0x1f4){logger[_0x75c2('0x13')](_0x75c2('0x15'),_0x388fab,_0x4e2d24[_0x75c2('0x13')][_0x75c2('0x16')]);return _0x567b49(_0x4e2d24['error'][_0x75c2('0x16')]);}logger[_0x75c2('0x13')](_0x75c2('0x15'),_0x388fab,_0x4e2d24[_0x75c2('0x13')][_0x75c2('0x16')]);return _0x42c7b2(_0x4e2d24[_0x75c2('0x13')][_0x75c2('0x16')]);}else{logger[_0x75c2('0xe')](_0x75c2('0x15'),_0x388fab,_0x75c2('0xf'));_0x42c7b2(_0x4e2d24[_0x75c2('0x17')][_0x75c2('0x16')]);}})['catch'](function(_0x2a97fc){logger[_0x75c2('0x13')](_0x75c2('0x15'),_0x388fab,_0x2a97fc);_0x567b49(_0x2a97fc);});});}exports[_0x75c2('0x18')]=function(_0x38eac1){var _0x5c5b3d=this;return new Promise(function(_0x493d7d,_0x3ebe6d){return db[_0x75c2('0x19')][_0x75c2('0x1a')]({'raw':_0x38eac1[_0x75c2('0x1b')]?_0x38eac1[_0x75c2('0x1b')][_0x75c2('0x1c')]===undefined?!![]:![]:!![],'where':_0x38eac1[_0x75c2('0x1b')]?_0x38eac1['options'][_0x75c2('0x1d')]||null:null,'attributes':_0x38eac1[_0x75c2('0x1b')]?_0x38eac1[_0x75c2('0x1b')][_0x75c2('0x1e')]||null:null,'limit':_0x38eac1[_0x75c2('0x1b')]?_0x38eac1[_0x75c2('0x1b')]['limit']||null:null,'include':_0x38eac1[_0x75c2('0x1b')]?_0x38eac1['options'][_0x75c2('0x1f')]?_[_0x75c2('0x20')](_0x38eac1[_0x75c2('0x1b')][_0x75c2('0x1f')],function(_0x2624d9){return{'model':db[_0x2624d9[_0x75c2('0x21')]],'as':_0x2624d9['as'],'attributes':_0x2624d9[_0x75c2('0x1e')],'include':_0x2624d9[_0x75c2('0x1f')]?_['map'](_0x2624d9[_0x75c2('0x1f')],function(_0x53e083){return{'model':db[_0x53e083[_0x75c2('0x21')]],'as':_0x53e083['as'],'attributes':_0x53e083[_0x75c2('0x1e')],'include':_0x53e083['include']?_['map'](_0x53e083[_0x75c2('0x1f')],function(_0x2283ba){return{'model':db[_0x2283ba[_0x75c2('0x21')]],'as':_0x2283ba['as'],'attributes':_0x2283ba[_0x75c2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19d5db){logger[_0x75c2('0xe')](_0x75c2('0x18'),_0x38eac1);logger[_0x75c2('0x10')](_0x75c2('0x18'),_0x38eac1,JSON[_0x75c2('0x12')](_0x19d5db));_0x493d7d(_0x19d5db);})[_0x75c2('0x22')](function(_0x44fc7c){logger[_0x75c2('0x13')](_0x75c2('0x18'),_0x44fc7c['message'],_0x38eac1);_0x3ebe6d(_0x5c5b3d['error'](0x1f4,_0x44fc7c[_0x75c2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index c7b7f5d..af2d95e 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 _0x93e9=['express','Router','fs-extra','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x5e40f4,_0x56411d){var _0x46002d=function(_0xe85d8d){while(--_0xe85d8d){_0x5e40f4['push'](_0x5e40f4['shift']());}};_0x46002d(++_0x56411d);}(_0x93e9,0xcc));var _0x993e=function(_0xca9594,_0x9c91c5){_0xca9594=_0xca9594-0x0;var _0x4db75a=_0x93e9[_0xca9594];return _0x4db75a;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['show']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getAnyConditions']);router[_0x993e('0x9')](_0x993e('0x10'),auth['isAuthenticated'](),controller['getActions']);router[_0x993e('0x11')]('/',auth['isAuthenticated'](),controller[_0x993e('0x12')]);router['post']('/:id/all_conditions',auth[_0x993e('0xa')](),controller[_0x993e('0x13')]);router[_0x993e('0x11')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller[_0x993e('0x14')]);router[_0x993e('0x11')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x15')]);router[_0x993e('0x16')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller[_0x993e('0x17')]);router[_0x993e('0x18')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['destroy']);module[_0x993e('0x19')]=router; \ No newline at end of file +var _0x8188=['getActions','post','addAllCondition','addAction','put','/:id','update','destroy','multer','express','Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x2cafc,_0x113d38){var _0x5c8444=function(_0x276304){while(--_0x276304){_0x2cafc['push'](_0x2cafc['shift']());}};_0x5c8444(++_0x113d38);}(_0x8188,0x76));var _0x8818=function(_0xf5b3f8,_0x5841c2){_0xf5b3f8=_0xf5b3f8-0x0;var _0x2f3f76=_0x8188[_0xf5b3f8];return _0x2f3f76;};'use strict';var multer=require(_0x8818('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8818('0x1'));var router=express[_0x8818('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8818('0x3'));var config=require(_0x8818('0x4'));var controller=require(_0x8818('0x5'));router[_0x8818('0x6')]('/',auth[_0x8818('0x7')](),controller[_0x8818('0x8')]);router['get']('/:id',auth[_0x8818('0x7')](),controller[_0x8818('0x9')]);router[_0x8818('0x6')](_0x8818('0xa'),auth[_0x8818('0x7')](),controller['getAllConditions']);router[_0x8818('0x6')](_0x8818('0xb'),auth[_0x8818('0x7')](),controller[_0x8818('0xc')]);router['get'](_0x8818('0xd'),auth['isAuthenticated'](),controller[_0x8818('0xe')]);router[_0x8818('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8818('0xf')](_0x8818('0xa'),auth[_0x8818('0x7')](),controller[_0x8818('0x10')]);router[_0x8818('0xf')](_0x8818('0xb'),auth[_0x8818('0x7')](),controller['addAnyCondition']);router[_0x8818('0xf')](_0x8818('0xd'),auth[_0x8818('0x7')](),controller[_0x8818('0x11')]);router[_0x8818('0x12')](_0x8818('0x13'),auth['isAuthenticated'](),controller[_0x8818('0x14')]);router['delete'](_0x8818('0x13'),auth[_0x8818('0x7')](),controller[_0x8818('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 0ee4263..de3da57 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 _0xfb16=['BOOLEAN','sequelize','STRING'];(function(_0x45ed7d,_0x5a34b2){var _0x4b219f=function(_0x20dfb4){while(--_0x20dfb4){_0x45ed7d['push'](_0x45ed7d['shift']());}};_0x4b219f(++_0x5a34b2);}(_0xfb16,0x109));var _0x6fb1=function(_0x17eca7,_0x4febc9){_0x17eca7=_0x17eca7-0x0;var _0x9a55c4=_0xfb16[_0x17eca7];return _0x9a55c4;};'use strict';var Sequelize=require(_0x6fb1('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fb1('0x1')]},'channel':{'type':Sequelize[_0x6fb1('0x1')]},'description':{'type':Sequelize[_0x6fb1('0x1')]},'status':{'type':Sequelize[_0x6fb1('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x06fb=['exports','STRING','sequelize'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0x06fb,0xe9));var _0xb06f=function(_0x10a431,_0x40896b){_0x10a431=_0x10a431-0x0;var _0x482d70=_0x06fb[_0x10a431];return _0x482d70;};'use strict';var Sequelize=require(_0xb06f('0x0'));module[_0xb06f('0x1')]={'name':{'type':Sequelize[_0xb06f('0x2')]},'channel':{'type':Sequelize[_0xb06f('0x2')]},'description':{'type':Sequelize[_0xb06f('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 9373743..1042be2 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 _0xead8=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','Triggers','destroy','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x18f618,_0x14130a){var _0x1243d7=function(_0x55f466){while(--_0x55f466){_0x18f618['push'](_0x18f618['shift']());}};_0x1243d7(++_0x14130a);}(_0xead8,0x170));var _0x8ead=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xead8[_0x2842b4];return _0x2b9521;};'use strict';var emlformat=require(_0x8ead('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ead('0x1'));var jsonpatch=require(_0x8ead('0x2'));var rp=require(_0x8ead('0x3'));var moment=require(_0x8ead('0x4'));var BPromise=require(_0x8ead('0x5'));var Mustache=require('mustache');var util=require(_0x8ead('0x6'));var path=require(_0x8ead('0x7'));var sox=require('sox');var csv=require(_0x8ead('0x8'));var ejs=require(_0x8ead('0x9'));var fs=require('fs');var fs_extra=require(_0x8ead('0xa'));var _=require(_0x8ead('0xb'));var squel=require(_0x8ead('0xc'));var crypto=require(_0x8ead('0xd'));var jsforce=require(_0x8ead('0xe'));var deskjs=require(_0x8ead('0xf'));var toCsv=require(_0x8ead('0x8'));var querystring=require(_0x8ead('0x10'));var Papa=require('papaparse');var Redis=require(_0x8ead('0x11'));var authService=require(_0x8ead('0x12'));var qs=require(_0x8ead('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ead('0x14'));var logger=require(_0x8ead('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8ead('0x16'));var db=require(_0x8ead('0x17'))['db'];function respondWithStatusCode(_0x43fcb2,_0x437596){_0x437596=_0x437596||0xcc;return function(_0x414532){if(_0x414532){return _0x43fcb2[_0x8ead('0x18')](_0x437596);}return _0x43fcb2['status'](_0x437596)[_0x8ead('0x19')]();};}function respondWithResult(_0x86d541,_0x368a7d){_0x368a7d=_0x368a7d||0xc8;return function(_0x15c793){if(_0x15c793){return _0x86d541[_0x8ead('0x1a')](_0x368a7d)['json'](_0x15c793);}};}function respondWithFilteredResult(_0x292462,_0x497a23){return function(_0x65708f){if(_0x65708f){var _0x2308bd=typeof _0x497a23[_0x8ead('0x1b')]===_0x8ead('0x1c')&&typeof _0x497a23[_0x8ead('0x1d')]==='undefined';var _0x49a72=_0x65708f[_0x8ead('0x1e')];var _0xd9830=_0x2308bd?0x0:_0x497a23[_0x8ead('0x1b')];var _0x14e6b3=_0x2308bd?_0x65708f[_0x8ead('0x1e')]:_0x497a23[_0x8ead('0x1b')]+_0x497a23[_0x8ead('0x1d')];var _0x5c079a;if(_0x14e6b3>=_0x49a72){_0x14e6b3=_0x49a72;_0x5c079a=0xc8;}else{_0x5c079a=0xce;}_0x292462[_0x8ead('0x1a')](_0x5c079a);return _0x292462[_0x8ead('0x1f')](_0x8ead('0x20'),_0xd9830+'-'+_0x14e6b3+'/'+_0x49a72)[_0x8ead('0x21')](_0x65708f);}return null;};}function patchUpdates(_0x5164e4){return function(_0x57604f){try{jsonpatch[_0x8ead('0x22')](_0x57604f,_0x5164e4,!![]);}catch(_0x567b9f){return BPromise[_0x8ead('0x23')](_0x567b9f);}return _0x57604f[_0x8ead('0x24')]();};}function saveUpdates(_0x144229,_0x138b0e){return function(_0x4953a3){if(_0x4953a3){return _0x4953a3[_0x8ead('0x25')](_0x144229)[_0x8ead('0x26')](function(_0x302c1f){return _0x302c1f;});}return null;};}function removeEntity(_0x99cba8,_0x279106){return function(_0x212989){if(_0x212989){return _0x212989['destroy']()[_0x8ead('0x26')](function(){var _0x1386ef=_0x212989[_0x8ead('0x27')]({'plain':!![]});var _0x32143e=_0x8ead('0x28');return db['UserProfileResource'][_0x8ead('0x29')]({'where':{'type':_0x32143e,'resourceId':_0x1386ef['id']}})[_0x8ead('0x26')](function(){return _0x212989;});})[_0x8ead('0x26')](function(){_0x99cba8[_0x8ead('0x1a')](0xcc)[_0x8ead('0x19')]();});}};}function handleEntityNotFound(_0xaca5e5,_0x17a8d4){return function(_0x2f6602){if(!_0x2f6602){_0xaca5e5['sendStatus'](0x194);}return _0x2f6602;};}function handleError(_0x40fc3c,_0xee94ae){_0xee94ae=_0xee94ae||0x1f4;return function(_0x178795){logger[_0x8ead('0x2a')](_0x178795[_0x8ead('0x2b')]);if(_0x178795[_0x8ead('0x2c')]){delete _0x178795['name'];}_0x40fc3c[_0x8ead('0x1a')](_0xee94ae)[_0x8ead('0x2d')](_0x178795);};}exports[_0x8ead('0x2e')]=function(_0x166728,_0x41d1ef){var _0x5e698f={},_0x5b7400={},_0x37c178={'count':0x0,'rows':[]};var _0x2a987e=_[_0x8ead('0x2f')](db[_0x8ead('0x30')][_0x8ead('0x31')],function(_0x4050e0){return{'name':_0x4050e0[_0x8ead('0x32')],'type':_0x4050e0[_0x8ead('0x33')][_0x8ead('0x34')]};});_0x5b7400['model']=_[_0x8ead('0x2f')](_0x2a987e,_0x8ead('0x2c'));_0x5b7400[_0x8ead('0x35')]=_[_0x8ead('0x36')](_0x166728[_0x8ead('0x35')]);_0x5b7400['filters']=_[_0x8ead('0x37')](_0x5b7400[_0x8ead('0x38')],_0x5b7400[_0x8ead('0x35')]);_0x5e698f[_0x8ead('0x39')]=_['intersection'](_0x5b7400['model'],qs[_0x8ead('0x3a')](_0x166728[_0x8ead('0x35')][_0x8ead('0x3a')]));_0x5e698f[_0x8ead('0x39')]=_0x5e698f[_0x8ead('0x39')][_0x8ead('0x3b')]?_0x5e698f[_0x8ead('0x39')]:_0x5b7400[_0x8ead('0x38')];if(!_0x166728[_0x8ead('0x35')]['hasOwnProperty'](_0x8ead('0x3c'))){_0x5e698f[_0x8ead('0x1d')]=qs[_0x8ead('0x1d')](_0x166728['query'][_0x8ead('0x1d')]);_0x5e698f[_0x8ead('0x1b')]=qs[_0x8ead('0x1b')](_0x166728['query']['offset']);}_0x5e698f[_0x8ead('0x3d')]=qs[_0x8ead('0x3e')](_0x166728[_0x8ead('0x35')][_0x8ead('0x3e')]);_0x5e698f[_0x8ead('0x3f')]=qs[_0x8ead('0x40')](_[_0x8ead('0x41')](_0x166728['query'],_0x5b7400[_0x8ead('0x40')]),_0x2a987e);if(_0x166728['query']['filter']){_0x5e698f['where']=_['merge'](_0x5e698f[_0x8ead('0x3f')],{'$or':_[_0x8ead('0x2f')](_0x2a987e,function(_0x11d531){if(_0x11d531[_0x8ead('0x33')]!=='VIRTUAL'){var _0x3f3cfe={};_0x3f3cfe[_0x11d531[_0x8ead('0x2c')]]={'$like':'%'+_0x166728[_0x8ead('0x35')][_0x8ead('0x42')]+'%'};return _0x3f3cfe;}})});}_0x5e698f=_[_0x8ead('0x43')]({},_0x5e698f,_0x166728[_0x8ead('0x44')]);var _0x24354c={'where':_0x5e698f[_0x8ead('0x3f')]};return db[_0x8ead('0x30')][_0x8ead('0x1e')](_0x24354c)['then'](function(_0x38dee5){_0x37c178[_0x8ead('0x1e')]=_0x38dee5;if(_0x166728[_0x8ead('0x35')][_0x8ead('0x45')]){_0x5e698f[_0x8ead('0x46')]=[{'all':!![]}];}return db[_0x8ead('0x30')][_0x8ead('0x47')](_0x5e698f);})['then'](function(_0x1cfa18){_0x37c178['rows']=_0x1cfa18;return _0x37c178;})['then'](respondWithFilteredResult(_0x41d1ef,_0x5e698f))[_0x8ead('0x48')](handleError(_0x41d1ef,null));};exports[_0x8ead('0x49')]=function(_0xdd9f73,_0x37d820){var _0x3400a8={'raw':![],'where':{'id':_0xdd9f73[_0x8ead('0x4a')]['id']}},_0x568462={};_0x568462['model']=_[_0x8ead('0x36')](db['Trigger'][_0x8ead('0x31')]);_0x568462[_0x8ead('0x35')]=_[_0x8ead('0x36')](_0xdd9f73[_0x8ead('0x35')]);_0x568462[_0x8ead('0x40')]=_[_0x8ead('0x37')](_0x568462['model'],_0x568462[_0x8ead('0x35')]);_0x3400a8['attributes']=_[_0x8ead('0x37')](_0x568462[_0x8ead('0x38')],qs[_0x8ead('0x3a')](_0xdd9f73[_0x8ead('0x35')][_0x8ead('0x3a')]));_0x3400a8[_0x8ead('0x39')]=_0x3400a8['attributes'][_0x8ead('0x3b')]?_0x3400a8[_0x8ead('0x39')]:_0x568462['model'];if(_0xdd9f73['query'][_0x8ead('0x45')]){_0x3400a8[_0x8ead('0x46')]=[{'all':!![]}];}_0x3400a8=_['merge']({},_0x3400a8,_0xdd9f73[_0x8ead('0x44')]);return db[_0x8ead('0x30')][_0x8ead('0x4b')](_0x3400a8)[_0x8ead('0x26')](handleEntityNotFound(_0x37d820,null))[_0x8ead('0x26')](respondWithResult(_0x37d820,null))[_0x8ead('0x48')](handleError(_0x37d820,null));};exports[_0x8ead('0x4c')]=function(_0x3a17f6,_0x192283){return db[_0x8ead('0x30')][_0x8ead('0x4c')](_0x3a17f6[_0x8ead('0x4d')],{})['then'](function(_0x2c2186){var _0x38fb67=_0x3a17f6[_0x8ead('0x4e')][_0x8ead('0x27')]({'plain':!![]});if(!_0x38fb67)throw new Error(_0x8ead('0x4f'));if(_0x38fb67[_0x8ead('0x50')]==='user'){var _0x340517=_0x2c2186[_0x8ead('0x27')]({'plain':!![]});var _0xda6cc7=_0x8ead('0x28');return db['UserProfileSection']['find']({'where':{'name':_0xda6cc7,'userProfileId':_0x38fb67['userProfileId']},'raw':!![]})[_0x8ead('0x26')](function(_0x19fafc){if(_0x19fafc&&_0x19fafc[_0x8ead('0x51')]===0x0){return db[_0x8ead('0x52')]['create']({'name':_0x340517[_0x8ead('0x2c')],'resourceId':_0x340517['id'],'type':_0x19fafc['name'],'sectionId':_0x19fafc['id']},{})[_0x8ead('0x26')](function(){return _0x2c2186;});}else{return _0x2c2186;}})['catch'](function(_0x3e5bb){logger[_0x8ead('0x2a')](_0x8ead('0x53'),_0x3e5bb);throw _0x3e5bb;});}return _0x2c2186;})['then'](respondWithResult(_0x192283,0xc9))[_0x8ead('0x48')](handleError(_0x192283,null));};exports[_0x8ead('0x25')]=function(_0x385faf,_0xf7f026){if(_0x385faf[_0x8ead('0x4d')]['id']){delete _0x385faf[_0x8ead('0x4d')]['id'];}return db[_0x8ead('0x30')]['find']({'where':{'id':_0x385faf[_0x8ead('0x4a')]['id']}})[_0x8ead('0x26')](handleEntityNotFound(_0xf7f026,null))[_0x8ead('0x26')](saveUpdates(_0x385faf[_0x8ead('0x4d')],null))[_0x8ead('0x26')](respondWithResult(_0xf7f026,null))[_0x8ead('0x48')](handleError(_0xf7f026,null));};exports[_0x8ead('0x29')]=function(_0x41e654,_0x10bef8){return db[_0x8ead('0x30')]['find']({'where':{'id':_0x41e654[_0x8ead('0x4a')]['id']}})[_0x8ead('0x26')](handleEntityNotFound(_0x10bef8,null))[_0x8ead('0x26')](removeEntity(_0x10bef8,null))['catch'](handleError(_0x10bef8,null));};exports[_0x8ead('0x54')]=function(_0x1faa66,_0x266d27,_0x2fad31){if(_0x1faa66[_0x8ead('0x4d')]['id']){delete _0x1faa66[_0x8ead('0x4d')]['id'];}return db[_0x8ead('0x30')][_0x8ead('0x4b')]({'where':{'id':_0x1faa66[_0x8ead('0x4a')]['id']}})[_0x8ead('0x26')](handleEntityNotFound(_0x266d27,null))['then'](function(_0x22a0ae){if(_0x22a0ae){_0x1faa66[_0x8ead('0x4d')]['TriggerAllId']=_0x22a0ae['id'];return db[_0x8ead('0x55')][_0x8ead('0x4c')](_0x1faa66[_0x8ead('0x4d')]);}})[_0x8ead('0x26')](respondWithResult(_0x266d27,null))['catch'](handleError(_0x266d27,null));};exports[_0x8ead('0x56')]=function(_0x365f9c,_0x478306,_0x51867c){if(_0x365f9c[_0x8ead('0x4d')]['id']){delete _0x365f9c[_0x8ead('0x4d')]['id'];}return db['Trigger'][_0x8ead('0x4b')]({'where':{'id':_0x365f9c['params']['id']}})['then'](handleEntityNotFound(_0x478306,null))[_0x8ead('0x26')](function(_0x47d2a8){if(_0x47d2a8){_0x365f9c[_0x8ead('0x4d')]['TriggerAnyId']=_0x47d2a8['id'];return db[_0x8ead('0x55')][_0x8ead('0x4c')](_0x365f9c['body']);}})[_0x8ead('0x26')](respondWithResult(_0x478306,null))['catch'](handleError(_0x478306,null));};exports[_0x8ead('0x57')]=function(_0x54f04b,_0x334984,_0x5252d3){var _0x1cea8c={};var _0x14b206={};var _0x417f7d;var _0x3ac7ae;return db[_0x8ead('0x30')][_0x8ead('0x58')]({'where':{'id':_0x54f04b['params']['id']}})[_0x8ead('0x26')](handleEntityNotFound(_0x334984,null))['then'](function(_0x45f354){if(_0x45f354){_0x417f7d=_0x45f354;_0x14b206[_0x8ead('0x38')]=_[_0x8ead('0x36')](db[_0x8ead('0x55')]['rawAttributes']);_0x14b206['query']=_[_0x8ead('0x36')](_0x54f04b[_0x8ead('0x35')]);_0x14b206['filters']=_[_0x8ead('0x37')](_0x14b206[_0x8ead('0x38')],_0x14b206[_0x8ead('0x35')]);_0x1cea8c[_0x8ead('0x39')]=_[_0x8ead('0x37')](_0x14b206[_0x8ead('0x38')],qs[_0x8ead('0x3a')](_0x54f04b[_0x8ead('0x35')][_0x8ead('0x3a')]));_0x1cea8c['attributes']=_0x1cea8c[_0x8ead('0x39')][_0x8ead('0x3b')]?_0x1cea8c['attributes']:_0x14b206['model'];_0x1cea8c[_0x8ead('0x3d')]=qs[_0x8ead('0x3e')](_0x54f04b['query'][_0x8ead('0x3e')]);_0x1cea8c['where']=qs[_0x8ead('0x40')](_['pick'](_0x54f04b[_0x8ead('0x35')],_0x14b206[_0x8ead('0x40')]));if(_0x54f04b['query'][_0x8ead('0x42')]){_0x1cea8c[_0x8ead('0x3f')]=_[_0x8ead('0x43')](_0x1cea8c[_0x8ead('0x3f')],{'$or':_[_0x8ead('0x2f')](_0x1cea8c[_0x8ead('0x39')],function(_0x2d215f){var _0x23bd36={};_0x23bd36[_0x2d215f]={'$like':'%'+_0x54f04b[_0x8ead('0x35')][_0x8ead('0x42')]+'%'};return _0x23bd36;})});}_0x1cea8c=_['merge']({},_0x1cea8c,_0x54f04b[_0x8ead('0x44')]);return _0x417f7d[_0x8ead('0x57')](_0x1cea8c);}})[_0x8ead('0x26')](function(_0x501123){if(_0x501123){_0x3ac7ae=_0x501123[_0x8ead('0x3b')];if(!_0x54f04b[_0x8ead('0x35')]['hasOwnProperty']('nolimit')){_0x1cea8c[_0x8ead('0x1d')]=qs[_0x8ead('0x1d')](_0x54f04b[_0x8ead('0x35')]['limit']);_0x1cea8c[_0x8ead('0x1b')]=qs[_0x8ead('0x1b')](_0x54f04b['query'][_0x8ead('0x1b')]);}return _0x417f7d[_0x8ead('0x57')](_0x1cea8c);}})['then'](function(_0x178374){if(_0x178374){return _0x178374?{'count':_0x3ac7ae,'rows':_0x178374}:null;}})['then'](respondWithResult(_0x334984,null))['catch'](handleError(_0x334984,null));};exports['getAnyConditions']=function(_0x33866e,_0x240e1c,_0x4b182d){var _0x42ea5a={};var _0x3c6ee8={};var _0x5453b3;var _0x515e80;return db[_0x8ead('0x30')]['findOne']({'where':{'id':_0x33866e[_0x8ead('0x4a')]['id']}})['then'](handleEntityNotFound(_0x240e1c,null))[_0x8ead('0x26')](function(_0x394e34){if(_0x394e34){_0x5453b3=_0x394e34;_0x3c6ee8[_0x8ead('0x38')]=_['keys'](db[_0x8ead('0x55')][_0x8ead('0x31')]);_0x3c6ee8['query']=_['keys'](_0x33866e['query']);_0x3c6ee8['filters']=_['intersection'](_0x3c6ee8[_0x8ead('0x38')],_0x3c6ee8[_0x8ead('0x35')]);_0x42ea5a[_0x8ead('0x39')]=_[_0x8ead('0x37')](_0x3c6ee8[_0x8ead('0x38')],qs[_0x8ead('0x3a')](_0x33866e[_0x8ead('0x35')]['fields']));_0x42ea5a[_0x8ead('0x39')]=_0x42ea5a['attributes'][_0x8ead('0x3b')]?_0x42ea5a['attributes']:_0x3c6ee8[_0x8ead('0x38')];_0x42ea5a[_0x8ead('0x3d')]=qs[_0x8ead('0x3e')](_0x33866e[_0x8ead('0x35')][_0x8ead('0x3e')]);_0x42ea5a[_0x8ead('0x3f')]=qs[_0x8ead('0x40')](_[_0x8ead('0x41')](_0x33866e[_0x8ead('0x35')],_0x3c6ee8[_0x8ead('0x40')]));if(_0x33866e[_0x8ead('0x35')]['filter']){_0x42ea5a[_0x8ead('0x3f')]=_[_0x8ead('0x43')](_0x42ea5a[_0x8ead('0x3f')],{'$or':_[_0x8ead('0x2f')](_0x42ea5a[_0x8ead('0x39')],function(_0xac7d85){var _0x390932={};_0x390932[_0xac7d85]={'$like':'%'+_0x33866e[_0x8ead('0x35')]['filter']+'%'};return _0x390932;})});}_0x42ea5a=_[_0x8ead('0x43')]({},_0x42ea5a,_0x33866e['options']);return _0x5453b3[_0x8ead('0x59')](_0x42ea5a);}})['then'](function(_0x272cf3){if(_0x272cf3){_0x515e80=_0x272cf3[_0x8ead('0x3b')];if(!_0x33866e['query']['hasOwnProperty'](_0x8ead('0x3c'))){_0x42ea5a[_0x8ead('0x1d')]=qs[_0x8ead('0x1d')](_0x33866e[_0x8ead('0x35')]['limit']);_0x42ea5a[_0x8ead('0x1b')]=qs[_0x8ead('0x1b')](_0x33866e[_0x8ead('0x35')]['offset']);}return _0x5453b3[_0x8ead('0x59')](_0x42ea5a);}})[_0x8ead('0x26')](function(_0x585c08){if(_0x585c08){return _0x585c08?{'count':_0x515e80,'rows':_0x585c08}:null;}})[_0x8ead('0x26')](respondWithResult(_0x240e1c,null))['catch'](handleError(_0x240e1c,null));};exports[_0x8ead('0x5a')]=function(_0x42db5a,_0x234af1,_0x2c4adc){if(_0x42db5a[_0x8ead('0x4d')]['id']){delete _0x42db5a[_0x8ead('0x4d')]['id'];}return db[_0x8ead('0x30')][_0x8ead('0x4b')]({'where':{'id':_0x42db5a[_0x8ead('0x4a')]['id']}})[_0x8ead('0x26')](handleEntityNotFound(_0x234af1,null))[_0x8ead('0x26')](function(_0x168c9c){if(_0x168c9c){_0x42db5a[_0x8ead('0x4d')]['TriggerId']=_0x168c9c['id'];return db[_0x8ead('0x5b')][_0x8ead('0x4c')](_0x42db5a[_0x8ead('0x4d')]);}})[_0x8ead('0x26')](respondWithResult(_0x234af1,null))['catch'](handleError(_0x234af1,null));};exports[_0x8ead('0x5c')]=function(_0x1e4508,_0x311bec,_0x6c3e91){var _0x2a9993={};var _0x2e1dff={};var _0x3783cc;var _0xe804ff;return db[_0x8ead('0x30')]['findOne']({'where':{'id':_0x1e4508['params']['id']}})['then'](handleEntityNotFound(_0x311bec,null))[_0x8ead('0x26')](function(_0x40ba0f){if(_0x40ba0f){_0x3783cc=_0x40ba0f;_0x2e1dff[_0x8ead('0x38')]=_[_0x8ead('0x36')](db[_0x8ead('0x5b')][_0x8ead('0x31')]);_0x2e1dff[_0x8ead('0x35')]=_[_0x8ead('0x36')](_0x1e4508[_0x8ead('0x35')]);_0x2e1dff[_0x8ead('0x40')]=_['intersection'](_0x2e1dff[_0x8ead('0x38')],_0x2e1dff[_0x8ead('0x35')]);_0x2a9993[_0x8ead('0x39')]=_['intersection'](_0x2e1dff[_0x8ead('0x38')],qs[_0x8ead('0x3a')](_0x1e4508[_0x8ead('0x35')][_0x8ead('0x3a')]));_0x2a9993[_0x8ead('0x39')]=_0x2a9993[_0x8ead('0x39')]['length']?_0x2a9993[_0x8ead('0x39')]:_0x2e1dff[_0x8ead('0x38')];_0x2a9993[_0x8ead('0x3d')]=qs['sort'](_0x1e4508[_0x8ead('0x35')][_0x8ead('0x3e')]);_0x2a9993['where']=qs[_0x8ead('0x40')](_[_0x8ead('0x41')](_0x1e4508[_0x8ead('0x35')],_0x2e1dff[_0x8ead('0x40')]));if(_0x1e4508[_0x8ead('0x35')]['filter']){_0x2a9993['where']=_[_0x8ead('0x43')](_0x2a9993[_0x8ead('0x3f')],{'$or':_[_0x8ead('0x2f')](_0x2a9993[_0x8ead('0x39')],function(_0x33ed83){var _0xc69d78={};_0xc69d78[_0x33ed83]={'$like':'%'+_0x1e4508[_0x8ead('0x35')][_0x8ead('0x42')]+'%'};return _0xc69d78;})});}_0x2a9993=_['merge']({},_0x2a9993,_0x1e4508[_0x8ead('0x44')]);return _0x3783cc[_0x8ead('0x5c')](_0x2a9993);}})[_0x8ead('0x26')](function(_0x233cfc){if(_0x233cfc){_0xe804ff=_0x233cfc[_0x8ead('0x3b')];if(!_0x1e4508['query'][_0x8ead('0x5d')](_0x8ead('0x3c'))){_0x2a9993['limit']=qs[_0x8ead('0x1d')](_0x1e4508[_0x8ead('0x35')][_0x8ead('0x1d')]);_0x2a9993['offset']=qs['offset'](_0x1e4508[_0x8ead('0x35')][_0x8ead('0x1b')]);}return _0x3783cc[_0x8ead('0x5c')](_0x2a9993);}})[_0x8ead('0x26')](function(_0x133de8){if(_0x133de8){return _0x133de8?{'count':_0xe804ff,'rows':_0x133de8}:null;}})[_0x8ead('0x26')](respondWithResult(_0x311bec,null))[_0x8ead('0x48')](handleError(_0x311bec,null));}; \ No newline at end of file +var _0x499b=['filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','length','pick','hasOwnProperty','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Triggers','error','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','order','sort'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x499b,0xe3));var _0xb499=function(_0x2b99f8,_0x217714){_0x2b99f8=_0x2b99f8-0x0;var _0x3cbf8a=_0x499b[_0x2b99f8];return _0x3cbf8a;};'use strict';var emlformat=require(_0xb499('0x0'));var rimraf=require(_0xb499('0x1'));var zipdir=require(_0xb499('0x2'));var jsonpatch=require(_0xb499('0x3'));var rp=require(_0xb499('0x4'));var moment=require(_0xb499('0x5'));var BPromise=require(_0xb499('0x6'));var Mustache=require(_0xb499('0x7'));var util=require(_0xb499('0x8'));var path=require(_0xb499('0x9'));var sox=require(_0xb499('0xa'));var csv=require(_0xb499('0xb'));var ejs=require(_0xb499('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb499('0xd'));var squel=require(_0xb499('0xe'));var crypto=require('crypto');var jsforce=require(_0xb499('0xf'));var deskjs=require(_0xb499('0x10'));var toCsv=require(_0xb499('0xb'));var querystring=require(_0xb499('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb499('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb499('0x13'));var logger=require('../../config/logger')(_0xb499('0x14'));var utils=require(_0xb499('0x15'));var config=require(_0xb499('0x16'));var licenseUtil=require(_0xb499('0x17'));var db=require(_0xb499('0x18'))['db'];function respondWithStatusCode(_0xfe280b,_0x3af46e){_0x3af46e=_0x3af46e||0xcc;return function(_0x3b8642){if(_0x3b8642){return _0xfe280b[_0xb499('0x19')](_0x3af46e);}return _0xfe280b['status'](_0x3af46e)[_0xb499('0x1a')]();};}function respondWithResult(_0x192213,_0x15fe0f){_0x15fe0f=_0x15fe0f||0xc8;return function(_0x292fff){if(_0x292fff){return _0x192213[_0xb499('0x1b')](_0x15fe0f)[_0xb499('0x1c')](_0x292fff);}};}function respondWithFilteredResult(_0x1e2c17,_0xfcb137){return function(_0x50310c){if(_0x50310c){var _0x56a410=typeof _0xfcb137[_0xb499('0x1d')]===_0xb499('0x1e')&&typeof _0xfcb137[_0xb499('0x1f')]==='undefined';var _0xc80182=_0x50310c[_0xb499('0x20')];var _0x2f3150=_0x56a410?0x0:_0xfcb137[_0xb499('0x1d')];var _0x3b10bb=_0x56a410?_0x50310c[_0xb499('0x20')]:_0xfcb137[_0xb499('0x1d')]+_0xfcb137[_0xb499('0x1f')];var _0x5c61a3;if(_0x3b10bb>=_0xc80182){_0x3b10bb=_0xc80182;_0x5c61a3=0xc8;}else{_0x5c61a3=0xce;}_0x1e2c17[_0xb499('0x1b')](_0x5c61a3);return _0x1e2c17[_0xb499('0x21')](_0xb499('0x22'),_0x2f3150+'-'+_0x3b10bb+'/'+_0xc80182)[_0xb499('0x1c')](_0x50310c);}return null;};}function patchUpdates(_0x140689){return function(_0x204570){try{jsonpatch[_0xb499('0x23')](_0x204570,_0x140689,!![]);}catch(_0x44b281){return BPromise[_0xb499('0x24')](_0x44b281);}return _0x204570['save']();};}function saveUpdates(_0x401590,_0x2c9261){return function(_0x3d581b){if(_0x3d581b){return _0x3d581b[_0xb499('0x25')](_0x401590)[_0xb499('0x26')](function(_0x340075){return _0x340075;});}return null;};}function removeEntity(_0x41c23d,_0x2b2000){return function(_0x5c2e76){if(_0x5c2e76){return _0x5c2e76[_0xb499('0x27')]()[_0xb499('0x26')](function(){var _0xc90430=_0x5c2e76[_0xb499('0x28')]({'plain':!![]});var _0x4b7229=_0xb499('0x29');return db['UserProfileResource'][_0xb499('0x27')]({'where':{'type':_0x4b7229,'resourceId':_0xc90430['id']}})[_0xb499('0x26')](function(){return _0x5c2e76;});})[_0xb499('0x26')](function(){_0x41c23d[_0xb499('0x1b')](0xcc)[_0xb499('0x1a')]();});}};}function handleEntityNotFound(_0x1386c9,_0x1d46d9){return function(_0x45eebf){if(!_0x45eebf){_0x1386c9[_0xb499('0x19')](0x194);}return _0x45eebf;};}function handleError(_0x5e80be,_0x55f0d4){_0x55f0d4=_0x55f0d4||0x1f4;return function(_0x5e4fb0){logger[_0xb499('0x2a')](_0x5e4fb0[_0xb499('0x2b')]);if(_0x5e4fb0['name']){delete _0x5e4fb0[_0xb499('0x2c')];}_0x5e80be['status'](_0x55f0d4)[_0xb499('0x2d')](_0x5e4fb0);};}exports[_0xb499('0x2e')]=function(_0x4e9aa3,_0x49f719){var _0x5014d6={},_0x55868a={},_0x4c87b1={'count':0x0,'rows':[]};var _0x14a890=_['map'](db[_0xb499('0x2f')][_0xb499('0x30')],function(_0x4f7ad3){return{'name':_0x4f7ad3[_0xb499('0x31')],'type':_0x4f7ad3[_0xb499('0x32')][_0xb499('0x33')]};});_0x55868a[_0xb499('0x34')]=_[_0xb499('0x35')](_0x14a890,_0xb499('0x2c'));_0x55868a[_0xb499('0x36')]=_[_0xb499('0x37')](_0x4e9aa3['query']);_0x55868a['filters']=_[_0xb499('0x38')](_0x55868a[_0xb499('0x34')],_0x55868a[_0xb499('0x36')]);_0x5014d6[_0xb499('0x39')]=_[_0xb499('0x38')](_0x55868a[_0xb499('0x34')],qs[_0xb499('0x3a')](_0x4e9aa3[_0xb499('0x36')][_0xb499('0x3a')]));_0x5014d6[_0xb499('0x39')]=_0x5014d6[_0xb499('0x39')]['length']?_0x5014d6[_0xb499('0x39')]:_0x55868a['model'];if(!_0x4e9aa3[_0xb499('0x36')]['hasOwnProperty']('nolimit')){_0x5014d6[_0xb499('0x1f')]=qs[_0xb499('0x1f')](_0x4e9aa3[_0xb499('0x36')][_0xb499('0x1f')]);_0x5014d6[_0xb499('0x1d')]=qs[_0xb499('0x1d')](_0x4e9aa3[_0xb499('0x36')]['offset']);}_0x5014d6[_0xb499('0x3b')]=qs[_0xb499('0x3c')](_0x4e9aa3[_0xb499('0x36')]['sort']);_0x5014d6['where']=qs[_0xb499('0x3d')](_['pick'](_0x4e9aa3[_0xb499('0x36')],_0x55868a[_0xb499('0x3d')]),_0x14a890);if(_0x4e9aa3[_0xb499('0x36')][_0xb499('0x3e')]){_0x5014d6[_0xb499('0x3f')]=_[_0xb499('0x40')](_0x5014d6[_0xb499('0x3f')],{'$or':_[_0xb499('0x35')](_0x14a890,function(_0xd3a20a){if(_0xd3a20a[_0xb499('0x32')]!==_0xb499('0x41')){var _0x364919={};_0x364919[_0xd3a20a[_0xb499('0x2c')]]={'$like':'%'+_0x4e9aa3['query']['filter']+'%'};return _0x364919;}})});}_0x5014d6=_[_0xb499('0x40')]({},_0x5014d6,_0x4e9aa3[_0xb499('0x42')]);var _0x52b1c7={'where':_0x5014d6[_0xb499('0x3f')]};return db[_0xb499('0x2f')]['count'](_0x52b1c7)['then'](function(_0x4131b0){_0x4c87b1[_0xb499('0x20')]=_0x4131b0;if(_0x4e9aa3[_0xb499('0x36')]['includeAll']){_0x5014d6[_0xb499('0x43')]=[{'all':!![]}];}return db[_0xb499('0x2f')][_0xb499('0x44')](_0x5014d6);})[_0xb499('0x26')](function(_0x5ee18b){_0x4c87b1[_0xb499('0x45')]=_0x5ee18b;return _0x4c87b1;})[_0xb499('0x26')](respondWithFilteredResult(_0x49f719,_0x5014d6))['catch'](handleError(_0x49f719,null));};exports['show']=function(_0x26e4a6,_0x2a7c4b){var _0x258b7d={'raw':![],'where':{'id':_0x26e4a6['params']['id']}},_0x4a0973={};_0x4a0973[_0xb499('0x34')]=_[_0xb499('0x37')](db['Trigger'][_0xb499('0x30')]);_0x4a0973[_0xb499('0x36')]=_[_0xb499('0x37')](_0x26e4a6[_0xb499('0x36')]);_0x4a0973[_0xb499('0x3d')]=_[_0xb499('0x38')](_0x4a0973[_0xb499('0x34')],_0x4a0973['query']);_0x258b7d[_0xb499('0x39')]=_[_0xb499('0x38')](_0x4a0973['model'],qs[_0xb499('0x3a')](_0x26e4a6[_0xb499('0x36')][_0xb499('0x3a')]));_0x258b7d[_0xb499('0x39')]=_0x258b7d[_0xb499('0x39')]['length']?_0x258b7d[_0xb499('0x39')]:_0x4a0973[_0xb499('0x34')];if(_0x26e4a6['query'][_0xb499('0x46')]){_0x258b7d[_0xb499('0x43')]=[{'all':!![]}];}_0x258b7d=_[_0xb499('0x40')]({},_0x258b7d,_0x26e4a6[_0xb499('0x42')]);return db['Trigger'][_0xb499('0x47')](_0x258b7d)['then'](handleEntityNotFound(_0x2a7c4b,null))[_0xb499('0x26')](respondWithResult(_0x2a7c4b,null))['catch'](handleError(_0x2a7c4b,null));};exports[_0xb499('0x48')]=function(_0x5bc625,_0x409107){return db['Trigger'][_0xb499('0x48')](_0x5bc625[_0xb499('0x49')],{})[_0xb499('0x26')](function(_0x24a2fa){var _0x39bc57=_0x5bc625['user'][_0xb499('0x28')]({'plain':!![]});if(!_0x39bc57)throw new Error(_0xb499('0x4a'));if(_0x39bc57['role']===_0xb499('0x4b')){var _0x58fc49=_0x24a2fa[_0xb499('0x28')]({'plain':!![]});var _0x4a4127=_0xb499('0x29');return db[_0xb499('0x4c')][_0xb499('0x47')]({'where':{'name':_0x4a4127,'userProfileId':_0x39bc57['userProfileId']},'raw':!![]})['then'](function(_0x33808a){if(_0x33808a&&_0x33808a[_0xb499('0x4d')]===0x0){return db['UserProfileResource'][_0xb499('0x48')]({'name':_0x58fc49[_0xb499('0x2c')],'resourceId':_0x58fc49['id'],'type':_0x33808a[_0xb499('0x2c')],'sectionId':_0x33808a['id']},{})[_0xb499('0x26')](function(){return _0x24a2fa;});}else{return _0x24a2fa;}})[_0xb499('0x4e')](function(_0x33ce29){logger['error'](_0xb499('0x4f'),_0x33ce29);throw _0x33ce29;});}return _0x24a2fa;})[_0xb499('0x26')](respondWithResult(_0x409107,0xc9))[_0xb499('0x4e')](handleError(_0x409107,null));};exports[_0xb499('0x25')]=function(_0x7f8f97,_0x158cd){if(_0x7f8f97[_0xb499('0x49')]['id']){delete _0x7f8f97['body']['id'];}return db[_0xb499('0x2f')]['find']({'where':{'id':_0x7f8f97[_0xb499('0x50')]['id']}})[_0xb499('0x26')](handleEntityNotFound(_0x158cd,null))[_0xb499('0x26')](saveUpdates(_0x7f8f97['body'],null))['then'](respondWithResult(_0x158cd,null))[_0xb499('0x4e')](handleError(_0x158cd,null));};exports['destroy']=function(_0x4052fc,_0x1bbd80){return db['Trigger'][_0xb499('0x47')]({'where':{'id':_0x4052fc['params']['id']}})[_0xb499('0x26')](handleEntityNotFound(_0x1bbd80,null))[_0xb499('0x26')](removeEntity(_0x1bbd80,null))[_0xb499('0x4e')](handleError(_0x1bbd80,null));};exports[_0xb499('0x51')]=function(_0x7d2f5f,_0x376f46,_0x4ecee6){if(_0x7d2f5f[_0xb499('0x49')]['id']){delete _0x7d2f5f[_0xb499('0x49')]['id'];}return db[_0xb499('0x2f')][_0xb499('0x47')]({'where':{'id':_0x7d2f5f['params']['id']}})[_0xb499('0x26')](handleEntityNotFound(_0x376f46,null))[_0xb499('0x26')](function(_0x18cbff){if(_0x18cbff){_0x7d2f5f['body'][_0xb499('0x52')]=_0x18cbff['id'];return db[_0xb499('0x53')][_0xb499('0x48')](_0x7d2f5f['body']);}})['then'](respondWithResult(_0x376f46,null))['catch'](handleError(_0x376f46,null));};exports['addAnyCondition']=function(_0x43c945,_0x2b08f8,_0x2380ae){if(_0x43c945[_0xb499('0x49')]['id']){delete _0x43c945[_0xb499('0x49')]['id'];}return db[_0xb499('0x2f')][_0xb499('0x47')]({'where':{'id':_0x43c945[_0xb499('0x50')]['id']}})[_0xb499('0x26')](handleEntityNotFound(_0x2b08f8,null))['then'](function(_0x417f2e){if(_0x417f2e){_0x43c945[_0xb499('0x49')][_0xb499('0x54')]=_0x417f2e['id'];return db[_0xb499('0x53')][_0xb499('0x48')](_0x43c945['body']);}})[_0xb499('0x26')](respondWithResult(_0x2b08f8,null))['catch'](handleError(_0x2b08f8,null));};exports[_0xb499('0x55')]=function(_0x4f6fb2,_0x1e8cfb,_0x26b3ec){var _0x4b179c={};var _0x447a10={};var _0x254e58;var _0x4746b2;return db[_0xb499('0x2f')]['findOne']({'where':{'id':_0x4f6fb2[_0xb499('0x50')]['id']}})['then'](handleEntityNotFound(_0x1e8cfb,null))['then'](function(_0xbec5c3){if(_0xbec5c3){_0x254e58=_0xbec5c3;_0x447a10['model']=_[_0xb499('0x37')](db[_0xb499('0x53')][_0xb499('0x30')]);_0x447a10[_0xb499('0x36')]=_[_0xb499('0x37')](_0x4f6fb2[_0xb499('0x36')]);_0x447a10[_0xb499('0x3d')]=_[_0xb499('0x38')](_0x447a10[_0xb499('0x34')],_0x447a10[_0xb499('0x36')]);_0x4b179c[_0xb499('0x39')]=_[_0xb499('0x38')](_0x447a10[_0xb499('0x34')],qs['fields'](_0x4f6fb2[_0xb499('0x36')][_0xb499('0x3a')]));_0x4b179c['attributes']=_0x4b179c['attributes'][_0xb499('0x56')]?_0x4b179c['attributes']:_0x447a10[_0xb499('0x34')];_0x4b179c[_0xb499('0x3b')]=qs[_0xb499('0x3c')](_0x4f6fb2[_0xb499('0x36')][_0xb499('0x3c')]);_0x4b179c[_0xb499('0x3f')]=qs[_0xb499('0x3d')](_[_0xb499('0x57')](_0x4f6fb2[_0xb499('0x36')],_0x447a10[_0xb499('0x3d')]));if(_0x4f6fb2[_0xb499('0x36')][_0xb499('0x3e')]){_0x4b179c['where']=_[_0xb499('0x40')](_0x4b179c[_0xb499('0x3f')],{'$or':_[_0xb499('0x35')](_0x4b179c[_0xb499('0x39')],function(_0x2d42aa){var _0x211219={};_0x211219[_0x2d42aa]={'$like':'%'+_0x4f6fb2['query']['filter']+'%'};return _0x211219;})});}_0x4b179c=_[_0xb499('0x40')]({},_0x4b179c,_0x4f6fb2[_0xb499('0x42')]);return _0x254e58[_0xb499('0x55')](_0x4b179c);}})['then'](function(_0x5c2c11){if(_0x5c2c11){_0x4746b2=_0x5c2c11[_0xb499('0x56')];if(!_0x4f6fb2[_0xb499('0x36')][_0xb499('0x58')](_0xb499('0x59'))){_0x4b179c[_0xb499('0x1f')]=qs[_0xb499('0x1f')](_0x4f6fb2['query'][_0xb499('0x1f')]);_0x4b179c['offset']=qs[_0xb499('0x1d')](_0x4f6fb2[_0xb499('0x36')]['offset']);}return _0x254e58[_0xb499('0x55')](_0x4b179c);}})[_0xb499('0x26')](function(_0x34d13f){if(_0x34d13f){return _0x34d13f?{'count':_0x4746b2,'rows':_0x34d13f}:null;}})[_0xb499('0x26')](respondWithResult(_0x1e8cfb,null))['catch'](handleError(_0x1e8cfb,null));};exports[_0xb499('0x5a')]=function(_0x217531,_0x3fa3f6,_0x57ce4a){var _0x52583a={};var _0x2f5e7c={};var _0x5ac84d;var _0x2dc3d2;return db[_0xb499('0x2f')]['findOne']({'where':{'id':_0x217531[_0xb499('0x50')]['id']}})['then'](handleEntityNotFound(_0x3fa3f6,null))[_0xb499('0x26')](function(_0x793df4){if(_0x793df4){_0x5ac84d=_0x793df4;_0x2f5e7c[_0xb499('0x34')]=_['keys'](db[_0xb499('0x53')][_0xb499('0x30')]);_0x2f5e7c[_0xb499('0x36')]=_['keys'](_0x217531[_0xb499('0x36')]);_0x2f5e7c[_0xb499('0x3d')]=_[_0xb499('0x38')](_0x2f5e7c[_0xb499('0x34')],_0x2f5e7c[_0xb499('0x36')]);_0x52583a[_0xb499('0x39')]=_['intersection'](_0x2f5e7c[_0xb499('0x34')],qs['fields'](_0x217531[_0xb499('0x36')][_0xb499('0x3a')]));_0x52583a[_0xb499('0x39')]=_0x52583a[_0xb499('0x39')][_0xb499('0x56')]?_0x52583a[_0xb499('0x39')]:_0x2f5e7c['model'];_0x52583a['order']=qs['sort'](_0x217531['query'][_0xb499('0x3c')]);_0x52583a['where']=qs['filters'](_[_0xb499('0x57')](_0x217531[_0xb499('0x36')],_0x2f5e7c[_0xb499('0x3d')]));if(_0x217531[_0xb499('0x36')][_0xb499('0x3e')]){_0x52583a[_0xb499('0x3f')]=_[_0xb499('0x40')](_0x52583a['where'],{'$or':_[_0xb499('0x35')](_0x52583a[_0xb499('0x39')],function(_0x215742){var _0x222e66={};_0x222e66[_0x215742]={'$like':'%'+_0x217531[_0xb499('0x36')][_0xb499('0x3e')]+'%'};return _0x222e66;})});}_0x52583a=_[_0xb499('0x40')]({},_0x52583a,_0x217531[_0xb499('0x42')]);return _0x5ac84d[_0xb499('0x5a')](_0x52583a);}})[_0xb499('0x26')](function(_0x42da64){if(_0x42da64){_0x2dc3d2=_0x42da64[_0xb499('0x56')];if(!_0x217531[_0xb499('0x36')][_0xb499('0x58')]('nolimit')){_0x52583a[_0xb499('0x1f')]=qs['limit'](_0x217531[_0xb499('0x36')][_0xb499('0x1f')]);_0x52583a['offset']=qs[_0xb499('0x1d')](_0x217531[_0xb499('0x36')][_0xb499('0x1d')]);}return _0x5ac84d['getAnyConditions'](_0x52583a);}})[_0xb499('0x26')](function(_0x3e010d){if(_0x3e010d){return _0x3e010d?{'count':_0x2dc3d2,'rows':_0x3e010d}:null;}})[_0xb499('0x26')](respondWithResult(_0x3fa3f6,null))[_0xb499('0x4e')](handleError(_0x3fa3f6,null));};exports[_0xb499('0x5b')]=function(_0x15d1ff,_0x4a7295,_0x45f9fb){if(_0x15d1ff[_0xb499('0x49')]['id']){delete _0x15d1ff['body']['id'];}return db[_0xb499('0x2f')]['find']({'where':{'id':_0x15d1ff[_0xb499('0x50')]['id']}})[_0xb499('0x26')](handleEntityNotFound(_0x4a7295,null))['then'](function(_0x2c4618){if(_0x2c4618){_0x15d1ff[_0xb499('0x49')][_0xb499('0x5c')]=_0x2c4618['id'];return db[_0xb499('0x5d')][_0xb499('0x48')](_0x15d1ff[_0xb499('0x49')]);}})['then'](respondWithResult(_0x4a7295,null))[_0xb499('0x4e')](handleError(_0x4a7295,null));};exports[_0xb499('0x5e')]=function(_0x13e385,_0xf131f0,_0x355c28){var _0x23756e={};var _0xc57eec={};var _0x44ae48;var _0x83dd7d;return db[_0xb499('0x2f')][_0xb499('0x5f')]({'where':{'id':_0x13e385[_0xb499('0x50')]['id']}})[_0xb499('0x26')](handleEntityNotFound(_0xf131f0,null))[_0xb499('0x26')](function(_0x270a29){if(_0x270a29){_0x44ae48=_0x270a29;_0xc57eec[_0xb499('0x34')]=_['keys'](db['Action']['rawAttributes']);_0xc57eec[_0xb499('0x36')]=_[_0xb499('0x37')](_0x13e385['query']);_0xc57eec[_0xb499('0x3d')]=_[_0xb499('0x38')](_0xc57eec[_0xb499('0x34')],_0xc57eec[_0xb499('0x36')]);_0x23756e[_0xb499('0x39')]=_['intersection'](_0xc57eec['model'],qs[_0xb499('0x3a')](_0x13e385[_0xb499('0x36')]['fields']));_0x23756e[_0xb499('0x39')]=_0x23756e[_0xb499('0x39')]['length']?_0x23756e[_0xb499('0x39')]:_0xc57eec['model'];_0x23756e['order']=qs['sort'](_0x13e385['query'][_0xb499('0x3c')]);_0x23756e['where']=qs[_0xb499('0x3d')](_[_0xb499('0x57')](_0x13e385['query'],_0xc57eec[_0xb499('0x3d')]));if(_0x13e385[_0xb499('0x36')]['filter']){_0x23756e[_0xb499('0x3f')]=_[_0xb499('0x40')](_0x23756e[_0xb499('0x3f')],{'$or':_[_0xb499('0x35')](_0x23756e[_0xb499('0x39')],function(_0x26a5cb){var _0x9e230e={};_0x9e230e[_0x26a5cb]={'$like':'%'+_0x13e385[_0xb499('0x36')][_0xb499('0x3e')]+'%'};return _0x9e230e;})});}_0x23756e=_[_0xb499('0x40')]({},_0x23756e,_0x13e385[_0xb499('0x42')]);return _0x44ae48[_0xb499('0x5e')](_0x23756e);}})[_0xb499('0x26')](function(_0x47f5c5){if(_0x47f5c5){_0x83dd7d=_0x47f5c5['length'];if(!_0x13e385[_0xb499('0x36')]['hasOwnProperty'](_0xb499('0x59'))){_0x23756e['limit']=qs[_0xb499('0x1f')](_0x13e385[_0xb499('0x36')][_0xb499('0x1f')]);_0x23756e[_0xb499('0x1d')]=qs['offset'](_0x13e385[_0xb499('0x36')][_0xb499('0x1d')]);}return _0x44ae48['getActions'](_0x23756e);}})[_0xb499('0x26')](function(_0x46711a){if(_0x46711a){return _0x46711a?{'count':_0x83dd7d,'rows':_0x46711a}:null;}})[_0xb499('0x26')](respondWithResult(_0xf131f0,null))[_0xb499('0x4e')](handleError(_0xf131f0,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 0870d3b..606de4c 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 _0x5af0=['moment','bluebird','request-promise','path','../../config/environment','exports','Trigger','lodash','util','../../config/logger','api'];(function(_0x19b024,_0x17c7f7){var _0x3a210e=function(_0x2f58f9){while(--_0x2f58f9){_0x19b024['push'](_0x19b024['shift']());}};_0x3a210e(++_0x17c7f7);}(_0x5af0,0x1eb));var _0x05af=function(_0x3568f3,_0x7201d2){_0x3568f3=_0x3568f3-0x0;var _0x20952f=_0x5af0[_0x3568f3];return _0x20952f;};'use strict';var _=require(_0x05af('0x0'));var util=require(_0x05af('0x1'));var logger=require(_0x05af('0x2'))(_0x05af('0x3'));var moment=require(_0x05af('0x4'));var BPromise=require(_0x05af('0x5'));var rp=require(_0x05af('0x6'));var fs=require('fs');var path=require(_0x05af('0x7'));var rimraf=require('rimraf');var config=require(_0x05af('0x8'));var attributes=require('./trigger.attributes');module[_0x05af('0x9')]=function(_0x27a3e2,_0x2a8ef6){return _0x27a3e2['define'](_0x05af('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf1c=['moment','bluebird','request-promise','./trigger.attributes','define','Trigger','tools_triggers','lodash','util','api'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0xcf1c,0x18d));var _0xccf1=function(_0x4aefc9,_0x27bfdc){_0x4aefc9=_0x4aefc9-0x0;var _0x1537a4=_0xcf1c[_0x4aefc9];return _0x1537a4;};'use strict';var _=require(_0xccf1('0x0'));var util=require(_0xccf1('0x1'));var logger=require('../../config/logger')(_0xccf1('0x2'));var moment=require(_0xccf1('0x3'));var BPromise=require(_0xccf1('0x4'));var rp=require(_0xccf1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xccf1('0x6'));module['exports']=function(_0x17e358,_0x2ee316){return _0x17e358[_0xccf1('0x7')](_0xccf1('0x8'),attributes,{'tableName':_0xccf1('0x9'),'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 feed5f6..03e8f06 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 _0x5884=['result','catch','GetTrigger','options','where','attributes','include','map','model','stringify','ShowTrigger','Trigger','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x34cd03,_0x22d586){var _0x3d1fed=function(_0x5b6cf8){while(--_0x5b6cf8){_0x34cd03['push'](_0x34cd03['shift']());}};_0x3d1fed(++_0x22d586);}(_0x5884,0x10c));var _0x4588=function(_0x35e099,_0x45c14e){_0x35e099=_0x35e099-0x0;var _0x27d39f=_0x5884[_0x35e099];return _0x27d39f;};'use strict';var _=require(_0x4588('0x0'));var util=require('util');var moment=require(_0x4588('0x1'));var BPromise=require(_0x4588('0x2'));var rs=require(_0x4588('0x3'));var fs=require('fs');var Redis=require(_0x4588('0x4'));var db=require(_0x4588('0x5'))['db'];var utils=require(_0x4588('0x6'));var logger=require(_0x4588('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4588('0x8')][_0x4588('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa68e16,_0x1cd7b3,_0x51f511){return new BPromise(function(_0x773b05,_0x5d576d){return client[_0x4588('0xa')](_0xa68e16,_0x51f511)[_0x4588('0xb')](function(_0x49ad28){logger[_0x4588('0xc')](_0x4588('0xd'),_0x1cd7b3,_0x4588('0xe'));logger[_0x4588('0xf')](_0x4588('0x10'),_0x1cd7b3,_0x4588('0xe'),JSON['stringify'](_0x49ad28));if(_0x49ad28['error']){if(_0x49ad28[_0x4588('0x11')][_0x4588('0x12')]===0x1f4){logger[_0x4588('0x11')](_0x4588('0xd'),_0x1cd7b3,_0x49ad28[_0x4588('0x11')][_0x4588('0x13')]);return _0x5d576d(_0x49ad28[_0x4588('0x11')][_0x4588('0x13')]);}logger[_0x4588('0x11')](_0x4588('0xd'),_0x1cd7b3,_0x49ad28[_0x4588('0x11')][_0x4588('0x13')]);return _0x773b05(_0x49ad28['error'][_0x4588('0x13')]);}else{logger[_0x4588('0xc')](_0x4588('0xd'),_0x1cd7b3,'request\x20sent');_0x773b05(_0x49ad28[_0x4588('0x14')]['message']);}})[_0x4588('0x15')](function(_0x59016d){logger[_0x4588('0x11')](_0x4588('0xd'),_0x1cd7b3,_0x59016d);_0x5d576d(_0x59016d);});});}exports[_0x4588('0x16')]=function(_0x3b6713){var _0x44477e=this;return new Promise(function(_0x41845e,_0x4a7351){return db['Trigger']['findAll']({'raw':_0x3b6713[_0x4588('0x17')]?_0x3b6713[_0x4588('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3b6713[_0x4588('0x17')]?_0x3b6713[_0x4588('0x17')][_0x4588('0x18')]||null:null,'attributes':_0x3b6713['options']?_0x3b6713['options'][_0x4588('0x19')]||null:null,'limit':_0x3b6713[_0x4588('0x17')]?_0x3b6713['options']['limit']||null:null,'include':_0x3b6713['options']?_0x3b6713[_0x4588('0x17')][_0x4588('0x1a')]?_[_0x4588('0x1b')](_0x3b6713[_0x4588('0x17')][_0x4588('0x1a')],function(_0x35bb23){return{'model':db[_0x35bb23[_0x4588('0x1c')]],'as':_0x35bb23['as'],'attributes':_0x35bb23[_0x4588('0x19')],'include':_0x35bb23[_0x4588('0x1a')]?_[_0x4588('0x1b')](_0x35bb23[_0x4588('0x1a')],function(_0x38f779){return{'model':db[_0x38f779['model']],'as':_0x38f779['as'],'attributes':_0x38f779['attributes'],'include':_0x38f779[_0x4588('0x1a')]?_['map'](_0x38f779[_0x4588('0x1a')],function(_0x59a97d){return{'model':db[_0x59a97d[_0x4588('0x1c')]],'as':_0x59a97d['as'],'attributes':_0x59a97d[_0x4588('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4588('0xb')](function(_0x2ccbf7){logger[_0x4588('0xc')]('GetTrigger',_0x3b6713);logger['debug'](_0x4588('0x16'),_0x3b6713,JSON[_0x4588('0x1d')](_0x2ccbf7));_0x41845e(_0x2ccbf7);})[_0x4588('0x15')](function(_0x2af8cd){logger[_0x4588('0x11')](_0x4588('0x16'),_0x2af8cd['message'],_0x3b6713);_0x4a7351(_0x44477e['error'](0x1f4,_0x2af8cd['message']));});});};exports[_0x4588('0x1e')]=function(_0xea1939){var _0x24ef22=this;return new Promise(function(_0x207c51,_0x27eaf4){return db[_0x4588('0x1f')]['find']({'raw':_0xea1939[_0x4588('0x17')]?_0xea1939[_0x4588('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xea1939[_0x4588('0x17')]?_0xea1939['options'][_0x4588('0x18')]||null:null,'attributes':_0xea1939[_0x4588('0x17')]?_0xea1939['options'][_0x4588('0x19')]||null:null,'include':_0xea1939['options']?_0xea1939[_0x4588('0x17')][_0x4588('0x1a')]?_['map'](_0xea1939[_0x4588('0x17')][_0x4588('0x1a')],function(_0x25ab8c){return{'model':db[_0x25ab8c['model']],'as':_0x25ab8c['as'],'attributes':_0x25ab8c[_0x4588('0x19')],'include':_0x25ab8c[_0x4588('0x1a')]?_[_0x4588('0x1b')](_0x25ab8c[_0x4588('0x1a')],function(_0x29643c){return{'model':db[_0x29643c[_0x4588('0x1c')]],'as':_0x29643c['as'],'attributes':_0x29643c[_0x4588('0x19')],'include':_0x29643c[_0x4588('0x1a')]?_['map'](_0x29643c[_0x4588('0x1a')],function(_0x23d061){return{'model':db[_0x23d061[_0x4588('0x1c')]],'as':_0x23d061['as'],'attributes':_0x23d061[_0x4588('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4588('0xb')](function(_0x473dac){logger[_0x4588('0xc')]('ShowTrigger',_0xea1939);logger[_0x4588('0xf')](_0x4588('0x1e'),_0xea1939,JSON[_0x4588('0x1d')](_0x473dac));_0x207c51(_0x473dac);})['catch'](function(_0x320649){logger[_0x4588('0x11')](_0x4588('0x1e'),_0x320649[_0x4588('0x13')],_0xea1939);_0x27eaf4(_0x24ef22[_0x4588('0x11')](0x1f4,_0x320649[_0x4588('0x13')]));});});}; \ No newline at end of file +var _0x054b=['../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','find','catch','lodash','moment','bluebird','ioredis'];(function(_0x43f54d,_0x14681a){var _0x5753c1=function(_0x2b3cce){while(--_0x2b3cce){_0x43f54d['push'](_0x43f54d['shift']());}};_0x5753c1(++_0x14681a);}(_0x054b,0x194));var _0xb054=function(_0x1ef0fe,_0x4b5901){_0x1ef0fe=_0x1ef0fe-0x0;var _0x2816e8=_0x054b[_0x1ef0fe];return _0x2816e8;};'use strict';var _=require(_0xb054('0x0'));var util=require('util');var moment=require(_0xb054('0x1'));var BPromise=require(_0xb054('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb054('0x3'));var db=require(_0xb054('0x4'))['db'];var utils=require(_0xb054('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb054('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb054('0x7')][_0xb054('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25c617,_0x4c89f0,_0x1b7348){return new BPromise(function(_0x5920ca,_0x39eba9){return client[_0xb054('0x9')](_0x25c617,_0x1b7348)[_0xb054('0xa')](function(_0x39dc54){logger['info'](_0xb054('0xb'),_0x4c89f0,_0xb054('0xc'));logger[_0xb054('0xd')](_0xb054('0xe'),_0x4c89f0,'request\x20sent',JSON[_0xb054('0xf')](_0x39dc54));if(_0x39dc54[_0xb054('0x10')]){if(_0x39dc54['error']['code']===0x1f4){logger[_0xb054('0x10')](_0xb054('0xb'),_0x4c89f0,_0x39dc54[_0xb054('0x10')][_0xb054('0x11')]);return _0x39eba9(_0x39dc54[_0xb054('0x10')][_0xb054('0x11')]);}logger[_0xb054('0x10')]('Trigger,\x20%s,\x20%s',_0x4c89f0,_0x39dc54['error'][_0xb054('0x11')]);return _0x5920ca(_0x39dc54['error'][_0xb054('0x11')]);}else{logger[_0xb054('0x12')](_0xb054('0xb'),_0x4c89f0,'request\x20sent');_0x5920ca(_0x39dc54[_0xb054('0x13')][_0xb054('0x11')]);}})['catch'](function(_0x4a4dd7){logger[_0xb054('0x10')](_0xb054('0xb'),_0x4c89f0,_0x4a4dd7);_0x39eba9(_0x4a4dd7);});});}exports[_0xb054('0x14')]=function(_0x4819e5){var _0x3b7ac4=this;return new Promise(function(_0x5df05b,_0x5971ec){return db[_0xb054('0x15')][_0xb054('0x16')]({'raw':_0x4819e5[_0xb054('0x17')]?_0x4819e5[_0xb054('0x17')][_0xb054('0x18')]===undefined?!![]:![]:!![],'where':_0x4819e5[_0xb054('0x17')]?_0x4819e5['options'][_0xb054('0x19')]||null:null,'attributes':_0x4819e5[_0xb054('0x17')]?_0x4819e5[_0xb054('0x17')][_0xb054('0x1a')]||null:null,'limit':_0x4819e5[_0xb054('0x17')]?_0x4819e5[_0xb054('0x17')][_0xb054('0x1b')]||null:null,'include':_0x4819e5[_0xb054('0x17')]?_0x4819e5['options'][_0xb054('0x1c')]?_[_0xb054('0x1d')](_0x4819e5[_0xb054('0x17')][_0xb054('0x1c')],function(_0x3d5e94){return{'model':db[_0x3d5e94[_0xb054('0x1e')]],'as':_0x3d5e94['as'],'attributes':_0x3d5e94[_0xb054('0x1a')],'include':_0x3d5e94[_0xb054('0x1c')]?_['map'](_0x3d5e94[_0xb054('0x1c')],function(_0x19029b){return{'model':db[_0x19029b[_0xb054('0x1e')]],'as':_0x19029b['as'],'attributes':_0x19029b[_0xb054('0x1a')],'include':_0x19029b[_0xb054('0x1c')]?_[_0xb054('0x1d')](_0x19029b[_0xb054('0x1c')],function(_0x17496f){return{'model':db[_0x17496f['model']],'as':_0x17496f['as'],'attributes':_0x17496f[_0xb054('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb054('0xa')](function(_0x50171e){logger[_0xb054('0x12')](_0xb054('0x14'),_0x4819e5);logger[_0xb054('0xd')](_0xb054('0x14'),_0x4819e5,JSON['stringify'](_0x50171e));_0x5df05b(_0x50171e);})['catch'](function(_0x20bec4){logger[_0xb054('0x10')](_0xb054('0x14'),_0x20bec4[_0xb054('0x11')],_0x4819e5);_0x5971ec(_0x3b7ac4[_0xb054('0x10')](0x1f4,_0x20bec4[_0xb054('0x11')]));});});};exports[_0xb054('0x1f')]=function(_0x5defa8){var _0x1bec3e=this;return new Promise(function(_0x1ef0fe,_0x495088){return db[_0xb054('0x15')][_0xb054('0x20')]({'raw':_0x5defa8[_0xb054('0x17')]?_0x5defa8[_0xb054('0x17')][_0xb054('0x18')]===undefined?!![]:![]:!![],'where':_0x5defa8[_0xb054('0x17')]?_0x5defa8[_0xb054('0x17')][_0xb054('0x19')]||null:null,'attributes':_0x5defa8['options']?_0x5defa8[_0xb054('0x17')]['attributes']||null:null,'include':_0x5defa8[_0xb054('0x17')]?_0x5defa8['options'][_0xb054('0x1c')]?_['map'](_0x5defa8['options'][_0xb054('0x1c')],function(_0x179787){return{'model':db[_0x179787[_0xb054('0x1e')]],'as':_0x179787['as'],'attributes':_0x179787[_0xb054('0x1a')],'include':_0x179787[_0xb054('0x1c')]?_['map'](_0x179787[_0xb054('0x1c')],function(_0x3b481f){return{'model':db[_0x3b481f['model']],'as':_0x3b481f['as'],'attributes':_0x3b481f[_0xb054('0x1a')],'include':_0x3b481f[_0xb054('0x1c')]?_[_0xb054('0x1d')](_0x3b481f[_0xb054('0x1c')],function(_0x5a4b47){return{'model':db[_0x5a4b47[_0xb054('0x1e')]],'as':_0x5a4b47['as'],'attributes':_0x5a4b47[_0xb054('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb054('0xa')](function(_0x3f316d){logger[_0xb054('0x12')]('ShowTrigger',_0x5defa8);logger['debug']('ShowTrigger',_0x5defa8,JSON[_0xb054('0xf')](_0x3f316d));_0x1ef0fe(_0x3f316d);})[_0xb054('0x21')](function(_0x4289f1){logger[_0xb054('0x10')]('ShowTrigger',_0x4289f1[_0xb054('0x11')],_0x5defa8);_0x495088(_0x1bec3e[_0xb054('0x10')](0x1f4,_0x4289f1['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index a89aef7..d0d2925 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 _0x2480=['./trunk.controller','get','isAuthenticated','index','/:id','show','post','clone','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4e7ecb,_0x2ecd98){var _0x21fd7c=function(_0x15107e){while(--_0x15107e){_0x4e7ecb['push'](_0x4e7ecb['shift']());}};_0x21fd7c(++_0x2ecd98);}(_0x2480,0x11d));var _0x0248=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2480[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0248('0x0'));var util=require(_0x0248('0x1'));var path=require(_0x0248('0x2'));var timeout=require(_0x0248('0x3'));var express=require('express');var router=express[_0x0248('0x4')]();var fs_extra=require(_0x0248('0x5'));var auth=require(_0x0248('0x6'));var interaction=require(_0x0248('0x7'));var config=require(_0x0248('0x8'));var controller=require(_0x0248('0x9'));router[_0x0248('0xa')]('/',auth[_0x0248('0xb')](),controller[_0x0248('0xc')]);router[_0x0248('0xa')](_0x0248('0xd'),auth[_0x0248('0xb')](),controller[_0x0248('0xe')]);router[_0x0248('0xf')]('/:id/clone',auth[_0x0248('0xb')](),controller[_0x0248('0x10')]);router['post']('/',auth[_0x0248('0xb')](),controller[_0x0248('0x11')]);router[_0x0248('0x12')](_0x0248('0xd'),auth[_0x0248('0xb')](),controller['update']);router[_0x0248('0x13')](_0x0248('0xd'),auth[_0x0248('0xb')](),controller[_0x0248('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5f39=['isAuthenticated','index','/:id','show','post','clone','create','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get'];(function(_0x4c0008,_0x553b00){var _0x3a24ae=function(_0x53a1bd){while(--_0x53a1bd){_0x4c0008['push'](_0x4c0008['shift']());}};_0x3a24ae(++_0x553b00);}(_0x5f39,0x1d7));var _0x95f3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5f39[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x95f3('0x0'));var util=require(_0x95f3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x95f3('0x2'));var router=express['Router']();var fs_extra=require(_0x95f3('0x3'));var auth=require(_0x95f3('0x4'));var interaction=require(_0x95f3('0x5'));var config=require(_0x95f3('0x6'));var controller=require(_0x95f3('0x7'));router[_0x95f3('0x8')]('/',auth[_0x95f3('0x9')](),controller[_0x95f3('0xa')]);router[_0x95f3('0x8')](_0x95f3('0xb'),auth[_0x95f3('0x9')](),controller[_0x95f3('0xc')]);router[_0x95f3('0xd')]('/:id/clone',auth[_0x95f3('0x9')](),controller[_0x95f3('0xe')]);router[_0x95f3('0xd')]('/',auth[_0x95f3('0x9')](),controller[_0x95f3('0xf')]);router['put'](_0x95f3('0xb'),auth[_0x95f3('0x9')](),controller[_0x95f3('0x10')]);router[_0x95f3('0x11')](_0x95f3('0xb'),auth[_0x95f3('0x9')](),controller[_0x95f3('0x12')]);module[_0x95f3('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 4276a2c..2803c17 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 _0x51d7=['PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','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','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','sequelize','exports','STRING','name','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN'];(function(_0x3b7fbe,_0x2a0c3b){var _0xb43f6a=function(_0xeaea56){while(--_0xeaea56){_0x3b7fbe['push'](_0x3b7fbe['shift']());}};_0xb43f6a(++_0x2a0c3b);}(_0x51d7,0x90));var _0x751d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x51d7[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x751d('0x0'));module[_0x751d('0x1')]={'name':{'type':Sequelize[_0x751d('0x2')],'allowNull':![],'unique':_0x751d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x5'),'user',_0x751d('0x6')),'allowNull':![],'defaultValue':_0x751d('0x5')},'context':{'type':Sequelize[_0x751d('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x7'),_0x751d('0x8'),'ALLOWED_FAILED_SCREEN',_0x751d('0x9'),_0x751d('0xa'),_0x751d('0xb'),_0x751d('0xc'),_0x751d('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x751d('0x2')]},'secret':{'type':Sequelize[_0x751d('0x2')]},'md5secret':{'type':Sequelize[_0x751d('0x2')]},'remotesecret':{'type':Sequelize[_0x751d('0x2')]},'transport':{'type':Sequelize[_0x751d('0x2')],'defaultValue':_0x751d('0xe'),'set':function(_0x40cc9e){this[_0x751d('0xf')](_0x751d('0x10'),_0x40cc9e?_0x40cc9e[_0x751d('0x11')](','):null);},'get':function(){return this[_0x751d('0x12')](_0x751d('0x10'))?this[_0x751d('0x12')](_0x751d('0x10'))[_0x751d('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x14'),_0x751d('0x15'),_0x751d('0x16'),_0x751d('0x17'),_0x751d('0x18')),'defaultValue':_0x751d('0x14')},'directmedia':{'type':Sequelize[_0x751d('0x4')]('yes','no',_0x751d('0x19'),_0x751d('0x1a'),_0x751d('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x751d('0x2')]},'nat':{'type':Sequelize[_0x751d('0x2')],'defaultValue':_0x751d('0x1d'),'set':function(_0x1fbec5){this[_0x751d('0xf')](_0x751d('0x1e'),_0x1fbec5?_0x1fbec5[_0x751d('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x751d('0x1e'))?this[_0x751d('0x12')](_0x751d('0x1e'))[_0x751d('0x13')](','):null;},'comment':_0x751d('0x1f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x751d('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x751d('0x2')]},'language':{'type':Sequelize[_0x751d('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x751d('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x751d('0x2')],'defaultValue':_0x751d('0x20')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x751d('0x21'),'set':function(_0x2d29cc){this['setDataValue'](_0x751d('0x22'),_0x2d29cc?_0x2d29cc[_0x751d('0x11')](';'):_0x751d('0x21'));},'get':function(){return this[_0x751d('0x12')](_0x751d('0x22'))?this[_0x751d('0x12')]('allow')[_0x751d('0x13')](';'):null;},'comment':_0x751d('0x23')},'autoframing':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'insecure':{'type':Sequelize[_0x751d('0x2')],'defaultValue':_0x751d('0x24'),'set':function(_0x49a2bc){this[_0x751d('0xf')](_0x751d('0x25'),_0x49a2bc?_0x49a2bc[_0x751d('0x11')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x751d('0x12')](_0x751d('0x25'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x751d('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x751d('0x1c'),'no',_0x751d('0x26'))},'promiscredir':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'useclientcode':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'accountcode':{'type':Sequelize[_0x751d('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x751d('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x751d('0x2')]},'callcounter':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no'),'defaultValue':_0x751d('0x1c')},'busylevel':{'type':Sequelize[_0x751d('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0x751d('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x751d('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0x751d('0x2')]},'template':{'type':Sequelize[_0x751d('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x751d('0x1c'),'no',_0x751d('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x751d('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'mailbox':{'type':Sequelize[_0x751d('0x2')]},'session_timers':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x29'),_0x751d('0x2a'),_0x751d('0x2b'))},'session_expires':{'type':Sequelize[_0x751d('0x27')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x751d('0x2c')),'defaultValue':_0x751d('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x751d('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x751d('0x2')]},'fromuser':{'type':Sequelize[_0x751d('0x2')]},'port':{'type':Sequelize[_0x751d('0x27')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x751d('0x1c')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x751d('0x2')]},'defaultuser':{'type':Sequelize[_0x751d('0x2')]},'rtptimeout':{'type':Sequelize[_0x751d('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x751d('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x751d('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no',_0x751d('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x751d('0x2')]},'timert1':{'type':Sequelize[_0x751d('0x27')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x751d('0x27')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x751d('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x751d('0x2')]},'use_q850_reason':{'type':Sequelize[_0x751d('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x751d('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x751d('0x1c'),'no')},'force_avp':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'icesupport':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'dtlsenable':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x751d('0x1c'),'no',_0x751d('0x2e'),_0x751d('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x751d('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x751d('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x751d('0x2')]},'dtlscipher':{'type':Sequelize[_0x751d('0x2')]},'dtlscafile':{'type':Sequelize[_0x751d('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x30'),_0x751d('0x31'),_0x751d('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x751d('0x2')]},'usereqphone':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x751d('0x2')]},'recordofffeature':{'type':Sequelize[_0x751d('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x751d('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x751d('0x4')](_0x751d('0x1c'),'no')},'vmexten':{'type':Sequelize[_0x751d('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x751d('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x751d('0x2')]},'host':{'type':Sequelize[_0x751d('0x2')],'defaultValue':_0x751d('0x33')},'canreinvite':{'type':Sequelize['ENUM'](_0x751d('0x1c'),'no',_0x751d('0x19'),_0x751d('0x1a'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x751d('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x751d('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1f80=['join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','setDataValue','transport'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x1f80,0xfd));var _0x01f8=function(_0x59525e,_0x5c0a76){_0x59525e=_0x59525e-0x0;var _0x37ba07=_0x1f80[_0x59525e];return _0x37ba07;};'use strict';var Sequelize=require(_0x01f8('0x0'));module[_0x01f8('0x1')]={'name':{'type':Sequelize[_0x01f8('0x2')],'allowNull':![],'unique':_0x01f8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x01f8('0x4')]('friend',_0x01f8('0x5'),_0x01f8('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x01f8('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x01f8('0x8'),_0x01f8('0x9'),_0x01f8('0xa'),_0x01f8('0xb'),_0x01f8('0xc'),'PROHIB_PASSED_SCREEN',_0x01f8('0xd'),'PROHIB')},'deny':{'type':Sequelize[_0x01f8('0x2')]},'permit':{'type':Sequelize[_0x01f8('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x01f8('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x01f8('0x2')],'defaultValue':_0x01f8('0xe'),'set':function(_0x51ccac){this[_0x01f8('0xf')](_0x01f8('0x10'),_0x51ccac?_0x51ccac[_0x01f8('0x11')](','):null);},'get':function(){return this[_0x01f8('0x12')](_0x01f8('0x10'))?this[_0x01f8('0x12')](_0x01f8('0x10'))['split'](','):null;},'comment':_0x01f8('0x13')},'dtmfmode':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x14'),_0x01f8('0x15'),_0x01f8('0x16'),'inband',_0x01f8('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x01f8('0x4')]('yes','no',_0x01f8('0x18'),_0x01f8('0x19'),_0x01f8('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x01f8('0x2')]},'directmediadeny':{'type':Sequelize[_0x01f8('0x2')]},'nat':{'type':Sequelize[_0x01f8('0x2')],'defaultValue':_0x01f8('0x1c'),'set':function(_0x105d85){this[_0x01f8('0xf')]('nat',_0x105d85?_0x105d85['join'](','):null);},'get':function(){return this['getDataValue'](_0x01f8('0x1d'))?this[_0x01f8('0x12')](_0x01f8('0x1d'))[_0x01f8('0x1e')](','):null;},'comment':_0x01f8('0x1f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x01f8('0x2')]},'language':{'type':Sequelize[_0x01f8('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x01f8('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x01f8('0x2')],'defaultValue':_0x01f8('0x20')},'allow':{'type':Sequelize[_0x01f8('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5beb63){this['setDataValue'](_0x01f8('0x21'),_0x5beb63?_0x5beb63[_0x01f8('0x11')](';'):_0x01f8('0x22'));},'get':function(){return this[_0x01f8('0x12')](_0x01f8('0x21'))?this['getDataValue'](_0x01f8('0x21'))[_0x01f8('0x1e')](';'):null;},'comment':_0x01f8('0x23')},'autoframing':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x1e66df){this[_0x01f8('0xf')](_0x01f8('0x24'),_0x1e66df?_0x1e66df[_0x01f8('0x11')](','):null);},'get':function(){return this[_0x01f8('0x12')](_0x01f8('0x24'))?this[_0x01f8('0x12')](_0x01f8('0x24'))[_0x01f8('0x1e')](','):null;},'comment':_0x01f8('0x25')},'trustrpid':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no',_0x01f8('0x26'))},'promiscredir':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x01f8('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0x01f8('0x27')](0xb)},'setvar':{'type':Sequelize[_0x01f8('0x2')]},'callerid':{'type':Sequelize[_0x01f8('0x2')],'defaultValue':_0x01f8('0x28')},'amaflags':{'type':Sequelize[_0x01f8('0x2')]},'callcounter':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no'),'defaultValue':_0x01f8('0x1b')},'busylevel':{'type':Sequelize[_0x01f8('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0x01f8('0x2')]},'template':{'type':Sequelize[_0x01f8('0x2')]},'videosupport':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no',_0x01f8('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no')},'mailbox':{'type':Sequelize[_0x01f8('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x01f8('0x2a'),_0x01f8('0x2b'),_0x01f8('0x2c'))},'session_expires':{'type':Sequelize[_0x01f8('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x01f8('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x2d'),_0x01f8('0x2e')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x01f8('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x01f8('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x01f8('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x01f8('0x2')]},'defaultuser':{'type':Sequelize[_0x01f8('0x2')]},'rtptimeout':{'type':Sequelize[_0x01f8('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x01f8('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x01f8('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no',_0x01f8('0x2f')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x01f8('0x2')]},'callbackextension':{'type':Sequelize[_0x01f8('0x2')]},'timert1':{'type':Sequelize[_0x01f8('0x27')](0xb)},'timerb':{'type':Sequelize[_0x01f8('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x01f8('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x01f8('0x2')]},'contactdeny':{'type':Sequelize[_0x01f8('0x2')]},'contactacl':{'type':Sequelize[_0x01f8('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x01f8('0x2')]},'maxforwards':{'type':Sequelize[_0x01f8('0x27')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x01f8('0x1b'),'no','fingerprint',_0x01f8('0x30'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x01f8('0x2')]},'dtlscipher':{'type':Sequelize[_0x01f8('0x2')]},'dtlscafile':{'type':Sequelize[_0x01f8('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x31'),'passive',_0x01f8('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x01f8('0x2')]},'usereqphone':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x01f8('0x2')]},'recordofffeature':{'type':Sequelize[_0x01f8('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no')},'vmexten':{'type':Sequelize[_0x01f8('0x2')]},'mohinterpret':{'type':Sequelize[_0x01f8('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x01f8('0x2')]},'host':{'type':Sequelize[_0x01f8('0x2')],'defaultValue':_0x01f8('0x33')},'canreinvite':{'type':Sequelize[_0x01f8('0x4')](_0x01f8('0x1b'),'no',_0x01f8('0x18'),'update',_0x01f8('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x01f8('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x01f8('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x01f8('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 295095e..12e2b35 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(_0x4c2cf8,_0x1a7904){var _0x2dd086=function(_0x665659){while(--_0x665659){_0x4c2cf8['push'](_0x4c2cf8['shift']());}};_0x2dd086(++_0x1a7904);}(_0x34e8,0x12c));var _0x834e=function(_0x9873aa,_0x244d26){_0x9873aa=_0x9873aa-0x0;var _0x39fda7=_0x34e8[_0x9873aa];return _0x39fda7;};'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 _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x521088,_0x7b2270){var _0x24a40b=function(_0x4b221b){while(--_0x4b221b){_0x521088['push'](_0x521088['shift']());}};_0x24a40b(++_0x7b2270);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x3dddee,_0x50e47f){_0x3dddee=_0x3dddee-0x0;var _0x24e85e=_0xd6d6[_0x3dddee];return _0x24e85e;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 6542895..ca063f7 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 _0xbee6=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Trunk','tools_trunks'];(function(_0x113061,_0x56c0b8){var _0x3c97a8=function(_0x58e41b){while(--_0x58e41b){_0x113061['push'](_0x113061['shift']());}};_0x3c97a8(++_0x56c0b8);}(_0xbee6,0x18c));var _0x6bee=function(_0x5bfe0d,_0x50b442){_0x5bfe0d=_0x5bfe0d-0x0;var _0x180e72=_0xbee6[_0x5bfe0d];return _0x180e72;};'use strict';var _=require(_0x6bee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6bee('0x1'));var moment=require(_0x6bee('0x2'));var BPromise=require('bluebird');var rp=require(_0x6bee('0x3'));var fs=require('fs');var path=require(_0x6bee('0x4'));var rimraf=require(_0x6bee('0x5'));var config=require(_0x6bee('0x6'));var attributes=require('./trunk.attributes');module[_0x6bee('0x7')]=function(_0x272f87,_0x3cd060){return _0x272f87[_0x6bee('0x8')](_0x6bee('0x9'),attributes,{'tableName':_0x6bee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x159e=['exports','define','Trunk','tools_trunks','lodash','util','api','bluebird','path','rimraf','../../config/environment','./trunk.attributes'];(function(_0x14fe5c,_0x4101af){var _0x14e6b6=function(_0x395ab2){while(--_0x395ab2){_0x14fe5c['push'](_0x14fe5c['shift']());}};_0x14e6b6(++_0x4101af);}(_0x159e,0xdc));var _0xe159=function(_0x1dfc08,_0x267878){_0x1dfc08=_0x1dfc08-0x0;var _0x3e7858=_0x159e[_0x1dfc08];return _0x3e7858;};'use strict';var _=require(_0xe159('0x0'));var util=require(_0xe159('0x1'));var logger=require('../../config/logger')(_0xe159('0x2'));var moment=require('moment');var BPromise=require(_0xe159('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe159('0x4'));var rimraf=require(_0xe159('0x5'));var config=require(_0xe159('0x6'));var attributes=require(_0xe159('0x7'));module[_0xe159('0x8')]=function(_0x12a3ea,_0x4f5ad9){return _0x12a3ea[_0xe159('0x9')](_0xe159('0xa'),attributes,{'tableName':_0xe159('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 8372519..1d3b13b 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 _0xd27f=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','GetTrunk','find','ShowTrunk','lodash','util','bluebird'];(function(_0x107308,_0x10f5cd){var _0x3da675=function(_0x2a996e){while(--_0x2a996e){_0x107308['push'](_0x107308['shift']());}};_0x3da675(++_0x10f5cd);}(_0xd27f,0x12f));var _0xfd27=function(_0x1067fe,_0x2e3cdf){_0x1067fe=_0x1067fe-0x0;var _0x14d4ec=_0xd27f[_0x1067fe];return _0x14d4ec;};'use strict';var _=require(_0xfd27('0x0'));var util=require(_0xfd27('0x1'));var moment=require('moment');var BPromise=require(_0xfd27('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd27('0x3'));var logger=require('../../config/logger')(_0xfd27('0x4'));var config=require(_0xfd27('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xfd27('0x6')][_0xfd27('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14ac49,_0x4c628f,_0xd9597b){return new BPromise(function(_0x509d91,_0x3c7332){return client[_0xfd27('0x8')](_0x14ac49,_0xd9597b)[_0xfd27('0x9')](function(_0x408f03){logger[_0xfd27('0xa')](_0xfd27('0xb'),_0x4c628f,_0xfd27('0xc'));logger[_0xfd27('0xd')](_0xfd27('0xe'),_0x4c628f,_0xfd27('0xc'),JSON[_0xfd27('0xf')](_0x408f03));if(_0x408f03[_0xfd27('0x10')]){if(_0x408f03['error'][_0xfd27('0x11')]===0x1f4){logger['error'](_0xfd27('0xb'),_0x4c628f,_0x408f03[_0xfd27('0x10')]['message']);return _0x3c7332(_0x408f03['error']['message']);}logger[_0xfd27('0x10')](_0xfd27('0xb'),_0x4c628f,_0x408f03['error'][_0xfd27('0x12')]);return _0x509d91(_0x408f03[_0xfd27('0x10')]['message']);}else{logger[_0xfd27('0xa')](_0xfd27('0xb'),_0x4c628f,_0xfd27('0xc'));_0x509d91(_0x408f03[_0xfd27('0x13')][_0xfd27('0x12')]);}})[_0xfd27('0x14')](function(_0x3672dc){logger[_0xfd27('0x10')](_0xfd27('0xb'),_0x4c628f,_0x3672dc);_0x3c7332(_0x3672dc);});});}exports['GetTrunk']=function(_0x26459e){var _0x27d27c=this;return new Promise(function(_0x4d69a7,_0x8c6094){return db[_0xfd27('0x15')][_0xfd27('0x16')]({'raw':_0x26459e[_0xfd27('0x17')]?_0x26459e[_0xfd27('0x17')][_0xfd27('0x18')]===undefined?!![]:![]:!![],'where':_0x26459e['options']?_0x26459e[_0xfd27('0x17')][_0xfd27('0x19')]||null:null,'attributes':_0x26459e[_0xfd27('0x17')]?_0x26459e[_0xfd27('0x17')][_0xfd27('0x1a')]||null:null,'limit':_0x26459e[_0xfd27('0x17')]?_0x26459e[_0xfd27('0x17')][_0xfd27('0x1b')]||null:null,'include':_0x26459e[_0xfd27('0x17')]?_0x26459e['options'][_0xfd27('0x1c')]?_[_0xfd27('0x1d')](_0x26459e[_0xfd27('0x17')]['include'],function(_0x289bcd){return{'model':db[_0x289bcd[_0xfd27('0x1e')]],'as':_0x289bcd['as'],'attributes':_0x289bcd['attributes'],'include':_0x289bcd['include']?_['map'](_0x289bcd[_0xfd27('0x1c')],function(_0x41b48b){return{'model':db[_0x41b48b[_0xfd27('0x1e')]],'as':_0x41b48b['as'],'attributes':_0x41b48b['attributes'],'include':_0x41b48b[_0xfd27('0x1c')]?_['map'](_0x41b48b['include'],function(_0x573cbf){return{'model':db[_0x573cbf['model']],'as':_0x573cbf['as'],'attributes':_0x573cbf[_0xfd27('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b4cca){logger[_0xfd27('0xa')](_0xfd27('0x1f'),_0x26459e);logger['debug'](_0xfd27('0x1f'),_0x26459e,JSON[_0xfd27('0xf')](_0x3b4cca));_0x4d69a7(_0x3b4cca);})[_0xfd27('0x14')](function(_0x4d728a){logger[_0xfd27('0x10')](_0xfd27('0x1f'),_0x4d728a[_0xfd27('0x12')],_0x26459e);_0x8c6094(_0x27d27c['error'](0x1f4,_0x4d728a[_0xfd27('0x12')]));});});};exports['ShowTrunk']=function(_0x2de353){var _0x59cc65=this;return new Promise(function(_0x2de3f1,_0x4dc56d){return db[_0xfd27('0x15')][_0xfd27('0x20')]({'raw':_0x2de353[_0xfd27('0x17')]?_0x2de353['options'][_0xfd27('0x18')]===undefined?!![]:![]:!![],'where':_0x2de353[_0xfd27('0x17')]?_0x2de353[_0xfd27('0x17')][_0xfd27('0x19')]||null:null,'attributes':_0x2de353[_0xfd27('0x17')]?_0x2de353['options'][_0xfd27('0x1a')]||null:null,'include':_0x2de353['options']?_0x2de353['options']['include']?_[_0xfd27('0x1d')](_0x2de353[_0xfd27('0x17')][_0xfd27('0x1c')],function(_0x53f54d){return{'model':db[_0x53f54d[_0xfd27('0x1e')]],'as':_0x53f54d['as'],'attributes':_0x53f54d['attributes'],'include':_0x53f54d['include']?_[_0xfd27('0x1d')](_0x53f54d[_0xfd27('0x1c')],function(_0x55ec17){return{'model':db[_0x55ec17[_0xfd27('0x1e')]],'as':_0x55ec17['as'],'attributes':_0x55ec17['attributes'],'include':_0x55ec17['include']?_[_0xfd27('0x1d')](_0x55ec17[_0xfd27('0x1c')],function(_0x108d58){return{'model':db[_0x108d58[_0xfd27('0x1e')]],'as':_0x108d58['as'],'attributes':_0x108d58['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd27('0x9')](function(_0xf68d62){logger[_0xfd27('0xa')]('ShowTrunk',_0x2de353);logger['debug'](_0xfd27('0x21'),_0x2de353,JSON[_0xfd27('0xf')](_0xf68d62));_0x2de3f1(_0xf68d62);})[_0xfd27('0x14')](function(_0x17eae4){logger[_0xfd27('0x10')](_0xfd27('0x21'),_0x17eae4[_0xfd27('0x12')],_0x2de353);_0x4dc56d(_0x59cc65[_0xfd27('0x10')](0x1f4,_0x17eae4[_0xfd27('0x12')]));});});}; \ No newline at end of file +var _0x3b0d=['raw','where','limit','include','attributes','map','model','Trunk','find','then','ShowTrunk','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetTrunk','findAll','options'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x3b0d,0xf9));var _0xd3b0=function(_0x543fca,_0x373924){_0x543fca=_0x543fca-0x0;var _0x1e8a64=_0x3b0d[_0x543fca];return _0x1e8a64;};'use strict';var _=require(_0xd3b0('0x0'));var util=require('util');var moment=require(_0xd3b0('0x1'));var BPromise=require(_0xd3b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3b0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd3b0('0x4'));var config=require(_0xd3b0('0x5'));var jayson=require(_0xd3b0('0x6'));var client=jayson[_0xd3b0('0x7')][_0xd3b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f1223,_0x4eedda,_0x145ef7){return new BPromise(function(_0x53150f,_0x2e447a){return client[_0xd3b0('0x9')](_0x3f1223,_0x145ef7)['then'](function(_0x163dbc){logger[_0xd3b0('0xa')](_0xd3b0('0xb'),_0x4eedda,_0xd3b0('0xc'));logger[_0xd3b0('0xd')](_0xd3b0('0xe'),_0x4eedda,_0xd3b0('0xc'),JSON[_0xd3b0('0xf')](_0x163dbc));if(_0x163dbc['error']){if(_0x163dbc['error'][_0xd3b0('0x10')]===0x1f4){logger[_0xd3b0('0x11')](_0xd3b0('0xb'),_0x4eedda,_0x163dbc['error']['message']);return _0x2e447a(_0x163dbc['error'][_0xd3b0('0x12')]);}logger[_0xd3b0('0x11')]('Trunk,\x20%s,\x20%s',_0x4eedda,_0x163dbc[_0xd3b0('0x11')][_0xd3b0('0x12')]);return _0x53150f(_0x163dbc[_0xd3b0('0x11')][_0xd3b0('0x12')]);}else{logger[_0xd3b0('0xa')](_0xd3b0('0xb'),_0x4eedda,_0xd3b0('0xc'));_0x53150f(_0x163dbc['result']['message']);}})[_0xd3b0('0x13')](function(_0x57d15b){logger[_0xd3b0('0x11')](_0xd3b0('0xb'),_0x4eedda,_0x57d15b);_0x2e447a(_0x57d15b);});});}exports[_0xd3b0('0x14')]=function(_0x43eec5){var _0x24b31b=this;return new Promise(function(_0x4e5d3b,_0x3647c0){return db['Trunk'][_0xd3b0('0x15')]({'raw':_0x43eec5['options']?_0x43eec5[_0xd3b0('0x16')][_0xd3b0('0x17')]===undefined?!![]:![]:!![],'where':_0x43eec5[_0xd3b0('0x16')]?_0x43eec5[_0xd3b0('0x16')][_0xd3b0('0x18')]||null:null,'attributes':_0x43eec5[_0xd3b0('0x16')]?_0x43eec5[_0xd3b0('0x16')]['attributes']||null:null,'limit':_0x43eec5['options']?_0x43eec5[_0xd3b0('0x16')][_0xd3b0('0x19')]||null:null,'include':_0x43eec5['options']?_0x43eec5[_0xd3b0('0x16')]['include']?_['map'](_0x43eec5[_0xd3b0('0x16')][_0xd3b0('0x1a')],function(_0x2cf36f){return{'model':db[_0x2cf36f['model']],'as':_0x2cf36f['as'],'attributes':_0x2cf36f[_0xd3b0('0x1b')],'include':_0x2cf36f[_0xd3b0('0x1a')]?_[_0xd3b0('0x1c')](_0x2cf36f[_0xd3b0('0x1a')],function(_0x3c8ed7){return{'model':db[_0x3c8ed7[_0xd3b0('0x1d')]],'as':_0x3c8ed7['as'],'attributes':_0x3c8ed7['attributes'],'include':_0x3c8ed7[_0xd3b0('0x1a')]?_[_0xd3b0('0x1c')](_0x3c8ed7['include'],function(_0x3726b8){return{'model':db[_0x3726b8[_0xd3b0('0x1d')]],'as':_0x3726b8['as'],'attributes':_0x3726b8[_0xd3b0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56afc5){logger[_0xd3b0('0xa')](_0xd3b0('0x14'),_0x43eec5);logger[_0xd3b0('0xd')](_0xd3b0('0x14'),_0x43eec5,JSON[_0xd3b0('0xf')](_0x56afc5));_0x4e5d3b(_0x56afc5);})[_0xd3b0('0x13')](function(_0x151d36){logger[_0xd3b0('0x11')](_0xd3b0('0x14'),_0x151d36['message'],_0x43eec5);_0x3647c0(_0x24b31b['error'](0x1f4,_0x151d36['message']));});});};exports['ShowTrunk']=function(_0x3de0bf){var _0x8517ca=this;return new Promise(function(_0x161728,_0x3833c8){return db[_0xd3b0('0x1e')][_0xd3b0('0x1f')]({'raw':_0x3de0bf[_0xd3b0('0x16')]?_0x3de0bf[_0xd3b0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3de0bf[_0xd3b0('0x16')]?_0x3de0bf[_0xd3b0('0x16')][_0xd3b0('0x18')]||null:null,'attributes':_0x3de0bf['options']?_0x3de0bf[_0xd3b0('0x16')][_0xd3b0('0x1b')]||null:null,'include':_0x3de0bf[_0xd3b0('0x16')]?_0x3de0bf[_0xd3b0('0x16')][_0xd3b0('0x1a')]?_['map'](_0x3de0bf['options'][_0xd3b0('0x1a')],function(_0x45d045){return{'model':db[_0x45d045[_0xd3b0('0x1d')]],'as':_0x45d045['as'],'attributes':_0x45d045[_0xd3b0('0x1b')],'include':_0x45d045[_0xd3b0('0x1a')]?_['map'](_0x45d045[_0xd3b0('0x1a')],function(_0x270a10){return{'model':db[_0x270a10['model']],'as':_0x270a10['as'],'attributes':_0x270a10[_0xd3b0('0x1b')],'include':_0x270a10['include']?_[_0xd3b0('0x1c')](_0x270a10['include'],function(_0x502088){return{'model':db[_0x502088[_0xd3b0('0x1d')]],'as':_0x502088['as'],'attributes':_0x502088['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3b0('0x20')](function(_0x50aff4){logger[_0xd3b0('0xa')](_0xd3b0('0x21'),_0x3de0bf);logger[_0xd3b0('0xd')](_0xd3b0('0x21'),_0x3de0bf,JSON[_0xd3b0('0xf')](_0x50aff4));_0x161728(_0x50aff4);})[_0xd3b0('0x13')](function(_0x28e16a){logger[_0xd3b0('0x11')](_0xd3b0('0x21'),_0x28e16a[_0xd3b0('0x12')],_0x3de0bf);_0x3833c8(_0x8517ca[_0xd3b0('0x11')](0x1f4,_0x28e16a[_0xd3b0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 2b08747..8bd22a2 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 _0x9bd5=['express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','exports'];(function(_0x3e58e8,_0x1bde1a){var _0xaddcd7=function(_0x2d2a96){while(--_0x2d2a96){_0x3e58e8['push'](_0x3e58e8['shift']());}};_0xaddcd7(++_0x1bde1a);}(_0x9bd5,0x138));var _0x59bd=function(_0x59b149,_0x8b477e){_0x59b149=_0x59b149-0x0;var _0x1ddb5d=_0x9bd5[_0x59b149];return _0x1ddb5d;};'use strict';var express=require(_0x59bd('0x0'));var router=express[_0x59bd('0x1')]();var auth=require(_0x59bd('0x2'));var controller=require(_0x59bd('0x3'));router[_0x59bd('0x4')](_0x59bd('0x5'),auth[_0x59bd('0x6')](),controller['update']);module[_0x59bd('0x7')]=router; \ No newline at end of file +var _0xdffd=['exports','../../components/auth/service','./user-setting.controller','put','/:id','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdffd,0x18d));var _0xddff=function(_0x270217,_0x32a7b9){_0x270217=_0x270217-0x0;var _0x1160ae=_0xdffd[_0x270217];return _0x1160ae;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xddff('0x0'));var controller=require(_0xddff('0x1'));router[_0xddff('0x2')](_0xddff('0x3'),auth['isAuthenticated'](),controller[_0xddff('0x4')]);module[_0xddff('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 8193d63..78c4527 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 _0x262b=['debug','exports','ENUM','error','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','info'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x262b,0x195));var _0xb262=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x262b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb262('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning',_0xb262('0x1'),_0xb262('0x2')];module[_0xb262('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xb262('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xb262('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xb262('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xb262('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xb262('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xb262('0x9')],'unique':_0xb262('0xa')}}; \ No newline at end of file +var _0x1adb=['ENUM','error','TEXT','DATE','INTEGER','UserId','sequelize','warning','info'];(function(_0x464ff7,_0x2fc039){var _0x228afc=function(_0x4cc6f6){while(--_0x4cc6f6){_0x464ff7['push'](_0x464ff7['shift']());}};_0x228afc(++_0x2fc039);}(_0x1adb,0x12f));var _0xb1ad=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1adb[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xb1ad('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xb1ad('0x1'),_0xb1ad('0x2'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xb1ad('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xb1ad('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xb1ad('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xb1ad('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xb1ad('0x7')],'unique':_0xb1ad('0x8')}}; \ 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 6be0488..9038523 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 _0x949d=['body','catch','lodash','ioredis','../../config/logger','api','socket.io-emitter','redis','register','localhost','status','update','then','error','name','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find'];(function(_0x5d3688,_0x7b9f90){var _0x26e538=function(_0x2fbb7f){while(--_0x2fbb7f){_0x5d3688['push'](_0x5d3688['shift']());}};_0x26e538(++_0x7b9f90);}(_0x949d,0x162));var _0xd949=function(_0x438492,_0x133f38){_0x438492=_0x438492-0x0;var _0x28cc54=_0x949d[_0x438492];return _0x28cc54;};'use strict';var _=require(_0xd949('0x0'));var Redis=require(_0xd949('0x1'));var logger=require(_0xd949('0x2'))(_0xd949('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0xd949('0x4'))(new Redis(config[_0xd949('0x5')]));require('./user-setting.socket')[_0xd949('0x6')](socket);config[_0xd949('0x5')]=_['defaults'](config[_0xd949('0x5')],{'host':_0xd949('0x7'),'port':0x18eb});function respondWithResult(_0x6e8175,_0x5e90f2){_0x5e90f2=_0x5e90f2||0xc8;return function(_0x208942){if(_0x208942){return _0x6e8175[_0xd949('0x8')](_0x5e90f2)['json'](_0x208942);}};}function saveUpdates(_0x58e185){return function(_0x1bba22){if(_0x1bba22){return _0x1bba22[_0xd949('0x9')](_0x58e185)[_0xd949('0xa')](function(_0x24eff8){return _0x24eff8;});}return null;};}function handleEntityNotFound(_0xefc12f){return function(_0x5037df){if(!_0x5037df){_0xefc12f['sendStatus'](0x194);}return _0x5037df;};}function handleError(_0xd4d875,_0x2fb71f){_0x2fb71f=_0x2fb71f||0x1f4;return function(_0xc55b5a){logger[_0xd949('0xb')](_0xc55b5a['stack']);if(_0xc55b5a[_0xd949('0xc')]){delete _0xc55b5a[_0xd949('0xc')];}_0xd4d875[_0xd949('0x8')](_0x2fb71f)[_0xd949('0xd')](_0xc55b5a);};}exports[_0xd949('0x9')]=function(_0x2edba2,_0x204615){if(_0x2edba2[_0xd949('0xe')]['role']!==_0xd949('0xf'))throw new Error(_0xd949('0x10'));if(isNaN(Number(_0x2edba2[_0xd949('0x11')]['id'])))throw new Error(_0xd949('0x12'));return db['UserSetting'][_0xd949('0x13')]({'where':{'id':_0x2edba2[_0xd949('0x11')]['id']}})[_0xd949('0xa')](handleEntityNotFound(_0x204615,null))[_0xd949('0xa')](saveUpdates(_0x2edba2[_0xd949('0x14')],null))[_0xd949('0xa')](respondWithResult(_0x204615,null))[_0xd949('0x15')](handleError(_0x204615,null));}; \ No newline at end of file +var _0x2821=['error','stack','name','user','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','localhost','status','json','update','then'];(function(_0x5e0130,_0x440609){var _0x366d0f=function(_0x4e2346){while(--_0x4e2346){_0x5e0130['push'](_0x5e0130['shift']());}};_0x366d0f(++_0x440609);}(_0x2821,0x87));var _0x1282=function(_0x2256f6,_0x394d89){_0x2256f6=_0x2256f6-0x0;var _0x162513=_0x2821[_0x2256f6];return _0x162513;};'use strict';var _=require(_0x1282('0x0'));var Redis=require(_0x1282('0x1'));var logger=require(_0x1282('0x2'))(_0x1282('0x3'));var config=require(_0x1282('0x4'));var db=require(_0x1282('0x5'))['db'];var socket=require(_0x1282('0x6'))(new Redis(config[_0x1282('0x7')]));require(_0x1282('0x8'))[_0x1282('0x9')](socket);config[_0x1282('0x7')]=_['defaults'](config[_0x1282('0x7')],{'host':_0x1282('0xa'),'port':0x18eb});function respondWithResult(_0x293947,_0x13beb5){_0x13beb5=_0x13beb5||0xc8;return function(_0xa4eee9){if(_0xa4eee9){return _0x293947[_0x1282('0xb')](_0x13beb5)[_0x1282('0xc')](_0xa4eee9);}};}function saveUpdates(_0x1436ba){return function(_0x5682bd){if(_0x5682bd){return _0x5682bd[_0x1282('0xd')](_0x1436ba)[_0x1282('0xe')](function(_0x3bda99){return _0x3bda99;});}return null;};}function handleEntityNotFound(_0x2ad86c){return function(_0x30fe03){if(!_0x30fe03){_0x2ad86c['sendStatus'](0x194);}return _0x30fe03;};}function handleError(_0xcfc680,_0x3452aa){_0x3452aa=_0x3452aa||0x1f4;return function(_0x4db9f6){logger[_0x1282('0xf')](_0x4db9f6[_0x1282('0x10')]);if(_0x4db9f6['name']){delete _0x4db9f6[_0x1282('0x11')];}_0xcfc680['status'](_0x3452aa)['send'](_0x4db9f6);};}exports[_0x1282('0xd')]=function(_0x1db4bf,_0x1c62fb){if(_0x1db4bf[_0x1282('0x12')]['role']!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x1db4bf[_0x1282('0x13')]['id'])))throw new Error(_0x1282('0x14'));return db[_0x1282('0x15')][_0x1282('0x16')]({'where':{'id':_0x1db4bf[_0x1282('0x13')]['id']}})[_0x1282('0xe')](handleEntityNotFound(_0x1c62fb,null))[_0x1282('0xe')](saveUpdates(_0x1db4bf[_0x1282('0x17')],null))['then'](respondWithResult(_0x1c62fb,null))[_0x1282('0x18')](handleError(_0x1c62fb,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 4e23556..1f19e21 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 _0xafe5=['emit','hasOwnProperty','hook','exports','events','UserSetting','save','update','remove'];(function(_0x66d08c,_0x27cea9){var _0x2e9e56=function(_0x1735a7){while(--_0x1735a7){_0x66d08c['push'](_0x66d08c['shift']());}};_0x2e9e56(++_0x27cea9);}(_0xafe5,0x94));var _0x5afe=function(_0x4178d9,_0x457645){_0x4178d9=_0x4178d9-0x0;var _0x4c0932=_0xafe5[_0x4178d9];return _0x4c0932;};'use strict';var EventEmitter=require(_0x5afe('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x5afe('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5afe('0x2'),'afterUpdate':_0x5afe('0x3'),'afterDestroy':_0x5afe('0x4')};function emitEvent(_0x3dbdf4){return function(_0x4162d7,_0x3f5cab,_0x5c1daf){UserSettingEvents[_0x5afe('0x5')](_0x3dbdf4+':'+_0x4162d7['id'],_0x4162d7);UserSettingEvents[_0x5afe('0x5')](_0x3dbdf4,_0x4162d7);_0x5c1daf(null);};}for(var e in events){if(events[_0x5afe('0x6')](e)){var event=events[e];UserSetting[_0x5afe('0x7')](e,emitEvent(event));}}module[_0x5afe('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x6119=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x52775e,_0x44001a){var _0x5e3cae=function(_0x10ba61){while(--_0x10ba61){_0x52775e['push'](_0x52775e['shift']());}};_0x5e3cae(++_0x44001a);}(_0x6119,0x8e));var _0x9611=function(_0x12daad,_0x21281d){_0x12daad=_0x12daad-0x0;var _0x2ecbd6=_0x6119[_0x12daad];return _0x2ecbd6;};'use strict';var EventEmitter=require(_0x9611('0x0'));var UserSetting=require(_0x9611('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x9611('0x2')](0x0);var events={'afterCreate':_0x9611('0x3'),'afterUpdate':_0x9611('0x4'),'afterDestroy':_0x9611('0x5')};function emitEvent(_0x28a93c){return function(_0x268c21,_0x1f7db2,_0x742e63){UserSettingEvents[_0x9611('0x6')](_0x28a93c+':'+_0x268c21['id'],_0x268c21);UserSettingEvents['emit'](_0x28a93c,_0x268c21);_0x742e63(null);};}for(var e in events){if(events[_0x9611('0x7')](e)){var event=events[e];UserSetting[_0x9611('0x8')](e,emitEvent(event));}}module[_0x9611('0x9')]=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 ba684f7..65593e0 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 _0x407f=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','define'];(function(_0x11b8ea,_0x17e988){var _0x41cf18=function(_0x4e7cb6){while(--_0x4e7cb6){_0x11b8ea['push'](_0x11b8ea['shift']());}};_0x41cf18(++_0x17e988);}(_0x407f,0xc2));var _0xf407=function(_0x2e92fc,_0x560c00){_0x2e92fc=_0x2e92fc-0x0;var _0x265912=_0x407f[_0x2e92fc];return _0x265912;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x5e211d){return _0x5e211d[_0xf407('0x0')](_0xf407('0x1'),attributes,{'tableName':_0xf407('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ec297){if(!_0x1ec297[_0xf407('0x3')])_0x1ec297[_0xf407('0x4')]=null;else if(_0x1ec297[_0xf407('0x4')]===null)_0x1ec297[_0xf407('0x4')]=new Date();}}});}; \ No newline at end of file +var _0xa75b=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting','user_settings'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xa75b,0x170));var _0xba75=function(_0x4289ae,_0x5445ae){_0x4289ae=_0x4289ae-0x0;var _0x1b7f5a=_0xa75b[_0x4289ae];return _0x1b7f5a;};'use strict';var attributes=require(_0xba75('0x0'));module['exports']=function(_0x546e14){return _0x546e14[_0xba75('0x1')](_0xba75('0x2'),attributes,{'tableName':_0xba75('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cde96){if(!_0x3cde96[_0xba75('0x4')])_0x3cde96[_0xba75('0x5')]=null;else if(_0x3cde96[_0xba75('0x5')]===null)_0x3cde96[_0xba75('0x5')]=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 7b5a08d..eb68385 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 _0x0518=['save','remove','update','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events'];(function(_0x533c42,_0x15f0a7){var _0x2a13d7=function(_0x1b2c6c){while(--_0x1b2c6c){_0x533c42['push'](_0x533c42['shift']());}};_0x2a13d7(++_0x15f0a7);}(_0x0518,0xa9));var _0x8051=function(_0x13249f,_0x8dc932){_0x13249f=_0x13249f-0x0;var _0x871145=_0x0518[_0x13249f];return _0x871145;};'use strict';var UserSettingEvents=require(_0x8051('0x0'));var events=[_0x8051('0x1'),_0x8051('0x2'),_0x8051('0x3')];function createListener(_0x2dc2d9,_0x1366ee){return function(_0xdf6204){_0x1366ee['emit'](_0x2dc2d9,_0xdf6204);if(_0x2dc2d9===_0x8051('0x4')){_0x1366ee['emit'](_0x8051('0x5')+_0xdf6204[_0x8051('0x6')],_0xdf6204);}};}exports[_0x8051('0x7')]=function(_0xb282c){for(var _0x4b7f46=0x0,_0x584b4d=events[_0x8051('0x8')];_0x4b7f46<_0x584b4d;_0x4b7f46++){var _0x469481=events[_0x4b7f46];var _0x1fd939=createListener(_0x8051('0x9')+_0x469481,_0xb282c);UserSettingEvents['on'](_0x469481,_0x1fd939);}}; \ No newline at end of file +var _0xd624=['emit','user-setting:update','register','length','user-setting:','save','remove','update'];(function(_0x5d1a10,_0x98e2ca){var _0x23800b=function(_0x18d830){while(--_0x18d830){_0x5d1a10['push'](_0x5d1a10['shift']());}};_0x23800b(++_0x98e2ca);}(_0xd624,0xed));var _0x4d62=function(_0x53cee8,_0x296430){_0x53cee8=_0x53cee8-0x0;var _0x4e5277=_0xd624[_0x53cee8];return _0x4e5277;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x4d62('0x0'),_0x4d62('0x1'),_0x4d62('0x2')];function createListener(_0x3138fe,_0xad07ca){return function(_0x2f5865){_0xad07ca[_0x4d62('0x3')](_0x3138fe,_0x2f5865);if(_0x3138fe===_0x4d62('0x4')){_0xad07ca[_0x4d62('0x3')]('user-setting:update:user-'+_0x2f5865['UserId'],_0x2f5865);}};}exports[_0x4d62('0x5')]=function(_0x383153){for(var _0xce36fe=0x0,_0xb52701=events[_0x4d62('0x6')];_0xce36fe<_0xb52701;_0xce36fe++){var _0x3f93f4=events[_0xce36fe];var _0x5dd060=createListener(_0x4d62('0x7')+_0x3f93f4,_0x383153);UserSettingEvents['on'](_0x3f93f4,_0x5dd060);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9131f94..63f2d71 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 _0x2136=['index','isAuthenticated','describe','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','getLists','/:id/agents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','addContacts','create','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/api_key','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x5e4224,_0x3a66ad){var _0x10805f=function(_0x69fb0d){while(--_0x69fb0d){_0x5e4224['push'](_0x5e4224['shift']());}};_0x10805f(++_0x3a66ad);}(_0x2136,0xda));var _0x6213=function(_0x503287,_0x252ead){_0x503287=_0x503287-0x0;var _0x3709ef=_0x2136[_0x503287];return _0x3709ef;};'use strict';var multer=require(_0x6213('0x0'));var util=require(_0x6213('0x1'));var path=require('path');var timeout=require(_0x6213('0x2'));var express=require(_0x6213('0x3'));var router=express['Router']();var fs_extra=require(_0x6213('0x4'));var auth=require(_0x6213('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6213('0x6'));var controller=require('./user.controller');router[_0x6213('0x7')]('/',auth['isAuthenticated'](),controller[_0x6213('0x8')]);router[_0x6213('0x7')]('/describe',auth[_0x6213('0x9')](),controller[_0x6213('0xa')]);router['get']('/whoami',auth['isAuthenticated'](),controller[_0x6213('0xb')]);router[_0x6213('0x7')](_0x6213('0xc'),auth[_0x6213('0x9')](),controller[_0x6213('0xd')]);router[_0x6213('0x7')](_0x6213('0xe'),auth['isAuthenticated'](),controller[_0x6213('0xf')]);router[_0x6213('0x7')]('/:id/avatar',controller[_0x6213('0x10')]);router['get']('/:id/open_tabs',auth[_0x6213('0x9')](),controller['getOpenTabs']);router[_0x6213('0x7')](_0x6213('0x11'),auth[_0x6213('0x9')](),controller[_0x6213('0x12')]);router[_0x6213('0x7')]('/:id/queues',auth[_0x6213('0x9')](),controller['getQueues']);router[_0x6213('0x7')](_0x6213('0x13'),auth[_0x6213('0x9')](),controller[_0x6213('0x14')]);router['get'](_0x6213('0x15'),auth[_0x6213('0x9')](),controller[_0x6213('0x16')]);router['get']('/:id/recordings',auth[_0x6213('0x9')](),controller[_0x6213('0x17')]);router[_0x6213('0x7')]('/:id/screen_recordings',auth[_0x6213('0x9')](),controller[_0x6213('0x18')]);router[_0x6213('0x7')](_0x6213('0x19'),auth[_0x6213('0x9')](),controller[_0x6213('0x1a')]);router['get'](_0x6213('0x1b'),auth[_0x6213('0x9')](),controller[_0x6213('0x1c')]);router[_0x6213('0x7')](_0x6213('0x1d'),auth['isAuthenticated'](),controller[_0x6213('0x1e')]);router[_0x6213('0x7')](_0x6213('0x1f'),auth[_0x6213('0x9')](),controller['getSmsInteractions']);router[_0x6213('0x7')]('/:id/fax/interactions',auth[_0x6213('0x9')](),controller[_0x6213('0x20')]);router[_0x6213('0x7')](_0x6213('0x21'),auth[_0x6213('0x9')](),controller['getWhatsappInteractions']);router['get'](_0x6213('0x22'),auth[_0x6213('0x9')](),controller[_0x6213('0x23')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0x6213('0x24')]);router[_0x6213('0x7')](_0x6213('0x25'),auth[_0x6213('0x9')](),controller['getAgents']);router[_0x6213('0x7')](_0x6213('0x26'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x6213('0x7')](_0x6213('0x27'),auth[_0x6213('0x9')](),controller[_0x6213('0x28')]);router[_0x6213('0x7')](_0x6213('0x29'),auth[_0x6213('0x9')](),controller[_0x6213('0x2a')]);router[_0x6213('0x7')](_0x6213('0x2b'),auth['isAuthenticated'](),controller[_0x6213('0x2c')]);router[_0x6213('0x7')](_0x6213('0x2d'),auth[_0x6213('0x9')](),controller[_0x6213('0x2e')]);router[_0x6213('0x7')]('/:id/chat_websites',auth[_0x6213('0x9')](),controller[_0x6213('0x2f')]);router[_0x6213('0x7')](_0x6213('0x30'),auth[_0x6213('0x9')](),controller[_0x6213('0x31')]);router[_0x6213('0x7')](_0x6213('0x32'),auth[_0x6213('0x9')](),controller[_0x6213('0x33')]);router[_0x6213('0x7')](_0x6213('0x34'),auth[_0x6213('0x9')](),controller[_0x6213('0x35')]);router[_0x6213('0x7')]('/:id/api_key',auth[_0x6213('0x9')](),controller['getApiKey']);router[_0x6213('0x36')](_0x6213('0x11'),auth[_0x6213('0x9')](),controller[_0x6213('0x37')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6213('0x38')]);router[_0x6213('0x36')]('/create_many',auth[_0x6213('0x9')](),controller[_0x6213('0x39')]);router[_0x6213('0x36')](_0x6213('0x3a'),auth[_0x6213('0x9')](),controller[_0x6213('0x3b')]);var upload=multer({'storage':multer[_0x6213('0x3c')]({'destination':function(_0x3b7790,_0x494d93,_0x1d8b95){_0x1d8b95(null,path[_0x6213('0x3d')](config[_0x6213('0x3e')],_0x6213('0x3f')));},'filename':function(_0x1e0f2a,_0x4464e0,_0x38c2b3){_0x38c2b3(null,util[_0x6213('0x40')](_0x6213('0x41'),Date['now'](),_0x4464e0[_0x6213('0x42')]));}})});router[_0x6213('0x36')](_0x6213('0x43'),upload['single'](_0x6213('0x44')),controller[_0x6213('0x45')]);router[_0x6213('0x36')](_0x6213('0x46'),auth['isAuthenticated'](),controller[_0x6213('0x47')]);router[_0x6213('0x36')](_0x6213('0x48'),auth[_0x6213('0x9')](),controller[_0x6213('0x49')]);router[_0x6213('0x36')](_0x6213('0x4a'),auth[_0x6213('0x9')](),controller[_0x6213('0x4b')]);router[_0x6213('0x36')](_0x6213('0x4c'),auth['isAuthenticated'](),controller[_0x6213('0x4d')]);router['post'](_0x6213('0x22'),auth[_0x6213('0x9')](),controller['addTeams']);router['post'](_0x6213('0x4e'),auth[_0x6213('0x9')](),controller['addChatInteractions']);router[_0x6213('0x36')](_0x6213('0x4f'),auth[_0x6213('0x9')](),controller[_0x6213('0x50')]);router[_0x6213('0x36')](_0x6213('0x51'),auth['isAuthenticated'](),controller[_0x6213('0x52')]);router[_0x6213('0x36')](_0x6213('0x53'),auth[_0x6213('0x9')](),controller[_0x6213('0x54')]);router[_0x6213('0x36')](_0x6213('0x55'),auth[_0x6213('0x9')](),controller['addOpenchannelInteractions']);router[_0x6213('0x36')](_0x6213('0x56'),auth[_0x6213('0x9')](),controller[_0x6213('0x57')]);router['post'](_0x6213('0x27'),auth['isAuthenticated'](),controller[_0x6213('0x58')]);router[_0x6213('0x36')](_0x6213('0x29'),auth[_0x6213('0x9')](),controller['addMailAccounts']);router[_0x6213('0x36')]('/:id/openchannel_accounts',auth[_0x6213('0x9')](),controller['addOpenchannelAccounts']);router[_0x6213('0x36')](_0x6213('0x2d'),auth[_0x6213('0x9')](),controller[_0x6213('0x59')]);router[_0x6213('0x36')](_0x6213('0x5a'),auth[_0x6213('0x9')](),controller[_0x6213('0x5b')]);router['post']('/:id/whatsapp_accounts',auth[_0x6213('0x9')](),controller['addWhatsappAccounts']);router['post'](_0x6213('0x32'),auth[_0x6213('0x9')](),controller['addSquareProjects']);router[_0x6213('0x36')](_0x6213('0x5c'),auth[_0x6213('0x9')](),controller['createApiKey']);router['put'](_0x6213('0xe'),auth[_0x6213('0x9')](),controller[_0x6213('0x5d')]);router[_0x6213('0x5e')](_0x6213('0x5f'),auth['isAuthenticated'](),controller[_0x6213('0x60')]);router[_0x6213('0x61')](_0x6213('0x3a'),auth[_0x6213('0x9')](),controller[_0x6213('0x62')]);router[_0x6213('0x61')]('/:id/teams',auth[_0x6213('0x9')](),controller[_0x6213('0x63')]);router[_0x6213('0x61')](_0x6213('0xe'),auth[_0x6213('0x9')](),controller['destroy']);router['delete']('/:id/chat_interactions',auth[_0x6213('0x9')](),controller[_0x6213('0x64')]);router[_0x6213('0x61')](_0x6213('0x4f'),auth[_0x6213('0x9')](),controller[_0x6213('0x65')]);router[_0x6213('0x61')](_0x6213('0x51'),auth[_0x6213('0x9')](),controller[_0x6213('0x66')]);router[_0x6213('0x61')]('/:id/sms_interactions',auth[_0x6213('0x9')](),controller[_0x6213('0x67')]);router['delete'](_0x6213('0x55'),auth[_0x6213('0x9')](),controller[_0x6213('0x68')]);router[_0x6213('0x61')](_0x6213('0x56'),auth[_0x6213('0x9')](),controller[_0x6213('0x69')]);router['delete']('/:id/fax_accounts',auth[_0x6213('0x9')](),controller[_0x6213('0x6a')]);router[_0x6213('0x61')](_0x6213('0x29'),auth[_0x6213('0x9')](),controller[_0x6213('0x6b')]);router['delete']('/:id/openchannel_accounts',auth[_0x6213('0x9')](),controller[_0x6213('0x6c')]);router[_0x6213('0x61')](_0x6213('0x2d'),auth[_0x6213('0x9')](),controller[_0x6213('0x6d')]);router['delete'](_0x6213('0x5a'),auth['isAuthenticated'](),controller[_0x6213('0x6e')]);router[_0x6213('0x61')](_0x6213('0x30'),auth[_0x6213('0x9')](),controller[_0x6213('0x6f')]);router[_0x6213('0x61')](_0x6213('0x32'),auth[_0x6213('0x9')](),controller['removeSquareProjects']);router[_0x6213('0x61')](_0x6213('0x5c'),auth['isAuthenticated'](),controller[_0x6213('0x70')]);module['exports']=router; \ No newline at end of file +var _0x70b7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/presence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','/:id/queues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','single','addAvatar','login','logout','/:id/pause','/:id/unpause','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','removeQueues','delete','/:id/teams','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/whatsapp_accounts','removeSquareProjects','exports','multer','util','path','connect-timeout','express'];(function(_0x58a121,_0x1cbad0){var _0xbfe6ca=function(_0x481ccb){while(--_0x481ccb){_0x58a121['push'](_0x58a121['shift']());}};_0xbfe6ca(++_0x1cbad0);}(_0x70b7,0x6b));var _0x770b=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x70b7[_0x5774be];return _0x4914b4;};'use strict';var multer=require(_0x770b('0x0'));var util=require(_0x770b('0x1'));var path=require(_0x770b('0x2'));var timeout=require(_0x770b('0x3'));var express=require(_0x770b('0x4'));var router=express[_0x770b('0x5')]();var fs_extra=require(_0x770b('0x6'));var auth=require(_0x770b('0x7'));var interaction=require(_0x770b('0x8'));var config=require(_0x770b('0x9'));var controller=require(_0x770b('0xa'));router[_0x770b('0xb')]('/',auth[_0x770b('0xc')](),controller[_0x770b('0xd')]);router[_0x770b('0xb')](_0x770b('0xe'),auth[_0x770b('0xc')](),controller['describe']);router[_0x770b('0xb')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router[_0x770b('0xb')](_0x770b('0xf'),auth[_0x770b('0xc')](),controller['getPresence']);router[_0x770b('0xb')](_0x770b('0x10'),auth[_0x770b('0xc')](),controller[_0x770b('0x11')]);router[_0x770b('0xb')](_0x770b('0x12'),controller[_0x770b('0x13')]);router[_0x770b('0xb')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x770b('0x14')]);router[_0x770b('0xb')](_0x770b('0x15'),auth['isAuthenticated'](),controller['getContacts']);router['get'](_0x770b('0x16'),auth[_0x770b('0xc')](),controller['getQueues']);router[_0x770b('0xb')]('/:id/queues_rt',auth[_0x770b('0xc')](),controller[_0x770b('0x17')]);router[_0x770b('0xb')](_0x770b('0x18'),auth[_0x770b('0xc')](),controller[_0x770b('0x19')]);router[_0x770b('0xb')]('/:id/recordings',auth[_0x770b('0xc')](),controller['getRecordings']);router[_0x770b('0xb')](_0x770b('0x1a'),auth['isAuthenticated'](),controller[_0x770b('0x1b')]);router[_0x770b('0xb')](_0x770b('0x1c'),auth[_0x770b('0xc')](),controller[_0x770b('0x1d')]);router[_0x770b('0xb')](_0x770b('0x1e'),auth['isAuthenticated'](),controller[_0x770b('0x1f')]);router[_0x770b('0xb')]('/:id/mail/interactions',auth[_0x770b('0xc')](),controller[_0x770b('0x20')]);router[_0x770b('0xb')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x770b('0x21')]);router['get']('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x770b('0xb')](_0x770b('0x22'),auth[_0x770b('0xc')](),controller[_0x770b('0x23')]);router[_0x770b('0xb')]('/:id/teams',auth['isAuthenticated'](),controller[_0x770b('0x24')]);router[_0x770b('0xb')](_0x770b('0x25'),auth[_0x770b('0xc')](),controller[_0x770b('0x26')]);router[_0x770b('0xb')]('/:id/agents',auth[_0x770b('0xc')](),controller[_0x770b('0x27')]);router[_0x770b('0xb')](_0x770b('0x28'),auth['isAuthenticated'](),controller[_0x770b('0x29')]);router[_0x770b('0xb')](_0x770b('0x2a'),auth[_0x770b('0xc')](),controller[_0x770b('0x2b')]);router['get'](_0x770b('0x2c'),auth['isAuthenticated'](),controller[_0x770b('0x2d')]);router['get'](_0x770b('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get']('/:id/sms_accounts',auth[_0x770b('0xc')](),controller[_0x770b('0x2f')]);router[_0x770b('0xb')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x770b('0x30')]);router[_0x770b('0xb')]('/:id/whatsapp_accounts',auth[_0x770b('0xc')](),controller['getWhatsappAccounts']);router['get'](_0x770b('0x31'),auth['isAuthenticated'](),controller[_0x770b('0x32')]);router['get'](_0x770b('0x33'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x770b('0xb')](_0x770b('0x34'),auth['isAuthenticated'](),controller[_0x770b('0x35')]);router[_0x770b('0x36')]('/:id/contacts',auth[_0x770b('0xc')](),controller[_0x770b('0x37')]);router['post']('/',auth[_0x770b('0xc')](),controller[_0x770b('0x38')]);router['post']('/create_many',auth[_0x770b('0xc')](),controller[_0x770b('0x39')]);router['post'](_0x770b('0x16'),auth[_0x770b('0xc')](),controller[_0x770b('0x3a')]);var upload=multer({'storage':multer[_0x770b('0x3b')]({'destination':function(_0x59bc58,_0x55bb74,_0x2c59ac){_0x2c59ac(null,path['join'](config[_0x770b('0x3c')],_0x770b('0x3d')));},'filename':function(_0x4c890c,_0x75a76d,_0x37f342){_0x37f342(null,util[_0x770b('0x3e')](_0x770b('0x3f'),Date[_0x770b('0x40')](),_0x75a76d[_0x770b('0x41')]));}})});router[_0x770b('0x36')]('/:id/avatar',upload[_0x770b('0x42')]('file'),controller[_0x770b('0x43')]);router[_0x770b('0x36')]('/:id/login',auth['isAuthenticated'](),controller[_0x770b('0x44')]);router['post']('/:id/logout',auth[_0x770b('0xc')](),controller[_0x770b('0x45')]);router[_0x770b('0x36')](_0x770b('0x46'),auth[_0x770b('0xc')](),controller['pause']);router[_0x770b('0x36')](_0x770b('0x47'),auth[_0x770b('0xc')](),controller['unpause']);router[_0x770b('0x36')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x770b('0x36')]('/:id/chat_interactions',auth[_0x770b('0xc')](),controller['addChatInteractions']);router[_0x770b('0x36')]('/:id/mail_interactions',auth[_0x770b('0xc')](),controller[_0x770b('0x48')]);router[_0x770b('0x36')](_0x770b('0x49'),auth[_0x770b('0xc')](),controller[_0x770b('0x4a')]);router[_0x770b('0x36')](_0x770b('0x4b'),auth[_0x770b('0xc')](),controller[_0x770b('0x4c')]);router['post']('/:id/openchannel_interactions',auth[_0x770b('0xc')](),controller[_0x770b('0x4d')]);router[_0x770b('0x36')](_0x770b('0x4e'),auth[_0x770b('0xc')](),controller[_0x770b('0x4f')]);router[_0x770b('0x36')](_0x770b('0x2a'),auth[_0x770b('0xc')](),controller['addFaxAccounts']);router[_0x770b('0x36')](_0x770b('0x2c'),auth[_0x770b('0xc')](),controller[_0x770b('0x50')]);router[_0x770b('0x36')](_0x770b('0x2e'),auth[_0x770b('0xc')](),controller[_0x770b('0x51')]);router[_0x770b('0x36')](_0x770b('0x52'),auth[_0x770b('0xc')](),controller[_0x770b('0x53')]);router[_0x770b('0x36')](_0x770b('0x54'),auth[_0x770b('0xc')](),controller['addChatWebsites']);router[_0x770b('0x36')]('/:id/whatsapp_accounts',auth[_0x770b('0xc')](),controller[_0x770b('0x55')]);router['post'](_0x770b('0x31'),auth[_0x770b('0xc')](),controller[_0x770b('0x56')]);router['post']('/:id/api_key',auth[_0x770b('0xc')](),controller[_0x770b('0x57')]);router[_0x770b('0x58')]('/:id',auth[_0x770b('0xc')](),controller[_0x770b('0x59')]);router[_0x770b('0x58')](_0x770b('0x5a'),auth['isAuthenticated'](),controller[_0x770b('0x5b')]);router['delete'](_0x770b('0x16'),auth[_0x770b('0xc')](),controller[_0x770b('0x5c')]);router[_0x770b('0x5d')](_0x770b('0x5e'),auth['isAuthenticated'](),controller[_0x770b('0x5f')]);router[_0x770b('0x5d')](_0x770b('0x10'),auth['isAuthenticated'](),controller[_0x770b('0x60')]);router[_0x770b('0x5d')](_0x770b('0x61'),auth[_0x770b('0xc')](),controller[_0x770b('0x62')]);router['delete'](_0x770b('0x63'),auth[_0x770b('0xc')](),controller['removeMailInteractions']);router[_0x770b('0x5d')]('/:id/fax_interactions',auth[_0x770b('0xc')](),controller[_0x770b('0x64')]);router['delete']('/:id/sms_interactions',auth[_0x770b('0xc')](),controller[_0x770b('0x65')]);router[_0x770b('0x5d')](_0x770b('0x66'),auth[_0x770b('0xc')](),controller[_0x770b('0x67')]);router[_0x770b('0x5d')](_0x770b('0x4e'),auth[_0x770b('0xc')](),controller[_0x770b('0x68')]);router[_0x770b('0x5d')](_0x770b('0x2a'),auth[_0x770b('0xc')](),controller[_0x770b('0x69')]);router[_0x770b('0x5d')](_0x770b('0x2c'),auth['isAuthenticated'](),controller[_0x770b('0x6a')]);router[_0x770b('0x5d')](_0x770b('0x2e'),auth[_0x770b('0xc')](),controller[_0x770b('0x6b')]);router[_0x770b('0x5d')](_0x770b('0x52'),auth[_0x770b('0xc')](),controller[_0x770b('0x6c')]);router[_0x770b('0x5d')]('/:id/chat_websites',auth[_0x770b('0xc')](),controller['removeChatWebsites']);router[_0x770b('0x5d')](_0x770b('0x6d'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x770b('0x5d')](_0x770b('0x31'),auth[_0x770b('0xc')](),controller[_0x770b('0x6e')]);router[_0x770b('0x5d')](_0x770b('0x34'),auth[_0x770b('0xc')](),controller['removeApiKey']);module[_0x770b('0x6f')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 75bab01..1367863 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 _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x5d41e8,_0x3f404b){var _0x5cdcb9=function(_0x56fed6){while(--_0x56fed6){_0x5d41e8['push'](_0x5d41e8['shift']());}};_0x5cdcb9(++_0x3f404b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0xcb91[_0x38841c];return _0x500610;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'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 c82ff24..2aa8890 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 _0x8160=['online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','QueueId','Queue:save','voice','VoiceQueue','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','channel','isArray','Queue:remove','destroy','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','root','server/files/images/','getOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','findOne','filters','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','remoteAddress','socket','connection','UserVoiceQueue.penalty','forEach','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','MemberReport','YYYY-MM-DD\x20HH:mm:ss','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','bulkCreate','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','flattenDeep','Voice','getLists','getVoiceQueues','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','CmHopper','firstName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','queues','teams','inbound','getAgents','lower','col','flatten','asc','desc','substring','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','SELECT','select','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','moment','path','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','socket.io-emitter','redis','./user.socket','register','localhost','client','http','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','info','sendStatus','status','end','json','undefined','count','offset','limit','set','update','emit','userNotification:recalc:','get','role','admin','Users','user','agent','telephone','ignore','map','value','name','UserProfileResource','send','index','rawAttributes','fieldName','type','filter','includes','password','where','User','query','includeAll','include','userSetting','true','UserSetting','attributes','findAll','rows','openTabs','length','push','chat','dataValues','sms','fax','mail','whatsapp','catch','show','params','model','differenceBy','keys','salt','intersection','fields','merge','options','find','openchannel','all','body','describe','omit','ids','Setting','validatePasswordPattern','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','mailbox','VoiceMail','email','permissions','102','113','110','104','105','106','108','109','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','UserProfileSection','Agents','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','changePassword','oldPassword','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Sequelize','ValidationError','Wrong\x20credentials','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','passwordHistoryLimit','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues'];(function(_0x4d2252,_0x3f98a0){var _0x784ad7=function(_0xde1aaf){while(--_0xde1aaf){_0x4d2252['push'](_0x4d2252['shift']());}};_0x784ad7(++_0x3f98a0);}(_0x8160,0x100));var _0x0816=function(_0x46bff9,_0x5d3412){_0x46bff9=_0x46bff9-0x0;var _0x2012f2=_0x8160[_0x46bff9];return _0x2012f2;};'use strict';var moment=require(_0x0816('0x0'));var util=require('util');var path=require(_0x0816('0x1'));var fs=require('fs');var _=require(_0x0816('0x2'));var squel=require('squel');var jayson=require(_0x0816('0x3'));var Redis=require(_0x0816('0x4'));var authService=require(_0x0816('0x5'));var qs=require(_0x0816('0x6'));var logger=require(_0x0816('0x7'))(_0x0816('0x8'));var utils=require('../../config/utils');var config=require(_0x0816('0x9'));var licenseUtil=require(_0x0816('0xa'));var APIBadRequestError=require(_0x0816('0xb'))[_0x0816('0xc')];var APINotFoundError=require(_0x0816('0xb'))[_0x0816('0xd')];var APIHandleError=require('../../errors/api')[_0x0816('0xe')];var db=require('../../mysqldb')['db'];var socket=require(_0x0816('0xf'))(new Redis(config[_0x0816('0x10')]));require(_0x0816('0x11'))[_0x0816('0x12')](socket);config[_0x0816('0x10')]=_['defaults'](config[_0x0816('0x10')],{'host':_0x0816('0x13'),'port':0x18eb});var amiClient=jayson[_0x0816('0x14')][_0x0816('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2bb8a9,_0x57be81,_0x492982,_0x24e095){return new Promise(function(_0x410c80,_0x2c47a7){var _0x57eb29=_0x24e095||amiClient;return _0x57eb29['request'](_0x2bb8a9,_0x492982)[_0x0816('0x16')](function(_0x3a8c79){logger['info'](_0x0816('0x17'),_0x57be81,_0x0816('0x18'));logger[_0x0816('0x19')](_0x0816('0x1a'),_0x57be81,'request\x20sent',JSON[_0x0816('0x1b')](_0x3a8c79));if(_0x3a8c79['error']){if(_0x3a8c79[_0x0816('0x1c')]['code']===0x1f4){logger[_0x0816('0x1c')]('User,\x20%s,\x20%s',_0x57be81,_0x3a8c79[_0x0816('0x1c')][_0x0816('0x1d')]);return _0x2c47a7(_0x3a8c79[_0x0816('0x1c')][_0x0816('0x1d')]);}logger[_0x0816('0x1c')]('User,\x20%s,\x20%s',_0x57be81,_0x3a8c79[_0x0816('0x1c')][_0x0816('0x1d')]);return _0x410c80(_0x3a8c79[_0x0816('0x1c')][_0x0816('0x1d')]);}else{logger[_0x0816('0x1e')](_0x0816('0x17'),_0x57be81,'request\x20sent');_0x410c80(_0x3a8c79['result']['message']);}})['catch'](function(_0x5c28e1){logger[_0x0816('0x1c')](_0x0816('0x17'),_0x57be81,_0x5c28e1);_0x2c47a7(_0x5c28e1);});});}function respondWithStatusCode(_0x57dbe6,_0x1a4c36){_0x1a4c36=_0x1a4c36||0xcc;return function(_0x23a990){if(_0x23a990){return _0x57dbe6[_0x0816('0x1f')](_0x1a4c36);}return _0x57dbe6[_0x0816('0x20')](_0x1a4c36)[_0x0816('0x21')]();};}function respondWithResult(_0x9d5736,_0x4d0225){_0x4d0225=_0x4d0225||0xc8;return function(_0x108961){if(_0x108961){return _0x9d5736[_0x0816('0x20')](_0x4d0225)[_0x0816('0x22')](_0x108961);}};}function respondWithFilteredResult(_0x207aca,_0x4f56d7){return function(_0x22e283){if(_0x22e283){var _0x320344=typeof _0x4f56d7['offset']===_0x0816('0x23')&&typeof _0x4f56d7['limit']===_0x0816('0x23');var _0x5268c7=_0x22e283[_0x0816('0x24')];var _0x455aba=_0x320344?0x0:_0x4f56d7[_0x0816('0x25')];var _0x873206=_0x320344?_0x22e283[_0x0816('0x24')]:_0x4f56d7[_0x0816('0x25')]+_0x4f56d7[_0x0816('0x26')];var _0xc20da5;if(_0x873206>=_0x5268c7){_0x873206=_0x5268c7;_0xc20da5=0xc8;}else{_0xc20da5=0xce;}_0x207aca[_0x0816('0x20')](_0xc20da5);return _0x207aca[_0x0816('0x27')]('Content-Range',_0x455aba+'-'+_0x873206+'/'+_0x5268c7)[_0x0816('0x22')](_0x22e283);}return null;};}function saveUpdates(_0x3b10f8){return function(_0x3c8759){if(_0x3c8759){return _0x3c8759[_0x0816('0x28')](_0x3b10f8)[_0x0816('0x16')](function(_0xd64cf5){socket[_0x0816('0x29')](_0x0816('0x2a')+_0xd64cf5['id'],{});return _0xd64cf5;});}return null;};}function removeEntity(_0x5df20c){return function(_0x3cbd04){if(_0x3cbd04){return _0x3cbd04['destroy']()[_0x0816('0x16')](function(){var _0x14419a=_0x3cbd04[_0x0816('0x2b')]({'plain':!![]});if(_0x14419a[_0x0816('0x2c')]===_0x0816('0x2d'))return;var _0x1a271e=[{'name':_0x0816('0x2e'),'value':_0x0816('0x2f'),'ignore':!![]},{'name':'Agents','value':_0x0816('0x30'),'ignore':![]},{'name':'Telephones','value':_0x0816('0x31'),'ignore':![]}];var _0x555b50=_(_0x1a271e)['filter'](_0x0816('0x32'))[_0x0816('0x33')](_0x0816('0x34'))[_0x0816('0x34')]();if(_['includes'](_0x555b50,_0x14419a[_0x0816('0x2c')])){return;}var _0x30c736=_['find'](_0x1a271e,['value',_0x14419a[_0x0816('0x2c')]])[_0x0816('0x35')];return db[_0x0816('0x36')]['destroy']({'where':{'type':_0x30c736,'resourceId':_0x14419a['id']}})[_0x0816('0x16')](function(){return _0x3cbd04;});})[_0x0816('0x16')](function(){_0x5df20c[_0x0816('0x20')](0xcc)[_0x0816('0x21')]();});}};}function handleEntityNotFound(_0x17059f){return function(_0xa65c72){if(!_0xa65c72){_0x17059f[_0x0816('0x1f')](0x194);}return _0xa65c72;};}function handleError(_0x5ca7b7,_0x4de1ab){_0x4de1ab=_0x4de1ab||0x1f4;return function(_0x1dca58){logger[_0x0816('0x1c')](_0x1dca58['stack']);if(_0x1dca58[_0x0816('0x35')]){delete _0x1dca58[_0x0816('0x35')];}_0x5ca7b7[_0x0816('0x20')](_0x4de1ab)[_0x0816('0x37')](_0x1dca58);};}exports[_0x0816('0x38')]=function(_0x8e9a66,_0x130dec){var _0x43035f={},_0x196671={'count':0x0,'rows':[]};var _0x133b50=_(db['User'][_0x0816('0x39')])[_0x0816('0x33')](function(_0x3636b4){return{'name':_0x3636b4[_0x0816('0x3a')],'type':_0x3636b4[_0x0816('0x3b')]['key']};})[_0x0816('0x3c')](function(_0x3579d7){return!_[_0x0816('0x3d')]([_0x0816('0x3e'),'salt'],_0x3579d7[_0x0816('0x35')]);})[_0x0816('0x34')]();_0x43035f=qs['getOptions'](_0x133b50,_0x8e9a66);var _0x53e409={'where':_0x43035f[_0x0816('0x3f')]};return db[_0x0816('0x40')][_0x0816('0x24')](_0x53e409)['then'](function(_0x423228){_0x196671[_0x0816('0x24')]=_0x423228;if(_0x8e9a66[_0x0816('0x41')][_0x0816('0x42')]){_0x43035f[_0x0816('0x43')]=[{'all':!![]}];}if(_0x8e9a66[_0x0816('0x41')][_0x0816('0x44')]===_0x0816('0x45')){_0x43035f[_0x0816('0x43')]=[{'model':db[_0x0816('0x46')],'as':_0x0816('0x44')}];}if(!_[_0x0816('0x3d')](_0x43035f[_0x0816('0x47')],'id')){_0x43035f[_0x0816('0x47')]['push']('id');}return db[_0x0816('0x40')][_0x0816('0x48')](_0x43035f);})[_0x0816('0x16')](function(_0x2b959f){_0x196671[_0x0816('0x49')]=_0x2b959f;if(_0x8e9a66[_0x0816('0x41')][_0x0816('0x4a')]==='true'){var _0x52d545=[];for(var _0x4cf147=0x0;_0x4cf147<_0x196671[_0x0816('0x49')][_0x0816('0x4b')];_0x4cf147++){_0x52d545[_0x0816('0x4c')](get_open_tabs(_0x0816('0x4d'),_0x196671[_0x0816('0x49')][_0x4cf147][_0x0816('0x4e')]));_0x52d545[_0x0816('0x4c')](get_open_tabs(_0x0816('0x4f'),_0x196671[_0x0816('0x49')][_0x4cf147][_0x0816('0x4e')]));_0x52d545[_0x0816('0x4c')](get_open_tabs(_0x0816('0x50'),_0x196671[_0x0816('0x49')][_0x4cf147][_0x0816('0x4e')]));_0x52d545[_0x0816('0x4c')](get_open_tabs(_0x0816('0x51'),_0x196671['rows'][_0x4cf147][_0x0816('0x4e')]));_0x52d545[_0x0816('0x4c')](get_open_tabs('openchannel',_0x196671['rows'][_0x4cf147]['dataValues']));_0x52d545[_0x0816('0x4c')](get_open_tabs(_0x0816('0x52'),_0x196671[_0x0816('0x49')][_0x4cf147][_0x0816('0x4e')]));}return Promise['all'](_0x52d545)['then'](function(){return _0x196671;});}else{return _0x196671;}})[_0x0816('0x16')](respondWithFilteredResult(_0x130dec,_0x43035f))[_0x0816('0x53')](handleError(_0x130dec,null));};exports[_0x0816('0x54')]=function(_0x31a8a8,_0x3721b9){var _0xecf02a={'raw':![],'where':{'id':_0x31a8a8[_0x0816('0x55')]['id']}},_0x2d4f70={};_0x2d4f70[_0x0816('0x56')]=_[_0x0816('0x57')](_[_0x0816('0x58')](db['User'][_0x0816('0x39')]),[_0x0816('0x3e'),_0x0816('0x59')]);_0x2d4f70['query']=_[_0x0816('0x58')](_0x31a8a8[_0x0816('0x41')]);_0x2d4f70['filters']=_[_0x0816('0x5a')](_0x2d4f70[_0x0816('0x56')],_0x2d4f70[_0x0816('0x41')]);_0xecf02a[_0x0816('0x47')]=_['intersection'](_0x2d4f70[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x31a8a8[_0x0816('0x41')]['fields']));_0xecf02a[_0x0816('0x47')]=_0xecf02a[_0x0816('0x47')][_0x0816('0x4b')]?_0xecf02a[_0x0816('0x47')]:_0x2d4f70[_0x0816('0x56')];if(_0x31a8a8[_0x0816('0x41')][_0x0816('0x42')]){_0xecf02a[_0x0816('0x43')]=[{'all':!![]}];}if(_0x31a8a8[_0x0816('0x41')]['userSetting']===_0x0816('0x45')){_0xecf02a[_0x0816('0x43')]=[{'model':db['UserSetting'],'as':_0x0816('0x44')}];}_0xecf02a=_[_0x0816('0x5c')]({},_0xecf02a,_0x31a8a8[_0x0816('0x5d')]);if(!_[_0x0816('0x3d')](_0xecf02a[_0x0816('0x47')],'id')){_0xecf02a['attributes']['push']('id');}return db[_0x0816('0x40')][_0x0816('0x5e')](_0xecf02a)['then'](handleEntityNotFound(_0x3721b9,null))[_0x0816('0x16')](function(_0x6474d6){var _0x1f1a75=[];values=_0x6474d6;if(_0x31a8a8[_0x0816('0x41')][_0x0816('0x4a')]==='true'){_0x1f1a75['push'](get_open_tabs(_0x0816('0x4d'),_0x6474d6[_0x0816('0x4e')]));_0x1f1a75[_0x0816('0x4c')](get_open_tabs(_0x0816('0x4f'),_0x6474d6[_0x0816('0x4e')]));_0x1f1a75[_0x0816('0x4c')](get_open_tabs(_0x0816('0x5f'),_0x6474d6['dataValues']));_0x1f1a75[_0x0816('0x4c')](get_open_tabs('whatsapp',_0x6474d6[_0x0816('0x4e')]));_0x1f1a75[_0x0816('0x4c')](get_open_tabs(_0x0816('0x50'),_0x6474d6['dataValues']));_0x1f1a75[_0x0816('0x4c')](get_open_tabs('mail',_0x6474d6['dataValues']));return Promise[_0x0816('0x60')](_0x1f1a75);}else{return values;}})[_0x0816('0x16')](function(){return values;})[_0x0816('0x16')](respondWithResult(_0x3721b9,null))[_0x0816('0x53')](handleError(_0x3721b9,null));};exports['update']=function(_0x340e81,_0x1fb364){if(_0x340e81[_0x0816('0x61')]['id']){delete _0x340e81[_0x0816('0x61')]['id'];}delete _0x340e81['body']['role'];return db[_0x0816('0x40')]['find']({'where':{'id':_0x340e81['params']['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x1fb364,null))['then'](saveUpdates(_0x340e81['body'],null))[_0x0816('0x16')](respondWithResult(_0x1fb364,null))[_0x0816('0x53')](handleError(_0x1fb364,null));};exports[_0x0816('0x62')]=function(_0x4cf37d,_0x1cc649){return db[_0x0816('0x40')][_0x0816('0x62')]()['then'](respondWithResult(_0x1cc649,null))[_0x0816('0x53')](handleError(_0x1cc649,null));};exports['addContacts']=function(_0xba9ac2,_0x30c2f6){return db['User'][_0x0816('0x5e')]({'where':{'id':_0xba9ac2[_0x0816('0x55')]['id']}})['then'](handleEntityNotFound(_0x30c2f6,null))[_0x0816('0x16')](function(_0x5822ef){if(_0x5822ef){return _0x5822ef['addContacts'](_0xba9ac2[_0x0816('0x61')]['ids'],_[_0x0816('0x63')](_0xba9ac2[_0x0816('0x61')],[_0x0816('0x64'),'id'])||{});}})[_0x0816('0x16')](respondWithResult(_0x30c2f6,null))[_0x0816('0x53')](handleError(_0x30c2f6,null));};function validateUser(_0x32edc6){return new Promise(function(_0x4608c7,_0xec9a11){if(_0x32edc6['internal'])return _0x4608c7(_0x32edc6);return db[_0x0816('0x65')]['findById'](0x1)['then'](function(_0x35cb1c){if(_0x35cb1c['securePassword'])authService[_0x0816('0x66')](_0x32edc6['password']);db['User']['max'](_0x0816('0x67'))['then'](function(_0x2241e1){if(_[_0x0816('0x68')](_0x2241e1)){_0x32edc6[_0x0816('0x67')]=_0x35cb1c['min_internal']||0x1;return;}if(_[_0x0816('0x68')](_0x35cb1c[_0x0816('0x69')])||_0x35cb1c[_0x0816('0x69')]===_0x2241e1){_0x32edc6[_0x0816('0x67')]=_0x2241e1+0x1;return;}if(_0x35cb1c[_0x0816('0x69')]>_0x2241e1){_0x32edc6['internal']=_0x35cb1c['min_internal'];return;}return db[_0x0816('0x6a')]['query'](_0x0816('0x6b'),{'type':db[_0x0816('0x6a')][_0x0816('0x6c')]['SELECT']})['then'](function(_0x3eb10c){if(_0x3eb10c&&_0x3eb10c[_0x0816('0x4b')]){for(var _0x5c2216=0x0,_0x10cbaf=_0x3eb10c[_0x0816('0x4b')];_0x5c2216<_0x10cbaf&&_[_0x0816('0x68')](_0x32edc6[_0x0816('0x67')]);_0x5c2216++){if(_0x35cb1c['min_internal']<=_0x3eb10c[_0x5c2216][_0x0816('0x6d')]){_0x32edc6[_0x0816('0x67')]=_0x3eb10c[_0x5c2216]['from'];}else if(_0x35cb1c[_0x0816('0x69')]>_0x3eb10c[_0x5c2216]['from']&&_0x35cb1c['min_internal']<=_0x3eb10c[_0x5c2216]['to']){_0x32edc6[_0x0816('0x67')]=_0x35cb1c['min_internal'];}}}if(_[_0x0816('0x68')](_0x32edc6[_0x0816('0x67')])){_0x32edc6['internal']=_0x2241e1+0x1;}return _0x4608c7(_0x32edc6);});});})['catch'](function(_0x3fccac){_0xec9a11(_0x3fccac);});});}function updateUser(_0x3f439d){return new Promise(function(_0x54a71a,_0x56a9df){try{if(_0x3f439d['voicemail']){_0x3f439d[_0x0816('0x6e')]=_0x3f439d[_0x0816('0x67')];_0x3f439d[_0x0816('0x6f')]={'mailbox':_0x3f439d[_0x0816('0x67')],'password':_0x3f439d[_0x0816('0x3e')],'fullname':_0x3f439d['fullname'],'email':_0x3f439d[_0x0816('0x70')]};}if(_0x3f439d[_0x0816('0x2c')]===_0x0816('0x30')){if(!_0x3f439d[_0x0816('0x71')])_0x3f439d['permissions']=['101',_0x0816('0x72'),'103',_0x0816('0x73'),_0x0816('0x74'),_0x0816('0x75'),_0x0816('0x76'),_0x0816('0x77'),'107',_0x0816('0x78'),_0x0816('0x79'),_0x0816('0x7a'),_0x0816('0x7b'),_0x0816('0x7c'),'115'];}_0x54a71a(_0x3f439d);}catch(_0x53a5d8){_0x56a9df(_0x53a5d8);}});}exports[_0x0816('0x7d')]=function(_0x53405e,_0x230e44){if(_0x53405e['user'][_0x0816('0x2c')]===_0x0816('0x30'))throw new Error(_0x0816('0x7e'));if(_0x53405e[_0x0816('0x61')][_0x0816('0x2c')]===_0x0816('0x2f')&&_0x53405e[_0x0816('0x2f')]['role']!==_0x0816('0x2d')){throw new Error(_0x0816('0x7f'));}if(_0x53405e[_0x0816('0x61')]['role']===_0x0816('0x2d')&&_0x53405e[_0x0816('0x2f')][_0x0816('0x2c')]!==_0x0816('0x2d')){throw new Error(_0x0816('0x80'));}return licenseUtil[_0x0816('0x81')]([_0x53405e[_0x0816('0x61')]])[_0x0816('0x16')](function(){return validateUser(_0x53405e['body']);})[_0x0816('0x16')](function(_0x48be57){return updateUser(_0x48be57)[_0x0816('0x16')](function(_0x147cf2){if(_0x147cf2[_0x0816('0x2c')]===_0x0816('0x2d')){_0x147cf2[_0x0816('0x82')]=_0x53405e[_0x0816('0x2f')][_0x0816('0x82')];delete _0x147cf2[_0x0816('0x83')];}return _0x147cf2;});})[_0x0816('0x16')](function(_0x57f316){return db[_0x0816('0x40')][_0x0816('0x7d')](_0x57f316,{'include':[{'model':db[_0x0816('0x6f')],'as':_0x0816('0x6f')}]});})[_0x0816('0x16')](function(_0x2dff0a){if(_0x53405e[_0x0816('0x61')][_0x0816('0x2c')]==='user')return _0x2dff0a;if(_0x53405e[_0x0816('0x2f')][_0x0816('0x2c')]!==_0x0816('0x2f'))return _0x2dff0a;return db[_0x0816('0x84')]['find']({'where':{'name':_0x2dff0a[_0x0816('0x2c')]===_0x0816('0x30')?_0x0816('0x85'):_0x0816('0x86'),'userProfileId':_0x53405e[_0x0816('0x2f')][_0x0816('0x83')]},'raw':!![]})[_0x0816('0x16')](function(_0x21039f){if(!_0x21039f||_0x21039f[_0x0816('0x87')]!=0x0)return _0x2dff0a;return db['UserProfileResource'][_0x0816('0x7d')]({'name':_0x2dff0a[_0x0816('0x35')],'resourceId':_0x2dff0a['id'],'type':_0x21039f[_0x0816('0x35')],'sectionId':_0x21039f['id']},{})[_0x0816('0x16')](function(){return _0x2dff0a;});})['catch'](function(_0x170a97){logger[_0x0816('0x1c')](_0x0816('0x88'),_0x170a97);throw _0x170a97;});})[_0x0816('0x16')](respondWithResult(_0x230e44,0xc9))[_0x0816('0x53')](handleError(_0x230e44,null));};exports['bulkCreate']=function(_0x4900a0,_0x58d852){var _0x39afa9=_0x4900a0[_0x0816('0x61')];var _0xf6a8a3=[];if(_0x4900a0[_0x0816('0x2f')][_0x0816('0x2c')]===_0x0816('0x30'))throw new Error(_0x0816('0x7e'));if(_['some'](_0x39afa9,['role',_0x0816('0x2f')])&&_0x4900a0[_0x0816('0x2f')][_0x0816('0x2c')]!=='admin'){throw new Error(_0x0816('0x7f'));}if(_[_0x0816('0x89')](_0x39afa9,['role','admin'])&&_0x4900a0['user'][_0x0816('0x2c')]!==_0x0816('0x2d')){throw new Error(_0x0816('0x8a'));}return licenseUtil[_0x0816('0x81')](_0x39afa9)['then'](function(){return validateUser(_0x39afa9[0x0]);})[_0x0816('0x16')](function(){for(var _0x3524cd=0x1;_0x3524cd<_0x39afa9[_0x0816('0x4b')];_0x3524cd++){var _0x2629f3=_0x39afa9[_0x3524cd-0x1]['internal'];if(!_0x39afa9[_0x3524cd]['internal'])_0x39afa9[_0x3524cd][_0x0816('0x67')]=_0x2629f3+0x1;_0xf6a8a3['push'](validateUser(_0x39afa9[_0x3524cd]));}return Promise[_0x0816('0x60')](_0xf6a8a3);})['then'](function(){_0xf6a8a3=[];for(var _0x2c533b=0x0;_0x2c533b<_0x39afa9[_0x0816('0x4b')];_0x2c533b++){_0xf6a8a3[_0x0816('0x4c')](updateUser(_0x39afa9[_0x2c533b]));}return Promise[_0x0816('0x60')](_0xf6a8a3);})['then'](function(){_0xf6a8a3=_0x39afa9[_0x0816('0x33')](function(_0x4ce561){return db[_0x0816('0x40')][_0x0816('0x7d')](_0x4ce561,{'include':[{'model':db[_0x0816('0x6f')],'as':'VoiceMail'}]})[_0x0816('0x16')](function(_0x5615b5){_0x4ce561['id']=_0x5615b5['id'];return _0x4ce561;});});return Promise[_0x0816('0x60')](_0xf6a8a3);})['then'](function(_0x5c94a0){if(_0x4900a0[_0x0816('0x61')][_0x0816('0x2c')]===_0x0816('0x2f'))return _0x5c94a0;if(_0x4900a0[_0x0816('0x2f')][_0x0816('0x2c')]!=='user')return _0x5c94a0;var _0xf35b2b=_[_0x0816('0x89')](_0x5c94a0,function(_0xc34061){return _0xc34061[_0x0816('0x2c')]==='agent'||_0xc34061[_0x0816('0x2c')]===_0x0816('0x31');});if(!_0xf35b2b)return _0x5c94a0;return db[_0x0816('0x84')]['findAll']({'where':{'name':{'$or':[_0x0816('0x85'),_0x0816('0x86')]},'userProfileId':_0x4900a0['user'][_0x0816('0x83')]},'raw':!![]})['then'](function(_0x5f37eb){if(_[_0x0816('0x8b')](_0x5f37eb)||!_[_0x0816('0x89')](_0x5f37eb,[_0x0816('0x87'),0x0]))return _0x5c94a0;_0xf6a8a3=[];var _0x7b7a72=_(_0x5f37eb)['map'](function(_0xa09219){if(_0xa09219['autoAssociation']===0x1)return;return _0xa09219[_0x0816('0x35')]===_0x0816('0x85')?'agent':'telephone';})[_0x0816('0x8c')]()['value']();for(var _0x5d36a9=0x0;_0x5d36a9<_0x5c94a0[_0x0816('0x4b')];_0x5d36a9++){if(!_[_0x0816('0x3d')](_0x7b7a72,_0x5c94a0[_0x5d36a9][_0x0816('0x2c')]))return;var _0x5bdb93=_0x5c94a0[_0x5d36a9][_0x0816('0x2c')]===_0x0816('0x30')?_0x0816('0x85'):_0x0816('0x86');_0xf6a8a3[_0x0816('0x4c')](db[_0x0816('0x36')]['create']({'name':_0x5c94a0[_0x5d36a9][_0x0816('0x35')],'resourceId':_0x5c94a0[_0x5d36a9]['id'],'type':_0x5bdb93,'sectionId':_[_0x0816('0x5e')](_0x5f37eb,['name',_0x5bdb93])['id']},{}));}return Promise[_0x0816('0x60')](_0xf6a8a3);});})[_0x0816('0x16')](respondWithResult(_0x58d852,0xc9))[_0x0816('0x53')](handleError(_0x58d852,null));};exports[_0x0816('0x8d')]=function(_0x5d5ace,_0x1e94fd){if(_0x5d5ace[_0x0816('0x61')]['id']){delete _0x5d5ace['body']['id'];}return db[_0x0816('0x40')][_0x0816('0x5e')]({'where':{'id':_0x5d5ace['params']['id']}})[_0x0816('0x16')](function(_0x1828d5){if(!_0x1828d5)return null;if(_0x1828d5['id']===_0x5d5ace[_0x0816('0x2f')]['id']){if(!_0x5d5ace[_0x0816('0x61')][_0x0816('0x8e')]||!_0x5d5ace[_0x0816('0x61')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0x0816('0x8f'));}if(!_0x1828d5['authenticate'](_0x5d5ace['body'][_0x0816('0x8e')])){throw new db[(_0x0816('0x90'))][(_0x0816('0x91'))](_0x0816('0x92'));}if(_0x5d5ace['body'][_0x0816('0x8e')]===_0x5d5ace[_0x0816('0x61')][_0x0816('0x93')]){throw new db['Sequelize']['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x5d5ace[_0x0816('0x2f')][_0x0816('0x2c')]==='admin'){if(!_0x5d5ace[_0x0816('0x61')][_0x0816('0x93')]){throw new db[(_0x0816('0x90'))][(_0x0816('0x91'))](_0x0816('0x94'));}}else if(_0x5d5ace[_0x0816('0x2f')][_0x0816('0x2c')]==='user'){if(!_0x5d5ace[_0x0816('0x61')][_0x0816('0x93')]){throw new db[(_0x0816('0x90'))]['ValidationError'](_0x0816('0x94'));}if(_0x1828d5[_0x0816('0x2c')]!==_0x0816('0x30')){throw new db[(_0x0816('0x90'))][(_0x0816('0x91'))]('Unauthorized');}}else{throw new db[(_0x0816('0x90'))][(_0x0816('0x91'))]('Unauthorized');}return _0x1828d5;})[_0x0816('0x16')](handleEntityNotFound(_0x1e94fd,null))['then'](function(_0x365399){return db['Setting']['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0x0816('0x95')]})['then'](function(_0x44ab62){if(_0x44ab62[_0x0816('0x96')])authService[_0x0816('0x66')](_0x5d5ace[_0x0816('0x61')][_0x0816('0x93')]);if(!_0x44ab62[_0x0816('0x97')]||!_0x365399[_0x0816('0x98')])return _0x365399;authService[_0x0816('0x99')](_0x5d5ace[_0x0816('0x61')][_0x0816('0x93')],_0x365399[_0x0816('0x98')],_0x44ab62['passwordHistoryLimit']);return _0x365399;})[_0x0816('0x16')](saveUpdates({'password':_0x5d5ace[_0x0816('0x61')]['newPassword'],'passwordResetAt':_0x5d5ace[_0x0816('0x2f')]['id']==_0x5d5ace[_0x0816('0x55')]['id']?moment():null,'previousPasswords':authService[_0x0816('0x9a')](_0x5d5ace[_0x0816('0x61')][_0x0816('0x93')],_0x365399[_0x0816('0x98')])},null));})[_0x0816('0x16')](respondWithResult(_0x1e94fd,null))[_0x0816('0x53')](handleError(_0x1e94fd,null));};exports[_0x0816('0x9b')]=function(_0x475a0a,_0x4fdbee){var _0x29fe5e=_0x475a0a['body']['channel'];return db[_0x0816('0x40')]['find']({'where':{'id':_0x475a0a[_0x0816('0x55')]['id']},'attributes':['id','name',_0x0816('0x2c'),_0x0816('0x9c'),_0x0816('0x9d'),_0x0816('0x9e'),_0x0816('0x9f')]})[_0x0816('0x16')](handleEntityNotFound(_0x4fdbee,null))[_0x0816('0x16')](function(_0x4e9077){if(_0x4e9077){if(!utils[_0x0816('0xa0')](_0x29fe5e)){throw new db[(_0x0816('0x90'))][(_0x0816('0x91'))](_0x0816('0xa1'));}return _0x4e9077[_0x0816('0xa2')+_[_0x0816('0xa3')](_0x29fe5e[_0x0816('0xa4')]())+_0x0816('0xa5')](_0x475a0a[_0x0816('0x61')][_0x0816('0x64')],{'penalty':_0x475a0a[_0x0816('0x61')][_0x0816('0xa6')]||0x0})['spread'](function(_0x40835c){for(var _0xe2d1d6=0x0;_0xe2d1d6<_0x475a0a[_0x0816('0x61')]['ids'][_0x0816('0x4b')];_0xe2d1d6+=0x1){var _0x42f657={'UserId':Number(_0x475a0a[_0x0816('0x55')]['id'])};_0x42f657[_[_0x0816('0xa3')](_0x29fe5e[_0x0816('0xa4')]())+_0x0816('0xa7')]=Number(_0x475a0a[_0x0816('0x61')][_0x0816('0x64')][_0xe2d1d6]);socket[_0x0816('0x29')]('user'+_[_0x0816('0xa3')](_0x29fe5e[_0x0816('0xa4')]())+_0x0816('0xa8'),_0x42f657);}return _0x40835c;})[_0x0816('0x16')](function(){if(_0x29fe5e===_0x0816('0xa9')){return db[_0x0816('0xaa')]['findAll']({'where':{'id':_0x475a0a[_0x0816('0x61')][_0x0816('0x64')]||[]},'raw':!![],'attributes':['id',_0x0816('0x35')]});}})['then'](function(_0x1e20bb){var _0x8c938e=_0x4e9077[_0x0816('0x2b')]({'plain':!![]});var _0x3722de=[];if(_0x29fe5e===_0x0816('0xa9')&&_0x8c938e[_0x0816('0x2c')]===_0x0816('0x30')&&_0x8c938e[_0x0816('0x9c')]){for(let _0x1ad743=0x0;_0x1ad743<_0x1e20bb[_0x0816('0x4b')];_0x1ad743+=0x1){_0x3722de[_0x0816('0x4c')]({'membername':_0x8c938e['name'],'UserId':_0x8c938e['id'],'queue_name':_0x1e20bb[_0x1ad743][_0x0816('0x35')],'VoiceQueueId':_0x1e20bb[_0x1ad743]['id'],'interface':_[_0x0816('0x68')](_0x8c938e[_0x0816('0x9f')])?util[_0x0816('0xab')](_0x0816('0xac'),_0x8c938e[_0x0816('0x35')]):_0x8c938e[_0x0816('0x9f')],'paused':_0x8c938e[_0x0816('0x9e')]||![],'penalty':_0x475a0a[_0x0816('0x61')][_0x0816('0xa6')]||0x0});}return Promise[_0x0816('0x60')](_0x3722de[_0x0816('0x33')](function(_0x29b0ef){return db[_0x0816('0xad')][_0x0816('0xae')](_0x29b0ef);}));}return _0x4e9077;});}})[_0x0816('0x16')](respondWithStatusCode(_0x4fdbee,null))[_0x0816('0x53')](handleError(_0x4fdbee,null));};exports[_0x0816('0xaf')]=function(_0x40fd3a,_0xd1a113){var _0x498a34,_0x493f01;return db['User'][_0x0816('0x5e')]({'where':{'id':_0x40fd3a[_0x0816('0x55')]['id']},'attributes':['id',_0x0816('0x35'),_0x0816('0x2c')]})['then'](handleEntityNotFound(_0xd1a113,null))['then'](function(_0x3b1b0f){if(_0x3b1b0f){_0x498a34=_0x3b1b0f;if(!_0x40fd3a[_0x0816('0x41')]['channel']||!utils['isValidChannel'](_0x40fd3a[_0x0816('0x41')]['channel'])){throw new db[(_0x0816('0x90'))][(_0x0816('0x91'))](_0x0816('0xa1'));}return _0x3b1b0f[_0x0816('0xb0')+_[_0x0816('0xa3')](_0x40fd3a['query'][_0x0816('0xb1')]['toLowerCase']())+_0x0816('0xa5')](_0x40fd3a[_0x0816('0x41')][_0x0816('0x64')]);}})['then'](function(_0x4d207e){if(_[_0x0816('0xb2')](_0x40fd3a['query'][_0x0816('0x64')])){for(var _0x459797=0x0;_0x459797<_0x40fd3a[_0x0816('0x41')][_0x0816('0x64')]['length'];_0x459797+=0x1){_0x493f01={'UserId':Number(_0x40fd3a['params']['id'])};_0x493f01[_[_0x0816('0xa3')](_0x40fd3a[_0x0816('0x41')][_0x0816('0xb1')]['toLowerCase']())+'QueueId']=Number(_0x40fd3a[_0x0816('0x41')]['ids'][_0x459797]);socket[_0x0816('0x29')](_0x0816('0x2f')+_[_0x0816('0xa3')](_0x40fd3a['query']['channel'][_0x0816('0xa4')]())+_0x0816('0xb3'),_0x493f01);}}else{_0x493f01={'UserId':Number(_0x40fd3a[_0x0816('0x55')]['id'])};_0x493f01[_[_0x0816('0xa3')](_0x40fd3a['query'][_0x0816('0xb1')][_0x0816('0xa4')]())+'QueueId']=Number(_0x40fd3a[_0x0816('0x41')][_0x0816('0x64')]);socket[_0x0816('0x29')](_0x0816('0x2f')+_[_0x0816('0xa3')](_0x40fd3a[_0x0816('0x41')][_0x0816('0xb1')][_0x0816('0xa4')]())+'Queue:remove',_0x493f01);}return _0x4d207e;})[_0x0816('0x16')](function(){if(_0x40fd3a[_0x0816('0x41')][_0x0816('0xb1')]===_0x0816('0xa9')){return db[_0x0816('0xad')][_0x0816('0xb4')]({'where':{'UserId':_0x40fd3a[_0x0816('0x55')]['id'],'VoiceQueueId':_0x40fd3a['query']['ids']},'individualHooks':!![]})['then'](function(){return _0x498a34;});}return _0x498a34;})[_0x0816('0x16')](respondWithStatusCode(_0xd1a113,null))['catch'](handleError(_0xd1a113,null));};exports[_0x0816('0xb5')]=function(_0x2303c1,_0x11b61b){_0x2303c1[_0x0816('0x61')][_0x0816('0xb6')]=_0x2303c1[_0x0816('0xb7')][_0x0816('0xb8')];return db['User']['find']({'where':{'id':_0x2303c1[_0x0816('0x55')]['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x11b61b,null))[_0x0816('0x16')](saveUpdates(_0x2303c1[_0x0816('0x61')],null))[_0x0816('0x16')](respondWithResult(_0x11b61b,null))[_0x0816('0x53')](handleError(_0x11b61b,null));};exports[_0x0816('0xb9')]=function(_0x1b1d5c,_0x371940){var _0x441b88=path[_0x0816('0xba')](config['root'],_0x0816('0xbb'));return db[_0x0816('0x40')][_0x0816('0x5e')]({'where':{'id':_0x1b1d5c['params']['id']},'attributes':['id',_0x0816('0xb6')],'raw':!![]})[_0x0816('0x16')](handleEntityNotFound(_0x371940,null))[_0x0816('0x16')](function(_0x39625b){if(_0x39625b){if(_[_0x0816('0x68')](_0x39625b[_0x0816('0xb6')])){return _0x371940[_0x0816('0xbc')](_0x441b88);}else{if(!fs['existsSync'](path[_0x0816('0xba')](config[_0x0816('0xbd')],_0x0816('0xbe'),_0x39625b[_0x0816('0xb6')]))){return _0x371940['download'](_0x441b88);}return _0x371940[_0x0816('0xbc')](path[_0x0816('0xba')](config['root'],_0x0816('0xbe'),_0x39625b[_0x0816('0xb6')]));}}})[_0x0816('0x53')](handleError(_0x371940,null));};exports[_0x0816('0xbf')]=function(_0xe7898d,_0x23e7e2){return db[_0x0816('0x40')][_0x0816('0x5e')]({'where':{'id':_0xe7898d[_0x0816('0x55')]['id']},'attributes':['id']})[_0x0816('0x16')](handleEntityNotFound(_0x23e7e2,null))[_0x0816('0x16')](function(_0x317e8e){var _0x9f7b45=[];values=_0x317e8e[_0x0816('0x4e')];_0x9f7b45[_0x0816('0x4c')](get_open_tabs('chat',_0x317e8e['dataValues']));_0x9f7b45[_0x0816('0x4c')](get_open_tabs(_0x0816('0x4f'),_0x317e8e[_0x0816('0x4e')]));_0x9f7b45[_0x0816('0x4c')](get_open_tabs(_0x0816('0x5f'),_0x317e8e[_0x0816('0x4e')]));_0x9f7b45[_0x0816('0x4c')](get_open_tabs(_0x0816('0x52'),_0x317e8e['dataValues']));_0x9f7b45[_0x0816('0x4c')](get_open_tabs(_0x0816('0x50'),_0x317e8e[_0x0816('0x4e')]));_0x9f7b45['push'](get_open_tabs('mail',_0x317e8e['dataValues']));return Promise['all'](_0x9f7b45);})[_0x0816('0x16')](function(_0x3e5c8b){if(_0x3e5c8b){var _0x451754=_[_0x0816('0x33')](values['ChatOpenTabs'],function(_0x10ee20){return{'channel':'CHAT','id':_0x10ee20['id'],'createdAt':_0x10ee20[_0x0816('0xc0')]};});var _0xad1e88=_[_0x0816('0x33')](values[_0x0816('0xc1')],function(_0x6d5f8a){return{'channel':_0x0816('0xc2'),'id':_0x6d5f8a['id'],'createdAt':_0x6d5f8a[_0x0816('0xc0')]};});var _0x284026=_[_0x0816('0x33')](values[_0x0816('0xc3')],function(_0x1122fa){return{'channel':_0x0816('0xc4'),'id':_0x1122fa['id'],'createdAt':_0x1122fa[_0x0816('0xc0')]};});var _0x3253ba=_['map'](values[_0x0816('0xc5')],function(_0x52f290){return{'channel':_0x0816('0xc6'),'id':_0x52f290['id'],'createdAt':_0x52f290['createdAt']};});var _0x128310=_[_0x0816('0x33')](values[_0x0816('0xc7')],function(_0x43e3d2){return{'channel':_0x0816('0xc8'),'id':_0x43e3d2['id'],'createdAt':_0x43e3d2[_0x0816('0xc0')]};});var _0x1d80c7=_[_0x0816('0x33')](values[_0x0816('0xc9')],function(_0x25b986){return{'channel':'WHATSAPP','id':_0x25b986['id'],'createdAt':_0x25b986[_0x0816('0xc0')]};});var _0x3e3bb2=_[_0x0816('0xca')](_0x451754,_0xad1e88,_0x284026,_0x3253ba,_0x128310,_0x1d80c7);var _0x3fbdcf={'count':_0x3e3bb2['length'],'rows':_0x3e3bb2};return _0x3fbdcf;}else return null;})[_0x0816('0x16')](respondWithResult(_0x23e7e2,null))[_0x0816('0x53')](handleError(_0x23e7e2,null));};exports[_0x0816('0xcb')]=function(_0x410cd6,_0x4f092b){var _0x4db880={};var _0x412197={};var _0x23d155;var _0x50de5f;return db[_0x0816('0x40')][_0x0816('0xcc')]({'where':{'id':_0x410cd6[_0x0816('0x55')]['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x4f092b,null))['then'](function(_0x1cf81f){if(_0x1cf81f){_0x23d155=_0x1cf81f;_0x412197['model']=_[_0x0816('0x58')](db['CmContact']['rawAttributes']);_0x412197[_0x0816('0x41')]=_[_0x0816('0x58')](_0x410cd6['query']);_0x412197[_0x0816('0xcd')]=_['intersection'](_0x412197[_0x0816('0x56')],_0x412197[_0x0816('0x41')]);_0x4db880[_0x0816('0x47')]=_[_0x0816('0x5a')](_0x412197['model'],qs['fields'](_0x410cd6[_0x0816('0x41')]['fields']));_0x4db880['attributes']=_0x4db880['attributes'][_0x0816('0x4b')]?_0x4db880[_0x0816('0x47')]:_0x412197[_0x0816('0x56')];_0x4db880[_0x0816('0xce')]=qs[_0x0816('0xcf')](_0x410cd6['query'][_0x0816('0xcf')]);_0x4db880[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x410cd6['query'],_0x412197['filters']));if(_0x410cd6['query'][_0x0816('0x3c')]){_0x4db880['where']=_['merge'](_0x4db880['where'],{'$or':_[_0x0816('0x33')](_0x4db880[_0x0816('0x47')],function(_0x9d949){var _0x3ff035={};_0x3ff035[_0x9d949]={'$like':'%'+_0x410cd6[_0x0816('0x41')][_0x0816('0x3c')]+'%'};return _0x3ff035;})});}_0x4db880=_[_0x0816('0x5c')]({},_0x4db880,_0x410cd6[_0x0816('0x5d')]);return _0x23d155['getContacts'](_0x4db880);}})['then'](function(_0x3448ae){if(_0x3448ae){_0x50de5f=_0x3448ae[_0x0816('0x4b')];if(_0x410cd6[_0x0816('0x41')][_0x0816('0xd1')](_0x0816('0x42'))){_0x4db880[_0x0816('0x43')]=[{'model':db[_0x0816('0xd2')],'as':_0x0816('0xd3'),'required':![]},{'model':db[_0x0816('0xd4')],'as':_0x0816('0xd5'),'attributes':['id',_0x0816('0x35'),_0x0816('0xd6')],'where':_0x410cd6[_0x0816('0x41')]['tag']?{'id':_0x410cd6['query'][_0x0816('0xd7')]}:undefined,'required':_0x410cd6[_0x0816('0x41')][_0x0816('0xd7')]?!![]:![]}];}if(!_0x410cd6[_0x0816('0x41')]['hasOwnProperty'](_0x0816('0xd8'))){_0x4db880[_0x0816('0x26')]=qs[_0x0816('0x26')](_0x410cd6['query'][_0x0816('0x26')]);_0x4db880['offset']=qs[_0x0816('0x25')](_0x410cd6[_0x0816('0x41')]['offset']);}return _0x23d155[_0x0816('0xcb')](_0x4db880);}})['then'](function(_0x1af1e6){if(_0x1af1e6){return _0x1af1e6?{'count':_0x50de5f,'rows':_0x1af1e6}:null;}})['then'](respondWithResult(_0x4f092b,null))[_0x0816('0x53')](handleError(_0x4f092b,null));};exports[_0x0816('0xd9')]=function(_0x242889,_0x55deaa){var _0x84bd00;var _0x27616e={};var _0x3f7877;return db[_0x0816('0x40')]['findOne']({'where':{'id':_0x242889['params']['id']},'attributes':['id',_0x0816('0x35'),_0x0816('0x2c')]})[_0x0816('0x16')](handleEntityNotFound(_0x55deaa,null))[_0x0816('0x16')](function(_0x5e3164){if(!utils[_0x0816('0xa0')](_0x242889[_0x0816('0x41')][_0x0816('0xb1')])){throw new db['Sequelize'][(_0x0816('0x91'))]('Unknown\x20channel');}_0x84bd00=_0x5e3164;var _0x5dda4b={};_0x5dda4b[_0x0816('0x56')]=_[_0x0816('0x58')](db[_[_0x0816('0xa3')](_0x242889[_0x0816('0x41')][_0x0816('0xb1')])+_0x0816('0xda')][_0x0816('0x39')]);_0x5dda4b[_0x0816('0x41')]=_[_0x0816('0x58')](_0x242889[_0x0816('0x41')]);_0x5dda4b['filters']=_[_0x0816('0x5a')](_0x5dda4b[_0x0816('0x56')],_0x5dda4b[_0x0816('0x41')]);_0x27616e[_0x0816('0x47')]=_['intersection'](_0x5dda4b[_0x0816('0x56')],qs['fields'](_0x242889[_0x0816('0x41')]['fields']));_0x27616e[_0x0816('0x47')]=_0x27616e[_0x0816('0x47')][_0x0816('0x4b')]?_0x27616e[_0x0816('0x47')]:_0x5dda4b['model'];_0x27616e[_0x0816('0xce')]=qs[_0x0816('0xcf')](_0x242889[_0x0816('0x41')][_0x0816('0xcf')]);_0x27616e[_0x0816('0x3f')]=qs['filters'](_['pick'](_0x242889[_0x0816('0x41')],_0x5dda4b[_0x0816('0xcd')]));if(_0x242889[_0x0816('0x41')][_0x0816('0x3c')]){_0x27616e[_0x0816('0x3f')]=_['merge'](_0x27616e['where'],{'$or':_[_0x0816('0x33')](_0x27616e[_0x0816('0x47')],function(_0x4a0989){var _0xe7118e={};_0xe7118e[_0x4a0989]={'$like':'%'+_0x242889[_0x0816('0x41')][_0x0816('0x3c')]+'%'};return _0xe7118e;})});}_0x27616e=_[_0x0816('0x5c')]({},_0x27616e,_0x242889['options']);switch(_0x84bd00[_0x0816('0x2c')]){case _0x0816('0x2d'):return db[_[_0x0816('0xa3')](_0x242889['query'][_0x0816('0xb1')])+_0x0816('0xda')][_0x0816('0x48')](_0x27616e);case'user':case'agent':return _0x84bd00[_0x0816('0x2b')+_[_0x0816('0xa3')](_0x242889[_0x0816('0x41')][_0x0816('0xb1')])+_0x0816('0xa5')](_0x27616e);default:throw new db[(_0x0816('0x90'))][(_0x0816('0x91'))](_0x0816('0xdb'));}})[_0x0816('0x16')](function(_0x136ad9){_0x3f7877=_0x136ad9[_0x0816('0x4b')];if(!_0x242889[_0x0816('0x41')]['hasOwnProperty'](_0x0816('0xd8'))){_0x27616e[_0x0816('0x26')]=qs[_0x0816('0x26')](_0x242889[_0x0816('0x41')][_0x0816('0x26')]);_0x27616e[_0x0816('0x25')]=qs['offset'](_0x242889[_0x0816('0x41')][_0x0816('0x25')]);}switch(_0x84bd00[_0x0816('0x2c')]){case _0x0816('0x2d'):return db[_[_0x0816('0xa3')](_0x242889[_0x0816('0x41')][_0x0816('0xb1')])+'Queue'][_0x0816('0x48')](_0x27616e);case _0x0816('0x2f'):case _0x0816('0x30'):return _0x84bd00[_0x0816('0x2b')+_[_0x0816('0xa3')](_0x242889[_0x0816('0x41')]['channel'])+_0x0816('0xa5')](_0x27616e);}})[_0x0816('0x16')](function(_0x3204d3){return{'count':_0x3f7877,'rows':_0x3204d3};})[_0x0816('0x16')](respondWithResult(_0x55deaa,null))[_0x0816('0x53')](handleError(_0x55deaa,null));};exports[_0x0816('0xdc')]=function(_0x16aa73,_0x50cf5e){var _0x5b0d01={};var _0x52c3f6={};var _0x3171f3;var _0x37070a;return db[_0x0816('0x40')]['findOne']({'where':{'id':_0x16aa73[_0x0816('0x55')]['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x50cf5e,null))[_0x0816('0x16')](function(_0x2eb1a8){if(_0x2eb1a8){_0x3171f3=_0x2eb1a8;_0x52c3f6[_0x0816('0x56')]=_[_0x0816('0x58')](db[_0x0816('0xad')]['rawAttributes']);_0x52c3f6[_0x0816('0x41')]=_[_0x0816('0x58')](_0x16aa73[_0x0816('0x41')]);_0x52c3f6[_0x0816('0xcd')]=_[_0x0816('0x5a')](_0x52c3f6[_0x0816('0x56')],_0x52c3f6[_0x0816('0x41')]);_0x5b0d01['attributes']=_['intersection'](_0x52c3f6[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x16aa73['query'][_0x0816('0x5b')]));_0x5b0d01[_0x0816('0x47')]=_0x5b0d01['attributes'][_0x0816('0x4b')]?_0x5b0d01[_0x0816('0x47')]:_0x52c3f6[_0x0816('0x56')];_0x5b0d01[_0x0816('0xce')]=qs[_0x0816('0xcf')](_0x16aa73['query'][_0x0816('0xcf')]);_0x5b0d01['where']=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x16aa73['query'],_0x52c3f6[_0x0816('0xcd')]));if(_0x16aa73[_0x0816('0x41')][_0x0816('0x3c')]){_0x5b0d01[_0x0816('0x3f')]=_[_0x0816('0x5c')](_0x5b0d01[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x5b0d01['attributes'],function(_0x80f67f){var _0x1684bc={};_0x1684bc[_0x80f67f]={'$like':'%'+_0x16aa73[_0x0816('0x41')]['filter']+'%'};return _0x1684bc;})});}_0x5b0d01=_[_0x0816('0x5c')]({},_0x5b0d01,_0x16aa73[_0x0816('0x5d')]);return _0x3171f3['getVoiceQueuesRt'](_0x5b0d01);}})['then'](function(_0x1f484f){if(_0x1f484f){_0x37070a=_0x1f484f[_0x0816('0x4b')];if(!_0x16aa73[_0x0816('0x41')][_0x0816('0xd1')](_0x0816('0xd8'))){_0x5b0d01['limit']=qs['limit'](_0x16aa73[_0x0816('0x41')][_0x0816('0x26')]);_0x5b0d01[_0x0816('0x25')]=qs[_0x0816('0x25')](_0x16aa73[_0x0816('0x41')]['offset']);}return _0x3171f3[_0x0816('0xdc')](_0x5b0d01);}})['then'](function(_0x518c25){if(_0x518c25){return _0x518c25?{'count':_0x37070a,'rows':_0x518c25}:null;}})[_0x0816('0x16')](respondWithResult(_0x50cf5e,null))[_0x0816('0x53')](handleError(_0x50cf5e,null));};exports[_0x0816('0xdd')]=function(_0x49b2d6,_0x2a901e){var _0x1f294f={};var _0x47993a={};var _0x1a6ef6;var _0x1ec293;return db[_0x0816('0x40')][_0x0816('0xcc')]({'where':{'id':_0x49b2d6['params']['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x2a901e,null))[_0x0816('0x16')](function(_0x5afd55){if(_0x5afd55){_0x1a6ef6=_0x5afd55;_0x47993a[_0x0816('0x56')]=_[_0x0816('0x58')](db[_0x0816('0xde')][_0x0816('0x39')]);_0x47993a[_0x0816('0x41')]=_['keys'](_0x49b2d6[_0x0816('0x41')]);_0x47993a[_0x0816('0xcd')]=_['intersection'](_0x47993a[_0x0816('0x56')],_0x47993a[_0x0816('0x41')]);_0x1f294f[_0x0816('0x47')]=_[_0x0816('0x5a')](_0x47993a['model'],qs['fields'](_0x49b2d6[_0x0816('0x41')][_0x0816('0x5b')]));_0x1f294f[_0x0816('0x47')]=_0x1f294f[_0x0816('0x47')]['length']?_0x1f294f[_0x0816('0x47')]:_0x47993a['model'];_0x1f294f[_0x0816('0xce')]=qs[_0x0816('0xcf')](_0x49b2d6[_0x0816('0x41')][_0x0816('0xcf')]);_0x1f294f[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_['pick'](_0x49b2d6[_0x0816('0x41')],_0x47993a[_0x0816('0xcd')]));if(_0x49b2d6[_0x0816('0x41')][_0x0816('0x3c')]){_0x1f294f['where']=_[_0x0816('0x5c')](_0x1f294f['where'],{'$or':_[_0x0816('0x33')](_0x1f294f['attributes'],function(_0x59898a){var _0x5ce2c7={};_0x5ce2c7[_0x59898a]={'$like':'%'+_0x49b2d6['query'][_0x0816('0x3c')]+'%'};return _0x5ce2c7;})});}_0x1f294f=_[_0x0816('0x5c')]({},_0x1f294f,_0x49b2d6[_0x0816('0x5d')]);return _0x1a6ef6['getGroups'](_0x1f294f);}})[_0x0816('0x16')](function(_0x5b4d1a){if(_0x5b4d1a){_0x1ec293=_0x5b4d1a[_0x0816('0x4b')];if(!_0x49b2d6['query']['hasOwnProperty'](_0x0816('0xd8'))){_0x1f294f[_0x0816('0x26')]=qs[_0x0816('0x26')](_0x49b2d6[_0x0816('0x41')]['limit']);_0x1f294f[_0x0816('0x25')]=qs['offset'](_0x49b2d6[_0x0816('0x41')]['offset']);}return _0x1a6ef6[_0x0816('0xdd')](_0x1f294f);}})['then'](function(_0x392d9d){if(_0x392d9d){return _0x392d9d?{'count':_0x1ec293,'rows':_0x392d9d}:null;}})[_0x0816('0x16')](respondWithResult(_0x2a901e,null))[_0x0816('0x53')](handleError(_0x2a901e,null));};exports[_0x0816('0xdf')]=function(_0x224ba6,_0x551332){var _0x4b9506={'raw':!![],'where':{}};var _0x2f916e={};var _0x4de134={'count':0x0,'rows':[]};return db[_0x0816('0x40')][_0x0816('0xcc')]({'where':{'id':_0x224ba6['params']['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x551332,null))[_0x0816('0x16')](function(_0xb595a6){if(_0xb595a6){_0x2f916e[_0x0816('0x56')]=_[_0x0816('0x58')](db[_0x0816('0xe0')][_0x0816('0x39')]);_0x2f916e[_0x0816('0x41')]=_['keys'](_0x224ba6[_0x0816('0x41')]);_0x2f916e[_0x0816('0xcd')]=_[_0x0816('0x5a')](_0x2f916e[_0x0816('0x56')],_0x2f916e[_0x0816('0x41')]);_0x4b9506[_0x0816('0x47')]=_[_0x0816('0x5a')](_0x2f916e[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x224ba6[_0x0816('0x41')][_0x0816('0x5b')]));_0x4b9506['attributes']=_0x4b9506[_0x0816('0x47')][_0x0816('0x4b')]?_0x4b9506['attributes']:_0x2f916e[_0x0816('0x56')];if(!_0x224ba6[_0x0816('0x41')]['hasOwnProperty'](_0x0816('0xd8'))){_0x4b9506[_0x0816('0x26')]=qs[_0x0816('0x26')](_0x224ba6[_0x0816('0x41')][_0x0816('0x26')]);_0x4b9506[_0x0816('0x25')]=qs[_0x0816('0x25')](_0x224ba6[_0x0816('0x41')]['offset']);}_0x4b9506[_0x0816('0xce')]=qs[_0x0816('0xcf')](_0x224ba6['query'][_0x0816('0xcf')]);_0x4b9506[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x224ba6[_0x0816('0x41')],_0x2f916e[_0x0816('0xcd')]));_0x4b9506[_0x0816('0x3f')]['UserId']=_0xb595a6['id'];if(_0x224ba6[_0x0816('0x41')][_0x0816('0x3c')]){_0x4b9506[_0x0816('0x3f')]=_[_0x0816('0x5c')](_0x4b9506[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x4b9506[_0x0816('0x47')],function(_0x1876de){var _0x5ebdcd={};_0x5ebdcd[_0x1876de]={'$like':'%'+_0x224ba6[_0x0816('0x41')][_0x0816('0x3c')]+'%'};return _0x5ebdcd;})});}_0x4b9506=_[_0x0816('0x5c')]({},_0x4b9506,_0x224ba6[_0x0816('0x5d')]);return db['VoiceRecording'][_0x0816('0x24')]({'where':_0x4b9506[_0x0816('0x3f')]})[_0x0816('0x16')](function(_0x2cad60){_0x4de134['count']=_0x2cad60;if(_0x224ba6['query'][_0x0816('0x42')]){_0x4b9506['include']=[{'all':!![]}];}return db[_0x0816('0xe0')][_0x0816('0x48')](_0x4b9506);})[_0x0816('0x16')](function(_0x4213ab){_0x4de134[_0x0816('0x49')]=_0x4213ab;return _0x4de134;});}})[_0x0816('0x16')](respondWithFilteredResult(_0x551332,_0x4b9506))[_0x0816('0x53')](handleError(_0x551332,null));};exports[_0x0816('0xe1')]=function(_0x10ce7c,_0x41da59){var _0x47641c={'raw':!![],'where':{}};var _0x4caa30={};var _0x5bdd5e={'count':0x0,'rows':[]};return db[_0x0816('0x40')][_0x0816('0xcc')]({'where':{'id':_0x10ce7c[_0x0816('0x55')]['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x41da59,null))[_0x0816('0x16')](function(_0x5bca45){if(_0x5bca45){_0x4caa30[_0x0816('0x56')]=_[_0x0816('0x58')](db['ScreenRecording'][_0x0816('0x39')]);_0x4caa30[_0x0816('0x41')]=_[_0x0816('0x58')](_0x10ce7c[_0x0816('0x41')]);_0x4caa30[_0x0816('0xcd')]=_['intersection'](_0x4caa30[_0x0816('0x56')],_0x4caa30[_0x0816('0x41')]);_0x47641c[_0x0816('0x47')]=_['intersection'](_0x4caa30[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x10ce7c['query']['fields']));_0x47641c['attributes']=_0x47641c[_0x0816('0x47')][_0x0816('0x4b')]?_0x47641c['attributes']:_0x4caa30[_0x0816('0x56')];if(!_0x10ce7c[_0x0816('0x41')]['hasOwnProperty']('nolimit')){_0x47641c[_0x0816('0x26')]=qs['limit'](_0x10ce7c[_0x0816('0x41')][_0x0816('0x26')]);_0x47641c['offset']=qs[_0x0816('0x25')](_0x10ce7c['query'][_0x0816('0x25')]);}_0x47641c['order']=qs[_0x0816('0xcf')](_0x10ce7c['query']['sort']);_0x47641c[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x10ce7c[_0x0816('0x41')],_0x4caa30['filters']));_0x47641c[_0x0816('0x3f')][_0x0816('0xe2')]=_0x5bca45['id'];if(_0x10ce7c[_0x0816('0x41')]['filter']){_0x47641c[_0x0816('0x3f')]=_[_0x0816('0x5c')](_0x47641c[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x47641c[_0x0816('0x47')],function(_0x29fd06){var _0x496b52={};_0x496b52[_0x29fd06]={'$like':'%'+_0x10ce7c[_0x0816('0x41')]['filter']+'%'};return _0x496b52;})});}_0x47641c=_[_0x0816('0x5c')]({},_0x47641c,_0x10ce7c['options']);return db['ScreenRecording'][_0x0816('0x24')]({'where':_0x47641c[_0x0816('0x3f')]})['then'](function(_0x43dc3e){_0x5bdd5e['count']=_0x43dc3e;if(_0x10ce7c[_0x0816('0x41')]['includeAll']){_0x47641c[_0x0816('0x43')]=[{'all':!![]}];}return db[_0x0816('0xe3')]['findAll'](_0x47641c);})['then'](function(_0xadd0dc){_0x5bdd5e[_0x0816('0x49')]=_0xadd0dc;return _0x5bdd5e;});}})[_0x0816('0x16')](respondWithFilteredResult(_0x41da59,_0x47641c))[_0x0816('0x53')](handleError(_0x41da59,null));};exports[_0x0816('0xe4')]=function(_0x1efe34,_0x1b332e){var _0x474cac={};var _0x59dc9f={};var _0x50d65b;var _0x5f1ccf;return db[_0x0816('0x40')]['findOne']({'where':{'id':_0x1efe34[_0x0816('0x55')]['id']}})['then'](handleEntityNotFound(_0x1b332e,null))[_0x0816('0x16')](function(_0x3be776){if(_0x3be776){_0x50d65b=_0x3be776;_0x59dc9f[_0x0816('0x56')]=_['keys'](db[_0x0816('0xe5')][_0x0816('0x39')]);_0x59dc9f[_0x0816('0x41')]=_[_0x0816('0x58')](_0x1efe34[_0x0816('0x41')]);_0x59dc9f['filters']=_['intersection'](_0x59dc9f['model'],_0x59dc9f['query']);_0x474cac['attributes']=_[_0x0816('0x5a')](_0x59dc9f[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x1efe34['query'][_0x0816('0x5b')]));_0x474cac[_0x0816('0x47')]=_0x474cac['attributes'][_0x0816('0x4b')]?_0x474cac[_0x0816('0x47')]:_0x59dc9f[_0x0816('0x56')];_0x474cac['order']=qs[_0x0816('0xcf')](_0x1efe34[_0x0816('0x41')]['sort']);_0x474cac[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x1efe34[_0x0816('0x41')],_0x59dc9f['filters']));if(_0x1efe34[_0x0816('0x41')][_0x0816('0x3c')]){_0x474cac['where']=_['merge'](_0x474cac[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x474cac[_0x0816('0x47')],function(_0x2be23a){var _0x5c5b88={};_0x5c5b88[_0x2be23a]={'$like':'%'+_0x1efe34[_0x0816('0x41')][_0x0816('0x3c')]+'%'};return _0x5c5b88;})});}_0x474cac=_['merge']({},_0x474cac,_0x1efe34[_0x0816('0x5d')]);return _0x50d65b[_0x0816('0xe4')](_0x474cac);}})['then'](function(_0x172afd){if(_0x172afd){_0x5f1ccf=_0x172afd[_0x0816('0x4b')];if(!_0x1efe34[_0x0816('0x41')][_0x0816('0xd1')](_0x0816('0xd8'))){_0x474cac['limit']=qs[_0x0816('0x26')](_0x1efe34[_0x0816('0x41')][_0x0816('0x26')]);_0x474cac[_0x0816('0x25')]=qs['offset'](_0x1efe34[_0x0816('0x41')][_0x0816('0x25')]);}return _0x50d65b[_0x0816('0xe4')](_0x474cac);}})[_0x0816('0x16')](function(_0x38d5eb){if(_0x38d5eb){return _0x38d5eb?{'count':_0x5f1ccf,'rows':_0x38d5eb}:null;}})[_0x0816('0x16')](respondWithResult(_0x1b332e,null))[_0x0816('0x53')](handleError(_0x1b332e,null));};exports[_0x0816('0xe6')]=function(_0x1425a1,_0x3d6d47){var _0x5a061a={};var _0x17ebc3={};var _0x1a980f;var _0x2a8409;return db['User'][_0x0816('0xcc')]({'where':{'id':_0x1425a1[_0x0816('0x55')]['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x3d6d47,null))['then'](function(_0x38fcb2){if(_0x38fcb2){_0x1a980f=_0x38fcb2;_0x17ebc3['model']=_[_0x0816('0x58')](db['OpenchannelInteraction'][_0x0816('0x39')]);_0x17ebc3[_0x0816('0x41')]=_['keys'](_0x1425a1[_0x0816('0x41')]);_0x17ebc3[_0x0816('0xcd')]=_[_0x0816('0x5a')](_0x17ebc3[_0x0816('0x56')],_0x17ebc3['query']);_0x5a061a['attributes']=_[_0x0816('0x5a')](_0x17ebc3['model'],qs[_0x0816('0x5b')](_0x1425a1[_0x0816('0x41')][_0x0816('0x5b')]));_0x5a061a[_0x0816('0x47')]=_0x5a061a[_0x0816('0x47')][_0x0816('0x4b')]?_0x5a061a['attributes']:_0x17ebc3[_0x0816('0x56')];_0x5a061a[_0x0816('0xce')]=qs['sort'](_0x1425a1['query'][_0x0816('0xcf')]);_0x5a061a[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x1425a1[_0x0816('0x41')],_0x17ebc3[_0x0816('0xcd')]));if(_0x1425a1['query'][_0x0816('0x3c')]){_0x5a061a['where']=_[_0x0816('0x5c')](_0x5a061a[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x5a061a[_0x0816('0x47')],function(_0x2ab277){var _0x7d4955={};_0x7d4955[_0x2ab277]={'$like':'%'+_0x1425a1['query']['filter']+'%'};return _0x7d4955;})});}_0x5a061a=_[_0x0816('0x5c')]({},_0x5a061a,_0x1425a1[_0x0816('0x5d')]);return _0x1a980f[_0x0816('0xe6')](_0x5a061a);}})[_0x0816('0x16')](function(_0x36a4ec){if(_0x36a4ec){_0x2a8409=_0x36a4ec['length'];if(!_0x1425a1[_0x0816('0x41')]['hasOwnProperty'](_0x0816('0xd8'))){_0x5a061a[_0x0816('0x26')]=qs['limit'](_0x1425a1[_0x0816('0x41')]['limit']);_0x5a061a[_0x0816('0x25')]=qs[_0x0816('0x25')](_0x1425a1[_0x0816('0x41')][_0x0816('0x25')]);}return _0x1a980f[_0x0816('0xe6')](_0x5a061a);}})[_0x0816('0x16')](function(_0x13a68c){if(_0x13a68c){return _0x13a68c?{'count':_0x2a8409,'rows':_0x13a68c}:null;}})['then'](respondWithResult(_0x3d6d47,null))[_0x0816('0x53')](handleError(_0x3d6d47,null));};exports[_0x0816('0xe7')]=function(_0x701d85,_0x24dada){var _0x8ccdf7={'raw':!![],'where':{}};var _0x1fd660={};var _0x3be746={'count':0x0,'rows':[]};return db[_0x0816('0x40')][_0x0816('0xcc')]({'where':{'id':_0x701d85[_0x0816('0x55')]['id']}})['then'](handleEntityNotFound(_0x24dada,null))[_0x0816('0x16')](function(_0x316a7f){if(_0x316a7f){_0x1fd660[_0x0816('0x56')]=_['keys'](db['MailInteraction'][_0x0816('0x39')]);_0x1fd660['query']=_[_0x0816('0x58')](_0x701d85[_0x0816('0x41')]);_0x1fd660[_0x0816('0xcd')]=_['intersection'](_0x1fd660['model'],_0x1fd660[_0x0816('0x41')]);_0x8ccdf7[_0x0816('0x47')]=_['intersection'](_0x1fd660[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x701d85['query']['fields']));_0x8ccdf7[_0x0816('0x47')]=_0x8ccdf7[_0x0816('0x47')]['length']?_0x8ccdf7[_0x0816('0x47')]:_0x1fd660[_0x0816('0x56')];if(!_0x701d85[_0x0816('0x41')][_0x0816('0xd1')](_0x0816('0xd8'))){_0x8ccdf7[_0x0816('0x26')]=qs[_0x0816('0x26')](_0x701d85[_0x0816('0x41')]['limit']);_0x8ccdf7[_0x0816('0x25')]=qs['offset'](_0x701d85['query'][_0x0816('0x25')]);}_0x8ccdf7['order']=qs[_0x0816('0xcf')](_0x701d85[_0x0816('0x41')][_0x0816('0xcf')]);_0x8ccdf7[_0x0816('0x3f')]=qs['filters'](_[_0x0816('0xd0')](_0x701d85[_0x0816('0x41')],_0x1fd660['filters']));_0x8ccdf7['where'][_0x0816('0xe2')]=_0x316a7f['id'];if(_0x701d85['query'][_0x0816('0x3c')]){_0x8ccdf7[_0x0816('0x3f')]=_['merge'](_0x8ccdf7[_0x0816('0x3f')],{'$or':_['map'](_0x8ccdf7[_0x0816('0x47')],function(_0x3224e9){var _0xc34bef={};_0xc34bef[_0x3224e9]={'$like':'%'+_0x701d85[_0x0816('0x41')]['filter']+'%'};return _0xc34bef;})});}_0x8ccdf7=_[_0x0816('0x5c')]({},_0x8ccdf7,_0x701d85[_0x0816('0x5d')]);return db[_0x0816('0xe8')][_0x0816('0x24')]({'where':_0x8ccdf7['where']})[_0x0816('0x16')](function(_0x353c58){_0x3be746['count']=_0x353c58;if(_0x701d85['query']['includeAll']){_0x8ccdf7['include']=[{'all':!![]}];}return db[_0x0816('0xe8')][_0x0816('0x48')](_0x8ccdf7);})[_0x0816('0x16')](function(_0x38d57e){_0x3be746[_0x0816('0x49')]=_0x38d57e;return _0x3be746;});}})[_0x0816('0x16')](respondWithFilteredResult(_0x24dada,_0x8ccdf7))[_0x0816('0x53')](handleError(_0x24dada,null));};exports[_0x0816('0xe9')]=function(_0xa08043,_0x318b20){var _0x17972f={};var _0x47761b={};var _0x2af023;var _0x1ba6bb;return db[_0x0816('0x40')][_0x0816('0xcc')]({'where':{'id':_0xa08043[_0x0816('0x55')]['id']}})['then'](handleEntityNotFound(_0x318b20,null))[_0x0816('0x16')](function(_0x332fb1){if(_0x332fb1){_0x2af023=_0x332fb1;_0x47761b[_0x0816('0x56')]=_[_0x0816('0x58')](db['SmsInteraction'][_0x0816('0x39')]);_0x47761b['query']=_[_0x0816('0x58')](_0xa08043[_0x0816('0x41')]);_0x47761b[_0x0816('0xcd')]=_[_0x0816('0x5a')](_0x47761b[_0x0816('0x56')],_0x47761b[_0x0816('0x41')]);_0x17972f[_0x0816('0x47')]=_[_0x0816('0x5a')](_0x47761b['model'],qs[_0x0816('0x5b')](_0xa08043[_0x0816('0x41')][_0x0816('0x5b')]));_0x17972f[_0x0816('0x47')]=_0x17972f['attributes'][_0x0816('0x4b')]?_0x17972f['attributes']:_0x47761b[_0x0816('0x56')];_0x17972f['order']=qs[_0x0816('0xcf')](_0xa08043[_0x0816('0x41')][_0x0816('0xcf')]);_0x17972f[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0xa08043['query'],_0x47761b[_0x0816('0xcd')]));if(_0xa08043['query'][_0x0816('0x3c')]){_0x17972f[_0x0816('0x3f')]=_[_0x0816('0x5c')](_0x17972f[_0x0816('0x3f')],{'$or':_['map'](_0x17972f['attributes'],function(_0x3120a0){var _0x4f8cc7={};_0x4f8cc7[_0x3120a0]={'$like':'%'+_0xa08043['query'][_0x0816('0x3c')]+'%'};return _0x4f8cc7;})});}_0x17972f=_[_0x0816('0x5c')]({},_0x17972f,_0xa08043['options']);return _0x2af023[_0x0816('0xe9')](_0x17972f);}})['then'](function(_0x27d828){if(_0x27d828){_0x1ba6bb=_0x27d828[_0x0816('0x4b')];if(!_0xa08043[_0x0816('0x41')][_0x0816('0xd1')](_0x0816('0xd8'))){_0x17972f[_0x0816('0x26')]=qs[_0x0816('0x26')](_0xa08043['query'][_0x0816('0x26')]);_0x17972f[_0x0816('0x25')]=qs['offset'](_0xa08043['query'][_0x0816('0x25')]);}return _0x2af023['getSmsInteractions'](_0x17972f);}})['then'](function(_0x5b8560){if(_0x5b8560){return _0x5b8560?{'count':_0x1ba6bb,'rows':_0x5b8560}:null;}})[_0x0816('0x16')](respondWithResult(_0x318b20,null))[_0x0816('0x53')](handleError(_0x318b20,null));};exports[_0x0816('0xea')]=function(_0x249711,_0x4b156c){var _0x2bf303={};var _0x38debb={};var _0x2a7389;var _0x2b6dcc;return db[_0x0816('0x40')]['findOne']({'where':{'id':_0x249711['params']['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x4b156c,null))[_0x0816('0x16')](function(_0x2e1c4a){if(_0x2e1c4a){_0x2a7389=_0x2e1c4a;_0x38debb['model']=_[_0x0816('0x58')](db['FaxInteraction']['rawAttributes']);_0x38debb[_0x0816('0x41')]=_[_0x0816('0x58')](_0x249711[_0x0816('0x41')]);_0x38debb[_0x0816('0xcd')]=_[_0x0816('0x5a')](_0x38debb['model'],_0x38debb[_0x0816('0x41')]);_0x2bf303[_0x0816('0x47')]=_[_0x0816('0x5a')](_0x38debb[_0x0816('0x56')],qs['fields'](_0x249711['query'][_0x0816('0x5b')]));_0x2bf303['attributes']=_0x2bf303[_0x0816('0x47')][_0x0816('0x4b')]?_0x2bf303[_0x0816('0x47')]:_0x38debb[_0x0816('0x56')];_0x2bf303[_0x0816('0xce')]=qs['sort'](_0x249711['query']['sort']);_0x2bf303[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x249711[_0x0816('0x41')],_0x38debb[_0x0816('0xcd')]));if(_0x249711[_0x0816('0x41')][_0x0816('0x3c')]){_0x2bf303['where']=_[_0x0816('0x5c')](_0x2bf303[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x2bf303['attributes'],function(_0x3aec70){var _0x49c670={};_0x49c670[_0x3aec70]={'$like':'%'+_0x249711[_0x0816('0x41')][_0x0816('0x3c')]+'%'};return _0x49c670;})});}_0x2bf303=_[_0x0816('0x5c')]({},_0x2bf303,_0x249711[_0x0816('0x5d')]);return _0x2a7389[_0x0816('0xea')](_0x2bf303);}})['then'](function(_0x293f50){if(_0x293f50){_0x2b6dcc=_0x293f50['length'];if(!_0x249711[_0x0816('0x41')][_0x0816('0xd1')]('nolimit')){_0x2bf303[_0x0816('0x26')]=qs['limit'](_0x249711[_0x0816('0x41')][_0x0816('0x26')]);_0x2bf303[_0x0816('0x25')]=qs[_0x0816('0x25')](_0x249711[_0x0816('0x41')][_0x0816('0x25')]);}return _0x2a7389[_0x0816('0xea')](_0x2bf303);}})[_0x0816('0x16')](function(_0x530287){if(_0x530287){return _0x530287?{'count':_0x2b6dcc,'rows':_0x530287}:null;}})['then'](respondWithResult(_0x4b156c,null))[_0x0816('0x53')](handleError(_0x4b156c,null));};exports[_0x0816('0xeb')]=function(_0x1e7fef,_0x1665ce){var _0x2f6e4e={};var _0x56a5dc={};var _0x2772b9;var _0x3ce272;return db['User']['findOne']({'where':{'id':_0x1e7fef[_0x0816('0x55')]['id']}})['then'](handleEntityNotFound(_0x1665ce,null))[_0x0816('0x16')](function(_0x4f83f7){if(_0x4f83f7){_0x2772b9=_0x4f83f7;_0x56a5dc[_0x0816('0x56')]=_[_0x0816('0x58')](db[_0x0816('0xec')]['rawAttributes']);_0x56a5dc[_0x0816('0x41')]=_[_0x0816('0x58')](_0x1e7fef[_0x0816('0x41')]);_0x56a5dc[_0x0816('0xcd')]=_[_0x0816('0x5a')](_0x56a5dc['model'],_0x56a5dc['query']);_0x2f6e4e[_0x0816('0x47')]=_[_0x0816('0x5a')](_0x56a5dc[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x1e7fef['query']['fields']));_0x2f6e4e['attributes']=_0x2f6e4e[_0x0816('0x47')][_0x0816('0x4b')]?_0x2f6e4e['attributes']:_0x56a5dc[_0x0816('0x56')];_0x2f6e4e[_0x0816('0xce')]=qs['sort'](_0x1e7fef[_0x0816('0x41')][_0x0816('0xcf')]);_0x2f6e4e[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x1e7fef['query'],_0x56a5dc[_0x0816('0xcd')]));if(_0x1e7fef[_0x0816('0x41')][_0x0816('0x3c')]){_0x2f6e4e['where']=_[_0x0816('0x5c')](_0x2f6e4e[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x2f6e4e[_0x0816('0x47')],function(_0x4c120c){var _0x3d6b2a={};_0x3d6b2a[_0x4c120c]={'$like':'%'+_0x1e7fef[_0x0816('0x41')][_0x0816('0x3c')]+'%'};return _0x3d6b2a;})});}_0x2f6e4e=_[_0x0816('0x5c')]({},_0x2f6e4e,_0x1e7fef[_0x0816('0x5d')]);return _0x2772b9[_0x0816('0xeb')](_0x2f6e4e);}})['then'](function(_0x57d87d){if(_0x57d87d){_0x3ce272=_0x57d87d[_0x0816('0x4b')];if(!_0x1e7fef[_0x0816('0x41')]['hasOwnProperty'](_0x0816('0xd8'))){_0x2f6e4e['limit']=qs['limit'](_0x1e7fef[_0x0816('0x41')][_0x0816('0x26')]);_0x2f6e4e['offset']=qs[_0x0816('0x25')](_0x1e7fef[_0x0816('0x41')]['offset']);}return _0x2772b9[_0x0816('0xeb')](_0x2f6e4e);}})['then'](function(_0x569110){if(_0x569110){return _0x569110?{'count':_0x3ce272,'rows':_0x569110}:null;}})[_0x0816('0x16')](respondWithResult(_0x1665ce,null))[_0x0816('0x53')](handleError(_0x1665ce,null));};exports[_0x0816('0xed')]=function(_0x5d0518,_0x2c8409,_0x43d172){var _0x557706;var _0x461134;var _0x17b7eb;var _0x57674f=!_['isNil'](_0x5d0518['params']['id'])?_0x5d0518[_0x0816('0x55')]['id']:!_[_0x0816('0x68')](_0x5d0518[_0x0816('0x2f')]['id'])?_0x5d0518[_0x0816('0x2f')]['id']:null;return db['User'][_0x0816('0x5e')]({'where':{'id':_0x57674f,'role':{'$or':[_0x0816('0x2d'),_0x0816('0x2f'),'agent']}},'attributes':['id','name',_0x0816('0xee'),_0x0816('0xef'),'role',_0x0816('0x67'),_0x0816('0x9d')]})['then'](function(_0x33a643){if(_0x33a643){if(_0x33a643[_0x0816('0x2c')]===_0x0816('0x30')){_0x557706=_0x33a643;if(_0x5d0518['body'][_0x0816('0x9f')]){_0x17b7eb=util[_0x0816('0xab')](_0x0816('0xf0'),_0x557706[_0x5d0518['body'][_0x0816('0x9f')]]);}else if(_0x5d0518['body'][_0x0816('0xf1')]){_0x17b7eb=util[_0x0816('0xab')](_0x0816('0xac'),_0x5d0518[_0x0816('0x61')][_0x0816('0xf1')]);}else{_0x17b7eb=util[_0x0816('0xab')](_0x0816('0xac'),_0x557706['name']);}socket['to'](util[_0x0816('0xab')](_0x0816('0xf2'),_0x557706[_0x0816('0x35')]))[_0x0816('0x29')](_0x0816('0xf3'),{'user':{'id':_0x557706['id'],'name':_0x557706[_0x0816('0x35')]},'ip':_0x5d0518['headers'][_0x0816('0xf4')]||_0x5d0518['connection'][_0x0816('0xf5')]||_0x5d0518[_0x0816('0xf6')][_0x0816('0xf5')]||_0x5d0518[_0x0816('0xf7')][_0x0816('0xf6')][_0x0816('0xf5')]});return db[_0x0816('0xad')]['destroy']({'where':{'membername':_0x557706[_0x0816('0x35')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x0816('0x91'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x0816('0x16')](function(){if(_0x557706){return _0x557706['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x3e2a07){if(_0x557706){if(_0x3e2a07){_0x461134=_0x3e2a07;if(_0x461134[_0x0816('0x4b')]){var _0x5e8b4c=_0x461134[_0x0816('0x33')](function(_0x272fab){var _0x19f214={'membername':_0x557706[_0x0816('0x35')],'UserId':_0x557706['id'],'queue_name':_0x272fab[_0x0816('0x35')],'VoiceQueueId':_0x272fab['id'],'interface':_0x17b7eb,'paused':_0x557706[_0x0816('0x9d')]||![],'penalty':_0x272fab[_0x0816('0xf8')]||0x0};return db['UserVoiceQueueRt'][_0x0816('0xae')](_0x19f214);});return Promise[_0x0816('0x60')](_0x5e8b4c);}}}})[_0x0816('0x16')](function(){if(_0x557706){return db['MemberReport']['findAll']({'where':{'membername':_0x557706[_0x0816('0x35')],'exitAt':null}});}})[_0x0816('0x16')](function(_0x406eba){if(_0x557706){var _0x1297a5=[];_0x406eba[_0x0816('0xf9')](function(_0x595450){_0x1297a5[_0x0816('0x4c')](_0x595450[_0x0816('0x28')]({'exitAt':moment()[_0x0816('0xab')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x0816('0x60')](_0x1297a5);}})[_0x0816('0x16')](function(){if(_0x557706){var _0x23f0d4=[];var _0x553687=[];var _0x5b02d5=utils[_0x0816('0xfa')]();var _0x29254f={'membername':_0x557706[_0x0816('0x35')],'interface':_0x17b7eb,'enterAt':moment()[_0x0816('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x557706[_0x0816('0x2c')],'internal':_0x557706[_0x0816('0x67')]};_0x5b02d5['forEach'](function(_0x1c3fe6){_0x23f0d4[_0x0816('0x4c')](_['merge']({'channel':_0x1c3fe6,'type':_0x0816('0xfb'),'data1':_0x5d0518[_0x0816('0x61')][_0x0816('0xfc')],'data2':_0x17b7eb},_0x29254f));if(_0x557706[_0x0816('0x9d')]){_0x553687['push'](_['merge']({'channel':_0x1c3fe6,'type':_0x0816('0xfd'),'data1':_0x0816('0xfe')},_0x29254f));}});return db['MemberReport']['bulkCreate'](_0x23f0d4[_0x0816('0xca')](_0x553687),{'individualHooks':!![]});}})[_0x0816('0x16')](function(){if(_0x557706){return _0x557706[_0x0816('0x28')]({'online':!![],'lastLoginAt':moment()[_0x0816('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x557706['loginInPause']||![],'mailPause':_0x557706[_0x0816('0x9d')]||![],'chatPause':_0x557706[_0x0816('0x9d')]||![],'faxPause':_0x557706[_0x0816('0x9d')]||![],'smsPause':_0x557706[_0x0816('0x9d')]||![],'openchannelPause':_0x557706[_0x0816('0x9d')]||![],'whatsappPause':_0x557706[_0x0816('0x9d')]||![],'pauseType':_0x557706[_0x0816('0x9d')]?_0x0816('0xfe'):null,'interface':_0x17b7eb,'lastPauseAt':moment()[_0x0816('0xab')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x0816('0x16')](function(_0x1b137f){if(_0x5d0518[_0x0816('0xff')]){return _0x43d172();}else{return Promise[_0x0816('0x100')](_0x1b137f)['then'](respondWithResult(_0x2c8409,null));}})[_0x0816('0x53')](handleError(_0x2c8409,null));};exports[_0x0816('0x101')]=function(_0x5a1847,_0x295f69){var _0x418774;return db[_0x0816('0x40')][_0x0816('0x5e')]({'where':{'id':_0x5a1847[_0x0816('0x55')]['id'],'role':_0x0816('0x30')},'attributes':['id',_0x0816('0x35'),_0x0816('0x2c')]})[_0x0816('0x16')](handleEntityNotFound(_0x295f69,null))['then'](function(_0x1c4a43){if(_0x1c4a43){_0x418774=_0x1c4a43;return db['UserVoiceQueueRt'][_0x0816('0xb4')]({'where':{'membername':_0x418774['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x0816('0x102')][_0x0816('0x48')]({'where':{'membername':_0x418774['name'],'exitAt':null}});})['then'](function(_0x259e20){var _0x1592b3=[];_0x259e20[_0x0816('0xf9')](function(_0x57c63b){_0x1592b3[_0x0816('0x4c')](_0x57c63b[_0x0816('0x28')]({'exitAt':moment()['format'](_0x0816('0x103'))}));});return Promise[_0x0816('0x60')](_0x1592b3);})[_0x0816('0x16')](function(){return _0x418774[_0x0816('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x0816('0x16')](respondWithResult(_0x295f69,null))[_0x0816('0x53')](handleError(_0x295f69,null));};exports[_0x0816('0x104')]=function(_0x5311fc,_0x5225a6){var _0x615270;return db[_0x0816('0xad')]['update']({'paused':0x1},{'where':{'UserId':_0x5311fc[_0x0816('0x55')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x0816('0x40')]['find']({'where':{'id':_0x5311fc[_0x0816('0x55')]['id'],'role':_0x0816('0x30')},'attributes':['id',_0x0816('0x35'),_0x0816('0x2c'),'internal','interface',_0x0816('0x9c')]});})[_0x0816('0x16')](handleEntityNotFound(_0x5225a6,null))[_0x0816('0x16')](function(_0x7d6323){if(_0x7d6323){_0x615270=_0x7d6323;return respondWithRpcPromise(_0x0816('0x105'),_0x0816('0x104'),{'id':_0x615270['id'],'name':_0x615270[_0x0816('0x35')],'pause':!![]});}})[_0x0816('0x16')](function(){if(_0x615270){return db['MemberReport'][_0x0816('0x48')]({'where':{'membername':_0x615270[_0x0816('0x35')],'type':_0x0816('0xfd'),'exitAt':null}});}})[_0x0816('0x16')](function(_0x2f79ef){if(_0x2f79ef[_0x0816('0x4b')]){var _0xae1f75=moment()[_0x0816('0xab')](_0x0816('0x103'));for(var _0x166697=0x0,_0x577ff3=_0x2f79ef['length'];_0x166697<_0x577ff3;_0x166697++){_0x2f79ef[_0x166697][_0x0816('0x106')]({'exitAt':_0xae1f75});}}})['then'](function(){var _0x2c24d2=[];var _0xc13dc8=utils[_0x0816('0xfa')]();_0xc13dc8[_0x0816('0xf9')](function(_0xfe8047){_0x2c24d2[_0x0816('0x4c')]({'channel':_0xfe8047,'membername':_0x615270[_0x0816('0x35')],'interface':_[_0x0816('0x68')](_0x615270[_0x0816('0x9f')])?util[_0x0816('0xab')](_0x0816('0xac'),_0x615270[_0x0816('0x35')]):_0x615270[_0x0816('0x9f')],'type':_0x0816('0xfd'),'enterAt':moment()[_0x0816('0xab')](_0x0816('0x103')),'data1':_0x5311fc[_0x0816('0x61')][_0x0816('0x3b')]||_0x0816('0x107'),'role':_0x615270[_0x0816('0x2c')],'internal':_0x615270[_0x0816('0x67')]});});return db[_0x0816('0x102')][_0x0816('0x108')](_0x2c24d2,{'individualHooks':!![]});})[_0x0816('0x16')](function(){return _0x615270[_0x0816('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5311fc[_0x0816('0x61')]['type']||_0x0816('0x107'),'lastPauseAt':moment()[_0x0816('0xab')](_0x0816('0x103'))});})['then'](respondWithResult(_0x5225a6,null))[_0x0816('0x53')](handleError(_0x5225a6,null));};exports['unpause']=function(_0x229c9b,_0x515aba){if(_0x229c9b[_0x0816('0x61')][_0x0816('0xb1')]&&!utils[_0x0816('0xa0')](_0x229c9b[_0x0816('0x61')][_0x0816('0xb1')])){throw new APIBadRequestError(util[_0x0816('0xab')](_0x0816('0x109'),_0x229c9b[_0x0816('0x61')][_0x0816('0xb1')]));}return db[_0x0816('0x40')]['find']({'where':{'id':_0x229c9b[_0x0816('0x55')]['id']},'attributes':['id',_0x0816('0x35'),'role',_0x0816('0x67'),_0x0816('0x9f'),_0x0816('0x9c'),_0x0816('0x9e'),_0x0816('0x10a'),_0x0816('0x10b'),_0x0816('0x10c'),_0x0816('0x10d'),_0x0816('0x10e'),_0x0816('0x10f'),_0x0816('0x110'),_0x0816('0x111')]})[_0x0816('0x16')](function(_0xccc3c0){if(!_0xccc3c0){throw new APINotFoundError(util['format'](_0x0816('0x112'),_0x229c9b['params']['id']));}return _0xccc3c0[_0x0816('0x113')](_0x229c9b[_0x0816('0x61')][_0x0816('0xb1')]);})[_0x0816('0x16')](respondWithResult(_0x515aba,null))['catch'](APIHandleError(_0x515aba));};exports[_0x0816('0x114')]=function(_0x1a397f,_0x1a544b){var _0x2a860d={};var _0x16cd62={};var _0x37c255;var _0x43e0a6;return db[_0x0816('0x40')][_0x0816('0xcc')]({'where':{'id':_0x1a397f[_0x0816('0x55')]['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x1a544b,null))['then'](function(_0xfcafaa){if(_0xfcafaa){_0x37c255=_0xfcafaa;_0x16cd62[_0x0816('0x56')]=_[_0x0816('0x58')](db[_0x0816('0x115')]['rawAttributes']);_0x16cd62[_0x0816('0x41')]=_[_0x0816('0x58')](_0x1a397f['query']);_0x16cd62[_0x0816('0xcd')]=_['intersection'](_0x16cd62[_0x0816('0x56')],_0x16cd62[_0x0816('0x41')]);_0x2a860d['attributes']=_['intersection'](_0x16cd62[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x1a397f[_0x0816('0x41')][_0x0816('0x5b')]));_0x2a860d[_0x0816('0x47')]=_0x2a860d[_0x0816('0x47')][_0x0816('0x4b')]?_0x2a860d[_0x0816('0x47')]:_0x16cd62['model'];_0x2a860d['order']=qs['sort'](_0x1a397f['query'][_0x0816('0xcf')]);_0x2a860d[_0x0816('0x3f')]=qs['filters'](_[_0x0816('0xd0')](_0x1a397f['query'],_0x16cd62[_0x0816('0xcd')]));if(_0x1a397f[_0x0816('0x41')][_0x0816('0x3c')]){_0x2a860d[_0x0816('0x3f')]=_['merge'](_0x2a860d[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x2a860d['attributes'],function(_0x44f161){var _0x34af1a={};_0x34af1a[_0x44f161]={'$like':'%'+_0x1a397f[_0x0816('0x41')][_0x0816('0x3c')]+'%'};return _0x34af1a;})});}_0x2a860d=_[_0x0816('0x5c')]({},_0x2a860d,_0x1a397f[_0x0816('0x5d')]);return _0x37c255[_0x0816('0x114')](_0x2a860d);}})[_0x0816('0x16')](function(_0x118f89){if(_0x118f89){_0x43e0a6=_0x118f89[_0x0816('0x4b')];if(!_0x1a397f[_0x0816('0x41')][_0x0816('0xd1')](_0x0816('0xd8'))){_0x2a860d[_0x0816('0x26')]=qs[_0x0816('0x26')](_0x1a397f[_0x0816('0x41')]['limit']);_0x2a860d[_0x0816('0x25')]=qs[_0x0816('0x25')](_0x1a397f[_0x0816('0x41')]['offset']);}return _0x37c255[_0x0816('0x114')](_0x2a860d);}})[_0x0816('0x16')](function(_0x12f02f){if(_0x12f02f){return _0x12f02f?{'count':_0x43e0a6,'rows':_0x12f02f}:null;}})[_0x0816('0x16')](respondWithResult(_0x1a544b,null))[_0x0816('0x53')](handleError(_0x1a544b,null));};exports[_0x0816('0x116')]=function(_0x45f74a,_0x353fd3){var _0x461c20=_0x45f74a['params']['id'];var _0x3e1fd9=_0x45f74a[_0x0816('0x61')]?_0x45f74a[_0x0816('0x61')][_0x0816('0x64')]:null;var _0x26cf13=[];return Promise[_0x0816('0x100')]()[_0x0816('0x16')](function(){if(!_0x3e1fd9)throw new APIBadRequestError(_0x0816('0x117'));})[_0x0816('0x16')](function(){return db[_0x0816('0x40')]['findOne']({'where':{'id':_0x461c20}});})[_0x0816('0x16')](function(_0x432166){if(!_0x432166)throw new APINotFoundError(util[_0x0816('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x45f74a[_0x0816('0x55')]['id']));return db[_0x0816('0x6a')]['transaction'](function(_0x39edeb){return _0x432166[_0x0816('0x116')](_0x3e1fd9,{'transaction':_0x39edeb})[_0x0816('0x16')](function(){return db['Team'][_0x0816('0x48')]({'where':{'id':{'$in':_0x3e1fd9}}});})['then'](function(_0x45f381){var _0x3d3d67=_['map'](_0x45f381,function(_0xea7090){return _0xea7090[_0x0816('0x118')]();});return Promise[_0x0816('0x60')](_0x3d3d67);})[_0x0816('0x16')](function(_0x5a1c71){_0x26cf13=_['flattenDeep'](_0x5a1c71);var _0x1b2a70=_[_0x0816('0x33')](_0x26cf13,function(_0x2682c4){return _0x2682c4[_0x0816('0x119')](_0x432166['id'],{'transaction':_0x39edeb});});return Promise[_0x0816('0x60')](_0x1b2a70);})[_0x0816('0x16')](function(){if(!_0x432166[_0x0816('0x9c')])return;var _0x465b1c=_[_0x0816('0x3c')](_0x26cf13,function(_0x1cb51f){return _0x1cb51f[_0x0816('0x11a')](_0x0816('0xb1'))==='Voice';});var _0x9d493b=_[_0x0816('0x33')](_0x465b1c,function(_0x18fba1){return db[_0x0816('0xad')][_0x0816('0xae')]({'membername':_0x432166[_0x0816('0x35')],'UserId':_0x432166['id'],'queue_name':_0x18fba1['name'],'VoiceQueueId':_0x18fba1['id'],'interface':_[_0x0816('0x68')](_0x432166[_0x0816('0x9f')])?util['format'](_0x0816('0xac'),_0x432166[_0x0816('0x35')]):_0x432166[_0x0816('0x9f')],'paused':_0x432166['voicePause']||![],'penalty':_0x432166[_0x0816('0xa6')]},{'transaction':_0x39edeb});});return Promise['all'](_0x9d493b);})['then'](function(){return db[_0x0816('0x11b')][_0x0816('0x48')]({'where':{'teamId':{'$in':_0x3e1fd9}}});})['then'](function(_0x31d8cd){var _0x2f3d59=_[_0x0816('0x33')](_0x31d8cd,function(_0x54f4bf){return db[_0x0816('0x11c')][_0x0816('0x7d')]({'UserId':_0x432166['id'],'VoicePrefixId':_0x54f4bf[_0x0816('0x11d')]},{'transaction':_0x39edeb});});return Promise['all'](_0x2f3d59);});});})[_0x0816('0x16')](function(){for(var _0x23835f=0x0;_0x23835f<_0x26cf13[_0x0816('0x4b')];_0x23835f++){var _0x6244c4=_0x26cf13[_0x23835f]['getDataValue'](_0x0816('0xb1'));var _0x22360e=_0x6244c4+'QueueId';socket[_0x0816('0x29')](_0x0816('0x2f')+_0x6244c4+_0x0816('0xa8'),{'UserId':_0x461c20,['queueField']:_0x26cf13[_0x23835f]['id']});}})[_0x0816('0x16')](respondWithStatusCode(_0x353fd3,null))['catch'](APIHandleError(_0x353fd3));};exports[_0x0816('0x11e')]=function(_0x5de549,_0xd88fb0){var _0x359707=_0x5de549[_0x0816('0x55')]['id'];var _0x48a2aa=null;if(_0x5de549[_0x0816('0x41')][_0x0816('0x64')]){_0x48a2aa=_[_0x0816('0xb2')](_0x5de549[_0x0816('0x41')][_0x0816('0x64')])?_0x5de549[_0x0816('0x41')]['ids']:[_0x5de549[_0x0816('0x41')][_0x0816('0x64')]];}var _0xc05773=[];return Promise[_0x0816('0x100')]()[_0x0816('0x16')](function(){if(!_0x48a2aa)throw new APIBadRequestError(_0x0816('0x11f'));})[_0x0816('0x16')](function(){return db[_0x0816('0x40')]['findOne']({'where':{'id':_0x359707}});})[_0x0816('0x16')](function(_0x3b9116){if(!_0x3b9116)throw new APINotFoundError(util[_0x0816('0xab')](_0x0816('0x112'),_0x5de549[_0x0816('0x55')]['id']));return db[_0x0816('0x6a')][_0x0816('0x120')](function(_0x50991f){return _0x3b9116['removeTeams'](_0x48a2aa,{'transaction':_0x50991f})[_0x0816('0x16')](function(){return db[_0x0816('0x115')][_0x0816('0x48')]({'where':{'id':{'$in':_0x48a2aa}}});})[_0x0816('0x16')](function(_0x32172b){var _0x5cb284=_[_0x0816('0x33')](_0x32172b,function(_0x49c6be){return _0x49c6be[_0x0816('0x118')]();});return Promise['all'](_0x5cb284);})[_0x0816('0x16')](function(_0x425c12){_0xc05773=_[_0x0816('0x121')](_0x425c12);var _0x3ed070=_[_0x0816('0x33')](_0xc05773,function(_0x2e79d5){return _0x2e79d5['removeAgent'](_0x3b9116['id'],{'transaction':_0x50991f});});return Promise[_0x0816('0x60')](_0x3ed070);})[_0x0816('0x16')](function(){if(!_0x3b9116['online'])return;var _0x5f3b68=_[_0x0816('0x3c')](_0xc05773,function(_0x2db48c){return _0x2db48c[_0x0816('0x11a')](_0x0816('0xb1'))===_0x0816('0x122');});var _0x4d921b=_[_0x0816('0x33')](_0x5f3b68,function(_0x176b90){return db[_0x0816('0xad')][_0x0816('0xb4')]({'where':{'VoiceQueueId':_0x176b90['id'],'UserId':_0x3b9116['id']},'transaction':_0x50991f});});return Promise[_0x0816('0x60')](_0x4d921b);})['then'](function(){return db[_0x0816('0x11b')][_0x0816('0x48')]({'where':{'teamId':{'$in':_0x48a2aa}}});})[_0x0816('0x16')](function(_0x2cd17a){var _0xd1781c=_[_0x0816('0x33')](_0x2cd17a,function(_0x44adea){return db[_0x0816('0x11c')]['destroy']({'where':{'UserId':_0x3b9116['id'],'VoicePrefixId':_0x44adea[_0x0816('0x11d')]}},{'transaction':_0x50991f});});return Promise[_0x0816('0x60')](_0xd1781c);});});})[_0x0816('0x16')](function(){for(var _0x4b9d60=0x0;_0x4b9d60<_0xc05773['length'];_0x4b9d60++){var _0x21dba4=_0xc05773[_0x4b9d60]['getDataValue'](_0x0816('0xb1'));var _0x2f6a8e=_0x21dba4+_0x0816('0xa7');socket[_0x0816('0x29')](_0x0816('0x2f')+_0x21dba4+_0x0816('0xb3'),{'UserId':_0x359707,['queueField']:_0xc05773[_0x4b9d60]['id']});}})[_0x0816('0x16')](respondWithStatusCode(_0xd88fb0,null))[_0x0816('0x53')](APIHandleError(_0xd88fb0));};exports['getLists']=function(_0x5a4f6e,_0x5c4bd0){var _0x2f3368={};var _0x100337={};var _0x3405fa;var _0x694902;return db['User'][_0x0816('0xcc')]({'where':{'id':_0x5a4f6e[_0x0816('0x55')]['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x5c4bd0,null))[_0x0816('0x16')](function(_0x14e8b4){if(_0x14e8b4){_0x3405fa=_0x14e8b4;_0x100337[_0x0816('0x56')]=_['keys'](db[_0x0816('0xd2')]['rawAttributes']);_0x100337[_0x0816('0x41')]=_[_0x0816('0x58')](_0x5a4f6e[_0x0816('0x41')]);_0x100337[_0x0816('0xcd')]=_[_0x0816('0x5a')](_0x100337[_0x0816('0x56')],_0x100337[_0x0816('0x41')]);_0x2f3368[_0x0816('0x47')]=_[_0x0816('0x5a')](_0x100337['model'],qs['fields'](_0x5a4f6e[_0x0816('0x41')][_0x0816('0x5b')]));_0x2f3368[_0x0816('0x47')]=_0x2f3368[_0x0816('0x47')]['length']?_0x2f3368['attributes']:_0x100337[_0x0816('0x56')];_0x2f3368[_0x0816('0xce')]=qs['sort'](_0x5a4f6e[_0x0816('0x41')][_0x0816('0xcf')]);_0x2f3368[_0x0816('0x3f')]=qs[_0x0816('0xcd')](_['pick'](_0x5a4f6e['query'],_0x100337[_0x0816('0xcd')]));if(_0x5a4f6e[_0x0816('0x41')][_0x0816('0x3c')]){_0x2f3368[_0x0816('0x3f')]=_[_0x0816('0x5c')](_0x2f3368['where'],{'$or':_['map'](_0x2f3368['attributes'],function(_0x279edd){var _0x29016f={};_0x29016f[_0x279edd]={'$like':'%'+_0x5a4f6e[_0x0816('0x41')][_0x0816('0x3c')]+'%'};return _0x29016f;})});}_0x2f3368=_[_0x0816('0x5c')]({},_0x2f3368,_0x5a4f6e[_0x0816('0x5d')]);return _0x3405fa[_0x0816('0x123')](_0x2f3368);}})[_0x0816('0x16')](function(_0x2d39c5){if(_0x2d39c5){_0x694902=_0x2d39c5[_0x0816('0x4b')];if(!_0x5a4f6e[_0x0816('0x41')][_0x0816('0xd1')](_0x0816('0xd8'))){_0x2f3368['limit']=qs[_0x0816('0x26')](_0x5a4f6e[_0x0816('0x41')][_0x0816('0x26')]);_0x2f3368[_0x0816('0x25')]=qs[_0x0816('0x25')](_0x5a4f6e[_0x0816('0x41')][_0x0816('0x25')]);}return _0x3405fa['getLists'](_0x2f3368);}})[_0x0816('0x16')](function(_0x3bf7a4){if(_0x3bf7a4){return _0x3bf7a4?{'count':_0x694902,'rows':_0x3bf7a4}:null;}})[_0x0816('0x16')](respondWithResult(_0x5c4bd0,null))[_0x0816('0x53')](handleError(_0x5c4bd0,null));};exports['getAgents']=function(_0x1495f4,_0x14e9fc){var _0x4901c6={};var _0x3133fd={};var _0x4a63cd;return db[_0x0816('0x40')][_0x0816('0xcc')]({'where':{'id':_0x1495f4[_0x0816('0x55')]['id']}})[_0x0816('0x16')](handleEntityNotFound(_0x14e9fc,null))[_0x0816('0x16')](function(_0x173f2e){if(_0x173f2e){_0x4a63cd=_0x173f2e;_0x3133fd[_0x0816('0x56')]=_['keys'](db[_0x0816('0x40')]['rawAttributes']);_0x3133fd[_0x0816('0x41')]=_[_0x0816('0x58')](_0x1495f4[_0x0816('0x41')]);_0x3133fd[_0x0816('0xcd')]=_[_0x0816('0x5a')](_0x3133fd['model'],_0x3133fd['query']);_0x4901c6[_0x0816('0x47')]=_[_0x0816('0x5a')](_0x3133fd[_0x0816('0x56')],qs[_0x0816('0x5b')](_0x1495f4[_0x0816('0x41')][_0x0816('0x5b')]));_0x4901c6[_0x0816('0x47')]=_0x4901c6[_0x0816('0x47')][_0x0816('0x4b')]?_0x4901c6[_0x0816('0x47')]:_0x3133fd['model'];_0x4901c6[_0x0816('0xce')]=qs[_0x0816('0xcf')](_0x1495f4['query']['sort']);_0x4901c6['where']=qs[_0x0816('0xcd')](_[_0x0816('0xd0')](_0x1495f4['query'],_0x3133fd[_0x0816('0xcd')]));if(_0x1495f4['query']['filter']){_0x4901c6['where']=_[_0x0816('0x5c')](_0x4901c6[_0x0816('0x3f')],{'$or':_[_0x0816('0x33')](_0x4901c6[_0x0816('0x47')],function(_0x424bf1){var _0x2e1636={};_0x2e1636[_0x424bf1]={'$like':'%'+_0x1495f4[_0x0816('0x41')]['filter']+'%'};return _0x2e1636;})});}_0x4901c6['model']=db[_0x0816('0x40')];_0x4901c6['as']=_0x0816('0x85');_0x4901c6=_[_0x0816('0x5c')]({},_0x4901c6,_0x1495f4[_0x0816('0x5d')]);return _0x4a63cd[_0x0816('0x124')]({'include':[_0x4901c6]});}})['then'](function(_0x28bbc0){if(_0x28bbc0){var _0x22211d={},_0x4ef990=[];for(var _0x412c03=0x0;_0x412c03<_0x28bbc0[_0x0816('0x4b')];_0x412c03+=0x1){for(var _0xe08283=0x0,_0xec1758;_0xe08283<_0x28bbc0[_0x412c03]['Agents'][_0x0816('0x4b')];_0xe08283+=0x1){_0xec1758=_0x28bbc0[_0x412c03][_0x0816('0x85')][_0xe08283][_0x0816('0x2b')]({'plain':!![]});_0x22211d[_0xec1758['id']]=_0xec1758;}}_0x22211d=_[_0x0816('0x125')](_0x22211d);for(var _0x495054=qs['offset'](_0x1495f4['query'][_0x0816('0x25')]);_0x495054<_0x22211d['length']&&_0x4ef990[_0x0816('0x4b')]=_0x180532){_0x243292=_0x180532;_0x4982ba=0xc8;}else{_0x4982ba=0xce;}_0x9166fd[_0xbe9b('0x25')](_0x4982ba);return _0x9166fd['set']('Content-Range',_0x45387c+'-'+_0x243292+'/'+_0x180532)[_0xbe9b('0x2a')](_0x1d6591);}return null;};}function saveUpdates(_0x3d121c){return function(_0x1dec7d){if(_0x1dec7d){return _0x1dec7d[_0xbe9b('0x2b')](_0x3d121c)[_0xbe9b('0x2c')](function(_0x374fdf){socket[_0xbe9b('0x2d')](_0xbe9b('0x2e')+_0x374fdf['id'],{});return _0x374fdf;});}return null;};}function removeEntity(_0x1a3a42){return function(_0x4eba1f){if(_0x4eba1f){return _0x4eba1f[_0xbe9b('0x2f')]()[_0xbe9b('0x2c')](function(){var _0x3be5f3=_0x4eba1f[_0xbe9b('0x30')]({'plain':!![]});if(_0x3be5f3['role']===_0xbe9b('0x31'))return;var _0xea2970=[{'name':_0xbe9b('0x32'),'value':_0xbe9b('0x33'),'ignore':!![]},{'name':_0xbe9b('0x34'),'value':_0xbe9b('0x35'),'ignore':![]},{'name':_0xbe9b('0x36'),'value':_0xbe9b('0x37'),'ignore':![]}];var _0x14e2d0=_(_0xea2970)['filter']('ignore')[_0xbe9b('0x38')](_0xbe9b('0x39'))[_0xbe9b('0x39')]();if(_[_0xbe9b('0x3a')](_0x14e2d0,_0x3be5f3[_0xbe9b('0x3b')])){return;}var _0x57dd29=_[_0xbe9b('0x3c')](_0xea2970,[_0xbe9b('0x39'),_0x3be5f3[_0xbe9b('0x3b')]])[_0xbe9b('0x3d')];return db[_0xbe9b('0x3e')][_0xbe9b('0x2f')]({'where':{'type':_0x57dd29,'resourceId':_0x3be5f3['id']}})['then'](function(){return _0x4eba1f;});})[_0xbe9b('0x2c')](function(){_0x1a3a42['status'](0xcc)[_0xbe9b('0x26')]();});}};}function handleEntityNotFound(_0x199b2b){return function(_0x1503a9){if(!_0x1503a9){_0x199b2b['sendStatus'](0x194);}return _0x1503a9;};}function handleError(_0x7fe091,_0x51cdd1){_0x51cdd1=_0x51cdd1||0x1f4;return function(_0x5e91e5){logger[_0xbe9b('0x1f')](_0x5e91e5[_0xbe9b('0x3f')]);if(_0x5e91e5[_0xbe9b('0x3d')]){delete _0x5e91e5[_0xbe9b('0x3d')];}_0x7fe091[_0xbe9b('0x25')](_0x51cdd1)[_0xbe9b('0x40')](_0x5e91e5);};}exports[_0xbe9b('0x41')]=function(_0x8284c3,_0x1fe8ba){var _0x4c2ee9={},_0x2aca23={'count':0x0,'rows':[]};var _0x529f22=_(db[_0xbe9b('0x42')][_0xbe9b('0x43')])[_0xbe9b('0x38')](function(_0x16d987){return{'name':_0x16d987[_0xbe9b('0x44')],'type':_0x16d987[_0xbe9b('0x45')][_0xbe9b('0x46')]};})[_0xbe9b('0x47')](function(_0x8f43ac){return!_[_0xbe9b('0x3a')]([_0xbe9b('0x48'),_0xbe9b('0x49')],_0x8f43ac[_0xbe9b('0x3d')]);})[_0xbe9b('0x39')]();_0x4c2ee9=qs['getOptions'](_0x529f22,_0x8284c3);var _0x3d3b20={'where':_0x4c2ee9['where']};return db[_0xbe9b('0x42')][_0xbe9b('0x29')](_0x3d3b20)['then'](function(_0x90e8a5){_0x2aca23[_0xbe9b('0x29')]=_0x90e8a5;if(_0x8284c3[_0xbe9b('0x4a')]['includeAll']){_0x4c2ee9[_0xbe9b('0x4b')]=[{'all':!![]}];}if(_0x8284c3[_0xbe9b('0x4a')][_0xbe9b('0x4c')]===_0xbe9b('0x4d')){_0x4c2ee9[_0xbe9b('0x4b')]=[{'model':db[_0xbe9b('0x4e')],'as':_0xbe9b('0x4c')}];}if(!_[_0xbe9b('0x3a')](_0x4c2ee9['attributes'],'id')){_0x4c2ee9[_0xbe9b('0x4f')][_0xbe9b('0x50')]('id');}return db[_0xbe9b('0x42')][_0xbe9b('0x51')](_0x4c2ee9);})['then'](function(_0x2a4bf0){_0x2aca23['rows']=_0x2a4bf0;if(_0x8284c3[_0xbe9b('0x4a')]['openTabs']===_0xbe9b('0x4d')){var _0x4d141b=[];for(var _0x4bea20=0x0;_0x4bea20<_0x2aca23[_0xbe9b('0x52')]['length'];_0x4bea20++){_0x4d141b[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x53'),_0x2aca23[_0xbe9b('0x52')][_0x4bea20][_0xbe9b('0x54')]));_0x4d141b['push'](get_open_tabs(_0xbe9b('0x55'),_0x2aca23['rows'][_0x4bea20]['dataValues']));_0x4d141b[_0xbe9b('0x50')](get_open_tabs('fax',_0x2aca23[_0xbe9b('0x52')][_0x4bea20][_0xbe9b('0x54')]));_0x4d141b['push'](get_open_tabs(_0xbe9b('0x56'),_0x2aca23[_0xbe9b('0x52')][_0x4bea20][_0xbe9b('0x54')]));_0x4d141b['push'](get_open_tabs('openchannel',_0x2aca23['rows'][_0x4bea20][_0xbe9b('0x54')]));_0x4d141b[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x57'),_0x2aca23[_0xbe9b('0x52')][_0x4bea20][_0xbe9b('0x54')]));}return Promise[_0xbe9b('0x58')](_0x4d141b)['then'](function(){return _0x2aca23;});}else{return _0x2aca23;}})[_0xbe9b('0x2c')](respondWithFilteredResult(_0x1fe8ba,_0x4c2ee9))['catch'](handleError(_0x1fe8ba,null));};exports[_0xbe9b('0x59')]=function(_0x538cfe,_0x167865){var _0x69b5f3={'raw':![],'where':{'id':_0x538cfe['params']['id']}},_0x2166fc={};_0x2166fc[_0xbe9b('0x5a')]=_[_0xbe9b('0x5b')](_[_0xbe9b('0x5c')](db[_0xbe9b('0x42')]['rawAttributes']),[_0xbe9b('0x48'),_0xbe9b('0x49')]);_0x2166fc[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0x538cfe[_0xbe9b('0x4a')]);_0x2166fc[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x2166fc[_0xbe9b('0x5a')],_0x2166fc['query']);_0x69b5f3[_0xbe9b('0x4f')]=_['intersection'](_0x2166fc['model'],qs[_0xbe9b('0x5f')](_0x538cfe[_0xbe9b('0x4a')]['fields']));_0x69b5f3['attributes']=_0x69b5f3[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x69b5f3[_0xbe9b('0x4f')]:_0x2166fc['model'];if(_0x538cfe['query'][_0xbe9b('0x61')]){_0x69b5f3[_0xbe9b('0x4b')]=[{'all':!![]}];}if(_0x538cfe[_0xbe9b('0x4a')][_0xbe9b('0x4c')]===_0xbe9b('0x4d')){_0x69b5f3[_0xbe9b('0x4b')]=[{'model':db['UserSetting'],'as':_0xbe9b('0x4c')}];}_0x69b5f3=_[_0xbe9b('0x62')]({},_0x69b5f3,_0x538cfe[_0xbe9b('0x63')]);if(!_[_0xbe9b('0x3a')](_0x69b5f3[_0xbe9b('0x4f')],'id')){_0x69b5f3[_0xbe9b('0x4f')][_0xbe9b('0x50')]('id');}return db[_0xbe9b('0x42')][_0xbe9b('0x3c')](_0x69b5f3)[_0xbe9b('0x2c')](handleEntityNotFound(_0x167865,null))[_0xbe9b('0x2c')](function(_0x610902){var _0x57922a=[];values=_0x610902;if(_0x538cfe[_0xbe9b('0x4a')][_0xbe9b('0x64')]==='true'){_0x57922a[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x53'),_0x610902[_0xbe9b('0x54')]));_0x57922a[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x55'),_0x610902['dataValues']));_0x57922a['push'](get_open_tabs('openchannel',_0x610902['dataValues']));_0x57922a[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x57'),_0x610902[_0xbe9b('0x54')]));_0x57922a['push'](get_open_tabs(_0xbe9b('0x65'),_0x610902[_0xbe9b('0x54')]));_0x57922a[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x56'),_0x610902['dataValues']));return Promise[_0xbe9b('0x58')](_0x57922a);}else{return values;}})[_0xbe9b('0x2c')](function(){return values;})[_0xbe9b('0x2c')](respondWithResult(_0x167865,null))['catch'](handleError(_0x167865,null));};exports['update']=function(_0x106d88,_0x56370a){if(_0x106d88['body']['id']){delete _0x106d88[_0xbe9b('0x66')]['id'];}delete _0x106d88['body'][_0xbe9b('0x3b')];return db[_0xbe9b('0x42')][_0xbe9b('0x3c')]({'where':{'id':_0x106d88[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x56370a,null))[_0xbe9b('0x2c')](saveUpdates(_0x106d88['body'],null))[_0xbe9b('0x2c')](respondWithResult(_0x56370a,null))[_0xbe9b('0x24')](handleError(_0x56370a,null));};exports['describe']=function(_0x2ca47f,_0x4bd7ea){return db[_0xbe9b('0x42')][_0xbe9b('0x68')]()[_0xbe9b('0x2c')](respondWithResult(_0x4bd7ea,null))['catch'](handleError(_0x4bd7ea,null));};exports[_0xbe9b('0x69')]=function(_0x10e999,_0x416fd2){return db[_0xbe9b('0x42')][_0xbe9b('0x3c')]({'where':{'id':_0x10e999[_0xbe9b('0x67')]['id']}})['then'](handleEntityNotFound(_0x416fd2,null))[_0xbe9b('0x2c')](function(_0x5929e9){if(_0x5929e9){return _0x5929e9[_0xbe9b('0x69')](_0x10e999[_0xbe9b('0x66')]['ids'],_[_0xbe9b('0x6a')](_0x10e999[_0xbe9b('0x66')],['ids','id'])||{});}})[_0xbe9b('0x2c')](respondWithResult(_0x416fd2,null))[_0xbe9b('0x24')](handleError(_0x416fd2,null));};function validateUser(_0x20b735){return new Promise(function(_0x4aee64,_0x26f121){if(_0x20b735[_0xbe9b('0x6b')])return _0x4aee64(_0x20b735);return db[_0xbe9b('0x6c')][_0xbe9b('0x6d')](0x1)['then'](function(_0xb1deb3){if(_0xb1deb3['securePassword'])authService[_0xbe9b('0x6e')](_0x20b735[_0xbe9b('0x48')]);db[_0xbe9b('0x42')][_0xbe9b('0x6f')]('internal')['then'](function(_0x1d5312){if(_['isNil'](_0x1d5312)){_0x20b735[_0xbe9b('0x6b')]=_0xb1deb3[_0xbe9b('0x70')]||0x1;return;}if(_[_0xbe9b('0x71')](_0xb1deb3[_0xbe9b('0x70')])||_0xb1deb3[_0xbe9b('0x70')]===_0x1d5312){_0x20b735[_0xbe9b('0x6b')]=_0x1d5312+0x1;return;}if(_0xb1deb3[_0xbe9b('0x70')]>_0x1d5312){_0x20b735[_0xbe9b('0x6b')]=_0xb1deb3[_0xbe9b('0x70')];return;}return db[_0xbe9b('0x72')][_0xbe9b('0x4a')](_0xbe9b('0x73'),{'type':db['sequelize'][_0xbe9b('0x74')]['SELECT']})[_0xbe9b('0x2c')](function(_0x2aabda){if(_0x2aabda&&_0x2aabda['length']){for(var _0x4d9c2d=0x0,_0x5dc28a=_0x2aabda[_0xbe9b('0x60')];_0x4d9c2d<_0x5dc28a&&_['isNil'](_0x20b735[_0xbe9b('0x6b')]);_0x4d9c2d++){if(_0xb1deb3[_0xbe9b('0x70')]<=_0x2aabda[_0x4d9c2d][_0xbe9b('0x75')]){_0x20b735[_0xbe9b('0x6b')]=_0x2aabda[_0x4d9c2d]['from'];}else if(_0xb1deb3[_0xbe9b('0x70')]>_0x2aabda[_0x4d9c2d][_0xbe9b('0x75')]&&_0xb1deb3[_0xbe9b('0x70')]<=_0x2aabda[_0x4d9c2d]['to']){_0x20b735[_0xbe9b('0x6b')]=_0xb1deb3[_0xbe9b('0x70')];}}}if(_[_0xbe9b('0x71')](_0x20b735[_0xbe9b('0x6b')])){_0x20b735[_0xbe9b('0x6b')]=_0x1d5312+0x1;}return _0x4aee64(_0x20b735);});});})['catch'](function(_0x338ac4){_0x26f121(_0x338ac4);});});}function updateUser(_0x1ec446){return new Promise(function(_0x349ebf,_0x3ed4d8){try{if(_0x1ec446[_0xbe9b('0x76')]){_0x1ec446['mailbox']=_0x1ec446[_0xbe9b('0x6b')];_0x1ec446[_0xbe9b('0x77')]={'mailbox':_0x1ec446['internal'],'password':_0x1ec446[_0xbe9b('0x48')],'fullname':_0x1ec446[_0xbe9b('0x78')],'email':_0x1ec446[_0xbe9b('0x79')]};}if(_0x1ec446['role']===_0xbe9b('0x35')){if(!_0x1ec446[_0xbe9b('0x7a')])_0x1ec446['permissions']=[_0xbe9b('0x7b'),_0xbe9b('0x7c'),'103','113',_0xbe9b('0x7d'),_0xbe9b('0x7e'),_0xbe9b('0x7f'),'106',_0xbe9b('0x80'),'108',_0xbe9b('0x81'),_0xbe9b('0x82'),_0xbe9b('0x83'),_0xbe9b('0x84'),_0xbe9b('0x85')];}_0x349ebf(_0x1ec446);}catch(_0x4d6e27){_0x3ed4d8(_0x4d6e27);}});}exports['create']=function(_0x1a2640,_0x1b89d0){if(_0x1a2640['user'][_0xbe9b('0x3b')]===_0xbe9b('0x35'))throw new Error(_0xbe9b('0x86'));if(_0x1a2640[_0xbe9b('0x66')][_0xbe9b('0x3b')]===_0xbe9b('0x33')&&_0x1a2640[_0xbe9b('0x33')][_0xbe9b('0x3b')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x1a2640[_0xbe9b('0x66')][_0xbe9b('0x3b')]===_0xbe9b('0x31')&&_0x1a2640[_0xbe9b('0x33')][_0xbe9b('0x3b')]!==_0xbe9b('0x31')){throw new Error(_0xbe9b('0x87'));}return licenseUtil[_0xbe9b('0x88')]([_0x1a2640[_0xbe9b('0x66')]])[_0xbe9b('0x2c')](function(){return validateUser(_0x1a2640[_0xbe9b('0x66')]);})[_0xbe9b('0x2c')](function(_0x56b0fa){return updateUser(_0x56b0fa)[_0xbe9b('0x2c')](function(_0x2fab78){if(_0x2fab78[_0xbe9b('0x3b')]==='admin'){_0x2fab78[_0xbe9b('0x89')]=_0x1a2640[_0xbe9b('0x33')]['settingsEnabled'];delete _0x2fab78[_0xbe9b('0x8a')];}return _0x2fab78;});})[_0xbe9b('0x2c')](function(_0x836424){return db[_0xbe9b('0x42')][_0xbe9b('0x8b')](_0x836424,{'include':[{'model':db['VoiceMail'],'as':_0xbe9b('0x77')}]});})['then'](function(_0x44d422){if(_0x1a2640[_0xbe9b('0x66')][_0xbe9b('0x3b')]===_0xbe9b('0x33'))return _0x44d422;if(_0x1a2640['user'][_0xbe9b('0x3b')]!=='user')return _0x44d422;return db['UserProfileSection'][_0xbe9b('0x3c')]({'where':{'name':_0x44d422[_0xbe9b('0x3b')]===_0xbe9b('0x35')?_0xbe9b('0x34'):'Telephones','userProfileId':_0x1a2640[_0xbe9b('0x33')][_0xbe9b('0x8a')]},'raw':!![]})[_0xbe9b('0x2c')](function(_0x3e85cf){if(!_0x3e85cf||_0x3e85cf[_0xbe9b('0x8c')]!=0x0)return _0x44d422;return db[_0xbe9b('0x3e')]['create']({'name':_0x44d422[_0xbe9b('0x3d')],'resourceId':_0x44d422['id'],'type':_0x3e85cf[_0xbe9b('0x3d')],'sectionId':_0x3e85cf['id']},{})[_0xbe9b('0x2c')](function(){return _0x44d422;});})[_0xbe9b('0x24')](function(_0x484786){logger[_0xbe9b('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x484786);throw _0x484786;});})[_0xbe9b('0x2c')](respondWithResult(_0x1b89d0,0xc9))[_0xbe9b('0x24')](handleError(_0x1b89d0,null));};exports[_0xbe9b('0x8d')]=function(_0xd2c07b,_0x5524c6){var _0x16feb1=_0xd2c07b['body'];var _0x554c39=[];if(_0xd2c07b['user'][_0xbe9b('0x3b')]===_0xbe9b('0x35'))throw new Error(_0xbe9b('0x86'));if(_['some'](_0x16feb1,[_0xbe9b('0x3b'),_0xbe9b('0x33')])&&_0xd2c07b[_0xbe9b('0x33')]['role']!==_0xbe9b('0x31')){throw new Error(_0xbe9b('0x8e'));}if(_[_0xbe9b('0x8f')](_0x16feb1,[_0xbe9b('0x3b'),_0xbe9b('0x31')])&&_0xd2c07b['user'][_0xbe9b('0x3b')]!==_0xbe9b('0x31')){throw new Error(_0xbe9b('0x90'));}return licenseUtil[_0xbe9b('0x88')](_0x16feb1)['then'](function(){return validateUser(_0x16feb1[0x0]);})[_0xbe9b('0x2c')](function(){for(var _0x536fbc=0x1;_0x536fbc<_0x16feb1[_0xbe9b('0x60')];_0x536fbc++){var _0x2d34c5=_0x16feb1[_0x536fbc-0x1]['internal'];if(!_0x16feb1[_0x536fbc][_0xbe9b('0x6b')])_0x16feb1[_0x536fbc][_0xbe9b('0x6b')]=_0x2d34c5+0x1;_0x554c39['push'](validateUser(_0x16feb1[_0x536fbc]));}return Promise[_0xbe9b('0x58')](_0x554c39);})[_0xbe9b('0x2c')](function(){_0x554c39=[];for(var _0x1b482f=0x0;_0x1b482f<_0x16feb1['length'];_0x1b482f++){_0x554c39['push'](updateUser(_0x16feb1[_0x1b482f]));}return Promise[_0xbe9b('0x58')](_0x554c39);})['then'](function(){_0x554c39=_0x16feb1[_0xbe9b('0x38')](function(_0x50f542){return db[_0xbe9b('0x42')][_0xbe9b('0x8b')](_0x50f542,{'include':[{'model':db[_0xbe9b('0x77')],'as':_0xbe9b('0x77')}]})[_0xbe9b('0x2c')](function(_0x1bc73e){_0x50f542['id']=_0x1bc73e['id'];return _0x50f542;});});return Promise[_0xbe9b('0x58')](_0x554c39);})[_0xbe9b('0x2c')](function(_0x4711ca){if(_0xd2c07b['body'][_0xbe9b('0x3b')]===_0xbe9b('0x33'))return _0x4711ca;if(_0xd2c07b[_0xbe9b('0x33')][_0xbe9b('0x3b')]!==_0xbe9b('0x33'))return _0x4711ca;var _0x436a52=_[_0xbe9b('0x8f')](_0x4711ca,function(_0x4327ed){return _0x4327ed['role']===_0xbe9b('0x35')||_0x4327ed[_0xbe9b('0x3b')]==='telephone';});if(!_0x436a52)return _0x4711ca;return db['UserProfileSection'][_0xbe9b('0x51')]({'where':{'name':{'$or':[_0xbe9b('0x34'),'Telephones']},'userProfileId':_0xd2c07b['user']['userProfileId']},'raw':!![]})['then'](function(_0xe0841f){if(_[_0xbe9b('0x91')](_0xe0841f)||!_[_0xbe9b('0x8f')](_0xe0841f,[_0xbe9b('0x8c'),0x0]))return _0x4711ca;_0x554c39=[];var _0x568e18=_(_0xe0841f)[_0xbe9b('0x38')](function(_0x5c61ee){if(_0x5c61ee[_0xbe9b('0x8c')]===0x1)return;return _0x5c61ee[_0xbe9b('0x3d')]==='Agents'?'agent':'telephone';})['compact']()['value']();for(var _0x165e03=0x0;_0x165e03<_0x4711ca['length'];_0x165e03++){if(!_[_0xbe9b('0x3a')](_0x568e18,_0x4711ca[_0x165e03][_0xbe9b('0x3b')]))return;var _0x5df6a4=_0x4711ca[_0x165e03][_0xbe9b('0x3b')]===_0xbe9b('0x35')?'Agents':_0xbe9b('0x36');_0x554c39[_0xbe9b('0x50')](db[_0xbe9b('0x3e')][_0xbe9b('0x8b')]({'name':_0x4711ca[_0x165e03][_0xbe9b('0x3d')],'resourceId':_0x4711ca[_0x165e03]['id'],'type':_0x5df6a4,'sectionId':_[_0xbe9b('0x3c')](_0xe0841f,[_0xbe9b('0x3d'),_0x5df6a4])['id']},{}));}return Promise[_0xbe9b('0x58')](_0x554c39);});})['then'](respondWithResult(_0x5524c6,0xc9))[_0xbe9b('0x24')](handleError(_0x5524c6,null));};exports[_0xbe9b('0x92')]=function(_0x5ba590,_0x44235c){if(_0x5ba590[_0xbe9b('0x66')]['id']){delete _0x5ba590['body']['id'];}return db[_0xbe9b('0x42')][_0xbe9b('0x3c')]({'where':{'id':_0x5ba590[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](function(_0x28ca2f){if(!_0x28ca2f)return null;if(_0x28ca2f['id']===_0x5ba590[_0xbe9b('0x33')]['id']){if(!_0x5ba590['body'][_0xbe9b('0x93')]||!_0x5ba590['body'][_0xbe9b('0x94')]){throw new db['Sequelize'][(_0xbe9b('0x95'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x28ca2f[_0xbe9b('0x96')](_0x5ba590['body'][_0xbe9b('0x93')])){throw new db[(_0xbe9b('0x97'))][(_0xbe9b('0x95'))](_0xbe9b('0x98'));}if(_0x5ba590[_0xbe9b('0x66')][_0xbe9b('0x93')]===_0x5ba590['body']['newPassword']){throw new db['Sequelize'][(_0xbe9b('0x95'))](_0xbe9b('0x99'));}}else if(_0x5ba590['user'][_0xbe9b('0x3b')]===_0xbe9b('0x31')){if(!_0x5ba590[_0xbe9b('0x66')][_0xbe9b('0x94')]){throw new db[(_0xbe9b('0x97'))][(_0xbe9b('0x95'))](_0xbe9b('0x9a'));}}else if(_0x5ba590['user'][_0xbe9b('0x3b')]==='user'){if(!_0x5ba590[_0xbe9b('0x66')][_0xbe9b('0x94')]){throw new db[(_0xbe9b('0x97'))][(_0xbe9b('0x95'))](_0xbe9b('0x9a'));}if(_0x28ca2f[_0xbe9b('0x3b')]!==_0xbe9b('0x35')){throw new db[(_0xbe9b('0x97'))][(_0xbe9b('0x95'))]('Unauthorized');}}else{throw new db[(_0xbe9b('0x97'))][(_0xbe9b('0x95'))]('Unauthorized');}return _0x28ca2f;})['then'](handleEntityNotFound(_0x44235c,null))[_0xbe9b('0x2c')](function(_0xa3c0b1){return db[_0xbe9b('0x6c')][_0xbe9b('0x9b')]({'attributes':['id',_0xbe9b('0x9c'),_0xbe9b('0x9d'),_0xbe9b('0x9e')]})[_0xbe9b('0x2c')](function(_0x2aa94b){if(_0x2aa94b['securePassword'])authService['validatePasswordPattern'](_0x5ba590[_0xbe9b('0x66')][_0xbe9b('0x94')]);if(!_0x2aa94b[_0xbe9b('0x9d')]||!_0xa3c0b1[_0xbe9b('0x9f')])return _0xa3c0b1;authService[_0xbe9b('0xa0')](_0x5ba590[_0xbe9b('0x66')][_0xbe9b('0x94')],_0xa3c0b1[_0xbe9b('0x9f')],_0x2aa94b[_0xbe9b('0x9e')]);return _0xa3c0b1;})[_0xbe9b('0x2c')](saveUpdates({'password':_0x5ba590[_0xbe9b('0x66')]['newPassword'],'passwordResetAt':_0x5ba590[_0xbe9b('0x33')]['id']==_0x5ba590[_0xbe9b('0x67')]['id']?moment():null,'previousPasswords':authService[_0xbe9b('0xa1')](_0x5ba590[_0xbe9b('0x66')][_0xbe9b('0x94')],_0xa3c0b1[_0xbe9b('0x9f')])},null));})[_0xbe9b('0x2c')](respondWithResult(_0x44235c,null))[_0xbe9b('0x24')](handleError(_0x44235c,null));};exports[_0xbe9b('0xa2')]=function(_0x26500a,_0x55b989){var _0x554524=_0x26500a[_0xbe9b('0x66')][_0xbe9b('0xa3')];return db[_0xbe9b('0x42')][_0xbe9b('0x3c')]({'where':{'id':_0x26500a[_0xbe9b('0x67')]['id']},'attributes':['id',_0xbe9b('0x3d'),_0xbe9b('0x3b'),_0xbe9b('0xa4'),'loginInPause',_0xbe9b('0xa5'),_0xbe9b('0xa6')]})['then'](handleEntityNotFound(_0x55b989,null))[_0xbe9b('0x2c')](function(_0x27fa8d){if(_0x27fa8d){if(!utils[_0xbe9b('0xa7')](_0x554524)){throw new db['Sequelize'][(_0xbe9b('0x95'))](_0xbe9b('0xa8'));}return _0x27fa8d[_0xbe9b('0xa9')+_[_0xbe9b('0xaa')](_0x554524[_0xbe9b('0xab')]())+'Queues'](_0x26500a[_0xbe9b('0x66')][_0xbe9b('0xac')],{'penalty':_0x26500a[_0xbe9b('0x66')][_0xbe9b('0xad')]||0x0})['spread'](function(_0x133037){for(var _0x4a309f=0x0;_0x4a309f<_0x26500a[_0xbe9b('0x66')][_0xbe9b('0xac')]['length'];_0x4a309f+=0x1){var _0x25a013={'UserId':Number(_0x26500a[_0xbe9b('0x67')]['id'])};_0x25a013[_[_0xbe9b('0xaa')](_0x554524[_0xbe9b('0xab')]())+'QueueId']=Number(_0x26500a[_0xbe9b('0x66')][_0xbe9b('0xac')][_0x4a309f]);socket[_0xbe9b('0x2d')](_0xbe9b('0x33')+_[_0xbe9b('0xaa')](_0x554524['toLowerCase']())+_0xbe9b('0xae'),_0x25a013);}return _0x133037;})[_0xbe9b('0x2c')](function(){if(_0x554524===_0xbe9b('0xaf')){return db['VoiceQueue'][_0xbe9b('0x51')]({'where':{'id':_0x26500a[_0xbe9b('0x66')][_0xbe9b('0xac')]||[]},'raw':!![],'attributes':['id',_0xbe9b('0x3d')]});}})['then'](function(_0x7bd641){var _0x28dfe1=_0x27fa8d[_0xbe9b('0x30')]({'plain':!![]});var _0x23c11d=[];if(_0x554524===_0xbe9b('0xaf')&&_0x28dfe1[_0xbe9b('0x3b')]===_0xbe9b('0x35')&&_0x28dfe1[_0xbe9b('0xa4')]){for(let _0x66046d=0x0;_0x66046d<_0x7bd641[_0xbe9b('0x60')];_0x66046d+=0x1){_0x23c11d[_0xbe9b('0x50')]({'membername':_0x28dfe1[_0xbe9b('0x3d')],'UserId':_0x28dfe1['id'],'queue_name':_0x7bd641[_0x66046d][_0xbe9b('0x3d')],'VoiceQueueId':_0x7bd641[_0x66046d]['id'],'interface':_['isNil'](_0x28dfe1['interface'])?util['format']('SIP/%s',_0x28dfe1[_0xbe9b('0x3d')]):_0x28dfe1['interface'],'paused':_0x28dfe1[_0xbe9b('0xa5')]||![],'penalty':_0x26500a[_0xbe9b('0x66')][_0xbe9b('0xad')]||0x0});}return Promise['all'](_0x23c11d[_0xbe9b('0x38')](function(_0x2ece97){return db['UserVoiceQueueRt'][_0xbe9b('0xb0')](_0x2ece97);}));}return _0x27fa8d;});}})[_0xbe9b('0x2c')](respondWithStatusCode(_0x55b989,null))[_0xbe9b('0x24')](handleError(_0x55b989,null));};exports[_0xbe9b('0xb1')]=function(_0x5b242f,_0x1b3ac3){var _0x18cae1,_0x2f1a85;return db['User'][_0xbe9b('0x3c')]({'where':{'id':_0x5b242f[_0xbe9b('0x67')]['id']},'attributes':['id',_0xbe9b('0x3d'),_0xbe9b('0x3b')]})[_0xbe9b('0x2c')](handleEntityNotFound(_0x1b3ac3,null))[_0xbe9b('0x2c')](function(_0x3f33e9){if(_0x3f33e9){_0x18cae1=_0x3f33e9;if(!_0x5b242f[_0xbe9b('0x4a')]['channel']||!utils[_0xbe9b('0xa7')](_0x5b242f[_0xbe9b('0x4a')][_0xbe9b('0xa3')])){throw new db['Sequelize'][(_0xbe9b('0x95'))](_0xbe9b('0xa8'));}return _0x3f33e9['remove'+_['capitalize'](_0x5b242f['query'][_0xbe9b('0xa3')][_0xbe9b('0xab')]())+_0xbe9b('0xb2')](_0x5b242f[_0xbe9b('0x4a')]['ids']);}})[_0xbe9b('0x2c')](function(_0x1b3c9e){if(_[_0xbe9b('0xb3')](_0x5b242f[_0xbe9b('0x4a')]['ids'])){for(var _0x103bb6=0x0;_0x103bb6<_0x5b242f[_0xbe9b('0x4a')][_0xbe9b('0xac')]['length'];_0x103bb6+=0x1){_0x2f1a85={'UserId':Number(_0x5b242f[_0xbe9b('0x67')]['id'])};_0x2f1a85[_['capitalize'](_0x5b242f[_0xbe9b('0x4a')][_0xbe9b('0xa3')]['toLowerCase']())+_0xbe9b('0xb4')]=Number(_0x5b242f[_0xbe9b('0x4a')][_0xbe9b('0xac')][_0x103bb6]);socket[_0xbe9b('0x2d')](_0xbe9b('0x33')+_[_0xbe9b('0xaa')](_0x5b242f[_0xbe9b('0x4a')][_0xbe9b('0xa3')]['toLowerCase']())+_0xbe9b('0xb5'),_0x2f1a85);}}else{_0x2f1a85={'UserId':Number(_0x5b242f[_0xbe9b('0x67')]['id'])};_0x2f1a85[_[_0xbe9b('0xaa')](_0x5b242f[_0xbe9b('0x4a')][_0xbe9b('0xa3')]['toLowerCase']())+'QueueId']=Number(_0x5b242f['query'][_0xbe9b('0xac')]);socket['emit'](_0xbe9b('0x33')+_[_0xbe9b('0xaa')](_0x5b242f['query']['channel'][_0xbe9b('0xab')]())+_0xbe9b('0xb5'),_0x2f1a85);}return _0x1b3c9e;})[_0xbe9b('0x2c')](function(){if(_0x5b242f['query'][_0xbe9b('0xa3')]===_0xbe9b('0xaf')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x5b242f[_0xbe9b('0x67')]['id'],'VoiceQueueId':_0x5b242f[_0xbe9b('0x4a')][_0xbe9b('0xac')]},'individualHooks':!![]})[_0xbe9b('0x2c')](function(){return _0x18cae1;});}return _0x18cae1;})[_0xbe9b('0x2c')](respondWithStatusCode(_0x1b3ac3,null))[_0xbe9b('0x24')](handleError(_0x1b3ac3,null));};exports[_0xbe9b('0xb6')]=function(_0x16d6a4,_0xb7da5e){_0x16d6a4[_0xbe9b('0x66')]['userpic']=_0x16d6a4[_0xbe9b('0xb7')][_0xbe9b('0xb8')];return db[_0xbe9b('0x42')][_0xbe9b('0x3c')]({'where':{'id':_0x16d6a4['params']['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0xb7da5e,null))[_0xbe9b('0x2c')](saveUpdates(_0x16d6a4[_0xbe9b('0x66')],null))[_0xbe9b('0x2c')](respondWithResult(_0xb7da5e,null))[_0xbe9b('0x24')](handleError(_0xb7da5e,null));};exports[_0xbe9b('0xb9')]=function(_0x556845,_0x1a1363){var _0x4072b5=path[_0xbe9b('0xba')](config[_0xbe9b('0xbb')],_0xbe9b('0xbc'));return db['User'][_0xbe9b('0x3c')]({'where':{'id':_0x556845[_0xbe9b('0x67')]['id']},'attributes':['id',_0xbe9b('0xbd')],'raw':!![]})[_0xbe9b('0x2c')](handleEntityNotFound(_0x1a1363,null))[_0xbe9b('0x2c')](function(_0x56e883){if(_0x56e883){if(_[_0xbe9b('0x71')](_0x56e883[_0xbe9b('0xbd')])){return _0x1a1363['download'](_0x4072b5);}else{if(!fs[_0xbe9b('0xbe')](path['join'](config[_0xbe9b('0xbb')],_0xbe9b('0xbf'),_0x56e883[_0xbe9b('0xbd')]))){return _0x1a1363[_0xbe9b('0xc0')](_0x4072b5);}return _0x1a1363[_0xbe9b('0xc0')](path[_0xbe9b('0xba')](config['root'],_0xbe9b('0xbf'),_0x56e883[_0xbe9b('0xbd')]));}}})['catch'](handleError(_0x1a1363,null));};exports['getOpenTabs']=function(_0x7b5b85,_0x37b551){return db[_0xbe9b('0x42')][_0xbe9b('0x3c')]({'where':{'id':_0x7b5b85['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x37b551,null))['then'](function(_0x2aa0ce){var _0x106fd7=[];values=_0x2aa0ce['dataValues'];_0x106fd7[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x53'),_0x2aa0ce[_0xbe9b('0x54')]));_0x106fd7[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x55'),_0x2aa0ce[_0xbe9b('0x54')]));_0x106fd7[_0xbe9b('0x50')](get_open_tabs('openchannel',_0x2aa0ce['dataValues']));_0x106fd7[_0xbe9b('0x50')](get_open_tabs(_0xbe9b('0x57'),_0x2aa0ce['dataValues']));_0x106fd7['push'](get_open_tabs(_0xbe9b('0x65'),_0x2aa0ce[_0xbe9b('0x54')]));_0x106fd7['push'](get_open_tabs(_0xbe9b('0x56'),_0x2aa0ce[_0xbe9b('0x54')]));return Promise[_0xbe9b('0x58')](_0x106fd7);})[_0xbe9b('0x2c')](function(_0x18b5cb){if(_0x18b5cb){var _0x323966=_[_0xbe9b('0x38')](values['ChatOpenTabs'],function(_0x1b44e9){return{'channel':'CHAT','id':_0x1b44e9['id'],'createdAt':_0x1b44e9['createdAt']};});var _0xcba395=_['map'](values['FaxOpenTabs'],function(_0x568b12){return{'channel':_0xbe9b('0xc1'),'id':_0x568b12['id'],'createdAt':_0x568b12[_0xbe9b('0xc2')]};});var _0x578be8=_[_0xbe9b('0x38')](values[_0xbe9b('0xc3')],function(_0x4d00b4){return{'channel':_0xbe9b('0xc4'),'id':_0x4d00b4['id'],'createdAt':_0x4d00b4[_0xbe9b('0xc2')]};});var _0x30fae6=_[_0xbe9b('0x38')](values[_0xbe9b('0xc5')],function(_0xd68105){return{'channel':_0xbe9b('0xc6'),'id':_0xd68105['id'],'createdAt':_0xd68105['createdAt']};});var _0x3e18b4=_[_0xbe9b('0x38')](values['SmsOpenTabs'],function(_0x35c024){return{'channel':_0xbe9b('0xc7'),'id':_0x35c024['id'],'createdAt':_0x35c024[_0xbe9b('0xc2')]};});var _0xad5cae=_[_0xbe9b('0x38')](values[_0xbe9b('0xc8')],function(_0x16adf9){return{'channel':'WHATSAPP','id':_0x16adf9['id'],'createdAt':_0x16adf9[_0xbe9b('0xc2')]};});var _0x41d4d3=_[_0xbe9b('0xc9')](_0x323966,_0xcba395,_0x578be8,_0x30fae6,_0x3e18b4,_0xad5cae);var _0x50e169={'count':_0x41d4d3[_0xbe9b('0x60')],'rows':_0x41d4d3};return _0x50e169;}else return null;})[_0xbe9b('0x2c')](respondWithResult(_0x37b551,null))[_0xbe9b('0x24')](handleError(_0x37b551,null));};exports[_0xbe9b('0xca')]=function(_0x2f734b,_0x315f7){var _0x133145={};var _0x4bd436={};var _0x34b5e0;var _0x6abd41;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x2f734b[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x315f7,null))[_0xbe9b('0x2c')](function(_0x4b0711){if(_0x4b0711){_0x34b5e0=_0x4b0711;_0x4bd436[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db[_0xbe9b('0xcb')][_0xbe9b('0x43')]);_0x4bd436['query']=_[_0xbe9b('0x5c')](_0x2f734b[_0xbe9b('0x4a')]);_0x4bd436[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x4bd436[_0xbe9b('0x5a')],_0x4bd436['query']);_0x133145[_0xbe9b('0x4f')]=_[_0xbe9b('0x5e')](_0x4bd436['model'],qs[_0xbe9b('0x5f')](_0x2f734b[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x133145['attributes']=_0x133145['attributes'][_0xbe9b('0x60')]?_0x133145[_0xbe9b('0x4f')]:_0x4bd436[_0xbe9b('0x5a')];_0x133145[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0x2f734b[_0xbe9b('0x4a')][_0xbe9b('0xcd')]);_0x133145[_0xbe9b('0xce')]=qs['filters'](_['pick'](_0x2f734b['query'],_0x4bd436[_0xbe9b('0x5d')]));if(_0x2f734b[_0xbe9b('0x4a')]['filter']){_0x133145['where']=_[_0xbe9b('0x62')](_0x133145[_0xbe9b('0xce')],{'$or':_[_0xbe9b('0x38')](_0x133145[_0xbe9b('0x4f')],function(_0x51f915){var _0x5be264={};_0x5be264[_0x51f915]={'$like':'%'+_0x2f734b[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x5be264;})});}_0x133145=_[_0xbe9b('0x62')]({},_0x133145,_0x2f734b['options']);return _0x34b5e0[_0xbe9b('0xca')](_0x133145);}})[_0xbe9b('0x2c')](function(_0x248643){if(_0x248643){_0x6abd41=_0x248643[_0xbe9b('0x60')];if(_0x2f734b[_0xbe9b('0x4a')]['hasOwnProperty'](_0xbe9b('0x61'))){_0x133145['include']=[{'model':db[_0xbe9b('0xcf')],'as':_0xbe9b('0xd0'),'required':![]},{'model':db[_0xbe9b('0xd1')],'as':'Tags','attributes':['id',_0xbe9b('0x3d'),_0xbe9b('0xd2')],'where':_0x2f734b[_0xbe9b('0x4a')][_0xbe9b('0xd3')]?{'id':_0x2f734b[_0xbe9b('0x4a')]['tag']}:undefined,'required':_0x2f734b['query'][_0xbe9b('0xd3')]?!![]:![]}];}if(!_0x2f734b[_0xbe9b('0x4a')][_0xbe9b('0xd4')]('nolimit')){_0x133145[_0xbe9b('0x28')]=qs[_0xbe9b('0x28')](_0x2f734b[_0xbe9b('0x4a')][_0xbe9b('0x28')]);_0x133145['offset']=qs[_0xbe9b('0x27')](_0x2f734b[_0xbe9b('0x4a')][_0xbe9b('0x27')]);}return _0x34b5e0[_0xbe9b('0xca')](_0x133145);}})[_0xbe9b('0x2c')](function(_0x3b8fc0){if(_0x3b8fc0){return _0x3b8fc0?{'count':_0x6abd41,'rows':_0x3b8fc0}:null;}})[_0xbe9b('0x2c')](respondWithResult(_0x315f7,null))[_0xbe9b('0x24')](handleError(_0x315f7,null));};exports[_0xbe9b('0xd5')]=function(_0x5c574a,_0x348bb3){var _0x18d187;var _0x5f0f54={};var _0x3c03c9;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x5c574a['params']['id']},'attributes':['id',_0xbe9b('0x3d'),_0xbe9b('0x3b')]})['then'](handleEntityNotFound(_0x348bb3,null))[_0xbe9b('0x2c')](function(_0x18141c){if(!utils[_0xbe9b('0xa7')](_0x5c574a[_0xbe9b('0x4a')]['channel'])){throw new db[(_0xbe9b('0x97'))][(_0xbe9b('0x95'))](_0xbe9b('0xa8'));}_0x18d187=_0x18141c;var _0x49c220={};_0x49c220[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db[_[_0xbe9b('0xaa')](_0x5c574a['query']['channel'])+_0xbe9b('0xd6')][_0xbe9b('0x43')]);_0x49c220[_0xbe9b('0x4a')]=_['keys'](_0x5c574a[_0xbe9b('0x4a')]);_0x49c220[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x49c220[_0xbe9b('0x5a')],_0x49c220[_0xbe9b('0x4a')]);_0x5f0f54[_0xbe9b('0x4f')]=_['intersection'](_0x49c220[_0xbe9b('0x5a')],qs[_0xbe9b('0x5f')](_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x5f0f54['attributes']=_0x5f0f54[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x5f0f54[_0xbe9b('0x4f')]:_0x49c220['model'];_0x5f0f54[_0xbe9b('0xcc')]=qs['sort'](_0x5c574a[_0xbe9b('0x4a')]['sort']);_0x5f0f54[_0xbe9b('0xce')]=qs[_0xbe9b('0x5d')](_['pick'](_0x5c574a[_0xbe9b('0x4a')],_0x49c220['filters']));if(_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0x47')]){_0x5f0f54[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x5f0f54[_0xbe9b('0xce')],{'$or':_['map'](_0x5f0f54['attributes'],function(_0x29c39d){var _0x11c1a1={};_0x11c1a1[_0x29c39d]={'$like':'%'+_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x11c1a1;})});}_0x5f0f54=_[_0xbe9b('0x62')]({},_0x5f0f54,_0x5c574a['options']);switch(_0x18d187[_0xbe9b('0x3b')]){case _0xbe9b('0x31'):return db[_[_0xbe9b('0xaa')](_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0xa3')])+_0xbe9b('0xd6')][_0xbe9b('0x51')](_0x5f0f54);case'user':case _0xbe9b('0x35'):return _0x18d187[_0xbe9b('0x30')+_[_0xbe9b('0xaa')](_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0xa3')])+'Queues'](_0x5f0f54);default:throw new db['Sequelize'][(_0xbe9b('0x95'))](_0xbe9b('0xd7'));}})['then'](function(_0x381f2b){_0x3c03c9=_0x381f2b[_0xbe9b('0x60')];if(!_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0xd4')](_0xbe9b('0xd8'))){_0x5f0f54['limit']=qs['limit'](_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0x28')]);_0x5f0f54[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0x27')]);}switch(_0x18d187['role']){case _0xbe9b('0x31'):return db[_[_0xbe9b('0xaa')](_0x5c574a[_0xbe9b('0x4a')][_0xbe9b('0xa3')])+'Queue'][_0xbe9b('0x51')](_0x5f0f54);case _0xbe9b('0x33'):case _0xbe9b('0x35'):return _0x18d187[_0xbe9b('0x30')+_[_0xbe9b('0xaa')](_0x5c574a[_0xbe9b('0x4a')]['channel'])+_0xbe9b('0xb2')](_0x5f0f54);}})[_0xbe9b('0x2c')](function(_0x396026){return{'count':_0x3c03c9,'rows':_0x396026};})[_0xbe9b('0x2c')](respondWithResult(_0x348bb3,null))[_0xbe9b('0x24')](handleError(_0x348bb3,null));};exports['getVoiceQueuesRt']=function(_0x330a29,_0x338645){var _0x3d2803={};var _0x51545e={};var _0x42f5e8;var _0x4ae4d5;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x330a29[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x338645,null))[_0xbe9b('0x2c')](function(_0x1b774b){if(_0x1b774b){_0x42f5e8=_0x1b774b;_0x51545e[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db[_0xbe9b('0xd9')][_0xbe9b('0x43')]);_0x51545e[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0x330a29[_0xbe9b('0x4a')]);_0x51545e[_0xbe9b('0x5d')]=_['intersection'](_0x51545e[_0xbe9b('0x5a')],_0x51545e[_0xbe9b('0x4a')]);_0x3d2803['attributes']=_['intersection'](_0x51545e[_0xbe9b('0x5a')],qs[_0xbe9b('0x5f')](_0x330a29[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x3d2803['attributes']=_0x3d2803[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x3d2803[_0xbe9b('0x4f')]:_0x51545e['model'];_0x3d2803[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0x330a29[_0xbe9b('0x4a')][_0xbe9b('0xcd')]);_0x3d2803[_0xbe9b('0xce')]=qs[_0xbe9b('0x5d')](_[_0xbe9b('0xda')](_0x330a29['query'],_0x51545e[_0xbe9b('0x5d')]));if(_0x330a29['query'][_0xbe9b('0x47')]){_0x3d2803[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x3d2803[_0xbe9b('0xce')],{'$or':_['map'](_0x3d2803[_0xbe9b('0x4f')],function(_0x1240e8){var _0x408fc9={};_0x408fc9[_0x1240e8]={'$like':'%'+_0x330a29[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x408fc9;})});}_0x3d2803=_[_0xbe9b('0x62')]({},_0x3d2803,_0x330a29[_0xbe9b('0x63')]);return _0x42f5e8[_0xbe9b('0xdb')](_0x3d2803);}})[_0xbe9b('0x2c')](function(_0x72e4cc){if(_0x72e4cc){_0x4ae4d5=_0x72e4cc[_0xbe9b('0x60')];if(!_0x330a29['query'][_0xbe9b('0xd4')]('nolimit')){_0x3d2803[_0xbe9b('0x28')]=qs[_0xbe9b('0x28')](_0x330a29['query']['limit']);_0x3d2803[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x330a29[_0xbe9b('0x4a')][_0xbe9b('0x27')]);}return _0x42f5e8[_0xbe9b('0xdb')](_0x3d2803);}})[_0xbe9b('0x2c')](function(_0x172abf){if(_0x172abf){return _0x172abf?{'count':_0x4ae4d5,'rows':_0x172abf}:null;}})[_0xbe9b('0x2c')](respondWithResult(_0x338645,null))[_0xbe9b('0x24')](handleError(_0x338645,null));};exports[_0xbe9b('0xdc')]=function(_0x5a7550,_0x3609c1){var _0x39680f={};var _0x2589fb={};var _0x5ed0c4;var _0x4cb748;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x5a7550[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x3609c1,null))['then'](function(_0x118001){if(_0x118001){_0x5ed0c4=_0x118001;_0x2589fb[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db['ChatGroup'][_0xbe9b('0x43')]);_0x2589fb[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0x5a7550[_0xbe9b('0x4a')]);_0x2589fb[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x2589fb[_0xbe9b('0x5a')],_0x2589fb[_0xbe9b('0x4a')]);_0x39680f[_0xbe9b('0x4f')]=_[_0xbe9b('0x5e')](_0x2589fb[_0xbe9b('0x5a')],qs[_0xbe9b('0x5f')](_0x5a7550[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x39680f[_0xbe9b('0x4f')]=_0x39680f['attributes'][_0xbe9b('0x60')]?_0x39680f[_0xbe9b('0x4f')]:_0x2589fb[_0xbe9b('0x5a')];_0x39680f[_0xbe9b('0xcc')]=qs['sort'](_0x5a7550[_0xbe9b('0x4a')][_0xbe9b('0xcd')]);_0x39680f['where']=qs[_0xbe9b('0x5d')](_[_0xbe9b('0xda')](_0x5a7550[_0xbe9b('0x4a')],_0x2589fb[_0xbe9b('0x5d')]));if(_0x5a7550['query'][_0xbe9b('0x47')]){_0x39680f['where']=_[_0xbe9b('0x62')](_0x39680f['where'],{'$or':_[_0xbe9b('0x38')](_0x39680f[_0xbe9b('0x4f')],function(_0x1233dd){var _0x7e1ce3={};_0x7e1ce3[_0x1233dd]={'$like':'%'+_0x5a7550[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x7e1ce3;})});}_0x39680f=_[_0xbe9b('0x62')]({},_0x39680f,_0x5a7550['options']);return _0x5ed0c4[_0xbe9b('0xdc')](_0x39680f);}})[_0xbe9b('0x2c')](function(_0x50241c){if(_0x50241c){_0x4cb748=_0x50241c[_0xbe9b('0x60')];if(!_0x5a7550[_0xbe9b('0x4a')][_0xbe9b('0xd4')]('nolimit')){_0x39680f[_0xbe9b('0x28')]=qs[_0xbe9b('0x28')](_0x5a7550[_0xbe9b('0x4a')][_0xbe9b('0x28')]);_0x39680f['offset']=qs[_0xbe9b('0x27')](_0x5a7550[_0xbe9b('0x4a')][_0xbe9b('0x27')]);}return _0x5ed0c4[_0xbe9b('0xdc')](_0x39680f);}})[_0xbe9b('0x2c')](function(_0x59a7d1){if(_0x59a7d1){return _0x59a7d1?{'count':_0x4cb748,'rows':_0x59a7d1}:null;}})[_0xbe9b('0x2c')](respondWithResult(_0x3609c1,null))[_0xbe9b('0x24')](handleError(_0x3609c1,null));};exports[_0xbe9b('0xdd')]=function(_0x32cfca,_0x22c191){var _0x58ac37={'raw':!![],'where':{}};var _0x49e9f8={};var _0xd1deb={'count':0x0,'rows':[]};return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x32cfca['params']['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x22c191,null))['then'](function(_0x54e2b0){if(_0x54e2b0){_0x49e9f8[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db['VoiceRecording']['rawAttributes']);_0x49e9f8[_0xbe9b('0x4a')]=_['keys'](_0x32cfca[_0xbe9b('0x4a')]);_0x49e9f8['filters']=_['intersection'](_0x49e9f8[_0xbe9b('0x5a')],_0x49e9f8['query']);_0x58ac37[_0xbe9b('0x4f')]=_[_0xbe9b('0x5e')](_0x49e9f8[_0xbe9b('0x5a')],qs[_0xbe9b('0x5f')](_0x32cfca[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x58ac37['attributes']=_0x58ac37[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x58ac37[_0xbe9b('0x4f')]:_0x49e9f8[_0xbe9b('0x5a')];if(!_0x32cfca[_0xbe9b('0x4a')]['hasOwnProperty'](_0xbe9b('0xd8'))){_0x58ac37[_0xbe9b('0x28')]=qs['limit'](_0x32cfca['query']['limit']);_0x58ac37[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x32cfca[_0xbe9b('0x4a')]['offset']);}_0x58ac37[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0x32cfca['query'][_0xbe9b('0xcd')]);_0x58ac37[_0xbe9b('0xce')]=qs[_0xbe9b('0x5d')](_[_0xbe9b('0xda')](_0x32cfca['query'],_0x49e9f8[_0xbe9b('0x5d')]));_0x58ac37['where']['UserId']=_0x54e2b0['id'];if(_0x32cfca['query'][_0xbe9b('0x47')]){_0x58ac37['where']=_['merge'](_0x58ac37[_0xbe9b('0xce')],{'$or':_[_0xbe9b('0x38')](_0x58ac37['attributes'],function(_0x110322){var _0x922c9f={};_0x922c9f[_0x110322]={'$like':'%'+_0x32cfca[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x922c9f;})});}_0x58ac37=_[_0xbe9b('0x62')]({},_0x58ac37,_0x32cfca[_0xbe9b('0x63')]);return db[_0xbe9b('0xde')][_0xbe9b('0x29')]({'where':_0x58ac37[_0xbe9b('0xce')]})[_0xbe9b('0x2c')](function(_0x15a809){_0xd1deb[_0xbe9b('0x29')]=_0x15a809;if(_0x32cfca[_0xbe9b('0x4a')]['includeAll']){_0x58ac37[_0xbe9b('0x4b')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x58ac37);})[_0xbe9b('0x2c')](function(_0x3e6773){_0xd1deb[_0xbe9b('0x52')]=_0x3e6773;return _0xd1deb;});}})[_0xbe9b('0x2c')](respondWithFilteredResult(_0x22c191,_0x58ac37))[_0xbe9b('0x24')](handleError(_0x22c191,null));};exports['getScreenRecordings']=function(_0xda9af2,_0x42834e){var _0x1f16cc={'raw':!![],'where':{}};var _0x3b5b87={};var _0x523166={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0xda9af2['params']['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x42834e,null))[_0xbe9b('0x2c')](function(_0x3433f4){if(_0x3433f4){_0x3b5b87[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db[_0xbe9b('0xdf')]['rawAttributes']);_0x3b5b87[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0xda9af2[_0xbe9b('0x4a')]);_0x3b5b87[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x3b5b87[_0xbe9b('0x5a')],_0x3b5b87['query']);_0x1f16cc['attributes']=_[_0xbe9b('0x5e')](_0x3b5b87[_0xbe9b('0x5a')],qs[_0xbe9b('0x5f')](_0xda9af2[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x1f16cc[_0xbe9b('0x4f')]=_0x1f16cc[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x1f16cc['attributes']:_0x3b5b87[_0xbe9b('0x5a')];if(!_0xda9af2[_0xbe9b('0x4a')][_0xbe9b('0xd4')](_0xbe9b('0xd8'))){_0x1f16cc['limit']=qs[_0xbe9b('0x28')](_0xda9af2[_0xbe9b('0x4a')]['limit']);_0x1f16cc[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0xda9af2[_0xbe9b('0x4a')]['offset']);}_0x1f16cc[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0xda9af2[_0xbe9b('0x4a')]['sort']);_0x1f16cc[_0xbe9b('0xce')]=qs['filters'](_['pick'](_0xda9af2[_0xbe9b('0x4a')],_0x3b5b87['filters']));_0x1f16cc['where']['UserId']=_0x3433f4['id'];if(_0xda9af2['query'][_0xbe9b('0x47')]){_0x1f16cc[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x1f16cc['where'],{'$or':_['map'](_0x1f16cc[_0xbe9b('0x4f')],function(_0x52928e){var _0x4550ec={};_0x4550ec[_0x52928e]={'$like':'%'+_0xda9af2[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x4550ec;})});}_0x1f16cc=_[_0xbe9b('0x62')]({},_0x1f16cc,_0xda9af2[_0xbe9b('0x63')]);return db[_0xbe9b('0xdf')][_0xbe9b('0x29')]({'where':_0x1f16cc[_0xbe9b('0xce')]})[_0xbe9b('0x2c')](function(_0x2636ab){_0x523166[_0xbe9b('0x29')]=_0x2636ab;if(_0xda9af2[_0xbe9b('0x4a')]['includeAll']){_0x1f16cc[_0xbe9b('0x4b')]=[{'all':!![]}];}return db[_0xbe9b('0xdf')][_0xbe9b('0x51')](_0x1f16cc);})[_0xbe9b('0x2c')](function(_0x5ec3de){_0x523166['rows']=_0x5ec3de;return _0x523166;});}})[_0xbe9b('0x2c')](respondWithFilteredResult(_0x42834e,_0x1f16cc))[_0xbe9b('0x24')](handleError(_0x42834e,null));};exports['getChatInteractions']=function(_0x12f3b9,_0x366f13){var _0x59f499={};var _0x7e62b7={};var _0x1bd912;var _0x15ea87;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x12f3b9[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x366f13,null))['then'](function(_0x501ae4){if(_0x501ae4){_0x1bd912=_0x501ae4;_0x7e62b7[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db[_0xbe9b('0xe0')][_0xbe9b('0x43')]);_0x7e62b7[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0x12f3b9['query']);_0x7e62b7[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x7e62b7[_0xbe9b('0x5a')],_0x7e62b7[_0xbe9b('0x4a')]);_0x59f499[_0xbe9b('0x4f')]=_[_0xbe9b('0x5e')](_0x7e62b7[_0xbe9b('0x5a')],qs[_0xbe9b('0x5f')](_0x12f3b9[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x59f499[_0xbe9b('0x4f')]=_0x59f499[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x59f499[_0xbe9b('0x4f')]:_0x7e62b7['model'];_0x59f499[_0xbe9b('0xcc')]=qs['sort'](_0x12f3b9['query'][_0xbe9b('0xcd')]);_0x59f499[_0xbe9b('0xce')]=qs[_0xbe9b('0x5d')](_[_0xbe9b('0xda')](_0x12f3b9[_0xbe9b('0x4a')],_0x7e62b7[_0xbe9b('0x5d')]));if(_0x12f3b9[_0xbe9b('0x4a')]['filter']){_0x59f499[_0xbe9b('0xce')]=_['merge'](_0x59f499['where'],{'$or':_['map'](_0x59f499[_0xbe9b('0x4f')],function(_0x3e00b0){var _0x2f2c06={};_0x2f2c06[_0x3e00b0]={'$like':'%'+_0x12f3b9[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x2f2c06;})});}_0x59f499=_[_0xbe9b('0x62')]({},_0x59f499,_0x12f3b9[_0xbe9b('0x63')]);return _0x1bd912[_0xbe9b('0xe1')](_0x59f499);}})[_0xbe9b('0x2c')](function(_0xda17a7){if(_0xda17a7){_0x15ea87=_0xda17a7['length'];if(!_0x12f3b9[_0xbe9b('0x4a')][_0xbe9b('0xd4')](_0xbe9b('0xd8'))){_0x59f499[_0xbe9b('0x28')]=qs['limit'](_0x12f3b9[_0xbe9b('0x4a')][_0xbe9b('0x28')]);_0x59f499['offset']=qs['offset'](_0x12f3b9[_0xbe9b('0x4a')]['offset']);}return _0x1bd912['getChatInteractions'](_0x59f499);}})['then'](function(_0x27a68b){if(_0x27a68b){return _0x27a68b?{'count':_0x15ea87,'rows':_0x27a68b}:null;}})['then'](respondWithResult(_0x366f13,null))[_0xbe9b('0x24')](handleError(_0x366f13,null));};exports[_0xbe9b('0xe2')]=function(_0x3bf597,_0x2af4a7){var _0x316b5d={};var _0x3d5c89={};var _0x3b6d2f;var _0x1a1fab;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x3bf597[_0xbe9b('0x67')]['id']}})['then'](handleEntityNotFound(_0x2af4a7,null))[_0xbe9b('0x2c')](function(_0x30d742){if(_0x30d742){_0x3b6d2f=_0x30d742;_0x3d5c89[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db[_0xbe9b('0xe3')][_0xbe9b('0x43')]);_0x3d5c89[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0x3bf597['query']);_0x3d5c89[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x3d5c89['model'],_0x3d5c89[_0xbe9b('0x4a')]);_0x316b5d[_0xbe9b('0x4f')]=_[_0xbe9b('0x5e')](_0x3d5c89['model'],qs[_0xbe9b('0x5f')](_0x3bf597['query'][_0xbe9b('0x5f')]));_0x316b5d[_0xbe9b('0x4f')]=_0x316b5d[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x316b5d['attributes']:_0x3d5c89[_0xbe9b('0x5a')];_0x316b5d[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0x3bf597['query'][_0xbe9b('0xcd')]);_0x316b5d[_0xbe9b('0xce')]=qs[_0xbe9b('0x5d')](_['pick'](_0x3bf597[_0xbe9b('0x4a')],_0x3d5c89[_0xbe9b('0x5d')]));if(_0x3bf597[_0xbe9b('0x4a')][_0xbe9b('0x47')]){_0x316b5d['where']=_['merge'](_0x316b5d[_0xbe9b('0xce')],{'$or':_[_0xbe9b('0x38')](_0x316b5d[_0xbe9b('0x4f')],function(_0x2aa377){var _0x16cf08={};_0x16cf08[_0x2aa377]={'$like':'%'+_0x3bf597[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x16cf08;})});}_0x316b5d=_[_0xbe9b('0x62')]({},_0x316b5d,_0x3bf597[_0xbe9b('0x63')]);return _0x3b6d2f[_0xbe9b('0xe2')](_0x316b5d);}})[_0xbe9b('0x2c')](function(_0x28495e){if(_0x28495e){_0x1a1fab=_0x28495e['length'];if(!_0x3bf597['query']['hasOwnProperty'](_0xbe9b('0xd8'))){_0x316b5d[_0xbe9b('0x28')]=qs[_0xbe9b('0x28')](_0x3bf597['query'][_0xbe9b('0x28')]);_0x316b5d[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x3bf597[_0xbe9b('0x4a')][_0xbe9b('0x27')]);}return _0x3b6d2f[_0xbe9b('0xe2')](_0x316b5d);}})[_0xbe9b('0x2c')](function(_0x13941a){if(_0x13941a){return _0x13941a?{'count':_0x1a1fab,'rows':_0x13941a}:null;}})[_0xbe9b('0x2c')](respondWithResult(_0x2af4a7,null))[_0xbe9b('0x24')](handleError(_0x2af4a7,null));};exports[_0xbe9b('0xe4')]=function(_0x51fe05,_0x62c3d4){var _0x82b1f5={'raw':!![],'where':{}};var _0xad888e={};var _0x4a37d9={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x51fe05[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x62c3d4,null))[_0xbe9b('0x2c')](function(_0x32e380){if(_0x32e380){_0xad888e['model']=_[_0xbe9b('0x5c')](db[_0xbe9b('0xe5')][_0xbe9b('0x43')]);_0xad888e[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0x51fe05[_0xbe9b('0x4a')]);_0xad888e[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0xad888e[_0xbe9b('0x5a')],_0xad888e[_0xbe9b('0x4a')]);_0x82b1f5[_0xbe9b('0x4f')]=_[_0xbe9b('0x5e')](_0xad888e[_0xbe9b('0x5a')],qs['fields'](_0x51fe05['query'][_0xbe9b('0x5f')]));_0x82b1f5['attributes']=_0x82b1f5[_0xbe9b('0x4f')]['length']?_0x82b1f5['attributes']:_0xad888e['model'];if(!_0x51fe05[_0xbe9b('0x4a')][_0xbe9b('0xd4')](_0xbe9b('0xd8'))){_0x82b1f5[_0xbe9b('0x28')]=qs['limit'](_0x51fe05[_0xbe9b('0x4a')][_0xbe9b('0x28')]);_0x82b1f5[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x51fe05['query'][_0xbe9b('0x27')]);}_0x82b1f5[_0xbe9b('0xcc')]=qs['sort'](_0x51fe05[_0xbe9b('0x4a')]['sort']);_0x82b1f5['where']=qs[_0xbe9b('0x5d')](_['pick'](_0x51fe05['query'],_0xad888e[_0xbe9b('0x5d')]));_0x82b1f5[_0xbe9b('0xce')][_0xbe9b('0xe6')]=_0x32e380['id'];if(_0x51fe05['query']['filter']){_0x82b1f5[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x82b1f5['where'],{'$or':_['map'](_0x82b1f5[_0xbe9b('0x4f')],function(_0x2efe48){var _0x4cd645={};_0x4cd645[_0x2efe48]={'$like':'%'+_0x51fe05[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x4cd645;})});}_0x82b1f5=_[_0xbe9b('0x62')]({},_0x82b1f5,_0x51fe05[_0xbe9b('0x63')]);return db[_0xbe9b('0xe5')][_0xbe9b('0x29')]({'where':_0x82b1f5[_0xbe9b('0xce')]})['then'](function(_0x302a61){_0x4a37d9[_0xbe9b('0x29')]=_0x302a61;if(_0x51fe05[_0xbe9b('0x4a')][_0xbe9b('0x61')]){_0x82b1f5['include']=[{'all':!![]}];}return db[_0xbe9b('0xe5')][_0xbe9b('0x51')](_0x82b1f5);})[_0xbe9b('0x2c')](function(_0x1cfd8a){_0x4a37d9[_0xbe9b('0x52')]=_0x1cfd8a;return _0x4a37d9;});}})['then'](respondWithFilteredResult(_0x62c3d4,_0x82b1f5))[_0xbe9b('0x24')](handleError(_0x62c3d4,null));};exports[_0xbe9b('0xe7')]=function(_0x385300,_0x8c4d09){var _0xccf4e7={};var _0x1c040f={};var _0x2e2722;var _0x2b9da8;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x385300[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x8c4d09,null))[_0xbe9b('0x2c')](function(_0x20c2ba){if(_0x20c2ba){_0x2e2722=_0x20c2ba;_0x1c040f['model']=_[_0xbe9b('0x5c')](db[_0xbe9b('0xe8')][_0xbe9b('0x43')]);_0x1c040f[_0xbe9b('0x4a')]=_['keys'](_0x385300[_0xbe9b('0x4a')]);_0x1c040f['filters']=_[_0xbe9b('0x5e')](_0x1c040f['model'],_0x1c040f[_0xbe9b('0x4a')]);_0xccf4e7[_0xbe9b('0x4f')]=_['intersection'](_0x1c040f[_0xbe9b('0x5a')],qs[_0xbe9b('0x5f')](_0x385300[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0xccf4e7['attributes']=_0xccf4e7[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0xccf4e7[_0xbe9b('0x4f')]:_0x1c040f['model'];_0xccf4e7[_0xbe9b('0xcc')]=qs['sort'](_0x385300['query'][_0xbe9b('0xcd')]);_0xccf4e7[_0xbe9b('0xce')]=qs['filters'](_[_0xbe9b('0xda')](_0x385300[_0xbe9b('0x4a')],_0x1c040f[_0xbe9b('0x5d')]));if(_0x385300[_0xbe9b('0x4a')][_0xbe9b('0x47')]){_0xccf4e7[_0xbe9b('0xce')]=_['merge'](_0xccf4e7[_0xbe9b('0xce')],{'$or':_[_0xbe9b('0x38')](_0xccf4e7[_0xbe9b('0x4f')],function(_0x282c21){var _0x1ec425={};_0x1ec425[_0x282c21]={'$like':'%'+_0x385300['query'][_0xbe9b('0x47')]+'%'};return _0x1ec425;})});}_0xccf4e7=_[_0xbe9b('0x62')]({},_0xccf4e7,_0x385300[_0xbe9b('0x63')]);return _0x2e2722[_0xbe9b('0xe7')](_0xccf4e7);}})[_0xbe9b('0x2c')](function(_0x28522c){if(_0x28522c){_0x2b9da8=_0x28522c[_0xbe9b('0x60')];if(!_0x385300['query']['hasOwnProperty']('nolimit')){_0xccf4e7[_0xbe9b('0x28')]=qs[_0xbe9b('0x28')](_0x385300[_0xbe9b('0x4a')][_0xbe9b('0x28')]);_0xccf4e7[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x385300[_0xbe9b('0x4a')][_0xbe9b('0x27')]);}return _0x2e2722[_0xbe9b('0xe7')](_0xccf4e7);}})[_0xbe9b('0x2c')](function(_0x30baf2){if(_0x30baf2){return _0x30baf2?{'count':_0x2b9da8,'rows':_0x30baf2}:null;}})['then'](respondWithResult(_0x8c4d09,null))[_0xbe9b('0x24')](handleError(_0x8c4d09,null));};exports[_0xbe9b('0xe9')]=function(_0x914142,_0x5c91a){var _0x54a27d={};var _0xcd372b={};var _0x5a2a85;var _0x3a6893;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x914142['params']['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x5c91a,null))[_0xbe9b('0x2c')](function(_0x595002){if(_0x595002){_0x5a2a85=_0x595002;_0xcd372b['model']=_[_0xbe9b('0x5c')](db[_0xbe9b('0xea')][_0xbe9b('0x43')]);_0xcd372b[_0xbe9b('0x4a')]=_['keys'](_0x914142[_0xbe9b('0x4a')]);_0xcd372b[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0xcd372b[_0xbe9b('0x5a')],_0xcd372b[_0xbe9b('0x4a')]);_0x54a27d[_0xbe9b('0x4f')]=_[_0xbe9b('0x5e')](_0xcd372b['model'],qs['fields'](_0x914142[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x54a27d[_0xbe9b('0x4f')]=_0x54a27d[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x54a27d[_0xbe9b('0x4f')]:_0xcd372b['model'];_0x54a27d[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0x914142['query'][_0xbe9b('0xcd')]);_0x54a27d['where']=qs['filters'](_['pick'](_0x914142[_0xbe9b('0x4a')],_0xcd372b[_0xbe9b('0x5d')]));if(_0x914142[_0xbe9b('0x4a')][_0xbe9b('0x47')]){_0x54a27d[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x54a27d[_0xbe9b('0xce')],{'$or':_[_0xbe9b('0x38')](_0x54a27d['attributes'],function(_0x3265f7){var _0x1168b0={};_0x1168b0[_0x3265f7]={'$like':'%'+_0x914142[_0xbe9b('0x4a')]['filter']+'%'};return _0x1168b0;})});}_0x54a27d=_['merge']({},_0x54a27d,_0x914142[_0xbe9b('0x63')]);return _0x5a2a85[_0xbe9b('0xe9')](_0x54a27d);}})[_0xbe9b('0x2c')](function(_0x2ba194){if(_0x2ba194){_0x3a6893=_0x2ba194[_0xbe9b('0x60')];if(!_0x914142[_0xbe9b('0x4a')][_0xbe9b('0xd4')](_0xbe9b('0xd8'))){_0x54a27d['limit']=qs[_0xbe9b('0x28')](_0x914142['query'][_0xbe9b('0x28')]);_0x54a27d[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x914142[_0xbe9b('0x4a')][_0xbe9b('0x27')]);}return _0x5a2a85[_0xbe9b('0xe9')](_0x54a27d);}})[_0xbe9b('0x2c')](function(_0x237b64){if(_0x237b64){return _0x237b64?{'count':_0x3a6893,'rows':_0x237b64}:null;}})[_0xbe9b('0x2c')](respondWithResult(_0x5c91a,null))[_0xbe9b('0x24')](handleError(_0x5c91a,null));};exports['getWhatsappInteractions']=function(_0x300823,_0x14ad31){var _0x5c34a5={};var _0x220dff={};var _0x29cee9;var _0x368528;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x300823['params']['id']}})['then'](handleEntityNotFound(_0x14ad31,null))[_0xbe9b('0x2c')](function(_0x31d246){if(_0x31d246){_0x29cee9=_0x31d246;_0x220dff[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db['WhatsappInteraction']['rawAttributes']);_0x220dff[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0x300823[_0xbe9b('0x4a')]);_0x220dff[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x220dff[_0xbe9b('0x5a')],_0x220dff[_0xbe9b('0x4a')]);_0x5c34a5[_0xbe9b('0x4f')]=_['intersection'](_0x220dff['model'],qs['fields'](_0x300823[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x5c34a5['attributes']=_0x5c34a5[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x5c34a5[_0xbe9b('0x4f')]:_0x220dff['model'];_0x5c34a5[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0x300823[_0xbe9b('0x4a')][_0xbe9b('0xcd')]);_0x5c34a5['where']=qs[_0xbe9b('0x5d')](_[_0xbe9b('0xda')](_0x300823[_0xbe9b('0x4a')],_0x220dff['filters']));if(_0x300823[_0xbe9b('0x4a')][_0xbe9b('0x47')]){_0x5c34a5[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x5c34a5[_0xbe9b('0xce')],{'$or':_['map'](_0x5c34a5[_0xbe9b('0x4f')],function(_0x307e54){var _0x2c7c96={};_0x2c7c96[_0x307e54]={'$like':'%'+_0x300823[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x2c7c96;})});}_0x5c34a5=_[_0xbe9b('0x62')]({},_0x5c34a5,_0x300823[_0xbe9b('0x63')]);return _0x29cee9[_0xbe9b('0xeb')](_0x5c34a5);}})[_0xbe9b('0x2c')](function(_0x13468e){if(_0x13468e){_0x368528=_0x13468e[_0xbe9b('0x60')];if(!_0x300823[_0xbe9b('0x4a')][_0xbe9b('0xd4')]('nolimit')){_0x5c34a5[_0xbe9b('0x28')]=qs[_0xbe9b('0x28')](_0x300823[_0xbe9b('0x4a')]['limit']);_0x5c34a5[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x300823[_0xbe9b('0x4a')][_0xbe9b('0x27')]);}return _0x29cee9['getWhatsappInteractions'](_0x5c34a5);}})[_0xbe9b('0x2c')](function(_0x50721b){if(_0x50721b){return _0x50721b?{'count':_0x368528,'rows':_0x50721b}:null;}})[_0xbe9b('0x2c')](respondWithResult(_0x14ad31,null))[_0xbe9b('0x24')](handleError(_0x14ad31,null));};exports[_0xbe9b('0xec')]=function(_0x263ae,_0x30cebd,_0xbc8b75){var _0x5c19c0;var _0x1f8a35;var _0x6f9ddf;var _0x262f8c=!_['isNil'](_0x263ae[_0xbe9b('0x67')]['id'])?_0x263ae[_0xbe9b('0x67')]['id']:!_[_0xbe9b('0x71')](_0x263ae['user']['id'])?_0x263ae['user']['id']:null;return db[_0xbe9b('0x42')]['find']({'where':{'id':_0x262f8c,'role':{'$or':['admin',_0xbe9b('0x33'),_0xbe9b('0x35')]}},'attributes':['id','name',_0xbe9b('0xed'),_0xbe9b('0xee'),_0xbe9b('0x3b'),_0xbe9b('0x6b'),_0xbe9b('0xef')]})[_0xbe9b('0x2c')](function(_0xab08ec){if(_0xab08ec){if(_0xab08ec['role']===_0xbe9b('0x35')){_0x5c19c0=_0xab08ec;if(_0x263ae['body'][_0xbe9b('0xa6')]){_0x6f9ddf=util[_0xbe9b('0xf0')](_0xbe9b('0xf1'),_0x5c19c0[_0x263ae[_0xbe9b('0x66')]['interface']]);}else if(_0x263ae[_0xbe9b('0x66')][_0xbe9b('0xf2')]){_0x6f9ddf=util['format'](_0xbe9b('0xf3'),_0x263ae[_0xbe9b('0x66')][_0xbe9b('0xf2')]);}else{_0x6f9ddf=util[_0xbe9b('0xf0')](_0xbe9b('0xf3'),_0x5c19c0[_0xbe9b('0x3d')]);}socket['to'](util[_0xbe9b('0xf0')](_0xbe9b('0xf4'),_0x5c19c0[_0xbe9b('0x3d')]))[_0xbe9b('0x2d')](_0xbe9b('0xf5'),{'user':{'id':_0x5c19c0['id'],'name':_0x5c19c0[_0xbe9b('0x3d')]},'ip':_0x263ae[_0xbe9b('0xf6')][_0xbe9b('0xf7')]||_0x263ae[_0xbe9b('0xf8')]['remoteAddress']||_0x263ae['socket'][_0xbe9b('0xf9')]||_0x263ae[_0xbe9b('0xf8')][_0xbe9b('0xfa')][_0xbe9b('0xf9')]});return db[_0xbe9b('0xd9')][_0xbe9b('0x2f')]({'where':{'membername':_0x5c19c0['name']},'individualHooks':!![]});}}else{throw new db[(_0xbe9b('0x97'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xbe9b('0x2c')](function(){if(_0x5c19c0){return _0x5c19c0['getVoiceQueues']({'raw':!![]});}})[_0xbe9b('0x2c')](function(_0x160923){if(_0x5c19c0){if(_0x160923){_0x1f8a35=_0x160923;if(_0x1f8a35[_0xbe9b('0x60')]){var _0x4614cb=_0x1f8a35[_0xbe9b('0x38')](function(_0x89c307){var _0x3c907e={'membername':_0x5c19c0[_0xbe9b('0x3d')],'UserId':_0x5c19c0['id'],'queue_name':_0x89c307[_0xbe9b('0x3d')],'VoiceQueueId':_0x89c307['id'],'interface':_0x6f9ddf,'paused':_0x5c19c0[_0xbe9b('0xef')]||![],'penalty':_0x89c307['UserVoiceQueue.penalty']||0x0};return db[_0xbe9b('0xd9')][_0xbe9b('0xb0')](_0x3c907e);});return Promise[_0xbe9b('0x58')](_0x4614cb);}}}})['then'](function(){if(_0x5c19c0){return db[_0xbe9b('0xfb')]['findAll']({'where':{'membername':_0x5c19c0['name'],'exitAt':null}});}})['then'](function(_0x35c919){if(_0x5c19c0){var _0x7b438e=[];_0x35c919['forEach'](function(_0x3785cb){_0x7b438e[_0xbe9b('0x50')](_0x3785cb[_0xbe9b('0x2b')]({'exitAt':moment()[_0xbe9b('0xf0')](_0xbe9b('0xfc'))}));});return Promise[_0xbe9b('0x58')](_0x7b438e);}})[_0xbe9b('0x2c')](function(){if(_0x5c19c0){var _0x364e30=[];var _0x2d2169=[];var _0x51994d=utils['getChannels']();var _0x1c1b49={'membername':_0x5c19c0[_0xbe9b('0x3d')],'interface':_0x6f9ddf,'enterAt':moment()[_0xbe9b('0xf0')](_0xbe9b('0xfc')),'role':_0x5c19c0['role'],'internal':_0x5c19c0[_0xbe9b('0x6b')]};_0x51994d[_0xbe9b('0xfd')](function(_0x42a589){_0x364e30[_0xbe9b('0x50')](_[_0xbe9b('0x62')]({'channel':_0x42a589,'type':_0xbe9b('0xfe'),'data1':_0x263ae[_0xbe9b('0x66')]['device'],'data2':_0x6f9ddf},_0x1c1b49));if(_0x5c19c0['loginInPause']){_0x2d2169[_0xbe9b('0x50')](_[_0xbe9b('0x62')]({'channel':_0x42a589,'type':'PAUSE','data1':'LOGININPAUSE'},_0x1c1b49));}});return db[_0xbe9b('0xfb')][_0xbe9b('0x8d')](_0x364e30['concat'](_0x2d2169),{'individualHooks':!![]});}})[_0xbe9b('0x2c')](function(){if(_0x5c19c0){return _0x5c19c0[_0xbe9b('0x2b')]({'online':!![],'lastLoginAt':moment()[_0xbe9b('0xf0')](_0xbe9b('0xfc')),'voicePause':_0x5c19c0[_0xbe9b('0xef')]||![],'mailPause':_0x5c19c0[_0xbe9b('0xef')]||![],'chatPause':_0x5c19c0[_0xbe9b('0xef')]||![],'faxPause':_0x5c19c0[_0xbe9b('0xef')]||![],'smsPause':_0x5c19c0[_0xbe9b('0xef')]||![],'openchannelPause':_0x5c19c0[_0xbe9b('0xef')]||![],'whatsappPause':_0x5c19c0[_0xbe9b('0xef')]||![],'pauseType':_0x5c19c0[_0xbe9b('0xef')]?_0xbe9b('0xff'):null,'interface':_0x6f9ddf,'lastPauseAt':moment()[_0xbe9b('0xf0')](_0xbe9b('0xfc'))});}})[_0xbe9b('0x2c')](function(_0x2ee396){if(_0x263ae[_0xbe9b('0x100')]){return _0xbc8b75();}else{return Promise['resolve'](_0x2ee396)[_0xbe9b('0x2c')](respondWithResult(_0x30cebd,null));}})['catch'](handleError(_0x30cebd,null));};exports[_0xbe9b('0x101')]=function(_0x27cf84,_0x3fab78){var _0x410892;return db[_0xbe9b('0x42')][_0xbe9b('0x3c')]({'where':{'id':_0x27cf84[_0xbe9b('0x67')]['id'],'role':_0xbe9b('0x35')},'attributes':['id','name',_0xbe9b('0x3b')]})['then'](handleEntityNotFound(_0x3fab78,null))['then'](function(_0x5d9abe){if(_0x5d9abe){_0x410892=_0x5d9abe;return db[_0xbe9b('0xd9')][_0xbe9b('0x2f')]({'where':{'membername':_0x410892[_0xbe9b('0x3d')]},'individualHooks':!![]});}})[_0xbe9b('0x2c')](function(){return db[_0xbe9b('0xfb')][_0xbe9b('0x51')]({'where':{'membername':_0x410892[_0xbe9b('0x3d')],'exitAt':null}});})[_0xbe9b('0x2c')](function(_0x6afb0a){var _0xc518d1=[];_0x6afb0a[_0xbe9b('0xfd')](function(_0x34be73){_0xc518d1[_0xbe9b('0x50')](_0x34be73[_0xbe9b('0x2b')]({'exitAt':moment()[_0xbe9b('0xf0')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0xc518d1);})[_0xbe9b('0x2c')](function(){return _0x410892[_0xbe9b('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xbe9b('0x2c')](respondWithResult(_0x3fab78,null))[_0xbe9b('0x24')](handleError(_0x3fab78,null));};exports[_0xbe9b('0x102')]=function(_0xb84e18,_0x64a805){var _0x52901a;return db[_0xbe9b('0xd9')]['update']({'paused':0x1},{'where':{'UserId':_0xb84e18[_0xbe9b('0x67')]['id']},'individualHooks':!![]})[_0xbe9b('0x2c')](function(){return db['User']['find']({'where':{'id':_0xb84e18[_0xbe9b('0x67')]['id'],'role':'agent'},'attributes':['id',_0xbe9b('0x3d'),'role',_0xbe9b('0x6b'),_0xbe9b('0xa6'),_0xbe9b('0xa4')]});})['then'](handleEntityNotFound(_0x64a805,null))['then'](function(_0x1b23b5){if(_0x1b23b5){_0x52901a=_0x1b23b5;return respondWithRpcPromise(_0xbe9b('0x103'),_0xbe9b('0x102'),{'id':_0x52901a['id'],'name':_0x52901a[_0xbe9b('0x3d')],'pause':!![]});}})[_0xbe9b('0x2c')](function(){if(_0x52901a){return db['MemberReport'][_0xbe9b('0x51')]({'where':{'membername':_0x52901a[_0xbe9b('0x3d')],'type':'PAUSE','exitAt':null}});}})[_0xbe9b('0x2c')](function(_0xb358cd){if(_0xb358cd['length']){var _0x4939d5=moment()[_0xbe9b('0xf0')](_0xbe9b('0xfc'));for(var _0x38cf5f=0x0,_0x1f66d0=_0xb358cd[_0xbe9b('0x60')];_0x38cf5f<_0x1f66d0;_0x38cf5f++){_0xb358cd[_0x38cf5f][_0xbe9b('0x104')]({'exitAt':_0x4939d5});}}})[_0xbe9b('0x2c')](function(){var _0x4293d3=[];var _0x39a5cd=utils[_0xbe9b('0x105')]();_0x39a5cd[_0xbe9b('0xfd')](function(_0x4cf0df){_0x4293d3[_0xbe9b('0x50')]({'channel':_0x4cf0df,'membername':_0x52901a[_0xbe9b('0x3d')],'interface':_[_0xbe9b('0x71')](_0x52901a[_0xbe9b('0xa6')])?util[_0xbe9b('0xf0')](_0xbe9b('0xf3'),_0x52901a[_0xbe9b('0x3d')]):_0x52901a[_0xbe9b('0xa6')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xb84e18[_0xbe9b('0x66')][_0xbe9b('0x45')]||_0xbe9b('0x106'),'role':_0x52901a[_0xbe9b('0x3b')],'internal':_0x52901a['internal']});});return db[_0xbe9b('0xfb')]['bulkCreate'](_0x4293d3,{'individualHooks':!![]});})[_0xbe9b('0x2c')](function(){return _0x52901a['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0xb84e18[_0xbe9b('0x66')][_0xbe9b('0x45')]||_0xbe9b('0x106'),'lastPauseAt':moment()['format'](_0xbe9b('0xfc'))});})[_0xbe9b('0x2c')](respondWithResult(_0x64a805,null))['catch'](handleError(_0x64a805,null));};exports[_0xbe9b('0x107')]=function(_0x5a9dcd,_0x322278){if(_0x5a9dcd[_0xbe9b('0x66')][_0xbe9b('0xa3')]&&!utils[_0xbe9b('0xa7')](_0x5a9dcd['body'][_0xbe9b('0xa3')])){throw new APIBadRequestError(util[_0xbe9b('0xf0')](_0xbe9b('0x108'),_0x5a9dcd[_0xbe9b('0x66')][_0xbe9b('0xa3')]));}return db['User'][_0xbe9b('0x3c')]({'where':{'id':_0x5a9dcd['params']['id']},'attributes':['id','name',_0xbe9b('0x3b'),_0xbe9b('0x6b'),_0xbe9b('0xa6'),'online',_0xbe9b('0xa5'),_0xbe9b('0x109'),_0xbe9b('0x10a'),_0xbe9b('0x10b'),_0xbe9b('0x10c'),_0xbe9b('0x10d'),_0xbe9b('0x10e'),'pauseType',_0xbe9b('0x10f')]})['then'](function(_0x28fad1){if(!_0x28fad1){throw new APINotFoundError(util['format'](_0xbe9b('0x110'),_0x5a9dcd['params']['id']));}return _0x28fad1[_0xbe9b('0x107')](_0x5a9dcd['body'][_0xbe9b('0xa3')]);})['then'](respondWithResult(_0x322278,null))['catch'](APIHandleError(_0x322278));};exports[_0xbe9b('0x111')]=function(_0x369736,_0x2478b8){var _0x537a22={};var _0xacccce={};var _0xb5a9da;var _0x4a6f11;return db[_0xbe9b('0x42')]['findOne']({'where':{'id':_0x369736[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x2478b8,null))[_0xbe9b('0x2c')](function(_0x20f758){if(_0x20f758){_0xb5a9da=_0x20f758;_0xacccce[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db['Team'][_0xbe9b('0x43')]);_0xacccce['query']=_[_0xbe9b('0x5c')](_0x369736[_0xbe9b('0x4a')]);_0xacccce[_0xbe9b('0x5d')]=_['intersection'](_0xacccce[_0xbe9b('0x5a')],_0xacccce[_0xbe9b('0x4a')]);_0x537a22[_0xbe9b('0x4f')]=_[_0xbe9b('0x5e')](_0xacccce[_0xbe9b('0x5a')],qs[_0xbe9b('0x5f')](_0x369736[_0xbe9b('0x4a')][_0xbe9b('0x5f')]));_0x537a22[_0xbe9b('0x4f')]=_0x537a22[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x537a22[_0xbe9b('0x4f')]:_0xacccce[_0xbe9b('0x5a')];_0x537a22['order']=qs[_0xbe9b('0xcd')](_0x369736[_0xbe9b('0x4a')]['sort']);_0x537a22[_0xbe9b('0xce')]=qs[_0xbe9b('0x5d')](_[_0xbe9b('0xda')](_0x369736[_0xbe9b('0x4a')],_0xacccce[_0xbe9b('0x5d')]));if(_0x369736[_0xbe9b('0x4a')]['filter']){_0x537a22[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x537a22[_0xbe9b('0xce')],{'$or':_[_0xbe9b('0x38')](_0x537a22[_0xbe9b('0x4f')],function(_0x304d2f){var _0x58a178={};_0x58a178[_0x304d2f]={'$like':'%'+_0x369736[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x58a178;})});}_0x537a22=_['merge']({},_0x537a22,_0x369736[_0xbe9b('0x63')]);return _0xb5a9da[_0xbe9b('0x111')](_0x537a22);}})[_0xbe9b('0x2c')](function(_0x3afdb9){if(_0x3afdb9){_0x4a6f11=_0x3afdb9[_0xbe9b('0x60')];if(!_0x369736['query']['hasOwnProperty'](_0xbe9b('0xd8'))){_0x537a22[_0xbe9b('0x28')]=qs[_0xbe9b('0x28')](_0x369736[_0xbe9b('0x4a')][_0xbe9b('0x28')]);_0x537a22[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x369736['query'][_0xbe9b('0x27')]);}return _0xb5a9da['getTeams'](_0x537a22);}})[_0xbe9b('0x2c')](function(_0x4e4392){if(_0x4e4392){return _0x4e4392?{'count':_0x4a6f11,'rows':_0x4e4392}:null;}})[_0xbe9b('0x2c')](respondWithResult(_0x2478b8,null))[_0xbe9b('0x24')](handleError(_0x2478b8,null));};exports['addTeams']=function(_0x1db531,_0x5953e9){var _0x5d827d=_0x1db531[_0xbe9b('0x67')]['id'];var _0x4f51c7=_0x1db531[_0xbe9b('0x66')]?_0x1db531[_0xbe9b('0x66')][_0xbe9b('0xac')]:null;var _0x4454ad=[];return Promise[_0xbe9b('0x112')]()[_0xbe9b('0x2c')](function(){if(!_0x4f51c7)throw new APIBadRequestError(_0xbe9b('0x113'));})[_0xbe9b('0x2c')](function(){return db['User'][_0xbe9b('0x9b')]({'where':{'id':_0x5d827d}});})['then'](function(_0x5c3ba9){if(!_0x5c3ba9)throw new APINotFoundError(util[_0xbe9b('0xf0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x1db531['params']['id']));return db[_0xbe9b('0x72')][_0xbe9b('0x114')](function(_0x469258){return _0x5c3ba9[_0xbe9b('0x115')](_0x4f51c7,{'transaction':_0x469258})[_0xbe9b('0x2c')](function(){return db[_0xbe9b('0x116')]['findAll']({'where':{'id':{'$in':_0x4f51c7}}});})['then'](function(_0x531785){var _0xff6516=_[_0xbe9b('0x38')](_0x531785,function(_0xd38b9c){return _0xd38b9c[_0xbe9b('0x117')]();});return Promise[_0xbe9b('0x58')](_0xff6516);})[_0xbe9b('0x2c')](function(_0x89eed3){_0x4454ad=_[_0xbe9b('0x118')](_0x89eed3);var _0x2de8c9=_[_0xbe9b('0x38')](_0x4454ad,function(_0xb71148){return _0xb71148[_0xbe9b('0x119')](_0x5c3ba9['id'],{'transaction':_0x469258});});return Promise['all'](_0x2de8c9);})[_0xbe9b('0x2c')](function(){if(!_0x5c3ba9[_0xbe9b('0xa4')])return;var _0xc689d9=_[_0xbe9b('0x47')](_0x4454ad,function(_0x2e1793){return _0x2e1793[_0xbe9b('0x11a')](_0xbe9b('0xa3'))===_0xbe9b('0x11b');});var _0x3ad1b4=_[_0xbe9b('0x38')](_0xc689d9,function(_0x386a63){return db[_0xbe9b('0xd9')][_0xbe9b('0xb0')]({'membername':_0x5c3ba9['name'],'UserId':_0x5c3ba9['id'],'queue_name':_0x386a63[_0xbe9b('0x3d')],'VoiceQueueId':_0x386a63['id'],'interface':_[_0xbe9b('0x71')](_0x5c3ba9[_0xbe9b('0xa6')])?util['format'](_0xbe9b('0xf3'),_0x5c3ba9[_0xbe9b('0x3d')]):_0x5c3ba9['interface'],'paused':_0x5c3ba9['voicePause']||![],'penalty':_0x5c3ba9[_0xbe9b('0xad')]},{'transaction':_0x469258});});return Promise[_0xbe9b('0x58')](_0x3ad1b4);})[_0xbe9b('0x2c')](function(){return db[_0xbe9b('0x11c')][_0xbe9b('0x51')]({'where':{'teamId':{'$in':_0x4f51c7}}});})[_0xbe9b('0x2c')](function(_0x285f2b){var _0x32f20e=_[_0xbe9b('0x38')](_0x285f2b,function(_0x2c058d){return db[_0xbe9b('0x11d')]['create']({'UserId':_0x5c3ba9['id'],'VoicePrefixId':_0x2c058d[_0xbe9b('0x11e')]},{'transaction':_0x469258});});return Promise[_0xbe9b('0x58')](_0x32f20e);});});})[_0xbe9b('0x2c')](function(){for(var _0xe973f7=0x0;_0xe973f7<_0x4454ad['length'];_0xe973f7++){var _0x42b0ff=_0x4454ad[_0xe973f7]['getDataValue'](_0xbe9b('0xa3'));var _0x24141a=_0x42b0ff+_0xbe9b('0xb4');socket[_0xbe9b('0x2d')](_0xbe9b('0x33')+_0x42b0ff+_0xbe9b('0xae'),{'UserId':_0x5d827d,['queueField']:_0x4454ad[_0xe973f7]['id']});}})[_0xbe9b('0x2c')](respondWithStatusCode(_0x5953e9,null))['catch'](APIHandleError(_0x5953e9));};exports[_0xbe9b('0x11f')]=function(_0x307cc0,_0x20b54a){var _0x45db5d=_0x307cc0[_0xbe9b('0x67')]['id'];var _0x44e412=null;if(_0x307cc0[_0xbe9b('0x4a')][_0xbe9b('0xac')]){_0x44e412=_[_0xbe9b('0xb3')](_0x307cc0[_0xbe9b('0x4a')][_0xbe9b('0xac')])?_0x307cc0[_0xbe9b('0x4a')]['ids']:[_0x307cc0['query']['ids']];}var _0xeed9bf=[];return Promise[_0xbe9b('0x112')]()[_0xbe9b('0x2c')](function(){if(!_0x44e412)throw new APIBadRequestError(_0xbe9b('0x120'));})[_0xbe9b('0x2c')](function(){return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x45db5d}});})['then'](function(_0x2d3a4e){if(!_0x2d3a4e)throw new APINotFoundError(util[_0xbe9b('0xf0')](_0xbe9b('0x110'),_0x307cc0['params']['id']));return db[_0xbe9b('0x72')][_0xbe9b('0x114')](function(_0x422dbb){return _0x2d3a4e[_0xbe9b('0x11f')](_0x44e412,{'transaction':_0x422dbb})[_0xbe9b('0x2c')](function(){return db[_0xbe9b('0x116')][_0xbe9b('0x51')]({'where':{'id':{'$in':_0x44e412}}});})['then'](function(_0x3f152){var _0x35a4cc=_[_0xbe9b('0x38')](_0x3f152,function(_0x3fb90d){return _0x3fb90d['getAssociatedQueues']();});return Promise[_0xbe9b('0x58')](_0x35a4cc);})[_0xbe9b('0x2c')](function(_0x5f5be4){_0xeed9bf=_[_0xbe9b('0x118')](_0x5f5be4);var _0x5c169a=_[_0xbe9b('0x38')](_0xeed9bf,function(_0xf834a4){return _0xf834a4[_0xbe9b('0x121')](_0x2d3a4e['id'],{'transaction':_0x422dbb});});return Promise[_0xbe9b('0x58')](_0x5c169a);})[_0xbe9b('0x2c')](function(){if(!_0x2d3a4e['online'])return;var _0x190c26=_[_0xbe9b('0x47')](_0xeed9bf,function(_0x1bcabe){return _0x1bcabe[_0xbe9b('0x11a')](_0xbe9b('0xa3'))===_0xbe9b('0x11b');});var _0x217edf=_[_0xbe9b('0x38')](_0x190c26,function(_0x3b88a2){return db[_0xbe9b('0xd9')][_0xbe9b('0x2f')]({'where':{'VoiceQueueId':_0x3b88a2['id'],'UserId':_0x2d3a4e['id']},'transaction':_0x422dbb});});return Promise[_0xbe9b('0x58')](_0x217edf);})[_0xbe9b('0x2c')](function(){return db[_0xbe9b('0x11c')][_0xbe9b('0x51')]({'where':{'teamId':{'$in':_0x44e412}}});})[_0xbe9b('0x2c')](function(_0x1c28a8){var _0x301dc6=_['map'](_0x1c28a8,function(_0x219070){return db[_0xbe9b('0x11d')][_0xbe9b('0x2f')]({'where':{'UserId':_0x2d3a4e['id'],'VoicePrefixId':_0x219070[_0xbe9b('0x11e')]}},{'transaction':_0x422dbb});});return Promise[_0xbe9b('0x58')](_0x301dc6);});});})[_0xbe9b('0x2c')](function(){for(var _0x6649f7=0x0;_0x6649f7<_0xeed9bf[_0xbe9b('0x60')];_0x6649f7++){var _0xf7674a=_0xeed9bf[_0x6649f7][_0xbe9b('0x11a')]('channel');var _0x2477ed=_0xf7674a+_0xbe9b('0xb4');socket[_0xbe9b('0x2d')](_0xbe9b('0x33')+_0xf7674a+'Queue:remove',{'UserId':_0x45db5d,['queueField']:_0xeed9bf[_0x6649f7]['id']});}})['then'](respondWithStatusCode(_0x20b54a,null))[_0xbe9b('0x24')](APIHandleError(_0x20b54a));};exports['getLists']=function(_0x4f814e,_0x2ad5bd){var _0x3cd763={};var _0x24fcd9={};var _0x1bf2ae;var _0x3f4a1d;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x4f814e[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x2ad5bd,null))[_0xbe9b('0x2c')](function(_0x1fe024){if(_0x1fe024){_0x1bf2ae=_0x1fe024;_0x24fcd9[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db['CmList']['rawAttributes']);_0x24fcd9[_0xbe9b('0x4a')]=_[_0xbe9b('0x5c')](_0x4f814e['query']);_0x24fcd9[_0xbe9b('0x5d')]=_[_0xbe9b('0x5e')](_0x24fcd9['model'],_0x24fcd9[_0xbe9b('0x4a')]);_0x3cd763[_0xbe9b('0x4f')]=_['intersection'](_0x24fcd9[_0xbe9b('0x5a')],qs['fields'](_0x4f814e[_0xbe9b('0x4a')]['fields']));_0x3cd763[_0xbe9b('0x4f')]=_0x3cd763['attributes']['length']?_0x3cd763['attributes']:_0x24fcd9[_0xbe9b('0x5a')];_0x3cd763[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0x4f814e[_0xbe9b('0x4a')][_0xbe9b('0xcd')]);_0x3cd763[_0xbe9b('0xce')]=qs[_0xbe9b('0x5d')](_['pick'](_0x4f814e[_0xbe9b('0x4a')],_0x24fcd9[_0xbe9b('0x5d')]));if(_0x4f814e['query']['filter']){_0x3cd763[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x3cd763[_0xbe9b('0xce')],{'$or':_['map'](_0x3cd763[_0xbe9b('0x4f')],function(_0x21f401){var _0x5e531d={};_0x5e531d[_0x21f401]={'$like':'%'+_0x4f814e[_0xbe9b('0x4a')]['filter']+'%'};return _0x5e531d;})});}_0x3cd763=_[_0xbe9b('0x62')]({},_0x3cd763,_0x4f814e[_0xbe9b('0x63')]);return _0x1bf2ae['getLists'](_0x3cd763);}})[_0xbe9b('0x2c')](function(_0x404c89){if(_0x404c89){_0x3f4a1d=_0x404c89[_0xbe9b('0x60')];if(!_0x4f814e[_0xbe9b('0x4a')][_0xbe9b('0xd4')](_0xbe9b('0xd8'))){_0x3cd763[_0xbe9b('0x28')]=qs[_0xbe9b('0x28')](_0x4f814e[_0xbe9b('0x4a')][_0xbe9b('0x28')]);_0x3cd763[_0xbe9b('0x27')]=qs[_0xbe9b('0x27')](_0x4f814e['query']['offset']);}return _0x1bf2ae[_0xbe9b('0x122')](_0x3cd763);}})['then'](function(_0x1cc1d4){if(_0x1cc1d4){return _0x1cc1d4?{'count':_0x3f4a1d,'rows':_0x1cc1d4}:null;}})[_0xbe9b('0x2c')](respondWithResult(_0x2ad5bd,null))[_0xbe9b('0x24')](handleError(_0x2ad5bd,null));};exports['getAgents']=function(_0x36bb2a,_0x16c6bd){var _0x3f5cef={};var _0x439a2b={};var _0x10f78f;return db[_0xbe9b('0x42')][_0xbe9b('0x9b')]({'where':{'id':_0x36bb2a[_0xbe9b('0x67')]['id']}})[_0xbe9b('0x2c')](handleEntityNotFound(_0x16c6bd,null))[_0xbe9b('0x2c')](function(_0x3b117f){if(_0x3b117f){_0x10f78f=_0x3b117f;_0x439a2b[_0xbe9b('0x5a')]=_[_0xbe9b('0x5c')](db[_0xbe9b('0x42')][_0xbe9b('0x43')]);_0x439a2b['query']=_[_0xbe9b('0x5c')](_0x36bb2a[_0xbe9b('0x4a')]);_0x439a2b['filters']=_[_0xbe9b('0x5e')](_0x439a2b[_0xbe9b('0x5a')],_0x439a2b[_0xbe9b('0x4a')]);_0x3f5cef['attributes']=_[_0xbe9b('0x5e')](_0x439a2b['model'],qs[_0xbe9b('0x5f')](_0x36bb2a['query'][_0xbe9b('0x5f')]));_0x3f5cef[_0xbe9b('0x4f')]=_0x3f5cef[_0xbe9b('0x4f')][_0xbe9b('0x60')]?_0x3f5cef['attributes']:_0x439a2b[_0xbe9b('0x5a')];_0x3f5cef[_0xbe9b('0xcc')]=qs[_0xbe9b('0xcd')](_0x36bb2a[_0xbe9b('0x4a')]['sort']);_0x3f5cef['where']=qs['filters'](_['pick'](_0x36bb2a[_0xbe9b('0x4a')],_0x439a2b[_0xbe9b('0x5d')]));if(_0x36bb2a['query']['filter']){_0x3f5cef[_0xbe9b('0xce')]=_[_0xbe9b('0x62')](_0x3f5cef[_0xbe9b('0xce')],{'$or':_['map'](_0x3f5cef[_0xbe9b('0x4f')],function(_0xf23dfe){var _0x39247e={};_0x39247e[_0xf23dfe]={'$like':'%'+_0x36bb2a[_0xbe9b('0x4a')][_0xbe9b('0x47')]+'%'};return _0x39247e;})});}_0x3f5cef[_0xbe9b('0x5a')]=db[_0xbe9b('0x42')];_0x3f5cef['as']=_0xbe9b('0x34');_0x3f5cef=_[_0xbe9b('0x62')]({},_0x3f5cef,_0x36bb2a[_0xbe9b('0x63')]);return _0x10f78f[_0xbe9b('0x123')]({'include':[_0x3f5cef]});}})[_0xbe9b('0x2c')](function(_0x3c22c4){if(_0x3c22c4){var _0x81c748={},_0x1396b5=[];for(var _0x3776d7=0x0;_0x3776d7<_0x3c22c4[_0xbe9b('0x60')];_0x3776d7+=0x1){for(var _0x28c034=0x0,_0x4892e8;_0x28c034<_0x3c22c4[_0x3776d7][_0xbe9b('0x34')][_0xbe9b('0x60')];_0x28c034+=0x1){_0x4892e8=_0x3c22c4[_0x3776d7]['Agents'][_0x28c034][_0xbe9b('0x30')]({'plain':!![]});_0x81c748[_0x4892e8['id']]=_0x4892e8;}}_0x81c748=_['values'](_0x81c748);for(var _0x2631fd=qs[_0xbe9b('0x27')](_0x36bb2a[_0xbe9b('0x4a')][_0xbe9b('0x27')]);_0x2631fd<_0x81c748[_0xbe9b('0x60')]&&_0x1396b5[_0xbe9b('0x60')]=_0x99473b[_0x2505('0x4b')]){throw new Error(_0x2505('0x4c'));}})[_0x2505('0x16')](function(){if(_0x53dcc3){return db[_0x2505('0x23')][_0x2505('0x43')]({'where':{'membername':_0x53dcc3[_0x2505('0x20')]},'individualHooks':!![]});}})['then'](function(){if(_0x53dcc3){return _0x53dcc3[_0x2505('0x4d')]({'raw':!![]});}})[_0x2505('0x16')](function(_0x2d475a){if(_0x53dcc3){if(_0x2d475a){var _0x25cc51=[];_0x328229=_0x2d475a;if(_0x328229[_0x2505('0x28')]){for(var _0x5dcbbe=0x0;_0x5dcbbe<_0x328229[_0x2505('0x28')];_0x5dcbbe++){_0x25cc51[_0x2505('0x2b')](db[_0x2505('0x23')]['upsert']({'membername':_0x53dcc3[_0x2505('0x20')],'UserId':_0x53dcc3['id'],'queue_name':_0x328229[_0x5dcbbe][_0x2505('0x20')],'VoiceQueueId':_0x328229[_0x5dcbbe]['id'],'interface':_0x3cc120,'paused':_0x53dcc3[_0x2505('0x48')]||![],'penalty':_0x328229[_0x5dcbbe][_0x2505('0x4e')]||0x0}));}return BPromise[_0x2505('0x44')](_0x25cc51);}}}})['then'](function(){if(_0x53dcc3){return db[_0x2505('0x24')][_0x2505('0xd')]({'where':{'membername':_0x53dcc3[_0x2505('0x20')],'exitAt':null}});}})[_0x2505('0x16')](function(_0x75f327){if(_0x53dcc3){if(_0x75f327&&_0x75f327[_0x2505('0x28')]){var _0x1f2a92=[];_0x75f327['forEach'](function(_0x95f016){_0x1f2a92['push'](_0x95f016[_0x2505('0x32')]({'exitAt':moment()[_0x2505('0x26')](_0x2505('0x27'))}));});return BPromise[_0x2505('0x44')](_0x1f2a92);}}})[_0x2505('0x16')](function(){if(_0x53dcc3){var _0x547dbb=[];var _0x4bb524=[];var _0x46d91d=utils[_0x2505('0x4f')]();var _0x1bcd8f={'membername':_0x53dcc3[_0x2505('0x20')],'interface':_0x3cc120,'enterAt':moment()[_0x2505('0x26')](_0x2505('0x27')),'role':_0x53dcc3[_0x2505('0x21')],'internal':_0x53dcc3['internal']};_0x46d91d['forEach'](function(_0x429cce){_0x547dbb[_0x2505('0x2b')](_['merge']({'channel':_0x429cce,'type':_0x2505('0x50'),'data1':_0x2505('0x51'),'data2':_0x3cc120},_0x1bcd8f));if(_0x53dcc3[_0x2505('0x48')]){_0x4bb524['push'](_[_0x2505('0x52')]({'channel':_0x429cce,'type':_0x2505('0x25'),'data1':_0x2505('0x53')},_0x1bcd8f));}});return db[_0x2505('0x24')][_0x2505('0x31')](_0x547dbb['concat'](_0x4bb524),{'individualHooks':!![]});}})[_0x2505('0x16')](function(){if(_0x53dcc3){return _0x53dcc3[_0x2505('0x32')]({'online':!![],'lastLoginAt':moment()[_0x2505('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x53dcc3[_0x2505('0x48')]||![],'mailPause':_0x53dcc3[_0x2505('0x48')]||![],'chatPause':_0x53dcc3[_0x2505('0x48')]||![],'faxPause':_0x53dcc3[_0x2505('0x48')]||![],'smsPause':_0x53dcc3[_0x2505('0x48')]||![],'openchannelPause':_0x53dcc3['loginInPause']||![],'pauseType':_0x53dcc3['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x2505('0x26')](_0x2505('0x27')),'interface':_0x3cc120});}})[_0x2505('0x16')](function(_0x108f85){_0x24c0cc(_0x108f85);})[_0x2505('0x1e')](function(_0x59e426){_0x10363a(_0x4f6890[_0x2505('0x1a')](0x1f4,_0x59e426[_0x2505('0x19')]));});});}; \ No newline at end of file +var _0x344b=['PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','interface','format','type','uniqueid','bulkCreate','body','DEFAULT\x20PAUSE','UnpauseUser','channel','isValidChannel','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','unpause','findOne','destroy','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','forEach','internal','LOGIN','callysquare','merge','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','redis','localhost','register','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','error','message','ShowUser','find','catch','PauseUser','name','role','UserVoiceQueueRt','update','MemberReport'];(function(_0x18390a,_0x4703a4){var _0x507986=function(_0x3a5902){while(--_0x3a5902){_0x18390a['push'](_0x18390a['shift']());}};_0x507986(++_0x4703a4);}(_0x344b,0xcd));var _0xb344=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x344b[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require(_0xb344('0x0'));var moment=require('moment');var BPromise=require(_0xb344('0x1'));var Redis=require(_0xb344('0x2'));var db=require(_0xb344('0x3'))['db'];var utils=require(_0xb344('0x4'));var logger=require(_0xb344('0x5'))('rpc');var config=require('../../config/environment');config['redis']=_['defaults'](config[_0xb344('0x6')],{'host':_0xb344('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb344('0x6')]));require('./user.socket')[_0xb344('0x8')](socket);exports[_0xb344('0x9')]=function(_0x5aeffa){var _0x27463a=this;return new Promise(function(_0x39bb53,_0x242fa4){return db[_0xb344('0xa')][_0xb344('0xb')]({'raw':_0x5aeffa[_0xb344('0xc')]?_0x5aeffa['options'][_0xb344('0xd')]===undefined?!![]:![]:!![],'where':_0x5aeffa[_0xb344('0xc')]?_0x5aeffa[_0xb344('0xc')][_0xb344('0xe')]||null:null,'attributes':_0x5aeffa[_0xb344('0xc')]?_0x5aeffa[_0xb344('0xc')][_0xb344('0xf')]||null:null,'limit':_0x5aeffa[_0xb344('0xc')]?_0x5aeffa['options'][_0xb344('0x10')]||null:null,'include':_0x5aeffa[_0xb344('0xc')]?_0x5aeffa[_0xb344('0xc')][_0xb344('0x11')]?_[_0xb344('0x12')](_0x5aeffa[_0xb344('0xc')][_0xb344('0x11')],function(_0x4215b2){return{'model':db[_0x4215b2['model']],'as':_0x4215b2['as'],'attributes':_0x4215b2[_0xb344('0xf')],'include':_0x4215b2[_0xb344('0x11')]?_[_0xb344('0x12')](_0x4215b2[_0xb344('0x11')],function(_0x47d18f){return{'model':db[_0x47d18f[_0xb344('0x13')]],'as':_0x47d18f['as'],'attributes':_0x47d18f[_0xb344('0xf')],'include':_0x47d18f[_0xb344('0x11')]?_['map'](_0x47d18f['include'],function(_0x53ea81){return{'model':db[_0x53ea81['model']],'as':_0x53ea81['as'],'attributes':_0x53ea81['attributes']};}):[]};}):[]};}):[]:[]})[_0xb344('0x14')](function(_0x5b6036){logger[_0xb344('0x15')]('GetUser',_0x5aeffa);logger[_0xb344('0x16')]('GetUser',_0x5aeffa,JSON[_0xb344('0x17')](_0x5b6036));_0x39bb53(_0x5b6036);})['catch'](function(_0x392f26){logger[_0xb344('0x18')](_0xb344('0x9'),_0x392f26['message'],_0x5aeffa);_0x242fa4(_0x27463a[_0xb344('0x18')](0x1f4,_0x392f26[_0xb344('0x19')]));});});};exports[_0xb344('0x1a')]=function(_0xdcdf8c){var _0x4281b6=this;return new Promise(function(_0x1d0ee8,_0x23e3c7){return db[_0xb344('0xa')][_0xb344('0x1b')]({'raw':_0xdcdf8c[_0xb344('0xc')]?_0xdcdf8c['options']['raw']===undefined?!![]:![]:!![],'where':_0xdcdf8c['options']?_0xdcdf8c[_0xb344('0xc')][_0xb344('0xe')]||null:null,'attributes':_0xdcdf8c[_0xb344('0xc')]?_0xdcdf8c[_0xb344('0xc')][_0xb344('0xf')]||null:null,'include':_0xdcdf8c[_0xb344('0xc')]?_0xdcdf8c['options'][_0xb344('0x11')]?_[_0xb344('0x12')](_0xdcdf8c['options'][_0xb344('0x11')],function(_0x173779){return{'model':db[_0x173779[_0xb344('0x13')]],'as':_0x173779['as'],'attributes':_0x173779[_0xb344('0xf')],'include':_0x173779[_0xb344('0x11')]?_[_0xb344('0x12')](_0x173779['include'],function(_0x3cb907){return{'model':db[_0x3cb907[_0xb344('0x13')]],'as':_0x3cb907['as'],'attributes':_0x3cb907[_0xb344('0xf')],'include':_0x3cb907[_0xb344('0x11')]?_['map'](_0x3cb907[_0xb344('0x11')],function(_0x124b3a){return{'model':db[_0x124b3a[_0xb344('0x13')]],'as':_0x124b3a['as'],'attributes':_0x124b3a[_0xb344('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x127a3c){logger[_0xb344('0x15')](_0xb344('0x1a'),_0xdcdf8c);logger[_0xb344('0x16')](_0xb344('0x1a'),_0xdcdf8c,JSON[_0xb344('0x17')](_0x127a3c));_0x1d0ee8(_0x127a3c);})[_0xb344('0x1c')](function(_0x250111){logger[_0xb344('0x18')]('ShowUser',_0x250111[_0xb344('0x19')],_0xdcdf8c);_0x23e3c7(_0x4281b6['error'](0x1f4,_0x250111['message']));});});};exports[_0xb344('0x1d')]=function(_0x19331b){var _0x122669=this;return new Promise(function(_0x6c13af,_0x4a7480){var _0x2dc1c2;return db[_0xb344('0xa')][_0xb344('0x1b')]({'where':_0x19331b[_0xb344('0xc')][_0xb344('0xe')]||{},'attributes':['id',_0xb344('0x1e'),_0xb344('0x1f'),'internal','interface']})['then'](function(_0x37f869){if(_0x37f869){_0x2dc1c2=_0x37f869;return db[_0xb344('0x20')][_0xb344('0x21')]({'paused':0x1},{'where':{'UserId':_0x2dc1c2['id']},'individualHooks':!![]});}})[_0xb344('0x14')](function(){if(_0x2dc1c2){return db[_0xb344('0x22')][_0xb344('0xb')]({'where':{'membername':_0x2dc1c2[_0xb344('0x1e')],'type':_0xb344('0x23'),'exitAt':null}});}})[_0xb344('0x14')](function(_0x2d3a8f){if(_0x2dc1c2){if(_0x2d3a8f&&_0x2d3a8f[_0xb344('0x24')]){var _0x114489=moment()['format'](_0xb344('0x25'));for(var _0x3b5ce5=0x0,_0x4229f5=_0x2d3a8f[_0xb344('0x24')];_0x3b5ce5<_0x4229f5;_0x3b5ce5++){_0x2d3a8f[_0x3b5ce5][_0xb344('0x26')]({'exitAt':_0x114489});}}}})[_0xb344('0x14')](function(){if(_0x2dc1c2){var _0x1415a8=[];var _0x3c8ca0=utils[_0xb344('0x27')]();_0x3c8ca0['forEach'](function(_0x481f0f){_0x1415a8[_0xb344('0x28')]({'channel':_0x481f0f,'membername':_0x2dc1c2[_0xb344('0x1e')],'interface':_['isNil'](_0x2dc1c2[_0xb344('0x29')])?util[_0xb344('0x2a')]('SIP/%s',_0x2dc1c2[_0xb344('0x1e')]):_0x2dc1c2[_0xb344('0x29')],'type':_0xb344('0x23'),'enterAt':moment()[_0xb344('0x2a')](_0xb344('0x25')),'data1':_0x19331b['body'][_0xb344('0x2b')]||'DEFAULT\x20PAUSE','role':_0x2dc1c2[_0xb344('0x1f')],'internal':_0x2dc1c2['internal'],'uniqueid':_0x19331b['body'][_0xb344('0x2c')]||null});});return db[_0xb344('0x22')][_0xb344('0x2d')](_0x1415a8,{'individualHooks':!![]});}})[_0xb344('0x14')](function(){if(_0x2dc1c2){return _0x2dc1c2[_0xb344('0x21')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x19331b[_0xb344('0x2e')]['type']||_0xb344('0x2f'),'lastPauseAt':moment()['format'](_0xb344('0x25'))});}})[_0xb344('0x14')](function(_0x5821ab){_0x6c13af(_0x5821ab);})[_0xb344('0x1c')](function(_0x35fb23){_0x4a7480(_0x122669[_0xb344('0x18')](0x1f4,_0x35fb23['message']));});});};exports[_0xb344('0x30')]=function(_0xa618e){var _0x20da0d=this;return new Promise(function(_0x4d4247,_0x46233d){if(_0xa618e[_0xb344('0x2e')][_0xb344('0x31')]&&!utils[_0xb344('0x32')](_0xa618e[_0xb344('0x2e')][_0xb344('0x31')])){throw new Error(util[_0xb344('0x2a')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xa618e[_0xb344('0x2e')]['channel']));}return db[_0xb344('0xa')]['findOne']({'where':_0xa618e['options']['where']||{},'attributes':['id','name',_0xb344('0x1f'),'internal',_0xb344('0x29'),_0xb344('0x33'),_0xb344('0x34'),_0xb344('0x35'),_0xb344('0x36'),_0xb344('0x37'),_0xb344('0x38'),_0xb344('0x39'),'whatsappPause',_0xb344('0x3a'),'lastPauseAt']})[_0xb344('0x14')](function(_0x264496){if(!_0x264496){throw new Error(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0xa618e['params']['id']));}return _0x264496[_0xb344('0x3b')](_0xa618e['body']['channel'],'system');})[_0xb344('0x14')](function(_0xd530ab){_0x4d4247(_0xd530ab);})[_0xb344('0x1c')](function(_0x34168d){_0x46233d(_0x20da0d[_0xb344('0x18')](0x1f4,_0x34168d[_0xb344('0x19')]));});});};exports['LogoutUser']=function(_0x2f2382){var _0xa80342=this;return new Promise(function(_0x41fdb4,_0x5d2a10){var _0x224139;return db['User'][_0xb344('0x3c')]({'where':_0x2f2382[_0xb344('0xc')][_0xb344('0xe')]||{},'attributes':['id',_0xb344('0x1e')]})[_0xb344('0x14')](function(_0x26da73){if(_0x26da73){_0x224139=_0x26da73;return db[_0xb344('0x20')][_0xb344('0x3d')]({'where':{'membername':_0x224139['name']},'individualHooks':!![]});}})[_0xb344('0x14')](function(){if(_0x224139){return db[_0xb344('0x22')][_0xb344('0xb')]({'where':{'membername':_0x224139[_0xb344('0x1e')],'exitAt':null}});}})[_0xb344('0x14')](function(_0x4323bb){if(_0x224139){if(_0x4323bb&&_0x4323bb[_0xb344('0x24')]){var _0x5afea1=[];_0x4323bb['forEach'](function(_0x1b2d34){_0x5afea1['push'](_0x1b2d34['update']({'exitAt':moment()[_0xb344('0x2a')](_0xb344('0x25'))}));});return BPromise[_0xb344('0x3e')](_0x5afea1);}}})[_0xb344('0x14')](function(){if(_0x224139){return _0x224139[_0xb344('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xb344('0x14')](function(_0x428a71){_0x41fdb4(_0x428a71);})[_0xb344('0x1c')](function(_0x49338f){_0x5d2a10(_0xa80342[_0xb344('0x18')](0x1f4,_0x49338f['message']));});});};exports[_0xb344('0x3f')]=function(_0x18d962){var _0xda2447=this;return new Promise(function(_0x33998c,_0x3df3fe){var _0x4b518e;var _0x14aaec;var _0x37f00f;var _0x5f5a6e;return db[_0xb344('0xa')][_0xb344('0x3c')]({'where':_0x18d962[_0xb344('0xc')][_0xb344('0xe')]||{},'attributes':['id',_0xb344('0x1e'),_0xb344('0x1f'),_0xb344('0x40'),_0xb344('0x41'),'internal',_0xb344('0x42'),_0xb344('0x29')]})['then'](function(_0xd6847d){if(_0xd6847d){_0x4b518e=_0xd6847d;_0x5f5a6e=_0x18d962['body'][_0xb344('0x29')]?_0x18d962['body'][_0xb344('0x29')]:util['format'](_0xb344('0x43'),_0x4b518e['name']);return db['User'][_0xb344('0x44')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4b518e['id']}}});}})[_0xb344('0x14')](function(_0x338313){if(_0x338313){_0x37f00f=_0x338313;return require(_0xb344('0x45'))[_0xb344('0x46')]();}})[_0xb344('0x14')](function(_0x42ab0b){if(_0x42ab0b&&_0x42ab0b['agents']&&_0x37f00f>=_0x42ab0b[_0xb344('0x47')]){throw new Error(_0xb344('0x48'));}})[_0xb344('0x14')](function(){if(_0x4b518e){return db[_0xb344('0x20')][_0xb344('0x3d')]({'where':{'membername':_0x4b518e[_0xb344('0x1e')]},'individualHooks':!![]});}})[_0xb344('0x14')](function(){if(_0x4b518e){return _0x4b518e[_0xb344('0x49')]({'raw':!![]});}})[_0xb344('0x14')](function(_0x15d9c8){if(_0x4b518e){if(_0x15d9c8){var _0x4fa7d7=[];_0x14aaec=_0x15d9c8;if(_0x14aaec[_0xb344('0x24')]){for(var _0x2bef80=0x0;_0x2bef80<_0x14aaec['length'];_0x2bef80++){_0x4fa7d7[_0xb344('0x28')](db[_0xb344('0x20')]['upsert']({'membername':_0x4b518e[_0xb344('0x1e')],'UserId':_0x4b518e['id'],'queue_name':_0x14aaec[_0x2bef80][_0xb344('0x1e')],'VoiceQueueId':_0x14aaec[_0x2bef80]['id'],'interface':_0x5f5a6e,'paused':_0x4b518e[_0xb344('0x42')]||![],'penalty':_0x14aaec[_0x2bef80][_0xb344('0x4a')]||0x0}));}return BPromise[_0xb344('0x3e')](_0x4fa7d7);}}}})[_0xb344('0x14')](function(){if(_0x4b518e){return db[_0xb344('0x22')][_0xb344('0xb')]({'where':{'membername':_0x4b518e[_0xb344('0x1e')],'exitAt':null}});}})[_0xb344('0x14')](function(_0x5d680d){if(_0x4b518e){if(_0x5d680d&&_0x5d680d[_0xb344('0x24')]){var _0x357d18=[];_0x5d680d[_0xb344('0x4b')](function(_0x31534d){_0x357d18[_0xb344('0x28')](_0x31534d[_0xb344('0x21')]({'exitAt':moment()[_0xb344('0x2a')](_0xb344('0x25'))}));});return BPromise['all'](_0x357d18);}}})['then'](function(){if(_0x4b518e){var _0x13aed9=[];var _0x2a9095=[];var _0x2843ed=utils[_0xb344('0x27')]();var _0x114fe3={'membername':_0x4b518e[_0xb344('0x1e')],'interface':_0x5f5a6e,'enterAt':moment()[_0xb344('0x2a')](_0xb344('0x25')),'role':_0x4b518e[_0xb344('0x1f')],'internal':_0x4b518e[_0xb344('0x4c')]};_0x2843ed[_0xb344('0x4b')](function(_0x43c906){_0x13aed9[_0xb344('0x28')](_['merge']({'channel':_0x43c906,'type':_0xb344('0x4d'),'data1':_0xb344('0x4e'),'data2':_0x5f5a6e},_0x114fe3));if(_0x4b518e['loginInPause']){_0x2a9095[_0xb344('0x28')](_[_0xb344('0x4f')]({'channel':_0x43c906,'type':_0xb344('0x23'),'data1':'LOGININPAUSE'},_0x114fe3));}});return db[_0xb344('0x22')][_0xb344('0x2d')](_0x13aed9['concat'](_0x2a9095),{'individualHooks':!![]});}})[_0xb344('0x14')](function(){if(_0x4b518e){return _0x4b518e['update']({'online':!![],'lastLoginAt':moment()[_0xb344('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4b518e['loginInPause']||![],'mailPause':_0x4b518e['loginInPause']||![],'chatPause':_0x4b518e[_0xb344('0x42')]||![],'faxPause':_0x4b518e['loginInPause']||![],'smsPause':_0x4b518e[_0xb344('0x42')]||![],'openchannelPause':_0x4b518e[_0xb344('0x42')]||![],'pauseType':_0x4b518e[_0xb344('0x42')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xb344('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5f5a6e});}})[_0xb344('0x14')](function(_0x3e52eb){_0x33998c(_0x3e52eb);})[_0xb344('0x1c')](function(_0x57ed3c){_0x3df3fe(_0xda2447[_0xb344('0x18')](0x1f4,_0x57ed3c['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 0e139b5..963d264 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 _0x0ede=['emit','removeListener','register','user:','./user.events','save','remove','update'];(function(_0x1ee4f6,_0x3f947f){var _0x4b5ceb=function(_0x3e9568){while(--_0x3e9568){_0x1ee4f6['push'](_0x1ee4f6['shift']());}};_0x4b5ceb(++_0x3f947f);}(_0x0ede,0x184));var _0xe0ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ede[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0xe0ed('0x0'));var events=[_0xe0ed('0x1'),_0xe0ed('0x2'),_0xe0ed('0x3')];function createListener(_0x509a82,_0x200e45){return function(_0x5f3293){_0x200e45[_0xe0ed('0x4')](_0x509a82,_0x5f3293);};}function removeListener(_0x46b564,_0x4342b7){return function(){UserEvents[_0xe0ed('0x5')](_0x46b564,_0x4342b7);};}exports[_0xe0ed('0x6')]=function(_0x5d079c){for(var _0x36e969=0x0,_0x35b176=events['length'];_0x36e969<_0x35b176;_0x36e969++){var _0x2ea1f9=events[_0x36e969];var _0x10fdd4=createListener(_0xe0ed('0x7')+_0x2ea1f9,_0x5d079c);UserEvents['on'](_0x2ea1f9,_0x10fdd4);}}; \ No newline at end of file +var _0xa063=['removeListener','register','length','emit'];(function(_0x4a3fa5,_0x15ddd9){var _0x2587a4=function(_0x1c1228){while(--_0x1c1228){_0x4a3fa5['push'](_0x4a3fa5['shift']());}};_0x2587a4(++_0x15ddd9);}(_0xa063,0x67));var _0x3a06=function(_0x44d1d6,_0x8e97a){_0x44d1d6=_0x44d1d6-0x0;var _0x5ebaae=_0xa063[_0x44d1d6];return _0x5ebaae;};'use strict';var UserEvents=require('./user.events');var events=['save','remove','update'];function createListener(_0x530983,_0x29121b){return function(_0x178a1d){_0x29121b[_0x3a06('0x0')](_0x530983,_0x178a1d);};}function removeListener(_0x271fa1,_0x31a024){return function(){UserEvents[_0x3a06('0x1')](_0x271fa1,_0x31a024);};}exports[_0x3a06('0x2')]=function(_0x3ebe22){for(var _0xe87944=0x0,_0x417804=events[_0x3a06('0x3')];_0xe87944<_0x417804;_0xe87944++){var _0x45737a=events[_0xe87944];var _0x192951=createListener('user:'+_0x45737a,_0x3ebe22);UserEvents['on'](_0x45737a,_0x192951);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b0b1b1e..99bdc92 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4fc2fb,_0x1dfdad){var _0x5c1bbf=function(_0x14fe0d){while(--_0x14fe0d){_0x4fc2fb['push'](_0x4fc2fb['shift']());}};_0x5c1bbf(++_0x1dfdad);}(_0x70e0,0x17b));var _0x070e=function(_0x3eb401,_0xd2a02b){_0x3eb401=_0x3eb401-0x0;var _0x19357e=_0x70e0[_0x3eb401];return _0x19357e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x15fc7a,_0x16557d){var _0x45ee6c=function(_0x439e66){while(--_0x439e66){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x45ee6c(++_0x16557d);}(_0x70e0,0x17b));var _0x070e=function(_0x1470de,_0x149a05){_0x1470de=_0x1470de-0x0;var _0x2709bd=_0x70e0[_0x1470de];return _0x2709bd;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 15295a7..c7f2dc9 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 _0xac8c=['exports','sequelize'];(function(_0x39853d,_0x2501bf){var _0x5864ca=function(_0xbc99d5){while(--_0xbc99d5){_0x39853d['push'](_0x39853d['shift']());}};_0x5864ca(++_0x2501bf);}(_0xac8c,0x1c3));var _0xcac8=function(_0x154983,_0xc29edf){_0x154983=_0x154983-0x0;var _0x3d1243=_0xac8c[_0x154983];return _0x3d1243;};'use strict';var Sequelize=require(_0xcac8('0x0'));module[_0xcac8('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe448=['sequelize','exports','INTEGER'];(function(_0x518517,_0x3e4df3){var _0xaee2e6=function(_0x20d192){while(--_0x20d192){_0x518517['push'](_0x518517['shift']());}};_0xaee2e6(++_0x3e4df3);}(_0xe448,0x1d4));var _0x8e44=function(_0x4e37df,_0x387fb9){_0x4e37df=_0x4e37df-0x0;var _0x421464=_0xe448[_0x4e37df];return _0x421464;};'use strict';var Sequelize=require(_0x8e44('0x0'));module[_0x8e44('0x1')]={'penalty':{'type':Sequelize[_0x8e44('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 3739f5f..386b453 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 _0x316d=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x142fec,_0x39a7d2){var _0x34c4eb=function(_0x5a9fbe){while(--_0x5a9fbe){_0x142fec['push'](_0x142fec['shift']());}};_0x34c4eb(++_0x39a7d2);}(_0x316d,0x6c));var _0xd316=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x316d[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xd316('0x0'));var util=require(_0xd316('0x1'));var logger=require(_0xd316('0x2'))(_0xd316('0x3'));var moment=require(_0xd316('0x4'));var BPromise=require(_0xd316('0x5'));var rp=require(_0xd316('0x6'));var fs=require('fs');var path=require(_0xd316('0x7'));var rimraf=require(_0xd316('0x8'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0xd316('0x9')]=function(_0x3bdcc2,_0x4b2134){return _0x3bdcc2[_0xd316('0xa')](_0xd316('0xb'),attributes,{'tableName':_0xd316('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfe9=['./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x448324,_0x675081){var _0x133d90=function(_0x117b7d){while(--_0x117b7d){_0x448324['push'](_0x448324['shift']());}};_0x133d90(++_0x675081);}(_0xcfe9,0x1f3));var _0x9cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9cfe('0x0'));var logger=require(_0x9cfe('0x1'))(_0x9cfe('0x2'));var moment=require(_0x9cfe('0x3'));var BPromise=require('bluebird');var rp=require(_0x9cfe('0x4'));var fs=require('fs');var path=require(_0x9cfe('0x5'));var rimraf=require(_0x9cfe('0x6'));var config=require('../../config/environment');var attributes=require(_0x9cfe('0x7'));module[_0x9cfe('0x8')]=function(_0x3286bc,_0x22ad64){return _0x3286bc['define'](_0x9cfe('0x9'),attributes,{'tableName':_0x9cfe('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 30728ea..6b298ba 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 _0x9458=['request\x20sent','debug','stringify','error','message','result','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x4fa66c,_0x51f9a3){var _0x9b192b=function(_0x5a930f){while(--_0x5a930f){_0x4fa66c['push'](_0x4fa66c['shift']());}};_0x9b192b(++_0x51f9a3);}(_0x9458,0xea));var _0x8945=function(_0x5ec64d,_0x55331c){_0x5ec64d=_0x5ec64d-0x0;var _0x16d0bd=_0x9458[_0x5ec64d];return _0x16d0bd;};'use strict';var _=require('lodash');var util=require(_0x8945('0x0'));var moment=require(_0x8945('0x1'));var BPromise=require(_0x8945('0x2'));var rs=require(_0x8945('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8945('0x4'));var logger=require('../../config/logger')(_0x8945('0x5'));var config=require(_0x8945('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8945('0x7')][_0x8945('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e4e38,_0xd1201d,_0x92e7b1){return new BPromise(function(_0x4f4173,_0x175728){return client[_0x8945('0x9')](_0x5e4e38,_0x92e7b1)[_0x8945('0xa')](function(_0x27970e){logger[_0x8945('0xb')](_0x8945('0xc'),_0xd1201d,_0x8945('0xd'));logger[_0x8945('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0xd1201d,_0x8945('0xd'),JSON[_0x8945('0xf')](_0x27970e));if(_0x27970e[_0x8945('0x10')]){if(_0x27970e[_0x8945('0x10')]['code']===0x1f4){logger[_0x8945('0x10')](_0x8945('0xc'),_0xd1201d,_0x27970e[_0x8945('0x10')][_0x8945('0x11')]);return _0x175728(_0x27970e['error'][_0x8945('0x11')]);}logger[_0x8945('0x10')](_0x8945('0xc'),_0xd1201d,_0x27970e[_0x8945('0x10')]['message']);return _0x4f4173(_0x27970e[_0x8945('0x10')][_0x8945('0x11')]);}else{logger[_0x8945('0xb')](_0x8945('0xc'),_0xd1201d,'request\x20sent');_0x4f4173(_0x27970e[_0x8945('0x12')]['message']);}})['catch'](function(_0x3cb2b3){logger[_0x8945('0x10')]('UserChatQueue,\x20%s,\x20%s',_0xd1201d,_0x3cb2b3);_0x175728(_0x3cb2b3);});});} \ No newline at end of file +var _0x70db=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x54776d,_0x161e77){var _0x37607c=function(_0x15e41c){while(--_0x15e41c){_0x54776d['push'](_0x54776d['shift']());}};_0x37607c(++_0x161e77);}(_0x70db,0xd4));var _0xb70d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x70db[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xb70d('0x0'));var util=require(_0xb70d('0x1'));var moment=require(_0xb70d('0x2'));var BPromise=require(_0xb70d('0x3'));var rs=require(_0xb70d('0x4'));var fs=require('fs');var Redis=require(_0xb70d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb70d('0x6'));var jayson=require(_0xb70d('0x7'));var client=jayson[_0xb70d('0x8')][_0xb70d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x471083,_0x4f8aeb,_0x3c6b46){return new BPromise(function(_0x143465,_0x26bb12){return client['request'](_0x471083,_0x3c6b46)['then'](function(_0x3c6d4c){logger[_0xb70d('0xa')](_0xb70d('0xb'),_0x4f8aeb,_0xb70d('0xc'));logger[_0xb70d('0xd')](_0xb70d('0xe'),_0x4f8aeb,_0xb70d('0xc'),JSON[_0xb70d('0xf')](_0x3c6d4c));if(_0x3c6d4c[_0xb70d('0x10')]){if(_0x3c6d4c['error'][_0xb70d('0x11')]===0x1f4){logger[_0xb70d('0x10')](_0xb70d('0xb'),_0x4f8aeb,_0x3c6d4c['error'][_0xb70d('0x12')]);return _0x26bb12(_0x3c6d4c[_0xb70d('0x10')]['message']);}logger[_0xb70d('0x10')](_0xb70d('0xb'),_0x4f8aeb,_0x3c6d4c[_0xb70d('0x10')][_0xb70d('0x12')]);return _0x143465(_0x3c6d4c[_0xb70d('0x10')][_0xb70d('0x12')]);}else{logger[_0xb70d('0xa')](_0xb70d('0xb'),_0x4f8aeb,_0xb70d('0xc'));_0x143465(_0x3c6d4c[_0xb70d('0x13')]['message']);}})[_0xb70d('0x14')](function(_0x9792aa){logger['error'](_0xb70d('0xb'),_0x4f8aeb,_0x9792aa);_0x26bb12(_0x9792aa);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index f4f5269..465602f 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(_0x421e6b,_0x4fa4c4){var _0x1969d5=function(_0x40042a){while(--_0x40042a){_0x421e6b['push'](_0x421e6b['shift']());}};_0x1969d5(++_0x4fa4c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x58f8ca,_0x3e0c99){var _0x22ca64=function(_0x10282e){while(--_0x10282e){_0x58f8ca['push'](_0x58f8ca['shift']());}};_0x22ca64(++_0x3e0c99);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f211917..531212e 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 _0x0a26=['exports','INTEGER','STRING'];(function(_0xe261f6,_0x412b8d){var _0x1db19d=function(_0x18f351){while(--_0x18f351){_0xe261f6['push'](_0xe261f6['shift']());}};_0x1db19d(++_0x412b8d);}(_0x0a26,0x132));var _0x60a2=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x0a26[_0x710815];return _0x5b3b89;};'use strict';var Sequelize=require('sequelize');module[_0x60a2('0x0')]={'penalty':{'type':Sequelize[_0x60a2('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x60a2('0x2')]}}; \ No newline at end of file +var _0xb1bf=['sequelize','exports','INTEGER','STRING'];(function(_0x115ebc,_0x31196f){var _0x21a067=function(_0x11784f){while(--_0x11784f){_0x115ebc['push'](_0x115ebc['shift']());}};_0x21a067(++_0x31196f);}(_0xb1bf,0x13c));var _0xfb1b=function(_0x1e4b14,_0x3aea28){_0x1e4b14=_0x1e4b14-0x0;var _0x190307=_0xb1bf[_0x1e4b14];return _0x190307;};'use strict';var Sequelize=require(_0xfb1b('0x0'));module[_0xfb1b('0x1')]={'penalty':{'type':Sequelize[_0xfb1b('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfb1b('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 880a74b..ae7e2ed 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 _0xf019=['../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x264037,_0x19ae50){var _0x581784=function(_0x4b7ac1){while(--_0x4b7ac1){_0x264037['push'](_0x264037['shift']());}};_0x581784(++_0x19ae50);}(_0xf019,0x147));var _0x9f01=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf019[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9f01('0x0'));var util=require(_0x9f01('0x1'));var logger=require(_0x9f01('0x2'))(_0x9f01('0x3'));var moment=require(_0x9f01('0x4'));var BPromise=require(_0x9f01('0x5'));var rp=require(_0x9f01('0x6'));var fs=require('fs');var path=require(_0x9f01('0x7'));var rimraf=require(_0x9f01('0x8'));var config=require(_0x9f01('0x9'));var attributes=require(_0x9f01('0xa'));module[_0x9f01('0xb')]=function(_0x203587,_0x1e9807){return _0x203587[_0x9f01('0xc')](_0x9f01('0xd'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd29b=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd29b,0xb2));var _0xbd29=function(_0x56c63a,_0x54ea86){_0x56c63a=_0x56c63a-0x0;var _0x39a455=_0xd29b[_0x56c63a];return _0x39a455;};'use strict';var _=require(_0xbd29('0x0'));var util=require(_0xbd29('0x1'));var logger=require(_0xbd29('0x2'))(_0xbd29('0x3'));var moment=require(_0xbd29('0x4'));var BPromise=require(_0xbd29('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd29('0x6'));var rimraf=require('rimraf');var config=require(_0xbd29('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xbd29('0x8')]=function(_0x2da1ea,_0xe56137){return _0x2da1ea[_0xbd29('0x9')](_0xbd29('0xa'),attributes,{'tableName':_0xbd29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 5653031..066eaf7 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 _0x18f8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x133ea2,_0x54cda0){var _0x341d81=function(_0x1d9612){while(--_0x1d9612){_0x133ea2['push'](_0x133ea2['shift']());}};_0x341d81(++_0x54cda0);}(_0x18f8,0x19b));var _0x818f=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x18f8[_0x4ae829];return _0x256b31;};'use strict';var _=require('lodash');var util=require(_0x818f('0x0'));var moment=require(_0x818f('0x1'));var BPromise=require(_0x818f('0x2'));var rs=require(_0x818f('0x3'));var fs=require('fs');var Redis=require(_0x818f('0x4'));var db=require(_0x818f('0x5'))['db'];var utils=require(_0x818f('0x6'));var logger=require(_0x818f('0x7'))(_0x818f('0x8'));var config=require(_0x818f('0x9'));var jayson=require(_0x818f('0xa'));var client=jayson[_0x818f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43d06d,_0xd4ec9a,_0x2c139c){return new BPromise(function(_0x1d8b0a,_0x4a283a){return client[_0x818f('0xc')](_0x43d06d,_0x2c139c)['then'](function(_0x13aa2f){logger[_0x818f('0xd')](_0x818f('0xe'),_0xd4ec9a,_0x818f('0xf'));logger[_0x818f('0x10')](_0x818f('0x11'),_0xd4ec9a,_0x818f('0xf'),JSON['stringify'](_0x13aa2f));if(_0x13aa2f[_0x818f('0x12')]){if(_0x13aa2f[_0x818f('0x12')][_0x818f('0x13')]===0x1f4){logger[_0x818f('0x12')](_0x818f('0xe'),_0xd4ec9a,_0x13aa2f[_0x818f('0x12')][_0x818f('0x14')]);return _0x4a283a(_0x13aa2f[_0x818f('0x12')]['message']);}logger[_0x818f('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0xd4ec9a,_0x13aa2f['error'][_0x818f('0x14')]);return _0x1d8b0a(_0x13aa2f[_0x818f('0x12')][_0x818f('0x14')]);}else{logger[_0x818f('0xd')](_0x818f('0xe'),_0xd4ec9a,_0x818f('0xf'));_0x1d8b0a(_0x13aa2f[_0x818f('0x15')]['message']);}})['catch'](function(_0x736e5d){logger[_0x818f('0x12')](_0x818f('0xe'),_0xd4ec9a,_0x736e5d);_0x4a283a(_0x736e5d);});});} \ No newline at end of file +var _0x2733=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','UserFaxQueue,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0x217419,_0x4c2eab){var _0x445be9=function(_0x10375c){while(--_0x10375c){_0x217419['push'](_0x217419['shift']());}};_0x445be9(++_0x4c2eab);}(_0x2733,0x172));var _0x3273=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x2733[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x3273('0x0'));var util=require(_0x3273('0x1'));var moment=require(_0x3273('0x2'));var BPromise=require(_0x3273('0x3'));var rs=require(_0x3273('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3273('0x5'))['db'];var utils=require(_0x3273('0x6'));var logger=require('../../config/logger')(_0x3273('0x7'));var config=require(_0x3273('0x8'));var jayson=require(_0x3273('0x9'));var client=jayson[_0x3273('0xa')][_0x3273('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17e1c1,_0xfb397a,_0x4f14de){return new BPromise(function(_0x443a50,_0x232c1c){return client[_0x3273('0xc')](_0x17e1c1,_0x4f14de)[_0x3273('0xd')](function(_0x4fafd0){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0xfb397a,'request\x20sent');logger[_0x3273('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xfb397a,_0x3273('0xf'),JSON['stringify'](_0x4fafd0));if(_0x4fafd0['error']){if(_0x4fafd0[_0x3273('0x10')][_0x3273('0x11')]===0x1f4){logger['error'](_0x3273('0x12'),_0xfb397a,_0x4fafd0[_0x3273('0x10')][_0x3273('0x13')]);return _0x232c1c(_0x4fafd0[_0x3273('0x10')][_0x3273('0x13')]);}logger['error'](_0x3273('0x12'),_0xfb397a,_0x4fafd0[_0x3273('0x10')][_0x3273('0x13')]);return _0x443a50(_0x4fafd0[_0x3273('0x10')][_0x3273('0x13')]);}else{logger[_0x3273('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0xfb397a,'request\x20sent');_0x443a50(_0x4fafd0[_0x3273('0x15')][_0x3273('0x13')]);}})['catch'](function(_0x4b5db2){logger[_0x3273('0x10')](_0x3273('0x12'),_0xfb397a,_0x4b5db2);_0x232c1c(_0x4b5db2);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2fa62a2..c314da6 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f5b1f,_0x2748f0){var _0x564596=function(_0x1fec2d){while(--_0x1fec2d){_0x1f5b1f['push'](_0x1f5b1f['shift']());}};_0x564596(++_0x2748f0);}(_0xe706,0xa3));var _0x6e70=function(_0x2089b3,_0x31fbde){_0x2089b3=_0x2089b3-0x0;var _0x181087=_0xe706[_0x2089b3];return _0x181087;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x267a92,_0x144bb1){var _0x41c589=function(_0x4ceae2){while(--_0x4ceae2){_0x267a92['push'](_0x267a92['shift']());}};_0x41c589(++_0x144bb1);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 24c0151..e637ea9 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 _0x33fb=['exports','INTEGER'];(function(_0x599aef,_0x3d3ed7){var _0x1ef555=function(_0x2381d9){while(--_0x2381d9){_0x599aef['push'](_0x599aef['shift']());}};_0x1ef555(++_0x3d3ed7);}(_0x33fb,0xaa));var _0xb33f=function(_0x39b8b8,_0x501342){_0x39b8b8=_0x39b8b8-0x0;var _0x38a80c=_0x33fb[_0x39b8b8];return _0x38a80c;};'use strict';var Sequelize=require('sequelize');module[_0xb33f('0x0')]={'penalty':{'type':Sequelize[_0xb33f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4d9e=['INTEGER','exports'];(function(_0x5490e8,_0x263110){var _0x268f96=function(_0x24f97f){while(--_0x24f97f){_0x5490e8['push'](_0x5490e8['shift']());}};_0x268f96(++_0x263110);}(_0x4d9e,0x93));var _0xe4d9=function(_0x72cc03,_0x527a1a){_0x72cc03=_0x72cc03-0x0;var _0x25a940=_0x4d9e[_0x72cc03];return _0x25a940;};'use strict';var Sequelize=require('sequelize');module[_0xe4d9('0x0')]={'penalty':{'type':Sequelize[_0xe4d9('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 a7d018f..be59b6c 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 _0x5eea=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api'];(function(_0x1fcd84,_0x1de4a2){var _0x315dfa=function(_0x150207){while(--_0x150207){_0x1fcd84['push'](_0x1fcd84['shift']());}};_0x315dfa(++_0x1de4a2);}(_0x5eea,0x1ea));var _0xa5ee=function(_0x5b75a7,_0x3f32ab){_0x5b75a7=_0x5b75a7-0x0;var _0x5c9c8f=_0x5eea[_0x5b75a7];return _0x5c9c8f;};'use strict';var _=require(_0xa5ee('0x0'));var util=require(_0xa5ee('0x1'));var logger=require(_0xa5ee('0x2'))(_0xa5ee('0x3'));var moment=require(_0xa5ee('0x4'));var BPromise=require(_0xa5ee('0x5'));var rp=require(_0xa5ee('0x6'));var fs=require('fs');var path=require(_0xa5ee('0x7'));var rimraf=require(_0xa5ee('0x8'));var config=require(_0xa5ee('0x9'));var attributes=require('./userMailQueue.attributes');module[_0xa5ee('0xa')]=function(_0x5bea29,_0x383514){return _0x5bea29['define'](_0xa5ee('0xb'),attributes,{'tableName':_0xa5ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x909e=['moment','request-promise','rimraf','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x5e8602,_0x2ce012){var _0x4434fb=function(_0x5ea1cb){while(--_0x5ea1cb){_0x5e8602['push'](_0x5e8602['shift']());}};_0x4434fb(++_0x2ce012);}(_0x909e,0x1ae));var _0xe909=function(_0x57edc3,_0x583f23){_0x57edc3=_0x57edc3-0x0;var _0x394dd4=_0x909e[_0x57edc3];return _0x394dd4;};'use strict';var _=require(_0xe909('0x0'));var util=require('util');var logger=require(_0xe909('0x1'))('api');var moment=require(_0xe909('0x2'));var BPromise=require('bluebird');var rp=require(_0xe909('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe909('0x4'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xe909('0x5')]=function(_0x51a6c5,_0x3a354b){return _0x51a6c5[_0xe909('0x6')]('UserMailQueue',attributes,{'tableName':_0xe909('0x7'),'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 25a2fee..071f171 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x18c04d,_0x1f5678){var _0x5b0e45=function(_0x51d269){while(--_0x51d269){_0x18c04d['push'](_0x18c04d['shift']());}};_0x5b0e45(++_0x1f5678);}(_0x34e8,0x12c));var _0x834e=function(_0x11d8ee,_0x29959d){_0x11d8ee=_0x11d8ee-0x0;var _0x3b745b=_0x34e8[_0x11d8ee];return _0x3b745b;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ 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(_0x547861,_0xcb2f00){var _0x4cf672=function(_0x533641){while(--_0x533641){_0x547861['push'](_0x547861['shift']());}};_0x4cf672(++_0xcb2f00);}(_0xe14b,0x93));var _0xbe14=function(_0x2422cc,_0x5d8230){_0x2422cc=_0x2422cc-0x0;var _0x3f3a87=_0xe14b[_0x2422cc];return _0x3f3a87;};'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 dfa305c..4070196 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 _0xcc61=['post','isAuthenticated','sendUserNotification','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd8d758,_0x153ed5){var _0x55628d=function(_0x1f43dd){while(--_0x1f43dd){_0xd8d758['push'](_0xd8d758['shift']());}};_0x55628d(++_0x153ed5);}(_0xcc61,0x1a8));var _0x1cc6=function(_0x21daf8,_0x25d57b){_0x21daf8=_0x21daf8-0x0;var _0x2d3489=_0xcc61[_0x21daf8];return _0x2d3489;};'use strict';var multer=require(_0x1cc6('0x0'));var util=require(_0x1cc6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1cc6('0x2'));var router=express[_0x1cc6('0x3')]();var fs_extra=require(_0x1cc6('0x4'));var auth=require(_0x1cc6('0x5'));var interaction=require(_0x1cc6('0x6'));var config=require(_0x1cc6('0x7'));var controller=require('./userNotification.controller');router[_0x1cc6('0x8')]('/',auth[_0x1cc6('0x9')](),controller[_0x1cc6('0xa')]);module[_0x1cc6('0xb')]=router; \ No newline at end of file +var _0x6525=['../../config/environment','./userNotification.controller','isAuthenticated','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4bb083,_0x523d8c){var _0x52dd1a=function(_0x387015){while(--_0x387015){_0x4bb083['push'](_0x4bb083['shift']());}};_0x52dd1a(++_0x523d8c);}(_0x6525,0x1d3));var _0x5652=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x6525[_0x15ca1a];return _0x507626;};'use strict';var multer=require('multer');var util=require(_0x5652('0x0'));var path=require('path');var timeout=require(_0x5652('0x1'));var express=require(_0x5652('0x2'));var router=express['Router']();var fs_extra=require(_0x5652('0x3'));var auth=require(_0x5652('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5652('0x5'));var controller=require(_0x5652('0x6'));router['post']('/',auth[_0x5652('0x7')](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 059d990..47f06e0 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 _0x44cd=['TEXT','STRING'];(function(_0x5c8f85,_0x7957cc){var _0x319d90=function(_0x173e1f){while(--_0x173e1f){_0x5c8f85['push'](_0x5c8f85['shift']());}};_0x319d90(++_0x7957cc);}(_0x44cd,0x1b1));var _0xd44c=function(_0x369289,_0xb779d8){_0x369289=_0x369289-0x0;var _0x1c8ba4=_0x44cd[_0x369289];return _0x1c8ba4;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xd44c('0x0')]},'recipientsId':{'type':Sequelize[_0xd44c('0x1')]},'recipientsDescription':{'type':Sequelize[_0xd44c('0x0')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x2455=['sequelize','TEXT','STRING'];(function(_0x3d827e,_0x4372d0){var _0xd7c688=function(_0x2326d9){while(--_0x2326d9){_0x3d827e['push'](_0x3d827e['shift']());}};_0xd7c688(++_0x4372d0);}(_0x2455,0x147));var _0x5245=function(_0x2598f0,_0x3d61ff){_0x2598f0=_0x2598f0-0x0;var _0x4448c8=_0x2455[_0x2598f0];return _0x4448c8;};'use strict';var Sequelize=require(_0x5245('0x0'));module['exports']={'body':{'type':Sequelize[_0x5245('0x1')]},'senderName':{'type':Sequelize[_0x5245('0x2')]},'recipientsId':{'type':Sequelize[_0x5245('0x1')]},'recipientsDescription':{'type':Sequelize[_0x5245('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 856c3cb..2a745bb 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 _0xe72f=['register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','sendUserNotification','text','body','hasOwnProperty','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','openchannelqueue','smsqueue','voicequeue','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','transaction','create','recipientsDescription','forEach','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','ids','queue','Queue','all','union','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./userNotification.socket'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe72f,0x167));var _0xfe72=function(_0x46a776,_0x586bcd){_0x46a776=_0x46a776-0x0;var _0xe67bac=_0xe72f[_0x46a776];return _0xe67bac;};'use strict';var emlformat=require(_0xfe72('0x0'));var rimraf=require(_0xfe72('0x1'));var zipdir=require(_0xfe72('0x2'));var jsonpatch=require(_0xfe72('0x3'));var rp=require(_0xfe72('0x4'));var moment=require(_0xfe72('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfe72('0x6'));var util=require(_0xfe72('0x7'));var path=require('path');var sox=require(_0xfe72('0x8'));var csv=require(_0xfe72('0x9'));var ejs=require(_0xfe72('0xa'));var fs=require('fs');var fs_extra=require(_0xfe72('0xb'));var _=require(_0xfe72('0xc'));var squel=require(_0xfe72('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe72('0xe'));var toCsv=require(_0xfe72('0x9'));var querystring=require(_0xfe72('0xf'));var Papa=require(_0xfe72('0x10'));var Redis=require('ioredis');var authService=require(_0xfe72('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfe72('0x12'));var hardwareService=require(_0xfe72('0x13'));var logger=require(_0xfe72('0x14'))(_0xfe72('0x15'));var utils=require(_0xfe72('0x16'));var config=require(_0xfe72('0x17'));var licenseUtil=require(_0xfe72('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xfe72('0x19')](config[_0xfe72('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe72('0x1b'))(new Redis(config[_0xfe72('0x1a')]));require(_0xfe72('0x1c'))[_0xfe72('0x1d')](socket);function respondWithStatusCode(_0x4f28d7,_0xb63414){_0xb63414=_0xb63414||0xcc;return function(_0x804aeb){if(_0x804aeb){return _0x4f28d7[_0xfe72('0x1e')](_0xb63414);}return _0x4f28d7[_0xfe72('0x1f')](_0xb63414)[_0xfe72('0x20')]();};}function respondWithResult(_0x1ed719,_0x1dd574){_0x1dd574=_0x1dd574||0xc8;return function(_0x19835c){if(_0x19835c){return _0x1ed719[_0xfe72('0x1f')](_0x1dd574)['json'](_0x19835c);}};}function respondWithFilteredResult(_0x4540c7,_0x27bdab){return function(_0x510006){if(_0x510006){var _0x37d33=typeof _0x27bdab[_0xfe72('0x21')]==='undefined'&&typeof _0x27bdab['limit']===_0xfe72('0x22');var _0x4a8768=_0x510006['count'];var _0x391d7f=_0x37d33?0x0:_0x27bdab[_0xfe72('0x21')];var _0x5539b7=_0x37d33?_0x510006[_0xfe72('0x23')]:_0x27bdab[_0xfe72('0x21')]+_0x27bdab['limit'];var _0x3d468b;if(_0x5539b7>=_0x4a8768){_0x5539b7=_0x4a8768;_0x3d468b=0xc8;}else{_0x3d468b=0xce;}_0x4540c7[_0xfe72('0x1f')](_0x3d468b);return _0x4540c7[_0xfe72('0x24')](_0xfe72('0x25'),_0x391d7f+'-'+_0x5539b7+'/'+_0x4a8768)[_0xfe72('0x26')](_0x510006);}return null;};}function patchUpdates(_0x476574){return function(_0xa2ff3c){try{jsonpatch[_0xfe72('0x27')](_0xa2ff3c,_0x476574,!![]);}catch(_0x26b85b){return BPromise[_0xfe72('0x28')](_0x26b85b);}return _0xa2ff3c[_0xfe72('0x29')]();};}function saveUpdates(_0x1be3b9,_0x4b740e){return function(_0x11c4d8){if(_0x11c4d8){return _0x11c4d8[_0xfe72('0x2a')](_0x1be3b9)[_0xfe72('0x2b')](function(_0x30984d){return _0x30984d;});}return null;};}function removeEntity(_0xbde72a,_0x7b06f9){return function(_0x421d09){if(_0x421d09){return _0x421d09[_0xfe72('0x2c')]()[_0xfe72('0x2b')](function(){_0xbde72a[_0xfe72('0x1f')](0xcc)[_0xfe72('0x20')]();});}};}function handleEntityNotFound(_0x3bd9ba,_0x221d9c){return function(_0x3fbece){if(!_0x3fbece){_0x3bd9ba[_0xfe72('0x1e')](0x194);}return _0x3fbece;};}function handleError(_0x12aefd,_0x5d2dd0){_0x5d2dd0=_0x5d2dd0||0x1f4;return function(_0x546801){logger[_0xfe72('0x2d')](_0x546801[_0xfe72('0x2e')]);if(_0x546801['name']){delete _0x546801['name'];}_0x12aefd['status'](_0x5d2dd0)[_0xfe72('0x2f')](_0x546801);};}exports[_0xfe72('0x30')]=function(_0x21595b,_0xfd9e81,_0x32fde8){if(!_0x21595b['body']['hasOwnProperty'](_0xfe72('0x31'))&&!_0x21595b[_0xfe72('0x32')][_0xfe72('0x33')]('TemplateId')){throw new db['Sequelize'][(_0xfe72('0x34'))](_0xfe72('0x35'));}else{if(_0x21595b[_0xfe72('0x32')]['hasOwnProperty'](_0xfe72('0x36'))&&!_0x21595b[_0xfe72('0x32')][_0xfe72('0x33')](_0xfe72('0x37'))){throw new db[(_0xfe72('0x38'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x21595b[_0xfe72('0x32')][_0xfe72('0x33')](_0xfe72('0x39'))){throw new db['Sequelize'][(_0xfe72('0x34'))](_0xfe72('0x3a'));}else{try{var _0x13d790=JSON[_0xfe72('0x3b')](_0x21595b[_0xfe72('0x32')][_0xfe72('0x39')]);}catch(_0xf45ae2){logger[_0xfe72('0x2d')](_0xf45ae2);throw new db[(_0xfe72('0x38'))]['ValidationError'](_0xfe72('0x3c'));}var _0x2f5918=['chatqueue',_0xfe72('0x3d'),'mailqueue',_0xfe72('0x3e'),_0xfe72('0x3f'),_0xfe72('0x40'),'whatsappqueue','team','user'];if(_['some'](_0x13d790,function(_0xdba1cd){return!_['includes'](_0x2f5918,_0xdba1cd[_0xfe72('0x41')][_0xfe72('0x42')]());})){throw new db[(_0xfe72('0x38'))]['ValidationError'](_0xfe72('0x43'));}}}var _0x5118b1={};_0x5118b1[_0xfe72('0x44')]=_0x21595b[_0xfe72('0x32')][_0xfe72('0x33')](_0xfe72('0x44'))?_0x21595b[_0xfe72('0x32')][_0xfe72('0x44')]:_0x21595b[_0xfe72('0x45')][_0xfe72('0x46')];_0x5118b1['recipientsDescription']=_[_0xfe72('0x47')](_0x21595b[_0xfe72('0x32')]['recipientsDescription'])?null:_0x21595b[_0xfe72('0x32')]['recipientsDescription'];_0x5118b1[_0xfe72('0x48')]=_0x21595b[_0xfe72('0x32')][_0xfe72('0x48')]||![];_0x5118b1[_0xfe72('0x49')]=_0x21595b[_0xfe72('0x45')]['id'];return getContent(_0x21595b[_0xfe72('0x32')])[_0xfe72('0x2b')](function(_0xaf8d81){_0x5118b1[_0xfe72('0x32')]=_0xaf8d81;return getRecipients(_0x13d790);})['then'](function(_0x207b2b){_0x5118b1[_0xfe72('0x4a')]=_[_0xfe72('0x4b')](_0x207b2b)['join'](',');return db[_0xfe72('0x4c')][_0xfe72('0x4d')](function(_0x166fab){return db['UserNotification'][_0xfe72('0x4e')](_0x5118b1,{'raw':!![],'transaction':_0x166fab})[_0xfe72('0x2b')](function(_0x12a72a){var _0x32efef={'sender':_0x5118b1[_0xfe72('0x44')],'description':_0x5118b1[_0xfe72('0x4f')],'content':_0x5118b1[_0xfe72('0x32')],'beep':_0x5118b1['beep']};_0x207b2b[_0xfe72('0x50')](function(_0xbe0051){_0x32efef['recipient']=_0xbe0051;socket[_0xfe72('0x51')](_0xfe72('0x52'),_0x32efef);});return _0x12a72a;});});})['then'](respondWithResult(_0xfd9e81,0xc9))[_0xfe72('0x53')](handleError(_0xfd9e81,null));};function getContent(_0x24ee2f){return new BPromise(function(_0x2deae5,_0x11f42a){if(_0x24ee2f[_0xfe72('0x31')]){_0x2deae5(_0x24ee2f['text']);return;}return db[_0xfe72('0x54')][_0xfe72('0x55')]({'attributes':[_0xfe72('0x56')],'where':{'id':_0x24ee2f[_0xfe72('0x36')]},'raw':!![]})[_0xfe72('0x2b')](function(_0x4df96e){if(!_0x4df96e)throw new db[(_0xfe72('0x38'))]['ValidationError'](_0xfe72('0x57'));var _0x443c9f=Mustache[_0xfe72('0x58')](_0x4df96e['html'],_0x24ee2f[_0xfe72('0x37')]);_0x2deae5(_0x443c9f);})[_0xfe72('0x53')](function(_0x103f3b){_0x11f42a(_0x103f3b);});});}function getRecipients(_0x19f997){return new BPromise(function(_0x1d7d52,_0x318fb2){var _0x31658d=[];var _0x16c0d4=[];_0x19f997[_0xfe72('0x50')](function(_0x47d1a8){var _0x1ad378=_[_0xfe72('0x59')](_0x47d1a8[_0xfe72('0x41')][_0xfe72('0x42')]());if(_0x1ad378==='User'){_0x31658d=_['union'](_0x31658d,_0x47d1a8[_0xfe72('0x5a')]);}else{if(_['includes'](_0x1ad378,_0xfe72('0x5b')))_0x1ad378=_0x1ad378['replace'](_0xfe72('0x5b'),_0xfe72('0x5c'));_0x47d1a8['ids']['forEach'](function(_0x46a7a4){_0x16c0d4['push'](getAgents(_0x1ad378,_0x46a7a4));});}});return BPromise[_0xfe72('0x5d')](_0x16c0d4)[_0xfe72('0x2b')](function(_0xe4a0bc){_0x31658d=_[_0xfe72('0x5e')](_0x31658d,_[_0xfe72('0x5f')](_0xe4a0bc));_0x1d7d52(_0x31658d);})['catch'](function(_0x4ea202){_0x318fb2(_0x4ea202);});});}function getAgents(_0x5242b6,_0x1b994a){return new BPromise(function(_0x3b92e0,_0x587b89){return db[_0x5242b6][_0xfe72('0x55')]({'where':{'id':_0x1b994a}})[_0xfe72('0x2b')](function(_0x3cc4f9){return _0x3cc4f9['getAgents']({'attributes':['id'],'raw':!![]})[_0xfe72('0x2b')](function(_0x1a394c){var _0x4d1bca=_[_0xfe72('0x60')](_0x1a394c,'id');_0x3b92e0(_0x4d1bca);});})[_0xfe72('0x53')](function(_0x1aab8b){_0x587b89(_0x1aab8b);});});} \ No newline at end of file +var _0x1b0f=['eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userNotification.socket','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','forEach','recipient','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','union','queue','replace','ids','push','all','flatten','getAgents'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x1b0f,0xbc));var _0xf1b0=function(_0x30cbfc,_0x2c9f0a){_0x30cbfc=_0x30cbfc-0x0;var _0x539a18=_0x1b0f[_0x30cbfc];return _0x539a18;};'use strict';var emlformat=require(_0xf1b0('0x0'));var rimraf=require(_0xf1b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1b0('0x2'));var rp=require(_0xf1b0('0x3'));var moment=require('moment');var BPromise=require(_0xf1b0('0x4'));var Mustache=require('mustache');var util=require(_0xf1b0('0x5'));var path=require(_0xf1b0('0x6'));var sox=require(_0xf1b0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf1b0('0x8'));var crypto=require(_0xf1b0('0x9'));var jsforce=require(_0xf1b0('0xa'));var deskjs=require(_0xf1b0('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf1b0('0xc'));var Papa=require(_0xf1b0('0xd'));var Redis=require(_0xf1b0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf1b0('0xf'));var as=require(_0xf1b0('0x10'));var hardwareService=require(_0xf1b0('0x11'));var logger=require(_0xf1b0('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xf1b0('0x13'));var licenseUtil=require(_0xf1b0('0x14'));var db=require(_0xf1b0('0x15'))['db'];config[_0xf1b0('0x16')]=_[_0xf1b0('0x17')](config[_0xf1b0('0x16')],{'host':_0xf1b0('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1b0('0x16')]));require(_0xf1b0('0x19'))['register'](socket);function respondWithStatusCode(_0x4009c0,_0x152693){_0x152693=_0x152693||0xcc;return function(_0xc2f2da){if(_0xc2f2da){return _0x4009c0['sendStatus'](_0x152693);}return _0x4009c0[_0xf1b0('0x1a')](_0x152693)[_0xf1b0('0x1b')]();};}function respondWithResult(_0x3c1ddf,_0x372b3c){_0x372b3c=_0x372b3c||0xc8;return function(_0x31665c){if(_0x31665c){return _0x3c1ddf[_0xf1b0('0x1a')](_0x372b3c)[_0xf1b0('0x1c')](_0x31665c);}};}function respondWithFilteredResult(_0x178395,_0x5aa7da){return function(_0x2a70bc){if(_0x2a70bc){var _0x46b83e=typeof _0x5aa7da[_0xf1b0('0x1d')]===_0xf1b0('0x1e')&&typeof _0x5aa7da[_0xf1b0('0x1f')]==='undefined';var _0x5ddab4=_0x2a70bc[_0xf1b0('0x20')];var _0x101f28=_0x46b83e?0x0:_0x5aa7da[_0xf1b0('0x1d')];var _0x12b72f=_0x46b83e?_0x2a70bc['count']:_0x5aa7da[_0xf1b0('0x1d')]+_0x5aa7da[_0xf1b0('0x1f')];var _0x2d022c;if(_0x12b72f>=_0x5ddab4){_0x12b72f=_0x5ddab4;_0x2d022c=0xc8;}else{_0x2d022c=0xce;}_0x178395[_0xf1b0('0x1a')](_0x2d022c);return _0x178395['set'](_0xf1b0('0x21'),_0x101f28+'-'+_0x12b72f+'/'+_0x5ddab4)[_0xf1b0('0x1c')](_0x2a70bc);}return null;};}function patchUpdates(_0x5ede9d){return function(_0x32b371){try{jsonpatch['apply'](_0x32b371,_0x5ede9d,!![]);}catch(_0xc056f1){return BPromise['reject'](_0xc056f1);}return _0x32b371[_0xf1b0('0x22')]();};}function saveUpdates(_0x52d31b,_0x2d62e9){return function(_0x1858d0){if(_0x1858d0){return _0x1858d0[_0xf1b0('0x23')](_0x52d31b)[_0xf1b0('0x24')](function(_0x15ff74){return _0x15ff74;});}return null;};}function removeEntity(_0x3606fa,_0x48df94){return function(_0x42f582){if(_0x42f582){return _0x42f582[_0xf1b0('0x25')]()[_0xf1b0('0x24')](function(){_0x3606fa[_0xf1b0('0x1a')](0xcc)[_0xf1b0('0x1b')]();});}};}function handleEntityNotFound(_0x3a8990,_0x14f50a){return function(_0x536a07){if(!_0x536a07){_0x3a8990[_0xf1b0('0x26')](0x194);}return _0x536a07;};}function handleError(_0x512c49,_0xab3a59){_0xab3a59=_0xab3a59||0x1f4;return function(_0x4512af){logger[_0xf1b0('0x27')](_0x4512af[_0xf1b0('0x28')]);if(_0x4512af[_0xf1b0('0x29')]){delete _0x4512af['name'];}_0x512c49[_0xf1b0('0x1a')](_0xab3a59)[_0xf1b0('0x2a')](_0x4512af);};}exports[_0xf1b0('0x2b')]=function(_0x496d9d,_0x2bf4de,_0x2822ed){if(!_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x2d')]('text')&&!_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x2d')](_0xf1b0('0x2e'))){throw new db[(_0xf1b0('0x2f'))]['ValidationError'](_0xf1b0('0x30'));}else{if(_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x2d')](_0xf1b0('0x2e'))&&!_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x2d')](_0xf1b0('0x31'))){throw new db[(_0xf1b0('0x2f'))]['ValidationError'](_0xf1b0('0x32'));}if(!_0x496d9d['body'][_0xf1b0('0x2d')](_0xf1b0('0x33'))){throw new db[(_0xf1b0('0x2f'))][(_0xf1b0('0x34'))](_0xf1b0('0x35'));}else{try{var _0x40609f=JSON[_0xf1b0('0x36')](_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x33')]);}catch(_0x58cc49){logger[_0xf1b0('0x27')](_0x58cc49);throw new db[(_0xf1b0('0x2f'))][(_0xf1b0('0x34'))](_0xf1b0('0x37'));}var _0x57c747=['chatqueue','faxqueue','mailqueue',_0xf1b0('0x38'),_0xf1b0('0x39'),_0xf1b0('0x3a'),'whatsappqueue',_0xf1b0('0x3b'),_0xf1b0('0x3c')];if(_[_0xf1b0('0x3d')](_0x40609f,function(_0x537250){return!_[_0xf1b0('0x3e')](_0x57c747,_0x537250['model'][_0xf1b0('0x3f')]());})){throw new db[(_0xf1b0('0x2f'))][(_0xf1b0('0x34'))](_0xf1b0('0x40'));}}}var _0x478805={};_0x478805[_0xf1b0('0x41')]=_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x2d')](_0xf1b0('0x41'))?_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x41')]:_0x496d9d[_0xf1b0('0x3c')]['fullname'];_0x478805[_0xf1b0('0x42')]=_[_0xf1b0('0x43')](_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x42')])?null:_0x496d9d[_0xf1b0('0x2c')][_0xf1b0('0x42')];_0x478805['beep']=_0x496d9d['body'][_0xf1b0('0x44')]||![];_0x478805[_0xf1b0('0x45')]=_0x496d9d[_0xf1b0('0x3c')]['id'];return getContent(_0x496d9d[_0xf1b0('0x2c')])[_0xf1b0('0x24')](function(_0x2ff6d7){_0x478805[_0xf1b0('0x2c')]=_0x2ff6d7;return getRecipients(_0x40609f);})[_0xf1b0('0x24')](function(_0x56f99e){_0x478805[_0xf1b0('0x46')]=_[_0xf1b0('0x47')](_0x56f99e)[_0xf1b0('0x48')](',');return db[_0xf1b0('0x49')]['transaction'](function(_0x4b70cf){return db[_0xf1b0('0x4a')]['create'](_0x478805,{'raw':!![],'transaction':_0x4b70cf})[_0xf1b0('0x24')](function(_0x266130){var _0xe2c46c={'sender':_0x478805['senderName'],'description':_0x478805['recipientsDescription'],'content':_0x478805['body'],'beep':_0x478805['beep']};_0x56f99e[_0xf1b0('0x4b')](function(_0x52e9a4){_0xe2c46c[_0xf1b0('0x4c')]=_0x52e9a4;socket['emit']('userNotification:send',_0xe2c46c);});return _0x266130;});});})[_0xf1b0('0x24')](respondWithResult(_0x2bf4de,0xc9))[_0xf1b0('0x4d')](handleError(_0x2bf4de,null));};function getContent(_0x12061b){return new BPromise(function(_0x33b972,_0x488b93){if(_0x12061b[_0xf1b0('0x4e')]){_0x33b972(_0x12061b['text']);return;}return db[_0xf1b0('0x4f')]['findOne']({'attributes':[_0xf1b0('0x50')],'where':{'id':_0x12061b[_0xf1b0('0x2e')]},'raw':!![]})[_0xf1b0('0x24')](function(_0x4bd237){if(!_0x4bd237)throw new db[(_0xf1b0('0x2f'))][(_0xf1b0('0x34'))](_0xf1b0('0x51'));var _0x3da6f7=Mustache[_0xf1b0('0x52')](_0x4bd237[_0xf1b0('0x50')],_0x12061b[_0xf1b0('0x31')]);_0x33b972(_0x3da6f7);})['catch'](function(_0x3bab2e){_0x488b93(_0x3bab2e);});});}function getRecipients(_0x2e67b2){return new BPromise(function(_0xc5c236,_0x2aa349){var _0x48024a=[];var _0x4ec190=[];_0x2e67b2[_0xf1b0('0x4b')](function(_0x22468a){var _0x3b4efb=_[_0xf1b0('0x53')](_0x22468a[_0xf1b0('0x54')]['toLowerCase']());if(_0x3b4efb===_0xf1b0('0x55')){_0x48024a=_[_0xf1b0('0x56')](_0x48024a,_0x22468a['ids']);}else{if(_[_0xf1b0('0x3e')](_0x3b4efb,_0xf1b0('0x57')))_0x3b4efb=_0x3b4efb[_0xf1b0('0x58')](_0xf1b0('0x57'),'Queue');_0x22468a[_0xf1b0('0x59')][_0xf1b0('0x4b')](function(_0x110610){_0x4ec190[_0xf1b0('0x5a')](getAgents(_0x3b4efb,_0x110610));});}});return BPromise[_0xf1b0('0x5b')](_0x4ec190)[_0xf1b0('0x24')](function(_0x533293){_0x48024a=_['union'](_0x48024a,_[_0xf1b0('0x5c')](_0x533293));_0xc5c236(_0x48024a);})['catch'](function(_0x3b29aa){_0x2aa349(_0x3b29aa);});});}function getAgents(_0x5a6e88,_0x15fcd9){return new BPromise(function(_0x318664,_0x1cb451){return db[_0x5a6e88]['findOne']({'where':{'id':_0x15fcd9}})['then'](function(_0x2989a3){return _0x2989a3[_0xf1b0('0x5d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2d93b7){var _0x55c7cd=_['map'](_0x2d93b7,'id');_0x318664(_0x55c7cd);});})['catch'](function(_0x1564cd){_0x1cb451(_0x1564cd);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 541feb7..df1ae67 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 _0x38a2=['hook','UserNotification','setMaxListeners','save','update','remove'];(function(_0x3d589e,_0xe1c704){var _0x20fe2c=function(_0x3d6509){while(--_0x3d6509){_0x3d589e['push'](_0x3d589e['shift']());}};_0x20fe2c(++_0xe1c704);}(_0x38a2,0x169));var _0x238a=function(_0x20f5e3,_0x443196){_0x20f5e3=_0x20f5e3-0x0;var _0x2247f3=_0x38a2[_0x20f5e3];return _0x2247f3;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x238a('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x238a('0x1')](0x0);var events={'afterCreate':_0x238a('0x2'),'afterUpdate':_0x238a('0x3'),'afterDestroy':_0x238a('0x4')};function emitEvent(_0x223114){return function(_0x133498,_0xf8b336,_0x3ce3f9){UserNotificationEvents['emit'](_0x223114+':'+_0x133498['id'],_0x133498);UserNotificationEvents['emit'](_0x223114,_0x133498);_0x3ce3f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x238a('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x9d4c=['save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4e3246,_0x244bd3){var _0x3f680b=function(_0x5d513d){while(--_0x5d513d){_0x4e3246['push'](_0x4e3246['shift']());}};_0x3f680b(++_0x244bd3);}(_0x9d4c,0x83));var _0xc9d4=function(_0x20901b,_0x35945f){_0x20901b=_0x20901b-0x0;var _0x2e4324=_0x9d4c[_0x20901b];return _0x2e4324;};'use strict';var EventEmitter=require(_0xc9d4('0x0'));var UserNotification=require(_0xc9d4('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc9d4('0x2'),'afterUpdate':'update','afterDestroy':_0xc9d4('0x3')};function emitEvent(_0x2b76c0){return function(_0xa0c324,_0x3610fb,_0x3b7466){UserNotificationEvents[_0xc9d4('0x4')](_0x2b76c0+':'+_0xa0c324['id'],_0xa0c324);UserNotificationEvents[_0xc9d4('0x4')](_0x2b76c0,_0xa0c324);_0x3b7466(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xc9d4('0x5')](e,emitEvent(event));}}module[_0xc9d4('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 58809cd..590c66e 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 _0x62f0=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','define','userNotifications','utf8mb4'];(function(_0x5808ca,_0x30161f){var _0x3ba8c5=function(_0x3dd21b){while(--_0x3dd21b){_0x5808ca['push'](_0x5808ca['shift']());}};_0x3ba8c5(++_0x30161f);}(_0x62f0,0x1ae));var _0x062f=function(_0xf80b3,_0x25d5f3){_0xf80b3=_0xf80b3-0x0;var _0x10c489=_0x62f0[_0xf80b3];return _0x10c489;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x062f('0x0'))(_0x062f('0x1'));var moment=require(_0x062f('0x2'));var BPromise=require(_0x062f('0x3'));var rp=require(_0x062f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x062f('0x5'));var config=require(_0x062f('0x6'));var attributes=require(_0x062f('0x7'));module[_0x062f('0x8')]=function(_0x309f0c,_0x50299d){return _0x309f0c[_0x062f('0x9')]('UserNotification',attributes,{'tableName':_0x062f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x062f('0xb'),'collate':_0x062f('0xc')});}; \ No newline at end of file +var _0xa4b9=['path','../../config/environment','./userNotification.attributes','exports','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa4b9,0x10f));var _0x9a4b=function(_0xb57be1,_0x189ee5){_0xb57be1=_0xb57be1-0x0;var _0x294aa3=_0xa4b9[_0xb57be1];return _0x294aa3;};'use strict';var _=require(_0x9a4b('0x0'));var util=require(_0x9a4b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9a4b('0x2'));var BPromise=require('bluebird');var rp=require(_0x9a4b('0x3'));var fs=require('fs');var path=require(_0x9a4b('0x4'));var rimraf=require('rimraf');var config=require(_0x9a4b('0x5'));var attributes=require(_0x9a4b('0x6'));module[_0x9a4b('0x7')]=function(_0x4edb15,_0x4c9822){return _0x4edb15['define']('UserNotification',attributes,{'tableName':_0x9a4b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a4b('0x9'),'collate':_0x9a4b('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index c988cbf..f2d1bf5 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 _0x721a=['then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','UserNotification,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','./userNotification.socket','register','request'];(function(_0x338496,_0xd67de2){var _0x3f83c5=function(_0x5f4128){while(--_0x5f4128){_0x338496['push'](_0x338496['shift']());}};_0x3f83c5(++_0xd67de2);}(_0x721a,0x15d));var _0xa721=function(_0x3db1a5,_0x1edc34){_0x3db1a5=_0x3db1a5-0x0;var _0x5bdb92=_0x721a[_0x3db1a5];return _0x5bdb92;};'use strict';var _=require('lodash');var util=require(_0xa721('0x0'));var moment=require(_0xa721('0x1'));var BPromise=require(_0xa721('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa721('0x3'));var logger=require(_0xa721('0x4'))(_0xa721('0x5'));var config=require(_0xa721('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa721('0x7')]['http']({'port':0x232a});config['redis']=_[_0xa721('0x8')](config['redis'],{'host':_0xa721('0x9'),'port':0x18eb});var socket=require(_0xa721('0xa'))(new Redis(config[_0xa721('0xb')]));require(_0xa721('0xc'))[_0xa721('0xd')](socket);function respondWithRpcPromise(_0x34614c,_0x28ead9,_0x90841b){return new BPromise(function(_0x5852d5,_0x5a4be0){return client[_0xa721('0xe')](_0x34614c,_0x90841b)[_0xa721('0xf')](function(_0x131b8a){logger[_0xa721('0x10')]('UserNotification,\x20%s,\x20%s',_0x28ead9,_0xa721('0x11'));logger[_0xa721('0x12')](_0xa721('0x13'),_0x28ead9,_0xa721('0x11'),JSON[_0xa721('0x14')](_0x131b8a));if(_0x131b8a[_0xa721('0x15')]){if(_0x131b8a['error']['code']===0x1f4){logger['error'](_0xa721('0x16'),_0x28ead9,_0x131b8a['error'][_0xa721('0x17')]);return _0x5a4be0(_0x131b8a['error'][_0xa721('0x17')]);}logger[_0xa721('0x15')](_0xa721('0x16'),_0x28ead9,_0x131b8a[_0xa721('0x15')][_0xa721('0x17')]);return _0x5852d5(_0x131b8a[_0xa721('0x15')]['message']);}else{logger[_0xa721('0x10')](_0xa721('0x16'),_0x28ead9,_0xa721('0x11'));_0x5852d5(_0x131b8a[_0xa721('0x18')]['message']);}})[_0xa721('0x19')](function(_0x36e74e){logger[_0xa721('0x15')](_0xa721('0x16'),_0x28ead9,_0x36e74e);_0x5a4be0(_0x36e74e);});});} \ No newline at end of file +var _0xb623=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x57eb19,_0x207501){var _0x1621c8=function(_0x4fe78e){while(--_0x4fe78e){_0x57eb19['push'](_0x57eb19['shift']());}};_0x1621c8(++_0x207501);}(_0xb623,0x141));var _0x3b62=function(_0x36590e,_0x163d09){_0x36590e=_0x36590e-0x0;var _0x4922c8=_0xb623[_0x36590e];return _0x4922c8;};'use strict';var _=require(_0x3b62('0x0'));var util=require('util');var moment=require(_0x3b62('0x1'));var BPromise=require(_0x3b62('0x2'));var rs=require(_0x3b62('0x3'));var fs=require('fs');var Redis=require(_0x3b62('0x4'));var db=require(_0x3b62('0x5'))['db'];var utils=require(_0x3b62('0x6'));var logger=require('../../config/logger')(_0x3b62('0x7'));var config=require(_0x3b62('0x8'));var jayson=require(_0x3b62('0x9'));var client=jayson[_0x3b62('0xa')]['http']({'port':0x232a});config[_0x3b62('0xb')]=_[_0x3b62('0xc')](config['redis'],{'host':_0x3b62('0xd'),'port':0x18eb});var socket=require(_0x3b62('0xe'))(new Redis(config[_0x3b62('0xb')]));require(_0x3b62('0xf'))['register'](socket);function respondWithRpcPromise(_0x1f665e,_0x39c715,_0x16ed0e){return new BPromise(function(_0xfc3a97,_0x54291b){return client[_0x3b62('0x10')](_0x1f665e,_0x16ed0e)[_0x3b62('0x11')](function(_0x7f9edf){logger['info'](_0x3b62('0x12'),_0x39c715,_0x3b62('0x13'));logger[_0x3b62('0x14')](_0x3b62('0x15'),_0x39c715,_0x3b62('0x13'),JSON[_0x3b62('0x16')](_0x7f9edf));if(_0x7f9edf[_0x3b62('0x17')]){if(_0x7f9edf[_0x3b62('0x17')][_0x3b62('0x18')]===0x1f4){logger[_0x3b62('0x17')](_0x3b62('0x12'),_0x39c715,_0x7f9edf[_0x3b62('0x17')][_0x3b62('0x19')]);return _0x54291b(_0x7f9edf['error'][_0x3b62('0x19')]);}logger[_0x3b62('0x17')]('UserNotification,\x20%s,\x20%s',_0x39c715,_0x7f9edf['error']['message']);return _0xfc3a97(_0x7f9edf[_0x3b62('0x17')][_0x3b62('0x19')]);}else{logger[_0x3b62('0x1a')](_0x3b62('0x12'),_0x39c715,'request\x20sent');_0xfc3a97(_0x7f9edf[_0x3b62('0x1b')][_0x3b62('0x19')]);}})[_0x3b62('0x1c')](function(_0x47dfa2){logger[_0x3b62('0x17')](_0x3b62('0x12'),_0x39c715,_0x47dfa2);_0x54291b(_0x47dfa2);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 855215a..7699cb2 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 _0xce27=['update','register','length','userNotification:','./userNotification.events','save'];(function(_0x41c92f,_0x2f66b7){var _0x19f1bd=function(_0x31ff59){while(--_0x31ff59){_0x41c92f['push'](_0x41c92f['shift']());}};_0x19f1bd(++_0x2f66b7);}(_0xce27,0x1d8));var _0x7ce2=function(_0x3ae170,_0xd94c90){_0x3ae170=_0x3ae170-0x0;var _0x3bd016=_0xce27[_0x3ae170];return _0x3bd016;};'use strict';var UserNotificationEvents=require(_0x7ce2('0x0'));var events=[_0x7ce2('0x1'),'remove',_0x7ce2('0x2')];function createListener(_0x377bb1,_0x389fa5){return function(_0x453ab7){_0x389fa5['emit'](_0x377bb1,_0x453ab7);};}function removeListener(_0x11ef8a,_0x3a67f6){return function(){UserNotificationEvents['removeListener'](_0x11ef8a,_0x3a67f6);};}exports[_0x7ce2('0x3')]=function(_0x441599){for(var _0x230c10=0x0,_0x9f26de=events[_0x7ce2('0x4')];_0x230c10<_0x9f26de;_0x230c10++){var _0x34d737=events[_0x230c10];var _0x5485bd=createListener(_0x7ce2('0x5')+_0x34d737,_0x441599);UserNotificationEvents['on'](_0x34d737,_0x5485bd);}}; \ No newline at end of file +var _0xc14b=['register','length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x106d46,_0x1120de){var _0x2a0119=function(_0x1603af){while(--_0x1603af){_0x106d46['push'](_0x106d46['shift']());}};_0x2a0119(++_0x1120de);}(_0xc14b,0xa5));var _0xbc14=function(_0x32b312,_0x4e3f0f){_0x32b312=_0x32b312-0x0;var _0x313368=_0xc14b[_0x32b312];return _0x313368;};'use strict';var UserNotificationEvents=require(_0xbc14('0x0'));var events=[_0xbc14('0x1'),_0xbc14('0x2'),_0xbc14('0x3')];function createListener(_0xf29a65,_0x46f7f7){return function(_0x476816){_0x46f7f7[_0xbc14('0x4')](_0xf29a65,_0x476816);};}function removeListener(_0x233a05,_0x4a6d81){return function(){UserNotificationEvents[_0xbc14('0x5')](_0x233a05,_0x4a6d81);};}exports[_0xbc14('0x6')]=function(_0x45eba0){for(var _0x1f4ba8=0x0,_0x467c82=events[_0xbc14('0x7')];_0x1f4ba8<_0x467c82;_0x1f4ba8++){var _0x41bf44=events[_0x1f4ba8];var _0x23b37d=createListener(_0xbc14('0x8')+_0x41bf44,_0x45eba0);UserNotificationEvents['on'](_0x41bf44,_0x23b37d);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index feaccf0..529d81e 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x129b52,_0x29a8f3){var _0x5e0266=function(_0x4ffc13){while(--_0x4ffc13){_0x129b52['push'](_0x129b52['shift']());}};_0x5e0266(++_0x29a8f3);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x50583c,_0x2d2dee){var _0x358ba5=function(_0x1aa091){while(--_0x1aa091){_0x50583c['push'](_0x50583c['shift']());}};_0x358ba5(++_0x2d2dee);}(_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 9207d38..19267d5 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 _0x9740=['INTEGER','exports'];(function(_0x493750,_0x4be4cb){var _0x4916bc=function(_0x2270c0){while(--_0x2270c0){_0x493750['push'](_0x493750['shift']());}};_0x4916bc(++_0x4be4cb);}(_0x9740,0x10b));var _0x0974=function(_0xbbb939,_0x30521d){_0xbbb939=_0xbbb939-0x0;var _0x1f1dd1=_0x9740[_0xbbb939];return _0x1f1dd1;};'use strict';var Sequelize=require('sequelize');module[_0x0974('0x0')]={'penalty':{'type':Sequelize[_0x0974('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x86ce=['sequelize','exports'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x86ce,0x174));var _0xe86c=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0x86ce[_0x1a4748];return _0x28ca99;};'use strict';var Sequelize=require(_0xe86c('0x0'));module[_0xe86c('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 a6c5316..f168d76 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 _0xfc65=['../../config/logger','api','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','exports','define','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc65,0x94));var _0x5fc6=function(_0x10f3b9,_0x7b57e0){_0x10f3b9=_0x10f3b9-0x0;var _0x2cab0c=_0xfc65[_0x10f3b9];return _0x2cab0c;};'use strict';var _=require(_0x5fc6('0x0'));var util=require(_0x5fc6('0x1'));var logger=require(_0x5fc6('0x2'))(_0x5fc6('0x3'));var moment=require('moment');var BPromise=require(_0x5fc6('0x4'));var rp=require(_0x5fc6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fc6('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fc6('0x7'));module[_0x5fc6('0x8')]=function(_0x42cfb5,_0x533179){return _0x42cfb5[_0x5fc6('0x9')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafd6=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','lodash'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0xafd6,0x15d));var _0x6afd=function(_0xda3125,_0x224323){_0xda3125=_0xda3125-0x0;var _0x174215=_0xafd6[_0xda3125];return _0x174215;};'use strict';var _=require(_0x6afd('0x0'));var util=require(_0x6afd('0x1'));var logger=require(_0x6afd('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6afd('0x3'));var fs=require('fs');var path=require(_0x6afd('0x4'));var rimraf=require(_0x6afd('0x5'));var config=require(_0x6afd('0x6'));var attributes=require(_0x6afd('0x7'));module[_0x6afd('0x8')]=function(_0x5c5aa7,_0x430a34){return _0x5c5aa7['define'](_0x6afd('0x9'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 05087fa..71c79b5 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 _0x37bf=['catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x23a8ca,_0x47a747){var _0x3cb37a=function(_0xeec0e8){while(--_0xeec0e8){_0x23a8ca['push'](_0x23a8ca['shift']());}};_0x3cb37a(++_0x47a747);}(_0x37bf,0xa9));var _0xf37b=function(_0x2ff324,_0xa5a189){_0x2ff324=_0x2ff324-0x0;var _0x1a6807=_0x37bf[_0x2ff324];return _0x1a6807;};'use strict';var _=require(_0xf37b('0x0'));var util=require(_0xf37b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf37b('0x2'));var fs=require('fs');var Redis=require(_0xf37b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf37b('0x4'));var logger=require(_0xf37b('0x5'))(_0xf37b('0x6'));var config=require(_0xf37b('0x7'));var jayson=require(_0xf37b('0x8'));var client=jayson[_0xf37b('0x9')][_0xf37b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a16bb,_0x2d2581,_0x3787e1){return new BPromise(function(_0x588ecf,_0x1776ac){return client[_0xf37b('0xb')](_0x2a16bb,_0x3787e1)[_0xf37b('0xc')](function(_0x2bb2c5){logger[_0xf37b('0xd')](_0xf37b('0xe'),_0x2d2581,_0xf37b('0xf'));logger[_0xf37b('0x10')](_0xf37b('0x11'),_0x2d2581,_0xf37b('0xf'),JSON[_0xf37b('0x12')](_0x2bb2c5));if(_0x2bb2c5[_0xf37b('0x13')]){if(_0x2bb2c5[_0xf37b('0x13')][_0xf37b('0x14')]===0x1f4){logger[_0xf37b('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2d2581,_0x2bb2c5[_0xf37b('0x13')]['message']);return _0x1776ac(_0x2bb2c5[_0xf37b('0x13')][_0xf37b('0x15')]);}logger[_0xf37b('0x13')](_0xf37b('0xe'),_0x2d2581,_0x2bb2c5[_0xf37b('0x13')][_0xf37b('0x15')]);return _0x588ecf(_0x2bb2c5[_0xf37b('0x13')][_0xf37b('0x15')]);}else{logger[_0xf37b('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2d2581,_0xf37b('0xf'));_0x588ecf(_0x2bb2c5[_0xf37b('0x16')][_0xf37b('0x15')]);}})[_0xf37b('0x17')](function(_0x7b2111){logger['error'](_0xf37b('0xe'),_0x2d2581,_0x7b2111);_0x1776ac(_0x7b2111);});});} \ No newline at end of file +var _0xb2a4=['UserOpenchannelQueue,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x38174a,_0x5449c5){var _0xba6e76=function(_0x50a2ee){while(--_0x50a2ee){_0x38174a['push'](_0x38174a['shift']());}};_0xba6e76(++_0x5449c5);}(_0xb2a4,0x169));var _0x4b2a=function(_0x505ffc,_0xcc9221){_0x505ffc=_0x505ffc-0x0;var _0xb1807b=_0xb2a4[_0x505ffc];return _0xb1807b;};'use strict';var _=require(_0x4b2a('0x0'));var util=require(_0x4b2a('0x1'));var moment=require(_0x4b2a('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b2a('0x3'));var fs=require('fs');var Redis=require(_0x4b2a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4b2a('0x5'));var config=require(_0x4b2a('0x6'));var jayson=require(_0x4b2a('0x7'));var client=jayson[_0x4b2a('0x8')][_0x4b2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26a841,_0x2c1a60,_0x302c95){return new BPromise(function(_0x58ef01,_0x1d8d5f){return client['request'](_0x26a841,_0x302c95)[_0x4b2a('0xa')](function(_0x1fabc5){logger[_0x4b2a('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2c1a60,_0x4b2a('0xc'));logger[_0x4b2a('0xd')](_0x4b2a('0xe'),_0x2c1a60,_0x4b2a('0xc'),JSON[_0x4b2a('0xf')](_0x1fabc5));if(_0x1fabc5[_0x4b2a('0x10')]){if(_0x1fabc5[_0x4b2a('0x10')][_0x4b2a('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2c1a60,_0x1fabc5[_0x4b2a('0x10')]['message']);return _0x1d8d5f(_0x1fabc5[_0x4b2a('0x10')][_0x4b2a('0x12')]);}logger[_0x4b2a('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2c1a60,_0x1fabc5['error'][_0x4b2a('0x12')]);return _0x58ef01(_0x1fabc5[_0x4b2a('0x10')][_0x4b2a('0x12')]);}else{logger[_0x4b2a('0xb')](_0x4b2a('0x13'),_0x2c1a60,_0x4b2a('0xc'));_0x58ef01(_0x1fabc5['result'][_0x4b2a('0x12')]);}})['catch'](function(_0x51226a){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2c1a60,_0x51226a);_0x1d8d5f(_0x51226a);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 94c4898..535a6d4 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 _0xf5e0=['/:id/resources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/sections','getSections'];(function(_0x1958d0,_0x116f21){var _0x28ae64=function(_0x5c3bb8){while(--_0x5c3bb8){_0x1958d0['push'](_0x1958d0['shift']());}};_0x28ae64(++_0x116f21);}(_0xf5e0,0x1ee));var _0x0f5e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf5e0[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x0f5e('0x0'));var util=require(_0x0f5e('0x1'));var path=require(_0x0f5e('0x2'));var timeout=require(_0x0f5e('0x3'));var express=require(_0x0f5e('0x4'));var router=express[_0x0f5e('0x5')]();var fs_extra=require(_0x0f5e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0f5e('0x7'));var config=require(_0x0f5e('0x8'));var controller=require(_0x0f5e('0x9'));router[_0x0f5e('0xa')]('/',auth['isAuthenticated'](),controller[_0x0f5e('0xb')]);router[_0x0f5e('0xa')](_0x0f5e('0xc'),auth[_0x0f5e('0xd')](),controller[_0x0f5e('0xe')]);router[_0x0f5e('0xa')](_0x0f5e('0xf'),auth[_0x0f5e('0xd')](),controller['show']);router['get'](_0x0f5e('0x10'),auth['isAuthenticated'](),controller[_0x0f5e('0x11')]);router[_0x0f5e('0xa')](_0x0f5e('0x12'),auth[_0x0f5e('0xd')](),controller['getResources']);router[_0x0f5e('0x13')]('/',auth['isAuthenticated'](),controller[_0x0f5e('0x14')]);router[_0x0f5e('0x13')](_0x0f5e('0x15'),auth[_0x0f5e('0xd')](),controller[_0x0f5e('0x16')]);router[_0x0f5e('0x13')](_0x0f5e('0x10'),auth['isAuthenticated'](),controller[_0x0f5e('0x17')]);router[_0x0f5e('0x13')](_0x0f5e('0x12'),auth[_0x0f5e('0xd')](),controller[_0x0f5e('0x18')]);router[_0x0f5e('0x19')](_0x0f5e('0xf'),auth[_0x0f5e('0xd')](),controller[_0x0f5e('0x1a')]);router[_0x0f5e('0x1b')](_0x0f5e('0xf'),auth[_0x0f5e('0xd')](),controller[_0x0f5e('0x1c')]);router[_0x0f5e('0x1b')](_0x0f5e('0x10'),auth[_0x0f5e('0xd')](),controller[_0x0f5e('0x1d')]);router['delete'](_0x0f5e('0x12'),auth[_0x0f5e('0xd')](),controller[_0x0f5e('0x1e')]);module[_0x0f5e('0x1f')]=router; \ No newline at end of file +var _0x070d=['get','isAuthenticated','describe','/:id','getSections','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x070d,0xe6));var _0xd070=function(_0x1d5d4a,_0x44102d){_0x1d5d4a=_0x1d5d4a-0x0;var _0x348926=_0x070d[_0x1d5d4a];return _0x348926;};'use strict';var multer=require(_0xd070('0x0'));var util=require(_0xd070('0x1'));var path=require(_0xd070('0x2'));var timeout=require(_0xd070('0x3'));var express=require(_0xd070('0x4'));var router=express[_0xd070('0x5')]();var fs_extra=require(_0xd070('0x6'));var auth=require(_0xd070('0x7'));var interaction=require(_0xd070('0x8'));var config=require('../../config/environment');var controller=require(_0xd070('0x9'));router[_0xd070('0xa')]('/',auth[_0xd070('0xb')](),controller['index']);router['get']('/describe',auth[_0xd070('0xb')](),controller[_0xd070('0xc')]);router['get'](_0xd070('0xd'),auth[_0xd070('0xb')](),controller['show']);router[_0xd070('0xa')]('/:id/sections',auth[_0xd070('0xb')](),controller[_0xd070('0xe')]);router['get'](_0xd070('0xf'),auth[_0xd070('0xb')](),controller['getResources']);router[_0xd070('0x10')]('/',auth[_0xd070('0xb')](),controller[_0xd070('0x11')]);router['post'](_0xd070('0x12'),auth[_0xd070('0xb')](),controller[_0xd070('0x13')]);router[_0xd070('0x10')](_0xd070('0x14'),auth[_0xd070('0xb')](),controller[_0xd070('0x15')]);router[_0xd070('0x10')](_0xd070('0xf'),auth[_0xd070('0xb')](),controller[_0xd070('0x16')]);router[_0xd070('0x17')]('/:id',auth[_0xd070('0xb')](),controller[_0xd070('0x18')]);router[_0xd070('0x19')](_0xd070('0xd'),auth[_0xd070('0xb')](),controller[_0xd070('0x1a')]);router[_0xd070('0x19')](_0xd070('0x14'),auth[_0xd070('0xb')](),controller[_0xd070('0x1b')]);router['delete']('/:id/resources',auth[_0xd070('0xb')](),controller[_0xd070('0x1c')]);module[_0xd070('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 00ad370..7467db4 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 _0x0bb0=['split','BOOLEAN','exports','STRING','setDataValue','crudPermissions','getDataValue'];(function(_0x4f1c7c,_0x309c96){var _0x46a96f=function(_0x339070){while(--_0x339070){_0x4f1c7c['push'](_0x4f1c7c['shift']());}};_0x46a96f(++_0x309c96);}(_0x0bb0,0xc6));var _0x00bb=function(_0x303163,_0x4d373d){_0x303163=_0x303163-0x0;var _0xcf2552=_0x0bb0[_0x303163];return _0xcf2552;};'use strict';var Sequelize=require('sequelize');module[_0x00bb('0x0')]={'name':{'type':Sequelize[_0x00bb('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2111d8){this[_0x00bb('0x2')](_0x00bb('0x3'),_0x2111d8?_0x2111d8['join'](''):[]);},'get':function(){return this[_0x00bb('0x4')](_0x00bb('0x3'))?this['getDataValue'](_0x00bb('0x3'))[_0x00bb('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x00bb('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x00bb('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x00bb('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x00bb('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x00bb('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x00bb('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x00bb('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4b1a=['name','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x145756,_0x39b6ab){var _0x3deded=function(_0x388a62){while(--_0x388a62){_0x145756['push'](_0x145756['shift']());}};_0x3deded(++_0x39b6ab);}(_0x4b1a,0xee));var _0xa4b1=function(_0x56cbcf,_0x25b29d){_0x56cbcf=_0x56cbcf-0x0;var _0x3fbb65=_0x4b1a[_0x56cbcf];return _0x3fbb65;};'use strict';var Sequelize=require(_0xa4b1('0x0'));module[_0xa4b1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa4b1('0x2')},'crudPermissions':{'type':Sequelize[_0xa4b1('0x3')],'set':function(_0x5cd793){this[_0xa4b1('0x4')](_0xa4b1('0x5'),_0x5cd793?_0x5cd793[_0xa4b1('0x6')](''):[]);},'get':function(){return this[_0xa4b1('0x7')](_0xa4b1('0x5'))?this['getDataValue'](_0xa4b1('0x5'))[_0xa4b1('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa4b1('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa4b1('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa4b1('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa4b1('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa4b1('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index f47fb16..acd5e25 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 _0xfa25=['../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','json','undefined','offset','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','catch','params','intersection','includeAll','options','find','create','body','clone','createdAt','crudPermissions','omit','transaction','get','UserProfileSection','findAll','each','autoAssociation','updatedAt','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','sequelize','push','ids','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis'];(function(_0x1c1935,_0x362de1){var _0x51af64=function(_0x6c5897){while(--_0x6c5897){_0x1c1935['push'](_0x1c1935['shift']());}};_0x51af64(++_0x362de1);}(_0xfa25,0xd1));var _0x5fa2=function(_0x388aeb,_0x57e5b6){_0x388aeb=_0x388aeb-0x0;var _0x45e01e=_0xfa25[_0x388aeb];return _0x45e01e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fa2('0x0'));var zipdir=require(_0x5fa2('0x1'));var jsonpatch=require(_0x5fa2('0x2'));var rp=require(_0x5fa2('0x3'));var moment=require(_0x5fa2('0x4'));var BPromise=require(_0x5fa2('0x5'));var Mustache=require(_0x5fa2('0x6'));var util=require(_0x5fa2('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5fa2('0x8'));var ejs=require(_0x5fa2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5fa2('0xa'));var crypto=require('crypto');var jsforce=require(_0x5fa2('0xb'));var deskjs=require(_0x5fa2('0xc'));var toCsv=require(_0x5fa2('0x8'));var querystring=require('querystring');var Papa=require(_0x5fa2('0xd'));var Redis=require(_0x5fa2('0xe'));var authService=require(_0x5fa2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5fa2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5fa2('0x11'));var utils=require(_0x5fa2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5fa2('0x13'));var db=require(_0x5fa2('0x14'))['db'];config[_0x5fa2('0x15')]=_[_0x5fa2('0x16')](config[_0x5fa2('0x15')],{'host':_0x5fa2('0x17'),'port':0x18eb});var socket=require(_0x5fa2('0x18'))(new Redis(config[_0x5fa2('0x15')]));require(_0x5fa2('0x19'))[_0x5fa2('0x1a')](socket);function respondWithStatusCode(_0x462bb3,_0x4e50d6){_0x4e50d6=_0x4e50d6||0xcc;return function(_0xde0526){if(_0xde0526){return _0x462bb3[_0x5fa2('0x1b')](_0x4e50d6);}return _0x462bb3['status'](_0x4e50d6)[_0x5fa2('0x1c')]();};}function respondWithResult(_0xf0786b,_0x1928a3){_0x1928a3=_0x1928a3||0xc8;return function(_0x4fd4f1){if(_0x4fd4f1){return _0xf0786b['status'](_0x1928a3)[_0x5fa2('0x1d')](_0x4fd4f1);}};}function respondWithFilteredResult(_0x449787,_0x2b74fa){return function(_0x522f1c){if(_0x522f1c){var _0x427205=typeof _0x2b74fa['offset']===_0x5fa2('0x1e')&&typeof _0x2b74fa['limit']===_0x5fa2('0x1e');var _0x4503c5=_0x522f1c['count'];var _0x2a34b3=_0x427205?0x0:_0x2b74fa[_0x5fa2('0x1f')];var _0x3a9741=_0x427205?_0x522f1c[_0x5fa2('0x20')]:_0x2b74fa['offset']+_0x2b74fa[_0x5fa2('0x21')];var _0x356902;if(_0x3a9741>=_0x4503c5){_0x3a9741=_0x4503c5;_0x356902=0xc8;}else{_0x356902=0xce;}_0x449787[_0x5fa2('0x22')](_0x356902);return _0x449787[_0x5fa2('0x23')](_0x5fa2('0x24'),_0x2a34b3+'-'+_0x3a9741+'/'+_0x4503c5)[_0x5fa2('0x1d')](_0x522f1c);}return null;};}function patchUpdates(_0x2fb5f9){return function(_0x3e089a){try{jsonpatch[_0x5fa2('0x25')](_0x3e089a,_0x2fb5f9,!![]);}catch(_0x16a18f){return BPromise[_0x5fa2('0x26')](_0x16a18f);}return _0x3e089a[_0x5fa2('0x27')]();};}function saveUpdates(_0xfed25c,_0x48f2f1){return function(_0x184753){if(_0x184753){return _0x184753[_0x5fa2('0x28')](_0xfed25c)[_0x5fa2('0x29')](function(_0x45af15){return _0x45af15;});}return null;};}function removeEntity(_0x5315fe,_0x4d2d12){return function(_0x339a28){if(_0x339a28){return _0x339a28[_0x5fa2('0x2a')]()['then'](function(){_0x5315fe[_0x5fa2('0x22')](0xcc)[_0x5fa2('0x1c')]();});}};}function handleEntityNotFound(_0x37f551,_0x398a05){return function(_0x18cbd7){if(!_0x18cbd7){_0x37f551[_0x5fa2('0x1b')](0x194);}return _0x18cbd7;};}function handleError(_0x4968ed,_0x29a699){_0x29a699=_0x29a699||0x1f4;return function(_0xea29b){logger[_0x5fa2('0x2b')](_0xea29b[_0x5fa2('0x2c')]);if(_0xea29b['name']){delete _0xea29b[_0x5fa2('0x2d')];}_0x4968ed[_0x5fa2('0x22')](_0x29a699)['send'](_0xea29b);};}exports['index']=function(_0x51bb4d,_0x34ebb5){var _0xc5a40c={},_0x5a0d50={},_0x22f054={'count':0x0,'rows':[]};var _0x3d1d41=_[_0x5fa2('0x2e')](db[_0x5fa2('0x2f')][_0x5fa2('0x30')],function(_0x5a41da){return{'name':_0x5a41da[_0x5fa2('0x31')],'type':_0x5a41da[_0x5fa2('0x32')][_0x5fa2('0x33')]};});_0x5a0d50[_0x5fa2('0x34')]=_[_0x5fa2('0x2e')](_0x3d1d41,'name');_0x5a0d50[_0x5fa2('0x35')]=_[_0x5fa2('0x36')](_0x51bb4d['query']);_0x5a0d50['filters']=_['intersection'](_0x5a0d50[_0x5fa2('0x34')],_0x5a0d50[_0x5fa2('0x35')]);_0xc5a40c[_0x5fa2('0x37')]=_['intersection'](_0x5a0d50[_0x5fa2('0x34')],qs[_0x5fa2('0x38')](_0x51bb4d['query']['fields']));_0xc5a40c[_0x5fa2('0x37')]=_0xc5a40c['attributes'][_0x5fa2('0x39')]?_0xc5a40c[_0x5fa2('0x37')]:_0x5a0d50['model'];if(!_0x51bb4d[_0x5fa2('0x35')]['hasOwnProperty'](_0x5fa2('0x3a'))){_0xc5a40c['limit']=qs[_0x5fa2('0x21')](_0x51bb4d[_0x5fa2('0x35')]['limit']);_0xc5a40c[_0x5fa2('0x1f')]=qs[_0x5fa2('0x1f')](_0x51bb4d[_0x5fa2('0x35')][_0x5fa2('0x1f')]);}_0xc5a40c[_0x5fa2('0x3b')]=qs[_0x5fa2('0x3c')](_0x51bb4d[_0x5fa2('0x35')][_0x5fa2('0x3c')]);_0xc5a40c[_0x5fa2('0x3d')]=qs[_0x5fa2('0x3e')](_[_0x5fa2('0x3f')](_0x51bb4d[_0x5fa2('0x35')],_0x5a0d50[_0x5fa2('0x3e')]),_0x3d1d41);if(_0x51bb4d['query'][_0x5fa2('0x40')]){_0xc5a40c[_0x5fa2('0x3d')]=_[_0x5fa2('0x41')](_0xc5a40c['where'],{'$or':_['map'](_0x3d1d41,function(_0x40b385){if(_0x40b385[_0x5fa2('0x32')]!==_0x5fa2('0x42')){var _0x369a6={};_0x369a6[_0x40b385['name']]={'$like':'%'+_0x51bb4d[_0x5fa2('0x35')][_0x5fa2('0x40')]+'%'};return _0x369a6;}})});}_0xc5a40c=_['merge']({},_0xc5a40c,_0x51bb4d['options']);var _0x59be26={'where':_0xc5a40c[_0x5fa2('0x3d')]};return db[_0x5fa2('0x2f')][_0x5fa2('0x20')](_0x59be26)[_0x5fa2('0x29')](function(_0x28d2dc){_0x22f054['count']=_0x28d2dc;if(_0x51bb4d[_0x5fa2('0x35')]['includeAll']){_0xc5a40c[_0x5fa2('0x43')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0xc5a40c);})[_0x5fa2('0x29')](function(_0x3fded0){_0x22f054['rows']=_0x3fded0;return _0x22f054;})[_0x5fa2('0x29')](respondWithFilteredResult(_0x34ebb5,_0xc5a40c))[_0x5fa2('0x44')](handleError(_0x34ebb5,null));};exports['show']=function(_0x502a19,_0x4cdc74){var _0x57d69d={'raw':![],'where':{'id':_0x502a19[_0x5fa2('0x45')]['id']}},_0x439d0a={};_0x439d0a[_0x5fa2('0x34')]=_[_0x5fa2('0x36')](db[_0x5fa2('0x2f')]['rawAttributes']);_0x439d0a[_0x5fa2('0x35')]=_[_0x5fa2('0x36')](_0x502a19['query']);_0x439d0a[_0x5fa2('0x3e')]=_[_0x5fa2('0x46')](_0x439d0a[_0x5fa2('0x34')],_0x439d0a[_0x5fa2('0x35')]);_0x57d69d[_0x5fa2('0x37')]=_['intersection'](_0x439d0a[_0x5fa2('0x34')],qs[_0x5fa2('0x38')](_0x502a19[_0x5fa2('0x35')][_0x5fa2('0x38')]));_0x57d69d[_0x5fa2('0x37')]=_0x57d69d[_0x5fa2('0x37')][_0x5fa2('0x39')]?_0x57d69d['attributes']:_0x439d0a[_0x5fa2('0x34')];if(_0x502a19[_0x5fa2('0x35')][_0x5fa2('0x47')]){_0x57d69d[_0x5fa2('0x43')]=[{'all':!![]}];}_0x57d69d=_[_0x5fa2('0x41')]({},_0x57d69d,_0x502a19[_0x5fa2('0x48')]);return db[_0x5fa2('0x2f')][_0x5fa2('0x49')](_0x57d69d)[_0x5fa2('0x29')](handleEntityNotFound(_0x4cdc74,null))[_0x5fa2('0x29')](respondWithResult(_0x4cdc74,null))[_0x5fa2('0x44')](handleError(_0x4cdc74,null));};exports[_0x5fa2('0x4a')]=function(_0x4f0135,_0x499bec){return db[_0x5fa2('0x2f')][_0x5fa2('0x4a')](_0x4f0135[_0x5fa2('0x4b')],{})[_0x5fa2('0x29')](respondWithResult(_0x499bec,0xc9))[_0x5fa2('0x44')](handleError(_0x499bec,null));};exports[_0x5fa2('0x4c')]=function(_0x538386,_0x5f10ec){var _0x302556={'where':{'id':_0x538386[_0x5fa2('0x45')]['id']}},_0xa6cced={};_0xa6cced[_0x5fa2('0x34')]=_['keys'](db[_0x5fa2('0x2f')][_0x5fa2('0x30')]);_0x302556[_0x5fa2('0x37')]=_[_0x5fa2('0x46')](_0xa6cced[_0x5fa2('0x34')],qs['fields'](_0x538386['query']['fields']));_0x302556[_0x5fa2('0x37')]=_0x302556[_0x5fa2('0x37')][_0x5fa2('0x39')]?_0x302556[_0x5fa2('0x37')]:_0xa6cced[_0x5fa2('0x34')];if(_0x538386[_0x5fa2('0x35')][_0x5fa2('0x47')]){_0x302556['include']=[{'all':!![]}];}_0x302556=_[_0x5fa2('0x41')]({},_0x302556,_0x538386['options']);return db['UserProfile'][_0x5fa2('0x49')](_0x302556)['then'](handleEntityNotFound(_0x5f10ec,null))[_0x5fa2('0x29')](function(_0x13796a){if(_0x13796a){var _0x5c40a6=_0x13796a['get']({'plain':!![]});_0x5c40a6=qs['omit'](_0x5c40a6,['id',_0x5fa2('0x4d'),'updatedAt',_0x5fa2('0x4e')]);_0x538386[_0x5fa2('0x4b')]=_[_0x5fa2('0x4f')](_0x538386['body'],['id',_0x5fa2('0x4d'),'updatedAt']);return db['sequelize'][_0x5fa2('0x50')](function(_0x4a6b98){return db[_0x5fa2('0x2f')][_0x5fa2('0x4a')](_[_0x5fa2('0x41')](_0x5c40a6,_0x538386[_0x5fa2('0x4b')]),{'include':_0x538386[_0x5fa2('0x35')][_0x5fa2('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x4a6b98})[_0x5fa2('0x29')](function(_0x5a2d81){var _0x1b5ca5=_0x5a2d81[_0x5fa2('0x51')]({'plain':!![]});return db[_0x5fa2('0x52')][_0x5fa2('0x53')]({'where':{'userProfileId':_0x538386[_0x5fa2('0x45')]['id']},'raw':!![]})[_0x5fa2('0x29')](function(_0x174edd){if(_0x174edd){return BPromise[_0x5fa2('0x54')](_0x174edd,function(_0x185d98){return new BPromise(function(_0x1b6a2e,_0x20792b){if(_0x185d98[_0x5fa2('0x55')]===null||_0x185d98[_0x5fa2('0x55')]===0x1)_0x1b6a2e(null);return db['UserProfileResource'][_0x5fa2('0x53')]({'where':{'sectionId':_0x185d98['id']},'raw':!![]})[_0x5fa2('0x29')](function(_0x1eb5d6){var _0x54f7f5=_['map'](_0x1eb5d6,function(_0x2cabde){return qs['omit'](_0x2cabde,['id',_0x5fa2('0x4d'),_0x5fa2('0x56'),_0x5fa2('0x57')]);});_0x1b6a2e(_0x54f7f5);})[_0x5fa2('0x44')](function(_0x49773f){_0x20792b(_0x49773f);});})[_0x5fa2('0x29')](function(_0x3fdebb){var _0x5af27e=qs[_0x5fa2('0x4f')](_0x185d98,['id',_0x5fa2('0x4d'),'updatedAt']);_0x5af27e[_0x5fa2('0x58')]=_0x1b5ca5['id'];if(_0x3fdebb)_0x5af27e[_0x5fa2('0x59')]=_0x3fdebb;return _0x5af27e;})[_0x5fa2('0x29')](function(_0x11d8ee){return db[_0x5fa2('0x52')]['create'](_0x11d8ee,{'include':[{'model':db[_0x5fa2('0x5a')],'as':_0x5fa2('0x59')}],'raw':!![],'transaction':_0x4a6b98});});})[_0x5fa2('0x29')](function(){return _0x1b5ca5;});}});});});}})[_0x5fa2('0x29')](respondWithResult(_0x5f10ec,0xc9))['catch'](handleError(_0x5f10ec,null));};exports[_0x5fa2('0x28')]=function(_0x4701d0,_0x4beb4d){if(_0x4701d0['body']['id']){delete _0x4701d0[_0x5fa2('0x4b')]['id'];}return db[_0x5fa2('0x2f')][_0x5fa2('0x49')]({'where':{'id':_0x4701d0[_0x5fa2('0x45')]['id']}})[_0x5fa2('0x29')](handleEntityNotFound(_0x4beb4d,null))[_0x5fa2('0x29')](saveUpdates(_0x4701d0[_0x5fa2('0x4b')],null))[_0x5fa2('0x29')](respondWithResult(_0x4beb4d,null))[_0x5fa2('0x44')](handleError(_0x4beb4d,null));};exports['destroy']=function(_0x406b8c,_0x1489c8){return db[_0x5fa2('0x2f')][_0x5fa2('0x49')]({'where':{'id':_0x406b8c[_0x5fa2('0x45')]['id']}})[_0x5fa2('0x29')](handleEntityNotFound(_0x1489c8,null))[_0x5fa2('0x29')](removeEntity(_0x1489c8,null))[_0x5fa2('0x44')](handleError(_0x1489c8,null));};exports[_0x5fa2('0x5b')]=function(_0x8a6f3,_0x1537ba){return db[_0x5fa2('0x2f')][_0x5fa2('0x5b')]()[_0x5fa2('0x29')](respondWithResult(_0x1537ba,null))[_0x5fa2('0x44')](handleError(_0x1537ba,null));};exports[_0x5fa2('0x5c')]=function(_0x2bb434,_0xc9493f){var _0x694dca=_0x2bb434['body'];return db['UserProfile'][_0x5fa2('0x49')]({'where':{'id':_0x2bb434[_0x5fa2('0x45')]['id']}})['then'](handleEntityNotFound(_0xc9493f,null))[_0x5fa2('0x29')](function(_0x2f2b62){if(_0x2f2b62){return db[_0x5fa2('0x5d')][_0x5fa2('0x50')](function(_0x2f43de){return db['UserProfileSection'][_0x5fa2('0x2a')]({'where':{'userProfileId':_0x2bb434['params']['id'],'sectionId':_[_0x5fa2('0x2e')](_0x694dca,function(_0x3e3c8f){return _0x3e3c8f[_0x5fa2('0x57')];})},'transaction':_0x2f43de})[_0x5fa2('0x29')](function(){var _0x1d850d=_[_0x5fa2('0x2e')](_0x694dca,function(_0x37872a){_0x37872a['userProfileId']=_0x2bb434[_0x5fa2('0x45')]['id'];return _0x37872a;});var _0x2966bd=[];return BPromise[_0x5fa2('0x54')](_0x1d850d,function(_0x536265){return db[_0x5fa2('0x52')][_0x5fa2('0x4a')](_0x536265,{'include':[{'model':db[_0x5fa2('0x5a')],'as':_0x5fa2('0x59')}],'raw':!![],'transaction':_0x2f43de})['then'](function(_0x109bc4){_0x2966bd[_0x5fa2('0x5e')](_0x109bc4[_0x5fa2('0x51')]({'plain':!![]}));});})[_0x5fa2('0x29')](function(){return _0x2966bd;});});});}})[_0x5fa2('0x29')](function(_0xfd5334){return _0xfd5334;})[_0x5fa2('0x29')](respondWithResult(_0xc9493f,null))[_0x5fa2('0x44')](handleError(_0xc9493f,null));};exports['removeSections']=function(_0x14d592,_0x32cf2){var _0xf2eba5;return db['UserProfile'][_0x5fa2('0x49')]({'where':{'id':_0x14d592['params']['id']},'attributes':['id',_0x5fa2('0x2d')]})['then'](handleEntityNotFound(_0x32cf2,null))['then'](function(_0x5d9a9c){if(_0x5d9a9c){_0xf2eba5=_0x5d9a9c;return db[_0x5fa2('0x52')][_0x5fa2('0x2a')]({'where':{'userProfileId':_0x14d592[_0x5fa2('0x45')]['id'],'sectionId':_0x14d592[_0x5fa2('0x35')][_0x5fa2('0x5f')]}});}})[_0x5fa2('0x29')](function(){return _0xf2eba5;})[_0x5fa2('0x29')](respondWithStatusCode(_0x32cf2,null))[_0x5fa2('0x44')](handleError(_0x32cf2,null));};exports['getSections']=function(_0x16f910,_0x57800a){var _0x29dff7=[];var _0xbabd6a=[];return db['UserProfileSection'][_0x5fa2('0x53')]({'where':{'userProfileId':_0x16f910['params']['id']},'raw':!![]})[_0x5fa2('0x29')](function(_0x52ebfe){_0x29dff7=_['filter'](_0x52ebfe,function(_0x264d2b){return _0x264d2b[_0x5fa2('0x60')]===0x1||_[_0x5fa2('0x61')]([0x3eb,0x709],_0x264d2b[_0x5fa2('0x57')]);});if(!_['isEmpty'](_0x29dff7)){return _[_0x5fa2('0x2e')](_0x29dff7,function(_0x2ec90e){return _0x2ec90e[_0x5fa2('0x57')];});}else{return;}})[_0x5fa2('0x29')](function(_0x537eb8){if(_0x537eb8)_0xbabd6a=_0x537eb8;if(_[_0x5fa2('0x61')](_0xbabd6a,0x64)){var _0x49e095=_['find'](_0x29dff7,{'sectionId':0x64});return hasDefaultDashboard(_0x49e095)[_0x5fa2('0x29')](function(_0x1c2621){return _[_0x5fa2('0x2e')](_0x29dff7,function(_0x38e5c6){if(_0x38e5c6[_0x5fa2('0x57')]===0x64){_0x38e5c6[_0x5fa2('0x62')]=_0x1c2621;}return _0x38e5c6;});});}else{return;}})[_0x5fa2('0x29')](function(_0x27589d){if(_0x27589d)_0x29dff7=_0x27589d;if(_[_0x5fa2('0x61')](_0xbabd6a,0x3eb)){var _0x24b686=_[_0x5fa2('0x49')](_0x29dff7,{'sectionId':0x3eb});return getCustomDashboards(_0x24b686)[_0x5fa2('0x29')](function(_0x18e681){return _[_0x5fa2('0x2e')](_0x29dff7,function(_0xc93968){if(_0x24b686[_0x5fa2('0x60')]){if(_0xc93968[_0x5fa2('0x57')]===0x3eb){_0xc93968[_0x5fa2('0x62')]=_0x18e681;}}else{if(_0xc93968[_0x5fa2('0x57')]===0x64){_0xc93968[_0x5fa2('0x62')]=_0x18e681;}}return _0xc93968;});});}else{return;}})[_0x5fa2('0x29')](function(_0x3d94a5){if(_0x3d94a5)_0x29dff7=_0x3d94a5;if(_[_0x5fa2('0x61')](_0xbabd6a,0x709)){var _0x15d4c5=_[_0x5fa2('0x49')](_0x29dff7,{'sectionId':0x709});return getPlugins(_0x15d4c5)[_0x5fa2('0x29')](function(_0x17ebcd){if(_0x15d4c5['enabled']){return _[_0x5fa2('0x2e')](_0x29dff7,function(_0x4c487e){if(_0x4c487e[_0x5fa2('0x57')]===0x709){_0x4c487e[_0x5fa2('0x62')]=_0x17ebcd;}return _0x4c487e;});}else{var _0x47225d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x17ebcd};var _0x16ab48=_['map'](_0x29dff7);_0x16ab48[_0x5fa2('0x5e')](_0x47225d);return _0x16ab48;}});}else{return;}})[_0x5fa2('0x29')](function(_0x528825){if(_0x528825)_0x29dff7=_0x528825;return _[_0x5fa2('0x40')](_0x29dff7,[_0x5fa2('0x60'),0x1]);})['then'](respondWithResult(_0x57800a,null))[_0x5fa2('0x44')](handleError(_0x57800a,null));};function hasDefaultDashboard(_0x5e83dd){var _0x95eac2=[0x65];return new BPromise(function(_0x304abd,_0x4af14a){try{if(_0x5e83dd['autoAssociation']){_0x304abd(_0x95eac2);}else{return db[_0x5fa2('0x5a')][_0x5fa2('0x63')]({'where':{'sectionId':_0x5e83dd['id']},'raw':!![]})[_0x5fa2('0x29')](function(_0x4bf394){_0x4bf394?_0x304abd(_0x95eac2):_0x304abd();});}}catch(_0x571875){_0x4af14a(_0x571875);}});}function getCustomDashboards(_0x3dbb63){var _0x1ed158=[];return new BPromise(function(_0x9b8673,_0x2db82d){try{if(_0x3dbb63[_0x5fa2('0x55')]){return db[_0x5fa2('0x64')][_0x5fa2('0x53')]({'raw':!![]})[_0x5fa2('0x29')](function(_0x4dbd5a){_0x4dbd5a[_0x5fa2('0x65')](function(_0x1b9083){_0x1ed158[_0x5fa2('0x5e')](_0x1b9083['id']+0x1869f);});_0x9b8673(_0x1ed158);});}else{return db[_0x5fa2('0x5a')][_0x5fa2('0x53')]({'where':{'sectionId':_0x3dbb63['id']},'raw':!![]})[_0x5fa2('0x29')](function(_0x1002d0){_0x1002d0[_0x5fa2('0x65')](function(_0x4fcc2c){_0x1ed158[_0x5fa2('0x5e')](_0x4fcc2c[_0x5fa2('0x66')]+0x1869f);});_0x9b8673(_0x1ed158);});}}catch(_0x4f3a6e){_0x2db82d(_0x4f3a6e);}});}function getPlugins(_0x45b432){var _0x546a86=[];return new BPromise(function(_0x38da32,_0x23feae){try{if(_0x45b432['autoAssociation']){return db[_0x5fa2('0x67')][_0x5fa2('0x53')]({'raw':!![]})[_0x5fa2('0x29')](function(_0x1fde8c){_0x1fde8c['forEach'](function(_0x1fc47d){_0x546a86[_0x5fa2('0x5e')](_0x1fc47d['id']+0x15b38);});_0x38da32(_0x546a86);});}else{return db[_0x5fa2('0x5a')][_0x5fa2('0x53')]({'where':{'sectionId':_0x45b432['id']},'raw':!![]})[_0x5fa2('0x29')](function(_0xd0834a){_0xd0834a[_0x5fa2('0x65')](function(_0x3babb2){_0x546a86[_0x5fa2('0x5e')](_0x3babb2[_0x5fa2('0x66')]+0x15b38);});_0x38da32(_0x546a86);});}}catch(_0x8aed53){_0x23feae(_0x8aed53);}});}exports[_0x5fa2('0x68')]=function(_0x4f1014,_0x46738){return db[_0x5fa2('0x2f')][_0x5fa2('0x49')]({'where':{'id':_0x4f1014[_0x5fa2('0x45')]['id']}})[_0x5fa2('0x29')](handleEntityNotFound(_0x46738,null))[_0x5fa2('0x29')](function(_0x46b38d){if(_0x46b38d){return db['sequelize'][_0x5fa2('0x50')](function(_0x4bd758){return db[_0x5fa2('0x52')][_0x5fa2('0x53')]({'where':{'userProfileId':_0x4f1014[_0x5fa2('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0x5fa2('0x29')](function(_0xac3dfd){if(_0xac3dfd){return db['UserProfileSection'][_0x5fa2('0x2a')]({'where':{'userProfileId':_0x4f1014[_0x5fa2('0x45')]['id'],'id':_[_0x5fa2('0x2e')](_0xac3dfd,function(_0xed1532){return _0xed1532['id'];})},'transaction':_0x4bd758});}})[_0x5fa2('0x29')](function(_0x5cbfe8){var _0x409d12=_[_0x5fa2('0x2e')](_0x4f1014[_0x5fa2('0x4b')],function(_0x20cf47){_0x20cf47[_0x5fa2('0x58')]=_0x4f1014[_0x5fa2('0x45')]['id'];return _0x20cf47;});return db['UserProfileSection'][_0x5fa2('0x69')](_0x409d12,{'raw':!![],'transaction':_0x4bd758});})['then'](function(_0x16d66b){var _0x169c77=_['filter'](_[_0x5fa2('0x2e')](_0x16d66b,function(_0x458c1b){return _0x458c1b[_0x5fa2('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x169c77){return db[_0x5fa2('0x52')][_0x5fa2('0x53')]({'where':{'userProfileId':_0x4f1014[_0x5fa2('0x45')]['id'],'sectionId':_[_0x5fa2('0x2e')](_0x169c77,function(_0x16bbbe){return _0x16bbbe['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x5fa2('0x29')](function(_0x14b521){var _0x384627=_[_0x5fa2('0x2e')](_0x4f1014[_0x5fa2('0x4b')],function(_0x3e967e){_0x3e967e[_0x5fa2('0x58')]=_0x4f1014[_0x5fa2('0x45')]['id'];return _0x3e967e;});return db['UserProfileResource'][_0x5fa2('0x69')](_0x384627,{'raw':!![],'transaction':_0x4bd758});});}})[_0x5fa2('0x44')](handleError(_0x46738,null));});}})[_0x5fa2('0x29')](function(_0x1723d2){var _0x2e5b15=_[_0x5fa2('0x2e')](_0x1723d2,function(_0x9b6c10){return _0x9b6c10[_0x5fa2('0x51')]({'plain':!![]});});})[_0x5fa2('0x29')](respondWithResult(_0x46738,null))[_0x5fa2('0x44')](handleError(_0x46738,null));};exports[_0x5fa2('0x6a')]=function(_0xc51a1d,_0x8fc17d,_0x10d832){return db[_0x5fa2('0x2f')][_0x5fa2('0x49')]({'where':{'id':_0xc51a1d['params']['id']}})[_0x5fa2('0x29')](handleEntityNotFound(_0x8fc17d,null))[_0x5fa2('0x29')](function(_0x24395f){if(_0x24395f){return _0x24395f[_0x5fa2('0x6a')](_0xc51a1d[_0x5fa2('0x35')]['ids']);}})[_0x5fa2('0x29')](respondWithStatusCode(_0x8fc17d,null))['catch'](handleError(_0x8fc17d,null));};exports['getResources']=function(_0x6c8f9c,_0x20a8d9){var _0xd51424={};if(!_0x6c8f9c['query'][_0x5fa2('0x6b')])throw new Error(_0x5fa2('0x6c'));if(!_0x6c8f9c['query'][_0x5fa2('0x6d')](_0x5fa2('0x3a'))){_0xd51424[_0x5fa2('0x21')]=qs[_0x5fa2('0x21')](_0x6c8f9c[_0x5fa2('0x35')]['limit']);_0xd51424[_0x5fa2('0x1f')]=qs[_0x5fa2('0x1f')](_0x6c8f9c['query'][_0x5fa2('0x1f')]);}return db['UserProfile'][_0x5fa2('0x49')]({'where':{'id':_0x6c8f9c[_0x5fa2('0x45')]['id']}})[_0x5fa2('0x29')](function(_0x2bc44c){if(!_0x2bc44c)throw new Error(_0x5fa2('0x6e')+_0x6c8f9c['params']['id']);return db['UserProfile'][_0x5fa2('0x6f')](_0x6c8f9c);})[_0x5fa2('0x29')](respondWithFilteredResult(_0x20a8d9,_0xd51424))[_0x5fa2('0x44')](handleError(_0x20a8d9,null));}; \ No newline at end of file +var _0xf970=['removeResources','getResources','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','length','includeAll','find','create','clone','get','omit','createdAt','crudPermissions','body','transaction','UserProfileSection','params','each','autoAssociation','UserProfileResource','sectionId','updatedAt','userProfileId','Resources','update','describe','addSections','sequelize','ids','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','push','Plugin','resourceId','addResources','bulkCreate'];(function(_0xe20df2,_0x1050f2){var _0x5f12ce=function(_0x2d9a2d){while(--_0x2d9a2d){_0xe20df2['push'](_0xe20df2['shift']());}};_0x5f12ce(++_0x1050f2);}(_0xf970,0x1d9));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x0f97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f97('0x1'));var jsonpatch=require(_0x0f97('0x2'));var rp=require(_0x0f97('0x3'));var moment=require(_0x0f97('0x4'));var BPromise=require(_0x0f97('0x5'));var Mustache=require(_0x0f97('0x6'));var util=require(_0x0f97('0x7'));var path=require('path');var sox=require(_0x0f97('0x8'));var csv=require(_0x0f97('0x9'));var ejs=require(_0x0f97('0xa'));var fs=require('fs');var fs_extra=require(_0x0f97('0xb'));var _=require(_0x0f97('0xc'));var squel=require(_0x0f97('0xd'));var crypto=require(_0x0f97('0xe'));var jsforce=require(_0x0f97('0xf'));var deskjs=require(_0x0f97('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0f97('0x11'));var Redis=require('ioredis');var authService=require(_0x0f97('0x12'));var qs=require(_0x0f97('0x13'));var as=require(_0x0f97('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f97('0x15'))('api');var utils=require(_0x0f97('0x16'));var config=require(_0x0f97('0x17'));var licenseUtil=require(_0x0f97('0x18'));var db=require(_0x0f97('0x19'))['db'];config[_0x0f97('0x1a')]=_['defaults'](config[_0x0f97('0x1a')],{'host':_0x0f97('0x1b'),'port':0x18eb});var socket=require(_0x0f97('0x1c'))(new Redis(config[_0x0f97('0x1a')]));require(_0x0f97('0x1d'))[_0x0f97('0x1e')](socket);function respondWithStatusCode(_0x424c47,_0x54f205){_0x54f205=_0x54f205||0xcc;return function(_0x4c34fc){if(_0x4c34fc){return _0x424c47[_0x0f97('0x1f')](_0x54f205);}return _0x424c47[_0x0f97('0x20')](_0x54f205)[_0x0f97('0x21')]();};}function respondWithResult(_0xe92b09,_0x5e3f3a){_0x5e3f3a=_0x5e3f3a||0xc8;return function(_0x58cb79){if(_0x58cb79){return _0xe92b09[_0x0f97('0x20')](_0x5e3f3a)[_0x0f97('0x22')](_0x58cb79);}};}function respondWithFilteredResult(_0x3edaf7,_0x185ba3){return function(_0xae246){if(_0xae246){var _0x208f6b=typeof _0x185ba3['offset']==='undefined'&&typeof _0x185ba3[_0x0f97('0x23')]===_0x0f97('0x24');var _0x3b547f=_0xae246[_0x0f97('0x25')];var _0x398216=_0x208f6b?0x0:_0x185ba3[_0x0f97('0x26')];var _0x4a50a8=_0x208f6b?_0xae246[_0x0f97('0x25')]:_0x185ba3[_0x0f97('0x26')]+_0x185ba3[_0x0f97('0x23')];var _0x15376e;if(_0x4a50a8>=_0x3b547f){_0x4a50a8=_0x3b547f;_0x15376e=0xc8;}else{_0x15376e=0xce;}_0x3edaf7[_0x0f97('0x20')](_0x15376e);return _0x3edaf7[_0x0f97('0x27')](_0x0f97('0x28'),_0x398216+'-'+_0x4a50a8+'/'+_0x3b547f)['json'](_0xae246);}return null;};}function patchUpdates(_0x2977fa){return function(_0x2201d4){try{jsonpatch[_0x0f97('0x29')](_0x2201d4,_0x2977fa,!![]);}catch(_0x5c2af0){return BPromise[_0x0f97('0x2a')](_0x5c2af0);}return _0x2201d4[_0x0f97('0x2b')]();};}function saveUpdates(_0x4ec6d0,_0xb5721e){return function(_0x15df5c){if(_0x15df5c){return _0x15df5c['update'](_0x4ec6d0)['then'](function(_0x51aa82){return _0x51aa82;});}return null;};}function removeEntity(_0x406e24,_0x22eb53){return function(_0x5247ad){if(_0x5247ad){return _0x5247ad[_0x0f97('0x2c')]()[_0x0f97('0x2d')](function(){_0x406e24[_0x0f97('0x20')](0xcc)[_0x0f97('0x21')]();});}};}function handleEntityNotFound(_0x10f71c,_0x23f078){return function(_0x51a376){if(!_0x51a376){_0x10f71c[_0x0f97('0x1f')](0x194);}return _0x51a376;};}function handleError(_0x1e688d,_0x3f4922){_0x3f4922=_0x3f4922||0x1f4;return function(_0x37d7c9){logger['error'](_0x37d7c9[_0x0f97('0x2e')]);if(_0x37d7c9[_0x0f97('0x2f')]){delete _0x37d7c9[_0x0f97('0x2f')];}_0x1e688d[_0x0f97('0x20')](_0x3f4922)[_0x0f97('0x30')](_0x37d7c9);};}exports[_0x0f97('0x31')]=function(_0x2aeef8,_0x28ba36){var _0x51de2e={},_0x481654={},_0x2a8acf={'count':0x0,'rows':[]};var _0x3b9f37=_[_0x0f97('0x32')](db[_0x0f97('0x33')][_0x0f97('0x34')],function(_0x405062){return{'name':_0x405062[_0x0f97('0x35')],'type':_0x405062[_0x0f97('0x36')][_0x0f97('0x37')]};});_0x481654[_0x0f97('0x38')]=_[_0x0f97('0x32')](_0x3b9f37,'name');_0x481654[_0x0f97('0x39')]=_[_0x0f97('0x3a')](_0x2aeef8[_0x0f97('0x39')]);_0x481654[_0x0f97('0x3b')]=_[_0x0f97('0x3c')](_0x481654['model'],_0x481654[_0x0f97('0x39')]);_0x51de2e['attributes']=_[_0x0f97('0x3c')](_0x481654['model'],qs[_0x0f97('0x3d')](_0x2aeef8[_0x0f97('0x39')][_0x0f97('0x3d')]));_0x51de2e[_0x0f97('0x3e')]=_0x51de2e[_0x0f97('0x3e')]['length']?_0x51de2e['attributes']:_0x481654[_0x0f97('0x38')];if(!_0x2aeef8[_0x0f97('0x39')]['hasOwnProperty'](_0x0f97('0x3f'))){_0x51de2e[_0x0f97('0x23')]=qs[_0x0f97('0x23')](_0x2aeef8[_0x0f97('0x39')]['limit']);_0x51de2e[_0x0f97('0x26')]=qs[_0x0f97('0x26')](_0x2aeef8[_0x0f97('0x39')][_0x0f97('0x26')]);}_0x51de2e[_0x0f97('0x40')]=qs['sort'](_0x2aeef8[_0x0f97('0x39')][_0x0f97('0x41')]);_0x51de2e[_0x0f97('0x42')]=qs[_0x0f97('0x3b')](_[_0x0f97('0x43')](_0x2aeef8[_0x0f97('0x39')],_0x481654['filters']),_0x3b9f37);if(_0x2aeef8['query'][_0x0f97('0x44')]){_0x51de2e[_0x0f97('0x42')]=_[_0x0f97('0x45')](_0x51de2e['where'],{'$or':_[_0x0f97('0x32')](_0x3b9f37,function(_0xb24a15){if(_0xb24a15[_0x0f97('0x36')]!=='VIRTUAL'){var _0x18aae7={};_0x18aae7[_0xb24a15[_0x0f97('0x2f')]]={'$like':'%'+_0x2aeef8[_0x0f97('0x39')][_0x0f97('0x44')]+'%'};return _0x18aae7;}})});}_0x51de2e=_[_0x0f97('0x45')]({},_0x51de2e,_0x2aeef8[_0x0f97('0x46')]);var _0xf4ed1a={'where':_0x51de2e[_0x0f97('0x42')]};return db[_0x0f97('0x33')][_0x0f97('0x25')](_0xf4ed1a)[_0x0f97('0x2d')](function(_0x5c1cd1){_0x2a8acf[_0x0f97('0x25')]=_0x5c1cd1;if(_0x2aeef8[_0x0f97('0x39')]['includeAll']){_0x51de2e[_0x0f97('0x47')]=[{'all':!![]}];}return db['UserProfile'][_0x0f97('0x48')](_0x51de2e);})[_0x0f97('0x2d')](function(_0x3e14b1){_0x2a8acf['rows']=_0x3e14b1;return _0x2a8acf;})['then'](respondWithFilteredResult(_0x28ba36,_0x51de2e))[_0x0f97('0x49')](handleError(_0x28ba36,null));};exports[_0x0f97('0x4a')]=function(_0x299695,_0xcda718){var _0x278a8c={'raw':![],'where':{'id':_0x299695['params']['id']}},_0x5ad169={};_0x5ad169[_0x0f97('0x38')]=_[_0x0f97('0x3a')](db[_0x0f97('0x33')][_0x0f97('0x34')]);_0x5ad169[_0x0f97('0x39')]=_[_0x0f97('0x3a')](_0x299695[_0x0f97('0x39')]);_0x5ad169[_0x0f97('0x3b')]=_[_0x0f97('0x3c')](_0x5ad169['model'],_0x5ad169[_0x0f97('0x39')]);_0x278a8c['attributes']=_[_0x0f97('0x3c')](_0x5ad169[_0x0f97('0x38')],qs[_0x0f97('0x3d')](_0x299695['query']['fields']));_0x278a8c[_0x0f97('0x3e')]=_0x278a8c[_0x0f97('0x3e')][_0x0f97('0x4b')]?_0x278a8c['attributes']:_0x5ad169['model'];if(_0x299695['query'][_0x0f97('0x4c')]){_0x278a8c[_0x0f97('0x47')]=[{'all':!![]}];}_0x278a8c=_[_0x0f97('0x45')]({},_0x278a8c,_0x299695[_0x0f97('0x46')]);return db[_0x0f97('0x33')][_0x0f97('0x4d')](_0x278a8c)[_0x0f97('0x2d')](handleEntityNotFound(_0xcda718,null))[_0x0f97('0x2d')](respondWithResult(_0xcda718,null))[_0x0f97('0x49')](handleError(_0xcda718,null));};exports[_0x0f97('0x4e')]=function(_0x55eba,_0x4c5d53){return db[_0x0f97('0x33')]['create'](_0x55eba['body'],{})[_0x0f97('0x2d')](respondWithResult(_0x4c5d53,0xc9))['catch'](handleError(_0x4c5d53,null));};exports[_0x0f97('0x4f')]=function(_0x20df4e,_0x31929a){var _0x449eef={'where':{'id':_0x20df4e['params']['id']}},_0x17455a={};_0x17455a['model']=_[_0x0f97('0x3a')](db[_0x0f97('0x33')]['rawAttributes']);_0x449eef[_0x0f97('0x3e')]=_[_0x0f97('0x3c')](_0x17455a[_0x0f97('0x38')],qs[_0x0f97('0x3d')](_0x20df4e['query'][_0x0f97('0x3d')]));_0x449eef[_0x0f97('0x3e')]=_0x449eef[_0x0f97('0x3e')][_0x0f97('0x4b')]?_0x449eef[_0x0f97('0x3e')]:_0x17455a[_0x0f97('0x38')];if(_0x20df4e[_0x0f97('0x39')][_0x0f97('0x4c')]){_0x449eef[_0x0f97('0x47')]=[{'all':!![]}];}_0x449eef=_[_0x0f97('0x45')]({},_0x449eef,_0x20df4e[_0x0f97('0x46')]);return db[_0x0f97('0x33')][_0x0f97('0x4d')](_0x449eef)[_0x0f97('0x2d')](handleEntityNotFound(_0x31929a,null))['then'](function(_0x1b757a){if(_0x1b757a){var _0x5ce464=_0x1b757a[_0x0f97('0x50')]({'plain':!![]});_0x5ce464=qs[_0x0f97('0x51')](_0x5ce464,['id',_0x0f97('0x52'),'updatedAt',_0x0f97('0x53')]);_0x20df4e[_0x0f97('0x54')]=_[_0x0f97('0x51')](_0x20df4e['body'],['id','createdAt','updatedAt']);return db['sequelize'][_0x0f97('0x55')](function(_0x6f08c1){return db[_0x0f97('0x33')]['create'](_[_0x0f97('0x45')](_0x5ce464,_0x20df4e['body']),{'include':_0x20df4e[_0x0f97('0x39')][_0x0f97('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x6f08c1})[_0x0f97('0x2d')](function(_0x8410d8){var _0x1460f8=_0x8410d8[_0x0f97('0x50')]({'plain':!![]});return db[_0x0f97('0x56')][_0x0f97('0x48')]({'where':{'userProfileId':_0x20df4e[_0x0f97('0x57')]['id']},'raw':!![]})['then'](function(_0x2e2103){if(_0x2e2103){return BPromise[_0x0f97('0x58')](_0x2e2103,function(_0x406210){return new BPromise(function(_0x9c4705,_0x46c9f2){if(_0x406210[_0x0f97('0x59')]===null||_0x406210[_0x0f97('0x59')]===0x1)_0x9c4705(null);return db[_0x0f97('0x5a')]['findAll']({'where':{'sectionId':_0x406210['id']},'raw':!![]})[_0x0f97('0x2d')](function(_0xddbd8d){var _0x56b939=_[_0x0f97('0x32')](_0xddbd8d,function(_0x177700){return qs[_0x0f97('0x51')](_0x177700,['id',_0x0f97('0x52'),'updatedAt',_0x0f97('0x5b')]);});_0x9c4705(_0x56b939);})[_0x0f97('0x49')](function(_0x3fc407){_0x46c9f2(_0x3fc407);});})[_0x0f97('0x2d')](function(_0x320b96){var _0x27d98c=qs[_0x0f97('0x51')](_0x406210,['id',_0x0f97('0x52'),_0x0f97('0x5c')]);_0x27d98c[_0x0f97('0x5d')]=_0x1460f8['id'];if(_0x320b96)_0x27d98c[_0x0f97('0x5e')]=_0x320b96;return _0x27d98c;})[_0x0f97('0x2d')](function(_0x33f395){return db[_0x0f97('0x56')]['create'](_0x33f395,{'include':[{'model':db[_0x0f97('0x5a')],'as':_0x0f97('0x5e')}],'raw':!![],'transaction':_0x6f08c1});});})[_0x0f97('0x2d')](function(){return _0x1460f8;});}});});});}})['then'](respondWithResult(_0x31929a,0xc9))['catch'](handleError(_0x31929a,null));};exports[_0x0f97('0x5f')]=function(_0x4d9097,_0x2ef94f){if(_0x4d9097['body']['id']){delete _0x4d9097[_0x0f97('0x54')]['id'];}return db['UserProfile'][_0x0f97('0x4d')]({'where':{'id':_0x4d9097['params']['id']}})[_0x0f97('0x2d')](handleEntityNotFound(_0x2ef94f,null))[_0x0f97('0x2d')](saveUpdates(_0x4d9097[_0x0f97('0x54')],null))[_0x0f97('0x2d')](respondWithResult(_0x2ef94f,null))[_0x0f97('0x49')](handleError(_0x2ef94f,null));};exports[_0x0f97('0x2c')]=function(_0x5b4922,_0x4e5d96){return db[_0x0f97('0x33')]['find']({'where':{'id':_0x5b4922[_0x0f97('0x57')]['id']}})[_0x0f97('0x2d')](handleEntityNotFound(_0x4e5d96,null))[_0x0f97('0x2d')](removeEntity(_0x4e5d96,null))['catch'](handleError(_0x4e5d96,null));};exports['describe']=function(_0x2c76f9,_0x4b1bce){return db['UserProfile'][_0x0f97('0x60')]()[_0x0f97('0x2d')](respondWithResult(_0x4b1bce,null))[_0x0f97('0x49')](handleError(_0x4b1bce,null));};exports[_0x0f97('0x61')]=function(_0x2d0c2d,_0x1892da){var _0x294ac8=_0x2d0c2d[_0x0f97('0x54')];return db[_0x0f97('0x33')]['find']({'where':{'id':_0x2d0c2d['params']['id']}})['then'](handleEntityNotFound(_0x1892da,null))[_0x0f97('0x2d')](function(_0x47e12f){if(_0x47e12f){return db[_0x0f97('0x62')][_0x0f97('0x55')](function(_0x2cf664){return db[_0x0f97('0x56')][_0x0f97('0x2c')]({'where':{'userProfileId':_0x2d0c2d['params']['id'],'sectionId':_[_0x0f97('0x32')](_0x294ac8,function(_0x4a278c){return _0x4a278c[_0x0f97('0x5b')];})},'transaction':_0x2cf664})['then'](function(){var _0x568821=_[_0x0f97('0x32')](_0x294ac8,function(_0x121cfb){_0x121cfb[_0x0f97('0x5d')]=_0x2d0c2d['params']['id'];return _0x121cfb;});var _0x3ca107=[];return BPromise[_0x0f97('0x58')](_0x568821,function(_0x6c9898){return db[_0x0f97('0x56')]['create'](_0x6c9898,{'include':[{'model':db[_0x0f97('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x2cf664})[_0x0f97('0x2d')](function(_0x27cff8){_0x3ca107['push'](_0x27cff8['get']({'plain':!![]}));});})[_0x0f97('0x2d')](function(){return _0x3ca107;});});});}})[_0x0f97('0x2d')](function(_0x33790c){return _0x33790c;})[_0x0f97('0x2d')](respondWithResult(_0x1892da,null))['catch'](handleError(_0x1892da,null));};exports['removeSections']=function(_0x352653,_0x33623f){var _0x2af25f;return db[_0x0f97('0x33')][_0x0f97('0x4d')]({'where':{'id':_0x352653[_0x0f97('0x57')]['id']},'attributes':['id','name']})[_0x0f97('0x2d')](handleEntityNotFound(_0x33623f,null))[_0x0f97('0x2d')](function(_0x161404){if(_0x161404){_0x2af25f=_0x161404;return db[_0x0f97('0x56')][_0x0f97('0x2c')]({'where':{'userProfileId':_0x352653[_0x0f97('0x57')]['id'],'sectionId':_0x352653['query'][_0x0f97('0x63')]}});}})[_0x0f97('0x2d')](function(){return _0x2af25f;})[_0x0f97('0x2d')](respondWithStatusCode(_0x33623f,null))[_0x0f97('0x49')](handleError(_0x33623f,null));};exports[_0x0f97('0x64')]=function(_0x6616d,_0x385caa){var _0x3b105c=[];var _0x538384=[];return db[_0x0f97('0x56')][_0x0f97('0x48')]({'where':{'userProfileId':_0x6616d['params']['id']},'raw':!![]})['then'](function(_0x1f1bc7){_0x3b105c=_['filter'](_0x1f1bc7,function(_0x3497aa){return _0x3497aa[_0x0f97('0x65')]===0x1||_[_0x0f97('0x66')]([0x3eb,0x709],_0x3497aa['sectionId']);});if(!_[_0x0f97('0x67')](_0x3b105c)){return _[_0x0f97('0x32')](_0x3b105c,function(_0x16071d){return _0x16071d[_0x0f97('0x5b')];});}else{return;}})[_0x0f97('0x2d')](function(_0x37b154){if(_0x37b154)_0x538384=_0x37b154;if(_[_0x0f97('0x66')](_0x538384,0x64)){var _0x1c62fa=_[_0x0f97('0x4d')](_0x3b105c,{'sectionId':0x64});return hasDefaultDashboard(_0x1c62fa)['then'](function(_0x3eb9cf){return _[_0x0f97('0x32')](_0x3b105c,function(_0x2042df){if(_0x2042df[_0x0f97('0x5b')]===0x64){_0x2042df[_0x0f97('0x68')]=_0x3eb9cf;}return _0x2042df;});});}else{return;}})['then'](function(_0x7a1c5c){if(_0x7a1c5c)_0x3b105c=_0x7a1c5c;if(_[_0x0f97('0x66')](_0x538384,0x3eb)){var _0x5ebe6e=_[_0x0f97('0x4d')](_0x3b105c,{'sectionId':0x3eb});return getCustomDashboards(_0x5ebe6e)['then'](function(_0x3c2c22){return _['map'](_0x3b105c,function(_0x2aac66){if(_0x5ebe6e[_0x0f97('0x65')]){if(_0x2aac66['sectionId']===0x3eb){_0x2aac66[_0x0f97('0x68')]=_0x3c2c22;}}else{if(_0x2aac66['sectionId']===0x64){_0x2aac66['subsections']=_0x3c2c22;}}return _0x2aac66;});});}else{return;}})['then'](function(_0x36defa){if(_0x36defa)_0x3b105c=_0x36defa;if(_[_0x0f97('0x66')](_0x538384,0x709)){var _0x1b8dbb=_[_0x0f97('0x4d')](_0x3b105c,{'sectionId':0x709});return getPlugins(_0x1b8dbb)[_0x0f97('0x2d')](function(_0x40897e){if(_0x1b8dbb[_0x0f97('0x65')]){return _[_0x0f97('0x32')](_0x3b105c,function(_0x2aa362){if(_0x2aa362[_0x0f97('0x5b')]===0x709){_0x2aa362['subsections']=_0x40897e;}return _0x2aa362;});}else{var _0x1f648e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x40897e};var _0x9fd5e0=_[_0x0f97('0x32')](_0x3b105c);_0x9fd5e0['push'](_0x1f648e);return _0x9fd5e0;}});}else{return;}})[_0x0f97('0x2d')](function(_0x1d65f7){if(_0x1d65f7)_0x3b105c=_0x1d65f7;return _['filter'](_0x3b105c,[_0x0f97('0x65'),0x1]);})[_0x0f97('0x2d')](respondWithResult(_0x385caa,null))[_0x0f97('0x49')](handleError(_0x385caa,null));};function hasDefaultDashboard(_0x3207bc){var _0x2d5a7a=[0x65];return new BPromise(function(_0x26dd22,_0x15d7c5){try{if(_0x3207bc[_0x0f97('0x59')]){_0x26dd22(_0x2d5a7a);}else{return db[_0x0f97('0x5a')][_0x0f97('0x69')]({'where':{'sectionId':_0x3207bc['id']},'raw':!![]})[_0x0f97('0x2d')](function(_0x10fb5c){_0x10fb5c?_0x26dd22(_0x2d5a7a):_0x26dd22();});}}catch(_0x66eedd){_0x15d7c5(_0x66eedd);}});}function getCustomDashboards(_0x22321b){var _0x105deb=[];return new BPromise(function(_0x27c053,_0x11997b){try{if(_0x22321b[_0x0f97('0x59')]){return db['Dashboard']['findAll']({'raw':!![]})[_0x0f97('0x2d')](function(_0x5d4bae){_0x5d4bae[_0x0f97('0x6a')](function(_0x12d248){_0x105deb[_0x0f97('0x6b')](_0x12d248['id']+0x1869f);});_0x27c053(_0x105deb);});}else{return db[_0x0f97('0x5a')][_0x0f97('0x48')]({'where':{'sectionId':_0x22321b['id']},'raw':!![]})['then'](function(_0x1dd537){_0x1dd537[_0x0f97('0x6a')](function(_0x409689){_0x105deb[_0x0f97('0x6b')](_0x409689['resourceId']+0x1869f);});_0x27c053(_0x105deb);});}}catch(_0x315557){_0x11997b(_0x315557);}});}function getPlugins(_0x1d014d){var _0x532ee4=[];return new BPromise(function(_0x352bcc,_0x336d92){try{if(_0x1d014d['autoAssociation']){return db[_0x0f97('0x6c')][_0x0f97('0x48')]({'raw':!![]})['then'](function(_0x398752){_0x398752['forEach'](function(_0x2264bd){_0x532ee4[_0x0f97('0x6b')](_0x2264bd['id']+0x15b38);});_0x352bcc(_0x532ee4);});}else{return db['UserProfileResource'][_0x0f97('0x48')]({'where':{'sectionId':_0x1d014d['id']},'raw':!![]})['then'](function(_0xe91b0e){_0xe91b0e[_0x0f97('0x6a')](function(_0x2e5135){_0x532ee4[_0x0f97('0x6b')](_0x2e5135[_0x0f97('0x6d')]+0x15b38);});_0x352bcc(_0x532ee4);});}}catch(_0x2824e8){_0x336d92(_0x2824e8);}});}exports[_0x0f97('0x6e')]=function(_0x12f84f,_0x53b994){return db[_0x0f97('0x33')][_0x0f97('0x4d')]({'where':{'id':_0x12f84f['params']['id']}})[_0x0f97('0x2d')](handleEntityNotFound(_0x53b994,null))[_0x0f97('0x2d')](function(_0x301cae){if(_0x301cae){return db[_0x0f97('0x62')][_0x0f97('0x55')](function(_0x3170c4){return db[_0x0f97('0x56')][_0x0f97('0x48')]({'where':{'userProfileId':_0x12f84f['params']['id']},'attributes':['id'],'raw':!![]})[_0x0f97('0x2d')](function(_0x40d0a9){if(_0x40d0a9){return db[_0x0f97('0x56')][_0x0f97('0x2c')]({'where':{'userProfileId':_0x12f84f['params']['id'],'id':_['map'](_0x40d0a9,function(_0x3dfb78){return _0x3dfb78['id'];})},'transaction':_0x3170c4});}})[_0x0f97('0x2d')](function(_0x34d326){var _0x9c46e2=_[_0x0f97('0x32')](_0x12f84f['body'],function(_0x2c78af){_0x2c78af[_0x0f97('0x5d')]=_0x12f84f[_0x0f97('0x57')]['id'];return _0x2c78af;});return db['UserProfileSection'][_0x0f97('0x6f')](_0x9c46e2,{'raw':!![],'transaction':_0x3170c4});})[_0x0f97('0x2d')](function(_0x20f089){var _0x2f5d49=_[_0x0f97('0x44')](_[_0x0f97('0x32')](_0x20f089,function(_0xdaa783){return _0xdaa783[_0x0f97('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x2f5d49){return db[_0x0f97('0x56')]['findAll']({'where':{'userProfileId':_0x12f84f[_0x0f97('0x57')]['id'],'sectionId':_['map'](_0x2f5d49,function(_0x31c94c){return _0x31c94c['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x0f97('0x2d')](function(_0x2895f5){var _0x452693=_[_0x0f97('0x32')](_0x12f84f[_0x0f97('0x54')],function(_0x5d71de){_0x5d71de[_0x0f97('0x5d')]=_0x12f84f['params']['id'];return _0x5d71de;});return db[_0x0f97('0x5a')][_0x0f97('0x6f')](_0x452693,{'raw':!![],'transaction':_0x3170c4});});}})[_0x0f97('0x49')](handleError(_0x53b994,null));});}})['then'](function(_0x249dad){var _0x1d461d=_[_0x0f97('0x32')](_0x249dad,function(_0x134377){return _0x134377[_0x0f97('0x50')]({'plain':!![]});});})[_0x0f97('0x2d')](respondWithResult(_0x53b994,null))[_0x0f97('0x49')](handleError(_0x53b994,null));};exports['removeResources']=function(_0x3559b1,_0x3f504a,_0x53795e){return db[_0x0f97('0x33')][_0x0f97('0x4d')]({'where':{'id':_0x3559b1[_0x0f97('0x57')]['id']}})[_0x0f97('0x2d')](handleEntityNotFound(_0x3f504a,null))[_0x0f97('0x2d')](function(_0x59c2c5){if(_0x59c2c5){return _0x59c2c5[_0x0f97('0x70')](_0x3559b1[_0x0f97('0x39')][_0x0f97('0x63')]);}})[_0x0f97('0x2d')](respondWithStatusCode(_0x3f504a,null))['catch'](handleError(_0x3f504a,null));};exports[_0x0f97('0x71')]=function(_0x547371,_0x2fbd8e){var _0x44e441={};if(!_0x547371['query']['section'])throw new Error(_0x0f97('0x72'));if(!_0x547371[_0x0f97('0x39')][_0x0f97('0x73')]('nolimit')){_0x44e441[_0x0f97('0x23')]=qs['limit'](_0x547371['query']['limit']);_0x44e441['offset']=qs[_0x0f97('0x26')](_0x547371['query'][_0x0f97('0x26')]);}return db[_0x0f97('0x33')][_0x0f97('0x4d')]({'where':{'id':_0x547371[_0x0f97('0x57')]['id']}})['then'](function(_0xd8499a){if(!_0xd8499a)throw new Error(_0x0f97('0x74')+_0x547371[_0x0f97('0x57')]['id']);return db[_0x0f97('0x33')]['getResources'](_0x547371);})[_0x0f97('0x2d')](respondWithFilteredResult(_0x2fbd8e,_0x44e441))['catch'](handleError(_0x2fbd8e,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 8f11721..ba2bc95 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 _0xfc65=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x47aded,_0xb76625){var _0x505e9a=function(_0x68696d){while(--_0x68696d){_0x47aded['push'](_0x47aded['shift']());}};_0x505e9a(++_0xb76625);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x150982,_0x96d84f){_0x150982=_0x150982-0x0;var _0x181f5d=_0xfc65[_0x150982];return _0x181f5d;};'use strict';var EventEmitter=require(_0x5fc6('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5fc6('0x1')](0x0);var events={'afterCreate':_0x5fc6('0x2'),'afterUpdate':_0x5fc6('0x3'),'afterDestroy':_0x5fc6('0x4')};function emitEvent(_0x3c542a){return function(_0x34b758,_0x22a8ad,_0xcdd520){UserProfileEvents[_0x5fc6('0x5')](_0x3c542a+':'+_0x34b758['id'],_0x34b758);UserProfileEvents[_0x5fc6('0x5')](_0x3c542a,_0x34b758);_0xcdd520(null);};}for(var e in events){if(events[_0x5fc6('0x6')](e)){var event=events[e];UserProfile[_0x5fc6('0x7')](e,emitEvent(event));}}module[_0x5fc6('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xac6a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x4258c7,_0x3fec4c){var _0x3c5d58=function(_0x4fa720){while(--_0x4fa720){_0x4258c7['push'](_0x4258c7['shift']());}};_0x3c5d58(++_0x3fec4c);}(_0xac6a,0xc2));var _0xaac6=function(_0x1a5697,_0x1c7ac8){_0x1a5697=_0x1a5697-0x0;var _0x42cb15=_0xac6a[_0x1a5697];return _0x42cb15;};'use strict';var EventEmitter=require(_0xaac6('0x0'));var UserProfile=require(_0xaac6('0x1'))['db'][_0xaac6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaac6('0x3')](0x0);var events={'afterCreate':_0xaac6('0x4'),'afterUpdate':'update','afterDestroy':_0xaac6('0x5')};function emitEvent(_0x4c0cf4){return function(_0x9dc043,_0x1a0d76,_0x44259b){UserProfileEvents[_0xaac6('0x6')](_0x4c0cf4+':'+_0x9dc043['id'],_0x9dc043);UserProfileEvents[_0xaac6('0x6')](_0x4c0cf4,_0x9dc043);_0x44259b(null);};}for(var e in events){if(events[_0xaac6('0x7')](e)){var event=events[e];UserProfile[_0xaac6('0x8')](e,emitEvent(event));}}module[_0xaac6('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 172acb6..b3c7947 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 _0x7984=['mail','openchannel','whatsapp','all','lodash','../../components/parsers/qs','squel','exports','models','filter','field','findAll','then','associatedResources','map','catch','model','name','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','odbc','childModel','SquareOdbc','SquareRecording','projectName','projects','JscriptyProject','contacts','CmContact','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','parentSections','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailAccount','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','intervals','Interval','pauses','Pause','scheduler','Schedule','tags','Tag','templates','Template','triggers','Trunk','variables','Variable','Plugin','extractedreports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','isEmpty','length','push','find','params','ignore','keys','intersection','attributes','fields','nolimit','limit','offset','order','sort','where','filters','merge','key','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','DefaultReports','CustomReports','ids','customSorting','extraQueryConditions','count','Tags','color','ThroughTags','tag','rows','Agents','openTabs','true','chat','dataValues'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x7984,0x17a));var _0x4798=function(_0x663c3a,_0x4f4331){_0x663c3a=_0x663c3a-0x0;var _0xeb05f1=_0x7984[_0x663c3a];return _0xeb05f1;};'use strict';var _=require(_0x4798('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x4798('0x1'));var squel=require(_0x4798('0x2'));module[_0x4798('0x3')]=function(_0x5d005e){var _0x322317=_0x5d005e[_0x4798('0x4')];function _0x47a599(_0x42d537,_0x427c18){return new Promise(function(_0x2a3f23,_0x328a6d){if(!_0x427c18)return _0x2a3f23(null);var _0x2b5866=_0x427c18[_0x4798('0x5')]?{[_0x427c18[_0x4798('0x5')][_0x4798('0x6')]]:_0x427c18['filter']['value']}:undefined;return _0x322317[_0x42d537][_0x4798('0x7')]({'where':_0x2b5866,'raw':!![]})[_0x4798('0x8')](function(_0xd0a7aa){_0x427c18[_0x4798('0x9')]=_[_0x4798('0xa')](_0xd0a7aa,'id');_0x2a3f23(_0x427c18);})[_0x4798('0xb')](function(_0x70ac02){_0x328a6d(_0x70ac02);});});}function _0x11d874(_0x4b8459,_0x55b959){return new Promise(function(_0xbb5bb,_0x3d61eb){var _0x23c637=_0x4b8459[_0x4798('0x5')]?{[_0x4b8459[_0x4798('0x5')][_0x4798('0x6')]]:_0x4b8459[_0x4798('0x5')]['value']}:undefined;return _0x322317[_0x4b8459[_0x4798('0xc')]][_0x4798('0x7')]({'where':_0x23c637,'raw':!![]})[_0x4798('0x8')](function(_0x31bdf8){_0x55b959[_0x4798('0x9')]=_[_0x4798('0xa')](_0x31bdf8,function(_0x2aba7d){return _0x2aba7d[_0x4798('0xd')];});_0xbb5bb(_0x55b959);})[_0x4798('0xb')](function(_0x58657c){_0x3d61eb(_0x58657c);});});}function _0x228622(_0x3af096,_0x53202d,_0x502b7e){if(!_0x53202d)return Promise['resolve'](null);return new Promise(function(_0x17e584,_0x46265b){return _0x322317[_0x4798('0xe')][_0x4798('0x7')]({'where':{'sectionId':_0x53202d['id']},'raw':!![]})[_0x4798('0x8')](function(_0x2adbae){if(_0x3af096[_0x4798('0x6')]&&_0x3af096[_0x4798('0x6')]!=='id'){_0x53202d[_0x4798('0x9')]=_[_0x4798('0xa')](_0x2adbae,function(_0x531396){return _0x531396[_0x3af096[_0x4798('0x6')]];});}else{if(_0x502b7e===_0x4798('0xf')){_0x53202d[_0x4798('0x9')]=_[_0x4798('0xa')](_0x2adbae,function(_0x529fcb){return{'id':_0x529fcb[_0x4798('0x10')],'type':_0x529fcb['type']};});}else{_0x53202d['associatedResources']=_[_0x4798('0xa')](_0x2adbae,function(_0x283bc2){return _0x283bc2[_0x4798('0x10')];});}}_0x17e584(_0x53202d);})[_0x4798('0xb')](function(_0x1645b7){_0x46265b(_0x1645b7);});});}function _0x3909df(_0xca2a32,_0x594aee){var _0x241e83={'parentSections':[]};switch(_0xca2a32[_0x4798('0x11')]()){case _0x4798('0x12'):_0x241e83['childModel']='SquareProject';break;case _0x4798('0x13'):_0x241e83[_0x4798('0x14')]=_0x4798('0x15');break;case'squarerecordings':_0x241e83[_0x4798('0x14')]=_0x4798('0x16');_0x241e83['parentSections']=[{'name':'SquareProjects','field':_0x4798('0xd'),'foreignKey':_0x4798('0x17')}];break;case _0x4798('0x18'):_0x241e83[_0x4798('0x14')]=_0x4798('0x19');break;case _0x4798('0x1a'):_0x241e83[_0x4798('0x14')]=_0x4798('0x1b');_0x241e83['parentSections']=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case'lists':_0x241e83[_0x4798('0x14')]='CmList';break;case'companies':_0x241e83[_0x4798('0x14')]=_0x4798('0x1c');break;case _0x4798('0x1d'):_0x241e83['childModel']=_0x4798('0x1e');break;case _0x4798('0x1f'):_0x241e83[_0x4798('0x14')]='ChatQueue';break;case _0x4798('0x20'):_0x241e83['childModel']=_0x4798('0x21');break;case _0x4798('0x22'):_0x241e83[_0x4798('0x14')]=_0x4798('0x23');break;case _0x4798('0x24'):_0x241e83[_0x4798('0x14')]=_0x4798('0x25');break;case _0x4798('0x26'):case'internalroutes':case _0x4798('0x27'):_0x241e83[_0x4798('0x14')]=_0x4798('0x28');break;case _0x4798('0x29'):_0x241e83[_0x4798('0x14')]='VoiceContext';break;case _0x4798('0x2a'):_0x241e83['childModel']=_0x4798('0x2b');break;case _0x4798('0x2c'):_0x241e83[_0x4798('0x14')]=_0x4798('0x2d');_0x241e83[_0x4798('0x2e')]=[{'name':'Agents','field':'name','foreignKey':_0x4798('0x2f'),'model':_0x4798('0x30'),'filter':{'field':'role','value':[_0x4798('0x31')]}},{'name':_0x4798('0x32'),'field':'name','foreignKey':_0x4798('0x2f'),'model':_0x4798('0x30'),'filter':{'field':_0x4798('0x33'),'value':[_0x4798('0x34')]}},{'name':_0x4798('0x35'),'field':_0x4798('0xd'),'foreignKey':_0x4798('0x36'),'model':_0x4798('0x37'),'filter':{'field':_0x4798('0x38'),'value':[_0x4798('0x39')]}},{'name':_0x4798('0x3a'),'field':_0x4798('0xd'),'foreignKey':_0x4798('0x36'),'model':'VoiceQueue','filter':{'field':_0x4798('0x38'),'value':[_0x4798('0x3b')]}}];break;case _0x4798('0x3c'):_0x241e83['childModel']='VoiceMusicOnHold';break;case _0x4798('0x3d'):_0x241e83[_0x4798('0x14')]=_0x4798('0x3e');break;case _0x4798('0x3f'):_0x241e83[_0x4798('0x14')]=_0x4798('0x40');break;case _0x4798('0x41'):_0x241e83[_0x4798('0x14')]=_0x4798('0x42');break;case _0x4798('0x43'):_0x241e83[_0x4798('0x14')]='MailQueue';break;case'mailaccounts':_0x241e83[_0x4798('0x14')]=_0x4798('0x44');break;case'mailsubstatuses':_0x241e83[_0x4798('0x14')]='MailSubstatus';break;case'openchannelqueues':_0x241e83[_0x4798('0x14')]=_0x4798('0x45');break;case _0x4798('0x46'):_0x241e83['childModel']=_0x4798('0x47');break;case'smsqueues':_0x241e83['childModel']=_0x4798('0x48');break;case _0x4798('0x49'):_0x241e83['childModel']='SmsAccount';break;case'whatsappqueues':_0x241e83[_0x4798('0x14')]=_0x4798('0x4a');break;case _0x4798('0x4b'):_0x241e83[_0x4798('0x14')]='WhatsappAccount';break;case _0x4798('0x4c'):_0x241e83[_0x4798('0x14')]=_0x4798('0x4d');break;case _0x4798('0x4e'):case _0x4798('0x4f'):_0x241e83[_0x4798('0x14')]=_0x4798('0x37');if(_0x594aee){_0x241e83['parentSections']=[{'name':_0x4798('0x35')},{'name':_0x4798('0x3a')}];}break;case _0x4798('0x50'):case _0x4798('0x51'):case _0x4798('0x52'):_0x241e83[_0x4798('0x14')]='User';if(_0x594aee){_0x241e83[_0x4798('0x2e')]=[{'name':_0x4798('0x53'),'filter':{'field':'role','value':[_0x4798('0x54'),_0x4798('0x55')]},'ignore':!![]},{'name':'Agents'},{'name':_0x4798('0x32')}];}break;case _0x4798('0x56'):_0x241e83[_0x4798('0x14')]=_0x4798('0x57');break;case'salesforceaccounts':_0x241e83[_0x4798('0x14')]=_0x4798('0x58');break;case _0x4798('0x59'):_0x241e83[_0x4798('0x14')]=_0x4798('0x5a');break;case _0x4798('0x5b'):_0x241e83[_0x4798('0x14')]=_0x4798('0x5c');break;case _0x4798('0x5d'):_0x241e83[_0x4798('0x14')]=_0x4798('0x5e');break;case _0x4798('0x5f'):_0x241e83['childModel']=_0x4798('0x60');break;case _0x4798('0x61'):_0x241e83['childModel']=_0x4798('0x30');break;case'cannedanswers':_0x241e83['childModel']=_0x4798('0x62');break;case _0x4798('0x63'):_0x241e83[_0x4798('0x14')]=_0x4798('0x64');break;case'customdashboards':_0x241e83[_0x4798('0x14')]='Dashboard';break;case _0x4798('0x65'):_0x241e83[_0x4798('0x14')]=_0x4798('0x66');break;case _0x4798('0x67'):_0x241e83['childModel']=_0x4798('0x68');break;case _0x4798('0x69'):_0x241e83[_0x4798('0x14')]=_0x4798('0x6a');break;case'sounds':_0x241e83[_0x4798('0x14')]='Sound';break;case _0x4798('0x6b'):_0x241e83[_0x4798('0x14')]=_0x4798('0x6c');break;case _0x4798('0x6d'):_0x241e83['childModel']=_0x4798('0x6e');break;case _0x4798('0x6f'):_0x241e83[_0x4798('0x14')]='Trigger';break;case'trunks':_0x241e83[_0x4798('0x14')]=_0x4798('0x70');break;case _0x4798('0x71'):_0x241e83[_0x4798('0x14')]=_0x4798('0x72');break;case'plugins':_0x241e83[_0x4798('0x14')]=_0x4798('0x73');break;case _0x4798('0x74'):_0x241e83['childModel']=_0x4798('0xf');_0x241e83[_0x4798('0x2e')]=[{'name':'Reports','field':'id','foreignKey':_0x4798('0x75')}];break;case _0x4798('0x76'):_0x241e83[_0x4798('0x14')]=_0x4798('0x77');break;}return _0x241e83;}function _0x5ceb23(_0x26d45a,_0x5e7cb3){var _0x1bf881=_0x26d45a['charAt'](0x0)[_0x4798('0x78')]()+_0x26d45a[_0x4798('0x79')](0x1);var _0x3107fc={'type':_0x322317[_0x4798('0x7a')][_0x4798('0x7b')][_0x4798('0x7c')],'raw':!![]};return new Promise(function(_0x9edeac,_0x56a8bc){var _0x3b5dde=squel['select']()[_0x4798('0x6')](_0x4798('0x7d')+_0x1bf881+_0x4798('0x7e'),'id')[_0x4798('0x6')]('ui.createdAt')['from'](_0x4798('0x7f')+_0x26d45a+_0x4798('0x80'),'ui')['where'](_0x4798('0x81'),_0x5e7cb3['id']);return _0x322317[_0x4798('0x82')][_0x4798('0x83')](_0x3b5dde[_0x4798('0x84')](),_0x3107fc)[_0x4798('0x8')](function(_0x1c1f67){_0x5e7cb3[_0x1bf881+_0x4798('0x85')]=_0x1c1f67;_0x9edeac(_0x1c1f67);})[_0x4798('0xb')](function(_0xb77cb3){_0x56a8bc(_0xb77cb3);});});}return _0x5d005e[_0x4798('0x86')](_0x4798('0x87'),attributes,{'tableName':_0x4798('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x176999){var _0x47624f={'raw':_0x176999[_0x4798('0x83')]['raw'],'where':{}};var _0x594e1f={};var _0x761828={'count':0x0,'rows':[]};var _0x5ce5bc=_0x176999[_0x4798('0x83')][_0x4798('0x89')];var _0x35df31=_0x176999[_0x4798('0x83')][_0x4798('0x8a')]||![];var _0xf2f353=_0x3909df(_0x5ce5bc,_0x35df31);if(!_0xf2f353[_0x4798('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x5ce5bc+'\x27');var _0x153c47=[{'name':_0x5ce5bc}];if(!_[_0x4798('0x8b')](_0xf2f353[_0x4798('0x2e')]))_0x153c47=_0xf2f353[_0x4798('0x2e')];var _0xbffd87=[];for(var _0x4a0830=0x0;_0x4a0830<_0x153c47[_0x4798('0x8c')];_0x4a0830++){_0xbffd87[_0x4798('0x8d')](_0x322317['UserProfileSection'][_0x4798('0x8e')]({'where':{'userProfileId':_0x176999[_0x4798('0x8f')]['id'],'name':_0x153c47[_0x4a0830][_0x4798('0xd')]},'raw':!![]}));}return Promise['all'](_0xbffd87)['then'](function(_0x18d2f8){var _0x223f48=_[_0x4798('0x5')](_0x18d2f8,function(_0x3d93bf){return _0x3d93bf?_0x3d93bf:undefined;});var _0x3c6bc5=_['filter'](_0x153c47,[_0x4798('0x90'),!![]]);var _0x316888=_[_0x4798('0x8b')](_0x223f48)&&_['isEmpty'](_0x3c6bc5)?null:_['union'](_0x3c6bc5,_0x223f48);if(!_0x316888)return null;var _0x4bea0a=[];for(var _0x5eca66=0x0;_0x5eca66<_0x316888[_0x4798('0x8c')];_0x5eca66++){var _0x5b90fc=_[_0x4798('0x8e')](_0x153c47,function(_0x43dc45){return _0x316888[_0x5eca66]?_0x43dc45[_0x4798('0xd')]===_0x316888[_0x5eca66][_0x4798('0xd')]:null;});if(_0x5b90fc){if(_0x316888[_0x5eca66][_0x4798('0x90')]){_0x4bea0a[_0x4798('0x8d')](_0x47a599(_0xf2f353[_0x4798('0x14')],_0x316888[_0x5eca66]));}else{if(!_0x316888[_0x5eca66]['autoAssociation']){_0x4bea0a[_0x4798('0x8d')](_0x228622(_0x5b90fc,_0x316888[_0x5eca66],_0xf2f353[_0x4798('0x14')]));}else{if(_0x5b90fc[_0x4798('0xc')]){_0x4bea0a[_0x4798('0x8d')](_0x11d874(_0x5b90fc,_0x316888[_0x5eca66]));}}}}}return Promise['all'](_0x4bea0a);})['then'](function(_0x445bb2){var _0x384fb9=_0x445bb2;var _0x41d835=null;if(_0x384fb9){_0x41d835=_0x384fb9[_0x4798('0x8c')]===0x1?_0x384fb9[0x0]:null;}if(!_0x41d835&&!_0x384fb9)return _0x761828;var _0x41e8f3=_0x322317[_0xf2f353[_0x4798('0x14')]]['rawAttributes'];_0x594e1f[_0x4798('0xc')]=_[_0x4798('0x91')](_0x41e8f3);_0x594e1f[_0x4798('0x83')]=_[_0x4798('0x91')](_0x176999['query']);_0x594e1f['filters']=_[_0x4798('0x92')](_0x594e1f[_0x4798('0xc')],_0x594e1f[_0x4798('0x83')]);_0x47624f[_0x4798('0x93')]=_['intersection'](_0x594e1f['model'],qs[_0x4798('0x94')](_0x176999['query'][_0x4798('0x94')]));_0x47624f[_0x4798('0x93')]=_0x47624f[_0x4798('0x93')]['length']?_0x47624f[_0x4798('0x93')]:_0x594e1f[_0x4798('0xc')];if(!_0x176999[_0x4798('0x83')]['hasOwnProperty'](_0x4798('0x95'))){_0x47624f[_0x4798('0x96')]=qs[_0x4798('0x96')](_0x176999[_0x4798('0x83')][_0x4798('0x96')]);_0x47624f[_0x4798('0x97')]=qs[_0x4798('0x97')](_0x176999['query'][_0x4798('0x97')]);}_0x47624f[_0x4798('0x98')]=qs[_0x4798('0x99')](_0x176999[_0x4798('0x83')]['sort']);_0x47624f[_0x4798('0x9a')]=qs[_0x4798('0x9b')](_['pick'](_0x176999[_0x4798('0x83')],_0x594e1f[_0x4798('0x9b')]));if(_0x176999[_0x4798('0x83')][_0x4798('0x5')]){_0x47624f['where']=_[_0x4798('0x9c')](_0x47624f['where'],{'$or':_[_0x4798('0xa')](_0x41e8f3,function(_0x56b485){if(_0x56b485[_0x4798('0x38')][_0x4798('0x9d')]!==_0x4798('0x9e')){var _0x1e9fb9={};_0x1e9fb9[_0x56b485[_0x4798('0x6')]]={'$like':'%'+_0x176999[_0x4798('0x83')][_0x4798('0x5')]+'%'};return _0x1e9fb9;}})});}var _0x34c7c4=[];var _0x5aa447=null;var _0x3fa6ca={};if(_0x41d835){_0x5aa447=_[_0x4798('0x8e')](_0x153c47,['name',_0x41d835[_0x4798('0xd')]]);if(_0x5aa447[_0x4798('0x6')]){_0x3fa6ca={};if(_0xf2f353[_0x4798('0x14')]==='AnalyticExtractedReport'){_0x3fa6ca[_0x5aa447[_0x4798('0x9f')]]=_[_0x4798('0xa')](_0x41d835[_0x4798('0x9')],'id');}else{_0x3fa6ca[_0x5aa447['foreignKey']]=_0x41d835[_0x4798('0x9')];}_0x34c7c4[_0x4798('0x8d')](_0x3fa6ca);}else{_0x47624f[_0x4798('0x9a')]['id']=_0x41d835[_0x4798('0x9')];}}else{for(var _0x23cc93=0x0;_0x23cc93<_0x384fb9[_0x4798('0x8c')];_0x23cc93++){_0x5aa447=_['find'](_0x153c47,[_0x4798('0xd'),_0x384fb9[_0x23cc93][_0x4798('0xd')]]);if(_0x5aa447[_0x4798('0x6')]){_0x3fa6ca={};_0x3fa6ca[_0x5aa447[_0x4798('0x9f')]]=_0x384fb9[_0x23cc93][_0x4798('0x9')];_0x34c7c4[_0x4798('0x8d')](_0x3fa6ca);}else{if(!_0x47624f['where']['id'])_0x47624f[_0x4798('0x9a')]['id']=[];_0x384fb9[_0x23cc93][_0x4798('0x9')][_0x4798('0xa0')](function(_0x1d326e){_0x47624f[_0x4798('0x9a')]['id']['push'](_0x1d326e);});}}}if(!_[_0x4798('0x8b')](_0x34c7c4)){_0x47624f[_0x4798('0x9a')]=_['merge'](_0x47624f[_0x4798('0x9a')],{'$and':{'$or':_0x34c7c4}});}_0x47624f=_['merge']({},_0x47624f,_0x176999[_0x4798('0xa1')]);if(_0x41d835&&!_0x41d835[_0x4798('0xa2')]&&_0xf2f353['childModel']===_0x4798('0xf')){if(_0x176999[_0x4798('0x83')][_0x4798('0xa3')]){_0x47624f[_0x4798('0xa4')]=[{'all':!![]}];}return _0x322317[_0xf2f353[_0x4798('0x14')]]['findAll'](_0x47624f)[_0x4798('0x8')](function(_0x18b9e8){var _0x10cee8=[];_0x18b9e8[_0x4798('0xa0')](function(_0x199e01){var _0x5be126;switch(_0x199e01[_0x4798('0xa5')]){case _0x4798('0xa6'):_0x5be126=_['find'](_0x41d835[_0x4798('0x9')],function(_0x1fc136){return _0x1fc136['id']===_0x199e01[_0x4798('0x75')]&&_0x1fc136['type']===_0x4798('0xa7');});break;case'custom':_0x5be126=_[_0x4798('0x8e')](_0x41d835['associatedResources'],function(_0xd62177){return _0xd62177['id']===_0x199e01['reportId']&&_0xd62177[_0x4798('0x38')]===_0x4798('0xa8');});break;}if(_0x5be126)_0x10cee8[_0x4798('0x8d')](_0x199e01);});_0x761828['count']=_0x10cee8[_0x4798('0x8c')];_0x761828['rows']=_0x10cee8;return _0x761828;});}else{if(!_[_0x4798('0x8b')](_0x176999[_0x4798('0x83')][_0x4798('0xa9')])){_0x47624f['where']['id']=_0x47624f['where']['id']?_['intersection'](_0x47624f[_0x4798('0x9a')]['id'],_0x176999[_0x4798('0x83')][_0x4798('0xa9')]):_0x176999[_0x4798('0x83')][_0x4798('0xa9')];if(_0x176999[_0x4798('0x83')]['customSorting']){_0x47624f[_0x4798('0x98')]=_0x176999[_0x4798('0x83')][_0x4798('0xaa')];}}if(_0x176999[_0x4798('0x83')][_0x4798('0xab')]){_0x47624f[_0x4798('0x9a')]=_[_0x4798('0x9c')](_0x47624f[_0x4798('0x9a')],{'$and':_0x176999['query'][_0x4798('0xab')]});}return _0x322317[_0xf2f353[_0x4798('0x14')]][_0x4798('0xac')]({'where':_0x47624f[_0x4798('0x9a')]})[_0x4798('0x8')](function(_0x52caad){_0x761828['count']=_0x52caad;if(_0x176999[_0x4798('0x83')][_0x4798('0xa3')]){if(_0xf2f353['childModel']===_0x4798('0x1b')){_0x47624f[_0x4798('0xa4')]=[{'model':_0x322317[_0x4798('0x6c')],'as':_0x4798('0xad'),'attributes':['id',_0x4798('0xd'),_0x4798('0xae')],'required':_0x176999['query']['tag']?!![]:![]},{'model':_0x322317['Tag'],'as':_0x4798('0xaf'),'attributes':['id',_0x4798('0xd'),_0x4798('0xae')],'through':_0x176999[_0x4798('0x83')][_0x4798('0xb0')]?{'attributes':[],'where':{'TagId':_0x176999['query'][_0x4798('0xb0')]||undefined}}:{},'required':_0x176999[_0x4798('0x83')]['tag']?!![]:![]}];}else{_0x47624f[_0x4798('0xa4')]=[{'all':!![]}];}}return _0x322317[_0xf2f353[_0x4798('0x14')]][_0x4798('0x7')](_0x47624f);})[_0x4798('0x8')](function(_0x226b04){_0x761828[_0x4798('0xb1')]=_0x226b04;if(_0x5ce5bc===_0x4798('0xb2')&&_0x176999['query'][_0x4798('0xb3')]===_0x4798('0xb4')){var _0x7ab66f=[];for(var _0x1211db=0x0;_0x1211db<_0x761828[_0x4798('0xb1')][_0x4798('0x8c')];_0x1211db++){_0x7ab66f[_0x4798('0x8d')](_0x5ceb23(_0x4798('0xb5'),_0x761828[_0x4798('0xb1')][_0x1211db][_0x4798('0xb6')]));_0x7ab66f[_0x4798('0x8d')](_0x5ceb23('sms',_0x761828[_0x4798('0xb1')][_0x1211db]['dataValues']));_0x7ab66f[_0x4798('0x8d')](_0x5ceb23('fax',_0x761828[_0x4798('0xb1')][_0x1211db]['dataValues']));_0x7ab66f[_0x4798('0x8d')](_0x5ceb23(_0x4798('0xb7'),_0x761828['rows'][_0x1211db][_0x4798('0xb6')]));_0x7ab66f[_0x4798('0x8d')](_0x5ceb23(_0x4798('0xb8'),_0x761828['rows'][_0x1211db][_0x4798('0xb6')]));_0x7ab66f['push'](_0x5ceb23(_0x4798('0xb9'),_0x761828[_0x4798('0xb1')][_0x1211db][_0x4798('0xb6')]));}return Promise[_0x4798('0xba')](_0x7ab66f)['then'](function(){return _0x761828;});}return _0x761828;});}});}}});}; \ No newline at end of file +var _0xe75d=['user_profiles','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','ignore','union','length','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','offset','order','sort','pick','where','merge','key','VIRTUAL','foreignKey','options','includeAll','include','forEach','reportType','default','CustomReports','rows','count','Tags','tag','ThroughTags','color','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','lodash','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','VoiceQueues','QueueCampaigns','queue','outbound','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','MailAccount','openchannelqueues','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','VoiceQueue','users','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','customdashboards','Dashboard','intervals','Interval','Pause','Schedule','Sound','tags','Tag','templates','triggers','trunks','Trunk','variables','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','QueryTypes','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xe75d,0xf4));var _0xde75=function(_0x189119,_0x4c846a){_0x189119=_0x189119-0x0;var _0x319814=_0xe75d[_0x189119];return _0x319814;};'use strict';var _=require(_0xde75('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xde75('0x1'));var squel=require('squel');module[_0xde75('0x2')]=function(_0x4776a6){var _0x4616c8=_0x4776a6[_0xde75('0x3')];function _0x561a20(_0x213448,_0x202d50){return new Promise(function(_0x41a784,_0x23e231){if(!_0x202d50)return _0x41a784(null);var _0x1f41f2=_0x202d50[_0xde75('0x4')]?{[_0x202d50[_0xde75('0x4')][_0xde75('0x5')]]:_0x202d50[_0xde75('0x4')][_0xde75('0x6')]}:undefined;return _0x4616c8[_0x213448][_0xde75('0x7')]({'where':_0x1f41f2,'raw':!![]})[_0xde75('0x8')](function(_0x5b9d53){_0x202d50[_0xde75('0x9')]=_[_0xde75('0xa')](_0x5b9d53,'id');_0x41a784(_0x202d50);})[_0xde75('0xb')](function(_0x5c8f5d){_0x23e231(_0x5c8f5d);});});}function _0x2c030c(_0x55cc7a,_0x44c646){return new Promise(function(_0x57fc30,_0x2aad28){var _0x295575=_0x55cc7a['filter']?{[_0x55cc7a[_0xde75('0x4')][_0xde75('0x5')]]:_0x55cc7a[_0xde75('0x4')][_0xde75('0x6')]}:undefined;return _0x4616c8[_0x55cc7a[_0xde75('0xc')]][_0xde75('0x7')]({'where':_0x295575,'raw':!![]})[_0xde75('0x8')](function(_0x1e93ad){_0x44c646['associatedResources']=_[_0xde75('0xa')](_0x1e93ad,function(_0x3140ff){return _0x3140ff['name'];});_0x57fc30(_0x44c646);})[_0xde75('0xb')](function(_0x507af8){_0x2aad28(_0x507af8);});});}function _0x2213bb(_0x24fdd2,_0x1b955c,_0x20baf4){if(!_0x1b955c)return Promise[_0xde75('0xd')](null);return new Promise(function(_0x300506,_0x1d38bd){return _0x4616c8[_0xde75('0xe')][_0xde75('0x7')]({'where':{'sectionId':_0x1b955c['id']},'raw':!![]})[_0xde75('0x8')](function(_0x4b4b7b){if(_0x24fdd2[_0xde75('0x5')]&&_0x24fdd2[_0xde75('0x5')]!=='id'){_0x1b955c[_0xde75('0x9')]=_[_0xde75('0xa')](_0x4b4b7b,function(_0x59d707){return _0x59d707[_0x24fdd2[_0xde75('0x5')]];});}else{if(_0x20baf4===_0xde75('0xf')){_0x1b955c[_0xde75('0x9')]=_[_0xde75('0xa')](_0x4b4b7b,function(_0x1e0741){return{'id':_0x1e0741[_0xde75('0x10')],'type':_0x1e0741[_0xde75('0x11')]};});}else{_0x1b955c['associatedResources']=_[_0xde75('0xa')](_0x4b4b7b,function(_0x1fa3f0){return _0x1fa3f0[_0xde75('0x10')];});}}_0x300506(_0x1b955c);})[_0xde75('0xb')](function(_0x145e00){_0x1d38bd(_0x145e00);});});}function _0x4cee20(_0x1eca7d,_0x8a3377){var _0x26d13b={'parentSections':[]};switch(_0x1eca7d[_0xde75('0x12')]()){case _0xde75('0x13'):_0x26d13b['childModel']='SquareProject';break;case _0xde75('0x14'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x16');break;case _0xde75('0x17'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x18');_0x26d13b[_0xde75('0x19')]=[{'name':_0xde75('0x1a'),'field':_0xde75('0x1b'),'foreignKey':_0xde75('0x1c')}];break;case _0xde75('0x1d'):_0x26d13b['childModel']=_0xde75('0x1e');break;case _0xde75('0x1f'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x20');_0x26d13b[_0xde75('0x19')]=[{'name':_0xde75('0x21'),'field':'id','foreignKey':_0xde75('0x22')}];break;case _0xde75('0x23'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x24');break;case _0xde75('0x25'):_0x26d13b[_0xde75('0x15')]='CmCompany';break;case _0xde75('0x26'):_0x26d13b['childModel']=_0xde75('0x27');break;case _0xde75('0x28'):_0x26d13b['childModel']=_0xde75('0x29');break;case _0xde75('0x2a'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x2b');break;case _0xde75('0x2c'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x2d');break;case _0xde75('0x2e'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x2f');break;case _0xde75('0x30'):case _0xde75('0x31'):case _0xde75('0x32'):_0x26d13b[_0xde75('0x15')]='VoiceExtension';break;case _0xde75('0x33'):_0x26d13b['childModel']='VoiceContext';break;case _0xde75('0x34'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x35');break;case _0xde75('0x36'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x37');_0x26d13b[_0xde75('0x19')]=[{'name':_0xde75('0x38'),'field':_0xde75('0x1b'),'foreignKey':_0xde75('0x39'),'model':'User','filter':{'field':_0xde75('0x3a'),'value':[_0xde75('0x3b')]}},{'name':_0xde75('0x3c'),'field':_0xde75('0x1b'),'foreignKey':'membername','model':_0xde75('0x3d'),'filter':{'field':_0xde75('0x3a'),'value':['telephone']}},{'name':_0xde75('0x3e'),'field':_0xde75('0x1b'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xde75('0x11'),'value':['inbound']}},{'name':_0xde75('0x3f'),'field':_0xde75('0x1b'),'foreignKey':_0xde75('0x40'),'model':'VoiceQueue','filter':{'field':_0xde75('0x11'),'value':[_0xde75('0x41')]}}];break;case'musiconholds':_0x26d13b[_0xde75('0x15')]=_0xde75('0x42');break;case'chanspies':_0x26d13b['childModel']=_0xde75('0x43');break;case _0xde75('0x44'):_0x26d13b['childModel']=_0xde75('0x45');break;case _0xde75('0x46'):_0x26d13b[_0xde75('0x15')]='Campaign';break;case _0xde75('0x47'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x48');break;case'mailaccounts':_0x26d13b['childModel']=_0xde75('0x49');break;case'mailsubstatuses':_0x26d13b['childModel']='MailSubstatus';break;case _0xde75('0x4a'):_0x26d13b['childModel']='OpenchannelQueue';break;case _0xde75('0x4b'):_0x26d13b[_0xde75('0x15')]='OpenchannelAccount';break;case _0xde75('0x4c'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x4d');break;case _0xde75('0x4e'):_0x26d13b['childModel']=_0xde75('0x4f');break;case'whatsappqueues':_0x26d13b[_0xde75('0x15')]=_0xde75('0x50');break;case _0xde75('0x51'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x52');break;case _0xde75('0x53'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x54');break;case'voicequeues':case _0xde75('0x55'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x56');if(_0x8a3377){_0x26d13b['parentSections']=[{'name':_0xde75('0x3e')},{'name':'QueueCampaigns'}];}break;case _0xde75('0x57'):case'agents':case'telephones':_0x26d13b[_0xde75('0x15')]=_0xde75('0x3d');if(_0x8a3377){_0x26d13b[_0xde75('0x19')]=[{'name':_0xde75('0x58'),'filter':{'field':_0xde75('0x3a'),'value':[_0xde75('0x59'),'user']},'ignore':!![]},{'name':_0xde75('0x38')},{'name':_0xde75('0x3c')}];}break;case _0xde75('0x5a'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x5b');break;case _0xde75('0x5c'):_0x26d13b['childModel']=_0xde75('0x5d');break;case _0xde75('0x5e'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x5f');break;case _0xde75('0x60'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x61');break;case'deskaccounts':_0x26d13b[_0xde75('0x15')]=_0xde75('0x62');break;case _0xde75('0x63'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x64');break;case _0xde75('0x65'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x3d');break;case _0xde75('0x66'):_0x26d13b[_0xde75('0x15')]='CannedAnswer';break;case _0xde75('0x67'):_0x26d13b['childModel']='Disposition';break;case _0xde75('0x68'):_0x26d13b['childModel']=_0xde75('0x69');break;case _0xde75('0x6a'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x6b');break;case'pauses':_0x26d13b['childModel']=_0xde75('0x6c');break;case'scheduler':_0x26d13b[_0xde75('0x15')]=_0xde75('0x6d');break;case'sounds':_0x26d13b['childModel']=_0xde75('0x6e');break;case _0xde75('0x6f'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x70');break;case _0xde75('0x71'):_0x26d13b[_0xde75('0x15')]='Template';break;case _0xde75('0x72'):_0x26d13b['childModel']='Trigger';break;case _0xde75('0x73'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x74');break;case _0xde75('0x75'):_0x26d13b[_0xde75('0x15')]='Variable';break;case _0xde75('0x76'):_0x26d13b[_0xde75('0x15')]=_0xde75('0x77');break;case _0xde75('0x78'):_0x26d13b['childModel']=_0xde75('0xf');_0x26d13b[_0xde75('0x19')]=[{'name':_0xde75('0x79'),'field':'id','foreignKey':_0xde75('0x7a')}];break;case _0xde75('0x7b'):_0x26d13b['childModel']=_0xde75('0x7c');break;}return _0x26d13b;}function _0x58d81a(_0x211788,_0x214571){var _0x2a4323=_0x211788[_0xde75('0x7d')](0x0)[_0xde75('0x7e')]()+_0x211788['slice'](0x1);var _0x4232ab={'type':_0x4616c8['Sequelize'][_0xde75('0x7f')]['SELECT'],'raw':!![]};return new Promise(function(_0x512a2c,_0x2c1ca4){var _0x343f5b=squel[_0xde75('0x80')]()['field'](_0xde75('0x81')+_0x2a4323+_0xde75('0x82'),'id')[_0xde75('0x5')](_0xde75('0x83'))['from'](_0xde75('0x84')+_0x211788+_0xde75('0x85'),'ui')['where'](_0xde75('0x86'),_0x214571['id']);return _0x4616c8[_0xde75('0x87')][_0xde75('0x88')](_0x343f5b[_0xde75('0x89')](),_0x4232ab)[_0xde75('0x8')](function(_0x203f73){_0x214571[_0x2a4323+'OpenTabs']=_0x203f73;_0x512a2c(_0x203f73);})[_0xde75('0xb')](function(_0x17e00f){_0x2c1ca4(_0x17e00f);});});}return _0x4776a6[_0xde75('0x8a')](_0xde75('0x8b'),attributes,{'tableName':_0xde75('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x11017c){var _0x4c1336={'raw':_0x11017c[_0xde75('0x88')]['raw'],'where':{}};var _0x433fcc={};var _0x245cc7={'count':0x0,'rows':[]};var _0x15105d=_0x11017c[_0xde75('0x88')][_0xde75('0x8d')];var _0x555cce=_0x11017c[_0xde75('0x88')]['mergeResources']||![];var _0x5854d8=_0x4cee20(_0x15105d,_0x555cce);if(!_0x5854d8['childModel'])throw new Error(_0xde75('0x8e')+_0x15105d+'\x27');var _0x7eadfd=[{'name':_0x15105d}];if(!_[_0xde75('0x8f')](_0x5854d8[_0xde75('0x19')]))_0x7eadfd=_0x5854d8[_0xde75('0x19')];var _0x14340d=[];for(var _0x18857e=0x0;_0x18857e<_0x7eadfd['length'];_0x18857e++){_0x14340d[_0xde75('0x90')](_0x4616c8[_0xde75('0x91')][_0xde75('0x92')]({'where':{'userProfileId':_0x11017c[_0xde75('0x93')]['id'],'name':_0x7eadfd[_0x18857e]['name']},'raw':!![]}));}return Promise['all'](_0x14340d)[_0xde75('0x8')](function(_0x21cc95){var _0x302efe=_[_0xde75('0x4')](_0x21cc95,function(_0x261906){return _0x261906?_0x261906:undefined;});var _0x521493=_[_0xde75('0x4')](_0x7eadfd,[_0xde75('0x94'),!![]]);var _0x5a3256=_[_0xde75('0x8f')](_0x302efe)&&_['isEmpty'](_0x521493)?null:_[_0xde75('0x95')](_0x521493,_0x302efe);if(!_0x5a3256)return null;var _0x30caec=[];for(var _0x35e060=0x0;_0x35e060<_0x5a3256[_0xde75('0x96')];_0x35e060++){var _0x269128=_['find'](_0x7eadfd,function(_0x342c48){return _0x5a3256[_0x35e060]?_0x342c48['name']===_0x5a3256[_0x35e060][_0xde75('0x1b')]:null;});if(_0x269128){if(_0x5a3256[_0x35e060][_0xde75('0x94')]){_0x30caec[_0xde75('0x90')](_0x561a20(_0x5854d8[_0xde75('0x15')],_0x5a3256[_0x35e060]));}else{if(!_0x5a3256[_0x35e060][_0xde75('0x97')]){_0x30caec[_0xde75('0x90')](_0x2213bb(_0x269128,_0x5a3256[_0x35e060],_0x5854d8[_0xde75('0x15')]));}else{if(_0x269128['model']){_0x30caec[_0xde75('0x90')](_0x2c030c(_0x269128,_0x5a3256[_0x35e060]));}}}}}return Promise['all'](_0x30caec);})[_0xde75('0x8')](function(_0x25f345){var _0x1220eb=_0x25f345;var _0x57e985=null;if(_0x1220eb){_0x57e985=_0x1220eb[_0xde75('0x96')]===0x1?_0x1220eb[0x0]:null;}if(!_0x57e985&&!_0x1220eb)return _0x245cc7;var _0x4fe412=_0x4616c8[_0x5854d8[_0xde75('0x15')]][_0xde75('0x98')];_0x433fcc[_0xde75('0xc')]=_[_0xde75('0x99')](_0x4fe412);_0x433fcc[_0xde75('0x88')]=_['keys'](_0x11017c['query']);_0x433fcc[_0xde75('0x9a')]=_['intersection'](_0x433fcc['model'],_0x433fcc[_0xde75('0x88')]);_0x4c1336[_0xde75('0x9b')]=_[_0xde75('0x9c')](_0x433fcc['model'],qs[_0xde75('0x9d')](_0x11017c[_0xde75('0x88')]['fields']));_0x4c1336[_0xde75('0x9b')]=_0x4c1336[_0xde75('0x9b')][_0xde75('0x96')]?_0x4c1336[_0xde75('0x9b')]:_0x433fcc[_0xde75('0xc')];if(!_0x11017c[_0xde75('0x88')][_0xde75('0x9e')]('nolimit')){_0x4c1336[_0xde75('0x9f')]=qs[_0xde75('0x9f')](_0x11017c[_0xde75('0x88')][_0xde75('0x9f')]);_0x4c1336[_0xde75('0xa0')]=qs['offset'](_0x11017c[_0xde75('0x88')][_0xde75('0xa0')]);}_0x4c1336[_0xde75('0xa1')]=qs[_0xde75('0xa2')](_0x11017c['query'][_0xde75('0xa2')]);_0x4c1336['where']=qs['filters'](_[_0xde75('0xa3')](_0x11017c[_0xde75('0x88')],_0x433fcc[_0xde75('0x9a')]));if(_0x11017c[_0xde75('0x88')][_0xde75('0x4')]){_0x4c1336[_0xde75('0xa4')]=_[_0xde75('0xa5')](_0x4c1336[_0xde75('0xa4')],{'$or':_[_0xde75('0xa')](_0x4fe412,function(_0x5553d1){if(_0x5553d1[_0xde75('0x11')][_0xde75('0xa6')]!==_0xde75('0xa7')){var _0x4139f0={};_0x4139f0[_0x5553d1['field']]={'$like':'%'+_0x11017c[_0xde75('0x88')]['filter']+'%'};return _0x4139f0;}})});}var _0x30cb91=[];var _0x296839=null;var _0x57e53a={};if(_0x57e985){_0x296839=_['find'](_0x7eadfd,[_0xde75('0x1b'),_0x57e985['name']]);if(_0x296839[_0xde75('0x5')]){_0x57e53a={};if(_0x5854d8[_0xde75('0x15')]==='AnalyticExtractedReport'){_0x57e53a[_0x296839[_0xde75('0xa8')]]=_[_0xde75('0xa')](_0x57e985[_0xde75('0x9')],'id');}else{_0x57e53a[_0x296839['foreignKey']]=_0x57e985[_0xde75('0x9')];}_0x30cb91[_0xde75('0x90')](_0x57e53a);}else{_0x4c1336[_0xde75('0xa4')]['id']=_0x57e985[_0xde75('0x9')];}}else{for(var _0x41971b=0x0;_0x41971b<_0x1220eb[_0xde75('0x96')];_0x41971b++){_0x296839=_[_0xde75('0x92')](_0x7eadfd,[_0xde75('0x1b'),_0x1220eb[_0x41971b][_0xde75('0x1b')]]);if(_0x296839['field']){_0x57e53a={};_0x57e53a[_0x296839['foreignKey']]=_0x1220eb[_0x41971b][_0xde75('0x9')];_0x30cb91[_0xde75('0x90')](_0x57e53a);}else{if(!_0x4c1336[_0xde75('0xa4')]['id'])_0x4c1336[_0xde75('0xa4')]['id']=[];_0x1220eb[_0x41971b][_0xde75('0x9')]['forEach'](function(_0x14aaef){_0x4c1336[_0xde75('0xa4')]['id'][_0xde75('0x90')](_0x14aaef);});}}}if(!_[_0xde75('0x8f')](_0x30cb91)){_0x4c1336[_0xde75('0xa4')]=_[_0xde75('0xa5')](_0x4c1336[_0xde75('0xa4')],{'$and':{'$or':_0x30cb91}});}_0x4c1336=_[_0xde75('0xa5')]({},_0x4c1336,_0x11017c[_0xde75('0xa9')]);if(_0x57e985&&!_0x57e985[_0xde75('0x97')]&&_0x5854d8[_0xde75('0x15')]===_0xde75('0xf')){if(_0x11017c['query'][_0xde75('0xaa')]){_0x4c1336[_0xde75('0xab')]=[{'all':!![]}];}return _0x4616c8[_0x5854d8[_0xde75('0x15')]][_0xde75('0x7')](_0x4c1336)['then'](function(_0x2797ac){var _0x4a7489=[];_0x2797ac[_0xde75('0xac')](function(_0x8971c7){var _0x4d13f8;switch(_0x8971c7[_0xde75('0xad')]){case _0xde75('0xae'):_0x4d13f8=_[_0xde75('0x92')](_0x57e985[_0xde75('0x9')],function(_0x13b42f){return _0x13b42f['id']===_0x8971c7[_0xde75('0x7a')]&&_0x13b42f[_0xde75('0x11')]==='DefaultReports';});break;case'custom':_0x4d13f8=_[_0xde75('0x92')](_0x57e985[_0xde75('0x9')],function(_0x4f5528){return _0x4f5528['id']===_0x8971c7[_0xde75('0x7a')]&&_0x4f5528[_0xde75('0x11')]===_0xde75('0xaf');});break;}if(_0x4d13f8)_0x4a7489['push'](_0x8971c7);});_0x245cc7['count']=_0x4a7489['length'];_0x245cc7[_0xde75('0xb0')]=_0x4a7489;return _0x245cc7;});}else{if(!_[_0xde75('0x8f')](_0x11017c[_0xde75('0x88')]['ids'])){_0x4c1336[_0xde75('0xa4')]['id']=_0x4c1336['where']['id']?_[_0xde75('0x9c')](_0x4c1336[_0xde75('0xa4')]['id'],_0x11017c[_0xde75('0x88')]['ids']):_0x11017c[_0xde75('0x88')]['ids'];if(_0x11017c['query']['customSorting']){_0x4c1336['order']=_0x11017c['query']['customSorting'];}}if(_0x11017c[_0xde75('0x88')]['extraQueryConditions']){_0x4c1336['where']=_[_0xde75('0xa5')](_0x4c1336['where'],{'$and':_0x11017c[_0xde75('0x88')]['extraQueryConditions']});}return _0x4616c8[_0x5854d8[_0xde75('0x15')]]['count']({'where':_0x4c1336['where']})['then'](function(_0x18ecdc){_0x245cc7[_0xde75('0xb1')]=_0x18ecdc;if(_0x11017c['query'][_0xde75('0xaa')]){if(_0x5854d8['childModel']===_0xde75('0x20')){_0x4c1336['include']=[{'model':_0x4616c8['Tag'],'as':_0xde75('0xb2'),'attributes':['id',_0xde75('0x1b'),'color'],'required':_0x11017c['query'][_0xde75('0xb3')]?!![]:![]},{'model':_0x4616c8[_0xde75('0x70')],'as':_0xde75('0xb4'),'attributes':['id',_0xde75('0x1b'),_0xde75('0xb5')],'through':_0x11017c['query']['tag']?{'attributes':[],'where':{'TagId':_0x11017c['query'][_0xde75('0xb3')]||undefined}}:{},'required':_0x11017c[_0xde75('0x88')][_0xde75('0xb3')]?!![]:![]}];}else{_0x4c1336[_0xde75('0xab')]=[{'all':!![]}];}}return _0x4616c8[_0x5854d8[_0xde75('0x15')]][_0xde75('0x7')](_0x4c1336);})[_0xde75('0x8')](function(_0x5279ab){_0x245cc7['rows']=_0x5279ab;if(_0x15105d==='Agents'&&_0x11017c[_0xde75('0x88')][_0xde75('0xb6')]===_0xde75('0xb7')){var _0xd151e8=[];for(var _0x1acdac=0x0;_0x1acdac<_0x245cc7[_0xde75('0xb0')][_0xde75('0x96')];_0x1acdac++){_0xd151e8[_0xde75('0x90')](_0x58d81a(_0xde75('0xb8'),_0x245cc7[_0xde75('0xb0')][_0x1acdac][_0xde75('0xb9')]));_0xd151e8[_0xde75('0x90')](_0x58d81a(_0xde75('0xba'),_0x245cc7['rows'][_0x1acdac]['dataValues']));_0xd151e8[_0xde75('0x90')](_0x58d81a(_0xde75('0xbb'),_0x245cc7['rows'][_0x1acdac]['dataValues']));_0xd151e8['push'](_0x58d81a(_0xde75('0xbc'),_0x245cc7['rows'][_0x1acdac][_0xde75('0xb9')]));_0xd151e8[_0xde75('0x90')](_0x58d81a(_0xde75('0xbd'),_0x245cc7[_0xde75('0xb0')][_0x1acdac][_0xde75('0xb9')]));_0xd151e8['push'](_0x58d81a(_0xde75('0xbe'),_0x245cc7[_0xde75('0xb0')][_0x1acdac]['dataValues']));}return Promise[_0xde75('0xbf')](_0xd151e8)[_0xde75('0x8')](function(){return _0x245cc7;});}return _0x245cc7;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 1672ca1..70519a8 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 _0x7804=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','UserProfile,\x20%s,\x20%s','error'];(function(_0x789a3a,_0x2582f7){var _0x41f1e3=function(_0x4bd077){while(--_0x4bd077){_0x789a3a['push'](_0x789a3a['shift']());}};_0x41f1e3(++_0x2582f7);}(_0x7804,0xc3));var _0x4780=function(_0x3a07a3,_0x5bcb88){_0x3a07a3=_0x3a07a3-0x0;var _0x198d31=_0x7804[_0x3a07a3];return _0x198d31;};'use strict';var _=require(_0x4780('0x0'));var util=require('util');var moment=require(_0x4780('0x1'));var BPromise=require(_0x4780('0x2'));var rs=require(_0x4780('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4780('0x4'))['db'];var utils=require(_0x4780('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4780('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4780('0x7')]({'port':0x232a});config[_0x4780('0x8')]=_[_0x4780('0x9')](config[_0x4780('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4780('0xa'))(new Redis(config['redis']));require('./userProfile.socket')[_0x4780('0xb')](socket);function respondWithRpcPromise(_0x14be09,_0x2fc8a9,_0x45369b){return new BPromise(function(_0x4af80e,_0x5ca23a){return client[_0x4780('0xc')](_0x14be09,_0x45369b)[_0x4780('0xd')](function(_0x21d3d5){logger['info']('UserProfile,\x20%s,\x20%s',_0x2fc8a9,_0x4780('0xe'));logger[_0x4780('0xf')](_0x4780('0x10'),_0x2fc8a9,_0x4780('0xe'),JSON[_0x4780('0x11')](_0x21d3d5));if(_0x21d3d5['error']){if(_0x21d3d5['error'][_0x4780('0x12')]===0x1f4){logger['error'](_0x4780('0x13'),_0x2fc8a9,_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);return _0x5ca23a(_0x21d3d5[_0x4780('0x14')]['message']);}logger[_0x4780('0x14')]('UserProfile,\x20%s,\x20%s',_0x2fc8a9,_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);return _0x4af80e(_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);}else{logger['info'](_0x4780('0x13'),_0x2fc8a9,'request\x20sent');_0x4af80e(_0x21d3d5[_0x4780('0x16')][_0x4780('0x15')]);}})[_0x4780('0x17')](function(_0x3af22f){logger['error'](_0x4780('0x13'),_0x2fc8a9,_0x3af22f);_0x5ca23a(_0x3af22f);});});} \ No newline at end of file +var _0x7e02=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3d43ab,_0x4e2b93){var _0x543481=function(_0x1f8d1a){while(--_0x1f8d1a){_0x3d43ab['push'](_0x3d43ab['shift']());}};_0x543481(++_0x4e2b93);}(_0x7e02,0x71));var _0x27e0=function(_0x56a1d0,_0x16a437){_0x56a1d0=_0x56a1d0-0x0;var _0x5952c4=_0x7e02[_0x56a1d0];return _0x5952c4;};'use strict';var _=require(_0x27e0('0x0'));var util=require(_0x27e0('0x1'));var moment=require(_0x27e0('0x2'));var BPromise=require(_0x27e0('0x3'));var rs=require(_0x27e0('0x4'));var fs=require('fs');var Redis=require(_0x27e0('0x5'));var db=require(_0x27e0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x27e0('0x7'));var config=require('../../config/environment');var jayson=require(_0x27e0('0x8'));var client=jayson[_0x27e0('0x9')][_0x27e0('0xa')]({'port':0x232a});config[_0x27e0('0xb')]=_[_0x27e0('0xc')](config[_0x27e0('0xb')],{'host':_0x27e0('0xd'),'port':0x18eb});var socket=require(_0x27e0('0xe'))(new Redis(config['redis']));require(_0x27e0('0xf'))['register'](socket);function respondWithRpcPromise(_0xa5a2fd,_0x1d7413,_0x480486){return new BPromise(function(_0x17f18d,_0xbf3ce5){return client[_0x27e0('0x10')](_0xa5a2fd,_0x480486)[_0x27e0('0x11')](function(_0x12db7d){logger[_0x27e0('0x12')](_0x27e0('0x13'),_0x1d7413,_0x27e0('0x14'));logger[_0x27e0('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x1d7413,_0x27e0('0x14'),JSON[_0x27e0('0x16')](_0x12db7d));if(_0x12db7d[_0x27e0('0x17')]){if(_0x12db7d['error'][_0x27e0('0x18')]===0x1f4){logger[_0x27e0('0x17')](_0x27e0('0x13'),_0x1d7413,_0x12db7d['error'][_0x27e0('0x19')]);return _0xbf3ce5(_0x12db7d[_0x27e0('0x17')][_0x27e0('0x19')]);}logger[_0x27e0('0x17')]('UserProfile,\x20%s,\x20%s',_0x1d7413,_0x12db7d['error'][_0x27e0('0x19')]);return _0x17f18d(_0x12db7d[_0x27e0('0x17')][_0x27e0('0x19')]);}else{logger[_0x27e0('0x12')]('UserProfile,\x20%s,\x20%s',_0x1d7413,_0x27e0('0x14'));_0x17f18d(_0x12db7d[_0x27e0('0x1a')][_0x27e0('0x19')]);}})[_0x27e0('0x1b')](function(_0x608e4f){logger[_0x27e0('0x17')]('UserProfile,\x20%s,\x20%s',_0x1d7413,_0x608e4f);_0xbf3ce5(_0x608e4f);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 8f2b978..ca5b78f 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 _0x5868=['update','emit','removeListener','register','length','userProfile:','save','remove'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0x5868,0x186));var _0x8586=function(_0x136ad2,_0x2f1a94){_0x136ad2=_0x136ad2-0x0;var _0x5e085c=_0x5868[_0x136ad2];return _0x5e085c;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x8586('0x0'),_0x8586('0x1'),_0x8586('0x2')];function createListener(_0xf93a5b,_0xf5be4d){return function(_0x5de676){_0xf5be4d[_0x8586('0x3')](_0xf93a5b,_0x5de676);};}function removeListener(_0x2a5758,_0x50c8a0){return function(){UserProfileEvents[_0x8586('0x4')](_0x2a5758,_0x50c8a0);};}exports[_0x8586('0x5')]=function(_0x1d7b10){for(var _0x4995c0=0x0,_0xe6f8c0=events[_0x8586('0x6')];_0x4995c0<_0xe6f8c0;_0x4995c0++){var _0x2ccecd=events[_0x4995c0];var _0x566263=createListener(_0x8586('0x7')+_0x2ccecd,_0x1d7b10);UserProfileEvents['on'](_0x2ccecd,_0x566263);}}; \ No newline at end of file +var _0xb461=['./userProfile.events','save','remove','update','emit','removeListener','register','length'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xb461,0x130));var _0x1b46=function(_0x4ab2d0,_0x4df9b2){_0x4ab2d0=_0x4ab2d0-0x0;var _0x93626=_0xb461[_0x4ab2d0];return _0x93626;};'use strict';var UserProfileEvents=require(_0x1b46('0x0'));var events=[_0x1b46('0x1'),_0x1b46('0x2'),_0x1b46('0x3')];function createListener(_0x29c13e,_0xcc4f5b){return function(_0x2d7170){_0xcc4f5b[_0x1b46('0x4')](_0x29c13e,_0x2d7170);};}function removeListener(_0x21286c,_0x4872f9){return function(){UserProfileEvents[_0x1b46('0x5')](_0x21286c,_0x4872f9);};}exports[_0x1b46('0x6')]=function(_0xbccd02){for(var _0x2d04e3=0x0,_0x2d4131=events[_0x1b46('0x7')];_0x2d04e3<_0x2d4131;_0x2d04e3++){var _0xe2cf34=events[_0x2d04e3];var _0x664f67=createListener('userProfile:'+_0xe2cf34,_0xbccd02);UserProfileEvents['on'](_0xe2cf34,_0x664f67);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 738f65f..574d541 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 _0x4010=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','exports','multer'];(function(_0x257316,_0x2495fe){var _0x1d769d=function(_0x17fb19){while(--_0x17fb19){_0x257316['push'](_0x257316['shift']());}};_0x1d769d(++_0x2495fe);}(_0x4010,0x153));var _0x0401=function(_0x1816b1,_0x54c9fe){_0x1816b1=_0x1816b1-0x0;var _0x24d478=_0x4010[_0x1816b1];return _0x24d478;};'use strict';var multer=require(_0x0401('0x0'));var util=require(_0x0401('0x1'));var path=require(_0x0401('0x2'));var timeout=require(_0x0401('0x3'));var express=require(_0x0401('0x4'));var router=express['Router']();var fs_extra=require(_0x0401('0x5'));var auth=require(_0x0401('0x6'));var interaction=require(_0x0401('0x7'));var config=require(_0x0401('0x8'));var controller=require(_0x0401('0x9'));router[_0x0401('0xa')]('/',auth[_0x0401('0xb')](),controller['index']);router[_0x0401('0xa')](_0x0401('0xc'),auth['isAuthenticated'](),controller[_0x0401('0xd')]);router[_0x0401('0xa')](_0x0401('0xe'),auth[_0x0401('0xb')](),controller[_0x0401('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0401('0x10')]);router['put'](_0x0401('0xe'),auth[_0x0401('0xb')](),controller[_0x0401('0x11')]);router[_0x0401('0x12')](_0x0401('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x0401('0x13')]=router; \ No newline at end of file +var _0xe226=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','./userProfileResource.controller','get'];(function(_0x5edc80,_0x560073){var _0xd9552e=function(_0x18f7c0){while(--_0x18f7c0){_0x5edc80['push'](_0x5edc80['shift']());}};_0xd9552e(++_0x560073);}(_0xe226,0x1db));var _0x6e22=function(_0x51775f,_0x32b5b9){_0x51775f=_0x51775f-0x0;var _0x1a31ef=_0xe226[_0x51775f];return _0x1a31ef;};'use strict';var multer=require(_0x6e22('0x0'));var util=require(_0x6e22('0x1'));var path=require(_0x6e22('0x2'));var timeout=require(_0x6e22('0x3'));var express=require(_0x6e22('0x4'));var router=express['Router']();var fs_extra=require(_0x6e22('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6e22('0x6'));router[_0x6e22('0x7')]('/',auth[_0x6e22('0x8')](),controller[_0x6e22('0x9')]);router[_0x6e22('0x7')](_0x6e22('0xa'),auth[_0x6e22('0x8')](),controller[_0x6e22('0xb')]);router['get'](_0x6e22('0xc'),auth[_0x6e22('0x8')](),controller[_0x6e22('0xd')]);router[_0x6e22('0xe')]('/',auth[_0x6e22('0x8')](),controller[_0x6e22('0xf')]);router[_0x6e22('0x10')]('/:id',auth[_0x6e22('0x8')](),controller[_0x6e22('0x11')]);router[_0x6e22('0x12')](_0x6e22('0xc'),auth['isAuthenticated'](),controller[_0x6e22('0x13')]);module[_0x6e22('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 3cf8ac6..d41d90d 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 _0x8113=['exports','STRING','sequelize'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0x8113,0xa4));var _0x3811=function(_0xd68f5f,_0x2e8cc3){_0xd68f5f=_0xd68f5f-0x0;var _0x1b36f6=_0x8113[_0xd68f5f];return _0x1b36f6;};'use strict';var Sequelize=require(_0x3811('0x0'));module[_0x3811('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x3811('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd12b=['sequelize','exports','STRING'];(function(_0x5a4c93,_0x283aa8){var _0x421ff4=function(_0x1afb30){while(--_0x1afb30){_0x5a4c93['push'](_0x5a4c93['shift']());}};_0x421ff4(++_0x283aa8);}(_0xd12b,0xdb));var _0xbd12=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0xd12b[_0x43d16c];return _0x208cce;};'use strict';var Sequelize=require(_0xbd12('0x0'));module[_0xbd12('0x1')]={'name':{'type':Sequelize[_0xbd12('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xbd12('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 1303ee0..982f8f7 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 _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','UserProfileResource','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(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0x1967,0x173));var _0x7196=function(_0x2213a6,_0x38782a){_0x2213a6=_0x2213a6-0x0;var _0x2608f7=_0x1967[_0x2213a6];return _0x2608f7;};'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['UserProfileResource'][_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['UserProfileResource'][_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['UserProfileResource'][_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 _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0xba34,0x119));var _0x4ba3=function(_0x400d55,_0x46979e){_0x400d55=_0x400d55-0x0;var _0x42fb60=_0xba34[_0x400d55];return _0x42fb60;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['UserProfileResource']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 79c69b6..2151a95 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 _0x3ecc=['resourceId','sectionId','lodash','util','../../config/logger','api','moment','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x5f153b,_0x194c12){var _0x3c861b=function(_0x47fc30){while(--_0x47fc30){_0x5f153b['push'](_0x5f153b['shift']());}};_0x3c861b(++_0x194c12);}(_0x3ecc,0x1a6));var _0xc3ec=function(_0x41beb0,_0x2298de){_0x41beb0=_0x41beb0-0x0;var _0x77cc6f=_0x3ecc[_0x41beb0];return _0x77cc6f;};'use strict';var _=require(_0xc3ec('0x0'));var util=require(_0xc3ec('0x1'));var logger=require(_0xc3ec('0x2'))(_0xc3ec('0x3'));var moment=require(_0xc3ec('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3ec('0x5'));var rimraf=require('rimraf');var config=require(_0xc3ec('0x6'));var attributes=require(_0xc3ec('0x7'));module[_0xc3ec('0x8')]=function(_0x34177e,_0x3a9989){return _0x34177e[_0xc3ec('0x9')](_0xc3ec('0xa'),attributes,{'tableName':_0xc3ec('0xb'),'paranoid':![],'indexes':[{'name':_0xc3ec('0xc'),'fields':[_0xc3ec('0xd'),_0xc3ec('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc14a=['request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','moment','bluebird'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc14a,0x191));var _0xac14=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc14a[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xac14('0x0'));var logger=require(_0xac14('0x1'))('api');var moment=require(_0xac14('0x2'));var BPromise=require(_0xac14('0x3'));var rp=require(_0xac14('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac14('0x5'));var config=require(_0xac14('0x6'));var attributes=require(_0xac14('0x7'));module[_0xac14('0x8')]=function(_0x182cdc,_0xb72a35){return _0x182cdc[_0xac14('0x9')](_0xac14('0xa'),attributes,{'tableName':_0xac14('0xb'),'paranoid':![],'indexes':[{'name':_0xac14('0xc'),'fields':[_0xac14('0xd'),_0xac14('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index ed0e9c1..9742df3 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 _0xc00a=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc00a,0xe2));var _0xac00=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xc00a[_0xb0de07];return _0x4633d8;};'use strict';var _=require(_0xac00('0x0'));var util=require('util');var moment=require(_0xac00('0x1'));var BPromise=require('bluebird');var rs=require(_0xac00('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac00('0x3'))['db'];var utils=require(_0xac00('0x4'));var logger=require(_0xac00('0x5'))('rpc');var config=require(_0xac00('0x6'));var jayson=require(_0xac00('0x7'));var client=jayson[_0xac00('0x8')][_0xac00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed103,_0x4ea516,_0x580f6b){return new BPromise(function(_0x3573f4,_0x2afa0e){return client['request'](_0x1ed103,_0x580f6b)[_0xac00('0xa')](function(_0x373c2f){logger[_0xac00('0xb')](_0xac00('0xc'),_0x4ea516,_0xac00('0xd'));logger['debug'](_0xac00('0xe'),_0x4ea516,_0xac00('0xd'),JSON[_0xac00('0xf')](_0x373c2f));if(_0x373c2f[_0xac00('0x10')]){if(_0x373c2f[_0xac00('0x10')]['code']===0x1f4){logger[_0xac00('0x10')](_0xac00('0xc'),_0x4ea516,_0x373c2f['error'][_0xac00('0x11')]);return _0x2afa0e(_0x373c2f['error']['message']);}logger[_0xac00('0x10')](_0xac00('0xc'),_0x4ea516,_0x373c2f[_0xac00('0x10')][_0xac00('0x11')]);return _0x3573f4(_0x373c2f[_0xac00('0x10')]['message']);}else{logger['info'](_0xac00('0xc'),_0x4ea516,_0xac00('0xd'));_0x3573f4(_0x373c2f[_0xac00('0x12')][_0xac00('0x11')]);}})['catch'](function(_0x709130){logger[_0xac00('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x4ea516,_0x709130);_0x2afa0e(_0x709130);});});} \ No newline at end of file +var _0x758c=['stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x4f02f2,_0x1d2619){var _0x22248b=function(_0x33e00c){while(--_0x33e00c){_0x4f02f2['push'](_0x4f02f2['shift']());}};_0x22248b(++_0x1d2619);}(_0x758c,0xac));var _0xc758=function(_0x53d7d6,_0x26a3c7){_0x53d7d6=_0x53d7d6-0x0;var _0x1c13d2=_0x758c[_0x53d7d6];return _0x1c13d2;};'use strict';var _=require(_0xc758('0x0'));var util=require('util');var moment=require(_0xc758('0x1'));var BPromise=require(_0xc758('0x2'));var rs=require(_0xc758('0x3'));var fs=require('fs');var Redis=require(_0xc758('0x4'));var db=require(_0xc758('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc758('0x6'))(_0xc758('0x7'));var config=require(_0xc758('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc758('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cbcae,_0x45666d,_0x6f1d58){return new BPromise(function(_0x112235,_0x830591){return client[_0xc758('0xa')](_0x4cbcae,_0x6f1d58)[_0xc758('0xb')](function(_0x19da45){logger[_0xc758('0xc')](_0xc758('0xd'),_0x45666d,_0xc758('0xe'));logger[_0xc758('0xf')](_0xc758('0x10'),_0x45666d,_0xc758('0xe'),JSON[_0xc758('0x11')](_0x19da45));if(_0x19da45[_0xc758('0x12')]){if(_0x19da45[_0xc758('0x12')]['code']===0x1f4){logger[_0xc758('0x12')](_0xc758('0xd'),_0x45666d,_0x19da45[_0xc758('0x12')][_0xc758('0x13')]);return _0x830591(_0x19da45[_0xc758('0x12')][_0xc758('0x13')]);}logger[_0xc758('0x12')](_0xc758('0xd'),_0x45666d,_0x19da45['error'][_0xc758('0x13')]);return _0x112235(_0x19da45['error'][_0xc758('0x13')]);}else{logger[_0xc758('0xc')](_0xc758('0xd'),_0x45666d,_0xc758('0xe'));_0x112235(_0x19da45[_0xc758('0x14')][_0xc758('0x13')]);}})['catch'](function(_0x4b6fcc){logger[_0xc758('0x12')](_0xc758('0xd'),_0x45666d,_0x4b6fcc);_0x830591(_0x4b6fcc);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9423869..fa6adff 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 _0xedb6=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update'];(function(_0x5ceeea,_0xc9631b){var _0x200a9d=function(_0x44116e){while(--_0x44116e){_0x5ceeea['push'](_0x5ceeea['shift']());}};_0x200a9d(++_0xc9631b);}(_0xedb6,0x1a4));var _0x6edb=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0xedb6[_0x39d39d];return _0x577ac3;};'use strict';var multer=require(_0x6edb('0x0'));var util=require(_0x6edb('0x1'));var path=require(_0x6edb('0x2'));var timeout=require('connect-timeout');var express=require(_0x6edb('0x3'));var router=express[_0x6edb('0x4')]();var fs_extra=require(_0x6edb('0x5'));var auth=require(_0x6edb('0x6'));var interaction=require(_0x6edb('0x7'));var config=require(_0x6edb('0x8'));var controller=require(_0x6edb('0x9'));router[_0x6edb('0xa')]('/',auth[_0x6edb('0xb')](),controller[_0x6edb('0xc')]);router[_0x6edb('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x6edb('0xd')]);router['get'](_0x6edb('0xe'),auth['isAuthenticated'](),controller[_0x6edb('0xf')]);router[_0x6edb('0x10')]('/',auth[_0x6edb('0xb')](),controller[_0x6edb('0x11')]);router[_0x6edb('0x12')](_0x6edb('0xe'),auth[_0x6edb('0xb')](),controller[_0x6edb('0x13')]);router[_0x6edb('0x14')]('/:id',auth[_0x6edb('0xb')](),controller[_0x6edb('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf88c=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x98fd7c,_0x488a10){var _0x3ae559=function(_0x3f588b){while(--_0x3f588b){_0x98fd7c['push'](_0x98fd7c['shift']());}};_0x3ae559(++_0x488a10);}(_0xf88c,0x19c));var _0xcf88=function(_0x84d452,_0x131330){_0x84d452=_0x84d452-0x0;var _0x5def5b=_0xf88c[_0x84d452];return _0x5def5b;};'use strict';var multer=require('multer');var util=require(_0xcf88('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcf88('0x1'));var router=express[_0xcf88('0x2')]();var fs_extra=require(_0xcf88('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcf88('0x4'));var config=require(_0xcf88('0x5'));var controller=require(_0xcf88('0x6'));router[_0xcf88('0x7')]('/',auth[_0xcf88('0x8')](),controller[_0xcf88('0x9')]);router[_0xcf88('0x7')](_0xcf88('0xa'),auth[_0xcf88('0x8')](),controller[_0xcf88('0xb')]);router[_0xcf88('0x7')](_0xcf88('0xc'),auth[_0xcf88('0x8')](),controller[_0xcf88('0xd')]);router[_0xcf88('0xe')]('/',auth[_0xcf88('0x8')](),controller[_0xcf88('0xf')]);router[_0xcf88('0x10')](_0xcf88('0xc'),auth['isAuthenticated'](),controller[_0xcf88('0x11')]);router[_0xcf88('0x12')](_0xcf88('0xc'),auth[_0xcf88('0x8')](),controller[_0xcf88('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 6041ae0..2017fbb 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 _0xefda=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x178d1b,_0xecf56a){var _0x2592ec=function(_0x301403){while(--_0x301403){_0x178d1b['push'](_0x178d1b['shift']());}};_0x2592ec(++_0xecf56a);}(_0xefda,0x96));var _0xaefd=function(_0x3b57da,_0x47c5d5){_0x3b57da=_0x3b57da-0x0;var _0x126ae2=_0xefda[_0x3b57da];return _0x126ae2;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xaefd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaefd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaefd('0x1')],'set':function(_0x2ade44){this[_0xaefd('0x4')](_0xaefd('0x5'),_0x2ade44?_0x2ade44[_0xaefd('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xaefd('0x5'))?this[_0xaefd('0x7')](_0xaefd('0x5'))[_0xaefd('0x8')](''):[];}}}; \ No newline at end of file +var _0xe1e3=['getDataValue','split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x113566,_0x78c52a){var _0x359407=function(_0x2fa3ad){while(--_0x2fa3ad){_0x113566['push'](_0x113566['shift']());}};_0x359407(++_0x78c52a);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5eb68f,_0x1e8211){_0x5eb68f=_0x5eb68f-0x0;var _0x469e74=_0xe1e3[_0x5eb68f];return _0x469e74;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x3e1e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3e1e('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3bacc){this[_0x3e1e('0x4')](_0x3e1e('0x5'),_0x3bacc?_0x3bacc[_0x3e1e('0x6')](''):[]);},'get':function(){return this[_0x3e1e('0x7')](_0x3e1e('0x5'))?this['getDataValue'](_0x3e1e('0x5'))[_0x3e1e('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2ab1bbf..3e124cb 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 _0x9a84=['intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','describe','eml-format','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','api','../../config/environment','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','UserProfileSection','rawAttributes','fieldName','key','model','keys','filters'];(function(_0x41626f,_0x56dd65){var _0xf94873=function(_0x4bad76){while(--_0x4bad76){_0x41626f['push'](_0x41626f['shift']());}};_0xf94873(++_0x56dd65);}(_0x9a84,0x13a));var _0x49a8=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x9a84[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x49a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49a8('0x1'));var jsonpatch=require(_0x49a8('0x2'));var rp=require(_0x49a8('0x3'));var moment=require(_0x49a8('0x4'));var BPromise=require(_0x49a8('0x5'));var Mustache=require('mustache');var util=require(_0x49a8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x49a8('0x7'));var ejs=require(_0x49a8('0x8'));var fs=require('fs');var fs_extra=require(_0x49a8('0x9'));var _=require(_0x49a8('0xa'));var squel=require(_0x49a8('0xb'));var crypto=require(_0x49a8('0xc'));var jsforce=require(_0x49a8('0xd'));var deskjs=require(_0x49a8('0xe'));var toCsv=require(_0x49a8('0x7'));var querystring=require(_0x49a8('0xf'));var Papa=require(_0x49a8('0x10'));var Redis=require(_0x49a8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x49a8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x49a8('0x13'))(_0x49a8('0x14'));var utils=require('../../config/utils');var config=require(_0x49a8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ff630,_0x4c1e9b){_0x4c1e9b=_0x4c1e9b||0xcc;return function(_0x3449fd){if(_0x3449fd){return _0x2ff630[_0x49a8('0x16')](_0x4c1e9b);}return _0x2ff630[_0x49a8('0x17')](_0x4c1e9b)[_0x49a8('0x18')]();};}function respondWithResult(_0x27d9eb,_0x22673b){_0x22673b=_0x22673b||0xc8;return function(_0x25f2a5){if(_0x25f2a5){return _0x27d9eb[_0x49a8('0x17')](_0x22673b)[_0x49a8('0x19')](_0x25f2a5);}};}function respondWithFilteredResult(_0x344e23,_0xa9be91){return function(_0x5eb08a){if(_0x5eb08a){var _0x380121=typeof _0xa9be91['offset']==='undefined'&&typeof _0xa9be91[_0x49a8('0x1a')]==='undefined';var _0x47fd88=_0x5eb08a[_0x49a8('0x1b')];var _0x4a319e=_0x380121?0x0:_0xa9be91[_0x49a8('0x1c')];var _0xc6706e=_0x380121?_0x5eb08a[_0x49a8('0x1b')]:_0xa9be91[_0x49a8('0x1c')]+_0xa9be91[_0x49a8('0x1a')];var _0x5e07dd;if(_0xc6706e>=_0x47fd88){_0xc6706e=_0x47fd88;_0x5e07dd=0xc8;}else{_0x5e07dd=0xce;}_0x344e23[_0x49a8('0x17')](_0x5e07dd);return _0x344e23['set'](_0x49a8('0x1d'),_0x4a319e+'-'+_0xc6706e+'/'+_0x47fd88)[_0x49a8('0x19')](_0x5eb08a);}return null;};}function patchUpdates(_0x555220){return function(_0x42ede5){try{jsonpatch[_0x49a8('0x1e')](_0x42ede5,_0x555220,!![]);}catch(_0x558781){return BPromise[_0x49a8('0x1f')](_0x558781);}return _0x42ede5[_0x49a8('0x20')]();};}function saveUpdates(_0x203268,_0x1d3b1a){return function(_0x2290ed){if(_0x2290ed){return _0x2290ed[_0x49a8('0x21')](_0x203268)[_0x49a8('0x22')](function(_0x47bd2f){return _0x47bd2f;});}return null;};}function removeEntity(_0x4f3935,_0xfec1f7){return function(_0x41a61e){if(_0x41a61e){return _0x41a61e['destroy']()[_0x49a8('0x22')](function(){_0x4f3935[_0x49a8('0x17')](0xcc)[_0x49a8('0x18')]();});}};}function handleEntityNotFound(_0x5b8b37,_0x39edb8){return function(_0x5ac59c){if(!_0x5ac59c){_0x5b8b37['sendStatus'](0x194);}return _0x5ac59c;};}function handleError(_0x52c0d4,_0x1c81d1){_0x1c81d1=_0x1c81d1||0x1f4;return function(_0x4a788e){logger[_0x49a8('0x23')](_0x4a788e[_0x49a8('0x24')]);if(_0x4a788e[_0x49a8('0x25')]){delete _0x4a788e[_0x49a8('0x25')];}_0x52c0d4[_0x49a8('0x17')](_0x1c81d1)['send'](_0x4a788e);};}exports[_0x49a8('0x26')]=function(_0x314049,_0x4c7453){var _0x427bde={},_0x1e11e5={},_0x343346={'count':0x0,'rows':[]};var _0x181e4f=_['map'](db[_0x49a8('0x27')][_0x49a8('0x28')],function(_0x5714af){return{'name':_0x5714af[_0x49a8('0x29')],'type':_0x5714af['type'][_0x49a8('0x2a')]};});_0x1e11e5[_0x49a8('0x2b')]=_['map'](_0x181e4f,_0x49a8('0x25'));_0x1e11e5['query']=_[_0x49a8('0x2c')](_0x314049['query']);_0x1e11e5[_0x49a8('0x2d')]=_[_0x49a8('0x2e')](_0x1e11e5[_0x49a8('0x2b')],_0x1e11e5[_0x49a8('0x2f')]);_0x427bde[_0x49a8('0x30')]=_[_0x49a8('0x2e')](_0x1e11e5[_0x49a8('0x2b')],qs['fields'](_0x314049[_0x49a8('0x2f')]['fields']));_0x427bde[_0x49a8('0x30')]=_0x427bde['attributes'][_0x49a8('0x31')]?_0x427bde['attributes']:_0x1e11e5[_0x49a8('0x2b')];if(!_0x314049['query'][_0x49a8('0x32')](_0x49a8('0x33'))){_0x427bde['limit']=qs[_0x49a8('0x1a')](_0x314049[_0x49a8('0x2f')][_0x49a8('0x1a')]);_0x427bde[_0x49a8('0x1c')]=qs[_0x49a8('0x1c')](_0x314049[_0x49a8('0x2f')][_0x49a8('0x1c')]);}_0x427bde[_0x49a8('0x34')]=qs['sort'](_0x314049[_0x49a8('0x2f')][_0x49a8('0x35')]);_0x427bde[_0x49a8('0x36')]=qs[_0x49a8('0x2d')](_['pick'](_0x314049[_0x49a8('0x2f')],_0x1e11e5['filters']),_0x181e4f);if(_0x314049['query']['filter']){_0x427bde['where']=_[_0x49a8('0x37')](_0x427bde[_0x49a8('0x36')],{'$or':_[_0x49a8('0x38')](_0x181e4f,function(_0x1f672d){if(_0x1f672d['type']!=='VIRTUAL'){var _0x2fea0c={};_0x2fea0c[_0x1f672d[_0x49a8('0x25')]]={'$like':'%'+_0x314049['query'][_0x49a8('0x39')]+'%'};return _0x2fea0c;}})});}_0x427bde=_[_0x49a8('0x37')]({},_0x427bde,_0x314049[_0x49a8('0x3a')]);var _0x52e3e0={'where':_0x427bde[_0x49a8('0x36')]};return db[_0x49a8('0x27')][_0x49a8('0x1b')](_0x52e3e0)['then'](function(_0x57f3b4){_0x343346[_0x49a8('0x1b')]=_0x57f3b4;if(_0x314049[_0x49a8('0x2f')][_0x49a8('0x3b')]){_0x427bde[_0x49a8('0x3c')]=[{'all':!![]}];}return db[_0x49a8('0x27')][_0x49a8('0x3d')](_0x427bde);})[_0x49a8('0x22')](function(_0x3b2645){_0x343346[_0x49a8('0x3e')]=_0x3b2645;return _0x343346;})[_0x49a8('0x22')](respondWithFilteredResult(_0x4c7453,_0x427bde))[_0x49a8('0x3f')](handleError(_0x4c7453,null));};exports[_0x49a8('0x40')]=function(_0x128fac,_0x35bc37){var _0x1d3881={'raw':![],'where':{'id':_0x128fac[_0x49a8('0x41')]['id']}},_0x1e3da7={};_0x1e3da7[_0x49a8('0x2b')]=_[_0x49a8('0x2c')](db[_0x49a8('0x27')]['rawAttributes']);_0x1e3da7[_0x49a8('0x2f')]=_['keys'](_0x128fac[_0x49a8('0x2f')]);_0x1e3da7[_0x49a8('0x2d')]=_[_0x49a8('0x2e')](_0x1e3da7[_0x49a8('0x2b')],_0x1e3da7[_0x49a8('0x2f')]);_0x1d3881[_0x49a8('0x30')]=_[_0x49a8('0x2e')](_0x1e3da7[_0x49a8('0x2b')],qs[_0x49a8('0x42')](_0x128fac[_0x49a8('0x2f')][_0x49a8('0x42')]));_0x1d3881[_0x49a8('0x30')]=_0x1d3881[_0x49a8('0x30')][_0x49a8('0x31')]?_0x1d3881[_0x49a8('0x30')]:_0x1e3da7['model'];if(_0x128fac['query'][_0x49a8('0x3b')]){_0x1d3881['include']=[{'all':!![]}];}_0x1d3881=_[_0x49a8('0x37')]({},_0x1d3881,_0x128fac[_0x49a8('0x3a')]);return db['UserProfileSection'][_0x49a8('0x43')](_0x1d3881)[_0x49a8('0x22')](handleEntityNotFound(_0x35bc37,null))['then'](respondWithResult(_0x35bc37,null))[_0x49a8('0x3f')](handleError(_0x35bc37,null));};exports[_0x49a8('0x44')]=function(_0x3b0879,_0x1fbc5a){return db[_0x49a8('0x27')][_0x49a8('0x44')](_0x3b0879[_0x49a8('0x45')],{})[_0x49a8('0x22')](respondWithResult(_0x1fbc5a,0xc9))[_0x49a8('0x3f')](handleError(_0x1fbc5a,null));};exports[_0x49a8('0x21')]=function(_0xd2aa56,_0x5c852f){if(_0xd2aa56['body']['id']){delete _0xd2aa56['body']['id'];}return db[_0x49a8('0x27')][_0x49a8('0x43')]({'where':{'id':_0xd2aa56['params']['id']}})['then'](handleEntityNotFound(_0x5c852f,null))[_0x49a8('0x22')](saveUpdates(_0xd2aa56['body'],null))[_0x49a8('0x22')](respondWithResult(_0x5c852f,null))['catch'](handleError(_0x5c852f,null));};exports[_0x49a8('0x46')]=function(_0x51aa4f,_0x204861){return db[_0x49a8('0x27')][_0x49a8('0x43')]({'where':{'id':_0x51aa4f[_0x49a8('0x41')]['id']}})['then'](handleEntityNotFound(_0x204861,null))['then'](removeEntity(_0x204861,null))[_0x49a8('0x3f')](handleError(_0x204861,null));};exports[_0x49a8('0x47')]=function(_0x5445e3,_0x459274){return db[_0x49a8('0x27')][_0x49a8('0x47')]()[_0x49a8('0x22')](respondWithResult(_0x459274,null))[_0x49a8('0x3f')](handleError(_0x459274,null));}; \ No newline at end of file +var _0x6909=['VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','update','destroy','error','stack','name','send','index','UserProfileSection','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge'];(function(_0x18eb1a,_0x446792){var _0x279ad8=function(_0x29a25a){while(--_0x29a25a){_0x18eb1a['push'](_0x18eb1a['shift']());}};_0x279ad8(++_0x446792);}(_0x6909,0x156));var _0x9690=function(_0x1804de,_0x122de2){_0x1804de=_0x1804de-0x0;var _0x1acd64=_0x6909[_0x1804de];return _0x1acd64;};'use strict';var emlformat=require(_0x9690('0x0'));var rimraf=require(_0x9690('0x1'));var zipdir=require(_0x9690('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9690('0x3'));var moment=require(_0x9690('0x4'));var BPromise=require(_0x9690('0x5'));var Mustache=require('mustache');var util=require(_0x9690('0x6'));var path=require(_0x9690('0x7'));var sox=require(_0x9690('0x8'));var csv=require(_0x9690('0x9'));var ejs=require(_0x9690('0xa'));var fs=require('fs');var fs_extra=require(_0x9690('0xb'));var _=require(_0x9690('0xc'));var squel=require(_0x9690('0xd'));var crypto=require(_0x9690('0xe'));var jsforce=require(_0x9690('0xf'));var deskjs=require(_0x9690('0x10'));var toCsv=require(_0x9690('0x9'));var querystring=require(_0x9690('0x11'));var Papa=require(_0x9690('0x12'));var Redis=require(_0x9690('0x13'));var authService=require(_0x9690('0x14'));var qs=require(_0x9690('0x15'));var as=require(_0x9690('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9690('0x17'))(_0x9690('0x18'));var utils=require(_0x9690('0x19'));var config=require(_0x9690('0x1a'));var licenseUtil=require(_0x9690('0x1b'));var db=require(_0x9690('0x1c'))['db'];function respondWithStatusCode(_0x54cb01,_0x2c38d9){_0x2c38d9=_0x2c38d9||0xcc;return function(_0x2fcbdd){if(_0x2fcbdd){return _0x54cb01[_0x9690('0x1d')](_0x2c38d9);}return _0x54cb01['status'](_0x2c38d9)[_0x9690('0x1e')]();};}function respondWithResult(_0x1e31d0,_0x405a1e){_0x405a1e=_0x405a1e||0xc8;return function(_0x374810){if(_0x374810){return _0x1e31d0[_0x9690('0x1f')](_0x405a1e)['json'](_0x374810);}};}function respondWithFilteredResult(_0x53476f,_0x57d7e0){return function(_0x40aba6){if(_0x40aba6){var _0x2fa14c=typeof _0x57d7e0[_0x9690('0x20')]===_0x9690('0x21')&&typeof _0x57d7e0['limit']==='undefined';var _0xa190fa=_0x40aba6[_0x9690('0x22')];var _0x116a25=_0x2fa14c?0x0:_0x57d7e0[_0x9690('0x20')];var _0x12fe26=_0x2fa14c?_0x40aba6[_0x9690('0x22')]:_0x57d7e0[_0x9690('0x20')]+_0x57d7e0['limit'];var _0x606946;if(_0x12fe26>=_0xa190fa){_0x12fe26=_0xa190fa;_0x606946=0xc8;}else{_0x606946=0xce;}_0x53476f[_0x9690('0x1f')](_0x606946);return _0x53476f[_0x9690('0x23')](_0x9690('0x24'),_0x116a25+'-'+_0x12fe26+'/'+_0xa190fa)[_0x9690('0x25')](_0x40aba6);}return null;};}function patchUpdates(_0x6f772f){return function(_0x435977){try{jsonpatch[_0x9690('0x26')](_0x435977,_0x6f772f,!![]);}catch(_0x4291b7){return BPromise[_0x9690('0x27')](_0x4291b7);}return _0x435977['save']();};}function saveUpdates(_0x459268,_0x335b91){return function(_0x250fc7){if(_0x250fc7){return _0x250fc7[_0x9690('0x28')](_0x459268)['then'](function(_0x3325bc){return _0x3325bc;});}return null;};}function removeEntity(_0x4e7f85,_0x1e99c3){return function(_0x37baa1){if(_0x37baa1){return _0x37baa1[_0x9690('0x29')]()['then'](function(){_0x4e7f85[_0x9690('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aa61f,_0x42350c){return function(_0x3853be){if(!_0x3853be){_0x4aa61f['sendStatus'](0x194);}return _0x3853be;};}function handleError(_0x14ae8b,_0x297df2){_0x297df2=_0x297df2||0x1f4;return function(_0x335cf5){logger[_0x9690('0x2a')](_0x335cf5[_0x9690('0x2b')]);if(_0x335cf5[_0x9690('0x2c')]){delete _0x335cf5[_0x9690('0x2c')];}_0x14ae8b[_0x9690('0x1f')](_0x297df2)[_0x9690('0x2d')](_0x335cf5);};}exports[_0x9690('0x2e')]=function(_0x27c66d,_0x4b5ce0){var _0xb0f175={},_0x2334e5={},_0x16c4d6={'count':0x0,'rows':[]};var _0x3637cc=_['map'](db[_0x9690('0x2f')]['rawAttributes'],function(_0x9c1828){return{'name':_0x9c1828[_0x9690('0x30')],'type':_0x9c1828[_0x9690('0x31')][_0x9690('0x32')]};});_0x2334e5[_0x9690('0x33')]=_[_0x9690('0x34')](_0x3637cc,_0x9690('0x2c'));_0x2334e5[_0x9690('0x35')]=_[_0x9690('0x36')](_0x27c66d[_0x9690('0x35')]);_0x2334e5[_0x9690('0x37')]=_[_0x9690('0x38')](_0x2334e5[_0x9690('0x33')],_0x2334e5[_0x9690('0x35')]);_0xb0f175[_0x9690('0x39')]=_[_0x9690('0x38')](_0x2334e5['model'],qs[_0x9690('0x3a')](_0x27c66d[_0x9690('0x35')][_0x9690('0x3a')]));_0xb0f175[_0x9690('0x39')]=_0xb0f175[_0x9690('0x39')][_0x9690('0x3b')]?_0xb0f175[_0x9690('0x39')]:_0x2334e5['model'];if(!_0x27c66d[_0x9690('0x35')][_0x9690('0x3c')](_0x9690('0x3d'))){_0xb0f175[_0x9690('0x3e')]=qs[_0x9690('0x3e')](_0x27c66d['query'][_0x9690('0x3e')]);_0xb0f175[_0x9690('0x20')]=qs[_0x9690('0x20')](_0x27c66d['query'][_0x9690('0x20')]);}_0xb0f175[_0x9690('0x3f')]=qs['sort'](_0x27c66d['query'][_0x9690('0x40')]);_0xb0f175[_0x9690('0x41')]=qs['filters'](_['pick'](_0x27c66d[_0x9690('0x35')],_0x2334e5[_0x9690('0x37')]),_0x3637cc);if(_0x27c66d[_0x9690('0x35')][_0x9690('0x42')]){_0xb0f175[_0x9690('0x41')]=_[_0x9690('0x43')](_0xb0f175[_0x9690('0x41')],{'$or':_[_0x9690('0x34')](_0x3637cc,function(_0x37a05c){if(_0x37a05c['type']!==_0x9690('0x44')){var _0x21c902={};_0x21c902[_0x37a05c['name']]={'$like':'%'+_0x27c66d[_0x9690('0x35')]['filter']+'%'};return _0x21c902;}})});}_0xb0f175=_['merge']({},_0xb0f175,_0x27c66d[_0x9690('0x45')]);var _0x70572a={'where':_0xb0f175[_0x9690('0x41')]};return db[_0x9690('0x2f')][_0x9690('0x22')](_0x70572a)[_0x9690('0x46')](function(_0xebc180){_0x16c4d6[_0x9690('0x22')]=_0xebc180;if(_0x27c66d[_0x9690('0x35')][_0x9690('0x47')]){_0xb0f175[_0x9690('0x48')]=[{'all':!![]}];}return db[_0x9690('0x2f')][_0x9690('0x49')](_0xb0f175);})[_0x9690('0x46')](function(_0x6ad3c3){_0x16c4d6[_0x9690('0x4a')]=_0x6ad3c3;return _0x16c4d6;})[_0x9690('0x46')](respondWithFilteredResult(_0x4b5ce0,_0xb0f175))[_0x9690('0x4b')](handleError(_0x4b5ce0,null));};exports[_0x9690('0x4c')]=function(_0x543d65,_0xfe7a93){var _0x427ee7={'raw':![],'where':{'id':_0x543d65['params']['id']}},_0x424985={};_0x424985[_0x9690('0x33')]=_['keys'](db['UserProfileSection']['rawAttributes']);_0x424985[_0x9690('0x35')]=_[_0x9690('0x36')](_0x543d65['query']);_0x424985[_0x9690('0x37')]=_['intersection'](_0x424985[_0x9690('0x33')],_0x424985[_0x9690('0x35')]);_0x427ee7[_0x9690('0x39')]=_[_0x9690('0x38')](_0x424985[_0x9690('0x33')],qs[_0x9690('0x3a')](_0x543d65[_0x9690('0x35')][_0x9690('0x3a')]));_0x427ee7['attributes']=_0x427ee7[_0x9690('0x39')][_0x9690('0x3b')]?_0x427ee7[_0x9690('0x39')]:_0x424985['model'];if(_0x543d65[_0x9690('0x35')][_0x9690('0x47')]){_0x427ee7['include']=[{'all':!![]}];}_0x427ee7=_['merge']({},_0x427ee7,_0x543d65[_0x9690('0x45')]);return db[_0x9690('0x2f')][_0x9690('0x4d')](_0x427ee7)['then'](handleEntityNotFound(_0xfe7a93,null))['then'](respondWithResult(_0xfe7a93,null))[_0x9690('0x4b')](handleError(_0xfe7a93,null));};exports[_0x9690('0x4e')]=function(_0x2a8e26,_0x4c4842){return db[_0x9690('0x2f')]['create'](_0x2a8e26[_0x9690('0x4f')],{})['then'](respondWithResult(_0x4c4842,0xc9))[_0x9690('0x4b')](handleError(_0x4c4842,null));};exports[_0x9690('0x28')]=function(_0x281fa6,_0x30c707){if(_0x281fa6[_0x9690('0x4f')]['id']){delete _0x281fa6[_0x9690('0x4f')]['id'];}return db[_0x9690('0x2f')][_0x9690('0x4d')]({'where':{'id':_0x281fa6[_0x9690('0x50')]['id']}})[_0x9690('0x46')](handleEntityNotFound(_0x30c707,null))['then'](saveUpdates(_0x281fa6['body'],null))['then'](respondWithResult(_0x30c707,null))[_0x9690('0x4b')](handleError(_0x30c707,null));};exports[_0x9690('0x29')]=function(_0x21e9a3,_0x1c81ee){return db[_0x9690('0x2f')]['find']({'where':{'id':_0x21e9a3[_0x9690('0x50')]['id']}})[_0x9690('0x46')](handleEntityNotFound(_0x1c81ee,null))[_0x9690('0x46')](removeEntity(_0x1c81ee,null))[_0x9690('0x4b')](handleError(_0x1c81ee,null));};exports[_0x9690('0x51')]=function(_0x40a5a4,_0x3ee35c){return db['UserProfileSection'][_0x9690('0x51')]()[_0x9690('0x46')](respondWithResult(_0x3ee35c,null))['catch'](handleError(_0x3ee35c,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e4e9cb7..7d5ee62 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 _0xdfa5=['../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4d8696,_0x63bd38){var _0xbc6ead=function(_0x40206e){while(--_0x40206e){_0x4d8696['push'](_0x4d8696['shift']());}};_0xbc6ead(++_0x63bd38);}(_0xdfa5,0xa8));var _0x5dfa=function(_0x5db7f2,_0x3d4bc9){_0x5db7f2=_0x5db7f2-0x0;var _0x1bacf9=_0xdfa5[_0x5db7f2];return _0x1bacf9;};'use strict';var _=require(_0x5dfa('0x0'));var util=require('util');var logger=require(_0x5dfa('0x1'))(_0x5dfa('0x2'));var moment=require(_0x5dfa('0x3'));var BPromise=require(_0x5dfa('0x4'));var rp=require(_0x5dfa('0x5'));var fs=require('fs');var path=require(_0x5dfa('0x6'));var rimraf=require(_0x5dfa('0x7'));var config=require(_0x5dfa('0x8'));var attributes=require(_0x5dfa('0x9'));module[_0x5dfa('0xa')]=function(_0x4a66a5,_0x4e6323){return _0x4a66a5[_0x5dfa('0xb')](_0x5dfa('0xc'),attributes,{'tableName':_0x5dfa('0xd'),'paranoid':![],'indexes':[{'name':_0x5dfa('0xe'),'fields':[_0x5dfa('0xf'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2752=['UserProfileSection','sectionId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x40e617,_0x4674eb){var _0x4e39f2=function(_0x17575f){while(--_0x17575f){_0x40e617['push'](_0x40e617['shift']());}};_0x4e39f2(++_0x4674eb);}(_0x2752,0x12b));var _0x2275=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2752[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2275('0x0'));var util=require('util');var logger=require(_0x2275('0x1'))('api');var moment=require(_0x2275('0x2'));var BPromise=require(_0x2275('0x3'));var rp=require(_0x2275('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2275('0x5'));var config=require(_0x2275('0x6'));var attributes=require(_0x2275('0x7'));module[_0x2275('0x8')]=function(_0x19249d,_0x3bc1b9){return _0x19249d['define'](_0x2275('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x2275('0xa'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 765d045..2f9d5ea 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 _0x105b=['catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x105b,0x1b9));var _0xb105=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x105b[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0xb105('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb105('0x1'));var fs=require('fs');var Redis=require(_0xb105('0x2'));var db=require(_0xb105('0x3'))['db'];var utils=require(_0xb105('0x4'));var logger=require(_0xb105('0x5'))(_0xb105('0x6'));var config=require(_0xb105('0x7'));var jayson=require(_0xb105('0x8'));var client=jayson[_0xb105('0x9')][_0xb105('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a88e1,_0x3e00d5,_0x25b2e7){return new BPromise(function(_0x4fd09b,_0x565201){return client[_0xb105('0xb')](_0x3a88e1,_0x25b2e7)['then'](function(_0x4f4742){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x3e00d5,_0xb105('0xc'));logger['debug'](_0xb105('0xd'),_0x3e00d5,_0xb105('0xc'),JSON[_0xb105('0xe')](_0x4f4742));if(_0x4f4742[_0xb105('0xf')]){if(_0x4f4742[_0xb105('0xf')][_0xb105('0x10')]===0x1f4){logger[_0xb105('0xf')](_0xb105('0x11'),_0x3e00d5,_0x4f4742[_0xb105('0xf')][_0xb105('0x12')]);return _0x565201(_0x4f4742[_0xb105('0xf')]['message']);}logger[_0xb105('0xf')](_0xb105('0x11'),_0x3e00d5,_0x4f4742[_0xb105('0xf')][_0xb105('0x12')]);return _0x4fd09b(_0x4f4742['error']['message']);}else{logger['info'](_0xb105('0x11'),_0x3e00d5,_0xb105('0xc'));_0x4fd09b(_0x4f4742['result'][_0xb105('0x12')]);}})[_0xb105('0x13')](function(_0xc81eb3){logger[_0xb105('0xf')](_0xb105('0x11'),_0x3e00d5,_0xc81eb3);_0x565201(_0xc81eb3);});});} \ No newline at end of file +var _0x8758=['info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2c2df9,_0x3550b7){var _0x51e9b7=function(_0x2e3f8e){while(--_0x2e3f8e){_0x2c2df9['push'](_0x2c2df9['shift']());}};_0x51e9b7(++_0x3550b7);}(_0x8758,0x19b));var _0x8875=function(_0x172873,_0x296045){_0x172873=_0x172873-0x0;var _0x4bbd08=_0x8758[_0x172873];return _0x4bbd08;};'use strict';var _=require(_0x8875('0x0'));var util=require(_0x8875('0x1'));var moment=require(_0x8875('0x2'));var BPromise=require('bluebird');var rs=require(_0x8875('0x3'));var fs=require('fs');var Redis=require(_0x8875('0x4'));var db=require(_0x8875('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8875('0x6'))(_0x8875('0x7'));var config=require(_0x8875('0x8'));var jayson=require(_0x8875('0x9'));var client=jayson[_0x8875('0xa')][_0x8875('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34d29b,_0x452539,_0x362591){return new BPromise(function(_0x34090e,_0x73e4a9){return client[_0x8875('0xc')](_0x34d29b,_0x362591)[_0x8875('0xd')](function(_0x19b542){logger[_0x8875('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x452539,_0x8875('0xf'));logger[_0x8875('0x10')](_0x8875('0x11'),_0x452539,_0x8875('0xf'),JSON[_0x8875('0x12')](_0x19b542));if(_0x19b542[_0x8875('0x13')]){if(_0x19b542[_0x8875('0x13')][_0x8875('0x14')]===0x1f4){logger[_0x8875('0x13')](_0x8875('0x15'),_0x452539,_0x19b542['error'][_0x8875('0x16')]);return _0x73e4a9(_0x19b542[_0x8875('0x13')][_0x8875('0x16')]);}logger[_0x8875('0x13')](_0x8875('0x15'),_0x452539,_0x19b542[_0x8875('0x13')][_0x8875('0x16')]);return _0x34090e(_0x19b542[_0x8875('0x13')][_0x8875('0x16')]);}else{logger[_0x8875('0xe')](_0x8875('0x15'),_0x452539,_0x8875('0xf'));_0x34090e(_0x19b542[_0x8875('0x17')]['message']);}})[_0x8875('0x18')](function(_0xd0e1e3){logger[_0x8875('0x13')](_0x8875('0x15'),_0x452539,_0xd0e1e3);_0x73e4a9(_0xd0e1e3);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index f558bd5..7ba2383 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3e9aca,_0x2ce960){var _0x182544=function(_0x4aaa99){while(--_0x4aaa99){_0x3e9aca['push'](_0x3e9aca['shift']());}};_0x182544(++_0x2ce960);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5fb672,_0xe0e1d1){var _0x1f89eb=function(_0x327794){while(--_0x327794){_0x5fb672['push'](_0x5fb672['shift']());}};_0x1f89eb(++_0xe0e1d1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index b515efe..e3bd04b 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 _0xd9ca=['exports','INTEGER','sequelize'];(function(_0x639430,_0x3c1d15){var _0x282adb=function(_0x115d59){while(--_0x115d59){_0x639430['push'](_0x639430['shift']());}};_0x282adb(++_0x3c1d15);}(_0xd9ca,0x1a0));var _0xad9c=function(_0x573273,_0x3c62a3){_0x573273=_0x573273-0x0;var _0x508ca4=_0xd9ca[_0x573273];return _0x508ca4;};'use strict';var Sequelize=require(_0xad9c('0x0'));module[_0xad9c('0x1')]={'penalty':{'type':Sequelize[_0xad9c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4453=['sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4453,0x9c));var _0x3445=function(_0x45d50b,_0x25cfa9){_0x45d50b=_0x45d50b-0x0;var _0xba96f3=_0x4453[_0x45d50b];return _0xba96f3;};'use strict';var Sequelize=require(_0x3445('0x0'));module[_0x3445('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 6999084..b340fc0 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 _0xcde7=['define','user_has_sms_queues','../../config/logger','api','moment','path','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x294b80,_0x5089ed){var _0x252e8b=function(_0x52330f){while(--_0x52330f){_0x294b80['push'](_0x294b80['shift']());}};_0x252e8b(++_0x5089ed);}(_0xcde7,0x65));var _0x7cde=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcde7[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7cde('0x0'))(_0x7cde('0x1'));var moment=require(_0x7cde('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cde('0x3'));var rimraf=require('rimraf');var config=require(_0x7cde('0x4'));var attributes=require(_0x7cde('0x5'));module[_0x7cde('0x6')]=function(_0x293f70,_0xbaa4b3){return _0x293f70[_0x7cde('0x7')]('UserSmsQueue',attributes,{'tableName':_0x7cde('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd2e=['./userSmsQueue.attributes','user_has_sms_queues','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x56ada5,_0x19d0e5){var _0x4c21b6=function(_0x41e47a){while(--_0x41e47a){_0x56ada5['push'](_0x56ada5['shift']());}};_0x4c21b6(++_0x19d0e5);}(_0xfd2e,0x6e));var _0xefd2=function(_0x476e6c,_0x34e46b){_0x476e6c=_0x476e6c-0x0;var _0x23e983=_0xfd2e[_0x476e6c];return _0x23e983;};'use strict';var _=require(_0xefd2('0x0'));var util=require('util');var logger=require(_0xefd2('0x1'))('api');var moment=require(_0xefd2('0x2'));var BPromise=require('bluebird');var rp=require(_0xefd2('0x3'));var fs=require('fs');var path=require(_0xefd2('0x4'));var rimraf=require(_0xefd2('0x5'));var config=require(_0xefd2('0x6'));var attributes=require(_0xefd2('0x7'));module['exports']=function(_0x5124c6,_0x40e76c){return _0x5124c6['define']('UserSmsQueue',attributes,{'tableName':_0xefd2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 03b314b..6e7cb30 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 _0x5d5f=['stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x23dcd1,_0x2346e8){var _0x2f8827=function(_0x39cb79){while(--_0x39cb79){_0x23dcd1['push'](_0x23dcd1['shift']());}};_0x2f8827(++_0x2346e8);}(_0x5d5f,0x90));var _0xf5d5=function(_0x4d4d7a,_0x4153b0){_0x4d4d7a=_0x4d4d7a-0x0;var _0x5b8e10=_0x5d5f[_0x4d4d7a];return _0x5b8e10;};'use strict';var _=require(_0xf5d5('0x0'));var util=require(_0xf5d5('0x1'));var moment=require(_0xf5d5('0x2'));var BPromise=require(_0xf5d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5d5('0x4'));var db=require(_0xf5d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf5d5('0x6'));var config=require('../../config/environment');var jayson=require(_0xf5d5('0x7'));var client=jayson[_0xf5d5('0x8')][_0xf5d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20efa8,_0x1e7026,_0x4420ea){return new BPromise(function(_0x45cceb,_0x4bd4d3){return client[_0xf5d5('0xa')](_0x20efa8,_0x4420ea)[_0xf5d5('0xb')](function(_0x4b83d8){logger[_0xf5d5('0xc')](_0xf5d5('0xd'),_0x1e7026,_0xf5d5('0xe'));logger['debug'](_0xf5d5('0xf'),_0x1e7026,'request\x20sent',JSON[_0xf5d5('0x10')](_0x4b83d8));if(_0x4b83d8[_0xf5d5('0x11')]){if(_0x4b83d8[_0xf5d5('0x11')]['code']===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1e7026,_0x4b83d8['error'][_0xf5d5('0x12')]);return _0x4bd4d3(_0x4b83d8[_0xf5d5('0x11')][_0xf5d5('0x12')]);}logger[_0xf5d5('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x1e7026,_0x4b83d8[_0xf5d5('0x11')][_0xf5d5('0x12')]);return _0x45cceb(_0x4b83d8['error'][_0xf5d5('0x12')]);}else{logger['info'](_0xf5d5('0xd'),_0x1e7026,_0xf5d5('0xe'));_0x45cceb(_0x4b83d8['result']['message']);}})[_0xf5d5('0x13')](function(_0x745b20){logger[_0xf5d5('0x11')](_0xf5d5('0xd'),_0x1e7026,_0x745b20);_0x4bd4d3(_0x745b20);});});} \ No newline at end of file +var _0xb724=['then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb724,0x111));var _0x4b72=function(_0x3e19d0,_0x3937d8){_0x3e19d0=_0x3e19d0-0x0;var _0x12e84d=_0xb724[_0x3e19d0];return _0x12e84d;};'use strict';var _=require(_0x4b72('0x0'));var util=require('util');var moment=require(_0x4b72('0x1'));var BPromise=require(_0x4b72('0x2'));var rs=require(_0x4b72('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b72('0x4'))['db'];var utils=require(_0x4b72('0x5'));var logger=require(_0x4b72('0x6'))(_0x4b72('0x7'));var config=require(_0x4b72('0x8'));var jayson=require(_0x4b72('0x9'));var client=jayson[_0x4b72('0xa')][_0x4b72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc1031c,_0x336edf,_0x56d9fc){return new BPromise(function(_0x1d5fce,_0x5e178d){return client[_0x4b72('0xc')](_0xc1031c,_0x56d9fc)[_0x4b72('0xd')](function(_0x878e58){logger[_0x4b72('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x336edf,_0x4b72('0xf'));logger['debug'](_0x4b72('0x10'),_0x336edf,_0x4b72('0xf'),JSON[_0x4b72('0x11')](_0x878e58));if(_0x878e58[_0x4b72('0x12')]){if(_0x878e58[_0x4b72('0x12')]['code']===0x1f4){logger[_0x4b72('0x12')](_0x4b72('0x13'),_0x336edf,_0x878e58[_0x4b72('0x12')]['message']);return _0x5e178d(_0x878e58[_0x4b72('0x12')]['message']);}logger['error'](_0x4b72('0x13'),_0x336edf,_0x878e58['error'][_0x4b72('0x14')]);return _0x1d5fce(_0x878e58[_0x4b72('0x12')]['message']);}else{logger[_0x4b72('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x336edf,_0x4b72('0xf'));_0x1d5fce(_0x878e58['result'][_0x4b72('0x14')]);}})[_0x4b72('0x15')](function(_0x55a669){logger['error'](_0x4b72('0x13'),_0x336edf,_0x55a669);_0x5e178d(_0x55a669);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 45f3226..429c92f 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 _0xa3f7=['exports'];(function(_0x1aac60,_0x2e5ce5){var _0x186adf=function(_0x1da24b){while(--_0x1da24b){_0x1aac60['push'](_0x1aac60['shift']());}};_0x186adf(++_0x2e5ce5);}(_0xa3f7,0x1d4));var _0x7a3f=function(_0x3b980d,_0x3c8db0){_0x3b980d=_0x3b980d-0x0;var _0x17184e=_0xa3f7[_0x3b980d];return _0x17184e;};'use strict';var Sequelize=require('sequelize');module[_0x7a3f('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x73f8=['exports','INTEGER','sequelize'];(function(_0x28cbc0,_0x203516){var _0x4b3cf5=function(_0x2a15c6){while(--_0x2a15c6){_0x28cbc0['push'](_0x28cbc0['shift']());}};_0x4b3cf5(++_0x203516);}(_0x73f8,0x179));var _0x873f=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x73f8[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0x873f('0x0'));module[_0x873f('0x1')]={'UserId':{'type':Sequelize[_0x873f('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x873f('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 0f37eb6..a1d4513 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(_0x379530,_0x5a68df){var _0x39bdf9=function(_0x1b8ba0){while(--_0x1b8ba0){_0x379530['push'](_0x379530['shift']());}};_0x39bdf9(++_0x5a68df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x4776d0,_0x1f47f5){var _0x51bccd=function(_0x48866b){while(--_0x48866b){_0x4776d0['push'](_0x4776d0['shift']());}};_0x51bccd(++_0x1f47f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_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 0dbb305..1fd1170 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x446cb9,_0x556636){var _0x44c6e5=function(_0x41b230){while(--_0x41b230){_0x446cb9['push'](_0x446cb9['shift']());}};_0x44c6e5(++_0x556636);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0xcb91[_0x136a0d];return _0x212ea5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5df77c,_0x3404c1){var _0x490a13=function(_0x476250){while(--_0x476250){_0x5df77c['push'](_0x5df77c['shift']());}};_0x490a13(++_0x3404c1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 40d1688..5d9cff8 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 _0xcf81=['INTEGER','sequelize','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xcf81,0x199));var _0x1cf8=function(_0x19d45c,_0x2313b8){_0x19d45c=_0x19d45c-0x0;var _0x4a3590=_0xcf81[_0x19d45c];return _0x4a3590;};'use strict';var Sequelize=require(_0x1cf8('0x0'));module[_0x1cf8('0x1')]={'penalty':{'type':Sequelize[_0x1cf8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7c24=['sequelize','exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c24,0xf9));var _0x47c2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x7c24[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x47c2('0x0'));module[_0x47c2('0x1')]={'penalty':{'type':Sequelize[_0x47c2('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 27df24c..a3c09fb 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 _0x570a=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0xcf84f2,_0x18cacb){var _0x52f2d4=function(_0x38519a){while(--_0x38519a){_0xcf84f2['push'](_0xcf84f2['shift']());}};_0x52f2d4(++_0x18cacb);}(_0x570a,0xee));var _0xa570=function(_0x4daaf1,_0x248196){_0x4daaf1=_0x4daaf1-0x0;var _0x3a9914=_0x570a[_0x4daaf1];return _0x3a9914;};'use strict';var _=require(_0xa570('0x0'));var util=require(_0xa570('0x1'));var logger=require(_0xa570('0x2'))(_0xa570('0x3'));var moment=require('moment');var BPromise=require(_0xa570('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa570('0x5'));var rimraf=require(_0xa570('0x6'));var config=require(_0xa570('0x7'));var attributes=require(_0xa570('0x8'));module['exports']=function(_0x3c62da,_0x516e9a){return _0x3c62da[_0xa570('0x9')](_0xa570('0xa'),attributes,{'tableName':_0xa570('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x896b=['util','api','moment','bluebird','request-promise','../../config/environment','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x5416df,_0x3d9b53){var _0x318215=function(_0x295448){while(--_0x295448){_0x5416df['push'](_0x5416df['shift']());}};_0x318215(++_0x3d9b53);}(_0x896b,0x10d));var _0xb896=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x896b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb896('0x0'));var util=require(_0xb896('0x1'));var logger=require('../../config/logger')(_0xb896('0x2'));var moment=require(_0xb896('0x3'));var BPromise=require(_0xb896('0x4'));var rp=require(_0xb896('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb896('0x6'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x33057b,_0x530cee){return _0x33057b[_0xb896('0x7')](_0xb896('0x8'),attributes,{'tableName':_0xb896('0x9'),'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 e7eee5b..f33d84e 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 _0x92d6=['message','result','catch','lodash','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92d6,0x6f));var _0x692d=function(_0x7a19d9,_0x2f4122){_0x7a19d9=_0x7a19d9-0x0;var _0x29bf47=_0x92d6[_0x7a19d9];return _0x29bf47;};'use strict';var _=require(_0x692d('0x0'));var util=require('util');var moment=require(_0x692d('0x1'));var BPromise=require(_0x692d('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(_0x692d('0x3'))('rpc');var config=require(_0x692d('0x4'));var jayson=require(_0x692d('0x5'));var client=jayson[_0x692d('0x6')][_0x692d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf90086,_0x127eda,_0x5ad386){return new BPromise(function(_0x114d7d,_0x581374){return client[_0x692d('0x8')](_0xf90086,_0x5ad386)['then'](function(_0x151002){logger[_0x692d('0x9')](_0x692d('0xa'),_0x127eda,_0x692d('0xb'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x127eda,_0x692d('0xb'),JSON[_0x692d('0xc')](_0x151002));if(_0x151002[_0x692d('0xd')]){if(_0x151002[_0x692d('0xd')][_0x692d('0xe')]===0x1f4){logger[_0x692d('0xd')](_0x692d('0xa'),_0x127eda,_0x151002[_0x692d('0xd')][_0x692d('0xf')]);return _0x581374(_0x151002['error'][_0x692d('0xf')]);}logger['error'](_0x692d('0xa'),_0x127eda,_0x151002['error'][_0x692d('0xf')]);return _0x114d7d(_0x151002['error'][_0x692d('0xf')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x127eda,_0x692d('0xb'));_0x114d7d(_0x151002[_0x692d('0x10')][_0x692d('0xf')]);}})[_0x692d('0x11')](function(_0x2e727a){logger[_0x692d('0xd')](_0x692d('0xa'),_0x127eda,_0x2e727a);_0x581374(_0x2e727a);});});} \ No newline at end of file +var _0x2bc5=['result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0xa15305,_0x48d409){var _0x31534c=function(_0x34ad83){while(--_0x34ad83){_0xa15305['push'](_0xa15305['shift']());}};_0x31534c(++_0x48d409);}(_0x2bc5,0x1e4));var _0x52bc=function(_0x467cb1,_0x1fca21){_0x467cb1=_0x467cb1-0x0;var _0x584cd1=_0x2bc5[_0x467cb1];return _0x584cd1;};'use strict';var _=require(_0x52bc('0x0'));var util=require('util');var moment=require(_0x52bc('0x1'));var BPromise=require('bluebird');var rs=require(_0x52bc('0x2'));var fs=require('fs');var Redis=require(_0x52bc('0x3'));var db=require(_0x52bc('0x4'))['db'];var utils=require(_0x52bc('0x5'));var logger=require(_0x52bc('0x6'))(_0x52bc('0x7'));var config=require(_0x52bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x52bc('0x9')][_0x52bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ab36,_0x1d9194,_0xc6cfce){return new BPromise(function(_0x46e4d3,_0x271bf0){return client[_0x52bc('0xb')](_0x56ab36,_0xc6cfce)[_0x52bc('0xc')](function(_0x1b58bc){logger[_0x52bc('0xd')](_0x52bc('0xe'),_0x1d9194,'request\x20sent');logger[_0x52bc('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1d9194,_0x52bc('0x10'),JSON[_0x52bc('0x11')](_0x1b58bc));if(_0x1b58bc[_0x52bc('0x12')]){if(_0x1b58bc[_0x52bc('0x12')]['code']===0x1f4){logger['error'](_0x52bc('0xe'),_0x1d9194,_0x1b58bc[_0x52bc('0x12')][_0x52bc('0x13')]);return _0x271bf0(_0x1b58bc[_0x52bc('0x12')][_0x52bc('0x13')]);}logger['error'](_0x52bc('0xe'),_0x1d9194,_0x1b58bc['error'][_0x52bc('0x13')]);return _0x46e4d3(_0x1b58bc[_0x52bc('0x12')][_0x52bc('0x13')]);}else{logger['info'](_0x52bc('0xe'),_0x1d9194,_0x52bc('0x10'));_0x46e4d3(_0x1b58bc[_0x52bc('0x14')][_0x52bc('0x13')]);}})['catch'](function(_0x39fe92){logger[_0x52bc('0x12')](_0x52bc('0xe'),_0x1d9194,_0x39fe92);_0x271bf0(_0x39fe92);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 08ec788..d96baa8 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x56de20,_0x583c70){var _0x167a4f=function(_0x5c7060){while(--_0x5c7060){_0x56de20['push'](_0x56de20['shift']());}};_0x167a4f(++_0x583c70);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xcb91[_0x1928c9];return _0x51b5fb;};'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(_0x167e5d,_0x5bf30f){var _0x46d285=function(_0x3b7221){while(--_0x3b7221){_0x167e5d['push'](_0x167e5d['shift']());}};_0x46d285(++_0x5bf30f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xcb91[_0x4843f9];return _0x193c6a;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d2091ca..e4dc735 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 _0xe081=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x5016c9,_0x57cdf0){var _0x5371ee=function(_0x494af9){while(--_0x494af9){_0x5016c9['push'](_0x5016c9['shift']());}};_0x5371ee(++_0x57cdf0);}(_0xe081,0x1bd));var _0x1e08=function(_0x2f9328,_0x5ad09e){_0x2f9328=_0x2f9328-0x0;var _0x2e66bd=_0xe081[_0x2f9328];return _0x2e66bd;};'use strict';var Sequelize=require('sequelize');module[_0x1e08('0x0')]={'uniqueid':{'type':Sequelize[_0x1e08('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1e08('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x1e08('0x2')},'UserId':{'type':Sequelize[_0x1e08('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1e08('0x3')],'allowNull':![],'unique':_0x1e08('0x4'),'comment':_0x1e08('0x2')},'VoiceQueueId':{'type':Sequelize[_0x1e08('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x1e08('0x3')],'allowNull':![],'unique':_0x1e08('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x1e08('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x1e08('0x1')](0xb),'defaultValue':0x0,'comment':_0x1e08('0x2')}}; \ No newline at end of file +var _0x4012=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x2834a4,_0x3976eb){var _0x5d6ec5=function(_0x2ec0a7){while(--_0x2ec0a7){_0x2834a4['push'](_0x2834a4['shift']());}};_0x5d6ec5(++_0x3976eb);}(_0x4012,0x16a));var _0x2401=function(_0x3349f6,_0x4df635){_0x3349f6=_0x3349f6-0x0;var _0xc62265=_0x4012[_0x3349f6];return _0xc62265;};'use strict';var Sequelize=require(_0x2401('0x0'));module[_0x2401('0x1')]={'uniqueid':{'type':Sequelize[_0x2401('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2401('0x3')},'membername':{'type':Sequelize[_0x2401('0x4')],'allowNull':![],'comment':_0x2401('0x3')},'UserId':{'type':Sequelize[_0x2401('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2401('0x5'),'comment':_0x2401('0x3')},'VoiceQueueId':{'type':Sequelize[_0x2401('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x2401('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x2401('0x3')},'penalty':{'type':Sequelize[_0x2401('0x2')](0xb),'defaultValue':0x0,'comment':_0x2401('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x2401('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 080b0e8..205ba78 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 _0xc9aa=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x302f73,_0x3c74eb){var _0x24817c=function(_0x118440){while(--_0x118440){_0x302f73['push'](_0x302f73['shift']());}};_0x24817c(++_0x3c74eb);}(_0xc9aa,0xe2));var _0xac9a=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0xc9aa[_0x53a7a8];return _0x555f71;};'use strict';var EventEmitter=require(_0xac9a('0x0'));var UserVoiceQueueRt=require(_0xac9a('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac9a('0x2'),'afterUpdate':_0xac9a('0x3'),'afterDestroy':_0xac9a('0x4')};function emitEvent(_0x4bf024){return function(_0x40eeb3,_0x1981a4,_0x2fef7a){UserVoiceQueueRtEvents[_0xac9a('0x5')](_0x4bf024+':'+_0x40eeb3['id'],_0x40eeb3);UserVoiceQueueRtEvents[_0xac9a('0x5')](_0x4bf024,_0x40eeb3);_0x2fef7a(null);};}for(var e in events){if(events[_0xac9a('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xac9a('0x7')](e,emitEvent(event));}}module[_0xac9a('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0b38=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0b38,0xe2));var _0x80b3=function(_0x2c3a24,_0x5c4914){_0x2c3a24=_0x2c3a24-0x0;var _0x13056a=_0x0b38[_0x2c3a24];return _0x13056a;};'use strict';var EventEmitter=require(_0x80b3('0x0'));var UserVoiceQueueRt=require(_0x80b3('0x1'))['db'][_0x80b3('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x80b3('0x3')](0x0);var events={'afterCreate':_0x80b3('0x4'),'afterUpdate':_0x80b3('0x5'),'afterDestroy':_0x80b3('0x6')};function emitEvent(_0xa53752){return function(_0x1f881d,_0x388e30,_0x43eb95){UserVoiceQueueRtEvents[_0x80b3('0x7')](_0xa53752+':'+_0x1f881d['id'],_0x1f881d);UserVoiceQueueRtEvents['emit'](_0xa53752,_0x1f881d);_0x43eb95(null);};}for(var e in events){if(events[_0x80b3('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x80b3('0x9')](e,emitEvent(event));}}module[_0x80b3('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 618bc10..0760949 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 _0xb8ff=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x44b48d,_0x4e68e0){var _0x13efc0=function(_0x3da85a){while(--_0x3da85a){_0x44b48d['push'](_0x44b48d['shift']());}};_0x13efc0(++_0x4e68e0);}(_0xb8ff,0x68));var _0xfb8f=function(_0xf3e0c0,_0x1d8356){_0xf3e0c0=_0xf3e0c0-0x0;var _0x4aac36=_0xb8ff[_0xf3e0c0];return _0x4aac36;};'use strict';var _=require(_0xfb8f('0x0'));var util=require('util');var logger=require(_0xfb8f('0x1'))('api');var moment=require(_0xfb8f('0x2'));var BPromise=require(_0xfb8f('0x3'));var rp=require(_0xfb8f('0x4'));var fs=require('fs');var path=require(_0xfb8f('0x5'));var rimraf=require(_0xfb8f('0x6'));var config=require(_0xfb8f('0x7'));var attributes=require(_0xfb8f('0x8'));module[_0xfb8f('0x9')]=function(_0x1ef9f3,_0x5838b7){return _0x1ef9f3[_0xfb8f('0xa')](_0xfb8f('0xb'),attributes,{'tableName':_0xfb8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81eb=['../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3aa6ab,_0x3b5f7c){var _0x5789d7=function(_0xe143d6){while(--_0xe143d6){_0x3aa6ab['push'](_0x3aa6ab['shift']());}};_0x5789d7(++_0x3b5f7c);}(_0x81eb,0x191));var _0xb81e=function(_0x5ccde3,_0x55d51c){_0x5ccde3=_0x5ccde3-0x0;var _0xec08c4=_0x81eb[_0x5ccde3];return _0xec08c4;};'use strict';var _=require('lodash');var util=require(_0xb81e('0x0'));var logger=require(_0xb81e('0x1'))(_0xb81e('0x2'));var moment=require('moment');var BPromise=require(_0xb81e('0x3'));var rp=require(_0xb81e('0x4'));var fs=require('fs');var path=require(_0xb81e('0x5'));var rimraf=require(_0xb81e('0x6'));var config=require(_0xb81e('0x7'));var attributes=require(_0xb81e('0x8'));module['exports']=function(_0x571b15,_0x4ada8f){return _0x571b15[_0xb81e('0x9')](_0xb81e('0xa'),attributes,{'tableName':_0xb81e('0xb'),'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 77e8cba..b44113e 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 _0x7cbb=['message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x330eac,_0x5683d1){var _0x2968a2=function(_0x7cc995){while(--_0x7cc995){_0x330eac['push'](_0x330eac['shift']());}};_0x2968a2(++_0x5683d1);}(_0x7cbb,0x80));var _0xb7cb=function(_0x3332c6,_0x42e290){_0x3332c6=_0x3332c6-0x0;var _0x2220d9=_0x7cbb[_0x3332c6];return _0x2220d9;};'use strict';var _=require(_0xb7cb('0x0'));var util=require(_0xb7cb('0x1'));var moment=require(_0xb7cb('0x2'));var BPromise=require('bluebird');var rs=require(_0xb7cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7cb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb7cb('0x5'));var config=require(_0xb7cb('0x6'));var jayson=require(_0xb7cb('0x7'));var client=jayson[_0xb7cb('0x8')][_0xb7cb('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb7cb('0xa'),'port':0x18eb});var socket=require(_0xb7cb('0xb'))(new Redis(config[_0xb7cb('0xc')]));require(_0xb7cb('0xd'))[_0xb7cb('0xe')](socket);function respondWithRpcPromise(_0x359306,_0x70f748,_0x7e16aa){return new BPromise(function(_0xda1158,_0x1e782b){return client[_0xb7cb('0xf')](_0x359306,_0x7e16aa)[_0xb7cb('0x10')](function(_0x234966){logger[_0xb7cb('0x11')](_0xb7cb('0x12'),_0x70f748,'request\x20sent');logger[_0xb7cb('0x13')](_0xb7cb('0x14'),_0x70f748,_0xb7cb('0x15'),JSON['stringify'](_0x234966));if(_0x234966[_0xb7cb('0x16')]){if(_0x234966[_0xb7cb('0x16')][_0xb7cb('0x17')]===0x1f4){logger[_0xb7cb('0x16')](_0xb7cb('0x12'),_0x70f748,_0x234966[_0xb7cb('0x16')]['message']);return _0x1e782b(_0x234966[_0xb7cb('0x16')]['message']);}logger[_0xb7cb('0x16')](_0xb7cb('0x12'),_0x70f748,_0x234966[_0xb7cb('0x16')][_0xb7cb('0x18')]);return _0xda1158(_0x234966[_0xb7cb('0x16')][_0xb7cb('0x18')]);}else{logger[_0xb7cb('0x11')](_0xb7cb('0x12'),_0x70f748,'request\x20sent');_0xda1158(_0x234966[_0xb7cb('0x19')][_0xb7cb('0x18')]);}})[_0xb7cb('0x1a')](function(_0xd6372d){logger[_0xb7cb('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x70f748,_0xd6372d);_0x1e782b(_0xd6372d);});});}exports[_0xb7cb('0x1b')]=function(_0x4e313c){var _0x6e72e0=this;return new Promise(function(_0x3b72ef,_0x2e0ff0){return db[_0xb7cb('0x1c')][_0xb7cb('0x1d')]({'raw':_0x4e313c[_0xb7cb('0x1e')]?_0x4e313c[_0xb7cb('0x1e')][_0xb7cb('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e313c[_0xb7cb('0x1e')]?_0x4e313c[_0xb7cb('0x1e')][_0xb7cb('0x20')]||null:null,'attributes':[[db[_0xb7cb('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb7cb('0x21')][_0xb7cb('0x22')](_0xb7cb('0x23')))),_0xb7cb('0x24')]]})['then'](function(_0x3cf3b8){logger[_0xb7cb('0x11')](_0xb7cb('0x1b'),_0x4e313c);logger[_0xb7cb('0x13')]('GetVoiceQueueRtPauses',_0x4e313c,JSON[_0xb7cb('0x25')](_0x3cf3b8));_0x3b72ef(_0x3cf3b8);})[_0xb7cb('0x1a')](function(_0x514d49){logger['error'](_0xb7cb('0x1b'),_0x514d49[_0xb7cb('0x18')],_0x4e313c);_0x2e0ff0(_0x6e72e0[_0xb7cb('0x16')](0x1f4,_0x514d49[_0xb7cb('0x18')]));});});}; \ No newline at end of file +var _0x0d62=['client','http','redis','localhost','./userVoiceQueueRt.socket','register','request','info','request\x20sent','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','findAll','options','raw','where','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0d62,0x15e));var _0x20d6=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0x0d62[_0x5465e6];return _0x10044e;};'use strict';var _=require(_0x20d6('0x0'));var util=require(_0x20d6('0x1'));var moment=require(_0x20d6('0x2'));var BPromise=require(_0x20d6('0x3'));var rs=require(_0x20d6('0x4'));var fs=require('fs');var Redis=require(_0x20d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x20d6('0x6'));var logger=require(_0x20d6('0x7'))('rpc');var config=require(_0x20d6('0x8'));var jayson=require(_0x20d6('0x9'));var client=jayson[_0x20d6('0xa')][_0x20d6('0xb')]({'port':0x232a});config[_0x20d6('0xc')]=_['defaults'](config['redis'],{'host':_0x20d6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20d6('0xc')]));require(_0x20d6('0xe'))[_0x20d6('0xf')](socket);function respondWithRpcPromise(_0x3d2d0f,_0x2d2b51,_0x26b076){return new BPromise(function(_0x49cf73,_0x59fb89){return client[_0x20d6('0x10')](_0x3d2d0f,_0x26b076)['then'](function(_0x4b1810){logger[_0x20d6('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d2b51,_0x20d6('0x12'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2d2b51,_0x20d6('0x12'),JSON[_0x20d6('0x13')](_0x4b1810));if(_0x4b1810[_0x20d6('0x14')]){if(_0x4b1810[_0x20d6('0x14')][_0x20d6('0x15')]===0x1f4){logger[_0x20d6('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d2b51,_0x4b1810['error'][_0x20d6('0x16')]);return _0x59fb89(_0x4b1810[_0x20d6('0x14')][_0x20d6('0x16')]);}logger['error'](_0x20d6('0x17'),_0x2d2b51,_0x4b1810['error']['message']);return _0x49cf73(_0x4b1810['error'][_0x20d6('0x16')]);}else{logger[_0x20d6('0x11')](_0x20d6('0x17'),_0x2d2b51,_0x20d6('0x12'));_0x49cf73(_0x4b1810[_0x20d6('0x18')]['message']);}})[_0x20d6('0x19')](function(_0x5ffb7d){logger[_0x20d6('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d2b51,_0x5ffb7d);_0x59fb89(_0x5ffb7d);});});}exports['GetVoiceQueueRtPauses']=function(_0x1417cf){var _0x2accc1=this;return new Promise(function(_0x1af3b7,_0x3ce960){return db['UserVoiceQueueRt'][_0x20d6('0x1a')]({'raw':_0x1417cf['options']?_0x1417cf[_0x20d6('0x1b')][_0x20d6('0x1c')]===undefined?!![]:![]:!![],'where':_0x1417cf[_0x20d6('0x1b')]?_0x1417cf[_0x20d6('0x1b')][_0x20d6('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x20d6('0x1e'),db[_0x20d6('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x20d6('0x20')))),_0x20d6('0x21')]]})[_0x20d6('0x22')](function(_0x21b420){logger[_0x20d6('0x11')]('GetVoiceQueueRtPauses',_0x1417cf);logger['debug'](_0x20d6('0x23'),_0x1417cf,JSON['stringify'](_0x21b420));_0x1af3b7(_0x21b420);})[_0x20d6('0x19')](function(_0x132e0d){logger[_0x20d6('0x14')](_0x20d6('0x23'),_0x132e0d[_0x20d6('0x16')],_0x1417cf);_0x3ce960(_0x2accc1['error'](0x1f4,_0x132e0d['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 9302618..db5d9c8 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 _0x3c94=['remove','update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x224e13,_0x520dad){var _0x5e3123=function(_0x178c68){while(--_0x178c68){_0x224e13['push'](_0x224e13['shift']());}};_0x5e3123(++_0x520dad);}(_0x3c94,0xcd));var _0x43c9=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x3c94[_0x4f431d];return _0x4f31e1;};'use strict';var UserVoiceQueueRtEvents=require(_0x43c9('0x0'));var events=[_0x43c9('0x1'),_0x43c9('0x2'),_0x43c9('0x3')];function createListener(_0x188507,_0x2da73f){return function(_0xe05adb){_0x2da73f[_0x43c9('0x4')](_0x188507,_0xe05adb);};}function removeListener(_0x170a0d,_0x44fc3){return function(){UserVoiceQueueRtEvents[_0x43c9('0x5')](_0x170a0d,_0x44fc3);};}exports[_0x43c9('0x6')]=function(_0x4fdfc2){for(var _0x39c220=0x0,_0xf03007=events[_0x43c9('0x7')];_0x39c220<_0xf03007;_0x39c220++){var _0x37c029=events[_0x39c220];var _0x383adb=createListener(_0x43c9('0x8')+_0x37c029,_0x4fdfc2);UserVoiceQueueRtEvents['on'](_0x37c029,_0x383adb);}}; \ No newline at end of file +var _0x1115=['save','remove','update','emit','length','userVoiceQueueRt:'];(function(_0x1789af,_0x10d98c){var _0x121cb0=function(_0x1732d1){while(--_0x1732d1){_0x1789af['push'](_0x1789af['shift']());}};_0x121cb0(++_0x10d98c);}(_0x1115,0x1b6));var _0x5111=function(_0x41e786,_0x52be0b){_0x41e786=_0x41e786-0x0;var _0x3959f4=_0x1115[_0x41e786];return _0x3959f4;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x5111('0x0'),_0x5111('0x1'),_0x5111('0x2')];function createListener(_0x20e2ee,_0x39a422){return function(_0x118ead){_0x39a422[_0x5111('0x3')](_0x20e2ee,_0x118ead);};}function removeListener(_0x2cd14a,_0xe7b51f){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2cd14a,_0xe7b51f);};}exports['register']=function(_0x467c3a){for(var _0x115ba7=0x0,_0x50f0a3=events[_0x5111('0x4')];_0x115ba7<_0x50f0a3;_0x115ba7++){var _0x2d2777=events[_0x115ba7];var _0x54d5ae=createListener(_0x5111('0x5')+_0x2d2777,_0x467c3a);UserVoiceQueueRtEvents['on'](_0x2d2777,_0x54d5ae);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index c6a9bfb..373df73 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x48ebcd,_0x19029b){var _0x5c4cec=function(_0x81fdda){while(--_0x81fdda){_0x48ebcd['push'](_0x48ebcd['shift']());}};_0x5c4cec(++_0x19029b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0xcb91[_0x6182ff];return _0x1cec22;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4150a8,_0x2274d5){var _0x5e797d=function(_0x25e3ad){while(--_0x25e3ad){_0x4150a8['push'](_0x4150a8['shift']());}};_0x5e797d(++_0x2274d5);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 583cbee..b0beecd 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 _0x4294=['sequelize','exports'];(function(_0x4b9957,_0x2e7013){var _0x5d3c45=function(_0x2006c9){while(--_0x2006c9){_0x4b9957['push'](_0x4b9957['shift']());}};_0x5d3c45(++_0x2e7013);}(_0x4294,0x6c));var _0x4429=function(_0x43792c,_0x5b2f16){_0x43792c=_0x43792c-0x0;var _0xab8fa8=_0x4294[_0x43792c];return _0xab8fa8;};'use strict';var Sequelize=require(_0x4429('0x0'));module[_0x4429('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x351b=['INTEGER','sequelize','exports'];(function(_0x40d140,_0xccb7c6){var _0x767802=function(_0x6687ce){while(--_0x6687ce){_0x40d140['push'](_0x40d140['shift']());}};_0x767802(++_0xccb7c6);}(_0x351b,0xf7));var _0xb351=function(_0x2947a4,_0x7c919b){_0x2947a4=_0x2947a4-0x0;var _0x5027cb=_0x351b[_0x2947a4];return _0x5027cb;};'use strict';var Sequelize=require(_0xb351('0x0'));module[_0xb351('0x1')]={'penalty':{'type':Sequelize[_0xb351('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 61b307d..d42fabe 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 _0xbc4b=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x35728a,_0x227a2d){var _0x10eb59=function(_0xcb1c74){while(--_0xcb1c74){_0x35728a['push'](_0x35728a['shift']());}};_0x10eb59(++_0x227a2d);}(_0xbc4b,0x9b));var _0xbbc4=function(_0x11115d,_0x540929){_0x11115d=_0x11115d-0x0;var _0x23696b=_0xbc4b[_0x11115d];return _0x23696b;};'use strict';var _=require(_0xbbc4('0x0'));var util=require(_0xbbc4('0x1'));var logger=require(_0xbbc4('0x2'))(_0xbbc4('0x3'));var moment=require(_0xbbc4('0x4'));var BPromise=require(_0xbbc4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbc4('0x6'));var rimraf=require(_0xbbc4('0x7'));var config=require(_0xbbc4('0x8'));var attributes=require('./userWhatsappQueue.attributes');module[_0xbbc4('0x9')]=function(_0xaea7a,_0x128fae){return _0xaea7a['define'](_0xbbc4('0xa'),attributes,{'tableName':_0xbbc4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea3b=['UserWhatsappQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3607c9,_0x4e6400){var _0x47c690=function(_0x4d1dc0){while(--_0x4d1dc0){_0x3607c9['push'](_0x3607c9['shift']());}};_0x47c690(++_0x4e6400);}(_0xea3b,0x85));var _0xbea3=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0xea3b[_0x31c19c];return _0x1a87f7;};'use strict';var _=require(_0xbea3('0x0'));var util=require('util');var logger=require(_0xbea3('0x1'))(_0xbea3('0x2'));var moment=require(_0xbea3('0x3'));var BPromise=require(_0xbea3('0x4'));var rp=require(_0xbea3('0x5'));var fs=require('fs');var path=require(_0xbea3('0x6'));var rimraf=require(_0xbea3('0x7'));var config=require(_0xbea3('0x8'));var attributes=require('./userWhatsappQueue.attributes');module[_0xbea3('0x9')]=function(_0x52a66c,_0x4b8b04){return _0x52a66c[_0xbea3('0xa')](_0xbea3('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index ee772a4..87e4e41 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 _0x3cf8=['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','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x50cf12,_0x4adf06){var _0x5c87f8=function(_0x2404c1){while(--_0x2404c1){_0x50cf12['push'](_0x50cf12['shift']());}};_0x5c87f8(++_0x4adf06);}(_0x3cf8,0x87));var _0x83cf=function(_0x3ae7b7,_0x469102){_0x3ae7b7=_0x3ae7b7-0x0;var _0x550b35=_0x3cf8[_0x3ae7b7];return _0x550b35;};'use strict';var _=require(_0x83cf('0x0'));var util=require(_0x83cf('0x1'));var moment=require(_0x83cf('0x2'));var BPromise=require(_0x83cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83cf('0x4'));var db=require(_0x83cf('0x5'))['db'];var utils=require(_0x83cf('0x6'));var logger=require(_0x83cf('0x7'))(_0x83cf('0x8'));var config=require(_0x83cf('0x9'));var jayson=require(_0x83cf('0xa'));var client=jayson[_0x83cf('0xb')][_0x83cf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4af11e,_0x1fbad1,_0x5e7057){return new BPromise(function(_0x304bc8,_0x594a65){return client[_0x83cf('0xd')](_0x4af11e,_0x5e7057)['then'](function(_0x8ee50){logger[_0x83cf('0xe')](_0x83cf('0xf'),_0x1fbad1,_0x83cf('0x10'));logger[_0x83cf('0x11')](_0x83cf('0x12'),_0x1fbad1,_0x83cf('0x10'),JSON[_0x83cf('0x13')](_0x8ee50));if(_0x8ee50[_0x83cf('0x14')]){if(_0x8ee50[_0x83cf('0x14')][_0x83cf('0x15')]===0x1f4){logger[_0x83cf('0x14')](_0x83cf('0xf'),_0x1fbad1,_0x8ee50[_0x83cf('0x14')][_0x83cf('0x16')]);return _0x594a65(_0x8ee50[_0x83cf('0x14')][_0x83cf('0x16')]);}logger[_0x83cf('0x14')](_0x83cf('0xf'),_0x1fbad1,_0x8ee50[_0x83cf('0x14')]['message']);return _0x304bc8(_0x8ee50[_0x83cf('0x14')]['message']);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x1fbad1,_0x83cf('0x10'));_0x304bc8(_0x8ee50[_0x83cf('0x17')][_0x83cf('0x16')]);}})[_0x83cf('0x18')](function(_0x3c17cf){logger[_0x83cf('0x14')](_0x83cf('0xf'),_0x1fbad1,_0x3c17cf);_0x594a65(_0x3c17cf);});});} \ No newline at end of file +var _0x0e21=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x0e21,0x85));var _0x10e2=function(_0xcb5f02,_0x20e511){_0xcb5f02=_0xcb5f02-0x0;var _0x27b6b0=_0x0e21[_0xcb5f02];return _0x27b6b0;};'use strict';var _=require(_0x10e2('0x0'));var util=require(_0x10e2('0x1'));var moment=require(_0x10e2('0x2'));var BPromise=require(_0x10e2('0x3'));var rs=require(_0x10e2('0x4'));var fs=require('fs');var Redis=require(_0x10e2('0x5'));var db=require(_0x10e2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x10e2('0x7'))(_0x10e2('0x8'));var config=require(_0x10e2('0x9'));var jayson=require(_0x10e2('0xa'));var client=jayson[_0x10e2('0xb')][_0x10e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51a50c,_0x122b20,_0x19697a){return new BPromise(function(_0x685cbe,_0x2fcfc8){return client[_0x10e2('0xd')](_0x51a50c,_0x19697a)[_0x10e2('0xe')](function(_0x3b4120){logger[_0x10e2('0xf')](_0x10e2('0x10'),_0x122b20,_0x10e2('0x11'));logger[_0x10e2('0x12')](_0x10e2('0x13'),_0x122b20,_0x10e2('0x11'),JSON[_0x10e2('0x14')](_0x3b4120));if(_0x3b4120[_0x10e2('0x15')]){if(_0x3b4120[_0x10e2('0x15')][_0x10e2('0x16')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x122b20,_0x3b4120[_0x10e2('0x15')][_0x10e2('0x17')]);return _0x2fcfc8(_0x3b4120[_0x10e2('0x15')][_0x10e2('0x17')]);}logger[_0x10e2('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x122b20,_0x3b4120[_0x10e2('0x15')][_0x10e2('0x17')]);return _0x685cbe(_0x3b4120[_0x10e2('0x15')][_0x10e2('0x17')]);}else{logger[_0x10e2('0xf')](_0x10e2('0x10'),_0x122b20,'request\x20sent');_0x685cbe(_0x3b4120[_0x10e2('0x18')][_0x10e2('0x17')]);}})[_0x10e2('0x19')](function(_0x3b3b83){logger[_0x10e2('0x15')](_0x10e2('0x10'),_0x122b20,_0x3b3b83);_0x2fcfc8(_0x3b3b83);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index aa5cb26..64033fa 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 _0xb079=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','isAuthenticated','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x2fede0,_0x3309ae){var _0x5ebcb3=function(_0x5a6bbd){while(--_0x5a6bbd){_0x2fede0['push'](_0x2fede0['shift']());}};_0x5ebcb3(++_0x3309ae);}(_0xb079,0x1c9));var _0x9b07=function(_0x53b6ae,_0x46ffc4){_0x53b6ae=_0x53b6ae-0x0;var _0x20ab0f=_0xb079[_0x53b6ae];return _0x20ab0f;};'use strict';var multer=require('multer');var util=require(_0x9b07('0x0'));var path=require(_0x9b07('0x1'));var timeout=require(_0x9b07('0x2'));var express=require(_0x9b07('0x3'));var router=express[_0x9b07('0x4')]();var fs_extra=require(_0x9b07('0x5'));var auth=require(_0x9b07('0x6'));var interaction=require(_0x9b07('0x7'));var config=require(_0x9b07('0x8'));var controller=require(_0x9b07('0x9'));router[_0x9b07('0xa')]('/',auth['isAuthenticated'](),controller[_0x9b07('0xb')]);router[_0x9b07('0xa')]('/:id',auth[_0x9b07('0xc')](),controller['show']);router['post']('/',auth[_0x9b07('0xc')](),controller[_0x9b07('0xd')]);router[_0x9b07('0xe')](_0x9b07('0xf'),auth['isAuthenticated'](),controller[_0x9b07('0x10')]);router[_0x9b07('0x11')](_0x9b07('0xf'),auth[_0x9b07('0xc')](),controller[_0x9b07('0x12')]);module[_0x9b07('0x13')]=router; \ No newline at end of file +var _0x323b=['./variable.controller','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x323b,0x1ad));var _0xb323=function(_0x2e59fe,_0x1e8854){_0x2e59fe=_0x2e59fe-0x0;var _0x52230c=_0x323b[_0x2e59fe];return _0x52230c;};'use strict';var multer=require(_0xb323('0x0'));var util=require('util');var path=require(_0xb323('0x1'));var timeout=require(_0xb323('0x2'));var express=require(_0xb323('0x3'));var router=express['Router']();var fs_extra=require(_0xb323('0x4'));var auth=require(_0xb323('0x5'));var interaction=require(_0xb323('0x6'));var config=require(_0xb323('0x7'));var controller=require(_0xb323('0x8'));router[_0xb323('0x9')]('/',auth[_0xb323('0xa')](),controller[_0xb323('0xb')]);router['get']('/:id',auth[_0xb323('0xa')](),controller[_0xb323('0xc')]);router[_0xb323('0xd')]('/',auth[_0xb323('0xa')](),controller['create']);router[_0xb323('0xe')](_0xb323('0xf'),auth[_0xb323('0xa')](),controller['update']);router[_0xb323('0x10')](_0xb323('0xf'),auth[_0xb323('0xa')](),controller[_0xb323('0x11')]);module[_0xb323('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 313fe74..c1989b7 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 _0x6315=['STRING','name','exports'];(function(_0x4c2e45,_0x40d854){var _0x2306b2=function(_0x1f7349){while(--_0x1f7349){_0x4c2e45['push'](_0x4c2e45['shift']());}};_0x2306b2(++_0x40d854);}(_0x6315,0x65));var _0x5631=function(_0x4a88b2,_0x407e10){_0x4a88b2=_0x4a88b2-0x0;var _0x5d9b3a=_0x6315[_0x4a88b2];return _0x5d9b3a;};'use strict';var Sequelize=require('sequelize');module[_0x5631('0x0')]={'name':{'type':Sequelize[_0x5631('0x1')],'unique':_0x5631('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5631('0x1')]}}; \ No newline at end of file +var _0x4703=['STRING','name','sequelize','exports'];(function(_0x2c5340,_0x5c86e5){var _0x3c505e=function(_0x1089d9){while(--_0x1089d9){_0x2c5340['push'](_0x2c5340['shift']());}};_0x3c505e(++_0x5c86e5);}(_0x4703,0xda));var _0x3470=function(_0x49e400,_0x4dc383){_0x49e400=_0x49e400-0x0;var _0x3bf73d=_0x4703[_0x49e400];return _0x3bf73d;};'use strict';var Sequelize=require(_0x3470('0x0'));module[_0x3470('0x1')]={'name':{'type':Sequelize[_0x3470('0x2')],'unique':_0x3470('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3470('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 80706e8..1475df6 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 _0xdb89=['merge','VIRTUAL','includeAll','findAll','catch','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','Variables','UserProfileResource','error','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x373385,_0x432e95){var _0x2f5062=function(_0x4506da){while(--_0x4506da){_0x373385['push'](_0x373385['shift']());}};_0x2f5062(++_0x432e95);}(_0xdb89,0x10c));var _0x9db8=function(_0x14cc69,_0x40c3f8){_0x14cc69=_0x14cc69-0x0;var _0x59a2fb=_0xdb89[_0x14cc69];return _0x59a2fb;};'use strict';var emlformat=require(_0x9db8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9db8('0x1'));var jsonpatch=require(_0x9db8('0x2'));var rp=require(_0x9db8('0x3'));var moment=require(_0x9db8('0x4'));var BPromise=require(_0x9db8('0x5'));var Mustache=require(_0x9db8('0x6'));var util=require(_0x9db8('0x7'));var path=require(_0x9db8('0x8'));var sox=require('sox');var csv=require(_0x9db8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9db8('0xa'));var _=require(_0x9db8('0xb'));var squel=require('squel');var crypto=require(_0x9db8('0xc'));var jsforce=require(_0x9db8('0xd'));var deskjs=require(_0x9db8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9db8('0xf'));var Papa=require(_0x9db8('0x10'));var Redis=require(_0x9db8('0x11'));var authService=require(_0x9db8('0x12'));var qs=require(_0x9db8('0x13'));var as=require(_0x9db8('0x14'));var hardwareService=require(_0x9db8('0x15'));var logger=require(_0x9db8('0x16'))('api');var utils=require(_0x9db8('0x17'));var config=require(_0x9db8('0x18'));var licenseUtil=require(_0x9db8('0x19'));var db=require(_0x9db8('0x1a'))['db'];function respondWithStatusCode(_0x21d48b,_0x4bc853){_0x4bc853=_0x4bc853||0xcc;return function(_0x5eee7c){if(_0x5eee7c){return _0x21d48b[_0x9db8('0x1b')](_0x4bc853);}return _0x21d48b[_0x9db8('0x1c')](_0x4bc853)[_0x9db8('0x1d')]();};}function respondWithResult(_0x5c3ed5,_0x2aaebd){_0x2aaebd=_0x2aaebd||0xc8;return function(_0x53d0a6){if(_0x53d0a6){return _0x5c3ed5[_0x9db8('0x1c')](_0x2aaebd)[_0x9db8('0x1e')](_0x53d0a6);}};}function respondWithFilteredResult(_0x33028d,_0x2373d2){return function(_0x4acdd7){if(_0x4acdd7){var _0x40d857=typeof _0x2373d2[_0x9db8('0x1f')]===_0x9db8('0x20')&&typeof _0x2373d2[_0x9db8('0x21')]===_0x9db8('0x20');var _0x2d5a79=_0x4acdd7[_0x9db8('0x22')];var _0xb726c3=_0x40d857?0x0:_0x2373d2['offset'];var _0x576c5d=_0x40d857?_0x4acdd7[_0x9db8('0x22')]:_0x2373d2[_0x9db8('0x1f')]+_0x2373d2['limit'];var _0x459076;if(_0x576c5d>=_0x2d5a79){_0x576c5d=_0x2d5a79;_0x459076=0xc8;}else{_0x459076=0xce;}_0x33028d[_0x9db8('0x1c')](_0x459076);return _0x33028d['set']('Content-Range',_0xb726c3+'-'+_0x576c5d+'/'+_0x2d5a79)[_0x9db8('0x1e')](_0x4acdd7);}return null;};}function patchUpdates(_0x9034f0){return function(_0x2610ef){try{jsonpatch[_0x9db8('0x23')](_0x2610ef,_0x9034f0,!![]);}catch(_0x5be48d){return BPromise[_0x9db8('0x24')](_0x5be48d);}return _0x2610ef['save']();};}function saveUpdates(_0x27d7f2,_0x5f259c){return function(_0x3714e5){if(_0x3714e5){return _0x3714e5[_0x9db8('0x25')](_0x27d7f2)[_0x9db8('0x26')](function(_0x356bcc){return _0x356bcc;});}return null;};}function removeEntity(_0xb88580,_0xd8127d){return function(_0x44b1b3){if(_0x44b1b3){return _0x44b1b3[_0x9db8('0x27')]()[_0x9db8('0x26')](function(){var _0x34bb1e=_0x44b1b3[_0x9db8('0x28')]({'plain':!![]});var _0x26dda3=_0x9db8('0x29');return db[_0x9db8('0x2a')][_0x9db8('0x27')]({'where':{'type':_0x26dda3,'resourceId':_0x34bb1e['id']}})[_0x9db8('0x26')](function(){return _0x44b1b3;});})['then'](function(){_0xb88580['status'](0xcc)[_0x9db8('0x1d')]();});}};}function handleEntityNotFound(_0x19d6e7,_0x524148){return function(_0x22a9e9){if(!_0x22a9e9){_0x19d6e7[_0x9db8('0x1b')](0x194);}return _0x22a9e9;};}function handleError(_0x3636a3,_0x40adcf){_0x40adcf=_0x40adcf||0x1f4;return function(_0x38c51f){logger[_0x9db8('0x2b')](_0x38c51f['stack']);if(_0x38c51f[_0x9db8('0x2c')]){delete _0x38c51f[_0x9db8('0x2c')];}_0x3636a3[_0x9db8('0x1c')](_0x40adcf)[_0x9db8('0x2d')](_0x38c51f);};}exports[_0x9db8('0x2e')]=function(_0xe2bfb6,_0x1e1f10){var _0x4ab097={},_0x11cc13={},_0x266819={'count':0x0,'rows':[]};var _0x404f32=_[_0x9db8('0x2f')](db[_0x9db8('0x30')][_0x9db8('0x31')],function(_0x1a04d4){return{'name':_0x1a04d4[_0x9db8('0x32')],'type':_0x1a04d4[_0x9db8('0x33')][_0x9db8('0x34')]};});_0x11cc13[_0x9db8('0x35')]=_[_0x9db8('0x2f')](_0x404f32,'name');_0x11cc13[_0x9db8('0x36')]=_[_0x9db8('0x37')](_0xe2bfb6[_0x9db8('0x36')]);_0x11cc13[_0x9db8('0x38')]=_[_0x9db8('0x39')](_0x11cc13[_0x9db8('0x35')],_0x11cc13[_0x9db8('0x36')]);_0x4ab097[_0x9db8('0x3a')]=_[_0x9db8('0x39')](_0x11cc13[_0x9db8('0x35')],qs[_0x9db8('0x3b')](_0xe2bfb6[_0x9db8('0x36')][_0x9db8('0x3b')]));_0x4ab097[_0x9db8('0x3a')]=_0x4ab097[_0x9db8('0x3a')][_0x9db8('0x3c')]?_0x4ab097[_0x9db8('0x3a')]:_0x11cc13[_0x9db8('0x35')];if(!_0xe2bfb6[_0x9db8('0x36')][_0x9db8('0x3d')](_0x9db8('0x3e'))){_0x4ab097[_0x9db8('0x21')]=qs['limit'](_0xe2bfb6['query'][_0x9db8('0x21')]);_0x4ab097[_0x9db8('0x1f')]=qs['offset'](_0xe2bfb6[_0x9db8('0x36')]['offset']);}_0x4ab097[_0x9db8('0x3f')]=qs[_0x9db8('0x40')](_0xe2bfb6[_0x9db8('0x36')][_0x9db8('0x40')]);_0x4ab097[_0x9db8('0x41')]=qs['filters'](_[_0x9db8('0x42')](_0xe2bfb6[_0x9db8('0x36')],_0x11cc13[_0x9db8('0x38')]),_0x404f32);if(_0xe2bfb6[_0x9db8('0x36')][_0x9db8('0x43')]){_0x4ab097[_0x9db8('0x41')]=_[_0x9db8('0x44')](_0x4ab097['where'],{'$or':_[_0x9db8('0x2f')](_0x404f32,function(_0x10ee9f){if(_0x10ee9f[_0x9db8('0x33')]!==_0x9db8('0x45')){var _0x86436e={};_0x86436e[_0x10ee9f[_0x9db8('0x2c')]]={'$like':'%'+_0xe2bfb6[_0x9db8('0x36')][_0x9db8('0x43')]+'%'};return _0x86436e;}})});}_0x4ab097=_[_0x9db8('0x44')]({},_0x4ab097,_0xe2bfb6['options']);var _0x430e6a={'where':_0x4ab097[_0x9db8('0x41')]};return db['Variable'][_0x9db8('0x22')](_0x430e6a)[_0x9db8('0x26')](function(_0x3c2352){_0x266819[_0x9db8('0x22')]=_0x3c2352;if(_0xe2bfb6['query'][_0x9db8('0x46')]){_0x4ab097['include']=[{'all':!![]}];}return db[_0x9db8('0x30')][_0x9db8('0x47')](_0x4ab097);})[_0x9db8('0x26')](function(_0x33b7e1){_0x266819['rows']=_0x33b7e1;return _0x266819;})[_0x9db8('0x26')](respondWithFilteredResult(_0x1e1f10,_0x4ab097))[_0x9db8('0x48')](handleError(_0x1e1f10,null));};exports['show']=function(_0x46c3a5,_0x1d8fe3){var _0x11dfcb={'raw':!![],'where':{'id':_0x46c3a5['params']['id']}},_0x11a04c={};_0x11a04c[_0x9db8('0x35')]=_['keys'](db['Variable'][_0x9db8('0x31')]);_0x11a04c[_0x9db8('0x36')]=_[_0x9db8('0x37')](_0x46c3a5['query']);_0x11a04c[_0x9db8('0x38')]=_[_0x9db8('0x39')](_0x11a04c[_0x9db8('0x35')],_0x11a04c[_0x9db8('0x36')]);_0x11dfcb['attributes']=_['intersection'](_0x11a04c['model'],qs[_0x9db8('0x3b')](_0x46c3a5[_0x9db8('0x36')]['fields']));_0x11dfcb[_0x9db8('0x3a')]=_0x11dfcb[_0x9db8('0x3a')][_0x9db8('0x3c')]?_0x11dfcb[_0x9db8('0x3a')]:_0x11a04c[_0x9db8('0x35')];if(_0x46c3a5[_0x9db8('0x36')][_0x9db8('0x46')]){_0x11dfcb[_0x9db8('0x49')]=[{'all':!![]}];}_0x11dfcb=_[_0x9db8('0x44')]({},_0x11dfcb,_0x46c3a5['options']);return db['Variable'][_0x9db8('0x4a')](_0x11dfcb)[_0x9db8('0x26')](handleEntityNotFound(_0x1d8fe3,null))[_0x9db8('0x26')](respondWithResult(_0x1d8fe3,null))[_0x9db8('0x48')](handleError(_0x1d8fe3,null));};exports[_0x9db8('0x4b')]=function(_0x1fa6eb,_0x49d829){return db[_0x9db8('0x30')][_0x9db8('0x4b')](_0x1fa6eb[_0x9db8('0x4c')],{})['then'](function(_0xa13a70){var _0x5b0bed=_0x1fa6eb[_0x9db8('0x4d')][_0x9db8('0x28')]({'plain':!![]});if(!_0x5b0bed)throw new Error(_0x9db8('0x4e'));if(_0x5b0bed[_0x9db8('0x4f')]===_0x9db8('0x4d')){var _0x49f329=_0xa13a70[_0x9db8('0x28')]({'plain':!![]});var _0x358608=_0x9db8('0x29');return db[_0x9db8('0x50')][_0x9db8('0x4a')]({'where':{'name':_0x358608,'userProfileId':_0x5b0bed[_0x9db8('0x51')]},'raw':!![]})['then'](function(_0x54b9fe){if(_0x54b9fe&&_0x54b9fe[_0x9db8('0x52')]===0x0){return db[_0x9db8('0x2a')][_0x9db8('0x4b')]({'name':_0x49f329[_0x9db8('0x2c')],'resourceId':_0x49f329['id'],'type':_0x54b9fe[_0x9db8('0x2c')],'sectionId':_0x54b9fe['id']},{})[_0x9db8('0x26')](function(){return _0xa13a70;});}else{return _0xa13a70;}})[_0x9db8('0x48')](function(_0x4a0dc6){logger[_0x9db8('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a0dc6);throw _0x4a0dc6;});}return _0xa13a70;})[_0x9db8('0x26')](respondWithResult(_0x49d829,0xc9))[_0x9db8('0x48')](handleError(_0x49d829,null));};exports[_0x9db8('0x25')]=function(_0x1e14bc,_0x20bba3){if(_0x1e14bc['body']['id']){delete _0x1e14bc['body']['id'];}return db[_0x9db8('0x30')]['find']({'where':{'id':_0x1e14bc['params']['id']}})['then'](handleEntityNotFound(_0x20bba3,null))[_0x9db8('0x26')](saveUpdates(_0x1e14bc[_0x9db8('0x4c')],null))[_0x9db8('0x26')](respondWithResult(_0x20bba3,null))[_0x9db8('0x48')](handleError(_0x20bba3,null));};exports[_0x9db8('0x27')]=function(_0x294116,_0x1449f8){return db['Variable'][_0x9db8('0x4a')]({'where':{'id':_0x294116[_0x9db8('0x53')]['id']}})[_0x9db8('0x26')](handleEntityNotFound(_0x1449f8,null))[_0x9db8('0x26')](removeEntity(_0x1449f8,null))['catch'](handleError(_0x1449f8,null));}; \ No newline at end of file +var _0x7a27=['end','error','name','send','index','map','Variable','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','Variables','UserProfileResource','destroy'];(function(_0x347ef7,_0x156495){var _0x35eb83=function(_0x1a6bcb){while(--_0x1a6bcb){_0x347ef7['push'](_0x347ef7['shift']());}};_0x35eb83(++_0x156495);}(_0x7a27,0x109));var _0x77a2=function(_0x3dbea5,_0x515074){_0x3dbea5=_0x3dbea5-0x0;var _0x30d533=_0x7a27[_0x3dbea5];return _0x30d533;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x77a2('0x0'));var jsonpatch=require(_0x77a2('0x1'));var rp=require(_0x77a2('0x2'));var moment=require(_0x77a2('0x3'));var BPromise=require(_0x77a2('0x4'));var Mustache=require(_0x77a2('0x5'));var util=require(_0x77a2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x77a2('0x7'));var ejs=require(_0x77a2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77a2('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x77a2('0xa'));var deskjs=require(_0x77a2('0xb'));var toCsv=require(_0x77a2('0x7'));var querystring=require(_0x77a2('0xc'));var Papa=require(_0x77a2('0xd'));var Redis=require(_0x77a2('0xe'));var authService=require(_0x77a2('0xf'));var qs=require(_0x77a2('0x10'));var as=require(_0x77a2('0x11'));var hardwareService=require(_0x77a2('0x12'));var logger=require(_0x77a2('0x13'))(_0x77a2('0x14'));var utils=require(_0x77a2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x77a2('0x16'));var db=require(_0x77a2('0x17'))['db'];function respondWithStatusCode(_0x5d7063,_0xad9285){_0xad9285=_0xad9285||0xcc;return function(_0x1ef805){if(_0x1ef805){return _0x5d7063[_0x77a2('0x18')](_0xad9285);}return _0x5d7063['status'](_0xad9285)['end']();};}function respondWithResult(_0x447c0d,_0x36686f){_0x36686f=_0x36686f||0xc8;return function(_0xdbf27b){if(_0xdbf27b){return _0x447c0d[_0x77a2('0x19')](_0x36686f)[_0x77a2('0x1a')](_0xdbf27b);}};}function respondWithFilteredResult(_0x2817d7,_0xd4f436){return function(_0x2ee71f){if(_0x2ee71f){var _0x24091a=typeof _0xd4f436[_0x77a2('0x1b')]===_0x77a2('0x1c')&&typeof _0xd4f436['limit']==='undefined';var _0x2bc50f=_0x2ee71f[_0x77a2('0x1d')];var _0x3e062e=_0x24091a?0x0:_0xd4f436['offset'];var _0x77be45=_0x24091a?_0x2ee71f[_0x77a2('0x1d')]:_0xd4f436[_0x77a2('0x1b')]+_0xd4f436[_0x77a2('0x1e')];var _0x1f6089;if(_0x77be45>=_0x2bc50f){_0x77be45=_0x2bc50f;_0x1f6089=0xc8;}else{_0x1f6089=0xce;}_0x2817d7[_0x77a2('0x19')](_0x1f6089);return _0x2817d7[_0x77a2('0x1f')](_0x77a2('0x20'),_0x3e062e+'-'+_0x77be45+'/'+_0x2bc50f)[_0x77a2('0x1a')](_0x2ee71f);}return null;};}function patchUpdates(_0x2e75dd){return function(_0x29c685){try{jsonpatch['apply'](_0x29c685,_0x2e75dd,!![]);}catch(_0x920a06){return BPromise['reject'](_0x920a06);}return _0x29c685['save']();};}function saveUpdates(_0x231b13,_0x423010){return function(_0x143b03){if(_0x143b03){return _0x143b03[_0x77a2('0x21')](_0x231b13)['then'](function(_0x63424d){return _0x63424d;});}return null;};}function removeEntity(_0x351169,_0x21f455){return function(_0x2a6706){if(_0x2a6706){return _0x2a6706['destroy']()[_0x77a2('0x22')](function(){var _0x10227e=_0x2a6706[_0x77a2('0x23')]({'plain':!![]});var _0x505edf=_0x77a2('0x24');return db[_0x77a2('0x25')][_0x77a2('0x26')]({'where':{'type':_0x505edf,'resourceId':_0x10227e['id']}})[_0x77a2('0x22')](function(){return _0x2a6706;});})['then'](function(){_0x351169['status'](0xcc)[_0x77a2('0x27')]();});}};}function handleEntityNotFound(_0x567e1f,_0x10444d){return function(_0x353235){if(!_0x353235){_0x567e1f['sendStatus'](0x194);}return _0x353235;};}function handleError(_0xb802f2,_0x4260a0){_0x4260a0=_0x4260a0||0x1f4;return function(_0x4d25fc){logger[_0x77a2('0x28')](_0x4d25fc['stack']);if(_0x4d25fc['name']){delete _0x4d25fc[_0x77a2('0x29')];}_0xb802f2[_0x77a2('0x19')](_0x4260a0)[_0x77a2('0x2a')](_0x4d25fc);};}exports[_0x77a2('0x2b')]=function(_0x4dc983,_0x1da411){var _0x292340={},_0xd3be9d={},_0x35da63={'count':0x0,'rows':[]};var _0x37f4f6=_[_0x77a2('0x2c')](db[_0x77a2('0x2d')][_0x77a2('0x2e')],function(_0x219dd9){return{'name':_0x219dd9[_0x77a2('0x2f')],'type':_0x219dd9['type']['key']};});_0xd3be9d[_0x77a2('0x30')]=_[_0x77a2('0x2c')](_0x37f4f6,'name');_0xd3be9d[_0x77a2('0x31')]=_[_0x77a2('0x32')](_0x4dc983[_0x77a2('0x31')]);_0xd3be9d['filters']=_['intersection'](_0xd3be9d[_0x77a2('0x30')],_0xd3be9d['query']);_0x292340[_0x77a2('0x33')]=_[_0x77a2('0x34')](_0xd3be9d[_0x77a2('0x30')],qs[_0x77a2('0x35')](_0x4dc983[_0x77a2('0x31')][_0x77a2('0x35')]));_0x292340[_0x77a2('0x33')]=_0x292340[_0x77a2('0x33')][_0x77a2('0x36')]?_0x292340['attributes']:_0xd3be9d[_0x77a2('0x30')];if(!_0x4dc983[_0x77a2('0x31')][_0x77a2('0x37')](_0x77a2('0x38'))){_0x292340[_0x77a2('0x1e')]=qs[_0x77a2('0x1e')](_0x4dc983['query'][_0x77a2('0x1e')]);_0x292340[_0x77a2('0x1b')]=qs[_0x77a2('0x1b')](_0x4dc983['query'][_0x77a2('0x1b')]);}_0x292340['order']=qs['sort'](_0x4dc983[_0x77a2('0x31')]['sort']);_0x292340[_0x77a2('0x39')]=qs[_0x77a2('0x3a')](_[_0x77a2('0x3b')](_0x4dc983['query'],_0xd3be9d[_0x77a2('0x3a')]),_0x37f4f6);if(_0x4dc983[_0x77a2('0x31')][_0x77a2('0x3c')]){_0x292340['where']=_['merge'](_0x292340['where'],{'$or':_[_0x77a2('0x2c')](_0x37f4f6,function(_0x2e6abc){if(_0x2e6abc['type']!=='VIRTUAL'){var _0xeb8fc5={};_0xeb8fc5[_0x2e6abc[_0x77a2('0x29')]]={'$like':'%'+_0x4dc983[_0x77a2('0x31')][_0x77a2('0x3c')]+'%'};return _0xeb8fc5;}})});}_0x292340=_[_0x77a2('0x3d')]({},_0x292340,_0x4dc983['options']);var _0xfb02c1={'where':_0x292340[_0x77a2('0x39')]};return db[_0x77a2('0x2d')][_0x77a2('0x1d')](_0xfb02c1)['then'](function(_0x3268a3){_0x35da63['count']=_0x3268a3;if(_0x4dc983['query']['includeAll']){_0x292340['include']=[{'all':!![]}];}return db['Variable'][_0x77a2('0x3e')](_0x292340);})['then'](function(_0x9ec213){_0x35da63[_0x77a2('0x3f')]=_0x9ec213;return _0x35da63;})[_0x77a2('0x22')](respondWithFilteredResult(_0x1da411,_0x292340))[_0x77a2('0x40')](handleError(_0x1da411,null));};exports[_0x77a2('0x41')]=function(_0x2a96a7,_0x1cd61b){var _0x286b7d={'raw':!![],'where':{'id':_0x2a96a7[_0x77a2('0x42')]['id']}},_0x5c6fe7={};_0x5c6fe7[_0x77a2('0x30')]=_['keys'](db[_0x77a2('0x2d')][_0x77a2('0x2e')]);_0x5c6fe7[_0x77a2('0x31')]=_['keys'](_0x2a96a7['query']);_0x5c6fe7[_0x77a2('0x3a')]=_[_0x77a2('0x34')](_0x5c6fe7[_0x77a2('0x30')],_0x5c6fe7[_0x77a2('0x31')]);_0x286b7d[_0x77a2('0x33')]=_['intersection'](_0x5c6fe7[_0x77a2('0x30')],qs[_0x77a2('0x35')](_0x2a96a7['query'][_0x77a2('0x35')]));_0x286b7d[_0x77a2('0x33')]=_0x286b7d[_0x77a2('0x33')][_0x77a2('0x36')]?_0x286b7d[_0x77a2('0x33')]:_0x5c6fe7[_0x77a2('0x30')];if(_0x2a96a7['query']['includeAll']){_0x286b7d['include']=[{'all':!![]}];}_0x286b7d=_[_0x77a2('0x3d')]({},_0x286b7d,_0x2a96a7['options']);return db[_0x77a2('0x2d')]['find'](_0x286b7d)[_0x77a2('0x22')](handleEntityNotFound(_0x1cd61b,null))['then'](respondWithResult(_0x1cd61b,null))[_0x77a2('0x40')](handleError(_0x1cd61b,null));};exports[_0x77a2('0x43')]=function(_0x23b561,_0x349224){return db[_0x77a2('0x2d')]['create'](_0x23b561['body'],{})[_0x77a2('0x22')](function(_0x427855){var _0x390ad0=_0x23b561['user'][_0x77a2('0x23')]({'plain':!![]});if(!_0x390ad0)throw new Error(_0x77a2('0x44'));if(_0x390ad0[_0x77a2('0x45')]===_0x77a2('0x46')){var _0x43d488=_0x427855[_0x77a2('0x23')]({'plain':!![]});var _0x12724b='Variables';return db[_0x77a2('0x47')][_0x77a2('0x48')]({'where':{'name':_0x12724b,'userProfileId':_0x390ad0[_0x77a2('0x49')]},'raw':!![]})[_0x77a2('0x22')](function(_0x4f210a){if(_0x4f210a&&_0x4f210a[_0x77a2('0x4a')]===0x0){return db[_0x77a2('0x25')][_0x77a2('0x43')]({'name':_0x43d488[_0x77a2('0x29')],'resourceId':_0x43d488['id'],'type':_0x4f210a[_0x77a2('0x29')],'sectionId':_0x4f210a['id']},{})['then'](function(){return _0x427855;});}else{return _0x427855;}})[_0x77a2('0x40')](function(_0x3ec8cd){logger[_0x77a2('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ec8cd);throw _0x3ec8cd;});}return _0x427855;})['then'](respondWithResult(_0x349224,0xc9))['catch'](handleError(_0x349224,null));};exports[_0x77a2('0x21')]=function(_0x297e9a,_0x5db817){if(_0x297e9a['body']['id']){delete _0x297e9a[_0x77a2('0x4b')]['id'];}return db['Variable'][_0x77a2('0x48')]({'where':{'id':_0x297e9a[_0x77a2('0x42')]['id']}})[_0x77a2('0x22')](handleEntityNotFound(_0x5db817,null))[_0x77a2('0x22')](saveUpdates(_0x297e9a[_0x77a2('0x4b')],null))['then'](respondWithResult(_0x5db817,null))['catch'](handleError(_0x5db817,null));};exports['destroy']=function(_0x2de89b,_0x1296af){return db[_0x77a2('0x2d')][_0x77a2('0x48')]({'where':{'id':_0x2de89b[_0x77a2('0x42')]['id']}})['then'](handleEntityNotFound(_0x1296af,null))[_0x77a2('0x22')](removeEntity(_0x1296af,null))[_0x77a2('0x40')](handleError(_0x1296af,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 9bd99c7..fb53ea6 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 _0xa47f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger'];(function(_0x1cee11,_0x1459a5){var _0x4104cb=function(_0x1a43eb){while(--_0x1a43eb){_0x1cee11['push'](_0x1cee11['shift']());}};_0x4104cb(++_0x1459a5);}(_0xa47f,0x1a2));var _0xfa47=function(_0x24ded,_0xeb0a2c){_0x24ded=_0x24ded-0x0;var _0x245611=_0xa47f[_0x24ded];return _0x245611;};'use strict';var _=require(_0xfa47('0x0'));var util=require('util');var logger=require(_0xfa47('0x1'))(_0xfa47('0x2'));var moment=require(_0xfa47('0x3'));var BPromise=require(_0xfa47('0x4'));var rp=require(_0xfa47('0x5'));var fs=require('fs');var path=require(_0xfa47('0x6'));var rimraf=require(_0xfa47('0x7'));var config=require(_0xfa47('0x8'));var attributes=require(_0xfa47('0x9'));module[_0xfa47('0xa')]=function(_0x4f4d70,_0x3f5b48){return _0x4f4d70[_0xfa47('0xb')](_0xfa47('0xc'),attributes,{'tableName':_0xfa47('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff37=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash'];(function(_0x11fc8b,_0x4ee51d){var _0x4ea86e=function(_0x50e5bf){while(--_0x50e5bf){_0x11fc8b['push'](_0x11fc8b['shift']());}};_0x4ea86e(++_0x4ee51d);}(_0xff37,0x13e));var _0x7ff3=function(_0x46be7d,_0x2258d2){_0x46be7d=_0x46be7d-0x0;var _0x12250f=_0xff37[_0x46be7d];return _0x12250f;};'use strict';var _=require(_0x7ff3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7ff3('0x1'));var BPromise=require(_0x7ff3('0x2'));var rp=require(_0x7ff3('0x3'));var fs=require('fs');var path=require(_0x7ff3('0x4'));var rimraf=require(_0x7ff3('0x5'));var config=require(_0x7ff3('0x6'));var attributes=require(_0x7ff3('0x7'));module[_0x7ff3('0x8')]=function(_0x224bff,_0x4efb21){return _0x224bff[_0x7ff3('0x9')](_0x7ff3('0xa'),attributes,{'tableName':'tools_variables','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 f78c20b..996f655 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x1b3287,_0x15c015){var _0x10b1bc=function(_0x104798){while(--_0x104798){_0x1b3287['push'](_0x1b3287['shift']());}};_0x10b1bc(++_0x15c015);}(_0xe14b,0x93));var _0xbe14=function(_0x2258e8,_0x396f17){_0x2258e8=_0x2258e8-0x0;var _0x539892=_0xe14b[_0x2258e8];return _0x539892;};'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);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +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(_0x13d915,_0x306818){var _0x3e1907=function(_0x3a1f5d){while(--_0x3a1f5d){_0x13d915['push'](_0x13d915['shift']());}};_0x3e1907(++_0x306818);}(_0x3e74,0x175));var _0x43e7=function(_0x52e4a1,_0x565ffd){_0x52e4a1=_0x52e4a1-0x0;var _0x2d0157=_0x3e74[_0x52e4a1];return _0x2d0157;};'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 diff --git a/server/api/version/index.js b/server/api/version/index.js index 2ac5782..90ba5c8 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 _0x8132=['get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','pull','/restart','restart','/migrations','exports','express','Router','../../components/auth/service'];(function(_0xda99d6,_0x5d0efa){var _0x4d8540=function(_0x5e2e94){while(--_0x5e2e94){_0xda99d6['push'](_0xda99d6['shift']());}};_0x4d8540(++_0x5d0efa);}(_0x8132,0x1bd));var _0x2813=function(_0x1293d3,_0x10f70b){_0x1293d3=_0x1293d3-0x0;var _0x22e796=_0x8132[_0x1293d3];return _0x22e796;};'use strict';var express=require(_0x2813('0x0'));var router=express[_0x2813('0x1')]();var auth=require(_0x2813('0x2'));var controller=require('./version.controller');router[_0x2813('0x3')]('/',controller[_0x2813('0x4')]);router[_0x2813('0x3')](_0x2813('0x5'),auth[_0x2813('0x6')](),auth[_0x2813('0x7')](),controller[_0x2813('0x8')]);router[_0x2813('0x3')](_0x2813('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x2813('0xa')]);router[_0x2813('0x3')]('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x2813('0xb')]);router[_0x2813('0x3')](_0x2813('0xc'),auth[_0x2813('0x6')](),controller[_0x2813('0xd')]);router[_0x2813('0x3')](_0x2813('0xe'),controller['migrations']);module[_0x2813('0xf')]=router; \ No newline at end of file +var _0xde5c=['/reset','/pull','pull','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','/fetch','isAuthenticated','canUpdate','fetch','get'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xde5c,0xf7));var _0xcde5=function(_0x4c7ee1,_0xdd33ba){_0x4c7ee1=_0x4c7ee1-0x0;var _0x3576fb=_0xde5c[_0x4c7ee1];return _0x3576fb;};'use strict';var express=require(_0xcde5('0x0'));var router=express[_0xcde5('0x1')]();var auth=require(_0xcde5('0x2'));var controller=require(_0xcde5('0x3'));router['get']('/',controller['index']);router['get'](_0xcde5('0x4'),auth[_0xcde5('0x5')](),auth[_0xcde5('0x6')](),controller[_0xcde5('0x7')]);router[_0xcde5('0x8')](_0xcde5('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller['reset']);router[_0xcde5('0x8')](_0xcde5('0xa'),auth[_0xcde5('0x5')](),auth[_0xcde5('0x6')](),controller[_0xcde5('0xb')]);router['get']('/restart',auth[_0xcde5('0x5')](),controller[_0xcde5('0xc')]);router[_0xcde5('0x8')](_0xcde5('0xd'),controller[_0xcde5('0xe')]);module[_0xcde5('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index ffbc308..240273e 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 _0x9fd0=['reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','replace','length','sort','sequelize','Migration','getQueryInterface','constructor','root','server','map','.js','then','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/logger','update','simple-git','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master'];(function(_0x2f7d18,_0x44bea6){var _0x425175=function(_0x4b6787){while(--_0x4b6787){_0x2f7d18['push'](_0x2f7d18['shift']());}};_0x425175(++_0x44bea6);}(_0x9fd0,0x18d));var _0x09fd=function(_0xb34efd,_0x4237da){_0xb34efd=_0xb34efd-0x0;var _0x1a8866=_0x9fd0[_0xb34efd];return _0x1a8866;};'use strict';var Umzug=require(_0x09fd('0x0'));var path=require(_0x09fd('0x1'));var fs=require('fs');var _=require(_0x09fd('0x2'));var pkginfo=require(_0x09fd('0x3'))(module,_0x09fd('0x4'));var compareVersions=require(_0x09fd('0x5'));var exec=require(_0x09fd('0x6'))[_0x09fd('0x7')];var db=require(_0x09fd('0x8'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0x09fd('0x9'))(_0x09fd('0xa'));var git=require(_0x09fd('0xb'))(config['root']);exports[_0x09fd('0xc')]=function(_0x52edb2,_0x5250f4){var _0x364dcb={'current':module[_0x09fd('0xd')]['version'],'phonebar':0x2};if(_0x52edb2[_0x09fd('0xe')]&&_0x52edb2[_0x09fd('0xe')][_0x09fd('0xf')]){return git[_0x09fd('0x10')]()[_0x09fd('0x11')](function(_0x506aaf,_0x8feda1){_0x364dcb['latest']=(_0x506aaf?module['exports']['version']:_0x8feda1[_0x09fd('0xf')])||_0x09fd('0x12');return _0x5250f4[_0x09fd('0x13')](0xc8)[_0x09fd('0x14')](_0x364dcb);});}else{return _0x5250f4[_0x09fd('0x13')](0xc8)[_0x09fd('0x14')](_0x364dcb);}};exports['fetch']=function(_0x13eadb,_0x4c8946){return git[_0x09fd('0x10')]([_0x09fd('0x15'),_0x09fd('0x16')],function(_0x5281c1){if(_0x5281c1){logger[_0x09fd('0x17')](_0x5281c1);return _0x4c8946[_0x09fd('0x13')](0x1f4)[_0x09fd('0x14')](_0x5281c1);}logger[_0x09fd('0x18')](_0x09fd('0x19'));return _0x4c8946[_0x09fd('0x13')](0xc8)['json']({'output':_0x09fd('0x1a')});});};exports[_0x09fd('0x1b')]=function(_0x2fdae2,_0x4a3b1f){return git[_0x09fd('0x1b')]([_0x09fd('0x1c'),'FETCH_HEAD'],function(_0x33370b){if(_0x33370b){logger[_0x09fd('0x17')](_0x33370b);return _0x4a3b1f[_0x09fd('0x13')](0x1f4)[_0x09fd('0x14')](_0x33370b);}logger[_0x09fd('0x18')](_0x09fd('0x1d'));return _0x4a3b1f['status'](0xc8)[_0x09fd('0x14')]({'output':'git\x20reset\x20--hard'});});};exports[_0x09fd('0x1e')]=function(_0x52328e,_0x5db826){exec(_0x09fd('0x1f'),function(_0x3cf5b5,_0x480d0e,_0x19b60e){logger[_0x09fd('0x18')](_0x480d0e);logger[_0x09fd('0x18')](_0x19b60e);if(_0x3cf5b5){logger[_0x09fd('0x17')](_0x3cf5b5);return _0x5db826['status'](0x1f4)[_0x09fd('0x14')](_0x3cf5b5);}return _0x5db826['status'](0xc8)[_0x09fd('0x14')]({'output':_0x480d0e});});};exports['restart']=function(_0x5841fc,_0x252b07){return pm2[_0x09fd('0x20')]('motion2')['then'](function(_0x3eed87){logger[_0x09fd('0x18')]('pm2\x20restart\x20motion\x20%s',_0x3eed87);return _0x252b07['status'](0xc8)[_0x09fd('0x14')]({'output':_0x09fd('0x21')});})['catch'](function(_0x3cb2b4){logger[_0x09fd('0x17')](_0x3cb2b4);return _0x252b07['status'](0x1f4)['json'](_0x3cb2b4);});};exports[_0x09fd('0x22')]=function(_0x2537ec,_0x57382e){var _0x35bbeb=fs[_0x09fd('0x23')](path[_0x09fd('0x24')](config['root'],'server',_0x09fd('0x22')));var _0x1360d0=[];for(var _0x265792=0x0;_0x265792<_0x35bbeb['length'];_0x265792++){var _0x2de488=_0x35bbeb[_0x265792][_0x09fd('0x25')]('.js','');if(compareVersions(module['exports'][_0x09fd('0x4')],_0x2de488)===-0x1){_0x1360d0['push'](_0x2de488);}}if(_0x1360d0[_0x09fd('0x26')]){var _0x6ccd5=_0x1360d0[_0x09fd('0x27')](compareVersions);var _0x25fd25=new Umzug({'storage':_0x09fd('0x28'),'storageOptions':{'model':db[_0x09fd('0x29')],'modelName':_0x09fd('0x29'),'columnName':_0x09fd('0x4')},'migrations':{'params':[db[_0x09fd('0x28')][_0x09fd('0x2a')](),db[_0x09fd('0x28')][_0x09fd('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x09fd('0x24')](config[_0x09fd('0x2c')],_0x09fd('0x2d'),_0x09fd('0x22')),'pattern':/\.js$/}});_0x25fd25['up']({'migrations':_[_0x09fd('0x2e')](_0x6ccd5,function(_0x566b8f){return _0x566b8f+_0x09fd('0x2f');})})[_0x09fd('0x30')](function(){return _0x57382e['status'](0xc8)[_0x09fd('0x14')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x09fd('0xd')]['version']+_0x09fd('0x31')+_[_0x09fd('0x32')](_0x6ccd5),'migrations':_['join'](_0x6ccd5)});})['catch'](function(_0x515470){if(_0x515470 instanceof db[_0x09fd('0x28')][_0x09fd('0x33')]){return _0x57382e[_0x09fd('0x13')](0xc8)[_0x09fd('0x14')]({'output':_0x09fd('0x34')});}else{return _0x57382e[_0x09fd('0x13')](0x1f4)[_0x09fd('0x14')](_0x515470);}});}else{return _0x57382e[_0x09fd('0x13')](0xc8)[_0x09fd('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xc4cc=['Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','catch','join','server','migrations','length','replace','.js','push','sort','Migration','getQueryInterface','sequelize','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','last','UniqueConstraintError'];(function(_0xc3bac9,_0x4d7226){var _0x1f46fb=function(_0x11a964){while(--_0x11a964){_0xc3bac9['push'](_0xc3bac9['shift']());}};_0x1f46fb(++_0x4d7226);}(_0xc4cc,0x1b1));var _0xcc4c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc4cc[_0x14add3];return _0x4a174f;};'use strict';var Umzug=require(_0xcc4c('0x0'));var path=require(_0xcc4c('0x1'));var fs=require('fs');var _=require(_0xcc4c('0x2'));var pkginfo=require(_0xcc4c('0x3'))(module,_0xcc4c('0x4'));var compareVersions=require(_0xcc4c('0x5'));var exec=require(_0xcc4c('0x6'))[_0xcc4c('0x7')];var db=require(_0xcc4c('0x8'))['db'];var config=require(_0xcc4c('0x9'));var pm2=require(_0xcc4c('0xa'));var logger=require(_0xcc4c('0xb'))('update');var git=require(_0xcc4c('0xc'))(config[_0xcc4c('0xd')]);exports['index']=function(_0xc33053,_0x22a13b){var _0x5c689a={'current':module[_0xcc4c('0xe')][_0xcc4c('0x4')],'phonebar':0x2};if(_0xc33053[_0xcc4c('0xf')]&&_0xc33053[_0xcc4c('0xf')]['latest']){return git[_0xcc4c('0x10')]()[_0xcc4c('0x11')](function(_0x16b3de,_0x1f6c48){_0x5c689a[_0xcc4c('0x12')]=(_0x16b3de?module['exports'][_0xcc4c('0x4')]:_0x1f6c48[_0xcc4c('0x12')])||_0xcc4c('0x13');return _0x22a13b[_0xcc4c('0x14')](0xc8)[_0xcc4c('0x15')](_0x5c689a);});}else{return _0x22a13b['status'](0xc8)[_0xcc4c('0x15')](_0x5c689a);}};exports['fetch']=function(_0x570a75,_0x42e6bb){return git[_0xcc4c('0x10')]([_0xcc4c('0x16'),_0xcc4c('0x17')],function(_0x3f8d9c){if(_0x3f8d9c){logger[_0xcc4c('0x18')](_0x3f8d9c);return _0x42e6bb[_0xcc4c('0x14')](0x1f4)[_0xcc4c('0x15')](_0x3f8d9c);}logger['info'](_0xcc4c('0x19'));return _0x42e6bb['status'](0xc8)[_0xcc4c('0x15')]({'output':_0xcc4c('0x1a')});});};exports[_0xcc4c('0x1b')]=function(_0x43787d,_0x4cb557){return git[_0xcc4c('0x1b')]([_0xcc4c('0x1c'),'FETCH_HEAD'],function(_0x47ab29){if(_0x47ab29){logger[_0xcc4c('0x18')](_0x47ab29);return _0x4cb557[_0xcc4c('0x14')](0x1f4)['json'](_0x47ab29);}logger[_0xcc4c('0x1d')](_0xcc4c('0x1e'));return _0x4cb557[_0xcc4c('0x14')](0xc8)[_0xcc4c('0x15')]({'output':'git\x20reset\x20--hard'});});};exports[_0xcc4c('0x1f')]=function(_0x2ca325,_0x2c83bd){exec(_0xcc4c('0x20'),function(_0x585551,_0x5c3066,_0x3d3531){logger['info'](_0x5c3066);logger[_0xcc4c('0x1d')](_0x3d3531);if(_0x585551){logger[_0xcc4c('0x18')](_0x585551);return _0x2c83bd[_0xcc4c('0x14')](0x1f4)[_0xcc4c('0x15')](_0x585551);}return _0x2c83bd['status'](0xc8)[_0xcc4c('0x15')]({'output':_0x5c3066});});};exports[_0xcc4c('0x21')]=function(_0x3698e6,_0x5553ca){return pm2['restart'](_0xcc4c('0x22'))['then'](function(_0x2ed5e8){logger[_0xcc4c('0x1d')]('pm2\x20restart\x20motion\x20%s',_0x2ed5e8);return _0x5553ca[_0xcc4c('0x14')](0xc8)[_0xcc4c('0x15')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xcc4c('0x23')](function(_0x357283){logger[_0xcc4c('0x18')](_0x357283);return _0x5553ca[_0xcc4c('0x14')](0x1f4)['json'](_0x357283);});};exports['migrations']=function(_0x1cd6f8,_0x44eab9){var _0x4d6a00=fs['readdirSync'](path[_0xcc4c('0x24')](config[_0xcc4c('0xd')],_0xcc4c('0x25'),_0xcc4c('0x26')));var _0x21b83c=[];for(var _0x11c2e2=0x0;_0x11c2e2<_0x4d6a00[_0xcc4c('0x27')];_0x11c2e2++){var _0x2e3b8e=_0x4d6a00[_0x11c2e2][_0xcc4c('0x28')](_0xcc4c('0x29'),'');if(compareVersions(module[_0xcc4c('0xe')][_0xcc4c('0x4')],_0x2e3b8e)===-0x1){_0x21b83c[_0xcc4c('0x2a')](_0x2e3b8e);}}if(_0x21b83c['length']){var _0x5afb23=_0x21b83c[_0xcc4c('0x2b')](compareVersions);var _0x409896=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xcc4c('0x2c')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db['sequelize'][_0xcc4c('0x2d')](),db[_0xcc4c('0x2e')][_0xcc4c('0x2f')],function(){throw new Error(_0xcc4c('0x30'));}],'path':path[_0xcc4c('0x24')](config[_0xcc4c('0xd')],_0xcc4c('0x25'),_0xcc4c('0x26')),'pattern':/\.js$/}});_0x409896['up']({'migrations':_[_0xcc4c('0x31')](_0x5afb23,function(_0x12f304){return _0x12f304+'.js';})})['then'](function(){return _0x44eab9[_0xcc4c('0x14')](0xc8)[_0xcc4c('0x15')]({'output':_0xcc4c('0x32')+module[_0xcc4c('0xe')][_0xcc4c('0x4')]+'\x20to\x20'+_[_0xcc4c('0x33')](_0x5afb23),'migrations':_[_0xcc4c('0x24')](_0x5afb23)});})[_0xcc4c('0x23')](function(_0x40eac1){if(_0x40eac1 instanceof db[_0xcc4c('0x2e')][_0xcc4c('0x34')]){return _0x44eab9[_0xcc4c('0x14')](0xc8)[_0xcc4c('0x15')]({'output':_0xcc4c('0x35')});}else{return _0x44eab9['status'](0x1f4)['json'](_0x40eac1);}});}else{return _0x44eab9['status'](0xc8)['json']({'output':_0xcc4c('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 0ab58a6..6e68132 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 _0x52dc=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','exports','multer','util'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x52dc,0x1cc));var _0xc52d=function(_0x1fa38e,_0x44f0a8){_0x1fa38e=_0x1fa38e-0x0;var _0x56a96c=_0x52dc[_0x1fa38e];return _0x56a96c;};'use strict';var multer=require(_0xc52d('0x0'));var util=require(_0xc52d('0x1'));var path=require(_0xc52d('0x2'));var timeout=require(_0xc52d('0x3'));var express=require('express');var router=express[_0xc52d('0x4')]();var fs_extra=require(_0xc52d('0x5'));var auth=require(_0xc52d('0x6'));var interaction=require(_0xc52d('0x7'));var config=require(_0xc52d('0x8'));var controller=require(_0xc52d('0x9'));router[_0xc52d('0xa')]('/',auth[_0xc52d('0xb')](),controller[_0xc52d('0xc')]);router[_0xc52d('0xa')]('/describe',auth[_0xc52d('0xb')](),controller[_0xc52d('0xd')]);router['get'](_0xc52d('0xe'),auth[_0xc52d('0xb')](),controller[_0xc52d('0xf')]);router['post']('/',auth[_0xc52d('0xb')](),controller['create']);router[_0xc52d('0x10')](_0xc52d('0xe'),auth[_0xc52d('0xb')](),controller[_0xc52d('0x11')]);router[_0xc52d('0x12')](_0xc52d('0xe'),auth[_0xc52d('0xb')](),controller[_0xc52d('0x13')]);module[_0xc52d('0x14')]=router; \ No newline at end of file +var _0xb062=['/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x1df89a,_0x3949eb){var _0x705b51=function(_0x2c6a97){while(--_0x2c6a97){_0x1df89a['push'](_0x1df89a['shift']());}};_0x705b51(++_0x3949eb);}(_0xb062,0x9e));var _0x2b06=function(_0x14dae0,_0x2d9ee2){_0x14dae0=_0x14dae0-0x0;var _0x13e3bd=_0xb062[_0x14dae0];return _0x13e3bd;};'use strict';var multer=require(_0x2b06('0x0'));var util=require(_0x2b06('0x1'));var path=require(_0x2b06('0x2'));var timeout=require('connect-timeout');var express=require(_0x2b06('0x3'));var router=express[_0x2b06('0x4')]();var fs_extra=require(_0x2b06('0x5'));var auth=require(_0x2b06('0x6'));var interaction=require(_0x2b06('0x7'));var config=require(_0x2b06('0x8'));var controller=require(_0x2b06('0x9'));router[_0x2b06('0xa')]('/',auth[_0x2b06('0xb')](),controller[_0x2b06('0xc')]);router[_0x2b06('0xa')](_0x2b06('0xd'),auth['isAuthenticated'](),controller[_0x2b06('0xe')]);router[_0x2b06('0xa')]('/:id',auth[_0x2b06('0xb')](),controller[_0x2b06('0xf')]);router[_0x2b06('0x10')]('/',auth['isAuthenticated'](),controller[_0x2b06('0x11')]);router['put'](_0x2b06('0x12'),auth['isAuthenticated'](),controller[_0x2b06('0x13')]);router[_0x2b06('0x14')](_0x2b06('0x12'),auth[_0x2b06('0xb')](),controller[_0x2b06('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index db93678..7d039c4 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 _0x9158=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0xc814ba,_0xc2b88c){var _0xb42a0e=function(_0x66051c){while(--_0x66051c){_0xc814ba['push'](_0xc814ba['shift']());}};_0xb42a0e(++_0xc2b88c);}(_0x9158,0x16e));var _0x8915=function(_0x1c6f0d,_0x229cc1){_0x1c6f0d=_0x1c6f0d-0x0;var _0x541538=_0x9158[_0x1c6f0d];return _0x541538;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'type':{'type':Sequelize[_0x8915('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8915('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8915('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x8915('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8915('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x8915('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x8915('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8915('0x3')]},'holdtime':{'type':Sequelize[_0x8915('0x4')]},'agentcomplete':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8915('0x4')]},'agentacw':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8915('0x4')]},'reason':{'type':Sequelize[_0x8915('0x2')]},'lastevent':{'type':Sequelize[_0x8915('0x2')]},'channel':{'type':Sequelize[_0x8915('0x2')]},'channelstate':{'type':Sequelize[_0x8915('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8915('0x2')]},'language':{'type':Sequelize[_0x8915('0x2')]},'accountcode':{'type':Sequelize[_0x8915('0x2')]},'context':{'type':Sequelize[_0x8915('0x2')]},'exten':{'type':Sequelize[_0x8915('0x2')]},'priority':{'type':Sequelize[_0x8915('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8915('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8915('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x8915('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x8915('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x8915('0x2')]},'destcontext':{'type':Sequelize[_0x8915('0x2')]},'destexten':{'type':Sequelize[_0x8915('0x2')]},'destpriority':{'type':Sequelize[_0x8915('0x2')]},'destuniqueid':{'type':Sequelize[_0x8915('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8915('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x8915('0x2')]},'transfer':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8915('0x2')],'comment':_0x8915('0x6')},'transferexten':{'type':Sequelize[_0x8915('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x8915('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2c91=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2c91,0x158));var _0x12c9=function(_0x45045a,_0x206a2f){_0x45045a=_0x45045a-0x0;var _0x38df21=_0x2c91[_0x45045a];return _0x38df21;};'use strict';var Sequelize=require(_0x12c9('0x0'));module[_0x12c9('0x1')]={'type':{'type':Sequelize[_0x12c9('0x2')]},'uniqueid':{'type':Sequelize[_0x12c9('0x2')]},'calleridnum':{'type':Sequelize[_0x12c9('0x2')]},'calleridname':{'type':Sequelize[_0x12c9('0x2')]},'queue':{'type':Sequelize[_0x12c9('0x2')]},'interface':{'type':Sequelize[_0x12c9('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x12c9('0x3')]},'agentconnectAt':{'type':Sequelize[_0x12c9('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x12c9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x12c9('0x3')]},'agentdumpAt':{'type':Sequelize[_0x12c9('0x3')]},'holdtime':{'type':Sequelize[_0x12c9('0x4')]},'agentcomplete':{'type':Sequelize[_0x12c9('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x12c9('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x12c9('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x12c9('0x4')]},'reason':{'type':Sequelize[_0x12c9('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x12c9('0x2')]},'channelstate':{'type':Sequelize[_0x12c9('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x12c9('0x2')]},'connectedlinename':{'type':Sequelize[_0x12c9('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x12c9('0x2')]},'context':{'type':Sequelize[_0x12c9('0x2')]},'exten':{'type':Sequelize[_0x12c9('0x2')]},'priority':{'type':Sequelize[_0x12c9('0x2')]},'destchannel':{'type':Sequelize[_0x12c9('0x2')]},'destchannelstate':{'type':Sequelize[_0x12c9('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x12c9('0x2')]},'destcalleridname':{'type':Sequelize[_0x12c9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x12c9('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x12c9('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x12c9('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x12c9('0x2')]},'transfer':{'type':Sequelize[_0x12c9('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x12c9('0x2')],'comment':_0x12c9('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x12c9('0x2')]},'agententerreason':{'type':Sequelize[_0x12c9('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 f05de15..e96c6f9 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(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 54106fd..0ad6e01 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 _0x975f=['destuniqueid','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','uniqueid'];(function(_0x270bd2,_0x14ec0a){var _0x4bb802=function(_0x45f05c){while(--_0x45f05c){_0x270bd2['push'](_0x270bd2['shift']());}};_0x4bb802(++_0x14ec0a);}(_0x975f,0x109));var _0xf975=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0x975f[_0x545b71];return _0x26e587;};'use strict';var _=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf975('0x2'));var BPromise=require(_0xf975('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf975('0x4'));var rimraf=require(_0xf975('0x5'));var config=require(_0xf975('0x6'));var attributes=require(_0xf975('0x7'));module['exports']=function(_0x356f71,_0x5a9aca){return _0x356f71[_0xf975('0x8')](_0xf975('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xf975('0xa'),_0xf975('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x826a=['request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','api','bluebird'];(function(_0x5c689f,_0x25b62c){var _0x36ffda=function(_0xfb8e16){while(--_0xfb8e16){_0x5c689f['push'](_0x5c689f['shift']());}};_0x36ffda(++_0x25b62c);}(_0x826a,0x1aa));var _0xa826=function(_0x73a705,_0x37bfae){_0x73a705=_0x73a705-0x0;var _0x189b04=_0x826a[_0x73a705];return _0x189b04;};'use strict';var _=require('lodash');var util=require(_0xa826('0x0'));var logger=require('../../config/logger')(_0xa826('0x1'));var moment=require('moment');var BPromise=require(_0xa826('0x2'));var rp=require(_0xa826('0x3'));var fs=require('fs');var path=require(_0xa826('0x4'));var rimraf=require(_0xa826('0x5'));var config=require('../../config/environment');var attributes=require(_0xa826('0x6'));module[_0xa826('0x7')]=function(_0x3929d4,_0x34327b){return _0x3929d4[_0xa826('0x8')](_0xa826('0x9'),attributes,{'tableName':_0xa826('0xa'),'paranoid':![],'indexes':[{'fields':[_0xa826('0xb'),_0xa826('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 affced7..efbbca7 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 _0x8245=['update','where','attributes','limit','UpdateVoiceAgentReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','catch'];(function(_0x576242,_0x142558){var _0x3a2b03=function(_0x35fe25){while(--_0x35fe25){_0x576242['push'](_0x576242['shift']());}};_0x3a2b03(++_0x142558);}(_0x8245,0x1d3));var _0x5824=function(_0x2ad239,_0x1f4149){_0x2ad239=_0x2ad239-0x0;var _0x310638=_0x8245[_0x2ad239];return _0x310638;};'use strict';var _=require('lodash');var util=require(_0x5824('0x0'));var moment=require(_0x5824('0x1'));var BPromise=require(_0x5824('0x2'));var rs=require(_0x5824('0x3'));var fs=require('fs');var Redis=require(_0x5824('0x4'));var db=require(_0x5824('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5824('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5824('0x7')][_0x5824('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16ae7f,_0x13dc75,_0x58cd8a){return new BPromise(function(_0x23853c,_0xc93d71){return client[_0x5824('0x9')](_0x16ae7f,_0x58cd8a)[_0x5824('0xa')](function(_0x45a53f){logger['info'](_0x5824('0xb'),_0x13dc75,'request\x20sent');logger[_0x5824('0xc')](_0x5824('0xd'),_0x13dc75,_0x5824('0xe'),JSON['stringify'](_0x45a53f));if(_0x45a53f[_0x5824('0xf')]){if(_0x45a53f['error'][_0x5824('0x10')]===0x1f4){logger[_0x5824('0xf')](_0x5824('0xb'),_0x13dc75,_0x45a53f[_0x5824('0xf')][_0x5824('0x11')]);return _0xc93d71(_0x45a53f[_0x5824('0xf')][_0x5824('0x11')]);}logger[_0x5824('0xf')](_0x5824('0xb'),_0x13dc75,_0x45a53f['error'][_0x5824('0x11')]);return _0x23853c(_0x45a53f[_0x5824('0xf')][_0x5824('0x11')]);}else{logger[_0x5824('0x12')](_0x5824('0xb'),_0x13dc75,_0x5824('0xe'));_0x23853c(_0x45a53f[_0x5824('0x13')][_0x5824('0x11')]);}})['catch'](function(_0x52b122){logger['error'](_0x5824('0xb'),_0x13dc75,_0x52b122);_0xc93d71(_0x52b122);});});}exports[_0x5824('0x14')]=function(_0x5526cf){var _0x21be70=this;return new Promise(function(_0x2968ae,_0x438de6){return db[_0x5824('0x15')][_0x5824('0x16')](_0x5526cf[_0x5824('0x17')],{'raw':_0x5526cf[_0x5824('0x18')]?_0x5526cf[_0x5824('0x18')][_0x5824('0x19')]===undefined?!![]:![]:!![]})[_0x5824('0xa')](function(_0xe1950b){logger[_0x5824('0x12')](_0x5824('0x14'),_0x5526cf);logger[_0x5824('0xc')]('CreateVoiceAgentReport',_0x5526cf,JSON[_0x5824('0x1a')](_0xe1950b));_0x2968ae(_0xe1950b);})[_0x5824('0x1b')](function(_0x58b8db){logger['error'](_0x5824('0x14'),_0x58b8db[_0x5824('0x11')],_0x5526cf);_0x438de6(_0x21be70[_0x5824('0xf')](0x1f4,_0x58b8db[_0x5824('0x11')]));});});};exports['UpdateVoiceAgentReport']=function(_0x63354e){var _0x40d12d=this;return new Promise(function(_0x2d971c,_0x5e38a1){return db[_0x5824('0x15')][_0x5824('0x1c')](_0x63354e['body'],{'raw':_0x63354e[_0x5824('0x18')]?_0x63354e['options'][_0x5824('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x63354e['options']?_0x63354e[_0x5824('0x18')][_0x5824('0x1d')]||null:null,'attributes':_0x63354e[_0x5824('0x18')]?_0x63354e[_0x5824('0x18')][_0x5824('0x1e')]||null:null,'limit':_0x63354e[_0x5824('0x18')]?_0x63354e[_0x5824('0x18')][_0x5824('0x1f')]||null:null})[_0x5824('0xa')](function(_0x232f88){logger[_0x5824('0x12')](_0x5824('0x20'),_0x63354e);logger['debug'](_0x5824('0x20'),_0x63354e,JSON[_0x5824('0x1a')](_0x232f88));_0x2d971c(_0x232f88);})['catch'](function(_0x40c50e){logger[_0x5824('0xf')](_0x5824('0x20'),_0x40c50e[_0x5824('0x11')],_0x63354e);_0x5e38a1(_0x40d12d['error'](0x1f4,_0x40c50e[_0x5824('0x11')]));});});}; \ No newline at end of file +var _0x45a8=['error','code','message','catch','CreateVoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','attributes','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x45a8,0x1b0));var _0x845a=function(_0x573bbf,_0x77ec64){_0x573bbf=_0x573bbf-0x0;var _0x5cb856=_0x45a8[_0x573bbf];return _0x5cb856;};'use strict';var _=require('lodash');var util=require(_0x845a('0x0'));var moment=require('moment');var BPromise=require(_0x845a('0x1'));var rs=require(_0x845a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x845a('0x3'));var logger=require(_0x845a('0x4'))(_0x845a('0x5'));var config=require(_0x845a('0x6'));var jayson=require(_0x845a('0x7'));var client=jayson[_0x845a('0x8')][_0x845a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46363b,_0x10ab40,_0x86dea1){return new BPromise(function(_0xdc9eb3,_0x4576e3){return client[_0x845a('0xa')](_0x46363b,_0x86dea1)[_0x845a('0xb')](function(_0x5e54a1){logger[_0x845a('0xc')](_0x845a('0xd'),_0x10ab40,_0x845a('0xe'));logger[_0x845a('0xf')](_0x845a('0x10'),_0x10ab40,_0x845a('0xe'),JSON[_0x845a('0x11')](_0x5e54a1));if(_0x5e54a1[_0x845a('0x12')]){if(_0x5e54a1[_0x845a('0x12')][_0x845a('0x13')]===0x1f4){logger[_0x845a('0x12')](_0x845a('0xd'),_0x10ab40,_0x5e54a1[_0x845a('0x12')][_0x845a('0x14')]);return _0x4576e3(_0x5e54a1['error'][_0x845a('0x14')]);}logger[_0x845a('0x12')](_0x845a('0xd'),_0x10ab40,_0x5e54a1[_0x845a('0x12')][_0x845a('0x14')]);return _0xdc9eb3(_0x5e54a1[_0x845a('0x12')]['message']);}else{logger['info'](_0x845a('0xd'),_0x10ab40,'request\x20sent');_0xdc9eb3(_0x5e54a1['result'][_0x845a('0x14')]);}})[_0x845a('0x15')](function(_0x2c788b){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x10ab40,_0x2c788b);_0x4576e3(_0x2c788b);});});}exports[_0x845a('0x16')]=function(_0x2ea4ae){var _0x160c30=this;return new Promise(function(_0x31c87a,_0x14c0c0){return db['VoiceAgentReport'][_0x845a('0x17')](_0x2ea4ae[_0x845a('0x18')],{'raw':_0x2ea4ae[_0x845a('0x19')]?_0x2ea4ae[_0x845a('0x19')][_0x845a('0x1a')]===undefined?!![]:![]:!![]})[_0x845a('0xb')](function(_0x52c909){logger[_0x845a('0xc')](_0x845a('0x16'),_0x2ea4ae);logger[_0x845a('0xf')](_0x845a('0x16'),_0x2ea4ae,JSON[_0x845a('0x11')](_0x52c909));_0x31c87a(_0x52c909);})[_0x845a('0x15')](function(_0x5438a6){logger['error'](_0x845a('0x16'),_0x5438a6[_0x845a('0x14')],_0x2ea4ae);_0x14c0c0(_0x160c30[_0x845a('0x12')](0x1f4,_0x5438a6[_0x845a('0x14')]));});});};exports[_0x845a('0x1b')]=function(_0x55fc75){var _0x79d2e2=this;return new Promise(function(_0x46ad24,_0x51ab48){return db['VoiceAgentReport'][_0x845a('0x1c')](_0x55fc75[_0x845a('0x18')],{'raw':_0x55fc75[_0x845a('0x19')]?_0x55fc75['options'][_0x845a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55fc75[_0x845a('0x19')]?_0x55fc75[_0x845a('0x19')]['where']||null:null,'attributes':_0x55fc75[_0x845a('0x19')]?_0x55fc75[_0x845a('0x19')][_0x845a('0x1d')]||null:null,'limit':_0x55fc75['options']?_0x55fc75[_0x845a('0x19')]['limit']||null:null})['then'](function(_0x597e0b){logger[_0x845a('0xc')]('UpdateVoiceAgentReport',_0x55fc75);logger['debug'](_0x845a('0x1b'),_0x55fc75,JSON[_0x845a('0x11')](_0x597e0b));_0x46ad24(_0x597e0b);})[_0x845a('0x15')](function(_0x6afd88){logger['error'](_0x845a('0x1b'),_0x6afd88[_0x845a('0x14')],_0x55fc75);_0x51ab48(_0x79d2e2['error'](0x1f4,_0x6afd88['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 19bacaf..e45f940 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 _0x8ef6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x321ad2,_0x5e9d4d){var _0x1bb26e=function(_0x392b17){while(--_0x392b17){_0x321ad2['push'](_0x321ad2['shift']());}};_0x1bb26e(++_0x5e9d4d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x70bf08,_0x24ad62){_0x70bf08=_0x70bf08-0x0;var _0x5e7590=_0x8ef6[_0x70bf08];return _0x5e7590;};'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('0xf')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')]('/:id',auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);module[_0x68ef('0x15')]=router; \ No newline at end of file +var _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0xca9e,0x136));var _0xeca9=function(_0x39e9fc,_0x28cc34){_0x39e9fc=_0x39e9fc-0x0;var _0x54e487=_0xca9e[_0x39e9fc];return _0x54e487;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 31c6bec..7188901 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 _0x4c41=['outbound','inbound-fax','dialer','STRING','TEXT','DATE','INTEGER','exports'];(function(_0x4832d9,_0x294c58){var _0x328e6a=function(_0x179b53){while(--_0x179b53){_0x4832d9['push'](_0x4832d9['shift']());}};_0x328e6a(++_0x294c58);}(_0x4c41,0xf7));var _0x14c4=function(_0x5bfe40,_0x495331){_0x5bfe40=_0x5bfe40-0x0;var _0x3f89d4=_0x4c41[_0x5bfe40];return _0x3f89d4;};'use strict';var Sequelize=require('sequelize');module[_0x14c4('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('inbound','internal',_0x14c4('0x1'),_0x14c4('0x2'),'outbound-fax',_0x14c4('0x3'))},'tag':{'type':Sequelize[_0x14c4('0x4')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x14c4('0x4')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x14c4('0x4')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x14c4('0x5')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x14c4('0x6')]},'answertime':{'type':Sequelize[_0x14c4('0x6')]},'endtime':{'type':Sequelize[_0x14c4('0x6')]},'duration':{'type':Sequelize[_0x14c4('0x7')]},'billableseconds':{'type':Sequelize[_0x14c4('0x7')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x14c4('0x4')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x14c4('0x4')]},'userDisposition':{'type':Sequelize[_0x14c4('0x4')]},'userSecondDisposition':{'type':Sequelize[_0x14c4('0x4')]},'userThirdDisposition':{'type':Sequelize[_0x14c4('0x4')]},'note':{'type':Sequelize[_0x14c4('0x4')]},'prefix':{'type':Sequelize[_0x14c4('0x4')]},'routeid':{'type':Sequelize[_0x14c4('0x7')]},'sipcallid':{'type':Sequelize[_0x14c4('0x4')]}}; \ No newline at end of file +var _0x3a20=['exports','ENUM','internal','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x71389,_0x2cd452){var _0x4af7e6=function(_0x33c932){while(--_0x33c932){_0x71389['push'](_0x71389['shift']());}};_0x4af7e6(++_0x2cd452);}(_0x3a20,0xd0));var _0x03a2=function(_0x5cdadb,_0x1a8758){_0x5cdadb=_0x5cdadb-0x0;var _0x1a1d89=_0x3a20[_0x5cdadb];return _0x1a1d89;};'use strict';var Sequelize=require('sequelize');module[_0x03a2('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x03a2('0x1')]('inbound',_0x03a2('0x2'),'outbound','inbound-fax','outbound-fax',_0x03a2('0x3'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x03a2('0x4')]},'source':{'type':Sequelize[_0x03a2('0x4')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x03a2('0x4')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x03a2('0x4')]},'destinationchannel':{'type':Sequelize[_0x03a2('0x4')]},'lastapplication':{'type':Sequelize[_0x03a2('0x4')]},'lastdata':{'type':Sequelize[_0x03a2('0x5')]},'starttime':{'type':Sequelize[_0x03a2('0x6')]},'systemanswertime':{'type':Sequelize[_0x03a2('0x6')]},'answertime':{'type':Sequelize[_0x03a2('0x6')]},'endtime':{'type':Sequelize[_0x03a2('0x6')]},'duration':{'type':Sequelize[_0x03a2('0x7')]},'billableseconds':{'type':Sequelize[_0x03a2('0x7')]},'mohtime':{'type':Sequelize[_0x03a2('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x03a2('0x4')]},'amaflags':{'type':Sequelize[_0x03a2('0x4')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x03a2('0x4')]},'userSecondDisposition':{'type':Sequelize[_0x03a2('0x4')]},'userThirdDisposition':{'type':Sequelize[_0x03a2('0x4')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x03a2('0x4')]},'routeid':{'type':Sequelize[_0x03a2('0x7')]},'sipcallid':{'type':Sequelize[_0x03a2('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 91e406c..4ae0752 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0xadb5,0xad));var _0x5adb=function(_0x1e0169,_0x475b3e){_0x1e0169=_0x1e0169-0x0;var _0x31fcbc=_0xadb5[_0x1e0169];return _0x31fcbc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x5670e9,_0x1e3abb){_0x5670e9=_0x5670e9-0x0;var _0x22e139=_0x2032[_0x5670e9];return _0x22e139;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 4cdc04f..2a5bedf 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 _0x3651=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0xd00b06,_0x4fffdd){var _0x490815=function(_0x24bce4){while(--_0x24bce4){_0xd00b06['push'](_0xd00b06['shift']());}};_0x490815(++_0x4fffdd);}(_0x3651,0x160));var _0x1365=function(_0x11a6bd,_0x526e61){_0x11a6bd=_0x11a6bd-0x0;var _0x120525=_0x3651[_0x11a6bd];return _0x120525;};'use strict';var _=require(_0x1365('0x0'));var util=require('util');var logger=require(_0x1365('0x1'))(_0x1365('0x2'));var moment=require('moment');var BPromise=require(_0x1365('0x3'));var rp=require(_0x1365('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1365('0x5'));var config=require('../../config/environment');var attributes=require(_0x1365('0x6'));module[_0x1365('0x7')]=function(_0x7b1590,_0x533756){return _0x7b1590[_0x1365('0x8')](_0x1365('0x9'),attributes,{'tableName':_0x1365('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1809=['../../config/logger','moment','bluebird','request-promise','rimraf','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid','util'];(function(_0x1e080d,_0xdafe08){var _0x219e1a=function(_0x5c3e59){while(--_0x5c3e59){_0x1e080d['push'](_0x1e080d['shift']());}};_0x219e1a(++_0xdafe08);}(_0x1809,0x1cd));var _0x9180=function(_0x2ad086,_0x36f9eb){_0x2ad086=_0x2ad086-0x0;var _0xb6cf14=_0x1809[_0x2ad086];return _0xb6cf14;};'use strict';var _=require('lodash');var util=require(_0x9180('0x0'));var logger=require(_0x9180('0x1'))('api');var moment=require(_0x9180('0x2'));var BPromise=require(_0x9180('0x3'));var rp=require(_0x9180('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9180('0x5'));var config=require('../../config/environment');var attributes=require(_0x9180('0x6'));module[_0x9180('0x7')]=function(_0x46ec76,_0x565127){return _0x46ec76['define'](_0x9180('0x8'),attributes,{'tableName':_0x9180('0x9'),'paranoid':![],'indexes':[{'fields':[_0x9180('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index f65d436..b21589a 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 _0xdd99=['request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','catch','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0x22fb72,_0x505bea){var _0x44c528=function(_0x4d0f14){while(--_0x4d0f14){_0x22fb72['push'](_0x22fb72['shift']());}};_0x44c528(++_0x505bea);}(_0xdd99,0x130));var _0x9dd9=function(_0x391a41,_0x343c7f){_0x391a41=_0x391a41-0x0;var _0x99e12=_0xdd99[_0x391a41];return _0x99e12;};'use strict';var _=require(_0x9dd9('0x0'));var util=require('util');var moment=require(_0x9dd9('0x1'));var BPromise=require(_0x9dd9('0x2'));var rs=require(_0x9dd9('0x3'));var fs=require('fs');var Redis=require(_0x9dd9('0x4'));var db=require(_0x9dd9('0x5'))['db'];var utils=require(_0x9dd9('0x6'));var logger=require(_0x9dd9('0x7'))('rpc');var config=require(_0x9dd9('0x8'));var jayson=require(_0x9dd9('0x9'));var client=jayson['client'][_0x9dd9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xadca7d,_0x32546b,_0x43815e){return new BPromise(function(_0x71236,_0x1c6de3){return client[_0x9dd9('0xb')](_0xadca7d,_0x43815e)[_0x9dd9('0xc')](function(_0x4c402f){logger[_0x9dd9('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x32546b,'request\x20sent');logger[_0x9dd9('0xe')](_0x9dd9('0xf'),_0x32546b,_0x9dd9('0x10'),JSON[_0x9dd9('0x11')](_0x4c402f));if(_0x4c402f[_0x9dd9('0x12')]){if(_0x4c402f[_0x9dd9('0x12')][_0x9dd9('0x13')]===0x1f4){logger[_0x9dd9('0x12')](_0x9dd9('0x14'),_0x32546b,_0x4c402f[_0x9dd9('0x12')][_0x9dd9('0x15')]);return _0x1c6de3(_0x4c402f[_0x9dd9('0x12')][_0x9dd9('0x15')]);}logger[_0x9dd9('0x12')](_0x9dd9('0x14'),_0x32546b,_0x4c402f['error'][_0x9dd9('0x15')]);return _0x71236(_0x4c402f[_0x9dd9('0x12')][_0x9dd9('0x15')]);}else{logger[_0x9dd9('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x32546b,_0x9dd9('0x10'));_0x71236(_0x4c402f[_0x9dd9('0x16')][_0x9dd9('0x15')]);}})['catch'](function(_0x1bb228){logger[_0x9dd9('0x12')](_0x9dd9('0x14'),_0x32546b,_0x1bb228);_0x1c6de3(_0x1bb228);});});}exports[_0x9dd9('0x17')]=function(_0x23d488){var _0x46ae2b=this;return new Promise(function(_0x2531f3,_0x4431e6){return db[_0x9dd9('0x18')][_0x9dd9('0x19')]({'raw':_0x23d488[_0x9dd9('0x1a')]?_0x23d488[_0x9dd9('0x1a')][_0x9dd9('0x1b')]===undefined?!![]:![]:!![],'where':_0x23d488['options']?_0x23d488[_0x9dd9('0x1a')][_0x9dd9('0x1c')]||null:null,'attributes':_0x23d488[_0x9dd9('0x1a')]?_0x23d488['options'][_0x9dd9('0x1d')]||null:null,'limit':_0x23d488[_0x9dd9('0x1a')]?_0x23d488[_0x9dd9('0x1a')][_0x9dd9('0x1e')]||null:null,'include':_0x23d488[_0x9dd9('0x1a')]?_0x23d488['options']['include']?_[_0x9dd9('0x1f')](_0x23d488[_0x9dd9('0x1a')][_0x9dd9('0x20')],function(_0x4b742d){return{'model':db[_0x4b742d[_0x9dd9('0x21')]],'as':_0x4b742d['as'],'attributes':_0x4b742d['attributes'],'include':_0x4b742d[_0x9dd9('0x20')]?_[_0x9dd9('0x1f')](_0x4b742d['include'],function(_0x1718b5){return{'model':db[_0x1718b5['model']],'as':_0x1718b5['as'],'attributes':_0x1718b5[_0x9dd9('0x1d')],'include':_0x1718b5[_0x9dd9('0x20')]?_[_0x9dd9('0x1f')](_0x1718b5[_0x9dd9('0x20')],function(_0x1c08f3){return{'model':db[_0x1c08f3[_0x9dd9('0x21')]],'as':_0x1c08f3['as'],'attributes':_0x1c08f3[_0x9dd9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9dd9('0xc')](function(_0x508f20){logger['info']('GetVoiceCallReport',_0x23d488);logger[_0x9dd9('0xe')](_0x9dd9('0x17'),_0x23d488,JSON[_0x9dd9('0x11')](_0x508f20));_0x2531f3(_0x508f20);})[_0x9dd9('0x22')](function(_0x366beb){logger[_0x9dd9('0x12')](_0x9dd9('0x17'),_0x366beb[_0x9dd9('0x15')],_0x23d488);_0x4431e6(_0x46ae2b[_0x9dd9('0x12')](0x1f4,_0x366beb[_0x9dd9('0x15')]));});});};exports[_0x9dd9('0x23')]=function(_0x79b916){var _0x8bdd47=this;return new Promise(function(_0x4a5ad3,_0x251e24){return db[_0x9dd9('0x18')][_0x9dd9('0x24')](_0x79b916[_0x9dd9('0x25')],{'raw':_0x79b916[_0x9dd9('0x1a')]?_0x79b916['options'][_0x9dd9('0x1b')]===undefined?!![]:![]:!![]})[_0x9dd9('0xc')](function(_0x225516){logger[_0x9dd9('0xd')](_0x9dd9('0x23'),_0x79b916);logger[_0x9dd9('0xe')]('CreateVoiceCallReport',_0x79b916,JSON[_0x9dd9('0x11')](_0x225516));_0x4a5ad3(_0x225516);})['catch'](function(_0xaea276){logger[_0x9dd9('0x12')](_0x9dd9('0x23'),_0xaea276[_0x9dd9('0x15')],_0x79b916);_0x251e24(_0x8bdd47[_0x9dd9('0x12')](0x1f4,_0xaea276['message']));});});};exports['UpdateVoiceCallReport']=function(_0x464c51){var _0x5ece01=this;return new Promise(function(_0xedea05,_0x3d036a){return db[_0x9dd9('0x18')][_0x9dd9('0x26')](_0x464c51[_0x9dd9('0x25')],{'raw':_0x464c51[_0x9dd9('0x1a')]?_0x464c51[_0x9dd9('0x1a')][_0x9dd9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x464c51[_0x9dd9('0x1a')]?_0x464c51['options'][_0x9dd9('0x1c')]||null:null,'attributes':_0x464c51[_0x9dd9('0x1a')]?_0x464c51['options'][_0x9dd9('0x1d')]||null:null,'limit':_0x464c51[_0x9dd9('0x1a')]?_0x464c51['options']['limit']||null:null})['then'](function(_0x3f4b0a){logger[_0x9dd9('0xd')](_0x9dd9('0x27'),_0x464c51);logger['debug'](_0x9dd9('0x27'),_0x464c51,JSON[_0x9dd9('0x11')](_0x3f4b0a));_0xedea05(_0x3f4b0a);})['catch'](function(_0x2915c4){logger[_0x9dd9('0x12')](_0x9dd9('0x27'),_0x2915c4['message'],_0x464c51);_0x3d036a(_0x5ece01[_0x9dd9('0x12')](0x1f4,_0x2915c4[_0x9dd9('0x15')]));});});}; \ No newline at end of file +var _0x04c0=['UpdateVoiceCallReport','update','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','raw','limit','include','model','attributes','map','GetVoiceCallReport','debug','body','CreateVoiceCallReport'];(function(_0x2e11f4,_0x48eb5c){var _0x489000=function(_0x299e6e){while(--_0x299e6e){_0x2e11f4['push'](_0x2e11f4['shift']());}};_0x489000(++_0x48eb5c);}(_0x04c0,0x6c));var _0x004c=function(_0x38e1ad,_0x3b8c69){_0x38e1ad=_0x38e1ad-0x0;var _0x373ffc=_0x04c0[_0x38e1ad];return _0x373ffc;};'use strict';var _=require(_0x004c('0x0'));var util=require('util');var moment=require(_0x004c('0x1'));var BPromise=require('bluebird');var rs=require(_0x004c('0x2'));var fs=require('fs');var Redis=require(_0x004c('0x3'));var db=require(_0x004c('0x4'))['db'];var utils=require(_0x004c('0x5'));var logger=require(_0x004c('0x6'))(_0x004c('0x7'));var config=require('../../config/environment');var jayson=require(_0x004c('0x8'));var client=jayson[_0x004c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7d99,_0x4ef6a9,_0x50c716){return new BPromise(function(_0x3112db,_0x36c46a){return client['request'](_0x3f7d99,_0x50c716)[_0x004c('0xa')](function(_0x196a0a){logger[_0x004c('0xb')](_0x004c('0xc'),_0x4ef6a9,'request\x20sent');logger['debug'](_0x004c('0xd'),_0x4ef6a9,_0x004c('0xe'),JSON[_0x004c('0xf')](_0x196a0a));if(_0x196a0a[_0x004c('0x10')]){if(_0x196a0a[_0x004c('0x10')][_0x004c('0x11')]===0x1f4){logger[_0x004c('0x10')](_0x004c('0xc'),_0x4ef6a9,_0x196a0a[_0x004c('0x10')][_0x004c('0x12')]);return _0x36c46a(_0x196a0a[_0x004c('0x10')][_0x004c('0x12')]);}logger[_0x004c('0x10')](_0x004c('0xc'),_0x4ef6a9,_0x196a0a[_0x004c('0x10')][_0x004c('0x12')]);return _0x3112db(_0x196a0a[_0x004c('0x10')]['message']);}else{logger[_0x004c('0xb')](_0x004c('0xc'),_0x4ef6a9,_0x004c('0xe'));_0x3112db(_0x196a0a['result'][_0x004c('0x12')]);}})[_0x004c('0x13')](function(_0x2c3772){logger[_0x004c('0x10')](_0x004c('0xc'),_0x4ef6a9,_0x2c3772);_0x36c46a(_0x2c3772);});});}exports['GetVoiceCallReport']=function(_0x1a32fa){var _0x122bde=this;return new Promise(function(_0x3cb448,_0xe25df3){return db['VoiceCallReport'][_0x004c('0x14')]({'raw':_0x1a32fa['options']?_0x1a32fa[_0x004c('0x15')][_0x004c('0x16')]===undefined?!![]:![]:!![],'where':_0x1a32fa['options']?_0x1a32fa['options']['where']||null:null,'attributes':_0x1a32fa[_0x004c('0x15')]?_0x1a32fa['options']['attributes']||null:null,'limit':_0x1a32fa['options']?_0x1a32fa[_0x004c('0x15')][_0x004c('0x17')]||null:null,'include':_0x1a32fa[_0x004c('0x15')]?_0x1a32fa[_0x004c('0x15')]['include']?_['map'](_0x1a32fa[_0x004c('0x15')][_0x004c('0x18')],function(_0x135cfd){return{'model':db[_0x135cfd[_0x004c('0x19')]],'as':_0x135cfd['as'],'attributes':_0x135cfd[_0x004c('0x1a')],'include':_0x135cfd['include']?_[_0x004c('0x1b')](_0x135cfd['include'],function(_0x3c3c4d){return{'model':db[_0x3c3c4d['model']],'as':_0x3c3c4d['as'],'attributes':_0x3c3c4d[_0x004c('0x1a')],'include':_0x3c3c4d[_0x004c('0x18')]?_[_0x004c('0x1b')](_0x3c3c4d[_0x004c('0x18')],function(_0x168239){return{'model':db[_0x168239[_0x004c('0x19')]],'as':_0x168239['as'],'attributes':_0x168239['attributes']};}):[]};}):[]};}):[]:[]})[_0x004c('0xa')](function(_0x49c132){logger['info'](_0x004c('0x1c'),_0x1a32fa);logger[_0x004c('0x1d')]('GetVoiceCallReport',_0x1a32fa,JSON[_0x004c('0xf')](_0x49c132));_0x3cb448(_0x49c132);})[_0x004c('0x13')](function(_0x2909f2){logger[_0x004c('0x10')]('GetVoiceCallReport',_0x2909f2[_0x004c('0x12')],_0x1a32fa);_0xe25df3(_0x122bde[_0x004c('0x10')](0x1f4,_0x2909f2[_0x004c('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0xd1f9bc){var _0x16381d=this;return new Promise(function(_0x1a53e6,_0x10b5a3){return db['VoiceCallReport']['create'](_0xd1f9bc[_0x004c('0x1e')],{'raw':_0xd1f9bc[_0x004c('0x15')]?_0xd1f9bc[_0x004c('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x27a58e){logger[_0x004c('0xb')](_0x004c('0x1f'),_0xd1f9bc);logger[_0x004c('0x1d')](_0x004c('0x1f'),_0xd1f9bc,JSON['stringify'](_0x27a58e));_0x1a53e6(_0x27a58e);})[_0x004c('0x13')](function(_0x227378){logger[_0x004c('0x10')](_0x004c('0x1f'),_0x227378[_0x004c('0x12')],_0xd1f9bc);_0x10b5a3(_0x16381d[_0x004c('0x10')](0x1f4,_0x227378[_0x004c('0x12')]));});});};exports[_0x004c('0x20')]=function(_0x1ea68e){var _0x3db15a=this;return new Promise(function(_0x10023e,_0x4b8549){return db['VoiceCallReport'][_0x004c('0x21')](_0x1ea68e['body'],{'raw':_0x1ea68e['options']?_0x1ea68e[_0x004c('0x15')][_0x004c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ea68e[_0x004c('0x15')]?_0x1ea68e[_0x004c('0x15')][_0x004c('0x22')]||null:null,'attributes':_0x1ea68e['options']?_0x1ea68e['options']['attributes']||null:null,'limit':_0x1ea68e[_0x004c('0x15')]?_0x1ea68e[_0x004c('0x15')]['limit']||null:null})['then'](function(_0x418361){logger['info'](_0x004c('0x20'),_0x1ea68e);logger[_0x004c('0x1d')](_0x004c('0x20'),_0x1ea68e,JSON['stringify'](_0x418361));_0x10023e(_0x418361);})['catch'](function(_0x1020f9){logger[_0x004c('0x10')]('UpdateVoiceCallReport',_0x1020f9[_0x004c('0x12')],_0x1ea68e);_0x4b8549(_0x3db15a[_0x004c('0x10')](0x1f4,_0x1020f9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index e5e8699..0702967 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 _0x25ef=['post','create','put','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show'];(function(_0x45e09d,_0x27488f){var _0x416021=function(_0x13c359){while(--_0x13c359){_0x45e09d['push'](_0x45e09d['shift']());}};_0x416021(++_0x27488f);}(_0x25ef,0x124));var _0xf25e=function(_0x218c88,_0x26a132){_0x218c88=_0x218c88-0x0;var _0x76a656=_0x25ef[_0x218c88];return _0x76a656;};'use strict';var multer=require(_0xf25e('0x0'));var util=require(_0xf25e('0x1'));var path=require(_0xf25e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf25e('0x3'));var router=express['Router']();var fs_extra=require(_0xf25e('0x4'));var auth=require(_0xf25e('0x5'));var interaction=require(_0xf25e('0x6'));var config=require(_0xf25e('0x7'));var controller=require(_0xf25e('0x8'));router[_0xf25e('0x9')]('/',auth[_0xf25e('0xa')](),controller[_0xf25e('0xb')]);router[_0xf25e('0x9')](_0xf25e('0xc'),auth[_0xf25e('0xa')](),controller[_0xf25e('0xd')]);router[_0xf25e('0xe')]('/',auth[_0xf25e('0xa')](),controller[_0xf25e('0xf')]);router[_0xf25e('0x10')](_0xf25e('0xc'),auth[_0xf25e('0xa')](),controller['update']);router['delete'](_0xf25e('0xc'),auth[_0xf25e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x53e4=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x38daf8,_0x1f5cae){var _0x1d8093=function(_0x502570){while(--_0x502570){_0x38daf8['push'](_0x38daf8['shift']());}};_0x1d8093(++_0x1f5cae);}(_0x53e4,0xd4));var _0x453e=function(_0x47d6c8,_0x4195c5){_0x47d6c8=_0x47d6c8-0x0;var _0x42e495=_0x53e4[_0x47d6c8];return _0x42e495;};'use strict';var multer=require(_0x453e('0x0'));var util=require(_0x453e('0x1'));var path=require(_0x453e('0x2'));var timeout=require(_0x453e('0x3'));var express=require('express');var router=express[_0x453e('0x4')]();var fs_extra=require(_0x453e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x453e('0x6'));var config=require(_0x453e('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x453e('0x8')]('/',auth[_0x453e('0x9')](),controller[_0x453e('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x453e('0xb')]);router[_0x453e('0xc')]('/',auth['isAuthenticated'](),controller[_0x453e('0xd')]);router['put'](_0x453e('0xe'),auth['isAuthenticated'](),controller[_0x453e('0xf')]);router[_0x453e('0x10')](_0x453e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x453e('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 afcfb4f..a18d09d 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 _0xfe22=['join','getDataValue','BOOLEAN','exports','STRING','name','setDataValue','options'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xfe22,0x143));var _0x2fe2=function(_0x58f83d,_0x5c1e4e){_0x58f83d=_0x58f83d-0x0;var _0x4ba667=_0xfe22[_0x58f83d];return _0x4ba667;};'use strict';var Sequelize=require('sequelize');module[_0x2fe2('0x0')]={'name':{'type':Sequelize[_0x2fe2('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x2fe2('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x4db0cc){this[_0x2fe2('0x3')](_0x2fe2('0x4'),_0x4db0cc?_0x4db0cc[_0x2fe2('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x2fe2('0x4'))?this[_0x2fe2('0x6')](_0x2fe2('0x4'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x2fe2('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fe2('0x1')]}}; \ No newline at end of file +var _0x7bd6=['STRING','name','setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x2303d6,_0x596c2b){var _0x126d54=function(_0xfeb17d){while(--_0xfeb17d){_0x2303d6['push'](_0x2303d6['shift']());}};_0x126d54(++_0x596c2b);}(_0x7bd6,0x115));var _0x67bd=function(_0x182648,_0x2a7b01){_0x182648=_0x182648-0x0;var _0x10d106=_0x7bd6[_0x182648];return _0x10d106;};'use strict';var Sequelize=require(_0x67bd('0x0'));module[_0x67bd('0x1')]={'name':{'type':Sequelize[_0x67bd('0x2')]},'prefix':{'type':Sequelize[_0x67bd('0x2')],'unique':_0x67bd('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x67bd('0x2')],'set':function(_0x25ad25){this[_0x67bd('0x4')](_0x67bd('0x5'),_0x25ad25?_0x25ad25['join'](''):[]);},'get':function(){return this[_0x67bd('0x6')](_0x67bd('0x5'))?this[_0x67bd('0x6')](_0x67bd('0x5'))[_0x67bd('0x7')](''):[];}},'auth':{'type':Sequelize[_0x67bd('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x67bd('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x67bd('0x2')]},'description':{'type':Sequelize[_0x67bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 1b693fb..a690bbf 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 _0xd5b6=['order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceChanSpy','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','ChanSpies','UserProfileResource','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xd5b6,0x73));var _0x6d5b=function(_0x4e32e2,_0x1de925){_0x4e32e2=_0x4e32e2-0x0;var _0x5200c2=_0xd5b6[_0x4e32e2];return _0x5200c2;};'use strict';var emlformat=require(_0x6d5b('0x0'));var rimraf=require(_0x6d5b('0x1'));var zipdir=require(_0x6d5b('0x2'));var jsonpatch=require(_0x6d5b('0x3'));var rp=require(_0x6d5b('0x4'));var moment=require(_0x6d5b('0x5'));var BPromise=require(_0x6d5b('0x6'));var Mustache=require(_0x6d5b('0x7'));var util=require('util');var path=require(_0x6d5b('0x8'));var sox=require(_0x6d5b('0x9'));var csv=require(_0x6d5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d5b('0xb'));var _=require(_0x6d5b('0xc'));var squel=require(_0x6d5b('0xd'));var crypto=require(_0x6d5b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6d5b('0xa'));var querystring=require(_0x6d5b('0xf'));var Papa=require(_0x6d5b('0x10'));var Redis=require(_0x6d5b('0x11'));var authService=require(_0x6d5b('0x12'));var qs=require(_0x6d5b('0x13'));var as=require(_0x6d5b('0x14'));var hardwareService=require(_0x6d5b('0x15'));var logger=require(_0x6d5b('0x16'))(_0x6d5b('0x17'));var utils=require(_0x6d5b('0x18'));var config=require(_0x6d5b('0x19'));var licenseUtil=require(_0x6d5b('0x1a'));var db=require(_0x6d5b('0x1b'))['db'];function respondWithStatusCode(_0x267798,_0x1e3c2b){_0x1e3c2b=_0x1e3c2b||0xcc;return function(_0x3c09bb){if(_0x3c09bb){return _0x267798[_0x6d5b('0x1c')](_0x1e3c2b);}return _0x267798['status'](_0x1e3c2b)[_0x6d5b('0x1d')]();};}function respondWithResult(_0x33d3a9,_0xe6fa49){_0xe6fa49=_0xe6fa49||0xc8;return function(_0x3a4ca5){if(_0x3a4ca5){return _0x33d3a9[_0x6d5b('0x1e')](_0xe6fa49)['json'](_0x3a4ca5);}};}function respondWithFilteredResult(_0x3c8078,_0x1e6814){return function(_0x51eb25){if(_0x51eb25){var _0x2baf47=typeof _0x1e6814['offset']===_0x6d5b('0x1f')&&typeof _0x1e6814['limit']==='undefined';var _0x49def6=_0x51eb25[_0x6d5b('0x20')];var _0x1ee9a3=_0x2baf47?0x0:_0x1e6814[_0x6d5b('0x21')];var _0x5e1642=_0x2baf47?_0x51eb25[_0x6d5b('0x20')]:_0x1e6814[_0x6d5b('0x21')]+_0x1e6814[_0x6d5b('0x22')];var _0x51a8d9;if(_0x5e1642>=_0x49def6){_0x5e1642=_0x49def6;_0x51a8d9=0xc8;}else{_0x51a8d9=0xce;}_0x3c8078[_0x6d5b('0x1e')](_0x51a8d9);return _0x3c8078['set'](_0x6d5b('0x23'),_0x1ee9a3+'-'+_0x5e1642+'/'+_0x49def6)[_0x6d5b('0x24')](_0x51eb25);}return null;};}function patchUpdates(_0x26b175){return function(_0x4b67ca){try{jsonpatch[_0x6d5b('0x25')](_0x4b67ca,_0x26b175,!![]);}catch(_0x195fd6){return BPromise[_0x6d5b('0x26')](_0x195fd6);}return _0x4b67ca[_0x6d5b('0x27')]();};}function saveUpdates(_0x672e5b,_0x36d8da){return function(_0x19148d){if(_0x19148d){return _0x19148d[_0x6d5b('0x28')](_0x672e5b)[_0x6d5b('0x29')](function(_0xae55d9){return _0xae55d9;});}return null;};}function removeEntity(_0x1b5261,_0xc1087e){return function(_0x2e3192){if(_0x2e3192){return _0x2e3192[_0x6d5b('0x2a')]()['then'](function(){var _0x38efa7=_0x2e3192['get']({'plain':!![]});var _0x3402bb=_0x6d5b('0x2b');return db[_0x6d5b('0x2c')][_0x6d5b('0x2a')]({'where':{'type':_0x3402bb,'resourceId':_0x38efa7['id']}})[_0x6d5b('0x29')](function(){return _0x2e3192;});})[_0x6d5b('0x29')](function(){_0x1b5261[_0x6d5b('0x1e')](0xcc)[_0x6d5b('0x1d')]();});}};}function handleEntityNotFound(_0x1fac80,_0x2076f1){return function(_0x158584){if(!_0x158584){_0x1fac80[_0x6d5b('0x1c')](0x194);}return _0x158584;};}function handleError(_0x202ec2,_0x5dd460){_0x5dd460=_0x5dd460||0x1f4;return function(_0x597e06){logger['error'](_0x597e06[_0x6d5b('0x2d')]);if(_0x597e06[_0x6d5b('0x2e')]){delete _0x597e06[_0x6d5b('0x2e')];}_0x202ec2['status'](_0x5dd460)[_0x6d5b('0x2f')](_0x597e06);};}exports[_0x6d5b('0x30')]=function(_0x5f3616,_0x47ebfe){var _0x4fce9f={},_0x38befc={},_0x454f7f={'count':0x0,'rows':[]};var _0x2f8503=_[_0x6d5b('0x31')](db['VoiceChanSpy']['rawAttributes'],function(_0x34bc21){return{'name':_0x34bc21['fieldName'],'type':_0x34bc21[_0x6d5b('0x32')][_0x6d5b('0x33')]};});_0x38befc[_0x6d5b('0x34')]=_[_0x6d5b('0x31')](_0x2f8503,_0x6d5b('0x2e'));_0x38befc[_0x6d5b('0x35')]=_[_0x6d5b('0x36')](_0x5f3616[_0x6d5b('0x35')]);_0x38befc['filters']=_[_0x6d5b('0x37')](_0x38befc[_0x6d5b('0x34')],_0x38befc[_0x6d5b('0x35')]);_0x4fce9f[_0x6d5b('0x38')]=_[_0x6d5b('0x37')](_0x38befc[_0x6d5b('0x34')],qs[_0x6d5b('0x39')](_0x5f3616[_0x6d5b('0x35')]['fields']));_0x4fce9f[_0x6d5b('0x38')]=_0x4fce9f[_0x6d5b('0x38')][_0x6d5b('0x3a')]?_0x4fce9f[_0x6d5b('0x38')]:_0x38befc[_0x6d5b('0x34')];if(!_0x5f3616[_0x6d5b('0x35')]['hasOwnProperty']('nolimit')){_0x4fce9f[_0x6d5b('0x22')]=qs[_0x6d5b('0x22')](_0x5f3616[_0x6d5b('0x35')][_0x6d5b('0x22')]);_0x4fce9f[_0x6d5b('0x21')]=qs[_0x6d5b('0x21')](_0x5f3616[_0x6d5b('0x35')][_0x6d5b('0x21')]);}_0x4fce9f[_0x6d5b('0x3b')]=qs[_0x6d5b('0x3c')](_0x5f3616[_0x6d5b('0x35')]['sort']);_0x4fce9f['where']=qs[_0x6d5b('0x3d')](_[_0x6d5b('0x3e')](_0x5f3616[_0x6d5b('0x35')],_0x38befc[_0x6d5b('0x3d')]),_0x2f8503);if(_0x5f3616['query'][_0x6d5b('0x3f')]){_0x4fce9f[_0x6d5b('0x40')]=_[_0x6d5b('0x41')](_0x4fce9f[_0x6d5b('0x40')],{'$or':_[_0x6d5b('0x31')](_0x2f8503,function(_0x371609){if(_0x371609[_0x6d5b('0x32')]!==_0x6d5b('0x42')){var _0x40ac5c={};_0x40ac5c[_0x371609[_0x6d5b('0x2e')]]={'$like':'%'+_0x5f3616[_0x6d5b('0x35')][_0x6d5b('0x3f')]+'%'};return _0x40ac5c;}})});}_0x4fce9f=_[_0x6d5b('0x41')]({},_0x4fce9f,_0x5f3616['options']);var _0x5ae3e4={'where':_0x4fce9f[_0x6d5b('0x40')]};return db[_0x6d5b('0x43')][_0x6d5b('0x20')](_0x5ae3e4)[_0x6d5b('0x29')](function(_0x43ecaf){_0x454f7f[_0x6d5b('0x20')]=_0x43ecaf;if(_0x5f3616[_0x6d5b('0x35')][_0x6d5b('0x44')]){_0x4fce9f[_0x6d5b('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x6d5b('0x46')](_0x4fce9f);})['then'](function(_0x10fc3c){_0x454f7f['rows']=_0x10fc3c;return _0x454f7f;})[_0x6d5b('0x29')](respondWithFilteredResult(_0x47ebfe,_0x4fce9f))[_0x6d5b('0x47')](handleError(_0x47ebfe,null));};exports[_0x6d5b('0x48')]=function(_0x5b1d2c,_0x5756ca){var _0x33894c={'raw':![],'where':{'id':_0x5b1d2c[_0x6d5b('0x49')]['id']}},_0x5e8ab2={};_0x5e8ab2[_0x6d5b('0x34')]=_[_0x6d5b('0x36')](db['VoiceChanSpy'][_0x6d5b('0x4a')]);_0x5e8ab2['query']=_[_0x6d5b('0x36')](_0x5b1d2c[_0x6d5b('0x35')]);_0x5e8ab2[_0x6d5b('0x3d')]=_['intersection'](_0x5e8ab2['model'],_0x5e8ab2['query']);_0x33894c['attributes']=_['intersection'](_0x5e8ab2[_0x6d5b('0x34')],qs[_0x6d5b('0x39')](_0x5b1d2c['query'][_0x6d5b('0x39')]));_0x33894c[_0x6d5b('0x38')]=_0x33894c[_0x6d5b('0x38')][_0x6d5b('0x3a')]?_0x33894c[_0x6d5b('0x38')]:_0x5e8ab2[_0x6d5b('0x34')];if(_0x5b1d2c[_0x6d5b('0x35')][_0x6d5b('0x44')]){_0x33894c[_0x6d5b('0x45')]=[{'all':!![]}];}_0x33894c=_['merge']({},_0x33894c,_0x5b1d2c[_0x6d5b('0x4b')]);return db[_0x6d5b('0x43')][_0x6d5b('0x4c')](_0x33894c)[_0x6d5b('0x29')](handleEntityNotFound(_0x5756ca,null))[_0x6d5b('0x29')](respondWithResult(_0x5756ca,null))[_0x6d5b('0x47')](handleError(_0x5756ca,null));};exports[_0x6d5b('0x4d')]=function(_0x1b543f,_0x72479c){return db[_0x6d5b('0x43')][_0x6d5b('0x4d')](_0x1b543f['body'],{})['then'](function(_0x3dfc35){var _0x3245b8=_0x1b543f[_0x6d5b('0x4e')][_0x6d5b('0x4f')]({'plain':!![]});if(!_0x3245b8)throw new Error(_0x6d5b('0x50'));if(_0x3245b8[_0x6d5b('0x51')]===_0x6d5b('0x4e')){var _0x2b20e7=_0x3dfc35[_0x6d5b('0x4f')]({'plain':!![]});var _0x36569a=_0x6d5b('0x2b');return db[_0x6d5b('0x52')]['find']({'where':{'name':_0x36569a,'userProfileId':_0x3245b8[_0x6d5b('0x53')]},'raw':!![]})[_0x6d5b('0x29')](function(_0x5ea0d4){if(_0x5ea0d4&&_0x5ea0d4[_0x6d5b('0x54')]===0x0){return db['UserProfileResource'][_0x6d5b('0x4d')]({'name':_0x2b20e7['name'],'resourceId':_0x2b20e7['id'],'type':_0x5ea0d4[_0x6d5b('0x2e')],'sectionId':_0x5ea0d4['id']},{})[_0x6d5b('0x29')](function(){return _0x3dfc35;});}else{return _0x3dfc35;}})['catch'](function(_0x29544f){logger['error'](_0x6d5b('0x55'),_0x29544f);throw _0x29544f;});}return _0x3dfc35;})[_0x6d5b('0x29')](respondWithResult(_0x72479c,0xc9))[_0x6d5b('0x47')](handleError(_0x72479c,null));};exports[_0x6d5b('0x28')]=function(_0x1a52de,_0x489ea3){if(_0x1a52de[_0x6d5b('0x56')]['id']){delete _0x1a52de[_0x6d5b('0x56')]['id'];}return db[_0x6d5b('0x43')][_0x6d5b('0x4c')]({'where':{'id':_0x1a52de[_0x6d5b('0x49')]['id']}})[_0x6d5b('0x29')](handleEntityNotFound(_0x489ea3,null))[_0x6d5b('0x29')](saveUpdates(_0x1a52de[_0x6d5b('0x56')],null))[_0x6d5b('0x29')](respondWithResult(_0x489ea3,null))['catch'](handleError(_0x489ea3,null));};exports[_0x6d5b('0x2a')]=function(_0x33ffe2,_0x7e4027){return db['VoiceChanSpy']['find']({'where':{'id':_0x33ffe2[_0x6d5b('0x49')]['id']}})[_0x6d5b('0x29')](handleEntityNotFound(_0x7e4027,null))[_0x6d5b('0x29')](removeEntity(_0x7e4027,null))[_0x6d5b('0x47')](handleError(_0x7e4027,null));}; \ No newline at end of file +var _0x630e=['intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','VoiceChanSpy','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','find','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','get','ChanSpies','name','send','index','rawAttributes','fieldName','type','key','model','map','keys'];(function(_0x206881,_0x46f703){var _0x1b5e93=function(_0x486f9f){while(--_0x486f9f){_0x206881['push'](_0x206881['shift']());}};_0x1b5e93(++_0x46f703);}(_0x630e,0x1af));var _0xe630=function(_0x1c1710,_0x5b5ebc){_0x1c1710=_0x1c1710-0x0;var _0x1dd819=_0x630e[_0x1c1710];return _0x1dd819;};'use strict';var emlformat=require(_0xe630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe630('0x2'));var BPromise=require(_0xe630('0x3'));var Mustache=require(_0xe630('0x4'));var util=require('util');var path=require(_0xe630('0x5'));var sox=require(_0xe630('0x6'));var csv=require(_0xe630('0x7'));var ejs=require(_0xe630('0x8'));var fs=require('fs');var fs_extra=require(_0xe630('0x9'));var _=require('lodash');var squel=require(_0xe630('0xa'));var crypto=require(_0xe630('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe630('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe630('0xd'));var Papa=require(_0xe630('0xe'));var Redis=require(_0xe630('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe630('0x10'));var hardwareService=require(_0xe630('0x11'));var logger=require(_0xe630('0x12'))(_0xe630('0x13'));var utils=require('../../config/utils');var config=require(_0xe630('0x14'));var licenseUtil=require(_0xe630('0x15'));var db=require(_0xe630('0x16'))['db'];function respondWithStatusCode(_0x2f59df,_0x51ce8a){_0x51ce8a=_0x51ce8a||0xcc;return function(_0x39283b){if(_0x39283b){return _0x2f59df[_0xe630('0x17')](_0x51ce8a);}return _0x2f59df[_0xe630('0x18')](_0x51ce8a)[_0xe630('0x19')]();};}function respondWithResult(_0xf3e519,_0xe92984){_0xe92984=_0xe92984||0xc8;return function(_0x2edf33){if(_0x2edf33){return _0xf3e519[_0xe630('0x18')](_0xe92984)['json'](_0x2edf33);}};}function respondWithFilteredResult(_0x1d8b1c,_0x1587a7){return function(_0x3e89f7){if(_0x3e89f7){var _0x3916a5=typeof _0x1587a7[_0xe630('0x1a')]===_0xe630('0x1b')&&typeof _0x1587a7[_0xe630('0x1c')]===_0xe630('0x1b');var _0x1ab409=_0x3e89f7[_0xe630('0x1d')];var _0x3dbcf6=_0x3916a5?0x0:_0x1587a7[_0xe630('0x1a')];var _0xafcf13=_0x3916a5?_0x3e89f7[_0xe630('0x1d')]:_0x1587a7[_0xe630('0x1a')]+_0x1587a7[_0xe630('0x1c')];var _0x11ac6f;if(_0xafcf13>=_0x1ab409){_0xafcf13=_0x1ab409;_0x11ac6f=0xc8;}else{_0x11ac6f=0xce;}_0x1d8b1c[_0xe630('0x18')](_0x11ac6f);return _0x1d8b1c[_0xe630('0x1e')](_0xe630('0x1f'),_0x3dbcf6+'-'+_0xafcf13+'/'+_0x1ab409)[_0xe630('0x20')](_0x3e89f7);}return null;};}function patchUpdates(_0x22fa75){return function(_0x472eb3){try{jsonpatch[_0xe630('0x21')](_0x472eb3,_0x22fa75,!![]);}catch(_0x1c2d94){return BPromise[_0xe630('0x22')](_0x1c2d94);}return _0x472eb3['save']();};}function saveUpdates(_0x4516f2,_0x35e869){return function(_0x204fc0){if(_0x204fc0){return _0x204fc0['update'](_0x4516f2)[_0xe630('0x23')](function(_0x11159a){return _0x11159a;});}return null;};}function removeEntity(_0x36ba2c,_0x5c2ac6){return function(_0x2d797c){if(_0x2d797c){return _0x2d797c[_0xe630('0x24')]()[_0xe630('0x23')](function(){var _0x30b079=_0x2d797c[_0xe630('0x25')]({'plain':!![]});var _0x277b9f=_0xe630('0x26');return db['UserProfileResource'][_0xe630('0x24')]({'where':{'type':_0x277b9f,'resourceId':_0x30b079['id']}})[_0xe630('0x23')](function(){return _0x2d797c;});})['then'](function(){_0x36ba2c[_0xe630('0x18')](0xcc)[_0xe630('0x19')]();});}};}function handleEntityNotFound(_0x2a80d6,_0x4b67e5){return function(_0x5670a1){if(!_0x5670a1){_0x2a80d6['sendStatus'](0x194);}return _0x5670a1;};}function handleError(_0x53213a,_0x5b105b){_0x5b105b=_0x5b105b||0x1f4;return function(_0x4256e3){logger['error'](_0x4256e3['stack']);if(_0x4256e3[_0xe630('0x27')]){delete _0x4256e3[_0xe630('0x27')];}_0x53213a[_0xe630('0x18')](_0x5b105b)[_0xe630('0x28')](_0x4256e3);};}exports[_0xe630('0x29')]=function(_0x238c96,_0x1e7ec4){var _0x58c676={},_0x6eba2={},_0x438bda={'count':0x0,'rows':[]};var _0x584294=_['map'](db['VoiceChanSpy'][_0xe630('0x2a')],function(_0x5e7b3c){return{'name':_0x5e7b3c[_0xe630('0x2b')],'type':_0x5e7b3c[_0xe630('0x2c')][_0xe630('0x2d')]};});_0x6eba2[_0xe630('0x2e')]=_[_0xe630('0x2f')](_0x584294,_0xe630('0x27'));_0x6eba2['query']=_[_0xe630('0x30')](_0x238c96['query']);_0x6eba2['filters']=_[_0xe630('0x31')](_0x6eba2[_0xe630('0x2e')],_0x6eba2[_0xe630('0x32')]);_0x58c676[_0xe630('0x33')]=_['intersection'](_0x6eba2[_0xe630('0x2e')],qs[_0xe630('0x34')](_0x238c96[_0xe630('0x32')][_0xe630('0x34')]));_0x58c676[_0xe630('0x33')]=_0x58c676[_0xe630('0x33')][_0xe630('0x35')]?_0x58c676['attributes']:_0x6eba2[_0xe630('0x2e')];if(!_0x238c96['query'][_0xe630('0x36')](_0xe630('0x37'))){_0x58c676[_0xe630('0x1c')]=qs[_0xe630('0x1c')](_0x238c96[_0xe630('0x32')][_0xe630('0x1c')]);_0x58c676[_0xe630('0x1a')]=qs[_0xe630('0x1a')](_0x238c96['query'][_0xe630('0x1a')]);}_0x58c676[_0xe630('0x38')]=qs['sort'](_0x238c96['query']['sort']);_0x58c676['where']=qs[_0xe630('0x39')](_[_0xe630('0x3a')](_0x238c96[_0xe630('0x32')],_0x6eba2[_0xe630('0x39')]),_0x584294);if(_0x238c96[_0xe630('0x32')][_0xe630('0x3b')]){_0x58c676[_0xe630('0x3c')]=_[_0xe630('0x3d')](_0x58c676[_0xe630('0x3c')],{'$or':_[_0xe630('0x2f')](_0x584294,function(_0x771f4f){if(_0x771f4f[_0xe630('0x2c')]!==_0xe630('0x3e')){var _0x171cdc={};_0x171cdc[_0x771f4f[_0xe630('0x27')]]={'$like':'%'+_0x238c96[_0xe630('0x32')][_0xe630('0x3b')]+'%'};return _0x171cdc;}})});}_0x58c676=_[_0xe630('0x3d')]({},_0x58c676,_0x238c96[_0xe630('0x3f')]);var _0x51e0b5={'where':_0x58c676['where']};return db['VoiceChanSpy'][_0xe630('0x1d')](_0x51e0b5)[_0xe630('0x23')](function(_0x40e3b7){_0x438bda['count']=_0x40e3b7;if(_0x238c96[_0xe630('0x32')][_0xe630('0x40')]){_0x58c676['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xe630('0x41')](_0x58c676);})['then'](function(_0x27fa4c){_0x438bda[_0xe630('0x42')]=_0x27fa4c;return _0x438bda;})[_0xe630('0x23')](respondWithFilteredResult(_0x1e7ec4,_0x58c676))['catch'](handleError(_0x1e7ec4,null));};exports[_0xe630('0x43')]=function(_0x18133c,_0x15052d){var _0x2fad35={'raw':![],'where':{'id':_0x18133c[_0xe630('0x44')]['id']}},_0x4d13a5={};_0x4d13a5[_0xe630('0x2e')]=_['keys'](db[_0xe630('0x45')][_0xe630('0x2a')]);_0x4d13a5[_0xe630('0x32')]=_[_0xe630('0x30')](_0x18133c['query']);_0x4d13a5[_0xe630('0x39')]=_[_0xe630('0x31')](_0x4d13a5[_0xe630('0x2e')],_0x4d13a5['query']);_0x2fad35[_0xe630('0x33')]=_[_0xe630('0x31')](_0x4d13a5[_0xe630('0x2e')],qs[_0xe630('0x34')](_0x18133c['query'][_0xe630('0x34')]));_0x2fad35['attributes']=_0x2fad35[_0xe630('0x33')]['length']?_0x2fad35[_0xe630('0x33')]:_0x4d13a5[_0xe630('0x2e')];if(_0x18133c[_0xe630('0x32')][_0xe630('0x40')]){_0x2fad35[_0xe630('0x46')]=[{'all':!![]}];}_0x2fad35=_[_0xe630('0x3d')]({},_0x2fad35,_0x18133c['options']);return db[_0xe630('0x45')]['find'](_0x2fad35)[_0xe630('0x23')](handleEntityNotFound(_0x15052d,null))[_0xe630('0x23')](respondWithResult(_0x15052d,null))[_0xe630('0x47')](handleError(_0x15052d,null));};exports[_0xe630('0x48')]=function(_0xd4c72b,_0x1b4c6a){return db[_0xe630('0x45')][_0xe630('0x48')](_0xd4c72b[_0xe630('0x49')],{})['then'](function(_0x31e19e){var _0x52fac4=_0xd4c72b[_0xe630('0x4a')][_0xe630('0x25')]({'plain':!![]});if(!_0x52fac4)throw new Error(_0xe630('0x4b'));if(_0x52fac4[_0xe630('0x4c')]==='user'){var _0x3938e0=_0x31e19e['get']({'plain':!![]});var _0x558e3e=_0xe630('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x558e3e,'userProfileId':_0x52fac4[_0xe630('0x4d')]},'raw':!![]})[_0xe630('0x23')](function(_0x4e72fc){if(_0x4e72fc&&_0x4e72fc[_0xe630('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x3938e0['name'],'resourceId':_0x3938e0['id'],'type':_0x4e72fc['name'],'sectionId':_0x4e72fc['id']},{})['then'](function(){return _0x31e19e;});}else{return _0x31e19e;}})[_0xe630('0x47')](function(_0xf0f784){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf0f784);throw _0xf0f784;});}return _0x31e19e;})['then'](respondWithResult(_0x1b4c6a,0xc9))[_0xe630('0x47')](handleError(_0x1b4c6a,null));};exports['update']=function(_0x3a7e12,_0x264ed8){if(_0x3a7e12[_0xe630('0x49')]['id']){delete _0x3a7e12[_0xe630('0x49')]['id'];}return db['VoiceChanSpy'][_0xe630('0x4f')]({'where':{'id':_0x3a7e12[_0xe630('0x44')]['id']}})[_0xe630('0x23')](handleEntityNotFound(_0x264ed8,null))[_0xe630('0x23')](saveUpdates(_0x3a7e12['body'],null))['then'](respondWithResult(_0x264ed8,null))[_0xe630('0x47')](handleError(_0x264ed8,null));};exports[_0xe630('0x24')]=function(_0x4abde0,_0x27e341){return db[_0xe630('0x45')][_0xe630('0x4f')]({'where':{'id':_0x4abde0[_0xe630('0x44')]['id']}})['then'](handleEntityNotFound(_0x27e341,null))[_0xe630('0x23')](removeEntity(_0x27e341,null))[_0xe630('0x47')](handleError(_0x27e341,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index cf9626c..6ba3b6c 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 _0x40ae=['%s%s','prefix','merge','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','push','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','internal','concat','User','findAll','then','models','define','voice_chanspy','bulkCreate','catch','VoiceExtension','destroy','lodash','util','bluebird','from-sip','format'];(function(_0x4159d8,_0x42e42b){var _0x3f46cb=function(_0xa1c2a3){while(--_0xa1c2a3){_0x4159d8['push'](_0x4159d8['shift']());}};_0x3f46cb(++_0x42e42b);}(_0x40ae,0x87));var _0xe40a=function(_0xc3ec11,_0x106937){_0xc3ec11=_0xc3ec11-0x0;var _0x4aa02d=_0x40ae[_0xc3ec11];return _0x4aa02d;};'use strict';var _=require(_0xe40a('0x0'));var util=require(_0xe40a('0x1'));var BPromise=require(_0xe40a('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x306410,_0x5e6d79,_0x6aebb5){var _0x3f6a36=0x1;var _0x50adf9=[];var _0x220a44={'context':_0x5e6d79['context']||_0xe40a('0x3'),'exten':util[_0xe40a('0x4')](_0xe40a('0x5'),_0x306410[_0xe40a('0x6')],_0x6aebb5),'type':'system','isApp':![],'ChanSpyId':_0x306410['id'],'UserId':_0x5e6d79['id']};_0x50adf9['push'](_[_0xe40a('0x7')]({'app':'Set','appdata':util['format'](_0xe40a('0x8'),_0xe40a('0x9')),'priority':_0x3f6a36++},_0x220a44));if(_0x306410[_0xe40a('0xa')]){_0x50adf9['push'](_['merge']({'app':_0xe40a('0xb'),'appdata':util[_0xe40a('0x4')]('${UNIQUEID}.%s,a',_0x306410[_0xe40a('0xc')]),'priority':_0x3f6a36++},_0x220a44));}if(_0x306410[_0xe40a('0xd')]){_0x50adf9[_0xe40a('0xe')](_[_0xe40a('0x7')]({'app':_0xe40a('0xf'),'appdata':_0x306410[_0xe40a('0x10')],'priority':_0x3f6a36++},_0x220a44));}_0x50adf9[_0xe40a('0xe')](_[_0xe40a('0x7')]({'app':_0xe40a('0x11'),'appdata':util[_0xe40a('0x4')](_0xe40a('0x12'),_0x5e6d79[_0xe40a('0x13')],_0x306410['options']?_0x306410[_0xe40a('0x14')][_0xe40a('0x15')](''):''),'priority':_0x3f6a36++},_0x220a44));if(_0x306410[_0xe40a('0xa')]){_0x50adf9['push'](_[_0xe40a('0x7')]({'app':'StopMixMonitor','priority':_0x3f6a36++},_0x220a44));}return _0x50adf9;};var getChanSpyApplications=function(_0x557686,_0x4ca22b){var _0x528055=[];for(var _0x4e11d9=0x0,_0x198236=0x1;_0x4e11d9<_0x4ca22b[_0xe40a('0x16')];_0x4e11d9++,_0x198236=0x1){_0x528055=_0x528055['concat'](getUserApplications(_0x557686,_0x4ca22b[_0x4e11d9],_0x4ca22b[_0x4e11d9][_0xe40a('0x17')]));if(_0x4ca22b[_0x4e11d9]['internal']!=_0x4ca22b[_0x4e11d9][_0xe40a('0x13')]){_0x528055=_0x528055[_0xe40a('0x18')](getUserApplications(_0x557686,_0x4ca22b[_0x4e11d9],_0x4ca22b[_0x4e11d9][_0xe40a('0x13')]));}}return _0x528055;};var getChanSpyPromise=function(_0x5a3478,_0x5caaa7){return new BPromise(function(_0x4a0eed,_0x355732){return _0x5a3478[_0xe40a('0x19')][_0xe40a('0x1a')]({'attributes':['id',_0xe40a('0x13'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xe40a('0x1b')](function(_0x46ef48){if(_0x46ef48){return _0x4a0eed(getChanSpyApplications(_0x5caaa7,_0x46ef48));}return _0x4a0eed([]);})['catch'](function(_0x2121f2){_0x355732(_0x2121f2);});});};module['exports']=function(_0xbcdbfe,_0x4005aa){var _0x4a2650=_0xbcdbfe[_0xe40a('0x1c')];return _0xbcdbfe[_0xe40a('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0xe40a('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3dead4,_0x58dcad,_0x45cf30){return getChanSpyPromise(_0x4a2650,_0x3dead4)[_0xe40a('0x1b')](function(_0x472f0c){if(_0x472f0c&&_0x472f0c['length']){return _0x4a2650['VoiceExtension'][_0xe40a('0x1f')](_0x472f0c);}})['then'](function(){_0x45cf30();})[_0xe40a('0x20')](function(_0xa5c293){_0x45cf30(_0xa5c293);});},'afterUpdate':function(_0x1385c3,_0x39fd5e,_0x53fb81){return _0x4a2650[_0xe40a('0x21')][_0xe40a('0x22')]({'where':{'ChanSpyId':_0x1385c3['id']}})[_0xe40a('0x1b')](function(){return getChanSpyPromise(_0x4a2650,_0x1385c3);})[_0xe40a('0x1b')](function(_0x3a45f6){if(_0x3a45f6&&_0x3a45f6[_0xe40a('0x16')]){return _0x4a2650['VoiceExtension']['bulkCreate'](_0x3a45f6);}})[_0xe40a('0x1b')](function(){_0x53fb81();})[_0xe40a('0x20')](function(_0x40669c){_0x53fb81(_0x40669c);});},'afterDestroy':function(_0x1c2572,_0x4baca5,_0x41db27){return _0x4a2650[_0xe40a('0x21')][_0xe40a('0x22')]({'where':{'ChanSpyId':_0x1c2572['id']}})['then'](function(){_0x41db27();})[_0xe40a('0x20')](function(_0x1156b4){_0x41db27(_0x1156b4);});}}});}; \ No newline at end of file +var _0x7416=['SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','then','catch','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','merge','Set','chanspy','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate'];(function(_0x17fa34,_0x243908){var _0x3ba9b8=function(_0x75807){while(--_0x75807){_0x17fa34['push'](_0x17fa34['shift']());}};_0x3ba9b8(++_0x243908);}(_0x7416,0x100));var _0x6741=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x7416[_0x5519a9];return _0x32f2cc;};'use strict';var _=require(_0x6741('0x0'));var util=require('util');var BPromise=require(_0x6741('0x1'));var attributes=require(_0x6741('0x2'));var getUserApplications=function(_0x26cc7b,_0x44f0bf,_0x3646bb){var _0x3641cf=0x1;var _0x557b47=[];var _0xfebdc1={'context':_0x44f0bf[_0x6741('0x3')]||_0x6741('0x4'),'exten':util[_0x6741('0x5')](_0x6741('0x6'),_0x26cc7b['prefix'],_0x3646bb),'type':_0x6741('0x7'),'isApp':![],'ChanSpyId':_0x26cc7b['id'],'UserId':_0x44f0bf['id']};_0x557b47[_0x6741('0x8')](_[_0x6741('0x9')]({'app':_0x6741('0xa'),'appdata':util[_0x6741('0x5')]('CDR(type)=%s',_0x6741('0xb')),'priority':_0x3641cf++},_0xfebdc1));if(_0x26cc7b['record']){_0x557b47['push'](_['merge']({'app':_0x6741('0xc'),'appdata':util[_0x6741('0x5')](_0x6741('0xd'),_0x26cc7b['recordingFormat']),'priority':_0x3641cf++},_0xfebdc1));}if(_0x26cc7b[_0x6741('0xe')]){_0x557b47[_0x6741('0x8')](_[_0x6741('0x9')]({'app':_0x6741('0xf'),'appdata':_0x26cc7b['password'],'priority':_0x3641cf++},_0xfebdc1));}_0x557b47[_0x6741('0x8')](_['merge']({'app':'ChanSpy','appdata':util[_0x6741('0x5')](_0x6741('0x10'),_0x44f0bf[_0x6741('0x11')],_0x26cc7b[_0x6741('0x12')]?_0x26cc7b[_0x6741('0x12')][_0x6741('0x13')](''):''),'priority':_0x3641cf++},_0xfebdc1));if(_0x26cc7b['record']){_0x557b47['push'](_[_0x6741('0x9')]({'app':_0x6741('0x14'),'priority':_0x3641cf++},_0xfebdc1));}return _0x557b47;};var getChanSpyApplications=function(_0x1f7b60,_0x267df7){var _0x282ef6=[];for(var _0x4668f6=0x0,_0x348511=0x1;_0x4668f6<_0x267df7[_0x6741('0x15')];_0x4668f6++,_0x348511=0x1){_0x282ef6=_0x282ef6[_0x6741('0x16')](getUserApplications(_0x1f7b60,_0x267df7[_0x4668f6],_0x267df7[_0x4668f6][_0x6741('0x17')]));if(_0x267df7[_0x4668f6][_0x6741('0x17')]!=_0x267df7[_0x4668f6][_0x6741('0x11')]){_0x282ef6=_0x282ef6[_0x6741('0x16')](getUserApplications(_0x1f7b60,_0x267df7[_0x4668f6],_0x267df7[_0x4668f6][_0x6741('0x11')]));}}return _0x282ef6;};var getChanSpyPromise=function(_0x9e444c,_0x34cb83){return new BPromise(function(_0x1d17fe,_0x245c97){return _0x9e444c['User'][_0x6741('0x18')]({'attributes':['id','name',_0x6741('0x17')],'where':{'role':_0x6741('0x19'),'chanspy':!![]},'raw':!![]})[_0x6741('0x1a')](function(_0x32ef62){if(_0x32ef62){return _0x1d17fe(getChanSpyApplications(_0x34cb83,_0x32ef62));}return _0x1d17fe([]);})[_0x6741('0x1b')](function(_0x3f0207){_0x245c97(_0x3f0207);});});};module['exports']=function(_0x27eedd,_0x33c2a9){var _0xc10aa=_0x27eedd['models'];return _0x27eedd[_0x6741('0x1c')](_0x6741('0x1d'),attributes,{'tableName':_0x6741('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d6659,_0x2dc3bc,_0x3139d8){return getChanSpyPromise(_0xc10aa,_0x3d6659)[_0x6741('0x1a')](function(_0x38c448){if(_0x38c448&&_0x38c448[_0x6741('0x15')]){return _0xc10aa[_0x6741('0x1f')][_0x6741('0x20')](_0x38c448);}})[_0x6741('0x1a')](function(){_0x3139d8();})[_0x6741('0x1b')](function(_0x4b5aaf){_0x3139d8(_0x4b5aaf);});},'afterUpdate':function(_0x3a4540,_0x422d8e,_0x5b96df){return _0xc10aa[_0x6741('0x1f')][_0x6741('0x21')]({'where':{'ChanSpyId':_0x3a4540['id']}})['then'](function(){return getChanSpyPromise(_0xc10aa,_0x3a4540);})[_0x6741('0x1a')](function(_0x1611c0){if(_0x1611c0&&_0x1611c0[_0x6741('0x15')]){return _0xc10aa[_0x6741('0x1f')][_0x6741('0x20')](_0x1611c0);}})[_0x6741('0x1a')](function(){_0x5b96df();})[_0x6741('0x1b')](function(_0x72eae8){_0x5b96df(_0x72eae8);});},'afterDestroy':function(_0x2636a7,_0x1d1d19,_0x512528){return _0xc10aa[_0x6741('0x1f')][_0x6741('0x21')]({'where':{'ChanSpyId':_0x2636a7['id']}})[_0x6741('0x1a')](function(){_0x512528();})[_0x6741('0x1b')](function(_0xef52f7){_0x512528(_0xef52f7);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a2b42c4..0608e99 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 _0xda65=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x26a42e,_0x535930){var _0x4b6eb0=function(_0x43a268){while(--_0x43a268){_0x26a42e['push'](_0x26a42e['shift']());}};_0x4b6eb0(++_0x535930);}(_0xda65,0x1d0));var _0x5da6=function(_0x3c4836,_0x3ccaa8){_0x3c4836=_0x3c4836-0x0;var _0x1dc7db=_0xda65[_0x3c4836];return _0x1dc7db;};'use strict';var _=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var moment=require(_0x5da6('0x2'));var BPromise=require('bluebird');var rs=require(_0x5da6('0x3'));var fs=require('fs');var Redis=require(_0x5da6('0x4'));var db=require(_0x5da6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5da6('0x6'));var config=require(_0x5da6('0x7'));var jayson=require(_0x5da6('0x8'));var client=jayson[_0x5da6('0x9')][_0x5da6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51924c,_0x35aff9,_0x4a7040){return new BPromise(function(_0x55108e,_0x40722c){return client['request'](_0x51924c,_0x4a7040)[_0x5da6('0xb')](function(_0x20cb14){logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));logger[_0x5da6('0xf')](_0x5da6('0x10'),_0x35aff9,_0x5da6('0xe'),JSON['stringify'](_0x20cb14));if(_0x20cb14[_0x5da6('0x11')]){if(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x12')]===0x1f4){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x40722c(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}logger['error'](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x55108e(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}else{logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));_0x55108e(_0x20cb14[_0x5da6('0x14')][_0x5da6('0x13')]);}})['catch'](function(_0x5207e5){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x5207e5);_0x40722c(_0x5207e5);});});} \ No newline at end of file +var _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x59e1b8,_0x3906af){var _0xdcbac8=function(_0x323b9a){while(--_0x323b9a){_0x59e1b8['push'](_0x59e1b8['shift']());}};_0xdcbac8(++_0x3906af);}(_0xb821,0xa7));var _0x1b82=function(_0x195436,_0x39ff46){_0x195436=_0x195436-0x0;var _0x542bb1=_0xb821[_0x195436];return _0x542bb1;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 2e805cc..e568cf5 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 _0xed92=['get','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller'];(function(_0x514244,_0x2721ec){var _0xca96e5=function(_0x440a38){while(--_0x440a38){_0x514244['push'](_0x514244['shift']());}};_0xca96e5(++_0x2721ec);}(_0xed92,0x199));var _0x2ed9=function(_0x52bd76,_0x93eabd){_0x52bd76=_0x52bd76-0x0;var _0x27371e=_0xed92[_0x52bd76];return _0x27371e;};'use strict';var multer=require('multer');var util=require(_0x2ed9('0x0'));var path=require(_0x2ed9('0x1'));var timeout=require(_0x2ed9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ed9('0x3'));var auth=require(_0x2ed9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2ed9('0x5'));var controller=require(_0x2ed9('0x6'));router[_0x2ed9('0x7')]('/',auth[_0x2ed9('0x8')](),controller['index']);router[_0x2ed9('0x7')]('/:id',auth[_0x2ed9('0x8')](),controller[_0x2ed9('0x9')]);router[_0x2ed9('0xa')]('/',auth[_0x2ed9('0x8')](),controller[_0x2ed9('0xb')]);router[_0x2ed9('0xc')]('/:id',auth[_0x2ed9('0x8')](),controller[_0x2ed9('0xd')]);router[_0x2ed9('0xe')]('/:id',auth[_0x2ed9('0x8')](),controller[_0x2ed9('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2126=['./voiceContext.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c24b6,_0x7eb85a){var _0xe51296=function(_0x410774){while(--_0x410774){_0x5c24b6['push'](_0x5c24b6['shift']());}};_0xe51296(++_0x7eb85a);}(_0x2126,0x1b0));var _0x6212=function(_0x14ac9e,_0x443c98){_0x14ac9e=_0x14ac9e-0x0;var _0x455527=_0x2126[_0x14ac9e];return _0x455527;};'use strict';var multer=require(_0x6212('0x0'));var util=require('util');var path=require(_0x6212('0x1'));var timeout=require(_0x6212('0x2'));var express=require(_0x6212('0x3'));var router=express['Router']();var fs_extra=require(_0x6212('0x4'));var auth=require(_0x6212('0x5'));var interaction=require(_0x6212('0x6'));var config=require(_0x6212('0x7'));var controller=require(_0x6212('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6212('0x9')]);router[_0x6212('0xa')](_0x6212('0xb'),auth[_0x6212('0xc')](),controller[_0x6212('0xd')]);router[_0x6212('0xe')]('/',auth[_0x6212('0xc')](),controller[_0x6212('0xf')]);router[_0x6212('0x10')](_0x6212('0xb'),auth[_0x6212('0xc')](),controller['update']);router[_0x6212('0x11')](_0x6212('0xb'),auth['isAuthenticated'](),controller[_0x6212('0x12')]);module[_0x6212('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 43bc215..585623c 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 _0x3cdc=['exports','STRING','BOOLEAN'];(function(_0x135c8f,_0x48e80e){var _0x310712=function(_0x36bec3){while(--_0x36bec3){_0x135c8f['push'](_0x135c8f['shift']());}};_0x310712(++_0x48e80e);}(_0x3cdc,0x1bf));var _0xc3cd=function(_0xc01d2,_0x29f146){_0xc01d2=_0xc01d2-0x0;var _0x17f297=_0x3cdc[_0xc01d2];return _0x17f297;};'use strict';var Sequelize=require('sequelize');module[_0xc3cd('0x0')]={'name':{'type':Sequelize[_0xc3cd('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xc3cd('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc3cd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x885c=['name','STRING','sequelize','exports'];(function(_0x5ac82b,_0x1b8786){var _0x41f23f=function(_0x1c4dc5){while(--_0x1c4dc5){_0x5ac82b['push'](_0x5ac82b['shift']());}};_0x41f23f(++_0x1b8786);}(_0x885c,0x6a));var _0xc885=function(_0x87eee5,_0x581852){_0x87eee5=_0x87eee5-0x0;var _0x17e2dc=_0x885c[_0x87eee5];return _0x17e2dc;};'use strict';var Sequelize=require(_0xc885('0x0'));module[_0xc885('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc885('0x2')},'description':{'type':Sequelize[_0xc885('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 827cde9..6dcc5b6 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 _0x0629=['squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','destroy','Contexts','UserProfileResource','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','VoiceContext','includeAll','include','findAll','rows','show','params','create','body','join','utf8','render','writeFileSync','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0629,0xca));var _0x9062=function(_0x46f748,_0x5c8f49){_0x46f748=_0x46f748-0x0;var _0x14e516=_0x0629[_0x46f748];return _0x14e516;};'use strict';var emlformat=require(_0x9062('0x0'));var rimraf=require(_0x9062('0x1'));var zipdir=require(_0x9062('0x2'));var jsonpatch=require(_0x9062('0x3'));var rp=require(_0x9062('0x4'));var moment=require(_0x9062('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9062('0x6'));var util=require('util');var path=require(_0x9062('0x7'));var sox=require('sox');var csv=require(_0x9062('0x8'));var ejs=require(_0x9062('0x9'));var fs=require('fs');var fs_extra=require(_0x9062('0xa'));var _=require(_0x9062('0xb'));var squel=require(_0x9062('0xc'));var crypto=require(_0x9062('0xd'));var jsforce=require(_0x9062('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9062('0x8'));var querystring=require('querystring');var Papa=require(_0x9062('0xf'));var Redis=require(_0x9062('0x10'));var authService=require(_0x9062('0x11'));var qs=require(_0x9062('0x12'));var as=require(_0x9062('0x13'));var hardwareService=require(_0x9062('0x14'));var logger=require(_0x9062('0x15'))(_0x9062('0x16'));var utils=require(_0x9062('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9062('0x18'));var db=require(_0x9062('0x19'))['db'];var jayson=require(_0x9062('0x1a'));var client=jayson[_0x9062('0x1b')][_0x9062('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1803de,_0x51fe1b,_0x126687,_0x4728bf){return new BPromise(function(_0x29a504,_0x3127f9){var _0xa68b0e=_0x4728bf||client;return _0xa68b0e[_0x9062('0x1d')](_0x1803de,_0x126687)[_0x9062('0x1e')](function(_0x1575f8){logger[_0x9062('0x1f')](_0x9062('0x20'),_0x51fe1b,_0x9062('0x21'));logger[_0x9062('0x22')](_0x9062('0x23'),_0x51fe1b,_0x9062('0x21'),JSON[_0x9062('0x24')](_0x1575f8));if(_0x1575f8[_0x9062('0x25')]){if(_0x1575f8[_0x9062('0x25')][_0x9062('0x26')]===0x1f4){logger[_0x9062('0x25')](_0x9062('0x20'),_0x51fe1b,_0x1575f8[_0x9062('0x25')][_0x9062('0x27')]);return _0x3127f9(_0x1575f8['error']['message']);}logger[_0x9062('0x25')](_0x9062('0x20'),_0x51fe1b,_0x1575f8[_0x9062('0x25')]['message']);return _0x29a504(_0x1575f8[_0x9062('0x25')][_0x9062('0x27')]);}else{logger[_0x9062('0x1f')](_0x9062('0x20'),_0x51fe1b,_0x9062('0x21'));_0x29a504(_0x1575f8[_0x9062('0x28')][_0x9062('0x27')]);}})[_0x9062('0x29')](function(_0x3cb21e){logger[_0x9062('0x25')](_0x9062('0x20'),_0x51fe1b,_0x3cb21e);_0x3127f9(_0x3cb21e);});});}function respondWithStatusCode(_0x3aa9f2,_0x2eda9b){_0x2eda9b=_0x2eda9b||0xcc;return function(_0x4ea3cf){if(_0x4ea3cf){return _0x3aa9f2[_0x9062('0x2a')](_0x2eda9b);}return _0x3aa9f2[_0x9062('0x2b')](_0x2eda9b)[_0x9062('0x2c')]();};}function respondWithResult(_0x43d04a,_0x1d7593){_0x1d7593=_0x1d7593||0xc8;return function(_0x506195){if(_0x506195){return _0x43d04a[_0x9062('0x2b')](_0x1d7593)[_0x9062('0x2d')](_0x506195);}};}function respondWithFilteredResult(_0x210f33,_0x4ed032){return function(_0x18829b){if(_0x18829b){var _0x3a119a=typeof _0x4ed032['offset']==='undefined'&&typeof _0x4ed032[_0x9062('0x2e')]===_0x9062('0x2f');var _0x5097e2=_0x18829b[_0x9062('0x30')];var _0x7de3a8=_0x3a119a?0x0:_0x4ed032[_0x9062('0x31')];var _0x433b2c=_0x3a119a?_0x18829b[_0x9062('0x30')]:_0x4ed032['offset']+_0x4ed032['limit'];var _0x4e9535;if(_0x433b2c>=_0x5097e2){_0x433b2c=_0x5097e2;_0x4e9535=0xc8;}else{_0x4e9535=0xce;}_0x210f33[_0x9062('0x2b')](_0x4e9535);return _0x210f33[_0x9062('0x32')](_0x9062('0x33'),_0x7de3a8+'-'+_0x433b2c+'/'+_0x5097e2)['json'](_0x18829b);}return null;};}function patchUpdates(_0x4afcbc){return function(_0x1ca253){try{jsonpatch['apply'](_0x1ca253,_0x4afcbc,!![]);}catch(_0x5dd9b4){return BPromise['reject'](_0x5dd9b4);}return _0x1ca253[_0x9062('0x34')]();};}function saveUpdates(_0x2c9d4d,_0x16b29b){return function(_0x5eac2a){if(_0x5eac2a){return _0x5eac2a[_0x9062('0x35')](_0x2c9d4d)[_0x9062('0x1e')](function(_0x366d46){return _0x366d46;});}return null;};}function removeEntity(_0x4d9fd7,_0x30b6e8){return function(_0x436350){if(_0x436350){return _0x436350[_0x9062('0x36')]()[_0x9062('0x1e')](function(){var _0x519072=_0x436350['get']({'plain':!![]});var _0x2680ec=_0x9062('0x37');return db[_0x9062('0x38')][_0x9062('0x36')]({'where':{'type':_0x2680ec,'resourceId':_0x519072['id']}})[_0x9062('0x1e')](function(){return _0x436350;});})['then'](function(){_0x4d9fd7['status'](0xcc)[_0x9062('0x2c')]();});}};}function handleEntityNotFound(_0x4547a5,_0x358d52){return function(_0x3806ac){if(!_0x3806ac){_0x4547a5[_0x9062('0x2a')](0x194);}return _0x3806ac;};}function handleError(_0x224f86,_0x42a92b){_0x42a92b=_0x42a92b||0x1f4;return function(_0x353823){logger[_0x9062('0x25')](_0x353823[_0x9062('0x39')]);if(_0x353823[_0x9062('0x3a')]){delete _0x353823[_0x9062('0x3a')];}_0x224f86['status'](_0x42a92b)['send'](_0x353823);};}exports[_0x9062('0x3b')]=function(_0x447b50,_0x156cc3){var _0x526d29={},_0x28a400={},_0x50477d={'count':0x0,'rows':[]};var _0x3ffedc=_[_0x9062('0x3c')](db['VoiceContext'][_0x9062('0x3d')],function(_0x568574){return{'name':_0x568574['fieldName'],'type':_0x568574[_0x9062('0x3e')][_0x9062('0x3f')]};});_0x28a400[_0x9062('0x40')]=_[_0x9062('0x3c')](_0x3ffedc,_0x9062('0x3a'));_0x28a400[_0x9062('0x41')]=_[_0x9062('0x42')](_0x447b50['query']);_0x28a400[_0x9062('0x43')]=_['intersection'](_0x28a400[_0x9062('0x40')],_0x28a400[_0x9062('0x41')]);_0x526d29[_0x9062('0x44')]=_[_0x9062('0x45')](_0x28a400[_0x9062('0x40')],qs[_0x9062('0x46')](_0x447b50[_0x9062('0x41')][_0x9062('0x46')]));_0x526d29['attributes']=_0x526d29[_0x9062('0x44')][_0x9062('0x47')]?_0x526d29[_0x9062('0x44')]:_0x28a400[_0x9062('0x40')];if(!_0x447b50[_0x9062('0x41')][_0x9062('0x48')](_0x9062('0x49'))){_0x526d29[_0x9062('0x2e')]=qs['limit'](_0x447b50['query'][_0x9062('0x2e')]);_0x526d29['offset']=qs['offset'](_0x447b50[_0x9062('0x41')][_0x9062('0x31')]);}_0x526d29[_0x9062('0x4a')]=qs[_0x9062('0x4b')](_0x447b50[_0x9062('0x41')][_0x9062('0x4b')]);_0x526d29[_0x9062('0x4c')]=qs[_0x9062('0x43')](_['pick'](_0x447b50[_0x9062('0x41')],_0x28a400[_0x9062('0x43')]),_0x3ffedc);if(_0x447b50[_0x9062('0x41')]['filter']){_0x526d29['where']=_[_0x9062('0x4d')](_0x526d29[_0x9062('0x4c')],{'$or':_[_0x9062('0x3c')](_0x3ffedc,function(_0x142566){if(_0x142566[_0x9062('0x3e')]!==_0x9062('0x4e')){var _0x2bd17a={};_0x2bd17a[_0x142566[_0x9062('0x3a')]]={'$like':'%'+_0x447b50['query'][_0x9062('0x4f')]+'%'};return _0x2bd17a;}})});}_0x526d29=_[_0x9062('0x4d')]({},_0x526d29,_0x447b50[_0x9062('0x50')]);var _0x6ac6a5={'where':_0x526d29[_0x9062('0x4c')]};return db[_0x9062('0x51')][_0x9062('0x30')](_0x6ac6a5)[_0x9062('0x1e')](function(_0x373208){_0x50477d[_0x9062('0x30')]=_0x373208;if(_0x447b50['query'][_0x9062('0x52')]){_0x526d29[_0x9062('0x53')]=[{'all':!![]}];}return db[_0x9062('0x51')][_0x9062('0x54')](_0x526d29);})['then'](function(_0x364754){_0x50477d[_0x9062('0x55')]=_0x364754;return _0x50477d;})[_0x9062('0x1e')](respondWithFilteredResult(_0x156cc3,_0x526d29))['catch'](handleError(_0x156cc3,null));};exports[_0x9062('0x56')]=function(_0x12a972,_0x265620){var _0x483376={'raw':![],'where':{'id':_0x12a972[_0x9062('0x57')]['id']}},_0x29c63e={};_0x29c63e[_0x9062('0x40')]=_[_0x9062('0x42')](db['VoiceContext'][_0x9062('0x3d')]);_0x29c63e[_0x9062('0x41')]=_[_0x9062('0x42')](_0x12a972[_0x9062('0x41')]);_0x29c63e[_0x9062('0x43')]=_['intersection'](_0x29c63e[_0x9062('0x40')],_0x29c63e[_0x9062('0x41')]);_0x483376[_0x9062('0x44')]=_[_0x9062('0x45')](_0x29c63e[_0x9062('0x40')],qs[_0x9062('0x46')](_0x12a972[_0x9062('0x41')][_0x9062('0x46')]));_0x483376[_0x9062('0x44')]=_0x483376[_0x9062('0x44')][_0x9062('0x47')]?_0x483376[_0x9062('0x44')]:_0x29c63e[_0x9062('0x40')];if(_0x12a972[_0x9062('0x41')][_0x9062('0x52')]){_0x483376['include']=[{'all':!![]}];}_0x483376=_[_0x9062('0x4d')]({},_0x483376,_0x12a972[_0x9062('0x50')]);return db['VoiceContext']['find'](_0x483376)[_0x9062('0x1e')](handleEntityNotFound(_0x265620,null))[_0x9062('0x1e')](respondWithResult(_0x265620,null))[_0x9062('0x29')](handleError(_0x265620,null));};exports[_0x9062('0x58')]=function(_0x45bd21,_0x134116,_0x4d3193){var _0x168dab;return db[_0x9062('0x51')][_0x9062('0x58')](_0x45bd21[_0x9062('0x59')],{'raw':!![]})[_0x9062('0x1e')](function(_0x5cc209){_0x168dab=_0x5cc209;return db[_0x9062('0x51')]['findAll']({'raw':!![]});})[_0x9062('0x1e')](function(_0x1f2b20){var _0x41bcb8=fs['readFileSync'](path[_0x9062('0x5a')](config['root'],'server/files/templates/context.ejs'),_0x9062('0x5b'));var _0x3a7fc6=ejs[_0x9062('0x5c')](_0x41bcb8,{'contexts':_0x1f2b20||[]});fs[_0x9062('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3a7fc6);})[_0x9062('0x1e')](function(){return respondWithRpcPromise(_0x9062('0x5e'),'create',{'module':_0x9062('0x5f')});})[_0x9062('0x1e')](function(){var _0x4c84a5=_0x45bd21[_0x9062('0x60')][_0x9062('0x61')]({'plain':!![]});if(!_0x4c84a5)throw new Error(_0x9062('0x62'));if(_0x4c84a5[_0x9062('0x63')]===_0x9062('0x60')){var _0x41035f=_0x168dab[_0x9062('0x61')]({'plain':!![]});return db[_0x9062('0x64')][_0x9062('0x65')]({'where':{'name':_0x9062('0x37'),'userProfileId':_0x4c84a5[_0x9062('0x66')]},'raw':!![]})[_0x9062('0x1e')](function(_0xae7ed){if(_0xae7ed&&_0xae7ed[_0x9062('0x67')]===0x0){return db[_0x9062('0x38')][_0x9062('0x58')]({'name':_0x41035f[_0x9062('0x3a')],'resourceId':_0x41035f['id'],'type':_0xae7ed[_0x9062('0x3a')],'sectionId':_0xae7ed['id']},{})[_0x9062('0x1e')](function(){return _0x168dab;});}else{return _0x168dab;}})[_0x9062('0x29')](function(_0x17370b){logger[_0x9062('0x25')](_0x9062('0x68'),_0x17370b);throw _0x17370b;});}return _0x168dab;})[_0x9062('0x1e')](respondWithResult(_0x134116,0xc9))[_0x9062('0x29')](handleError(_0x134116,null));};exports[_0x9062('0x35')]=function(_0x34adde,_0x445b96,_0x3f83b5){var _0x35b4c7;return db[_0x9062('0x51')][_0x9062('0x65')]({'where':{'id':_0x34adde[_0x9062('0x57')]['id']}})['then'](handleEntityNotFound(_0x445b96,null))['then'](saveUpdates(_0x34adde[_0x9062('0x59')],null))[_0x9062('0x1e')](function(_0x4b9b77){if(_0x4b9b77){_0x35b4c7=_0x4b9b77;return db[_0x9062('0x51')][_0x9062('0x54')]({'raw':!![]});}})[_0x9062('0x1e')](function(_0x1e9965){var _0x387956=fs[_0x9062('0x69')](path[_0x9062('0x5a')](config['root'],'server/files/templates/context.ejs'),_0x9062('0x5b'));var _0x588daa=ejs[_0x9062('0x5c')](_0x387956,{'contexts':_0x1e9965||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x588daa);})[_0x9062('0x1e')](function(){return respondWithRpcPromise(_0x9062('0x5e'),_0x9062('0x35'),{'module':_0x9062('0x5f')});})['then'](function(){return _0x35b4c7;})[_0x9062('0x1e')](respondWithResult(_0x445b96,null))[_0x9062('0x29')](handleError(_0x445b96,null));};exports[_0x9062('0x36')]=function(_0x4645bd,_0x5ef33c,_0x3a9dcf){var _0x173e2d;return db['VoiceContext']['find']({'where':{'id':_0x4645bd['params']['id']}})['then'](handleEntityNotFound(_0x5ef33c,null))[_0x9062('0x1e')](removeEntity(_0x5ef33c,null))['then'](function(){return db[_0x9062('0x51')][_0x9062('0x54')]({'raw':!![]});})['then'](function(_0xdc358a){var _0x426025=fs[_0x9062('0x69')](path['join'](config['root'],_0x9062('0x6a')),_0x9062('0x5b'));var _0x433acd=ejs[_0x9062('0x5c')](_0x426025,{'contexts':_0xdc358a});fs[_0x9062('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x433acd);return respondWithRpcPromise(_0x9062('0x5e'),_0x9062('0x36'),{'module':_0x9062('0x5f')});})[_0x9062('0x29')](handleError(_0x5ef33c,null));}; \ No newline at end of file +var _0xc69e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','Contexts','UserProfileResource','sendStatus','name','send','index','map','VoiceContext','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','create','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','chan_sip.so','root','eml-format','rimraf'];(function(_0x288086,_0x34ad16){var _0x577d96=function(_0x427dc9){while(--_0x427dc9){_0x288086['push'](_0x288086['shift']());}};_0x577d96(++_0x34ad16);}(_0xc69e,0x12d));var _0xec69=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc69e[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0xec69('0x0'));var rimraf=require(_0xec69('0x1'));var zipdir=require(_0xec69('0x2'));var jsonpatch=require(_0xec69('0x3'));var rp=require(_0xec69('0x4'));var moment=require(_0xec69('0x5'));var BPromise=require(_0xec69('0x6'));var Mustache=require(_0xec69('0x7'));var util=require(_0xec69('0x8'));var path=require(_0xec69('0x9'));var sox=require(_0xec69('0xa'));var csv=require('to-csv');var ejs=require(_0xec69('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec69('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec69('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xec69('0xe'));var Papa=require(_0xec69('0xf'));var Redis=require('ioredis');var authService=require(_0xec69('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xec69('0x11'));var hardwareService=require(_0xec69('0x12'));var logger=require(_0xec69('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xec69('0x14'));var licenseUtil=require(_0xec69('0x15'));var db=require(_0xec69('0x16'))['db'];var jayson=require(_0xec69('0x17'));var client=jayson[_0xec69('0x18')][_0xec69('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x434064,_0x2cde6a,_0x12efbf,_0x4d9104){return new BPromise(function(_0x41ba2d,_0x307743){var _0x3d1594=_0x4d9104||client;return _0x3d1594['request'](_0x434064,_0x12efbf)[_0xec69('0x1a')](function(_0x4e88b5){logger[_0xec69('0x1b')](_0xec69('0x1c'),_0x2cde6a,'request\x20sent');logger[_0xec69('0x1d')](_0xec69('0x1e'),_0x2cde6a,'request\x20sent',JSON['stringify'](_0x4e88b5));if(_0x4e88b5[_0xec69('0x1f')]){if(_0x4e88b5[_0xec69('0x1f')][_0xec69('0x20')]===0x1f4){logger[_0xec69('0x1f')](_0xec69('0x1c'),_0x2cde6a,_0x4e88b5[_0xec69('0x1f')][_0xec69('0x21')]);return _0x307743(_0x4e88b5[_0xec69('0x1f')][_0xec69('0x21')]);}logger['error'](_0xec69('0x1c'),_0x2cde6a,_0x4e88b5[_0xec69('0x1f')][_0xec69('0x21')]);return _0x41ba2d(_0x4e88b5[_0xec69('0x1f')][_0xec69('0x21')]);}else{logger[_0xec69('0x1b')](_0xec69('0x1c'),_0x2cde6a,_0xec69('0x22'));_0x41ba2d(_0x4e88b5[_0xec69('0x23')][_0xec69('0x21')]);}})[_0xec69('0x24')](function(_0x1efb8a){logger[_0xec69('0x1f')](_0xec69('0x1c'),_0x2cde6a,_0x1efb8a);_0x307743(_0x1efb8a);});});}function respondWithStatusCode(_0x29e6f3,_0x379423){_0x379423=_0x379423||0xcc;return function(_0xfefcdc){if(_0xfefcdc){return _0x29e6f3['sendStatus'](_0x379423);}return _0x29e6f3['status'](_0x379423)[_0xec69('0x25')]();};}function respondWithResult(_0x158064,_0xd6bc55){_0xd6bc55=_0xd6bc55||0xc8;return function(_0x590b34){if(_0x590b34){return _0x158064[_0xec69('0x26')](_0xd6bc55)[_0xec69('0x27')](_0x590b34);}};}function respondWithFilteredResult(_0x25d093,_0x115fdd){return function(_0x10c4c5){if(_0x10c4c5){var _0x465b0f=typeof _0x115fdd[_0xec69('0x28')]===_0xec69('0x29')&&typeof _0x115fdd[_0xec69('0x2a')]===_0xec69('0x29');var _0x57bddf=_0x10c4c5[_0xec69('0x2b')];var _0x2f0e7d=_0x465b0f?0x0:_0x115fdd[_0xec69('0x28')];var _0x3dfb64=_0x465b0f?_0x10c4c5[_0xec69('0x2b')]:_0x115fdd[_0xec69('0x28')]+_0x115fdd['limit'];var _0x64305b;if(_0x3dfb64>=_0x57bddf){_0x3dfb64=_0x57bddf;_0x64305b=0xc8;}else{_0x64305b=0xce;}_0x25d093['status'](_0x64305b);return _0x25d093[_0xec69('0x2c')](_0xec69('0x2d'),_0x2f0e7d+'-'+_0x3dfb64+'/'+_0x57bddf)[_0xec69('0x27')](_0x10c4c5);}return null;};}function patchUpdates(_0x2cf98b){return function(_0x209447){try{jsonpatch[_0xec69('0x2e')](_0x209447,_0x2cf98b,!![]);}catch(_0x387709){return BPromise['reject'](_0x387709);}return _0x209447[_0xec69('0x2f')]();};}function saveUpdates(_0x5bc78b,_0x5c5a6f){return function(_0x45d476){if(_0x45d476){return _0x45d476['update'](_0x5bc78b)[_0xec69('0x1a')](function(_0xffc26){return _0xffc26;});}return null;};}function removeEntity(_0x11e213,_0x5f1118){return function(_0x4544d6){if(_0x4544d6){return _0x4544d6[_0xec69('0x30')]()[_0xec69('0x1a')](function(){var _0x282399=_0x4544d6[_0xec69('0x31')]({'plain':!![]});var _0x1c495e=_0xec69('0x32');return db[_0xec69('0x33')]['destroy']({'where':{'type':_0x1c495e,'resourceId':_0x282399['id']}})[_0xec69('0x1a')](function(){return _0x4544d6;});})[_0xec69('0x1a')](function(){_0x11e213[_0xec69('0x26')](0xcc)[_0xec69('0x25')]();});}};}function handleEntityNotFound(_0x5d1624,_0xe270c6){return function(_0x1a05f6){if(!_0x1a05f6){_0x5d1624[_0xec69('0x34')](0x194);}return _0x1a05f6;};}function handleError(_0x23f9c2,_0x26c833){_0x26c833=_0x26c833||0x1f4;return function(_0x163595){logger['error'](_0x163595['stack']);if(_0x163595[_0xec69('0x35')]){delete _0x163595[_0xec69('0x35')];}_0x23f9c2[_0xec69('0x26')](_0x26c833)[_0xec69('0x36')](_0x163595);};}exports[_0xec69('0x37')]=function(_0x305545,_0x4c6d46){var _0xe22b02={},_0x9f5d9d={},_0x5049d8={'count':0x0,'rows':[]};var _0x2dd232=_[_0xec69('0x38')](db[_0xec69('0x39')][_0xec69('0x3a')],function(_0x4cf805){return{'name':_0x4cf805[_0xec69('0x3b')],'type':_0x4cf805['type'][_0xec69('0x3c')]};});_0x9f5d9d['model']=_[_0xec69('0x38')](_0x2dd232,'name');_0x9f5d9d[_0xec69('0x3d')]=_[_0xec69('0x3e')](_0x305545['query']);_0x9f5d9d[_0xec69('0x3f')]=_[_0xec69('0x40')](_0x9f5d9d[_0xec69('0x41')],_0x9f5d9d[_0xec69('0x3d')]);_0xe22b02[_0xec69('0x42')]=_[_0xec69('0x40')](_0x9f5d9d[_0xec69('0x41')],qs[_0xec69('0x43')](_0x305545[_0xec69('0x3d')]['fields']));_0xe22b02[_0xec69('0x42')]=_0xe22b02[_0xec69('0x42')]['length']?_0xe22b02[_0xec69('0x42')]:_0x9f5d9d['model'];if(!_0x305545['query'][_0xec69('0x44')](_0xec69('0x45'))){_0xe22b02[_0xec69('0x2a')]=qs[_0xec69('0x2a')](_0x305545[_0xec69('0x3d')]['limit']);_0xe22b02[_0xec69('0x28')]=qs['offset'](_0x305545['query']['offset']);}_0xe22b02[_0xec69('0x46')]=qs[_0xec69('0x47')](_0x305545[_0xec69('0x3d')][_0xec69('0x47')]);_0xe22b02[_0xec69('0x48')]=qs['filters'](_['pick'](_0x305545['query'],_0x9f5d9d['filters']),_0x2dd232);if(_0x305545[_0xec69('0x3d')]['filter']){_0xe22b02['where']=_[_0xec69('0x49')](_0xe22b02[_0xec69('0x48')],{'$or':_[_0xec69('0x38')](_0x2dd232,function(_0x41310b){if(_0x41310b['type']!==_0xec69('0x4a')){var _0x48ed97={};_0x48ed97[_0x41310b[_0xec69('0x35')]]={'$like':'%'+_0x305545[_0xec69('0x3d')]['filter']+'%'};return _0x48ed97;}})});}_0xe22b02=_[_0xec69('0x49')]({},_0xe22b02,_0x305545[_0xec69('0x4b')]);var _0xd81d2d={'where':_0xe22b02[_0xec69('0x48')]};return db[_0xec69('0x39')][_0xec69('0x2b')](_0xd81d2d)[_0xec69('0x1a')](function(_0x4afe08){_0x5049d8[_0xec69('0x2b')]=_0x4afe08;if(_0x305545[_0xec69('0x3d')][_0xec69('0x4c')]){_0xe22b02['include']=[{'all':!![]}];}return db[_0xec69('0x39')][_0xec69('0x4d')](_0xe22b02);})[_0xec69('0x1a')](function(_0x13dad5){_0x5049d8[_0xec69('0x4e')]=_0x13dad5;return _0x5049d8;})[_0xec69('0x1a')](respondWithFilteredResult(_0x4c6d46,_0xe22b02))[_0xec69('0x24')](handleError(_0x4c6d46,null));};exports['show']=function(_0x1a8010,_0x4699bd){var _0x1db78e={'raw':![],'where':{'id':_0x1a8010[_0xec69('0x4f')]['id']}},_0xb3aadb={};_0xb3aadb[_0xec69('0x41')]=_[_0xec69('0x3e')](db['VoiceContext'][_0xec69('0x3a')]);_0xb3aadb[_0xec69('0x3d')]=_[_0xec69('0x3e')](_0x1a8010[_0xec69('0x3d')]);_0xb3aadb['filters']=_[_0xec69('0x40')](_0xb3aadb[_0xec69('0x41')],_0xb3aadb['query']);_0x1db78e[_0xec69('0x42')]=_[_0xec69('0x40')](_0xb3aadb[_0xec69('0x41')],qs[_0xec69('0x43')](_0x1a8010['query']['fields']));_0x1db78e[_0xec69('0x42')]=_0x1db78e[_0xec69('0x42')]['length']?_0x1db78e[_0xec69('0x42')]:_0xb3aadb['model'];if(_0x1a8010[_0xec69('0x3d')]['includeAll']){_0x1db78e[_0xec69('0x50')]=[{'all':!![]}];}_0x1db78e=_[_0xec69('0x49')]({},_0x1db78e,_0x1a8010['options']);return db[_0xec69('0x39')][_0xec69('0x51')](_0x1db78e)[_0xec69('0x1a')](handleEntityNotFound(_0x4699bd,null))[_0xec69('0x1a')](respondWithResult(_0x4699bd,null))['catch'](handleError(_0x4699bd,null));};exports[_0xec69('0x52')]=function(_0x14532d,_0xa10beb,_0x2253ce){var _0x36a75a;return db[_0xec69('0x39')][_0xec69('0x52')](_0x14532d['body'],{'raw':!![]})['then'](function(_0x3be4a0){_0x36a75a=_0x3be4a0;return db[_0xec69('0x39')][_0xec69('0x4d')]({'raw':!![]});})['then'](function(_0x43ea3a){var _0x19a840=fs[_0xec69('0x53')](path[_0xec69('0x54')](config['root'],_0xec69('0x55')),_0xec69('0x56'));var _0x5c2850=ejs[_0xec69('0x57')](_0x19a840,{'contexts':_0x43ea3a||[]});fs[_0xec69('0x58')](_0xec69('0x59'),_0x5c2850);})[_0xec69('0x1a')](function(){return respondWithRpcPromise(_0xec69('0x5a'),_0xec69('0x52'),{'module':'chan_sip.so'});})[_0xec69('0x1a')](function(){var _0x230e78=_0x14532d['user'][_0xec69('0x31')]({'plain':!![]});if(!_0x230e78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x230e78[_0xec69('0x5b')]===_0xec69('0x5c')){var _0x253fcf=_0x36a75a[_0xec69('0x31')]({'plain':!![]});return db[_0xec69('0x5d')][_0xec69('0x51')]({'where':{'name':'Contexts','userProfileId':_0x230e78[_0xec69('0x5e')]},'raw':!![]})[_0xec69('0x1a')](function(_0x1d553e){if(_0x1d553e&&_0x1d553e[_0xec69('0x5f')]===0x0){return db[_0xec69('0x33')][_0xec69('0x52')]({'name':_0x253fcf[_0xec69('0x35')],'resourceId':_0x253fcf['id'],'type':_0x1d553e['name'],'sectionId':_0x1d553e['id']},{})[_0xec69('0x1a')](function(){return _0x36a75a;});}else{return _0x36a75a;}})[_0xec69('0x24')](function(_0x2f71f3){logger[_0xec69('0x1f')](_0xec69('0x60'),_0x2f71f3);throw _0x2f71f3;});}return _0x36a75a;})[_0xec69('0x1a')](respondWithResult(_0xa10beb,0xc9))[_0xec69('0x24')](handleError(_0xa10beb,null));};exports[_0xec69('0x61')]=function(_0x3ed597,_0x1821e6,_0x5865f1){var _0x5c26ed;return db[_0xec69('0x39')]['find']({'where':{'id':_0x3ed597[_0xec69('0x4f')]['id']}})[_0xec69('0x1a')](handleEntityNotFound(_0x1821e6,null))[_0xec69('0x1a')](saveUpdates(_0x3ed597[_0xec69('0x62')],null))[_0xec69('0x1a')](function(_0x509feb){if(_0x509feb){_0x5c26ed=_0x509feb;return db[_0xec69('0x39')][_0xec69('0x4d')]({'raw':!![]});}})[_0xec69('0x1a')](function(_0x3078a3){var _0x32e72a=fs[_0xec69('0x53')](path[_0xec69('0x54')](config['root'],_0xec69('0x55')),_0xec69('0x56'));var _0x286087=ejs[_0xec69('0x57')](_0x32e72a,{'contexts':_0x3078a3||[]});fs[_0xec69('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x286087);})[_0xec69('0x1a')](function(){return respondWithRpcPromise(_0xec69('0x5a'),_0xec69('0x61'),{'module':_0xec69('0x63')});})[_0xec69('0x1a')](function(){return _0x5c26ed;})['then'](respondWithResult(_0x1821e6,null))[_0xec69('0x24')](handleError(_0x1821e6,null));};exports[_0xec69('0x30')]=function(_0x11a875,_0x456830,_0x50d408){var _0x167232;return db[_0xec69('0x39')][_0xec69('0x51')]({'where':{'id':_0x11a875[_0xec69('0x4f')]['id']}})[_0xec69('0x1a')](handleEntityNotFound(_0x456830,null))[_0xec69('0x1a')](removeEntity(_0x456830,null))[_0xec69('0x1a')](function(){return db[_0xec69('0x39')]['findAll']({'raw':!![]});})[_0xec69('0x1a')](function(_0x51df68){var _0x3bbc05=fs[_0xec69('0x53')](path[_0xec69('0x54')](config[_0xec69('0x64')],_0xec69('0x55')),_0xec69('0x56'));var _0xf288a2=ejs[_0xec69('0x57')](_0x3bbc05,{'contexts':_0x51df68});fs[_0xec69('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xf288a2);return respondWithRpcPromise('Reload','destroy',{'module':_0xec69('0x63')});})[_0xec69('0x24')](handleError(_0x456830,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index b41ea23..81156f8 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 _0xabc1=['path','rimraf','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a4400,_0xfae3b6){var _0xf9b532=function(_0x39804e){while(--_0x39804e){_0x5a4400['push'](_0x5a4400['shift']());}};_0xf9b532(++_0xfae3b6);}(_0xabc1,0x13e));var _0x1abc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xabc1[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x1abc('0x0'));var util=require(_0x1abc('0x1'));var logger=require(_0x1abc('0x2'))(_0x1abc('0x3'));var moment=require(_0x1abc('0x4'));var BPromise=require(_0x1abc('0x5'));var rp=require(_0x1abc('0x6'));var fs=require('fs');var path=require(_0x1abc('0x7'));var rimraf=require(_0x1abc('0x8'));var config=require('../../config/environment');var attributes=require(_0x1abc('0x9'));module[_0x1abc('0xa')]=function(_0x5c9892,_0x1057d1){return _0x5c9892[_0x1abc('0xb')]('VoiceContext',attributes,{'tableName':_0x1abc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x076b=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x076b,0x1c1));var _0xb076=function(_0x558030,_0x2bf6a5){_0x558030=_0x558030-0x0;var _0x839597=_0x076b[_0x558030];return _0x839597;};'use strict';var _=require(_0xb076('0x0'));var util=require(_0xb076('0x1'));var logger=require(_0xb076('0x2'))(_0xb076('0x3'));var moment=require(_0xb076('0x4'));var BPromise=require(_0xb076('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb076('0x6'));var config=require(_0xb076('0x7'));var attributes=require(_0xb076('0x8'));module['exports']=function(_0x5d7e47,_0x53134b){return _0x5d7e47[_0xb076('0x9')](_0xb076('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 101b7f3..899f4a9 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 _0x9e6b=['request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9e6b[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var moment=require('moment');var BPromise=require(_0xb9e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9e6('0x3'))['db'];var utils=require(_0xb9e6('0x4'));var logger=require(_0xb9e6('0x5'))(_0xb9e6('0x6'));var config=require('../../config/environment');var jayson=require(_0xb9e6('0x7'));var client=jayson[_0xb9e6('0x8')][_0xb9e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bb674,_0x2cbcf7,_0x49565c){return new BPromise(function(_0x5a54db,_0x4cc018){return client[_0xb9e6('0xa')](_0x4bb674,_0x49565c)['then'](function(_0x378e17){logger[_0xb9e6('0xb')](_0xb9e6('0xc'),_0x2cbcf7,_0xb9e6('0xd'));logger[_0xb9e6('0xe')](_0xb9e6('0xf'),_0x2cbcf7,_0xb9e6('0xd'),JSON[_0xb9e6('0x10')](_0x378e17));if(_0x378e17[_0xb9e6('0x11')]){if(_0x378e17[_0xb9e6('0x11')]['code']===0x1f4){logger[_0xb9e6('0x11')](_0xb9e6('0xc'),_0x2cbcf7,_0x378e17[_0xb9e6('0x11')][_0xb9e6('0x12')]);return _0x4cc018(_0x378e17['error'][_0xb9e6('0x12')]);}logger[_0xb9e6('0x11')]('VoiceContext,\x20%s,\x20%s',_0x2cbcf7,_0x378e17['error'][_0xb9e6('0x12')]);return _0x5a54db(_0x378e17[_0xb9e6('0x11')][_0xb9e6('0x12')]);}else{logger[_0xb9e6('0xb')]('VoiceContext,\x20%s,\x20%s',_0x2cbcf7,_0xb9e6('0xd'));_0x5a54db(_0x378e17[_0xb9e6('0x13')][_0xb9e6('0x12')]);}})[_0xb9e6('0x14')](function(_0x15aa3d){logger[_0xb9e6('0x11')](_0xb9e6('0xc'),_0x2cbcf7,_0x15aa3d);_0x4cc018(_0x15aa3d);});});} \ No newline at end of file +var _0xdc5d=['../../config/logger','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x580005,_0x55e402){var _0x12defc=function(_0xb57f09){while(--_0xb57f09){_0x580005['push'](_0x580005['shift']());}};_0x12defc(++_0x55e402);}(_0xdc5d,0x14d));var _0xddc5=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xdc5d[_0x1d1963];return _0x3f58bb;};'use strict';var _=require(_0xddc5('0x0'));var util=require(_0xddc5('0x1'));var moment=require(_0xddc5('0x2'));var BPromise=require(_0xddc5('0x3'));var rs=require(_0xddc5('0x4'));var fs=require('fs');var Redis=require(_0xddc5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xddc5('0x6'));var logger=require(_0xddc5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xddc5('0x8'));var client=jayson[_0xddc5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x82fb3c,_0x5669ca,_0x234590){return new BPromise(function(_0x250a6d,_0x5a4ee5){return client['request'](_0x82fb3c,_0x234590)[_0xddc5('0xa')](function(_0x2a1e2d){logger[_0xddc5('0xb')](_0xddc5('0xc'),_0x5669ca,_0xddc5('0xd'));logger[_0xddc5('0xe')](_0xddc5('0xf'),_0x5669ca,_0xddc5('0xd'),JSON['stringify'](_0x2a1e2d));if(_0x2a1e2d['error']){if(_0x2a1e2d[_0xddc5('0x10')]['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5669ca,_0x2a1e2d[_0xddc5('0x10')][_0xddc5('0x11')]);return _0x5a4ee5(_0x2a1e2d[_0xddc5('0x10')][_0xddc5('0x11')]);}logger[_0xddc5('0x10')](_0xddc5('0xc'),_0x5669ca,_0x2a1e2d['error']['message']);return _0x250a6d(_0x2a1e2d[_0xddc5('0x10')][_0xddc5('0x11')]);}else{logger[_0xddc5('0xb')](_0xddc5('0xc'),_0x5669ca,_0xddc5('0xd'));_0x250a6d(_0x2a1e2d[_0xddc5('0x12')][_0xddc5('0x11')]);}})[_0xddc5('0x13')](function(_0x321f22){logger[_0xddc5('0x10')](_0xddc5('0xc'),_0x5669ca,_0x321f22);_0x5a4ee5(_0x321f22);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 89b6db6..0bda182 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 _0x663c=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','update','destroy'];(function(_0x1bf3b1,_0x52edd4){var _0x58da35=function(_0x5eefd7){while(--_0x5eefd7){_0x1bf3b1['push'](_0x1bf3b1['shift']());}};_0x58da35(++_0x52edd4);}(_0x663c,0x1ef));var _0xc663=function(_0x37a0ab,_0x34b900){_0x37a0ab=_0x37a0ab-0x0;var _0x13ca1d=_0x663c[_0x37a0ab];return _0x13ca1d;};'use strict';var multer=require(_0xc663('0x0'));var util=require('util');var path=require(_0xc663('0x1'));var timeout=require(_0xc663('0x2'));var express=require(_0xc663('0x3'));var router=express[_0xc663('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc663('0x5'));var interaction=require(_0xc663('0x6'));var config=require(_0xc663('0x7'));var controller=require('./voiceDialReport.controller');router[_0xc663('0x8')]('/',auth[_0xc663('0x9')](),controller[_0xc663('0xa')]);router[_0xc663('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xc663('0xb')]);router[_0xc663('0x8')](_0xc663('0xc'),auth[_0xc663('0x9')](),controller[_0xc663('0xd')]);router[_0xc663('0xe')]('/',auth[_0xc663('0x9')](),controller[_0xc663('0xf')]);router['put'](_0xc663('0xc'),auth[_0xc663('0x9')](),controller[_0xc663('0x10')]);router['delete'](_0xc663('0xc'),auth['isAuthenticated'](),controller[_0xc663('0x11')]);module[_0xc663('0x12')]=router; \ No newline at end of file +var _0xde5d=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','multer'];(function(_0x56f704,_0x17e3d4){var _0xd833d6=function(_0x817cce){while(--_0x817cce){_0x56f704['push'](_0x56f704['shift']());}};_0xd833d6(++_0x17e3d4);}(_0xde5d,0xd7));var _0xdde5=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xde5d[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0xdde5('0x0'));var util=require('util');var path=require(_0xdde5('0x1'));var timeout=require(_0xdde5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdde5('0x3'));var auth=require(_0xdde5('0x4'));var interaction=require(_0xdde5('0x5'));var config=require('../../config/environment');var controller=require(_0xdde5('0x6'));router[_0xdde5('0x7')]('/',auth[_0xdde5('0x8')](),controller[_0xdde5('0x9')]);router['get'](_0xdde5('0xa'),auth['isAuthenticated'](),controller[_0xdde5('0xb')]);router['get'](_0xdde5('0xc'),auth[_0xdde5('0x8')](),controller['show']);router[_0xdde5('0xd')]('/',auth['isAuthenticated'](),controller[_0xdde5('0xe')]);router[_0xdde5('0xf')](_0xdde5('0xc'),auth['isAuthenticated'](),controller[_0xdde5('0x10')]);router[_0xdde5('0x11')](_0xdde5('0xc'),auth[_0xdde5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 7782a30..ba71e54 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 _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x5ae93d,_0x48a929){var _0x3bc344=function(_0x37d1e8){while(--_0x37d1e8){_0x5ae93d['push'](_0x5ae93d['shift']());}};_0x3bc344(++_0x48a929);}(_0x9f62,0x154));var _0x29f6=function(_0xfc7143,_0x1995ee){_0xfc7143=_0xfc7143-0x0;var _0x4c0c40=_0x9f62[_0xfc7143];return _0x4c0c40;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}}; \ No newline at end of file +var _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x2c022d,_0x53e9c5){var _0x1b835f=function(_0x4671b1){while(--_0x4671b1){_0x2c022d['push'](_0x2c022d['shift']());}};_0x1b835f(++_0x53e9c5);}(_0x81bd,0x7c));var _0xd81b=function(_0x2304ce,_0x5e2bb0){_0x2304ce=_0x2304ce-0x0;var _0x503964=_0x81bd[_0x2304ce];return _0x503964;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index f30bef2..e0c97b6 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 _0x69e2=['show','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','VoiceDialReport','rawAttributes','fieldName','model','name','query','keys','filters','intersection','fields','attributes','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x69e2,0xef));var _0x269e=function(_0x35e5fe,_0x335017){_0x35e5fe=_0x35e5fe-0x0;var _0x3c2910=_0x69e2[_0x35e5fe];return _0x3c2910;};'use strict';var emlformat=require(_0x269e('0x0'));var rimraf=require(_0x269e('0x1'));var zipdir=require(_0x269e('0x2'));var jsonpatch=require(_0x269e('0x3'));var rp=require(_0x269e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x269e('0x5'));var util=require(_0x269e('0x6'));var path=require('path');var sox=require(_0x269e('0x7'));var csv=require(_0x269e('0x8'));var ejs=require(_0x269e('0x9'));var fs=require('fs');var fs_extra=require(_0x269e('0xa'));var _=require(_0x269e('0xb'));var squel=require(_0x269e('0xc'));var crypto=require(_0x269e('0xd'));var jsforce=require(_0x269e('0xe'));var deskjs=require(_0x269e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x269e('0x10'));var Papa=require(_0x269e('0x11'));var Redis=require(_0x269e('0x12'));var authService=require(_0x269e('0x13'));var qs=require(_0x269e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x269e('0x15'));var logger=require('../../config/logger')(_0x269e('0x16'));var utils=require(_0x269e('0x17'));var config=require(_0x269e('0x18'));var licenseUtil=require(_0x269e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x157324,_0xc9daa){_0xc9daa=_0xc9daa||0xcc;return function(_0x2e6b77){if(_0x2e6b77){return _0x157324[_0x269e('0x1a')](_0xc9daa);}return _0x157324[_0x269e('0x1b')](_0xc9daa)[_0x269e('0x1c')]();};}function respondWithResult(_0x1f6231,_0x6b4c1c){_0x6b4c1c=_0x6b4c1c||0xc8;return function(_0x121f49){if(_0x121f49){return _0x1f6231['status'](_0x6b4c1c)[_0x269e('0x1d')](_0x121f49);}};}function respondWithFilteredResult(_0x21fb6b,_0x840c06){return function(_0x4869eb){if(_0x4869eb){var _0x3a9e7e=typeof _0x840c06[_0x269e('0x1e')]===_0x269e('0x1f')&&typeof _0x840c06[_0x269e('0x20')]==='undefined';var _0x551cd6=_0x4869eb[_0x269e('0x21')];var _0x32fc27=_0x3a9e7e?0x0:_0x840c06[_0x269e('0x1e')];var _0x1b0403=_0x3a9e7e?_0x4869eb[_0x269e('0x21')]:_0x840c06[_0x269e('0x1e')]+_0x840c06[_0x269e('0x20')];var _0x3a35e3;if(_0x1b0403>=_0x551cd6){_0x1b0403=_0x551cd6;_0x3a35e3=0xc8;}else{_0x3a35e3=0xce;}_0x21fb6b[_0x269e('0x1b')](_0x3a35e3);return _0x21fb6b['set'](_0x269e('0x22'),_0x32fc27+'-'+_0x1b0403+'/'+_0x551cd6)['json'](_0x4869eb);}return null;};}function patchUpdates(_0x2f7e21){return function(_0x4cc92c){try{jsonpatch[_0x269e('0x23')](_0x4cc92c,_0x2f7e21,!![]);}catch(_0x239708){return BPromise['reject'](_0x239708);}return _0x4cc92c[_0x269e('0x24')]();};}function saveUpdates(_0x4b35d9,_0x476421){return function(_0x56f7be){if(_0x56f7be){return _0x56f7be[_0x269e('0x25')](_0x4b35d9)[_0x269e('0x26')](function(_0x556c9f){return _0x556c9f;});}return null;};}function removeEntity(_0x2186e6,_0x4eaedc){return function(_0xd420d1){if(_0xd420d1){return _0xd420d1[_0x269e('0x27')]()[_0x269e('0x26')](function(){_0x2186e6['status'](0xcc)[_0x269e('0x1c')]();});}};}function handleEntityNotFound(_0x5e4e64,_0x54558b){return function(_0x5ac263){if(!_0x5ac263){_0x5e4e64['sendStatus'](0x194);}return _0x5ac263;};}function handleError(_0xaa7f4c,_0x12eba5){_0x12eba5=_0x12eba5||0x1f4;return function(_0x4f8f90){logger[_0x269e('0x28')](_0x4f8f90[_0x269e('0x29')]);if(_0x4f8f90['name']){delete _0x4f8f90['name'];}_0xaa7f4c['status'](_0x12eba5)[_0x269e('0x2a')](_0x4f8f90);};}exports[_0x269e('0x2b')]=function(_0xbfdbf9,_0x49dbcd){var _0x45230a={},_0x7a349b={},_0xbe67cc={'count':0x0,'rows':[]};var _0x4fcb40=_[_0x269e('0x2c')](db[_0x269e('0x2d')][_0x269e('0x2e')],function(_0x25ab8f){return{'name':_0x25ab8f[_0x269e('0x2f')],'type':_0x25ab8f['type']['key']};});_0x7a349b[_0x269e('0x30')]=_[_0x269e('0x2c')](_0x4fcb40,_0x269e('0x31'));_0x7a349b[_0x269e('0x32')]=_[_0x269e('0x33')](_0xbfdbf9['query']);_0x7a349b[_0x269e('0x34')]=_[_0x269e('0x35')](_0x7a349b[_0x269e('0x30')],_0x7a349b['query']);_0x45230a['attributes']=_[_0x269e('0x35')](_0x7a349b[_0x269e('0x30')],qs[_0x269e('0x36')](_0xbfdbf9[_0x269e('0x32')][_0x269e('0x36')]));_0x45230a[_0x269e('0x37')]=_0x45230a['attributes']['length']?_0x45230a['attributes']:_0x7a349b['model'];if(!_0xbfdbf9[_0x269e('0x32')]['hasOwnProperty']('nolimit')){_0x45230a[_0x269e('0x20')]=qs['limit'](_0xbfdbf9[_0x269e('0x32')][_0x269e('0x20')]);_0x45230a[_0x269e('0x1e')]=qs[_0x269e('0x1e')](_0xbfdbf9[_0x269e('0x32')][_0x269e('0x1e')]);}_0x45230a[_0x269e('0x38')]=qs[_0x269e('0x39')](_0xbfdbf9[_0x269e('0x32')][_0x269e('0x39')]);_0x45230a['where']=qs[_0x269e('0x34')](_[_0x269e('0x3a')](_0xbfdbf9[_0x269e('0x32')],_0x7a349b[_0x269e('0x34')]),_0x4fcb40);if(_0xbfdbf9[_0x269e('0x32')][_0x269e('0x3b')]){_0x45230a[_0x269e('0x3c')]=_[_0x269e('0x3d')](_0x45230a['where'],{'$or':_[_0x269e('0x2c')](_0x4fcb40,function(_0x460c3e){if(_0x460c3e[_0x269e('0x3e')]!==_0x269e('0x3f')){var _0x56ab9f={};_0x56ab9f[_0x460c3e[_0x269e('0x31')]]={'$like':'%'+_0xbfdbf9[_0x269e('0x32')][_0x269e('0x3b')]+'%'};return _0x56ab9f;}})});}_0x45230a=_[_0x269e('0x3d')]({},_0x45230a,_0xbfdbf9['options']);var _0x153bc0={'where':_0x45230a[_0x269e('0x3c')]};return db['VoiceDialReport'][_0x269e('0x21')](_0x153bc0)[_0x269e('0x26')](function(_0x298932){_0xbe67cc[_0x269e('0x21')]=_0x298932;if(_0xbfdbf9[_0x269e('0x32')][_0x269e('0x40')]){_0x45230a[_0x269e('0x41')]=[{'all':!![]}];}return db[_0x269e('0x2d')][_0x269e('0x42')](_0x45230a);})[_0x269e('0x26')](function(_0x11d140){_0xbe67cc[_0x269e('0x43')]=_0x11d140;return _0xbe67cc;})[_0x269e('0x26')](respondWithFilteredResult(_0x49dbcd,_0x45230a))[_0x269e('0x44')](handleError(_0x49dbcd,null));};exports[_0x269e('0x45')]=function(_0x57c424,_0x3b6ef9){var _0x3b792f={'raw':!![],'where':{'id':_0x57c424[_0x269e('0x46')]['id']}},_0x4645f4={};_0x4645f4[_0x269e('0x30')]=_['keys'](db[_0x269e('0x2d')][_0x269e('0x2e')]);_0x4645f4['query']=_['keys'](_0x57c424[_0x269e('0x32')]);_0x4645f4[_0x269e('0x34')]=_[_0x269e('0x35')](_0x4645f4['model'],_0x4645f4[_0x269e('0x32')]);_0x3b792f[_0x269e('0x37')]=_[_0x269e('0x35')](_0x4645f4[_0x269e('0x30')],qs['fields'](_0x57c424[_0x269e('0x32')][_0x269e('0x36')]));_0x3b792f[_0x269e('0x37')]=_0x3b792f[_0x269e('0x37')][_0x269e('0x47')]?_0x3b792f[_0x269e('0x37')]:_0x4645f4[_0x269e('0x30')];if(_0x57c424[_0x269e('0x32')][_0x269e('0x40')]){_0x3b792f['include']=[{'all':!![]}];}_0x3b792f=_[_0x269e('0x3d')]({},_0x3b792f,_0x57c424[_0x269e('0x48')]);return db[_0x269e('0x2d')][_0x269e('0x49')](_0x3b792f)[_0x269e('0x26')](handleEntityNotFound(_0x3b6ef9,null))[_0x269e('0x26')](respondWithResult(_0x3b6ef9,null))[_0x269e('0x44')](handleError(_0x3b6ef9,null));};exports[_0x269e('0x4a')]=function(_0x362684,_0x4d6e66){return db[_0x269e('0x2d')][_0x269e('0x4a')](_0x362684['body'],{})[_0x269e('0x26')](respondWithResult(_0x4d6e66,0xc9))[_0x269e('0x44')](handleError(_0x4d6e66,null));};exports[_0x269e('0x25')]=function(_0x466f89,_0x5aa7ce){if(_0x466f89['body']['id']){delete _0x466f89[_0x269e('0x4b')]['id'];}return db[_0x269e('0x2d')][_0x269e('0x49')]({'where':{'id':_0x466f89[_0x269e('0x46')]['id']}})['then'](handleEntityNotFound(_0x5aa7ce,null))[_0x269e('0x26')](saveUpdates(_0x466f89[_0x269e('0x4b')],null))['then'](respondWithResult(_0x5aa7ce,null))[_0x269e('0x44')](handleError(_0x5aa7ce,null));};exports[_0x269e('0x27')]=function(_0x168175,_0xc4e6e1){return db[_0x269e('0x2d')][_0x269e('0x49')]({'where':{'id':_0x168175[_0x269e('0x46')]['id']}})[_0x269e('0x26')](handleEntityNotFound(_0xc4e6e1,null))[_0x269e('0x26')](removeEntity(_0xc4e6e1,null))['catch'](handleError(_0xc4e6e1,null));};exports[_0x269e('0x4c')]=function(_0x47dcf6,_0x2cb212){return db[_0x269e('0x2d')]['describe']()[_0x269e('0x26')](respondWithResult(_0x2cb212,null))['catch'](handleError(_0x2cb212,null));}; \ No newline at end of file +var _0xb208=['crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','fields','attributes','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','VoiceDialReport','includeAll','findAll','catch','show','params','intersection','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x58ee9f,_0x230f5c){var _0x3b8c28=function(_0x3e3d34){while(--_0x3e3d34){_0x58ee9f['push'](_0x58ee9f['shift']());}};_0x3b8c28(++_0x230f5c);}(_0xb208,0x1b0));var _0x8b20=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb208[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b20('0x0'));var zipdir=require(_0x8b20('0x1'));var jsonpatch=require(_0x8b20('0x2'));var rp=require(_0x8b20('0x3'));var moment=require(_0x8b20('0x4'));var BPromise=require(_0x8b20('0x5'));var Mustache=require(_0x8b20('0x6'));var util=require(_0x8b20('0x7'));var path=require(_0x8b20('0x8'));var sox=require(_0x8b20('0x9'));var csv=require('to-csv');var ejs=require(_0x8b20('0xa'));var fs=require('fs');var fs_extra=require(_0x8b20('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8b20('0xc'));var jsforce=require(_0x8b20('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8b20('0xe'));var querystring=require('querystring');var Papa=require(_0x8b20('0xf'));var Redis=require(_0x8b20('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b20('0x11'));var as=require(_0x8b20('0x12'));var hardwareService=require(_0x8b20('0x13'));var logger=require(_0x8b20('0x14'))(_0x8b20('0x15'));var utils=require(_0x8b20('0x16'));var config=require(_0x8b20('0x17'));var licenseUtil=require(_0x8b20('0x18'));var db=require(_0x8b20('0x19'))['db'];function respondWithStatusCode(_0x2b93d3,_0x5d3aea){_0x5d3aea=_0x5d3aea||0xcc;return function(_0x278340){if(_0x278340){return _0x2b93d3['sendStatus'](_0x5d3aea);}return _0x2b93d3[_0x8b20('0x1a')](_0x5d3aea)[_0x8b20('0x1b')]();};}function respondWithResult(_0x44eba1,_0xae47da){_0xae47da=_0xae47da||0xc8;return function(_0x3cae00){if(_0x3cae00){return _0x44eba1[_0x8b20('0x1a')](_0xae47da)[_0x8b20('0x1c')](_0x3cae00);}};}function respondWithFilteredResult(_0x2a1a77,_0x2bfe13){return function(_0x19de4c){if(_0x19de4c){var _0x2bcaac=typeof _0x2bfe13[_0x8b20('0x1d')]===_0x8b20('0x1e')&&typeof _0x2bfe13[_0x8b20('0x1f')]===_0x8b20('0x1e');var _0xb53631=_0x19de4c[_0x8b20('0x20')];var _0x1a9ed0=_0x2bcaac?0x0:_0x2bfe13['offset'];var _0x47871b=_0x2bcaac?_0x19de4c[_0x8b20('0x20')]:_0x2bfe13['offset']+_0x2bfe13[_0x8b20('0x1f')];var _0x10c253;if(_0x47871b>=_0xb53631){_0x47871b=_0xb53631;_0x10c253=0xc8;}else{_0x10c253=0xce;}_0x2a1a77[_0x8b20('0x1a')](_0x10c253);return _0x2a1a77[_0x8b20('0x21')](_0x8b20('0x22'),_0x1a9ed0+'-'+_0x47871b+'/'+_0xb53631)['json'](_0x19de4c);}return null;};}function patchUpdates(_0x9beb02){return function(_0x17e9d8){try{jsonpatch[_0x8b20('0x23')](_0x17e9d8,_0x9beb02,!![]);}catch(_0x188014){return BPromise[_0x8b20('0x24')](_0x188014);}return _0x17e9d8['save']();};}function saveUpdates(_0x3d08d0,_0x4a8785){return function(_0x31da2e){if(_0x31da2e){return _0x31da2e[_0x8b20('0x25')](_0x3d08d0)[_0x8b20('0x26')](function(_0x36ac96){return _0x36ac96;});}return null;};}function removeEntity(_0x2746a7,_0x21dc89){return function(_0x4f7d6e){if(_0x4f7d6e){return _0x4f7d6e[_0x8b20('0x27')]()['then'](function(){_0x2746a7['status'](0xcc)[_0x8b20('0x1b')]();});}};}function handleEntityNotFound(_0x4fd40d,_0x3534f1){return function(_0x4cd6de){if(!_0x4cd6de){_0x4fd40d[_0x8b20('0x28')](0x194);}return _0x4cd6de;};}function handleError(_0x5a08ba,_0x3db88d){_0x3db88d=_0x3db88d||0x1f4;return function(_0x21961a){logger[_0x8b20('0x29')](_0x21961a['stack']);if(_0x21961a[_0x8b20('0x2a')]){delete _0x21961a[_0x8b20('0x2a')];}_0x5a08ba[_0x8b20('0x1a')](_0x3db88d)[_0x8b20('0x2b')](_0x21961a);};}exports[_0x8b20('0x2c')]=function(_0x44bc7e,_0xe5b057){var _0x3f467c={},_0x2f565b={},_0x10a927={'count':0x0,'rows':[]};var _0x16d4e3=_[_0x8b20('0x2d')](db['VoiceDialReport'][_0x8b20('0x2e')],function(_0x36631d){return{'name':_0x36631d[_0x8b20('0x2f')],'type':_0x36631d['type'][_0x8b20('0x30')]};});_0x2f565b[_0x8b20('0x31')]=_[_0x8b20('0x2d')](_0x16d4e3,_0x8b20('0x2a'));_0x2f565b['query']=_[_0x8b20('0x32')](_0x44bc7e[_0x8b20('0x33')]);_0x2f565b[_0x8b20('0x34')]=_['intersection'](_0x2f565b[_0x8b20('0x31')],_0x2f565b['query']);_0x3f467c['attributes']=_['intersection'](_0x2f565b[_0x8b20('0x31')],qs[_0x8b20('0x35')](_0x44bc7e[_0x8b20('0x33')][_0x8b20('0x35')]));_0x3f467c[_0x8b20('0x36')]=_0x3f467c[_0x8b20('0x36')][_0x8b20('0x37')]?_0x3f467c[_0x8b20('0x36')]:_0x2f565b[_0x8b20('0x31')];if(!_0x44bc7e[_0x8b20('0x33')]['hasOwnProperty'](_0x8b20('0x38'))){_0x3f467c[_0x8b20('0x1f')]=qs[_0x8b20('0x1f')](_0x44bc7e['query']['limit']);_0x3f467c['offset']=qs[_0x8b20('0x1d')](_0x44bc7e[_0x8b20('0x33')][_0x8b20('0x1d')]);}_0x3f467c['order']=qs[_0x8b20('0x39')](_0x44bc7e[_0x8b20('0x33')][_0x8b20('0x39')]);_0x3f467c[_0x8b20('0x3a')]=qs['filters'](_['pick'](_0x44bc7e[_0x8b20('0x33')],_0x2f565b[_0x8b20('0x34')]),_0x16d4e3);if(_0x44bc7e[_0x8b20('0x33')][_0x8b20('0x3b')]){_0x3f467c['where']=_['merge'](_0x3f467c['where'],{'$or':_[_0x8b20('0x2d')](_0x16d4e3,function(_0x2004da){if(_0x2004da[_0x8b20('0x3c')]!==_0x8b20('0x3d')){var _0x1f127c={};_0x1f127c[_0x2004da[_0x8b20('0x2a')]]={'$like':'%'+_0x44bc7e[_0x8b20('0x33')][_0x8b20('0x3b')]+'%'};return _0x1f127c;}})});}_0x3f467c=_[_0x8b20('0x3e')]({},_0x3f467c,_0x44bc7e[_0x8b20('0x3f')]);var _0x51c921={'where':_0x3f467c['where']};return db[_0x8b20('0x40')]['count'](_0x51c921)[_0x8b20('0x26')](function(_0x858e47){_0x10a927[_0x8b20('0x20')]=_0x858e47;if(_0x44bc7e['query'][_0x8b20('0x41')]){_0x3f467c['include']=[{'all':!![]}];}return db[_0x8b20('0x40')][_0x8b20('0x42')](_0x3f467c);})[_0x8b20('0x26')](function(_0x18eb8c){_0x10a927['rows']=_0x18eb8c;return _0x10a927;})[_0x8b20('0x26')](respondWithFilteredResult(_0xe5b057,_0x3f467c))[_0x8b20('0x43')](handleError(_0xe5b057,null));};exports[_0x8b20('0x44')]=function(_0x97a2f,_0x5b92fe){var _0x101dad={'raw':!![],'where':{'id':_0x97a2f[_0x8b20('0x45')]['id']}},_0x564458={};_0x564458[_0x8b20('0x31')]=_[_0x8b20('0x32')](db['VoiceDialReport'][_0x8b20('0x2e')]);_0x564458[_0x8b20('0x33')]=_[_0x8b20('0x32')](_0x97a2f[_0x8b20('0x33')]);_0x564458['filters']=_['intersection'](_0x564458[_0x8b20('0x31')],_0x564458['query']);_0x101dad[_0x8b20('0x36')]=_[_0x8b20('0x46')](_0x564458[_0x8b20('0x31')],qs['fields'](_0x97a2f['query'][_0x8b20('0x35')]));_0x101dad['attributes']=_0x101dad[_0x8b20('0x36')][_0x8b20('0x37')]?_0x101dad['attributes']:_0x564458[_0x8b20('0x31')];if(_0x97a2f[_0x8b20('0x33')][_0x8b20('0x41')]){_0x101dad['include']=[{'all':!![]}];}_0x101dad=_[_0x8b20('0x3e')]({},_0x101dad,_0x97a2f['options']);return db[_0x8b20('0x40')]['find'](_0x101dad)[_0x8b20('0x26')](handleEntityNotFound(_0x5b92fe,null))['then'](respondWithResult(_0x5b92fe,null))[_0x8b20('0x43')](handleError(_0x5b92fe,null));};exports['create']=function(_0x562117,_0x45095c){return db[_0x8b20('0x40')][_0x8b20('0x47')](_0x562117['body'],{})['then'](respondWithResult(_0x45095c,0xc9))[_0x8b20('0x43')](handleError(_0x45095c,null));};exports[_0x8b20('0x25')]=function(_0x5c017d,_0xf01d64){if(_0x5c017d[_0x8b20('0x48')]['id']){delete _0x5c017d[_0x8b20('0x48')]['id'];}return db[_0x8b20('0x40')][_0x8b20('0x49')]({'where':{'id':_0x5c017d['params']['id']}})[_0x8b20('0x26')](handleEntityNotFound(_0xf01d64,null))[_0x8b20('0x26')](saveUpdates(_0x5c017d[_0x8b20('0x48')],null))[_0x8b20('0x26')](respondWithResult(_0xf01d64,null))[_0x8b20('0x43')](handleError(_0xf01d64,null));};exports[_0x8b20('0x27')]=function(_0x586ead,_0x1599de){return db[_0x8b20('0x40')]['find']({'where':{'id':_0x586ead['params']['id']}})[_0x8b20('0x26')](handleEntityNotFound(_0x1599de,null))[_0x8b20('0x26')](removeEntity(_0x1599de,null))['catch'](handleError(_0x1599de,null));};exports['describe']=function(_0x21a477,_0x5b9be2){return db[_0x8b20('0x40')]['describe']()[_0x8b20('0x26')](respondWithResult(_0x5b9be2,null))['catch'](handleError(_0x5b9be2,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index dec6e14..36d795b 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 _0x76bb=['../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','util'];(function(_0xa03344,_0x581292){var _0x38acfd=function(_0x1b1e8c){while(--_0x1b1e8c){_0xa03344['push'](_0xa03344['shift']());}};_0x38acfd(++_0x581292);}(_0x76bb,0x16a));var _0xb76b=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x76bb[_0x261b8a];return _0x3455e8;};'use strict';var _=require('lodash');var util=require(_0xb76b('0x0'));var logger=require(_0xb76b('0x1'))(_0xb76b('0x2'));var moment=require(_0xb76b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb76b('0x4'));var fs=require('fs');var path=require(_0xb76b('0x5'));var rimraf=require('rimraf');var config=require(_0xb76b('0x6'));var attributes=require(_0xb76b('0x7'));module['exports']=function(_0x42254d,_0x361737){return _0x42254d[_0xb76b('0x8')](_0xb76b('0x9'),attributes,{'tableName':_0xb76b('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x27e7=['define','VoiceDialReport','report_dial','uniqueid','lodash','moment','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27e7,0x67));var _0x727e=function(_0x4bb192,_0x52b3a3){_0x4bb192=_0x4bb192-0x0;var _0x2876f3=_0x27e7[_0x4bb192];return _0x2876f3;};'use strict';var _=require(_0x727e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x727e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x727e('0x2'));var rimraf=require(_0x727e('0x3'));var config=require(_0x727e('0x4'));var attributes=require(_0x727e('0x5'));module[_0x727e('0x6')]=function(_0x3af886,_0x29f32a){return _0x3af886[_0x727e('0x7')](_0x727e('0x8'),attributes,{'tableName':_0x727e('0x9'),'paranoid':![],'indexes':[{'fields':[_0x727e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 7afe072..d7b8de8 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 _0xb06d=['message','result','catch','VoiceDialReport','create','options','raw','then','info','CreateVoiceDialReport','update','body','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','request','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s'];(function(_0x539be4,_0x34c69b){var _0x1217fb=function(_0x41a242){while(--_0x41a242){_0x539be4['push'](_0x539be4['shift']());}};_0x1217fb(++_0x34c69b);}(_0xb06d,0xd6));var _0xdb06=function(_0x570d2c,_0x290573){_0x570d2c=_0x570d2c-0x0;var _0x140677=_0xb06d[_0x570d2c];return _0x140677;};'use strict';var _=require(_0xdb06('0x0'));var util=require(_0xdb06('0x1'));var moment=require(_0xdb06('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb06('0x3'));var fs=require('fs');var Redis=require(_0xdb06('0x4'));var db=require(_0xdb06('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdb06('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdb06('0x7')][_0xdb06('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4855a4,_0x3ce680,_0xf977fa){return new BPromise(function(_0x2720b1,_0x4347a5){return client[_0xdb06('0x9')](_0x4855a4,_0xf977fa)['then'](function(_0x3e67f7){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3ce680,_0xdb06('0xa'));logger[_0xdb06('0xb')](_0xdb06('0xc'),_0x3ce680,_0xdb06('0xa'),JSON[_0xdb06('0xd')](_0x3e67f7));if(_0x3e67f7[_0xdb06('0xe')]){if(_0x3e67f7['error'][_0xdb06('0xf')]===0x1f4){logger['error'](_0xdb06('0x10'),_0x3ce680,_0x3e67f7['error'][_0xdb06('0x11')]);return _0x4347a5(_0x3e67f7[_0xdb06('0xe')][_0xdb06('0x11')]);}logger[_0xdb06('0xe')](_0xdb06('0x10'),_0x3ce680,_0x3e67f7[_0xdb06('0xe')]['message']);return _0x2720b1(_0x3e67f7['error'][_0xdb06('0x11')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3ce680,_0xdb06('0xa'));_0x2720b1(_0x3e67f7[_0xdb06('0x12')]['message']);}})[_0xdb06('0x13')](function(_0x42c699){logger[_0xdb06('0xe')](_0xdb06('0x10'),_0x3ce680,_0x42c699);_0x4347a5(_0x42c699);});});}exports['CreateVoiceDialReport']=function(_0x27c69d){var _0x3a5b23=this;return new Promise(function(_0x32af30,_0x52b124){return db[_0xdb06('0x14')][_0xdb06('0x15')](_0x27c69d['body'],{'raw':_0x27c69d[_0xdb06('0x16')]?_0x27c69d[_0xdb06('0x16')][_0xdb06('0x17')]===undefined?!![]:![]:!![]})[_0xdb06('0x18')](function(_0x4a0c64){logger[_0xdb06('0x19')](_0xdb06('0x1a'),_0x27c69d);logger[_0xdb06('0xb')](_0xdb06('0x1a'),_0x27c69d,JSON[_0xdb06('0xd')](_0x4a0c64));_0x32af30(_0x4a0c64);})[_0xdb06('0x13')](function(_0x482eee){logger[_0xdb06('0xe')](_0xdb06('0x1a'),_0x482eee[_0xdb06('0x11')],_0x27c69d);_0x52b124(_0x3a5b23[_0xdb06('0xe')](0x1f4,_0x482eee[_0xdb06('0x11')]));});});};exports['UpdateVoiceDialReport']=function(_0x3ddcb8){var _0x2e92a9=this;return new Promise(function(_0x36a5ad,_0x422254){return db[_0xdb06('0x14')][_0xdb06('0x1b')](_0x3ddcb8[_0xdb06('0x1c')],{'raw':_0x3ddcb8[_0xdb06('0x16')]?_0x3ddcb8[_0xdb06('0x16')][_0xdb06('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ddcb8[_0xdb06('0x16')]?_0x3ddcb8[_0xdb06('0x16')][_0xdb06('0x1d')]||null:null,'attributes':_0x3ddcb8[_0xdb06('0x16')]?_0x3ddcb8[_0xdb06('0x16')][_0xdb06('0x1e')]||null:null,'limit':_0x3ddcb8[_0xdb06('0x16')]?_0x3ddcb8[_0xdb06('0x16')][_0xdb06('0x1f')]||null:null})['then'](function(_0x30eff4){logger['info'](_0xdb06('0x20'),_0x3ddcb8);logger[_0xdb06('0xb')]('UpdateVoiceDialReport',_0x3ddcb8,JSON['stringify'](_0x30eff4));_0x36a5ad(_0x30eff4);})[_0xdb06('0x13')](function(_0x1e99c8){logger[_0xdb06('0xe')](_0xdb06('0x20'),_0x1e99c8[_0xdb06('0x11')],_0x3ddcb8);_0x422254(_0x2e92a9[_0xdb06('0xe')](0x1f4,_0x1e99c8[_0xdb06('0x11')]));});});}; \ No newline at end of file +var _0xd5da=['http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','update','where','attributes','UpdateVoiceDialReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xd5da,0x160));var _0xad5d=function(_0x2ff3c9,_0x718dab){_0x2ff3c9=_0x2ff3c9-0x0;var _0x5215f5=_0xd5da[_0x2ff3c9];return _0x5215f5;};'use strict';var _=require('lodash');var util=require(_0xad5d('0x0'));var moment=require(_0xad5d('0x1'));var BPromise=require(_0xad5d('0x2'));var rs=require(_0xad5d('0x3'));var fs=require('fs');var Redis=require(_0xad5d('0x4'));var db=require(_0xad5d('0x5'))['db'];var utils=require(_0xad5d('0x6'));var logger=require(_0xad5d('0x7'))('rpc');var config=require(_0xad5d('0x8'));var jayson=require(_0xad5d('0x9'));var client=jayson[_0xad5d('0xa')][_0xad5d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e88b0,_0x3108ad,_0x10909e){return new BPromise(function(_0x9c80d9,_0x515542){return client[_0xad5d('0xc')](_0x3e88b0,_0x10909e)[_0xad5d('0xd')](function(_0x5bac93){logger['info'](_0xad5d('0xe'),_0x3108ad,_0xad5d('0xf'));logger[_0xad5d('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3108ad,'request\x20sent',JSON['stringify'](_0x5bac93));if(_0x5bac93[_0xad5d('0x11')]){if(_0x5bac93[_0xad5d('0x11')]['code']===0x1f4){logger[_0xad5d('0x11')](_0xad5d('0xe'),_0x3108ad,_0x5bac93[_0xad5d('0x11')][_0xad5d('0x12')]);return _0x515542(_0x5bac93[_0xad5d('0x11')][_0xad5d('0x12')]);}logger['error'](_0xad5d('0xe'),_0x3108ad,_0x5bac93[_0xad5d('0x11')][_0xad5d('0x12')]);return _0x9c80d9(_0x5bac93[_0xad5d('0x11')][_0xad5d('0x12')]);}else{logger[_0xad5d('0x13')](_0xad5d('0xe'),_0x3108ad,_0xad5d('0xf'));_0x9c80d9(_0x5bac93[_0xad5d('0x14')][_0xad5d('0x12')]);}})[_0xad5d('0x15')](function(_0x1b7bc7){logger[_0xad5d('0x11')](_0xad5d('0xe'),_0x3108ad,_0x1b7bc7);_0x515542(_0x1b7bc7);});});}exports[_0xad5d('0x16')]=function(_0xfe21f5){var _0x21f7e7=this;return new Promise(function(_0x14ffa3,_0x247649){return db[_0xad5d('0x17')][_0xad5d('0x18')](_0xfe21f5[_0xad5d('0x19')],{'raw':_0xfe21f5[_0xad5d('0x1a')]?_0xfe21f5['options'][_0xad5d('0x1b')]===undefined?!![]:![]:!![]})[_0xad5d('0xd')](function(_0x767a40){logger[_0xad5d('0x13')](_0xad5d('0x16'),_0xfe21f5);logger[_0xad5d('0x10')](_0xad5d('0x16'),_0xfe21f5,JSON[_0xad5d('0x1c')](_0x767a40));_0x14ffa3(_0x767a40);})[_0xad5d('0x15')](function(_0x4d4b7e){logger[_0xad5d('0x11')]('CreateVoiceDialReport',_0x4d4b7e[_0xad5d('0x12')],_0xfe21f5);_0x247649(_0x21f7e7[_0xad5d('0x11')](0x1f4,_0x4d4b7e['message']));});});};exports['UpdateVoiceDialReport']=function(_0xbadf5){var _0x2f68b4=this;return new Promise(function(_0x1a7e28,_0x363b7e){return db['VoiceDialReport'][_0xad5d('0x1d')](_0xbadf5['body'],{'raw':_0xbadf5[_0xad5d('0x1a')]?_0xbadf5[_0xad5d('0x1a')][_0xad5d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbadf5['options']?_0xbadf5[_0xad5d('0x1a')][_0xad5d('0x1e')]||null:null,'attributes':_0xbadf5[_0xad5d('0x1a')]?_0xbadf5[_0xad5d('0x1a')][_0xad5d('0x1f')]||null:null,'limit':_0xbadf5[_0xad5d('0x1a')]?_0xbadf5[_0xad5d('0x1a')]['limit']||null:null})[_0xad5d('0xd')](function(_0x4284e9){logger[_0xad5d('0x13')](_0xad5d('0x20'),_0xbadf5);logger[_0xad5d('0x10')](_0xad5d('0x20'),_0xbadf5,JSON[_0xad5d('0x1c')](_0x4284e9));_0x1a7e28(_0x4284e9);})[_0xad5d('0x15')](function(_0x212fb0){logger[_0xad5d('0x11')](_0xad5d('0x20'),_0x212fb0[_0xad5d('0x12')],_0xbadf5);_0x363b7e(_0x2f68b4[_0xad5d('0x11')](0x1f4,_0x212fb0['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 2c85ca6..65c2be2 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 _0x719c=['get','isAuthenticated','show','create','post','/:id/applications','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b3300,_0x1137f1){var _0x2d26d3=function(_0x4678b5){while(--_0x4678b5){_0x4b3300['push'](_0x4b3300['shift']());}};_0x2d26d3(++_0x1137f1);}(_0x719c,0x97));var _0xc719=function(_0x239436,_0xfc1828){_0x239436=_0x239436-0x0;var _0x43c888=_0x719c[_0x239436];return _0x43c888;};'use strict';var multer=require(_0xc719('0x0'));var util=require(_0xc719('0x1'));var path=require(_0xc719('0x2'));var timeout=require(_0xc719('0x3'));var express=require('express');var router=express[_0xc719('0x4')]();var fs_extra=require(_0xc719('0x5'));var auth=require(_0xc719('0x6'));var interaction=require(_0xc719('0x7'));var config=require(_0xc719('0x8'));var controller=require('./voiceExtension.controller');router[_0xc719('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc719('0x9')]('/:id',auth[_0xc719('0xa')](),controller[_0xc719('0xb')]);router['post']('/',auth[_0xc719('0xa')](),controller[_0xc719('0xc')]);router[_0xc719('0xd')](_0xc719('0xe'),auth[_0xc719('0xa')](),controller['addApplications']);router[_0xc719('0xf')](_0xc719('0x10'),auth['isAuthenticated'](),controller[_0xc719('0x11')]);router[_0xc719('0x12')](_0xc719('0x10'),auth[_0xc719('0xa')](),controller[_0xc719('0x13')]);module['exports']=router; \ No newline at end of file +var _0x921d=['Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x43c9e5,_0x3ade1d){var _0x44dc5c=function(_0x3d5b1b){while(--_0x3d5b1b){_0x43c9e5['push'](_0x43c9e5['shift']());}};_0x44dc5c(++_0x3ade1d);}(_0x921d,0x16b));var _0xd921=function(_0x3f8bce,_0x302fc4){_0x3f8bce=_0x3f8bce-0x0;var _0x47bb89=_0x921d[_0x3f8bce];return _0x47bb89;};'use strict';var multer=require(_0xd921('0x0'));var util=require(_0xd921('0x1'));var path=require(_0xd921('0x2'));var timeout=require(_0xd921('0x3'));var express=require(_0xd921('0x4'));var router=express[_0xd921('0x5')]();var fs_extra=require(_0xd921('0x6'));var auth=require(_0xd921('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd921('0x8'));var controller=require(_0xd921('0x9'));router[_0xd921('0xa')]('/',auth[_0xd921('0xb')](),controller[_0xd921('0xc')]);router[_0xd921('0xa')](_0xd921('0xd'),auth[_0xd921('0xb')](),controller[_0xd921('0xe')]);router[_0xd921('0xf')]('/',auth['isAuthenticated'](),controller[_0xd921('0x10')]);router['post'](_0xd921('0x11'),auth[_0xd921('0xb')](),controller[_0xd921('0x12')]);router[_0xd921('0x13')]('/:id',auth[_0xd921('0xb')](),controller[_0xd921('0x14')]);router[_0xd921('0x15')](_0xd921('0xd'),auth[_0xd921('0xb')](),controller[_0xd921('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index d247010..f96115b 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 _0xf55e=['inbound-fax','outbound-fax','BOOLEAN','INTEGER','VIRTUAL','getDataValue','sequelize','STRING','compositeIndex','NoOp','inbound','outbound','internal'];(function(_0x4c2a66,_0x5abaaf){var _0x3fbe5f=function(_0x5a1beb){while(--_0x5a1beb){_0x4c2a66['push'](_0x4c2a66['shift']());}};_0x3fbe5f(++_0x5abaaf);}(_0xf55e,0x6e));var _0xef55=function(_0xbfab8d,_0x4023da){_0xbfab8d=_0xbfab8d-0x0;var _0x3b3b9e=_0xf55e[_0xbfab8d];return _0x3b3b9e;};'use strict';var Sequelize=require(_0xef55('0x0'));module['exports']={'context':{'type':Sequelize[_0xef55('0x1')],'allowNull':![],'unique':_0xef55('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xef55('0x2')},'priority':{'type':Sequelize[_0xef55('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xef55('0x2')},'tag':{'type':Sequelize[_0xef55('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xef55('0x1')],'allowNull':![],'defaultValue':_0xef55('0x3')},'appdata':{'type':Sequelize[_0xef55('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xef55('0x4'),_0xef55('0x5'),_0xef55('0x6'),_0xef55('0x7'),_0xef55('0x8'),'system','any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xef55('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xef55('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xef55('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xef55('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xef55('0xa')]},'recordingFormat':{'type':Sequelize[_0xef55('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xef55('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0xef55('0xb')],'get':function(_0x16667f){return this[_0xef55('0xc')]('exten');}},'alias':{'type':Sequelize[_0xef55('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x7cca=['exten','sequelize','STRING','compositeIndex','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x7cca,0x131));var _0xa7cc=function(_0x5018f0,_0x417ee6){_0x5018f0=_0x5018f0-0x0;var _0x133289=_0x7cca[_0x5018f0];return _0x133289;};'use strict';var Sequelize=require(_0xa7cc('0x0'));module['exports']={'context':{'type':Sequelize[_0xa7cc('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa7cc('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xa7cc('0x2')},'tag':{'type':Sequelize[_0xa7cc('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xa7cc('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xa7cc('0x3')](_0xa7cc('0x4'),_0xa7cc('0x5'),'internal',_0xa7cc('0x6'),_0xa7cc('0x7'),_0xa7cc('0x8'),_0xa7cc('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xa7cc('0x1')]},'interval':{'type':Sequelize[_0xa7cc('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xa7cc('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa7cc('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xa7cc('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xa7cc('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xa7cc('0xc')},'answer':{'type':Sequelize[_0xa7cc('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xa7cc('0xd')],'get':function(_0x3fce1b){return this[_0xa7cc('0xe')](_0xa7cc('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index c55890d..adc5ae5 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 _0xf678=['isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','json','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','destroy','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','ignore','map','value','includes','type','find','UserProfileResource','then','error','stack','name','send','VoiceExtension','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','outbound','body','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','cutdigits','mandatoryDisposition','alias','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId'];(function(_0x4ee76c,_0x42b476){var _0x421085=function(_0x4ba1bf){while(--_0x4ba1bf){_0x4ee76c['push'](_0x4ee76c['shift']());}};_0x421085(++_0x42b476);}(_0xf678,0x16b));var _0x8f67=function(_0x282ee9,_0x241fc8){_0x282ee9=_0x282ee9-0x0;var _0x4ada16=_0xf678[_0x282ee9];return _0x4ada16;};'use strict';var _=require('lodash');var Redis=require(_0x8f67('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x8f67('0x1'))('api');var config=require(_0x8f67('0x2'));var db=require(_0x8f67('0x3'))['db'];config[_0x8f67('0x4')]=_[_0x8f67('0x5')](config[_0x8f67('0x4')],{'host':_0x8f67('0x6'),'port':0x18eb});var socket=require(_0x8f67('0x7'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x599fce,_0x3d1a2c){_0x3d1a2c=_0x3d1a2c||0xcc;return function(_0x1c85f7){if(_0x1c85f7){return _0x599fce[_0x8f67('0x8')](_0x3d1a2c);}return _0x599fce[_0x8f67('0x9')](_0x3d1a2c)[_0x8f67('0xa')]();};}function respondWithResult(_0x267b5b,_0x350390){_0x350390=_0x350390||0xc8;return function(_0x4c6348){if(_0x4c6348){return _0x267b5b['status'](_0x350390)['json'](_0x4c6348);}};}function respondWithFilteredResult(_0x12ee71,_0x3ff417){return function(_0x4715f8){if(_0x4715f8){var _0x5c922a=typeof _0x3ff417[_0x8f67('0xb')]===_0x8f67('0xc')&&typeof _0x3ff417[_0x8f67('0xd')]===_0x8f67('0xc');var _0x587ccc=_0x4715f8[_0x8f67('0xe')];var _0x29f88f=_0x5c922a?0x0:_0x3ff417[_0x8f67('0xb')];var _0x3427b5=_0x5c922a?_0x4715f8['count']:_0x3ff417[_0x8f67('0xb')]+_0x3ff417[_0x8f67('0xd')];var _0x581c36;if(_0x3427b5>=_0x587ccc){_0x3427b5=_0x587ccc;_0x581c36=0xc8;}else{_0x581c36=0xce;}_0x12ee71[_0x8f67('0x9')](_0x581c36);return _0x12ee71['set']('Content-Range',_0x29f88f+'-'+_0x3427b5+'/'+_0x587ccc)['json'](_0x4715f8);}return null;};}function removeEntity(_0x322bbb){return function(_0x38e5c0){if(_0x38e5c0){return _0x38e5c0[_0x8f67('0xf')]()['then'](function(){var _0xb3e0fd=_0x38e5c0['get']({'plain':!![]});var _0x42f89c=[{'name':_0x8f67('0x10'),'value':_0x8f67('0x11'),'ignore':![]},{'name':_0x8f67('0x12'),'value':'outbound','ignore':![]},{'name':_0x8f67('0x13'),'value':_0x8f67('0x14'),'ignore':![]}];var _0x381b6f=_(_0x42f89c)['filter'](_0x8f67('0x15'))[_0x8f67('0x16')](_0x8f67('0x17'))[_0x8f67('0x17')]();if(_[_0x8f67('0x18')](_0x381b6f,_0xb3e0fd[_0x8f67('0x19')])){return;}var _0x10bcea=_[_0x8f67('0x1a')](_0x42f89c,['value',_0xb3e0fd[_0x8f67('0x19')]])['name'];return db[_0x8f67('0x1b')]['destroy']({'where':{'type':_0x10bcea,'resourceId':_0xb3e0fd['id']}})[_0x8f67('0x1c')](function(){return _0x38e5c0;});})[_0x8f67('0x1c')](function(){_0x322bbb[_0x8f67('0x9')](0xcc)[_0x8f67('0xa')]();});}};}function handleEntityNotFound(_0xc12a61){return function(_0x29b781){if(!_0x29b781){_0xc12a61[_0x8f67('0x8')](0x194);}return _0x29b781;};}function handleError(_0xcf2339,_0x27990e){_0x27990e=_0x27990e||0x1f4;return function(_0x25bd4a){logger[_0x8f67('0x1d')](_0x25bd4a[_0x8f67('0x1e')]);if(_0x25bd4a[_0x8f67('0x1f')]){delete _0x25bd4a[_0x8f67('0x1f')];}_0xcf2339[_0x8f67('0x9')](_0x27990e)[_0x8f67('0x20')](_0x25bd4a);};}exports['index']=function(_0xcc2ef,_0x2cf9b0){var _0x55536f={},_0x5c2d70={},_0x1ce3af={'count':0x0,'rows':[]};var _0x17eca8=_[_0x8f67('0x16')](db[_0x8f67('0x21')][_0x8f67('0x22')],function(_0x1bbc2d){return{'name':_0x1bbc2d['fieldName'],'type':_0x1bbc2d[_0x8f67('0x19')][_0x8f67('0x23')]};});_0x5c2d70['model']=_[_0x8f67('0x16')](_0x17eca8,'name');_0x5c2d70[_0x8f67('0x24')]=_[_0x8f67('0x25')](_0xcc2ef[_0x8f67('0x24')]);_0x5c2d70[_0x8f67('0x26')]=_[_0x8f67('0x27')](_0x5c2d70[_0x8f67('0x28')],_0x5c2d70[_0x8f67('0x24')]);_0x55536f['attributes']=_[_0x8f67('0x27')](_0x5c2d70[_0x8f67('0x28')],qs[_0x8f67('0x29')](_0xcc2ef['query']['fields']));_0x55536f[_0x8f67('0x2a')]=_0x55536f['attributes'][_0x8f67('0x2b')]?_0x55536f[_0x8f67('0x2a')]:_0x5c2d70[_0x8f67('0x28')];if(!_0xcc2ef[_0x8f67('0x24')][_0x8f67('0x2c')](_0x8f67('0x2d'))){_0x55536f[_0x8f67('0xd')]=qs[_0x8f67('0xd')](_0xcc2ef[_0x8f67('0x24')][_0x8f67('0xd')]);_0x55536f['offset']=qs['offset'](_0xcc2ef[_0x8f67('0x24')][_0x8f67('0xb')]);}_0x55536f[_0x8f67('0x2e')]=qs['sort'](_0xcc2ef[_0x8f67('0x24')][_0x8f67('0x2f')]);_0x55536f[_0x8f67('0x30')]=qs[_0x8f67('0x26')](_[_0x8f67('0x31')](_0xcc2ef[_0x8f67('0x24')],_0x5c2d70[_0x8f67('0x26')]),_0x17eca8);if(_0xcc2ef['query'][_0x8f67('0x32')]){_0x55536f[_0x8f67('0x30')]=_[_0x8f67('0x33')](_0x55536f[_0x8f67('0x30')],{'$or':_[_0x8f67('0x16')](_0x17eca8,function(_0x374ea7){if(_0x374ea7[_0x8f67('0x19')]!=='VIRTUAL'){var _0x536758={};_0x536758[_0x374ea7[_0x8f67('0x1f')]]={'$like':'%'+_0xcc2ef[_0x8f67('0x24')][_0x8f67('0x32')]+'%'};return _0x536758;}})});}_0x55536f=_[_0x8f67('0x33')]({},_0x55536f,_0xcc2ef[_0x8f67('0x34')]);var _0xfd5ccc={'where':_0x55536f['where']};return db[_0x8f67('0x21')]['count'](_0xfd5ccc)[_0x8f67('0x1c')](function(_0x377d1f){_0x1ce3af[_0x8f67('0xe')]=_0x377d1f;if(_0xcc2ef[_0x8f67('0x24')][_0x8f67('0x35')]){_0x55536f[_0x8f67('0x36')]=[{'all':!![]}];}return db[_0x8f67('0x21')][_0x8f67('0x37')](_0x55536f);})['then'](function(_0x122b7e){_0x1ce3af[_0x8f67('0x38')]=_0x122b7e;return _0x1ce3af;})[_0x8f67('0x1c')](respondWithFilteredResult(_0x2cf9b0,_0x55536f))['catch'](handleError(_0x2cf9b0,null));};exports[_0x8f67('0x39')]=function(_0x107cc8,_0x153902){var _0xe3741d={'raw':![],'where':{'id':_0x107cc8[_0x8f67('0x3a')]['id']}},_0x2abf07={};_0x2abf07[_0x8f67('0x28')]=_['keys'](db['VoiceExtension'][_0x8f67('0x22')]);_0x2abf07[_0x8f67('0x24')]=_['keys'](_0x107cc8[_0x8f67('0x24')]);_0x2abf07[_0x8f67('0x26')]=_['intersection'](_0x2abf07[_0x8f67('0x28')],_0x2abf07[_0x8f67('0x24')]);_0xe3741d[_0x8f67('0x2a')]=_[_0x8f67('0x27')](_0x2abf07[_0x8f67('0x28')],qs[_0x8f67('0x29')](_0x107cc8[_0x8f67('0x24')]['fields']));_0xe3741d[_0x8f67('0x2a')]=_0xe3741d[_0x8f67('0x2a')][_0x8f67('0x2b')]?_0xe3741d[_0x8f67('0x2a')]:_0x2abf07[_0x8f67('0x28')];if(_0x107cc8[_0x8f67('0x24')][_0x8f67('0x35')]){_0xe3741d[_0x8f67('0x36')]=[{'all':!![]}];}_0xe3741d=_[_0x8f67('0x33')]({},_0xe3741d,_0x107cc8[_0x8f67('0x34')]);return db[_0x8f67('0x21')][_0x8f67('0x1a')](_0xe3741d)[_0x8f67('0x1c')](handleEntityNotFound(_0x153902,null))[_0x8f67('0x1c')](respondWithResult(_0x153902,null))['catch'](handleError(_0x153902,null));};exports[_0x8f67('0xf')]=function(_0x3e59ea,_0x5cf64d){return db[_0x8f67('0x21')][_0x8f67('0x1a')]({'where':{'id':_0x3e59ea[_0x8f67('0x3a')]['id']}})[_0x8f67('0x1c')](handleEntityNotFound(_0x5cf64d,null))[_0x8f67('0x1c')](removeEntity(_0x5cf64d,null))['catch'](handleError(_0x5cf64d,null));};exports['create']=function(_0x496128,_0x41060b){if(_0x496128['body'][_0x8f67('0x19')]===_0x8f67('0x3b')&&!_['startsWith'](_0x496128[_0x8f67('0x3c')][_0x8f67('0x3d')],'_')){_0x496128[_0x8f67('0x3c')][_0x8f67('0x3d')]='_'['concat'](_0x496128['body']['exten']);}return db[_0x8f67('0x21')]['create'](_0x496128[_0x8f67('0x3c')],{'raw':![]})[_0x8f67('0x1c')](function(_0xfc5832){var _0x41ce3c=_0x496128[_0x8f67('0x3e')][_0x8f67('0x3f')]({'plain':!![]});if(!_0x41ce3c)throw new Error(_0x8f67('0x40'));if(_0x41ce3c[_0x8f67('0x41')]===_0x8f67('0x3e')){var _0x12a5cc=_0xfc5832[_0x8f67('0x3f')]({'plain':!![]});var _0x2b1c56=[{'name':_0x8f67('0x10'),'value':_0x8f67('0x11')},{'name':_0x8f67('0x12'),'value':'outbound'},{'name':'InternalRoutes','value':_0x8f67('0x14')}];var _0x3379f2=_[_0x8f67('0x1a')](_0x2b1c56,[_0x8f67('0x17'),_0x12a5cc[_0x8f67('0x19')]])[_0x8f67('0x1f')];return db[_0x8f67('0x42')]['find']({'where':{'name':_0x3379f2,'userProfileId':_0x41ce3c['userProfileId']},'raw':!![]})['then'](function(_0x23a267){if(_0x23a267&&_0x23a267[_0x8f67('0x43')]===0x0){return db[_0x8f67('0x1b')][_0x8f67('0x44')]({'name':_0x12a5cc['name'],'resourceId':_0x12a5cc['id'],'type':_0x23a267[_0x8f67('0x1f')],'sectionId':_0x23a267['id']},{})[_0x8f67('0x1c')](function(){return _0xfc5832;});}else{return _0xfc5832;}})[_0x8f67('0x45')](function(_0x1da89d){logger[_0x8f67('0x1d')](_0x8f67('0x46'),_0x1da89d);throw _0x1da89d;});}return _0xfc5832;})[_0x8f67('0x1c')](respondWithResult(_0x41060b,0xc9))[_0x8f67('0x45')](handleError(_0x41060b,null));};exports['update']=function(_0x3f58db,_0x488f99){if(_0x3f58db['body']['id']){delete _0x3f58db['body']['id'];}return db[_0x8f67('0x21')][_0x8f67('0x1a')]({'where':{'id':_0x3f58db[_0x8f67('0x3a')]['id']}})['then'](handleEntityNotFound(_0x488f99,null))[_0x8f67('0x1c')](function(_0x5eecd8){if(_0x5eecd8){return db[_0x8f67('0x21')][_0x8f67('0x47')](_[_0x8f67('0x31')](_0x3f58db['body'],[_0x8f67('0x3d'),_0x8f67('0x48'),'description','recordingFormat',_0x8f67('0x49'),_0x8f67('0x4a'),_0x8f67('0x4b')]),{'where':{'context':_0x5eecd8[_0x8f67('0x48')],'exten':_0x5eecd8[_0x8f67('0x3d')]},'individualHooks':!![]})[_0x8f67('0x1c')](function(_0x6d9325){return _0x6d9325;});}return null;})[_0x8f67('0x1c')](respondWithStatusCode(_0x488f99,null))[_0x8f67('0x45')](handleError(_0x488f99,null));};exports[_0x8f67('0x4c')]=function(_0x200b35,_0x42b471){var _0xb2edd8=_0x200b35[_0x8f67('0x3a')]['id'];var _0xc755a3=_0x200b35[_0x8f67('0x3c')];var _0x4176c6=0xc8;var _0x2856c2=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x8f67('0x4d')][_0x8f67('0x4e')][_0x8f67('0x4f')]},function(_0x56d462){return db[_0x8f67('0x21')][_0x8f67('0x50')]({'where':{'id':_0xb2edd8},'transaction':_0x56d462})[_0x8f67('0x1c')](function(_0x2ca496){if(_0x2ca496){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0xb2edd8},'transaction':_0x56d462})[_0x8f67('0x1c')](function(){var _0x25fd84=_[_0x8f67('0x16')](_0xc755a3,function(_0x3946aa){_0x3946aa[_0x8f67('0x51')]=_0xb2edd8;_0x3946aa[_0x8f67('0x52')]=!![];return _0x3946aa;});return _0x2ca496[_0x8f67('0x53')](_0x25fd84);})[_0x8f67('0x1c')](function(_0x18ff40){return db['VoiceExtension'][_0x8f67('0x54')](_0x18ff40,{'transaction':_0x56d462});});}else{_0x4176c6=0x194;_0x2856c2=[];}});})['then'](function(){if(_0x4176c6!==0x194){return db[_0x8f67('0x21')][_0x8f67('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0xb2edd8},'order':_0x8f67('0x56')})[_0x8f67('0x1c')](function(_0x26c2ea){_0x2856c2=_0x26c2ea;});}})['catch'](function(_0x1e85ae){_0x4176c6=0x1f4;logger[_0x8f67('0x1d')](_0x1e85ae[_0x8f67('0x1e')]);if(_0x1e85ae[_0x8f67('0x1f')]){delete _0x1e85ae[_0x8f67('0x1f')];}_0x2856c2=_0x1e85ae;})[_0x8f67('0x57')](function(){if(_0x2856c2===null){_0x42b471[_0x8f67('0x8')](_0x4176c6);}else{if(_0x4176c6===0x1f4){_0x42b471[_0x8f67('0x9')](_0x4176c6)[_0x8f67('0x20')](_0x2856c2);}else{_0x42b471[_0x8f67('0x9')](_0x4176c6)[_0x8f67('0x58')](_0x2856c2);}}});}; \ No newline at end of file +var _0x5541=['UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','ignore','map','value','includes','type','find','UserProfileResource','error','stack','name','send','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0xacfe4e,_0x38f594){var _0x2ed860=function(_0x10acea){while(--_0x10acea){_0xacfe4e['push'](_0xacfe4e['shift']());}};_0x2ed860(++_0x38f594);}(_0x5541,0x178));var _0x1554=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0x5541[_0x3c858f];return _0x198090;};'use strict';var _=require('lodash');var Redis=require(_0x1554('0x0'));var qs=require(_0x1554('0x1'));var logger=require(_0x1554('0x2'))(_0x1554('0x3'));var config=require(_0x1554('0x4'));var db=require(_0x1554('0x5'))['db'];config[_0x1554('0x6')]=_[_0x1554('0x7')](config[_0x1554('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x1554('0x8'))(new Redis(config[_0x1554('0x6')]));require(_0x1554('0x9'))['register'](socket);function respondWithStatusCode(_0x56eff7,_0xcea9af){_0xcea9af=_0xcea9af||0xcc;return function(_0x33cbec){if(_0x33cbec){return _0x56eff7[_0x1554('0xa')](_0xcea9af);}return _0x56eff7[_0x1554('0xb')](_0xcea9af)[_0x1554('0xc')]();};}function respondWithResult(_0x59317f,_0x40ea57){_0x40ea57=_0x40ea57||0xc8;return function(_0x426e6a){if(_0x426e6a){return _0x59317f['status'](_0x40ea57)[_0x1554('0xd')](_0x426e6a);}};}function respondWithFilteredResult(_0xaa062b,_0x501d39){return function(_0x19e651){if(_0x19e651){var _0x5808e5=typeof _0x501d39[_0x1554('0xe')]==='undefined'&&typeof _0x501d39[_0x1554('0xf')]===_0x1554('0x10');var _0x1b7b72=_0x19e651[_0x1554('0x11')];var _0x57b0d7=_0x5808e5?0x0:_0x501d39[_0x1554('0xe')];var _0x5b8c28=_0x5808e5?_0x19e651[_0x1554('0x11')]:_0x501d39[_0x1554('0xe')]+_0x501d39[_0x1554('0xf')];var _0x4458f8;if(_0x5b8c28>=_0x1b7b72){_0x5b8c28=_0x1b7b72;_0x4458f8=0xc8;}else{_0x4458f8=0xce;}_0xaa062b[_0x1554('0xb')](_0x4458f8);return _0xaa062b['set'](_0x1554('0x12'),_0x57b0d7+'-'+_0x5b8c28+'/'+_0x1b7b72)[_0x1554('0xd')](_0x19e651);}return null;};}function removeEntity(_0xdf48bd){return function(_0x35fb68){if(_0x35fb68){return _0x35fb68[_0x1554('0x13')]()[_0x1554('0x14')](function(){var _0x3eb86a=_0x35fb68[_0x1554('0x15')]({'plain':!![]});var _0x267940=[{'name':_0x1554('0x16'),'value':_0x1554('0x17'),'ignore':![]},{'name':_0x1554('0x18'),'value':'outbound','ignore':![]},{'name':_0x1554('0x19'),'value':_0x1554('0x1a'),'ignore':![]}];var _0x208476=_(_0x267940)['filter'](_0x1554('0x1b'))[_0x1554('0x1c')](_0x1554('0x1d'))[_0x1554('0x1d')]();if(_[_0x1554('0x1e')](_0x208476,_0x3eb86a[_0x1554('0x1f')])){return;}var _0x2ba7de=_[_0x1554('0x20')](_0x267940,[_0x1554('0x1d'),_0x3eb86a[_0x1554('0x1f')]])['name'];return db[_0x1554('0x21')][_0x1554('0x13')]({'where':{'type':_0x2ba7de,'resourceId':_0x3eb86a['id']}})[_0x1554('0x14')](function(){return _0x35fb68;});})[_0x1554('0x14')](function(){_0xdf48bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3301b0){return function(_0x4c4637){if(!_0x4c4637){_0x3301b0[_0x1554('0xa')](0x194);}return _0x4c4637;};}function handleError(_0x26d9a9,_0x964eec){_0x964eec=_0x964eec||0x1f4;return function(_0x5b8573){logger[_0x1554('0x22')](_0x5b8573[_0x1554('0x23')]);if(_0x5b8573['name']){delete _0x5b8573[_0x1554('0x24')];}_0x26d9a9[_0x1554('0xb')](_0x964eec)[_0x1554('0x25')](_0x5b8573);};}exports['index']=function(_0x591e78,_0x23f410){var _0x31a25f={},_0x499d2b={},_0x3fc494={'count':0x0,'rows':[]};var _0x5043b5=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x34ea43){return{'name':_0x34ea43['fieldName'],'type':_0x34ea43[_0x1554('0x1f')][_0x1554('0x26')]};});_0x499d2b[_0x1554('0x27')]=_[_0x1554('0x1c')](_0x5043b5,'name');_0x499d2b[_0x1554('0x28')]=_[_0x1554('0x29')](_0x591e78[_0x1554('0x28')]);_0x499d2b['filters']=_[_0x1554('0x2a')](_0x499d2b[_0x1554('0x27')],_0x499d2b[_0x1554('0x28')]);_0x31a25f[_0x1554('0x2b')]=_['intersection'](_0x499d2b[_0x1554('0x27')],qs[_0x1554('0x2c')](_0x591e78['query'][_0x1554('0x2c')]));_0x31a25f[_0x1554('0x2b')]=_0x31a25f[_0x1554('0x2b')]['length']?_0x31a25f[_0x1554('0x2b')]:_0x499d2b[_0x1554('0x27')];if(!_0x591e78[_0x1554('0x28')]['hasOwnProperty'](_0x1554('0x2d'))){_0x31a25f[_0x1554('0xf')]=qs[_0x1554('0xf')](_0x591e78[_0x1554('0x28')]['limit']);_0x31a25f['offset']=qs['offset'](_0x591e78['query'][_0x1554('0xe')]);}_0x31a25f[_0x1554('0x2e')]=qs[_0x1554('0x2f')](_0x591e78[_0x1554('0x28')]['sort']);_0x31a25f[_0x1554('0x30')]=qs[_0x1554('0x31')](_[_0x1554('0x32')](_0x591e78['query'],_0x499d2b[_0x1554('0x31')]),_0x5043b5);if(_0x591e78[_0x1554('0x28')]['filter']){_0x31a25f[_0x1554('0x30')]=_[_0x1554('0x33')](_0x31a25f['where'],{'$or':_[_0x1554('0x1c')](_0x5043b5,function(_0x5cf180){if(_0x5cf180[_0x1554('0x1f')]!==_0x1554('0x34')){var _0x3714c0={};_0x3714c0[_0x5cf180['name']]={'$like':'%'+_0x591e78[_0x1554('0x28')][_0x1554('0x35')]+'%'};return _0x3714c0;}})});}_0x31a25f=_[_0x1554('0x33')]({},_0x31a25f,_0x591e78[_0x1554('0x36')]);var _0x5afa06={'where':_0x31a25f[_0x1554('0x30')]};return db[_0x1554('0x37')]['count'](_0x5afa06)['then'](function(_0x15e0a0){_0x3fc494[_0x1554('0x11')]=_0x15e0a0;if(_0x591e78[_0x1554('0x28')][_0x1554('0x38')]){_0x31a25f[_0x1554('0x39')]=[{'all':!![]}];}return db['VoiceExtension'][_0x1554('0x3a')](_0x31a25f);})[_0x1554('0x14')](function(_0x5ef582){_0x3fc494[_0x1554('0x3b')]=_0x5ef582;return _0x3fc494;})[_0x1554('0x14')](respondWithFilteredResult(_0x23f410,_0x31a25f))[_0x1554('0x3c')](handleError(_0x23f410,null));};exports[_0x1554('0x3d')]=function(_0x3ccd01,_0x4a11bf){var _0x3b7a08={'raw':![],'where':{'id':_0x3ccd01[_0x1554('0x3e')]['id']}},_0x521f9e={};_0x521f9e[_0x1554('0x27')]=_[_0x1554('0x29')](db[_0x1554('0x37')][_0x1554('0x3f')]);_0x521f9e[_0x1554('0x28')]=_[_0x1554('0x29')](_0x3ccd01[_0x1554('0x28')]);_0x521f9e['filters']=_[_0x1554('0x2a')](_0x521f9e[_0x1554('0x27')],_0x521f9e[_0x1554('0x28')]);_0x3b7a08[_0x1554('0x2b')]=_[_0x1554('0x2a')](_0x521f9e[_0x1554('0x27')],qs[_0x1554('0x2c')](_0x3ccd01[_0x1554('0x28')][_0x1554('0x2c')]));_0x3b7a08['attributes']=_0x3b7a08[_0x1554('0x2b')][_0x1554('0x40')]?_0x3b7a08[_0x1554('0x2b')]:_0x521f9e['model'];if(_0x3ccd01['query']['includeAll']){_0x3b7a08[_0x1554('0x39')]=[{'all':!![]}];}_0x3b7a08=_['merge']({},_0x3b7a08,_0x3ccd01[_0x1554('0x36')]);return db['VoiceExtension'][_0x1554('0x20')](_0x3b7a08)[_0x1554('0x14')](handleEntityNotFound(_0x4a11bf,null))[_0x1554('0x14')](respondWithResult(_0x4a11bf,null))[_0x1554('0x3c')](handleError(_0x4a11bf,null));};exports['destroy']=function(_0x1e8c41,_0x4cddae){return db[_0x1554('0x37')]['find']({'where':{'id':_0x1e8c41[_0x1554('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4cddae,null))[_0x1554('0x14')](removeEntity(_0x4cddae,null))[_0x1554('0x3c')](handleError(_0x4cddae,null));};exports[_0x1554('0x41')]=function(_0x5abc84,_0x50724b){if(_0x5abc84[_0x1554('0x42')][_0x1554('0x1f')]===_0x1554('0x43')&&!_[_0x1554('0x44')](_0x5abc84['body'][_0x1554('0x45')],'_')){_0x5abc84[_0x1554('0x42')][_0x1554('0x45')]='_'[_0x1554('0x46')](_0x5abc84[_0x1554('0x42')][_0x1554('0x45')]);}return db[_0x1554('0x37')][_0x1554('0x41')](_0x5abc84[_0x1554('0x42')],{'raw':![]})[_0x1554('0x14')](function(_0x599290){var _0x472383=_0x5abc84[_0x1554('0x47')][_0x1554('0x15')]({'plain':!![]});if(!_0x472383)throw new Error(_0x1554('0x48'));if(_0x472383[_0x1554('0x49')]===_0x1554('0x47')){var _0x5c34bd=_0x599290[_0x1554('0x15')]({'plain':!![]});var _0x330645=[{'name':_0x1554('0x16'),'value':_0x1554('0x17')},{'name':_0x1554('0x18'),'value':_0x1554('0x43')},{'name':_0x1554('0x19'),'value':_0x1554('0x1a')}];var _0x2abe17=_['find'](_0x330645,[_0x1554('0x1d'),_0x5c34bd['type']])[_0x1554('0x24')];return db[_0x1554('0x4a')][_0x1554('0x20')]({'where':{'name':_0x2abe17,'userProfileId':_0x472383['userProfileId']},'raw':!![]})[_0x1554('0x14')](function(_0x352e8b){if(_0x352e8b&&_0x352e8b['autoAssociation']===0x0){return db[_0x1554('0x21')][_0x1554('0x41')]({'name':_0x5c34bd[_0x1554('0x24')],'resourceId':_0x5c34bd['id'],'type':_0x352e8b[_0x1554('0x24')],'sectionId':_0x352e8b['id']},{})[_0x1554('0x14')](function(){return _0x599290;});}else{return _0x599290;}})[_0x1554('0x3c')](function(_0x3eb227){logger[_0x1554('0x22')](_0x1554('0x4b'),_0x3eb227);throw _0x3eb227;});}return _0x599290;})['then'](respondWithResult(_0x50724b,0xc9))[_0x1554('0x3c')](handleError(_0x50724b,null));};exports['update']=function(_0x1ea399,_0x2d2bd8){if(_0x1ea399[_0x1554('0x42')]['id']){delete _0x1ea399['body']['id'];}return db[_0x1554('0x37')][_0x1554('0x20')]({'where':{'id':_0x1ea399['params']['id']}})[_0x1554('0x14')](handleEntityNotFound(_0x2d2bd8,null))[_0x1554('0x14')](function(_0x14dc37){if(_0x14dc37){return db[_0x1554('0x37')][_0x1554('0x4c')](_['pick'](_0x1ea399[_0x1554('0x42')],[_0x1554('0x45'),'context',_0x1554('0x4d'),_0x1554('0x4e'),'cutdigits',_0x1554('0x4f'),_0x1554('0x50')]),{'where':{'context':_0x14dc37['context'],'exten':_0x14dc37[_0x1554('0x45')]},'individualHooks':!![]})[_0x1554('0x14')](function(_0x8012cb){return _0x8012cb;});}return null;})[_0x1554('0x14')](respondWithStatusCode(_0x2d2bd8,null))[_0x1554('0x3c')](handleError(_0x2d2bd8,null));};exports[_0x1554('0x51')]=function(_0x338055,_0x1a2a41){var _0x293a70=_0x338055[_0x1554('0x3e')]['id'];var _0x5b2f68=_0x338055[_0x1554('0x42')];var _0x536291=0xc8;var _0x4f0c12=null;return db[_0x1554('0x52')][_0x1554('0x53')]({'isolationLevel':db[_0x1554('0x52')][_0x1554('0x54')][_0x1554('0x55')]['READ_COMMITTED']},function(_0x261423){return db[_0x1554('0x37')]['findOne']({'where':{'id':_0x293a70},'transaction':_0x261423})[_0x1554('0x14')](function(_0x201995){if(_0x201995){return db[_0x1554('0x37')][_0x1554('0x13')]({'where':{'VoiceExtensionId':_0x293a70},'transaction':_0x261423})[_0x1554('0x14')](function(){var _0x459a4e=_[_0x1554('0x1c')](_0x5b2f68,function(_0x1e8cbb){_0x1e8cbb[_0x1554('0x56')]=_0x293a70;_0x1e8cbb['isApp']=!![];return _0x1e8cbb;});return _0x201995['createRouting'](_0x459a4e);})['then'](function(_0x45d3d6){return db[_0x1554('0x37')][_0x1554('0x57')](_0x45d3d6,{'transaction':_0x261423});});}else{_0x536291=0x194;_0x4f0c12=[];}});})[_0x1554('0x14')](function(){if(_0x536291!==0x194){return db['VoiceExtension'][_0x1554('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x293a70},'order':_0x1554('0x59')})[_0x1554('0x14')](function(_0x20713f){_0x4f0c12=_0x20713f;});}})['catch'](function(_0x266e65){_0x536291=0x1f4;logger[_0x1554('0x22')](_0x266e65[_0x1554('0x23')]);if(_0x266e65[_0x1554('0x24')]){delete _0x266e65[_0x1554('0x24')];}_0x4f0c12=_0x266e65;})['finally'](function(){if(_0x4f0c12===null){_0x1a2a41[_0x1554('0xa')](_0x536291);}else{if(_0x536291===0x1f4){_0x1a2a41[_0x1554('0xb')](_0x536291)['send'](_0x4f0c12);}else{_0x1a2a41[_0x1554('0xb')](_0x536291)['json'](_0x4f0c12);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index a73ae6a..10b6254 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 _0x02e7=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x02e7,0x1de));var _0x702e=function(_0x268eb2,_0x458a0f){_0x268eb2=_0x268eb2-0x0;var _0x5ca2c3=_0x02e7[_0x268eb2];return _0x5ca2c3;};'use strict';var EventEmitter=require(_0x702e('0x0'));var VoiceExtension=require(_0x702e('0x1'))['db'][_0x702e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x702e('0x3')](0x0);var events={'afterCreate':_0x702e('0x4'),'afterUpdate':_0x702e('0x5'),'afterDestroy':_0x702e('0x6')};function emitEvent(_0x80b71c){return function(_0x55810e,_0x5dd0ab,_0x50cbd3){VoiceExtensionEvents[_0x702e('0x7')](_0x80b71c+':'+_0x55810e['id'],_0x55810e);VoiceExtensionEvents[_0x702e('0x7')](_0x80b71c,_0x55810e);_0x50cbd3(null);};}for(var e in events){if(events[_0x702e('0x8')](e)){var event=events[e];VoiceExtension[_0x702e('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xc9f3=['VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x25ea27,_0x490acf){var _0x36153e=function(_0x56eda2){while(--_0x56eda2){_0x25ea27['push'](_0x25ea27['shift']());}};_0x36153e(++_0x490acf);}(_0xc9f3,0x12a));var _0x3c9f=function(_0x42750e,_0x1f1acf){_0x42750e=_0x42750e-0x0;var _0x4b627a=_0xc9f3[_0x42750e];return _0x4b627a;};'use strict';var EventEmitter=require(_0x3c9f('0x0'));var VoiceExtension=require(_0x3c9f('0x1'))['db'][_0x3c9f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3c9f('0x3')](0x0);var events={'afterCreate':_0x3c9f('0x4'),'afterUpdate':_0x3c9f('0x5'),'afterDestroy':'remove'};function emitEvent(_0xb50455){return function(_0x57edda,_0x8be2ad,_0x1832ea){VoiceExtensionEvents[_0x3c9f('0x6')](_0xb50455+':'+_0x57edda['id'],_0x57edda);VoiceExtensionEvents[_0x3c9f('0x6')](_0xb50455,_0x57edda);_0x1832ea(null);};}for(var e in events){if(events[_0x3c9f('0x7')](e)){var event=events[e];VoiceExtension[_0x3c9f('0x8')](e,emitEvent(event));}}module[_0x3c9f('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index bd2b1ed..5b7b8c2 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 _0xc9b9=['type','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','Set','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','url','split','name','param','phone','prefix','SIP','join','options','none','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','then','length','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','last','priority','catch','define','VoiceExtension','voice_extensions','get','concat','exports'];(function(_0x44a373,_0x37e5b5){var _0x58ec58=function(_0x1fab54){while(--_0x1fab54){_0x44a373['push'](_0x44a373['shift']());}};_0x58ec58(++_0x37e5b5);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0xc9b9[_0x2eac4f];return _0x58f73b;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x9c9b('0x0')]=function(_0x29c242){var _0x3418ab=_0x29c242['models'];function _0x5ee8f8(_0x48231c){var _0x497d53=0x2;var _0x38a64b=[{'type':_0x48231c['type'],'app':'Set','appdata':'CDR(type)='+_0x48231c[_0x9c9b('0x1')],'context':_0x48231c[_0x9c9b('0x2')],'exten':_0x48231c[_0x9c9b('0x3')],'priority':_0x497d53++,'VoiceExtensionId':_0x48231c['id']},{'type':_0x48231c[_0x9c9b('0x1')],'app':_0x48231c[_0x9c9b('0x4')]?'Set':_0x9c9b('0x5'),'appdata':_0x48231c[_0x9c9b('0x4')]?_0x9c9b('0x6')+_0x48231c[_0x9c9b('0x4')]:'No\x20alias\x20set','context':_0x48231c[_0x9c9b('0x2')],'exten':_0x48231c[_0x9c9b('0x3')],'priority':_0x497d53++,'VoiceExtensionId':_0x48231c['id']}];if(_0x48231c['type']===_0x9c9b('0x7')){_0x38a64b[_0x9c9b('0x8')]({'type':'inbound','app':'Set','appdata':_0x9c9b('0x9')+_0x48231c['id'],'context':_0x48231c['context'],'exten':_0x48231c[_0x9c9b('0x3')],'priority':_0x497d53++,'VoiceExtensionId':_0x48231c['id']});}_0x38a64b[_0x9c9b('0x8')]({'type':_0x48231c['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x48231c['context'],'exten':_0x48231c[_0x9c9b('0x3')],'priority':_0x497d53++,'VoiceExtensionId':_0x48231c['id']},{'type':_0x48231c[_0x9c9b('0x1')],'app':'Set','appdata':_0x9c9b('0xa'),'context':_0x48231c[_0x9c9b('0x2')],'exten':_0x48231c['exten'],'priority':_0x497d53++,'VoiceExtensionId':_0x48231c['id']},{'type':_0x48231c[_0x9c9b('0x1')],'app':_0x9c9b('0xb'),'appdata':_0x9c9b('0xc'),'context':_0x48231c[_0x9c9b('0x2')],'exten':_0x48231c[_0x9c9b('0x3')],'priority':_0x497d53++,'VoiceExtensionId':_0x48231c['id']});return _0x38a64b;}function _0x299221(_0x10cb89){var _0x2b0b74=0x2;var _0x1f6a87=[{'type':'outbound','app':_0x9c9b('0xb'),'appdata':_0x9c9b('0xd'),'context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':_0x10cb89[_0x9c9b('0x4')]?_0x9c9b('0xb'):'NoOp','appdata':_0x10cb89['alias']?_0x9c9b('0x6')+_0x10cb89['alias']:_0x9c9b('0xf'),'context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':_0x9c9b('0xb'),'appdata':_0x9c9b('0x10')+(_0x10cb89[_0x9c9b('0x11')]?_0x9c9b('0x12')+_0x10cb89[_0x9c9b('0x11')]+'}':_0x9c9b('0x13')),'context':_0x10cb89['context'],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':_0x9c9b('0xb'),'appdata':_0x9c9b('0x9')+_0x10cb89['id'],'context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89['exten'],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':_0x9c9b('0x14'),'appdata':_0x9c9b('0x15')+(_0x2b0b74+0x2)+_0x9c9b('0x16')+(_0x2b0b74+0x1)+')','context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':_0x9c9b('0xb'),'appdata':_0x10cb89['cutdigits']?_0x9c9b('0x17')+_0x10cb89[_0x9c9b('0x11')]+'}':_0x9c9b('0x18'),'context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':'outbound','app':_0x9c9b('0xb'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':_0x9c9b('0xb'),'appdata':_0x9c9b('0xa'),'context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':_0x9c9b('0xb'),'appdata':'MONITOR_OPTIONS=ab','context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89['exten'],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':'Set','appdata':_0x9c9b('0x19')+_0x10cb89['id'],'context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89['exten'],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']}];if(_0x10cb89[_0x9c9b('0x1a')](_0x9c9b('0x1b'))&&_0x10cb89[_0x9c9b('0x1b')]!=='none'){_0x1f6a87[_0x9c9b('0x8')]({'type':'outbound','app':'Set','appdata':_0x9c9b('0x1c'),'context':_0x10cb89['context'],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']},{'type':_0x9c9b('0xe'),'app':_0x9c9b('0xb'),'appdata':_0x9c9b('0x1d')+_0x10cb89['recordingFormat']||'wav','context':_0x10cb89[_0x9c9b('0x2')],'exten':_0x10cb89[_0x9c9b('0x3')],'priority':_0x2b0b74++,'VoiceExtensionId':_0x10cb89['id']});}return _0x1f6a87;}function _0x5239d0(_0x22480a,_0xe7201e){var _0x2c8645=[{'name':_0x9c9b('0x1e'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x9c9b('0x1f'),'param':0x3}];var _0x351b1e={};var _0x5b1502=_0xe7201e[_0x9c9b('0x20')](',');var _0x2c45c0=[];for(var _0x5c976=0x0;_0x5c976<_0x2c8645['length'];_0x5c976++){switch(_0x2c8645[_0x5c976][_0x9c9b('0x21')]){case _0x9c9b('0x1e'):_0x351b1e[_0x9c9b('0x1e')]=_0x5b1502[_0x2c8645[_0x5c976][_0x9c9b('0x22')]][_0x9c9b('0x20')]('/')[0x1];_0x351b1e[_0x9c9b('0x23')]=_0x5b1502[_0x2c8645[_0x5c976]['param']]['split']('/')[0x2];_0x351b1e['prefix']=_0x351b1e[_0x9c9b('0x23')]?_0x351b1e[_0x9c9b('0x23')][_0x9c9b('0x20')]('$')[0x0]:undefined;_0x351b1e[_0x9c9b('0x23')]=_0x22480a['cutdigits']?(_0x351b1e['prefix']||'')+_0x9c9b('0x12')+_0x22480a[_0x9c9b('0x11')]+'}':(_0x351b1e[_0x9c9b('0x24')]||'')+_0x9c9b('0x13');_0x2c45c0[_0x2c8645[_0x5c976][_0x9c9b('0x22')]]=[_0x9c9b('0x25'),_0x351b1e[_0x9c9b('0x1e')],_0x351b1e[_0x9c9b('0x23')]][_0x9c9b('0x26')]('/');break;case _0x9c9b('0x27'):_0x351b1e['options']=_0x5b1502[_0x2c8645[_0x5c976][_0x9c9b('0x22')]];if(_0x22480a[_0x9c9b('0x1b')]!==_0x9c9b('0x28')){if(_0x351b1e['options'][_0x9c9b('0x29')](_0x9c9b('0x2a'))<0x0){_0x351b1e['options']+='U(xcally-mixmonitor-context)';}}else{_0x351b1e['options']=_0x351b1e['options']['replace'](_0x9c9b('0x2a'),'');}_0x2c45c0[_0x2c8645[_0x5c976][_0x9c9b('0x22')]]=_0x351b1e[_0x9c9b('0x27')];break;default:_0x2c45c0[_0x2c8645[_0x5c976][_0x9c9b('0x22')]]=_0x5b1502[_0x2c8645[_0x5c976][_0x9c9b('0x22')]];}}return _0x2c45c0[_0x9c9b('0x26')](',');}function _0x272b8e(_0x33805a,_0x34b7af,_0x46eec4){return new Promise(function(_0x38754e,_0x253efd){var _0x84b415=[];if(_['isEmpty'](_0x34b7af))return _0x38754e(_0x84b415);_0x3418ab[_0x9c9b('0x2b')][_0x9c9b('0x2c')]({'attributes':['id',_0x9c9b('0x2d'),_0x9c9b('0x2e')],'raw':!![]})[_0x9c9b('0x2f')](function(_0x4a040d){for(var _0x42f9b3=0x0,_0x8deee2=0x0;_0x42f9b3<_0x34b7af[_0x9c9b('0x30')];_0x42f9b3++,_0x8deee2=0x0){var _0x249579=_0x34b7af[_0x42f9b3];var _0x5e0c1b=[];var _0x4e6ea7=[];delete _0x249579['id'];if(_0x249579['interval']!=='*,*,*,*'){_0x249579[_0x9c9b('0x31')]=[_0x249579[_0x9c9b('0x2d')]];}else{_0x249579['intervals']=_0x249579[_0x9c9b('0x2e')]?_[_0x9c9b('0x32')](_[_0x9c9b('0x33')](_0x4a040d,{'IntervalId':_0x249579[_0x9c9b('0x2e')]}),_0x9c9b('0x2d')):[];}_0x249579[_0x9c9b('0x2')]=_0x33805a[_0x9c9b('0x2')];_0x249579['exten']=_0x33805a[_0x9c9b('0x3')];if(_0x249579[_0x9c9b('0x1')])_0x249579['type']=_0x249579[_0x9c9b('0x1')][_0x9c9b('0x34')]();if(_0x33805a['type']===_0x9c9b('0xe')){if(_0x249579[_0x9c9b('0x1a')](_0x9c9b('0x35'))&&_0x249579[_0x9c9b('0x35')]&&_0x249579[_0x9c9b('0x35')]!=='--'){_0x5e0c1b[_0x9c9b('0x8')]({'type':_0x249579[_0x9c9b('0x1')][_0x9c9b('0x34')](),'app':_0x9c9b('0xb'),'appdata':_0x9c9b('0x36')+_0x249579[_0x9c9b('0x35')],'context':_0x33805a[_0x9c9b('0x2')],'exten':_0x33805a['exten'],'priority':_0x249579[_0x9c9b('0x31')]['length']+_0x46eec4+_0x8deee2++,'VoiceExtensionId':_0x33805a['id']});}_0x5e0c1b[_0x9c9b('0x8')]({'type':_0x249579[_0x9c9b('0x1')][_0x9c9b('0x34')](),'app':_0x9c9b('0x14'),'appdata':_0x9c9b('0x37')+(_0x249579[_0x9c9b('0x38')]?_0x9c9b('0x39')+_0x249579[_0x9c9b('0x38')]+')':_0x9c9b('0x3a')),'context':_0x33805a[_0x9c9b('0x2')],'exten':_0x33805a['exten'],'priority':_0x249579[_0x9c9b('0x31')]['length']+_0x46eec4+_0x8deee2++,'VoiceExtensionId':_0x33805a['id']});}else{if(_0x249579[_0x9c9b('0x1a')]('answer')){if([_0x9c9b('0x3b'),_0x9c9b('0x3c')][_0x9c9b('0x3d')](_0x249579['app'][_0x9c9b('0x34')]())&&_0x249579[_0x9c9b('0x3e')]!==_0x9c9b('0x3f')){if(_0x249579['answer']){_0x5e0c1b[_0x9c9b('0x8')]({'type':_0x249579[_0x9c9b('0x1')][_0x9c9b('0x34')](),'app':_0x9c9b('0x14'),'appdata':_0x9c9b('0x40'),'context':_0x33805a[_0x9c9b('0x2')],'exten':_0x33805a[_0x9c9b('0x3')],'priority':_0x249579['intervals'][_0x9c9b('0x30')]+_0x46eec4+_0x8deee2++,'VoiceExtensionId':_0x33805a['id']});_0x5e0c1b[_0x9c9b('0x8')]({'type':_0x249579['type'][_0x9c9b('0x34')](),'app':'Set','appdata':_0x9c9b('0x41'),'context':_0x33805a[_0x9c9b('0x2')],'exten':_0x33805a[_0x9c9b('0x3')],'priority':_0x249579[_0x9c9b('0x31')][_0x9c9b('0x30')]+_0x46eec4+_0x8deee2++,'VoiceExtensionId':_0x33805a['id']});}else{_0x5e0c1b['push']({'type':_0x249579['type'][_0x9c9b('0x34')](),'app':_0x9c9b('0x14'),'appdata':_0x9c9b('0x42'),'context':_0x33805a[_0x9c9b('0x2')],'exten':_0x33805a[_0x9c9b('0x3')],'priority':_0x249579['intervals'][_0x9c9b('0x30')]+_0x46eec4+_0x8deee2++,'VoiceExtensionId':_0x33805a['id']});_0x5e0c1b[_0x9c9b('0x8')]({'type':_0x249579[_0x9c9b('0x1')][_0x9c9b('0x34')](),'app':'Set','appdata':_0x9c9b('0x43'),'context':_0x33805a[_0x9c9b('0x2')],'exten':_0x33805a[_0x9c9b('0x3')],'priority':_0x249579[_0x9c9b('0x31')][_0x9c9b('0x30')]+_0x46eec4+_0x8deee2++,'VoiceExtensionId':_0x33805a['id']});}}}}for(var _0x4ae774=0x0;_0x4ae774<_0x249579['intervals'][_0x9c9b('0x30')];_0x4ae774++){var _0x15711a=_0x46eec4+_0x249579[_0x9c9b('0x31')][_0x9c9b('0x30')];var _0x19fbd5=_0x4ae774===_0x249579[_0x9c9b('0x31')][_0x9c9b('0x30')]-0x1?_0x46eec4+_0x5e0c1b['length']+_0x4e6ea7[_0x9c9b('0x30')]+0x2:_0x46eec4+_0x4ae774+0x1;_0x5e0c1b[_0x9c9b('0x44')](_0x4ae774,0x0,{'type':_0x33805a[_0x9c9b('0x1')],'app':_0x9c9b('0x45'),'appdata':_0x249579[_0x9c9b('0x31')][_0x4ae774]+'?'+_0x33805a['context']+_0x9c9b('0x46')+_0x15711a+':'+_0x33805a[_0x9c9b('0x2')]+_0x9c9b('0x46')+_0x19fbd5,'exten':_0x33805a[_0x9c9b('0x3')],'context':_0x33805a[_0x9c9b('0x2')],'priority':_0x46eec4+_0x4ae774,'VoiceExtensionId':_0x33805a['id']});}if(_0x249579[_0x9c9b('0x3e')]===_0x9c9b('0x47'))_0x249579['appdata']=_0x5239d0(_0x33805a,_0x249579['appdata']);_0x249579['priority']=_0x5e0c1b[_0x9c9b('0x30')]?_[_0x9c9b('0x48')](_0x5e0c1b)[_0x9c9b('0x49')]+0x1:_0x46eec4;_0x84b415=_['concat'](_0x84b415,_0x5e0c1b,[_0x249579],_0x4e6ea7);_0x46eec4=_[_0x9c9b('0x48')](_0x84b415)['priority']+0x1;}return _0x38754e(_0x84b415);})[_0x9c9b('0x4a')](function(_0x3c8c86){_0x253efd(_0x3c8c86);});});}return _0x29c242[_0x9c9b('0x4b')](_0x9c9b('0x4c'),attributes,{'tableName':_0x9c9b('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2deefe){var _0x3f2f77=this[_0x9c9b('0x4e')]({'plain':!![]});var _0x67ce34=_0x3f2f77[_0x9c9b('0x1')]===_0x9c9b('0xe')?_0x299221(_0x3f2f77):_0x5ee8f8(_0x3f2f77);return _0x272b8e(_0x3f2f77,_0x2deefe,_[_0x9c9b('0x48')](_0x67ce34)[_0x9c9b('0x49')]+0x1)[_0x9c9b('0x2f')](function(_0x4a71e5){var _0x32a067=_[_0x9c9b('0x4f')](_0x67ce34,_0x4a71e5);_0x32a067['push']({'type':_0x3f2f77['type'],'app':'Hangup','exten':_0x3f2f77['exten'],'context':_0x3f2f77[_0x9c9b('0x2')],'priority':_[_0x9c9b('0x48')](_0x32a067)[_0x9c9b('0x49')]+0x1,'VoiceExtensionId':_0x3f2f77['id']});return _0x32a067;});}}});}; \ No newline at end of file +var _0x93bb=['name','param','split','phone','prefix','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','queue','playback','includes','app','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','VoiceExtension','voice_extensions','then','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','type','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length'];(function(_0xa521cb,_0x274e3e){var _0x159b3d=function(_0x5424d6){while(--_0x5424d6){_0xa521cb['push'](_0xa521cb['shift']());}};_0x159b3d(++_0x274e3e);}(_0x93bb,0x135));var _0xb93b=function(_0x1eff3e,_0x534d1a){_0x1eff3e=_0x1eff3e-0x0;var _0x595c9=_0x93bb[_0x1eff3e];return _0x595c9;};'use strict';var _=require(_0xb93b('0x0'));var attributes=require(_0xb93b('0x1'));module[_0xb93b('0x2')]=function(_0x34b579){var _0xef52ba=_0x34b579[_0xb93b('0x3')];function _0x3ae317(_0x3d634e){var _0x3eb285=0x2;var _0x355196=[{'type':_0x3d634e['type'],'app':_0xb93b('0x4'),'appdata':_0xb93b('0x5')+_0x3d634e['type'],'context':_0x3d634e[_0xb93b('0x6')],'exten':_0x3d634e[_0xb93b('0x7')],'priority':_0x3eb285++,'VoiceExtensionId':_0x3d634e['id']},{'type':_0x3d634e['type'],'app':_0x3d634e[_0xb93b('0x8')]?_0xb93b('0x4'):_0xb93b('0x9'),'appdata':_0x3d634e[_0xb93b('0x8')]?_0xb93b('0xa')+_0x3d634e[_0xb93b('0x8')]:_0xb93b('0xb'),'context':_0x3d634e[_0xb93b('0x6')],'exten':_0x3d634e[_0xb93b('0x7')],'priority':_0x3eb285++,'VoiceExtensionId':_0x3d634e['id']}];if(_0x3d634e[_0xb93b('0xc')]===_0xb93b('0xd')){_0x355196['push']({'type':_0xb93b('0xd'),'app':_0xb93b('0x4'),'appdata':_0xb93b('0xe')+_0x3d634e['id'],'context':_0x3d634e[_0xb93b('0x6')],'exten':_0x3d634e['exten'],'priority':_0x3eb285++,'VoiceExtensionId':_0x3d634e['id']});}_0x355196[_0xb93b('0xf')]({'type':_0x3d634e[_0xb93b('0xc')],'app':_0xb93b('0x4'),'appdata':_0xb93b('0x10'),'context':_0x3d634e[_0xb93b('0x6')],'exten':_0x3d634e[_0xb93b('0x7')],'priority':_0x3eb285++,'VoiceExtensionId':_0x3d634e['id']},{'type':_0x3d634e[_0xb93b('0xc')],'app':'Set','appdata':_0xb93b('0x11'),'context':_0x3d634e[_0xb93b('0x6')],'exten':_0x3d634e[_0xb93b('0x7')],'priority':_0x3eb285++,'VoiceExtensionId':_0x3d634e['id']},{'type':_0x3d634e[_0xb93b('0xc')],'app':_0xb93b('0x4'),'appdata':_0xb93b('0x12'),'context':_0x3d634e['context'],'exten':_0x3d634e[_0xb93b('0x7')],'priority':_0x3eb285++,'VoiceExtensionId':_0x3d634e['id']});return _0x355196;}function _0x5ee3c4(_0x3ba0df){var _0x1f4300=0x2;var _0x17b680=[{'type':_0xb93b('0x13'),'app':_0xb93b('0x4'),'appdata':_0xb93b('0x14'),'context':_0x3ba0df['context'],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':_0xb93b('0x13'),'app':_0x3ba0df[_0xb93b('0x8')]?_0xb93b('0x4'):_0xb93b('0x9'),'appdata':_0x3ba0df[_0xb93b('0x8')]?'CDR(routeAlias)='+_0x3ba0df['alias']:'No\x20alias\x20set','context':_0x3ba0df['context'],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':'outbound','app':'Set','appdata':_0xb93b('0x15')+(_0x3ba0df[_0xb93b('0x16')]?_0xb93b('0x17')+_0x3ba0df['cutdigits']+'}':_0xb93b('0x18')),'context':_0x3ba0df[_0xb93b('0x6')],'exten':_0x3ba0df['exten'],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':_0xb93b('0x13'),'app':_0xb93b('0x4'),'appdata':_0xb93b('0xe')+_0x3ba0df['id'],'context':_0x3ba0df[_0xb93b('0x6')],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':_0xb93b('0x13'),'app':'ExecIf','appdata':_0xb93b('0x19')+(_0x1f4300+0x2)+_0xb93b('0x1a')+(_0x1f4300+0x1)+')','context':_0x3ba0df[_0xb93b('0x6')],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':'outbound','app':_0xb93b('0x4'),'appdata':_0x3ba0df[_0xb93b('0x16')]?_0xb93b('0x1b')+_0x3ba0df[_0xb93b('0x16')]+'}':_0xb93b('0x1c'),'context':_0x3ba0df[_0xb93b('0x6')],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':'outbound','app':_0xb93b('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3ba0df[_0xb93b('0x6')],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':_0xb93b('0x13'),'app':_0xb93b('0x4'),'appdata':_0xb93b('0x11'),'context':_0x3ba0df[_0xb93b('0x6')],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':_0xb93b('0x13'),'app':_0xb93b('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3ba0df['context'],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':_0xb93b('0x13'),'app':_0xb93b('0x4'),'appdata':'outboundrouteid='+_0x3ba0df['id'],'context':_0x3ba0df['context'],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']}];if(_0x3ba0df[_0xb93b('0x1d')](_0xb93b('0x1e'))&&_0x3ba0df['recordingFormat']!=='none'){_0x17b680[_0xb93b('0xf')]({'type':_0xb93b('0x13'),'app':_0xb93b('0x4'),'appdata':_0xb93b('0x1f'),'context':_0x3ba0df[_0xb93b('0x6')],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']},{'type':_0xb93b('0x13'),'app':'Set','appdata':_0xb93b('0x20')+_0x3ba0df[_0xb93b('0x1e')]||_0xb93b('0x21'),'context':_0x3ba0df[_0xb93b('0x6')],'exten':_0x3ba0df[_0xb93b('0x7')],'priority':_0x1f4300++,'VoiceExtensionId':_0x3ba0df['id']});}return _0x17b680;}function _0x46dbd2(_0xf348d7,_0x4da64c){var _0x465d5b=[{'name':_0xb93b('0x22'),'param':0x0},{'name':_0xb93b('0x23'),'param':0x1},{'name':_0xb93b('0x24'),'param':0x2},{'name':_0xb93b('0x25'),'param':0x3}];var _0x155f14={};var _0x446e45=_0x4da64c['split'](',');var _0xfbfbc5=[];for(var _0x86a71=0x0;_0x86a71<_0x465d5b[_0xb93b('0x26')];_0x86a71++){switch(_0x465d5b[_0x86a71][_0xb93b('0x27')]){case _0xb93b('0x22'):_0x155f14[_0xb93b('0x22')]=_0x446e45[_0x465d5b[_0x86a71][_0xb93b('0x28')]][_0xb93b('0x29')]('/')[0x1];_0x155f14[_0xb93b('0x2a')]=_0x446e45[_0x465d5b[_0x86a71][_0xb93b('0x28')]][_0xb93b('0x29')]('/')[0x2];_0x155f14[_0xb93b('0x2b')]=_0x155f14[_0xb93b('0x2a')]?_0x155f14[_0xb93b('0x2a')]['split']('$')[0x0]:undefined;_0x155f14[_0xb93b('0x2a')]=_0xf348d7[_0xb93b('0x16')]?(_0x155f14['prefix']||'')+_0xb93b('0x17')+_0xf348d7[_0xb93b('0x16')]+'}':(_0x155f14[_0xb93b('0x2b')]||'')+_0xb93b('0x18');_0xfbfbc5[_0x465d5b[_0x86a71][_0xb93b('0x28')]]=[_0xb93b('0x2c'),_0x155f14['trunk'],_0x155f14[_0xb93b('0x2a')]][_0xb93b('0x2d')]('/');break;case _0xb93b('0x24'):_0x155f14[_0xb93b('0x24')]=_0x446e45[_0x465d5b[_0x86a71]['param']];if(_0xf348d7['recordingFormat']!==_0xb93b('0x2e')){if(_0x155f14[_0xb93b('0x24')][_0xb93b('0x2f')](_0xb93b('0x30'))<0x0){_0x155f14['options']+=_0xb93b('0x30');}}else{_0x155f14['options']=_0x155f14[_0xb93b('0x24')]['replace'](_0xb93b('0x30'),'');}_0xfbfbc5[_0x465d5b[_0x86a71][_0xb93b('0x28')]]=_0x155f14[_0xb93b('0x24')];break;default:_0xfbfbc5[_0x465d5b[_0x86a71][_0xb93b('0x28')]]=_0x446e45[_0x465d5b[_0x86a71][_0xb93b('0x28')]];}}return _0xfbfbc5[_0xb93b('0x2d')](',');}function _0x1ac228(_0x50b8fa,_0x19a477,_0x4fe796){return new Promise(function(_0x95f919,_0x4dd710){var _0x51a5b1=[];if(_[_0xb93b('0x31')](_0x19a477))return _0x95f919(_0x51a5b1);_0xef52ba[_0xb93b('0x32')][_0xb93b('0x33')]({'attributes':['id',_0xb93b('0x34'),_0xb93b('0x35')],'raw':!![]})['then'](function(_0x5ead61){for(var _0x321fb0=0x0,_0x38124d=0x0;_0x321fb0<_0x19a477[_0xb93b('0x26')];_0x321fb0++,_0x38124d=0x0){var _0x4ef552=_0x19a477[_0x321fb0];var _0x279f96=[];var _0x16c596=[];delete _0x4ef552['id'];if(_0x4ef552['interval']!==_0xb93b('0x36')){_0x4ef552[_0xb93b('0x37')]=[_0x4ef552[_0xb93b('0x34')]];}else{_0x4ef552[_0xb93b('0x37')]=_0x4ef552['IntervalId']?_[_0xb93b('0x38')](_[_0xb93b('0x39')](_0x5ead61,{'IntervalId':_0x4ef552['IntervalId']}),_0xb93b('0x34')):[];}_0x4ef552[_0xb93b('0x6')]=_0x50b8fa['context'];_0x4ef552['exten']=_0x50b8fa[_0xb93b('0x7')];if(_0x4ef552[_0xb93b('0xc')])_0x4ef552['type']=_0x4ef552[_0xb93b('0xc')][_0xb93b('0x3a')]();if(_0x50b8fa[_0xb93b('0xc')]===_0xb93b('0x13')){if(_0x4ef552[_0xb93b('0x1d')](_0xb93b('0x3b'))&&_0x4ef552['tag']&&_0x4ef552[_0xb93b('0x3b')]!=='--'){_0x279f96[_0xb93b('0xf')]({'type':_0x4ef552['type'][_0xb93b('0x3a')](),'app':'Set','appdata':_0xb93b('0x3c')+_0x4ef552[_0xb93b('0x3b')],'context':_0x50b8fa[_0xb93b('0x6')],'exten':_0x50b8fa[_0xb93b('0x7')],'priority':_0x4ef552[_0xb93b('0x37')]['length']+_0x4fe796+_0x38124d++,'VoiceExtensionId':_0x50b8fa['id']});}_0x279f96['push']({'type':_0x4ef552[_0xb93b('0xc')][_0xb93b('0x3a')](),'app':_0xb93b('0x3d'),'appdata':_0xb93b('0x3e')+(_0x4ef552[_0xb93b('0x3f')]?_0xb93b('0x40')+_0x4ef552[_0xb93b('0x3f')]+')':'NoOp(No\x20number\x20available)'),'context':_0x50b8fa['context'],'exten':_0x50b8fa['exten'],'priority':_0x4ef552[_0xb93b('0x37')]['length']+_0x4fe796+_0x38124d++,'VoiceExtensionId':_0x50b8fa['id']});}else{if(_0x4ef552['hasOwnProperty']('answer')){if([_0xb93b('0x41'),_0xb93b('0x42')][_0xb93b('0x43')](_0x4ef552[_0xb93b('0x44')]['toLowerCase']())&&_0x4ef552['appType']!==_0xb93b('0x45')){if(_0x4ef552[_0xb93b('0x46')]){_0x279f96[_0xb93b('0xf')]({'type':_0x4ef552[_0xb93b('0xc')][_0xb93b('0x3a')](),'app':_0xb93b('0x3d'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x50b8fa[_0xb93b('0x6')],'exten':_0x50b8fa[_0xb93b('0x7')],'priority':_0x4ef552['intervals']['length']+_0x4fe796+_0x38124d++,'VoiceExtensionId':_0x50b8fa['id']});_0x279f96['push']({'type':_0x4ef552[_0xb93b('0xc')][_0xb93b('0x3a')](),'app':_0xb93b('0x4'),'appdata':_0xb93b('0x47'),'context':_0x50b8fa[_0xb93b('0x6')],'exten':_0x50b8fa['exten'],'priority':_0x4ef552[_0xb93b('0x37')][_0xb93b('0x26')]+_0x4fe796+_0x38124d++,'VoiceExtensionId':_0x50b8fa['id']});}else{_0x279f96[_0xb93b('0xf')]({'type':_0x4ef552['type'][_0xb93b('0x3a')](),'app':_0xb93b('0x3d'),'appdata':_0xb93b('0x48'),'context':_0x50b8fa['context'],'exten':_0x50b8fa['exten'],'priority':_0x4ef552[_0xb93b('0x37')][_0xb93b('0x26')]+_0x4fe796+_0x38124d++,'VoiceExtensionId':_0x50b8fa['id']});_0x279f96[_0xb93b('0xf')]({'type':_0x4ef552[_0xb93b('0xc')][_0xb93b('0x3a')](),'app':'Set','appdata':_0xb93b('0x49'),'context':_0x50b8fa[_0xb93b('0x6')],'exten':_0x50b8fa[_0xb93b('0x7')],'priority':_0x4ef552[_0xb93b('0x37')]['length']+_0x4fe796+_0x38124d++,'VoiceExtensionId':_0x50b8fa['id']});}}}}for(var _0x3d2db5=0x0;_0x3d2db5<_0x4ef552[_0xb93b('0x37')]['length'];_0x3d2db5++){var _0x58b417=_0x4fe796+_0x4ef552[_0xb93b('0x37')]['length'];var _0x3ba60e=_0x3d2db5===_0x4ef552[_0xb93b('0x37')][_0xb93b('0x26')]-0x1?_0x4fe796+_0x279f96[_0xb93b('0x26')]+_0x16c596['length']+0x2:_0x4fe796+_0x3d2db5+0x1;_0x279f96[_0xb93b('0x4a')](_0x3d2db5,0x0,{'type':_0x50b8fa[_0xb93b('0xc')],'app':_0xb93b('0x4b'),'appdata':_0x4ef552[_0xb93b('0x37')][_0x3d2db5]+'?'+_0x50b8fa[_0xb93b('0x6')]+_0xb93b('0x4c')+_0x58b417+':'+_0x50b8fa[_0xb93b('0x6')]+',${EXTEN},'+_0x3ba60e,'exten':_0x50b8fa[_0xb93b('0x7')],'context':_0x50b8fa[_0xb93b('0x6')],'priority':_0x4fe796+_0x3d2db5,'VoiceExtensionId':_0x50b8fa['id']});}if(_0x4ef552[_0xb93b('0x4d')]===_0xb93b('0x4e'))_0x4ef552[_0xb93b('0x4f')]=_0x46dbd2(_0x50b8fa,_0x4ef552[_0xb93b('0x4f')]);_0x4ef552[_0xb93b('0x50')]=_0x279f96[_0xb93b('0x26')]?_[_0xb93b('0x51')](_0x279f96)['priority']+0x1:_0x4fe796;_0x51a5b1=_['concat'](_0x51a5b1,_0x279f96,[_0x4ef552],_0x16c596);_0x4fe796=_['last'](_0x51a5b1)[_0xb93b('0x50')]+0x1;}return _0x95f919(_0x51a5b1);})['catch'](function(_0xb9a576){_0x4dd710(_0xb9a576);});});}return _0x34b579['define'](_0xb93b('0x52'),attributes,{'tableName':_0xb93b('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x30a882){var _0x9dfe68=this['get']({'plain':!![]});var _0x4f1849=_0x9dfe68[_0xb93b('0xc')]===_0xb93b('0x13')?_0x5ee3c4(_0x9dfe68):_0x3ae317(_0x9dfe68);return _0x1ac228(_0x9dfe68,_0x30a882,_[_0xb93b('0x51')](_0x4f1849)['priority']+0x1)[_0xb93b('0x54')](function(_0x9e4ed8){var _0x522012=_[_0xb93b('0x55')](_0x4f1849,_0x9e4ed8);_0x522012['push']({'type':_0x9dfe68[_0xb93b('0xc')],'app':_0xb93b('0x56'),'exten':_0x9dfe68['exten'],'context':_0x9dfe68['context'],'priority':_[_0xb93b('0x51')](_0x522012)[_0xb93b('0x50')]+0x1,'VoiceExtensionId':_0x9dfe68['id']});return _0x522012;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index b2311b3..c19400f 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 _0x3f1c=['info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','register','then'];(function(_0x27b059,_0x275671){var _0x982b2a=function(_0x1e7d71){while(--_0x1e7d71){_0x27b059['push'](_0x27b059['shift']());}};_0x982b2a(++_0x275671);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x29f59a,_0x82ef0){_0x29f59a=_0x29f59a-0x0;var _0x5bbed0=_0x3f1c[_0x29f59a];return _0x5bbed0;};'use strict';var _=require(_0xc3f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc3f1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3f1('0x2'))['db'];var utils=require(_0xc3f1('0x3'));var logger=require(_0xc3f1('0x4'))(_0xc3f1('0x5'));var config=require(_0xc3f1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc3f1('0x7')]['http']({'port':0x232a});config[_0xc3f1('0x8')]=_[_0xc3f1('0x9')](config[_0xc3f1('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3f1('0x8')]));require('./voiceExtension.socket')[_0xc3f1('0xa')](socket);function respondWithRpcPromise(_0xf72cc2,_0x2ec9dd,_0x3134ec){return new BPromise(function(_0x4f2771,_0x63129a){return client['request'](_0xf72cc2,_0x3134ec)[_0xc3f1('0xb')](function(_0x5a58b9){logger[_0xc3f1('0xc')]('VoiceExtension,\x20%s,\x20%s',_0x2ec9dd,'request\x20sent');logger[_0xc3f1('0xd')](_0xc3f1('0xe'),_0x2ec9dd,_0xc3f1('0xf'),JSON[_0xc3f1('0x10')](_0x5a58b9));if(_0x5a58b9[_0xc3f1('0x11')]){if(_0x5a58b9[_0xc3f1('0x11')]['code']===0x1f4){logger['error'](_0xc3f1('0x12'),_0x2ec9dd,_0x5a58b9[_0xc3f1('0x11')][_0xc3f1('0x13')]);return _0x63129a(_0x5a58b9[_0xc3f1('0x11')]['message']);}logger[_0xc3f1('0x11')](_0xc3f1('0x12'),_0x2ec9dd,_0x5a58b9[_0xc3f1('0x11')][_0xc3f1('0x13')]);return _0x4f2771(_0x5a58b9['error'][_0xc3f1('0x13')]);}else{logger['info'](_0xc3f1('0x12'),_0x2ec9dd,_0xc3f1('0xf'));_0x4f2771(_0x5a58b9[_0xc3f1('0x14')][_0xc3f1('0x13')]);}})['catch'](function(_0x10da7e){logger[_0xc3f1('0x11')](_0xc3f1('0x12'),_0x2ec9dd,_0x10da7e);_0x63129a(_0x10da7e);});});}exports[_0xc3f1('0x15')]=function(_0x27a37c){var _0x4d0412=this;return new Promise(function(_0x68d412,_0x4f53c1){return db['VoiceExtension'][_0xc3f1('0x16')]({'raw':_0x27a37c[_0xc3f1('0x17')]?_0x27a37c[_0xc3f1('0x17')][_0xc3f1('0x18')]===undefined?!![]:![]:!![],'where':_0x27a37c['options']?_0x27a37c[_0xc3f1('0x17')][_0xc3f1('0x19')]||null:null,'attributes':_0x27a37c[_0xc3f1('0x17')]?_0x27a37c[_0xc3f1('0x17')][_0xc3f1('0x1a')]||null:null,'limit':_0x27a37c[_0xc3f1('0x17')]?_0x27a37c[_0xc3f1('0x17')][_0xc3f1('0x1b')]||null:null,'include':_0x27a37c['options']?_0x27a37c['options'][_0xc3f1('0x1c')]?_[_0xc3f1('0x1d')](_0x27a37c[_0xc3f1('0x17')]['include'],function(_0x5e1b6a){return{'model':db[_0x5e1b6a[_0xc3f1('0x1e')]],'as':_0x5e1b6a['as'],'attributes':_0x5e1b6a[_0xc3f1('0x1a')],'include':_0x5e1b6a[_0xc3f1('0x1c')]?_['map'](_0x5e1b6a['include'],function(_0x136e7a){return{'model':db[_0x136e7a[_0xc3f1('0x1e')]],'as':_0x136e7a['as'],'attributes':_0x136e7a['attributes'],'include':_0x136e7a['include']?_[_0xc3f1('0x1d')](_0x136e7a[_0xc3f1('0x1c')],function(_0x5cb85d){return{'model':db[_0x5cb85d[_0xc3f1('0x1e')]],'as':_0x5cb85d['as'],'attributes':_0x5cb85d[_0xc3f1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc3f1('0xb')](function(_0x3454a3){logger[_0xc3f1('0xc')](_0xc3f1('0x15'),_0x27a37c);logger[_0xc3f1('0xd')]('GetVoiceExtension',_0x27a37c,JSON[_0xc3f1('0x10')](_0x3454a3));_0x68d412(_0x3454a3);})[_0xc3f1('0x1f')](function(_0x1782d7){logger[_0xc3f1('0x11')](_0xc3f1('0x15'),_0x1782d7['message'],_0x27a37c);_0x4f53c1(_0x4d0412[_0xc3f1('0x11')](0x1f4,_0x1782d7['message']));});});}; \ No newline at end of file +var _0xef17=['info','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','debug','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message'];(function(_0x156fa9,_0x2c4a0e){var _0x14dd7d=function(_0x20f7a4){while(--_0x20f7a4){_0x156fa9['push'](_0x156fa9['shift']());}};_0x14dd7d(++_0x2c4a0e);}(_0xef17,0x136));var _0x7ef1=function(_0x39a8d0,_0x8e3e85){_0x39a8d0=_0x39a8d0-0x0;var _0x5f21c7=_0xef17[_0x39a8d0];return _0x5f21c7;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var moment=require(_0x7ef1('0x2'));var BPromise=require(_0x7ef1('0x3'));var rs=require(_0x7ef1('0x4'));var fs=require('fs');var Redis=require(_0x7ef1('0x5'));var db=require(_0x7ef1('0x6'))['db'];var utils=require(_0x7ef1('0x7'));var logger=require(_0x7ef1('0x8'))('rpc');var config=require(_0x7ef1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ef1('0xa')]['http']({'port':0x232a});config[_0x7ef1('0xb')]=_['defaults'](config['redis'],{'host':_0x7ef1('0xc'),'port':0x18eb});var socket=require(_0x7ef1('0xd'))(new Redis(config['redis']));require(_0x7ef1('0xe'))[_0x7ef1('0xf')](socket);function respondWithRpcPromise(_0x4534fc,_0x3d47e2,_0x2cb9b0){return new BPromise(function(_0x3ce78d,_0x642de7){return client['request'](_0x4534fc,_0x2cb9b0)['then'](function(_0x1d4522){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x3d47e2,'request\x20sent');logger[_0x7ef1('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3d47e2,_0x7ef1('0x11'),JSON[_0x7ef1('0x12')](_0x1d4522));if(_0x1d4522[_0x7ef1('0x13')]){if(_0x1d4522[_0x7ef1('0x13')][_0x7ef1('0x14')]===0x1f4){logger[_0x7ef1('0x13')](_0x7ef1('0x15'),_0x3d47e2,_0x1d4522[_0x7ef1('0x13')]['message']);return _0x642de7(_0x1d4522['error'][_0x7ef1('0x16')]);}logger['error'](_0x7ef1('0x15'),_0x3d47e2,_0x1d4522[_0x7ef1('0x13')]['message']);return _0x3ce78d(_0x1d4522['error']['message']);}else{logger[_0x7ef1('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x3d47e2,_0x7ef1('0x11'));_0x3ce78d(_0x1d4522['result']['message']);}})['catch'](function(_0x2bd224){logger['error'](_0x7ef1('0x15'),_0x3d47e2,_0x2bd224);_0x642de7(_0x2bd224);});});}exports[_0x7ef1('0x18')]=function(_0x5291b0){var _0x568d0a=this;return new Promise(function(_0x44bcf2,_0x5490b9){return db[_0x7ef1('0x19')][_0x7ef1('0x1a')]({'raw':_0x5291b0[_0x7ef1('0x1b')]?_0x5291b0[_0x7ef1('0x1b')][_0x7ef1('0x1c')]===undefined?!![]:![]:!![],'where':_0x5291b0[_0x7ef1('0x1b')]?_0x5291b0[_0x7ef1('0x1b')][_0x7ef1('0x1d')]||null:null,'attributes':_0x5291b0['options']?_0x5291b0[_0x7ef1('0x1b')][_0x7ef1('0x1e')]||null:null,'limit':_0x5291b0[_0x7ef1('0x1b')]?_0x5291b0[_0x7ef1('0x1b')][_0x7ef1('0x1f')]||null:null,'include':_0x5291b0[_0x7ef1('0x1b')]?_0x5291b0[_0x7ef1('0x1b')][_0x7ef1('0x20')]?_['map'](_0x5291b0['options'][_0x7ef1('0x20')],function(_0x12ef5a){return{'model':db[_0x12ef5a[_0x7ef1('0x21')]],'as':_0x12ef5a['as'],'attributes':_0x12ef5a[_0x7ef1('0x1e')],'include':_0x12ef5a[_0x7ef1('0x20')]?_['map'](_0x12ef5a[_0x7ef1('0x20')],function(_0x9eca93){return{'model':db[_0x9eca93[_0x7ef1('0x21')]],'as':_0x9eca93['as'],'attributes':_0x9eca93[_0x7ef1('0x1e')],'include':_0x9eca93[_0x7ef1('0x20')]?_[_0x7ef1('0x22')](_0x9eca93[_0x7ef1('0x20')],function(_0x58e7ee){return{'model':db[_0x58e7ee[_0x7ef1('0x21')]],'as':_0x58e7ee['as'],'attributes':_0x58e7ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x7ef1('0x23')](function(_0x2546bf){logger['info']('GetVoiceExtension',_0x5291b0);logger[_0x7ef1('0x10')](_0x7ef1('0x18'),_0x5291b0,JSON['stringify'](_0x2546bf));_0x44bcf2(_0x2546bf);})[_0x7ef1('0x24')](function(_0x56fe40){logger[_0x7ef1('0x13')]('GetVoiceExtension',_0x56fe40[_0x7ef1('0x16')],_0x5291b0);_0x5490b9(_0x568d0a[_0x7ef1('0x13')](0x1f4,_0x56fe40['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 7c09a86..ecdd208 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 _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x21b90e,_0x2f510d){var _0x262fcf=function(_0x3bff58){while(--_0x3bff58){_0x21b90e['push'](_0x21b90e['shift']());}};_0x262fcf(++_0x2f510d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file +var _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x4e3bcf,_0x157db0){var _0x3c23e0=function(_0x700636){while(--_0x700636){_0x4e3bcf['push'](_0x4e3bcf['shift']());}};_0x3c23e0(++_0x157db0);}(_0x0295,0x1f0));var _0x5029=function(_0x2b3c9d,_0x1c8c0c){_0x2b3c9d=_0x2b3c9d-0x0;var _0x4b8037=_0x0295[_0x2b3c9d];return _0x4b8037;};'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 ff19b65..a14bfd7 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 _0xd046=['get','show','getMessages','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMail.controller','index'];(function(_0x3fda88,_0x16362e){var _0x2ba82f=function(_0x78027e){while(--_0x78027e){_0x3fda88['push'](_0x3fda88['shift']());}};_0x2ba82f(++_0x16362e);}(_0xd046,0x129));var _0x6d04=function(_0x3560cb,_0x4ec8d6){_0x3560cb=_0x3560cb-0x0;var _0x46ea89=_0xd046[_0x3560cb];return _0x46ea89;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['post']('/',auth[_0x6d04('0xa')](),controller['create']);router['put']('/:id',auth[_0x6d04('0xa')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')](_0x6d04('0xd'),auth['isAuthenticated'](),controller[_0x6d04('0xe')]);module[_0x6d04('0xf')]=router; \ No newline at end of file +var _0x6a55=['isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy','exports','multer','express','../../components/auth/service','../../config/environment','get'];(function(_0x3df1ca,_0x49fb2a){var _0x5e7db8=function(_0x5aad74){while(--_0x5aad74){_0x3df1ca['push'](_0x3df1ca['shift']());}};_0x5e7db8(++_0x49fb2a);}(_0x6a55,0xdb));var _0x56a5=function(_0x5e8282,_0x1f2962){_0x5e8282=_0x5e8282-0x0;var _0x5cd37d=_0x6a55[_0x5e8282];return _0x5cd37d;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x56a5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x56a5('0x3'));var controller=require('./voiceMail.controller');router[_0x56a5('0x4')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0x6')]);router[_0x56a5('0x4')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x4')]('/:id/messages',auth[_0x56a5('0x5')](),controller[_0x56a5('0x9')]);router[_0x56a5('0xa')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0xb')]);router[_0x56a5('0xc')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xd')]);router['delete']('/:id',auth[_0x56a5('0x5')](),controller[_0x56a5('0xe')]);module[_0x56a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 919ee87..df2db6c 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 _0xe46c=['email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','STRING','contest_mailbox'];(function(_0xfe328a,_0x40602a){var _0x54d9a4=function(_0x591e40){while(--_0x591e40){_0xfe328a['push'](_0xfe328a['shift']());}};_0x54d9a4(++_0x40602a);}(_0xe46c,0x1a2));var _0xce46=function(_0x50119e,_0x55e961){_0x50119e=_0x50119e-0x0;var _0xc88caa=_0xe46c[_0x50119e];return _0xc88caa;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xce46('0x0')]},'context':{'type':Sequelize[_0xce46('0x0')],'defaultValue':'from-voicemail','unique':_0xce46('0x1')},'mailbox':{'type':Sequelize[_0xce46('0x0')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xce46('0x0')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xce46('0x0')],'validate':{'isEmail':!![]},'set':function(_0x4290d3){this['setDataValue'](_0xce46('0x2'),typeof _0x4290d3===_0xce46('0x3')&&_0x4290d3[_0xce46('0x4')]()?_0x4290d3[_0xce46('0x4')]():null);}},'pager':{'type':Sequelize[_0xce46('0x0')]},'tz':{'type':Sequelize[_0xce46('0x0')],'defaultValue':_0xce46('0x5')},'attach':{'type':Sequelize[_0xce46('0x6')](_0xce46('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xce46('0x6')](_0xce46('0x7'),'no'),'defaultValue':_0xce46('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xce46('0x0')]},'review':{'type':Sequelize[_0xce46('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xce46('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xce46('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xce46('0x6')](_0xce46('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xce46('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xce46('0x6')](_0xce46('0x7'),'no'),'defaultValue':_0xce46('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0xce46('0x6')](_0xce46('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xce46('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xce46('0x6')](_0xce46('0x7'),'no'),'defaultValue':_0xce46('0x7'),'allowNull':![]},'stamp':{'type':_0xce46('0x9')},'emailsubject':{'type':Sequelize[_0xce46('0x0')]},'emailbody':{'type':Sequelize[_0xce46('0x0')]},'maxsecs':{'type':Sequelize[_0xce46('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xce46('0xb')],'get':function(){return this[_0xce46('0xc')]('fullname')+_0xce46('0xd')+this[_0xce46('0xc')](_0xce46('0xe'));}}}; \ No newline at end of file +var _0x35ef=['from-voicemail','contest_mailbox','setDataValue','trim','central','ENUM','yes','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING'];(function(_0x5d860d,_0x32001b){var _0x5bbf9d=function(_0xd8cf25){while(--_0xd8cf25){_0x5d860d['push'](_0x5d860d['shift']());}};_0x5bbf9d(++_0x32001b);}(_0x35ef,0x175));var _0xf35e=function(_0x12f54b,_0x25cafa){_0x12f54b=_0x12f54b-0x0;var _0x274f24=_0x35ef[_0x12f54b];return _0x274f24;};'use strict';var Sequelize=require(_0xf35e('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf35e('0x1')],'defaultValue':_0xf35e('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xf35e('0x1')],'defaultValue':'','allowNull':![],'unique':_0xf35e('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xf35e('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x2c3fad){this[_0xf35e('0x4')]('email',typeof _0x2c3fad==='string'&&_0x2c3fad[_0xf35e('0x5')]()?_0x2c3fad[_0xf35e('0x5')]():null);}},'pager':{'type':Sequelize[_0xf35e('0x1')]},'tz':{'type':Sequelize[_0xf35e('0x1')],'defaultValue':_0xf35e('0x6')},'attach':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':_0xf35e('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf35e('0x1')]},'callback':{'type':Sequelize[_0xf35e('0x1')]},'review':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xf35e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xf35e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':_0xf35e('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf35e('0x7')](_0xf35e('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xf35e('0x9')},'emailsubject':{'type':Sequelize[_0xf35e('0x1')]},'emailbody':{'type':Sequelize[_0xf35e('0x1')]},'maxsecs':{'type':Sequelize[_0xf35e('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf35e('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf35e('0xb')](_0xf35e('0xc'))+_0xf35e('0xd')+this[_0xf35e('0xb')](_0xf35e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 587eecf..6b3ac5f 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 _0x04b8=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Voicemails','error','stack','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x370ae6,_0x360164){var _0x4acb8e=function(_0x42d10c){while(--_0x42d10c){_0x370ae6['push'](_0x370ae6['shift']());}};_0x4acb8e(++_0x360164);}(_0x04b8,0x159));var _0x804b=function(_0x116016,_0x4d0d48){_0x116016=_0x116016-0x0;var _0x55dea9=_0x04b8[_0x116016];return _0x55dea9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['VoiceMail'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['VoiceMail']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Voicemails';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));};exports[_0x804b('0x55')]=function(_0x5a549f,_0x4f7cc4,_0x13fa81){return db[_0x804b('0x2d')][_0x804b('0x56')]({'where':{'id':_0x5a549f[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x4f7cc4,null))[_0x804b('0x24')](function(_0x24c9b0){var _0x3100aa;var _0x2c0ed4={},_0x3f0ca3={};_0x3f0ca3[_0x804b('0x31')]=_[_0x804b('0x33')](db[_0x804b('0x57')][_0x804b('0x2e')]);_0x3f0ca3[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5a549f['query']);_0x3f0ca3[_0x804b('0x34')]=_[_0x804b('0x35')](_0x3f0ca3['model'],_0x3f0ca3[_0x804b('0x32')]);_0x2c0ed4[_0x804b('0x36')]=_[_0x804b('0x35')](_0x3f0ca3[_0x804b('0x31')],qs['fields'](_0x5a549f[_0x804b('0x32')][_0x804b('0x37')]));_0x2c0ed4['attributes']=_0x2c0ed4[_0x804b('0x36')][_0x804b('0x38')]?_0x2c0ed4[_0x804b('0x36')]:_0x3f0ca3['model'];if(!_0x5a549f[_0x804b('0x32')][_0x804b('0x39')](_0x804b('0x58'))){_0x2c0ed4[_0x804b('0x1d')]=qs[_0x804b('0x1d')](_0x5a549f['query'][_0x804b('0x1d')]);_0x2c0ed4[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x5a549f[_0x804b('0x32')]['offset']);}_0x2c0ed4['order']=qs[_0x804b('0x3b')](_0x5a549f['query'][_0x804b('0x3b')]);_0x2c0ed4[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x5a549f[_0x804b('0x32')],_0x3f0ca3['filters']));if(_0x5a549f[_0x804b('0x32')][_0x804b('0x3e')]){_0x2c0ed4[_0x804b('0x3c')]=_['merge'](_0x2c0ed4[_0x804b('0x3c')],{'$or':_[_0x804b('0x2c')](_0x2c0ed4['attributes'],function(_0xb9deae){var _0x481bcd={};_0x481bcd[_0xb9deae]={'$like':'%'+_0x5a549f[_0x804b('0x32')][_0x804b('0x3e')]+'%'};return _0x481bcd;})});}_0x2c0ed4['where']=_[_0x804b('0x3f')](_0x2c0ed4[_0x804b('0x3c')],{'mailboxuser':_0x24c9b0[_0x804b('0x59')]});_0x2c0ed4=_['merge']({},_0x2c0ed4,_0x5a549f[_0x804b('0x41')]);return db['VoiceMailMessage'][_0x804b('0x5a')](_0x2c0ed4)[_0x804b('0x24')](respondWithFilteredResult(_0x4f7cc4,_0x2c0ed4));})[_0x804b('0x46')](handleError(_0x4f7cc4,null));}; \ No newline at end of file +var _0x5eb8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','VoiceMail','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','VoiceMailMessage','pick','filter','mailbox'];(function(_0x6d4cee,_0x295b67){var _0x2602b0=function(_0x712d39){while(--_0x712d39){_0x6d4cee['push'](_0x6d4cee['shift']());}};_0x2602b0(++_0x295b67);}(_0x5eb8,0xb0));var _0x85eb=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x5eb8[_0x273c39];return _0x46d6b5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x27')]({'plain':!![]});var _0x5dfc96=_0x85eb('0x28');return db[_0x85eb('0x29')][_0x85eb('0x25')]({'where':{'type':_0x5dfc96,'resourceId':_0x312b3e['id']}})[_0x85eb('0x26')](function(){return _0x1426c8;});})[_0x85eb('0x26')](function(){_0x5b48d9['status'](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x792d3a,_0x291557){return function(_0x3e7eb9){if(!_0x3e7eb9){_0x792d3a[_0x85eb('0x2a')](0x194);}return _0x3e7eb9;};}function handleError(_0x29d262,_0x50541a){_0x50541a=_0x50541a||0x1f4;return function(_0x562792){logger[_0x85eb('0x2b')](_0x562792['stack']);if(_0x562792[_0x85eb('0x2c')]){delete _0x562792['name'];}_0x29d262[_0x85eb('0x1a')](_0x50541a)[_0x85eb('0x2d')](_0x562792);};}exports[_0x85eb('0x2e')]=function(_0x1d9278,_0xa67e1c){var _0xf4ac13={},_0x41ed76={},_0x5decd5={'count':0x0,'rows':[]};var _0x237f19=_[_0x85eb('0x2f')](db['VoiceMail'][_0x85eb('0x30')],function(_0x5af2de){return{'name':_0x5af2de['fieldName'],'type':_0x5af2de[_0x85eb('0x31')][_0x85eb('0x32')]};});_0x41ed76[_0x85eb('0x33')]=_[_0x85eb('0x2f')](_0x237f19,_0x85eb('0x2c'));_0x41ed76[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x1d9278[_0x85eb('0x34')]);_0x41ed76[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x41ed76['model'],_0x41ed76[_0x85eb('0x34')]);_0xf4ac13[_0x85eb('0x38')]=_['intersection'](_0x41ed76['model'],qs[_0x85eb('0x39')](_0x1d9278[_0x85eb('0x34')][_0x85eb('0x39')]));_0xf4ac13[_0x85eb('0x38')]=_0xf4ac13[_0x85eb('0x38')][_0x85eb('0x3a')]?_0xf4ac13[_0x85eb('0x38')]:_0x41ed76[_0x85eb('0x33')];if(!_0x1d9278[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0xf4ac13[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x1d9278[_0x85eb('0x34')]['limit']);_0xf4ac13[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1d9278['query']['offset']);}_0xf4ac13[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x1d9278['query'][_0x85eb('0x3e')]);_0xf4ac13['where']=qs[_0x85eb('0x36')](_['pick'](_0x1d9278[_0x85eb('0x34')],_0x41ed76['filters']),_0x237f19);if(_0x1d9278[_0x85eb('0x34')]['filter']){_0xf4ac13[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0xf4ac13['where'],{'$or':_[_0x85eb('0x2f')](_0x237f19,function(_0x5a1c15){if(_0x5a1c15[_0x85eb('0x31')]!==_0x85eb('0x41')){var _0x5c0156={};_0x5c0156[_0x5a1c15[_0x85eb('0x2c')]]={'$like':'%'+_0x1d9278['query']['filter']+'%'};return _0x5c0156;}})});}_0xf4ac13=_[_0x85eb('0x40')]({},_0xf4ac13,_0x1d9278['options']);var _0x17cc20={'where':_0xf4ac13[_0x85eb('0x3f')]};return db['VoiceMail']['count'](_0x17cc20)[_0x85eb('0x26')](function(_0x422ec3){_0x5decd5['count']=_0x422ec3;if(_0x1d9278['query'][_0x85eb('0x42')]){_0xf4ac13[_0x85eb('0x43')]=[{'all':!![]}];}return db[_0x85eb('0x44')][_0x85eb('0x45')](_0xf4ac13);})[_0x85eb('0x26')](function(_0x5b7411){_0x5decd5[_0x85eb('0x46')]=_0x5b7411;return _0x5decd5;})[_0x85eb('0x26')](respondWithFilteredResult(_0xa67e1c,_0xf4ac13))[_0x85eb('0x47')](handleError(_0xa67e1c,null));};exports[_0x85eb('0x48')]=function(_0x2ed39d,_0xbc43a7){var _0x40e2a2={'raw':!![],'where':{'id':_0x2ed39d[_0x85eb('0x49')]['id']}},_0x3e11a8={};_0x3e11a8['model']=_[_0x85eb('0x35')](db[_0x85eb('0x44')]['rawAttributes']);_0x3e11a8[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x2ed39d[_0x85eb('0x34')]);_0x3e11a8[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],_0x3e11a8['query']);_0x40e2a2[_0x85eb('0x38')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x39')]));_0x40e2a2[_0x85eb('0x38')]=_0x40e2a2[_0x85eb('0x38')]['length']?_0x40e2a2[_0x85eb('0x38')]:_0x3e11a8[_0x85eb('0x33')];if(_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x42')]){_0x40e2a2[_0x85eb('0x43')]=[{'all':!![]}];}_0x40e2a2=_[_0x85eb('0x40')]({},_0x40e2a2,_0x2ed39d[_0x85eb('0x4a')]);return db[_0x85eb('0x44')][_0x85eb('0x4b')](_0x40e2a2)[_0x85eb('0x26')](handleEntityNotFound(_0xbc43a7,null))[_0x85eb('0x26')](respondWithResult(_0xbc43a7,null))[_0x85eb('0x47')](handleError(_0xbc43a7,null));};exports['create']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x44')]['create'](_0x11da79[_0x85eb('0x4c')],{})[_0x85eb('0x26')](function(_0x2cf928){var _0xd2f302=_0x11da79[_0x85eb('0x4d')]['get']({'plain':!![]});if(!_0xd2f302)throw new Error(_0x85eb('0x4e'));if(_0xd2f302[_0x85eb('0x4f')]===_0x85eb('0x4d')){var _0x50e264=_0x2cf928[_0x85eb('0x27')]({'plain':!![]});var _0x4550fd=_0x85eb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4550fd,'userProfileId':_0xd2f302[_0x85eb('0x50')]},'raw':!![]})['then'](function(_0x5ed98a){if(_0x5ed98a&&_0x5ed98a[_0x85eb('0x51')]===0x0){return db['UserProfileResource'][_0x85eb('0x52')]({'name':_0x50e264[_0x85eb('0x2c')],'resourceId':_0x50e264['id'],'type':_0x5ed98a['name'],'sectionId':_0x5ed98a['id']},{})['then'](function(){return _0x2cf928;});}else{return _0x2cf928;}})[_0x85eb('0x47')](function(_0x249511){logger[_0x85eb('0x2b')](_0x85eb('0x53'),_0x249511);throw _0x249511;});}return _0x2cf928;})[_0x85eb('0x26')](respondWithResult(_0x2c951b,0xc9))['catch'](handleError(_0x2c951b,null));};exports[_0x85eb('0x24')]=function(_0x30062e,_0x270bb2){if(_0x30062e[_0x85eb('0x4c')]['id']){delete _0x30062e[_0x85eb('0x4c')]['id'];}return db['VoiceMail'][_0x85eb('0x4b')]({'where':{'id':_0x30062e['params']['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x270bb2,null))[_0x85eb('0x26')](saveUpdates(_0x30062e['body'],null))[_0x85eb('0x26')](respondWithResult(_0x270bb2,null))[_0x85eb('0x47')](handleError(_0x270bb2,null));};exports[_0x85eb('0x25')]=function(_0x26e04a,_0x214ef7){return db[_0x85eb('0x44')]['find']({'where':{'id':_0x26e04a[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x214ef7,null))[_0x85eb('0x26')](removeEntity(_0x214ef7,null))[_0x85eb('0x47')](handleError(_0x214ef7,null));};exports['getMessages']=function(_0x152452,_0x2a0f8b,_0x4a3af9){return db[_0x85eb('0x44')]['findOne']({'where':{'id':_0x152452[_0x85eb('0x49')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2a0f8b,null))[_0x85eb('0x26')](function(_0x13c0b3){var _0x45a201;var _0x15d4a7={},_0x5a729e={};_0x5a729e[_0x85eb('0x33')]=_[_0x85eb('0x35')](db[_0x85eb('0x54')][_0x85eb('0x30')]);_0x5a729e[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x152452[_0x85eb('0x34')]);_0x5a729e[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],_0x5a729e[_0x85eb('0x34')]);_0x15d4a7['attributes']=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x152452[_0x85eb('0x34')][_0x85eb('0x39')]));_0x15d4a7[_0x85eb('0x38')]=_0x15d4a7['attributes'][_0x85eb('0x3a')]?_0x15d4a7['attributes']:_0x5a729e[_0x85eb('0x33')];if(!_0x152452[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0x15d4a7[_0x85eb('0x1e')]=qs['limit'](_0x152452[_0x85eb('0x34')][_0x85eb('0x1e')]);_0x15d4a7[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x152452[_0x85eb('0x34')][_0x85eb('0x1c')]);}_0x15d4a7[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x152452['query'][_0x85eb('0x3e')]);_0x15d4a7['where']=qs[_0x85eb('0x36')](_[_0x85eb('0x55')](_0x152452[_0x85eb('0x34')],_0x5a729e[_0x85eb('0x36')]));if(_0x152452[_0x85eb('0x34')]['filter']){_0x15d4a7[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'$or':_[_0x85eb('0x2f')](_0x15d4a7[_0x85eb('0x38')],function(_0x419b24){var _0x562ffa={};_0x562ffa[_0x419b24]={'$like':'%'+_0x152452['query'][_0x85eb('0x56')]+'%'};return _0x562ffa;})});}_0x15d4a7['where']=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'mailboxuser':_0x13c0b3[_0x85eb('0x57')]});_0x15d4a7=_[_0x85eb('0x40')]({},_0x15d4a7,_0x152452[_0x85eb('0x4a')]);return db[_0x85eb('0x54')]['findAndCountAll'](_0x15d4a7)[_0x85eb('0x26')](respondWithFilteredResult(_0x2a0f8b,_0x15d4a7));})[_0x85eb('0x47')](handleError(_0x2a0f8b,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 686385c..d43355e 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 _0xd2fa=['rimraf','../../config/environment','exports','mailbox_context','context','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd2fa,0x9f));var _0xad2f=function(_0x153dbf,_0xe57dc){_0x153dbf=_0x153dbf-0x0;var _0x392d8d=_0xd2fa[_0x153dbf];return _0x392d8d;};'use strict';var _=require(_0xad2f('0x0'));var util=require(_0xad2f('0x1'));var logger=require(_0xad2f('0x2'))(_0xad2f('0x3'));var moment=require('moment');var BPromise=require(_0xad2f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad2f('0x5'));var rimraf=require(_0xad2f('0x6'));var config=require(_0xad2f('0x7'));var attributes=require('./voiceMail.attributes');module[_0xad2f('0x8')]=function(_0x62b334,_0x3cc08b){return _0x62b334['define']('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xad2f('0x9'),'fields':['mailbox',_0xad2f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0591=['../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','../../config/logger','moment','bluebird','path'];(function(_0x9f3a63,_0x37619e){var _0x1b2f2a=function(_0x296b49){while(--_0x296b49){_0x9f3a63['push'](_0x9f3a63['shift']());}};_0x1b2f2a(++_0x37619e);}(_0x0591,0x1ab));var _0x1059=function(_0x17e174,_0x4991f8){_0x17e174=_0x17e174-0x0;var _0x3f26f1=_0x0591[_0x17e174];return _0x3f26f1;};'use strict';var _=require(_0x1059('0x0'));var util=require('util');var logger=require(_0x1059('0x1'))('api');var moment=require(_0x1059('0x2'));var BPromise=require(_0x1059('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1059('0x4'));var rimraf=require('rimraf');var config=require(_0x1059('0x5'));var attributes=require(_0x1059('0x6'));module['exports']=function(_0x402711,_0x31eae3){return _0x402711[_0x1059('0x7')](_0x1059('0x8'),attributes,{'tableName':_0x1059('0x9'),'paranoid':![],'indexes':[{'name':_0x1059('0xa'),'fields':[_0x1059('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 93df295..5dd9ccc 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 _0x6a39=['then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\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','client','http'];(function(_0x8bd365,_0x683042){var _0x3b7ea0=function(_0x4405d8){while(--_0x4405d8){_0x8bd365['push'](_0x8bd365['shift']());}};_0x3b7ea0(++_0x683042);}(_0x6a39,0x89));var _0x96a3=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x6a39[_0x261b8a];return _0x3455e8;};'use strict';var _=require(_0x96a3('0x0'));var util=require(_0x96a3('0x1'));var moment=require(_0x96a3('0x2'));var BPromise=require(_0x96a3('0x3'));var rs=require(_0x96a3('0x4'));var fs=require('fs');var Redis=require(_0x96a3('0x5'));var db=require(_0x96a3('0x6'))['db'];var utils=require(_0x96a3('0x7'));var logger=require('../../config/logger')(_0x96a3('0x8'));var config=require(_0x96a3('0x9'));var jayson=require(_0x96a3('0xa'));var client=jayson[_0x96a3('0xb')][_0x96a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x339d56,_0x23bd5a,_0x511b6c){return new BPromise(function(_0x381da4,_0x4cd85e){return client['request'](_0x339d56,_0x511b6c)[_0x96a3('0xd')](function(_0x3f77aa){logger[_0x96a3('0xe')](_0x96a3('0xf'),_0x23bd5a,_0x96a3('0x10'));logger[_0x96a3('0x11')](_0x96a3('0x12'),_0x23bd5a,_0x96a3('0x10'),JSON[_0x96a3('0x13')](_0x3f77aa));if(_0x3f77aa[_0x96a3('0x14')]){if(_0x3f77aa['error'][_0x96a3('0x15')]===0x1f4){logger[_0x96a3('0x14')](_0x96a3('0xf'),_0x23bd5a,_0x3f77aa[_0x96a3('0x14')]['message']);return _0x4cd85e(_0x3f77aa[_0x96a3('0x14')][_0x96a3('0x16')]);}logger[_0x96a3('0x14')](_0x96a3('0xf'),_0x23bd5a,_0x3f77aa[_0x96a3('0x14')][_0x96a3('0x16')]);return _0x381da4(_0x3f77aa[_0x96a3('0x14')][_0x96a3('0x16')]);}else{logger[_0x96a3('0xe')]('VoiceMail,\x20%s,\x20%s',_0x23bd5a,_0x96a3('0x10'));_0x381da4(_0x3f77aa[_0x96a3('0x17')][_0x96a3('0x16')]);}})[_0x96a3('0x18')](function(_0x5afff){logger[_0x96a3('0x14')](_0x96a3('0xf'),_0x23bd5a,_0x5afff);_0x4cd85e(_0x5afff);});});} \ No newline at end of file +var _0xb64f=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0xb64f,0xf6));var _0xfb64=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0xb64f[_0x5bd4f6];return _0x33a165;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfb64('0x0'));var BPromise=require(_0xfb64('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb64('0x2'));var db=require(_0xfb64('0x3'))['db'];var utils=require(_0xfb64('0x4'));var logger=require('../../config/logger')(_0xfb64('0x5'));var config=require('../../config/environment');var jayson=require(_0xfb64('0x6'));var client=jayson[_0xfb64('0x7')][_0xfb64('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33c59f,_0x416f61,_0x3518f0){return new BPromise(function(_0x42cb69,_0x4803fc){return client[_0xfb64('0x9')](_0x33c59f,_0x3518f0)['then'](function(_0x2aecc6){logger[_0xfb64('0xa')](_0xfb64('0xb'),_0x416f61,_0xfb64('0xc'));logger[_0xfb64('0xd')](_0xfb64('0xe'),_0x416f61,_0xfb64('0xc'),JSON[_0xfb64('0xf')](_0x2aecc6));if(_0x2aecc6[_0xfb64('0x10')]){if(_0x2aecc6[_0xfb64('0x10')][_0xfb64('0x11')]===0x1f4){logger[_0xfb64('0x10')](_0xfb64('0xb'),_0x416f61,_0x2aecc6[_0xfb64('0x10')][_0xfb64('0x12')]);return _0x4803fc(_0x2aecc6['error'][_0xfb64('0x12')]);}logger[_0xfb64('0x10')](_0xfb64('0xb'),_0x416f61,_0x2aecc6[_0xfb64('0x10')][_0xfb64('0x12')]);return _0x42cb69(_0x2aecc6[_0xfb64('0x10')][_0xfb64('0x12')]);}else{logger[_0xfb64('0xa')](_0xfb64('0xb'),_0x416f61,_0xfb64('0xc'));_0x42cb69(_0x2aecc6['result'][_0xfb64('0x12')]);}})['catch'](function(_0x3817f8){logger[_0xfb64('0x10')]('VoiceMail,\x20%s,\x20%s',_0x416f61,_0x3817f8);_0x4803fc(_0x3817f8);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 845204f..6349373 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 _0x216d=['post','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x1e99d1,_0x38250c){var _0x3ae329=function(_0x2db617){while(--_0x2db617){_0x1e99d1['push'](_0x1e99d1['shift']());}};_0x3ae329(++_0x38250c);}(_0x216d,0xe9));var _0xd216=function(_0x4bbe5e,_0x3223c4){_0x4bbe5e=_0x4bbe5e-0x0;var _0x1d334a=_0x216d[_0x4bbe5e];return _0x1d334a;};'use strict';var multer=require('multer');var util=require(_0xd216('0x0'));var path=require(_0xd216('0x1'));var timeout=require(_0xd216('0x2'));var express=require(_0xd216('0x3'));var router=express['Router']();var fs_extra=require(_0xd216('0x4'));var auth=require(_0xd216('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd216('0x6'));var controller=require(_0xd216('0x7'));router[_0xd216('0x8')]('/',auth[_0xd216('0x9')](),controller[_0xd216('0xa')]);router[_0xd216('0x8')](_0xd216('0xb'),auth[_0xd216('0x9')](),controller[_0xd216('0xc')]);router['get'](_0xd216('0xd'),auth[_0xd216('0x9')](),controller['download']);router[_0xd216('0xe')]('/',auth[_0xd216('0x9')](),controller['create']);router[_0xd216('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd216('0x10')]);router[_0xd216('0x11')](_0xd216('0xb'),auth[_0xd216('0x9')](),controller[_0xd216('0x12')]);module['exports']=router; \ No newline at end of file +var _0xef54=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','update','delete','multer','path','express'];(function(_0x4329e2,_0x9d649){var _0x2ed317=function(_0x4e521b){while(--_0x4e521b){_0x4329e2['push'](_0x4329e2['shift']());}};_0x2ed317(++_0x9d649);}(_0xef54,0xb1));var _0x4ef5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xef54[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4ef5('0x0'));var util=require('util');var path=require(_0x4ef5('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ef5('0x2'));var router=express[_0x4ef5('0x3')]();var fs_extra=require(_0x4ef5('0x4'));var auth=require(_0x4ef5('0x5'));var interaction=require(_0x4ef5('0x6'));var config=require(_0x4ef5('0x7'));var controller=require(_0x4ef5('0x8'));router[_0x4ef5('0x9')]('/',auth[_0x4ef5('0xa')](),controller[_0x4ef5('0xb')]);router[_0x4ef5('0x9')](_0x4ef5('0xc'),auth[_0x4ef5('0xa')](),controller[_0x4ef5('0xd')]);router['get'](_0x4ef5('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x4ef5('0xf')]('/',auth[_0x4ef5('0xa')](),controller[_0x4ef5('0x10')]);router[_0x4ef5('0x11')](_0x4ef5('0xc'),auth[_0x4ef5('0xa')](),controller[_0x4ef5('0x12')]);router[_0x4ef5('0x13')](_0x4ef5('0xc'),auth[_0x4ef5('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6ece12b..63a9da0 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 _0xee95=['BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','INTEGER','STRING'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0xee95,0x15a));var _0x5ee9=function(_0x3ecae6,_0x3ca416){_0x3ecae6=_0x3ecae6-0x0;var _0x4c5ecb=_0xee95[_0x3ecae6];return _0x4c5ecb;};'use strict';var Sequelize=require(_0x5ee9('0x0'));module[_0x5ee9('0x1')]={'name':{'type':Sequelize[_0x5ee9('0x2')],'get':function(_0x19c175){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x5ee9('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x5ee9('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x5ee9('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5ee9('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x5ee9('0x5')](_0x5ee9('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x5ee9('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5ee9('0x4')],'defaultValue':''},'stamp':{'type':_0x5ee9('0x7'),'defaultValue':Sequelize[_0x5ee9('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xd75e=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','STRING','TIMESTAMP'];(function(_0x424351,_0x156ec0){var _0x26fc2b=function(_0x38743e){while(--_0x38743e){_0x424351['push'](_0x424351['shift']());}};_0x26fc2b(++_0x156ec0);}(_0xd75e,0xb8));var _0xed75=function(_0xa697ee,_0x3f6a82){_0xa697ee=_0xa697ee-0x0;var _0x2c4bd1=_0xd75e[_0xa697ee];return _0x2c4bd1;};'use strict';var Sequelize=require(_0xed75('0x0'));module['exports']={'name':{'type':Sequelize[_0xed75('0x1')],'get':function(_0xbfe18b){return this[_0xed75('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xed75('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xed75('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xed75('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xed75('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xed75('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xed75('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xed75('0x3')],'defaultValue':''},'stamp':{'type':_0xed75('0x4'),'defaultValue':Sequelize[_0xed75('0x5')](_0xed75('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 99f7732..af6ec9a 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 _0x6cf5=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','params','find','create','body','download','recording','Sequelize','ValidationError','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','status','error','stack','name','index','map','rawAttributes','type','model','differenceBy','query','keys'];(function(_0x220964,_0x56e49f){var _0x302cd8=function(_0x517903){while(--_0x517903){_0x220964['push'](_0x220964['shift']());}};_0x302cd8(++_0x56e49f);}(_0x6cf5,0x16d));var _0x56cf=function(_0x1726f5,_0x25534c){_0x1726f5=_0x1726f5-0x0;var _0x5b4e70=_0x6cf5[_0x1726f5];return _0x5b4e70;};'use strict';var emlformat=require(_0x56cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x56cf('0x1'));var jsonpatch=require(_0x56cf('0x2'));var rp=require(_0x56cf('0x3'));var moment=require(_0x56cf('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x56cf('0x5'));var path=require('path');var sox=require(_0x56cf('0x6'));var csv=require(_0x56cf('0x7'));var ejs=require(_0x56cf('0x8'));var fs=require('fs');var fs_extra=require(_0x56cf('0x9'));var _=require('lodash');var squel=require(_0x56cf('0xa'));var crypto=require(_0x56cf('0xb'));var jsforce=require(_0x56cf('0xc'));var deskjs=require(_0x56cf('0xd'));var toCsv=require(_0x56cf('0x7'));var querystring=require(_0x56cf('0xe'));var Papa=require('papaparse');var Redis=require(_0x56cf('0xf'));var authService=require(_0x56cf('0x10'));var qs=require(_0x56cf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x56cf('0x12'))(_0x56cf('0x13'));var utils=require(_0x56cf('0x14'));var config=require(_0x56cf('0x15'));var licenseUtil=require(_0x56cf('0x16'));var db=require(_0x56cf('0x17'))['db'];function respondWithStatusCode(_0x328fa4,_0x54376b){_0x54376b=_0x54376b||0xcc;return function(_0x1001af){if(_0x1001af){return _0x328fa4[_0x56cf('0x18')](_0x54376b);}return _0x328fa4['status'](_0x54376b)[_0x56cf('0x19')]();};}function respondWithResult(_0x4c1770,_0x3c19fd){_0x3c19fd=_0x3c19fd||0xc8;return function(_0x438a7d){if(_0x438a7d){return _0x4c1770['status'](_0x3c19fd)['json'](_0x438a7d);}};}function respondWithFilteredResult(_0x3cf3b4,_0x2b3501){return function(_0x34e472){if(_0x34e472){var _0x30ffe8=typeof _0x2b3501[_0x56cf('0x1a')]===_0x56cf('0x1b')&&typeof _0x2b3501[_0x56cf('0x1c')]===_0x56cf('0x1b');var _0x54f368=_0x34e472['count'];var _0x45d865=_0x30ffe8?0x0:_0x2b3501[_0x56cf('0x1a')];var _0xeb2cf2=_0x30ffe8?_0x34e472[_0x56cf('0x1d')]:_0x2b3501[_0x56cf('0x1a')]+_0x2b3501[_0x56cf('0x1c')];var _0x71ef0e;if(_0xeb2cf2>=_0x54f368){_0xeb2cf2=_0x54f368;_0x71ef0e=0xc8;}else{_0x71ef0e=0xce;}_0x3cf3b4['status'](_0x71ef0e);return _0x3cf3b4[_0x56cf('0x1e')](_0x56cf('0x1f'),_0x45d865+'-'+_0xeb2cf2+'/'+_0x54f368)[_0x56cf('0x20')](_0x34e472);}return null;};}function patchUpdates(_0x42d056){return function(_0x3d29ad){try{jsonpatch['apply'](_0x3d29ad,_0x42d056,!![]);}catch(_0x4402ff){return BPromise[_0x56cf('0x21')](_0x4402ff);}return _0x3d29ad[_0x56cf('0x22')]();};}function saveUpdates(_0x1ff5dc,_0x3770f8){return function(_0x4f35ff){if(_0x4f35ff){return _0x4f35ff[_0x56cf('0x23')](_0x1ff5dc)[_0x56cf('0x24')](function(_0x58ea89){return _0x58ea89;});}return null;};}function removeEntity(_0x49344a,_0x5f2302){return function(_0xa650a8){if(_0xa650a8){return _0xa650a8[_0x56cf('0x25')]()[_0x56cf('0x24')](function(){_0x49344a[_0x56cf('0x26')](0xcc)[_0x56cf('0x19')]();});}};}function handleEntityNotFound(_0x36f464,_0x179e47){return function(_0x3ddf37){if(!_0x3ddf37){_0x36f464[_0x56cf('0x18')](0x194);}return _0x3ddf37;};}function handleError(_0x16e83e,_0x105641){_0x105641=_0x105641||0x1f4;return function(_0x5e3523){logger[_0x56cf('0x27')](_0x5e3523[_0x56cf('0x28')]);if(_0x5e3523[_0x56cf('0x29')]){delete _0x5e3523[_0x56cf('0x29')];}_0x16e83e[_0x56cf('0x26')](_0x105641)['send'](_0x5e3523);};}exports[_0x56cf('0x2a')]=function(_0x12b276,_0x119775){var _0x4da47b={},_0xa723fe={},_0x192896={'count':0x0,'rows':[]};var _0x2986d2=_[_0x56cf('0x2b')](db['VoiceMailMessage'][_0x56cf('0x2c')],function(_0x4c3951){return{'name':_0x4c3951['fieldName'],'type':_0x4c3951[_0x56cf('0x2d')]['key']};});_0xa723fe[_0x56cf('0x2e')]=_[_0x56cf('0x2f')](_[_0x56cf('0x2b')](_0x2986d2,_0x56cf('0x29')),[_0x56cf('0x29')]);_0xa723fe[_0x56cf('0x30')]=_[_0x56cf('0x31')](_0x12b276[_0x56cf('0x30')]);_0xa723fe[_0x56cf('0x32')]=_[_0x56cf('0x33')](_0xa723fe['model'],_0xa723fe[_0x56cf('0x30')]);_0x4da47b[_0x56cf('0x34')]=_[_0x56cf('0x33')](_0xa723fe[_0x56cf('0x2e')],qs[_0x56cf('0x35')](_0x12b276['query'][_0x56cf('0x35')]));_0x4da47b[_0x56cf('0x34')]=_0x4da47b['attributes'][_0x56cf('0x36')]?_0x4da47b[_0x56cf('0x34')]:_0xa723fe['model'];if(!_0x12b276[_0x56cf('0x30')]['hasOwnProperty'](_0x56cf('0x37'))){_0x4da47b[_0x56cf('0x1c')]=qs[_0x56cf('0x1c')](_0x12b276['query']['limit']);_0x4da47b[_0x56cf('0x1a')]=qs[_0x56cf('0x1a')](_0x12b276[_0x56cf('0x30')][_0x56cf('0x1a')]);}_0x4da47b[_0x56cf('0x38')]=qs[_0x56cf('0x39')](_0x12b276[_0x56cf('0x30')][_0x56cf('0x39')]);_0x4da47b[_0x56cf('0x3a')]=qs[_0x56cf('0x32')](_[_0x56cf('0x3b')](_0x12b276[_0x56cf('0x30')],_0xa723fe[_0x56cf('0x32')]),_0x2986d2);if(_0x12b276[_0x56cf('0x30')][_0x56cf('0x3c')]){_0x4da47b[_0x56cf('0x3a')]=_['merge'](_0x4da47b[_0x56cf('0x3a')],{'$or':_[_0x56cf('0x2b')](_0x2986d2,function(_0x16b686){if(_0x16b686[_0x56cf('0x2d')]!==_0x56cf('0x3d')){var _0x12b550={};_0x12b550[_0x16b686[_0x56cf('0x29')]]={'$like':'%'+_0x12b276['query']['filter']+'%'};return _0x12b550;}})});}_0x4da47b=_[_0x56cf('0x3e')]({},_0x4da47b,_0x12b276[_0x56cf('0x3f')]);var _0x372523={'where':_0x4da47b[_0x56cf('0x3a')]};return db[_0x56cf('0x40')][_0x56cf('0x1d')](_0x372523)[_0x56cf('0x24')](function(_0x2efa8f){_0x192896['count']=_0x2efa8f;if(_0x12b276[_0x56cf('0x30')][_0x56cf('0x41')]){_0x4da47b[_0x56cf('0x42')]=[{'all':!![]}];}return db[_0x56cf('0x40')][_0x56cf('0x43')](_0x4da47b);})[_0x56cf('0x24')](function(_0xbfbf06){_0x192896[_0x56cf('0x44')]=_0xbfbf06;return _0x192896;})[_0x56cf('0x24')](respondWithFilteredResult(_0x119775,_0x4da47b))[_0x56cf('0x45')](handleError(_0x119775,null));};exports['show']=function(_0x3c0785,_0x257450){var _0x4b654a={'raw':!![],'where':{'id':_0x3c0785[_0x56cf('0x46')]['id']}},_0x54f11c={};_0x54f11c[_0x56cf('0x2e')]=_[_0x56cf('0x31')](db[_0x56cf('0x40')][_0x56cf('0x2c')]);_0x54f11c[_0x56cf('0x30')]=_[_0x56cf('0x31')](_0x3c0785[_0x56cf('0x30')]);_0x54f11c[_0x56cf('0x32')]=_['intersection'](_0x54f11c[_0x56cf('0x2e')],_0x54f11c['query']);_0x4b654a[_0x56cf('0x34')]=_[_0x56cf('0x33')](_0x54f11c[_0x56cf('0x2e')],qs[_0x56cf('0x35')](_0x3c0785['query'][_0x56cf('0x35')]));_0x4b654a[_0x56cf('0x34')]=_0x4b654a[_0x56cf('0x34')][_0x56cf('0x36')]?_0x4b654a[_0x56cf('0x34')]:_0x54f11c[_0x56cf('0x2e')];if(_0x3c0785[_0x56cf('0x30')]['includeAll']){_0x4b654a['include']=[{'all':!![]}];}_0x4b654a=_[_0x56cf('0x3e')]({},_0x4b654a,_0x3c0785[_0x56cf('0x3f')]);return db[_0x56cf('0x40')][_0x56cf('0x47')](_0x4b654a)[_0x56cf('0x24')](handleEntityNotFound(_0x257450,null))[_0x56cf('0x24')](respondWithResult(_0x257450,null))[_0x56cf('0x45')](handleError(_0x257450,null));};exports[_0x56cf('0x48')]=function(_0x4b49c3,_0x43f4b2){return db['VoiceMailMessage']['create'](_0x4b49c3[_0x56cf('0x49')],{})[_0x56cf('0x24')](respondWithResult(_0x43f4b2,0xc9))[_0x56cf('0x45')](handleError(_0x43f4b2,null));};exports[_0x56cf('0x23')]=function(_0x34120c,_0x5b0164){if(_0x34120c[_0x56cf('0x49')]['id']){delete _0x34120c['body']['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x34120c[_0x56cf('0x46')]['id']}})[_0x56cf('0x24')](handleEntityNotFound(_0x5b0164,null))[_0x56cf('0x24')](saveUpdates(_0x34120c[_0x56cf('0x49')],null))[_0x56cf('0x24')](respondWithResult(_0x5b0164,null))[_0x56cf('0x45')](handleError(_0x5b0164,null));};exports[_0x56cf('0x25')]=function(_0x707db2,_0x132a2e){return db['VoiceMailMessage'][_0x56cf('0x47')]({'where':{'id':_0x707db2[_0x56cf('0x46')]['id']}})['then'](handleEntityNotFound(_0x132a2e,null))[_0x56cf('0x24')](removeEntity(_0x132a2e,null))[_0x56cf('0x45')](handleError(_0x132a2e,null));};exports[_0x56cf('0x4a')]=function(_0x12a338,_0x4e7f9d,_0x50a7a6){return db[_0x56cf('0x40')]['find']({'where':{'id':_0x12a338['params']['id']},'attributes':['id',_0x56cf('0x4b'),'msg_id']})[_0x56cf('0x24')](handleEntityNotFound(_0x4e7f9d,null))[_0x56cf('0x24')](function(_0x158f9d){if(_0x158f9d){if(!_0x158f9d[_0x56cf('0x4b')]){throw new db[(_0x56cf('0x4c'))][(_0x56cf('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x314b30={'Content-Type':'audio/wav','Content-Disposition':_0x56cf('0x4e')};if(_0x158f9d[_0x56cf('0x4f')]){_0x314b30[_0x56cf('0x50')]=_0x56cf('0x51')+_0x158f9d[_0x56cf('0x4f')]+_0x56cf('0x52');}_0x4e7f9d['set'](_0x314b30);return _0x4e7f9d['send'](new Buffer(_0x158f9d['recording']));}})[_0x56cf('0x45')](handleError(_0x4e7f9d,null));}; \ No newline at end of file +var _0xd755=['count','set','apply','reject','save','update','then','error','stack','name','send','index','VoiceMailMessage','fieldName','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x203d73,_0x6bfa0f){var _0x2abb5d=function(_0x4b61c9){while(--_0x4b61c9){_0x203d73['push'](_0x203d73['shift']());}};_0x2abb5d(++_0x6bfa0f);}(_0xd755,0x173));var _0x5d75=function(_0x547fe3,_0x5bbc1a){_0x547fe3=_0x547fe3-0x0;var _0x5391b7=_0xd755[_0x547fe3];return _0x5391b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d75('0x0'));var zipdir=require(_0x5d75('0x1'));var jsonpatch=require(_0x5d75('0x2'));var rp=require(_0x5d75('0x3'));var moment=require(_0x5d75('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5d75('0x5'));var sox=require(_0x5d75('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d75('0x7'));var _=require(_0x5d75('0x8'));var squel=require(_0x5d75('0x9'));var crypto=require(_0x5d75('0xa'));var jsforce=require(_0x5d75('0xb'));var deskjs=require(_0x5d75('0xc'));var toCsv=require(_0x5d75('0xd'));var querystring=require(_0x5d75('0xe'));var Papa=require('papaparse');var Redis=require(_0x5d75('0xf'));var authService=require(_0x5d75('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5d75('0x11'));var hardwareService=require(_0x5d75('0x12'));var logger=require(_0x5d75('0x13'))('api');var utils=require(_0x5d75('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5d75('0x15'))['db'];function respondWithStatusCode(_0x1dc5e1,_0x5c13aa){_0x5c13aa=_0x5c13aa||0xcc;return function(_0x4e73c3){if(_0x4e73c3){return _0x1dc5e1[_0x5d75('0x16')](_0x5c13aa);}return _0x1dc5e1[_0x5d75('0x17')](_0x5c13aa)[_0x5d75('0x18')]();};}function respondWithResult(_0x1334a1,_0x4fd39f){_0x4fd39f=_0x4fd39f||0xc8;return function(_0x5d85ac){if(_0x5d85ac){return _0x1334a1[_0x5d75('0x17')](_0x4fd39f)[_0x5d75('0x19')](_0x5d85ac);}};}function respondWithFilteredResult(_0x6fdd9d,_0x2080c3){return function(_0x3a7556){if(_0x3a7556){var _0x878587=typeof _0x2080c3[_0x5d75('0x1a')]===_0x5d75('0x1b')&&typeof _0x2080c3[_0x5d75('0x1c')]===_0x5d75('0x1b');var _0x1bb0b6=_0x3a7556[_0x5d75('0x1d')];var _0x1a2e7e=_0x878587?0x0:_0x2080c3[_0x5d75('0x1a')];var _0x3eb6b3=_0x878587?_0x3a7556['count']:_0x2080c3['offset']+_0x2080c3[_0x5d75('0x1c')];var _0x13ba22;if(_0x3eb6b3>=_0x1bb0b6){_0x3eb6b3=_0x1bb0b6;_0x13ba22=0xc8;}else{_0x13ba22=0xce;}_0x6fdd9d[_0x5d75('0x17')](_0x13ba22);return _0x6fdd9d[_0x5d75('0x1e')]('Content-Range',_0x1a2e7e+'-'+_0x3eb6b3+'/'+_0x1bb0b6)['json'](_0x3a7556);}return null;};}function patchUpdates(_0x45c685){return function(_0x143c2c){try{jsonpatch[_0x5d75('0x1f')](_0x143c2c,_0x45c685,!![]);}catch(_0x2e7d25){return BPromise[_0x5d75('0x20')](_0x2e7d25);}return _0x143c2c[_0x5d75('0x21')]();};}function saveUpdates(_0x315a9c,_0x26a773){return function(_0x1a3d5e){if(_0x1a3d5e){return _0x1a3d5e[_0x5d75('0x22')](_0x315a9c)['then'](function(_0xb84a51){return _0xb84a51;});}return null;};}function removeEntity(_0xcdf4a0,_0x553f8e){return function(_0xaf283b){if(_0xaf283b){return _0xaf283b['destroy']()[_0x5d75('0x23')](function(){_0xcdf4a0[_0x5d75('0x17')](0xcc)[_0x5d75('0x18')]();});}};}function handleEntityNotFound(_0x14ac2f,_0x2968b0){return function(_0x3ecc5c){if(!_0x3ecc5c){_0x14ac2f[_0x5d75('0x16')](0x194);}return _0x3ecc5c;};}function handleError(_0xc00dec,_0x2f5983){_0x2f5983=_0x2f5983||0x1f4;return function(_0x3845c6){logger[_0x5d75('0x24')](_0x3845c6[_0x5d75('0x25')]);if(_0x3845c6['name']){delete _0x3845c6[_0x5d75('0x26')];}_0xc00dec[_0x5d75('0x17')](_0x2f5983)[_0x5d75('0x27')](_0x3845c6);};}exports[_0x5d75('0x28')]=function(_0x254b2a,_0x4d65d0){var _0x134135={},_0x2c4cf2={},_0x457a32={'count':0x0,'rows':[]};var _0x59a273=_['map'](db[_0x5d75('0x29')]['rawAttributes'],function(_0x2bcfa9){return{'name':_0x2bcfa9[_0x5d75('0x2a')],'type':_0x2bcfa9['type'][_0x5d75('0x2b')]};});_0x2c4cf2[_0x5d75('0x2c')]=_[_0x5d75('0x2d')](_[_0x5d75('0x2e')](_0x59a273,'name'),[_0x5d75('0x26')]);_0x2c4cf2[_0x5d75('0x2f')]=_[_0x5d75('0x30')](_0x254b2a[_0x5d75('0x2f')]);_0x2c4cf2[_0x5d75('0x31')]=_[_0x5d75('0x32')](_0x2c4cf2[_0x5d75('0x2c')],_0x2c4cf2[_0x5d75('0x2f')]);_0x134135[_0x5d75('0x33')]=_[_0x5d75('0x32')](_0x2c4cf2['model'],qs['fields'](_0x254b2a[_0x5d75('0x2f')][_0x5d75('0x34')]));_0x134135[_0x5d75('0x33')]=_0x134135[_0x5d75('0x33')]['length']?_0x134135[_0x5d75('0x33')]:_0x2c4cf2[_0x5d75('0x2c')];if(!_0x254b2a[_0x5d75('0x2f')]['hasOwnProperty'](_0x5d75('0x35'))){_0x134135[_0x5d75('0x1c')]=qs[_0x5d75('0x1c')](_0x254b2a[_0x5d75('0x2f')][_0x5d75('0x1c')]);_0x134135[_0x5d75('0x1a')]=qs[_0x5d75('0x1a')](_0x254b2a[_0x5d75('0x2f')][_0x5d75('0x1a')]);}_0x134135[_0x5d75('0x36')]=qs[_0x5d75('0x37')](_0x254b2a[_0x5d75('0x2f')][_0x5d75('0x37')]);_0x134135[_0x5d75('0x38')]=qs[_0x5d75('0x31')](_['pick'](_0x254b2a[_0x5d75('0x2f')],_0x2c4cf2[_0x5d75('0x31')]),_0x59a273);if(_0x254b2a['query'][_0x5d75('0x39')]){_0x134135[_0x5d75('0x38')]=_[_0x5d75('0x3a')](_0x134135[_0x5d75('0x38')],{'$or':_[_0x5d75('0x2e')](_0x59a273,function(_0x55b627){if(_0x55b627[_0x5d75('0x3b')]!=='VIRTUAL'){var _0x4a1a8b={};_0x4a1a8b[_0x55b627['name']]={'$like':'%'+_0x254b2a[_0x5d75('0x2f')]['filter']+'%'};return _0x4a1a8b;}})});}_0x134135=_[_0x5d75('0x3a')]({},_0x134135,_0x254b2a['options']);var _0x4e6ffa={'where':_0x134135[_0x5d75('0x38')]};return db[_0x5d75('0x29')][_0x5d75('0x1d')](_0x4e6ffa)[_0x5d75('0x23')](function(_0x47aaad){_0x457a32[_0x5d75('0x1d')]=_0x47aaad;if(_0x254b2a[_0x5d75('0x2f')][_0x5d75('0x3c')]){_0x134135[_0x5d75('0x3d')]=[{'all':!![]}];}return db[_0x5d75('0x29')]['findAll'](_0x134135);})[_0x5d75('0x23')](function(_0x1a660f){_0x457a32[_0x5d75('0x3e')]=_0x1a660f;return _0x457a32;})[_0x5d75('0x23')](respondWithFilteredResult(_0x4d65d0,_0x134135))[_0x5d75('0x3f')](handleError(_0x4d65d0,null));};exports[_0x5d75('0x40')]=function(_0x599d32,_0x386bb6){var _0x46f4c2={'raw':!![],'where':{'id':_0x599d32[_0x5d75('0x41')]['id']}},_0xc5b94e={};_0xc5b94e[_0x5d75('0x2c')]=_[_0x5d75('0x30')](db[_0x5d75('0x29')][_0x5d75('0x42')]);_0xc5b94e[_0x5d75('0x2f')]=_[_0x5d75('0x30')](_0x599d32[_0x5d75('0x2f')]);_0xc5b94e[_0x5d75('0x31')]=_[_0x5d75('0x32')](_0xc5b94e['model'],_0xc5b94e[_0x5d75('0x2f')]);_0x46f4c2[_0x5d75('0x33')]=_[_0x5d75('0x32')](_0xc5b94e[_0x5d75('0x2c')],qs[_0x5d75('0x34')](_0x599d32[_0x5d75('0x2f')]['fields']));_0x46f4c2[_0x5d75('0x33')]=_0x46f4c2[_0x5d75('0x33')]['length']?_0x46f4c2[_0x5d75('0x33')]:_0xc5b94e[_0x5d75('0x2c')];if(_0x599d32[_0x5d75('0x2f')]['includeAll']){_0x46f4c2[_0x5d75('0x3d')]=[{'all':!![]}];}_0x46f4c2=_['merge']({},_0x46f4c2,_0x599d32[_0x5d75('0x43')]);return db['VoiceMailMessage'][_0x5d75('0x44')](_0x46f4c2)[_0x5d75('0x23')](handleEntityNotFound(_0x386bb6,null))[_0x5d75('0x23')](respondWithResult(_0x386bb6,null))['catch'](handleError(_0x386bb6,null));};exports[_0x5d75('0x45')]=function(_0x4c34dc,_0x210608){return db[_0x5d75('0x29')][_0x5d75('0x45')](_0x4c34dc['body'],{})[_0x5d75('0x23')](respondWithResult(_0x210608,0xc9))[_0x5d75('0x3f')](handleError(_0x210608,null));};exports[_0x5d75('0x22')]=function(_0x572a26,_0x27261b){if(_0x572a26['body']['id']){delete _0x572a26[_0x5d75('0x46')]['id'];}return db[_0x5d75('0x29')][_0x5d75('0x44')]({'where':{'id':_0x572a26[_0x5d75('0x41')]['id']}})[_0x5d75('0x23')](handleEntityNotFound(_0x27261b,null))['then'](saveUpdates(_0x572a26[_0x5d75('0x46')],null))[_0x5d75('0x23')](respondWithResult(_0x27261b,null))[_0x5d75('0x3f')](handleError(_0x27261b,null));};exports['destroy']=function(_0x58063b,_0x50d032){return db[_0x5d75('0x29')][_0x5d75('0x44')]({'where':{'id':_0x58063b[_0x5d75('0x41')]['id']}})['then'](handleEntityNotFound(_0x50d032,null))[_0x5d75('0x23')](removeEntity(_0x50d032,null))[_0x5d75('0x3f')](handleError(_0x50d032,null));};exports[_0x5d75('0x47')]=function(_0x2b53fd,_0x1c28f7,_0x3d6bf6){return db[_0x5d75('0x29')]['find']({'where':{'id':_0x2b53fd[_0x5d75('0x41')]['id']},'attributes':['id',_0x5d75('0x48'),_0x5d75('0x49')]})[_0x5d75('0x23')](handleEntityNotFound(_0x1c28f7,null))['then'](function(_0x6f2054){if(_0x6f2054){if(!_0x6f2054[_0x5d75('0x48')]){throw new db[(_0x5d75('0x4a'))][(_0x5d75('0x4b'))](_0x5d75('0x4c'));}var _0x5c24d1={'Content-Type':_0x5d75('0x4d'),'Content-Disposition':'attachment'};if(_0x6f2054['msg_id']){_0x5c24d1[_0x5d75('0x4e')]='attachment;\x20filename=\x22'+_0x6f2054[_0x5d75('0x49')]+_0x5d75('0x4f');}_0x1c28f7[_0x5d75('0x1e')](_0x5c24d1);return _0x1c28f7[_0x5d75('0x27')](new Buffer(_0x6f2054['recording']));}})[_0x5d75('0x3f')](handleError(_0x1c28f7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4d585b3..06f1b06 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 _0xd125=['exports','define','voice_voicemail_messages','dir','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x336482,_0x3ff01e){var _0x1e9d51=function(_0x1e33d4){while(--_0x1e33d4){_0x336482['push'](_0x336482['shift']());}};_0x1e9d51(++_0x3ff01e);}(_0xd125,0x16f));var _0x5d12=function(_0x67b5,_0x107299){_0x67b5=_0x67b5-0x0;var _0x13897f=_0xd125[_0x67b5];return _0x13897f;};'use strict';var _=require(_0x5d12('0x0'));var util=require('util');var logger=require(_0x5d12('0x1'))('api');var moment=require(_0x5d12('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d12('0x3'));var fs=require('fs');var path=require(_0x5d12('0x4'));var rimraf=require(_0x5d12('0x5'));var config=require(_0x5d12('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x5d12('0x7')]=function(_0x5ef07e,_0x5b566c){return _0x5ef07e[_0x5d12('0x8')]('VoiceMailMessage',attributes,{'tableName':_0x5d12('0x9'),'paranoid':![],'indexes':[{'name':_0x5d12('0xa'),'fields':[_0x5d12('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x207c=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir'];(function(_0xeb1452,_0x1bff5b){var _0x1ed85b=function(_0x49c11a){while(--_0x49c11a){_0xeb1452['push'](_0xeb1452['shift']());}};_0x1ed85b(++_0x1bff5b);}(_0x207c,0x70));var _0xc207=function(_0x41c66d,_0x512755){_0x41c66d=_0x41c66d-0x0;var _0x4b3302=_0x207c[_0x41c66d];return _0x4b3302;};'use strict';var _=require(_0xc207('0x0'));var util=require('util');var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var BPromise=require(_0xc207('0x4'));var rp=require(_0xc207('0x5'));var fs=require('fs');var path=require(_0xc207('0x6'));var rimraf=require(_0xc207('0x7'));var config=require(_0xc207('0x8'));var attributes=require(_0xc207('0x9'));module[_0xc207('0xa')]=function(_0x4b0f9d,_0x598e73){return _0x4b0f9d[_0xc207('0xb')]('VoiceMailMessage',attributes,{'tableName':_0xc207('0xc'),'paranoid':![],'indexes':[{'name':_0xc207('0xd'),'fields':[_0xc207('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5a83d3c..01d2dc7 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 _0x44c0=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','info','result','lodash'];(function(_0x3b9e09,_0x3d3a30){var _0x196791=function(_0xf7b193){while(--_0xf7b193){_0x3b9e09['push'](_0x3b9e09['shift']());}};_0x196791(++_0x3d3a30);}(_0x44c0,0x133));var _0x044c=function(_0x38904e,_0x2b471f){_0x38904e=_0x38904e-0x0;var _0x5d8f00=_0x44c0[_0x38904e];return _0x5d8f00;};'use strict';var _=require(_0x044c('0x0'));var util=require(_0x044c('0x1'));var moment=require(_0x044c('0x2'));var BPromise=require(_0x044c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x044c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x044c('0x5'));var logger=require('../../config/logger')(_0x044c('0x6'));var config=require(_0x044c('0x7'));var jayson=require(_0x044c('0x8'));var client=jayson[_0x044c('0x9')][_0x044c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ce0cd,_0xa351b8,_0x1866b4){return new BPromise(function(_0x155cb9,_0x16a879){return client[_0x044c('0xb')](_0x3ce0cd,_0x1866b4)[_0x044c('0xc')](function(_0x350042){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0xa351b8,_0x044c('0xd'));logger[_0x044c('0xe')](_0x044c('0xf'),_0xa351b8,_0x044c('0xd'),JSON[_0x044c('0x10')](_0x350042));if(_0x350042[_0x044c('0x11')]){if(_0x350042[_0x044c('0x11')]['code']===0x1f4){logger[_0x044c('0x11')](_0x044c('0x12'),_0xa351b8,_0x350042[_0x044c('0x11')]['message']);return _0x16a879(_0x350042['error'][_0x044c('0x13')]);}logger[_0x044c('0x11')](_0x044c('0x12'),_0xa351b8,_0x350042[_0x044c('0x11')][_0x044c('0x13')]);return _0x155cb9(_0x350042['error'][_0x044c('0x13')]);}else{logger[_0x044c('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0xa351b8,_0x044c('0xd'));_0x155cb9(_0x350042[_0x044c('0x15')][_0x044c('0x13')]);}})['catch'](function(_0x285de3){logger[_0x044c('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0xa351b8,_0x285de3);_0x16a879(_0x285de3);});});} \ No newline at end of file +var _0x251c=['../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3450f2,_0x456752){var _0xf77fab=function(_0x29ab12){while(--_0x29ab12){_0x3450f2['push'](_0x3450f2['shift']());}};_0xf77fab(++_0x456752);}(_0x251c,0x1c4));var _0xc251=function(_0x223d2d,_0x5444ab){_0x223d2d=_0x223d2d-0x0;var _0x27ae70=_0x251c[_0x223d2d];return _0x27ae70;};'use strict';var _=require(_0xc251('0x0'));var util=require(_0xc251('0x1'));var moment=require(_0xc251('0x2'));var BPromise=require(_0xc251('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc251('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc251('0x5'));var logger=require(_0xc251('0x6'))(_0xc251('0x7'));var config=require(_0xc251('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc251('0x9')][_0xc251('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cae2a,_0x3b1206,_0xffb493){return new BPromise(function(_0x5c69f8,_0xb92566){return client[_0xc251('0xb')](_0x5cae2a,_0xffb493)[_0xc251('0xc')](function(_0x2b22d6){logger[_0xc251('0xd')](_0xc251('0xe'),_0x3b1206,'request\x20sent');logger[_0xc251('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3b1206,_0xc251('0x10'),JSON[_0xc251('0x11')](_0x2b22d6));if(_0x2b22d6[_0xc251('0x12')]){if(_0x2b22d6['error']['code']===0x1f4){logger[_0xc251('0x12')](_0xc251('0xe'),_0x3b1206,_0x2b22d6[_0xc251('0x12')][_0xc251('0x13')]);return _0xb92566(_0x2b22d6[_0xc251('0x12')][_0xc251('0x13')]);}logger[_0xc251('0x12')](_0xc251('0xe'),_0x3b1206,_0x2b22d6[_0xc251('0x12')]['message']);return _0x5c69f8(_0x2b22d6['error'][_0xc251('0x13')]);}else{logger[_0xc251('0xd')](_0xc251('0xe'),_0x3b1206,'request\x20sent');_0x5c69f8(_0x2b22d6['result'][_0xc251('0x13')]);}})['catch'](function(_0x2df64b){logger[_0xc251('0x12')](_0xc251('0xe'),_0x3b1206,_0x2df64b);_0xb92566(_0x2df64b);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 258bf0d..e932b05 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 _0xd994=['addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/sounds','getSounds','post','create'];(function(_0x7511d4,_0x396c45){var _0x47c58d=function(_0x224b37){while(--_0x224b37){_0x7511d4['push'](_0x7511d4['shift']());}};_0x47c58d(++_0x396c45);}(_0xd994,0x98));var _0x4d99=function(_0x4fdd08,_0x28c946){_0x4fdd08=_0x4fdd08-0x0;var _0x4f968f=_0xd994[_0x4fdd08];return _0x4f968f;};'use strict';var multer=require(_0x4d99('0x0'));var util=require(_0x4d99('0x1'));var path=require(_0x4d99('0x2'));var timeout=require(_0x4d99('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4d99('0x4'));var interaction=require(_0x4d99('0x5'));var config=require(_0x4d99('0x6'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x4d99('0x7')](),controller[_0x4d99('0x8')]);router[_0x4d99('0x9')](_0x4d99('0xa'),auth[_0x4d99('0x7')](),controller[_0x4d99('0xb')]);router[_0x4d99('0x9')](_0x4d99('0xc'),auth[_0x4d99('0x7')](),controller[_0x4d99('0xd')]);router[_0x4d99('0xe')]('/',auth[_0x4d99('0x7')](),controller[_0x4d99('0xf')]);router[_0x4d99('0xe')](_0x4d99('0xc'),auth['isAuthenticated'](),controller[_0x4d99('0x10')]);router[_0x4d99('0x11')](_0x4d99('0xa'),auth[_0x4d99('0x7')](),controller[_0x4d99('0x12')]);router[_0x4d99('0x13')](_0x4d99('0xa'),auth[_0x4d99('0x7')](),controller[_0x4d99('0x14')]);router['delete'](_0x4d99('0x15'),auth['isAuthenticated'](),controller[_0x4d99('0x16')]);module[_0x4d99('0x17')]=router; \ No newline at end of file +var _0xee95=['get','index','/:id','isAuthenticated','/:id/sounds','create','addSound','update','destroy','/:id/sounds/:id2','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller'];(function(_0x5ba8fc,_0x3120dd){var _0x974890=function(_0x4ec53d){while(--_0x4ec53d){_0x5ba8fc['push'](_0x5ba8fc['shift']());}};_0x974890(++_0x3120dd);}(_0xee95,0x6a));var _0x5ee9=function(_0x517cfa,_0x3da5e3){_0x517cfa=_0x517cfa-0x0;var _0x2bfeb1=_0xee95[_0x517cfa];return _0x2bfeb1;};'use strict';var multer=require(_0x5ee9('0x0'));var util=require(_0x5ee9('0x1'));var path=require(_0x5ee9('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ee9('0x3'));var router=express[_0x5ee9('0x4')]();var fs_extra=require(_0x5ee9('0x5'));var auth=require(_0x5ee9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5ee9('0x7'));router[_0x5ee9('0x8')]('/',auth['isAuthenticated'](),controller[_0x5ee9('0x9')]);router[_0x5ee9('0x8')](_0x5ee9('0xa'),auth[_0x5ee9('0xb')](),controller['show']);router['get'](_0x5ee9('0xc'),auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth[_0x5ee9('0xb')](),controller[_0x5ee9('0xd')]);router['post'](_0x5ee9('0xc'),auth['isAuthenticated'](),controller[_0x5ee9('0xe')]);router['put'](_0x5ee9('0xa'),auth[_0x5ee9('0xb')](),controller[_0x5ee9('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5ee9('0x10')]);router['delete'](_0x5ee9('0x11'),auth[_0x5ee9('0xb')](),controller['removeSound']);module[_0x5ee9('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 f09652e..9df9683 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 _0xa818=['files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x53c429,_0x548250){var _0x2f1a48=function(_0x5d97cd){while(--_0x5d97cd){_0x53c429['push'](_0x53c429['shift']());}};_0x2f1a48(++_0x548250);}(_0xa818,0x100));var _0x8a81=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xa818[_0x533e4e];return _0x1f14bb;};'use strict';var Sequelize=require(_0x8a81('0x0'));module[_0x8a81('0x1')]={'name':{'type':Sequelize[_0x8a81('0x2')],'allowNull':![],'unique':_0x8a81('0x3')},'mode':{'type':Sequelize[_0x8a81('0x4')](_0x8a81('0x5'),'files',_0x8a81('0x6'),_0x8a81('0x7'),_0x8a81('0x8'),_0x8a81('0x9')),'allowNull':!![],'defaultValue':_0x8a81('0xa')},'directory':{'type':Sequelize[_0x8a81('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x8a81('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8a81('0x2')],'allowNull':!![],'defaultValue':_0x8a81('0xb')},'format':{'type':Sequelize[_0x8a81('0x2')],'allowNull':!![]},'stamp':{'type':_0x8a81('0xc')},'defaultEntry':{'type':Sequelize[_0x8a81('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2357=['mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files'];(function(_0x262d20,_0x33baf4){var _0x5c085b=function(_0x79c4d5){while(--_0x79c4d5){_0x262d20['push'](_0x262d20['shift']());}};_0x5c085b(++_0x33baf4);}(_0x2357,0x1b3));var _0x7235=function(_0x106d83,_0x21bc8d){_0x106d83=_0x106d83-0x0;var _0x515d6a=_0x2357[_0x106d83];return _0x515d6a;};'use strict';var Sequelize=require(_0x7235('0x0'));module[_0x7235('0x1')]={'name':{'type':Sequelize[_0x7235('0x2')],'allowNull':![],'unique':_0x7235('0x3')},'mode':{'type':Sequelize[_0x7235('0x4')](_0x7235('0x5'),_0x7235('0x6'),_0x7235('0x7'),_0x7235('0x8'),'quietmp3',_0x7235('0x9')),'allowNull':!![],'defaultValue':_0x7235('0x6')},'directory':{'type':Sequelize[_0x7235('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x7235('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7235('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x7235('0x2')],'allowNull':!![],'defaultValue':_0x7235('0xa')},'format':{'type':Sequelize[_0x7235('0x2')],'allowNull':!![]},'stamp':{'type':_0x7235('0xb')},'defaultEntry':{'type':Sequelize[_0x7235('0xc')],'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 95ebe5f..93db5c9 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 _0x01f5=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','sequelize','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','transaction','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','Sound','id2','getSounds','order','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x01f5,0x145));var _0x501f=function(_0x5e5361,_0x3f9c74){_0x5e5361=_0x5e5361-0x0;var _0xa185c1=_0x01f5[_0x5e5361];return _0xa185c1;};'use strict';var emlformat=require(_0x501f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x501f('0x1'));var jsonpatch=require(_0x501f('0x2'));var rp=require(_0x501f('0x3'));var moment=require(_0x501f('0x4'));var BPromise=require(_0x501f('0x5'));var Mustache=require(_0x501f('0x6'));var util=require(_0x501f('0x7'));var path=require('path');var sox=require(_0x501f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x501f('0x9'));var _=require(_0x501f('0xa'));var squel=require(_0x501f('0xb'));var crypto=require('crypto');var jsforce=require(_0x501f('0xc'));var deskjs=require(_0x501f('0xd'));var toCsv=require(_0x501f('0xe'));var querystring=require(_0x501f('0xf'));var Papa=require(_0x501f('0x10'));var Redis=require(_0x501f('0x11'));var authService=require(_0x501f('0x12'));var qs=require(_0x501f('0x13'));var as=require(_0x501f('0x14'));var hardwareService=require(_0x501f('0x15'));var logger=require(_0x501f('0x16'))(_0x501f('0x17'));var utils=require(_0x501f('0x18'));var config=require(_0x501f('0x19'));var licenseUtil=require(_0x501f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49f36c,_0x53b34e){_0x53b34e=_0x53b34e||0xcc;return function(_0x2f2a86){if(_0x2f2a86){return _0x49f36c[_0x501f('0x1b')](_0x53b34e);}return _0x49f36c[_0x501f('0x1c')](_0x53b34e)['end']();};}function respondWithResult(_0x29cf0c,_0x6f20a5){_0x6f20a5=_0x6f20a5||0xc8;return function(_0x174854){if(_0x174854){return _0x29cf0c['status'](_0x6f20a5)[_0x501f('0x1d')](_0x174854);}};}function respondWithFilteredResult(_0x31cb32,_0x26a61a){return function(_0x1bbcd6){if(_0x1bbcd6){var _0x5261fc=typeof _0x26a61a['offset']===_0x501f('0x1e')&&typeof _0x26a61a[_0x501f('0x1f')]===_0x501f('0x1e');var _0x336ea4=_0x1bbcd6[_0x501f('0x20')];var _0x226087=_0x5261fc?0x0:_0x26a61a[_0x501f('0x21')];var _0xe8c61b=_0x5261fc?_0x1bbcd6['count']:_0x26a61a['offset']+_0x26a61a[_0x501f('0x1f')];var _0x394f5c;if(_0xe8c61b>=_0x336ea4){_0xe8c61b=_0x336ea4;_0x394f5c=0xc8;}else{_0x394f5c=0xce;}_0x31cb32[_0x501f('0x1c')](_0x394f5c);return _0x31cb32[_0x501f('0x22')](_0x501f('0x23'),_0x226087+'-'+_0xe8c61b+'/'+_0x336ea4)[_0x501f('0x1d')](_0x1bbcd6);}return null;};}function patchUpdates(_0x9878cd){return function(_0x53179e){try{jsonpatch['apply'](_0x53179e,_0x9878cd,!![]);}catch(_0x2384cd){return BPromise['reject'](_0x2384cd);}return _0x53179e['save']();};}function saveUpdates(_0x3b1deb,_0x3a0bca){return function(_0x4eebbb){if(_0x4eebbb){return _0x4eebbb[_0x501f('0x24')](_0x3b1deb)[_0x501f('0x25')](function(_0x498dcb){return _0x498dcb;});}return null;};}function removeEntity(_0x834af8,_0x46546f){return function(_0x54a4b9){if(_0x54a4b9){return _0x54a4b9['destroy']()[_0x501f('0x25')](function(){var _0x541179=_0x54a4b9[_0x501f('0x26')]({'plain':!![]});var _0xcd9eab=_0x501f('0x27');return db[_0x501f('0x28')]['destroy']({'where':{'type':_0xcd9eab,'resourceId':_0x541179['id']}})['then'](function(){return _0x54a4b9;});})[_0x501f('0x25')](function(){_0x834af8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a213f,_0x8a80bc){return function(_0x522bf2){if(!_0x522bf2){_0x5a213f[_0x501f('0x1b')](0x194);}return _0x522bf2;};}function handleError(_0xe895cc,_0x1d6441){_0x1d6441=_0x1d6441||0x1f4;return function(_0x436673){logger[_0x501f('0x29')](_0x436673[_0x501f('0x2a')]);if(_0x436673[_0x501f('0x2b')]){delete _0x436673[_0x501f('0x2b')];}_0xe895cc[_0x501f('0x1c')](_0x1d6441)[_0x501f('0x2c')](_0x436673);};}exports[_0x501f('0x2d')]=function(_0xe2ca20,_0x2a2817){var _0x45c446={},_0x30ec38={},_0x2eb10e={'count':0x0,'rows':[]};var _0x594a9c=_[_0x501f('0x2e')](db[_0x501f('0x2f')]['rawAttributes'],function(_0x3f59d2){return{'name':_0x3f59d2[_0x501f('0x30')],'type':_0x3f59d2[_0x501f('0x31')][_0x501f('0x32')]};});_0x30ec38[_0x501f('0x33')]=_['map'](_0x594a9c,'name');_0x30ec38['query']=_['keys'](_0xe2ca20[_0x501f('0x34')]);_0x30ec38[_0x501f('0x35')]=_[_0x501f('0x36')](_0x30ec38[_0x501f('0x33')],_0x30ec38['query']);_0x45c446['attributes']=_[_0x501f('0x36')](_0x30ec38[_0x501f('0x33')],qs[_0x501f('0x37')](_0xe2ca20[_0x501f('0x34')]['fields']));_0x45c446[_0x501f('0x38')]=_0x45c446[_0x501f('0x38')][_0x501f('0x39')]?_0x45c446[_0x501f('0x38')]:_0x30ec38[_0x501f('0x33')];if(!_0xe2ca20[_0x501f('0x34')][_0x501f('0x3a')](_0x501f('0x3b'))){_0x45c446['limit']=qs[_0x501f('0x1f')](_0xe2ca20[_0x501f('0x34')][_0x501f('0x1f')]);_0x45c446[_0x501f('0x21')]=qs['offset'](_0xe2ca20[_0x501f('0x34')][_0x501f('0x21')]);}_0x45c446['order']=qs[_0x501f('0x3c')](_0xe2ca20['query'][_0x501f('0x3c')]);delete _0xe2ca20[_0x501f('0x34')]['sort'];_0x45c446['where']=qs[_0x501f('0x35')](_['pick'](_0xe2ca20[_0x501f('0x34')],_0x30ec38['filters']),_0x594a9c);if(_0xe2ca20[_0x501f('0x34')][_0x501f('0x3d')]){_0x45c446[_0x501f('0x3e')]=_[_0x501f('0x3f')](_0x45c446[_0x501f('0x3e')],{'$or':_[_0x501f('0x2e')](_0x594a9c,function(_0x204885){if(_0x204885[_0x501f('0x31')]!=='VIRTUAL'){var _0x419958={};_0x419958[_0x204885[_0x501f('0x2b')]]={'$like':'%'+_0xe2ca20['query'][_0x501f('0x3d')]+'%'};return _0x419958;}})});}_0x45c446=_['merge']({},_0x45c446,_0xe2ca20[_0x501f('0x40')]);var _0x11d86c={'where':_0x45c446[_0x501f('0x3e')]};return db[_0x501f('0x2f')][_0x501f('0x20')](_0x11d86c)[_0x501f('0x25')](function(_0x5363de){_0x2eb10e[_0x501f('0x20')]=_0x5363de;if(_0xe2ca20['query'][_0x501f('0x41')]){_0x45c446[_0x501f('0x42')]=[{'all':!![]}];}return db[_0x501f('0x2f')][_0x501f('0x43')](_0x45c446);})[_0x501f('0x25')](function(_0x6758f3){_0x2eb10e[_0x501f('0x44')]=_0x6758f3;return _0x2eb10e;})['then'](respondWithFilteredResult(_0x2a2817,_0x45c446))[_0x501f('0x45')](handleError(_0x2a2817,null));};exports[_0x501f('0x46')]=function(_0x156db,_0x58f294){var _0x5f12ed={'raw':![],'where':{'id':_0x156db[_0x501f('0x47')]['id']}},_0x3e7bb3={};_0x3e7bb3[_0x501f('0x33')]=_[_0x501f('0x48')](db[_0x501f('0x2f')]['rawAttributes']);_0x3e7bb3['query']=_[_0x501f('0x48')](_0x156db['query']);_0x3e7bb3['filters']=_[_0x501f('0x36')](_0x3e7bb3[_0x501f('0x33')],_0x3e7bb3['query']);_0x5f12ed[_0x501f('0x38')]=_[_0x501f('0x36')](_0x3e7bb3[_0x501f('0x33')],qs[_0x501f('0x37')](_0x156db[_0x501f('0x34')]['fields']));_0x5f12ed[_0x501f('0x38')]=_0x5f12ed[_0x501f('0x38')][_0x501f('0x39')]?_0x5f12ed[_0x501f('0x38')]:_0x3e7bb3[_0x501f('0x33')];if(_0x156db['query']['includeAll']){_0x5f12ed[_0x501f('0x42')]=[{'all':!![]}];}_0x5f12ed=_[_0x501f('0x3f')]({},_0x5f12ed,_0x156db[_0x501f('0x40')]);return db[_0x501f('0x2f')][_0x501f('0x49')](_0x5f12ed)[_0x501f('0x25')](handleEntityNotFound(_0x58f294,null))['then'](respondWithResult(_0x58f294,null))[_0x501f('0x45')](handleError(_0x58f294,null));};exports[_0x501f('0x24')]=function(_0xf318ba,_0x7580be){if(_0xf318ba[_0x501f('0x4a')]['id']){delete _0xf318ba[_0x501f('0x4a')]['id'];}return db[_0x501f('0x2f')][_0x501f('0x49')]({'where':{'id':_0xf318ba[_0x501f('0x47')]['id']}})[_0x501f('0x25')](handleEntityNotFound(_0x7580be,null))[_0x501f('0x25')](saveUpdates(_0xf318ba['body'],null))[_0x501f('0x25')](respondWithResult(_0x7580be,null))[_0x501f('0x45')](handleError(_0x7580be,null));};exports[_0x501f('0x4b')]=function(_0x31ab50,_0x15f200,_0x328fc7){return db[_0x501f('0x4c')]['transaction'](function(_0x596633){if(_0x31ab50[_0x501f('0x4a')][_0x501f('0x4d')]===_0x501f('0x4e')){_0x31ab50[_0x501f('0x4a')][_0x501f('0x4f')]=path[_0x501f('0x50')](config['root'],_0x501f('0x51'),_0x31ab50[_0x501f('0x4a')][_0x501f('0x2b')]);}return db[_0x501f('0x2f')][_0x501f('0x4b')](_0x31ab50[_0x501f('0x4a')],{'transaction':_0x596633})[_0x501f('0x25')](function(_0xaa7b53){if(_0x31ab50[_0x501f('0x4a')][_0x501f('0x4d')]==='files'){fs[_0x501f('0x52')](_0xaa7b53[_0x501f('0x4f')],parseInt(_0x501f('0x53'),0x8));}var _0x1e9ee6=_0x31ab50[_0x501f('0x54')][_0x501f('0x26')]({'plain':!![]});if(!_0x1e9ee6)throw new Error(_0x501f('0x55'));if(_0x1e9ee6[_0x501f('0x56')]===_0x501f('0x54')){var _0x1add7f=_0xaa7b53[_0x501f('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x1e9ee6[_0x501f('0x57')]},'raw':!![]})['then'](function(_0x271615){if(_0x271615&&_0x271615[_0x501f('0x58')]===0x0){return db[_0x501f('0x28')][_0x501f('0x4b')]({'name':_0x1add7f[_0x501f('0x2b')],'resourceId':_0x1add7f['id'],'type':_0x271615[_0x501f('0x2b')],'sectionId':_0x271615['id']},{})[_0x501f('0x25')](function(){return _0xaa7b53;});}else{return _0xaa7b53;}})[_0x501f('0x45')](function(_0x632fc1){logger[_0x501f('0x29')](_0x501f('0x59'),_0x632fc1);});}return _0xaa7b53;});})[_0x501f('0x25')](respondWithResult(_0x15f200,0xc9))[_0x501f('0x45')](handleError(_0x15f200,null));};exports['destroy']=function(_0x1aac36,_0x13ade0,_0xdbde3d){var _0x134017;return db[_0x501f('0x2f')][_0x501f('0x49')]({'where':{'id':_0x1aac36['params']['id']}})[_0x501f('0x25')](function(_0x1c3d4d){if(_0x1c3d4d){return db[_0x501f('0x4c')]['transaction'](function(_0x3961a3){return _0x1c3d4d['destroy']({'transaction':_0x3961a3,'raw':!![]})['then'](function(_0x14e519){if(_0x14e519[_0x501f('0x4f')]){fs[_0x501f('0x5a')](_0x14e519['directory'])['forEach'](function(_0x2fdf1c){fs[_0x501f('0x5b')](path[_0x501f('0x50')](_0x14e519[_0x501f('0x4f')],_0x2fdf1c));});fs[_0x501f('0x5c')](_0x14e519['directory']);}return _0x14e519;});})[_0x501f('0x45')](function(_0x415aab){throw new db[(_0x501f('0x5d'))][(_0x501f('0x5e'))](_0x415aab[_0x501f('0x5f')]);});}})['then'](handleEntityNotFound(_0x13ade0,null))[_0x501f('0x25')](removeEntity(_0x13ade0,null))[_0x501f('0x45')](handleError(_0x13ade0,null));};exports[_0x501f('0x60')]=function(_0x104355,_0x338597,_0xd9744){return db['sequelize'][_0x501f('0x61')](function(_0x1be0ae){var _0x4ccc97;return db[_0x501f('0x2f')][_0x501f('0x49')]({'where':{'id':_0x104355[_0x501f('0x47')]['id']}})['then'](function(_0x32a420){if(_0x32a420){_0x4ccc97=_0x32a420;return _0x32a420[_0x501f('0x60')](_0x104355[_0x501f('0x4a')]['id'],{'transaction':_0x1be0ae});}})[_0x501f('0x25')](function(_0x49351f){if(_0x49351f){return db['Sound'][_0x501f('0x62')]({'where':{'id':_0x104355['body']['id']},'attributes':['id',_0x501f('0x2b'),_0x501f('0x63'),_0x501f('0x64'),_0x501f('0x65')],'raw':!![]});}})['then'](function(_0x3d39ba){if(_0x3d39ba){var _0xa88513=path[_0x501f('0x50')](config[_0x501f('0x66')],_0x501f('0x67'),util[_0x501f('0x68')](_0x501f('0x69'),path[_0x501f('0x6a')](_0x3d39ba[_0x501f('0x63')],path[_0x501f('0x6b')](_0x3d39ba[_0x501f('0x63')])),_0x3d39ba[_0x501f('0x64')]));var _0x2a877d=path[_0x501f('0x50')](config[_0x501f('0x66')],_0x501f('0x51'),_0x4ccc97[_0x501f('0x2b')],util[_0x501f('0x68')](_0x501f('0x69'),_0x3d39ba[_0x501f('0x2b')],_0x3d39ba['converted_format']));fs[_0x501f('0x6c')](_0xa88513,_0x2a877d);return _0x3d39ba;}})[_0x501f('0x45')](function(_0x17640a){throw new db[(_0x501f('0x5d'))]['ValidationError'](_0x17640a[_0x501f('0x5f')]);});})[_0x501f('0x25')](handleEntityNotFound(_0x338597,null))[_0x501f('0x25')](respondWithResult(_0x338597,0xc9))[_0x501f('0x45')](handleError(_0x338597,null));};exports[_0x501f('0x6d')]=function(_0x2c9bea,_0x4ff2be,_0x48dbd0){return db['sequelize'][_0x501f('0x61')](function(_0x325f3f){var _0x31cffd;return db[_0x501f('0x2f')][_0x501f('0x62')]({'where':{'id':_0x2c9bea[_0x501f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ff2be,null))['then'](function(_0x438d1e){if(_0x438d1e){_0x31cffd=_0x438d1e;return _0x438d1e[_0x501f('0x6d')](_0x2c9bea['params']['id2']);}})[_0x501f('0x25')](function(_0x31989a){if(_0x31989a){return db[_0x501f('0x6e')][_0x501f('0x62')]({'where':{'id':_0x2c9bea['params'][_0x501f('0x6f')]},'attributes':['id',_0x501f('0x2b'),'save_name',_0x501f('0x64'),'createdAt'],'raw':!![]});}})['then'](function(_0xe67eb4){if(_0xe67eb4){fs[_0x501f('0x5b')](path[_0x501f('0x50')](_0x31cffd[_0x501f('0x4f')],util['format']('%s.%s',_0xe67eb4[_0x501f('0x2b')],_0xe67eb4[_0x501f('0x64')])));return _0xe67eb4;}})['catch'](function(_0x493c87){throw new db[(_0x501f('0x5d'))][(_0x501f('0x5e'))](_0x493c87['message']);});})[_0x501f('0x25')](handleEntityNotFound(_0x4ff2be,null))[_0x501f('0x25')](respondWithStatusCode(_0x4ff2be,0xcc))[_0x501f('0x45')](handleError(_0x4ff2be,null));};exports[_0x501f('0x70')]=function(_0x10395d,_0x21878f,_0x428b59){var _0x278a36={};var _0x2aef29={};var _0x5c80a0;var _0x1830d4;return db[_0x501f('0x2f')][_0x501f('0x62')]({'where':{'id':_0x10395d[_0x501f('0x47')]['id']}})[_0x501f('0x25')](handleEntityNotFound(_0x21878f,null))[_0x501f('0x25')](function(_0x5debad){if(_0x5debad){_0x5c80a0=_0x5debad;_0x2aef29[_0x501f('0x33')]=_['keys'](db[_0x501f('0x6e')]['rawAttributes']);_0x2aef29['query']=_[_0x501f('0x48')](_0x10395d[_0x501f('0x34')]);_0x2aef29[_0x501f('0x35')]=_['intersection'](_0x2aef29['model'],_0x2aef29[_0x501f('0x34')]);_0x278a36[_0x501f('0x38')]=_[_0x501f('0x36')](_0x2aef29['model'],qs['fields'](_0x10395d[_0x501f('0x34')][_0x501f('0x37')]));_0x278a36['attributes']=_0x278a36['attributes'][_0x501f('0x39')]?_0x278a36['attributes']:_0x2aef29[_0x501f('0x33')];_0x278a36[_0x501f('0x71')]=qs[_0x501f('0x3c')](_0x10395d['query']['sort']);_0x278a36['where']=qs[_0x501f('0x35')](_[_0x501f('0x72')](_0x10395d['query'],_0x2aef29[_0x501f('0x35')]));if(_0x10395d['query'][_0x501f('0x3d')]){_0x278a36[_0x501f('0x3e')]=_[_0x501f('0x3f')](_0x278a36['where'],{'$or':_[_0x501f('0x2e')](_0x278a36[_0x501f('0x38')],function(_0x1ee3b1){var _0x183c50={};_0x183c50[_0x1ee3b1]={'$like':'%'+_0x10395d[_0x501f('0x34')][_0x501f('0x3d')]+'%'};return _0x183c50;})});}_0x278a36=_[_0x501f('0x3f')]({},_0x278a36,_0x10395d[_0x501f('0x40')]);return _0x5c80a0['getSounds'](_0x278a36);}})['then'](function(_0x37841f){if(_0x37841f){_0x1830d4=_0x37841f[_0x501f('0x39')];if(!_0x10395d[_0x501f('0x34')][_0x501f('0x3a')](_0x501f('0x3b'))){_0x278a36[_0x501f('0x1f')]=qs['limit'](_0x10395d[_0x501f('0x34')][_0x501f('0x1f')]);_0x278a36['offset']=qs[_0x501f('0x21')](_0x10395d[_0x501f('0x34')][_0x501f('0x21')]);}return _0x5c80a0['getSounds'](_0x278a36);}})[_0x501f('0x25')](function(_0x14dfbb){if(_0x14dfbb){return _0x14dfbb?{'count':_0x1830d4,'rows':_0x14dfbb}:null;}})[_0x501f('0x25')](respondWithResult(_0x21878f,null))['catch'](handleError(_0x21878f,null));}; \ No newline at end of file +var _0x3cf7=['update','destroy','then','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','rawAttributes','include','options','find','body','params','sequelize','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','extname','%s.%s','symlinkSync','Sequelize','ValidationError','removeSound','id2','createdAt','message','getSounds','pick','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x3cf7,0x198));var _0x73cf=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0x3cf7[_0x1e5cc3];return _0x15c596;};'use strict';var emlformat=require(_0x73cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73cf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73cf('0x2'));var moment=require(_0x73cf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x73cf('0x4'));var util=require(_0x73cf('0x5'));var path=require(_0x73cf('0x6'));var sox=require(_0x73cf('0x7'));var csv=require('to-csv');var ejs=require(_0x73cf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x73cf('0x9'));var jsforce=require(_0x73cf('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x73cf('0xb'));var querystring=require(_0x73cf('0xc'));var Papa=require(_0x73cf('0xd'));var Redis=require(_0x73cf('0xe'));var authService=require(_0x73cf('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73cf('0x10'));var logger=require(_0x73cf('0x11'))(_0x73cf('0x12'));var utils=require(_0x73cf('0x13'));var config=require(_0x73cf('0x14'));var licenseUtil=require(_0x73cf('0x15'));var db=require(_0x73cf('0x16'))['db'];function respondWithStatusCode(_0x26b39c,_0x3bbbc6){_0x3bbbc6=_0x3bbbc6||0xcc;return function(_0x233ea1){if(_0x233ea1){return _0x26b39c[_0x73cf('0x17')](_0x3bbbc6);}return _0x26b39c[_0x73cf('0x18')](_0x3bbbc6)[_0x73cf('0x19')]();};}function respondWithResult(_0x12623f,_0xe13bbb){_0xe13bbb=_0xe13bbb||0xc8;return function(_0x30cc86){if(_0x30cc86){return _0x12623f['status'](_0xe13bbb)[_0x73cf('0x1a')](_0x30cc86);}};}function respondWithFilteredResult(_0x3115f9,_0x1549d7){return function(_0x45352f){if(_0x45352f){var _0x528cde=typeof _0x1549d7[_0x73cf('0x1b')]===_0x73cf('0x1c')&&typeof _0x1549d7[_0x73cf('0x1d')]===_0x73cf('0x1c');var _0x3843a9=_0x45352f[_0x73cf('0x1e')];var _0x15d35c=_0x528cde?0x0:_0x1549d7[_0x73cf('0x1b')];var _0x5efda3=_0x528cde?_0x45352f[_0x73cf('0x1e')]:_0x1549d7[_0x73cf('0x1b')]+_0x1549d7[_0x73cf('0x1d')];var _0xc24f01;if(_0x5efda3>=_0x3843a9){_0x5efda3=_0x3843a9;_0xc24f01=0xc8;}else{_0xc24f01=0xce;}_0x3115f9[_0x73cf('0x18')](_0xc24f01);return _0x3115f9[_0x73cf('0x1f')](_0x73cf('0x20'),_0x15d35c+'-'+_0x5efda3+'/'+_0x3843a9)['json'](_0x45352f);}return null;};}function patchUpdates(_0x752230){return function(_0x20af73){try{jsonpatch[_0x73cf('0x21')](_0x20af73,_0x752230,!![]);}catch(_0x7ece9e){return BPromise[_0x73cf('0x22')](_0x7ece9e);}return _0x20af73[_0x73cf('0x23')]();};}function saveUpdates(_0x2daf06,_0x5ce9d0){return function(_0x4f1dca){if(_0x4f1dca){return _0x4f1dca[_0x73cf('0x24')](_0x2daf06)['then'](function(_0x2460de){return _0x2460de;});}return null;};}function removeEntity(_0x3fa1,_0x52df09){return function(_0x37f614){if(_0x37f614){return _0x37f614[_0x73cf('0x25')]()[_0x73cf('0x26')](function(){var _0x54117e=_0x37f614['get']({'plain':!![]});var _0x107404='MusicOnHolds';return db[_0x73cf('0x27')][_0x73cf('0x25')]({'where':{'type':_0x107404,'resourceId':_0x54117e['id']}})['then'](function(){return _0x37f614;});})['then'](function(){_0x3fa1[_0x73cf('0x18')](0xcc)[_0x73cf('0x19')]();});}};}function handleEntityNotFound(_0x823572,_0x4b1000){return function(_0x24655c){if(!_0x24655c){_0x823572[_0x73cf('0x17')](0x194);}return _0x24655c;};}function handleError(_0x5df8dc,_0x4b110a){_0x4b110a=_0x4b110a||0x1f4;return function(_0x21713b){logger[_0x73cf('0x28')](_0x21713b[_0x73cf('0x29')]);if(_0x21713b[_0x73cf('0x2a')]){delete _0x21713b[_0x73cf('0x2a')];}_0x5df8dc['status'](_0x4b110a)[_0x73cf('0x2b')](_0x21713b);};}exports[_0x73cf('0x2c')]=function(_0x2a0db1,_0x585702){var _0x4e77fe={},_0x53b8c0={},_0x51b170={'count':0x0,'rows':[]};var _0x463054=_[_0x73cf('0x2d')](db[_0x73cf('0x2e')]['rawAttributes'],function(_0x482127){return{'name':_0x482127[_0x73cf('0x2f')],'type':_0x482127[_0x73cf('0x30')][_0x73cf('0x31')]};});_0x53b8c0[_0x73cf('0x32')]=_['map'](_0x463054,_0x73cf('0x2a'));_0x53b8c0[_0x73cf('0x33')]=_[_0x73cf('0x34')](_0x2a0db1[_0x73cf('0x33')]);_0x53b8c0[_0x73cf('0x35')]=_['intersection'](_0x53b8c0[_0x73cf('0x32')],_0x53b8c0['query']);_0x4e77fe[_0x73cf('0x36')]=_[_0x73cf('0x37')](_0x53b8c0['model'],qs['fields'](_0x2a0db1[_0x73cf('0x33')][_0x73cf('0x38')]));_0x4e77fe[_0x73cf('0x36')]=_0x4e77fe[_0x73cf('0x36')][_0x73cf('0x39')]?_0x4e77fe[_0x73cf('0x36')]:_0x53b8c0[_0x73cf('0x32')];if(!_0x2a0db1['query']['hasOwnProperty'](_0x73cf('0x3a'))){_0x4e77fe[_0x73cf('0x1d')]=qs[_0x73cf('0x1d')](_0x2a0db1[_0x73cf('0x33')][_0x73cf('0x1d')]);_0x4e77fe[_0x73cf('0x1b')]=qs['offset'](_0x2a0db1[_0x73cf('0x33')]['offset']);}_0x4e77fe['order']=qs[_0x73cf('0x3b')](_0x2a0db1[_0x73cf('0x33')][_0x73cf('0x3b')]);delete _0x2a0db1[_0x73cf('0x33')][_0x73cf('0x3b')];_0x4e77fe['where']=qs['filters'](_['pick'](_0x2a0db1[_0x73cf('0x33')],_0x53b8c0[_0x73cf('0x35')]),_0x463054);if(_0x2a0db1[_0x73cf('0x33')][_0x73cf('0x3c')]){_0x4e77fe[_0x73cf('0x3d')]=_[_0x73cf('0x3e')](_0x4e77fe[_0x73cf('0x3d')],{'$or':_[_0x73cf('0x2d')](_0x463054,function(_0x57649a){if(_0x57649a[_0x73cf('0x30')]!==_0x73cf('0x3f')){var _0x4ad4ba={};_0x4ad4ba[_0x57649a[_0x73cf('0x2a')]]={'$like':'%'+_0x2a0db1[_0x73cf('0x33')][_0x73cf('0x3c')]+'%'};return _0x4ad4ba;}})});}_0x4e77fe=_[_0x73cf('0x3e')]({},_0x4e77fe,_0x2a0db1['options']);var _0x253888={'where':_0x4e77fe[_0x73cf('0x3d')]};return db[_0x73cf('0x2e')]['count'](_0x253888)['then'](function(_0x2bdde){_0x51b170[_0x73cf('0x1e')]=_0x2bdde;if(_0x2a0db1[_0x73cf('0x33')][_0x73cf('0x40')]){_0x4e77fe['include']=[{'all':!![]}];}return db[_0x73cf('0x2e')][_0x73cf('0x41')](_0x4e77fe);})[_0x73cf('0x26')](function(_0xfa56c3){_0x51b170['rows']=_0xfa56c3;return _0x51b170;})[_0x73cf('0x26')](respondWithFilteredResult(_0x585702,_0x4e77fe))[_0x73cf('0x42')](handleError(_0x585702,null));};exports[_0x73cf('0x43')]=function(_0xa3fa8e,_0x14ee74){var _0x2af1ef={'raw':![],'where':{'id':_0xa3fa8e['params']['id']}},_0x10d4ab={};_0x10d4ab[_0x73cf('0x32')]=_[_0x73cf('0x34')](db[_0x73cf('0x2e')][_0x73cf('0x44')]);_0x10d4ab[_0x73cf('0x33')]=_[_0x73cf('0x34')](_0xa3fa8e[_0x73cf('0x33')]);_0x10d4ab['filters']=_[_0x73cf('0x37')](_0x10d4ab['model'],_0x10d4ab[_0x73cf('0x33')]);_0x2af1ef[_0x73cf('0x36')]=_[_0x73cf('0x37')](_0x10d4ab[_0x73cf('0x32')],qs['fields'](_0xa3fa8e[_0x73cf('0x33')][_0x73cf('0x38')]));_0x2af1ef[_0x73cf('0x36')]=_0x2af1ef['attributes'][_0x73cf('0x39')]?_0x2af1ef[_0x73cf('0x36')]:_0x10d4ab[_0x73cf('0x32')];if(_0xa3fa8e[_0x73cf('0x33')][_0x73cf('0x40')]){_0x2af1ef[_0x73cf('0x45')]=[{'all':!![]}];}_0x2af1ef=_[_0x73cf('0x3e')]({},_0x2af1ef,_0xa3fa8e[_0x73cf('0x46')]);return db['VoiceMusicOnHold'][_0x73cf('0x47')](_0x2af1ef)[_0x73cf('0x26')](handleEntityNotFound(_0x14ee74,null))['then'](respondWithResult(_0x14ee74,null))[_0x73cf('0x42')](handleError(_0x14ee74,null));};exports['update']=function(_0x49ebf3,_0x12d683){if(_0x49ebf3[_0x73cf('0x48')]['id']){delete _0x49ebf3[_0x73cf('0x48')]['id'];}return db['VoiceMusicOnHold'][_0x73cf('0x47')]({'where':{'id':_0x49ebf3[_0x73cf('0x49')]['id']}})[_0x73cf('0x26')](handleEntityNotFound(_0x12d683,null))['then'](saveUpdates(_0x49ebf3[_0x73cf('0x48')],null))[_0x73cf('0x26')](respondWithResult(_0x12d683,null))[_0x73cf('0x42')](handleError(_0x12d683,null));};exports['create']=function(_0xee4c3f,_0x11ed9f,_0x1c7c59){return db[_0x73cf('0x4a')][_0x73cf('0x4b')](function(_0x26756b){if(_0xee4c3f['body'][_0x73cf('0x4c')]===_0x73cf('0x4d')){_0xee4c3f['body'][_0x73cf('0x4e')]=path[_0x73cf('0x4f')](config[_0x73cf('0x50')],_0x73cf('0x51'),_0xee4c3f[_0x73cf('0x48')]['name']);}return db[_0x73cf('0x2e')][_0x73cf('0x52')](_0xee4c3f['body'],{'transaction':_0x26756b})[_0x73cf('0x26')](function(_0x48243d){if(_0xee4c3f[_0x73cf('0x48')]['mode']===_0x73cf('0x4d')){fs[_0x73cf('0x53')](_0x48243d[_0x73cf('0x4e')],parseInt('0777',0x8));}var _0x20cd0d=_0xee4c3f[_0x73cf('0x54')]['get']({'plain':!![]});if(!_0x20cd0d)throw new Error(_0x73cf('0x55'));if(_0x20cd0d[_0x73cf('0x56')]==='user'){var _0x12a8b9=_0x48243d['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x20cd0d[_0x73cf('0x57')]},'raw':!![]})[_0x73cf('0x26')](function(_0x416d63){if(_0x416d63&&_0x416d63[_0x73cf('0x58')]===0x0){return db[_0x73cf('0x27')][_0x73cf('0x52')]({'name':_0x12a8b9[_0x73cf('0x2a')],'resourceId':_0x12a8b9['id'],'type':_0x416d63[_0x73cf('0x2a')],'sectionId':_0x416d63['id']},{})[_0x73cf('0x26')](function(){return _0x48243d;});}else{return _0x48243d;}})['catch'](function(_0x5d5f29){logger[_0x73cf('0x28')](_0x73cf('0x59'),_0x5d5f29);});}return _0x48243d;});})[_0x73cf('0x26')](respondWithResult(_0x11ed9f,0xc9))[_0x73cf('0x42')](handleError(_0x11ed9f,null));};exports[_0x73cf('0x25')]=function(_0x2713f4,_0x2379c9,_0x398f4f){var _0x251703;return db[_0x73cf('0x2e')][_0x73cf('0x47')]({'where':{'id':_0x2713f4[_0x73cf('0x49')]['id']}})[_0x73cf('0x26')](function(_0x2425f8){if(_0x2425f8){return db[_0x73cf('0x4a')][_0x73cf('0x4b')](function(_0x47e4a0){return _0x2425f8[_0x73cf('0x25')]({'transaction':_0x47e4a0,'raw':!![]})[_0x73cf('0x26')](function(_0x2a9321){if(_0x2a9321[_0x73cf('0x4e')]){fs[_0x73cf('0x5a')](_0x2a9321[_0x73cf('0x4e')])[_0x73cf('0x5b')](function(_0x565bbb){fs[_0x73cf('0x5c')](path['join'](_0x2a9321[_0x73cf('0x4e')],_0x565bbb));});fs[_0x73cf('0x5d')](_0x2a9321['directory']);}return _0x2a9321;});})[_0x73cf('0x42')](function(_0x6a2d28){throw new db['Sequelize']['ValidationError'](_0x6a2d28['message']);});}})[_0x73cf('0x26')](handleEntityNotFound(_0x2379c9,null))['then'](removeEntity(_0x2379c9,null))[_0x73cf('0x42')](handleError(_0x2379c9,null));};exports[_0x73cf('0x5e')]=function(_0x4a8fb5,_0x5986aa,_0x268ff2){return db[_0x73cf('0x4a')]['transaction'](function(_0x4f82f9){var _0x2c642f;return db['VoiceMusicOnHold'][_0x73cf('0x47')]({'where':{'id':_0x4a8fb5['params']['id']}})[_0x73cf('0x26')](function(_0x14f5c4){if(_0x14f5c4){_0x2c642f=_0x14f5c4;return _0x14f5c4[_0x73cf('0x5e')](_0x4a8fb5[_0x73cf('0x48')]['id'],{'transaction':_0x4f82f9});}})['then'](function(_0x2c00b6){if(_0x2c00b6){return db[_0x73cf('0x5f')][_0x73cf('0x60')]({'where':{'id':_0x4a8fb5[_0x73cf('0x48')]['id']},'attributes':['id',_0x73cf('0x2a'),_0x73cf('0x61'),_0x73cf('0x62'),'createdAt'],'raw':!![]});}})['then'](function(_0x2d2988){if(_0x2d2988){var _0x295915=path[_0x73cf('0x4f')](config[_0x73cf('0x50')],_0x73cf('0x63'),util['format']('%s.%s',path['basename'](_0x2d2988[_0x73cf('0x61')],path[_0x73cf('0x64')](_0x2d2988[_0x73cf('0x61')])),_0x2d2988[_0x73cf('0x62')]));var _0x23e2c5=path[_0x73cf('0x4f')](config[_0x73cf('0x50')],'server/files/moh',_0x2c642f[_0x73cf('0x2a')],util['format'](_0x73cf('0x65'),_0x2d2988[_0x73cf('0x2a')],_0x2d2988[_0x73cf('0x62')]));fs[_0x73cf('0x66')](_0x295915,_0x23e2c5);return _0x2d2988;}})['catch'](function(_0x2aa5ff){throw new db[(_0x73cf('0x67'))][(_0x73cf('0x68'))](_0x2aa5ff['message']);});})[_0x73cf('0x26')](handleEntityNotFound(_0x5986aa,null))['then'](respondWithResult(_0x5986aa,0xc9))[_0x73cf('0x42')](handleError(_0x5986aa,null));};exports[_0x73cf('0x69')]=function(_0x1fdf62,_0x40762b,_0x525cc1){return db['sequelize'][_0x73cf('0x4b')](function(_0x15e872){var _0x2ddf0b;return db['VoiceMusicOnHold'][_0x73cf('0x60')]({'where':{'id':_0x1fdf62[_0x73cf('0x49')]['id']}})['then'](handleEntityNotFound(_0x40762b,null))[_0x73cf('0x26')](function(_0x3c09d5){if(_0x3c09d5){_0x2ddf0b=_0x3c09d5;return _0x3c09d5[_0x73cf('0x69')](_0x1fdf62[_0x73cf('0x49')][_0x73cf('0x6a')]);}})[_0x73cf('0x26')](function(_0x1a7165){if(_0x1a7165){return db[_0x73cf('0x5f')][_0x73cf('0x60')]({'where':{'id':_0x1fdf62[_0x73cf('0x49')][_0x73cf('0x6a')]},'attributes':['id',_0x73cf('0x2a'),_0x73cf('0x61'),'converted_format',_0x73cf('0x6b')],'raw':!![]});}})[_0x73cf('0x26')](function(_0xad6f9e){if(_0xad6f9e){fs[_0x73cf('0x5c')](path[_0x73cf('0x4f')](_0x2ddf0b['directory'],util['format'](_0x73cf('0x65'),_0xad6f9e[_0x73cf('0x2a')],_0xad6f9e[_0x73cf('0x62')])));return _0xad6f9e;}})[_0x73cf('0x42')](function(_0x5376df){throw new db[(_0x73cf('0x67'))][(_0x73cf('0x68'))](_0x5376df[_0x73cf('0x6c')]);});})['then'](handleEntityNotFound(_0x40762b,null))[_0x73cf('0x26')](respondWithStatusCode(_0x40762b,0xcc))[_0x73cf('0x42')](handleError(_0x40762b,null));};exports[_0x73cf('0x6d')]=function(_0x1fae18,_0x21f3fc,_0x20931d){var _0x45f152={};var _0xace2e7={};var _0x300c96;var _0x1af35f;return db[_0x73cf('0x2e')]['findOne']({'where':{'id':_0x1fae18[_0x73cf('0x49')]['id']}})[_0x73cf('0x26')](handleEntityNotFound(_0x21f3fc,null))[_0x73cf('0x26')](function(_0x1ba7ba){if(_0x1ba7ba){_0x300c96=_0x1ba7ba;_0xace2e7[_0x73cf('0x32')]=_[_0x73cf('0x34')](db[_0x73cf('0x5f')]['rawAttributes']);_0xace2e7[_0x73cf('0x33')]=_[_0x73cf('0x34')](_0x1fae18[_0x73cf('0x33')]);_0xace2e7[_0x73cf('0x35')]=_[_0x73cf('0x37')](_0xace2e7['model'],_0xace2e7[_0x73cf('0x33')]);_0x45f152[_0x73cf('0x36')]=_['intersection'](_0xace2e7['model'],qs[_0x73cf('0x38')](_0x1fae18[_0x73cf('0x33')][_0x73cf('0x38')]));_0x45f152[_0x73cf('0x36')]=_0x45f152[_0x73cf('0x36')][_0x73cf('0x39')]?_0x45f152[_0x73cf('0x36')]:_0xace2e7[_0x73cf('0x32')];_0x45f152['order']=qs[_0x73cf('0x3b')](_0x1fae18[_0x73cf('0x33')][_0x73cf('0x3b')]);_0x45f152[_0x73cf('0x3d')]=qs[_0x73cf('0x35')](_[_0x73cf('0x6e')](_0x1fae18[_0x73cf('0x33')],_0xace2e7['filters']));if(_0x1fae18[_0x73cf('0x33')][_0x73cf('0x3c')]){_0x45f152[_0x73cf('0x3d')]=_['merge'](_0x45f152['where'],{'$or':_[_0x73cf('0x2d')](_0x45f152[_0x73cf('0x36')],function(_0x4b0be1){var _0x519bdc={};_0x519bdc[_0x4b0be1]={'$like':'%'+_0x1fae18[_0x73cf('0x33')][_0x73cf('0x3c')]+'%'};return _0x519bdc;})});}_0x45f152=_[_0x73cf('0x3e')]({},_0x45f152,_0x1fae18[_0x73cf('0x46')]);return _0x300c96[_0x73cf('0x6d')](_0x45f152);}})[_0x73cf('0x26')](function(_0x1fb05a){if(_0x1fb05a){_0x1af35f=_0x1fb05a[_0x73cf('0x39')];if(!_0x1fae18[_0x73cf('0x33')]['hasOwnProperty'](_0x73cf('0x3a'))){_0x45f152['limit']=qs[_0x73cf('0x1d')](_0x1fae18[_0x73cf('0x33')][_0x73cf('0x1d')]);_0x45f152[_0x73cf('0x1b')]=qs['offset'](_0x1fae18[_0x73cf('0x33')]['offset']);}return _0x300c96[_0x73cf('0x6d')](_0x45f152);}})['then'](function(_0x19bee9){if(_0x19bee9){return _0x19bee9?{'count':_0x1af35f,'rows':_0x19bee9}:null;}})[_0x73cf('0x26')](respondWithResult(_0x21f3fc,null))[_0x73cf('0x42')](handleError(_0x21f3fc,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index bd72bc6..c7dae11 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 _0xbd48=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x261c5a,_0x1c2dfa){var _0x4d8c6c=function(_0x54baba){while(--_0x54baba){_0x261c5a['push'](_0x261c5a['shift']());}};_0x4d8c6c(++_0x1c2dfa);}(_0xbd48,0x124));var _0x8bd4=function(_0x2fbcbe,_0x54eb3f){_0x2fbcbe=_0x2fbcbe-0x0;var _0x57f5a5=_0xbd48[_0x2fbcbe];return _0x57f5a5;};'use strict';var _=require(_0x8bd4('0x0'));var util=require(_0x8bd4('0x1'));var logger=require(_0x8bd4('0x2'))(_0x8bd4('0x3'));var moment=require(_0x8bd4('0x4'));var BPromise=require('bluebird');var rp=require(_0x8bd4('0x5'));var fs=require('fs');var path=require(_0x8bd4('0x6'));var rimraf=require(_0x8bd4('0x7'));var config=require(_0x8bd4('0x8'));var attributes=require(_0x8bd4('0x9'));module[_0x8bd4('0xa')]=function(_0x222810,_0x245862){return _0x222810[_0x8bd4('0xb')](_0x8bd4('0xc'),attributes,{'tableName':_0x8bd4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2290=['exports','VoiceMusicOnHold','voice_musiconhold','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x4b8779,_0x387942){var _0x45fdb3=function(_0x482a10){while(--_0x482a10){_0x4b8779['push'](_0x4b8779['shift']());}};_0x45fdb3(++_0x387942);}(_0x2290,0x158));var _0x0229=function(_0x4803e8,_0xecdf22){_0x4803e8=_0x4803e8-0x0;var _0x1d5c39=_0x2290[_0x4803e8];return _0x1d5c39;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0229('0x0'))(_0x0229('0x1'));var moment=require(_0x0229('0x2'));var BPromise=require('bluebird');var rp=require(_0x0229('0x3'));var fs=require('fs');var path=require(_0x0229('0x4'));var rimraf=require(_0x0229('0x5'));var config=require(_0x0229('0x6'));var attributes=require(_0x0229('0x7'));module[_0x0229('0x8')]=function(_0x2f3fc6,_0x11a676){return _0x2f3fc6['define'](_0x0229('0x9'),attributes,{'tableName':_0x0229('0xa'),'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 cc926fc..33bf301 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x472470,_0x2372a8){var _0x656385=function(_0x4e1bb6){while(--_0x4e1bb6){_0x472470['push'](_0x472470['shift']());}};_0x656385(++_0x2372a8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xcb91[_0x2283dc];return _0x16db90;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x52ae4d,_0x505a74){var _0x4bbf67=function(_0x4b9274){while(--_0x4b9274){_0x52ae4d['push'](_0x52ae4d['shift']());}};_0x4bbf67(++_0x505a74);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 919857c..748b558 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 _0x3297=['fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getTeams','post','create','addAgents','/:id/teams','addTeams','put','update','destroy','delete','removeAgents','removeTeams','exports','multer','util','path','express','Router'];(function(_0x12fa48,_0x3cd115){var _0x250da8=function(_0x439c08){while(--_0x439c08){_0x12fa48['push'](_0x12fa48['shift']());}};_0x250da8(++_0x3cd115);}(_0x3297,0x19f));var _0x7329=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x3297[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x7329('0x0'));var util=require(_0x7329('0x1'));var path=require(_0x7329('0x2'));var timeout=require('connect-timeout');var express=require(_0x7329('0x3'));var router=express[_0x7329('0x4')]();var fs_extra=require(_0x7329('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7329('0x6'));var config=require(_0x7329('0x7'));var controller=require(_0x7329('0x8'));router[_0x7329('0x9')]('/',auth[_0x7329('0xa')](),controller[_0x7329('0xb')]);router[_0x7329('0x9')](_0x7329('0xc'),auth[_0x7329('0xa')](),controller[_0x7329('0xd')]);router[_0x7329('0x9')](_0x7329('0xe'),auth['isAuthenticated'](),controller[_0x7329('0xf')]);router['get'](_0x7329('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x7329('0x9')]('/:id/teams',auth[_0x7329('0xa')](),controller[_0x7329('0x11')]);router[_0x7329('0x12')]('/',auth[_0x7329('0xa')](),controller[_0x7329('0x13')]);router[_0x7329('0x12')]('/:id/users',auth[_0x7329('0xa')](),controller[_0x7329('0x14')]);router[_0x7329('0x12')](_0x7329('0x15'),auth[_0x7329('0xa')](),controller[_0x7329('0x16')]);router[_0x7329('0x17')](_0x7329('0xe'),auth[_0x7329('0xa')](),controller[_0x7329('0x18')]);router['delete']('/:id',auth[_0x7329('0xa')](),controller[_0x7329('0x19')]);router[_0x7329('0x1a')]('/:id/users',auth[_0x7329('0xa')](),controller[_0x7329('0x1b')]);router[_0x7329('0x1a')](_0x7329('0x15'),auth[_0x7329('0xa')](),controller[_0x7329('0x1c')]);module[_0x7329('0x1d')]=router; \ No newline at end of file +var _0x308a=['getAgents','/:id/teams','post','create','/:id/users','addTeams','put','update','delete','/:id','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe'];(function(_0xbdf620,_0x59767f){var _0x23d152=function(_0x4ee925){while(--_0x4ee925){_0xbdf620['push'](_0xbdf620['shift']());}};_0x23d152(++_0x59767f);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xa308('0x0'));var util=require('util');var path=require(_0xa308('0x1'));var timeout=require(_0xa308('0x2'));var express=require(_0xa308('0x3'));var router=express[_0xa308('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa308('0x5'));var config=require(_0xa308('0x6'));var controller=require(_0xa308('0x7'));router[_0xa308('0x8')]('/',auth[_0xa308('0x9')](),controller[_0xa308('0xa')]);router[_0xa308('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa308('0xb')]);router[_0xa308('0x8')]('/:id',auth[_0xa308('0x9')](),controller['show']);router[_0xa308('0x8')]('/:id/users',auth[_0xa308('0x9')](),controller[_0xa308('0xc')]);router['get'](_0xa308('0xd'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa308('0xe')]('/',auth[_0xa308('0x9')](),controller[_0xa308('0xf')]);router[_0xa308('0xe')](_0xa308('0x10'),auth[_0xa308('0x9')](),controller['addAgents']);router[_0xa308('0xe')](_0xa308('0xd'),auth[_0xa308('0x9')](),controller[_0xa308('0x11')]);router[_0xa308('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa308('0x13')]);router[_0xa308('0x14')](_0xa308('0x15'),auth[_0xa308('0x9')](),controller[_0xa308('0x16')]);router['delete'](_0xa308('0x10'),auth[_0xa308('0x9')](),controller[_0xa308('0x17')]);router[_0xa308('0x14')](_0xa308('0xd'),auth[_0xa308('0x9')](),controller['removeTeams']);module[_0xa308('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 11d7be2..ef9ad64 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 _0xc83d=['name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','STRING'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xc83d,0x147));var _0xdc83=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc83d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xdc83('0x0'));module['exports']={'name':{'type':Sequelize[_0xdc83('0x1')],'allowNull':![],'unique':_0xdc83('0x2')},'prefix':{'type':Sequelize[_0xdc83('0x3')],'get':function(_0x226742){return _0xdc83('0x4')+this[_0xdc83('0x5')](_0xdc83('0x2'))+'-';}},'description':{'type':Sequelize[_0xdc83('0x1')]},'callerIdAll':{'type':Sequelize[_0xdc83('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xdc83('0x6')]}}; \ No newline at end of file +var _0x3a3b=['VIRTUAL','system-','exports','name'];(function(_0x5ef083,_0x3fc691){var _0x3a02ee=function(_0x5f4998){while(--_0x5f4998){_0x5ef083['push'](_0x5ef083['shift']());}};_0x3a02ee(++_0x3fc691);}(_0x3a3b,0x16e));var _0xb3a3=function(_0x5cb3ad,_0x499335){_0x5cb3ad=_0x5cb3ad-0x0;var _0x229d31=_0x3a3b[_0x5cb3ad];return _0x229d31;};'use strict';var Sequelize=require('sequelize');module[_0xb3a3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb3a3('0x1')},'prefix':{'type':Sequelize[_0xb3a3('0x2')],'get':function(_0x17ebce){return _0xb3a3('0x3')+this['getDataValue'](_0xb3a3('0x1'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 81136fe..c8d31ad 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 _0x087b=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','end','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','VIRTUAL','where','include','catch','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Set','CDR(prefix)=','callerIdAll','push','No\x20callerid\x20available','context','charAt','body','system-','findById','addAgents','params','omit','ids','spread','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','getTeams','Team','addTeams','findAll','interface','flatMap','Agents','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','union','compact','value','removeTeams','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus'];(function(_0x2855fb,_0x5bacef){var _0x47b736=function(_0x955202){while(--_0x955202){_0x2855fb['push'](_0x2855fb['shift']());}};_0x47b736(++_0x5bacef);}(_0x087b,0x11a));var _0xb087=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x087b[_0x1ccdf7];return _0x52a0ae;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];config[_0xb087('0x1b')]=_[_0xb087('0x1c')](config['redis'],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1b')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);function respondWithStatusCode(_0x12d0db,_0x5e9757){_0x5e9757=_0x5e9757||0xcc;return function(_0x5147e3){if(_0x5147e3){return _0x12d0db[_0xb087('0x21')](_0x5e9757);}return _0x12d0db[_0xb087('0x22')](_0x5e9757)['end']();};}function respondWithResult(_0x43e576,_0x412b48){_0x412b48=_0x412b48||0xc8;return function(_0x597478){if(_0x597478){return _0x43e576[_0xb087('0x22')](_0x412b48)[_0xb087('0x23')](_0x597478);}};}function respondWithFilteredResult(_0x2e9e74,_0x5bb80b){return function(_0x330005){if(_0x330005){var _0x3c680f=typeof _0x5bb80b[_0xb087('0x24')]===_0xb087('0x25')&&typeof _0x5bb80b['limit']===_0xb087('0x25');var _0x28428e=_0x330005[_0xb087('0x26')];var _0x23c1b6=_0x3c680f?0x0:_0x5bb80b['offset'];var _0x5aeab1=_0x3c680f?_0x330005['count']:_0x5bb80b['offset']+_0x5bb80b[_0xb087('0x27')];var _0x17be8e;if(_0x5aeab1>=_0x28428e){_0x5aeab1=_0x28428e;_0x17be8e=0xc8;}else{_0x17be8e=0xce;}_0x2e9e74[_0xb087('0x22')](_0x17be8e);return _0x2e9e74[_0xb087('0x28')](_0xb087('0x29'),_0x23c1b6+'-'+_0x5aeab1+'/'+_0x28428e)[_0xb087('0x23')](_0x330005);}return null;};}function patchUpdates(_0x31ae01){return function(_0x5587f7){try{jsonpatch[_0xb087('0x2a')](_0x5587f7,_0x31ae01,!![]);}catch(_0x466397){return BPromise[_0xb087('0x2b')](_0x466397);}return _0x5587f7[_0xb087('0x2c')]();};}function saveUpdates(_0x3ad74e,_0x4d9028){return function(_0x183eab){if(_0x183eab){return _0x183eab[_0xb087('0x2d')](_0x3ad74e)['then'](function(_0x5a2dc6){return _0x5a2dc6;});}return null;};}function removeEntity(_0x50745a,_0x598b99){return function(_0x5a4ee0){if(_0x5a4ee0){return _0x5a4ee0[_0xb087('0x2e')]()[_0xb087('0x2f')](function(){var _0x1d124f=_0x5a4ee0[_0xb087('0x30')]({'plain':!![]});var _0xd9ec66=_0xb087('0x31');return db[_0xb087('0x32')][_0xb087('0x2e')]({'where':{'type':_0xd9ec66,'resourceId':_0x1d124f['id']}})[_0xb087('0x2f')](function(){return _0x5a4ee0;});})[_0xb087('0x2f')](function(){_0x50745a[_0xb087('0x22')](0xcc)[_0xb087('0x33')]();});}};}function handleEntityNotFound(_0xb0baf6,_0x263259){return function(_0x593b78){if(!_0x593b78){_0xb0baf6[_0xb087('0x21')](0x194);}return _0x593b78;};}function handleError(_0x1335d9,_0x20183f){_0x20183f=_0x20183f||0x1f4;return function(_0x15c9ac){logger[_0xb087('0x34')](_0x15c9ac[_0xb087('0x35')]);if(_0x15c9ac[_0xb087('0x36')]){delete _0x15c9ac[_0xb087('0x36')];}_0x1335d9['status'](_0x20183f)['send'](_0x15c9ac);};}exports[_0xb087('0x37')]=function(_0xedd164,_0x4cb5a8){var _0x60bfe2={},_0x7d3776={},_0x2a48d3={'count':0x0,'rows':[]};var _0x32b20d=_[_0xb087('0x38')](db[_0xb087('0x39')][_0xb087('0x3a')],function(_0x3b7ace){return{'name':_0x3b7ace[_0xb087('0x3b')],'type':_0x3b7ace[_0xb087('0x3c')][_0xb087('0x3d')]};});_0x7d3776[_0xb087('0x3e')]=_['map'](_0x32b20d,_0xb087('0x36'));_0x7d3776['query']=_[_0xb087('0x3f')](_0xedd164[_0xb087('0x40')]);_0x7d3776[_0xb087('0x41')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],_0x7d3776[_0xb087('0x40')]);_0x60bfe2[_0xb087('0x43')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],qs['fields'](_0xedd164['query'][_0xb087('0x44')]));_0x60bfe2[_0xb087('0x43')]=_0x60bfe2[_0xb087('0x43')][_0xb087('0x45')]?_0x60bfe2[_0xb087('0x43')]:_0x7d3776['model'];if(!_0xedd164[_0xb087('0x40')][_0xb087('0x46')]('nolimit')){_0x60bfe2['limit']=qs[_0xb087('0x27')](_0xedd164[_0xb087('0x40')][_0xb087('0x27')]);_0x60bfe2['offset']=qs[_0xb087('0x24')](_0xedd164[_0xb087('0x40')][_0xb087('0x24')]);}_0x60bfe2[_0xb087('0x47')]=qs[_0xb087('0x48')](_0xedd164['query'][_0xb087('0x48')]);_0x60bfe2['where']=qs[_0xb087('0x41')](_['pick'](_0xedd164[_0xb087('0x40')],_0x7d3776[_0xb087('0x41')]),_0x32b20d);if(_0xedd164['query'][_0xb087('0x49')]){_0x60bfe2['where']=_[_0xb087('0x4a')](_0x60bfe2['where'],{'$or':_[_0xb087('0x38')](_0x32b20d,function(_0x326934){if(_0x326934[_0xb087('0x3c')]!==_0xb087('0x4b')){var _0x1785e0={};_0x1785e0[_0x326934[_0xb087('0x36')]]={'$like':'%'+_0xedd164[_0xb087('0x40')]['filter']+'%'};return _0x1785e0;}})});}_0x60bfe2=_[_0xb087('0x4a')]({},_0x60bfe2,_0xedd164['options']);var _0x2a2b9c={'where':_0x60bfe2[_0xb087('0x4c')]};return db['VoicePrefix'][_0xb087('0x26')](_0x2a2b9c)[_0xb087('0x2f')](function(_0x7650c5){_0x2a48d3['count']=_0x7650c5;if(_0xedd164[_0xb087('0x40')]['includeAll']){_0x60bfe2[_0xb087('0x4d')]=[{'all':!![]}];}return db[_0xb087('0x39')]['findAll'](_0x60bfe2);})[_0xb087('0x2f')](function(_0x302ce7){_0x2a48d3['rows']=_0x302ce7;return _0x2a48d3;})[_0xb087('0x2f')](respondWithFilteredResult(_0x4cb5a8,_0x60bfe2))[_0xb087('0x4e')](handleError(_0x4cb5a8,null));};exports['show']=function(_0x93ada7,_0x46c713){var _0x1d7f80={'raw':![],'where':{'id':_0x93ada7['params']['id']}},_0x174c10={};_0x174c10['model']=_[_0xb087('0x3f')](db[_0xb087('0x39')][_0xb087('0x3a')]);_0x174c10[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x93ada7[_0xb087('0x40')]);_0x174c10['filters']=_['intersection'](_0x174c10[_0xb087('0x3e')],_0x174c10['query']);_0x1d7f80[_0xb087('0x43')]=_[_0xb087('0x42')](_0x174c10[_0xb087('0x3e')],qs[_0xb087('0x44')](_0x93ada7['query'][_0xb087('0x44')]));_0x1d7f80['attributes']=_0x1d7f80[_0xb087('0x43')][_0xb087('0x45')]?_0x1d7f80[_0xb087('0x43')]:_0x174c10[_0xb087('0x3e')];if(_0x93ada7[_0xb087('0x40')]['includeAll']){_0x1d7f80[_0xb087('0x4d')]=[{'all':!![]}];}_0x1d7f80=_[_0xb087('0x4a')]({},_0x1d7f80,_0x93ada7[_0xb087('0x4f')]);return db['VoicePrefix'][_0xb087('0x50')](_0x1d7f80)['then'](handleEntityNotFound(_0x46c713,null))['then'](respondWithResult(_0x46c713,null))[_0xb087('0x4e')](handleError(_0x46c713,null));};exports[_0xb087('0x2e')]=function(_0x5eacf3,_0x4362d4){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x5eacf3['params']['id']}})['then'](handleEntityNotFound(_0x4362d4,null))[_0xb087('0x2f')](removeEntity(_0x4362d4,null))['catch'](handleError(_0x4362d4,null));};exports['describe']=function(_0x1e52e4,_0x3bafca){return db[_0xb087('0x39')][_0xb087('0x51')]()[_0xb087('0x2f')](respondWithResult(_0x3bafca,null))[_0xb087('0x4e')](handleError(_0x3bafca,null));};exports[_0xb087('0x52')]=function(_0xfb8827,_0x1fe178){var _0x18d93b;return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x55e653){return db[_0xb087('0x39')][_0xb087('0x52')](_0xfb8827['body'],{'transaction':_0x55e653})[_0xb087('0x2f')](function(_0x458301){_0x18d93b=_0x458301[_0xb087('0x30')]({'plain':!![]});return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x18d93b[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x298169){return createVoicePrefixExtensions(_0x18d93b,_0x298169,_0x55e653);});});})[_0xb087('0x2f')](function(){var _0x357616=_0xfb8827[_0xb087('0x57')]['get']({'plain':!![]});if(!_0x357616)throw new Error(_0xb087('0x58'));if(_0x357616['role']===_0xb087('0x57')){var _0x575cc4=_0x18d93b;return db[_0xb087('0x59')][_0xb087('0x50')]({'where':{'name':_0xb087('0x31'),'userProfileId':_0x357616[_0xb087('0x5a')]},'raw':!![]})[_0xb087('0x2f')](function(_0x465ef6){if(_0x465ef6&&_0x465ef6[_0xb087('0x5b')]===0x0){return db[_0xb087('0x32')][_0xb087('0x52')]({'name':_0x575cc4[_0xb087('0x36')],'resourceId':_0x575cc4['id'],'type':_0x465ef6[_0xb087('0x36')],'sectionId':_0x465ef6['id']},{})[_0xb087('0x2f')](function(){return _0x18d93b;});}else{return _0x18d93b;}})[_0xb087('0x4e')](function(_0x22be05){logger[_0xb087('0x34')](_0xb087('0x5c'),_0x22be05);throw _0x22be05;});}return _0x18d93b;})[_0xb087('0x2f')](respondWithResult(_0x1fe178,null))[_0xb087('0x4e')](handleError(_0x1fe178,null));};function Extension(_0x40ff74,_0xe3cb2,_0x4053c8,_0x459c5b){this['context']=_0xb087('0x5d');this[_0xb087('0x5e')]=_0x40ff74;this[_0xb087('0x5f')]=_0x4053c8;this['type']=_0xb087('0x60');this[_0xb087('0x61')]='Voice\x20Prefix\x20Extension';this[_0xb087('0x62')]=_0xe3cb2;this[_0xb087('0x63')]=_0x459c5b;}function createVoicePrefixExtensions(_0x2e3a14,_0x596264,_0x133c58){return new BPromise(function(_0x257894,_0x3d7f74){var _0x43ef22=new Extension(formatPrefixName(_0x2e3a14[_0xb087('0x64')]),0x1,_0xb087('0x65'),_0xb087('0x66'));_0x43ef22[_0xb087('0x67')]=_0x2e3a14['id'];return db['VoiceExtension'][_0xb087('0x52')](_0x43ef22,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x44548f){var _0x47b2c7=_0x44548f[_0xb087('0x30')]({'plain':!![]});var _0x4a26d0=_['map'](addVoicePrefixExtensions(_0x2e3a14,_0x596264),function(_0x3516d4){_0x3516d4[_0xb087('0x56')]=_0x47b2c7['id'];_0x3516d4['VoicePrefixId']=_0x2e3a14['id'];return _0x3516d4;});return db[_0xb087('0x55')]['bulkCreate'](_0x4a26d0,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x1a8237){if(!_0x1a8237){return _0x3d7f74('Extensions\x20creation\x20failed');}else{return _0x257894(_0x1a8237);}})['catch'](function(_0x22219d){return _0x3d7f74(_0x22219d);});});;});};function addVoicePrefixExtensions(_0x5c43c8,_0x5ede2e){var _0x3c97ab=[];var _0x52d72a=formatPrefixName(_0x5c43c8[_0xb087('0x64')]);_0x3c97ab['push'](new Extension(_0x52d72a,0x2,_0xb087('0x68'),_0xb087('0x69')+_0x5c43c8[_0xb087('0x36')]));if(_0x5c43c8[_0xb087('0x6a')]){_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x3,_0xb087('0x68'),'PREFIX-CALLERIDALL='+_0x5c43c8[_0xb087('0x6a')]));}else{_0x3c97ab['push'](new Extension(_0x52d72a,0x3,_0xb087('0x65'),_0xb087('0x6c')));}_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x4,'goto',_0x5ede2e[_0xb087('0x6d')]+','+'${EXTEN:'+(0x8+_0x5c43c8[_0xb087('0x36')][_0xb087('0x45')])+'}'+','+0x1));return _0x3c97ab;}function formatPrefixName(_0x66f15b){var _0x2ee63f='_';for(var _0x16cb87=0x0;_0x16cb87<_0x66f15b[_0xb087('0x45')];_0x16cb87++){if(_0x66f15b['charAt'](_0x16cb87)=='-'){_0x2ee63f+=_0x66f15b[_0xb087('0x6e')](_0x16cb87);}else{_0x2ee63f+='['+_0x66f15b[_0xb087('0x6e')](_0x16cb87)+']';}}_0x2ee63f+='.';return _0x2ee63f;}exports['update']=function(_0x25a45f,_0x58de88,_0x19238d){var _0x38f5d2=_0x25a45f[_0xb087('0x6f')];_0x38f5d2[_0xb087('0x64')]=_0xb087('0x70')+_0x38f5d2[_0xb087('0x36')]+'-';return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x509ee7){return db['VoicePrefix']['update'](_0x38f5d2,{'where':{'id':_0x38f5d2['id']},'transaction':_0x509ee7})[_0xb087('0x2f')](function(){return db['VoiceExtension'][_0xb087('0x2e')]({'where':{'VoicePrefixId':_0x38f5d2['id']},'transaction':_0x509ee7})['then'](function(){return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x38f5d2[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x49d0d3){return createVoicePrefixExtensions(_0x38f5d2,_0x49d0d3,_0x509ee7);});});});})[_0xb087('0x2f')](function(){return db['VoicePrefix'][_0xb087('0x71')](_0x38f5d2['id']);})[_0xb087('0x2f')](respondWithResult(_0x58de88,null))[_0xb087('0x4e')](handleError(_0x58de88,null));};exports[_0xb087('0x72')]=function(_0x5b5ad3,_0x49d26a,_0x38f296){return db['VoicePrefix'][_0xb087('0x50')]({'where':{'id':_0x5b5ad3[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x49d26a,null))[_0xb087('0x2f')](function(_0x4a9193){if(_0x4a9193){return _0x4a9193['addAgents'](_0x5b5ad3[_0xb087('0x6f')]['ids'],_[_0xb087('0x74')](_0x5b5ad3[_0xb087('0x6f')],[_0xb087('0x75'),'id'])||{})[_0xb087('0x76')](function(_0x142b0f){for(var _0x581ad4=0x0;_0x581ad4<_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')]['length'];_0x581ad4+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')][_0x581ad4]),'VoicePrefixId':Number(_0x5b5ad3[_0xb087('0x73')]['id'])});}return _0x142b0f;});}})[_0xb087('0x2f')](respondWithResult(_0x49d26a,null))[_0xb087('0x4e')](handleError(_0x49d26a,null));};exports[_0xb087('0x77')]=function(_0x47ea48,_0xd1f58a,_0x25e097){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x47ea48[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0xd1f58a,null))[_0xb087('0x2f')](function(_0x50454b){if(_0x50454b){return _0x50454b[_0xb087('0x77')](_0x47ea48[_0xb087('0x40')][_0xb087('0x75')])['then'](function(){if(_[_0xb087('0x78')](_0x47ea48['query'][_0xb087('0x75')])){for(var _0x5fb869=0x0;_0x5fb869<_0x47ea48[_0xb087('0x40')][_0xb087('0x75')][_0xb087('0x45')];_0x5fb869+=0x1){socket[_0xb087('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x47ea48['query'][_0xb087('0x75')][_0x5fb869]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}}else{socket['emit'](_0xb087('0x7a'),{'UserId':Number(_0x47ea48[_0xb087('0x40')][_0xb087('0x75')]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}});}})[_0xb087('0x2f')](respondWithStatusCode(_0xd1f58a,null))[_0xb087('0x4e')](handleError(_0xd1f58a,null));};exports['getAgents']=function(_0x15ff29,_0x141859,_0x2c92f6){var _0x3114ce={};var _0x416e05={};var _0x3d6d1a;var _0xf286de;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x15ff29['params']['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x141859,null))['then'](function(_0x2a32d0){if(_0x2a32d0){_0x3d6d1a=_0x2a32d0;_0x416e05[_0xb087('0x3e')]=_['keys'](db[_0xb087('0x7c')][_0xb087('0x3a')]);_0x416e05[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x15ff29[_0xb087('0x40')]);_0x416e05[_0xb087('0x41')]=_['intersection'](_0x416e05[_0xb087('0x3e')],_0x416e05[_0xb087('0x40')]);_0x3114ce[_0xb087('0x43')]=_[_0xb087('0x42')](_0x416e05[_0xb087('0x3e')],qs['fields'](_0x15ff29[_0xb087('0x40')][_0xb087('0x44')]));_0x3114ce[_0xb087('0x43')]=_0x3114ce[_0xb087('0x43')][_0xb087('0x45')]?_0x3114ce[_0xb087('0x43')]:_0x416e05[_0xb087('0x3e')];_0x3114ce[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x15ff29[_0xb087('0x40')][_0xb087('0x48')]);_0x3114ce['where']=qs['filters'](_[_0xb087('0x7d')](_0x15ff29[_0xb087('0x40')],_0x416e05[_0xb087('0x41')]));if(_0x15ff29[_0xb087('0x40')][_0xb087('0x49')]){_0x3114ce['where']=_[_0xb087('0x4a')](_0x3114ce[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x3114ce[_0xb087('0x43')],function(_0x3e58be){var _0xbe2a4c={};_0xbe2a4c[_0x3e58be]={'$like':'%'+_0x15ff29['query'][_0xb087('0x49')]+'%'};return _0xbe2a4c;})});}_0x3114ce=_['merge']({},_0x3114ce,_0x15ff29['options']);return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})[_0xb087('0x2f')](function(_0x3a446d){if(_0x3a446d){_0xf286de=_0x3a446d[_0xb087('0x45')];if(!_0x15ff29['query'][_0xb087('0x46')](_0xb087('0x7f'))){_0x3114ce['limit']=qs[_0xb087('0x27')](_0x15ff29['query']['limit']);_0x3114ce[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x15ff29[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})['then'](function(_0x3cf818){if(_0x3cf818){return _0x3cf818?{'count':_0xf286de,'rows':_0x3cf818}:null;}})[_0xb087('0x2f')](respondWithResult(_0x141859,null))[_0xb087('0x4e')](handleError(_0x141859,null));};exports[_0xb087('0x80')]=function(_0x48e2c6,_0x489b1f,_0x544a68){var _0x5ebb4f={};var _0x17f0af={};var _0x3296c9;var _0x10e4b6;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x48e2c6[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x489b1f,null))['then'](function(_0x5d45e7){if(_0x5d45e7){_0x3296c9=_0x5d45e7;_0x17f0af[_0xb087('0x3e')]=_[_0xb087('0x3f')](db[_0xb087('0x81')][_0xb087('0x3a')]);_0x17f0af['query']=_[_0xb087('0x3f')](_0x48e2c6['query']);_0x17f0af[_0xb087('0x41')]=_['intersection'](_0x17f0af[_0xb087('0x3e')],_0x17f0af[_0xb087('0x40')]);_0x5ebb4f[_0xb087('0x43')]=_[_0xb087('0x42')](_0x17f0af['model'],qs[_0xb087('0x44')](_0x48e2c6['query']['fields']));_0x5ebb4f['attributes']=_0x5ebb4f[_0xb087('0x43')]['length']?_0x5ebb4f[_0xb087('0x43')]:_0x17f0af[_0xb087('0x3e')];_0x5ebb4f[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x48')]);_0x5ebb4f[_0xb087('0x4c')]=qs[_0xb087('0x41')](_[_0xb087('0x7d')](_0x48e2c6[_0xb087('0x40')],_0x17f0af[_0xb087('0x41')]));if(_0x48e2c6[_0xb087('0x40')][_0xb087('0x49')]){_0x5ebb4f[_0xb087('0x4c')]=_[_0xb087('0x4a')](_0x5ebb4f[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x5ebb4f[_0xb087('0x43')],function(_0x4e42eb){var _0x15e2f9={};_0x15e2f9[_0x4e42eb]={'$like':'%'+_0x48e2c6['query'][_0xb087('0x49')]+'%'};return _0x15e2f9;})});}_0x5ebb4f=_[_0xb087('0x4a')]({},_0x5ebb4f,_0x48e2c6[_0xb087('0x4f')]);return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})[_0xb087('0x2f')](function(_0x2e4d22){if(_0x2e4d22){_0x10e4b6=_0x2e4d22[_0xb087('0x45')];if(!_0x48e2c6['query']['hasOwnProperty']('nolimit')){_0x5ebb4f[_0xb087('0x27')]=qs[_0xb087('0x27')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x27')]);_0x5ebb4f[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})['then'](function(_0x2de517){if(_0x2de517){return _0x2de517?{'count':_0x10e4b6,'rows':_0x2de517}:null;}})['then'](respondWithResult(_0x489b1f,null))[_0xb087('0x4e')](handleError(_0x489b1f,null));};exports[_0xb087('0x82')]=function(_0x597d80,_0x4c3aef,_0x2f2597){var _0x2ae274=_0x597d80[_0xb087('0x6f')][_0xb087('0x75')];var _0x5069f2;return db[_0xb087('0x81')][_0xb087('0x83')]({'where':{'id':_0x2ae274},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb087('0x36'),'online','voicePause',_0xb087('0x84')],'raw':!![]}]})['then'](function(_0x4059ac){if(_0x4059ac){_0x5069f2=_0x4059ac;var _0x12976c=_[_0xb087('0x85')](_0x4059ac,function(_0x1e48cc){var _0x2de831=_0x1e48cc[_0xb087('0x30')]({'plain':!![]});return _0x2de831[_0xb087('0x86')];});return db[_0xb087('0x39')]['find']({'where':{'id':_0x597d80[_0xb087('0x73')]['id']}})['then'](function(_0x5acf13){return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x1fdb0f){return _0x5acf13['addTeams'](_0x2ae274,{'transaction':_0x1fdb0f})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x5069f2,function(_0x313d4b){return db[_0xb087('0x88')]['upsert']({'TeamId':_0x313d4b['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},{'transaction':_0x1fdb0f});});})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x12976c,function(_0x46f5e6){return db[_0xb087('0x89')][_0xb087('0x8a')]({'where':{'UserId':_0x46f5e6['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},'transaction':_0x1fdb0f});});})['then'](function(){_0x12976c[_0xb087('0x8b')](function(_0xfc3490){socket[_0xb087('0x79')](_0xb087('0x8c'),{'UserId':_0xfc3490['id'],'VoicePrefixId':_0x5acf13['id']});});});});});}})[_0xb087('0x2f')](respondWithStatusCode(_0x4c3aef,null))[_0xb087('0x4e')](handleError(_0x4c3aef,null));};exports['removeTeams']=function(_0x44c8cb,_0x15bbda,_0x149020){return db['Team']['findAll']({'where':{'id':_0x44c8cb[_0xb087('0x40')][_0xb087('0x75')]},'attributes':['id'],'include':[{'model':db[_0xb087('0x7c')],'as':_0xb087('0x86'),'attributes':['id'],'raw':!![]}]})[_0xb087('0x2f')](handleEntityNotFound(_0x15bbda,null))[_0xb087('0x2f')](function(_0x42528a){var _0x2795e9=_[_0xb087('0x38')](_0x42528a,'id');var _0xa58050=[];var _0x5ef263=[];var _0x1a7486=squel[_0xb087('0x8d')]();_0x1a7486[_0xb087('0x8e')](_0xb087('0x8f'))[_0xb087('0x90')]('team_has_voice_prefixes','tq')[_0xb087('0x91')](_0xb087('0x92'),'ut',_0xb087('0x93'))[_0xb087('0x4c')]('VoicePrefixId\x20=\x20?',_0x44c8cb[_0xb087('0x73')]['id']);for(var _0x547968=0x0;_0x547968<_0x42528a[_0xb087('0x45')];_0x547968+=0x1){let _0x532682=_0x42528a[_0x547968];for(var _0x5f4312=0x0;_0x5f4312<_0x532682[_0xb087('0x86')][_0xb087('0x45')];_0x5f4312+=0x1){let _0x1cb959=_0x532682['Agents'][_0x5f4312];var _0x595faa=_0x1a7486[_0xb087('0x94')]();_0x595faa[_0xb087('0x4c')](_0xb087('0x95'),_0x1cb959['id']);_0x5ef263[_0xb087('0x6b')](db[_0xb087('0x53')]['query'](_0x595faa[_0xb087('0x96')](),{'type':db[_0xb087('0x53')][_0xb087('0x97')][_0xb087('0x98')]})[_0xb087('0x2f')](function(_0x14737){if(_0x14737['length']===0x1){return _0x1cb959['id'];}else{var _0x5777d0=_[_0xb087('0x99')](_[_0xb087('0x38')](_0x14737,'TeamId'),function(_0x1f28dd){return _['includes'](_0x2795e9,_0x1f28dd);});if(_0x5777d0){return _0x1cb959['id'];}}}));}}return BPromise['all'](_0x5ef263)[_0xb087('0x2f')](function(_0x3193c8){_0xa58050=_(_0xa58050)[_0xb087('0x9a')](_0x3193c8)[_0xb087('0x9b')]()[_0xb087('0x9c')]();return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x44c8cb[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](function(_0xff9c0c){return db['sequelize']['transaction'](function(_0x5e704a){return _0xff9c0c[_0xb087('0x9d')](_0x44c8cb['query'][_0xb087('0x75')],{'transaction':_0x5e704a})['then'](function(){if(!_['isEmpty'](_0xa58050)){return _0xff9c0c[_0xb087('0x77')](_0xa58050,{'transaction':_0x5e704a});}})[_0xb087('0x2f')](function(){_0xa58050[_0xb087('0x8b')](function(_0x170d9e){socket[_0xb087('0x79')](_0xb087('0x7a'),{'UserId':_0x170d9e,'VoicePrefixId':_0xff9c0c['id']});});});});});});})[_0xb087('0x2f')](respondWithStatusCode(_0x15bbda,null))[_0xb087('0x4e')](handleError(_0x15bbda,null));}; \ No newline at end of file +var _0x4991=['VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','describe','create','transaction','body','VoiceExtension','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','NoOp','goto','context','charAt','system-','findById','addAgents','ids','omit','emit','isArray','userVoicePrefix:remove','getAgents','findOne','pick','getTeams','Team','findAll','User','interface','Agents','sequelize','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','every','includes','all','union','compact','value','isEmpty','removeAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map'];(function(_0x350034,_0x341770){var _0x303eb4=function(_0x306295){while(--_0x306295){_0x350034['push'](_0x350034['shift']());}};_0x303eb4(++_0x341770);}(_0x4991,0xf7));var _0x1499=function(_0x563104,_0x3d0aba){_0x563104=_0x563104-0x0;var _0x4897b4=_0x4991[_0x563104];return _0x4897b4;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1499('0x17')]=_[_0x1499('0x18')](config[_0x1499('0x17')],{'host':_0x1499('0x19'),'port':0x18eb});var socket=require(_0x1499('0x1a'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x1499('0x1b')](socket);function respondWithStatusCode(_0x4e5195,_0x37d99e){_0x37d99e=_0x37d99e||0xcc;return function(_0x12cde0){if(_0x12cde0){return _0x4e5195[_0x1499('0x1c')](_0x37d99e);}return _0x4e5195[_0x1499('0x1d')](_0x37d99e)['end']();};}function respondWithResult(_0x1ed43b,_0x373f57){_0x373f57=_0x373f57||0xc8;return function(_0x592c27){if(_0x592c27){return _0x1ed43b[_0x1499('0x1d')](_0x373f57)[_0x1499('0x1e')](_0x592c27);}};}function respondWithFilteredResult(_0x46b364,_0xc92272){return function(_0x1e45a9){if(_0x1e45a9){var _0x27e533=typeof _0xc92272['offset']==='undefined'&&typeof _0xc92272['limit']===_0x1499('0x1f');var _0xad534b=_0x1e45a9['count'];var _0x351da9=_0x27e533?0x0:_0xc92272[_0x1499('0x20')];var _0x28dff3=_0x27e533?_0x1e45a9[_0x1499('0x21')]:_0xc92272[_0x1499('0x20')]+_0xc92272[_0x1499('0x22')];var _0x2b0458;if(_0x28dff3>=_0xad534b){_0x28dff3=_0xad534b;_0x2b0458=0xc8;}else{_0x2b0458=0xce;}_0x46b364[_0x1499('0x1d')](_0x2b0458);return _0x46b364[_0x1499('0x23')](_0x1499('0x24'),_0x351da9+'-'+_0x28dff3+'/'+_0xad534b)[_0x1499('0x1e')](_0x1e45a9);}return null;};}function patchUpdates(_0x836081){return function(_0x223f4c){try{jsonpatch[_0x1499('0x25')](_0x223f4c,_0x836081,!![]);}catch(_0x4ec57a){return BPromise[_0x1499('0x26')](_0x4ec57a);}return _0x223f4c[_0x1499('0x27')]();};}function saveUpdates(_0x5615b4,_0x258e9c){return function(_0xc79f69){if(_0xc79f69){return _0xc79f69[_0x1499('0x28')](_0x5615b4)[_0x1499('0x29')](function(_0x3968e0){return _0x3968e0;});}return null;};}function removeEntity(_0x16d036,_0x54f3c2){return function(_0x501c0d){if(_0x501c0d){return _0x501c0d[_0x1499('0x2a')]()[_0x1499('0x29')](function(){var _0x3b9259=_0x501c0d[_0x1499('0x2b')]({'plain':!![]});var _0x32782a='VoicePrefixes';return db[_0x1499('0x2c')]['destroy']({'where':{'type':_0x32782a,'resourceId':_0x3b9259['id']}})['then'](function(){return _0x501c0d;});})['then'](function(){_0x16d036[_0x1499('0x1d')](0xcc)[_0x1499('0x2d')]();});}};}function handleEntityNotFound(_0x40932a,_0x1b460b){return function(_0x3dad86){if(!_0x3dad86){_0x40932a[_0x1499('0x1c')](0x194);}return _0x3dad86;};}function handleError(_0x3dd534,_0x5d3ec5){_0x5d3ec5=_0x5d3ec5||0x1f4;return function(_0x180171){logger[_0x1499('0x2e')](_0x180171[_0x1499('0x2f')]);if(_0x180171['name']){delete _0x180171[_0x1499('0x30')];}_0x3dd534[_0x1499('0x1d')](_0x5d3ec5)['send'](_0x180171);};}exports[_0x1499('0x31')]=function(_0x72ad,_0x497efd){var _0x464c5a={},_0x2eda80={},_0x15cc57={'count':0x0,'rows':[]};var _0x39f74f=_[_0x1499('0x32')](db[_0x1499('0x33')][_0x1499('0x34')],function(_0x18b662){return{'name':_0x18b662[_0x1499('0x35')],'type':_0x18b662[_0x1499('0x36')][_0x1499('0x37')]};});_0x2eda80[_0x1499('0x38')]=_[_0x1499('0x32')](_0x39f74f,_0x1499('0x30'));_0x2eda80[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x72ad[_0x1499('0x39')]);_0x2eda80[_0x1499('0x3b')]=_[_0x1499('0x3c')](_0x2eda80[_0x1499('0x38')],_0x2eda80['query']);_0x464c5a[_0x1499('0x3d')]=_[_0x1499('0x3c')](_0x2eda80[_0x1499('0x38')],qs[_0x1499('0x3e')](_0x72ad[_0x1499('0x39')][_0x1499('0x3e')]));_0x464c5a[_0x1499('0x3d')]=_0x464c5a[_0x1499('0x3d')][_0x1499('0x3f')]?_0x464c5a[_0x1499('0x3d')]:_0x2eda80[_0x1499('0x38')];if(!_0x72ad['query']['hasOwnProperty'](_0x1499('0x40'))){_0x464c5a['limit']=qs[_0x1499('0x22')](_0x72ad['query'][_0x1499('0x22')]);_0x464c5a[_0x1499('0x20')]=qs[_0x1499('0x20')](_0x72ad[_0x1499('0x39')]['offset']);}_0x464c5a[_0x1499('0x41')]=qs['sort'](_0x72ad[_0x1499('0x39')][_0x1499('0x42')]);_0x464c5a[_0x1499('0x43')]=qs[_0x1499('0x3b')](_['pick'](_0x72ad[_0x1499('0x39')],_0x2eda80[_0x1499('0x3b')]),_0x39f74f);if(_0x72ad[_0x1499('0x39')][_0x1499('0x44')]){_0x464c5a['where']=_[_0x1499('0x45')](_0x464c5a['where'],{'$or':_[_0x1499('0x32')](_0x39f74f,function(_0x38f449){if(_0x38f449[_0x1499('0x36')]!==_0x1499('0x46')){var _0x3ed978={};_0x3ed978[_0x38f449[_0x1499('0x30')]]={'$like':'%'+_0x72ad[_0x1499('0x39')][_0x1499('0x44')]+'%'};return _0x3ed978;}})});}_0x464c5a=_[_0x1499('0x45')]({},_0x464c5a,_0x72ad[_0x1499('0x47')]);var _0x5ab521={'where':_0x464c5a[_0x1499('0x43')]};return db['VoicePrefix'][_0x1499('0x21')](_0x5ab521)[_0x1499('0x29')](function(_0x5646cf){_0x15cc57[_0x1499('0x21')]=_0x5646cf;if(_0x72ad[_0x1499('0x39')][_0x1499('0x48')]){_0x464c5a[_0x1499('0x49')]=[{'all':!![]}];}return db[_0x1499('0x33')]['findAll'](_0x464c5a);})['then'](function(_0x368fdb){_0x15cc57[_0x1499('0x4a')]=_0x368fdb;return _0x15cc57;})['then'](respondWithFilteredResult(_0x497efd,_0x464c5a))[_0x1499('0x4b')](handleError(_0x497efd,null));};exports[_0x1499('0x4c')]=function(_0x4a5529,_0x5de9b6){var _0x3814aa={'raw':![],'where':{'id':_0x4a5529[_0x1499('0x4d')]['id']}},_0x177147={};_0x177147['model']=_[_0x1499('0x3a')](db[_0x1499('0x33')][_0x1499('0x34')]);_0x177147[_0x1499('0x39')]=_['keys'](_0x4a5529[_0x1499('0x39')]);_0x177147[_0x1499('0x3b')]=_[_0x1499('0x3c')](_0x177147[_0x1499('0x38')],_0x177147['query']);_0x3814aa[_0x1499('0x3d')]=_[_0x1499('0x3c')](_0x177147[_0x1499('0x38')],qs['fields'](_0x4a5529['query'][_0x1499('0x3e')]));_0x3814aa['attributes']=_0x3814aa[_0x1499('0x3d')][_0x1499('0x3f')]?_0x3814aa[_0x1499('0x3d')]:_0x177147[_0x1499('0x38')];if(_0x4a5529[_0x1499('0x39')][_0x1499('0x48')]){_0x3814aa[_0x1499('0x49')]=[{'all':!![]}];}_0x3814aa=_['merge']({},_0x3814aa,_0x4a5529[_0x1499('0x47')]);return db['VoicePrefix'][_0x1499('0x4e')](_0x3814aa)[_0x1499('0x29')](handleEntityNotFound(_0x5de9b6,null))['then'](respondWithResult(_0x5de9b6,null))[_0x1499('0x4b')](handleError(_0x5de9b6,null));};exports[_0x1499('0x2a')]=function(_0x3de674,_0x4d1d24){return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x3de674[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x4d1d24,null))[_0x1499('0x29')](removeEntity(_0x4d1d24,null))[_0x1499('0x4b')](handleError(_0x4d1d24,null));};exports[_0x1499('0x4f')]=function(_0x3b7a6b,_0x28822a){return db[_0x1499('0x33')]['describe']()[_0x1499('0x29')](respondWithResult(_0x28822a,null))[_0x1499('0x4b')](handleError(_0x28822a,null));};exports[_0x1499('0x50')]=function(_0x4dc648,_0x339471){var _0x2a7614;return db['sequelize'][_0x1499('0x51')](function(_0x162ddb){return db['VoicePrefix'][_0x1499('0x50')](_0x4dc648[_0x1499('0x52')],{'transaction':_0x162ddb})[_0x1499('0x29')](function(_0x30b27b){_0x2a7614=_0x30b27b[_0x1499('0x2b')]({'plain':!![]});return db[_0x1499('0x53')][_0x1499('0x4e')]({'where':{'id':_0x2a7614['VoiceExtensionId']},'raw':!![]})[_0x1499('0x29')](function(_0x2a9f23){return createVoicePrefixExtensions(_0x2a7614,_0x2a9f23,_0x162ddb);});});})[_0x1499('0x29')](function(){var _0x175b8d=_0x4dc648['user']['get']({'plain':!![]});if(!_0x175b8d)throw new Error(_0x1499('0x54'));if(_0x175b8d[_0x1499('0x55')]==='user'){var _0x3c3a20=_0x2a7614;return db[_0x1499('0x56')][_0x1499('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x175b8d['userProfileId']},'raw':!![]})['then'](function(_0x308ce2){if(_0x308ce2&&_0x308ce2[_0x1499('0x57')]===0x0){return db[_0x1499('0x2c')]['create']({'name':_0x3c3a20[_0x1499('0x30')],'resourceId':_0x3c3a20['id'],'type':_0x308ce2['name'],'sectionId':_0x308ce2['id']},{})[_0x1499('0x29')](function(){return _0x2a7614;});}else{return _0x2a7614;}})[_0x1499('0x4b')](function(_0x2fc6f9){logger[_0x1499('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fc6f9);throw _0x2fc6f9;});}return _0x2a7614;})['then'](respondWithResult(_0x339471,null))['catch'](handleError(_0x339471,null));};function Extension(_0x403832,_0x42629d,_0x1e9261,_0x28866f){this['context']=_0x1499('0x58');this[_0x1499('0x59')]=_0x403832;this['app']=_0x1e9261;this[_0x1499('0x36')]='system';this[_0x1499('0x5a')]=_0x1499('0x5b');this[_0x1499('0x5c')]=_0x42629d;this['appdata']=_0x28866f;}function createVoicePrefixExtensions(_0x739e63,_0xca5326,_0x253706){return new BPromise(function(_0x5b2dab,_0x761610){var _0x3ff1ce=new Extension(formatPrefixName(_0x739e63[_0x1499('0x5d')]),0x1,'NoOp',_0x1499('0x5e'));_0x3ff1ce[_0x1499('0x5f')]=_0x739e63['id'];return db[_0x1499('0x53')][_0x1499('0x50')](_0x3ff1ce,{'transaction':_0x253706})[_0x1499('0x29')](function(_0x96a0ed){var _0x5c61dc=_0x96a0ed[_0x1499('0x2b')]({'plain':!![]});var _0x10b49f=_['map'](addVoicePrefixExtensions(_0x739e63,_0xca5326),function(_0x3839da){_0x3839da[_0x1499('0x60')]=_0x5c61dc['id'];_0x3839da[_0x1499('0x5f')]=_0x739e63['id'];return _0x3839da;});return db[_0x1499('0x53')][_0x1499('0x61')](_0x10b49f,{'transaction':_0x253706})[_0x1499('0x29')](function(_0x5e5ee4){if(!_0x5e5ee4){return _0x761610(_0x1499('0x62'));}else{return _0x5b2dab(_0x5e5ee4);}})[_0x1499('0x4b')](function(_0x4eec83){return _0x761610(_0x4eec83);});});;});};function addVoicePrefixExtensions(_0x4a0487,_0x1ff29d){var _0x314d88=[];var _0x502474=formatPrefixName(_0x4a0487[_0x1499('0x5d')]);_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x2,_0x1499('0x64'),_0x1499('0x65')+_0x4a0487[_0x1499('0x30')]));if(_0x4a0487['callerIdAll']){_0x314d88['push'](new Extension(_0x502474,0x3,_0x1499('0x64'),'PREFIX-CALLERIDALL='+_0x4a0487['callerIdAll']));}else{_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x3,_0x1499('0x66'),'No\x20callerid\x20available'));}_0x314d88[_0x1499('0x63')](new Extension(_0x502474,0x4,_0x1499('0x67'),_0x1ff29d[_0x1499('0x68')]+','+'${EXTEN:'+(0x8+_0x4a0487['name'][_0x1499('0x3f')])+'}'+','+0x1));return _0x314d88;}function formatPrefixName(_0x2f3a3a){var _0x256893='_';for(var _0x392f6f=0x0;_0x392f6f<_0x2f3a3a[_0x1499('0x3f')];_0x392f6f++){if(_0x2f3a3a['charAt'](_0x392f6f)=='-'){_0x256893+=_0x2f3a3a[_0x1499('0x69')](_0x392f6f);}else{_0x256893+='['+_0x2f3a3a[_0x1499('0x69')](_0x392f6f)+']';}}_0x256893+='.';return _0x256893;}exports['update']=function(_0x358a76,_0x20e5f3,_0x44d970){var _0x5741e5=_0x358a76[_0x1499('0x52')];_0x5741e5[_0x1499('0x5d')]=_0x1499('0x6a')+_0x5741e5[_0x1499('0x30')]+'-';return db['sequelize'][_0x1499('0x51')](function(_0x74e09b){return db[_0x1499('0x33')]['update'](_0x5741e5,{'where':{'id':_0x5741e5['id']},'transaction':_0x74e09b})[_0x1499('0x29')](function(){return db[_0x1499('0x53')][_0x1499('0x2a')]({'where':{'VoicePrefixId':_0x5741e5['id']},'transaction':_0x74e09b})[_0x1499('0x29')](function(){return db[_0x1499('0x53')][_0x1499('0x4e')]({'where':{'id':_0x5741e5['VoiceExtensionId']},'raw':!![]})[_0x1499('0x29')](function(_0x57e25b){return createVoicePrefixExtensions(_0x5741e5,_0x57e25b,_0x74e09b);});});});})['then'](function(){return db[_0x1499('0x33')][_0x1499('0x6b')](_0x5741e5['id']);})[_0x1499('0x29')](respondWithResult(_0x20e5f3,null))['catch'](handleError(_0x20e5f3,null));};exports['addAgents']=function(_0x320654,_0xb4a84b,_0x494d88){return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x320654[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0xb4a84b,null))[_0x1499('0x29')](function(_0x3f6f36){if(_0x3f6f36){return _0x3f6f36[_0x1499('0x6c')](_0x320654['body'][_0x1499('0x6d')],_[_0x1499('0x6e')](_0x320654['body'],[_0x1499('0x6d'),'id'])||{})['spread'](function(_0x25a8c4){for(var _0x375576=0x0;_0x375576<_0x320654[_0x1499('0x52')][_0x1499('0x6d')]['length'];_0x375576+=0x1){socket[_0x1499('0x6f')]('userVoicePrefix:save',{'UserId':Number(_0x320654[_0x1499('0x52')]['ids'][_0x375576]),'VoicePrefixId':Number(_0x320654[_0x1499('0x4d')]['id'])});}return _0x25a8c4;});}})[_0x1499('0x29')](respondWithResult(_0xb4a84b,null))[_0x1499('0x4b')](handleError(_0xb4a84b,null));};exports['removeAgents']=function(_0x2349d7,_0x44511c,_0x585fe8){return db['VoicePrefix'][_0x1499('0x4e')]({'where':{'id':_0x2349d7['params']['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x44511c,null))['then'](function(_0x917508){if(_0x917508){return _0x917508['removeAgents'](_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')])[_0x1499('0x29')](function(){if(_[_0x1499('0x70')](_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')])){for(var _0x114aea=0x0;_0x114aea<_0x2349d7[_0x1499('0x39')]['ids'][_0x1499('0x3f')];_0x114aea+=0x1){socket[_0x1499('0x6f')](_0x1499('0x71'),{'UserId':Number(_0x2349d7['query'][_0x1499('0x6d')][_0x114aea]),'VoicePrefixId':Number(_0x2349d7[_0x1499('0x4d')]['id'])});}}else{socket['emit'](_0x1499('0x71'),{'UserId':Number(_0x2349d7[_0x1499('0x39')][_0x1499('0x6d')]),'VoicePrefixId':Number(_0x2349d7[_0x1499('0x4d')]['id'])});}});}})[_0x1499('0x29')](respondWithStatusCode(_0x44511c,null))['catch'](handleError(_0x44511c,null));};exports[_0x1499('0x72')]=function(_0x53700c,_0x5ed058,_0x5cc567){var _0x2a0525={};var _0x362d8c={};var _0x419d9a;var _0x23dfc0;return db[_0x1499('0x33')][_0x1499('0x73')]({'where':{'id':_0x53700c['params']['id']}})['then'](handleEntityNotFound(_0x5ed058,null))[_0x1499('0x29')](function(_0x20e0d7){if(_0x20e0d7){_0x419d9a=_0x20e0d7;_0x362d8c['model']=_[_0x1499('0x3a')](db['User'][_0x1499('0x34')]);_0x362d8c['query']=_[_0x1499('0x3a')](_0x53700c['query']);_0x362d8c[_0x1499('0x3b')]=_['intersection'](_0x362d8c[_0x1499('0x38')],_0x362d8c[_0x1499('0x39')]);_0x2a0525['attributes']=_[_0x1499('0x3c')](_0x362d8c[_0x1499('0x38')],qs['fields'](_0x53700c[_0x1499('0x39')][_0x1499('0x3e')]));_0x2a0525[_0x1499('0x3d')]=_0x2a0525[_0x1499('0x3d')][_0x1499('0x3f')]?_0x2a0525[_0x1499('0x3d')]:_0x362d8c[_0x1499('0x38')];_0x2a0525['order']=qs[_0x1499('0x42')](_0x53700c[_0x1499('0x39')]['sort']);_0x2a0525[_0x1499('0x43')]=qs[_0x1499('0x3b')](_['pick'](_0x53700c[_0x1499('0x39')],_0x362d8c[_0x1499('0x3b')]));if(_0x53700c['query'][_0x1499('0x44')]){_0x2a0525[_0x1499('0x43')]=_[_0x1499('0x45')](_0x2a0525[_0x1499('0x43')],{'$or':_[_0x1499('0x32')](_0x2a0525[_0x1499('0x3d')],function(_0x1f4794){var _0x43b74b={};_0x43b74b[_0x1f4794]={'$like':'%'+_0x53700c['query'][_0x1499('0x44')]+'%'};return _0x43b74b;})});}_0x2a0525=_[_0x1499('0x45')]({},_0x2a0525,_0x53700c[_0x1499('0x47')]);return _0x419d9a[_0x1499('0x72')](_0x2a0525);}})[_0x1499('0x29')](function(_0x3fa3a4){if(_0x3fa3a4){_0x23dfc0=_0x3fa3a4['length'];if(!_0x53700c['query']['hasOwnProperty'](_0x1499('0x40'))){_0x2a0525[_0x1499('0x22')]=qs[_0x1499('0x22')](_0x53700c[_0x1499('0x39')][_0x1499('0x22')]);_0x2a0525[_0x1499('0x20')]=qs[_0x1499('0x20')](_0x53700c[_0x1499('0x39')]['offset']);}return _0x419d9a[_0x1499('0x72')](_0x2a0525);}})[_0x1499('0x29')](function(_0x59a12f){if(_0x59a12f){return _0x59a12f?{'count':_0x23dfc0,'rows':_0x59a12f}:null;}})['then'](respondWithResult(_0x5ed058,null))[_0x1499('0x4b')](handleError(_0x5ed058,null));};exports['getTeams']=function(_0x52282e,_0x5666f5,_0x63c7b3){var _0x118d7a={};var _0x23fd46={};var _0x30ba76;var _0x3c91d2;return db['VoicePrefix']['findOne']({'where':{'id':_0x52282e[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](handleEntityNotFound(_0x5666f5,null))[_0x1499('0x29')](function(_0x497619){if(_0x497619){_0x30ba76=_0x497619;_0x23fd46[_0x1499('0x38')]=_['keys'](db['Team'][_0x1499('0x34')]);_0x23fd46['query']=_[_0x1499('0x3a')](_0x52282e['query']);_0x23fd46[_0x1499('0x3b')]=_['intersection'](_0x23fd46[_0x1499('0x38')],_0x23fd46[_0x1499('0x39')]);_0x118d7a['attributes']=_[_0x1499('0x3c')](_0x23fd46['model'],qs[_0x1499('0x3e')](_0x52282e[_0x1499('0x39')][_0x1499('0x3e')]));_0x118d7a[_0x1499('0x3d')]=_0x118d7a[_0x1499('0x3d')][_0x1499('0x3f')]?_0x118d7a[_0x1499('0x3d')]:_0x23fd46[_0x1499('0x38')];_0x118d7a[_0x1499('0x41')]=qs[_0x1499('0x42')](_0x52282e[_0x1499('0x39')][_0x1499('0x42')]);_0x118d7a[_0x1499('0x43')]=qs['filters'](_[_0x1499('0x74')](_0x52282e[_0x1499('0x39')],_0x23fd46[_0x1499('0x3b')]));if(_0x52282e[_0x1499('0x39')]['filter']){_0x118d7a[_0x1499('0x43')]=_[_0x1499('0x45')](_0x118d7a['where'],{'$or':_['map'](_0x118d7a[_0x1499('0x3d')],function(_0x1fbf21){var _0x2d4e5a={};_0x2d4e5a[_0x1fbf21]={'$like':'%'+_0x52282e[_0x1499('0x39')][_0x1499('0x44')]+'%'};return _0x2d4e5a;})});}_0x118d7a=_[_0x1499('0x45')]({},_0x118d7a,_0x52282e[_0x1499('0x47')]);return _0x30ba76[_0x1499('0x75')](_0x118d7a);}})[_0x1499('0x29')](function(_0x2dd404){if(_0x2dd404){_0x3c91d2=_0x2dd404['length'];if(!_0x52282e['query']['hasOwnProperty'](_0x1499('0x40'))){_0x118d7a[_0x1499('0x22')]=qs[_0x1499('0x22')](_0x52282e[_0x1499('0x39')][_0x1499('0x22')]);_0x118d7a[_0x1499('0x20')]=qs['offset'](_0x52282e[_0x1499('0x39')][_0x1499('0x20')]);}return _0x30ba76[_0x1499('0x75')](_0x118d7a);}})['then'](function(_0x4a11e4){if(_0x4a11e4){return _0x4a11e4?{'count':_0x3c91d2,'rows':_0x4a11e4}:null;}})[_0x1499('0x29')](respondWithResult(_0x5666f5,null))[_0x1499('0x4b')](handleError(_0x5666f5,null));};exports['addTeams']=function(_0x47f7e8,_0x4e5f60,_0x2f9c93){var _0x23e2c6=_0x47f7e8['body'][_0x1499('0x6d')];var _0x7dd273;return db[_0x1499('0x76')][_0x1499('0x77')]({'where':{'id':_0x23e2c6},'attributes':['id'],'include':[{'model':db[_0x1499('0x78')],'as':'Agents','attributes':['id','name','online','voicePause',_0x1499('0x79')],'raw':!![]}]})[_0x1499('0x29')](function(_0x14e4e8){if(_0x14e4e8){_0x7dd273=_0x14e4e8;var _0x5a675b=_['flatMap'](_0x14e4e8,function(_0x479936){var _0x2add75=_0x479936[_0x1499('0x2b')]({'plain':!![]});return _0x2add75[_0x1499('0x7a')];});return db[_0x1499('0x33')][_0x1499('0x4e')]({'where':{'id':_0x47f7e8[_0x1499('0x4d')]['id']}})[_0x1499('0x29')](function(_0x420576){return db[_0x1499('0x7b')]['transaction'](function(_0x3f5aab){return _0x420576['addTeams'](_0x23e2c6,{'transaction':_0x3f5aab})[_0x1499('0x29')](function(){return BPromise[_0x1499('0x7c')](_0x7dd273,function(_0x425dac){return db[_0x1499('0x7d')][_0x1499('0x7e')]({'TeamId':_0x425dac['id'],'VoicePrefixId':_0x47f7e8[_0x1499('0x4d')]['id']},{'transaction':_0x3f5aab});});})[_0x1499('0x29')](function(){return BPromise['each'](_0x5a675b,function(_0x56507a){return db[_0x1499('0x7f')][_0x1499('0x80')]({'where':{'UserId':_0x56507a['id'],'VoicePrefixId':_0x47f7e8['params']['id']},'transaction':_0x3f5aab});});})[_0x1499('0x29')](function(){_0x5a675b[_0x1499('0x81')](function(_0x477bb9){socket['emit']('userVoicePrefix:save',{'UserId':_0x477bb9['id'],'VoicePrefixId':_0x420576['id']});});});});});}})[_0x1499('0x29')](respondWithStatusCode(_0x4e5f60,null))['catch'](handleError(_0x4e5f60,null));};exports[_0x1499('0x82')]=function(_0x3f366a,_0x11ef6,_0x548faf){return db['Team']['findAll']({'where':{'id':_0x3f366a[_0x1499('0x39')][_0x1499('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1499('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x11ef6,null))['then'](function(_0x10f4cf){var _0x5d1170=_['map'](_0x10f4cf,'id');var _0x52de11=[];var _0x2e39ac=[];var _0x4a9e81=squel[_0x1499('0x83')]();_0x4a9e81[_0x1499('0x84')](_0x1499('0x85'))[_0x1499('0x86')](_0x1499('0x87'),'tq')['join'](_0x1499('0x88'),'ut',_0x1499('0x89'))[_0x1499('0x43')]('VoicePrefixId\x20=\x20?',_0x3f366a[_0x1499('0x4d')]['id']);for(var _0x772b0c=0x0;_0x772b0c<_0x10f4cf[_0x1499('0x3f')];_0x772b0c+=0x1){let _0x27135a=_0x10f4cf[_0x772b0c];for(var _0x1e9c28=0x0;_0x1e9c28<_0x27135a[_0x1499('0x7a')][_0x1499('0x3f')];_0x1e9c28+=0x1){let _0x2c1793=_0x27135a['Agents'][_0x1e9c28];var _0x39d6a9=_0x4a9e81[_0x1499('0x8a')]();_0x39d6a9[_0x1499('0x43')]('ut.UserId\x20=\x20?',_0x2c1793['id']);_0x2e39ac[_0x1499('0x63')](db[_0x1499('0x7b')][_0x1499('0x39')](_0x39d6a9[_0x1499('0x8b')](),{'type':db[_0x1499('0x7b')][_0x1499('0x8c')]['SELECT']})[_0x1499('0x29')](function(_0x18d9bc){if(_0x18d9bc['length']===0x1){return _0x2c1793['id'];}else{var _0x271d85=_[_0x1499('0x8d')](_[_0x1499('0x32')](_0x18d9bc,'TeamId'),function(_0x53659b){return _[_0x1499('0x8e')](_0x5d1170,_0x53659b);});if(_0x271d85){return _0x2c1793['id'];}}}));}}return BPromise[_0x1499('0x8f')](_0x2e39ac)[_0x1499('0x29')](function(_0x6478eb){_0x52de11=_(_0x52de11)[_0x1499('0x90')](_0x6478eb)[_0x1499('0x91')]()[_0x1499('0x92')]();return db[_0x1499('0x33')]['find']({'where':{'id':_0x3f366a['params']['id']}})['then'](function(_0x335af4){return db[_0x1499('0x7b')]['transaction'](function(_0x2c5702){return _0x335af4['removeTeams'](_0x3f366a[_0x1499('0x39')][_0x1499('0x6d')],{'transaction':_0x2c5702})['then'](function(){if(!_[_0x1499('0x93')](_0x52de11)){return _0x335af4[_0x1499('0x94')](_0x52de11,{'transaction':_0x2c5702});}})[_0x1499('0x29')](function(){_0x52de11['forEach'](function(_0x3e7f29){socket[_0x1499('0x6f')](_0x1499('0x71'),{'UserId':_0x3e7f29,'VoicePrefixId':_0x335af4['id']});});});});});});})[_0x1499('0x29')](respondWithStatusCode(_0x11ef6,null))[_0x1499('0x4b')](handleError(_0x11ef6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 1c547a9..28a5f6d 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 _0x87b9=['emit','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x87b9,0xfd));var _0x987b=function(_0x232ed2,_0xecec93){_0x232ed2=_0x232ed2-0x0;var _0xed677b=_0x87b9[_0x232ed2];return _0xed677b;};'use strict';var EventEmitter=require(_0x987b('0x0'));var VoicePrefix=require(_0x987b('0x1'))['db'][_0x987b('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x987b('0x3')](0x0);var events={'afterCreate':_0x987b('0x4'),'afterUpdate':_0x987b('0x5'),'afterDestroy':_0x987b('0x6')};function emitEvent(_0x1daced){return function(_0x183714,_0x20cb41,_0x32596a){VoicePrefixEvents[_0x987b('0x7')](_0x1daced+':'+_0x183714['id'],_0x183714);VoicePrefixEvents['emit'](_0x1daced,_0x183714);_0x32596a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x987b('0x8')](e,emitEvent(event));}}module[_0x987b('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0xe30a=['../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x203253,_0x174f74){var _0x6f5831=function(_0x2741c9){while(--_0x2741c9){_0x203253['push'](_0x203253['shift']());}};_0x6f5831(++_0x174f74);}(_0xe30a,0x131));var _0xae30=function(_0x452863,_0x305598){_0x452863=_0x452863-0x0;var _0x2c0f8e=_0xe30a[_0x452863];return _0x2c0f8e;};'use strict';var EventEmitter=require(_0xae30('0x0'));var VoicePrefix=require(_0xae30('0x1'))['db'][_0xae30('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xae30('0x3')](0x0);var events={'afterCreate':_0xae30('0x4'),'afterUpdate':'update','afterDestroy':_0xae30('0x5')};function emitEvent(_0x2edf2c){return function(_0x44e417,_0x1e86fe,_0x39da5a){VoicePrefixEvents['emit'](_0x2edf2c+':'+_0x44e417['id'],_0x44e417);VoicePrefixEvents[_0xae30('0x6')](_0x2edf2c,_0x44e417);_0x39da5a(null);};}for(var e in events){if(events[_0xae30('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xae30('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 3fe5a8d..e526db9 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 _0x706a=['voice_prefixes','lodash','util','../../config/logger','api','bluebird','path','rimraf','define'];(function(_0x478d72,_0x2d6b7a){var _0x5ef7cf=function(_0x199aea){while(--_0x199aea){_0x478d72['push'](_0x478d72['shift']());}};_0x5ef7cf(++_0x2d6b7a);}(_0x706a,0x1c3));var _0xa706=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0x706a[_0x376db5];return _0x304c17;};'use strict';var _=require(_0xa706('0x0'));var util=require(_0xa706('0x1'));var logger=require(_0xa706('0x2'))(_0xa706('0x3'));var moment=require('moment');var BPromise=require(_0xa706('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa706('0x5'));var rimraf=require(_0xa706('0x6'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x2a9410,_0xf36b67){return _0x2a9410[_0xa706('0x7')]('VoicePrefix',attributes,{'tableName':_0xa706('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x583f=['api','moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','util','../../config/logger'];(function(_0x286e63,_0x90bf8f){var _0x4535eb=function(_0x1d71b4){while(--_0x1d71b4){_0x286e63['push'](_0x286e63['shift']());}};_0x4535eb(++_0x90bf8f);}(_0x583f,0x195));var _0xf583=function(_0x3eef60,_0x9eb279){_0x3eef60=_0x3eef60-0x0;var _0x569efe=_0x583f[_0x3eef60];return _0x569efe;};'use strict';var _=require('lodash');var util=require(_0xf583('0x0'));var logger=require(_0xf583('0x1'))(_0xf583('0x2'));var moment=require(_0xf583('0x3'));var BPromise=require('bluebird');var rp=require(_0xf583('0x4'));var fs=require('fs');var path=require(_0xf583('0x5'));var rimraf=require(_0xf583('0x6'));var config=require(_0xf583('0x7'));var attributes=require(_0xf583('0x8'));module[_0xf583('0x9')]=function(_0x68ae7a,_0x3f3505){return _0x68ae7a['define'](_0xf583('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 6397242..cfe8bda 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 _0x3714=['rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0x3714,0x95));var _0x4371=function(_0x209552,_0x170123){_0x209552=_0x209552-0x0;var _0x19a185=_0x3714[_0x209552];return _0x19a185;};'use strict';var _=require(_0x4371('0x0'));var util=require(_0x4371('0x1'));var moment=require('moment');var BPromise=require(_0x4371('0x2'));var rs=require(_0x4371('0x3'));var fs=require('fs');var Redis=require(_0x4371('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4371('0x5'));var logger=require(_0x4371('0x6'))(_0x4371('0x7'));var config=require('../../config/environment');var jayson=require(_0x4371('0x8'));var client=jayson['client'][_0x4371('0x9')]({'port':0x232a});config[_0x4371('0xa')]=_['defaults'](config[_0x4371('0xa')],{'host':_0x4371('0xb'),'port':0x18eb});var socket=require(_0x4371('0xc'))(new Redis(config[_0x4371('0xa')]));require('./voicePrefix.socket')[_0x4371('0xd')](socket);function respondWithRpcPromise(_0x54c547,_0x38842e,_0x80ea6e){return new BPromise(function(_0x1bf105,_0x3dedb6){return client['request'](_0x54c547,_0x80ea6e)[_0x4371('0xe')](function(_0x263143){logger['info'](_0x4371('0xf'),_0x38842e,_0x4371('0x10'));logger[_0x4371('0x11')](_0x4371('0x12'),_0x38842e,_0x4371('0x10'),JSON[_0x4371('0x13')](_0x263143));if(_0x263143[_0x4371('0x14')]){if(_0x263143[_0x4371('0x14')][_0x4371('0x15')]===0x1f4){logger[_0x4371('0x14')](_0x4371('0xf'),_0x38842e,_0x263143['error'][_0x4371('0x16')]);return _0x3dedb6(_0x263143[_0x4371('0x14')][_0x4371('0x16')]);}logger['error'](_0x4371('0xf'),_0x38842e,_0x263143[_0x4371('0x14')][_0x4371('0x16')]);return _0x1bf105(_0x263143[_0x4371('0x14')][_0x4371('0x16')]);}else{logger[_0x4371('0x17')](_0x4371('0xf'),_0x38842e,_0x4371('0x10'));_0x1bf105(_0x263143[_0x4371('0x18')][_0x4371('0x16')]);}})[_0x4371('0x19')](function(_0x31b07e){logger[_0x4371('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x38842e,_0x31b07e);_0x3dedb6(_0x31b07e);});});} \ No newline at end of file +var _0xee8f=['then','info','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','VoicePrefix,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voicePrefix.socket','request'];(function(_0x2bb398,_0xd7c0dc){var _0x4dfefc=function(_0x20b088){while(--_0x20b088){_0x2bb398['push'](_0x2bb398['shift']());}};_0x4dfefc(++_0xd7c0dc);}(_0xee8f,0x1ed));var _0xfee8=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xee8f[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0xfee8('0x0'));var moment=require('moment');var BPromise=require(_0xfee8('0x1'));var rs=require(_0xfee8('0x2'));var fs=require('fs');var Redis=require(_0xfee8('0x3'));var db=require(_0xfee8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfee8('0x5'));var jayson=require(_0xfee8('0x6'));var client=jayson[_0xfee8('0x7')]['http']({'port':0x232a});config[_0xfee8('0x8')]=_[_0xfee8('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfee8('0xa'))(new Redis(config[_0xfee8('0x8')]));require(_0xfee8('0xb'))['register'](socket);function respondWithRpcPromise(_0x4fc2e8,_0x301383,_0x24e24c){return new BPromise(function(_0xb76f6,_0x223b94){return client[_0xfee8('0xc')](_0x4fc2e8,_0x24e24c)[_0xfee8('0xd')](function(_0x3ec896){logger[_0xfee8('0xe')]('VoicePrefix,\x20%s,\x20%s',_0x301383,'request\x20sent');logger['debug'](_0xfee8('0xf'),_0x301383,_0xfee8('0x10'),JSON[_0xfee8('0x11')](_0x3ec896));if(_0x3ec896['error']){if(_0x3ec896['error'][_0xfee8('0x12')]===0x1f4){logger[_0xfee8('0x13')](_0xfee8('0x14'),_0x301383,_0x3ec896[_0xfee8('0x13')][_0xfee8('0x15')]);return _0x223b94(_0x3ec896[_0xfee8('0x13')][_0xfee8('0x15')]);}logger[_0xfee8('0x13')](_0xfee8('0x14'),_0x301383,_0x3ec896[_0xfee8('0x13')][_0xfee8('0x15')]);return _0xb76f6(_0x3ec896[_0xfee8('0x13')]['message']);}else{logger['info'](_0xfee8('0x14'),_0x301383,_0xfee8('0x10'));_0xb76f6(_0x3ec896['result'][_0xfee8('0x15')]);}})[_0xfee8('0x16')](function(_0x59c29e){logger[_0xfee8('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x301383,_0x59c29e);_0x223b94(_0x59c29e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2ccf739..fd4bed0 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 _0x74fd=['remove','update','emit','removeListener','voicePrefix:','./voicePrefix.events'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x74fd,0x8f));var _0xd74f=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0x74fd[_0x4d08b8];return _0x70214a;};'use strict';var VoicePrefixEvents=require(_0xd74f('0x0'));var events=['save',_0xd74f('0x1'),_0xd74f('0x2')];function createListener(_0x1562a0,_0x2377f2){return function(_0x3686d5){_0x2377f2[_0xd74f('0x3')](_0x1562a0,_0x3686d5);};}function removeListener(_0x12359c,_0x1037c0){return function(){VoicePrefixEvents[_0xd74f('0x4')](_0x12359c,_0x1037c0);};}exports['register']=function(_0x4bf975){for(var _0x19daee=0x0,_0xf8e312=events['length'];_0x19daee<_0xf8e312;_0x19daee++){var _0x43f684=events[_0x19daee];var _0x161599=createListener(_0xd74f('0x5')+_0x43f684,_0x4bf975);VoicePrefixEvents['on'](_0x43f684,_0x161599);}}; \ No newline at end of file +var _0xb43b=['./voicePrefix.events','save','update','emit','removeListener','length','voicePrefix:'];(function(_0x205123,_0x240ebe){var _0x5b69fb=function(_0x488aaf){while(--_0x488aaf){_0x205123['push'](_0x205123['shift']());}};_0x5b69fb(++_0x240ebe);}(_0xb43b,0x1b2));var _0xbb43=function(_0x272ba9,_0xca984e){_0x272ba9=_0x272ba9-0x0;var _0x216772=_0xb43b[_0x272ba9];return _0x216772;};'use strict';var VoicePrefixEvents=require(_0xbb43('0x0'));var events=[_0xbb43('0x1'),'remove',_0xbb43('0x2')];function createListener(_0x1995f8,_0x22bc86){return function(_0x4cf605){_0x22bc86[_0xbb43('0x3')](_0x1995f8,_0x4cf605);};}function removeListener(_0x41aff6,_0x351254){return function(){VoicePrefixEvents[_0xbb43('0x4')](_0x41aff6,_0x351254);};}exports['register']=function(_0x491fb9){for(var _0x378df5=0x0,_0x553520=events[_0xbb43('0x5')];_0x378df5<_0x553520;_0x378df5++){var _0x1ccd49=events[_0x378df5];var _0x2a2f11=createListener(_0xbb43('0x6')+_0x1ccd49,_0x491fb9);VoicePrefixEvents['on'](_0x1ccd49,_0x2a2f11);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 0c7867e..d930753 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(_0x2939d4,_0x5c3803){var _0x1c3312=function(_0x2e2d60){while(--_0x2e2d60){_0x2939d4['push'](_0x2939d4['shift']());}};_0x1c3312(++_0x5c3803);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x403599,_0x3e02c0){var _0x44f134=function(_0x464df5){while(--_0x464df5){_0x403599['push'](_0x403599['shift']());}};_0x44f134(++_0x3e02c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 a5df322..3f0cc51 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 _0x9928=['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)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','ENUM','outbound','inbound','STRING','default','ringall','leastrecent','random','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9928,0x1dc));var _0x8992=function(_0x1c83c9,_0x2a0efc){_0x1c83c9=_0x1c83c9-0x0;var _0x49c840=_0x9928[_0x1c83c9];return _0x49c840;};'use strict';var Sequelize=require('sequelize');module[_0x8992('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8992('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8992('0x2')]('inbound',_0x8992('0x3')),'allowNull':![],'defaultValue':_0x8992('0x4')},'musiconhold':{'type':Sequelize[_0x8992('0x5')],'defaultValue':_0x8992('0x6')},'announce':{'type':Sequelize[_0x8992('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8992('0x2')]('rr',_0x8992('0x7'),_0x8992('0x8'),'fewestcalls',_0x8992('0x9'),_0x8992('0xa'),'linear',_0x8992('0xb'),_0x8992('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x529406){this[_0x8992('0xd')](_0x8992('0xe'),_0x529406?_0x529406:_0x8992('0xa'));},'get':function(){var _0x337f29=this[_0x8992('0xf')]('type');var _0x326e15=this[_0x8992('0xf')](_0x8992('0x10'));var _0x38e18f=this['getDataValue'](_0x8992('0xe'));if(_0x337f29===_0x8992('0x4')){return _0x38e18f;}if(_0x326e15===_0x8992('0x11')&&_0x38e18f==='rrmemory'||_0x326e15==='booked'&&_0x38e18f===_0x8992('0x12')){return _0x38e18f;}if(_0x326e15===_0x8992('0x13')||_0x326e15===_0x8992('0x14')||_0x326e15===_0x8992('0x15')){return _0x38e18f;}return null;}},'servicelevel':{'type':Sequelize[_0x8992('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8992('0x16')](0xb)},'timeout':{'type':Sequelize[_0x8992('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8992('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8992('0x5')]},'weight':{'type':Sequelize[_0x8992('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8992('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no'),'defaultValue':_0x8992('0x17')},'autopause':{'type':Sequelize[_0x8992('0x2')]('yes','no',_0x8992('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8992('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x8992('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x8992('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8992('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8992('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8992('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8992('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8992('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no',_0x8992('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8992('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x8992('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8992('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x8992('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8992('0x5')]},'queue_youarenext':{'type':Sequelize[_0x8992('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8992('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8992('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8992('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8992('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8992('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8992('0x5')]},'queue_quantity1':{'type':Sequelize[_0x8992('0x5')]},'queue_quantity2':{'type':Sequelize[_0x8992('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x8992('0x5')]},'queue_less_than':{'type':Sequelize[_0x8992('0x5')]},'periodic_announce':{'type':Sequelize[_0x8992('0x1a')],'set':function(_0x363b76){this[_0x8992('0xd')](_0x8992('0x1b'),_0x363b76?_0x363b76[_0x8992('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0x8992('0x1b'))?this[_0x8992('0xf')](_0x8992('0x1b'))[_0x8992('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x8992('0x5')],'defaultValue':'yes','set':function(_0x3303f2){this[_0x8992('0xd')](_0x8992('0x1e'),_0x3303f2?_0x3303f2[_0x8992('0x1c')](','):undefined);},'get':function(){return this[_0x8992('0xf')]('joinempty')?this[_0x8992('0xf')](_0x8992('0x1e'))[_0x8992('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0xed0b5c){this[_0x8992('0xd')]('leavewhenempty',_0xed0b5c?_0xed0b5c[_0x8992('0x1c')](','):undefined);},'get':function(){return this[_0x8992('0xf')](_0x8992('0x1f'))?this[_0x8992('0xf')](_0x8992('0x1f'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x8992('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8992('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8992('0x5')]},'description':{'type':Sequelize[_0x8992('0x5')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x30fc85){this['setDataValue'](_0x8992('0x20'),_0x30fc85);if(_0x30fc85){if(this['getDataValue'](_0x8992('0x21'))<0x2){this[_0x8992('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8992('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8992('0x22')],'defaultValue':0x0,'comment':_0x8992('0x23')},'dialMethod':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x24'),_0x8992('0x13'),'power',_0x8992('0x14'),_0x8992('0x11')),'defaultValue':_0x8992('0x13'),'comment':_0x8992('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8992('0x26')},'dialLimitQueue':{'type':Sequelize[_0x8992('0x16')](0x4)[_0x8992('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8992('0x28')},'dialPowerLevel':{'type':Sequelize[_0x8992('0x29')](0x2)[_0x8992('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8992('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x2b'),_0x8992('0x2c')),'defaultValue':_0x8992('0x2c'),'comment':_0x8992('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8992('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8992('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8992('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8992('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x8992('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8992('0x31')},'dialQueueProject':{'type':Sequelize[_0x8992('0x5')],'comment':_0x8992('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8992('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8992('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8992('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8992('0x35')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8992('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8992('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x3,'comment':_0x8992('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8992('0x16')](0x5)[_0x8992('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8992('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8992('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x8992('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8992('0x5')],'defaultValue':_0x8992('0x39')},'dialPrefix':{'type':Sequelize[_0x8992('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x3a'),_0x8992('0x3b'),_0x8992('0x3c')),'defaultValue':_0x8992('0x3a')},'dialAMDActive':{'type':Sequelize[_0x8992('0x22')],'defaultValue':0x0,'comment':_0x8992('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0x8992('0x16')](0x9)[_0x8992('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8992('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0x8992('0x16')](0x9)[_0x8992('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8992('0x16')](0x9)[_0x8992('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8992('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8992('0x16')](0x9)[_0x8992('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8992('0x40')},'dialAMDMinWordLength':{'type':Sequelize[_0x8992('0x16')](0x9)[_0x8992('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8992('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8992('0x16')](0x9)[_0x8992('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8992('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8992('0x16')](0x9)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8992('0x43')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8992('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8992('0x44')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8992('0x16')](0x9)[_0x8992('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8992('0x45')},'dialRecallMeTimeout':{'type':Sequelize[_0x8992('0x16')](0x5)[_0x8992('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8992('0x46')},'dialRecallInQueue':{'type':Sequelize[_0x8992('0x22')],'defaultValue':0x0,'comment':_0x8992('0x47')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8992('0x2')](_0x8992('0x48'),_0x8992('0x49')),'defaultValue':_0x8992('0x48')},'dialQueueProject2':{'type':Sequelize[_0x8992('0x5')],'comment':_0x8992('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8992('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8992('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8992('0x4a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8992('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8992('0x4b')},'dialDropMaxRetry':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8992('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x8992('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8992('0x4d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8992('0x4e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8992('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8992('0x4f')},'dialMachineMaxRetry':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8992('0x50')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8992('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8992('0x51')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8992('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8992('0x16')](0x5)[_0x8992('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8992('0x52')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8992('0x16')],'allowNull':!![],'comment':_0x8992('0x53')},'mandatoryDisposition':{'type':Sequelize[_0x8992('0x22')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4c9e10){if(!_0x4c9e10)this[_0x8992('0xd')](_0x8992('0x54'),null);this[_0x8992('0xd')](_0x8992('0x55'),_0x4c9e10);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8992('0x22')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8992('0x16')](0x3)[_0x8992('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8992('0x22')],'defaultValue':![]}}; \ No newline at end of file +var _0xea88=['STRING','name','ENUM','outbound','inbound','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','dialMethod','getDataValue','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','joinempty','join','split','leavewhenempty','acw','BOOLEAN','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','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)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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)','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x95e7d4,_0x2ef58b){var _0x2c9559=function(_0x2de6b8){while(--_0x2de6b8){_0x95e7d4['push'](_0x95e7d4['shift']());}};_0x2c9559(++_0x2ef58b);}(_0xea88,0x146));var _0x8ea8=function(_0x59fcb0,_0x584977){_0x59fcb0=_0x59fcb0-0x0;var _0x44af41=_0xea88[_0x59fcb0];return _0x44af41;};'use strict';var Sequelize=require(_0x8ea8('0x0'));module[_0x8ea8('0x1')]={'name':{'type':Sequelize[_0x8ea8('0x2')],'allowNull':![],'unique':_0x8ea8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8ea8('0x4')]('inbound',_0x8ea8('0x5')),'allowNull':![],'defaultValue':_0x8ea8('0x6')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x8ea8('0x4')]('rr','ringall',_0x8ea8('0x7'),_0x8ea8('0x8'),_0x8ea8('0x9'),_0x8ea8('0xa'),_0x8ea8('0xb'),_0x8ea8('0xc'),_0x8ea8('0xd')),'allowNull':![],'defaultValue':_0x8ea8('0xe'),'set':function(_0x458490){this[_0x8ea8('0xf')](_0x8ea8('0x10'),_0x458490?_0x458490:_0x8ea8('0xa'));},'get':function(){var _0x54e3d0=this['getDataValue']('type');var _0x16a222=this['getDataValue'](_0x8ea8('0x11'));var _0x4e342f=this[_0x8ea8('0x12')](_0x8ea8('0x10'));if(_0x54e3d0===_0x8ea8('0x6')){return _0x4e342f;}if(_0x16a222===_0x8ea8('0x13')&&_0x4e342f===_0x8ea8('0xa')||_0x16a222===_0x8ea8('0x13')&&_0x4e342f===_0x8ea8('0x14')){return _0x4e342f;}if(_0x16a222===_0x8ea8('0x15')||_0x16a222===_0x8ea8('0x16')||_0x16a222==='power'){return _0x4e342f;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8ea8('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8ea8('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8ea8('0x2')]},'weight':{'type':Sequelize[_0x8ea8('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8ea8('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8ea8('0x18')},'autopause':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no',_0x8ea8('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8ea8('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8ea8('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8ea8('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8ea8('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8ea8('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':_0x8ea8('0x18')},'announce_holdtime':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no',_0x8ea8('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x8ea8('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8ea8('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8ea8('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x8ea8('0x2')]},'queue_quantity2':{'type':Sequelize[_0x8ea8('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x8ea8('0x2')]},'queue_less_than':{'type':Sequelize[_0x8ea8('0x2')]},'periodic_announce':{'type':Sequelize[_0x8ea8('0x1b')],'set':function(_0x804028){this[_0x8ea8('0xf')]('periodic_announce',_0x804028?_0x804028['join'](','):[]);},'get':function(){return this[_0x8ea8('0x12')](_0x8ea8('0x1c'))?this[_0x8ea8('0x12')](_0x8ea8('0x1c'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':_0x8ea8('0x18'),'set':function(_0x516a82){this['setDataValue'](_0x8ea8('0x1d'),_0x516a82?_0x516a82[_0x8ea8('0x1e')](','):undefined);},'get':function(){return this[_0x8ea8('0x12')](_0x8ea8('0x1d'))?this['getDataValue'](_0x8ea8('0x1d'))[_0x8ea8('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4b1cf4){this[_0x8ea8('0xf')](_0x8ea8('0x20'),_0x4b1cf4?_0x4b1cf4[_0x8ea8('0x1e')](','):undefined);},'get':function(){return this[_0x8ea8('0x12')]('leavewhenempty')?this[_0x8ea8('0x12')](_0x8ea8('0x20'))[_0x8ea8('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8ea8('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8ea8('0x2')]},'description':{'type':Sequelize[_0x8ea8('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x1b3212){this['setDataValue'](_0x8ea8('0x21'),_0x1b3212);if(_0x1b3212){if(this[_0x8ea8('0x12')]('wrapuptime')<0x2){this[_0x8ea8('0xf')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8ea8('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8ea8('0x22')],'defaultValue':0x0,'comment':_0x8ea8('0x23')},'dialMethod':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x24'),_0x8ea8('0x15'),_0x8ea8('0x25'),_0x8ea8('0x16'),'booked'),'defaultValue':'progressive','comment':_0x8ea8('0x26')},'dialLimitChannel':{'type':Sequelize[_0x8ea8('0x17')](0x4)[_0x8ea8('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8ea8('0x28')},'dialLimitQueue':{'type':Sequelize[_0x8ea8('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8ea8('0x29')},'dialPowerLevel':{'type':Sequelize[_0x8ea8('0x2a')](0x2)[_0x8ea8('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8ea8('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x2c'),'dropRate'),'defaultValue':'dropRate','comment':_0x8ea8('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8ea8('0x2a')](0x2)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8ea8('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8ea8('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8ea8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8ea8('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ea8('0x30')},'dialQueueOptions':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':_0x8ea8('0x31'),'comment':_0x8ea8('0x32')},'dialQueueTimeout':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ea8('0x33')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ea8('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8ea8('0x17')](0x5)[_0x8ea8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ea8('0x35')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ea8('0x36')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8ea8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8ea8('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8ea8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ea8('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8ea8('0x39')},'dialTimezone':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x8ea8('0x3a')},'dialPrefix':{'type':Sequelize[_0x8ea8('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8ea8('0x4')](_0x8ea8('0x3b'),_0x8ea8('0x3c'),_0x8ea8('0x3d')),'defaultValue':_0x8ea8('0x3b')},'dialAMDActive':{'type':Sequelize[_0x8ea8('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x8ea8('0x17')](0x9)[_0x8ea8('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8ea8('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0x8ea8('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8ea8('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8ea8('0x17')](0x9)[_0x8ea8('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8ea8('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8ea8('0x17')](0x9)[_0x8ea8('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x8ea8('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8ea8('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8ea8('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8ea8('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8ea8('0x17')](0x9)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8ea8('0x43')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8ea8('0x17')](0x5)[_0x8ea8('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8ea8('0x44')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8ea8('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8ea8('0x45')},'dialRecallMeTimeout':{'type':Sequelize[_0x8ea8('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8ea8('0x46')},'dialRecallInQueue':{'type':Sequelize[_0x8ea8('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x8ea8('0x47'),'ASC'),'defaultValue':_0x8ea8('0x47')},'dialQueueProject2':{'type':Sequelize[_0x8ea8('0x2')],'comment':_0x8ea8('0x48')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8ea8('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8ea8('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8ea8('0x49')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8ea8('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8ea8('0x17')](0x5)[_0x8ea8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ea8('0x4a')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8ea8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ea8('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ea8('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ea8('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ea8('0x4e')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8ea8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ea8('0x4f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8ea8('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ea8('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8ea8('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1eef9c){if(!_0x1eef9c)this['setDataValue'](_0x8ea8('0x51'),null);this['setDataValue']('mandatoryDisposition',_0x1eef9c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8ea8('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8ea8('0x22')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8ea8('0x17')](0x3)[_0x8ea8('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index e056fed..50c8bae 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 _0x4ca4=['join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','union','isEmpty','UserVoiceQueueRt','emit','userVoiceQueue:remove','addAgents','spread','online','removeAgents','User','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','field','scheduledAt','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','value','includes','type','find','name','error','stack','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','role','getHoppers','findOne','CmHopper','hasOwnProperty','order','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','removeTeams','Team','ids','select','tq.TeamId','team_has_voice_queues'];(function(_0x221ba2,_0x79208){var _0x47d08e=function(_0xaf14ee){while(--_0xaf14ee){_0x221ba2['push'](_0x221ba2['shift']());}};_0x47d08e(++_0x79208);}(_0x4ca4,0x100));var _0x44ca=function(_0x241dfe,_0x509682){_0x241dfe=_0x241dfe-0x0;var _0x442e52=_0x4ca4[_0x241dfe];return _0x442e52;};'use strict';var emlformat=require(_0x44ca('0x0'));var rimraf=require(_0x44ca('0x1'));var zipdir=require(_0x44ca('0x2'));var jsonpatch=require(_0x44ca('0x3'));var rp=require(_0x44ca('0x4'));var moment=require(_0x44ca('0x5'));var BPromise=require(_0x44ca('0x6'));var Mustache=require(_0x44ca('0x7'));var util=require('util');var path=require(_0x44ca('0x8'));var sox=require(_0x44ca('0x9'));var csv=require(_0x44ca('0xa'));var ejs=require(_0x44ca('0xb'));var fs=require('fs');var fs_extra=require(_0x44ca('0xc'));var _=require(_0x44ca('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x44ca('0xe'));var toCsv=require(_0x44ca('0xa'));var querystring=require('querystring');var Papa=require(_0x44ca('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x44ca('0x10'));var as=require(_0x44ca('0x11'));var hardwareService=require(_0x44ca('0x12'));var logger=require(_0x44ca('0x13'))(_0x44ca('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x44ca('0x15'));var db=require(_0x44ca('0x16'))['db'];config['redis']=_['defaults'](config[_0x44ca('0x17')],{'host':_0x44ca('0x18'),'port':0x18eb});var socket=require(_0x44ca('0x19'))(new Redis(config[_0x44ca('0x17')]));require(_0x44ca('0x1a'))[_0x44ca('0x1b')](socket);function respondWithStatusCode(_0x14b5ee,_0x1ac17d){_0x1ac17d=_0x1ac17d||0xcc;return function(_0x4d1afe){if(_0x4d1afe){return _0x14b5ee[_0x44ca('0x1c')](_0x1ac17d);}return _0x14b5ee[_0x44ca('0x1d')](_0x1ac17d)['end']();};}function respondWithResult(_0x334e34,_0x2c7da3){_0x2c7da3=_0x2c7da3||0xc8;return function(_0x598619){if(_0x598619){return _0x334e34[_0x44ca('0x1d')](_0x2c7da3)[_0x44ca('0x1e')](_0x598619);}};}function respondWithFilteredResult(_0x1dc8ce,_0x1e4190){return function(_0x3bea76){if(_0x3bea76){var _0x3b4626=typeof _0x1e4190[_0x44ca('0x1f')]===_0x44ca('0x20')&&typeof _0x1e4190[_0x44ca('0x21')]==='undefined';var _0x1bc607=_0x3bea76[_0x44ca('0x22')];var _0x3fdfcc=_0x3b4626?0x0:_0x1e4190[_0x44ca('0x1f')];var _0x52cc6a=_0x3b4626?_0x3bea76[_0x44ca('0x22')]:_0x1e4190['offset']+_0x1e4190[_0x44ca('0x21')];var _0x18b932;if(_0x52cc6a>=_0x1bc607){_0x52cc6a=_0x1bc607;_0x18b932=0xc8;}else{_0x18b932=0xce;}_0x1dc8ce['status'](_0x18b932);return _0x1dc8ce[_0x44ca('0x23')](_0x44ca('0x24'),_0x3fdfcc+'-'+_0x52cc6a+'/'+_0x1bc607)[_0x44ca('0x1e')](_0x3bea76);}return null;};}function patchUpdates(_0x2ec184){return function(_0x510a2a){try{jsonpatch[_0x44ca('0x25')](_0x510a2a,_0x2ec184,!![]);}catch(_0x4d127b){return BPromise[_0x44ca('0x26')](_0x4d127b);}return _0x510a2a[_0x44ca('0x27')]();};}function saveUpdates(_0x4f93e0,_0x524246){return function(_0x4ef6a4){if(_0x4ef6a4){return _0x4ef6a4['update'](_0x4f93e0)[_0x44ca('0x28')](function(_0x15c454){return _0x15c454;});}return null;};}function removeEntity(_0x56181e,_0x117ba0){return function(_0xe25e10){if(_0xe25e10){return _0xe25e10[_0x44ca('0x29')]()[_0x44ca('0x28')](function(){var _0x43008b=_0xe25e10[_0x44ca('0x2a')]({'plain':!![]});var _0x247aa3=[{'name':_0x44ca('0x2b'),'value':_0x44ca('0x2c'),'ignore':![]},{'name':_0x44ca('0x2d'),'value':_0x44ca('0x2e'),'ignore':![]}];var _0x270336=_(_0x247aa3)['filter'](_0x44ca('0x2f'))['map'](_0x44ca('0x30'))['value']();if(_[_0x44ca('0x31')](_0x270336,_0x43008b[_0x44ca('0x32')])){return;}var _0x5db900=_[_0x44ca('0x33')](_0x247aa3,['value',_0x43008b['type']])[_0x44ca('0x34')];return db['UserProfileResource'][_0x44ca('0x29')]({'where':{'type':_0x5db900,'resourceId':_0x43008b['id']}})[_0x44ca('0x28')](function(){return _0xe25e10;});})[_0x44ca('0x28')](function(){_0x56181e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53a688,_0x101169){return function(_0x3f1a27){if(!_0x3f1a27){_0x53a688['sendStatus'](0x194);}return _0x3f1a27;};}function handleError(_0x42e11f,_0x4e0afe){_0x4e0afe=_0x4e0afe||0x1f4;return function(_0xd74e40){logger[_0x44ca('0x35')](_0xd74e40[_0x44ca('0x36')]);if(_0xd74e40[_0x44ca('0x34')]){delete _0xd74e40[_0x44ca('0x34')];}_0x42e11f[_0x44ca('0x1d')](_0x4e0afe)[_0x44ca('0x37')](_0xd74e40);};}exports[_0x44ca('0x38')]=function(_0x320d10,_0x1d158c){var _0x1f981d={},_0x31fad8={},_0x12c615={'count':0x0,'rows':[]};var _0x41f02e=_['map'](db['VoiceQueue'][_0x44ca('0x39')],function(_0x47c8df){return{'name':_0x47c8df[_0x44ca('0x3a')],'type':_0x47c8df['type'][_0x44ca('0x3b')]};});_0x31fad8[_0x44ca('0x3c')]=_[_0x44ca('0x3d')](_0x41f02e,_0x44ca('0x34'));_0x31fad8[_0x44ca('0x3e')]=_[_0x44ca('0x3f')](_0x320d10[_0x44ca('0x3e')]);_0x31fad8[_0x44ca('0x40')]=_[_0x44ca('0x41')](_0x31fad8[_0x44ca('0x3c')],_0x31fad8[_0x44ca('0x3e')]);_0x1f981d[_0x44ca('0x42')]=_[_0x44ca('0x41')](_0x31fad8[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x320d10[_0x44ca('0x3e')][_0x44ca('0x43')]));_0x1f981d[_0x44ca('0x42')]=_0x1f981d['attributes'][_0x44ca('0x44')]?_0x1f981d['attributes']:_0x31fad8[_0x44ca('0x3c')];if(!_0x320d10[_0x44ca('0x3e')]['hasOwnProperty'](_0x44ca('0x45'))){_0x1f981d[_0x44ca('0x21')]=qs[_0x44ca('0x21')](_0x320d10[_0x44ca('0x3e')]['limit']);_0x1f981d[_0x44ca('0x1f')]=qs[_0x44ca('0x1f')](_0x320d10[_0x44ca('0x3e')]['offset']);}_0x1f981d['order']=qs[_0x44ca('0x46')](_0x320d10[_0x44ca('0x3e')][_0x44ca('0x46')]);_0x1f981d[_0x44ca('0x47')]=qs[_0x44ca('0x40')](_[_0x44ca('0x48')](_0x320d10[_0x44ca('0x3e')],_0x31fad8[_0x44ca('0x40')]),_0x41f02e);if(_0x320d10[_0x44ca('0x3e')][_0x44ca('0x49')]){_0x1f981d[_0x44ca('0x47')]=_[_0x44ca('0x4a')](_0x1f981d[_0x44ca('0x47')],{'$or':_[_0x44ca('0x3d')](_0x41f02e,function(_0x10c8f8){if(_0x10c8f8['type']!==_0x44ca('0x4b')){var _0x444d29={};_0x444d29[_0x10c8f8[_0x44ca('0x34')]]={'$like':'%'+_0x320d10[_0x44ca('0x3e')][_0x44ca('0x49')]+'%'};return _0x444d29;}})});}_0x1f981d=_[_0x44ca('0x4a')]({},_0x1f981d,_0x320d10[_0x44ca('0x4c')]);var _0x466110={'where':_0x1f981d[_0x44ca('0x47')]};return db[_0x44ca('0x4d')][_0x44ca('0x22')](_0x466110)[_0x44ca('0x28')](function(_0x279569){_0x12c615[_0x44ca('0x22')]=_0x279569;if(_0x320d10[_0x44ca('0x3e')][_0x44ca('0x4e')]){_0x1f981d[_0x44ca('0x4f')]=[{'all':!![]}];}return db[_0x44ca('0x4d')][_0x44ca('0x50')](_0x1f981d);})[_0x44ca('0x28')](function(_0x5a5cd2){_0x12c615[_0x44ca('0x51')]=_0x5a5cd2;return _0x12c615;})[_0x44ca('0x28')](respondWithFilteredResult(_0x1d158c,_0x1f981d))[_0x44ca('0x52')](handleError(_0x1d158c,null));};exports[_0x44ca('0x53')]=function(_0x35d940,_0x5dc24d){var _0x232b25={'raw':![],'where':{'id':_0x35d940[_0x44ca('0x54')]['id']}},_0x1caf56={};_0x1caf56[_0x44ca('0x3c')]=_[_0x44ca('0x3f')](db[_0x44ca('0x4d')]['rawAttributes']);_0x1caf56['query']=_[_0x44ca('0x3f')](_0x35d940[_0x44ca('0x3e')]);_0x1caf56[_0x44ca('0x40')]=_[_0x44ca('0x41')](_0x1caf56[_0x44ca('0x3c')],_0x1caf56[_0x44ca('0x3e')]);_0x232b25[_0x44ca('0x42')]=_[_0x44ca('0x41')](_0x1caf56[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x35d940[_0x44ca('0x3e')][_0x44ca('0x43')]));_0x232b25['attributes']=_0x232b25['attributes'][_0x44ca('0x44')]?_0x232b25[_0x44ca('0x42')]:_0x1caf56[_0x44ca('0x3c')];if(_0x35d940['query'][_0x44ca('0x4e')]){_0x232b25['include']=[{'all':!![]}];}_0x232b25=_['merge']({},_0x232b25,_0x35d940[_0x44ca('0x4c')]);return db['VoiceQueue'][_0x44ca('0x33')](_0x232b25)[_0x44ca('0x28')](handleEntityNotFound(_0x5dc24d,null))[_0x44ca('0x28')](respondWithResult(_0x5dc24d,null))[_0x44ca('0x52')](handleError(_0x5dc24d,null));};exports[_0x44ca('0x55')]=function(_0x28e589,_0x17d755){return db[_0x44ca('0x4d')][_0x44ca('0x55')](_0x28e589['body'],{})['then'](function(_0x45cebb){var _0x4aa038=_0x28e589['user'][_0x44ca('0x2a')]({'plain':!![]});if(!_0x4aa038)throw new Error(_0x44ca('0x56'));if(_0x4aa038['role']===_0x44ca('0x57')){var _0x4903ab=_0x45cebb['get']({'plain':!![]});var _0x354757=[{'name':_0x44ca('0x2b'),'value':_0x44ca('0x2c')},{'name':_0x44ca('0x2d'),'value':_0x44ca('0x2e')}];var _0x8042c4=_['find'](_0x354757,[_0x44ca('0x30'),_0x4903ab[_0x44ca('0x32')]])[_0x44ca('0x34')];return db[_0x44ca('0x58')]['find']({'where':{'name':_0x8042c4,'userProfileId':_0x4aa038[_0x44ca('0x59')]},'raw':!![]})['then'](function(_0x1c796a){if(_0x1c796a&&_0x1c796a[_0x44ca('0x5a')]===0x0){return db[_0x44ca('0x5b')][_0x44ca('0x55')]({'name':_0x4903ab[_0x44ca('0x34')],'resourceId':_0x4903ab['id'],'type':_0x1c796a[_0x44ca('0x34')],'sectionId':_0x1c796a['id']},{})['then'](function(){return _0x45cebb;});}else{return _0x45cebb;}})[_0x44ca('0x52')](function(_0x4d3d7a){logger['error'](_0x44ca('0x5c'),_0x4d3d7a);throw _0x4d3d7a;});}return _0x45cebb;})[_0x44ca('0x28')](respondWithResult(_0x17d755,0xc9))[_0x44ca('0x52')](handleError(_0x17d755,null));};exports[_0x44ca('0x5d')]=function(_0x5d5276,_0x104b0c){var _0x4f9c32={'where':{'id':_0x5d5276[_0x44ca('0x54')]['id']}},_0x3b0f70={};_0x3b0f70[_0x44ca('0x3c')]=_[_0x44ca('0x3f')](db[_0x44ca('0x4d')][_0x44ca('0x39')]);_0x4f9c32['attributes']=_['intersection'](_0x3b0f70[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x5d5276['query'][_0x44ca('0x43')]));_0x4f9c32['attributes']=_0x4f9c32[_0x44ca('0x42')]['length']?_0x4f9c32[_0x44ca('0x42')]:_0x3b0f70[_0x44ca('0x3c')];if(_0x5d5276[_0x44ca('0x3e')][_0x44ca('0x4e')]){_0x4f9c32[_0x44ca('0x4f')]=[{'all':!![]}];}_0x4f9c32=_[_0x44ca('0x4a')]({},_0x4f9c32,_0x5d5276[_0x44ca('0x4c')]);return db[_0x44ca('0x4d')][_0x44ca('0x33')](_0x4f9c32)[_0x44ca('0x28')](handleEntityNotFound(_0x104b0c,null))[_0x44ca('0x28')](function(_0x4a3c5e){if(_0x4a3c5e){var _0x2ff7c6=_0x4a3c5e[_0x44ca('0x2a')]({'plain':!![]});_0x2ff7c6=qs[_0x44ca('0x5e')](_0x2ff7c6,['id','createdAt',_0x44ca('0x5f')]);_0x5d5276[_0x44ca('0x60')]=_[_0x44ca('0x5e')](_0x5d5276[_0x44ca('0x60')],['id',_0x44ca('0x61'),'updatedAt']);return db[_0x44ca('0x4d')][_0x44ca('0x55')](_[_0x44ca('0x4a')](_0x2ff7c6,_0x5d5276['body']),{'include':_0x5d5276[_0x44ca('0x3e')][_0x44ca('0x4e')]?[{'all':!![]}]:undefined})[_0x44ca('0x28')](function(_0x5abe5e){var _0x5b161f=_0x5d5276['user'][_0x44ca('0x2a')]({'plain':!![]});if(!_0x5b161f)throw new Error(_0x44ca('0x56'));if(_0x5b161f[_0x44ca('0x62')]===_0x44ca('0x57')){var _0x36873d=_0x5abe5e[_0x44ca('0x2a')]({'plain':!![]});var _0x1a09ea=[{'name':'VoiceQueues','value':_0x44ca('0x2c')},{'name':'QueueCampaigns','value':_0x44ca('0x2e')}];var _0x40e465=_['find'](_0x1a09ea,[_0x44ca('0x30'),_0x36873d[_0x44ca('0x32')]])['name'];return db[_0x44ca('0x58')][_0x44ca('0x33')]({'where':{'name':_0x40e465,'userProfileId':_0x5b161f['userProfileId']},'raw':!![]})['then'](function(_0x97f3f7){if(_0x97f3f7&&_0x97f3f7[_0x44ca('0x5a')]===0x0){return db['UserProfileResource'][_0x44ca('0x55')]({'name':_0x36873d[_0x44ca('0x34')],'resourceId':_0x36873d['id'],'type':_0x97f3f7['name'],'sectionId':_0x97f3f7['id']},{})[_0x44ca('0x28')](function(){return _0x5abe5e;});}else{return _0x5abe5e;}})[_0x44ca('0x52')](function(_0x9b9125){logger[_0x44ca('0x35')](_0x44ca('0x5c'),_0x9b9125);throw _0x9b9125;});}return _0x5abe5e;});}})[_0x44ca('0x28')](respondWithResult(_0x104b0c,0xc9))['catch'](handleError(_0x104b0c,null));};exports['update']=function(_0x1269ef,_0x2caa37){if(_0x1269ef['body']['id']){delete _0x1269ef[_0x44ca('0x60')]['id'];}return db[_0x44ca('0x4d')][_0x44ca('0x33')]({'where':{'id':_0x1269ef[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x2caa37,null))[_0x44ca('0x28')](saveUpdates(_0x1269ef[_0x44ca('0x60')],null))[_0x44ca('0x28')](respondWithResult(_0x2caa37,null))['catch'](handleError(_0x2caa37,null));};exports[_0x44ca('0x29')]=function(_0x315b9e,_0xbfea9a){return db[_0x44ca('0x4d')][_0x44ca('0x33')]({'where':{'id':_0x315b9e['params']['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0xbfea9a,null))['then'](removeEntity(_0xbfea9a,null))[_0x44ca('0x52')](handleError(_0xbfea9a,null));};exports[_0x44ca('0x63')]=function(_0x72345f,_0x389e6a,_0x1f8d8f){var _0x5d470d={'raw':![],'where':{}};var _0xb4df5c={};var _0x21fcbb={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x44ca('0x64')]({'where':{'id':_0x72345f['params']['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x389e6a,null))[_0x44ca('0x28')](function(_0x5f48dc){if(_0x5f48dc){_0xb4df5c[_0x44ca('0x3c')]=_[_0x44ca('0x3f')](db[_0x44ca('0x65')]['rawAttributes']);_0xb4df5c[_0x44ca('0x3e')]=_[_0x44ca('0x3f')](_0x72345f[_0x44ca('0x3e')]);_0xb4df5c['filters']=_[_0x44ca('0x41')](_0xb4df5c[_0x44ca('0x3c')],_0xb4df5c[_0x44ca('0x3e')]);_0x5d470d[_0x44ca('0x42')]=_[_0x44ca('0x41')](_0xb4df5c[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x72345f['query']['fields']));_0x5d470d[_0x44ca('0x42')]=_0x5d470d['attributes'][_0x44ca('0x44')]?_0x5d470d[_0x44ca('0x42')]:_0xb4df5c[_0x44ca('0x3c')];if(!_0x72345f[_0x44ca('0x3e')][_0x44ca('0x66')]('nolimit')){_0x5d470d[_0x44ca('0x21')]=qs[_0x44ca('0x21')](_0x72345f['query'][_0x44ca('0x21')]);_0x5d470d['offset']=qs[_0x44ca('0x1f')](_0x72345f[_0x44ca('0x3e')][_0x44ca('0x1f')]);}_0x5d470d[_0x44ca('0x67')]=qs[_0x44ca('0x46')](_0x72345f[_0x44ca('0x3e')]['sort']);_0x5d470d['where']=qs['filters'](_[_0x44ca('0x48')](_0x72345f['query'],_0xb4df5c[_0x44ca('0x40')]));_0x5d470d[_0x44ca('0x47')]['VoiceQueueId']=_0x5f48dc['id'];if(_0x72345f[_0x44ca('0x3e')]['filter']){_0x5d470d[_0x44ca('0x47')]=_[_0x44ca('0x4a')](_0x5d470d['where'],{'$or':_[_0x44ca('0x3d')](_0x5d470d[_0x44ca('0x42')],function(_0x2f105e){var _0x5886f7={};_0x5886f7[_0x2f105e]={'$like':'%'+_0x72345f[_0x44ca('0x3e')][_0x44ca('0x49')]+'%'};return _0x5886f7;})});}_0x5d470d=_[_0x44ca('0x4a')]({},_0x5d470d,_0x72345f['options']);return db[_0x44ca('0x65')][_0x44ca('0x22')]({'where':_0x5d470d[_0x44ca('0x47')]})[_0x44ca('0x28')](function(_0xcae3b9){_0x21fcbb[_0x44ca('0x22')]=_0xcae3b9;if(_0x72345f[_0x44ca('0x3e')][_0x44ca('0x4e')]){_0x5d470d[_0x44ca('0x4f')]=[{'all':!![]}];}return db[_0x44ca('0x65')][_0x44ca('0x50')](_0x5d470d);})[_0x44ca('0x28')](function(_0x55f741){_0x21fcbb[_0x44ca('0x51')]=_0x55f741;return _0x21fcbb;});}})[_0x44ca('0x28')](respondWithFilteredResult(_0x389e6a,_0x5d470d))['catch'](handleError(_0x389e6a,null));};exports[_0x44ca('0x68')]=function(_0x1f031e,_0x741537,_0x21aee6){var _0x1f87a6={'raw':!![],'where':{}};var _0x46b49f={};var _0xd38ca0={'count':0x0,'rows':[]};return db[_0x44ca('0x4d')][_0x44ca('0x64')]({'where':{'id':_0x1f031e[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x741537,null))[_0x44ca('0x28')](function(_0x40f864){if(_0x40f864){_0x46b49f[_0x44ca('0x3c')]=_['keys'](db[_0x44ca('0x69')][_0x44ca('0x39')]);_0x46b49f['query']=_[_0x44ca('0x3f')](_0x1f031e[_0x44ca('0x3e')]);_0x46b49f['filters']=_[_0x44ca('0x41')](_0x46b49f[_0x44ca('0x3c')],_0x46b49f[_0x44ca('0x3e')]);_0x1f87a6['attributes']=_['intersection'](_0x46b49f['model'],qs['fields'](_0x1f031e[_0x44ca('0x3e')][_0x44ca('0x43')]));_0x1f87a6[_0x44ca('0x42')]=_0x1f87a6[_0x44ca('0x42')][_0x44ca('0x44')]?_0x1f87a6[_0x44ca('0x42')]:_0x46b49f['model'];if(!_0x1f031e[_0x44ca('0x3e')][_0x44ca('0x66')]('nolimit')){_0x1f87a6[_0x44ca('0x21')]=qs[_0x44ca('0x21')](_0x1f031e[_0x44ca('0x3e')][_0x44ca('0x21')]);_0x1f87a6[_0x44ca('0x1f')]=qs[_0x44ca('0x1f')](_0x1f031e[_0x44ca('0x3e')][_0x44ca('0x1f')]);}_0x1f87a6[_0x44ca('0x67')]=qs['sort'](_0x1f031e[_0x44ca('0x3e')]['sort']);_0x1f87a6[_0x44ca('0x47')]=qs[_0x44ca('0x40')](_['pick'](_0x1f031e[_0x44ca('0x3e')],_0x46b49f[_0x44ca('0x40')]));_0x1f87a6['where'][_0x44ca('0x6a')]=_0x40f864['id'];if(_0x1f031e[_0x44ca('0x3e')][_0x44ca('0x49')]){_0x1f87a6[_0x44ca('0x47')]=_[_0x44ca('0x4a')](_0x1f87a6[_0x44ca('0x47')],{'$or':_[_0x44ca('0x3d')](_0x1f87a6[_0x44ca('0x42')],function(_0x534550){var _0x3f46f0={};_0x3f46f0[_0x534550]={'$like':'%'+_0x1f031e[_0x44ca('0x3e')]['filter']+'%'};return _0x3f46f0;})});}_0x1f87a6=_['merge']({},_0x1f87a6,_0x1f031e[_0x44ca('0x4c')]);return db[_0x44ca('0x69')][_0x44ca('0x22')]({'where':_0x1f87a6['where']})[_0x44ca('0x28')](function(_0x5bac8c){_0xd38ca0[_0x44ca('0x22')]=_0x5bac8c;if(_0x1f031e[_0x44ca('0x3e')][_0x44ca('0x4e')]){_0x1f87a6[_0x44ca('0x4f')]=[{'all':!![]}];}return db[_0x44ca('0x69')][_0x44ca('0x50')](_0x1f87a6);})[_0x44ca('0x28')](function(_0x3b0a06){_0xd38ca0['rows']=_0x3b0a06;return _0xd38ca0;});}})[_0x44ca('0x28')](respondWithFilteredResult(_0x741537,_0x1f87a6))[_0x44ca('0x52')](handleError(_0x741537,null));};exports[_0x44ca('0x6b')]=function(_0x3fd33f,_0x32b069,_0x19ce45){var _0x2031d1={'raw':!![],'where':{}};var _0x49f9e7={};var _0x532fba={'count':0x0,'rows':[]};return db[_0x44ca('0x4d')][_0x44ca('0x64')]({'where':{'id':_0x3fd33f[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x32b069,null))[_0x44ca('0x28')](function(_0x1a7990){if(_0x1a7990){_0x49f9e7['model']=_[_0x44ca('0x3f')](db[_0x44ca('0x6c')]['rawAttributes']);_0x49f9e7[_0x44ca('0x3e')]=_[_0x44ca('0x3f')](_0x3fd33f[_0x44ca('0x3e')]);_0x49f9e7[_0x44ca('0x40')]=_[_0x44ca('0x41')](_0x49f9e7['model'],_0x49f9e7['query']);_0x2031d1[_0x44ca('0x42')]=_[_0x44ca('0x41')](_0x49f9e7[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x3fd33f[_0x44ca('0x3e')]['fields']));_0x2031d1[_0x44ca('0x42')]=_0x2031d1[_0x44ca('0x42')][_0x44ca('0x44')]?_0x2031d1[_0x44ca('0x42')]:_0x49f9e7[_0x44ca('0x3c')];if(!_0x3fd33f['query']['hasOwnProperty'](_0x44ca('0x45'))){_0x2031d1[_0x44ca('0x21')]=qs[_0x44ca('0x21')](_0x3fd33f['query'][_0x44ca('0x21')]);_0x2031d1[_0x44ca('0x1f')]=qs[_0x44ca('0x1f')](_0x3fd33f[_0x44ca('0x3e')][_0x44ca('0x1f')]);}_0x2031d1['order']=qs[_0x44ca('0x46')](_0x3fd33f['query'][_0x44ca('0x46')]);_0x2031d1[_0x44ca('0x47')]=qs[_0x44ca('0x40')](_[_0x44ca('0x48')](_0x3fd33f['query'],_0x49f9e7[_0x44ca('0x40')]));_0x2031d1[_0x44ca('0x47')][_0x44ca('0x6a')]=_0x1a7990['id'];if(_0x3fd33f['query'][_0x44ca('0x49')]){_0x2031d1[_0x44ca('0x47')]=_[_0x44ca('0x4a')](_0x2031d1['where'],{'$or':_['map'](_0x2031d1['attributes'],function(_0x216831){var _0x4d353c={};_0x4d353c[_0x216831]={'$like':'%'+_0x3fd33f[_0x44ca('0x3e')][_0x44ca('0x49')]+'%'};return _0x4d353c;})});}_0x2031d1=_[_0x44ca('0x4a')]({},_0x2031d1,_0x3fd33f[_0x44ca('0x4c')]);return db[_0x44ca('0x6c')][_0x44ca('0x22')]({'where':_0x2031d1['where']})[_0x44ca('0x28')](function(_0xc673b5){_0x532fba[_0x44ca('0x22')]=_0xc673b5;if(_0x3fd33f[_0x44ca('0x3e')][_0x44ca('0x4e')]){_0x2031d1[_0x44ca('0x4f')]=[{'all':!![]}];}return db[_0x44ca('0x6c')][_0x44ca('0x50')](_0x2031d1);})[_0x44ca('0x28')](function(_0x3e2ee4){_0x532fba['rows']=_0x3e2ee4;return _0x532fba;});}})[_0x44ca('0x28')](respondWithFilteredResult(_0x32b069,_0x2031d1))[_0x44ca('0x52')](handleError(_0x32b069,null));};exports[_0x44ca('0x6d')]=function(_0x3b13f2,_0x1dacaa,_0xe9e69f){var _0x5ab5c9={'raw':!![],'where':{}};var _0x257a32={};var _0x45d40b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x44ca('0x64')]({'where':{'id':_0x3b13f2[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x1dacaa,null))[_0x44ca('0x28')](function(_0x28cd29){if(_0x28cd29){_0x257a32[_0x44ca('0x3c')]=_['keys'](db['CmHopperBlack'][_0x44ca('0x39')]);_0x257a32['query']=_[_0x44ca('0x3f')](_0x3b13f2[_0x44ca('0x3e')]);_0x257a32['filters']=_[_0x44ca('0x41')](_0x257a32['model'],_0x257a32['query']);_0x5ab5c9['attributes']=_[_0x44ca('0x41')](_0x257a32[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x3b13f2[_0x44ca('0x3e')]['fields']));_0x5ab5c9[_0x44ca('0x42')]=_0x5ab5c9[_0x44ca('0x42')][_0x44ca('0x44')]?_0x5ab5c9[_0x44ca('0x42')]:_0x257a32[_0x44ca('0x3c')];if(!_0x3b13f2['query']['hasOwnProperty'](_0x44ca('0x45'))){_0x5ab5c9[_0x44ca('0x21')]=qs[_0x44ca('0x21')](_0x3b13f2[_0x44ca('0x3e')][_0x44ca('0x21')]);_0x5ab5c9[_0x44ca('0x1f')]=qs[_0x44ca('0x1f')](_0x3b13f2['query'][_0x44ca('0x1f')]);}_0x5ab5c9[_0x44ca('0x67')]=qs['sort'](_0x3b13f2[_0x44ca('0x3e')][_0x44ca('0x46')]);_0x5ab5c9[_0x44ca('0x47')]=qs[_0x44ca('0x40')](_[_0x44ca('0x48')](_0x3b13f2[_0x44ca('0x3e')],_0x257a32[_0x44ca('0x40')]));_0x5ab5c9[_0x44ca('0x47')]['VoiceQueueId']=_0x28cd29['id'];if(_0x3b13f2['query'][_0x44ca('0x49')]){_0x5ab5c9[_0x44ca('0x47')]=_['merge'](_0x5ab5c9[_0x44ca('0x47')],{'$or':_[_0x44ca('0x3d')](_0x5ab5c9[_0x44ca('0x42')],function(_0x6b2841){var _0x4dd291={};_0x4dd291[_0x6b2841]={'$like':'%'+_0x3b13f2[_0x44ca('0x3e')][_0x44ca('0x49')]+'%'};return _0x4dd291;})});}_0x5ab5c9=_[_0x44ca('0x4a')]({},_0x5ab5c9,_0x3b13f2[_0x44ca('0x4c')]);return db[_0x44ca('0x6e')][_0x44ca('0x22')]({'where':_0x5ab5c9[_0x44ca('0x47')]})[_0x44ca('0x28')](function(_0x44d2d8){_0x45d40b[_0x44ca('0x22')]=_0x44d2d8;if(_0x3b13f2[_0x44ca('0x3e')]['includeAll']){_0x5ab5c9[_0x44ca('0x4f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x44ca('0x50')](_0x5ab5c9);})[_0x44ca('0x28')](function(_0x1434b6){_0x45d40b['rows']=_0x1434b6;return _0x45d40b;});}})[_0x44ca('0x28')](respondWithFilteredResult(_0x1dacaa,_0x5ab5c9))[_0x44ca('0x52')](handleError(_0x1dacaa,null));};exports[_0x44ca('0x6f')]=function(_0x272795,_0x27266f,_0x489cfe){var _0x2b582f={};var _0x547283={};var _0x3f4b4a;var _0x40b8a8;return db[_0x44ca('0x4d')][_0x44ca('0x64')]({'where':{'id':_0x272795[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x27266f,null))[_0x44ca('0x28')](function(_0x5535a8){if(_0x5535a8){_0x3f4b4a=_0x5535a8;_0x547283[_0x44ca('0x3c')]=_[_0x44ca('0x3f')](db['Team'][_0x44ca('0x39')]);_0x547283[_0x44ca('0x3e')]=_[_0x44ca('0x3f')](_0x272795[_0x44ca('0x3e')]);_0x547283[_0x44ca('0x40')]=_[_0x44ca('0x41')](_0x547283[_0x44ca('0x3c')],_0x547283[_0x44ca('0x3e')]);_0x2b582f[_0x44ca('0x42')]=_[_0x44ca('0x41')](_0x547283[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x272795['query'][_0x44ca('0x43')]));_0x2b582f[_0x44ca('0x42')]=_0x2b582f[_0x44ca('0x42')][_0x44ca('0x44')]?_0x2b582f[_0x44ca('0x42')]:_0x547283[_0x44ca('0x3c')];_0x2b582f[_0x44ca('0x67')]=qs['sort'](_0x272795[_0x44ca('0x3e')][_0x44ca('0x46')]);_0x2b582f[_0x44ca('0x47')]=qs['filters'](_['pick'](_0x272795[_0x44ca('0x3e')],_0x547283['filters']));if(_0x272795[_0x44ca('0x3e')]['filter']){_0x2b582f['where']=_[_0x44ca('0x4a')](_0x2b582f[_0x44ca('0x47')],{'$or':_[_0x44ca('0x3d')](_0x2b582f['attributes'],function(_0x2c9cdb){var _0x19aeae={};_0x19aeae[_0x2c9cdb]={'$like':'%'+_0x272795['query']['filter']+'%'};return _0x19aeae;})});}_0x2b582f=_[_0x44ca('0x4a')]({},_0x2b582f,_0x272795['options']);return _0x3f4b4a[_0x44ca('0x6f')](_0x2b582f);}})[_0x44ca('0x28')](function(_0x59c58b){if(_0x59c58b){_0x40b8a8=_0x59c58b[_0x44ca('0x44')];if(!_0x272795[_0x44ca('0x3e')][_0x44ca('0x66')](_0x44ca('0x45'))){_0x2b582f['limit']=qs[_0x44ca('0x21')](_0x272795['query'][_0x44ca('0x21')]);_0x2b582f['offset']=qs[_0x44ca('0x1f')](_0x272795['query'][_0x44ca('0x1f')]);}return _0x3f4b4a['getTeams'](_0x2b582f);}})[_0x44ca('0x28')](function(_0x5251dc){if(_0x5251dc){return _0x5251dc?{'count':_0x40b8a8,'rows':_0x5251dc}:null;}})[_0x44ca('0x28')](respondWithResult(_0x27266f,null))[_0x44ca('0x52')](handleError(_0x27266f,null));};exports[_0x44ca('0x70')]=function(_0x56d5bd,_0x3e95a4,_0x284215){var _0x53cd9c=_0x56d5bd['body'][_0x44ca('0x71')];var _0x21c4ef=_[_0x44ca('0x3d')](_0x53cd9c,'id');return db['Team'][_0x44ca('0x50')]({'where':{'id':_0x21c4ef},'attributes':['id'],'include':[{'model':db['User'],'as':_0x44ca('0x72'),'attributes':['id',_0x44ca('0x34'),'online',_0x44ca('0x73'),_0x44ca('0x74')],'raw':!![]}]})['then'](function(_0x25fac7){if(_0x25fac7){var _0x55b2cb=_[_0x44ca('0x75')](_0x25fac7,function(_0x4c18f2){var _0x316cd4=_0x4c18f2[_0x44ca('0x2a')]({'plain':!![]});_0x316cd4[_0x44ca('0x72')][_0x44ca('0x76')](function(_0x3ac4f0){_0x3ac4f0[_0x44ca('0x77')]=_[_0x44ca('0x33')](_0x53cd9c,{'id':_0x316cd4['id']})[_0x44ca('0x77')];});return _0x316cd4[_0x44ca('0x72')];});return db[_0x44ca('0x4d')]['find']({'where':{'id':_0x56d5bd['params']['id']}})[_0x44ca('0x28')](function(_0x4ba0e3){return db[_0x44ca('0x78')][_0x44ca('0x79')](function(_0x1cc7b7){return _0x4ba0e3[_0x44ca('0x70')](_0x21c4ef,{'transaction':_0x1cc7b7})[_0x44ca('0x28')](function(){return BPromise[_0x44ca('0x7a')](_0x53cd9c,function(_0x6ef25a){return db[_0x44ca('0x7b')][_0x44ca('0x7c')]({'TeamId':_0x6ef25a['id'],'VoiceQueueId':_0x56d5bd['params']['id'],'penalty':_0x6ef25a[_0x44ca('0x77')]},{'transaction':_0x1cc7b7});});})[_0x44ca('0x28')](function(){return BPromise['each'](_0x55b2cb,function(_0x14a1c2){return db[_0x44ca('0x7d')][_0x44ca('0x7e')]({'where':{'UserId':_0x14a1c2['id'],'VoiceQueueId':_0x56d5bd[_0x44ca('0x54')]['id']},'defaults':{'penalty':_0x14a1c2['penalty']},'transaction':_0x1cc7b7});});})['then'](function(){return BPromise['each'](_[_0x44ca('0x49')](_0x55b2cb,{'online':!![]}),function(_0x1b467f){return db['UserVoiceQueueRt'][_0x44ca('0x7c')]({'membername':_0x1b467f['name'],'UserId':_0x1b467f['id'],'queue_name':_0x4ba0e3[_0x44ca('0x34')],'VoiceQueueId':_0x4ba0e3['id'],'interface':_[_0x44ca('0x7f')](_0x1b467f[_0x44ca('0x74')])?util[_0x44ca('0x80')](_0x44ca('0x81'),_0x1b467f[_0x44ca('0x34')]):_0x1b467f[_0x44ca('0x74')],'paused':_0x1b467f['voicePause']||![],'penalty':_0x1b467f[_0x44ca('0x77')]},{'transaction':_0x1cc7b7});});})[_0x44ca('0x28')](function(){_0x55b2cb[_0x44ca('0x76')](function(_0x3f15bf){socket['emit']('userVoiceQueue:save',{'UserId':_0x3f15bf['id'],'VoiceQueueId':_0x4ba0e3['id']});});});});});}})[_0x44ca('0x28')](respondWithStatusCode(_0x3e95a4,null))[_0x44ca('0x52')](handleError(_0x3e95a4,null));};exports[_0x44ca('0x82')]=function(_0x163b40,_0x5479cf,_0x23234e){return db[_0x44ca('0x83')][_0x44ca('0x50')]({'where':{'id':_0x163b40[_0x44ca('0x3e')][_0x44ca('0x84')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x44ca('0x72'),'attributes':['id'],'raw':!![]}]})[_0x44ca('0x28')](handleEntityNotFound(_0x5479cf,null))[_0x44ca('0x28')](function(_0xd14368){var _0x2d9799=_[_0x44ca('0x3d')](_0xd14368,'id');var _0x4b6b18=[];var _0x52f7bb=[];var _0x25c5ca=squel[_0x44ca('0x85')]();_0x25c5ca['field'](_0x44ca('0x86'))['from'](_0x44ca('0x87'),'tq')[_0x44ca('0x88')]('user_has_teams','ut',_0x44ca('0x89'))[_0x44ca('0x47')](_0x44ca('0x8a'),_0x163b40[_0x44ca('0x54')]['id']);for(var _0x542035=0x0;_0x542035<_0xd14368['length'];_0x542035+=0x1){let _0x23141f=_0xd14368[_0x542035];for(var _0x15cc24=0x0;_0x15cc24<_0x23141f[_0x44ca('0x72')][_0x44ca('0x44')];_0x15cc24+=0x1){let _0x21b8aa=_0x23141f[_0x44ca('0x72')][_0x15cc24];var _0x381bf0=_0x25c5ca['clone']();_0x381bf0['where'](_0x44ca('0x8b'),_0x21b8aa['id']);_0x52f7bb[_0x44ca('0x8c')](db[_0x44ca('0x78')]['query'](_0x381bf0[_0x44ca('0x8d')](),{'type':db[_0x44ca('0x78')]['QueryTypes']['SELECT']})[_0x44ca('0x28')](function(_0x3cd8e7){if(_0x3cd8e7[_0x44ca('0x44')]===0x1){return _0x21b8aa['id'];}else{var _0x488567=_[_0x44ca('0x8e')](_[_0x44ca('0x3d')](_0x3cd8e7,_0x44ca('0x8f')),function(_0x397276){return _['includes'](_0x2d9799,_0x397276);});if(_0x488567){return _0x21b8aa['id'];}}}));}}return BPromise[_0x44ca('0x90')](_0x52f7bb)[_0x44ca('0x28')](function(_0x255d34){_0x4b6b18=_(_0x4b6b18)[_0x44ca('0x91')](_0x255d34)['compact']()['value']();return db[_0x44ca('0x4d')][_0x44ca('0x33')]({'where':{'id':_0x163b40[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](function(_0x172a27){return db[_0x44ca('0x78')][_0x44ca('0x79')](function(_0x363fe8){return _0x172a27[_0x44ca('0x82')](_0x163b40[_0x44ca('0x3e')][_0x44ca('0x84')],{'transaction':_0x363fe8})[_0x44ca('0x28')](function(){if(!_[_0x44ca('0x92')](_0x4b6b18)){return _0x172a27['removeAgents'](_0x4b6b18,{'transaction':_0x363fe8})['then'](function(){return db[_0x44ca('0x93')][_0x44ca('0x29')]({'where':{'VoiceQueueId':_0x163b40[_0x44ca('0x54')]['id'],'UserId':_0x4b6b18},'transaction':_0x363fe8});});}})[_0x44ca('0x28')](function(){_0x4b6b18['forEach'](function(_0x18e3ed){socket[_0x44ca('0x94')](_0x44ca('0x95'),{'UserId':_0x18e3ed,'VoiceQueueId':_0x172a27['id']});});});});});});})[_0x44ca('0x28')](respondWithStatusCode(_0x5479cf,null))[_0x44ca('0x52')](handleError(_0x5479cf,null));};exports[_0x44ca('0x96')]=function(_0x3b5af2,_0x4f8083,_0x438d69){var _0x4967ed,_0x521b55;return db[_0x44ca('0x4d')][_0x44ca('0x33')]({'where':{'id':_0x3b5af2[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x4f8083,null))[_0x44ca('0x28')](function(_0x35e908){if(_0x35e908){_0x521b55=_0x35e908;return _0x35e908['addAgents'](_0x3b5af2[_0x44ca('0x60')]['ids'],_[_0x44ca('0x5e')](_0x3b5af2[_0x44ca('0x60')],[_0x44ca('0x84'),'id'])||{})[_0x44ca('0x97')](function(_0x3f1b48){for(var _0x2f4c36=0x0;_0x2f4c36<_0x3b5af2[_0x44ca('0x60')][_0x44ca('0x84')][_0x44ca('0x44')];_0x2f4c36+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x3b5af2[_0x44ca('0x60')][_0x44ca('0x84')][_0x2f4c36]),'VoiceQueueId':Number(_0x3b5af2[_0x44ca('0x54')]['id'])});}return _0x3f1b48;});}})['then'](function(_0x2aa7d2){_0x4967ed=_0x2aa7d2||[];if(_0x521b55){return db['User']['findAll']({'where':{'id':_0x3b5af2['body'][_0x44ca('0x84')]},'attributes':['id',_0x44ca('0x34'),_0x44ca('0x98'),_0x44ca('0x73'),_0x44ca('0x74')],'raw':!![]});}})['then'](function(_0x2ad745){if(!_['isEmpty'](_0x2ad745)){var _0x570093=[];for(var _0x37e623=0x0;_0x37e623<_0x2ad745['length'];_0x37e623++){if(_0x2ad745[_0x37e623][_0x44ca('0x98')]){_0x570093['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x2ad745[_0x37e623][_0x44ca('0x34')],'UserId':_0x2ad745[_0x37e623]['id'],'queue_name':_0x521b55['name'],'VoiceQueueId':_0x521b55['id'],'interface':_[_0x44ca('0x7f')](_0x2ad745[_0x37e623][_0x44ca('0x74')])?util['format'](_0x44ca('0x81'),_0x2ad745[_0x37e623][_0x44ca('0x34')]):_0x2ad745[_0x37e623][_0x44ca('0x74')],'paused':_0x2ad745[_0x37e623][_0x44ca('0x73')]||![],'penalty':_0x3b5af2[_0x44ca('0x60')]['penalty']||0x0}));}}return BPromise[_0x44ca('0x90')](_0x570093);}})[_0x44ca('0x28')](function(){return _0x4967ed;})['then'](respondWithResult(_0x4f8083,null))[_0x44ca('0x52')](handleError(_0x4f8083,null));};exports['removeAgents']=function(_0x25d2ff,_0x5bd02e,_0x5b18cd){return db[_0x44ca('0x4d')][_0x44ca('0x33')]({'where':{'id':_0x25d2ff['params']['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x5bd02e,null))[_0x44ca('0x28')](function(_0x35323e){if(_0x35323e){return _0x35323e[_0x44ca('0x99')](_0x25d2ff[_0x44ca('0x3e')][_0x44ca('0x84')])[_0x44ca('0x28')](function(){if(_['isArray'](_0x25d2ff[_0x44ca('0x3e')][_0x44ca('0x84')])){for(var _0x46cb1b=0x0;_0x46cb1b<_0x25d2ff[_0x44ca('0x3e')][_0x44ca('0x84')][_0x44ca('0x44')];_0x46cb1b+=0x1){socket['emit'](_0x44ca('0x95'),{'UserId':Number(_0x25d2ff[_0x44ca('0x3e')]['ids'][_0x46cb1b]),'VoiceQueueId':Number(_0x25d2ff[_0x44ca('0x54')]['id'])});}}else{socket[_0x44ca('0x94')](_0x44ca('0x95'),{'UserId':Number(_0x25d2ff[_0x44ca('0x3e')][_0x44ca('0x84')]),'VoiceQueueId':Number(_0x25d2ff['params']['id'])});}});}})[_0x44ca('0x28')](function(_0x4c9d2d){return db[_0x44ca('0x93')][_0x44ca('0x29')]({'where':{'VoiceQueueId':_0x25d2ff[_0x44ca('0x54')]['id'],'UserId':_0x25d2ff['query'][_0x44ca('0x84')]}})['then'](function(){return _0x4c9d2d;});})[_0x44ca('0x28')](respondWithStatusCode(_0x5bd02e,null))['catch'](handleError(_0x5bd02e,null));};exports['getAgents']=function(_0x378996,_0x114382,_0x45b671){var _0x52e789={};var _0x3dac4f={};var _0x2c73be;var _0x1ae231;return db[_0x44ca('0x4d')][_0x44ca('0x64')]({'where':{'id':_0x378996['params']['id']}})['then'](handleEntityNotFound(_0x114382,null))[_0x44ca('0x28')](function(_0x1addf5){if(_0x1addf5){_0x2c73be=_0x1addf5;_0x3dac4f[_0x44ca('0x3c')]=_[_0x44ca('0x3f')](db[_0x44ca('0x9a')]['rawAttributes']);_0x3dac4f[_0x44ca('0x3e')]=_['keys'](_0x378996[_0x44ca('0x3e')]);_0x3dac4f['filters']=_['intersection'](_0x3dac4f['model'],_0x3dac4f[_0x44ca('0x3e')]);_0x52e789[_0x44ca('0x42')]=_['intersection'](_0x3dac4f['model'],qs['fields'](_0x378996['query'][_0x44ca('0x43')]));_0x52e789[_0x44ca('0x42')]=_0x52e789[_0x44ca('0x42')]['length']?_0x52e789[_0x44ca('0x42')]:_0x3dac4f[_0x44ca('0x3c')];_0x52e789['order']=qs['sort'](_0x378996[_0x44ca('0x3e')][_0x44ca('0x46')]);_0x52e789[_0x44ca('0x47')]=qs[_0x44ca('0x40')](_[_0x44ca('0x48')](_0x378996['query'],_0x3dac4f['filters']));if(_0x378996[_0x44ca('0x3e')][_0x44ca('0x49')]){_0x52e789[_0x44ca('0x47')]=_['merge'](_0x52e789[_0x44ca('0x47')],{'$or':_[_0x44ca('0x3d')](_0x52e789['attributes'],function(_0x297612){var _0x4bec92={};_0x4bec92[_0x297612]={'$like':'%'+_0x378996[_0x44ca('0x3e')][_0x44ca('0x49')]+'%'};return _0x4bec92;})});}_0x52e789=_['merge']({},_0x52e789,_0x378996[_0x44ca('0x4c')]);return _0x2c73be[_0x44ca('0x9b')](_0x52e789);}})[_0x44ca('0x28')](function(_0x12834a){if(_0x12834a){_0x1ae231=_0x12834a[_0x44ca('0x44')];if(!_0x378996['query'][_0x44ca('0x66')]('nolimit')){_0x52e789[_0x44ca('0x21')]=qs[_0x44ca('0x21')](_0x378996[_0x44ca('0x3e')]['limit']);_0x52e789[_0x44ca('0x1f')]=qs['offset'](_0x378996[_0x44ca('0x3e')][_0x44ca('0x1f')]);}return _0x2c73be[_0x44ca('0x9b')](_0x52e789);}})['then'](function(_0x35d200){if(_0x35d200){return _0x35d200?{'count':_0x1ae231,'rows':_0x35d200}:null;}})['then'](respondWithResult(_0x114382,null))['catch'](handleError(_0x114382,null));};exports[_0x44ca('0x9c')]=function(_0x55e4fd,_0x27c904,_0xbb51a3){var _0x1f13a={};var _0x3a9865={};var _0x1460ea;var _0x3b4e74;return db['VoiceQueue'][_0x44ca('0x64')]({'where':{'id':_0x55e4fd['params']['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x27c904,null))[_0x44ca('0x28')](function(_0x89da34){if(_0x89da34){_0x1460ea=_0x89da34;_0x3a9865['model']=_[_0x44ca('0x3f')](db[_0x44ca('0x93')]['rawAttributes']);_0x3a9865['query']=_[_0x44ca('0x3f')](_0x55e4fd['query']);_0x3a9865[_0x44ca('0x40')]=_[_0x44ca('0x41')](_0x3a9865[_0x44ca('0x3c')],_0x3a9865[_0x44ca('0x3e')]);_0x1f13a[_0x44ca('0x42')]=_[_0x44ca('0x41')](_0x3a9865['model'],qs['fields'](_0x55e4fd[_0x44ca('0x3e')]['fields']));_0x1f13a['attributes']=_0x1f13a['attributes'][_0x44ca('0x44')]?_0x1f13a[_0x44ca('0x42')]:_0x3a9865[_0x44ca('0x3c')];_0x1f13a[_0x44ca('0x67')]=qs['sort'](_0x55e4fd[_0x44ca('0x3e')][_0x44ca('0x46')]);_0x1f13a[_0x44ca('0x47')]=qs[_0x44ca('0x40')](_['pick'](_0x55e4fd['query'],_0x3a9865[_0x44ca('0x40')]));if(_0x55e4fd[_0x44ca('0x3e')]['filter']){_0x1f13a['where']=_[_0x44ca('0x4a')](_0x1f13a['where'],{'$or':_[_0x44ca('0x3d')](_0x1f13a[_0x44ca('0x42')],function(_0x14202b){var _0x233534={};_0x233534[_0x14202b]={'$like':'%'+_0x55e4fd['query'][_0x44ca('0x49')]+'%'};return _0x233534;})});}_0x1f13a=_['merge']({},_0x1f13a,_0x55e4fd[_0x44ca('0x4c')]);return _0x1460ea['getMembers'](_0x1f13a);}})[_0x44ca('0x28')](function(_0x38bf86){if(_0x38bf86){_0x3b4e74=_0x38bf86[_0x44ca('0x44')];if(!_0x55e4fd[_0x44ca('0x3e')][_0x44ca('0x66')](_0x44ca('0x45'))){_0x1f13a['limit']=qs[_0x44ca('0x21')](_0x55e4fd[_0x44ca('0x3e')][_0x44ca('0x21')]);_0x1f13a[_0x44ca('0x1f')]=qs[_0x44ca('0x1f')](_0x55e4fd[_0x44ca('0x3e')][_0x44ca('0x1f')]);}return _0x1460ea['getMembers'](_0x1f13a);}})['then'](function(_0x206d37){return _0x206d37?{'count':_0x3b4e74,'rows':_0x206d37}:null;})[_0x44ca('0x28')](respondWithResult(_0x27c904,null))['catch'](handleError(_0x27c904,null));};exports['getLists']=function(_0x13ea28,_0x338389,_0x231878){var _0x275662={};var _0x446b02={};var _0x437c72;var _0x59c661;return db['VoiceQueue'][_0x44ca('0x64')]({'where':{'id':_0x13ea28[_0x44ca('0x54')]['id']}})['then'](handleEntityNotFound(_0x338389,null))[_0x44ca('0x28')](function(_0x3947f1){if(_0x3947f1){_0x437c72=_0x3947f1;_0x446b02[_0x44ca('0x3c')]=_['keys'](db[_0x44ca('0x9d')][_0x44ca('0x39')]);_0x446b02['query']=_['keys'](_0x13ea28[_0x44ca('0x3e')]);_0x446b02[_0x44ca('0x40')]=_['intersection'](_0x446b02[_0x44ca('0x3c')],_0x446b02[_0x44ca('0x3e')]);_0x275662[_0x44ca('0x42')]=_['intersection'](_0x446b02[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x13ea28['query'][_0x44ca('0x43')]));_0x275662['attributes']=_0x275662[_0x44ca('0x42')][_0x44ca('0x44')]?_0x275662[_0x44ca('0x42')]:_0x446b02['model'];_0x275662[_0x44ca('0x67')]=qs[_0x44ca('0x46')](_0x13ea28[_0x44ca('0x3e')]['sort']);_0x275662[_0x44ca('0x47')]=qs[_0x44ca('0x40')](_[_0x44ca('0x48')](_0x13ea28[_0x44ca('0x3e')],_0x446b02[_0x44ca('0x40')]));if(_0x13ea28[_0x44ca('0x3e')][_0x44ca('0x49')]){_0x275662[_0x44ca('0x47')]=_[_0x44ca('0x4a')](_0x275662['where'],{'$or':_[_0x44ca('0x3d')](_0x275662['attributes'],function(_0x5dcee5){var _0xba6a3f={};_0xba6a3f[_0x5dcee5]={'$like':'%'+_0x13ea28[_0x44ca('0x3e')][_0x44ca('0x49')]+'%'};return _0xba6a3f;})});}_0x275662=_[_0x44ca('0x4a')]({},_0x275662,_0x13ea28[_0x44ca('0x4c')]);return _0x437c72['getLists'](_0x275662);}})['then'](function(_0x19ac3b){if(_0x19ac3b){_0x59c661=_0x19ac3b[_0x44ca('0x44')];if(!_0x13ea28['query'][_0x44ca('0x66')]('nolimit')){_0x275662[_0x44ca('0x21')]=qs['limit'](_0x13ea28[_0x44ca('0x3e')][_0x44ca('0x21')]);_0x275662[_0x44ca('0x1f')]=qs[_0x44ca('0x1f')](_0x13ea28[_0x44ca('0x3e')][_0x44ca('0x1f')]);}return _0x437c72[_0x44ca('0x9e')](_0x275662);}})[_0x44ca('0x28')](function(_0x215af4){if(_0x215af4){return _0x215af4?{'count':_0x59c661,'rows':_0x215af4}:null;}})['then'](respondWithResult(_0x338389,null))['catch'](handleError(_0x338389,null));};exports[_0x44ca('0x9f')]=function(_0x491448,_0x1d05e9,_0x47e787){var _0x42c0da=moment()['format'](_0x44ca('0xa0'));var _0x1cf179,_0x3639b0;return db['VoiceQueue']['find']({'where':{'id':_0x491448[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x1d05e9,null))[_0x44ca('0x28')](function(_0x49aa1e){if(_0x49aa1e){_0x3639b0=_0x49aa1e;return _0x49aa1e[_0x44ca('0x9f')](_0x491448[_0x44ca('0x60')]['ids'],_['omit'](_0x491448[_0x44ca('0x60')],['ids','id'])||{});}return null;})[_0x44ca('0x97')](function(_0x369fd5){var _0x4d466c;_0x1cf179=_0x369fd5||[];var _0x2c7855=[];if(_0x369fd5){for(var _0x587eb9=0x0;_0x587eb9<_0x369fd5[_0x44ca('0x44')];_0x587eb9+=0x1){var _0x5bac46=_0x369fd5[_0x587eb9]['get']({'plain':!![]});_0x3639b0['dialCheckDuplicateType']=_0x491448[_0x44ca('0x60')][_0x44ca('0xa1')]?_0x491448[_0x44ca('0x60')][_0x44ca('0xa1')]:_0x3639b0[_0x44ca('0xa1')];switch(_0x3639b0[_0x44ca('0xa1')]){case _0x44ca('0xa2'):_0x4d466c=squel[_0x44ca('0xa3')]()['into'](_0x44ca('0xa4'))[_0x44ca('0xa5')]([_0x44ca('0xa6'),'scheduledAt',_0x44ca('0xa7'),'ListId',_0x44ca('0x6a'),'createdAt','updatedAt'],squel[_0x44ca('0x85')]()[_0x44ca('0xa8')](_0x44ca('0xa6'),_0x44ca('0xa6'))[_0x44ca('0xa8')]('\x27'+_0x42c0da+'\x27',_0x44ca('0xa9'))[_0x44ca('0xa8')]('id',_0x44ca('0xa7'))[_0x44ca('0xa8')](_0x5bac46[_0x44ca('0xaa')]['toString'](),_0x44ca('0xab'))[_0x44ca('0xa8')](_0x491448['params']['id']['toString'](),_0x44ca('0x6a'))['field']('\x27'+_0x42c0da+'\x27','createdAt')[_0x44ca('0xa8')]('\x27'+_0x42c0da+'\x27','updatedAt')['from'](_0x44ca('0xac'))[_0x44ca('0x47')](_0x44ca('0xad'))['where']('ListId\x20=\x20?',_0x5bac46[_0x44ca('0xaa')]['toString']())[_0x44ca('0x47')](_0x44ca('0xae'))[_0x44ca('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x44ca('0x85')]()['field'](_0x44ca('0xaf'))[_0x44ca('0xb0')](_0x44ca('0xb1'))[_0x44ca('0x47')]('VoiceQueueId\x20=\x20?',_0x491448[_0x44ca('0x54')]['id']['toString']()))['where'](_0x44ca('0xb2'),squel[_0x44ca('0x85')]()['field'](_0x44ca('0xb3'))[_0x44ca('0xb0')]('cm_hopper')['where'](_0x44ca('0x8a'),_0x491448[_0x44ca('0x54')]['id'][_0x44ca('0x8d')]())))[_0x44ca('0x8d')]();break;case _0x44ca('0xb4'):_0x4d466c=squel['insert']()[_0x44ca('0xb5')]('cm_hopper')['fromQuery']([_0x44ca('0xa6'),'scheduledAt',_0x44ca('0xa7'),'ListId',_0x44ca('0x6a'),_0x44ca('0x61'),_0x44ca('0x5f')],squel[_0x44ca('0x85')]()['field'](_0x44ca('0xa6'),_0x44ca('0xa6'))[_0x44ca('0xa8')]('\x27'+_0x42c0da+'\x27',_0x44ca('0xa9'))[_0x44ca('0xa8')]('id',_0x44ca('0xa7'))[_0x44ca('0xa8')](_0x5bac46[_0x44ca('0xaa')][_0x44ca('0x8d')](),_0x44ca('0xab'))[_0x44ca('0xa8')](_0x491448[_0x44ca('0x54')]['id']['toString'](),_0x44ca('0x6a'))[_0x44ca('0xa8')]('\x27'+_0x42c0da+'\x27','createdAt')[_0x44ca('0xa8')]('\x27'+_0x42c0da+'\x27','updatedAt')[_0x44ca('0xb0')](_0x44ca('0xac'))[_0x44ca('0x47')]('deletedAt\x20IS\x20NULL')[_0x44ca('0x47')](_0x44ca('0xb6'),_0x5bac46['CmListId'][_0x44ca('0x8d')]())[_0x44ca('0x47')](_0x44ca('0xae'))[_0x44ca('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x44ca('0x85')]()['field'](_0x44ca('0xb3'))[_0x44ca('0xb0')](_0x44ca('0xa4'))[_0x44ca('0x47')](_0x44ca('0x8a'),_0x491448[_0x44ca('0x54')]['id'][_0x44ca('0x8d')]())))[_0x44ca('0x8d')]();break;default:_0x4d466c=squel[_0x44ca('0xa3')]()[_0x44ca('0xb5')]('cm_hopper')[_0x44ca('0xa5')]([_0x44ca('0xa6'),'scheduledAt','ContactId',_0x44ca('0xab'),_0x44ca('0x6a'),_0x44ca('0x61'),_0x44ca('0x5f')],squel[_0x44ca('0x85')]()[_0x44ca('0xa8')](_0x44ca('0xa6'),'phone')['field']('\x27'+_0x42c0da+'\x27',_0x44ca('0xa9'))[_0x44ca('0xa8')]('id',_0x44ca('0xa7'))['field'](_0x5bac46['CmListId'][_0x44ca('0x8d')](),_0x44ca('0xab'))['field'](_0x491448[_0x44ca('0x54')]['id'][_0x44ca('0x8d')](),'VoiceQueueId')['field']('\x27'+_0x42c0da+'\x27',_0x44ca('0x61'))[_0x44ca('0xa8')]('\x27'+_0x42c0da+'\x27',_0x44ca('0x5f'))[_0x44ca('0xb0')](_0x44ca('0xac'))['where']('deletedAt\x20IS\x20NULL')[_0x44ca('0x47')]('ListId\x20=\x20?',_0x5bac46['CmListId']['toString']())[_0x44ca('0x47')](_0x44ca('0xae')))['toString']();}_0x2c7855[_0x44ca('0x8c')](db[_0x44ca('0x78')][_0x44ca('0x3e')](_0x4d466c));}return BPromise[_0x44ca('0x90')](_0x2c7855);}})[_0x44ca('0x28')](function(){var _0x4d2422=[];var _0x4a11df=squel[_0x44ca('0xa3')]()['into'](_0x44ca('0xb7'))['fromQuery'](['CmHopperId',_0x44ca('0xa6'),'OrderBy',_0x44ca('0x61'),_0x44ca('0x5f')],squel[_0x44ca('0x85')]()[_0x44ca('0xa8')](_0x44ca('0xb8'))[_0x44ca('0xa8')](_0x44ca('0xb9'))[_0x44ca('0xa8')]('ci.OrderBy+1')['field']('\x27'+_0x42c0da+'\x27',_0x44ca('0x61'))[_0x44ca('0xa8')]('\x27'+_0x42c0da+'\x27',_0x44ca('0x5f'))['from'](_0x44ca('0xba'),'ci')[_0x44ca('0x88')](_0x44ca('0xa4'),'h',_0x44ca('0xbb'))[_0x44ca('0x47')](_0x44ca('0xbc'),_0x42c0da)[_0x44ca('0x47')](_0x44ca('0xbd'),'PHONE'))[_0x44ca('0x8d')]();_0x4d2422[_0x44ca('0x8c')](db['sequelize'][_0x44ca('0x3e')](_0x4a11df));return BPromise['all'](_0x4d2422);})[_0x44ca('0x28')](function(){return _0x1cf179;})[_0x44ca('0x28')](respondWithResult(_0x1d05e9,null))['catch'](handleError(_0x1d05e9,null));};exports['removeLists']=function(_0x49d290,_0x5f1b3d,_0x209840){return db[_0x44ca('0x4d')][_0x44ca('0x33')]({'where':{'id':_0x49d290[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x5f1b3d,null))[_0x44ca('0x28')](function(_0x2763bb){if(_0x2763bb){return _0x2763bb[_0x44ca('0xbe')](_0x49d290[_0x44ca('0x3e')][_0x44ca('0x84')]);}})[_0x44ca('0x28')](function(_0x3a4fad){if(_0x3a4fad){return db['CmHopper'][_0x44ca('0x29')]({'where':{'ListId':_0x49d290['query'][_0x44ca('0x84')],'VoiceQueueId':_0x49d290[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](function(){return _0x3a4fad;});}})[_0x44ca('0x28')](respondWithStatusCode(_0x5f1b3d,null))[_0x44ca('0x52')](handleError(_0x5f1b3d,null));};exports['getBlackLists']=function(_0x458857,_0x4f565d,_0x51fbde){var _0xba7b09={};var _0x34f438={};var _0x503dbc;var _0x125fbb;return db[_0x44ca('0x4d')][_0x44ca('0x64')]({'where':{'id':_0x458857[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x4f565d,null))[_0x44ca('0x28')](function(_0xa9cd0b){if(_0xa9cd0b){_0x503dbc=_0xa9cd0b;_0x34f438[_0x44ca('0x3c')]=_[_0x44ca('0x3f')](db[_0x44ca('0x9d')]['rawAttributes']);_0x34f438[_0x44ca('0x3e')]=_[_0x44ca('0x3f')](_0x458857[_0x44ca('0x3e')]);_0x34f438[_0x44ca('0x40')]=_[_0x44ca('0x41')](_0x34f438[_0x44ca('0x3c')],_0x34f438[_0x44ca('0x3e')]);_0xba7b09['attributes']=_[_0x44ca('0x41')](_0x34f438[_0x44ca('0x3c')],qs[_0x44ca('0x43')](_0x458857[_0x44ca('0x3e')][_0x44ca('0x43')]));_0xba7b09['attributes']=_0xba7b09[_0x44ca('0x42')]['length']?_0xba7b09['attributes']:_0x34f438['model'];_0xba7b09[_0x44ca('0x67')]=qs['sort'](_0x458857[_0x44ca('0x3e')][_0x44ca('0x46')]);_0xba7b09[_0x44ca('0x47')]=qs['filters'](_[_0x44ca('0x48')](_0x458857[_0x44ca('0x3e')],_0x34f438[_0x44ca('0x40')]));if(_0x458857[_0x44ca('0x3e')][_0x44ca('0x49')]){_0xba7b09[_0x44ca('0x47')]=_[_0x44ca('0x4a')](_0xba7b09['where'],{'$or':_[_0x44ca('0x3d')](_0xba7b09[_0x44ca('0x42')],function(_0x5ad0a8){var _0x464daa={};_0x464daa[_0x5ad0a8]={'$like':'%'+_0x458857[_0x44ca('0x3e')][_0x44ca('0x49')]+'%'};return _0x464daa;})});}_0xba7b09=_[_0x44ca('0x4a')]({},_0xba7b09,_0x458857[_0x44ca('0x4c')]);return _0x503dbc['getBlackLists'](_0xba7b09);}})['then'](function(_0xe550aa){if(_0xe550aa){_0x125fbb=_0xe550aa['length'];if(!_0x458857[_0x44ca('0x3e')]['hasOwnProperty']('nolimit')){_0xba7b09[_0x44ca('0x21')]=qs[_0x44ca('0x21')](_0x458857['query'][_0x44ca('0x21')]);_0xba7b09[_0x44ca('0x1f')]=qs['offset'](_0x458857['query'][_0x44ca('0x1f')]);}return _0x503dbc[_0x44ca('0xbf')](_0xba7b09);}})[_0x44ca('0x28')](function(_0x431f22){if(_0x431f22){return _0x431f22?{'count':_0x125fbb,'rows':_0x431f22}:null;}})[_0x44ca('0x28')](respondWithResult(_0x4f565d,null))[_0x44ca('0x52')](handleError(_0x4f565d,null));};exports[_0x44ca('0xc0')]=function(_0x4ab256,_0x42349e,_0x3f1a4d){var _0x3da7a4,_0x5952a8;return db[_0x44ca('0x4d')]['find']({'where':{'id':_0x4ab256[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x42349e,null))[_0x44ca('0x28')](function(_0x55ae80){if(_0x55ae80){_0x5952a8=_0x55ae80;return _0x55ae80[_0x44ca('0xc0')](_0x4ab256['body'][_0x44ca('0x84')],_['omit'](_0x4ab256['body'],['ids','id'])||{});}return null;})[_0x44ca('0x97')](function(_0x117b14){var _0x1f8958;_0x3da7a4=_0x117b14||[];var _0x177ee5=[];if(_0x117b14){for(var _0x11645c=0x0;_0x11645c<_0x117b14[_0x44ca('0x44')];_0x11645c+=0x1){var _0x5e5f21=_0x117b14[_0x11645c]['get']({'plain':!![]});_0x1f8958=squel['insert']()[_0x44ca('0xb5')](_0x44ca('0xc1'))[_0x44ca('0xa5')](['phone',_0x44ca('0xa7'),'ListId',_0x44ca('0x6a'),_0x44ca('0x61'),'updatedAt'],squel[_0x44ca('0x85')]()[_0x44ca('0xa8')](_0x44ca('0xa6'),_0x44ca('0xa6'))['field']('id',_0x44ca('0xa7'))[_0x44ca('0xa8')](_0x5e5f21[_0x44ca('0xaa')][_0x44ca('0x8d')](),_0x44ca('0xab'))[_0x44ca('0xa8')](_0x4ab256[_0x44ca('0x54')]['id'][_0x44ca('0x8d')](),'VoiceQueueId')[_0x44ca('0xa8')](_0x44ca('0xc2'),_0x44ca('0x61'))[_0x44ca('0xa8')](_0x44ca('0xc2'),_0x44ca('0x5f'))[_0x44ca('0xb0')]('cm_contacts')[_0x44ca('0x47')](_0x44ca('0xad'))[_0x44ca('0x47')]('ListId\x20=\x20?',_0x5e5f21['CmListId'][_0x44ca('0x8d')]())['where'](_0x44ca('0xae')))[_0x44ca('0x8d')]();_0x177ee5['push'](db[_0x44ca('0x78')][_0x44ca('0x3e')](_0x1f8958));}return BPromise[_0x44ca('0x90')](_0x177ee5);}})[_0x44ca('0x28')](function(){return _0x3da7a4;})[_0x44ca('0x28')](respondWithResult(_0x42349e,null))['catch'](handleError(_0x42349e,null));};exports[_0x44ca('0xc3')]=function(_0x2d0d67,_0x2073ce,_0x6a6607){return db[_0x44ca('0x4d')][_0x44ca('0x33')]({'where':{'id':_0x2d0d67[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](handleEntityNotFound(_0x2073ce,null))['then'](function(_0x3ff366){if(_0x3ff366){return _0x3ff366[_0x44ca('0xc3')](_0x2d0d67[_0x44ca('0x3e')][_0x44ca('0x84')]);}})[_0x44ca('0x28')](function(_0x3ddc2b){if(_0x3ddc2b){return db[_0x44ca('0x6e')][_0x44ca('0x29')]({'where':{'ListId':_0x2d0d67[_0x44ca('0x3e')]['ids'],'VoiceQueueId':_0x2d0d67[_0x44ca('0x54')]['id']}})[_0x44ca('0x28')](function(){return _0x3ddc2b;});}})[_0x44ca('0x28')](respondWithStatusCode(_0x2073ce,null))[_0x44ca('0x52')](handleError(_0x2073ce,null));}; \ No newline at end of file +var _0xaf11=['include','create','body','user','role','get','userProfileId','autoAssociation','catch','error','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','update','getHoppers','findOne','CmHopper','getHopperHistories','hasOwnProperty','getHopperFinals','CmHopperFinal','VoiceQueueId','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','online','voicePause','interface','Agents','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','field','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','compact','removeAgents','emit','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','updatedAt','select','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','value','find','type','UserProfileResource','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceQueue','includeAll','findAll','rows','show','params','fields'];(function(_0x702a6d,_0x144204){var _0x2f653a=function(_0x5f0eb7){while(--_0x5f0eb7){_0x702a6d['push'](_0x702a6d['shift']());}};_0x2f653a(++_0x144204);}(_0xaf11,0x12f));var _0x1af1=function(_0x39162a,_0x57a8af){_0x39162a=_0x39162a-0x0;var _0x36556f=_0xaf11[_0x39162a];return _0x36556f;};'use strict';var emlformat=require(_0x1af1('0x0'));var rimraf=require(_0x1af1('0x1'));var zipdir=require(_0x1af1('0x2'));var jsonpatch=require(_0x1af1('0x3'));var rp=require('request-promise');var moment=require(_0x1af1('0x4'));var BPromise=require(_0x1af1('0x5'));var Mustache=require(_0x1af1('0x6'));var util=require('util');var path=require(_0x1af1('0x7'));var sox=require(_0x1af1('0x8'));var csv=require(_0x1af1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1af1('0xa'));var _=require('lodash');var squel=require(_0x1af1('0xb'));var crypto=require(_0x1af1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1af1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1af1('0xe'));var Redis=require(_0x1af1('0xf'));var authService=require(_0x1af1('0x10'));var qs=require(_0x1af1('0x11'));var as=require(_0x1af1('0x12'));var hardwareService=require(_0x1af1('0x13'));var logger=require('../../config/logger')(_0x1af1('0x14'));var utils=require(_0x1af1('0x15'));var config=require(_0x1af1('0x16'));var licenseUtil=require(_0x1af1('0x17'));var db=require(_0x1af1('0x18'))['db'];config[_0x1af1('0x19')]=_[_0x1af1('0x1a')](config['redis'],{'host':_0x1af1('0x1b'),'port':0x18eb});var socket=require(_0x1af1('0x1c'))(new Redis(config[_0x1af1('0x19')]));require(_0x1af1('0x1d'))['register'](socket);function respondWithStatusCode(_0x19f4e3,_0x1a7eb8){_0x1a7eb8=_0x1a7eb8||0xcc;return function(_0x1af575){if(_0x1af575){return _0x19f4e3['sendStatus'](_0x1a7eb8);}return _0x19f4e3[_0x1af1('0x1e')](_0x1a7eb8)[_0x1af1('0x1f')]();};}function respondWithResult(_0x38df6f,_0x39f691){_0x39f691=_0x39f691||0xc8;return function(_0x1692aa){if(_0x1692aa){return _0x38df6f[_0x1af1('0x1e')](_0x39f691)[_0x1af1('0x20')](_0x1692aa);}};}function respondWithFilteredResult(_0x45dd76,_0x163a06){return function(_0x20c17b){if(_0x20c17b){var _0x52c11b=typeof _0x163a06['offset']==='undefined'&&typeof _0x163a06[_0x1af1('0x21')]==='undefined';var _0xf1c8ae=_0x20c17b[_0x1af1('0x22')];var _0x19aa3a=_0x52c11b?0x0:_0x163a06[_0x1af1('0x23')];var _0x2866d1=_0x52c11b?_0x20c17b[_0x1af1('0x22')]:_0x163a06['offset']+_0x163a06[_0x1af1('0x21')];var _0x2ef81a;if(_0x2866d1>=_0xf1c8ae){_0x2866d1=_0xf1c8ae;_0x2ef81a=0xc8;}else{_0x2ef81a=0xce;}_0x45dd76[_0x1af1('0x1e')](_0x2ef81a);return _0x45dd76['set'](_0x1af1('0x24'),_0x19aa3a+'-'+_0x2866d1+'/'+_0xf1c8ae)[_0x1af1('0x20')](_0x20c17b);}return null;};}function patchUpdates(_0x535a8e){return function(_0x455052){try{jsonpatch[_0x1af1('0x25')](_0x455052,_0x535a8e,!![]);}catch(_0x187dd4){return BPromise['reject'](_0x187dd4);}return _0x455052[_0x1af1('0x26')]();};}function saveUpdates(_0x4003db,_0x5d3b72){return function(_0x57d9f0){if(_0x57d9f0){return _0x57d9f0['update'](_0x4003db)[_0x1af1('0x27')](function(_0x5df091){return _0x5df091;});}return null;};}function removeEntity(_0x50c0e0,_0x21c60c){return function(_0x461f54){if(_0x461f54){return _0x461f54[_0x1af1('0x28')]()[_0x1af1('0x27')](function(){var _0x6222f1=_0x461f54['get']({'plain':!![]});var _0x371931=[{'name':_0x1af1('0x29'),'value':_0x1af1('0x2a'),'ignore':![]},{'name':_0x1af1('0x2b'),'value':_0x1af1('0x2c'),'ignore':![]}];var _0x3ddf21=_(_0x371931)['filter'](_0x1af1('0x2d'))['map'](_0x1af1('0x2e'))[_0x1af1('0x2e')]();if(_['includes'](_0x3ddf21,_0x6222f1['type'])){return;}var _0xe47522=_[_0x1af1('0x2f')](_0x371931,[_0x1af1('0x2e'),_0x6222f1[_0x1af1('0x30')]])['name'];return db[_0x1af1('0x31')][_0x1af1('0x28')]({'where':{'type':_0xe47522,'resourceId':_0x6222f1['id']}})['then'](function(){return _0x461f54;});})[_0x1af1('0x27')](function(){_0x50c0e0['status'](0xcc)[_0x1af1('0x1f')]();});}};}function handleEntityNotFound(_0x2514b9,_0x243ed6){return function(_0x24f94c){if(!_0x24f94c){_0x2514b9['sendStatus'](0x194);}return _0x24f94c;};}function handleError(_0x2a4648,_0x3e9857){_0x3e9857=_0x3e9857||0x1f4;return function(_0x45fed8){logger['error'](_0x45fed8['stack']);if(_0x45fed8[_0x1af1('0x32')]){delete _0x45fed8['name'];}_0x2a4648[_0x1af1('0x1e')](_0x3e9857)[_0x1af1('0x33')](_0x45fed8);};}exports['index']=function(_0x4c5f9c,_0x139141){var _0x4fcf10={},_0xb52f3f={},_0x25e0c3={'count':0x0,'rows':[]};var _0x153ac3=_[_0x1af1('0x34')](db['VoiceQueue'][_0x1af1('0x35')],function(_0x49c150){return{'name':_0x49c150[_0x1af1('0x36')],'type':_0x49c150['type'][_0x1af1('0x37')]};});_0xb52f3f[_0x1af1('0x38')]=_[_0x1af1('0x34')](_0x153ac3,_0x1af1('0x32'));_0xb52f3f['query']=_[_0x1af1('0x39')](_0x4c5f9c[_0x1af1('0x3a')]);_0xb52f3f[_0x1af1('0x3b')]=_[_0x1af1('0x3c')](_0xb52f3f[_0x1af1('0x38')],_0xb52f3f[_0x1af1('0x3a')]);_0x4fcf10['attributes']=_[_0x1af1('0x3c')](_0xb52f3f[_0x1af1('0x38')],qs['fields'](_0x4c5f9c[_0x1af1('0x3a')]['fields']));_0x4fcf10[_0x1af1('0x3d')]=_0x4fcf10[_0x1af1('0x3d')][_0x1af1('0x3e')]?_0x4fcf10[_0x1af1('0x3d')]:_0xb52f3f[_0x1af1('0x38')];if(!_0x4c5f9c['query']['hasOwnProperty'](_0x1af1('0x3f'))){_0x4fcf10[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x4c5f9c[_0x1af1('0x3a')][_0x1af1('0x21')]);_0x4fcf10['offset']=qs[_0x1af1('0x23')](_0x4c5f9c['query'][_0x1af1('0x23')]);}_0x4fcf10[_0x1af1('0x40')]=qs[_0x1af1('0x41')](_0x4c5f9c['query'][_0x1af1('0x41')]);_0x4fcf10[_0x1af1('0x42')]=qs[_0x1af1('0x3b')](_[_0x1af1('0x43')](_0x4c5f9c[_0x1af1('0x3a')],_0xb52f3f['filters']),_0x153ac3);if(_0x4c5f9c[_0x1af1('0x3a')][_0x1af1('0x44')]){_0x4fcf10['where']=_['merge'](_0x4fcf10['where'],{'$or':_['map'](_0x153ac3,function(_0x35b73f){if(_0x35b73f[_0x1af1('0x30')]!==_0x1af1('0x45')){var _0x53b640={};_0x53b640[_0x35b73f[_0x1af1('0x32')]]={'$like':'%'+_0x4c5f9c[_0x1af1('0x3a')][_0x1af1('0x44')]+'%'};return _0x53b640;}})});}_0x4fcf10=_[_0x1af1('0x46')]({},_0x4fcf10,_0x4c5f9c[_0x1af1('0x47')]);var _0x4531c5={'where':_0x4fcf10['where']};return db[_0x1af1('0x48')][_0x1af1('0x22')](_0x4531c5)[_0x1af1('0x27')](function(_0x2c5a6d){_0x25e0c3['count']=_0x2c5a6d;if(_0x4c5f9c[_0x1af1('0x3a')][_0x1af1('0x49')]){_0x4fcf10['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x1af1('0x4a')](_0x4fcf10);})[_0x1af1('0x27')](function(_0x582c85){_0x25e0c3[_0x1af1('0x4b')]=_0x582c85;return _0x25e0c3;})[_0x1af1('0x27')](respondWithFilteredResult(_0x139141,_0x4fcf10))['catch'](handleError(_0x139141,null));};exports[_0x1af1('0x4c')]=function(_0x4d201b,_0x277e9d){var _0x4d0cba={'raw':![],'where':{'id':_0x4d201b[_0x1af1('0x4d')]['id']}},_0x41d1e6={};_0x41d1e6['model']=_[_0x1af1('0x39')](db[_0x1af1('0x48')][_0x1af1('0x35')]);_0x41d1e6[_0x1af1('0x3a')]=_[_0x1af1('0x39')](_0x4d201b['query']);_0x41d1e6[_0x1af1('0x3b')]=_['intersection'](_0x41d1e6[_0x1af1('0x38')],_0x41d1e6[_0x1af1('0x3a')]);_0x4d0cba['attributes']=_[_0x1af1('0x3c')](_0x41d1e6[_0x1af1('0x38')],qs[_0x1af1('0x4e')](_0x4d201b['query'][_0x1af1('0x4e')]));_0x4d0cba[_0x1af1('0x3d')]=_0x4d0cba[_0x1af1('0x3d')]['length']?_0x4d0cba[_0x1af1('0x3d')]:_0x41d1e6[_0x1af1('0x38')];if(_0x4d201b['query'][_0x1af1('0x49')]){_0x4d0cba[_0x1af1('0x4f')]=[{'all':!![]}];}_0x4d0cba=_[_0x1af1('0x46')]({},_0x4d0cba,_0x4d201b['options']);return db[_0x1af1('0x48')][_0x1af1('0x2f')](_0x4d0cba)[_0x1af1('0x27')](handleEntityNotFound(_0x277e9d,null))['then'](respondWithResult(_0x277e9d,null))['catch'](handleError(_0x277e9d,null));};exports[_0x1af1('0x50')]=function(_0x515925,_0x59173e){return db['VoiceQueue'][_0x1af1('0x50')](_0x515925[_0x1af1('0x51')],{})[_0x1af1('0x27')](function(_0x3c2105){var _0x55734e=_0x515925[_0x1af1('0x52')]['get']({'plain':!![]});if(!_0x55734e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55734e[_0x1af1('0x53')]==='user'){var _0x3f8e30=_0x3c2105[_0x1af1('0x54')]({'plain':!![]});var _0x1403e8=[{'name':_0x1af1('0x29'),'value':_0x1af1('0x2a')},{'name':_0x1af1('0x2b'),'value':_0x1af1('0x2c')}];var _0x572d3b=_[_0x1af1('0x2f')](_0x1403e8,[_0x1af1('0x2e'),_0x3f8e30[_0x1af1('0x30')]])['name'];return db['UserProfileSection'][_0x1af1('0x2f')]({'where':{'name':_0x572d3b,'userProfileId':_0x55734e[_0x1af1('0x55')]},'raw':!![]})[_0x1af1('0x27')](function(_0x5c0131){if(_0x5c0131&&_0x5c0131[_0x1af1('0x56')]===0x0){return db[_0x1af1('0x31')][_0x1af1('0x50')]({'name':_0x3f8e30['name'],'resourceId':_0x3f8e30['id'],'type':_0x5c0131[_0x1af1('0x32')],'sectionId':_0x5c0131['id']},{})[_0x1af1('0x27')](function(){return _0x3c2105;});}else{return _0x3c2105;}})[_0x1af1('0x57')](function(_0x510b09){logger[_0x1af1('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x510b09);throw _0x510b09;});}return _0x3c2105;})[_0x1af1('0x27')](respondWithResult(_0x59173e,0xc9))[_0x1af1('0x57')](handleError(_0x59173e,null));};exports['clone']=function(_0x6bcab0,_0x10fcb1){var _0x4d5b1d={'where':{'id':_0x6bcab0['params']['id']}},_0x1a9ecc={};_0x1a9ecc['model']=_['keys'](db[_0x1af1('0x48')][_0x1af1('0x35')]);_0x4d5b1d[_0x1af1('0x3d')]=_[_0x1af1('0x3c')](_0x1a9ecc[_0x1af1('0x38')],qs[_0x1af1('0x4e')](_0x6bcab0[_0x1af1('0x3a')]['fields']));_0x4d5b1d[_0x1af1('0x3d')]=_0x4d5b1d[_0x1af1('0x3d')][_0x1af1('0x3e')]?_0x4d5b1d['attributes']:_0x1a9ecc[_0x1af1('0x38')];if(_0x6bcab0[_0x1af1('0x3a')][_0x1af1('0x49')]){_0x4d5b1d[_0x1af1('0x4f')]=[{'all':!![]}];}_0x4d5b1d=_[_0x1af1('0x46')]({},_0x4d5b1d,_0x6bcab0['options']);return db[_0x1af1('0x48')]['find'](_0x4d5b1d)[_0x1af1('0x27')](handleEntityNotFound(_0x10fcb1,null))[_0x1af1('0x27')](function(_0xdf4301){if(_0xdf4301){var _0x195cfd=_0xdf4301[_0x1af1('0x54')]({'plain':!![]});_0x195cfd=qs[_0x1af1('0x59')](_0x195cfd,['id','createdAt','updatedAt']);_0x6bcab0[_0x1af1('0x51')]=_[_0x1af1('0x59')](_0x6bcab0[_0x1af1('0x51')],['id',_0x1af1('0x5a'),'updatedAt']);return db[_0x1af1('0x48')][_0x1af1('0x50')](_[_0x1af1('0x46')](_0x195cfd,_0x6bcab0[_0x1af1('0x51')]),{'include':_0x6bcab0['query'][_0x1af1('0x49')]?[{'all':!![]}]:undefined})[_0x1af1('0x27')](function(_0x287ed6){var _0x59a5b2=_0x6bcab0[_0x1af1('0x52')][_0x1af1('0x54')]({'plain':!![]});if(!_0x59a5b2)throw new Error(_0x1af1('0x5b'));if(_0x59a5b2[_0x1af1('0x53')]===_0x1af1('0x52')){var _0x38261d=_0x287ed6[_0x1af1('0x54')]({'plain':!![]});var _0x44f21b=[{'name':'VoiceQueues','value':_0x1af1('0x2a')},{'name':_0x1af1('0x2b'),'value':_0x1af1('0x2c')}];var _0x214a82=_[_0x1af1('0x2f')](_0x44f21b,[_0x1af1('0x2e'),_0x38261d[_0x1af1('0x30')]])[_0x1af1('0x32')];return db[_0x1af1('0x5c')][_0x1af1('0x2f')]({'where':{'name':_0x214a82,'userProfileId':_0x59a5b2[_0x1af1('0x55')]},'raw':!![]})[_0x1af1('0x27')](function(_0x5d53dc){if(_0x5d53dc&&_0x5d53dc[_0x1af1('0x56')]===0x0){return db[_0x1af1('0x31')][_0x1af1('0x50')]({'name':_0x38261d[_0x1af1('0x32')],'resourceId':_0x38261d['id'],'type':_0x5d53dc[_0x1af1('0x32')],'sectionId':_0x5d53dc['id']},{})[_0x1af1('0x27')](function(){return _0x287ed6;});}else{return _0x287ed6;}})[_0x1af1('0x57')](function(_0x2891e6){logger[_0x1af1('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2891e6);throw _0x2891e6;});}return _0x287ed6;});}})[_0x1af1('0x27')](respondWithResult(_0x10fcb1,0xc9))['catch'](handleError(_0x10fcb1,null));};exports[_0x1af1('0x5d')]=function(_0x3941e9,_0x425c16){if(_0x3941e9[_0x1af1('0x51')]['id']){delete _0x3941e9[_0x1af1('0x51')]['id'];}return db[_0x1af1('0x48')][_0x1af1('0x2f')]({'where':{'id':_0x3941e9[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x425c16,null))[_0x1af1('0x27')](saveUpdates(_0x3941e9[_0x1af1('0x51')],null))[_0x1af1('0x27')](respondWithResult(_0x425c16,null))[_0x1af1('0x57')](handleError(_0x425c16,null));};exports[_0x1af1('0x28')]=function(_0x77d2b5,_0x40a01c){return db['VoiceQueue'][_0x1af1('0x2f')]({'where':{'id':_0x77d2b5[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x40a01c,null))[_0x1af1('0x27')](removeEntity(_0x40a01c,null))[_0x1af1('0x57')](handleError(_0x40a01c,null));};exports[_0x1af1('0x5e')]=function(_0x50040e,_0x19da2b,_0x55d85e){var _0x19a7f3={'raw':![],'where':{}};var _0x482f44={};var _0x34aaae={'count':0x0,'rows':[]};return db[_0x1af1('0x48')][_0x1af1('0x5f')]({'where':{'id':_0x50040e[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x19da2b,null))[_0x1af1('0x27')](function(_0x401b76){if(_0x401b76){_0x482f44[_0x1af1('0x38')]=_[_0x1af1('0x39')](db[_0x1af1('0x60')]['rawAttributes']);_0x482f44[_0x1af1('0x3a')]=_['keys'](_0x50040e[_0x1af1('0x3a')]);_0x482f44[_0x1af1('0x3b')]=_[_0x1af1('0x3c')](_0x482f44[_0x1af1('0x38')],_0x482f44[_0x1af1('0x3a')]);_0x19a7f3[_0x1af1('0x3d')]=_[_0x1af1('0x3c')](_0x482f44[_0x1af1('0x38')],qs[_0x1af1('0x4e')](_0x50040e[_0x1af1('0x3a')][_0x1af1('0x4e')]));_0x19a7f3[_0x1af1('0x3d')]=_0x19a7f3[_0x1af1('0x3d')][_0x1af1('0x3e')]?_0x19a7f3[_0x1af1('0x3d')]:_0x482f44[_0x1af1('0x38')];if(!_0x50040e['query']['hasOwnProperty'](_0x1af1('0x3f'))){_0x19a7f3[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x50040e[_0x1af1('0x3a')]['limit']);_0x19a7f3[_0x1af1('0x23')]=qs[_0x1af1('0x23')](_0x50040e[_0x1af1('0x3a')][_0x1af1('0x23')]);}_0x19a7f3['order']=qs[_0x1af1('0x41')](_0x50040e['query']['sort']);_0x19a7f3[_0x1af1('0x42')]=qs[_0x1af1('0x3b')](_[_0x1af1('0x43')](_0x50040e[_0x1af1('0x3a')],_0x482f44[_0x1af1('0x3b')]));_0x19a7f3[_0x1af1('0x42')]['VoiceQueueId']=_0x401b76['id'];if(_0x50040e[_0x1af1('0x3a')]['filter']){_0x19a7f3[_0x1af1('0x42')]=_[_0x1af1('0x46')](_0x19a7f3['where'],{'$or':_[_0x1af1('0x34')](_0x19a7f3[_0x1af1('0x3d')],function(_0x3673a8){var _0x3ee685={};_0x3ee685[_0x3673a8]={'$like':'%'+_0x50040e[_0x1af1('0x3a')][_0x1af1('0x44')]+'%'};return _0x3ee685;})});}_0x19a7f3=_[_0x1af1('0x46')]({},_0x19a7f3,_0x50040e['options']);return db[_0x1af1('0x60')]['count']({'where':_0x19a7f3[_0x1af1('0x42')]})[_0x1af1('0x27')](function(_0x35aad1){_0x34aaae[_0x1af1('0x22')]=_0x35aad1;if(_0x50040e[_0x1af1('0x3a')][_0x1af1('0x49')]){_0x19a7f3[_0x1af1('0x4f')]=[{'all':!![]}];}return db[_0x1af1('0x60')]['findAll'](_0x19a7f3);})[_0x1af1('0x27')](function(_0x1c91a8){_0x34aaae['rows']=_0x1c91a8;return _0x34aaae;});}})['then'](respondWithFilteredResult(_0x19da2b,_0x19a7f3))[_0x1af1('0x57')](handleError(_0x19da2b,null));};exports[_0x1af1('0x61')]=function(_0x10cf03,_0x300365,_0x57453a){var _0x915278={'raw':!![],'where':{}};var _0x3b62ef={};var _0x57a39b={'count':0x0,'rows':[]};return db[_0x1af1('0x48')][_0x1af1('0x5f')]({'where':{'id':_0x10cf03[_0x1af1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x300365,null))[_0x1af1('0x27')](function(_0x5627cd){if(_0x5627cd){_0x3b62ef['model']=_[_0x1af1('0x39')](db['CmHopperHistory'][_0x1af1('0x35')]);_0x3b62ef['query']=_['keys'](_0x10cf03[_0x1af1('0x3a')]);_0x3b62ef['filters']=_[_0x1af1('0x3c')](_0x3b62ef[_0x1af1('0x38')],_0x3b62ef['query']);_0x915278['attributes']=_[_0x1af1('0x3c')](_0x3b62ef['model'],qs['fields'](_0x10cf03['query'][_0x1af1('0x4e')]));_0x915278[_0x1af1('0x3d')]=_0x915278[_0x1af1('0x3d')][_0x1af1('0x3e')]?_0x915278[_0x1af1('0x3d')]:_0x3b62ef['model'];if(!_0x10cf03['query'][_0x1af1('0x62')]('nolimit')){_0x915278[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x10cf03[_0x1af1('0x3a')][_0x1af1('0x21')]);_0x915278[_0x1af1('0x23')]=qs[_0x1af1('0x23')](_0x10cf03[_0x1af1('0x3a')]['offset']);}_0x915278[_0x1af1('0x40')]=qs[_0x1af1('0x41')](_0x10cf03[_0x1af1('0x3a')][_0x1af1('0x41')]);_0x915278[_0x1af1('0x42')]=qs['filters'](_[_0x1af1('0x43')](_0x10cf03['query'],_0x3b62ef[_0x1af1('0x3b')]));_0x915278[_0x1af1('0x42')]['VoiceQueueId']=_0x5627cd['id'];if(_0x10cf03[_0x1af1('0x3a')][_0x1af1('0x44')]){_0x915278[_0x1af1('0x42')]=_[_0x1af1('0x46')](_0x915278['where'],{'$or':_[_0x1af1('0x34')](_0x915278['attributes'],function(_0x3eed63){var _0x31d07e={};_0x31d07e[_0x3eed63]={'$like':'%'+_0x10cf03['query']['filter']+'%'};return _0x31d07e;})});}_0x915278=_[_0x1af1('0x46')]({},_0x915278,_0x10cf03[_0x1af1('0x47')]);return db['CmHopperHistory'][_0x1af1('0x22')]({'where':_0x915278[_0x1af1('0x42')]})[_0x1af1('0x27')](function(_0x4eafe2){_0x57a39b['count']=_0x4eafe2;if(_0x10cf03[_0x1af1('0x3a')]['includeAll']){_0x915278[_0x1af1('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x1af1('0x4a')](_0x915278);})[_0x1af1('0x27')](function(_0x50a9dc){_0x57a39b['rows']=_0x50a9dc;return _0x57a39b;});}})[_0x1af1('0x27')](respondWithFilteredResult(_0x300365,_0x915278))[_0x1af1('0x57')](handleError(_0x300365,null));};exports[_0x1af1('0x63')]=function(_0x46ce8b,_0x40f697,_0x3f486e){var _0x576ebe={'raw':!![],'where':{}};var _0x566448={};var _0x3a6684={'count':0x0,'rows':[]};return db[_0x1af1('0x48')][_0x1af1('0x5f')]({'where':{'id':_0x46ce8b['params']['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x40f697,null))[_0x1af1('0x27')](function(_0x38920c){if(_0x38920c){_0x566448['model']=_[_0x1af1('0x39')](db[_0x1af1('0x64')][_0x1af1('0x35')]);_0x566448[_0x1af1('0x3a')]=_['keys'](_0x46ce8b[_0x1af1('0x3a')]);_0x566448[_0x1af1('0x3b')]=_['intersection'](_0x566448[_0x1af1('0x38')],_0x566448[_0x1af1('0x3a')]);_0x576ebe[_0x1af1('0x3d')]=_[_0x1af1('0x3c')](_0x566448[_0x1af1('0x38')],qs[_0x1af1('0x4e')](_0x46ce8b[_0x1af1('0x3a')][_0x1af1('0x4e')]));_0x576ebe['attributes']=_0x576ebe[_0x1af1('0x3d')][_0x1af1('0x3e')]?_0x576ebe[_0x1af1('0x3d')]:_0x566448[_0x1af1('0x38')];if(!_0x46ce8b[_0x1af1('0x3a')][_0x1af1('0x62')](_0x1af1('0x3f'))){_0x576ebe[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x46ce8b[_0x1af1('0x3a')]['limit']);_0x576ebe['offset']=qs['offset'](_0x46ce8b[_0x1af1('0x3a')]['offset']);}_0x576ebe[_0x1af1('0x40')]=qs[_0x1af1('0x41')](_0x46ce8b[_0x1af1('0x3a')][_0x1af1('0x41')]);_0x576ebe['where']=qs['filters'](_[_0x1af1('0x43')](_0x46ce8b[_0x1af1('0x3a')],_0x566448[_0x1af1('0x3b')]));_0x576ebe[_0x1af1('0x42')][_0x1af1('0x65')]=_0x38920c['id'];if(_0x46ce8b['query']['filter']){_0x576ebe[_0x1af1('0x42')]=_['merge'](_0x576ebe[_0x1af1('0x42')],{'$or':_[_0x1af1('0x34')](_0x576ebe[_0x1af1('0x3d')],function(_0x460202){var _0x5ba57f={};_0x5ba57f[_0x460202]={'$like':'%'+_0x46ce8b['query'][_0x1af1('0x44')]+'%'};return _0x5ba57f;})});}_0x576ebe=_[_0x1af1('0x46')]({},_0x576ebe,_0x46ce8b['options']);return db[_0x1af1('0x64')]['count']({'where':_0x576ebe[_0x1af1('0x42')]})[_0x1af1('0x27')](function(_0x46b2c0){_0x3a6684[_0x1af1('0x22')]=_0x46b2c0;if(_0x46ce8b[_0x1af1('0x3a')][_0x1af1('0x49')]){_0x576ebe[_0x1af1('0x4f')]=[{'all':!![]}];}return db[_0x1af1('0x64')][_0x1af1('0x4a')](_0x576ebe);})[_0x1af1('0x27')](function(_0x439c44){_0x3a6684[_0x1af1('0x4b')]=_0x439c44;return _0x3a6684;});}})[_0x1af1('0x27')](respondWithFilteredResult(_0x40f697,_0x576ebe))[_0x1af1('0x57')](handleError(_0x40f697,null));};exports[_0x1af1('0x66')]=function(_0x2b9e9b,_0x208e74,_0x45d924){var _0x213d85={'raw':!![],'where':{}};var _0x4c6ae6={};var _0x1586ff={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x1af1('0x5f')]({'where':{'id':_0x2b9e9b[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x208e74,null))[_0x1af1('0x27')](function(_0x119067){if(_0x119067){_0x4c6ae6[_0x1af1('0x38')]=_[_0x1af1('0x39')](db['CmHopperBlack']['rawAttributes']);_0x4c6ae6[_0x1af1('0x3a')]=_[_0x1af1('0x39')](_0x2b9e9b[_0x1af1('0x3a')]);_0x4c6ae6[_0x1af1('0x3b')]=_[_0x1af1('0x3c')](_0x4c6ae6['model'],_0x4c6ae6[_0x1af1('0x3a')]);_0x213d85[_0x1af1('0x3d')]=_[_0x1af1('0x3c')](_0x4c6ae6[_0x1af1('0x38')],qs['fields'](_0x2b9e9b[_0x1af1('0x3a')][_0x1af1('0x4e')]));_0x213d85[_0x1af1('0x3d')]=_0x213d85['attributes'][_0x1af1('0x3e')]?_0x213d85[_0x1af1('0x3d')]:_0x4c6ae6[_0x1af1('0x38')];if(!_0x2b9e9b[_0x1af1('0x3a')]['hasOwnProperty'](_0x1af1('0x3f'))){_0x213d85[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x2b9e9b[_0x1af1('0x3a')][_0x1af1('0x21')]);_0x213d85['offset']=qs['offset'](_0x2b9e9b['query']['offset']);}_0x213d85[_0x1af1('0x40')]=qs[_0x1af1('0x41')](_0x2b9e9b[_0x1af1('0x3a')][_0x1af1('0x41')]);_0x213d85[_0x1af1('0x42')]=qs['filters'](_[_0x1af1('0x43')](_0x2b9e9b[_0x1af1('0x3a')],_0x4c6ae6[_0x1af1('0x3b')]));_0x213d85[_0x1af1('0x42')][_0x1af1('0x65')]=_0x119067['id'];if(_0x2b9e9b['query'][_0x1af1('0x44')]){_0x213d85[_0x1af1('0x42')]=_[_0x1af1('0x46')](_0x213d85[_0x1af1('0x42')],{'$or':_['map'](_0x213d85[_0x1af1('0x3d')],function(_0x56d227){var _0x3fcb20={};_0x3fcb20[_0x56d227]={'$like':'%'+_0x2b9e9b[_0x1af1('0x3a')]['filter']+'%'};return _0x3fcb20;})});}_0x213d85=_[_0x1af1('0x46')]({},_0x213d85,_0x2b9e9b[_0x1af1('0x47')]);return db[_0x1af1('0x67')][_0x1af1('0x22')]({'where':_0x213d85[_0x1af1('0x42')]})[_0x1af1('0x27')](function(_0x5006b3){_0x1586ff[_0x1af1('0x22')]=_0x5006b3;if(_0x2b9e9b['query'][_0x1af1('0x49')]){_0x213d85['include']=[{'all':!![]}];}return db[_0x1af1('0x67')][_0x1af1('0x4a')](_0x213d85);})['then'](function(_0x472064){_0x1586ff[_0x1af1('0x4b')]=_0x472064;return _0x1586ff;});}})[_0x1af1('0x27')](respondWithFilteredResult(_0x208e74,_0x213d85))[_0x1af1('0x57')](handleError(_0x208e74,null));};exports[_0x1af1('0x68')]=function(_0x5c7b10,_0x27b5c2,_0x24bdba){var _0x308473={};var _0x29bd99={};var _0x326806;var _0x382720;return db[_0x1af1('0x48')][_0x1af1('0x5f')]({'where':{'id':_0x5c7b10[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x27b5c2,null))['then'](function(_0x4e6a08){if(_0x4e6a08){_0x326806=_0x4e6a08;_0x29bd99['model']=_['keys'](db[_0x1af1('0x69')][_0x1af1('0x35')]);_0x29bd99[_0x1af1('0x3a')]=_['keys'](_0x5c7b10[_0x1af1('0x3a')]);_0x29bd99[_0x1af1('0x3b')]=_[_0x1af1('0x3c')](_0x29bd99[_0x1af1('0x38')],_0x29bd99[_0x1af1('0x3a')]);_0x308473[_0x1af1('0x3d')]=_[_0x1af1('0x3c')](_0x29bd99['model'],qs['fields'](_0x5c7b10[_0x1af1('0x3a')]['fields']));_0x308473['attributes']=_0x308473[_0x1af1('0x3d')][_0x1af1('0x3e')]?_0x308473[_0x1af1('0x3d')]:_0x29bd99[_0x1af1('0x38')];_0x308473['order']=qs[_0x1af1('0x41')](_0x5c7b10[_0x1af1('0x3a')][_0x1af1('0x41')]);_0x308473[_0x1af1('0x42')]=qs[_0x1af1('0x3b')](_['pick'](_0x5c7b10[_0x1af1('0x3a')],_0x29bd99[_0x1af1('0x3b')]));if(_0x5c7b10['query'][_0x1af1('0x44')]){_0x308473['where']=_[_0x1af1('0x46')](_0x308473[_0x1af1('0x42')],{'$or':_[_0x1af1('0x34')](_0x308473[_0x1af1('0x3d')],function(_0x13074c){var _0x1a0b56={};_0x1a0b56[_0x13074c]={'$like':'%'+_0x5c7b10[_0x1af1('0x3a')][_0x1af1('0x44')]+'%'};return _0x1a0b56;})});}_0x308473=_['merge']({},_0x308473,_0x5c7b10['options']);return _0x326806[_0x1af1('0x68')](_0x308473);}})[_0x1af1('0x27')](function(_0x160634){if(_0x160634){_0x382720=_0x160634[_0x1af1('0x3e')];if(!_0x5c7b10[_0x1af1('0x3a')][_0x1af1('0x62')](_0x1af1('0x3f'))){_0x308473[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x5c7b10[_0x1af1('0x3a')][_0x1af1('0x21')]);_0x308473[_0x1af1('0x23')]=qs[_0x1af1('0x23')](_0x5c7b10[_0x1af1('0x3a')][_0x1af1('0x23')]);}return _0x326806['getTeams'](_0x308473);}})[_0x1af1('0x27')](function(_0x484a07){if(_0x484a07){return _0x484a07?{'count':_0x382720,'rows':_0x484a07}:null;}})[_0x1af1('0x27')](respondWithResult(_0x27b5c2,null))[_0x1af1('0x57')](handleError(_0x27b5c2,null));};exports[_0x1af1('0x6a')]=function(_0x3c752a,_0x123834,_0x1015cc){var _0x3e2edd=_0x3c752a[_0x1af1('0x51')][_0x1af1('0x6b')];var _0x443829=_[_0x1af1('0x34')](_0x3e2edd,'id');return db[_0x1af1('0x69')][_0x1af1('0x4a')]({'where':{'id':_0x443829},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1af1('0x32'),_0x1af1('0x6c'),_0x1af1('0x6d'),_0x1af1('0x6e')],'raw':!![]}]})[_0x1af1('0x27')](function(_0x52453b){if(_0x52453b){var _0x1c6ba2=_['flatMap'](_0x52453b,function(_0x14c044){var _0x34b7e6=_0x14c044['get']({'plain':!![]});_0x34b7e6[_0x1af1('0x6f')][_0x1af1('0x70')](function(_0x2e6f8d){_0x2e6f8d[_0x1af1('0x71')]=_[_0x1af1('0x2f')](_0x3e2edd,{'id':_0x34b7e6['id']})[_0x1af1('0x71')];});return _0x34b7e6[_0x1af1('0x6f')];});return db['VoiceQueue'][_0x1af1('0x2f')]({'where':{'id':_0x3c752a[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](function(_0x3c5261){return db[_0x1af1('0x72')][_0x1af1('0x73')](function(_0x3f9f49){return _0x3c5261['addTeams'](_0x443829,{'transaction':_0x3f9f49})[_0x1af1('0x27')](function(){return BPromise[_0x1af1('0x74')](_0x3e2edd,function(_0xbad93){return db['TeamVoiceQueue']['upsert']({'TeamId':_0xbad93['id'],'VoiceQueueId':_0x3c752a[_0x1af1('0x4d')]['id'],'penalty':_0xbad93[_0x1af1('0x71')]},{'transaction':_0x3f9f49});});})[_0x1af1('0x27')](function(){return BPromise[_0x1af1('0x74')](_0x1c6ba2,function(_0x28c767){return db[_0x1af1('0x75')][_0x1af1('0x76')]({'where':{'UserId':_0x28c767['id'],'VoiceQueueId':_0x3c752a[_0x1af1('0x4d')]['id']},'defaults':{'penalty':_0x28c767[_0x1af1('0x71')]},'transaction':_0x3f9f49});});})['then'](function(){return BPromise[_0x1af1('0x74')](_[_0x1af1('0x44')](_0x1c6ba2,{'online':!![]}),function(_0x24666e){return db[_0x1af1('0x77')][_0x1af1('0x78')]({'membername':_0x24666e[_0x1af1('0x32')],'UserId':_0x24666e['id'],'queue_name':_0x3c5261[_0x1af1('0x32')],'VoiceQueueId':_0x3c5261['id'],'interface':_[_0x1af1('0x79')](_0x24666e[_0x1af1('0x6e')])?util[_0x1af1('0x7a')](_0x1af1('0x7b'),_0x24666e[_0x1af1('0x32')]):_0x24666e[_0x1af1('0x6e')],'paused':_0x24666e[_0x1af1('0x6d')]||![],'penalty':_0x24666e[_0x1af1('0x71')]},{'transaction':_0x3f9f49});});})[_0x1af1('0x27')](function(){_0x1c6ba2[_0x1af1('0x70')](function(_0x295dac){socket['emit'](_0x1af1('0x7c'),{'UserId':_0x295dac['id'],'VoiceQueueId':_0x3c5261['id']});});});});});}})[_0x1af1('0x27')](respondWithStatusCode(_0x123834,null))[_0x1af1('0x57')](handleError(_0x123834,null));};exports[_0x1af1('0x7d')]=function(_0x5ea5e9,_0x1f6b86,_0x2647a1){return db[_0x1af1('0x69')]['findAll']({'where':{'id':_0x5ea5e9[_0x1af1('0x3a')][_0x1af1('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x1af1('0x7f')],'as':_0x1af1('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1af1('0x27')](handleEntityNotFound(_0x1f6b86,null))[_0x1af1('0x27')](function(_0x374b48){var _0x5cbbfb=_['map'](_0x374b48,'id');var _0x12ae60=[];var _0x1a9135=[];var _0x18ce49=squel['select']();_0x18ce49[_0x1af1('0x80')]('tq.TeamId')[_0x1af1('0x81')](_0x1af1('0x82'),'tq')[_0x1af1('0x83')]('user_has_teams','ut',_0x1af1('0x84'))['where'](_0x1af1('0x85'),_0x5ea5e9[_0x1af1('0x4d')]['id']);for(var _0x31380f=0x0;_0x31380f<_0x374b48[_0x1af1('0x3e')];_0x31380f+=0x1){let _0x443cd2=_0x374b48[_0x31380f];for(var _0x5c4721=0x0;_0x5c4721<_0x443cd2[_0x1af1('0x6f')][_0x1af1('0x3e')];_0x5c4721+=0x1){let _0x133b98=_0x443cd2['Agents'][_0x5c4721];var _0x4302b8=_0x18ce49['clone']();_0x4302b8[_0x1af1('0x42')]('ut.UserId\x20=\x20?',_0x133b98['id']);_0x1a9135[_0x1af1('0x86')](db[_0x1af1('0x72')][_0x1af1('0x3a')](_0x4302b8[_0x1af1('0x87')](),{'type':db[_0x1af1('0x72')]['QueryTypes'][_0x1af1('0x88')]})[_0x1af1('0x27')](function(_0x66c52c){if(_0x66c52c['length']===0x1){return _0x133b98['id'];}else{var _0x44b54e=_[_0x1af1('0x89')](_[_0x1af1('0x34')](_0x66c52c,_0x1af1('0x8a')),function(_0x484676){return _[_0x1af1('0x8b')](_0x5cbbfb,_0x484676);});if(_0x44b54e){return _0x133b98['id'];}}}));}}return BPromise['all'](_0x1a9135)[_0x1af1('0x27')](function(_0x331ce7){_0x12ae60=_(_0x12ae60)['union'](_0x331ce7)[_0x1af1('0x8c')]()['value']();return db['VoiceQueue'][_0x1af1('0x2f')]({'where':{'id':_0x5ea5e9[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](function(_0x3bf669){return db[_0x1af1('0x72')][_0x1af1('0x73')](function(_0x319fce){return _0x3bf669['removeTeams'](_0x5ea5e9[_0x1af1('0x3a')][_0x1af1('0x7e')],{'transaction':_0x319fce})[_0x1af1('0x27')](function(){if(!_['isEmpty'](_0x12ae60)){return _0x3bf669[_0x1af1('0x8d')](_0x12ae60,{'transaction':_0x319fce})[_0x1af1('0x27')](function(){return db['UserVoiceQueueRt'][_0x1af1('0x28')]({'where':{'VoiceQueueId':_0x5ea5e9[_0x1af1('0x4d')]['id'],'UserId':_0x12ae60},'transaction':_0x319fce});});}})['then'](function(){_0x12ae60['forEach'](function(_0xf60457){socket[_0x1af1('0x8e')]('userVoiceQueue:remove',{'UserId':_0xf60457,'VoiceQueueId':_0x3bf669['id']});});});});});});})[_0x1af1('0x27')](respondWithStatusCode(_0x1f6b86,null))['catch'](handleError(_0x1f6b86,null));};exports[_0x1af1('0x8f')]=function(_0x3dfa90,_0x2915a8,_0x15e1ed){var _0x32a2e3,_0x5af8c7;return db[_0x1af1('0x48')]['find']({'where':{'id':_0x3dfa90['params']['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x2915a8,null))[_0x1af1('0x27')](function(_0x2a052e){if(_0x2a052e){_0x5af8c7=_0x2a052e;return _0x2a052e[_0x1af1('0x8f')](_0x3dfa90[_0x1af1('0x51')][_0x1af1('0x7e')],_['omit'](_0x3dfa90[_0x1af1('0x51')],['ids','id'])||{})[_0x1af1('0x90')](function(_0xca2241){for(var _0x4ea4f3=0x0;_0x4ea4f3<_0x3dfa90[_0x1af1('0x51')][_0x1af1('0x7e')]['length'];_0x4ea4f3+=0x1){socket[_0x1af1('0x8e')](_0x1af1('0x7c'),{'UserId':Number(_0x3dfa90[_0x1af1('0x51')][_0x1af1('0x7e')][_0x4ea4f3]),'VoiceQueueId':Number(_0x3dfa90['params']['id'])});}return _0xca2241;});}})[_0x1af1('0x27')](function(_0x3ed6de){_0x32a2e3=_0x3ed6de||[];if(_0x5af8c7){return db[_0x1af1('0x7f')][_0x1af1('0x4a')]({'where':{'id':_0x3dfa90[_0x1af1('0x51')][_0x1af1('0x7e')]},'attributes':['id',_0x1af1('0x32'),_0x1af1('0x6c'),_0x1af1('0x6d'),_0x1af1('0x6e')],'raw':!![]});}})[_0x1af1('0x27')](function(_0x3b373d){if(!_['isEmpty'](_0x3b373d)){var _0x21a96f=[];for(var _0x2d1caf=0x0;_0x2d1caf<_0x3b373d['length'];_0x2d1caf++){if(_0x3b373d[_0x2d1caf][_0x1af1('0x6c')]){_0x21a96f['push'](db[_0x1af1('0x77')][_0x1af1('0x78')]({'membername':_0x3b373d[_0x2d1caf][_0x1af1('0x32')],'UserId':_0x3b373d[_0x2d1caf]['id'],'queue_name':_0x5af8c7[_0x1af1('0x32')],'VoiceQueueId':_0x5af8c7['id'],'interface':_[_0x1af1('0x79')](_0x3b373d[_0x2d1caf]['interface'])?util[_0x1af1('0x7a')](_0x1af1('0x7b'),_0x3b373d[_0x2d1caf][_0x1af1('0x32')]):_0x3b373d[_0x2d1caf][_0x1af1('0x6e')],'paused':_0x3b373d[_0x2d1caf]['voicePause']||![],'penalty':_0x3dfa90['body']['penalty']||0x0}));}}return BPromise[_0x1af1('0x91')](_0x21a96f);}})[_0x1af1('0x27')](function(){return _0x32a2e3;})[_0x1af1('0x27')](respondWithResult(_0x2915a8,null))[_0x1af1('0x57')](handleError(_0x2915a8,null));};exports[_0x1af1('0x8d')]=function(_0x10ae11,_0x18e6b0,_0x1cdbc6){return db[_0x1af1('0x48')][_0x1af1('0x2f')]({'where':{'id':_0x10ae11['params']['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x18e6b0,null))[_0x1af1('0x27')](function(_0x3a4f60){if(_0x3a4f60){return _0x3a4f60[_0x1af1('0x8d')](_0x10ae11[_0x1af1('0x3a')][_0x1af1('0x7e')])['then'](function(){if(_[_0x1af1('0x92')](_0x10ae11[_0x1af1('0x3a')][_0x1af1('0x7e')])){for(var _0x5994f6=0x0;_0x5994f6<_0x10ae11[_0x1af1('0x3a')][_0x1af1('0x7e')][_0x1af1('0x3e')];_0x5994f6+=0x1){socket['emit'](_0x1af1('0x93'),{'UserId':Number(_0x10ae11[_0x1af1('0x3a')]['ids'][_0x5994f6]),'VoiceQueueId':Number(_0x10ae11[_0x1af1('0x4d')]['id'])});}}else{socket[_0x1af1('0x8e')]('userVoiceQueue:remove',{'UserId':Number(_0x10ae11[_0x1af1('0x3a')][_0x1af1('0x7e')]),'VoiceQueueId':Number(_0x10ae11[_0x1af1('0x4d')]['id'])});}});}})['then'](function(_0x1e0ed3){return db[_0x1af1('0x77')][_0x1af1('0x28')]({'where':{'VoiceQueueId':_0x10ae11[_0x1af1('0x4d')]['id'],'UserId':_0x10ae11[_0x1af1('0x3a')][_0x1af1('0x7e')]}})[_0x1af1('0x27')](function(){return _0x1e0ed3;});})['then'](respondWithStatusCode(_0x18e6b0,null))[_0x1af1('0x57')](handleError(_0x18e6b0,null));};exports[_0x1af1('0x94')]=function(_0x577999,_0x4d8c5b,_0x47fcca){var _0x40c325={};var _0x235bdf={};var _0x54d07c;var _0x3113f8;return db[_0x1af1('0x48')]['findOne']({'where':{'id':_0x577999[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x4d8c5b,null))[_0x1af1('0x27')](function(_0x2b23de){if(_0x2b23de){_0x54d07c=_0x2b23de;_0x235bdf[_0x1af1('0x38')]=_[_0x1af1('0x39')](db['User']['rawAttributes']);_0x235bdf[_0x1af1('0x3a')]=_[_0x1af1('0x39')](_0x577999[_0x1af1('0x3a')]);_0x235bdf[_0x1af1('0x3b')]=_[_0x1af1('0x3c')](_0x235bdf[_0x1af1('0x38')],_0x235bdf[_0x1af1('0x3a')]);_0x40c325[_0x1af1('0x3d')]=_[_0x1af1('0x3c')](_0x235bdf[_0x1af1('0x38')],qs['fields'](_0x577999['query'][_0x1af1('0x4e')]));_0x40c325[_0x1af1('0x3d')]=_0x40c325[_0x1af1('0x3d')][_0x1af1('0x3e')]?_0x40c325['attributes']:_0x235bdf['model'];_0x40c325[_0x1af1('0x40')]=qs[_0x1af1('0x41')](_0x577999[_0x1af1('0x3a')][_0x1af1('0x41')]);_0x40c325[_0x1af1('0x42')]=qs[_0x1af1('0x3b')](_[_0x1af1('0x43')](_0x577999['query'],_0x235bdf[_0x1af1('0x3b')]));if(_0x577999[_0x1af1('0x3a')][_0x1af1('0x44')]){_0x40c325[_0x1af1('0x42')]=_['merge'](_0x40c325[_0x1af1('0x42')],{'$or':_[_0x1af1('0x34')](_0x40c325['attributes'],function(_0x119f9f){var _0x178cbb={};_0x178cbb[_0x119f9f]={'$like':'%'+_0x577999[_0x1af1('0x3a')][_0x1af1('0x44')]+'%'};return _0x178cbb;})});}_0x40c325=_[_0x1af1('0x46')]({},_0x40c325,_0x577999['options']);return _0x54d07c[_0x1af1('0x94')](_0x40c325);}})['then'](function(_0x302eb0){if(_0x302eb0){_0x3113f8=_0x302eb0['length'];if(!_0x577999[_0x1af1('0x3a')][_0x1af1('0x62')](_0x1af1('0x3f'))){_0x40c325[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x577999[_0x1af1('0x3a')][_0x1af1('0x21')]);_0x40c325[_0x1af1('0x23')]=qs[_0x1af1('0x23')](_0x577999[_0x1af1('0x3a')]['offset']);}return _0x54d07c['getAgents'](_0x40c325);}})['then'](function(_0x273e22){if(_0x273e22){return _0x273e22?{'count':_0x3113f8,'rows':_0x273e22}:null;}})[_0x1af1('0x27')](respondWithResult(_0x4d8c5b,null))[_0x1af1('0x57')](handleError(_0x4d8c5b,null));};exports[_0x1af1('0x95')]=function(_0x3d1805,_0x243d28,_0x596ea8){var _0x4ee03e={};var _0x3ef16b={};var _0x38a45d;var _0x8f976a;return db[_0x1af1('0x48')][_0x1af1('0x5f')]({'where':{'id':_0x3d1805[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x243d28,null))['then'](function(_0x2530c6){if(_0x2530c6){_0x38a45d=_0x2530c6;_0x3ef16b['model']=_[_0x1af1('0x39')](db[_0x1af1('0x77')][_0x1af1('0x35')]);_0x3ef16b[_0x1af1('0x3a')]=_[_0x1af1('0x39')](_0x3d1805[_0x1af1('0x3a')]);_0x3ef16b['filters']=_['intersection'](_0x3ef16b[_0x1af1('0x38')],_0x3ef16b['query']);_0x4ee03e[_0x1af1('0x3d')]=_[_0x1af1('0x3c')](_0x3ef16b[_0x1af1('0x38')],qs['fields'](_0x3d1805[_0x1af1('0x3a')][_0x1af1('0x4e')]));_0x4ee03e['attributes']=_0x4ee03e['attributes']['length']?_0x4ee03e[_0x1af1('0x3d')]:_0x3ef16b['model'];_0x4ee03e[_0x1af1('0x40')]=qs[_0x1af1('0x41')](_0x3d1805[_0x1af1('0x3a')]['sort']);_0x4ee03e[_0x1af1('0x42')]=qs[_0x1af1('0x3b')](_['pick'](_0x3d1805[_0x1af1('0x3a')],_0x3ef16b[_0x1af1('0x3b')]));if(_0x3d1805[_0x1af1('0x3a')][_0x1af1('0x44')]){_0x4ee03e[_0x1af1('0x42')]=_[_0x1af1('0x46')](_0x4ee03e[_0x1af1('0x42')],{'$or':_[_0x1af1('0x34')](_0x4ee03e[_0x1af1('0x3d')],function(_0x4e52fb){var _0x44c0b4={};_0x44c0b4[_0x4e52fb]={'$like':'%'+_0x3d1805['query'][_0x1af1('0x44')]+'%'};return _0x44c0b4;})});}_0x4ee03e=_[_0x1af1('0x46')]({},_0x4ee03e,_0x3d1805[_0x1af1('0x47')]);return _0x38a45d[_0x1af1('0x95')](_0x4ee03e);}})[_0x1af1('0x27')](function(_0x4f3d9c){if(_0x4f3d9c){_0x8f976a=_0x4f3d9c[_0x1af1('0x3e')];if(!_0x3d1805[_0x1af1('0x3a')][_0x1af1('0x62')]('nolimit')){_0x4ee03e[_0x1af1('0x21')]=qs['limit'](_0x3d1805[_0x1af1('0x3a')][_0x1af1('0x21')]);_0x4ee03e[_0x1af1('0x23')]=qs[_0x1af1('0x23')](_0x3d1805[_0x1af1('0x3a')][_0x1af1('0x23')]);}return _0x38a45d[_0x1af1('0x95')](_0x4ee03e);}})[_0x1af1('0x27')](function(_0x43d76d){return _0x43d76d?{'count':_0x8f976a,'rows':_0x43d76d}:null;})[_0x1af1('0x27')](respondWithResult(_0x243d28,null))['catch'](handleError(_0x243d28,null));};exports[_0x1af1('0x96')]=function(_0x3fb7f1,_0xe19ce8,_0x4ed5c5){var _0x1978c9={};var _0x2b9db4={};var _0x348a86;var _0x34816c;return db['VoiceQueue'][_0x1af1('0x5f')]({'where':{'id':_0x3fb7f1[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0xe19ce8,null))[_0x1af1('0x27')](function(_0x253bba){if(_0x253bba){_0x348a86=_0x253bba;_0x2b9db4[_0x1af1('0x38')]=_[_0x1af1('0x39')](db[_0x1af1('0x97')][_0x1af1('0x35')]);_0x2b9db4[_0x1af1('0x3a')]=_[_0x1af1('0x39')](_0x3fb7f1['query']);_0x2b9db4[_0x1af1('0x3b')]=_['intersection'](_0x2b9db4['model'],_0x2b9db4[_0x1af1('0x3a')]);_0x1978c9[_0x1af1('0x3d')]=_[_0x1af1('0x3c')](_0x2b9db4['model'],qs[_0x1af1('0x4e')](_0x3fb7f1[_0x1af1('0x3a')][_0x1af1('0x4e')]));_0x1978c9[_0x1af1('0x3d')]=_0x1978c9['attributes']['length']?_0x1978c9['attributes']:_0x2b9db4[_0x1af1('0x38')];_0x1978c9['order']=qs[_0x1af1('0x41')](_0x3fb7f1['query'][_0x1af1('0x41')]);_0x1978c9[_0x1af1('0x42')]=qs[_0x1af1('0x3b')](_[_0x1af1('0x43')](_0x3fb7f1['query'],_0x2b9db4[_0x1af1('0x3b')]));if(_0x3fb7f1[_0x1af1('0x3a')][_0x1af1('0x44')]){_0x1978c9[_0x1af1('0x42')]=_[_0x1af1('0x46')](_0x1978c9['where'],{'$or':_[_0x1af1('0x34')](_0x1978c9[_0x1af1('0x3d')],function(_0x561ae5){var _0x46f597={};_0x46f597[_0x561ae5]={'$like':'%'+_0x3fb7f1[_0x1af1('0x3a')][_0x1af1('0x44')]+'%'};return _0x46f597;})});}_0x1978c9=_['merge']({},_0x1978c9,_0x3fb7f1[_0x1af1('0x47')]);return _0x348a86[_0x1af1('0x96')](_0x1978c9);}})[_0x1af1('0x27')](function(_0x11581e){if(_0x11581e){_0x34816c=_0x11581e[_0x1af1('0x3e')];if(!_0x3fb7f1[_0x1af1('0x3a')][_0x1af1('0x62')](_0x1af1('0x3f'))){_0x1978c9[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x3fb7f1[_0x1af1('0x3a')][_0x1af1('0x21')]);_0x1978c9[_0x1af1('0x23')]=qs['offset'](_0x3fb7f1['query'][_0x1af1('0x23')]);}return _0x348a86['getLists'](_0x1978c9);}})['then'](function(_0x50c653){if(_0x50c653){return _0x50c653?{'count':_0x34816c,'rows':_0x50c653}:null;}})[_0x1af1('0x27')](respondWithResult(_0xe19ce8,null))['catch'](handleError(_0xe19ce8,null));};exports[_0x1af1('0x98')]=function(_0x22a19e,_0x1e89b8,_0xa701de){var _0x4bb8ee=moment()['format'](_0x1af1('0x99'));var _0x477334,_0x26a4e2;return db[_0x1af1('0x48')][_0x1af1('0x2f')]({'where':{'id':_0x22a19e[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x1e89b8,null))[_0x1af1('0x27')](function(_0x2baaa8){if(_0x2baaa8){_0x26a4e2=_0x2baaa8;return _0x2baaa8[_0x1af1('0x98')](_0x22a19e[_0x1af1('0x51')][_0x1af1('0x7e')],_[_0x1af1('0x59')](_0x22a19e[_0x1af1('0x51')],[_0x1af1('0x7e'),'id'])||{});}return null;})[_0x1af1('0x90')](function(_0x5b7668){var _0x5c7191;_0x477334=_0x5b7668||[];var _0xc63909=[];if(_0x5b7668){for(var _0x5330a7=0x0;_0x5330a7<_0x5b7668[_0x1af1('0x3e')];_0x5330a7+=0x1){var _0x1b9da5=_0x5b7668[_0x5330a7][_0x1af1('0x54')]({'plain':!![]});_0x26a4e2[_0x1af1('0x9a')]=_0x22a19e[_0x1af1('0x51')][_0x1af1('0x9a')]?_0x22a19e['body'][_0x1af1('0x9a')]:_0x26a4e2[_0x1af1('0x9a')];switch(_0x26a4e2[_0x1af1('0x9a')]){case _0x1af1('0x9b'):_0x5c7191=squel[_0x1af1('0x9c')]()[_0x1af1('0x9d')](_0x1af1('0x9e'))['fromQuery']([_0x1af1('0x9f'),_0x1af1('0xa0'),_0x1af1('0xa1'),_0x1af1('0xa2'),_0x1af1('0x65'),_0x1af1('0x5a'),_0x1af1('0xa3')],squel[_0x1af1('0xa4')]()[_0x1af1('0x80')](_0x1af1('0x9f'),_0x1af1('0x9f'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0xa0'))[_0x1af1('0x80')]('id',_0x1af1('0xa1'))['field'](_0x1b9da5[_0x1af1('0xa5')][_0x1af1('0x87')](),'ListId')['field'](_0x22a19e[_0x1af1('0x4d')]['id'][_0x1af1('0x87')](),_0x1af1('0x65'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0x5a'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0xa3'))[_0x1af1('0x81')](_0x1af1('0xa6'))[_0x1af1('0x42')]('deletedAt\x20IS\x20NULL')[_0x1af1('0x42')](_0x1af1('0xa7'),_0x1b9da5[_0x1af1('0xa5')][_0x1af1('0x87')]())[_0x1af1('0x42')](_0x1af1('0xa8'))[_0x1af1('0x42')](_0x1af1('0xa9'),squel['select']()['field'](_0x1af1('0xaa'))[_0x1af1('0x81')](_0x1af1('0xab'))[_0x1af1('0x42')](_0x1af1('0x85'),_0x22a19e[_0x1af1('0x4d')]['id'][_0x1af1('0x87')]()))['where'](_0x1af1('0xa9'),squel[_0x1af1('0xa4')]()[_0x1af1('0x80')](_0x1af1('0xac'))[_0x1af1('0x81')](_0x1af1('0x9e'))[_0x1af1('0x42')]('VoiceQueueId\x20=\x20?',_0x22a19e[_0x1af1('0x4d')]['id']['toString']())))['toString']();break;case _0x1af1('0xad'):_0x5c7191=squel[_0x1af1('0x9c')]()[_0x1af1('0x9d')](_0x1af1('0x9e'))[_0x1af1('0xae')](['phone','scheduledAt','ContactId','ListId',_0x1af1('0x65'),_0x1af1('0x5a'),_0x1af1('0xa3')],squel[_0x1af1('0xa4')]()[_0x1af1('0x80')]('phone',_0x1af1('0x9f'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0xa0'))['field']('id',_0x1af1('0xa1'))[_0x1af1('0x80')](_0x1b9da5[_0x1af1('0xa5')][_0x1af1('0x87')](),'ListId')[_0x1af1('0x80')](_0x22a19e[_0x1af1('0x4d')]['id'][_0x1af1('0x87')](),_0x1af1('0x65'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0x5a'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27','updatedAt')['from'](_0x1af1('0xa6'))[_0x1af1('0x42')](_0x1af1('0xaf'))[_0x1af1('0x42')](_0x1af1('0xa7'),_0x1b9da5['CmListId'][_0x1af1('0x87')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x1af1('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1af1('0xa4')]()['field']('COALESCE(phone,\x27\x27)')[_0x1af1('0x81')](_0x1af1('0x9e'))['where'](_0x1af1('0x85'),_0x22a19e[_0x1af1('0x4d')]['id']['toString']())))[_0x1af1('0x87')]();break;default:_0x5c7191=squel['insert']()[_0x1af1('0x9d')]('cm_hopper')['fromQuery']([_0x1af1('0x9f'),_0x1af1('0xa0'),_0x1af1('0xa1'),'ListId',_0x1af1('0x65'),_0x1af1('0x5a'),_0x1af1('0xa3')],squel[_0x1af1('0xa4')]()[_0x1af1('0x80')]('phone',_0x1af1('0x9f'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0xa0'))['field']('id','ContactId')[_0x1af1('0x80')](_0x1b9da5[_0x1af1('0xa5')]['toString'](),_0x1af1('0xa2'))[_0x1af1('0x80')](_0x22a19e[_0x1af1('0x4d')]['id'][_0x1af1('0x87')](),_0x1af1('0x65'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0x5a'))[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0xa3'))[_0x1af1('0x81')](_0x1af1('0xa6'))[_0x1af1('0x42')](_0x1af1('0xaf'))[_0x1af1('0x42')](_0x1af1('0xa7'),_0x1b9da5['CmListId'][_0x1af1('0x87')]())[_0x1af1('0x42')](_0x1af1('0xa8')))[_0x1af1('0x87')]();}_0xc63909['push'](db['sequelize'][_0x1af1('0x3a')](_0x5c7191));}return BPromise[_0x1af1('0x91')](_0xc63909);}})[_0x1af1('0x27')](function(){var _0xbef843=[];var _0x292573=squel[_0x1af1('0x9c')]()[_0x1af1('0x9d')]('cm_hopper_additional_phones')[_0x1af1('0xae')]([_0x1af1('0xb0'),_0x1af1('0x9f'),_0x1af1('0xb1'),_0x1af1('0x5a'),_0x1af1('0xa3')],squel['select']()[_0x1af1('0x80')]('h.id')[_0x1af1('0x80')](_0x1af1('0xb2'))[_0x1af1('0x80')](_0x1af1('0xb3'))['field']('\x27'+_0x4bb8ee+'\x27','createdAt')[_0x1af1('0x80')]('\x27'+_0x4bb8ee+'\x27',_0x1af1('0xa3'))['from'](_0x1af1('0xb4'),'ci')['join'](_0x1af1('0x9e'),'h',_0x1af1('0xb5'))[_0x1af1('0x42')](_0x1af1('0xb6'),_0x4bb8ee)[_0x1af1('0x42')](_0x1af1('0xb7'),_0x1af1('0xb8')))['toString']();_0xbef843['push'](db[_0x1af1('0x72')][_0x1af1('0x3a')](_0x292573));return BPromise['all'](_0xbef843);})['then'](function(){return _0x477334;})['then'](respondWithResult(_0x1e89b8,null))[_0x1af1('0x57')](handleError(_0x1e89b8,null));};exports[_0x1af1('0xb9')]=function(_0x90bb61,_0x1e111a,_0x230190){return db[_0x1af1('0x48')][_0x1af1('0x2f')]({'where':{'id':_0x90bb61[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x1e111a,null))[_0x1af1('0x27')](function(_0x594c5b){if(_0x594c5b){return _0x594c5b['removeLists'](_0x90bb61[_0x1af1('0x3a')]['ids']);}})[_0x1af1('0x27')](function(_0x1fd8af){if(_0x1fd8af){return db[_0x1af1('0x60')][_0x1af1('0x28')]({'where':{'ListId':_0x90bb61[_0x1af1('0x3a')][_0x1af1('0x7e')],'VoiceQueueId':_0x90bb61['params']['id']}})[_0x1af1('0x27')](function(){return _0x1fd8af;});}})[_0x1af1('0x27')](respondWithStatusCode(_0x1e111a,null))[_0x1af1('0x57')](handleError(_0x1e111a,null));};exports[_0x1af1('0xba')]=function(_0x38951a,_0x1d84fe,_0x886a15){var _0x3d4fbe={};var _0x28fdcb={};var _0xb9fe6f;var _0x400e18;return db[_0x1af1('0x48')]['findOne']({'where':{'id':_0x38951a[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x1d84fe,null))[_0x1af1('0x27')](function(_0x352666){if(_0x352666){_0xb9fe6f=_0x352666;_0x28fdcb[_0x1af1('0x38')]=_[_0x1af1('0x39')](db[_0x1af1('0x97')][_0x1af1('0x35')]);_0x28fdcb['query']=_['keys'](_0x38951a['query']);_0x28fdcb['filters']=_[_0x1af1('0x3c')](_0x28fdcb[_0x1af1('0x38')],_0x28fdcb[_0x1af1('0x3a')]);_0x3d4fbe[_0x1af1('0x3d')]=_['intersection'](_0x28fdcb[_0x1af1('0x38')],qs[_0x1af1('0x4e')](_0x38951a[_0x1af1('0x3a')][_0x1af1('0x4e')]));_0x3d4fbe[_0x1af1('0x3d')]=_0x3d4fbe['attributes'][_0x1af1('0x3e')]?_0x3d4fbe[_0x1af1('0x3d')]:_0x28fdcb['model'];_0x3d4fbe[_0x1af1('0x40')]=qs[_0x1af1('0x41')](_0x38951a[_0x1af1('0x3a')]['sort']);_0x3d4fbe[_0x1af1('0x42')]=qs[_0x1af1('0x3b')](_[_0x1af1('0x43')](_0x38951a[_0x1af1('0x3a')],_0x28fdcb[_0x1af1('0x3b')]));if(_0x38951a[_0x1af1('0x3a')][_0x1af1('0x44')]){_0x3d4fbe[_0x1af1('0x42')]=_[_0x1af1('0x46')](_0x3d4fbe[_0x1af1('0x42')],{'$or':_[_0x1af1('0x34')](_0x3d4fbe['attributes'],function(_0x455c00){var _0x7c38f7={};_0x7c38f7[_0x455c00]={'$like':'%'+_0x38951a[_0x1af1('0x3a')][_0x1af1('0x44')]+'%'};return _0x7c38f7;})});}_0x3d4fbe=_['merge']({},_0x3d4fbe,_0x38951a[_0x1af1('0x47')]);return _0xb9fe6f[_0x1af1('0xba')](_0x3d4fbe);}})[_0x1af1('0x27')](function(_0x4a752b){if(_0x4a752b){_0x400e18=_0x4a752b[_0x1af1('0x3e')];if(!_0x38951a[_0x1af1('0x3a')][_0x1af1('0x62')](_0x1af1('0x3f'))){_0x3d4fbe[_0x1af1('0x21')]=qs[_0x1af1('0x21')](_0x38951a['query'][_0x1af1('0x21')]);_0x3d4fbe[_0x1af1('0x23')]=qs[_0x1af1('0x23')](_0x38951a['query'][_0x1af1('0x23')]);}return _0xb9fe6f['getBlackLists'](_0x3d4fbe);}})[_0x1af1('0x27')](function(_0x3d8c0b){if(_0x3d8c0b){return _0x3d8c0b?{'count':_0x400e18,'rows':_0x3d8c0b}:null;}})[_0x1af1('0x27')](respondWithResult(_0x1d84fe,null))[_0x1af1('0x57')](handleError(_0x1d84fe,null));};exports[_0x1af1('0xbb')]=function(_0x46a7f9,_0x2b9350,_0x2046c2){var _0xf4059a,_0x5c0924;return db['VoiceQueue'][_0x1af1('0x2f')]({'where':{'id':_0x46a7f9[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x2b9350,null))['then'](function(_0xe07ce6){if(_0xe07ce6){_0x5c0924=_0xe07ce6;return _0xe07ce6['addBlackLists'](_0x46a7f9['body'][_0x1af1('0x7e')],_[_0x1af1('0x59')](_0x46a7f9['body'],[_0x1af1('0x7e'),'id'])||{});}return null;})[_0x1af1('0x90')](function(_0x515581){var _0x2244d3;_0xf4059a=_0x515581||[];var _0x406b04=[];if(_0x515581){for(var _0x3442a3=0x0;_0x3442a3<_0x515581[_0x1af1('0x3e')];_0x3442a3+=0x1){var _0x2084c2=_0x515581[_0x3442a3][_0x1af1('0x54')]({'plain':!![]});_0x2244d3=squel[_0x1af1('0x9c')]()['into'](_0x1af1('0xbc'))[_0x1af1('0xae')]([_0x1af1('0x9f'),_0x1af1('0xa1'),_0x1af1('0xa2'),_0x1af1('0x65'),_0x1af1('0x5a'),_0x1af1('0xa3')],squel[_0x1af1('0xa4')]()[_0x1af1('0x80')]('phone',_0x1af1('0x9f'))['field']('id',_0x1af1('0xa1'))[_0x1af1('0x80')](_0x2084c2[_0x1af1('0xa5')][_0x1af1('0x87')](),'ListId')['field'](_0x46a7f9[_0x1af1('0x4d')]['id'][_0x1af1('0x87')](),_0x1af1('0x65'))[_0x1af1('0x80')](_0x1af1('0xbd'),_0x1af1('0x5a'))[_0x1af1('0x80')]('NOW()',_0x1af1('0xa3'))[_0x1af1('0x81')](_0x1af1('0xa6'))[_0x1af1('0x42')](_0x1af1('0xaf'))[_0x1af1('0x42')](_0x1af1('0xa7'),_0x2084c2[_0x1af1('0xa5')][_0x1af1('0x87')]())[_0x1af1('0x42')](_0x1af1('0xa8')))[_0x1af1('0x87')]();_0x406b04['push'](db['sequelize']['query'](_0x2244d3));}return BPromise['all'](_0x406b04);}})[_0x1af1('0x27')](function(){return _0xf4059a;})[_0x1af1('0x27')](respondWithResult(_0x2b9350,null))[_0x1af1('0x57')](handleError(_0x2b9350,null));};exports[_0x1af1('0xbe')]=function(_0x2a5426,_0x489273,_0x17afbb){return db[_0x1af1('0x48')][_0x1af1('0x2f')]({'where':{'id':_0x2a5426[_0x1af1('0x4d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x489273,null))[_0x1af1('0x27')](function(_0xc88334){if(_0xc88334){return _0xc88334[_0x1af1('0xbe')](_0x2a5426[_0x1af1('0x3a')][_0x1af1('0x7e')]);}})[_0x1af1('0x27')](function(_0x327213){if(_0x327213){return db[_0x1af1('0x67')][_0x1af1('0x28')]({'where':{'ListId':_0x2a5426[_0x1af1('0x3a')][_0x1af1('0x7e')],'VoiceQueueId':_0x2a5426[_0x1af1('0x4d')]['id']}})['then'](function(){return _0x327213;});}})[_0x1af1('0x27')](respondWithStatusCode(_0x489273,null))[_0x1af1('0x57')](handleError(_0x489273,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 837e20a..fc7ac36 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 _0x27f8=['emit','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x3c25e1,_0x3e5653){var _0xf20f26=function(_0x2b319f){while(--_0x2b319f){_0x3c25e1['push'](_0x3c25e1['shift']());}};_0xf20f26(++_0x3e5653);}(_0x27f8,0x175));var _0x827f=function(_0x2db0e0,_0x43c8c0){_0x2db0e0=_0x2db0e0-0x0;var _0x1d78ca=_0x27f8[_0x2db0e0];return _0x1d78ca;};'use strict';var EventEmitter=require(_0x827f('0x0'));var VoiceQueue=require(_0x827f('0x1'))['db'][_0x827f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x827f('0x3')](0x0);var events={'afterCreate':_0x827f('0x4'),'afterUpdate':_0x827f('0x5'),'afterDestroy':_0x827f('0x6')};function emitEvent(_0x5163f1){return function(_0x2e0263,_0x4fddde,_0x1ee29e){VoiceQueueEvents[_0x827f('0x7')](_0x5163f1+':'+_0x2e0263['id'],_0x2e0263);VoiceQueueEvents['emit'](_0x5163f1,_0x2e0263);_0x1ee29e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x827f('0x8')](e,emitEvent(event));}}module[_0x827f('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x8388=['hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','save','update','remove'];(function(_0x296a2a,_0x267556){var _0x5b91d8=function(_0x579587){while(--_0x579587){_0x296a2a['push'](_0x296a2a['shift']());}};_0x5b91d8(++_0x267556);}(_0x8388,0x1ab));var _0x8838=function(_0x23f8c8,_0xb536b9){_0x23f8c8=_0x23f8c8-0x0;var _0x3dc718=_0x8388[_0x23f8c8];return _0x3dc718;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x8838('0x0'))['db'][_0x8838('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8838('0x2'),'afterUpdate':_0x8838('0x3'),'afterDestroy':_0x8838('0x4')};function emitEvent(_0x24c76f){return function(_0x5b5cbd,_0x3fb030,_0x12a010){VoiceQueueEvents['emit'](_0x24c76f+':'+_0x5b5cbd['id'],_0x5b5cbd);VoiceQueueEvents['emit'](_0x24c76f,_0x5b5cbd);_0x12a010(null);};}for(var e in events){if(events[_0x8838('0x5')](e)){var event=events[e];VoiceQueue[_0x8838('0x6')](e,emitEvent(event));}}module[_0x8838('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index e649c1c..5c6403b 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x4fa08c,_0x30cac4){var _0x7a920a=function(_0x213fd1){while(--_0x213fd1){_0x4fa08c['push'](_0x4fa08c['shift']());}};_0x7a920a(++_0x30cac4);}(_0x008c,0x188));var _0xc008=function(_0x1c74d2,_0x5b1c47){_0x1c74d2=_0x1c74d2-0x0;var _0x1187b7=_0x008c[_0x1c74d2];return _0x1187b7;};'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')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x70e0,0x17b));var _0x070e=function(_0x3ed777,_0x5e61b7){_0x3ed777=_0x3ed777-0x0;var _0x82c8a7=_0x70e0[_0x3ed777];return _0x82c8a7;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'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 c3adcf0..784441d 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 _0x3bfb=['register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','attributes','limit','include','map','model','GetVoiceQueue','debug','VoiceQueue','find','raw','where','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3bfb,0x1d3));var _0xb3bf=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x3bfb[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0xb3bf('0x0'));var util=require(_0xb3bf('0x1'));var moment=require(_0xb3bf('0x2'));var BPromise=require(_0xb3bf('0x3'));var rs=require(_0xb3bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3bf('0x5'))['db'];var utils=require(_0xb3bf('0x6'));var logger=require(_0xb3bf('0x7'))(_0xb3bf('0x8'));var config=require(_0xb3bf('0x9'));var jayson=require(_0xb3bf('0xa'));var client=jayson[_0xb3bf('0xb')][_0xb3bf('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb3bf('0xd')],{'host':_0xb3bf('0xe'),'port':0x18eb});var socket=require(_0xb3bf('0xf'))(new Redis(config[_0xb3bf('0xd')]));require(_0xb3bf('0x10'))[_0xb3bf('0x11')](socket);function respondWithRpcPromise(_0x52f671,_0x3ee728,_0x38e228){return new BPromise(function(_0x470d65,_0x58bbbf){return client[_0xb3bf('0x12')](_0x52f671,_0x38e228)[_0xb3bf('0x13')](function(_0x5a9ea7){logger[_0xb3bf('0x14')](_0xb3bf('0x15'),_0x3ee728,_0xb3bf('0x16'));logger['debug'](_0xb3bf('0x17'),_0x3ee728,'request\x20sent',JSON[_0xb3bf('0x18')](_0x5a9ea7));if(_0x5a9ea7[_0xb3bf('0x19')]){if(_0x5a9ea7[_0xb3bf('0x19')][_0xb3bf('0x1a')]===0x1f4){logger['error'](_0xb3bf('0x15'),_0x3ee728,_0x5a9ea7[_0xb3bf('0x19')]['message']);return _0x58bbbf(_0x5a9ea7[_0xb3bf('0x19')][_0xb3bf('0x1b')]);}logger[_0xb3bf('0x19')](_0xb3bf('0x15'),_0x3ee728,_0x5a9ea7[_0xb3bf('0x19')][_0xb3bf('0x1b')]);return _0x470d65(_0x5a9ea7[_0xb3bf('0x19')][_0xb3bf('0x1b')]);}else{logger[_0xb3bf('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x3ee728,_0xb3bf('0x16'));_0x470d65(_0x5a9ea7[_0xb3bf('0x1c')][_0xb3bf('0x1b')]);}})[_0xb3bf('0x1d')](function(_0x1c2df7){logger[_0xb3bf('0x19')](_0xb3bf('0x15'),_0x3ee728,_0x1c2df7);_0x58bbbf(_0x1c2df7);});});}exports['GetVoiceQueue']=function(_0x44d26b){var _0x524d00=this;return new Promise(function(_0x31c52d,_0x3c702f){return db['VoiceQueue'][_0xb3bf('0x1e')]({'raw':_0x44d26b[_0xb3bf('0x1f')]?_0x44d26b[_0xb3bf('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x44d26b[_0xb3bf('0x1f')]?_0x44d26b[_0xb3bf('0x1f')]['where']||null:null,'attributes':_0x44d26b[_0xb3bf('0x1f')]?_0x44d26b[_0xb3bf('0x1f')][_0xb3bf('0x20')]||null:null,'limit':_0x44d26b['options']?_0x44d26b[_0xb3bf('0x1f')][_0xb3bf('0x21')]||null:null,'include':_0x44d26b['options']?_0x44d26b[_0xb3bf('0x1f')][_0xb3bf('0x22')]?_[_0xb3bf('0x23')](_0x44d26b[_0xb3bf('0x1f')]['include'],function(_0x311167){return{'model':db[_0x311167[_0xb3bf('0x24')]],'as':_0x311167['as'],'attributes':_0x311167[_0xb3bf('0x20')],'include':_0x311167[_0xb3bf('0x22')]?_[_0xb3bf('0x23')](_0x311167['include'],function(_0x393ecf){return{'model':db[_0x393ecf[_0xb3bf('0x24')]],'as':_0x393ecf['as'],'attributes':_0x393ecf[_0xb3bf('0x20')],'include':_0x393ecf[_0xb3bf('0x22')]?_[_0xb3bf('0x23')](_0x393ecf['include'],function(_0x3326a9){return{'model':db[_0x3326a9[_0xb3bf('0x24')]],'as':_0x3326a9['as'],'attributes':_0x3326a9[_0xb3bf('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb3bf('0x13')](function(_0x103011){logger[_0xb3bf('0x14')](_0xb3bf('0x25'),_0x44d26b);logger[_0xb3bf('0x26')](_0xb3bf('0x25'),_0x44d26b,JSON[_0xb3bf('0x18')](_0x103011));_0x31c52d(_0x103011);})[_0xb3bf('0x1d')](function(_0x23dd1e){logger['error']('GetVoiceQueue',_0x23dd1e[_0xb3bf('0x1b')],_0x44d26b);_0x3c702f(_0x524d00['error'](0x1f4,_0x23dd1e['message']));});});};exports['ShowVoiceQueue']=function(_0x17d802){var _0xf21b73=this;return new Promise(function(_0x538a8a,_0x2141c0){return db[_0xb3bf('0x27')][_0xb3bf('0x28')]({'raw':_0x17d802[_0xb3bf('0x1f')]?_0x17d802[_0xb3bf('0x1f')][_0xb3bf('0x29')]===undefined?!![]:![]:!![],'where':_0x17d802[_0xb3bf('0x1f')]?_0x17d802[_0xb3bf('0x1f')][_0xb3bf('0x2a')]||null:null,'attributes':_0x17d802[_0xb3bf('0x1f')]?_0x17d802[_0xb3bf('0x1f')][_0xb3bf('0x20')]||null:null,'include':_0x17d802['options']?_0x17d802[_0xb3bf('0x1f')][_0xb3bf('0x22')]?_['map'](_0x17d802[_0xb3bf('0x1f')][_0xb3bf('0x22')],function(_0x39f444){return{'model':db[_0x39f444[_0xb3bf('0x24')]],'as':_0x39f444['as'],'attributes':_0x39f444['attributes'],'include':_0x39f444[_0xb3bf('0x22')]?_[_0xb3bf('0x23')](_0x39f444[_0xb3bf('0x22')],function(_0x4915ee){return{'model':db[_0x4915ee[_0xb3bf('0x24')]],'as':_0x4915ee['as'],'attributes':_0x4915ee[_0xb3bf('0x20')],'include':_0x4915ee[_0xb3bf('0x22')]?_[_0xb3bf('0x23')](_0x4915ee[_0xb3bf('0x22')],function(_0x233b1a){return{'model':db[_0x233b1a[_0xb3bf('0x24')]],'as':_0x233b1a['as'],'attributes':_0x233b1a[_0xb3bf('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a2bba){logger['info']('ShowVoiceQueue',_0x17d802);logger[_0xb3bf('0x26')](_0xb3bf('0x2b'),_0x17d802,JSON[_0xb3bf('0x18')](_0x4a2bba));_0x538a8a(_0x4a2bba);})[_0xb3bf('0x1d')](function(_0x4efe66){logger[_0xb3bf('0x19')](_0xb3bf('0x2b'),_0x4efe66['message'],_0x17d802);_0x2141c0(_0xf21b73['error'](0x1f4,_0x4efe66['message']));});});}; \ No newline at end of file +var _0x7c69=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e572d,_0x247e17){var _0x3f98e9=function(_0xac1663){while(--_0xac1663){_0x3e572d['push'](_0x3e572d['shift']());}};_0x3f98e9(++_0x247e17);}(_0x7c69,0xd4));var _0x97c6=function(_0x416928,_0x1078dc){_0x416928=_0x416928-0x0;var _0x21f8d6=_0x7c69[_0x416928];return _0x21f8d6;};'use strict';var _=require(_0x97c6('0x0'));var util=require(_0x97c6('0x1'));var moment=require(_0x97c6('0x2'));var BPromise=require(_0x97c6('0x3'));var rs=require(_0x97c6('0x4'));var fs=require('fs');var Redis=require(_0x97c6('0x5'));var db=require(_0x97c6('0x6'))['db'];var utils=require(_0x97c6('0x7'));var logger=require(_0x97c6('0x8'))(_0x97c6('0x9'));var config=require(_0x97c6('0xa'));var jayson=require(_0x97c6('0xb'));var client=jayson['client'][_0x97c6('0xc')]({'port':0x232a});config[_0x97c6('0xd')]=_[_0x97c6('0xe')](config['redis'],{'host':_0x97c6('0xf'),'port':0x18eb});var socket=require(_0x97c6('0x10'))(new Redis(config[_0x97c6('0xd')]));require(_0x97c6('0x11'))[_0x97c6('0x12')](socket);function respondWithRpcPromise(_0x39917a,_0x32e963,_0x37d24b){return new BPromise(function(_0x3b9a3c,_0x1e5e4e){return client[_0x97c6('0x13')](_0x39917a,_0x37d24b)[_0x97c6('0x14')](function(_0x365132){logger[_0x97c6('0x15')](_0x97c6('0x16'),_0x32e963,'request\x20sent');logger[_0x97c6('0x17')](_0x97c6('0x18'),_0x32e963,_0x97c6('0x19'),JSON[_0x97c6('0x1a')](_0x365132));if(_0x365132[_0x97c6('0x1b')]){if(_0x365132[_0x97c6('0x1b')][_0x97c6('0x1c')]===0x1f4){logger[_0x97c6('0x1b')](_0x97c6('0x16'),_0x32e963,_0x365132['error'][_0x97c6('0x1d')]);return _0x1e5e4e(_0x365132[_0x97c6('0x1b')][_0x97c6('0x1d')]);}logger[_0x97c6('0x1b')](_0x97c6('0x16'),_0x32e963,_0x365132[_0x97c6('0x1b')]['message']);return _0x3b9a3c(_0x365132[_0x97c6('0x1b')][_0x97c6('0x1d')]);}else{logger[_0x97c6('0x15')](_0x97c6('0x16'),_0x32e963,_0x97c6('0x19'));_0x3b9a3c(_0x365132[_0x97c6('0x1e')][_0x97c6('0x1d')]);}})[_0x97c6('0x1f')](function(_0x5524a9){logger[_0x97c6('0x1b')](_0x97c6('0x16'),_0x32e963,_0x5524a9);_0x1e5e4e(_0x5524a9);});});}exports[_0x97c6('0x20')]=function(_0x17d72e){var _0x265194=this;return new Promise(function(_0x19dd78,_0x380ce0){return db[_0x97c6('0x21')][_0x97c6('0x22')]({'raw':_0x17d72e[_0x97c6('0x23')]?_0x17d72e[_0x97c6('0x23')][_0x97c6('0x24')]===undefined?!![]:![]:!![],'where':_0x17d72e[_0x97c6('0x23')]?_0x17d72e[_0x97c6('0x23')][_0x97c6('0x25')]||null:null,'attributes':_0x17d72e[_0x97c6('0x23')]?_0x17d72e[_0x97c6('0x23')][_0x97c6('0x26')]||null:null,'limit':_0x17d72e[_0x97c6('0x23')]?_0x17d72e['options']['limit']||null:null,'include':_0x17d72e[_0x97c6('0x23')]?_0x17d72e[_0x97c6('0x23')][_0x97c6('0x27')]?_[_0x97c6('0x28')](_0x17d72e[_0x97c6('0x23')]['include'],function(_0x228ffb){return{'model':db[_0x228ffb[_0x97c6('0x29')]],'as':_0x228ffb['as'],'attributes':_0x228ffb['attributes'],'include':_0x228ffb['include']?_[_0x97c6('0x28')](_0x228ffb[_0x97c6('0x27')],function(_0x5f6be3){return{'model':db[_0x5f6be3['model']],'as':_0x5f6be3['as'],'attributes':_0x5f6be3[_0x97c6('0x26')],'include':_0x5f6be3[_0x97c6('0x27')]?_[_0x97c6('0x28')](_0x5f6be3[_0x97c6('0x27')],function(_0x148c38){return{'model':db[_0x148c38[_0x97c6('0x29')]],'as':_0x148c38['as'],'attributes':_0x148c38[_0x97c6('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4feb07){logger[_0x97c6('0x15')](_0x97c6('0x20'),_0x17d72e);logger['debug'](_0x97c6('0x20'),_0x17d72e,JSON[_0x97c6('0x1a')](_0x4feb07));_0x19dd78(_0x4feb07);})[_0x97c6('0x1f')](function(_0x21e5a1){logger['error'](_0x97c6('0x20'),_0x21e5a1['message'],_0x17d72e);_0x380ce0(_0x265194[_0x97c6('0x1b')](0x1f4,_0x21e5a1[_0x97c6('0x1d')]));});});};exports[_0x97c6('0x2a')]=function(_0x677093){var _0x109b28=this;return new Promise(function(_0x425b63,_0x13501b){return db['VoiceQueue'][_0x97c6('0x2b')]({'raw':_0x677093[_0x97c6('0x23')]?_0x677093['options']['raw']===undefined?!![]:![]:!![],'where':_0x677093[_0x97c6('0x23')]?_0x677093['options'][_0x97c6('0x25')]||null:null,'attributes':_0x677093[_0x97c6('0x23')]?_0x677093[_0x97c6('0x23')]['attributes']||null:null,'include':_0x677093[_0x97c6('0x23')]?_0x677093['options'][_0x97c6('0x27')]?_[_0x97c6('0x28')](_0x677093['options'][_0x97c6('0x27')],function(_0x1348f5){return{'model':db[_0x1348f5['model']],'as':_0x1348f5['as'],'attributes':_0x1348f5[_0x97c6('0x26')],'include':_0x1348f5[_0x97c6('0x27')]?_['map'](_0x1348f5[_0x97c6('0x27')],function(_0x269bae){return{'model':db[_0x269bae['model']],'as':_0x269bae['as'],'attributes':_0x269bae[_0x97c6('0x26')],'include':_0x269bae[_0x97c6('0x27')]?_[_0x97c6('0x28')](_0x269bae[_0x97c6('0x27')],function(_0x233d94){return{'model':db[_0x233d94[_0x97c6('0x29')]],'as':_0x233d94['as'],'attributes':_0x233d94[_0x97c6('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f7502){logger[_0x97c6('0x15')](_0x97c6('0x2a'),_0x677093);logger[_0x97c6('0x17')](_0x97c6('0x2a'),_0x677093,JSON[_0x97c6('0x1a')](_0x3f7502));_0x425b63(_0x3f7502);})[_0x97c6('0x1f')](function(_0x13a174){logger[_0x97c6('0x1b')](_0x97c6('0x2a'),_0x13a174[_0x97c6('0x1d')],_0x677093);_0x13501b(_0x109b28[_0x97c6('0x1b')](0x1f4,_0x13a174[_0x97c6('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 8839a94..2adf8f8 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 _0xbaec=['register','./voiceQueue.events','remove','update','emit','removeListener'];(function(_0xb0592f,_0x509723){var _0x49eb32=function(_0x1a7073){while(--_0x1a7073){_0xb0592f['push'](_0xb0592f['shift']());}};_0x49eb32(++_0x509723);}(_0xbaec,0x1f3));var _0xcbae=function(_0x1a87cd,_0x2a244f){_0x1a87cd=_0x1a87cd-0x0;var _0x4af60e=_0xbaec[_0x1a87cd];return _0x4af60e;};'use strict';var VoiceQueueEvents=require(_0xcbae('0x0'));var events=['save',_0xcbae('0x1'),_0xcbae('0x2')];function createListener(_0x12b68e,_0x187169){return function(_0x546d71){_0x187169[_0xcbae('0x3')](_0x12b68e,_0x546d71);};}function removeListener(_0x245fb0,_0x29b6c5){return function(){VoiceQueueEvents[_0xcbae('0x4')](_0x245fb0,_0x29b6c5);};}exports[_0xcbae('0x5')]=function(_0x4861ea){for(var _0x296b62=0x0,_0x3ef583=events['length'];_0x296b62<_0x3ef583;_0x296b62++){var _0x44bae=events[_0x296b62];var _0x5c4552=createListener('voiceQueue:'+_0x44bae,_0x4861ea);VoiceQueueEvents['on'](_0x44bae,_0x5c4552);}}; \ No newline at end of file +var _0x297f=['./voiceQueue.events','remove','update','removeListener','register','length','voiceQueue:'];(function(_0x1a1dae,_0x2a9522){var _0x2e2ee8=function(_0x54d928){while(--_0x54d928){_0x1a1dae['push'](_0x1a1dae['shift']());}};_0x2e2ee8(++_0x2a9522);}(_0x297f,0x149));var _0xf297=function(_0x58c87e,_0x3e1a5b){_0x58c87e=_0x58c87e-0x0;var _0x45681e=_0x297f[_0x58c87e];return _0x45681e;};'use strict';var VoiceQueueEvents=require(_0xf297('0x0'));var events=['save',_0xf297('0x1'),_0xf297('0x2')];function createListener(_0x4910e7,_0x4ae9e7){return function(_0x53a63d){_0x4ae9e7['emit'](_0x4910e7,_0x53a63d);};}function removeListener(_0x205e06,_0x10dfb1){return function(){VoiceQueueEvents[_0xf297('0x3')](_0x205e06,_0x10dfb1);};}exports[_0xf297('0x4')]=function(_0x5685fb){for(var _0x1d8dd7=0x0,_0x479db9=events[_0xf297('0x5')];_0x1d8dd7<_0x479db9;_0x1d8dd7++){var _0x1f67c3=events[_0x1d8dd7];var _0x30b44e=createListener(_0xf297('0x6')+_0x1f67c3,_0x5685fb);VoiceQueueEvents['on'](_0x1f67c3,_0x30b44e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ea09fc8..cefef7c 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 _0x2188=['post','update','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','/:id','show'];(function(_0x50a319,_0x3e3b1d){var _0x31de6f=function(_0x2a6c44){while(--_0x2a6c44){_0x50a319['push'](_0x50a319['shift']());}};_0x31de6f(++_0x3e3b1d);}(_0x2188,0x16c));var _0x8218=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x2188[_0x456a4b];return _0x42957c;};'use strict';var multer=require('multer');var util=require(_0x8218('0x0'));var path=require(_0x8218('0x1'));var timeout=require(_0x8218('0x2'));var express=require(_0x8218('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8218('0x4'));var config=require(_0x8218('0x5'));var controller=require(_0x8218('0x6'));router[_0x8218('0x7')]('/',auth[_0x8218('0x8')](),controller['index']);router[_0x8218('0x7')](_0x8218('0x9'),auth[_0x8218('0x8')](),controller[_0x8218('0xa')]);router[_0x8218('0x7')](_0x8218('0xb'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0x8218('0x7')](_0x8218('0xc'),auth[_0x8218('0x8')](),controller[_0x8218('0xd')]);router[_0x8218('0xe')]('/',auth[_0x8218('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8218('0xf')]);router['delete'](_0x8218('0xc'),auth[_0x8218('0x8')](),controller[_0x8218('0x10')]);module[_0x8218('0x11')]=router; \ No newline at end of file +var _0xfb59=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','describe','getVoiceQueuesReport','show','create','/:id','update','delete','exports'];(function(_0x162b2c,_0x1806f5){var _0x50b806=function(_0x137627){while(--_0x137627){_0x162b2c['push'](_0x162b2c['shift']());}};_0x50b806(++_0x1806f5);}(_0xfb59,0x7e));var _0x9fb5=function(_0x19cb13,_0x54b5d3){_0x19cb13=_0x19cb13-0x0;var _0x3fc50e=_0xfb59[_0x19cb13];return _0x3fc50e;};'use strict';var multer=require(_0x9fb5('0x0'));var util=require(_0x9fb5('0x1'));var path=require('path');var timeout=require(_0x9fb5('0x2'));var express=require(_0x9fb5('0x3'));var router=express[_0x9fb5('0x4')]();var fs_extra=require(_0x9fb5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9fb5('0x6'));var config=require(_0x9fb5('0x7'));var controller=require(_0x9fb5('0x8'));router[_0x9fb5('0x9')]('/',auth['isAuthenticated'](),controller[_0x9fb5('0xa')]);router[_0x9fb5('0x9')](_0x9fb5('0xb'),auth[_0x9fb5('0xc')](),controller[_0x9fb5('0xd')]);router[_0x9fb5('0x9')]('/index',auth[_0x9fb5('0xc')](),controller[_0x9fb5('0xe')]);router[_0x9fb5('0x9')]('/:id',auth[_0x9fb5('0xc')](),controller[_0x9fb5('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9fb5('0x10')]);router['put'](_0x9fb5('0x11'),auth[_0x9fb5('0xc')](),controller[_0x9fb5('0x12')]);router[_0x9fb5('0x13')](_0x9fb5('0x11'),auth[_0x9fb5('0xc')](),controller['destroy']);module[_0x9fb5('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 4d16e06..748522c 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 _0xa492=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','INTEGER','BOOLEAN'];(function(_0x21399e,_0xf0942){var _0x1bf325=function(_0x2ea868){while(--_0x2ea868){_0x21399e['push'](_0x21399e['shift']());}};_0x1bf325(++_0xf0942);}(_0xa492,0x10a));var _0x2a49=function(_0x4a0480,_0x4e6824){_0x4a0480=_0x4a0480-0x0;var _0x278cee=_0xa492[_0x4a0480];return _0x278cee;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2a49('0x0')]={'type':{'type':Sequelize[_0x2a49('0x1')]},'uniqueid':{'type':Sequelize[_0x2a49('0x1')]},'calleridnum':{'type':Sequelize[_0x2a49('0x1')]},'calleridname':{'type':Sequelize[_0x2a49('0x1')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x2a49('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x2a49('0x2')],'set':function(_0x50ae2c){var _0x3d85ee=moment(_0x50ae2c);var _0x1afbe0=moment(this['getDataValue'](_0x2a49('0x3')))[_0x2a49('0x4')](_0x2a49('0x5'));var _0x1c4d10=_0x3d85ee[_0x2a49('0x6')](_0x1afbe0,'seconds');this['setDataValue']('queuecallerleaveAt',_0x50ae2c);this[_0x2a49('0x7')]('holdtime',_0x1c4d10||null);}},'position':{'type':Sequelize[_0x2a49('0x8')]},'count':{'type':Sequelize[_0x2a49('0x8')]},'queuecallerabandon':{'type':Sequelize[_0x2a49('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2a49('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x2a49('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x2a49('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x2a49('0x1')],'comment':_0x2a49('0xa')},'originalposition':{'type':Sequelize[_0x2a49('0x8')]},'channel':{'type':Sequelize[_0x2a49('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2a49('0x1')]},'connectedlinename':{'type':Sequelize[_0x2a49('0x1')]},'accountcode':{'type':Sequelize[_0x2a49('0x1')]},'context':{'type':Sequelize[_0x2a49('0x1')]},'exten':{'type':Sequelize[_0x2a49('0x1')]},'priority':{'type':Sequelize[_0x2a49('0x1')]},'holdtime':{'type':Sequelize[_0x2a49('0x8')]},'mohtime':{'type':Sequelize[_0x2a49('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2a49('0x1')]},'transfer':{'type':Sequelize[_0x2a49('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x2a49('0xb')},'transferexten':{'type':Sequelize[_0x2a49('0x1')]},'transferuniqueid':{'type':Sequelize[_0x2a49('0x1')]},'disposition':{'type':Sequelize[_0x2a49('0x1')]},'secondDisposition':{'type':Sequelize[_0x2a49('0x1')]},'thirdDisposition':{'type':Sequelize[_0x2a49('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x2a49('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6f98=['moment','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x6f98,0xa8));var _0x86f9=function(_0x12b449,_0x403538){_0x12b449=_0x12b449-0x0;var _0x3714fe=_0x6f98[_0x12b449];return _0x3714fe;};'use strict';var Sequelize=require(_0x86f9('0x0'));var moment=require(_0x86f9('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x86f9('0x2')]},'calleridname':{'type':Sequelize[_0x86f9('0x2')]},'queue':{'type':Sequelize[_0x86f9('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x86f9('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x86f9('0x3')],'set':function(_0x3d2628){var _0x1f5421=moment(_0x3d2628);var _0x1c0466=moment(this[_0x86f9('0x4')]('queuecallerjoinAt'))[_0x86f9('0x5')](_0x86f9('0x6'));var _0x2a43ed=_0x1f5421[_0x86f9('0x7')](_0x1c0466,'seconds');this[_0x86f9('0x8')](_0x86f9('0x9'),_0x3d2628);this[_0x86f9('0x8')]('holdtime',_0x2a43ed||null);}},'position':{'type':Sequelize[_0x86f9('0xa')]},'count':{'type':Sequelize[_0x86f9('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x86f9('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x86f9('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x86f9('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x86f9('0x2')],'comment':_0x86f9('0xc')},'originalposition':{'type':Sequelize[_0x86f9('0xa')]},'channel':{'type':Sequelize[_0x86f9('0x2')]},'connectedlinenum':{'type':Sequelize[_0x86f9('0x2')]},'connectedlinename':{'type':Sequelize[_0x86f9('0x2')]},'accountcode':{'type':Sequelize[_0x86f9('0x2')]},'context':{'type':Sequelize[_0x86f9('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x86f9('0x2')]},'holdtime':{'type':Sequelize[_0x86f9('0xa')]},'mohtime':{'type':Sequelize[_0x86f9('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x86f9('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x86f9('0x2')]},'transfer':{'type':Sequelize[_0x86f9('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x86f9('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x86f9('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x86f9('0x2')]},'secondDisposition':{'type':Sequelize[_0x86f9('0x2')]},'thirdDisposition':{'type':Sequelize[_0x86f9('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x86f9('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index cf8fe63..5b31c78 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 _0x47fc=['reject','save','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','intersection','includeAll','find','catch','create','body','update','params','describe','rawAttributes','pick','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x47fc,0x17a));var _0xc47f=function(_0x54e143,_0x4a0a3f){_0x54e143=_0x54e143-0x0;var _0xe3d1c3=_0x47fc[_0x54e143];return _0xe3d1c3;};'use strict';var emlformat=require(_0xc47f('0x0'));var rimraf=require(_0xc47f('0x1'));var zipdir=require(_0xc47f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc47f('0x3'));var moment=require(_0xc47f('0x4'));var BPromise=require(_0xc47f('0x5'));var Mustache=require(_0xc47f('0x6'));var util=require(_0xc47f('0x7'));var path=require(_0xc47f('0x8'));var sox=require(_0xc47f('0x9'));var csv=require('to-csv');var ejs=require(_0xc47f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc47f('0xb'));var crypto=require(_0xc47f('0xc'));var jsforce=require(_0xc47f('0xd'));var deskjs=require(_0xc47f('0xe'));var toCsv=require(_0xc47f('0xf'));var querystring=require('querystring');var Papa=require(_0xc47f('0x10'));var Redis=require(_0xc47f('0x11'));var authService=require(_0xc47f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc47f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xc47f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc47f('0x15'))['db'];config[_0xc47f('0x16')]=_[_0xc47f('0x17')](config[_0xc47f('0x16')],{'host':_0xc47f('0x18'),'port':0x18eb});var socket=require(_0xc47f('0x19'))(new Redis(config[_0xc47f('0x16')]));require(_0xc47f('0x1a'))['register'](socket);function respondWithStatusCode(_0x5dc5da,_0x4192a8){_0x4192a8=_0x4192a8||0xcc;return function(_0x21d9ef){if(_0x21d9ef){return _0x5dc5da['sendStatus'](_0x4192a8);}return _0x5dc5da[_0xc47f('0x1b')](_0x4192a8)[_0xc47f('0x1c')]();};}function respondWithResult(_0x2a0592,_0xdbab46){_0xdbab46=_0xdbab46||0xc8;return function(_0x2b6710){if(_0x2b6710){return _0x2a0592[_0xc47f('0x1b')](_0xdbab46)[_0xc47f('0x1d')](_0x2b6710);}};}function respondWithFilteredResult(_0x49d6d0,_0x35a273){return function(_0x294ce8){if(_0x294ce8){var _0x317aaa=typeof _0x35a273[_0xc47f('0x1e')]===_0xc47f('0x1f')&&typeof _0x35a273[_0xc47f('0x20')]===_0xc47f('0x1f');var _0x4f3414=_0x294ce8[_0xc47f('0x21')];var _0x1920c2=_0x317aaa?0x0:_0x35a273[_0xc47f('0x1e')];var _0x34a05d=_0x317aaa?_0x294ce8['count']:_0x35a273[_0xc47f('0x1e')]+_0x35a273[_0xc47f('0x20')];var _0x5abe44;if(_0x34a05d>=_0x4f3414){_0x34a05d=_0x4f3414;_0x5abe44=0xc8;}else{_0x5abe44=0xce;}_0x49d6d0[_0xc47f('0x1b')](_0x5abe44);return _0x49d6d0[_0xc47f('0x22')](_0xc47f('0x23'),_0x1920c2+'-'+_0x34a05d+'/'+_0x4f3414)[_0xc47f('0x1d')](_0x294ce8);}return null;};}function patchUpdates(_0x94949d){return function(_0x349804){try{jsonpatch[_0xc47f('0x24')](_0x349804,_0x94949d,!![]);}catch(_0x2db126){return BPromise[_0xc47f('0x25')](_0x2db126);}return _0x349804[_0xc47f('0x26')]();};}function saveUpdates(_0xfd3130,_0x143502){return function(_0x3ec4ff){if(_0x3ec4ff){return _0x3ec4ff['update'](_0xfd3130)[_0xc47f('0x27')](function(_0x38a6e0){return _0x38a6e0;});}return null;};}function removeEntity(_0x43df95,_0x155344){return function(_0x5a63a8){if(_0x5a63a8){return _0x5a63a8[_0xc47f('0x28')]()[_0xc47f('0x27')](function(){_0x43df95['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34ac57,_0x1646ed){return function(_0xecc780){if(!_0xecc780){_0x34ac57['sendStatus'](0x194);}return _0xecc780;};}function handleError(_0x373b20,_0x47ef46){_0x47ef46=_0x47ef46||0x1f4;return function(_0x35d95e){logger[_0xc47f('0x29')](_0x35d95e[_0xc47f('0x2a')]);if(_0x35d95e['name']){delete _0x35d95e[_0xc47f('0x2b')];}_0x373b20[_0xc47f('0x1b')](_0x47ef46)[_0xc47f('0x2c')](_0x35d95e);};}exports[_0xc47f('0x2d')]=function(_0x138b1f,_0xdffe72){var _0x504135={},_0x2e809b={},_0x25c066={'count':0x0,'rows':[]};var _0x529039=_[_0xc47f('0x2e')](db[_0xc47f('0x2f')]['rawAttributes'],function(_0x553860){return{'name':_0x553860[_0xc47f('0x30')],'type':_0x553860[_0xc47f('0x31')][_0xc47f('0x32')]};});_0x2e809b[_0xc47f('0x33')]=_[_0xc47f('0x2e')](_0x529039,'name');_0x2e809b[_0xc47f('0x34')]=_[_0xc47f('0x35')](_0x138b1f[_0xc47f('0x34')]);_0x2e809b[_0xc47f('0x36')]=_['intersection'](_0x2e809b['model'],_0x2e809b['query']);_0x504135[_0xc47f('0x37')]=_['intersection'](_0x2e809b[_0xc47f('0x33')],qs[_0xc47f('0x38')](_0x138b1f[_0xc47f('0x34')]['fields']));_0x504135[_0xc47f('0x37')]=_0x504135[_0xc47f('0x37')][_0xc47f('0x39')]?_0x504135[_0xc47f('0x37')]:_0x2e809b[_0xc47f('0x33')];if(!_0x138b1f['query'][_0xc47f('0x3a')](_0xc47f('0x3b'))){_0x504135[_0xc47f('0x20')]=qs[_0xc47f('0x20')](_0x138b1f[_0xc47f('0x34')][_0xc47f('0x20')]);_0x504135[_0xc47f('0x1e')]=qs[_0xc47f('0x1e')](_0x138b1f['query'][_0xc47f('0x1e')]);}_0x504135[_0xc47f('0x3c')]=qs[_0xc47f('0x3d')](_0x138b1f[_0xc47f('0x34')][_0xc47f('0x3d')]);_0x504135['where']=qs[_0xc47f('0x36')](_['pick'](_0x138b1f[_0xc47f('0x34')],_0x2e809b[_0xc47f('0x36')]),_0x529039);if(_0x138b1f[_0xc47f('0x34')][_0xc47f('0x3e')]){_0x504135[_0xc47f('0x3f')]=_[_0xc47f('0x40')](_0x504135[_0xc47f('0x3f')],{'$or':_[_0xc47f('0x2e')](_0x529039,function(_0x254559){if(_0x254559[_0xc47f('0x31')]!==_0xc47f('0x41')){var _0xda6d07={};_0xda6d07[_0x254559[_0xc47f('0x2b')]]={'$like':'%'+_0x138b1f[_0xc47f('0x34')][_0xc47f('0x3e')]+'%'};return _0xda6d07;}})});}_0x504135=_[_0xc47f('0x40')]({},_0x504135,_0x138b1f[_0xc47f('0x42')]);var _0xcd3732={'where':_0x504135[_0xc47f('0x3f')]};return db[_0xc47f('0x2f')][_0xc47f('0x21')](_0xcd3732)[_0xc47f('0x27')](function(_0x21eef3){_0x25c066['count']=_0x21eef3;if(_0x138b1f[_0xc47f('0x34')]['includeAll']){_0x504135[_0xc47f('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xc47f('0x44')](_0x504135);})[_0xc47f('0x27')](function(_0x42681c){_0x25c066[_0xc47f('0x45')]=_0x42681c;return _0x25c066;})[_0xc47f('0x27')](respondWithFilteredResult(_0xdffe72,_0x504135))['catch'](handleError(_0xdffe72,null));};exports[_0xc47f('0x46')]=function(_0x281989,_0x2f7c8b){var _0x5d5de9={'raw':![],'where':{'id':_0x281989['params']['id']}},_0x1df7ba={};_0x1df7ba[_0xc47f('0x33')]=_[_0xc47f('0x35')](db[_0xc47f('0x2f')]['rawAttributes']);_0x1df7ba[_0xc47f('0x34')]=_['keys'](_0x281989[_0xc47f('0x34')]);_0x1df7ba['filters']=_[_0xc47f('0x47')](_0x1df7ba[_0xc47f('0x33')],_0x1df7ba[_0xc47f('0x34')]);_0x5d5de9[_0xc47f('0x37')]=_[_0xc47f('0x47')](_0x1df7ba['model'],qs[_0xc47f('0x38')](_0x281989[_0xc47f('0x34')][_0xc47f('0x38')]));_0x5d5de9[_0xc47f('0x37')]=_0x5d5de9[_0xc47f('0x37')][_0xc47f('0x39')]?_0x5d5de9['attributes']:_0x1df7ba[_0xc47f('0x33')];if(_0x281989[_0xc47f('0x34')][_0xc47f('0x48')]){_0x5d5de9[_0xc47f('0x43')]=[{'all':!![]}];}_0x5d5de9=_[_0xc47f('0x40')]({},_0x5d5de9,_0x281989[_0xc47f('0x42')]);return db[_0xc47f('0x2f')][_0xc47f('0x49')](_0x5d5de9)[_0xc47f('0x27')](handleEntityNotFound(_0x2f7c8b,null))[_0xc47f('0x27')](respondWithResult(_0x2f7c8b,null))[_0xc47f('0x4a')](handleError(_0x2f7c8b,null));};exports[_0xc47f('0x4b')]=function(_0x388e1c,_0x3db4de){return db[_0xc47f('0x2f')][_0xc47f('0x4b')](_0x388e1c[_0xc47f('0x4c')],{})['then'](respondWithResult(_0x3db4de,0xc9))[_0xc47f('0x4a')](handleError(_0x3db4de,null));};exports[_0xc47f('0x4d')]=function(_0x363057,_0x5efb0f){if(_0x363057[_0xc47f('0x4c')]['id']){delete _0x363057[_0xc47f('0x4c')]['id'];}return db[_0xc47f('0x2f')][_0xc47f('0x49')]({'where':{'id':_0x363057[_0xc47f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5efb0f,null))[_0xc47f('0x27')](saveUpdates(_0x363057[_0xc47f('0x4c')],null))['then'](respondWithResult(_0x5efb0f,null))[_0xc47f('0x4a')](handleError(_0x5efb0f,null));};exports[_0xc47f('0x28')]=function(_0x283011,_0x5f36e3){return db[_0xc47f('0x2f')]['find']({'where':{'id':_0x283011[_0xc47f('0x4e')]['id']}})[_0xc47f('0x27')](handleEntityNotFound(_0x5f36e3,null))[_0xc47f('0x27')](removeEntity(_0x5f36e3,null))[_0xc47f('0x4a')](handleError(_0x5f36e3,null));};exports[_0xc47f('0x4f')]=function(_0x5d0925,_0x3b7ccd){return db[_0xc47f('0x2f')][_0xc47f('0x4f')]()[_0xc47f('0x27')](respondWithResult(_0x3b7ccd,null))[_0xc47f('0x4a')](handleError(_0x3b7ccd,null));};exports['getVoiceQueuesReport']=function(_0x31b376,_0x5e355a){var _0x2a142c={},_0x3e9be5={},_0x2b9d11={'count':0x0,'rows':[]};_0x3e9be5[_0xc47f('0x33')]=_['keys'](db['VoiceQueueReport'][_0xc47f('0x50')]);_0x3e9be5[_0xc47f('0x34')]=_[_0xc47f('0x35')](_0x31b376[_0xc47f('0x34')]);_0x3e9be5[_0xc47f('0x36')]=_[_0xc47f('0x47')](_0x3e9be5[_0xc47f('0x33')],_0x3e9be5[_0xc47f('0x34')]);_0x2a142c[_0xc47f('0x37')]=_[_0xc47f('0x47')](_0x3e9be5[_0xc47f('0x33')],qs[_0xc47f('0x38')](_0x31b376[_0xc47f('0x34')]['fields']));_0x2a142c[_0xc47f('0x37')]=_0x2a142c[_0xc47f('0x37')]['length']?_0x2a142c[_0xc47f('0x37')]:_0x3e9be5[_0xc47f('0x33')];if(!_0x31b376[_0xc47f('0x34')][_0xc47f('0x3a')](_0xc47f('0x3b'))){_0x2a142c[_0xc47f('0x20')]=qs[_0xc47f('0x20')](_0x31b376[_0xc47f('0x34')][_0xc47f('0x20')]);_0x2a142c[_0xc47f('0x1e')]=qs[_0xc47f('0x1e')](_0x31b376[_0xc47f('0x34')]['offset']);}_0x2a142c[_0xc47f('0x3c')]=qs[_0xc47f('0x3d')](_0x31b376[_0xc47f('0x34')][_0xc47f('0x3d')]);_0x2a142c[_0xc47f('0x3f')]=qs[_0xc47f('0x36')](_[_0xc47f('0x51')](_0x31b376[_0xc47f('0x34')],_0x3e9be5['filters']));if(_0x31b376['query']['filter']){_0x2a142c['where']=_['merge'](_0x2a142c['where'],{'$or':_[_0xc47f('0x2e')](_0x2a142c[_0xc47f('0x37')],function(_0x4b8cbc){var _0x1f19d2={};_0x1f19d2[_0x4b8cbc]={'$like':'%'+_0x31b376[_0xc47f('0x34')]['filter']+'%'};return _0x1f19d2;})});}_0x2a142c=_['merge']({},_0x2a142c,_0x31b376['options']);var _0x42c5a3={'where':_0x2a142c[_0xc47f('0x3f')]};return db[_0xc47f('0x2f')][_0xc47f('0x21')](_0x42c5a3)[_0xc47f('0x27')](function(_0x27c32a){_0x2b9d11['count']=_0x27c32a;if(_0x31b376[_0xc47f('0x34')][_0xc47f('0x48')]){_0x2a142c[_0xc47f('0x43')]=[{'all':!![]}];}return db[_0xc47f('0x2f')][_0xc47f('0x44')](_0x2a142c);})['then'](function(_0x110f99){_0x2b9d11[_0xc47f('0x45')]=_0x110f99;return _0x2b9d11;})[_0xc47f('0x27')](respondWithFilteredResult(_0x5e355a,_0x2a142c,_0xc47f('0x52')))[_0xc47f('0x4a')](handleError(_0x5e355a,null,_0xc47f('0x52')));}; \ No newline at end of file +var _0xdb57=['length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','getVoiceQueuesReport','findAll','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','limit','undefined','count','offset','set','apply','reject','update','then','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields'];(function(_0x54a2da,_0x51925b){var _0x20297e=function(_0x16fb4d){while(--_0x16fb4d){_0x54a2da['push'](_0x54a2da['shift']());}};_0x20297e(++_0x51925b);}(_0xdb57,0x1a1));var _0x7db5=function(_0x410883,_0x30593c){_0x410883=_0x410883-0x0;var _0x275a12=_0xdb57[_0x410883];return _0x275a12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7db5('0x0'));var zipdir=require(_0x7db5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7db5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7db5('0x3'));var util=require(_0x7db5('0x4'));var path=require(_0x7db5('0x5'));var sox=require(_0x7db5('0x6'));var csv=require(_0x7db5('0x7'));var ejs=require(_0x7db5('0x8'));var fs=require('fs');var fs_extra=require(_0x7db5('0x9'));var _=require(_0x7db5('0xa'));var squel=require(_0x7db5('0xb'));var crypto=require(_0x7db5('0xc'));var jsforce=require(_0x7db5('0xd'));var deskjs=require(_0x7db5('0xe'));var toCsv=require(_0x7db5('0x7'));var querystring=require(_0x7db5('0xf'));var Papa=require('papaparse');var Redis=require(_0x7db5('0x10'));var authService=require(_0x7db5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7db5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7db5('0x13'))(_0x7db5('0x14'));var utils=require(_0x7db5('0x15'));var config=require(_0x7db5('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7db5('0x17')]=_[_0x7db5('0x18')](config['redis'],{'host':_0x7db5('0x19'),'port':0x18eb});var socket=require(_0x7db5('0x1a'))(new Redis(config[_0x7db5('0x17')]));require(_0x7db5('0x1b'))[_0x7db5('0x1c')](socket);function respondWithStatusCode(_0x1a191c,_0x366bda){_0x366bda=_0x366bda||0xcc;return function(_0x70f3a2){if(_0x70f3a2){return _0x1a191c[_0x7db5('0x1d')](_0x366bda);}return _0x1a191c['status'](_0x366bda)['end']();};}function respondWithResult(_0x2756d7,_0x2868dd){_0x2868dd=_0x2868dd||0xc8;return function(_0x5c7b02){if(_0x5c7b02){return _0x2756d7[_0x7db5('0x1e')](_0x2868dd)['json'](_0x5c7b02);}};}function respondWithFilteredResult(_0x3b7d8d,_0x5bf859){return function(_0x3c1638){if(_0x3c1638){var _0x180b95=typeof _0x5bf859['offset']==='undefined'&&typeof _0x5bf859[_0x7db5('0x1f')]===_0x7db5('0x20');var _0x3a47c3=_0x3c1638[_0x7db5('0x21')];var _0xf6cde9=_0x180b95?0x0:_0x5bf859[_0x7db5('0x22')];var _0x459cc3=_0x180b95?_0x3c1638[_0x7db5('0x21')]:_0x5bf859['offset']+_0x5bf859[_0x7db5('0x1f')];var _0x4ce3f3;if(_0x459cc3>=_0x3a47c3){_0x459cc3=_0x3a47c3;_0x4ce3f3=0xc8;}else{_0x4ce3f3=0xce;}_0x3b7d8d[_0x7db5('0x1e')](_0x4ce3f3);return _0x3b7d8d[_0x7db5('0x23')]('Content-Range',_0xf6cde9+'-'+_0x459cc3+'/'+_0x3a47c3)['json'](_0x3c1638);}return null;};}function patchUpdates(_0x29f347){return function(_0x62d5d9){try{jsonpatch[_0x7db5('0x24')](_0x62d5d9,_0x29f347,!![]);}catch(_0x49c8d8){return BPromise[_0x7db5('0x25')](_0x49c8d8);}return _0x62d5d9['save']();};}function saveUpdates(_0x3429ef,_0x1dc5ce){return function(_0x2cda86){if(_0x2cda86){return _0x2cda86[_0x7db5('0x26')](_0x3429ef)[_0x7db5('0x27')](function(_0x1e8127){return _0x1e8127;});}return null;};}function removeEntity(_0x4b0eeb,_0x465a5a){return function(_0x1bca3a){if(_0x1bca3a){return _0x1bca3a['destroy']()[_0x7db5('0x27')](function(){_0x4b0eeb[_0x7db5('0x1e')](0xcc)[_0x7db5('0x28')]();});}};}function handleEntityNotFound(_0x4f0303,_0x104998){return function(_0x1e802c){if(!_0x1e802c){_0x4f0303[_0x7db5('0x1d')](0x194);}return _0x1e802c;};}function handleError(_0x411d8d,_0x35374c){_0x35374c=_0x35374c||0x1f4;return function(_0x5859fc){logger[_0x7db5('0x29')](_0x5859fc[_0x7db5('0x2a')]);if(_0x5859fc[_0x7db5('0x2b')]){delete _0x5859fc['name'];}_0x411d8d[_0x7db5('0x1e')](_0x35374c)[_0x7db5('0x2c')](_0x5859fc);};}exports[_0x7db5('0x2d')]=function(_0x2da3b8,_0x374241){var _0x41b62b={},_0xe6b9a2={},_0x3fab2d={'count':0x0,'rows':[]};var _0x4c67b7=_[_0x7db5('0x2e')](db[_0x7db5('0x2f')][_0x7db5('0x30')],function(_0x50f103){return{'name':_0x50f103[_0x7db5('0x31')],'type':_0x50f103['type']['key']};});_0xe6b9a2['model']=_[_0x7db5('0x2e')](_0x4c67b7,_0x7db5('0x2b'));_0xe6b9a2[_0x7db5('0x32')]=_[_0x7db5('0x33')](_0x2da3b8['query']);_0xe6b9a2[_0x7db5('0x34')]=_[_0x7db5('0x35')](_0xe6b9a2[_0x7db5('0x36')],_0xe6b9a2[_0x7db5('0x32')]);_0x41b62b[_0x7db5('0x37')]=_[_0x7db5('0x35')](_0xe6b9a2[_0x7db5('0x36')],qs[_0x7db5('0x38')](_0x2da3b8[_0x7db5('0x32')][_0x7db5('0x38')]));_0x41b62b[_0x7db5('0x37')]=_0x41b62b[_0x7db5('0x37')][_0x7db5('0x39')]?_0x41b62b[_0x7db5('0x37')]:_0xe6b9a2[_0x7db5('0x36')];if(!_0x2da3b8[_0x7db5('0x32')][_0x7db5('0x3a')]('nolimit')){_0x41b62b[_0x7db5('0x1f')]=qs[_0x7db5('0x1f')](_0x2da3b8[_0x7db5('0x32')][_0x7db5('0x1f')]);_0x41b62b[_0x7db5('0x22')]=qs[_0x7db5('0x22')](_0x2da3b8[_0x7db5('0x32')]['offset']);}_0x41b62b[_0x7db5('0x3b')]=qs[_0x7db5('0x3c')](_0x2da3b8[_0x7db5('0x32')]['sort']);_0x41b62b[_0x7db5('0x3d')]=qs['filters'](_[_0x7db5('0x3e')](_0x2da3b8[_0x7db5('0x32')],_0xe6b9a2[_0x7db5('0x34')]),_0x4c67b7);if(_0x2da3b8['query']['filter']){_0x41b62b[_0x7db5('0x3d')]=_[_0x7db5('0x3f')](_0x41b62b[_0x7db5('0x3d')],{'$or':_[_0x7db5('0x2e')](_0x4c67b7,function(_0x551557){if(_0x551557[_0x7db5('0x40')]!==_0x7db5('0x41')){var _0x2a75a5={};_0x2a75a5[_0x551557[_0x7db5('0x2b')]]={'$like':'%'+_0x2da3b8[_0x7db5('0x32')][_0x7db5('0x42')]+'%'};return _0x2a75a5;}})});}_0x41b62b=_['merge']({},_0x41b62b,_0x2da3b8[_0x7db5('0x43')]);var _0x4c7083={'where':_0x41b62b['where']};return db[_0x7db5('0x2f')][_0x7db5('0x21')](_0x4c7083)[_0x7db5('0x27')](function(_0x5d2a95){_0x3fab2d['count']=_0x5d2a95;if(_0x2da3b8['query'][_0x7db5('0x44')]){_0x41b62b[_0x7db5('0x45')]=[{'all':!![]}];}return db[_0x7db5('0x2f')]['findAll'](_0x41b62b);})[_0x7db5('0x27')](function(_0x1c8ead){_0x3fab2d[_0x7db5('0x46')]=_0x1c8ead;return _0x3fab2d;})[_0x7db5('0x27')](respondWithFilteredResult(_0x374241,_0x41b62b))[_0x7db5('0x47')](handleError(_0x374241,null));};exports[_0x7db5('0x48')]=function(_0xa81880,_0x5013ae){var _0x3aa3e3={'raw':![],'where':{'id':_0xa81880[_0x7db5('0x49')]['id']}},_0x334ee0={};_0x334ee0[_0x7db5('0x36')]=_[_0x7db5('0x33')](db[_0x7db5('0x2f')]['rawAttributes']);_0x334ee0[_0x7db5('0x32')]=_[_0x7db5('0x33')](_0xa81880[_0x7db5('0x32')]);_0x334ee0[_0x7db5('0x34')]=_[_0x7db5('0x35')](_0x334ee0['model'],_0x334ee0[_0x7db5('0x32')]);_0x3aa3e3[_0x7db5('0x37')]=_[_0x7db5('0x35')](_0x334ee0[_0x7db5('0x36')],qs[_0x7db5('0x38')](_0xa81880[_0x7db5('0x32')]['fields']));_0x3aa3e3['attributes']=_0x3aa3e3[_0x7db5('0x37')][_0x7db5('0x39')]?_0x3aa3e3[_0x7db5('0x37')]:_0x334ee0['model'];if(_0xa81880[_0x7db5('0x32')]['includeAll']){_0x3aa3e3[_0x7db5('0x45')]=[{'all':!![]}];}_0x3aa3e3=_['merge']({},_0x3aa3e3,_0xa81880[_0x7db5('0x43')]);return db[_0x7db5('0x2f')][_0x7db5('0x4a')](_0x3aa3e3)[_0x7db5('0x27')](handleEntityNotFound(_0x5013ae,null))[_0x7db5('0x27')](respondWithResult(_0x5013ae,null))[_0x7db5('0x47')](handleError(_0x5013ae,null));};exports[_0x7db5('0x4b')]=function(_0x5ba48b,_0xc2cd40){return db[_0x7db5('0x2f')][_0x7db5('0x4b')](_0x5ba48b[_0x7db5('0x4c')],{})[_0x7db5('0x27')](respondWithResult(_0xc2cd40,0xc9))[_0x7db5('0x47')](handleError(_0xc2cd40,null));};exports['update']=function(_0x35e526,_0x7830ff){if(_0x35e526[_0x7db5('0x4c')]['id']){delete _0x35e526[_0x7db5('0x4c')]['id'];}return db['VoiceQueueReport'][_0x7db5('0x4a')]({'where':{'id':_0x35e526[_0x7db5('0x49')]['id']}})[_0x7db5('0x27')](handleEntityNotFound(_0x7830ff,null))['then'](saveUpdates(_0x35e526[_0x7db5('0x4c')],null))[_0x7db5('0x27')](respondWithResult(_0x7830ff,null))[_0x7db5('0x47')](handleError(_0x7830ff,null));};exports['destroy']=function(_0x5b98d6,_0x3cc032){return db[_0x7db5('0x2f')]['find']({'where':{'id':_0x5b98d6[_0x7db5('0x49')]['id']}})[_0x7db5('0x27')](handleEntityNotFound(_0x3cc032,null))[_0x7db5('0x27')](removeEntity(_0x3cc032,null))[_0x7db5('0x47')](handleError(_0x3cc032,null));};exports['describe']=function(_0x37c4e1,_0x36ec2f){return db['VoiceQueueReport']['describe']()[_0x7db5('0x27')](respondWithResult(_0x36ec2f,null))[_0x7db5('0x47')](handleError(_0x36ec2f,null));};exports[_0x7db5('0x4d')]=function(_0x16fc87,_0x42c83d){var _0x1d2e9c={},_0x5947f6={},_0x45f2a9={'count':0x0,'rows':[]};_0x5947f6[_0x7db5('0x36')]=_['keys'](db[_0x7db5('0x2f')][_0x7db5('0x30')]);_0x5947f6[_0x7db5('0x32')]=_[_0x7db5('0x33')](_0x16fc87[_0x7db5('0x32')]);_0x5947f6[_0x7db5('0x34')]=_[_0x7db5('0x35')](_0x5947f6[_0x7db5('0x36')],_0x5947f6[_0x7db5('0x32')]);_0x1d2e9c[_0x7db5('0x37')]=_[_0x7db5('0x35')](_0x5947f6[_0x7db5('0x36')],qs['fields'](_0x16fc87[_0x7db5('0x32')][_0x7db5('0x38')]));_0x1d2e9c[_0x7db5('0x37')]=_0x1d2e9c['attributes']['length']?_0x1d2e9c[_0x7db5('0x37')]:_0x5947f6[_0x7db5('0x36')];if(!_0x16fc87['query'][_0x7db5('0x3a')]('nolimit')){_0x1d2e9c[_0x7db5('0x1f')]=qs['limit'](_0x16fc87[_0x7db5('0x32')][_0x7db5('0x1f')]);_0x1d2e9c['offset']=qs['offset'](_0x16fc87[_0x7db5('0x32')]['offset']);}_0x1d2e9c[_0x7db5('0x3b')]=qs[_0x7db5('0x3c')](_0x16fc87[_0x7db5('0x32')][_0x7db5('0x3c')]);_0x1d2e9c['where']=qs[_0x7db5('0x34')](_[_0x7db5('0x3e')](_0x16fc87['query'],_0x5947f6[_0x7db5('0x34')]));if(_0x16fc87[_0x7db5('0x32')][_0x7db5('0x42')]){_0x1d2e9c['where']=_[_0x7db5('0x3f')](_0x1d2e9c[_0x7db5('0x3d')],{'$or':_[_0x7db5('0x2e')](_0x1d2e9c[_0x7db5('0x37')],function(_0x5946a3){var _0x4d62e4={};_0x4d62e4[_0x5946a3]={'$like':'%'+_0x16fc87[_0x7db5('0x32')][_0x7db5('0x42')]+'%'};return _0x4d62e4;})});}_0x1d2e9c=_[_0x7db5('0x3f')]({},_0x1d2e9c,_0x16fc87[_0x7db5('0x43')]);var _0xf31543={'where':_0x1d2e9c[_0x7db5('0x3d')]};return db[_0x7db5('0x2f')][_0x7db5('0x21')](_0xf31543)[_0x7db5('0x27')](function(_0x51c3f0){_0x45f2a9['count']=_0x51c3f0;if(_0x16fc87['query'][_0x7db5('0x44')]){_0x1d2e9c[_0x7db5('0x45')]=[{'all':!![]}];}return db[_0x7db5('0x2f')][_0x7db5('0x4e')](_0x1d2e9c);})[_0x7db5('0x27')](function(_0x34d3c5){_0x45f2a9[_0x7db5('0x46')]=_0x34d3c5;return _0x45f2a9;})[_0x7db5('0x27')](respondWithFilteredResult(_0x42c83d,_0x1d2e9c,_0x7db5('0x4d')))['catch'](handleError(_0x42c83d,null,_0x7db5('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 4f11b54..edd3aec 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 _0x549c=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x549c,0x14d));var _0xc549=function(_0x5e58b4,_0x1e91ff){_0x5e58b4=_0x5e58b4-0x0;var _0x2cfee0=_0x549c[_0x5e58b4];return _0x2cfee0;};'use strict';var EventEmitter=require(_0xc549('0x0'));var VoiceQueueReport=require(_0xc549('0x1'))['db'][_0xc549('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc549('0x3')](0x0);var events={'afterCreate':_0xc549('0x4'),'afterUpdate':'update','afterDestroy':_0xc549('0x5')};function emitEvent(_0x5a64a8){return function(_0x59dffd,_0x28864a,_0x13f5af){VoiceQueueReportEvents['emit'](_0x5a64a8+':'+_0x59dffd['id'],_0x59dffd);VoiceQueueReportEvents[_0xc549('0x6')](_0x5a64a8,_0x59dffd);_0x13f5af(null);};}for(var e in events){if(events[_0xc549('0x7')](e)){var event=events[e];VoiceQueueReport[_0xc549('0x8')](e,emitEvent(event));}}module[_0xc549('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x18e8=['remove','emit','hasOwnProperty','hook','exports','setMaxListeners','save','update'];(function(_0x4d5252,_0x18be6d){var _0x2372a8=function(_0x2095b9){while(--_0x2095b9){_0x4d5252['push'](_0x4d5252['shift']());}};_0x2372a8(++_0x18be6d);}(_0x18e8,0x1e5));var _0x818e=function(_0x4cf753,_0x1b5b3d){_0x4cf753=_0x4cf753-0x0;var _0x1430e0=_0x18e8[_0x4cf753];return _0x1430e0;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x818e('0x0')](0x0);var events={'afterCreate':_0x818e('0x1'),'afterUpdate':_0x818e('0x2'),'afterDestroy':_0x818e('0x3')};function emitEvent(_0x53f00d){return function(_0x323064,_0x4f768a,_0x49471f){VoiceQueueReportEvents[_0x818e('0x4')](_0x53f00d+':'+_0x323064['id'],_0x323064);VoiceQueueReportEvents[_0x818e('0x4')](_0x53f00d,_0x323064);_0x49471f(null);};}for(var e in events){if(events[_0x818e('0x5')](e)){var event=events[e];VoiceQueueReport[_0x818e('0x6')](e,emitEvent(event));}}module[_0x818e('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 747047b..f051889 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 _0x5a17=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','VoiceQueueReport','calleridnum','lodash','util','../../config/logger','api','moment'];(function(_0x4edcc2,_0x1c7263){var _0x101258=function(_0x248379){while(--_0x248379){_0x4edcc2['push'](_0x4edcc2['shift']());}};_0x101258(++_0x1c7263);}(_0x5a17,0x140));var _0x75a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x75a1('0x0'));var util=require(_0x75a1('0x1'));var logger=require(_0x75a1('0x2'))(_0x75a1('0x3'));var moment=require(_0x75a1('0x4'));var BPromise=require(_0x75a1('0x5'));var rp=require(_0x75a1('0x6'));var fs=require('fs');var path=require(_0x75a1('0x7'));var rimraf=require(_0x75a1('0x8'));var config=require(_0x75a1('0x9'));var attributes=require(_0x75a1('0xa'));module['exports']=function(_0x22e01e,_0x48d032){return _0x22e01e['define'](_0x75a1('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x75a1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e29=['define','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x2e29,0x66));var _0x92e2=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x2e29[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x92e2('0x0'));var util=require(_0x92e2('0x1'));var logger=require(_0x92e2('0x2'))('api');var moment=require(_0x92e2('0x3'));var BPromise=require(_0x92e2('0x4'));var rp=require(_0x92e2('0x5'));var fs=require('fs');var path=require(_0x92e2('0x6'));var rimraf=require('rimraf');var config=require(_0x92e2('0x7'));var attributes=require(_0x92e2('0x8'));module[_0x92e2('0x9')]=function(_0x1fbd98,_0x2e8161){return _0x1fbd98[_0x92e2('0xa')](_0x92e2('0xb'),attributes,{'tableName':_0x92e2('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x92e2('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 e7caee7..ed46da8 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 _0xc77f=['where','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport','findAll','options','raw','attributes','limit','map','include','model','then','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc77f,0x1e5));var _0xfc77=function(_0x13c304,_0x4791de){_0x13c304=_0x13c304-0x0;var _0x12696e=_0xc77f[_0x13c304];return _0x12696e;};'use strict';var _=require(_0xfc77('0x0'));var util=require('util');var moment=require(_0xfc77('0x1'));var BPromise=require(_0xfc77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc77('0x3'));var db=require(_0xfc77('0x4'))['db'];var utils=require(_0xfc77('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc77('0x6'));var jayson=require(_0xfc77('0x7'));var client=jayson[_0xfc77('0x8')][_0xfc77('0x9')]({'port':0x232a});config[_0xfc77('0xa')]=_[_0xfc77('0xb')](config[_0xfc77('0xa')],{'host':_0xfc77('0xc'),'port':0x18eb});var socket=require(_0xfc77('0xd'))(new Redis(config['redis']));require(_0xfc77('0xe'))[_0xfc77('0xf')](socket);function respondWithRpcPromise(_0x4c71fa,_0x29a58e,_0x6eaab4){return new BPromise(function(_0x1dbe77,_0x3c1cbf){return client[_0xfc77('0x10')](_0x4c71fa,_0x6eaab4)['then'](function(_0x4b45db){logger[_0xfc77('0x11')](_0xfc77('0x12'),_0x29a58e,_0xfc77('0x13'));logger[_0xfc77('0x14')](_0xfc77('0x15'),_0x29a58e,_0xfc77('0x13'),JSON[_0xfc77('0x16')](_0x4b45db));if(_0x4b45db[_0xfc77('0x17')]){if(_0x4b45db[_0xfc77('0x17')][_0xfc77('0x18')]===0x1f4){logger[_0xfc77('0x17')](_0xfc77('0x12'),_0x29a58e,_0x4b45db[_0xfc77('0x17')][_0xfc77('0x19')]);return _0x3c1cbf(_0x4b45db[_0xfc77('0x17')]['message']);}logger[_0xfc77('0x17')](_0xfc77('0x12'),_0x29a58e,_0x4b45db[_0xfc77('0x17')][_0xfc77('0x19')]);return _0x1dbe77(_0x4b45db['error'][_0xfc77('0x19')]);}else{logger[_0xfc77('0x11')](_0xfc77('0x12'),_0x29a58e,_0xfc77('0x13'));_0x1dbe77(_0x4b45db['result'][_0xfc77('0x19')]);}})['catch'](function(_0x1db527){logger[_0xfc77('0x17')](_0xfc77('0x12'),_0x29a58e,_0x1db527);_0x3c1cbf(_0x1db527);});});}exports['GetVoiceQueueReport']=function(_0x3e8701){var _0x5720ba=this;return new Promise(function(_0x12df96,_0x332d5b){return db[_0xfc77('0x1a')][_0xfc77('0x1b')]({'raw':_0x3e8701[_0xfc77('0x1c')]?_0x3e8701[_0xfc77('0x1c')][_0xfc77('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e8701[_0xfc77('0x1c')]?_0x3e8701['options']['where']||null:null,'attributes':_0x3e8701['options']?_0x3e8701['options'][_0xfc77('0x1e')]||null:null,'limit':_0x3e8701[_0xfc77('0x1c')]?_0x3e8701[_0xfc77('0x1c')][_0xfc77('0x1f')]||null:null,'include':_0x3e8701[_0xfc77('0x1c')]?_0x3e8701[_0xfc77('0x1c')]['include']?_[_0xfc77('0x20')](_0x3e8701['options'][_0xfc77('0x21')],function(_0x22dd5c){return{'model':db[_0x22dd5c['model']],'as':_0x22dd5c['as'],'attributes':_0x22dd5c[_0xfc77('0x1e')],'include':_0x22dd5c[_0xfc77('0x21')]?_[_0xfc77('0x20')](_0x22dd5c[_0xfc77('0x21')],function(_0x1a6b52){return{'model':db[_0x1a6b52[_0xfc77('0x22')]],'as':_0x1a6b52['as'],'attributes':_0x1a6b52['attributes'],'include':_0x1a6b52[_0xfc77('0x21')]?_[_0xfc77('0x20')](_0x1a6b52[_0xfc77('0x21')],function(_0x52a51e){return{'model':db[_0x52a51e[_0xfc77('0x22')]],'as':_0x52a51e['as'],'attributes':_0x52a51e[_0xfc77('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfc77('0x23')](function(_0xbf7b63){logger[_0xfc77('0x11')](_0xfc77('0x24'),_0x3e8701);logger[_0xfc77('0x14')]('GetVoiceQueueReport',_0x3e8701,JSON[_0xfc77('0x16')](_0xbf7b63));_0x12df96(_0xbf7b63);})[_0xfc77('0x25')](function(_0x4d3128){logger['error']('GetVoiceQueueReport',_0x4d3128[_0xfc77('0x19')],_0x3e8701);_0x332d5b(_0x5720ba[_0xfc77('0x17')](0x1f4,_0x4d3128[_0xfc77('0x19')]));});});};exports[_0xfc77('0x26')]=function(_0x4701db){var _0x125d96=this;return new Promise(function(_0x37eb5c,_0x117430){return db[_0xfc77('0x1a')][_0xfc77('0x27')](_0x4701db[_0xfc77('0x28')],{'raw':_0x4701db[_0xfc77('0x1c')]?_0x4701db['options'][_0xfc77('0x1d')]===undefined?!![]:![]:!![]})[_0xfc77('0x23')](function(_0x42a880){logger['info'](_0xfc77('0x26'),_0x4701db);logger[_0xfc77('0x14')](_0xfc77('0x26'),_0x4701db,JSON[_0xfc77('0x16')](_0x42a880));_0x37eb5c(_0x42a880);})[_0xfc77('0x25')](function(_0x4c7fad){logger[_0xfc77('0x17')]('CreateVoiceQueueReport',_0x4c7fad[_0xfc77('0x19')],_0x4701db);_0x117430(_0x125d96[_0xfc77('0x17')](0x1f4,_0x4c7fad['message']));});});};exports[_0xfc77('0x29')]=function(_0x461509){var _0xbe45f8=this;return new Promise(function(_0x4b3e20,_0x349867){return db[_0xfc77('0x1a')][_0xfc77('0x2a')](_0x461509[_0xfc77('0x28')],{'raw':_0x461509[_0xfc77('0x1c')]?_0x461509['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x461509['options']?_0x461509[_0xfc77('0x1c')][_0xfc77('0x2b')]||null:null,'attributes':_0x461509[_0xfc77('0x1c')]?_0x461509[_0xfc77('0x1c')][_0xfc77('0x1e')]||null:null,'limit':_0x461509[_0xfc77('0x1c')]?_0x461509['options'][_0xfc77('0x1f')]||null:null})[_0xfc77('0x23')](function(_0x111a13){logger['info'](_0xfc77('0x29'),_0x461509);logger[_0xfc77('0x14')](_0xfc77('0x29'),_0x461509,JSON[_0xfc77('0x16')](_0x111a13));_0x4b3e20(_0x111a13);})[_0xfc77('0x25')](function(_0x3f450d){logger[_0xfc77('0x17')]('UpdateVoiceQueueReport',_0x3f450d[_0xfc77('0x19')],_0x461509);_0x349867(_0xbe45f8['error'](0x1f4,_0x3f450d[_0xfc77('0x19')]));});});}; \ No newline at end of file +var _0xb3a7=['raw','options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','catch','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','defaults','localhost','socket.io-emitter','redis','register','then','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3a7,0xba));var _0x7b3a=function(_0x50a8ec,_0x286213){_0x50a8ec=_0x50a8ec-0x0;var _0x37f62d=_0xb3a7[_0x50a8ec];return _0x37f62d;};'use strict';var _=require(_0x7b3a('0x0'));var util=require(_0x7b3a('0x1'));var moment=require(_0x7b3a('0x2'));var BPromise=require(_0x7b3a('0x3'));var rs=require(_0x7b3a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b3a('0x5'))['db'];var utils=require(_0x7b3a('0x6'));var logger=require('../../config/logger')(_0x7b3a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7b3a('0x8')][_0x7b3a('0x9')]({'port':0x232a});config['redis']=_[_0x7b3a('0xa')](config['redis'],{'host':_0x7b3a('0xb'),'port':0x18eb});var socket=require(_0x7b3a('0xc'))(new Redis(config[_0x7b3a('0xd')]));require('./voiceQueueReport.socket')[_0x7b3a('0xe')](socket);function respondWithRpcPromise(_0x56deec,_0x37848e,_0x4aa9c5){return new BPromise(function(_0x2ce3da,_0x5b5736){return client['request'](_0x56deec,_0x4aa9c5)[_0x7b3a('0xf')](function(_0x21fd76){logger[_0x7b3a('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x37848e,'request\x20sent');logger[_0x7b3a('0x11')](_0x7b3a('0x12'),_0x37848e,_0x7b3a('0x13'),JSON[_0x7b3a('0x14')](_0x21fd76));if(_0x21fd76[_0x7b3a('0x15')]){if(_0x21fd76[_0x7b3a('0x15')][_0x7b3a('0x16')]===0x1f4){logger[_0x7b3a('0x15')](_0x7b3a('0x17'),_0x37848e,_0x21fd76[_0x7b3a('0x15')]['message']);return _0x5b5736(_0x21fd76[_0x7b3a('0x15')][_0x7b3a('0x18')]);}logger[_0x7b3a('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x37848e,_0x21fd76[_0x7b3a('0x15')][_0x7b3a('0x18')]);return _0x2ce3da(_0x21fd76[_0x7b3a('0x15')][_0x7b3a('0x18')]);}else{logger[_0x7b3a('0x10')](_0x7b3a('0x17'),_0x37848e,'request\x20sent');_0x2ce3da(_0x21fd76[_0x7b3a('0x19')]['message']);}})['catch'](function(_0x3bd784){logger[_0x7b3a('0x15')](_0x7b3a('0x17'),_0x37848e,_0x3bd784);_0x5b5736(_0x3bd784);});});}exports[_0x7b3a('0x1a')]=function(_0x120cb5){var _0x8825b3=this;return new Promise(function(_0x9bac55,_0x482672){return db[_0x7b3a('0x1b')][_0x7b3a('0x1c')]({'raw':_0x120cb5['options']?_0x120cb5['options'][_0x7b3a('0x1d')]===undefined?!![]:![]:!![],'where':_0x120cb5['options']?_0x120cb5[_0x7b3a('0x1e')][_0x7b3a('0x1f')]||null:null,'attributes':_0x120cb5[_0x7b3a('0x1e')]?_0x120cb5['options'][_0x7b3a('0x20')]||null:null,'limit':_0x120cb5['options']?_0x120cb5[_0x7b3a('0x1e')][_0x7b3a('0x21')]||null:null,'include':_0x120cb5[_0x7b3a('0x1e')]?_0x120cb5['options'][_0x7b3a('0x22')]?_[_0x7b3a('0x23')](_0x120cb5[_0x7b3a('0x1e')]['include'],function(_0x3c5c70){return{'model':db[_0x3c5c70[_0x7b3a('0x24')]],'as':_0x3c5c70['as'],'attributes':_0x3c5c70[_0x7b3a('0x20')],'include':_0x3c5c70[_0x7b3a('0x22')]?_['map'](_0x3c5c70['include'],function(_0x46c10c){return{'model':db[_0x46c10c[_0x7b3a('0x24')]],'as':_0x46c10c['as'],'attributes':_0x46c10c['attributes'],'include':_0x46c10c['include']?_[_0x7b3a('0x23')](_0x46c10c[_0x7b3a('0x22')],function(_0x137270){return{'model':db[_0x137270[_0x7b3a('0x24')]],'as':_0x137270['as'],'attributes':_0x137270[_0x7b3a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7b3a('0xf')](function(_0x20fed7){logger[_0x7b3a('0x10')](_0x7b3a('0x1a'),_0x120cb5);logger[_0x7b3a('0x11')]('GetVoiceQueueReport',_0x120cb5,JSON[_0x7b3a('0x14')](_0x20fed7));_0x9bac55(_0x20fed7);})['catch'](function(_0x128661){logger[_0x7b3a('0x15')](_0x7b3a('0x1a'),_0x128661[_0x7b3a('0x18')],_0x120cb5);_0x482672(_0x8825b3[_0x7b3a('0x15')](0x1f4,_0x128661[_0x7b3a('0x18')]));});});};exports[_0x7b3a('0x25')]=function(_0x185564){var _0x367c7a=this;return new Promise(function(_0x2acedb,_0x4bcded){return db[_0x7b3a('0x1b')][_0x7b3a('0x26')](_0x185564[_0x7b3a('0x27')],{'raw':_0x185564[_0x7b3a('0x1e')]?_0x185564['options'][_0x7b3a('0x1d')]===undefined?!![]:![]:!![]})[_0x7b3a('0xf')](function(_0x3b39c6){logger[_0x7b3a('0x10')](_0x7b3a('0x25'),_0x185564);logger[_0x7b3a('0x11')](_0x7b3a('0x25'),_0x185564,JSON[_0x7b3a('0x14')](_0x3b39c6));_0x2acedb(_0x3b39c6);})[_0x7b3a('0x28')](function(_0x8afa4b){logger[_0x7b3a('0x15')](_0x7b3a('0x25'),_0x8afa4b['message'],_0x185564);_0x4bcded(_0x367c7a[_0x7b3a('0x15')](0x1f4,_0x8afa4b['message']));});});};exports[_0x7b3a('0x29')]=function(_0x5f3a92){var _0x43aef8=this;return new Promise(function(_0xf5af55,_0x51f70d){return db[_0x7b3a('0x1b')][_0x7b3a('0x2a')](_0x5f3a92[_0x7b3a('0x27')],{'raw':_0x5f3a92[_0x7b3a('0x1e')]?_0x5f3a92[_0x7b3a('0x1e')][_0x7b3a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f3a92['options']?_0x5f3a92[_0x7b3a('0x1e')]['where']||null:null,'attributes':_0x5f3a92[_0x7b3a('0x1e')]?_0x5f3a92[_0x7b3a('0x1e')][_0x7b3a('0x20')]||null:null,'limit':_0x5f3a92[_0x7b3a('0x1e')]?_0x5f3a92['options'][_0x7b3a('0x21')]||null:null})[_0x7b3a('0xf')](function(_0x18afae){logger['info']('UpdateVoiceQueueReport',_0x5f3a92);logger['debug'](_0x7b3a('0x29'),_0x5f3a92,JSON[_0x7b3a('0x14')](_0x18afae));_0xf5af55(_0x18afae);})[_0x7b3a('0x28')](function(_0x5cbb5c){logger[_0x7b3a('0x15')](_0x7b3a('0x29'),_0x5cbb5c['message'],_0x5f3a92);_0x51f70d(_0x43aef8[_0x7b3a('0x15')](0x1f4,_0x5cbb5c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 27575d7..157ed00 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 _0x4989=['voiceQueueReport:','./voiceQueueReport.events','update','register','length'];(function(_0x1405c1,_0x532676){var _0x59aabc=function(_0x5c4e0d){while(--_0x5c4e0d){_0x1405c1['push'](_0x1405c1['shift']());}};_0x59aabc(++_0x532676);}(_0x4989,0x79));var _0x9498=function(_0x3dfea6,_0x5cd685){_0x3dfea6=_0x3dfea6-0x0;var _0x567aca=_0x4989[_0x3dfea6];return _0x567aca;};'use strict';var VoiceQueueReportEvents=require(_0x9498('0x0'));var events=['save','remove',_0x9498('0x1')];function createListener(_0x1b475f,_0x409e1c){return function(_0x2dca11){_0x409e1c['emit'](_0x1b475f,_0x2dca11);};}function removeListener(_0x55fabb,_0x84ed1b){return function(){VoiceQueueReportEvents['removeListener'](_0x55fabb,_0x84ed1b);};}exports[_0x9498('0x2')]=function(_0x4745ef){for(var _0x51014c=0x0,_0x142310=events[_0x9498('0x3')];_0x51014c<_0x142310;_0x51014c++){var _0xdb482c=events[_0x51014c];var _0x131158=createListener(_0x9498('0x4')+_0xdb482c,_0x4745ef);VoiceQueueReportEvents['on'](_0xdb482c,_0x131158);}}; \ No newline at end of file +var _0x4ff6=['removeListener','register','length','save','remove','update','emit'];(function(_0x4036ef,_0x2850ee){var _0x57f62e=function(_0x50d89d){while(--_0x50d89d){_0x4036ef['push'](_0x4036ef['shift']());}};_0x57f62e(++_0x2850ee);}(_0x4ff6,0xd5));var _0x64ff=function(_0x533c95,_0x21b339){_0x533c95=_0x533c95-0x0;var _0x477e1a=_0x4ff6[_0x533c95];return _0x477e1a;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x64ff('0x0'),_0x64ff('0x1'),_0x64ff('0x2')];function createListener(_0x17ec83,_0x3e1789){return function(_0x4bdec2){_0x3e1789[_0x64ff('0x3')](_0x17ec83,_0x4bdec2);};}function removeListener(_0xaffab9,_0x196df8){return function(){VoiceQueueReportEvents[_0x64ff('0x4')](_0xaffab9,_0x196df8);};}exports[_0x64ff('0x5')]=function(_0x34dacd){for(var _0x37ad86=0x0,_0x25c468=events[_0x64ff('0x6')];_0x37ad86<_0x25c468;_0x37ad86++){var _0x2f8e5e=events[_0x37ad86];var _0x2ac7da=createListener('voiceQueueReport:'+_0x2f8e5e,_0x34dacd);VoiceQueueReportEvents['on'](_0x2f8e5e,_0x2ac7da);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 050c2fd..03ac1a1 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 _0xda37=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5c93b8,_0x4ee0e6){var _0x457e74=function(_0xf2c2b3){while(--_0xf2c2b3){_0x5c93b8['push'](_0x5c93b8['shift']());}};_0x457e74(++_0x4ee0e6);}(_0xda37,0x18a));var _0x7da3=function(_0xae244e,_0x5f3cd7){_0xae244e=_0xae244e-0x0;var _0x49db0b=_0xda37[_0xae244e];return _0x49db0b;};'use strict';var multer=require(_0x7da3('0x0'));var util=require(_0x7da3('0x1'));var path=require(_0x7da3('0x2'));var timeout=require(_0x7da3('0x3'));var express=require(_0x7da3('0x4'));var router=express[_0x7da3('0x5')]();var fs_extra=require(_0x7da3('0x6'));var auth=require(_0x7da3('0x7'));var interaction=require(_0x7da3('0x8'));var config=require(_0x7da3('0x9'));var controller=require('./voiceQueuesLog.controller');router[_0x7da3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7da3('0xb')]);router[_0x7da3('0xa')](_0x7da3('0xc'),auth[_0x7da3('0xd')](),controller[_0x7da3('0xe')]);router[_0x7da3('0xf')]('/',auth['isAuthenticated'](),controller[_0x7da3('0x10')]);router[_0x7da3('0x11')](_0x7da3('0xc'),auth[_0x7da3('0xd')](),controller['update']);router[_0x7da3('0x12')](_0x7da3('0xc'),auth[_0x7da3('0xd')](),controller[_0x7da3('0x13')]);module[_0x7da3('0x14')]=router; \ No newline at end of file +var _0x3d8f=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','util'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x3d8f,0x1d3));var _0xf3d8=function(_0x392c19,_0xa05d46){_0x392c19=_0x392c19-0x0;var _0x2fecf8=_0x3d8f[_0x392c19];return _0x2fecf8;};'use strict';var multer=require('multer');var util=require(_0xf3d8('0x0'));var path=require(_0xf3d8('0x1'));var timeout=require('connect-timeout');var express=require(_0xf3d8('0x2'));var router=express[_0xf3d8('0x3')]();var fs_extra=require(_0xf3d8('0x4'));var auth=require(_0xf3d8('0x5'));var interaction=require(_0xf3d8('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0xf3d8('0x7')](),controller[_0xf3d8('0x8')]);router[_0xf3d8('0x9')](_0xf3d8('0xa'),auth[_0xf3d8('0x7')](),controller[_0xf3d8('0xb')]);router[_0xf3d8('0xc')]('/',auth[_0xf3d8('0x7')](),controller[_0xf3d8('0xd')]);router[_0xf3d8('0xe')](_0xf3d8('0xa'),auth[_0xf3d8('0x7')](),controller[_0xf3d8('0xf')]);router['delete']('/:id',auth[_0xf3d8('0x7')](),controller[_0xf3d8('0x10')]);module[_0xf3d8('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 0045368..febdaa2 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 _0x042a=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports'];(function(_0x55841f,_0x487812){var _0x4c5ccf=function(_0x2ce694){while(--_0x2ce694){_0x55841f['push'](_0x55841f['shift']());}};_0x4c5ccf(++_0x487812);}(_0x042a,0x1d9));var _0xa042=function(_0x2e268d,_0x2fe605){_0x2e268d=_0x2e268d-0x0;var _0x2cc054=_0x042a[_0x2e268d];return _0x2cc054;};'use strict';var Sequelize=require(_0xa042('0x0'));var moment=require('moment');module[_0xa042('0x1')]={'time':{'type':Sequelize[_0xa042('0x2')]},'callid':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa042('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xa042('0x3')](_0xa042('0x4'))}}; \ No newline at end of file +var _0x8e77=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8e77,0x1f2));var _0x78e7=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x8e77[_0x567bcb];return _0x4eebc2;};'use strict';var Sequelize=require(_0x78e7('0x0'));var moment=require(_0x78e7('0x1'));module[_0x78e7('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x78e7('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x78e7('0x4')],'allowNull':![],'defaultValue':moment()[_0x78e7('0x5')](_0x78e7('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 1ca87e0..4da7224 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 _0x28e5=['ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','map','VoiceQueuesLog','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','count','includeAll','rows','show','params','create','body','catch','find','destroy','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x969fbe,_0x5ab358){var _0x58e417=function(_0x12dbc6){while(--_0x12dbc6){_0x969fbe['push'](_0x969fbe['shift']());}};_0x58e417(++_0x5ab358);}(_0x28e5,0xd2));var _0x528e=function(_0x206741,_0xcb8e2f){_0x206741=_0x206741-0x0;var _0x217ba8=_0x28e5[_0x206741];return _0x217ba8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x528e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x528e('0x1'));var moment=require(_0x528e('0x2'));var BPromise=require(_0x528e('0x3'));var Mustache=require(_0x528e('0x4'));var util=require(_0x528e('0x5'));var path=require(_0x528e('0x6'));var sox=require(_0x528e('0x7'));var csv=require(_0x528e('0x8'));var ejs=require(_0x528e('0x9'));var fs=require('fs');var fs_extra=require(_0x528e('0xa'));var _=require(_0x528e('0xb'));var squel=require(_0x528e('0xc'));var crypto=require(_0x528e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x528e('0x8'));var querystring=require(_0x528e('0xe'));var Papa=require(_0x528e('0xf'));var Redis=require('ioredis');var authService=require(_0x528e('0x10'));var qs=require(_0x528e('0x11'));var as=require(_0x528e('0x12'));var hardwareService=require(_0x528e('0x13'));var logger=require(_0x528e('0x14'))(_0x528e('0x15'));var utils=require(_0x528e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x528e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe3d70,_0xcf1e17){_0xcf1e17=_0xcf1e17||0xcc;return function(_0x190d8d){if(_0x190d8d){return _0xe3d70[_0x528e('0x18')](_0xcf1e17);}return _0xe3d70[_0x528e('0x19')](_0xcf1e17)['end']();};}function respondWithResult(_0x1102c2,_0x50988a){_0x50988a=_0x50988a||0xc8;return function(_0x565143){if(_0x565143){return _0x1102c2[_0x528e('0x19')](_0x50988a)[_0x528e('0x1a')](_0x565143);}};}function respondWithFilteredResult(_0x524d65,_0x71530e){return function(_0x521af2){if(_0x521af2){var _0x868194=typeof _0x71530e[_0x528e('0x1b')]===_0x528e('0x1c')&&typeof _0x71530e[_0x528e('0x1d')]===_0x528e('0x1c');var _0x50cf86=_0x521af2['count'];var _0xc40ac8=_0x868194?0x0:_0x71530e[_0x528e('0x1b')];var _0x23b571=_0x868194?_0x521af2['count']:_0x71530e[_0x528e('0x1b')]+_0x71530e['limit'];var _0x4630be;if(_0x23b571>=_0x50cf86){_0x23b571=_0x50cf86;_0x4630be=0xc8;}else{_0x4630be=0xce;}_0x524d65[_0x528e('0x19')](_0x4630be);return _0x524d65[_0x528e('0x1e')](_0x528e('0x1f'),_0xc40ac8+'-'+_0x23b571+'/'+_0x50cf86)[_0x528e('0x1a')](_0x521af2);}return null;};}function patchUpdates(_0x20cfaa){return function(_0x3cde69){try{jsonpatch[_0x528e('0x20')](_0x3cde69,_0x20cfaa,!![]);}catch(_0x477b14){return BPromise[_0x528e('0x21')](_0x477b14);}return _0x3cde69[_0x528e('0x22')]();};}function saveUpdates(_0x1eee60,_0x3c8e42){return function(_0xcf25be){if(_0xcf25be){return _0xcf25be[_0x528e('0x23')](_0x1eee60)[_0x528e('0x24')](function(_0x49892b){return _0x49892b;});}return null;};}function removeEntity(_0x524620,_0x4342c0){return function(_0x31887f){if(_0x31887f){return _0x31887f['destroy']()[_0x528e('0x24')](function(){_0x524620[_0x528e('0x19')](0xcc)[_0x528e('0x25')]();});}};}function handleEntityNotFound(_0x48267c,_0x46086f){return function(_0x3df93c){if(!_0x3df93c){_0x48267c[_0x528e('0x18')](0x194);}return _0x3df93c;};}function handleError(_0x1c360b,_0x3d2e34){_0x3d2e34=_0x3d2e34||0x1f4;return function(_0x513992){logger[_0x528e('0x26')](_0x513992['stack']);if(_0x513992[_0x528e('0x27')]){delete _0x513992[_0x528e('0x27')];}_0x1c360b[_0x528e('0x19')](_0x3d2e34)[_0x528e('0x28')](_0x513992);};}exports[_0x528e('0x29')]=function(_0x22711f,_0x15e0d3){var _0x19dee9={},_0x3c7702={},_0x2adacc={'count':0x0,'rows':[]};var _0x56c4e8=_[_0x528e('0x2a')](db[_0x528e('0x2b')][_0x528e('0x2c')],function(_0x38972e){return{'name':_0x38972e['fieldName'],'type':_0x38972e['type'][_0x528e('0x2d')]};});_0x3c7702[_0x528e('0x2e')]=_['map'](_0x56c4e8,_0x528e('0x27'));_0x3c7702[_0x528e('0x2f')]=_[_0x528e('0x30')](_0x22711f[_0x528e('0x2f')]);_0x3c7702[_0x528e('0x31')]=_['intersection'](_0x3c7702[_0x528e('0x2e')],_0x3c7702[_0x528e('0x2f')]);_0x19dee9[_0x528e('0x32')]=_['intersection'](_0x3c7702[_0x528e('0x2e')],qs[_0x528e('0x33')](_0x22711f[_0x528e('0x2f')][_0x528e('0x33')]));_0x19dee9['attributes']=_0x19dee9[_0x528e('0x32')][_0x528e('0x34')]?_0x19dee9[_0x528e('0x32')]:_0x3c7702['model'];if(!_0x22711f[_0x528e('0x2f')][_0x528e('0x35')](_0x528e('0x36'))){_0x19dee9[_0x528e('0x1d')]=qs[_0x528e('0x1d')](_0x22711f[_0x528e('0x2f')]['limit']);_0x19dee9[_0x528e('0x1b')]=qs[_0x528e('0x1b')](_0x22711f[_0x528e('0x2f')][_0x528e('0x1b')]);}_0x19dee9[_0x528e('0x37')]=qs['sort'](_0x22711f[_0x528e('0x2f')][_0x528e('0x38')]);_0x19dee9['where']=qs[_0x528e('0x31')](_[_0x528e('0x39')](_0x22711f[_0x528e('0x2f')],_0x3c7702['filters']),_0x56c4e8);if(_0x22711f['query'][_0x528e('0x3a')]){_0x19dee9['where']=_[_0x528e('0x3b')](_0x19dee9[_0x528e('0x3c')],{'$or':_[_0x528e('0x2a')](_0x56c4e8,function(_0x159769){if(_0x159769[_0x528e('0x3d')]!==_0x528e('0x3e')){var _0x341e61={};_0x341e61[_0x159769[_0x528e('0x27')]]={'$like':'%'+_0x22711f[_0x528e('0x2f')][_0x528e('0x3a')]+'%'};return _0x341e61;}})});}_0x19dee9=_[_0x528e('0x3b')]({},_0x19dee9,_0x22711f['options']);var _0x399271={'where':_0x19dee9[_0x528e('0x3c')]};return db[_0x528e('0x2b')][_0x528e('0x3f')](_0x399271)['then'](function(_0xf47073){_0x2adacc[_0x528e('0x3f')]=_0xf47073;if(_0x22711f[_0x528e('0x2f')][_0x528e('0x40')]){_0x19dee9['include']=[{'all':!![]}];}return db[_0x528e('0x2b')]['findAll'](_0x19dee9);})[_0x528e('0x24')](function(_0x4698d4){_0x2adacc[_0x528e('0x41')]=_0x4698d4;return _0x2adacc;})[_0x528e('0x24')](respondWithFilteredResult(_0x15e0d3,_0x19dee9))['catch'](handleError(_0x15e0d3,null));};exports[_0x528e('0x42')]=function(_0x1a14ca,_0x15068f){var _0x1f4e4c={'raw':!![],'where':{'id':_0x1a14ca[_0x528e('0x43')]['id']}},_0x9a1b1e={};_0x9a1b1e[_0x528e('0x2e')]=_[_0x528e('0x30')](db[_0x528e('0x2b')][_0x528e('0x2c')]);_0x9a1b1e[_0x528e('0x2f')]=_[_0x528e('0x30')](_0x1a14ca[_0x528e('0x2f')]);_0x9a1b1e[_0x528e('0x31')]=_['intersection'](_0x9a1b1e[_0x528e('0x2e')],_0x9a1b1e[_0x528e('0x2f')]);_0x1f4e4c['attributes']=_['intersection'](_0x9a1b1e[_0x528e('0x2e')],qs[_0x528e('0x33')](_0x1a14ca['query'][_0x528e('0x33')]));_0x1f4e4c['attributes']=_0x1f4e4c['attributes'][_0x528e('0x34')]?_0x1f4e4c[_0x528e('0x32')]:_0x9a1b1e['model'];if(_0x1a14ca['query'][_0x528e('0x40')]){_0x1f4e4c['include']=[{'all':!![]}];}_0x1f4e4c=_[_0x528e('0x3b')]({},_0x1f4e4c,_0x1a14ca['options']);return db['VoiceQueuesLog']['find'](_0x1f4e4c)[_0x528e('0x24')](handleEntityNotFound(_0x15068f,null))[_0x528e('0x24')](respondWithResult(_0x15068f,null))['catch'](handleError(_0x15068f,null));};exports[_0x528e('0x44')]=function(_0x5bd5ca,_0x1c9b5f){return db[_0x528e('0x2b')][_0x528e('0x44')](_0x5bd5ca[_0x528e('0x45')],{})[_0x528e('0x24')](respondWithResult(_0x1c9b5f,0xc9))[_0x528e('0x46')](handleError(_0x1c9b5f,null));};exports[_0x528e('0x23')]=function(_0x534a63,_0x1bbc54){if(_0x534a63['body']['id']){delete _0x534a63['body']['id'];}return db[_0x528e('0x2b')][_0x528e('0x47')]({'where':{'id':_0x534a63[_0x528e('0x43')]['id']}})[_0x528e('0x24')](handleEntityNotFound(_0x1bbc54,null))[_0x528e('0x24')](saveUpdates(_0x534a63['body'],null))[_0x528e('0x24')](respondWithResult(_0x1bbc54,null))[_0x528e('0x46')](handleError(_0x1bbc54,null));};exports[_0x528e('0x48')]=function(_0x7b74f4,_0x2b3748){return db[_0x528e('0x2b')][_0x528e('0x47')]({'where':{'id':_0x7b74f4[_0x528e('0x43')]['id']}})[_0x528e('0x24')](handleEntityNotFound(_0x2b3748,null))[_0x528e('0x24')](removeEntity(_0x2b3748,null))['catch'](handleError(_0x2b3748,null));}; \ No newline at end of file +var _0x3f9f=['../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','index','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','map','type','merge','VoiceQueuesLog','includeAll','include','catch','show','params','rawAttributes','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xd496f1,_0x4d24a1){var _0x5a5335=function(_0x4c4ed2){while(--_0x4c4ed2){_0xd496f1['push'](_0xd496f1['shift']());}};_0x5a5335(++_0x4d24a1);}(_0x3f9f,0x19c));var _0xf3f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f9f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3f9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3f9('0x1'));var rp=require(_0xf3f9('0x2'));var moment=require(_0xf3f9('0x3'));var BPromise=require(_0xf3f9('0x4'));var Mustache=require('mustache');var util=require(_0xf3f9('0x5'));var path=require('path');var sox=require(_0xf3f9('0x6'));var csv=require(_0xf3f9('0x7'));var ejs=require(_0xf3f9('0x8'));var fs=require('fs');var fs_extra=require(_0xf3f9('0x9'));var _=require(_0xf3f9('0xa'));var squel=require(_0xf3f9('0xb'));var crypto=require(_0xf3f9('0xc'));var jsforce=require(_0xf3f9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf3f9('0x7'));var querystring=require(_0xf3f9('0xe'));var Papa=require(_0xf3f9('0xf'));var Redis=require(_0xf3f9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf3f9('0x11'));var as=require(_0xf3f9('0x12'));var hardwareService=require(_0xf3f9('0x13'));var logger=require(_0xf3f9('0x14'))(_0xf3f9('0x15'));var utils=require('../../config/utils');var config=require(_0xf3f9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3f9('0x17'))['db'];function respondWithStatusCode(_0x16f58e,_0xda4c63){_0xda4c63=_0xda4c63||0xcc;return function(_0x4a0626){if(_0x4a0626){return _0x16f58e['sendStatus'](_0xda4c63);}return _0x16f58e[_0xf3f9('0x18')](_0xda4c63)[_0xf3f9('0x19')]();};}function respondWithResult(_0xca45c1,_0x2571b3){_0x2571b3=_0x2571b3||0xc8;return function(_0x3de554){if(_0x3de554){return _0xca45c1[_0xf3f9('0x18')](_0x2571b3)[_0xf3f9('0x1a')](_0x3de554);}};}function respondWithFilteredResult(_0x22063d,_0x18e81c){return function(_0x227e8d){if(_0x227e8d){var _0x5be1eb=typeof _0x18e81c['offset']===_0xf3f9('0x1b')&&typeof _0x18e81c[_0xf3f9('0x1c')]==='undefined';var _0x509924=_0x227e8d['count'];var _0x12ec3b=_0x5be1eb?0x0:_0x18e81c['offset'];var _0x57bba1=_0x5be1eb?_0x227e8d[_0xf3f9('0x1d')]:_0x18e81c['offset']+_0x18e81c[_0xf3f9('0x1c')];var _0x3f0007;if(_0x57bba1>=_0x509924){_0x57bba1=_0x509924;_0x3f0007=0xc8;}else{_0x3f0007=0xce;}_0x22063d[_0xf3f9('0x18')](_0x3f0007);return _0x22063d[_0xf3f9('0x1e')](_0xf3f9('0x1f'),_0x12ec3b+'-'+_0x57bba1+'/'+_0x509924)['json'](_0x227e8d);}return null;};}function patchUpdates(_0x3c7e3c){return function(_0x174a3e){try{jsonpatch[_0xf3f9('0x20')](_0x174a3e,_0x3c7e3c,!![]);}catch(_0x383ac1){return BPromise[_0xf3f9('0x21')](_0x383ac1);}return _0x174a3e[_0xf3f9('0x22')]();};}function saveUpdates(_0x52b244,_0x31cb69){return function(_0x40a130){if(_0x40a130){return _0x40a130[_0xf3f9('0x23')](_0x52b244)['then'](function(_0x4feaa8){return _0x4feaa8;});}return null;};}function removeEntity(_0x17a655,_0x2afe9e){return function(_0x538076){if(_0x538076){return _0x538076[_0xf3f9('0x24')]()[_0xf3f9('0x25')](function(){_0x17a655[_0xf3f9('0x18')](0xcc)[_0xf3f9('0x19')]();});}};}function handleEntityNotFound(_0xd1d517,_0x23970f){return function(_0x28fd5c){if(!_0x28fd5c){_0xd1d517[_0xf3f9('0x26')](0x194);}return _0x28fd5c;};}function handleError(_0x18e013,_0x509a90){_0x509a90=_0x509a90||0x1f4;return function(_0xbbd451){logger['error'](_0xbbd451[_0xf3f9('0x27')]);if(_0xbbd451[_0xf3f9('0x28')]){delete _0xbbd451['name'];}_0x18e013[_0xf3f9('0x18')](_0x509a90)['send'](_0xbbd451);};}exports[_0xf3f9('0x29')]=function(_0x47008f,_0x38cd99){var _0x3f795b={},_0xa14423={},_0x5851c9={'count':0x0,'rows':[]};var _0x3c1b76=_['map'](db['VoiceQueuesLog']['rawAttributes'],function(_0x347abf){return{'name':_0x347abf['fieldName'],'type':_0x347abf['type'][_0xf3f9('0x2a')]};});_0xa14423[_0xf3f9('0x2b')]=_['map'](_0x3c1b76,_0xf3f9('0x28'));_0xa14423[_0xf3f9('0x2c')]=_[_0xf3f9('0x2d')](_0x47008f[_0xf3f9('0x2c')]);_0xa14423[_0xf3f9('0x2e')]=_[_0xf3f9('0x2f')](_0xa14423[_0xf3f9('0x2b')],_0xa14423[_0xf3f9('0x2c')]);_0x3f795b['attributes']=_[_0xf3f9('0x2f')](_0xa14423[_0xf3f9('0x2b')],qs['fields'](_0x47008f[_0xf3f9('0x2c')][_0xf3f9('0x30')]));_0x3f795b[_0xf3f9('0x31')]=_0x3f795b[_0xf3f9('0x31')][_0xf3f9('0x32')]?_0x3f795b[_0xf3f9('0x31')]:_0xa14423['model'];if(!_0x47008f['query']['hasOwnProperty'](_0xf3f9('0x33'))){_0x3f795b[_0xf3f9('0x1c')]=qs[_0xf3f9('0x1c')](_0x47008f[_0xf3f9('0x2c')][_0xf3f9('0x1c')]);_0x3f795b['offset']=qs['offset'](_0x47008f[_0xf3f9('0x2c')][_0xf3f9('0x34')]);}_0x3f795b[_0xf3f9('0x35')]=qs[_0xf3f9('0x36')](_0x47008f[_0xf3f9('0x2c')][_0xf3f9('0x36')]);_0x3f795b[_0xf3f9('0x37')]=qs[_0xf3f9('0x2e')](_[_0xf3f9('0x38')](_0x47008f[_0xf3f9('0x2c')],_0xa14423[_0xf3f9('0x2e')]),_0x3c1b76);if(_0x47008f[_0xf3f9('0x2c')][_0xf3f9('0x39')]){_0x3f795b[_0xf3f9('0x37')]=_['merge'](_0x3f795b[_0xf3f9('0x37')],{'$or':_[_0xf3f9('0x3a')](_0x3c1b76,function(_0x4cfbdb){if(_0x4cfbdb[_0xf3f9('0x3b')]!=='VIRTUAL'){var _0xd70fc0={};_0xd70fc0[_0x4cfbdb['name']]={'$like':'%'+_0x47008f[_0xf3f9('0x2c')]['filter']+'%'};return _0xd70fc0;}})});}_0x3f795b=_[_0xf3f9('0x3c')]({},_0x3f795b,_0x47008f['options']);var _0x3f568a={'where':_0x3f795b[_0xf3f9('0x37')]};return db[_0xf3f9('0x3d')][_0xf3f9('0x1d')](_0x3f568a)[_0xf3f9('0x25')](function(_0x400cd1){_0x5851c9[_0xf3f9('0x1d')]=_0x400cd1;if(_0x47008f[_0xf3f9('0x2c')][_0xf3f9('0x3e')]){_0x3f795b[_0xf3f9('0x3f')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x3f795b);})['then'](function(_0x3de225){_0x5851c9['rows']=_0x3de225;return _0x5851c9;})[_0xf3f9('0x25')](respondWithFilteredResult(_0x38cd99,_0x3f795b))[_0xf3f9('0x40')](handleError(_0x38cd99,null));};exports[_0xf3f9('0x41')]=function(_0x39cf61,_0x50feab){var _0x36f838={'raw':!![],'where':{'id':_0x39cf61[_0xf3f9('0x42')]['id']}},_0x437b40={};_0x437b40[_0xf3f9('0x2b')]=_[_0xf3f9('0x2d')](db[_0xf3f9('0x3d')][_0xf3f9('0x43')]);_0x437b40[_0xf3f9('0x2c')]=_[_0xf3f9('0x2d')](_0x39cf61[_0xf3f9('0x2c')]);_0x437b40['filters']=_[_0xf3f9('0x2f')](_0x437b40[_0xf3f9('0x2b')],_0x437b40[_0xf3f9('0x2c')]);_0x36f838[_0xf3f9('0x31')]=_['intersection'](_0x437b40[_0xf3f9('0x2b')],qs['fields'](_0x39cf61[_0xf3f9('0x2c')][_0xf3f9('0x30')]));_0x36f838['attributes']=_0x36f838['attributes'][_0xf3f9('0x32')]?_0x36f838['attributes']:_0x437b40[_0xf3f9('0x2b')];if(_0x39cf61[_0xf3f9('0x2c')][_0xf3f9('0x3e')]){_0x36f838[_0xf3f9('0x3f')]=[{'all':!![]}];}_0x36f838=_['merge']({},_0x36f838,_0x39cf61[_0xf3f9('0x44')]);return db[_0xf3f9('0x3d')][_0xf3f9('0x45')](_0x36f838)['then'](handleEntityNotFound(_0x50feab,null))[_0xf3f9('0x25')](respondWithResult(_0x50feab,null))[_0xf3f9('0x40')](handleError(_0x50feab,null));};exports[_0xf3f9('0x46')]=function(_0x744271,_0x3b5bf4){return db[_0xf3f9('0x3d')][_0xf3f9('0x46')](_0x744271[_0xf3f9('0x47')],{})[_0xf3f9('0x25')](respondWithResult(_0x3b5bf4,0xc9))[_0xf3f9('0x40')](handleError(_0x3b5bf4,null));};exports[_0xf3f9('0x23')]=function(_0x1ec78c,_0x15fa93){if(_0x1ec78c[_0xf3f9('0x47')]['id']){delete _0x1ec78c['body']['id'];}return db[_0xf3f9('0x3d')]['find']({'where':{'id':_0x1ec78c[_0xf3f9('0x42')]['id']}})['then'](handleEntityNotFound(_0x15fa93,null))[_0xf3f9('0x25')](saveUpdates(_0x1ec78c[_0xf3f9('0x47')],null))[_0xf3f9('0x25')](respondWithResult(_0x15fa93,null))[_0xf3f9('0x40')](handleError(_0x15fa93,null));};exports['destroy']=function(_0x27bfaf,_0x4a380e){return db['VoiceQueuesLog'][_0xf3f9('0x45')]({'where':{'id':_0x27bfaf['params']['id']}})[_0xf3f9('0x25')](handleEntityNotFound(_0x4a380e,null))[_0xf3f9('0x25')](removeEntity(_0x4a380e,null))[_0xf3f9('0x40')](handleError(_0x4a380e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 8eebf5d..4daff2d 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 _0x3449=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','voice_queues_log','event','dtm','lodash','util','../../config/logger'];(function(_0x34dc68,_0x12fcab){var _0x48c5c9=function(_0x2cc039){while(--_0x2cc039){_0x34dc68['push'](_0x34dc68['shift']());}};_0x48c5c9(++_0x12fcab);}(_0x3449,0x11d));var _0x9344=function(_0x5e849e,_0x25c9dc){_0x5e849e=_0x5e849e-0x0;var _0x2cd4e7=_0x3449[_0x5e849e];return _0x2cd4e7;};'use strict';var _=require(_0x9344('0x0'));var util=require(_0x9344('0x1'));var logger=require(_0x9344('0x2'))('api');var moment=require(_0x9344('0x3'));var BPromise=require(_0x9344('0x4'));var rp=require(_0x9344('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9344('0x6'));var config=require(_0x9344('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x9344('0x8')]=function(_0x285f1c,_0x949a6f){return _0x285f1c['define']('VoiceQueuesLog',attributes,{'tableName':_0x9344('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x9344('0xa'),_0x9344('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd239=['event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log'];(function(_0x5e2553,_0x3cdf8){var _0x33a113=function(_0x159acb){while(--_0x159acb){_0x5e2553['push'](_0x5e2553['shift']());}};_0x33a113(++_0x3cdf8);}(_0xd239,0x92));var _0x9d23=function(_0xf7379b,_0x44ec77){_0xf7379b=_0xf7379b-0x0;var _0x96a568=_0xd239[_0xf7379b];return _0x96a568;};'use strict';var _=require(_0x9d23('0x0'));var util=require(_0x9d23('0x1'));var logger=require(_0x9d23('0x2'))(_0x9d23('0x3'));var moment=require(_0x9d23('0x4'));var BPromise=require(_0x9d23('0x5'));var rp=require(_0x9d23('0x6'));var fs=require('fs');var path=require(_0x9d23('0x7'));var rimraf=require(_0x9d23('0x8'));var config=require(_0x9d23('0x9'));var attributes=require(_0x9d23('0xa'));module[_0x9d23('0xb')]=function(_0x204f94,_0x595e14){return _0x204f94[_0x9d23('0xc')]('VoiceQueuesLog',attributes,{'tableName':_0x9d23('0xd'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x9d23('0xe'),_0x9d23('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 4268a21..d108e09 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 _0x3ae9=['then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x4647e1,_0x35070c){var _0x7163c4=function(_0x287383){while(--_0x287383){_0x4647e1['push'](_0x4647e1['shift']());}};_0x7163c4(++_0x35070c);}(_0x3ae9,0xdb));var _0x93ae=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3ae9[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x93ae('0x0'));var BPromise=require(_0x93ae('0x1'));var rs=require(_0x93ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93ae('0x3'))['db'];var utils=require(_0x93ae('0x4'));var logger=require(_0x93ae('0x5'))(_0x93ae('0x6'));var config=require('../../config/environment');var jayson=require(_0x93ae('0x7'));var client=jayson['client'][_0x93ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32564c,_0x2a0972,_0x36e141){return new BPromise(function(_0x22761c,_0x354bf9){return client['request'](_0x32564c,_0x36e141)[_0x93ae('0x9')](function(_0x4ac4b0){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x2a0972,_0x93ae('0xa'));logger[_0x93ae('0xb')](_0x93ae('0xc'),_0x2a0972,_0x93ae('0xa'),JSON[_0x93ae('0xd')](_0x4ac4b0));if(_0x4ac4b0[_0x93ae('0xe')]){if(_0x4ac4b0['error']['code']===0x1f4){logger[_0x93ae('0xe')](_0x93ae('0xf'),_0x2a0972,_0x4ac4b0['error']['message']);return _0x354bf9(_0x4ac4b0[_0x93ae('0xe')]['message']);}logger[_0x93ae('0xe')](_0x93ae('0xf'),_0x2a0972,_0x4ac4b0['error'][_0x93ae('0x10')]);return _0x22761c(_0x4ac4b0[_0x93ae('0xe')][_0x93ae('0x10')]);}else{logger[_0x93ae('0x11')](_0x93ae('0xf'),_0x2a0972,_0x93ae('0xa'));_0x22761c(_0x4ac4b0['result'][_0x93ae('0x10')]);}})[_0x93ae('0x12')](function(_0x129e44){logger['error'](_0x93ae('0xf'),_0x2a0972,_0x129e44);_0x354bf9(_0x129e44);});});} \ No newline at end of file +var _0x6995=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x6995,0xfd));var _0x5699=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x6995[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x5699('0x0'));var util=require(_0x5699('0x1'));var moment=require(_0x5699('0x2'));var BPromise=require(_0x5699('0x3'));var rs=require(_0x5699('0x4'));var fs=require('fs');var Redis=require(_0x5699('0x5'));var db=require(_0x5699('0x6'))['db'];var utils=require(_0x5699('0x7'));var logger=require('../../config/logger')(_0x5699('0x8'));var config=require(_0x5699('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5699('0xa')][_0x5699('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe65c6b,_0xeb90b3,_0x28ee3c){return new BPromise(function(_0x5e8143,_0x571fe8){return client[_0x5699('0xc')](_0xe65c6b,_0x28ee3c)[_0x5699('0xd')](function(_0x1e257b){logger['info'](_0x5699('0xe'),_0xeb90b3,_0x5699('0xf'));logger['debug'](_0x5699('0x10'),_0xeb90b3,_0x5699('0xf'),JSON[_0x5699('0x11')](_0x1e257b));if(_0x1e257b[_0x5699('0x12')]){if(_0x1e257b['error'][_0x5699('0x13')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0xeb90b3,_0x1e257b[_0x5699('0x12')][_0x5699('0x14')]);return _0x571fe8(_0x1e257b[_0x5699('0x12')][_0x5699('0x14')]);}logger[_0x5699('0x12')](_0x5699('0xe'),_0xeb90b3,_0x1e257b[_0x5699('0x12')]['message']);return _0x5e8143(_0x1e257b[_0x5699('0x12')][_0x5699('0x14')]);}else{logger[_0x5699('0x15')](_0x5699('0xe'),_0xeb90b3,_0x5699('0xf'));_0x5e8143(_0x1e257b[_0x5699('0x16')][_0x5699('0x14')]);}})['catch'](function(_0x14d1f6){logger[_0x5699('0x12')](_0x5699('0xe'),_0xeb90b3,_0x14d1f6);_0x571fe8(_0x14d1f6);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 7f14c83..5307be8 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 _0xad74=['put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe'];(function(_0x4c9ef9,_0x5656c3){var _0x169055=function(_0x2c4a74){while(--_0x2c4a74){_0x4c9ef9['push'](_0x4c9ef9['shift']());}};_0x169055(++_0x5656c3);}(_0xad74,0x10b));var _0x4ad7=function(_0xd3f68f,_0x314282){_0xd3f68f=_0xd3f68f-0x0;var _0x14e2dd=_0xad74[_0xd3f68f];return _0x14e2dd;};'use strict';var multer=require(_0x4ad7('0x0'));var util=require(_0x4ad7('0x1'));var path=require(_0x4ad7('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ad7('0x3'));var router=express[_0x4ad7('0x4')]();var fs_extra=require(_0x4ad7('0x5'));var auth=require(_0x4ad7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4ad7('0x7'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x4ad7('0x8')](),controller[_0x4ad7('0x9')]);router[_0x4ad7('0xa')](_0x4ad7('0xb'),auth['isAuthenticated'](),controller[_0x4ad7('0xc')]);router['get'](_0x4ad7('0xd'),auth[_0x4ad7('0x8')](),controller[_0x4ad7('0xe')]);router['get'](_0x4ad7('0xf'),auth[_0x4ad7('0x8')](),controller['download']);router[_0x4ad7('0xa')](_0x4ad7('0x10'),controller[_0x4ad7('0x11')]);router[_0x4ad7('0xa')](_0x4ad7('0x12'),auth[_0x4ad7('0x8')](),controller['downloadTranscribe']);router[_0x4ad7('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ad7('0x13')](_0x4ad7('0x12'),auth[_0x4ad7('0x8')](),controller[_0x4ad7('0x14')]);router[_0x4ad7('0x15')](_0x4ad7('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4ad7('0xd'),auth['isAuthenticated'](),controller[_0x4ad7('0x16')]);module[_0x4ad7('0x17')]=router; \ No newline at end of file +var _0x61f4=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update'];(function(_0x1ab45e,_0x521b8b){var _0x364d0b=function(_0x5c4eb5){while(--_0x5c4eb5){_0x1ab45e['push'](_0x1ab45e['shift']());}};_0x364d0b(++_0x521b8b);}(_0x61f4,0x142));var _0x461f=function(_0x35a730,_0x5950fd){_0x35a730=_0x35a730-0x0;var _0x2d785e=_0x61f4[_0x35a730];return _0x2d785e;};'use strict';var multer=require(_0x461f('0x0'));var util=require(_0x461f('0x1'));var path=require(_0x461f('0x2'));var timeout=require(_0x461f('0x3'));var express=require(_0x461f('0x4'));var router=express[_0x461f('0x5')]();var fs_extra=require(_0x461f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x461f('0x7'));var config=require(_0x461f('0x8'));var controller=require(_0x461f('0x9'));router[_0x461f('0xa')]('/',auth[_0x461f('0xb')](),controller[_0x461f('0xc')]);router[_0x461f('0xa')](_0x461f('0xd'),auth[_0x461f('0xb')](),controller['describe']);router['get'](_0x461f('0xe'),auth[_0x461f('0xb')](),controller[_0x461f('0xf')]);router['get']('/:id/download',auth[_0x461f('0xb')](),controller[_0x461f('0x10')]);router['get'](_0x461f('0x11'),controller[_0x461f('0x12')]);router[_0x461f('0xa')](_0x461f('0x13'),auth['isAuthenticated'](),controller[_0x461f('0x14')]);router[_0x461f('0x15')]('/',auth[_0x461f('0xb')](),controller[_0x461f('0x16')]);router[_0x461f('0x15')](_0x461f('0x13'),auth[_0x461f('0xb')](),controller[_0x461f('0x17')]);router[_0x461f('0x18')](_0x461f('0xe'),auth[_0x461f('0xb')](),controller[_0x461f('0x19')]);router[_0x461f('0x1a')](_0x461f('0xe'),auth[_0x461f('0xb')](),controller[_0x461f('0x1b')]);module[_0x461f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 47bbfdb..d6e9a2b 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(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 2e5b332..87efbc4 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 _0x57b3=['TranscriptionJobStatus','runTranscribe','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','model','differenceBy','format','query','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','type','options','includeAll','include','findAll','catch','show','params','keys','length','create','body','describe','download','uniqueid','find','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','$and','push','filename','unlink','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','listBuckets','createBucket','upload','[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','transcribeName','TranscriptionJob','transcribeStatus'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x57b3,0x1cb));var _0x357b=function(_0x3a1f12,_0x4532b9){_0x3a1f12=_0x3a1f12-0x0;var _0x1c0e58=_0x57b3[_0x3a1f12];return _0x1c0e58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x357b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x357b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x357b('0x2'));var Mustache=require(_0x357b('0x3'));var util=require(_0x357b('0x4'));var path=require('path');var sox=require(_0x357b('0x5'));var csv=require(_0x357b('0x6'));var ejs=require(_0x357b('0x7'));var fs=require('fs');var fs_extra=require(_0x357b('0x8'));var _=require(_0x357b('0x9'));var squel=require(_0x357b('0xa'));var crypto=require(_0x357b('0xb'));var jsforce=require(_0x357b('0xc'));var deskjs=require(_0x357b('0xd'));var toCsv=require(_0x357b('0x6'));var querystring=require(_0x357b('0xe'));var Papa=require(_0x357b('0xf'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x357b('0x10'));var authService=require(_0x357b('0x11'));var qs=require(_0x357b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x357b('0x13'));var logger=require('../../config/logger')(_0x357b('0x14'));var utils=require(_0x357b('0x15'));var config=require(_0x357b('0x16'));var licenseUtil=require(_0x357b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1475ff,_0x2af06d){_0x2af06d=_0x2af06d||0xcc;return function(_0x591389){if(_0x591389){return _0x1475ff[_0x357b('0x18')](_0x2af06d);}return _0x1475ff[_0x357b('0x19')](_0x2af06d)[_0x357b('0x1a')]();};}function respondWithResult(_0x1e235f,_0xf4d8e9){_0xf4d8e9=_0xf4d8e9||0xc8;return function(_0x4c2819){if(_0x4c2819){return _0x1e235f[_0x357b('0x19')](_0xf4d8e9)[_0x357b('0x1b')](_0x4c2819);}};}function respondWithFilteredResult(_0x26669c,_0xff7f97){return function(_0x2bbd76){if(_0x2bbd76){var _0x1ea58a=typeof _0xff7f97['offset']===_0x357b('0x1c')&&typeof _0xff7f97['limit']===_0x357b('0x1c');var _0x2d7239=_0x2bbd76['count'];var _0x484b06=_0x1ea58a?0x0:_0xff7f97['offset'];var _0x376a23=_0x1ea58a?_0x2bbd76[_0x357b('0x1d')]:_0xff7f97[_0x357b('0x1e')]+_0xff7f97[_0x357b('0x1f')];var _0x5577d1;if(_0x376a23>=_0x2d7239){_0x376a23=_0x2d7239;_0x5577d1=0xc8;}else{_0x5577d1=0xce;}_0x26669c['status'](_0x5577d1);return _0x26669c[_0x357b('0x20')](_0x357b('0x21'),_0x484b06+'-'+_0x376a23+'/'+_0x2d7239)[_0x357b('0x1b')](_0x2bbd76);}return null;};}function patchUpdates(_0x1efc81){return function(_0x59551c){try{jsonpatch['apply'](_0x59551c,_0x1efc81,!![]);}catch(_0x258693){return BPromise[_0x357b('0x22')](_0x258693);}return _0x59551c['save']();};}function saveUpdates(_0x4ff4c5,_0x267cb8){return function(_0x966f47){if(_0x966f47){return _0x966f47[_0x357b('0x23')](_0x4ff4c5)[_0x357b('0x24')](function(_0x2b4a9b){return _0x2b4a9b;});}return null;};}function removeEntity(_0x2a0d04,_0x8008ad){return function(_0x5c0b9d){if(_0x5c0b9d){return _0x5c0b9d[_0x357b('0x25')]()[_0x357b('0x24')](function(){_0x2a0d04[_0x357b('0x19')](0xcc)[_0x357b('0x1a')]();});}};}function handleEntityNotFound(_0x5dd9a4,_0x5ed359){return function(_0x1dee9d){if(!_0x1dee9d){_0x5dd9a4[_0x357b('0x18')](0x194);}return _0x1dee9d;};}function handleError(_0x44a039,_0x24806d){_0x24806d=_0x24806d||0x1f4;return function(_0x5b0983){logger['error'](_0x5b0983[_0x357b('0x26')]);if(_0x5b0983[_0x357b('0x27')]){delete _0x5b0983[_0x357b('0x27')];}_0x44a039[_0x357b('0x19')](_0x24806d)[_0x357b('0x28')](_0x5b0983);};}exports[_0x357b('0x29')]=function(_0x10f7e4,_0x1c4ec6){var _0x2aded4={},_0x1f6c68={},_0x152c4c={'count':0x0,'rows':[]};var _0x3671c3=_[_0x357b('0x2a')](db[_0x357b('0x2b')][_0x357b('0x2c')],function(_0x5567f7){return{'name':_0x5567f7['fieldName'],'type':_0x5567f7['type']['key']};});_0x1f6c68[_0x357b('0x2d')]=_[_0x357b('0x2e')](_[_0x357b('0x2a')](_0x3671c3,'name'),[_0x357b('0x2f')]);_0x1f6c68['query']=_['keys'](_0x10f7e4[_0x357b('0x30')]);_0x1f6c68['filters']=_['intersection'](_0x1f6c68[_0x357b('0x2d')],_0x1f6c68[_0x357b('0x30')]);_0x2aded4[_0x357b('0x31')]=_[_0x357b('0x32')](_0x1f6c68[_0x357b('0x2d')],qs[_0x357b('0x33')](_0x10f7e4[_0x357b('0x30')][_0x357b('0x33')]));_0x2aded4[_0x357b('0x31')]=_0x2aded4[_0x357b('0x31')]['length']?_0x2aded4[_0x357b('0x31')]:_0x1f6c68[_0x357b('0x2d')];if(!_0x10f7e4['query'][_0x357b('0x34')]('nolimit')){_0x2aded4[_0x357b('0x1f')]=qs[_0x357b('0x1f')](_0x10f7e4[_0x357b('0x30')]['limit']);_0x2aded4[_0x357b('0x1e')]=qs[_0x357b('0x1e')](_0x10f7e4[_0x357b('0x30')][_0x357b('0x1e')]);}_0x2aded4['order']=qs[_0x357b('0x35')](_0x10f7e4['query']['sort']);_0x2aded4[_0x357b('0x36')]=qs['filters'](_[_0x357b('0x37')](_0x10f7e4[_0x357b('0x30')],_0x1f6c68[_0x357b('0x38')]),_0x3671c3);if(_0x10f7e4[_0x357b('0x30')][_0x357b('0x39')]){_0x2aded4[_0x357b('0x36')]=_[_0x357b('0x3a')](_0x2aded4[_0x357b('0x36')],{'$or':_[_0x357b('0x2a')](_0x3671c3,function(_0x121e31){if(_0x121e31[_0x357b('0x3b')]!=='VIRTUAL'){var _0x48042d={};_0x48042d[_0x121e31['name']]={'$like':'%'+_0x10f7e4[_0x357b('0x30')][_0x357b('0x39')]+'%'};return _0x48042d;}})});}_0x2aded4=_['merge']({},_0x2aded4,_0x10f7e4[_0x357b('0x3c')]);var _0x87767e={'where':_0x2aded4[_0x357b('0x36')]};return db['VoiceRecording'][_0x357b('0x1d')](_0x87767e)[_0x357b('0x24')](function(_0x14f2af){_0x152c4c[_0x357b('0x1d')]=_0x14f2af;if(_0x10f7e4['query'][_0x357b('0x3d')]){_0x2aded4[_0x357b('0x3e')]=[{'all':!![]}];}return db[_0x357b('0x2b')][_0x357b('0x3f')](_0x2aded4);})[_0x357b('0x24')](function(_0x2541a8){_0x152c4c['rows']=_0x2541a8;return _0x152c4c;})[_0x357b('0x24')](respondWithFilteredResult(_0x1c4ec6,_0x2aded4))[_0x357b('0x40')](handleError(_0x1c4ec6,null));};exports[_0x357b('0x41')]=function(_0x370f29,_0x307024){var _0x2a420c={'raw':![],'where':{'id':_0x370f29[_0x357b('0x42')]['id']}},_0x1bf947={};_0x1bf947[_0x357b('0x2d')]=_[_0x357b('0x43')](db[_0x357b('0x2b')][_0x357b('0x2c')]);_0x1bf947[_0x357b('0x30')]=_[_0x357b('0x43')](_0x370f29[_0x357b('0x30')]);_0x1bf947[_0x357b('0x38')]=_['intersection'](_0x1bf947[_0x357b('0x2d')],_0x1bf947[_0x357b('0x30')]);_0x2a420c['attributes']=_[_0x357b('0x32')](_0x1bf947[_0x357b('0x2d')],qs[_0x357b('0x33')](_0x370f29[_0x357b('0x30')][_0x357b('0x33')]));_0x2a420c[_0x357b('0x31')]=_0x2a420c['attributes'][_0x357b('0x44')]?_0x2a420c[_0x357b('0x31')]:_0x1bf947[_0x357b('0x2d')];if(_0x370f29[_0x357b('0x30')][_0x357b('0x3d')]){_0x2a420c[_0x357b('0x3e')]=[{'all':!![]}];}_0x2a420c=_[_0x357b('0x3a')]({},_0x2a420c,_0x370f29[_0x357b('0x3c')]);return db[_0x357b('0x2b')]['find'](_0x2a420c)[_0x357b('0x24')](handleEntityNotFound(_0x307024,null))[_0x357b('0x24')](respondWithResult(_0x307024,null))['catch'](handleError(_0x307024,null));};exports[_0x357b('0x45')]=function(_0xac13b0,_0x742b57){return db[_0x357b('0x2b')][_0x357b('0x45')](_0xac13b0[_0x357b('0x46')],{})[_0x357b('0x24')](respondWithResult(_0x742b57,0xc9))[_0x357b('0x40')](handleError(_0x742b57,null));};exports[_0x357b('0x23')]=function(_0x1bcc4a,_0x5a4fdc){if(_0x1bcc4a['body']['id']){delete _0x1bcc4a[_0x357b('0x46')]['id'];}return db[_0x357b('0x2b')]['find']({'where':{'id':_0x1bcc4a[_0x357b('0x42')]['id']}})[_0x357b('0x24')](handleEntityNotFound(_0x5a4fdc,null))[_0x357b('0x24')](saveUpdates(_0x1bcc4a[_0x357b('0x46')],null))[_0x357b('0x24')](respondWithResult(_0x5a4fdc,null))['catch'](handleError(_0x5a4fdc,null));};exports[_0x357b('0x47')]=function(_0x4aca4f,_0x22f0a6){return db[_0x357b('0x2b')]['describe']()['then'](respondWithResult(_0x22f0a6,null))[_0x357b('0x40')](handleError(_0x22f0a6,null));};exports[_0x357b('0x48')]=function(_0x130861,_0x5db7d2,_0x1080a4){var _0x406dee=require('../../components/encryptor');var _0x376ace=![];var _0xfbda8c={};if(_0x130861['query'][_0x357b('0x3b')]&&_0x130861['query']['type']===_0x357b('0x49')){_0xfbda8c[_0x357b('0x49')]=_0x130861[_0x357b('0x42')]['id'];}else{_0xfbda8c['id']=_0x130861[_0x357b('0x42')]['id'];}return db[_0x357b('0x2b')][_0x357b('0x4a')]({'where':_0xfbda8c,'attributes':['id',_0x357b('0x4b')],'raw':!![]})[_0x357b('0x24')](handleEntityNotFound(_0x5db7d2,null))[_0x357b('0x24')](function(_0x1e5514){if(_0x1e5514){var _0x20081e=_0x1e5514[_0x357b('0x4b')];var _0x1a02f9=util['format']('%s.cypher',_0x20081e);if(fs[_0x357b('0x4c')](_0x1a02f9)){_0x376ace=!![];return _0x406dee[_0x357b('0x4d')](_0x1a02f9,_0x20081e,config[_0x357b('0x4e')][_0x357b('0x4f')])[_0x357b('0x24')](function(){return _0x1e5514;});}return _0x1e5514;}})[_0x357b('0x24')](function(_0x2ebe9a){if(_0x2ebe9a){var _0x5134e9=_0x2ebe9a['value'];if(!fs['existsSync'](_0x5134e9)){throw new db[(_0x357b('0x50'))][(_0x357b('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x2ebe9a['filename']){return _0x5db7d2['download'](_0x5134e9,_0x2ebe9a['filename']+path[_0x357b('0x52')](_0x5134e9),function(){if(_0x376ace){fs['unlink'](_0x5134e9);}});}else{return _0x5db7d2['download'](_0x5134e9,function(_0x229f68){if(_0x376ace){fs['unlink'](_0x5134e9);}});}}})[_0x357b('0x40')](function(_0x267e2e){if(_0x267e2e[_0x357b('0x53')]===_0x357b('0x54')){_0x5db7d2[_0x357b('0x19')](0x194)[_0x357b('0x28')](_0x357b('0x55'));}else{return handleError(_0x5db7d2,null);}});};exports[_0x357b('0x56')]=function(_0x10f84a,_0x19e2a6,_0x45dd0c){var _0x2203a4=require('../../components/encryptor');var _0x9dabea=![];var _0x3129c7={'$and':[db[_0x357b('0x57')][_0x357b('0x36')](db['sequelize']['fn']('MD5',db[_0x357b('0x57')]['col'](_0x357b('0x49'))),_0x10f84a[_0x357b('0x30')]['token'])]};if(_0x10f84a[_0x357b('0x30')][_0x357b('0x3b')]&&_0x10f84a[_0x357b('0x30')][_0x357b('0x3b')]===_0x357b('0x49')){_0x3129c7[_0x357b('0x58')][_0x357b('0x59')]({'uniqueid':_0x10f84a[_0x357b('0x42')]['id']});}else{_0x3129c7['$and'][_0x357b('0x59')]({'id':_0x10f84a[_0x357b('0x42')]['id']});}return db[_0x357b('0x2b')][_0x357b('0x4a')]({'where':_0x3129c7,'attributes':['id',_0x357b('0x4b')],'raw':!![]})[_0x357b('0x24')](handleEntityNotFound(_0x19e2a6,null))[_0x357b('0x24')](function(_0x43775b){if(_0x43775b){var _0x3517bc=util[_0x357b('0x2f')]('%s.cypher',_0x43775b[_0x357b('0x4b')]);if(fs[_0x357b('0x4c')](_0x3517bc)){_0x9dabea=!![];return _0x2203a4[_0x357b('0x4d')](_0x3517bc,_0x43775b[_0x357b('0x4b')],config[_0x357b('0x4e')][_0x357b('0x4f')])[_0x357b('0x24')](function(){return _0x43775b;});}return _0x43775b;}})['then'](function(_0xeb71e2){if(_0xeb71e2){if(!fs[_0x357b('0x4c')](_0xeb71e2[_0x357b('0x4b')])){throw new db[(_0x357b('0x50'))]['ValidationError'](_0x357b('0x54'));}if(_0xeb71e2[_0x357b('0x5a')]){return _0x19e2a6[_0x357b('0x48')](_0xeb71e2[_0x357b('0x4b')],_0xeb71e2[_0x357b('0x5a')]+path[_0x357b('0x52')](_0xeb71e2[_0x357b('0x4b')]),function(){if(_0x9dabea){fs[_0x357b('0x5b')](_0xeb71e2[_0x357b('0x4b')]);}});}else{return _0x19e2a6[_0x357b('0x48')](_0xeb71e2[_0x357b('0x4b')],function(_0x5156e7){if(_0x9dabea){fs[_0x357b('0x5b')](_0xeb71e2[_0x357b('0x4b')]);}});}}})[_0x357b('0x40')](handleError(_0x19e2a6,null));};exports['destroy']=function(_0x3b016b,_0x3b44c3){return db[_0x357b('0x2b')][_0x357b('0x4a')]({'where':{'id':_0x3b016b[_0x357b('0x42')]['id']}})[_0x357b('0x24')](function(_0x34ebb3){if(_['isNil'](_0x34ebb3)){throw new ReferenceError(_0x357b('0x5c'));}return _0x34ebb3;})[_0x357b('0x24')](function(_0x895ccb){var _0x2a3255=_0x895ccb[_0x357b('0x4b')];logger[_0x357b('0x5d')]('cancellazione\x20fisica\x20documento\x20%s',_0x2a3255);if(!_['isNil'](_0x895ccb[_0x357b('0x4b')])&&fs['existsSync'](_0x2a3255)){logger[_0x357b('0x5d')](_0x357b('0x5e')+_0x2a3255+_0x357b('0x5f'));fs[_0x357b('0x60')](_0x2a3255);}_0x2a3255=_0x2a3255+'.cypher';if(!_[_0x357b('0x61')](_0x895ccb['value'])&&fs['existsSync'](_0x2a3255)){logger[_0x357b('0x5d')]('File:\x20\x22'+_0x2a3255+_0x357b('0x5f'));fs['unlinkSync'](_0x2a3255);}return _0x895ccb;})['then'](function(_0x51a28e){if(!_0x51a28e)throw new InternalError();return _0x51a28e[_0x357b('0x25')]();})['then'](function(){_0x3b44c3[_0x357b('0x19')](0xcc)[_0x357b('0x1a')]();})[_0x357b('0x40')](handleError(_0x3b44c3,null));};function getBucketslist(_0x5a29eb,_0x33ade9,_0x29280b){return new Promise(function(_0x1ef990,_0x127af9){var _0x22df8b=new AWS['S3']({'accessKeyId':_0x33ade9,'secretAccessKey':_0x5a29eb,'region':_0x29280b});_0x22df8b[_0x357b('0x62')]({},function(_0x4a4eda,_0x212a96){if(_0x4a4eda){return _0x127af9(_0x4a4eda);}else{return _0x1ef990(_0x212a96);}});});}function createBucket(_0x592ca3,_0x834527,_0x5c4d52,_0x3c3527){return new Promise(function(_0x209e32,_0x23ffed){var _0x128f34=new AWS['S3']({'accessKeyId':_0x834527,'secretAccessKey':_0x592ca3,'region':_0x5c4d52});_0x128f34[_0x357b('0x63')]({'Bucket':_0x3c3527},function(_0x4acf3f,_0x230ef6){if(_0x4acf3f){return _0x23ffed(_0x4acf3f);}else{return _0x209e32(_0x230ef6);}});});}function uploadFile(_0x4450e9,_0x3a30f7,_0x613bc6,_0x27dd51,_0x12ee8a,_0xdaa517){return new Promise(function(_0x31c041,_0x2e4be9){var _0x3939f7=new AWS['S3']({'accessKeyId':_0x3a30f7,'secretAccessKey':_0x4450e9,'region':_0x613bc6});_0x3939f7[_0x357b('0x64')]({'Bucket':_0x27dd51,'Key':_0x12ee8a,'Body':_0xdaa517},function(_0x3d6685,_0x50a4d4){if(_0x3d6685){return _0x2e4be9(_0x3d6685);}else{return _0x31c041(_0x50a4d4);}});});}function startTranscribe(_0x96b100,_0x2e5182,_0x5daeff,_0x117066,_0x25b861,_0x3732a3){return new Promise(function(_0x42005b,_0x2ae850){var _0x22644c=new AWS['TranscribeService']({'accessKeyId':_0x2e5182,'secretAccessKey':_0x96b100,'region':_0x5daeff});_0x22644c['startTranscriptionJob']({'TranscriptionJobName':_0x117066,'LanguageCode':_0x25b861,'Media':{'MediaFileUri':_0x3732a3}},function(_0x57198c,_0x4cf728){if(_0x57198c){return _0x2ae850(_0x57198c);}else{return _0x42005b(_0x4cf728);}});});}function transcribe(_0x3a952c,_0x2cb4b6,_0x48c494,_0x86c252,_0x4e3ae7,_0x49af5c,_0x4a4534){return new Promise(function(_0x4ccd4c,_0xace78b){var _0x4a4b4a={};logger[_0x357b('0x5d')](util[_0x357b('0x2f')](_0x357b('0x65'),_0x3a952c,_0x4e3ae7));return uploadFile(_0x2cb4b6,_0x48c494,_0x86c252,_0x4e3ae7,path[_0x357b('0x66')](_0x49af5c),fs[_0x357b('0x67')](_0x49af5c))[_0x357b('0x24')](function(_0xce8ae3){logger[_0x357b('0x5d')](util[_0x357b('0x2f')](_0x357b('0x68'),_0x3a952c,_0x4e3ae7,_0xce8ae3[_0x357b('0x69')]));_0x4a4b4a[_0x357b('0x6a')]=_0xce8ae3[_0x357b('0x6b')];_0x4a4b4a[_0x357b('0x6c')]=_0xce8ae3[_0x357b('0x69')];logger['info'](util['format'](_0x357b('0x6d'),_0x3a952c));return startTranscribe(_0x2cb4b6,_0x48c494,_0x86c252,uuidv4(),_0x4a4534,_0xce8ae3[_0x357b('0x69')]);})[_0x357b('0x24')](function(_0x475fda){logger[_0x357b('0x5d')](util[_0x357b('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x3a952c,_0x475fda['TranscriptionJob']['TranscriptionJobName']));_0x4a4b4a[_0x357b('0x6e')]=_0x475fda[_0x357b('0x6f')]['TranscriptionJobName'];_0x4a4b4a[_0x357b('0x70')]=_0x475fda['TranscriptionJob'][_0x357b('0x71')];return _0x4ccd4c(_0x4a4b4a);})[_0x357b('0x40')](function(_0x38a3d1){return _0xace78b(_0x38a3d1);});});}exports[_0x357b('0x72')]=function(_0x44db74,_0x90a2fa,_0xebe892){var _0x364a4a;var _0x7d21cd;var _0x1d4194;var _0x147480=require('../../components/encryptor');return db[_0x357b('0x2b')][_0x357b('0x73')]({'where':{'id':_0x44db74[_0x357b('0x42')]['id']}})['then'](function(_0x20b9c2){if(_0x20b9c2){var _0x37ee1f=util['format'](_0x357b('0x74'),_0x20b9c2[_0x357b('0x4b')]);if(fs['existsSync'](_0x37ee1f)){cypher=!![];return _0x147480['decryptFile'](_0x37ee1f,_0x20b9c2[_0x357b('0x4b')],config[_0x357b('0x4e')][_0x357b('0x4f')])[_0x357b('0x24')](function(){return _0x20b9c2;});}return _0x20b9c2;}})[_0x357b('0x24')](function(_0x4fbd27){if(!_0x4fbd27){throw new db[(_0x357b('0x50'))][(_0x357b('0x51'))](_0x357b('0x75'));}_0x7d21cd=_0x4fbd27;return db[_0x357b('0x76')]['findOne']({'where':{'id':0x1}});})[_0x357b('0x24')](handleEntityNotFound(_0x90a2fa,null))[_0x357b('0x24')](function(_0x5298f4){if(_0x5298f4){_0x364a4a=_0x5298f4;if(!_0x364a4a[_0x357b('0x77')]||!_0x364a4a[_0x357b('0x78')]||!_0x364a4a['transcribeRegion']||!_0x364a4a[_0x357b('0x79')]||!_0x364a4a['bucket']){throw new db[(_0x357b('0x50'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x44db74['body'][_0x357b('0x7a')]&&(!_0x364a4a['sentiment']||!_0x364a4a[_0x357b('0x7b')]||!_0x364a4a['sentimentRegion']||!_0x364a4a[_0x357b('0x79')]||!_0x364a4a[_0x357b('0x6a')])){throw new db[(_0x357b('0x50'))][(_0x357b('0x51'))](_0x357b('0x7c'));}return db[_0x357b('0x7d')][_0x357b('0x73')]({'where':{'id':_0x364a4a[_0x357b('0x78')]}});}})[_0x357b('0x24')](function(_0xaa0cc6){if(!_0xaa0cc6){throw new db[(_0x357b('0x50'))][(_0x357b('0x51'))](_0x357b('0x7e'));}if(!_0xaa0cc6[_0x357b('0x7f')]||!_0xaa0cc6['data2']){throw new db['Sequelize']['ValidationError'](_0x357b('0x80'));}_0x1d4194=_0xaa0cc6;return getBucketslist(_0x1d4194[_0x357b('0x7f')],_0x1d4194['data2'],_0x364a4a['transcribeRegion']);})[_0x357b('0x24')](function(_0x43c8d3){if(_0x43c8d3&&_0x43c8d3[_0x357b('0x81')]){var _0x58dfb8=_[_0x357b('0x4a')](_0x43c8d3[_0x357b('0x81')],function(_0x19c6cb){return _0x19c6cb['Name']===_0x364a4a[_0x357b('0x6a')];});if(!_0x58dfb8){logger['info'](util[_0x357b('0x2f')](_0x357b('0x82'),_0x44db74[_0x357b('0x42')]['id'],_0x364a4a['bucket']));return createBucket(_0x1d4194[_0x357b('0x7f')],_0x1d4194[_0x357b('0x83')],_0x364a4a[_0x357b('0x84')],_0x364a4a[_0x357b('0x6a')]);}logger[_0x357b('0x5d')](util['format'](_0x357b('0x85'),_0x44db74[_0x357b('0x42')]['id'],_0x364a4a[_0x357b('0x6a')]));return;}})[_0x357b('0x24')](function(_0x3b82cd){if(_0x7d21cd[_0x357b('0x70')]===_0x357b('0x86')){return transcribe(_0x44db74[_0x357b('0x42')]['id'],_0x1d4194['data1'],_0x1d4194[_0x357b('0x83')],_0x364a4a[_0x357b('0x84')],_0x364a4a[_0x357b('0x6a')],_0x7d21cd['value'],_0x364a4a[_0x357b('0x79')]);}else{logger['info'](util[_0x357b('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x44db74[_0x357b('0x42')]['id']));return{'transcribeStatus':_0x357b('0x87')};}})[_0x357b('0x24')](function(_0x16ce50){if(_0x16ce50){_0x16ce50[_0x357b('0x88')]=_0x44db74[_0x357b('0x46')][_0x357b('0x7a')];return _0x7d21cd[_0x357b('0x89')](_0x16ce50);}})[_0x357b('0x24')](respondWithResult(_0x90a2fa,null))['catch'](handleError(_0x90a2fa,null));};function writeFile(_0x13b6cf,_0x4bc63a){return new Promise(function(_0x378ebb,_0x5e7e05){fs[_0x357b('0x8a')](_0x4bc63a,_0x13b6cf,function(_0x38a61c,_0x5044aa){if(_0x38a61c){return _0x5e7e05(_0x38a61c);}else{return _0x378ebb(_0x5044aa);}});});}exports['downloadTranscribe']=function(_0x1889da,_0x39603c,_0x1b22f3){return db['VoiceRecording'][_0x357b('0x73')]({'where':{'id':_0x1889da['params']['id']}})['then'](handleEntityNotFound(_0x39603c))[_0x357b('0x24')](function(_0x49e696){if(_0x49e696&&_0x49e696[_0x357b('0x8b')]){var _0x2782ae=_0x49e696['fileText'];var _0x313ccc=config[_0x357b('0x8c')]+_0x357b('0x8d')+_0x49e696['id']+_0x357b('0x8e');if(fs[_0x357b('0x4c')](_0x313ccc)){return _0x313ccc;}return writeFile(_0x2782ae,_0x313ccc)['then'](function(){return _0x313ccc;});}else{throw new db[(_0x357b('0x50'))][(_0x357b('0x51'))]('Transcript\x20not\x20available');}})[_0x357b('0x24')](function(_0x40e25d){return _0x39603c['download'](_0x40e25d);})[_0x357b('0x40')](handleError(_0x39603c));}; \ No newline at end of file +var _0xff17=['[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]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','ValidationError','Voice\x20Recording\x20not\x20found','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','save','update','destroy','then','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','options','find','create','body','describe','download','uniqueid','params','value','%s.cypher','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','VoiceRecording\x20not\x20found','Not\x20found','../../components/encryptor','sequelize','MD5','col','token','$and','push','existsSync','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','createBucket','startTranscriptionJob','format'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0xff17,0xbe));var _0x7ff1=function(_0x242562,_0x395319){_0x242562=_0x242562-0x0;var _0x183247=_0xff17[_0x242562];return _0x183247;};'use strict';var emlformat=require(_0x7ff1('0x0'));var rimraf=require(_0x7ff1('0x1'));var zipdir=require(_0x7ff1('0x2'));var jsonpatch=require(_0x7ff1('0x3'));var rp=require(_0x7ff1('0x4'));var moment=require('moment');var BPromise=require(_0x7ff1('0x5'));var Mustache=require(_0x7ff1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7ff1('0x7'));var csv=require(_0x7ff1('0x8'));var ejs=require(_0x7ff1('0x9'));var fs=require('fs');var fs_extra=require(_0x7ff1('0xa'));var _=require(_0x7ff1('0xb'));var squel=require(_0x7ff1('0xc'));var crypto=require(_0x7ff1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7ff1('0xe'));var toCsv=require(_0x7ff1('0x8'));var querystring=require(_0x7ff1('0xf'));var Papa=require(_0x7ff1('0x10'));var AWS=require(_0x7ff1('0x11'));var uuidv4=require(_0x7ff1('0x12'));var Redis=require('ioredis');var authService=require(_0x7ff1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7ff1('0x14'));var hardwareService=require(_0x7ff1('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7ff1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7ff1('0x17'))['db'];function respondWithStatusCode(_0x36ff6a,_0x439edf){_0x439edf=_0x439edf||0xcc;return function(_0x1559c7){if(_0x1559c7){return _0x36ff6a[_0x7ff1('0x18')](_0x439edf);}return _0x36ff6a[_0x7ff1('0x19')](_0x439edf)[_0x7ff1('0x1a')]();};}function respondWithResult(_0x274530,_0x5c0026){_0x5c0026=_0x5c0026||0xc8;return function(_0x43a361){if(_0x43a361){return _0x274530[_0x7ff1('0x19')](_0x5c0026)['json'](_0x43a361);}};}function respondWithFilteredResult(_0xf93091,_0x158e97){return function(_0x591d87){if(_0x591d87){var _0xf9ab0a=typeof _0x158e97['offset']===_0x7ff1('0x1b')&&typeof _0x158e97[_0x7ff1('0x1c')]===_0x7ff1('0x1b');var _0x356b9d=_0x591d87[_0x7ff1('0x1d')];var _0x3d046e=_0xf9ab0a?0x0:_0x158e97['offset'];var _0x14d3fb=_0xf9ab0a?_0x591d87[_0x7ff1('0x1d')]:_0x158e97[_0x7ff1('0x1e')]+_0x158e97[_0x7ff1('0x1c')];var _0x332cf3;if(_0x14d3fb>=_0x356b9d){_0x14d3fb=_0x356b9d;_0x332cf3=0xc8;}else{_0x332cf3=0xce;}_0xf93091[_0x7ff1('0x19')](_0x332cf3);return _0xf93091['set']('Content-Range',_0x3d046e+'-'+_0x14d3fb+'/'+_0x356b9d)[_0x7ff1('0x1f')](_0x591d87);}return null;};}function patchUpdates(_0x48c520){return function(_0x1ee81c){try{jsonpatch['apply'](_0x1ee81c,_0x48c520,!![]);}catch(_0x2419fe){return BPromise['reject'](_0x2419fe);}return _0x1ee81c[_0x7ff1('0x20')]();};}function saveUpdates(_0x5eacb2,_0x2fc7d8){return function(_0x33f66f){if(_0x33f66f){return _0x33f66f[_0x7ff1('0x21')](_0x5eacb2)['then'](function(_0x525d5e){return _0x525d5e;});}return null;};}function removeEntity(_0x3f6684,_0x4620d7){return function(_0x39da69){if(_0x39da69){return _0x39da69[_0x7ff1('0x22')]()[_0x7ff1('0x23')](function(){_0x3f6684[_0x7ff1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11fbd0,_0x53634d){return function(_0x5cb41d){if(!_0x5cb41d){_0x11fbd0[_0x7ff1('0x18')](0x194);}return _0x5cb41d;};}function handleError(_0x5b8bc5,_0x11fc72){_0x11fc72=_0x11fc72||0x1f4;return function(_0x41dea7){logger[_0x7ff1('0x24')](_0x41dea7[_0x7ff1('0x25')]);if(_0x41dea7['name']){delete _0x41dea7[_0x7ff1('0x26')];}_0x5b8bc5[_0x7ff1('0x19')](_0x11fc72)[_0x7ff1('0x27')](_0x41dea7);};}exports[_0x7ff1('0x28')]=function(_0x574637,_0xf75b37){var _0x1fbbed={},_0x40b5e9={},_0x20e794={'count':0x0,'rows':[]};var _0x710046=_[_0x7ff1('0x29')](db[_0x7ff1('0x2a')][_0x7ff1('0x2b')],function(_0xd36d96){return{'name':_0xd36d96[_0x7ff1('0x2c')],'type':_0xd36d96[_0x7ff1('0x2d')][_0x7ff1('0x2e')]};});_0x40b5e9[_0x7ff1('0x2f')]=_[_0x7ff1('0x30')](_['map'](_0x710046,'name'),['format']);_0x40b5e9[_0x7ff1('0x31')]=_[_0x7ff1('0x32')](_0x574637['query']);_0x40b5e9[_0x7ff1('0x33')]=_[_0x7ff1('0x34')](_0x40b5e9[_0x7ff1('0x2f')],_0x40b5e9[_0x7ff1('0x31')]);_0x1fbbed[_0x7ff1('0x35')]=_[_0x7ff1('0x34')](_0x40b5e9[_0x7ff1('0x2f')],qs[_0x7ff1('0x36')](_0x574637[_0x7ff1('0x31')][_0x7ff1('0x36')]));_0x1fbbed['attributes']=_0x1fbbed['attributes'][_0x7ff1('0x37')]?_0x1fbbed[_0x7ff1('0x35')]:_0x40b5e9[_0x7ff1('0x2f')];if(!_0x574637[_0x7ff1('0x31')]['hasOwnProperty'](_0x7ff1('0x38'))){_0x1fbbed[_0x7ff1('0x1c')]=qs[_0x7ff1('0x1c')](_0x574637[_0x7ff1('0x31')][_0x7ff1('0x1c')]);_0x1fbbed[_0x7ff1('0x1e')]=qs['offset'](_0x574637[_0x7ff1('0x31')]['offset']);}_0x1fbbed['order']=qs[_0x7ff1('0x39')](_0x574637[_0x7ff1('0x31')][_0x7ff1('0x39')]);_0x1fbbed[_0x7ff1('0x3a')]=qs[_0x7ff1('0x33')](_[_0x7ff1('0x3b')](_0x574637[_0x7ff1('0x31')],_0x40b5e9[_0x7ff1('0x33')]),_0x710046);if(_0x574637[_0x7ff1('0x31')][_0x7ff1('0x3c')]){_0x1fbbed[_0x7ff1('0x3a')]=_[_0x7ff1('0x3d')](_0x1fbbed['where'],{'$or':_[_0x7ff1('0x29')](_0x710046,function(_0x139e4a){if(_0x139e4a[_0x7ff1('0x2d')]!==_0x7ff1('0x3e')){var _0x58c31c={};_0x58c31c[_0x139e4a['name']]={'$like':'%'+_0x574637['query'][_0x7ff1('0x3c')]+'%'};return _0x58c31c;}})});}_0x1fbbed=_[_0x7ff1('0x3d')]({},_0x1fbbed,_0x574637['options']);var _0x108319={'where':_0x1fbbed[_0x7ff1('0x3a')]};return db['VoiceRecording'][_0x7ff1('0x1d')](_0x108319)[_0x7ff1('0x23')](function(_0x13363d){_0x20e794[_0x7ff1('0x1d')]=_0x13363d;if(_0x574637[_0x7ff1('0x31')]['includeAll']){_0x1fbbed[_0x7ff1('0x3f')]=[{'all':!![]}];}return db['VoiceRecording'][_0x7ff1('0x40')](_0x1fbbed);})[_0x7ff1('0x23')](function(_0x4a74c9){_0x20e794['rows']=_0x4a74c9;return _0x20e794;})[_0x7ff1('0x23')](respondWithFilteredResult(_0xf75b37,_0x1fbbed))[_0x7ff1('0x41')](handleError(_0xf75b37,null));};exports[_0x7ff1('0x42')]=function(_0x474221,_0x45d86d){var _0x3e1dd7={'raw':![],'where':{'id':_0x474221['params']['id']}},_0x585c43={};_0x585c43[_0x7ff1('0x2f')]=_[_0x7ff1('0x32')](db[_0x7ff1('0x2a')][_0x7ff1('0x2b')]);_0x585c43['query']=_[_0x7ff1('0x32')](_0x474221[_0x7ff1('0x31')]);_0x585c43['filters']=_[_0x7ff1('0x34')](_0x585c43['model'],_0x585c43[_0x7ff1('0x31')]);_0x3e1dd7[_0x7ff1('0x35')]=_[_0x7ff1('0x34')](_0x585c43[_0x7ff1('0x2f')],qs['fields'](_0x474221[_0x7ff1('0x31')][_0x7ff1('0x36')]));_0x3e1dd7[_0x7ff1('0x35')]=_0x3e1dd7[_0x7ff1('0x35')][_0x7ff1('0x37')]?_0x3e1dd7[_0x7ff1('0x35')]:_0x585c43[_0x7ff1('0x2f')];if(_0x474221['query']['includeAll']){_0x3e1dd7[_0x7ff1('0x3f')]=[{'all':!![]}];}_0x3e1dd7=_['merge']({},_0x3e1dd7,_0x474221[_0x7ff1('0x43')]);return db[_0x7ff1('0x2a')][_0x7ff1('0x44')](_0x3e1dd7)[_0x7ff1('0x23')](handleEntityNotFound(_0x45d86d,null))['then'](respondWithResult(_0x45d86d,null))['catch'](handleError(_0x45d86d,null));};exports[_0x7ff1('0x45')]=function(_0x5d649f,_0x3358f3){return db[_0x7ff1('0x2a')]['create'](_0x5d649f[_0x7ff1('0x46')],{})[_0x7ff1('0x23')](respondWithResult(_0x3358f3,0xc9))['catch'](handleError(_0x3358f3,null));};exports[_0x7ff1('0x21')]=function(_0x33b704,_0x1a4bb8){if(_0x33b704[_0x7ff1('0x46')]['id']){delete _0x33b704[_0x7ff1('0x46')]['id'];}return db[_0x7ff1('0x2a')][_0x7ff1('0x44')]({'where':{'id':_0x33b704['params']['id']}})['then'](handleEntityNotFound(_0x1a4bb8,null))[_0x7ff1('0x23')](saveUpdates(_0x33b704['body'],null))[_0x7ff1('0x23')](respondWithResult(_0x1a4bb8,null))[_0x7ff1('0x41')](handleError(_0x1a4bb8,null));};exports[_0x7ff1('0x47')]=function(_0x401f8f,_0x4a4efe){return db[_0x7ff1('0x2a')][_0x7ff1('0x47')]()[_0x7ff1('0x23')](respondWithResult(_0x4a4efe,null))['catch'](handleError(_0x4a4efe,null));};exports[_0x7ff1('0x48')]=function(_0x4e979c,_0x3aca9a,_0x45f247){var _0x160ee7=require('../../components/encryptor');var _0x2fb181=![];var _0x15612c={};if(_0x4e979c[_0x7ff1('0x31')][_0x7ff1('0x2d')]&&_0x4e979c[_0x7ff1('0x31')]['type']==='uniqueid'){_0x15612c[_0x7ff1('0x49')]=_0x4e979c[_0x7ff1('0x4a')]['id'];}else{_0x15612c['id']=_0x4e979c[_0x7ff1('0x4a')]['id'];}return db[_0x7ff1('0x2a')][_0x7ff1('0x44')]({'where':_0x15612c,'attributes':['id',_0x7ff1('0x4b')],'raw':!![]})[_0x7ff1('0x23')](handleEntityNotFound(_0x3aca9a,null))[_0x7ff1('0x23')](function(_0x205ef9){if(_0x205ef9){var _0x1e01b2=_0x205ef9['value'];var _0x479b6e=util['format'](_0x7ff1('0x4c'),_0x1e01b2);if(fs['existsSync'](_0x479b6e)){_0x2fb181=!![];return _0x160ee7[_0x7ff1('0x4d')](_0x479b6e,_0x1e01b2,config[_0x7ff1('0x4e')][_0x7ff1('0x4f')])[_0x7ff1('0x23')](function(){return _0x205ef9;});}return _0x205ef9;}})[_0x7ff1('0x23')](function(_0x403cb1){if(_0x403cb1){var _0xc06aa2=_0x403cb1[_0x7ff1('0x4b')];if(!fs['existsSync'](_0xc06aa2)){throw new db[(_0x7ff1('0x50'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x403cb1[_0x7ff1('0x51')]){return _0x3aca9a[_0x7ff1('0x48')](_0xc06aa2,_0x403cb1[_0x7ff1('0x51')]+path[_0x7ff1('0x52')](_0xc06aa2),function(){if(_0x2fb181){fs[_0x7ff1('0x53')](_0xc06aa2);}});}else{return _0x3aca9a['download'](_0xc06aa2,function(_0xf47464){if(_0x2fb181){fs['unlink'](_0xc06aa2);}});}}})[_0x7ff1('0x41')](function(_0x309a17){if(_0x309a17['message']===_0x7ff1('0x54')){_0x3aca9a['status'](0x194)['send'](_0x7ff1('0x55'));}else{return handleError(_0x3aca9a,null);}});};exports['downloads']=function(_0x28ca50,_0x11ebc3,_0xc1b8af){var _0x381eb8=require(_0x7ff1('0x56'));var _0x4f0d6c=![];var _0x369647={'$and':[db['sequelize']['where'](db[_0x7ff1('0x57')]['fn'](_0x7ff1('0x58'),db[_0x7ff1('0x57')][_0x7ff1('0x59')](_0x7ff1('0x49'))),_0x28ca50[_0x7ff1('0x31')][_0x7ff1('0x5a')])]};if(_0x28ca50['query'][_0x7ff1('0x2d')]&&_0x28ca50[_0x7ff1('0x31')][_0x7ff1('0x2d')]==='uniqueid'){_0x369647['$and']['push']({'uniqueid':_0x28ca50[_0x7ff1('0x4a')]['id']});}else{_0x369647[_0x7ff1('0x5b')][_0x7ff1('0x5c')]({'id':_0x28ca50[_0x7ff1('0x4a')]['id']});}return db[_0x7ff1('0x2a')][_0x7ff1('0x44')]({'where':_0x369647,'attributes':['id',_0x7ff1('0x4b')],'raw':!![]})[_0x7ff1('0x23')](handleEntityNotFound(_0x11ebc3,null))[_0x7ff1('0x23')](function(_0x118700){if(_0x118700){var _0x1d01e2=util['format']('%s.cypher',_0x118700['value']);if(fs[_0x7ff1('0x5d')](_0x1d01e2)){_0x4f0d6c=!![];return _0x381eb8[_0x7ff1('0x4d')](_0x1d01e2,_0x118700[_0x7ff1('0x4b')],config[_0x7ff1('0x4e')][_0x7ff1('0x4f')])[_0x7ff1('0x23')](function(){return _0x118700;});}return _0x118700;}})[_0x7ff1('0x23')](function(_0x52ff8c){if(_0x52ff8c){if(!fs[_0x7ff1('0x5d')](_0x52ff8c[_0x7ff1('0x4b')])){throw new db[(_0x7ff1('0x50'))]['ValidationError'](_0x7ff1('0x54'));}if(_0x52ff8c[_0x7ff1('0x51')]){return _0x11ebc3[_0x7ff1('0x48')](_0x52ff8c[_0x7ff1('0x4b')],_0x52ff8c[_0x7ff1('0x51')]+path[_0x7ff1('0x52')](_0x52ff8c[_0x7ff1('0x4b')]),function(){if(_0x4f0d6c){fs['unlink'](_0x52ff8c['value']);}});}else{return _0x11ebc3[_0x7ff1('0x48')](_0x52ff8c['value'],function(_0x3d22e7){if(_0x4f0d6c){fs[_0x7ff1('0x53')](_0x52ff8c[_0x7ff1('0x4b')]);}});}}})[_0x7ff1('0x41')](handleError(_0x11ebc3,null));};exports[_0x7ff1('0x22')]=function(_0x148700,_0x1e0c6e){return db['VoiceRecording']['find']({'where':{'id':_0x148700[_0x7ff1('0x4a')]['id']}})[_0x7ff1('0x23')](function(_0x122a17){if(_[_0x7ff1('0x5e')](_0x122a17)){throw new ReferenceError(_0x7ff1('0x5f'));}return _0x122a17;})[_0x7ff1('0x23')](function(_0x120dba){var _0x5dc34f=_0x120dba[_0x7ff1('0x4b')];logger[_0x7ff1('0x60')](_0x7ff1('0x61'),_0x5dc34f);if(!_[_0x7ff1('0x5e')](_0x120dba['value'])&&fs[_0x7ff1('0x5d')](_0x5dc34f)){logger['info']('File:\x20\x22'+_0x5dc34f+_0x7ff1('0x62'));fs['unlinkSync'](_0x5dc34f);}_0x5dc34f=_0x5dc34f+_0x7ff1('0x63');if(!_['isNil'](_0x120dba[_0x7ff1('0x4b')])&&fs[_0x7ff1('0x5d')](_0x5dc34f)){logger[_0x7ff1('0x60')](_0x7ff1('0x64')+_0x5dc34f+_0x7ff1('0x62'));fs['unlinkSync'](_0x5dc34f);}return _0x120dba;})[_0x7ff1('0x23')](function(_0x3f6875){if(!_0x3f6875)throw new InternalError();return _0x3f6875[_0x7ff1('0x22')]();})['then'](function(){_0x1e0c6e[_0x7ff1('0x19')](0xcc)['end']();})[_0x7ff1('0x41')](handleError(_0x1e0c6e,null));};function getBucketslist(_0x53592a,_0x2627f6,_0x257a09){return new Promise(function(_0x1455cd,_0x43fa43){var _0x148bc1=new AWS['S3']({'accessKeyId':_0x2627f6,'secretAccessKey':_0x53592a,'region':_0x257a09});_0x148bc1['listBuckets']({},function(_0x4b2aab,_0x7c4368){if(_0x4b2aab){return _0x43fa43(_0x4b2aab);}else{return _0x1455cd(_0x7c4368);}});});}function createBucket(_0x53c617,_0x4c65fe,_0x881ea8,_0x380a8b){return new Promise(function(_0x3e1e71,_0x4d3f68){var _0x1246f4=new AWS['S3']({'accessKeyId':_0x4c65fe,'secretAccessKey':_0x53c617,'region':_0x881ea8});_0x1246f4[_0x7ff1('0x65')]({'Bucket':_0x380a8b},function(_0x268d1b,_0x2d3f0f){if(_0x268d1b){return _0x4d3f68(_0x268d1b);}else{return _0x3e1e71(_0x2d3f0f);}});});}function uploadFile(_0x6b841f,_0x253b2c,_0x5bb7ed,_0x2e631b,_0x1356be,_0x37ce94){return new Promise(function(_0x33084c,_0x37badd){var _0xd86074=new AWS['S3']({'accessKeyId':_0x253b2c,'secretAccessKey':_0x6b841f,'region':_0x5bb7ed});_0xd86074['upload']({'Bucket':_0x2e631b,'Key':_0x1356be,'Body':_0x37ce94},function(_0x3469ad,_0x5c7bbd){if(_0x3469ad){return _0x37badd(_0x3469ad);}else{return _0x33084c(_0x5c7bbd);}});});}function startTranscribe(_0xccddff,_0x11f6ad,_0x26311d,_0x367a46,_0x3f2742,_0x2dcc14){return new Promise(function(_0x49e27b,_0x2c64f1){var _0x2de045=new AWS['TranscribeService']({'accessKeyId':_0x11f6ad,'secretAccessKey':_0xccddff,'region':_0x26311d});_0x2de045[_0x7ff1('0x66')]({'TranscriptionJobName':_0x367a46,'LanguageCode':_0x3f2742,'Media':{'MediaFileUri':_0x2dcc14}},function(_0x167d7e,_0x554692){if(_0x167d7e){return _0x2c64f1(_0x167d7e);}else{return _0x49e27b(_0x554692);}});});}function transcribe(_0x4adeb9,_0x42e31e,_0x5900d9,_0x5c656f,_0x35eeae,_0x57fcfe,_0x21711e){return new Promise(function(_0xa9102e,_0x10dcff){var _0x2829d5={};logger['info'](util[_0x7ff1('0x67')](_0x7ff1('0x68'),_0x4adeb9,_0x35eeae));return uploadFile(_0x42e31e,_0x5900d9,_0x5c656f,_0x35eeae,path[_0x7ff1('0x69')](_0x57fcfe),fs[_0x7ff1('0x6a')](_0x57fcfe))[_0x7ff1('0x23')](function(_0x20f2f4){logger['info'](util[_0x7ff1('0x67')](_0x7ff1('0x6b'),_0x4adeb9,_0x35eeae,_0x20f2f4[_0x7ff1('0x6c')]));_0x2829d5[_0x7ff1('0x6d')]=_0x20f2f4[_0x7ff1('0x6e')];_0x2829d5[_0x7ff1('0x6f')]=_0x20f2f4['Location'];logger[_0x7ff1('0x60')](util[_0x7ff1('0x67')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x4adeb9));return startTranscribe(_0x42e31e,_0x5900d9,_0x5c656f,uuidv4(),_0x21711e,_0x20f2f4[_0x7ff1('0x6c')]);})['then'](function(_0x294833){logger[_0x7ff1('0x60')](util['format'](_0x7ff1('0x70'),_0x4adeb9,_0x294833[_0x7ff1('0x71')][_0x7ff1('0x72')]));_0x2829d5[_0x7ff1('0x73')]=_0x294833[_0x7ff1('0x71')][_0x7ff1('0x72')];_0x2829d5['transcribeStatus']=_0x294833['TranscriptionJob'][_0x7ff1('0x74')];return _0xa9102e(_0x2829d5);})[_0x7ff1('0x41')](function(_0x30d3cf){return _0x10dcff(_0x30d3cf);});});}exports[_0x7ff1('0x75')]=function(_0x5dfece,_0x5b1351,_0x47cc5f){var _0x28373d;var _0x19d6e6;var _0x4ac583;var _0x22c08c=require('../../components/encryptor');return db['VoiceRecording']['findOne']({'where':{'id':_0x5dfece[_0x7ff1('0x4a')]['id']}})[_0x7ff1('0x23')](function(_0x5e0450){if(_0x5e0450){var _0x5b9984=util[_0x7ff1('0x67')](_0x7ff1('0x4c'),_0x5e0450[_0x7ff1('0x4b')]);if(fs[_0x7ff1('0x5d')](_0x5b9984)){cypher=!![];return _0x22c08c[_0x7ff1('0x4d')](_0x5b9984,_0x5e0450[_0x7ff1('0x4b')],config[_0x7ff1('0x4e')][_0x7ff1('0x4f')])[_0x7ff1('0x23')](function(){return _0x5e0450;});}return _0x5e0450;}})['then'](function(_0x21c17f){if(!_0x21c17f){throw new db[(_0x7ff1('0x50'))][(_0x7ff1('0x76'))](_0x7ff1('0x77'));}_0x19d6e6=_0x21c17f;return db['Setting'][_0x7ff1('0x78')]({'where':{'id':0x1}});})[_0x7ff1('0x23')](handleEntityNotFound(_0x5b1351,null))[_0x7ff1('0x23')](function(_0x4d9049){if(_0x4d9049){_0x28373d=_0x4d9049;if(!_0x28373d[_0x7ff1('0x79')]||!_0x28373d[_0x7ff1('0x7a')]||!_0x28373d[_0x7ff1('0x7b')]||!_0x28373d[_0x7ff1('0x7c')]||!_0x28373d[_0x7ff1('0x6d')]){throw new db['Sequelize'][(_0x7ff1('0x76'))](_0x7ff1('0x7d'));}if(_0x5dfece[_0x7ff1('0x46')]['runSentiment']&&(!_0x28373d[_0x7ff1('0x7e')]||!_0x28373d[_0x7ff1('0x7f')]||!_0x28373d[_0x7ff1('0x80')]||!_0x28373d[_0x7ff1('0x7c')]||!_0x28373d[_0x7ff1('0x6d')])){throw new db['Sequelize'][(_0x7ff1('0x76'))](_0x7ff1('0x81'));}return db[_0x7ff1('0x82')][_0x7ff1('0x78')]({'where':{'id':_0x28373d[_0x7ff1('0x7a')]}});}})[_0x7ff1('0x23')](function(_0x54260a){if(!_0x54260a){throw new db[(_0x7ff1('0x50'))][(_0x7ff1('0x76'))](_0x7ff1('0x83'));}if(!_0x54260a[_0x7ff1('0x84')]||!_0x54260a[_0x7ff1('0x85')]){throw new db[(_0x7ff1('0x50'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x4ac583=_0x54260a;return getBucketslist(_0x4ac583[_0x7ff1('0x84')],_0x4ac583['data2'],_0x28373d[_0x7ff1('0x7b')]);})[_0x7ff1('0x23')](function(_0x1704a9){if(_0x1704a9&&_0x1704a9[_0x7ff1('0x86')]){var _0x59e58b=_[_0x7ff1('0x44')](_0x1704a9['Buckets'],function(_0x5d0cee){return _0x5d0cee['Name']===_0x28373d[_0x7ff1('0x6d')];});if(!_0x59e58b){logger[_0x7ff1('0x60')](util[_0x7ff1('0x67')](_0x7ff1('0x87'),_0x5dfece[_0x7ff1('0x4a')]['id'],_0x28373d[_0x7ff1('0x6d')]));return createBucket(_0x4ac583[_0x7ff1('0x84')],_0x4ac583['data2'],_0x28373d['transcribeRegion'],_0x28373d[_0x7ff1('0x6d')]);}logger[_0x7ff1('0x60')](util[_0x7ff1('0x67')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x5dfece[_0x7ff1('0x4a')]['id'],_0x28373d[_0x7ff1('0x6d')]));return;}})[_0x7ff1('0x23')](function(_0x2e0064){if(_0x19d6e6['transcribeStatus']===_0x7ff1('0x88')){return transcribe(_0x5dfece[_0x7ff1('0x4a')]['id'],_0x4ac583['data1'],_0x4ac583['data2'],_0x28373d[_0x7ff1('0x7b')],_0x28373d[_0x7ff1('0x6d')],_0x19d6e6[_0x7ff1('0x4b')],_0x28373d[_0x7ff1('0x7c')]);}else{logger[_0x7ff1('0x60')](util['format'](_0x7ff1('0x89'),_0x5dfece[_0x7ff1('0x4a')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x1a5f47){if(_0x1a5f47){_0x1a5f47[_0x7ff1('0x8a')]=_0x5dfece['body'][_0x7ff1('0x8b')];return _0x19d6e6[_0x7ff1('0x8c')](_0x1a5f47);}})[_0x7ff1('0x23')](respondWithResult(_0x5b1351,null))[_0x7ff1('0x41')](handleError(_0x5b1351,null));};function writeFile(_0x5bb8ba,_0xa564ca){return new Promise(function(_0x4c798d,_0x450e8b){fs[_0x7ff1('0x8d')](_0xa564ca,_0x5bb8ba,function(_0x2813ca,_0x49e67a){if(_0x2813ca){return _0x450e8b(_0x2813ca);}else{return _0x4c798d(_0x49e67a);}});});}exports[_0x7ff1('0x8e')]=function(_0x4dfea7,_0x69193,_0x372f4e){return db[_0x7ff1('0x2a')][_0x7ff1('0x78')]({'where':{'id':_0x4dfea7[_0x7ff1('0x4a')]['id']}})[_0x7ff1('0x23')](handleEntityNotFound(_0x69193))[_0x7ff1('0x23')](function(_0xc2bba0){if(_0xc2bba0&&_0xc2bba0[_0x7ff1('0x8f')]){var _0x2f56da=_0xc2bba0[_0x7ff1('0x8f')];var _0x51f1ef=config['root']+_0x7ff1('0x90')+_0xc2bba0['id']+_0x7ff1('0x91');if(fs[_0x7ff1('0x5d')](_0x51f1ef)){return _0x51f1ef;}return writeFile(_0x2f56da,_0x51f1ef)[_0x7ff1('0x23')](function(){return _0x51f1ef;});}else{throw new db[(_0x7ff1('0x50'))][(_0x7ff1('0x76'))](_0x7ff1('0x92'));}})['then'](function(_0x52ba12){return _0x69193[_0x7ff1('0x48')](_0x52ba12);})[_0x7ff1('0x41')](handleError(_0x69193));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index d0fb781..c5c06e2 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 _0xe9e8=['exports','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x2ef14b,_0x5458ea){var _0x999e0c=function(_0x59ea76){while(--_0x59ea76){_0x2ef14b['push'](_0x2ef14b['shift']());}};_0x999e0c(++_0x5458ea);}(_0xe9e8,0x179));var _0x8e9e=function(_0x359e4d,_0xf04805){_0x359e4d=_0x359e4d-0x0;var _0x2b5f45=_0xe9e8[_0x359e4d];return _0x2b5f45;};'use strict';var attributes=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]=function(_0x38ef03,_0x38b3cb){return _0x38ef03[_0x8e9e('0x2')](_0x8e9e('0x3'),attributes,{'tableName':_0x8e9e('0x4'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8e9e('0x5')]},{'name':'transcribeStatus','fields':[_0x8e9e('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f75=['uniqueid','transcribeStatus','./voiceRecording.attributes','voice_recordings'];(function(_0x392e5f,_0x39e30e){var _0x53b304=function(_0xfd62cb){while(--_0xfd62cb){_0x392e5f['push'](_0x392e5f['shift']());}};_0x53b304(++_0x39e30e);}(_0x9f75,0x15a));var _0x59f7=function(_0x1e9fe5,_0x1875c5){_0x1e9fe5=_0x1e9fe5-0x0;var _0xa43141=_0x9f75[_0x1e9fe5];return _0xa43141;};'use strict';var attributes=require(_0x59f7('0x0'));module['exports']=function(_0x2d26fa,_0x2a2154){return _0x2d26fa['define']('VoiceRecording',attributes,{'tableName':_0x59f7('0x1'),'paranoid':![],'indexes':[{'name':_0x59f7('0x2'),'fields':[_0x59f7('0x2')]},{'name':_0x59f7('0x3'),'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 d951f4f..db016b0 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 _0x77e6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','options','raw','attributes','limit','UpdateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x77e6,0x1a6));var _0x677e=function(_0xfe70e,_0x63b7b3){_0xfe70e=_0xfe70e-0x0;var _0x2a4ced=_0x77e6[_0xfe70e];return _0x2a4ced;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});}exports['UpdateVoiceRecording']=function(_0x1c5124){var _0x2ef2bf=this;return new Promise(function(_0x385b06,_0x221b6d){return db[_0x677e('0x18')][_0x677e('0x19')](_0x1c5124['body'],{'raw':_0x1c5124[_0x677e('0x1a')]?_0x1c5124['options'][_0x677e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')]['where']||null:null,'attributes':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'limit':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1d')]||null:null})[_0x677e('0xc')](function(_0x52ee8b){logger['info']('UpdateVoiceRecording',_0x1c5124);logger[_0x677e('0xf')](_0x677e('0x1e'),_0x1c5124,JSON[_0x677e('0x11')](_0x52ee8b));_0x385b06(_0x52ee8b);})[_0x677e('0x17')](function(_0x424e5d){logger[_0x677e('0x12')](_0x677e('0x1e'),_0x424e5d[_0x677e('0x15')],_0x1c5124);_0x221b6d(_0x2ef2bf[_0x677e('0x12')](0x1f4,_0x424e5d[_0x677e('0x15')]));});});};exports['CreateVoiceRecording']=function(_0x5f0ba2){var _0x3d3370=this;return new Promise(function(_0x184f68,_0x4d9e0b){var _0x51e39d=require(_0x677e('0x1f'));var _0xf6b3ad;return db[_0x677e('0x20')][_0x677e('0x21')]({'attributes':['id',_0x677e('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0xcd4646){_0xf6b3ad=_0xcd4646;return db[_0x677e('0x18')][_0x677e('0x23')](_0x5f0ba2[_0x677e('0x24')]);})[_0x677e('0xc')](function(_0x2bd6fb){if(_0xf6b3ad[_0x677e('0x22')]&&fs[_0x677e('0x25')](_0x2bd6fb[_0x677e('0x26')])){var _0x4c5113=util[_0x677e('0x27')](_0x677e('0x28'),_0x2bd6fb[_0x677e('0x26')]);return _0x51e39d[_0x677e('0x29')](_0x2bd6fb[_0x677e('0x26')],_0x4c5113,config[_0x677e('0x2a')][_0x677e('0x2b')])[_0x677e('0xc')](function(){fs[_0x677e('0x2c')](_0x2bd6fb[_0x677e('0x26')]);logger['info'](_0x677e('0x2d'));return _0x2bd6fb;});}return _0x2bd6fb;})[_0x677e('0xc')](function(_0x2b6f24){logger[_0x677e('0xd')](_0x677e('0x2e'),_0x5f0ba2);logger[_0x677e('0xf')]('CreateVoiceRecording',_0x5f0ba2,JSON[_0x677e('0x11')](_0x2b6f24));_0x184f68(_0x2b6f24);})[_0x677e('0x17')](function(_0x2d0bc0){logger['error'](_0x677e('0x2e'),_0x2d0bc0[_0x677e('0x15')],_0x5f0ba2);_0x4d9e0b(_0x3d3370[_0x677e('0x12')](0x1f4,_0x2d0bc0[_0x677e('0x15')]));});});}; \ No newline at end of file +var _0xb016=['options','raw','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','value','format','encryptFile','secrets','recording','unlink','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb016,0x159));var _0x6b01=function(_0x2cb538,_0x546da9){_0x2cb538=_0x2cb538-0x0;var _0x1f924f=_0xb016[_0x2cb538];return _0x1f924f;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}exports[_0x6b01('0x14')]=function(_0x9c6571){var _0xc4e1b1=this;return new Promise(function(_0x18f336,_0x4f2d08){return db[_0x6b01('0x15')][_0x6b01('0x16')](_0x9c6571[_0x6b01('0x17')],{'raw':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')]['where']||null:null,'attributes':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x1a')]||null:null,'limit':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x1b')]||null:null})[_0x6b01('0xa')](function(_0x542fab){logger[_0x6b01('0xb')](_0x6b01('0x14'),_0x9c6571);logger[_0x6b01('0x1c')]('UpdateVoiceRecording',_0x9c6571,JSON[_0x6b01('0xe')](_0x542fab));_0x18f336(_0x542fab);})[_0x6b01('0x13')](function(_0x304393){logger[_0x6b01('0xf')](_0x6b01('0x14'),_0x304393[_0x6b01('0x11')],_0x9c6571);_0x4f2d08(_0xc4e1b1[_0x6b01('0xf')](0x1f4,_0x304393[_0x6b01('0x11')]));});});};exports[_0x6b01('0x1d')]=function(_0x152dda){var _0x3c0607=this;return new Promise(function(_0xa846d8,_0x154dfc){var _0x55ca4b=require(_0x6b01('0x1e'));var _0x220efb;return db[_0x6b01('0x1f')][_0x6b01('0x20')]({'attributes':['id',_0x6b01('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x54f030){_0x220efb=_0x54f030;return db[_0x6b01('0x15')][_0x6b01('0x22')](_0x152dda[_0x6b01('0x17')]);})[_0x6b01('0xa')](function(_0x2a894e){if(_0x220efb[_0x6b01('0x21')]&&fs['existsSync'](_0x2a894e[_0x6b01('0x23')])){var _0x5482a8=util[_0x6b01('0x24')]('%s.cypher',_0x2a894e[_0x6b01('0x23')]);return _0x55ca4b[_0x6b01('0x25')](_0x2a894e[_0x6b01('0x23')],_0x5482a8,config[_0x6b01('0x26')][_0x6b01('0x27')])['then'](function(){fs[_0x6b01('0x28')](_0x2a894e[_0x6b01('0x23')]);logger[_0x6b01('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2a894e;});}return _0x2a894e;})['then'](function(_0x3578ef){logger['info'](_0x6b01('0x1d'),_0x152dda);logger[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x152dda,JSON['stringify'](_0x3578ef));_0xa846d8(_0x3578ef);})[_0x6b01('0x13')](function(_0x42d5f7){logger[_0x6b01('0xf')]('CreateVoiceRecording',_0x42d5f7[_0x6b01('0x11')],_0x152dda);_0x154dfc(_0x3c0607[_0x6b01('0xf')](0x1f4,_0x42d5f7[_0x6b01('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 36bf043..774d4ce 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 _0xbda2=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x15204b,_0x12d6af){var _0x410d73=function(_0x48e1df){while(--_0x48e1df){_0x15204b['push'](_0x15204b['shift']());}};_0x410d73(++_0x12d6af);}(_0xbda2,0x12d));var _0x2bda=function(_0x1d9d1c,_0x4c81cb){_0x1d9d1c=_0x1d9d1c-0x0;var _0x131427=_0xbda2[_0x1d9d1c];return _0x131427;};'use strict';var multer=require(_0x2bda('0x0'));var util=require(_0x2bda('0x1'));var path=require('path');var timeout=require(_0x2bda('0x2'));var express=require('express');var router=express[_0x2bda('0x3')]();var fs_extra=require(_0x2bda('0x4'));var auth=require(_0x2bda('0x5'));var interaction=require(_0x2bda('0x6'));var config=require(_0x2bda('0x7'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x2bda('0x8')](),controller[_0x2bda('0x9')]);router[_0x2bda('0xa')]('/describe',auth[_0x2bda('0x8')](),controller[_0x2bda('0xb')]);router[_0x2bda('0xa')](_0x2bda('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2bda('0xd')]('/',auth[_0x2bda('0x8')](),controller[_0x2bda('0xe')]);router[_0x2bda('0xf')](_0x2bda('0xc'),auth[_0x2bda('0x8')](),controller[_0x2bda('0x10')]);router[_0x2bda('0x11')](_0x2bda('0xc'),auth[_0x2bda('0x8')](),controller[_0x2bda('0x12')]);module[_0x2bda('0x13')]=router; \ No newline at end of file +var _0xfc47=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','destroy','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc47,0xc6));var _0x7fc4=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0xfc47[_0x3f88bc];return _0x4df1c4;};'use strict';var multer=require('multer');var util=require(_0x7fc4('0x0'));var path=require(_0x7fc4('0x1'));var timeout=require(_0x7fc4('0x2'));var express=require(_0x7fc4('0x3'));var router=express[_0x7fc4('0x4')]();var fs_extra=require(_0x7fc4('0x5'));var auth=require(_0x7fc4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7fc4('0x7'));router[_0x7fc4('0x8')]('/',auth[_0x7fc4('0x9')](),controller[_0x7fc4('0xa')]);router[_0x7fc4('0x8')](_0x7fc4('0xb'),auth[_0x7fc4('0x9')](),controller['describe']);router[_0x7fc4('0x8')]('/:id',auth[_0x7fc4('0x9')](),controller[_0x7fc4('0xc')]);router[_0x7fc4('0xd')]('/',auth[_0x7fc4('0x9')](),controller[_0x7fc4('0xe')]);router[_0x7fc4('0xf')](_0x7fc4('0x10'),auth[_0x7fc4('0x9')](),controller[_0x7fc4('0x11')]);router['delete'](_0x7fc4('0x10'),auth[_0x7fc4('0x9')](),controller[_0x7fc4('0x12')]);module[_0x7fc4('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 2d8706b..a8980e1 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 _0xb8ee=['exports','ENUM','attended','STRING','Yes','sequelize'];(function(_0x5060c0,_0x1bec7d){var _0xa67d56=function(_0xa45ed9){while(--_0xa45ed9){_0x5060c0['push'](_0x5060c0['shift']());}};_0xa67d56(++_0x1bec7d);}(_0xb8ee,0xa1));var _0xeb8e=function(_0x33f31b,_0x550ae9){_0x33f31b=_0x33f31b-0x0;var _0x33514e=_0xb8ee[_0x33f31b];return _0x33514e;};'use strict';var Sequelize=require(_0xeb8e('0x0'));var moment=require('moment');module[_0xeb8e('0x1')]={'type':{'type':Sequelize[_0xeb8e('0x2')]('blind',_0xeb8e('0x3'))},'result':{'type':Sequelize[_0xeb8e('0x4')]},'transfererchannel':{'type':Sequelize[_0xeb8e('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xeb8e('0x4')]},'transferercalleridname':{'type':Sequelize[_0xeb8e('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xeb8e('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xeb8e('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xeb8e('0x4')]},'transferercontext':{'type':Sequelize[_0xeb8e('0x4')]},'transfererexten':{'type':Sequelize[_0xeb8e('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xeb8e('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xeb8e('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xeb8e('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xeb8e('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xeb8e('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xeb8e('0x4')]},'transfereecontext':{'type':Sequelize[_0xeb8e('0x4')]},'transfereeexten':{'type':Sequelize[_0xeb8e('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xeb8e('0x4')]},'isexternal':{'type':Sequelize[_0xeb8e('0x2')](_0xeb8e('0x5'),'No')},'context':{'type':Sequelize[_0xeb8e('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x546d=['blind','attended','STRING','Yes','moment','exports','ENUM'];(function(_0x5bc65b,_0x36c735){var _0xe2d49a=function(_0x2f5856){while(--_0x2f5856){_0x5bc65b['push'](_0x5bc65b['shift']());}};_0xe2d49a(++_0x36c735);}(_0x546d,0x14d));var _0xd546=function(_0x154618,_0x5f5b86){_0x154618=_0x154618-0x0;var _0x4be226=_0x546d[_0x154618];return _0x4be226;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd546('0x0'));module[_0xd546('0x1')]={'type':{'type':Sequelize[_0xd546('0x2')](_0xd546('0x3'),_0xd546('0x4'))},'result':{'type':Sequelize[_0xd546('0x5')]},'transfererchannel':{'type':Sequelize[_0xd546('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xd546('0x5')]},'transferercalleridname':{'type':Sequelize[_0xd546('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd546('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xd546('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xd546('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xd546('0x5')]},'transfereechannel':{'type':Sequelize[_0xd546('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xd546('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xd546('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xd546('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd546('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xd546('0x5')]},'transfereecontext':{'type':Sequelize[_0xd546('0x5')]},'transfereeexten':{'type':Sequelize[_0xd546('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xd546('0x2')](_0xd546('0x6'),'No')},'context':{'type':Sequelize[_0xd546('0x5')]},'extension':{'type':Sequelize[_0xd546('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 62e1d40..685cde8 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 _0x08bc=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','limit','Content-Range','json','apply','reject','destroy','then','error','stack','name','index','map','VoiceTransferReport','rawAttributes','type','key','query','intersection','attributes','model','fields','length','nolimit','offset','order','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','catch','params','keys','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs'];(function(_0x398e5e,_0x4d0730){var _0x2f05b3=function(_0x4a5510){while(--_0x4a5510){_0x398e5e['push'](_0x398e5e['shift']());}};_0x2f05b3(++_0x4d0730);}(_0x08bc,0x1d3));var _0xc08b=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0x08bc[_0x413aac];return _0x569b11;};'use strict';var emlformat=require(_0xc08b('0x0'));var rimraf=require(_0xc08b('0x1'));var zipdir=require(_0xc08b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc08b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc08b('0x4'));var util=require(_0xc08b('0x5'));var path=require(_0xc08b('0x6'));var sox=require('sox');var csv=require(_0xc08b('0x7'));var ejs=require(_0xc08b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc08b('0x9'));var squel=require('squel');var crypto=require(_0xc08b('0xa'));var jsforce=require(_0xc08b('0xb'));var deskjs=require(_0xc08b('0xc'));var toCsv=require(_0xc08b('0x7'));var querystring=require(_0xc08b('0xd'));var Papa=require('papaparse');var Redis=require(_0xc08b('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc08b('0xf'));var logger=require('../../config/logger')(_0xc08b('0x10'));var utils=require(_0xc08b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xc08b('0x12'));var db=require(_0xc08b('0x13'))['db'];function respondWithStatusCode(_0x7b2a6d,_0x260b26){_0x260b26=_0x260b26||0xcc;return function(_0x3d2ab0){if(_0x3d2ab0){return _0x7b2a6d[_0xc08b('0x14')](_0x260b26);}return _0x7b2a6d[_0xc08b('0x15')](_0x260b26)[_0xc08b('0x16')]();};}function respondWithResult(_0x1db73a,_0x442650){_0x442650=_0x442650||0xc8;return function(_0x5876e7){if(_0x5876e7){return _0x1db73a[_0xc08b('0x15')](_0x442650)['json'](_0x5876e7);}};}function respondWithFilteredResult(_0x10c540,_0x20fd22){return function(_0x521511){if(_0x521511){var _0x3a256b=typeof _0x20fd22['offset']===_0xc08b('0x17')&&typeof _0x20fd22['limit']==='undefined';var _0x473829=_0x521511['count'];var _0x693702=_0x3a256b?0x0:_0x20fd22['offset'];var _0x500fcb=_0x3a256b?_0x521511[_0xc08b('0x18')]:_0x20fd22['offset']+_0x20fd22[_0xc08b('0x19')];var _0x52ff33;if(_0x500fcb>=_0x473829){_0x500fcb=_0x473829;_0x52ff33=0xc8;}else{_0x52ff33=0xce;}_0x10c540[_0xc08b('0x15')](_0x52ff33);return _0x10c540['set'](_0xc08b('0x1a'),_0x693702+'-'+_0x500fcb+'/'+_0x473829)[_0xc08b('0x1b')](_0x521511);}return null;};}function patchUpdates(_0x6944ce){return function(_0x4b81be){try{jsonpatch[_0xc08b('0x1c')](_0x4b81be,_0x6944ce,!![]);}catch(_0x81c7d8){return BPromise[_0xc08b('0x1d')](_0x81c7d8);}return _0x4b81be['save']();};}function saveUpdates(_0x581d64,_0x585061){return function(_0x1d0d5e){if(_0x1d0d5e){return _0x1d0d5e['update'](_0x581d64)['then'](function(_0x52b0ca){return _0x52b0ca;});}return null;};}function removeEntity(_0x416f58,_0x42ced5){return function(_0x191acc){if(_0x191acc){return _0x191acc[_0xc08b('0x1e')]()[_0xc08b('0x1f')](function(){_0x416f58['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ec8dd,_0x1ff76f){return function(_0x4e0542){if(!_0x4e0542){_0x5ec8dd['sendStatus'](0x194);}return _0x4e0542;};}function handleError(_0x3b1de7,_0x189b4a){_0x189b4a=_0x189b4a||0x1f4;return function(_0x58feea){logger[_0xc08b('0x20')](_0x58feea[_0xc08b('0x21')]);if(_0x58feea[_0xc08b('0x22')]){delete _0x58feea[_0xc08b('0x22')];}_0x3b1de7[_0xc08b('0x15')](_0x189b4a)['send'](_0x58feea);};}exports[_0xc08b('0x23')]=function(_0x4bc002,_0x292416){var _0x16ae90={},_0x176567={},_0x4f5f06={'count':0x0,'rows':[]};var _0x2181a6=_[_0xc08b('0x24')](db[_0xc08b('0x25')][_0xc08b('0x26')],function(_0x192f96){return{'name':_0x192f96['fieldName'],'type':_0x192f96[_0xc08b('0x27')][_0xc08b('0x28')]};});_0x176567['model']=_[_0xc08b('0x24')](_0x2181a6,'name');_0x176567[_0xc08b('0x29')]=_['keys'](_0x4bc002['query']);_0x176567['filters']=_[_0xc08b('0x2a')](_0x176567['model'],_0x176567['query']);_0x16ae90[_0xc08b('0x2b')]=_[_0xc08b('0x2a')](_0x176567[_0xc08b('0x2c')],qs['fields'](_0x4bc002['query'][_0xc08b('0x2d')]));_0x16ae90[_0xc08b('0x2b')]=_0x16ae90['attributes'][_0xc08b('0x2e')]?_0x16ae90[_0xc08b('0x2b')]:_0x176567[_0xc08b('0x2c')];if(!_0x4bc002['query']['hasOwnProperty'](_0xc08b('0x2f'))){_0x16ae90[_0xc08b('0x19')]=qs[_0xc08b('0x19')](_0x4bc002['query']['limit']);_0x16ae90[_0xc08b('0x30')]=qs['offset'](_0x4bc002[_0xc08b('0x29')][_0xc08b('0x30')]);}_0x16ae90[_0xc08b('0x31')]=qs[_0xc08b('0x32')](_0x4bc002['query'][_0xc08b('0x32')]);_0x16ae90['where']=qs[_0xc08b('0x33')](_[_0xc08b('0x34')](_0x4bc002[_0xc08b('0x29')],_0x176567['filters']),_0x2181a6);if(_0x4bc002[_0xc08b('0x29')][_0xc08b('0x35')]){_0x16ae90[_0xc08b('0x36')]=_[_0xc08b('0x37')](_0x16ae90[_0xc08b('0x36')],{'$or':_[_0xc08b('0x24')](_0x2181a6,function(_0x543fcc){if(_0x543fcc['type']!=='VIRTUAL'){var _0x28dada={};_0x28dada[_0x543fcc[_0xc08b('0x22')]]={'$like':'%'+_0x4bc002[_0xc08b('0x29')][_0xc08b('0x35')]+'%'};return _0x28dada;}})});}_0x16ae90=_['merge']({},_0x16ae90,_0x4bc002[_0xc08b('0x38')]);var _0x371c31={'where':_0x16ae90['where']};return db[_0xc08b('0x25')][_0xc08b('0x18')](_0x371c31)[_0xc08b('0x1f')](function(_0x188038){_0x4f5f06[_0xc08b('0x18')]=_0x188038;if(_0x4bc002[_0xc08b('0x29')][_0xc08b('0x39')]){_0x16ae90[_0xc08b('0x3a')]=[{'all':!![]}];}return db[_0xc08b('0x25')]['findAll'](_0x16ae90);})[_0xc08b('0x1f')](function(_0x166a76){_0x4f5f06[_0xc08b('0x3b')]=_0x166a76;return _0x4f5f06;})['then'](respondWithFilteredResult(_0x292416,_0x16ae90))[_0xc08b('0x3c')](handleError(_0x292416,null));};exports['show']=function(_0x36a46a,_0x16b10f){var _0x235853={'raw':!![],'where':{'id':_0x36a46a[_0xc08b('0x3d')]['id']}},_0x528ede={};_0x528ede['model']=_['keys'](db['VoiceTransferReport'][_0xc08b('0x26')]);_0x528ede[_0xc08b('0x29')]=_[_0xc08b('0x3e')](_0x36a46a['query']);_0x528ede[_0xc08b('0x33')]=_[_0xc08b('0x2a')](_0x528ede[_0xc08b('0x2c')],_0x528ede[_0xc08b('0x29')]);_0x235853[_0xc08b('0x2b')]=_['intersection'](_0x528ede[_0xc08b('0x2c')],qs[_0xc08b('0x2d')](_0x36a46a[_0xc08b('0x29')][_0xc08b('0x2d')]));_0x235853['attributes']=_0x235853[_0xc08b('0x2b')][_0xc08b('0x2e')]?_0x235853[_0xc08b('0x2b')]:_0x528ede[_0xc08b('0x2c')];if(_0x36a46a['query'][_0xc08b('0x39')]){_0x235853[_0xc08b('0x3a')]=[{'all':!![]}];}_0x235853=_['merge']({},_0x235853,_0x36a46a[_0xc08b('0x38')]);return db[_0xc08b('0x25')][_0xc08b('0x3f')](_0x235853)[_0xc08b('0x1f')](handleEntityNotFound(_0x16b10f,null))[_0xc08b('0x1f')](respondWithResult(_0x16b10f,null))[_0xc08b('0x3c')](handleError(_0x16b10f,null));};exports[_0xc08b('0x40')]=function(_0x3b9c03,_0x548d0d){return db['VoiceTransferReport']['create'](_0x3b9c03[_0xc08b('0x41')],{})['then'](respondWithResult(_0x548d0d,0xc9))[_0xc08b('0x3c')](handleError(_0x548d0d,null));};exports[_0xc08b('0x42')]=function(_0x2c3373,_0x346e0e){if(_0x2c3373[_0xc08b('0x41')]['id']){delete _0x2c3373[_0xc08b('0x41')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x2c3373[_0xc08b('0x3d')]['id']}})[_0xc08b('0x1f')](handleEntityNotFound(_0x346e0e,null))[_0xc08b('0x1f')](saveUpdates(_0x2c3373[_0xc08b('0x41')],null))[_0xc08b('0x1f')](respondWithResult(_0x346e0e,null))[_0xc08b('0x3c')](handleError(_0x346e0e,null));};exports[_0xc08b('0x1e')]=function(_0x4e560a,_0x44b56e){return db[_0xc08b('0x25')][_0xc08b('0x3f')]({'where':{'id':_0x4e560a['params']['id']}})['then'](handleEntityNotFound(_0x44b56e,null))[_0xc08b('0x1f')](removeEntity(_0x44b56e,null))[_0xc08b('0x3c')](handleError(_0x44b56e,null));};exports[_0xc08b('0x43')]=function(_0x4834d1,_0x4777aa){return db[_0xc08b('0x25')][_0xc08b('0x43')]()[_0xc08b('0x1f')](respondWithResult(_0x4777aa,null))[_0xc08b('0x3c')](handleError(_0x4777aa,null));}; \ No newline at end of file +var _0xda0a=['sort','where','pick','filter','merge','type','options','count','include','rows','show','params','keys','rawAttributes','fields','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceTransferReport','fieldName','key','model','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda0a,0x190));var _0xada0=function(_0x235f28,_0x3fb381){_0x235f28=_0x235f28-0x0;var _0x4a2ad2=_0xda0a[_0x235f28];return _0x4a2ad2;};'use strict';var emlformat=require(_0xada0('0x0'));var rimraf=require(_0xada0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xada0('0x2'));var rp=require(_0xada0('0x3'));var moment=require(_0xada0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xada0('0x5'));var util=require(_0xada0('0x6'));var path=require(_0xada0('0x7'));var sox=require(_0xada0('0x8'));var csv=require(_0xada0('0x9'));var ejs=require(_0xada0('0xa'));var fs=require('fs');var fs_extra=require(_0xada0('0xb'));var _=require(_0xada0('0xc'));var squel=require(_0xada0('0xd'));var crypto=require(_0xada0('0xe'));var jsforce=require(_0xada0('0xf'));var deskjs=require(_0xada0('0x10'));var toCsv=require(_0xada0('0x9'));var querystring=require(_0xada0('0x11'));var Papa=require('papaparse');var Redis=require(_0xada0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xada0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xada0('0x14'));var logger=require('../../config/logger')(_0xada0('0x15'));var utils=require(_0xada0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xada0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24be17,_0x33cf3a){_0x33cf3a=_0x33cf3a||0xcc;return function(_0x5b2911){if(_0x5b2911){return _0x24be17[_0xada0('0x18')](_0x33cf3a);}return _0x24be17[_0xada0('0x19')](_0x33cf3a)[_0xada0('0x1a')]();};}function respondWithResult(_0x1b65aa,_0x466df6){_0x466df6=_0x466df6||0xc8;return function(_0x31e052){if(_0x31e052){return _0x1b65aa[_0xada0('0x19')](_0x466df6)[_0xada0('0x1b')](_0x31e052);}};}function respondWithFilteredResult(_0xf2ca34,_0x154324){return function(_0xef93fa){if(_0xef93fa){var _0x148921=typeof _0x154324['offset']===_0xada0('0x1c')&&typeof _0x154324[_0xada0('0x1d')]===_0xada0('0x1c');var _0xb21483=_0xef93fa['count'];var _0x2c86df=_0x148921?0x0:_0x154324[_0xada0('0x1e')];var _0x6448e5=_0x148921?_0xef93fa['count']:_0x154324['offset']+_0x154324['limit'];var _0x3a1cfc;if(_0x6448e5>=_0xb21483){_0x6448e5=_0xb21483;_0x3a1cfc=0xc8;}else{_0x3a1cfc=0xce;}_0xf2ca34['status'](_0x3a1cfc);return _0xf2ca34[_0xada0('0x1f')](_0xada0('0x20'),_0x2c86df+'-'+_0x6448e5+'/'+_0xb21483)[_0xada0('0x1b')](_0xef93fa);}return null;};}function patchUpdates(_0x50a723){return function(_0x99e25){try{jsonpatch[_0xada0('0x21')](_0x99e25,_0x50a723,!![]);}catch(_0x51e9b4){return BPromise[_0xada0('0x22')](_0x51e9b4);}return _0x99e25[_0xada0('0x23')]();};}function saveUpdates(_0x18b76f,_0x513136){return function(_0x32e4a4){if(_0x32e4a4){return _0x32e4a4[_0xada0('0x24')](_0x18b76f)[_0xada0('0x25')](function(_0x227dcc){return _0x227dcc;});}return null;};}function removeEntity(_0x214757,_0x23ad51){return function(_0x5ae279){if(_0x5ae279){return _0x5ae279['destroy']()[_0xada0('0x25')](function(){_0x214757[_0xada0('0x19')](0xcc)[_0xada0('0x1a')]();});}};}function handleEntityNotFound(_0x4086f3,_0x2eecca){return function(_0x29cb6a){if(!_0x29cb6a){_0x4086f3['sendStatus'](0x194);}return _0x29cb6a;};}function handleError(_0x4de9e0,_0x1ddbea){_0x1ddbea=_0x1ddbea||0x1f4;return function(_0x25d7b9){logger[_0xada0('0x26')](_0x25d7b9[_0xada0('0x27')]);if(_0x25d7b9['name']){delete _0x25d7b9[_0xada0('0x28')];}_0x4de9e0[_0xada0('0x19')](_0x1ddbea)[_0xada0('0x29')](_0x25d7b9);};}exports[_0xada0('0x2a')]=function(_0x44c959,_0x2ab5bb){var _0x14a158={},_0x1d0e4e={},_0x59ddd6={'count':0x0,'rows':[]};var _0xd08030=_[_0xada0('0x2b')](db[_0xada0('0x2c')]['rawAttributes'],function(_0x558235){return{'name':_0x558235[_0xada0('0x2d')],'type':_0x558235['type'][_0xada0('0x2e')]};});_0x1d0e4e[_0xada0('0x2f')]=_[_0xada0('0x2b')](_0xd08030,'name');_0x1d0e4e['query']=_['keys'](_0x44c959['query']);_0x1d0e4e[_0xada0('0x30')]=_[_0xada0('0x31')](_0x1d0e4e[_0xada0('0x2f')],_0x1d0e4e[_0xada0('0x32')]);_0x14a158['attributes']=_[_0xada0('0x31')](_0x1d0e4e[_0xada0('0x2f')],qs['fields'](_0x44c959[_0xada0('0x32')]['fields']));_0x14a158[_0xada0('0x33')]=_0x14a158['attributes'][_0xada0('0x34')]?_0x14a158[_0xada0('0x33')]:_0x1d0e4e['model'];if(!_0x44c959[_0xada0('0x32')][_0xada0('0x35')](_0xada0('0x36'))){_0x14a158[_0xada0('0x1d')]=qs[_0xada0('0x1d')](_0x44c959[_0xada0('0x32')]['limit']);_0x14a158[_0xada0('0x1e')]=qs[_0xada0('0x1e')](_0x44c959[_0xada0('0x32')][_0xada0('0x1e')]);}_0x14a158[_0xada0('0x37')]=qs[_0xada0('0x38')](_0x44c959[_0xada0('0x32')][_0xada0('0x38')]);_0x14a158[_0xada0('0x39')]=qs['filters'](_[_0xada0('0x3a')](_0x44c959[_0xada0('0x32')],_0x1d0e4e[_0xada0('0x30')]),_0xd08030);if(_0x44c959['query'][_0xada0('0x3b')]){_0x14a158['where']=_[_0xada0('0x3c')](_0x14a158['where'],{'$or':_['map'](_0xd08030,function(_0x15ec48){if(_0x15ec48[_0xada0('0x3d')]!=='VIRTUAL'){var _0xf3ec04={};_0xf3ec04[_0x15ec48[_0xada0('0x28')]]={'$like':'%'+_0x44c959[_0xada0('0x32')][_0xada0('0x3b')]+'%'};return _0xf3ec04;}})});}_0x14a158=_['merge']({},_0x14a158,_0x44c959[_0xada0('0x3e')]);var _0x5e2578={'where':_0x14a158['where']};return db['VoiceTransferReport']['count'](_0x5e2578)['then'](function(_0xc9b3a4){_0x59ddd6[_0xada0('0x3f')]=_0xc9b3a4;if(_0x44c959['query']['includeAll']){_0x14a158[_0xada0('0x40')]=[{'all':!![]}];}return db[_0xada0('0x2c')]['findAll'](_0x14a158);})[_0xada0('0x25')](function(_0x28c0dd){_0x59ddd6[_0xada0('0x41')]=_0x28c0dd;return _0x59ddd6;})[_0xada0('0x25')](respondWithFilteredResult(_0x2ab5bb,_0x14a158))['catch'](handleError(_0x2ab5bb,null));};exports[_0xada0('0x42')]=function(_0x3c631c,_0x3fe948){var _0xf317d0={'raw':!![],'where':{'id':_0x3c631c[_0xada0('0x43')]['id']}},_0x14e1eb={};_0x14e1eb[_0xada0('0x2f')]=_[_0xada0('0x44')](db[_0xada0('0x2c')][_0xada0('0x45')]);_0x14e1eb[_0xada0('0x32')]=_['keys'](_0x3c631c[_0xada0('0x32')]);_0x14e1eb['filters']=_[_0xada0('0x31')](_0x14e1eb[_0xada0('0x2f')],_0x14e1eb[_0xada0('0x32')]);_0xf317d0[_0xada0('0x33')]=_[_0xada0('0x31')](_0x14e1eb[_0xada0('0x2f')],qs['fields'](_0x3c631c[_0xada0('0x32')][_0xada0('0x46')]));_0xf317d0[_0xada0('0x33')]=_0xf317d0[_0xada0('0x33')]['length']?_0xf317d0[_0xada0('0x33')]:_0x14e1eb[_0xada0('0x2f')];if(_0x3c631c['query']['includeAll']){_0xf317d0['include']=[{'all':!![]}];}_0xf317d0=_[_0xada0('0x3c')]({},_0xf317d0,_0x3c631c[_0xada0('0x3e')]);return db[_0xada0('0x2c')][_0xada0('0x47')](_0xf317d0)[_0xada0('0x25')](handleEntityNotFound(_0x3fe948,null))['then'](respondWithResult(_0x3fe948,null))[_0xada0('0x48')](handleError(_0x3fe948,null));};exports[_0xada0('0x49')]=function(_0x50e1e8,_0x53307f){return db[_0xada0('0x2c')][_0xada0('0x49')](_0x50e1e8[_0xada0('0x4a')],{})[_0xada0('0x25')](respondWithResult(_0x53307f,0xc9))[_0xada0('0x48')](handleError(_0x53307f,null));};exports[_0xada0('0x24')]=function(_0x2ee25d,_0x3115e3){if(_0x2ee25d[_0xada0('0x4a')]['id']){delete _0x2ee25d[_0xada0('0x4a')]['id'];}return db[_0xada0('0x2c')]['find']({'where':{'id':_0x2ee25d['params']['id']}})[_0xada0('0x25')](handleEntityNotFound(_0x3115e3,null))['then'](saveUpdates(_0x2ee25d[_0xada0('0x4a')],null))[_0xada0('0x25')](respondWithResult(_0x3115e3,null))[_0xada0('0x48')](handleError(_0x3115e3,null));};exports['destroy']=function(_0x218fcb,_0x2d3018){return db[_0xada0('0x2c')][_0xada0('0x47')]({'where':{'id':_0x218fcb['params']['id']}})['then'](handleEntityNotFound(_0x2d3018,null))[_0xada0('0x25')](removeEntity(_0x2d3018,null))['catch'](handleError(_0x2d3018,null));};exports[_0xada0('0x4b')]=function(_0x36e3ea,_0x4d9307){return db[_0xada0('0x2c')][_0xada0('0x4b')]()[_0xada0('0x25')](respondWithResult(_0x4d9307,null))['catch'](handleError(_0x4d9307,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index fa91d71..a0baa20 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 _0xa37b=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceTransferReport.attributes','exports','define'];(function(_0x1ed791,_0x3c86aa){var _0xea6482=function(_0x168cc9){while(--_0x168cc9){_0x1ed791['push'](_0x1ed791['shift']());}};_0xea6482(++_0x3c86aa);}(_0xa37b,0x79));var _0xba37=function(_0x598aa9,_0x36ce33){_0x598aa9=_0x598aa9-0x0;var _0x4ccbc3=_0xa37b[_0x598aa9];return _0x4ccbc3;};'use strict';var _=require(_0xba37('0x0'));var util=require(_0xba37('0x1'));var logger=require(_0xba37('0x2'))(_0xba37('0x3'));var moment=require('moment');var BPromise=require(_0xba37('0x4'));var rp=require(_0xba37('0x5'));var fs=require('fs');var path=require(_0xba37('0x6'));var rimraf=require(_0xba37('0x7'));var config=require('../../config/environment');var attributes=require(_0xba37('0x8'));module[_0xba37('0x9')]=function(_0x5b09c7,_0x447a84){return _0x5b09c7[_0xba37('0xa')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1107=['define','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x869558,_0xf3eeaf){var _0x3cdff8=function(_0x14d4ab){while(--_0x14d4ab){_0x869558['push'](_0x869558['shift']());}};_0x3cdff8(++_0xf3eeaf);}(_0x1107,0xfb));var _0x7110=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0x1107[_0x55fb83];return _0x59a87a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7110('0x0'))(_0x7110('0x1'));var moment=require(_0x7110('0x2'));var BPromise=require(_0x7110('0x3'));var rp=require(_0x7110('0x4'));var fs=require('fs');var path=require(_0x7110('0x5'));var rimraf=require('rimraf');var config=require(_0x7110('0x6'));var attributes=require(_0x7110('0x7'));module[_0x7110('0x8')]=function(_0x1647fb,_0x1f0ef0){return _0x1647fb[_0x7110('0x9')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index a07db6d..b3d769e 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 _0x38d0=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceTransferReport','create','options','raw','info','CreateVoiceTransferReport','debug','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x38d0,0x19b));var _0x038d=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x38d0[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0x038d('0x0'));var moment=require(_0x038d('0x1'));var BPromise=require(_0x038d('0x2'));var rs=require(_0x038d('0x3'));var fs=require('fs');var Redis=require(_0x038d('0x4'));var db=require(_0x038d('0x5'))['db'];var utils=require(_0x038d('0x6'));var logger=require(_0x038d('0x7'))(_0x038d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x038d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3596fe,_0x562aff,_0x2bd9b5){return new BPromise(function(_0x2da51c,_0x24f814){return client[_0x038d('0xa')](_0x3596fe,_0x2bd9b5)[_0x038d('0xb')](function(_0x38e6c2){logger['info'](_0x038d('0xc'),_0x562aff,_0x038d('0xd'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x562aff,_0x038d('0xd'),JSON[_0x038d('0xe')](_0x38e6c2));if(_0x38e6c2[_0x038d('0xf')]){if(_0x38e6c2[_0x038d('0xf')][_0x038d('0x10')]===0x1f4){logger[_0x038d('0xf')](_0x038d('0xc'),_0x562aff,_0x38e6c2[_0x038d('0xf')][_0x038d('0x11')]);return _0x24f814(_0x38e6c2['error'][_0x038d('0x11')]);}logger[_0x038d('0xf')](_0x038d('0xc'),_0x562aff,_0x38e6c2[_0x038d('0xf')][_0x038d('0x11')]);return _0x2da51c(_0x38e6c2[_0x038d('0xf')][_0x038d('0x11')]);}else{logger['info'](_0x038d('0xc'),_0x562aff,'request\x20sent');_0x2da51c(_0x38e6c2['result']['message']);}})['catch'](function(_0x15b9ab){logger['error'](_0x038d('0xc'),_0x562aff,_0x15b9ab);_0x24f814(_0x15b9ab);});});}exports['CreateVoiceTransferReport']=function(_0x42bffa){var _0x14762b=this;return new Promise(function(_0x44299f,_0xb6af9f){return db[_0x038d('0x12')][_0x038d('0x13')](_0x42bffa['body'],{'raw':_0x42bffa[_0x038d('0x14')]?_0x42bffa[_0x038d('0x14')][_0x038d('0x15')]===undefined?!![]:![]:!![]})[_0x038d('0xb')](function(_0x26b2f6){logger[_0x038d('0x16')](_0x038d('0x17'),_0x42bffa);logger[_0x038d('0x18')]('CreateVoiceTransferReport',_0x42bffa,JSON[_0x038d('0xe')](_0x26b2f6));_0x44299f(_0x26b2f6);})[_0x038d('0x19')](function(_0x39749b){logger[_0x038d('0xf')]('CreateVoiceTransferReport',_0x39749b[_0x038d('0x11')],_0x42bffa);_0xb6af9f(_0x14762b[_0x038d('0xf')](0x1f4,_0x39749b[_0x038d('0x11')]));});});}; \ No newline at end of file +var _0x4d63=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VoiceTransferReport','create','body','raw','CreateVoiceTransferReport'];(function(_0x21969e,_0x5c1581){var _0x706446=function(_0x392d47){while(--_0x392d47){_0x21969e['push'](_0x21969e['shift']());}};_0x706446(++_0x5c1581);}(_0x4d63,0x140));var _0x34d6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4d63[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x34d6('0x0'));var util=require(_0x34d6('0x1'));var moment=require(_0x34d6('0x2'));var BPromise=require(_0x34d6('0x3'));var rs=require(_0x34d6('0x4'));var fs=require('fs');var Redis=require(_0x34d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x34d6('0x6'));var logger=require(_0x34d6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x34d6('0x8'));var client=jayson[_0x34d6('0x9')][_0x34d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52c27a,_0x2132c9,_0x15dfbb){return new BPromise(function(_0x1804ff,_0x50184c){return client[_0x34d6('0xb')](_0x52c27a,_0x15dfbb)[_0x34d6('0xc')](function(_0x3c1130){logger['info'](_0x34d6('0xd'),_0x2132c9,_0x34d6('0xe'));logger[_0x34d6('0xf')](_0x34d6('0x10'),_0x2132c9,_0x34d6('0xe'),JSON['stringify'](_0x3c1130));if(_0x3c1130[_0x34d6('0x11')]){if(_0x3c1130[_0x34d6('0x11')][_0x34d6('0x12')]===0x1f4){logger['error'](_0x34d6('0xd'),_0x2132c9,_0x3c1130['error'][_0x34d6('0x13')]);return _0x50184c(_0x3c1130['error'][_0x34d6('0x13')]);}logger[_0x34d6('0x11')](_0x34d6('0xd'),_0x2132c9,_0x3c1130[_0x34d6('0x11')][_0x34d6('0x13')]);return _0x1804ff(_0x3c1130['error'][_0x34d6('0x13')]);}else{logger[_0x34d6('0x14')](_0x34d6('0xd'),_0x2132c9,_0x34d6('0xe'));_0x1804ff(_0x3c1130[_0x34d6('0x15')][_0x34d6('0x13')]);}})[_0x34d6('0x16')](function(_0x7bff46){logger['error'](_0x34d6('0xd'),_0x2132c9,_0x7bff46);_0x50184c(_0x7bff46);});});}exports['CreateVoiceTransferReport']=function(_0x59a144){var _0x48ed0f=this;return new Promise(function(_0x594f3e,_0x35d2d3){return db[_0x34d6('0x17')][_0x34d6('0x18')](_0x59a144[_0x34d6('0x19')],{'raw':_0x59a144['options']?_0x59a144['options'][_0x34d6('0x1a')]===undefined?!![]:![]:!![]})[_0x34d6('0xc')](function(_0x132d12){logger[_0x34d6('0x14')](_0x34d6('0x1b'),_0x59a144);logger['debug'](_0x34d6('0x1b'),_0x59a144,JSON[_0x34d6('0x1c')](_0x132d12));_0x594f3e(_0x132d12);})['catch'](function(_0x131981){logger[_0x34d6('0x11')](_0x34d6('0x1b'),_0x131981[_0x34d6('0x13')],_0x59a144);_0x35d2d3(_0x48ed0f['error'](0x1f4,_0x131981[_0x34d6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index be3e67a..e26c709 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 _0x91a7=['/originate','isWebrtcLicence','/hangup','isAuthenticated','hangup','/answer','answer','post','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller'];(function(_0x5d1df9,_0x4a95bf){var _0x5d4feb=function(_0x37b443){while(--_0x37b443){_0x5d1df9['push'](_0x5d1df9['shift']());}};_0x5d4feb(++_0x4a95bf);}(_0x91a7,0xe7));var _0x791a=function(_0x4486e3,_0x2f38cd){_0x4486e3=_0x4486e3-0x0;var _0x55fdba=_0x91a7[_0x4486e3];return _0x55fdba;};'use strict';var express=require('express');var router=express[_0x791a('0x0')]();var auth=require(_0x791a('0x1'));var controller=require(_0x791a('0x2'));router['post'](_0x791a('0x3'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller['originate']);router['post'](_0x791a('0x5'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x7')]);router['post'](_0x791a('0x8'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x9')]);router[_0x791a('0xa')](_0x791a('0xb'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['hold']);router[_0x791a('0xa')](_0x791a('0xc'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller[_0x791a('0xd')]);router[_0x791a('0xa')](_0x791a('0xe'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['calls']);router['post'](_0x791a('0xf'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x10')]);module[_0x791a('0x11')]=router; \ No newline at end of file +var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x182929,_0x12b9c2){var _0x340d2b=function(_0x53d42c){while(--_0x53d42c){_0x182929['push'](_0x182929['shift']());}};_0x340d2b(++_0x12b9c2);}(_0x5b02,0xe9));var _0x25b0=function(_0x2bb577,_0x2ee496){_0x2bb577=_0x2bb577-0x0;var _0x2f2d6f=_0x5b02[_0x2bb577];return _0x2f2d6f;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 6195c35..13dc14a 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 _0xd87e=['transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','client','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','transferNumber\x20is\x20required','info','emit','log','error','stack','name','status','send','then','code','message','result','catch','User','findOne','agent','all','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','sessionId','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','filter','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0xd87e,0x1bf));var _0xed87=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0xd87e[_0x5751e6];return _0x4199e4;};'use strict';var path=require(_0xed87('0x0'));var fs=require('fs');var _=require(_0xed87('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xed87('0x2'));var util=require(_0xed87('0x3'));var BPromise=require(_0xed87('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xed87('0x5')]['http']({'port':0x232a});var logger=require(_0xed87('0x6'))(_0xed87('0x7'));var Redis=require('ioredis');config[_0xed87('0x8')]=_['defaults'](config['redis'],{'host':_0xed87('0x9'),'port':0x18eb});var io=require(_0xed87('0xa'))(new Redis(config[_0xed87('0x8')]));var Schema=require(_0xed87('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xed87('0xc')]},'callNumber':{'type':_0xed87('0xd'),'required':[!![],_0xed87('0xe')]},'callerId':{'type':_0xed87('0xd')},'callbackUrl':{'type':_0xed87('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xed87('0xd'),'required':[!![],_0xed87('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]},'sessionId':{'type':_0xed87('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xed87('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]}});function emit(_0xd34e0e,_0x173413,_0x2563e4){logger[_0xed87('0x11')](_0xd34e0e,_0x173413,JSON['stringify'](_0x2563e4));io['to'](_0xd34e0e)[_0xed87('0x12')](_0x173413,_0x2563e4);}function handleError(_0x18ab7d){return function(_0x2c386a){console[_0xed87('0x13')]('handleError:',_0x2c386a,_0x2c386a instanceof RangeError);logger[_0xed87('0x14')](_0x2c386a[_0xed87('0x15')]);if(_0x2c386a instanceof RangeError){if(_0x2c386a[_0xed87('0x16')]){delete _0x2c386a[_0xed87('0x16')];}_0x18ab7d[_0xed87('0x17')](0x194)[_0xed87('0x18')](_0x2c386a);}else{if(_0x2c386a[_0xed87('0x16')]){delete _0x2c386a[_0xed87('0x16')];}_0x18ab7d[_0xed87('0x17')](0x1f4)['send'](_0x2c386a);}};}function checkError(){return function(_0x5a7329){if(!_0x5a7329){throw new RangeError('NotFound');}return _0x5a7329;};}function respondWithRpcPromise(_0x47c121,_0x42609e){return new BPromise(function(_0x5d3ec8,_0x4191a7){var _0x2b0b98=amiClient;return _0x2b0b98['request'](_0x47c121,_0x42609e)[_0xed87('0x19')](function(_0x505733){if(_0x505733[_0xed87('0x14')]){if(_0x505733[_0xed87('0x14')][_0xed87('0x1a')]===0x1f4){return _0x4191a7(_0x505733[_0xed87('0x14')][_0xed87('0x1b')]);}return _0x5d3ec8(_0x505733['error'][_0xed87('0x1b')]);}else{_0x5d3ec8(_0x505733[_0xed87('0x1c')]);}})[_0xed87('0x1d')](function(_0x320bcc){_0x4191a7(_0x320bcc);});});}function getAgent(_0x31c600){return db[_0xed87('0x1e')][_0xed87('0x1f')]({'where':{'id':_0x31c600,'role':_0xed87('0x20')}})[_0xed87('0x19')](checkError());}function getAgentCheckSession(_0x38f5c,_0x469181){return new BPromise(function(_0x341a35,_0x16a541){var _0x2b86e2=respondWithRpcPromise('VoiceChannels');var _0xb32b1c=getAgent(_0x38f5c);Promise[_0xed87('0x21')]([_0x2b86e2,_0xb32b1c])['then'](function(_0x3dff74){var _0x33c367=_0x3dff74[0x0];var _0x21c93b=_0x3dff74[0x1];var _0x4b259e=_['filter'](_0x33c367[_0xed87('0x22')],function(_0x428b75){return _0x428b75[_0xed87('0x23')]==_0x21c93b['id']&&_0x428b75['sessionId']==_0x469181;});if(_0x4b259e[_0xed87('0x24')]==0x1){_0x341a35(_0x21c93b);}else{_0x16a541(new RangeError(_0xed87('0x25')+_0x469181+_0xed87('0x26')));}});});}exports[_0xed87('0x27')]=function(_0x114e60,_0x46b9f9){logger[_0xed87('0x11')](_0xed87('0x28'),_0x114e60[_0xed87('0x29')]);var _0x4c0bc0=originateValidation[_0xed87('0xb')](_0x114e60[_0xed87('0x29')]);if(_0x4c0bc0['length']>0x0){return _0x46b9f9[_0xed87('0x17')](0x190)['json'](_0x4c0bc0);}var _0x4430aa=_0x114e60[_0xed87('0x29')][_0xed87('0x2a')];var _0x46b41b=_0x114e60[_0xed87('0x29')][_0xed87('0x2b')];var _0xbd7b69=_0x114e60[_0xed87('0x29')][_0xed87('0x2c')];var _0x6f7b23=_0x114e60[_0xed87('0x29')]['callbackUrl'];return getAgent(_0x4430aa)[_0xed87('0x19')](function(_0x167de8){logger['info'](_0xed87('0x2d'),_0x167de8['name']);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x167de8['name']),_0xed87('0x30'),{'callNumber':_0x46b41b,'callerId':_0xbd7b69,'callbackUrl':_0x6f7b23});return _0x46b9f9[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x32')});})[_0xed87('0x1d')](handleError(_0x46b9f9));};exports['hangup']=function(_0x1ca26d,_0x525a11){logger[_0xed87('0x11')]('hangup\x20fired:',_0x1ca26d[_0xed87('0x29')]);var _0xb6fe59=hangupValidation[_0xed87('0xb')](_0x1ca26d[_0xed87('0x29')]);if(_0xb6fe59[_0xed87('0x24')]>0x0){return _0x525a11[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0xb6fe59);}var _0x161491=_0x1ca26d[_0xed87('0x29')]['userId'];var _0x4b49f8=_0x1ca26d[_0xed87('0x29')][_0xed87('0x33')];return getAgent(_0x161491)[_0xed87('0x19')](function(_0x325112){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x325112['name']);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x325112[_0xed87('0x16')]),'webbar:hangup',{'sessionId':_0x4b49f8});return _0x525a11[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x34')});})[_0xed87('0x1d')](handleError(_0x525a11));};exports[_0xed87('0x35')]=function(_0x151179,_0x315e13){logger[_0xed87('0x11')](_0xed87('0x36'),_0x151179[_0xed87('0x29')]);var _0x5c6925=answerValidation[_0xed87('0xb')](_0x151179[_0xed87('0x29')]);if(_0x5c6925[_0xed87('0x24')]>0x0){return _0x315e13['status'](0x190)['json'](_0x5c6925);}var _0xa31eec=_0x151179[_0xed87('0x29')][_0xed87('0x2a')];var _0x41a658=_0x151179['body'][_0xed87('0x33')];return getAgent(_0xa31eec)[_0xed87('0x19')](function(_0x57fa19){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x57fa19[_0xed87('0x16')]);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x57fa19[_0xed87('0x16')]),_0xed87('0x37'),{'sessionId':_0x41a658});return _0x315e13[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x38')});})[_0xed87('0x1d')](handleError(_0x315e13));};exports['hold']=function(_0x168d7a,_0x122369){logger[_0xed87('0x11')](_0xed87('0x39'),_0x168d7a[_0xed87('0x29')]);var _0x1d3f37=holdValidation[_0xed87('0xb')](_0x168d7a[_0xed87('0x29')]);if(_0x1d3f37[_0xed87('0x24')]>0x0){return _0x122369[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x1d3f37);}var _0x26c8f4=_0x168d7a[_0xed87('0x29')][_0xed87('0x2a')];var _0x2ed9c3=_0x168d7a[_0xed87('0x29')][_0xed87('0x33')];return getAgent(_0x26c8f4)['then'](function(_0x2c7bef){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x2c7bef['name']);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x2c7bef['name']),_0xed87('0x3a'),{'sessionId':_0x2ed9c3});return _0x122369[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x3b')});})['catch'](handleError(_0x122369));};exports[_0xed87('0x3c')]=function(_0x436e15,_0x3ca34c){logger[_0xed87('0x11')](_0xed87('0x3d'),_0x436e15[_0xed87('0x29')]);var _0x242b57=unholdValidation[_0xed87('0xb')](_0x436e15[_0xed87('0x29')]);if(_0x242b57[_0xed87('0x24')]>0x0){return _0x3ca34c[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x242b57);}var _0x2e5a9f=_0x436e15['body'][_0xed87('0x2a')];var _0x4ea4e3=_0x436e15[_0xed87('0x29')][_0xed87('0x33')];return getAgent(_0x2e5a9f)[_0xed87('0x19')](function(_0x27ad77){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x27ad77[_0xed87('0x16')]);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x27ad77[_0xed87('0x16')]),'webbar:unhold',{'sessionId':_0x4ea4e3});return _0x3ca34c[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x3e')});})[_0xed87('0x1d')](handleError(_0x3ca34c));};exports[_0xed87('0x3f')]=function(_0x44b176,_0x1dbadc){logger[_0xed87('0x11')](_0xed87('0x40'),_0x1dbadc[_0xed87('0x29')]);var _0x32db1f=callsValidation['validate'](_0x44b176['body']);if(_0x32db1f[_0xed87('0x24')]>0x0){return _0x1dbadc[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x32db1f);}var _0x2ef4a9=_0x44b176[_0xed87('0x29')]['userId'];var _0x7e6738=respondWithRpcPromise(_0xed87('0x41'));var _0x184e99=getAgent(_0x2ef4a9);return Promise[_0xed87('0x21')]([_0x7e6738,_0x184e99])[_0xed87('0x19')](function(_0x43034f){var _0x15e3bc=_0x43034f[0x0];var _0x1391a2=_0x43034f[0x1];var _0x2ffffa=_[_0xed87('0x42')](_0x15e3bc[_0xed87('0x22')],function(_0x227d19){return _0x227d19[_0xed87('0x23')]==_0x1391a2['id'];});return _0x1dbadc[_0xed87('0x17')](0xc8)['json']({'count':_0x2ffffa[_0xed87('0x24')],'rows':_0x2ffffa});})[_0xed87('0x1d')](handleError(_0x1dbadc));};exports[_0xed87('0x43')]=function(_0x423076,_0x1c6578){logger[_0xed87('0x11')](_0xed87('0x44'),_0x423076[_0xed87('0x29')]);var _0x4b1cc5=conferenceValidation[_0xed87('0xb')](_0x423076[_0xed87('0x29')]);if(_0x4b1cc5[_0xed87('0x24')]>0x0){return _0x1c6578[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x4b1cc5);}var _0x306d9a=_0x423076['body']['userId'];return getAgent(_0x306d9a)[_0xed87('0x19')](function(_0x176bc4){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x176bc4[_0xed87('0x16')]);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x176bc4[_0xed87('0x16')]),'webbar:conference');return _0x1c6578[_0xed87('0x17')](0xc8)['json']({'error':![],'message':_0xed87('0x45')});})[_0xed87('0x1d')](handleError(_0x1c6578));};exports['transfer']=function(_0x11b3a8,_0x30f9d0){logger['info'](_0xed87('0x46'),_0x11b3a8[_0xed87('0x29')]);var _0x2dd1e8=transferValidation[_0xed87('0xb')](_0x11b3a8[_0xed87('0x29')]);if(_0x2dd1e8['length']>0x0){return _0x30f9d0[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x2dd1e8);}var _0x263810=_0x11b3a8[_0xed87('0x29')]['userId'];var _0x58279a=_0x11b3a8[_0xed87('0x29')][_0xed87('0x33')];var _0x52b53f=_0x11b3a8[_0xed87('0x29')][_0xed87('0x47')];return getAgent(_0x263810)[_0xed87('0x19')](function(_0xa1c262){logger[_0xed87('0x11')](_0xed87('0x2d'),_0xa1c262[_0xed87('0x16')]);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0xa1c262[_0xed87('0x16')]),_0xed87('0x48'),{'sessionId':_0x58279a,'transferNumber':_0x52b53f});return _0x30f9d0[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x49')});})['catch'](handleError(_0x30f9d0));}; \ No newline at end of file +var _0x6308=['userId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','status','json','callNumber','callerId','callbackUrl','info','entityFound:','format','user:%s','hangup','hangup\x20fired:','userId','sessionId','webbar:hangup','catch','answer\x20fired:','webbar:answer','hold','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','bluebird','jayson/promise','client','http','../../config/logger','redis','localhost','socket.io-emitter','validate','number','string'];(function(_0x585ac4,_0x93a49d){var _0x1a3499=function(_0x4fb5b4){while(--_0x4fb5b4){_0x585ac4['push'](_0x585ac4['shift']());}};_0x1a3499(++_0x93a49d);}(_0x6308,0x1f2));var _0x8630=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x6308[_0x24061a];return _0x82054e;};'use strict';var path=require(_0x8630('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x8630('0x1'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x8630('0x2'));var jayson=require(_0x8630('0x3'));var amiClient=jayson[_0x8630('0x4')][_0x8630('0x5')]({'port':0x232a});var logger=require(_0x8630('0x6'))('webbarapi');var Redis=require('ioredis');config[_0x8630('0x7')]=_['defaults'](config[_0x8630('0x7')],{'host':_0x8630('0x8'),'port':0x18eb});var io=require(_0x8630('0x9'))(new Redis(config[_0x8630('0x7')]));var Schema=require(_0x8630('0xa'));var originateValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x8630('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x8630('0xc')},'callbackUrl':{'type':_0x8630('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8630('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x8630('0xc'),'required':[!![],_0x8630('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8630('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]}});function emit(_0x49fce1,_0x5c0ba0,_0x3ea754){logger['info'](_0x49fce1,_0x5c0ba0,JSON[_0x8630('0xf')](_0x3ea754));io['to'](_0x49fce1)[_0x8630('0x10')](_0x5c0ba0,_0x3ea754);}function handleError(_0x2c360d){return function(_0x20f462){console[_0x8630('0x11')](_0x8630('0x12'),_0x20f462,_0x20f462 instanceof RangeError);logger[_0x8630('0x13')](_0x20f462[_0x8630('0x14')]);if(_0x20f462 instanceof RangeError){if(_0x20f462[_0x8630('0x15')]){delete _0x20f462['name'];}_0x2c360d['status'](0x194)[_0x8630('0x16')](_0x20f462);}else{if(_0x20f462[_0x8630('0x15')]){delete _0x20f462['name'];}_0x2c360d['status'](0x1f4)[_0x8630('0x16')](_0x20f462);}};}function checkError(){return function(_0x441918){if(!_0x441918){throw new RangeError(_0x8630('0x17'));}return _0x441918;};}function respondWithRpcPromise(_0x491c65,_0x5ce487){return new BPromise(function(_0xcc7454,_0x58c0b5){var _0x30fb4d=amiClient;return _0x30fb4d[_0x8630('0x18')](_0x491c65,_0x5ce487)[_0x8630('0x19')](function(_0x469de3){if(_0x469de3['error']){if(_0x469de3[_0x8630('0x13')][_0x8630('0x1a')]===0x1f4){return _0x58c0b5(_0x469de3[_0x8630('0x13')][_0x8630('0x1b')]);}return _0xcc7454(_0x469de3[_0x8630('0x13')][_0x8630('0x1b')]);}else{_0xcc7454(_0x469de3[_0x8630('0x1c')]);}})['catch'](function(_0x5b2823){_0x58c0b5(_0x5b2823);});});}function getAgent(_0x18fd53){return db[_0x8630('0x1d')][_0x8630('0x1e')]({'where':{'id':_0x18fd53,'role':_0x8630('0x1f')}})[_0x8630('0x19')](checkError());}function getAgentCheckSession(_0x1c012d,_0x149a8e){return new BPromise(function(_0x349c4d,_0x306ca2){var _0x357c15=respondWithRpcPromise(_0x8630('0x20'));var _0x41f74c=getAgent(_0x1c012d);Promise[_0x8630('0x21')]([_0x357c15,_0x41f74c])[_0x8630('0x19')](function(_0xbb1a58){var _0x190216=_0xbb1a58[0x0];var _0x2d3f0b=_0xbb1a58[0x1];var _0x4d42c6=_[_0x8630('0x22')](_0x190216[_0x8630('0x23')],function(_0x24d85d){return _0x24d85d[_0x8630('0x24')]==_0x2d3f0b['id']&&_0x24d85d['sessionId']==_0x149a8e;});if(_0x4d42c6[_0x8630('0x25')]==0x1){_0x349c4d(_0x2d3f0b);}else{_0x306ca2(new RangeError(_0x8630('0x26')+_0x149a8e+_0x8630('0x27')));}});});}exports[_0x8630('0x28')]=function(_0x35b7b2,_0x32f4fd){logger['info'](_0x8630('0x29'),_0x35b7b2[_0x8630('0x2a')]);var _0x24e6af=originateValidation['validate'](_0x35b7b2[_0x8630('0x2a')]);if(_0x24e6af[_0x8630('0x25')]>0x0){return _0x32f4fd[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x24e6af);}var _0x2e0352=_0x35b7b2[_0x8630('0x2a')]['userId'];var _0x7deb1e=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2d')];var _0x16370e=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2e')];var _0x2843a6=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2f')];return getAgent(_0x2e0352)[_0x8630('0x19')](function(_0x396b2c){logger[_0x8630('0x30')](_0x8630('0x31'),_0x396b2c[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x396b2c[_0x8630('0x15')]),'webbar:originate',{'callNumber':_0x7deb1e,'callerId':_0x16370e,'callbackUrl':_0x2843a6});return _0x32f4fd[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x32f4fd));};exports[_0x8630('0x34')]=function(_0x1c2281,_0x28f75d){logger[_0x8630('0x30')](_0x8630('0x35'),_0x1c2281['body']);var _0x21e879=hangupValidation[_0x8630('0xa')](_0x1c2281[_0x8630('0x2a')]);if(_0x21e879[_0x8630('0x25')]>0x0){return _0x28f75d['status'](0x190)[_0x8630('0x2c')](_0x21e879);}var _0x437fde=_0x1c2281[_0x8630('0x2a')][_0x8630('0x36')];var _0x411a5c=_0x1c2281[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x437fde)['then'](function(_0x1076f4){logger[_0x8630('0x30')](_0x8630('0x31'),_0x1076f4[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x1076f4[_0x8630('0x15')]),_0x8630('0x38'),{'sessionId':_0x411a5c});return _0x28f75d[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0x8630('0x39')](handleError(_0x28f75d));};exports['answer']=function(_0x8b40e1,_0x475bb4){logger[_0x8630('0x30')](_0x8630('0x3a'),_0x8b40e1[_0x8630('0x2a')]);var _0x2f1fec=answerValidation['validate'](_0x8b40e1[_0x8630('0x2a')]);if(_0x2f1fec[_0x8630('0x25')]>0x0){return _0x475bb4[_0x8630('0x2b')](0x190)['json'](_0x2f1fec);}var _0x79385=_0x8b40e1[_0x8630('0x2a')][_0x8630('0x36')];var _0x327466=_0x8b40e1[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x79385)['then'](function(_0x348bb3){logger[_0x8630('0x30')](_0x8630('0x31'),_0x348bb3['name']);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x348bb3['name']),_0x8630('0x3b'),{'sessionId':_0x327466});return _0x475bb4[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x475bb4));};exports[_0x8630('0x3c')]=function(_0x4ab99a,_0x4f33bf){logger[_0x8630('0x30')]('hold\x20fired:',_0x4ab99a[_0x8630('0x2a')]);var _0x35a3c8=holdValidation['validate'](_0x4ab99a[_0x8630('0x2a')]);if(_0x35a3c8[_0x8630('0x25')]>0x0){return _0x4f33bf[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x35a3c8);}var _0x121e83=_0x4ab99a['body'][_0x8630('0x36')];var _0x231289=_0x4ab99a['body'][_0x8630('0x37')];return getAgent(_0x121e83)[_0x8630('0x19')](function(_0x3ff20b){logger['info'](_0x8630('0x31'),_0x3ff20b[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x3ff20b[_0x8630('0x15')]),_0x8630('0x3d'),{'sessionId':_0x231289});return _0x4f33bf[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x3e')});})['catch'](handleError(_0x4f33bf));};exports['unhold']=function(_0x1b8328,_0x13326d){logger[_0x8630('0x30')](_0x8630('0x3f'),_0x1b8328[_0x8630('0x2a')]);var _0x24a363=unholdValidation[_0x8630('0xa')](_0x1b8328['body']);if(_0x24a363[_0x8630('0x25')]>0x0){return _0x13326d[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x24a363);}var _0x16c286=_0x1b8328[_0x8630('0x2a')]['userId'];var _0x398ea7=_0x1b8328[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x16c286)[_0x8630('0x19')](function(_0x503f2b){logger[_0x8630('0x30')](_0x8630('0x31'),_0x503f2b['name']);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x503f2b[_0x8630('0x15')]),_0x8630('0x40'),{'sessionId':_0x398ea7});return _0x13326d['status'](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x41')});})['catch'](handleError(_0x13326d));};exports['calls']=function(_0x438a56,_0x9fef86){logger['info'](_0x8630('0x42'),_0x9fef86['body']);var _0x2e49c8=callsValidation[_0x8630('0xa')](_0x438a56[_0x8630('0x2a')]);if(_0x2e49c8['length']>0x0){return _0x9fef86[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x2e49c8);}var _0x7615f5=_0x438a56[_0x8630('0x2a')][_0x8630('0x36')];var _0x1c28dc=respondWithRpcPromise(_0x8630('0x20'));var _0x49c2bc=getAgent(_0x7615f5);return Promise[_0x8630('0x21')]([_0x1c28dc,_0x49c2bc])[_0x8630('0x19')](function(_0x2c3e6e){var _0x50ce41=_0x2c3e6e[0x0];var _0x535add=_0x2c3e6e[0x1];var _0x388e1f=_['filter'](_0x50ce41[_0x8630('0x23')],function(_0x83b818){return _0x83b818['UserId']==_0x535add['id'];});return _0x9fef86[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'count':_0x388e1f[_0x8630('0x25')],'rows':_0x388e1f});})[_0x8630('0x39')](handleError(_0x9fef86));};exports['conference']=function(_0x19af58,_0x1b33c3){logger[_0x8630('0x30')]('conference\x20fired:',_0x19af58['body']);var _0x4d32ac=conferenceValidation[_0x8630('0xa')](_0x19af58[_0x8630('0x2a')]);if(_0x4d32ac[_0x8630('0x25')]>0x0){return _0x1b33c3[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x4d32ac);}var _0x59f0d3=_0x19af58[_0x8630('0x2a')][_0x8630('0x36')];return getAgent(_0x59f0d3)[_0x8630('0x19')](function(_0x4f352b){logger['info'](_0x8630('0x31'),_0x4f352b[_0x8630('0x15')]);emit(util['format'](_0x8630('0x33'),_0x4f352b['name']),_0x8630('0x43'));return _0x1b33c3[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x44')});})[_0x8630('0x39')](handleError(_0x1b33c3));};exports['transfer']=function(_0x5f02ac,_0x5b9d39){logger[_0x8630('0x30')](_0x8630('0x45'),_0x5f02ac[_0x8630('0x2a')]);var _0x3da5cb=transferValidation[_0x8630('0xa')](_0x5f02ac[_0x8630('0x2a')]);if(_0x3da5cb[_0x8630('0x25')]>0x0){return _0x5b9d39[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x3da5cb);}var _0x36a55b=_0x5f02ac[_0x8630('0x2a')][_0x8630('0x36')];var _0x4bccab=_0x5f02ac[_0x8630('0x2a')]['sessionId'];var _0x427d94=_0x5f02ac[_0x8630('0x2a')][_0x8630('0x46')];return getAgent(_0x36a55b)[_0x8630('0x19')](function(_0x4beca1){logger['info'](_0x8630('0x31'),_0x4beca1[_0x8630('0x15')]);emit(util[_0x8630('0x32')]('user:%s',_0x4beca1[_0x8630('0x15')]),_0x8630('0x47'),{'sessionId':_0x4bccab,'transferNumber':_0x427d94});return _0x5b9d39['status'](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x48')});})[_0x8630('0x39')](handleError(_0x5b9d39));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index dd6ccec..b86ccb5 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 _0x781d=['post','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications'];(function(_0xf7c208,_0x5cbc84){var _0x16992d=function(_0x2fe157){while(--_0x2fe157){_0xf7c208['push'](_0xf7c208['shift']());}};_0x16992d(++_0x5cbc84);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd781('0x2'));var router=express[_0xd781('0x3')]();var fs_extra=require(_0xd781('0x4'));var auth=require(_0xd781('0x5'));var interaction=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var controller=require(_0xd781('0x8'));router[_0xd781('0x9')]('/',auth[_0xd781('0xa')](),controller[_0xd781('0xb')]);router['get'](_0xd781('0xc'),auth[_0xd781('0xa')](),controller[_0xd781('0xd')]);router[_0xd781('0x9')]('/:id',auth[_0xd781('0xa')](),controller['show']);router[_0xd781('0x9')](_0xd781('0xe'),auth['isAuthenticated'](),controller[_0xd781('0xf')]);router[_0xd781('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd781('0x10')]);router[_0xd781('0x9')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x12')]);router[_0xd781('0x9')](_0xd781('0x13'),auth[_0xd781('0xa')](),controller[_0xd781('0x14')]);router[_0xd781('0x15')]('/',auth[_0xd781('0xa')](),controller['create']);router[_0xd781('0x15')](_0xd781('0xe'),auth['isAuthenticated'](),controller[_0xd781('0x16')]);router['post'](_0xd781('0x17'),auth[_0xd781('0xa')](),controller[_0xd781('0x18')]);router[_0xd781('0x15')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x19')]);router['post'](_0xd781('0x13'),auth[_0xd781('0xa')](),controller[_0xd781('0x1a')]);router[_0xd781('0x15')](_0xd781('0x1b'),controller[_0xd781('0x1c')]);router[_0xd781('0x15')](_0xd781('0x1d'),auth['isAuthenticated'](),controller[_0xd781('0x1e')]);router[_0xd781('0x1f')](_0xd781('0x20'),auth[_0xd781('0xa')](),controller[_0xd781('0x21')]);router[_0xd781('0x22')](_0xd781('0x20'),auth['isAuthenticated'](),controller[_0xd781('0x23')]);router['delete']('/:id/dispositions',auth[_0xd781('0xa')](),controller['removeDispositions']);router[_0xd781('0x22')](_0xd781('0x17'),auth[_0xd781('0xa')](),controller[_0xd781('0x24')]);router[_0xd781('0x22')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x25')]);module[_0xd781('0x26')]=router; \ No newline at end of file +var _0x7880=['/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','notify','put','update','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x19e57f,_0x4ae750){var _0x469556=function(_0xf6968b){while(--_0xf6968b){_0x19e57f['push'](_0x19e57f['shift']());}};_0x469556(++_0x4ae750);}(_0x7880,0x1f4));var _0x0788=function(_0x314397,_0x550526){_0x314397=_0x314397-0x0;var _0x1ec45e=_0x7880[_0x314397];return _0x1ec45e;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['get'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x11')]);router[_0x0788('0x9')](_0x0788('0x12'),auth['isAuthenticated'](),controller[_0x0788('0x13')]);router[_0x0788('0x9')](_0x0788('0x14'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);router[_0x0788('0x9')](_0x0788('0x16'),auth['isAuthenticated'](),controller[_0x0788('0x17')]);router[_0x0788('0x18')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0x19')]);router['post'](_0x0788('0x10'),auth['isAuthenticated'](),controller[_0x0788('0x1a')]);router[_0x0788('0x18')](_0x0788('0x12'),auth[_0x0788('0xa')](),controller[_0x0788('0x1b')]);router[_0x0788('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x0788('0x1c')]);router[_0x0788('0x18')]('/:id/applications',auth[_0x0788('0xa')](),controller[_0x0788('0x1d')]);router[_0x0788('0x18')]('/:id/notify',controller[_0x0788('0x1e')]);router[_0x0788('0x18')]('/:id/send',auth[_0x0788('0xa')](),controller['send']);router[_0x0788('0x1f')]('/:id',auth[_0x0788('0xa')](),controller[_0x0788('0x20')]);router[_0x0788('0x21')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['destroy']);router['delete'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x22')]);router[_0x0788('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0788('0x23')]);router[_0x0788('0x21')](_0x0788('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0788('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 539df3c..af3a17a 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 _0x8247=['name','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x8247,0x1dc));var _0x7824=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x8247[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x7824('0x0'));var rs=require(_0x7824('0x1'));module[_0x7824('0x2')]={'name':{'type':Sequelize[_0x7824('0x3')],'unique':_0x7824('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7824('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7824('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7824('0x3')],'defaultValue':function(){return rs[_0x7824('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x7824('0x6'),_0x7824('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x7824('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x7824('0x8')],'defaultValue':function(){return _0x7824('0x9');}},'notificationSound':{'type':Sequelize[_0x7824('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7824('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7824('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7824('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7824('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x7824('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x7824('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x396ebf){if(!_0x396ebf){this[_0x7824('0xd')]('mandatoryDispositionPauseId',null);}this[_0x7824('0xd')](_0x7824('0xe'),_0x396ebf);}},'description':{'type':Sequelize[_0x7824('0x3')]}}; \ No newline at end of file +var _0xe811=['sinch','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','name','STRING','generate','ENUM'];(function(_0x561b5b,_0x512287){var _0x284e88=function(_0x1c1b98){while(--_0x1c1b98){_0x561b5b['push'](_0x561b5b['shift']());}};_0x284e88(++_0x512287);}(_0xe811,0x164));var _0x1e81=function(_0x343bb8,_0x34d917){_0x343bb8=_0x343bb8-0x0;var _0x2ca65=_0xe811[_0x343bb8];return _0x2ca65;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1e81('0x0'),'allowNull':![]},'key':{'type':Sequelize[_0x1e81('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x1e81('0x1')],'defaultValue':function(){return rs[_0x1e81('0x2')]();}},'phone':{'type':Sequelize[_0x1e81('0x1')]},'type':{'type':Sequelize[_0x1e81('0x3')]('twilio',_0x1e81('0x4'))},'accountSid':{'type':Sequelize[_0x1e81('0x1')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x1e81('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1e81('0x5')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1e81('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1e81('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1e81('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1e81('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x1e81('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x1e81('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x333593){if(!_0x333593){this['setDataValue'](_0x1e81('0x8'),null);}this[_0x1e81('0x9')]('mandatoryDisposition',_0x333593);}},'description':{'type':Sequelize[_0x1e81('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 2380048..2737cf5 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 _0x66a0=['read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','messageId','MessageSid','sinch','notifications','isNil','Sequelize','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','list','omit','defaults','contact','WhatsappInteraction','interaction','created','autoclose','close','*,*,*,*','ContactId','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','options','rows','length','includeAll','include','merge','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','addDisposition','params','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addAgents','ids','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','priority','finally','send','getApplications','notify','whatsapp','Applications','account','statuses'];(function(_0x4e55aa,_0x48bfd2){var _0x2f48d6=function(_0x29b734){while(--_0x29b734){_0x4e55aa['push'](_0x4e55aa['shift']());}};_0x2f48d6(++_0x48bfd2);}(_0x66a0,0xfb));var _0x066a=function(_0x1e93fa,_0x210f48){_0x1e93fa=_0x1e93fa-0x0;var _0xd4e1e6=_0x66a0[_0x1e93fa];return _0xd4e1e6;};'use strict';var emlformat=require(_0x066a('0x0'));var rimraf=require(_0x066a('0x1'));var zipdir=require(_0x066a('0x2'));var jsonpatch=require(_0x066a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x066a('0x4'));var Mustache=require(_0x066a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x066a('0x6'));var csv=require('to-csv');var ejs=require(_0x066a('0x7'));var fs=require('fs');var fs_extra=require(_0x066a('0x8'));var _=require(_0x066a('0x9'));var squel=require(_0x066a('0xa'));var crypto=require('crypto');var jsforce=require(_0x066a('0xb'));var deskjs=require(_0x066a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x066a('0xd'));var Papa=require(_0x066a('0xe'));var Redis=require(_0x066a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x066a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x066a('0x11'));var logger=require(_0x066a('0x12'))(_0x066a('0x13'));var utils=require(_0x066a('0x14'));var config=require(_0x066a('0x15'));var licenseUtil=require(_0x066a('0x16'));var db=require(_0x066a('0x17'))['db'];config['redis']=_['defaults'](config[_0x066a('0x18')],{'host':_0x066a('0x19'),'port':0x18eb});var socket=require(_0x066a('0x1a'))(new Redis(config[_0x066a('0x18')]));require('./whatsappAccount.socket')[_0x066a('0x1b')](socket);var jayson=require(_0x066a('0x1c'));var client=jayson[_0x066a('0x1d')][_0x066a('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x111663,_0x4c302c,_0x7c22cc,_0x29f4f5){return new BPromise(function(_0x5e5845,_0x35ffe8){var _0x5525c7=_0x29f4f5||client;return _0x5525c7[_0x066a('0x1f')](_0x111663,_0x7c22cc)[_0x066a('0x20')](function(_0x4d0d99){logger['info'](_0x066a('0x21'),_0x4c302c,'request\x20sent');logger[_0x066a('0x22')](_0x066a('0x23'),_0x4c302c,_0x066a('0x24'),JSON[_0x066a('0x25')](_0x4d0d99));if(_0x4d0d99[_0x066a('0x26')]){if(_0x4d0d99[_0x066a('0x26')]['code']===0x1f4){logger[_0x066a('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x4c302c,_0x4d0d99[_0x066a('0x26')][_0x066a('0x27')]);return _0x35ffe8(_0x4d0d99['error'][_0x066a('0x27')]);}logger[_0x066a('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x4c302c,_0x4d0d99[_0x066a('0x26')][_0x066a('0x27')]);return _0x5e5845(_0x4d0d99[_0x066a('0x26')][_0x066a('0x27')]);}else{logger[_0x066a('0x28')](_0x066a('0x21'),_0x4c302c,_0x066a('0x24'));_0x5e5845(_0x4d0d99['result'][_0x066a('0x27')]);}})['catch'](function(_0x474436){logger['error'](_0x066a('0x21'),_0x4c302c,_0x474436);_0x35ffe8(_0x474436);});});}function respondWithStatusCode(_0x3d00d5,_0x5a521f){_0x5a521f=_0x5a521f||0xcc;return function(_0x205341){if(_0x205341){return _0x3d00d5[_0x066a('0x29')](_0x5a521f);}return _0x3d00d5['status'](_0x5a521f)[_0x066a('0x2a')]();};}function respondWithResult(_0x118ba5,_0x5c7377){_0x5c7377=_0x5c7377||0xc8;return function(_0x4f6111){if(_0x4f6111){return _0x118ba5[_0x066a('0x2b')](_0x5c7377)[_0x066a('0x2c')](_0x4f6111);}};}function respondWithFilteredResult(_0x49c974,_0x2dacc1){return function(_0x2cb60d){if(_0x2cb60d){var _0x52d8c1=typeof _0x2dacc1[_0x066a('0x2d')]==='undefined'&&typeof _0x2dacc1['limit']===_0x066a('0x2e');var _0x318fda=_0x2cb60d[_0x066a('0x2f')];var _0x40ea4c=_0x52d8c1?0x0:_0x2dacc1[_0x066a('0x2d')];var _0x1f61b8=_0x52d8c1?_0x2cb60d[_0x066a('0x2f')]:_0x2dacc1[_0x066a('0x2d')]+_0x2dacc1[_0x066a('0x30')];var _0x51b3c2;if(_0x1f61b8>=_0x318fda){_0x1f61b8=_0x318fda;_0x51b3c2=0xc8;}else{_0x51b3c2=0xce;}_0x49c974[_0x066a('0x2b')](_0x51b3c2);return _0x49c974['set'](_0x066a('0x31'),_0x40ea4c+'-'+_0x1f61b8+'/'+_0x318fda)[_0x066a('0x2c')](_0x2cb60d);}return null;};}function patchUpdates(_0x10518f){return function(_0x58d603){try{jsonpatch[_0x066a('0x32')](_0x58d603,_0x10518f,!![]);}catch(_0x456316){return BPromise[_0x066a('0x33')](_0x456316);}return _0x58d603[_0x066a('0x34')]();};}function saveUpdates(_0x3b4097,_0x5234b9){return function(_0x52bdbe){if(_0x52bdbe){return _0x52bdbe[_0x066a('0x35')](_0x3b4097)[_0x066a('0x20')](function(_0x267ab5){return _0x267ab5;});}return null;};}function removeEntity(_0x992ea3,_0x4670a9){return function(_0x1deccd){if(_0x1deccd){return _0x1deccd[_0x066a('0x36')]()['then'](function(){var _0x46dd6f=_0x1deccd[_0x066a('0x37')]({'plain':!![]});var _0x273019=_0x066a('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0x273019,'resourceId':_0x46dd6f['id']}})[_0x066a('0x20')](function(){return _0x1deccd;});})[_0x066a('0x20')](function(){_0x992ea3[_0x066a('0x2b')](0xcc)[_0x066a('0x2a')]();});}};}function handleEntityNotFound(_0x22b42b,_0x2ed17b){return function(_0x4b6b30){if(!_0x4b6b30){_0x22b42b[_0x066a('0x29')](0x194);}return _0x4b6b30;};}function handleError(_0x2b63d8,_0x4440d2){_0x4440d2=_0x4440d2||0x1f4;return function(_0x23491a){logger[_0x066a('0x26')](_0x23491a[_0x066a('0x39')]);if(_0x23491a[_0x066a('0x3a')]){delete _0x23491a[_0x066a('0x3a')];}_0x2b63d8[_0x066a('0x2b')](_0x4440d2)['send'](_0x23491a);};}exports[_0x066a('0x3b')]=function(_0x1c5521,_0x29ecf6){var _0x4b9d97={'include':[{'model':db[_0x066a('0x3c')],'as':_0x066a('0x3d')}]},_0x19455a={},_0x2ffc9b={'count':0x0,'rows':[]};var _0x1b065a=_[_0x066a('0x3e')](db[_0x066a('0x3f')][_0x066a('0x40')],function(_0x25030f){return{'name':_0x25030f[_0x066a('0x41')],'type':_0x25030f[_0x066a('0x42')][_0x066a('0x43')]};});_0x19455a[_0x066a('0x44')]=_['map'](_0x1b065a,'name');_0x19455a[_0x066a('0x45')]=_[_0x066a('0x46')](_0x1c5521[_0x066a('0x45')]);_0x19455a[_0x066a('0x47')]=_[_0x066a('0x48')](_0x19455a[_0x066a('0x44')],_0x19455a[_0x066a('0x45')]);_0x4b9d97[_0x066a('0x49')]=_[_0x066a('0x48')](_0x19455a[_0x066a('0x44')],qs['fields'](_0x1c5521[_0x066a('0x45')][_0x066a('0x4a')]));_0x4b9d97[_0x066a('0x49')]=_0x4b9d97[_0x066a('0x49')]['length']?_0x4b9d97[_0x066a('0x49')]:_0x19455a[_0x066a('0x44')];if(!_0x1c5521[_0x066a('0x45')]['hasOwnProperty'](_0x066a('0x4b'))){_0x4b9d97[_0x066a('0x30')]=qs[_0x066a('0x30')](_0x1c5521[_0x066a('0x45')][_0x066a('0x30')]);_0x4b9d97['offset']=qs['offset'](_0x1c5521[_0x066a('0x45')][_0x066a('0x2d')]);}_0x4b9d97[_0x066a('0x4c')]=qs[_0x066a('0x4d')](_0x1c5521[_0x066a('0x45')][_0x066a('0x4d')]);_0x4b9d97[_0x066a('0x4e')]=qs[_0x066a('0x47')](_[_0x066a('0x4f')](_0x1c5521[_0x066a('0x45')],_0x19455a[_0x066a('0x47')]),_0x1b065a);if(_0x1c5521[_0x066a('0x45')][_0x066a('0x50')]){_0x4b9d97['where']=_['merge'](_0x4b9d97[_0x066a('0x4e')],{'$or':_[_0x066a('0x3e')](_0x1b065a,function(_0x3154d4){if(_0x3154d4[_0x066a('0x42')]!==_0x066a('0x51')){var _0x3c3dea={};_0x3c3dea[_0x3154d4[_0x066a('0x3a')]]={'$like':'%'+_0x1c5521['query'][_0x066a('0x50')]+'%'};return _0x3c3dea;}})});}_0x4b9d97=_['merge']({},_0x4b9d97,_0x1c5521[_0x066a('0x52')]);var _0x303fa6={'where':_0x4b9d97[_0x066a('0x4e')]};return db[_0x066a('0x3f')]['count'](_0x303fa6)[_0x066a('0x20')](function(_0x30b572){_0x2ffc9b[_0x066a('0x2f')]=_0x30b572;if(_0x1c5521[_0x066a('0x45')]['includeAll']){_0x4b9d97['include']=[{'all':!![]}];}return db[_0x066a('0x3f')]['findAll'](_0x4b9d97);})[_0x066a('0x20')](function(_0x4bb0d7){_0x2ffc9b[_0x066a('0x53')]=_0x4bb0d7;return _0x2ffc9b;})['then'](respondWithFilteredResult(_0x29ecf6,_0x4b9d97))['catch'](handleError(_0x29ecf6,null));};exports['show']=function(_0x4216ae,_0x1471e0){var _0x3489a1={'raw':![],'where':{'id':_0x4216ae['params']['id']},'include':[{'model':db[_0x066a('0x3c')],'as':_0x066a('0x3d')}]},_0x1a6990={};_0x1a6990[_0x066a('0x44')]=_[_0x066a('0x46')](db[_0x066a('0x3f')][_0x066a('0x40')]);_0x1a6990[_0x066a('0x45')]=_['keys'](_0x4216ae[_0x066a('0x45')]);_0x1a6990[_0x066a('0x47')]=_['intersection'](_0x1a6990[_0x066a('0x44')],_0x1a6990[_0x066a('0x45')]);_0x3489a1[_0x066a('0x49')]=_[_0x066a('0x48')](_0x1a6990[_0x066a('0x44')],qs[_0x066a('0x4a')](_0x4216ae[_0x066a('0x45')][_0x066a('0x4a')]));_0x3489a1[_0x066a('0x49')]=_0x3489a1[_0x066a('0x49')][_0x066a('0x54')]?_0x3489a1[_0x066a('0x49')]:_0x1a6990['model'];if(_0x4216ae[_0x066a('0x45')][_0x066a('0x55')]){_0x3489a1[_0x066a('0x56')]=[{'all':!![]}];}_0x3489a1=_[_0x066a('0x57')]({},_0x3489a1,_0x4216ae['options']);return db[_0x066a('0x3f')][_0x066a('0x58')](_0x3489a1)[_0x066a('0x20')](handleEntityNotFound(_0x1471e0,null))[_0x066a('0x20')](respondWithResult(_0x1471e0,null))[_0x066a('0x59')](handleError(_0x1471e0,null));};exports[_0x066a('0x5a')]=function(_0x2fe299,_0x156a04){return db[_0x066a('0x3f')][_0x066a('0x5a')](_0x2fe299['body'],{})['then'](function(_0x419456){var _0x39955c=_0x2fe299[_0x066a('0x5b')]['get']({'plain':!![]});if(!_0x39955c)throw new Error(_0x066a('0x5c'));if(_0x39955c['role']==='user'){var _0x413413=_0x419456[_0x066a('0x37')]({'plain':!![]});var _0x1795f8=_0x066a('0x38');return db[_0x066a('0x5d')][_0x066a('0x58')]({'where':{'name':_0x1795f8,'userProfileId':_0x39955c[_0x066a('0x5e')]},'raw':!![]})[_0x066a('0x20')](function(_0x1fef34){if(_0x1fef34&&_0x1fef34[_0x066a('0x5f')]===0x0){return db[_0x066a('0x60')]['create']({'name':_0x413413[_0x066a('0x3a')],'resourceId':_0x413413['id'],'type':_0x1fef34[_0x066a('0x3a')],'sectionId':_0x1fef34['id']},{})['then'](function(){return _0x419456;});}else{return _0x419456;}})[_0x066a('0x59')](function(_0x548534){logger[_0x066a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x548534);throw _0x548534;});}return _0x419456;})[_0x066a('0x20')](respondWithResult(_0x156a04,0xc9))[_0x066a('0x59')](handleError(_0x156a04,null));};exports[_0x066a('0x35')]=function(_0x3c6296,_0x549237){if(_0x3c6296[_0x066a('0x61')]['id']){delete _0x3c6296[_0x066a('0x61')]['id'];}return db[_0x066a('0x3f')][_0x066a('0x58')]({'where':{'id':_0x3c6296['params']['id']},'include':[{'model':db[_0x066a('0x3c')],'as':_0x066a('0x3d')}]})['then'](handleEntityNotFound(_0x549237,null))['then'](saveUpdates(_0x3c6296['body'],null))[_0x066a('0x20')](respondWithResult(_0x549237,null))['catch'](handleError(_0x549237,null));};exports[_0x066a('0x36')]=function(_0x40b556,_0x5581d2){return db[_0x066a('0x3f')][_0x066a('0x58')]({'where':{'id':_0x40b556['params']['id']}})[_0x066a('0x20')](handleEntityNotFound(_0x5581d2,null))[_0x066a('0x20')](removeEntity(_0x5581d2,null))[_0x066a('0x59')](handleError(_0x5581d2,null));};exports[_0x066a('0x62')]=function(_0x123e4e,_0x1c980b){return db[_0x066a('0x3f')][_0x066a('0x62')]()[_0x066a('0x20')](respondWithResult(_0x1c980b,null))['catch'](handleError(_0x1c980b,null));};exports[_0x066a('0x63')]=function(_0x5cf07d,_0x485bd4,_0x3ebbb1){if(_0x5cf07d['body']['id']){delete _0x5cf07d[_0x066a('0x61')]['id'];}return db[_0x066a('0x3f')]['find']({'where':{'id':_0x5cf07d[_0x066a('0x64')]['id']}})[_0x066a('0x20')](handleEntityNotFound(_0x485bd4,null))[_0x066a('0x20')](function(_0x3291d0){if(_0x3291d0){_0x5cf07d['body'][_0x066a('0x65')]=_0x3291d0['id'];return db[_0x066a('0x66')]['create'](_0x5cf07d[_0x066a('0x61')]);}})['then'](respondWithResult(_0x485bd4,null))[_0x066a('0x59')](handleError(_0x485bd4,null));};exports[_0x066a('0x67')]=function(_0x3bc3b1,_0x2184d7,_0x51fcd0){var _0x1537d2={'raw':![],'where':{}};var _0x437ff4={};var _0x37f4c6={'count':0x0,'rows':[]};return db[_0x066a('0x3f')][_0x066a('0x68')]({'where':{'id':_0x3bc3b1[_0x066a('0x64')]['id']}})['then'](handleEntityNotFound(_0x2184d7,null))['then'](function(_0x30591a){if(_0x30591a){_0x437ff4[_0x066a('0x44')]=_[_0x066a('0x46')](db[_0x066a('0x66')]['rawAttributes']);_0x437ff4[_0x066a('0x45')]=_['keys'](_0x3bc3b1[_0x066a('0x45')]);_0x437ff4[_0x066a('0x47')]=_['intersection'](_0x437ff4[_0x066a('0x44')],_0x437ff4[_0x066a('0x45')]);_0x1537d2[_0x066a('0x49')]=_[_0x066a('0x48')](_0x437ff4[_0x066a('0x44')],qs['fields'](_0x3bc3b1['query'][_0x066a('0x4a')]));_0x1537d2[_0x066a('0x49')]=_0x1537d2['attributes'][_0x066a('0x54')]?_0x1537d2[_0x066a('0x49')]:_0x437ff4['model'];if(!_0x3bc3b1[_0x066a('0x45')]['hasOwnProperty'](_0x066a('0x4b'))){_0x1537d2[_0x066a('0x30')]=qs[_0x066a('0x30')](_0x3bc3b1[_0x066a('0x45')][_0x066a('0x30')]);_0x1537d2[_0x066a('0x2d')]=qs['offset'](_0x3bc3b1[_0x066a('0x45')][_0x066a('0x2d')]);}_0x1537d2[_0x066a('0x4c')]=qs[_0x066a('0x4d')](_0x3bc3b1[_0x066a('0x45')]['sort']);_0x1537d2[_0x066a('0x4e')]=qs[_0x066a('0x47')](_[_0x066a('0x4f')](_0x3bc3b1[_0x066a('0x45')],_0x437ff4['filters']));_0x1537d2[_0x066a('0x4e')][_0x066a('0x65')]=_0x30591a['id'];if(_0x3bc3b1[_0x066a('0x45')][_0x066a('0x50')]){_0x1537d2['where']=_[_0x066a('0x57')](_0x1537d2[_0x066a('0x4e')],{'$or':_['map'](_0x1537d2['attributes'],function(_0x30f1cb){var _0x2ab21b={};_0x2ab21b[_0x30f1cb]={'$like':'%'+_0x3bc3b1[_0x066a('0x45')]['filter']+'%'};return _0x2ab21b;})});}_0x1537d2=_['merge']({},_0x1537d2,_0x3bc3b1[_0x066a('0x52')]);return db[_0x066a('0x66')][_0x066a('0x2f')]({'where':_0x1537d2[_0x066a('0x4e')]})[_0x066a('0x20')](function(_0x32cb4d){_0x37f4c6[_0x066a('0x2f')]=_0x32cb4d;if(_0x3bc3b1[_0x066a('0x45')][_0x066a('0x55')]){_0x1537d2['include']=[{'all':!![]}];}return db[_0x066a('0x66')][_0x066a('0x69')](_0x1537d2);})[_0x066a('0x20')](function(_0x3e8187){_0x37f4c6[_0x066a('0x53')]=_0x3e8187;return _0x37f4c6;});}})[_0x066a('0x20')](respondWithFilteredResult(_0x2184d7,_0x1537d2))['catch'](handleError(_0x2184d7,null));};exports['removeDispositions']=function(_0x5f5817,_0x533539,_0x5452a9){return db[_0x066a('0x3f')][_0x066a('0x58')]({'where':{'id':_0x5f5817[_0x066a('0x64')]['id']}})[_0x066a('0x20')](handleEntityNotFound(_0x533539,null))[_0x066a('0x20')](function(_0xf85e7e){if(_0xf85e7e){return _0xf85e7e[_0x066a('0x6a')](_0x5f5817[_0x066a('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x533539,null))[_0x066a('0x59')](handleError(_0x533539,null));};exports[_0x066a('0x6b')]=function(_0x453efe,_0x2e090b,_0x29e09c){if(_0x453efe['body']['id']){delete _0x453efe[_0x066a('0x61')]['id'];}return db['WhatsappAccount'][_0x066a('0x58')]({'where':{'id':_0x453efe[_0x066a('0x64')]['id']}})[_0x066a('0x20')](handleEntityNotFound(_0x2e090b,null))[_0x066a('0x20')](function(_0x5d8a4c){if(_0x5d8a4c){_0x453efe[_0x066a('0x61')][_0x066a('0x65')]=_0x5d8a4c['id'];return db[_0x066a('0x6c')][_0x066a('0x5a')](_0x453efe[_0x066a('0x61')]);}})['then'](respondWithResult(_0x2e090b,null))['catch'](handleError(_0x2e090b,null));};exports[_0x066a('0x6d')]=function(_0x4803c1,_0x22356d,_0x5ae117){var _0x290e12={'raw':![],'where':{}};var _0x3af147={};var _0x7daaea={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x4803c1[_0x066a('0x64')]['id']}})[_0x066a('0x20')](handleEntityNotFound(_0x22356d,null))['then'](function(_0x5ba0dd){if(_0x5ba0dd){_0x3af147['model']=_[_0x066a('0x46')](db[_0x066a('0x6c')][_0x066a('0x40')]);_0x3af147[_0x066a('0x45')]=_['keys'](_0x4803c1['query']);_0x3af147[_0x066a('0x47')]=_[_0x066a('0x48')](_0x3af147[_0x066a('0x44')],_0x3af147[_0x066a('0x45')]);_0x290e12[_0x066a('0x49')]=_[_0x066a('0x48')](_0x3af147[_0x066a('0x44')],qs[_0x066a('0x4a')](_0x4803c1['query'][_0x066a('0x4a')]));_0x290e12['attributes']=_0x290e12['attributes']['length']?_0x290e12[_0x066a('0x49')]:_0x3af147['model'];if(!_0x4803c1['query'][_0x066a('0x6e')]('nolimit')){_0x290e12[_0x066a('0x30')]=qs[_0x066a('0x30')](_0x4803c1[_0x066a('0x45')]['limit']);_0x290e12[_0x066a('0x2d')]=qs[_0x066a('0x2d')](_0x4803c1[_0x066a('0x45')]['offset']);}_0x290e12[_0x066a('0x4c')]=qs['sort'](_0x4803c1[_0x066a('0x45')][_0x066a('0x4d')]);_0x290e12[_0x066a('0x4e')]=qs[_0x066a('0x47')](_[_0x066a('0x4f')](_0x4803c1['query'],_0x3af147['filters']));_0x290e12[_0x066a('0x4e')][_0x066a('0x65')]=_0x5ba0dd['id'];if(_0x4803c1[_0x066a('0x45')]['filter']){_0x290e12[_0x066a('0x4e')]=_['merge'](_0x290e12[_0x066a('0x4e')],{'$or':_[_0x066a('0x3e')](_0x290e12[_0x066a('0x49')],function(_0x2c8c43){var _0x1be574={};_0x1be574[_0x2c8c43]={'$like':'%'+_0x4803c1['query'][_0x066a('0x50')]+'%'};return _0x1be574;})});}_0x290e12=_[_0x066a('0x57')]({},_0x290e12,_0x4803c1[_0x066a('0x52')]);return db[_0x066a('0x6c')][_0x066a('0x2f')]({'where':_0x290e12['where']})['then'](function(_0x1efbb5){_0x7daaea[_0x066a('0x2f')]=_0x1efbb5;if(_0x4803c1[_0x066a('0x45')][_0x066a('0x55')]){_0x290e12[_0x066a('0x56')]=[{'all':!![]}];}return db[_0x066a('0x6c')][_0x066a('0x69')](_0x290e12);})[_0x066a('0x20')](function(_0x19e962){_0x7daaea[_0x066a('0x53')]=_0x19e962;return _0x7daaea;});}})[_0x066a('0x20')](respondWithFilteredResult(_0x22356d,_0x290e12))[_0x066a('0x59')](handleError(_0x22356d,null));};exports['removeAnswers']=function(_0x3a79d4,_0x57a29a,_0x23b384){return db[_0x066a('0x3f')]['find']({'where':{'id':_0x3a79d4['params']['id']}})[_0x066a('0x20')](handleEntityNotFound(_0x57a29a,null))[_0x066a('0x20')](function(_0x26cf85){if(_0x26cf85){return _0x26cf85[_0x066a('0x6f')](_0x3a79d4[_0x066a('0x45')]['ids']);}})[_0x066a('0x20')](respondWithStatusCode(_0x57a29a,null))['catch'](handleError(_0x57a29a,null));};exports[_0x066a('0x70')]=function(_0x53cf02,_0x55dd86,_0x5504c8){return db[_0x066a('0x3f')][_0x066a('0x58')]({'where':{'id':_0x53cf02[_0x066a('0x64')]['id']}})[_0x066a('0x20')](handleEntityNotFound(_0x55dd86,null))['then'](function(_0x1733c9){if(_0x1733c9){return _0x1733c9[_0x066a('0x70')](_0x53cf02[_0x066a('0x61')][_0x066a('0x71')],_['omit'](_0x53cf02[_0x066a('0x61')],['ids','id'])||{})[_0x066a('0x72')](function(_0x2c4096){for(var _0x2ac1df=0x0;_0x2ac1df<_0x53cf02[_0x066a('0x61')][_0x066a('0x71')][_0x066a('0x54')];_0x2ac1df+=0x1){socket[_0x066a('0x73')](_0x066a('0x74'),{'UserId':Number(_0x53cf02[_0x066a('0x61')][_0x066a('0x71')][_0x2ac1df]),'WhatsappAccountId':Number(_0x53cf02[_0x066a('0x64')]['id'])});}return _0x2c4096;});}})[_0x066a('0x20')](respondWithResult(_0x55dd86,null))[_0x066a('0x59')](handleError(_0x55dd86,null));};exports[_0x066a('0x75')]=function(_0x3390b9,_0xd64db2,_0x26a2a0){return db['WhatsappAccount'][_0x066a('0x58')]({'where':{'id':_0x3390b9[_0x066a('0x64')]['id']}})[_0x066a('0x20')](handleEntityNotFound(_0xd64db2,null))[_0x066a('0x20')](function(_0x5bc426){if(_0x5bc426){return _0x5bc426[_0x066a('0x75')](_0x3390b9[_0x066a('0x45')][_0x066a('0x71')])['then'](function(){if(_[_0x066a('0x76')](_0x3390b9[_0x066a('0x45')]['ids'])){for(var _0x48ceec=0x0;_0x48ceec<_0x3390b9[_0x066a('0x45')][_0x066a('0x71')]['length'];_0x48ceec+=0x1){socket['emit'](_0x066a('0x77'),{'UserId':Number(_0x3390b9['query']['ids'][_0x48ceec]),'WhatsappAccountId':Number(_0x3390b9[_0x066a('0x64')]['id'])});}}else{socket['emit'](_0x066a('0x77'),{'UserId':Number(_0x3390b9['query']['ids']),'WhatsappAccountId':Number(_0x3390b9[_0x066a('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0xd64db2,null))[_0x066a('0x59')](handleError(_0xd64db2,null));};exports['getAgents']=function(_0x127b44,_0x187830,_0x35f057){var _0x1b42db={};var _0x7125b4={};var _0x7addd0;var _0x276dff;return db[_0x066a('0x3f')][_0x066a('0x68')]({'where':{'id':_0x127b44[_0x066a('0x64')]['id']}})[_0x066a('0x20')](handleEntityNotFound(_0x187830,null))[_0x066a('0x20')](function(_0x40d0b0){if(_0x40d0b0){_0x7addd0=_0x40d0b0;_0x7125b4[_0x066a('0x44')]=_[_0x066a('0x46')](db[_0x066a('0x78')][_0x066a('0x40')]);_0x7125b4[_0x066a('0x45')]=_[_0x066a('0x46')](_0x127b44[_0x066a('0x45')]);_0x7125b4[_0x066a('0x47')]=_[_0x066a('0x48')](_0x7125b4[_0x066a('0x44')],_0x7125b4[_0x066a('0x45')]);_0x1b42db[_0x066a('0x49')]=_[_0x066a('0x48')](_0x7125b4['model'],qs['fields'](_0x127b44[_0x066a('0x45')]['fields']));_0x1b42db[_0x066a('0x49')]=_0x1b42db[_0x066a('0x49')][_0x066a('0x54')]?_0x1b42db['attributes']:_0x7125b4[_0x066a('0x44')];_0x1b42db[_0x066a('0x4c')]=qs['sort'](_0x127b44[_0x066a('0x45')][_0x066a('0x4d')]);_0x1b42db['where']=qs[_0x066a('0x47')](_[_0x066a('0x4f')](_0x127b44[_0x066a('0x45')],_0x7125b4[_0x066a('0x47')]));if(_0x127b44[_0x066a('0x45')]['filter']){_0x1b42db[_0x066a('0x4e')]=_[_0x066a('0x57')](_0x1b42db[_0x066a('0x4e')],{'$or':_[_0x066a('0x3e')](_0x1b42db[_0x066a('0x49')],function(_0xd5007){var _0x3ef23e={};_0x3ef23e[_0xd5007]={'$like':'%'+_0x127b44[_0x066a('0x45')][_0x066a('0x50')]+'%'};return _0x3ef23e;})});}_0x1b42db=_[_0x066a('0x57')]({},_0x1b42db,_0x127b44[_0x066a('0x52')]);return _0x7addd0[_0x066a('0x79')](_0x1b42db);}})['then'](function(_0x5a59fb){if(_0x5a59fb){_0x276dff=_0x5a59fb['length'];if(!_0x127b44['query']['hasOwnProperty'](_0x066a('0x4b'))){_0x1b42db[_0x066a('0x30')]=qs[_0x066a('0x30')](_0x127b44['query'][_0x066a('0x30')]);_0x1b42db[_0x066a('0x2d')]=qs[_0x066a('0x2d')](_0x127b44[_0x066a('0x45')][_0x066a('0x2d')]);}return _0x7addd0[_0x066a('0x79')](_0x1b42db);}})['then'](function(_0x89b301){if(_0x89b301){return _0x89b301?{'count':_0x276dff,'rows':_0x89b301}:null;}})[_0x066a('0x20')](respondWithResult(_0x187830,null))[_0x066a('0x59')](handleError(_0x187830,null));};exports[_0x066a('0x7a')]=function(_0x3f059b,_0x18477b){var _0x36f69c=_0x3f059b['params']['id'];var _0x2a762a=_0x3f059b[_0x066a('0x61')];var _0x5bc0ea=0xc8;var _0x196f73=null;return db[_0x066a('0x7b')][_0x066a('0x7c')]({'isolationLevel':db['sequelize'][_0x066a('0x7d')][_0x066a('0x7e')]['READ_COMMITTED']},function(_0x261497){return db['WhatsappAccount'][_0x066a('0x68')]({'where':{'id':_0x36f69c},'transaction':_0x261497})['then'](function(_0x19844c){if(_0x19844c){return db['WhatsappApplication'][_0x066a('0x36')]({'where':{'WhatsappAccountId':_0x36f69c},'transaction':_0x261497})[_0x066a('0x20')](function(){var _0x392a03=_[_0x066a('0x3e')](_0x2a762a,function(_0x12c367){_0x12c367[_0x066a('0x65')]=_0x36f69c;return _0x12c367;});return db[_0x066a('0x7f')]['bulkCreate'](_0x392a03,{'transaction':_0x261497});});}else{_0x5bc0ea=0x194;_0x196f73=[];}});})['then'](function(){if(_0x5bc0ea!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x36f69c},'order':_0x066a('0x80')})['then'](function(_0xd7de92){_0x196f73=_0xd7de92;});}})['catch'](function(_0x10fd76){_0x5bc0ea=0x1f4;logger[_0x066a('0x26')](_0x10fd76['stack']);if(_0x10fd76[_0x066a('0x3a')]){delete _0x10fd76[_0x066a('0x3a')];}_0x196f73=_0x10fd76;})[_0x066a('0x81')](function(){if(_0x196f73===null){_0x18477b['sendStatus'](_0x5bc0ea);}else{if(_0x5bc0ea===0x1f4){_0x18477b[_0x066a('0x2b')](_0x5bc0ea)[_0x066a('0x82')](_0x196f73);}else{_0x18477b[_0x066a('0x2b')](_0x5bc0ea)[_0x066a('0x2c')](_0x196f73);}}});};exports[_0x066a('0x83')]=function(_0x9104d0,_0x51c727,_0x3b5553){var _0x4e0f14={};var _0x5017a9={};var _0x598c06;var _0x545af5;return db['WhatsappAccount'][_0x066a('0x68')]({'where':{'id':_0x9104d0[_0x066a('0x64')]['id']}})['then'](handleEntityNotFound(_0x51c727,null))[_0x066a('0x20')](function(_0x410fa6){if(_0x410fa6){_0x598c06=_0x410fa6;_0x5017a9[_0x066a('0x44')]=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x5017a9['query']=_['keys'](_0x9104d0[_0x066a('0x45')]);_0x5017a9[_0x066a('0x47')]=_[_0x066a('0x48')](_0x5017a9[_0x066a('0x44')],_0x5017a9['query']);_0x4e0f14[_0x066a('0x49')]=_['intersection'](_0x5017a9[_0x066a('0x44')],qs[_0x066a('0x4a')](_0x9104d0['query'][_0x066a('0x4a')]));_0x4e0f14['attributes']=_0x4e0f14[_0x066a('0x49')][_0x066a('0x54')]?_0x4e0f14[_0x066a('0x49')]:_0x5017a9[_0x066a('0x44')];_0x4e0f14['order']=qs['sort'](_0x9104d0[_0x066a('0x45')][_0x066a('0x4d')]);_0x4e0f14[_0x066a('0x4e')]=qs['filters'](_[_0x066a('0x4f')](_0x9104d0[_0x066a('0x45')],_0x5017a9[_0x066a('0x47')]));if(_0x9104d0[_0x066a('0x45')][_0x066a('0x50')]){_0x4e0f14[_0x066a('0x4e')]=_[_0x066a('0x57')](_0x4e0f14[_0x066a('0x4e')],{'$or':_[_0x066a('0x3e')](_0x4e0f14[_0x066a('0x49')],function(_0x2294fa){var _0x3569b4={};_0x3569b4[_0x2294fa]={'$like':'%'+_0x9104d0['query']['filter']+'%'};return _0x3569b4;})});}_0x4e0f14=_['merge']({},_0x4e0f14,_0x9104d0[_0x066a('0x52')]);return _0x598c06[_0x066a('0x83')](_0x4e0f14);}})[_0x066a('0x20')](function(_0x50a933){if(_0x50a933){_0x545af5=_0x50a933['length'];if(!_0x9104d0['query'][_0x066a('0x6e')](_0x066a('0x4b'))){_0x4e0f14[_0x066a('0x30')]=qs[_0x066a('0x30')](_0x9104d0[_0x066a('0x45')][_0x066a('0x30')]);_0x4e0f14['offset']=qs[_0x066a('0x2d')](_0x9104d0[_0x066a('0x45')][_0x066a('0x2d')]);}return _0x598c06[_0x066a('0x83')](_0x4e0f14);}})[_0x066a('0x20')](function(_0x512364){if(_0x512364){return _0x512364?{'count':_0x545af5,'rows':_0x512364}:null;}})[_0x066a('0x20')](respondWithResult(_0x51c727,null))[_0x066a('0x59')](handleError(_0x51c727,null));};exports[_0x066a('0x84')]=function(_0x47ba5e,_0x1da230,_0x2ba2f4){var _0x5491d9={'channel':_0x066a('0x85')};var _0x4a8beb=[];var _0x2cce02=[];var _0x3f7544={};return db[_0x066a('0x3f')][_0x066a('0x58')]({'where':{'id':_0x47ba5e['params']['id']},'include':[{'model':db[_0x066a('0x7f')],'as':_0x066a('0x86')}]})[_0x066a('0x20')](handleEntityNotFound(_0x1da230,null))[_0x066a('0x20')](function(_0x3c34c2){_0x5491d9[_0x066a('0x87')]=_0x3c34c2;if(_0x5491d9[_0x066a('0x87')]&&_0x5491d9[_0x066a('0x87')][_0x066a('0x42')]==='sinch'&&_0x47ba5e['body']['statuses']){if(_0x47ba5e['body']['statuses']['length']===0x0)return;if(_0x47ba5e[_0x066a('0x61')][_0x066a('0x88')][0x0]['state']!==_0x066a('0x89'))return;return db[_0x066a('0x8a')][_0x066a('0x35')]({'read':!![],'readAt':_0x47ba5e[_0x066a('0x61')][_0x066a('0x88')][0x0][_0x066a('0x8b')]},{'where':{'messageId':_0x47ba5e[_0x066a('0x61')][_0x066a('0x88')][0x0][_0x066a('0x8c')]},'individualHooks':!![]})[_0x066a('0x20')](function(_0x48672e){return _0x1da230[_0x066a('0x2b')](0xc8)['json'](_0x48672e);});}_0x5491d9[_0x066a('0x8d')]=_[_0x066a('0x8e')](_0x3c34c2[_0x066a('0x86')],[_0x066a('0x80')],[_0x066a('0x8f')]);if(_0x5491d9['account'][_0x066a('0x86')]){delete _0x5491d9[_0x066a('0x87')][_0x066a('0x86')];}return db[_0x066a('0x90')][_0x066a('0x62')]()[_0x066a('0x20')](function(_0x26d8b7){if(!_0x26d8b7){throw new db['Sequelize'][(_0x066a('0x91'))](_0x066a('0x92'));}_0x4a8beb=_[_0x066a('0x93')](_[_0x066a('0x46')](_0x26d8b7),[_0x066a('0x94'),_0x066a('0x95')]);_0x2cce02=_[_0x066a('0x93')](_[_0x066a('0x46')](_0x26d8b7),['createdAt','updatedAt',_0x066a('0x96'),_0x066a('0x97')]);_0x5491d9[_0x066a('0x61')]={'mapKey':_0x066a('0x98')};if(_0x5491d9['account']&&_0x5491d9[_0x066a('0x87')][_0x066a('0x42')]===_0x066a('0x99')){_0x5491d9[_0x066a('0x61')][_0x066a('0x9a')]=_0x47ba5e[_0x066a('0x61')][_0x066a('0x9b')][_0x066a('0x9c')](_0x066a('0x9d'),'');_0x5491d9[_0x066a('0x61')][_0x066a('0x61')]=_0x47ba5e['body']['Body'];_0x5491d9[_0x066a('0x61')][_0x066a('0x9e')]=_0x47ba5e[_0x066a('0x61')][_0x066a('0x9f')];}if(_0x5491d9[_0x066a('0x87')]&&_0x5491d9['account'][_0x066a('0x42')]===_0x066a('0xa0')){_0x5491d9[_0x066a('0x61')]['from']=_0x47ba5e[_0x066a('0x61')][_0x066a('0xa1')][0x0][_0x066a('0x9a')];_0x5491d9[_0x066a('0x61')][_0x066a('0x61')]=_0x47ba5e['body'][_0x066a('0xa1')][0x0]['message'][_0x066a('0x61')];_0x5491d9['body']['messageId']=_0x47ba5e[_0x066a('0x61')][_0x066a('0xa1')][0x0][_0x066a('0x8c')];}if(_0x5491d9[_0x066a('0x61')]['id']){delete _0x5491d9[_0x066a('0x61')]['id'];}if(_[_0x066a('0xa2')](_0x5491d9[_0x066a('0x61')]['from'])){throw new db[(_0x066a('0xa3'))][(_0x066a('0x91'))](_0x066a('0xa4'));}if(_[_0x066a('0xa2')](_0x5491d9[_0x066a('0x61')][_0x066a('0x61')])||_0x5491d9['body'][_0x066a('0x61')]===''){throw new db['Sequelize'][(_0x066a('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5491d9['body']['mapKey'])){throw new db[(_0x066a('0xa3'))][(_0x066a('0x91'))](_0x066a('0xa5')+_0x2cce02);}if(!_['includes'](_0x2cce02,_0x5491d9[_0x066a('0x61')][_0x066a('0xa6')])){throw new db[(_0x066a('0xa3'))][(_0x066a('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cce02);}_0x3f7544[_0x5491d9[_0x066a('0x61')][_0x066a('0xa6')]]=_0x5491d9[_0x066a('0x61')][_0x066a('0x9a')];return db[_0x066a('0xa7')][_0x066a('0x58')]({'where':{'id':_0x5491d9[_0x066a('0x87')][_0x066a('0x97')]},'include':[{'model':db[_0x066a('0x90')],'as':_0x066a('0xa8'),'where':_0x3f7544,'limit':0x1,'order':[[_0x066a('0x95'),'DESC']]}]});})['then'](handleEntityNotFound(_0x1da230,null))[_0x066a('0x20')](function(_0x478766){if(_0x478766){_0x5491d9[_0x066a('0xa9')]=_[_0x066a('0xaa')](_0x478766,['Contacts']);if(_0x478766[_0x066a('0xa8')][_0x066a('0x54')]){return _0x478766['Contacts'][0x0];}var _0x1a69bd=_[_0x066a('0xab')](_0x5491d9[_0x066a('0x61')],{'firstName':_0x5491d9[_0x066a('0x61')][_0x066a('0x9a')],'ListId':_0x478766['id']});_0x1a69bd[_0x5491d9[_0x066a('0x61')][_0x066a('0xa6')]]=_0x5491d9[_0x066a('0x61')]['from'];return db[_0x066a('0x90')]['create'](_0x1a69bd,{'fields':_0x4a8beb,'raw':!![]});}})[_0x066a('0x20')](handleEntityNotFound(_0x1da230,null))['then'](function(_0xe1b64b){if(_0xe1b64b){_0x5491d9[_0x066a('0xac')]=_0xe1b64b;var _0x744bb9={'ContactId':_0xe1b64b['id'],'phone':_0x5491d9[_0x066a('0x61')][_0x066a('0x9a')],'WhatsappAccountId':_0x47ba5e[_0x066a('0x64')]['id']};var _0x450a7a={'ContactId':_0xe1b64b['id'],'WhatsappAccountId':_0x47ba5e['params']['id'],'closed':![]};return db[_0x066a('0xad')]['find']({'where':_0x450a7a})[_0x066a('0x20')](function(_0x5506d9){if(_0x5506d9){return[_0x5506d9,![]];}return db[_0x066a('0xad')][_0x066a('0x5a')](_0x744bb9)[_0x066a('0x20')](function(_0x44c82b){return[_0x44c82b,!![]];});});}})[_0x066a('0x72')](function(_0x49dbcc,_0x45aa79){_0x5491d9[_0x066a('0xae')]=_0x49dbcc[_0x066a('0x37')]({'plain':!![]});_0x5491d9[_0x066a('0xae')][_0x066a('0xaf')]=![];if(_0x45aa79){if(_0x5491d9[_0x066a('0x87')][_0x066a('0xb0')]){_0x5491d9[_0x066a('0x8d')]['push']({'id':0x0,'priority':_0x5491d9[_0x066a('0x8d')]['length']+0x1,'app':_0x066a('0xb1'),'appdata':'unmanaged','interval':_0x066a('0xb2')});}_0x5491d9['interaction']['created']=!![];}return db['WhatsappMessage'][_0x066a('0x5a')]({'phone':_0x5491d9[_0x066a('0x61')][_0x066a('0x9a')],'messageId':_0x5491d9['body'][_0x066a('0x9e')],'body':_0x5491d9[_0x066a('0x61')]['body'],'WhatsappAccountId':_0x47ba5e['params']['id'],'WhatsappInteractionId':_0x49dbcc['id'],'direction':'in','ContactId':_0x49dbcc[_0x066a('0xb3')],'AttachmentId':_0x5491d9['body']['AttachmentId']});})[_0x066a('0x20')](function(_0x5039fc){_0x5491d9[_0x066a('0x27')]=_0x5039fc;if(_0x5491d9['interaction']['UserId']){return db[_0x066a('0x78')][_0x066a('0x58')]({'attributes':['id',_0x066a('0x3a')],'where':{'id':_0x5491d9[_0x066a('0xae')]['UserId']}})[_0x066a('0x20')](function(_0x1afd7e){if(_0x1afd7e){_0x5491d9[_0x066a('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x066a('0xb4'),'appdata':_0x1afd7e[_0x066a('0x3a')]+','+(_0x5491d9[_0x066a('0x87')][_0x066a('0xb5')]||0xa),'interval':_0x066a('0xb2')});}return respondWithRpcPromise(_0x066a('0xb6'),'startRouting',_0x5491d9);});}return respondWithRpcPromise(_0x066a('0xb6'),_0x066a('0xb7'),_0x5491d9);})[_0x066a('0x20')](function(_0x22c943){if(_0x22c943){var _0x19f26c=0xc8;var _0x41606d='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x41606d,_0x19f26c,_0x066a('0xb8'));logger[_0x066a('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x41606d,_0x19f26c,_0x066a('0xb8'),JSON[_0x066a('0x25')](_0x22c943));if(_0x5491d9[_0x066a('0x87')][_0x066a('0x42')]==='twilio'){return _0x1da230['status'](_0x19f26c)['set'](_0x066a('0xb9'),_0x066a('0xba'))[_0x066a('0x82')]('\x0a');}else{return _0x1da230[_0x066a('0x2b')](_0x19f26c)[_0x066a('0x2c')](_0x22c943);}}});})[_0x066a('0x59')](handleError(_0x1da230,null));};exports[_0x066a('0x82')]=function(_0x2b8a3f,_0x19fd85,_0x4510f4){var _0x29b805,_0x6171f0,_0x3a423d;if(_[_0x066a('0xa2')](_0x2b8a3f[_0x066a('0x61')]['body'])||_0x2b8a3f['body'][_0x066a('0x61')]===''){throw new db[(_0x066a('0xa3'))]['ValidationError'](_0x066a('0xbb'));}if(_['isNil'](_0x2b8a3f[_0x066a('0x61')]['to'])){throw new db['Sequelize'][(_0x066a('0x91'))](_0x066a('0xbc'));}_0x29b805=_0x2b8a3f['body']['to'];return db[_0x066a('0x3f')]['find']({'where':{'id':_0x2b8a3f[_0x066a('0x64')]['id']},'include':[{'model':db[_0x066a('0xa7')],'as':_0x066a('0xbd'),'include':[{'model':db['CmContact'],'as':_0x066a('0xa8'),'where':{'mobile':_0x29b805},'limit':0x1,'order':[[_0x066a('0x95'),_0x066a('0xbe')]]}]}]})[_0x066a('0x20')](handleEntityNotFound(_0x19fd85,null))[_0x066a('0x20')](function(_0x3ecea4){if(_0x3ecea4&&_0x3ecea4['List']){_0x6171f0=_0x3ecea4[_0x066a('0x37')]({'plain':!![]});if(_0x6171f0[_0x066a('0xbd')]&&_0x6171f0[_0x066a('0xbd')][_0x066a('0xa8')][_0x066a('0x54')]){return _0x6171f0[_0x066a('0xbd')]['Contacts'][0x0];}return db[_0x066a('0x90')][_0x066a('0x5a')](_[_0x066a('0xab')](_0x2b8a3f['body'],{'firstName':_0x29b805,'mobile':_0x29b805,'phone':_0x29b805,'ListId':_0x6171f0[_0x066a('0x97')]}));}})[_0x066a('0x20')](handleEntityNotFound(_0x19fd85,null))[_0x066a('0x20')](function(_0x3d505e){if(_0x3d505e){_0x3a423d=_0x3d505e;return db['WhatsappInteraction'][_0x066a('0x58')]({'where':{'ContactId':_0x3a423d['id'],'closed':![],'WhatsappAccountId':_0x6171f0['id']}})['then'](function(_0xf26762){if(_0xf26762){return[_0xf26762,![]];}return db[_0x066a('0xad')][_0x066a('0x5a')]({'UserId':_0x2b8a3f[_0x066a('0x5b')]['id'],'ContactId':_0x3a423d['id'],'WhatsappAccountId':_0x6171f0['id'],'phone':_0x29b805,'firstMsgDirection':_0x066a('0xbf'),'Messages':[_['merge'](_0x2b8a3f[_0x066a('0x61')],{'read':![],'body':_0x2b8a3f[_0x066a('0x61')][_0x066a('0x61')],'phone':_0x29b805,'WhatsappAccountId':_0x6171f0['id'],'UserId':_0x2b8a3f['user']['id'],'ContactId':_0x3a423d['id']})]},{'include':[{'model':db[_0x066a('0x8a')],'as':_0x066a('0xc0')}]})[_0x066a('0x20')](function(_0x335b06){return[_0x335b06,!![]];});});}})['spread'](function(_0x1ab5fa,_0x5c38a2){if(_0x5c38a2){return _0x1ab5fa;}return db['WhatsappMessage'][_0x066a('0x5a')](_[_0x066a('0x57')](_0x2b8a3f['body'],{'read':![],'body':_0x2b8a3f[_0x066a('0x61')][_0x066a('0x61')],'phone':_0x29b805,'WhatsappAccountId':_0x6171f0['id'],'WhatsappInteractionId':_0x1ab5fa['id'],'UserId':_0x2b8a3f['user']['id'],'ContactId':_0x3a423d['id']}))[_0x066a('0x20')](function(_0x694314){_0x1ab5fa['dataValues'][_0x066a('0xc0')]=[];_0x1ab5fa[_0x066a('0xc1')][_0x066a('0xc0')]['push'](_0x694314['dataValues']);return _0x1ab5fa;});})[_0x066a('0x20')](respondWithResult(_0x19fd85,null))[_0x066a('0x59')](handleError(_0x19fd85,null));}; \ No newline at end of file +var _0x4d0d=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','reject','destroy','get','WhatsappAccounts','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','keys','create','body','user','UserProfileSection','find','userProfileId','UserProfileResource','update','describe','Disposition','getDispositions','sort','WhatsappAccountId','removeDispositions','ids','CannedAnswer','getAnswers','findOne','order','removeAnswers','addAgents','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','from','whatsapp:','Body','MessageSid','messageId','notifications','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','omit','Contacts','WhatsappInteraction','interaction','autoclose','applications','push','close','*,*,*,*','created','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','Content-Type','text/xml','\x0a','CmList','List','Messages','spread','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x4d0d,0x176));var _0xd4d0=function(_0x5c149e,_0x420da0){_0x5c149e=_0x5c149e-0x0;var _0x2ceb57=_0x4d0d[_0x5c149e];return _0x2ceb57;};'use strict';var emlformat=require(_0xd4d0('0x0'));var rimraf=require(_0xd4d0('0x1'));var zipdir=require(_0xd4d0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4d0('0x3'));var moment=require(_0xd4d0('0x4'));var BPromise=require(_0xd4d0('0x5'));var Mustache=require(_0xd4d0('0x6'));var util=require('util');var path=require(_0xd4d0('0x7'));var sox=require('sox');var csv=require(_0xd4d0('0x8'));var ejs=require(_0xd4d0('0x9'));var fs=require('fs');var fs_extra=require(_0xd4d0('0xa'));var _=require('lodash');var squel=require(_0xd4d0('0xb'));var crypto=require(_0xd4d0('0xc'));var jsforce=require(_0xd4d0('0xd'));var deskjs=require(_0xd4d0('0xe'));var toCsv=require(_0xd4d0('0x8'));var querystring=require(_0xd4d0('0xf'));var Papa=require('papaparse');var Redis=require(_0xd4d0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd4d0('0x11'));var as=require(_0xd4d0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4d0('0x13'))(_0xd4d0('0x14'));var utils=require(_0xd4d0('0x15'));var config=require(_0xd4d0('0x16'));var licenseUtil=require(_0xd4d0('0x17'));var db=require(_0xd4d0('0x18'))['db'];config[_0xd4d0('0x19')]=_[_0xd4d0('0x1a')](config[_0xd4d0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd4d0('0x1b'))(new Redis(config['redis']));require(_0xd4d0('0x1c'))[_0xd4d0('0x1d')](socket);var jayson=require(_0xd4d0('0x1e'));var client=jayson[_0xd4d0('0x1f')][_0xd4d0('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2047ea,_0x362244,_0x4fdb4e,_0x3ba597){return new BPromise(function(_0x462a16,_0x4c5a8a){var _0x31f245=_0x3ba597||client;return _0x31f245[_0xd4d0('0x21')](_0x2047ea,_0x4fdb4e)[_0xd4d0('0x22')](function(_0xe1ab5f){logger[_0xd4d0('0x23')](_0xd4d0('0x24'),_0x362244,_0xd4d0('0x25'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x362244,_0xd4d0('0x25'),JSON['stringify'](_0xe1ab5f));if(_0xe1ab5f[_0xd4d0('0x26')]){if(_0xe1ab5f['error'][_0xd4d0('0x27')]===0x1f4){logger[_0xd4d0('0x26')](_0xd4d0('0x24'),_0x362244,_0xe1ab5f[_0xd4d0('0x26')][_0xd4d0('0x28')]);return _0x4c5a8a(_0xe1ab5f[_0xd4d0('0x26')]['message']);}logger[_0xd4d0('0x26')](_0xd4d0('0x24'),_0x362244,_0xe1ab5f[_0xd4d0('0x26')]['message']);return _0x462a16(_0xe1ab5f[_0xd4d0('0x26')][_0xd4d0('0x28')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x362244,_0xd4d0('0x25'));_0x462a16(_0xe1ab5f[_0xd4d0('0x29')][_0xd4d0('0x28')]);}})[_0xd4d0('0x2a')](function(_0x177482){logger['error'](_0xd4d0('0x24'),_0x362244,_0x177482);_0x4c5a8a(_0x177482);});});}function respondWithStatusCode(_0x5959fe,_0x5440d2){_0x5440d2=_0x5440d2||0xcc;return function(_0x31cda7){if(_0x31cda7){return _0x5959fe[_0xd4d0('0x2b')](_0x5440d2);}return _0x5959fe[_0xd4d0('0x2c')](_0x5440d2)[_0xd4d0('0x2d')]();};}function respondWithResult(_0x2235a8,_0x26a30a){_0x26a30a=_0x26a30a||0xc8;return function(_0x21e865){if(_0x21e865){return _0x2235a8[_0xd4d0('0x2c')](_0x26a30a)[_0xd4d0('0x2e')](_0x21e865);}};}function respondWithFilteredResult(_0x44c626,_0x259706){return function(_0x35965e){if(_0x35965e){var _0x4b158c=typeof _0x259706[_0xd4d0('0x2f')]==='undefined'&&typeof _0x259706['limit']===_0xd4d0('0x30');var _0x322456=_0x35965e[_0xd4d0('0x31')];var _0x55700=_0x4b158c?0x0:_0x259706[_0xd4d0('0x2f')];var _0x4f1d82=_0x4b158c?_0x35965e[_0xd4d0('0x31')]:_0x259706['offset']+_0x259706['limit'];var _0x2d83fd;if(_0x4f1d82>=_0x322456){_0x4f1d82=_0x322456;_0x2d83fd=0xc8;}else{_0x2d83fd=0xce;}_0x44c626['status'](_0x2d83fd);return _0x44c626[_0xd4d0('0x32')]('Content-Range',_0x55700+'-'+_0x4f1d82+'/'+_0x322456)[_0xd4d0('0x2e')](_0x35965e);}return null;};}function patchUpdates(_0x14a94d){return function(_0x3a7f6f){try{jsonpatch['apply'](_0x3a7f6f,_0x14a94d,!![]);}catch(_0xb81f0d){return BPromise[_0xd4d0('0x33')](_0xb81f0d);}return _0x3a7f6f['save']();};}function saveUpdates(_0x507e16,_0x403702){return function(_0x13dca4){if(_0x13dca4){return _0x13dca4['update'](_0x507e16)[_0xd4d0('0x22')](function(_0x41f0d3){return _0x41f0d3;});}return null;};}function removeEntity(_0x29518e,_0x25d619){return function(_0x1c76fb){if(_0x1c76fb){return _0x1c76fb[_0xd4d0('0x34')]()['then'](function(){var _0x35bbd6=_0x1c76fb[_0xd4d0('0x35')]({'plain':!![]});var _0x3721ca=_0xd4d0('0x36');return db['UserProfileResource'][_0xd4d0('0x34')]({'where':{'type':_0x3721ca,'resourceId':_0x35bbd6['id']}})[_0xd4d0('0x22')](function(){return _0x1c76fb;});})[_0xd4d0('0x22')](function(){_0x29518e[_0xd4d0('0x2c')](0xcc)[_0xd4d0('0x2d')]();});}};}function handleEntityNotFound(_0x28311d,_0x196936){return function(_0x103279){if(!_0x103279){_0x28311d[_0xd4d0('0x2b')](0x194);}return _0x103279;};}function handleError(_0x1c3a7b,_0x1c1ed0){_0x1c1ed0=_0x1c1ed0||0x1f4;return function(_0x55c675){logger['error'](_0x55c675[_0xd4d0('0x37')]);if(_0x55c675[_0xd4d0('0x38')]){delete _0x55c675[_0xd4d0('0x38')];}_0x1c3a7b[_0xd4d0('0x2c')](_0x1c1ed0)[_0xd4d0('0x39')](_0x55c675);};}exports[_0xd4d0('0x3a')]=function(_0x1f10b5,_0x3322cc){var _0xb6d095={'include':[{'model':db['Pause'],'as':_0xd4d0('0x3b')}]},_0x3c2c3c={},_0x2f6b9b={'count':0x0,'rows':[]};var _0x4f334e=_[_0xd4d0('0x3c')](db[_0xd4d0('0x3d')][_0xd4d0('0x3e')],function(_0x5a6e44){return{'name':_0x5a6e44[_0xd4d0('0x3f')],'type':_0x5a6e44[_0xd4d0('0x40')]['key']};});_0x3c2c3c[_0xd4d0('0x41')]=_[_0xd4d0('0x3c')](_0x4f334e,'name');_0x3c2c3c[_0xd4d0('0x42')]=_['keys'](_0x1f10b5[_0xd4d0('0x42')]);_0x3c2c3c[_0xd4d0('0x43')]=_[_0xd4d0('0x44')](_0x3c2c3c[_0xd4d0('0x41')],_0x3c2c3c['query']);_0xb6d095[_0xd4d0('0x45')]=_[_0xd4d0('0x44')](_0x3c2c3c[_0xd4d0('0x41')],qs[_0xd4d0('0x46')](_0x1f10b5[_0xd4d0('0x42')][_0xd4d0('0x46')]));_0xb6d095[_0xd4d0('0x45')]=_0xb6d095['attributes'][_0xd4d0('0x47')]?_0xb6d095['attributes']:_0x3c2c3c[_0xd4d0('0x41')];if(!_0x1f10b5[_0xd4d0('0x42')][_0xd4d0('0x48')](_0xd4d0('0x49'))){_0xb6d095[_0xd4d0('0x4a')]=qs[_0xd4d0('0x4a')](_0x1f10b5[_0xd4d0('0x42')]['limit']);_0xb6d095[_0xd4d0('0x2f')]=qs[_0xd4d0('0x2f')](_0x1f10b5[_0xd4d0('0x42')]['offset']);}_0xb6d095['order']=qs['sort'](_0x1f10b5['query']['sort']);_0xb6d095[_0xd4d0('0x4b')]=qs[_0xd4d0('0x43')](_[_0xd4d0('0x4c')](_0x1f10b5[_0xd4d0('0x42')],_0x3c2c3c[_0xd4d0('0x43')]),_0x4f334e);if(_0x1f10b5['query'][_0xd4d0('0x4d')]){_0xb6d095[_0xd4d0('0x4b')]=_[_0xd4d0('0x4e')](_0xb6d095[_0xd4d0('0x4b')],{'$or':_[_0xd4d0('0x3c')](_0x4f334e,function(_0x447d47){if(_0x447d47['type']!==_0xd4d0('0x4f')){var _0x5965d7={};_0x5965d7[_0x447d47[_0xd4d0('0x38')]]={'$like':'%'+_0x1f10b5[_0xd4d0('0x42')][_0xd4d0('0x4d')]+'%'};return _0x5965d7;}})});}_0xb6d095=_[_0xd4d0('0x4e')]({},_0xb6d095,_0x1f10b5[_0xd4d0('0x50')]);var _0x36e795={'where':_0xb6d095[_0xd4d0('0x4b')]};return db[_0xd4d0('0x3d')][_0xd4d0('0x31')](_0x36e795)[_0xd4d0('0x22')](function(_0x42a6e3){_0x2f6b9b[_0xd4d0('0x31')]=_0x42a6e3;if(_0x1f10b5['query'][_0xd4d0('0x51')]){_0xb6d095[_0xd4d0('0x52')]=[{'all':!![]}];}return db[_0xd4d0('0x3d')][_0xd4d0('0x53')](_0xb6d095);})[_0xd4d0('0x22')](function(_0x24a0eb){_0x2f6b9b[_0xd4d0('0x54')]=_0x24a0eb;return _0x2f6b9b;})[_0xd4d0('0x22')](respondWithFilteredResult(_0x3322cc,_0xb6d095))[_0xd4d0('0x2a')](handleError(_0x3322cc,null));};exports[_0xd4d0('0x55')]=function(_0x4652e1,_0x111485){var _0x4de057={'raw':![],'where':{'id':_0x4652e1[_0xd4d0('0x56')]['id']},'include':[{'model':db[_0xd4d0('0x57')],'as':_0xd4d0('0x3b')}]},_0xe896fb={};_0xe896fb[_0xd4d0('0x41')]=_['keys'](db[_0xd4d0('0x3d')][_0xd4d0('0x3e')]);_0xe896fb['query']=_[_0xd4d0('0x58')](_0x4652e1[_0xd4d0('0x42')]);_0xe896fb['filters']=_[_0xd4d0('0x44')](_0xe896fb[_0xd4d0('0x41')],_0xe896fb[_0xd4d0('0x42')]);_0x4de057[_0xd4d0('0x45')]=_[_0xd4d0('0x44')](_0xe896fb[_0xd4d0('0x41')],qs['fields'](_0x4652e1[_0xd4d0('0x42')][_0xd4d0('0x46')]));_0x4de057[_0xd4d0('0x45')]=_0x4de057[_0xd4d0('0x45')][_0xd4d0('0x47')]?_0x4de057['attributes']:_0xe896fb[_0xd4d0('0x41')];if(_0x4652e1['query']['includeAll']){_0x4de057[_0xd4d0('0x52')]=[{'all':!![]}];}_0x4de057=_['merge']({},_0x4de057,_0x4652e1[_0xd4d0('0x50')]);return db[_0xd4d0('0x3d')]['find'](_0x4de057)[_0xd4d0('0x22')](handleEntityNotFound(_0x111485,null))[_0xd4d0('0x22')](respondWithResult(_0x111485,null))[_0xd4d0('0x2a')](handleError(_0x111485,null));};exports['create']=function(_0x488a28,_0x228965){return db[_0xd4d0('0x3d')][_0xd4d0('0x59')](_0x488a28[_0xd4d0('0x5a')],{})['then'](function(_0x1485f4){var _0x3f29a6=_0x488a28[_0xd4d0('0x5b')][_0xd4d0('0x35')]({'plain':!![]});if(!_0x3f29a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f29a6['role']===_0xd4d0('0x5b')){var _0x5abbe7=_0x1485f4[_0xd4d0('0x35')]({'plain':!![]});var _0x1851c3=_0xd4d0('0x36');return db[_0xd4d0('0x5c')][_0xd4d0('0x5d')]({'where':{'name':_0x1851c3,'userProfileId':_0x3f29a6[_0xd4d0('0x5e')]},'raw':!![]})[_0xd4d0('0x22')](function(_0x7ada88){if(_0x7ada88&&_0x7ada88['autoAssociation']===0x0){return db[_0xd4d0('0x5f')][_0xd4d0('0x59')]({'name':_0x5abbe7['name'],'resourceId':_0x5abbe7['id'],'type':_0x7ada88[_0xd4d0('0x38')],'sectionId':_0x7ada88['id']},{})[_0xd4d0('0x22')](function(){return _0x1485f4;});}else{return _0x1485f4;}})[_0xd4d0('0x2a')](function(_0x540641){logger[_0xd4d0('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x540641);throw _0x540641;});}return _0x1485f4;})[_0xd4d0('0x22')](respondWithResult(_0x228965,0xc9))[_0xd4d0('0x2a')](handleError(_0x228965,null));};exports[_0xd4d0('0x60')]=function(_0x4a8030,_0x34fa5d){if(_0x4a8030[_0xd4d0('0x5a')]['id']){delete _0x4a8030[_0xd4d0('0x5a')]['id'];}return db[_0xd4d0('0x3d')][_0xd4d0('0x5d')]({'where':{'id':_0x4a8030[_0xd4d0('0x56')]['id']},'include':[{'model':db[_0xd4d0('0x57')],'as':_0xd4d0('0x3b')}]})[_0xd4d0('0x22')](handleEntityNotFound(_0x34fa5d,null))['then'](saveUpdates(_0x4a8030['body'],null))['then'](respondWithResult(_0x34fa5d,null))[_0xd4d0('0x2a')](handleError(_0x34fa5d,null));};exports[_0xd4d0('0x34')]=function(_0x45fce1,_0x4f9bd2){return db[_0xd4d0('0x3d')]['find']({'where':{'id':_0x45fce1[_0xd4d0('0x56')]['id']}})[_0xd4d0('0x22')](handleEntityNotFound(_0x4f9bd2,null))[_0xd4d0('0x22')](removeEntity(_0x4f9bd2,null))[_0xd4d0('0x2a')](handleError(_0x4f9bd2,null));};exports[_0xd4d0('0x61')]=function(_0xca88c2,_0x2d491f){return db['WhatsappAccount'][_0xd4d0('0x61')]()[_0xd4d0('0x22')](respondWithResult(_0x2d491f,null))[_0xd4d0('0x2a')](handleError(_0x2d491f,null));};exports['addDisposition']=function(_0x1eb8eb,_0x46eb99,_0x112629){if(_0x1eb8eb['body']['id']){delete _0x1eb8eb['body']['id'];}return db[_0xd4d0('0x3d')][_0xd4d0('0x5d')]({'where':{'id':_0x1eb8eb[_0xd4d0('0x56')]['id']}})[_0xd4d0('0x22')](handleEntityNotFound(_0x46eb99,null))[_0xd4d0('0x22')](function(_0x166ce3){if(_0x166ce3){_0x1eb8eb['body']['WhatsappAccountId']=_0x166ce3['id'];return db[_0xd4d0('0x62')]['create'](_0x1eb8eb[_0xd4d0('0x5a')]);}})[_0xd4d0('0x22')](respondWithResult(_0x46eb99,null))[_0xd4d0('0x2a')](handleError(_0x46eb99,null));};exports[_0xd4d0('0x63')]=function(_0x30900f,_0x18ac6e,_0x1f442b){var _0x252644={'raw':![],'where':{}};var _0x2bfe51={};var _0x2b574d={'count':0x0,'rows':[]};return db[_0xd4d0('0x3d')]['findOne']({'where':{'id':_0x30900f[_0xd4d0('0x56')]['id']}})['then'](handleEntityNotFound(_0x18ac6e,null))[_0xd4d0('0x22')](function(_0x37c34b){if(_0x37c34b){_0x2bfe51[_0xd4d0('0x41')]=_[_0xd4d0('0x58')](db['Disposition'][_0xd4d0('0x3e')]);_0x2bfe51[_0xd4d0('0x42')]=_['keys'](_0x30900f['query']);_0x2bfe51['filters']=_['intersection'](_0x2bfe51[_0xd4d0('0x41')],_0x2bfe51[_0xd4d0('0x42')]);_0x252644[_0xd4d0('0x45')]=_[_0xd4d0('0x44')](_0x2bfe51[_0xd4d0('0x41')],qs['fields'](_0x30900f[_0xd4d0('0x42')][_0xd4d0('0x46')]));_0x252644[_0xd4d0('0x45')]=_0x252644[_0xd4d0('0x45')][_0xd4d0('0x47')]?_0x252644[_0xd4d0('0x45')]:_0x2bfe51[_0xd4d0('0x41')];if(!_0x30900f[_0xd4d0('0x42')][_0xd4d0('0x48')]('nolimit')){_0x252644['limit']=qs[_0xd4d0('0x4a')](_0x30900f[_0xd4d0('0x42')]['limit']);_0x252644['offset']=qs[_0xd4d0('0x2f')](_0x30900f[_0xd4d0('0x42')][_0xd4d0('0x2f')]);}_0x252644['order']=qs['sort'](_0x30900f[_0xd4d0('0x42')][_0xd4d0('0x64')]);_0x252644[_0xd4d0('0x4b')]=qs[_0xd4d0('0x43')](_[_0xd4d0('0x4c')](_0x30900f['query'],_0x2bfe51[_0xd4d0('0x43')]));_0x252644[_0xd4d0('0x4b')][_0xd4d0('0x65')]=_0x37c34b['id'];if(_0x30900f[_0xd4d0('0x42')]['filter']){_0x252644[_0xd4d0('0x4b')]=_['merge'](_0x252644[_0xd4d0('0x4b')],{'$or':_['map'](_0x252644['attributes'],function(_0x5a4908){var _0x4fe209={};_0x4fe209[_0x5a4908]={'$like':'%'+_0x30900f[_0xd4d0('0x42')]['filter']+'%'};return _0x4fe209;})});}_0x252644=_['merge']({},_0x252644,_0x30900f[_0xd4d0('0x50')]);return db[_0xd4d0('0x62')]['count']({'where':_0x252644[_0xd4d0('0x4b')]})[_0xd4d0('0x22')](function(_0x13f6cc){_0x2b574d[_0xd4d0('0x31')]=_0x13f6cc;if(_0x30900f['query'][_0xd4d0('0x51')]){_0x252644[_0xd4d0('0x52')]=[{'all':!![]}];}return db[_0xd4d0('0x62')][_0xd4d0('0x53')](_0x252644);})['then'](function(_0x50159e){_0x2b574d[_0xd4d0('0x54')]=_0x50159e;return _0x2b574d;});}})[_0xd4d0('0x22')](respondWithFilteredResult(_0x18ac6e,_0x252644))[_0xd4d0('0x2a')](handleError(_0x18ac6e,null));};exports['removeDispositions']=function(_0x51f8a1,_0x272201,_0x15b822){return db[_0xd4d0('0x3d')]['find']({'where':{'id':_0x51f8a1[_0xd4d0('0x56')]['id']}})['then'](handleEntityNotFound(_0x272201,null))[_0xd4d0('0x22')](function(_0x668928){if(_0x668928){return _0x668928[_0xd4d0('0x66')](_0x51f8a1[_0xd4d0('0x42')][_0xd4d0('0x67')]);}})[_0xd4d0('0x22')](respondWithStatusCode(_0x272201,null))[_0xd4d0('0x2a')](handleError(_0x272201,null));};exports['addAnswer']=function(_0x231891,_0x597577,_0x4fa4d3){if(_0x231891[_0xd4d0('0x5a')]['id']){delete _0x231891['body']['id'];}return db[_0xd4d0('0x3d')]['find']({'where':{'id':_0x231891[_0xd4d0('0x56')]['id']}})[_0xd4d0('0x22')](handleEntityNotFound(_0x597577,null))['then'](function(_0xfe3d0b){if(_0xfe3d0b){_0x231891[_0xd4d0('0x5a')]['WhatsappAccountId']=_0xfe3d0b['id'];return db[_0xd4d0('0x68')][_0xd4d0('0x59')](_0x231891[_0xd4d0('0x5a')]);}})[_0xd4d0('0x22')](respondWithResult(_0x597577,null))[_0xd4d0('0x2a')](handleError(_0x597577,null));};exports[_0xd4d0('0x69')]=function(_0x6649df,_0x3a086d,_0x337b00){var _0x4c7e6b={'raw':![],'where':{}};var _0x3559b3={};var _0x553cbc={'count':0x0,'rows':[]};return db[_0xd4d0('0x3d')][_0xd4d0('0x6a')]({'where':{'id':_0x6649df[_0xd4d0('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a086d,null))[_0xd4d0('0x22')](function(_0x1a88cf){if(_0x1a88cf){_0x3559b3[_0xd4d0('0x41')]=_[_0xd4d0('0x58')](db[_0xd4d0('0x68')][_0xd4d0('0x3e')]);_0x3559b3[_0xd4d0('0x42')]=_[_0xd4d0('0x58')](_0x6649df['query']);_0x3559b3[_0xd4d0('0x43')]=_[_0xd4d0('0x44')](_0x3559b3[_0xd4d0('0x41')],_0x3559b3[_0xd4d0('0x42')]);_0x4c7e6b[_0xd4d0('0x45')]=_['intersection'](_0x3559b3[_0xd4d0('0x41')],qs['fields'](_0x6649df[_0xd4d0('0x42')]['fields']));_0x4c7e6b['attributes']=_0x4c7e6b[_0xd4d0('0x45')][_0xd4d0('0x47')]?_0x4c7e6b[_0xd4d0('0x45')]:_0x3559b3[_0xd4d0('0x41')];if(!_0x6649df['query'][_0xd4d0('0x48')](_0xd4d0('0x49'))){_0x4c7e6b['limit']=qs[_0xd4d0('0x4a')](_0x6649df[_0xd4d0('0x42')]['limit']);_0x4c7e6b[_0xd4d0('0x2f')]=qs[_0xd4d0('0x2f')](_0x6649df['query'][_0xd4d0('0x2f')]);}_0x4c7e6b[_0xd4d0('0x6b')]=qs['sort'](_0x6649df[_0xd4d0('0x42')][_0xd4d0('0x64')]);_0x4c7e6b[_0xd4d0('0x4b')]=qs[_0xd4d0('0x43')](_['pick'](_0x6649df[_0xd4d0('0x42')],_0x3559b3[_0xd4d0('0x43')]));_0x4c7e6b[_0xd4d0('0x4b')][_0xd4d0('0x65')]=_0x1a88cf['id'];if(_0x6649df[_0xd4d0('0x42')][_0xd4d0('0x4d')]){_0x4c7e6b['where']=_[_0xd4d0('0x4e')](_0x4c7e6b[_0xd4d0('0x4b')],{'$or':_[_0xd4d0('0x3c')](_0x4c7e6b[_0xd4d0('0x45')],function(_0x46c5d6){var _0x2da09f={};_0x2da09f[_0x46c5d6]={'$like':'%'+_0x6649df[_0xd4d0('0x42')][_0xd4d0('0x4d')]+'%'};return _0x2da09f;})});}_0x4c7e6b=_[_0xd4d0('0x4e')]({},_0x4c7e6b,_0x6649df[_0xd4d0('0x50')]);return db[_0xd4d0('0x68')]['count']({'where':_0x4c7e6b[_0xd4d0('0x4b')]})[_0xd4d0('0x22')](function(_0x10391a){_0x553cbc[_0xd4d0('0x31')]=_0x10391a;if(_0x6649df[_0xd4d0('0x42')]['includeAll']){_0x4c7e6b['include']=[{'all':!![]}];}return db[_0xd4d0('0x68')][_0xd4d0('0x53')](_0x4c7e6b);})['then'](function(_0x5ab220){_0x553cbc['rows']=_0x5ab220;return _0x553cbc;});}})['then'](respondWithFilteredResult(_0x3a086d,_0x4c7e6b))[_0xd4d0('0x2a')](handleError(_0x3a086d,null));};exports[_0xd4d0('0x6c')]=function(_0x241379,_0x3805b1,_0xbfa10){return db[_0xd4d0('0x3d')]['find']({'where':{'id':_0x241379['params']['id']}})['then'](handleEntityNotFound(_0x3805b1,null))[_0xd4d0('0x22')](function(_0x519877){if(_0x519877){return _0x519877[_0xd4d0('0x6c')](_0x241379[_0xd4d0('0x42')][_0xd4d0('0x67')]);}})['then'](respondWithStatusCode(_0x3805b1,null))[_0xd4d0('0x2a')](handleError(_0x3805b1,null));};exports['addAgents']=function(_0x4ab469,_0x1ad83c,_0x27dc1f){return db['WhatsappAccount'][_0xd4d0('0x5d')]({'where':{'id':_0x4ab469[_0xd4d0('0x56')]['id']}})[_0xd4d0('0x22')](handleEntityNotFound(_0x1ad83c,null))['then'](function(_0x427068){if(_0x427068){return _0x427068[_0xd4d0('0x6d')](_0x4ab469['body'][_0xd4d0('0x67')],_['omit'](_0x4ab469[_0xd4d0('0x5a')],['ids','id'])||{})['spread'](function(_0x79c177){for(var _0x3eea0c=0x0;_0x3eea0c<_0x4ab469[_0xd4d0('0x5a')][_0xd4d0('0x67')]['length'];_0x3eea0c+=0x1){socket[_0xd4d0('0x6e')]('userWhatsappAccount:save',{'UserId':Number(_0x4ab469[_0xd4d0('0x5a')][_0xd4d0('0x67')][_0x3eea0c]),'WhatsappAccountId':Number(_0x4ab469[_0xd4d0('0x56')]['id'])});}return _0x79c177;});}})['then'](respondWithResult(_0x1ad83c,null))[_0xd4d0('0x2a')](handleError(_0x1ad83c,null));};exports[_0xd4d0('0x6f')]=function(_0x20c525,_0x2ebeb5,_0x1b2e89){return db[_0xd4d0('0x3d')][_0xd4d0('0x5d')]({'where':{'id':_0x20c525[_0xd4d0('0x56')]['id']}})[_0xd4d0('0x22')](handleEntityNotFound(_0x2ebeb5,null))['then'](function(_0x692904){if(_0x692904){return _0x692904[_0xd4d0('0x6f')](_0x20c525['query'][_0xd4d0('0x67')])[_0xd4d0('0x22')](function(){if(_[_0xd4d0('0x70')](_0x20c525['query'][_0xd4d0('0x67')])){for(var _0x341fa8=0x0;_0x341fa8<_0x20c525[_0xd4d0('0x42')][_0xd4d0('0x67')]['length'];_0x341fa8+=0x1){socket[_0xd4d0('0x6e')](_0xd4d0('0x71'),{'UserId':Number(_0x20c525[_0xd4d0('0x42')]['ids'][_0x341fa8]),'WhatsappAccountId':Number(_0x20c525[_0xd4d0('0x56')]['id'])});}}else{socket[_0xd4d0('0x6e')](_0xd4d0('0x71'),{'UserId':Number(_0x20c525[_0xd4d0('0x42')]['ids']),'WhatsappAccountId':Number(_0x20c525['params']['id'])});}});}})[_0xd4d0('0x22')](respondWithStatusCode(_0x2ebeb5,null))[_0xd4d0('0x2a')](handleError(_0x2ebeb5,null));};exports[_0xd4d0('0x72')]=function(_0x201107,_0x19c776,_0x44eb7b){var _0x10c456={};var _0x4ecce1={};var _0x416a82;var _0x5d0422;return db[_0xd4d0('0x3d')][_0xd4d0('0x6a')]({'where':{'id':_0x201107[_0xd4d0('0x56')]['id']}})[_0xd4d0('0x22')](handleEntityNotFound(_0x19c776,null))[_0xd4d0('0x22')](function(_0x117a3b){if(_0x117a3b){_0x416a82=_0x117a3b;_0x4ecce1[_0xd4d0('0x41')]=_[_0xd4d0('0x58')](db[_0xd4d0('0x73')][_0xd4d0('0x3e')]);_0x4ecce1[_0xd4d0('0x42')]=_[_0xd4d0('0x58')](_0x201107['query']);_0x4ecce1['filters']=_[_0xd4d0('0x44')](_0x4ecce1[_0xd4d0('0x41')],_0x4ecce1['query']);_0x10c456['attributes']=_[_0xd4d0('0x44')](_0x4ecce1[_0xd4d0('0x41')],qs['fields'](_0x201107[_0xd4d0('0x42')][_0xd4d0('0x46')]));_0x10c456[_0xd4d0('0x45')]=_0x10c456[_0xd4d0('0x45')][_0xd4d0('0x47')]?_0x10c456[_0xd4d0('0x45')]:_0x4ecce1['model'];_0x10c456['order']=qs[_0xd4d0('0x64')](_0x201107[_0xd4d0('0x42')][_0xd4d0('0x64')]);_0x10c456[_0xd4d0('0x4b')]=qs[_0xd4d0('0x43')](_['pick'](_0x201107[_0xd4d0('0x42')],_0x4ecce1['filters']));if(_0x201107[_0xd4d0('0x42')]['filter']){_0x10c456[_0xd4d0('0x4b')]=_[_0xd4d0('0x4e')](_0x10c456[_0xd4d0('0x4b')],{'$or':_[_0xd4d0('0x3c')](_0x10c456['attributes'],function(_0x44e0d0){var _0x5f51a3={};_0x5f51a3[_0x44e0d0]={'$like':'%'+_0x201107['query'][_0xd4d0('0x4d')]+'%'};return _0x5f51a3;})});}_0x10c456=_[_0xd4d0('0x4e')]({},_0x10c456,_0x201107[_0xd4d0('0x50')]);return _0x416a82[_0xd4d0('0x72')](_0x10c456);}})[_0xd4d0('0x22')](function(_0xdc755){if(_0xdc755){_0x5d0422=_0xdc755['length'];if(!_0x201107[_0xd4d0('0x42')][_0xd4d0('0x48')](_0xd4d0('0x49'))){_0x10c456[_0xd4d0('0x4a')]=qs[_0xd4d0('0x4a')](_0x201107[_0xd4d0('0x42')]['limit']);_0x10c456[_0xd4d0('0x2f')]=qs['offset'](_0x201107[_0xd4d0('0x42')][_0xd4d0('0x2f')]);}return _0x416a82[_0xd4d0('0x72')](_0x10c456);}})[_0xd4d0('0x22')](function(_0x275156){if(_0x275156){return _0x275156?{'count':_0x5d0422,'rows':_0x275156}:null;}})[_0xd4d0('0x22')](respondWithResult(_0x19c776,null))['catch'](handleError(_0x19c776,null));};exports[_0xd4d0('0x74')]=function(_0x1ffeaa,_0x50c985){var _0x1058c1=_0x1ffeaa[_0xd4d0('0x56')]['id'];var _0x385432=_0x1ffeaa[_0xd4d0('0x5a')];var _0x124b3c=0xc8;var _0x26cebe=null;return db[_0xd4d0('0x75')]['transaction']({'isolationLevel':db[_0xd4d0('0x75')][_0xd4d0('0x76')]['ISOLATION_LEVELS'][_0xd4d0('0x77')]},function(_0x415cdf){return db[_0xd4d0('0x3d')]['findOne']({'where':{'id':_0x1058c1},'transaction':_0x415cdf})[_0xd4d0('0x22')](function(_0xcde4f7){if(_0xcde4f7){return db[_0xd4d0('0x78')][_0xd4d0('0x34')]({'where':{'WhatsappAccountId':_0x1058c1},'transaction':_0x415cdf})[_0xd4d0('0x22')](function(){var _0xaa9719=_[_0xd4d0('0x3c')](_0x385432,function(_0x2593b7){_0x2593b7['WhatsappAccountId']=_0x1058c1;return _0x2593b7;});return db[_0xd4d0('0x78')][_0xd4d0('0x79')](_0xaa9719,{'transaction':_0x415cdf});});}else{_0x124b3c=0x194;_0x26cebe=[];}});})[_0xd4d0('0x22')](function(){if(_0x124b3c!==0x194){return db[_0xd4d0('0x78')][_0xd4d0('0x7a')]({'where':{'WhatsappAccountId':_0x1058c1},'order':_0xd4d0('0x7b')})[_0xd4d0('0x22')](function(_0x3e06be){_0x26cebe=_0x3e06be;});}})[_0xd4d0('0x2a')](function(_0x462bc3){_0x124b3c=0x1f4;logger['error'](_0x462bc3[_0xd4d0('0x37')]);if(_0x462bc3[_0xd4d0('0x38')]){delete _0x462bc3[_0xd4d0('0x38')];}_0x26cebe=_0x462bc3;})[_0xd4d0('0x7c')](function(){if(_0x26cebe===null){_0x50c985[_0xd4d0('0x2b')](_0x124b3c);}else{if(_0x124b3c===0x1f4){_0x50c985[_0xd4d0('0x2c')](_0x124b3c)[_0xd4d0('0x39')](_0x26cebe);}else{_0x50c985[_0xd4d0('0x2c')](_0x124b3c)[_0xd4d0('0x2e')](_0x26cebe);}}});};exports['getApplications']=function(_0x4b6c8d,_0x474fc1,_0x4e9f03){var _0x38dfc0={};var _0x515cbb={};var _0x198223;var _0x5de101;return db[_0xd4d0('0x3d')][_0xd4d0('0x6a')]({'where':{'id':_0x4b6c8d[_0xd4d0('0x56')]['id']}})[_0xd4d0('0x22')](handleEntityNotFound(_0x474fc1,null))[_0xd4d0('0x22')](function(_0x38f967){if(_0x38f967){_0x198223=_0x38f967;_0x515cbb[_0xd4d0('0x41')]=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x515cbb[_0xd4d0('0x42')]=_[_0xd4d0('0x58')](_0x4b6c8d[_0xd4d0('0x42')]);_0x515cbb[_0xd4d0('0x43')]=_[_0xd4d0('0x44')](_0x515cbb[_0xd4d0('0x41')],_0x515cbb[_0xd4d0('0x42')]);_0x38dfc0['attributes']=_[_0xd4d0('0x44')](_0x515cbb['model'],qs['fields'](_0x4b6c8d[_0xd4d0('0x42')][_0xd4d0('0x46')]));_0x38dfc0[_0xd4d0('0x45')]=_0x38dfc0['attributes']['length']?_0x38dfc0[_0xd4d0('0x45')]:_0x515cbb['model'];_0x38dfc0[_0xd4d0('0x6b')]=qs[_0xd4d0('0x64')](_0x4b6c8d['query']['sort']);_0x38dfc0[_0xd4d0('0x4b')]=qs[_0xd4d0('0x43')](_['pick'](_0x4b6c8d[_0xd4d0('0x42')],_0x515cbb['filters']));if(_0x4b6c8d[_0xd4d0('0x42')][_0xd4d0('0x4d')]){_0x38dfc0[_0xd4d0('0x4b')]=_['merge'](_0x38dfc0[_0xd4d0('0x4b')],{'$or':_[_0xd4d0('0x3c')](_0x38dfc0[_0xd4d0('0x45')],function(_0x3881da){var _0x4bf1a4={};_0x4bf1a4[_0x3881da]={'$like':'%'+_0x4b6c8d[_0xd4d0('0x42')][_0xd4d0('0x4d')]+'%'};return _0x4bf1a4;})});}_0x38dfc0=_['merge']({},_0x38dfc0,_0x4b6c8d[_0xd4d0('0x50')]);return _0x198223['getApplications'](_0x38dfc0);}})['then'](function(_0x144173){if(_0x144173){_0x5de101=_0x144173[_0xd4d0('0x47')];if(!_0x4b6c8d[_0xd4d0('0x42')]['hasOwnProperty']('nolimit')){_0x38dfc0[_0xd4d0('0x4a')]=qs[_0xd4d0('0x4a')](_0x4b6c8d[_0xd4d0('0x42')][_0xd4d0('0x4a')]);_0x38dfc0['offset']=qs[_0xd4d0('0x2f')](_0x4b6c8d[_0xd4d0('0x42')]['offset']);}return _0x198223[_0xd4d0('0x7d')](_0x38dfc0);}})['then'](function(_0x40fd90){if(_0x40fd90){return _0x40fd90?{'count':_0x5de101,'rows':_0x40fd90}:null;}})['then'](respondWithResult(_0x474fc1,null))[_0xd4d0('0x2a')](handleError(_0x474fc1,null));};exports['notify']=function(_0x5de3ec,_0x3627fe,_0x2e0077){var _0x20f976={'channel':_0xd4d0('0x7e')};var _0x247dae=[];var _0x2e7dbd=[];var _0x56c2b7={};return db[_0xd4d0('0x3d')]['find']({'where':{'id':_0x5de3ec[_0xd4d0('0x56')]['id']},'include':[{'model':db[_0xd4d0('0x78')],'as':_0xd4d0('0x7f')}]})[_0xd4d0('0x22')](handleEntityNotFound(_0x3627fe,null))[_0xd4d0('0x22')](function(_0x17837f){_0x20f976[_0xd4d0('0x80')]=_0x17837f;if(_0x20f976[_0xd4d0('0x80')]&&_0x20f976['account'][_0xd4d0('0x40')]===_0xd4d0('0x81')&&_0x5de3ec[_0xd4d0('0x5a')][_0xd4d0('0x82')]){if(_0x5de3ec[_0xd4d0('0x5a')][_0xd4d0('0x82')]['length']===0x0)return;if(_0x5de3ec[_0xd4d0('0x5a')][_0xd4d0('0x82')][0x0][_0xd4d0('0x83')]!==_0xd4d0('0x84'))return;return db[_0xd4d0('0x85')]['update']({'read':!![],'readAt':_0x5de3ec['body'][_0xd4d0('0x82')][0x0]['timestamp']},{'where':{'messageId':_0x5de3ec[_0xd4d0('0x5a')][_0xd4d0('0x82')][0x0][_0xd4d0('0x86')]},'individualHooks':!![]})[_0xd4d0('0x22')](function(_0xed09a9){return _0x3627fe[_0xd4d0('0x2c')](0xc8)[_0xd4d0('0x2e')](_0xed09a9);});}_0x20f976['applications']=_[_0xd4d0('0x87')](_0x17837f[_0xd4d0('0x7f')],[_0xd4d0('0x7b')],[_0xd4d0('0x88')]);if(_0x20f976['account'][_0xd4d0('0x7f')]){delete _0x20f976[_0xd4d0('0x80')]['Applications'];}return db[_0xd4d0('0x89')][_0xd4d0('0x61')]()[_0xd4d0('0x22')](function(_0x186206){if(!_0x186206){throw new db['Sequelize'][(_0xd4d0('0x8a'))](_0xd4d0('0x8b'));}_0x247dae=_[_0xd4d0('0x8c')](_[_0xd4d0('0x58')](_0x186206),['createdAt',_0xd4d0('0x8d')]);_0x2e7dbd=_['difference'](_[_0xd4d0('0x58')](_0x186206),[_0xd4d0('0x8e'),_0xd4d0('0x8d'),_0xd4d0('0x8f'),_0xd4d0('0x90')]);_0x20f976[_0xd4d0('0x5a')]={'mapKey':_0xd4d0('0x91')};if(_0x20f976[_0xd4d0('0x80')]&&_0x20f976['account']['type']==='twilio'){_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x92')]=_0x5de3ec[_0xd4d0('0x5a')]['From']['replace'](_0xd4d0('0x93'),'');_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x5a')]=_0x5de3ec[_0xd4d0('0x5a')][_0xd4d0('0x94')];_0x20f976[_0xd4d0('0x5a')]['messageId']=_0x5de3ec[_0xd4d0('0x5a')][_0xd4d0('0x95')];}if(_0x20f976['account']&&_0x20f976['account']['type']==='sinch'){_0x20f976['body'][_0xd4d0('0x92')]=_0x5de3ec[_0xd4d0('0x5a')]['notifications'][0x0][_0xd4d0('0x92')];_0x20f976[_0xd4d0('0x5a')]['body']=_0x5de3ec[_0xd4d0('0x5a')]['notifications'][0x0][_0xd4d0('0x28')]['body'];_0x20f976['body'][_0xd4d0('0x96')]=_0x5de3ec['body'][_0xd4d0('0x97')][0x0]['message_id'];}if(_0x20f976[_0xd4d0('0x5a')]['id']){delete _0x20f976[_0xd4d0('0x5a')]['id'];}if(_['isNil'](_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x92')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x20f976['body']['body'])||_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x5a')]===''){throw new db[(_0xd4d0('0x98'))][(_0xd4d0('0x8a'))](_0xd4d0('0x99'));}if(_[_0xd4d0('0x9a')](_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x9b')])){throw new db[(_0xd4d0('0x98'))][(_0xd4d0('0x8a'))](_0xd4d0('0x9c')+_0x2e7dbd);}if(!_['includes'](_0x2e7dbd,_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x9b')])){throw new db[(_0xd4d0('0x98'))]['ValidationError'](_0xd4d0('0x9d')+_0x2e7dbd);}_0x56c2b7[_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x9b')]]=_0x20f976['body'][_0xd4d0('0x92')];return db['CmList'][_0xd4d0('0x5d')]({'where':{'id':_0x20f976[_0xd4d0('0x80')][_0xd4d0('0x90')]},'include':[{'model':db[_0xd4d0('0x89')],'as':'Contacts','where':_0x56c2b7,'limit':0x1,'order':[[_0xd4d0('0x8d'),_0xd4d0('0x9e')]]}]});})['then'](handleEntityNotFound(_0x3627fe,null))[_0xd4d0('0x22')](function(_0x1a0bb6){if(_0x1a0bb6){_0x20f976[_0xd4d0('0x9f')]=_[_0xd4d0('0xa0')](_0x1a0bb6,['Contacts']);if(_0x1a0bb6[_0xd4d0('0xa1')][_0xd4d0('0x47')]){return _0x1a0bb6[_0xd4d0('0xa1')][0x0];}var _0x23327e=_[_0xd4d0('0x1a')](_0x20f976['body'],{'firstName':_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x92')],'ListId':_0x1a0bb6['id']});_0x23327e[_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x9b')]]=_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x92')];return db[_0xd4d0('0x89')]['create'](_0x23327e,{'fields':_0x247dae,'raw':!![]});}})[_0xd4d0('0x22')](handleEntityNotFound(_0x3627fe,null))['then'](function(_0x47a413){if(_0x47a413){_0x20f976['contact']=_0x47a413;var _0x30acc5={'ContactId':_0x47a413['id'],'phone':_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x92')],'WhatsappAccountId':_0x5de3ec['params']['id']};var _0x4e53c0={'ContactId':_0x47a413['id'],'WhatsappAccountId':_0x5de3ec[_0xd4d0('0x56')]['id'],'closed':![]};return db[_0xd4d0('0xa2')]['find']({'where':_0x4e53c0})['then'](function(_0xff65cc){if(_0xff65cc){return[_0xff65cc,![]];}return db[_0xd4d0('0xa2')][_0xd4d0('0x59')](_0x30acc5)[_0xd4d0('0x22')](function(_0x4d8fb9){return[_0x4d8fb9,!![]];});});}})['spread'](function(_0x41d4ce,_0x59dba0){_0x20f976[_0xd4d0('0xa3')]=_0x41d4ce[_0xd4d0('0x35')]({'plain':!![]});_0x20f976['interaction']['created']=![];if(_0x59dba0){if(_0x20f976['account'][_0xd4d0('0xa4')]){_0x20f976[_0xd4d0('0xa5')][_0xd4d0('0xa6')]({'id':0x0,'priority':_0x20f976['applications']['length']+0x1,'app':_0xd4d0('0xa7'),'appdata':'unmanaged','interval':_0xd4d0('0xa8')});}_0x20f976['interaction'][_0xd4d0('0xa9')]=!![];}return db['WhatsappMessage'][_0xd4d0('0x59')]({'phone':_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x92')],'messageId':_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x96')],'body':_0x20f976[_0xd4d0('0x5a')][_0xd4d0('0x5a')],'WhatsappAccountId':_0x5de3ec[_0xd4d0('0x56')]['id'],'WhatsappInteractionId':_0x41d4ce['id'],'direction':'in','ContactId':_0x41d4ce[_0xd4d0('0xaa')],'AttachmentId':_0x20f976[_0xd4d0('0x5a')]['AttachmentId']});})[_0xd4d0('0x22')](function(_0x2aa59f){_0x20f976[_0xd4d0('0x28')]=_0x2aa59f;if(_0x20f976[_0xd4d0('0xa3')]['UserId']){return db['User']['find']({'attributes':['id',_0xd4d0('0x38')],'where':{'id':_0x20f976[_0xd4d0('0xa3')][_0xd4d0('0xab')]}})[_0xd4d0('0x22')](function(_0x8199b0){if(_0x8199b0){_0x20f976[_0xd4d0('0xa5')][_0xd4d0('0xac')]({'id':0x0,'priority':0x0,'app':_0xd4d0('0xad'),'appdata':_0x8199b0[_0xd4d0('0x38')]+','+(_0x20f976[_0xd4d0('0x80')]['waitForTheAssignedAgent']||0xa),'interval':_0xd4d0('0xa8')});}return respondWithRpcPromise(_0xd4d0('0xae'),'startRouting',_0x20f976);});}return respondWithRpcPromise(_0xd4d0('0xae'),_0xd4d0('0xaf'),_0x20f976);})['then'](function(_0x5be6af){if(_0x5be6af){var _0x565435=0xc8;var _0x3f3f0e=_0xd4d0('0xb0');logger[_0xd4d0('0x23')](_0xd4d0('0xb1'),_0x3f3f0e,_0x565435,_0xd4d0('0xb2'));logger[_0xd4d0('0xb3')](_0xd4d0('0xb4'),_0x3f3f0e,_0x565435,_0xd4d0('0xb2'),JSON[_0xd4d0('0xb5')](_0x5be6af));if(_0x20f976[_0xd4d0('0x80')][_0xd4d0('0x40')]===_0xd4d0('0xb6')){return _0x3627fe[_0xd4d0('0x2c')](_0x565435)[_0xd4d0('0x32')](_0xd4d0('0xb7'),_0xd4d0('0xb8'))[_0xd4d0('0x39')](_0xd4d0('0xb9'));}else{return _0x3627fe['status'](_0x565435)[_0xd4d0('0x2e')](_0x5be6af);}}});})[_0xd4d0('0x2a')](handleError(_0x3627fe,null));};exports[_0xd4d0('0x39')]=function(_0x4b8b88,_0x347e5f,_0x23ebdb){var _0x13e2cd,_0x328028,_0x4d9223;if(_[_0xd4d0('0x9a')](_0x4b8b88['body']['body'])||_0x4b8b88[_0xd4d0('0x5a')][_0xd4d0('0x5a')]===''){throw new db[(_0xd4d0('0x98'))][(_0xd4d0('0x8a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd4d0('0x9a')](_0x4b8b88[_0xd4d0('0x5a')]['to'])){throw new db['Sequelize'][(_0xd4d0('0x8a'))]('to\x20is\x20mandatory');}_0x13e2cd=_0x4b8b88[_0xd4d0('0x5a')]['to'];return db[_0xd4d0('0x3d')][_0xd4d0('0x5d')]({'where':{'id':_0x4b8b88['params']['id']},'include':[{'model':db[_0xd4d0('0xba')],'as':_0xd4d0('0xbb'),'include':[{'model':db['CmContact'],'as':_0xd4d0('0xa1'),'where':{'mobile':_0x13e2cd},'limit':0x1,'order':[[_0xd4d0('0x8d'),_0xd4d0('0x9e')]]}]}]})['then'](handleEntityNotFound(_0x347e5f,null))['then'](function(_0x303857){if(_0x303857&&_0x303857[_0xd4d0('0xbb')]){_0x328028=_0x303857[_0xd4d0('0x35')]({'plain':!![]});if(_0x328028[_0xd4d0('0xbb')]&&_0x328028[_0xd4d0('0xbb')][_0xd4d0('0xa1')][_0xd4d0('0x47')]){return _0x328028[_0xd4d0('0xbb')][_0xd4d0('0xa1')][0x0];}return db[_0xd4d0('0x89')][_0xd4d0('0x59')](_[_0xd4d0('0x1a')](_0x4b8b88[_0xd4d0('0x5a')],{'firstName':_0x13e2cd,'mobile':_0x13e2cd,'phone':_0x13e2cd,'ListId':_0x328028[_0xd4d0('0x90')]}));}})['then'](handleEntityNotFound(_0x347e5f,null))[_0xd4d0('0x22')](function(_0x17bf9a){if(_0x17bf9a){_0x4d9223=_0x17bf9a;return db[_0xd4d0('0xa2')][_0xd4d0('0x5d')]({'where':{'ContactId':_0x4d9223['id'],'closed':![],'WhatsappAccountId':_0x328028['id']}})[_0xd4d0('0x22')](function(_0x3110f6){if(_0x3110f6){return[_0x3110f6,![]];}return db[_0xd4d0('0xa2')][_0xd4d0('0x59')]({'UserId':_0x4b8b88['user']['id'],'ContactId':_0x4d9223['id'],'WhatsappAccountId':_0x328028['id'],'phone':_0x13e2cd,'firstMsgDirection':'out','Messages':[_[_0xd4d0('0x4e')](_0x4b8b88[_0xd4d0('0x5a')],{'read':![],'body':_0x4b8b88[_0xd4d0('0x5a')]['body'],'phone':_0x13e2cd,'WhatsappAccountId':_0x328028['id'],'UserId':_0x4b8b88[_0xd4d0('0x5b')]['id'],'ContactId':_0x4d9223['id']})]},{'include':[{'model':db[_0xd4d0('0x85')],'as':_0xd4d0('0xbc')}]})['then'](function(_0xd1bf14){return[_0xd1bf14,!![]];});});}})[_0xd4d0('0xbd')](function(_0x15917c,_0x568a09){if(_0x568a09){return _0x15917c;}return db[_0xd4d0('0x85')]['create'](_[_0xd4d0('0x4e')](_0x4b8b88['body'],{'read':![],'body':_0x4b8b88[_0xd4d0('0x5a')][_0xd4d0('0x5a')],'phone':_0x13e2cd,'WhatsappAccountId':_0x328028['id'],'WhatsappInteractionId':_0x15917c['id'],'UserId':_0x4b8b88[_0xd4d0('0x5b')]['id'],'ContactId':_0x4d9223['id']}))[_0xd4d0('0x22')](function(_0x1720a9){_0x15917c['dataValues'][_0xd4d0('0xbc')]=[];_0x15917c[_0xd4d0('0xbe')][_0xd4d0('0xbc')]['push'](_0x1720a9[_0xd4d0('0xbe')]);return _0x15917c;});})[_0xd4d0('0x22')](respondWithResult(_0x347e5f,null))[_0xd4d0('0x2a')](handleError(_0x347e5f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index ef02968..e50f82e 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 _0x26df=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x167d56,_0x24b56a){var _0x5c8a9d=function(_0x5a7ede){while(--_0x5a7ede){_0x167d56['push'](_0x167d56['shift']());}};_0x5c8a9d(++_0x24b56a);}(_0x26df,0x149));var _0xf26d=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x26df[_0x5beda8];return _0x2aa042;};'use strict';var EventEmitter=require(_0xf26d('0x0'));var WhatsappAccount=require(_0xf26d('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf26d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf26d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5ac2e4){return function(_0x411abe,_0x6da946,_0xacee27){WhatsappAccountEvents[_0xf26d('0x4')](_0x5ac2e4+':'+_0x411abe['id'],_0x411abe);WhatsappAccountEvents[_0xf26d('0x4')](_0x5ac2e4,_0x411abe);_0xacee27(null);};}for(var e in events){if(events[_0xf26d('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xf26d('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x61c8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappAccount'];(function(_0x3cc8e2,_0x247224){var _0x10a33c=function(_0x9366a5){while(--_0x9366a5){_0x3cc8e2['push'](_0x3cc8e2['shift']());}};_0x10a33c(++_0x247224);}(_0x61c8,0xbb));var _0x861c=function(_0x502ec7,_0x8e99b3){_0x502ec7=_0x502ec7-0x0;var _0x362b0f=_0x61c8[_0x502ec7];return _0x362b0f;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x861c('0x0'))['db'][_0x861c('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x861c('0x2')](0x0);var events={'afterCreate':_0x861c('0x3'),'afterUpdate':_0x861c('0x4'),'afterDestroy':_0x861c('0x5')};function emitEvent(_0x509ad0){return function(_0x1f42eb,_0x22176f,_0x1bff15){WhatsappAccountEvents[_0x861c('0x6')](_0x509ad0+':'+_0x1f42eb['id'],_0x1f42eb);WhatsappAccountEvents[_0x861c('0x6')](_0x509ad0,_0x1f42eb);_0x1bff15(null);};}for(var e in events){if(events[_0x861c('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x861c('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 5d93053..7dc0230 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 _0x8ebe=['lodash','api','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x5dbf5a,_0x4077b8){var _0xe6272a=function(_0x32f641){while(--_0x32f641){_0x5dbf5a['push'](_0x5dbf5a['shift']());}};_0xe6272a(++_0x4077b8);}(_0x8ebe,0xea));var _0xe8eb=function(_0x59522a,_0x14d1e5){_0x59522a=_0x59522a-0x0;var _0x30f09d=_0x8ebe[_0x59522a];return _0x30f09d;};'use strict';var _=require(_0xe8eb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe8eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8eb('0x2'));var rimraf=require('rimraf');var config=require(_0xe8eb('0x3'));var attributes=require(_0xe8eb('0x4'));module[_0xe8eb('0x5')]=function(_0x1b92de,_0x2753d5){return _0x1b92de[_0xe8eb('0x6')](_0xe8eb('0x7'),attributes,{'tableName':_0xe8eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60cb=['rimraf','./whatsappAccount.attributes','exports','define','whatsapp_accounts','util','api','moment','bluebird','request-promise'];(function(_0x13f030,_0x416e17){var _0x4c10b0=function(_0x4faa86){while(--_0x4faa86){_0x13f030['push'](_0x13f030['shift']());}};_0x4c10b0(++_0x416e17);}(_0x60cb,0x113));var _0xb60c=function(_0x5a540c,_0x5e40c8){_0x5a540c=_0x5a540c-0x0;var _0x5139f0=_0x60cb[_0x5a540c];return _0x5139f0;};'use strict';var _=require('lodash');var util=require(_0xb60c('0x0'));var logger=require('../../config/logger')(_0xb60c('0x1'));var moment=require(_0xb60c('0x2'));var BPromise=require(_0xb60c('0x3'));var rp=require(_0xb60c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb60c('0x5'));var config=require('../../config/environment');var attributes=require(_0xb60c('0x6'));module[_0xb60c('0x7')]=function(_0x4e515a,_0x492b89){return _0x4e515a[_0xb60c('0x8')]('WhatsappAccount',attributes,{'tableName':_0xb60c('0x9'),'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 31786b9..39ca032 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 _0xcabf=['request','info','request\x20sent','debug','stringify','error','code','message','result','catch','options','raw','include','map','model','attributes','then','ShowWhatsappAccount','lodash','util','ioredis','rpc','jayson/promise','client','http','defaults','redis','localhost','./whatsappAccount.socket','register'];(function(_0x20acdb,_0x210c8e){var _0x383b0d=function(_0x5d0919){while(--_0x5d0919){_0x20acdb['push'](_0x20acdb['shift']());}};_0x383b0d(++_0x210c8e);}(_0xcabf,0x102));var _0xfcab=function(_0x1ef7fa,_0x99e53d){_0x1ef7fa=_0x1ef7fa-0x0;var _0x35fd36=_0xcabf[_0x1ef7fa];return _0x35fd36;};'use strict';var _=require(_0xfcab('0x0'));var util=require(_0xfcab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcab('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfcab('0x3'));var config=require('../../config/environment');var jayson=require(_0xfcab('0x4'));var client=jayson[_0xfcab('0x5')][_0xfcab('0x6')]({'port':0x232a});config['redis']=_[_0xfcab('0x7')](config[_0xfcab('0x8')],{'host':_0xfcab('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcab('0x8')]));require(_0xfcab('0xa'))[_0xfcab('0xb')](socket);function respondWithRpcPromise(_0x18d16c,_0x4c3e37,_0x477f95){return new BPromise(function(_0x473f10,_0x505cfd){return client[_0xfcab('0xc')](_0x18d16c,_0x477f95)['then'](function(_0x23d2a7){logger[_0xfcab('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x4c3e37,_0xfcab('0xe'));logger[_0xfcab('0xf')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4c3e37,'request\x20sent',JSON[_0xfcab('0x10')](_0x23d2a7));if(_0x23d2a7[_0xfcab('0x11')]){if(_0x23d2a7[_0xfcab('0x11')][_0xfcab('0x12')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4c3e37,_0x23d2a7[_0xfcab('0x11')][_0xfcab('0x13')]);return _0x505cfd(_0x23d2a7[_0xfcab('0x11')][_0xfcab('0x13')]);}logger[_0xfcab('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x4c3e37,_0x23d2a7[_0xfcab('0x11')][_0xfcab('0x13')]);return _0x473f10(_0x23d2a7[_0xfcab('0x11')][_0xfcab('0x13')]);}else{logger[_0xfcab('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x4c3e37,_0xfcab('0xe'));_0x473f10(_0x23d2a7[_0xfcab('0x14')][_0xfcab('0x13')]);}})[_0xfcab('0x15')](function(_0x4e8ed6){logger[_0xfcab('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x4c3e37,_0x4e8ed6);_0x505cfd(_0x4e8ed6);});});}exports['ShowWhatsappAccount']=function(_0x485ff5){var _0x307e74=this;return new Promise(function(_0x5cb321,_0x1f59b1){return db['WhatsappAccount']['find']({'raw':_0x485ff5[_0xfcab('0x16')]?_0x485ff5[_0xfcab('0x16')][_0xfcab('0x17')]===undefined?!![]:![]:!![],'where':_0x485ff5[_0xfcab('0x16')]?_0x485ff5[_0xfcab('0x16')]['where']||null:null,'attributes':_0x485ff5[_0xfcab('0x16')]?_0x485ff5[_0xfcab('0x16')]['attributes']||null:null,'include':_0x485ff5[_0xfcab('0x16')]?_0x485ff5[_0xfcab('0x16')][_0xfcab('0x18')]?_[_0xfcab('0x19')](_0x485ff5[_0xfcab('0x16')][_0xfcab('0x18')],function(_0x1fbe42){return{'model':db[_0x1fbe42[_0xfcab('0x1a')]],'as':_0x1fbe42['as'],'attributes':_0x1fbe42['attributes'],'include':_0x1fbe42[_0xfcab('0x18')]?_['map'](_0x1fbe42[_0xfcab('0x18')],function(_0xc4ed52){return{'model':db[_0xc4ed52[_0xfcab('0x1a')]],'as':_0xc4ed52['as'],'attributes':_0xc4ed52[_0xfcab('0x1b')],'include':_0xc4ed52['include']?_[_0xfcab('0x19')](_0xc4ed52['include'],function(_0x5f4e01){return{'model':db[_0x5f4e01['model']],'as':_0x5f4e01['as'],'attributes':_0x5f4e01[_0xfcab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfcab('0x1c')](function(_0x321d82){logger['info'](_0xfcab('0x1d'),_0x485ff5);logger[_0xfcab('0xf')](_0xfcab('0x1d'),_0x485ff5,JSON[_0xfcab('0x10')](_0x321d82));_0x5cb321(_0x321d82);})[_0xfcab('0x15')](function(_0xd75c3b){logger[_0xfcab('0x11')](_0xfcab('0x1d'),_0xd75c3b['message'],_0x485ff5);_0x1f59b1(_0x307e74[_0xfcab('0x11')](0x1f4,_0xd75c3b['message']));});});}; \ No newline at end of file +var _0xd283=['ShowWhatsappAccount','options','raw','attributes','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd283,0xf7));var _0x3d28=function(_0x5ef5c2,_0x202322){_0x5ef5c2=_0x5ef5c2-0x0;var _0x1d1641=_0xd283[_0x5ef5c2];return _0x1d1641;};'use strict';var _=require(_0x3d28('0x0'));var util=require(_0x3d28('0x1'));var moment=require(_0x3d28('0x2'));var BPromise=require(_0x3d28('0x3'));var rs=require(_0x3d28('0x4'));var fs=require('fs');var Redis=require(_0x3d28('0x5'));var db=require(_0x3d28('0x6'))['db'];var utils=require(_0x3d28('0x7'));var logger=require(_0x3d28('0x8'))('rpc');var config=require(_0x3d28('0x9'));var jayson=require(_0x3d28('0xa'));var client=jayson[_0x3d28('0xb')][_0x3d28('0xc')]({'port':0x232a});config[_0x3d28('0xd')]=_['defaults'](config[_0x3d28('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d28('0xe'))(new Redis(config[_0x3d28('0xd')]));require(_0x3d28('0xf'))[_0x3d28('0x10')](socket);function respondWithRpcPromise(_0x3cb883,_0x502bbd,_0x490e32){return new BPromise(function(_0x483503,_0x34f229){return client[_0x3d28('0x11')](_0x3cb883,_0x490e32)['then'](function(_0x3107e7){logger[_0x3d28('0x12')](_0x3d28('0x13'),_0x502bbd,_0x3d28('0x14'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x502bbd,_0x3d28('0x14'),JSON[_0x3d28('0x15')](_0x3107e7));if(_0x3107e7[_0x3d28('0x16')]){if(_0x3107e7[_0x3d28('0x16')]['code']===0x1f4){logger[_0x3d28('0x16')](_0x3d28('0x13'),_0x502bbd,_0x3107e7[_0x3d28('0x16')]['message']);return _0x34f229(_0x3107e7[_0x3d28('0x16')][_0x3d28('0x17')]);}logger[_0x3d28('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x502bbd,_0x3107e7[_0x3d28('0x16')][_0x3d28('0x17')]);return _0x483503(_0x3107e7[_0x3d28('0x16')][_0x3d28('0x17')]);}else{logger[_0x3d28('0x12')](_0x3d28('0x13'),_0x502bbd,_0x3d28('0x14'));_0x483503(_0x3107e7['result']['message']);}})[_0x3d28('0x18')](function(_0x45153b){logger['error'](_0x3d28('0x13'),_0x502bbd,_0x45153b);_0x34f229(_0x45153b);});});}exports[_0x3d28('0x19')]=function(_0xbb729e){var _0x213afb=this;return new Promise(function(_0xd69428,_0x39a50c){return db['WhatsappAccount']['find']({'raw':_0xbb729e[_0x3d28('0x1a')]?_0xbb729e['options'][_0x3d28('0x1b')]===undefined?!![]:![]:!![],'where':_0xbb729e[_0x3d28('0x1a')]?_0xbb729e[_0x3d28('0x1a')]['where']||null:null,'attributes':_0xbb729e[_0x3d28('0x1a')]?_0xbb729e[_0x3d28('0x1a')][_0x3d28('0x1c')]||null:null,'include':_0xbb729e[_0x3d28('0x1a')]?_0xbb729e['options'][_0x3d28('0x1d')]?_[_0x3d28('0x1e')](_0xbb729e[_0x3d28('0x1a')][_0x3d28('0x1d')],function(_0x580637){return{'model':db[_0x580637[_0x3d28('0x1f')]],'as':_0x580637['as'],'attributes':_0x580637[_0x3d28('0x1c')],'include':_0x580637[_0x3d28('0x1d')]?_['map'](_0x580637[_0x3d28('0x1d')],function(_0x1d2050){return{'model':db[_0x1d2050[_0x3d28('0x1f')]],'as':_0x1d2050['as'],'attributes':_0x1d2050[_0x3d28('0x1c')],'include':_0x1d2050['include']?_[_0x3d28('0x1e')](_0x1d2050[_0x3d28('0x1d')],function(_0x1992b6){return{'model':db[_0x1992b6[_0x3d28('0x1f')]],'as':_0x1992b6['as'],'attributes':_0x1992b6[_0x3d28('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3d28('0x20')](function(_0x1c2856){logger['info'](_0x3d28('0x19'),_0xbb729e);logger[_0x3d28('0x21')](_0x3d28('0x19'),_0xbb729e,JSON[_0x3d28('0x15')](_0x1c2856));_0xd69428(_0x1c2856);})[_0x3d28('0x18')](function(_0x3e55ba){logger[_0x3d28('0x16')](_0x3d28('0x19'),_0x3e55ba[_0x3d28('0x17')],_0xbb729e);_0x39a50c(_0x213afb[_0x3d28('0x16')](0x1f4,_0x3e55ba['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 0a9a56b..8821573 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 _0x4d3b=['update','emit','removeListener','register','length','save','remove'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x4d3b,0x75));var _0xb4d3=function(_0x274a0a,_0x7af9e){_0x274a0a=_0x274a0a-0x0;var _0x3ba22b=_0x4d3b[_0x274a0a];return _0x3ba22b;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xb4d3('0x0'),_0xb4d3('0x1'),_0xb4d3('0x2')];function createListener(_0x46cbaf,_0x1109cd){return function(_0x2e7f28){_0x1109cd[_0xb4d3('0x3')](_0x46cbaf,_0x2e7f28);};}function removeListener(_0x334318,_0x5bb29a){return function(){WhatsappAccountEvents[_0xb4d3('0x4')](_0x334318,_0x5bb29a);};}exports[_0xb4d3('0x5')]=function(_0x8d367){for(var _0x2f5f11=0x0,_0x34d5f5=events[_0xb4d3('0x6')];_0x2f5f11<_0x34d5f5;_0x2f5f11++){var _0x914469=events[_0x2f5f11];var _0x131e09=createListener('whatsappAccount:'+_0x914469,_0x8d367);WhatsappAccountEvents['on'](_0x914469,_0x131e09);}}; \ No newline at end of file +var _0x5417=['whatsappAccount:','./whatsappAccount.events','save','update','emit','removeListener','register'];(function(_0x483643,_0x4afa1b){var _0x19a20c=function(_0x5e0e16){while(--_0x5e0e16){_0x483643['push'](_0x483643['shift']());}};_0x19a20c(++_0x4afa1b);}(_0x5417,0xcc));var _0x7541=function(_0x2b7252,_0x4b10bb){_0x2b7252=_0x2b7252-0x0;var _0x481499=_0x5417[_0x2b7252];return _0x481499;};'use strict';var WhatsappAccountEvents=require(_0x7541('0x0'));var events=[_0x7541('0x1'),'remove',_0x7541('0x2')];function createListener(_0x316956,_0x1c6b5b){return function(_0x44bb47){_0x1c6b5b[_0x7541('0x3')](_0x316956,_0x44bb47);};}function removeListener(_0x21e4a0,_0x5d0125){return function(){WhatsappAccountEvents[_0x7541('0x4')](_0x21e4a0,_0x5d0125);};}exports[_0x7541('0x5')]=function(_0x54bbf7){for(var _0x585c26=0x0,_0x33e794=events['length'];_0x585c26<_0x33e794;_0x585c26++){var _0x41dd25=events[_0x585c26];var _0x411399=createListener(_0x7541('0x6')+_0x41dd25,_0x54bbf7);WhatsappAccountEvents['on'](_0x41dd25,_0x411399);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 2934dd0..fd9ef33 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 _0x7f1e=['../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','show','put','/:id','update','delete','exports','path','connect-timeout','express'];(function(_0x69b3c4,_0x53132e){var _0x430258=function(_0x1f903c){while(--_0x1f903c){_0x69b3c4['push'](_0x69b3c4['shift']());}};_0x430258(++_0x53132e);}(_0x7f1e,0xa2));var _0xe7f1=function(_0x1494e9,_0x275e2e){_0x1494e9=_0x1494e9-0x0;var _0x10a5df=_0x7f1e[_0x1494e9];return _0x10a5df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7f1('0x0'));var timeout=require(_0xe7f1('0x1'));var express=require(_0xe7f1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe7f1('0x3'));var interaction=require(_0xe7f1('0x4'));var config=require('../../config/environment');var controller=require(_0xe7f1('0x5'));router[_0xe7f1('0x6')]('/',auth[_0xe7f1('0x7')](),controller[_0xe7f1('0x8')]);router[_0xe7f1('0x6')]('/:id',auth[_0xe7f1('0x7')](),controller[_0xe7f1('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe7f1('0xa')](_0xe7f1('0xb'),auth['isAuthenticated'](),controller[_0xe7f1('0xc')]);router[_0xe7f1('0xd')](_0xe7f1('0xb'),auth[_0xe7f1('0x7')](),controller['destroy']);module[_0xe7f1('0xe')]=router; \ No newline at end of file +var _0x76a7=['isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x49511b,_0x1f449e){var _0x5ee679=function(_0x47b9f6){while(--_0x47b9f6){_0x49511b['push'](_0x49511b['shift']());}};_0x5ee679(++_0x1f449e);}(_0x76a7,0x185));var _0x776a=function(_0x310407,_0x349ef9){_0x310407=_0x310407-0x0;var _0x234ee6=_0x76a7[_0x310407];return _0x234ee6;};'use strict';var multer=require(_0x776a('0x0'));var util=require(_0x776a('0x1'));var path=require(_0x776a('0x2'));var timeout=require(_0x776a('0x3'));var express=require(_0x776a('0x4'));var router=express[_0x776a('0x5')]();var fs_extra=require(_0x776a('0x6'));var auth=require(_0x776a('0x7'));var interaction=require(_0x776a('0x8'));var config=require(_0x776a('0x9'));var controller=require('./whatsappApplication.controller');router[_0x776a('0xa')]('/',auth[_0x776a('0xb')](),controller['index']);router[_0x776a('0xa')]('/:id',auth[_0x776a('0xb')](),controller[_0x776a('0xc')]);router[_0x776a('0xd')]('/',auth[_0x776a('0xb')](),controller[_0x776a('0xe')]);router['put'](_0x776a('0xf'),auth[_0x776a('0xb')](),controller[_0x776a('0x10')]);router[_0x776a('0x11')](_0x776a('0xf'),auth['isAuthenticated'](),controller[_0x776a('0x12')]);module[_0x776a('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 3164d6a..f18c18e 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 _0xe148=['*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0xc80f43,_0x5621ea){var _0x226f94=function(_0x2a3771){while(--_0x2a3771){_0xc80f43['push'](_0xc80f43['shift']());}};_0x226f94(++_0x5621ea);}(_0xe148,0x6a));var _0x8e14=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0xe148[_0xb5fc3e];return _0x2efc3c;};'use strict';var Sequelize=require('sequelize');module[_0x8e14('0x0')]={'priority':{'type':Sequelize[_0x8e14('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8e14('0x2')],'allowNull':![],'defaultValue':_0x8e14('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8e14('0x2')],'defaultValue':_0x8e14('0x4')}}; \ No newline at end of file +var _0xa21c=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x4bb987,_0x4a41da){var _0x503167=function(_0x10132c){while(--_0x10132c){_0x4bb987['push'](_0x4bb987['shift']());}};_0x503167(++_0x4a41da);}(_0xa21c,0x96));var _0xca21=function(_0x5dd49c,_0x254e27){_0x5dd49c=_0x5dd49c-0x0;var _0x3a91c1=_0xa21c[_0x5dd49c];return _0x3a91c1;};'use strict';var Sequelize=require(_0xca21('0x0'));module[_0xca21('0x1')]={'priority':{'type':Sequelize[_0xca21('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xca21('0x3')],'allowNull':![],'defaultValue':_0xca21('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xca21('0x3')]},'interval':{'type':Sequelize[_0xca21('0x3')],'defaultValue':_0xca21('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e7510d6..6ac0cce 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 _0x6d11=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','then','destroy','stack','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','fields','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x4969dd,_0x41474c){var _0x3ca693=function(_0xb73ad7){while(--_0xb73ad7){_0x4969dd['push'](_0x4969dd['shift']());}};_0x3ca693(++_0x41474c);}(_0x6d11,0xbf));var _0x16d1=function(_0x4cc730,_0x4c6616){_0x4cc730=_0x4cc730-0x0;var _0x1bf5d9=_0x6d11[_0x4cc730];return _0x1bf5d9;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)[_0x16d1('0x1b')]();});}};}function handleEntityNotFound(_0x335c24,_0x4b2b5c){return function(_0x15203b){if(!_0x15203b){_0x335c24[_0x16d1('0x19')](0x194);}return _0x15203b;};}function handleError(_0x262f89,_0x346b69){_0x346b69=_0x346b69||0x1f4;return function(_0x2b8403){logger['error'](_0x2b8403[_0x16d1('0x24')]);if(_0x2b8403[_0x16d1('0x25')]){delete _0x2b8403[_0x16d1('0x25')];}_0x262f89['status'](_0x346b69)[_0x16d1('0x26')](_0x2b8403);};}exports[_0x16d1('0x27')]=function(_0x364bf7,_0x22e5b3){var _0x6396fc={},_0x462e5b={},_0x1dd574={'count':0x0,'rows':[]};var _0x562908=_[_0x16d1('0x28')](db[_0x16d1('0x29')][_0x16d1('0x2a')],function(_0x30cd8f){return{'name':_0x30cd8f['fieldName'],'type':_0x30cd8f['type'][_0x16d1('0x2b')]};});_0x462e5b[_0x16d1('0x2c')]=_[_0x16d1('0x28')](_0x562908,_0x16d1('0x25'));_0x462e5b[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x364bf7[_0x16d1('0x2d')]);_0x462e5b[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],_0x462e5b[_0x16d1('0x2d')]);_0x6396fc[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],qs['fields'](_0x364bf7[_0x16d1('0x2d')]['fields']));_0x6396fc[_0x16d1('0x31')]=_0x6396fc[_0x16d1('0x31')][_0x16d1('0x32')]?_0x6396fc[_0x16d1('0x31')]:_0x462e5b[_0x16d1('0x2c')];if(!_0x364bf7[_0x16d1('0x2d')]['hasOwnProperty']('nolimit')){_0x6396fc['limit']=qs[_0x16d1('0x1f')](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1f')]);_0x6396fc[_0x16d1('0x1d')]=qs['offset'](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1d')]);}_0x6396fc['order']=qs['sort'](_0x364bf7['query'][_0x16d1('0x33')]);_0x6396fc[_0x16d1('0x34')]=qs[_0x16d1('0x2f')](_['pick'](_0x364bf7[_0x16d1('0x2d')],_0x462e5b[_0x16d1('0x2f')]),_0x562908);if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]){_0x6396fc[_0x16d1('0x34')]=_[_0x16d1('0x36')](_0x6396fc[_0x16d1('0x34')],{'$or':_['map'](_0x562908,function(_0x50267b){if(_0x50267b['type']!==_0x16d1('0x37')){var _0x2306d3={};_0x2306d3[_0x50267b[_0x16d1('0x25')]]={'$like':'%'+_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]+'%'};return _0x2306d3;}})});}_0x6396fc=_[_0x16d1('0x36')]({},_0x6396fc,_0x364bf7[_0x16d1('0x38')]);var _0x369b1c={'where':_0x6396fc['where']};return db[_0x16d1('0x29')]['count'](_0x369b1c)['then'](function(_0x352c5b){_0x1dd574[_0x16d1('0x39')]=_0x352c5b;if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x6396fc[_0x16d1('0x3b')]=[{'all':!![]}];}return db[_0x16d1('0x29')]['findAll'](_0x6396fc);})[_0x16d1('0x22')](function(_0x525212){_0x1dd574['rows']=_0x525212;return _0x1dd574;})['then'](respondWithFilteredResult(_0x22e5b3,_0x6396fc))['catch'](handleError(_0x22e5b3,null));};exports[_0x16d1('0x3c')]=function(_0x168e14,_0x24038b){var _0x1eb761={'raw':!![],'where':{'id':_0x168e14[_0x16d1('0x3d')]['id']}},_0x53de06={};_0x53de06['model']=_[_0x16d1('0x2e')](db[_0x16d1('0x29')][_0x16d1('0x2a')]);_0x53de06[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x168e14[_0x16d1('0x2d')]);_0x53de06[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],_0x53de06[_0x16d1('0x2d')]);_0x1eb761[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],qs[_0x16d1('0x3e')](_0x168e14[_0x16d1('0x2d')]['fields']));_0x1eb761['attributes']=_0x1eb761[_0x16d1('0x31')][_0x16d1('0x32')]?_0x1eb761[_0x16d1('0x31')]:_0x53de06[_0x16d1('0x2c')];if(_0x168e14[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x1eb761['include']=[{'all':!![]}];}_0x1eb761=_[_0x16d1('0x36')]({},_0x1eb761,_0x168e14[_0x16d1('0x38')]);return db[_0x16d1('0x29')]['find'](_0x1eb761)['then'](handleEntityNotFound(_0x24038b,null))[_0x16d1('0x22')](respondWithResult(_0x24038b,null))[_0x16d1('0x3f')](handleError(_0x24038b,null));};exports['create']=function(_0x1cc137,_0x583151){return db[_0x16d1('0x29')][_0x16d1('0x40')](_0x1cc137[_0x16d1('0x41')],{})[_0x16d1('0x22')](respondWithResult(_0x583151,0xc9))['catch'](handleError(_0x583151,null));};exports['update']=function(_0x1d92cd,_0x8bb0c1){if(_0x1d92cd['body']['id']){delete _0x1d92cd[_0x16d1('0x41')]['id'];}return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x1d92cd[_0x16d1('0x3d')]['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x8bb0c1,null))['then'](saveUpdates(_0x1d92cd[_0x16d1('0x41')],null))['then'](respondWithResult(_0x8bb0c1,null))[_0x16d1('0x3f')](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x23')]=function(_0x5d384c,_0x413acd){return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x5d384c[_0x16d1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x413acd,null))['then'](removeEntity(_0x413acd,null))['catch'](handleError(_0x413acd,null));}; \ No newline at end of file +var _0x89fb=['sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','update','then','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','create','body','find','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5a60e3,_0x8c2d09){var _0x3074fc=function(_0x106858){while(--_0x106858){_0x5a60e3['push'](_0x5a60e3['shift']());}};_0x3074fc(++_0x8c2d09);}(_0x89fb,0x14b));var _0xb89f=function(_0x44620f,_0x130940){_0x44620f=_0x44620f-0x0;var _0x36d37e=_0x89fb[_0x44620f];return _0x36d37e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb89f('0x0'));var zipdir=require(_0xb89f('0x1'));var jsonpatch=require(_0xb89f('0x2'));var rp=require(_0xb89f('0x3'));var moment=require(_0xb89f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb89f('0x5'));var util=require(_0xb89f('0x6'));var path=require(_0xb89f('0x7'));var sox=require(_0xb89f('0x8'));var csv=require(_0xb89f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb89f('0xa'));var _=require('lodash');var squel=require(_0xb89f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb89f('0xc'));var deskjs=require(_0xb89f('0xd'));var toCsv=require(_0xb89f('0x9'));var querystring=require('querystring');var Papa=require(_0xb89f('0xe'));var Redis=require(_0xb89f('0xf'));var authService=require(_0xb89f('0x10'));var qs=require(_0xb89f('0x11'));var as=require(_0xb89f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb89f('0x13'));var utils=require(_0xb89f('0x14'));var config=require(_0xb89f('0x15'));var licenseUtil=require(_0xb89f('0x16'));var db=require(_0xb89f('0x17'))['db'];function respondWithStatusCode(_0x5ee4f8,_0xfec2b3){_0xfec2b3=_0xfec2b3||0xcc;return function(_0x453d78){if(_0x453d78){return _0x5ee4f8[_0xb89f('0x18')](_0xfec2b3);}return _0x5ee4f8[_0xb89f('0x19')](_0xfec2b3)[_0xb89f('0x1a')]();};}function respondWithResult(_0x422cd1,_0x482a90){_0x482a90=_0x482a90||0xc8;return function(_0x36a404){if(_0x36a404){return _0x422cd1[_0xb89f('0x19')](_0x482a90)[_0xb89f('0x1b')](_0x36a404);}};}function respondWithFilteredResult(_0x39a226,_0x1b6088){return function(_0x10ffba){if(_0x10ffba){var _0xb33497=typeof _0x1b6088['offset']===_0xb89f('0x1c')&&typeof _0x1b6088[_0xb89f('0x1d')]===_0xb89f('0x1c');var _0x43b231=_0x10ffba['count'];var _0x55c865=_0xb33497?0x0:_0x1b6088[_0xb89f('0x1e')];var _0x3004b7=_0xb33497?_0x10ffba[_0xb89f('0x1f')]:_0x1b6088['offset']+_0x1b6088['limit'];var _0x20e126;if(_0x3004b7>=_0x43b231){_0x3004b7=_0x43b231;_0x20e126=0xc8;}else{_0x20e126=0xce;}_0x39a226[_0xb89f('0x19')](_0x20e126);return _0x39a226[_0xb89f('0x20')](_0xb89f('0x21'),_0x55c865+'-'+_0x3004b7+'/'+_0x43b231)[_0xb89f('0x1b')](_0x10ffba);}return null;};}function patchUpdates(_0x3c772d){return function(_0x2f3846){try{jsonpatch['apply'](_0x2f3846,_0x3c772d,!![]);}catch(_0x59e898){return BPromise['reject'](_0x59e898);}return _0x2f3846['save']();};}function saveUpdates(_0x5ee95f,_0x42005c){return function(_0x510dfe){if(_0x510dfe){return _0x510dfe[_0xb89f('0x22')](_0x5ee95f)[_0xb89f('0x23')](function(_0x40f063){return _0x40f063;});}return null;};}function removeEntity(_0x1e5490,_0x19b881){return function(_0x2c8856){if(_0x2c8856){return _0x2c8856['destroy']()[_0xb89f('0x23')](function(){_0x1e5490[_0xb89f('0x19')](0xcc)[_0xb89f('0x1a')]();});}};}function handleEntityNotFound(_0x3b3829,_0x183928){return function(_0x2a22b6){if(!_0x2a22b6){_0x3b3829[_0xb89f('0x18')](0x194);}return _0x2a22b6;};}function handleError(_0x177db8,_0x4bef2e){_0x4bef2e=_0x4bef2e||0x1f4;return function(_0x20b2b7){logger[_0xb89f('0x24')](_0x20b2b7[_0xb89f('0x25')]);if(_0x20b2b7[_0xb89f('0x26')]){delete _0x20b2b7[_0xb89f('0x26')];}_0x177db8[_0xb89f('0x19')](_0x4bef2e)['send'](_0x20b2b7);};}exports[_0xb89f('0x27')]=function(_0x22b15f,_0x289d88){var _0x2ab40c={},_0x4eb8da={},_0x51218b={'count':0x0,'rows':[]};var _0x4bef24=_[_0xb89f('0x28')](db[_0xb89f('0x29')][_0xb89f('0x2a')],function(_0x3dd8aa){return{'name':_0x3dd8aa[_0xb89f('0x2b')],'type':_0x3dd8aa[_0xb89f('0x2c')][_0xb89f('0x2d')]};});_0x4eb8da[_0xb89f('0x2e')]=_[_0xb89f('0x28')](_0x4bef24,'name');_0x4eb8da[_0xb89f('0x2f')]=_[_0xb89f('0x30')](_0x22b15f['query']);_0x4eb8da[_0xb89f('0x31')]=_[_0xb89f('0x32')](_0x4eb8da[_0xb89f('0x2e')],_0x4eb8da[_0xb89f('0x2f')]);_0x2ab40c['attributes']=_[_0xb89f('0x32')](_0x4eb8da[_0xb89f('0x2e')],qs[_0xb89f('0x33')](_0x22b15f[_0xb89f('0x2f')]['fields']));_0x2ab40c[_0xb89f('0x34')]=_0x2ab40c['attributes'][_0xb89f('0x35')]?_0x2ab40c[_0xb89f('0x34')]:_0x4eb8da[_0xb89f('0x2e')];if(!_0x22b15f['query'][_0xb89f('0x36')](_0xb89f('0x37'))){_0x2ab40c[_0xb89f('0x1d')]=qs['limit'](_0x22b15f[_0xb89f('0x2f')][_0xb89f('0x1d')]);_0x2ab40c[_0xb89f('0x1e')]=qs[_0xb89f('0x1e')](_0x22b15f[_0xb89f('0x2f')][_0xb89f('0x1e')]);}_0x2ab40c[_0xb89f('0x38')]=qs['sort'](_0x22b15f[_0xb89f('0x2f')][_0xb89f('0x39')]);_0x2ab40c[_0xb89f('0x3a')]=qs[_0xb89f('0x31')](_['pick'](_0x22b15f[_0xb89f('0x2f')],_0x4eb8da['filters']),_0x4bef24);if(_0x22b15f[_0xb89f('0x2f')][_0xb89f('0x3b')]){_0x2ab40c['where']=_[_0xb89f('0x3c')](_0x2ab40c[_0xb89f('0x3a')],{'$or':_[_0xb89f('0x28')](_0x4bef24,function(_0x4257f0){if(_0x4257f0[_0xb89f('0x2c')]!=='VIRTUAL'){var _0x5d7b55={};_0x5d7b55[_0x4257f0[_0xb89f('0x26')]]={'$like':'%'+_0x22b15f[_0xb89f('0x2f')][_0xb89f('0x3b')]+'%'};return _0x5d7b55;}})});}_0x2ab40c=_[_0xb89f('0x3c')]({},_0x2ab40c,_0x22b15f[_0xb89f('0x3d')]);var _0x3f3074={'where':_0x2ab40c['where']};return db[_0xb89f('0x29')][_0xb89f('0x1f')](_0x3f3074)[_0xb89f('0x23')](function(_0x983d30){_0x51218b['count']=_0x983d30;if(_0x22b15f[_0xb89f('0x2f')][_0xb89f('0x3e')]){_0x2ab40c[_0xb89f('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xb89f('0x40')](_0x2ab40c);})[_0xb89f('0x23')](function(_0x25f22d){_0x51218b['rows']=_0x25f22d;return _0x51218b;})[_0xb89f('0x23')](respondWithFilteredResult(_0x289d88,_0x2ab40c))[_0xb89f('0x41')](handleError(_0x289d88,null));};exports['show']=function(_0x598e0b,_0x57e0ab){var _0x5eb555={'raw':!![],'where':{'id':_0x598e0b['params']['id']}},_0x8cf572={};_0x8cf572[_0xb89f('0x2e')]=_[_0xb89f('0x30')](db[_0xb89f('0x29')][_0xb89f('0x2a')]);_0x8cf572['query']=_[_0xb89f('0x30')](_0x598e0b[_0xb89f('0x2f')]);_0x8cf572[_0xb89f('0x31')]=_[_0xb89f('0x32')](_0x8cf572[_0xb89f('0x2e')],_0x8cf572[_0xb89f('0x2f')]);_0x5eb555[_0xb89f('0x34')]=_[_0xb89f('0x32')](_0x8cf572[_0xb89f('0x2e')],qs[_0xb89f('0x33')](_0x598e0b[_0xb89f('0x2f')][_0xb89f('0x33')]));_0x5eb555[_0xb89f('0x34')]=_0x5eb555['attributes'][_0xb89f('0x35')]?_0x5eb555[_0xb89f('0x34')]:_0x8cf572[_0xb89f('0x2e')];if(_0x598e0b[_0xb89f('0x2f')][_0xb89f('0x3e')]){_0x5eb555[_0xb89f('0x3f')]=[{'all':!![]}];}_0x5eb555=_[_0xb89f('0x3c')]({},_0x5eb555,_0x598e0b['options']);return db[_0xb89f('0x29')]['find'](_0x5eb555)[_0xb89f('0x23')](handleEntityNotFound(_0x57e0ab,null))['then'](respondWithResult(_0x57e0ab,null))[_0xb89f('0x41')](handleError(_0x57e0ab,null));};exports[_0xb89f('0x42')]=function(_0x2477fc,_0x59d194){return db[_0xb89f('0x29')][_0xb89f('0x42')](_0x2477fc[_0xb89f('0x43')],{})[_0xb89f('0x23')](respondWithResult(_0x59d194,0xc9))[_0xb89f('0x41')](handleError(_0x59d194,null));};exports['update']=function(_0x2c00f6,_0x2a2e0d){if(_0x2c00f6['body']['id']){delete _0x2c00f6[_0xb89f('0x43')]['id'];}return db[_0xb89f('0x29')][_0xb89f('0x44')]({'where':{'id':_0x2c00f6[_0xb89f('0x45')]['id']}})[_0xb89f('0x23')](handleEntityNotFound(_0x2a2e0d,null))[_0xb89f('0x23')](saveUpdates(_0x2c00f6[_0xb89f('0x43')],null))[_0xb89f('0x23')](respondWithResult(_0x2a2e0d,null))[_0xb89f('0x41')](handleError(_0x2a2e0d,null));};exports[_0xb89f('0x46')]=function(_0x5d40b8,_0x5eddc0){return db[_0xb89f('0x29')][_0xb89f('0x44')]({'where':{'id':_0x5d40b8[_0xb89f('0x45')]['id']}})[_0xb89f('0x23')](handleEntityNotFound(_0x5eddc0,null))['then'](removeEntity(_0x5eddc0,null))['catch'](handleError(_0x5eddc0,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 08f483c..ade6f20 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 _0xfd7b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4','util','../../config/logger'];(function(_0x53faba,_0x3efb78){var _0x527736=function(_0x285168){while(--_0x285168){_0x53faba['push'](_0x53faba['shift']());}};_0x527736(++_0x3efb78);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xfd7b[_0x234ae1];return _0x227ba0;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var logger=require(_0xbfd7('0x1'))(_0xbfd7('0x2'));var moment=require(_0xbfd7('0x3'));var BPromise=require(_0xbfd7('0x4'));var rp=require(_0xbfd7('0x5'));var fs=require('fs');var path=require(_0xbfd7('0x6'));var rimraf=require(_0xbfd7('0x7'));var config=require(_0xbfd7('0x8'));var attributes=require(_0xbfd7('0x9'));module[_0xbfd7('0xa')]=function(_0x2ad158,_0x639dd4){return _0x2ad158['define'](_0xbfd7('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbfd7('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4006=['../../config/environment','define','WhatsappApplication','whatsapp_applications','utf8mb4','util','../../config/logger','api','moment','path'];(function(_0x6f992c,_0x32ba1e){var _0x351989=function(_0x1ded0f){while(--_0x1ded0f){_0x6f992c['push'](_0x6f992c['shift']());}};_0x351989(++_0x32ba1e);}(_0x4006,0x1c7));var _0x6400=function(_0x4adf4a,_0x4172af){_0x4adf4a=_0x4adf4a-0x0;var _0x24cd38=_0x4006[_0x4adf4a];return _0x24cd38;};'use strict';var _=require('lodash');var util=require(_0x6400('0x0'));var logger=require(_0x6400('0x1'))(_0x6400('0x2'));var moment=require(_0x6400('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6400('0x4'));var rimraf=require('rimraf');var config=require(_0x6400('0x5'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x2dbd03,_0x599e6f){return _0x2dbd03[_0x6400('0x6')](_0x6400('0x7'),attributes,{'tableName':_0x6400('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6400('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 80bb4f0..dfd154f 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 _0xac31=['code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21287e,_0x4a7fc8){var _0x243c03=function(_0x4b4ea7){while(--_0x4b4ea7){_0x21287e['push'](_0x21287e['shift']());}};_0x243c03(++_0x4a7fc8);}(_0xac31,0xca));var _0x1ac3=function(_0x1f4f71,_0x109f06){_0x1f4f71=_0x1f4f71-0x0;var _0x2378e7=_0xac31[_0x1f4f71];return _0x2378e7;};'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});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file +var _0xe5b3=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x12b756,_0x43f6f3){var _0x40cc2e=function(_0x4cbae3){while(--_0x4cbae3){_0x12b756['push'](_0x12b756['shift']());}};_0x40cc2e(++_0x43f6f3);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1bac43,_0x36d42d){_0x1bac43=_0x1bac43-0x0;var _0x633e2f=_0xe5b3[_0x1bac43];return _0x633e2f;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 757ed14..a9e725a 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 _0xd8b1=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','exports'];(function(_0x3cfff1,_0x5d3970){var _0x3bd0f7=function(_0x3f16c9){while(--_0x3f16c9){_0x3cfff1['push'](_0x3cfff1['shift']());}};_0x3bd0f7(++_0x5d3970);}(_0xd8b1,0x105));var _0x1d8b=function(_0x119256,_0x17feae){_0x119256=_0x119256-0x0;var _0x5099ec=_0xd8b1[_0x119256];return _0x5099ec;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1d8b('0xd')]);router['get']('/:id/messages',auth[_0x1d8b('0xa')](),controller['getMessages']);router[_0x1d8b('0xc')]('/:id/download',auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xe')]);router[_0x1d8b('0xf')]('/',auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x10')]);router[_0x1d8b('0xf')]('/:id/messages',auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x11')]);router[_0x1d8b('0xf')](_0x1d8b('0x12'),auth[_0x1d8b('0xa')](),interaction[_0x1d8b('0x13')](_0x1d8b('0x14'),_0x1d8b('0x15')),controller['addTags']);router[_0x1d8b('0x16')](_0x1d8b('0x17'),auth[_0x1d8b('0xa')](),interaction[_0x1d8b('0x13')](_0x1d8b('0x14'),_0x1d8b('0x18')),controller[_0x1d8b('0x19')]);router['delete']('/:id',auth[_0x1d8b('0xa')](),interaction[_0x1d8b('0x13')](_0x1d8b('0x14'),_0x1d8b('0x1a')),controller[_0x1d8b('0x1b')]);router['delete'](_0x1d8b('0x12'),auth[_0x1d8b('0xa')](),controller['removeTags']);module[_0x1d8b('0x1c')]=router; \ No newline at end of file +var _0xf767=['removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:update','delete'];(function(_0x5f0811,_0x5aacde){var _0x1ba678=function(_0x4c57db){while(--_0x4c57db){_0x5f0811['push'](_0x5f0811['shift']());}};_0x1ba678(++_0x5aacde);}(_0xf767,0x76));var _0x7f76=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xf767[_0x4ed1d4];return _0x28e363;};'use strict';var multer=require('multer');var util=require(_0x7f76('0x0'));var path=require(_0x7f76('0x1'));var timeout=require(_0x7f76('0x2'));var express=require(_0x7f76('0x3'));var router=express[_0x7f76('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f76('0x5'));var interaction=require(_0x7f76('0x6'));var config=require(_0x7f76('0x7'));var controller=require(_0x7f76('0x8'));router['get']('/',auth[_0x7f76('0x9')](),controller[_0x7f76('0xa')]);router[_0x7f76('0xb')](_0x7f76('0xc'),auth[_0x7f76('0x9')](),controller['describe']);router[_0x7f76('0xb')](_0x7f76('0xd'),auth[_0x7f76('0x9')](),controller[_0x7f76('0xe')]);router['get'](_0x7f76('0xf'),auth['isAuthenticated'](),controller[_0x7f76('0x10')]);router[_0x7f76('0xb')](_0x7f76('0x11'),auth[_0x7f76('0x9')](),controller[_0x7f76('0x12')]);router[_0x7f76('0x13')]('/',auth['isAuthenticated'](),controller[_0x7f76('0x14')]);router[_0x7f76('0x13')](_0x7f76('0xf'),auth[_0x7f76('0x9')](),controller[_0x7f76('0x15')]);router['post'](_0x7f76('0x16'),auth['isAuthenticated'](),interaction[_0x7f76('0x17')](_0x7f76('0x18'),'whatsappinteraction:addtags'),controller['addTags']);router['put'](_0x7f76('0xd'),auth[_0x7f76('0x9')](),interaction[_0x7f76('0x17')]('whatsapp',_0x7f76('0x19')),controller['update']);router[_0x7f76('0x1a')](_0x7f76('0xd'),auth[_0x7f76('0x9')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller['destroy']);router['delete'](_0x7f76('0x16'),auth[_0x7f76('0x9')](),controller[_0x7f76('0x1b')]);module[_0x7f76('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 92e74a8..36762cb 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 _0xff2a=['moment','exports','DATE','STRING','out','ENUM','BOOLEAN'];(function(_0x450e22,_0x3ba125){var _0x5e3b1d=function(_0x50f77c){while(--_0x50f77c){_0x450e22['push'](_0x450e22['shift']());}};_0x5e3b1d(++_0x3ba125);}(_0xff2a,0x93));var _0xaff2=function(_0x50562c,_0x154265){_0x50562c=_0x50562c-0x0;var _0x1cea0a=_0xff2a[_0x50562c];return _0x1cea0a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaff2('0x0'));module[_0xaff2('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaff2('0x2')]},'disposition':{'type':Sequelize[_0xaff2('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaff2('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xaff2('0x3')]},'read1stAt':{'type':Sequelize[_0xaff2('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xaff2('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaff2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xaff2('0x5')]('in',_0xaff2('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xaff2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x741c=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x4d6b4e,_0x1f851a){var _0x5356d0=function(_0x1cb7e8){while(--_0x1cb7e8){_0x4d6b4e['push'](_0x4d6b4e['shift']());}};_0x5356d0(++_0x1f851a);}(_0x741c,0x196));var _0xc741=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x741c[_0xfae23b];return _0x200640;};'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/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 59d8eb7..9399492 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 _0xfee9=['error','stack','name','index','map','fieldName','type','key','getOptions','findAll','whatsapp','query','user','show','params','model','keys','WhatsappInteraction','filters','intersection','fields','attributes','length','include','options','find','catch','create','body','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','setTags','omit','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','toString','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','createdAt','secret','read','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','disposition','Messages','basename','createReadStream','pipe','createWriteStream','direction','System','Contact','out','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy'];(function(_0x414cbe,_0x16a463){var _0x2793fe=function(_0x3a75f6){while(--_0x3a75f6){_0x414cbe['push'](_0x414cbe['shift']());}};_0x2793fe(++_0x16a463);}(_0xfee9,0x16b));var _0x9fee=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfee9[_0x122ef9];return _0x42fba0;};'use strict';var rimraf=require(_0x9fee('0x0'));var zipdir=require(_0x9fee('0x1'));var moment=require(_0x9fee('0x2'));var BPromise=require(_0x9fee('0x3'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9fee('0x4'));var Redis=require(_0x9fee('0x5'));var interaction=require(_0x9fee('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x9fee('0x7'))(_0x9fee('0x8'));var config=require(_0x9fee('0x9'));var db=require(_0x9fee('0xa'))['db'];config[_0x9fee('0xb')]=_['defaults'](config[_0x9fee('0xb')],{'host':_0x9fee('0xc'),'port':0x18eb});var socket=require(_0x9fee('0xd'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x9fee('0xe')](socket);function respondWithStatusCode(_0x486c99,_0x2dca8e){_0x2dca8e=_0x2dca8e||0xcc;return function(_0x5af90a){if(_0x5af90a){return _0x486c99['sendStatus'](_0x2dca8e);}return _0x486c99['status'](_0x2dca8e)[_0x9fee('0xf')]();};}function respondWithResult(_0xedb59b,_0x5a4786){_0x5a4786=_0x5a4786||0xc8;return function(_0x2aa7aa){if(_0x2aa7aa){return _0xedb59b[_0x9fee('0x10')](_0x5a4786)[_0x9fee('0x11')](_0x2aa7aa);}};}function respondWithFilteredResult(_0x17ac0a,_0x473d02){return function(_0x456d19){if(_0x456d19){var _0x20534d=typeof _0x473d02[_0x9fee('0x12')]===_0x9fee('0x13')&&typeof _0x473d02[_0x9fee('0x14')]==='undefined';var _0x19f20b=_0x456d19[_0x9fee('0x15')];var _0x3890ec=_0x20534d?0x0:_0x473d02[_0x9fee('0x12')];var _0x3e1a4=_0x20534d?_0x456d19[_0x9fee('0x15')]:_0x473d02['offset']+_0x473d02[_0x9fee('0x14')];var _0x20c092;if(_0x3e1a4>=_0x19f20b){_0x3e1a4=_0x19f20b;_0x20c092=0xc8;}else{_0x20c092=0xce;}_0x17ac0a[_0x9fee('0x10')](_0x20c092);return _0x17ac0a[_0x9fee('0x16')](_0x9fee('0x17'),_0x3890ec+'-'+_0x3e1a4+'/'+_0x19f20b)[_0x9fee('0x11')](_0x456d19);}return null;};}function saveUpdates(_0x43a6e5){return function(_0xbff27e){if(_0xbff27e){return _0xbff27e[_0x9fee('0x18')](_0x43a6e5)[_0x9fee('0x19')](function(_0x4b54bc){return _0x4b54bc;});}return null;};}function removeEntity(_0x4edbb8){return function(_0x334d23){if(_0x334d23){return _0x334d23[_0x9fee('0x1a')]()['then'](function(){_0x4edbb8[_0x9fee('0x10')](0xcc)[_0x9fee('0xf')]();});}};}function handleEntityNotFound(_0x2d1866){return function(_0x5c8f7a){if(!_0x5c8f7a){_0x2d1866['sendStatus'](0x194);}return _0x5c8f7a;};}function handleError(_0x43aa09,_0x2a53c7){_0x2a53c7=_0x2a53c7||0x1f4;return function(_0x48a184){logger[_0x9fee('0x1b')](_0x48a184[_0x9fee('0x1c')]);if(_0x48a184[_0x9fee('0x1d')]){delete _0x48a184[_0x9fee('0x1d')];}_0x43aa09[_0x9fee('0x10')](_0x2a53c7)['send'](_0x48a184);};}exports[_0x9fee('0x1e')]=function(_0x5cffd6,_0x6df4fb){var _0x4acae5={};var _0x301d0e=_[_0x9fee('0x1f')](db['WhatsappInteraction']['rawAttributes'],function(_0x458fb0){return{'name':_0x458fb0[_0x9fee('0x20')],'type':_0x458fb0[_0x9fee('0x21')][_0x9fee('0x22')]};});_0x4acae5=qs[_0x9fee('0x23')](_0x301d0e,_0x5cffd6);return interaction[_0x9fee('0x24')](_0x9fee('0x25'),_0x5cffd6[_0x9fee('0x26')],_0x5cffd6[_0x9fee('0x27')],_0x4acae5,_0x301d0e)[_0x9fee('0x19')](respondWithFilteredResult(_0x6df4fb,_0x4acae5))['catch'](handleError(_0x6df4fb,null));};exports[_0x9fee('0x28')]=function(_0x1e70f1,_0x5f292c){var _0x2a21eb={'raw':![],'where':{'id':_0x1e70f1[_0x9fee('0x29')]['id']}},_0x52e8b5={};_0x52e8b5[_0x9fee('0x2a')]=_[_0x9fee('0x2b')](db[_0x9fee('0x2c')]['rawAttributes']);_0x52e8b5[_0x9fee('0x26')]=_[_0x9fee('0x2b')](_0x1e70f1[_0x9fee('0x26')]);_0x52e8b5[_0x9fee('0x2d')]=_[_0x9fee('0x2e')](_0x52e8b5[_0x9fee('0x2a')],_0x52e8b5[_0x9fee('0x26')]);_0x2a21eb['attributes']=_[_0x9fee('0x2e')](_0x52e8b5[_0x9fee('0x2a')],qs[_0x9fee('0x2f')](_0x1e70f1[_0x9fee('0x26')]['fields']));_0x2a21eb[_0x9fee('0x30')]=_0x2a21eb[_0x9fee('0x30')][_0x9fee('0x31')]?_0x2a21eb[_0x9fee('0x30')]:_0x52e8b5['model'];if(_0x1e70f1[_0x9fee('0x26')]['includeAll']){_0x2a21eb[_0x9fee('0x32')]=[{'all':!![]}];}_0x2a21eb=_['merge']({},_0x2a21eb,_0x1e70f1[_0x9fee('0x33')]);return db[_0x9fee('0x2c')][_0x9fee('0x34')](_0x2a21eb)[_0x9fee('0x19')](handleEntityNotFound(_0x5f292c,null))[_0x9fee('0x19')](respondWithResult(_0x5f292c,null))[_0x9fee('0x35')](handleError(_0x5f292c,null));};exports[_0x9fee('0x36')]=function(_0x2b6cf2,_0x4a1c1a){return db[_0x9fee('0x2c')][_0x9fee('0x36')](_0x2b6cf2[_0x9fee('0x37')],{})[_0x9fee('0x19')](respondWithResult(_0x4a1c1a,0xc9))[_0x9fee('0x35')](handleError(_0x4a1c1a,null));};exports[_0x9fee('0x18')]=function(_0x2a8eab,_0x212ca1){if(_0x2a8eab[_0x9fee('0x37')]['id']){delete _0x2a8eab[_0x9fee('0x37')]['id'];}return db['WhatsappInteraction'][_0x9fee('0x34')]({'where':{'id':_0x2a8eab['params']['id']}})['then'](handleEntityNotFound(_0x212ca1,null))['then'](saveUpdates(_0x2a8eab[_0x9fee('0x37')],null))['then'](respondWithResult(_0x212ca1,null))['catch'](handleError(_0x212ca1,null));};exports[_0x9fee('0x1a')]=function(_0x31d07a,_0x43d389){return db[_0x9fee('0x2c')][_0x9fee('0x34')]({'where':{'id':_0x31d07a['params']['id']}})['then'](handleEntityNotFound(_0x43d389,null))[_0x9fee('0x19')](removeEntity(_0x43d389,null))[_0x9fee('0x35')](handleError(_0x43d389,null));};exports[_0x9fee('0x38')]=function(_0x1223aa,_0x56dc11){return db[_0x9fee('0x2c')]['describe']()['then'](respondWithResult(_0x56dc11,null))[_0x9fee('0x35')](handleError(_0x56dc11,null));};exports[_0x9fee('0x39')]=function(_0x5d985a,_0x54cc3){return db[_0x9fee('0x3a')][_0x9fee('0x34')]({'where':{'id':_0x5d985a[_0x9fee('0x29')]['id']}})[_0x9fee('0x19')](handleEntityNotFound(_0x54cc3,null))['then'](function(_0x1eb9a1){if(_0x1eb9a1){return _0x1eb9a1[_0x9fee('0x39')](_0x5d985a[_0x9fee('0x37')][_0x9fee('0x3b')],_['omit'](_0x5d985a[_0x9fee('0x37')],[_0x9fee('0x3b'),'id'])||{});}})[_0x9fee('0x19')](respondWithResult(_0x54cc3,null))[_0x9fee('0x35')](handleError(_0x54cc3,null));};exports[_0x9fee('0x3c')]=function(_0x376b7a,_0x5260f8){var _0xe09341={'raw':![],'where':{}};var _0x13a04b={};var _0x3e202e={'count':0x0,'rows':[]};return db[_0x9fee('0x2c')][_0x9fee('0x3d')]({'where':{'id':_0x376b7a[_0x9fee('0x29')]['id']}})['then'](handleEntityNotFound(_0x5260f8,null))[_0x9fee('0x19')](function(_0x48f809){if(_0x48f809){_0x13a04b['model']=_[_0x9fee('0x2b')](db['WhatsappMessage'][_0x9fee('0x3e')]);_0x13a04b[_0x9fee('0x26')]=_[_0x9fee('0x2b')](_0x376b7a['query']);_0x13a04b['filters']=_[_0x9fee('0x2e')](_0x13a04b[_0x9fee('0x2a')],_0x13a04b[_0x9fee('0x26')]);_0xe09341[_0x9fee('0x30')]=_[_0x9fee('0x2e')](_0x13a04b[_0x9fee('0x2a')],qs[_0x9fee('0x2f')](_0x376b7a[_0x9fee('0x26')][_0x9fee('0x2f')]));_0xe09341[_0x9fee('0x30')]=_0xe09341[_0x9fee('0x30')][_0x9fee('0x31')]?_0xe09341[_0x9fee('0x30')]:_0x13a04b[_0x9fee('0x2a')];if(!_0x376b7a[_0x9fee('0x26')][_0x9fee('0x3f')](_0x9fee('0x40'))){_0xe09341[_0x9fee('0x14')]=qs['limit'](_0x376b7a['query'][_0x9fee('0x14')]);_0xe09341[_0x9fee('0x12')]=qs[_0x9fee('0x12')](_0x376b7a[_0x9fee('0x26')][_0x9fee('0x12')]);}_0xe09341[_0x9fee('0x41')]=qs[_0x9fee('0x42')](_0x376b7a[_0x9fee('0x26')][_0x9fee('0x42')]);_0xe09341[_0x9fee('0x43')]=qs[_0x9fee('0x2d')](_[_0x9fee('0x44')](_0x376b7a[_0x9fee('0x26')],_0x13a04b[_0x9fee('0x2d')]));_0xe09341[_0x9fee('0x43')][_0x9fee('0x45')]=_0x48f809['id'];if(_0x376b7a[_0x9fee('0x26')][_0x9fee('0x46')]){_0xe09341[_0x9fee('0x43')]=_[_0x9fee('0x47')](_0xe09341[_0x9fee('0x43')],{'$or':_[_0x9fee('0x1f')](_0xe09341[_0x9fee('0x30')],function(_0x2aa94e){var _0x2d671f={};_0x2d671f[_0x2aa94e]={'$like':'%'+_0x376b7a[_0x9fee('0x26')][_0x9fee('0x46')]+'%'};return _0x2d671f;})});}if(_0x376b7a[_0x9fee('0x26')]['$gte']){var _0x37fd48=_0x376b7a['query'][_0x9fee('0x48')][_0x9fee('0x49')](',');var _0x327dbb={};_0x327dbb[_0x37fd48[0x0]]={'$gte':moment(_0x37fd48[0x1])[_0x9fee('0x4a')](_0x9fee('0x4b'))};_0xe09341[_0x9fee('0x43')]=_[_0x9fee('0x47')](_0xe09341[_0x9fee('0x43')],_0x327dbb);}_0xe09341=_[_0x9fee('0x47')]({},_0xe09341,_0x376b7a[_0x9fee('0x33')]);return db[_0x9fee('0x3a')][_0x9fee('0x15')]({'where':_0xe09341[_0x9fee('0x43')]})['then'](function(_0x34c81d){_0x3e202e['count']=_0x34c81d;if(_0x376b7a['query']['includeAll']){_0xe09341[_0x9fee('0x32')]=[{'all':!![]}];}return db[_0x9fee('0x3a')]['findAll'](_0xe09341);})[_0x9fee('0x19')](function(_0x491973){_0x3e202e['rows']=_0x491973;return _0x3e202e;});}})[_0x9fee('0x19')](respondWithFilteredResult(_0x5260f8,_0xe09341))[_0x9fee('0x35')](handleError(_0x5260f8,null));};exports['addTags']=function(_0x3554e5,_0x592eea){return db['WhatsappInteraction'][_0x9fee('0x34')]({'where':{'id':_0x3554e5[_0x9fee('0x29')]['id']}})[_0x9fee('0x19')](handleEntityNotFound(_0x592eea,null))[_0x9fee('0x19')](function(_0x11aa94){if(_0x11aa94){return _0x11aa94[_0x9fee('0x4c')](_0x3554e5[_0x9fee('0x37')]['ids'],_[_0x9fee('0x4d')](_0x3554e5[_0x9fee('0x37')],[_0x9fee('0x3b'),'id'])||{})[_0x9fee('0x4e')](function(){return db[_0x9fee('0x4f')]['findAll']({'attributes':['id',_0x9fee('0x1d'),_0x9fee('0x50')],'where':{'id':_0x3554e5['body'][_0x9fee('0x3b')]}});})[_0x9fee('0x19')](function(_0x29b008){socket[_0x9fee('0x51')](_0x9fee('0x52'),{'id':Number(_0x3554e5[_0x9fee('0x29')]['id']),'tags':_0x29b008||[]});return{'id':Number(_0x3554e5[_0x9fee('0x29')]['id']),'tags':_0x29b008||[]};});}})[_0x9fee('0x19')](respondWithResult(_0x592eea,null))[_0x9fee('0x35')](handleError(_0x592eea,null));};exports[_0x9fee('0x53')]=function(_0x37c4a3,_0x390e2c){return db['WhatsappInteraction'][_0x9fee('0x34')]({'where':{'id':_0x37c4a3[_0x9fee('0x29')]['id']}})['then'](handleEntityNotFound(_0x390e2c,null))[_0x9fee('0x19')](function(_0x2c9b66){if(_0x2c9b66){return _0x2c9b66[_0x9fee('0x53')](_0x37c4a3['query'][_0x9fee('0x3b')]);}})['then'](respondWithStatusCode(_0x390e2c,null))[_0x9fee('0x35')](handleError(_0x390e2c,null));};exports[_0x9fee('0x54')]=function(_0x237d00,_0x5c7a8a){var _0x2b5ee9=moment()['unix']()[_0x9fee('0x55')]();var _0x5e3653=path[_0x9fee('0x56')](config['root'],'server',_0x9fee('0x57'),_0x9fee('0x58'));var _0x5d0e40=path[_0x9fee('0x56')](config[_0x9fee('0x59')],_0x9fee('0x5a'),_0x9fee('0x57'),_0x9fee('0x5b'));var _0xb6ca4c=path['join'](_0x5e3653,_0x2b5ee9);var _0x4d2c9c=util['format'](_0x9fee('0x5c'),_0x237d00['params']['id'],_0x2b5ee9);var _0x3ac130=path['join'](_0x5e3653,_0x4d2c9c);var _0x4313e5=[];_0x4313e5[_0x9fee('0x5d')]({'model':db[_0x9fee('0x5e')],'as':_0x9fee('0x5e'),'attributes':['id',_0x9fee('0x5f')],'raw':!![]});_0x4313e5[_0x9fee('0x5d')]({'model':db[_0x9fee('0x60')],'as':'Contact','attributes':['id',_0x9fee('0x61'),_0x9fee('0x62')],'raw':!![]});if(_0x237d00[_0x9fee('0x26')][_0x9fee('0x5b')]){_0x4313e5[_0x9fee('0x5d')]({'model':db[_0x9fee('0x63')],'as':'Attachment','raw':!![]});}var _0x2ac6f6=[{'model':db[_0x9fee('0x3a')],'as':'Messages','attributes':['id','body',_0x9fee('0x64'),'direction',_0x9fee('0x65'),_0x9fee('0x66')],'include':_0x4313e5}];_0x2ac6f6[_0x9fee('0x5d')]({'model':db[_0x9fee('0x67')],'as':_0x9fee('0x68'),'attributes':['id',_0x9fee('0x1d')]});_0x2ac6f6[_0x9fee('0x5d')]({'model':db[_0x9fee('0x5e')],'as':'Owner','attributes':['id',_0x9fee('0x5f')]});return db[_0x9fee('0x2c')][_0x9fee('0x34')]({'where':{'id':_0x237d00[_0x9fee('0x29')]['id']},'include':_0x2ac6f6})['then'](handleEntityNotFound(_0x5c7a8a,null))[_0x9fee('0x19')](function(_0x17cc30){if(_0x17cc30){var _0x3805aa=_0x17cc30[_0x9fee('0x69')]({'plain':!![]});fs[_0x9fee('0x6a')](_0xb6ca4c);var _0x1a91af={'channel':_0x9fee('0x6b'),'account':_0x3805aa[_0x9fee('0x68')][_0x9fee('0x1d')],'agent':_0x3805aa[_0x9fee('0x6c')]?_0x3805aa[_0x9fee('0x6c')]['fullname']:_0x9fee('0x6d'),'createdAt':moment(_0x3805aa[_0x9fee('0x64')])[_0x9fee('0x4a')](_0x9fee('0x4b'))['toString'](),'closedAt':_0x3805aa['closed']?moment(_0x3805aa['closedAt'])[_0x9fee('0x4a')](_0x9fee('0x4b'))[_0x9fee('0x55')]():'','disposition':_0x3805aa[_0x9fee('0x6e')],'messages':_(_0x3805aa[_0x9fee('0x6f')])[_0x9fee('0x46')]({'secret':![]})[_0x9fee('0x1f')](function(_0x2a63a8){if(_0x2a63a8[_0x9fee('0x63')]){var _0x3c36e7=path[_0x9fee('0x56')](_0x5d0e40,_0x2a63a8[_0x9fee('0x63')][_0x9fee('0x70')]);if(fs['existsSync'](_0x3c36e7)){fs[_0x9fee('0x71')](_0x3c36e7)[_0x9fee('0x72')](fs[_0x9fee('0x73')](path[_0x9fee('0x56')](_0xb6ca4c,_0x2a63a8['Attachment'][_0x9fee('0x70')])));}}return{'date':moment(_0x2a63a8[_0x9fee('0x64')])[_0x9fee('0x4a')](_0x9fee('0x4b'))[_0x9fee('0x55')](),'sender':_0x2a63a8[_0x9fee('0x74')]==='out'?_0x2a63a8['User']?_0x2a63a8['User']['fullname']:_0x9fee('0x75'):_0x2a63a8[_0x9fee('0x76')][_0x9fee('0x61')]+(_0x2a63a8[_0x9fee('0x76')]['lastName']?'\x20'+_0x2a63a8['Contact'][_0x9fee('0x62')]:''),'body':_0x2a63a8[_0x9fee('0x63')]?_0x2a63a8['Attachment'][_0x9fee('0x70')]:_0x2a63a8[_0x9fee('0x37')],'direction':_0x2a63a8['direction']===_0x9fee('0x77')?'A':'C','secret':_0x2a63a8[_0x9fee('0x65')],'read':_0x2a63a8[_0x9fee('0x66')],'attachment':_0x2a63a8[_0x9fee('0x63')]};})[_0x9fee('0x78')]()};return ejs[_0x9fee('0x79')](path[_0x9fee('0x56')](config['root'],_0x9fee('0x5a'),_0x9fee('0x7a'),_0x9fee('0x7b')),{'interaction':_0x1a91af})[_0x9fee('0x19')](function(_0x383efb){var _0x24c1d3=path[_0x9fee('0x56')](_0xb6ca4c,_0x9fee('0x7c')+_0x3805aa['id']+'-'+_0x2b5ee9+'.pdf');var _0x3b6198={'path':_0x24c1d3,'channel':_0x9fee('0x6b'),'interactionId':_0x3805aa['id']};return pdf[_0x9fee('0x7d')](_0x383efb,_0x3b6198);})[_0x9fee('0x19')](function(){return new BPromise(function(_0x590094,_0x5178b2){zipdir(_0xb6ca4c,{'saveTo':_0x3ac130},function(_0x199e50,_0x30be05){if(_0x199e50)return _0x5178b2(_0x199e50);return _0x590094(_0x30be05);});})[_0x9fee('0x19')](function(){return new BPromise(function(_0x5b7266,_0x2a55b1){rimraf(_0xb6ca4c,function(_0x55f8ab){if(_0x55f8ab)_0x2a55b1(_0x55f8ab);return _0x5b7266();});});})[_0x9fee('0x19')](function(){return _0x5c7a8a[_0x9fee('0x54')](_0x3ac130,_0x4d2c9c,function(_0x1b8af6){if(_0x1b8af6){console[_0x9fee('0x7e')](_0x9fee('0x7f'),_0x1b8af6);}else{fs[_0x9fee('0x80')](_0x3ac130);}});});});}else{return _0x5c7a8a[_0x9fee('0x81')](0xc8);}})[_0x9fee('0x35')](handleError(_0x5c7a8a,null));}; \ No newline at end of file +var _0x1346=['existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','value','renderFile','views','transcript-','createPdfFromHTML','download','log','err','unlinkSync','zip-dir','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','then','error','stack','name','send','index','map','WhatsappInteraction','fieldName','type','getOptions','query','show','keys','rawAttributes','model','attributes','intersection','fields','length','include','merge','options','catch','create','update','body','find','params','destroy','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','filters','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','setTags','omit','Tag','color','emit','whatsappInteractionTags:save','removeTags','toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','basename'];(function(_0x26c149,_0x14daf3){var _0x45384b=function(_0x574985){while(--_0x574985){_0x26c149['push'](_0x26c149['shift']());}};_0x45384b(++_0x14daf3);}(_0x1346,0x95));var _0x6134=function(_0x97699d,_0x3e1d9f){_0x97699d=_0x97699d-0x0;var _0x3a0bc2=_0x1346[_0x97699d];return _0x3a0bc2;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x6134('0x0'));var moment=require(_0x6134('0x1'));var BPromise=require('bluebird');var util=require(_0x6134('0x2'));var path=require(_0x6134('0x3'));var ejs=require(_0x6134('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x6134('0x5'));var interaction=require(_0x6134('0x6'));var qs=require(_0x6134('0x7'));var pdf=require(_0x6134('0x8'));var logger=require(_0x6134('0x9'))(_0x6134('0xa'));var config=require(_0x6134('0xb'));var db=require(_0x6134('0xc'))['db'];config['redis']=_[_0x6134('0xd')](config[_0x6134('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x6134('0xf'))(new Redis(config[_0x6134('0xe')]));require(_0x6134('0x10'))[_0x6134('0x11')](socket);function respondWithStatusCode(_0x26742a,_0x6348b5){_0x6348b5=_0x6348b5||0xcc;return function(_0x4e6399){if(_0x4e6399){return _0x26742a[_0x6134('0x12')](_0x6348b5);}return _0x26742a[_0x6134('0x13')](_0x6348b5)[_0x6134('0x14')]();};}function respondWithResult(_0x5369b3,_0x2942ca){_0x2942ca=_0x2942ca||0xc8;return function(_0x85158){if(_0x85158){return _0x5369b3[_0x6134('0x13')](_0x2942ca)[_0x6134('0x15')](_0x85158);}};}function respondWithFilteredResult(_0x4e7a8d,_0x321005){return function(_0x14423b){if(_0x14423b){var _0x5ac751=typeof _0x321005[_0x6134('0x16')]===_0x6134('0x17')&&typeof _0x321005[_0x6134('0x18')]===_0x6134('0x17');var _0x8a1e85=_0x14423b[_0x6134('0x19')];var _0x263833=_0x5ac751?0x0:_0x321005['offset'];var _0x25d7c9=_0x5ac751?_0x14423b['count']:_0x321005[_0x6134('0x16')]+_0x321005[_0x6134('0x18')];var _0x4037ad;if(_0x25d7c9>=_0x8a1e85){_0x25d7c9=_0x8a1e85;_0x4037ad=0xc8;}else{_0x4037ad=0xce;}_0x4e7a8d[_0x6134('0x13')](_0x4037ad);return _0x4e7a8d[_0x6134('0x1a')]('Content-Range',_0x263833+'-'+_0x25d7c9+'/'+_0x8a1e85)['json'](_0x14423b);}return null;};}function saveUpdates(_0x705d79){return function(_0xa01f28){if(_0xa01f28){return _0xa01f28['update'](_0x705d79)[_0x6134('0x1b')](function(_0x294cd8){return _0x294cd8;});}return null;};}function removeEntity(_0x112a0b){return function(_0x5a3d6d){if(_0x5a3d6d){return _0x5a3d6d['destroy']()[_0x6134('0x1b')](function(){_0x112a0b[_0x6134('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1acfc2){return function(_0x40c86d){if(!_0x40c86d){_0x1acfc2['sendStatus'](0x194);}return _0x40c86d;};}function handleError(_0x1f5939,_0x21d29f){_0x21d29f=_0x21d29f||0x1f4;return function(_0x269ba3){logger[_0x6134('0x1c')](_0x269ba3[_0x6134('0x1d')]);if(_0x269ba3[_0x6134('0x1e')]){delete _0x269ba3[_0x6134('0x1e')];}_0x1f5939[_0x6134('0x13')](_0x21d29f)[_0x6134('0x1f')](_0x269ba3);};}exports[_0x6134('0x20')]=function(_0x2c0304,_0x5a40d1){var _0x195a07={};var _0x3a1180=_[_0x6134('0x21')](db[_0x6134('0x22')]['rawAttributes'],function(_0x51a310){return{'name':_0x51a310[_0x6134('0x23')],'type':_0x51a310[_0x6134('0x24')]['key']};});_0x195a07=qs[_0x6134('0x25')](_0x3a1180,_0x2c0304);return interaction['findAll']('whatsapp',_0x2c0304[_0x6134('0x26')],_0x2c0304['user'],_0x195a07,_0x3a1180)[_0x6134('0x1b')](respondWithFilteredResult(_0x5a40d1,_0x195a07))['catch'](handleError(_0x5a40d1,null));};exports[_0x6134('0x27')]=function(_0x1d77ab,_0x437c34){var _0x4eacb7={'raw':![],'where':{'id':_0x1d77ab['params']['id']}},_0x141c0c={};_0x141c0c['model']=_[_0x6134('0x28')](db[_0x6134('0x22')][_0x6134('0x29')]);_0x141c0c[_0x6134('0x26')]=_[_0x6134('0x28')](_0x1d77ab['query']);_0x141c0c['filters']=_['intersection'](_0x141c0c[_0x6134('0x2a')],_0x141c0c[_0x6134('0x26')]);_0x4eacb7[_0x6134('0x2b')]=_[_0x6134('0x2c')](_0x141c0c[_0x6134('0x2a')],qs['fields'](_0x1d77ab[_0x6134('0x26')][_0x6134('0x2d')]));_0x4eacb7[_0x6134('0x2b')]=_0x4eacb7[_0x6134('0x2b')][_0x6134('0x2e')]?_0x4eacb7[_0x6134('0x2b')]:_0x141c0c[_0x6134('0x2a')];if(_0x1d77ab[_0x6134('0x26')]['includeAll']){_0x4eacb7[_0x6134('0x2f')]=[{'all':!![]}];}_0x4eacb7=_[_0x6134('0x30')]({},_0x4eacb7,_0x1d77ab[_0x6134('0x31')]);return db['WhatsappInteraction']['find'](_0x4eacb7)['then'](handleEntityNotFound(_0x437c34,null))[_0x6134('0x1b')](respondWithResult(_0x437c34,null))[_0x6134('0x32')](handleError(_0x437c34,null));};exports[_0x6134('0x33')]=function(_0x287654,_0x14b917){return db['WhatsappInteraction'][_0x6134('0x33')](_0x287654['body'],{})['then'](respondWithResult(_0x14b917,0xc9))[_0x6134('0x32')](handleError(_0x14b917,null));};exports[_0x6134('0x34')]=function(_0x34f7f3,_0x41e9f7){if(_0x34f7f3[_0x6134('0x35')]['id']){delete _0x34f7f3[_0x6134('0x35')]['id'];}return db[_0x6134('0x22')][_0x6134('0x36')]({'where':{'id':_0x34f7f3[_0x6134('0x37')]['id']}})['then'](handleEntityNotFound(_0x41e9f7,null))['then'](saveUpdates(_0x34f7f3[_0x6134('0x35')],null))[_0x6134('0x1b')](respondWithResult(_0x41e9f7,null))[_0x6134('0x32')](handleError(_0x41e9f7,null));};exports[_0x6134('0x38')]=function(_0xcaa827,_0x55365c){return db['WhatsappInteraction']['find']({'where':{'id':_0xcaa827[_0x6134('0x37')]['id']}})[_0x6134('0x1b')](handleEntityNotFound(_0x55365c,null))['then'](removeEntity(_0x55365c,null))['catch'](handleError(_0x55365c,null));};exports[_0x6134('0x39')]=function(_0x499348,_0x12e723){return db[_0x6134('0x22')][_0x6134('0x39')]()['then'](respondWithResult(_0x12e723,null))['catch'](handleError(_0x12e723,null));};exports[_0x6134('0x3a')]=function(_0x5c0d03,_0x54dab8){return db['WhatsappMessage']['find']({'where':{'id':_0x5c0d03[_0x6134('0x37')]['id']}})[_0x6134('0x1b')](handleEntityNotFound(_0x54dab8,null))[_0x6134('0x1b')](function(_0xdd83e3){if(_0xdd83e3){return _0xdd83e3[_0x6134('0x3a')](_0x5c0d03[_0x6134('0x35')]['ids'],_['omit'](_0x5c0d03[_0x6134('0x35')],[_0x6134('0x3b'),'id'])||{});}})[_0x6134('0x1b')](respondWithResult(_0x54dab8,null))[_0x6134('0x32')](handleError(_0x54dab8,null));};exports[_0x6134('0x3c')]=function(_0x255e45,_0x6b09b3){var _0x1adf53={'raw':![],'where':{}};var _0x50cd8e={};var _0x3cbe20={'count':0x0,'rows':[]};return db[_0x6134('0x22')][_0x6134('0x3d')]({'where':{'id':_0x255e45[_0x6134('0x37')]['id']}})[_0x6134('0x1b')](handleEntityNotFound(_0x6b09b3,null))[_0x6134('0x1b')](function(_0x52a655){if(_0x52a655){_0x50cd8e[_0x6134('0x2a')]=_['keys'](db[_0x6134('0x3e')][_0x6134('0x29')]);_0x50cd8e[_0x6134('0x26')]=_['keys'](_0x255e45['query']);_0x50cd8e[_0x6134('0x3f')]=_[_0x6134('0x2c')](_0x50cd8e['model'],_0x50cd8e['query']);_0x1adf53[_0x6134('0x2b')]=_[_0x6134('0x2c')](_0x50cd8e['model'],qs[_0x6134('0x2d')](_0x255e45['query'][_0x6134('0x2d')]));_0x1adf53[_0x6134('0x2b')]=_0x1adf53['attributes'][_0x6134('0x2e')]?_0x1adf53[_0x6134('0x2b')]:_0x50cd8e[_0x6134('0x2a')];if(!_0x255e45[_0x6134('0x26')][_0x6134('0x40')](_0x6134('0x41'))){_0x1adf53[_0x6134('0x18')]=qs[_0x6134('0x18')](_0x255e45[_0x6134('0x26')][_0x6134('0x18')]);_0x1adf53[_0x6134('0x16')]=qs['offset'](_0x255e45[_0x6134('0x26')]['offset']);}_0x1adf53[_0x6134('0x42')]=qs[_0x6134('0x43')](_0x255e45[_0x6134('0x26')][_0x6134('0x43')]);_0x1adf53['where']=qs['filters'](_[_0x6134('0x44')](_0x255e45[_0x6134('0x26')],_0x50cd8e[_0x6134('0x3f')]));_0x1adf53[_0x6134('0x45')][_0x6134('0x46')]=_0x52a655['id'];if(_0x255e45[_0x6134('0x26')][_0x6134('0x47')]){_0x1adf53['where']=_[_0x6134('0x30')](_0x1adf53[_0x6134('0x45')],{'$or':_[_0x6134('0x21')](_0x1adf53[_0x6134('0x2b')],function(_0xc9ec0c){var _0x3962a5={};_0x3962a5[_0xc9ec0c]={'$like':'%'+_0x255e45['query'][_0x6134('0x47')]+'%'};return _0x3962a5;})});}if(_0x255e45[_0x6134('0x26')]['$gte']){var _0x56fe46=_0x255e45['query'][_0x6134('0x48')][_0x6134('0x49')](',');var _0x3b33f4={};_0x3b33f4[_0x56fe46[0x0]]={'$gte':moment(_0x56fe46[0x1])[_0x6134('0x4a')](_0x6134('0x4b'))};_0x1adf53[_0x6134('0x45')]=_[_0x6134('0x30')](_0x1adf53['where'],_0x3b33f4);}_0x1adf53=_[_0x6134('0x30')]({},_0x1adf53,_0x255e45[_0x6134('0x31')]);return db[_0x6134('0x3e')][_0x6134('0x19')]({'where':_0x1adf53[_0x6134('0x45')]})[_0x6134('0x1b')](function(_0x33f59e){_0x3cbe20[_0x6134('0x19')]=_0x33f59e;if(_0x255e45[_0x6134('0x26')][_0x6134('0x4c')]){_0x1adf53[_0x6134('0x2f')]=[{'all':!![]}];}return db[_0x6134('0x3e')][_0x6134('0x4d')](_0x1adf53);})['then'](function(_0x25936e){_0x3cbe20[_0x6134('0x4e')]=_0x25936e;return _0x3cbe20;});}})[_0x6134('0x1b')](respondWithFilteredResult(_0x6b09b3,_0x1adf53))[_0x6134('0x32')](handleError(_0x6b09b3,null));};exports[_0x6134('0x4f')]=function(_0x4f21c5,_0x56f0e8){return db[_0x6134('0x22')][_0x6134('0x36')]({'where':{'id':_0x4f21c5[_0x6134('0x37')]['id']}})[_0x6134('0x1b')](handleEntityNotFound(_0x56f0e8,null))['then'](function(_0x50a527){if(_0x50a527){return _0x50a527[_0x6134('0x50')](_0x4f21c5[_0x6134('0x35')]['ids'],_[_0x6134('0x51')](_0x4f21c5[_0x6134('0x35')],[_0x6134('0x3b'),'id'])||{})['spread'](function(){return db[_0x6134('0x52')][_0x6134('0x4d')]({'attributes':['id','name',_0x6134('0x53')],'where':{'id':_0x4f21c5[_0x6134('0x35')][_0x6134('0x3b')]}});})['then'](function(_0xa2ac63){socket[_0x6134('0x54')](_0x6134('0x55'),{'id':Number(_0x4f21c5['params']['id']),'tags':_0xa2ac63||[]});return{'id':Number(_0x4f21c5[_0x6134('0x37')]['id']),'tags':_0xa2ac63||[]};});}})['then'](respondWithResult(_0x56f0e8,null))[_0x6134('0x32')](handleError(_0x56f0e8,null));};exports[_0x6134('0x56')]=function(_0x91b36e,_0x257a8b){return db['WhatsappInteraction'][_0x6134('0x36')]({'where':{'id':_0x91b36e[_0x6134('0x37')]['id']}})['then'](handleEntityNotFound(_0x257a8b,null))['then'](function(_0x21778a){if(_0x21778a){return _0x21778a[_0x6134('0x56')](_0x91b36e[_0x6134('0x26')][_0x6134('0x3b')]);}})[_0x6134('0x1b')](respondWithStatusCode(_0x257a8b,null))['catch'](handleError(_0x257a8b,null));};exports['download']=function(_0x424d28,_0x2ea00e){var _0x42867d=moment()['unix']()[_0x6134('0x57')]();var _0x4deae5=path[_0x6134('0x58')](config['root'],_0x6134('0x59'),_0x6134('0x5a'),_0x6134('0x5b'));var _0x1b5778=path[_0x6134('0x58')](config[_0x6134('0x5c')],_0x6134('0x59'),_0x6134('0x5a'),_0x6134('0x5d'));var _0x4b14e8=path[_0x6134('0x58')](_0x4deae5,_0x42867d);var _0x5f1be0=util['format'](_0x6134('0x5e'),_0x424d28[_0x6134('0x37')]['id'],_0x42867d);var _0x2080ed=path[_0x6134('0x58')](_0x4deae5,_0x5f1be0);var _0x321472=[];_0x321472['push']({'model':db['User'],'as':_0x6134('0x5f'),'attributes':['id',_0x6134('0x60')],'raw':!![]});_0x321472[_0x6134('0x61')]({'model':db[_0x6134('0x62')],'as':'Contact','attributes':['id',_0x6134('0x63'),_0x6134('0x64')],'raw':!![]});if(_0x424d28[_0x6134('0x26')][_0x6134('0x5d')]){_0x321472[_0x6134('0x61')]({'model':db[_0x6134('0x65')],'as':_0x6134('0x65'),'raw':!![]});}var _0x410942=[{'model':db[_0x6134('0x3e')],'as':_0x6134('0x66'),'attributes':['id',_0x6134('0x35'),_0x6134('0x67'),_0x6134('0x68'),_0x6134('0x69'),_0x6134('0x6a')],'include':_0x321472}];_0x410942[_0x6134('0x61')]({'model':db[_0x6134('0x6b')],'as':'Account','attributes':['id',_0x6134('0x1e')]});_0x410942[_0x6134('0x61')]({'model':db[_0x6134('0x5f')],'as':_0x6134('0x6c'),'attributes':['id',_0x6134('0x60')]});return db[_0x6134('0x22')][_0x6134('0x36')]({'where':{'id':_0x424d28[_0x6134('0x37')]['id']},'include':_0x410942})[_0x6134('0x1b')](handleEntityNotFound(_0x2ea00e,null))[_0x6134('0x1b')](function(_0x4ae496){if(_0x4ae496){var _0x17f3b3=_0x4ae496[_0x6134('0x6d')]({'plain':!![]});fs[_0x6134('0x6e')](_0x4b14e8);var _0x2e4868={'channel':_0x6134('0x6f'),'account':_0x17f3b3[_0x6134('0x70')][_0x6134('0x1e')],'agent':_0x17f3b3[_0x6134('0x6c')]?_0x17f3b3[_0x6134('0x6c')]['fullname']:_0x6134('0x71'),'createdAt':moment(_0x17f3b3[_0x6134('0x67')])[_0x6134('0x4a')](_0x6134('0x4b'))['toString'](),'closedAt':_0x17f3b3[_0x6134('0x72')]?moment(_0x17f3b3[_0x6134('0x73')])['format'](_0x6134('0x4b'))['toString']():'','disposition':_0x17f3b3['disposition'],'messages':_(_0x17f3b3[_0x6134('0x66')])[_0x6134('0x47')]({'secret':![]})[_0x6134('0x21')](function(_0x2d73fe){if(_0x2d73fe[_0x6134('0x65')]){var _0x35cdb4=path[_0x6134('0x58')](_0x1b5778,_0x2d73fe[_0x6134('0x65')][_0x6134('0x74')]);if(fs[_0x6134('0x75')](_0x35cdb4)){fs[_0x6134('0x76')](_0x35cdb4)[_0x6134('0x77')](fs[_0x6134('0x78')](path[_0x6134('0x58')](_0x4b14e8,_0x2d73fe[_0x6134('0x65')]['basename'])));}}return{'date':moment(_0x2d73fe[_0x6134('0x67')])[_0x6134('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2d73fe[_0x6134('0x68')]===_0x6134('0x79')?_0x2d73fe[_0x6134('0x5f')]?_0x2d73fe[_0x6134('0x5f')][_0x6134('0x60')]:_0x6134('0x7a'):_0x2d73fe[_0x6134('0x7b')]['firstName']+(_0x2d73fe[_0x6134('0x7b')]['lastName']?'\x20'+_0x2d73fe['Contact'][_0x6134('0x64')]:''),'body':_0x2d73fe[_0x6134('0x65')]?_0x2d73fe[_0x6134('0x65')][_0x6134('0x74')]:_0x2d73fe[_0x6134('0x35')],'direction':_0x2d73fe[_0x6134('0x68')]===_0x6134('0x79')?'A':'C','secret':_0x2d73fe[_0x6134('0x69')],'read':_0x2d73fe[_0x6134('0x6a')],'attachment':_0x2d73fe[_0x6134('0x65')]};})[_0x6134('0x7c')]()};return ejs[_0x6134('0x7d')](path['join'](config['root'],_0x6134('0x59'),_0x6134('0x7e'),'downloadInteraction.ejs'),{'interaction':_0x2e4868})[_0x6134('0x1b')](function(_0x34e202){var _0x4a8121=path['join'](_0x4b14e8,_0x6134('0x7f')+_0x17f3b3['id']+'-'+_0x42867d+'.pdf');var _0x31eba6={'path':_0x4a8121,'channel':'Whatsapp','interactionId':_0x17f3b3['id']};return pdf[_0x6134('0x80')](_0x34e202,_0x31eba6);})['then'](function(){return new BPromise(function(_0xa37b9b,_0x3b2772){zipdir(_0x4b14e8,{'saveTo':_0x2080ed},function(_0x64e122,_0x1997b9){if(_0x64e122)return _0x3b2772(_0x64e122);return _0xa37b9b(_0x1997b9);});})[_0x6134('0x1b')](function(){return new BPromise(function(_0x47c31a,_0x2a615c){rimraf(_0x4b14e8,function(_0x1e102b){if(_0x1e102b)_0x2a615c(_0x1e102b);return _0x47c31a();});});})[_0x6134('0x1b')](function(){return _0x2ea00e[_0x6134('0x81')](_0x2080ed,_0x5f1be0,function(_0x19c171){if(_0x19c171){console[_0x6134('0x82')](_0x6134('0x83'),_0x19c171);}else{fs[_0x6134('0x84')](_0x2080ed);}});});});}else{return _0x2ea00e[_0x6134('0x12')](0xc8);}})[_0x6134('0x32')](handleError(_0x2ea00e,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index f89e48b..0cfc496 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 _0x2dae=['length','emit','catch','hasOwnProperty','hook','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x558d0d,_0x4bb99a){var _0x497645=function(_0x5a99c2){while(--_0x5a99c2){_0x558d0d['push'](_0x558d0d['shift']());}};_0x497645(++_0x4bb99a);}(_0x2dae,0xc3));var _0xe2da=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x2dae[_0x4bb145];return _0x4db596;};'use strict';var EventEmitter=require(_0xe2da('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xe2da('0x1')];var WhatsappMessage=require(_0xe2da('0x2'))['db'][_0xe2da('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe2da('0x4')](0x0);var events={'afterCreate':_0xe2da('0x5'),'afterUpdate':'update','afterDestroy':_0xe2da('0x6')};function emitEvent(_0x439b5d){return function(_0x77e45e,_0x28cf6b,_0x523c60){_0x77e45e[_0xe2da('0x7')]({'attributes':['id'],'raw':!![]})[_0xe2da('0x8')](function(_0x34cc98){_0x77e45e[_0xe2da('0x9')](_0xe2da('0xa'),_0x34cc98[_0xe2da('0xb')](function(_0x29960a){return{'id':_0x29960a['id']};}));return WhatsappMessage[_0xe2da('0xc')]({'where':{'WhatsappInteractionId':_0x77e45e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe2da('0x8')](function(_0x5a2fc5){_0x77e45e[_0xe2da('0x9')](_0xe2da('0xd'),_0x5a2fc5[_0xe2da('0xe')]);WhatsappInteractionEvents[_0xe2da('0xf')](_0x439b5d+':'+_0x77e45e['id'],_0x77e45e);WhatsappInteractionEvents[_0xe2da('0xf')](_0x439b5d,_0x77e45e);_0x523c60(null);})[_0xe2da('0x10')](_0x523c60(null));};}for(var e in events){if(events[_0xe2da('0x11')](e)){var event=events[e];WhatsappInteraction[_0xe2da('0x12')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x1ab1=['length','emit','catch','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages'];(function(_0x135f1f,_0x45e875){var _0x547ed6=function(_0x466b4c){while(--_0x466b4c){_0x135f1f['push'](_0x135f1f['shift']());}};_0x547ed6(++_0x45e875);}(_0x1ab1,0x83));var _0x11ab=function(_0x3948a1,_0x3a4220){_0x3948a1=_0x3948a1-0x0;var _0x5e8b02=_0x1ab1[_0x3948a1];return _0x5e8b02;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x11ab('0x0'))['db'][_0x11ab('0x1')];var WhatsappMessage=require(_0x11ab('0x0'))['db'][_0x11ab('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x11ab('0x3')](0x0);var events={'afterCreate':_0x11ab('0x4'),'afterUpdate':_0x11ab('0x5'),'afterDestroy':'remove'};function emitEvent(_0xded89b){return function(_0x2689a2,_0x260c92,_0x173e17){_0x2689a2[_0x11ab('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0xe4281a){_0x2689a2[_0x11ab('0x7')](_0x11ab('0x8'),_0xe4281a[_0x11ab('0x9')](function(_0x495619){return{'id':_0x495619['id']};}));return WhatsappMessage[_0x11ab('0xa')]({'where':{'WhatsappInteractionId':_0x2689a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x11ab('0xb')](function(_0xf74671){_0x2689a2[_0x11ab('0x7')](_0x11ab('0xc'),_0xf74671[_0x11ab('0xd')]);WhatsappInteractionEvents[_0x11ab('0xe')](_0xded89b+':'+_0x2689a2['id'],_0x2689a2);WhatsappInteractionEvents['emit'](_0xded89b,_0x2689a2);_0x173e17(null);})[_0x11ab('0xf')](_0x173e17(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x11ab('0x10')](e,emitEvent(event));}}module[_0x11ab('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index cf19c65..b9b25db 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 _0xb503=['../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x1b54b4,_0x1df7d5){var _0x18cc9b=function(_0x18debb){while(--_0x18debb){_0x1b54b4['push'](_0x1b54b4['shift']());}};_0x18cc9b(++_0x1df7d5);}(_0xb503,0x161));var _0x3b50=function(_0x4a3d6f,_0x435eb6){_0x4a3d6f=_0x4a3d6f-0x0;var _0xbeae7f=_0xb503[_0x4a3d6f];return _0xbeae7f;};'use strict';var _=require(_0x3b50('0x0'));var util=require(_0x3b50('0x1'));var logger=require(_0x3b50('0x2'))(_0x3b50('0x3'));var moment=require(_0x3b50('0x4'));var BPromise=require(_0x3b50('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3b50('0x6'));var config=require(_0x3b50('0x7'));var attributes=require(_0x3b50('0x8'));module[_0x3b50('0x9')]=function(_0x13c98d,_0x158013){return _0x13c98d[_0x3b50('0xa')]('WhatsappInteraction',attributes,{'tableName':_0x3b50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c170c,_0x1e050a,_0x44ad61){if(_0x4c170c[_0x3b50('0xc')]('closed')){_0x4c170c['closedAt']=moment()[_0x3b50('0xd')](_0x3b50('0xe'));}_0x44ad61(null,_0x4c170c);}}});}; \ No newline at end of file +var _0x8d23=['changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x8d23,0x133));var _0x38d2=function(_0x32a304,_0x15513d){_0x32a304=_0x32a304-0x0;var _0x331c64=_0x8d23[_0x32a304];return _0x331c64;};'use strict';var _=require('lodash');var util=require(_0x38d2('0x0'));var logger=require(_0x38d2('0x1'))(_0x38d2('0x2'));var moment=require(_0x38d2('0x3'));var BPromise=require(_0x38d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38d2('0x5'));var rimraf=require(_0x38d2('0x6'));var config=require(_0x38d2('0x7'));var attributes=require(_0x38d2('0x8'));module[_0x38d2('0x9')]=function(_0x4e0a65,_0x42b460){return _0x4e0a65[_0x38d2('0xa')](_0x38d2('0xb'),attributes,{'tableName':_0x38d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5317a6,_0x19cf29,_0x9437ab){if(_0x5317a6[_0x38d2('0xd')]('closed')){_0x5317a6[_0x38d2('0xe')]=moment()['format'](_0x38d2('0xf'));}_0x9437ab(null,_0x5317a6);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index c1e7c91..e369b64 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 _0x9870=['http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','info','debug','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','limit','then','AddTagsToWhatsappInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x2bbd2d,_0x37c3c4){var _0x257dc9=function(_0x1928ff){while(--_0x1928ff){_0x2bbd2d['push'](_0x2bbd2d['shift']());}};_0x257dc9(++_0x37c3c4);}(_0x9870,0x1c4));var _0x0987=function(_0x25726d,_0x396ebf){_0x25726d=_0x25726d-0x0;var _0x524dd3=_0x9870[_0x25726d];return _0x524dd3;};'use strict';var _=require(_0x0987('0x0'));var util=require(_0x0987('0x1'));var moment=require(_0x0987('0x2'));var BPromise=require(_0x0987('0x3'));var rs=require(_0x0987('0x4'));var fs=require('fs');var Redis=require(_0x0987('0x5'));var db=require(_0x0987('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0987('0x7'));var config=require('../../config/environment');var jayson=require(_0x0987('0x8'));var client=jayson[_0x0987('0x9')][_0x0987('0xa')]({'port':0x232a});config[_0x0987('0xb')]=_['defaults'](config[_0x0987('0xb')],{'host':_0x0987('0xc'),'port':0x18eb});var socket=require(_0x0987('0xd'))(new Redis(config[_0x0987('0xb')]));require(_0x0987('0xe'))[_0x0987('0xf')](socket);function respondWithRpcPromise(_0x2aabb8,_0x2cc39d,_0x2ce540){return new BPromise(function(_0x173c0c,_0x3e9aa7){return client['request'](_0x2aabb8,_0x2ce540)['then'](function(_0x332622){logger[_0x0987('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x2cc39d,'request\x20sent');logger[_0x0987('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x2cc39d,_0x0987('0x12'),JSON[_0x0987('0x13')](_0x332622));if(_0x332622[_0x0987('0x14')]){if(_0x332622[_0x0987('0x14')][_0x0987('0x15')]===0x1f4){logger[_0x0987('0x14')](_0x0987('0x16'),_0x2cc39d,_0x332622[_0x0987('0x14')][_0x0987('0x17')]);return _0x3e9aa7(_0x332622[_0x0987('0x14')][_0x0987('0x17')]);}logger[_0x0987('0x14')](_0x0987('0x16'),_0x2cc39d,_0x332622[_0x0987('0x14')][_0x0987('0x17')]);return _0x173c0c(_0x332622[_0x0987('0x14')][_0x0987('0x17')]);}else{logger[_0x0987('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x2cc39d,_0x0987('0x12'));_0x173c0c(_0x332622[_0x0987('0x18')][_0x0987('0x17')]);}})[_0x0987('0x19')](function(_0x65e59a){logger[_0x0987('0x14')](_0x0987('0x16'),_0x2cc39d,_0x65e59a);_0x3e9aa7(_0x65e59a);});});}exports[_0x0987('0x1a')]=function(_0x4e164b){var _0x16a6ac=this;return new Promise(function(_0x1efaeb,_0x47dde4){return db[_0x0987('0x1b')][_0x0987('0x1c')](_0x4e164b[_0x0987('0x1d')],{'raw':_0x4e164b[_0x0987('0x1e')]?_0x4e164b[_0x0987('0x1e')][_0x0987('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e164b[_0x0987('0x1e')]?_0x4e164b['options']['where']||null:null,'attributes':_0x4e164b['options']?_0x4e164b[_0x0987('0x1e')][_0x0987('0x20')]||null:null,'limit':_0x4e164b[_0x0987('0x1e')]?_0x4e164b[_0x0987('0x1e')][_0x0987('0x21')]||null:null})[_0x0987('0x22')](function(_0xfbf52c){logger[_0x0987('0x10')](_0x0987('0x1a'),_0x4e164b);logger['debug'](_0x0987('0x1a'),_0x4e164b,JSON[_0x0987('0x13')](_0xfbf52c));_0x1efaeb(_0xfbf52c);})[_0x0987('0x19')](function(_0x2752c3){logger[_0x0987('0x14')]('UpdateWhatsappInteraction',_0x2752c3[_0x0987('0x17')],_0x4e164b);_0x47dde4(_0x16a6ac[_0x0987('0x14')](0x1f4,_0x2752c3[_0x0987('0x17')]));});});};exports[_0x0987('0x23')]=function(_0x5597d5){return new Promise(function(_0x2e2bb3,_0x5a1e89){return db['WhatsappInteraction'][_0x0987('0x24')]({'where':_0x5597d5[_0x0987('0x1e')]?_0x5597d5[_0x0987('0x1e')][_0x0987('0x25')]||null:null})[_0x0987('0x22')](function(_0x176361){if(_0x176361){return _0x176361[_0x0987('0x26')](_0x5597d5[_0x0987('0x1d')][_0x0987('0x27')],_['omit'](_0x5597d5['body'],[_0x0987('0x27'),'id'])||{});}})[_0x0987('0x28')](function(_0x17f33e){logger[_0x0987('0x10')](_0x0987('0x29'),_0x5597d5);logger['debug']('AddTags',_0x5597d5,JSON[_0x0987('0x13')](_0x17f33e));_0x2e2bb3(_0x17f33e);})[_0x0987('0x19')](function(_0x39d99b){logger['error'](_0x0987('0x29'),_0x39d99b['message'],_0x5597d5);_0x5a1e89(_this[_0x0987('0x14')](0x1f4,_0x39d99b['message']));});});}; \ No newline at end of file +var _0x8c49=['AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','request','WhatsappInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread'];(function(_0x41628f,_0x4fbc62){var _0x28f7f1=function(_0x90e33){while(--_0x90e33){_0x41628f['push'](_0x41628f['shift']());}};_0x28f7f1(++_0x4fbc62);}(_0x8c49,0x1da));var _0x98c4=function(_0x36acb3,_0x204e94){_0x36acb3=_0x36acb3-0x0;var _0x13976c=_0x8c49[_0x36acb3];return _0x13976c;};'use strict';var _=require('lodash');var util=require(_0x98c4('0x0'));var moment=require(_0x98c4('0x1'));var BPromise=require('bluebird');var rs=require(_0x98c4('0x2'));var fs=require('fs');var Redis=require(_0x98c4('0x3'));var db=require(_0x98c4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x98c4('0x5'))(_0x98c4('0x6'));var config=require(_0x98c4('0x7'));var jayson=require(_0x98c4('0x8'));var client=jayson[_0x98c4('0x9')]['http']({'port':0x232a});config['redis']=_[_0x98c4('0xa')](config['redis'],{'host':_0x98c4('0xb'),'port':0x18eb});var socket=require(_0x98c4('0xc'))(new Redis(config[_0x98c4('0xd')]));require(_0x98c4('0xe'))['register'](socket);function respondWithRpcPromise(_0x5f09ac,_0x167bea,_0x2e011c){return new BPromise(function(_0x24ef47,_0x1b563f){return client[_0x98c4('0xf')](_0x5f09ac,_0x2e011c)['then'](function(_0x1407dd){logger['info'](_0x98c4('0x10'),_0x167bea,'request\x20sent');logger[_0x98c4('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x167bea,'request\x20sent',JSON[_0x98c4('0x12')](_0x1407dd));if(_0x1407dd[_0x98c4('0x13')]){if(_0x1407dd[_0x98c4('0x13')][_0x98c4('0x14')]===0x1f4){logger['error'](_0x98c4('0x10'),_0x167bea,_0x1407dd[_0x98c4('0x13')][_0x98c4('0x15')]);return _0x1b563f(_0x1407dd[_0x98c4('0x13')][_0x98c4('0x15')]);}logger[_0x98c4('0x13')](_0x98c4('0x10'),_0x167bea,_0x1407dd[_0x98c4('0x13')][_0x98c4('0x15')]);return _0x24ef47(_0x1407dd['error']['message']);}else{logger[_0x98c4('0x16')](_0x98c4('0x10'),_0x167bea,_0x98c4('0x17'));_0x24ef47(_0x1407dd[_0x98c4('0x18')]['message']);}})[_0x98c4('0x19')](function(_0x284e93){logger[_0x98c4('0x13')](_0x98c4('0x10'),_0x167bea,_0x284e93);_0x1b563f(_0x284e93);});});}exports[_0x98c4('0x1a')]=function(_0x1c706b){var _0x3d7280=this;return new Promise(function(_0xe9d5fa,_0x3d8470){return db[_0x98c4('0x1b')][_0x98c4('0x1c')](_0x1c706b[_0x98c4('0x1d')],{'raw':_0x1c706b['options']?_0x1c706b[_0x98c4('0x1e')][_0x98c4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c706b[_0x98c4('0x1e')]?_0x1c706b[_0x98c4('0x1e')][_0x98c4('0x20')]||null:null,'attributes':_0x1c706b[_0x98c4('0x1e')]?_0x1c706b['options'][_0x98c4('0x21')]||null:null,'limit':_0x1c706b[_0x98c4('0x1e')]?_0x1c706b[_0x98c4('0x1e')][_0x98c4('0x22')]||null:null})[_0x98c4('0x23')](function(_0xd9deb8){logger[_0x98c4('0x16')](_0x98c4('0x1a'),_0x1c706b);logger[_0x98c4('0x11')]('UpdateWhatsappInteraction',_0x1c706b,JSON[_0x98c4('0x12')](_0xd9deb8));_0xe9d5fa(_0xd9deb8);})[_0x98c4('0x19')](function(_0x41855c){logger[_0x98c4('0x13')](_0x98c4('0x1a'),_0x41855c['message'],_0x1c706b);_0x3d8470(_0x3d7280[_0x98c4('0x13')](0x1f4,_0x41855c[_0x98c4('0x15')]));});});};exports[_0x98c4('0x24')]=function(_0xc23888){return new Promise(function(_0x16586e,_0x8fed52){return db['WhatsappInteraction'][_0x98c4('0x25')]({'where':_0xc23888['options']?_0xc23888[_0x98c4('0x1e')]['where']||null:null})[_0x98c4('0x23')](function(_0x2c2b66){if(_0x2c2b66){return _0x2c2b66[_0x98c4('0x26')](_0xc23888[_0x98c4('0x1d')][_0x98c4('0x27')],_[_0x98c4('0x28')](_0xc23888[_0x98c4('0x1d')],[_0x98c4('0x27'),'id'])||{});}})[_0x98c4('0x29')](function(_0x26a8be){logger['info']('AddTags',_0xc23888);logger['debug'](_0x98c4('0x2a'),_0xc23888,JSON[_0x98c4('0x12')](_0x26a8be));_0x16586e(_0x26a8be);})[_0x98c4('0x19')](function(_0x13b7fe){logger['error'](_0x98c4('0x2a'),_0x13b7fe[_0x98c4('0x15')],_0xc23888);_0x8fed52(_this[_0x98c4('0x13')](0x1f4,_0x13b7fe[_0x98c4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 07690f9..184cb79 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 _0x7064=['whatsappInteraction:','save','remove','removeListener'];(function(_0x4d1639,_0x4ca48f){var _0x1a246d=function(_0x90ca54){while(--_0x90ca54){_0x4d1639['push'](_0x4d1639['shift']());}};_0x1a246d(++_0x4ca48f);}(_0x7064,0x85));var _0x4706=function(_0x534271,_0x707a7){_0x534271=_0x534271-0x0;var _0x3aae0c=_0x7064[_0x534271];return _0x3aae0c;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x4706('0x0'),_0x4706('0x1'),'update'];function createListener(_0x5829b0,_0x4b104a){return function(_0x9946d0){_0x4b104a['emit'](_0x5829b0,_0x9946d0);};}function removeListener(_0x501217,_0x214bd1){return function(){WhatsappInteractionEvents[_0x4706('0x2')](_0x501217,_0x214bd1);};}exports['register']=function(_0x4e8554){for(var _0xb5cccd=0x0,_0x5c5385=events['length'];_0xb5cccd<_0x5c5385;_0xb5cccd++){var _0x4ae9fe=events[_0xb5cccd];var _0x1f0df4=createListener(_0x4706('0x3')+_0x4ae9fe,_0x4e8554);WhatsappInteractionEvents['on'](_0x4ae9fe,_0x1f0df4);}}; \ No newline at end of file +var _0xdff5=['emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xdff5,0x17c));var _0x5dff=function(_0x3fc1de,_0x1392f9){_0x3fc1de=_0x3fc1de-0x0;var _0x13fbba=_0xdff5[_0x3fc1de];return _0x13fbba;};'use strict';var WhatsappInteractionEvents=require(_0x5dff('0x0'));var events=[_0x5dff('0x1'),_0x5dff('0x2'),_0x5dff('0x3')];function createListener(_0x470650,_0x26a20b){return function(_0x1252e3){_0x26a20b[_0x5dff('0x4')](_0x470650,_0x1252e3);};}function removeListener(_0x588f72,_0x4fc9eb){return function(){WhatsappInteractionEvents[_0x5dff('0x5')](_0x588f72,_0x4fc9eb);};}exports['register']=function(_0x5ee812){for(var _0x2eb801=0x0,_0x8cce71=events[_0x5dff('0x6')];_0x2eb801<_0x8cce71;_0x2eb801++){var _0x3d6f5f=events[_0x2eb801];var _0x33a958=createListener(_0x5dff('0x7')+_0x3d6f5f,_0x5ee812);WhatsappInteractionEvents['on'](_0x3d6f5f,_0x33a958);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index aa4a83a..34c3168 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 _0x57b2=['/:id','show','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','index','get','/describe','isAuthenticated'];(function(_0x20909c,_0x7a9ab){var _0x5531d2=function(_0x5232a6){while(--_0x5232a6){_0x20909c['push'](_0x20909c['shift']());}};_0x5531d2(++_0x7a9ab);}(_0x57b2,0xc4));var _0x257b=function(_0x333062,_0x3c6887){_0x333062=_0x333062-0x0;var _0x39b6c5=_0x57b2[_0x333062];return _0x39b6c5;};'use strict';var multer=require(_0x257b('0x0'));var util=require(_0x257b('0x1'));var path=require('path');var timeout=require(_0x257b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x257b('0x3'));var auth=require(_0x257b('0x4'));var interaction=require(_0x257b('0x5'));var config=require(_0x257b('0x6'));var controller=require(_0x257b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x257b('0x8')]);router[_0x257b('0x9')](_0x257b('0xa'),auth[_0x257b('0xb')](),controller['describe']);router['get'](_0x257b('0xc'),auth[_0x257b('0xb')](),controller[_0x257b('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x257b('0xe')](_0x257b('0xf'),_0x257b('0x10')),controller[_0x257b('0x11')]);router['post']('/:id/status',controller[_0x257b('0x12')]);router[_0x257b('0x13')](_0x257b('0xc'),auth[_0x257b('0xb')](),controller['update']);router[_0x257b('0x13')](_0x257b('0x14'),auth['isAuthenticated'](),controller[_0x257b('0x15')]);router[_0x257b('0x13')](_0x257b('0x16'),auth[_0x257b('0xb')](),controller['reject']);router[_0x257b('0x17')](_0x257b('0xc'),auth[_0x257b('0xb')](),controller[_0x257b('0x18')]);module[_0x257b('0x19')]=router; \ No newline at end of file +var _0xca15=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','status','put','/:id/reject','reject','delete','destroy','path','connect-timeout','express','Router','fs-extra'];(function(_0x5c4ca2,_0x295fee){var _0x47c971=function(_0x12c38e){while(--_0x12c38e){_0x5c4ca2['push'](_0x5c4ca2['shift']());}};_0x47c971(++_0x295fee);}(_0xca15,0x1e9));var _0x5ca1=function(_0x43a3cc,_0x55ae7d){_0x43a3cc=_0x43a3cc-0x0;var _0x375d6a=_0xca15[_0x43a3cc];return _0x375d6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5ca1('0x0'));var timeout=require(_0x5ca1('0x1'));var express=require(_0x5ca1('0x2'));var router=express[_0x5ca1('0x3')]();var fs_extra=require(_0x5ca1('0x4'));var auth=require(_0x5ca1('0x5'));var interaction=require(_0x5ca1('0x6'));var config=require(_0x5ca1('0x7'));var controller=require(_0x5ca1('0x8'));router[_0x5ca1('0x9')]('/',auth[_0x5ca1('0xa')](),controller[_0x5ca1('0xb')]);router[_0x5ca1('0x9')](_0x5ca1('0xc'),auth[_0x5ca1('0xa')](),controller[_0x5ca1('0xd')]);router[_0x5ca1('0x9')](_0x5ca1('0xe'),auth[_0x5ca1('0xa')](),controller[_0x5ca1('0xf')]);router[_0x5ca1('0x10')]('/',auth[_0x5ca1('0xa')](),interaction[_0x5ca1('0x11')]('whatsapp',_0x5ca1('0x12')),controller['create']);router[_0x5ca1('0x10')](_0x5ca1('0x13'),controller[_0x5ca1('0x14')]);router[_0x5ca1('0x15')](_0x5ca1('0xe'),auth[_0x5ca1('0xa')](),controller['update']);router[_0x5ca1('0x15')]('/:id/accept',auth[_0x5ca1('0xa')](),controller['accept']);router[_0x5ca1('0x15')](_0x5ca1('0x16'),auth['isAuthenticated'](),controller[_0x5ca1('0x17')]);router[_0x5ca1('0x18')]('/:id',auth[_0x5ca1('0xa')](),controller[_0x5ca1('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index f7dbb98..f90f802 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 _0x3efa=['BOOLEAN','ENUM','out','STRING','DATE','exports','medium'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x3efa,0x147));var _0xa3ef=function(_0x36666d,_0xa16069){_0x36666d=_0x36666d-0x0;var _0x2366de=_0x3efa[_0x36666d];return _0x2366de;};'use strict';var Sequelize=require('sequelize');module[_0xa3ef('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa3ef('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa3ef('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa3ef('0x3')]('in',_0xa3ef('0x4')),'defaultValue':_0xa3ef('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa3ef('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xa3ef('0x6')]},'secret':{'type':Sequelize[_0xa3ef('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa3ef('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf6f0=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT'];(function(_0xdd31c,_0x484018){var _0x11b6ce=function(_0x178aca){while(--_0x178aca){_0xdd31c['push'](_0xdd31c['shift']());}};_0x11b6ce(++_0x484018);}(_0xf6f0,0x157));var _0x0f6f=function(_0x1f1305,_0x2435f5){_0x1f1305=_0x1f1305-0x0;var _0x571a9d=_0xf6f0[_0x1f1305];return _0x571a9d;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x0f6f('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x0f6f('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0f6f('0x2')]('in',_0x0f6f('0x3')),'defaultValue':_0x0f6f('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0f6f('0x4')](0xbe)},'phone':{'type':Sequelize[_0x0f6f('0x4')]},'readAt':{'type':Sequelize[_0x0f6f('0x5')]},'secret':{'type':Sequelize[_0x0f6f('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0f6f('0x4')]},'providerResponse':{'type':Sequelize[_0x0f6f('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 16443e3..1f23f19 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 _0xa003=['agent','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','whatsapp-interactions','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','interface','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','inspect','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\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','save','update','then','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','show','params','keys','options','find','create','body','destroy','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','format','interaction','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact'];(function(_0x11f249,_0x4ca4a8){var _0x5c3656=function(_0x27c9f8){while(--_0x27c9f8){_0x11f249['push'](_0x11f249['shift']());}};_0x5c3656(++_0x4ca4a8);}(_0xa003,0x12e));var _0x3a00=function(_0x5eef10,_0xa7befd){_0x5eef10=_0x5eef10-0x0;var _0x58e39e=_0xa003[_0x5eef10];return _0x58e39e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3a00('0x0'));var jsonpatch=require(_0x3a00('0x1'));var rp=require(_0x3a00('0x2'));var moment=require(_0x3a00('0x3'));var BPromise=require(_0x3a00('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a00('0x5'));var sox=require(_0x3a00('0x6'));var csv=require(_0x3a00('0x7'));var ejs=require(_0x3a00('0x8'));var fs=require('fs');var fs_extra=require(_0x3a00('0x9'));var _=require(_0x3a00('0xa'));var squel=require('squel');var crypto=require(_0x3a00('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3a00('0xc'));var Papa=require(_0x3a00('0xd'));var Redis=require('ioredis');var authService=require(_0x3a00('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3a00('0xf'));var hardwareService=require(_0x3a00('0x10'));var logger=require(_0x3a00('0x11'))('api');var utils=require(_0x3a00('0x12'));var config=require(_0x3a00('0x13'));var licenseUtil=require(_0x3a00('0x14'));var db=require(_0x3a00('0x15'))['db'];config[_0x3a00('0x16')]=_[_0x3a00('0x17')](config['redis'],{'host':_0x3a00('0x18'),'port':0x18eb});var socket=require(_0x3a00('0x19'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x3a00('0x1a'));var client=jayson[_0x3a00('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x3a00('0x1b')][_0x3a00('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x55c741,_0x2fdb4e,_0x131a51,_0x1a35ce){return new BPromise(function(_0x162132,_0x2b9813){var _0x2cc85d=_0x1a35ce||client;return _0x2cc85d[_0x3a00('0x1d')](_0x55c741,_0x131a51)['then'](function(_0x48e6a6){logger['info'](_0x3a00('0x1e'),_0x2fdb4e,_0x3a00('0x1f'));logger['debug'](_0x3a00('0x20'),_0x2fdb4e,_0x3a00('0x1f'),JSON[_0x3a00('0x21')](_0x48e6a6));if(_0x48e6a6[_0x3a00('0x22')]){if(_0x48e6a6['error'][_0x3a00('0x23')]===0x1f4){logger[_0x3a00('0x22')](_0x3a00('0x1e'),_0x2fdb4e,_0x48e6a6['error'][_0x3a00('0x24')]);return _0x2b9813(_0x48e6a6[_0x3a00('0x22')]['message']);}logger[_0x3a00('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x2fdb4e,_0x48e6a6[_0x3a00('0x22')][_0x3a00('0x24')]);return _0x162132(_0x48e6a6[_0x3a00('0x22')][_0x3a00('0x24')]);}else{logger['info'](_0x3a00('0x1e'),_0x2fdb4e,_0x3a00('0x1f'));_0x162132(_0x48e6a6[_0x3a00('0x25')][_0x3a00('0x24')]);}})[_0x3a00('0x26')](function(_0x54307f){logger[_0x3a00('0x22')](_0x3a00('0x1e'),_0x2fdb4e,_0x54307f);_0x2b9813(_0x54307f);});});}function respondWithStatusCode(_0xc439a2,_0xe16cd1){_0xe16cd1=_0xe16cd1||0xcc;return function(_0xca7c8d){if(_0xca7c8d){return _0xc439a2[_0x3a00('0x27')](_0xe16cd1);}return _0xc439a2['status'](_0xe16cd1)[_0x3a00('0x28')]();};}function respondWithResult(_0x41ec8c,_0xf0080f){_0xf0080f=_0xf0080f||0xc8;return function(_0x413204){if(_0x413204){return _0x41ec8c[_0x3a00('0x29')](_0xf0080f)[_0x3a00('0x2a')](_0x413204);}};}function respondWithFilteredResult(_0x1b5b6c,_0x2eabbd){return function(_0x521903){if(_0x521903){var _0x276580=typeof _0x2eabbd[_0x3a00('0x2b')]==='undefined'&&typeof _0x2eabbd[_0x3a00('0x2c')]===_0x3a00('0x2d');var _0x561525=_0x521903[_0x3a00('0x2e')];var _0x55a220=_0x276580?0x0:_0x2eabbd['offset'];var _0x376fde=_0x276580?_0x521903[_0x3a00('0x2e')]:_0x2eabbd[_0x3a00('0x2b')]+_0x2eabbd[_0x3a00('0x2c')];var _0x5a4e8c;if(_0x376fde>=_0x561525){_0x376fde=_0x561525;_0x5a4e8c=0xc8;}else{_0x5a4e8c=0xce;}_0x1b5b6c[_0x3a00('0x29')](_0x5a4e8c);return _0x1b5b6c[_0x3a00('0x2f')](_0x3a00('0x30'),_0x55a220+'-'+_0x376fde+'/'+_0x561525)[_0x3a00('0x2a')](_0x521903);}return null;};}function patchUpdates(_0x578a5f){return function(_0x569725){try{jsonpatch[_0x3a00('0x31')](_0x569725,_0x578a5f,!![]);}catch(_0x18b9a9){return BPromise[_0x3a00('0x32')](_0x18b9a9);}return _0x569725[_0x3a00('0x33')]();};}function saveUpdates(_0x5a986b,_0x2ae3af){return function(_0x111d69){if(_0x111d69){return _0x111d69[_0x3a00('0x34')](_0x5a986b)[_0x3a00('0x35')](function(_0x4f54dd){return _0x4f54dd;});}return null;};}function removeEntity(_0x5715be,_0x28577e){return function(_0x52c6b8){if(_0x52c6b8){return _0x52c6b8['destroy']()['then'](function(){_0x5715be[_0x3a00('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f81aa,_0x18112c){return function(_0x57d1fd){if(!_0x57d1fd){_0x3f81aa[_0x3a00('0x27')](0x194);}return _0x57d1fd;};}function handleError(_0x28378a,_0x4a2775){_0x4a2775=_0x4a2775||0x1f4;return function(_0x4467a6){logger[_0x3a00('0x22')](_0x4467a6[_0x3a00('0x36')]);if(_0x4467a6['name']){delete _0x4467a6[_0x3a00('0x37')];}_0x28378a['status'](_0x4a2775)['send'](_0x4467a6);};}exports[_0x3a00('0x38')]=function(_0x300037,_0xc047d3){var _0x24d681={},_0x9121c8={},_0xf69ced={'count':0x0,'rows':[]};var _0xfdb27b=_[_0x3a00('0x39')](db[_0x3a00('0x3a')][_0x3a00('0x3b')],function(_0x9623f1){return{'name':_0x9623f1[_0x3a00('0x3c')],'type':_0x9623f1[_0x3a00('0x3d')]['key']};});_0x9121c8['model']=_[_0x3a00('0x39')](_0xfdb27b,_0x3a00('0x37'));_0x9121c8[_0x3a00('0x3e')]=_['keys'](_0x300037[_0x3a00('0x3e')]);_0x9121c8[_0x3a00('0x3f')]=_[_0x3a00('0x40')](_0x9121c8[_0x3a00('0x41')],_0x9121c8[_0x3a00('0x3e')]);_0x24d681[_0x3a00('0x42')]=_['intersection'](_0x9121c8[_0x3a00('0x41')],qs[_0x3a00('0x43')](_0x300037[_0x3a00('0x3e')][_0x3a00('0x43')]));_0x24d681[_0x3a00('0x42')]=_0x24d681[_0x3a00('0x42')][_0x3a00('0x44')]?_0x24d681[_0x3a00('0x42')]:_0x9121c8[_0x3a00('0x41')];if(!_0x300037[_0x3a00('0x3e')][_0x3a00('0x45')](_0x3a00('0x46'))){_0x24d681['limit']=qs[_0x3a00('0x2c')](_0x300037['query'][_0x3a00('0x2c')]);_0x24d681[_0x3a00('0x2b')]=qs[_0x3a00('0x2b')](_0x300037['query']['offset']);}_0x24d681['order']=qs[_0x3a00('0x47')](_0x300037[_0x3a00('0x3e')][_0x3a00('0x47')]);_0x24d681['where']=qs[_0x3a00('0x3f')](_[_0x3a00('0x48')](_0x300037['query'],_0x9121c8['filters']),_0xfdb27b);if(_0x300037[_0x3a00('0x3e')][_0x3a00('0x49')]){_0x24d681[_0x3a00('0x4a')]=_['merge'](_0x24d681['where'],{'$or':_[_0x3a00('0x39')](_0xfdb27b,function(_0xf3817){if(_0xf3817[_0x3a00('0x3d')]!==_0x3a00('0x4b')){var _0x182867={};_0x182867[_0xf3817['name']]={'$like':'%'+_0x300037['query']['filter']+'%'};return _0x182867;}})});}_0x24d681=_[_0x3a00('0x4c')]({},_0x24d681,_0x300037['options']);var _0x4c5f46={'where':_0x24d681[_0x3a00('0x4a')]};return db['WhatsappMessage'][_0x3a00('0x2e')](_0x4c5f46)[_0x3a00('0x35')](function(_0x562296){_0xf69ced[_0x3a00('0x2e')]=_0x562296;if(_0x300037[_0x3a00('0x3e')][_0x3a00('0x4d')]){_0x24d681[_0x3a00('0x4e')]=[{'all':!![]}];}return db[_0x3a00('0x3a')]['findAll'](_0x24d681);})['then'](function(_0x4924e2){_0xf69ced[_0x3a00('0x4f')]=_0x4924e2;return _0xf69ced;})[_0x3a00('0x35')](respondWithFilteredResult(_0xc047d3,_0x24d681))['catch'](handleError(_0xc047d3,null));};exports[_0x3a00('0x50')]=function(_0x35a707,_0x218fd6){var _0x5172d6={'raw':!![],'where':{'id':_0x35a707[_0x3a00('0x51')]['id']}},_0x324c75={};_0x324c75[_0x3a00('0x41')]=_[_0x3a00('0x52')](db[_0x3a00('0x3a')][_0x3a00('0x3b')]);_0x324c75[_0x3a00('0x3e')]=_[_0x3a00('0x52')](_0x35a707[_0x3a00('0x3e')]);_0x324c75[_0x3a00('0x3f')]=_[_0x3a00('0x40')](_0x324c75[_0x3a00('0x41')],_0x324c75[_0x3a00('0x3e')]);_0x5172d6[_0x3a00('0x42')]=_[_0x3a00('0x40')](_0x324c75[_0x3a00('0x41')],qs[_0x3a00('0x43')](_0x35a707['query'][_0x3a00('0x43')]));_0x5172d6[_0x3a00('0x42')]=_0x5172d6[_0x3a00('0x42')][_0x3a00('0x44')]?_0x5172d6[_0x3a00('0x42')]:_0x324c75[_0x3a00('0x41')];if(_0x35a707[_0x3a00('0x3e')][_0x3a00('0x4d')]){_0x5172d6[_0x3a00('0x4e')]=[{'all':!![]}];}_0x5172d6=_['merge']({},_0x5172d6,_0x35a707[_0x3a00('0x53')]);return db[_0x3a00('0x3a')][_0x3a00('0x54')](_0x5172d6)[_0x3a00('0x35')](handleEntityNotFound(_0x218fd6,null))[_0x3a00('0x35')](respondWithResult(_0x218fd6,null))['catch'](handleError(_0x218fd6,null));};exports['create']=function(_0x31be19,_0x3a574e){return db[_0x3a00('0x3a')][_0x3a00('0x55')](_0x31be19['body'],{})[_0x3a00('0x35')](respondWithResult(_0x3a574e,0xc9))[_0x3a00('0x26')](handleError(_0x3a574e,null));};exports[_0x3a00('0x34')]=function(_0x4ef762,_0x110a97){if(_0x4ef762[_0x3a00('0x56')]['id']){delete _0x4ef762[_0x3a00('0x56')]['id'];}return db[_0x3a00('0x3a')][_0x3a00('0x54')]({'where':{'id':_0x4ef762[_0x3a00('0x51')]['id']}})['then'](handleEntityNotFound(_0x110a97,null))[_0x3a00('0x35')](saveUpdates(_0x4ef762[_0x3a00('0x56')],null))['then'](respondWithResult(_0x110a97,null))[_0x3a00('0x26')](handleError(_0x110a97,null));};exports[_0x3a00('0x57')]=function(_0x3f0238,_0x4e4eda){return db[_0x3a00('0x3a')]['find']({'where':{'id':_0x3f0238[_0x3a00('0x51')]['id']}})[_0x3a00('0x35')](handleEntityNotFound(_0x4e4eda,null))[_0x3a00('0x35')](removeEntity(_0x4e4eda,null))[_0x3a00('0x26')](handleError(_0x4e4eda,null));};exports['describe']=function(_0x1ad032,_0x522745){return db[_0x3a00('0x3a')]['describe']()[_0x3a00('0x35')](respondWithResult(_0x522745,null))['catch'](handleError(_0x522745,null));};var interaction_log=require(_0x3a00('0x11'))('whatsapp-interactions');exports[_0x3a00('0x58')]=function(_0x3ee607,_0x523ce0,_0x3d3a53){var _0x186f88={'agent':{},'channel':_0x3a00('0x59')};if(_0x3ee607[_0x3a00('0x56')]['id']){delete _0x3ee607[_0x3a00('0x56')]['id'];}_0x3ee607[_0x3a00('0x56')][_0x3a00('0x5a')]=!![];_0x3ee607[_0x3a00('0x56')][_0x3a00('0x5b')]=moment()['format'](_0x3a00('0x5c'));_0x3ee607['body']['UserId']=_0x3ee607[_0x3a00('0x56')][_0x3a00('0x5d')]||_0x3ee607[_0x3a00('0x5e')]['id'];_0x186f88['agent']['id']=_0x3ee607[_0x3a00('0x56')][_0x3a00('0x5d')];return db[_0x3a00('0x3a')][_0x3a00('0x54')]({'where':{'id':_0x3ee607[_0x3a00('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x523ce0,null))[_0x3a00('0x35')](saveUpdates(_0x3ee607['body'],null))[_0x3a00('0x35')](function(_0x168e5b){if(_0x168e5b){_0x186f88[_0x3a00('0x24')]=_0x168e5b[_0x3a00('0x5f')]({'plain':!![]});return db[_0x3a00('0x60')][_0x3a00('0x54')]({'where':{'id':_0x168e5b[_0x3a00('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x523ce0,null))[_0x3a00('0x35')](function(_0x467288){if(_0x467288){return _0x467288[_0x3a00('0x34')]({'UserId':_0x3ee607['body']['UserId'],'read1stAt':_['isNil'](_0x467288[_0x3a00('0x62')])?moment()[_0x3a00('0x63')](_0x3a00('0x5c')):undefined});}return null;})[_0x3a00('0x35')](function(_0x3749a7){if(_0x3749a7){_0x186f88[_0x3a00('0x64')]=_0x3749a7['get']({'plain':!![]});interaction_log[_0x3a00('0x65')](_0x3a00('0x66'),_0x3ee607['user']['id'],_0x3ee607[_0x3a00('0x5e')][_0x3a00('0x37')],_0x3ee607['user'][_0x3a00('0x67')],_0x186f88['interaction']['id'],_0x3ee607['body']?JSON[_0x3a00('0x21')](_0x3ee607[_0x3a00('0x56')]):_0x3a00('0x68'));return respondWithRpcPromise(_0x3a00('0x69'),_0x3a00('0x6a'),_0x186f88);}return null;})[_0x3a00('0x35')](function(_0x5e75c6){var _0xfa61bf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e75c6[_0x3a00('0x24')][_0x3a00('0x6b')];return db[_0x3a00('0x6c')]['query'](_0xfa61bf,{'type':db[_0x3a00('0x6d')][_0x3a00('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x486c60){return _0x486c60;});})['then'](function(_0x915a25){if(_0x915a25){_0x186f88[_0x3a00('0x24')][_0x3a00('0x6f')]=_0x915a25[0x0];if(!_0x3ee607['body'][_0x3a00('0x5d')])return;return db['User'][_0x3a00('0x54')]({'where':{'id':_0x3ee607[_0x3a00('0x56')]['UserId'],'role':_0x3a00('0x70')},'attributes':['id',_0x3a00('0x37'),_0x3a00('0x71'),_0x3a00('0x72'),_0x3a00('0x73')],'raw':!![]});}return null;})[_0x3a00('0x35')](function(_0x159202){if(!_0x159202)return null;_0x186f88['message'][_0x3a00('0x70')]=_0x159202;return _0x186f88;})['then'](function(_0x16650a){if(_0x16650a){if(_0x3ee607[_0x3a00('0x56')][_0x3a00('0x74')]){_0x186f88[_0x3a00('0x24')]['interface']=util[_0x3a00('0x63')](_0x3a00('0x75'),_0x3ee607[_0x3a00('0x5e')][_0x3a00('0x37')]);_0x186f88[_0x3a00('0x24')]['channel']=_0x186f88['channel'];_0x186f88[_0x3a00('0x24')]['motionChannel']=_0x186f88[_0x3a00('0x76')];_0x186f88[_0x3a00('0x24')][_0x3a00('0x77')]=_0x3a00('0x58');return respondWithRpcPromise(_0x3a00('0x78'),_0x3a00('0x78'),{'event':'acceptmessage','message':_0x186f88[_0x3a00('0x24')]},client9002)[_0x3a00('0x35')](function(){return _0x186f88;});}return _0x186f88;}return null;})[_0x3a00('0x35')](respondWithResult(_0x523ce0,null))[_0x3a00('0x26')](handleError(_0x523ce0,null));};var interaction_log=require(_0x3a00('0x11'))(_0x3a00('0x79'));exports['reject']=function(_0x28bd8e,_0x151500,_0x350400){var _0xb3e204={'agent':{},'channel':_0x3a00('0x59')};if(_0x28bd8e['body']['id']){delete _0x28bd8e[_0x3a00('0x56')]['id'];}_0x28bd8e[_0x3a00('0x56')][_0x3a00('0x5d')]=_0x28bd8e[_0x3a00('0x56')][_0x3a00('0x5d')]||_0x28bd8e[_0x3a00('0x5e')]['id'];_0xb3e204[_0x3a00('0x70')]['id']=_0x28bd8e['body']['UserId'];return db[_0x3a00('0x3a')][_0x3a00('0x54')]({'where':{'id':_0x28bd8e[_0x3a00('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x151500,null))['then'](function(_0x3853a){if(_0x3853a){_0xb3e204['message']=_0x3853a[_0x3a00('0x5f')]({'plain':!![]});return db[_0x3a00('0x60')][_0x3a00('0x54')]({'where':{'id':_0x3853a['WhatsappInteractionId']}});}return null;})[_0x3a00('0x35')](handleEntityNotFound(_0x151500,null))['then'](function(_0x3034c4){if(_0x3034c4){_0xb3e204[_0x3a00('0x64')]=_0x3034c4['get']({'plain':!![]});interaction_log[_0x3a00('0x65')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x28bd8e['user']['id'],_0x28bd8e['user'][_0x3a00('0x37')],_0x28bd8e['user'][_0x3a00('0x67')],_0xb3e204[_0x3a00('0x64')]['id'],_0x28bd8e[_0x3a00('0x56')]?JSON['stringify'](_0x28bd8e[_0x3a00('0x56')]):_0x3a00('0x68'));return respondWithRpcPromise(_0x3a00('0x7a'),_0x3a00('0x7b'),_0xb3e204);}return null;})[_0x3a00('0x35')](function(_0x50b2ba){var _0x1c657f=_0x3a00('0x7c')+_0x50b2ba[_0x3a00('0x24')][_0x3a00('0x6b')];return db[_0x3a00('0x6c')]['query'](_0x1c657f,{'type':db[_0x3a00('0x6d')][_0x3a00('0x6e')][_0x3a00('0x7d')],'raw':!![]})[_0x3a00('0x35')](function(_0x53857d){return _0x53857d;});})[_0x3a00('0x35')](function(_0x43db91){if(_0x43db91){_0xb3e204['message'][_0x3a00('0x6f')]=_0x43db91[0x0];if(!_0x28bd8e['body'][_0x3a00('0x5d')])return;return db['User'][_0x3a00('0x54')]({'where':{'id':_0x28bd8e[_0x3a00('0x56')]['UserId'],'role':_0x3a00('0x70')},'attributes':['id',_0x3a00('0x37'),_0x3a00('0x71'),'email',_0x3a00('0x73')],'raw':!![]});}return null;})['then'](function(_0x197304){if(!_0x197304)return null;_0xb3e204['message']['agent']=_0x197304;return _0xb3e204;})[_0x3a00('0x35')](function(_0x811b4){if(_0x811b4){_0x811b4[_0x3a00('0x24')][_0x3a00('0x7e')]=util['format']('SIP/%s',_0x28bd8e[_0x3a00('0x5e')][_0x3a00('0x37')]);_0x811b4[_0x3a00('0x24')][_0x3a00('0x76')]=_0xb3e204[_0x3a00('0x76')];_0x811b4[_0x3a00('0x24')][_0x3a00('0x7f')]=_0xb3e204['channel'];_0x811b4['message'][_0x3a00('0x77')]=_0x3a00('0x32');respondWithRpcPromise(_0x3a00('0x78'),_0x3a00('0x78'),{'event':_0x3a00('0x80'),'message':_0x811b4[_0x3a00('0x24')]},client9002);return _0xb3e204;}return null;})['then'](respondWithResult(_0x151500,null))[_0x3a00('0x26')](handleError(_0x151500,null));};exports[_0x3a00('0x29')]=function(_0x5f577a,_0x542f6f,_0x380465){if(_0x5f577a[_0x3a00('0x56')]['id']){delete _0x5f577a[_0x3a00('0x56')]['id'];}var _0x16f8d3;return db[_0x3a00('0x3a')]['find']({'where':{'id':_0x5f577a[_0x3a00('0x51')]['id']}})[_0x3a00('0x35')](handleEntityNotFound(_0x542f6f,null))[_0x3a00('0x35')](function(_0x2df155){if(_0x2df155){_0x16f8d3=_0x2df155;return db[_0x3a00('0x81')]['find']({'where':{'id':_0x2df155[_0x3a00('0x82')]}});}})[_0x3a00('0x35')](handleEntityNotFound(_0x542f6f,null))[_0x3a00('0x35')](function(_0x2730fb){if(_0x2730fb){logger[_0x3a00('0x83')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0x3a00('0x84'),_0x2730fb[_0x3a00('0x3d')],util['inspect'](_0x5f577a['body'],{'showHidden':![],'depth':null}));switch(_0x2730fb[_0x3a00('0x3d')]){case _0x3a00('0x85'):if(_0x5f577a[_0x3a00('0x56')]['MessageSid']&&_0x5f577a[_0x3a00('0x56')][_0x3a00('0x86')]===_0x16f8d3[_0x3a00('0x87')]&&_0x5f577a[_0x3a00('0x56')][_0x3a00('0x88')]&&_0x5f577a[_0x3a00('0x56')][_0x3a00('0x88')]===_0x3a00('0x5a')){return _0x16f8d3[_0x3a00('0x34')]({'read':!![]});}else{logger[_0x3a00('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3a00('0x29'),_0x3a00('0x85'),util[_0x3a00('0x89')](_0x5f577a[_0x3a00('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x16f8d3;}})[_0x3a00('0x35')](respondWithResult(_0x542f6f,null))[_0x3a00('0x26')](handleError(_0x542f6f,null));}; \ No newline at end of file +var _0xafdd=['model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','params','includeAll','create','body','find','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','channel','motionChannel','event','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','SIP/%s','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','inspect','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','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','defaults','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0xafdd,0x1dd));var _0xdafd=function(_0x5a56f4,_0x4f0f75){_0x5a56f4=_0x5a56f4-0x0;var _0x105365=_0xafdd[_0x5a56f4];return _0x105365;};'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('moment');var BPromise=require(_0xdafd('0x5'));var Mustache=require(_0xdafd('0x6'));var util=require('util');var path=require(_0xdafd('0x7'));var sox=require(_0xdafd('0x8'));var csv=require(_0xdafd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdafd('0xa'));var _=require(_0xdafd('0xb'));var squel=require('squel');var crypto=require(_0xdafd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdafd('0xd'));var toCsv=require(_0xdafd('0x9'));var querystring=require(_0xdafd('0xe'));var Papa=require('papaparse');var Redis=require(_0xdafd('0xf'));var authService=require(_0xdafd('0x10'));var qs=require(_0xdafd('0x11'));var as=require(_0xdafd('0x12'));var hardwareService=require(_0xdafd('0x13'));var logger=require(_0xdafd('0x14'))(_0xdafd('0x15'));var utils=require(_0xdafd('0x16'));var config=require(_0xdafd('0x17'));var licenseUtil=require(_0xdafd('0x18'));var db=require(_0xdafd('0x19'))['db'];config['redis']=_[_0xdafd('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdafd('0x1b'))(new Redis(config['redis']));require(_0xdafd('0x1c'))[_0xdafd('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdafd('0x1e')][_0xdafd('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xdafd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x9bf140,_0x220dde,_0x44a077,_0x355b4f){return new BPromise(function(_0x27ce32,_0x4391ef){var _0x2c58bc=_0x355b4f||client;return _0x2c58bc[_0xdafd('0x20')](_0x9bf140,_0x44a077)[_0xdafd('0x21')](function(_0x5a9286){logger[_0xdafd('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x220dde,_0xdafd('0x23'));logger[_0xdafd('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x220dde,_0xdafd('0x23'),JSON[_0xdafd('0x25')](_0x5a9286));if(_0x5a9286[_0xdafd('0x26')]){if(_0x5a9286[_0xdafd('0x26')][_0xdafd('0x27')]===0x1f4){logger[_0xdafd('0x26')](_0xdafd('0x28'),_0x220dde,_0x5a9286[_0xdafd('0x26')][_0xdafd('0x29')]);return _0x4391ef(_0x5a9286[_0xdafd('0x26')][_0xdafd('0x29')]);}logger[_0xdafd('0x26')](_0xdafd('0x28'),_0x220dde,_0x5a9286[_0xdafd('0x26')]['message']);return _0x27ce32(_0x5a9286[_0xdafd('0x26')][_0xdafd('0x29')]);}else{logger[_0xdafd('0x22')](_0xdafd('0x28'),_0x220dde,'request\x20sent');_0x27ce32(_0x5a9286[_0xdafd('0x2a')][_0xdafd('0x29')]);}})[_0xdafd('0x2b')](function(_0x11b74f){logger[_0xdafd('0x26')](_0xdafd('0x28'),_0x220dde,_0x11b74f);_0x4391ef(_0x11b74f);});});}function respondWithStatusCode(_0x57105f,_0x256c1a){_0x256c1a=_0x256c1a||0xcc;return function(_0x47f194){if(_0x47f194){return _0x57105f[_0xdafd('0x2c')](_0x256c1a);}return _0x57105f[_0xdafd('0x2d')](_0x256c1a)['end']();};}function respondWithResult(_0x26950e,_0x1c73d2){_0x1c73d2=_0x1c73d2||0xc8;return function(_0x3ed03a){if(_0x3ed03a){return _0x26950e[_0xdafd('0x2d')](_0x1c73d2)[_0xdafd('0x2e')](_0x3ed03a);}};}function respondWithFilteredResult(_0x249039,_0x18159){return function(_0x41fd58){if(_0x41fd58){var _0x38a56c=typeof _0x18159['offset']===_0xdafd('0x2f')&&typeof _0x18159[_0xdafd('0x30')]===_0xdafd('0x2f');var _0x21fe35=_0x41fd58[_0xdafd('0x31')];var _0x35d9d0=_0x38a56c?0x0:_0x18159[_0xdafd('0x32')];var _0x217714=_0x38a56c?_0x41fd58[_0xdafd('0x31')]:_0x18159['offset']+_0x18159[_0xdafd('0x30')];var _0x3a1114;if(_0x217714>=_0x21fe35){_0x217714=_0x21fe35;_0x3a1114=0xc8;}else{_0x3a1114=0xce;}_0x249039[_0xdafd('0x2d')](_0x3a1114);return _0x249039[_0xdafd('0x33')](_0xdafd('0x34'),_0x35d9d0+'-'+_0x217714+'/'+_0x21fe35)[_0xdafd('0x2e')](_0x41fd58);}return null;};}function patchUpdates(_0x248e2a){return function(_0x43afff){try{jsonpatch[_0xdafd('0x35')](_0x43afff,_0x248e2a,!![]);}catch(_0x431323){return BPromise[_0xdafd('0x36')](_0x431323);}return _0x43afff[_0xdafd('0x37')]();};}function saveUpdates(_0x48b545,_0x34781f){return function(_0x230434){if(_0x230434){return _0x230434[_0xdafd('0x38')](_0x48b545)[_0xdafd('0x21')](function(_0x5145e5){return _0x5145e5;});}return null;};}function removeEntity(_0x2570b6,_0x1f2002){return function(_0x542239){if(_0x542239){return _0x542239[_0xdafd('0x39')]()[_0xdafd('0x21')](function(){_0x2570b6[_0xdafd('0x2d')](0xcc)[_0xdafd('0x3a')]();});}};}function handleEntityNotFound(_0x90f12b,_0x25c85d){return function(_0x4af715){if(!_0x4af715){_0x90f12b[_0xdafd('0x2c')](0x194);}return _0x4af715;};}function handleError(_0x463af8,_0x80de34){_0x80de34=_0x80de34||0x1f4;return function(_0x46497c){logger[_0xdafd('0x26')](_0x46497c[_0xdafd('0x3b')]);if(_0x46497c[_0xdafd('0x3c')]){delete _0x46497c[_0xdafd('0x3c')];}_0x463af8[_0xdafd('0x2d')](_0x80de34)['send'](_0x46497c);};}exports[_0xdafd('0x3d')]=function(_0x46db42,_0x3843fe){var _0x1c5c95={},_0x239684={},_0x2d681d={'count':0x0,'rows':[]};var _0x175196=_[_0xdafd('0x3e')](db[_0xdafd('0x3f')][_0xdafd('0x40')],function(_0x27c3fa){return{'name':_0x27c3fa[_0xdafd('0x41')],'type':_0x27c3fa[_0xdafd('0x42')]['key']};});_0x239684[_0xdafd('0x43')]=_['map'](_0x175196,_0xdafd('0x3c'));_0x239684[_0xdafd('0x44')]=_[_0xdafd('0x45')](_0x46db42[_0xdafd('0x44')]);_0x239684[_0xdafd('0x46')]=_[_0xdafd('0x47')](_0x239684[_0xdafd('0x43')],_0x239684[_0xdafd('0x44')]);_0x1c5c95[_0xdafd('0x48')]=_[_0xdafd('0x47')](_0x239684['model'],qs[_0xdafd('0x49')](_0x46db42[_0xdafd('0x44')][_0xdafd('0x49')]));_0x1c5c95['attributes']=_0x1c5c95[_0xdafd('0x48')][_0xdafd('0x4a')]?_0x1c5c95[_0xdafd('0x48')]:_0x239684['model'];if(!_0x46db42['query']['hasOwnProperty'](_0xdafd('0x4b'))){_0x1c5c95['limit']=qs[_0xdafd('0x30')](_0x46db42[_0xdafd('0x44')][_0xdafd('0x30')]);_0x1c5c95['offset']=qs[_0xdafd('0x32')](_0x46db42[_0xdafd('0x44')][_0xdafd('0x32')]);}_0x1c5c95[_0xdafd('0x4c')]=qs['sort'](_0x46db42['query'][_0xdafd('0x4d')]);_0x1c5c95[_0xdafd('0x4e')]=qs[_0xdafd('0x46')](_[_0xdafd('0x4f')](_0x46db42[_0xdafd('0x44')],_0x239684['filters']),_0x175196);if(_0x46db42[_0xdafd('0x44')][_0xdafd('0x50')]){_0x1c5c95['where']=_['merge'](_0x1c5c95[_0xdafd('0x4e')],{'$or':_['map'](_0x175196,function(_0x2ee1f9){if(_0x2ee1f9[_0xdafd('0x42')]!==_0xdafd('0x51')){var _0xf53fd0={};_0xf53fd0[_0x2ee1f9['name']]={'$like':'%'+_0x46db42['query'][_0xdafd('0x50')]+'%'};return _0xf53fd0;}})});}_0x1c5c95=_[_0xdafd('0x52')]({},_0x1c5c95,_0x46db42[_0xdafd('0x53')]);var _0x5d0b37={'where':_0x1c5c95[_0xdafd('0x4e')]};return db[_0xdafd('0x3f')][_0xdafd('0x31')](_0x5d0b37)[_0xdafd('0x21')](function(_0x104151){_0x2d681d['count']=_0x104151;if(_0x46db42[_0xdafd('0x44')]['includeAll']){_0x1c5c95[_0xdafd('0x54')]=[{'all':!![]}];}return db[_0xdafd('0x3f')][_0xdafd('0x55')](_0x1c5c95);})[_0xdafd('0x21')](function(_0x142e97){_0x2d681d['rows']=_0x142e97;return _0x2d681d;})[_0xdafd('0x21')](respondWithFilteredResult(_0x3843fe,_0x1c5c95))['catch'](handleError(_0x3843fe,null));};exports['show']=function(_0x55bb82,_0x41fe76){var _0x26dbb8={'raw':!![],'where':{'id':_0x55bb82[_0xdafd('0x56')]['id']}},_0x27c43d={};_0x27c43d[_0xdafd('0x43')]=_[_0xdafd('0x45')](db[_0xdafd('0x3f')][_0xdafd('0x40')]);_0x27c43d[_0xdafd('0x44')]=_[_0xdafd('0x45')](_0x55bb82[_0xdafd('0x44')]);_0x27c43d[_0xdafd('0x46')]=_[_0xdafd('0x47')](_0x27c43d[_0xdafd('0x43')],_0x27c43d[_0xdafd('0x44')]);_0x26dbb8['attributes']=_[_0xdafd('0x47')](_0x27c43d[_0xdafd('0x43')],qs['fields'](_0x55bb82[_0xdafd('0x44')][_0xdafd('0x49')]));_0x26dbb8[_0xdafd('0x48')]=_0x26dbb8[_0xdafd('0x48')][_0xdafd('0x4a')]?_0x26dbb8[_0xdafd('0x48')]:_0x27c43d['model'];if(_0x55bb82[_0xdafd('0x44')][_0xdafd('0x57')]){_0x26dbb8[_0xdafd('0x54')]=[{'all':!![]}];}_0x26dbb8=_['merge']({},_0x26dbb8,_0x55bb82[_0xdafd('0x53')]);return db[_0xdafd('0x3f')]['find'](_0x26dbb8)[_0xdafd('0x21')](handleEntityNotFound(_0x41fe76,null))[_0xdafd('0x21')](respondWithResult(_0x41fe76,null))['catch'](handleError(_0x41fe76,null));};exports[_0xdafd('0x58')]=function(_0x59489a,_0x5adbdf){return db[_0xdafd('0x3f')][_0xdafd('0x58')](_0x59489a['body'],{})['then'](respondWithResult(_0x5adbdf,0xc9))['catch'](handleError(_0x5adbdf,null));};exports[_0xdafd('0x38')]=function(_0x173679,_0x2eb04f){if(_0x173679[_0xdafd('0x59')]['id']){delete _0x173679[_0xdafd('0x59')]['id'];}return db[_0xdafd('0x3f')][_0xdafd('0x5a')]({'where':{'id':_0x173679[_0xdafd('0x56')]['id']}})[_0xdafd('0x21')](handleEntityNotFound(_0x2eb04f,null))[_0xdafd('0x21')](saveUpdates(_0x173679[_0xdafd('0x59')],null))[_0xdafd('0x21')](respondWithResult(_0x2eb04f,null))[_0xdafd('0x2b')](handleError(_0x2eb04f,null));};exports[_0xdafd('0x39')]=function(_0x34c675,_0x57cd0b){return db['WhatsappMessage'][_0xdafd('0x5a')]({'where':{'id':_0x34c675[_0xdafd('0x56')]['id']}})[_0xdafd('0x21')](handleEntityNotFound(_0x57cd0b,null))[_0xdafd('0x21')](removeEntity(_0x57cd0b,null))[_0xdafd('0x2b')](handleError(_0x57cd0b,null));};exports[_0xdafd('0x5b')]=function(_0x246777,_0x1d5b8a){return db[_0xdafd('0x3f')]['describe']()[_0xdafd('0x21')](respondWithResult(_0x1d5b8a,null))[_0xdafd('0x2b')](handleError(_0x1d5b8a,null));};var interaction_log=require('../../config/logger')(_0xdafd('0x5c'));exports[_0xdafd('0x5d')]=function(_0x54caec,_0x2163f5,_0x1973f7){var _0x30ecdd={'agent':{},'channel':_0xdafd('0x5e')};if(_0x54caec[_0xdafd('0x59')]['id']){delete _0x54caec[_0xdafd('0x59')]['id'];}_0x54caec[_0xdafd('0x59')][_0xdafd('0x5f')]=!![];_0x54caec[_0xdafd('0x59')]['readAt']=moment()[_0xdafd('0x60')](_0xdafd('0x61'));_0x54caec[_0xdafd('0x59')][_0xdafd('0x62')]=_0x54caec[_0xdafd('0x59')][_0xdafd('0x62')]||_0x54caec[_0xdafd('0x63')]['id'];_0x30ecdd['agent']['id']=_0x54caec[_0xdafd('0x59')]['UserId'];return db[_0xdafd('0x3f')][_0xdafd('0x5a')]({'where':{'id':_0x54caec[_0xdafd('0x56')]['id'],'UserId':null}})[_0xdafd('0x21')](handleEntityNotFound(_0x2163f5,null))['then'](saveUpdates(_0x54caec[_0xdafd('0x59')],null))[_0xdafd('0x21')](function(_0x4f631b){if(_0x4f631b){_0x30ecdd[_0xdafd('0x29')]=_0x4f631b[_0xdafd('0x64')]({'plain':!![]});return db[_0xdafd('0x65')]['find']({'where':{'id':_0x4f631b['WhatsappInteractionId']}});}return null;})[_0xdafd('0x21')](handleEntityNotFound(_0x2163f5,null))[_0xdafd('0x21')](function(_0x5ab636){if(_0x5ab636){return _0x5ab636[_0xdafd('0x38')]({'UserId':_0x54caec[_0xdafd('0x59')][_0xdafd('0x62')],'read1stAt':_['isNil'](_0x5ab636[_0xdafd('0x66')])?moment()['format'](_0xdafd('0x61')):undefined});}return null;})['then'](function(_0x16e826){if(_0x16e826){_0x30ecdd[_0xdafd('0x67')]=_0x16e826[_0xdafd('0x64')]({'plain':!![]});interaction_log[_0xdafd('0x22')](_0xdafd('0x68'),_0x54caec['user']['id'],_0x54caec[_0xdafd('0x63')][_0xdafd('0x3c')],_0x54caec['user']['role'],_0x30ecdd['interaction']['id'],_0x54caec[_0xdafd('0x59')]?JSON[_0xdafd('0x25')](_0x54caec[_0xdafd('0x59')]):_0xdafd('0x69'));return respondWithRpcPromise(_0xdafd('0x6a'),'acceptMessage',_0x30ecdd);}return null;})[_0xdafd('0x21')](function(_0x33cd2d){var _0x1fd9f2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x33cd2d[_0xdafd('0x29')]['ContactId'];return db['sequelize'][_0xdafd('0x44')](_0x1fd9f2,{'type':db[_0xdafd('0x6b')][_0xdafd('0x6c')][_0xdafd('0x6d')],'raw':!![]})[_0xdafd('0x21')](function(_0x4375e6){return _0x4375e6;});})[_0xdafd('0x21')](function(_0x49494b){if(_0x49494b){_0x30ecdd[_0xdafd('0x29')][_0xdafd('0x6e')]=_0x49494b[0x0];if(!_0x54caec[_0xdafd('0x59')][_0xdafd('0x62')])return;return db[_0xdafd('0x6f')][_0xdafd('0x5a')]({'where':{'id':_0x54caec['body'][_0xdafd('0x62')],'role':_0xdafd('0x70')},'attributes':['id',_0xdafd('0x3c'),'fullname',_0xdafd('0x71'),_0xdafd('0x72')],'raw':!![]});}return null;})[_0xdafd('0x21')](function(_0x3407ab){if(!_0x3407ab)return null;_0x30ecdd[_0xdafd('0x29')]['agent']=_0x3407ab;return _0x30ecdd;})[_0xdafd('0x21')](function(_0x5143c4){if(_0x5143c4){if(_0x54caec[_0xdafd('0x59')][_0xdafd('0x73')]){_0x30ecdd[_0xdafd('0x29')][_0xdafd('0x74')]=util[_0xdafd('0x60')]('SIP/%s',_0x54caec[_0xdafd('0x63')][_0xdafd('0x3c')]);_0x30ecdd['message'][_0xdafd('0x75')]=_0x30ecdd[_0xdafd('0x75')];_0x30ecdd['message'][_0xdafd('0x76')]=_0x30ecdd['channel'];_0x30ecdd['message'][_0xdafd('0x77')]=_0xdafd('0x5d');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xdafd('0x78'),'message':_0x30ecdd[_0xdafd('0x29')]},client9002)[_0xdafd('0x21')](function(){return _0x30ecdd;});}return _0x30ecdd;}return null;})[_0xdafd('0x21')](respondWithResult(_0x2163f5,null))['catch'](handleError(_0x2163f5,null));};var interaction_log=require(_0xdafd('0x14'))(_0xdafd('0x5c'));exports[_0xdafd('0x36')]=function(_0x4b7bc6,_0x3eacdb,_0x1c8822){var _0xa117c7={'agent':{},'channel':_0xdafd('0x5e')};if(_0x4b7bc6[_0xdafd('0x59')]['id']){delete _0x4b7bc6[_0xdafd('0x59')]['id'];}_0x4b7bc6[_0xdafd('0x59')][_0xdafd('0x62')]=_0x4b7bc6[_0xdafd('0x59')][_0xdafd('0x62')]||_0x4b7bc6[_0xdafd('0x63')]['id'];_0xa117c7[_0xdafd('0x70')]['id']=_0x4b7bc6[_0xdafd('0x59')][_0xdafd('0x62')];return db[_0xdafd('0x3f')][_0xdafd('0x5a')]({'where':{'id':_0x4b7bc6[_0xdafd('0x56')]['id'],'UserId':null}})[_0xdafd('0x21')](handleEntityNotFound(_0x3eacdb,null))[_0xdafd('0x21')](function(_0x227f25){if(_0x227f25){_0xa117c7[_0xdafd('0x29')]=_0x227f25['get']({'plain':!![]});return db[_0xdafd('0x65')]['find']({'where':{'id':_0x227f25[_0xdafd('0x79')]}});}return null;})['then'](handleEntityNotFound(_0x3eacdb,null))[_0xdafd('0x21')](function(_0x56ad97){if(_0x56ad97){_0xa117c7['interaction']=_0x56ad97[_0xdafd('0x64')]({'plain':!![]});interaction_log[_0xdafd('0x22')](_0xdafd('0x7a'),_0x4b7bc6[_0xdafd('0x63')]['id'],_0x4b7bc6['user']['name'],_0x4b7bc6[_0xdafd('0x63')]['role'],_0xa117c7['interaction']['id'],_0x4b7bc6['body']?JSON[_0xdafd('0x25')](_0x4b7bc6[_0xdafd('0x59')]):_0xdafd('0x69'));return respondWithRpcPromise('RejectMessage',_0xdafd('0x7b'),_0xa117c7);}return null;})[_0xdafd('0x21')](function(_0x504da2){var _0x51efc4=_0xdafd('0x7c')+_0x504da2[_0xdafd('0x29')]['ContactId'];return db['sequelize']['query'](_0x51efc4,{'type':db[_0xdafd('0x6b')][_0xdafd('0x6c')]['SELECT'],'raw':!![]})[_0xdafd('0x21')](function(_0x55248c){return _0x55248c;});})[_0xdafd('0x21')](function(_0x56de8c){if(_0x56de8c){_0xa117c7[_0xdafd('0x29')][_0xdafd('0x6e')]=_0x56de8c[0x0];if(!_0x4b7bc6[_0xdafd('0x59')][_0xdafd('0x62')])return;return db[_0xdafd('0x6f')][_0xdafd('0x5a')]({'where':{'id':_0x4b7bc6['body'][_0xdafd('0x62')],'role':'agent'},'attributes':['id',_0xdafd('0x3c'),_0xdafd('0x7d'),_0xdafd('0x71'),_0xdafd('0x72')],'raw':!![]});}return null;})[_0xdafd('0x21')](function(_0x2a0354){if(!_0x2a0354)return null;_0xa117c7[_0xdafd('0x29')][_0xdafd('0x70')]=_0x2a0354;return _0xa117c7;})['then'](function(_0x4ac1bf){if(_0x4ac1bf){_0x4ac1bf[_0xdafd('0x29')][_0xdafd('0x74')]=util[_0xdafd('0x60')](_0xdafd('0x7e'),_0x4b7bc6['user'][_0xdafd('0x3c')]);_0x4ac1bf[_0xdafd('0x29')][_0xdafd('0x75')]=_0xa117c7[_0xdafd('0x75')];_0x4ac1bf[_0xdafd('0x29')][_0xdafd('0x76')]=_0xa117c7['channel'];_0x4ac1bf[_0xdafd('0x29')]['event']=_0xdafd('0x36');respondWithRpcPromise(_0xdafd('0x7f'),_0xdafd('0x7f'),{'event':_0xdafd('0x80'),'message':_0x4ac1bf['message']},client9002);return _0xa117c7;}return null;})[_0xdafd('0x21')](respondWithResult(_0x3eacdb,null))[_0xdafd('0x2b')](handleError(_0x3eacdb,null));};exports[_0xdafd('0x2d')]=function(_0x5d873a,_0x51739f,_0x36eeea){if(_0x5d873a['body']['id']){delete _0x5d873a[_0xdafd('0x59')]['id'];}var _0x548bf8;return db[_0xdafd('0x3f')][_0xdafd('0x5a')]({'where':{'id':_0x5d873a[_0xdafd('0x56')]['id']}})['then'](handleEntityNotFound(_0x51739f,null))[_0xdafd('0x21')](function(_0x186dd0){if(_0x186dd0){_0x548bf8=_0x186dd0;return db[_0xdafd('0x81')]['find']({'where':{'id':_0x186dd0[_0xdafd('0x82')]}});}})[_0xdafd('0x21')](handleEntityNotFound(_0x51739f,null))[_0xdafd('0x21')](function(_0x1532cf){if(_0x1532cf){logger[_0xdafd('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x1532cf[_0xdafd('0x42')],util[_0xdafd('0x83')](_0x5d873a[_0xdafd('0x59')],{'showHidden':![],'depth':null}));switch(_0x1532cf[_0xdafd('0x42')]){case _0xdafd('0x84'):if(_0x5d873a['body']['MessageSid']&&_0x5d873a['body']['MessageSid']===_0x548bf8[_0xdafd('0x85')]&&_0x5d873a[_0xdafd('0x59')][_0xdafd('0x86')]&&_0x5d873a[_0xdafd('0x59')][_0xdafd('0x86')]===_0xdafd('0x5f')){return _0x548bf8[_0xdafd('0x38')]({'read':!![]});}else{logger['error'](_0xdafd('0x87'),_0xdafd('0x2d'),_0xdafd('0x84'),util['inspect'](_0x5d873a[_0xdafd('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x548bf8;}})[_0xdafd('0x21')](respondWithResult(_0x51739f,null))[_0xdafd('0x2b')](handleError(_0x51739f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 32a8475..53ca17c 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 _0x8130=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x5f363b,_0x531fb1){var _0x561af3=function(_0x902d6d){while(--_0x902d6d){_0x5f363b['push'](_0x5f363b['shift']());}};_0x561af3(++_0x531fb1);}(_0x8130,0x146));var _0x0813=function(_0x58c831,_0x1c6723){_0x58c831=_0x58c831-0x0;var _0x1ed056=_0x8130[_0x58c831];return _0x1ed056;};'use strict';var EventEmitter=require(_0x0813('0x0'));var WhatsappMessage=require(_0x0813('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0813('0x2')](0x0);var events={'afterCreate':_0x0813('0x3'),'afterUpdate':_0x0813('0x4'),'afterDestroy':_0x0813('0x5')};function emitEvent(_0x1421d7){return function(_0x25d6c6,_0x4e66f4,_0x442a9b){WhatsappMessageEvents['emit'](_0x1421d7+':'+_0x25d6c6['id'],_0x25d6c6);WhatsappMessageEvents['emit'](_0x1421d7,_0x25d6c6);_0x442a9b(null);};}for(var e in events){if(events[_0x0813('0x6')](e)){var event=events[e];WhatsappMessage[_0x0813('0x7')](e,emitEvent(event));}}module[_0x0813('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xb7e7=['hook','exports','events','WhatsappMessage','save','remove','hasOwnProperty'];(function(_0x69a7aa,_0x37e649){var _0x3b8402=function(_0x147b58){while(--_0x147b58){_0x69a7aa['push'](_0x69a7aa['shift']());}};_0x3b8402(++_0x37e649);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'use strict';var EventEmitter=require(_0x7b7e('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x7b7e('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7b7e('0x2'),'afterUpdate':'update','afterDestroy':_0x7b7e('0x3')};function emitEvent(_0x556d68){return function(_0x31d0ed,_0x118577,_0x1d9384){WhatsappMessageEvents['emit'](_0x556d68+':'+_0x31d0ed['id'],_0x31d0ed);WhatsappMessageEvents['emit'](_0x556d68,_0x31d0ed);_0x1d9384(null);};}for(var e in events){if(events[_0x7b7e('0x4')](e)){var event=events[e];WhatsappMessage[_0x7b7e('0x5')](e,emitEvent(event));}}module[_0x7b7e('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 1643886..1eddf42 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 _0x4024=['rimraf','../../config/environment','./whatsappMessage.attributes','exports','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','messages','body','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','authToken','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','node-fetch','path'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0x4024,0xdd));var _0x4402=function(_0xebfc87,_0x45b53b){_0xebfc87=_0xebfc87-0x0;var _0x57ce21=_0x4024[_0xebfc87];return _0x57ce21;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var logger=require(_0x4402('0x2'))('api');var moment=require(_0x4402('0x3'));var BPromise=require('bluebird');var rp=require(_0x4402('0x4'));var fetch=require(_0x4402('0x5'));var fs=require('fs');var path=require(_0x4402('0x6'));var rimraf=require(_0x4402('0x7'));var config=require(_0x4402('0x8'));var attributes=require(_0x4402('0x9'));module[_0x4402('0xa')]=function(_0xafe10f,_0x45fb6a){return _0xafe10f['define']('WhatsappMessage',attributes,{'tableName':_0x4402('0xb'),'paranoid':![],'indexes':[{'name':_0x4402('0xc'),'fields':[_0x4402('0xc')]},{'name':_0x4402('0xd'),'fields':['body'],'type':_0x4402('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfddd77,_0x486bdb,_0x5d6ac7){var _0x14820f=_0xafe10f[_0x4402('0xf')];var _0x39848d=_0xfddd77['get']({'plain':!![]});if(_0x39848d[_0x4402('0x10')][_0x4402('0x11')]()==='in'||_0x39848d['direction'][_0x4402('0x11')]()==='out'&&!_0x39848d['secret']&&!_['isNil'](_0x39848d[_0x4402('0x12')])){_0x14820f[_0x4402('0x13')]['findOne']({'where':{'id':_0x39848d[_0x4402('0x14')]}})[_0x4402('0x15')](function(_0x11bba7){if(_0x11bba7){_0x11bba7[_0x4402('0x16')]({'lastMsgAt':_0x39848d[_0x4402('0x17')],'lastMsgDirection':_0x39848d[_0x4402('0x10')][_0x4402('0x11')]()});}})['catch'](function(_0x48b394){console[_0x4402('0x18')](_0x48b394);});}if(_0x39848d[_0x4402('0x10')]==='out'&&!_0x39848d[_0x4402('0x19')]){var _0x3704c3;_0x14820f[_0x4402('0x1a')][_0x4402('0x1b')]({'where':{'id':_0x39848d[_0x4402('0x1c')]},'raw':!![]})[_0x4402('0x15')](function(_0x32fa0a){_0x3704c3=_0x32fa0a;if(_0x3704c3&&_0x3704c3[_0x4402('0x1d')]){switch(_0x3704c3[_0x4402('0x1d')]){case'twilio':var _0x468ae7=require(_0x4402('0x1e'));if(_0x3704c3[_0x4402('0x1f')]&&_0x3704c3['authToken']&&_0x3704c3['phone']){var _0x1e31fd=new _0x468ae7(_0x3704c3[_0x4402('0x1f')],_0x3704c3['authToken']);_0x1e31fd[_0x4402('0x20')]['create']({'body':_0x39848d[_0x4402('0x21')],'to':_0x4402('0x22')+_0x39848d[_0x4402('0x23')],'from':_0x4402('0x22')+_0x3704c3[_0x4402('0x23')],'statusCallback':_0x3704c3['remote']+_0x4402('0x24')+_0x39848d['id']+_0x4402('0x25')+_0x3704c3[_0x4402('0x26')]})[_0x4402('0x15')](function(_0x276d9f){if(_0x276d9f['sid']){return _0xfddd77[_0x4402('0x16')]({'messageId':_0x276d9f[_0x4402('0x27')]});}})[_0x4402('0x28')](function(_0x387d31){logger['error'](_0x4402('0x29'),_0x4402('0x2a'),'twilio',util['inspect'](_0x387d31,{'showHidden':![],'depth':null}));});}else{logger[_0x4402('0x18')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4402('0x2a'),_0x4402('0x1e'),_0x4402('0x2b'));}break;case'sinch':var _0x124e44=_0x3704c3[_0x4402('0x1f')];var _0x19ad68=_0x3704c3[_0x4402('0x2c')];var _0x5b7519=_0x3704c3[_0x4402('0x2d')]+_0x4402('0x2e')+_0x124e44+_0x4402('0x2f');var _0x4c319f={'to':[_0x39848d[_0x4402('0x23')]],'message':{'type':_0x4402('0x30'),'text':_0x39848d[_0x4402('0x21')]}};var _0x28d42c={'method':_0x4402('0x31'),'uri':_0x5b7519,'headers':{'Authorization':_0x4402('0x32')+_0x19ad68,'Content-Type':'application/json'},'body':_0x4c319f,'json':!![]};rp(_0x28d42c)[_0x4402('0x15')](function(_0xd19bce){if(_0xd19bce[_0x4402('0x33')][0x0][_0x4402('0x34')]){return _0xfddd77[_0x4402('0x16')]({'messageId':_0xd19bce[_0x4402('0x33')][0x0][_0x4402('0x34')]});}})['catch'](function(_0x298e2a){logger['err'](_0x4402('0x35'),_0x298e2a);});break;}}})[_0x4402('0x36')](function(){_0x5d6ac7();});}else{_0x5d6ac7();}}},'charset':_0x4402('0x37'),'collate':_0x4402('0x38')});}; \ No newline at end of file +var _0x98e1=['phone','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','finally','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','out','findOne','WhatsappInteractionId','then','update','createdAt','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create'];(function(_0x3c4f40,_0x302e0b){var _0x12032f=function(_0x159d92){while(--_0x159d92){_0x3c4f40['push'](_0x3c4f40['shift']());}};_0x12032f(++_0x302e0b);}(_0x98e1,0x160));var _0x198e=function(_0xaa8e39,_0x34ef8e){_0xaa8e39=_0xaa8e39-0x0;var _0x27759e=_0x98e1[_0xaa8e39];return _0x27759e;};'use strict';var _=require('lodash');var util=require(_0x198e('0x0'));var logger=require(_0x198e('0x1'))(_0x198e('0x2'));var moment=require(_0x198e('0x3'));var BPromise=require('bluebird');var rp=require(_0x198e('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require(_0x198e('0x5'));var config=require(_0x198e('0x6'));var attributes=require(_0x198e('0x7'));module[_0x198e('0x8')]=function(_0x551d31,_0x545114){return _0x551d31[_0x198e('0x9')]('WhatsappMessage',attributes,{'tableName':_0x198e('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x198e('0xb')]},{'name':_0x198e('0xc'),'fields':[_0x198e('0xd')],'type':_0x198e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ec4c9,_0x412f75,_0x272f6b){var _0x162604=_0x551d31[_0x198e('0xf')];var _0x5be755=_0x1ec4c9[_0x198e('0x10')]({'plain':!![]});if(_0x5be755[_0x198e('0x11')]['toLowerCase']()==='in'||_0x5be755[_0x198e('0x11')]['toLowerCase']()===_0x198e('0x12')&&!_0x5be755['secret']&&!_['isNil'](_0x5be755['UserId'])){_0x162604['WhatsappInteraction'][_0x198e('0x13')]({'where':{'id':_0x5be755[_0x198e('0x14')]}})[_0x198e('0x15')](function(_0x4bd409){if(_0x4bd409){_0x4bd409[_0x198e('0x16')]({'lastMsgAt':_0x5be755[_0x198e('0x17')],'lastMsgDirection':_0x5be755[_0x198e('0x11')]['toLowerCase']()});}})['catch'](function(_0x5bb7dc){console['error'](_0x5bb7dc);});}if(_0x5be755['direction']===_0x198e('0x12')&&!_0x5be755['secret']){var _0x514315;_0x162604[_0x198e('0x18')][_0x198e('0x19')]({'where':{'id':_0x5be755[_0x198e('0x1a')]},'raw':!![]})['then'](function(_0x7742f1){_0x514315=_0x7742f1;if(_0x514315&&_0x514315[_0x198e('0x1b')]){switch(_0x514315[_0x198e('0x1b')]){case _0x198e('0x1c'):var _0x39ab23=require('twilio');if(_0x514315[_0x198e('0x1d')]&&_0x514315[_0x198e('0x1e')]&&_0x514315['phone']){var _0x10d94d=new _0x39ab23(_0x514315[_0x198e('0x1d')],_0x514315[_0x198e('0x1e')]);_0x10d94d[_0x198e('0x1f')][_0x198e('0x20')]({'body':_0x5be755[_0x198e('0xd')],'to':'whatsapp:'+_0x5be755[_0x198e('0x21')],'from':_0x198e('0x22')+_0x514315[_0x198e('0x21')],'statusCallback':_0x514315[_0x198e('0x23')]+_0x198e('0x24')+_0x5be755['id']+_0x198e('0x25')+_0x514315[_0x198e('0x26')]})['then'](function(_0x309326){if(_0x309326[_0x198e('0x27')]){return _0x1ec4c9[_0x198e('0x16')]({'messageId':_0x309326[_0x198e('0x27')]});}})[_0x198e('0x28')](function(_0x2c27c0){logger[_0x198e('0x29')](_0x198e('0x2a'),_0x198e('0x2b'),'twilio',util['inspect'](_0x2c27c0,{'showHidden':![],'depth':null}));});}else{logger[_0x198e('0x29')](_0x198e('0x2a'),'afterCreate','twilio',_0x198e('0x2c'));}break;case _0x198e('0x2d'):var _0x337c73=_0x514315['accountSid'];var _0x5e657e=_0x514315[_0x198e('0x1e')];var _0x17a5b5=_0x514315[_0x198e('0x2e')]+_0x198e('0x2f')+_0x337c73+_0x198e('0x30');var _0x25e452={'to':[_0x5be755[_0x198e('0x21')]],'message':{'type':_0x198e('0x31'),'text':_0x5be755['body']}};var _0x3eca9c={'method':_0x198e('0x32'),'uri':_0x17a5b5,'headers':{'Authorization':_0x198e('0x33')+_0x5e657e,'Content-Type':'application/json'},'body':_0x25e452,'json':!![]};rp(_0x3eca9c)['then'](function(_0x38db97){if(_0x38db97[_0x198e('0x34')][0x0]['message_id']){return _0x1ec4c9[_0x198e('0x16')]({'messageId':_0x38db97[_0x198e('0x34')][0x0][_0x198e('0x35')]});}})[_0x198e('0x28')](function(_0x2e847c){logger['err']('WhatsappMessage,\x20%s',_0x2e847c);});break;}}})[_0x198e('0x36')](function(){_0x272f6b();});}else{_0x272f6b();}}},'charset':'utf8mb4','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 48d102f..ac43ba2 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 _0x88bd=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','body','options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xfff9cf,_0x55ad70){var _0x231718=function(_0x410e35){while(--_0x410e35){_0xfff9cf['push'](_0xfff9cf['shift']());}};_0x231718(++_0x55ad70);}(_0x88bd,0x108));var _0xd88b=function(_0x35c1eb,_0x5458f9){_0x35c1eb=_0x35c1eb-0x0;var _0x3b1278=_0x88bd[_0x35c1eb];return _0x3b1278;};'use strict';var _=require(_0xd88b('0x0'));var util=require('util');var moment=require(_0xd88b('0x1'));var BPromise=require(_0xd88b('0x2'));var rs=require(_0xd88b('0x3'));var fs=require('fs');var Redis=require(_0xd88b('0x4'));var db=require(_0xd88b('0x5'))['db'];var utils=require(_0xd88b('0x6'));var logger=require('../../config/logger')(_0xd88b('0x7'));var config=require(_0xd88b('0x8'));var jayson=require(_0xd88b('0x9'));var client=jayson[_0xd88b('0xa')][_0xd88b('0xb')]({'port':0x232a});config['redis']=_[_0xd88b('0xc')](config[_0xd88b('0xd')],{'host':_0xd88b('0xe'),'port':0x18eb});var socket=require(_0xd88b('0xf'))(new Redis(config[_0xd88b('0xd')]));require(_0xd88b('0x10'))[_0xd88b('0x11')](socket);function respondWithRpcPromise(_0x5c9045,_0x27d031,_0x28bc2d){return new BPromise(function(_0x4c3c36,_0x433aa3){return client[_0xd88b('0x12')](_0x5c9045,_0x28bc2d)['then'](function(_0x433853){logger[_0xd88b('0x13')](_0xd88b('0x14'),_0x27d031,_0xd88b('0x15'));logger[_0xd88b('0x16')](_0xd88b('0x17'),_0x27d031,'request\x20sent',JSON[_0xd88b('0x18')](_0x433853));if(_0x433853[_0xd88b('0x19')]){if(_0x433853[_0xd88b('0x19')]['code']===0x1f4){logger[_0xd88b('0x19')](_0xd88b('0x14'),_0x27d031,_0x433853['error'][_0xd88b('0x1a')]);return _0x433aa3(_0x433853[_0xd88b('0x19')][_0xd88b('0x1a')]);}logger[_0xd88b('0x19')](_0xd88b('0x14'),_0x27d031,_0x433853[_0xd88b('0x19')][_0xd88b('0x1a')]);return _0x4c3c36(_0x433853[_0xd88b('0x19')][_0xd88b('0x1a')]);}else{logger[_0xd88b('0x13')](_0xd88b('0x14'),_0x27d031,_0xd88b('0x15'));_0x4c3c36(_0x433853[_0xd88b('0x1b')][_0xd88b('0x1a')]);}})[_0xd88b('0x1c')](function(_0x50f5a1){logger[_0xd88b('0x19')](_0xd88b('0x14'),_0x27d031,_0x50f5a1);_0x433aa3(_0x50f5a1);});});}exports[_0xd88b('0x1d')]=function(_0x370814){var _0x20fef4=this;return new Promise(function(_0x10d7ce,_0x451860){return db['WhatsappMessage']['create'](_0x370814[_0xd88b('0x1e')],{'raw':_0x370814[_0xd88b('0x1f')]?_0x370814[_0xd88b('0x1f')][_0xd88b('0x20')]===undefined?!![]:![]:!![]})[_0xd88b('0x21')](function(_0x5c45fc){logger[_0xd88b('0x13')](_0xd88b('0x1d'),_0x370814);logger[_0xd88b('0x16')]('CreateWhatsappMessage',_0x370814,JSON[_0xd88b('0x18')](_0x5c45fc));_0x10d7ce(_0x5c45fc);})['catch'](function(_0x380f17){logger[_0xd88b('0x19')]('CreateWhatsappMessage',_0x380f17[_0xd88b('0x1a')],_0x370814);_0x451860(_0x20fef4[_0xd88b('0x19')](0x1f4,_0x380f17[_0xd88b('0x1a')]));});});}; \ No newline at end of file +var _0xb353=['raw','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options'];(function(_0x1ebf76,_0x32ab5c){var _0x85ebfc=function(_0x42d6b5){while(--_0x42d6b5){_0x1ebf76['push'](_0x1ebf76['shift']());}};_0x85ebfc(++_0x32ab5c);}(_0xb353,0x187));var _0x3b35=function(_0x780d7a,_0x46e7cf){_0x780d7a=_0x780d7a-0x0;var _0x8a7261=_0xb353[_0x780d7a];return _0x8a7261;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3b35('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b35('0x1'));var db=require(_0x3b35('0x2'))['db'];var utils=require(_0x3b35('0x3'));var logger=require(_0x3b35('0x4'))(_0x3b35('0x5'));var config=require(_0x3b35('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3b35('0x7')][_0x3b35('0x8')]({'port':0x232a});config[_0x3b35('0x9')]=_[_0x3b35('0xa')](config[_0x3b35('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b35('0x9')]));require('./whatsappMessage.socket')[_0x3b35('0xb')](socket);function respondWithRpcPromise(_0x4509c7,_0x1a0d74,_0x2d663a){return new BPromise(function(_0x56e2de,_0x474118){return client[_0x3b35('0xc')](_0x4509c7,_0x2d663a)[_0x3b35('0xd')](function(_0x430d32){logger[_0x3b35('0xe')](_0x3b35('0xf'),_0x1a0d74,_0x3b35('0x10'));logger[_0x3b35('0x11')](_0x3b35('0x12'),_0x1a0d74,'request\x20sent',JSON[_0x3b35('0x13')](_0x430d32));if(_0x430d32['error']){if(_0x430d32[_0x3b35('0x14')][_0x3b35('0x15')]===0x1f4){logger['error'](_0x3b35('0xf'),_0x1a0d74,_0x430d32[_0x3b35('0x14')][_0x3b35('0x16')]);return _0x474118(_0x430d32[_0x3b35('0x14')][_0x3b35('0x16')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1a0d74,_0x430d32[_0x3b35('0x14')][_0x3b35('0x16')]);return _0x56e2de(_0x430d32[_0x3b35('0x14')][_0x3b35('0x16')]);}else{logger['info'](_0x3b35('0xf'),_0x1a0d74,_0x3b35('0x10'));_0x56e2de(_0x430d32[_0x3b35('0x17')]['message']);}})[_0x3b35('0x18')](function(_0x58d0a3){logger[_0x3b35('0x14')](_0x3b35('0xf'),_0x1a0d74,_0x58d0a3);_0x474118(_0x58d0a3);});});}exports[_0x3b35('0x19')]=function(_0x4f5be6){var _0x63a134=this;return new Promise(function(_0x3e5dbb,_0xc884d9){return db[_0x3b35('0x1a')][_0x3b35('0x1b')](_0x4f5be6['body'],{'raw':_0x4f5be6[_0x3b35('0x1c')]?_0x4f5be6['options'][_0x3b35('0x1d')]===undefined?!![]:![]:!![]})[_0x3b35('0xd')](function(_0x5ddc2c){logger[_0x3b35('0xe')](_0x3b35('0x19'),_0x4f5be6);logger[_0x3b35('0x11')]('CreateWhatsappMessage',_0x4f5be6,JSON[_0x3b35('0x13')](_0x5ddc2c));_0x3e5dbb(_0x5ddc2c);})['catch'](function(_0x325579){logger[_0x3b35('0x14')](_0x3b35('0x19'),_0x325579['message'],_0x4f5be6);_0xc884d9(_0x63a134[_0x3b35('0x14')](0x1f4,_0x325579['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index bab076a..5d32c60 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 _0xa525=['length','whatsappMessage:','save','update','register'];(function(_0x4732b7,_0x4e73cd){var _0x385e09=function(_0x5d69ee){while(--_0x5d69ee){_0x4732b7['push'](_0x4732b7['shift']());}};_0x385e09(++_0x4e73cd);}(_0xa525,0xa2));var _0x5a52=function(_0x3fb065,_0x504547){_0x3fb065=_0x3fb065-0x0;var _0x486678=_0xa525[_0x3fb065];return _0x486678;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x5a52('0x0'),'remove',_0x5a52('0x1')];function createListener(_0x59dd15,_0x564de1){return function(_0x3b7973){_0x564de1['emit'](_0x59dd15,_0x3b7973);};}function removeListener(_0x4e0930,_0x17fc11){return function(){WhatsappMessageEvents['removeListener'](_0x4e0930,_0x17fc11);};}exports[_0x5a52('0x2')]=function(_0x1752ef){for(var _0x4a3639=0x0,_0x57fcb2=events[_0x5a52('0x3')];_0x4a3639<_0x57fcb2;_0x4a3639++){var _0x1fdcd4=events[_0x4a3639];var _0x35a6dd=createListener(_0x5a52('0x4')+_0x1fdcd4,_0x1752ef);WhatsappMessageEvents['on'](_0x1fdcd4,_0x35a6dd);}}; \ No newline at end of file +var _0xdc23=['length','whatsappMessage:','save','update','emit','removeListener','register'];(function(_0x6c2b1f,_0x4ece0f){var _0xa0fde9=function(_0x4a380b){while(--_0x4a380b){_0x6c2b1f['push'](_0x6c2b1f['shift']());}};_0xa0fde9(++_0x4ece0f);}(_0xdc23,0x1bb));var _0x3dc2=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xdc23[_0x57486e];return _0x5f110b;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x3dc2('0x0'),'remove',_0x3dc2('0x1')];function createListener(_0x32db78,_0x3d8f07){return function(_0x212cf2){_0x3d8f07[_0x3dc2('0x2')](_0x32db78,_0x212cf2);};}function removeListener(_0x5e5929,_0x1b33d2){return function(){WhatsappMessageEvents[_0x3dc2('0x3')](_0x5e5929,_0x1b33d2);};}exports[_0x3dc2('0x4')]=function(_0x3232bf){for(var _0x46a1f0=0x0,_0x36bdee=events[_0x3dc2('0x5')];_0x46a1f0<_0x36bdee;_0x46a1f0++){var _0x1e5e8e=events[_0x46a1f0];var _0x4743b5=createListener(_0x3dc2('0x6')+_0x1e5e8e,_0x3232bf);WhatsappMessageEvents['on'](_0x1e5e8e,_0x4743b5);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 5a6ca40..f97c5f6 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 _0x2ae4=['../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','post','/:id/users','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x797d8,_0x283de6){var _0x2a5372=function(_0x4da1e7){while(--_0x4da1e7){_0x797d8['push'](_0x797d8['shift']());}};_0x2a5372(++_0x283de6);}(_0x2ae4,0x1c5));var _0x42ae=function(_0x1745ae,_0x5e3d50){_0x1745ae=_0x1745ae-0x0;var _0x23966f=_0x2ae4[_0x1745ae];return _0x23966f;};'use strict';var multer=require(_0x42ae('0x0'));var util=require(_0x42ae('0x1'));var path=require(_0x42ae('0x2'));var timeout=require(_0x42ae('0x3'));var express=require('express');var router=express[_0x42ae('0x4')]();var fs_extra=require(_0x42ae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x42ae('0x6'));var config=require(_0x42ae('0x7'));var controller=require(_0x42ae('0x8'));router[_0x42ae('0x9')]('/',auth[_0x42ae('0xa')](),controller[_0x42ae('0xb')]);router[_0x42ae('0x9')](_0x42ae('0xc'),auth[_0x42ae('0xa')](),controller[_0x42ae('0xd')]);router['get'](_0x42ae('0xe'),auth[_0x42ae('0xa')](),controller['show']);router[_0x42ae('0x9')](_0x42ae('0xf'),auth[_0x42ae('0xa')](),controller[_0x42ae('0x10')]);router['get'](_0x42ae('0x11'),auth[_0x42ae('0xa')](),controller['getTeams']);router[_0x42ae('0x9')]('/:id/users',auth[_0x42ae('0xa')](),controller['getAgents']);router[_0x42ae('0x12')]('/',auth[_0x42ae('0xa')](),controller['create']);router['post'](_0x42ae('0x11'),auth[_0x42ae('0xa')](),controller['addTeams']);router[_0x42ae('0x12')](_0x42ae('0x13'),auth[_0x42ae('0xa')](),controller['addAgents']);router[_0x42ae('0x14')](_0x42ae('0xe'),auth['isAuthenticated'](),controller[_0x42ae('0x15')]);router['delete'](_0x42ae('0xe'),auth[_0x42ae('0xa')](),controller[_0x42ae('0x16')]);router[_0x42ae('0x17')](_0x42ae('0x11'),auth[_0x42ae('0xa')](),controller[_0x42ae('0x18')]);router[_0x42ae('0x17')](_0x42ae('0x13'),auth[_0x42ae('0xa')](),controller[_0x42ae('0x19')]);module[_0x42ae('0x1a')]=router; \ No newline at end of file +var _0x782e=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports'];(function(_0xb601e8,_0x2650a4){var _0x454615=function(_0x5763ed){while(--_0x5763ed){_0xb601e8['push'](_0xb601e8['shift']());}};_0x454615(++_0x2650a4);}(_0x782e,0xe8));var _0xe782=function(_0x9f4333,_0xdf7aa){_0x9f4333=_0x9f4333-0x0;var _0x3360fe=_0x782e[_0x9f4333];return _0x3360fe;};'use strict';var multer=require(_0xe782('0x0'));var util=require('util');var path=require(_0xe782('0x1'));var timeout=require(_0xe782('0x2'));var express=require(_0xe782('0x3'));var router=express[_0xe782('0x4')]();var fs_extra=require(_0xe782('0x5'));var auth=require(_0xe782('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe782('0x7'));var controller=require('./whatsappQueue.controller');router[_0xe782('0x8')]('/',auth['isAuthenticated'](),controller[_0xe782('0x9')]);router[_0xe782('0x8')]('/describe',auth[_0xe782('0xa')](),controller[_0xe782('0xb')]);router['get'](_0xe782('0xc'),auth[_0xe782('0xa')](),controller['show']);router[_0xe782('0x8')](_0xe782('0xd'),auth[_0xe782('0xa')](),controller[_0xe782('0xe')]);router['get'](_0xe782('0xf'),auth['isAuthenticated'](),controller[_0xe782('0x10')]);router[_0xe782('0x8')](_0xe782('0x11'),auth[_0xe782('0xa')](),controller[_0xe782('0x12')]);router['post']('/',auth[_0xe782('0xa')](),controller[_0xe782('0x13')]);router[_0xe782('0x14')]('/:id/teams',auth[_0xe782('0xa')](),controller[_0xe782('0x15')]);router[_0xe782('0x14')](_0xe782('0x11'),auth[_0xe782('0xa')](),controller[_0xe782('0x16')]);router[_0xe782('0x17')](_0xe782('0xc'),auth['isAuthenticated'](),controller[_0xe782('0x18')]);router[_0xe782('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xe782('0x19')](_0xe782('0xf'),auth[_0xe782('0xa')](),controller[_0xe782('0x1a')]);router[_0xe782('0x19')](_0xe782('0x11'),auth[_0xe782('0xa')](),controller[_0xe782('0x1b')]);module[_0xe782('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 8b300f2..dfbc062 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 _0xc3b0=['STRING','name','rrmemory','beepall','sequelize','exports'];(function(_0x1c8746,_0x345321){var _0x42d944=function(_0x57cc3b){while(--_0x57cc3b){_0x1c8746['push'](_0x1c8746['shift']());}};_0x42d944(++_0x345321);}(_0xc3b0,0x166));var _0x0c3b=function(_0x47e504,_0xcebaea){_0x47e504=_0x47e504-0x0;var _0x43a953=_0xc3b0[_0x47e504];return _0x43a953;};'use strict';var Sequelize=require(_0x0c3b('0x0'));module[_0x0c3b('0x1')]={'name':{'type':Sequelize[_0x0c3b('0x2')],'unique':_0x0c3b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0c3b('0x4'),_0x0c3b('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x0c3b('0x2')]}}; \ No newline at end of file +var _0xea70=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory'];(function(_0x24a917,_0x5e0498){var _0x46d82b=function(_0x316cb2){while(--_0x316cb2){_0x24a917['push'](_0x24a917['shift']());}};_0x46d82b(++_0x5e0498);}(_0xea70,0x175));var _0x0ea7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xea70[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0ea7('0x0'));module[_0x0ea7('0x1')]={'name':{'type':Sequelize[_0x0ea7('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0ea7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0ea7('0x4'),'beepall',_0x0ea7('0x5'))},'description':{'type':Sequelize[_0x0ea7('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index c66157b..83f47b8 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 _0x303f=['register','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','WhatsappQueues','sendStatus','error','stack','name','send','index','map','WhatsappQueue','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','include','findAll','catch','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','rawAttributes','nolimit','pick','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','forEach','emit','userWhatsappQueue:save','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','transaction','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket'];(function(_0x5d0cd2,_0x1e0854){var _0x3ed61f=function(_0x51ace9){while(--_0x51ace9){_0x5d0cd2['push'](_0x5d0cd2['shift']());}};_0x3ed61f(++_0x1e0854);}(_0x303f,0x74));var _0xf303=function(_0x49dea7,_0x32f7b8){_0x49dea7=_0x49dea7-0x0;var _0x511b11=_0x303f[_0x49dea7];return _0x511b11;};'use strict';var emlformat=require(_0xf303('0x0'));var rimraf=require(_0xf303('0x1'));var zipdir=require(_0xf303('0x2'));var jsonpatch=require(_0xf303('0x3'));var rp=require(_0xf303('0x4'));var moment=require(_0xf303('0x5'));var BPromise=require(_0xf303('0x6'));var Mustache=require(_0xf303('0x7'));var util=require(_0xf303('0x8'));var path=require(_0xf303('0x9'));var sox=require('sox');var csv=require(_0xf303('0xa'));var ejs=require(_0xf303('0xb'));var fs=require('fs');var fs_extra=require(_0xf303('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf303('0xd'));var deskjs=require(_0xf303('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf303('0xf'));var Papa=require('papaparse');var Redis=require(_0xf303('0x10'));var authService=require(_0xf303('0x11'));var qs=require(_0xf303('0x12'));var as=require(_0xf303('0x13'));var hardwareService=require(_0xf303('0x14'));var logger=require(_0xf303('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf303('0x16'));var licenseUtil=require(_0xf303('0x17'));var db=require(_0xf303('0x18'))['db'];config[_0xf303('0x19')]=_[_0xf303('0x1a')](config[_0xf303('0x19')],{'host':_0xf303('0x1b'),'port':0x18eb});var socket=require(_0xf303('0x1c'))(new Redis(config[_0xf303('0x19')]));require(_0xf303('0x1d'))[_0xf303('0x1e')](socket);function respondWithStatusCode(_0x277cb9,_0x53ec51){_0x53ec51=_0x53ec51||0xcc;return function(_0x196fa6){if(_0x196fa6){return _0x277cb9['sendStatus'](_0x53ec51);}return _0x277cb9[_0xf303('0x1f')](_0x53ec51)[_0xf303('0x20')]();};}function respondWithResult(_0x217fa0,_0x1661c6){_0x1661c6=_0x1661c6||0xc8;return function(_0x48ba94){if(_0x48ba94){return _0x217fa0[_0xf303('0x1f')](_0x1661c6)[_0xf303('0x21')](_0x48ba94);}};}function respondWithFilteredResult(_0x27fe14,_0x3bd5e9){return function(_0x34275a){if(_0x34275a){var _0x31ecc8=typeof _0x3bd5e9[_0xf303('0x22')]==='undefined'&&typeof _0x3bd5e9[_0xf303('0x23')]==='undefined';var _0xd24853=_0x34275a[_0xf303('0x24')];var _0x31780d=_0x31ecc8?0x0:_0x3bd5e9['offset'];var _0x267b3f=_0x31ecc8?_0x34275a['count']:_0x3bd5e9[_0xf303('0x22')]+_0x3bd5e9[_0xf303('0x23')];var _0x1b60e1;if(_0x267b3f>=_0xd24853){_0x267b3f=_0xd24853;_0x1b60e1=0xc8;}else{_0x1b60e1=0xce;}_0x27fe14[_0xf303('0x1f')](_0x1b60e1);return _0x27fe14[_0xf303('0x25')](_0xf303('0x26'),_0x31780d+'-'+_0x267b3f+'/'+_0xd24853)[_0xf303('0x21')](_0x34275a);}return null;};}function patchUpdates(_0x473e1b){return function(_0x1d6683){try{jsonpatch[_0xf303('0x27')](_0x1d6683,_0x473e1b,!![]);}catch(_0xe624f6){return BPromise[_0xf303('0x28')](_0xe624f6);}return _0x1d6683[_0xf303('0x29')]();};}function saveUpdates(_0x204d56,_0x3c09fc){return function(_0x2ea206){if(_0x2ea206){return _0x2ea206[_0xf303('0x2a')](_0x204d56)[_0xf303('0x2b')](function(_0x5ca16e){return _0x5ca16e;});}return null;};}function removeEntity(_0x5855d7,_0x67bbe6){return function(_0x549f85){if(_0x549f85){return _0x549f85[_0xf303('0x2c')]()[_0xf303('0x2b')](function(){var _0x1e17cc=_0x549f85['get']({'plain':!![]});var _0x2f6f2f=_0xf303('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x2f6f2f,'resourceId':_0x1e17cc['id']}})['then'](function(){return _0x549f85;});})[_0xf303('0x2b')](function(){_0x5855d7[_0xf303('0x1f')](0xcc)[_0xf303('0x20')]();});}};}function handleEntityNotFound(_0x2b0022,_0x195135){return function(_0x41d805){if(!_0x41d805){_0x2b0022[_0xf303('0x2e')](0x194);}return _0x41d805;};}function handleError(_0x1593f,_0xe52bfd){_0xe52bfd=_0xe52bfd||0x1f4;return function(_0x28bcce){logger[_0xf303('0x2f')](_0x28bcce[_0xf303('0x30')]);if(_0x28bcce[_0xf303('0x31')]){delete _0x28bcce[_0xf303('0x31')];}_0x1593f['status'](_0xe52bfd)[_0xf303('0x32')](_0x28bcce);};}exports[_0xf303('0x33')]=function(_0x3ba0b9,_0x3dcf7b){var _0x22d7df={},_0x3b6fbb={},_0x2222ec={'count':0x0,'rows':[]};var _0x5c1112=_[_0xf303('0x34')](db[_0xf303('0x35')]['rawAttributes'],function(_0x3f08f8){return{'name':_0x3f08f8['fieldName'],'type':_0x3f08f8[_0xf303('0x36')][_0xf303('0x37')]};});_0x3b6fbb[_0xf303('0x38')]=_['map'](_0x5c1112,_0xf303('0x31'));_0x3b6fbb[_0xf303('0x39')]=_['keys'](_0x3ba0b9['query']);_0x3b6fbb[_0xf303('0x3a')]=_[_0xf303('0x3b')](_0x3b6fbb[_0xf303('0x38')],_0x3b6fbb[_0xf303('0x39')]);_0x22d7df[_0xf303('0x3c')]=_[_0xf303('0x3b')](_0x3b6fbb[_0xf303('0x38')],qs['fields'](_0x3ba0b9[_0xf303('0x39')][_0xf303('0x3d')]));_0x22d7df[_0xf303('0x3c')]=_0x22d7df['attributes'][_0xf303('0x3e')]?_0x22d7df['attributes']:_0x3b6fbb['model'];if(!_0x3ba0b9[_0xf303('0x39')][_0xf303('0x3f')]('nolimit')){_0x22d7df[_0xf303('0x23')]=qs[_0xf303('0x23')](_0x3ba0b9[_0xf303('0x39')][_0xf303('0x23')]);_0x22d7df[_0xf303('0x22')]=qs[_0xf303('0x22')](_0x3ba0b9[_0xf303('0x39')]['offset']);}_0x22d7df[_0xf303('0x40')]=qs['sort'](_0x3ba0b9[_0xf303('0x39')][_0xf303('0x41')]);_0x22d7df[_0xf303('0x42')]=qs[_0xf303('0x3a')](_['pick'](_0x3ba0b9[_0xf303('0x39')],_0x3b6fbb[_0xf303('0x3a')]),_0x5c1112);if(_0x3ba0b9['query']['filter']){_0x22d7df['where']=_['merge'](_0x22d7df[_0xf303('0x42')],{'$or':_['map'](_0x5c1112,function(_0x5270bc){if(_0x5270bc[_0xf303('0x36')]!=='VIRTUAL'){var _0x4946d3={};_0x4946d3[_0x5270bc[_0xf303('0x31')]]={'$like':'%'+_0x3ba0b9[_0xf303('0x39')][_0xf303('0x43')]+'%'};return _0x4946d3;}})});}_0x22d7df=_[_0xf303('0x44')]({},_0x22d7df,_0x3ba0b9[_0xf303('0x45')]);var _0x5d8cb1={'where':_0x22d7df[_0xf303('0x42')]};return db[_0xf303('0x35')][_0xf303('0x24')](_0x5d8cb1)[_0xf303('0x2b')](function(_0x1308ed){_0x2222ec[_0xf303('0x24')]=_0x1308ed;if(_0x3ba0b9[_0xf303('0x39')]['includeAll']){_0x22d7df[_0xf303('0x46')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xf303('0x47')](_0x22d7df);})[_0xf303('0x2b')](function(_0x5d1166){_0x2222ec['rows']=_0x5d1166;return _0x2222ec;})[_0xf303('0x2b')](respondWithFilteredResult(_0x3dcf7b,_0x22d7df))[_0xf303('0x48')](handleError(_0x3dcf7b,null));};exports['show']=function(_0x130791,_0x2e695f){var _0x4d0f05={'raw':!![],'where':{'id':_0x130791['params']['id']}},_0x3e4072={};_0x3e4072['model']=_['keys'](db['WhatsappQueue']['rawAttributes']);_0x3e4072[_0xf303('0x39')]=_[_0xf303('0x49')](_0x130791[_0xf303('0x39')]);_0x3e4072[_0xf303('0x3a')]=_['intersection'](_0x3e4072[_0xf303('0x38')],_0x3e4072['query']);_0x4d0f05['attributes']=_[_0xf303('0x3b')](_0x3e4072[_0xf303('0x38')],qs['fields'](_0x130791[_0xf303('0x39')][_0xf303('0x3d')]));_0x4d0f05['attributes']=_0x4d0f05['attributes'][_0xf303('0x3e')]?_0x4d0f05[_0xf303('0x3c')]:_0x3e4072['model'];if(_0x130791[_0xf303('0x39')][_0xf303('0x4a')]){_0x4d0f05[_0xf303('0x46')]=[{'all':!![]}];}_0x4d0f05=_['merge']({},_0x4d0f05,_0x130791[_0xf303('0x45')]);return db['WhatsappQueue'][_0xf303('0x4b')](_0x4d0f05)[_0xf303('0x2b')](handleEntityNotFound(_0x2e695f,null))[_0xf303('0x2b')](respondWithResult(_0x2e695f,null))['catch'](handleError(_0x2e695f,null));};exports[_0xf303('0x4c')]=function(_0x4a6e83,_0x1de431){return db[_0xf303('0x35')][_0xf303('0x4c')](_0x4a6e83[_0xf303('0x4d')],{})['then'](function(_0x2954de){var _0x4a98d5=_0x4a6e83[_0xf303('0x4e')][_0xf303('0x4f')]({'plain':!![]});if(!_0x4a98d5)throw new Error(_0xf303('0x50'));if(_0x4a98d5[_0xf303('0x51')]==='user'){var _0x549e90=_0x2954de[_0xf303('0x4f')]({'plain':!![]});var _0xd7df17=_0xf303('0x2d');return db[_0xf303('0x52')][_0xf303('0x4b')]({'where':{'name':_0xd7df17,'userProfileId':_0x4a98d5[_0xf303('0x53')]},'raw':!![]})['then'](function(_0x2670e1){if(_0x2670e1&&_0x2670e1[_0xf303('0x54')]===0x0){return db[_0xf303('0x55')]['create']({'name':_0x549e90['name'],'resourceId':_0x549e90['id'],'type':_0x2670e1[_0xf303('0x31')],'sectionId':_0x2670e1['id']},{})[_0xf303('0x2b')](function(){return _0x2954de;});}else{return _0x2954de;}})[_0xf303('0x48')](function(_0x5bde06){logger[_0xf303('0x2f')](_0xf303('0x56'),_0x5bde06);throw _0x5bde06;});}return _0x2954de;})['then'](respondWithResult(_0x1de431,0xc9))[_0xf303('0x48')](handleError(_0x1de431,null));};exports[_0xf303('0x2a')]=function(_0x8ac115,_0x50c987){if(_0x8ac115['body']['id']){delete _0x8ac115[_0xf303('0x4d')]['id'];}return db[_0xf303('0x35')]['find']({'where':{'id':_0x8ac115[_0xf303('0x57')]['id']}})[_0xf303('0x2b')](handleEntityNotFound(_0x50c987,null))[_0xf303('0x2b')](saveUpdates(_0x8ac115[_0xf303('0x4d')],null))['then'](respondWithResult(_0x50c987,null))['catch'](handleError(_0x50c987,null));};exports[_0xf303('0x2c')]=function(_0x556e17,_0xa90de1){return db[_0xf303('0x35')][_0xf303('0x4b')]({'where':{'id':_0x556e17[_0xf303('0x57')]['id']}})[_0xf303('0x2b')](handleEntityNotFound(_0xa90de1,null))['then'](removeEntity(_0xa90de1,null))[_0xf303('0x48')](handleError(_0xa90de1,null));};exports[_0xf303('0x58')]=function(_0x44ef8a,_0x32028b){return db['WhatsappQueue'][_0xf303('0x58')]()[_0xf303('0x2b')](respondWithResult(_0x32028b,null))[_0xf303('0x48')](handleError(_0x32028b,null));};exports[_0xf303('0x59')]=function(_0x340759,_0x10c9aa,_0x1af539){var _0x55e0fc={'raw':!![],'where':{}},_0xad180b={},_0x1a56c1;return db['WhatsappQueue'][_0xf303('0x5a')]({'where':{'id':_0x340759[_0xf303('0x57')]['id']}})[_0xf303('0x2b')](handleEntityNotFound(_0x10c9aa,null))['then'](function(_0x3b54dc){if(_0x3b54dc){_0x1a56c1=_0x3b54dc[_0xf303('0x4f')]({'plain':!![]});_0xad180b[_0xf303('0x38')]=_[_0xf303('0x49')](db[_0xf303('0x5b')][_0xf303('0x5c')]);_0xad180b[_0xf303('0x39')]=_[_0xf303('0x49')](_0x340759[_0xf303('0x39')]);_0xad180b[_0xf303('0x3a')]=_[_0xf303('0x3b')](_0xad180b[_0xf303('0x38')],_0xad180b[_0xf303('0x39')]);_0x55e0fc[_0xf303('0x3c')]=_['intersection'](_0xad180b[_0xf303('0x38')],qs[_0xf303('0x3d')](_0x340759['query'][_0xf303('0x3d')]));_0x55e0fc[_0xf303('0x3c')]=_0x55e0fc[_0xf303('0x3c')][_0xf303('0x3e')]?_0x55e0fc[_0xf303('0x3c')]:_0xad180b[_0xf303('0x38')];if(!_0x340759['query']['hasOwnProperty'](_0xf303('0x5d'))){_0x55e0fc[_0xf303('0x23')]=qs[_0xf303('0x23')](_0x340759[_0xf303('0x39')][_0xf303('0x23')]);_0x55e0fc[_0xf303('0x22')]=qs[_0xf303('0x22')](_0x340759['query'][_0xf303('0x22')]);}_0x55e0fc[_0xf303('0x40')]=qs[_0xf303('0x41')](_0x340759[_0xf303('0x39')][_0xf303('0x41')]);_0x55e0fc[_0xf303('0x42')]=qs[_0xf303('0x3a')](_[_0xf303('0x5e')](_0x340759[_0xf303('0x39')],_0xad180b[_0xf303('0x3a')]));_0x55e0fc[_0xf303('0x42')]['WhatsappQueueId']=_0x3b54dc['id'];if(_0x340759[_0xf303('0x39')][_0xf303('0x43')]){_0x55e0fc[_0xf303('0x42')]=_[_0xf303('0x44')](_0x55e0fc[_0xf303('0x42')],{'$or':_[_0xf303('0x34')](_0x55e0fc['attributes'],function(_0x5a4c6b){var _0x194975={};_0x194975[_0x5a4c6b]={'$like':'%'+_0x340759[_0xf303('0x39')][_0xf303('0x43')]+'%'};return _0x194975;})});}_0x55e0fc=_[_0xf303('0x44')]({},_0x55e0fc,_0x340759[_0xf303('0x45')]);return db[_0xf303('0x5b')][_0xf303('0x47')](_0x55e0fc);}})[_0xf303('0x2b')](function(_0xd3a3d5){if(_0xd3a3d5){return db[_0xf303('0x5f')][_0xf303('0x60')]({'where':{'id':_['map'](_0xd3a3d5,_0xf303('0x61')),'role':_0xf303('0x62')},'attributes':['id',_0xf303('0x31'),_0xf303('0x63'),_0xf303('0x64'),'createdAt']});}})['then'](function(_0x4730f9){if(_0x4730f9){return{'count':_0x4730f9[_0xf303('0x24')],'rows':_['map'](_0x4730f9[_0xf303('0x65')],function(_0x2fe7a5){return{'membername':_0x2fe7a5['name'],'UserId':_0x2fe7a5['id'],'queue_name':_0x1a56c1[_0xf303('0x31')],'WhatsappQueueId':_0x1a56c1['id'],'interface':util[_0xf303('0x66')](_0xf303('0x67'),_0xf303('0x68'),_0x2fe7a5[_0xf303('0x31')]),'penalty':0x0,'paused':_0x2fe7a5[_0xf303('0x63')],'createdAt':_0x2fe7a5[_0xf303('0x69')],'updatedAt':_0x2fe7a5[_0xf303('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf303('0x2b')](respondWithFilteredResult(_0x10c9aa,_0x55e0fc))[_0xf303('0x48')](handleError(_0x10c9aa,null));};exports[_0xf303('0x6a')]=function(_0x44ea5e,_0xd872d5,_0x2cdfd8){var _0x3b1cb5={};var _0x185174={};var _0x4c15d5;var _0x1b4275;return db['WhatsappQueue'][_0xf303('0x5a')]({'where':{'id':_0x44ea5e[_0xf303('0x57')]['id']}})[_0xf303('0x2b')](handleEntityNotFound(_0xd872d5,null))['then'](function(_0x54639f){if(_0x54639f){_0x4c15d5=_0x54639f;_0x185174[_0xf303('0x38')]=_[_0xf303('0x49')](db[_0xf303('0x6b')]['rawAttributes']);_0x185174['query']=_[_0xf303('0x49')](_0x44ea5e[_0xf303('0x39')]);_0x185174[_0xf303('0x3a')]=_['intersection'](_0x185174[_0xf303('0x38')],_0x185174['query']);_0x3b1cb5[_0xf303('0x3c')]=_[_0xf303('0x3b')](_0x185174[_0xf303('0x38')],qs[_0xf303('0x3d')](_0x44ea5e[_0xf303('0x39')][_0xf303('0x3d')]));_0x3b1cb5[_0xf303('0x3c')]=_0x3b1cb5[_0xf303('0x3c')][_0xf303('0x3e')]?_0x3b1cb5['attributes']:_0x185174['model'];_0x3b1cb5[_0xf303('0x40')]=qs[_0xf303('0x41')](_0x44ea5e['query'][_0xf303('0x41')]);_0x3b1cb5[_0xf303('0x42')]=qs[_0xf303('0x3a')](_['pick'](_0x44ea5e['query'],_0x185174[_0xf303('0x3a')]));if(_0x44ea5e['query'][_0xf303('0x43')]){_0x3b1cb5['where']=_['merge'](_0x3b1cb5['where'],{'$or':_[_0xf303('0x34')](_0x3b1cb5['attributes'],function(_0x31faaf){var _0x1599ff={};_0x1599ff[_0x31faaf]={'$like':'%'+_0x44ea5e[_0xf303('0x39')][_0xf303('0x43')]+'%'};return _0x1599ff;})});}_0x3b1cb5=_[_0xf303('0x44')]({},_0x3b1cb5,_0x44ea5e[_0xf303('0x45')]);return _0x4c15d5[_0xf303('0x6a')](_0x3b1cb5);}})[_0xf303('0x2b')](function(_0x1e64ac){if(_0x1e64ac){_0x1b4275=_0x1e64ac[_0xf303('0x3e')];if(!_0x44ea5e['query']['hasOwnProperty']('nolimit')){_0x3b1cb5[_0xf303('0x23')]=qs['limit'](_0x44ea5e['query'][_0xf303('0x23')]);_0x3b1cb5[_0xf303('0x22')]=qs[_0xf303('0x22')](_0x44ea5e[_0xf303('0x39')][_0xf303('0x22')]);}return _0x4c15d5[_0xf303('0x6a')](_0x3b1cb5);}})[_0xf303('0x2b')](function(_0x1b09f2){if(_0x1b09f2){return _0x1b09f2?{'count':_0x1b4275,'rows':_0x1b09f2}:null;}})[_0xf303('0x2b')](respondWithResult(_0xd872d5,null))[_0xf303('0x48')](handleError(_0xd872d5,null));};exports[_0xf303('0x6c')]=function(_0x23689b,_0x2a207d,_0x5d74f4){var _0x276c73=_0x23689b[_0xf303('0x4d')][_0xf303('0x6d')];return db[_0xf303('0x6b')][_0xf303('0x47')]({'where':{'id':_0x276c73},'attributes':['id'],'include':[{'model':db[_0xf303('0x5f')],'as':_0xf303('0x6e'),'attributes':['id','name',_0xf303('0x6f'),_0xf303('0x70'),_0xf303('0x71')],'raw':!![]}]})[_0xf303('0x2b')](function(_0x51b395){if(_0x51b395){var _0x4d1c5a=_['flatMap'](_0x51b395,function(_0xa43991){var _0x4992e6=_0xa43991[_0xf303('0x4f')]({'plain':!![]});return _0x4992e6['Agents'];});return db['WhatsappQueue']['find']({'where':{'id':_0x23689b[_0xf303('0x57')]['id']}})[_0xf303('0x2b')](function(_0xd1a4da){return db[_0xf303('0x72')]['transaction'](function(_0x398459){return _0xd1a4da['addTeams'](_0x276c73,{'transaction':_0x398459})[_0xf303('0x2b')](function(){return BPromise[_0xf303('0x73')](_0x4d1c5a,function(_0x19ff7b){return db[_0xf303('0x5b')]['findOrCreate']({'where':{'UserId':_0x19ff7b['id'],'WhatsappQueueId':_0x23689b[_0xf303('0x57')]['id']},'transaction':_0x398459});});})['then'](function(){_0x4d1c5a[_0xf303('0x74')](function(_0x37230c){socket[_0xf303('0x75')](_0xf303('0x76'),{'UserId':_0x37230c['id'],'WhatsappQueueId':_0xd1a4da['id']});});});});});}})[_0xf303('0x2b')](respondWithStatusCode(_0x2a207d,null))[_0xf303('0x48')](handleError(_0x2a207d,null));};exports['removeTeams']=function(_0xffd5e,_0x1831bf,_0x4973b0){return db[_0xf303('0x6b')][_0xf303('0x47')]({'where':{'id':_0xffd5e[_0xf303('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf303('0x5f')],'as':_0xf303('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1831bf,null))[_0xf303('0x2b')](function(_0x4759e4){var _0xcc5d24=_[_0xf303('0x34')](_0x4759e4,'id');var _0x43d8d3=[];var _0x170053=[];var _0x11ada4=squel['select']();_0x11ada4[_0xf303('0x77')](_0xf303('0x78'))[_0xf303('0x79')](_0xf303('0x7a'),'tq')[_0xf303('0x7b')](_0xf303('0x7c'),'ut',_0xf303('0x7d'))[_0xf303('0x42')](_0xf303('0x7e'),_0xffd5e[_0xf303('0x57')]['id']);for(var _0x114520=0x0;_0x114520<_0x4759e4['length'];_0x114520+=0x1){let _0x4bb779=_0x4759e4[_0x114520];for(var _0x59ab24=0x0;_0x59ab24<_0x4bb779[_0xf303('0x6e')][_0xf303('0x3e')];_0x59ab24+=0x1){let _0x1ada60=_0x4bb779['Agents'][_0x59ab24];var _0x49cb8a=_0x11ada4['clone']();_0x49cb8a['where'](_0xf303('0x7f'),_0x1ada60['id']);_0x170053[_0xf303('0x80')](db[_0xf303('0x72')][_0xf303('0x39')](_0x49cb8a[_0xf303('0x81')](),{'type':db[_0xf303('0x72')][_0xf303('0x82')][_0xf303('0x83')]})[_0xf303('0x2b')](function(_0x272093){if(_0x272093['length']===0x1){return _0x1ada60['id'];}else{var _0x5c469f=_[_0xf303('0x84')](_[_0xf303('0x34')](_0x272093,_0xf303('0x85')),function(_0x4cba52){return _[_0xf303('0x86')](_0xcc5d24,_0x4cba52);});if(_0x5c469f){return _0x1ada60['id'];}}}));}}return BPromise[_0xf303('0x87')](_0x170053)['then'](function(_0x3fba4a){_0x43d8d3=_(_0x43d8d3)['union'](_0x3fba4a)[_0xf303('0x88')]()['value']();return db[_0xf303('0x35')]['find']({'where':{'id':_0xffd5e[_0xf303('0x57')]['id']}})[_0xf303('0x2b')](function(_0x1373e3){return db[_0xf303('0x72')][_0xf303('0x89')](function(_0x4c7d32){return _0x1373e3[_0xf303('0x8a')](_0xffd5e[_0xf303('0x39')][_0xf303('0x6d')],{'transaction':_0x4c7d32})[_0xf303('0x2b')](function(){if(!_[_0xf303('0x8b')](_0x43d8d3)){return _0x1373e3[_0xf303('0x8c')](_0x43d8d3,{'transaction':_0x4c7d32});}})['then'](function(){_0x43d8d3[_0xf303('0x74')](function(_0x3136d1){socket[_0xf303('0x75')](_0xf303('0x8d'),{'UserId':_0x3136d1,'WhatsappQueueId':_0x1373e3['id']});});});});});});})[_0xf303('0x2b')](respondWithStatusCode(_0x1831bf,null))[_0xf303('0x48')](handleError(_0x1831bf,null));};exports[_0xf303('0x8e')]=function(_0x26e090,_0x25493e,_0x52559f){return db[_0xf303('0x35')][_0xf303('0x4b')]({'where':{'id':_0x26e090[_0xf303('0x57')]['id']}})[_0xf303('0x2b')](handleEntityNotFound(_0x25493e,null))[_0xf303('0x2b')](function(_0x325117){if(_0x325117){return _0x325117[_0xf303('0x8e')](_0x26e090['body']['ids'],_['omit'](_0x26e090[_0xf303('0x4d')],[_0xf303('0x6d'),'id'])||{})[_0xf303('0x8f')](function(_0x10519f){for(var _0x4ca9ea=0x0;_0x4ca9ea<_0x26e090['body']['ids'][_0xf303('0x3e')];_0x4ca9ea+=0x1){socket[_0xf303('0x75')](_0xf303('0x76'),{'UserId':Number(_0x26e090[_0xf303('0x4d')][_0xf303('0x6d')][_0x4ca9ea]),'WhatsappQueueId':Number(_0x26e090[_0xf303('0x57')]['id'])});}return _0x10519f;});}})[_0xf303('0x2b')](respondWithResult(_0x25493e,null))[_0xf303('0x48')](handleError(_0x25493e,null));};exports['removeAgents']=function(_0x48f668,_0x368070,_0x2c74bd){return db[_0xf303('0x35')][_0xf303('0x4b')]({'where':{'id':_0x48f668[_0xf303('0x57')]['id']}})['then'](handleEntityNotFound(_0x368070,null))[_0xf303('0x2b')](function(_0x18cb44){if(_0x18cb44){return _0x18cb44['removeAgents'](_0x48f668[_0xf303('0x39')][_0xf303('0x6d')])[_0xf303('0x2b')](function(){if(_[_0xf303('0x90')](_0x48f668['query'][_0xf303('0x6d')])){for(var _0x25fc47=0x0;_0x25fc47<_0x48f668[_0xf303('0x39')][_0xf303('0x6d')]['length'];_0x25fc47+=0x1){socket[_0xf303('0x75')](_0xf303('0x8d'),{'UserId':Number(_0x48f668['query'][_0xf303('0x6d')][_0x25fc47]),'WhatsappQueueId':Number(_0x48f668[_0xf303('0x57')]['id'])});}}else{socket[_0xf303('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x48f668['query'][_0xf303('0x6d')]),'WhatsappQueueId':Number(_0x48f668['params']['id'])});}});}})[_0xf303('0x2b')](respondWithStatusCode(_0x368070,null))[_0xf303('0x48')](handleError(_0x368070,null));};exports['getAgents']=function(_0x15866d,_0x2fd975,_0x1c11d3){var _0x4f080c={};var _0x23c505={};var _0x238a27;var _0x56d70f;return db[_0xf303('0x35')][_0xf303('0x5a')]({'where':{'id':_0x15866d['params']['id']}})[_0xf303('0x2b')](handleEntityNotFound(_0x2fd975,null))['then'](function(_0x4174e3){if(_0x4174e3){_0x238a27=_0x4174e3;_0x23c505[_0xf303('0x38')]=_['keys'](db[_0xf303('0x5f')][_0xf303('0x5c')]);_0x23c505[_0xf303('0x39')]=_[_0xf303('0x49')](_0x15866d[_0xf303('0x39')]);_0x23c505['filters']=_[_0xf303('0x3b')](_0x23c505['model'],_0x23c505[_0xf303('0x39')]);_0x4f080c[_0xf303('0x3c')]=_['intersection'](_0x23c505['model'],qs[_0xf303('0x3d')](_0x15866d[_0xf303('0x39')]['fields']));_0x4f080c[_0xf303('0x3c')]=_0x4f080c[_0xf303('0x3c')]['length']?_0x4f080c[_0xf303('0x3c')]:_0x23c505['model'];_0x4f080c[_0xf303('0x40')]=qs['sort'](_0x15866d[_0xf303('0x39')][_0xf303('0x41')]);_0x4f080c[_0xf303('0x42')]=qs[_0xf303('0x3a')](_[_0xf303('0x5e')](_0x15866d[_0xf303('0x39')],_0x23c505[_0xf303('0x3a')]));if(_0x15866d[_0xf303('0x39')][_0xf303('0x43')]){_0x4f080c[_0xf303('0x42')]=_[_0xf303('0x44')](_0x4f080c[_0xf303('0x42')],{'$or':_[_0xf303('0x34')](_0x4f080c[_0xf303('0x3c')],function(_0x3df711){var _0x1e8069={};_0x1e8069[_0x3df711]={'$like':'%'+_0x15866d[_0xf303('0x39')][_0xf303('0x43')]+'%'};return _0x1e8069;})});}_0x4f080c=_['merge']({},_0x4f080c,_0x15866d[_0xf303('0x45')]);return _0x238a27[_0xf303('0x91')](_0x4f080c);}})['then'](function(_0x3578b9){if(_0x3578b9){_0x56d70f=_0x3578b9['length'];if(!_0x15866d['query']['hasOwnProperty'](_0xf303('0x5d'))){_0x4f080c[_0xf303('0x23')]=qs[_0xf303('0x23')](_0x15866d['query'][_0xf303('0x23')]);_0x4f080c[_0xf303('0x22')]=qs[_0xf303('0x22')](_0x15866d['query']['offset']);}return _0x238a27['getAgents'](_0x4f080c);}})[_0xf303('0x2b')](function(_0x3b2f28){if(_0x3b2f28){return _0x3b2f28?{'count':_0x56d70f,'rows':_0x3b2f28}:null;}})[_0xf303('0x2b')](respondWithResult(_0x2fd975,null))['catch'](handleError(_0x2fd975,null));}; \ No newline at end of file +var _0x7a1c=['find','params','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','getTeams','addTeams','ids','online','voicePause','interface','transaction','each','findOrCreate','userWhatsappQueue:save','removeTeams','Agents','field','tq.TeamId','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','isEmpty','removeAgents','forEach','emit','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','WhatsappQueue','includeAll','include','findAll','catch','show','intersection','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7a1c,0xcb));var _0xc7a1=function(_0x3f09d3,_0x4a1d36){_0x3f09d3=_0x3f09d3-0x0;var _0x24dd42=_0x7a1c[_0x3f09d3];return _0x24dd42;};'use strict';var emlformat=require(_0xc7a1('0x0'));var rimraf=require(_0xc7a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7a1('0x2'));var rp=require(_0xc7a1('0x3'));var moment=require(_0xc7a1('0x4'));var BPromise=require(_0xc7a1('0x5'));var Mustache=require('mustache');var util=require(_0xc7a1('0x6'));var path=require(_0xc7a1('0x7'));var sox=require(_0xc7a1('0x8'));var csv=require(_0xc7a1('0x9'));var ejs=require(_0xc7a1('0xa'));var fs=require('fs');var fs_extra=require(_0xc7a1('0xb'));var _=require('lodash');var squel=require(_0xc7a1('0xc'));var crypto=require(_0xc7a1('0xd'));var jsforce=require(_0xc7a1('0xe'));var deskjs=require(_0xc7a1('0xf'));var toCsv=require(_0xc7a1('0x9'));var querystring=require('querystring');var Papa=require(_0xc7a1('0x10'));var Redis=require('ioredis');var authService=require(_0xc7a1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc7a1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7a1('0x13'))(_0xc7a1('0x14'));var utils=require(_0xc7a1('0x15'));var config=require(_0xc7a1('0x16'));var licenseUtil=require(_0xc7a1('0x17'));var db=require(_0xc7a1('0x18'))['db'];config[_0xc7a1('0x19')]=_[_0xc7a1('0x1a')](config[_0xc7a1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xc7a1('0x1b'))(new Redis(config[_0xc7a1('0x19')]));require(_0xc7a1('0x1c'))[_0xc7a1('0x1d')](socket);function respondWithStatusCode(_0x328fe0,_0x324978){_0x324978=_0x324978||0xcc;return function(_0x149399){if(_0x149399){return _0x328fe0[_0xc7a1('0x1e')](_0x324978);}return _0x328fe0['status'](_0x324978)[_0xc7a1('0x1f')]();};}function respondWithResult(_0x2c85c4,_0x1c46a3){_0x1c46a3=_0x1c46a3||0xc8;return function(_0x353433){if(_0x353433){return _0x2c85c4[_0xc7a1('0x20')](_0x1c46a3)[_0xc7a1('0x21')](_0x353433);}};}function respondWithFilteredResult(_0x1b9c57,_0x2374fb){return function(_0xefcc55){if(_0xefcc55){var _0x124b54=typeof _0x2374fb[_0xc7a1('0x22')]===_0xc7a1('0x23')&&typeof _0x2374fb['limit']===_0xc7a1('0x23');var _0x1f70b0=_0xefcc55[_0xc7a1('0x24')];var _0x491e25=_0x124b54?0x0:_0x2374fb[_0xc7a1('0x22')];var _0x538512=_0x124b54?_0xefcc55[_0xc7a1('0x24')]:_0x2374fb['offset']+_0x2374fb[_0xc7a1('0x25')];var _0x2465b0;if(_0x538512>=_0x1f70b0){_0x538512=_0x1f70b0;_0x2465b0=0xc8;}else{_0x2465b0=0xce;}_0x1b9c57[_0xc7a1('0x20')](_0x2465b0);return _0x1b9c57['set'](_0xc7a1('0x26'),_0x491e25+'-'+_0x538512+'/'+_0x1f70b0)[_0xc7a1('0x21')](_0xefcc55);}return null;};}function patchUpdates(_0x3b5a57){return function(_0x264f0a){try{jsonpatch[_0xc7a1('0x27')](_0x264f0a,_0x3b5a57,!![]);}catch(_0x3ba19e){return BPromise[_0xc7a1('0x28')](_0x3ba19e);}return _0x264f0a['save']();};}function saveUpdates(_0x49f58b,_0x1fa4ae){return function(_0x5b1dc8){if(_0x5b1dc8){return _0x5b1dc8[_0xc7a1('0x29')](_0x49f58b)[_0xc7a1('0x2a')](function(_0x200b35){return _0x200b35;});}return null;};}function removeEntity(_0xe8321f,_0x4645e1){return function(_0x9efe66){if(_0x9efe66){return _0x9efe66[_0xc7a1('0x2b')]()[_0xc7a1('0x2a')](function(){var _0x17085a=_0x9efe66['get']({'plain':!![]});var _0x2fe78b=_0xc7a1('0x2c');return db[_0xc7a1('0x2d')][_0xc7a1('0x2b')]({'where':{'type':_0x2fe78b,'resourceId':_0x17085a['id']}})[_0xc7a1('0x2a')](function(){return _0x9efe66;});})[_0xc7a1('0x2a')](function(){_0xe8321f[_0xc7a1('0x20')](0xcc)[_0xc7a1('0x1f')]();});}};}function handleEntityNotFound(_0x4afdf7,_0x5cb5f7){return function(_0x1a62b4){if(!_0x1a62b4){_0x4afdf7[_0xc7a1('0x1e')](0x194);}return _0x1a62b4;};}function handleError(_0x578e0f,_0x4e9436){_0x4e9436=_0x4e9436||0x1f4;return function(_0x38c6cd){logger[_0xc7a1('0x2e')](_0x38c6cd[_0xc7a1('0x2f')]);if(_0x38c6cd[_0xc7a1('0x30')]){delete _0x38c6cd['name'];}_0x578e0f[_0xc7a1('0x20')](_0x4e9436)[_0xc7a1('0x31')](_0x38c6cd);};}exports[_0xc7a1('0x32')]=function(_0x4a8d8f,_0x325bf6){var _0x88713f={},_0x1f2fa6={},_0x4e2ec1={'count':0x0,'rows':[]};var _0x254d68=_[_0xc7a1('0x33')](db['WhatsappQueue'][_0xc7a1('0x34')],function(_0x4ed436){return{'name':_0x4ed436['fieldName'],'type':_0x4ed436[_0xc7a1('0x35')]['key']};});_0x1f2fa6[_0xc7a1('0x36')]=_[_0xc7a1('0x33')](_0x254d68,'name');_0x1f2fa6[_0xc7a1('0x37')]=_[_0xc7a1('0x38')](_0x4a8d8f[_0xc7a1('0x37')]);_0x1f2fa6[_0xc7a1('0x39')]=_['intersection'](_0x1f2fa6['model'],_0x1f2fa6[_0xc7a1('0x37')]);_0x88713f[_0xc7a1('0x3a')]=_['intersection'](_0x1f2fa6[_0xc7a1('0x36')],qs[_0xc7a1('0x3b')](_0x4a8d8f[_0xc7a1('0x37')]['fields']));_0x88713f[_0xc7a1('0x3a')]=_0x88713f[_0xc7a1('0x3a')][_0xc7a1('0x3c')]?_0x88713f[_0xc7a1('0x3a')]:_0x1f2fa6[_0xc7a1('0x36')];if(!_0x4a8d8f[_0xc7a1('0x37')][_0xc7a1('0x3d')]('nolimit')){_0x88713f[_0xc7a1('0x25')]=qs[_0xc7a1('0x25')](_0x4a8d8f[_0xc7a1('0x37')]['limit']);_0x88713f[_0xc7a1('0x22')]=qs[_0xc7a1('0x22')](_0x4a8d8f[_0xc7a1('0x37')][_0xc7a1('0x22')]);}_0x88713f[_0xc7a1('0x3e')]=qs[_0xc7a1('0x3f')](_0x4a8d8f[_0xc7a1('0x37')][_0xc7a1('0x3f')]);_0x88713f['where']=qs[_0xc7a1('0x39')](_[_0xc7a1('0x40')](_0x4a8d8f[_0xc7a1('0x37')],_0x1f2fa6[_0xc7a1('0x39')]),_0x254d68);if(_0x4a8d8f[_0xc7a1('0x37')][_0xc7a1('0x41')]){_0x88713f['where']=_[_0xc7a1('0x42')](_0x88713f[_0xc7a1('0x43')],{'$or':_[_0xc7a1('0x33')](_0x254d68,function(_0x148102){if(_0x148102[_0xc7a1('0x35')]!=='VIRTUAL'){var _0x34d46b={};_0x34d46b[_0x148102[_0xc7a1('0x30')]]={'$like':'%'+_0x4a8d8f[_0xc7a1('0x37')][_0xc7a1('0x41')]+'%'};return _0x34d46b;}})});}_0x88713f=_[_0xc7a1('0x42')]({},_0x88713f,_0x4a8d8f[_0xc7a1('0x44')]);var _0x1c515b={'where':_0x88713f[_0xc7a1('0x43')]};return db[_0xc7a1('0x45')][_0xc7a1('0x24')](_0x1c515b)['then'](function(_0xca3639){_0x4e2ec1[_0xc7a1('0x24')]=_0xca3639;if(_0x4a8d8f['query'][_0xc7a1('0x46')]){_0x88713f[_0xc7a1('0x47')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xc7a1('0x48')](_0x88713f);})['then'](function(_0xc755aa){_0x4e2ec1['rows']=_0xc755aa;return _0x4e2ec1;})[_0xc7a1('0x2a')](respondWithFilteredResult(_0x325bf6,_0x88713f))[_0xc7a1('0x49')](handleError(_0x325bf6,null));};exports[_0xc7a1('0x4a')]=function(_0x50a78a,_0x4335e3){var _0x3a2088={'raw':!![],'where':{'id':_0x50a78a['params']['id']}},_0x3e2267={};_0x3e2267['model']=_[_0xc7a1('0x38')](db[_0xc7a1('0x45')][_0xc7a1('0x34')]);_0x3e2267[_0xc7a1('0x37')]=_[_0xc7a1('0x38')](_0x50a78a[_0xc7a1('0x37')]);_0x3e2267['filters']=_[_0xc7a1('0x4b')](_0x3e2267[_0xc7a1('0x36')],_0x3e2267[_0xc7a1('0x37')]);_0x3a2088[_0xc7a1('0x3a')]=_['intersection'](_0x3e2267[_0xc7a1('0x36')],qs[_0xc7a1('0x3b')](_0x50a78a[_0xc7a1('0x37')][_0xc7a1('0x3b')]));_0x3a2088['attributes']=_0x3a2088['attributes'][_0xc7a1('0x3c')]?_0x3a2088[_0xc7a1('0x3a')]:_0x3e2267[_0xc7a1('0x36')];if(_0x50a78a[_0xc7a1('0x37')]['includeAll']){_0x3a2088[_0xc7a1('0x47')]=[{'all':!![]}];}_0x3a2088=_[_0xc7a1('0x42')]({},_0x3a2088,_0x50a78a['options']);return db[_0xc7a1('0x45')]['find'](_0x3a2088)[_0xc7a1('0x2a')](handleEntityNotFound(_0x4335e3,null))[_0xc7a1('0x2a')](respondWithResult(_0x4335e3,null))['catch'](handleError(_0x4335e3,null));};exports['create']=function(_0x1ef09d,_0x285977){return db['WhatsappQueue'][_0xc7a1('0x4c')](_0x1ef09d[_0xc7a1('0x4d')],{})[_0xc7a1('0x2a')](function(_0x1c1c2b){var _0x44b8e8=_0x1ef09d[_0xc7a1('0x4e')][_0xc7a1('0x4f')]({'plain':!![]});if(!_0x44b8e8)throw new Error(_0xc7a1('0x50'));if(_0x44b8e8[_0xc7a1('0x51')]===_0xc7a1('0x4e')){var _0x3ad5e1=_0x1c1c2b['get']({'plain':!![]});var _0x589f5e=_0xc7a1('0x2c');return db[_0xc7a1('0x52')]['find']({'where':{'name':_0x589f5e,'userProfileId':_0x44b8e8['userProfileId']},'raw':!![]})[_0xc7a1('0x2a')](function(_0x359c0b){if(_0x359c0b&&_0x359c0b[_0xc7a1('0x53')]===0x0){return db[_0xc7a1('0x2d')][_0xc7a1('0x4c')]({'name':_0x3ad5e1['name'],'resourceId':_0x3ad5e1['id'],'type':_0x359c0b[_0xc7a1('0x30')],'sectionId':_0x359c0b['id']},{})[_0xc7a1('0x2a')](function(){return _0x1c1c2b;});}else{return _0x1c1c2b;}})[_0xc7a1('0x49')](function(_0x2c827c){logger[_0xc7a1('0x2e')](_0xc7a1('0x54'),_0x2c827c);throw _0x2c827c;});}return _0x1c1c2b;})[_0xc7a1('0x2a')](respondWithResult(_0x285977,0xc9))[_0xc7a1('0x49')](handleError(_0x285977,null));};exports[_0xc7a1('0x29')]=function(_0x513a94,_0x3a125e){if(_0x513a94[_0xc7a1('0x4d')]['id']){delete _0x513a94[_0xc7a1('0x4d')]['id'];}return db[_0xc7a1('0x45')][_0xc7a1('0x55')]({'where':{'id':_0x513a94['params']['id']}})[_0xc7a1('0x2a')](handleEntityNotFound(_0x3a125e,null))[_0xc7a1('0x2a')](saveUpdates(_0x513a94[_0xc7a1('0x4d')],null))[_0xc7a1('0x2a')](respondWithResult(_0x3a125e,null))[_0xc7a1('0x49')](handleError(_0x3a125e,null));};exports[_0xc7a1('0x2b')]=function(_0x15d6ad,_0x3ede99){return db['WhatsappQueue'][_0xc7a1('0x55')]({'where':{'id':_0x15d6ad[_0xc7a1('0x56')]['id']}})[_0xc7a1('0x2a')](handleEntityNotFound(_0x3ede99,null))[_0xc7a1('0x2a')](removeEntity(_0x3ede99,null))[_0xc7a1('0x49')](handleError(_0x3ede99,null));};exports['describe']=function(_0x2f1c40,_0x40e0c4){return db[_0xc7a1('0x45')][_0xc7a1('0x57')]()[_0xc7a1('0x2a')](respondWithResult(_0x40e0c4,null))[_0xc7a1('0x49')](handleError(_0x40e0c4,null));};exports[_0xc7a1('0x58')]=function(_0x48912d,_0x56b910,_0x488d90){var _0x350d84={'raw':!![],'where':{}},_0xdd99c8={},_0x225d3e;return db[_0xc7a1('0x45')][_0xc7a1('0x59')]({'where':{'id':_0x48912d[_0xc7a1('0x56')]['id']}})[_0xc7a1('0x2a')](handleEntityNotFound(_0x56b910,null))[_0xc7a1('0x2a')](function(_0x5e25df){if(_0x5e25df){_0x225d3e=_0x5e25df['get']({'plain':!![]});_0xdd99c8[_0xc7a1('0x36')]=_[_0xc7a1('0x38')](db[_0xc7a1('0x5a')][_0xc7a1('0x34')]);_0xdd99c8['query']=_['keys'](_0x48912d['query']);_0xdd99c8['filters']=_[_0xc7a1('0x4b')](_0xdd99c8[_0xc7a1('0x36')],_0xdd99c8['query']);_0x350d84[_0xc7a1('0x3a')]=_[_0xc7a1('0x4b')](_0xdd99c8[_0xc7a1('0x36')],qs['fields'](_0x48912d['query'][_0xc7a1('0x3b')]));_0x350d84[_0xc7a1('0x3a')]=_0x350d84['attributes'][_0xc7a1('0x3c')]?_0x350d84[_0xc7a1('0x3a')]:_0xdd99c8[_0xc7a1('0x36')];if(!_0x48912d['query'][_0xc7a1('0x3d')](_0xc7a1('0x5b'))){_0x350d84[_0xc7a1('0x25')]=qs[_0xc7a1('0x25')](_0x48912d['query'][_0xc7a1('0x25')]);_0x350d84[_0xc7a1('0x22')]=qs[_0xc7a1('0x22')](_0x48912d[_0xc7a1('0x37')]['offset']);}_0x350d84[_0xc7a1('0x3e')]=qs['sort'](_0x48912d[_0xc7a1('0x37')][_0xc7a1('0x3f')]);_0x350d84['where']=qs[_0xc7a1('0x39')](_['pick'](_0x48912d[_0xc7a1('0x37')],_0xdd99c8['filters']));_0x350d84[_0xc7a1('0x43')][_0xc7a1('0x5c')]=_0x5e25df['id'];if(_0x48912d[_0xc7a1('0x37')][_0xc7a1('0x41')]){_0x350d84[_0xc7a1('0x43')]=_[_0xc7a1('0x42')](_0x350d84['where'],{'$or':_['map'](_0x350d84[_0xc7a1('0x3a')],function(_0x350325){var _0x577ec3={};_0x577ec3[_0x350325]={'$like':'%'+_0x48912d['query'][_0xc7a1('0x41')]+'%'};return _0x577ec3;})});}_0x350d84=_[_0xc7a1('0x42')]({},_0x350d84,_0x48912d['options']);return db['UserWhatsappQueue'][_0xc7a1('0x48')](_0x350d84);}})[_0xc7a1('0x2a')](function(_0x60acbd){if(_0x60acbd){return db[_0xc7a1('0x5d')][_0xc7a1('0x5e')]({'where':{'id':_['map'](_0x60acbd,_0xc7a1('0x5f')),'role':_0xc7a1('0x60')},'attributes':['id','name',_0xc7a1('0x61'),_0xc7a1('0x62'),_0xc7a1('0x63')]});}})[_0xc7a1('0x2a')](function(_0x6633b1){if(_0x6633b1){return{'count':_0x6633b1[_0xc7a1('0x24')],'rows':_[_0xc7a1('0x33')](_0x6633b1[_0xc7a1('0x64')],function(_0xa45c2a){return{'membername':_0xa45c2a[_0xc7a1('0x30')],'UserId':_0xa45c2a['id'],'queue_name':_0x225d3e[_0xc7a1('0x30')],'WhatsappQueueId':_0x225d3e['id'],'interface':util[_0xc7a1('0x65')](_0xc7a1('0x66'),_0xc7a1('0x67'),_0xa45c2a[_0xc7a1('0x30')]),'penalty':0x0,'paused':_0xa45c2a[_0xc7a1('0x61')],'createdAt':_0xa45c2a['createdAt'],'updatedAt':_0xa45c2a[_0xc7a1('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc7a1('0x2a')](respondWithFilteredResult(_0x56b910,_0x350d84))[_0xc7a1('0x49')](handleError(_0x56b910,null));};exports['getTeams']=function(_0x89fa66,_0x542ee6,_0x23045b){var _0x547e72={};var _0x572c84={};var _0x105e34;var _0x243733;return db[_0xc7a1('0x45')]['findOne']({'where':{'id':_0x89fa66['params']['id']}})[_0xc7a1('0x2a')](handleEntityNotFound(_0x542ee6,null))[_0xc7a1('0x2a')](function(_0x466280){if(_0x466280){_0x105e34=_0x466280;_0x572c84[_0xc7a1('0x36')]=_[_0xc7a1('0x38')](db[_0xc7a1('0x68')][_0xc7a1('0x34')]);_0x572c84['query']=_[_0xc7a1('0x38')](_0x89fa66[_0xc7a1('0x37')]);_0x572c84['filters']=_[_0xc7a1('0x4b')](_0x572c84['model'],_0x572c84['query']);_0x547e72[_0xc7a1('0x3a')]=_[_0xc7a1('0x4b')](_0x572c84[_0xc7a1('0x36')],qs['fields'](_0x89fa66[_0xc7a1('0x37')]['fields']));_0x547e72['attributes']=_0x547e72[_0xc7a1('0x3a')]['length']?_0x547e72[_0xc7a1('0x3a')]:_0x572c84[_0xc7a1('0x36')];_0x547e72['order']=qs[_0xc7a1('0x3f')](_0x89fa66['query']['sort']);_0x547e72['where']=qs[_0xc7a1('0x39')](_['pick'](_0x89fa66[_0xc7a1('0x37')],_0x572c84['filters']));if(_0x89fa66['query'][_0xc7a1('0x41')]){_0x547e72[_0xc7a1('0x43')]=_[_0xc7a1('0x42')](_0x547e72['where'],{'$or':_[_0xc7a1('0x33')](_0x547e72[_0xc7a1('0x3a')],function(_0x2dd93b){var _0x29642f={};_0x29642f[_0x2dd93b]={'$like':'%'+_0x89fa66['query']['filter']+'%'};return _0x29642f;})});}_0x547e72=_[_0xc7a1('0x42')]({},_0x547e72,_0x89fa66[_0xc7a1('0x44')]);return _0x105e34[_0xc7a1('0x69')](_0x547e72);}})[_0xc7a1('0x2a')](function(_0x238c36){if(_0x238c36){_0x243733=_0x238c36[_0xc7a1('0x3c')];if(!_0x89fa66[_0xc7a1('0x37')][_0xc7a1('0x3d')](_0xc7a1('0x5b'))){_0x547e72['limit']=qs[_0xc7a1('0x25')](_0x89fa66[_0xc7a1('0x37')][_0xc7a1('0x25')]);_0x547e72['offset']=qs[_0xc7a1('0x22')](_0x89fa66[_0xc7a1('0x37')][_0xc7a1('0x22')]);}return _0x105e34[_0xc7a1('0x69')](_0x547e72);}})['then'](function(_0x188d91){if(_0x188d91){return _0x188d91?{'count':_0x243733,'rows':_0x188d91}:null;}})[_0xc7a1('0x2a')](respondWithResult(_0x542ee6,null))[_0xc7a1('0x49')](handleError(_0x542ee6,null));};exports[_0xc7a1('0x6a')]=function(_0x39c30e,_0x1e74c5,_0x44a94a){var _0x38e10a=_0x39c30e[_0xc7a1('0x4d')][_0xc7a1('0x6b')];return db['Team'][_0xc7a1('0x48')]({'where':{'id':_0x38e10a},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xc7a1('0x30'),_0xc7a1('0x6c'),_0xc7a1('0x6d'),_0xc7a1('0x6e')],'raw':!![]}]})[_0xc7a1('0x2a')](function(_0x4c0b82){if(_0x4c0b82){var _0x1a8400=_['flatMap'](_0x4c0b82,function(_0x2ade5e){var _0x1fcbc1=_0x2ade5e[_0xc7a1('0x4f')]({'plain':!![]});return _0x1fcbc1['Agents'];});return db[_0xc7a1('0x45')][_0xc7a1('0x55')]({'where':{'id':_0x39c30e['params']['id']}})[_0xc7a1('0x2a')](function(_0x5b26f4){return db['sequelize'][_0xc7a1('0x6f')](function(_0x4b6c62){return _0x5b26f4['addTeams'](_0x38e10a,{'transaction':_0x4b6c62})[_0xc7a1('0x2a')](function(){return BPromise[_0xc7a1('0x70')](_0x1a8400,function(_0x113cc0){return db[_0xc7a1('0x5a')][_0xc7a1('0x71')]({'where':{'UserId':_0x113cc0['id'],'WhatsappQueueId':_0x39c30e['params']['id']},'transaction':_0x4b6c62});});})[_0xc7a1('0x2a')](function(){_0x1a8400['forEach'](function(_0x30beee){socket['emit'](_0xc7a1('0x72'),{'UserId':_0x30beee['id'],'WhatsappQueueId':_0x5b26f4['id']});});});});});}})[_0xc7a1('0x2a')](respondWithStatusCode(_0x1e74c5,null))[_0xc7a1('0x49')](handleError(_0x1e74c5,null));};exports[_0xc7a1('0x73')]=function(_0x3bda0b,_0xfe8f5c,_0x105d9e){return db['Team'][_0xc7a1('0x48')]({'where':{'id':_0x3bda0b['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xc7a1('0x5d')],'as':_0xc7a1('0x74'),'attributes':['id'],'raw':!![]}]})[_0xc7a1('0x2a')](handleEntityNotFound(_0xfe8f5c,null))[_0xc7a1('0x2a')](function(_0x4c7183){var _0x2febdb=_['map'](_0x4c7183,'id');var _0x254d11=[];var _0x3079d4=[];var _0x5f4fe2=squel['select']();_0x5f4fe2[_0xc7a1('0x75')](_0xc7a1('0x76'))['from'](_0xc7a1('0x77'),'tq')[_0xc7a1('0x78')]('user_has_teams','ut',_0xc7a1('0x79'))[_0xc7a1('0x43')](_0xc7a1('0x7a'),_0x3bda0b[_0xc7a1('0x56')]['id']);for(var _0x5e3a31=0x0;_0x5e3a31<_0x4c7183[_0xc7a1('0x3c')];_0x5e3a31+=0x1){let _0x2db624=_0x4c7183[_0x5e3a31];for(var _0x5d51ab=0x0;_0x5d51ab<_0x2db624[_0xc7a1('0x74')]['length'];_0x5d51ab+=0x1){let _0x4b428d=_0x2db624[_0xc7a1('0x74')][_0x5d51ab];var _0x1d063f=_0x5f4fe2[_0xc7a1('0x7b')]();_0x1d063f[_0xc7a1('0x43')](_0xc7a1('0x7c'),_0x4b428d['id']);_0x3079d4[_0xc7a1('0x7d')](db[_0xc7a1('0x7e')][_0xc7a1('0x37')](_0x1d063f[_0xc7a1('0x7f')](),{'type':db[_0xc7a1('0x7e')][_0xc7a1('0x80')][_0xc7a1('0x81')]})[_0xc7a1('0x2a')](function(_0x4eef78){if(_0x4eef78[_0xc7a1('0x3c')]===0x1){return _0x4b428d['id'];}else{var _0x35a64c=_[_0xc7a1('0x82')](_[_0xc7a1('0x33')](_0x4eef78,_0xc7a1('0x83')),function(_0x3d33d9){return _[_0xc7a1('0x84')](_0x2febdb,_0x3d33d9);});if(_0x35a64c){return _0x4b428d['id'];}}}));}}return BPromise['all'](_0x3079d4)[_0xc7a1('0x2a')](function(_0x547e32){_0x254d11=_(_0x254d11)['union'](_0x547e32)[_0xc7a1('0x85')]()[_0xc7a1('0x86')]();return db[_0xc7a1('0x45')][_0xc7a1('0x55')]({'where':{'id':_0x3bda0b[_0xc7a1('0x56')]['id']}})[_0xc7a1('0x2a')](function(_0x13ade2){return db[_0xc7a1('0x7e')]['transaction'](function(_0x291450){return _0x13ade2['removeTeams'](_0x3bda0b[_0xc7a1('0x37')]['ids'],{'transaction':_0x291450})['then'](function(){if(!_[_0xc7a1('0x87')](_0x254d11)){return _0x13ade2[_0xc7a1('0x88')](_0x254d11,{'transaction':_0x291450});}})['then'](function(){_0x254d11[_0xc7a1('0x89')](function(_0x3294a6){socket[_0xc7a1('0x8a')]('userWhatsappQueue:remove',{'UserId':_0x3294a6,'WhatsappQueueId':_0x13ade2['id']});});});});});});})['then'](respondWithStatusCode(_0xfe8f5c,null))[_0xc7a1('0x49')](handleError(_0xfe8f5c,null));};exports['addAgents']=function(_0x59c7b8,_0x3a64f6,_0x20ac95){return db[_0xc7a1('0x45')]['find']({'where':{'id':_0x59c7b8[_0xc7a1('0x56')]['id']}})[_0xc7a1('0x2a')](handleEntityNotFound(_0x3a64f6,null))[_0xc7a1('0x2a')](function(_0x7d48b2){if(_0x7d48b2){return _0x7d48b2['addAgents'](_0x59c7b8[_0xc7a1('0x4d')][_0xc7a1('0x6b')],_[_0xc7a1('0x8b')](_0x59c7b8[_0xc7a1('0x4d')],[_0xc7a1('0x6b'),'id'])||{})[_0xc7a1('0x8c')](function(_0x50737f){for(var _0x304787=0x0;_0x304787<_0x59c7b8[_0xc7a1('0x4d')]['ids'][_0xc7a1('0x3c')];_0x304787+=0x1){socket['emit'](_0xc7a1('0x72'),{'UserId':Number(_0x59c7b8[_0xc7a1('0x4d')][_0xc7a1('0x6b')][_0x304787]),'WhatsappQueueId':Number(_0x59c7b8[_0xc7a1('0x56')]['id'])});}return _0x50737f;});}})[_0xc7a1('0x2a')](respondWithResult(_0x3a64f6,null))[_0xc7a1('0x49')](handleError(_0x3a64f6,null));};exports['removeAgents']=function(_0x1816dc,_0x5ea150,_0x2c398d){return db[_0xc7a1('0x45')][_0xc7a1('0x55')]({'where':{'id':_0x1816dc['params']['id']}})[_0xc7a1('0x2a')](handleEntityNotFound(_0x5ea150,null))[_0xc7a1('0x2a')](function(_0x45c5f2){if(_0x45c5f2){return _0x45c5f2[_0xc7a1('0x88')](_0x1816dc[_0xc7a1('0x37')][_0xc7a1('0x6b')])['then'](function(){if(_[_0xc7a1('0x8d')](_0x1816dc[_0xc7a1('0x37')][_0xc7a1('0x6b')])){for(var _0x137c0a=0x0;_0x137c0a<_0x1816dc[_0xc7a1('0x37')][_0xc7a1('0x6b')][_0xc7a1('0x3c')];_0x137c0a+=0x1){socket[_0xc7a1('0x8a')](_0xc7a1('0x8e'),{'UserId':Number(_0x1816dc['query']['ids'][_0x137c0a]),'WhatsappQueueId':Number(_0x1816dc['params']['id'])});}}else{socket[_0xc7a1('0x8a')](_0xc7a1('0x8e'),{'UserId':Number(_0x1816dc[_0xc7a1('0x37')][_0xc7a1('0x6b')]),'WhatsappQueueId':Number(_0x1816dc[_0xc7a1('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x5ea150,null))[_0xc7a1('0x49')](handleError(_0x5ea150,null));};exports[_0xc7a1('0x8f')]=function(_0x4123fd,_0x3bba7,_0x5c0a54){var _0x2d02db={};var _0x5ac186={};var _0x37b821;var _0x40fa29;return db[_0xc7a1('0x45')][_0xc7a1('0x59')]({'where':{'id':_0x4123fd['params']['id']}})[_0xc7a1('0x2a')](handleEntityNotFound(_0x3bba7,null))['then'](function(_0x327379){if(_0x327379){_0x37b821=_0x327379;_0x5ac186[_0xc7a1('0x36')]=_['keys'](db[_0xc7a1('0x5d')]['rawAttributes']);_0x5ac186[_0xc7a1('0x37')]=_[_0xc7a1('0x38')](_0x4123fd[_0xc7a1('0x37')]);_0x5ac186[_0xc7a1('0x39')]=_[_0xc7a1('0x4b')](_0x5ac186['model'],_0x5ac186[_0xc7a1('0x37')]);_0x2d02db[_0xc7a1('0x3a')]=_[_0xc7a1('0x4b')](_0x5ac186[_0xc7a1('0x36')],qs[_0xc7a1('0x3b')](_0x4123fd[_0xc7a1('0x37')][_0xc7a1('0x3b')]));_0x2d02db['attributes']=_0x2d02db[_0xc7a1('0x3a')]['length']?_0x2d02db[_0xc7a1('0x3a')]:_0x5ac186[_0xc7a1('0x36')];_0x2d02db[_0xc7a1('0x3e')]=qs[_0xc7a1('0x3f')](_0x4123fd[_0xc7a1('0x37')][_0xc7a1('0x3f')]);_0x2d02db[_0xc7a1('0x43')]=qs[_0xc7a1('0x39')](_['pick'](_0x4123fd[_0xc7a1('0x37')],_0x5ac186[_0xc7a1('0x39')]));if(_0x4123fd[_0xc7a1('0x37')][_0xc7a1('0x41')]){_0x2d02db['where']=_[_0xc7a1('0x42')](_0x2d02db[_0xc7a1('0x43')],{'$or':_[_0xc7a1('0x33')](_0x2d02db['attributes'],function(_0x212a9d){var _0x274a1d={};_0x274a1d[_0x212a9d]={'$like':'%'+_0x4123fd['query'][_0xc7a1('0x41')]+'%'};return _0x274a1d;})});}_0x2d02db=_['merge']({},_0x2d02db,_0x4123fd[_0xc7a1('0x44')]);return _0x37b821[_0xc7a1('0x8f')](_0x2d02db);}})[_0xc7a1('0x2a')](function(_0xfb7957){if(_0xfb7957){_0x40fa29=_0xfb7957[_0xc7a1('0x3c')];if(!_0x4123fd[_0xc7a1('0x37')][_0xc7a1('0x3d')](_0xc7a1('0x5b'))){_0x2d02db[_0xc7a1('0x25')]=qs[_0xc7a1('0x25')](_0x4123fd[_0xc7a1('0x37')][_0xc7a1('0x25')]);_0x2d02db[_0xc7a1('0x22')]=qs['offset'](_0x4123fd[_0xc7a1('0x37')][_0xc7a1('0x22')]);}return _0x37b821[_0xc7a1('0x8f')](_0x2d02db);}})['then'](function(_0x25f98e){if(_0x25f98e){return _0x25f98e?{'count':_0x40fa29,'rows':_0x25f98e}:null;}})[_0xc7a1('0x2a')](respondWithResult(_0x3bba7,null))[_0xc7a1('0x49')](handleError(_0x3bba7,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 1b44116..3a254be 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 _0x50da=['save','update','emit','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x27e489,_0x4dbbcc){var _0x5b02df=function(_0x1d274a){while(--_0x1d274a){_0x27e489['push'](_0x27e489['shift']());}};_0x5b02df(++_0x4dbbcc);}(_0x50da,0xdd));var _0xa50d=function(_0xa83021,_0x41a4d6){_0xa83021=_0xa83021-0x0;var _0x13ee5b=_0x50da[_0xa83021];return _0x13ee5b;};'use strict';var EventEmitter=require(_0xa50d('0x0'));var WhatsappQueue=require(_0xa50d('0x1'))['db'][_0xa50d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa50d('0x3')](0x0);var events={'afterCreate':_0xa50d('0x4'),'afterUpdate':_0xa50d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x7a46ed){return function(_0x3ac0c9,_0x2f25d7,_0x116db2){WhatsappQueueEvents[_0xa50d('0x6')](_0x7a46ed+':'+_0x3ac0c9['id'],_0x3ac0c9);WhatsappQueueEvents[_0xa50d('0x6')](_0x7a46ed,_0x3ac0c9);_0x116db2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xa50d('0x7')](e,emitEvent(event));}}module[_0xa50d('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xc0a2=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x92a11,_0x22e3cc){var _0x17466a=function(_0x52e2a1){while(--_0x52e2a1){_0x92a11['push'](_0x92a11['shift']());}};_0x17466a(++_0x22e3cc);}(_0xc0a2,0x9c));var _0x2c0a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0a2[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x2c0a('0x0'));var WhatsappQueue=require(_0x2c0a('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2c0a('0x2')](0x0);var events={'afterCreate':_0x2c0a('0x3'),'afterUpdate':'update','afterDestroy':_0x2c0a('0x4')};function emitEvent(_0x4aec85){return function(_0x4e1f76,_0x51111f,_0x3bfd35){WhatsappQueueEvents['emit'](_0x4aec85+':'+_0x4e1f76['id'],_0x4e1f76);WhatsappQueueEvents[_0x2c0a('0x5')](_0x4aec85,_0x4e1f76);_0x3bfd35(null);};}for(var e in events){if(events[_0x2c0a('0x6')](e)){var event=events[e];WhatsappQueue[_0x2c0a('0x7')](e,emitEvent(event));}}module[_0x2c0a('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 33ab538..8bcd78a 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 _0x10ce=['./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cb990,_0x38831c){var _0x353fd2=function(_0x31c410){while(--_0x31c410){_0x5cb990['push'](_0x5cb990['shift']());}};_0x353fd2(++_0x38831c);}(_0x10ce,0x119));var _0xe10c=function(_0x3ac368,_0x214547){_0x3ac368=_0x3ac368-0x0;var _0x51e3e6=_0x10ce[_0x3ac368];return _0x51e3e6;};'use strict';var _=require(_0xe10c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe10c('0x1'));var moment=require('moment');var BPromise=require(_0xe10c('0x2'));var rp=require(_0xe10c('0x3'));var fs=require('fs');var path=require(_0xe10c('0x4'));var rimraf=require(_0xe10c('0x5'));var config=require(_0xe10c('0x6'));var attributes=require(_0xe10c('0x7'));module[_0xe10c('0x8')]=function(_0x3287d9,_0x301b5a){return _0x3287d9[_0xe10c('0x9')](_0xe10c('0xa'),attributes,{'tableName':_0xe10c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x672d=['exports','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x4b9078,_0x222e7f){var _0x3cf2ca=function(_0xf3ae89){while(--_0xf3ae89){_0x4b9078['push'](_0x4b9078['shift']());}};_0x3cf2ca(++_0x222e7f);}(_0x672d,0x8f));var _0xd672=function(_0x501bfd,_0x36d196){_0x501bfd=_0x501bfd-0x0;var _0x3cb897=_0x672d[_0x501bfd];return _0x3cb897;};'use strict';var _=require(_0xd672('0x0'));var util=require(_0xd672('0x1'));var logger=require(_0xd672('0x2'))(_0xd672('0x3'));var moment=require(_0xd672('0x4'));var BPromise=require(_0xd672('0x5'));var rp=require(_0xd672('0x6'));var fs=require('fs');var path=require(_0xd672('0x7'));var rimraf=require(_0xd672('0x8'));var config=require(_0xd672('0x9'));var attributes=require(_0xd672('0xa'));module[_0xd672('0xb')]=function(_0x4200f4,_0x472716){return _0x4200f4['define'](_0xd672('0xc'),attributes,{'tableName':_0xd672('0xd'),'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 5ee158e..4945341 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 _0x9392=['redis','localhost','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','map','include','model','catch','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x1a3341,_0x29a541){var _0x40b759=function(_0x44f4f9){while(--_0x44f4f9){_0x1a3341['push'](_0x1a3341['shift']());}};_0x40b759(++_0x29a541);}(_0x9392,0x17a));var _0x2939=function(_0x5a7770,_0x120756){_0x5a7770=_0x5a7770-0x0;var _0x20d168=_0x9392[_0x5a7770];return _0x20d168;};'use strict';var _=require(_0x2939('0x0'));var util=require(_0x2939('0x1'));var moment=require(_0x2939('0x2'));var BPromise=require(_0x2939('0x3'));var rs=require(_0x2939('0x4'));var fs=require('fs');var Redis=require(_0x2939('0x5'));var db=require(_0x2939('0x6'))['db'];var utils=require(_0x2939('0x7'));var logger=require('../../config/logger')(_0x2939('0x8'));var config=require(_0x2939('0x9'));var jayson=require(_0x2939('0xa'));var client=jayson['client'][_0x2939('0xb')]({'port':0x232a});config[_0x2939('0xc')]=_['defaults'](config[_0x2939('0xc')],{'host':_0x2939('0xd'),'port':0x18eb});var socket=require(_0x2939('0xe'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x2939('0xf')](socket);function respondWithRpcPromise(_0x2228d0,_0x2515d2,_0x5da855){return new BPromise(function(_0x1d7b3b,_0x256ec8){return client[_0x2939('0x10')](_0x2228d0,_0x5da855)[_0x2939('0x11')](function(_0x3eff5d){logger[_0x2939('0x12')](_0x2939('0x13'),_0x2515d2,'request\x20sent');logger[_0x2939('0x14')](_0x2939('0x15'),_0x2515d2,_0x2939('0x16'),JSON[_0x2939('0x17')](_0x3eff5d));if(_0x3eff5d[_0x2939('0x18')]){if(_0x3eff5d['error']['code']===0x1f4){logger[_0x2939('0x18')](_0x2939('0x13'),_0x2515d2,_0x3eff5d[_0x2939('0x18')][_0x2939('0x19')]);return _0x256ec8(_0x3eff5d['error'][_0x2939('0x19')]);}logger[_0x2939('0x18')](_0x2939('0x13'),_0x2515d2,_0x3eff5d[_0x2939('0x18')][_0x2939('0x19')]);return _0x1d7b3b(_0x3eff5d[_0x2939('0x18')][_0x2939('0x19')]);}else{logger[_0x2939('0x12')](_0x2939('0x13'),_0x2515d2,_0x2939('0x16'));_0x1d7b3b(_0x3eff5d[_0x2939('0x1a')][_0x2939('0x19')]);}})['catch'](function(_0x3f9b5e){logger['error'](_0x2939('0x13'),_0x2515d2,_0x3f9b5e);_0x256ec8(_0x3f9b5e);});});}exports[_0x2939('0x1b')]=function(_0x725bde){var _0x5e5cab=this;return new Promise(function(_0x45c28c,_0x42ac76){return db[_0x2939('0x1c')][_0x2939('0x1d')]({'raw':_0x725bde[_0x2939('0x1e')]?_0x725bde[_0x2939('0x1e')][_0x2939('0x1f')]===undefined?!![]:![]:!![],'where':_0x725bde['options']?_0x725bde[_0x2939('0x1e')][_0x2939('0x20')]||null:null,'attributes':_0x725bde[_0x2939('0x1e')]?_0x725bde[_0x2939('0x1e')][_0x2939('0x21')]||null:null,'limit':_0x725bde[_0x2939('0x1e')]?_0x725bde[_0x2939('0x1e')]['limit']||null:null,'include':_0x725bde[_0x2939('0x1e')]?_0x725bde[_0x2939('0x1e')]['include']?_[_0x2939('0x22')](_0x725bde['options'][_0x2939('0x23')],function(_0x6b5ac1){return{'model':db[_0x6b5ac1[_0x2939('0x24')]],'as':_0x6b5ac1['as'],'attributes':_0x6b5ac1[_0x2939('0x21')],'include':_0x6b5ac1[_0x2939('0x23')]?_[_0x2939('0x22')](_0x6b5ac1[_0x2939('0x23')],function(_0x229f92){return{'model':db[_0x229f92['model']],'as':_0x229f92['as'],'attributes':_0x229f92[_0x2939('0x21')],'include':_0x229f92[_0x2939('0x23')]?_['map'](_0x229f92['include'],function(_0x541acb){return{'model':db[_0x541acb[_0x2939('0x24')]],'as':_0x541acb['as'],'attributes':_0x541acb['attributes']};}):[]};}):[]};}):[]:[]})[_0x2939('0x11')](function(_0x5a5d5b){logger[_0x2939('0x12')](_0x2939('0x1b'),_0x725bde);logger[_0x2939('0x14')]('GetWhatsappQueue',_0x725bde,JSON[_0x2939('0x17')](_0x5a5d5b));_0x45c28c(_0x5a5d5b);})[_0x2939('0x25')](function(_0x17a157){logger[_0x2939('0x18')](_0x2939('0x1b'),_0x17a157[_0x2939('0x19')],_0x725bde);_0x42ac76(_0x5e5cab[_0x2939('0x18')](0x1f4,_0x17a157['message']));});});};exports[_0x2939('0x26')]=function(_0x45c9c1){var _0x162561=this;return new Promise(function(_0x37a173,_0xd01524){return db[_0x2939('0x1c')]['find']({'raw':_0x45c9c1['options']?_0x45c9c1[_0x2939('0x1e')][_0x2939('0x1f')]===undefined?!![]:![]:!![],'where':_0x45c9c1[_0x2939('0x1e')]?_0x45c9c1['options'][_0x2939('0x20')]||null:null,'attributes':_0x45c9c1[_0x2939('0x1e')]?_0x45c9c1[_0x2939('0x1e')]['attributes']||null:null,'include':_0x45c9c1[_0x2939('0x1e')]?_0x45c9c1[_0x2939('0x1e')][_0x2939('0x23')]?_[_0x2939('0x22')](_0x45c9c1[_0x2939('0x1e')][_0x2939('0x23')],function(_0x367586){return{'model':db[_0x367586[_0x2939('0x24')]],'as':_0x367586['as'],'attributes':_0x367586[_0x2939('0x21')],'include':_0x367586['include']?_[_0x2939('0x22')](_0x367586['include'],function(_0x1d12a9){return{'model':db[_0x1d12a9[_0x2939('0x24')]],'as':_0x1d12a9['as'],'attributes':_0x1d12a9[_0x2939('0x21')],'include':_0x1d12a9[_0x2939('0x23')]?_[_0x2939('0x22')](_0x1d12a9[_0x2939('0x23')],function(_0x573bcb){return{'model':db[_0x573bcb['model']],'as':_0x573bcb['as'],'attributes':_0x573bcb[_0x2939('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2939('0x11')](function(_0x53c260){logger[_0x2939('0x12')](_0x2939('0x26'),_0x45c9c1);logger[_0x2939('0x14')](_0x2939('0x26'),_0x45c9c1,JSON[_0x2939('0x17')](_0x53c260));_0x37a173(_0x53c260);})['catch'](function(_0x25ece0){logger[_0x2939('0x18')](_0x2939('0x26'),_0x25ece0[_0x2939('0x19')],_0x45c9c1);_0xd01524(_0x162561[_0x2939('0x18')](0x1f4,_0x25ece0[_0x2939('0x19')]));});});}; \ No newline at end of file +var _0x176c=['include','map','attributes','model','ShowWhatsappQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where'];(function(_0x38db39,_0x1e7d63){var _0x381ea5=function(_0xa1a7a2){while(--_0xa1a7a2){_0x38db39['push'](_0x38db39['shift']());}};_0x381ea5(++_0x1e7d63);}(_0x176c,0x78));var _0xc176=function(_0x4b9015,_0x3aaa6f){_0x4b9015=_0x4b9015-0x0;var _0x189bd8=_0x176c[_0x4b9015];return _0x189bd8;};'use strict';var _=require(_0xc176('0x0'));var util=require(_0xc176('0x1'));var moment=require('moment');var BPromise=require(_0xc176('0x2'));var rs=require(_0xc176('0x3'));var fs=require('fs');var Redis=require(_0xc176('0x4'));var db=require(_0xc176('0x5'))['db'];var utils=require(_0xc176('0x6'));var logger=require(_0xc176('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc176('0x8')][_0xc176('0x9')]({'port':0x232a});config[_0xc176('0xa')]=_[_0xc176('0xb')](config[_0xc176('0xa')],{'host':_0xc176('0xc'),'port':0x18eb});var socket=require(_0xc176('0xd'))(new Redis(config[_0xc176('0xa')]));require(_0xc176('0xe'))[_0xc176('0xf')](socket);function respondWithRpcPromise(_0x2c9afd,_0x40c68f,_0x557e54){return new BPromise(function(_0x3c8d2c,_0x5e07df){return client['request'](_0x2c9afd,_0x557e54)[_0xc176('0x10')](function(_0x26d5a5){logger['info'](_0xc176('0x11'),_0x40c68f,_0xc176('0x12'));logger[_0xc176('0x13')](_0xc176('0x14'),_0x40c68f,_0xc176('0x12'),JSON[_0xc176('0x15')](_0x26d5a5));if(_0x26d5a5['error']){if(_0x26d5a5['error'][_0xc176('0x16')]===0x1f4){logger[_0xc176('0x17')](_0xc176('0x11'),_0x40c68f,_0x26d5a5[_0xc176('0x17')][_0xc176('0x18')]);return _0x5e07df(_0x26d5a5[_0xc176('0x17')][_0xc176('0x18')]);}logger[_0xc176('0x17')](_0xc176('0x11'),_0x40c68f,_0x26d5a5[_0xc176('0x17')][_0xc176('0x18')]);return _0x3c8d2c(_0x26d5a5[_0xc176('0x17')]['message']);}else{logger[_0xc176('0x19')](_0xc176('0x11'),_0x40c68f,'request\x20sent');_0x3c8d2c(_0x26d5a5['result'][_0xc176('0x18')]);}})[_0xc176('0x1a')](function(_0x55934f){logger['error'](_0xc176('0x11'),_0x40c68f,_0x55934f);_0x5e07df(_0x55934f);});});}exports[_0xc176('0x1b')]=function(_0x416da3){var _0x308d13=this;return new Promise(function(_0x3a804b,_0x36306b){return db[_0xc176('0x1c')]['findAll']({'raw':_0x416da3['options']?_0x416da3[_0xc176('0x1d')][_0xc176('0x1e')]===undefined?!![]:![]:!![],'where':_0x416da3[_0xc176('0x1d')]?_0x416da3['options'][_0xc176('0x1f')]||null:null,'attributes':_0x416da3[_0xc176('0x1d')]?_0x416da3[_0xc176('0x1d')]['attributes']||null:null,'limit':_0x416da3[_0xc176('0x1d')]?_0x416da3[_0xc176('0x1d')]['limit']||null:null,'include':_0x416da3[_0xc176('0x1d')]?_0x416da3['options'][_0xc176('0x20')]?_[_0xc176('0x21')](_0x416da3[_0xc176('0x1d')][_0xc176('0x20')],function(_0x2d7896){return{'model':db[_0x2d7896['model']],'as':_0x2d7896['as'],'attributes':_0x2d7896[_0xc176('0x22')],'include':_0x2d7896[_0xc176('0x20')]?_[_0xc176('0x21')](_0x2d7896[_0xc176('0x20')],function(_0x49c139){return{'model':db[_0x49c139['model']],'as':_0x49c139['as'],'attributes':_0x49c139[_0xc176('0x22')],'include':_0x49c139['include']?_[_0xc176('0x21')](_0x49c139[_0xc176('0x20')],function(_0x138a76){return{'model':db[_0x138a76[_0xc176('0x23')]],'as':_0x138a76['as'],'attributes':_0x138a76['attributes']};}):[]};}):[]};}):[]:[]})[_0xc176('0x10')](function(_0x4b3f8e){logger[_0xc176('0x19')](_0xc176('0x1b'),_0x416da3);logger[_0xc176('0x13')]('GetWhatsappQueue',_0x416da3,JSON[_0xc176('0x15')](_0x4b3f8e));_0x3a804b(_0x4b3f8e);})['catch'](function(_0x354b8e){logger[_0xc176('0x17')](_0xc176('0x1b'),_0x354b8e[_0xc176('0x18')],_0x416da3);_0x36306b(_0x308d13[_0xc176('0x17')](0x1f4,_0x354b8e[_0xc176('0x18')]));});});};exports[_0xc176('0x24')]=function(_0xa55bf1){var _0x5c4e82=this;return new Promise(function(_0x16c2be,_0x324442){return db[_0xc176('0x1c')][_0xc176('0x25')]({'raw':_0xa55bf1['options']?_0xa55bf1[_0xc176('0x1d')][_0xc176('0x1e')]===undefined?!![]:![]:!![],'where':_0xa55bf1['options']?_0xa55bf1[_0xc176('0x1d')][_0xc176('0x1f')]||null:null,'attributes':_0xa55bf1[_0xc176('0x1d')]?_0xa55bf1[_0xc176('0x1d')][_0xc176('0x22')]||null:null,'include':_0xa55bf1['options']?_0xa55bf1['options'][_0xc176('0x20')]?_[_0xc176('0x21')](_0xa55bf1[_0xc176('0x1d')][_0xc176('0x20')],function(_0x5adf9a){return{'model':db[_0x5adf9a[_0xc176('0x23')]],'as':_0x5adf9a['as'],'attributes':_0x5adf9a[_0xc176('0x22')],'include':_0x5adf9a[_0xc176('0x20')]?_[_0xc176('0x21')](_0x5adf9a[_0xc176('0x20')],function(_0x1ecba4){return{'model':db[_0x1ecba4[_0xc176('0x23')]],'as':_0x1ecba4['as'],'attributes':_0x1ecba4[_0xc176('0x22')],'include':_0x1ecba4['include']?_[_0xc176('0x21')](_0x1ecba4[_0xc176('0x20')],function(_0x471c49){return{'model':db[_0x471c49[_0xc176('0x23')]],'as':_0x471c49['as'],'attributes':_0x471c49['attributes']};}):[]};}):[]};}):[]:[]})[_0xc176('0x10')](function(_0xa89f14){logger[_0xc176('0x19')]('ShowWhatsappQueue',_0xa55bf1);logger[_0xc176('0x13')](_0xc176('0x24'),_0xa55bf1,JSON[_0xc176('0x15')](_0xa89f14));_0x16c2be(_0xa89f14);})[_0xc176('0x1a')](function(_0x26a366){logger['error'](_0xc176('0x24'),_0x26a366[_0xc176('0x18')],_0xa55bf1);_0x324442(_0x5c4e82[_0xc176('0x17')](0x1f4,_0x26a366['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 4d7905a..2bfc116 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 _0x3a2f=['./whatsappQueue.events','save','remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x3f8684,_0x1d1801){var _0x442c7e=function(_0x4c6e87){while(--_0x4c6e87){_0x3f8684['push'](_0x3f8684['shift']());}};_0x442c7e(++_0x1d1801);}(_0x3a2f,0x1dd));var _0xf3a2=function(_0x4be84d,_0x501ea2){_0x4be84d=_0x4be84d-0x0;var _0x262043=_0x3a2f[_0x4be84d];return _0x262043;};'use strict';var WhatsappQueueEvents=require(_0xf3a2('0x0'));var events=[_0xf3a2('0x1'),_0xf3a2('0x2'),_0xf3a2('0x3')];function createListener(_0x834358,_0x236e4b){return function(_0x39a3c5){_0x236e4b[_0xf3a2('0x4')](_0x834358,_0x39a3c5);};}function removeListener(_0x17b1a3,_0x384e93){return function(){WhatsappQueueEvents[_0xf3a2('0x5')](_0x17b1a3,_0x384e93);};}exports[_0xf3a2('0x6')]=function(_0x4d430a){for(var _0x9c109e=0x0,_0x544dba=events[_0xf3a2('0x7')];_0x9c109e<_0x544dba;_0x9c109e++){var _0x42564a=events[_0x9c109e];var _0x35bfc9=createListener(_0xf3a2('0x8')+_0x42564a,_0x4d430a);WhatsappQueueEvents['on'](_0x42564a,_0x35bfc9);}}; \ No newline at end of file +var _0x9d08=['remove','update','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0xf0aea8,_0x5a443f){var _0x594c8f=function(_0x89e017){while(--_0x89e017){_0xf0aea8['push'](_0xf0aea8['shift']());}};_0x594c8f(++_0x5a443f);}(_0x9d08,0xde));var _0x89d0=function(_0x3732f7,_0x43261a){_0x3732f7=_0x3732f7-0x0;var _0x43f200=_0x9d08[_0x3732f7];return _0x43f200;};'use strict';var WhatsappQueueEvents=require(_0x89d0('0x0'));var events=[_0x89d0('0x1'),_0x89d0('0x2'),_0x89d0('0x3')];function createListener(_0x2663fd,_0xdac4b5){return function(_0x21d001){_0xdac4b5['emit'](_0x2663fd,_0x21d001);};}function removeListener(_0x1c66a7,_0x3b4f9b){return function(){WhatsappQueueEvents['removeListener'](_0x1c66a7,_0x3b4f9b);};}exports[_0x89d0('0x4')]=function(_0x3a125d){for(var _0x154b70=0x0,_0x1f44c8=events[_0x89d0('0x5')];_0x154b70<_0x1f44c8;_0x154b70++){var _0x26420d=events[_0x154b70];var _0x24880d=createListener(_0x89d0('0x6')+_0x26420d,_0x3a125d);WhatsappQueueEvents['on'](_0x26420d,_0x24880d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index b184d2d..e287d49 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 _0x9150=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','destroy','util','connect-timeout'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9150,0xee));var _0x0915=function(_0x3203e9,_0x5bacc3){_0x3203e9=_0x3203e9-0x0;var _0x5c9fca=_0x9150[_0x3203e9];return _0x5c9fca;};'use strict';var multer=require('multer');var util=require(_0x0915('0x0'));var path=require('path');var timeout=require(_0x0915('0x1'));var express=require(_0x0915('0x2'));var router=express[_0x0915('0x3')]();var fs_extra=require(_0x0915('0x4'));var auth=require(_0x0915('0x5'));var interaction=require(_0x0915('0x6'));var config=require(_0x0915('0x7'));var controller=require(_0x0915('0x8'));router[_0x0915('0x9')]('/',auth[_0x0915('0xa')](),controller[_0x0915('0xb')]);router[_0x0915('0x9')]('/describe',auth[_0x0915('0xa')](),controller[_0x0915('0xc')]);router[_0x0915('0x9')]('/:id',auth[_0x0915('0xa')](),controller[_0x0915('0xd')]);router['post']('/',auth[_0x0915('0xa')](),controller[_0x0915('0xe')]);router[_0x0915('0xf')](_0x0915('0x10'),auth['isAuthenticated'](),controller[_0x0915('0x11')]);router[_0x0915('0x12')](_0x0915('0x10'),auth[_0x0915('0xa')](),controller[_0x0915('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd871=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0xd871,0x19e));var _0x1d87=function(_0x18bd81,_0x1e4f95){_0x18bd81=_0x18bd81-0x0;var _0x504bdb=_0xd871[_0x18bd81];return _0x504bdb;};'use strict';var multer=require(_0x1d87('0x0'));var util=require(_0x1d87('0x1'));var path=require(_0x1d87('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d87('0x3'));var router=express[_0x1d87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d87('0x5'));var interaction=require(_0x1d87('0x6'));var config=require(_0x1d87('0x7'));var controller=require(_0x1d87('0x8'));router[_0x1d87('0x9')]('/',auth[_0x1d87('0xa')](),controller[_0x1d87('0xb')]);router[_0x1d87('0x9')](_0x1d87('0xc'),auth[_0x1d87('0xa')](),controller[_0x1d87('0xd')]);router[_0x1d87('0x9')](_0x1d87('0xe'),auth['isAuthenticated'](),controller[_0x1d87('0xf')]);router['post']('/',auth[_0x1d87('0xa')](),controller['create']);router[_0x1d87('0x10')]('/:id',auth[_0x1d87('0xa')](),controller[_0x1d87('0x11')]);router[_0x1d87('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x1d87('0x13')]);module[_0x1d87('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index f534d34..f7d9b3b 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(_0x20c065,_0x5c3dcb){var _0x4bacdf=function(_0x199234){while(--_0x199234){_0x20c065['push'](_0x20c065['shift']());}};_0x4bacdf(++_0x5c3dcb);}(_0x7a54,0x106));var _0x47a5=function(_0x5e67b6,_0x23990c){_0x5e67b6=_0x5e67b6-0x0;var _0x49ae7a=_0x7a54[_0x5e67b6];return _0x49ae7a;};'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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4b1225,_0x37ba00){var _0x47dc07=function(_0x430e30){while(--_0x430e30){_0x4b1225['push'](_0x4b1225['shift']());}};_0x47dc07(++_0x37ba00);}(_0x7a54,0x106));var _0x47a5=function(_0x1a5513,_0x1710b2){_0x1a5513=_0x1a5513-0x0;var _0x217fc=_0x7a54[_0x1a5513];return _0x217fc;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index e268dee..ea4626f 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3c=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xcdc926,_0x39ebcd){var _0x4ad918=function(_0x601901){while(--_0x601901){_0xcdc926['push'](_0xcdc926['shift']());}};_0x4ad918(++_0x39ebcd);}(_0xed3c,0x1a6));var _0xced3=function(_0x5f0ea6,_0x4245c7){_0x5f0ea6=_0x5f0ea6-0x0;var _0x324271=_0xed3c[_0x5f0ea6];return _0x324271;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];function respondWithStatusCode(_0x42d879,_0x3b2ac4){_0x3b2ac4=_0x3b2ac4||0xcc;return function(_0x457caf){if(_0x457caf){return _0x42d879[_0xced3('0x16')](_0x3b2ac4);}return _0x42d879[_0xced3('0x17')](_0x3b2ac4)['end']();};}function respondWithResult(_0x65bb58,_0x5e186e){_0x5e186e=_0x5e186e||0xc8;return function(_0xf2db6f){if(_0xf2db6f){return _0x65bb58[_0xced3('0x17')](_0x5e186e)[_0xced3('0x18')](_0xf2db6f);}};}function respondWithFilteredResult(_0x39e4aa,_0x4dd4c3){return function(_0x146a21){if(_0x146a21){var _0x322c2d=typeof _0x4dd4c3['offset']===_0xced3('0x19')&&typeof _0x4dd4c3[_0xced3('0x1a')]===_0xced3('0x19');var _0x17f611=_0x146a21['count'];var _0x4569af=_0x322c2d?0x0:_0x4dd4c3['offset'];var _0x353580=_0x322c2d?_0x146a21[_0xced3('0x1b')]:_0x4dd4c3[_0xced3('0x1c')]+_0x4dd4c3[_0xced3('0x1a')];var _0x44143f;if(_0x353580>=_0x17f611){_0x353580=_0x17f611;_0x44143f=0xc8;}else{_0x44143f=0xce;}_0x39e4aa[_0xced3('0x17')](_0x44143f);return _0x39e4aa[_0xced3('0x1d')](_0xced3('0x1e'),_0x4569af+'-'+_0x353580+'/'+_0x17f611)[_0xced3('0x18')](_0x146a21);}return null;};}function patchUpdates(_0x17c011){return function(_0x2008f2){try{jsonpatch['apply'](_0x2008f2,_0x17c011,!![]);}catch(_0x5b8b1f){return BPromise['reject'](_0x5b8b1f);}return _0x2008f2[_0xced3('0x1f')]();};}function saveUpdates(_0x342b9e,_0x21e074){return function(_0x4bf915){if(_0x4bf915){return _0x4bf915[_0xced3('0x20')](_0x342b9e)[_0xced3('0x21')](function(_0x526854){return _0x526854;});}return null;};}function removeEntity(_0x559fa2,_0x3adf14){return function(_0x101708){if(_0x101708){return _0x101708[_0xced3('0x22')]()[_0xced3('0x21')](function(){_0x559fa2['status'](0xcc)[_0xced3('0x23')]();});}};}function handleEntityNotFound(_0x23f92b,_0x4fc285){return function(_0x3fb4f9){if(!_0x3fb4f9){_0x23f92b['sendStatus'](0x194);}return _0x3fb4f9;};}function handleError(_0x1dcc52,_0x4123ba){_0x4123ba=_0x4123ba||0x1f4;return function(_0x3b728d){logger[_0xced3('0x24')](_0x3b728d[_0xced3('0x25')]);if(_0x3b728d['name']){delete _0x3b728d['name'];}_0x1dcc52[_0xced3('0x17')](_0x4123ba)['send'](_0x3b728d);};}exports[_0xced3('0x26')]=function(_0x1e6923,_0x4a8e85){var _0x3db664={},_0x4024fa={},_0x196956={'count':0x0,'rows':[]};var _0x1032d6=_[_0xced3('0x27')](db[_0xced3('0x28')][_0xced3('0x29')],function(_0x41d003){return{'name':_0x41d003[_0xced3('0x2a')],'type':_0x41d003['type'][_0xced3('0x2b')]};});_0x4024fa[_0xced3('0x2c')]=_[_0xced3('0x27')](_0x1032d6,_0xced3('0x2d'));_0x4024fa[_0xced3('0x2e')]=_[_0xced3('0x2f')](_0x1e6923[_0xced3('0x2e')]);_0x4024fa[_0xced3('0x30')]=_[_0xced3('0x31')](_0x4024fa[_0xced3('0x2c')],_0x4024fa[_0xced3('0x2e')]);_0x3db664[_0xced3('0x32')]=_[_0xced3('0x31')](_0x4024fa[_0xced3('0x2c')],qs[_0xced3('0x33')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x33')]));_0x3db664[_0xced3('0x32')]=_0x3db664[_0xced3('0x32')][_0xced3('0x34')]?_0x3db664[_0xced3('0x32')]:_0x4024fa['model'];if(!_0x1e6923[_0xced3('0x2e')]['hasOwnProperty'](_0xced3('0x35'))){_0x3db664[_0xced3('0x1a')]=qs[_0xced3('0x1a')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x1a')]);_0x3db664[_0xced3('0x1c')]=qs[_0xced3('0x1c')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x1c')]);}_0x3db664[_0xced3('0x36')]=qs['sort'](_0x1e6923[_0xced3('0x2e')][_0xced3('0x37')]);_0x3db664['where']=qs[_0xced3('0x30')](_[_0xced3('0x38')](_0x1e6923[_0xced3('0x2e')],_0x4024fa['filters']),_0x1032d6);if(_0x1e6923['query'][_0xced3('0x39')]){_0x3db664['where']=_[_0xced3('0x3a')](_0x3db664[_0xced3('0x3b')],{'$or':_['map'](_0x1032d6,function(_0x180b65){if(_0x180b65[_0xced3('0x3c')]!==_0xced3('0x3d')){var _0x58b344={};_0x58b344[_0x180b65[_0xced3('0x2d')]]={'$like':'%'+_0x1e6923['query']['filter']+'%'};return _0x58b344;}})});}_0x3db664=_[_0xced3('0x3a')]({},_0x3db664,_0x1e6923[_0xced3('0x3e')]);var _0x217bff={'where':_0x3db664['where']};return db[_0xced3('0x28')][_0xced3('0x1b')](_0x217bff)[_0xced3('0x21')](function(_0x28626b){_0x196956[_0xced3('0x1b')]=_0x28626b;if(_0x1e6923[_0xced3('0x2e')][_0xced3('0x3f')]){_0x3db664[_0xced3('0x40')]=[{'all':!![]}];}return db[_0xced3('0x28')][_0xced3('0x41')](_0x3db664);})[_0xced3('0x21')](function(_0x38855f){_0x196956[_0xced3('0x42')]=_0x38855f;return _0x196956;})[_0xced3('0x21')](respondWithFilteredResult(_0x4a8e85,_0x3db664))[_0xced3('0x43')](handleError(_0x4a8e85,null));};exports['show']=function(_0x4279a3,_0x2ec0ad){var _0x44ff72={'raw':!![],'where':{'id':_0x4279a3[_0xced3('0x44')]['id']}},_0x1a6c1f={};_0x1a6c1f[_0xced3('0x2c')]=_[_0xced3('0x2f')](db[_0xced3('0x28')][_0xced3('0x29')]);_0x1a6c1f['query']=_[_0xced3('0x2f')](_0x4279a3['query']);_0x1a6c1f[_0xced3('0x30')]=_[_0xced3('0x31')](_0x1a6c1f[_0xced3('0x2c')],_0x1a6c1f['query']);_0x44ff72[_0xced3('0x32')]=_[_0xced3('0x31')](_0x1a6c1f[_0xced3('0x2c')],qs[_0xced3('0x33')](_0x4279a3['query'][_0xced3('0x33')]));_0x44ff72[_0xced3('0x32')]=_0x44ff72[_0xced3('0x32')][_0xced3('0x34')]?_0x44ff72[_0xced3('0x32')]:_0x1a6c1f['model'];if(_0x4279a3[_0xced3('0x2e')][_0xced3('0x3f')]){_0x44ff72[_0xced3('0x40')]=[{'all':!![]}];}_0x44ff72=_[_0xced3('0x3a')]({},_0x44ff72,_0x4279a3[_0xced3('0x3e')]);return db[_0xced3('0x28')][_0xced3('0x45')](_0x44ff72)['then'](handleEntityNotFound(_0x2ec0ad,null))[_0xced3('0x21')](respondWithResult(_0x2ec0ad,null))[_0xced3('0x43')](handleError(_0x2ec0ad,null));};exports['create']=function(_0x569c3d,_0x140df2){return db['WhatsappQueueReport'][_0xced3('0x46')](_0x569c3d[_0xced3('0x47')],{})[_0xced3('0x21')](respondWithResult(_0x140df2,0xc9))[_0xced3('0x43')](handleError(_0x140df2,null));};exports[_0xced3('0x20')]=function(_0x1b3396,_0x3700ed){if(_0x1b3396[_0xced3('0x47')]['id']){delete _0x1b3396[_0xced3('0x47')]['id'];}return db['WhatsappQueueReport'][_0xced3('0x45')]({'where':{'id':_0x1b3396[_0xced3('0x44')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x3700ed,null))[_0xced3('0x21')](saveUpdates(_0x1b3396[_0xced3('0x47')],null))[_0xced3('0x21')](respondWithResult(_0x3700ed,null))['catch'](handleError(_0x3700ed,null));};exports[_0xced3('0x22')]=function(_0x629ecf,_0x74f70){return db[_0xced3('0x28')][_0xced3('0x45')]({'where':{'id':_0x629ecf[_0xced3('0x44')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x74f70,null))[_0xced3('0x21')](removeEntity(_0x74f70,null))[_0xced3('0x43')](handleError(_0x74f70,null));};exports[_0xced3('0x48')]=function(_0x257ff0,_0x3e2a19){return db['WhatsappQueueReport'][_0xced3('0x48')]()['then'](respondWithResult(_0x3e2a19,null))[_0xced3('0x43')](handleError(_0x3e2a19,null));}; \ No newline at end of file +var _0xa5fa=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','includeAll','rows','catch','show','params','fields','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1c0b46,_0x39e4c1){var _0x48fe48=function(_0x55406d){while(--_0x55406d){_0x1c0b46['push'](_0x1c0b46['shift']());}};_0x48fe48(++_0x39e4c1);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x407dbd,_0x2dda7d){_0x407dbd=_0x407dbd-0x0;var _0x3fbce3=_0xa5fa[_0x407dbd];return _0x3fbce3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa5f('0x0'));var zipdir=require(_0xaa5f('0x1'));var jsonpatch=require(_0xaa5f('0x2'));var rp=require(_0xaa5f('0x3'));var moment=require('moment');var BPromise=require(_0xaa5f('0x4'));var Mustache=require(_0xaa5f('0x5'));var util=require('util');var path=require(_0xaa5f('0x6'));var sox=require(_0xaa5f('0x7'));var csv=require(_0xaa5f('0x8'));var ejs=require(_0xaa5f('0x9'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xa'));var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x8'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var licenseUtil=require(_0xaa5f('0x15'));var db=require(_0xaa5f('0x16'))['db'];function respondWithStatusCode(_0x9aeae9,_0x252ae0){_0x252ae0=_0x252ae0||0xcc;return function(_0x48d1d3){if(_0x48d1d3){return _0x9aeae9[_0xaa5f('0x17')](_0x252ae0);}return _0x9aeae9['status'](_0x252ae0)[_0xaa5f('0x18')]();};}function respondWithResult(_0x23f872,_0x31eabc){_0x31eabc=_0x31eabc||0xc8;return function(_0x19aa27){if(_0x19aa27){return _0x23f872[_0xaa5f('0x19')](_0x31eabc)['json'](_0x19aa27);}};}function respondWithFilteredResult(_0x4fc828,_0x1f37fb){return function(_0x291042){if(_0x291042){var _0xb0bfb6=typeof _0x1f37fb[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x1f37fb[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x28407c=_0x291042[_0xaa5f('0x1d')];var _0x3d874f=_0xb0bfb6?0x0:_0x1f37fb[_0xaa5f('0x1a')];var _0x1019e8=_0xb0bfb6?_0x291042['count']:_0x1f37fb[_0xaa5f('0x1a')]+_0x1f37fb[_0xaa5f('0x1c')];var _0x1cbab5;if(_0x1019e8>=_0x28407c){_0x1019e8=_0x28407c;_0x1cbab5=0xc8;}else{_0x1cbab5=0xce;}_0x4fc828[_0xaa5f('0x19')](_0x1cbab5);return _0x4fc828[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x3d874f+'-'+_0x1019e8+'/'+_0x28407c)[_0xaa5f('0x20')](_0x291042);}return null;};}function patchUpdates(_0x194691){return function(_0x2d8fc3){try{jsonpatch[_0xaa5f('0x21')](_0x2d8fc3,_0x194691,!![]);}catch(_0x40c223){return BPromise[_0xaa5f('0x22')](_0x40c223);}return _0x2d8fc3[_0xaa5f('0x23')]();};}function saveUpdates(_0x5238a8,_0x1e917d){return function(_0x57082c){if(_0x57082c){return _0x57082c[_0xaa5f('0x24')](_0x5238a8)[_0xaa5f('0x25')](function(_0x561381){return _0x561381;});}return null;};}function removeEntity(_0x1baa2e,_0x1032ce){return function(_0x5b9f0b){if(_0x5b9f0b){return _0x5b9f0b[_0xaa5f('0x26')]()[_0xaa5f('0x25')](function(){_0x1baa2e[_0xaa5f('0x19')](0xcc)[_0xaa5f('0x18')]();});}};}function handleEntityNotFound(_0x1f66c0,_0xacbded){return function(_0x3d7bca){if(!_0x3d7bca){_0x1f66c0[_0xaa5f('0x17')](0x194);}return _0x3d7bca;};}function handleError(_0x51eb55,_0x2445a6){_0x2445a6=_0x2445a6||0x1f4;return function(_0x3a66e8){logger[_0xaa5f('0x27')](_0x3a66e8['stack']);if(_0x3a66e8[_0xaa5f('0x28')]){delete _0x3a66e8[_0xaa5f('0x28')];}_0x51eb55[_0xaa5f('0x19')](_0x2445a6)['send'](_0x3a66e8);};}exports[_0xaa5f('0x29')]=function(_0x479f29,_0x5990d2){var _0x27d1a4={},_0x50998f={},_0x1bffec={'count':0x0,'rows':[]};var _0x4e0ec9=_['map'](db['WhatsappQueueReport'][_0xaa5f('0x2a')],function(_0x4ddebd){return{'name':_0x4ddebd[_0xaa5f('0x2b')],'type':_0x4ddebd[_0xaa5f('0x2c')]['key']};});_0x50998f['model']=_[_0xaa5f('0x2d')](_0x4e0ec9,'name');_0x50998f[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0x479f29['query']);_0x50998f[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x50998f[_0xaa5f('0x32')],_0x50998f['query']);_0x27d1a4[_0xaa5f('0x33')]=_[_0xaa5f('0x31')](_0x50998f['model'],qs['fields'](_0x479f29['query']['fields']));_0x27d1a4[_0xaa5f('0x33')]=_0x27d1a4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x27d1a4[_0xaa5f('0x33')]:_0x50998f[_0xaa5f('0x32')];if(!_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x35')]('nolimit')){_0x27d1a4[_0xaa5f('0x1c')]=qs[_0xaa5f('0x1c')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x1c')]);_0x27d1a4[_0xaa5f('0x1a')]=qs[_0xaa5f('0x1a')](_0x479f29['query'][_0xaa5f('0x1a')]);}_0x27d1a4[_0xaa5f('0x36')]=qs[_0xaa5f('0x37')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x37')]);_0x27d1a4['where']=qs['filters'](_[_0xaa5f('0x38')](_0x479f29[_0xaa5f('0x2e')],_0x50998f[_0xaa5f('0x30')]),_0x4e0ec9);if(_0x479f29[_0xaa5f('0x2e')]['filter']){_0x27d1a4[_0xaa5f('0x39')]=_[_0xaa5f('0x3a')](_0x27d1a4[_0xaa5f('0x39')],{'$or':_[_0xaa5f('0x2d')](_0x4e0ec9,function(_0x37db88){if(_0x37db88[_0xaa5f('0x2c')]!==_0xaa5f('0x3b')){var _0x2c4d29={};_0x2c4d29[_0x37db88[_0xaa5f('0x28')]]={'$like':'%'+_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3c')]+'%'};return _0x2c4d29;}})});}_0x27d1a4=_['merge']({},_0x27d1a4,_0x479f29[_0xaa5f('0x3d')]);var _0x2562ce={'where':_0x27d1a4[_0xaa5f('0x39')]};return db[_0xaa5f('0x3e')][_0xaa5f('0x1d')](_0x2562ce)[_0xaa5f('0x25')](function(_0x1fb572){_0x1bffec[_0xaa5f('0x1d')]=_0x1fb572;if(_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3f')]){_0x27d1a4['include']=[{'all':!![]}];}return db[_0xaa5f('0x3e')]['findAll'](_0x27d1a4);})[_0xaa5f('0x25')](function(_0x21f4bc){_0x1bffec[_0xaa5f('0x40')]=_0x21f4bc;return _0x1bffec;})['then'](respondWithFilteredResult(_0x5990d2,_0x27d1a4))[_0xaa5f('0x41')](handleError(_0x5990d2,null));};exports[_0xaa5f('0x42')]=function(_0xe49f8,_0x528b08){var _0x12a8e4={'raw':!![],'where':{'id':_0xe49f8[_0xaa5f('0x43')]['id']}},_0x179be8={};_0x179be8[_0xaa5f('0x32')]=_['keys'](db[_0xaa5f('0x3e')][_0xaa5f('0x2a')]);_0x179be8[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0xe49f8[_0xaa5f('0x2e')]);_0x179be8[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x179be8[_0xaa5f('0x32')],_0x179be8['query']);_0x12a8e4[_0xaa5f('0x33')]=_['intersection'](_0x179be8[_0xaa5f('0x32')],qs['fields'](_0xe49f8[_0xaa5f('0x2e')][_0xaa5f('0x44')]));_0x12a8e4['attributes']=_0x12a8e4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x12a8e4[_0xaa5f('0x33')]:_0x179be8['model'];if(_0xe49f8['query']['includeAll']){_0x12a8e4[_0xaa5f('0x45')]=[{'all':!![]}];}_0x12a8e4=_['merge']({},_0x12a8e4,_0xe49f8[_0xaa5f('0x3d')]);return db[_0xaa5f('0x3e')][_0xaa5f('0x46')](_0x12a8e4)[_0xaa5f('0x25')](handleEntityNotFound(_0x528b08,null))['then'](respondWithResult(_0x528b08,null))[_0xaa5f('0x41')](handleError(_0x528b08,null));};exports[_0xaa5f('0x47')]=function(_0x3c6a17,_0x231ad1){return db[_0xaa5f('0x3e')][_0xaa5f('0x47')](_0x3c6a17[_0xaa5f('0x48')],{})[_0xaa5f('0x25')](respondWithResult(_0x231ad1,0xc9))[_0xaa5f('0x41')](handleError(_0x231ad1,null));};exports[_0xaa5f('0x24')]=function(_0x3ea553,_0x2de737){if(_0x3ea553[_0xaa5f('0x48')]['id']){delete _0x3ea553[_0xaa5f('0x48')]['id'];}return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x3ea553['params']['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x2de737,null))[_0xaa5f('0x25')](saveUpdates(_0x3ea553[_0xaa5f('0x48')],null))[_0xaa5f('0x25')](respondWithResult(_0x2de737,null))[_0xaa5f('0x41')](handleError(_0x2de737,null));};exports[_0xaa5f('0x26')]=function(_0x32bbed,_0x4aa556){return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x32bbed[_0xaa5f('0x43')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x4aa556,null))['then'](removeEntity(_0x4aa556,null))[_0xaa5f('0x41')](handleError(_0x4aa556,null));};exports[_0xaa5f('0x49')]=function(_0x36c4aa,_0x575803){return db['WhatsappQueueReport']['describe']()['then'](respondWithResult(_0x575803,null))['catch'](handleError(_0x575803,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 90cbf5c..a26a4b7 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 _0x829f=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x829f,0xfb));var _0xf829=function(_0x4b0de9,_0x128b9b){_0x4b0de9=_0x4b0de9-0x0;var _0xb9e0e9=_0x829f[_0x4b0de9];return _0xb9e0e9;};'use strict';var _=require('lodash');var util=require(_0xf829('0x0'));var logger=require(_0xf829('0x1'))(_0xf829('0x2'));var moment=require(_0xf829('0x3'));var BPromise=require('bluebird');var rp=require(_0xf829('0x4'));var fs=require('fs');var path=require(_0xf829('0x5'));var rimraf=require(_0xf829('0x6'));var config=require(_0xf829('0x7'));var attributes=require(_0xf829('0x8'));module['exports']=function(_0x17ff4b,_0x5503ae){return _0x17ff4b['define'](_0xf829('0x9'),attributes,{'tableName':_0xf829('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf829('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f8e=['./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x0f8e,0x13e));var _0xe0f8=function(_0x2e2292,_0x1891b8){_0x2e2292=_0x2e2292-0x0;var _0x4f77ab=_0x0f8e[_0x2e2292];return _0x4f77ab;};'use strict';var _=require(_0xe0f8('0x0'));var util=require('util');var logger=require(_0xe0f8('0x1'))(_0xe0f8('0x2'));var moment=require(_0xe0f8('0x3'));var BPromise=require(_0xe0f8('0x4'));var rp=require(_0xe0f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0f8('0x6'));var config=require('../../config/environment');var attributes=require(_0xe0f8('0x7'));module[_0xe0f8('0x8')]=function(_0x315fff,_0x99c18b){return _0x315fff[_0xe0f8('0x9')](_0xe0f8('0xa'),attributes,{'tableName':_0xe0f8('0xb'),'paranoid':![],'indexes':[{'name':_0xe0f8('0xc'),'fields':[_0xe0f8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 13c2ae1..3837bb8 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 _0x06e3=['then','update','where','attributes','limit','UpdateWhatsappQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x06e3,0x1b3));var _0x306e=function(_0x5c3a32,_0x3037e4){_0x5c3a32=_0x5c3a32-0x0;var _0x58adce=_0x06e3[_0x5c3a32];return _0x58adce;};'use strict';var _=require('lodash');var util=require(_0x306e('0x0'));var moment=require(_0x306e('0x1'));var BPromise=require(_0x306e('0x2'));var rs=require(_0x306e('0x3'));var fs=require('fs');var Redis=require(_0x306e('0x4'));var db=require(_0x306e('0x5'))['db'];var utils=require(_0x306e('0x6'));var logger=require(_0x306e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x306e('0x8'));var client=jayson[_0x306e('0x9')][_0x306e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f70a,_0x25d9ca,_0x1b46c4){return new BPromise(function(_0x19d0cc,_0x5dacf3){return client[_0x306e('0xb')](_0x51f70a,_0x1b46c4)['then'](function(_0x478252){logger[_0x306e('0xc')](_0x306e('0xd'),_0x25d9ca,_0x306e('0xe'));logger[_0x306e('0xf')](_0x306e('0x10'),_0x25d9ca,_0x306e('0xe'),JSON['stringify'](_0x478252));if(_0x478252[_0x306e('0x11')]){if(_0x478252[_0x306e('0x11')]['code']===0x1f4){logger[_0x306e('0x11')](_0x306e('0xd'),_0x25d9ca,_0x478252[_0x306e('0x11')][_0x306e('0x12')]);return _0x5dacf3(_0x478252[_0x306e('0x11')][_0x306e('0x12')]);}logger['error'](_0x306e('0xd'),_0x25d9ca,_0x478252['error'][_0x306e('0x12')]);return _0x19d0cc(_0x478252[_0x306e('0x11')][_0x306e('0x12')]);}else{logger[_0x306e('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x25d9ca,'request\x20sent');_0x19d0cc(_0x478252[_0x306e('0x13')][_0x306e('0x12')]);}})[_0x306e('0x14')](function(_0x350cc9){logger[_0x306e('0x11')](_0x306e('0xd'),_0x25d9ca,_0x350cc9);_0x5dacf3(_0x350cc9);});});}exports[_0x306e('0x15')]=function(_0x76cc6c){var _0x4804dc=this;return new Promise(function(_0x21c944,_0x33dfd1){return db[_0x306e('0x16')][_0x306e('0x17')](_0x76cc6c[_0x306e('0x18')],{'raw':_0x76cc6c[_0x306e('0x19')]?_0x76cc6c['options'][_0x306e('0x1a')]===undefined?!![]:![]:!![]})[_0x306e('0x1b')](function(_0x3ec80e){logger[_0x306e('0xc')](_0x306e('0x15'),_0x76cc6c);logger[_0x306e('0xf')]('CreateWhatsappQueueReport',_0x76cc6c,JSON['stringify'](_0x3ec80e));_0x21c944(_0x3ec80e);})[_0x306e('0x14')](function(_0x5eaadd){logger[_0x306e('0x11')]('CreateWhatsappQueueReport',_0x5eaadd[_0x306e('0x12')],_0x76cc6c);_0x33dfd1(_0x4804dc['error'](0x1f4,_0x5eaadd[_0x306e('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1ecb20){var _0x2e2f7d=this;return new Promise(function(_0x437872,_0x5e680c){return db['WhatsappQueueReport'][_0x306e('0x1c')](_0x1ecb20['body'],{'raw':_0x1ecb20[_0x306e('0x19')]?_0x1ecb20[_0x306e('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ecb20[_0x306e('0x19')]?_0x1ecb20[_0x306e('0x19')][_0x306e('0x1d')]||null:null,'attributes':_0x1ecb20[_0x306e('0x19')]?_0x1ecb20[_0x306e('0x19')][_0x306e('0x1e')]||null:null,'limit':_0x1ecb20[_0x306e('0x19')]?_0x1ecb20[_0x306e('0x19')][_0x306e('0x1f')]||null:null})[_0x306e('0x1b')](function(_0x4faf0e){logger[_0x306e('0xc')](_0x306e('0x20'),_0x1ecb20);logger[_0x306e('0xf')](_0x306e('0x20'),_0x1ecb20,JSON['stringify'](_0x4faf0e));_0x437872(_0x4faf0e);})[_0x306e('0x14')](function(_0x2e46c2){logger[_0x306e('0x11')]('UpdateWhatsappQueueReport',_0x2e46c2[_0x306e('0x12')],_0x1ecb20);_0x5e680c(_0x2e2f7d[_0x306e('0x11')](0x1f4,_0x2e46c2[_0x306e('0x12')]));});});}; \ No newline at end of file +var _0xdda6=['CreateWhatsappQueueReport','update','body','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','WhatsappQueueReport','create','options'];(function(_0x505db9,_0x35273a){var _0x5a4215=function(_0x288d87){while(--_0x288d87){_0x505db9['push'](_0x505db9['shift']());}};_0x5a4215(++_0x35273a);}(_0xdda6,0xac));var _0x6dda=function(_0x40f355,_0x27fac0){_0x40f355=_0x40f355-0x0;var _0x1ebb62=_0xdda6[_0x40f355];return _0x1ebb62;};'use strict';var _=require(_0x6dda('0x0'));var util=require(_0x6dda('0x1'));var moment=require(_0x6dda('0x2'));var BPromise=require(_0x6dda('0x3'));var rs=require(_0x6dda('0x4'));var fs=require('fs');var Redis=require(_0x6dda('0x5'));var db=require(_0x6dda('0x6'))['db'];var utils=require(_0x6dda('0x7'));var logger=require(_0x6dda('0x8'))(_0x6dda('0x9'));var config=require(_0x6dda('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6dda('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4691ad,_0x50ea38,_0x39317f){return new BPromise(function(_0x2105df,_0x1d2419){return client[_0x6dda('0xc')](_0x4691ad,_0x39317f)[_0x6dda('0xd')](function(_0x44357d){logger[_0x6dda('0xe')](_0x6dda('0xf'),_0x50ea38,'request\x20sent');logger[_0x6dda('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x50ea38,_0x6dda('0x11'),JSON[_0x6dda('0x12')](_0x44357d));if(_0x44357d['error']){if(_0x44357d[_0x6dda('0x13')][_0x6dda('0x14')]===0x1f4){logger[_0x6dda('0x13')](_0x6dda('0xf'),_0x50ea38,_0x44357d[_0x6dda('0x13')][_0x6dda('0x15')]);return _0x1d2419(_0x44357d[_0x6dda('0x13')][_0x6dda('0x15')]);}logger[_0x6dda('0x13')](_0x6dda('0xf'),_0x50ea38,_0x44357d[_0x6dda('0x13')][_0x6dda('0x15')]);return _0x2105df(_0x44357d[_0x6dda('0x13')][_0x6dda('0x15')]);}else{logger[_0x6dda('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x50ea38,_0x6dda('0x11'));_0x2105df(_0x44357d['result'][_0x6dda('0x15')]);}})[_0x6dda('0x16')](function(_0x1dc570){logger[_0x6dda('0x13')](_0x6dda('0xf'),_0x50ea38,_0x1dc570);_0x1d2419(_0x1dc570);});});}exports['CreateWhatsappQueueReport']=function(_0xba74c6){var _0x5f0e17=this;return new Promise(function(_0x4b118f,_0x2eed26){return db[_0x6dda('0x17')][_0x6dda('0x18')](_0xba74c6['body'],{'raw':_0xba74c6[_0x6dda('0x19')]?_0xba74c6[_0x6dda('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x6dda('0xd')](function(_0x515924){logger[_0x6dda('0xe')](_0x6dda('0x1a'),_0xba74c6);logger['debug'](_0x6dda('0x1a'),_0xba74c6,JSON[_0x6dda('0x12')](_0x515924));_0x4b118f(_0x515924);})[_0x6dda('0x16')](function(_0x24297b){logger['error'](_0x6dda('0x1a'),_0x24297b[_0x6dda('0x15')],_0xba74c6);_0x2eed26(_0x5f0e17[_0x6dda('0x13')](0x1f4,_0x24297b[_0x6dda('0x15')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x50ba32){var _0x59500c=this;return new Promise(function(_0x5cad07,_0xa193d9){return db[_0x6dda('0x17')][_0x6dda('0x1b')](_0x50ba32[_0x6dda('0x1c')],{'raw':_0x50ba32[_0x6dda('0x19')]?_0x50ba32[_0x6dda('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50ba32['options']?_0x50ba32[_0x6dda('0x19')][_0x6dda('0x1d')]||null:null,'attributes':_0x50ba32['options']?_0x50ba32[_0x6dda('0x19')][_0x6dda('0x1e')]||null:null,'limit':_0x50ba32[_0x6dda('0x19')]?_0x50ba32[_0x6dda('0x19')][_0x6dda('0x1f')]||null:null})[_0x6dda('0xd')](function(_0x1bafa7){logger[_0x6dda('0xe')](_0x6dda('0x20'),_0x50ba32);logger['debug'](_0x6dda('0x20'),_0x50ba32,JSON['stringify'](_0x1bafa7));_0x5cad07(_0x1bafa7);})['catch'](function(_0x59e716){logger[_0x6dda('0x13')](_0x6dda('0x20'),_0x59e716[_0x6dda('0x15')],_0x50ba32);_0xa193d9(_0x59500c[_0x6dda('0x13')](0x1f4,_0x59e716['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 2c27413..c91d765 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 _0xd9b9=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','delete','destroy'];(function(_0x425df4,_0x8ac429){var _0x3ef113=function(_0x54648a){while(--_0x54648a){_0x425df4['push'](_0x425df4['shift']());}};_0x3ef113(++_0x8ac429);}(_0xd9b9,0x1a3));var _0x9d9b=function(_0x2d154d,_0x497226){_0x2d154d=_0x2d154d-0x0;var _0x50b645=_0xd9b9[_0x2d154d];return _0x50b645;};'use strict';var multer=require(_0x9d9b('0x0'));var util=require('util');var path=require(_0x9d9b('0x1'));var timeout=require(_0x9d9b('0x2'));var express=require(_0x9d9b('0x3'));var router=express[_0x9d9b('0x4')]();var fs_extra=require(_0x9d9b('0x5'));var auth=require(_0x9d9b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9d9b('0x7'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0x9d9b('0x8')](),controller[_0x9d9b('0x9')]);router[_0x9d9b('0xa')](_0x9d9b('0xb'),auth[_0x9d9b('0x8')](),controller[_0x9d9b('0xc')]);router[_0x9d9b('0xa')](_0x9d9b('0xd'),auth[_0x9d9b('0x8')](),controller[_0x9d9b('0xe')]);router['post']('/',auth[_0x9d9b('0x8')](),controller[_0x9d9b('0xf')]);router['put']('/:id',auth[_0x9d9b('0x8')](),controller['update']);router[_0x9d9b('0x10')](_0x9d9b('0xd'),auth[_0x9d9b('0x8')](),controller[_0x9d9b('0x11')]);module[_0x9d9b('0x12')]=router; \ No newline at end of file +var _0x47f6=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','put','update','delete','exports','multer'];(function(_0x5a371b,_0x5c28a1){var _0x25775d=function(_0x461fcf){while(--_0x461fcf){_0x5a371b['push'](_0x5a371b['shift']());}};_0x25775d(++_0x5c28a1);}(_0x47f6,0x12b));var _0x647f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47f6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x647f('0x0'));var util=require(_0x647f('0x1'));var path=require(_0x647f('0x2'));var timeout=require(_0x647f('0x3'));var express=require(_0x647f('0x4'));var router=express[_0x647f('0x5')]();var fs_extra=require(_0x647f('0x6'));var auth=require(_0x647f('0x7'));var interaction=require(_0x647f('0x8'));var config=require('../../config/environment');var controller=require(_0x647f('0x9'));router[_0x647f('0xa')]('/',auth[_0x647f('0xb')](),controller['index']);router['get'](_0x647f('0xc'),auth['isAuthenticated'](),controller[_0x647f('0xd')]);router[_0x647f('0xa')](_0x647f('0xe'),auth[_0x647f('0xb')](),controller[_0x647f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x647f('0x10')](_0x647f('0xe'),auth[_0x647f('0xb')](),controller[_0x647f('0x11')]);router[_0x647f('0x12')](_0x647f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x647f('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 7707cf9..5bf9996 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 _0xd509=['DATE','STRING','ENUM','account'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x9d50('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x9d50('0x1')](_0x9d50('0x2'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x9d50('0x3')]}}; \ No newline at end of file +var _0xf6ed=['account','DATE','sequelize','STRING','ENUM'];(function(_0x4f0430,_0x57d1bc){var _0x360938=function(_0xe6a44b){while(--_0xe6a44b){_0x4f0430['push'](_0x4f0430['shift']());}};_0x360938(++_0x57d1bc);}(_0xf6ed,0x1ce));var _0xdf6e=function(_0x227b98,_0x4e5fab){_0x227b98=_0x227b98-0x0;var _0x5d9209=_0xf6ed[_0x227b98];return _0x5d9209;};'use strict';var Sequelize=require(_0xdf6e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdf6e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdf6e('0x2')](_0xdf6e('0x3'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xdf6e('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 264f57b..c9d7676 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 _0xa6f8=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','eml-format','zip-dir'];(function(_0x18b07b,_0x1f5d24){var _0xa63ba0=function(_0x483596){while(--_0x483596){_0x18b07b['push'](_0x18b07b['shift']());}};_0xa63ba0(++_0x1f5d24);}(_0xa6f8,0x94));var _0x8a6f=function(_0x1722bf,_0x2fa7f4){_0x1722bf=_0x1722bf-0x0;var _0x58c607=_0xa6f8[_0x1722bf];return _0x58c607;};'use strict';var emlformat=require(_0x8a6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a6f('0x1'));var jsonpatch=require(_0x8a6f('0x2'));var rp=require(_0x8a6f('0x3'));var moment=require(_0x8a6f('0x4'));var BPromise=require(_0x8a6f('0x5'));var Mustache=require(_0x8a6f('0x6'));var util=require(_0x8a6f('0x7'));var path=require(_0x8a6f('0x8'));var sox=require(_0x8a6f('0x9'));var csv=require('to-csv');var ejs=require(_0x8a6f('0xa'));var fs=require('fs');var fs_extra=require(_0x8a6f('0xb'));var _=require(_0x8a6f('0xc'));var squel=require('squel');var crypto=require(_0x8a6f('0xd'));var jsforce=require(_0x8a6f('0xe'));var deskjs=require(_0x8a6f('0xf'));var toCsv=require(_0x8a6f('0x10'));var querystring=require(_0x8a6f('0x11'));var Papa=require(_0x8a6f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a6f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a6f('0x14'))('api');var utils=require(_0x8a6f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8a6f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x140c65,_0x1fff9f){_0x1fff9f=_0x1fff9f||0xcc;return function(_0x2c40db){if(_0x2c40db){return _0x140c65['sendStatus'](_0x1fff9f);}return _0x140c65[_0x8a6f('0x17')](_0x1fff9f)['end']();};}function respondWithResult(_0x5568c4,_0x3e1c07){_0x3e1c07=_0x3e1c07||0xc8;return function(_0x5aacc9){if(_0x5aacc9){return _0x5568c4[_0x8a6f('0x17')](_0x3e1c07)[_0x8a6f('0x18')](_0x5aacc9);}};}function respondWithFilteredResult(_0x478c3a,_0x2fde81){return function(_0x8418d){if(_0x8418d){var _0x496a5f=typeof _0x2fde81['offset']==='undefined'&&typeof _0x2fde81['limit']===_0x8a6f('0x19');var _0x4cd281=_0x8418d[_0x8a6f('0x1a')];var _0x3f7760=_0x496a5f?0x0:_0x2fde81[_0x8a6f('0x1b')];var _0x4ec3fb=_0x496a5f?_0x8418d[_0x8a6f('0x1a')]:_0x2fde81[_0x8a6f('0x1b')]+_0x2fde81[_0x8a6f('0x1c')];var _0x28e9df;if(_0x4ec3fb>=_0x4cd281){_0x4ec3fb=_0x4cd281;_0x28e9df=0xc8;}else{_0x28e9df=0xce;}_0x478c3a[_0x8a6f('0x17')](_0x28e9df);return _0x478c3a[_0x8a6f('0x1d')]('Content-Range',_0x3f7760+'-'+_0x4ec3fb+'/'+_0x4cd281)['json'](_0x8418d);}return null;};}function patchUpdates(_0x3fad42){return function(_0x4b453a){try{jsonpatch[_0x8a6f('0x1e')](_0x4b453a,_0x3fad42,!![]);}catch(_0xe08190){return BPromise[_0x8a6f('0x1f')](_0xe08190);}return _0x4b453a[_0x8a6f('0x20')]();};}function saveUpdates(_0x3f6f5c,_0x189c35){return function(_0x4a380a){if(_0x4a380a){return _0x4a380a[_0x8a6f('0x21')](_0x3f6f5c)[_0x8a6f('0x22')](function(_0x1ae4c4){return _0x1ae4c4;});}return null;};}function removeEntity(_0x1b943b,_0xf124b2){return function(_0x15cebe){if(_0x15cebe){return _0x15cebe['destroy']()[_0x8a6f('0x22')](function(){_0x1b943b[_0x8a6f('0x17')](0xcc)[_0x8a6f('0x23')]();});}};}function handleEntityNotFound(_0x245007,_0x1f2607){return function(_0x4266e0){if(!_0x4266e0){_0x245007[_0x8a6f('0x24')](0x194);}return _0x4266e0;};}function handleError(_0x33fa2e,_0x4d11c6){_0x4d11c6=_0x4d11c6||0x1f4;return function(_0x3ac959){logger[_0x8a6f('0x25')](_0x3ac959[_0x8a6f('0x26')]);if(_0x3ac959['name']){delete _0x3ac959[_0x8a6f('0x27')];}_0x33fa2e[_0x8a6f('0x17')](_0x4d11c6)[_0x8a6f('0x28')](_0x3ac959);};}exports[_0x8a6f('0x29')]=function(_0x104d04,_0x5395ae){var _0x5e42fc={},_0x5b87b4={},_0x37c966={'count':0x0,'rows':[]};var _0x2cc465=_[_0x8a6f('0x2a')](db[_0x8a6f('0x2b')][_0x8a6f('0x2c')],function(_0x27a35b){return{'name':_0x27a35b[_0x8a6f('0x2d')],'type':_0x27a35b[_0x8a6f('0x2e')]['key']};});_0x5b87b4[_0x8a6f('0x2f')]=_[_0x8a6f('0x2a')](_0x2cc465,_0x8a6f('0x27'));_0x5b87b4[_0x8a6f('0x30')]=_[_0x8a6f('0x31')](_0x104d04[_0x8a6f('0x30')]);_0x5b87b4[_0x8a6f('0x32')]=_[_0x8a6f('0x33')](_0x5b87b4[_0x8a6f('0x2f')],_0x5b87b4[_0x8a6f('0x30')]);_0x5e42fc[_0x8a6f('0x34')]=_[_0x8a6f('0x33')](_0x5b87b4['model'],qs[_0x8a6f('0x35')](_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x35')]));_0x5e42fc[_0x8a6f('0x34')]=_0x5e42fc[_0x8a6f('0x34')][_0x8a6f('0x36')]?_0x5e42fc[_0x8a6f('0x34')]:_0x5b87b4[_0x8a6f('0x2f')];if(!_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x37')](_0x8a6f('0x38'))){_0x5e42fc['limit']=qs[_0x8a6f('0x1c')](_0x104d04[_0x8a6f('0x30')]['limit']);_0x5e42fc[_0x8a6f('0x1b')]=qs[_0x8a6f('0x1b')](_0x104d04['query'][_0x8a6f('0x1b')]);}_0x5e42fc[_0x8a6f('0x39')]=qs[_0x8a6f('0x3a')](_0x104d04['query'][_0x8a6f('0x3a')]);_0x5e42fc[_0x8a6f('0x3b')]=qs['filters'](_[_0x8a6f('0x3c')](_0x104d04[_0x8a6f('0x30')],_0x5b87b4[_0x8a6f('0x32')]),_0x2cc465);if(_0x104d04[_0x8a6f('0x30')]['filter']){_0x5e42fc[_0x8a6f('0x3b')]=_[_0x8a6f('0x3d')](_0x5e42fc[_0x8a6f('0x3b')],{'$or':_[_0x8a6f('0x2a')](_0x2cc465,function(_0x21cdee){if(_0x21cdee[_0x8a6f('0x2e')]!==_0x8a6f('0x3e')){var _0x1b1942={};_0x1b1942[_0x21cdee[_0x8a6f('0x27')]]={'$like':'%'+_0x104d04[_0x8a6f('0x30')]['filter']+'%'};return _0x1b1942;}})});}_0x5e42fc=_[_0x8a6f('0x3d')]({},_0x5e42fc,_0x104d04[_0x8a6f('0x3f')]);var _0x180f9b={'where':_0x5e42fc[_0x8a6f('0x3b')]};return db[_0x8a6f('0x2b')][_0x8a6f('0x1a')](_0x180f9b)['then'](function(_0x327993){_0x37c966[_0x8a6f('0x1a')]=_0x327993;if(_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x40')]){_0x5e42fc['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x8a6f('0x41')](_0x5e42fc);})[_0x8a6f('0x22')](function(_0x1d696d){_0x37c966['rows']=_0x1d696d;return _0x37c966;})[_0x8a6f('0x22')](respondWithFilteredResult(_0x5395ae,_0x5e42fc))[_0x8a6f('0x42')](handleError(_0x5395ae,null));};exports[_0x8a6f('0x43')]=function(_0x129d73,_0x49d28e){var _0x3f92f6={'raw':!![],'where':{'id':_0x129d73[_0x8a6f('0x44')]['id']}},_0xabf44a={};_0xabf44a['model']=_[_0x8a6f('0x31')](db[_0x8a6f('0x2b')][_0x8a6f('0x2c')]);_0xabf44a['query']=_[_0x8a6f('0x31')](_0x129d73[_0x8a6f('0x30')]);_0xabf44a[_0x8a6f('0x32')]=_[_0x8a6f('0x33')](_0xabf44a[_0x8a6f('0x2f')],_0xabf44a[_0x8a6f('0x30')]);_0x3f92f6[_0x8a6f('0x34')]=_[_0x8a6f('0x33')](_0xabf44a[_0x8a6f('0x2f')],qs[_0x8a6f('0x35')](_0x129d73['query']['fields']));_0x3f92f6[_0x8a6f('0x34')]=_0x3f92f6[_0x8a6f('0x34')]['length']?_0x3f92f6[_0x8a6f('0x34')]:_0xabf44a['model'];if(_0x129d73[_0x8a6f('0x30')]['includeAll']){_0x3f92f6[_0x8a6f('0x45')]=[{'all':!![]}];}_0x3f92f6=_[_0x8a6f('0x3d')]({},_0x3f92f6,_0x129d73[_0x8a6f('0x3f')]);return db[_0x8a6f('0x2b')][_0x8a6f('0x46')](_0x3f92f6)[_0x8a6f('0x22')](handleEntityNotFound(_0x49d28e,null))[_0x8a6f('0x22')](respondWithResult(_0x49d28e,null))['catch'](handleError(_0x49d28e,null));};exports[_0x8a6f('0x47')]=function(_0x208c21,_0x52c655){return db['WhatsappTransferReport']['create'](_0x208c21[_0x8a6f('0x48')],{})[_0x8a6f('0x22')](respondWithResult(_0x52c655,0xc9))['catch'](handleError(_0x52c655,null));};exports[_0x8a6f('0x21')]=function(_0x576e31,_0x39507c){if(_0x576e31[_0x8a6f('0x48')]['id']){delete _0x576e31[_0x8a6f('0x48')]['id'];}return db[_0x8a6f('0x2b')]['find']({'where':{'id':_0x576e31[_0x8a6f('0x44')]['id']}})[_0x8a6f('0x22')](handleEntityNotFound(_0x39507c,null))[_0x8a6f('0x22')](saveUpdates(_0x576e31[_0x8a6f('0x48')],null))['then'](respondWithResult(_0x39507c,null))[_0x8a6f('0x42')](handleError(_0x39507c,null));};exports[_0x8a6f('0x49')]=function(_0x5c9848,_0x23cc12){return db['WhatsappTransferReport'][_0x8a6f('0x46')]({'where':{'id':_0x5c9848[_0x8a6f('0x44')]['id']}})[_0x8a6f('0x22')](handleEntityNotFound(_0x23cc12,null))[_0x8a6f('0x22')](removeEntity(_0x23cc12,null))[_0x8a6f('0x42')](handleError(_0x23cc12,null));};exports[_0x8a6f('0x4a')]=function(_0x84aa5e,_0x15a929){return db['WhatsappTransferReport'][_0x8a6f('0x4a')]()[_0x8a6f('0x22')](respondWithResult(_0x15a929,null))[_0x8a6f('0x42')](handleError(_0x15a929,null));}; \ No newline at end of file +var _0x9cab=['name','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','WhatsappTransferReport','include','findAll','rows','catch','show','includeAll','create','update','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','key'];(function(_0x3c30a4,_0x152fd6){var _0x4f3e14=function(_0x28d11e){while(--_0x28d11e){_0x3c30a4['push'](_0x3c30a4['shift']());}};_0x4f3e14(++_0x152fd6);}(_0x9cab,0x1e7));var _0xb9ca=function(_0x2cfdf8,_0x4cc489){_0x2cfdf8=_0x2cfdf8-0x0;var _0xcc37e0=_0x9cab[_0x2cfdf8];return _0xcc37e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9ca('0x0'));var zipdir=require(_0xb9ca('0x1'));var jsonpatch=require(_0xb9ca('0x2'));var rp=require(_0xb9ca('0x3'));var moment=require(_0xb9ca('0x4'));var BPromise=require(_0xb9ca('0x5'));var Mustache=require('mustache');var util=require(_0xb9ca('0x6'));var path=require(_0xb9ca('0x7'));var sox=require('sox');var csv=require(_0xb9ca('0x8'));var ejs=require(_0xb9ca('0x9'));var fs=require('fs');var fs_extra=require(_0xb9ca('0xa'));var _=require(_0xb9ca('0xb'));var squel=require(_0xb9ca('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb9ca('0xd'));var toCsv=require(_0xb9ca('0x8'));var querystring=require(_0xb9ca('0xe'));var Papa=require(_0xb9ca('0xf'));var Redis=require('ioredis');var authService=require(_0xb9ca('0x10'));var qs=require(_0xb9ca('0x11'));var as=require(_0xb9ca('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9ca('0x13'))(_0xb9ca('0x14'));var utils=require('../../config/utils');var config=require(_0xb9ca('0x15'));var licenseUtil=require(_0xb9ca('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd11dc9,_0x5125bc){_0x5125bc=_0x5125bc||0xcc;return function(_0x17bb09){if(_0x17bb09){return _0xd11dc9[_0xb9ca('0x17')](_0x5125bc);}return _0xd11dc9['status'](_0x5125bc)[_0xb9ca('0x18')]();};}function respondWithResult(_0x4619af,_0x1e7c82){_0x1e7c82=_0x1e7c82||0xc8;return function(_0x3e0156){if(_0x3e0156){return _0x4619af[_0xb9ca('0x19')](_0x1e7c82)[_0xb9ca('0x1a')](_0x3e0156);}};}function respondWithFilteredResult(_0x3dd1c8,_0x13b178){return function(_0x556f62){if(_0x556f62){var _0x51f7e0=typeof _0x13b178[_0xb9ca('0x1b')]===_0xb9ca('0x1c')&&typeof _0x13b178[_0xb9ca('0x1d')]===_0xb9ca('0x1c');var _0xf4e7ac=_0x556f62[_0xb9ca('0x1e')];var _0x4f45e5=_0x51f7e0?0x0:_0x13b178['offset'];var _0x502ee2=_0x51f7e0?_0x556f62[_0xb9ca('0x1e')]:_0x13b178[_0xb9ca('0x1b')]+_0x13b178[_0xb9ca('0x1d')];var _0x499a73;if(_0x502ee2>=_0xf4e7ac){_0x502ee2=_0xf4e7ac;_0x499a73=0xc8;}else{_0x499a73=0xce;}_0x3dd1c8[_0xb9ca('0x19')](_0x499a73);return _0x3dd1c8[_0xb9ca('0x1f')](_0xb9ca('0x20'),_0x4f45e5+'-'+_0x502ee2+'/'+_0xf4e7ac)[_0xb9ca('0x1a')](_0x556f62);}return null;};}function patchUpdates(_0x209ac5){return function(_0x5135e7){try{jsonpatch['apply'](_0x5135e7,_0x209ac5,!![]);}catch(_0x1c6349){return BPromise[_0xb9ca('0x21')](_0x1c6349);}return _0x5135e7[_0xb9ca('0x22')]();};}function saveUpdates(_0x4ae27a,_0x5156f3){return function(_0x1e9427){if(_0x1e9427){return _0x1e9427['update'](_0x4ae27a)[_0xb9ca('0x23')](function(_0x139d40){return _0x139d40;});}return null;};}function removeEntity(_0x414afe,_0x2f8fce){return function(_0x40779e){if(_0x40779e){return _0x40779e[_0xb9ca('0x24')]()[_0xb9ca('0x23')](function(){_0x414afe[_0xb9ca('0x19')](0xcc)[_0xb9ca('0x18')]();});}};}function handleEntityNotFound(_0xdfc6eb,_0x43db30){return function(_0x5991b4){if(!_0x5991b4){_0xdfc6eb[_0xb9ca('0x17')](0x194);}return _0x5991b4;};}function handleError(_0x26ed4b,_0x42e81a){_0x42e81a=_0x42e81a||0x1f4;return function(_0x3e69b0){logger[_0xb9ca('0x25')](_0x3e69b0[_0xb9ca('0x26')]);if(_0x3e69b0['name']){delete _0x3e69b0['name'];}_0x26ed4b[_0xb9ca('0x19')](_0x42e81a)[_0xb9ca('0x27')](_0x3e69b0);};}exports[_0xb9ca('0x28')]=function(_0x3f2474,_0x5a983e){var _0x2bf5bd={},_0x39c916={},_0x14aeb8={'count':0x0,'rows':[]};var _0x5e1e28=_[_0xb9ca('0x29')](db['WhatsappTransferReport'][_0xb9ca('0x2a')],function(_0x25a5cd){return{'name':_0x25a5cd[_0xb9ca('0x2b')],'type':_0x25a5cd['type'][_0xb9ca('0x2c')]};});_0x39c916['model']=_[_0xb9ca('0x29')](_0x5e1e28,_0xb9ca('0x2d'));_0x39c916[_0xb9ca('0x2e')]=_[_0xb9ca('0x2f')](_0x3f2474[_0xb9ca('0x2e')]);_0x39c916[_0xb9ca('0x30')]=_[_0xb9ca('0x31')](_0x39c916['model'],_0x39c916[_0xb9ca('0x2e')]);_0x2bf5bd[_0xb9ca('0x32')]=_['intersection'](_0x39c916[_0xb9ca('0x33')],qs[_0xb9ca('0x34')](_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x34')]));_0x2bf5bd[_0xb9ca('0x32')]=_0x2bf5bd['attributes'][_0xb9ca('0x35')]?_0x2bf5bd[_0xb9ca('0x32')]:_0x39c916['model'];if(!_0x3f2474[_0xb9ca('0x2e')]['hasOwnProperty'](_0xb9ca('0x36'))){_0x2bf5bd['limit']=qs[_0xb9ca('0x1d')](_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x1d')]);_0x2bf5bd[_0xb9ca('0x1b')]=qs[_0xb9ca('0x1b')](_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x1b')]);}_0x2bf5bd[_0xb9ca('0x37')]=qs['sort'](_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x38')]);_0x2bf5bd[_0xb9ca('0x39')]=qs[_0xb9ca('0x30')](_['pick'](_0x3f2474[_0xb9ca('0x2e')],_0x39c916[_0xb9ca('0x30')]),_0x5e1e28);if(_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x3a')]){_0x2bf5bd[_0xb9ca('0x39')]=_['merge'](_0x2bf5bd[_0xb9ca('0x39')],{'$or':_[_0xb9ca('0x29')](_0x5e1e28,function(_0xdcde75){if(_0xdcde75[_0xb9ca('0x3b')]!==_0xb9ca('0x3c')){var _0x35c059={};_0x35c059[_0xdcde75[_0xb9ca('0x2d')]]={'$like':'%'+_0x3f2474[_0xb9ca('0x2e')][_0xb9ca('0x3a')]+'%'};return _0x35c059;}})});}_0x2bf5bd=_[_0xb9ca('0x3d')]({},_0x2bf5bd,_0x3f2474[_0xb9ca('0x3e')]);var _0xb3d549={'where':_0x2bf5bd['where']};return db[_0xb9ca('0x3f')][_0xb9ca('0x1e')](_0xb3d549)['then'](function(_0x3e1986){_0x14aeb8['count']=_0x3e1986;if(_0x3f2474[_0xb9ca('0x2e')]['includeAll']){_0x2bf5bd[_0xb9ca('0x40')]=[{'all':!![]}];}return db[_0xb9ca('0x3f')][_0xb9ca('0x41')](_0x2bf5bd);})['then'](function(_0x30acaf){_0x14aeb8[_0xb9ca('0x42')]=_0x30acaf;return _0x14aeb8;})[_0xb9ca('0x23')](respondWithFilteredResult(_0x5a983e,_0x2bf5bd))[_0xb9ca('0x43')](handleError(_0x5a983e,null));};exports[_0xb9ca('0x44')]=function(_0x42281a,_0x174605){var _0x57a85e={'raw':!![],'where':{'id':_0x42281a['params']['id']}},_0x2c9d1f={};_0x2c9d1f[_0xb9ca('0x33')]=_[_0xb9ca('0x2f')](db[_0xb9ca('0x3f')][_0xb9ca('0x2a')]);_0x2c9d1f['query']=_[_0xb9ca('0x2f')](_0x42281a[_0xb9ca('0x2e')]);_0x2c9d1f[_0xb9ca('0x30')]=_['intersection'](_0x2c9d1f[_0xb9ca('0x33')],_0x2c9d1f[_0xb9ca('0x2e')]);_0x57a85e['attributes']=_[_0xb9ca('0x31')](_0x2c9d1f[_0xb9ca('0x33')],qs[_0xb9ca('0x34')](_0x42281a[_0xb9ca('0x2e')]['fields']));_0x57a85e[_0xb9ca('0x32')]=_0x57a85e[_0xb9ca('0x32')][_0xb9ca('0x35')]?_0x57a85e[_0xb9ca('0x32')]:_0x2c9d1f[_0xb9ca('0x33')];if(_0x42281a['query'][_0xb9ca('0x45')]){_0x57a85e[_0xb9ca('0x40')]=[{'all':!![]}];}_0x57a85e=_[_0xb9ca('0x3d')]({},_0x57a85e,_0x42281a[_0xb9ca('0x3e')]);return db[_0xb9ca('0x3f')]['find'](_0x57a85e)[_0xb9ca('0x23')](handleEntityNotFound(_0x174605,null))[_0xb9ca('0x23')](respondWithResult(_0x174605,null))[_0xb9ca('0x43')](handleError(_0x174605,null));};exports[_0xb9ca('0x46')]=function(_0x7607f7,_0x1fba3a){return db[_0xb9ca('0x3f')]['create'](_0x7607f7['body'],{})[_0xb9ca('0x23')](respondWithResult(_0x1fba3a,0xc9))[_0xb9ca('0x43')](handleError(_0x1fba3a,null));};exports[_0xb9ca('0x47')]=function(_0x10de42,_0x3f1283){if(_0x10de42[_0xb9ca('0x48')]['id']){delete _0x10de42[_0xb9ca('0x48')]['id'];}return db[_0xb9ca('0x3f')][_0xb9ca('0x49')]({'where':{'id':_0x10de42[_0xb9ca('0x4a')]['id']}})[_0xb9ca('0x23')](handleEntityNotFound(_0x3f1283,null))[_0xb9ca('0x23')](saveUpdates(_0x10de42[_0xb9ca('0x48')],null))[_0xb9ca('0x23')](respondWithResult(_0x3f1283,null))[_0xb9ca('0x43')](handleError(_0x3f1283,null));};exports[_0xb9ca('0x24')]=function(_0x211fc8,_0x5a7f32){return db['WhatsappTransferReport'][_0xb9ca('0x49')]({'where':{'id':_0x211fc8['params']['id']}})[_0xb9ca('0x23')](handleEntityNotFound(_0x5a7f32,null))[_0xb9ca('0x23')](removeEntity(_0x5a7f32,null))[_0xb9ca('0x43')](handleError(_0x5a7f32,null));};exports['describe']=function(_0x5e44b1,_0x2c76ed){return db[_0xb9ca('0x3f')][_0xb9ca('0x4b')]()[_0xb9ca('0x23')](respondWithResult(_0x2c76ed,null))[_0xb9ca('0x43')](handleError(_0x2c76ed,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 98ff669..113336b 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 _0x7123=['uniqueid','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x141f74,_0x420286){var _0x3a462f=function(_0x4e0c27){while(--_0x4e0c27){_0x141f74['push'](_0x141f74['shift']());}};_0x3a462f(++_0x420286);}(_0x7123,0xfd));var _0x3712=function(_0x59c5c4,_0x4f1b73){_0x59c5c4=_0x59c5c4-0x0;var _0x185ab1=_0x7123[_0x59c5c4];return _0x185ab1;};'use strict';var _=require('lodash');var util=require(_0x3712('0x0'));var logger=require('../../config/logger')(_0x3712('0x1'));var moment=require(_0x3712('0x2'));var BPromise=require(_0x3712('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3712('0x4'));var rimraf=require(_0x3712('0x5'));var config=require(_0x3712('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x3712('0x7')]=function(_0x25f6e1,_0x4875a9){return _0x25f6e1[_0x3712('0x8')](_0x3712('0x9'),attributes,{'tableName':_0x3712('0xa'),'paranoid':![],'indexes':[{'name':_0x3712('0xb'),'fields':[_0x3712('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b81=['../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x380561,_0x3edcf8){var _0xbf13a0=function(_0x313926){while(--_0x313926){_0x380561['push'](_0x380561['shift']());}};_0xbf13a0(++_0x3edcf8);}(_0x5b81,0xd2));var _0x15b8=function(_0x4d112b,_0x5ce092){_0x4d112b=_0x4d112b-0x0;var _0x1500ed=_0x5b81[_0x4d112b];return _0x1500ed;};'use strict';var _=require('lodash');var util=require(_0x15b8('0x0'));var logger=require(_0x15b8('0x1'))(_0x15b8('0x2'));var moment=require('moment');var BPromise=require(_0x15b8('0x3'));var rp=require(_0x15b8('0x4'));var fs=require('fs');var path=require(_0x15b8('0x5'));var rimraf=require('rimraf');var config=require(_0x15b8('0x6'));var attributes=require(_0x15b8('0x7'));module[_0x15b8('0x8')]=function(_0x1c9694,_0x5ca7bc){return _0x1c9694[_0x15b8('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0x15b8('0xa'),'paranoid':![],'indexes':[{'name':_0x15b8('0xb'),'fields':[_0x15b8('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 6b56987..22cfcca 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 _0x1f3f=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x136b66,_0x25c3f9){var _0x1eebc0=function(_0x167d27){while(--_0x167d27){_0x136b66['push'](_0x136b66['shift']());}};_0x1eebc0(++_0x25c3f9);}(_0x1f3f,0x8d));var _0xf1f3=function(_0x38fbc2,_0x641aa1){_0x38fbc2=_0x38fbc2-0x0;var _0x43c7d4=_0x1f3f[_0x38fbc2];return _0x43c7d4;};'use strict';var _=require(_0xf1f3('0x0'));var util=require(_0xf1f3('0x1'));var moment=require(_0xf1f3('0x2'));var BPromise=require(_0xf1f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1f3('0x5'))(_0xf1f3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf1f3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f7a04,_0x38572b,_0x24b4ed){return new BPromise(function(_0x21eba7,_0x177383){return client[_0xf1f3('0x8')](_0x1f7a04,_0x24b4ed)[_0xf1f3('0x9')](function(_0x4b88fb){logger[_0xf1f3('0xa')](_0xf1f3('0xb'),_0x38572b,_0xf1f3('0xc'));logger[_0xf1f3('0xd')](_0xf1f3('0xe'),_0x38572b,_0xf1f3('0xc'),JSON[_0xf1f3('0xf')](_0x4b88fb));if(_0x4b88fb[_0xf1f3('0x10')]){if(_0x4b88fb[_0xf1f3('0x10')]['code']===0x1f4){logger[_0xf1f3('0x10')](_0xf1f3('0xb'),_0x38572b,_0x4b88fb[_0xf1f3('0x10')]['message']);return _0x177383(_0x4b88fb[_0xf1f3('0x10')][_0xf1f3('0x11')]);}logger[_0xf1f3('0x10')](_0xf1f3('0xb'),_0x38572b,_0x4b88fb[_0xf1f3('0x10')][_0xf1f3('0x11')]);return _0x21eba7(_0x4b88fb['error'][_0xf1f3('0x11')]);}else{logger[_0xf1f3('0xa')](_0xf1f3('0xb'),_0x38572b,'request\x20sent');_0x21eba7(_0x4b88fb[_0xf1f3('0x12')]['message']);}})[_0xf1f3('0x13')](function(_0x31794c){logger[_0xf1f3('0x10')](_0xf1f3('0xb'),_0x38572b,_0x31794c);_0x177383(_0x31794c);});});} \ No newline at end of file +var _0x44d6=['request\x20sent','stringify','error','code','message','info','result','catch','lodash','bluebird','ioredis','jayson/promise','client','then','WhatsappTransferReport,\x20%s,\x20%s','debug'];(function(_0x2e85b9,_0x2aa7bd){var _0x3337a5=function(_0x31928b){while(--_0x31928b){_0x2e85b9['push'](_0x2e85b9['shift']());}};_0x3337a5(++_0x2aa7bd);}(_0x44d6,0xb8));var _0x644d=function(_0x57808d,_0x3b6920){_0x57808d=_0x57808d-0x0;var _0x4f4ed1=_0x44d6[_0x57808d];return _0x4f4ed1;};'use strict';var _=require(_0x644d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x644d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x644d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x644d('0x3'));var client=jayson[_0x644d('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2adff6,_0x3f88b0,_0x3decd5){return new BPromise(function(_0x539994,_0x2354de){return client['request'](_0x2adff6,_0x3decd5)[_0x644d('0x5')](function(_0x9ac947){logger['info'](_0x644d('0x6'),_0x3f88b0,'request\x20sent');logger[_0x644d('0x7')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x3f88b0,_0x644d('0x8'),JSON[_0x644d('0x9')](_0x9ac947));if(_0x9ac947[_0x644d('0xa')]){if(_0x9ac947[_0x644d('0xa')][_0x644d('0xb')]===0x1f4){logger[_0x644d('0xa')](_0x644d('0x6'),_0x3f88b0,_0x9ac947['error'][_0x644d('0xc')]);return _0x2354de(_0x9ac947[_0x644d('0xa')][_0x644d('0xc')]);}logger['error'](_0x644d('0x6'),_0x3f88b0,_0x9ac947[_0x644d('0xa')]['message']);return _0x539994(_0x9ac947['error'][_0x644d('0xc')]);}else{logger[_0x644d('0xd')](_0x644d('0x6'),_0x3f88b0,_0x644d('0x8'));_0x539994(_0x9ac947[_0x644d('0xe')][_0x644d('0xc')]);}})[_0x644d('0xf')](function(_0x35829f){logger[_0x644d('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3f88b0,_0x35829f);_0x2354de(_0x35829f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 3628f2b..fe4eefd 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4989=['number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','status','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/license','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode'];(function(_0x52476c,_0x1950b4){var _0x37a1b1=function(_0x354db6){while(--_0x354db6){_0x52476c['push'](_0x52476c['shift']());}};_0x37a1b1(++_0x1950b4);}(_0x4989,0x79));var _0x9498=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0x4989[_0x1f71d8];return _0x10b045;};'use strict';var _=require(_0x9498('0x0'));var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x9498('0x1'));var rpc=require(_0x9498('0x2'));var config=require(_0x9498('0x3'));var logger=require(_0x9498('0x4'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x9498('0x5'));var schedule=require('./config/schedule');var chat=require(_0x9498('0x6'));var whatsapp=require(_0x9498('0x7'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x9498('0x8'));function main(){return db[_0x9498('0x9')][_0x9498('0xa')]()[_0x9498('0xb')](function(){if(config[_0x9498('0xc')]){return seedDb[_0x9498('0xd')]();}})[_0x9498('0xb')](function(){return checkLicense[_0x9498('0xd')]();})[_0x9498('0xb')](function(){return rpc[_0x9498('0xe')]();})[_0x9498('0xb')](function(_0x5ce9bf){logger[_0x9498('0xf')](_0x5ce9bf);return chat[_0x9498('0x10')]();})[_0x9498('0xb')](function(){return whatsapp['start']();})[_0x9498('0xb')](function(){return schedule[_0x9498('0x10')]();})['then'](function(){return transcribe['start']();})['then'](function(){return provider[_0x9498('0x10')]();})[_0x9498('0xb')](function(_0x44d06e){logger[_0x9498('0xf')](_0x44d06e);return pm2[_0x9498('0x10')](pm2Config);})[_0x9498('0xb')](function(_0x4de27c){var _0x3c2b7a=_0x4de27c[_0x9498('0x11')](function(_0x3605dd){return typeof _0x3605dd[_0x9498('0x12')]===_0x9498('0x13')&&_0x3605dd[_0x9498('0x12')]>=0x0;});if(_0x3c2b7a[_0x9498('0x14')]>0x0){throw new Error(_0x3c2b7a[_0x9498('0x14')]+_0x9498('0x15')+_[_0x9498('0x16')](_0x3c2b7a,function(_0x2cfa99){return'\x22'+_0x2cfa99[_0x9498('0x17')][_0x9498('0x18')]+'\x22';}));}logger[_0x9498('0xf')](_0x9498('0x19'),_[_0x9498('0x16')](_['filter'](_0x4de27c,{'status':_0x9498('0x1a')}),_0x9498('0x18'))[_0x9498('0x1b')]());logger[_0x9498('0xf')]('Offline\x20apps:',_[_0x9498('0x16')](_['filter'](_0x4de27c,function(_0x2cad3f){return _0x2cad3f[_0x9498('0x1c')]!==_0x9498('0x1a');}),'name')['join']()||'None');console[_0x9498('0x1d')](_0x9498('0x1e'));})['catch'](function(_0x12025f){console[_0x9498('0x1d')](_0x9498('0x1f'),_0x12025f);logger[_0x9498('0x20')](_0x9498('0x21'),_0x12025f);process[_0x9498('0x22')](0x1);});}main(); \ No newline at end of file +var _0xc99e=['./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','default','listen','start','info','filter','exitCode','number','length','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x1060f6,_0x50c582){var _0x166f37=function(_0x1884fc){while(--_0x1884fc){_0x1060f6['push'](_0x1060f6['shift']());}};_0x166f37(++_0x50c582);}(_0xc99e,0x6e));var _0xec99=function(_0x57b4cb,_0x307882){_0x57b4cb=_0x57b4cb-0x0;var _0x221ffd=_0xc99e[_0x57b4cb];return _0x221ffd;};'use strict';var _=require(_0xec99('0x0'));var db=require(_0xec99('0x1'))['db'];var seedDb=require(_0xec99('0x2'));var checkLicense=require(_0xec99('0x3'));var rpc=require(_0xec99('0x4'));var config=require(_0xec99('0x5'));var logger=require('./config/logger')(_0xec99('0x6'));var pm2=require(_0xec99('0x7'));var pm2Config=require(_0xec99('0x8'));var schedule=require(_0xec99('0x9'));var chat=require(_0xec99('0xa'));var whatsapp=require(_0xec99('0xb'));var transcribe=require(_0xec99('0xc'));var provider=require(_0xec99('0xd'));function main(){return db['sequelize'][_0xec99('0xe')]()[_0xec99('0xf')](function(){if(config['seedDB']){return seedDb[_0xec99('0x10')]();}})[_0xec99('0xf')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xec99('0x11')]();})[_0xec99('0xf')](function(_0x1a057a){logger['info'](_0x1a057a);return chat[_0xec99('0x12')]();})[_0xec99('0xf')](function(){return whatsapp[_0xec99('0x12')]();})[_0xec99('0xf')](function(){return schedule[_0xec99('0x12')]();})[_0xec99('0xf')](function(){return transcribe['start']();})[_0xec99('0xf')](function(){return provider['start']();})[_0xec99('0xf')](function(_0x53d44e){logger[_0xec99('0x13')](_0x53d44e);return pm2['start'](pm2Config);})['then'](function(_0xc7627){var _0x569825=_0xc7627[_0xec99('0x14')](function(_0x159c47){return typeof _0x159c47[_0xec99('0x15')]===_0xec99('0x16')&&_0x159c47[_0xec99('0x15')]>=0x0;});if(_0x569825[_0xec99('0x17')]>0x0){throw new Error(_0x569825[_0xec99('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xec99('0x18')](_0x569825,function(_0x52d9a7){return'\x22'+_0x52d9a7[_0xec99('0x19')][_0xec99('0x1a')]+'\x22';}));}logger[_0xec99('0x13')](_0xec99('0x1b'),_['map'](_['filter'](_0xc7627,{'status':'online'}),_0xec99('0x1a'))[_0xec99('0x1c')]());logger[_0xec99('0x13')](_0xec99('0x1d'),_[_0xec99('0x18')](_[_0xec99('0x14')](_0xc7627,function(_0x1644a8){return _0x1644a8['status']!=='online';}),_0xec99('0x1a'))[_0xec99('0x1c')]()||'None');console[_0xec99('0x1e')](_0xec99('0x1f'));})[_0xec99('0x20')](function(_0x2c4a60){console[_0xec99('0x1e')](_0xec99('0x21'),_0x2c4a60);logger[_0xec99('0x22')](_0xec99('0x23'),_0x2c4a60);process[_0xec99('0x24')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index d0fa63e..7a766b8 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 _0x6aa7=['smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','find','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','User','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','now','HS512','toString','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','util','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6aa7,0x178));var _0x76aa=function(_0x495fae,_0x603467){_0x495fae=_0x495fae-0x0;var _0x1339b8=_0x6aa7[_0x495fae];return _0x1339b8;};'use strict';var db=require(_0x76aa('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x76aa('0x1'));var licenseUtil=require(_0x76aa('0x2'));var encryptor=require(_0x76aa('0x3'));var _=require(_0x76aa('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x76aa('0x5'));var compose=require(_0x76aa('0x6'));var basicAuth=require(_0x76aa('0x7'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x76aa('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x76aa('0x9')][_0x76aa('0xa')]});var userAttributes=['id',_0x76aa('0xb'),'fullname',_0x76aa('0xc'),_0x76aa('0xd'),_0x76aa('0xe'),'userpic',_0x76aa('0xf'),_0x76aa('0x10'),_0x76aa('0x11'),_0x76aa('0x12'),_0x76aa('0x13'),_0x76aa('0x14'),_0x76aa('0x15'),_0x76aa('0x16'),_0x76aa('0x17'),_0x76aa('0x18'),'lastLoginAt',_0x76aa('0x19'),'crudPermissions',_0x76aa('0x1a'),_0x76aa('0x1b'),_0x76aa('0x1c'),_0x76aa('0x1d'),_0x76aa('0x1e'),'phoneBarDnd','phoneBarEnableRecording',_0x76aa('0x1f'),'phoneBarEnableSettings',_0x76aa('0x20'),_0x76aa('0x21'),'phoneBarRemoteControl',_0x76aa('0x22'),'hotdesk',_0x76aa('0x23'),'userProfileId',_0x76aa('0x24'),_0x76aa('0x25'),_0x76aa('0x26'),_0x76aa('0x27'),_0x76aa('0x28'),_0x76aa('0x29'),'ignorePauseForPreviewCalls','selectRecallMeCampaign',_0x76aa('0x2a'),_0x76aa('0x2b'),_0x76aa('0x2c'),_0x76aa('0x2d'),_0x76aa('0x2e'),_0x76aa('0x2f'),_0x76aa('0x30'),_0x76aa('0x31'),_0x76aa('0x32'),'faxAutoanswerDelay',_0x76aa('0x33'),_0x76aa('0x34')];exports[_0x76aa('0x35')]=function(){return this['isAuthenticated'](!![])[_0x76aa('0x36')](function(_0x189cb6,_0x31252f,_0x2bd2c6){if(_0x189cb6[_0x76aa('0x37')]){_0x2bd2c6();}else{return db[_0x76aa('0x38')][_0x76aa('0x39')]({'where':{'id':_0x189cb6[_0x76aa('0x3a')]['id']},'attributes':['id',_0x76aa('0x3b'),_0x76aa('0x3c')],'raw':!![]})[_0x76aa('0x3d')](function(_0x26b75e){if(_0x26b75e&&_0x26b75e[_0x76aa('0x3b')]){return _0x31252f['status'](_0x26b75e[_0x76aa('0x3c')]===_0x76aa('0x3e')?0x195:0x193)[_0x76aa('0x3f')]({'message':_0x26b75e[_0x76aa('0x3c')]===_0x76aa('0x3e')?_0x76aa('0x40'):_0x76aa('0x41')});}else{_0x2bd2c6();}})[_0x76aa('0x42')](function(_0xd12a99){_0x2bd2c6(_0xd12a99);});}});};exports[_0x76aa('0x43')]=function isAuthenticated(_0x545b06){return compose()[_0x76aa('0x36')](function(_0x5a8030,_0x994550,_0x365ff8){var _0x2dec94;if(_0x5a8030[_0x76aa('0x44')][_0x76aa('0x45')]){if(_[_0x76aa('0x46')](_0x5a8030[_0x76aa('0x44')][_0x76aa('0x45')],_0x76aa('0x47'))){var _0x3ea05a=basicAuth(_0x5a8030);db['User'][_0x76aa('0x48')]({'where':{'name':_0x3ea05a[_0x76aa('0xc')]}})[_0x76aa('0x3d')](function(_0x928ccf){if(!_0x928ccf||!_0x928ccf[_0x76aa('0x49')](_0x3ea05a[_0x76aa('0x4a')])){return _0x994550[_0x76aa('0x4b')](0x191)['json']({'message':_0x76aa('0x4c')});}_0x5a8030[_0x76aa('0x37')]={'id':_0x928ccf['id']};_0x365ff8();})['catch'](function(_0x2ee338){_0x365ff8(_0x2ee338);});}else if(_['startsWith'](_0x5a8030[_0x76aa('0x44')]['authorization'],_0x76aa('0x4d'))){validateJwt(_0x5a8030,_0x994550,_0x365ff8);}else{if(_0x545b06){_0x365ff8();}else{return _0x994550['status'](0x193)['json']({'message':_0x76aa('0x4e')});}}}else if(_0x5a8030[_0x76aa('0x4f')][_0x76aa('0x50')]){try{var _0x37dfab={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5a8030[_0x76aa('0x4f')][_0x76aa('0x50')],_0x37dfab)[_0x76aa('0x3d')](function(_0x23e2fd){return db[_0x76aa('0x51')]['find']({'where':{'id':_0x23e2fd[_0x76aa('0x52')]}})['then'](function(_0x5086f5){_0x2dec94=_0x5086f5;return db[_0x76aa('0x53')][_0x76aa('0x39')]({'where':{'id':0x1},'attributes':[_0x76aa('0x54'),_0x76aa('0x55')],'raw':!![]});})['then'](function(_0x401c07){if(!_0x2dec94||!_[_0x76aa('0x56')](_0x2dec94[_0x76aa('0x57')],_0x23e2fd['nonce'])){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x58')});}if(_0x2dec94[_0x76aa('0x59')]){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x5a')});}if(_0x2dec94[_0x76aa('0x5b')]){if(_0x401c07[_0x76aa('0x55')]>0x0){if(moment(_0x2dec94['blockedAt'])[_0x76aa('0x5c')](_0x401c07[_0x76aa('0x55')],_0x76aa('0x5d'))>moment()){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x5a')});}}else{return _0x994550['status'](0x191)['json']({'message':_0x76aa('0x5a')});}}_0x5a8030[_0x76aa('0x37')]={'id':_0x2dec94['id']};_0x365ff8();});})[_0x76aa('0x42')](function(){return _0x994550[_0x76aa('0x4b')](0x191)['json']({'message':_0x76aa('0x5a')});});}catch(_0x403084){_0x365ff8(_0x403084);}}else if(_0x545b06){_0x365ff8();}else{return _0x994550[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x4e')});}})['use'](function(_0x13dafe,_0x556f59,_0xbb3136){if(_0x13dafe['user']){db['User']['find']({'where':{'id':_0x13dafe[_0x76aa('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5cf314){if(!_0x5cf314){return _0x556f59['status'](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x5e')});}_0x13dafe[_0x76aa('0x37')]=_0x5cf314;_0xbb3136();})[_0x76aa('0x42')](function(_0x27a52e){_0xbb3136(_0x27a52e);});}else if(_0x545b06){_0xbb3136();}else{return _0x556f59['status'](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x5f')});}});};exports[_0x76aa('0x60')]=function canUpdate(){return compose()[_0x76aa('0x36')](function(_0x3800a4,_0x47a308,_0x2f695c){return licenseUtil[_0x76aa('0x61')]()['then'](function(_0x2d3441){if(_0x2d3441['update']){_0x2f695c();}else{return _0x47a308[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x62')});}})[_0x76aa('0x42')](function(_0x2d0bc4){_0x2f695c(_0x2d0bc4);});});};exports[_0x76aa('0x63')]=function isWebrtcLicence(){return compose()[_0x76aa('0x36')](function(_0x165858,_0xb8d052,_0x3946bd){return licenseUtil['getLicense']()[_0x76aa('0x3d')](function(_0x4b8f12){if(_0x4b8f12[_0x76aa('0x64')]){_0x3946bd();}else{return _0xb8d052[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x62')});}})['catch'](function(_0x5a3d9c){_0x3946bd(_0x5a3d9c);});});};exports[_0x76aa('0x65')]=function(_0x54b673,_0x8660a4,_0x302a0c){_0x54b673[_0x76aa('0x65')]=!![];return _0x302a0c();};exports[_0x76aa('0x66')]=function signToken(_0x30c577){return signJwt(_0x30c577);};exports[_0x76aa('0x67')]=function(_0x5b567b,_0x564546){if(!_0x5b567b[_0x76aa('0x37')]){return _0x564546[_0x76aa('0x4b')](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x68')});}var _0x18c679={'payload':{'id':_0x5b567b[_0x76aa('0x37')]['id'],'role':_0x5b567b['user'][_0x76aa('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x18c679)[_0x76aa('0x3d')](function(_0x26db69){_0x564546['cookie'](_0x76aa('0x69'),_0x26db69);_0x564546['redirect'](_0x76aa('0x6a'));})['catch'](function(_0x339b0d){return _0x564546[_0x76aa('0x4b')](0x1f4)[_0x76aa('0x6b')](_0x339b0d);});};exports[_0x76aa('0x6c')]=function(_0x37a4d9){if(_[_0x76aa('0x6d')](_0x37a4d9[_0x76aa('0x57')])||_['isNil'](_0x37a4d9[_0x76aa('0x6e')])){return null;}else{return createJwt(_0x37a4d9);}};exports['generateApiKey']=function(_0x3ee32){_0x3ee32[_0x76aa('0x57')]=generateNonce();_0x3ee32[_0x76aa('0x6e')]=generateIssuedAt();return createJwt(_0x3ee32);};exports[_0x76aa('0x6f')]=function(_0x3fa7ec,_0x28f8aa){var _0x336024=_0x3fa7ec['query'][_0x76aa('0x50')];if(_0x336024){var _0x281f73={'nonce':_0x28f8aa[_0x76aa('0x57')],'iat':_0x28f8aa[_0x76aa('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x76aa('0x70')]()};return verifyJwt(_0x336024,_0x281f73)[_0x76aa('0x3d')](function(){return generateApiKey(_0x28f8aa);});}else{throw{'message':_0x76aa('0x71')};}};exports[_0x76aa('0x72')]=function(_0x2027f8){var _0xf7732=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xf7732['test'](_0x2027f8))throw new db[(_0x76aa('0x73'))][(_0x76aa('0x74'))](_0x76aa('0x75'));return;};exports[_0x76aa('0x76')]=function(_0x3967f3,_0x2fdc4f,_0x37babe){var _0x51893b=encryptor['decryptString'](_0x2fdc4f)[_0x76aa('0x77')](',');for(var _0x3b0d8a=0x0;_0x3b0d8a<_0x37babe;_0x3b0d8a++){if(!_0x51893b[_0x3b0d8a])break;if(_0x3967f3['toLowerCase']()===_0x51893b[_0x3b0d8a][_0x76aa('0x78')]()){var _0x1e6f3c=util['format'](_0x76aa('0x79'),_0x37babe);if(_0x37babe===0x1){_0x1e6f3c=_0x76aa('0x7a');}throw new db[(_0x76aa('0x73'))][(_0x76aa('0x74'))](_0x1e6f3c);}}return;};exports[_0x76aa('0x7b')]=function(_0x1f5010,_0x3376ec){var _0x30573a=_0x3376ec?encryptor[_0x76aa('0x7c')](_0x3376ec)['split'](','):[];if(_0x30573a[_0x76aa('0x7d')]===0x5){_0x30573a['splice'](-0x1,0x1);}_0x30573a[_0x76aa('0x7e')](_0x1f5010);return encryptor[_0x76aa('0x7f')](_0x30573a[_0x76aa('0x80')](','));};function signJwt(_0x16cc85){var _0x343cf1=BPromise[_0x76aa('0x81')](jwt[_0x76aa('0x82')],{'context':jwt});var _0x431d1c=_0x16cc85[_0x76aa('0x83')]||config['secrets'][_0x76aa('0xa')];return new BPromise(function(_0x3d4025,_0x5c542b){_0x343cf1(_0x16cc85[_0x76aa('0x84')],_0x431d1c,_0x16cc85[_0x76aa('0x85')])[_0x76aa('0x3d')](function(_0x3d6d10){_0x3d4025(_0x3d6d10);})[_0x76aa('0x42')](function(_0x5546b6){_0x5c542b(_0x5546b6);});});}function verifyJwt(_0x364d05,_0x4d3ad0,_0x35bd2b){var _0x35881c=BPromise[_0x76aa('0x81')](jwt[_0x76aa('0x86')],{'context':jwt});var _0x3a82fe=_0x35bd2b||config[_0x76aa('0x9')][_0x76aa('0xa')];return new BPromise(function(_0x4a37f1,_0x9ea0af){_0x35881c(_0x364d05,_0x3a82fe,_0x4d3ad0)[_0x76aa('0x3d')](function(_0x543c1d){_0x4a37f1(_0x543c1d);})['catch'](function(_0x40429c){_0x9ea0af(_0x40429c);});});}function generateNonce(){return crypto[_0x76aa('0x87')](0x10)['toString'](_0x76aa('0x88'));}function generateIssuedAt(){return Math[_0x76aa('0x89')](Date[_0x76aa('0x8a')]()/0x3e8)['toString']();}function createJwt(_0x446073){var _0x47f733={'payload':{'iat':_0x446073[_0x76aa('0x6e')],'nonce':_0x446073[_0x76aa('0x57')]},'options':{'algorithm':_0x76aa('0x8b'),'subject':_0x446073['id'][_0x76aa('0x8c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x47f733)[_0x76aa('0x3d')](function(_0x4dfeb3){return{'iat':_0x446073[_0x76aa('0x6e')],'nonce':_0x446073[_0x76aa('0x57')],'token':_0x4dfeb3};});} \ No newline at end of file +var _0x70e0=['express-jwt','composable-middleware','crypto','util','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','catch','headers','authorization','startsWith','Basic','User','authenticate','Bearer','status','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','splice','encryptString','promisify','sign','secret','secrets','session','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken'];(function(_0x167a99,_0x1bbb59){var _0x442d62=function(_0x12c3f8){while(--_0x12c3f8){_0x167a99['push'](_0x167a99['shift']());}};_0x442d62(++_0x1bbb59);}(_0x70e0,0x17b));var _0x070e=function(_0x4e36d1,_0x4c38e7){_0x4e36d1=_0x4e36d1-0x0;var _0x2ff0e2=_0x70e0[_0x4e36d1];return _0x2ff0e2;};'use strict';var db=require(_0x070e('0x0'))['db'];var config=require(_0x070e('0x1'));var hardwareConf=require(_0x070e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x070e('0x3'));var jwt=require(_0x070e('0x4'));var expressJwt=require(_0x070e('0x5'));var compose=require(_0x070e('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x070e('0x7'));var BPromise=require('bluebird');var util=require(_0x070e('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x070e('0x9'),_0x070e('0xa'),_0x070e('0xb'),_0x070e('0xc'),_0x070e('0xd'),_0x070e('0xe'),_0x070e('0xf'),'md5secret','voicePause',_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13'),_0x070e('0x14'),_0x070e('0x15'),_0x070e('0x16'),_0x070e('0x17'),_0x070e('0x18'),_0x070e('0x19'),_0x070e('0x1a'),'passwordResetAt','alias',_0x070e('0x1b'),'phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording',_0x070e('0x1c'),_0x070e('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0x070e('0x1e'),_0x070e('0x1f'),_0x070e('0x20'),_0x070e('0x21'),'userProfileId','privacyEnabled',_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26'),'ignorePauseForPreviewCalls',_0x070e('0x27'),_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a'),_0x070e('0x2b'),'smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer',_0x070e('0x2c'),_0x070e('0x2d'),_0x070e('0x2e'),'whatsappAutoanswer',_0x070e('0x2f')];exports['isChatInteractionAuthorized']=function(){return this[_0x070e('0x30')](!![])[_0x070e('0x31')](function(_0x27a01e,_0x33e8c6,_0x28a1c3){if(_0x27a01e[_0x070e('0x32')]){_0x28a1c3();}else{return db[_0x070e('0x33')][_0x070e('0x34')]({'where':{'id':_0x27a01e['params']['id']},'attributes':['id',_0x070e('0x35'),_0x070e('0x36')],'raw':!![]})[_0x070e('0x37')](function(_0x503f4d){if(_0x503f4d&&_0x503f4d[_0x070e('0x35')]){return _0x33e8c6['status'](_0x503f4d['disposition']===_0x070e('0x38')?0x195:0x193)[_0x070e('0x39')]({'message':_0x503f4d[_0x070e('0x36')]===_0x070e('0x38')?_0x070e('0x3a'):'Forbidden.'});}else{_0x28a1c3();}})[_0x070e('0x3b')](function(_0x219e48){_0x28a1c3(_0x219e48);});}});};exports[_0x070e('0x30')]=function isAuthenticated(_0x1d2a34){return compose()[_0x070e('0x31')](function(_0x28d7f2,_0x1a1892,_0x26373b){var _0x5e8326;if(_0x28d7f2[_0x070e('0x3c')][_0x070e('0x3d')]){if(_[_0x070e('0x3e')](_0x28d7f2['headers']['authorization'],_0x070e('0x3f'))){var _0x46065c=basicAuth(_0x28d7f2);db[_0x070e('0x40')]['find']({'where':{'name':_0x46065c[_0x070e('0xb')]}})[_0x070e('0x37')](function(_0x3a9425){if(!_0x3a9425||!_0x3a9425[_0x070e('0x41')](_0x46065c['pass'])){return _0x1a1892['status'](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x28d7f2[_0x070e('0x32')]={'id':_0x3a9425['id']};_0x26373b();})['catch'](function(_0x1dff97){_0x26373b(_0x1dff97);});}else if(_[_0x070e('0x3e')](_0x28d7f2['headers']['authorization'],_0x070e('0x42'))){validateJwt(_0x28d7f2,_0x1a1892,_0x26373b);}else{if(_0x1d2a34){_0x26373b();}else{return _0x1a1892[_0x070e('0x43')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x28d7f2[_0x070e('0x44')][_0x070e('0x45')]){try{var _0x444d02={'audience':hardwareConf[_0x070e('0x46')](),'issuer':hardwareConf[_0x070e('0x46')]()};verifyJwt(_0x28d7f2['query']['apikey'],_0x444d02)[_0x070e('0x37')](function(_0x3011c4){return db[_0x070e('0x40')][_0x070e('0x47')]({'where':{'id':_0x3011c4[_0x070e('0x48')]}})['then'](function(_0x22f3a9){_0x5e8326=_0x22f3a9;return db[_0x070e('0x49')]['findOne']({'where':{'id':0x1},'attributes':[_0x070e('0x4a'),_0x070e('0x4b')],'raw':!![]});})['then'](function(_0x4d4ee8){if(!_0x5e8326||!_['isEqual'](_0x5e8326[_0x070e('0x4c')],_0x3011c4[_0x070e('0x4d')])){return _0x1a1892[_0x070e('0x43')](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4e')});}if(_0x5e8326['disabled']){return _0x1a1892[_0x070e('0x43')](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4f')});}if(_0x5e8326['blocked']){if(_0x4d4ee8[_0x070e('0x4b')]>0x0){if(moment(_0x5e8326[_0x070e('0x50')])[_0x070e('0x51')](_0x4d4ee8['blockDuration'],_0x070e('0x52'))>moment()){return _0x1a1892[_0x070e('0x43')](0x191)['json']({'message':_0x070e('0x4f')});}}else{return _0x1a1892['status'](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4f')});}}_0x28d7f2[_0x070e('0x32')]={'id':_0x5e8326['id']};_0x26373b();});})[_0x070e('0x3b')](function(){return _0x1a1892[_0x070e('0x43')](0x191)['json']({'message':_0x070e('0x4f')});});}catch(_0x5db2ce){_0x26373b(_0x5db2ce);}}else if(_0x1d2a34){_0x26373b();}else{return _0x1a1892['status'](0x193)[_0x070e('0x39')]({'message':_0x070e('0x53')});}})[_0x070e('0x31')](function(_0x4d52ff,_0x2ad56c,_0x1223be){if(_0x4d52ff[_0x070e('0x32')]){db[_0x070e('0x40')]['find']({'where':{'id':_0x4d52ff[_0x070e('0x32')]['id']},'attributes':userAttributes})['then'](function(_0x544b53){if(!_0x544b53){return _0x2ad56c['status'](0x194)[_0x070e('0x39')]({'message':_0x070e('0x54')});}_0x4d52ff[_0x070e('0x32')]=_0x544b53;_0x1223be();})[_0x070e('0x3b')](function(_0x34f23e){_0x1223be(_0x34f23e);});}else if(_0x1d2a34){_0x1223be();}else{return _0x2ad56c['status'](0x194)[_0x070e('0x39')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x070e('0x55')]=function canUpdate(){return compose()[_0x070e('0x31')](function(_0xff760c,_0x52fcea,_0x54285a){return licenseUtil[_0x070e('0x56')]()['then'](function(_0x35349f){if(_0x35349f[_0x070e('0x57')]){_0x54285a();}else{return _0x52fcea[_0x070e('0x43')](0x193)['json']({'message':_0x070e('0x58')});}})[_0x070e('0x3b')](function(_0x48d836){_0x54285a(_0x48d836);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x070e('0x31')](function(_0x945901,_0x2d43ce,_0x1fc7c4){return licenseUtil[_0x070e('0x56')]()['then'](function(_0x20b80e){if(_0x20b80e[_0x070e('0x59')]){_0x1fc7c4();}else{return _0x2d43ce[_0x070e('0x43')](0x193)[_0x070e('0x39')]({'message':_0x070e('0x58')});}})[_0x070e('0x3b')](function(_0x1f54d5){_0x1fc7c4(_0x1f54d5);});});};exports[_0x070e('0x5a')]=function(_0xd67987,_0x66a3f3,_0x210c4d){_0xd67987[_0x070e('0x5a')]=!![];return _0x210c4d();};exports[_0x070e('0x5b')]=function signToken(_0x216d27){return signJwt(_0x216d27);};exports[_0x070e('0x5c')]=function(_0x5e051a,_0x171621){if(!_0x5e051a[_0x070e('0x32')]){return _0x171621[_0x070e('0x43')](0x194)[_0x070e('0x39')]({'message':_0x070e('0x5d')});}var _0x3bd738={'payload':{'id':_0x5e051a[_0x070e('0x32')]['id'],'role':_0x5e051a[_0x070e('0x32')][_0x070e('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3bd738)['then'](function(_0x251696){_0x171621['cookie'](_0x070e('0x5e'),_0x251696);_0x171621[_0x070e('0x5f')]('/dashboards/general');})[_0x070e('0x3b')](function(_0x130a50){return _0x171621[_0x070e('0x43')](0x1f4)[_0x070e('0x60')](_0x130a50);});};exports[_0x070e('0x61')]=function(_0x1e8a4f){if(_[_0x070e('0x62')](_0x1e8a4f['apiKeyNonce'])||_[_0x070e('0x62')](_0x1e8a4f['apiKeyIat'])){return null;}else{return createJwt(_0x1e8a4f);}};exports['generateApiKey']=function(_0x3a06c6){_0x3a06c6[_0x070e('0x4c')]=generateNonce();_0x3a06c6[_0x070e('0x63')]=generateIssuedAt();return createJwt(_0x3a06c6);};exports[_0x070e('0x64')]=function(_0x202015,_0x7948ed){var _0x440fa1=_0x202015[_0x070e('0x44')]['apikey'];if(_0x440fa1){var _0x477e69={'nonce':_0x7948ed['apiKeyNonce'],'iat':_0x7948ed['apiKeyIat'],'audience':hardwareConf[_0x070e('0x46')](),'issuer':hardwareConf[_0x070e('0x46')]()};return verifyJwt(_0x440fa1,_0x477e69)['then'](function(){return generateApiKey(_0x7948ed);});}else{throw{'message':_0x070e('0x65')};}};exports[_0x070e('0x66')]=function(_0x210f4a){var _0x2f8104=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2f8104[_0x070e('0x67')](_0x210f4a))throw new db[(_0x070e('0x68'))][(_0x070e('0x69'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x5943e3,_0x3087e5,_0x1948a5){var _0x29f497=encryptor[_0x070e('0x6a')](_0x3087e5)['split'](',');for(var _0x25f34c=0x0;_0x25f34c<_0x1948a5;_0x25f34c++){if(!_0x29f497[_0x25f34c])break;if(_0x5943e3['toLowerCase']()===_0x29f497[_0x25f34c][_0x070e('0x6b')]()){var _0x1cbb7e=util[_0x070e('0x6c')](_0x070e('0x6d'),_0x1948a5);if(_0x1948a5===0x1){_0x1cbb7e=_0x070e('0x6e');}throw new db[(_0x070e('0x68'))]['ValidationError'](_0x1cbb7e);}}return;};exports[_0x070e('0x6f')]=function(_0x18e8d0,_0x8aaf00){var _0x533431=_0x8aaf00?encryptor[_0x070e('0x6a')](_0x8aaf00)[_0x070e('0x70')](','):[];if(_0x533431['length']===0x5){_0x533431[_0x070e('0x71')](-0x1,0x1);}_0x533431['unshift'](_0x18e8d0);return encryptor[_0x070e('0x72')](_0x533431['join'](','));};function signJwt(_0x4cb86f){var _0x4b354d=BPromise[_0x070e('0x73')](jwt[_0x070e('0x74')],{'context':jwt});var _0x1100d8=_0x4cb86f[_0x070e('0x75')]||config[_0x070e('0x76')][_0x070e('0x77')];return new BPromise(function(_0x498bc6,_0x841c89){_0x4b354d(_0x4cb86f['payload'],_0x1100d8,_0x4cb86f[_0x070e('0x78')])['then'](function(_0x2e10f7){_0x498bc6(_0x2e10f7);})[_0x070e('0x3b')](function(_0x5b0b46){_0x841c89(_0x5b0b46);});});}function verifyJwt(_0x1bcdc3,_0x50399e,_0x1a9e25){var _0x139630=BPromise[_0x070e('0x73')](jwt[_0x070e('0x79')],{'context':jwt});var _0x764b06=_0x1a9e25||config[_0x070e('0x76')][_0x070e('0x77')];return new BPromise(function(_0x148f1d,_0x3ef9cc){_0x139630(_0x1bcdc3,_0x764b06,_0x50399e)[_0x070e('0x37')](function(_0x40c560){_0x148f1d(_0x40c560);})[_0x070e('0x3b')](function(_0x455bf2){_0x3ef9cc(_0x455bf2);});});}function generateNonce(){return crypto[_0x070e('0x7a')](0x10)['toString'](_0x070e('0x7b'));}function generateIssuedAt(){return Math[_0x070e('0x7c')](Date[_0x070e('0x7d')]()/0x3e8)[_0x070e('0x7e')]();}function createJwt(_0x5712d1){var _0x2ccd8d={'payload':{'iat':_0x5712d1[_0x070e('0x63')],'nonce':_0x5712d1[_0x070e('0x4c')]},'options':{'algorithm':_0x070e('0x7f'),'subject':_0x5712d1['id'][_0x070e('0x7e')](),'issuer':hardwareConf[_0x070e('0x46')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x2ccd8d)[_0x070e('0x37')](function(_0x7d154){return{'iat':_0x5712d1[_0x070e('0x63')],'nonce':_0x5712d1[_0x070e('0x4c')],'token':_0x7d154};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index da3c192..778f58c 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 _0x5f66=['buildContactsQuery','getFilteredContacts','catch','CmContact','keys','filter','cf_','CmCustomField','slice','all','length','./sql-utils','findAll','resolve','then','search','parseAdvancedSearchFilter','where','default','fields','clause','user','skip','checkListsRestrictions','ids','tag','count'];(function(_0x3dfe8f,_0x230080){var _0x49a6e1=function(_0x206623){while(--_0x206623){_0x3dfe8f['push'](_0x3dfe8f['shift']());}};_0x49a6e1(++_0x230080);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var sqlUtils=require(_0x65f6('0x0'));var db=require('../../mysqldb')['db'];exports[_0x65f6('0x1')]=function(_0x2f06ae,_0x3461cd,_0xbce843,_0x1a330c){var _0x5eb9ad={'count':0x0,'rows':[]};var _0x3c5029=sqlUtils['skipContactsQuery'](_0x3461cd,_0x2f06ae);if(_0x3c5029){return Promise[_0x65f6('0x2')](_0x5eb9ad);}var _0x22b017=sqlUtils['getContactsSubquery']();var _0x4ed98f={};var _0x1c0e12=![];var _0x2c6571=![];return Promise[_0x65f6('0x2')]()[_0x65f6('0x3')](function(){if(_0x2f06ae[_0x65f6('0x4')]){return sqlUtils[_0x65f6('0x5')](_0x2f06ae['search'],_0x1a330c);}else{return sqlUtils['parseQueryParameters'](_0x2f06ae,_0x1a330c);}})[_0x65f6('0x3')](function(_0x2f6d5b){_0x22b017[_0x65f6('0x6')](_0x2f6d5b[_0x65f6('0x7')]);_0x22b017['where'](_0x2f6d5b[_0x65f6('0x8')]);_0x22b017['where'](_0x2f6d5b['filter']);_0x22b017[_0x65f6('0x6')](_0x2f6d5b['user'][_0x65f6('0x9')]);_0x4ed98f=_0x2f6d5b['tags'];_0x2c6571=_0x2f6d5b[_0x65f6('0xa')][_0x65f6('0xb')];return sqlUtils[_0x65f6('0xc')](_0x3461cd,_0x2f06ae,_0x2c6571);})[_0x65f6('0x3')](function(_0x369f96){_0x22b017[_0x65f6('0x6')](_0x369f96);var _0x44144b=_0x2f06ae[_0x65f6('0x4')]?_0x4ed98f[_0x65f6('0xd')]:_0x2f06ae[_0x65f6('0xe')];_0x1c0e12=_0x44144b?!![]:![];return sqlUtils['countFilteredContacts'](_0x22b017,_0x44144b);})[_0x65f6('0x3')](function(_0x49a913){_0x5eb9ad['count']=_0x49a913;if(_0x5eb9ad[_0x65f6('0xf')]===0x0){return;}return sqlUtils[_0x65f6('0x10')](_0x22b017,_0x2f06ae[_0x65f6('0x8')],_0xbce843,_0x1c0e12,_0x4ed98f[_0x65f6('0x9')],_0x2c6571);})[_0x65f6('0x3')](function(_0x1f974c){if(!_0x1f974c){return[];}return sqlUtils[_0x65f6('0x11')](_0x1f974c,_0x2f06ae,_0xbce843);})[_0x65f6('0x3')](function(_0x495dd6){_0x5eb9ad['rows']=_0x495dd6;return _0x5eb9ad;})[_0x65f6('0x12')](function(_0x5b4055){throw _0x5b4055;});};exports['describe']=function(){var _0x5c5b91={};var _0x365159=[];return db[_0x65f6('0x13')]['describe']()[_0x65f6('0x3')](function(_0x270893){_0x5c5b91=_0x270893;var _0xbee6a4=Object[_0x65f6('0x14')](_0x5c5b91)[_0x65f6('0x15')](function(_0xc139c2){return _['startsWith'](_0xc139c2,_0x65f6('0x16'))?_0xc139c2:undefined;});var _0x4bb39e=_0xbee6a4['map'](function(_0x212247){return db[_0x65f6('0x17')]['findOne']({'where':{'id':_0x212247[_0x65f6('0x18')](0x3)},'raw':!![]});});return Promise[_0x65f6('0x19')](_0x4bb39e);})[_0x65f6('0x3')](function(_0x2774a1){for(var _0x4f5a69=0x0;_0x4f5a69<_0x2774a1[_0x65f6('0x1a')];_0x4f5a69++){if(_0x2774a1[_0x4f5a69]){var _0x59ea32=_0x65f6('0x16')+_0x2774a1[_0x4f5a69]['id'];_0x5c5b91[_0x59ea32]['fieldType']=_0x2774a1[_0x4f5a69]['type'];}}_0x365159=_['map'](Object[_0x65f6('0x14')](_0x5c5b91),function(_0x16cde8){return{'name':_0x16cde8,'type':_0x5c5b91[_0x16cde8]['type']};});return _0x365159;})[_0x65f6('0x12')](function(_0x28f710){throw _0x28f710;});}; \ No newline at end of file +var _0x5f66=['buildContactsQuery','getFilteredContacts','catch','CmContact','keys','filter','cf_','CmCustomField','slice','all','length','./sql-utils','findAll','resolve','then','search','parseAdvancedSearchFilter','where','default','fields','clause','user','skip','checkListsRestrictions','ids','tag','count'];(function(_0x3c7893,_0x2748a8){var _0xc06425=function(_0x244475){while(--_0x244475){_0x3c7893['push'](_0x3c7893['shift']());}};_0xc06425(++_0x2748a8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var sqlUtils=require(_0x65f6('0x0'));var db=require('../../mysqldb')['db'];exports[_0x65f6('0x1')]=function(_0x2f06ae,_0x3461cd,_0xbce843,_0x1a330c){var _0x5eb9ad={'count':0x0,'rows':[]};var _0x3c5029=sqlUtils['skipContactsQuery'](_0x3461cd,_0x2f06ae);if(_0x3c5029){return Promise[_0x65f6('0x2')](_0x5eb9ad);}var _0x22b017=sqlUtils['getContactsSubquery']();var _0x4ed98f={};var _0x1c0e12=![];var _0x2c6571=![];return Promise[_0x65f6('0x2')]()[_0x65f6('0x3')](function(){if(_0x2f06ae[_0x65f6('0x4')]){return sqlUtils[_0x65f6('0x5')](_0x2f06ae['search'],_0x1a330c);}else{return sqlUtils['parseQueryParameters'](_0x2f06ae,_0x1a330c);}})[_0x65f6('0x3')](function(_0x2f6d5b){_0x22b017[_0x65f6('0x6')](_0x2f6d5b[_0x65f6('0x7')]);_0x22b017['where'](_0x2f6d5b[_0x65f6('0x8')]);_0x22b017['where'](_0x2f6d5b['filter']);_0x22b017[_0x65f6('0x6')](_0x2f6d5b['user'][_0x65f6('0x9')]);_0x4ed98f=_0x2f6d5b['tags'];_0x2c6571=_0x2f6d5b[_0x65f6('0xa')][_0x65f6('0xb')];return sqlUtils[_0x65f6('0xc')](_0x3461cd,_0x2f06ae,_0x2c6571);})[_0x65f6('0x3')](function(_0x369f96){_0x22b017[_0x65f6('0x6')](_0x369f96);var _0x44144b=_0x2f06ae[_0x65f6('0x4')]?_0x4ed98f[_0x65f6('0xd')]:_0x2f06ae[_0x65f6('0xe')];_0x1c0e12=_0x44144b?!![]:![];return sqlUtils['countFilteredContacts'](_0x22b017,_0x44144b);})[_0x65f6('0x3')](function(_0x49a913){_0x5eb9ad['count']=_0x49a913;if(_0x5eb9ad[_0x65f6('0xf')]===0x0){return;}return sqlUtils[_0x65f6('0x10')](_0x22b017,_0x2f06ae[_0x65f6('0x8')],_0xbce843,_0x1c0e12,_0x4ed98f[_0x65f6('0x9')],_0x2c6571);})[_0x65f6('0x3')](function(_0x1f974c){if(!_0x1f974c){return[];}return sqlUtils[_0x65f6('0x11')](_0x1f974c,_0x2f06ae,_0xbce843);})[_0x65f6('0x3')](function(_0x495dd6){_0x5eb9ad['rows']=_0x495dd6;return _0x5eb9ad;})[_0x65f6('0x12')](function(_0x5b4055){throw _0x5b4055;});};exports['describe']=function(){var _0x5c5b91={};var _0x365159=[];return db[_0x65f6('0x13')]['describe']()[_0x65f6('0x3')](function(_0x270893){_0x5c5b91=_0x270893;var _0xbee6a4=Object[_0x65f6('0x14')](_0x5c5b91)[_0x65f6('0x15')](function(_0xc139c2){return _['startsWith'](_0xc139c2,_0x65f6('0x16'))?_0xc139c2:undefined;});var _0x4bb39e=_0xbee6a4['map'](function(_0x212247){return db[_0x65f6('0x17')]['findOne']({'where':{'id':_0x212247[_0x65f6('0x18')](0x3)},'raw':!![]});});return Promise[_0x65f6('0x19')](_0x4bb39e);})[_0x65f6('0x3')](function(_0x2774a1){for(var _0x4f5a69=0x0;_0x4f5a69<_0x2774a1[_0x65f6('0x1a')];_0x4f5a69++){if(_0x2774a1[_0x4f5a69]){var _0x59ea32=_0x65f6('0x16')+_0x2774a1[_0x4f5a69]['id'];_0x5c5b91[_0x59ea32]['fieldType']=_0x2774a1[_0x4f5a69]['type'];}}_0x365159=_['map'](Object[_0x65f6('0x14')](_0x5c5b91),function(_0x16cde8){return{'name':_0x16cde8,'type':_0x5c5b91[_0x16cde8]['type']};});return _0x365159;})[_0x65f6('0x12')](function(_0x28f710){throw _0x28f710;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 8bf3d6b..183f27b 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 _0xf958=['c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','sequelize','query','TagIds','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','../parsers/advancedSearch','../interaction/utils','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','CompanyId','createdAt','updatedAt','deletedAt','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.mobile\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','fieldType','castTo','buildExpression','type','default','text','value','start','end','Tag','map','tags','and','ids','user','clause','uc.UserId\x20=\x20?','skip','keys','some','Contact','push','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','fields','tag','filter','role','getLists'];(function(_0x3a1b30,_0x58374b){var _0x555d24=function(_0x2ce087){while(--_0x2ce087){_0x3a1b30['push'](_0x3a1b30['shift']());}};_0x555d24(++_0x58374b);}(_0xf958,0xe6));var _0x8f95=function(_0x2167eb,_0x1b1204){_0x2167eb=_0x2167eb-0x0;var _0xb94da7=_0xf958[_0x2167eb];return _0xb94da7;};'use strict';var _=require(_0x8f95('0x0'));var squel=require('squel');var as=require(_0x8f95('0x1'));var qs=require('../parsers/qs');var utils=require(_0x8f95('0x2'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x3155dc,_0x3fbf4f){var _0x1aeb7b=![];if(_0x3155dc['role']==='agent'&&!_0x3fbf4f[_0x8f95('0x3')]&&!_0x3fbf4f[_0x8f95('0x4')]&&_0x3fbf4f[_0x8f95('0x5')]!==_0x8f95('0x6')){_0x1aeb7b=!![];}return _0x1aeb7b;}function getContactsSubquery(){return squel['select']()[_0x8f95('0x7')](_0x8f95('0x8'),'c')[_0x8f95('0x9')](_0x8f95('0xa'));}function applyJoinClauses(_0x3b695c,_0x585025){var _0x378eb1=_0x585025?'c':_0x8f95('0xb');_0x3b695c['left_join'](_0x8f95('0xc'),'uc',_0x8f95('0xd')+_0x378eb1+_0x8f95('0xe'))['left_join'](_0x8f95('0xf'),'ct',_0x8f95('0x10')+_0x378eb1+_0x8f95('0xe'))['left_join'](_0x8f95('0x11'),'t',_0x8f95('0x12'));return _0x3b695c;}function addFieldsToQuery(_0x7fc65f,_0x5d4acf,_0x19bcc8,_0x10e077,_0x230d97){var _0x13f9e8=_0x230d97?'c':_0x8f95('0xb');if(!_0x5d4acf){_0x5d4acf=['id',_0x8f95('0x13'),_0x8f95('0x14'),'phone','mobile','fax','email','ListId',_0x8f95('0x15'),_0x8f95('0x16'),_0x8f95('0x17'),_0x8f95('0x18'),'TagIds'];}var _0x5da758=_0x19bcc8&&_0x230d97||!_0x19bcc8&&!_0x230d97;if(_0x10e077){_0x5da758=_0x10e077&&_0x230d97||!_0x10e077&&!_0x230d97;}_0x5d4acf[_0x8f95('0x19')](function(_0x17b85b){if(_0x17b85b==='TagIds'){if(_0x5da758){_0x7fc65f[_0x8f95('0x1a')](_0x8f95('0x1b'),_0x17b85b);}else if(_0x19bcc8||_0x10e077){_0x7fc65f[_0x8f95('0x1a')](_0x13f9e8+'.'+_0x17b85b);}}else{_0x7fc65f[_0x8f95('0x1a')](_0x13f9e8+'.'+_0x17b85b);}});return _0x7fc65f;}function getSqlClauses(){var _0x4f2f60={'default':squel[_0x8f95('0x1c')](),'fields':squel[_0x8f95('0x1c')](),'filter':squel[_0x8f95('0x1c')](),'tags':{'clause':squel[_0x8f95('0x1c')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x4f2f60;}function parseTagParameter(_0x53f819){var _0x314ba6=squel[_0x8f95('0x1c')]();if(_0x53f819){var _0x13e7c5=utils[_0x8f95('0x1d')](_0x53f819);_0x13e7c5[_0x8f95('0x19')](function(_0x5d1edf){_0x314ba6['or'](_0x8f95('0x1e'),'%,'+_0x5d1edf+',%');});}return _0x314ba6;}function parseSearchFilter(_0xa3b182){var _0x4ea420=squel[_0x8f95('0x1c')]();if(_0xa3b182){var _0x284eb7=_0xa3b182['replace']('\x5c','\x5c\x5c')[_0x8f95('0x1f')](/'/g,'\x27\x27');if(_0x284eb7[_0x8f95('0x20')]('\x20')[_0x8f95('0x21')]>0x1){_0x4ea420['or'](_0x8f95('0x22'),qs['getFullTextValue'](_0x284eb7),null);}else{if(qs[_0x8f95('0x23')](_0x284eb7)){_0x4ea420['or']('c.id\x20LIKE\x20?',_0x284eb7+'%');_0x4ea420['or']('c.phone\x20LIKE\x20?',_0x284eb7+'%');_0x4ea420['or'](_0x8f95('0x24'),_0x284eb7+'%');_0x4ea420['or']('c.fax\x20LIKE\x20?',_0x284eb7+'%');}else if(qs[_0x8f95('0x25')](_0x284eb7)){_0x4ea420['or']('c.email\x20LIKE\x20?',_0x284eb7+'%');}else{_0x4ea420['or']('c.firstName\x20LIKE\x20?','%'+_0x284eb7+'%');_0x4ea420['or'](_0x8f95('0x26'),'%'+_0x284eb7+'%');_0x4ea420['or']('c.email\x20LIKE\x20?','%'+_0x284eb7+'%');}}}return _0x4ea420;}function parseAdvancedSearchFilter(_0x24c1a1,_0x5c45ba){var _0x43c843=getSqlClauses();var _0x3fc1d9=as[_0x8f95('0x27')](_0x24c1a1);var _0x2bb4ea=_0x3fc1d9[_0x8f95('0x28')];for(var _0x28a270=0x0;_0x28a270<_0x3fc1d9[_0x8f95('0x29')][_0x8f95('0x21')];_0x28a270++){var _0x3029d6=_0x3fc1d9[_0x8f95('0x29')][_0x28a270];var _0x4895a6='c';var _0x5e11c4=_[_0x8f95('0x2a')](_0x5c45ba,[_0x8f95('0x2b'),_0x3029d6['field']]);if(_0x5e11c4){if(_0x3029d6['field']==='dateOfBirth'||_0x5e11c4[_0x8f95('0x2c')]==='datetime'){_0x3029d6[_0x8f95('0x2d')]='DATE';}var _0x5841d1=as[_0x8f95('0x2e')](_0x4895a6,_0x5e11c4[_0x8f95('0x2f')],_0x3029d6);_0x43c843[_0x8f95('0x30')][_0x2bb4ea](_0x5841d1[_0x8f95('0x31')],_0x5841d1[_0x8f95('0x32')][_0x8f95('0x33')],_0x5841d1[_0x8f95('0x32')][_0x8f95('0x34')]);}else{if(_0x3029d6[_0x8f95('0x1a')]===_0x8f95('0x35')){var _0x5200d9=_0x3029d6[_0x8f95('0x32')]['split'](',')[_0x8f95('0x36')](function(_0x351183){return Number(_0x351183);});var _0x33bc0c=parseTagParameter(_0x5200d9);_0x43c843[_0x8f95('0x37')]['clause'][_0x8f95('0x38')](_0x33bc0c);_0x43c843[_0x8f95('0x37')][_0x8f95('0x39')]=_0x5200d9;}else if(_0x3029d6['field']==='User'){_0x43c843[_0x8f95('0x3a')][_0x8f95('0x3b')]['and'](_0x8f95('0x3c'),_0x3029d6[_0x8f95('0x32')]);_0x43c843[_0x8f95('0x3a')][_0x8f95('0x3d')]=!![];}}}return _0x43c843;}function parseModelFields(_0xb4a48b,_0xfef018){var _0x256fde=squel[_0x8f95('0x1c')]();var _0x46968b=_(_0xb4a48b)[_0x8f95('0x3e')]()[_0x8f95('0x36')](function(_0xd927f3){return _[_0x8f95('0x3f')](_0xfef018,[_0x8f95('0x2b'),_0xd927f3])?_0xd927f3:undefined;})['compact']()[_0x8f95('0x32')]();if(_0xb4a48b[_0x8f95('0x40')]){_0x46968b[_0x8f95('0x41')](_0x8f95('0x40'));}if(_0x46968b[_0x8f95('0x21')]>0x0){_0x46968b[_0x8f95('0x19')](function(_0x220e47){if(_0x220e47===_0x8f95('0x4')){_0x256fde[_0x8f95('0x38')](_0x8f95('0x42'),[][_0x8f95('0x43')](_0xb4a48b[_0x220e47]));}else if(_0x220e47===_0x8f95('0x40')){var _0x2f42f8='%'+_0xb4a48b[_0x220e47]+'%';_0x256fde[_0x8f95('0x38')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x2f42f8);}else{_0x256fde[_0x8f95('0x38')]('c.'+_0x220e47+_0x8f95('0x44'),_0xb4a48b[_0x220e47]);}});}return _0x256fde;}function parseQueryParameters(_0x8784fb,_0x22be07){var _0x3a1097=getSqlClauses();return Promise[_0x8f95('0x45')]()[_0x8f95('0x46')](function(){return parseModelFields(_0x8784fb,_0x22be07);})[_0x8f95('0x46')](function(_0x589609){_0x3a1097[_0x8f95('0x47')][_0x8f95('0x38')](_0x589609);return parseTagParameter(_0x8784fb[_0x8f95('0x48')]);})[_0x8f95('0x46')](function(_0xc4765f){_0x3a1097[_0x8f95('0x37')]['clause'][_0x8f95('0x38')](_0xc4765f);return parseSearchFilter(_0x8784fb[_0x8f95('0x49')]);})[_0x8f95('0x46')](function(_0x2fb5d9){_0x3a1097['filter']=_0x2fb5d9;return _0x3a1097;});}function checkListsRestrictions(_0x59dc71,_0x547c3f,_0x16c97d){var _0x3b0fab=squel['expr']();return Promise[_0x8f95('0x45')]()['then'](function(){if(_0x547c3f[_0x8f95('0x3')]&&_0x59dc71[_0x8f95('0x4a')]==='agent'&&!_0x16c97d){return _0x59dc71[_0x8f95('0x4b')]({'attributes':['id'],'raw':!![]});}})[_0x8f95('0x46')](function(_0x20dd3a){if(_0x20dd3a){if(_0x20dd3a[_0x8f95('0x21')]===0x0){_0x3b0fab[_0x8f95('0x38')](_0x8f95('0x4c'));}else{_0x3b0fab[_0x8f95('0x38')](_0x8f95('0x42'),_[_0x8f95('0x36')](_0x20dd3a,'id'));}}})[_0x8f95('0x46')](function(){return _0x3b0fab;});}function buildContactsQuery(_0x4d7fbc,_0x32a7c8,_0x212a91,_0x3ef9ed,_0x335940,_0x44c7ab){if(_0x32a7c8){_0x32a7c8=_0x212a91[_0x8f95('0x4d')];}_0x4d7fbc=addFieldsToQuery(_0x4d7fbc,_0x32a7c8,_0x3ef9ed,_0x44c7ab,!![]);var _0x4c21ab=squel[_0x8f95('0x4e')]();_0x4c21ab=addFieldsToQuery(_0x4c21ab,_0x32a7c8,_0x3ef9ed,_0x44c7ab,![]);if(_0x3ef9ed||_0x44c7ab){_0x4d7fbc=applyJoinClauses(_0x4d7fbc,!![]);_0x4d7fbc[_0x8f95('0x4f')](_0x8f95('0x50'));if(_0x212a91[_0x8f95('0x51')]){_0x4c21ab[_0x8f95('0x51')](_0x212a91['limit']);}if(_0x212a91[_0x8f95('0x52')]){_0x4c21ab[_0x8f95('0x52')](_0x212a91[_0x8f95('0x52')]);}}else{_0x4c21ab=applyJoinClauses(_0x4c21ab,![]);_0x4c21ab[_0x8f95('0x4f')](_0x8f95('0x53'));if(_0x212a91[_0x8f95('0x51')]){_0x4d7fbc[_0x8f95('0x51')](_0x212a91['limit']);}if(_0x212a91[_0x8f95('0x52')]){_0x4d7fbc[_0x8f95('0x52')](_0x212a91[_0x8f95('0x52')]);}}_0x4c21ab[_0x8f95('0x54')](_0x335940);if(_0x212a91[_0x8f95('0x55')]){_0x212a91['order'][_0x8f95('0x19')](function(_0x151378){_0x4d7fbc[_0x8f95('0x55')]('c.'+_0x151378[0x0],_0x151378[0x1]===_0x8f95('0x56')?![]:!![]);_0x4c21ab['order'](_0x8f95('0x57')+_0x151378[0x0],_0x151378[0x1]===_0x8f95('0x56')?![]:!![]);});}_0x4c21ab[_0x8f95('0x7')](_0x4d7fbc,_0x8f95('0xb'));return _0x4c21ab;}function getFilteredContacts(_0x5aa278){var _0x2b082f=[];return db[_0x8f95('0x35')][_0x8f95('0x58')]({'attributes':['id',_0x8f95('0x2b'),_0x8f95('0x59')],'raw':!![]})[_0x8f95('0x46')](function(_0x43849a){_0x2b082f=_[_0x8f95('0x5a')](_0x43849a,'id');var _0x26b761={'type':db[_0x8f95('0x5b')][_0x8f95('0x5c')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x8f95('0x5d')][_0x8f95('0x5e')](_0x5aa278['toString'](),_0x26b761);})[_0x8f95('0x46')](function(_0x4a34f2){_0x4a34f2[_0x8f95('0x19')](function(_0x1997a7){if(_0x1997a7['TagIds']){_0x1997a7['Tags']=[];_0x1997a7[_0x8f95('0x5f')][_0x8f95('0x20')](',')['forEach'](function(_0xb981ba){_0x1997a7['Tags'][_0x8f95('0x41')](_0x2b082f[_0xb981ba]);});}delete _0x1997a7[_0x8f95('0x5f')];});return _0x4a34f2;});}function countFilteredContacts(_0x59e9e5,_0xf62ffe){var _0x3966a5=_0x59e9e5[_0x8f95('0x60')]();_0x3966a5[_0x8f95('0x1a')](_0x8f95('0x61'));_0x3966a5=applyJoinClauses(_0x3966a5,!![]);_0x59e9e5[_0x8f95('0x4f')](_0x8f95('0x50'));var _0x55b85d=utils[_0x8f95('0x1d')](_0xf62ffe);if(!_[_0x8f95('0x62')](_0x55b85d)){_0x3966a5[_0x8f95('0x9')](_0x8f95('0x63'),_0x55b85d);}var _0x504301={'type':db[_0x8f95('0x5b')][_0x8f95('0x5c')][_0x8f95('0x64')],'raw':!![]};return db[_0x8f95('0x5d')][_0x8f95('0x5e')](_0x3966a5['toString'](),_0x504301)[_0x8f95('0x46')](function(_0x3c0f9a){return _0x3c0f9a[0x0][_0x8f95('0x61')];});}module[_0x8f95('0x65')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x99b7=['concat','\x20=\x20?','resolve','then','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','having','order','subqry.','DESC','findAll','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','lodash','../parsers/advancedSearch','agent','search','ListId','autocomplete','true','select','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','.id','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','firstName','phone','fax','email','CompanyId','createdAt','deletedAt','TagIds','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','name','dateOfBirth','datetime','buildExpression','type','default','text','value','start','end','Tag','map','tags','clause','and','User','user','skip','keys','compact','Contact','push','c.ListId\x20IN\x20?'];(function(_0x2473dc,_0x3622ad){var _0x1c04d8=function(_0x5adc13){while(--_0x5adc13){_0x2473dc['push'](_0x2473dc['shift']());}};_0x1c04d8(++_0x3622ad);}(_0x99b7,0x14e));var _0x799b=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x99b7[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x799b('0x0'));var squel=require('squel');var as=require(_0x799b('0x1'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x41135c,_0x45d0c6){var _0x43adef=![];if(_0x41135c['role']===_0x799b('0x2')&&!_0x45d0c6[_0x799b('0x3')]&&!_0x45d0c6[_0x799b('0x4')]&&_0x45d0c6[_0x799b('0x5')]!==_0x799b('0x6')){_0x43adef=!![];}return _0x43adef;}function getContactsSubquery(){return squel[_0x799b('0x7')]()['from'](_0x799b('0x8'),'c')[_0x799b('0x9')](_0x799b('0xa'));}function applyJoinClauses(_0x243c15,_0x291e49){var _0x5eccec=_0x291e49?'c':_0x799b('0xb');_0x243c15[_0x799b('0xc')](_0x799b('0xd'),'uc','uc.CmContactId\x20=\x20'+_0x5eccec+_0x799b('0xe'))['left_join']('cm_contact_has_tags','ct',_0x799b('0xf')+_0x5eccec+'.id')[_0x799b('0xc')]('tools_tags','t',_0x799b('0x10'));return _0x243c15;}function addFieldsToQuery(_0x4a6d53,_0x4cdb0d,_0x21970e,_0xda3891,_0x28e749){var _0x36d3cb=_0x28e749?'c':_0x799b('0xb');if(!_0x4cdb0d){_0x4cdb0d=['id',_0x799b('0x11'),'lastName',_0x799b('0x12'),'mobile',_0x799b('0x13'),_0x799b('0x14'),'ListId',_0x799b('0x15'),_0x799b('0x16'),'updatedAt',_0x799b('0x17'),_0x799b('0x18')];}var _0x3f5cbb=_0x21970e&&_0x28e749||!_0x21970e&&!_0x28e749;if(_0xda3891){_0x3f5cbb=_0xda3891&&_0x28e749||!_0xda3891&&!_0x28e749;}_0x4cdb0d['forEach'](function(_0x51d53c){if(_0x51d53c===_0x799b('0x18')){if(_0x3f5cbb){_0x4a6d53['field'](_0x799b('0x19'),_0x51d53c);}else if(_0x21970e||_0xda3891){_0x4a6d53[_0x799b('0x1a')](_0x36d3cb+'.'+_0x51d53c);}}else{_0x4a6d53['field'](_0x36d3cb+'.'+_0x51d53c);}});return _0x4a6d53;}function getSqlClauses(){var _0x51803d={'default':squel[_0x799b('0x1b')](),'fields':squel[_0x799b('0x1b')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x799b('0x1b')](),'ids':null},'user':{'clause':squel[_0x799b('0x1b')](),'skip':![]}};return _0x51803d;}function parseTagParameter(_0x4aef46){var _0x190a29=squel['expr']();if(_0x4aef46){var _0x51f9bc=utils[_0x799b('0x1c')](_0x4aef46);_0x51f9bc[_0x799b('0x1d')](function(_0x5ae79f){_0x190a29['or'](_0x799b('0x1e'),'%,'+_0x5ae79f+',%');});}return _0x190a29;}function parseSearchFilter(_0x26d8ec){var _0x2621a9=squel[_0x799b('0x1b')]();if(_0x26d8ec){var _0x107e5e=_0x26d8ec[_0x799b('0x1f')]('\x5c','\x5c\x5c')[_0x799b('0x1f')](/'/g,'\x27\x27');if(_0x107e5e[_0x799b('0x20')]('\x20')[_0x799b('0x21')]>0x1){_0x2621a9['or'](_0x799b('0x22'),qs[_0x799b('0x23')](_0x107e5e),null);}else{if(qs[_0x799b('0x24')](_0x107e5e)){_0x2621a9['or'](_0x799b('0x25'),_0x107e5e+'%');_0x2621a9['or'](_0x799b('0x26'),_0x107e5e+'%');_0x2621a9['or'](_0x799b('0x27'),_0x107e5e+'%');_0x2621a9['or']('c.fax\x20LIKE\x20?',_0x107e5e+'%');}else if(qs[_0x799b('0x28')](_0x107e5e)){_0x2621a9['or'](_0x799b('0x29'),_0x107e5e+'%');}else{_0x2621a9['or'](_0x799b('0x2a'),'%'+_0x107e5e+'%');_0x2621a9['or'](_0x799b('0x2b'),'%'+_0x107e5e+'%');_0x2621a9['or'](_0x799b('0x29'),'%'+_0x107e5e+'%');}}}return _0x2621a9;}function parseAdvancedSearchFilter(_0x242ace,_0x10fd33){var _0x1b0339=getSqlClauses();var _0x52dc90=as[_0x799b('0x2c')](_0x242ace);var _0x33d2e6=_0x52dc90['sqlOperator'];for(var _0x5bf64a=0x0;_0x5bf64a<_0x52dc90[_0x799b('0x2d')]['length'];_0x5bf64a++){var _0x52ce09=_0x52dc90[_0x799b('0x2d')][_0x5bf64a];var _0x5b891a='c';var _0x1fbc8c=_[_0x799b('0x2e')](_0x10fd33,[_0x799b('0x2f'),_0x52ce09[_0x799b('0x1a')]]);if(_0x1fbc8c){if(_0x52ce09['field']===_0x799b('0x30')||_0x1fbc8c['fieldType']===_0x799b('0x31')){_0x52ce09['castTo']='DATE';}var _0x3d06ea=as[_0x799b('0x32')](_0x5b891a,_0x1fbc8c[_0x799b('0x33')],_0x52ce09);_0x1b0339[_0x799b('0x34')][_0x33d2e6](_0x3d06ea[_0x799b('0x35')],_0x3d06ea[_0x799b('0x36')][_0x799b('0x37')],_0x3d06ea[_0x799b('0x36')][_0x799b('0x38')]);}else{if(_0x52ce09[_0x799b('0x1a')]===_0x799b('0x39')){var _0x4539f5=_0x52ce09[_0x799b('0x36')][_0x799b('0x20')](',')[_0x799b('0x3a')](function(_0xbef2d8){return Number(_0xbef2d8);});var _0x356fd5=parseTagParameter(_0x4539f5);_0x1b0339[_0x799b('0x3b')][_0x799b('0x3c')][_0x799b('0x3d')](_0x356fd5);_0x1b0339[_0x799b('0x3b')]['ids']=_0x4539f5;}else if(_0x52ce09[_0x799b('0x1a')]===_0x799b('0x3e')){_0x1b0339['user'][_0x799b('0x3c')][_0x799b('0x3d')]('uc.UserId\x20=\x20?',_0x52ce09['value']);_0x1b0339[_0x799b('0x3f')][_0x799b('0x40')]=!![];}}}return _0x1b0339;}function parseModelFields(_0x57ef0a,_0x3ac819){var _0x38c796=squel[_0x799b('0x1b')]();var _0x2420a2=_(_0x57ef0a)[_0x799b('0x41')]()[_0x799b('0x3a')](function(_0x5abe13){return _['some'](_0x3ac819,[_0x799b('0x2f'),_0x5abe13])?_0x5abe13:undefined;})[_0x799b('0x42')]()[_0x799b('0x36')]();if(_0x57ef0a[_0x799b('0x43')]){_0x2420a2[_0x799b('0x44')](_0x799b('0x43'));}if(_0x2420a2[_0x799b('0x21')]>0x0){_0x2420a2['forEach'](function(_0x121992){if(_0x121992==='ListId'){_0x38c796['and'](_0x799b('0x45'),[][_0x799b('0x46')](_0x57ef0a[_0x121992]));}else if(_0x121992===_0x799b('0x43')){var _0x3fd244='%'+_0x57ef0a[_0x121992]+'%';_0x38c796['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x3fd244);}else{_0x38c796[_0x799b('0x3d')]('c.'+_0x121992+_0x799b('0x47'),_0x57ef0a[_0x121992]);}});}return _0x38c796;}function parseQueryParameters(_0x44e786,_0x489491){var _0x2f3c74=getSqlClauses();return Promise[_0x799b('0x48')]()[_0x799b('0x49')](function(){return parseModelFields(_0x44e786,_0x489491);})[_0x799b('0x49')](function(_0x19515f){_0x2f3c74['fields'][_0x799b('0x3d')](_0x19515f);return parseTagParameter(_0x44e786[_0x799b('0x4a')]);})[_0x799b('0x49')](function(_0x529246){_0x2f3c74[_0x799b('0x3b')][_0x799b('0x3c')]['and'](_0x529246);return parseSearchFilter(_0x44e786[_0x799b('0x4b')]);})[_0x799b('0x49')](function(_0x10f205){_0x2f3c74['filter']=_0x10f205;return _0x2f3c74;});}function checkListsRestrictions(_0x57d9ce,_0x2ebf2a,_0x46e50e){var _0x18a278=squel[_0x799b('0x1b')]();return Promise[_0x799b('0x48')]()[_0x799b('0x49')](function(){if(_0x2ebf2a['search']&&_0x57d9ce[_0x799b('0x4c')]===_0x799b('0x2')&&!_0x46e50e){return _0x57d9ce[_0x799b('0x4d')]({'attributes':['id'],'raw':!![]});}})[_0x799b('0x49')](function(_0x3d9dcc){if(_0x3d9dcc){if(_0x3d9dcc[_0x799b('0x21')]===0x0){_0x18a278[_0x799b('0x3d')](_0x799b('0x4e'));}else{_0x18a278[_0x799b('0x3d')](_0x799b('0x45'),_[_0x799b('0x3a')](_0x3d9dcc,'id'));}}})[_0x799b('0x49')](function(){return _0x18a278;});}function buildContactsQuery(_0x33748b,_0x27f4e1,_0x3907d4,_0xc725a1,_0x539110,_0x4a08b6){if(_0x27f4e1){_0x27f4e1=_0x3907d4[_0x799b('0x4f')];}_0x33748b=addFieldsToQuery(_0x33748b,_0x27f4e1,_0xc725a1,_0x4a08b6,!![]);var _0x31a22=squel[_0x799b('0x7')]();_0x31a22=addFieldsToQuery(_0x31a22,_0x27f4e1,_0xc725a1,_0x4a08b6,![]);if(_0xc725a1||_0x4a08b6){_0x33748b=applyJoinClauses(_0x33748b,!![]);_0x33748b[_0x799b('0x50')](_0x799b('0x51'));if(_0x3907d4[_0x799b('0x52')]){_0x31a22[_0x799b('0x52')](_0x3907d4['limit']);}if(_0x3907d4[_0x799b('0x53')]){_0x31a22[_0x799b('0x53')](_0x3907d4['offset']);}}else{_0x31a22=applyJoinClauses(_0x31a22,![]);_0x31a22[_0x799b('0x50')]('subqry.id');if(_0x3907d4['limit']){_0x33748b[_0x799b('0x52')](_0x3907d4[_0x799b('0x52')]);}if(_0x3907d4[_0x799b('0x53')]){_0x33748b[_0x799b('0x53')](_0x3907d4[_0x799b('0x53')]);}}_0x31a22[_0x799b('0x54')](_0x539110);if(_0x3907d4[_0x799b('0x55')]){_0x3907d4['order']['forEach'](function(_0xf6eb20){_0x33748b[_0x799b('0x55')]('c.'+_0xf6eb20[0x0],_0xf6eb20[0x1]==='DESC'?![]:!![]);_0x31a22[_0x799b('0x55')](_0x799b('0x56')+_0xf6eb20[0x0],_0xf6eb20[0x1]===_0x799b('0x57')?![]:!![]);});}_0x31a22['from'](_0x33748b,_0x799b('0xb'));return _0x31a22;}function getFilteredContacts(_0x5d2fa8){var _0x146f88=[];return db[_0x799b('0x39')][_0x799b('0x58')]({'attributes':['id','name','color'],'raw':!![]})['then'](function(_0x3ea4b3){_0x146f88=_[_0x799b('0x59')](_0x3ea4b3,'id');var _0x3e83e2={'type':db[_0x799b('0x5a')][_0x799b('0x5b')][_0x799b('0x5c')],'model':db[_0x799b('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x799b('0x5e')][_0x799b('0x5f')](_0x5d2fa8[_0x799b('0x60')](),_0x3e83e2);})[_0x799b('0x49')](function(_0x227a37){_0x227a37[_0x799b('0x1d')](function(_0x5791a7){if(_0x5791a7[_0x799b('0x18')]){_0x5791a7[_0x799b('0x61')]=[];_0x5791a7[_0x799b('0x18')]['split'](',')[_0x799b('0x1d')](function(_0x38a366){_0x5791a7[_0x799b('0x61')][_0x799b('0x44')](_0x146f88[_0x38a366]);});}delete _0x5791a7[_0x799b('0x18')];});return _0x227a37;});}function countFilteredContacts(_0x50d984,_0x5bb4e2){var _0x127439=_0x50d984[_0x799b('0x62')]();_0x127439[_0x799b('0x1a')](_0x799b('0x63'));_0x127439=applyJoinClauses(_0x127439,!![]);_0x50d984[_0x799b('0x50')](_0x799b('0x51'));var _0x10a88f=utils[_0x799b('0x1c')](_0x5bb4e2);if(!_[_0x799b('0x64')](_0x10a88f)){_0x127439['where']('t.id\x20IN\x20?',_0x10a88f);}var _0x56595d={'type':db[_0x799b('0x5a')][_0x799b('0x5b')][_0x799b('0x5c')],'raw':!![]};return db[_0x799b('0x5e')][_0x799b('0x5f')](_0x127439['toString'](),_0x56595d)['then'](function(_0x3de840){return _0x3de840[0x0][_0x799b('0x63')];});}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 b1c4017..375d114 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 _0x194f=['aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','final','binary','write','end','close','unlink','decryptFile','createDecipher','encryptString','secret','base64','decryptString','utf8','lodash','../../config/environment','../../config/logger','session'];(function(_0x21658e,_0x4bdffe){var _0x43f475=function(_0x3ed6cf){while(--_0x3ed6cf){_0x21658e['push'](_0x21658e['shift']());}};_0x43f475(++_0x4bdffe);}(_0x194f,0xc8));var _0xf194=function(_0x4ddcee,_0x4c9042){_0x4ddcee=_0x4ddcee-0x0;var _0x2797e9=_0x194f[_0x4ddcee];return _0x2797e9;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xf194('0x0'));var config=require(_0xf194('0x1'));var logger=require(_0xf194('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xf194('0x3')],'algorithm':_0xf194('0x4')};const fileOptions={'algorithm':_0xf194('0x5')};if(config['encrypt']&&config[_0xf194('0x6')][_0xf194('0x7')]){var isSupported=isAlgorithmSupported(config[_0xf194('0x6')][_0xf194('0x7')]);if(isSupported){fileOptions['algorithm']=config[_0xf194('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf194('0x8')](',\x20');logger[_0xf194('0x9')](config[_0xf194('0x6')][_0xf194('0x7')],_0xf194('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x44ad1f){return AES_SUPPORTED_RX[_0xf194('0xb')](_0x44ad1f);}function getSupportedCiphers(){return crypto[_0xf194('0xc')]()[_0xf194('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0xec949a){return getSupportedCiphers()[_0xf194('0xe')](_0xec949a)>-0x1;}function combineOptions(_0x2cdfe6){var _0x4fcdb1={};for(var _0x1b2547 in fileOptions){if(fileOptions[_0xf194('0xf')](_0x1b2547)){_0x4fcdb1[_0x1b2547]=fileOptions[_0x1b2547];}}if(_0x2cdfe6){for(var _0x16e915 in _0x2cdfe6){if(_0x2cdfe6[_0xf194('0xf')](_0x16e915)){_0x4fcdb1[_0x16e915]=_0x2cdfe6[_0x16e915];}}}return _0x4fcdb1;}exports['encryptFile']=function(_0x2f54ca,_0x32747d,_0xaa1ea0,_0x4515f7){return new BPromise(function(_0x4f4ce9,_0x222c91){_0x4515f7=combineOptions(_0x4515f7);var _0x1c2772=new Buffer(_0xaa1ea0);var _0xe0fbfa=fs[_0xf194('0x10')](_0x2f54ca);var _0x283c8e=fs[_0xf194('0x11')](_0x32747d);var _0x144f61=crypto[_0xf194('0x12')](_0x4515f7[_0xf194('0x7')],_0x1c2772);_0xe0fbfa['on'](_0xf194('0x13'),function(_0x3ff62c){var _0x35e4d2=new Buffer(_0x144f61[_0xf194('0x14')](_0x3ff62c),'binary');_0x283c8e['write'](_0x35e4d2);});_0xe0fbfa['on']('end',function(){try{var _0x364f3d=new Buffer(_0x144f61[_0xf194('0x15')](_0xf194('0x16')),_0xf194('0x16'));_0x283c8e[_0xf194('0x17')](_0x364f3d);_0x283c8e[_0xf194('0x18')]();_0x283c8e['on'](_0xf194('0x19'),function(){return _0x4f4ce9(_0x32747d);});}catch(_0x4d2376){fs[_0xf194('0x1a')](_0x32747d);return _0x222c91(_0x4d2376);}});});};exports[_0xf194('0x1b')]=function(_0x5f3374,_0x3e8fce,_0xf8079d,_0x54ceb4){return new BPromise(function(_0xcdfe93,_0x51880d){_0x54ceb4=combineOptions(_0x54ceb4);var _0x565e6d=new Buffer(_0xf8079d);var _0x2d5560=fs[_0xf194('0x10')](_0x5f3374);var _0x3ecbcc=fs['createWriteStream'](_0x3e8fce);var _0x5235d0=crypto[_0xf194('0x1c')](_0x54ceb4[_0xf194('0x7')],_0x565e6d);_0x2d5560['on']('data',function(_0x449d2f){var _0x498738=new Buffer(_0x5235d0[_0xf194('0x14')](_0x449d2f),_0xf194('0x16'));_0x3ecbcc[_0xf194('0x17')](_0x498738);});_0x2d5560['on'](_0xf194('0x18'),function(){try{var _0x5b163b=new Buffer(_0x5235d0['final'](_0xf194('0x16')),_0xf194('0x16'));_0x3ecbcc['write'](_0x5b163b);_0x3ecbcc[_0xf194('0x18')]();_0x3ecbcc['on'](_0xf194('0x19'),function(){return _0xcdfe93(_0x3e8fce);});}catch(_0x1699f5){fs[_0xf194('0x1a')](_0x3e8fce);return _0x51880d(_0x1699f5);}});});};exports[_0xf194('0x1d')]=function(_0x23eb72,_0x5b29b3,_0x4d0900){var _0x3e9b1d=_0x4d0900||stringOptions[_0xf194('0x7')];var _0x3128fc=_0x5b29b3||stringOptions[_0xf194('0x1e')];var _0x242533=crypto[_0xf194('0x12')](_0x3e9b1d,_0x3128fc);var _0x425f2b=_0x242533[_0xf194('0x14')](_0x23eb72,'utf8','base64');_0x425f2b+=_0x242533[_0xf194('0x15')](_0xf194('0x1f'));return _0x425f2b;};exports[_0xf194('0x20')]=function(_0x4b5da2,_0x40787b,_0x4037f4){var _0x25420e=_0x4037f4||stringOptions[_0xf194('0x7')];var _0x44d86c=_0x40787b||stringOptions[_0xf194('0x1e')];var _0x4262a5=crypto[_0xf194('0x1c')](_0x25420e,_0x44d86c);var _0x95c0ab=_0x4262a5['update'](_0x4b5da2,_0xf194('0x1f'),_0xf194('0x21'));_0x95c0ab+=_0x4262a5[_0xf194('0x15')](_0xf194('0x21'));return _0x95c0ab;}; \ No newline at end of file +var _0xe10f=['close','unlink','decryptFile','createDecipher','update','secret','base64','decryptString','utf8','crypto','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','write','end','final','binary'];(function(_0x4f1ded,_0x40f1de){var _0x5824cf=function(_0x204323){while(--_0x204323){_0x4f1ded['push'](_0x4f1ded['shift']());}};_0x5824cf(++_0x40f1de);}(_0xe10f,0xd5));var _0xfe10=function(_0x3cf83e,_0x107ff4){_0x3cf83e=_0x3cf83e-0x0;var _0x131185=_0xe10f[_0x3cf83e];return _0x131185;};'use strict';var crypto=require(_0xfe10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xfe10('0x1'));var config=require(_0xfe10('0x2'));var logger=require(_0xfe10('0x3'))(_0xfe10('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xfe10('0x5')],'algorithm':_0xfe10('0x6')};const fileOptions={'algorithm':_0xfe10('0x7')};if(config[_0xfe10('0x8')]&&config[_0xfe10('0x8')][_0xfe10('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xfe10('0x9')]);if(isSupported){fileOptions[_0xfe10('0x9')]=config[_0xfe10('0x8')][_0xfe10('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xfe10('0xa')](',\x20');logger[_0xfe10('0xb')](config['encrypt'][_0xfe10('0x9')],_0xfe10('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2505f7){return AES_SUPPORTED_RX[_0xfe10('0xd')](_0x2505f7);}function getSupportedCiphers(){return crypto[_0xfe10('0xe')]()[_0xfe10('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x4b9b27){return getSupportedCiphers()['indexOf'](_0x4b9b27)>-0x1;}function combineOptions(_0x56ddb5){var _0x4f75f9={};for(var _0x801955 in fileOptions){if(fileOptions['hasOwnProperty'](_0x801955)){_0x4f75f9[_0x801955]=fileOptions[_0x801955];}}if(_0x56ddb5){for(var _0x38652d in _0x56ddb5){if(_0x56ddb5[_0xfe10('0x10')](_0x38652d)){_0x4f75f9[_0x38652d]=_0x56ddb5[_0x38652d];}}}return _0x4f75f9;}exports[_0xfe10('0x11')]=function(_0x187f31,_0x358f4e,_0x21dcce,_0x3036e6){return new BPromise(function(_0x4f7947,_0x3964a0){_0x3036e6=combineOptions(_0x3036e6);var _0xe1bb30=new Buffer(_0x21dcce);var _0x5dba34=fs[_0xfe10('0x12')](_0x187f31);var _0x51de50=fs[_0xfe10('0x13')](_0x358f4e);var _0x5c9e34=crypto[_0xfe10('0x14')](_0x3036e6[_0xfe10('0x9')],_0xe1bb30);_0x5dba34['on']('data',function(_0x4068ff){var _0x1e0ba8=new Buffer(_0x5c9e34['update'](_0x4068ff),'binary');_0x51de50[_0xfe10('0x15')](_0x1e0ba8);});_0x5dba34['on'](_0xfe10('0x16'),function(){try{var _0x329af3=new Buffer(_0x5c9e34[_0xfe10('0x17')](_0xfe10('0x18')),_0xfe10('0x18'));_0x51de50[_0xfe10('0x15')](_0x329af3);_0x51de50[_0xfe10('0x16')]();_0x51de50['on'](_0xfe10('0x19'),function(){return _0x4f7947(_0x358f4e);});}catch(_0x3476c7){fs[_0xfe10('0x1a')](_0x358f4e);return _0x3964a0(_0x3476c7);}});});};exports[_0xfe10('0x1b')]=function(_0x5ba3a3,_0x4b9449,_0x33ceeb,_0x544358){return new BPromise(function(_0x53a546,_0x4dd799){_0x544358=combineOptions(_0x544358);var _0x3f78f1=new Buffer(_0x33ceeb);var _0x4919f1=fs['createReadStream'](_0x5ba3a3);var _0x8b2381=fs[_0xfe10('0x13')](_0x4b9449);var _0x2d5959=crypto[_0xfe10('0x1c')](_0x544358[_0xfe10('0x9')],_0x3f78f1);_0x4919f1['on']('data',function(_0x55147b){var _0x5307bb=new Buffer(_0x2d5959[_0xfe10('0x1d')](_0x55147b),'binary');_0x8b2381[_0xfe10('0x15')](_0x5307bb);});_0x4919f1['on'](_0xfe10('0x16'),function(){try{var _0x487ad4=new Buffer(_0x2d5959[_0xfe10('0x17')](_0xfe10('0x18')),'binary');_0x8b2381['write'](_0x487ad4);_0x8b2381['end']();_0x8b2381['on']('close',function(){return _0x53a546(_0x4b9449);});}catch(_0xf1be05){fs[_0xfe10('0x1a')](_0x4b9449);return _0x4dd799(_0xf1be05);}});});};exports['encryptString']=function(_0x41874a,_0x5292d3,_0x303104){var _0x103567=_0x303104||stringOptions[_0xfe10('0x9')];var _0x34ad52=_0x5292d3||stringOptions[_0xfe10('0x1e')];var _0x50113f=crypto['createCipher'](_0x103567,_0x34ad52);var _0x3699c8=_0x50113f[_0xfe10('0x1d')](_0x41874a,'utf8',_0xfe10('0x1f'));_0x3699c8+=_0x50113f[_0xfe10('0x17')](_0xfe10('0x1f'));return _0x3699c8;};exports[_0xfe10('0x20')]=function(_0x2f2b95,_0x19ea54,_0x5679eb){var _0x3a8a9d=_0x5679eb||stringOptions[_0xfe10('0x9')];var _0x4cf425=_0x19ea54||stringOptions[_0xfe10('0x1e')];var _0x364b27=crypto[_0xfe10('0x1c')](_0x3a8a9d,_0x4cf425);var _0x58b1c7=_0x364b27[_0xfe10('0x1d')](_0x2f2b95,_0xfe10('0x1f'),_0xfe10('0x21'));_0x58b1c7+=_0x364b27['final'](_0xfe10('0x21'));return _0x58b1c7;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 3e613e1..eeee507 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 _0x8b6a=['csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','query','QueryTypes','num','Empty','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','length','mkdirSync','join','each','%s%d.%s','%s.%s'];(function(_0x43c7f1,_0xc4adad){var _0x5e5945=function(_0x2a4dc1){while(--_0x2a4dc1){_0x43c7f1['push'](_0x43c7f1['shift']());}};_0x5e5945(++_0xc4adad);}(_0x8b6a,0x167));var _0xa8b6=function(_0x3d305a,_0x32ad4c){_0x3d305a=_0x3d305a-0x0;var _0x25b678=_0x8b6a[_0x3d305a];return _0x25b678;};'use strict';var util=require(_0xa8b6('0x0'));var path=require('path');var _=require(_0xa8b6('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xa8b6('0x2'));var zipdir=require(_0xa8b6('0x3'));var rimraf=require(_0xa8b6('0x4'));var db=require(_0xa8b6('0x5'))['db'];var dbH=require(_0xa8b6('0x5'))[_0xa8b6('0x6')];var logger=require(_0xa8b6('0x7'))(_0xa8b6('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa8b6('0x9')][0x3];var PATH=process[_0xa8b6('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x55b8e0,_0x5e33ae){var _0x4fef4a={'status':_0x55b8e0};var _0x44265a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5e33ae){_0x4fef4a[_0xa8b6('0xa')]=_0x5e33ae;}return db[_0xa8b6('0xb')][_0xa8b6('0xc')](_0x4fef4a,_0x44265a);}function main(){var _0x166059=0x1388;var _0x169b18;logger[_0xa8b6('0xd')](util[_0xa8b6('0xe')](_0xa8b6('0xf'),EXTRACTED_REPORT_ID,_0xa8b6('0x10')));return db[_0xa8b6('0x11')][_0xa8b6('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa8b6('0x13'),'splitSizeCsv']})[_0xa8b6('0x14')](function(_0x5d12a5){if(_0x5d12a5){_0x169b18=_0x5d12a5;_0x166059=_0x169b18[_0xa8b6('0x15')]||0x1388;}})[_0xa8b6('0x14')](function(){return dbH[_0xa8b6('0x16')][_0xa8b6('0x17')](util[_0xa8b6('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa8b6('0x16')][_0xa8b6('0x18')]['SELECT']});})[_0xa8b6('0x14')](function(_0x588773){if(!_0x588773[0x0][_0xa8b6('0x19')]){return analyticExtractedReport(_0xa8b6('0x1a'));}var _0x2a8396=[];var _0x39ef26=0x0;if(_0x169b18[_0xa8b6('0x13')]){if(_0x588773&&_0x588773['length']){var _0x56bccc=_['range'](_0x588773[0x0]['num']/_0x166059);var _0x2da8f9=Number[_0xa8b6('0x1b')](_0x588773[0x0][_0xa8b6('0x19')]/_0x166059)?_0x588773[0x0][_0xa8b6('0x19')]%_0x166059:0x0;_0x56bccc[_0xa8b6('0x1c')](function(_0x48ba39){if(_0x48ba39>0x0){_0x39ef26+=_0x166059;}_0x2a8396[_0xa8b6('0x1d')](dbH[_0xa8b6('0x16')][_0xa8b6('0x17')](util[_0xa8b6('0xe')](_0xa8b6('0x1e'),QUERY,_0x166059,_0x39ef26),{'type':dbH[_0xa8b6('0x16')][_0xa8b6('0x18')][_0xa8b6('0x1f')]}));});if(_0x2da8f9>0x0){_0x39ef26+=_0x166059;_0x2a8396[_0xa8b6('0x1d')](dbH[_0xa8b6('0x16')][_0xa8b6('0x17')](util['format'](_0xa8b6('0x1e'),QUERY,_0x2da8f9,_0x39ef26),{'type':dbH[_0xa8b6('0x16')][_0xa8b6('0x18')]['SELECT']}));}}}else{_0x2a8396[_0xa8b6('0x1d')](dbH['sequelize'][_0xa8b6('0x17')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x51fa8d=path[_0xa8b6('0x20')](PATH);var _0xe44bc0=path[_0xa8b6('0x21')](PATH,_0xa8b6('0x22'));var _0x8b065=_0x169b18[_0xa8b6('0x13')]&&_0x2a8396[_0xa8b6('0x23')]>0x1;var _0x4110c4=[];if(!fs['existsSync'](path['join'](_0x51fa8d,_0xe44bc0))&&_0x8b065){fs[_0xa8b6('0x24')](path[_0xa8b6('0x25')](_0x51fa8d,_0xe44bc0));}return BPromise[_0xa8b6('0x26')](_0x2a8396,function(_0x3201e0){_0x4110c4[_0xa8b6('0x1d')](_0x3201e0);})[_0xa8b6('0x14')](function(){for(var _0x12d1cd=0x0;_0x12d1cd<_0x4110c4[_0xa8b6('0x23')];_0x12d1cd+=0x1){var _0x176544;var _0x1a60d0=_0x4110c4[_0x12d1cd];if(_0x8b065){_0x176544=path[_0xa8b6('0x25')](_0x51fa8d,_0xe44bc0,util[_0xa8b6('0xe')](_0xa8b6('0x27'),_0xe44bc0,_0x12d1cd,'csv'));}else{_0x176544=path[_0xa8b6('0x25')](_0x51fa8d,util[_0xa8b6('0xe')](_0xa8b6('0x28'),_0xe44bc0,_0xa8b6('0x29')));}fs[_0xa8b6('0x2a')](_0x176544,csv(_0x1a60d0));}})[_0xa8b6('0x14')](function(){if(_0x8b065){return new Promise(function(_0x284dfb){zipdir(path[_0xa8b6('0x25')](_0x51fa8d,_0xe44bc0),{'saveTo':path['join'](_0x51fa8d,util[_0xa8b6('0xe')](_0xa8b6('0x28'),_0xe44bc0,_0xa8b6('0x2b')))},function(_0x173ca7,_0x202b30){rimraf(path[_0xa8b6('0x25')](_0x51fa8d,_0xe44bc0),function(){});_0x284dfb('zip\x20finished');});});}})['then'](function(){logger[_0xa8b6('0xd')](util[_0xa8b6('0xe')](_0xa8b6('0x2c'),EXTRACTED_REPORT_ID,_0xa8b6('0x10')));return analyticExtractedReport(_0xa8b6('0x2d'),_0x8b065?util[_0xa8b6('0xe')](_0xa8b6('0x28'),_0xe44bc0,_0x8b065?_0xa8b6('0x2b'):_0xa8b6('0x29')):null);});})[_0xa8b6('0x2e')](function(_0xec6a1a){logger['info'](util['format'](_0xa8b6('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0xec6a1a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xa8b6('0x30')](function(){process[_0xa8b6('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9427=['rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','inspect','finally','exit','util','path','lodash','to-csv','bluebird'];(function(_0x11755b,_0x18fa74){var _0x3d7771=function(_0x2cc787){while(--_0x2cc787){_0x11755b['push'](_0x11755b['shift']());}};_0x3d7771(++_0x18fa74);}(_0x9427,0x82));var _0x7942=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9427[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0x7942('0x0'));var path=require(_0x7942('0x1'));var _=require(_0x7942('0x2'));var csv=require(_0x7942('0x3'));var fs=require('fs');var BPromise=require(_0x7942('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x7942('0x5'));var db=require(_0x7942('0x6'))['db'];var dbH=require(_0x7942('0x6'))[_0x7942('0x7')];var logger=require(_0x7942('0x8'))(_0x7942('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x7942('0xa')][0x2]);var QUERY=process[_0x7942('0xa')][0x3];var PATH=process[_0x7942('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d3df2,_0x3df146){var _0x39802a={'status':_0x4d3df2};var _0x35f5c6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3df146){_0x39802a['savename']=_0x3df146;}return db['AnalyticExtractedReport'][_0x7942('0xb')](_0x39802a,_0x35f5c6);}function main(){var _0x1101eb=0x1388;var _0x4da453;logger[_0x7942('0xc')](util[_0x7942('0xd')](_0x7942('0xe'),EXTRACTED_REPORT_ID,_0x7942('0xf')));return db[_0x7942('0x10')][_0x7942('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7942('0x12'),'splitSizeCsv']})[_0x7942('0x13')](function(_0x14eec9){if(_0x14eec9){_0x4da453=_0x14eec9;_0x1101eb=_0x4da453['splitSizeCsv']||0x1388;}})[_0x7942('0x13')](function(){return dbH[_0x7942('0x14')][_0x7942('0x15')](util[_0x7942('0xd')](_0x7942('0x16'),QUERY),{'type':dbH[_0x7942('0x14')][_0x7942('0x17')][_0x7942('0x18')]});})[_0x7942('0x13')](function(_0x5e263b){if(!_0x5e263b[0x0][_0x7942('0x19')]){return analyticExtractedReport('Empty');}var _0x1e1e15=[];var _0xa911c4=0x0;if(_0x4da453[_0x7942('0x12')]){if(_0x5e263b&&_0x5e263b[_0x7942('0x1a')]){var _0x27ec5b=_['range'](_0x5e263b[0x0]['num']/_0x1101eb);var _0x897d78=Number[_0x7942('0x1b')](_0x5e263b[0x0][_0x7942('0x19')]/_0x1101eb)?_0x5e263b[0x0][_0x7942('0x19')]%_0x1101eb:0x0;_0x27ec5b[_0x7942('0x1c')](function(_0x36475b){if(_0x36475b>0x0){_0xa911c4+=_0x1101eb;}_0x1e1e15[_0x7942('0x1d')](dbH[_0x7942('0x14')][_0x7942('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1101eb,_0xa911c4),{'type':dbH[_0x7942('0x14')][_0x7942('0x17')]['SELECT']}));});if(_0x897d78>0x0){_0xa911c4+=_0x1101eb;_0x1e1e15[_0x7942('0x1d')](dbH[_0x7942('0x14')][_0x7942('0x15')](util[_0x7942('0xd')](_0x7942('0x1e'),QUERY,_0x897d78,_0xa911c4),{'type':dbH[_0x7942('0x14')][_0x7942('0x17')][_0x7942('0x18')]}));}}}else{_0x1e1e15['push'](dbH['sequelize'][_0x7942('0x15')](QUERY,{'type':dbH[_0x7942('0x14')][_0x7942('0x17')][_0x7942('0x18')]}));}var _0x24ceab=path[_0x7942('0x1f')](PATH);var _0x82622e=path['basename'](PATH,'.csv');var _0x45da66=_0x4da453[_0x7942('0x12')]&&_0x1e1e15[_0x7942('0x1a')]>0x1;var _0x50b85=[];if(!fs[_0x7942('0x20')](path[_0x7942('0x21')](_0x24ceab,_0x82622e))&&_0x45da66){fs[_0x7942('0x22')](path['join'](_0x24ceab,_0x82622e));}return BPromise['each'](_0x1e1e15,function(_0x4a4667){_0x50b85['push'](_0x4a4667);})[_0x7942('0x13')](function(){for(var _0x5735ba=0x0;_0x5735ba<_0x50b85[_0x7942('0x1a')];_0x5735ba+=0x1){var _0x457910;var _0x3740b2=_0x50b85[_0x5735ba];if(_0x45da66){_0x457910=path[_0x7942('0x21')](_0x24ceab,_0x82622e,util['format'](_0x7942('0x23'),_0x82622e,_0x5735ba,_0x7942('0x24')));}else{_0x457910=path['join'](_0x24ceab,util['format'](_0x7942('0x25'),_0x82622e,_0x7942('0x24')));}fs[_0x7942('0x26')](_0x457910,csv(_0x3740b2));}})[_0x7942('0x13')](function(){if(_0x45da66){return new Promise(function(_0x342dd7){zipdir(path['join'](_0x24ceab,_0x82622e),{'saveTo':path[_0x7942('0x21')](_0x24ceab,util[_0x7942('0xd')](_0x7942('0x25'),_0x82622e,_0x7942('0x27')))},function(_0x58bbda,_0x2133de){rimraf(path[_0x7942('0x21')](_0x24ceab,_0x82622e),function(){});_0x342dd7(_0x7942('0x28'));});});}})[_0x7942('0x13')](function(){logger[_0x7942('0xc')](util[_0x7942('0xd')](_0x7942('0x29'),EXTRACTED_REPORT_ID,_0x7942('0xf')));return analyticExtractedReport('Completed',_0x45da66?util[_0x7942('0xd')]('%s.%s',_0x82622e,_0x45da66?_0x7942('0x27'):_0x7942('0x24')):null);});})['catch'](function(_0x4c0f13){logger['info'](util[_0x7942('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x7942('0x2a')](_0x4c0f13,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x7942('0x2b')](function(){process[_0x7942('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 6d62a2f..77ef65b 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 _0x21c4=['/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','createPdfFromHTML','catch','lodash','util','path','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','fill','push','body','keys','forEach','format','name','startDate','endDate','length','header','before','margin','\x20/\x20','Arial','black','right','num','Empty','split','splitSizePdf','then','sequelize','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','finally','exit','/fonts/arial-regular.ttf'];(function(_0x4ad512,_0x8376ed){var _0x3ddb68=function(_0x20cb7f){while(--_0x20cb7f){_0x4ad512['push'](_0x4ad512['shift']());}};_0x3ddb68(++_0x8376ed);}(_0x21c4,0x102));var _0x421c=function(_0x59ae80,_0x56b205){_0x59ae80=_0x59ae80-0x0;var _0x473bf9=_0x21c4[_0x59ae80];return _0x473bf9;};'use strict';var _=require(_0x421c('0x0'));var fs=require('fs');var util=require(_0x421c('0x1'));var path=require(_0x421c('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x421c('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x421c('0x4'));var rimraf=require(_0x421c('0x5'));var JSDOM=require(_0x421c('0x6'))[_0x421c('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0x421c('0x8'));var db=require(_0x421c('0x9'))['db'];var dbH=require('../../mysqldb')[_0x421c('0xa')];var logger=require(_0x421c('0xb'))(_0x421c('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x421c('0xd')][0x2]);var QUERY=process[_0x421c('0xd')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x421c('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2a1710,_0x256b16){var _0x4fb06e={'status':_0x2a1710};var _0x103163={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x256b16){_0x4fb06e[_0x421c('0xf')]=_0x256b16;}return db['AnalyticExtractedReport'][_0x421c('0x10')](_0x4fb06e,_0x103163);}function getHeaders(_0x17e189){return _[_0x421c('0x11')](_0x17e189,function(_0x3b812c){return{'text':_0x3b812c,'style':_0x421c('0x12')};});}function getRows(_0x57fef6,_0x25605e){return _[_0x421c('0x11')](_0x25605e,function(_0x43a823){return _(_0x43a823)[_0x421c('0x13')](_0x57fef6)['map'](function(_0x1cc96e){return _0x1cc96e?_[_0x421c('0x14')](_0x1cc96e):'';})[_0x421c('0x15')]();});}function createTable(_0x484d86,_0x46ccdb){var _0x226a9e={'widths':_[_0x421c('0x16')](Array(_0x484d86['length']),0x91),'heights':function(_0x5b265d){return _0x5b265d===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x28dd4d=getHeaders(_0x484d86);_0x226a9e['body'][_0x421c('0x17')](_0x28dd4d);var _0x1f9422=getRows(_0x484d86,_0x46ccdb);_0x226a9e[_0x421c('0x18')]=_0x226a9e[_0x421c('0x18')]['concat'](_0x1f9422);return _0x226a9e;}function createTables(_0x2881e5){var _0x13acb3=[];var _0x346e6a=_['chunk'](Object[_0x421c('0x19')](_0x2881e5[0x0]),0x5);_0x346e6a[_0x421c('0x1a')](function(_0x4023b8){_0x13acb3['push'](createTable(_0x4023b8,_0x2881e5));});return _0x13acb3;}function getPDFDocDefinition(_0x36d235){var _0x24ffae=util[_0x421c('0x1b')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x421c('0x1c')],moment(EXTRACTED_REPORT[_0x421c('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x421c('0x1e')])[_0x421c('0x1b')](FORMAT));var _0x3d06c7=[];for(var _0x64d5a9=0x0;_0x64d5a9<_0x36d235[_0x421c('0x1f')];_0x64d5a9++){var _0x584012=[];if(_0x64d5a9===0x0){_0x584012[_0x421c('0x17')]({'text':_0x24ffae,'style':_0x421c('0x20')});}var _0x1986f6={'table':_0x36d235[_0x64d5a9]};if(_0x64d5a9>0x0){_0x1986f6['pageBreak']=_0x421c('0x21');_0x1986f6[_0x421c('0x22')]=[0x0,0x46,0x0,0x0];}_0x584012['push'](_0x1986f6);_0x3d06c7[_0x421c('0x17')](_0x584012);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x3d06c7,'footer':function(_0x4a5352,_0x3eb96d){return{'text':_0x4a5352[_0x421c('0x14')]()+_0x421c('0x23')+_0x3eb96d,'style':'footer'};},'defaultStyle':{'font':_0x421c('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x421c('0x25')},'footer':{'alignment':_0x421c('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3d0f3a){var _0x24f0d3=0x1388;var _0x50c86b;if(!_0x3d0f3a[0x0][_0x421c('0x27')]){return analyticExtractedReport(_0x421c('0x28'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x421c('0x29'),_0x421c('0x2a')]})[_0x421c('0x2b')](function(_0x480565){if(_0x480565){_0x50c86b=_0x480565;_0x24f0d3=_0x50c86b[_0x421c('0x2a')]||0x3e8;}})[_0x421c('0x2b')](function(){var _0x4fa262=[];var _0xbbb8e0=0x0;if(_0x50c86b[_0x421c('0x29')]){if(_0x3d0f3a&&_0x3d0f3a[_0x421c('0x1f')]){var _0xceee12=_['range'](_0x3d0f3a[0x0][_0x421c('0x27')]/_0x24f0d3);var _0x318495=Number['isInteger'](_0x3d0f3a[0x0][_0x421c('0x27')]/_0x24f0d3)?_0x3d0f3a[0x0][_0x421c('0x27')]%_0x24f0d3:0x0;_0xceee12[_0x421c('0x1a')](function(_0x5bc159){if(_0x5bc159>0x0){_0xbbb8e0+=_0x24f0d3;}_0x4fa262['push'](dbH[_0x421c('0x2c')]['query'](util[_0x421c('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24f0d3,_0xbbb8e0),{'type':dbH[_0x421c('0x2c')][_0x421c('0x2d')][_0x421c('0x2e')]}));});if(_0x318495>0x0){_0xbbb8e0+=_0x24f0d3;_0x4fa262[_0x421c('0x17')](dbH[_0x421c('0x2c')][_0x421c('0x2f')](util[_0x421c('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x318495,_0xbbb8e0),{'type':dbH[_0x421c('0x2c')][_0x421c('0x2d')][_0x421c('0x2e')]}));}}}else{_0x4fa262['push'](dbH[_0x421c('0x2c')][_0x421c('0x2f')](QUERY,{'type':dbH[_0x421c('0x2c')][_0x421c('0x2d')][_0x421c('0x2e')]}));}var _0xdb49ee=path[_0x421c('0x30')](PATH);var _0x5aa843=path[_0x421c('0x31')](PATH,_0x421c('0x32'));var _0x3ae5ad=_0x50c86b[_0x421c('0x29')]&&_0x4fa262[_0x421c('0x1f')]>0x1;var _0xa4469a=[];if(!fs[_0x421c('0x33')](path[_0x421c('0x34')](_0xdb49ee,_0x5aa843))&&_0x3ae5ad){fs[_0x421c('0x35')](path['join'](_0xdb49ee,_0x5aa843));}return BPromise['each'](_0x4fa262,function(_0x4dbbbc){_0xa4469a[_0x421c('0x17')](_0x4dbbbc);})[_0x421c('0x2b')](function(){var _0x33e409=[];for(var _0x170102=0x0;_0x170102<_0xa4469a[_0x421c('0x1f')];_0x170102+=0x1){var _0x42b075=_0xa4469a[_0x170102];var _0x18b47e=createTables(_['flatten'](_0x42b075));var _0x14e200;var _0x378245=getPDFDocDefinition(_0x18b47e);var _0x87b3de=getPDFPrinter();var _0x4a52e2=_0x87b3de[_0x421c('0x36')](_0x378245);if(_0x3ae5ad){_0x14e200=path[_0x421c('0x34')](_0xdb49ee,_0x5aa843,util['format'](_0x421c('0x37'),_0x5aa843,_0x170102,_0x421c('0x38')));}else{_0x14e200=path[_0x421c('0x34')](_0xdb49ee,util[_0x421c('0x1b')](_0x421c('0x39'),_0x5aa843,_0x421c('0x38')));}_0x33e409[_0x421c('0x17')](writePDFDocument(_0x4a52e2,_0x14e200));}return Promise['all'](_0x33e409);})[_0x421c('0x2b')](function(){if(_0x3ae5ad){return new Promise(function(_0x16397b){zipdir(path[_0x421c('0x34')](_0xdb49ee,_0x5aa843),{'saveTo':path[_0x421c('0x34')](_0xdb49ee,util[_0x421c('0x1b')](_0x421c('0x39'),_0x5aa843,_0x421c('0x3a')))},function(){rimraf(path['join'](_0xdb49ee,_0x5aa843),function(){});_0x16397b('zip\x20finished');});});}})[_0x421c('0x2b')](function(){if(!_0x3ae5ad)return;rimraf(path[_0x421c('0x34')](_0xdb49ee,_0x5aa843),function(){});})[_0x421c('0x2b')](function(){logger['info'](util[_0x421c('0x1b')](_0x421c('0x3b'),EXTRACTED_REPORT_ID,_0x421c('0x3c')));return analyticExtractedReport(_0x421c('0x3d'),_0x3ae5ad?util['format'](_0x421c('0x39'),_0x5aa843,_0x3ae5ad?_0x421c('0x3a'):_0x421c('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x421c('0x3e')](util['format'](_0x421c('0x3f'),EXTRACTED_REPORT_ID,_0x421c('0x3c')));return db[_0x421c('0x40')][_0x421c('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x421c('0x2b')](function(_0x3240eb){EXTRACTED_REPORT=_0x3240eb;return dbH['sequelize'][_0x421c('0x2f')](util[_0x421c('0x1b')](_0x421c('0x42'),QUERY),{'type':dbH[_0x421c('0x2c')]['QueryTypes'][_0x421c('0x2e')]});})[_0x421c('0x2b')](extractReport)['catch'](function(_0x18910e){logger['info'](util[_0x421c('0x1b')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x421c('0x3c')),util['inspect'](_0x18910e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x421c('0x43')](function(){process[_0x421c('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4d3d80=new PdfPrinter({'Arial':{'normal':__dirname+_0x421c('0x45'),'bold':__dirname+_0x421c('0x46'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x421c('0x47')}});return _0x4d3d80;}function getPDFDocDefinitionFromHTML(_0x357c54,_0x5a344f){var _0x5ae784=util[_0x421c('0x1b')]('%s\x20#%d',_0x5a344f['channel'],_0x5a344f[_0x421c('0x48')]);var _0x21788f=moment()[_0x421c('0x1b')](_0x421c('0x49'))[_0x421c('0x14')]();var _0x1e12e7=htmlToPdfmake(_0x357c54,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1e12e7],'defaultStyle':{'font':_0x421c('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x421c('0x4a'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x421c('0x4a')}},'header':function(){return[{'text':_0x421c('0x4b'),'style':_0x421c('0x20')}];},'footer':function(_0x1e0971,_0x391f6d){return[{'text':util['format'](_0x421c('0x4c'),_0x5ae784,_0x1e0971,_0x391f6d,_0x21788f),'style':'footer'}];}};}function writePDFDocument(_0x4f996c,_0x33062a){return new Promise(function(_0x1309cd,_0x5b7c20){var _0x3a71a8=_0x4f996c[_0x421c('0x4d')](fs[_0x421c('0x4e')](_0x33062a));_0x3a71a8['on'](_0x421c('0x4f'),function(){_0x1309cd(_0x421c('0x4f'));});_0x3a71a8['on']('error',function(_0x59059a){_0x5b7c20(_0x59059a);});_0x4f996c['end']();});}exports[_0x421c('0x50')]=function(_0x3ca6c6,_0x391994){var _0xc93923=getPDFPrinter();var _0x3ec35f=getPDFDocDefinitionFromHTML(_0x3ca6c6,_0x391994);var _0x67c86b=_0xc93923[_0x421c('0x36')](_0x3ec35f);return writePDFDocument(_0x67c86b,_0x391994[_0x421c('0x2')])[_0x421c('0x51')](function(_0x33b84c){throw _0x33b84c;});}; \ No newline at end of file +var _0x7cef=['footer','black','num','Empty','find','splitSizePdf','then','split','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','SELECT','QueryTypes','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','Arial','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','end','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','pick','value','fill','length','auto','body','concat','chunk','keys','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','format','header','pageBreak','before','margin','toString','\x20/\x20'];(function(_0x22e6ba,_0x26b0d0){var _0x4bfbc8=function(_0x535031){while(--_0x535031){_0x22e6ba['push'](_0x22e6ba['shift']());}};_0x4bfbc8(++_0x26b0d0);}(_0x7cef,0xe3));var _0xf7ce=function(_0xfc6cb7,_0x346a04){_0xfc6cb7=_0xfc6cb7-0x0;var _0x2357ef=_0x7cef[_0xfc6cb7];return _0x2357ef;};'use strict';var _=require(_0xf7ce('0x0'));var fs=require('fs');var util=require(_0xf7ce('0x1'));var path=require(_0xf7ce('0x2'));var moment=require(_0xf7ce('0x3'));var htmlToPdfmake=require(_0xf7ce('0x4'));var PdfPrinter=require(_0xf7ce('0x5'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0xf7ce('0x6')];var window=new JSDOM('')[_0xf7ce('0x7')];var BPromise=require(_0xf7ce('0x8'));var db=require(_0xf7ce('0x9'))['db'];var dbH=require(_0xf7ce('0x9'))[_0xf7ce('0xa')];var logger=require(_0xf7ce('0xb'))(_0xf7ce('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xf7ce('0xd')][0x2]);var QUERY=process[_0xf7ce('0xd')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x26288e,_0x12bd3b){var _0x5a7c63={'status':_0x26288e};var _0x5adafc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x12bd3b){_0x5a7c63[_0xf7ce('0xe')]=_0x12bd3b;}return db[_0xf7ce('0xf')][_0xf7ce('0x10')](_0x5a7c63,_0x5adafc);}function getHeaders(_0x2252e1){return _['map'](_0x2252e1,function(_0x2b1d43){return{'text':_0x2b1d43,'style':'tableHeader'};});}function getRows(_0x1c8782,_0x2c4f88){return _[_0xf7ce('0x11')](_0x2c4f88,function(_0x38d2a4){return _(_0x38d2a4)[_0xf7ce('0x12')](_0x1c8782)[_0xf7ce('0x11')](function(_0x727f63){return _0x727f63?_['toString'](_0x727f63):'';})[_0xf7ce('0x13')]();});}function createTable(_0x388e07,_0x4bbabf){var _0x194a66={'widths':_[_0xf7ce('0x14')](Array(_0x388e07[_0xf7ce('0x15')]),0x91),'heights':function(_0x4323c2){return _0x4323c2===0x0?_0xf7ce('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3785fa=getHeaders(_0x388e07);_0x194a66['body']['push'](_0x3785fa);var _0xfc279=getRows(_0x388e07,_0x4bbabf);_0x194a66[_0xf7ce('0x17')]=_0x194a66['body'][_0xf7ce('0x18')](_0xfc279);return _0x194a66;}function createTables(_0x42dec8){var _0x322368=[];var _0x2584e2=_[_0xf7ce('0x19')](Object[_0xf7ce('0x1a')](_0x42dec8[0x0]),0x5);_0x2584e2[_0xf7ce('0x1b')](function(_0x2184ec){_0x322368[_0xf7ce('0x1c')](createTable(_0x2184ec,_0x42dec8));});return _0x322368;}function getPDFDocDefinition(_0x413480){var _0x10d6ec=util['format'](_0xf7ce('0x1d'),NAME,EXTRACTED_REPORT[_0xf7ce('0x1e')],moment(EXTRACTED_REPORT[_0xf7ce('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xf7ce('0x20')])[_0xf7ce('0x21')](FORMAT));var _0x32d647=[];for(var _0x5e4170=0x0;_0x5e4170<_0x413480['length'];_0x5e4170++){var _0x1dd85f=[];if(_0x5e4170===0x0){_0x1dd85f[_0xf7ce('0x1c')]({'text':_0x10d6ec,'style':_0xf7ce('0x22')});}var _0xd5a1e6={'table':_0x413480[_0x5e4170]};if(_0x5e4170>0x0){_0xd5a1e6[_0xf7ce('0x23')]=_0xf7ce('0x24');_0xd5a1e6[_0xf7ce('0x25')]=[0x0,0x46,0x0,0x0];}_0x1dd85f[_0xf7ce('0x1c')](_0xd5a1e6);_0x32d647[_0xf7ce('0x1c')](_0x1dd85f);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x32d647,'footer':function(_0x2359f8,_0x528e1f){return{'text':_0x2359f8[_0xf7ce('0x26')]()+_0xf7ce('0x27')+_0x528e1f,'style':_0xf7ce('0x28')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf7ce('0x29')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x198f8e){var _0xfc5b2f=0x1388;var _0x4151d9;if(!_0x198f8e[0x0][_0xf7ce('0x2a')]){return analyticExtractedReport(_0xf7ce('0x2b'));}return db['Setting'][_0xf7ce('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf7ce('0x2d')]})[_0xf7ce('0x2e')](function(_0x102468){if(_0x102468){_0x4151d9=_0x102468;_0xfc5b2f=_0x4151d9[_0xf7ce('0x2d')]||0x3e8;}})['then'](function(){var _0x5e5523=[];var _0x29c2b1=0x0;if(_0x4151d9[_0xf7ce('0x2f')]){if(_0x198f8e&&_0x198f8e['length']){var _0x2214e6=_[_0xf7ce('0x30')](_0x198f8e[0x0][_0xf7ce('0x2a')]/_0xfc5b2f);var _0xd57b71=Number[_0xf7ce('0x31')](_0x198f8e[0x0][_0xf7ce('0x2a')]/_0xfc5b2f)?_0x198f8e[0x0][_0xf7ce('0x2a')]%_0xfc5b2f:0x0;_0x2214e6[_0xf7ce('0x1b')](function(_0x3d69a0){if(_0x3d69a0>0x0){_0x29c2b1+=_0xfc5b2f;}_0x5e5523[_0xf7ce('0x1c')](dbH['sequelize'][_0xf7ce('0x32')](util[_0xf7ce('0x21')](_0xf7ce('0x33'),QUERY,_0xfc5b2f,_0x29c2b1),{'type':dbH[_0xf7ce('0x34')]['QueryTypes'][_0xf7ce('0x35')]}));});if(_0xd57b71>0x0){_0x29c2b1+=_0xfc5b2f;_0x5e5523[_0xf7ce('0x1c')](dbH['sequelize'][_0xf7ce('0x32')](util[_0xf7ce('0x21')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xd57b71,_0x29c2b1),{'type':dbH[_0xf7ce('0x34')][_0xf7ce('0x36')][_0xf7ce('0x35')]}));}}}else{_0x5e5523[_0xf7ce('0x1c')](dbH[_0xf7ce('0x34')]['query'](QUERY,{'type':dbH[_0xf7ce('0x34')][_0xf7ce('0x36')]['SELECT']}));}var _0x55f9c8=path['dirname'](PATH);var _0x1f0100=path['basename'](PATH,_0xf7ce('0x37'));var _0x1ae55b=_0x4151d9[_0xf7ce('0x2f')]&&_0x5e5523[_0xf7ce('0x15')]>0x1;var _0x53452b=[];if(!fs[_0xf7ce('0x38')](path['join'](_0x55f9c8,_0x1f0100))&&_0x1ae55b){fs[_0xf7ce('0x39')](path[_0xf7ce('0x3a')](_0x55f9c8,_0x1f0100));}return BPromise[_0xf7ce('0x3b')](_0x5e5523,function(_0x56f63b){_0x53452b[_0xf7ce('0x1c')](_0x56f63b);})[_0xf7ce('0x2e')](function(){var _0x2dad4a=[];for(var _0x188333=0x0;_0x188333<_0x53452b['length'];_0x188333+=0x1){var _0x272623=_0x53452b[_0x188333];var _0x46184f=createTables(_[_0xf7ce('0x3c')](_0x272623));var _0x573d49;var _0x4b9954=getPDFDocDefinition(_0x46184f);var _0x380cff=getPDFPrinter();var _0x26afd9=_0x380cff[_0xf7ce('0x3d')](_0x4b9954);if(_0x1ae55b){_0x573d49=path[_0xf7ce('0x3a')](_0x55f9c8,_0x1f0100,util['format'](_0xf7ce('0x3e'),_0x1f0100,_0x188333,_0xf7ce('0x3f')));}else{_0x573d49=path[_0xf7ce('0x3a')](_0x55f9c8,util[_0xf7ce('0x21')](_0xf7ce('0x40'),_0x1f0100,_0xf7ce('0x3f')));}_0x2dad4a[_0xf7ce('0x1c')](writePDFDocument(_0x26afd9,_0x573d49));}return Promise[_0xf7ce('0x41')](_0x2dad4a);})[_0xf7ce('0x2e')](function(){if(_0x1ae55b){return new Promise(function(_0x281638){zipdir(path[_0xf7ce('0x3a')](_0x55f9c8,_0x1f0100),{'saveTo':path[_0xf7ce('0x3a')](_0x55f9c8,util[_0xf7ce('0x21')](_0xf7ce('0x40'),_0x1f0100,_0xf7ce('0x42')))},function(){rimraf(path['join'](_0x55f9c8,_0x1f0100),function(){});_0x281638('zip\x20finished');});});}})[_0xf7ce('0x2e')](function(){if(!_0x1ae55b)return;rimraf(path[_0xf7ce('0x3a')](_0x55f9c8,_0x1f0100),function(){});})[_0xf7ce('0x2e')](function(){logger[_0xf7ce('0x43')](util[_0xf7ce('0x21')](_0xf7ce('0x44'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xf7ce('0x45'),_0x1ae55b?util[_0xf7ce('0x21')]('%s.%s',_0x1f0100,_0x1ae55b?_0xf7ce('0x42'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf7ce('0x43')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf7ce('0x46')));return db[_0xf7ce('0xf')][_0xf7ce('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf7ce('0x2e')](function(_0x2e532c){EXTRACTED_REPORT=_0x2e532c;return dbH[_0xf7ce('0x34')][_0xf7ce('0x32')](util[_0xf7ce('0x21')](_0xf7ce('0x48'),QUERY),{'type':dbH[_0xf7ce('0x34')][_0xf7ce('0x36')]['SELECT']});})['then'](extractReport)['catch'](function(_0x29bf0a){logger[_0xf7ce('0x43')](util[_0xf7ce('0x21')](_0xf7ce('0x49'),EXTRACTED_REPORT_ID,_0xf7ce('0x46')),util['inspect'](_0x29bf0a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xf7ce('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x429fdb=new PdfPrinter({'Arial':{'normal':__dirname+_0xf7ce('0x4b'),'bold':__dirname+_0xf7ce('0x4c'),'italics':__dirname+_0xf7ce('0x4d'),'bolditalics':__dirname+_0xf7ce('0x4e')}});return _0x429fdb;}function getPDFDocDefinitionFromHTML(_0x304deb,_0x5f0441){var _0x38e5dc=util[_0xf7ce('0x21')](_0xf7ce('0x4f'),_0x5f0441[_0xf7ce('0x50')],_0x5f0441['interactionId']);var _0x53b734=moment()[_0xf7ce('0x21')](_0xf7ce('0x51'))[_0xf7ce('0x26')]();var _0x13874f=htmlToPdfmake(_0x304deb,{'window':window,'tableAutoSize':!![]});return{'content':[_0x13874f],'defaultStyle':{'font':_0xf7ce('0x52')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf7ce('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf7ce('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xf7ce('0x22')}];},'footer':function(_0x1e9b41,_0x297b71){return[{'text':util[_0xf7ce('0x21')](_0xf7ce('0x54'),_0x38e5dc,_0x1e9b41,_0x297b71,_0x53b734),'style':_0xf7ce('0x28')}];}};}function writePDFDocument(_0x5a4832,_0x4829d7){return new Promise(function(_0x5e6e93,_0x3923c4){var _0x358969=_0x5a4832[_0xf7ce('0x55')](fs['createWriteStream'](_0x4829d7));_0x358969['on']('finish',function(){_0x5e6e93('finish');});_0x358969['on']('error',function(_0x104a2d){_0x3923c4(_0x104a2d);});_0x5a4832[_0xf7ce('0x56')]();});}exports[_0xf7ce('0x57')]=function(_0x41f57b,_0x56382e){var _0x52f863=getPDFPrinter();var _0x3da69c=getPDFDocDefinitionFromHTML(_0x41f57b,_0x56382e);var _0x38c227=_0x52f863[_0xf7ce('0x3d')](_0x3da69c);return writePDFDocument(_0x38c227,_0x56382e['path'])[_0xf7ce('0x58')](function(_0x2d1d43){throw _0x2d1d43;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index c4c0afa..0ad7166 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 _0xdd6a=['existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','length','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','query','SELECT','basename','.xlsx'];(function(_0xe9c8e4,_0x3aa2f6){var _0x2037fa=function(_0xcb43b1){while(--_0xcb43b1){_0xe9c8e4['push'](_0xe9c8e4['shift']());}};_0x2037fa(++_0x3aa2f6);}(_0xdd6a,0x15d));var _0xadd6=function(_0x5c3fac,_0x5f0267){_0x5c3fac=_0x5c3fac-0x0;var _0x382099=_0xdd6a[_0x5c3fac];return _0x382099;};'use strict';var util=require(_0xadd6('0x0'));var path=require(_0xadd6('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xadd6('0x2'));var BPromise=require(_0xadd6('0x3'));var zipdir=require(_0xadd6('0x4'));var rimraf=require(_0xadd6('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xadd6('0x6'))[_0xadd6('0x7')];var logger=require(_0xadd6('0x8'))(_0xadd6('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xadd6('0xa')][0x2]);var QUERY=process[_0xadd6('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4368d0,_0x51cbe6){var _0x27be41={'status':_0x4368d0};var _0x119801={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51cbe6){_0x27be41[_0xadd6('0xb')]=_0x51cbe6;}return db['AnalyticExtractedReport'][_0xadd6('0xc')](_0x27be41,_0x119801);}function main(){var _0x5ef445=0x1388;var _0x2fdd60;logger[_0xadd6('0xd')](util[_0xadd6('0xe')](_0xadd6('0xf'),EXTRACTED_REPORT_ID,_0xadd6('0x10')));return db[_0xadd6('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xadd6('0x12'),_0xadd6('0x13')]})[_0xadd6('0x14')](function(_0x5b2512){if(_0x5b2512){_0x2fdd60=_0x5b2512;_0x5ef445=_0x2fdd60['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0xadd6('0xe')](_0xadd6('0x15'),QUERY),{'type':dbH[_0xadd6('0x16')][_0xadd6('0x17')]['SELECT']});})[_0xadd6('0x14')](function(_0x4ffa70){if(!_0x4ffa70[0x0][_0xadd6('0x18')]){return analyticExtractedReport(_0xadd6('0x19'));}var _0x54ee9b=[];var _0x274a71=0x0;if(_0x2fdd60['split']){if(_0x4ffa70&&_0x4ffa70[_0xadd6('0x1a')]){var _0x5e0a4d=_['range'](_0x4ffa70[0x0][_0xadd6('0x18')]/_0x5ef445);var _0x15fdca=Number[_0xadd6('0x1b')](_0x4ffa70[0x0][_0xadd6('0x18')]/_0x5ef445)?_0x4ffa70[0x0]['num']%_0x5ef445:0x0;_0x5e0a4d[_0xadd6('0x1c')](function(_0x107aa0){if(_0x107aa0>0x0){_0x274a71+=_0x5ef445;}_0x54ee9b['push'](dbH[_0xadd6('0x16')]['query'](util[_0xadd6('0xe')](_0xadd6('0x1d'),QUERY,_0x5ef445,_0x274a71),{'type':dbH[_0xadd6('0x16')][_0xadd6('0x17')]['SELECT']}));});if(_0x15fdca>0x0){_0x274a71+=_0x5ef445;_0x54ee9b[_0xadd6('0x1e')](dbH[_0xadd6('0x16')][_0xadd6('0x1f')](util[_0xadd6('0xe')](_0xadd6('0x1d'),QUERY,_0x15fdca,_0x274a71),{'type':dbH[_0xadd6('0x16')][_0xadd6('0x17')][_0xadd6('0x20')]}));}}}else{_0x54ee9b[_0xadd6('0x1e')](dbH[_0xadd6('0x16')][_0xadd6('0x1f')](QUERY,{'type':dbH[_0xadd6('0x16')][_0xadd6('0x17')][_0xadd6('0x20')]}));}var _0x4772b9=path['dirname'](PATH);var _0x449151=path[_0xadd6('0x21')](PATH,_0xadd6('0x22'));var _0x5138ad=_0x2fdd60[_0xadd6('0x12')]&&_0x54ee9b[_0xadd6('0x1a')]>0x1;var _0x279758=[];if(!fs[_0xadd6('0x23')](path[_0xadd6('0x24')](_0x4772b9,_0x449151))&&_0x5138ad){fs[_0xadd6('0x25')](path[_0xadd6('0x24')](_0x4772b9,_0x449151));}return BPromise['each'](_0x54ee9b,function(_0x39a3f7){_0x279758[_0xadd6('0x1e')](_0x39a3f7);})[_0xadd6('0x14')](function(){for(var _0x2b1d19=0x0;_0x2b1d19<_0x279758[_0xadd6('0x1a')];_0x2b1d19+=0x1){var _0x16b610;var _0x3135eb=_0x279758[_0x2b1d19];if(_0x5138ad){_0x16b610=path[_0xadd6('0x24')](_0x4772b9,_0x449151,util[_0xadd6('0xe')](_0xadd6('0x26'),_0x449151,_0x2b1d19,_0xadd6('0x27')));}else{_0x16b610=path[_0xadd6('0x24')](_0x4772b9,util[_0xadd6('0xe')]('%s.%s',_0x449151,'xlsx'));}fs['writeFileSync'](_0x16b610,json2xls(_0x3135eb),'binary');}})['then'](function(){if(_0x5138ad){return new Promise(function(_0x7a707c){zipdir(path[_0xadd6('0x24')](_0x4772b9,_0x449151),{'saveTo':path[_0xadd6('0x24')](_0x4772b9,util[_0xadd6('0xe')](_0xadd6('0x28'),_0x449151,_0xadd6('0x29')))},function(_0x570f9a,_0x5a3060){rimraf(path[_0xadd6('0x24')](_0x4772b9,_0x449151),function(){});_0x7a707c('zip\x20finished');});});}})[_0xadd6('0x14')](function(){logger[_0xadd6('0xd')](util[_0xadd6('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xadd6('0x10')));return analyticExtractedReport(_0xadd6('0x2a'),_0x5138ad?util[_0xadd6('0xe')](_0xadd6('0x28'),_0x449151,_0x5138ad?_0xadd6('0x29'):'xlsx'):null);});})[_0xadd6('0x2b')](function(_0x20c396){logger[_0xadd6('0xd')](util[_0xadd6('0xe')](_0xadd6('0x2c'),EXTRACTED_REPORT_ID,_0xadd6('0x10')),util[_0xadd6('0x2d')](_0x20c396,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xadd6('0x2e'));})[_0xadd6('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xcac2=['lodash','bluebird','zip-dir','../../config/logger','analytics','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','mkdirSync','each','length','join','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path'];(function(_0x3702e9,_0xa63337){var _0x3afcb7=function(_0x4aaaf5){while(--_0x4aaaf5){_0x3702e9['push'](_0x3702e9['shift']());}};_0x3afcb7(++_0xa63337);}(_0xcac2,0x1e8));var _0x2cac=function(_0x820783,_0x5d8b15){_0x820783=_0x820783-0x0;var _0x416566=_0xcac2[_0x820783];return _0x416566;};'use strict';var util=require(_0x2cac('0x0'));var path=require(_0x2cac('0x1'));var _=require(_0x2cac('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x2cac('0x3'));var zipdir=require(_0x2cac('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x2cac('0x5'))(_0x2cac('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x2cac('0x7')][0x2]);var QUERY=process[_0x2cac('0x7')][0x3];var PATH=process[_0x2cac('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x703f11,_0x1920cf){var _0x56b4f9={'status':_0x703f11};var _0x5df249={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1920cf){_0x56b4f9[_0x2cac('0x8')]=_0x1920cf;}return db['AnalyticExtractedReport'][_0x2cac('0x9')](_0x56b4f9,_0x5df249);}function main(){var _0x2590a0=0x1388;var _0x48857a;logger['info'](util[_0x2cac('0xa')](_0x2cac('0xb'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x2cac('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2cac('0xd'),_0x2cac('0xe')]})[_0x2cac('0xf')](function(_0x1ccf7b){if(_0x1ccf7b){_0x48857a=_0x1ccf7b;_0x2590a0=_0x48857a[_0x2cac('0xe')]||0x1388;}})['then'](function(){return dbH[_0x2cac('0x10')][_0x2cac('0x11')](util['format'](_0x2cac('0x12'),QUERY),{'type':dbH[_0x2cac('0x10')][_0x2cac('0x13')]['SELECT']});})[_0x2cac('0xf')](function(_0x354ab7){if(!_0x354ab7[0x0][_0x2cac('0x14')]){return analyticExtractedReport('Empty');}var _0x46db00=[];var _0x3e7e90=0x0;if(_0x48857a[_0x2cac('0xd')]){if(_0x354ab7&&_0x354ab7['length']){var _0x58b93d=_[_0x2cac('0x15')](_0x354ab7[0x0][_0x2cac('0x14')]/_0x2590a0);var _0x1dac01=Number[_0x2cac('0x16')](_0x354ab7[0x0][_0x2cac('0x14')]/_0x2590a0)?_0x354ab7[0x0]['num']%_0x2590a0:0x0;_0x58b93d[_0x2cac('0x17')](function(_0x2764c7){if(_0x2764c7>0x0){_0x3e7e90+=_0x2590a0;}_0x46db00[_0x2cac('0x18')](dbH[_0x2cac('0x10')][_0x2cac('0x11')](util[_0x2cac('0xa')](_0x2cac('0x19'),QUERY,_0x2590a0,_0x3e7e90),{'type':dbH[_0x2cac('0x10')]['QueryTypes'][_0x2cac('0x1a')]}));});if(_0x1dac01>0x0){_0x3e7e90+=_0x2590a0;_0x46db00[_0x2cac('0x18')](dbH['sequelize']['query'](util[_0x2cac('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1dac01,_0x3e7e90),{'type':dbH[_0x2cac('0x10')][_0x2cac('0x13')]['SELECT']}));}}}else{_0x46db00[_0x2cac('0x18')](dbH['sequelize'][_0x2cac('0x11')](QUERY,{'type':dbH[_0x2cac('0x10')][_0x2cac('0x13')][_0x2cac('0x1a')]}));}var _0x547154=path[_0x2cac('0x1b')](PATH);var _0x1de22c=path[_0x2cac('0x1c')](PATH,_0x2cac('0x1d'));var _0x1224ed=_0x48857a[_0x2cac('0xd')]&&_0x46db00['length']>0x1;var _0x2c1968=[];if(!fs[_0x2cac('0x1e')](path['join'](_0x547154,_0x1de22c))&&_0x1224ed){fs[_0x2cac('0x1f')](path['join'](_0x547154,_0x1de22c));}return BPromise[_0x2cac('0x20')](_0x46db00,function(_0x387e56){_0x2c1968['push'](_0x387e56);})['then'](function(){for(var _0x221d72=0x0;_0x221d72<_0x2c1968[_0x2cac('0x21')];_0x221d72+=0x1){var _0x246cef;var _0x4fa50b=_0x2c1968[_0x221d72];if(_0x1224ed){_0x246cef=path[_0x2cac('0x22')](_0x547154,_0x1de22c,util[_0x2cac('0xa')](_0x2cac('0x23'),_0x1de22c,_0x221d72,'xlsx'));}else{_0x246cef=path[_0x2cac('0x22')](_0x547154,util[_0x2cac('0xa')](_0x2cac('0x24'),_0x1de22c,_0x2cac('0x25')));}fs[_0x2cac('0x26')](_0x246cef,json2xls(_0x4fa50b),_0x2cac('0x27'));}})[_0x2cac('0xf')](function(){if(_0x1224ed){return new Promise(function(_0x59ee4c){zipdir(path[_0x2cac('0x22')](_0x547154,_0x1de22c),{'saveTo':path[_0x2cac('0x22')](_0x547154,util[_0x2cac('0xa')]('%s.%s',_0x1de22c,_0x2cac('0x28')))},function(_0x1deb95,_0x36b1c3){rimraf(path[_0x2cac('0x22')](_0x547154,_0x1de22c),function(){});_0x59ee4c(_0x2cac('0x29'));});});}})[_0x2cac('0xf')](function(){logger[_0x2cac('0x2a')](util[_0x2cac('0xa')](_0x2cac('0x2b'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x1224ed?util['format'](_0x2cac('0x24'),_0x1de22c,_0x1224ed?_0x2cac('0x28'):'xlsx'):null);});})['catch'](function(_0x47a5aa){logger['info'](util['format'](_0x2cac('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x2cac('0x2d')](_0x47a5aa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2cac('0x2e'));})[_0x2cac('0x2f')](function(){process[_0x2cac('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b94fb3d..ad1ef6c 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 _0xe85f=['XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','filter','tag','callerID','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','sortBy','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','groupBy','exten','extensions','extension','push','type','Set','format','CDR(type)=%s','priority','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0xe85f,0x16a));var _0xfe85=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xe85f[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xfe85('0x0'));var util=require(_0xfe85('0x1'));function rewrite(_0x597496,_0x44828c){var _0x257f7f=this;return _0x597496[_0xfe85('0x2')][_0xfe85('0x3')][_0xfe85('0x4')]({'raw':!![]})[_0xfe85('0x5')](function(_0x522ce6){_0x257f7f[_0xfe85('0x6')]=_0x522ce6;return _0x597496[_0xfe85('0x2')][_0xfe85('0x7')][_0xfe85('0x4')]({'where':{'IntervalId':_0x44828c[_0xfe85('0x8')]},'raw':!![]});})[_0xfe85('0x5')](function(_0x45007e){return _0x597496[_0xfe85('0x2')]['VoiceExtension'][_0xfe85('0x4')]({'where':{'exten':{'$in':_[_0xfe85('0x9')](_[_0xfe85('0xa')](_0x45007e,'exten'))}},'order':[{'raw':_0xfe85('0xb')}],'raw':!![]});})[_0xfe85('0x5')](function(_0x1c8037){var _0x3a2cd0=_['filter'](_0x1c8037,{'priority':'1'});var _0x351dc9=_['filter'](_0x1c8037,{'isApp':0x1});var _0x14e234=_[_0xfe85('0xc')](_0x351dc9,_0xfe85('0xd'));var _0x112e88=['queue','playback'];var _0x5a691a=[];var _0x2b08fc=[];for(var _0x4f0698 in _0x14e234){if(_0x14e234['hasOwnProperty'](_0x4f0698)){_0x257f7f['priority']=0x2;_0x257f7f[_0xfe85('0xe')]=[];_0x257f7f[_0xfe85('0xf')]=_['find'](_0x3a2cd0,{'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')]});_0x257f7f['extensions'][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':util[_0xfe85('0x13')](_0xfe85('0x14'),_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')]),'context':_0x14e234[_0x4f0698][0x0]['context'],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x257f7f[_0xfe85('0x15')]++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});if(_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')]===_0xfe85('0x17')){_0x257f7f[_0xfe85('0xe')][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0]['type'],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x18')+_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')],'context':_0x14e234[_0x4f0698][0x0][_0xfe85('0x19')],'exten':_0x14e234[_0x4f0698][0x0]['exten'],'priority':_0x257f7f[_0xfe85('0x15')]++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});}else if(_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')]===_0xfe85('0x1a')){if(_0x257f7f['extension']){_0x257f7f['extensions'][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x1b')+(_0x257f7f[_0xfe85('0xf')][_0xfe85('0x1c')]?'${EXTEN:'+_0x257f7f[_0xfe85('0xf')][_0xfe85('0x1c')]+'}':_0xfe85('0x1d')),'context':_0x14e234[_0x4f0698][0x0][_0xfe85('0x19')],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x257f7f[_0xfe85('0x15')]++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});}_0x257f7f[_0xfe85('0xe')][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x18')+_0x14e234[_0x4f0698][0x0]['VoiceExtensionId'],'context':_0x14e234[_0x4f0698][0x0][_0xfe85('0x19')],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x257f7f['priority']++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0]['VoiceExtensionId']});var _0x168d66=_0x257f7f[_0xfe85('0x15')]++;_0x257f7f[_0xfe85('0xe')]['push']({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x1e'),'appdata':_0xfe85('0x1f')+(_0x168d66+0x2)+_0xfe85('0x20')+(_0x168d66+0x1)+')','context':_0x14e234[_0x4f0698][0x0][_0xfe85('0x19')],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x168d66,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});if(_0x257f7f['extension']){_0x257f7f[_0xfe85('0xe')][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':_0x257f7f['extension'][_0xfe85('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x257f7f[_0xfe85('0xf')][_0xfe85('0x1c')]+'}':_0xfe85('0x21'),'context':_0x14e234[_0x4f0698][0x0][_0xfe85('0x19')],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x257f7f['priority']++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});}_0x257f7f['extensions']['push']({'type':_0x14e234[_0x4f0698][0x0]['type'],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x22')+_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')],'context':_0x14e234[_0x4f0698][0x0][_0xfe85('0x19')],'exten':_0x14e234[_0x4f0698][0x0]['exten'],'priority':_0x257f7f['priority']++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});if(_0x257f7f[_0xfe85('0xf')]&&_0x257f7f['extension'][_0xfe85('0x23')](_0xfe85('0x24'))&&_0x257f7f['extension'][_0xfe85('0x24')]!=='none'){_0x257f7f[_0xfe85('0xe')]['push']({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x25'),'context':_0x14e234[_0x4f0698][0x0]['context'],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x257f7f[_0xfe85('0x15')]++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});_0x257f7f[_0xfe85('0xe')][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x26')+_0x257f7f[_0xfe85('0xf')][_0xfe85('0x24')]||'wav','context':_0x14e234[_0x4f0698][0x0]['context'],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x257f7f['priority']++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});}}_0x257f7f[_0xfe85('0xe')][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x27'),'context':_0x14e234[_0x4f0698][0x0]['context'],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x257f7f[_0xfe85('0x15')]++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0]['VoiceExtensionId']});_0x257f7f[_0xfe85('0xe')][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x28'),'context':_0x14e234[_0x4f0698][0x0]['context'],'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'priority':_0x257f7f[_0xfe85('0x15')]++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0]['VoiceExtensionId']});_0x257f7f[_0xfe85('0xe')][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':'Set','appdata':_0xfe85('0x29'),'context':_0x14e234[_0x4f0698][0x0][_0xfe85('0x19')],'exten':_0x14e234[_0x4f0698][0x0]['exten'],'priority':_0x257f7f[_0xfe85('0x15')]++,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});for(var _0xe2922b=0x0,_0x16f9a1=0x0;_0xe2922b<_0x14e234[_0x4f0698][_0xfe85('0x2a')];_0xe2922b+=0x1,_0x16f9a1=0x0){var _0x2bf1bf=_0x14e234[_0x4f0698][_0xe2922b];if(_0x2bf1bf[_0xfe85('0x11')]){_0x2bf1bf[_0xfe85('0x11')]=_0x2bf1bf[_0xfe85('0x11')][_0xfe85('0x2b')]();}var _0x179b80=[];var _0x1fa765=[];delete _0x2bf1bf['id'];delete _0x2bf1bf[_0xfe85('0x2c')];delete _0x2bf1bf[_0xfe85('0x2d')];var _0x47d8a8=_0x2bf1bf[_0xfe85('0x2e')]!=='*,*,*,*'?[_0x2bf1bf['interval']]:_0x2bf1bf[_0xfe85('0x8')]?_[_0xfe85('0xa')](_[_0xfe85('0x2f')](_0x257f7f[_0xfe85('0x6')],{'IntervalId':_0x2bf1bf[_0xfe85('0x8')]}),_0xfe85('0x2e')):[];if(_0x2bf1bf[_0xfe85('0x23')]('tag')){if(_0x2bf1bf[_0xfe85('0x30')]&&_0x2bf1bf[_0xfe85('0x30')]!=='--'){_0x179b80[_0xfe85('0x10')]({'type':_0x2bf1bf[_0xfe85('0x11')],'app':_0xfe85('0x12'),'appdata':'CDR(tag)='+_0x2bf1bf[_0xfe85('0x30')],'context':_0x2bf1bf['context'],'exten':_0x2bf1bf[_0xfe85('0xd')],'priority':_0x47d8a8[_0xfe85('0x2a')]+_0x257f7f['priority']+_0x16f9a1++,'VoiceExtensionId':_0x2bf1bf[_0xfe85('0x16')]});}}if(_0x2bf1bf['type']===_0xfe85('0x1a')&&_0x2bf1bf['hasOwnProperty'](_0xfe85('0x31'))){if(_0x2bf1bf['callerID']){_0x179b80[_0xfe85('0x10')]({'type':_0x2bf1bf[_0xfe85('0x11')],'app':_0xfe85('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2bf1bf[_0xfe85('0x31')]+')','context':_0x2bf1bf['context'],'exten':_0x2bf1bf[_0xfe85('0xd')],'priority':_0x47d8a8[_0xfe85('0x2a')]+_0x257f7f[_0xfe85('0x15')]+_0x16f9a1++,'VoiceExtensionId':_0x2bf1bf[_0xfe85('0x16')]});}else{_0x179b80[_0xfe85('0x10')]({'type':_0x2bf1bf[_0xfe85('0x11')],'app':_0xfe85('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x2bf1bf[_0xfe85('0x19')],'exten':_0x2bf1bf['exten'],'priority':_0x47d8a8[_0xfe85('0x2a')]+_0x257f7f[_0xfe85('0x15')]+_0x16f9a1++,'VoiceExtensionId':_0x2bf1bf[_0xfe85('0x16')]});}}if(_0x2bf1bf['hasOwnProperty'](_0xfe85('0x32'))){if(_0x112e88[_0xfe85('0x33')](_0x2bf1bf[_0xfe85('0x34')][_0xfe85('0x2b')]())>=0x0&&_0x2bf1bf[_0xfe85('0x35')]!==_0xfe85('0x36')){if(_0x2bf1bf[_0xfe85('0x32')]){_0x179b80[_0xfe85('0x10')]({'type':_0x2bf1bf[_0xfe85('0x11')],'app':_0xfe85('0x1e'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2bf1bf[_0xfe85('0x19')],'exten':_0x2bf1bf[_0xfe85('0xd')],'priority':_0x47d8a8[_0xfe85('0x2a')]+_0x257f7f['priority']+_0x16f9a1++,'VoiceExtensionId':_0x2bf1bf[_0xfe85('0x16')]});_0x179b80[_0xfe85('0x10')]({'type':_0x2bf1bf[_0xfe85('0x11')],'app':'Set','appdata':_0xfe85('0x37'),'context':_0x2bf1bf[_0xfe85('0x19')],'exten':_0x2bf1bf[_0xfe85('0xd')],'priority':_0x47d8a8[_0xfe85('0x2a')]+_0x257f7f[_0xfe85('0x15')]+_0x16f9a1++,'VoiceExtensionId':_0x2bf1bf['VoiceExtensionId']});}else{_0x179b80[_0xfe85('0x10')]({'type':_0x2bf1bf[_0xfe85('0x11')],'app':_0xfe85('0x1e'),'appdata':_0xfe85('0x38'),'context':_0x2bf1bf[_0xfe85('0x19')],'exten':_0x2bf1bf[_0xfe85('0xd')],'priority':_0x47d8a8[_0xfe85('0x2a')]+_0x257f7f[_0xfe85('0x15')]+_0x16f9a1++,'VoiceExtensionId':_0x2bf1bf[_0xfe85('0x16')]});_0x179b80[_0xfe85('0x10')]({'type':_0x2bf1bf['type'],'app':_0xfe85('0x12'),'appdata':_0xfe85('0x39'),'context':_0x2bf1bf['context'],'exten':_0x2bf1bf['exten'],'priority':_0x47d8a8[_0xfe85('0x2a')]+_0x257f7f[_0xfe85('0x15')]+_0x16f9a1++,'VoiceExtensionId':_0x2bf1bf[_0xfe85('0x16')]});}}}for(var _0x30251=0x0;_0x30251<_0x47d8a8[_0xfe85('0x2a')];_0x30251+=0x1){var _0x1efea6=_0x257f7f['priority']+_0x47d8a8[_0xfe85('0x2a')];var _0x37ab5c=_0x30251===_0x47d8a8[_0xfe85('0x2a')]-0x1?_0x257f7f[_0xfe85('0x15')]+_0x179b80[_0xfe85('0x2a')]+_0x1fa765['length']+0x2:_0x257f7f[_0xfe85('0x15')]+_0x30251+0x1;_0x179b80[_0xfe85('0x3a')](_0x30251,0x0,{'type':_0x2bf1bf[_0xfe85('0x11')],'app':_0xfe85('0x3b'),'appdata':_0x47d8a8[_0x30251]+'?'+_0x2bf1bf[_0xfe85('0x19')]+_0xfe85('0x3c')+_0x1efea6+':'+_0x2bf1bf['context']+_0xfe85('0x3c')+_0x37ab5c,'exten':_0x2bf1bf[_0xfe85('0xd')],'context':_0x2bf1bf[_0xfe85('0x19')],'priority':_0x257f7f['priority']+_0x30251,'VoiceExtensionId':_0x14e234[_0x4f0698][0x0][_0xfe85('0x16')]});}_0x2bf1bf[_0xfe85('0x15')]=_0x179b80[_0xfe85('0x2a')]?_['last'](_0x179b80)[_0xfe85('0x15')]+0x1:_0x257f7f[_0xfe85('0x15')];_0x257f7f[_0xfe85('0x15')]=(_0x1fa765[_0xfe85('0x2a')]?_[_0xfe85('0x3d')](_0x1fa765)[_0xfe85('0x15')]:_0x2bf1bf[_0xfe85('0x15')])+0x1;_0x257f7f['extensions']=_[_0xfe85('0x3e')](_0x257f7f[_0xfe85('0xe')],_0x179b80,[_0x2bf1bf],_0x1fa765);}_0x257f7f[_0xfe85('0xe')][_0xfe85('0x10')]({'type':_0x14e234[_0x4f0698][0x0][_0xfe85('0x11')],'app':_0xfe85('0x3f'),'exten':_0x14e234[_0x4f0698][0x0][_0xfe85('0xd')],'context':_0x14e234[_0x4f0698][0x0][_0xfe85('0x19')],'priority':_0x257f7f[_0xfe85('0x15')],'VoiceExtensionId':_0x14e234[_0x4f0698][0x0]['VoiceExtensionId']});_0x5a691a[_0xfe85('0x10')](_0x14e234[_0x4f0698][0x0]['VoiceExtensionId']);_0x2b08fc=_[_0xfe85('0x3e')](_0x2b08fc,_0x257f7f[_0xfe85('0xe')]);}}return _0x597496[_0xfe85('0x40')](function(_0x6cf42){return _0x597496['models'][_0xfe85('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x5a691a}},'transaction':_0x6cf42})[_0xfe85('0x5')](function(_0x3e064c){return _0x597496[_0xfe85('0x2')][_0xfe85('0x7')]['bulkCreate'](_[_0xfe85('0x41')](_0x2b08fc,_0xfe85('0x15')),{'transaction':_0x6cf42});});});})['catch'](function(_0x2eada6){console[_0xfe85('0x42')](_0x2eada6);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xa836=['type','Set','format','CDR(type)=%s','priority','VoiceExtensionId','push','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','length','toLowerCase','createdAt','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','Hangup','concat','transaction','VoiceExtension','destroy','bulkCreate','sortBy','catch','error','rewrite','models','Interval','findAll','then','intervals','IntervalId','uniq','map','filter','groupBy','exten','queue','playback','hasOwnProperty','extensions','extension','find'];(function(_0x4a1843,_0x1884bc){var _0x2dfbc4=function(_0x49686a){while(--_0x49686a){_0x4a1843['push'](_0x4a1843['shift']());}};_0x2dfbc4(++_0x1884bc);}(_0xa836,0xb2));var _0x6a83=function(_0x37979a,_0x36b16d){_0x37979a=_0x37979a-0x0;var _0x38d22f=_0xa836[_0x37979a];return _0x38d22f;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x4ade9d,_0x3d9454){var _0x4f9295=this;return _0x4ade9d[_0x6a83('0x0')][_0x6a83('0x1')][_0x6a83('0x2')]({'raw':!![]})[_0x6a83('0x3')](function(_0x5a68e6){_0x4f9295[_0x6a83('0x4')]=_0x5a68e6;return _0x4ade9d[_0x6a83('0x0')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x3d9454[_0x6a83('0x5')]},'raw':!![]});})[_0x6a83('0x3')](function(_0x1f4372){return _0x4ade9d[_0x6a83('0x0')]['VoiceExtension'][_0x6a83('0x2')]({'where':{'exten':{'$in':_[_0x6a83('0x6')](_[_0x6a83('0x7')](_0x1f4372,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x6a83('0x3')](function(_0x306e18){var _0x39b65e=_[_0x6a83('0x8')](_0x306e18,{'priority':'1'});var _0x2291e7=_[_0x6a83('0x8')](_0x306e18,{'isApp':0x1});var _0x15c4df=_[_0x6a83('0x9')](_0x2291e7,_0x6a83('0xa'));var _0x336714=[_0x6a83('0xb'),_0x6a83('0xc')];var _0x54d294=[];var _0x4fe021=[];for(var _0x5f46c3 in _0x15c4df){if(_0x15c4df[_0x6a83('0xd')](_0x5f46c3)){_0x4f9295['priority']=0x2;_0x4f9295[_0x6a83('0xe')]=[];_0x4f9295[_0x6a83('0xf')]=_[_0x6a83('0x10')](_0x39b65e,{'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')]});_0x4f9295[_0x6a83('0xe')]['push']({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':util[_0x6a83('0x13')](_0x6a83('0x14'),_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')]),'context':_0x15c4df[_0x5f46c3][0x0]['context'],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});if(_0x15c4df[_0x5f46c3][0x0]['type']==='inbound'){_0x4f9295['extensions'][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':_0x6a83('0x18')+_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')],'context':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x19')],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0]['VoiceExtensionId']});}else if(_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')]===_0x6a83('0x1a')){if(_0x4f9295[_0x6a83('0xf')]){_0x4f9295['extensions']['push']({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':_0x6a83('0x1b')+(_0x4f9295['extension'][_0x6a83('0x1c')]?'${EXTEN:'+_0x4f9295[_0x6a83('0xf')][_0x6a83('0x1c')]+'}':_0x6a83('0x1d')),'context':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x19')],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295['priority']++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});}_0x4f9295[_0x6a83('0xe')][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':_0x6a83('0x18')+_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')],'context':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x19')],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0]['VoiceExtensionId']});var _0x42cf13=_0x4f9295[_0x6a83('0x15')]++;_0x4f9295[_0x6a83('0xe')][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0]['type'],'app':_0x6a83('0x1e'),'appdata':_0x6a83('0x1f')+(_0x42cf13+0x2)+'):Goto('+(_0x42cf13+0x1)+')','context':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x19')],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x42cf13,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});if(_0x4f9295['extension']){_0x4f9295[_0x6a83('0xe')]['push']({'type':_0x15c4df[_0x5f46c3][0x0]['type'],'app':_0x6a83('0x12'),'appdata':_0x4f9295['extension']['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x4f9295[_0x6a83('0xf')][_0x6a83('0x1c')]+'}':_0x6a83('0x20'),'context':_0x15c4df[_0x5f46c3][0x0]['context'],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});}_0x4f9295[_0x6a83('0xe')]['push']({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':_0x6a83('0x21')+_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')],'context':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x19')],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295['priority']++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});if(_0x4f9295[_0x6a83('0xf')]&&_0x4f9295['extension']['hasOwnProperty']('recordingFormat')&&_0x4f9295[_0x6a83('0xf')][_0x6a83('0x22')]!==_0x6a83('0x23')){_0x4f9295[_0x6a83('0xe')][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0]['type'],'app':_0x6a83('0x12'),'appdata':_0x6a83('0x24'),'context':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x19')],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0]['VoiceExtensionId']});_0x4f9295[_0x6a83('0xe')][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':_0x6a83('0x25')+_0x4f9295['extension'][_0x6a83('0x22')]||'wav','context':_0x15c4df[_0x5f46c3][0x0]['context'],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0]['VoiceExtensionId']});}}_0x4f9295['extensions'][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x19')],'exten':_0x15c4df[_0x5f46c3][0x0]['exten'],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});_0x4f9295[_0x6a83('0xe')][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0]['type'],'app':_0x6a83('0x12'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x15c4df[_0x5f46c3][0x0]['context'],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});_0x4f9295[_0x6a83('0xe')][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x19')],'exten':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0xa')],'priority':_0x4f9295[_0x6a83('0x15')]++,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0]['VoiceExtensionId']});for(var _0x53ae95=0x0,_0x453832=0x0;_0x53ae95<_0x15c4df[_0x5f46c3][_0x6a83('0x26')];_0x53ae95+=0x1,_0x453832=0x0){var _0x46a515=_0x15c4df[_0x5f46c3][_0x53ae95];if(_0x46a515['type']){_0x46a515[_0x6a83('0x11')]=_0x46a515['type'][_0x6a83('0x27')]();}var _0x67079e=[];var _0x5e84e1=[];delete _0x46a515['id'];delete _0x46a515[_0x6a83('0x28')];delete _0x46a515[_0x6a83('0x29')];var _0x5aeba9=_0x46a515[_0x6a83('0x2a')]!=='*,*,*,*'?[_0x46a515[_0x6a83('0x2a')]]:_0x46a515[_0x6a83('0x5')]?_['map'](_[_0x6a83('0x8')](_0x4f9295[_0x6a83('0x4')],{'IntervalId':_0x46a515[_0x6a83('0x5')]}),_0x6a83('0x2a')):[];if(_0x46a515['hasOwnProperty'](_0x6a83('0x2b'))){if(_0x46a515[_0x6a83('0x2b')]&&_0x46a515[_0x6a83('0x2b')]!=='--'){_0x67079e[_0x6a83('0x17')]({'type':_0x46a515[_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':_0x6a83('0x2c')+_0x46a515[_0x6a83('0x2b')],'context':_0x46a515[_0x6a83('0x19')],'exten':_0x46a515[_0x6a83('0xa')],'priority':_0x5aeba9[_0x6a83('0x26')]+_0x4f9295[_0x6a83('0x15')]+_0x453832++,'VoiceExtensionId':_0x46a515['VoiceExtensionId']});}}if(_0x46a515['type']===_0x6a83('0x1a')&&_0x46a515['hasOwnProperty'](_0x6a83('0x2d'))){if(_0x46a515[_0x6a83('0x2d')]){_0x67079e[_0x6a83('0x17')]({'type':_0x46a515[_0x6a83('0x11')],'app':'ExecIf','appdata':_0x6a83('0x2e')+_0x46a515['callerID']+')','context':_0x46a515[_0x6a83('0x19')],'exten':_0x46a515[_0x6a83('0xa')],'priority':_0x5aeba9[_0x6a83('0x26')]+_0x4f9295[_0x6a83('0x15')]+_0x453832++,'VoiceExtensionId':_0x46a515[_0x6a83('0x16')]});}else{_0x67079e[_0x6a83('0x17')]({'type':_0x46a515['type'],'app':_0x6a83('0x1e'),'appdata':_0x6a83('0x2f'),'context':_0x46a515['context'],'exten':_0x46a515[_0x6a83('0xa')],'priority':_0x5aeba9[_0x6a83('0x26')]+_0x4f9295[_0x6a83('0x15')]+_0x453832++,'VoiceExtensionId':_0x46a515['VoiceExtensionId']});}}if(_0x46a515[_0x6a83('0xd')](_0x6a83('0x30'))){if(_0x336714[_0x6a83('0x31')](_0x46a515['app']['toLowerCase']())>=0x0&&_0x46a515['appType']!==_0x6a83('0x32')){if(_0x46a515[_0x6a83('0x30')]){_0x67079e[_0x6a83('0x17')]({'type':_0x46a515[_0x6a83('0x11')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x46a515[_0x6a83('0x19')],'exten':_0x46a515[_0x6a83('0xa')],'priority':_0x5aeba9[_0x6a83('0x26')]+_0x4f9295[_0x6a83('0x15')]+_0x453832++,'VoiceExtensionId':_0x46a515['VoiceExtensionId']});_0x67079e[_0x6a83('0x17')]({'type':_0x46a515[_0x6a83('0x11')],'app':_0x6a83('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x46a515[_0x6a83('0x19')],'exten':_0x46a515[_0x6a83('0xa')],'priority':_0x5aeba9[_0x6a83('0x26')]+_0x4f9295[_0x6a83('0x15')]+_0x453832++,'VoiceExtensionId':_0x46a515[_0x6a83('0x16')]});}else{_0x67079e[_0x6a83('0x17')]({'type':_0x46a515[_0x6a83('0x11')],'app':_0x6a83('0x1e'),'appdata':_0x6a83('0x33'),'context':_0x46a515[_0x6a83('0x19')],'exten':_0x46a515[_0x6a83('0xa')],'priority':_0x5aeba9[_0x6a83('0x26')]+_0x4f9295[_0x6a83('0x15')]+_0x453832++,'VoiceExtensionId':_0x46a515[_0x6a83('0x16')]});_0x67079e[_0x6a83('0x17')]({'type':_0x46a515['type'],'app':_0x6a83('0x12'),'appdata':_0x6a83('0x34'),'context':_0x46a515['context'],'exten':_0x46a515[_0x6a83('0xa')],'priority':_0x5aeba9['length']+_0x4f9295[_0x6a83('0x15')]+_0x453832++,'VoiceExtensionId':_0x46a515[_0x6a83('0x16')]});}}}for(var _0x306240=0x0;_0x306240<_0x5aeba9[_0x6a83('0x26')];_0x306240+=0x1){var _0x183f13=_0x4f9295[_0x6a83('0x15')]+_0x5aeba9['length'];var _0x862a35=_0x306240===_0x5aeba9[_0x6a83('0x26')]-0x1?_0x4f9295[_0x6a83('0x15')]+_0x67079e['length']+_0x5e84e1[_0x6a83('0x26')]+0x2:_0x4f9295[_0x6a83('0x15')]+_0x306240+0x1;_0x67079e[_0x6a83('0x35')](_0x306240,0x0,{'type':_0x46a515[_0x6a83('0x11')],'app':_0x6a83('0x36'),'appdata':_0x5aeba9[_0x306240]+'?'+_0x46a515[_0x6a83('0x19')]+',${EXTEN},'+_0x183f13+':'+_0x46a515[_0x6a83('0x19')]+',${EXTEN},'+_0x862a35,'exten':_0x46a515[_0x6a83('0xa')],'context':_0x46a515['context'],'priority':_0x4f9295['priority']+_0x306240,'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});}_0x46a515[_0x6a83('0x15')]=_0x67079e['length']?_['last'](_0x67079e)[_0x6a83('0x15')]+0x1:_0x4f9295[_0x6a83('0x15')];_0x4f9295[_0x6a83('0x15')]=(_0x5e84e1['length']?_['last'](_0x5e84e1)['priority']:_0x46a515['priority'])+0x1;_0x4f9295[_0x6a83('0xe')]=_['concat'](_0x4f9295[_0x6a83('0xe')],_0x67079e,[_0x46a515],_0x5e84e1);}_0x4f9295[_0x6a83('0xe')][_0x6a83('0x17')]({'type':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x11')],'app':_0x6a83('0x37'),'exten':_0x15c4df[_0x5f46c3][0x0]['exten'],'context':_0x15c4df[_0x5f46c3][0x0]['context'],'priority':_0x4f9295['priority'],'VoiceExtensionId':_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]});_0x54d294[_0x6a83('0x17')](_0x15c4df[_0x5f46c3][0x0][_0x6a83('0x16')]);_0x4fe021=_[_0x6a83('0x38')](_0x4fe021,_0x4f9295[_0x6a83('0xe')]);}}return _0x4ade9d[_0x6a83('0x39')](function(_0x43bbdb){return _0x4ade9d['models'][_0x6a83('0x3a')][_0x6a83('0x3b')]({'where':{'VoiceExtensionId':{'$in':_0x54d294}},'transaction':_0x43bbdb})['then'](function(_0x534af6){return _0x4ade9d['models']['VoiceExtension'][_0x6a83('0x3c')](_[_0x6a83('0x3d')](_0x4fe021,_0x6a83('0x15')),{'transaction':_0x43bbdb});});});})[_0x6a83('0x3e')](function(_0x5fec5b){console[_0x6a83('0x3f')](_0x5fec5b);});}exports[_0x6a83('0x40')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index f423518..17ebcdd 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 _0xbce4=['length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','create','then','push','pick','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','always','sequelize','query','catch','VoiceQueueId','all','BlackLists','Lists','get','CampaignId','onlyIfOpen','Campaign','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors'];(function(_0x206053,_0x422374){var _0x39e8db=function(_0x4d3d4c){while(--_0x4d3d4c){_0x206053['push'](_0x206053['shift']());}};_0x39e8db(++_0x422374);}(_0xbce4,0xc8));var _0x4bce=function(_0x508d4c,_0x20831a){_0x508d4c=_0x508d4c-0x0;var _0x99a884=_0xbce4[_0x508d4c];return _0x99a884;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x4bce('0x0'));var fs=require('fs');var squel=require(_0x4bce('0x1'));var Papa=require('papaparse');var Redis=require(_0x4bce('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0x4bce('0x3'));var logger=require(_0x4bce('0x4'))(_0x4bce('0x5'));config[_0x4bce('0x6')]=_['defaults'](config['redis'],{'host':_0x4bce('0x7'),'port':0x18eb});var socket=require(_0x4bce('0x8'))(new Redis(config[_0x4bce('0x6')]));require(_0x4bce('0x9'))[_0x4bce('0xa')](socket);try{if(!process[_0x4bce('0xb')][0x2]||process['argv'][0x2]==='undefined'||process[_0x4bce('0xb')][0x2]===_0x4bce('0xc')){throw new Error(_0x4bce('0xd'));}var FILEPATH=process[_0x4bce('0xb')][0x2];if(!process['argv'][0x3]||process[_0x4bce('0xb')][0x3]===_0x4bce('0xe')||process[_0x4bce('0xb')][0x3]===_0x4bce('0xc')||!process[_0x4bce('0xb')][0x4]||process[_0x4bce('0xb')][0x4]==='undefined'||process[_0x4bce('0xb')][0x4]===_0x4bce('0xc')){throw new Error(_0x4bce('0xf'));}var FIELDS=_[_0x4bce('0x10')](process['argv'][0x3][_0x4bce('0x11')](','),process[_0x4bce('0xb')][0x4][_0x4bce('0x11')](','));if(!process[_0x4bce('0xb')][0x5]||process[_0x4bce('0xb')][0x5]==='undefined'||process[_0x4bce('0xb')][0x5]===_0x4bce('0xc')){throw new Error(_0x4bce('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x4bce('0xb')][0x6]!==_0x4bce('0xe')&&process[_0x4bce('0xb')][0x6]!==_0x4bce('0xc')?process[_0x4bce('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x4bce('0xb')][0x7]!==_0x4bce('0xe')&&process[_0x4bce('0xb')][0x7]!==_0x4bce('0xc')?process[_0x4bce('0xb')][0x7]:null;if(!process[_0x4bce('0xb')][0x8]||process[_0x4bce('0xb')][0x8]===_0x4bce('0xe')||process[_0x4bce('0xb')][0x8]==='null'){throw new Error(_0x4bce('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x524220){logger[_0x4bce('0x14')](_0x524220);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(_0x50f8d3,_0x2ebc81,_0x2482a9,_0x45e169){var _0xdca8cb={'message':_0x2ebc81};_0xdca8cb[_0x50f8d3]=!![];if(_0x2482a9){_0xdca8cb[_0x4bce('0x15')]=_0x2482a9;}if(_0x45e169){_0xdca8cb['index']=_0x45e169;}return _0xdca8cb;}function isEmail(_0x20758b){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x20758b);}function checkRow(_0x4bfdec,_0x22b22b,_0x3adbdd){return new BPromise(function(_0x301098,_0x465097){if(_['isNil'](_0x4bfdec)){return _0x465097(handleCheckRowError(_0x4bce('0x14'),_0x4bce('0x16'),null,_0x3adbdd));}if(_0x4bfdec[_0x4bce('0x17')]&&_0x4bfdec[_0x4bce('0x17')][_0x4bce('0x18')]){var _0x3abe70=_[_0x4bce('0x19')](_0x4bfdec[_0x4bce('0x17')],_0x4bce('0x1a'))[_0x4bce('0x1b')](';');return _0x465097(handleCheckRowError(_0x4bce('0x14'),_0x3abe70,null,_0x3adbdd));}var _0x3efff6={};for(var _0x30c3a1 in FIELDS){if(FIELDS[_0x4bce('0x1c')](_0x30c3a1)&&FIELDS[_0x30c3a1]){_0x3efff6[_0x30c3a1]=_0x4bfdec[_0x4bce('0x1d')][0x0][FIELDS[_0x30c3a1]]||_0x4bfdec[_0x4bce('0x1d')][0x0]['\ufeff'+FIELDS[_0x30c3a1]];}}if(!_0x3efff6[_0x4bce('0x1e')]){return _0x465097(handleCheckRowError(_0x4bce('0x14'),_0x4bce('0x1f'),null,_0x3adbdd));}if(!_0x3efff6['phone']){return _0x465097(handleCheckRowError(_0x4bce('0x14'),'phone\x20not\x20specified!',null,_0x3adbdd));}if(_0x3efff6[_0x4bce('0x20')]){var _0x1455b3=moment(_0x3efff6['birthDate'],_0x4bce('0x21'));if(!_0x1455b3[_0x4bce('0x22')]()){return _0x465097(handleCheckRowError(_0x4bce('0x14'),_0x4bce('0x23'),null,_0x3adbdd));}}if(_0x3efff6['email']){if(!isEmail(_0x3efff6[_0x4bce('0x24')])){return _0x465097(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x3adbdd));}}_0x3efff6[_0x4bce('0x25')]=LISTID;_0x3efff6[_0x4bce('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4bce('0x18')]&&_0x22b22b){var _0x5921a2={};for(var _0x3c9069=0x0,_0x68768b=DUPLICATES[_0x4bce('0x18')];_0x3c9069<_0x68768b;_0x3c9069+=0x1){_0x5921a2[DUPLICATES[_0x3c9069]]=_0x3efff6[DUPLICATES[_0x3c9069]];}var _0x5d3241=_[_0x4bce('0x27')](_0x22b22b,_0x5921a2);if(_0x5d3241){return _0x465097(handleCheckRowError(_0x4bce('0x28'),'Duplicate\x20Contact',_0x5d3241,_0x3adbdd));}}return db['CmContact'][_0x4bce('0x29')](_0x3efff6,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3efff6)})[_0x4bce('0x2a')](function(_0x2e46a2){if(DUPLICATES&&DUPLICATES[_0x4bce('0x18')]&&_0x22b22b){_0x22b22b[_0x4bce('0x2b')](_[_0x4bce('0x2c')](_0x3efff6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2e46a2['id'];return _0x301098();})['catch'](function(_0x2aa29d){return _0x465097(handleCheckRowError(_0x4bce('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x2aa29d[_0x4bce('0x1a')]||JSON[_0x4bce('0x2d')](_0x2aa29d)),null,_0x3adbdd));});});}function checkHopper(){function _0x5b309a(){return function(_0xfd4569){logger[_0x4bce('0x14')](_0x4bce('0x2e'),_0x4bce('0x2f'),util[_0x4bce('0x30')](_0xfd4569,{'showHidden':![],'depth':null}));};}var _0x3bb93b=function(_0x94e880,_0x53d670){var _0x59c4b4=squel[_0x4bce('0x31')]()[_0x4bce('0x32')](_0x4bce('0x33'))[_0x4bce('0x34')]([_0x4bce('0x35'),'scheduledAt',_0x4bce('0x36'),_0x4bce('0x25'),_0x53d670,_0x4bce('0x37'),_0x4bce('0x38')],squel[_0x4bce('0x39')]()['field']('phone',_0x4bce('0x35'))[_0x4bce('0x3a')](_0x4bce('0x3b'),_0x4bce('0x3c'))[_0x4bce('0x3a')]('id','ContactId')['field'](LISTID[_0x4bce('0x3d')](),_0x4bce('0x25'))[_0x4bce('0x3a')](_0x94e880['id'][_0x4bce('0x3d')](),_0x53d670)['field'](_0x4bce('0x3b'),_0x4bce('0x37'))[_0x4bce('0x3a')]('NOW()',_0x4bce('0x38'))[_0x4bce('0x3e')](_0x4bce('0x3f'))[_0x4bce('0x40')](_0x4bce('0x41'))[_0x4bce('0x40')](_0x4bce('0x42'),LISTID[_0x4bce('0x3d')]())[_0x4bce('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x4bce('0x40')](_0x4bce('0x43'),squel[_0x4bce('0x39')]()[_0x4bce('0x3a')](_0x4bce('0x35'))[_0x4bce('0x3e')]('cm_hopper')[_0x4bce('0x40')](_0x53d670+_0x4bce('0x44'),_0x94e880['id']['toString']())))[_0x4bce('0x3d')]();return _0x59c4b4;};var _0x437f58=function(_0x175171,_0x47dc10){var _0x1bab3f=squel['insert']()[_0x4bce('0x32')]('cm_hopper')[_0x4bce('0x34')]([_0x4bce('0x35'),_0x4bce('0x3c'),'ContactId',_0x4bce('0x25'),_0x47dc10,_0x4bce('0x37'),'updatedAt'],squel[_0x4bce('0x39')]()[_0x4bce('0x3a')]('phone',_0x4bce('0x35'))[_0x4bce('0x3a')](_0x4bce('0x3b'),_0x4bce('0x3c'))[_0x4bce('0x3a')]('id',_0x4bce('0x36'))[_0x4bce('0x3a')](LISTID[_0x4bce('0x3d')](),'ListId')[_0x4bce('0x3a')](_0x175171['id']['toString'](),_0x47dc10)['field']('NOW()',_0x4bce('0x37'))['field'](_0x4bce('0x3b'),_0x4bce('0x38'))[_0x4bce('0x3e')]('cm_contacts')[_0x4bce('0x40')](_0x4bce('0x41'))[_0x4bce('0x40')](_0x4bce('0x42'),LISTID[_0x4bce('0x3d')]())['where'](_0x4bce('0x45'),squel[_0x4bce('0x46')](hopperContacts))[_0x4bce('0x40')](_0x4bce('0x47'))[_0x4bce('0x40')](_0x4bce('0x43'),squel[_0x4bce('0x39')]()[_0x4bce('0x3a')](_0x4bce('0x48'))[_0x4bce('0x3e')](_0x4bce('0x49'))[_0x4bce('0x40')](_0x47dc10+_0x4bce('0x44'),_0x175171['id'][_0x4bce('0x3d')]()))['where'](_0x4bce('0x43'),squel[_0x4bce('0x39')]()[_0x4bce('0x3a')]('phone')[_0x4bce('0x3e')](_0x4bce('0x33'))[_0x4bce('0x40')](_0x47dc10+_0x4bce('0x44'),_0x175171['id'][_0x4bce('0x3d')]())))[_0x4bce('0x3d')]();return _0x1bab3f;};function _0x565e07(_0x540306,_0x1d5454){var _0x52a5fb=squel[_0x4bce('0x31')]()[_0x4bce('0x32')]('cm_hopper')[_0x4bce('0x34')]([_0x4bce('0x35'),'scheduledAt',_0x4bce('0x36'),_0x4bce('0x25'),_0x1d5454,'createdAt',_0x4bce('0x38')],squel['select']()[_0x4bce('0x3a')](_0x4bce('0x35'),_0x4bce('0x35'))[_0x4bce('0x3a')]('NOW()',_0x4bce('0x3c'))[_0x4bce('0x3a')]('id','ContactId')[_0x4bce('0x3a')](LISTID[_0x4bce('0x3d')](),_0x4bce('0x25'))[_0x4bce('0x3a')](_0x540306['id'][_0x4bce('0x3d')](),_0x1d5454)[_0x4bce('0x3a')]('NOW()',_0x4bce('0x37'))[_0x4bce('0x3a')](_0x4bce('0x3b'),_0x4bce('0x38'))[_0x4bce('0x3e')](_0x4bce('0x3f'))[_0x4bce('0x40')]('deletedAt\x20IS\x20NULL')[_0x4bce('0x40')](_0x4bce('0x42'),LISTID['toString']())['where'](_0x4bce('0x45'),squel['str'](hopperContacts))[_0x4bce('0x40')](_0x4bce('0x47')))[_0x4bce('0x3d')]();return _0x52a5fb;}function _0x557dee(_0x3ee192,_0x1eaf49){var _0x867733=squel['insert']()[_0x4bce('0x32')](_0x4bce('0x4a'))[_0x4bce('0x34')]([_0x4bce('0x35'),_0x4bce('0x36'),'ListId',_0x1eaf49,'createdAt',_0x4bce('0x38')],squel[_0x4bce('0x39')]()[_0x4bce('0x3a')](_0x4bce('0x35'),_0x4bce('0x35'))['field']('id',_0x4bce('0x36'))['field'](LISTID[_0x4bce('0x3d')](),_0x4bce('0x25'))[_0x4bce('0x3a')](_0x3ee192['id'][_0x4bce('0x3d')](),_0x1eaf49)[_0x4bce('0x3a')](_0x4bce('0x3b'),_0x4bce('0x37'))[_0x4bce('0x3a')]('NOW()',_0x4bce('0x38'))[_0x4bce('0x3e')](_0x4bce('0x3f'))['where'](_0x4bce('0x41'))['where']('ListId\x20=\x20?',LISTID[_0x4bce('0x3d')]())['where'](_0x4bce('0x45'),squel[_0x4bce('0x46')](hopperContacts))[_0x4bce('0x40')](_0x4bce('0x47')))[_0x4bce('0x3d')]();return _0x867733;}return db[_0x4bce('0x4b')][_0x4bce('0x4c')]({'where':{'type':_0x4bce('0x4d')},'attributes':['id',_0x4bce('0x4e')],'include':[{'model':db[_0x4bce('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0x4bce('0x2a')](function(_0xeea0d9){var _0x27cd73=[];if(_0xeea0d9){var _0x4c8a50;for(var _0x54f462=0x0,_0x5ee777;_0x54f462<_0xeea0d9[_0x4bce('0x18')];_0x54f462+=0x1){_0x5ee777=_0xeea0d9[_0x54f462]['get']({'plain':!![]});switch(_0x5ee777[_0x4bce('0x4e')]){case _0x4bce('0x50'):_0x27cd73[_0x4bce('0x2b')](db[_0x4bce('0x51')][_0x4bce('0x52')](_0x437f58(_0x5ee777,'VoiceQueueId'))[_0x4bce('0x2a')](function(){})[_0x4bce('0x53')](_0x5b309a()));break;case'onlyIfOpen':_0x27cd73[_0x4bce('0x2b')](db[_0x4bce('0x51')][_0x4bce('0x52')](_0x3bb93b(_0x5ee777,'VoiceQueueId'))[_0x4bce('0x2a')](function(){})[_0x4bce('0x53')](_0x5b309a()));break;default:_0x27cd73['push'](db['sequelize']['query'](_0x565e07(_0x5ee777,_0x4bce('0x54')))[_0x4bce('0x2a')](function(){})[_0x4bce('0x53')](_0x5b309a()));}}}return _0x27cd73;})[_0x4bce('0x55')]()[_0x4bce('0x2a')](function(){return db[_0x4bce('0x4b')][_0x4bce('0x4c')]({'where':{'type':_0x4bce('0x4d')},'attributes':['id'],'include':[{'model':db[_0x4bce('0x4f')],'as':_0x4bce('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x1267ca){var _0x253446=[];if(_0x1267ca){var _0x553c10;for(var _0x2984cf=0x0,_0x3f9fb6;_0x2984cf<_0x1267ca[_0x4bce('0x18')];_0x2984cf+=0x1){_0x3f9fb6=_0x1267ca[_0x2984cf]['get']({'plain':!![]});_0x253446['push'](db[_0x4bce('0x51')][_0x4bce('0x52')](_0x557dee(_0x3f9fb6,_0x4bce('0x54')))[_0x4bce('0x2a')](function(){})[_0x4bce('0x53')](_0x5b309a()));}}return _0x253446;})[_0x4bce('0x55')]();})[_0x4bce('0x2a')](function(){return db['Campaign'][_0x4bce('0x4c')]({'attributes':['id',_0x4bce('0x4e')],'include':[{'model':db[_0x4bce('0x4f')],'as':_0x4bce('0x57'),'where':{'id':LISTID}}]})[_0x4bce('0x2a')](function(_0x427c3b){var _0x4e212e=[];if(_0x427c3b){for(var _0x1ac09e=0x0,_0x4b0f96;_0x1ac09e<_0x427c3b[_0x4bce('0x18')];_0x1ac09e+=0x1){_0x4b0f96=_0x427c3b[_0x1ac09e][_0x4bce('0x58')]({'plain':!![]});switch(_0x4b0f96['dialCheckDuplicateType']){case'always':_0x4e212e[_0x4bce('0x2b')](db[_0x4bce('0x51')][_0x4bce('0x52')](_0x437f58(_0x4b0f96,_0x4bce('0x59')))[_0x4bce('0x2a')](function(){})[_0x4bce('0x53')](_0x5b309a()));break;case _0x4bce('0x5a'):_0x4e212e[_0x4bce('0x2b')](db[_0x4bce('0x51')][_0x4bce('0x52')](_0x3bb93b(_0x4b0f96,'CampaignId'))[_0x4bce('0x2a')](function(){})['catch'](_0x5b309a()));break;default:_0x4e212e[_0x4bce('0x2b')](db[_0x4bce('0x51')][_0x4bce('0x52')](_0x565e07(_0x4b0f96,'CampaignId'))[_0x4bce('0x2a')](function(){})[_0x4bce('0x53')](_0x5b309a()));}}}return _0x4e212e;})[_0x4bce('0x55')]();})[_0x4bce('0x2a')](function(){return db[_0x4bce('0x5b')][_0x4bce('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x4bce('0x56'),'where':{'id':LISTID}}]})[_0x4bce('0x2a')](function(_0x4fa581){var _0x2e02b3=[];if(_0x4fa581){for(var _0x328522=0x0,_0x38ab6f;_0x328522<_0x4fa581[_0x4bce('0x18')];_0x328522+=0x1){_0x38ab6f=_0x4fa581[_0x328522]['get']({'plain':!![]});_0x2e02b3[_0x4bce('0x2b')](db[_0x4bce('0x51')][_0x4bce('0x52')](_0x557dee(_0x38ab6f,'CampaignId'))[_0x4bce('0x2a')](function(){})['catch'](_0x5b309a()));}}return _0x2e02b3;})[_0x4bce('0x55')]();})['catch'](function(_0x3735b5){logger[_0x4bce('0x14')]('cmContact,\x20%s,\x20%s',_0x4bce('0x5c'),_0x3735b5[_0x4bce('0x1a')]);});}var processPromises=function(_0x4e0450){return BPromise[_0x4bce('0x55')](promises)[_0x4bce('0x2a')](function(_0x333738){})['catch'](function(_0x42164d){logger[_0x4bce('0x14')](_0x4bce('0x5d'),JSON[_0x4bce('0x2d')](_0x42164d));})[_0x4bce('0x5e')](function(){socket[_0x4bce('0x5f')](_0x4bce('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4e0450){return _0x4e0450[_0x4bce('0x61')]();}});};var endCsv=function(){return BPromise[_0x4bce('0x62')]()[_0x4bce('0x2a')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x4bce('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4bce('0x63')](FILEPATH);}catch(_0x4e40c9){logger[_0x4bce('0x14')](_0x4bce('0x64'),JSON[_0x4bce('0x2d')](_0x4e40c9));}finally{process[_0x4bce('0x65')](0x0);}});};process['on'](_0x4bce('0x66'),function(){logger[_0x4bce('0x67')](_0x4bce('0x68'));endCsv();});function main(){return BPromise['resolve']()[_0x4bce('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x4bce('0x69')][_0x4bce('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x633310){var _0x259116=fs[_0x4bce('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4bce('0x6b')](_0x259116,{'header':!![],'skipEmptyLines':!![],'step':function(_0x419100,_0x435414){total+=0x1;var _0x151a7f=total;promises[_0x4bce('0x2b')](checkRow(_0x419100,_0x633310,_0x151a7f)[_0x4bce('0x2a')](function(){success+=0x1;})['catch'](function(_0x1fade2){if(_0x1fade2['error']){errors+=0x1;delete _0x1fade2[_0x4bce('0x14')];}else if(_0x1fade2[_0x4bce('0x28')]){duplicates+=0x1;delete _0x1fade2[_0x4bce('0x28')];}rows[_0x4bce('0x2b')](_0x1fade2);}));if(total%0xc8===0x0){_0x435414[_0x4bce('0x6c')]();return processPromises(_0x435414);}},'complete':function(){return processPromises()[_0x4bce('0x2a')](function(){logger['info'](_0x4bce('0x6d'));endCsv();});},'error':function(_0x88872a,_0x23cf98){logger[_0x4bce('0x67')](_0x4bce('0x6e'),JSON[_0x4bce('0x2d')](_0x88872a));endCsv();}});})[_0x4bce('0x53')](function(_0x2066e8){logger[_0x4bce('0x14')](_0x4bce('0x6f'),JSON['stringify'](_0x2066e8));});}main(); \ No newline at end of file +var _0xa6a8=['CmContact','create','keys','then','push','message','stringify','inspect','insert','into','cm_hopper','fromQuery','ContactId','updatedAt','select','field','phone','NOW()','scheduledAt','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','ListId\x20=\x20?','findAll','CmList','get','dialCheckDuplicateType','always','sequelize','query','catch','onlyIfOpen','VoiceQueueId','all','VoiceQueue','outbound','BlackLists','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','util','squel','papaparse','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','duplicate','Duplicate\x20Contact'];(function(_0x43115b,_0x4e3e01){var _0x43742b=function(_0x23d574){while(--_0x23d574){_0x43115b['push'](_0x43115b['shift']());}};_0x43742b(++_0x4e3e01);}(_0xa6a8,0x16d));var _0x8a6a=function(_0xb7598f,_0x58b17e){_0xb7598f=_0xb7598f-0x0;var _0xaf5b40=_0xa6a8[_0xb7598f];return _0xaf5b40;};'use strict';var BPromise=require('bluebird');var util=require(_0x8a6a('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0x8a6a('0x1'));var Papa=require(_0x8a6a('0x2'));var Redis=require('ioredis');var db=require(_0x8a6a('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x8a6a('0x4'))('api');config[_0x8a6a('0x5')]=_[_0x8a6a('0x6')](config[_0x8a6a('0x5')],{'host':_0x8a6a('0x7'),'port':0x18eb});var socket=require(_0x8a6a('0x8'))(new Redis(config[_0x8a6a('0x5')]));require(_0x8a6a('0x9'))[_0x8a6a('0xa')](socket);try{if(!process[_0x8a6a('0xb')][0x2]||process[_0x8a6a('0xb')][0x2]==='undefined'||process[_0x8a6a('0xb')][0x2]===_0x8a6a('0xc')){throw new Error(_0x8a6a('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x8a6a('0xb')][0x3]||process[_0x8a6a('0xb')][0x3]===_0x8a6a('0xe')||process[_0x8a6a('0xb')][0x3]===_0x8a6a('0xc')||!process[_0x8a6a('0xb')][0x4]||process['argv'][0x4]==='undefined'||process[_0x8a6a('0xb')][0x4]==='null'){throw new Error(_0x8a6a('0xf'));}var FIELDS=_[_0x8a6a('0x10')](process[_0x8a6a('0xb')][0x3][_0x8a6a('0x11')](','),process[_0x8a6a('0xb')][0x4][_0x8a6a('0x11')](','));if(!process[_0x8a6a('0xb')][0x5]||process[_0x8a6a('0xb')][0x5]===_0x8a6a('0xe')||process['argv'][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x8a6a('0xb')][0x5];var COMPANYID=process[_0x8a6a('0xb')][0x6]&&process['argv'][0x6]!==_0x8a6a('0xe')&&process['argv'][0x6]!==_0x8a6a('0xc')?process[_0x8a6a('0xb')][0x6]:null;var DUPLICATES=process[_0x8a6a('0xb')][0x7]&&process[_0x8a6a('0xb')][0x7]!==_0x8a6a('0xe')&&process['argv'][0x7]!==_0x8a6a('0xc')?process[_0x8a6a('0xb')][0x7]:null;if(!process[_0x8a6a('0xb')][0x8]||process[_0x8a6a('0xb')][0x8]===_0x8a6a('0xe')||process[_0x8a6a('0xb')][0x8]===_0x8a6a('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xaca2c9){logger['error'](_0xaca2c9);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(_0x2aab14,_0x2d13ca,_0x153a2d,_0x41b333){var _0x1db5e3={'message':_0x2d13ca};_0x1db5e3[_0x2aab14]=!![];if(_0x153a2d){_0x1db5e3['contact']=_0x153a2d;}if(_0x41b333){_0x1db5e3[_0x8a6a('0x12')]=_0x41b333;}return _0x1db5e3;}function isEmail(_0x36de40){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))*$/[_0x8a6a('0x13')](_0x36de40);}function checkRow(_0x13ed24,_0x1d5709,_0x59a68f){return new BPromise(function(_0x2f627b,_0x3c702a){if(_[_0x8a6a('0x14')](_0x13ed24)){return _0x3c702a(handleCheckRowError(_0x8a6a('0x15'),_0x8a6a('0x16'),null,_0x59a68f));}if(_0x13ed24[_0x8a6a('0x17')]&&_0x13ed24[_0x8a6a('0x17')][_0x8a6a('0x18')]){var _0x5497c2=_[_0x8a6a('0x19')](_0x13ed24[_0x8a6a('0x17')],'message')[_0x8a6a('0x1a')](';');return _0x3c702a(handleCheckRowError('error',_0x5497c2,null,_0x59a68f));}var _0x272309={};for(var _0x14bb07 in FIELDS){if(FIELDS[_0x8a6a('0x1b')](_0x14bb07)&&FIELDS[_0x14bb07]){_0x272309[_0x14bb07]=_0x13ed24['data'][0x0][FIELDS[_0x14bb07]]||_0x13ed24[_0x8a6a('0x1c')][0x0]['\ufeff'+FIELDS[_0x14bb07]];}}if(!_0x272309[_0x8a6a('0x1d')]){return _0x3c702a(handleCheckRowError(_0x8a6a('0x15'),_0x8a6a('0x1e'),null,_0x59a68f));}if(!_0x272309['phone']){return _0x3c702a(handleCheckRowError(_0x8a6a('0x15'),_0x8a6a('0x1f'),null,_0x59a68f));}if(_0x272309[_0x8a6a('0x20')]){var _0x49f641=moment(_0x272309[_0x8a6a('0x20')],'YYYY-MM-DD');if(!_0x49f641[_0x8a6a('0x21')]()){return _0x3c702a(handleCheckRowError(_0x8a6a('0x15'),_0x8a6a('0x22'),null,_0x59a68f));}}if(_0x272309[_0x8a6a('0x23')]){if(!isEmail(_0x272309['email'])){return _0x3c702a(handleCheckRowError(_0x8a6a('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x59a68f));}}_0x272309[_0x8a6a('0x24')]=LISTID;_0x272309['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8a6a('0x18')]&&_0x1d5709){var _0x587daf={};for(var _0x3374c3=0x0,_0x18484e=DUPLICATES['length'];_0x3374c3<_0x18484e;_0x3374c3+=0x1){_0x587daf[DUPLICATES[_0x3374c3]]=_0x272309[DUPLICATES[_0x3374c3]];}var _0x5f522c=_['find'](_0x1d5709,_0x587daf);if(_0x5f522c){return _0x3c702a(handleCheckRowError(_0x8a6a('0x25'),_0x8a6a('0x26'),_0x5f522c,_0x59a68f));}}return db[_0x8a6a('0x27')][_0x8a6a('0x28')](_0x272309,{'raw':!![],'hooks':![],'fields':_[_0x8a6a('0x29')](_0x272309)})[_0x8a6a('0x2a')](function(_0x2197bb){if(DUPLICATES&&DUPLICATES[_0x8a6a('0x18')]&&_0x1d5709){_0x1d5709[_0x8a6a('0x2b')](_['pick'](_0x272309,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2197bb['id'];return _0x2f627b();})['catch'](function(_0x592687){return _0x3c702a(handleCheckRowError(_0x8a6a('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x592687[_0x8a6a('0x2c')]||JSON[_0x8a6a('0x2d')](_0x592687)),null,_0x59a68f));});});}function checkHopper(){function _0x53d7bd(){return function(_0x50ecde){logger[_0x8a6a('0x15')]('cmContact','checkHopper',util[_0x8a6a('0x2e')](_0x50ecde,{'showHidden':![],'depth':null}));};}var _0x310ac9=function(_0xd0874e,_0x5a0614){var _0x66fbb1=squel[_0x8a6a('0x2f')]()[_0x8a6a('0x30')](_0x8a6a('0x31'))[_0x8a6a('0x32')](['phone','scheduledAt',_0x8a6a('0x33'),_0x8a6a('0x24'),_0x5a0614,'createdAt',_0x8a6a('0x34')],squel[_0x8a6a('0x35')]()[_0x8a6a('0x36')](_0x8a6a('0x37'),_0x8a6a('0x37'))[_0x8a6a('0x36')](_0x8a6a('0x38'),_0x8a6a('0x39'))[_0x8a6a('0x36')]('id','ContactId')[_0x8a6a('0x36')](LISTID[_0x8a6a('0x3a')](),_0x8a6a('0x24'))[_0x8a6a('0x36')](_0xd0874e['id']['toString'](),_0x5a0614)[_0x8a6a('0x36')](_0x8a6a('0x38'),_0x8a6a('0x3b'))[_0x8a6a('0x36')]('NOW()',_0x8a6a('0x34'))[_0x8a6a('0x3c')](_0x8a6a('0x3d'))[_0x8a6a('0x3e')](_0x8a6a('0x3f'))[_0x8a6a('0x3e')]('ListId\x20=\x20?',LISTID[_0x8a6a('0x3a')]())[_0x8a6a('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x8a6a('0x3e')](_0x8a6a('0x40'),squel[_0x8a6a('0x35')]()[_0x8a6a('0x36')](_0x8a6a('0x37'))[_0x8a6a('0x3c')](_0x8a6a('0x31'))[_0x8a6a('0x3e')](_0x5a0614+_0x8a6a('0x41'),_0xd0874e['id'][_0x8a6a('0x3a')]())))[_0x8a6a('0x3a')]();return _0x66fbb1;};var _0x5e9cec=function(_0x29dc8f,_0x5f29d6){var _0x21f6fa=squel[_0x8a6a('0x2f')]()['into'](_0x8a6a('0x31'))[_0x8a6a('0x32')]([_0x8a6a('0x37'),_0x8a6a('0x39'),_0x8a6a('0x33'),_0x8a6a('0x24'),_0x5f29d6,_0x8a6a('0x3b'),'updatedAt'],squel['select']()['field'](_0x8a6a('0x37'),'phone')[_0x8a6a('0x36')](_0x8a6a('0x38'),_0x8a6a('0x39'))[_0x8a6a('0x36')]('id',_0x8a6a('0x33'))[_0x8a6a('0x36')](LISTID[_0x8a6a('0x3a')](),'ListId')['field'](_0x29dc8f['id'][_0x8a6a('0x3a')](),_0x5f29d6)['field'](_0x8a6a('0x38'),_0x8a6a('0x3b'))[_0x8a6a('0x36')](_0x8a6a('0x38'),_0x8a6a('0x34'))[_0x8a6a('0x3c')](_0x8a6a('0x3d'))[_0x8a6a('0x3e')](_0x8a6a('0x3f'))[_0x8a6a('0x3e')]('ListId\x20=\x20?',LISTID[_0x8a6a('0x3a')]())[_0x8a6a('0x3e')](_0x8a6a('0x42'),squel[_0x8a6a('0x43')](hopperContacts))[_0x8a6a('0x3e')](_0x8a6a('0x44'))['where'](_0x8a6a('0x40'),squel['select']()[_0x8a6a('0x36')](_0x8a6a('0x45'))[_0x8a6a('0x3c')](_0x8a6a('0x46'))[_0x8a6a('0x3e')](_0x5f29d6+_0x8a6a('0x41'),_0x29dc8f['id']['toString']()))[_0x8a6a('0x3e')](_0x8a6a('0x40'),squel[_0x8a6a('0x35')]()[_0x8a6a('0x36')]('phone')[_0x8a6a('0x3c')](_0x8a6a('0x31'))[_0x8a6a('0x3e')](_0x5f29d6+_0x8a6a('0x41'),_0x29dc8f['id']['toString']())))[_0x8a6a('0x3a')]();return _0x21f6fa;};function _0xce2160(_0x25a8cb,_0x584656){var _0x16ddae=squel[_0x8a6a('0x2f')]()['into'](_0x8a6a('0x31'))[_0x8a6a('0x32')]([_0x8a6a('0x37'),_0x8a6a('0x39'),_0x8a6a('0x33'),_0x8a6a('0x24'),_0x584656,_0x8a6a('0x3b'),_0x8a6a('0x34')],squel[_0x8a6a('0x35')]()[_0x8a6a('0x36')](_0x8a6a('0x37'),_0x8a6a('0x37'))[_0x8a6a('0x36')](_0x8a6a('0x38'),_0x8a6a('0x39'))[_0x8a6a('0x36')]('id',_0x8a6a('0x33'))['field'](LISTID[_0x8a6a('0x3a')](),_0x8a6a('0x24'))['field'](_0x25a8cb['id'][_0x8a6a('0x3a')](),_0x584656)[_0x8a6a('0x36')](_0x8a6a('0x38'),'createdAt')[_0x8a6a('0x36')](_0x8a6a('0x38'),_0x8a6a('0x34'))[_0x8a6a('0x3c')](_0x8a6a('0x3d'))[_0x8a6a('0x3e')](_0x8a6a('0x3f'))[_0x8a6a('0x3e')](_0x8a6a('0x47'),LISTID['toString']())[_0x8a6a('0x3e')](_0x8a6a('0x42'),squel[_0x8a6a('0x43')](hopperContacts))[_0x8a6a('0x3e')](_0x8a6a('0x44')))[_0x8a6a('0x3a')]();return _0x16ddae;}function _0x382e63(_0x135ef1,_0x4cd7cc){var _0x4efc7e=squel[_0x8a6a('0x2f')]()[_0x8a6a('0x30')]('cm_hopper_black')[_0x8a6a('0x32')]([_0x8a6a('0x37'),_0x8a6a('0x33'),_0x8a6a('0x24'),_0x4cd7cc,'createdAt',_0x8a6a('0x34')],squel[_0x8a6a('0x35')]()['field'](_0x8a6a('0x37'),_0x8a6a('0x37'))['field']('id',_0x8a6a('0x33'))['field'](LISTID[_0x8a6a('0x3a')](),_0x8a6a('0x24'))[_0x8a6a('0x36')](_0x135ef1['id'][_0x8a6a('0x3a')](),_0x4cd7cc)[_0x8a6a('0x36')]('NOW()','createdAt')[_0x8a6a('0x36')]('NOW()','updatedAt')[_0x8a6a('0x3c')](_0x8a6a('0x3d'))[_0x8a6a('0x3e')]('deletedAt\x20IS\x20NULL')[_0x8a6a('0x3e')]('ListId\x20=\x20?',LISTID[_0x8a6a('0x3a')]())[_0x8a6a('0x3e')]('id\x20IN\x20?',squel[_0x8a6a('0x43')](hopperContacts))['where'](_0x8a6a('0x44')))[_0x8a6a('0x3a')]();return _0x4efc7e;}return db['VoiceQueue'][_0x8a6a('0x48')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x8a6a('0x49')],'as':'Lists','where':{'id':LISTID}}]})[_0x8a6a('0x2a')](function(_0x74bfa9){var _0x19ef06=[];if(_0x74bfa9){var _0x75031f;for(var _0x275c3c=0x0,_0x11579e;_0x275c3c<_0x74bfa9['length'];_0x275c3c+=0x1){_0x11579e=_0x74bfa9[_0x275c3c][_0x8a6a('0x4a')]({'plain':!![]});switch(_0x11579e[_0x8a6a('0x4b')]){case _0x8a6a('0x4c'):_0x19ef06['push'](db[_0x8a6a('0x4d')][_0x8a6a('0x4e')](_0x5e9cec(_0x11579e,'VoiceQueueId'))['then'](function(){})[_0x8a6a('0x4f')](_0x53d7bd()));break;case _0x8a6a('0x50'):_0x19ef06[_0x8a6a('0x2b')](db[_0x8a6a('0x4d')][_0x8a6a('0x4e')](_0x310ac9(_0x11579e,_0x8a6a('0x51')))[_0x8a6a('0x2a')](function(){})['catch'](_0x53d7bd()));break;default:_0x19ef06[_0x8a6a('0x2b')](db[_0x8a6a('0x4d')]['query'](_0xce2160(_0x11579e,'VoiceQueueId'))[_0x8a6a('0x2a')](function(){})[_0x8a6a('0x4f')](_0x53d7bd()));}}}return _0x19ef06;})[_0x8a6a('0x52')]()['then'](function(){return db[_0x8a6a('0x53')]['findAll']({'where':{'type':_0x8a6a('0x54')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x8a6a('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x2e5059){var _0x10baeb=[];if(_0x2e5059){var _0x286b8c;for(var _0x3c7fb5=0x0,_0xb2e419;_0x3c7fb5<_0x2e5059[_0x8a6a('0x18')];_0x3c7fb5+=0x1){_0xb2e419=_0x2e5059[_0x3c7fb5][_0x8a6a('0x4a')]({'plain':!![]});_0x10baeb[_0x8a6a('0x2b')](db['sequelize'][_0x8a6a('0x4e')](_0x382e63(_0xb2e419,_0x8a6a('0x51')))[_0x8a6a('0x2a')](function(){})[_0x8a6a('0x4f')](_0x53d7bd()));}}return _0x10baeb;})[_0x8a6a('0x52')]();})[_0x8a6a('0x2a')](function(){return db[_0x8a6a('0x56')]['findAll']({'attributes':['id',_0x8a6a('0x4b')],'include':[{'model':db[_0x8a6a('0x49')],'as':'Lists','where':{'id':LISTID}}]})[_0x8a6a('0x2a')](function(_0x3a35da){var _0x12e817=[];if(_0x3a35da){for(var _0x2d58aa=0x0,_0x35f4ff;_0x2d58aa<_0x3a35da['length'];_0x2d58aa+=0x1){_0x35f4ff=_0x3a35da[_0x2d58aa][_0x8a6a('0x4a')]({'plain':!![]});switch(_0x35f4ff['dialCheckDuplicateType']){case _0x8a6a('0x4c'):_0x12e817[_0x8a6a('0x2b')](db[_0x8a6a('0x4d')][_0x8a6a('0x4e')](_0x5e9cec(_0x35f4ff,'CampaignId'))['then'](function(){})[_0x8a6a('0x4f')](_0x53d7bd()));break;case'onlyIfOpen':_0x12e817[_0x8a6a('0x2b')](db[_0x8a6a('0x4d')][_0x8a6a('0x4e')](_0x310ac9(_0x35f4ff,_0x8a6a('0x57')))[_0x8a6a('0x2a')](function(){})['catch'](_0x53d7bd()));break;default:_0x12e817[_0x8a6a('0x2b')](db['sequelize']['query'](_0xce2160(_0x35f4ff,_0x8a6a('0x57')))[_0x8a6a('0x2a')](function(){})['catch'](_0x53d7bd()));}}}return _0x12e817;})['all']();})[_0x8a6a('0x2a')](function(){return db['Campaign'][_0x8a6a('0x48')]({'attributes':['id'],'include':[{'model':db[_0x8a6a('0x49')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x8a6a('0x2a')](function(_0x425f4f){var _0x336069=[];if(_0x425f4f){for(var _0x52bfbc=0x0,_0x526d68;_0x52bfbc<_0x425f4f[_0x8a6a('0x18')];_0x52bfbc+=0x1){_0x526d68=_0x425f4f[_0x52bfbc][_0x8a6a('0x4a')]({'plain':!![]});_0x336069[_0x8a6a('0x2b')](db[_0x8a6a('0x4d')]['query'](_0x382e63(_0x526d68,_0x8a6a('0x57')))['then'](function(){})['catch'](_0x53d7bd()));}}return _0x336069;})['all']();})[_0x8a6a('0x4f')](function(_0x3f1600){logger['error']('cmContact,\x20%s,\x20%s',_0x8a6a('0x58'),_0x3f1600['message']);});}var processPromises=function(_0x18d3d9){return BPromise[_0x8a6a('0x52')](promises)[_0x8a6a('0x2a')](function(_0x4115b6){})[_0x8a6a('0x4f')](function(_0x19bd62){logger[_0x8a6a('0x15')](_0x8a6a('0x59'),JSON[_0x8a6a('0x2d')](_0x19bd62));})[_0x8a6a('0x5a')](function(){socket[_0x8a6a('0x5b')](_0x8a6a('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x18d3d9){return _0x18d3d9[_0x8a6a('0x5d')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x8a6a('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x8a6a('0x2a')](function(){socket[_0x8a6a('0x5b')](_0x8a6a('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1e6bf6){logger[_0x8a6a('0x15')](_0x8a6a('0x5e'),JSON[_0x8a6a('0x2d')](_0x1e6bf6));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x8a6a('0x5f')](_0x8a6a('0x60'));endCsv();});function main(){return BPromise['resolve']()[_0x8a6a('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8a6a('0x11')](',');return db[_0x8a6a('0x27')][_0x8a6a('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8a6a('0x2a')](function(_0x2f4397){var _0x1addc5=fs[_0x8a6a('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8a6a('0x62')](_0x1addc5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x125640,_0x443d0d){total+=0x1;var _0x51eae5=total;promises['push'](checkRow(_0x125640,_0x2f4397,_0x51eae5)[_0x8a6a('0x2a')](function(){success+=0x1;})[_0x8a6a('0x4f')](function(_0xa80524){if(_0xa80524[_0x8a6a('0x15')]){errors+=0x1;delete _0xa80524['error'];}else if(_0xa80524['duplicate']){duplicates+=0x1;delete _0xa80524[_0x8a6a('0x25')];}rows[_0x8a6a('0x2b')](_0xa80524);}));if(total%0xc8===0x0){_0x443d0d[_0x8a6a('0x63')]();return processPromises(_0x443d0d);}},'complete':function(){return processPromises()[_0x8a6a('0x2a')](function(){logger['info'](_0x8a6a('0x64'));endCsv();});},'error':function(_0x4528a2,_0xd23538){logger[_0x8a6a('0x5f')]('CSV\x20parse\x20error',JSON['stringify'](_0x4528a2));endCsv();}});})[_0x8a6a('0x4f')](function(_0x5bde5b){logger[_0x8a6a('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x8a6a('0x2d')](_0x5bde5b));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 61efe3d..d939020 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 _0xe495=['scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.createdAt','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','ContactId','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_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','info','Received\x20SIGINT','error','message','exit','errors','sequelize','query','spread','catch','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','set','main','stringify','send','start','binding','root','.csv','keys','includes','header','ContactItemType','findAll','name','_description','writeFileSync','createReadStream','data','find','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','itemTypeId','description','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','affectedRows','complete','argv','server/files/tmp','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','SIGINT','uncaughtException','path','papaparse','util','bluebird','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','\x20=\x20','where','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe495,0x12f));var _0x5e49=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xe495[_0x1928c9];return _0x51b5fb;};'use strict';var fs=require('fs');var path=require(_0x5e49('0x0'));var _=require('lodash');var Papa=require(_0x5e49('0x1'));var util=require(_0x5e49('0x2'));var BPromise=require(_0x5e49('0x3'));var moment=require('moment');var squel=require(_0x5e49('0x4'));var Redis=require('ioredis');var db=require(_0x5e49('0x5'))['db'];var config=require(_0x5e49('0x6'));var shared=require(_0x5e49('0x7'));var logger=require(_0x5e49('0x8'))(_0x5e49('0x9'));config[_0x5e49('0xa')]=_['defaults'](config[_0x5e49('0xa')],{'host':_0x5e49('0xb'),'port':0x18eb});var socket=require(_0x5e49('0xc'))(new Redis(config[_0x5e49('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5e49('0xd')](_0x5e49('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5e49('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x18d403){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))*$/[_0x5e49('0xf')](_0x18d403);}function selectNotIn(_0x1a9fe6,_0x235983,_0x2bbab0,_0x4bd196,_0x31f447){return squel[_0x5e49('0x10')]()[_0x5e49('0x11')](_0x5e49('0x12'))[_0x5e49('0x13')](_0x4bd196)[_0x5e49('0x14')](_0x235983,null,_0x235983+'.id\x20=\x20'+_0x4bd196+'.'+_0x2bbab0)['where'](_0x4bd196+'.'+_0x2bbab0+_0x5e49('0x15')+_0x1a9fe6+'.'+_0x2bbab0)[_0x5e49('0x16')](_0x235983+'.dialCheckDuplicateType\x20IN\x20('+_0x31f447[_0x5e49('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5894d3,_0x42f40d){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0x5e49('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x5e49('0x18')](function(_0x4758d4){if(_0x4758d4!==null){var _0x1e87a8=[];for(var _0x562e4f=0x0;_0x562e4f<_0x4758d4[_0x5e49('0x19')];_0x562e4f++){var _0x3778c1=_0x4758d4[_0x562e4f];_0x1e87a8[_0x5e49('0x1a')](insertAdditionalPhones(_0x3778c1));}}Promise[_0x5e49('0x1b')](_0x1e87a8)['then'](function(){_0x5894d3({'val':0x1});});});});}function insertAdditionalPhones(_0x118672){return new Promise(function(_0x5f0756,_0xca2ebe){var _0x459b05=_0x118672[_0x5e49('0x17')];var _0x1c1d3d=_0x459b05['split'](';');var _0x49eb4f=[];orderBy=0x0;for(var _0x26f3b7=0x0;_0x26f3b7<_0x1c1d3d[_0x5e49('0x19')];_0x26f3b7++){_0x49eb4f[_0x5e49('0x1a')](splitAdditionalPhone(_0x118672['id'],_0x1c1d3d[_0x26f3b7]));}Promise['all'](_0x49eb4f)[_0x5e49('0x18')](function(){_0x5f0756({'val':_0x1c1d3d[_0x5e49('0x19')]});});});}function splitAdditionalPhone(_0x2db5af,_0x414b8f){return new Promise(function(_0x1b3b9e,_0x4649cb){var _0x4d2bce=_0x414b8f[_0x5e49('0x1c')](':');var _0x510cb1=_0x4d2bce[0x0];var _0x412b56=_0x4d2bce[0x1];if(!_[_0x5e49('0x1d')](_0x412b56)){var _0xf5586d=_0x412b56[_0x5e49('0x1c')]('|');var _0xc68b62=[];for(var _0x37e121=0x0;_0x37e121<_0xf5586d[_0x5e49('0x19')];_0x37e121++){if(_0xf5586d[_0x37e121]!==''){var _0x19b90f=_['filter'](promisesAdditionalPhones,{'contactId':_0x2db5af,'phone':_0xf5586d[_0x37e121]});if(_0x19b90f[_0x5e49('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x5e49('0x1a')]({'contactId':_0x2db5af,'contactTypeId':_0x510cb1,'phone':_0xf5586d[_0x37e121],'orderBy':orderBy});}}}_0x1b3b9e({'ok':0x1});}else _0x1b3b9e({'res':0x0});});}function createAdditionalPhone(_0x210335,_0x2988d6,_0x37935e,_0x25cd59){var _0xf985ca='';var _0x5112ce='';var _0x4012a0=_0x37935e['split']('§');_0xf985ca=_0x4012a0[0x0];if(_0x4012a0['length']==0x2)_0x5112ce=_0x4012a0[0x1];return new Promise(function(_0x19446f,_0x1e64aa){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x210335,'item':_0xf985ca}})[_0x5e49('0x18')](function(_0x12b0a7){if(_0x12b0a7){return db[_0x5e49('0x1e')][_0x5e49('0x1f')]({'ItemTypeId':_0x2988d6,'description':_0x5112ce,'OrderBy':_0x25cd59},{'where':{'CmContactId':_0x210335,'item':_0xf985ca}})[_0x5e49('0x18')](function(_0x669e28){_0x19446f({'res':'updated'});});}else{return db[_0x5e49('0x1e')][_0x5e49('0x20')]({'CmContactId':_0x210335,'item':_0xf985ca,'description':_0x5112ce,'ItemTypeId':_0x2988d6,'OrderBy':_0x25cd59,'ItemClass':_0x5e49('0x21')})[_0x5e49('0x18')](function(_0x4f3c40){_0x19446f({'res':_0x5e49('0x22')});});}});});}function insertCmHopper(_0x36b307,_0x1b1523,_0x26b29b,_0x557204,_0x1cd835){var _0x3a0f11=[_0x5e49('0x23'),'cm_contacts.scheduledat',_0x5e49('0x24'),_0x5e49('0x25'),_0x1b1523+'.'+_0x557204,'cm_contacts.createdAt',_0x5e49('0x26'),_0x5e49('0x27'),_0x5e49('0x28'),'\x22'+_0x1cd835+'\x22'];return squel[_0x5e49('0x29')]()[_0x5e49('0x2a')](_0x5e49('0x2b'))[_0x5e49('0x2c')]([_0x5e49('0x12'),_0x5e49('0x2d'),'ContactId',_0x5e49('0x2e'),_0x557204,_0x5e49('0x2f'),_0x5e49('0x30'),_0x5e49('0x31'),_0x5e49('0x32'),_0x5e49('0x33')],squel[_0x5e49('0x10')]()['fields'](_0x3a0f11)[_0x5e49('0x13')](_0x1b1523)[_0x5e49('0x14')](_0x5e49('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x1b1523+_0x5e49('0x35'))[_0x5e49('0x14')](_0x26b29b,null,_0x26b29b+_0x5e49('0x36')+_0x1b1523+'.'+_0x557204)[_0x5e49('0x16')](_0x1b1523+_0x5e49('0x37'),_0x36b307)[_0x5e49('0x16')](_0x5e49('0x38'),NOW)[_0x5e49('0x16')](_0x5e49('0x39'),selectNotIn(_0x1b1523,_0x26b29b,_0x557204,'cm_hopper',['\x22always\x22',_0x5e49('0x3a')]))['where'](_0x5e49('0x39'),selectNotIn(_0x1b1523,_0x26b29b,_0x557204,_0x5e49('0x2b'),[_0x5e49('0x3b')])))[_0x5e49('0x3c')]();}function insertCmHopperBlack(_0x17bd52,_0x595833,_0x387bb7,_0x320de8){var _0x58dfe8=[_0x5e49('0x23'),'cm_contacts.id',_0x5e49('0x25'),_0x595833+'.'+_0x320de8,_0x5e49('0x3d'),'cm_contacts.updatedAt'];return squel[_0x5e49('0x29')]()[_0x5e49('0x2a')](_0x5e49('0x3e'))[_0x5e49('0x2c')]([_0x5e49('0x12'),'ContactId',_0x5e49('0x2e'),_0x320de8,_0x5e49('0x2f'),_0x5e49('0x30')],squel[_0x5e49('0x10')]()[_0x5e49('0x3f')](_0x58dfe8)[_0x5e49('0x13')](_0x595833)[_0x5e49('0x14')](_0x5e49('0x34'),null,_0x5e49('0x40')+_0x595833+'.CmListId')[_0x5e49('0x14')](_0x387bb7,null,_0x387bb7+_0x5e49('0x36')+_0x595833+'.'+_0x320de8)[_0x5e49('0x16')](_0x595833+_0x5e49('0x37'),_0x17bd52)['where'](_0x5e49('0x38'),NOW)[_0x5e49('0x16')](_0x5e49('0x39'),squel[_0x5e49('0x10')]()[_0x5e49('0x11')](_0x5e49('0x12'))[_0x5e49('0x13')](_0x5e49('0x3e'))[_0x5e49('0x16')](_0x5e49('0x41'),_0x17bd52)[_0x5e49('0x16')](_0x320de8+_0x5e49('0x15')+_0x595833+'.'+_0x320de8)))[_0x5e49('0x3c')]();}function insertTzCmHopper(_0x3d0f82,_0x498f2c,_0x144797,_0xbed94,_0x262739,_0x1144c0){var _0x1edd23=['cm_contacts.phone',_0x5e49('0x42')+_0x1144c0+'.offset-cm_contacts.utcOffset\x20minute)',_0x5e49('0x24'),_0x5e49('0x25'),_0x498f2c+'.'+_0xbed94,_0x5e49('0x3d'),_0x5e49('0x26'),_0x5e49('0x27'),_0x5e49('0x28'),'\x22'+_0x262739+'\x22'];var _0x2ae15d=squel[_0x5e49('0x29')]()['into'](_0x5e49('0x2b'))['fromQuery']([_0x5e49('0x12'),_0x5e49('0x2d'),_0x5e49('0x43'),_0x5e49('0x2e'),_0xbed94,_0x5e49('0x2f'),_0x5e49('0x30'),_0x5e49('0x31'),'UserId',_0x5e49('0x33')],squel['select']()[_0x5e49('0x3f')](_0x1edd23)[_0x5e49('0x13')](_0x498f2c)[_0x5e49('0x14')](_0x5e49('0x34'),null,_0x5e49('0x40')+_0x498f2c+_0x5e49('0x35'))[_0x5e49('0x14')](_0x144797,null,_0x144797+_0x5e49('0x36')+_0x498f2c+'.'+_0xbed94)[_0x5e49('0x14')](_0x1144c0,null,_0x1144c0+_0x5e49('0x36')+_0x498f2c+'.'+_0xbed94)[_0x5e49('0x16')](_0x498f2c+_0x5e49('0x37'),_0x3d0f82)['where'](_0x5e49('0x38'),NOW)[_0x5e49('0x16')](_0x5e49('0x39'),selectNotIn(_0x498f2c,_0x144797,_0xbed94,_0x5e49('0x2b'),[_0x5e49('0x3b'),_0x5e49('0x3a')]))[_0x5e49('0x16')](_0x5e49('0x39'),selectNotIn(_0x498f2c,_0x144797,_0xbed94,_0x5e49('0x2b'),[_0x5e49('0x3b')])))[_0x5e49('0x3c')]();return _0x2ae15d;}function insertTzCmHopperBlack(_0x210fc9,_0x35ccea,_0x529cbb,_0x3def1c){var _0x19301e=[_0x5e49('0x23'),_0x5e49('0x24'),_0x5e49('0x25'),_0x35ccea+'.'+_0x3def1c,_0x5e49('0x3d'),_0x5e49('0x26')];return squel[_0x5e49('0x29')]()['into'](_0x5e49('0x3e'))[_0x5e49('0x2c')]([_0x5e49('0x12'),_0x5e49('0x43'),_0x5e49('0x2e'),_0x3def1c,_0x5e49('0x2f'),_0x5e49('0x30')],squel[_0x5e49('0x10')]()[_0x5e49('0x3f')](_0x19301e)[_0x5e49('0x13')](_0x35ccea)[_0x5e49('0x14')](_0x5e49('0x34'),null,_0x5e49('0x40')+_0x35ccea+_0x5e49('0x35'))[_0x5e49('0x14')](_0x529cbb,null,_0x529cbb+_0x5e49('0x36')+_0x35ccea+'.'+_0x3def1c)[_0x5e49('0x16')](_0x35ccea+'.CmListId\x20=\x20?',_0x210fc9)[_0x5e49('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5e49('0x16')](_0x5e49('0x39'),squel[_0x5e49('0x10')]()[_0x5e49('0x11')](_0x5e49('0x12'))[_0x5e49('0x13')](_0x5e49('0x3e'))['where'](_0x5e49('0x41'),_0x210fc9)['where'](_0x3def1c+_0x5e49('0x15')+_0x35ccea+'.'+_0x3def1c)))[_0x5e49('0x3c')]();}function insertCmHopperAdditionalPhones(_0x1b15f0){var _0x94cc1d=['cm_hopper.id',_0x5e49('0x44'),_0x5e49('0x45'),_0x5e49('0x46'),_0x5e49('0x47')];return squel[_0x5e49('0x29')]()[_0x5e49('0x2a')](_0x5e49('0x48'))[_0x5e49('0x2c')]([_0x5e49('0x49'),_0x5e49('0x12'),'OrderBy',_0x5e49('0x2f'),_0x5e49('0x30')],squel[_0x5e49('0x10')]()[_0x5e49('0x3f')](_0x94cc1d)['from'](_0x5e49('0x2b'))[_0x5e49('0x14')](_0x5e49('0x34'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x5e49('0x14')](_0x5e49('0x4a'),null,_0x5e49('0x4b'))[_0x5e49('0x16')](_0x5e49('0x4c'),_0x1b15f0)[_0x5e49('0x16')](_0x5e49('0x38'),NOW))['toString']();}function insertCmContact(_0x47ca3b,_0x5eb53e,_0x45b10f,_0x46b993){var _0x530253=_[_0x5e49('0x4d')](_['keys'](_0x46b993),[_0x5e49('0x2e'),_0x5e49('0x4e'),_0x5e49('0x2f'),_0x5e49('0x30')]);return squel['insert']()[_0x5e49('0x2a')](_0x5e49('0x34'))['fromQuery'](_0x530253,squel[_0x5e49('0x10')]()[_0x5e49('0x3f')](_0x530253)[_0x5e49('0x13')](_0x5eb53e)[_0x5e49('0x16')]('('+_0x45b10f[_0x5e49('0x14')](',')+')\x20NOT\x20IN\x20?',squel[_0x5e49('0x10')]()[_0x5e49('0x3f')](_0x45b10f)[_0x5e49('0x13')](_0x5e49('0x34'))[_0x5e49('0x16')](_0x5e49('0x41'),_0x47ca3b)['where'](_0x5e49('0x4f')))[_0x5e49('0x16')](_0x5e49('0x50'),squel[_0x5e49('0x10')]()[_0x5e49('0x11')]('MIN(id)',_0x5e49('0x51'))[_0x5e49('0x13')](_0x5eb53e)['group'](_0x45b10f[_0x5e49('0x14')](','))))['toString']();}function handleStop(){logger[_0x5e49('0x52')](_0x5e49('0x53'));stopped=!![];}function handleUncaughtException(_0x5968f3){logger[_0x5e49('0x54')](_0x5968f3[_0x5e49('0x55')]);process[_0x5e49('0x56')](0x1);}function handleError(_0x2eca45,_0x222272){stats[_0x5e49('0x57')]['push']({'name':_0x222272['code'],'message':_0x222272[_0x5e49('0x55')],'row':_0x2eca45});}function handleQuery(_0x4d3bb2){logger[_0x5e49('0x52')](_0x4d3bb2);return db[_0x5e49('0x58')][_0x5e49('0x59')](_0x4d3bb2)[_0x5e49('0x5a')](function(_0x2ab8b4){results[_0x5e49('0x1a')](_0x2ab8b4);})[_0x5e49('0x5b')](function(_0x20390c){logger['error'](_0x20390c['message']);});}function updateTzCampaigns(_0xdbbcd3){return new Promise(function(_0x40b846,_0x5387b6){var _0x33aa0e=squel[_0x5e49('0x10')]()[_0x5e49('0x3f')](['campaigns.id',_0x5e49('0x5c')])[_0x5e49('0x13')](_0x5e49('0x5d'))['join']('campaigns_has_cm_lists',null,_0x5e49('0x5e'))['where']('campaigns_has_cm_lists.CmListId='+_0xdbbcd3);db['sequelize'][_0x5e49('0x59')](_0x33aa0e['toString']())[_0x5e49('0x5a')](function(_0x19e0aa){var _0x52035c=[];for(var _0x423e23=0x0;_0x423e23<_0x19e0aa[_0x5e49('0x19')];_0x423e23++){_0x52035c['push'](getTimezoneData(_0x19e0aa[_0x423e23],tmp_campaigns));}BPromise[_0x5e49('0x1b')](_0x52035c)[_0x5e49('0x18')](function(){_0x40b846({'val':0x1});});})[_0x5e49('0x5b')](function(_0x42713e){logger[_0x5e49('0x54')](_0x42713e['message']);_0x40b846({'val':0x0});});});}function updateTzVoiceQueues(_0x466093){return new Promise(function(_0x5170ae,_0xb3e6d3){var _0x3aec9b=squel[_0x5e49('0x10')]()['fields']([_0x5e49('0x5f'),_0x5e49('0x60')])[_0x5e49('0x13')](_0x5e49('0x61'))['join']('voice_queues_has_cm_lists',null,_0x5e49('0x62'))['where'](_0x5e49('0x63')+_0x466093);db['sequelize'][_0x5e49('0x59')](_0x3aec9b['toString']())[_0x5e49('0x5a')](function(_0x3aa6a7){var _0x51382a=[];for(var _0x30e288=0x0;_0x30e288<_0x3aa6a7[_0x5e49('0x19')];_0x30e288++){_0x51382a[_0x5e49('0x1a')](getTimezoneData(_0x3aa6a7[_0x30e288],tmp_voice_queues));}BPromise[_0x5e49('0x1b')](_0x51382a)[_0x5e49('0x18')](function(){_0x5170ae({'val':0x1});});})[_0x5e49('0x5b')](function(_0x2e39cd){logger['error'](_0x2e39cd[_0x5e49('0x55')]);_0x5170ae({'val':0x0});});});}function getTimezoneData(_0x244b00,_0x12b54b){return new Promise(function(_0x5b359d,_0x43cec8){var _0x31f9bc=shared['timezones'];var _0x5dc712=_0x31f9bc[_0x244b00[_0x5e49('0x64')]];if(_[_0x5e49('0x1d')](_0x5dc712)){_0x5b359d({'ret':0x1});}else{var _0x5aa920=_0x5dc712['utcOffset'];var _0x33bf6d=squel['insert']()[_0x5e49('0x2a')](_0x12b54b)['set']('id',_0x244b00['id'])['set']('offset',_0x5aa920)[_0x5e49('0x65')](_0x5e49('0x64'),_0x244b00['dialTimezone'])[_0x5e49('0x3c')]();return db['sequelize'][_0x5e49('0x59')](_0x33bf6d)[_0x5e49('0x5a')](function(_0x1cb012){_0x5b359d({'ret':0x1});})['catch'](function(_0x3e8400){logger['error'](_0x3e8400[_0x5e49('0x55')]);_0x43cec8({'ret':0x1});});}});}function handleTZQuery(_0x519a01){logger[_0x5e49('0x52')](_0x519a01);return db[_0x5e49('0x58')][_0x5e49('0x59')](_0x519a01)[_0x5e49('0x5a')](function(_0xf78bcf){})[_0x5e49('0x5b')](function(_0x3028b3){logger[_0x5e49('0x54')](_0x3028b3[_0x5e49('0x55')]);});}function main(_0x1dc146,_0x371c46,_0x5a0e5e,_0x113f28){logger[_0x5e49('0x52')](_0x5e49('0x66'),_0x1dc146,JSON[_0x5e49('0x67')](_0x371c46));process[_0x5e49('0x68')](_0x5e49('0x69'));var _0x53c92f=_0x371c46[_0x5e49('0x6a')];var _0x360d54=_['clone'](_0x53c92f);var _0x2ac45d=_0x371c46['socket_timestamp'];var _0x11bfe7=path[_0x5e49('0x14')](config[_0x5e49('0x6b')],'server/files/tmp',_0x2ac45d+_0x5e49('0x6c'));hasTZ=_[_0x5e49('0x6d')](_0x53c92f)[_0x5e49('0x6e')](_0x5e49('0x64'));var _0x537dea=_['keys'](_0x53c92f)[_0x5e49('0x14')]();logger[_0x5e49('0x52')](_0x5e49('0x6f'),_0x537dea);db[_0x5e49('0x70')][_0x5e49('0x71')]({'raw':!![],'attributes':['id',_0x5e49('0x72')]})['then'](function(_0x27d9bf){for(var _0x2bbdbe=0x0;_0x2bbdbe<_0x27d9bf[_0x5e49('0x19')];_0x2bbdbe++){if(_0x27d9bf[_0x2bbdbe]['name']in _0x53c92f){contactItemTypes['push'](_0x27d9bf[_0x2bbdbe]);delete _0x360d54[_0x27d9bf[_0x2bbdbe][_0x5e49('0x72')]];hasAdditionalPhones=!![];}for(var _0x32ee9e in _0x53c92f){if(_0x27d9bf[_0x2bbdbe]['name']+_0x5e49('0x73')===_0x32ee9e){phoneDescriptions['push']({'itemTypeId':_0x27d9bf[_0x2bbdbe]['id'],'description':_0x32ee9e});delete _0x360d54[_0x32ee9e];}}}if(hasAdditionalPhones)_0x360d54['AdditionalPhones']='';var _0x1d7040=_[_0x5e49('0x6d')](_0x360d54)[_0x5e49('0x14')]();logger[_0x5e49('0x52')](_0x5e49('0x6f'),_0x1d7040);fs[_0x5e49('0x74')](_0x11bfe7,_0x1d7040+'\x0a');Papa['parse'](fs[_0x5e49('0x75')](_0x1dc146),{'header':!![],'skipEmptyLines':!![],'step':function(_0x226e62,_0x1ca456){try{for(var _0x28a1eb=0x0,_0x568154=[];_0x28a1eb<_0x226e62['data'][_0x5e49('0x19')];_0x28a1eb++){stats['rows']+=0x1;if(_0x226e62[_0x5e49('0x57')][_0x28a1eb]){handleError(_0x226e62[_0x5e49('0x76')][_0x28a1eb],_0x226e62[_0x5e49('0x57')][_0x28a1eb]);}else{var _0x4770b8=[];var _0x2c183d=[];var _0xa466b4={};for(var _0x2c6a2f in _0x53c92f){let _0xec106b=contactItemTypes[_0x5e49('0x77')](_0x2a72d6=>_0x2a72d6[_0x5e49('0x72')]===_0x2c6a2f);let _0x10da3d=contactItemTypes['find'](_0x5df25c=>_0x5df25c[_0x5e49('0x72')]+_0x5e49('0x73')===_0x2c6a2f);if(_['isNil'](_0xec106b)&&_[_0x5e49('0x1d')](_0x10da3d)){if(_0x53c92f['hasOwnProperty'](_0x2c6a2f)){if(_0x226e62['data'][_0x28a1eb][_0x53c92f[_0x2c6a2f]]){var _0x3121b0=_[_0x5e49('0x78')](_0x226e62[_0x5e49('0x76')][_0x28a1eb][_0x53c92f[_0x2c6a2f]][_0x5e49('0x79')](/"/g,'\x27'));switch(_0x2c6a2f){case _0x5e49('0x2d'):var _0x16148f=moment(_0x3121b0,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x16148f[_0x5e49('0x7a')]()){_0x568154[_0x5e49('0x1a')]('\x22'+_0x3121b0+'\x22');}else{_0x4770b8[_0x5e49('0x1a')](_0x5e49('0x7b'));}break;case _0x5e49('0x31'):var _0x2c66b3=parseInt(_0x3121b0);_0x3121b0=_[_0x5e49('0x7c')](_0x2c66b3)||_0x2c66b3<0x0||_0x2c66b3>0x4?_0x113f28?0x3:0x2:_0x2c66b3;_0x568154[_0x5e49('0x1a')]('\x22'+_0x3121b0+'\x22');break;case _0x5e49('0x32'):var _0x336f0a=parseInt(_0x3121b0);if(_['isNumber'](_0x336f0a)&&_[_0x5e49('0x6e')](_0x5a0e5e,_0x336f0a)){_0x568154['push']('\x22'+_0x336f0a+'\x22');}else{_0x4770b8[_0x5e49('0x1a')](_0x5e49('0x7d'));}break;case _0x5e49('0x7e'):if(isEmail(_0x3121b0)){_0x568154['push']('\x22'+_0x3121b0+'\x22');}else{_0x4770b8['push'](_0x5e49('0x7f'));}break;case _0x5e49('0x80'):var _0x399227=moment(_0x3121b0,'YYYY-MM-DD',!![]);if(_0x399227[_0x5e49('0x7a')]()){_0x568154['push']('\x22'+_0x3121b0+'\x22');}else{_0x4770b8[_0x5e49('0x1a')](_0x5e49('0x81'));}break;case _0x5e49('0x64'):var _0x4149d2=shared[_0x5e49('0x82')];var _0x54df96=_0x4149d2[_0x3121b0];if(!_['isNil'](_0x54df96)){var _0x10a8c2=_0x54df96['utcOffset'];_0x568154[_0x5e49('0x1a')]('\x22'+_0x3121b0+'\x22');_0x568154[_0x5e49('0x1a')]('\x22'+_0x10a8c2+'\x22');}break;default:_0x568154[_0x5e49('0x1a')]('\x22'+_0x3121b0+'\x22');}}else{switch(_0x2c6a2f){case _0x5e49('0x83'):case _0x5e49('0x12'):_0x4770b8[_0x5e49('0x1a')](_0x2c6a2f+'\x20not\x20specified');break;default:_0x568154[_0x5e49('0x1a')]('\x22\x22');}}}}else{var _0x30907c='';if(!_['isNil'](_0xec106b)){if(!_0xa466b4['hasOwnProperty'](_0xec106b['id'])){if(!_[_0x5e49('0x1d')](_0x226e62['data'][_0x28a1eb][_0x53c92f[_0x2c6a2f]])){var _0x3121b0=_['trim'](_0x226e62[_0x5e49('0x76')][_0x28a1eb][_0x53c92f[_0x2c6a2f]]['replace'](/"/g,'\x27'));var _0x4cc9ac=phoneDescriptions[_0x5e49('0x77')](_0x24ef77=>_0x24ef77[_0x5e49('0x84')]===_0xec106b['id']);if(!_[_0x5e49('0x1d')](_0x4cc9ac)){var _0xb19977=_['trim'](_0x226e62[_0x5e49('0x76')][_0x28a1eb][_0x53c92f[_0x4cc9ac[_0x5e49('0x85')]]]['replace'](/"/g,'\x27'));if(!_[_0x5e49('0x1d')](_0xb19977))_0x3121b0=_0x3121b0+'§'+_0xb19977;}if(_0x30907c=='')_0x30907c=_0x3121b0;else _0x30907c+='|'+_0x3121b0;}_0x2c183d[_0x5e49('0x1a')](_0xec106b['id']+':'+_0x30907c);_0xa466b4[_0xec106b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x568154[_0x5e49('0x1a')]('\x22'+_0x2c183d[_0x5e49('0x14')](';')+'\x22');}if(_0x4770b8[_0x5e49('0x19')]){handleError(_0x226e62['data'][_0x28a1eb],{'code':_0x5e49('0x86'),'message':_0x4770b8[_0x5e49('0x14')]()});}else{fs[_0x5e49('0x87')](_0x11bfe7,_0x568154[_0x5e49('0x14')]()+'\x0a');}_0x568154=[];}if(!(stats[_0x5e49('0x88')]%0xc8)){socket[_0x5e49('0x89')](_0x5e49('0x8a')+_0x2ac45d,stats);stats[_0x5e49('0x57')]=[];}}if(stopped){logger[_0x5e49('0x52')](_0x5e49('0x8b'));_0x1ca456[_0x5e49('0x8c')]();}}catch(_0x2cfa57){handleError(_0x226e62[_0x5e49('0x76')][_0x28a1eb],{'code':_0x5e49('0x8d'),'message':_0x2cfa57['message']});logger[_0x5e49('0x54')](_0x5e49('0x8e'),_0x2cfa57[_0x5e49('0x55')]);}},'complete':function(){try{var _0x8d1df0=[];var _0x17a3cd=[];var _0x24f4d7=_0x5e49('0x34');if(_0x371c46[_0x5e49('0x8f')]&&_0x371c46['duplicates']['length']){_0x24f4d7=_0x5e49('0x90')+_0x2ac45d;_0x8d1df0['push']('CREATE\x20TABLE\x20'+_0x24f4d7+_0x5e49('0x91'));}tmp_campaigns=_0x5e49('0x92')+_0x2ac45d;tmp_voice_queues=_0x5e49('0x93')+_0x2ac45d;_0x17a3cd[_0x5e49('0x1a')](_0x5e49('0x94')+tmp_campaigns+_0x5e49('0x95'));_0x17a3cd[_0x5e49('0x1a')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x5e49('0x96')](_0x17a3cd,handleTZQuery)[_0x5e49('0x18')](function(_0x19b236){updateTzCampaigns(_0x371c46[_0x5e49('0x2e')])[_0x5e49('0x18')](function(_0xbbab87){updateTzVoiceQueues(_0x371c46['ListId'])[_0x5e49('0x18')](function(_0x214eae){if(hasTZ)_0x1d7040=_0x1d7040[_0x5e49('0x79')]('dialTimezone',_0x5e49('0x97'));var _0x3927d5=util[_0x5e49('0xd')](_0x5e49('0x98'),_0x11bfe7,_0x24f4d7,_0x1d7040,_0x371c46[_0x5e49('0x2e')],_0x371c46[_0x5e49('0x4e')]||null,NOW,NOW);if(_['isNil'](_0x53c92f[_0x5e49('0x2d')])){_0x3927d5+=_0x5e49('0x99');}_0x8d1df0['push'](_0x3927d5);if(_0x371c46['duplicates']&&_0x371c46['duplicates'][_0x5e49('0x19')]){_0x8d1df0[_0x5e49('0x1a')](insertCmContact(_0x371c46[_0x5e49('0x2e')],_0x24f4d7,_0x371c46[_0x5e49('0x8f')],_0x53c92f));_0x8d1df0[_0x5e49('0x1a')](_0x5e49('0x9a')+_0x24f4d7+';');}BPromise[_0x5e49('0x96')](_0x8d1df0,handleQuery)['then'](function(_0x2881ff){BPromise['all']([handleAdditionalPhones()])[_0x5e49('0x18')](function(){_0x8d1df0=[];for(var _0x721310=0x0;_0x721310\x20\x20');}var _0x4495fa=path['join'](config[_0x5e49('0x6b')],_0x5e49('0xa7'),process[_0x5e49('0xa6')][0x2]);if(!fs['existsSync'](_0x4495fa)){throw new Error(_0x5e49('0xa8'));}var _0x2bdf61={};try{_0x2bdf61=JSON[_0x5e49('0xa9')](process[_0x5e49('0xa6')][0x3]);if(!_0x2bdf61[_0x5e49('0x6a')]){throw new Error(_0x5e49('0xaa'));}if(!_0x2bdf61[_0x5e49('0x6a')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x2bdf61[_0x5e49('0x6a')][_0x5e49('0x83')]){throw new Error('firstName\x20is\x20mandatory');}var _0x58f33f=0x0;if(_0x2bdf61['binding']['UserId']){_0x58f33f=0x1;}if(!_0x2bdf61[_0x5e49('0x2e')]){throw new Error(_0x5e49('0xab'));}}catch(_0x302821){throw new Error('body\x20id\x20mandatory');}var _0x5931ac=[];try{_0x5931ac=_['map'](JSON[_0x5e49('0xa9')](process[_0x5e49('0xa6')][0x4]),'id');}catch(_0x1f2779){logger[_0x5e49('0x52')]('No\x20agent\x20available');}main(_0x4495fa,_0x2bdf61,_0x5931ac,_0x58f33f);}validate();process['on'](_0x5e49('0xac'),handleStop);process['on'](_0x5e49('0xad'),handleUncaughtException); \ No newline at end of file +var _0x59f8=['cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_hopper_black','ListId','cm_contacts','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','priority','\x22always\x22','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','main','stringify','send','start','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','firstName','itemTypeId','appendFileSync','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','campaigns_has_cm_blacklists','CampaignId','voice_queues_has_cm_blacklists','affectedRows','emit','contact:import:','unlink','argv','arguments\x20\x20\x20','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','length','all','AdditionalPhones','push','isNil','split','CmContactHasItem','findOne','then','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?'];(function(_0xeceed2,_0x1167ab){var _0x2ddb79=function(_0x4d5760){while(--_0x4d5760){_0xeceed2['push'](_0xeceed2['shift']());}};_0x2ddb79(++_0x1167ab);}(_0x59f8,0x1d2));var _0x859f=function(_0x1c27e1,_0x10cc1c){_0x1c27e1=_0x1c27e1-0x0;var _0x9a81ac=_0x59f8[_0x1c27e1];return _0x9a81ac;};'use strict';var fs=require('fs');var path=require(_0x859f('0x0'));var _=require(_0x859f('0x1'));var Papa=require('papaparse');var util=require(_0x859f('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x859f('0x3'));var Redis=require(_0x859f('0x4'));var db=require(_0x859f('0x5'))['db'];var config=require(_0x859f('0x6'));var shared=require(_0x859f('0x7'));var logger=require('../../../config/logger')('import');config['redis']=_['defaults'](config['redis'],{'host':_0x859f('0x8'),'port':0x18eb});var socket=require(_0x859f('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x859f('0xa')](_0x859f('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x859f('0xa')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x16c822){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))*$/[_0x859f('0xc')](_0x16c822);}function selectNotIn(_0x48dcef,_0x5d0f46,_0x5c02c3,_0x566d82,_0x4ca756){return squel[_0x859f('0xd')]()[_0x859f('0xe')](_0x859f('0xf'))[_0x859f('0x10')](_0x566d82)['join'](_0x5d0f46,null,_0x5d0f46+_0x859f('0x11')+_0x566d82+'.'+_0x5c02c3)[_0x859f('0x12')](_0x566d82+'.'+_0x5c02c3+'\x20=\x20'+_0x48dcef+'.'+_0x5c02c3)[_0x859f('0x12')](_0x5d0f46+_0x859f('0x13')+_0x4ca756[_0x859f('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xa98a5a,_0x5beef8){promisesAdditionalPhones=[];return db[_0x859f('0x15')][_0x859f('0x16')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x3d9ad5){if(_0x3d9ad5!==null){var _0x21a3f0=[];for(var _0x5025d1=0x0;_0x5025d1<_0x3d9ad5[_0x859f('0x17')];_0x5025d1++){var _0x2e9279=_0x3d9ad5[_0x5025d1];_0x21a3f0['push'](insertAdditionalPhones(_0x2e9279));}}Promise[_0x859f('0x18')](_0x21a3f0)['then'](function(){_0xa98a5a({'val':0x1});});});});}function insertAdditionalPhones(_0x5836ea){return new Promise(function(_0xad699f,_0x180dfe){var _0x263a09=_0x5836ea[_0x859f('0x19')];var _0x4f6256=_0x263a09['split'](';');var _0x267d7a=[];orderBy=0x0;for(var _0x4533e9=0x0;_0x4533e9<_0x4f6256['length'];_0x4533e9++){_0x267d7a[_0x859f('0x1a')](splitAdditionalPhone(_0x5836ea['id'],_0x4f6256[_0x4533e9]));}Promise[_0x859f('0x18')](_0x267d7a)['then'](function(){_0xad699f({'val':_0x4f6256[_0x859f('0x17')]});});});}function splitAdditionalPhone(_0x30a565,_0x3c610b){return new Promise(function(_0x4a1225,_0x4157ee){var _0x4488e2=_0x3c610b['split'](':');var _0x4c9586=_0x4488e2[0x0];var _0x8b128b=_0x4488e2[0x1];if(!_[_0x859f('0x1b')](_0x8b128b)){var _0x15145d=_0x8b128b[_0x859f('0x1c')]('|');var _0x1e65a7=[];for(var _0x1274bc=0x0;_0x1274bc<_0x15145d[_0x859f('0x17')];_0x1274bc++){if(_0x15145d[_0x1274bc]!==''){var _0x55e9d0=_['filter'](promisesAdditionalPhones,{'contactId':_0x30a565,'phone':_0x15145d[_0x1274bc]});if(_0x55e9d0[_0x859f('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0x859f('0x1a')]({'contactId':_0x30a565,'contactTypeId':_0x4c9586,'phone':_0x15145d[_0x1274bc],'orderBy':orderBy});}}}_0x4a1225({'ok':0x1});}else _0x4a1225({'res':0x0});});}function createAdditionalPhone(_0x4ee618,_0x2b9fa5,_0x56a3e1,_0x5cb603){var _0x156a58='';var _0x2e2320='';var _0x2678eb=_0x56a3e1[_0x859f('0x1c')]('§');_0x156a58=_0x2678eb[0x0];if(_0x2678eb['length']==0x2)_0x2e2320=_0x2678eb[0x1];return new Promise(function(_0x505069,_0x985c17){return db[_0x859f('0x1d')][_0x859f('0x1e')]({'where':{'CmContactId':_0x4ee618,'item':_0x156a58}})[_0x859f('0x1f')](function(_0x168626){if(_0x168626){return db[_0x859f('0x1d')]['update']({'ItemTypeId':_0x2b9fa5,'description':_0x2e2320,'OrderBy':_0x5cb603},{'where':{'CmContactId':_0x4ee618,'item':_0x156a58}})[_0x859f('0x1f')](function(_0x3a6456){_0x505069({'res':'updated'});});}else{return db[_0x859f('0x1d')]['create']({'CmContactId':_0x4ee618,'item':_0x156a58,'description':_0x2e2320,'ItemTypeId':_0x2b9fa5,'OrderBy':_0x5cb603,'ItemClass':_0x859f('0x20')})[_0x859f('0x1f')](function(_0x246e7a){_0x505069({'res':_0x859f('0x21')});});}});});}function insertCmHopper(_0x2be5af,_0x53d422,_0x236b50,_0x1cbeb1,_0x19bdb3){var _0x10df19=[_0x859f('0x22'),'cm_contacts.scheduledat',_0x859f('0x23'),_0x859f('0x24'),_0x53d422+'.'+_0x1cbeb1,_0x859f('0x25'),_0x859f('0x26'),'cm_contacts.priority',_0x859f('0x27'),'\x22'+_0x19bdb3+'\x22'];return squel[_0x859f('0x28')]()[_0x859f('0x29')](_0x859f('0x2a'))[_0x859f('0x2b')]([_0x859f('0xf'),_0x859f('0x2c'),_0x859f('0x2d'),'ListId',_0x1cbeb1,_0x859f('0x2e'),_0x859f('0x2f'),'priority','UserId',_0x859f('0x30')],squel['select']()[_0x859f('0x31')](_0x10df19)[_0x859f('0x10')](_0x53d422)[_0x859f('0x14')]('cm_contacts',null,_0x859f('0x32')+_0x53d422+_0x859f('0x33'))[_0x859f('0x14')](_0x236b50,null,_0x236b50+_0x859f('0x11')+_0x53d422+'.'+_0x1cbeb1)[_0x859f('0x12')](_0x53d422+_0x859f('0x34'),_0x2be5af)[_0x859f('0x12')](_0x859f('0x35'),NOW)[_0x859f('0x12')](_0x859f('0x36'),selectNotIn(_0x53d422,_0x236b50,_0x1cbeb1,_0x859f('0x2a'),['\x22always\x22',_0x859f('0x37')]))[_0x859f('0x12')](_0x859f('0x36'),selectNotIn(_0x53d422,_0x236b50,_0x1cbeb1,_0x859f('0x2a'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x518eee,_0x42eaa3,_0x526786,_0x148db3){var _0x4d285c=[_0x859f('0x22'),_0x859f('0x23'),_0x859f('0x24'),_0x42eaa3+'.'+_0x148db3,_0x859f('0x25'),_0x859f('0x26')];return squel[_0x859f('0x28')]()[_0x859f('0x29')](_0x859f('0x38'))[_0x859f('0x2b')]([_0x859f('0xf'),'ContactId',_0x859f('0x39'),_0x148db3,_0x859f('0x2e'),'updatedAt'],squel['select']()[_0x859f('0x31')](_0x4d285c)[_0x859f('0x10')](_0x42eaa3)[_0x859f('0x14')](_0x859f('0x3a'),null,_0x859f('0x32')+_0x42eaa3+'.CmListId')[_0x859f('0x14')](_0x526786,null,_0x526786+_0x859f('0x11')+_0x42eaa3+'.'+_0x148db3)[_0x859f('0x12')](_0x42eaa3+_0x859f('0x34'),_0x518eee)[_0x859f('0x12')](_0x859f('0x35'),NOW)[_0x859f('0x12')](_0x859f('0x36'),squel['select']()[_0x859f('0xe')]('phone')[_0x859f('0x10')](_0x859f('0x38'))[_0x859f('0x12')]('ListId\x20=\x20?',_0x518eee)[_0x859f('0x12')](_0x148db3+_0x859f('0x3b')+_0x42eaa3+'.'+_0x148db3)))['toString']();}function insertTzCmHopper(_0x5dd4d0,_0x559819,_0x5007da,_0x5176cd,_0x494f44,_0x5031e7){var _0x10317e=[_0x859f('0x22'),_0x859f('0x3c')+_0x5031e7+'.offset-cm_contacts.utcOffset\x20minute)',_0x859f('0x23'),_0x859f('0x24'),_0x559819+'.'+_0x5176cd,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x859f('0x3d'),_0x859f('0x27'),'\x22'+_0x494f44+'\x22'];var _0x10407c=squel['insert']()['into'](_0x859f('0x2a'))[_0x859f('0x2b')]([_0x859f('0xf'),_0x859f('0x2c'),_0x859f('0x2d'),'ListId',_0x5176cd,'createdAt',_0x859f('0x2f'),_0x859f('0x3e'),'UserId',_0x859f('0x30')],squel[_0x859f('0xd')]()['fields'](_0x10317e)[_0x859f('0x10')](_0x559819)[_0x859f('0x14')](_0x859f('0x3a'),null,_0x859f('0x32')+_0x559819+_0x859f('0x33'))[_0x859f('0x14')](_0x5007da,null,_0x5007da+_0x859f('0x11')+_0x559819+'.'+_0x5176cd)['join'](_0x5031e7,null,_0x5031e7+'.id\x20=\x20'+_0x559819+'.'+_0x5176cd)[_0x859f('0x12')](_0x559819+_0x859f('0x34'),_0x5dd4d0)[_0x859f('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x859f('0x36'),selectNotIn(_0x559819,_0x5007da,_0x5176cd,_0x859f('0x2a'),[_0x859f('0x3f'),_0x859f('0x37')]))[_0x859f('0x12')](_0x859f('0x36'),selectNotIn(_0x559819,_0x5007da,_0x5176cd,_0x859f('0x2a'),['\x22always\x22'])))[_0x859f('0x40')]();return _0x10407c;}function insertTzCmHopperBlack(_0x39d77f,_0x43e569,_0x4273bc,_0x4de654){var _0x251f66=[_0x859f('0x22'),'cm_contacts.id',_0x859f('0x24'),_0x43e569+'.'+_0x4de654,'cm_contacts.createdAt',_0x859f('0x26')];return squel[_0x859f('0x28')]()['into'](_0x859f('0x38'))[_0x859f('0x2b')]([_0x859f('0xf'),_0x859f('0x2d'),'ListId',_0x4de654,_0x859f('0x2e'),_0x859f('0x2f')],squel['select']()[_0x859f('0x31')](_0x251f66)['from'](_0x43e569)['join']('cm_contacts',null,_0x859f('0x32')+_0x43e569+_0x859f('0x33'))['join'](_0x4273bc,null,_0x4273bc+_0x859f('0x11')+_0x43e569+'.'+_0x4de654)[_0x859f('0x12')](_0x43e569+_0x859f('0x34'),_0x39d77f)[_0x859f('0x12')](_0x859f('0x35'),NOW)[_0x859f('0x12')](_0x859f('0x36'),squel['select']()['field'](_0x859f('0xf'))[_0x859f('0x10')](_0x859f('0x38'))[_0x859f('0x12')]('ListId\x20=\x20?',_0x39d77f)[_0x859f('0x12')](_0x4de654+_0x859f('0x3b')+_0x43e569+'.'+_0x4de654)))[_0x859f('0x40')]();}function insertCmHopperAdditionalPhones(_0x93c014){var _0x4cef11=[_0x859f('0x41'),_0x859f('0x42'),_0x859f('0x43'),_0x859f('0x44'),_0x859f('0x45')];return squel[_0x859f('0x28')]()[_0x859f('0x29')](_0x859f('0x46'))[_0x859f('0x2b')]([_0x859f('0x47'),'phone',_0x859f('0x48'),_0x859f('0x2e'),_0x859f('0x2f')],squel[_0x859f('0xd')]()[_0x859f('0x31')](_0x4cef11)[_0x859f('0x10')](_0x859f('0x2a'))['join'](_0x859f('0x3a'),null,_0x859f('0x49'))['join'](_0x859f('0x4a'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x859f('0x4b'),_0x93c014)[_0x859f('0x12')](_0x859f('0x35'),NOW))[_0x859f('0x40')]();}function insertCmContact(_0x5634ef,_0x3ac097,_0x2b6c5f,_0x8e492f){var _0x5d4ad8=_['concat'](_[_0x859f('0x4c')](_0x8e492f),['ListId',_0x859f('0x4d'),_0x859f('0x2e'),_0x859f('0x2f')]);return squel[_0x859f('0x28')]()[_0x859f('0x29')](_0x859f('0x3a'))[_0x859f('0x2b')](_0x5d4ad8,squel[_0x859f('0xd')]()[_0x859f('0x31')](_0x5d4ad8)[_0x859f('0x10')](_0x3ac097)[_0x859f('0x12')]('('+_0x2b6c5f[_0x859f('0x14')](',')+_0x859f('0x4e'),squel[_0x859f('0xd')]()[_0x859f('0x31')](_0x2b6c5f)['from']('cm_contacts')['where']('ListId\x20=\x20?',_0x5634ef)[_0x859f('0x12')](_0x859f('0x4f')))[_0x859f('0x12')](_0x859f('0x50'),squel[_0x859f('0xd')]()[_0x859f('0xe')](_0x859f('0x51'),'min_id')[_0x859f('0x10')](_0x3ac097)[_0x859f('0x52')](_0x2b6c5f[_0x859f('0x14')](','))))[_0x859f('0x40')]();}function handleStop(){logger[_0x859f('0x53')](_0x859f('0x54'));stopped=!![];}function handleUncaughtException(_0x2a010c){logger[_0x859f('0x55')](_0x2a010c[_0x859f('0x56')]);process[_0x859f('0x57')](0x1);}function handleError(_0x182abe,_0x3e4cc0){stats[_0x859f('0x58')]['push']({'name':_0x3e4cc0[_0x859f('0x59')],'message':_0x3e4cc0['message'],'row':_0x182abe});}function handleQuery(_0x2da7e6){logger['info'](_0x2da7e6);return db[_0x859f('0x5a')][_0x859f('0x5b')](_0x2da7e6)[_0x859f('0x5c')](function(_0x29f32a){results[_0x859f('0x1a')](_0x29f32a);})['catch'](function(_0x56031d){logger[_0x859f('0x55')](_0x56031d[_0x859f('0x56')]);});}function updateTzCampaigns(_0x11f0b3){return new Promise(function(_0x5ba25b,_0x4f89ab){var _0x4079de=squel[_0x859f('0xd')]()[_0x859f('0x31')]([_0x859f('0x5d'),'campaigns.dialTimezone'])[_0x859f('0x10')](_0x859f('0x5e'))['join'](_0x859f('0x5f'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x859f('0x12')](_0x859f('0x60')+_0x11f0b3);db['sequelize']['query'](_0x4079de['toString']())['spread'](function(_0x3e241d){var _0xecc38e=[];for(var _0x521063=0x0;_0x521063<_0x3e241d['length'];_0x521063++){_0xecc38e['push'](getTimezoneData(_0x3e241d[_0x521063],tmp_campaigns));}BPromise['all'](_0xecc38e)[_0x859f('0x1f')](function(){_0x5ba25b({'val':0x1});});})[_0x859f('0x61')](function(_0x56248b){logger[_0x859f('0x55')](_0x56248b['message']);_0x5ba25b({'val':0x0});});});}function updateTzVoiceQueues(_0xe301fa){return new Promise(function(_0x543ab1,_0x13289b){var _0x5b3777=squel[_0x859f('0xd')]()[_0x859f('0x31')]([_0x859f('0x62'),_0x859f('0x63')])[_0x859f('0x10')](_0x859f('0x64'))[_0x859f('0x14')]('voice_queues_has_cm_lists',null,_0x859f('0x65'))[_0x859f('0x12')](_0x859f('0x66')+_0xe301fa);db[_0x859f('0x5a')]['query'](_0x5b3777[_0x859f('0x40')]())[_0x859f('0x5c')](function(_0x142bdc){var _0x292bf0=[];for(var _0x28a962=0x0;_0x28a962<_0x142bdc[_0x859f('0x17')];_0x28a962++){_0x292bf0[_0x859f('0x1a')](getTimezoneData(_0x142bdc[_0x28a962],tmp_voice_queues));}BPromise[_0x859f('0x18')](_0x292bf0)[_0x859f('0x1f')](function(){_0x543ab1({'val':0x1});});})[_0x859f('0x61')](function(_0xaf1911){logger[_0x859f('0x55')](_0xaf1911[_0x859f('0x56')]);_0x543ab1({'val':0x0});});});}function getTimezoneData(_0x345163,_0xc6829d){return new Promise(function(_0x3b0bd1,_0x42088a){var _0x3375f0=shared[_0x859f('0x67')];var _0x3ec00d=_0x3375f0[_0x345163[_0x859f('0x68')]];if(_[_0x859f('0x1b')](_0x3ec00d)){_0x3b0bd1({'ret':0x1});}else{var _0x25ff94=_0x3ec00d[_0x859f('0x69')];var _0x9ed741=squel[_0x859f('0x28')]()[_0x859f('0x29')](_0xc6829d)[_0x859f('0x6a')]('id',_0x345163['id'])[_0x859f('0x6a')]('offset',_0x25ff94)['set'](_0x859f('0x68'),_0x345163[_0x859f('0x68')])[_0x859f('0x40')]();return db['sequelize'][_0x859f('0x5b')](_0x9ed741)[_0x859f('0x5c')](function(_0x5c778d){_0x3b0bd1({'ret':0x1});})['catch'](function(_0x4ba079){logger[_0x859f('0x55')](_0x4ba079[_0x859f('0x56')]);_0x42088a({'ret':0x1});});}});}function handleTZQuery(_0x309906){logger['info'](_0x309906);return db[_0x859f('0x5a')]['query'](_0x309906)[_0x859f('0x5c')](function(_0x3ef8e4){})[_0x859f('0x61')](function(_0x41e29e){logger[_0x859f('0x55')](_0x41e29e[_0x859f('0x56')]);});}function main(_0x2e03ac,_0x8d255d,_0x1076bb,_0x1de519){logger[_0x859f('0x53')](_0x859f('0x6b'),_0x2e03ac,JSON[_0x859f('0x6c')](_0x8d255d));process[_0x859f('0x6d')](_0x859f('0x6e'));var _0x2644b1=_0x8d255d['binding'];var _0x3d8b35=_[_0x859f('0x6f')](_0x2644b1);var _0x47ab1b=_0x8d255d[_0x859f('0x70')];var _0x46e2af=path[_0x859f('0x14')](config[_0x859f('0x71')],_0x859f('0x72'),_0x47ab1b+_0x859f('0x73'));hasTZ=_[_0x859f('0x4c')](_0x2644b1)[_0x859f('0x74')]('dialTimezone');var _0x2f7288=_[_0x859f('0x4c')](_0x2644b1)[_0x859f('0x14')]();logger[_0x859f('0x53')](_0x859f('0x75'),_0x2f7288);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x859f('0x76')]})[_0x859f('0x1f')](function(_0x377d6a){for(var _0x3cc218=0x0;_0x3cc218<_0x377d6a[_0x859f('0x17')];_0x3cc218++){if(_0x377d6a[_0x3cc218]['name']in _0x2644b1){contactItemTypes['push'](_0x377d6a[_0x3cc218]);delete _0x3d8b35[_0x377d6a[_0x3cc218][_0x859f('0x76')]];hasAdditionalPhones=!![];}for(var _0x323f62 in _0x2644b1){if(_0x377d6a[_0x3cc218][_0x859f('0x76')]+_0x859f('0x77')===_0x323f62){phoneDescriptions['push']({'itemTypeId':_0x377d6a[_0x3cc218]['id'],'description':_0x323f62});delete _0x3d8b35[_0x323f62];}}}if(hasAdditionalPhones)_0x3d8b35['AdditionalPhones']='';var _0x4a2f5f=_[_0x859f('0x4c')](_0x3d8b35)['join']();logger[_0x859f('0x53')](_0x859f('0x75'),_0x4a2f5f);fs[_0x859f('0x78')](_0x46e2af,_0x4a2f5f+'\x0a');Papa[_0x859f('0x79')](fs[_0x859f('0x7a')](_0x2e03ac),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1581b3,_0x388e89){try{for(var _0x468b06=0x0,_0x2fde6d=[];_0x468b06<_0x1581b3[_0x859f('0x7b')][_0x859f('0x17')];_0x468b06++){stats[_0x859f('0x7c')]+=0x1;if(_0x1581b3[_0x859f('0x58')][_0x468b06]){handleError(_0x1581b3[_0x859f('0x7b')][_0x468b06],_0x1581b3['errors'][_0x468b06]);}else{var _0x2f36bb=[];var _0x48c0a6=[];var _0x5ad158={};for(var _0x79211 in _0x2644b1){let _0x3a314d=contactItemTypes[_0x859f('0x7d')](_0x2a9c32=>_0x2a9c32[_0x859f('0x76')]===_0x79211);let _0x1f82a9=contactItemTypes['find'](_0x3cef8b=>_0x3cef8b[_0x859f('0x76')]+_0x859f('0x77')===_0x79211);if(_['isNil'](_0x3a314d)&&_['isNil'](_0x1f82a9)){if(_0x2644b1[_0x859f('0x7e')](_0x79211)){if(_0x1581b3[_0x859f('0x7b')][_0x468b06][_0x2644b1[_0x79211]]){var _0x2ec559=_[_0x859f('0x7f')](_0x1581b3[_0x859f('0x7b')][_0x468b06][_0x2644b1[_0x79211]][_0x859f('0x80')](/"/g,'\x27'));switch(_0x79211){case _0x859f('0x2c'):var _0x27650a=moment(_0x2ec559,_0x859f('0xb'),!![]);if(_0x27650a[_0x859f('0x81')]()){_0x2fde6d[_0x859f('0x1a')]('\x22'+_0x2ec559+'\x22');}else{_0x2f36bb['push'](_0x859f('0x82'));}break;case _0x859f('0x3e'):var _0x458538=parseInt(_0x2ec559);_0x2ec559=_[_0x859f('0x83')](_0x458538)||_0x458538<0x0||_0x458538>0x4?_0x1de519?0x3:0x2:_0x458538;_0x2fde6d[_0x859f('0x1a')]('\x22'+_0x2ec559+'\x22');break;case'UserId':var _0x32cc7c=parseInt(_0x2ec559);if(_[_0x859f('0x84')](_0x32cc7c)&&_[_0x859f('0x74')](_0x1076bb,_0x32cc7c)){_0x2fde6d[_0x859f('0x1a')]('\x22'+_0x32cc7c+'\x22');}else{_0x2f36bb[_0x859f('0x1a')](_0x859f('0x85'));}break;case _0x859f('0x86'):if(isEmail(_0x2ec559)){_0x2fde6d['push']('\x22'+_0x2ec559+'\x22');}else{_0x2f36bb[_0x859f('0x1a')]('email\x20wrong\x20format');}break;case _0x859f('0x87'):var _0x52b408=moment(_0x2ec559,'YYYY-MM-DD',!![]);if(_0x52b408[_0x859f('0x81')]()){_0x2fde6d[_0x859f('0x1a')]('\x22'+_0x2ec559+'\x22');}else{_0x2f36bb[_0x859f('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x859f('0x68'):var _0x2be517=shared[_0x859f('0x67')];var _0x4e0f0e=_0x2be517[_0x2ec559];if(!_[_0x859f('0x1b')](_0x4e0f0e)){var _0x2bf788=_0x4e0f0e[_0x859f('0x69')];_0x2fde6d['push']('\x22'+_0x2ec559+'\x22');_0x2fde6d[_0x859f('0x1a')]('\x22'+_0x2bf788+'\x22');}break;default:_0x2fde6d[_0x859f('0x1a')]('\x22'+_0x2ec559+'\x22');}}else{switch(_0x79211){case _0x859f('0x88'):case _0x859f('0xf'):_0x2f36bb['push'](_0x79211+'\x20not\x20specified');break;default:_0x2fde6d['push']('\x22\x22');}}}}else{var _0xed82b7='';if(!_[_0x859f('0x1b')](_0x3a314d)){if(!_0x5ad158[_0x859f('0x7e')](_0x3a314d['id'])){if(!_['isNil'](_0x1581b3['data'][_0x468b06][_0x2644b1[_0x79211]])){var _0x2ec559=_['trim'](_0x1581b3['data'][_0x468b06][_0x2644b1[_0x79211]]['replace'](/"/g,'\x27'));var _0x2a89bb=phoneDescriptions[_0x859f('0x7d')](_0x7993f2=>_0x7993f2[_0x859f('0x89')]===_0x3a314d['id']);if(!_['isNil'](_0x2a89bb)){var _0x405d25=_[_0x859f('0x7f')](_0x1581b3[_0x859f('0x7b')][_0x468b06][_0x2644b1[_0x2a89bb['description']]][_0x859f('0x80')](/"/g,'\x27'));if(!_[_0x859f('0x1b')](_0x405d25))_0x2ec559=_0x2ec559+'§'+_0x405d25;}if(_0xed82b7=='')_0xed82b7=_0x2ec559;else _0xed82b7+='|'+_0x2ec559;}_0x48c0a6[_0x859f('0x1a')](_0x3a314d['id']+':'+_0xed82b7);_0x5ad158[_0x3a314d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2fde6d[_0x859f('0x1a')]('\x22'+_0x48c0a6[_0x859f('0x14')](';')+'\x22');}if(_0x2f36bb[_0x859f('0x17')]){handleError(_0x1581b3[_0x859f('0x7b')][_0x468b06],{'code':'SystemRow','message':_0x2f36bb[_0x859f('0x14')]()});}else{fs[_0x859f('0x8a')](_0x46e2af,_0x2fde6d[_0x859f('0x14')]()+'\x0a');}_0x2fde6d=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x47ab1b,stats);stats[_0x859f('0x58')]=[];}}if(stopped){logger['info'](_0x859f('0x8b'));_0x388e89[_0x859f('0x8c')]();}}catch(_0x10dee7){handleError(_0x1581b3[_0x859f('0x7b')][_0x468b06],{'code':_0x859f('0x8d'),'message':_0x10dee7[_0x859f('0x56')]});logger[_0x859f('0x55')]('step',_0x10dee7[_0x859f('0x56')]);}},'complete':function(){try{var _0x3bf201=[];var _0x2b9c02=[];var _0x1dab9a=_0x859f('0x3a');if(_0x8d255d[_0x859f('0x8e')]&&_0x8d255d[_0x859f('0x8e')]['length']){_0x1dab9a=_0x859f('0x8f')+_0x47ab1b;_0x3bf201[_0x859f('0x1a')](_0x859f('0x90')+_0x1dab9a+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x859f('0x91')+_0x47ab1b;tmp_voice_queues='voice_queues_'+_0x47ab1b;_0x2b9c02[_0x859f('0x1a')](_0x859f('0x90')+tmp_campaigns+_0x859f('0x92'));_0x2b9c02[_0x859f('0x1a')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x859f('0x92'));BPromise[_0x859f('0x93')](_0x2b9c02,handleTZQuery)[_0x859f('0x1f')](function(_0x366012){updateTzCampaigns(_0x8d255d[_0x859f('0x39')])[_0x859f('0x1f')](function(_0x37f3f0){updateTzVoiceQueues(_0x8d255d['ListId'])['then'](function(_0x248084){if(hasTZ)_0x4a2f5f=_0x4a2f5f['replace'](_0x859f('0x68'),_0x859f('0x94'));var _0x1dec05=util[_0x859f('0xa')]('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',_0x46e2af,_0x1dab9a,_0x4a2f5f,_0x8d255d['ListId'],_0x8d255d[_0x859f('0x4d')]||null,NOW,NOW);if(_[_0x859f('0x1b')](_0x2644b1['scheduledat'])){_0x1dec05+=_0x859f('0x95');}_0x3bf201[_0x859f('0x1a')](_0x1dec05);if(_0x8d255d['duplicates']&&_0x8d255d[_0x859f('0x8e')][_0x859f('0x17')]){_0x3bf201[_0x859f('0x1a')](insertCmContact(_0x8d255d[_0x859f('0x39')],_0x1dab9a,_0x8d255d[_0x859f('0x8e')],_0x2644b1));_0x3bf201[_0x859f('0x1a')](_0x859f('0x96')+_0x1dab9a+';');}BPromise[_0x859f('0x93')](_0x3bf201,handleQuery)[_0x859f('0x1f')](function(_0x5a673f){BPromise['all']([handleAdditionalPhones()])[_0x859f('0x1f')](function(){_0x3bf201=[];for(var _0x52760a=0x0;_0x52760a\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','phone','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','CmContactHasItem','update','updated','create','inserted','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','UserId','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','ListId','field','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','CompanyId','into',')\x20NOT\x20IN\x20?'];(function(_0x102de9,_0x13079d){var _0x1cb5bf=function(_0x4d9327){while(--_0x4d9327){_0x102de9['push'](_0x102de9['shift']());}};_0x1cb5bf(++_0x13079d);}(_0xa064,0x192));var _0x4a06=function(_0x4e1d3c,_0x4f9988){_0x4e1d3c=_0x4e1d3c-0x0;var _0x5177b2=_0xa064[_0x4e1d3c];return _0x5177b2;};'use strict';var fs=require('fs');var path=require(_0x4a06('0x0'));var _=require(_0x4a06('0x1'));var Papa=require(_0x4a06('0x2'));var util=require(_0x4a06('0x3'));var BPromise=require(_0x4a06('0x4'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x4a06('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x4a06('0x6'));var logger=require(_0x4a06('0x7'))('import');config[_0x4a06('0x8')]=_[_0x4a06('0x9')](config['redis'],{'host':_0x4a06('0xa'),'port':0x18eb});var socket=require(_0x4a06('0xb'))(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()['format'](_0x4a06('0xc'));var tempTableName=_0x4a06('0xd')+moment()[_0x4a06('0xe')](_0x4a06('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x51079c){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))*$/[_0x4a06('0x10')](_0x51079c);}function selectNotIn(_0x1b8308,_0x40bf75,_0x1bcc38,_0x2f5762,_0x455225){return squel[_0x4a06('0x11')]()['field'](_0x4a06('0x12'))['from'](_0x2f5762)[_0x4a06('0x13')](_0x40bf75,null,_0x40bf75+_0x4a06('0x14')+_0x2f5762+'.'+_0x1bcc38)[_0x4a06('0x15')](_0x2f5762+'.'+_0x1bcc38+'\x20=\x20'+_0x1b8308+'.'+_0x1bcc38)[_0x4a06('0x15')](_0x40bf75+_0x4a06('0x16')+_0x455225[_0x4a06('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x569aed,_0x338545){promisesAdditionalPhones=[];promisesContact=[];return db[_0x4a06('0x17')][_0x4a06('0x18')]('select\x20*\x20from\x20'+tempTableName)[_0x4a06('0x19')](function(_0x29e99b){if(_0x29e99b!==null){var _0xa2655c=[];for(var _0x3574e9=0x0;_0x3574e9<_0x29e99b[_0x4a06('0x1a')];_0x3574e9++){var _0x4b05f4=_0x29e99b[_0x3574e9];if(!_[_0x4a06('0x1b')](_0x4b05f4['phone'])){if(!_[_0x4a06('0x1b')](_0x4b05f4[_0x4a06('0x1c')]))_0xa2655c[_0x4a06('0x1d')](insertAdditionalPhones(_0x4b05f4));promisesContact[_0x4a06('0x1d')]({'contact':_0x4b05f4});}}}Promise[_0x4a06('0x1e')](_0xa2655c)[_0x4a06('0x1f')](function(){_0x569aed({'val':0x1});});})[_0x4a06('0x20')](function(_0x39c640){logger[_0x4a06('0x21')](_0x39c640[_0x4a06('0x22')]);});});}function insertAdditionalPhones(_0x4a53e0){return new Promise(function(_0x98df26,_0x3933e6){var _0x321127=_0x4a53e0[_0x4a06('0x1c')];if(_[_0x4a06('0x1b')](_0x321127))_0x3933e6({'val':0x0});else{var _0x2822d6=_0x321127[_0x4a06('0x23')](';');var _0x156af7=[];orderBy=0x0;for(var _0xae7471=0x0;_0xae7471<_0x2822d6[_0x4a06('0x1a')];_0xae7471++){_0x156af7[_0x4a06('0x1d')](splitAdditionalPhone(_0x4a53e0['id'],_0x2822d6[_0xae7471]));}Promise[_0x4a06('0x1e')](_0x156af7)[_0x4a06('0x1f')](function(){_0x98df26({'val':_0x2822d6['length']});});}});}function splitAdditionalPhone(_0x501ee9,_0x3c5fba){return new Promise(function(_0x2ad64a,_0x272544){var _0x166f02=_0x3c5fba['split'](':');var _0x5e8af0=_0x166f02[0x0];var _0xf7e565=_0x166f02[0x1];if(_0xf7e565!==''){var _0x33c2f0=_0xf7e565['split']('|');var _0xdf5163=[];for(var _0x54613e=0x0;_0x54613e<_0x33c2f0[_0x4a06('0x1a')];_0x54613e++){if(_0x33c2f0[_0x54613e]!==''){var _0xa48043=_['filter'](promisesAdditionalPhones,{'contactId':_0x501ee9,'phone':_0x33c2f0[_0x54613e]});if(_0xa48043[_0x4a06('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x4a06('0x1d')]({'contactId':_0x501ee9,'contactTypeId':_0x5e8af0,'phone':_0x33c2f0[_0x54613e],'orderBy':orderBy});}}}_0x2ad64a({'ok':0x1});}else _0x2ad64a({'res':0x0});});}function createAdditionalPhone(_0x1be810,_0x180e95,_0x1c14d3,_0x37cb33){var _0x5ee187='';var _0x255924='';var _0x452188=_0x1c14d3[_0x4a06('0x23')]('§');_0x5ee187=_0x452188[0x0];if(_0x452188['length']==0x2)_0x255924=_0x452188[0x1];return new Promise(function(_0x3659ef,_0x1c97ef){return db[_0x4a06('0x24')]['findOne']({'where':{'CmContactId':_0x1be810,'item':_0x5ee187}})['then'](function(_0x424e8e){if(_0x424e8e){return db[_0x4a06('0x24')][_0x4a06('0x25')]({'ItemTypeId':_0x180e95,'description':_0x255924,'OrderBy':_0x37cb33},{'where':{'CmContactId':_0x1be810,'item':_0x5ee187}})[_0x4a06('0x1f')](function(_0x2870f4){_0x3659ef({'res':_0x4a06('0x26')});});}else{return db[_0x4a06('0x24')][_0x4a06('0x27')]({'CmContactId':_0x1be810,'item':_0x5ee187,'ItemTypeId':_0x180e95,'description':_0x255924,'OrderBy':_0x37cb33,'ItemClass':'PHONE'})[_0x4a06('0x1f')](function(_0x34b300){_0x3659ef({'res':_0x4a06('0x28')});});}});});}function updateContact(_0x2f2953){return new Promise(function(_0x1615e5,_0x50cc59){var _0x3d0928=_0x2f2953['id'];delete _0x2f2953['id'];return db['CmContact'][_0x4a06('0x25')](_0x2f2953,{'where':{'id':_0x3d0928}})[_0x4a06('0x1f')](function(_0x4c0d58){updatedRows+=0x1;return db[_0x4a06('0x29')][_0x4a06('0x25')]({'phone':_0x2f2953[_0x4a06('0x12')]},{'where':{'ContactId':_0x3d0928}})[_0x4a06('0x1f')](function(_0x178a57){_0x1615e5({'ret':'OK'});});});});}function insertCmHopper(_0x4de43c,_0x1732f3,_0x528d62,_0x202502,_0x1abeee){var _0x32d5b8=['cm_contacts.phone',_0x4a06('0x2a'),_0x4a06('0x2b'),_0x4a06('0x2c'),_0x1732f3+'.'+_0x202502,_0x4a06('0x2d'),_0x4a06('0x2e'),_0x4a06('0x2f'),'cm_contacts.UserId','\x22'+_0x1abeee+'\x22'];return squel[_0x4a06('0x30')]()['into'](_0x4a06('0x31'))[_0x4a06('0x32')]([_0x4a06('0x12'),'scheduledat',_0x4a06('0x33'),'ListId',_0x202502,_0x4a06('0x34'),_0x4a06('0x35'),'priority',_0x4a06('0x36'),_0x4a06('0x37')],squel[_0x4a06('0x11')]()[_0x4a06('0x38')](_0x32d5b8)[_0x4a06('0x39')](_0x1732f3)[_0x4a06('0x13')](_0x4a06('0x3a'),null,_0x4a06('0x3b')+_0x1732f3+_0x4a06('0x3c'))['join'](_0x528d62,null,_0x528d62+'.id\x20=\x20'+_0x1732f3+'.'+_0x202502)[_0x4a06('0x15')](_0x1732f3+_0x4a06('0x3d'),_0x4de43c)[_0x4a06('0x15')](_0x4a06('0x3e'),NOW)[_0x4a06('0x15')](_0x4a06('0x3f'),selectNotIn(_0x1732f3,_0x528d62,_0x202502,_0x4a06('0x31'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x4a06('0x15')](_0x4a06('0x3f'),selectNotIn(_0x1732f3,_0x528d62,_0x202502,_0x4a06('0x31'),[_0x4a06('0x40')])))[_0x4a06('0x41')]();}function insertCmHopperBlack(_0x534227,_0x18dbe9,_0x538c73,_0x35fb1b){var _0xf71ee=[_0x4a06('0x42'),_0x4a06('0x2b'),'cm_contacts.ListId',_0x18dbe9+'.'+_0x35fb1b,_0x4a06('0x2d'),_0x4a06('0x2e')];return squel[_0x4a06('0x30')]()['into'](_0x4a06('0x43'))[_0x4a06('0x32')]([_0x4a06('0x12'),'ContactId',_0x4a06('0x44'),_0x35fb1b,_0x4a06('0x34'),_0x4a06('0x35')],squel[_0x4a06('0x11')]()[_0x4a06('0x38')](_0xf71ee)[_0x4a06('0x39')](_0x18dbe9)[_0x4a06('0x13')](_0x4a06('0x3a'),null,_0x4a06('0x3b')+_0x18dbe9+_0x4a06('0x3c'))[_0x4a06('0x13')](_0x538c73,null,_0x538c73+_0x4a06('0x14')+_0x18dbe9+'.'+_0x35fb1b)[_0x4a06('0x15')](_0x18dbe9+'.CmListId\x20=\x20?',_0x534227)[_0x4a06('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x4a06('0x15')](_0x4a06('0x3f'),squel[_0x4a06('0x11')]()[_0x4a06('0x45')](_0x4a06('0x12'))['from'](_0x4a06('0x43'))[_0x4a06('0x15')](_0x4a06('0x46'),_0x534227)['where'](_0x35fb1b+_0x4a06('0x47'),_0x18dbe9+'.'+_0x35fb1b)))[_0x4a06('0x41')]();}function insertCmHopperAdditionalPhones(_0x23e2b0){var _0x5e3ace=[_0x4a06('0x48'),_0x4a06('0x49'),_0x4a06('0x4a'),_0x4a06('0x4b'),_0x4a06('0x4c')];return squel[_0x4a06('0x30')]()['into'](_0x4a06('0x4d'))[_0x4a06('0x32')]([_0x4a06('0x4e'),_0x4a06('0x12'),_0x4a06('0x4f'),_0x4a06('0x34'),'updatedAt'],squel[_0x4a06('0x11')]()['fields'](_0x5e3ace)['from'](_0x4a06('0x31'))[_0x4a06('0x13')](_0x4a06('0x3a'),null,_0x4a06('0x50'))[_0x4a06('0x13')](_0x4a06('0x51'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x4a06('0x15')](_0x4a06('0x52'),_0x23e2b0)['where'](_0x4a06('0x3e'),NOW))['toString']();}function insertCmContact(_0x53cd83,_0x4104a2,_0x574a0d,_0x2d45fe){var _0x24c759=_[_0x4a06('0x53')](_['keys'](_0x2d45fe),[_0x4a06('0x44'),_0x4a06('0x54'),_0x4a06('0x34'),'updatedAt']);return squel['insert']()[_0x4a06('0x55')]('cm_contacts')[_0x4a06('0x32')](_0x24c759,squel[_0x4a06('0x11')]()[_0x4a06('0x38')](_0x24c759)[_0x4a06('0x39')](_0x4104a2)[_0x4a06('0x15')]('('+_0x574a0d[_0x4a06('0x13')](',')+_0x4a06('0x56'),squel[_0x4a06('0x11')]()[_0x4a06('0x38')](_0x574a0d)[_0x4a06('0x39')]('cm_contacts')[_0x4a06('0x15')](_0x4a06('0x46'),_0x53cd83))['where'](_0x4a06('0x57'),squel[_0x4a06('0x11')]()[_0x4a06('0x45')](_0x4a06('0x58'),_0x4a06('0x59'))['from'](_0x4104a2)[_0x4a06('0x5a')](_0x574a0d['join'](','))))[_0x4a06('0x41')]();}function handleStop(){logger[_0x4a06('0x5b')](_0x4a06('0x5c'));stopped=!![];}function handleUncaughtException(_0xe9ad46){logger['error'](_0xe9ad46[_0x4a06('0x22')]);process[_0x4a06('0x5d')](0x1);}function handleError(_0x31fffe,_0x4ce025){stats[_0x4a06('0x5e')][_0x4a06('0x1d')]({'name':_0x4ce025['code'],'message':_0x4ce025['message'],'row':_0x31fffe});}function handleQuery(_0x4e102e){logger[_0x4a06('0x5b')](_0x4e102e);return db[_0x4a06('0x17')][_0x4a06('0x18')](_0x4e102e)[_0x4a06('0x19')](function(_0x140432){results[_0x4a06('0x1d')](_0x140432);})[_0x4a06('0x20')](function(_0x150e76){logger[_0x4a06('0x21')](_0x150e76[_0x4a06('0x22')]);});}function main(_0x21bbbe,_0x370c42,_0x136f3f,_0x4909d4){logger['info']('main',_0x21bbbe,JSON[_0x4a06('0x5f')](_0x370c42));process[_0x4a06('0x60')]('start');var _0x5de3e5=_0x370c42[_0x4a06('0x61')];var _0x35b7da=_[_0x4a06('0x62')](_0x5de3e5);var _0x135e18=_0x370c42[_0x4a06('0x63')];var _0xc2d7a8=path[_0x4a06('0x13')](config[_0x4a06('0x64')],_0x4a06('0x65'),_0x135e18+_0x4a06('0x66'));logger[_0x4a06('0x5b')](_0x4a06('0x67'),_0x370c42);db[_0x4a06('0x68')][_0x4a06('0x69')]({'raw':!![],'attributes':['id',_0x4a06('0x6a')]})[_0x4a06('0x1f')](function(_0x2da75a){for(var _0x10cc7f=0x0;_0x10cc7f<_0x2da75a['length'];_0x10cc7f++){if(_0x2da75a[_0x10cc7f][_0x4a06('0x6a')]in _0x5de3e5){contactItemTypes[_0x4a06('0x1d')](_0x2da75a[_0x10cc7f]);delete _0x35b7da[_0x2da75a[_0x10cc7f][_0x4a06('0x6a')]];hasAdditionalPhones=!![];}for(var _0x453bed in _0x5de3e5){if(_0x2da75a[_0x10cc7f][_0x4a06('0x6a')]+'_description'===_0x453bed){phoneDescriptions['push']({'itemTypeId':_0x2da75a[_0x10cc7f]['id'],'description':_0x453bed});delete _0x35b7da[_0x453bed];}}}if(hasAdditionalPhones)_0x35b7da['AdditionalPhones']='';var _0x30fff6=_[_0x4a06('0x6b')](_0x35b7da)[_0x4a06('0x13')]();logger[_0x4a06('0x5b')](_0x4a06('0x6c'),_0x30fff6);fs['writeFileSync'](_0xc2d7a8,_0x30fff6+'\x0a');Papa[_0x4a06('0x6d')](fs[_0x4a06('0x6e')](_0x21bbbe),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3138ba,_0x5cadb4){try{for(var _0x228069=0x0,_0x187650=[];_0x228069<_0x3138ba['data'][_0x4a06('0x1a')];_0x228069++){stats[_0x4a06('0x6f')]+=0x1;if(_0x3138ba[_0x4a06('0x5e')][_0x228069]){handleError(_0x3138ba[_0x4a06('0x70')][_0x228069],_0x3138ba[_0x4a06('0x5e')][_0x228069]);}else{var _0x2a2c1b=[];var _0x28451b=[];var _0x30aeca={};for(var _0x50462d in _0x5de3e5){let _0x5aca4d=contactItemTypes[_0x4a06('0x71')](_0x2bdddf=>_0x2bdddf[_0x4a06('0x6a')]===_0x50462d);let _0x43edc2=contactItemTypes[_0x4a06('0x71')](_0x39cbbb=>_0x39cbbb[_0x4a06('0x6a')]+'_description'===_0x50462d);if(_[_0x4a06('0x1b')](_0x5aca4d)&&_[_0x4a06('0x1b')](_0x43edc2)){if(_0x5de3e5[_0x4a06('0x72')](_0x50462d)){if(_0x3138ba['data'][_0x228069][_0x5de3e5[_0x50462d]]){var _0x5aa125=_['trim'](_0x3138ba['data'][_0x228069][_0x5de3e5[_0x50462d]][_0x4a06('0x73')](/"/g,'\x27'));switch(_0x50462d){case'scheduledat':var _0x5fc253=moment(_0x5aa125,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5fc253['isValid']()){_0x187650[_0x4a06('0x1d')]('\x22'+_0x5aa125+'\x22');}else{_0x2a2c1b[_0x4a06('0x1d')](_0x4a06('0x74'));}break;case _0x4a06('0x75'):var _0x5bf1ae=parseInt(_0x5aa125);_0x5aa125=_[_0x4a06('0x76')](_0x5bf1ae)||_0x5bf1ae<0x0||_0x5bf1ae>0x4?_0x4909d4?0x3:0x2:_0x5bf1ae;_0x187650[_0x4a06('0x1d')]('\x22'+_0x5aa125+'\x22');break;case _0x4a06('0x36'):var _0x1d9923=parseInt(_0x5aa125);if(_[_0x4a06('0x77')](_0x1d9923)&&_[_0x4a06('0x78')](_0x136f3f,_0x1d9923)){_0x187650[_0x4a06('0x1d')]('\x22'+_0x1d9923+'\x22');}else{_0x2a2c1b['push'](_0x4a06('0x79'));}break;case _0x4a06('0x7a'):if(isEmail(_0x5aa125)){_0x187650[_0x4a06('0x1d')]('\x22'+_0x5aa125+'\x22');}else{_0x2a2c1b['push'](_0x4a06('0x7b'));}break;case _0x4a06('0x7c'):var _0x3abf4a=moment(_0x5aa125,_0x4a06('0x7d'),!![]);if(_0x3abf4a[_0x4a06('0x7e')]()){_0x187650[_0x4a06('0x1d')]('\x22'+_0x5aa125+'\x22');}else{_0x2a2c1b[_0x4a06('0x1d')](_0x4a06('0x7f'));}break;default:_0x187650[_0x4a06('0x1d')]('\x22'+_0x5aa125+'\x22');}}else{switch(_0x50462d){case _0x4a06('0x80'):case _0x4a06('0x12'):_0x2a2c1b[_0x4a06('0x1d')](_0x50462d+_0x4a06('0x81'));break;default:_0x187650[_0x4a06('0x1d')]('\x22\x22');}}}}else{var _0x53df96='';if(!_[_0x4a06('0x1b')](_0x5aca4d)){if(!_0x30aeca['hasOwnProperty'](_0x5aca4d['id'])){for(var _0xd7c141=0x0;_0xd7c141<_0x5de3e5[_0x50462d][_0x4a06('0x1a')];_0xd7c141++){var _0x5aa125=_[_0x4a06('0x82')](_0x3138ba[_0x4a06('0x70')][_0x228069][_0x5de3e5[_0x50462d][_0xd7c141]][_0x4a06('0x73')](/"/g,'\x27'));var _0x310d2a=phoneDescriptions[_0x4a06('0x71')](_0x1dc176=>_0x1dc176[_0x4a06('0x83')]===_0x5aca4d['id']);if(!_[_0x4a06('0x1b')](_0x310d2a)){var _0x5a425a=_[_0x4a06('0x82')](_0x3138ba[_0x4a06('0x70')][_0x228069][_0x5de3e5[_0x310d2a[_0x4a06('0x84')]][0x0]][_0x4a06('0x73')](/"/g,'\x27'));if(!_[_0x4a06('0x1b')](_0x5a425a))_0x5aa125=_0x5aa125+'§'+_0x5a425a;}if(_0x53df96=='')_0x53df96=_0x5aa125;else _0x53df96+='|'+_0x5aa125;}_0x28451b['push'](_0x5aca4d['id']+':'+_0x53df96);_0x30aeca[_0x5aca4d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x187650[_0x4a06('0x1d')]('\x22'+_0x28451b['join'](';')+'\x22');}if(_0x2a2c1b[_0x4a06('0x1a')]){handleError(_0x3138ba[_0x4a06('0x70')][_0x228069],{'code':_0x4a06('0x85'),'message':_0x2a2c1b[_0x4a06('0x13')]()});}else{fs[_0x4a06('0x86')](_0xc2d7a8,_0x187650[_0x4a06('0x13')]()+'\x0a');}_0x187650=[];}if(!(stats[_0x4a06('0x6f')]%0xc8)){socket[_0x4a06('0x87')]('contact:import:'+_0x135e18,stats);stats['errors']=[];}}if(stopped){logger[_0x4a06('0x5b')]('Abort\x20parser');_0x5cadb4[_0x4a06('0x88')]();}}catch(_0x3fc446){handleError(_0x3138ba[_0x4a06('0x70')][_0x228069],{'code':_0x4a06('0x89'),'message':_0x3fc446[_0x4a06('0x22')]});logger[_0x4a06('0x21')](_0x4a06('0x8a'),_0x3fc446[_0x4a06('0x22')]);}},'complete':function(){try{var _0x4254b3=[];var _0x25aa8f=tempTableName;_0x4254b3['push'](_0x4a06('0x8b')+_0x25aa8f+'\x20LIKE\x20cm_contacts;');logger[_0x4a06('0x5b')](_0x4a06('0x8c'),contactItemTypes['length']);var _0x5cca91=util[_0x4a06('0xe')](_0x4a06('0x8d'),_0xc2d7a8,_0x25aa8f,_0x30fff6,_0x370c42[_0x4a06('0x44')],_0x370c42[_0x4a06('0x54')]||null,NOW,NOW);if(_[_0x4a06('0x1b')](_0x5de3e5[_0x4a06('0x8e')])){_0x5cca91+=_0x4a06('0x8f');}_0x4254b3[_0x4a06('0x1d')](_0x5cca91);BPromise[_0x4a06('0x90')](_0x4254b3,handleQuery)['then'](function(_0x35cdea){BPromise[_0x4a06('0x1e')]([handleAdditionalPhones()])[_0x4a06('0x1f')](function(){_0x4254b3=[];for(var _0x24916e=0x0;_0x24916e\x20\x20','root','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','moment','squel','ioredis','../../../mysqldb','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','phone','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','length','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','update','create','PHONE','inserted','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','scheduledat','ContactId','ListId','createdAt','UserId','select','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','into','cm_hopper_black','fromQuery','.CmListId','field','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','updatedAt','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys','CompanyId'];(function(_0x558831,_0x53f42a){var _0x14f097=function(_0x3f1108){while(--_0x3f1108){_0x558831['push'](_0x558831['shift']());}};_0x14f097(++_0x53f42a);}(_0xdac7,0x180));var _0x7dac=function(_0x5996f5,_0x367ef5){_0x5996f5=_0x5996f5-0x0;var _0x2c213c=_0xdac7[_0x5996f5];return _0x2c213c;};'use strict';var fs=require('fs');var path=require(_0x7dac('0x0'));var _=require(_0x7dac('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require('bluebird');var moment=require(_0x7dac('0x2'));var squel=require(_0x7dac('0x3'));var Redis=require(_0x7dac('0x4'));var db=require(_0x7dac('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0x7dac('0x6')]=_[_0x7dac('0x7')](config['redis'],{'host':_0x7dac('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7dac('0x6')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x7dac('0x9'));var tempTableName=_0x7dac('0xa')+moment()[_0x7dac('0xb')](_0x7dac('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x11b680){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))*$/[_0x7dac('0xd')](_0x11b680);}function selectNotIn(_0x27eb87,_0x41e0db,_0x201464,_0x9284f6,_0x4dba13){return squel['select']()['field'](_0x7dac('0xe'))['from'](_0x9284f6)[_0x7dac('0xf')](_0x41e0db,null,_0x41e0db+'.id\x20=\x20'+_0x9284f6+'.'+_0x201464)[_0x7dac('0x10')](_0x9284f6+'.'+_0x201464+_0x7dac('0x11')+_0x27eb87+'.'+_0x201464)[_0x7dac('0x10')](_0x41e0db+_0x7dac('0x12')+_0x4dba13[_0x7dac('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2c5dae,_0x752576){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x7dac('0x13')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x218a2a){if(_0x218a2a!==null){var _0x22177c=[];for(var _0x2b8a27=0x0;_0x2b8a27<_0x218a2a[_0x7dac('0x14')];_0x2b8a27++){var _0xb7740d=_0x218a2a[_0x2b8a27];if(!_['isNil'](_0xb7740d[_0x7dac('0xe')])){if(!_['isNil'](_0xb7740d[_0x7dac('0x15')]))_0x22177c[_0x7dac('0x16')](insertAdditionalPhones(_0xb7740d));promisesContact[_0x7dac('0x16')]({'contact':_0xb7740d});}}}Promise[_0x7dac('0x17')](_0x22177c)[_0x7dac('0x18')](function(){_0x2c5dae({'val':0x1});});})[_0x7dac('0x19')](function(_0x2375c8){logger[_0x7dac('0x1a')](_0x2375c8[_0x7dac('0x1b')]);});});}function insertAdditionalPhones(_0x212fcc){return new Promise(function(_0x18f993,_0xb095bb){var _0x1a9276=_0x212fcc[_0x7dac('0x15')];if(_['isNil'](_0x1a9276))_0xb095bb({'val':0x0});else{var _0x502c05=_0x1a9276[_0x7dac('0x1c')](';');var _0x4c9fda=[];orderBy=0x0;for(var _0x137c18=0x0;_0x137c18<_0x502c05[_0x7dac('0x14')];_0x137c18++){_0x4c9fda['push'](splitAdditionalPhone(_0x212fcc['id'],_0x502c05[_0x137c18]));}Promise[_0x7dac('0x17')](_0x4c9fda)[_0x7dac('0x18')](function(){_0x18f993({'val':_0x502c05['length']});});}});}function splitAdditionalPhone(_0xbdabba,_0x41b3cd){return new Promise(function(_0x341cc8,_0x179881){var _0x31876c=_0x41b3cd[_0x7dac('0x1c')](':');var _0x2b0029=_0x31876c[0x0];var _0x4b5776=_0x31876c[0x1];if(_0x4b5776!==''){var _0x9acd44=_0x4b5776[_0x7dac('0x1c')]('|');var _0x329d14=[];for(var _0x53d660=0x0;_0x53d660<_0x9acd44['length'];_0x53d660++){if(_0x9acd44[_0x53d660]!==''){var _0x456264=_[_0x7dac('0x1d')](promisesAdditionalPhones,{'contactId':_0xbdabba,'phone':_0x9acd44[_0x53d660]});if(_0x456264[_0x7dac('0x14')]==0x0){orderBy++;promisesAdditionalPhones[_0x7dac('0x16')]({'contactId':_0xbdabba,'contactTypeId':_0x2b0029,'phone':_0x9acd44[_0x53d660],'orderBy':orderBy});}}}_0x341cc8({'ok':0x1});}else _0x341cc8({'res':0x0});});}function createAdditionalPhone(_0xbad8a1,_0x3d47e9,_0x3f76fd,_0x31bbf7){var _0xdd98b1='';var _0x184887='';var _0x954909=_0x3f76fd['split']('§');_0xdd98b1=_0x954909[0x0];if(_0x954909['length']==0x2)_0x184887=_0x954909[0x1];return new Promise(function(_0x3168f7,_0xa92c4b){return db[_0x7dac('0x1e')]['findOne']({'where':{'CmContactId':_0xbad8a1,'item':_0xdd98b1}})[_0x7dac('0x18')](function(_0x823620){if(_0x823620){return db[_0x7dac('0x1e')][_0x7dac('0x1f')]({'ItemTypeId':_0x3d47e9,'description':_0x184887,'OrderBy':_0x31bbf7},{'where':{'CmContactId':_0xbad8a1,'item':_0xdd98b1}})['then'](function(_0x282e3d){_0x3168f7({'res':'updated'});});}else{return db[_0x7dac('0x1e')][_0x7dac('0x20')]({'CmContactId':_0xbad8a1,'item':_0xdd98b1,'ItemTypeId':_0x3d47e9,'description':_0x184887,'OrderBy':_0x31bbf7,'ItemClass':_0x7dac('0x21')})['then'](function(_0xad5b0c){_0x3168f7({'res':_0x7dac('0x22')});});}});});}function updateContact(_0x322a45){return new Promise(function(_0x70fa01,_0x1e7f3f){var _0xb0aacd=_0x322a45['id'];delete _0x322a45['id'];return db['CmContact']['update'](_0x322a45,{'where':{'id':_0xb0aacd}})['then'](function(_0x1fffc5){updatedRows+=0x1;return db[_0x7dac('0x23')][_0x7dac('0x1f')]({'phone':_0x322a45['phone']},{'where':{'ContactId':_0xb0aacd}})[_0x7dac('0x18')](function(_0x47aeb7){_0x70fa01({'ret':'OK'});});});});}function insertCmHopper(_0x174e58,_0x493dbc,_0x44f475,_0x2f0613,_0x1300da){var _0x3450d3=['cm_contacts.phone',_0x7dac('0x24'),_0x7dac('0x25'),_0x7dac('0x26'),_0x493dbc+'.'+_0x2f0613,_0x7dac('0x27'),_0x7dac('0x28'),_0x7dac('0x29'),'cm_contacts.UserId','\x22'+_0x1300da+'\x22'];return squel[_0x7dac('0x2a')]()['into'](_0x7dac('0x2b'))['fromQuery']([_0x7dac('0xe'),_0x7dac('0x2c'),_0x7dac('0x2d'),_0x7dac('0x2e'),_0x2f0613,_0x7dac('0x2f'),'updatedAt','priority',_0x7dac('0x30'),'recallme'],squel[_0x7dac('0x31')]()[_0x7dac('0x32')](_0x3450d3)[_0x7dac('0x33')](_0x493dbc)[_0x7dac('0xf')](_0x7dac('0x34'),null,_0x7dac('0x35')+_0x493dbc+'.CmListId')['join'](_0x44f475,null,_0x44f475+_0x7dac('0x36')+_0x493dbc+'.'+_0x2f0613)[_0x7dac('0x10')](_0x493dbc+_0x7dac('0x37'),_0x174e58)[_0x7dac('0x10')](_0x7dac('0x38'),NOW)[_0x7dac('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x493dbc,_0x44f475,_0x2f0613,_0x7dac('0x2b'),[_0x7dac('0x39'),_0x7dac('0x3a')]))[_0x7dac('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x493dbc,_0x44f475,_0x2f0613,_0x7dac('0x2b'),['\x22always\x22'])))[_0x7dac('0x3b')]();}function insertCmHopperBlack(_0x2f593b,_0x3b430f,_0xd9f6ea,_0x1ccf40){var _0x4e7ee0=['cm_contacts.phone',_0x7dac('0x25'),_0x7dac('0x26'),_0x3b430f+'.'+_0x1ccf40,_0x7dac('0x27'),_0x7dac('0x28')];return squel[_0x7dac('0x2a')]()[_0x7dac('0x3c')](_0x7dac('0x3d'))[_0x7dac('0x3e')]([_0x7dac('0xe'),_0x7dac('0x2d'),_0x7dac('0x2e'),_0x1ccf40,'createdAt','updatedAt'],squel[_0x7dac('0x31')]()[_0x7dac('0x32')](_0x4e7ee0)['from'](_0x3b430f)[_0x7dac('0xf')](_0x7dac('0x34'),null,_0x7dac('0x35')+_0x3b430f+_0x7dac('0x3f'))[_0x7dac('0xf')](_0xd9f6ea,null,_0xd9f6ea+'.id\x20=\x20'+_0x3b430f+'.'+_0x1ccf40)[_0x7dac('0x10')](_0x3b430f+_0x7dac('0x37'),_0x2f593b)['where'](_0x7dac('0x38'),NOW)[_0x7dac('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7dac('0x31')]()[_0x7dac('0x40')](_0x7dac('0xe'))[_0x7dac('0x33')](_0x7dac('0x3d'))[_0x7dac('0x10')](_0x7dac('0x41'),_0x2f593b)[_0x7dac('0x10')](_0x1ccf40+_0x7dac('0x42'),_0x3b430f+'.'+_0x1ccf40)))['toString']();}function insertCmHopperAdditionalPhones(_0x2d2c8b){var _0xe61204=[_0x7dac('0x43'),_0x7dac('0x44'),_0x7dac('0x45'),_0x7dac('0x46'),_0x7dac('0x47')];return squel[_0x7dac('0x2a')]()[_0x7dac('0x3c')](_0x7dac('0x48'))[_0x7dac('0x3e')]([_0x7dac('0x49'),_0x7dac('0xe'),_0x7dac('0x4a'),_0x7dac('0x2f'),_0x7dac('0x4b')],squel[_0x7dac('0x31')]()[_0x7dac('0x32')](_0xe61204)['from'](_0x7dac('0x2b'))['join'](_0x7dac('0x34'),null,_0x7dac('0x4c'))['join'](_0x7dac('0x4d'),null,_0x7dac('0x4e'))[_0x7dac('0x10')]('cm_hopper.ListId\x20=\x20?',_0x2d2c8b)[_0x7dac('0x10')](_0x7dac('0x38'),NOW))[_0x7dac('0x3b')]();}function insertCmContact(_0x33909c,_0x7cb821,_0x5f0224,_0x139cc7){var _0x1a831f=_['concat'](_[_0x7dac('0x4f')](_0x139cc7),[_0x7dac('0x2e'),_0x7dac('0x50'),'createdAt',_0x7dac('0x4b')]);return squel[_0x7dac('0x2a')]()[_0x7dac('0x3c')](_0x7dac('0x34'))[_0x7dac('0x3e')](_0x1a831f,squel[_0x7dac('0x31')]()[_0x7dac('0x32')](_0x1a831f)['from'](_0x7cb821)['where']('('+_0x5f0224['join'](',')+_0x7dac('0x51'),squel[_0x7dac('0x31')]()['fields'](_0x5f0224)[_0x7dac('0x33')](_0x7dac('0x34'))[_0x7dac('0x10')](_0x7dac('0x41'),_0x33909c))[_0x7dac('0x10')](_0x7dac('0x52'),squel[_0x7dac('0x31')]()[_0x7dac('0x40')](_0x7dac('0x53'),_0x7dac('0x54'))[_0x7dac('0x33')](_0x7cb821)[_0x7dac('0x55')](_0x5f0224['join'](','))))[_0x7dac('0x3b')]();}function handleStop(){logger[_0x7dac('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3d3773){logger[_0x7dac('0x1a')](_0x3d3773[_0x7dac('0x1b')]);process[_0x7dac('0x57')](0x1);}function handleError(_0x597520,_0x523818){stats[_0x7dac('0x58')][_0x7dac('0x16')]({'name':_0x523818[_0x7dac('0x59')],'message':_0x523818[_0x7dac('0x1b')],'row':_0x597520});}function handleQuery(_0x599815){logger[_0x7dac('0x56')](_0x599815);return db[_0x7dac('0x5a')][_0x7dac('0x13')](_0x599815)['spread'](function(_0x5bc558){results[_0x7dac('0x16')](_0x5bc558);})[_0x7dac('0x19')](function(_0xcbf0ce){logger[_0x7dac('0x1a')](_0xcbf0ce[_0x7dac('0x1b')]);});}function main(_0x49c004,_0x5ee268,_0x4b3d12,_0x137b47){logger[_0x7dac('0x56')](_0x7dac('0x5b'),_0x49c004,JSON[_0x7dac('0x5c')](_0x5ee268));process[_0x7dac('0x5d')]('start');var _0x561e95=_0x5ee268[_0x7dac('0x5e')];var _0x5aa962=_['clone'](_0x561e95);var _0x3a5997=_0x5ee268[_0x7dac('0x5f')];var _0x19f4f2=path[_0x7dac('0xf')](config['root'],_0x7dac('0x60'),_0x3a5997+'.csv');logger[_0x7dac('0x56')](_0x7dac('0x61'),_0x5ee268);db[_0x7dac('0x62')][_0x7dac('0x63')]({'raw':!![],'attributes':['id',_0x7dac('0x64')]})[_0x7dac('0x18')](function(_0x5810b0){for(var _0x5caed0=0x0;_0x5caed0<_0x5810b0[_0x7dac('0x14')];_0x5caed0++){if(_0x5810b0[_0x5caed0][_0x7dac('0x64')]in _0x561e95){contactItemTypes[_0x7dac('0x16')](_0x5810b0[_0x5caed0]);delete _0x5aa962[_0x5810b0[_0x5caed0][_0x7dac('0x64')]];hasAdditionalPhones=!![];}for(var _0x2fb4ea in _0x561e95){if(_0x5810b0[_0x5caed0][_0x7dac('0x64')]+_0x7dac('0x65')===_0x2fb4ea){phoneDescriptions['push']({'itemTypeId':_0x5810b0[_0x5caed0]['id'],'description':_0x2fb4ea});delete _0x5aa962[_0x2fb4ea];}}}if(hasAdditionalPhones)_0x5aa962[_0x7dac('0x15')]='';var _0x4df699=_[_0x7dac('0x4f')](_0x5aa962)[_0x7dac('0xf')]();logger['info'](_0x7dac('0x66'),_0x4df699);fs[_0x7dac('0x67')](_0x19f4f2,_0x4df699+'\x0a');Papa[_0x7dac('0x68')](fs[_0x7dac('0x69')](_0x49c004),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3830c3,_0x215972){try{for(var _0x4a02a8=0x0,_0xf25c=[];_0x4a02a8<_0x3830c3['data']['length'];_0x4a02a8++){stats[_0x7dac('0x6a')]+=0x1;if(_0x3830c3['errors'][_0x4a02a8]){handleError(_0x3830c3[_0x7dac('0x6b')][_0x4a02a8],_0x3830c3['errors'][_0x4a02a8]);}else{var _0x561f07=[];var _0x1c6c2c=[];var _0x3a5679={};for(var _0x15be1c in _0x561e95){let _0xfe88bc=contactItemTypes[_0x7dac('0x6c')](_0x52e4f9=>_0x52e4f9[_0x7dac('0x64')]===_0x15be1c);let _0x35caa5=contactItemTypes[_0x7dac('0x6c')](_0x4df49d=>_0x4df49d[_0x7dac('0x64')]+_0x7dac('0x65')===_0x15be1c);if(_[_0x7dac('0x6d')](_0xfe88bc)&&_[_0x7dac('0x6d')](_0x35caa5)){if(_0x561e95['hasOwnProperty'](_0x15be1c)){if(_0x3830c3[_0x7dac('0x6b')][_0x4a02a8][_0x561e95[_0x15be1c]]){var _0x4bf988=_[_0x7dac('0x6e')](_0x3830c3[_0x7dac('0x6b')][_0x4a02a8][_0x561e95[_0x15be1c]][_0x7dac('0x6f')](/"/g,'\x27'));switch(_0x15be1c){case _0x7dac('0x2c'):var _0x1153e4=moment(_0x4bf988,_0x7dac('0x9'),!![]);if(_0x1153e4['isValid']()){_0xf25c[_0x7dac('0x16')]('\x22'+_0x4bf988+'\x22');}else{_0x561f07[_0x7dac('0x16')](_0x7dac('0x70'));}break;case _0x7dac('0x71'):var _0x110b78=parseInt(_0x4bf988);_0x4bf988=_[_0x7dac('0x72')](_0x110b78)||_0x110b78<0x0||_0x110b78>0x4?_0x137b47?0x3:0x2:_0x110b78;_0xf25c['push']('\x22'+_0x4bf988+'\x22');break;case'UserId':var _0x2326cd=parseInt(_0x4bf988);if(_[_0x7dac('0x73')](_0x2326cd)&&_[_0x7dac('0x74')](_0x4b3d12,_0x2326cd)){_0xf25c['push']('\x22'+_0x2326cd+'\x22');}else{_0x561f07[_0x7dac('0x16')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x4bf988)){_0xf25c[_0x7dac('0x16')]('\x22'+_0x4bf988+'\x22');}else{_0x561f07[_0x7dac('0x16')](_0x7dac('0x75'));}break;case _0x7dac('0x76'):var _0x252982=moment(_0x4bf988,_0x7dac('0x77'),!![]);if(_0x252982[_0x7dac('0x78')]()){_0xf25c['push']('\x22'+_0x4bf988+'\x22');}else{_0x561f07[_0x7dac('0x16')](_0x7dac('0x79'));}break;default:_0xf25c[_0x7dac('0x16')]('\x22'+_0x4bf988+'\x22');}}else{switch(_0x15be1c){case'firstName':case _0x7dac('0xe'):_0x561f07['push'](_0x15be1c+'\x20not\x20specified');break;default:_0xf25c[_0x7dac('0x16')]('\x22\x22');}}}}else{var _0x26194d='';if(!_[_0x7dac('0x6d')](_0xfe88bc)){if(!_0x3a5679[_0x7dac('0x7a')](_0xfe88bc['id'])){for(var _0x2ff1f8=0x0;_0x2ff1f8<_0x561e95[_0x15be1c][_0x7dac('0x14')];_0x2ff1f8++){var _0x4bf988=_[_0x7dac('0x6e')](_0x3830c3[_0x7dac('0x6b')][_0x4a02a8][_0x561e95[_0x15be1c][_0x2ff1f8]][_0x7dac('0x6f')](/"/g,'\x27'));var _0x3090f7=phoneDescriptions[_0x7dac('0x6c')](_0xb6acba=>_0xb6acba[_0x7dac('0x7b')]===_0xfe88bc['id']);if(!_[_0x7dac('0x6d')](_0x3090f7)){var _0x2227ac=_[_0x7dac('0x6e')](_0x3830c3[_0x7dac('0x6b')][_0x4a02a8][_0x561e95[_0x3090f7[_0x7dac('0x7c')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x7dac('0x6d')](_0x2227ac))_0x4bf988=_0x4bf988+'§'+_0x2227ac;}if(_0x26194d=='')_0x26194d=_0x4bf988;else _0x26194d+='|'+_0x4bf988;}_0x1c6c2c[_0x7dac('0x16')](_0xfe88bc['id']+':'+_0x26194d);_0x3a5679[_0xfe88bc['id']]=0x1;}}}}if(hasAdditionalPhones){_0xf25c[_0x7dac('0x16')]('\x22'+_0x1c6c2c[_0x7dac('0xf')](';')+'\x22');}if(_0x561f07[_0x7dac('0x14')]){handleError(_0x3830c3[_0x7dac('0x6b')][_0x4a02a8],{'code':_0x7dac('0x7d'),'message':_0x561f07[_0x7dac('0xf')]()});}else{fs['appendFileSync'](_0x19f4f2,_0xf25c[_0x7dac('0xf')]()+'\x0a');}_0xf25c=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x3a5997,stats);stats[_0x7dac('0x58')]=[];}}if(stopped){logger[_0x7dac('0x56')](_0x7dac('0x7e'));_0x215972[_0x7dac('0x7f')]();}}catch(_0x4584b4){handleError(_0x3830c3[_0x7dac('0x6b')][_0x4a02a8],{'code':_0x7dac('0x80'),'message':_0x4584b4[_0x7dac('0x1b')]});logger['error'](_0x7dac('0x81'),_0x4584b4[_0x7dac('0x1b')]);}},'complete':function(){try{var _0x499af1=[];var _0x37e446=tempTableName;_0x499af1[_0x7dac('0x16')](_0x7dac('0x82')+_0x37e446+_0x7dac('0x83'));logger[_0x7dac('0x56')](_0x7dac('0x84'),contactItemTypes[_0x7dac('0x14')]);var _0x4ad4fa=util[_0x7dac('0xb')](_0x7dac('0x85'),_0x19f4f2,_0x37e446,_0x4df699,_0x5ee268[_0x7dac('0x2e')],_0x5ee268[_0x7dac('0x50')]||null,NOW,NOW);if(_['isNil'](_0x561e95[_0x7dac('0x2c')])){_0x4ad4fa+=_0x7dac('0x86');}_0x499af1['push'](_0x4ad4fa);BPromise[_0x7dac('0x87')](_0x499af1,handleQuery)['then'](function(_0x2cebc1){BPromise[_0x7dac('0x17')]([handleAdditionalPhones()])[_0x7dac('0x18')](function(){_0x499af1=[];for(var _0x4d409e=0x0;_0x4d409e\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','enableEmailPreview','clone','SELECT','exports','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','field','name','color','from','user_has_','_interactions','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','select','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var squel=require(_0x20c0('0x0'));var as=require(_0x20c0('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x20c0('0x2'))[_0x20c0('0x3')];var utils=require(_0x20c0('0x4'));var db=require(_0x20c0('0x5'))['db'];function skipInteractionsQuery(_0x38022e,_0x2e9d65,_0x2afa72){var _0x1474f7=![];var _0x13312d=utils[_0x20c0('0x6')](_0x38022e);if(_0x2e9d65['role']==='agent'&&!_0x2afa72['search']&&!_0x2afa72[_0x13312d]){_0x1474f7=!![];}return _0x1474f7;}function getTagsQuery(){return squel['select']()[_0x20c0('0x7')]('id')[_0x20c0('0x7')](_0x20c0('0x8'))[_0x20c0('0x7')](_0x20c0('0x9'))[_0x20c0('0xa')]('tools_tags');}function getUsersQuery(_0x506a6c,_0x52eb0d){var _0x578592=utils['getInteractionFK'](_0x506a6c);var _0x2f82ed=_0x20c0('0xb')+_0x506a6c+_0x20c0('0xc');var _0x207b1e=squel['select']()[_0x20c0('0x7')]('u.id')['field'](_0x20c0('0xd'))[_0x20c0('0x7')](_0x20c0('0xe')+_0x578592)[_0x20c0('0xa')](_0x2f82ed,'ui')[_0x20c0('0xf')](_0x20c0('0x10'),'u',_0x20c0('0x11'));if(_0x52eb0d[_0x20c0('0x12')]>0x0){_0x207b1e[_0x20c0('0x13')]('ui.'+_0x578592+_0x20c0('0x14'),_[_0x20c0('0x15')](_0x52eb0d,'id'));}return _0x207b1e;}function getInteractionsQuery(_0x1a708e){var _0x46b9e5=utils[_0x20c0('0x16')](_0x1a708e);var _0xeff5b9=utils['getAccountFK'](_0x1a708e);var _0x55de3b=utils['getInteractionFK'](_0x1a708e);return squel[_0x20c0('0x17')]()[_0x20c0('0xa')](_0x46b9e5[_0x20c0('0x18')],'i')[_0x20c0('0xf')]('cm_contacts','c',_0x20c0('0x19'))[_0x20c0('0xf')](_0x20c0('0x10'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x46b9e5[_0x20c0('0x1a')],'a',_0x20c0('0x1b')+_0xeff5b9)[_0x20c0('0xf')](_0x46b9e5[_0x20c0('0x1c')],'me',_0x20c0('0x1d')+_0x55de3b+'\x20=\x20i.id')[_0x20c0('0xf')](_0x46b9e5[_0x20c0('0x1e')],'it',_0x20c0('0x1f')+_0x55de3b+_0x20c0('0x20'))['left_join'](_0x20c0('0x21'),'t',_0x20c0('0x22'));}function getSqlClauses(){var _0x2447e6={'body':squel[_0x20c0('0x23')](),'contact':squel[_0x20c0('0x23')](),'default':squel[_0x20c0('0x23')](),'fields':squel[_0x20c0('0x23')](),'filter':squel['expr'](),'read':squel[_0x20c0('0x23')](),'tags':{'clause':squel[_0x20c0('0x23')](),'ids':null},'user':squel[_0x20c0('0x23')]()};return _0x2447e6;}function parseTagParameter(_0x31565b){var _0x11da5a=squel[_0x20c0('0x23')]();if(_0x31565b){var _0x55684b=utils['getSelectedTags'](_0x31565b);_0x55684b[_0x20c0('0x24')](function(_0x198bdd){_0x11da5a['or'](_0x20c0('0x25'),'%,'+_0x198bdd+',%');});}return _0x11da5a;}function parseReadParameter(_0x5b863b){var _0xa24196='';if(_0x5b863b){_0xa24196=_0x20c0('0x26');if(_0x5b863b==='1'){_0xa24196=_0xa24196[_0x20c0('0x27')](_0x20c0('0x28'),'=');}else{_0xa24196=_0xa24196['replace']('{OPERATOR}','>');}}return _0xa24196;}function parseSearchFilter(_0x29d8ee,_0x11f405){var _0x3edc22=squel[_0x20c0('0x23')]();if(_0x11f405){var _0x3055e9=_0x11f405[_0x20c0('0x27')]('\x5c','\x5c\x5c')[_0x20c0('0x27')](/'/g,'\x27\x27');if(qs[_0x20c0('0x29')](_0x3055e9)){_0x3edc22['or'](_0x20c0('0x2a'),_0x3055e9+'%');if([_0x20c0('0x2b'),_0x20c0('0x2c')][_0x20c0('0x2d')](_0x29d8ee)){_0x3edc22['or'](_0x20c0('0x2e'),_0x3055e9+'%');}else if(_0x29d8ee===_0x20c0('0x2f')){_0x3edc22['or']('i.fax\x20LIKE\x20?',_0x3055e9+'%');}else if(_0x29d8ee===_0x20c0('0x30')){_0x3edc22['or'](_0x20c0('0x31'),_0x3055e9+'%');}}else if(_0x29d8ee===_0x20c0('0x32')&&qs[_0x20c0('0x33')](_0x3055e9)){_0x3edc22['or']('c.email\x20LIKE\x20?',_0x3055e9+'%');}else{if(_0x29d8ee===_0x20c0('0x32')){_0x3edc22['or'](_0x20c0('0x34'),qs[_0x20c0('0x35')](_0x3055e9))['or'](_0x20c0('0x36'),qs[_0x20c0('0x35')](_0x3055e9));}else{if(_0x29d8ee!=='fax'){_0x3edc22['or'](_0x20c0('0x37'),qs['getFullTextValue'](_0x3055e9));}_0x3edc22['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3055e9+'%');}}}return _0x3edc22;}function parseAdvancedSearchFilter(_0x394e6f,_0x1b1b31){var _0x3b334a=getSqlClauses();var _0x37714d=as[_0x20c0('0x38')](_0x394e6f);var _0x39fd84=_0x37714d[_0x20c0('0x39')];for(var _0x4c8400=0x0;_0x4c8400<_0x37714d['conditions']['length'];_0x4c8400++){var _0x129eb5=_0x37714d[_0x20c0('0x3a')][_0x4c8400];var _0x545b39='i';var _0x346a04=_[_0x20c0('0x3b')](_0x1b1b31,['name',_0x129eb5['field']]);if(_0x346a04){var _0x700675=as[_0x20c0('0x3c')](_0x545b39,_0x346a04['type'],_0x129eb5);_0x3b334a[_0x20c0('0x3d')][_0x39fd84](_0x700675['text'],_0x700675[_0x20c0('0x3e')][_0x20c0('0x3f')],_0x700675[_0x20c0('0x3e')][_0x20c0('0x40')]);}else{switch(_0x129eb5['field']){case _0x20c0('0x41'):var _0x1f7a34=parseReadParameter(_0x129eb5[_0x20c0('0x3e')]);_0x3b334a[_0x20c0('0x42')][_0x20c0('0x43')](_0x1f7a34);break;case _0x20c0('0x44'):if(_0x129eb5[_0x20c0('0x45')]===_0x20c0('0x46')){if(_0x129eb5['value']['split']('\x20')['length']>0x1){_0x3b334a[_0x20c0('0x47')][_0x39fd84]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x20c0('0x35')](_0x129eb5[_0x20c0('0x3e')]),null);}else{var _0x88863='%'+_0x129eb5[_0x20c0('0x3e')]+'%';_0x3b334a['contact'][_0x39fd84](_0x20c0('0x48'),_0x88863,_0x88863,_0x88863);}}else{_0x346a04=_['find'](_0x1b1b31,['name',_0x20c0('0x49')]);_0x129eb5[_0x20c0('0x7')]=_0x20c0('0x49');_0x700675=as[_0x20c0('0x3c')](_0x545b39,_0x346a04['type'],_0x129eb5);_0x3b334a[_0x20c0('0x47')][_0x39fd84](_0x700675[_0x20c0('0x4a')],_0x700675[_0x20c0('0x3e')][_0x20c0('0x3f')],_0x700675['value'][_0x20c0('0x40')]);}break;case _0x20c0('0x4b'):var _0x5a924e=_0x129eb5[_0x20c0('0x3e')][_0x20c0('0x4c')](',')[_0x20c0('0x15')](function(_0x527f6f){return Number(_0x527f6f);});var _0x399514=parseTagParameter(_0x5a924e);_0x3b334a['tags']['clause']['and'](_0x399514);_0x3b334a[_0x20c0('0x4d')]['ids']=_0x5a924e;break;case _0x20c0('0x4e'):if(_0x129eb5[_0x20c0('0x45')]===_0x20c0('0x46')){_0x3b334a[_0x20c0('0x4f')][_0x39fd84](_0x20c0('0x50'),'%'+_0x129eb5[_0x20c0('0x3e')]+'%',null);}else{_0x346a04=_[_0x20c0('0x3b')](_0x1b1b31,['name',_0x20c0('0x51')]);_0x129eb5[_0x20c0('0x7')]=_0x20c0('0x51');_0x700675=as[_0x20c0('0x3c')](_0x545b39,_0x346a04[_0x20c0('0x52')],_0x129eb5);_0x3b334a[_0x20c0('0x4f')][_0x39fd84](_0x700675['text'],_0x700675['value'][_0x20c0('0x3f')],_0x700675[_0x20c0('0x3e')][_0x20c0('0x40')]);}break;case'body':case'plainBody':_0x700675=as[_0x20c0('0x3c')]('me',null,_0x129eb5);_0x3b334a[_0x20c0('0x53')][_0x39fd84](_0x700675[_0x20c0('0x4a')],_0x700675['value'][_0x20c0('0x3f')],_0x700675[_0x20c0('0x3e')]['end']);break;}}}return _0x3b334a;}function parseModelFields(_0x4972a3,_0x3fb4f1,_0x5b314b){var _0xdd2a3b=utils['getAccountFK'](_0x4972a3);var _0x1b25d6=squel[_0x20c0('0x23')]();var _0x5dd76d=_(_0x3fb4f1)['keys']()[_0x20c0('0x15')](function(_0x149376){return _[_0x20c0('0x54')](_0x5b314b,[_0x20c0('0x8'),_0x149376])?_0x149376:undefined;})[_0x20c0('0x55')]()[_0x20c0('0x3e')]();if(_0x5dd76d[_0x20c0('0x12')]>0x0){_0x5dd76d[_0x20c0('0x24')](function(_0x5cccbf){if(_0x5cccbf===_0xdd2a3b){_0x1b25d6[_0x20c0('0x43')]('i.'+_0xdd2a3b+_0x20c0('0x14'),[][_0x20c0('0x56')](_0x3fb4f1[_0x5cccbf]));}else if(_0x5cccbf===_0x20c0('0x57')){var _0x2c3404=JSON['parse'](_0x3fb4f1[_0x5cccbf])['$gte'];var _0x3cff12=JSON[_0x20c0('0x58')](_0x3fb4f1[_0x5cccbf])[_0x20c0('0x59')];_0x1b25d6[_0x20c0('0x43')](_0x20c0('0x5a'),_0x2c3404,_0x3cff12);}else{if(_0x3fb4f1[_0x5cccbf]===_0x20c0('0x5b')){_0x1b25d6[_0x20c0('0x43')]('i.'+_0x5cccbf+'\x20IS\x20NULL');}else{_0x1b25d6['and']('i.'+_0x5cccbf+_0x20c0('0x5c'),_0x3fb4f1[_0x5cccbf]);}}});}return _0x1b25d6;}function parseQueryParameters(_0x1933e6,_0x10e51f,_0x4b5810){var _0xff6ea=getSqlClauses();return Promise['resolve']()[_0x20c0('0x5d')](function(){return parseModelFields(_0x1933e6,_0x10e51f,_0x4b5810);})[_0x20c0('0x5d')](function(_0x76a8a2){_0xff6ea['fields'][_0x20c0('0x43')](_0x76a8a2);return parseReadParameter(_0x10e51f[_0x20c0('0x42')]);})[_0x20c0('0x5d')](function(_0x490936){_0xff6ea[_0x20c0('0x42')]['and'](_0x490936);return parseTagParameter(_0x10e51f[_0x20c0('0x5e')]);})[_0x20c0('0x5d')](function(_0x10c8c1){_0xff6ea[_0x20c0('0x4d')]['clause'][_0x20c0('0x43')](_0x10c8c1);return parseSearchFilter(_0x1933e6,_0x10e51f['filter']);})[_0x20c0('0x5d')](function(_0x5d40c9){_0xff6ea[_0x20c0('0x5f')]=_0x5d40c9;return _0xff6ea;});}function checkAccountsRestrictions(_0x2e64f5,_0x2cf512,_0x332d83){var _0x54bb05=utils[_0x20c0('0x6')](_0x2e64f5);var _0xcd87e8=_0x20c0('0x60')+_[_0x20c0('0x61')](_0x2e64f5)+(_0x2e64f5===_0x20c0('0x62')?_0x20c0('0x63'):_0x20c0('0x64'));var _0x166dbd=squel['expr']();return Promise[_0x20c0('0x65')]()[_0x20c0('0x5d')](function(){if(_0x332d83[_0x20c0('0x66')]&&_0x2cf512['role']===_0x20c0('0x67')){return _0x2cf512[_0xcd87e8]({'attributes':['id'],'raw':!![]});}})[_0x20c0('0x5d')](function(_0x57ca28){if(_0x57ca28){if(_0x57ca28[_0x20c0('0x12')]===0x0){_0x166dbd['and']('i.'+_0x54bb05+'\x20IS\x20NULL');}else{_0x166dbd['and']('i.'+_0x54bb05+'\x20IN\x20?',_[_0x20c0('0x15')](_0x57ca28,'id'));}}else if(!_0x332d83[_0x54bb05]){_0x166dbd[_0x20c0('0x43')]('i.'+_0x54bb05+_0x20c0('0x68'));}})[_0x20c0('0x5d')](function(){return _0x166dbd;});}function getClosedOrderClause(_0x353e1b,_0xc34e9f){var _0x1f16e6='';var _0x247dee=[_0x20c0('0x69'),'i.secondDisposition',_0x20c0('0x6a')];if(_0x353e1b===_0x20c0('0x32')){_0x247dee[_0x20c0('0x6b')](_0x20c0('0x6c'));}if(_0xc34e9f[_0x20c0('0x6d')]==='0'&&_0x353e1b===_0x20c0('0x32')){_0x1f16e6=_0x20c0('0x6c');}else{if(_0xc34e9f[_0x20c0('0x6d')]==='1'){_0x247dee[_0x20c0('0x6e')]();}_0x1f16e6=_0x20c0('0x6f')+_0x247dee['join'](',\x20')+')';}return _0x1f16e6;}function getFilteredInteractions(_0x8146da,_0x32f975,_0x1ae801,_0x11511c){var _0x5a1f33=utils['getInteractionFK'](_0x8146da);var _0x9c0b80=_[_0x20c0('0x61')](_0x8146da)+'Interaction';var _0x2222eb=[];var _0x4bc360=getTagsQuery();var _0x12080a={'type':db[_0x20c0('0x70')][_0x20c0('0x71')]['SELECT'],'raw':!![]};var _0x59c854=[];var _0x113725=[];return db[_0x20c0('0x72')][_0x20c0('0x73')](_0x4bc360[_0x20c0('0x74')](),_0x12080a)['then'](function(_0x526bdb){_0x2222eb=_['keyBy'](_0x526bdb,'id');_0x12080a=_[_0x20c0('0x75')](_0x12080a,{'model':db[_0x9c0b80],'mapToModel':!![],'nest':!![]});if(_0x1ae801[_0x20c0('0x76')]){_0x11511c[_0x20c0('0x77')]['forEach'](function(_0x47b241){_0x32f975[_0x20c0('0x7')]('i.'+_0x47b241);});}else{_0x32f975[_0x20c0('0x7')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x20c0('0x41'));_0x32f975['field']('a.key','Account.key');_0x32f975[_0x20c0('0x7')]('a.mandatoryDisposition',_0x20c0('0x78'));if(_0x8146da==='mail'){_0x32f975[_0x20c0('0x7')](_0x20c0('0x79'),_0x20c0('0x7a'));_0x32f975['field']('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',_0x20c0('0x7b'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x7c'));_0x32f975[_0x20c0('0x7')]('i.createdAt');_0x32f975['field'](_0x20c0('0x7d'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x7e'));_0x32f975[_0x20c0('0x7')]('i.closedAt');_0x32f975[_0x20c0('0x7')](_0x20c0('0x7f'));_0x32f975[_0x20c0('0x7')]('i.lastMsgAt');_0x32f975['field']('i.lastMsgDirection');_0x32f975[_0x20c0('0x7')](_0x20c0('0x80'));_0x32f975['field']('i.disposition');_0x32f975[_0x20c0('0x7')]('i.secondDisposition');_0x32f975['field'](_0x20c0('0x69'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x6c'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x81'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x82'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x83'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x84'));}else if(_0x8146da==='openchannel'){_0x32f975[_0x20c0('0x7')](_0x20c0('0x85'),_0x20c0('0x7b'));}else{_0x32f975[_0x20c0('0x7')]('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',_0x20c0('0x7b'));}if(_0x8146da!==_0x20c0('0x32')){_0x32f975[_0x20c0('0x7')](_0x20c0('0x86'));}_0x32f975[_0x20c0('0x7')](_0x20c0('0x87'),_0x20c0('0x88'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x89'),_0x20c0('0x8a'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x8b'),_0x20c0('0x8c'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x8d'),_0x20c0('0x8e'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x8f'),_0x20c0('0x90'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x91'),'Contact.fax');_0x32f975['field'](_0x20c0('0x92'),_0x20c0('0x93'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x94'),'Owner.internal');_0x32f975[_0x20c0('0x7')](_0x20c0('0x95'),_0x20c0('0x96'));}if(_0x11511c['limit']){_0x32f975['limit'](_0x11511c[_0x20c0('0x97')]);}if(_0x11511c[_0x20c0('0x98')]){_0x32f975[_0x20c0('0x98')](_0x11511c[_0x20c0('0x98')]);}return db['sequelize']['query'](_0x32f975[_0x20c0('0x74')](),_0x12080a);})[_0x20c0('0x5d')](function(_0xb4c454){_0x59c854=_0xb4c454;var _0x3558af=getUsersQuery(_0x8146da,_0x59c854);return db[_0x20c0('0x72')][_0x20c0('0x73')](_0x3558af['toString'](),_0x12080a);})[_0x20c0('0x5d')](function(_0xf0b82d){_0x113725=_['groupBy'](_0xf0b82d,_0x5a1f33);if(_0x8146da==='mail'){return db[_0x20c0('0x99')]['findOne']({'attributes':[_0x20c0('0x9a')],'raw':!![]});}})[_0x20c0('0x5d')](function(_0x2c6b6b){var _0x3e55b9=_0x2c6b6b?_0x2c6b6b[_0x20c0('0x9a')]:undefined;var _0x415137=_0x59c854[_0x20c0('0x15')](function(_0x2870dd){return updateInteraction(_0x2870dd,_0x2222eb,_0x113725,_0x3e55b9);});return Promise['all'](_0x415137);});}function countFilteredInteractions(_0x13ee2d,_0x1aa1b4){var _0x29c9a1=_0x13ee2d[_0x20c0('0x9b')]();_0x29c9a1['field']('COUNT(*)');_0x29c9a1['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x20c0('0x41'));var _0x13c005=utils['getSelectedTags'](_0x1aa1b4);if(!_['isEmpty'](_0x13c005)){_0x29c9a1[_0x20c0('0x13')]('t.id\x20IN\x20?',_0x13c005);}var _0x5b853e={'type':db[_0x20c0('0x70')][_0x20c0('0x71')][_0x20c0('0x9c')],'raw':!![]};return db[_0x20c0('0x72')][_0x20c0('0x73')](_0x29c9a1['toString'](),_0x5b853e);}module[_0x20c0('0x9d')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x0eaa=['tools_tags','getInteractionFK','_interactions','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','where','ui.','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','whatsapp','includes','fax','i.fax\x20LIKE\x20?','openchannel','isEmail','c.email\x20LIKE\x20?','mail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','length','find','type','text','start','end','unreadMessages','read','and','Contact','operator','$substring','value','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','tags','ids','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','resolve','then','fields','tag','clause','filter','get','capitalize','chat','Websites','role','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','Interaction','Sequelize','QueryTypes','SELECT','query','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','enableEmailPreview','all','t.id\x20IN\x20?','exports','lodash','squel','./update-interaction','updateInteraction','../../mysqldb','getAccountFK','search','select','name','field','color','from'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0xa6004f,_0x29a1cb){_0xa6004f=_0xa6004f-0x0;var _0x3d9f53=_0x0eaa[_0xa6004f];return _0x3d9f53;};'use strict';var _=require(_0xa0ea('0x0'));var squel=require(_0xa0ea('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0xa0ea('0x2'))[_0xa0ea('0x3')];var utils=require('./utils');var db=require(_0xa0ea('0x4'))['db'];function skipInteractionsQuery(_0x1c74b8,_0x30dd52,_0x1404ab){var _0x1d27f8=![];var _0x5636ed=utils[_0xa0ea('0x5')](_0x1c74b8);if(_0x30dd52['role']==='agent'&&!_0x1404ab[_0xa0ea('0x6')]&&!_0x1404ab[_0x5636ed]){_0x1d27f8=!![];}return _0x1d27f8;}function getTagsQuery(){return squel[_0xa0ea('0x7')]()['field']('id')['field'](_0xa0ea('0x8'))[_0xa0ea('0x9')](_0xa0ea('0xa'))[_0xa0ea('0xb')](_0xa0ea('0xc'));}function getUsersQuery(_0x5ec608,_0x38b2f0){var _0xb29ca5=utils[_0xa0ea('0xd')](_0x5ec608);var _0x2ff061='user_has_'+_0x5ec608+_0xa0ea('0xe');var _0x4046e6=squel[_0xa0ea('0x7')]()[_0xa0ea('0x9')](_0xa0ea('0xf'))['field'](_0xa0ea('0x10'))[_0xa0ea('0x9')]('ui.'+_0xb29ca5)[_0xa0ea('0xb')](_0x2ff061,'ui')[_0xa0ea('0x11')](_0xa0ea('0x12'),'u',_0xa0ea('0x13'));if(_0x38b2f0['length']>0x0){_0x4046e6[_0xa0ea('0x14')](_0xa0ea('0x15')+_0xb29ca5+_0xa0ea('0x16'),_[_0xa0ea('0x17')](_0x38b2f0,'id'));}return _0x4046e6;}function getInteractionsQuery(_0x10d8f9){var _0x34b94c=utils[_0xa0ea('0x18')](_0x10d8f9);var _0x324555=utils[_0xa0ea('0x5')](_0x10d8f9);var _0x405f7f=utils['getInteractionFK'](_0x10d8f9);return squel['select']()[_0xa0ea('0xb')](_0x34b94c[_0xa0ea('0x19')],'i')[_0xa0ea('0x11')](_0xa0ea('0x1a'),'c',_0xa0ea('0x1b'))[_0xa0ea('0x11')](_0xa0ea('0x12'),'o','o.id\x20=\x20i.UserId')[_0xa0ea('0x11')](_0x34b94c[_0xa0ea('0x1c')],'a',_0xa0ea('0x1d')+_0x324555)['left_join'](_0x34b94c[_0xa0ea('0x1e')],'me',_0xa0ea('0x1f')+_0x405f7f+_0xa0ea('0x20'))[_0xa0ea('0x11')](_0x34b94c[_0xa0ea('0x21')],'it',_0xa0ea('0x22')+_0x405f7f+'\x20=\x20i.id')[_0xa0ea('0x11')]('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x259175={'body':squel[_0xa0ea('0x23')](),'contact':squel[_0xa0ea('0x23')](),'default':squel['expr'](),'fields':squel[_0xa0ea('0x23')](),'filter':squel['expr'](),'read':squel[_0xa0ea('0x23')](),'tags':{'clause':squel[_0xa0ea('0x23')](),'ids':null},'user':squel[_0xa0ea('0x23')]()};return _0x259175;}function parseTagParameter(_0x26b6f1){var _0x35c247=squel[_0xa0ea('0x23')]();if(_0x26b6f1){var _0x1e506f=utils[_0xa0ea('0x24')](_0x26b6f1);_0x1e506f[_0xa0ea('0x25')](function(_0x208c8){_0x35c247['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x208c8+',%');});}return _0x35c247;}function parseReadParameter(_0x15534e){var _0x4f1acd='';if(_0x15534e){_0x4f1acd=_0xa0ea('0x26');if(_0x15534e==='1'){_0x4f1acd=_0x4f1acd[_0xa0ea('0x27')](_0xa0ea('0x28'),'=');}else{_0x4f1acd=_0x4f1acd[_0xa0ea('0x27')](_0xa0ea('0x28'),'>');}}return _0x4f1acd;}function parseSearchFilter(_0x129130,_0x4e9748){var _0x114395=squel['expr']();if(_0x4e9748){var _0x210ce3=_0x4e9748['replace']('\x5c','\x5c\x5c')[_0xa0ea('0x27')](/'/g,'\x27\x27');if(qs[_0xa0ea('0x29')](_0x210ce3)){_0x114395['or'](_0xa0ea('0x2a'),_0x210ce3+'%');if(['sms',_0xa0ea('0x2b')][_0xa0ea('0x2c')](_0x129130)){_0x114395['or']('i.phone\x20LIKE\x20?',_0x210ce3+'%');}else if(_0x129130===_0xa0ea('0x2d')){_0x114395['or'](_0xa0ea('0x2e'),_0x210ce3+'%');}else if(_0x129130===_0xa0ea('0x2f')){_0x114395['or']('i.from\x20LIKE\x20?',_0x210ce3+'%');}}else if(_0x129130==='mail'&&qs[_0xa0ea('0x30')](_0x210ce3)){_0x114395['or'](_0xa0ea('0x31'),_0x210ce3+'%');}else{if(_0x129130===_0xa0ea('0x32')){_0x114395['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa0ea('0x33')](_0x210ce3))['or'](_0xa0ea('0x34'),qs[_0xa0ea('0x33')](_0x210ce3));}else{if(_0x129130!==_0xa0ea('0x2d')){_0x114395['or'](_0xa0ea('0x35'),qs['getFullTextValue'](_0x210ce3));}_0x114395['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x210ce3+'%');}}}return _0x114395;}function parseAdvancedSearchFilter(_0x26fa5c,_0x540038){var _0x272dca=getSqlClauses();var _0x54ab57=as[_0xa0ea('0x36')](_0x26fa5c);var _0x2497e2=_0x54ab57[_0xa0ea('0x37')];for(var _0x4bc386=0x0;_0x4bc386<_0x54ab57[_0xa0ea('0x38')][_0xa0ea('0x39')];_0x4bc386++){var _0x430388=_0x54ab57[_0xa0ea('0x38')][_0x4bc386];var _0x1def95='i';var _0x2d54f0=_[_0xa0ea('0x3a')](_0x540038,[_0xa0ea('0x8'),_0x430388[_0xa0ea('0x9')]]);if(_0x2d54f0){var _0x99a0d0=as['buildExpression'](_0x1def95,_0x2d54f0[_0xa0ea('0x3b')],_0x430388);_0x272dca['default'][_0x2497e2](_0x99a0d0[_0xa0ea('0x3c')],_0x99a0d0['value'][_0xa0ea('0x3d')],_0x99a0d0['value'][_0xa0ea('0x3e')]);}else{switch(_0x430388[_0xa0ea('0x9')]){case _0xa0ea('0x3f'):var _0x6ec12e=parseReadParameter(_0x430388['value']);_0x272dca[_0xa0ea('0x40')][_0xa0ea('0x41')](_0x6ec12e);break;case _0xa0ea('0x42'):if(_0x430388[_0xa0ea('0x43')]===_0xa0ea('0x44')){if(_0x430388[_0xa0ea('0x45')][_0xa0ea('0x46')]('\x20')[_0xa0ea('0x39')]>0x1){_0x272dca[_0xa0ea('0x47')][_0x2497e2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa0ea('0x33')](_0x430388['value']),null);}else{var _0x431f6c='%'+_0x430388[_0xa0ea('0x45')]+'%';_0x272dca[_0xa0ea('0x47')][_0x2497e2](_0xa0ea('0x48'),_0x431f6c,_0x431f6c,_0x431f6c);}}else{_0x2d54f0=_[_0xa0ea('0x3a')](_0x540038,[_0xa0ea('0x8'),_0xa0ea('0x49')]);_0x430388[_0xa0ea('0x9')]=_0xa0ea('0x49');_0x99a0d0=as[_0xa0ea('0x4a')](_0x1def95,_0x2d54f0[_0xa0ea('0x3b')],_0x430388);_0x272dca[_0xa0ea('0x47')][_0x2497e2](_0x99a0d0[_0xa0ea('0x3c')],_0x99a0d0[_0xa0ea('0x45')][_0xa0ea('0x3d')],_0x99a0d0['value'][_0xa0ea('0x3e')]);}break;case'Tag':var _0x42898=_0x430388['value']['split'](',')['map'](function(_0x53606e){return Number(_0x53606e);});var _0x468109=parseTagParameter(_0x42898);_0x272dca[_0xa0ea('0x4b')]['clause'][_0xa0ea('0x41')](_0x468109);_0x272dca[_0xa0ea('0x4b')][_0xa0ea('0x4c')]=_0x42898;break;case'User':if(_0x430388['operator']==='$substring'){_0x272dca[_0xa0ea('0x4d')][_0x2497e2](_0xa0ea('0x4e'),'%'+_0x430388[_0xa0ea('0x45')]+'%',null);}else{_0x2d54f0=_[_0xa0ea('0x3a')](_0x540038,[_0xa0ea('0x8'),_0xa0ea('0x4f')]);_0x430388[_0xa0ea('0x9')]=_0xa0ea('0x4f');_0x99a0d0=as[_0xa0ea('0x4a')](_0x1def95,_0x2d54f0[_0xa0ea('0x3b')],_0x430388);_0x272dca[_0xa0ea('0x4d')][_0x2497e2](_0x99a0d0[_0xa0ea('0x3c')],_0x99a0d0['value'][_0xa0ea('0x3d')],_0x99a0d0[_0xa0ea('0x45')][_0xa0ea('0x3e')]);}break;case _0xa0ea('0x50'):case'plainBody':_0x99a0d0=as['buildExpression']('me',null,_0x430388);_0x272dca[_0xa0ea('0x50')][_0x2497e2](_0x99a0d0[_0xa0ea('0x3c')],_0x99a0d0[_0xa0ea('0x45')][_0xa0ea('0x3d')],_0x99a0d0[_0xa0ea('0x45')][_0xa0ea('0x3e')]);break;}}}return _0x272dca;}function parseModelFields(_0x219540,_0x361210,_0x36c1b3){var _0x7db1a6=utils['getAccountFK'](_0x219540);var _0x7cdf48=squel[_0xa0ea('0x23')]();var _0x3fd22b=_(_0x361210)[_0xa0ea('0x51')]()[_0xa0ea('0x17')](function(_0x62b29a){return _[_0xa0ea('0x52')](_0x36c1b3,['name',_0x62b29a])?_0x62b29a:undefined;})[_0xa0ea('0x53')]()[_0xa0ea('0x45')]();if(_0x3fd22b['length']>0x0){_0x3fd22b[_0xa0ea('0x25')](function(_0x47ff71){if(_0x47ff71===_0x7db1a6){_0x7cdf48[_0xa0ea('0x41')]('i.'+_0x7db1a6+_0xa0ea('0x16'),[][_0xa0ea('0x54')](_0x361210[_0x47ff71]));}else if(_0x47ff71===_0xa0ea('0x55')){var _0x19f8d6=JSON['parse'](_0x361210[_0x47ff71])[_0xa0ea('0x56')];var _0x5eb316=JSON[_0xa0ea('0x57')](_0x361210[_0x47ff71])['$lte'];_0x7cdf48[_0xa0ea('0x41')](_0xa0ea('0x58'),_0x19f8d6,_0x5eb316);}else{if(_0x361210[_0x47ff71]==='null'){_0x7cdf48[_0xa0ea('0x41')]('i.'+_0x47ff71+_0xa0ea('0x59'));}else{_0x7cdf48[_0xa0ea('0x41')]('i.'+_0x47ff71+'\x20=\x20?',_0x361210[_0x47ff71]);}}});}return _0x7cdf48;}function parseQueryParameters(_0x2b4d7c,_0x4853fe,_0x33342e){var _0xbb8878=getSqlClauses();return Promise[_0xa0ea('0x5a')]()[_0xa0ea('0x5b')](function(){return parseModelFields(_0x2b4d7c,_0x4853fe,_0x33342e);})[_0xa0ea('0x5b')](function(_0x4b0208){_0xbb8878[_0xa0ea('0x5c')]['and'](_0x4b0208);return parseReadParameter(_0x4853fe['read']);})[_0xa0ea('0x5b')](function(_0x1163f5){_0xbb8878[_0xa0ea('0x40')]['and'](_0x1163f5);return parseTagParameter(_0x4853fe[_0xa0ea('0x5d')]);})[_0xa0ea('0x5b')](function(_0x7e15c2){_0xbb8878[_0xa0ea('0x4b')][_0xa0ea('0x5e')][_0xa0ea('0x41')](_0x7e15c2);return parseSearchFilter(_0x2b4d7c,_0x4853fe[_0xa0ea('0x5f')]);})[_0xa0ea('0x5b')](function(_0x4e5a3f){_0xbb8878[_0xa0ea('0x5f')]=_0x4e5a3f;return _0xbb8878;});}function checkAccountsRestrictions(_0x3c79d0,_0x2d5ddc,_0x4a0837){var _0x1ae398=utils['getAccountFK'](_0x3c79d0);var _0x16026b=_0xa0ea('0x60')+_[_0xa0ea('0x61')](_0x3c79d0)+(_0x3c79d0===_0xa0ea('0x62')?_0xa0ea('0x63'):'Accounts');var _0x3bc207=squel[_0xa0ea('0x23')]();return Promise[_0xa0ea('0x5a')]()[_0xa0ea('0x5b')](function(){if(_0x4a0837[_0xa0ea('0x6')]&&_0x2d5ddc[_0xa0ea('0x64')]==='agent'){return _0x2d5ddc[_0x16026b]({'attributes':['id'],'raw':!![]});}})[_0xa0ea('0x5b')](function(_0x1ea4c7){if(_0x1ea4c7){if(_0x1ea4c7[_0xa0ea('0x39')]===0x0){_0x3bc207['and']('i.'+_0x1ae398+_0xa0ea('0x59'));}else{_0x3bc207[_0xa0ea('0x41')]('i.'+_0x1ae398+_0xa0ea('0x16'),_[_0xa0ea('0x17')](_0x1ea4c7,'id'));}}else if(!_0x4a0837[_0x1ae398]){_0x3bc207[_0xa0ea('0x41')]('i.'+_0x1ae398+_0xa0ea('0x65'));}})[_0xa0ea('0x5b')](function(){return _0x3bc207;});}function getClosedOrderClause(_0x2ffd13,_0x55d6d9){var _0x4cb062='';var _0x537da0=[_0xa0ea('0x66'),'i.secondDisposition',_0xa0ea('0x67')];if(_0x2ffd13===_0xa0ea('0x32')){_0x537da0[_0xa0ea('0x68')](_0xa0ea('0x69'));}if(_0x55d6d9[_0xa0ea('0x6a')]==='0'&&_0x2ffd13==='mail'){_0x4cb062=_0xa0ea('0x69');}else{if(_0x55d6d9[_0xa0ea('0x6a')]==='1'){_0x537da0[_0xa0ea('0x6b')]();}_0x4cb062=_0xa0ea('0x6c')+_0x537da0['join'](',\x20')+')';}return _0x4cb062;}function getFilteredInteractions(_0x284a46,_0x17fcdb,_0x4bb97f,_0x145630){var _0x557ffb=utils['getInteractionFK'](_0x284a46);var _0xac75e8=_['capitalize'](_0x284a46)+_0xa0ea('0x6d');var _0x6f5039=[];var _0x4f44bf=getTagsQuery();var _0xdc05d={'type':db[_0xa0ea('0x6e')][_0xa0ea('0x6f')][_0xa0ea('0x70')],'raw':!![]};var _0x4ca3fd=[];var _0x750026=[];return db['sequelize'][_0xa0ea('0x71')](_0x4f44bf[_0xa0ea('0x72')](),_0xdc05d)[_0xa0ea('0x5b')](function(_0x1c880f){_0x6f5039=_[_0xa0ea('0x73')](_0x1c880f,'id');_0xdc05d=_[_0xa0ea('0x74')](_0xdc05d,{'model':db[_0xac75e8],'mapToModel':!![],'nest':!![]});if(_0x4bb97f['fields']){_0x145630['attributes'][_0xa0ea('0x25')](function(_0x5a08eb){_0x17fcdb[_0xa0ea('0x9')]('i.'+_0x5a08eb);});}else{_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x75'),_0xa0ea('0x3f'));_0x17fcdb['field'](_0xa0ea('0x76'),_0xa0ea('0x77'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x78'),'Account.mandatoryDisposition');if(_0x284a46===_0xa0ea('0x32')){_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x79'),_0xa0ea('0x7a'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x7b'),_0xa0ea('0x7c'));_0x17fcdb[_0xa0ea('0x9')]('i.id');_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x7d'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x7e'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x7f'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x80'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x81'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x82'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x83'));_0x17fcdb[_0xa0ea('0x9')]('i.subject');_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x67'));_0x17fcdb[_0xa0ea('0x9')]('i.secondDisposition');_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x66'));_0x17fcdb['field']('i.substatus');_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x84'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x85'));_0x17fcdb['field'](_0xa0ea('0x86'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x87'));}else if(_0x284a46==='openchannel'){_0x17fcdb['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x88'),_0xa0ea('0x7c'));}if(_0x284a46!==_0xa0ea('0x32')){_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x89'));}_0x17fcdb[_0xa0ea('0x9')]('c.firstName',_0xa0ea('0x8a'));_0x17fcdb[_0xa0ea('0x9')]('c.lastName',_0xa0ea('0x8b'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x8c'),'Contact.email');_0x17fcdb[_0xa0ea('0x9')]('c.phone',_0xa0ea('0x8d'));_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x8e'),'Contact.mobile');_0x17fcdb['field'](_0xa0ea('0x8f'),'Contact.fax');_0x17fcdb[_0xa0ea('0x9')](_0xa0ea('0x90'),'Owner.fullname');_0x17fcdb[_0xa0ea('0x9')]('o.internal',_0xa0ea('0x91'));_0x17fcdb['field'](_0xa0ea('0x92'),_0xa0ea('0x93'));}if(_0x145630[_0xa0ea('0x94')]){_0x17fcdb['limit'](_0x145630['limit']);}if(_0x145630[_0xa0ea('0x95')]){_0x17fcdb[_0xa0ea('0x95')](_0x145630[_0xa0ea('0x95')]);}return db[_0xa0ea('0x96')][_0xa0ea('0x71')](_0x17fcdb[_0xa0ea('0x72')](),_0xdc05d);})[_0xa0ea('0x5b')](function(_0xefff94){_0x4ca3fd=_0xefff94;var _0x30f0b2=getUsersQuery(_0x284a46,_0x4ca3fd);return db[_0xa0ea('0x96')]['query'](_0x30f0b2[_0xa0ea('0x72')](),_0xdc05d);})[_0xa0ea('0x5b')](function(_0xd169f9){_0x750026=_['groupBy'](_0xd169f9,_0x557ffb);if(_0x284a46===_0xa0ea('0x32')){return db['Setting']['findOne']({'attributes':[_0xa0ea('0x97')],'raw':!![]});}})[_0xa0ea('0x5b')](function(_0x420f45){var _0xeefe29=_0x420f45?_0x420f45['enableEmailPreview']:undefined;var _0x45c8a0=_0x4ca3fd[_0xa0ea('0x17')](function(_0x23c77b){return updateInteraction(_0x23c77b,_0x6f5039,_0x750026,_0xeefe29);});return Promise[_0xa0ea('0x98')](_0x45c8a0);});}function countFilteredInteractions(_0x3cf893,_0x3b16b2){var _0x2ad7f7=_0x3cf893['clone']();_0x2ad7f7['field']('COUNT(*)');_0x2ad7f7[_0xa0ea('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa0ea('0x3f'));var _0x26a193=utils[_0xa0ea('0x24')](_0x3b16b2);if(!_['isEmpty'](_0x26a193)){_0x2ad7f7[_0xa0ea('0x14')](_0xa0ea('0x99'),_0x26a193);}var _0x365855={'type':db[_0xa0ea('0x6e')][_0xa0ea('0x6f')][_0xa0ea('0x70')],'raw':!![]};return db[_0xa0ea('0x96')][_0xa0ea('0x71')](_0x2ad7f7[_0xa0ea('0x72')](),_0x365855);}module[_0xa0ea('0x9a')]={'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 af06284..5f25c83 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 _0x8b4d=['closed','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','forEach','waiting','talking','answered','unmanaged','abandoned','total'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x8b4d,0x77));var _0xd8b4=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x8b4d[_0x22ffbf];return _0x360c17;};'use strict';var _=require(_0xd8b4('0x0'));var db=require(_0xd8b4('0x1'))['db'];function getInteractionUsers(_0x18120a,_0x24abe8){return new Promise(function(_0x4330e8,_0x3b67d0){try{var _0x14ecfe=[];if(_0x24abe8[_0x18120a]){_0x14ecfe=_0x24abe8[_0x18120a][_0xd8b4('0x2')](function(_0x196767){return{'id':_0x196767['id'],'fullname':_0x196767[_0xd8b4('0x3')]};});}return _0x4330e8(_0x14ecfe);}catch(_0x1e5b6c){_0x3b67d0(_0x1e5b6c);}});}function getInteractionTags(_0x5438ca,_0x1b0534){var _0x4cab7c=[];if(_0x5438ca){_0x5438ca['split'](',')[_0xd8b4('0x4')](function(_0x4c300b){_0x4cab7c['push'](_0x1b0534[_0x4c300b]);});}return _0x4cab7c;}function updateWaitingCounter(_0x30d9e4){if(_0x30d9e4[_0xd8b4('0x5')]){_0x30d9e4[_0xd8b4('0x5')]-=0x1;}}function updateInteractionCounters(_0x351ea0){_0x351ea0['waiting']=0x0;_0x351ea0[_0xd8b4('0x6')]=0x0;_0x351ea0[_0xd8b4('0x7')]=0x0;_0x351ea0[_0xd8b4('0x8')]=0x0;_0x351ea0[_0xd8b4('0x9')]=0x0;_0x351ea0[_0xd8b4('0xa')]=0x0;if(_0x351ea0[_0xd8b4('0xb')]){if(_0x351ea0[_0xd8b4('0xc')]===_0xd8b4('0x9')){_0x351ea0[_0xd8b4('0x9')]+=0x1;updateWaitingCounter(_0x351ea0);}if(_0x351ea0['UserId']){_0x351ea0[_0xd8b4('0x7')]+=0x1;if(_0x351ea0[_0xd8b4('0x6')]){_0x351ea0[_0xd8b4('0x6')]-=0x1;}}else{if(_0x351ea0[_0xd8b4('0xc')]){_0x351ea0[_0xd8b4('0x8')]+=0x1;updateWaitingCounter(_0x351ea0);}}}else{if(!_0x351ea0[_0xd8b4('0xd')]){_0x351ea0[_0xd8b4('0x5')]+=0x1;}if(_0x351ea0['UserId']){_0x351ea0[_0xd8b4('0x6')]+=0x1;updateWaitingCounter(_0x351ea0);}}_0x351ea0['total']+=0x1;return _0x351ea0;}function getLastMessageText(_0x297244){return db[_0xd8b4('0xe')][_0xd8b4('0xf')]({'where':{'$and':[{'MailInteractionId':_0x297244['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd8b4('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd8b4('0x11')],'order':_0xd8b4('0x12'),'raw':!![]})[_0xd8b4('0x13')](function(_0x563321){if(_0x563321&&_0x563321[_0xd8b4('0x11')]){_0x297244[_0xd8b4('0x14')]=_['trimStart'](_0x563321[_0xd8b4('0x11')]);}return _0x297244;})[_0xd8b4('0x15')](function(_0x57a648){throw _0x57a648;});}exports[_0xd8b4('0x16')]=function(_0x94a6ff,_0x51af98,_0x5a7528,_0xd817d0){return new Promise(function(_0x21153b,_0x4c81b4){return getInteractionUsers(_0x94a6ff['id'],_0x5a7528)[_0xd8b4('0x13')](function(_0x1d5def){_0x94a6ff[_0xd8b4('0x17')]=_0x1d5def;return getInteractionTags(_0x94a6ff[_0xd8b4('0x18')],_0x51af98);})[_0xd8b4('0x13')](function(_0x47732a){_0x94a6ff[_0xd8b4('0x19')]=_0x47732a;delete _0x94a6ff[_0xd8b4('0x18')];return updateInteractionCounters(_0x94a6ff);})[_0xd8b4('0x13')](function(_0xe09986){if(_0xd817d0){return getLastMessageText(_0xe09986);}else{return _0xe09986;}})[_0xd8b4('0x13')](function(_0x38b7ec){_0x21153b(_0x38b7ec);})['catch'](function(_0x319f4c){_0x4c81b4(_0x319f4c);});});}; \ No newline at end of file +var _0xcf62=['TagIds','Tags','lodash','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','closed','UserId','disposition','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','catch','updateInteraction','Users'];(function(_0x7c1169,_0x482c23){var _0x254edd=function(_0x4e2c19){while(--_0x4e2c19){_0x7c1169['push'](_0x7c1169['shift']());}};_0x254edd(++_0x482c23);}(_0xcf62,0x13a));var _0x2cf6=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xcf62[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x2cf6('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x5e0075,_0x1cda51){return new Promise(function(_0x45f9b4,_0x43b395){try{var _0x6c394a=[];if(_0x1cda51[_0x5e0075]){_0x6c394a=_0x1cda51[_0x5e0075]['map'](function(_0x2442b4){return{'id':_0x2442b4['id'],'fullname':_0x2442b4['fullname']};});}return _0x45f9b4(_0x6c394a);}catch(_0x324c44){_0x43b395(_0x324c44);}});}function getInteractionTags(_0x2e08a3,_0x342ad7){var _0x1c1d59=[];if(_0x2e08a3){_0x2e08a3[_0x2cf6('0x1')](',')[_0x2cf6('0x2')](function(_0x5f4f10){_0x1c1d59[_0x2cf6('0x3')](_0x342ad7[_0x5f4f10]);});}return _0x1c1d59;}function updateWaitingCounter(_0x2419d6){if(_0x2419d6[_0x2cf6('0x4')]){_0x2419d6['waiting']-=0x1;}}function updateInteractionCounters(_0x5e781b){_0x5e781b[_0x2cf6('0x4')]=0x0;_0x5e781b[_0x2cf6('0x5')]=0x0;_0x5e781b[_0x2cf6('0x6')]=0x0;_0x5e781b[_0x2cf6('0x7')]=0x0;_0x5e781b[_0x2cf6('0x8')]=0x0;_0x5e781b['total']=0x0;if(_0x5e781b[_0x2cf6('0x9')]){if(_0x5e781b['disposition']==='abandoned'){_0x5e781b[_0x2cf6('0x8')]+=0x1;updateWaitingCounter(_0x5e781b);}if(_0x5e781b[_0x2cf6('0xa')]){_0x5e781b[_0x2cf6('0x6')]+=0x1;if(_0x5e781b[_0x2cf6('0x5')]){_0x5e781b[_0x2cf6('0x5')]-=0x1;}}else{if(_0x5e781b[_0x2cf6('0xb')]){_0x5e781b[_0x2cf6('0x7')]+=0x1;updateWaitingCounter(_0x5e781b);}}}else{if(!_0x5e781b[_0x2cf6('0xa')]){_0x5e781b[_0x2cf6('0x4')]+=0x1;}if(_0x5e781b['UserId']){_0x5e781b[_0x2cf6('0x5')]+=0x1;updateWaitingCounter(_0x5e781b);}}_0x5e781b['total']+=0x1;return _0x5e781b;}function getLastMessageText(_0x3176fe){return db[_0x2cf6('0xc')][_0x2cf6('0xd')]({'where':{'$and':[{'MailInteractionId':_0x3176fe['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2cf6('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2cf6('0xf')],'order':_0x2cf6('0x10'),'raw':!![]})[_0x2cf6('0x11')](function(_0x20682d){if(_0x20682d&&_0x20682d[_0x2cf6('0xf')]){_0x3176fe[_0x2cf6('0x12')]=_['trimStart'](_0x20682d[_0x2cf6('0xf')]);}return _0x3176fe;})[_0x2cf6('0x13')](function(_0x3316ab){throw _0x3316ab;});}exports[_0x2cf6('0x14')]=function(_0x59f507,_0x3feaa5,_0x12dc2a,_0x5b0ea3){return new Promise(function(_0x296b31,_0x482c21){return getInteractionUsers(_0x59f507['id'],_0x12dc2a)[_0x2cf6('0x11')](function(_0x5799e2){_0x59f507[_0x2cf6('0x15')]=_0x5799e2;return getInteractionTags(_0x59f507[_0x2cf6('0x16')],_0x3feaa5);})['then'](function(_0x41d7b0){_0x59f507[_0x2cf6('0x17')]=_0x41d7b0;delete _0x59f507[_0x2cf6('0x16')];return updateInteractionCounters(_0x59f507);})[_0x2cf6('0x11')](function(_0x48e555){if(_0x5b0ea3){return getLastMessageText(_0x48e555);}else{return _0x48e555;}})['then'](function(_0x226569){_0x296b31(_0x226569);})[_0x2cf6('0x13')](function(_0x28de10){_0x482c21(_0x28de10);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index f807bc9..95da5f7 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 _0xdda7=['Account','InteractionId','upperFirst','websites','accounts','_messages','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','Interaction','then','update','info','error','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website'];(function(_0x105a98,_0x1b6e37){var _0x1e1d87=function(_0x123778){while(--_0x123778){_0x105a98['push'](_0x105a98['shift']());}};_0x1e1d87(++_0x1b6e37);}(_0xdda7,0xdc));var _0x7dda=function(_0x212ead,_0x51d20d){_0x212ead=_0x212ead-0x0;var _0x366d71=_0xdda7[_0x212ead];return _0x366d71;};'use strict';var _=require(_0x7dda('0x0'));var db=require(_0x7dda('0x1'))['db'];var loggers={'openchannel':require(_0x7dda('0x2'))(_0x7dda('0x3')),'mail':require('../../config/logger')(_0x7dda('0x4')),'fax':require(_0x7dda('0x2'))(_0x7dda('0x5')),'sms':require(_0x7dda('0x2'))(_0x7dda('0x6')),'chat':require('../../config/logger')(_0x7dda('0x7')),'whatsapp':require(_0x7dda('0x2'))(_0x7dda('0x8'))};function getAccountFK(_0x3449f8){return _[_0x7dda('0x9')](_0x3449f8)+(_0x3449f8===_0x7dda('0xa')?_0x7dda('0xb'):_0x7dda('0xc'))+'Id';}function getInteractionFK(_0x55a851){return _[_0x7dda('0x9')](_0x55a851)+_0x7dda('0xd');}function getInteractionId(_0xf11204,_0x3b3acf,_0x48e7e2){if(_0xf11204&&_0xf11204[_[_0x7dda('0xe')](_0x48e7e2)+_0x7dda('0xd')]){return _0xf11204[_['upperFirst'](_0x48e7e2)+_0x7dda('0xd')];}else if(_0xf11204&&_0xf11204['id']){return _0xf11204['id'];}else if(_0x3b3acf&&_0x3b3acf['id']){return _0x3b3acf['id'];}else{return'unknown';}}function getInteractionsTables(_0x1103cc){return{'accounts':_0x1103cc+'_'+(_0x1103cc===_0x7dda('0xa')?_0x7dda('0xf'):_0x7dda('0x10')),'interactions':_0x1103cc+'_interactions','interactionsTags':_0x1103cc+'_interaction_has_tags','messages':_0x1103cc+_0x7dda('0x11'),'userInteractions':'user_has_'+_0x1103cc+'_interactions'};}function getSelectedTags(_0x5ebbc9){var _0x39ad60=[];if(_0x5ebbc9){_0x39ad60=Array[_0x7dda('0x12')](_0x5ebbc9)?_0x5ebbc9:[_0x5ebbc9];}return _0x39ad60;}function log(_0x1a090f,_0x3d6f6e,_0x25c7f3,_0x1afa3d,_0x5af572,_0x5dec47){loggers[_0x5af572[_0x7dda('0x13')]()][_0x1a090f](_0x7dda('0x14'),_0x5dec47[_0x7dda('0x15')](),_0x3d6f6e?_0x3d6f6e['id']:null,_0x3d6f6e?_0x3d6f6e['name']:null,_0x3d6f6e?_0x3d6f6e['role']:null,getInteractionId(_0x25c7f3,_0x1afa3d,_0x5af572),_0x25c7f3?JSON[_0x7dda('0x16')](_0x25c7f3):_0x7dda('0x17'));}function updateUser(_0x1444e8,_0x1d1213,_0x41080d,_0x4af68f,_0x2ca369){db[_[_0x7dda('0xe')](_0x4af68f)+_0x7dda('0x18')]['findOne']({'where':{'id':getInteractionId(_0x1d1213,_0x41080d,_0x4af68f)}})[_0x7dda('0x19')](function(_0x5a2ab7){if(_0x5a2ab7){return _0x5a2ab7[_0x7dda('0x1a')]({'UserId':_0x1444e8?_0x1444e8['id']:null});}})[_0x7dda('0x19')](function(_0x5392d6){if(_0x5392d6){log(_0x7dda('0x1b'),_0x1444e8,_0x1d1213,_0x41080d,_0x4af68f,_0x2ca369);}})['catch'](function(){log(_0x7dda('0x1c'),_0x1444e8,_0x1d1213,_0x41080d,_0x4af68f,_0x2ca369);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x0561=['then','catch','error','exports','lodash','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','findOne','update'];(function(_0x2d0bdd,_0x299c2f){var _0x80ebfb=function(_0x15c145){while(--_0x15c145){_0x2d0bdd['push'](_0x2d0bdd['shift']());}};_0x80ebfb(++_0x299c2f);}(_0x0561,0xfc));var _0x1056=function(_0x3dd5cf,_0x2a54dd){_0x3dd5cf=_0x3dd5cf-0x0;var _0x45e83c=_0x0561[_0x3dd5cf];return _0x45e83c;};'use strict';var _=require(_0x1056('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0x1056('0x1')),'mail':require(_0x1056('0x2'))(_0x1056('0x3')),'fax':require(_0x1056('0x2'))(_0x1056('0x4')),'sms':require(_0x1056('0x2'))('sms-interactions'),'chat':require(_0x1056('0x2'))(_0x1056('0x5')),'whatsapp':require('../../config/logger')(_0x1056('0x6'))};function getAccountFK(_0x19c4d0){return _[_0x1056('0x7')](_0x19c4d0)+(_0x19c4d0===_0x1056('0x8')?_0x1056('0x9'):_0x1056('0xa'))+'Id';}function getInteractionFK(_0x344343){return _['capitalize'](_0x344343)+_0x1056('0xb');}function getInteractionId(_0x26e74f,_0x14bb5e,_0x1256c9){if(_0x26e74f&&_0x26e74f[_[_0x1056('0xc')](_0x1256c9)+_0x1056('0xb')]){return _0x26e74f[_[_0x1056('0xc')](_0x1256c9)+_0x1056('0xb')];}else if(_0x26e74f&&_0x26e74f['id']){return _0x26e74f['id'];}else if(_0x14bb5e&&_0x14bb5e['id']){return _0x14bb5e['id'];}else{return _0x1056('0xd');}}function getInteractionsTables(_0x4ed82a){return{'accounts':_0x4ed82a+'_'+(_0x4ed82a===_0x1056('0x8')?_0x1056('0xe'):_0x1056('0xf')),'interactions':_0x4ed82a+_0x1056('0x10'),'interactionsTags':_0x4ed82a+'_interaction_has_tags','messages':_0x4ed82a+_0x1056('0x11'),'userInteractions':'user_has_'+_0x4ed82a+_0x1056('0x10')};}function getSelectedTags(_0x3a7417){var _0x294c1c=[];if(_0x3a7417){_0x294c1c=Array[_0x1056('0x12')](_0x3a7417)?_0x3a7417:[_0x3a7417];}return _0x294c1c;}function log(_0x211759,_0x23fd07,_0x2edfb5,_0xf6c305,_0x7a7b0e,_0x3bc649){loggers[_0x7a7b0e[_0x1056('0x13')]()][_0x211759](_0x1056('0x14'),_0x3bc649[_0x1056('0x15')](),_0x23fd07?_0x23fd07['id']:null,_0x23fd07?_0x23fd07[_0x1056('0x16')]:null,_0x23fd07?_0x23fd07[_0x1056('0x17')]:null,getInteractionId(_0x2edfb5,_0xf6c305,_0x7a7b0e),_0x2edfb5?JSON[_0x1056('0x18')](_0x2edfb5):'null');}function updateUser(_0x10e1ed,_0x56e4b4,_0x8bcb0c,_0x4aeca0,_0x5248d4){db[_[_0x1056('0xc')](_0x4aeca0)+'Interaction'][_0x1056('0x19')]({'where':{'id':getInteractionId(_0x56e4b4,_0x8bcb0c,_0x4aeca0)}})['then'](function(_0x43b139){if(_0x43b139){return _0x43b139[_0x1056('0x1a')]({'UserId':_0x10e1ed?_0x10e1ed['id']:null});}})[_0x1056('0x1b')](function(_0x5429e0){if(_0x5429e0){log('info',_0x10e1ed,_0x56e4b4,_0x8bcb0c,_0x4aeca0,_0x5248d4);}})[_0x1056('0x1c')](function(){log(_0x1056('0x1d'),_0x10e1ed,_0x56e4b4,_0x8bcb0c,_0x4aeca0,_0x5248d4);});}module[_0x1056('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 cf9afa1..e924b53 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 _0xcb99=['then','status','json','catch','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','License','findOne'];(function(_0x8cae4f,_0x2ce6f2){var _0x555907=function(_0x333afc){while(--_0x333afc){_0x8cae4f['push'](_0x8cae4f['shift']());}};_0x555907(++_0x2ce6f2);}(_0xcb99,0x1e7));var _0x9cb9=function(_0xcf95b4,_0x24baf1){_0xcf95b4=_0xcf95b4-0x0;var _0x20d28b=_0xcb99[_0xcf95b4];return _0x20d28b;};'use strict';var crypto=require(_0x9cb9('0x0'));var util=require(_0x9cb9('0x1'));var compose=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];var config=require(_0x9cb9('0x4'));function getValueFromLicense(_0x491f1d,_0x4bb395){if(_0x491f1d&&_0x4bb395){if(_0x4bb395['data1']&&_0x4bb395['license']){var _0x14ca54=_0x4bb395[_0x9cb9('0x5')];var _0x4d0473=_0x4bb395[_0x9cb9('0x6')];var _0x576e95=_0x14ca54[_0x9cb9('0x7')]('-')[0x4];var _0x1aa6ac=_0x14ca54[_0x9cb9('0x7')]('-')[0x0];var _0x299ae9=crypto[_0x9cb9('0x8')]('aes-256-ctr',util[_0x9cb9('0x9')](_0x9cb9('0xa'),_0x576e95,_0x14ca54,_0x1aa6ac));var _0x56af53=_0x299ae9[_0x9cb9('0xb')](_0x4d0473,_0x9cb9('0xc'),_0x9cb9('0xd'));_0x56af53+=_0x299ae9[_0x9cb9('0xe')](_0x9cb9('0xd'));var _0x47f4a9=JSON['parse'](_0x56af53);return _0x47f4a9['hasOwnProperty'](_0x491f1d)?_0x47f4a9[_0x491f1d]:null;}}return null;}function isLimit(_0x56691e,_0x2c3c9a,_0x7de729,_0x2ef535){var _0x531b85=_0x2c3c9a;return compose()['use'](function(_0xfcb452,_0x11716f,_0x15558b){return db[_0x9cb9('0xf')][_0x9cb9('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x9cb9('0x11')](function(_0x52a8fd){var _0xa16ef5=getValueFromLicense(_0x56691e,_0x52a8fd);return _0xa16ef5?_0xa16ef5:_0x531b85;})[_0x9cb9('0x11')](function(_0x503903){_0x531b85=_0x503903;return _0x7de729['count'](_0x2ef535);})[_0x9cb9('0x11')](function(_0xab8ea){if(_0xab8ea>=_0x531b85){return _0x11716f[_0x9cb9('0x12')](0x193)[_0x9cb9('0x13')]({'message':util[_0x9cb9('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x56691e)});}_0x15558b();})[_0x9cb9('0x14')](function(_0x4c6b23){_0x15558b(_0x4c6b23);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x9cb9('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x9cb9('0x16')}]}});}exports[_0x9cb9('0x17')]=isUserLimit; \ No newline at end of file +var _0x2d79=['composable-middleware','../../mysqldb','data1','license','split','format','update','utf8','final','hasOwnProperty','use','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit'];(function(_0x1c7e9f,_0x204da1){var _0x5beb22=function(_0x2bb1f1){while(--_0x2bb1f1){_0x1c7e9f['push'](_0x1c7e9f['shift']());}};_0x5beb22(++_0x204da1);}(_0x2d79,0x18f));var _0x92d7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2d79[_0x57b54c];return _0x59cc19;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x92d7('0x0'));var db=require(_0x92d7('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x5f5cdc,_0x39c3e7){if(_0x5f5cdc&&_0x39c3e7){if(_0x39c3e7[_0x92d7('0x2')]&&_0x39c3e7[_0x92d7('0x3')]){var _0x46f34e=_0x39c3e7[_0x92d7('0x2')];var _0xf59104=_0x39c3e7[_0x92d7('0x3')];var _0x268253=_0x46f34e[_0x92d7('0x4')]('-')[0x4];var _0x1d1df0=_0x46f34e[_0x92d7('0x4')]('-')[0x0];var _0x24aded=crypto['createDecipher']('aes-256-ctr',util[_0x92d7('0x5')]('%s:%s:%s',_0x268253,_0x46f34e,_0x1d1df0));var _0xbada97=_0x24aded[_0x92d7('0x6')](_0xf59104,'base64',_0x92d7('0x7'));_0xbada97+=_0x24aded[_0x92d7('0x8')]('utf8');var _0x2e1f86=JSON['parse'](_0xbada97);return _0x2e1f86[_0x92d7('0x9')](_0x5f5cdc)?_0x2e1f86[_0x5f5cdc]:null;}}return null;}function isLimit(_0x329991,_0x1630ee,_0x2e6e5b,_0x272690){var _0x1851c1=_0x1630ee;return compose()[_0x92d7('0xa')](function(_0xd333a8,_0x3ed317,_0x508d29){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x92d7('0xb')](function(_0x30beb4){var _0x384d42=getValueFromLicense(_0x329991,_0x30beb4);return _0x384d42?_0x384d42:_0x1851c1;})['then'](function(_0x18d676){_0x1851c1=_0x18d676;return _0x2e6e5b[_0x92d7('0xc')](_0x272690);})[_0x92d7('0xb')](function(_0x34cb12){if(_0x34cb12>=_0x1851c1){return _0x3ed317[_0x92d7('0xd')](0x193)[_0x92d7('0xe')]({'message':util['format'](_0x92d7('0xf'),_0x329991)});}_0x508d29();})[_0x92d7('0x10')](function(_0x3cb2d6){_0x508d29(_0x3cb2d6);});});}function isUserLimit(){return isLimit(_0x92d7('0x11'),0x1,db[_0x92d7('0x12')],{'where':{'$or':[{'role':_0x92d7('0x13')},{'role':'user'}]}});}exports[_0x92d7('0x14')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4dd1bd4..b4a3631 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 _0x919a=['<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','minutes','format','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','split','length','slice','forEach','shift','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','$gt','add','days','castTo','CAST(','field','text','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$eq','=\x20?'];(function(_0x3473c7,_0x3fc87a){var _0x3b3006=function(_0xa44df0){while(--_0xa44df0){_0x3473c7['push'](_0x3473c7['shift']());}};_0x3b3006(++_0x3fc87a);}(_0x919a,0x1d9));var _0xa919=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x919a[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var moment=require(_0xa919('0x0'));exports[_0xa919('0x1')]=function(_0x4dfcf4){var _0x41c3d3={'conditions':[]};_0x41c3d3[_0xa919('0x2')]=_[_0xa919('0x3')](_0x4dfcf4,_0xa919('0x4'))?'or':'and';var _0x25ab14=_0x4dfcf4[_0xa919('0x5')]('[$and]','')[_0xa919('0x5')](_0xa919('0x4'),'')[_0xa919('0x6')]('||');for(var _0x1be345=0x0;_0x1be345<_0x25ab14[_0xa919('0x7')];_0x1be345++){var _0x34d83c=_0x25ab14[_0x1be345][_0xa919('0x6')](':=');var _0x2ecf9a=_0x34d83c[0x0];var _0x5291f0=_0x34d83c[_0xa919('0x8')](0x1);_0x5291f0[_0xa919('0x9')](function(_0x42476b){var _0x98e17e=_0x42476b[_0xa919('0x6')]('[')[_0xa919('0xa')]();var _0x21f4a2=_0x42476b[_0xa919('0xb')](/\[(.*?)\]/g);_0x21f4a2['forEach'](function(_0x2b2727){var _0x203f7e=_0x2b2727[_0xa919('0x6')]('[')['filter'](function(_0x13c77c){return _0x13c77c[_0xa919('0xc')](']')>-0x1;})[_0xa919('0xd')](function(_0x4b7dc4){return _0x4b7dc4[_0xa919('0x6')](']')[0x0];})[0x0];_0x41c3d3[_0xa919('0xe')][_0xa919('0xf')]({'field':_0x2ecf9a,'operator':_0x98e17e,'value':_0x203f7e});});});}return _0x41c3d3;};exports[_0xa919('0x10')]=function(_0x4f80af,_0x5916cb,_0xf447fe){var _0x240069={};if(_0x5916cb===_0xa919('0x11')){if(_0xf447fe['operator']==='$eq'){_0xf447fe[_0xa919('0x12')]=_0xa919('0x13');_0xf447fe[_0xa919('0x14')]+=','+_0xf447fe[_0xa919('0x14')];}else if(_['includes']([_0xa919('0x15'),'$lte'],_0xf447fe[_0xa919('0x12')])){_0xf447fe[_0xa919('0x14')]=moment(_0xf447fe[_0xa919('0x14')])[_0xa919('0x16')](0x1,_0xa919('0x17'))['format']('YYYY-MM-DD');}}if(_0xf447fe[_0xa919('0x18')]){_0x5916cb=_0xf447fe[_0xa919('0x18')];_0x240069['text']=_0xa919('0x19')+_0x4f80af+'.'+_0xf447fe[_0xa919('0x1a')]+'\x20AS\x20'+_0xf447fe[_0xa919('0x18')]+')\x20'+parseOperator(_0xf447fe[_0xa919('0x12')]);}else{_0x240069[_0xa919('0x1b')]=_0x4f80af+'.'+_0xf447fe[_0xa919('0x1a')]+'\x20'+parseOperator(_0xf447fe['operator']);}if(_[_0xa919('0x1c')]([_0xa919('0x1d'),_0xa919('0x1e')],_0xf447fe[_0xa919('0x12')]))_0x240069[_0xa919('0x1b')]='('+_0x240069['text']+_0xa919('0x1f')+_0x4f80af+'.'+_0xf447fe[_0xa919('0x1a')]+_0xa919('0x20');_0x240069[_0xa919('0x14')]=parseValue(_0x5916cb,_0xf447fe['operator'],_0xf447fe[_0xa919('0x14')]);return _0x240069;};function parseOperator(_0x323f5e){var _0x2bf3ea;switch(_0x323f5e){case _0xa919('0x21'):_0x2bf3ea='IN\x20?';break;case _0xa919('0x1e'):_0x2bf3ea=_0xa919('0x22');break;case _0xa919('0x23'):_0x2bf3ea=_0xa919('0x24');break;case'$ne':_0x2bf3ea=_0xa919('0x25');break;case _0xa919('0x26'):case _0xa919('0x27'):case _0xa919('0x28'):_0x2bf3ea='LIKE\x20?';break;case _0xa919('0x29'):_0x2bf3ea=_0xa919('0x2a');break;case _0xa919('0x15'):_0x2bf3ea=_0xa919('0x2b');break;case'$lte':_0x2bf3ea=_0xa919('0x2c');break;case'$gte':_0x2bf3ea='>=\x20?';break;case _0xa919('0x13'):_0x2bf3ea=_0xa919('0x2d');break;}return _0x2bf3ea;}function parseValue(_0x2de7cb,_0x3fcd8d,_0xdf2111){var _0x2d2177={'start':undefined,'end':undefined};switch(_0x3fcd8d){case _0xa919('0x21'):case _0xa919('0x1e'):_0x2d2177[_0xa919('0x2e')]=_0xdf2111[_0xa919('0x6')](',');break;case _0xa919('0x26'):_0x2d2177[_0xa919('0x2e')]='%'+_0xdf2111+'%';break;case'$startsWith':_0x2d2177['start']=_0xdf2111+'%';break;case _0xa919('0x28'):_0x2d2177[_0xa919('0x2e')]='%'+_0xdf2111;break;case _0xa919('0x13'):var _0x53b737=_0xdf2111[_0xa919('0x6')](',');var _0xdf2111=_0x53b737['shift']();var _0x2753bf=_0x53b737[_0xa919('0x2f')]();if(_0x2de7cb===_0xa919('0x11')){_0xdf2111=moment(_0xdf2111)[_0xa919('0x30')](0x0,!![])['format']();_0x2753bf=moment(_0x2753bf)[_0xa919('0x30')](0x0,!![])[_0xa919('0x16')](0x17,'hours')['add'](0x3b,_0xa919('0x31'))[_0xa919('0x16')](0x3b,'seconds')[_0xa919('0x32')]();}_0x2d2177={'start':_0xdf2111,'end':_0x2753bf};break;default:_0x2d2177[_0xa919('0x2e')]=_0xdf2111;break;}return _0x2d2177;} \ No newline at end of file +var _0x05d1=['moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','slice','forEach','shift','match','filter','indexOf','conditions','buildExpression','DATE','operator','$eq','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','text','\x20AS\x20','field','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','<=\x20?','>=\x20?','$between','$in','$notIn','start','pop','utcOffset','minutes','seconds','lodash'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x05d1,0xa1));var _0x105d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x05d1[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x105d('0x0'));var moment=require(_0x105d('0x1'));exports[_0x105d('0x2')]=function(_0xdeb9ae){var _0x58b174={'conditions':[]};_0x58b174[_0x105d('0x3')]=_[_0x105d('0x4')](_0xdeb9ae,_0x105d('0x5'))?'or':_0x105d('0x6');var _0x4482d2=_0xdeb9ae['replace']('[$and]','')[_0x105d('0x7')](_0x105d('0x5'),'')[_0x105d('0x8')]('||');for(var _0x255cf7=0x0;_0x255cf7<_0x4482d2['length'];_0x255cf7++){var _0x2a0f21=_0x4482d2[_0x255cf7][_0x105d('0x8')](':=');var _0x4812c4=_0x2a0f21[0x0];var _0xdb2237=_0x2a0f21[_0x105d('0x9')](0x1);_0xdb2237[_0x105d('0xa')](function(_0x19fcfa){var _0x38cb2c=_0x19fcfa[_0x105d('0x8')]('[')[_0x105d('0xb')]();var _0x2c5a84=_0x19fcfa[_0x105d('0xc')](/\[(.*?)\]/g);_0x2c5a84['forEach'](function(_0x43cb0f){var _0x8a5697=_0x43cb0f[_0x105d('0x8')]('[')[_0x105d('0xd')](function(_0x357df4){return _0x357df4[_0x105d('0xe')](']')>-0x1;})['map'](function(_0x4f67b6){return _0x4f67b6[_0x105d('0x8')](']')[0x0];})[0x0];_0x58b174[_0x105d('0xf')]['push']({'field':_0x4812c4,'operator':_0x38cb2c,'value':_0x8a5697});});});}return _0x58b174;};exports[_0x105d('0x10')]=function(_0x49d3a8,_0x2c2f7b,_0x44129e){var _0x49c47d={};if(_0x2c2f7b===_0x105d('0x11')){if(_0x44129e[_0x105d('0x12')]===_0x105d('0x13')){_0x44129e[_0x105d('0x12')]='$between';_0x44129e[_0x105d('0x14')]+=','+_0x44129e[_0x105d('0x14')];}else if(_[_0x105d('0x15')](['$gt',_0x105d('0x16')],_0x44129e[_0x105d('0x12')])){_0x44129e[_0x105d('0x14')]=moment(_0x44129e[_0x105d('0x14')])[_0x105d('0x17')](0x1,_0x105d('0x18'))[_0x105d('0x19')](_0x105d('0x1a'));}}if(_0x44129e[_0x105d('0x1b')]){_0x2c2f7b=_0x44129e['castTo'];_0x49c47d[_0x105d('0x1c')]='CAST('+_0x49d3a8+'.'+_0x44129e['field']+_0x105d('0x1d')+_0x44129e['castTo']+')\x20'+parseOperator(_0x44129e[_0x105d('0x12')]);}else{_0x49c47d[_0x105d('0x1c')]=_0x49d3a8+'.'+_0x44129e[_0x105d('0x1e')]+'\x20'+parseOperator(_0x44129e[_0x105d('0x12')]);}if(_[_0x105d('0x15')](['$ne','$notIn'],_0x44129e[_0x105d('0x12')]))_0x49c47d[_0x105d('0x1c')]='('+_0x49c47d[_0x105d('0x1c')]+_0x105d('0x1f')+_0x49d3a8+'.'+_0x44129e[_0x105d('0x1e')]+_0x105d('0x20');_0x49c47d[_0x105d('0x14')]=parseValue(_0x2c2f7b,_0x44129e[_0x105d('0x12')],_0x44129e['value']);return _0x49c47d;};function parseOperator(_0x3d3498){var _0x31bc4a;switch(_0x3d3498){case'$in':_0x31bc4a=_0x105d('0x21');break;case'$notIn':_0x31bc4a='NOT\x20IN\x20?';break;case _0x105d('0x13'):_0x31bc4a=_0x105d('0x22');break;case _0x105d('0x23'):_0x31bc4a=_0x105d('0x24');break;case _0x105d('0x25'):case _0x105d('0x26'):case _0x105d('0x27'):_0x31bc4a=_0x105d('0x28');break;case _0x105d('0x29'):_0x31bc4a=_0x105d('0x2a');break;case _0x105d('0x2b'):_0x31bc4a='>\x20?';break;case _0x105d('0x16'):_0x31bc4a=_0x105d('0x2c');break;case'$gte':_0x31bc4a=_0x105d('0x2d');break;case _0x105d('0x2e'):_0x31bc4a='BETWEEN\x20?\x20AND\x20?';break;}return _0x31bc4a;}function parseValue(_0x4150d2,_0x1d5a91,_0x144052){var _0x4ce597={'start':undefined,'end':undefined};switch(_0x1d5a91){case _0x105d('0x2f'):case _0x105d('0x30'):_0x4ce597[_0x105d('0x31')]=_0x144052[_0x105d('0x8')](',');break;case _0x105d('0x25'):_0x4ce597[_0x105d('0x31')]='%'+_0x144052+'%';break;case _0x105d('0x26'):_0x4ce597[_0x105d('0x31')]=_0x144052+'%';break;case'$endsWith':_0x4ce597[_0x105d('0x31')]='%'+_0x144052;break;case _0x105d('0x2e'):var _0x42d2c6=_0x144052['split'](',');var _0x144052=_0x42d2c6['shift']();var _0x32760d=_0x42d2c6[_0x105d('0x32')]();if(_0x4150d2===_0x105d('0x11')){_0x144052=moment(_0x144052)[_0x105d('0x33')](0x0,!![])[_0x105d('0x19')]();_0x32760d=moment(_0x32760d)[_0x105d('0x33')](0x0,!![])[_0x105d('0x17')](0x17,'hours')[_0x105d('0x17')](0x3b,_0x105d('0x34'))[_0x105d('0x17')](0x3b,_0x105d('0x35'))[_0x105d('0x19')]();}_0x4ce597={'start':_0x144052,'end':_0x32760d};break;default:_0x4ce597[_0x105d('0x31')]=_0x144052;break;}return _0x4ce597;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 64e6a96..7113bea 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 _0xca9e=['query','$id','model','intersection','attributes','fields','where','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','split','filters','isEmpty','forOwn','find','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','sort','map','priority','cast','substr','DESC','col','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','getOptions'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0xca9e,0x136));var _0xeca9=function(_0x459da1,_0xff1d3a){_0x459da1=_0x459da1-0x0;var _0x16b609=_0xca9e[_0x459da1];return _0x16b609;};'use strict';var _=require(_0xeca9('0x0'));var sequelize=require(_0xeca9('0x1'));var moment=require(_0xeca9('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1c579d){var _0x2df937=['ne'];try{var _0x1443e3=JSON[_0xeca9('0x3')](_0x1c579d);var _0x2c6185=Object[_0xeca9('0x4')](_0x1443e3)[0x0];return _0x2df937[_0xeca9('0x5')](_0x2c6185);}catch(_0x3aba81){return![];}}function getOperatorValue(_0x1c4ce6){var _0x186a47=JSON[_0xeca9('0x3')](_0x1c4ce6);var _0x483e41=Object[_0xeca9('0x4')](_0x186a47)[0x0];var _0x1774f3=_0x186a47[_0x483e41];return{['$'+_0x483e41]:_0x1774f3};}exports['fields']=function(_0x4eaf49){var _0x1ef0f3=null;if(_0x4eaf49){_0x1ef0f3=_0x4eaf49[_0xeca9('0x6')](',');}return _0x1ef0f3;};exports[_0xeca9('0x7')]=function(_0x5305ce,_0x2dba50){var _0x364eb2={};if(!_[_0xeca9('0x8')](_0x5305ce)){_[_0xeca9('0x9')](_0x5305ce,function(_0x19584d,_0x3d06fe){try{if(_0x2dba50){var _0x5b5fbf=_[_0xeca9('0xa')](_0x2dba50,{'name':_0x3d06fe})||{};if(hasSequelizeOperator(_0x19584d)){_0x364eb2[_0x3d06fe]=getOperatorValue(_0x19584d);}else if(_0x5b5fbf[_0xeca9('0xb')]==='DATE'&&_[_0xeca9('0xc')](_0x19584d)){var _0x4b2ae1=JSON[_0xeca9('0x3')](_0x19584d);var _0x5e7e73={'$gte':moment(moment(_0x4b2ae1['$gte'])[_0xeca9('0xd')](_0xeca9('0xe')))[_0xeca9('0xf')]()['format'](),'$lte':moment(moment(_0x4b2ae1[_0xeca9('0x10')])[_0xeca9('0xd')](_0xeca9('0xe')))[_0xeca9('0xf')]()['subtract'](0x1,'s')['format']()};_0x364eb2[_0x3d06fe]=_0x5e7e73;}else if(_0x5b5fbf[_0xeca9('0x11')]===_0xeca9('0x12')){_0x364eb2[_0x3d06fe]=_0x19584d;}else{_0x364eb2[_0x3d06fe]=_['isArray'](_0x19584d)?_0x19584d:JSON[_0xeca9('0x3')](_0x19584d);}}else{_0x364eb2[_0x3d06fe]=_[_0xeca9('0x13')](_0x19584d)?_0x19584d:JSON['parse'](_0x19584d);}}catch(_0x517060){_0x364eb2[_0x3d06fe]=_0x19584d['split'](',');}});}return _0x364eb2;};exports[_0xeca9('0x14')]=function(_0x304f8f){_0x304f8f=parseInt(_0x304f8f,0xa);if(!_0x304f8f||_0x304f8f<0x0){_0x304f8f=LIMIT_VALUE;}return _0x304f8f;};exports[_0xeca9('0x15')]=function(_0x5dde5f){_0x5dde5f=parseInt(_0x5dde5f,0xa);if(!_0x5dde5f||_0x5dde5f<0x0){_0x5dde5f=0x0;}return _0x5dde5f;};exports[_0xeca9('0x16')]=function(_0x5a5c52){var _0x5bbdce,_0x317159=null;if(_0x5a5c52){_0x5bbdce=_0x5a5c52['split'](',');_0x317159=_[_0xeca9('0x17')](_0x5bbdce,function(_0x1c4dd6){if(_0x1c4dd6['indexOf']('-')===0x0){return[_0x1c4dd6===_0xeca9('0x18')?sequelize[_0xeca9('0x19')](sequelize['col'](_0xeca9('0x18')),'unsigned'):_0x1c4dd6[_0xeca9('0x1a')](0x1),_0xeca9('0x1b')];}else{return[_0x1c4dd6===_0xeca9('0x18')?sequelize['cast'](sequelize[_0xeca9('0x1c')](_0xeca9('0x18')),'unsigned'):_0x1c4dd6,_0xeca9('0x1d')];}});}return _0x317159;};exports[_0xeca9('0x1e')]=function(_0x2b2c70,_0x26bb0c){if(_['isEmpty'](_0x2b2c70)){return _0x2b2c70;}if(_[_0xeca9('0x13')](_0x2b2c70)){for(var _0x57e190=0x0;_0x57e190<_0x2b2c70[_0xeca9('0x1f')];_0x57e190+=0x1){_0x2b2c70[_0x57e190]=this[_0xeca9('0x1e')](_0x2b2c70[_0x57e190],_0x26bb0c);}return _0x2b2c70;}if(!_[_0xeca9('0x20')](_0x2b2c70)){return _0x2b2c70;}if(_[_0xeca9('0x21')](_0x26bb0c)){_0x26bb0c=[_0x26bb0c];}if(!_[_0xeca9('0x13')](_0x26bb0c)){return _0x2b2c70;}for(var _0x2f63dc=0x0;_0x2f63dc<_0x26bb0c[_0xeca9('0x1f')];_0x2f63dc+=0x1){_[_0xeca9('0x22')](_0x2b2c70,_0x26bb0c[_0x2f63dc]);}for(var _0x467979 in _0x2b2c70){if(_0x2b2c70[_0xeca9('0x23')](_0x467979)){_0x2b2c70[_0x467979]=this[_0xeca9('0x1e')](_0x2b2c70[_0x467979],_0x26bb0c);}}return _0x2b2c70;};exports[_0xeca9('0x24')]=function(_0x424f7b){return _0x424f7b[_0xeca9('0x25')](RegExp(_0xeca9('0x26')))?!![]:![];};exports['isEmail']=function(_0x4db3e2){return _0x4db3e2['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xeca9('0x27')]=function(_0x4ffb8a){var _0x2ca943=[];_0x4ffb8a[_0xeca9('0x6')](/[ ,]+/)[_0xeca9('0x28')](function(_0x36e75e){_0x36e75e=_0x36e75e[_0xeca9('0x29')](/([^:]")"+/g,'$1');_0x36e75e='+'+_0x36e75e+'*';var _0x2d263a=/[ `!@#$%^&*()_\-?~]/;if(_0x36e75e['match'](_0x2d263a))_0x36e75e='\x22'+_0x36e75e+'\x22';_0x2ca943[_0xeca9('0x2a')](_0x36e75e);});return _0x2ca943['join']('\x20');};exports[_0xeca9('0x2b')]=function(_0x23a5fe,_0x219dd6,_0x5ee4a6){var _0x21357d={},_0x33c4e0={};if(_0x219dd6[_0xeca9('0x2c')][_0xeca9('0x2d')]){_0x219dd6['query']['id']=_0x219dd6[_0xeca9('0x2c')]['$id'];delete _0x219dd6[_0xeca9('0x2c')][_0xeca9('0x2d')];}_0x21357d[_0xeca9('0x2e')]=_[_0xeca9('0x17')](_0x23a5fe,_0xeca9('0x11'));_0x21357d[_0xeca9('0x2c')]=_['keys'](_0x219dd6[_0xeca9('0x2c')]);_0x21357d[_0xeca9('0x7')]=_[_0xeca9('0x2f')](_0x21357d[_0xeca9('0x2e')],_0x21357d[_0xeca9('0x2c')]);_0x33c4e0[_0xeca9('0x30')]=_[_0xeca9('0x2f')](_0x21357d['model'],this[_0xeca9('0x31')](_0x219dd6[_0xeca9('0x2c')][_0xeca9('0x31')]));_0x33c4e0[_0xeca9('0x30')]=_0x33c4e0[_0xeca9('0x30')][_0xeca9('0x1f')]?_0x33c4e0['attributes']:_0x21357d[_0xeca9('0x2e')];if(!_0x219dd6['query'][_0xeca9('0x23')]('nolimit')){_0x33c4e0[_0xeca9('0x14')]=this[_0xeca9('0x14')](_0x219dd6['query'][_0xeca9('0x14')]);_0x33c4e0['offset']=this[_0xeca9('0x15')](_0x219dd6['query'][_0xeca9('0x15')]);}_0x33c4e0['order']=this[_0xeca9('0x16')](_0x219dd6[_0xeca9('0x2c')]['sort']);_0x33c4e0[_0xeca9('0x32')]=this[_0xeca9('0x7')](_['pick'](_0x219dd6[_0xeca9('0x2c')],_0x21357d[_0xeca9('0x7')]),_0x23a5fe);if(_0x219dd6[_0xeca9('0x2c')][_0xeca9('0x33')]){var _0xb1f2fc=_0x23a5fe;var _0x2d72e3=_0x219dd6[_0xeca9('0x2c')][_0xeca9('0x33')];if(typeof _0x2d72e3===_0xeca9('0x34')){_0xb1f2fc=_['filter'](_0x23a5fe,function(_0x380aa2){return _[_0xeca9('0x5')](_0x2d72e3[_0xeca9('0x35')],_0x380aa2[_0xeca9('0x11')]);});_0x2d72e3=_0x2d72e3[_0xeca9('0x36')];}_0x33c4e0[_0xeca9('0x32')]=_[_0xeca9('0x37')](_0x33c4e0['where'],{'$or':_[_0xeca9('0x17')](_0xb1f2fc,function(_0x388943){if(_0x388943[_0xeca9('0xb')]!==_0xeca9('0x38')){if(_0x5ee4a6){return sequelize[_0xeca9('0x32')](sequelize['fn']('lower',sequelize[_0xeca9('0x1c')](_0x388943[_0xeca9('0x11')])),{'$like':sequelize['fn'](_0xeca9('0x39'),'%'+_0x219dd6[_0xeca9('0x2c')]['filter']+'%')});}else{var _0x427a5c={};_0x427a5c[_0x388943[_0xeca9('0x11')]]={'$like':'%'+_0x219dd6['query'][_0xeca9('0x33')]+'%'};return _0x427a5c;}}})});}_0x33c4e0=_[_0xeca9('0x37')]({},_0x33c4e0,_0x219dd6[_0xeca9('0x3a')]);return _0x33c4e0;}; \ No newline at end of file +var _0xf69d=['sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','offset','sort','map','priority','cast','col','DESC','omit','length','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','model','attributes','intersection','nolimit','limit','where','pick','filter','object','columns','value','type','lower','lodash'];(function(_0x2dd6b1,_0x4485d7){var _0x494306=function(_0x46d23d){while(--_0x46d23d){_0x2dd6b1['push'](_0x2dd6b1['shift']());}};_0x494306(++_0x4485d7);}(_0xf69d,0xd3));var _0xdf69=function(_0x4d0e56,_0x489410){_0x4d0e56=_0x4d0e56-0x0;var _0xe83cf1=_0xf69d[_0x4d0e56];return _0xe83cf1;};'use strict';var _=require(_0xdf69('0x0'));var sequelize=require(_0xdf69('0x1'));var moment=require(_0xdf69('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xe063fc){var _0xf89475=['ne'];try{var _0x4e4bdd=JSON[_0xdf69('0x3')](_0xe063fc);var _0x342114=Object[_0xdf69('0x4')](_0x4e4bdd)[0x0];return _0xf89475[_0xdf69('0x5')](_0x342114);}catch(_0x177ff7){return![];}}function getOperatorValue(_0x18ce2b){var _0x2d456f=JSON[_0xdf69('0x3')](_0x18ce2b);var _0x1d2501=Object[_0xdf69('0x4')](_0x2d456f)[0x0];var _0x18a08e=_0x2d456f[_0x1d2501];return{['$'+_0x1d2501]:_0x18a08e};}exports[_0xdf69('0x6')]=function(_0x38909e){var _0x466c26=null;if(_0x38909e){_0x466c26=_0x38909e[_0xdf69('0x7')](',');}return _0x466c26;};exports[_0xdf69('0x8')]=function(_0x1e0e8d,_0x4fcc93){var _0x305726={};if(!_[_0xdf69('0x9')](_0x1e0e8d)){_[_0xdf69('0xa')](_0x1e0e8d,function(_0x21d8e0,_0x43ce3d){try{if(_0x4fcc93){var _0x1b86d4=_['find'](_0x4fcc93,{'name':_0x43ce3d})||{};if(hasSequelizeOperator(_0x21d8e0)){_0x305726[_0x43ce3d]=getOperatorValue(_0x21d8e0);}else if(_0x1b86d4['type']==='DATE'&&_['isPlainObject'](_0x21d8e0)){var _0x3dcda8=JSON[_0xdf69('0x3')](_0x21d8e0);var _0x3b557c={'$gte':moment(moment(_0x3dcda8[_0xdf69('0xb')])[_0xdf69('0xc')](_0xdf69('0xd')))['utc']()[_0xdf69('0xc')](),'$lte':moment(moment(_0x3dcda8[_0xdf69('0xe')])[_0xdf69('0xc')](_0xdf69('0xd')))['utc']()[_0xdf69('0xf')](0x1,'s')['format']()};_0x305726[_0x43ce3d]=_0x3b557c;}else if(_0x1b86d4[_0xdf69('0x10')]===_0xdf69('0x11')){_0x305726[_0x43ce3d]=_0x21d8e0;}else{_0x305726[_0x43ce3d]=_['isArray'](_0x21d8e0)?_0x21d8e0:JSON[_0xdf69('0x3')](_0x21d8e0);}}else{_0x305726[_0x43ce3d]=_[_0xdf69('0x12')](_0x21d8e0)?_0x21d8e0:JSON[_0xdf69('0x3')](_0x21d8e0);}}catch(_0x85d1d){_0x305726[_0x43ce3d]=_0x21d8e0['split'](',');}});}return _0x305726;};exports['limit']=function(_0x352400){_0x352400=parseInt(_0x352400,0xa);if(!_0x352400||_0x352400<0x0){_0x352400=LIMIT_VALUE;}return _0x352400;};exports[_0xdf69('0x13')]=function(_0x54df73){_0x54df73=parseInt(_0x54df73,0xa);if(!_0x54df73||_0x54df73<0x0){_0x54df73=0x0;}return _0x54df73;};exports[_0xdf69('0x14')]=function(_0x259e90){var _0x68fa80,_0x526cbc=null;if(_0x259e90){_0x68fa80=_0x259e90[_0xdf69('0x7')](',');_0x526cbc=_[_0xdf69('0x15')](_0x68fa80,function(_0x4d09d5){if(_0x4d09d5['indexOf']('-')===0x0){return[_0x4d09d5===_0xdf69('0x16')?sequelize[_0xdf69('0x17')](sequelize[_0xdf69('0x18')]('priority'),'unsigned'):_0x4d09d5['substr'](0x1),_0xdf69('0x19')];}else{return[_0x4d09d5==='priority'?sequelize[_0xdf69('0x17')](sequelize[_0xdf69('0x18')](_0xdf69('0x16')),'unsigned'):_0x4d09d5,'ASC'];}});}return _0x526cbc;};exports[_0xdf69('0x1a')]=function(_0x1437f6,_0x6da296){if(_[_0xdf69('0x9')](_0x1437f6)){return _0x1437f6;}if(_['isArray'](_0x1437f6)){for(var _0x3b727c=0x0;_0x3b727c<_0x1437f6[_0xdf69('0x1b')];_0x3b727c+=0x1){_0x1437f6[_0x3b727c]=this[_0xdf69('0x1a')](_0x1437f6[_0x3b727c],_0x6da296);}return _0x1437f6;}if(!_['isObject'](_0x1437f6)){return _0x1437f6;}if(_[_0xdf69('0x1c')](_0x6da296)){_0x6da296=[_0x6da296];}if(!_['isArray'](_0x6da296)){return _0x1437f6;}for(var _0x5dcabd=0x0;_0x5dcabd<_0x6da296['length'];_0x5dcabd+=0x1){_['unset'](_0x1437f6,_0x6da296[_0x5dcabd]);}for(var _0x146b6a in _0x1437f6){if(_0x1437f6[_0xdf69('0x1d')](_0x146b6a)){_0x1437f6[_0x146b6a]=this['omit'](_0x1437f6[_0x146b6a],_0x6da296);}}return _0x1437f6;};exports[_0xdf69('0x1e')]=function(_0xd81d0a){return _0xd81d0a[_0xdf69('0x1f')](RegExp(_0xdf69('0x20')))?!![]:![];};exports[_0xdf69('0x21')]=function(_0x1b57b3){return _0x1b57b3[_0xdf69('0x1f')](/^\S+@\S+$/)?!![]:![];};exports[_0xdf69('0x22')]=function(_0x1f67fe){var _0x3b97df=[];_0x1f67fe[_0xdf69('0x7')](/[ ,]+/)[_0xdf69('0x23')](function(_0x38f848){_0x38f848=_0x38f848[_0xdf69('0x24')](/([^:]")"+/g,'$1');_0x38f848='+'+_0x38f848+'*';var _0x1b145b=/[ `!@#$%^&*()_\-?~]/;if(_0x38f848[_0xdf69('0x1f')](_0x1b145b))_0x38f848='\x22'+_0x38f848+'\x22';_0x3b97df[_0xdf69('0x25')](_0x38f848);});return _0x3b97df['join']('\x20');};exports[_0xdf69('0x26')]=function(_0x2aab76,_0x20fd6e,_0x321040){var _0x1a23d1={},_0x51ee4c={};if(_0x20fd6e[_0xdf69('0x27')]['$id']){_0x20fd6e[_0xdf69('0x27')]['id']=_0x20fd6e[_0xdf69('0x27')]['$id'];delete _0x20fd6e[_0xdf69('0x27')]['$id'];}_0x1a23d1[_0xdf69('0x28')]=_[_0xdf69('0x15')](_0x2aab76,_0xdf69('0x10'));_0x1a23d1[_0xdf69('0x27')]=_[_0xdf69('0x4')](_0x20fd6e['query']);_0x1a23d1[_0xdf69('0x8')]=_['intersection'](_0x1a23d1[_0xdf69('0x28')],_0x1a23d1[_0xdf69('0x27')]);_0x51ee4c[_0xdf69('0x29')]=_[_0xdf69('0x2a')](_0x1a23d1['model'],this[_0xdf69('0x6')](_0x20fd6e['query'][_0xdf69('0x6')]));_0x51ee4c['attributes']=_0x51ee4c[_0xdf69('0x29')]['length']?_0x51ee4c[_0xdf69('0x29')]:_0x1a23d1[_0xdf69('0x28')];if(!_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x1d')](_0xdf69('0x2b'))){_0x51ee4c['limit']=this[_0xdf69('0x2c')](_0x20fd6e[_0xdf69('0x27')]['limit']);_0x51ee4c['offset']=this['offset'](_0x20fd6e['query'][_0xdf69('0x13')]);}_0x51ee4c['order']=this[_0xdf69('0x14')](_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x14')]);_0x51ee4c[_0xdf69('0x2d')]=this['filters'](_[_0xdf69('0x2e')](_0x20fd6e[_0xdf69('0x27')],_0x1a23d1[_0xdf69('0x8')]),_0x2aab76);if(_0x20fd6e['query'][_0xdf69('0x2f')]){var _0xdd919d=_0x2aab76;var _0x34ab67=_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')];if(typeof _0x34ab67===_0xdf69('0x30')){_0xdd919d=_[_0xdf69('0x2f')](_0x2aab76,function(_0x4fd313){return _['includes'](_0x34ab67[_0xdf69('0x31')],_0x4fd313[_0xdf69('0x10')]);});_0x34ab67=_0x34ab67[_0xdf69('0x32')];}_0x51ee4c[_0xdf69('0x2d')]=_['merge'](_0x51ee4c['where'],{'$or':_['map'](_0xdd919d,function(_0x5454e1){if(_0x5454e1[_0xdf69('0x33')]!=='VIRTUAL'){if(_0x321040){return sequelize[_0xdf69('0x2d')](sequelize['fn']('lower',sequelize[_0xdf69('0x18')](_0x5454e1[_0xdf69('0x10')])),{'$like':sequelize['fn'](_0xdf69('0x34'),'%'+_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')]+'%')});}else{var _0x2a7c7d={};_0x2a7c7d[_0x5454e1[_0xdf69('0x10')]]={'$like':'%'+_0x20fd6e[_0xdf69('0x27')][_0xdf69('0x2f')]+'%'};return _0x2a7c7d;}}})});}_0x51ee4c=_['merge']({},_0x51ee4c,_0x20fd6e['options']);return _0x51ee4c;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index a61ce37..ce9aba9 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 _0x67a6=['smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','lodash','jayson/promise','http','client','chatPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unavailable','isNil','voiceStatus','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','result','unknown','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','findAll','name','find','merge','globalStatus','catch','split','fields','order','ASC','fullname','internal','indexOf','validateSortParameter','DESC','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','address','faxPause','chatCapacity','mailCapacity'];(function(_0x4bfbd2,_0x120e01){var _0x4d61ec=function(_0x41e97d){while(--_0x41e97d){_0x4bfbd2['push'](_0x4bfbd2['shift']());}};_0x4d61ec(++_0x120e01);}(_0x67a6,0x67));var _0x667a=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x67a6[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x667a('0x0'));var jayson=require(_0x667a('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x667a('0x2')]({'port':0x232a});var routingClient=jayson[_0x667a('0x3')][_0x667a('0x2')]({'port':0x232c});function isAgentPaused(_0x364138,_0x8d1493){var _0x549b8d=[_0x364138[_0x667a('0x4')],_0x364138['faxPause'],_0x364138['mailPause'],_0x364138[_0x667a('0x5')],_0x364138[_0x667a('0x6')],_0x364138[_0x667a('0x7')],_0x364138[_0x667a('0x8')]];if(!_0x8d1493)return _[_0x667a('0x9')](_0x549b8d);var _0x411753=_[_0x667a('0xa')](_0x549b8d);return _0x411753[_0x667a('0xb')]>0x0&&_0x411753[_0x667a('0xb')]<_0x549b8d['length']?!![]:![];}function isIdle(_0x303fe7){return _0x303fe7===_0x667a('0xc')||_0x303fe7==='unknown'||_0x303fe7===_0x667a('0xd')||_0x303fe7==='ringing'||_[_0x667a('0xe')](_0x303fe7);}function isAgentIdle(_0x762e70){if(_0x762e70[_0x667a('0xf')]!==_0x667a('0xc')&&_0x762e70[_0x667a('0x7')]){_0x762e70[_0x667a('0xf')]=_0x667a('0x10');return![];}return _[_0x667a('0x9')]([_0x762e70['chatStatus'],_0x762e70[_0x667a('0x11')],_0x762e70[_0x667a('0x12')],_0x762e70[_0x667a('0x13')],_0x762e70[_0x667a('0x14')],_0x762e70['voiceStatus'],_0x762e70[_0x667a('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x667a('0x16')](_0x667a('0x17'),{})[_0x667a('0x18')](function(_0x2da573){if(_0x2da573[_0x667a('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x29bd1e=_0x2da573[_0x667a('0x1a')];return routingClient[_0x667a('0x16')](_0x667a('0x17'),{})['then'](function(_0x4fb06d){if(_0x4fb06d[_0x667a('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x1f3809=_0x4fb06d['result'];return _['merge']({},_0x29bd1e,_0x1f3809);});})['catch'](function(_0x419132){throw _0x419132;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x50b057){var _0x2552b3=_0x667a('0x1b');if(isAgentPaused(_0x50b057))_0x2552b3='pause';else if(isAgentPaused(_0x50b057,!![]))_0x2552b3=_0x667a('0x1c');else if(isAgentIdle(_0x50b057))_0x2552b3=_0x667a('0xc');else _0x2552b3=_0x667a('0x1d');return _0x2552b3;}exports[_0x667a('0x1e')]=getAgentStatus;function getAgentIdsByQueues(_0x345d7c,_0x1001ec){var _0x28efed=_[_0x667a('0x1f')](_0x345d7c)?_0x345d7c:[_0x345d7c];var _0x391e9d=_[_0x667a('0x20')](_0x1001ec)+_0x667a('0x21');var _0xa01470=_[_0x667a('0x22')](_0x28efed,function(_0x272519){return db[_0x391e9d]['findOne']({'where':{'id':_0x272519}})[_0x667a('0x18')](function(_0x21fcd8){if(!_0x21fcd8)return[];return _0x21fcd8['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0xa01470)[_0x667a('0x18')](function(_0x451891){var _0x251986=_(_0x451891)[_0x667a('0x23')]()[_0x667a('0x22')]('id')['uniq']()[_0x667a('0x24')]();return _0x251986;});}exports[_0x667a('0x25')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3ab810,_0xb4d1dc,_0x565597){try{if(_0xb4d1dc[_0x667a('0xb')]>0x0){_0x3ab810=_0x3ab810[_0x667a('0xa')](function(_0x964fb){return _0xb4d1dc[_0x667a('0x26')](_0x964fb['id']);});}var _0x174995=_0x3ab810[_0x667a('0xa')](function(_0x3e95d5){var _0x53b08a='busy';if(isAgentIdle(_0x3e95d5)){_0x53b08a=_0x667a('0xc');}return _0x53b08a===_0x565597;});return _[_0x667a('0x22')](_0x174995,'id');}catch(_0x5ecc40){throw _0x5ecc40;}}exports[_0x667a('0x27')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xc34143,_0x37470a,_0xb66e09){return Promise['resolve']()['then'](function(){if(_0x37470a['length']>0x0){_0xc34143=_0xc34143[_0x667a('0xa')](function(_0x3c4f23){return _0x37470a[_0x667a('0x26')](_0x3c4f23['id']);});}return _0xc34143;})[_0x667a('0x18')](function(){return db['User'][_0x667a('0x28')]({'attributes':['id',_0x667a('0x29'),'fullname',_0x667a('0x4'),'faxPause','mailPause',_0x667a('0x5'),_0x667a('0x6'),_0x667a('0x7'),_0x667a('0x8'),'pauseType'],'where':{'id':{'$in':_[_0x667a('0x22')](_0xc34143,'id')}},'raw':!![]});})[_0x667a('0x18')](function(_0x18a10c){return _0x18a10c[_0x667a('0x22')](function(_0x13cbf2){var _0x5b522b=_[_0x667a('0x2a')](_0xc34143,['id',_0x13cbf2['id']]);var _0xa6a886=filterAgentAttributes(_0x5b522b);_[_0x667a('0x2b')](_0x13cbf2,_0xa6a886);_0x13cbf2[_0x667a('0x2c')]=getAgentStatus(_0x13cbf2);return _0x13cbf2;});})[_0x667a('0x18')](function(_0x5d0951){var _0x51ab53=sortAgentsByStatus(_0x5d0951,_0xb66e09);return _[_0x667a('0x22')](_0x51ab53,'id');})[_0x667a('0x2d')](function(_0x590445){throw _0x590445;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x263a03){var _0x3511bc={'fields':[],'order':null};var _0x47695b=_0x263a03[_0x667a('0x2e')](',');_0x3511bc[_0x667a('0x2f')]=_[_0x667a('0xa')](_0x47695b,function(_0x540479){if(!_0x540479[_0x667a('0x26')](_0x667a('0x2c'))){return!![];}_0x3511bc[_0x667a('0x30')]=_['startsWith'](_0x540479,'-')?'DESC':_0x667a('0x31');return![];});return _0x3511bc;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x56c200){if(_0x56c200['includes'](_0x667a('0x32'))&&!_0x56c200[_0x667a('0x26')](_0x667a('0x33'))){var _0x2b836b=_0x56c200['substring'](0x0,_0x56c200[_0x667a('0x34')]('fullname'));_0x56c200+=','+_0x2b836b+_0x667a('0x33');}return _0x56c200;}exports[_0x667a('0x35')]=validateSortParameter;function sortAgentsByStatus(_0xf0eb3d,_0x342306){var _0x3045e9=_0xf0eb3d['sort'](function(_0x51f13d,_0x6f3550){if(_0x51f13d[_0x667a('0x2c')]===_0x6f3550[_0x667a('0x2c')]){if(_0x51f13d[_0x667a('0x2c')]==='pause'){if(_0x342306===_0x667a('0x36')){return(_0x51f13d[_0x667a('0x37')]||'')<(_0x6f3550[_0x667a('0x37')]||'')||_0x51f13d['fullname']['toLowerCase']()>_0x6f3550['fullname'][_0x667a('0x38')]()?0x1:-0x1;}else{return(_0x51f13d[_0x667a('0x37')]||'')<(_0x6f3550[_0x667a('0x37')]||'')||_0x51f13d[_0x667a('0x32')][_0x667a('0x38')]()>_0x6f3550[_0x667a('0x32')][_0x667a('0x38')]()?-0x1:0x1;}}else{if(_0x342306==='DESC'){return _0x51f13d[_0x667a('0x32')][_0x667a('0x38')]()<_0x6f3550[_0x667a('0x32')]['toLowerCase']()?0x1:-0x1;}else{return _0x51f13d[_0x667a('0x32')][_0x667a('0x38')]()<_0x6f3550[_0x667a('0x32')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x342306==='DESC'){return _0x51f13d[_0x667a('0x2c')]<_0x6f3550[_0x667a('0x2c')]?0x1:-0x1;}else{return _0x51f13d['globalStatus']<_0x6f3550[_0x667a('0x2c')]?-0x1:0x1;}}});return _0x3045e9;}exports[_0x667a('0x39')]=sortAgentsByStatus;function filterAgentAttributes(_0x3fe2d4){var _0x484286=[_0x667a('0x3a'),_0x667a('0x3b'),'lastLoginAt',_0x667a('0x3c'),_0x667a('0x37'),'lastPauseAt',_0x667a('0x33'),_0x667a('0x3d'),_0x667a('0x4'),_0x667a('0x5'),'mailPause','smsPause',_0x667a('0x8'),_0x667a('0x3e'),'voicePause',_0x667a('0x3f'),'openchannelCapacity',_0x667a('0x40'),_0x667a('0x41'),_0x667a('0x42'),_0x667a('0x43'),_0x667a('0x44'),_0x667a('0x45'),_0x667a('0x46'),_0x667a('0x47'),'whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','openchannelStatus',_0x667a('0x12'),_0x667a('0x14'),'whatsappStatus',_0x667a('0x11'),'voiceStatus',_0x667a('0x48'),_0x667a('0x49'),'mailStatusTime',_0x667a('0x4a'),_0x667a('0x4b'),_0x667a('0x4c'),_0x667a('0x4d'),_0x667a('0x4e'),_0x667a('0x4f'),'screenrecording',_0x667a('0x50'),_0x667a('0x51'),'routealias'];var _0x267c37=[_0x667a('0x4'),_0x667a('0x5'),'mailPause',_0x667a('0x6'),'whatsappPause',_0x667a('0x3e'),_0x667a('0x7'),'online'];var _0x19aa22=_(_0x3fe2d4)[_0x667a('0x52')](_0x267c37)[_0x667a('0x53')](_0x484286)['value']();return _0x19aa22;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x2b5e=['lastLoginAt','lastPauseAt','address','mailPause','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','faxStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','lodash','../../mysqldb','client','http','chatPause','openchannelPause','smsPause','voicePause','whatsappPause','every','length','unknown','ringing','isNil','idle','pause','chatStatus','openchannelStatus','smsStatus','voiceStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','*pause','busy','getAgentStatus','Queue','map','findOne','then','all','flatten','value','getAgentIdsByQueues','includes','filter','getAgentIdsByStatus','resolve','findAll','name','faxPause','pauseType','split','fields','globalStatus','startsWith','DESC','ASC','fullname','internal','substring','indexOf','sort','toLowerCase','userpic','online'];(function(_0xa7c05d,_0x312374){var _0x47b002=function(_0x44aa2f){while(--_0x44aa2f){_0xa7c05d['push'](_0xa7c05d['shift']());}};_0x47b002(++_0x312374);}(_0x2b5e,0x75));var _0xe2b5=function(_0x12e3cb,_0x56b424){_0x12e3cb=_0x12e3cb-0x0;var _0x381e17=_0x2b5e[_0x12e3cb];return _0x381e17;};'use strict';var _=require(_0xe2b5('0x0'));var jayson=require('jayson/promise');var db=require(_0xe2b5('0x1'))['db'];var amiClient=jayson[_0xe2b5('0x2')][_0xe2b5('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0xe2b5('0x3')]({'port':0x232c});function isAgentPaused(_0x40835c,_0x4b52aa){var _0xc5f43e=[_0x40835c[_0xe2b5('0x4')],_0x40835c['faxPause'],_0x40835c['mailPause'],_0x40835c[_0xe2b5('0x5')],_0x40835c[_0xe2b5('0x6')],_0x40835c[_0xe2b5('0x7')],_0x40835c[_0xe2b5('0x8')]];if(!_0x4b52aa)return _[_0xe2b5('0x9')](_0xc5f43e);var _0x40fad7=_['filter'](_0xc5f43e);return _0x40fad7[_0xe2b5('0xa')]>0x0&&_0x40fad7[_0xe2b5('0xa')]<_0xc5f43e['length']?!![]:![];}function isIdle(_0x3f1b0c){return _0x3f1b0c==='idle'||_0x3f1b0c===_0xe2b5('0xb')||_0x3f1b0c==='unavailable'||_0x3f1b0c===_0xe2b5('0xc')||_[_0xe2b5('0xd')](_0x3f1b0c);}function isAgentIdle(_0x49ecf6){if(_0x49ecf6['voiceStatus']!==_0xe2b5('0xe')&&_0x49ecf6['voicePause']){_0x49ecf6['voiceStatus']=_0xe2b5('0xf');return![];}return _['every']([_0x49ecf6[_0xe2b5('0x10')],_0x49ecf6['faxStatus'],_0x49ecf6['mailStatus'],_0x49ecf6[_0xe2b5('0x11')],_0x49ecf6[_0xe2b5('0x12')],_0x49ecf6[_0xe2b5('0x13')],_0x49ecf6['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xe2b5('0x14')](_0xe2b5('0x15'),{})['then'](function(_0x2a6dba){if(_0x2a6dba[_0xe2b5('0x16')]){throw new Error(_0xe2b5('0x17'));}var _0x54ea0a=_0x2a6dba[_0xe2b5('0x18')];return routingClient[_0xe2b5('0x14')](_0xe2b5('0x15'),{})['then'](function(_0x665fa6){if(_0x665fa6['error']){throw new Error(_0xe2b5('0x19'));}var _0x21bcf6=_0x665fa6['result'];return _[_0xe2b5('0x1a')]({},_0x54ea0a,_0x21bcf6);});})[_0xe2b5('0x1b')](function(_0x475674){throw _0x475674;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x4dbc86){var _0x544dd5=_0xe2b5('0xb');if(isAgentPaused(_0x4dbc86))_0x544dd5=_0xe2b5('0xf');else if(isAgentPaused(_0x4dbc86,!![]))_0x544dd5=_0xe2b5('0x1c');else if(isAgentIdle(_0x4dbc86))_0x544dd5=_0xe2b5('0xe');else _0x544dd5=_0xe2b5('0x1d');return _0x544dd5;}exports[_0xe2b5('0x1e')]=getAgentStatus;function getAgentIdsByQueues(_0x70ca22,_0x1d1dcd){var _0x55874c=_['isArray'](_0x70ca22)?_0x70ca22:[_0x70ca22];var _0x44b05a=_['startCase'](_0x1d1dcd)+_0xe2b5('0x1f');var _0x5c7f72=_[_0xe2b5('0x20')](_0x55874c,function(_0x457b91){return db[_0x44b05a][_0xe2b5('0x21')]({'where':{'id':_0x457b91}})[_0xe2b5('0x22')](function(_0x1ee471){if(!_0x1ee471)return[];return _0x1ee471['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xe2b5('0x23')](_0x5c7f72)['then'](function(_0x4b5170){var _0x4392ed=_(_0x4b5170)[_0xe2b5('0x24')]()['map']('id')['uniq']()[_0xe2b5('0x25')]();return _0x4392ed;});}exports[_0xe2b5('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x2a2f7e,_0x398ec4,_0x554c27){try{if(_0x398ec4[_0xe2b5('0xa')]>0x0){_0x2a2f7e=_0x2a2f7e['filter'](function(_0xe37f44){return _0x398ec4[_0xe2b5('0x27')](_0xe37f44['id']);});}var _0x218d1a=_0x2a2f7e[_0xe2b5('0x28')](function(_0x238e11){var _0x4db8ca=_0xe2b5('0x1d');if(isAgentIdle(_0x238e11)){_0x4db8ca='idle';}return _0x4db8ca===_0x554c27;});return _[_0xe2b5('0x20')](_0x218d1a,'id');}catch(_0x3e8529){throw _0x3e8529;}}exports[_0xe2b5('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4ae816,_0x3732a7,_0x403c3f){return Promise[_0xe2b5('0x2a')]()[_0xe2b5('0x22')](function(){if(_0x3732a7[_0xe2b5('0xa')]>0x0){_0x4ae816=_0x4ae816[_0xe2b5('0x28')](function(_0x48a0e7){return _0x3732a7[_0xe2b5('0x27')](_0x48a0e7['id']);});}return _0x4ae816;})[_0xe2b5('0x22')](function(){return db['User'][_0xe2b5('0x2b')]({'attributes':['id',_0xe2b5('0x2c'),'fullname',_0xe2b5('0x4'),_0xe2b5('0x2d'),'mailPause',_0xe2b5('0x5'),_0xe2b5('0x6'),_0xe2b5('0x7'),'whatsappPause',_0xe2b5('0x2e')],'where':{'id':{'$in':_[_0xe2b5('0x20')](_0x4ae816,'id')}},'raw':!![]});})[_0xe2b5('0x22')](function(_0x3f98cd){return _0x3f98cd['map'](function(_0x14d5d2){var _0x135caa=_['find'](_0x4ae816,['id',_0x14d5d2['id']]);var _0xce4da=filterAgentAttributes(_0x135caa);_[_0xe2b5('0x1a')](_0x14d5d2,_0xce4da);_0x14d5d2['globalStatus']=getAgentStatus(_0x14d5d2);return _0x14d5d2;});})['then'](function(_0x369014){var _0x1a71bd=sortAgentsByStatus(_0x369014,_0x403c3f);return _[_0xe2b5('0x20')](_0x1a71bd,'id');})['catch'](function(_0x5a7b6a){throw _0x5a7b6a;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x23f993){var _0x2c72c1={'fields':[],'order':null};var _0x19c3c6=_0x23f993[_0xe2b5('0x2f')](',');_0x2c72c1[_0xe2b5('0x30')]=_[_0xe2b5('0x28')](_0x19c3c6,function(_0x530ff8){if(!_0x530ff8[_0xe2b5('0x27')](_0xe2b5('0x31'))){return!![];}_0x2c72c1['order']=_[_0xe2b5('0x32')](_0x530ff8,'-')?_0xe2b5('0x33'):_0xe2b5('0x34');return![];});return _0x2c72c1;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0xd7b7e3){if(_0xd7b7e3[_0xe2b5('0x27')](_0xe2b5('0x35'))&&!_0xd7b7e3[_0xe2b5('0x27')](_0xe2b5('0x36'))){var _0x503169=_0xd7b7e3[_0xe2b5('0x37')](0x0,_0xd7b7e3[_0xe2b5('0x38')]('fullname'));_0xd7b7e3+=','+_0x503169+_0xe2b5('0x36');}return _0xd7b7e3;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x43cc8d,_0x4f92af){var _0x48e01e=_0x43cc8d[_0xe2b5('0x39')](function(_0x42ce68,_0x495a31){if(_0x42ce68[_0xe2b5('0x31')]===_0x495a31['globalStatus']){if(_0x42ce68[_0xe2b5('0x31')]==='pause'){if(_0x4f92af==='DESC'){return(_0x42ce68[_0xe2b5('0x2e')]||'')<(_0x495a31[_0xe2b5('0x2e')]||'')||_0x42ce68[_0xe2b5('0x35')][_0xe2b5('0x3a')]()>_0x495a31[_0xe2b5('0x35')][_0xe2b5('0x3a')]()?0x1:-0x1;}else{return(_0x42ce68[_0xe2b5('0x2e')]||'')<(_0x495a31[_0xe2b5('0x2e')]||'')||_0x42ce68[_0xe2b5('0x35')][_0xe2b5('0x3a')]()>_0x495a31[_0xe2b5('0x35')][_0xe2b5('0x3a')]()?-0x1:0x1;}}else{if(_0x4f92af===_0xe2b5('0x33')){return _0x42ce68[_0xe2b5('0x35')]['toLowerCase']()<_0x495a31[_0xe2b5('0x35')][_0xe2b5('0x3a')]()?0x1:-0x1;}else{return _0x42ce68[_0xe2b5('0x35')]['toLowerCase']()<_0x495a31[_0xe2b5('0x35')][_0xe2b5('0x3a')]()?-0x1:0x1;}}}else{if(_0x4f92af==='DESC'){return _0x42ce68[_0xe2b5('0x31')]<_0x495a31[_0xe2b5('0x31')]?0x1:-0x1;}else{return _0x42ce68['globalStatus']<_0x495a31[_0xe2b5('0x31')]?-0x1:0x1;}}});return _0x48e01e;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x496e45){var _0x500eb2=[_0xe2b5('0x3b'),_0xe2b5('0x3c'),_0xe2b5('0x3d'),'lastPauseAt',_0xe2b5('0x2e'),_0xe2b5('0x3e'),_0xe2b5('0x36'),_0xe2b5('0x3f'),_0xe2b5('0x4'),_0xe2b5('0x5'),_0xe2b5('0x40'),_0xe2b5('0x6'),'whatsappPause',_0xe2b5('0x2d'),_0xe2b5('0x7'),'chatCapacity','openchannelCapacity',_0xe2b5('0x41'),_0xe2b5('0x42'),_0xe2b5('0x43'),_0xe2b5('0x44'),_0xe2b5('0x45'),_0xe2b5('0x46'),'mailCurrentCapacity',_0xe2b5('0x47'),_0xe2b5('0x48'),_0xe2b5('0x49'),_0xe2b5('0x10'),'openchannelStatus',_0xe2b5('0x4a'),_0xe2b5('0x12'),'whatsappStatus',_0xe2b5('0x4b'),_0xe2b5('0x13'),'chatStatusTime',_0xe2b5('0x4c'),_0xe2b5('0x4d'),_0xe2b5('0x4e'),_0xe2b5('0x4f'),_0xe2b5('0x50'),_0xe2b5('0x51'),_0xe2b5('0x52'),_0xe2b5('0x53'),'screenrecording',_0xe2b5('0x54'),'phoneBarEnableAutomaticScreenRecording',_0xe2b5('0x55')];var _0x286c93=['chatPause',_0xe2b5('0x5'),_0xe2b5('0x40'),_0xe2b5('0x6'),_0xe2b5('0x8'),_0xe2b5('0x2d'),_0xe2b5('0x7'),'online'];var _0x139cf5=_(_0x496e45)[_0xe2b5('0x56')](_0x286c93)[_0xe2b5('0x57')](_0x500eb2)[_0xe2b5('0x25')]();return _0x139cf5;}exports[_0xe2b5('0x58')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 553cfae..dcf2a85 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0xe455e7,_0x29fb65){var _0xfc683e=function(_0x10ee38){while(--_0x10ee38){_0xe455e7['push'](_0xe455e7['shift']());}};_0xfc683e(++_0x29fb65);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 61c0a94..d00a3dc 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 _0x7a7b=['utf8','replace','hostname','macAddress','ipAddress','substring','crypto','child_process','execSync','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','md5','update','digest','hex','getUuid','licenseToken','test','win32'];(function(_0xf7598b,_0x345d0d){var _0xe60017=function(_0x4fb67a){while(--_0x4fb67a){_0xf7598b['push'](_0xf7598b['shift']());}};_0xe60017(++_0x345d0d);}(_0x7a7b,0xd2));var _0xb7a7=function(_0x49b00a,_0x5835f7){_0x49b00a=_0x49b00a-0x0;var _0x136eca=_0x7a7b[_0x49b00a];return _0x136eca;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xb7a7('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xb7a7('0x1'))[_0xb7a7('0x2')];var config=require('../environment');function getInterfaces(){var _0x5a0a8c=[];var _0x51d6df=os['networkInterfaces']();var _0x546c5e=_[_0xb7a7('0x3')](_[_0xb7a7('0x4')](_0x51d6df));for(var _0x19a3fd=0x0;_0x19a3fd<_0x546c5e[_0xb7a7('0x5')];_0x19a3fd++){var _0xc1e14b=_0x51d6df[_0x546c5e[_0x19a3fd]][_0xb7a7('0x6')](function(_0x586875){return _0x586875[_0xb7a7('0x7')]===_0xb7a7('0x8')&&_0x586875[_0xb7a7('0x9')]===![];});_0x5a0a8c=_0x5a0a8c[_0xb7a7('0xa')](_0xc1e14b);}return _0x5a0a8c;}function getFirstInterface(){var _0x3386ec=_[_0xb7a7('0xb')](getInterfaces());return{'macAddress':_0x3386ec&&_0x3386ec['mac']?_0x3386ec[_0xb7a7('0xc')]:_0xb7a7('0xd'),'ipAddress':_0x3386ec&&_0x3386ec[_0xb7a7('0xe')]?_0x3386ec[_0xb7a7('0xe')]:_0xb7a7('0xf')};}exports[_0xb7a7('0x10')]=getFirstInterface;function getCPUhash(){var _0x5566cf=_[_0xb7a7('0x3')](os[_0xb7a7('0x11')]()['map'](function(_0x1efa7e){return _0x1efa7e[_0xb7a7('0x12')];}))[_0xb7a7('0x13')](':');return crypto['createHash'](_0xb7a7('0x14'))[_0xb7a7('0x15')](_0x5566cf)[_0xb7a7('0x16')](_0xb7a7('0x17'));}exports[_0xb7a7('0x18')]=function(){var _0x1220d5=os['platform']();var _0x483117=/[0-9a-f-]{36}/;if(config[_0xb7a7('0x19')]&&_0x483117[_0xb7a7('0x1a')](config['licenseToken'])){return config[_0xb7a7('0x19')];}else if(_0x1220d5===_0xb7a7('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xb7a7('0x1c')})[_0xb7a7('0x1d')]('\x0d\x0a','');}else{var _0x4b79a5=getFirstInterface();var _0x1fc6e3=getCPUhash();var _0x46684f=_0x1fc6e3+'|'+os[_0xb7a7('0x1e')]()+'|'+_0x4b79a5[_0xb7a7('0x1f')]+'|'+_0x4b79a5[_0xb7a7('0x20')];var _0x3c94e0=crypto['createHash'](_0xb7a7('0x14'))['update'](_0x46684f)[_0xb7a7('0x16')]('hex');return _0x3c94e0[_0xb7a7('0x21')](0x0,0x8)+'-'+_0x3c94e0[_0xb7a7('0x21')](0x8,0xc)+'-'+_0x3c94e0[_0xb7a7('0x21')](0xc,0x10)+'-'+_0x3c94e0[_0xb7a7('0x21')](0x10,0x14)+'-'+_0x3c94e0[_0xb7a7('0x21')](0x14);}}; \ No newline at end of file +var _0xebd9=['md5','update','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','digest','substring','lodash','crypto','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','cpus','model','join','createHash'];(function(_0x2f0543,_0x17c6f4){var _0x164430=function(_0x4c3a7f){while(--_0x4c3a7f){_0x2f0543['push'](_0x2f0543['shift']());}};_0x164430(++_0x17c6f4);}(_0xebd9,0x153));var _0x9ebd=function(_0x510bff,_0x25e95d){_0x510bff=_0x510bff-0x0;var _0xa24336=_0xebd9[_0x510bff];return _0xa24336;};'use strict';var _=require(_0x9ebd('0x0'));var os=require('os');var crypto=require(_0x9ebd('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x9ebd('0x2'))['execSync'];var config=require(_0x9ebd('0x3'));function getInterfaces(){var _0x26d2bd=[];var _0x290381=os[_0x9ebd('0x4')]();var _0x57901b=_[_0x9ebd('0x5')](_[_0x9ebd('0x6')](_0x290381));for(var _0x55cec4=0x0;_0x55cec4<_0x57901b[_0x9ebd('0x7')];_0x55cec4++){var _0x660be9=_0x290381[_0x57901b[_0x55cec4]][_0x9ebd('0x8')](function(_0x17af1b){return _0x17af1b[_0x9ebd('0x9')]===_0x9ebd('0xa')&&_0x17af1b[_0x9ebd('0xb')]===![];});_0x26d2bd=_0x26d2bd[_0x9ebd('0xc')](_0x660be9);}return _0x26d2bd;}function getFirstInterface(){var _0x3d1d28=_[_0x9ebd('0xd')](getInterfaces());return{'macAddress':_0x3d1d28&&_0x3d1d28[_0x9ebd('0xe')]?_0x3d1d28[_0x9ebd('0xe')]:'00:00:00:00:00:00','ipAddress':_0x3d1d28&&_0x3d1d28[_0x9ebd('0xf')]?_0x3d1d28[_0x9ebd('0xf')]:_0x9ebd('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x413405=_[_0x9ebd('0x5')](os[_0x9ebd('0x11')]()['map'](function(_0x16d6a2){return _0x16d6a2[_0x9ebd('0x12')];}))[_0x9ebd('0x13')](':');return crypto[_0x9ebd('0x14')](_0x9ebd('0x15'))[_0x9ebd('0x16')](_0x413405)['digest'](_0x9ebd('0x17'));}exports[_0x9ebd('0x18')]=function(){var _0x596e62=os[_0x9ebd('0x19')]();var _0x37bb5a=/[0-9a-f-]{36}/;if(config[_0x9ebd('0x1a')]&&_0x37bb5a['test'](config['licenseToken'])){return config['licenseToken'];}else if(_0x596e62===_0x9ebd('0x1b')){return exec(_0x9ebd('0x1c'),{'encoding':_0x9ebd('0x1d')})[_0x9ebd('0x1e')]('\x0d\x0a','');}else{var _0x54d00b=getFirstInterface();var _0x3eedef=getCPUhash();var _0x4be043=_0x3eedef+'|'+os[_0x9ebd('0x1f')]()+'|'+_0x54d00b[_0x9ebd('0x20')]+'|'+_0x54d00b[_0x9ebd('0x21')];var _0x413a3d=crypto['createHash']('md5')['update'](_0x4be043)[_0x9ebd('0x22')]('hex');return _0x413a3d['substring'](0x0,0x8)+'-'+_0x413a3d[_0x9ebd('0x23')](0x8,0xc)+'-'+_0x413a3d[_0x9ebd('0x23')](0xc,0x10)+'-'+_0x413a3d[_0x9ebd('0x23')](0x10,0x14)+'-'+_0x413a3d['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index cb88a45..392127d 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 _0x09be=['license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','update','error','message','finally','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger'];(function(_0x4c3220,_0x4c4faf){var _0x466e33=function(_0x4cb506){while(--_0x4cb506){_0x4c3220['push'](_0x4c3220['shift']());}};_0x466e33(++_0x4c4faf);}(_0x09be,0x9c));var _0xe09b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x09be[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var moment=require(_0xe09b('0x0'));var rp=require(_0xe09b('0x1'));var BPromise=require(_0xe09b('0x2'));var pkginfo=require(_0xe09b('0x3'))(module,'version');var db=require(_0xe09b('0x4'))['db'];var encryptor=require(_0xe09b('0x5'));var hardware=require(_0xe09b('0x6'));var logger=require(_0xe09b('0x7'))(_0xe09b('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x231f2f){return new BPromise(function(_0x27f1b0,_0x410294){var _0x31b0a5=util[_0xe09b('0x9')](_0xe09b('0xa'),HOST,_0x231f2f,module[_0xe09b('0xb')]['version']);if(oldToken){_0x31b0a5=util[_0xe09b('0x9')](_0xe09b('0xc'),HOST,_0x231f2f,module['exports'][_0xe09b('0xd')],oldToken);}var _0xd0ad0b={'uri':_0x31b0a5,'method':_0xe09b('0xe'),'timeout':0xea60,'json':!![]};return rp(_0xd0ad0b)[_0xe09b('0xf')](function(_0x1af601){_0x27f1b0(_0x1af601);})[_0xe09b('0x10')](function(_0x12db01){_0x410294(_0x12db01);});});}function manageLicense(_0x7d5ac1,_0x56f8c9){var _0x4bcac4=_0x56f8c9[_0xe09b('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x4bcac4[_0xe09b('0x12')]!==_0x7d5ac1&&!_0x4bcac4[_0xe09b('0x13')]){oldToken=_0x4bcac4['data1'];}httpRequest(_0x7d5ac1)[_0xe09b('0xf')](function(_0x55dafb){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x55dafb[_0xe09b('0x14')]){isOldTokenSent=![];if(!_0x4bcac4['license']&&_0x4bcac4['license']!=_0x55dafb[_0xe09b('0x8')]||_0x4bcac4[_0xe09b('0x8')]&&_0x4bcac4[_0xe09b('0x13')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4bcac4['license']&&!_0x4bcac4[_0xe09b('0x13')]&&_0x4bcac4[_0xe09b('0x8')]!=_0x55dafb['license']){logger[_0xe09b('0x15')](_0xe09b('0x16'));}if(_0x4bcac4[_0xe09b('0x8')]&&!_0x4bcac4[_0xe09b('0x13')]&&_0x4bcac4['license']==_0x55dafb[_0xe09b('0x8')]){return _0x56f8c9;}return _0x56f8c9['update']({'data1':_0x7d5ac1,'data2':null,'license':_0x55dafb[_0xe09b('0x8')]});}else{if(_0x55dafb['license']||_0x4bcac4['license']){if(!_0x4bcac4[_0xe09b('0x13')]){if(_0x4bcac4[_0xe09b('0x12')]==_0x7d5ac1){GRAY_PERIOD_REASON=_0xe09b('0x17');logger[_0xe09b('0x15')](_0xe09b('0x18'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xe09b('0x15')](_0xe09b('0x19'),_0x4bcac4[_0xe09b('0x12')],_0x7d5ac1);}logger[_0xe09b('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xe09b('0x1a')](),moment()[_0xe09b('0x9')](_0xe09b('0x1b')));return _0x56f8c9['update']({'data2':encryptor[_0xe09b('0x1c')](moment()[_0xe09b('0x9')](_0xe09b('0x1b')))});}else{if(moment()[_0xe09b('0x1d')](encryptor[_0xe09b('0x1e')](_0x4bcac4['data2']),_0xe09b('0x1f'))>DAYS){logger[_0xe09b('0x15')](_0xe09b('0x20'),moment()[_0xe09b('0x9')](_0xe09b('0x1b')));isOldTokenSent=![];return _0x56f8c9[_0xe09b('0x21')]({'data1':_0x7d5ac1,'data2':null,'license':null});}}}else{if(_0x4bcac4['data1']!=_0x7d5ac1){logger[_0xe09b('0x15')](_0xe09b('0x19'),_0x4bcac4[_0xe09b('0x12')],_0x7d5ac1);return _0x56f8c9['update']({'data1':_0x7d5ac1,'data2':null,'license':null});}}}return _0x56f8c9;})['then'](function(_0x926dc7){_0x56f8c9=_0x926dc7;})[_0xe09b('0x10')](function(_0x64ed28){logger[_0xe09b('0x22')](_0x64ed28[_0xe09b('0x23')]);})[_0xe09b('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0xe09b('0x25')](),_0x56f8c9);},TIME);});}function defaultLicense(){var _0x119f9a=hardware[_0xe09b('0x25')]();if(_0x119f9a){return db[_0xe09b('0x26')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x119f9a}})['spread'](function(_0x300c09,_0x2df18a){logger['info'](_0xe09b('0x27'),_0x119f9a);manageLicense(_0x119f9a,_0x300c09);})[_0xe09b('0x10')](function(_0x55a7c3){logger[_0xe09b('0x22')](_0x55a7c3['message']);});}}exports[_0xe09b('0x28')]=defaultLicense; \ No newline at end of file +var _0x9323=['format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','active','info','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','spread','util','moment','request-promise','bluebird','version','../../mysqldb','./hardware','../logger','license','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9323,0x140));var _0x3932=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9323[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3932('0x0'));var moment=require(_0x3932('0x1'));var rp=require(_0x3932('0x2'));var BPromise=require(_0x3932('0x3'));var pkginfo=require('pkginfo')(module,_0x3932('0x4'));var db=require(_0x3932('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x3932('0x6'));var logger=require(_0x3932('0x7'))(_0x3932('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x37cf4a){return new BPromise(function(_0x2c9c33,_0x1b9db5){var _0x3c95f8=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x37cf4a,module[_0x3932('0x9')][_0x3932('0x4')]);if(oldToken){_0x3c95f8=util[_0x3932('0xa')](_0x3932('0xb'),HOST,_0x37cf4a,module[_0x3932('0x9')]['version'],oldToken);}var _0x17f8ac={'uri':_0x3c95f8,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x17f8ac)[_0x3932('0xc')](function(_0x221461){_0x2c9c33(_0x221461);})[_0x3932('0xd')](function(_0x40efd6){_0x1b9db5(_0x40efd6);});});}function manageLicense(_0x5b0954,_0x1ea7b7){var _0x3dbca3=_0x1ea7b7[_0x3932('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3dbca3[_0x3932('0xf')]!==_0x5b0954&&!_0x3dbca3[_0x3932('0x10')]){oldToken=_0x3dbca3[_0x3932('0xf')];}httpRequest(_0x5b0954)[_0x3932('0xc')](function(_0x88a560){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x88a560[_0x3932('0x11')]){isOldTokenSent=![];if(!_0x3dbca3['license']&&_0x3dbca3[_0x3932('0x8')]!=_0x88a560[_0x3932('0x8')]||_0x3dbca3[_0x3932('0x8')]&&_0x3dbca3[_0x3932('0x10')]){logger[_0x3932('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3dbca3['license']&&!_0x3dbca3[_0x3932('0x10')]&&_0x3dbca3[_0x3932('0x8')]!=_0x88a560[_0x3932('0x8')]){logger[_0x3932('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3dbca3[_0x3932('0x8')]&&!_0x3dbca3[_0x3932('0x10')]&&_0x3dbca3[_0x3932('0x8')]==_0x88a560[_0x3932('0x8')]){return _0x1ea7b7;}return _0x1ea7b7[_0x3932('0x13')]({'data1':_0x5b0954,'data2':null,'license':_0x88a560[_0x3932('0x8')]});}else{if(_0x88a560[_0x3932('0x8')]||_0x3dbca3[_0x3932('0x8')]){if(!_0x3dbca3[_0x3932('0x10')]){if(_0x3dbca3['data1']==_0x5b0954){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x3932('0x14');logger[_0x3932('0x12')](_0x3932('0x15'),_0x3dbca3['data1'],_0x5b0954);}logger[_0x3932('0x12')](_0x3932('0x16'),GRAY_PERIOD_REASON[_0x3932('0x17')](),moment()[_0x3932('0xa')](_0x3932('0x18')));return _0x1ea7b7['update']({'data2':encryptor['encryptString'](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x3dbca3['data2']),_0x3932('0x19'))>DAYS){logger[_0x3932('0x12')](_0x3932('0x1a'),moment()['format'](_0x3932('0x18')));isOldTokenSent=![];return _0x1ea7b7[_0x3932('0x13')]({'data1':_0x5b0954,'data2':null,'license':null});}}}else{if(_0x3dbca3[_0x3932('0xf')]!=_0x5b0954){logger[_0x3932('0x12')](_0x3932('0x15'),_0x3dbca3[_0x3932('0xf')],_0x5b0954);return _0x1ea7b7[_0x3932('0x13')]({'data1':_0x5b0954,'data2':null,'license':null});}}}return _0x1ea7b7;})[_0x3932('0xc')](function(_0x13fd51){_0x1ea7b7=_0x13fd51;})[_0x3932('0xd')](function(_0x38bca6){logger[_0x3932('0x1b')](_0x38bca6[_0x3932('0x1c')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x3932('0x1d')](),_0x1ea7b7);},TIME);});}function defaultLicense(){var _0x4f42b0=hardware[_0x3932('0x1d')]();if(_0x4f42b0){return db[_0x3932('0x1e')][_0x3932('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x4f42b0}})[_0x3932('0x20')](function(_0x50eb6f,_0xa44a7b){logger[_0x3932('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x4f42b0);manageLicense(_0x4f42b0,_0x50eb6f);})[_0x3932('0xd')](function(_0x2d43a6){logger[_0x3932('0x1b')](_0x2d43a6['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e22c6d3..90c5453 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 _0xd7b0=['Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','gray','deadline','add','grayReason','uuid','disabled','message','findAll','role','COUNT','sequelize','count','user','telephone','users','telephones','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','./hardware','2027-01-01T00:00:00.000Z','getUuid'];(function(_0x7f8f15,_0x282eea){var _0xb01d9f=function(_0x430db1){while(--_0x430db1){_0x7f8f15['push'](_0x7f8f15['shift']());}};_0xb01d9f(++_0x282eea);}(_0xd7b0,0x103));var _0x0d7b=function(_0x319e0b,_0x468d2d){_0x319e0b=_0x319e0b-0x0;var _0x23acd8=_0xd7b0[_0x319e0b];return _0x23acd8;};'use strict';var util=require('util');var _=require(_0x0d7b('0x0'));var moment=require(_0x0d7b('0x1'));var BPromise=require('bluebird');var hardware=require(_0x0d7b('0x2'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0d7b('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x0d7b('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0d7b('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0d7b('0x5'),'machineUuid':hardware[_0x0d7b('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4230bf){return new BPromise(function(_0x3c4482,_0x340ad2){return db[_0x0d7b('0x6')][_0x0d7b('0x7')](_[_0x0d7b('0x8')](_0x4230bf,{'raw':!![],'where':{'id':0x1}}))[_0x0d7b('0x9')](function(_0x183fa6){return checkLicense(_0x183fa6,null);})[_0x0d7b('0x9')](function(_0x238b8b){_0x3c4482(_0x238b8b);return;})[_0x0d7b('0xa')](function(_0x49b43c){_0x340ad2(_0x49b43c);});});}function checkLicense(_0x6c327f,_0x269a4f){if(!_0x6c327f){demoLicense['uuid']=_0x6c327f[_0x0d7b('0xb')];return demoLicense;}try{var _0x589ec5=_0x269a4f||_0x6c327f[_0x0d7b('0xc')];if(_[_0x0d7b('0xd')](_0x589ec5)){throw new Error(_0x0d7b('0xe'));}var _0x479a16=_0x6c327f[_0x0d7b('0xb')];var _0x2fc3ed=_0x6c327f[_0x0d7b('0xf')];var _0x399f53=_0x479a16[_0x0d7b('0x10')]('-')[0x4];var _0x393fd4=_0x479a16[_0x0d7b('0x10')]('-')[0x0];var _0x367865=encryptor[_0x0d7b('0x11')](_0x589ec5,util[_0x0d7b('0x12')](_0x0d7b('0x13'),_0x399f53,_0x479a16,_0x393fd4));var _0x2a9146=JSON[_0x0d7b('0x14')](_0x367865);_0x2a9146[_0x0d7b('0x15')]=![];_0x2a9146['uuid']=_0x479a16;_0x2a9146['machineUuid']=hardware[_0x0d7b('0x4')]();if(_0x2fc3ed){var _0x3b8065=encryptor[_0x0d7b('0x11')](_0x2fc3ed);_0x2a9146[_0x0d7b('0x16')]=_0x3b8065;_0x2a9146[_0x0d7b('0x17')]=moment(_0x3b8065)[_0x0d7b('0x18')](0x7,'days')[_0x0d7b('0x12')]();_0x2a9146[_0x0d7b('0x19')]=_0x2a9146[_0x0d7b('0x1a')]!=_0x2a9146['machineUuid']?'changed':_0x0d7b('0x1b');}return _0x2a9146;}catch(_0x510337){breakingLicense[_0x0d7b('0x1a')]=_0x6c327f[_0x0d7b('0xb')];breakingLicense[_0x0d7b('0x1c')]=_0x510337[_0x0d7b('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x40688f,_0x5c69b0){getLicense()['then'](function(_0x25075b){return db['User'][_0x0d7b('0x1d')]({'attributes':[_0x0d7b('0x1e'),[db['sequelize']['fn'](_0x0d7b('0x1f'),db[_0x0d7b('0x20')]['col']('role')),_0x0d7b('0x21')]],'group':'role','where':{'role':{'$or':['admin',_0x0d7b('0x22'),_0x0d7b('0x23')]}},'raw':!![]})[_0x0d7b('0x9')](function(_0x4635a9){var _0x1d9142={'user':_0x25075b[_0x0d7b('0x24')]||0x0,'telephone':_0x25075b[_0x0d7b('0x25')]||0x0};_0x4635a9['forEach'](function(_0x1dcd9a){var _0x43f306=_0x1dcd9a['role']===_0x0d7b('0x26')?_0x0d7b('0x22'):_0x1dcd9a[_0x0d7b('0x1e')];_0x1d9142[_0x43f306]-=_0x1dcd9a[_0x0d7b('0x21')];if(_0x1d9142[_0x43f306]<0x0)_0x1d9142[_0x43f306]=0x0;});_0x40688f(_0x1d9142);return;});})['catch'](function(_0x142723){_0x5c69b0(_0x142723);});});}function checkUserLimits(_0x1b04a2){return new BPromise(function(_0x4c1d77,_0x271d0a){getLimits()[_0x0d7b('0x9')](function(_0x2c4162){var _0x706af1=_[_0x0d7b('0x27')](_[_0x0d7b('0x28')](_0x1b04a2,_0x0d7b('0x1e')),['admin',_0x0d7b('0x22'),_0x0d7b('0x23')]);var _0x5b1926=(_0x706af1[_0x0d7b('0x26')]||0x0)+(_0x706af1['user']||0x0);var _0x460d44=_0x706af1[_0x0d7b('0x23')]||0x0;if(_0x5b1926>_0x2c4162['user'])return _0x271d0a(_0x0d7b('0x29'));if(_0x460d44>_0x2c4162[_0x0d7b('0x23')])return _0x271d0a(_0x0d7b('0x2a'));return _0x4c1d77();})[_0x0d7b('0xa')](function(_0x47123d){_0x271d0a(_0x47123d);});});}module[_0x0d7b('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x79b9=['util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','format','%s:%s:%s','parse','demo','decryptString','gray','deadline','add','days','machineUuid','changed','disabled','message','sequelize','COUNT','role','count','admin','user','telephone','users','telephones','pick','countBy','License\x20limit\x20reached\x20for\x20users'];(function(_0x4f32dc,_0x4680ca){var _0x6ea91d=function(_0x586627){while(--_0x586627){_0x4f32dc['push'](_0x4f32dc['shift']());}};_0x6ea91d(++_0x4680ca);}(_0x79b9,0x168));var _0x979b=function(_0x1f5067,_0x2e995a){_0x1f5067=_0x1f5067-0x0;var _0x4c21d4=_0x79b9[_0x1f5067];return _0x4c21d4;};'use strict';var util=require(_0x979b('0x0'));var _=require(_0x979b('0x1'));var moment=require(_0x979b('0x2'));var BPromise=require(_0x979b('0x3'));var hardware=require(_0x979b('0x4'));var encryptor=require(_0x979b('0x5'));var db=require(_0x979b('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x979b('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x979b('0x8'),'machineUuid':hardware[_0x979b('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x979b('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x979b('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2ff671){return new BPromise(function(_0x3c8ad1,_0x4af4ed){return db[_0x979b('0xa')]['find'](_[_0x979b('0xb')](_0x2ff671,{'raw':!![],'where':{'id':0x1}}))[_0x979b('0xc')](function(_0x5b3c62){return checkLicense(_0x5b3c62,null);})[_0x979b('0xc')](function(_0x2465d1){_0x3c8ad1(_0x2465d1);return;})[_0x979b('0xd')](function(_0x5a592f){_0x4af4ed(_0x5a592f);});});}function checkLicense(_0x373b6e,_0x33ae5f){if(!_0x373b6e){demoLicense[_0x979b('0xe')]=_0x373b6e[_0x979b('0xf')];return demoLicense;}try{var _0x592889=_0x33ae5f||_0x373b6e[_0x979b('0x10')];if(_[_0x979b('0x11')](_0x592889)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x29cec4=_0x373b6e['data1'];var _0x1f5a4b=_0x373b6e[_0x979b('0x12')];var _0x38fc04=_0x29cec4[_0x979b('0x13')]('-')[0x4];var _0x966a6=_0x29cec4[_0x979b('0x13')]('-')[0x0];var _0x23c87f=encryptor['decryptString'](_0x592889,util[_0x979b('0x14')](_0x979b('0x15'),_0x38fc04,_0x29cec4,_0x966a6));var _0x1ec819=JSON[_0x979b('0x16')](_0x23c87f);_0x1ec819[_0x979b('0x17')]=![];_0x1ec819['uuid']=_0x29cec4;_0x1ec819['machineUuid']=hardware[_0x979b('0x9')]();if(_0x1f5a4b){var _0xda3bb1=encryptor[_0x979b('0x18')](_0x1f5a4b);_0x1ec819[_0x979b('0x19')]=_0xda3bb1;_0x1ec819[_0x979b('0x1a')]=moment(_0xda3bb1)[_0x979b('0x1b')](0x7,_0x979b('0x1c'))[_0x979b('0x14')]();_0x1ec819['grayReason']=_0x1ec819[_0x979b('0xe')]!=_0x1ec819[_0x979b('0x1d')]?_0x979b('0x1e'):_0x979b('0x1f');}return _0x1ec819;}catch(_0x2eb00b){breakingLicense[_0x979b('0xe')]=_0x373b6e[_0x979b('0xf')];breakingLicense[_0x979b('0x20')]=_0x2eb00b[_0x979b('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2faa2f,_0x26f010){getLicense()[_0x979b('0xc')](function(_0x5044f6){return db['User']['findAll']({'attributes':['role',[db[_0x979b('0x21')]['fn'](_0x979b('0x22'),db[_0x979b('0x21')]['col'](_0x979b('0x23'))),_0x979b('0x24')]],'group':'role','where':{'role':{'$or':[_0x979b('0x25'),_0x979b('0x26'),_0x979b('0x27')]}},'raw':!![]})[_0x979b('0xc')](function(_0x45f9ef){var _0x19cad0={'user':_0x5044f6[_0x979b('0x28')]||0x0,'telephone':_0x5044f6[_0x979b('0x29')]||0x0};_0x45f9ef['forEach'](function(_0x8b67ed){var _0x57a70d=_0x8b67ed[_0x979b('0x23')]===_0x979b('0x25')?'user':_0x8b67ed[_0x979b('0x23')];_0x19cad0[_0x57a70d]-=_0x8b67ed[_0x979b('0x24')];if(_0x19cad0[_0x57a70d]<0x0)_0x19cad0[_0x57a70d]=0x0;});_0x2faa2f(_0x19cad0);return;});})['catch'](function(_0x354595){_0x26f010(_0x354595);});});}function checkUserLimits(_0x451403){return new BPromise(function(_0x3e4eee,_0xcefc8a){getLimits()[_0x979b('0xc')](function(_0xc85cf3){var _0x3ece52=_[_0x979b('0x2a')](_[_0x979b('0x2b')](_0x451403,_0x979b('0x23')),[_0x979b('0x25'),_0x979b('0x26'),_0x979b('0x27')]);var _0xb11a4c=(_0x3ece52[_0x979b('0x25')]||0x0)+(_0x3ece52[_0x979b('0x26')]||0x0);var _0x33c704=_0x3ece52['telephone']||0x0;if(_0xb11a4c>_0xc85cf3[_0x979b('0x26')])return _0xcefc8a(_0x979b('0x2c'));if(_0x33c704>_0xc85cf3[_0x979b('0x27')])return _0xcefc8a('License\x20limit\x20reached\x20for\x20telephones');return _0x3e4eee();})['catch'](function(_0x2daf83){_0xcefc8a(_0x2daf83);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index cc7537d..138e581 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 _0x63a5=['myappanuglar-secret','secret','exports','http://localhost:9000'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x63a5,0x18e));var _0x563a=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x63a5[_0x2642cb];return _0xe6e41;};'use strict';module[_0x563a('0x0')]={'DOMAIN':_0x563a('0x1'),'SESSION_SECRET':_0x563a('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x563a('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x236c=['secret','exports','myappanuglar-secret','app-id'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x236c,0x155));var _0xc236=function(_0x54ab23,_0x3be323){_0x54ab23=_0x54ab23-0x0;var _0x3d11b0=_0x236c[_0x54ab23];return _0x3d11b0;};'use strict';module[_0xc236('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xc236('0x1'),'GOOGLE_ID':_0xc236('0x2'),'GOOGLE_SECRET':_0xc236('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c2fb69c..ca5e288 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3857=['exports','../utils/loggers','fileLogger'];(function(_0x2142ed,_0x1c0c13){var _0x6b9703=function(_0x33bf23){while(--_0x33bf23){_0x2142ed['push'](_0x2142ed['shift']());}};_0x6b9703(++_0x1c0c13);}(_0x3857,0xb8));var _0x7385=function(_0xff8237,_0x5bd2cf){_0xff8237=_0xff8237-0x0;var _0x4ee37f=_0x3857[_0xff8237];return _0x4ee37f;};'use strict';var fileLogger=require(_0x7385('0x0'))[_0x7385('0x1')];module[_0x7385('0x2')]=fileLogger; \ No newline at end of file +var _0xe702=['../utils/loggers','fileLogger'];(function(_0x39bf1b,_0xa88007){var _0x2a7542=function(_0x40cdf0){while(--_0x40cdf0){_0x39bf1b['push'](_0x39bf1b['shift']());}};_0x2a7542(++_0xa88007);}(_0xe702,0xfe));var _0x2e70=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe702[_0x14add3];return _0x4a174f;};'use strict';var fileLogger=require(_0x2e70('0x0'))[_0x2e70('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 78d1263..b2a9aa8 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 _0x4c12=['join','../../services/express/index.js','ami','../../services/ami/index.js','email','../../services/routing/index.js','xdr','path','express'];(function(_0x2b6c61,_0x35b3a1){var _0x3b6ecb=function(_0x1512de){while(--_0x1512de){_0x2b6c61['push'](_0x2b6c61['shift']());}};_0x3b6ecb(++_0x35b3a1);}(_0x4c12,0x1c0));var _0x24c1=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0x4c12[_0x402731];return _0x111736;};'use strict';var path=require(_0x24c1('0x0'));var os=require('os');var config={'apps':[{'name':_0x24c1('0x1'),'script':path[_0x24c1('0x2')](__dirname,_0x24c1('0x3'))},{'name':_0x24c1('0x4'),'script':path[_0x24c1('0x2')](__dirname,_0x24c1('0x5'))},{'name':'agi','script':path[_0x24c1('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x24c1('0x6'),'script':path[_0x24c1('0x2')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0x24c1('0x2')](__dirname,_0x24c1('0x7'))},{'name':_0x24c1('0x8'),'script':path[_0x24c1('0x2')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0xe26f=['express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','exports','path'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xe26f,0x1df));var _0xfe26=function(_0x6f9d22,_0xe2ef04){_0x6f9d22=_0x6f9d22-0x0;var _0x53081b=_0xe26f[_0x6f9d22];return _0x53081b;};'use strict';var path=require(_0xfe26('0x0'));var os=require('os');var config={'apps':[{'name':_0xfe26('0x1'),'script':path[_0xfe26('0x2')](__dirname,'../../services/express/index.js')},{'name':_0xfe26('0x3'),'script':path[_0xfe26('0x2')](__dirname,_0xfe26('0x4'))},{'name':_0xfe26('0x5'),'script':path[_0xfe26('0x2')](__dirname,_0xfe26('0x6'))},{'name':_0xfe26('0x7'),'script':path[_0xfe26('0x2')](__dirname,_0xfe26('0x8'))},{'name':_0xfe26('0x9'),'script':path[_0xfe26('0x2')](__dirname,_0xfe26('0xa'))},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0xfe26('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8a08202..241d36f 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 _0xb848=['connect','connected','start','disconnect','then','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x57c5aa,_0x5436c5){var _0x125a88=function(_0x1b2460){while(--_0x1b2460){_0x57c5aa['push'](_0x57c5aa['shift']());}};_0x125a88(++_0x5436c5);}(_0xb848,0x10e));var _0x8b84=function(_0x35d60f,_0x1995b7){_0x35d60f=_0x35d60f-0x0;var _0x2a43db=_0xb848[_0x35d60f];return _0x2a43db;};'use strict';var pm2=require(_0x8b84('0x0'));var BPromise=require(_0x8b84('0x1'));var config=require(_0x8b84('0x2'));function connect(){return new BPromise(function(_0x1c5ab6,_0x337a85){return pm2[_0x8b84('0x3')](function(_0x4e68f7){if(_0x4e68f7){return _0x337a85(_0x4e68f7);}return _0x1c5ab6(_0x8b84('0x4'));});});};exports['start']=function(_0x3d5fa1){return connect()['then'](function(){return new BPromise(function(_0x11b45e,_0x103feb){return pm2[_0x8b84('0x5')](_0x3d5fa1,function(_0x274011,_0x20875d){if(_0x274011){return _0x103feb(_0x274011);}pm2[_0x8b84('0x6')]();return _0x11b45e(_0x20875d);});});});};exports['stop']=function(_0x98984a){return connect()['then'](function(){return new BPromise(function(_0x579617,_0x299ff7){return pm2['stop'](_0x98984a,function(_0x422e5d,_0x190421){if(_0x422e5d){return _0x299ff7(_0x422e5d);}pm2[_0x8b84('0x6')]();return _0x579617(_0x190421);});});});};exports['restart']=function(_0x32d94d){return connect()[_0x8b84('0x7')](function(){return new BPromise(function(_0x1c3f43,_0x30b222){return pm2['restart'](_0x32d94d,function(_0x3cad0f,_0x59eea7){if(_0x3cad0f){return _0x30b222(_0x3cad0f);}pm2['disconnect']();return _0x1c3f43(_0x59eea7);});});});};exports[_0x8b84('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x55db7a,_0x4f11c4){return pm2['list'](function(_0xb9d4c7,_0x1f32ec){if(_0xb9d4c7){return _0x4f11c4(_0xb9d4c7);}pm2[_0x8b84('0x6')]();return _0x55db7a(_0x1f32ec);});});});};exports[_0x8b84('0x9')]=function(_0x4c77c1){return connect()['then'](function(){return new BPromise(function(_0x412082,_0x1fcf1f){return pm2['describe'](_0x4c77c1,function(_0x5b510b,_0x4bcedc){if(_0x5b510b){return _0x1fcf1f(_0x5b510b);}pm2[_0x8b84('0x6')]();return _0x412082(_0x4bcedc);});});});};exports[_0x8b84('0xa')]=function(_0x9b89d8){return connect()[_0x8b84('0x7')](function(){return new BPromise(function(_0x17ae60,_0x579cde){return pm2[_0x8b84('0xa')](_0x9b89d8,function(_0x38f1b0,_0x37abbe){if(_0x38f1b0){return _0x579cde(_0x38f1b0);}pm2[_0x8b84('0x6')]();return _0x17ae60(_0x37abbe);});});});};exports[_0x8b84('0xb')]=function(){return connect()[_0x8b84('0x7')](function(){return new BPromise(function(_0x184191,_0x47fe50){return pm2[_0x8b84('0xb')](function(_0x502322){if(_0x502322){return _0x47fe50(_0x502322);}return _0x184191(_0x8b84('0xc'));});});});}; \ No newline at end of file +var _0xa646=['dump','bluebird','./config','connected','start','disconnect','then','stop','restart','list','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa646,0x135));var _0x6a64=function(_0x9ed79d,_0x7d5bc5){_0x9ed79d=_0x9ed79d-0x0;var _0xee068b=_0xa646[_0x9ed79d];return _0xee068b;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6a64('0x0'));var config=require(_0x6a64('0x1'));function connect(){return new BPromise(function(_0x3fc63d,_0x2da109){return pm2['connect'](function(_0x171280){if(_0x171280){return _0x2da109(_0x171280);}return _0x3fc63d(_0x6a64('0x2'));});});};exports[_0x6a64('0x3')]=function(_0xecaf94){return connect()['then'](function(){return new BPromise(function(_0xc36d4c,_0x4866d6){return pm2['start'](_0xecaf94,function(_0x29e8c6,_0x5aaede){if(_0x29e8c6){return _0x4866d6(_0x29e8c6);}pm2[_0x6a64('0x4')]();return _0xc36d4c(_0x5aaede);});});});};exports['stop']=function(_0x34d434){return connect()[_0x6a64('0x5')](function(){return new BPromise(function(_0x182f54,_0x4c1bdf){return pm2[_0x6a64('0x6')](_0x34d434,function(_0x78888,_0x4d9477){if(_0x78888){return _0x4c1bdf(_0x78888);}pm2[_0x6a64('0x4')]();return _0x182f54(_0x4d9477);});});});};exports[_0x6a64('0x7')]=function(_0x5874ce){return connect()[_0x6a64('0x5')](function(){return new BPromise(function(_0x8a2feb,_0x311a97){return pm2[_0x6a64('0x7')](_0x5874ce,function(_0x5a95ea,_0x1b19de){if(_0x5a95ea){return _0x311a97(_0x5a95ea);}pm2[_0x6a64('0x4')]();return _0x8a2feb(_0x1b19de);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x3b988c,_0x39e770){return pm2[_0x6a64('0x8')](function(_0x19e758,_0x592288){if(_0x19e758){return _0x39e770(_0x19e758);}pm2[_0x6a64('0x4')]();return _0x3b988c(_0x592288);});});});};exports['describe']=function(_0x5694d4){return connect()[_0x6a64('0x5')](function(){return new BPromise(function(_0x24905e,_0x50d226){return pm2['describe'](_0x5694d4,function(_0xa785e,_0x4f0e53){if(_0xa785e){return _0x50d226(_0xa785e);}pm2['disconnect']();return _0x24905e(_0x4f0e53);});});});};exports[_0x6a64('0x9')]=function(_0x214c84){return connect()['then'](function(){return new BPromise(function(_0x575da4,_0x501a1c){return pm2[_0x6a64('0x9')](_0x214c84,function(_0x54f71c,_0x3f07fb){if(_0x54f71c){return _0x501a1c(_0x54f71c);}pm2[_0x6a64('0x4')]();return _0x575da4(_0x3f07fb);});});});};exports[_0x6a64('0xa')]=function(){return connect()[_0x6a64('0x5')](function(){return new BPromise(function(_0x55ee01,_0x171c48){return pm2[_0x6a64('0xa')](function(_0x11e33e){if(_0x11e33e){return _0x171c48(_0x11e33e);}return _0x55ee01('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index bb11996..02f80d6 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 _0xe6d5=['then','length','map','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../logger','defaults','localhost','socket.io-emitter','redis','Setting','chatTimeout','ChatInteraction','findAll','subtract','minutes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe6d5,0xa4));var _0x5e6d=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xe6d5[_0xa4928c];return _0x27cc29;};'use strict';var _=require(_0x5e6d('0x0'));var moment=require(_0x5e6d('0x1'));var Redis=require(_0x5e6d('0x2'));var util=require(_0x5e6d('0x3'));var config=require(_0x5e6d('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x5e6d('0x5'))('schedule');config['redis']=_[_0x5e6d('0x6')](config['redis'],{'host':_0x5e6d('0x7'),'port':0x18eb});var io=require(_0x5e6d('0x8'))(new Redis(config[_0x5e6d('0x9')]));function closeInteractions(){var _0x2c1cbd=0x0;var _0x5ce0ed=[];return db[_0x5e6d('0xa')]['find']({'raw':!![],'attributes':['id',_0x5e6d('0xb')],'where':{'id':0x1}})['then'](function(_0x183fcd){_0x2c1cbd=_0x183fcd[_0x5e6d('0xb')];if(_0x2c1cbd){return db[_0x5e6d('0xc')][_0x5e6d('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5e6d('0xe')](_0x183fcd[_0x5e6d('0xb')],_0x5e6d('0xf'))}}});}else{return[];}})[_0x5e6d('0x10')](function(_0x1e12a0){if(_0x1e12a0&&_0x1e12a0[_0x5e6d('0x11')]){_0x5ce0ed=_[_0x5e6d('0x12')](_0x1e12a0||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x5ce0ed[_0x5e6d('0x13')]());return db[_0x5e6d('0xc')][_0x5e6d('0x14')]({'closeReason':_0x5e6d('0x15'),'disposition':_0x5e6d('0x16'),'closed':!![],'closedAt':moment()['format'](_0x5e6d('0x17'))},{'where':{'id':_0x5ce0ed}});}})[_0x5e6d('0x10')](function(){if(_0x5ce0ed&&_0x5ce0ed['length']){logger[_0x5e6d('0x18')](_0x5e6d('0x19'),_0x5ce0ed[_0x5e6d('0x13')]());for(var _0x4dce77=0x0;_0x4dce77<_0x5ce0ed[_0x5e6d('0x11')];_0x4dce77++){io['emit'](_0x5e6d('0x1a'),{'id':_0x5ce0ed[_0x4dce77],'closed':!![]});}}})['catch'](function(_0x4513e5){logger[_0x5e6d('0x1b')](_0x5e6d('0x1c'),_0x4513e5?util['inspect'](_0x4513e5,{'showHidden':![],'depth':null}):'');});}exports[_0x5e6d('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf2d0=['Setting','find','then','chatTimeout','ChatInteraction','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../mysqldb','../logger','defaults','redis','localhost'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0xf2d0,0x197));var _0x0f2d=function(_0x1387f3,_0x287117){_0x1387f3=_0x1387f3-0x0;var _0x226e25=_0xf2d0[_0x1387f3];return _0x226e25;};'use strict';var _=require(_0x0f2d('0x0'));var moment=require(_0x0f2d('0x1'));var Redis=require(_0x0f2d('0x2'));var util=require(_0x0f2d('0x3'));var config=require('../../config/environment');var db=require(_0x0f2d('0x4'))['db'];var logger=require(_0x0f2d('0x5'))('schedule');config['redis']=_[_0x0f2d('0x6')](config[_0x0f2d('0x7')],{'host':_0x0f2d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0f2d('0x7')]));function closeInteractions(){var _0x5ee505=0x0;var _0x43e40f=[];return db[_0x0f2d('0x9')][_0x0f2d('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x0f2d('0xb')](function(_0x39d7f9){_0x5ee505=_0x39d7f9[_0x0f2d('0xc')];if(_0x5ee505){return db[_0x0f2d('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x0f2d('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0f2d('0xf')](_0x39d7f9[_0x0f2d('0xc')],'minutes')}}});}else{return[];}})[_0x0f2d('0xb')](function(_0x1caf7c){if(_0x1caf7c&&_0x1caf7c[_0x0f2d('0x10')]){_0x43e40f=_[_0x0f2d('0x11')](_0x1caf7c||[],'id');logger[_0x0f2d('0x12')](_0x0f2d('0x13'),_0x43e40f[_0x0f2d('0x14')]());return db[_0x0f2d('0xd')][_0x0f2d('0x15')]({'closeReason':_0x0f2d('0x16'),'disposition':_0x0f2d('0x17'),'closed':!![],'closedAt':moment()[_0x0f2d('0x18')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x43e40f}});}})[_0x0f2d('0xb')](function(){if(_0x43e40f&&_0x43e40f['length']){logger[_0x0f2d('0x12')](_0x0f2d('0x19'),_0x43e40f['join']());for(var _0xf1dd5f=0x0;_0xf1dd5f<_0x43e40f['length'];_0xf1dd5f++){io[_0x0f2d('0x1a')](_0x0f2d('0x1b'),{'id':_0x43e40f[_0xf1dd5f],'closed':!![]});}}})[_0x0f2d('0x1c')](function(_0x49808c){logger[_0x0f2d('0x1d')](_0x0f2d('0x1e'),_0x49808c?util['inspect'](_0x49808c,{'showHidden':![],'depth':null}):'');});}exports[_0x0f2d('0x1f')]=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 eb9a4c8..132c58a 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 _0xdb22=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x43ed38,_0x507af1){var _0x181497=function(_0x153d8e){while(--_0x153d8e){_0x43ed38['push'](_0x43ed38['shift']());}};_0x181497(++_0x507af1);}(_0xdb22,0x18d));var _0x2db2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdb22[_0x2dafbe];return _0x58a45a;};'use strict';function start(){var _0xfc7de5=require(_0x2db2('0x0'));return _0xfc7de5[_0x2db2('0x1')]();}module[_0x2db2('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x9112=['startAllRefreshIntervals'];(function(_0x1a57d1,_0x4281ff){var _0x394876=function(_0x268ec9){while(--_0x268ec9){_0x1a57d1['push'](_0x1a57d1['shift']());}};_0x394876(++_0x4281ff);}(_0x9112,0x19d));var _0x2911=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x9112[_0x5f3f88];return _0xd08119;};'use strict';function start(){var _0x46cf8c=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x46cf8c[_0x2911('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 3e86d07..ca2c4ce 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 _0x614b=['basename','extname','zip','join','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','attachments','empty\x20file,\x20email\x20not\x20sent','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','CloudProvider','keys','jobs','toString','keyBy','difference','length','exists','stop','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','deleteJob','stop\x20cron','endAt','update','update\x20cron','run','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','format','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','savename'];(function(_0x3bb8d6,_0x4cfaed){var _0x32551f=function(_0x252ba1){while(--_0x252ba1){_0x3bb8d6['push'](_0x3bb8d6['shift']());}};_0x32551f(++_0x4cfaed);}(_0x614b,0x8e));var _0xb614=function(_0x6ad493,_0x495203){_0x6ad493=_0x6ad493-0x0;var _0x3ba724=_0x614b[_0x6ad493];return _0x3ba724;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require('lodash');var moment=require(_0xb614('0x0'));var CronJobManager=require(_0xb614('0x1'));var jayson=require(_0xb614('0x2'));var BPromise=require(_0xb614('0x3'));var logger=require(_0xb614('0x4'))('schedule');var db=require(_0xb614('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xb614('0x6'));var client=jayson[_0xb614('0x7')][_0xb614('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x24dd68,_0x11d9e5){return function(){logger[_0xb614('0x9')](_0xb614('0xa'),_0x24dd68['email']);var _0x1c43ae=!![];var _0x25504f=_0x24dd68[_0xb614('0xb')]['getSmtpOptions']();var _0x486531={'account':_0x25504f,'message':{'from':util[_0xb614('0xc')](_0xb614('0xd'),_0x24dd68[_0xb614('0xb')]['name'],_0x24dd68[_0xb614('0xb')][_0xb614('0xe')]||_0x24dd68[_0xb614('0xb')][_0xb614('0xf')][_0xb614('0x10')]),'to':_0x24dd68[_0xb614('0xe')],'cc':_0x24dd68['cc'],'bcc':_0x24dd68[_0xb614('0x11')],'subject':util[_0xb614('0xc')](_0xb614('0x12'),_0x11d9e5['name'],_0x24dd68[_0xb614('0x13')],_0x24dd68[_0xb614('0x14')])}};var _0x55194e=path['join'](__dirname,'../../files/reports');var _0x3baa8e=_0x11d9e5[_0xb614('0x15')];var _0x5d3c92=util[_0xb614('0xc')]('%s.%s',path[_0xb614('0x16')](_0x11d9e5[_0xb614('0x15')],path[_0xb614('0x17')](_0x11d9e5['savename'])),_0xb614('0x18'));var _0x54ed84=path['join'](_0x55194e,_0x3baa8e);var _0x26cdb5=path[_0xb614('0x19')](_0x55194e,_0x5d3c92);if(fs['existsSync'](_0x54ed84)){_0x11d9e5[_0xb614('0x1a')]=_0xb614('0x1b');_0x486531[_0xb614('0x1c')]['attachments']=[{'filename':_0x3baa8e,'path':_0x54ed84}];_0x486531[_0xb614('0x1c')][_0xb614('0x1d')]=util[_0xb614('0xc')](_0xb614('0x1e'),JSON[_0xb614('0x1f')](_0x11d9e5,null,0x2));}else if(fs[_0xb614('0x20')](_0x26cdb5)){_0x11d9e5['status']=_0xb614('0x1b');_0x486531['message'][_0xb614('0x21')]=[{'filename':_0x5d3c92,'path':_0x26cdb5}];}else{_0x486531[_0xb614('0x1c')][_0xb614('0x1d')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x24dd68['sendIfEmpty']){_0x1c43ae=![];logger[_0xb614('0x9')](_0xb614('0x22'));}}if(_0x1c43ae){return client['request']('SendMail',_0x486531)['then'](function(_0x4c8183){if(_0x4c8183[_0xb614('0x23')]){return logger[_0xb614('0x23')](_0xb614('0x24'),JSON[_0xb614('0x1f')](_0x4c8183));}return logger[_0xb614('0x9')]('email\x20sent');})[_0xb614('0x25')](function(_0x2cd2e2){return logger[_0xb614('0x23')]('error\x20mail',JSON[_0xb614('0x1f')](_0x2cd2e2));});}};}function handleError(){return function(_0x542622){return logger[_0xb614('0x23')](JSON['stringify'](_0x542622));};}function handleResult(_0x11c6b7){return function(_0x33e223){logger[_0xb614('0x9')](_0xb614('0x26'),JSON[_0xb614('0x1f')](_0x33e223));if(_0x11c6b7[_0xb614('0xb')]&&_0x11c6b7[_0xb614('0xb')]['Smtp']&&!_[_0xb614('0x27')](_0x11c6b7['email'])){setTimeout(handleSendEmail(_0x11c6b7,_0x33e223),0x3c*0x3e8);}};}function handleJob(_0x33703e){return function(){try{if(_['isNil'](_0x33703e['subtractNumber'])){return logger[_0xb614('0x9')](_0xb614('0x28'));}if(_[_0xb614('0x27')](_0x33703e[_0xb614('0x14')])){return logger[_0xb614('0x9')](_0xb614('0x29'));}var _0x4a0456={'startDate':moment()[_0xb614('0x2a')](_0x33703e['subtractNumber'],_0x33703e[_0xb614('0x14')])[_0xb614('0xc')](_0xb614('0x2b')),'endDate':moment()['format'](_0xb614('0x2b')),'type':_0xb614('0x2c'),'output':_0x33703e[_0xb614('0x2d')],'name':_0x33703e[_0xb614('0x2e')]};if(!_[_0xb614('0x27')](_0x33703e[_0xb614('0x2f')])){logger[_0xb614('0x9')](_0xb614('0x30'),_0x33703e[_0xb614('0x2f')]);return analyticDefaultReportController[_0xb614('0x31')]({'id':_0x33703e['DefaultReportId']},_0x4a0456)[_0xb614('0x32')](handleResult(_0x33703e))[_0xb614('0x25')](handleError());}if(!_[_0xb614('0x27')](_0x33703e[_0xb614('0x33')])){logger[_0xb614('0x9')](_0xb614('0x34'),_0x33703e[_0xb614('0x33')]);return analyticCustomReportController['runReport']({'id':_0x33703e[_0xb614('0x33')]},_0x4a0456)[_0xb614('0x32')](handleResult(_0x33703e))['catch'](handleError());}}catch(_0x2d7df6){logger[_0xb614('0x23')](JSON[_0xb614('0x1f')](_0x2d7df6));}return logger['info'](_0xb614('0x35'));};}function getJobs(_0x40a245){var _0x3eefd9={};if(_0x40a245){_0x3eefd9['id']=_0x40a245;}return db[_0xb614('0x36')]['findAll']({'where':_0x3eefd9,'include':[{'model':db[_0xb614('0xb')],'attributes':['id',_0xb614('0x2e'),_0xb614('0xe')],'include':[{'model':db['MailServerOut'],'as':_0xb614('0xf'),'include':[{'model':db[_0xb614('0x37')],'as':_0xb614('0x37')}]}]}]})[_0xb614('0x32')](function(_0x4b9830){var _0x54cad8=_[_0xb614('0x38')](manager[_0xb614('0x39')]);var _0xe907dd=_['map'](_0x4b9830,function(_0x4fdcbb){return _0x4fdcbb['id'][_0xb614('0x3a')]();});var _0x1fb4b5=_[_0xb614('0x3b')](_0x4b9830,function(_0x64583e){return _0x64583e['id']['toString']();});var _0x1f5474=_0x40a245?_0xe907dd:_[_0xb614('0x3c')](_0xe907dd,_0x54cad8);var _0x2a7aaf=_['intersection'](_0xe907dd,_0x54cad8);var _0x16b087=_['difference'](_0x54cad8,_0xe907dd);var _0x94ffaa;var _0x40a00b;for(_0x94ffaa=0x0;_0x94ffaa<_0x16b087[_0xb614('0x3d')]&&!_0x40a245;_0x94ffaa+=0x1){_0x40a00b=_0x16b087[_0x94ffaa]['toString']();if(manager[_0xb614('0x3e')](_0x40a00b)){manager[_0xb614('0x3f')](_0x40a00b);manager['deleteJob'](_0x40a00b);logger[_0xb614('0x9')](_0xb614('0x40'),_0x40a00b);}}logger[_0xb614('0x9')]('toRun',JSON[_0xb614('0x1f')](_0x1f5474));for(_0x94ffaa=0x0;_0x94ffaa<_0x1f5474[_0xb614('0x3d')];_0x94ffaa+=0x1){_0x40a00b=_0x1f5474[_0x94ffaa][_0xb614('0x3a')]();logger[_0xb614('0x9')](_0xb614('0x41'),_0x40a00b);if(_0x40a245){logger['info'](_0xb614('0x42'),_0x40a245);logger[_0xb614('0x9')](JSON['stringify'](_0x1fb4b5[_0x40a00b]));BPromise[_0xb614('0x43')]()['then'](handleJob(_0x1fb4b5[_0x40a00b]));logger[_0xb614('0x9')](_0xb614('0x44'),_0x1fb4b5[_0x40a00b][_0xb614('0x2e')],_0x1fb4b5[_0x40a00b]['cron']);}else if(_0x1fb4b5[_0x40a00b][_0xb614('0x45')]&&_0x1fb4b5[_0x40a00b][_0xb614('0x46')]&&moment()[_0xb614('0x47')](_0x1fb4b5[_0x40a00b][_0xb614('0x48')],_0x1fb4b5[_0x40a00b]['endAt'])){manager[_0xb614('0x49')](_0x40a00b,_0x1fb4b5[_0x40a00b]['cron'],handleJob(_0x1fb4b5[_0x40a00b]));manager[_0xb614('0x4a')](_0x40a00b);logger[_0xb614('0x9')](_0xb614('0x4b'),_0x1fb4b5[_0x40a00b][_0xb614('0x2e')],_0x1fb4b5[_0x40a00b][_0xb614('0x45')]);}else if(manager[_0xb614('0x3e')](_0x40a00b)){manager[_0xb614('0x3f')](_0x40a00b);manager[_0xb614('0x4c')](_0x40a00b);logger[_0xb614('0x9')](_0xb614('0x4d'),_0x1fb4b5[_0x40a00b][_0xb614('0x2e')],_0x1fb4b5[_0x40a00b][_0xb614('0x45')]);}}for(_0x94ffaa=0x0,_0x40a00b;_0x94ffaa<_0x2a7aaf[_0xb614('0x3d')]&&!_0x40a245;_0x94ffaa+=0x1){_0x40a00b=_0x2a7aaf[_0x94ffaa][_0xb614('0x3a')]();if(manager[_0xb614('0x3e')](_0x40a00b)){if(_0x1fb4b5[_0x40a00b][_0xb614('0x45')]&&_0x1fb4b5[_0x40a00b]['active']&&moment()[_0xb614('0x47')](_0x1fb4b5[_0x40a00b][_0xb614('0x48')],_0x1fb4b5[_0x40a00b][_0xb614('0x4e')])){manager[_0xb614('0x4f')](_0x40a00b,_0x1fb4b5[_0x40a00b][_0xb614('0x45')],handleJob(_0x1fb4b5[_0x40a00b]));logger[_0xb614('0x9')](_0xb614('0x50'),_0x1fb4b5[_0x40a00b][_0xb614('0x2e')],_0x1fb4b5[_0x40a00b][_0xb614('0x45')]);}else{manager[_0xb614('0x3f')](_0x40a00b);manager[_0xb614('0x4c')](_0x40a00b);logger[_0xb614('0x9')](_0xb614('0x4d'),_0x1fb4b5[_0x40a00b][_0xb614('0x2e')],_0x1fb4b5[_0x40a00b][_0xb614('0x45')]);}}}})['catch'](function(_0x3ccd6d){logger[_0xb614('0x23')](JSON[_0xb614('0x1f')](_0x3ccd6d));});}exports[_0xb614('0x51')]=function(_0x4f9458){return getJobs(_0x4f9458);};exports[_0xb614('0x4a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xccc3=['email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','MailServerOut','CloudProvider','map','toString','keyBy','difference','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop','update\x20cron','stop\x20cron','run','path','lodash','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail'];(function(_0x524fd7,_0x33cd75){var _0x2a8723=function(_0x3e53e0){while(--_0x3e53e0){_0x524fd7['push'](_0x524fd7['shift']());}};_0x2a8723(++_0x33cd75);}(_0xccc3,0x77));var _0x3ccc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xccc3[_0x57b54c];return _0x59cc19;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x3ccc('0x0'));var _=require(_0x3ccc('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3ccc('0x2'))(_0x3ccc('0x3'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x3ccc('0x4'));var analyticDefaultReportController=require(_0x3ccc('0x5'));var client=jayson[_0x3ccc('0x6')][_0x3ccc('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1bb5d1,_0x371a4f){return function(){logger[_0x3ccc('0x8')](_0x3ccc('0x9'),_0x1bb5d1[_0x3ccc('0xa')]);var _0x3f9e8e=!![];var _0x1d3211=_0x1bb5d1[_0x3ccc('0xb')]['getSmtpOptions']();var _0x48d244={'account':_0x1d3211,'message':{'from':util[_0x3ccc('0xc')](_0x3ccc('0xd'),_0x1bb5d1[_0x3ccc('0xb')]['name'],_0x1bb5d1[_0x3ccc('0xb')][_0x3ccc('0xa')]||_0x1bb5d1[_0x3ccc('0xb')][_0x3ccc('0xe')][_0x3ccc('0xf')]),'to':_0x1bb5d1[_0x3ccc('0xa')],'cc':_0x1bb5d1['cc'],'bcc':_0x1bb5d1[_0x3ccc('0x10')],'subject':util[_0x3ccc('0xc')](_0x3ccc('0x11'),_0x371a4f[_0x3ccc('0x12')],_0x1bb5d1[_0x3ccc('0x13')],_0x1bb5d1[_0x3ccc('0x14')])}};var _0x57600b=path[_0x3ccc('0x15')](__dirname,_0x3ccc('0x16'));var _0x34c1e9=_0x371a4f[_0x3ccc('0x17')];var _0x2de527=util[_0x3ccc('0xc')](_0x3ccc('0x18'),path[_0x3ccc('0x19')](_0x371a4f[_0x3ccc('0x17')],path[_0x3ccc('0x1a')](_0x371a4f['savename'])),_0x3ccc('0x1b'));var _0x58110d=path[_0x3ccc('0x15')](_0x57600b,_0x34c1e9);var _0x1f19d5=path['join'](_0x57600b,_0x2de527);if(fs[_0x3ccc('0x1c')](_0x58110d)){_0x371a4f[_0x3ccc('0x1d')]='Sent';_0x48d244[_0x3ccc('0x1e')][_0x3ccc('0x1f')]=[{'filename':_0x34c1e9,'path':_0x58110d}];_0x48d244[_0x3ccc('0x1e')][_0x3ccc('0x20')]=util[_0x3ccc('0xc')](_0x3ccc('0x21'),JSON[_0x3ccc('0x22')](_0x371a4f,null,0x2));}else if(fs['existsSync'](_0x1f19d5)){_0x371a4f[_0x3ccc('0x1d')]=_0x3ccc('0x23');_0x48d244[_0x3ccc('0x1e')][_0x3ccc('0x1f')]=[{'filename':_0x2de527,'path':_0x1f19d5}];}else{_0x48d244[_0x3ccc('0x1e')][_0x3ccc('0x20')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x1bb5d1[_0x3ccc('0x24')]){_0x3f9e8e=![];logger[_0x3ccc('0x8')](_0x3ccc('0x25'));}}if(_0x3f9e8e){return client[_0x3ccc('0x26')](_0x3ccc('0x27'),_0x48d244)[_0x3ccc('0x28')](function(_0x569008){if(_0x569008[_0x3ccc('0x29')]){return logger['error'](_0x3ccc('0x2a'),JSON[_0x3ccc('0x22')](_0x569008));}return logger[_0x3ccc('0x8')](_0x3ccc('0x2b'));})[_0x3ccc('0x2c')](function(_0x848789){return logger['error']('error\x20mail',JSON['stringify'](_0x848789));});}};}function handleError(){return function(_0x15aeaf){return logger[_0x3ccc('0x29')](JSON[_0x3ccc('0x22')](_0x15aeaf));};}function handleResult(_0x31b418){return function(_0x4c948b){logger[_0x3ccc('0x8')](_0x3ccc('0x2d'),JSON['stringify'](_0x4c948b));if(_0x31b418['MailAccount']&&_0x31b418[_0x3ccc('0xb')][_0x3ccc('0xe')]&&!_['isNil'](_0x31b418[_0x3ccc('0xa')])){setTimeout(handleSendEmail(_0x31b418,_0x4c948b),0x3c*0x3e8);}};}function handleJob(_0x59466d){return function(){try{if(_[_0x3ccc('0x2e')](_0x59466d['subtractNumber'])){return logger[_0x3ccc('0x8')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x3ccc('0x2e')](_0x59466d['subtractUnit'])){return logger[_0x3ccc('0x8')](_0x3ccc('0x2f'));}var _0x5f49f6={'startDate':moment()['subtract'](_0x59466d[_0x3ccc('0x13')],_0x59466d[_0x3ccc('0x14')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x3ccc('0xc')](_0x3ccc('0x30')),'type':_0x3ccc('0x31'),'output':_0x59466d['output'],'name':_0x59466d[_0x3ccc('0x12')]};if(!_['isNil'](_0x59466d[_0x3ccc('0x32')])){logger['info'](_0x3ccc('0x33'),_0x59466d[_0x3ccc('0x32')]);return analyticDefaultReportController[_0x3ccc('0x34')]({'id':_0x59466d[_0x3ccc('0x32')]},_0x5f49f6)[_0x3ccc('0x28')](handleResult(_0x59466d))[_0x3ccc('0x2c')](handleError());}if(!_[_0x3ccc('0x2e')](_0x59466d[_0x3ccc('0x35')])){logger[_0x3ccc('0x8')]('exec\x20custom\x20report\x20id:%s',_0x59466d[_0x3ccc('0x35')]);return analyticCustomReportController['runReport']({'id':_0x59466d[_0x3ccc('0x35')]},_0x5f49f6)[_0x3ccc('0x28')](handleResult(_0x59466d))[_0x3ccc('0x2c')](handleError());}}catch(_0x273a9b){logger[_0x3ccc('0x29')](JSON['stringify'](_0x273a9b));}return logger['info'](_0x3ccc('0x36'));};}function getJobs(_0x1da9a2){var _0x590feb={};if(_0x1da9a2){_0x590feb['id']=_0x1da9a2;}return db['Schedule']['findAll']({'where':_0x590feb,'include':[{'model':db['MailAccount'],'attributes':['id',_0x3ccc('0x12'),'email'],'include':[{'model':db[_0x3ccc('0x37')],'as':'Smtp','include':[{'model':db[_0x3ccc('0x38')],'as':_0x3ccc('0x38')}]}]}]})[_0x3ccc('0x28')](function(_0x4ef377){var _0x4bd892=_['keys'](manager['jobs']);var _0x36b12e=_[_0x3ccc('0x39')](_0x4ef377,function(_0x5840a4){return _0x5840a4['id'][_0x3ccc('0x3a')]();});var _0x2cb831=_[_0x3ccc('0x3b')](_0x4ef377,function(_0xec7941){return _0xec7941['id'][_0x3ccc('0x3a')]();});var _0x12e532=_0x1da9a2?_0x36b12e:_[_0x3ccc('0x3c')](_0x36b12e,_0x4bd892);var _0x7f2743=_['intersection'](_0x36b12e,_0x4bd892);var _0x1fd9a4=_[_0x3ccc('0x3c')](_0x4bd892,_0x36b12e);var _0x3e375b;var _0x146a5e;for(_0x3e375b=0x0;_0x3e375b<_0x1fd9a4[_0x3ccc('0x3d')]&&!_0x1da9a2;_0x3e375b+=0x1){_0x146a5e=_0x1fd9a4[_0x3e375b][_0x3ccc('0x3a')]();if(manager[_0x3ccc('0x3e')](_0x146a5e)){manager['stop'](_0x146a5e);manager[_0x3ccc('0x3f')](_0x146a5e);logger[_0x3ccc('0x8')](_0x3ccc('0x40'),_0x146a5e);}}logger[_0x3ccc('0x8')](_0x3ccc('0x41'),JSON[_0x3ccc('0x22')](_0x12e532));for(_0x3e375b=0x0;_0x3e375b<_0x12e532[_0x3ccc('0x3d')];_0x3e375b+=0x1){_0x146a5e=_0x12e532[_0x3e375b][_0x3ccc('0x3a')]();logger[_0x3ccc('0x8')](_0x3ccc('0x42'),_0x146a5e);if(_0x1da9a2){logger['info'](_0x3ccc('0x43'),_0x1da9a2);logger[_0x3ccc('0x8')](JSON[_0x3ccc('0x22')](_0x2cb831[_0x146a5e]));BPromise[_0x3ccc('0x44')]()[_0x3ccc('0x28')](handleJob(_0x2cb831[_0x146a5e]));logger[_0x3ccc('0x8')]('run\x20job',_0x2cb831[_0x146a5e]['name'],_0x2cb831[_0x146a5e][_0x3ccc('0x45')]);}else if(_0x2cb831[_0x146a5e][_0x3ccc('0x45')]&&_0x2cb831[_0x146a5e][_0x3ccc('0x46')]&&moment()[_0x3ccc('0x47')](_0x2cb831[_0x146a5e][_0x3ccc('0x48')],_0x2cb831[_0x146a5e][_0x3ccc('0x49')])){manager[_0x3ccc('0x4a')](_0x146a5e,_0x2cb831[_0x146a5e][_0x3ccc('0x45')],handleJob(_0x2cb831[_0x146a5e]));manager[_0x3ccc('0x4b')](_0x146a5e);logger[_0x3ccc('0x8')](_0x3ccc('0x4c'),_0x2cb831[_0x146a5e][_0x3ccc('0x12')],_0x2cb831[_0x146a5e][_0x3ccc('0x45')]);}else if(manager[_0x3ccc('0x3e')](_0x146a5e)){manager[_0x3ccc('0x4d')](_0x146a5e);manager[_0x3ccc('0x3f')](_0x146a5e);logger[_0x3ccc('0x8')]('stop\x20cron',_0x2cb831[_0x146a5e][_0x3ccc('0x12')],_0x2cb831[_0x146a5e][_0x3ccc('0x45')]);}}for(_0x3e375b=0x0,_0x146a5e;_0x3e375b<_0x7f2743['length']&&!_0x1da9a2;_0x3e375b+=0x1){_0x146a5e=_0x7f2743[_0x3e375b][_0x3ccc('0x3a')]();if(manager[_0x3ccc('0x3e')](_0x146a5e)){if(_0x2cb831[_0x146a5e][_0x3ccc('0x45')]&&_0x2cb831[_0x146a5e][_0x3ccc('0x46')]&&moment()[_0x3ccc('0x47')](_0x2cb831[_0x146a5e][_0x3ccc('0x48')],_0x2cb831[_0x146a5e]['endAt'])){manager['update'](_0x146a5e,_0x2cb831[_0x146a5e][_0x3ccc('0x45')],handleJob(_0x2cb831[_0x146a5e]));logger[_0x3ccc('0x8')](_0x3ccc('0x4e'),_0x2cb831[_0x146a5e][_0x3ccc('0x12')],_0x2cb831[_0x146a5e]['cron']);}else{manager[_0x3ccc('0x4d')](_0x146a5e);manager[_0x3ccc('0x3f')](_0x146a5e);logger[_0x3ccc('0x8')](_0x3ccc('0x4f'),_0x2cb831[_0x146a5e][_0x3ccc('0x12')],_0x2cb831[_0x146a5e][_0x3ccc('0x45')]);}}}})[_0x3ccc('0x2c')](function(_0x8c5083){logger[_0x3ccc('0x29')](JSON['stringify'](_0x8c5083));});}exports[_0x3ccc('0x50')]=function(_0x50c270){return getJobs(_0x50c270);};exports[_0x3ccc('0x4b')]=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 6b7a29b..98d098b 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 _0x02ce=['FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Transcript\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','inspect','lodash','aws-sdk','request-promise','bluebird','../../config/logger','transcribe','Comprehend','detectSentiment','substring','format','transcribeName','data2','then','info','TranscriptionJob','COMPLETED','TranscriptionJobStatus','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x02ce,0x1ac));var _0xe02c=function(_0x2ccb53,_0x625376){_0x2ccb53=_0x2ccb53-0x0;var _0x6c7b5d=_0x02ce[_0x2ccb53];return _0x6c7b5d;};var _=require(_0xe02c('0x0'));var AWS=require(_0xe02c('0x1'));var rp=require(_0xe02c('0x2'));var util=require('util');var BPromise=require(_0xe02c('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xe02c('0x4'))(_0xe02c('0x5'));function getTranscriptionJob(_0x46475c,_0xf4b764,_0x41b41c,_0x229653){return new Promise(function(_0x3f7436,_0x2b804f){var _0x36a87f=new AWS['TranscribeService']({'accessKeyId':_0xf4b764,'secretAccessKey':_0x46475c,'region':_0x41b41c});_0x36a87f['getTranscriptionJob']({'TranscriptionJobName':_0x229653},function(_0x3c757e,_0x2d85d7){if(_0x3c757e){return _0x2b804f(_0x3c757e);}else{return _0x3f7436(_0x2d85d7);}});});}function sentiment(_0x469932,_0x1a9f97,_0x2afbf5,_0x18a398,_0x17fb93){return new Promise(function(_0x20ea63,_0x17e684){var _0x36c558=new AWS[(_0xe02c('0x6'))]({'accessKeyId':_0x1a9f97,'secretAccessKey':_0x469932,'region':_0x2afbf5});_0x36c558[_0xe02c('0x7')]({'Text':_0x18a398,'LanguageCode':_0x17fb93[_0xe02c('0x8')](0x0,0x2)},function(_0x2a382e,_0x27d301){if(_0x2a382e){return _0x17e684(_0x2a382e);}else{return _0x20ea63(_0x27d301);}});});}function checkTranscribeJob(_0x144037,_0x23d886,_0x32fc45){var _0x5d6d13;return new BPromise(function(_0x43079c,_0x525538){logger['info'](util[_0xe02c('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x144037['id'],_0x144037[_0xe02c('0xa')]));return getTranscriptionJob(_0x32fc45['data1'],_0x32fc45[_0xe02c('0xb')],_0x23d886['transcribeRegion'],_0x144037[_0xe02c('0xa')])[_0xe02c('0xc')](function(_0x59f2f6){logger[_0xe02c('0xd')](util[_0xe02c('0x9')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x144037['id'],_0x144037[_0xe02c('0xa')],_0x59f2f6[_0xe02c('0xe')]['TranscriptionJobStatus']));if(!_0x144037['fileText']){switch(_0x59f2f6[_0xe02c('0xe')]['TranscriptionJobStatus']){case _0xe02c('0xf'):var _0x28b21a={'transcribeStatus':_0x59f2f6[_0xe02c('0xe')][_0xe02c('0x10')],'fileUri':_0x59f2f6[_0xe02c('0xe')]['Transcript'][_0xe02c('0x11')]};logger['info'](util['format'](_0xe02c('0x12'),_0x144037['id']));return rp({'uri':_0x59f2f6[_0xe02c('0xe')]['Transcript'][_0xe02c('0x11')],'json':!![]})[_0xe02c('0xc')](function(_0x4ce5ee){logger[_0xe02c('0xd')](util[_0xe02c('0x9')](_0xe02c('0x13'),_0x144037['id']));if(_0x4ce5ee&&_0x4ce5ee[_0xe02c('0x14')]&&_0x4ce5ee[_0xe02c('0x14')][_0xe02c('0x15')]&&_0x4ce5ee[_0xe02c('0x14')][_0xe02c('0x15')][_0xe02c('0x16')]){_0x28b21a[_0xe02c('0x17')]='';for(var _0x60b65e=0x0;_0x60b65e<_0x4ce5ee['results'][_0xe02c('0x15')][_0xe02c('0x16')];_0x60b65e++){_0x28b21a[_0xe02c('0x17')]+=_0x4ce5ee[_0xe02c('0x14')][_0xe02c('0x15')][_0x60b65e][_0xe02c('0x18')]+'';}}return _0x144037[_0xe02c('0x19')](_0x28b21a);})[_0xe02c('0xc')](function(){logger['info'](util[_0xe02c('0x9')](_0xe02c('0x1a'),_0x144037['id']));if(!_0x144037[_0xe02c('0x1b')]){throw new db['Sequelize'][(_0xe02c('0x1c'))](_0xe02c('0x1d'));}if(!_0x23d886[_0xe02c('0x1e')]||!_0x23d886[_0xe02c('0x1f')]||!_0x23d886[_0xe02c('0x20')]||!_0x23d886[_0xe02c('0x21')]||!_0x23d886[_0xe02c('0x22')]){throw new db[(_0xe02c('0x23'))][(_0xe02c('0x1c'))](_0xe02c('0x24'));}if(!_0x28b21a[_0xe02c('0x17')]){throw new Error('Transcript\x20not\x20available');}if(_0x23d886[_0xe02c('0x1f')]===_0x32fc45['id']){return _0x32fc45;}else{return db[_0xe02c('0x25')][_0xe02c('0x26')]({'where':{'id':_settings[_0xe02c('0x1f')]}});}})[_0xe02c('0xc')](function(_0x14d27a){if(!_0x14d27a){throw new db['Sequelize'][(_0xe02c('0x1c'))](_0xe02c('0x27'));}if(!_0x14d27a['data1']||!_0x14d27a[_0xe02c('0xb')]){throw new db[(_0xe02c('0x23'))][(_0xe02c('0x1c'))](_0xe02c('0x28'));}_0x5d6d13=_0x14d27a;logger[_0xe02c('0xd')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x144037['id']));return sentiment(_0x5d6d13[_0xe02c('0x29')],_0x5d6d13[_0xe02c('0xb')],_0x23d886['sentimentRegion'],_0x28b21a[_0xe02c('0x17')],_0x23d886['language']);})[_0xe02c('0xc')](function(_0xaa8cc7){logger[_0xe02c('0xd')](util[_0xe02c('0x9')](_0xe02c('0x2a'),_0x144037['id']));return _0x144037['update']({'sentiment':_0xaa8cc7[_0xe02c('0x2b')],'sPositive':_0xaa8cc7['SentimentScore'][_0xe02c('0x2c')],'sNegative':_0xaa8cc7[_0xe02c('0x2d')][_0xe02c('0x2e')],'sMixed':_0xaa8cc7[_0xe02c('0x2d')][_0xe02c('0x2f')],'sNeutral':_0xaa8cc7[_0xe02c('0x2d')]['Neutral']});})[_0xe02c('0xc')](function(){logger[_0xe02c('0xd')](util['format'](_0xe02c('0x1a'),_0x144037['id']));_0x43079c();});case _0xe02c('0x30'):return _0x144037['update']({'transcribeStatus':_0xe02c('0x30'),'failureReason':_0x59f2f6['TranscriptionJob'][_0xe02c('0x31')]})[_0xe02c('0xc')](function(){logger['info'](util[_0xe02c('0x9')](_0xe02c('0x1a'),_0x144037['id']));_0x43079c();});default:logger[_0xe02c('0xd')](util[_0xe02c('0x9')](_0xe02c('0x32'),_0x144037['id']));break;}}else{return BPromise[_0xe02c('0x33')]()['then'](function(){if(!_0x144037[_0xe02c('0x1b')]){throw new db['Sequelize']['ValidationError'](_0xe02c('0x1d'));}if(!_0x23d886[_0xe02c('0x1e')]||!_0x23d886[_0xe02c('0x1f')]||!_0x23d886[_0xe02c('0x20')]||!_0x23d886['language']||!_0x23d886[_0xe02c('0x22')]){throw new db[(_0xe02c('0x23'))][(_0xe02c('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x144037['fileText']){throw new Error(_0xe02c('0x34'));}if(_0x23d886[_0xe02c('0x1f')]===_0x32fc45['id']){return _0x32fc45;}else{return db[_0xe02c('0x25')][_0xe02c('0x26')]({'where':{'id':_settings[_0xe02c('0x1f')]}});}})[_0xe02c('0xc')](function(_0x25f8ae){if(!_0x25f8ae){throw new db[(_0xe02c('0x23'))][(_0xe02c('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x25f8ae[_0xe02c('0x29')]||!_0x25f8ae['data2']){throw new db['Sequelize'][(_0xe02c('0x1c'))](_0xe02c('0x28'));}_0x5d6d13=_0x25f8ae;logger[_0xe02c('0xd')](util[_0xe02c('0x9')](_0xe02c('0x35'),_0x144037['id']));return sentiment(_0x5d6d13[_0xe02c('0x29')],_0x5d6d13[_0xe02c('0xb')],_0x23d886[_0xe02c('0x20')],_0x144037['fileText'],_0x23d886['language']);})[_0xe02c('0xc')](function(_0xf89a57){logger[_0xe02c('0xd')](util['format'](_0xe02c('0x2a'),_0x144037['id']));return _0x144037[_0xe02c('0x19')]({'sentiment':_0xf89a57[_0xe02c('0x2b')],'sPositive':_0xf89a57[_0xe02c('0x2d')][_0xe02c('0x2c')],'sNegative':_0xf89a57[_0xe02c('0x2d')][_0xe02c('0x2e')],'sMixed':_0xf89a57[_0xe02c('0x2d')][_0xe02c('0x2f')],'sNeutral':_0xf89a57[_0xe02c('0x2d')]['Neutral'],'transcribeStatus':_0xe02c('0xf')});})[_0xe02c('0xc')](function(){logger[_0xe02c('0xd')](util[_0xe02c('0x9')](_0xe02c('0x1a'),_0x144037['id']));_0x43079c();});}})[_0xe02c('0x36')](function(_0x125c43){if(_0x125c43){if(!_0x125c43[_0xe02c('0x37')]||_0x125c43[_0xe02c('0x37')]!==_0xe02c('0x38')){logger[_0xe02c('0x39')](util[_0xe02c('0x9')](_0xe02c('0x3a'),_0x144037['id']),util['inspect'](_0x125c43,{'showHidden':![],'depth':null}));}}_0x43079c();});});}function checkTranscribe(){var _0x25e790;var _0x4866e1;var _0x15b05c;return db[_0xe02c('0x3b')][_0xe02c('0x3c')]({'where':{'transcribeStatus':_0xe02c('0x3d')}})[_0xe02c('0xc')](function(_0x1ffb1d){if(!_0x1ffb1d||!_0x1ffb1d[_0xe02c('0x16')]){throw new db[(_0xe02c('0x23'))][(_0xe02c('0x1c'))](_0xe02c('0x3e'));}_0x25e790=_0x1ffb1d;return db['Setting'][_0xe02c('0x26')]({'where':{'id':0x1}});})[_0xe02c('0xc')](function(_0xeb4214){if(!_0xeb4214){throw new db['Sequelize'][(_0xe02c('0x1c'))]('Settings\x20not\x20available');}_0x4866e1=_0xeb4214;if(!_0x4866e1[_0xe02c('0x5')]||!_0x4866e1['transcribeAccountId']||!_0x4866e1['transcribeRegion']||!_0x4866e1['language']||!_0x4866e1['bucket']){throw new db['Sequelize']['ValidationError'](_0xe02c('0x3f'));}return db[_0xe02c('0x25')][_0xe02c('0x26')]({'where':{'id':_0x4866e1[_0xe02c('0x40')]}});})['then'](function(_0x274beb){if(!_0x274beb){throw new db[(_0xe02c('0x23'))]['ValidationError'](_0xe02c('0x27'));}if(!_0x274beb[_0xe02c('0x29')]||!_0x274beb[_0xe02c('0xb')]){throw new db['Sequelize']['ValidationError'](_0xe02c('0x28'));}_0x15b05c=_0x274beb;var _0x44a9f3=[];_0x25e790[_0xe02c('0x41')](function(_0x5b2d2b){_0x44a9f3[_0xe02c('0x42')](checkTranscribeJob(_0x5b2d2b,_0x4866e1,_0x15b05c));});return BPromise['all'](_0x44a9f3);})['catch'](function(_0x2d50c1){if(_0x2d50c1){if(!_0x2d50c1[_0xe02c('0x37')]||_0x2d50c1['name']!==_0xe02c('0x38')){logger[_0xe02c('0x39')](util[_0xe02c('0x43')](_0x2d50c1,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xab23=['lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError'];(function(_0x36363e,_0x221eec){var _0x436846=function(_0x400d35){while(--_0x400d35){_0x36363e['push'](_0x36363e['shift']());}};_0x436846(++_0x221eec);}(_0xab23,0x1bc));var _0x3ab2=function(_0x3b844a,_0x7e7a38){_0x3b844a=_0x3b844a-0x0;var _0x5a8d15=_0xab23[_0x3b844a];return _0x5a8d15;};var _=require(_0x3ab2('0x0'));var AWS=require(_0x3ab2('0x1'));var rp=require(_0x3ab2('0x2'));var util=require(_0x3ab2('0x3'));var BPromise=require(_0x3ab2('0x4'));var db=require(_0x3ab2('0x5'))['db'];var logger=require('../../config/logger')(_0x3ab2('0x6'));function getTranscriptionJob(_0x2d17cc,_0x379eb5,_0x1865fc,_0x5cb595){return new Promise(function(_0x5222ba,_0x3445f2){var _0x4e8d92=new AWS['TranscribeService']({'accessKeyId':_0x379eb5,'secretAccessKey':_0x2d17cc,'region':_0x1865fc});_0x4e8d92[_0x3ab2('0x7')]({'TranscriptionJobName':_0x5cb595},function(_0x46d253,_0x20cfe1){if(_0x46d253){return _0x3445f2(_0x46d253);}else{return _0x5222ba(_0x20cfe1);}});});}function sentiment(_0x1ac1a1,_0x2a7513,_0x120021,_0x122aa8,_0x4261c3){return new Promise(function(_0x1432ba,_0x1ac8d0){var _0x9265ce=new AWS['Comprehend']({'accessKeyId':_0x2a7513,'secretAccessKey':_0x1ac1a1,'region':_0x120021});_0x9265ce[_0x3ab2('0x8')]({'Text':_0x122aa8,'LanguageCode':_0x4261c3[_0x3ab2('0x9')](0x0,0x2)},function(_0x27fa76,_0x53bff8){if(_0x27fa76){return _0x1ac8d0(_0x27fa76);}else{return _0x1432ba(_0x53bff8);}});});}function checkTranscribeJob(_0x4fb4e1,_0x3fcc4d,_0x2ec0e3){var _0x1f967a;return new BPromise(function(_0x42d017,_0x23cdc3){logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')](_0x3ab2('0xc'),_0x4fb4e1['id'],_0x4fb4e1[_0x3ab2('0xd')]));return getTranscriptionJob(_0x2ec0e3['data1'],_0x2ec0e3[_0x3ab2('0xe')],_0x3fcc4d['transcribeRegion'],_0x4fb4e1[_0x3ab2('0xd')])[_0x3ab2('0xf')](function(_0x5c152c){logger['info'](util[_0x3ab2('0xb')](_0x3ab2('0x10'),_0x4fb4e1['id'],_0x4fb4e1[_0x3ab2('0xd')],_0x5c152c[_0x3ab2('0x11')][_0x3ab2('0x12')]));if(!_0x4fb4e1['fileText']){switch(_0x5c152c['TranscriptionJob'][_0x3ab2('0x12')]){case _0x3ab2('0x13'):var _0x48c7c1={'transcribeStatus':_0x5c152c[_0x3ab2('0x11')][_0x3ab2('0x12')],'fileUri':_0x5c152c[_0x3ab2('0x11')][_0x3ab2('0x14')]['TranscriptFileUri']};logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')](_0x3ab2('0x15'),_0x4fb4e1['id']));return rp({'uri':_0x5c152c[_0x3ab2('0x11')][_0x3ab2('0x14')][_0x3ab2('0x16')],'json':!![]})[_0x3ab2('0xf')](function(_0x12e3a2){logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4fb4e1['id']));if(_0x12e3a2&&_0x12e3a2[_0x3ab2('0x17')]&&_0x12e3a2[_0x3ab2('0x17')][_0x3ab2('0x18')]&&_0x12e3a2['results'][_0x3ab2('0x18')][_0x3ab2('0x19')]){_0x48c7c1[_0x3ab2('0x1a')]='';for(var _0x3dcb9e=0x0;_0x3dcb9e<_0x12e3a2[_0x3ab2('0x17')][_0x3ab2('0x18')][_0x3ab2('0x19')];_0x3dcb9e++){_0x48c7c1[_0x3ab2('0x1a')]+=_0x12e3a2[_0x3ab2('0x17')][_0x3ab2('0x18')][_0x3dcb9e][_0x3ab2('0x1b')]+'';}}return _0x4fb4e1[_0x3ab2('0x1c')](_0x48c7c1);})['then'](function(){logger[_0x3ab2('0xa')](util['format'](_0x3ab2('0x1d'),_0x4fb4e1['id']));if(!_0x4fb4e1[_0x3ab2('0x1e')]){throw new db[(_0x3ab2('0x1f'))][(_0x3ab2('0x20'))](_0x3ab2('0x21'));}if(!_0x3fcc4d[_0x3ab2('0x22')]||!_0x3fcc4d[_0x3ab2('0x23')]||!_0x3fcc4d[_0x3ab2('0x24')]||!_0x3fcc4d[_0x3ab2('0x25')]||!_0x3fcc4d[_0x3ab2('0x26')]){throw new db[(_0x3ab2('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x48c7c1['fileText']){throw new Error(_0x3ab2('0x27'));}if(_0x3fcc4d['sentimentAccountId']===_0x2ec0e3['id']){return _0x2ec0e3;}else{return db[_0x3ab2('0x28')][_0x3ab2('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3ab2('0xf')](function(_0x26b3b1){if(!_0x26b3b1){throw new db[(_0x3ab2('0x1f'))]['ValidationError'](_0x3ab2('0x2a'));}if(!_0x26b3b1[_0x3ab2('0x2b')]||!_0x26b3b1[_0x3ab2('0xe')]){throw new db['Sequelize']['ValidationError'](_0x3ab2('0x2c'));}_0x1f967a=_0x26b3b1;logger[_0x3ab2('0xa')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4fb4e1['id']));return sentiment(_0x1f967a[_0x3ab2('0x2b')],_0x1f967a[_0x3ab2('0xe')],_0x3fcc4d[_0x3ab2('0x24')],_0x48c7c1['fileText'],_0x3fcc4d[_0x3ab2('0x25')]);})[_0x3ab2('0xf')](function(_0x4fa0ce){logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')](_0x3ab2('0x2d'),_0x4fb4e1['id']));return _0x4fb4e1[_0x3ab2('0x1c')]({'sentiment':_0x4fa0ce['Sentiment'],'sPositive':_0x4fa0ce[_0x3ab2('0x2e')][_0x3ab2('0x2f')],'sNegative':_0x4fa0ce[_0x3ab2('0x2e')][_0x3ab2('0x30')],'sMixed':_0x4fa0ce[_0x3ab2('0x2e')][_0x3ab2('0x31')],'sNeutral':_0x4fa0ce['SentimentScore'][_0x3ab2('0x32')]});})[_0x3ab2('0xf')](function(){logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')](_0x3ab2('0x1d'),_0x4fb4e1['id']));_0x42d017();});case'FAILED':return _0x4fb4e1[_0x3ab2('0x1c')]({'transcribeStatus':_0x3ab2('0x33'),'failureReason':_0x5c152c['TranscriptionJob'][_0x3ab2('0x34')]})[_0x3ab2('0xf')](function(){logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')](_0x3ab2('0x1d'),_0x4fb4e1['id']));_0x42d017();});default:logger['info'](util[_0x3ab2('0xb')](_0x3ab2('0x35'),_0x4fb4e1['id']));break;}}else{return BPromise[_0x3ab2('0x36')]()[_0x3ab2('0xf')](function(){if(!_0x4fb4e1[_0x3ab2('0x1e')]){throw new db[(_0x3ab2('0x1f'))][(_0x3ab2('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3fcc4d[_0x3ab2('0x22')]||!_0x3fcc4d['sentimentAccountId']||!_0x3fcc4d[_0x3ab2('0x24')]||!_0x3fcc4d['language']||!_0x3fcc4d[_0x3ab2('0x26')]){throw new db[(_0x3ab2('0x1f'))]['ValidationError'](_0x3ab2('0x37'));}if(!_0x4fb4e1[_0x3ab2('0x1a')]){throw new Error(_0x3ab2('0x27'));}if(_0x3fcc4d[_0x3ab2('0x23')]===_0x2ec0e3['id']){return _0x2ec0e3;}else{return db[_0x3ab2('0x28')][_0x3ab2('0x29')]({'where':{'id':_settings[_0x3ab2('0x23')]}});}})[_0x3ab2('0xf')](function(_0xcb3fa3){if(!_0xcb3fa3){throw new db[(_0x3ab2('0x1f'))][(_0x3ab2('0x20'))](_0x3ab2('0x2a'));}if(!_0xcb3fa3['data1']||!_0xcb3fa3[_0x3ab2('0xe')]){throw new db[(_0x3ab2('0x1f'))][(_0x3ab2('0x20'))](_0x3ab2('0x2c'));}_0x1f967a=_0xcb3fa3;logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')](_0x3ab2('0x38'),_0x4fb4e1['id']));return sentiment(_0x1f967a['data1'],_0x1f967a[_0x3ab2('0xe')],_0x3fcc4d[_0x3ab2('0x24')],_0x4fb4e1[_0x3ab2('0x1a')],_0x3fcc4d['language']);})[_0x3ab2('0xf')](function(_0x119916){logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4fb4e1['id']));return _0x4fb4e1[_0x3ab2('0x1c')]({'sentiment':_0x119916[_0x3ab2('0x39')],'sPositive':_0x119916['SentimentScore'][_0x3ab2('0x2f')],'sNegative':_0x119916['SentimentScore'][_0x3ab2('0x30')],'sMixed':_0x119916['SentimentScore'][_0x3ab2('0x31')],'sNeutral':_0x119916[_0x3ab2('0x2e')]['Neutral'],'transcribeStatus':_0x3ab2('0x13')});})[_0x3ab2('0xf')](function(){logger[_0x3ab2('0xa')](util[_0x3ab2('0xb')](_0x3ab2('0x1d'),_0x4fb4e1['id']));_0x42d017();});}})[_0x3ab2('0x3a')](function(_0x4810d7){if(_0x4810d7){if(!_0x4810d7[_0x3ab2('0x3b')]||_0x4810d7['name']!=='SequelizeValidationError'){logger[_0x3ab2('0x3c')](util[_0x3ab2('0xb')](_0x3ab2('0x3d'),_0x4fb4e1['id']),util[_0x3ab2('0x3e')](_0x4810d7,{'showHidden':![],'depth':null}));}}_0x42d017();});});}function checkTranscribe(){var _0x28d0c9;var _0x2ff535;var _0x44ff03;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0x3ab2('0x3f')}})['then'](function(_0x2e5e02){if(!_0x2e5e02||!_0x2e5e02[_0x3ab2('0x19')]){throw new db[(_0x3ab2('0x1f'))][(_0x3ab2('0x20'))](_0x3ab2('0x40'));}_0x28d0c9=_0x2e5e02;return db[_0x3ab2('0x41')][_0x3ab2('0x29')]({'where':{'id':0x1}});})['then'](function(_0x3c316b){if(!_0x3c316b){throw new db['Sequelize'][(_0x3ab2('0x20'))](_0x3ab2('0x42'));}_0x2ff535=_0x3c316b;if(!_0x2ff535[_0x3ab2('0x6')]||!_0x2ff535[_0x3ab2('0x43')]||!_0x2ff535[_0x3ab2('0x44')]||!_0x2ff535[_0x3ab2('0x25')]||!_0x2ff535[_0x3ab2('0x26')]){throw new db[(_0x3ab2('0x1f'))][(_0x3ab2('0x20'))](_0x3ab2('0x45'));}return db[_0x3ab2('0x28')][_0x3ab2('0x29')]({'where':{'id':_0x2ff535[_0x3ab2('0x43')]}});})['then'](function(_0x1a6e71){if(!_0x1a6e71){throw new db['Sequelize'][(_0x3ab2('0x20'))](_0x3ab2('0x2a'));}if(!_0x1a6e71['data1']||!_0x1a6e71[_0x3ab2('0xe')]){throw new db[(_0x3ab2('0x1f'))]['ValidationError'](_0x3ab2('0x2c'));}_0x44ff03=_0x1a6e71;var _0x44f8d2=[];_0x28d0c9[_0x3ab2('0x46')](function(_0x36ed18){_0x44f8d2[_0x3ab2('0x47')](checkTranscribeJob(_0x36ed18,_0x2ff535,_0x44ff03));});return BPromise[_0x3ab2('0x48')](_0x44f8d2);})[_0x3ab2('0x3a')](function(_0x1afab3){if(_0x1afab3){if(!_0x1afab3[_0x3ab2('0x3b')]||_0x1afab3[_0x3ab2('0x3b')]!==_0x3ab2('0x49')){logger[_0x3ab2('0x3c')](util[_0x3ab2('0x3e')](_0x1afab3,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 5cc8b02..5519e71 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 _0x50b8=['../logger','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','join','update','system','timeout','format','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','start','lodash','moment','ioredis','util'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x50b8,0x9d));var _0x850b=function(_0x57ab5b,_0x4c535a){_0x57ab5b=_0x57ab5b-0x0;var _0x3191be=_0x50b8[_0x57ab5b];return _0x3191be;};'use strict';var _=require(_0x850b('0x0'));var moment=require(_0x850b('0x1'));var Redis=require(_0x850b('0x2'));var util=require(_0x850b('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x850b('0x4'))('schedule');config[_0x850b('0x5')]=_[_0x850b('0x6')](config['redis'],{'host':_0x850b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x4c2884=[];return db[_0x850b('0x8')][_0x850b('0x9')]({'raw':!![],'attributes':['id',_0x850b('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x850b('0xb')](0x18,'hours')}}})[_0x850b('0xc')](function(_0xc25315){if(_0xc25315&&_0xc25315['length']){_0x4c2884=_['map'](_0xc25315||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4c2884[_0x850b('0xd')]());return db['WhatsappInteraction'][_0x850b('0xe')]({'closeReason':_0x850b('0xf'),'disposition':_0x850b('0x10'),'closed':!![],'closedAt':moment()[_0x850b('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4c2884}});}})[_0x850b('0xc')](function(){if(_0x4c2884&&_0x4c2884[_0x850b('0x12')]){logger['info'](_0x850b('0x13'),_0x4c2884['join']());for(var _0x500269=0x0;_0x500269<_0x4c2884[_0x850b('0x12')];_0x500269++){io[_0x850b('0x14')](_0x850b('0x15'),{'id':_0x4c2884[_0x500269],'closed':!![]});}}})['catch'](function(_0x4deef6){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4deef6?util['inspect'](_0x4deef6,{'showHidden':![],'depth':null}):'');});}exports[_0x850b('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x16f2=['start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','map','info','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect'];(function(_0x399814,_0x5066c7){var _0x1e3449=function(_0x2b6e11){while(--_0x2b6e11){_0x399814['push'](_0x399814['shift']());}};_0x1e3449(++_0x5066c7);}(_0x16f2,0x187));var _0x216f=function(_0x5d3f51,_0x3025b6){_0x5d3f51=_0x5d3f51-0x0;var _0x24bcdb=_0x16f2[_0x5d3f51];return _0x24bcdb;};'use strict';var _=require(_0x216f('0x0'));var moment=require(_0x216f('0x1'));var Redis=require(_0x216f('0x2'));var util=require(_0x216f('0x3'));var config=require(_0x216f('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x216f('0x5'))(_0x216f('0x6'));config[_0x216f('0x7')]=_[_0x216f('0x8')](config[_0x216f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x216f('0x9'))(new Redis(config[_0x216f('0x7')]));function closeInteractions(){var _0x327caf=[];return db[_0x216f('0xa')][_0x216f('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x216f('0xc')](0x18,_0x216f('0xd'))}}})[_0x216f('0xe')](function(_0x146661){if(_0x146661&&_0x146661['length']){_0x327caf=_[_0x216f('0xf')](_0x146661||[],'id');logger[_0x216f('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x327caf[_0x216f('0x11')]());return db[_0x216f('0xa')][_0x216f('0x12')]({'closeReason':_0x216f('0x13'),'disposition':_0x216f('0x14'),'closed':!![],'closedAt':moment()['format'](_0x216f('0x15'))},{'where':{'id':_0x327caf}});}})['then'](function(){if(_0x327caf&&_0x327caf[_0x216f('0x16')]){logger[_0x216f('0x10')](_0x216f('0x17'),_0x327caf[_0x216f('0x11')]());for(var _0x5155e1=0x0;_0x5155e1<_0x327caf['length'];_0x5155e1++){io[_0x216f('0x18')](_0x216f('0x19'),{'id':_0x327caf[_0x5155e1],'closed':!![]});}}})[_0x216f('0x1a')](function(_0x11f673){logger[_0x216f('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x11f673?util[_0x216f('0x1c')](_0x11f673,{'showHidden':![],'depth':null}):'');});}exports[_0x216f('0x1d')]=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 c5e1ac9..4f29381 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa408=['contacts1','CmHopper','log','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','destroy','then','CmContact','bulkCreate','finished\x20populating'];(function(_0x54a279,_0x5cebfd){var _0x28d5a6=function(_0x262159){while(--_0x262159){_0x54a279['push'](_0x54a279['shift']());}};_0x28d5a6(++_0x5cebfd);}(_0xa408,0x1e2));var _0x8a40=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xa408[_0x571c1d];return _0x33c609;};'use strict';var util=require('util');var db=require(_0x8a40('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8a40('0x1')]({'id':i,'firstName':_0x8a40('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x8a40('0x3')+i+_0x8a40('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x8a40('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8a40('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x8a40('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x8a40('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x8a40('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x8a40('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8a40('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8a40('0x5')](),'updatedAt':Date[_0x8a40('0x5')]()});}db['CmContact'][_0x8a40('0x6')]({'where':{}})[_0x8a40('0x7')](function(){return db[_0x8a40('0x8')][_0x8a40('0x9')](contacts);})[_0x8a40('0x7')](function(){console['log'](_0x8a40('0xa'),_0x8a40('0xb'));return db['CmHopper'][_0x8a40('0x6')]({'where':{}});})[_0x8a40('0x7')](function(){return db[_0x8a40('0xc')]['bulkCreate'](hopper);})[_0x8a40('0x7')](function(){console[_0x8a40('0xd')](_0x8a40('0xa'),'hopper1');return db[_0x8a40('0x8')][_0x8a40('0x9')](contacts2);})[_0x8a40('0x7')](function(){console[_0x8a40('0xd')](_0x8a40('0xa'),_0x8a40('0xe'));return db[_0x8a40('0xc')][_0x8a40('0x9')](hopper2);})[_0x8a40('0x7')](function(){console[_0x8a40('0xd')]('finished\x20populating',_0x8a40('0xf'));})[_0x8a40('0x10')](function(_0x1d1b68){console[_0x8a40('0xd')](_0x1d1b68);}); \ No newline at end of file +var _0x930a=['finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','CmContact','log','catch','util','../mysqldb','Innocenzo','innocenzo.biondo','@xcally.com','push','now','Biondo','then'];(function(_0x582628,_0x3a5c5d){var _0x2e7432=function(_0x52c566){while(--_0x52c566){_0x582628['push'](_0x582628['shift']());}};_0x2e7432(++_0x3a5c5d);}(_0x930a,0xa1));var _0xa930=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x930a[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xa930('0x0'));var db=require(_0xa930('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xa930('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xa930('0x3')+i+_0xa930('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa930('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xa930('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa930('0x6')](),'updatedAt':Date[_0xa930('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa930('0x5')]({'id':i,'firstName':_0xa930('0x2')+i,'lastName':_0xa930('0x7')+i,'phone':0xf879fb460+i,'email':_0xa930('0x3')+i+_0xa930('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xa930('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xa930('0x6')]()});}db['CmContact']['destroy']({'where':{}})[_0xa930('0x8')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0xa930('0x8')](function(){console['log'](_0xa930('0x9'),_0xa930('0xa'));return db[_0xa930('0xb')][_0xa930('0xc')]({'where':{}});})[_0xa930('0x8')](function(){return db[_0xa930('0xb')][_0xa930('0xd')](hopper);})[_0xa930('0x8')](function(){console['log'](_0xa930('0x9'),'hopper1');return db[_0xa930('0xe')][_0xa930('0xd')](contacts2);})[_0xa930('0x8')](function(){console['log'](_0xa930('0x9'),'contacts2');return db[_0xa930('0xb')][_0xa930('0xd')](hopper2);})[_0xa930('0x8')](function(){console[_0xa930('0xf')](_0xa930('0x9'),'hopper2');})[_0xa930('0x10')](function(_0x43ba43){console[_0xa930('0xf')](_0x43ba43);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 29cf7f7..5247a59 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1af4=['udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x2dc024,_0x97f547){var _0x44b423=function(_0x2889a2){while(--_0x2889a2){_0x2dc024['push'](_0x2dc024['shift']());}};_0x44b423(++_0x97f547);}(_0x1af4,0x1ac));var _0x41af=function(_0x2c3afe,_0x331870){_0x2c3afe=_0x2c3afe-0x0;var _0x28cd44=_0x1af4[_0x2c3afe];return _0x28cd44;};'use strict';var util=require(_0x41af('0x0'));var db=require(_0x41af('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x41af('0x2')]({'name':util[_0x41af('0x3')](_0x41af('0x4'),_0x41af('0x5'),i),'fullname':util[_0x41af('0x3')](_0x41af('0x4'),'agent',i),'email':util[_0x41af('0x3')](_0x41af('0x6'),'agent',i),'role':'agent','password':_0x41af('0x7'),'internal':0xfa0+i,'type':_0x41af('0x8'),'transport':[_0x41af('0x9'),'ws',_0x41af('0xa')],'disallow':[_0x41af('0xb')],'allow':[_0x41af('0xc')],'defaultuser':util['format'](_0x41af('0x4'),_0x41af('0x5'),i),'encryption':_0x41af('0xd'),'avpf':'yes','force_avp':_0x41af('0xd'),'icesupport':_0x41af('0xd'),'dtlsenable':_0x41af('0xd'),'dtlsverify':'no','dtlscertfile':_0x41af('0xe'),'dtlsprivatekey':_0x41af('0xf'),'dtlssetup':_0x41af('0x10'),'callerid':util['format'](_0x41af('0x11'),util['format']('%s%s',_0x41af('0x5'),i),0xfa0+i)});}db[_0x41af('0x12')][_0x41af('0x13')](users)[_0x41af('0x14')](function(){console[_0x41af('0x15')]('add\x20user');})[_0x41af('0x16')](function(_0x450950){console['log'](_0x450950);}); \ No newline at end of file +var _0xa572=['udp','wss','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa572,0x1ec));var _0x2a57=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0xa572[_0x179e11];return _0x549f04;};'use strict';var util=require(_0x2a57('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x2a57('0x1')]({'name':util[_0x2a57('0x2')](_0x2a57('0x3'),_0x2a57('0x4'),i),'fullname':util['format'](_0x2a57('0x3'),_0x2a57('0x4'),i),'email':util['format'](_0x2a57('0x5'),'agent',i),'role':_0x2a57('0x4'),'password':_0x2a57('0x6'),'internal':0xfa0+i,'type':_0x2a57('0x7'),'transport':[_0x2a57('0x8'),'ws',_0x2a57('0x9')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x2a57('0x2')](_0x2a57('0x3'),_0x2a57('0x4'),i),'encryption':_0x2a57('0xa'),'avpf':'yes','force_avp':'yes','icesupport':_0x2a57('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x2a57('0xb'),'dtlssetup':_0x2a57('0xc'),'callerid':util[_0x2a57('0x2')](_0x2a57('0xd'),util[_0x2a57('0x2')](_0x2a57('0x3'),_0x2a57('0x4'),i),0xfa0+i)});}db[_0x2a57('0xe')][_0x2a57('0xf')](users)[_0x2a57('0x10')](function(){console[_0x2a57('0x11')](_0x2a57('0x12'));})[_0x2a57('0x13')](function(_0xae4485){console[_0x2a57('0x11')](_0xae4485);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 32681be..e1ffb7e 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8374=['getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','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','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','connectedAt','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','FaxQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','format','%s:queue:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','SmsQueue','WhatsappQueue','user','VoiceQueues','ChatQueues','SmsQueues','MailQueue','OpenchannelQueue','WhatsappQueues','Telephones','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues'];(function(_0x5d951f,_0x4b2216){var _0x3e448b=function(_0x33cc33){while(--_0x33cc33){_0x5d951f['push'](_0x5d951f['shift']());}};_0x3e448b(++_0x4b2216);}(_0x8374,0x174));var _0x4837=function(_0x4e89e9,_0x2c9c84){_0x4e89e9=_0x4e89e9-0x0;var _0x1107d3=_0x8374[_0x4e89e9];return _0x1107d3;};'use strict';var _=require(_0x4837('0x0'));var util=require(_0x4837('0x1'));var BPromise=require(_0x4837('0x2'));var db=require(_0x4837('0x3'))['db'];var config=require(_0x4837('0x4'));var queryQueues={'attributes':['id',_0x4837('0x5')],'include':[{'as':_0x4837('0x6'),'model':db[_0x4837('0x7')],'attributes':['id',_0x4837('0x5'),_0x4837('0x8')],'raw':!![],'where':{'role':_0x4837('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4837('0x5')],'where':{'role':_0x4837('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4837('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x4837('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x4837('0xb')],'where':{'type':_0x4837('0xc')}};function getAssociatedResources(_0x2046c1,_0x33c069,_0x2f0ca6){return db[_0x4837('0xd')][_0x4837('0xe')]({'where':{'name':_0x2046c1,'userProfileId':_0x33c069},'raw':!![]})[_0x4837('0xf')](function(_0x37f017){if(_0x37f017){if(_0x37f017[_0x4837('0x10')]){switch(_0x2046c1){case'VoiceQueues':case'ChatQueues':case _0x4837('0x11'):case'SmsQueues':case _0x4837('0x12'):case _0x4837('0x13'):case'WhatsappQueues':return db[_0x2f0ca6]['findAll'](queryQueues);case'Telephones':return db[_0x2f0ca6][_0x4837('0x14')](queryTelephones);case _0x4837('0x15'):return db[_0x2f0ca6][_0x4837('0x14')](queryTrunks);case _0x4837('0x16'):return db[_0x2f0ca6]['findAll'](queryCampaigns);}}else{return db[_0x4837('0x17')][_0x4837('0x14')]({'attributes':[_0x4837('0x18')],'where':{'sectionId':_0x37f017['id']},'raw':!![]})['then'](function(_0x1685ee){if(_0x1685ee){var _0xae4f01={'where':{'id':_['map'](_0x1685ee,_0x4837('0x18'))},'raw':!![]};switch(_0x2f0ca6){case _0x4837('0x7'):_0xae4f01[_0x4837('0x19')][_0x4837('0x8')]=_0x4837('0xa');break;case _0x4837('0x1a'):_0xae4f01['where'][_0x4837('0xb')]=_0x4837('0xc');break;}return db[_0x2f0ca6][_0x4837('0x14')](_0xae4f01);}else{return[];}});}}else{return[];}})[_0x4837('0xf')](function(_0x41f86c){return _0x41f86c;});}function joinOrLeaveQueues(_0x2c1ddf,_0x3af7e0,_0x4b482d,_0x567468){_0x2c1ddf[_0x3af7e0](util[_0x4837('0x1b')](_0x4837('0x1c'),_0x4b482d,_0x567468[_0x4837('0x5')]));if(_0x567468[_0x4837('0x6')]){for(var _0x5e8f16=0x0;_0x5e8f16<_0x567468[_0x4837('0x6')]['length'];_0x5e8f16+=0x1){_0x2c1ddf[_0x3af7e0](util[_0x4837('0x1b')]('user:%s',_0x567468['Agents'][_0x5e8f16][_0x4837('0x5')]));}}}function joinOrLeave(_0x487c6b,_0x4988f5,_0x57d48a){var _0x40bebd;if(_0x487c6b[_0x4837('0x1d')]['query']['id']){db[_0x4837('0x7')][_0x4837('0x1e')]({'attributes':['id','name',_0x4837('0x8'),_0x4837('0x1f')],'where':{'id':_0x487c6b['handshake'][_0x4837('0x20')]['id']},'include':[{'model':db[_0x4837('0x21')],'as':_0x4837('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x4837('0x23')],'as':_0x4837('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x4837('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4837('0x26')],'as':_0x4837('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x4837('0x28')],'as':_0x4837('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x4837('0x2a')],'as':_0x4837('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x4837('0xf')](function(_0x55f82b){if(_0x55f82b){_0x40bebd=_0x55f82b;_0x487c6b[_0x4988f5](util[_0x4837('0x1b')](_0x4837('0x2c'),_0x55f82b[_0x4837('0x5')]));var _0x2da6bf=[];switch(_0x55f82b[_0x4837('0x8')]){case _0x4837('0x2d'):_0x487c6b[_0x4988f5](_0x4837('0x2e'));_0x487c6b[_0x4988f5](_0x4837('0x2f'));if(queryQueues[_0x4837('0x30')]('include')){delete queryQueues[_0x4837('0x31')];}_0x2da6bf['push'](db[_0x4837('0x32')]['findAll'](queryQueues));_0x2da6bf[_0x4837('0x33')](db[_0x4837('0x34')][_0x4837('0x14')](queryQueues));_0x2da6bf['push'](db['FaxQueue'][_0x4837('0x14')](queryQueues));_0x2da6bf[_0x4837('0x33')](db[_0x4837('0x35')][_0x4837('0x14')](queryQueues));_0x2da6bf[_0x4837('0x33')](db['MailQueue'][_0x4837('0x14')](queryQueues));_0x2da6bf[_0x4837('0x33')](db['OpenchannelQueue'][_0x4837('0x14')](queryQueues));_0x2da6bf['push'](db[_0x4837('0x36')]['findAll'](queryQueues));_0x2da6bf['push'](db[_0x4837('0x7')][_0x4837('0x14')](queryTelephones));_0x2da6bf[_0x4837('0x33')](db['Trunk'][_0x4837('0x14')](queryTrunks));_0x2da6bf[_0x4837('0x33')](db['Campaign'][_0x4837('0x14')](queryCampaigns));_0x2da6bf['push'](db[_0x4837('0x7')][_0x4837('0x14')](queryAgents));break;case _0x4837('0x37'):_0x487c6b[_0x4988f5](_0x4837('0x2e'));_0x487c6b[_0x4988f5]('voice:outbound');_0x2da6bf[_0x4837('0x33')](getAssociatedResources(_0x4837('0x38'),_0x55f82b[_0x4837('0x1f')],_0x4837('0x32')));_0x2da6bf[_0x4837('0x33')](getAssociatedResources(_0x4837('0x39'),_0x55f82b['userProfileId'],_0x4837('0x34')));_0x2da6bf['push'](getAssociatedResources(_0x4837('0x11'),_0x55f82b[_0x4837('0x1f')],'FaxQueue'));_0x2da6bf['push'](getAssociatedResources(_0x4837('0x3a'),_0x55f82b[_0x4837('0x1f')],_0x4837('0x35')));_0x2da6bf[_0x4837('0x33')](getAssociatedResources(_0x4837('0x12'),_0x55f82b[_0x4837('0x1f')],_0x4837('0x3b')));_0x2da6bf[_0x4837('0x33')](getAssociatedResources(_0x4837('0x13'),_0x55f82b[_0x4837('0x1f')],_0x4837('0x3c')));_0x2da6bf[_0x4837('0x33')](getAssociatedResources(_0x4837('0x3d'),_0x55f82b[_0x4837('0x1f')],'WhatsappQueue'));_0x2da6bf['push'](getAssociatedResources(_0x4837('0x3e'),_0x55f82b[_0x4837('0x1f')],_0x4837('0x7')));_0x2da6bf[_0x4837('0x33')](getAssociatedResources('Trunks',_0x55f82b['userProfileId'],_0x4837('0x3f')));_0x2da6bf['push'](getAssociatedResources('IvrCampaigns',_0x55f82b[_0x4837('0x1f')],_0x4837('0x1a')));_0x2da6bf[_0x4837('0x33')](db['User'][_0x4837('0x14')](queryAgents));break;case _0x4837('0x9'):_0x487c6b[_0x4988f5]('voice:inbound');_0x487c6b[_0x4988f5](_0x4837('0x2f'));_0x2da6bf[_0x4837('0x33')](_0x55f82b[_0x4837('0x40')]({'attributes':['id',_0x4837('0x5')]}));_0x2da6bf[_0x4837('0x33')](_0x55f82b[_0x4837('0x41')]({'attributes':['id',_0x4837('0x5')]}));_0x2da6bf[_0x4837('0x33')](_0x55f82b[_0x4837('0x42')]({'attributes':['id',_0x4837('0x5')]}));_0x2da6bf[_0x4837('0x33')](_0x55f82b[_0x4837('0x43')]({'attributes':['id',_0x4837('0x5')]}));_0x2da6bf[_0x4837('0x33')](_0x55f82b[_0x4837('0x44')]({'attributes':['id','name']}));_0x2da6bf[_0x4837('0x33')](_0x55f82b[_0x4837('0x45')]({'attributes':['id',_0x4837('0x5')]}));_0x2da6bf[_0x4837('0x33')](_0x55f82b['getWhatsappQueues']({'attributes':['id',_0x4837('0x5')]}));break;}return BPromise[_0x4837('0x46')](_0x2da6bf);}})['then'](function(_0x4f5f13){if(_0x4f5f13&&_0x4f5f13[_0x4837('0x47')]){for(var _0x2959e8=0x0;_0x2959e8<_0x4f5f13[_0x4837('0x47')];_0x2959e8+=0x1){for(var _0x4e2155=0x0;_0x4e2155<_0x4f5f13[_0x2959e8][_0x4837('0x47')];_0x4e2155+=0x1){switch(_0x2959e8){case 0x0:joinOrLeaveQueues(_0x487c6b,_0x4988f5,_0x4837('0x48'),_0x4f5f13[_0x2959e8][_0x4e2155]);break;case 0x1:joinOrLeaveQueues(_0x487c6b,_0x4988f5,_0x4837('0x49'),_0x4f5f13[_0x2959e8][_0x4e2155]);break;case 0x2:joinOrLeaveQueues(_0x487c6b,_0x4988f5,_0x4837('0x4a'),_0x4f5f13[_0x2959e8][_0x4e2155]);break;case 0x3:joinOrLeaveQueues(_0x487c6b,_0x4988f5,_0x4837('0x4b'),_0x4f5f13[_0x2959e8][_0x4e2155]);break;case 0x4:joinOrLeaveQueues(_0x487c6b,_0x4988f5,_0x4837('0x4c'),_0x4f5f13[_0x2959e8][_0x4e2155]);break;case 0x5:joinOrLeaveQueues(_0x487c6b,_0x4988f5,_0x4837('0x4d'),_0x4f5f13[_0x2959e8][_0x4e2155]);break;case 0x6:joinOrLeaveQueues(_0x487c6b,_0x4988f5,_0x4837('0x4e'),_0x4f5f13[_0x2959e8][_0x4e2155]);break;case 0x7:if(_0x40bebd[_0x4837('0x8')]!=='agent')_0x487c6b[_0x4988f5](util['format'](_0x4837('0x4f'),_0x4f5f13[_0x2959e8][_0x4e2155]['name']));break;case 0x8:if(_0x40bebd[_0x4837('0x8')]!==_0x4837('0x9'))_0x487c6b[_0x4988f5](util[_0x4837('0x1b')](_0x4837('0x50'),_0x4f5f13[_0x2959e8][_0x4e2155][_0x4837('0x5')]));break;case 0x9:if(_0x40bebd[_0x4837('0x8')]!=='agent')_0x487c6b[_0x4988f5](util[_0x4837('0x1b')](_0x4837('0x51'),_0x4f5f13[_0x2959e8][_0x4e2155][_0x4837('0xb')],_0x4f5f13[_0x2959e8][_0x4e2155][_0x4837('0x5')]));break;case 0xa:_0x487c6b[_0x4988f5](util['format'](_0x4837('0x2c'),_0x4f5f13[_0x2959e8][_0x4e2155][_0x4837('0x5')]));break;}}}}})[_0x4837('0xf')](function(){if(_0x4988f5===_0x4837('0x52')){var _0x1dcc10=_[_0x4837('0x53')](_0x40bebd['ChatInteractions'],'id');return _0x40bebd[_0x4837('0x54')](_0x1dcc10)[_0x4837('0xf')](function(){for(var _0x575b34=0x0;_0x575b34<_0x1dcc10[_0x4837('0x47')];_0x575b34+=0x1){_0x57d48a[_0x4837('0x55')](_0x4837('0x56'),{'ChatInteractionId':Number(_0x1dcc10[_0x575b34]),'UserId':Number(_0x40bebd['id'])});}});}})[_0x4837('0xf')](function(){if(_0x4988f5==='leave'){var _0x3f9f9c=_[_0x4837('0x53')](_0x40bebd[_0x4837('0x24')],'id');return _0x40bebd[_0x4837('0x57')](_0x3f9f9c)[_0x4837('0xf')](function(){for(var _0x1466ff=0x0;_0x1466ff<_0x3f9f9c[_0x4837('0x47')];_0x1466ff+=0x1){_0x57d48a['emit'](_0x4837('0x58'),{'MailInteractionId':Number(_0x3f9f9c[_0x1466ff]),'UserId':Number(_0x40bebd['id'])});}});}})[_0x4837('0xf')](function(){if(_0x4988f5===_0x4837('0x52')){var _0x2bc50d=_[_0x4837('0x53')](_0x40bebd[_0x4837('0x25')],'id');return _0x40bebd[_0x4837('0x59')](_0x2bc50d)['then'](function(){for(var _0x44595a=0x0;_0x44595a<_0x2bc50d[_0x4837('0x47')];_0x44595a+=0x1){_0x57d48a[_0x4837('0x55')](_0x4837('0x5a'),{'FaxInteractionId':Number(_0x2bc50d[_0x44595a]),'UserId':Number(_0x40bebd['id'])});}});}})[_0x4837('0xf')](function(){if(_0x4988f5===_0x4837('0x52')){var _0x25f3e0=_[_0x4837('0x53')](_0x40bebd[_0x4837('0x27')],'id');return _0x40bebd[_0x4837('0x5b')](_0x25f3e0)[_0x4837('0xf')](function(){for(var _0x27ab33=0x0;_0x27ab33<_0x25f3e0[_0x4837('0x47')];_0x27ab33+=0x1){_0x57d48a[_0x4837('0x55')](_0x4837('0x5c'),{'SmsInteractionId':Number(_0x25f3e0[_0x27ab33]),'UserId':Number(_0x40bebd['id'])});}});}})[_0x4837('0xf')](function(){if(_0x4988f5==='leave'){var _0x43cff0=_[_0x4837('0x53')](_0x40bebd[_0x4837('0x29')],'id');return _0x40bebd['removeOpenchannelInteractions'](_0x43cff0)[_0x4837('0xf')](function(){for(var _0x39d564=0x0;_0x39d564<_0x43cff0['length'];_0x39d564+=0x1){_0x57d48a[_0x4837('0x55')](_0x4837('0x5d'),{'OpenchannelInteractionId':Number(_0x43cff0[_0x39d564]),'UserId':Number(_0x40bebd['id'])});}});}})['then'](function(){if(_0x4988f5===_0x4837('0x52')){var _0x27809e=_['map'](_0x40bebd[_0x4837('0x2b')],'id');return _0x40bebd[_0x4837('0x5e')](_0x27809e)[_0x4837('0xf')](function(){for(var _0x37df91=0x0;_0x37df91<_0x27809e[_0x4837('0x47')];_0x37df91+=0x1){_0x57d48a['emit'](_0x4837('0x5f'),{'WhatsappInteractionId':Number(_0x27809e[_0x37df91]),'UserId':Number(_0x40bebd['id'])});}});}})[_0x4837('0x60')](function(_0x1dff60){_0x487c6b[_0x4837('0x61')](_0x1dff60);});}}function onDisconnect(_0x1bbea9,_0x191f27){joinOrLeave(_0x1bbea9,_0x4837('0x52'),_0x191f27);}function onConnect(_0x1af04f){joinOrLeave(_0x1af04f,_0x4837('0x62'));}exports[_0x4837('0x63')]=function(_0x413c5a){_0x413c5a['on'](_0x4837('0x64'),function(_0x138f7b){_0x138f7b[_0x4837('0x65')](0x0);_0x138f7b['address']=_0x138f7b[_0x4837('0x66')][_0x4837('0x64')][_0x4837('0x67')]+':'+_0x138f7b[_0x4837('0x66')][_0x4837('0x64')]['remotePort'];_0x138f7b[_0x4837('0x68')]=new Date();_0x138f7b[_0x4837('0x61')]=function(_0x14baac){console[_0x4837('0x61')]('SocketIO\x20'+_0x138f7b[_0x4837('0x69')]['name']+'['+_0x138f7b[_0x4837('0x6a')]+']',_0x14baac);};_0x138f7b['on'](_0x4837('0x6b'),function(){onDisconnect(_0x138f7b,_0x413c5a);_0x138f7b[_0x4837('0x61')](_0x4837('0x6c'));});onConnect(_0x138f7b);_0x138f7b[_0x4837('0x61')](_0x4837('0x6d'));});}; \ No newline at end of file +var _0x9de5=['lodash','util','bluebird','../mysqldb','./environment','name','Agents','role','type','ivr','findOne','autoAssociation','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','User','where','telephone','Campaign','%s:queue:%s','length','format','handshake','query','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','WhatsappInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','VoiceQueue','push','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','user','VoiceQueues','SmsQueues','SmsQueue','agent','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','whatsapp','trunk:%s','leave','emit','removeMailInteractions','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED'];(function(_0x15bf76,_0x212130){var _0x5a9265=function(_0x1e3127){while(--_0x1e3127){_0x15bf76['push'](_0x15bf76['shift']());}};_0x5a9265(++_0x212130);}(_0x9de5,0xbc));var _0x59de=function(_0x3c5c93,_0x2a826f){_0x3c5c93=_0x3c5c93-0x0;var _0x146fd8=_0x9de5[_0x3c5c93];return _0x146fd8;};'use strict';var _=require(_0x59de('0x0'));var util=require(_0x59de('0x1'));var BPromise=require(_0x59de('0x2'));var db=require(_0x59de('0x3'))['db'];var config=require(_0x59de('0x4'));var queryQueues={'attributes':['id',_0x59de('0x5')],'include':[{'as':_0x59de('0x6'),'model':db['User'],'attributes':['id','name',_0x59de('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x59de('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x59de('0x5'),_0x59de('0x8')],'where':{'type':_0x59de('0x9')}};function getAssociatedResources(_0xc925d0,_0xda6e4e,_0x24d672){return db['UserProfileSection'][_0x59de('0xa')]({'where':{'name':_0xc925d0,'userProfileId':_0xda6e4e},'raw':!![]})['then'](function(_0x54bb12){if(_0x54bb12){if(_0x54bb12[_0x59de('0xb')]){switch(_0xc925d0){case'VoiceQueues':case _0x59de('0xc'):case _0x59de('0xd'):case'SmsQueues':case _0x59de('0xe'):case _0x59de('0xf'):case _0x59de('0x10'):return db[_0x24d672][_0x59de('0x11')](queryQueues);case _0x59de('0x12'):return db[_0x24d672][_0x59de('0x11')](queryTelephones);case _0x59de('0x13'):return db[_0x24d672][_0x59de('0x11')](queryTrunks);case _0x59de('0x14'):return db[_0x24d672][_0x59de('0x11')](queryCampaigns);}}else{return db[_0x59de('0x15')]['findAll']({'attributes':[_0x59de('0x16')],'where':{'sectionId':_0x54bb12['id']},'raw':!![]})[_0x59de('0x17')](function(_0x57f30f){if(_0x57f30f){var _0x570d8b={'where':{'id':_[_0x59de('0x18')](_0x57f30f,_0x59de('0x16'))},'raw':!![]};switch(_0x24d672){case _0x59de('0x19'):_0x570d8b[_0x59de('0x1a')][_0x59de('0x7')]=_0x59de('0x1b');break;case _0x59de('0x1c'):_0x570d8b[_0x59de('0x1a')]['type']='ivr';break;}return db[_0x24d672]['findAll'](_0x570d8b);}else{return[];}});}}else{return[];}})[_0x59de('0x17')](function(_0x39699f){return _0x39699f;});}function joinOrLeaveQueues(_0xc267c,_0x56ba6a,_0x32e837,_0x3622a7){_0xc267c[_0x56ba6a](util['format'](_0x59de('0x1d'),_0x32e837,_0x3622a7[_0x59de('0x5')]));if(_0x3622a7['Agents']){for(var _0x41a740=0x0;_0x41a740<_0x3622a7['Agents'][_0x59de('0x1e')];_0x41a740+=0x1){_0xc267c[_0x56ba6a](util[_0x59de('0x1f')]('user:%s',_0x3622a7[_0x59de('0x6')][_0x41a740][_0x59de('0x5')]));}}}function joinOrLeave(_0x140115,_0x3dbe4a,_0x5b10bd){var _0x2c22aa;if(_0x140115[_0x59de('0x20')][_0x59de('0x21')]['id']){db[_0x59de('0x19')]['find']({'attributes':['id',_0x59de('0x5'),'role',_0x59de('0x22')],'where':{'id':_0x140115[_0x59de('0x20')][_0x59de('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x59de('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x59de('0x24')],'as':_0x59de('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x59de('0x26')],'as':_0x59de('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x59de('0x28')],'as':_0x59de('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x59de('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x59de('0x17')](function(_0x5483da){if(_0x5483da){_0x2c22aa=_0x5483da;_0x140115[_0x3dbe4a](util[_0x59de('0x1f')](_0x59de('0x2b'),_0x5483da[_0x59de('0x5')]));var _0x2e5a03=[];switch(_0x5483da[_0x59de('0x7')]){case'admin':_0x140115[_0x3dbe4a](_0x59de('0x2c'));_0x140115[_0x3dbe4a](_0x59de('0x2d'));if(queryQueues[_0x59de('0x2e')]('include')){delete queryQueues['include'];}_0x2e5a03['push'](db[_0x59de('0x2f')][_0x59de('0x11')](queryQueues));_0x2e5a03[_0x59de('0x30')](db[_0x59de('0x31')][_0x59de('0x11')](queryQueues));_0x2e5a03['push'](db[_0x59de('0x32')]['findAll'](queryQueues));_0x2e5a03[_0x59de('0x30')](db['SmsQueue'][_0x59de('0x11')](queryQueues));_0x2e5a03[_0x59de('0x30')](db['MailQueue']['findAll'](queryQueues));_0x2e5a03[_0x59de('0x30')](db[_0x59de('0x33')][_0x59de('0x11')](queryQueues));_0x2e5a03[_0x59de('0x30')](db[_0x59de('0x34')][_0x59de('0x11')](queryQueues));_0x2e5a03[_0x59de('0x30')](db[_0x59de('0x19')][_0x59de('0x11')](queryTelephones));_0x2e5a03['push'](db['Trunk'][_0x59de('0x11')](queryTrunks));_0x2e5a03[_0x59de('0x30')](db[_0x59de('0x1c')][_0x59de('0x11')](queryCampaigns));_0x2e5a03['push'](db['User'][_0x59de('0x11')](queryAgents));break;case _0x59de('0x35'):_0x140115[_0x3dbe4a]('voice:inbound');_0x140115[_0x3dbe4a](_0x59de('0x2d'));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0x36'),_0x5483da['userProfileId'],_0x59de('0x2f')));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0xc'),_0x5483da[_0x59de('0x22')],'ChatQueue'));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0xd'),_0x5483da['userProfileId'],'FaxQueue'));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0x37'),_0x5483da['userProfileId'],_0x59de('0x38')));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0xe'),_0x5483da[_0x59de('0x22')],'MailQueue'));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0xf'),_0x5483da[_0x59de('0x22')],'OpenchannelQueue'));_0x2e5a03[_0x59de('0x30')](getAssociatedResources('WhatsappQueues',_0x5483da['userProfileId'],_0x59de('0x34')));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0x12'),_0x5483da['userProfileId'],_0x59de('0x19')));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0x13'),_0x5483da[_0x59de('0x22')],'Trunk'));_0x2e5a03[_0x59de('0x30')](getAssociatedResources(_0x59de('0x14'),_0x5483da[_0x59de('0x22')],_0x59de('0x1c')));_0x2e5a03[_0x59de('0x30')](db[_0x59de('0x19')][_0x59de('0x11')](queryAgents));break;case _0x59de('0x39'):_0x140115[_0x3dbe4a](_0x59de('0x2c'));_0x140115[_0x3dbe4a](_0x59de('0x2d'));_0x2e5a03[_0x59de('0x30')](_0x5483da[_0x59de('0x3a')]({'attributes':['id',_0x59de('0x5')]}));_0x2e5a03['push'](_0x5483da[_0x59de('0x3b')]({'attributes':['id',_0x59de('0x5')]}));_0x2e5a03[_0x59de('0x30')](_0x5483da[_0x59de('0x3c')]({'attributes':['id','name']}));_0x2e5a03[_0x59de('0x30')](_0x5483da['getSmsQueues']({'attributes':['id','name']}));_0x2e5a03[_0x59de('0x30')](_0x5483da[_0x59de('0x3d')]({'attributes':['id',_0x59de('0x5')]}));_0x2e5a03[_0x59de('0x30')](_0x5483da[_0x59de('0x3e')]({'attributes':['id',_0x59de('0x5')]}));_0x2e5a03['push'](_0x5483da[_0x59de('0x3f')]({'attributes':['id',_0x59de('0x5')]}));break;}return BPromise[_0x59de('0x40')](_0x2e5a03);}})['then'](function(_0x248e61){if(_0x248e61&&_0x248e61[_0x59de('0x1e')]){for(var _0x3247bb=0x0;_0x3247bb<_0x248e61[_0x59de('0x1e')];_0x3247bb+=0x1){for(var _0xcdd740=0x0;_0xcdd740<_0x248e61[_0x3247bb][_0x59de('0x1e')];_0xcdd740+=0x1){switch(_0x3247bb){case 0x0:joinOrLeaveQueues(_0x140115,_0x3dbe4a,_0x59de('0x41'),_0x248e61[_0x3247bb][_0xcdd740]);break;case 0x1:joinOrLeaveQueues(_0x140115,_0x3dbe4a,_0x59de('0x42'),_0x248e61[_0x3247bb][_0xcdd740]);break;case 0x2:joinOrLeaveQueues(_0x140115,_0x3dbe4a,_0x59de('0x43'),_0x248e61[_0x3247bb][_0xcdd740]);break;case 0x3:joinOrLeaveQueues(_0x140115,_0x3dbe4a,_0x59de('0x44'),_0x248e61[_0x3247bb][_0xcdd740]);break;case 0x4:joinOrLeaveQueues(_0x140115,_0x3dbe4a,_0x59de('0x45'),_0x248e61[_0x3247bb][_0xcdd740]);break;case 0x5:joinOrLeaveQueues(_0x140115,_0x3dbe4a,'openchannel',_0x248e61[_0x3247bb][_0xcdd740]);break;case 0x6:joinOrLeaveQueues(_0x140115,_0x3dbe4a,_0x59de('0x46'),_0x248e61[_0x3247bb][_0xcdd740]);break;case 0x7:if(_0x2c22aa[_0x59de('0x7')]!==_0x59de('0x39'))_0x140115[_0x3dbe4a](util['format']('telephone:%s',_0x248e61[_0x3247bb][_0xcdd740][_0x59de('0x5')]));break;case 0x8:if(_0x2c22aa[_0x59de('0x7')]!==_0x59de('0x39'))_0x140115[_0x3dbe4a](util[_0x59de('0x1f')](_0x59de('0x47'),_0x248e61[_0x3247bb][_0xcdd740][_0x59de('0x5')]));break;case 0x9:if(_0x2c22aa[_0x59de('0x7')]!==_0x59de('0x39'))_0x140115[_0x3dbe4a](util[_0x59de('0x1f')]('campaign:%s:%s',_0x248e61[_0x3247bb][_0xcdd740][_0x59de('0x8')],_0x248e61[_0x3247bb][_0xcdd740][_0x59de('0x5')]));break;case 0xa:_0x140115[_0x3dbe4a](util[_0x59de('0x1f')](_0x59de('0x2b'),_0x248e61[_0x3247bb][_0xcdd740][_0x59de('0x5')]));break;}}}}})['then'](function(){if(_0x3dbe4a===_0x59de('0x48')){var _0x4d7568=_['map'](_0x2c22aa[_0x59de('0x23')],'id');return _0x2c22aa['removeChatInteractions'](_0x4d7568)[_0x59de('0x17')](function(){for(var _0x1469e1=0x0;_0x1469e1<_0x4d7568[_0x59de('0x1e')];_0x1469e1+=0x1){_0x5b10bd[_0x59de('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4d7568[_0x1469e1]),'UserId':Number(_0x2c22aa['id'])});}});}})[_0x59de('0x17')](function(){if(_0x3dbe4a===_0x59de('0x48')){var _0xfa70e7=_[_0x59de('0x18')](_0x2c22aa[_0x59de('0x25')],'id');return _0x2c22aa[_0x59de('0x4a')](_0xfa70e7)[_0x59de('0x17')](function(){for(var _0x16464f=0x0;_0x16464f<_0xfa70e7[_0x59de('0x1e')];_0x16464f+=0x1){_0x5b10bd[_0x59de('0x49')](_0x59de('0x4b'),{'MailInteractionId':Number(_0xfa70e7[_0x16464f]),'UserId':Number(_0x2c22aa['id'])});}});}})['then'](function(){if(_0x3dbe4a==='leave'){var _0x1a1595=_[_0x59de('0x18')](_0x2c22aa[_0x59de('0x27')],'id');return _0x2c22aa['removeFaxInteractions'](_0x1a1595)[_0x59de('0x17')](function(){for(var _0x3cb1ff=0x0;_0x3cb1ff<_0x1a1595[_0x59de('0x1e')];_0x3cb1ff+=0x1){_0x5b10bd[_0x59de('0x49')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1a1595[_0x3cb1ff]),'UserId':Number(_0x2c22aa['id'])});}});}})[_0x59de('0x17')](function(){if(_0x3dbe4a===_0x59de('0x48')){var _0x39e51e=_[_0x59de('0x18')](_0x2c22aa[_0x59de('0x29')],'id');return _0x2c22aa[_0x59de('0x4c')](_0x39e51e)[_0x59de('0x17')](function(){for(var _0x280772=0x0;_0x280772<_0x39e51e[_0x59de('0x1e')];_0x280772+=0x1){_0x5b10bd[_0x59de('0x49')](_0x59de('0x4d'),{'SmsInteractionId':Number(_0x39e51e[_0x280772]),'UserId':Number(_0x2c22aa['id'])});}});}})[_0x59de('0x17')](function(){if(_0x3dbe4a==='leave'){var _0x598e36=_[_0x59de('0x18')](_0x2c22aa['OpenchannelInteractions'],'id');return _0x2c22aa['removeOpenchannelInteractions'](_0x598e36)[_0x59de('0x17')](function(){for(var _0xbbdd72=0x0;_0xbbdd72<_0x598e36[_0x59de('0x1e')];_0xbbdd72+=0x1){_0x5b10bd[_0x59de('0x49')](_0x59de('0x4e'),{'OpenchannelInteractionId':Number(_0x598e36[_0xbbdd72]),'UserId':Number(_0x2c22aa['id'])});}});}})['then'](function(){if(_0x3dbe4a===_0x59de('0x48')){var _0x40c2ed=_[_0x59de('0x18')](_0x2c22aa[_0x59de('0x2a')],'id');return _0x2c22aa[_0x59de('0x4f')](_0x40c2ed)[_0x59de('0x17')](function(){for(var _0x2c825d=0x0;_0x2c825d<_0x40c2ed[_0x59de('0x1e')];_0x2c825d+=0x1){_0x5b10bd[_0x59de('0x49')](_0x59de('0x50'),{'WhatsappInteractionId':Number(_0x40c2ed[_0x2c825d]),'UserId':Number(_0x2c22aa['id'])});}});}})['catch'](function(_0x23541a){_0x140115[_0x59de('0x51')](_0x23541a);});}}function onDisconnect(_0x3dd5ff,_0x4b4e8b){joinOrLeave(_0x3dd5ff,_0x59de('0x48'),_0x4b4e8b);}function onConnect(_0x18f86d){joinOrLeave(_0x18f86d,_0x59de('0x52'));}exports[_0x59de('0x53')]=function(_0x1134d2){_0x1134d2['on'](_0x59de('0x54'),function(_0x2775c5){_0x2775c5['setMaxListeners'](0x0);_0x2775c5['address']=_0x2775c5[_0x59de('0x55')][_0x59de('0x54')][_0x59de('0x56')]+':'+_0x2775c5['request'][_0x59de('0x54')][_0x59de('0x57')];_0x2775c5[_0x59de('0x58')]=new Date();_0x2775c5['log']=function(_0x14b166){console[_0x59de('0x51')](_0x59de('0x59')+_0x2775c5[_0x59de('0x5a')]['name']+'['+_0x2775c5[_0x59de('0x5b')]+']',_0x14b166);};_0x2775c5['on'](_0x59de('0x5c'),function(){onDisconnect(_0x2775c5,_0x1134d2);_0x2775c5[_0x59de('0x51')](_0x59de('0x5d'));});onConnect(_0x2775c5);_0x2775c5['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index dac2746..b0e53a8 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 _0x7627=['Sms','SmsInteraction','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','Trigger,\x20%s','catch','channel','motionChannel','direction','undefined','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','SIP/%s','AfterCreateMessage','get','offlineMessage','opened','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','name','AfterCreate','changed','closed','substatus','event','sequelize','format','agent','find','internal','default','length','model','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','ChatMessage','newmessage','ChatOfflineMessage'];(function(_0x219ddb,_0xab20e1){var _0x10d674=function(_0x3e7f4b){while(--_0x3e7f4b){_0x219ddb['push'](_0x219ddb['shift']());}};_0x10d674(++_0xab20e1);}(_0x7627,0x152));var _0x7762=function(_0x9967e2,_0x534b75){_0x9967e2=_0x9967e2-0x0;var _0x1e45cc=_0x7627[_0x9967e2];return _0x1e45cc;};'use strict';var util=require('util');var db=require(_0x7762('0x0'))['db'];var jayson=require(_0x7762('0x1'));var logger=require(_0x7762('0x2'))(_0x7762('0x3'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0x7762('0x4'),'model':'ChatInteraction','event':_0x7762('0x5'),'condition':_0x7762('0x6'),'callback':afterCreate},{'channel':_0x7762('0x4'),'model':_0x7762('0x7'),'event':_0x7762('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':_0x7762('0x9'),'event':'afterCreate','condition':_0x7762('0xa'),'callback':afterCreateMessage},{'channel':_0x7762('0x4'),'model':_0x7762('0xb'),'event':_0x7762('0x5'),'condition':_0x7762('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0x7762('0xc'),'model':_0x7762('0xd'),'event':_0x7762('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x7762('0x8'),'condition':_0x7762('0xe'),'callback':afterUpdate},{'channel':'Sms','model':_0x7762('0xf'),'event':_0x7762('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x7762('0x10'),'model':_0x7762('0x11'),'event':_0x7762('0x5'),'condition':_0x7762('0x6'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x7762('0x8'),'condition':_0x7762('0xe'),'callback':afterUpdate},{'channel':'Whatsapp','model':'WhatsappMessage','event':_0x7762('0x5'),'condition':_0x7762('0xa'),'callback':afterCreateMessage},{'channel':_0x7762('0x12'),'model':_0x7762('0x13'),'event':'afterCreate','condition':_0x7762('0x6'),'callback':afterCreate},{'channel':_0x7762('0x12'),'model':_0x7762('0x13'),'event':_0x7762('0x8'),'condition':_0x7762('0xe'),'callback':afterUpdate},{'channel':_0x7762('0x12'),'model':_0x7762('0x14'),'event':_0x7762('0x5'),'condition':_0x7762('0xa'),'callback':afterCreateMessage},{'channel':_0x7762('0x15'),'model':'MailInteraction','event':_0x7762('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7762('0x15'),'model':_0x7762('0x16'),'event':_0x7762('0x8'),'condition':_0x7762('0xe'),'callback':afterUpdate},{'channel':'Mail','model':_0x7762('0x17'),'event':_0x7762('0x5'),'condition':_0x7762('0xa'),'callback':afterCreateMessage},{'channel':_0x7762('0x18'),'model':_0x7762('0x19'),'event':_0x7762('0x5'),'condition':_0x7762('0x6'),'callback':afterCreate},{'channel':_0x7762('0x18'),'model':_0x7762('0x19'),'event':'afterUpdate','condition':_0x7762('0xe'),'callback':afterUpdate},{'channel':_0x7762('0x18'),'model':_0x7762('0x1a'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x50a910){return client[_0x7762('0x1b')](_0x7762('0x1c'),_0x50a910)[_0x7762('0x1d')](function(_0x4e541e){logger[_0x7762('0x1e')]('Trigger,\x20%s',_0x7762('0x1c'),_0x4e541e);if(_0x4e541e['error']){if(_0x4e541e['error']['code']===0x1f4){logger[_0x7762('0x1f')](_0x7762('0x20'),_0x7762('0x1c'),_0x4e541e[_0x7762('0x1f')]);}}})[_0x7762('0x21')](function(_0x287a3c){logger[_0x7762('0x1f')](_0x7762('0x20'),_0x7762('0x1c'),_0x287a3c);});}function afterCreateMessage(_0x5aae7c){return function(_0x1768be){_0x1768be=_0x1768be['get']({'plain':!![]});_0x1768be[_0x7762('0x22')]=_0x5aae7c;_0x1768be[_0x7762('0x23')]=_0x5aae7c;_0x1768be['event']=_0x1768be[_0x7762('0x24')];Promise['resolve']()['then'](function(){if(typeof _0x1768be['ContactId']===_0x7762('0x25'))return null;var _0x5904a7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1768be['ContactId'];return db['sequelize'][_0x7762('0x26')](_0x5904a7,{'type':db[_0x7762('0x27')][_0x7762('0x28')][_0x7762('0x29')],'raw':!![]});})[_0x7762('0x1d')](function(_0x37d675){if(_0x37d675){_0x1768be[_0x7762('0x2a')]=_0x37d675[0x0];}if(typeof _0x1768be['UserId']==='undefined')return;return getAgent(_0x1768be[_0x7762('0x2b')]);})[_0x7762('0x1d')](function(_0x3573f0){if(_0x3573f0){_0x1768be[_0x7762('0x2c')]=util['format'](_0x7762('0x2d'),_0x3573f0['name']);_0x1768be['agent']=_0x3573f0;_0x1768be[_0x7762('0x22')]=_0x5aae7c;return request({'event':'incomingmessage','message':_0x1768be});}else{return request({'event':'outgoingmessage','message':_0x1768be});}})[_0x7762('0x21')](function(_0x1c250d){logger[_0x7762('0x1f')](_0x7762('0x20'),_0x7762('0x2e'),_0x1c250d);});};}function afterCreateOfflineMessage(_0xf9144d){return function(_0x5c1d3c){_0x5c1d3c=_0x5c1d3c[_0x7762('0x2f')]({'plain':!![]});_0x5c1d3c[_0x7762('0x22')]=_0xf9144d;_0x5c1d3c[_0x7762('0x23')]=_0xf9144d;_0x5c1d3c['event']=_0x7762('0x30');return request({'event':_0x5c1d3c['event'],'message':_0x5c1d3c});};}function afterCreate(_0x2ae0d7,_0x1663e5){return function(_0x527229){_0x527229=_0x527229[_0x7762('0x2f')]({'plain':!![]});_0x527229['channel']=_0x2ae0d7;_0x527229[_0x7762('0x23')]=_0x2ae0d7;_0x527229['event']=_0x7762('0x31');Promise[_0x7762('0x32')]()['then'](function(){var _0x35ce09=_0x7762('0x33')+_0x527229[_0x7762('0x34')];return db['sequelize'][_0x7762('0x26')](_0x35ce09,{'type':db['Sequelize'][_0x7762('0x28')][_0x7762('0x29')],'raw':!![]});})[_0x7762('0x1d')](function(_0x551038){if(_0x551038){_0x527229['contact']=_0x551038[0x0];}if(typeof _0x527229[_0x7762('0x2b')]===_0x7762('0x25'))return;return getAgent(_0x527229[_0x7762('0x2b')]);})[_0x7762('0x1d')](function(_0x4999bd){if(_0x4999bd){_0x527229['interface']=util['format'](_0x7762('0x2d'),_0x4999bd[_0x7762('0x35')]);_0x527229['agent']=_0x4999bd;}return request({'event':_0x1663e5,'message':_0x527229});})['catch'](function(_0x326607){logger['error'](_0x7762('0x20'),_0x7762('0x36'),_0x326607);});};}function afterUpdate(_0xe4a715){return function(_0x45d66c){var _0x366639=_0x45d66c[_0x7762('0x37')](_0x7762('0x38'))&&_0x45d66c['closed'];var _0x55f004=_0x45d66c['changed']('substatus');if(_0x366639||_0x55f004){var _0x29684e=_0x366639?'closedinteraction':_0x7762('0x39');var _0x2bfb87=_0x45d66c[_0x7762('0x2f')]({'plain':!![]});_0x2bfb87[_0x7762('0x22')]=_0xe4a715;_0x2bfb87['motionChannel']=_0xe4a715;_0x2bfb87[_0x7762('0x3a')]=_0x366639?_0x7762('0x38'):_0x7762('0x39');var _0x3d7a96=_0x7762('0x33')+_0x2bfb87[_0x7762('0x34')];return db[_0x7762('0x3b')][_0x7762('0x26')](_0x3d7a96,{'type':db['Sequelize'][_0x7762('0x28')][_0x7762('0x29')],'raw':!![]})['then'](function(_0x2c88c4){if(_0x2c88c4){_0x2bfb87[_0x7762('0x2a')]=_0x2c88c4[0x0];}if(typeof _0x2bfb87[_0x7762('0x2b')]==='undefined')return;return getAgent(_0x2bfb87['UserId']);})[_0x7762('0x1d')](function(_0x40a4ca){if(_0x40a4ca){_0x2bfb87[_0x7762('0x2c')]=util[_0x7762('0x3c')](_0x7762('0x2d'),_0x40a4ca[_0x7762('0x35')]);_0x2bfb87[_0x7762('0x3d')]=_0x40a4ca;}return request({'event':_0x29684e,'message':_0x2bfb87});})[_0x7762('0x21')](function(_0x14e7d1){logger[_0x7762('0x1f')](_0x7762('0x20'),'AfterUpdate',_0x14e7d1);});}};}function getAgent(_0x336e18){return db['User'][_0x7762('0x3e')]({'where':{'id':_0x336e18},'attributes':['id',_0x7762('0x35'),'fullname','email',_0x7762('0x3f')],'raw':!![]})[_0x7762('0x1d')](function(_0x5d2368){return _0x5d2368;});}exports[_0x7762('0x40')]=function(){for(var _0x1af616=0x0;_0x1af616=_0x149f29['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x123b9a(_0x164088);})['catch'](function(_0x16bddc){_0x2e9ee6(_0x16bddc);});});}; \ No newline at end of file +var _0x9207=['clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','voice','mail','chat','whatsapp','getChannels','isValidChannel','includes'];(function(_0x152882,_0x8d5c5c){var _0x29b882=function(_0x14e53a){while(--_0x14e53a){_0x152882['push'](_0x152882['shift']());}};_0x29b882(++_0x8d5c5c);}(_0x9207,0x10a));var _0x7920=function(_0x39da12,_0x2365e3){_0x39da12=_0x39da12-0x0;var _0x3c68a3=_0x9207[_0x39da12];return _0x3c68a3;};'use strict';var _=require(_0x7920('0x0'));var BPromise=require(_0x7920('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x7920('0x2'));var channels=[_0x7920('0x3'),_0x7920('0x4'),_0x7920('0x5'),'fax','sms',_0x7920('0x6'),'openchannel'];exports[_0x7920('0x7')]=function(){return channels;};exports[_0x7920('0x8')]=function(_0x623892){_0x623892=_0x623892['toLowerCase']();return _[_0x7920('0x9')](channels,_0x623892);};exports[_0x7920('0xa')]=function(_0x47c64f,_0x385d99,_0x4e2c05,_0x2815ee){var _0x4ced5d={'loginAttempts':_0x385d99,'blocked':_0x4e2c05};if(!_[_0x7920('0xb')](_0x2815ee)){_0x4ced5d[_0x7920('0xc')]=_0x2815ee;}return _0x47c64f[_0x7920('0xd')](_0x4ced5d);};exports[_0x7920('0xe')]=function(_0x55709e){return new BPromise(function(_0x60e891,_0x522d5f){var _0x2c0a14=0x0;if(_0x55709e[_0x7920('0xf')]!==_0x7920('0x10')){_0x60e891(_0x55709e);}db[_0x7920('0x11')][_0x7920('0x12')]({'where':{'role':_0x7920('0x10'),'online':!![],'id':{'$ne':_0x55709e['id']}}})[_0x7920('0x13')](function(_0x22c44b){_0x2c0a14=_0x22c44b;return util['getLicense']();})[_0x7920('0x13')](function(_0x1c3f13){if(_0x1c3f13&&_0x1c3f13[_0x7920('0x14')]&&_0x2c0a14>=_0x1c3f13[_0x7920('0x14')]){throw Error(_0x7920('0x15'));}_0x60e891(_0x55709e);})[_0x7920('0x16')](function(_0x35f745){_0x522d5f(_0x35f745);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 15cfd70..136bbdc 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['inherits','message','Bad\x20Request','Entity\x20not\x20found','name','Not\x20Found','Forbidden','OutOfInterval','error','stack','send','exports','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x139abf,_0x44ef15){var _0x5754f8=function(_0x5ee861){while(--_0x5ee861){_0x139abf['push'](_0x139abf['shift']());}};_0x5754f8(++_0x44ef15);}(_0xda3f,0xec));var _0xfda3=function(_0x1499c4,_0x531e3d){_0x1499c4=_0x1499c4-0x0;var _0x25d90e=_0xda3f[_0x1499c4];return _0x25d90e;};'use strict';var util=require('util');var logger=require(_0xfda3('0x0'))(_0xfda3('0x1'));var APIError=function(_0x534697,_0x5299b0){this['message']=_0x534697||_0xfda3('0x2');this['name']=_0x5299b0||_0xfda3('0x3');util[_0xfda3('0x4')](APIError,Error);};var APIBadRequestError=function(_0x516500){this[_0xfda3('0x5')]=_0x516500||_0xfda3('0x6');this['name']='Bad\x20Request';util[_0xfda3('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x42476a){this[_0xfda3('0x5')]=_0x42476a||_0xfda3('0x7');this[_0xfda3('0x8')]=_0xfda3('0x9');util[_0xfda3('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x1b1ea6){switch(_0x1b1ea6){case _0xfda3('0x6'):return 0x190;case _0xfda3('0xa'),_0xfda3('0xb'):return 0x193;case _0xfda3('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x4d7841){return function(_0xe933f5){logger[_0xfda3('0xc')](_0xe933f5[_0xfda3('0xd')]);var _0x11afc1=getStatusCode(_0xe933f5[_0xfda3('0x8')]);if(_0xe933f5['name'])delete _0xe933f5[_0xfda3('0x8')];return _0x4d7841['status'](_0x11afc1)[_0xfda3('0xe')](_0xe933f5);};}module[_0xfda3('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xbdb7=['Error','Bad\x20Request','Entity\x20not\x20found','inherits','Forbidden','OutOfInterval','Not\x20Found','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name'];(function(_0x2f6f5b,_0x1a6e08){var _0x342f2e=function(_0x14dff5){while(--_0x14dff5){_0x2f6f5b['push'](_0x2f6f5b['shift']());}};_0x342f2e(++_0x1a6e08);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x20a761,_0x2ffd85){_0x20a761=_0x20a761-0x0;var _0x284a38=_0xbdb7[_0x20a761];return _0x284a38;};'use strict';var util=require(_0x7bdb('0x0'));var logger=require(_0x7bdb('0x1'))(_0x7bdb('0x2'));var APIError=function(_0x2a2c1c,_0x23c326){this[_0x7bdb('0x3')]=_0x2a2c1c||_0x7bdb('0x4');this[_0x7bdb('0x5')]=_0x23c326||_0x7bdb('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x28542c){this['message']=_0x28542c||'Bad\x20Request';this[_0x7bdb('0x5')]=_0x7bdb('0x7');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x513cba){this[_0x7bdb('0x3')]=_0x513cba||_0x7bdb('0x8');this['name']='Not\x20Found';util[_0x7bdb('0x9')](APINotFoundError,APIError);};function getStatusCode(_0x1a6b61){switch(_0x1a6b61){case _0x7bdb('0x7'):return 0x190;case _0x7bdb('0xa'),_0x7bdb('0xb'):return 0x193;case _0x7bdb('0xc'):return 0x194;default:return 0x1f4;}}function handleError(_0x297724){return function(_0x258cc6){logger['error'](_0x258cc6['stack']);var _0x52b9b9=getStatusCode(_0x258cc6[_0x7bdb('0x5')]);if(_0x258cc6[_0x7bdb('0x5')])delete _0x258cc6['name'];return _0x297724[_0x7bdb('0xd')](_0x52b9b9)['send'](_0x258cc6);};}module['exports']={'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 a8cc7fa..f7f0f92 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb3e=['json','send','404','status','render'];(function(_0x30a1c5,_0x4d1276){var _0x174f8e=function(_0x8185a2){while(--_0x8185a2){_0x30a1c5['push'](_0x30a1c5['shift']());}};_0x174f8e(++_0x4d1276);}(_0xdb3e,0x1e2));var _0xedb3=function(_0x4d90e6,_0x52b54e){_0x4d90e6=_0x4d90e6-0x0;var _0x428249=_0xdb3e[_0x4d90e6];return _0x428249;};'use strict';module['exports'][0x194]=function pageNotFound(_0x3a2bf1,_0x5affc2){var _0x40be36=_0xedb3('0x0');var _0x2b6355=0x194;var _0x4e834c={'status':_0x2b6355};_0x5affc2[_0xedb3('0x1')](_0x4e834c[_0xedb3('0x1')]);_0x5affc2[_0xedb3('0x2')](_0x40be36,{},function(_0xf108c8,_0x4010ab){if(_0xf108c8){return _0x5affc2[_0xedb3('0x1')](_0x4e834c[_0xedb3('0x1')])[_0xedb3('0x3')](_0x4e834c);}_0x5affc2[_0xedb3('0x4')](_0x4010ab);});}; \ No newline at end of file +var _0xf79b=['404','status','render','json','send'];(function(_0x488b44,_0x4e9d9a){var _0x5ece27=function(_0x4eb75e){while(--_0x4eb75e){_0x488b44['push'](_0x488b44['shift']());}};_0x5ece27(++_0x4e9d9a);}(_0xf79b,0xa0));var _0xbf79=function(_0xd8818e,_0x113374){_0xd8818e=_0xd8818e-0x0;var _0x11d74d=_0xf79b[_0xd8818e];return _0x11d74d;};'use strict';module['exports'][0x194]=function pageNotFound(_0x2ac377,_0x15d780){var _0x5389ed=_0xbf79('0x0');var _0x157ab6=0x194;var _0x1a53e4={'status':_0x157ab6};_0x15d780['status'](_0x1a53e4[_0xbf79('0x1')]);_0x15d780[_0xbf79('0x2')](_0x5389ed,{},function(_0x238ca0,_0x106e28){if(_0x238ca0){return _0x15d780[_0xbf79('0x1')](_0x1a53e4[_0xbf79('0x1')])[_0xbf79('0x3')](_0x1a53e4);}_0x15d780[_0xbf79('0x4')](_0x106e28);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index a5ef9ec..6ba95cf 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x794f=['Answers','Interactions','ListId','mandatoryDispositionPauseId','Agents','team_has_mail_queues','Teams','MailInteractionId','Account','ContactId','mail_interaction_has_tags','Tags','Tag','ThroughTags','Users','user_has_mail_interactions','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','MailQueueReport','List','DashboardItem','Items','FaxAccountId','TagId','FaxInteractionId','Owner','fax_interaction_has_tags','team_has_fax_queues','FaxQueueReport','SmsAccountId','Applications','SmsInteractionId','UserSmsQueue','OpenchannelAccountId','OpenchannelMessage','user_has_openchannel_accounts','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessageId','team_has_chat_queues','Phones','CmContactId','Hoppers','Company','CompanyId','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','SmsApplications','CustomReportId','Mohs','moh_has_sounds','sms_interaction_has_tags','ItemType','ItemTypeId','CmHopperAdditionalPhone','Hopper','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Fields','DefaultReportId','MetricId','Configurations','AccountId','Subjects','SubjectId','SalesforceConfiguration','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmAccount','int_desk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowAccount','ServicenowConfiguration','ServicenowField','Dynamics365Configuration','Dynamics365Field','FromId','ToId','SessionId','SmsQueueReport','JscriptyProject','ProjectId','user_has_square_projects','user_has_teams','VoiceQueues','FaxQueues','team_has_sms_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToUserId','ToChatWebsiteId','FromFaxAccountId','FromOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSections','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','utf8mb4','database','username','options','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../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','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','userSetting','hasMany','Recordings','UserId','Extensions','CmHopperFinal','HopperFinals','OpenchannelInteractions','SmsInteractions','MailInteraction','MailInteractions','UserNotification','UserNotifications','belongsTo','UserProfile','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','UserVoiceQueue','VoicePrefix','VoicePrefixes','UserVoicePrefix','MailQueues','UserMailQueue','ChatQueues','FaxQueue','UserFaxQueue','SmsQueue','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Sounds','Members','VoiceQueueId','CmHopper','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','AgentReports','uniqueid','Contact','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','Smtp','Dispositions'];(function(_0x4eaa64,_0x382ef3){var _0x5d52eb=function(_0x3374d2){while(--_0x3374d2){_0x4eaa64['push'](_0x4eaa64['shift']());}};_0x5d52eb(++_0x382ef3);}(_0x794f,0x9b));var _0xf794=function(_0x1e25a0,_0x5d6176){_0x1e25a0=_0x1e25a0-0x0;var _0x1d86ba=_0x794f[_0x1e25a0];return _0x1d86ba;};'use strict';var config=require(_0xf794('0x0'));var Sequelize=require(_0xf794('0x1'));var _=require('lodash');var jstz=require(_0xf794('0x2'));var timezone=jstz[_0xf794('0x3')]();config[_0xf794('0x1')]=_[_0xf794('0x4')](config[_0xf794('0x1')],{'database':_0xf794('0x5'),'username':_0xf794('0x6'),'password':_0xf794('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xf794('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xf794('0x9')](),'define':{'charset':_0xf794('0xa'),'collate':_0xf794('0xb')}}});config[_0xf794('0xc')]=_[_0xf794('0x4')](config[_0xf794('0xc')],{'database':_0xf794('0x5'),'username':_0xf794('0x6'),'password':_0xf794('0x7'),'options':{'host':_0xf794('0xd'),'port':0xcea,'dialect':_0xf794('0x8'),'dialectOptions':{'charset':_0xf794('0xe')},'logging':![],'timezone':timezone[_0xf794('0x9')](),'define':{'charset':_0xf794('0xa'),'collate':_0xf794('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xf794('0xf')],config[_0xf794('0x1')][_0xf794('0x10')],config['sequelize']['password'],config[_0xf794('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf794('0xc')]['database'],config[_0xf794('0xc')][_0xf794('0x10')],config[_0xf794('0xc')]['password'],config[_0xf794('0xc')][_0xf794('0x11')])};db['User']=db[_0xf794('0x1')]['import'](_0xf794('0x12'));db[_0xf794('0x13')]=db[_0xf794('0x1')]['import'](_0xf794('0x14'));db[_0xf794('0x15')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x17'));db[_0xf794('0x18')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x19'));db[_0xf794('0x1a')]=db['sequelize']['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db['sequelize'][_0xf794('0x16')](_0xf794('0x1b'));db[_0xf794('0x1c')]=db[_0xf794('0x1')]['import'](_0xf794('0x1d'));db['ScreenRecording']=db['sequelize']['import'](_0xf794('0x1e'));db[_0xf794('0x1f')]=db[_0xf794('0x1')]['import']('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize'][_0xf794('0x16')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db['sequelize'][_0xf794('0x16')](_0xf794('0x20'));db['VoiceDialReport']=db['sequelize'][_0xf794('0x16')](_0xf794('0x21'));db[_0xf794('0x22')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x23'));db[_0xf794('0x24')]=db[_0xf794('0x1')]['import'](_0xf794('0x25'));db[_0xf794('0x26')]=db['sequelize']['import']('../api/memberReport/memberReport.model');db[_0xf794('0x27')]=db['sequelize'][_0xf794('0x16')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0xf794('0x1')]['import'](_0xf794('0x28'));db[_0xf794('0x29')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x2a'));db['UserVoiceQueue']=db[_0xf794('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0xf794('0x2b')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x2c'));db['UserMailQueue']=db[_0xf794('0x1')][_0xf794('0x16')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xf794('0x1')]['import'](_0xf794('0x2d'));db['UserSmsQueue']=db[_0xf794('0x1')][_0xf794('0x16')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x2e'));db[_0xf794('0x2f')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xf794('0x30')]=db[_0xf794('0x1')]['import'](_0xf794('0x31'));db['MailServerOut']=db['sequelize']['import']('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x32'));db[_0xf794('0x33')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x34'));db[_0xf794('0x35')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db['sequelize'][_0xf794('0x16')](_0xf794('0x36'));db[_0xf794('0x37')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/mailMessage/mailMessage.model');db[_0xf794('0x38')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0xf794('0x16')]('../api/mailQueueReport/mailQueueReport.model');db[_0xf794('0x39')]=db[_0xf794('0x1')]['import'](_0xf794('0x3a'));db['DashboardItem']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x3b'));db[_0xf794('0x3c')]=db['sequelize']['import'](_0xf794('0x3d'));db[_0xf794('0x3e')]=db[_0xf794('0x1')]['import'](_0xf794('0x3f'));db[_0xf794('0x40')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x41'));db[_0xf794('0x42')]=db[_0xf794('0x1')]['import'](_0xf794('0x43'));db['FaxQueue']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x44'));db['FaxQueueReport']=db['sequelize'][_0xf794('0x16')](_0xf794('0x45'));db[_0xf794('0x46')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x47'));db[_0xf794('0x48')]=db[_0xf794('0x1')]['import'](_0xf794('0x49'));db[_0xf794('0x4a')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x4b'));db[_0xf794('0x4c')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x4d'));db['SmsQueue']=db['sequelize']['import'](_0xf794('0x4e'));db['OpenchannelAccount']=db['sequelize']['import'](_0xf794('0x4f'));db[_0xf794('0x50')]=db[_0xf794('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0xf794('0x51')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x52'));db['OpenchannelMessage']=db['sequelize'][_0xf794('0x16')](_0xf794('0x53'));db[_0xf794('0x54')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x55'));db[_0xf794('0x56')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x57'));db[_0xf794('0x58')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xf794('0x59')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x5a'));db[_0xf794('0x5b')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x5c'));db['ChatMessage']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x5d'));db['ChatOfflineMessage']=db[_0xf794('0x1')][_0xf794('0x16')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xf794('0x5e')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/chatQueue/chatQueue.model');db[_0xf794('0x5f')]=db[_0xf794('0x1')]['import']('../api/chatGroup/chatGroup.model');db[_0xf794('0x60')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x61'));db[_0xf794('0x62')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x63'));db[_0xf794('0x64')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/cmContact/cmContact.model');db['CmHopper']=db['sequelize'][_0xf794('0x16')](_0xf794('0x65'));db['CmHopperBlack']=db[_0xf794('0x1')]['import'](_0xf794('0x66'));db['CmHopperFinal']=db['sequelize']['import'](_0xf794('0x67'));db[_0xf794('0x68')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xf794('0x69')]=db['sequelize']['import'](_0xf794('0x6a'));db[_0xf794('0x6b')]=db['sequelize']['import'](_0xf794('0x6c'));db[_0xf794('0x6d')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/action/action.model');db[_0xf794('0x6e')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x6f'));db[_0xf794('0x70')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x71'));db[_0xf794('0x72')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x73'));db[_0xf794('0x74')]=db['sequelize']['import'](_0xf794('0x75'));db[_0xf794('0x76')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x77'));db[_0xf794('0x78')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x79'));db[_0xf794('0x7a')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x7b'));db[_0xf794('0x7c')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x7d'));db[_0xf794('0x7e')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/schedule/schedule.model');db[_0xf794('0x7f')]=db[_0xf794('0x1')]['import'](_0xf794('0x80'));db['Tag']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x81'));db[_0xf794('0x82')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x83'));db[_0xf794('0x84')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x85'));db['CmHopperAdditionalPhone']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x86'));db[_0xf794('0x87')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/template/template.model');db[_0xf794('0x88')]=db[_0xf794('0x1')]['import']('../api/trigger/trigger.model');db[_0xf794('0x89')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x8a'));db[_0xf794('0x8b')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x8c'));db[_0xf794('0x8d')]=db[_0xf794('0x1')]['import'](_0xf794('0x8e'));db[_0xf794('0x8f')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x90'));db[_0xf794('0x91')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x92'));db[_0xf794('0x93')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x94'));db[_0xf794('0x95')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x96'));db[_0xf794('0x97')]=db[_0xf794('0x1')]['import'](_0xf794('0x98'));db[_0xf794('0x99')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x9a'));db[_0xf794('0x9b')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x9c'));db[_0xf794('0x9d')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x9e'));db['SugarcrmAccount']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x9f'));db[_0xf794('0xa0')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xf794('0xa1')]=db[_0xf794('0x1')]['import'](_0xf794('0xa2'));db[_0xf794('0xa3')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xa4'));db[_0xf794('0xa5')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xa6'));db[_0xf794('0xa7')]=db[_0xf794('0x1')]['import'](_0xf794('0xa8'));db[_0xf794('0xa9')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xaa'));db[_0xf794('0xab')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xac'));db[_0xf794('0xad')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xae'));db[_0xf794('0xaf')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xb0'));db[_0xf794('0xb1')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xb2'));db[_0xf794('0xb3')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xb4'));db[_0xf794('0xb5')]=db[_0xf794('0x1')][_0xf794('0x16')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xb6'));db[_0xf794('0xb7')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xb8'));db['VtigerAccount']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xb9'));db[_0xf794('0xba')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xbb'));db[_0xf794('0xbc')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xbd'));db['ServicenowAccount']=db['sequelize'][_0xf794('0x16')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xf794('0x1')][_0xf794('0x16')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0xf794('0x1')][_0xf794('0x16')]('../api/intServicenowField/intServicenowField.model');db[_0xf794('0xbe')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xbf'));db['Dynamics365Configuration']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xc0'));db['Dynamics365Field']=db[_0xf794('0x1')]['import'](_0xf794('0xc1'));db[_0xf794('0xc2')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xc3'));db[_0xf794('0xc4')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xc5'));db[_0xf794('0xc6')]=db['sequelize']['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0xf794('0x8b')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x8c'));db[_0xf794('0xc7')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xc8'));db[_0xf794('0xc9')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xca'));db[_0xf794('0xcb')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xcc'));db[_0xf794('0xcd')]=db[_0xf794('0x1')]['import'](_0xf794('0xce'));db[_0xf794('0xcf')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xd0'));db['JscriptySessionReport']=db['sequelize'][_0xf794('0x16')](_0xf794('0xd1'));db['SmsQueueReport']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xd2'));db['SquareReport']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xd3'));db['SquareDetailsReport']=db['sequelize']['import'](_0xf794('0xd4'));db['JscriptyProject']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xd5'));db[_0xf794('0xd6')]=db[_0xf794('0x1')]['import']('../api/setting/setting.model');db[_0xf794('0xd7')]=db[_0xf794('0x1')]['import'](_0xf794('0xd8'));db[_0xf794('0xd9')]=db[_0xf794('0x1')]['import'](_0xf794('0xda'));db[_0xf794('0xdb')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xdc'));db[_0xf794('0xdd')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xde'));db[_0xf794('0xdf')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xe0'));db['License']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xe1'));db[_0xf794('0xe2')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xe3'));db[_0xf794('0xe4')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xe5'));db['Attachment']=db['sequelize'][_0xf794('0x16')](_0xf794('0xe6'));db[_0xf794('0xe7')]=db[_0xf794('0x1')]['import']('../api/plugin/plugin.model');db['MailTransferReport']=db['sequelize'][_0xf794('0x16')]('../api/mailTransferReport/mailTransferReport.model');db[_0xf794('0xe8')]=db['sequelize']['import']('../api/chatTransferReport/chatTransferReport.model');db[_0xf794('0xe9')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xea'));db[_0xf794('0xeb')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xec'));db[_0xf794('0xed')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xee'));db[_0xf794('0xef')]=db['sequelize']['import']('../api/cmList/cmList.model');db['VoicePrefix']=db['sequelize'][_0xf794('0x16')](_0xf794('0xf0'));db['UserProfile']=db[_0xf794('0x1')]['import'](_0xf794('0xf1'));db[_0xf794('0xf2')]=db[_0xf794('0x1')]['import'](_0xf794('0xf3'));db[_0xf794('0xf4')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xf5'));db['UserNotification']=db[_0xf794('0x1')]['import']('../api/userNotification/userNotification.model');db['WhatsappAccount']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xf6'));db['WhatsappApplication']=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xf7'));db[_0xf794('0xf8')]=db[_0xf794('0x1')]['import'](_0xf794('0xf9'));db[_0xf794('0xfa')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xfb'));db[_0xf794('0xfc')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0xfd'));db[_0xf794('0xfe')]=db['sequelize'][_0xf794('0x16')](_0xf794('0xff'));db[_0xf794('0x100')]=db[_0xf794('0x1')][_0xf794('0x16')](_0xf794('0x101'));db[_0xf794('0x102')]=db['sequelize']['import']('../api/cloudProvider/cloudProvider.model');db[_0xf794('0x103')]=db['sequelize']['import'](_0xf794('0x104'));db[_0xf794('0x105')]=db[_0xf794('0x1')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db['sequelize'][_0xf794('0x16')](_0xf794('0x106'));db[_0xf794('0x107')]=db['sequelize'][_0xf794('0x16')](_0xf794('0x108'));db[_0xf794('0x109')][_0xf794('0x10a')](db[_0xf794('0x1f')],{'as':_0xf794('0x1f'),'onDelete':_0xf794('0x10b'),'foreignKey':'UserId'});db['User'][_0xf794('0x10a')](db[_0xf794('0x107')],{'as':_0xf794('0x10c'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0x1c')],{'as':_0xf794('0x10e'),'foreignKey':_0xf794('0x10f')});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0x29')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db['User'][_0xf794('0x10d')](db[_0xf794('0x18')],{'as':_0xf794('0x110'),'onDelete':_0xf794('0x10b'),'hooks':!![]});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0x111')],{'as':_0xf794('0x112'),'foreignKey':_0xf794('0x10f')});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0x68')],{'as':'HopperHistory','foreignKey':_0xf794('0x10f')});db['User'][_0xf794('0x10d')](db[_0xf794('0x69')],{'as':_0xf794('0x69'),'foreignKey':_0xf794('0x10f')});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0x51')],{'as':_0xf794('0x113'),'foreignKey':_0xf794('0x10f')});db['User'][_0xf794('0x10d')](db[_0xf794('0x5b')],{'as':'ChatInteractions','foreignKey':_0xf794('0x10f')});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0x4a')],{'as':_0xf794('0x114'),'foreignKey':_0xf794('0x10f')});db['User'][_0xf794('0x10d')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xf794('0x10f')});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0x115')],{'as':_0xf794('0x116'),'foreignKey':_0xf794('0x10f')});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0xf8')],{'as':'WhatsappInteractions','foreignKey':_0xf794('0x10f')});db[_0xf794('0x109')][_0xf794('0x10d')](db[_0xf794('0x117')],{'as':_0xf794('0x118'),'foreignKey':'SenderId'});db[_0xf794('0x109')][_0xf794('0x119')](db['UserProfile'],{'as':_0xf794('0x11a'),'foreignKey':_0xf794('0x11b')});db['User']['belongsToMany'](db['ChatGroup'],{'as':_0xf794('0x11c'),'through':_0xf794('0x11d')});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0x64')],{'as':_0xf794('0x11f'),'through':_0xf794('0x120')});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0xef')],{'as':_0xf794('0x121'),'through':_0xf794('0x122')});db[_0xf794('0x109')]['belongsToMany'](db[_0xf794('0xdf')],{'through':'user_has_teams'});db['User'][_0xf794('0x11e')](db[_0xf794('0x115')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db['User'][_0xf794('0x11e')](db['ChatInteraction'],{'as':_0xf794('0x123'),'through':_0xf794('0x124')});db['User'][_0xf794('0x11e')](db[_0xf794('0x40')],{'as':_0xf794('0x125'),'through':_0xf794('0x126')});db[_0xf794('0x109')]['belongsToMany'](db['SmsInteraction'],{'as':_0xf794('0x114'),'through':_0xf794('0x127')});db[_0xf794('0x109')]['belongsToMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0xf794('0x128')});db[_0xf794('0x109')]['belongsToMany'](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0xf794('0x129')});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0x12a')],{'as':'VoiceQueues','through':_0xf794('0x12b'),'required':![]});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0x12c')],{'as':_0xf794('0x12d'),'through':_0xf794('0x12e'),'required':![]});db['User']['belongsToMany'](db[_0xf794('0x33')],{'as':_0xf794('0x12f'),'through':_0xf794('0x130'),'required':![]});db['User']['belongsToMany'](db[_0xf794('0x5e')],{'as':_0xf794('0x131'),'through':_0xf794('0x2b'),'required':![],'hooks':!![]});db['User'][_0xf794('0x11e')](db[_0xf794('0x132')],{'as':'FaxQueues','through':_0xf794('0x133'),'required':![]});db[_0xf794('0x109')]['belongsToMany'](db[_0xf794('0x134')],{'as':_0xf794('0x135'),'through':'UserSmsQueue','required':![]});db['User']['belongsToMany'](db[_0xf794('0x54')],{'as':_0xf794('0x136'),'through':_0xf794('0x137'),'required':![]});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0x100')],{'as':_0xf794('0x138'),'through':_0xf794('0x2f'),'required':![]});db[_0xf794('0x109')][_0xf794('0x11e')](db['CmList'],{'through':_0xf794('0x122')});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0x56')],{'as':_0xf794('0x139'),'through':_0xf794('0x13a')});db['User'][_0xf794('0x11e')](db[_0xf794('0x3c')],{'as':_0xf794('0x13b'),'through':_0xf794('0x13c')});db[_0xf794('0x109')]['belongsToMany'](db[_0xf794('0x13d')],{'as':'MailAccounts','through':_0xf794('0x13e')});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0x13f')],{'as':_0xf794('0x140'),'through':'user_has_openchannel_accounts'});db[_0xf794('0x109')]['belongsToMany'](db['SmsAccount'],{'as':_0xf794('0x141'),'through':_0xf794('0x142')});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0x143')],{'as':_0xf794('0x144'),'through':_0xf794('0x145')});db[_0xf794('0x109')][_0xf794('0x11e')](db[_0xf794('0xd9')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0xf794('0x13')]['hasMany'](db[_0xf794('0x18')],{'as':_0xf794('0x146'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x147')});db['VoiceContext'][_0xf794('0x10d')](db[_0xf794('0x18')],{'onDelete':'cascade'});db[_0xf794('0x18')][_0xf794('0x10d')](db[_0xf794('0x18')],{'as':'Applications','onDelete':_0xf794('0x10b')});db['VoiceMusicOnHold'][_0xf794('0x11e')](db[_0xf794('0x7f')],{'as':_0xf794('0x148'),'through':'moh_has_sounds'});db[_0xf794('0x12a')][_0xf794('0x10d')](db[_0xf794('0x29')],{'as':_0xf794('0x149'),'foreignKey':_0xf794('0x14a')});db[_0xf794('0x12a')]['hasMany'](db[_0xf794('0x14b')],{'as':'Hoppers','foreignKey':_0xf794('0x14a')});db[_0xf794('0x12a')][_0xf794('0x10d')](db[_0xf794('0x111')],{'as':'HopperFinals','foreignKey':_0xf794('0x14a')});db['VoiceQueue'][_0xf794('0x10d')](db[_0xf794('0x68')],{'as':_0xf794('0x14c'),'foreignKey':'VoiceQueueId'});db[_0xf794('0x12a')][_0xf794('0x10d')](db['ReportAgentPreview'],{'as':_0xf794('0x69'),'foreignKey':_0xf794('0x14a')});db['VoiceQueue'][_0xf794('0x10d')](db[_0xf794('0x14d')],{'as':_0xf794('0x14e'),'foreignKey':_0xf794('0x14a')});db['VoiceQueue'][_0xf794('0x10d')](db[_0xf794('0x14f')],{'as':_0xf794('0x150'),'foreignKey':_0xf794('0x14a')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0xf794('0x27'),'foreignKey':_0xf794('0x151')});db['VoiceQueue'][_0xf794('0x119')](db['Trunk'],{'as':_0xf794('0x152'),'foreignKey':_0xf794('0x153')});db[_0xf794('0x12a')]['belongsTo'](db[_0xf794('0x76')],{'as':_0xf794('0x76'),'foreignKey':_0xf794('0x154')});db['VoiceQueue'][_0xf794('0x119')](db[_0xf794('0x78')],{'as':_0xf794('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf794('0x12a')][_0xf794('0x11e')](db[_0xf794('0xef')],{'as':_0xf794('0x121'),'through':_0xf794('0x156')});db[_0xf794('0x12a')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf794('0x12b')});db[_0xf794('0x12a')][_0xf794('0x11e')](db['Team'],{'as':'Teams','through':_0xf794('0x103')});db['VoiceQueue'][_0xf794('0x11e')](db[_0xf794('0xef')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x109'),'foreignKey':_0xf794('0x10f')});db[_0xf794('0x157')][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x109'),'foreignKey':_0xf794('0x10f')});db['VoiceMail']['hasMany'](db[_0xf794('0x158')],{'as':_0xf794('0x159'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x15a'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0xf794('0x119')](db['VoiceMail'],{'foreignKey':_0xf794('0x15a'),'targetKey':_0xf794('0x15b')});db[_0xf794('0x15c')][_0xf794('0x10d')](db['VoiceQueueReport'],{'as':_0xf794('0x15d'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0xf794('0x10d')](db['VoiceAgentReport'],{'as':_0xf794('0x15e'),'foreignKey':_0xf794('0x15f'),'constraints':![]});db[_0xf794('0x15c')]['belongsTo'](db[_0xf794('0x109')],{'as':_0xf794('0x109'),'foreignKey':_0xf794('0x10f')});db['VoiceCallReport'][_0xf794('0x119')](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':'ContactId'});db[_0xf794('0x30')][_0xf794('0x119')](db[_0xf794('0x13d')],{'as':_0xf794('0x13d'),'foreignKey':_0xf794('0x161')});db['MailServerIn']['belongsTo'](db[_0xf794('0x102')],{'as':_0xf794('0x102'),'foreignKey':_0xf794('0x162'),'onDelete':_0xf794('0x163')});db['MailServerOut'][_0xf794('0x119')](db[_0xf794('0x13d')],{'as':_0xf794('0x13d'),'foreignKey':_0xf794('0x161')});db[_0xf794('0x164')][_0xf794('0x119')](db[_0xf794('0x102')],{'as':_0xf794('0x102'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0xf794('0x13d')]['hasOne'](db[_0xf794('0x30')],{'as':_0xf794('0x165'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x13d')][_0xf794('0x10a')](db['MailServerOut'],{'as':_0xf794('0x166'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x13d')]['hasMany'](db[_0xf794('0x72')],{'as':_0xf794('0x167'),'foreignKey':_0xf794('0x161'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x13d')][_0xf794('0x10d')](db[_0xf794('0x70')],{'as':_0xf794('0x168'),'foreignKey':_0xf794('0x161')});db['MailAccount'][_0xf794('0x10d')](db[_0xf794('0x37')],{'as':_0xf794('0x159'),'foreignKey':_0xf794('0x161')});db[_0xf794('0x13d')][_0xf794('0x10d')](db[_0xf794('0x115')],{'as':_0xf794('0x169')});db[_0xf794('0x13d')][_0xf794('0x10d')](db[_0xf794('0x38')],{'as':'Applications','foreignKey':'MailAccountId','onDelete':_0xf794('0x10b')});db[_0xf794('0x13d')][_0xf794('0x119')](db[_0xf794('0xef')],{'as':'List','foreignKey':_0xf794('0x16a')});db[_0xf794('0x13d')][_0xf794('0x119')](db['Template'],{'as':'Template','foreignKey':'TemplateId'});db[_0xf794('0x13d')]['belongsTo'](db[_0xf794('0x78')],{'as':_0xf794('0x155'),'foreignKey':_0xf794('0x16b')});db[_0xf794('0x13d')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':'user_has_mail_accounts'});db[_0xf794('0x33')]['belongsToMany'](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':_0xf794('0x130')});db[_0xf794('0x33')][_0xf794('0x11e')](db[_0xf794('0xdf')],{'through':_0xf794('0x16d'),'as':_0xf794('0x16e')});db[_0xf794('0x115')][_0xf794('0x10d')](db[_0xf794('0x37')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf794('0x16f')});db[_0xf794('0x115')][_0xf794('0x119')](db[_0xf794('0x13d')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x161')});db[_0xf794('0x115')][_0xf794('0x119')](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db['MailInteraction'][_0xf794('0x119')](db[_0xf794('0x109')],{'as':'Owner','foreignKey':_0xf794('0x10f')});db[_0xf794('0x115')][_0xf794('0x11e')](db['Tag'],{'through':_0xf794('0x172'),'as':_0xf794('0x173')});db[_0xf794('0x115')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':'mail_interaction_has_tags','as':_0xf794('0x175')});db['MailInteraction'][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x176'),'through':_0xf794('0x177'),'foreignKey':_0xf794('0x16f')});db[_0xf794('0x37')][_0xf794('0x10d')](db[_0xf794('0x178')],{'as':_0xf794('0x179'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x37')][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x109')});db[_0xf794('0x37')][_0xf794('0x119')](db[_0xf794('0x64')],{'onDelete':'cascade','as':'Contact'});db[_0xf794('0x37')][_0xf794('0x119')](db[_0xf794('0x115')],{'as':_0xf794('0x17a'),'foreignKey':_0xf794('0x16f')});db['MailMessage'][_0xf794('0x119')](db[_0xf794('0x13d')],{'as':_0xf794('0x170'),'foreignKey':'MailAccountId'});db[_0xf794('0x37')][_0xf794('0x119')](db[_0xf794('0x56')],{'as':_0xf794('0x56'),'foreignKey':_0xf794('0x17b')});db['MailMessage'][_0xf794('0x119')](db[_0xf794('0x17c')],{'as':_0xf794('0x17c'),'foreignKey':'ChatOfflineMessageId'});db[_0xf794('0x38')][_0xf794('0x119')](db[_0xf794('0x109')],{'onDelete':_0xf794('0x163')});db[_0xf794('0x38')]['belongsTo'](db[_0xf794('0x33')],{'onDelete':_0xf794('0x163')});db[_0xf794('0x38')][_0xf794('0x119')](db['MailAccount'],{'onDelete':_0xf794('0x163')});db['MailApplication'][_0xf794('0x119')](db[_0xf794('0x76')],{'onDelete':_0xf794('0x163'),'foreignKey':_0xf794('0x154')});db[_0xf794('0x38')]['belongsTo'](db[_0xf794('0x174')],{'onDelete':_0xf794('0x163'),'foreignKey':'TagId'});db[_0xf794('0x17d')][_0xf794('0x119')](db[_0xf794('0x13d')],{});db[_0xf794('0x17d')]['belongsTo'](db[_0xf794('0xef')],{'as':_0xf794('0x17e'),'foreignKey':_0xf794('0x16a')});db['MailQueueReport']['belongsTo'](db[_0xf794('0x64')],{'as':'Contact','foreignKey':_0xf794('0x171')});db['MailQueueReport'][_0xf794('0x119')](db['MailInteraction'],{});db[_0xf794('0x17d')][_0xf794('0x119')](db[_0xf794('0x37')],{});db['MailQueueReport'][_0xf794('0x119')](db[_0xf794('0x109')],{});db['MailQueueReport'][_0xf794('0x119')](db[_0xf794('0x33')],{});db[_0xf794('0x39')]['hasMany'](db[_0xf794('0x17f')],{'as':_0xf794('0x180'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x3c')][_0xf794('0x10d')](db[_0xf794('0x72')],{'as':'Dispositions','foreignKey':_0xf794('0x181'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x3c')][_0xf794('0x10d')](db[_0xf794('0x70')],{'as':_0xf794('0x168'),'foreignKey':_0xf794('0x181')});db['FaxAccount']['hasMany'](db[_0xf794('0x40')],{'as':_0xf794('0x169')});db[_0xf794('0x3c')][_0xf794('0x10d')](db['FaxApplication'],{'as':'Applications','foreignKey':_0xf794('0x181'),'onDelete':'cascade'});db[_0xf794('0x3c')]['hasMany'](db[_0xf794('0x18')],{'as':'Exntensions','onDelete':_0xf794('0x10b')});db[_0xf794('0x3c')][_0xf794('0x10d')](db[_0xf794('0x42')],{'as':_0xf794('0x159')});db['FaxAccount'][_0xf794('0x119')](db['Trunk'],{'as':'Trunk'});db[_0xf794('0x3c')][_0xf794('0x119')](db[_0xf794('0xef')],{'as':_0xf794('0x17e'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0x3c')][_0xf794('0x119')](db['Pause'],{'as':_0xf794('0x155'),'foreignKey':_0xf794('0x16b')});db[_0xf794('0x3c')]['belongsToMany'](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':_0xf794('0x13c')});db[_0xf794('0x3e')]['belongsTo'](db[_0xf794('0x109')],{'onDelete':_0xf794('0x163')});db[_0xf794('0x3e')][_0xf794('0x119')](db[_0xf794('0x132')],{'onDelete':_0xf794('0x163')});db[_0xf794('0x3e')][_0xf794('0x119')](db[_0xf794('0x3c')],{'onDelete':_0xf794('0x163')});db[_0xf794('0x3e')]['belongsTo'](db['Tag'],{'onDelete':_0xf794('0x163'),'foreignKey':_0xf794('0x182')});db[_0xf794('0x40')]['hasMany'](db['FaxMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf794('0x183')});db[_0xf794('0x40')]['belongsTo'](db[_0xf794('0x3c')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x181')});db[_0xf794('0x40')][_0xf794('0x119')](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db[_0xf794('0x40')][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x184'),'foreignKey':_0xf794('0x10f')});db[_0xf794('0x40')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':_0xf794('0x185'),'as':_0xf794('0x173')});db['FaxInteraction'][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':_0xf794('0x185'),'as':_0xf794('0x175')});db[_0xf794('0x40')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x176'),'through':_0xf794('0x126'),'foreignKey':_0xf794('0x183')});db['FaxMessage'][_0xf794('0x119')](db['User'],{'onDelete':'cascade','as':_0xf794('0x109')});db['FaxMessage'][_0xf794('0x119')](db[_0xf794('0x40')],{'as':'Interaction','foreignKey':_0xf794('0x183')});db[_0xf794('0x42')]['belongsTo'](db[_0xf794('0x64')],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x160')});db[_0xf794('0x42')][_0xf794('0x119')](db[_0xf794('0x178')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xf794('0x42')][_0xf794('0x119')](db['FaxAccount'],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x181')});db[_0xf794('0x132')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':_0xf794('0x133')});db['FaxQueue']['belongsToMany'](db['Team'],{'through':_0xf794('0x186'),'as':_0xf794('0x16e')});db[_0xf794('0x187')][_0xf794('0x119')](db[_0xf794('0x3c')],{});db[_0xf794('0x187')]['belongsTo'](db[_0xf794('0xef')],{'as':'List','foreignKey':_0xf794('0x16a')});db[_0xf794('0x187')]['belongsTo'](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db['FaxQueueReport']['belongsTo'](db[_0xf794('0x40')],{});db[_0xf794('0x187')][_0xf794('0x119')](db['FaxMessage'],{});db[_0xf794('0x187')][_0xf794('0x119')](db[_0xf794('0x109')],{});db[_0xf794('0x187')][_0xf794('0x119')](db[_0xf794('0x132')],{});db[_0xf794('0x46')][_0xf794('0x10d')](db['Disposition'],{'as':_0xf794('0x167'),'foreignKey':_0xf794('0x188'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x46')][_0xf794('0x10d')](db[_0xf794('0x70')],{'as':'Answers','foreignKey':_0xf794('0x188')});db['SmsAccount'][_0xf794('0x10d')](db[_0xf794('0x4c')],{'as':_0xf794('0x159'),'foreignKey':_0xf794('0x188')});db[_0xf794('0x46')][_0xf794('0x10d')](db[_0xf794('0x4a')],{'as':'Interactions'});db[_0xf794('0x46')][_0xf794('0x10d')](db[_0xf794('0x48')],{'as':_0xf794('0x189'),'foreignKey':_0xf794('0x188'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x46')][_0xf794('0x119')](db['CmList'],{'as':'List','foreignKey':_0xf794('0x16a')});db['SmsAccount']['belongsTo'](db[_0xf794('0x78')],{'as':_0xf794('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf794('0x46')]['belongsToMany'](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':_0xf794('0x142')});db[_0xf794('0x48')][_0xf794('0x119')](db[_0xf794('0x109')],{'onDelete':_0xf794('0x163')});db[_0xf794('0x48')][_0xf794('0x119')](db['SmsQueue'],{'onDelete':_0xf794('0x163')});db['SmsApplication'][_0xf794('0x119')](db[_0xf794('0x46')],{'onDelete':'restrict'});db['SmsApplication'][_0xf794('0x119')](db[_0xf794('0x76')],{'onDelete':_0xf794('0x163'),'foreignKey':'IntervalId'});db[_0xf794('0x48')][_0xf794('0x119')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xf794('0x182')});db[_0xf794('0x4a')][_0xf794('0x10d')](db['SmsMessage'],{'as':_0xf794('0x159'),'onDelete':'cascade','foreignKey':_0xf794('0x18a')});db[_0xf794('0x4a')][_0xf794('0x119')](db[_0xf794('0x46')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x188')});db[_0xf794('0x4a')]['belongsTo'](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db[_0xf794('0x4a')]['belongsTo'](db[_0xf794('0x109')],{'as':'Owner','foreignKey':'UserId'});db[_0xf794('0x4a')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':'sms_interaction_has_tags','as':_0xf794('0x173')});db[_0xf794('0x4a')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':'sms_interaction_has_tags','as':_0xf794('0x175')});db[_0xf794('0x4a')]['belongsToMany'](db[_0xf794('0x109')],{'as':'Users','through':_0xf794('0x127'),'foreignKey':_0xf794('0x18a')});db[_0xf794('0x4c')][_0xf794('0x119')](db['User'],{'as':_0xf794('0x109')});db['SmsMessage'][_0xf794('0x119')](db[_0xf794('0x64')],{'onDelete':_0xf794('0x10b'),'as':'Contact'});db['SmsMessage'][_0xf794('0x119')](db['SmsInteraction'],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x17a'),'foreignKey':_0xf794('0x18a')});db[_0xf794('0x4c')]['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0xf794('0x188')});db[_0xf794('0x134')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':_0xf794('0x18b'),'foreignKey':'SmsQueueId'});db[_0xf794('0x134')]['belongsToMany'](db[_0xf794('0xdf')],{'through':'team_has_sms_queues','as':_0xf794('0x16e')});db['OpenchannelAccount'][_0xf794('0x10d')](db[_0xf794('0x72')],{'as':_0xf794('0x167'),'foreignKey':_0xf794('0x18c'),'onDelete':'cascade'});db['OpenchannelAccount'][_0xf794('0x10d')](db[_0xf794('0x70')],{'as':_0xf794('0x168'),'foreignKey':_0xf794('0x18c')});db[_0xf794('0x13f')][_0xf794('0x10d')](db[_0xf794('0x51')],{'as':'Interactions','foreignKey':_0xf794('0x18c')});db[_0xf794('0x13f')][_0xf794('0x10d')](db[_0xf794('0x18d')],{'as':'Messages','foreignKey':_0xf794('0x18c')});db[_0xf794('0x13f')][_0xf794('0x10d')](db[_0xf794('0x50')],{'as':'Applications','foreignKey':_0xf794('0x18c'),'onDelete':'cascade'});db[_0xf794('0x13f')][_0xf794('0x119')](db[_0xf794('0xef')],{'as':'List','foreignKey':_0xf794('0x16a')});db['OpenchannelAccount']['belongsTo'](db[_0xf794('0x78')],{'as':_0xf794('0x155'),'foreignKey':_0xf794('0x16b')});db[_0xf794('0x13f')]['belongsToMany'](db[_0xf794('0x109')],{'as':'Agents','through':_0xf794('0x18e')});db['OpenchannelApplication'][_0xf794('0x119')](db[_0xf794('0x109')],{'onDelete':_0xf794('0x163')});db['OpenchannelApplication'][_0xf794('0x119')](db[_0xf794('0x54')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0xf794('0x50')][_0xf794('0x119')](db[_0xf794('0x13f')],{'onDelete':_0xf794('0x163'),'foreignKey':_0xf794('0x18c')});db['OpenchannelApplication'][_0xf794('0x119')](db[_0xf794('0x76')],{'onDelete':_0xf794('0x163'),'foreignKey':_0xf794('0x154')});db[_0xf794('0x50')][_0xf794('0x119')](db[_0xf794('0x174')],{'onDelete':_0xf794('0x163'),'foreignKey':_0xf794('0x182')});db[_0xf794('0x51')][_0xf794('0x10d')](db[_0xf794('0x18d')],{'as':_0xf794('0x159'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x18f')});db[_0xf794('0x51')][_0xf794('0x119')](db['OpenchannelAccount'],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x18c')});db[_0xf794('0x51')][_0xf794('0x119')](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db['OpenchannelInteraction'][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x184'),'foreignKey':'UserId'});db[_0xf794('0x51')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':_0xf794('0x190'),'as':_0xf794('0x173')});db['OpenchannelInteraction'][_0xf794('0x11e')](db['Tag'],{'through':_0xf794('0x190'),'as':_0xf794('0x175')});db[_0xf794('0x51')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x176'),'through':_0xf794('0x128'),'foreignKey':'OpenchannelInteractionId'});db[_0xf794('0x18d')][_0xf794('0x119')](db[_0xf794('0x109')],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x109')});db[_0xf794('0x18d')][_0xf794('0x119')](db[_0xf794('0x64')],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x160')});db['OpenchannelMessage']['belongsTo'](db[_0xf794('0x51')],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x17a'),'foreignKey':_0xf794('0x18f')});db[_0xf794('0x18d')][_0xf794('0x119')](db['Attachment'],{'as':'Attachment','foreignKey':_0xf794('0x191')});db[_0xf794('0x18d')]['belongsTo'](db[_0xf794('0x13f')],{'as':_0xf794('0x170'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0xf794('0x11e')](db['User'],{'as':_0xf794('0x16c'),'through':_0xf794('0x137'),'foreignKey':_0xf794('0x192')});db[_0xf794('0x54')][_0xf794('0x11e')](db[_0xf794('0xdf')],{'through':_0xf794('0x193'),'as':_0xf794('0x16e')});db['ChatWebsite'][_0xf794('0x10d')](db[_0xf794('0x72')],{'as':_0xf794('0x167'),'foreignKey':_0xf794('0x17b'),'onDelete':_0xf794('0x10b')});db['ChatWebsite']['hasMany'](db[_0xf794('0x70')],{'as':'Answers','foreignKey':_0xf794('0x17b')});db[_0xf794('0x56')]['hasMany'](db[_0xf794('0x60')],{'as':_0xf794('0x194')});db['ChatWebsite'][_0xf794('0x10d')](db[_0xf794('0x5b')],{'as':_0xf794('0x169')});db['ChatWebsite'][_0xf794('0x10d')](db[_0xf794('0x59')],{'as':'Applications','foreignKey':_0xf794('0x17b'),'onDelete':_0xf794('0x10b')});db['ChatWebsite'][_0xf794('0x10d')](db[_0xf794('0x195')],{'as':_0xf794('0x159')});db[_0xf794('0x56')][_0xf794('0x119')](db['CmList'],{'as':_0xf794('0x17e'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0x56')][_0xf794('0x119')](db[_0xf794('0x76')],{'as':'Interval','foreignKey':_0xf794('0x154')});db['ChatWebsite'][_0xf794('0x119')](db[_0xf794('0x13d')],{'as':_0xf794('0x13d'),'foreignKey':'MailAccountId'});db[_0xf794('0x56')][_0xf794('0x119')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xf794('0x16b')});db[_0xf794('0x56')]['belongsToMany'](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xf794('0x119')](db[_0xf794('0x13f')],{});db[_0xf794('0x58')][_0xf794('0x119')](db[_0xf794('0xef')],{'as':_0xf794('0x17e'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0x58')][_0xf794('0x119')](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db['OpenchannelQueueReport']['belongsTo'](db[_0xf794('0x51')],{});db['OpenchannelQueueReport'][_0xf794('0x119')](db[_0xf794('0x18d')],{});db[_0xf794('0x58')][_0xf794('0x119')](db[_0xf794('0x109')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xf794('0x54')],{});db[_0xf794('0x59')][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x196'),'foreignKey':_0xf794('0x10f'),'onDelete':_0xf794('0x163')});db['ChatApplication']['belongsTo'](db[_0xf794('0x5e')],{'as':_0xf794('0x197'),'foreignKey':_0xf794('0x198'),'onDelete':'restrict'});db[_0xf794('0x59')][_0xf794('0x119')](db[_0xf794('0x56')],{'as':_0xf794('0x199'),'foreignKey':_0xf794('0x17b'),'onDelete':_0xf794('0x163')});db['ChatApplication'][_0xf794('0x119')](db[_0xf794('0x174')],{'onDelete':'restrict','foreignKey':_0xf794('0x182')});db[_0xf794('0x5b')][_0xf794('0x10d')](db['ChatMessage'],{'as':_0xf794('0x159'),'onDelete':_0xf794('0x10b'),'foreignKey':'ChatInteractionId'});db[_0xf794('0x5b')]['belongsTo'](db[_0xf794('0x56')],{'as':_0xf794('0x170'),'foreignKey':'ChatWebsiteId'});db[_0xf794('0x5b')][_0xf794('0x119')](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db[_0xf794('0x5b')][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x184'),'foreignKey':'UserId'});db[_0xf794('0x5b')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':_0xf794('0x19a'),'as':_0xf794('0x173')});db[_0xf794('0x5b')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':'chat_interaction_has_tags','as':_0xf794('0x175')});db[_0xf794('0x5b')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':'Users','through':_0xf794('0x124'),'foreignKey':_0xf794('0x19b')});db[_0xf794('0x195')]['belongsTo'](db[_0xf794('0x109')],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x109')});db[_0xf794('0x195')][_0xf794('0x119')](db[_0xf794('0x64')],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db['ChatMessage'][_0xf794('0x119')](db[_0xf794('0x5b')],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x17a'),'foreignKey':_0xf794('0x19b')});db[_0xf794('0x195')][_0xf794('0x119')](db[_0xf794('0x178')],{'as':'Attachment','foreignKey':_0xf794('0x191')});db[_0xf794('0x195')][_0xf794('0x119')](db['ChatWebsite'],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x17b')});db['ChatOfflineMessage'][_0xf794('0x10d')](db[_0xf794('0x178')],{'as':'Attachments','foreignKey':_0xf794('0x19c'),'onDelete':_0xf794('0x10b'),'hooks':!![]});db[_0xf794('0x17c')][_0xf794('0x119')](db[_0xf794('0x64')],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171')});db['ChatOfflineMessage'][_0xf794('0x119')](db['ChatWebsite'],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x17b')});db['ChatQueue'][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xf794('0x11e')](db['Team'],{'through':_0xf794('0x19d'),'as':_0xf794('0x16e')});db[_0xf794('0x5f')][_0xf794('0x10d')](db[_0xf794('0xcb')],{'as':_0xf794('0x159'),'foreignKey':'ChatGroupId','onDelete':_0xf794('0x10b')});db[_0xf794('0x5f')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x149'),'through':_0xf794('0x11d')});db[_0xf794('0x60')]['belongsTo'](db[_0xf794('0x56')],{'as':'Website','foreignKey':_0xf794('0x17b')});db[_0xf794('0x62')]['hasMany'](db[_0xf794('0x64')],{'as':_0xf794('0x11f'),'foreignKey':'CompanyId'});db[_0xf794('0x64')]['hasMany'](db['CmContactHasItem'],{'as':_0xf794('0x19e'),'foreignKey':_0xf794('0x19f')});db[_0xf794('0x64')][_0xf794('0x10d')](db[_0xf794('0x14b')],{'as':_0xf794('0x1a0'),'foreignKey':_0xf794('0x171')});db[_0xf794('0x64')][_0xf794('0x10d')](db[_0xf794('0x111')],{'as':_0xf794('0x112'),'foreignKey':_0xf794('0x171')});db[_0xf794('0x64')][_0xf794('0x10d')](db[_0xf794('0x68')],{'as':_0xf794('0x14c'),'foreignKey':_0xf794('0x171')});db['CmContact'][_0xf794('0x10d')](db['ReportAgentPreview'],{'as':_0xf794('0x69'),'foreignKey':'ContactId'});db[_0xf794('0x64')][_0xf794('0x10d')](db[_0xf794('0x14f')],{'as':_0xf794('0x150'),'foreignKey':'ContactId'});db[_0xf794('0x64')][_0xf794('0x10d')](db[_0xf794('0x51')],{'as':_0xf794('0x113'),'foreignKey':_0xf794('0x171'),'onDelete':_0xf794('0x163')});db['CmContact'][_0xf794('0x10d')](db[_0xf794('0x5b')],{'as':'ChatInteractions','foreignKey':_0xf794('0x171'),'onDelete':'restrict'});db['CmContact'][_0xf794('0x10d')](db[_0xf794('0x4a')],{'as':'SmsInteractions','foreignKey':_0xf794('0x171'),'onDelete':_0xf794('0x163')});db[_0xf794('0x64')][_0xf794('0x10d')](db[_0xf794('0x40')],{'as':_0xf794('0x125'),'foreignKey':_0xf794('0x171'),'onDelete':_0xf794('0x163')});db[_0xf794('0x64')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xf794('0x171'),'onDelete':_0xf794('0x163')});db[_0xf794('0x64')][_0xf794('0x119')](db[_0xf794('0x62')],{'as':_0xf794('0x1a1'),'foreignKey':_0xf794('0x1a2')});db['CmContact'][_0xf794('0x119')](db['CmList'],{'as':_0xf794('0x17e'),'foreignKey':_0xf794('0x16a'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x64')]['belongsToMany'](db['User'],{'as':_0xf794('0x176'),'through':_0xf794('0x120')});db[_0xf794('0x64')][_0xf794('0x11e')](db[_0xf794('0x174')],{'as':_0xf794('0x173'),'through':_0xf794('0x1a3')});db['CmContact']['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xf794('0x14b')][_0xf794('0x10d')](db['CmHopperAdditionalPhone'],{'as':_0xf794('0x1a4'),'foreignKey':_0xf794('0x1a5')});db[_0xf794('0x14b')][_0xf794('0x119')](db[_0xf794('0x64')],{'as':_0xf794('0x160'),'foreignKey':_0xf794('0x171'),'onDelete':'cascade'});db[_0xf794('0x14b')][_0xf794('0x119')](db[_0xf794('0xef')],{'as':'List','foreignKey':_0xf794('0x16a'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x14b')][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x196'),'foreignKey':_0xf794('0x10f')});db['CmHopper'][_0xf794('0x119')](db[_0xf794('0x12a')],{'as':_0xf794('0x197'),'foreignKey':_0xf794('0x14a'),'onDelete':'cascade'});db[_0xf794('0x14b')][_0xf794('0x119')](db[_0xf794('0xe2')],{'as':_0xf794('0xe2'),'foreignKey':_0xf794('0x1a6'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x14b')][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x184'),'foreignKey':_0xf794('0x1a7')});db['CmHopperBlack'][_0xf794('0x119')](db[_0xf794('0x64')],{'as':'Contact','foreignKey':_0xf794('0x171'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x14d')][_0xf794('0x119')](db[_0xf794('0xef')],{'as':'List','foreignKey':_0xf794('0x16a'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x14d')]['belongsTo'](db[_0xf794('0x12a')],{'as':_0xf794('0x197'),'foreignKey':_0xf794('0x14a'),'onDelete':_0xf794('0x10b')});db['CmHopperBlack']['belongsTo'](db[_0xf794('0xe2')],{'as':'Campaign','foreignKey':_0xf794('0x1a6'),'onDelete':'cascade'});db[_0xf794('0x6e')][_0xf794('0x10d')](db[_0xf794('0x74')],{'as':{'plural':_0xf794('0x1a8'),'singular':'OneAll'},'foreignKey':_0xf794('0x1a9'),'onDelete':_0xf794('0x10b'),'hooks':!![]});db[_0xf794('0x6e')][_0xf794('0x10d')](db[_0xf794('0x74')],{'as':{'plural':_0xf794('0x1aa'),'singular':_0xf794('0x1ab')},'foreignKey':_0xf794('0x1ac'),'onDelete':_0xf794('0x10b'),'hooks':!![]});db['Automation'][_0xf794('0x10d')](db['Action'],{'as':_0xf794('0x1ad'),'foreignKey':_0xf794('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0xf794('0x72')]['hasMany'](db['Disposition'],{'as':_0xf794('0x167'),'foreignKey':_0xf794('0x1af'),'onDelete':'cascade'});db[_0xf794('0x76')][_0xf794('0x10d')](db[_0xf794('0x76')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xf794('0x10b'),'hooks':!![],'required':![]});db[_0xf794('0x76')][_0xf794('0x10d')](db['VoiceExtension'],{'as':_0xf794('0x110'),'foreignKey':_0xf794('0x154'),'onDelete':_0xf794('0x163')});db[_0xf794('0x76')]['hasMany'](db[_0xf794('0x38')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xf794('0x76')][_0xf794('0x10d')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0xf794('0x154')});db[_0xf794('0x76')][_0xf794('0x10d')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0xf794('0x76')][_0xf794('0x10d')](db[_0xf794('0x48')],{'as':_0xf794('0x1b0'),'foreignKey':_0xf794('0x154')});db[_0xf794('0x7e')][_0xf794('0x119')](db[_0xf794('0x13d')],{});db[_0xf794('0x7e')][_0xf794('0x119')](db[_0xf794('0x91')],{'foreignKey':'DefaultReportId'});db[_0xf794('0x7e')]['belongsTo'](db[_0xf794('0x8f')],{'foreignKey':_0xf794('0x1b1')});db[_0xf794('0x7f')][_0xf794('0x11e')](db['VoiceMusicOnHold'],{'as':_0xf794('0x1b2'),'through':_0xf794('0x1b3'),'onDelete':'restrict'});db['Tag']['belongsToMany'](db[_0xf794('0x64')],{'through':'cm_contact_has_tags'});db[_0xf794('0x174')][_0xf794('0x11e')](db[_0xf794('0x5b')],{'through':_0xf794('0x19a')});db[_0xf794('0x174')]['belongsToMany'](db[_0xf794('0x115')],{'through':_0xf794('0x172')});db[_0xf794('0x174')][_0xf794('0x11e')](db['SmsInteraction'],{'through':_0xf794('0x1b4')});db['Tag'][_0xf794('0x11e')](db[_0xf794('0x40')],{'through':_0xf794('0x185')});db[_0xf794('0x174')][_0xf794('0x11e')](db[_0xf794('0x51')],{'through':_0xf794('0x190')});db[_0xf794('0x174')]['belongsToMany'](db[_0xf794('0xf8')],{'through':'whatsapp_interaction_has_tags'});db[_0xf794('0x84')][_0xf794('0x119')](db[_0xf794('0x82')],{'as':_0xf794('0x1b5'),'foreignKey':_0xf794('0x1b6')});db[_0xf794('0x1b7')][_0xf794('0x119')](db[_0xf794('0x14b')],{'as':_0xf794('0x1b8'),'foreignKey':_0xf794('0x1a5')});db[_0xf794('0x84')][_0xf794('0x119')](db['CmContact'],{'as':'Contact','foreignKey':_0xf794('0x19f')});db[_0xf794('0x88')]['hasMany'](db[_0xf794('0x74')],{'as':{'plural':_0xf794('0x1b9'),'singular':_0xf794('0x1ba')},'foreignKey':'TriggerAllId','onDelete':_0xf794('0x10b'),'hooks':!![]});db[_0xf794('0x88')][_0xf794('0x10d')](db[_0xf794('0x74')],{'as':{'plural':_0xf794('0x1bb'),'singular':'AnyCondition'},'foreignKey':_0xf794('0x1bc'),'onDelete':_0xf794('0x10b'),'hooks':!![]});db[_0xf794('0x88')][_0xf794('0x10d')](db[_0xf794('0x6d')],{'as':_0xf794('0x1ad'),'foreignKey':'TriggerId','onDelete':_0xf794('0x10b'),'hooks':!![]});db[_0xf794('0x8f')][_0xf794('0x10d')](db[_0xf794('0x97')],{'as':_0xf794('0x1bd'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1b1'),'hooks':!![]});db[_0xf794('0x91')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xf794('0x1bd'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1be')});db['AnalyticMetric'][_0xf794('0x10d')](db[_0xf794('0x97')],{'as':_0xf794('0x1bd'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0xf794('0x97')][_0xf794('0x119')](db[_0xf794('0x95')],{'foreignKey':_0xf794('0x1bf')});db[_0xf794('0x9b')][_0xf794('0x10d')](db['SalesforceConfiguration'],{'as':_0xf794('0x1c0'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c1')});db['SalesforceConfiguration'][_0xf794('0x10d')](db[_0xf794('0x9d')],{'as':_0xf794('0x1c2'),'onDelete':'cascade','foreignKey':_0xf794('0x1c3')});db[_0xf794('0x1c4')][_0xf794('0x10d')](db['SalesforceField'],{'as':_0xf794('0x1c5'),'onDelete':'cascade','foreignKey':_0xf794('0x1c6')});db['SalesforceConfiguration'][_0xf794('0x10d')](db[_0xf794('0x9d')],{'as':_0xf794('0x1bd'),'onDelete':'cascade','foreignKey':_0xf794('0x1c7')});db[_0xf794('0x1c4')]['belongsTo'](db[_0xf794('0x9b')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0x9d')][_0xf794('0x10d')](db['SalesforceField'],{'as':_0xf794('0x1c8'),'foreignKey':'SubjectId'});db[_0xf794('0x9d')][_0xf794('0x10d')](db[_0xf794('0x9d')],{'as':_0xf794('0x1c9'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0xf794('0x10d')](db[_0xf794('0x9d')],{'as':_0xf794('0x1ca'),'foreignKey':_0xf794('0x1c7')});db['SalesforceField']['belongsTo'](db[_0xf794('0x89')],{'as':'Variable','foreignKey':_0xf794('0x1cb')});db['SugarcrmAccount'][_0xf794('0x10d')](db[_0xf794('0xa0')],{'as':'Configurations','onDelete':_0xf794('0x10b'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0xf794('0x10d')](db[_0xf794('0xa1')],{'as':_0xf794('0x1c2'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c3')});db[_0xf794('0xa0')]['hasMany'](db[_0xf794('0xa1')],{'as':_0xf794('0x1c5'),'onDelete':'cascade','foreignKey':_0xf794('0x1c6')});db[_0xf794('0xa0')]['hasMany'](db[_0xf794('0xa1')],{'as':'Fields','onDelete':_0xf794('0x10b'),'foreignKey':'FieldId'});db[_0xf794('0xa0')][_0xf794('0x119')](db[_0xf794('0x1cc')],{'as':'Account','foreignKey':_0xf794('0x1c1')});db[_0xf794('0xa1')][_0xf794('0x10d')](db[_0xf794('0xa1')],{'as':_0xf794('0x1c8'),'foreignKey':_0xf794('0x1c3')});db['SugarcrmField'][_0xf794('0x10d')](db[_0xf794('0xa1')],{'as':_0xf794('0x1c9'),'foreignKey':_0xf794('0x1c6')});db[_0xf794('0xa1')]['hasMany'](db['SugarcrmField'],{'as':_0xf794('0x1ca'),'foreignKey':_0xf794('0x1c7')});db[_0xf794('0xa1')][_0xf794('0x119')](db[_0xf794('0x89')],{'as':'Variable','foreignKey':'VariableId'});db[_0xf794('0xa3')][_0xf794('0x10d')](db[_0xf794('0xa5')],{'as':_0xf794('0x1c0'),'onDelete':'cascade','foreignKey':_0xf794('0x1c1')});db[_0xf794('0xa5')][_0xf794('0x10d')](db[_0xf794('0xa7')],{'as':_0xf794('0x1c2'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c3')});db['DeskConfiguration']['hasMany'](db[_0xf794('0xa7')],{'as':_0xf794('0x1c5'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c6')});db[_0xf794('0xa5')][_0xf794('0x10d')](db[_0xf794('0xa7')],{'as':_0xf794('0x1bd'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c7')});db[_0xf794('0xa5')][_0xf794('0x119')](db[_0xf794('0xa3')],{'as':_0xf794('0x170'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xf794('0x11e')](db['Tag'],{'through':_0xf794('0x1cd')});db[_0xf794('0xa7')][_0xf794('0x10d')](db[_0xf794('0xa7')],{'as':_0xf794('0x1c8'),'foreignKey':_0xf794('0x1c3')});db[_0xf794('0xa7')]['hasMany'](db[_0xf794('0xa7')],{'as':'Description','foreignKey':'DescriptionId'});db['DeskField']['hasMany'](db[_0xf794('0xa7')],{'as':_0xf794('0x1ca'),'foreignKey':_0xf794('0x1c7')});db[_0xf794('0xa7')][_0xf794('0x119')](db[_0xf794('0x89')],{'as':_0xf794('0x89'),'foreignKey':'VariableId'});db[_0xf794('0xa9')][_0xf794('0x10d')](db[_0xf794('0xab')],{'as':_0xf794('0x1c0'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0xab')][_0xf794('0x10d')](db[_0xf794('0xad')],{'as':'Subjects','onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c3')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xf794('0x1c6')});db[_0xf794('0xab')][_0xf794('0x10d')](db[_0xf794('0xad')],{'as':_0xf794('0x1bd'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c7')});db[_0xf794('0xab')]['belongsTo'](db[_0xf794('0xa9')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0xad')][_0xf794('0x10d')](db['ZohoField'],{'as':_0xf794('0x1c8'),'foreignKey':_0xf794('0x1c3')});db['ZohoField'][_0xf794('0x10d')](db['ZohoField'],{'as':'Description','foreignKey':_0xf794('0x1c6')});db[_0xf794('0xad')]['hasMany'](db['ZohoField'],{'as':_0xf794('0x1ca'),'foreignKey':'FieldId'});db['ZohoField'][_0xf794('0x119')](db[_0xf794('0x89')],{'as':_0xf794('0x89'),'foreignKey':_0xf794('0x1cb')});db['ZendeskAccount'][_0xf794('0x10d')](db[_0xf794('0xb1')],{'as':_0xf794('0x1c0'),'onDelete':'cascade','foreignKey':_0xf794('0x1c1')});db[_0xf794('0xb1')][_0xf794('0x10d')](db[_0xf794('0xb3')],{'as':_0xf794('0x1c2'),'foreignKey':_0xf794('0x1c3')});db[_0xf794('0xb1')][_0xf794('0x10d')](db[_0xf794('0xb3')],{'as':_0xf794('0x1c5'),'foreignKey':_0xf794('0x1c6')});db[_0xf794('0xb1')][_0xf794('0x10d')](db['ZendeskField'],{'as':_0xf794('0x1bd'),'foreignKey':_0xf794('0x1c7')});db[_0xf794('0xb1')]['belongsTo'](db['ZendeskAccount'],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0xb1')][_0xf794('0x11e')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0xf794('0xb3')]['hasMany'](db[_0xf794('0xb3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf794('0xb3')][_0xf794('0x10d')](db[_0xf794('0xb3')],{'as':'Description','foreignKey':_0xf794('0x1c6')});db[_0xf794('0xb3')][_0xf794('0x10d')](db[_0xf794('0xb3')],{'as':'Field','foreignKey':_0xf794('0x1c7')});db[_0xf794('0xb3')]['belongsTo'](db[_0xf794('0x89')],{'as':_0xf794('0x89'),'foreignKey':_0xf794('0x1cb')});db[_0xf794('0xb5')][_0xf794('0x10d')](db[_0xf794('0x1ce')],{'as':_0xf794('0x1c0'),'onDelete':'cascade','foreignKey':_0xf794('0x1c1')});db['FreshdeskConfiguration'][_0xf794('0x10d')](db[_0xf794('0xb7')],{'as':_0xf794('0x1c2'),'onDelete':'cascade','foreignKey':_0xf794('0x1c3')});db[_0xf794('0x1ce')][_0xf794('0x10d')](db[_0xf794('0xb7')],{'as':'Descriptions','onDelete':_0xf794('0x10b'),'foreignKey':'DescriptionId'});db[_0xf794('0x1ce')][_0xf794('0x10d')](db[_0xf794('0xb7')],{'as':_0xf794('0x1bd'),'onDelete':'cascade','foreignKey':_0xf794('0x1c7')});db[_0xf794('0x1ce')][_0xf794('0x119')](db[_0xf794('0xb5')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0x1ce')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':_0xf794('0x1cf')});db[_0xf794('0xb7')][_0xf794('0x10d')](db[_0xf794('0xb7')],{'as':_0xf794('0x1c8'),'foreignKey':'SubjectId'});db[_0xf794('0xb7')]['hasMany'](db['FreshdeskField'],{'as':_0xf794('0x1c9'),'foreignKey':_0xf794('0x1c6')});db[_0xf794('0xb7')][_0xf794('0x10d')](db[_0xf794('0xb7')],{'as':_0xf794('0x1ca'),'foreignKey':'FieldId'});db[_0xf794('0xb7')]['belongsTo'](db[_0xf794('0x89')],{'as':_0xf794('0x89'),'foreignKey':_0xf794('0x1cb')});db[_0xf794('0x1d0')][_0xf794('0x10d')](db[_0xf794('0xba')],{'as':_0xf794('0x1c0'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0xba')][_0xf794('0x10d')](db[_0xf794('0xbc')],{'as':_0xf794('0x1c2'),'foreignKey':_0xf794('0x1c3')});db[_0xf794('0xba')][_0xf794('0x10d')](db['VtigerField'],{'as':_0xf794('0x1c5'),'foreignKey':_0xf794('0x1c6')});db[_0xf794('0xba')]['hasMany'](db[_0xf794('0xbc')],{'as':'Fields','foreignKey':'FieldId'});db['VtigerConfiguration']['belongsTo'](db[_0xf794('0x1d0')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0xbc')][_0xf794('0x10d')](db[_0xf794('0xbc')],{'as':_0xf794('0x1c8'),'foreignKey':'SubjectId'});db[_0xf794('0xbc')][_0xf794('0x10d')](db[_0xf794('0xbc')],{'as':_0xf794('0x1c9'),'foreignKey':_0xf794('0x1c6')});db[_0xf794('0xbc')][_0xf794('0x10d')](db[_0xf794('0xbc')],{'as':_0xf794('0x1ca'),'foreignKey':'FieldId'});db[_0xf794('0xbc')][_0xf794('0x119')](db[_0xf794('0x89')],{'as':_0xf794('0x89'),'foreignKey':_0xf794('0x1cb')});db[_0xf794('0x1d1')]['hasMany'](db[_0xf794('0x1d2')],{'as':_0xf794('0x1c0'),'onDelete':'cascade','foreignKey':_0xf794('0x1c1')});db[_0xf794('0x1d2')]['hasMany'](db['ServicenowField'],{'as':_0xf794('0x1c2'),'foreignKey':'SubjectId'});db[_0xf794('0x1d2')][_0xf794('0x10d')](db['ServicenowField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xf794('0x10d')](db[_0xf794('0x1d3')],{'as':'Fields','foreignKey':_0xf794('0x1c7')});db[_0xf794('0x1d2')][_0xf794('0x119')](db['ServicenowAccount'],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0x1d3')][_0xf794('0x10d')](db['ServicenowField'],{'as':'Subject','foreignKey':'SubjectId'});db['ServicenowField'][_0xf794('0x10d')](db[_0xf794('0x1d3')],{'as':'Description','foreignKey':_0xf794('0x1c6')});db[_0xf794('0x1d3')][_0xf794('0x10d')](db[_0xf794('0x1d3')],{'as':_0xf794('0x1ca'),'foreignKey':_0xf794('0x1c7')});db[_0xf794('0x1d3')][_0xf794('0x119')](db[_0xf794('0x89')],{'as':_0xf794('0x89'),'foreignKey':_0xf794('0x1cb')});db[_0xf794('0xbe')][_0xf794('0x10d')](db[_0xf794('0x1d4')],{'as':_0xf794('0x1c0'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0xbe')][_0xf794('0x119')](db['CloudProvider'],{'as':_0xf794('0x102'),'foreignKey':_0xf794('0x162')});db[_0xf794('0x1d4')]['hasMany'](db[_0xf794('0x1d5')],{'as':_0xf794('0x1c2'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c3')});db['Dynamics365Configuration'][_0xf794('0x10d')](db[_0xf794('0x1d5')],{'as':_0xf794('0x1c5'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c6')});db['Dynamics365Configuration']['hasMany'](db[_0xf794('0x1d5')],{'as':'Fields','onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c7')});db[_0xf794('0x1d4')][_0xf794('0x119')](db[_0xf794('0xbe')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0x1d5')][_0xf794('0x10d')](db[_0xf794('0x1d5')],{'as':_0xf794('0x1c8'),'foreignKey':_0xf794('0x1c3')});db[_0xf794('0x1d5')][_0xf794('0x10d')](db[_0xf794('0x1d5')],{'as':_0xf794('0x1c9'),'foreignKey':'DescriptionId'});db[_0xf794('0x1d5')][_0xf794('0x10d')](db[_0xf794('0x1d5')],{'as':_0xf794('0x1ca'),'foreignKey':_0xf794('0x1c7')});db[_0xf794('0x1d5')][_0xf794('0x119')](db[_0xf794('0x89')],{'as':_0xf794('0x89'),'foreignKey':_0xf794('0x1cb')});db[_0xf794('0xc2')][_0xf794('0x10d')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0xc4')][_0xf794('0x10d')](db[_0xf794('0xc6')],{'as':_0xf794('0x1c2'),'foreignKey':_0xf794('0x1c3')});db[_0xf794('0xc4')][_0xf794('0x10d')](db[_0xf794('0xc6')],{'as':_0xf794('0x1c5'),'foreignKey':_0xf794('0x1c6')});db[_0xf794('0xc4')][_0xf794('0x10d')](db[_0xf794('0xc6')],{'as':_0xf794('0x1bd'),'foreignKey':'FieldId'});db[_0xf794('0xc4')][_0xf794('0x119')](db['FreshsalesAccount'],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1c1')});db[_0xf794('0xc6')][_0xf794('0x10d')](db['FreshsalesField'],{'as':_0xf794('0x1c8'),'foreignKey':'SubjectId'});db['FreshsalesField'][_0xf794('0x10d')](db[_0xf794('0xc6')],{'as':_0xf794('0x1c9'),'foreignKey':_0xf794('0x1c6')});db[_0xf794('0xc6')][_0xf794('0x10d')](db['FreshsalesField'],{'as':_0xf794('0x1ca'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xf794('0x119')](db[_0xf794('0x89')],{'as':_0xf794('0x89'),'foreignKey':_0xf794('0x1cb')});db[_0xf794('0xc9')][_0xf794('0x119')](db[_0xf794('0x56')],{});db[_0xf794('0xc9')]['belongsTo'](db[_0xf794('0xef')],{'as':_0xf794('0x17e'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0xc9')]['belongsTo'](db[_0xf794('0x64')],{'as':'Contact','foreignKey':_0xf794('0x171')});db[_0xf794('0xc9')][_0xf794('0x119')](db[_0xf794('0x5b')],{});db[_0xf794('0xc9')][_0xf794('0x119')](db[_0xf794('0x195')],{});db[_0xf794('0xc9')][_0xf794('0x119')](db[_0xf794('0x109')],{});db[_0xf794('0xc9')][_0xf794('0x119')](db['ChatQueue'],{});db[_0xf794('0xcb')][_0xf794('0x119')](db[_0xf794('0x109')],{'onDelete':'cascade','foreignKey':_0xf794('0x1d6')});db[_0xf794('0xcb')][_0xf794('0x119')](db[_0xf794('0x109')],{'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x1d7')});db[_0xf794('0x14f')]['hasMany'](db[_0xf794('0xcf')],{'foreignKey':_0xf794('0x1d8'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x14f')]['hasMany'](db[_0xf794('0xcd')],{'foreignKey':_0xf794('0x1d8'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x1d9')][_0xf794('0x119')](db['SmsAccount'],{});db[_0xf794('0x1d9')][_0xf794('0x119')](db[_0xf794('0xef')],{'as':'List','foreignKey':_0xf794('0x16a')});db[_0xf794('0x1d9')][_0xf794('0x119')](db[_0xf794('0x64')],{'as':'Contact','foreignKey':_0xf794('0x171')});db['SmsQueueReport'][_0xf794('0x119')](db[_0xf794('0x4a')],{});db['SmsQueueReport'][_0xf794('0x119')](db[_0xf794('0x4c')],{});db[_0xf794('0x1d9')][_0xf794('0x119')](db[_0xf794('0x109')],{});db[_0xf794('0x1d9')][_0xf794('0x119')](db[_0xf794('0x134')],{});db['JscriptyProject'][_0xf794('0x10d')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0xf794('0x1da')][_0xf794('0x10d')](db[_0xf794('0xcf')],{'foreignKey':_0xf794('0x1db')});db[_0xf794('0x1da')][_0xf794('0x10d')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0xf794('0xd9')]['belongsToMany'](db['User'],{'as':_0xf794('0x176'),'through':_0xf794('0x1dc')});db[_0xf794('0xdf')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':_0xf794('0x1dd')});db[_0xf794('0xdf')][_0xf794('0x11e')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0xf794('0x1de')});db['Team']['belongsToMany'](db[_0xf794('0x33')],{'through':'team_has_mail_queues','as':_0xf794('0x12f')});db[_0xf794('0xdf')][_0xf794('0x11e')](db[_0xf794('0x5e')],{'through':'team_has_chat_queues','as':_0xf794('0x131')});db[_0xf794('0xdf')][_0xf794('0x11e')](db[_0xf794('0x132')],{'through':'team_has_fax_queues','as':_0xf794('0x1df')});db['Team'][_0xf794('0x11e')](db['SmsQueue'],{'through':_0xf794('0x1e0'),'as':'SmsQueues'});db[_0xf794('0xdf')][_0xf794('0x11e')](db[_0xf794('0x54')],{'through':_0xf794('0x193'),'as':'OpenchannelQueues'});db['Team'][_0xf794('0x11e')](db[_0xf794('0x100')],{'through':_0xf794('0x1e1'),'as':_0xf794('0x138')});db[_0xf794('0xdf')][_0xf794('0x11e')](db['VoicePrefix'],{'through':_0xf794('0x105'),'as':_0xf794('0x12d')});db[_0xf794('0xe2')][_0xf794('0x10d')](db[_0xf794('0x14b')],{'as':_0xf794('0x1a0'),'foreignKey':_0xf794('0x1a6')});db['Campaign'][_0xf794('0x10d')](db[_0xf794('0x111')],{'as':_0xf794('0x112'),'foreignKey':'CampaignId'});db[_0xf794('0xe2')][_0xf794('0x10d')](db[_0xf794('0x68')],{'as':_0xf794('0x14c'),'foreignKey':_0xf794('0x1a6')});db[_0xf794('0xe2')]['hasMany'](db[_0xf794('0x14d')],{'as':_0xf794('0x14e'),'foreignKey':_0xf794('0x1a6')});db[_0xf794('0xe2')][_0xf794('0x119')](db[_0xf794('0x27')],{'as':_0xf794('0x27'),'foreignKey':_0xf794('0x151')});db[_0xf794('0xe2')][_0xf794('0x119')](db[_0xf794('0x27')],{'as':_0xf794('0x152'),'foreignKey':'TrunkBackupId'});db[_0xf794('0xe2')][_0xf794('0x119')](db[_0xf794('0x76')],{'as':_0xf794('0x76'),'foreignKey':_0xf794('0x154')});db[_0xf794('0xe2')]['belongsTo'](db[_0xf794('0xd9')],{'as':_0xf794('0xd9'),'foreignKey':_0xf794('0x1e2')});db[_0xf794('0xe2')]['belongsToMany'](db[_0xf794('0xef')],{'as':_0xf794('0x121'),'through':_0xf794('0x1e3')});db['Campaign']['belongsToMany'](db[_0xf794('0xef')],{'as':_0xf794('0x1e4'),'through':_0xf794('0x1e5')});db[_0xf794('0x178')][_0xf794('0x119')](db['ChatOfflineMessage'],{'as':_0xf794('0x17c'),'foreignKey':_0xf794('0x19c')});db[_0xf794('0x1e6')][_0xf794('0x119')](db['MailMessage'],{});db[_0xf794('0x1e6')][_0xf794('0x119')](db['MailInteraction'],{});db[_0xf794('0x1e6')][_0xf794('0x119')](db[_0xf794('0x13d')],{'foreignKey':_0xf794('0x1e7'),'as':_0xf794('0x1e8')});db[_0xf794('0x1e6')][_0xf794('0x119')](db[_0xf794('0x109')],{'foreignKey':_0xf794('0x1e9'),'as':_0xf794('0x1ea')});db[_0xf794('0x1e6')][_0xf794('0x119')](db[_0xf794('0x109')],{'foreignKey':'ToUserId','as':_0xf794('0x1eb')});db['MailTransferReport'][_0xf794('0x119')](db['MailQueue'],{'foreignKey':_0xf794('0x1ec'),'as':_0xf794('0x1ed')});db[_0xf794('0x1e6')]['belongsTo'](db[_0xf794('0x13d')],{'foreignKey':_0xf794('0x1ee'),'as':_0xf794('0x1ef')});db[_0xf794('0xe8')][_0xf794('0x119')](db['ChatMessage'],{});db[_0xf794('0xe8')][_0xf794('0x119')](db[_0xf794('0x5b')],{});db[_0xf794('0xe8')]['belongsTo'](db[_0xf794('0x56')],{'foreignKey':'FromChatWebsiteId','as':_0xf794('0x1e8')});db[_0xf794('0xe8')][_0xf794('0x119')](db[_0xf794('0x109')],{'foreignKey':_0xf794('0x1e9'),'as':_0xf794('0x1ea')});db[_0xf794('0xe8')]['belongsTo'](db[_0xf794('0x109')],{'foreignKey':_0xf794('0x1f0'),'as':_0xf794('0x1eb')});db[_0xf794('0xe8')][_0xf794('0x119')](db[_0xf794('0x5e')],{'foreignKey':'ToChatQueueId','as':_0xf794('0x1ed')});db[_0xf794('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xf794('0x1f1'),'as':_0xf794('0x1ef')});db[_0xf794('0xe9')]['belongsTo'](db[_0xf794('0x42')],{});db['FaxTransferReport']['belongsTo'](db[_0xf794('0x40')],{});db[_0xf794('0xe9')]['belongsTo'](db[_0xf794('0x3c')],{'foreignKey':_0xf794('0x1f2'),'as':'FromAccount'});db[_0xf794('0xe9')][_0xf794('0x119')](db[_0xf794('0x109')],{'foreignKey':_0xf794('0x1e9'),'as':'FromAgent'});db[_0xf794('0xe9')][_0xf794('0x119')](db['User'],{'foreignKey':_0xf794('0x1f0'),'as':_0xf794('0x1eb')});db['FaxTransferReport'][_0xf794('0x119')](db[_0xf794('0x132')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0xf794('0xe9')]['belongsTo'](db[_0xf794('0x3c')],{'foreignKey':'ToFaxAccountId','as':_0xf794('0x1ef')});db['OpenchannelTransferReport'][_0xf794('0x119')](db[_0xf794('0x18d')],{});db[_0xf794('0xeb')][_0xf794('0x119')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0xf794('0x119')](db[_0xf794('0x13f')],{'foreignKey':_0xf794('0x1f3'),'as':_0xf794('0x1e8')});db[_0xf794('0xeb')][_0xf794('0x119')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db['OpenchannelTransferReport'][_0xf794('0x119')](db[_0xf794('0x109')],{'foreignKey':_0xf794('0x1f0'),'as':_0xf794('0x1eb')});db[_0xf794('0xeb')][_0xf794('0x119')](db[_0xf794('0x54')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0xf794('0xeb')][_0xf794('0x119')](db[_0xf794('0x13f')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xf794('0x119')](db['SmsMessage'],{});db[_0xf794('0xed')][_0xf794('0x119')](db[_0xf794('0x4a')],{});db[_0xf794('0xed')]['belongsTo'](db[_0xf794('0x46')],{'foreignKey':_0xf794('0x1f4'),'as':_0xf794('0x1e8')});db[_0xf794('0xed')]['belongsTo'](db[_0xf794('0x109')],{'foreignKey':_0xf794('0x1e9'),'as':_0xf794('0x1ea')});db['SmsTransferReport'][_0xf794('0x119')](db['User'],{'foreignKey':_0xf794('0x1f0'),'as':_0xf794('0x1eb')});db[_0xf794('0xed')][_0xf794('0x119')](db[_0xf794('0x134')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport'][_0xf794('0x119')](db['SmsAccount'],{'foreignKey':_0xf794('0x1f5'),'as':_0xf794('0x1ef')});db[_0xf794('0xef')]['hasMany'](db['Disposition'],{'as':_0xf794('0x167'),'foreignKey':_0xf794('0x16a'),'onDelete':_0xf794('0x10b')});db[_0xf794('0xef')][_0xf794('0x10d')](db[_0xf794('0x6b')],{'as':_0xf794('0x1f6'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0xef')]['hasMany'](db[_0xf794('0x64')],{'as':_0xf794('0x11f'),'onDelete':_0xf794('0x10b'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0xef')]['hasMany'](db[_0xf794('0x111')],{'as':_0xf794('0x112'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0xef')][_0xf794('0x10d')](db[_0xf794('0x68')],{'as':_0xf794('0x1f7'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0xef')][_0xf794('0x10d')](db['ReportAgentPreview'],{'as':_0xf794('0x69'),'foreignKey':_0xf794('0x16a')});db['CmList'][_0xf794('0x11e')](db[_0xf794('0x12a')],{'as':_0xf794('0x1f8'),'through':'voice_queues_has_cm_lists'});db[_0xf794('0xef')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':'Agents','through':_0xf794('0x122')});db[_0xf794('0x12c')][_0xf794('0x10d')](db[_0xf794('0x18')],{'as':'Extensions','onDelete':_0xf794('0x10b')});db[_0xf794('0x12c')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':'UserVoicePrefix'});db['VoicePrefix'][_0xf794('0x11e')](db[_0xf794('0xdf')],{'through':_0xf794('0x105'),'as':'Teams'});db[_0xf794('0x11a')][_0xf794('0x10d')](db['User'],{'as':'Users','foreignKey':_0xf794('0x11b')});db[_0xf794('0x11a')]['hasMany'](db[_0xf794('0xf2')],{'as':_0xf794('0x1f9'),'foreignKey':_0xf794('0x11b'),'onDelete':_0xf794('0x10b')});db[_0xf794('0xf2')][_0xf794('0x10d')](db[_0xf794('0xf4')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0xf794('0x10b')});db['WhatsappAccount']['hasMany'](db[_0xf794('0x72')],{'as':'Dispositions','foreignKey':_0xf794('0x1fa'),'onDelete':_0xf794('0x10b')});db[_0xf794('0x143')][_0xf794('0x10d')](db[_0xf794('0x70')],{'as':_0xf794('0x168'),'foreignKey':_0xf794('0x1fa')});db[_0xf794('0x143')][_0xf794('0x10d')](db['WhatsappMessage'],{'as':_0xf794('0x159'),'foreignKey':_0xf794('0x1fa')});db['WhatsappAccount'][_0xf794('0x10d')](db['WhatsappInteraction'],{'as':_0xf794('0x169')});db['WhatsappAccount'][_0xf794('0x10d')](db['WhatsappApplication'],{'as':_0xf794('0x189'),'foreignKey':_0xf794('0x1fa'),'onDelete':_0xf794('0x10b')});db['WhatsappAccount'][_0xf794('0x119')](db[_0xf794('0xef')],{'as':_0xf794('0x17e'),'foreignKey':_0xf794('0x16a')});db[_0xf794('0x143')][_0xf794('0x119')](db[_0xf794('0x78')],{'as':'mandatoryDispositionPause','foreignKey':_0xf794('0x16b')});db[_0xf794('0x143')][_0xf794('0x11e')](db[_0xf794('0x109')],{'as':_0xf794('0x16c'),'through':_0xf794('0x145')});db['WhatsappApplication'][_0xf794('0x119')](db[_0xf794('0x109')],{'onDelete':_0xf794('0x163')});db[_0xf794('0x1fb')][_0xf794('0x119')](db[_0xf794('0x100')],{'onDelete':_0xf794('0x163')});db[_0xf794('0x1fb')][_0xf794('0x119')](db[_0xf794('0x143')],{'onDelete':'restrict'});db[_0xf794('0x1fb')][_0xf794('0x119')](db[_0xf794('0x76')],{'onDelete':'restrict','foreignKey':_0xf794('0x154')});db[_0xf794('0x1fb')][_0xf794('0x119')](db[_0xf794('0x174')],{'onDelete':_0xf794('0x163'),'foreignKey':'TagId'});db['WhatsappInteraction'][_0xf794('0x10d')](db[_0xf794('0xfa')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf794('0x1fc')});db['WhatsappInteraction']['belongsTo'](db[_0xf794('0x143')],{'as':'Account','foreignKey':_0xf794('0x1fa')});db[_0xf794('0xf8')][_0xf794('0x119')](db[_0xf794('0x64')],{'as':'Contact','foreignKey':_0xf794('0x171')});db[_0xf794('0xf8')][_0xf794('0x119')](db[_0xf794('0x109')],{'as':_0xf794('0x184'),'foreignKey':_0xf794('0x10f')});db[_0xf794('0xf8')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':_0xf794('0x1fd'),'as':_0xf794('0x173')});db[_0xf794('0xf8')][_0xf794('0x11e')](db[_0xf794('0x174')],{'through':_0xf794('0x1fd'),'as':'ThroughTags'});db[_0xf794('0xf8')]['belongsToMany'](db[_0xf794('0x109')],{'as':_0xf794('0x176'),'through':'user_has_whatsapp_interactions','foreignKey':_0xf794('0x1fc')});db[_0xf794('0xfa')]['belongsTo'](db['User'],{'as':_0xf794('0x109')});db['WhatsappMessage'][_0xf794('0x119')](db[_0xf794('0x64')],{'onDelete':'cascade','as':_0xf794('0x160')});db[_0xf794('0xfa')][_0xf794('0x119')](db['WhatsappInteraction'],{'onDelete':_0xf794('0x10b'),'as':_0xf794('0x17a'),'foreignKey':_0xf794('0x1fc')});db[_0xf794('0xfa')][_0xf794('0x119')](db[_0xf794('0x143')],{'as':_0xf794('0x170'),'foreignKey':_0xf794('0x1fa')});db[_0xf794('0xfc')]['belongsTo'](db[_0xf794('0x143')],{});db[_0xf794('0xfc')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xf794('0x16a')});db['WhatsappQueueReport']['belongsTo'](db[_0xf794('0x64')],{'as':'Contact','foreignKey':_0xf794('0x171')});db[_0xf794('0xfc')][_0xf794('0x119')](db[_0xf794('0xf8')],{});db[_0xf794('0xfc')]['belongsTo'](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0xf794('0x119')](db[_0xf794('0xfa')],{});db['WhatsappQueueReport']['belongsTo'](db['User'],{});db['WhatsappTransferReport']['belongsTo'](db[_0xf794('0xfa')],{});db[_0xf794('0xfe')][_0xf794('0x119')](db[_0xf794('0xf8')],{});db[_0xf794('0xfe')][_0xf794('0x119')](db[_0xf794('0x143')],{'foreignKey':_0xf794('0x1fe'),'as':_0xf794('0x1e8')});db['WhatsappTransferReport']['belongsTo'](db[_0xf794('0x143')],{'foreignKey':_0xf794('0x1ff'),'as':_0xf794('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db[_0xf794('0x100')],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0xf794('0xfe')][_0xf794('0x119')](db['User'],{'foreignKey':'FromUserId','as':_0xf794('0x1ea')});db[_0xf794('0xfe')]['belongsTo'](db[_0xf794('0x109')],{'foreignKey':_0xf794('0x1f0'),'as':_0xf794('0x1eb')});db['WhatsappQueue']['belongsToMany'](db['User'],{'as':_0xf794('0x16c'),'through':_0xf794('0x2f'),'foreignKey':_0xf794('0x200')});db[_0xf794('0x100')][_0xf794('0x11e')](db[_0xf794('0xdf')],{'through':'team_has_whatsapp_queues','as':_0xf794('0x16e')});db['UserSetting']['belongsTo'](db['User'],{'as':_0xf794('0x201'),'foreignKey':_0xf794('0x10f'),'onDelete':_0xf794('0x10b'),'hooks':!![]});db[_0xf794('0x102')]['hasOne'](db['Dynamics365Account'],{'as':_0xf794('0xbe'),'onDelete':_0xf794('0x163')});db[_0xf794('0x102')][_0xf794('0x10a')](db[_0xf794('0x30')],{'as':_0xf794('0x165'),'onDelete':_0xf794('0x163')});db[_0xf794('0x102')][_0xf794('0x10a')](db[_0xf794('0x164')],{'as':'Smtp','onDelete':'restrict'});module[_0xf794('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x9579=['JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Extensions','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','CmList','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','Members','VoiceQueueId','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','CmContact','ContactId','MailAccountId','restrict','Imap','Smtp','Disposition','Dispositions','CannedAnswer','Answers','MailMessage','Interactions','List','ListId','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','TagId','Items','FaxAccountId','Exntensions','FaxInteractionId','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','CompanyId','CmContactId','SmsInteractions','FaxInteractions','Company','cm_contact_has_tags','CmHopperId','All','OneAll','AutomationAllId','OneAny','Actions','ParentId','Intervals','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','fax_interaction_has_tags','whatsapp_interaction_has_tags','ItemType','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Description','VariableId','AccountId','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','Subject','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','ServicenowField','Dynamics365Account','CloudProviderId','Dynamics365Field','FreshsalesField','ChatQueueReport','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','FaxQueues','team_has_whatsapp_queues','Hoppers','CampaignId','HopperFinals','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAccount','ToUserId','ToAgent','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','UserWhatsappQueue','WhatsappQueueId','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','utf8','sequelizeHistory','mysql','name','utf8_general_ci','options','database','username','password','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','Tag','../api/tag/tag.model','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model'];(function(_0x52a7e1,_0x189bf3){var _0x4f4495=function(_0x5d1915){while(--_0x5d1915){_0x52a7e1['push'](_0x52a7e1['shift']());}};_0x4f4495(++_0x189bf3);}(_0x9579,0x122));var _0x9957=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0x9579[_0x27530d];return _0x59e561;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x9957('0x0'));var _=require('lodash');var jstz=require(_0x9957('0x1'));var timezone=jstz[_0x9957('0x2')]();config[_0x9957('0x0')]=_[_0x9957('0x3')](config[_0x9957('0x0')],{'database':_0x9957('0x4'),'username':_0x9957('0x5'),'password':_0x9957('0x6'),'options':{'host':_0x9957('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x9957('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x9957('0x9'),'collate':'utf8_general_ci'}}});config[_0x9957('0xa')]=_[_0x9957('0x3')](config['sequelizeHistory'],{'database':_0x9957('0x4'),'username':_0x9957('0x5'),'password':_0x9957('0x6'),'options':{'host':_0x9957('0x7'),'port':0xcea,'dialect':_0x9957('0xb'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x9957('0xc')](),'define':{'charset':_0x9957('0x9'),'collate':_0x9957('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9957('0x0')]['database'],config['sequelize']['username'],config[_0x9957('0x0')]['password'],config[_0x9957('0x0')][_0x9957('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x9957('0xf')],config[_0x9957('0xa')][_0x9957('0x10')],config[_0x9957('0xa')][_0x9957('0x11')],config['sequelizeHistory'][_0x9957('0xe')])};db[_0x9957('0x12')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x14'));db[_0x9957('0x15')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x9957('0x16')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x17'));db[_0x9957('0x18')]=db['sequelize']['import'](_0x9957('0x19'));db['VoiceMusicOnHold']=db[_0x9957('0x0')]['import'](_0x9957('0x1a'));db[_0x9957('0x1b')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x1c'));db[_0x9957('0x1d')]=db['sequelize'][_0x9957('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x9957('0x1e')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x1f'));db[_0x9957('0x20')]=db[_0x9957('0x0')]['import'](_0x9957('0x21'));db[_0x9957('0x22')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x23'));db[_0x9957('0x24')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x9957('0x0')][_0x9957('0x13')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x25'));db[_0x9957('0x26')]=db[_0x9957('0x0')]['import'](_0x9957('0x27'));db['MemberReport']=db[_0x9957('0x0')][_0x9957('0x13')]('../api/memberReport/memberReport.model');db[_0x9957('0x28')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x29'));db[_0x9957('0x2a')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x2b'));db[_0x9957('0x2c')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x2d'));db[_0x9957('0x2e')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x2f'));db[_0x9957('0x30')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x9957('0x31')]=db[_0x9957('0x0')]['import'](_0x9957('0x32'));db[_0x9957('0x33')]=db[_0x9957('0x0')]['import'](_0x9957('0x34'));db[_0x9957('0x35')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x36'));db['UserWhatsappQueue']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x37'));db[_0x9957('0x38')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x39'));db[_0x9957('0x3a')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x3b'));db[_0x9957('0x3c')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x3d'));db[_0x9957('0x3e')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x3f'));db[_0x9957('0x40')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x41'));db[_0x9957('0x42')]=db['sequelize']['import'](_0x9957('0x43'));db['MailMessage']=db['sequelize'][_0x9957('0x13')](_0x9957('0x44'));db[_0x9957('0x45')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x46'));db[_0x9957('0x47')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x48'));db[_0x9957('0x49')]=db[_0x9957('0x0')]['import'](_0x9957('0x4a'));db[_0x9957('0x4b')]=db['sequelize'][_0x9957('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0x9957('0x4c')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x4d'));db[_0x9957('0x4e')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x4f'));db[_0x9957('0x50')]=db['sequelize'][_0x9957('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x9957('0x51')]=db[_0x9957('0x0')]['import'](_0x9957('0x52'));db['FaxQueue']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x53'));db['FaxQueueReport']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x54'));db[_0x9957('0x55')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x56'));db[_0x9957('0x57')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/smsApplication/smsApplication.model');db[_0x9957('0x58')]=db[_0x9957('0x0')]['import'](_0x9957('0x59'));db[_0x9957('0x5a')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x5b'));db[_0x9957('0x5c')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/smsQueue/smsQueue.model');db[_0x9957('0x5d')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x5e'));db[_0x9957('0x5f')]=db[_0x9957('0x0')]['import'](_0x9957('0x60'));db[_0x9957('0x61')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x62'));db['OpenchannelQueue']=db['sequelize'][_0x9957('0x13')](_0x9957('0x63'));db[_0x9957('0x64')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x65'));db[_0x9957('0x66')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x9957('0x67')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x68'));db[_0x9957('0x69')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x6a'));db[_0x9957('0x6b')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x6c'));db['ChatOfflineMessage']=db[_0x9957('0x0')]['import'](_0x9957('0x6d'));db[_0x9957('0x6e')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/chatQueue/chatQueue.model');db[_0x9957('0x6f')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x70'));db[_0x9957('0x71')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x72'));db[_0x9957('0x73')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x74'));db['CmContact']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x75'));db[_0x9957('0x76')]=db[_0x9957('0x0')]['import'](_0x9957('0x77'));db[_0x9957('0x78')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x79'));db[_0x9957('0x7a')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x7b'));db['CmHopperHistory']=db[_0x9957('0x0')]['import'](_0x9957('0x7c'));db[_0x9957('0x7d')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x7e'));db[_0x9957('0x7f')]=db[_0x9957('0x0')]['import']('../api/cmCustomField/cmCustomField.model');db[_0x9957('0x80')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x81'));db[_0x9957('0x82')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x83'));db['CannedAnswer']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x84'));db['Disposition']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x85'));db[_0x9957('0x86')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/condition/condition.model');db[_0x9957('0x87')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x88'));db[_0x9957('0x89')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x8a'));db[_0x9957('0x8b')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x8c'));db[_0x9957('0x8d')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x8e'));db[_0x9957('0x8f')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/schedule/schedule.model');db[_0x9957('0x90')]=db['sequelize'][_0x9957('0x13')]('../api/sound/sound.model');db[_0x9957('0x91')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x92'));db['ContactItemType']=db['sequelize'][_0x9957('0x13')]('../api/contactItemType/contactItemType.model');db[_0x9957('0x93')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0x9957('0x94')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x95'));db[_0x9957('0x96')]=db['sequelize']['import'](_0x9957('0x97'));db[_0x9957('0x98')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x99'));db[_0x9957('0x9a')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x9b'));db[_0x9957('0x9c')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x9d'));db[_0x9957('0x9e')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x9f'));db[_0x9957('0xa0')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xa1'));db[_0x9957('0xa2')]=db['sequelize']['import'](_0x9957('0xa3'));db[_0x9957('0xa4')]=db[_0x9957('0x0')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x9957('0xa5')]=db[_0x9957('0x0')]['import'](_0x9957('0xa6'));db[_0x9957('0xa7')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xa8'));db[_0x9957('0xa9')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xaa'));db[_0x9957('0xab')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xac'));db['SalesforceConfiguration']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xad'));db[_0x9957('0xae')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xaf'));db[_0x9957('0xb0')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xb1'));db[_0x9957('0xb2')]=db[_0x9957('0x0')]['import'](_0x9957('0xb3'));db[_0x9957('0xb4')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xb5'));db[_0x9957('0xb6')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xb7'));db[_0x9957('0xb8')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xb9'));db[_0x9957('0xba')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xbb'));db[_0x9957('0xbc')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x9957('0x0')][_0x9957('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xbd'));db['ZendeskAccount']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xbe'));db[_0x9957('0xbf')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xc0'));db[_0x9957('0xc1')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xc2'));db[_0x9957('0xc3')]=db['sequelize']['import'](_0x9957('0xc4'));db[_0x9957('0xc5')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xc6'));db[_0x9957('0xc7')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xc8'));db['VtigerAccount']=db['sequelize'][_0x9957('0x13')](_0x9957('0xc9'));db[_0x9957('0xca')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xcb'));db[_0x9957('0xcc')]=db[_0x9957('0x0')]['import']('../api/intVtigerField/intVtigerField.model');db[_0x9957('0xcd')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xce'));db['ServicenowConfiguration']=db['sequelize'][_0x9957('0x13')](_0x9957('0xcf'));db['ServicenowField']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xd0'));db['Dynamics365Account']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xd1'));db[_0x9957('0xd2')]=db['sequelize']['import'](_0x9957('0xd3'));db['Dynamics365Field']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xd4'));db[_0x9957('0xd5')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xd6'));db[_0x9957('0xd7')]=db['sequelize']['import'](_0x9957('0xd8'));db['FreshsalesField']=db[_0x9957('0x0')]['import'](_0x9957('0xd9'));db[_0x9957('0x9c')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/integration/integration.model');db[_0x9957('0xda')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xdb'));db['ChatQueueReport']=db['sequelize'][_0x9957('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0x9957('0xdc')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xdd'));db[_0x9957('0xde')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xdf'));db['JscriptyQuestionReport']=db[_0x9957('0x0')][_0x9957('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xe0'));db[_0x9957('0xe1')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0x9957('0xe2')]=db['sequelize']['import'](_0x9957('0xe3'));db[_0x9957('0xe4')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x9957('0xe5')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x9957('0xe6')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/setting/setting.model');db['SquareOdbc']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xe7'));db[_0x9957('0xe8')]=db[_0x9957('0x0')]['import'](_0x9957('0xe9'));db[_0x9957('0xea')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xeb'));db[_0x9957('0xec')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/squareMessage/squareMessage.model');db[_0x9957('0xed')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xee'));db[_0x9957('0xef')]=db['sequelize']['import'](_0x9957('0xf0'));db[_0x9957('0xf1')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xf2'));db[_0x9957('0xf3')]=db['sequelize'][_0x9957('0x13')](_0x9957('0xf4'));db['Attachment']=db['sequelize'][_0x9957('0x13')](_0x9957('0xf5'));db[_0x9957('0xf6')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xf7'));db['MailTransferReport']=db[_0x9957('0x0')]['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db['sequelize'][_0x9957('0x13')](_0x9957('0xf8'));db[_0x9957('0xf9')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xfa'));db['OpenchannelTransferReport']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xfb'));db['SmsTransferReport']=db[_0x9957('0x0')]['import'](_0x9957('0xfc'));db['CmList']=db[_0x9957('0x0')]['import'](_0x9957('0xfd'));db['VoicePrefix']=db['sequelize'][_0x9957('0x13')](_0x9957('0xfe'));db['UserProfile']=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0xff'));db[_0x9957('0x100')]=db[_0x9957('0x0')]['import'](_0x9957('0x101'));db['UserProfileResource']=db[_0x9957('0x0')][_0x9957('0x13')]('../api/userProfileResource/userProfileResource.model');db[_0x9957('0x102')]=db['sequelize'][_0x9957('0x13')]('../api/userNotification/userNotification.model');db[_0x9957('0x103')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x104'));db[_0x9957('0x105')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x9957('0x106')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x107'));db[_0x9957('0x108')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x109'));db['WhatsappQueueReport']=db[_0x9957('0x0')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db['sequelize'][_0x9957('0x13')](_0x9957('0x10a'));db[_0x9957('0x10b')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x10c'));db[_0x9957('0x10d')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x10e'));db[_0x9957('0x10f')]=db[_0x9957('0x0')][_0x9957('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x9957('0x110')]=db[_0x9957('0x0')]['import'](_0x9957('0x111'));db[_0x9957('0x112')]=db['sequelize'][_0x9957('0x13')](_0x9957('0x113'));db[_0x9957('0x114')]=db[_0x9957('0x0')][_0x9957('0x13')](_0x9957('0x115'));db[_0x9957('0x12')][_0x9957('0x116')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x116')](db[_0x9957('0x114')],{'as':_0x9957('0x119'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db[_0x9957('0x1d')],{'as':'Recordings','foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x9957('0x12')]['hasMany'](db[_0x9957('0x18')],{'as':_0x9957('0x11b'),'onDelete':_0x9957('0x117'),'hooks':!![]});db[_0x9957('0x12')]['hasMany'](db[_0x9957('0x7a')],{'as':'HopperFinals','foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db[_0x9957('0x11c')],{'as':_0x9957('0x11d'),'foreignKey':'UserId'});db[_0x9957('0x12')]['hasMany'](db[_0x9957('0x7d')],{'as':_0x9957('0x7d'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db[_0x9957('0x61')],{'as':_0x9957('0x11e'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db[_0x9957('0x69')],{'as':_0x9957('0x11f'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db[_0x9957('0x58')],{'as':'SmsInteractions','foreignKey':_0x9957('0x118')});db[_0x9957('0x12')]['hasMany'](db[_0x9957('0x50')],{'as':'FaxInteractions','foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db[_0x9957('0x42')],{'as':_0x9957('0x120'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':_0x9957('0x118')});db[_0x9957('0x12')][_0x9957('0x11a')](db[_0x9957('0x102')],{'as':_0x9957('0x121'),'foreignKey':_0x9957('0x122')});db[_0x9957('0x12')][_0x9957('0x123')](db[_0x9957('0x124')],{'as':_0x9957('0x124'),'foreignKey':_0x9957('0x125')});db['User'][_0x9957('0x126')](db[_0x9957('0x6f')],{'as':'Groups','through':_0x9957('0x127')});db[_0x9957('0x12')]['belongsToMany'](db['CmContact'],{'as':_0x9957('0x128'),'through':_0x9957('0x129')});db[_0x9957('0x12')][_0x9957('0x126')](db['CmList'],{'as':_0x9957('0x12a'),'through':'cm_user_has_lists'});db[_0x9957('0x12')][_0x9957('0x126')](db[_0x9957('0xed')],{'through':'user_has_teams'});db[_0x9957('0x12')]['belongsToMany'](db['MailInteraction'],{'as':_0x9957('0x120'),'through':'user_has_mail_interactions'});db[_0x9957('0x12')]['belongsToMany'](db[_0x9957('0x69')],{'as':_0x9957('0x11f'),'through':_0x9957('0x12b')});db['User'][_0x9957('0x126')](db[_0x9957('0x50')],{'as':'FaxInteractions','through':_0x9957('0x12c')});db[_0x9957('0x12')][_0x9957('0x126')](db[_0x9957('0x58')],{'as':'SmsInteractions','through':_0x9957('0x12d')});db[_0x9957('0x12')][_0x9957('0x126')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x9957('0x12')][_0x9957('0x126')](db[_0x9957('0x106')],{'as':_0x9957('0x12e'),'through':_0x9957('0x12f')});db[_0x9957('0x12')][_0x9957('0x126')](db['VoiceQueue'],{'as':_0x9957('0x130'),'through':'UserVoiceQueue','required':![]});db['User'][_0x9957('0x126')](db[_0x9957('0x131')],{'as':_0x9957('0x132'),'through':_0x9957('0x112'),'required':![]});db['User'][_0x9957('0x126')](db[_0x9957('0x3e')],{'as':_0x9957('0x133'),'through':_0x9957('0x30'),'required':![]});db[_0x9957('0x12')][_0x9957('0x126')](db[_0x9957('0x6e')],{'as':_0x9957('0x134'),'through':_0x9957('0x135'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x9957('0x136')],{'as':'FaxQueues','through':_0x9957('0x31'),'required':![]});db[_0x9957('0x12')][_0x9957('0x126')](db['SmsQueue'],{'as':_0x9957('0x137'),'through':'UserSmsQueue','required':![]});db[_0x9957('0x12')][_0x9957('0x126')](db[_0x9957('0x138')],{'as':_0x9957('0x139'),'through':'UserOpenchannelQueue','required':![]});db[_0x9957('0x12')]['belongsToMany'](db[_0x9957('0x10b')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0x9957('0x12')][_0x9957('0x126')](db[_0x9957('0x13a')],{'through':_0x9957('0x13b')});db[_0x9957('0x12')][_0x9957('0x126')](db[_0x9957('0x64')],{'as':_0x9957('0x13c'),'through':_0x9957('0x13d')});db['User'][_0x9957('0x126')](db[_0x9957('0x4c')],{'as':_0x9957('0x13e'),'through':_0x9957('0x13f')});db[_0x9957('0x12')]['belongsToMany'](db[_0x9957('0x3c')],{'as':'MailAccounts','through':_0x9957('0x140')});db['User'][_0x9957('0x126')](db['OpenchannelAccount'],{'as':_0x9957('0x141'),'through':_0x9957('0x142')});db[_0x9957('0x12')][_0x9957('0x126')](db[_0x9957('0x55')],{'as':_0x9957('0x143'),'through':'user_has_sms_accounts'});db[_0x9957('0x12')]['belongsToMany'](db[_0x9957('0x103')],{'as':'WhatsappAccounts','through':_0x9957('0x144')});db['User'][_0x9957('0x126')](db[_0x9957('0xe8')],{'as':_0x9957('0x145'),'through':_0x9957('0x146')});db[_0x9957('0x15')][_0x9957('0x11a')](db[_0x9957('0x18')],{'as':_0x9957('0x147'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x148')});db[_0x9957('0x16')]['hasMany'](db[_0x9957('0x18')],{'onDelete':_0x9957('0x117')});db[_0x9957('0x18')]['hasMany'](db[_0x9957('0x18')],{'as':_0x9957('0x149'),'onDelete':'cascade'});db[_0x9957('0x14a')][_0x9957('0x126')](db[_0x9957('0x90')],{'as':_0x9957('0x14b'),'through':'moh_has_sounds'});db[_0x9957('0x1b')][_0x9957('0x11a')](db['UserVoiceQueueRt'],{'as':_0x9957('0x14c'),'foreignKey':_0x9957('0x14d')});db[_0x9957('0x1b')][_0x9957('0x11a')](db[_0x9957('0x76')],{'as':'Hoppers','foreignKey':_0x9957('0x14d')});db[_0x9957('0x1b')][_0x9957('0x11a')](db[_0x9957('0x7a')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x9957('0x1b')][_0x9957('0x11a')](db[_0x9957('0x11c')],{'as':_0x9957('0x14e'),'foreignKey':_0x9957('0x14d')});db['VoiceQueue'][_0x9957('0x11a')](db[_0x9957('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0x9957('0x14d')});db[_0x9957('0x1b')][_0x9957('0x11a')](db[_0x9957('0x78')],{'as':'HopperBlacks','foreignKey':_0x9957('0x14d')});db[_0x9957('0x1b')][_0x9957('0x11a')](db[_0x9957('0x14f')],{'as':_0x9957('0x150'),'foreignKey':_0x9957('0x14d')});db[_0x9957('0x1b')][_0x9957('0x123')](db[_0x9957('0x28')],{'as':_0x9957('0x28'),'foreignKey':_0x9957('0x151')});db[_0x9957('0x1b')][_0x9957('0x123')](db['Trunk'],{'as':_0x9957('0x152'),'foreignKey':_0x9957('0x153')});db['VoiceQueue']['belongsTo'](db[_0x9957('0x87')],{'as':_0x9957('0x87'),'foreignKey':_0x9957('0x154')});db[_0x9957('0x1b')]['belongsTo'](db['Pause'],{'as':_0x9957('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9957('0x1b')][_0x9957('0x126')](db[_0x9957('0x13a')],{'as':_0x9957('0x12a'),'through':_0x9957('0x156')});db['VoiceQueue'][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':_0x9957('0x2e')});db[_0x9957('0x1b')][_0x9957('0x126')](db[_0x9957('0xed')],{'as':_0x9957('0x158'),'through':'TeamVoiceQueue'});db[_0x9957('0x1b')]['belongsToMany'](db[_0x9957('0x13a')],{'as':_0x9957('0x159'),'through':'voice_queues_has_cm_blacklists'});db[_0x9957('0x1d')][_0x9957('0x123')](db[_0x9957('0x12')],{'as':'User','foreignKey':_0x9957('0x118')});db[_0x9957('0x1e')][_0x9957('0x123')](db['User'],{'as':'User','foreignKey':_0x9957('0x118')});db[_0x9957('0x20')][_0x9957('0x11a')](db[_0x9957('0x22')],{'as':_0x9957('0x15a'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x15b'),'sourceKey':_0x9957('0x15c')});db[_0x9957('0x22')][_0x9957('0x123')](db[_0x9957('0x20')],{'foreignKey':_0x9957('0x15b'),'targetKey':'mailbox'});db[_0x9957('0x24')][_0x9957('0x11a')](db['VoiceQueueReport'],{'as':_0x9957('0x15d'),'foreignKey':_0x9957('0x15e'),'constraints':![]});db[_0x9957('0x24')]['hasMany'](db[_0x9957('0x15f')],{'as':'AgentReports','foreignKey':_0x9957('0x15e'),'constraints':![]});db[_0x9957('0x24')]['belongsTo'](db[_0x9957('0x12')],{'as':_0x9957('0x12'),'foreignKey':'UserId'});db[_0x9957('0x24')][_0x9957('0x123')](db[_0x9957('0x160')],{'as':'Contact','foreignKey':_0x9957('0x161')});db[_0x9957('0x38')][_0x9957('0x123')](db[_0x9957('0x3c')],{'as':'MailAccount','foreignKey':_0x9957('0x162')});db[_0x9957('0x38')][_0x9957('0x123')](db[_0x9957('0x10d')],{'as':_0x9957('0x10d'),'foreignKey':'CloudProviderId','onDelete':_0x9957('0x163')});db[_0x9957('0x3a')][_0x9957('0x123')](db[_0x9957('0x3c')],{'as':_0x9957('0x3c'),'foreignKey':'MailAccountId'});db[_0x9957('0x3a')][_0x9957('0x123')](db[_0x9957('0x10d')],{'as':_0x9957('0x10d'),'foreignKey':'CloudProviderId','onDelete':_0x9957('0x163')});db[_0x9957('0x3c')][_0x9957('0x116')](db[_0x9957('0x38')],{'as':_0x9957('0x164'),'onDelete':'cascade'});db['MailAccount'][_0x9957('0x116')](db[_0x9957('0x3a')],{'as':_0x9957('0x165'),'onDelete':_0x9957('0x117')});db[_0x9957('0x3c')][_0x9957('0x11a')](db[_0x9957('0x166')],{'as':_0x9957('0x167'),'foreignKey':_0x9957('0x162'),'onDelete':_0x9957('0x117')});db['MailAccount'][_0x9957('0x11a')](db[_0x9957('0x168')],{'as':_0x9957('0x169'),'foreignKey':'MailAccountId'});db[_0x9957('0x3c')][_0x9957('0x11a')](db[_0x9957('0x16a')],{'as':_0x9957('0x15a'),'foreignKey':_0x9957('0x162')});db[_0x9957('0x3c')][_0x9957('0x11a')](db['MailInteraction'],{'as':_0x9957('0x16b')});db[_0x9957('0x3c')]['hasMany'](db[_0x9957('0x45')],{'as':_0x9957('0x149'),'foreignKey':_0x9957('0x162'),'onDelete':_0x9957('0x117')});db[_0x9957('0x3c')]['belongsTo'](db['CmList'],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d')});db['MailAccount'][_0x9957('0x123')](db[_0x9957('0x96')],{'as':'Template','foreignKey':_0x9957('0x16e')});db[_0x9957('0x3c')][_0x9957('0x123')](db[_0x9957('0x89')],{'as':_0x9957('0x155'),'foreignKey':_0x9957('0x16f')});db[_0x9957('0x3c')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':_0x9957('0x140')});db[_0x9957('0x3e')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':_0x9957('0x30')});db[_0x9957('0x3e')][_0x9957('0x126')](db['Team'],{'through':_0x9957('0x170'),'as':_0x9957('0x158')});db[_0x9957('0x42')][_0x9957('0x11a')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x9957('0x171')});db[_0x9957('0x42')]['belongsTo'](db[_0x9957('0x3c')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x162')});db['MailInteraction'][_0x9957('0x123')](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':'ContactId'});db['MailInteraction'][_0x9957('0x123')](db[_0x9957('0x12')],{'as':_0x9957('0x174'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x42')][_0x9957('0x126')](db[_0x9957('0x91')],{'through':_0x9957('0x175'),'as':_0x9957('0x176')});db[_0x9957('0x42')]['belongsToMany'](db[_0x9957('0x91')],{'through':_0x9957('0x175'),'as':_0x9957('0x177')});db[_0x9957('0x42')][_0x9957('0x126')](db['User'],{'as':_0x9957('0x178'),'through':_0x9957('0x179'),'foreignKey':'MailInteractionId'});db[_0x9957('0x16a')][_0x9957('0x11a')](db[_0x9957('0x17a')],{'as':_0x9957('0x17b'),'onDelete':_0x9957('0x117')});db[_0x9957('0x16a')][_0x9957('0x123')](db['User'],{'as':'User'});db[_0x9957('0x16a')][_0x9957('0x123')](db['CmContact'],{'onDelete':_0x9957('0x117'),'as':'Contact'});db[_0x9957('0x16a')][_0x9957('0x123')](db['MailInteraction'],{'as':_0x9957('0x17c'),'foreignKey':'MailInteractionId'});db[_0x9957('0x16a')][_0x9957('0x123')](db[_0x9957('0x3c')],{'as':_0x9957('0x172'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x9957('0x123')](db[_0x9957('0x64')],{'as':'ChatWebsite','foreignKey':_0x9957('0x17d')});db[_0x9957('0x16a')][_0x9957('0x123')](db[_0x9957('0x17e')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x9957('0x45')][_0x9957('0x123')](db['User'],{'onDelete':_0x9957('0x163')});db[_0x9957('0x45')][_0x9957('0x123')](db[_0x9957('0x3e')],{'onDelete':_0x9957('0x163')});db[_0x9957('0x45')][_0x9957('0x123')](db[_0x9957('0x3c')],{'onDelete':_0x9957('0x163')});db[_0x9957('0x45')][_0x9957('0x123')](db[_0x9957('0x87')],{'onDelete':_0x9957('0x163'),'foreignKey':_0x9957('0x154')});db['MailApplication'][_0x9957('0x123')](db['Tag'],{'onDelete':_0x9957('0x163'),'foreignKey':_0x9957('0x17f')});db['MailQueueReport'][_0x9957('0x123')](db[_0x9957('0x3c')],{});db[_0x9957('0x47')][_0x9957('0x123')](db['CmList'],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x47')]['belongsTo'](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161')});db[_0x9957('0x47')][_0x9957('0x123')](db[_0x9957('0x42')],{});db[_0x9957('0x47')][_0x9957('0x123')](db[_0x9957('0x16a')],{});db[_0x9957('0x47')]['belongsTo'](db['User'],{});db[_0x9957('0x47')]['belongsTo'](db[_0x9957('0x3e')],{});db['Dashboard']['hasMany'](db[_0x9957('0x4b')],{'as':_0x9957('0x180'),'onDelete':_0x9957('0x117')});db[_0x9957('0x4c')][_0x9957('0x11a')](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x9957('0x117')});db[_0x9957('0x4c')][_0x9957('0x11a')](db[_0x9957('0x168')],{'as':_0x9957('0x169'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0x9957('0x11a')](db[_0x9957('0x50')],{'as':'Interactions'});db[_0x9957('0x4c')]['hasMany'](db[_0x9957('0x4e')],{'as':_0x9957('0x149'),'foreignKey':_0x9957('0x181'),'onDelete':_0x9957('0x117')});db[_0x9957('0x4c')][_0x9957('0x11a')](db[_0x9957('0x18')],{'as':_0x9957('0x182'),'onDelete':'cascade'});db['FaxAccount'][_0x9957('0x11a')](db[_0x9957('0x51')],{'as':'Messages'});db[_0x9957('0x4c')]['belongsTo'](db['Trunk'],{'as':_0x9957('0x28')});db['FaxAccount']['belongsTo'](db['CmList'],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x4c')][_0x9957('0x123')](db['Pause'],{'as':_0x9957('0x155'),'foreignKey':_0x9957('0x16f')});db[_0x9957('0x4c')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':'Agents','through':_0x9957('0x13f')});db[_0x9957('0x4e')][_0x9957('0x123')](db[_0x9957('0x12')],{'onDelete':'restrict'});db[_0x9957('0x4e')][_0x9957('0x123')](db[_0x9957('0x136')],{'onDelete':_0x9957('0x163')});db[_0x9957('0x4e')][_0x9957('0x123')](db['FaxAccount'],{'onDelete':'restrict'});db[_0x9957('0x4e')]['belongsTo'](db[_0x9957('0x91')],{'onDelete':_0x9957('0x163'),'foreignKey':_0x9957('0x17f')});db['FaxInteraction'][_0x9957('0x11a')](db[_0x9957('0x51')],{'as':_0x9957('0x15a'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x183')});db[_0x9957('0x50')][_0x9957('0x123')](db[_0x9957('0x4c')],{'as':_0x9957('0x172'),'foreignKey':'FaxAccountId'});db[_0x9957('0x50')]['belongsTo'](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161')});db[_0x9957('0x50')]['belongsTo'](db['User'],{'as':_0x9957('0x174'),'foreignKey':_0x9957('0x118')});db['FaxInteraction'][_0x9957('0x126')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x9957('0x176')});db[_0x9957('0x50')][_0x9957('0x126')](db[_0x9957('0x91')],{'through':'fax_interaction_has_tags','as':_0x9957('0x177')});db[_0x9957('0x50')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x178'),'through':_0x9957('0x12c'),'foreignKey':'FaxInteractionId'});db[_0x9957('0x51')][_0x9957('0x123')](db[_0x9957('0x12')],{'onDelete':_0x9957('0x117'),'as':_0x9957('0x12')});db[_0x9957('0x51')][_0x9957('0x123')](db[_0x9957('0x50')],{'as':'Interaction','foreignKey':_0x9957('0x183')});db['FaxMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x9957('0x173')});db[_0x9957('0x51')]['belongsTo'](db['Attachment'],{'as':_0x9957('0x17a'),'foreignKey':_0x9957('0x184')});db[_0x9957('0x51')][_0x9957('0x123')](db[_0x9957('0x4c')],{'as':_0x9957('0x172'),'foreignKey':'FaxAccountId'});db[_0x9957('0x136')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':'UserFaxQueue'});db[_0x9957('0x136')][_0x9957('0x126')](db['Team'],{'through':_0x9957('0x185'),'as':_0x9957('0x158')});db[_0x9957('0x186')][_0x9957('0x123')](db['FaxAccount'],{});db[_0x9957('0x186')][_0x9957('0x123')](db[_0x9957('0x13a')],{'as':'List','foreignKey':_0x9957('0x16d')});db[_0x9957('0x186')]['belongsTo'](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161')});db[_0x9957('0x186')][_0x9957('0x123')](db[_0x9957('0x50')],{});db['FaxQueueReport'][_0x9957('0x123')](db[_0x9957('0x51')],{});db[_0x9957('0x186')][_0x9957('0x123')](db[_0x9957('0x12')],{});db['FaxQueueReport'][_0x9957('0x123')](db['FaxQueue'],{});db['SmsAccount'][_0x9957('0x11a')](db[_0x9957('0x166')],{'as':_0x9957('0x167'),'foreignKey':_0x9957('0x187'),'onDelete':_0x9957('0x117')});db[_0x9957('0x55')][_0x9957('0x11a')](db[_0x9957('0x168')],{'as':'Answers','foreignKey':_0x9957('0x187')});db[_0x9957('0x55')]['hasMany'](db[_0x9957('0x5a')],{'as':'Messages','foreignKey':_0x9957('0x187')});db[_0x9957('0x55')]['hasMany'](db['SmsInteraction'],{'as':_0x9957('0x16b')});db[_0x9957('0x55')][_0x9957('0x11a')](db[_0x9957('0x57')],{'as':'Applications','foreignKey':_0x9957('0x187'),'onDelete':_0x9957('0x117')});db[_0x9957('0x55')][_0x9957('0x123')](db[_0x9957('0x13a')],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x55')][_0x9957('0x123')](db[_0x9957('0x89')],{'as':_0x9957('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9957('0x55')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':'Agents','through':'user_has_sms_accounts'});db['SmsApplication'][_0x9957('0x123')](db[_0x9957('0x12')],{'onDelete':_0x9957('0x163')});db['SmsApplication'][_0x9957('0x123')](db[_0x9957('0x5c')],{'onDelete':_0x9957('0x163')});db[_0x9957('0x57')][_0x9957('0x123')](db['SmsAccount'],{'onDelete':_0x9957('0x163')});db[_0x9957('0x57')][_0x9957('0x123')](db[_0x9957('0x87')],{'onDelete':_0x9957('0x163'),'foreignKey':_0x9957('0x154')});db[_0x9957('0x57')][_0x9957('0x123')](db[_0x9957('0x91')],{'onDelete':_0x9957('0x163'),'foreignKey':_0x9957('0x17f')});db['SmsInteraction'][_0x9957('0x11a')](db[_0x9957('0x5a')],{'as':_0x9957('0x15a'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x9957('0x58')][_0x9957('0x123')](db[_0x9957('0x55')],{'as':'Account','foreignKey':_0x9957('0x187')});db[_0x9957('0x58')][_0x9957('0x123')](db['CmContact'],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161')});db[_0x9957('0x58')][_0x9957('0x123')](db['User'],{'as':_0x9957('0x174'),'foreignKey':_0x9957('0x118')});db['SmsInteraction'][_0x9957('0x126')](db['Tag'],{'through':_0x9957('0x188'),'as':'Tags'});db[_0x9957('0x58')][_0x9957('0x126')](db[_0x9957('0x91')],{'through':_0x9957('0x188'),'as':_0x9957('0x177')});db['SmsInteraction'][_0x9957('0x126')](db[_0x9957('0x12')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x9957('0x189')});db['SmsMessage'][_0x9957('0x123')](db[_0x9957('0x12')],{'as':_0x9957('0x12')});db[_0x9957('0x5a')][_0x9957('0x123')](db['CmContact'],{'onDelete':_0x9957('0x117'),'as':_0x9957('0x173')});db[_0x9957('0x5a')]['belongsTo'](db['SmsInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x9957('0x189')});db[_0x9957('0x5a')][_0x9957('0x123')](db[_0x9957('0x55')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x187')});db['SmsQueue'][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':_0x9957('0x33'),'foreignKey':'SmsQueueId'});db[_0x9957('0x5c')][_0x9957('0x126')](db['Team'],{'through':_0x9957('0x18a'),'as':'Teams'});db['OpenchannelAccount']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0x9957('0x117')});db['OpenchannelAccount']['hasMany'](db[_0x9957('0x168')],{'as':'Answers','foreignKey':_0x9957('0x18b')});db[_0x9957('0x5d')]['hasMany'](db[_0x9957('0x61')],{'as':_0x9957('0x16b'),'foreignKey':_0x9957('0x18b')});db['OpenchannelAccount'][_0x9957('0x11a')](db[_0x9957('0x18c')],{'as':_0x9957('0x15a'),'foreignKey':_0x9957('0x18b')});db['OpenchannelAccount']['hasMany'](db[_0x9957('0x5f')],{'as':_0x9957('0x149'),'foreignKey':_0x9957('0x18b'),'onDelete':_0x9957('0x117')});db[_0x9957('0x5d')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x9957('0x5d')][_0x9957('0x123')](db['Pause'],{'as':_0x9957('0x155'),'foreignKey':_0x9957('0x16f')});db[_0x9957('0x5d')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':_0x9957('0x142')});db[_0x9957('0x5f')][_0x9957('0x123')](db['User'],{'onDelete':_0x9957('0x163')});db['OpenchannelApplication'][_0x9957('0x123')](db[_0x9957('0x138')],{'onDelete':'restrict','foreignKey':_0x9957('0x18d')});db[_0x9957('0x5f')][_0x9957('0x123')](db[_0x9957('0x5d')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0x9957('0x123')](db[_0x9957('0x87')],{'onDelete':_0x9957('0x163'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x9957('0x123')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db['OpenchannelInteraction'][_0x9957('0x11a')](db['OpenchannelMessage'],{'as':_0x9957('0x15a'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x9957('0x61')][_0x9957('0x123')](db[_0x9957('0x5d')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x18b')});db[_0x9957('0x61')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x9957('0x161')});db[_0x9957('0x61')][_0x9957('0x123')](db[_0x9957('0x12')],{'as':_0x9957('0x174'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x61')][_0x9957('0x126')](db[_0x9957('0x91')],{'through':'openchannel_interaction_has_tags','as':_0x9957('0x176')});db[_0x9957('0x61')][_0x9957('0x126')](db[_0x9957('0x91')],{'through':_0x9957('0x18e'),'as':_0x9957('0x177')});db[_0x9957('0x61')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':'Users','through':_0x9957('0x18f'),'foreignKey':_0x9957('0x190')});db['OpenchannelMessage'][_0x9957('0x123')](db[_0x9957('0x12')],{'onDelete':'cascade','as':'User'});db[_0x9957('0x18c')][_0x9957('0x123')](db['CmContact'],{'onDelete':'cascade','as':_0x9957('0x173')});db['OpenchannelMessage'][_0x9957('0x123')](db[_0x9957('0x61')],{'onDelete':'cascade','as':_0x9957('0x17c'),'foreignKey':'OpenchannelInteractionId'});db[_0x9957('0x18c')]['belongsTo'](db[_0x9957('0x17a')],{'as':_0x9957('0x17a'),'foreignKey':_0x9957('0x184')});db[_0x9957('0x18c')][_0x9957('0x123')](db[_0x9957('0x5d')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x18b')});db[_0x9957('0x138')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':'UserOpenchannelQueue','foreignKey':_0x9957('0x18d')});db['OpenchannelQueue'][_0x9957('0x126')](db['Team'],{'through':_0x9957('0x191'),'as':'Teams'});db['ChatWebsite']['hasMany'](db[_0x9957('0x166')],{'as':_0x9957('0x167'),'foreignKey':_0x9957('0x17d'),'onDelete':'cascade'});db[_0x9957('0x64')]['hasMany'](db[_0x9957('0x168')],{'as':_0x9957('0x169'),'foreignKey':'ChatWebsiteId'});db[_0x9957('0x64')][_0x9957('0x11a')](db[_0x9957('0x71')],{'as':_0x9957('0x192')});db[_0x9957('0x64')][_0x9957('0x11a')](db['ChatInteraction'],{'as':_0x9957('0x16b')});db[_0x9957('0x64')][_0x9957('0x11a')](db['ChatApplication'],{'as':_0x9957('0x149'),'foreignKey':_0x9957('0x17d'),'onDelete':_0x9957('0x117')});db[_0x9957('0x64')][_0x9957('0x11a')](db[_0x9957('0x6b')],{'as':_0x9957('0x15a')});db[_0x9957('0x64')][_0x9957('0x123')](db[_0x9957('0x13a')],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x64')][_0x9957('0x123')](db[_0x9957('0x87')],{'as':_0x9957('0x87'),'foreignKey':_0x9957('0x154')});db[_0x9957('0x64')][_0x9957('0x123')](db[_0x9957('0x3c')],{'as':_0x9957('0x3c'),'foreignKey':_0x9957('0x162')});db[_0x9957('0x64')][_0x9957('0x123')](db[_0x9957('0x89')],{'as':_0x9957('0x155'),'foreignKey':_0x9957('0x16f')});db[_0x9957('0x64')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':'user_has_chat_websites'});db[_0x9957('0x66')][_0x9957('0x123')](db[_0x9957('0x5d')],{});db[_0x9957('0x66')][_0x9957('0x123')](db['CmList'],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x66')][_0x9957('0x123')](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161')});db[_0x9957('0x66')][_0x9957('0x123')](db[_0x9957('0x61')],{});db[_0x9957('0x66')][_0x9957('0x123')](db[_0x9957('0x18c')],{});db[_0x9957('0x66')][_0x9957('0x123')](db[_0x9957('0x12')],{});db[_0x9957('0x66')][_0x9957('0x123')](db['OpenchannelQueue'],{});db[_0x9957('0x67')][_0x9957('0x123')](db[_0x9957('0x12')],{'as':_0x9957('0x193'),'foreignKey':'UserId','onDelete':_0x9957('0x163')});db[_0x9957('0x67')][_0x9957('0x123')](db[_0x9957('0x6e')],{'as':_0x9957('0x194'),'foreignKey':'ChatQueueId','onDelete':_0x9957('0x163')});db[_0x9957('0x67')][_0x9957('0x123')](db[_0x9957('0x64')],{'as':_0x9957('0x195'),'foreignKey':'ChatWebsiteId','onDelete':_0x9957('0x163')});db[_0x9957('0x67')][_0x9957('0x123')](db[_0x9957('0x91')],{'onDelete':_0x9957('0x163'),'foreignKey':_0x9957('0x17f')});db['ChatInteraction']['hasMany'](db[_0x9957('0x6b')],{'as':_0x9957('0x15a'),'onDelete':'cascade','foreignKey':_0x9957('0x196')});db[_0x9957('0x69')][_0x9957('0x123')](db[_0x9957('0x64')],{'as':'Account','foreignKey':_0x9957('0x17d')});db['ChatInteraction'][_0x9957('0x123')](db[_0x9957('0x160')],{'as':'Contact','foreignKey':_0x9957('0x161')});db[_0x9957('0x69')]['belongsTo'](db[_0x9957('0x12')],{'as':_0x9957('0x174'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x69')]['belongsToMany'](db['Tag'],{'through':_0x9957('0x197'),'as':_0x9957('0x176')});db[_0x9957('0x69')]['belongsToMany'](db[_0x9957('0x91')],{'through':_0x9957('0x197'),'as':_0x9957('0x177')});db[_0x9957('0x69')][_0x9957('0x126')](db['User'],{'as':_0x9957('0x178'),'through':_0x9957('0x12b'),'foreignKey':_0x9957('0x196')});db['ChatMessage'][_0x9957('0x123')](db[_0x9957('0x12')],{'onDelete':'cascade','as':'User'});db[_0x9957('0x6b')]['belongsTo'](db[_0x9957('0x160')],{'onDelete':_0x9957('0x117'),'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161')});db[_0x9957('0x6b')][_0x9957('0x123')](db[_0x9957('0x69')],{'onDelete':_0x9957('0x117'),'as':'Interaction','foreignKey':_0x9957('0x196')});db[_0x9957('0x6b')][_0x9957('0x123')](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x9957('0x6b')]['belongsTo'](db[_0x9957('0x64')],{'as':'Account','foreignKey':_0x9957('0x17d')});db['ChatOfflineMessage'][_0x9957('0x11a')](db[_0x9957('0x17a')],{'as':_0x9957('0x17b'),'foreignKey':_0x9957('0x198'),'onDelete':_0x9957('0x117'),'hooks':!![]});db[_0x9957('0x17e')][_0x9957('0x123')](db[_0x9957('0x160')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x9957('0x161')});db[_0x9957('0x17e')][_0x9957('0x123')](db[_0x9957('0x64')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x17d')});db[_0x9957('0x6e')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':_0x9957('0x135'),'hooks':!![]});db[_0x9957('0x6e')][_0x9957('0x126')](db['Team'],{'through':_0x9957('0x199'),'as':_0x9957('0x158')});db['ChatGroup'][_0x9957('0x11a')](db['ChatInternalMessage'],{'as':_0x9957('0x15a'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db['ChatGroup'][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x14c'),'through':_0x9957('0x127')});db[_0x9957('0x71')][_0x9957('0x123')](db[_0x9957('0x64')],{'as':'Website','foreignKey':_0x9957('0x17d')});db[_0x9957('0x73')][_0x9957('0x11a')](db[_0x9957('0x160')],{'as':_0x9957('0x128'),'foreignKey':_0x9957('0x19a')});db[_0x9957('0x160')][_0x9957('0x11a')](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x9957('0x19b')});db[_0x9957('0x160')][_0x9957('0x11a')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x9957('0x161')});db[_0x9957('0x160')][_0x9957('0x11a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x9957('0x161')});db[_0x9957('0x160')][_0x9957('0x11a')](db[_0x9957('0x11c')],{'as':_0x9957('0x14e'),'foreignKey':'ContactId'});db[_0x9957('0x160')]['hasMany'](db[_0x9957('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0x9957('0x161')});db['CmContact'][_0x9957('0x11a')](db[_0x9957('0x14f')],{'as':_0x9957('0x150'),'foreignKey':'ContactId'});db[_0x9957('0x160')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x9957('0x11e'),'foreignKey':'ContactId','onDelete':_0x9957('0x163')});db[_0x9957('0x160')][_0x9957('0x11a')](db[_0x9957('0x69')],{'as':_0x9957('0x11f'),'foreignKey':_0x9957('0x161'),'onDelete':_0x9957('0x163')});db[_0x9957('0x160')]['hasMany'](db['SmsInteraction'],{'as':_0x9957('0x19c'),'foreignKey':_0x9957('0x161'),'onDelete':_0x9957('0x163')});db[_0x9957('0x160')][_0x9957('0x11a')](db[_0x9957('0x50')],{'as':_0x9957('0x19d'),'foreignKey':'ContactId','onDelete':_0x9957('0x163')});db[_0x9957('0x160')][_0x9957('0x11a')](db[_0x9957('0x42')],{'as':_0x9957('0x120'),'foreignKey':_0x9957('0x161'),'onDelete':_0x9957('0x163')});db[_0x9957('0x160')][_0x9957('0x123')](db[_0x9957('0x73')],{'as':_0x9957('0x19e'),'foreignKey':_0x9957('0x19a')});db[_0x9957('0x160')]['belongsTo'](db[_0x9957('0x13a')],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d'),'onDelete':_0x9957('0x117')});db['CmContact']['belongsToMany'](db[_0x9957('0x12')],{'as':'Users','through':_0x9957('0x129')});db[_0x9957('0x160')]['belongsToMany'](db[_0x9957('0x91')],{'as':_0x9957('0x176'),'through':_0x9957('0x19f')});db['CmContact']['belongsToMany'](db[_0x9957('0x91')],{'through':_0x9957('0x19f'),'as':_0x9957('0x177')});db[_0x9957('0x76')][_0x9957('0x11a')](db[_0x9957('0x94')],{'as':'AdditionalPhones','foreignKey':_0x9957('0x1a0')});db['CmHopper'][_0x9957('0x123')](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161'),'onDelete':_0x9957('0x117')});db[_0x9957('0x76')]['belongsTo'](db[_0x9957('0x13a')],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d'),'onDelete':'cascade'});db[_0x9957('0x76')]['belongsTo'](db[_0x9957('0x12')],{'as':_0x9957('0x193'),'foreignKey':_0x9957('0x118')});db[_0x9957('0x76')][_0x9957('0x123')](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x9957('0x117')});db[_0x9957('0x76')]['belongsTo'](db[_0x9957('0xf1')],{'as':_0x9957('0xf1'),'foreignKey':'CampaignId','onDelete':_0x9957('0x117')});db[_0x9957('0x76')]['belongsTo'](db[_0x9957('0x12')],{'as':_0x9957('0x174'),'foreignKey':'OwnerId'});db[_0x9957('0x78')][_0x9957('0x123')](db[_0x9957('0x160')],{'as':'Contact','foreignKey':_0x9957('0x161'),'onDelete':_0x9957('0x117')});db[_0x9957('0x78')]['belongsTo'](db[_0x9957('0x13a')],{'as':'List','foreignKey':_0x9957('0x16d'),'onDelete':_0x9957('0x117')});db['CmHopperBlack'][_0x9957('0x123')](db['VoiceQueue'],{'as':_0x9957('0x194'),'foreignKey':_0x9957('0x14d'),'onDelete':_0x9957('0x117')});db[_0x9957('0x78')][_0x9957('0x123')](db[_0x9957('0xf1')],{'as':_0x9957('0xf1'),'foreignKey':'CampaignId','onDelete':_0x9957('0x117')});db[_0x9957('0x82')][_0x9957('0x11a')](db['Condition'],{'as':{'plural':_0x9957('0x1a1'),'singular':_0x9957('0x1a2')},'foreignKey':_0x9957('0x1a3'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x9957('0x11a')](db[_0x9957('0x86')],{'as':{'plural':'Any','singular':_0x9957('0x1a4')},'foreignKey':'AutomationAnyId','onDelete':_0x9957('0x117'),'hooks':!![]});db[_0x9957('0x82')][_0x9957('0x11a')](db[_0x9957('0x80')],{'as':_0x9957('0x1a5'),'foreignKey':'AutomationId','onDelete':_0x9957('0x117'),'hooks':!![]});db[_0x9957('0x166')]['hasMany'](db[_0x9957('0x166')],{'as':_0x9957('0x167'),'foreignKey':_0x9957('0x1a6'),'onDelete':_0x9957('0x117')});db['Interval'][_0x9957('0x11a')](db[_0x9957('0x87')],{'as':_0x9957('0x1a7'),'foreignKey':_0x9957('0x154'),'onDelete':_0x9957('0x117'),'hooks':!![],'required':![]});db[_0x9957('0x87')][_0x9957('0x11a')](db[_0x9957('0x18')],{'as':'Extensions','foreignKey':_0x9957('0x154'),'onDelete':_0x9957('0x163')});db[_0x9957('0x87')][_0x9957('0x11a')](db[_0x9957('0x45')],{'as':'MailApplications','foreignKey':_0x9957('0x154')});db['Interval'][_0x9957('0x11a')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x9957('0x87')]['hasMany'](db['FaxApplication'],{'as':_0x9957('0x1a8'),'foreignKey':_0x9957('0x154')});db['Interval'][_0x9957('0x11a')](db[_0x9957('0x57')],{'as':_0x9957('0x1a9'),'foreignKey':'IntervalId'});db['Schedule'][_0x9957('0x123')](db['MailAccount'],{});db[_0x9957('0x8f')][_0x9957('0x123')](db[_0x9957('0xa2')],{'foreignKey':_0x9957('0x1aa')});db[_0x9957('0x8f')][_0x9957('0x123')](db[_0x9957('0xa0')],{'foreignKey':_0x9957('0x1ab')});db[_0x9957('0x90')][_0x9957('0x126')](db[_0x9957('0x14a')],{'as':_0x9957('0x1ac'),'through':'moh_has_sounds','onDelete':'restrict'});db[_0x9957('0x91')][_0x9957('0x126')](db[_0x9957('0x160')],{'through':_0x9957('0x19f')});db[_0x9957('0x91')][_0x9957('0x126')](db[_0x9957('0x69')],{'through':'chat_interaction_has_tags'});db[_0x9957('0x91')][_0x9957('0x126')](db[_0x9957('0x42')],{'through':_0x9957('0x175')});db[_0x9957('0x91')][_0x9957('0x126')](db[_0x9957('0x58')],{'through':'sms_interaction_has_tags'});db[_0x9957('0x91')][_0x9957('0x126')](db[_0x9957('0x50')],{'through':_0x9957('0x1ad')});db[_0x9957('0x91')][_0x9957('0x126')](db[_0x9957('0x61')],{'through':_0x9957('0x18e')});db[_0x9957('0x91')][_0x9957('0x126')](db[_0x9957('0x106')],{'through':_0x9957('0x1ae')});db[_0x9957('0x93')]['belongsTo'](db['ContactItemType'],{'as':_0x9957('0x1af'),'foreignKey':'ItemTypeId'});db[_0x9957('0x94')][_0x9957('0x123')](db[_0x9957('0x76')],{'as':'Hopper','foreignKey':_0x9957('0x1a0')});db['CmContactHasItem'][_0x9957('0x123')](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x19b')});db[_0x9957('0x98')][_0x9957('0x11a')](db[_0x9957('0x86')],{'as':{'plural':_0x9957('0x1b0'),'singular':_0x9957('0x1b1')},'foreignKey':'TriggerAllId','onDelete':_0x9957('0x117'),'hooks':!![]});db[_0x9957('0x98')][_0x9957('0x11a')](db['Condition'],{'as':{'plural':_0x9957('0x1b2'),'singular':_0x9957('0x1b3')},'foreignKey':_0x9957('0x1b4'),'onDelete':_0x9957('0x117'),'hooks':!![]});db[_0x9957('0x98')][_0x9957('0x11a')](db[_0x9957('0x80')],{'as':_0x9957('0x1a5'),'foreignKey':_0x9957('0x1b5'),'onDelete':_0x9957('0x117'),'hooks':!![]});db[_0x9957('0xa0')][_0x9957('0x11a')](db['AnalyticFieldReport'],{'as':_0x9957('0x1b6'),'onDelete':_0x9957('0x117'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x9957('0xa2')][_0x9957('0x11a')](db[_0x9957('0xa7')],{'as':_0x9957('0x1b6'),'onDelete':_0x9957('0x117'),'foreignKey':'DefaultReportId'});db[_0x9957('0xa5')][_0x9957('0x11a')](db[_0x9957('0xa7')],{'as':_0x9957('0x1b6'),'onDelete':'cascade','foreignKey':_0x9957('0x1b7')});db[_0x9957('0xa7')][_0x9957('0x123')](db[_0x9957('0xa5')],{'foreignKey':_0x9957('0x1b7')});db[_0x9957('0xab')]['hasMany'](db[_0x9957('0x1b8')],{'as':_0x9957('0x1b9'),'onDelete':_0x9957('0x117'),'foreignKey':'AccountId'});db[_0x9957('0x1b8')][_0x9957('0x11a')](db[_0x9957('0xae')],{'as':_0x9957('0x1ba'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0x1b8')][_0x9957('0x11a')](db[_0x9957('0xae')],{'as':_0x9957('0x1bc'),'onDelete':'cascade','foreignKey':_0x9957('0x1bd')});db[_0x9957('0x1b8')][_0x9957('0x11a')](db[_0x9957('0xae')],{'as':_0x9957('0x1b6'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1be')});db[_0x9957('0x1b8')]['belongsTo'](db[_0x9957('0xab')],{'as':_0x9957('0x172'),'foreignKey':'AccountId'});db[_0x9957('0xae')][_0x9957('0x11a')](db[_0x9957('0xae')],{'as':'Subject','foreignKey':'SubjectId'});db['SalesforceField'][_0x9957('0x11a')](db['SalesforceField'],{'as':_0x9957('0x1bf'),'foreignKey':_0x9957('0x1bd')});db[_0x9957('0xae')][_0x9957('0x11a')](db['SalesforceField'],{'as':'Field','foreignKey':_0x9957('0x1be')});db[_0x9957('0xae')][_0x9957('0x123')](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':_0x9957('0x1c0')});db['SugarcrmAccount']['hasMany'](db[_0x9957('0xb2')],{'as':_0x9957('0x1b9'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1c1')});db['SugarcrmConfiguration']['hasMany'](db[_0x9957('0xb4')],{'as':_0x9957('0x1ba'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0xb2')][_0x9957('0x11a')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x9957('0x117'),'foreignKey':'DescriptionId'});db[_0x9957('0xb2')]['hasMany'](db[_0x9957('0xb4')],{'as':_0x9957('0x1b6'),'onDelete':'cascade','foreignKey':_0x9957('0x1be')});db[_0x9957('0xb2')]['belongsTo'](db[_0x9957('0xb0')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0xb4')][_0x9957('0x11a')](db[_0x9957('0xb4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9957('0xb4')][_0x9957('0x11a')](db['SugarcrmField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x9957('0xb4')]['hasMany'](db[_0x9957('0xb4')],{'as':'Field','foreignKey':'FieldId'});db[_0x9957('0xb4')][_0x9957('0x123')](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':'VariableId'});db[_0x9957('0xb6')]['hasMany'](db[_0x9957('0xb8')],{'as':_0x9957('0x1b9'),'onDelete':'cascade','foreignKey':_0x9957('0x1c1')});db[_0x9957('0xb8')]['hasMany'](db[_0x9957('0xba')],{'as':_0x9957('0x1ba'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0xb8')]['hasMany'](db[_0x9957('0xba')],{'as':_0x9957('0x1bc'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bd')});db[_0x9957('0xb8')][_0x9957('0x11a')](db[_0x9957('0xba')],{'as':_0x9957('0x1b6'),'onDelete':_0x9957('0x117'),'foreignKey':'FieldId'});db[_0x9957('0xb8')][_0x9957('0x123')](db[_0x9957('0xb6')],{'as':_0x9957('0x172'),'foreignKey':'AccountId'});db[_0x9957('0xb8')][_0x9957('0x126')](db[_0x9957('0x91')],{'through':_0x9957('0x1c2')});db[_0x9957('0xba')][_0x9957('0x11a')](db[_0x9957('0xba')],{'as':'Subject','foreignKey':_0x9957('0x1bb')});db[_0x9957('0xba')][_0x9957('0x11a')](db[_0x9957('0xba')],{'as':_0x9957('0x1bf'),'foreignKey':_0x9957('0x1bd')});db['DeskField'][_0x9957('0x11a')](db[_0x9957('0xba')],{'as':_0x9957('0x1c3'),'foreignKey':_0x9957('0x1be')});db[_0x9957('0xba')]['belongsTo'](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':_0x9957('0x1c0')});db[_0x9957('0xbc')][_0x9957('0x11a')](db['ZohoConfiguration'],{'as':_0x9957('0x1b9'),'onDelete':_0x9957('0x117'),'foreignKey':'AccountId'});db[_0x9957('0x1c4')][_0x9957('0x11a')](db[_0x9957('0x1c5')],{'as':'Subjects','onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0x1c4')][_0x9957('0x11a')](db['ZohoField'],{'as':_0x9957('0x1bc'),'onDelete':_0x9957('0x117'),'foreignKey':'DescriptionId'});db[_0x9957('0x1c4')][_0x9957('0x11a')](db[_0x9957('0x1c5')],{'as':_0x9957('0x1b6'),'onDelete':_0x9957('0x117'),'foreignKey':'FieldId'});db[_0x9957('0x1c4')][_0x9957('0x123')](db[_0x9957('0xbc')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0x1c5')][_0x9957('0x11a')](db['ZohoField'],{'as':'Subject','foreignKey':_0x9957('0x1bb')});db[_0x9957('0x1c5')][_0x9957('0x11a')](db[_0x9957('0x1c5')],{'as':'Description','foreignKey':_0x9957('0x1bd')});db[_0x9957('0x1c5')][_0x9957('0x11a')](db[_0x9957('0x1c5')],{'as':_0x9957('0x1c3'),'foreignKey':_0x9957('0x1be')});db[_0x9957('0x1c5')][_0x9957('0x123')](db[_0x9957('0x9a')],{'as':'Variable','foreignKey':'VariableId'});db[_0x9957('0x1c6')]['hasMany'](db[_0x9957('0xbf')],{'as':_0x9957('0x1b9'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0xbf')]['hasMany'](db[_0x9957('0xc1')],{'as':_0x9957('0x1ba'),'foreignKey':'SubjectId'});db[_0x9957('0xbf')]['hasMany'](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x9957('0x1bd')});db[_0x9957('0xbf')][_0x9957('0x11a')](db['ZendeskField'],{'as':_0x9957('0x1b6'),'foreignKey':_0x9957('0x1be')});db['ZendeskConfiguration'][_0x9957('0x123')](db[_0x9957('0x1c6')],{'as':_0x9957('0x172'),'foreignKey':'AccountId'});db[_0x9957('0xbf')][_0x9957('0x126')](db[_0x9957('0x91')],{'through':_0x9957('0x1c7')});db[_0x9957('0xc1')]['hasMany'](db[_0x9957('0xc1')],{'as':_0x9957('0x1c8'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0xc1')][_0x9957('0x11a')](db[_0x9957('0xc1')],{'as':'Description','foreignKey':_0x9957('0x1bd')});db[_0x9957('0xc1')][_0x9957('0x11a')](db[_0x9957('0xc1')],{'as':_0x9957('0x1c3'),'foreignKey':_0x9957('0x1be')});db[_0x9957('0xc1')][_0x9957('0x123')](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':_0x9957('0x1c0')});db[_0x9957('0xc3')][_0x9957('0x11a')](db[_0x9957('0xc5')],{'as':_0x9957('0x1b9'),'onDelete':_0x9957('0x117'),'foreignKey':'AccountId'});db[_0x9957('0xc5')][_0x9957('0x11a')](db[_0x9957('0xc7')],{'as':'Subjects','onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0xc5')][_0x9957('0x11a')](db[_0x9957('0xc7')],{'as':_0x9957('0x1bc'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bd')});db[_0x9957('0xc5')][_0x9957('0x11a')](db[_0x9957('0xc7')],{'as':'Fields','onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1be')});db['FreshdeskConfiguration'][_0x9957('0x123')](db[_0x9957('0xc3')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x1c1')});db['FreshdeskConfiguration'][_0x9957('0x126')](db[_0x9957('0x91')],{'through':_0x9957('0x1c9')});db[_0x9957('0xc7')][_0x9957('0x11a')](db[_0x9957('0xc7')],{'as':'Subject','foreignKey':_0x9957('0x1bb')});db[_0x9957('0xc7')][_0x9957('0x11a')](db['FreshdeskField'],{'as':_0x9957('0x1bf'),'foreignKey':'DescriptionId'});db[_0x9957('0xc7')]['hasMany'](db[_0x9957('0xc7')],{'as':_0x9957('0x1c3'),'foreignKey':_0x9957('0x1be')});db['FreshdeskField'][_0x9957('0x123')](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':_0x9957('0x1c0')});db[_0x9957('0x1ca')][_0x9957('0x11a')](db[_0x9957('0xca')],{'as':_0x9957('0x1b9'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0xca')][_0x9957('0x11a')](db[_0x9957('0xcc')],{'as':_0x9957('0x1ba'),'foreignKey':'SubjectId'});db[_0x9957('0xca')][_0x9957('0x11a')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x9957('0x1bd')});db['VtigerConfiguration']['hasMany'](db[_0x9957('0xcc')],{'as':_0x9957('0x1b6'),'foreignKey':_0x9957('0x1be')});db[_0x9957('0xca')][_0x9957('0x123')](db['VtigerAccount'],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0xcc')]['hasMany'](db[_0x9957('0xcc')],{'as':_0x9957('0x1c8'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0xcc')][_0x9957('0x11a')](db[_0x9957('0xcc')],{'as':_0x9957('0x1bf'),'foreignKey':'DescriptionId'});db[_0x9957('0xcc')][_0x9957('0x11a')](db[_0x9957('0xcc')],{'as':_0x9957('0x1c3'),'foreignKey':_0x9957('0x1be')});db[_0x9957('0xcc')][_0x9957('0x123')](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':_0x9957('0x1c0')});db[_0x9957('0xcd')][_0x9957('0x11a')](db[_0x9957('0x1cb')],{'as':'Configurations','onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0x1cb')][_0x9957('0x11a')](db['ServicenowField'],{'as':_0x9957('0x1ba'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0x1cb')][_0x9957('0x11a')](db[_0x9957('0x1cc')],{'as':_0x9957('0x1bc'),'foreignKey':_0x9957('0x1bd')});db[_0x9957('0x1cb')]['hasMany'](db[_0x9957('0x1cc')],{'as':_0x9957('0x1b6'),'foreignKey':_0x9957('0x1be')});db[_0x9957('0x1cb')][_0x9957('0x123')](db['ServicenowAccount'],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x1c1')});db['ServicenowField'][_0x9957('0x11a')](db[_0x9957('0x1cc')],{'as':_0x9957('0x1c8'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0x1cc')][_0x9957('0x11a')](db['ServicenowField'],{'as':'Description','foreignKey':_0x9957('0x1bd')});db[_0x9957('0x1cc')][_0x9957('0x11a')](db[_0x9957('0x1cc')],{'as':'Field','foreignKey':_0x9957('0x1be')});db[_0x9957('0x1cc')][_0x9957('0x123')](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':_0x9957('0x1c0')});db[_0x9957('0x1cd')][_0x9957('0x11a')](db[_0x9957('0xd2')],{'as':_0x9957('0x1b9'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0x1cd')]['belongsTo'](db[_0x9957('0x10d')],{'as':_0x9957('0x10d'),'foreignKey':_0x9957('0x1ce')});db[_0x9957('0xd2')][_0x9957('0x11a')](db['Dynamics365Field'],{'as':_0x9957('0x1ba'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0xd2')][_0x9957('0x11a')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1bd')});db[_0x9957('0xd2')][_0x9957('0x11a')](db[_0x9957('0x1cf')],{'as':_0x9957('0x1b6'),'onDelete':'cascade','foreignKey':_0x9957('0x1be')});db[_0x9957('0xd2')][_0x9957('0x123')](db[_0x9957('0x1cd')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0x1cf')]['hasMany'](db[_0x9957('0x1cf')],{'as':_0x9957('0x1c8'),'foreignKey':'SubjectId'});db[_0x9957('0x1cf')][_0x9957('0x11a')](db[_0x9957('0x1cf')],{'as':_0x9957('0x1bf'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x9957('0x11a')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x9957('0x1be')});db[_0x9957('0x1cf')][_0x9957('0x123')](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':'VariableId'});db[_0x9957('0xd5')][_0x9957('0x11a')](db[_0x9957('0xd7')],{'as':_0x9957('0x1b9'),'onDelete':_0x9957('0x117'),'foreignKey':_0x9957('0x1c1')});db[_0x9957('0xd7')]['hasMany'](db[_0x9957('0x1d0')],{'as':_0x9957('0x1ba'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0xd7')][_0x9957('0x11a')](db[_0x9957('0x1d0')],{'as':_0x9957('0x1bc'),'foreignKey':_0x9957('0x1bd')});db[_0x9957('0xd7')][_0x9957('0x11a')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x9957('0x1be')});db[_0x9957('0xd7')][_0x9957('0x123')](db['FreshsalesAccount'],{'as':_0x9957('0x172'),'foreignKey':'AccountId'});db[_0x9957('0x1d0')]['hasMany'](db['FreshsalesField'],{'as':_0x9957('0x1c8'),'foreignKey':_0x9957('0x1bb')});db[_0x9957('0x1d0')][_0x9957('0x11a')](db['FreshsalesField'],{'as':_0x9957('0x1bf'),'foreignKey':_0x9957('0x1bd')});db[_0x9957('0x1d0')][_0x9957('0x11a')](db[_0x9957('0x1d0')],{'as':'Field','foreignKey':_0x9957('0x1be')});db[_0x9957('0x1d0')]['belongsTo'](db[_0x9957('0x9a')],{'as':_0x9957('0x9a'),'foreignKey':_0x9957('0x1c0')});db[_0x9957('0x1d1')][_0x9957('0x123')](db['ChatWebsite'],{});db[_0x9957('0x1d1')][_0x9957('0x123')](db[_0x9957('0x13a')],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x1d1')][_0x9957('0x123')](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161')});db[_0x9957('0x1d1')][_0x9957('0x123')](db[_0x9957('0x69')],{});db[_0x9957('0x1d1')][_0x9957('0x123')](db[_0x9957('0x6b')],{});db[_0x9957('0x1d1')][_0x9957('0x123')](db[_0x9957('0x12')],{});db[_0x9957('0x1d1')][_0x9957('0x123')](db[_0x9957('0x6e')],{});db['ChatInternalMessage'][_0x9957('0x123')](db[_0x9957('0x12')],{'onDelete':'cascade','foreignKey':_0x9957('0x1d2')});db[_0x9957('0xdc')][_0x9957('0x123')](db[_0x9957('0x12')],{'onDelete':'cascade','foreignKey':_0x9957('0x1d3')});db['JscriptySessionReport'][_0x9957('0x11a')](db['JscriptyQuestionReport'],{'foreignKey':_0x9957('0x1d4'),'onDelete':_0x9957('0x117')});db['JscriptySessionReport'][_0x9957('0x11a')](db[_0x9957('0xde')],{'foreignKey':_0x9957('0x1d4'),'onDelete':_0x9957('0x117')});db[_0x9957('0xe1')][_0x9957('0x123')](db[_0x9957('0x55')],{});db[_0x9957('0xe1')][_0x9957('0x123')](db[_0x9957('0x13a')],{'as':'List','foreignKey':'ListId'});db[_0x9957('0xe1')]['belongsTo'](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':'ContactId'});db[_0x9957('0xe1')][_0x9957('0x123')](db[_0x9957('0x58')],{});db[_0x9957('0xe1')][_0x9957('0x123')](db['SmsMessage'],{});db[_0x9957('0xe1')][_0x9957('0x123')](db[_0x9957('0x12')],{});db['SmsQueueReport'][_0x9957('0x123')](db[_0x9957('0x5c')],{});db['JscriptyProject']['hasMany'](db[_0x9957('0x14f')],{'foreignKey':_0x9957('0x1d5')});db[_0x9957('0xe5')]['hasMany'](db[_0x9957('0x1d6')],{'foreignKey':_0x9957('0x1d5')});db[_0x9957('0xe5')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x9957('0x1d5')});db[_0x9957('0xe8')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x178'),'through':_0x9957('0x146')});db[_0x9957('0xed')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':'user_has_teams'});db[_0x9957('0xed')][_0x9957('0x126')](db['VoiceQueue'],{'through':_0x9957('0x10f'),'as':_0x9957('0x130')});db['Team']['belongsToMany'](db[_0x9957('0x3e')],{'through':_0x9957('0x170'),'as':_0x9957('0x133')});db[_0x9957('0xed')]['belongsToMany'](db[_0x9957('0x6e')],{'through':_0x9957('0x199'),'as':_0x9957('0x134')});db[_0x9957('0xed')]['belongsToMany'](db['FaxQueue'],{'through':_0x9957('0x185'),'as':_0x9957('0x1d7')});db['Team']['belongsToMany'](db[_0x9957('0x5c')],{'through':_0x9957('0x18a'),'as':'SmsQueues'});db[_0x9957('0xed')][_0x9957('0x126')](db[_0x9957('0x138')],{'through':'team_has_openchannel_queues','as':_0x9957('0x139')});db[_0x9957('0xed')][_0x9957('0x126')](db[_0x9957('0x10b')],{'through':_0x9957('0x1d8'),'as':'WhatsappQueues'});db[_0x9957('0xed')][_0x9957('0x126')](db[_0x9957('0x131')],{'through':_0x9957('0x110'),'as':_0x9957('0x132')});db[_0x9957('0xf1')]['hasMany'](db['CmHopper'],{'as':_0x9957('0x1d9'),'foreignKey':_0x9957('0x1da')});db['Campaign'][_0x9957('0x11a')](db[_0x9957('0x7a')],{'as':_0x9957('0x1db'),'foreignKey':_0x9957('0x1da')});db[_0x9957('0xf1')][_0x9957('0x11a')](db[_0x9957('0x11c')],{'as':_0x9957('0x14e'),'foreignKey':_0x9957('0x1da')});db[_0x9957('0xf1')][_0x9957('0x11a')](db[_0x9957('0x78')],{'as':_0x9957('0x1dc'),'foreignKey':_0x9957('0x1da')});db[_0x9957('0xf1')][_0x9957('0x123')](db[_0x9957('0x28')],{'as':_0x9957('0x28'),'foreignKey':_0x9957('0x151')});db[_0x9957('0xf1')][_0x9957('0x123')](db['Trunk'],{'as':_0x9957('0x152'),'foreignKey':_0x9957('0x153')});db[_0x9957('0xf1')][_0x9957('0x123')](db[_0x9957('0x87')],{'as':_0x9957('0x87'),'foreignKey':_0x9957('0x154')});db[_0x9957('0xf1')][_0x9957('0x123')](db[_0x9957('0xe8')],{'as':_0x9957('0xe8'),'foreignKey':_0x9957('0x1dd')});db[_0x9957('0xf1')][_0x9957('0x126')](db[_0x9957('0x13a')],{'as':_0x9957('0x12a'),'through':_0x9957('0x1de')});db['Campaign']['belongsToMany'](db[_0x9957('0x13a')],{'as':_0x9957('0x159'),'through':_0x9957('0x1df')});db[_0x9957('0x17a')][_0x9957('0x123')](db[_0x9957('0x17e')],{'as':_0x9957('0x17e'),'foreignKey':'ChatOfflineMessageId'});db[_0x9957('0x1e0')][_0x9957('0x123')](db[_0x9957('0x16a')],{});db['MailTransferReport'][_0x9957('0x123')](db[_0x9957('0x42')],{});db[_0x9957('0x1e0')]['belongsTo'](db[_0x9957('0x3c')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0x9957('0x1e0')][_0x9957('0x123')](db[_0x9957('0x12')],{'foreignKey':_0x9957('0x1e1'),'as':_0x9957('0x1e2')});db[_0x9957('0x1e0')][_0x9957('0x123')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9957('0x1e0')][_0x9957('0x123')](db[_0x9957('0x3e')],{'foreignKey':_0x9957('0x1e3'),'as':_0x9957('0x1e4')});db[_0x9957('0x1e0')]['belongsTo'](db[_0x9957('0x3c')],{'foreignKey':'ToMailAccountId','as':_0x9957('0x1e5')});db[_0x9957('0x1e6')][_0x9957('0x123')](db[_0x9957('0x6b')],{});db[_0x9957('0x1e6')][_0x9957('0x123')](db['ChatInteraction'],{});db[_0x9957('0x1e6')]['belongsTo'](db[_0x9957('0x64')],{'foreignKey':_0x9957('0x1e7'),'as':_0x9957('0x1e8')});db[_0x9957('0x1e6')]['belongsTo'](db[_0x9957('0x12')],{'foreignKey':_0x9957('0x1e1'),'as':_0x9957('0x1e2')});db[_0x9957('0x1e6')][_0x9957('0x123')](db[_0x9957('0x12')],{'foreignKey':_0x9957('0x1e9'),'as':'ToAgent'});db[_0x9957('0x1e6')][_0x9957('0x123')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x9957('0x1e4')});db[_0x9957('0x1e6')][_0x9957('0x123')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0x9957('0xf9')]['belongsTo'](db[_0x9957('0x51')],{});db['FaxTransferReport'][_0x9957('0x123')](db[_0x9957('0x50')],{});db[_0x9957('0xf9')][_0x9957('0x123')](db[_0x9957('0x4c')],{'foreignKey':'FromFaxAccountId','as':_0x9957('0x1e8')});db[_0x9957('0xf9')][_0x9957('0x123')](db[_0x9957('0x12')],{'foreignKey':_0x9957('0x1e1'),'as':_0x9957('0x1e2')});db['FaxTransferReport'][_0x9957('0x123')](db[_0x9957('0x12')],{'foreignKey':'ToUserId','as':_0x9957('0x1ea')});db[_0x9957('0xf9')][_0x9957('0x123')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x9957('0x1e4')});db[_0x9957('0xf9')]['belongsTo'](db[_0x9957('0x4c')],{'foreignKey':_0x9957('0x1eb'),'as':_0x9957('0x1e5')});db['OpenchannelTransferReport'][_0x9957('0x123')](db[_0x9957('0x18c')],{});db[_0x9957('0x1ec')][_0x9957('0x123')](db[_0x9957('0x61')],{});db[_0x9957('0x1ec')][_0x9957('0x123')](db['OpenchannelAccount'],{'foreignKey':_0x9957('0x1ed'),'as':_0x9957('0x1e8')});db[_0x9957('0x1ec')][_0x9957('0x123')](db[_0x9957('0x12')],{'foreignKey':_0x9957('0x1e1'),'as':_0x9957('0x1e2')});db[_0x9957('0x1ec')][_0x9957('0x123')](db['User'],{'foreignKey':'ToUserId','as':_0x9957('0x1ea')});db[_0x9957('0x1ec')][_0x9957('0x123')](db[_0x9957('0x138')],{'foreignKey':_0x9957('0x1ee'),'as':'ToQueue'});db[_0x9957('0x1ec')][_0x9957('0x123')](db['OpenchannelAccount'],{'foreignKey':_0x9957('0x1ef'),'as':_0x9957('0x1e5')});db[_0x9957('0x1f0')][_0x9957('0x123')](db[_0x9957('0x5a')],{});db[_0x9957('0x1f0')][_0x9957('0x123')](db[_0x9957('0x58')],{});db[_0x9957('0x1f0')][_0x9957('0x123')](db[_0x9957('0x55')],{'foreignKey':_0x9957('0x1f1'),'as':_0x9957('0x1e8')});db[_0x9957('0x1f0')][_0x9957('0x123')](db[_0x9957('0x12')],{'foreignKey':_0x9957('0x1e1'),'as':_0x9957('0x1e2')});db[_0x9957('0x1f0')]['belongsTo'](db[_0x9957('0x12')],{'foreignKey':_0x9957('0x1e9'),'as':_0x9957('0x1ea')});db[_0x9957('0x1f0')][_0x9957('0x123')](db['SmsQueue'],{'foreignKey':_0x9957('0x1f2'),'as':_0x9957('0x1e4')});db['SmsTransferReport'][_0x9957('0x123')](db[_0x9957('0x55')],{'foreignKey':'ToSmsAccountId','as':_0x9957('0x1e5')});db[_0x9957('0x13a')]['hasMany'](db[_0x9957('0x166')],{'as':_0x9957('0x167'),'foreignKey':_0x9957('0x16d'),'onDelete':'cascade'});db[_0x9957('0x13a')][_0x9957('0x11a')](db[_0x9957('0x7f')],{'as':_0x9957('0x1f3'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x13a')]['hasMany'](db[_0x9957('0x160')],{'as':_0x9957('0x128'),'onDelete':'cascade','foreignKey':'ListId'});db['CmList']['hasMany'](db['CmHopperFinal'],{'as':_0x9957('0x1db'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x13a')][_0x9957('0x11a')](db['CmHopperHistory'],{'as':_0x9957('0x11d'),'foreignKey':'ListId'});db[_0x9957('0x13a')][_0x9957('0x11a')](db[_0x9957('0x7d')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db['CmList']['belongsToMany'](db[_0x9957('0x1b')],{'as':_0x9957('0x1f4'),'through':'voice_queues_has_cm_lists'});db[_0x9957('0x13a')][_0x9957('0x126')](db['User'],{'as':_0x9957('0x157'),'through':_0x9957('0x13b')});db[_0x9957('0x131')][_0x9957('0x11a')](db[_0x9957('0x18')],{'as':'Extensions','onDelete':_0x9957('0x117')});db[_0x9957('0x131')][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x157'),'through':_0x9957('0x112')});db[_0x9957('0x131')][_0x9957('0x126')](db[_0x9957('0xed')],{'through':_0x9957('0x110'),'as':_0x9957('0x158')});db['UserProfile'][_0x9957('0x11a')](db['User'],{'as':_0x9957('0x178'),'foreignKey':_0x9957('0x125')});db['UserProfile'][_0x9957('0x11a')](db[_0x9957('0x100')],{'as':_0x9957('0x1f5'),'foreignKey':_0x9957('0x125'),'onDelete':_0x9957('0x117')});db[_0x9957('0x100')][_0x9957('0x11a')](db['UserProfileResource'],{'as':_0x9957('0x1f6'),'foreignKey':_0x9957('0x1f7'),'onDelete':_0x9957('0x117')});db[_0x9957('0x103')][_0x9957('0x11a')](db['Disposition'],{'as':_0x9957('0x167'),'foreignKey':'WhatsappAccountId','onDelete':_0x9957('0x117')});db[_0x9957('0x103')]['hasMany'](db[_0x9957('0x168')],{'as':_0x9957('0x169'),'foreignKey':_0x9957('0x1f8')});db[_0x9957('0x103')][_0x9957('0x11a')](db[_0x9957('0x108')],{'as':_0x9957('0x15a'),'foreignKey':_0x9957('0x1f8')});db['WhatsappAccount']['hasMany'](db[_0x9957('0x106')],{'as':_0x9957('0x16b')});db[_0x9957('0x103')][_0x9957('0x11a')](db[_0x9957('0x105')],{'as':'Applications','foreignKey':_0x9957('0x1f8'),'onDelete':_0x9957('0x117')});db[_0x9957('0x103')][_0x9957('0x123')](db[_0x9957('0x13a')],{'as':'List','foreignKey':'ListId'});db[_0x9957('0x103')][_0x9957('0x123')](db[_0x9957('0x89')],{'as':_0x9957('0x155'),'foreignKey':_0x9957('0x16f')});db['WhatsappAccount']['belongsToMany'](db[_0x9957('0x12')],{'as':'Agents','through':_0x9957('0x144')});db[_0x9957('0x105')]['belongsTo'](db['User'],{'onDelete':'restrict'});db['WhatsappApplication'][_0x9957('0x123')](db[_0x9957('0x10b')],{'onDelete':'restrict'});db[_0x9957('0x105')][_0x9957('0x123')](db['WhatsappAccount'],{'onDelete':_0x9957('0x163')});db[_0x9957('0x105')]['belongsTo'](db[_0x9957('0x87')],{'onDelete':_0x9957('0x163'),'foreignKey':_0x9957('0x154')});db[_0x9957('0x105')][_0x9957('0x123')](db[_0x9957('0x91')],{'onDelete':'restrict','foreignKey':_0x9957('0x17f')});db['WhatsappInteraction'][_0x9957('0x11a')](db[_0x9957('0x108')],{'as':_0x9957('0x15a'),'onDelete':_0x9957('0x117'),'foreignKey':'WhatsappInteractionId'});db[_0x9957('0x106')][_0x9957('0x123')](db[_0x9957('0x103')],{'as':_0x9957('0x172'),'foreignKey':_0x9957('0x1f8')});db[_0x9957('0x106')]['belongsTo'](db[_0x9957('0x160')],{'as':'Contact','foreignKey':_0x9957('0x161')});db[_0x9957('0x106')][_0x9957('0x123')](db[_0x9957('0x12')],{'as':_0x9957('0x174'),'foreignKey':_0x9957('0x118')});db['WhatsappInteraction']['belongsToMany'](db[_0x9957('0x91')],{'through':_0x9957('0x1ae'),'as':_0x9957('0x176')});db[_0x9957('0x106')][_0x9957('0x126')](db[_0x9957('0x91')],{'through':_0x9957('0x1ae'),'as':'ThroughTags'});db['WhatsappInteraction'][_0x9957('0x126')](db[_0x9957('0x12')],{'as':_0x9957('0x178'),'through':_0x9957('0x12f'),'foreignKey':_0x9957('0x1f9')});db[_0x9957('0x108')]['belongsTo'](db[_0x9957('0x12')],{'as':'User'});db[_0x9957('0x108')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x9957('0x173')});db[_0x9957('0x108')]['belongsTo'](db[_0x9957('0x106')],{'onDelete':_0x9957('0x117'),'as':_0x9957('0x17c'),'foreignKey':_0x9957('0x1f9')});db['WhatsappMessage'][_0x9957('0x123')](db[_0x9957('0x103')],{'as':'Account','foreignKey':_0x9957('0x1f8')});db[_0x9957('0x1fa')][_0x9957('0x123')](db['WhatsappAccount'],{});db[_0x9957('0x1fa')]['belongsTo'](db[_0x9957('0x13a')],{'as':_0x9957('0x16c'),'foreignKey':_0x9957('0x16d')});db[_0x9957('0x1fa')]['belongsTo'](db[_0x9957('0x160')],{'as':_0x9957('0x173'),'foreignKey':_0x9957('0x161')});db[_0x9957('0x1fa')][_0x9957('0x123')](db[_0x9957('0x106')],{});db[_0x9957('0x1fa')][_0x9957('0x123')](db[_0x9957('0x10b')],{});db[_0x9957('0x1fa')][_0x9957('0x123')](db['WhatsappMessage'],{});db[_0x9957('0x1fa')][_0x9957('0x123')](db[_0x9957('0x12')],{});db[_0x9957('0x1fb')]['belongsTo'](db[_0x9957('0x108')],{});db[_0x9957('0x1fb')][_0x9957('0x123')](db[_0x9957('0x106')],{});db[_0x9957('0x1fb')][_0x9957('0x123')](db[_0x9957('0x103')],{'foreignKey':'FromWhatsappAccountId','as':_0x9957('0x1e8')});db['WhatsappTransferReport']['belongsTo'](db[_0x9957('0x103')],{'foreignKey':_0x9957('0x1fc'),'as':_0x9957('0x1e5')});db[_0x9957('0x1fb')][_0x9957('0x123')](db['WhatsappQueue'],{'foreignKey':_0x9957('0x1fd'),'as':_0x9957('0x1e4')});db[_0x9957('0x1fb')][_0x9957('0x123')](db['User'],{'foreignKey':_0x9957('0x1e1'),'as':_0x9957('0x1e2')});db[_0x9957('0x1fb')]['belongsTo'](db[_0x9957('0x12')],{'foreignKey':_0x9957('0x1e9'),'as':_0x9957('0x1ea')});db[_0x9957('0x10b')][_0x9957('0x126')](db['User'],{'as':_0x9957('0x157'),'through':_0x9957('0x1fe'),'foreignKey':_0x9957('0x1ff')});db[_0x9957('0x10b')]['belongsToMany'](db[_0x9957('0xed')],{'through':_0x9957('0x1d8'),'as':'Teams'});db['UserSetting'][_0x9957('0x123')](db[_0x9957('0x12')],{'as':'user','foreignKey':_0x9957('0x118'),'onDelete':_0x9957('0x117'),'hooks':!![]});db['CloudProvider'][_0x9957('0x116')](db[_0x9957('0x1cd')],{'as':_0x9957('0x1cd'),'onDelete':'restrict'});db[_0x9957('0x10d')][_0x9957('0x116')](db[_0x9957('0x38')],{'as':_0x9957('0x164'),'onDelete':_0x9957('0x163')});db[_0x9957('0x10d')][_0x9957('0x116')](db[_0x9957('0x3a')],{'as':_0x9957('0x165'),'onDelete':_0x9957('0x163')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 1848113..e29a1ce 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0042=['./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','./api/userProfileSection','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','get','appPath','/index.html','path','express','./config/environment','./utils/client-side-logger','./api/client-side-logs','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/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticDefaultReport','/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/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0042,0x18b));var _0x2004=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x0042[_0x38fb8b];return _0x1ec681;};'use strict';var path=require(_0x2004('0x0'));var express=require(_0x2004('0x1'));var errors=require('./errors');var config=require(_0x2004('0x2'));var setupLoggers=require(_0x2004('0x3'))['setupLoggers'];var clientSideLogs=require(_0x2004('0x4'));exports['default']=function(_0x378307){return setupLoggers(_0x378307)['then'](function(){_0x378307[_0x2004('0x5')](_0x2004('0x6'),require(_0x2004('0x7')));_0x378307[_0x2004('0x5')](_0x2004('0x8'),require(_0x2004('0x9')));_0x378307['use'](_0x2004('0xa'),require(_0x2004('0xb')));_0x378307[_0x2004('0x5')](_0x2004('0xc'),require(_0x2004('0xd')));_0x378307['use'](_0x2004('0xe'),require(_0x2004('0xf')));_0x378307[_0x2004('0x5')](_0x2004('0x10'),require('./api/voiceQueue'));_0x378307[_0x2004('0x5')](_0x2004('0x11'),require(_0x2004('0x12')));_0x378307[_0x2004('0x5')]('/api/screen/recordings',require(_0x2004('0x13')));_0x378307[_0x2004('0x5')](_0x2004('0x14'),require(_0x2004('0x15')));_0x378307[_0x2004('0x5')](_0x2004('0x16'),require('./api/voiceMailMessage'));_0x378307['use']('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x378307['use'](_0x2004('0x17'),require('./api/voiceDialReport'));_0x378307['use'](_0x2004('0x18'),require(_0x2004('0x19')));_0x378307[_0x2004('0x5')](_0x2004('0x1a'),require(_0x2004('0x1b')));_0x378307[_0x2004('0x5')](_0x2004('0x1c'),require(_0x2004('0x1d')));_0x378307[_0x2004('0x5')](_0x2004('0x1e'),require('./api/trunk'));_0x378307[_0x2004('0x5')](_0x2004('0x1f'),require('./api/voiceTransferReport'));_0x378307[_0x2004('0x5')](_0x2004('0x20'),require('./api/mailServerOut'));_0x378307[_0x2004('0x5')]('/api/mail/accounts',require(_0x2004('0x21')));_0x378307[_0x2004('0x5')]('/api/mail/queues',require(_0x2004('0x22')));_0x378307['use']('/api/mail/substatuses',require(_0x2004('0x23')));_0x378307[_0x2004('0x5')](_0x2004('0x24'),require(_0x2004('0x25')));_0x378307[_0x2004('0x5')](_0x2004('0x26'),require(_0x2004('0x27')));_0x378307[_0x2004('0x5')](_0x2004('0x28'),require('./api/mailApplication'));_0x378307[_0x2004('0x5')](_0x2004('0x29'),require('./api/mailQueueReport'));_0x378307[_0x2004('0x5')](_0x2004('0x2a'),require(_0x2004('0x2b')));_0x378307['use'](_0x2004('0x2c'),require(_0x2004('0x2d')));_0x378307[_0x2004('0x5')](_0x2004('0x2e'),require('./api/faxAccount'));_0x378307[_0x2004('0x5')](_0x2004('0x2f'),require(_0x2004('0x30')));_0x378307[_0x2004('0x5')](_0x2004('0x31'),require(_0x2004('0x32')));_0x378307[_0x2004('0x5')](_0x2004('0x33'),require(_0x2004('0x34')));_0x378307[_0x2004('0x5')](_0x2004('0x35'),require(_0x2004('0x36')));_0x378307[_0x2004('0x5')](_0x2004('0x37'),require('./api/faxQueueReport'));_0x378307[_0x2004('0x5')](_0x2004('0x38'),require('./api/smsAccount'));_0x378307['use'](_0x2004('0x39'),require('./api/smsApplication'));_0x378307['use'](_0x2004('0x3a'),require(_0x2004('0x3b')));_0x378307[_0x2004('0x5')](_0x2004('0x3c'),require(_0x2004('0x3d')));_0x378307['use'](_0x2004('0x3e'),require(_0x2004('0x3f')));_0x378307['use']('/api/openchannel/accounts',require(_0x2004('0x40')));_0x378307[_0x2004('0x5')](_0x2004('0x41'),require(_0x2004('0x42')));_0x378307[_0x2004('0x5')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x378307['use']('/api/openchannel/messages',require(_0x2004('0x43')));_0x378307[_0x2004('0x5')](_0x2004('0x44'),require(_0x2004('0x45')));_0x378307[_0x2004('0x5')](_0x2004('0x46'),require(_0x2004('0x47')));_0x378307[_0x2004('0x5')]('/api/openchannel/reports/queue',require(_0x2004('0x48')));_0x378307[_0x2004('0x5')](_0x2004('0x49'),require('./api/chatApplication'));_0x378307[_0x2004('0x5')](_0x2004('0x4a'),require(_0x2004('0x4b')));_0x378307['use']('/api/chat/messages',require(_0x2004('0x4c')));_0x378307[_0x2004('0x5')](_0x2004('0x4d'),require(_0x2004('0x4e')));_0x378307[_0x2004('0x5')]('/api/chat/queues',require(_0x2004('0x4f')));_0x378307[_0x2004('0x5')](_0x2004('0x50'),require(_0x2004('0x51')));_0x378307[_0x2004('0x5')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x378307[_0x2004('0x5')]('/api/cm/companies',require(_0x2004('0x52')));_0x378307['use'](_0x2004('0x53'),require(_0x2004('0x54')));_0x378307[_0x2004('0x5')](_0x2004('0x55'),require('./api/cmHopper'));_0x378307['use']('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x378307['use'](_0x2004('0x56'),require(_0x2004('0x57')));_0x378307['use'](_0x2004('0x58'),require(_0x2004('0x59')));_0x378307['use'](_0x2004('0x5a'),require(_0x2004('0x5b')));_0x378307[_0x2004('0x5')](_0x2004('0x5c'),require('./api/action'));_0x378307[_0x2004('0x5')](_0x2004('0x5d'),require(_0x2004('0x5e')));_0x378307[_0x2004('0x5')](_0x2004('0x5f'),require('./api/cannedAnswer'));_0x378307[_0x2004('0x5')]('/api/dispositions',require(_0x2004('0x60')));_0x378307[_0x2004('0x5')](_0x2004('0x61'),require('./api/condition'));_0x378307[_0x2004('0x5')](_0x2004('0x62'),require('./api/interval'));_0x378307['use'](_0x2004('0x63'),require(_0x2004('0x64')));_0x378307[_0x2004('0x5')](_0x2004('0x65'),require(_0x2004('0x66')));_0x378307[_0x2004('0x5')](_0x2004('0x67'),require(_0x2004('0x68')));_0x378307[_0x2004('0x5')](_0x2004('0x69'),require('./api/schedule'));_0x378307[_0x2004('0x5')]('/api/sounds',require(_0x2004('0x6a')));_0x378307['use'](_0x2004('0x6b'),require('./api/tag'));_0x378307[_0x2004('0x5')](_0x2004('0x6c'),require(_0x2004('0x6d')));_0x378307[_0x2004('0x5')](_0x2004('0x6e'),require('./api/cmContactHasItem'));_0x378307[_0x2004('0x5')](_0x2004('0x6f'),require(_0x2004('0x70')));_0x378307[_0x2004('0x5')](_0x2004('0x71'),require(_0x2004('0x72')));_0x378307['use']('/api/triggers',require(_0x2004('0x73')));_0x378307['use'](_0x2004('0x74'),require(_0x2004('0x75')));_0x378307['use'](_0x2004('0x76'),require(_0x2004('0x77')));_0x378307['use'](_0x2004('0x78'),require('./api/integrationReport'));_0x378307[_0x2004('0x5')](_0x2004('0x79'),require('./api/analyticCustomReport'));_0x378307[_0x2004('0x5')]('/api/analytics/default_reports',require(_0x2004('0x7a')));_0x378307[_0x2004('0x5')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x378307[_0x2004('0x5')](_0x2004('0x7b'),require(_0x2004('0x7c')));_0x378307[_0x2004('0x5')](_0x2004('0x7d'),require(_0x2004('0x7e')));_0x378307[_0x2004('0x5')](_0x2004('0x7f'),require(_0x2004('0x80')));_0x378307[_0x2004('0x5')](_0x2004('0x81'),require(_0x2004('0x82')));_0x378307[_0x2004('0x5')](_0x2004('0x83'),require(_0x2004('0x84')));_0x378307[_0x2004('0x5')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x378307[_0x2004('0x5')](_0x2004('0x85'),require('./api/intSugarcrmAccount'));_0x378307['use'](_0x2004('0x86'),require(_0x2004('0x87')));_0x378307[_0x2004('0x5')]('/api/integrations/sugarcrm/fields',require(_0x2004('0x88')));_0x378307['use']('/api/integrations/desk/accounts',require(_0x2004('0x89')));_0x378307['use'](_0x2004('0x8a'),require(_0x2004('0x8b')));_0x378307['use']('/api/integrations/desk/fields',require(_0x2004('0x8c')));_0x378307[_0x2004('0x5')](_0x2004('0x8d'),require(_0x2004('0x8e')));_0x378307[_0x2004('0x5')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x378307[_0x2004('0x5')]('/api/integrations/zoho/fields',require(_0x2004('0x8f')));_0x378307[_0x2004('0x5')]('/api/integrations/zendesk/accounts',require(_0x2004('0x90')));_0x378307[_0x2004('0x5')]('/api/integrations/zendesk/configurations',require(_0x2004('0x91')));_0x378307[_0x2004('0x5')](_0x2004('0x92'),require(_0x2004('0x93')));_0x378307['use']('/api/integrations/freshdesk/accounts',require(_0x2004('0x94')));_0x378307[_0x2004('0x5')](_0x2004('0x95'),require(_0x2004('0x96')));_0x378307[_0x2004('0x5')](_0x2004('0x97'),require('./api/intFreshdeskField'));_0x378307['use'](_0x2004('0x98'),require(_0x2004('0x99')));_0x378307[_0x2004('0x5')](_0x2004('0x9a'),require(_0x2004('0x9b')));_0x378307[_0x2004('0x5')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x378307[_0x2004('0x5')](_0x2004('0x9c'),require(_0x2004('0x9d')));_0x378307[_0x2004('0x5')]('/api/integrations/servicenow/configurations',require(_0x2004('0x9e')));_0x378307[_0x2004('0x5')](_0x2004('0x9f'),require(_0x2004('0xa0')));_0x378307[_0x2004('0x5')](_0x2004('0xa1'),require(_0x2004('0xa2')));_0x378307[_0x2004('0x5')](_0x2004('0xa3'),require(_0x2004('0xa4')));_0x378307[_0x2004('0x5')](_0x2004('0xa5'),require(_0x2004('0xa6')));_0x378307[_0x2004('0x5')]('/api/integrations/freshsales/accounts',require(_0x2004('0xa7')));_0x378307['use'](_0x2004('0xa8'),require(_0x2004('0xa9')));_0x378307['use'](_0x2004('0xaa'),require(_0x2004('0xab')));_0x378307[_0x2004('0x5')](_0x2004('0xac'),require(_0x2004('0xad')));_0x378307['use'](_0x2004('0xae'),require(_0x2004('0xaf')));_0x378307[_0x2004('0x5')](_0x2004('0xb0'),require(_0x2004('0xb1')));_0x378307[_0x2004('0x5')](_0x2004('0xb2'),require(_0x2004('0xb3')));_0x378307[_0x2004('0x5')](_0x2004('0xb4'),require(_0x2004('0xb5')));_0x378307[_0x2004('0x5')]('/api/jscripty/sessions/reports',require(_0x2004('0xb6')));_0x378307[_0x2004('0x5')](_0x2004('0xb7'),require(_0x2004('0xb8')));_0x378307['use'](_0x2004('0xb9'),require('./api/squareReport'));_0x378307[_0x2004('0x5')](_0x2004('0xba'),require(_0x2004('0xbb')));_0x378307[_0x2004('0x5')](_0x2004('0xbc'),require(_0x2004('0xbd')));_0x378307[_0x2004('0x5')](_0x2004('0xbe'),require(_0x2004('0xbf')));_0x378307[_0x2004('0x5')](_0x2004('0xc0'),require('./api/squareOdbc'));_0x378307[_0x2004('0x5')](_0x2004('0xc1'),require('./api/squareProject'));_0x378307['use'](_0x2004('0xc2'),require('./api/squareRecording'));_0x378307['use'](_0x2004('0xc3'),require(_0x2004('0xc4')));_0x378307['use'](_0x2004('0xc5'),require(_0x2004('0xc6')));_0x378307[_0x2004('0x5')](_0x2004('0xc7'),require(_0x2004('0xc8')));_0x378307[_0x2004('0x5')](_0x2004('0xc9'),require(_0x2004('0xca')));_0x378307['use']('/api/migrations',require('./api/migration'));_0x378307[_0x2004('0x5')](_0x2004('0xcb'),require(_0x2004('0xcc')));_0x378307[_0x2004('0x5')](_0x2004('0xcd'),require(_0x2004('0xce')));_0x378307[_0x2004('0x5')](_0x2004('0xcf'),require(_0x2004('0xd0')));_0x378307[_0x2004('0x5')](_0x2004('0xd1'),require(_0x2004('0xd2')));_0x378307[_0x2004('0x5')](_0x2004('0xd3'),require(_0x2004('0xd4')));_0x378307['use'](_0x2004('0xd5'),require('./api/openchannelTransferReport'));_0x378307[_0x2004('0x5')](_0x2004('0xd6'),require(_0x2004('0xd7')));_0x378307[_0x2004('0x5')](_0x2004('0xd8'),require('./api/cmList'));_0x378307['use'](_0x2004('0xd9'),require(_0x2004('0xda')));_0x378307['use']('/api/userProfiles',require('./api/userProfile'));_0x378307[_0x2004('0x5')]('/api/userProfile/sections',require(_0x2004('0xdb')));_0x378307[_0x2004('0x5')](_0x2004('0xdc'),require('./api/userProfileResource'));_0x378307[_0x2004('0x5')]('/api/userNotifications',require(_0x2004('0xdd')));_0x378307[_0x2004('0x5')](_0x2004('0xde'),require(_0x2004('0xdf')));_0x378307[_0x2004('0x5')](_0x2004('0xe0'),require(_0x2004('0xe1')));_0x378307[_0x2004('0x5')](_0x2004('0xe2'),require(_0x2004('0xe3')));_0x378307[_0x2004('0x5')]('/api/whatsapp/messages',require(_0x2004('0xe4')));_0x378307[_0x2004('0x5')](_0x2004('0xe5'),require(_0x2004('0xe6')));_0x378307['use'](_0x2004('0xe7'),require(_0x2004('0xe8')));_0x378307['use'](_0x2004('0xe9'),require(_0x2004('0xea')));_0x378307[_0x2004('0x5')](_0x2004('0xeb'),require(_0x2004('0xec')));_0x378307[_0x2004('0x5')](_0x2004('0xed'),require('./api/realtime'));_0x378307[_0x2004('0x5')](_0x2004('0xee'),require(_0x2004('0xef')));_0x378307['use']('/api/auth/local',require(_0x2004('0xf0')));_0x378307[_0x2004('0x5')](_0x2004('0xf1'),require(_0x2004('0xf2')));_0x378307['use']('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x378307[_0x2004('0x5')](_0x2004('0xf3'),require('./api/jira'));_0x378307['use'](_0x2004('0xf4'),require('./api/rpc'));_0x378307['use']('/api/version',require(_0x2004('0xf5')));_0x378307[_0x2004('0x5')](_0x2004('0xf6'),require('./api/system'));_0x378307[_0x2004('0x5')](_0x2004('0xf7'),require(_0x2004('0xf8')));_0x378307[_0x2004('0x5')]('/api/webbar',require('./api/webbar'));_0x378307['use'](_0x2004('0xf9'),clientSideLogs);_0x378307[_0x2004('0x5')](_0x2004('0xfa'),express[_0x2004('0xfb')](path['join'](config[_0x2004('0xfc')],_0x2004('0xfa'))));_0x378307[_0x2004('0x5')](_0x2004('0xfd'),express[_0x2004('0xfb')](path[_0x2004('0xfe')](config[_0x2004('0xfc')],'/www')));_0x378307['use'](_0x2004('0xff'),express[_0x2004('0xfb')](path[_0x2004('0xfe')](config[_0x2004('0xfc')],_0x2004('0xff'))));_0x378307[_0x2004('0x5')](_0x2004('0x100'),express[_0x2004('0xfb')](path[_0x2004('0xfe')](config[_0x2004('0xfc')],_0x2004('0x101'),'3.0.0')));_0x378307[_0x2004('0x5')]('/plugins',express[_0x2004('0xfb')](path[_0x2004('0xfe')](config[_0x2004('0xfc')],_0x2004('0x102'))));_0x378307[_0x2004('0x103')](_0x2004('0x104'))['get'](errors[0x194]);_0x378307[_0x2004('0x103')]('/*')['get'](function(_0xc27bdb,_0x303242){_0x303242[_0x2004('0x105')](path[_0x2004('0x106')](_0x378307[_0x2004('0x107')](_0x2004('0x108'))+_0x2004('0x109')));});return _0x378307;});}; \ No newline at end of file +var _0x28a5=['./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./api/network','./api/chatQueueReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authGoogle','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','static','join','/apidoc','/www','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/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/faxInteraction','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/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/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations'];(function(_0x3bf62a,_0x3f7754){var _0x267b96=function(_0x57a4c4){while(--_0x57a4c4){_0x3bf62a['push'](_0x3bf62a['shift']());}};_0x267b96(++_0x3f7754);}(_0x28a5,0x6d));var _0x528a=function(_0x301064,_0x1985aa){_0x301064=_0x301064-0x0;var _0x5bc841=_0x28a5[_0x301064];return _0x5bc841;};'use strict';var path=require(_0x528a('0x0'));var express=require(_0x528a('0x1'));var errors=require(_0x528a('0x2'));var config=require(_0x528a('0x3'));var setupLoggers=require(_0x528a('0x4'))[_0x528a('0x5')];var clientSideLogs=require(_0x528a('0x6'));exports[_0x528a('0x7')]=function(_0x5f70a8){return setupLoggers(_0x5f70a8)['then'](function(){_0x5f70a8['use'](_0x528a('0x8'),require(_0x528a('0x9')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xb'),require(_0x528a('0xc')));_0x5f70a8['use'](_0x528a('0xd'),require(_0x528a('0xe')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xf'),require(_0x528a('0x10')));_0x5f70a8['use']('/api/voice/mohs',require(_0x528a('0x11')));_0x5f70a8['use'](_0x528a('0x12'),require(_0x528a('0x13')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x14'),require(_0x528a('0x15')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x16'),require(_0x528a('0x17')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x18'),require(_0x528a('0x19')));_0x5f70a8['use']('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x1a'),require('./api/voiceCallReport'));_0x5f70a8['use']('/api/voice/dials/reports',require(_0x528a('0x1b')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x1c'),require(_0x528a('0x1d')));_0x5f70a8[_0x528a('0xa')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x1e'),require('./api/memberReport'));_0x5f70a8[_0x528a('0xa')]('/api/trunks',require('./api/trunk'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x1f'),require(_0x528a('0x20')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x21'),require(_0x528a('0x22')));_0x5f70a8['use']('/api/mail/accounts',require('./api/mailAccount'));_0x5f70a8['use'](_0x528a('0x23'),require(_0x528a('0x24')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x25'),require(_0x528a('0x26')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x27'),require(_0x528a('0x28')));_0x5f70a8['use'](_0x528a('0x29'),require(_0x528a('0x2a')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x2b'),require(_0x528a('0x2c')));_0x5f70a8['use'](_0x528a('0x2d'),require(_0x528a('0x2e')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x2f'),require(_0x528a('0x30')));_0x5f70a8['use'](_0x528a('0x31'),require(_0x528a('0x32')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x33'),require(_0x528a('0x34')));_0x5f70a8['use'](_0x528a('0x35'),require(_0x528a('0x36')));_0x5f70a8[_0x528a('0xa')]('/api/fax/interactions',require(_0x528a('0x37')));_0x5f70a8[_0x528a('0xa')]('/api/fax/messages',require('./api/faxMessage'));_0x5f70a8[_0x528a('0xa')]('/api/fax/queues',require('./api/faxQueue'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x38'),require('./api/faxQueueReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x39'),require(_0x528a('0x3a')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x3b'),require(_0x528a('0x3c')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x3d'),require(_0x528a('0x3e')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x3f'),require(_0x528a('0x40')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x41'),require(_0x528a('0x42')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x43'),require(_0x528a('0x44')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x45'),require(_0x528a('0x46')));_0x5f70a8[_0x528a('0xa')]('/api/openchannel/interactions',require(_0x528a('0x47')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x48'),require(_0x528a('0x49')));_0x5f70a8[_0x528a('0xa')]('/api/openchannel/queues',require(_0x528a('0x4a')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x4b'),require('./api/chatWebsite'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x4c'),require(_0x528a('0x4d')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x4e'),require(_0x528a('0x4f')));_0x5f70a8['use']('/api/chat/interactions',require('./api/chatInteraction'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x50'),require(_0x528a('0x51')));_0x5f70a8['use'](_0x528a('0x52'),require(_0x528a('0x53')));_0x5f70a8[_0x528a('0xa')]('/api/chat/queues',require(_0x528a('0x54')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x55'),require('./api/chatGroup'));_0x5f70a8[_0x528a('0xa')]('/api/chat/proactive_actions',require(_0x528a('0x56')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x57'),require('./api/cmCompany'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x58'),require(_0x528a('0x59')));_0x5f70a8[_0x528a('0xa')]('/api/cm/hopper',require(_0x528a('0x5a')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x5b'),require(_0x528a('0x5c')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x5d'),require('./api/cmHopperFinal'));_0x5f70a8[_0x528a('0xa')]('/api/cm/hopper_history',require(_0x528a('0x5e')));_0x5f70a8['use'](_0x528a('0x5f'),require('./api/cmCustomField'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x60'),require('./api/action'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x61'),require(_0x528a('0x62')));_0x5f70a8[_0x528a('0xa')]('/api/canned_answers',require(_0x528a('0x63')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x64'),require('./api/disposition'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x65'),require(_0x528a('0x66')));_0x5f70a8[_0x528a('0xa')]('/api/intervals',require(_0x528a('0x67')));_0x5f70a8[_0x528a('0xa')]('/api/pauses',require(_0x528a('0x68')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x69'),require('./api/cdr'));_0x5f70a8[_0x528a('0xa')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x6a'),require('./api/schedule'));_0x5f70a8['use'](_0x528a('0x6b'),require(_0x528a('0x6c')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x6d'),require(_0x528a('0x6e')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x6f'),require(_0x528a('0x70')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x71'),require(_0x528a('0x72')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x73'),require('./api/cmHopperAdditionalPhone'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x74'),require(_0x528a('0x75')));_0x5f70a8[_0x528a('0xa')]('/api/triggers',require(_0x528a('0x76')));_0x5f70a8[_0x528a('0xa')]('/api/variables',require(_0x528a('0x77')));_0x5f70a8['use'](_0x528a('0x78'),require('./api/integration'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x79'),require('./api/integrationReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x7a'),require(_0x528a('0x7b')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x7c'),require(_0x528a('0x7d')));_0x5f70a8['use']('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x7e'),require(_0x528a('0x7f')));_0x5f70a8['use'](_0x528a('0x80'),require(_0x528a('0x81')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x82'),require(_0x528a('0x83')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x84'),require(_0x528a('0x85')));_0x5f70a8[_0x528a('0xa')]('/api/integrations/salesforce/configurations',require(_0x528a('0x86')));_0x5f70a8['use'](_0x528a('0x87'),require('./api/intSalesforceField'));_0x5f70a8[_0x528a('0xa')]('/api/integrations/sugarcrm/accounts',require(_0x528a('0x88')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x89'),require('./api/intSugarcrmConfiguration'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x8a'),require(_0x528a('0x8b')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x8c'),require('./api/intDeskAccount'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x8d'),require('./api/intDeskConfiguration'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x8e'),require('./api/intDeskField'));_0x5f70a8['use'](_0x528a('0x8f'),require(_0x528a('0x90')));_0x5f70a8[_0x528a('0xa')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x5f70a8['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x5f70a8[_0x528a('0xa')](_0x528a('0x91'),require(_0x528a('0x92')));_0x5f70a8[_0x528a('0xa')]('/api/integrations/zendesk/configurations',require(_0x528a('0x93')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x94'),require(_0x528a('0x95')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x96'),require(_0x528a('0x97')));_0x5f70a8['use'](_0x528a('0x98'),require(_0x528a('0x99')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x9a'),require(_0x528a('0x9b')));_0x5f70a8[_0x528a('0xa')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x5f70a8['use'](_0x528a('0x9c'),require(_0x528a('0x9d')));_0x5f70a8[_0x528a('0xa')](_0x528a('0x9e'),require(_0x528a('0x9f')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xa0'),require('./api/intServicenowAccount'));_0x5f70a8['use'](_0x528a('0xa1'),require(_0x528a('0xa2')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xa3'),require(_0x528a('0xa4')));_0x5f70a8['use'](_0x528a('0xa5'),require(_0x528a('0xa6')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xa7'),require(_0x528a('0xa8')));_0x5f70a8[_0x528a('0xa')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xa9'),require(_0x528a('0xaa')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xab'),require(_0x528a('0xac')));_0x5f70a8['use']('/api/integrations/freshsales/fields',require(_0x528a('0xad')));_0x5f70a8[_0x528a('0xa')]('/api/networks',require(_0x528a('0xae')));_0x5f70a8[_0x528a('0xa')]('/api/chat/reports/queue',require(_0x528a('0xaf')));_0x5f70a8[_0x528a('0xa')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x5f70a8[_0x528a('0xa')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xb0'),require(_0x528a('0xb1')));_0x5f70a8['use']('/api/jscripty/sessions/reports',require(_0x528a('0xb2')));_0x5f70a8[_0x528a('0xa')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xb3'),require(_0x528a('0xb4')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xb5'),require(_0x528a('0xb6')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xb7'),require(_0x528a('0xb8')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xb9'),require('./api/setting'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xba'),require(_0x528a('0xbb')));_0x5f70a8[_0x528a('0xa')]('/api/square/projects',require(_0x528a('0xbc')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xbd'),require('./api/squareRecording'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xbe'),require('./api/squareMessage'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xbf'),require('./api/team'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xc0'),require(_0x528a('0xc1')));_0x5f70a8['use'](_0x528a('0xc2'),require('./api/campaign'));_0x5f70a8['use'](_0x528a('0xc3'),require(_0x528a('0xc4')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xc5'),require(_0x528a('0xc6')));_0x5f70a8['use'](_0x528a('0xc7'),require(_0x528a('0xc8')));_0x5f70a8['use'](_0x528a('0xc9'),require(_0x528a('0xca')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xcb'),require(_0x528a('0xcc')));_0x5f70a8['use'](_0x528a('0xcd'),require('./api/faxTransferReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xce'),require(_0x528a('0xcf')));_0x5f70a8['use'](_0x528a('0xd0'),require(_0x528a('0xd1')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xd2'),require(_0x528a('0xd3')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xd4'),require('./api/voicePrefix'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xd5'),require(_0x528a('0xd6')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xd7'),require(_0x528a('0xd8')));_0x5f70a8['use']('/api/userProfile/resources',require('./api/userProfileResource'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xd9'),require(_0x528a('0xda')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xdb'),require(_0x528a('0xdc')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xdd'),require(_0x528a('0xde')));_0x5f70a8['use'](_0x528a('0xdf'),require(_0x528a('0xe0')));_0x5f70a8['use']('/api/whatsapp/messages',require(_0x528a('0xe1')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xe2'),require('./api/whatsappQueueReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xe3'),require('./api/whatsappTransferReport'));_0x5f70a8[_0x528a('0xa')](_0x528a('0xe4'),require(_0x528a('0xe5')));_0x5f70a8['use'](_0x528a('0xe6'),require(_0x528a('0xe7')));_0x5f70a8[_0x528a('0xa')]('/api/realtime',require(_0x528a('0xe8')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xe9'),require(_0x528a('0xea')));_0x5f70a8['use'](_0x528a('0xeb'),require('./api/authLocal'));_0x5f70a8[_0x528a('0xa')]('/api/auth/google',require(_0x528a('0xec')));_0x5f70a8[_0x528a('0xa')]('/api/auth/activedirectory',require(_0x528a('0xed')));_0x5f70a8['use'](_0x528a('0xee'),require('./api/jira'));_0x5f70a8['use'](_0x528a('0xef'),require(_0x528a('0xf0')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xf1'),require(_0x528a('0xf2')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xf3'),require(_0x528a('0xf4')));_0x5f70a8['use'](_0x528a('0xf5'),require(_0x528a('0xf6')));_0x5f70a8[_0x528a('0xa')](_0x528a('0xf7'),require('./api/webbar'));_0x5f70a8['use']('/api/logs',clientSideLogs);_0x5f70a8[_0x528a('0xa')]('/apidoc',express[_0x528a('0xf8')](path[_0x528a('0xf9')](config['root'],_0x528a('0xfa'))));_0x5f70a8['use'](_0x528a('0xfb'),express[_0x528a('0xf8')](path[_0x528a('0xf9')](config['root'],_0x528a('0xfb'))));_0x5f70a8['use']('/demo',express[_0x528a('0xf8')](path[_0x528a('0xf9')](config[_0x528a('0xfc')],_0x528a('0xfd'))));_0x5f70a8[_0x528a('0xa')](_0x528a('0xfe'),express[_0x528a('0xf8')](path[_0x528a('0xf9')](config[_0x528a('0xfc')],_0x528a('0xff'),_0x528a('0x100'))));_0x5f70a8[_0x528a('0xa')](_0x528a('0x101'),express[_0x528a('0xf8')](path[_0x528a('0xf9')](config[_0x528a('0xfc')],_0x528a('0x102'))));_0x5f70a8[_0x528a('0x103')](_0x528a('0x104'))['get'](errors[0x194]);_0x5f70a8[_0x528a('0x103')]('/*')[_0x528a('0x105')](function(_0x463e8d,_0x3a2927){_0x3a2927[_0x528a('0x106')](path[_0x528a('0x107')](_0x5f70a8['get'](_0x528a('0x108'))+_0x528a('0x109')));});return _0x5f70a8;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index c756b2f..9619e2b 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf8c=['../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/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xcf8c,0xf0));var _0xccf8=function(_0x241838,_0xc0bc0f){_0x241838=_0x241838-0x0;var _0x6e6055=_0xcf8c[_0x241838];return _0x6e6055;};'use strict';var jayson=require(_0xccf8('0x0'));var _=require(_0xccf8('0x1'));var config=require(_0xccf8('0x2'));exports[_0xccf8('0x3')]=function(){return new Promise(function(_0x17a471,_0x202e35){var _0x545785={};_0x545785=_['merge'](_0x545785,require(_0xccf8('0x4')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x6')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x7')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x8')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x9')));_0x545785=_['merge'](_0x545785,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0xa')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0xb')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0xc')));_0x545785=_['merge'](_0x545785,require('../api/trunk/trunk.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0xd')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0xe')));_0x545785=_['merge'](_0x545785,require('../api/mailAccount/mailAccount.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0xf')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x10')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/mailMessage/mailMessage.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/mailApplication/mailApplication.rpc'));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x11')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x12')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x13')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x14')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x15')));_0x545785=_['merge'](_0x545785,require('../api/faxQueue/faxQueue.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x16')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x17')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x18')));_0x545785=_['merge'](_0x545785,require('../api/smsMessage/smsMessage.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x19')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x1a')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x1b')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x1c')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x1d')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/chatInteraction/chatInteraction.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/chatMessage/chatMessage.rpc'));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x1e')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x1f')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/cmHopper/cmHopper.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x20')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x21')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x22')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x23')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x24')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x25')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x26')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x27')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x28')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x29')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x2a')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x2b')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x2c')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x2d')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x2e')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x2f')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x30')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x31')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x32')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x33')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x34')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x35')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/setting/setting.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/squareOdbc/squareOdbc.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x36')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x37')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/squareMessage/squareMessage.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x38')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x39')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/plugin/plugin.rpc'));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x3a')));_0x545785=_[_0xccf8('0x5')](_0x545785,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x3b')));_0x545785=_['merge'](_0x545785,require(_0xccf8('0x3c')));_0x545785=_[_0xccf8('0x5')](_0x545785,require(_0xccf8('0x3d')));var _0x531028=jayson[_0xccf8('0x3e')](_0x545785)[_0xccf8('0x3f')]();var _0x1a7668=config[_0xccf8('0x40')]['port']||config[_0xccf8('0x41')]+0x1;var _0x28f881=config[_0xccf8('0x40')]['ip']||_0xccf8('0x42');_0x531028['on'](_0xccf8('0x43'),function(_0x44ef4c){return _0x202e35(_0x44ef4c);});_0x531028['listen'](_0x1a7668,_0x28f881,function(){console[_0xccf8('0x44')](_0xccf8('0x45'),_0x28f881,_0x1a7668);require('../config/triggers')[_0xccf8('0x46')]();return _0x17a471(_0xccf8('0x47')+_0x28f881+':'+_0x1a7668);});});}; \ No newline at end of file +var _0x2787=['../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc'];(function(_0x2cc656,_0x4f500e){var _0x297ef9=function(_0x5e2d39){while(--_0x5e2d39){_0x2cc656['push'](_0x2cc656['shift']());}};_0x297ef9(++_0x4f500e);}(_0x2787,0x15e));var _0x7278=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2787[_0x17d9e3];return _0x14192d;};'use strict';var jayson=require(_0x7278('0x0'));var _=require('lodash');var config=require(_0x7278('0x1'));exports['listen']=function(){return new Promise(function(_0x5a39d3,_0x2d8f2e){var _0xfe6252={};_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x3')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/voiceExtension/voiceExtension.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x4')));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0x5')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x6')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x7')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x8')));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0x9')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0xa')));_0xfe6252=_['merge'](_0xfe6252,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0xb')));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0xc')));_0xfe6252=_['merge'](_0xfe6252,require('../api/mailQueue/mailQueue.rpc'));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0xd')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0xe')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/mailApplication/mailApplication.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0xf')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x10')));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0x11')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x12')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x13')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/faxQueue/faxQueue.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x14')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/smsAccount/smsAccount.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x15')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x16')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x17')));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0x18')));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0x19')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x1a')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x1b')));_0xfe6252=_['merge'](_0xfe6252,require('../api/chatInteraction/chatInteraction.rpc'));_0xfe6252=_['merge'](_0xfe6252,require('../api/chatMessage/chatMessage.rpc'));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0x1c')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x1d')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x1e')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x1f')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x20')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/interval/interval.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x21')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x22')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x23')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x24')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x25')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/variable/variable.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x26')));_0xfe6252=_['merge'](_0xfe6252,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x27')));_0xfe6252=_['merge'](_0xfe6252,require('../api/intZohoAccount/intZohoAccount.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x28')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x29')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x2a')));_0xfe6252=_['merge'](_0xfe6252,require(_0x7278('0x2b')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x2c')));_0xfe6252=_['merge'](_0xfe6252,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x2d')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x2e')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x2f')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x30')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/setting/setting.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x31')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x32')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x33')));_0xfe6252=_['merge'](_0xfe6252,require('../api/squareMessage/squareMessage.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/campaign/campaign.rpc'));_0xfe6252=_['merge'](_0xfe6252,require('../api/attachment/attachment.rpc'));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x34')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x35')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x36')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x37')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require(_0x7278('0x38')));_0xfe6252=_[_0x7278('0x2')](_0xfe6252,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x1f0e9f=jayson[_0x7278('0x39')](_0xfe6252)[_0x7278('0x3a')]();var _0xe761e7=config[_0x7278('0x3b')][_0x7278('0x3c')]||config[_0x7278('0x3c')]+0x1;var _0x88ad8f=config[_0x7278('0x3b')]['ip']||_0x7278('0x3d');_0x1f0e9f['on'](_0x7278('0x3e'),function(_0x5d174c){return _0x2d8f2e(_0x5d174c);});_0x1f0e9f[_0x7278('0x3f')](_0xe761e7,_0x88ad8f,function(){console['log'](_0x7278('0x40'),_0x88ad8f,_0xe761e7);require(_0x7278('0x41'))[_0x7278('0x42')]();return _0x5a39d3('RPC\x20listening\x20on\x20'+_0x88ad8f+':'+_0xe761e7);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 4ca3226..e30ebfa 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 _0xa93a=['substring','520-Invalid','function','no\x20code','replace','result=','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','NO\x20MESSAGE','format','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','setExtension','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','streamFile','agi','AGI','wait','WAIT','label','exports','events','./error','call','setEncoding','utf8','emit','ready','hangup'];(function(_0x4ea353,_0x282ad1){var _0x1bea66=function(_0x1c732b){while(--_0x1c732b){_0x4ea353['push'](_0x4ea353['shift']());}};_0x1bea66(++_0x282ad1);}(_0xa93a,0xb8));var _0xaa93=function(_0x46b75d,_0x13a894){_0x46b75d=_0x46b75d-0x0;var _0x1bfb5a=_0xa93a[_0x46b75d];return _0x1bfb5a;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0xaa93('0x0'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0xaa93('0x1'));function AGIChannel(_0x499cbc){var _0xdb8133=this,_0x4deab1=new AGIReply(),_0x242aa2=![],_0x181549={};EventEmitter[_0xaa93('0x2')](_0xdb8133);_0x499cbc[_0xaa93('0x3')](_0xaa93('0x4'));_0x499cbc['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x4deab1[_0xaa93('0x3')](_0xaa93('0x4'));_0x4deab1['on']('headers',function(_0x2bb7a8){for(var _0x4bb171 in _0x2bb7a8){_0xdb8133[_0x4bb171]=_0x2bb7a8[_0x4bb171];}_0xdb8133[_0xaa93('0x5')](_0xaa93('0x6'));});_0x4deab1['on']('line',function(_0x4f3681){if(_0x4f3681['toLowerCase']()==_0xaa93('0x7')){_0xdb8133['emit'](_0xaa93('0x7'));return;}if(_0x4f3681[_0xaa93('0x8')](0x0,0xb)==_0xaa93('0x9')){_0x242aa2=!![];}if(_0x242aa2){_0x181549['rx']+=_0x4f3681+'\x0a';if(_0x4f3681['search']('520\x20End\x20of\x20proper')!=-0x1){_0x242aa2=![];}}else{_0x181549['rx']=_0x4f3681;}if(_0x242aa2){return;}if(typeof _0x181549['cb']==_0xaa93('0xa')){var _0x52fba9=_0x181549['rx'][_0xaa93('0x8')](0x0,0x3),_0x96fabf=null,_0x55f5dc=null;_0x52fba9=parseInt(_0x52fba9);if(isNaN(_0x52fba9)){_0x181549['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xaa93('0xb')});return;}if(_0x52fba9!=0xc8){_0x181549['cb'](null,{'code':_0x52fba9,'result':-0x1,'extra':'KO'});return;}_0x96fabf=_0x181549['rx'][_0xaa93('0x8')](0x4)[_0xaa93('0xc')](_0xaa93('0xd'),'');if(_0x96fabf['indexOf']('\x20')!=-0x1){_0x96fabf=_0x96fabf[_0xaa93('0xe')](0x0,_0x96fabf['indexOf']('\x20'));}if(_[_0xaa93('0xf')](_0x96fabf,'-1')){_0x96fabf=parseInt(_0x96fabf);}_0x55f5dc=_0x181549['rx'][_0xaa93('0x10')]('\x20');if(_0x55f5dc['length']==0x3){_0x55f5dc=_0x55f5dc[0x2]['substring'](0x1,_0x55f5dc[0x2][_0xaa93('0x11')]-0x1);}else if(_0x55f5dc[_0xaa93('0x11')]>0x3){var _0x1cc0bc=/\((.+)\)/;var _0x33cab3=_0x181549['rx'][_0xaa93('0x12')](_0x1cc0bc);if(_0x33cab3){_0x55f5dc=_0x33cab3[0x1];}else{_0x55f5dc=null;}}else{_0x55f5dc=null;}_0x181549['cb'](null,{'code':_0x52fba9,'result':_0x96fabf,'extra':_0x55f5dc});}});_0x499cbc['on'](_0xaa93('0x13'),function(_0x29f90a){_0xdb8133[_0xaa93('0x5')](_0xaa93('0x13'),new AGIError('E_AGI_SOCKET_ERROR',_0x29f90a[_0xaa93('0x14')]));});_0x499cbc['on'](_0xaa93('0x15'),function(){_0xdb8133[_0xaa93('0x5')]('close',new AGIError(_0xaa93('0x16')));});_0x499cbc['on'](_0xaa93('0x17'),function(){_0xdb8133['emit'](_0xaa93('0x17'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x499cbc[_0xaa93('0x18')]();});_0x499cbc['pipe'](_0x4deab1);this[_0xaa93('0x19')]=function(_0x877f9b,_0x4d6a45){var _0x877f9b=_0x877f9b||'',_0x4d6a45=typeof _0x4d6a45==_0xaa93('0xa')?_0x4d6a45:new Function();_0x181549={'tx':_0x877f9b,'rx':'','cb':_0x4d6a45};_0x499cbc[_0xaa93('0x1a')](_0x877f9b+'\x0a');},this['close']=function(){_0x499cbc['destroy']();};}util[_0xaa93('0x1b')](AGIChannel,EventEmitter);AGIChannel[_0xaa93('0x1c')][_0xaa93('0x1d')]=function(_0x5f3529){return this['command'][_0xaa93('0x1e')](this,_0x5f3529);};AGIChannel['prototype'][_0xaa93('0x1f')]=function(){return this[_0xaa93('0x1d')](_0xaa93('0x20'));};AGIChannel['prototype'][_0xaa93('0x21')]=function(_0x17e2e6,_0x381de5,_0x400527){_0x17e2e6=_0x17e2e6===undefined?'beep':_0x17e2e6;_0x381de5=_0x381de5===undefined?'5':_0x381de5;_0x400527=_0x400527===undefined?'1':_0x400527;return this[_0xaa93('0x1d')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x17e2e6,_0x381de5*0x3e8,_0x400527));};AGIChannel['prototype']['noop']=function(_0x3b7b4c){_0x3b7b4c=_0x3b7b4c||_0xaa93('0x22');return this[_0xaa93('0x1d')](util[_0xaa93('0x23')]('VERBOSE\x20\x22%s\x22',_0x3b7b4c));};AGIChannel[_0xaa93('0x1c')][_0xaa93('0x24')]=function(_0x3afae7,_0x185059){if(_[_0xaa93('0x25')](_0x185059)){return this[_0xaa93('0x1d')](util[_0xaa93('0x23')](_0xaa93('0x26'),_0x3afae7,_0x185059[_0xaa93('0x27')](',')));}return this[_0xaa93('0x1d')](util['format']('EXEC\x20%s\x20%s',_0x3afae7,_0x185059));};AGIChannel['prototype'][_0xaa93('0x28')]=function(_0x2c627f){return this[_0xaa93('0x1d')](util['format']('SET\x20CONTEXT\x20%s',_0x2c627f));};AGIChannel[_0xaa93('0x1c')]['setExtension']=function(_0x22b4fd){return this[_0xaa93('0x1d')](util[_0xaa93('0x23')](_0xaa93('0x29'),_0x22b4fd));};AGIChannel['prototype'][_0xaa93('0x2a')]=function(_0x46f46d){return this[_0xaa93('0x1d')](util[_0xaa93('0x23')](_0xaa93('0x2b'),_0x46f46d));};AGIChannel['prototype'][_0xaa93('0x7')]=function(){return this['sendRequest'](_0xaa93('0x2c'));};AGIChannel[_0xaa93('0x1c')][_0xaa93('0x2d')]=function(_0x1fb0e7,_0x529c82){var _0x2313cb=_['isBoolean'](_0x529c82)||_['isNumber'](_0x529c82)?_0x529c82['toString']():_0x529c82;return this[_0xaa93('0x1d')](util['format'](_0xaa93('0x2e'),_0x1fb0e7,_0x2313cb?_0x2313cb[_0xaa93('0x2f')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xaa93('0x1c')][_0xaa93('0x30')]=function(_0x3c972e,_0x355fc0){return this[_0xaa93('0x1d')](util[_0xaa93('0x23')](_0xaa93('0x31'),_0x3c972e,_0x355fc0));};AGIChannel[_0xaa93('0x1c')]['sayDigits']=function(_0x1f0cc0,_0x2fede7){return this[_0xaa93('0x1d')](util[_0xaa93('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x1f0cc0,_0x2fede7));};AGIChannel['prototype']['sayPhonetic']=function(_0x500d1a,_0x459857){return this[_0xaa93('0x1d')](util[_0xaa93('0x23')](_0xaa93('0x32'),_0x500d1a,_0x459857));};AGIChannel['prototype']['continueAt']=function(_0x1e361f,_0x1b5ce7,_0x4bd128){_0x1b5ce7=_0x1b5ce7||this['extension'];_0x4bd128=_0x4bd128||0x1;this[_0xaa93('0x28')](_0x1e361f);this[_0xaa93('0x33')](_0x1b5ce7);this['setPriority'](_0x4bd128);return this[_0xaa93('0x34')](util['format'](_0xaa93('0x35'),_0x1e361f,_0x1b5ce7,_0x4bd128));};AGIChannel['prototype']['getVariable']=function(_0x35dc56){return this[_0xaa93('0x1d')](util['format'](_0xaa93('0x36'),_0x35dc56));};AGIChannel[_0xaa93('0x1c')][_0xaa93('0x37')]=function(_0x1839f9,_0x3fdd92,_0x3c08b4,_0x2ff9e4,_0x389ca8,_0x195a6e){_0x3fdd92=_0x3fdd92||'wav';_0x3c08b4=_0x3c08b4||'';_0x2ff9e4=_0x2ff9e4===undefined?-0x1:_0x2ff9e4==='-1'?-0x1:_0x2ff9e4*0x3e8;_0x389ca8=_0x389ca8===undefined?'':'s='+_0x389ca8;_0x195a6e=_0x195a6e?_0xaa93('0x38'):'';return this[_0xaa93('0x1d')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1839f9,_0x3fdd92,_0x3c08b4,_0x2ff9e4,_0x195a6e,_0x389ca8));};AGIChannel[_0xaa93('0x1c')][_0xaa93('0x39')]=function(_0x13b340,_0xaa2387){_0xaa2387=_0xaa2387||'';return this[_0xaa93('0x1d')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x13b340,_0xaa2387));};AGIChannel['prototype'][_0xaa93('0x3a')]=function(_0x4dfe00){return this[_0xaa93('0x24')](_0xaa93('0x3b'),_0x4dfe00);};AGIChannel[_0xaa93('0x1c')][_0xaa93('0x3c')]=function(_0xa56483){return this[_0xaa93('0x24')](_0xaa93('0x3d'),_0xa56483);};AGIChannel[_0xaa93('0x1c')][_0xaa93('0x13')]=function(_0x526f18,_0x2370ea){this['noop'](util[_0xaa93('0x23')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x526f18['id'],_0x526f18[_0xaa93('0x3e')],_0x2370ea));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xaa93('0x3f')]=AGIChannel; \ No newline at end of file +var _0xf8bb=['setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','ready','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','inherits','prototype','sendRequest','command','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf8bb,0x111));var _0xbf8b=function(_0x40f9bf,_0xdfe4ee){_0x40f9bf=_0x40f9bf-0x0;var _0x1448f6=_0xf8bb[_0x40f9bf];return _0x1448f6;};'use strict';var util=require(_0xbf8b('0x0'));var _=require(_0xbf8b('0x1'));var EventEmitter=require(_0xbf8b('0x2'))['EventEmitter'];var AGIReply=require(_0xbf8b('0x3'));var AGIError=require(_0xbf8b('0x4'));function AGIChannel(_0x2d4a12){var _0xcbd3f4=this,_0x1d5006=new AGIReply(),_0x1a0b38=![],_0x3a0b97={};EventEmitter[_0xbf8b('0x5')](_0xcbd3f4);_0x2d4a12[_0xbf8b('0x6')](_0xbf8b('0x7'));_0x2d4a12[_0xbf8b('0x8')](0x8*0x3c*0x3c*0x3e8);_0x1d5006[_0xbf8b('0x6')](_0xbf8b('0x7'));_0x1d5006['on']('headers',function(_0x36692f){for(var _0x5ef0ec in _0x36692f){_0xcbd3f4[_0x5ef0ec]=_0x36692f[_0x5ef0ec];}_0xcbd3f4['emit'](_0xbf8b('0x9'));});_0x1d5006['on']('line',function(_0x20452b){if(_0x20452b['toLowerCase']()==_0xbf8b('0xa')){_0xcbd3f4[_0xbf8b('0xb')](_0xbf8b('0xa'));return;}if(_0x20452b[_0xbf8b('0xc')](0x0,0xb)==_0xbf8b('0xd')){_0x1a0b38=!![];}if(_0x1a0b38){_0x3a0b97['rx']+=_0x20452b+'\x0a';if(_0x20452b[_0xbf8b('0xe')](_0xbf8b('0xf'))!=-0x1){_0x1a0b38=![];}}else{_0x3a0b97['rx']=_0x20452b;}if(_0x1a0b38){return;}if(typeof _0x3a0b97['cb']==_0xbf8b('0x10')){var _0x59055d=_0x3a0b97['rx']['substring'](0x0,0x3),_0x3e3bfb=null,_0xeffd6d=null;_0x59055d=parseInt(_0x59055d);if(isNaN(_0x59055d)){_0x3a0b97['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xbf8b('0x11')});return;}if(_0x59055d!=0xc8){_0x3a0b97['cb'](null,{'code':_0x59055d,'result':-0x1,'extra':'KO'});return;}_0x3e3bfb=_0x3a0b97['rx'][_0xbf8b('0xc')](0x4)[_0xbf8b('0x12')](_0xbf8b('0x13'),'');if(_0x3e3bfb[_0xbf8b('0x14')]('\x20')!=-0x1){_0x3e3bfb=_0x3e3bfb[_0xbf8b('0x15')](0x0,_0x3e3bfb[_0xbf8b('0x14')]('\x20'));}if(_[_0xbf8b('0x16')](_0x3e3bfb,'-1')){_0x3e3bfb=parseInt(_0x3e3bfb);}_0xeffd6d=_0x3a0b97['rx'][_0xbf8b('0x17')]('\x20');if(_0xeffd6d[_0xbf8b('0x18')]==0x3){_0xeffd6d=_0xeffd6d[0x2]['substring'](0x1,_0xeffd6d[0x2][_0xbf8b('0x18')]-0x1);}else if(_0xeffd6d[_0xbf8b('0x18')]>0x3){var _0x3d605b=/\((.+)\)/;var _0x31eabe=_0x3a0b97['rx'][_0xbf8b('0x19')](_0x3d605b);if(_0x31eabe){_0xeffd6d=_0x31eabe[0x1];}else{_0xeffd6d=null;}}else{_0xeffd6d=null;}_0x3a0b97['cb'](null,{'code':_0x59055d,'result':_0x3e3bfb,'extra':_0xeffd6d});}});_0x2d4a12['on']('error',function(_0x3bab93){_0xcbd3f4[_0xbf8b('0xb')](_0xbf8b('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x3bab93[_0xbf8b('0x1b')]));});_0x2d4a12['on'](_0xbf8b('0x1c'),function(){_0xcbd3f4[_0xbf8b('0xb')]('close',new AGIError(_0xbf8b('0x1d')));});_0x2d4a12['on'](_0xbf8b('0x1e'),function(){_0xcbd3f4[_0xbf8b('0xb')](_0xbf8b('0x1e'),new AGIError(_0xbf8b('0x1f')));_0x2d4a12[_0xbf8b('0x20')]();});_0x2d4a12['pipe'](_0x1d5006);this['command']=function(_0x56174f,_0x153c19){var _0x56174f=_0x56174f||'',_0x153c19=typeof _0x153c19=='function'?_0x153c19:new Function();_0x3a0b97={'tx':_0x56174f,'rx':'','cb':_0x153c19};_0x2d4a12[_0xbf8b('0x21')](_0x56174f+'\x0a');},this['close']=function(){_0x2d4a12['destroy']();};}util[_0xbf8b('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x24')]=function(_0x4befad){return this[_0xbf8b('0x25')][_0xbf8b('0x26')](this,_0x4befad);};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x27')]=function(){return this['sendRequest'](_0xbf8b('0x28'));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x29')]=function(_0x18d1d5,_0x530ebf,_0x22c98c){_0x18d1d5=_0x18d1d5===undefined?_0xbf8b('0x2a'):_0x18d1d5;_0x530ebf=_0x530ebf===undefined?'5':_0x530ebf;_0x22c98c=_0x22c98c===undefined?'1':_0x22c98c;return this['sendRequest'](util[_0xbf8b('0x2b')](_0xbf8b('0x2c'),_0x18d1d5,_0x530ebf*0x3e8,_0x22c98c));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x2d')]=function(_0x1af553){_0x1af553=_0x1af553||_0xbf8b('0x2e');return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')](_0xbf8b('0x2f'),_0x1af553));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x30')]=function(_0x1adb2c,_0x456269){if(_['isArray'](_0x456269)){return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')](_0xbf8b('0x31'),_0x1adb2c,_0x456269[_0xbf8b('0x32')](',')));}return this['sendRequest'](util[_0xbf8b('0x2b')](_0xbf8b('0x31'),_0x1adb2c,_0x456269));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x33')]=function(_0xc5653e){return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')](_0xbf8b('0x34'),_0xc5653e));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x35')]=function(_0x1d3908){return this[_0xbf8b('0x24')](util['format'](_0xbf8b('0x36'),_0x1d3908));};AGIChannel['prototype']['setPriority']=function(_0x36ce40){return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')](_0xbf8b('0x37'),_0x36ce40));};AGIChannel[_0xbf8b('0x23')]['hangup']=function(){return this['sendRequest'](_0xbf8b('0x38'));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x39')]=function(_0x31fcac,_0xe5ac92){var _0x326bed=_[_0xbf8b('0x3a')](_0xe5ac92)||_[_0xbf8b('0x3b')](_0xe5ac92)?_0xe5ac92[_0xbf8b('0x3c')]():_0xe5ac92;return this[_0xbf8b('0x24')](util['format'](_0xbf8b('0x3d'),_0x31fcac,_0x326bed?_0x326bed[_0xbf8b('0x3c')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x3e')]=function(_0x13822b,_0x6fa31c){return this[_0xbf8b('0x24')](util['format'](_0xbf8b('0x3f'),_0x13822b,_0x6fa31c));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x40')]=function(_0x259775,_0x1bdf87){return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')](_0xbf8b('0x41'),_0x259775,_0x1bdf87));};AGIChannel[_0xbf8b('0x23')]['sayPhonetic']=function(_0x39eeff,_0x38a3b8){return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')](_0xbf8b('0x42'),_0x39eeff,_0x38a3b8));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x43')]=function(_0x17acf1,_0x5c7871,_0x21484f){_0x5c7871=_0x5c7871||this[_0xbf8b('0x44')];_0x21484f=_0x21484f||0x1;this[_0xbf8b('0x33')](_0x17acf1);this[_0xbf8b('0x35')](_0x5c7871);this[_0xbf8b('0x45')](_0x21484f);return this['noop'](util['format'](_0xbf8b('0x46'),_0x17acf1,_0x5c7871,_0x21484f));};AGIChannel[_0xbf8b('0x23')]['getVariable']=function(_0x4d6a45){return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')](_0xbf8b('0x47'),_0x4d6a45));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x48')]=function(_0x4fd196,_0x37b817,_0x263bbc,_0x3cfb10,_0x1180fb,_0x33f2d6){_0x37b817=_0x37b817||'wav';_0x263bbc=_0x263bbc||'';_0x3cfb10=_0x3cfb10===undefined?-0x1:_0x3cfb10==='-1'?-0x1:_0x3cfb10*0x3e8;_0x1180fb=_0x1180fb===undefined?'':'s='+_0x1180fb;_0x33f2d6=_0x33f2d6?_0xbf8b('0x49'):'';return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x4fd196,_0x37b817,_0x263bbc,_0x3cfb10,_0x33f2d6,_0x1180fb));};AGIChannel['prototype']['streamFile']=function(_0x1fc1c3,_0x2e8a0c){_0x2e8a0c=_0x2e8a0c||'';return this[_0xbf8b('0x24')](util[_0xbf8b('0x2b')](_0xbf8b('0x4a'),_0x1fc1c3,_0x2e8a0c));};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x4b')]=function(_0x34d294){return this[_0xbf8b('0x30')](_0xbf8b('0x4c'),_0x34d294);};AGIChannel[_0xbf8b('0x23')][_0xbf8b('0x4d')]=function(_0x1b20bb){return this[_0xbf8b('0x30')](_0xbf8b('0x4e'),_0x1b20bb);};AGIChannel[_0xbf8b('0x23')]['error']=function(_0x28dd01,_0x355644){this[_0xbf8b('0x2d')](util[_0xbf8b('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x28dd01['id'],_0x28dd01[_0xbf8b('0x4f')],_0x355644));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xbf8b('0x50')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7c22f10..6db4c91 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 _0x11db=['apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0x11db,0x9d));var _0xb11d=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x11db[_0x4fdc46];return _0x2c178a;};'use strict';var util=require(_0xb11d('0x0'));var error={'E_AGI_UNDEFINED':_0xb11d('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xb11d('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xb11d('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xb11d('0x4'),'E_AGI_SOCKET_ERROR':_0xb11d('0x5'),'E_AGI_SOCKET_CLOSE':_0xb11d('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xb11d('0x7'),'E_AGI_COMMAND_EMPTY':_0xb11d('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb11d('0x9'),'E_AGI_IVR_ENTRY':_0xb11d('0xa')};function AGIError(_0x2f28f1){var _0x2f28f1=_0x2f28f1||null,_0x164f2e=_0x164f2e||[],_0x1612d3=0x1,_0x237b3c='';if(!error[_0x2f28f1]){_0x2f28f1=_0xb11d('0xb');}_0x164f2e[_0xb11d('0xc')](error[_0x2f28f1]);while(arguments[_0x1612d3]){_0x164f2e[_0xb11d('0xc')](arguments[_0x1612d3]);_0x1612d3++;}_0x237b3c=util['format'][_0xb11d('0xd')](util,_0x164f2e);this[_0xb11d('0xe')]=_0x237b3c;this[_0xb11d('0xf')]=_0x2f28f1;}module[_0xb11d('0x10')]=AGIError; \ No newline at end of file +var _0x0b5a=['Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','name','util','Undefined\x20error.'];(function(_0x54c6e4,_0x380018){var _0x4b2868=function(_0x5f2a3d){while(--_0x5f2a3d){_0x54c6e4['push'](_0x54c6e4['shift']());}};_0x4b2868(++_0x380018);}(_0x0b5a,0x12a));var _0xa0b5=function(_0x4dac4a,_0x1cae55){_0x4dac4a=_0x4dac4a-0x0;var _0x4b5126=_0x0b5a[_0x4dac4a];return _0x4b5126;};'use strict';var util=require(_0xa0b5('0x0'));var error={'E_AGI_UNDEFINED':_0xa0b5('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xa0b5('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xa0b5('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xa0b5('0x4'),'E_AGI_SOCKET_ERROR':_0xa0b5('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xa0b5('0x6'),'E_AGI_COMMAND_EMPTY':_0xa0b5('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa0b5('0x8'),'E_AGI_IVR_ENTRY':_0xa0b5('0x9')};function AGIError(_0x3a7668){var _0x3a7668=_0x3a7668||null,_0x4895da=_0x4895da||[],_0x2d3267=0x1,_0xf20699='';if(!error[_0x3a7668]){_0x3a7668=_0xa0b5('0xa');}_0x4895da[_0xa0b5('0xb')](error[_0x3a7668]);while(arguments[_0x2d3267]){_0x4895da[_0xa0b5('0xb')](arguments[_0x2d3267]);_0x2d3267++;}_0xf20699=util[_0xa0b5('0xc')][_0xa0b5('0xd')](util,_0x4895da);this['message']=_0xf20699;this[_0xa0b5('0xe')]=_0x3a7668;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index dac8933..0447a98 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 _0xe26e=['./error','../../config/environment','redis','defaults','localhost','error','E_AGI_SERVER_ERROR','message','agi','parse','exports','EventEmitter','ioredis'];(function(_0xb9f0dc,_0x12e5f3){var _0x160c7d=function(_0x32ac43){while(--_0x32ac43){_0xb9f0dc['push'](_0xb9f0dc['shift']());}};_0x160c7d(++_0x12e5f3);}(_0xe26e,0xa7));var _0xee26=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe26e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var EventEmitter=require('events')[_0xee26('0x0')];var Redis=require(_0xee26('0x1'));var AGIError=require(_0xee26('0x2'));var config=require(_0xee26('0x3'));config[_0xee26('0x4')]=_[_0xee26('0x5')](config[_0xee26('0x4')],{'host':_0xee26('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xee26('0x4')]);sub['subscribe']('agi',function(_0x262d0a){if(_0x262d0a)return eventEmitter['emit'](_0xee26('0x7'),new AGIError(_0xee26('0x8'),_0x262d0a));});sub['on'](_0xee26('0x9'),function(_0x4513a8,_0x46cb1d){if(_0x4513a8!==_0xee26('0xa'))return;try{var _0x138762=JSON[_0xee26('0xb')](_0x46cb1d);eventEmitter['emit']('projectUpdate',_0x138762);}catch(_0x5f4aa0){eventEmitter['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x5f4aa0));}});module[_0xee26('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x8ac9=['defaults','redis','subscribe','agi','emit','error','message','E_AGI_SERVER_ERROR','exports','lodash','events','EventEmitter','ioredis','../../config/environment'];(function(_0x3afad3,_0x5266f8){var _0x4e55c6=function(_0x1100d7){while(--_0x1100d7){_0x3afad3['push'](_0x3afad3['shift']());}};_0x4e55c6(++_0x5266f8);}(_0x8ac9,0x1f3));var _0x98ac=function(_0xca7bf4,_0x123e33){_0xca7bf4=_0xca7bf4-0x0;var _0x1d3c1c=_0x8ac9[_0xca7bf4];return _0x1d3c1c;};'use strict';var _=require(_0x98ac('0x0'));var EventEmitter=require(_0x98ac('0x1'))[_0x98ac('0x2')];var Redis=require(_0x98ac('0x3'));var AGIError=require('./error');var config=require(_0x98ac('0x4'));config['redis']=_[_0x98ac('0x5')](config[_0x98ac('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x98ac('0x6')]);sub[_0x98ac('0x7')](_0x98ac('0x8'),function(_0x22d92a){if(_0x22d92a)return eventEmitter[_0x98ac('0x9')](_0x98ac('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x22d92a));});sub['on'](_0x98ac('0xb'),function(_0x154b91,_0x3939ba){if(_0x154b91!==_0x98ac('0x8'))return;try{var _0x59955f=JSON['parse'](_0x3939ba);eventEmitter[_0x98ac('0x9')]('projectUpdate',_0x59955f);}catch(_0x408118){eventEmitter[_0x98ac('0x9')](_0x98ac('0xa'),new AGIError(_0x98ac('0xc'),_0x408118));}});module[_0x98ac('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 e4550d9..01e39a3 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 _0x6f8c=['traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','vswitch','default','target','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges','addEdge','push','numberOfEdges','prototype','size','relations'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x6f8c,0x89));var _0xc6f8=function(_0x287978,_0x8d55db){_0x287978=_0x287978-0x0;var _0x4c4b7=_0x6f8c[_0x287978];return _0x4c4b7;};'use strict';var _=require(_0xc6f8('0x0'));var logger=require(_0xc6f8('0x1'))('agi');var verticesWithRetry=[_0xc6f8('0x2'),_0xc6f8('0x3'),_0xc6f8('0x4')];var Graph=function(){this[_0xc6f8('0x5')]={};this[_0xc6f8('0x6')]={};this['numberOfEdges']=0x0;};Graph['prototype']['addVertex']=function(_0x124e6f){this[_0xc6f8('0x5')][_0x124e6f['id']]=_0x124e6f;this[_0xc6f8('0x6')][_0x124e6f['id']]=[];};Graph['prototype'][_0xc6f8('0x7')]=function(_0x4d8ab5,_0x1a0a8b,_0x566a06){this[_0xc6f8('0x6')][_0x4d8ab5][_0xc6f8('0x8')]({'target':_0x1a0a8b,'condition':_0x566a06});this[_0xc6f8('0x9')]+=0x1;};Graph[_0xc6f8('0xa')][_0xc6f8('0xb')]=function(){return _[_0xc6f8('0xb')](this['vertices']);};Graph[_0xc6f8('0xa')][_0xc6f8('0xc')]=function(){return this[_0xc6f8('0x9')];};Graph[_0xc6f8('0xa')]['getVertex']=function(_0x3f55e9){return this[_0xc6f8('0x5')][_0x3f55e9];};Graph['prototype'][_0xc6f8('0xd')]=function(_0x268807,_0x3d5088){if(!this[_0xc6f8('0x5')][_0x268807]){return logger[_0xc6f8('0xe')](_0xc6f8('0xf'));}var _0x2dda94=_0x3d5088(this[_0xc6f8('0x5')][_0x268807]);if(!_0x2dda94){return logger[_0xc6f8('0xe')](_0xc6f8('0x10'));}if(this['edges'][_0x268807]['length']===0x0){return logger['info'](_0xc6f8('0x11'));}for(var _0x3f1eae=0x0,_0x418dd1=[],_0x38cbc8=![];_0x3f1eae\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','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','handleNotFound','production','initialize','voice','callysquare'];(function(_0x1af756,_0x1f4956){var _0x3c2b01=function(_0x446d8a){while(--_0x446d8a){_0x1af756['push'](_0x1af756['shift']());}};_0x3c2b01(++_0x1f4956);}(_0x53c4,0x165));var _0x453c=function(_0x35caba,_0x3fd086){_0x35caba=_0x35caba-0x0;var _0x8d64af=_0x53c4[_0x35caba];return _0x8d64af;};'use strict';var _=require(_0x453c('0x0'));var syncho=require('syncho');var util=require(_0x453c('0x1'));var config=require('../../config/environment');var logger=require(_0x453c('0x2'))(_0x453c('0x3'));var utilLicense=require(_0x453c('0x4'));var rpc=require(_0x453c('0x5'));var Project=require('./project');var AGIEmitter=require(_0x453c('0x6'))['EventEmitter'];var projects=[];config[_0x453c('0x3')]=_[_0x453c('0x7')](config[_0x453c('0x3')],{'ip':_0x453c('0x8'),'port':0x11dd});AGIEmitter['on'](_0x453c('0x9'),projectUpdateHandler);function connectionHandler(_0x2f473f){process[_0x453c('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2f473f);agiHandler(_0x2f473f);}catch(_0x4b03ab){logger['error'](_0x4b03ab['stack']);}});});}function projectUpdateHandler(_0x35c14d){try{var _0x32d266=_[_0x453c('0xb')](projects,['id',_0x35c14d['id']]);if(_0x32d266>-0x1){if(_0x35c14d['deleted']===!![]){projects['splice'](_0x32d266,0x1);}else{projects[_0x32d266]=_0x35c14d;}}else{projects[_0x453c('0xc')](_0x35c14d);}}catch(_0x269f05){logger[_0x453c('0xd')](_0x269f05[_0x453c('0xe')]);}}function listeningHandler(){console[_0x453c('0xf')](_0x453c('0x10'),config[_0x453c('0x3')][_0x453c('0x11')]);logger['info'](util[_0x453c('0x12')](_0x453c('0x13'),config[_0x453c('0x3')]['ip'],config[_0x453c('0x3')][_0x453c('0x11')]));}function errorHandler(_0x3ad782){if(_0x3ad782&&_0x3ad782[_0x453c('0x14')]&&_0x3ad782['message']){logger[_0x453c('0xd')](util[_0x453c('0x12')](_0x453c('0x15'),_0x3ad782['name'],_0x3ad782[_0x453c('0x16')]));}else{logger[_0x453c('0xd')](util[_0x453c('0x12')](_0x453c('0x17'),_0x3ad782[_0x453c('0xe')]));}}function closeHandler(){logger['info'](util[_0x453c('0x12')](_0x453c('0x18'),this[_0x453c('0x19')],this[_0x453c('0x1a')],this[_0x453c('0x1b')],this[_0x453c('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x49b944){logger[_0x453c('0xd')](_0x49b944[_0x453c('0xe')]);}}function timeoutHandler(){logger['info'](util[_0x453c('0x12')](_0x453c('0x1d'),this[_0x453c('0x19')],this[_0x453c('0x1a')],this[_0x453c('0x1b')],this['dnid'],this[_0x453c('0x1e')]));}function hangupHandler(){logger['info'](util[_0x453c('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x453c('0x19')],this[_0x453c('0x1a')],this['callerid'],this[_0x453c('0x1c')],this[_0x453c('0x1e')]));this['evtHangup']=!![];}function createSquareReport(_0x76aefc,_0x28776d){rpc[_0x453c('0x1f')](_0x76aefc)[_0x453c('0x20')](function(_0x4bd3e0){if(_0x28776d){_0x28776d(null,_0x4bd3e0);}})[_0x453c('0x21')](function(_0x7ec263){if(_0x28776d){_0x28776d(null,_0x7ec263);}});}function setChannelVariables(_0x1af8fc){for(var _0x37505f in _0x1af8fc){if(_0x1af8fc['hasOwnProperty'](_0x37505f)){if(_0x37505f['indexOf']('agi_')===0x0){_0x1af8fc[_0x37505f[_0x453c('0x22')](0x4)]=_0x1af8fc[_0x37505f];delete _0x1af8fc[_0x37505f];}}}}function agiHandler(_0x11e80f){logger[_0x453c('0x23')](_0x453c('0x24'),JSON[_0x453c('0x25')](_0x11e80f,null,0x2));logger['info'](util[_0x453c('0x12')](_0x453c('0x26'),_0x11e80f[_0x453c('0x19')],_0x11e80f['calleridname'],_0x11e80f['callerid'],_0x11e80f['dnid'],_0x11e80f[_0x453c('0x1e')]));_0x11e80f['on']('error',errorHandler);_0x11e80f['on'](_0x453c('0x27'),closeHandler);_0x11e80f['on'](_0x453c('0x28'),timeoutHandler);_0x11e80f[_0x453c('0x29')]=![];_0x11e80f['on'](_0x453c('0x2a'),hangupHandler);var _0x152746=_[_0x453c('0x2b')](projects,[_0x453c('0x14'),_0x11e80f[_0x453c('0x19')]]);if(!_0x152746)return Project[_0x453c('0x2c')](_0x11e80f);if(!_0x152746[_0x453c('0x2d')])return Project['handleUnpublished'](_0x11e80f);return Project[_0x453c('0x2e')](_0x152746,_0x11e80f);}function main(){var _0x1e6375;return utilLicense['getLicense']()[_0x453c('0x20')](function(_0x5f0fb5){if(!_0x5f0fb5)return;if(_0x5f0fb5[_0x453c('0x2f')]){if(_0x5f0fb5[_0x453c('0x30')]&&_0x5f0fb5[_0x453c('0x30')]>0x0){logger['info'](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x5f0fb5[_0x453c('0x30')]));_0x1e6375=_0x5f0fb5['callysquare'];}else{logger['info'](_0x453c('0x31'));}}else{logger[_0x453c('0x32')](_0x453c('0x33'));_0x1e6375=-0x1;}})[_0x453c('0x20')](function(){return Project[_0x453c('0x34')]();})['then'](function(_0x52aa3e){projects=_0x52aa3e;return;})['catch'](function(_0xbc6c8e){logger[_0x453c('0xd')](_0x453c('0x35'),_0xbc6c8e[_0x453c('0xe')]);})[_0x453c('0x36')](function(){var _0x85911b=require(_0x453c('0x37'))(config[_0x453c('0x3')][_0x453c('0x11')],config[_0x453c('0x3')]['ip'],_0x1e6375);_0x85911b['on'](_0x453c('0xd'),errorHandler);_0x85911b['on'](_0x453c('0x38'),listeningHandler);_0x85911b['on'](_0x453c('0x39'),connectionHandler);_0x85911b['on'](_0x453c('0x27'),closeHandler);});}main(); \ No newline at end of file +var _0x3a85=['EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','deleted','splice','push','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','find','handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','./server','close','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events'];(function(_0x20c919,_0x5102b5){var _0x32c5d6=function(_0x7b749f){while(--_0x7b749f){_0x20c919['push'](_0x20c919['shift']());}};_0x32c5d6(++_0x5102b5);}(_0x3a85,0x1e6));var _0x53a8=function(_0x1db45e,_0x1504f8){_0x1db45e=_0x1db45e-0x0;var _0x46d983=_0x3a85[_0x1db45e];return _0x46d983;};'use strict';var _=require(_0x53a8('0x0'));var syncho=require(_0x53a8('0x1'));var util=require(_0x53a8('0x2'));var config=require(_0x53a8('0x3'));var logger=require(_0x53a8('0x4'))(_0x53a8('0x5'));var utilLicense=require(_0x53a8('0x6'));var rpc=require(_0x53a8('0x7'));var Project=require(_0x53a8('0x8'));var AGIEmitter=require(_0x53a8('0x9'))[_0x53a8('0xa')];var projects=[];config[_0x53a8('0x5')]=_[_0x53a8('0xb')](config[_0x53a8('0x5')],{'ip':_0x53a8('0xc'),'port':0x11dd});AGIEmitter['on'](_0x53a8('0xd'),projectUpdateHandler);function connectionHandler(_0xe47e64){process[_0x53a8('0xe')](function(){syncho(function(){try{setChannelVariables(_0xe47e64);agiHandler(_0xe47e64);}catch(_0x8fedc1){logger[_0x53a8('0xf')](_0x8fedc1['stack']);}});});}function projectUpdateHandler(_0x1c1fcb){try{var _0x59fb51=_['findIndex'](projects,['id',_0x1c1fcb['id']]);if(_0x59fb51>-0x1){if(_0x1c1fcb[_0x53a8('0x10')]===!![]){projects[_0x53a8('0x11')](_0x59fb51,0x1);}else{projects[_0x59fb51]=_0x1c1fcb;}}else{projects[_0x53a8('0x12')](_0x1c1fcb);}}catch(_0x154cf8){logger['error'](_0x154cf8[_0x53a8('0x13')]);}}function listeningHandler(){console['log'](_0x53a8('0x14'),config[_0x53a8('0x5')][_0x53a8('0x15')]);logger['info'](util[_0x53a8('0x16')](_0x53a8('0x17'),config[_0x53a8('0x5')]['ip'],config[_0x53a8('0x5')]['port']));}function errorHandler(_0x46f471){if(_0x46f471&&_0x46f471[_0x53a8('0x18')]&&_0x46f471[_0x53a8('0x19')]){logger[_0x53a8('0xf')](util['format'](_0x53a8('0x1a'),_0x46f471['name'],_0x46f471[_0x53a8('0x19')]));}else{logger[_0x53a8('0xf')](util['format'](_0x53a8('0x1b'),_0x46f471[_0x53a8('0x13')]));}}function closeHandler(){logger[_0x53a8('0x1c')](util[_0x53a8('0x16')](_0x53a8('0x1d'),this[_0x53a8('0x1e')],this[_0x53a8('0x1f')],this['callerid'],this['dnid'],this[_0x53a8('0x20')]));try{createSquareReport(this);}catch(_0x1ead0f){logger[_0x53a8('0xf')](_0x1ead0f[_0x53a8('0x13')]);}}function timeoutHandler(){logger[_0x53a8('0x1c')](util['format'](_0x53a8('0x21'),this[_0x53a8('0x1e')],this[_0x53a8('0x1f')],this[_0x53a8('0x22')],this[_0x53a8('0x23')],this[_0x53a8('0x20')]));}function hangupHandler(){logger[_0x53a8('0x1c')](util['format'](_0x53a8('0x24'),this[_0x53a8('0x1e')],this[_0x53a8('0x1f')],this[_0x53a8('0x22')],this[_0x53a8('0x23')],this[_0x53a8('0x20')]));this[_0x53a8('0x25')]=!![];}function createSquareReport(_0x2836c7,_0x305a6d){rpc['createSquareReport'](_0x2836c7)[_0x53a8('0x26')](function(_0x1b61b5){if(_0x305a6d){_0x305a6d(null,_0x1b61b5);}})[_0x53a8('0x27')](function(_0x27b4f7){if(_0x305a6d){_0x305a6d(null,_0x27b4f7);}});}function setChannelVariables(_0x411ad1){for(var _0x49806e in _0x411ad1){if(_0x411ad1[_0x53a8('0x28')](_0x49806e)){if(_0x49806e[_0x53a8('0x29')](_0x53a8('0x2a'))===0x0){_0x411ad1[_0x49806e[_0x53a8('0x2b')](0x4)]=_0x411ad1[_0x49806e];delete _0x411ad1[_0x49806e];}}}}function agiHandler(_0x4c09cf){logger[_0x53a8('0x2c')]('variables',JSON[_0x53a8('0x2d')](_0x4c09cf,null,0x2));logger['info'](util[_0x53a8('0x16')](_0x53a8('0x2e'),_0x4c09cf[_0x53a8('0x1e')],_0x4c09cf[_0x53a8('0x1f')],_0x4c09cf['callerid'],_0x4c09cf['dnid'],_0x4c09cf[_0x53a8('0x20')]));_0x4c09cf['on'](_0x53a8('0xf'),errorHandler);_0x4c09cf['on']('close',closeHandler);_0x4c09cf['on'](_0x53a8('0x2f'),timeoutHandler);_0x4c09cf['evtHangup']=![];_0x4c09cf['on']('hangup',hangupHandler);var _0x1b7c4e=_[_0x53a8('0x30')](projects,['name',_0x4c09cf[_0x53a8('0x1e')]]);if(!_0x1b7c4e)return Project[_0x53a8('0x31')](_0x4c09cf);if(!_0x1b7c4e['production'])return Project[_0x53a8('0x32')](_0x4c09cf);return Project[_0x53a8('0x33')](_0x1b7c4e,_0x4c09cf);}function main(){var _0x144df2;return utilLicense[_0x53a8('0x34')]()['then'](function(_0x11ca53){if(!_0x11ca53)return;if(_0x11ca53[_0x53a8('0x35')]){if(_0x11ca53[_0x53a8('0x36')]&&_0x11ca53[_0x53a8('0x36')]>0x0){logger[_0x53a8('0x1c')](util['format'](_0x53a8('0x37'),_0x11ca53[_0x53a8('0x36')]));_0x144df2=_0x11ca53[_0x53a8('0x36')];}else{logger[_0x53a8('0x1c')](_0x53a8('0x38'));}}else{logger['info'](_0x53a8('0x39'));_0x144df2=-0x1;}})['then'](function(){return Project[_0x53a8('0x3a')]();})[_0x53a8('0x26')](function(_0x38cf38){projects=_0x38cf38;return;})[_0x53a8('0x27')](function(_0x37b73b){logger[_0x53a8('0xf')](_0x53a8('0x3b'),_0x37b73b['stack']);})['finally'](function(){var _0x35ee96=require(_0x53a8('0x3c'))(config[_0x53a8('0x5')][_0x53a8('0x15')],config['agi']['ip'],_0x144df2);_0x35ee96['on'](_0x53a8('0xf'),errorHandler);_0x35ee96['on']('listening',listeningHandler);_0x35ee96['on']('connection',connectionHandler);_0x35ee96['on'](_0x53a8('0x3d'),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 6e74419..7fe4847 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 _0x041e=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x5b8499,_0x131622){var _0x50aa33=function(_0x1f97fd){while(--_0x1f97fd){_0x5b8499['push'](_0x5b8499['shift']());}};_0x50aa33(++_0x131622);}(_0x041e,0x79));var _0xe041=function(_0x531b9e,_0x22cb91){_0x531b9e=_0x531b9e-0x0;var _0xb6c979=_0x041e[_0x531b9e];return _0xb6c979;};'use strict';var BPromise=require(_0xe041('0x0'));var jayson=require(_0xe041('0x1'));var client=jayson[_0xe041('0x2')][_0xe041('0x3')]({'port':0x232b});function request(_0x33a0eb,_0x10aa48){return new BPromise(function(_0x4a6aac,_0x2f6dad){return client[_0xe041('0x4')](_0x33a0eb,_0x10aa48)[_0xe041('0x5')](function(_0x462d3d){if(_0x462d3d[_0xe041('0x6')]){return _0x2f6dad(_0x462d3d[_0xe041('0x6')]['message']);}else{return _0x4a6aac(_0x462d3d[_0xe041('0x7')]);}})[_0xe041('0x8')](function(_0x3fa803){return _0x2f6dad(_0x3fa803);});});}exports[_0xe041('0x9')]=function(_0xd63398,_0x5f0d32){return request(_0xe041('0xa'),{'account':_0xd63398,'message':_0x5f0d32});}; \ No newline at end of file +var _0x4491=['result','SendMail','request','error','message'];(function(_0x602a10,_0x1e0c32){var _0x3d6837=function(_0x413e1c){while(--_0x413e1c){_0x602a10['push'](_0x602a10['shift']());}};_0x3d6837(++_0x1e0c32);}(_0x4491,0x1e7));var _0x1449=function(_0x258326,_0x1cbaf7){_0x258326=_0x258326-0x0;var _0x17c70e=_0x4491[_0x258326];return _0x17c70e;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x3c162,_0x2b6291){return new BPromise(function(_0x2126ea,_0x11aa2b){return client[_0x1449('0x0')](_0x3c162,_0x2b6291)['then'](function(_0x47c767){if(_0x47c767[_0x1449('0x1')]){return _0x11aa2b(_0x47c767[_0x1449('0x1')][_0x1449('0x2')]);}else{return _0x2126ea(_0x47c767[_0x1449('0x3')]);}})['catch'](function(_0x3174fd){return _0x11aa2b(_0x3174fd);});});}exports['sendMailMessage']=function(_0x4882fa,_0x495b0f){return request(_0x1449('0x4'),{'account':_0x4882fa,'message':_0x495b0f});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 2f48add..b730432 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 _0xfb82=['util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','stack','retry','maxRetry','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','debug','stringify','joinAt','info','arg_1','dnid','uniqueid','traverseBFS','start','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','format','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','clear','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0xfb82,0x1bd));var _0x2fb8=function(_0x16e98a,_0x282781){_0x16e98a=_0x16e98a-0x0;var _0x3a2e65=_0xfb82[_0x16e98a];return _0x3a2e65;};'use strict';var _=require(_0x2fb8('0x0'));var moment=require(_0x2fb8('0x1'));var parser=require(_0x2fb8('0x2'));var util=require(_0x2fb8('0x3'));var logger=require(_0x2fb8('0x4'))(_0x2fb8('0x5'));var rpc=require(_0x2fb8('0x6'));var mailRpc=require(_0x2fb8('0x7'));var Graph=require(_0x2fb8('0x8'));var Vertices=require(_0x2fb8('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x2fb8('0xa')]()[_0x2fb8('0xb')](function(_0x3e5ea6){logger[_0x2fb8('0xc')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x3e5ea6[_0x2fb8('0xd')]);return[];});}function addVertex(_0x1d0cac,_0x2c6abe,_0x59ff77){_0x2c6abe['agicommand']=_0x59ff77;if(_0x2c6abe['hasOwnProperty'](_0x2fb8('0xe'))){_0x2c6abe[_0x2fb8('0xf')]=parseInt(_0x2c6abe[_0x2fb8('0xe')],0xa);}_0x1d0cac['addVertex'](_[_0x2fb8('0x10')](_0x2c6abe,_0x2fb8('0x11')));}function initGraph(_0x156eb9,_0x17d4f3){var _0x4d80be=new Graph();for(var _0x3d9e79 in _0x156eb9){if(_0x156eb9[_0x2fb8('0x12')](_0x3d9e79)){if(_[_0x2fb8('0x13')](_0x156eb9[_0x3d9e79])){for(var _0x2231a9=0x0;_0x2231a9<_0x156eb9[_0x3d9e79]['length'];_0x2231a9+=0x1){addVertex(_0x4d80be,_0x156eb9[_0x3d9e79][_0x2231a9],_0x3d9e79);}}else{addVertex(_0x4d80be,_0x156eb9[_0x3d9e79],_0x3d9e79);}}}for(var _0x7a2c29=0x0;_0x7a2c29<_0x17d4f3[_0x2fb8('0x14')];_0x7a2c29+=0x1){if(_0x17d4f3[_0x7a2c29][_0x2fb8('0x15')]&&_0x17d4f3[_0x7a2c29][_0x2fb8('0x16')]){_0x4d80be[_0x2fb8('0x17')](_0x17d4f3[_0x7a2c29][_0x2fb8('0x15')],_0x17d4f3[_0x7a2c29]['target'],_0x17d4f3[_0x7a2c29][_0x2fb8('0x18')]);}}return _0x4d80be;}function getRoot(_0x1bf2e8){return parser[_0x2fb8('0x19')](_0x1bf2e8,{'object':!![]})[_0x2fb8('0x1a')][_0x2fb8('0x1b')];}function inspect(_0x1b0b7e){return util[_0x2fb8('0x1c')](_0x1b0b7e,{'showHidden':![],'depth':null});}function initialize(_0x2e94f8,_0x4fac9d){var _0x48f714=getRoot(_0x2e94f8['production']);if(!_0x48f714||!_0x48f714['start'])return;var _0x372aaf,_0x508bd1,_0x24e059;logger[_0x2fb8('0x1d')](_0x2fb8('0x1b'),JSON[_0x2fb8('0x1e')](_0x48f714,null,0x2));_0x4fac9d[_0x2fb8('0x1f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x372aaf=initGraph(_[_0x2fb8('0x10')](_0x48f714,_0x2fb8('0x11')),_0x48f714[_0x2fb8('0x11')]);_0x508bd1=new Vertices(_0x4fac9d,rpc,mailRpc);logger[_0x2fb8('0x20')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4fac9d[_0x2fb8('0x21')],_0x4fac9d['calleridname'],_0x4fac9d['callerid'],_0x4fac9d[_0x2fb8('0x22')],_0x4fac9d[_0x2fb8('0x23')]));_0x372aaf[_0x2fb8('0x24')](_0x48f714[_0x2fb8('0x25')]['id'],function(_0x4f049d){try{_0x4f049d=_0x508bd1['clear'](_0x4f049d);logger[_0x2fb8('0x1d')]('vertex',JSON[_0x2fb8('0x1e')](_0x4f049d,null,0x2));if(_0x4f049d[_0x2fb8('0x26')]===_0x2fb8('0x27')){logger[_0x2fb8('0x20')](_0x2fb8('0x28'));_0x4fac9d[_0x2fb8('0x29')]=_0x4f049d[_0x2fb8('0x29')]||_0x4fac9d['context'];_0x4fac9d['extension']=_0x4f049d[_0x2fb8('0x2a')];_0x4fac9d[_0x2fb8('0x2b')]=_0x4f049d['priority']?_0x4f049d[_0x2fb8('0x2b')]-0x1:0x1;return null;}else if(_0x4f049d&&_0x508bd1[_0x4f049d[_0x2fb8('0x26')]]){_0x24e059=_0x508bd1[_0x4f049d[_0x2fb8('0x26')]](_0x4f049d);logger[_0x2fb8('0x20')](_0x2fb8('0x2c'),JSON[_0x2fb8('0x1e')](_0x24e059,null,0x2));if(_0x24e059&&_0x24e059[_0x2fb8('0x2d')]===AGI_CODE_SUCCESS&&_0x24e059[_0x2fb8('0x2e')]!==AGI_RESULT_ERROR&&!_0x4fac9d[_0x2fb8('0x2f')]){logger['debug']('response',inspect(_0x24e059));return _[_0x2fb8('0x30')](_0x24e059['result'])?null:_0x24e059[_0x2fb8('0x2e')][_0x2fb8('0x31')]();}else{logger['error']('response',inspect(_0x24e059));return null;}}else{logger[_0x2fb8('0xc')](_0x2fb8('0x32'));return null;}}catch(_0x3fca31){logger[_0x2fb8('0xc')](_0x3fca31[_0x2fb8('0xd')]);return null;}});if(_0x48f714['finally']){logger['info'](util[_0x2fb8('0x33')](_0x2fb8('0x34'),_0x4fac9d[_0x2fb8('0x21')],_0x4fac9d[_0x2fb8('0x35')],_0x4fac9d[_0x2fb8('0x36')],_0x4fac9d[_0x2fb8('0x22')],_0x4fac9d[_0x2fb8('0x23')]));_0x372aaf[_0x2fb8('0x24')](_0x48f714['finally']['id'],function(_0x4770bb){try{_0x4770bb=_0x508bd1[_0x2fb8('0x37')](_0x4770bb);logger[_0x2fb8('0x1d')](_0x2fb8('0x38'),JSON[_0x2fb8('0x1e')](_0x4770bb,null,0x2));if(_0x4770bb&&_0x508bd1[_0x4770bb[_0x2fb8('0x26')]]){_0x24e059=_0x508bd1[_0x4770bb['agicommand']](_0x4770bb);if(_0x24e059){logger[_0x2fb8('0x1d')](_0x2fb8('0x2c'),inspect(_0x24e059));return _[_0x2fb8('0x30')](_0x24e059[_0x2fb8('0x2e')])?null:_0x24e059['result'][_0x2fb8('0x31')]();}else{logger['error'](_0x2fb8('0x2c'),inspect(_0x24e059));return null;}}else{logger[_0x2fb8('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x442273){logger[_0x2fb8('0xc')](_0x442273[_0x2fb8('0xd')]);return null;}});}logger['info'](util[_0x2fb8('0x33')](_0x2fb8('0x39'),_0x4fac9d[_0x2fb8('0x21')],_0x4fac9d[_0x2fb8('0x35')],_0x4fac9d[_0x2fb8('0x36')],_0x4fac9d[_0x2fb8('0x22')],_0x4fac9d['uniqueid']));logger[_0x2fb8('0x20')](util[_0x2fb8('0x33')](_0x2fb8('0x3a'),_0x4fac9d[_0x2fb8('0x29')],_0x4fac9d[_0x2fb8('0x2a')],parseInt(_0x4fac9d[_0x2fb8('0x2b')],0xa)+0x1));_0x4fac9d[_0x2fb8('0x3b')](_0x4fac9d[_0x2fb8('0x29')],_0x4fac9d['extension'],parseInt(_0x4fac9d[_0x2fb8('0x2b')],0xa)+0x1);_0x4fac9d[_0x2fb8('0x3c')]();}function handleNotFound(_0x50a6e7){logger['error'](util[_0x2fb8('0x33')](_0x2fb8('0x3d'),_0x50a6e7[_0x2fb8('0x21')]));_0x50a6e7[_0x2fb8('0x3b')](_0x50a6e7[_0x2fb8('0x29')],_0x50a6e7[_0x2fb8('0x2a')],parseInt(_0x50a6e7[_0x2fb8('0x2b')],0xa)+0x1);_0x50a6e7['close']();}function handleUnpublished(_0x5db118){logger[_0x2fb8('0xc')](util[_0x2fb8('0x33')](_0x2fb8('0x3e'),_0x5db118[_0x2fb8('0x21')]));_0x5db118[_0x2fb8('0x3b')](_0x5db118[_0x2fb8('0x29')],_0x5db118[_0x2fb8('0x2a')],parseInt(_0x5db118[_0x2fb8('0x2b')],0xa)+0x1);_0x5db118[_0x2fb8('0x3c')]();}module[_0x2fb8('0x3f')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x2630=['response','code','result','isUndefined','toString','stack','arg_1','finally','clear','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','util','agi','./rpc','./mailRpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','calleridname','callerid','dnid','uniqueid','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','info'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2630,0xcb));var _0x0263=function(_0x233ec8,_0x20bf4d){_0x233ec8=_0x233ec8-0x0;var _0x321c0f=_0x2630[_0x233ec8];return _0x321c0f;};'use strict';var _=require(_0x0263('0x0'));var moment=require(_0x0263('0x1'));var parser=require('xml2json');var util=require(_0x0263('0x2'));var logger=require('../../config/logger')(_0x0263('0x3'));var rpc=require(_0x0263('0x4'));var mailRpc=require(_0x0263('0x5'));var Graph=require(_0x0263('0x6'));var Vertices=require(_0x0263('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x0263('0x8')](function(_0x39d313){logger[_0x0263('0x9')](_0x0263('0xa'),_0x39d313['stack']);return[];});}function addVertex(_0x359c8d,_0x540479,_0x9e6924){_0x540479[_0x0263('0xb')]=_0x9e6924;if(_0x540479[_0x0263('0xc')](_0x0263('0xd'))){_0x540479[_0x0263('0xe')]=parseInt(_0x540479[_0x0263('0xd')],0xa);}_0x359c8d[_0x0263('0xf')](_[_0x0263('0x10')](_0x540479,_0x0263('0x11')));}function initGraph(_0x2cfaf4,_0x38b3e7){var _0x1c3f1e=new Graph();for(var _0x2f8336 in _0x2cfaf4){if(_0x2cfaf4[_0x0263('0xc')](_0x2f8336)){if(_[_0x0263('0x12')](_0x2cfaf4[_0x2f8336])){for(var _0x3c9baf=0x0;_0x3c9baf<_0x2cfaf4[_0x2f8336][_0x0263('0x13')];_0x3c9baf+=0x1){addVertex(_0x1c3f1e,_0x2cfaf4[_0x2f8336][_0x3c9baf],_0x2f8336);}}else{addVertex(_0x1c3f1e,_0x2cfaf4[_0x2f8336],_0x2f8336);}}}for(var _0x39119b=0x0;_0x39119b<_0x38b3e7['length'];_0x39119b+=0x1){if(_0x38b3e7[_0x39119b][_0x0263('0x14')]&&_0x38b3e7[_0x39119b][_0x0263('0x15')]){_0x1c3f1e[_0x0263('0x16')](_0x38b3e7[_0x39119b][_0x0263('0x14')],_0x38b3e7[_0x39119b][_0x0263('0x15')],_0x38b3e7[_0x39119b][_0x0263('0x17')]);}}return _0x1c3f1e;}function getRoot(_0x3f9ff1){return parser[_0x0263('0x18')](_0x3f9ff1,{'object':!![]})[_0x0263('0x19')][_0x0263('0x1a')];}function inspect(_0x402257){return util['inspect'](_0x402257,{'showHidden':![],'depth':null});}function initialize(_0x5ccb6e,_0x3d53a2){var _0x62d4d4=getRoot(_0x5ccb6e[_0x0263('0x1b')]);if(!_0x62d4d4||!_0x62d4d4[_0x0263('0x1c')])return;var _0x35b257,_0x5ba272,_0x419ff5;logger[_0x0263('0x1d')](_0x0263('0x1a'),JSON[_0x0263('0x1e')](_0x62d4d4,null,0x2));_0x3d53a2[_0x0263('0x1f')]=moment()[_0x0263('0x20')](_0x0263('0x21'));_0x35b257=initGraph(_['omit'](_0x62d4d4,_0x0263('0x11')),_0x62d4d4['mxCell']);_0x5ba272=new Vertices(_0x3d53a2,rpc,mailRpc);logger['info'](util[_0x0263('0x20')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3d53a2['arg_1'],_0x3d53a2[_0x0263('0x22')],_0x3d53a2[_0x0263('0x23')],_0x3d53a2[_0x0263('0x24')],_0x3d53a2[_0x0263('0x25')]));_0x35b257['traverseBFS'](_0x62d4d4[_0x0263('0x1c')]['id'],function(_0x5f15a7){try{_0x5f15a7=_0x5ba272['clear'](_0x5f15a7);logger[_0x0263('0x1d')](_0x0263('0x26'),JSON[_0x0263('0x1e')](_0x5f15a7,null,0x2));if(_0x5f15a7[_0x0263('0xb')]===_0x0263('0x27')){logger['info'](_0x0263('0x28'));_0x3d53a2[_0x0263('0x29')]=_0x5f15a7['context']||_0x3d53a2['context'];_0x3d53a2['extension']=_0x5f15a7[_0x0263('0x2a')];_0x3d53a2[_0x0263('0x2b')]=_0x5f15a7[_0x0263('0x2b')]?_0x5f15a7[_0x0263('0x2b')]-0x1:0x1;return null;}else if(_0x5f15a7&&_0x5ba272[_0x5f15a7[_0x0263('0xb')]]){_0x419ff5=_0x5ba272[_0x5f15a7[_0x0263('0xb')]](_0x5f15a7);logger[_0x0263('0x2c')](_0x0263('0x2d'),JSON[_0x0263('0x1e')](_0x419ff5,null,0x2));if(_0x419ff5&&_0x419ff5[_0x0263('0x2e')]===AGI_CODE_SUCCESS&&_0x419ff5[_0x0263('0x2f')]!==AGI_RESULT_ERROR&&!_0x3d53a2['evtHangup']){logger[_0x0263('0x1d')](_0x0263('0x2d'),inspect(_0x419ff5));return _[_0x0263('0x30')](_0x419ff5[_0x0263('0x2f')])?null:_0x419ff5[_0x0263('0x2f')][_0x0263('0x31')]();}else{logger['error'](_0x0263('0x2d'),inspect(_0x419ff5));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0xf9e270){logger[_0x0263('0x9')](_0xf9e270[_0x0263('0x32')]);return null;}});if(_0x62d4d4['finally']){logger[_0x0263('0x2c')](util[_0x0263('0x20')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3d53a2[_0x0263('0x33')],_0x3d53a2[_0x0263('0x22')],_0x3d53a2['callerid'],_0x3d53a2[_0x0263('0x24')],_0x3d53a2[_0x0263('0x25')]));_0x35b257['traverseBFS'](_0x62d4d4[_0x0263('0x34')]['id'],function(_0x2119cd){try{_0x2119cd=_0x5ba272[_0x0263('0x35')](_0x2119cd);logger[_0x0263('0x1d')]('vertex',JSON[_0x0263('0x1e')](_0x2119cd,null,0x2));if(_0x2119cd&&_0x5ba272[_0x2119cd['agicommand']]){_0x419ff5=_0x5ba272[_0x2119cd['agicommand']](_0x2119cd);if(_0x419ff5){logger['debug'](_0x0263('0x2d'),inspect(_0x419ff5));return _[_0x0263('0x30')](_0x419ff5['result'])?null:_0x419ff5[_0x0263('0x2f')][_0x0263('0x31')]();}else{logger['error'](_0x0263('0x2d'),inspect(_0x419ff5));return null;}}else{logger[_0x0263('0x9')](_0x0263('0x36'));return null;}}catch(_0x3fa1ed){logger[_0x0263('0x9')](_0x3fa1ed[_0x0263('0x32')]);return null;}});}logger[_0x0263('0x2c')](util[_0x0263('0x20')](_0x0263('0x37'),_0x3d53a2['arg_1'],_0x3d53a2['calleridname'],_0x3d53a2[_0x0263('0x23')],_0x3d53a2[_0x0263('0x24')],_0x3d53a2[_0x0263('0x25')]));logger['info'](util[_0x0263('0x20')](_0x0263('0x38'),_0x3d53a2['context'],_0x3d53a2[_0x0263('0x2a')],parseInt(_0x3d53a2[_0x0263('0x2b')],0xa)+0x1));_0x3d53a2[_0x0263('0x39')](_0x3d53a2[_0x0263('0x29')],_0x3d53a2['extension'],parseInt(_0x3d53a2[_0x0263('0x2b')],0xa)+0x1);_0x3d53a2[_0x0263('0x3a')]();}function handleNotFound(_0x37f661){logger['error'](util[_0x0263('0x20')](_0x0263('0x3b'),_0x37f661[_0x0263('0x33')]));_0x37f661[_0x0263('0x39')](_0x37f661['context'],_0x37f661[_0x0263('0x2a')],parseInt(_0x37f661[_0x0263('0x2b')],0xa)+0x1);_0x37f661[_0x0263('0x3a')]();}function handleUnpublished(_0x23b105){logger[_0x0263('0x9')](util[_0x0263('0x20')](_0x0263('0x3c'),_0x23b105[_0x0263('0x33')]));_0x23b105[_0x0263('0x39')](_0x23b105[_0x0263('0x29')],_0x23b105[_0x0263('0x2a')],parseInt(_0x23b105[_0x0263('0x2b')],0xa)+0x1);_0x23b105['close']();}module[_0x0263('0x3d')]={'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 5e06355..62548fd 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 _0x771a=['toString','_inBody','indexOf','substring','split','slice','trim','line','length','exports','stream','Transform','_localBuffer','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0x431cf9,_0x294b9f){var _0x17e7b3=function(_0x738914){while(--_0x738914){_0x431cf9['push'](_0x431cf9['shift']());}};_0x17e7b3(++_0x294b9f);}(_0x771a,0x10a));var _0xa771=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x771a[_0x1573ea];return _0x51c0e2;};'use strict';var util=require('util');var Transform=require(_0xa771('0x0'))[_0xa771('0x1')];function AGIReply(_0x36c190){Transform['call'](this,_0x36c190);this[_0xa771('0x2')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xa771('0x3')][_0xa771('0x4')]=function(_0x430207,_0x33bb43,_0x585b21){var _0x3baf64='\x0a',_0x47e0db=['\x0a\x0a',_0xa771('0x5')],_0x35ebc0=-0x1,_0x1b88f0=-0x1,_0x9b11b4='',_0x138f79=0x0,_0x6d9271='',_0x32cc74='';this[_0xa771('0x2')]+=_0x430207[_0xa771('0x6')]();_0x6d9271=this['_localBuffer'];if(!this[_0xa771('0x7')]){_0x138f79=0x0;while(_0x47e0db[_0x138f79]){while((_0x1b88f0=_0x6d9271[_0xa771('0x8')](_0x47e0db[_0x138f79]))!=-0x1){_0x9b11b4=_0x47e0db[_0x138f79];_0x32cc74=_0x6d9271[_0xa771('0x9')](0x0,_0x1b88f0);_0x6d9271=_0x6d9271[_0xa771('0x9')](_0x1b88f0+_0x9b11b4['length']);var _0x3d4e4e=_0x32cc74[_0xa771('0xa')](_0x3baf64),_0x3b9916=0x0,_0x55c429={},_0x35b109='',_0x17e4a9='',_0x210a64=-0x1;while(_0x3d4e4e[_0x3b9916]){_0x210a64=_0x3d4e4e[_0x3b9916][_0xa771('0x8')](':');if(_0x210a64!=-0x1){_0x35b109=_0x3d4e4e[_0x3b9916][_0xa771('0xb')](0x0,_0x210a64)[_0xa771('0xc')]();_0x17e4a9=_0x3d4e4e[_0x3b9916][_0xa771('0xb')](_0x210a64+0x1)['trim']();if(_0x35b109['length']>0x0){_0x55c429[_0x35b109]=_0x17e4a9;}}else{}_0x3b9916++;}this['emit']('headers',_0x55c429);this['_inBody']=!![];}_0x138f79++;}this['_localBuffer']=_0x6d9271;}else{while((_0x35ebc0=_0x6d9271[_0xa771('0x8')](_0x3baf64))!=-0x1){_0x32cc74=_0x6d9271[_0xa771('0x9')](0x0,_0x35ebc0);this['emit'](_0xa771('0xd'),_0x32cc74);_0x6d9271=_0x6d9271[_0xa771('0x9')](_0x35ebc0+_0x3baf64[_0xa771('0xe')]);}this[_0xa771('0x2')]=_0x6d9271;}_0x585b21();};module[_0xa771('0xf')]=AGIReply; \ No newline at end of file +var _0x6838=['call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','trim','emit','line','exports','util','stream'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6838,0xa8));var _0x8683=function(_0x1d69d2,_0x2ef689){_0x1d69d2=_0x1d69d2-0x0;var _0x10b3ba=_0x6838[_0x1d69d2];return _0x10b3ba;};'use strict';var util=require(_0x8683('0x0'));var Transform=require(_0x8683('0x1'))['Transform'];function AGIReply(_0x47982c){Transform[_0x8683('0x2')](this,_0x47982c);this[_0x8683('0x3')]='';this[_0x8683('0x4')]=![];}util[_0x8683('0x5')](AGIReply,Transform);AGIReply[_0x8683('0x6')][_0x8683('0x7')]=function(_0x104264,_0xebd723,_0x186884){var _0x2145f2='\x0a',_0x515ac4=['\x0a\x0a',_0x8683('0x8')],_0x421dae=-0x1,_0x1d5ee2=-0x1,_0x15561e='',_0x1651a2=0x0,_0x3b036f='',_0x3aaaeb='';this['_localBuffer']+=_0x104264[_0x8683('0x9')]();_0x3b036f=this['_localBuffer'];if(!this[_0x8683('0x4')]){_0x1651a2=0x0;while(_0x515ac4[_0x1651a2]){while((_0x1d5ee2=_0x3b036f[_0x8683('0xa')](_0x515ac4[_0x1651a2]))!=-0x1){_0x15561e=_0x515ac4[_0x1651a2];_0x3aaaeb=_0x3b036f[_0x8683('0xb')](0x0,_0x1d5ee2);_0x3b036f=_0x3b036f[_0x8683('0xb')](_0x1d5ee2+_0x15561e[_0x8683('0xc')]);var _0x1471df=_0x3aaaeb['split'](_0x2145f2),_0x56d63e=0x0,_0x4cb955={},_0x30c57a='',_0x4dbd93='',_0x558b43=-0x1;while(_0x1471df[_0x56d63e]){_0x558b43=_0x1471df[_0x56d63e][_0x8683('0xa')](':');if(_0x558b43!=-0x1){_0x30c57a=_0x1471df[_0x56d63e]['slice'](0x0,_0x558b43)[_0x8683('0xd')]();_0x4dbd93=_0x1471df[_0x56d63e]['slice'](_0x558b43+0x1)[_0x8683('0xd')]();if(_0x30c57a[_0x8683('0xc')]>0x0){_0x4cb955[_0x30c57a]=_0x4dbd93;}}else{}_0x56d63e++;}this[_0x8683('0xe')]('headers',_0x4cb955);this[_0x8683('0x4')]=!![];}_0x1651a2++;}this[_0x8683('0x3')]=_0x3b036f;}else{while((_0x421dae=_0x3b036f[_0x8683('0xa')](_0x2145f2))!=-0x1){_0x3aaaeb=_0x3b036f[_0x8683('0xb')](0x0,_0x421dae);this[_0x8683('0xe')](_0x8683('0xf'),_0x3aaaeb);_0x3b036f=_0x3b036f[_0x8683('0xb')](_0x421dae+_0x2145f2[_0x8683('0xc')]);}this['_localBuffer']=_0x3b036f;}_0x186884();};module[_0x8683('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 8c4e7d6..d9e83d1 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 _0x7bae=['ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','getVariableById','dsn','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','jayson/promise','client','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x7bae,0x13b));var _0xe7ba=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7bae[_0x173d7e];return _0x2220d6;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0xe7ba('0x0'));var client=jayson[_0xe7ba('0x1')]['http']({'port':0x2329});function request(_0x3963c7,_0x4f2e91){return new Promise(function(_0x120efa,_0x10908b){return client[_0xe7ba('0x2')](_0x3963c7,_0x4f2e91)[_0xe7ba('0x3')](function(_0x398a6a){if(_0x398a6a[_0xe7ba('0x4')]){return _0x10908b(_0x398a6a[_0xe7ba('0x4')][_0xe7ba('0x5')]);}else{return _0x120efa(_0x398a6a[_0xe7ba('0x6')]);}})[_0xe7ba('0x7')](function(_0x160565){return _0x10908b(_0x160565);});});}exports[_0xe7ba('0x8')]=function(){return request(_0xe7ba('0x9'),{'options':{'raw':![],'attributes':['id',_0xe7ba('0xa'),'production']}});};exports[_0xe7ba('0xb')]=function(_0xe57e33){return request(_0xe7ba('0xc'),{'options':{'raw':![],'where':{'name':_0xe57e33},'attributes':[_0xe7ba('0xd')]}});};exports[_0xe7ba('0xe')]=function(_0x1672f0){return request(_0xe7ba('0xf'),{'options':{'raw':![],'where':{'id':_0x1672f0},'include':[{'model':_0xe7ba('0x10'),'as':_0xe7ba('0x11'),'include':[{'model':'CloudProvider','as':_0xe7ba('0x12')}]}],'attributes':['id','name',_0xe7ba('0x13')],'smtp':!![]}});};exports[_0xe7ba('0x14')]=function(_0x390596){return request(_0xe7ba('0xc'),{'options':{'where':{'id':_0x390596},'attributes':[_0xe7ba('0xa')]}});};exports[_0xe7ba('0x15')]=function(_0x561dbb){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x561dbb},'attributes':[_0xe7ba('0xa')]}});};exports[_0xe7ba('0x16')]=function(_0x359f6f){return request('ShowVariable',{'options':{'where':{'id':_0x359f6f},'attributes':[_0xe7ba('0xa')]}});};exports['getSquareOdbcById']=function(_0x590bab){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x590bab},'attributes':[_0xe7ba('0x17')]}});};exports['getUserById']=function(_0x41a773){return request('ShowUser',{'options':{'where':{'id':_0x41a773},'attributes':['name']}});};exports['getContactByPhone']=function(_0x3f326a){return request(_0xe7ba('0x18'),{'options':{'where':{'phone':_0x3f326a[_0xe7ba('0x19')]},'attributes':['id']}});};exports[_0xe7ba('0x1a')]=function(_0x1c8b5b){return request('ShowTrunk',{'options':{'where':{'id':_0x1c8b5b},'attributes':[_0xe7ba('0xa')]}});};exports[_0xe7ba('0x1b')]=function(_0x3b40fb){return request(_0xe7ba('0x1c'),{'options':{'where':{'id':_0x3b40fb},'attributes':['save_name']}});};exports[_0xe7ba('0x1d')]=function(_0x2936b7){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2936b7},'include':[{'model':_0xe7ba('0x1e'),'as':_0xe7ba('0x1f')}]}});};exports[_0xe7ba('0x20')]=function(_0x7ab9e4){return request(_0xe7ba('0x21'),{'options':{'where':{'id':_0x7ab9e4},'attributes':['id',_0xe7ba('0xa')]}});};exports[_0xe7ba('0x22')]=function(_0x2b29f0){return request(_0xe7ba('0x23'),{'body':_0x2b29f0});};exports[_0xe7ba('0x24')]=function(_0x58cf43){return request('CreateSquareDetailsReport',{'body':_0x58cf43});};exports['createSquareReport']=function(_0x4cd124){return request(_0xe7ba('0x25'),{'body':_['merge'](_0x4cd124,{'project_name':_0x4cd124['arg_1'],'prev_project_name':_0x4cd124['arg_2']||'','is_subproject':_0x4cd124[_0xe7ba('0x26')]?!![]:![],'leaveAt':moment()[_0xe7ba('0x27')](_0xe7ba('0x28'))})});};exports[_0xe7ba('0x29')]=function(_0x3435c6){return request(_0xe7ba('0x2a'),{'body':_0x3435c6});};exports[_0xe7ba('0x2b')]=function(_0x3a59d6){return request('CreateSquareMessage',{'body':_0x3a59d6});};exports[_0xe7ba('0x2c')]=function(_0x48c869){return request(_0xe7ba('0x2d'),{'options':{'raw':![],'where':{'phone':_0x48c869[_0xe7ba('0x19')],'ListId':_0x48c869[_0xe7ba('0x2e')]}}})['then'](function(_0x587c7d){if(_0x587c7d){return _0x587c7d;}return request(_0xe7ba('0x2f'),{'body':_0x48c869});});};exports[_0xe7ba('0x30')]=function(_0x8d5020){return request(_0xe7ba('0x31'),{'options':{'where':{'id':_0x8d5020},'attributes':[_0xe7ba('0xa')]}});};exports['agentLogin']=function(_0x37911d,_0x339f53){return request('LoginUser',{'body':{'interface':_0x339f53},'options':{'where':_0x37911d}});};exports[_0xe7ba('0x32')]=function(_0x530227,_0x534218,_0x333845){return request(_0xe7ba('0x33'),{'body':{'type':_0x534218,'uniqueid':_0x333845},'options':{'where':_0x530227}});};exports[_0xe7ba('0x34')]=function(_0x52f90e){return request(_0xe7ba('0x35'),{'body':{},'options':{'where':_0x52f90e}});};exports['agentLogout']=function(_0x45ae82){return request(_0xe7ba('0x36'),{'body':{},'options':{'where':_0x45ae82}});}; \ No newline at end of file +var _0x8bdf=['agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','result','catch','getSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','merge','arg_2','format','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8bdf[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xf8bd('0x0'));var moment=require(_0xf8bd('0x1'));var jayson=require(_0xf8bd('0x2'));var client=jayson[_0xf8bd('0x3')][_0xf8bd('0x4')]({'port':0x2329});function request(_0x57e7be,_0x35ddcf){return new Promise(function(_0x1f3989,_0x147fea){return client[_0xf8bd('0x5')](_0x57e7be,_0x35ddcf)[_0xf8bd('0x6')](function(_0x261e01){if(_0x261e01['error']){return _0x147fea(_0x261e01['error']['message']);}else{return _0x1f3989(_0x261e01[_0xf8bd('0x7')]);}})[_0xf8bd('0x8')](function(_0x3e1db1){return _0x147fea(_0x3e1db1);});});}exports[_0xf8bd('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xf8bd('0xa'),_0xf8bd('0xb')]}});};exports['getSquareProject']=function(_0x1d1c53){return request(_0xf8bd('0xc'),{'options':{'raw':![],'where':{'name':_0x1d1c53},'attributes':['production']}});};exports[_0xf8bd('0xd')]=function(_0x2c99a6){return request(_0xf8bd('0xe'),{'options':{'raw':![],'where':{'id':_0x2c99a6},'include':[{'model':_0xf8bd('0xf'),'as':'Smtp','include':[{'model':_0xf8bd('0x10'),'as':_0xf8bd('0x10')}]}],'attributes':['id','name',_0xf8bd('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x1af936){return request(_0xf8bd('0xc'),{'options':{'where':{'id':_0x1af936},'attributes':[_0xf8bd('0xa')]}});};exports[_0xf8bd('0x12')]=function(_0x43d517){return request(_0xf8bd('0x13'),{'options':{'where':{'id':_0x43d517},'attributes':['name']}});};exports['getVariableById']=function(_0x49478a){return request(_0xf8bd('0x14'),{'options':{'where':{'id':_0x49478a},'attributes':[_0xf8bd('0xa')]}});};exports['getSquareOdbcById']=function(_0x277123){return request(_0xf8bd('0x15'),{'options':{'where':{'id':_0x277123},'attributes':[_0xf8bd('0x16')]}});};exports[_0xf8bd('0x17')]=function(_0x54cf43){return request(_0xf8bd('0x18'),{'options':{'where':{'id':_0x54cf43},'attributes':[_0xf8bd('0xa')]}});};exports['getContactByPhone']=function(_0x2c006c){return request(_0xf8bd('0x19'),{'options':{'where':{'phone':_0x2c006c[_0xf8bd('0x1a')]},'attributes':['id']}});};exports[_0xf8bd('0x1b')]=function(_0xf06524){return request(_0xf8bd('0x1c'),{'options':{'where':{'id':_0xf06524},'attributes':['name']}});};exports[_0xf8bd('0x1d')]=function(_0xe20d3c){return request('ShowSound',{'options':{'where':{'id':_0xe20d3c},'attributes':[_0xf8bd('0x1e')]}});};exports['getIntervalById']=function(_0x30d533){return request(_0xf8bd('0x1f'),{'options':{'raw':![],'where':{'id':_0x30d533},'include':[{'model':'Interval','as':_0xf8bd('0x20')}]}});};exports[_0xf8bd('0x21')]=function(_0x4c575f){return request('ShowSmsAccount',{'options':{'where':{'id':_0x4c575f},'attributes':['id',_0xf8bd('0xa')]}});};exports[_0xf8bd('0x22')]=function(_0x4edd5a){return request(_0xf8bd('0x23'),{'body':_0x4edd5a});};exports['createSquareDetailsReport']=function(_0x36abba){return request(_0xf8bd('0x24'),{'body':_0x36abba});};exports['createSquareReport']=function(_0xd96e62){return request('CreateSquareReport',{'body':_[_0xf8bd('0x25')](_0xd96e62,{'project_name':_0xd96e62['arg_1'],'prev_project_name':_0xd96e62[_0xf8bd('0x26')]||'','is_subproject':_0xd96e62['arg_2']?!![]:![],'leaveAt':moment()[_0xf8bd('0x27')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x329a09){return request('CreateSquareRecording',{'body':_0x329a09});};exports[_0xf8bd('0x28')]=function(_0x27baa0){return request(_0xf8bd('0x29'),{'body':_0x27baa0});};exports['createCmContact']=function(_0x258d09){return request(_0xf8bd('0x2a'),{'options':{'raw':![],'where':{'phone':_0x258d09[_0xf8bd('0x1a')],'ListId':_0x258d09[_0xf8bd('0x2b')]}}})['then'](function(_0x4bff64){if(_0x4bff64){return _0x4bff64;}return request(_0xf8bd('0x2c'),{'body':_0x258d09});});};exports['getPauseById']=function(_0x4c386a){return request('ShowPause',{'options':{'where':{'id':_0x4c386a},'attributes':['name']}});};exports[_0xf8bd('0x2d')]=function(_0x1f9cba,_0x578969){return request(_0xf8bd('0x2e'),{'body':{'interface':_0x578969},'options':{'where':_0x1f9cba}});};exports[_0xf8bd('0x2f')]=function(_0x4f19f0,_0x588b4c,_0xa1e73c){return request('PauseUser',{'body':{'type':_0x588b4c,'uniqueid':_0xa1e73c},'options':{'where':_0x4f19f0}});};exports[_0xf8bd('0x30')]=function(_0x3bc9ed){return request(_0xf8bd('0x31'),{'body':{},'options':{'where':_0x3bc9ed}});};exports[_0xf8bd('0x32')]=function(_0x35cb0a){return request(_0xf8bd('0x33'),{'body':{},'options':{'where':_0x35cb0a}});}; \ 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 ad1ea20..050bf21 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 _0x960c=['exports','./polly'];(function(_0x537c0c,_0x2b0e0c){var _0x38393c=function(_0x15842c){while(--_0x15842c){_0x537c0c['push'](_0x537c0c['shift']());}};_0x38393c(++_0x2b0e0c);}(_0x960c,0x113));var _0xc960=function(_0x121dc0,_0x366e53){_0x121dc0=_0x121dc0-0x0;var _0x369c71=_0x960c[_0x121dc0];return _0x369c71;};var polly=require(_0xc960('0x0'));var lex=require('./lex');module[_0xc960('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0b78=['./lex','exports'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0x0b78,0x1d6));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};var polly=require('./polly');var lex=require(_0x80b7('0x0'));module[_0x80b7('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 6ee013d..abcbc85 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 _0x2750=['./lib/api'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x2750,0x13b));var _0x0275=function(_0xb0b089,_0x5a49ab){_0xb0b089=_0xb0b089-0x0;var _0x52a587=_0x2750[_0xb0b089];return _0x52a587;};'use strict';var lex=require(_0x0275('0x0'));module['exports']=function(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06){return lex(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x1ffbbf,_0x18bf2d,_0x26844b,_0x1ba0bb,_0x455700,_0x2ad237){return lex(_0x1ffbbf,_0x18bf2d,_0x26844b,_0x1ba0bb,_0x455700,_0x2ad237);}; \ 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 2c6873d..9c1f80c 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(_0x670360,_0x363c37){var _0xc1d6f3=function(_0x4763ea){while(--_0x4763ea){_0x670360['push'](_0x670360['shift']());}};_0xc1d6f3(++_0x363c37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x41044b,_0x3aee60){var _0x4d055f=function(_0x55d122){while(--_0x55d122){_0x41044b['push'](_0x41044b['shift']());}};_0x4d055f(++_0x3aee60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 e8d0f9e..c06d8bd 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 _0x97d8=['./lib/api','exports'];(function(_0x4a2848,_0x1766c7){var _0x2c8dc1=function(_0x2be136){while(--_0x2be136){_0x4a2848['push'](_0x4a2848['shift']());}};_0x2c8dc1(++_0x1766c7);}(_0x97d8,0x16e));var _0x897d=function(_0x2e91eb,_0x29a979){_0x2e91eb=_0x2e91eb-0x0;var _0x1c0adc=_0x97d8[_0x2e91eb];return _0x1c0adc;};'use strict';var polly=require(_0x897d('0x0'));module[_0x897d('0x1')]=function(_0xeccdfc,_0x51ee7c,_0x3bd94f,_0x59cd2c,_0x18f344,_0x3b3b68,_0xdd8894){return polly(_0xeccdfc,_0x51ee7c,_0x3bd94f,_0x59cd2c,_0x18f344,_0x3b3b68,_0xdd8894);}; \ No newline at end of file +var _0xdcf2=['./lib/api','exports'];(function(_0x14dde8,_0x102ca4){var _0xa71d08=function(_0x2f7f36){while(--_0x2f7f36){_0x14dde8['push'](_0x14dde8['shift']());}};_0xa71d08(++_0x102ca4);}(_0xdcf2,0x108));var _0x2dcf=function(_0x41936a,_0x26e929){_0x41936a=_0x41936a-0x0;var _0x212240=_0xdcf2[_0x41936a];return _0x212240;};'use strict';var polly=require(_0x2dcf('0x0'));module[_0x2dcf('0x1')]=function(_0x2abff6,_0x1a2500,_0x285c8f,_0x383f88,_0x3a9cb8,_0x1b1775,_0x2faf7a){return polly(_0x2abff6,_0x1a2500,_0x285c8f,_0x383f88,_0x3a9cb8,_0x1b1775,_0x2faf7a);}; \ 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 53546e6..f5c1244 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 _0x8261=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0xdce534,_0x1444ac){var _0x56cad8=function(_0x372993){while(--_0x372993){_0xdce534['push'](_0xdce534['shift']());}};_0x56cad8(++_0x1444ac);}(_0x8261,0x1ee));var _0x1826=function(_0x1937b9,_0xba0099){_0x1937b9=_0x1937b9-0x0;var _0x513ec8=_0x8261[_0x1937b9];return _0x513ec8;};'use strict';var fs=require('fs');var path=require(_0x1826('0x0'));var BPromise=require(_0x1826('0x1'));var rs=require('randomstring');var AWS=require(_0x1826('0x2'));function pollyResult(_0x19aaaa,_0xb51b4f,_0x4c1f22){return new BPromise(function(_0x55ed67,_0x33c8b2){_0x19aaaa[_0x1826('0x3')](_0xb51b4f,function(_0x471380,_0x2509f9){if(_0x471380){_0x33c8b2(_0x471380);}else if(_0x2509f9){if(_0x2509f9[_0x1826('0x4')]instanceof Buffer){fs[_0x1826('0x5')](_0x4c1f22,_0x2509f9[_0x1826('0x4')],function(_0x13f653){if(_0x13f653){_0x33c8b2(_0x13f653);}else{_0x55ed67();}});}else{_0x33c8b2(new Error(_0x1826('0x6')));}}else{_0x33c8b2(new Error(_0x1826('0x7')));}});});}module['exports']=function(_0x1a1145,_0x40bb2e,_0x3068d6,_0x494e70,_0x733158,_0x5dedff,_0x9eb2b5){var _0x78ca8=new AWS[(_0x1826('0x8'))]({'accessKeyId':_0x1a1145,'secretAccessKey':_0x40bb2e,'region':_0x3068d6});var _0x549722={'Text':_0x733158,'TextType':_0x5dedff||_0x1826('0x9'),'OutputFormat':'mp3','VoiceId':_0x494e70};return pollyResult(_0x78ca8,_0x549722,_0x9eb2b5);}; \ No newline at end of file +var _0x1160=['mp3','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','writeFile','exports','text'];(function(_0x957a2e,_0x460342){var _0x53952f=function(_0x6f355e){while(--_0x6f355e){_0x957a2e['push'](_0x957a2e['shift']());}};_0x53952f(++_0x460342);}(_0x1160,0x19f));var _0x0116=function(_0x13b3b5,_0x52d8d8){_0x13b3b5=_0x13b3b5-0x0;var _0x337cd0=_0x1160[_0x13b3b5];return _0x337cd0;};'use strict';var fs=require('fs');var path=require(_0x0116('0x0'));var BPromise=require(_0x0116('0x1'));var rs=require('randomstring');var AWS=require(_0x0116('0x2'));function pollyResult(_0x1137c8,_0x186d71,_0x678f19){return new BPromise(function(_0x2a5cc4,_0x5c6de6){_0x1137c8[_0x0116('0x3')](_0x186d71,function(_0x119fd9,_0xde3bb5){if(_0x119fd9){_0x5c6de6(_0x119fd9);}else if(_0xde3bb5){if(_0xde3bb5[_0x0116('0x4')]instanceof Buffer){fs[_0x0116('0x5')](_0x678f19,_0xde3bb5[_0x0116('0x4')],function(_0x226b05){if(_0x226b05){_0x5c6de6(_0x226b05);}else{_0x2a5cc4();}});}else{_0x5c6de6(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x5c6de6(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x0116('0x6')]=function(_0x46a58d,_0x504267,_0x2ec9ed,_0x1e45ef,_0x51f08f,_0x2a3475,_0x30b247){var _0x5eb773=new AWS['Polly']({'accessKeyId':_0x46a58d,'secretAccessKey':_0x504267,'region':_0x2ec9ed});var _0x458b3d={'Text':_0x51f08f,'TextType':_0x2a3475||_0x0116('0x7'),'OutputFormat':_0x0116('0x8'),'VoiceId':_0x1e45ef};return pollyResult(_0x5eb773,_0x458b3d,_0x30b247);}; \ 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 7b0b6c0..0f0bfce 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 _0x2dc7=['./lib/api','exports'];(function(_0x31f2d6,_0x580523){var _0xa984d9=function(_0x4d7f0f){while(--_0x4d7f0f){_0x31f2d6['push'](_0x31f2d6['shift']());}};_0xa984d9(++_0x580523);}(_0x2dc7,0x14e));var _0x72dc=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x2dc7[_0x5f309e];return _0x487b5e;};'use strict';var asr=require(_0x72dc('0x0'));module[_0x72dc('0x1')]=function(_0x3f83f5,_0xe9de4e,_0x4a0f44,_0x41f123){return asr(_0x3f83f5,_0xe9de4e,_0x4a0f44);}; \ No newline at end of file +var _0x59ef=['./lib/api','exports'];(function(_0x570dba,_0x2000b9){var _0x5a951e=function(_0x207f46){while(--_0x207f46){_0x570dba['push'](_0x570dba['shift']());}};_0x5a951e(++_0x2000b9);}(_0x59ef,0x13e));var _0xf59e=function(_0x3afdfa,_0x236c0a){_0x3afdfa=_0x3afdfa-0x0;var _0x53fd42=_0x59ef[_0x3afdfa];return _0x53fd42;};'use strict';var asr=require(_0xf59e('0x0'));module[_0xf59e('0x1')]=function(_0x2ac44c,_0x5821ba,_0x510520,_0x394299){return asr(_0x2ac44c,_0x5821ba,_0x510520);}; \ 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 d1e2fb5..a01f93b 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 _0x1bca=['bluebird','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0x3e07b7,_0x423bb4){var _0x119669=function(_0x193e13){while(--_0x193e13){_0x3e07b7['push'](_0x3e07b7['shift']());}};_0x119669(++_0x423bb4);}(_0x1bca,0xb6));var _0xa1bc=function(_0x1f3e5a,_0xdfae3c){_0x1f3e5a=_0x1f3e5a-0x0;var _0xd5e7dc=_0x1bca[_0x1f3e5a];return _0xd5e7dc;};'use strict';var url=require('url');var BPromise=require(_0xa1bc('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x84fe95,_0x4feb3b,_0x1865b2){return new BPromise(function(_0x1fa3d2,_0x3469ad){var _0x543df3;if(typeof _0x84fe95!==_0xa1bc('0x1')||_0x84fe95[_0xa1bc('0x2')]===0x0){return _0x3469ad(_0xa1bc('0x3'));}if(typeof _0x4feb3b!==_0xa1bc('0x1')||_0x4feb3b['length']===0x0){return _0x3469ad(_0xa1bc('0x4'));}if(typeof _0x1865b2!==_0xa1bc('0x5')&&(typeof _0x1865b2!==_0xa1bc('0x1')||_0x1865b2[_0xa1bc('0x2')]===0x0)){return _0x3469ad(_0xa1bc('0x6'));}try{_0x543df3=fs[_0xa1bc('0x7')](_0x84fe95)[_0xa1bc('0x8')]('base64');}catch(_0x1b826d){return _0x3469ad(_0x1b826d);}return _0x1fa3d2({'method':_0xa1bc('0x9'),'uri':host+_0xa1bc('0xa')+_0x4feb3b,'body':{'config':{'encoding':_0xa1bc('0xb'),'sampleRateHertz':_0xa1bc('0xc'),'languageCode':_0x1865b2},'audio':{'content':_0x543df3}},'json':!![]});});}; \ No newline at end of file +var _0xf46a=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','POST','/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','exports','string'];(function(_0x12936c,_0x2cce41){var _0x1c2c39=function(_0x5ac22d){while(--_0x5ac22d){_0x12936c['push'](_0x12936c['shift']());}};_0x1c2c39(++_0x2cce41);}(_0xf46a,0xa4));var _0xaf46=function(_0x1854ca,_0x4ed66d){_0x1854ca=_0x1854ca-0x0;var _0x4ac9c6=_0xf46a[_0x1854ca];return _0x4ac9c6;};'use strict';var url=require(_0xaf46('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xaf46('0x1');module[_0xaf46('0x2')]=function(_0x571132,_0xf4ff9e,_0x3a7936){return new BPromise(function(_0x53059e,_0x14a6b6){var _0x34c69d;if(typeof _0x571132!==_0xaf46('0x3')||_0x571132[_0xaf46('0x4')]===0x0){return _0x14a6b6(_0xaf46('0x5'));}if(typeof _0xf4ff9e!==_0xaf46('0x3')||_0xf4ff9e[_0xaf46('0x4')]===0x0){return _0x14a6b6(_0xaf46('0x6'));}if(typeof _0x3a7936!==_0xaf46('0x7')&&(typeof _0x3a7936!==_0xaf46('0x3')||_0x3a7936[_0xaf46('0x4')]===0x0)){return _0x14a6b6('lang\x20should\x20be\x20a\x20string');}try{_0x34c69d=fs[_0xaf46('0x8')](_0x571132)['toString']('base64');}catch(_0x51f679){return _0x14a6b6(_0x51f679);}return _0x53059e({'method':_0xaf46('0x9'),'uri':host+_0xaf46('0xa')+_0xf4ff9e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xaf46('0xb'),'languageCode':_0x3a7936},'audio':{'content':_0x34c69d}},'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 8e48ce1..9077c62 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 _0xdd4f=['./asr','exports'];(function(_0x254456,_0x3c0f14){var _0x1b4926=function(_0x1067a0){while(--_0x1067a0){_0x254456['push'](_0x254456['shift']());}};_0x1b4926(++_0x3c0f14);}(_0xdd4f,0xc4));var _0xfdd4=function(_0x10af84,_0x19684f){_0x10af84=_0x10af84-0x0;var _0x4539d7=_0xdd4f[_0x10af84];return _0x4539d7;};var asr=require(_0xfdd4('0x0'));module[_0xfdd4('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2adc=['./asr','exports'];(function(_0x4627ff,_0x596184){var _0x3f4e1=function(_0x536bbc){while(--_0x536bbc){_0x4627ff['push'](_0x4627ff['shift']());}};_0x3f4e1(++_0x596184);}(_0x2adc,0x1e6));var _0xc2ad=function(_0xa2d866,_0x4ccad3){_0xa2d866=_0xa2d866-0x0;var _0x52bf60=_0x2adc[_0xa2d866];return _0x52bf60;};var asr=require(_0xc2ad('0x0'));module[_0xc2ad('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 eca7f8b..2d281a9 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 _0x9e83=['action','actionIncomplete','speech','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','protocol','https:','host','WHAT_EVER','get','error','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','download\x20error','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','utf8','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','resolvedQuery'];(function(_0x46807d,_0x209920){var _0x189ec5=function(_0x436943){while(--_0x436943){_0x46807d['push'](_0x46807d['shift']());}};_0x189ec5(++_0x209920);}(_0x9e83,0x1c3));var _0x39e8=function(_0x4dd325,_0x3e8f8d){_0x4dd325=_0x4dd325-0x0;var _0x43309e=_0x9e83[_0x4dd325];return _0x43309e;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x39e8('0x0'));var dialogflow=require(_0x39e8('0x1'));var fs=require('fs');var http=require(_0x39e8('0x2'));var https=require(_0x39e8('0x3'));var md5=require(_0x39e8('0x4'));var path=require(_0x39e8('0x5'));var querystring=require(_0x39e8('0x6'));var rp=require(_0x39e8('0x7'));var rs=require('randomstring');var sox=require('sox');var tts=require(_0x39e8('0x8'));var urlParse=require(_0x39e8('0x9'))[_0x39e8('0xa')];var util=require('util');var aws=require(_0x39e8('0xb'));var google=require(_0x39e8('0xc'));var sestek=require(_0x39e8('0xd'));var tilde=require(_0x39e8('0xe'));var logger=require('../../../config/logger')('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x3c6609,_0x40e7a2){return new BPromise(function(_0x45a16f,_0x28875d){var _0x1c01a2=urlParse(_0x3c6609);var _0x4af755=_0x1c01a2[_0x39e8('0xf')]===_0x39e8('0x10')?https:http;var _0x2a41c8={'host':_0x1c01a2[_0x39e8('0x11')],'path':_0x1c01a2[_0x39e8('0x5')],'headers':{'user-agent':_0x39e8('0x12')}};_0x4af755[_0x39e8('0x13')](_0x2a41c8,function(_0x5ede40){if(_0x5ede40['statusCode']!==0xc8){logger[_0x39e8('0x14')]('request\x20to\x20'+_0x3c6609+'\x20failed,\x20status\x20code\x20=\x20'+_0x5ede40[_0x39e8('0x15')]+'\x20('+_0x5ede40['statusMessage']+')');_0x28875d(new Error(_0x39e8('0x16')+_0x3c6609+_0x39e8('0x17')+_0x5ede40[_0x39e8('0x15')]+'\x20('+_0x5ede40[_0x39e8('0x18')]+')'));return;}var _0x528e9a=fs[_0x39e8('0x19')](_0x40e7a2);_0x528e9a['on'](_0x39e8('0x1a'),function(){logger[_0x39e8('0x1b')](_0x39e8('0x1c'));_0x528e9a['close'](_0x45a16f);});_0x528e9a['on']('error',function(_0x156bf0){fs['unlink'](_0x40e7a2);logger['error'](_0x39e8('0x1d'),_0x156bf0);_0x28875d(_0x156bf0);});_0x5ede40['pipe'](_0x528e9a);})['on']('error',function(_0x2c8321){logger['error'](_0x2c8321);_0x28875d(_0x2c8321);})[_0x39e8('0x1e')]();});}function uploadFile(_0xc3b30a){return new BPromise(function(_0x2850b0,_0x3b9c46){var _0x373b21=urlParse(_0xc3b30a);var _0x190576=_0x373b21['protocol']===_0x39e8('0x10')?https:http;var _0x548973={'host':_0x373b21[_0x39e8('0x11')],'path':_0x373b21['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x190576[_0x39e8('0x13')](_0x548973,function(_0x9caeac){if(_0x9caeac[_0x39e8('0x15')]!==0xc8){_0x3b9c46(new Error(_0x39e8('0x16')+_0xc3b30a+'\x20failed,\x20status\x20code\x20=\x20'+_0x9caeac[_0x39e8('0x15')]+'\x20('+_0x9caeac['statusMessage']+')'));return;}var _0x152c71='';_0x9caeac['on'](_0x39e8('0x1f'),function(_0x3b8d07){_0x152c71+=_0x3b8d07;});_0x9caeac['on'](_0x39e8('0x1e'),function(){_0x2850b0(_0x152c71);});})['on'](_0x39e8('0x14'),function(_0x31208f){_0x3b9c46(_0x31208f);})[_0x39e8('0x1e')]();});}function convertFile(_0x2e9a96,_0x3ed846){return new BPromise(function(_0x2551a5,_0x241bf2){var _0x425257=sox[_0x39e8('0x20')](_0x2e9a96,_0x3ed846,{'sampleRate':0x1f40,'format':_0x39e8('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x425257['on'](_0x39e8('0x14'),function(_0x4c787f){logger['error'](_0x39e8('0x22'),_0x4c787f);_0x241bf2(_0x4c787f);});_0x425257['on'](_0x39e8('0x1e'),function(){logger[_0x39e8('0x1b')](_0x39e8('0x23'));_0x2551a5();});_0x425257[_0x39e8('0x24')]();});}function base64Decode(_0x59844f,_0x344d1a){var _0x5cca21=path[_0x39e8('0x25')](__dirname,_0x39e8('0x26'),rs[_0x39e8('0x27')](0x4)+_0x39e8('0x28'));fs[_0x39e8('0x29')](_0x5cca21,_0x59844f,_0x39e8('0x2a'));return convertFile(_0x5cca21,_0x344d1a)[_0x39e8('0x2b')](function(){try{fs[_0x39e8('0x2c')](_0x5cca21);fs[_0x39e8('0x2d')](_0x344d1a,_0x39e8('0x2e'));}catch(_0x1cd670){logger[_0x39e8('0x14')](_0x1cd670);}return _0x344d1a[_0x39e8('0x2f')]('.')[0x0];});}function base64Encode(_0x45c6d0){var _0x536cc3=fs['readFileSync'](_0x45c6d0);return new Buffer(_0x536cc3)[_0x39e8('0x30')](_0x39e8('0x2a'));}exports[_0x39e8('0x31')]=function(_0x12d5b5,_0x54996d,_0x423b83,_0x560d09,_0x550173,_0x866c16){var _0x14ac56,_0x3f5f75;var _0x2bffd7=_0x39e8('0x32');var _0x14502e=_0x39e8('0x33')+_0x12d5b5;var _0x13e932={};if(_0x54996d===_0x39e8('0x34')){_0x13e932['input']={'ssml':_0x423b83};}else{_0x13e932[_0x39e8('0x35')]={'text':_0x423b83};};_0x13e932[_0x39e8('0x36')]={'languageCode':_0x560d09,'ssmlGender':_0x550173};_0x13e932[_0x39e8('0x37')]={'audioEncoding':_0x39e8('0x38'),'sampleRateHertz':0x1f40};var _0x4740d3={'url':_0x2bffd7+_0x39e8('0x39')+_0x14502e,'method':_0x39e8('0x3a'),'json':!![],'body':_0x13e932};return rp(_0x4740d3)[_0x39e8('0x2b')](function(_0x237d32){return new BPromise(function(_0x1ec09a,_0x349e13){_0x14ac56=path['resolve'](__dirname,_0x39e8('0x26'),rs['generate'](0x4)+_0x39e8('0x3b'));var _0x3733e5=Buffer[_0x39e8('0x3c')](_0x237d32[_0x39e8('0x3d')],_0x39e8('0x2a'));return fs[_0x39e8('0x3e')](_0x14ac56,_0x3733e5,function(_0xda15a3){_0x349e13(_0xda15a3);},function(_0x5ce4c6){fs[_0x39e8('0x2d')](_0x14ac56,'777');_0x1ec09a(_0x5ce4c6);});});})[_0x39e8('0x2b')](function(_0xe94fd8){_0x3f5f75=path[_0x39e8('0x25')](__dirname,_0x39e8('0x26'),rs[_0x39e8('0x27')](0x4)+_0x39e8('0x28'));return convertFile(_0x14ac56,_0x3f5f75);})[_0x39e8('0x2b')](function(){try{fs[_0x39e8('0x2c')](_0x14ac56);fs[_0x39e8('0x2d')](_0x3f5f75,_0x39e8('0x2e'));}catch(_0x12dc1f){logger[_0x39e8('0x14')](_0x12dc1f);}logger[_0x39e8('0x1b')](_0x39e8('0x3f'),_0x3f5f75['split']('.')[0x0]);return _0x3f5f75[_0x39e8('0x2f')]('.')[0x0];});};exports['googleTTS']=function(_0x24a456,_0x122a36){var _0x40d641='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x2fb730,_0x27c107;var _0x547789;var _0x15e3b4={'encoding':_0x39e8('0x40'),'method':'POST','timeout':0x2710,'url':_0x40d641,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x39e8('0x41')+encodeURIComponent(JSON[_0x39e8('0x42')]([[[_0x39e8('0x43'),JSON[_0x39e8('0x42')]([_0x24a456,_0x122a36||'en',![],_0x39e8('0x44')]),null,_0x39e8('0x45')]]]))};return rp(_0x15e3b4)[_0x39e8('0x2b')](function(_0x32f50f){try{_0x547789=eval(_0x32f50f[_0x39e8('0x46')](0x5))[0x0][0x2];}catch(_0x219c4b){throw new Error(_0x39e8('0x47')+_0x32f50f[_0x39e8('0x1f')]);}if(!_0x547789){if(_0x24a456[_0x39e8('0x48')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x39e8('0x49')+_0x122a36+'\x22\x20might\x20not\x20exist');}}try{_0x547789=eval(_0x547789)[0x0];}catch(_0x296ab8){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x39e8('0x1f')]);}const _0x2d5b45=_0x547789;_0x2fb730=path[_0x39e8('0x25')](__dirname,_0x39e8('0x26'),rs[_0x39e8('0x27')](0x4)+_0x39e8('0x3b'));fs[_0x39e8('0x29')](_0x2fb730,_0x547789,{'encoding':_0x39e8('0x2a')});_0x27c107=path['resolve'](__dirname,_0x39e8('0x26'),rs[_0x39e8('0x27')](0x4)+_0x39e8('0x28'));return convertFile(_0x2fb730,_0x27c107);})[_0x39e8('0x2b')](function(){try{fs[_0x39e8('0x2c')](_0x2fb730);fs['chmodSync'](_0x27c107,_0x39e8('0x2e'));}catch(_0x481173){logger['error'](_0x481173);}logger[_0x39e8('0x1b')](_0x39e8('0x4a'),_0x27c107[_0x39e8('0x2f')]('.')[0x0]);return _0x27c107['split']('.')[0x0];});};exports[_0x39e8('0x4b')]=function(_0x216041,_0x9d49ea,_0x4fec28){return google[_0x39e8('0x4c')](_0x216041,_0x9d49ea,_0x4fec28)[_0x39e8('0x2b')](function(_0x4f9c2c){logger[_0x39e8('0x1b')](_0x4f9c2c[_0x39e8('0x4d')]);return rp(_0x4f9c2c);})[_0x39e8('0x2b')](function(_0x18bb8d){var _0x1fed77='';var _0x3aec4f=0x0;try{fs[_0x39e8('0x2c')](_0x216041);}catch(_0x10071b){logger['error'](_0x10071b);}if(_0x18bb8d&&_0x18bb8d['results']){_0x1fed77=_0x18bb8d[_0x39e8('0x4e')][_0x39e8('0x4f')](function(_0xf553b6){return _0xf553b6&&_0xf553b6[_0x39e8('0x50')][0x0]&&_0xf553b6[_0x39e8('0x50')][0x0][_0x39e8('0x51')]?_0xf553b6[_0x39e8('0x50')][0x0][_0x39e8('0x51')]:'';})[_0x39e8('0x52')]('\x0a');_0x3aec4f=_0x18bb8d['results'][_0x39e8('0x4f')](function(_0xaf471a){return _0xaf471a&&_0xaf471a['alternatives'][0x0]&&_0xaf471a['alternatives'][0x0]['confidence']?_0xaf471a[_0x39e8('0x50')][0x0][_0x39e8('0x53')]:0x0;})[_0x39e8('0x52')]('\x0a');}logger[_0x39e8('0x1b')](_0x39e8('0x54'),_0x1fed77);logger[_0x39e8('0x1b')](_0x39e8('0x55'),_0x3aec4f);return{'transcript':_0x1fed77,'confidence':_0x3aec4f};})[_0x39e8('0x56')](function(_0x5bcdd8){logger[_0x39e8('0x14')](_0x39e8('0x57'),_0x5bcdd8[_0x39e8('0x15')],_0x5bcdd8[_0x39e8('0x58')],_0x5bcdd8['message']);});};exports[_0x39e8('0x59')]=function(_0x100cc8,_0x104760,_0x496619,_0xb3e55e){var _0x1f4398=apiai(_0x104760,{'language':_0xb3e55e||'en'});return _0x1f4398[_0x39e8('0x5a')](_0x496619,{'sessionId':md5(_0x100cc8)})[_0x39e8('0x2b')](function(_0x1bde3d){logger[_0x39e8('0x1b')](JSON[_0x39e8('0x42')](_0x1bde3d));return{'source':_0x1bde3d[_0x39e8('0x5b')]['source'],'resolvedQuery':_0x1bde3d[_0x39e8('0x5b')][_0x39e8('0x5c')],'action':_0x1bde3d[_0x39e8('0x5b')][_0x39e8('0x5d')],'actionIncomplete':_0x1bde3d[_0x39e8('0x5b')][_0x39e8('0x5e')],'speech':_0x1bde3d[_0x39e8('0x5b')]['fulfillment'][_0x39e8('0x5f')],'score':_0x1bde3d['result']['score'],'statusCode':_0x1bde3d['status'][_0x39e8('0x60')],'endConversation':_0x1bde3d[_0x39e8('0x5b')][_0x39e8('0x61')]['endConversation']||![],'isFallbackIntent':_0x1bde3d['result'][_0x39e8('0x61')][_0x39e8('0x62')]};});};exports[_0x39e8('0x63')]=function(_0x5c6650,_0x45c0eb,_0x24a2d1,_0x1ae6dd,_0x288e45,_0x2fe4ac){var _0x7554e2=_0x1ae6dd[_0x39e8('0x64')](/\\n/g,'\x0a');var _0x4f1058={'credentials':{'private_key':_0x7554e2,'client_email':_0x24a2d1}};var _0x21d26c=new dialogflow[(_0x39e8('0x65'))](_0x4f1058);var _0x2b4479=_0x21d26c['sessionPath'](_0x45c0eb,md5(_0x5c6650));var _0x45a192={'session':_0x2b4479,'queryInput':{'text':{'text':_0x288e45,'languageCode':_0x2fe4ac}}};return _0x21d26c['detectIntent'](_0x45a192)[_0x39e8('0x2b')](function(_0x52cbc7){if(_0x52cbc7&&_0x52cbc7['length']){logger[_0x39e8('0x1b')](_0x39e8('0x66'),JSON[_0x39e8('0x42')](_0x52cbc7));var _0x27bb07=_0x52cbc7[0x0];if(_0x27bb07){var _0x9dc88f={'action':_0x27bb07[_0x39e8('0x67')]['action'],'allRequiredParamsPresent':_0x27bb07[_0x39e8('0x67')][_0x39e8('0x68')],'endConversation':_0x27bb07['queryResult']['diagnosticInfo']&&_0x27bb07[_0x39e8('0x67')][_0x39e8('0x69')][_0x39e8('0x6a')]?_0x27bb07[_0x39e8('0x67')]['diagnosticInfo'][_0x39e8('0x6a')]['end_conversation'][_0x39e8('0x6b')]:![],'fulfillmentText':_0x27bb07[_0x39e8('0x67')][_0x39e8('0x6c')],'intentName':_0x27bb07[_0x39e8('0x67')][_0x39e8('0x6d')][_0x39e8('0x58')],'intentDisplayName':_0x27bb07[_0x39e8('0x67')][_0x39e8('0x6d')][_0x39e8('0x6e')],'isFallbackIntent':_0x27bb07[_0x39e8('0x67')]['intent'][_0x39e8('0x6f')],'languageCode':_0x27bb07[_0x39e8('0x67')][_0x39e8('0x70')],'queryText':_0x27bb07[_0x39e8('0x67')][_0x39e8('0x71')],'responseId':_0x27bb07[_0x39e8('0x72')],'score':_0x27bb07['queryResult'][_0x39e8('0x73')],'speech':_0x27bb07['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x39e8('0x42')](_0x52cbc7)};return _0x9dc88f;}}});};exports[_0x39e8('0x74')]=function(_0x4ad2ec,_0x3dd8c3,_0x248072,_0x33cde2){return tilde[_0x39e8('0x4c')](_0x4ad2ec,_0x3dd8c3,_0x248072,_0x33cde2)['then'](function(_0x1abbc9){try{fs[_0x39e8('0x2c')](_0x4ad2ec);}catch(_0x4c54b8){logger[_0x39e8('0x14')](_0x4c54b8);}logger[_0x39e8('0x1b')](_0x39e8('0x75'),_0x1abbc9['transcript']);logger[_0x39e8('0x1b')]('Tilde\x20ASR\x20confidence',_0x1abbc9[_0x39e8('0x53')]);return _0x1abbc9;});};exports[_0x39e8('0x76')]=function(_0x5a4979,_0x26edcb,_0x57180f,_0x4402eb,_0xa82740,_0x2f1731){var _0x1594d2=path[_0x39e8('0x25')](__dirname,_0x39e8('0x26'),rs[_0x39e8('0x27')](0x4)+_0x39e8('0x3b'));var _0x1a63ca;return aws[_0x39e8('0x77')](_0x5a4979,_0x26edcb,_0x57180f,_0x4402eb,_0xa82740,_0x2f1731,_0x1594d2)[_0x39e8('0x2b')](function(){_0x1a63ca=path[_0x39e8('0x25')](__dirname,_0x39e8('0x26'),rs[_0x39e8('0x27')](0x4)+_0x39e8('0x28'));return convertFile(_0x1594d2,_0x1a63ca);})[_0x39e8('0x2b')](function(){try{fs[_0x39e8('0x2c')](_0x1594d2);fs[_0x39e8('0x2d')](_0x1a63ca,'777');}catch(_0x498476){logger[_0x39e8('0x14')](_0x498476);}return _0x1a63ca[_0x39e8('0x2f')]('.')[0x0];});};exports[_0x39e8('0x78')]=function(_0x55c4e4,_0x7a699f,_0x415063,_0x1e80d8,_0x291f51,_0x57a5a3){return aws[_0x39e8('0x79')](_0x55c4e4,_0x7a699f,_0x415063,_0x1e80d8,_0x291f51,_0x57a5a3)[_0x39e8('0x2b')](function(_0x4490fe){logger[_0x39e8('0x1b')](JSON['stringify'](_0x4490fe));return _0x4490fe;});};exports['ispeechTTS']=function(_0x1054e3,_0x4a87f3,_0x54d122,_0x5897fe){var _0xb9e7a0=util[_0x39e8('0x7a')](_0x39e8('0x7b'),ISPEECH_API,_0x1054e3,encodeURIComponent(_0x4a87f3),_0x54d122,_0x5897fe);var _0x3ca3ce=path['resolve'](__dirname,_0x39e8('0x26'),rs[_0x39e8('0x27')](0x4)+_0x39e8('0x3b'));var _0xeee97e;return downloadFile(_0xb9e7a0,_0x3ca3ce)[_0x39e8('0x2b')](function(){_0xeee97e=path[_0x39e8('0x25')](__dirname,'tmp',rs[_0x39e8('0x27')](0x4)+_0x39e8('0x28'));return convertFile(_0x3ca3ce,_0xeee97e);})[_0x39e8('0x2b')](function(){try{fs[_0x39e8('0x2c')](_0x3ca3ce);fs[_0x39e8('0x2d')](_0xeee97e,'777');}catch(_0x4b4dd1){logger[_0x39e8('0x14')](_0x4b4dd1);}return _0xeee97e['split']('.')[0x0];});};exports[_0x39e8('0x7c')]=function(_0x3034e3,_0x16b561,_0x1af838,_0x349035){var _0x306de2=util[_0x39e8('0x7a')](_0x39e8('0x7d'),ISPEECH_API,_0x16b561,_0x1af838,base64Encode(_0x3034e3),_0x349035?util[_0x39e8('0x7a')](_0x39e8('0x7e'),encodeURIComponent(_0x349035)):_0x39e8('0x7f'));return uploadFile(_0x306de2)[_0x39e8('0x2b')](function(_0x5b4278){return querystring[_0x39e8('0xa')](_0x5b4278);});};exports[_0x39e8('0x80')]=function(_0x3de033,_0x1e9392){return sestek['nda'](_0x3de033,_0x1e9392)[_0x39e8('0x2b')](function(_0x2bb7b9){logger[_0x39e8('0x1b')](JSON['stringify'](_0x2bb7b9));var _0x25c948={'speech':_0x2bb7b9[_0x39e8('0x81')],'action':_0x2bb7b9[_0x39e8('0x82')]?_0x2bb7b9['channelData'][_0x39e8('0x83')]:undefined,'actiondata':_0x2bb7b9[_0x39e8('0x82')]?_0x2bb7b9[_0x39e8('0x82')][_0x39e8('0x84')]:undefined};if(_0x2bb7b9[_0x39e8('0x82')]&&_0x2bb7b9[_0x39e8('0x82')][_0x39e8('0x85')]){return base64Decode(_0x2bb7b9['channelData'][_0x39e8('0x85')]['Data'],path['resolve'](__dirname,_0x39e8('0x26'),rs[_0x39e8('0x27')](0x4)+_0x39e8('0x28')))[_0x39e8('0x2b')](function(_0x31f7b8){_0x25c948[_0x39e8('0x86')]=_0x31f7b8;return _0x25c948;});}return _0x25c948;});};exports[_0x39e8('0x87')]=function(){return __dirname;}; \ No newline at end of file +var _0xe7e2=['parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','goggleTTS\x20path','googleASR','asr','uri','map','alternatives','transcript','join','results','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','http','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','info','finish\x20download\x20file','close','pipe','end','host','WHAT_EVER','finish\x20to\x20convert','tmp','generate','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','voice','audioConfig','MP3','POST','.mp3','from','resolve','.wav','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','generic'];(function(_0x3fe14d,_0x275879){var _0x439108=function(_0x397562){while(--_0x397562){_0x3fe14d['push'](_0x3fe14d['shift']());}};_0x439108(++_0x275879);}(_0xe7e2,0x1bc));var _0x2e7e=function(_0x19bb66,_0xc32ae6){_0x19bb66=_0x19bb66-0x0;var _0x137057=_0xe7e2[_0x19bb66];return _0x137057;};'use strict';var apiai=require(_0x2e7e('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x2e7e('0x1'));var https=require(_0x2e7e('0x2'));var md5=require(_0x2e7e('0x3'));var path=require(_0x2e7e('0x4'));var querystring=require(_0x2e7e('0x5'));var rp=require(_0x2e7e('0x6'));var rs=require(_0x2e7e('0x7'));var sox=require(_0x2e7e('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x2e7e('0x9'))[_0x2e7e('0xa')];var util=require(_0x2e7e('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x2e7e('0xc'));var tilde=require(_0x2e7e('0xd'));var logger=require(_0x2e7e('0xe'))(_0x2e7e('0xf'));var ISPEECH_API=_0x2e7e('0x10');function downloadFile(_0x852feb,_0x508b6){return new BPromise(function(_0x29e83f,_0x3e9317){var _0x3855cf=urlParse(_0x852feb);var _0x2d829a=_0x3855cf[_0x2e7e('0x11')]===_0x2e7e('0x12')?https:http;var _0xd427b4={'host':_0x3855cf['host'],'path':_0x3855cf[_0x2e7e('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x2d829a[_0x2e7e('0x13')](_0xd427b4,function(_0x1b0558){if(_0x1b0558[_0x2e7e('0x14')]!==0xc8){logger[_0x2e7e('0x15')](_0x2e7e('0x16')+_0x852feb+_0x2e7e('0x17')+_0x1b0558['statusCode']+'\x20('+_0x1b0558[_0x2e7e('0x18')]+')');_0x3e9317(new Error(_0x2e7e('0x16')+_0x852feb+_0x2e7e('0x17')+_0x1b0558[_0x2e7e('0x14')]+'\x20('+_0x1b0558[_0x2e7e('0x18')]+')'));return;}var _0x365334=fs['createWriteStream'](_0x508b6);_0x365334['on']('finish',function(){logger[_0x2e7e('0x19')](_0x2e7e('0x1a'));_0x365334[_0x2e7e('0x1b')](_0x29e83f);});_0x365334['on']('error',function(_0xa2572f){fs['unlink'](_0x508b6);logger[_0x2e7e('0x15')]('download\x20error',_0xa2572f);_0x3e9317(_0xa2572f);});_0x1b0558[_0x2e7e('0x1c')](_0x365334);})['on'](_0x2e7e('0x15'),function(_0x1b7c20){logger[_0x2e7e('0x15')](_0x1b7c20);_0x3e9317(_0x1b7c20);})[_0x2e7e('0x1d')]();});}function uploadFile(_0x391623){return new BPromise(function(_0x3a70ee,_0x363ec4){var _0x470dbf=urlParse(_0x391623);var _0x512cba=_0x470dbf[_0x2e7e('0x11')]===_0x2e7e('0x12')?https:http;var _0x13d67d={'host':_0x470dbf[_0x2e7e('0x1e')],'path':_0x470dbf[_0x2e7e('0x4')],'headers':{'user-agent':_0x2e7e('0x1f')}};_0x512cba[_0x2e7e('0x13')](_0x13d67d,function(_0x38a614){if(_0x38a614['statusCode']!==0xc8){_0x363ec4(new Error('request\x20to\x20'+_0x391623+_0x2e7e('0x17')+_0x38a614['statusCode']+'\x20('+_0x38a614[_0x2e7e('0x18')]+')'));return;}var _0x41dab6='';_0x38a614['on']('data',function(_0x309741){_0x41dab6+=_0x309741;});_0x38a614['on']('end',function(){_0x3a70ee(_0x41dab6);});})['on']('error',function(_0x3056d1){_0x363ec4(_0x3056d1);})[_0x2e7e('0x1d')]();});}function convertFile(_0x3f52e0,_0x54d4ab){return new BPromise(function(_0x345308,_0x1fd440){var _0xc11b90=sox['transcode'](_0x3f52e0,_0x54d4ab,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xc11b90['on']('error',function(_0x582b70){logger[_0x2e7e('0x15')]('error\x20convert',_0x582b70);_0x1fd440(_0x582b70);});_0xc11b90['on']('end',function(){logger[_0x2e7e('0x19')](_0x2e7e('0x20'));_0x345308();});_0xc11b90['start']();});}function base64Decode(_0x3d350e,_0x3b7a18){var _0x4c93db=path['resolve'](__dirname,_0x2e7e('0x21'),rs[_0x2e7e('0x22')](0x4)+'.wav');fs[_0x2e7e('0x23')](_0x4c93db,_0x3d350e,_0x2e7e('0x24'));return convertFile(_0x4c93db,_0x3b7a18)[_0x2e7e('0x25')](function(){try{fs[_0x2e7e('0x26')](_0x4c93db);fs[_0x2e7e('0x27')](_0x3b7a18,_0x2e7e('0x28'));}catch(_0x93c00e){logger[_0x2e7e('0x15')](_0x93c00e);}return _0x3b7a18[_0x2e7e('0x29')]('.')[0x0];});}function base64Encode(_0x9be6f4){var _0x235ba3=fs[_0x2e7e('0x2a')](_0x9be6f4);return new Buffer(_0x235ba3)[_0x2e7e('0x2b')](_0x2e7e('0x24'));}exports[_0x2e7e('0x2c')]=function(_0x10b090,_0x22a70c,_0x420fd3,_0x50fb64,_0x38a409,_0x1b203f){var _0x44a9fb,_0x47a59c;var _0x417867=_0x2e7e('0x2d');var _0x388df2='?key='+_0x10b090;var _0x5d7591={};if(_0x22a70c===_0x2e7e('0x2e')){_0x5d7591['input']={'ssml':_0x420fd3};}else{_0x5d7591['input']={'text':_0x420fd3};};_0x5d7591[_0x2e7e('0x2f')]={'languageCode':_0x50fb64,'ssmlGender':_0x38a409};_0x5d7591[_0x2e7e('0x30')]={'audioEncoding':_0x2e7e('0x31'),'sampleRateHertz':0x1f40};var _0x5df900={'url':_0x417867+'text:synthesize'+_0x388df2,'method':_0x2e7e('0x32'),'json':!![],'body':_0x5d7591};return rp(_0x5df900)['then'](function(_0x162cb5){return new BPromise(function(_0x21c0f7,_0x170e4c){_0x44a9fb=path['resolve'](__dirname,_0x2e7e('0x21'),rs[_0x2e7e('0x22')](0x4)+_0x2e7e('0x33'));var _0x384274=Buffer[_0x2e7e('0x34')](_0x162cb5['audioContent'],_0x2e7e('0x24'));return fs['writeFile'](_0x44a9fb,_0x384274,function(_0x22b1d6){_0x170e4c(_0x22b1d6);},function(_0x415db5){fs[_0x2e7e('0x27')](_0x44a9fb,'777');_0x21c0f7(_0x415db5);});});})[_0x2e7e('0x25')](function(_0x15f634){_0x47a59c=path[_0x2e7e('0x35')](__dirname,_0x2e7e('0x21'),rs[_0x2e7e('0x22')](0x4)+_0x2e7e('0x36'));return convertFile(_0x44a9fb,_0x47a59c);})[_0x2e7e('0x25')](function(){try{fs[_0x2e7e('0x26')](_0x44a9fb);fs[_0x2e7e('0x27')](_0x47a59c,_0x2e7e('0x28'));}catch(_0x345839){logger['error'](_0x345839);}logger[_0x2e7e('0x19')]('googleCloudTTS\x20path',_0x47a59c[_0x2e7e('0x29')]('.')[0x0]);return _0x47a59c['split']('.')[0x0];});};exports[_0x2e7e('0x37')]=function(_0x3e8e69,_0x25f0b7){var _0x46b2a5=_0x2e7e('0x38');var _0x3733ec,_0x176ac5;var _0xd4567c;var _0x46fbfd={'encoding':_0x2e7e('0x39'),'method':_0x2e7e('0x32'),'timeout':0x2710,'url':_0x46b2a5,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x2e7e('0x3a')]([[['jQ1olc',JSON[_0x2e7e('0x3a')]([_0x3e8e69,_0x25f0b7||'en',![],'null']),null,_0x2e7e('0x3b')]]]))};return rp(_0x46fbfd)[_0x2e7e('0x25')](function(_0x5376a0){try{_0xd4567c=eval(_0x5376a0['slice'](0x5))[0x0][0x2];}catch(_0x27e476){throw new Error(_0x2e7e('0x3c')+_0x5376a0['data']);}if(!_0xd4567c){if(_0x3e8e69['length']>0xc8){throw new Error(_0x2e7e('0x3d'));}else{throw new Error('lang\x20\x22'+_0x25f0b7+'\x22\x20might\x20not\x20exist');}}try{_0xd4567c=eval(_0xd4567c)[0x0];}catch(_0xd205b2){throw new Error(_0x2e7e('0x3c')+res['data']);}const _0x245aad=_0xd4567c;_0x3733ec=path['resolve'](__dirname,'tmp',rs[_0x2e7e('0x22')](0x4)+_0x2e7e('0x33'));fs['writeFileSync'](_0x3733ec,_0xd4567c,{'encoding':'base64'});_0x176ac5=path[_0x2e7e('0x35')](__dirname,'tmp',rs[_0x2e7e('0x22')](0x4)+_0x2e7e('0x36'));return convertFile(_0x3733ec,_0x176ac5);})['then'](function(){try{fs['unlink'](_0x3733ec);fs['chmodSync'](_0x176ac5,'777');}catch(_0x4da002){logger['error'](_0x4da002);}logger['info'](_0x2e7e('0x3e'),_0x176ac5[_0x2e7e('0x29')]('.')[0x0]);return _0x176ac5[_0x2e7e('0x29')]('.')[0x0];});};exports[_0x2e7e('0x3f')]=function(_0x8c5422,_0x3f0bfa,_0x33b513){return google[_0x2e7e('0x40')](_0x8c5422,_0x3f0bfa,_0x33b513)['then'](function(_0x59443b){logger[_0x2e7e('0x19')](_0x59443b[_0x2e7e('0x41')]);return rp(_0x59443b);})['then'](function(_0xd7de09){var _0x3eba8b='';var _0x4c7967=0x0;try{fs[_0x2e7e('0x26')](_0x8c5422);}catch(_0x4941e9){logger[_0x2e7e('0x15')](_0x4941e9);}if(_0xd7de09&&_0xd7de09['results']){_0x3eba8b=_0xd7de09['results'][_0x2e7e('0x42')](function(_0x22887a){return _0x22887a&&_0x22887a[_0x2e7e('0x43')][0x0]&&_0x22887a[_0x2e7e('0x43')][0x0][_0x2e7e('0x44')]?_0x22887a['alternatives'][0x0][_0x2e7e('0x44')]:'';})[_0x2e7e('0x45')]('\x0a');_0x4c7967=_0xd7de09[_0x2e7e('0x46')][_0x2e7e('0x42')](function(_0x312e54){return _0x312e54&&_0x312e54[_0x2e7e('0x43')][0x0]&&_0x312e54[_0x2e7e('0x43')][0x0]['confidence']?_0x312e54[_0x2e7e('0x43')][0x0][_0x2e7e('0x47')]:0x0;})[_0x2e7e('0x45')]('\x0a');}logger[_0x2e7e('0x19')](_0x2e7e('0x48'),_0x3eba8b);logger[_0x2e7e('0x19')](_0x2e7e('0x49'),_0x4c7967);return{'transcript':_0x3eba8b,'confidence':_0x4c7967};})[_0x2e7e('0x4a')](function(_0x56c939){logger[_0x2e7e('0x15')](_0x2e7e('0x4b'),_0x56c939[_0x2e7e('0x14')],_0x56c939[_0x2e7e('0x4c')],_0x56c939['message']);});};exports[_0x2e7e('0x4d')]=function(_0x3c4af0,_0x5167ed,_0x71f3e1,_0x223585){var _0x581b4f=apiai(_0x5167ed,{'language':_0x223585||'en'});return _0x581b4f[_0x2e7e('0x4e')](_0x71f3e1,{'sessionId':md5(_0x3c4af0)})[_0x2e7e('0x25')](function(_0x5771d7){logger[_0x2e7e('0x19')](JSON[_0x2e7e('0x3a')](_0x5771d7));return{'source':_0x5771d7[_0x2e7e('0x4f')][_0x2e7e('0x50')],'resolvedQuery':_0x5771d7[_0x2e7e('0x4f')][_0x2e7e('0x51')],'action':_0x5771d7[_0x2e7e('0x4f')][_0x2e7e('0x52')],'actionIncomplete':_0x5771d7[_0x2e7e('0x4f')]['actionIncomplete'],'speech':_0x5771d7[_0x2e7e('0x4f')][_0x2e7e('0x53')][_0x2e7e('0x54')],'score':_0x5771d7[_0x2e7e('0x4f')][_0x2e7e('0x55')],'statusCode':_0x5771d7[_0x2e7e('0x56')][_0x2e7e('0x57')],'endConversation':_0x5771d7[_0x2e7e('0x4f')][_0x2e7e('0x58')]['endConversation']||![],'isFallbackIntent':_0x5771d7[_0x2e7e('0x4f')][_0x2e7e('0x58')][_0x2e7e('0x59')]};});};exports[_0x2e7e('0x5a')]=function(_0x416970,_0x47a8c2,_0x598528,_0x1e72a5,_0x5ef41a,_0x3e79a2){var _0x59f97f=_0x1e72a5['replace'](/\\n/g,'\x0a');var _0x28c467={'credentials':{'private_key':_0x59f97f,'client_email':_0x598528}};var _0xfa1fcd=new dialogflow[(_0x2e7e('0x5b'))](_0x28c467);var _0x480a7e=_0xfa1fcd[_0x2e7e('0x5c')](_0x47a8c2,md5(_0x416970));var _0x58b31a={'session':_0x480a7e,'queryInput':{'text':{'text':_0x5ef41a,'languageCode':_0x3e79a2}}};return _0xfa1fcd['detectIntent'](_0x58b31a)[_0x2e7e('0x25')](function(_0x138638){if(_0x138638&&_0x138638[_0x2e7e('0x5d')]){logger[_0x2e7e('0x19')](_0x2e7e('0x5e'),JSON[_0x2e7e('0x3a')](_0x138638));var _0xcff834=_0x138638[0x0];if(_0xcff834){var _0x377960={'action':_0xcff834[_0x2e7e('0x5f')][_0x2e7e('0x52')],'allRequiredParamsPresent':_0xcff834[_0x2e7e('0x5f')][_0x2e7e('0x60')],'endConversation':_0xcff834[_0x2e7e('0x5f')]['diagnosticInfo']&&_0xcff834[_0x2e7e('0x5f')][_0x2e7e('0x61')][_0x2e7e('0x62')]?_0xcff834[_0x2e7e('0x5f')]['diagnosticInfo'][_0x2e7e('0x62')][_0x2e7e('0x63')][_0x2e7e('0x64')]:![],'fulfillmentText':_0xcff834[_0x2e7e('0x5f')]['fulfillmentText'],'intentName':_0xcff834[_0x2e7e('0x5f')]['intent'][_0x2e7e('0x4c')],'intentDisplayName':_0xcff834[_0x2e7e('0x5f')][_0x2e7e('0x65')][_0x2e7e('0x66')],'isFallbackIntent':_0xcff834[_0x2e7e('0x5f')]['intent'][_0x2e7e('0x67')],'languageCode':_0xcff834[_0x2e7e('0x5f')]['languageCode'],'queryText':_0xcff834[_0x2e7e('0x5f')][_0x2e7e('0x68')],'responseId':_0xcff834['responseId'],'score':_0xcff834['queryResult'][_0x2e7e('0x69')],'speech':_0xcff834[_0x2e7e('0x5f')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x138638)};return _0x377960;}}});};exports[_0x2e7e('0x6a')]=function(_0x47692b,_0x1ec7f1,_0x5b2d08,_0x3e4d23){return tilde['asr'](_0x47692b,_0x1ec7f1,_0x5b2d08,_0x3e4d23)['then'](function(_0x4ad04a){try{fs[_0x2e7e('0x26')](_0x47692b);}catch(_0x53cb8b){logger[_0x2e7e('0x15')](_0x53cb8b);}logger[_0x2e7e('0x19')](_0x2e7e('0x6b'),_0x4ad04a[_0x2e7e('0x44')]);logger[_0x2e7e('0x19')](_0x2e7e('0x6c'),_0x4ad04a['confidence']);return _0x4ad04a;});};exports[_0x2e7e('0x6d')]=function(_0x3379fd,_0x4e51e2,_0x41f34f,_0x214f16,_0x1cb340,_0x448481){var _0x572c34=path['resolve'](__dirname,_0x2e7e('0x21'),rs[_0x2e7e('0x22')](0x4)+_0x2e7e('0x33'));var _0xa9fb10;return aws['polly'](_0x3379fd,_0x4e51e2,_0x41f34f,_0x214f16,_0x1cb340,_0x448481,_0x572c34)[_0x2e7e('0x25')](function(){_0xa9fb10=path[_0x2e7e('0x35')](__dirname,_0x2e7e('0x21'),rs[_0x2e7e('0x22')](0x4)+_0x2e7e('0x36'));return convertFile(_0x572c34,_0xa9fb10);})[_0x2e7e('0x25')](function(){try{fs['unlink'](_0x572c34);fs[_0x2e7e('0x27')](_0xa9fb10,_0x2e7e('0x28'));}catch(_0x3ca0ba){logger[_0x2e7e('0x15')](_0x3ca0ba);}return _0xa9fb10['split']('.')[0x0];});};exports[_0x2e7e('0x6e')]=function(_0xebd661,_0x372c5c,_0x16c4ae,_0x8623f8,_0x2b636e,_0x53305e){return aws[_0x2e7e('0x6f')](_0xebd661,_0x372c5c,_0x16c4ae,_0x8623f8,_0x2b636e,_0x53305e)[_0x2e7e('0x25')](function(_0x56450a){logger[_0x2e7e('0x19')](JSON[_0x2e7e('0x3a')](_0x56450a));return _0x56450a;});};exports['ispeechTTS']=function(_0xc16d28,_0x37c71d,_0x48303e,_0x8f1779){var _0x1f69fe=util[_0x2e7e('0x70')](_0x2e7e('0x71'),ISPEECH_API,_0xc16d28,encodeURIComponent(_0x37c71d),_0x48303e,_0x8f1779);var _0x26a1c6=path[_0x2e7e('0x35')](__dirname,_0x2e7e('0x21'),rs[_0x2e7e('0x22')](0x4)+'.mp3');var _0x4eadba;return downloadFile(_0x1f69fe,_0x26a1c6)['then'](function(){_0x4eadba=path[_0x2e7e('0x35')](__dirname,_0x2e7e('0x21'),rs[_0x2e7e('0x22')](0x4)+_0x2e7e('0x36'));return convertFile(_0x26a1c6,_0x4eadba);})[_0x2e7e('0x25')](function(){try{fs[_0x2e7e('0x26')](_0x26a1c6);fs[_0x2e7e('0x27')](_0x4eadba,_0x2e7e('0x28'));}catch(_0x23bca4){logger['error'](_0x23bca4);}return _0x4eadba[_0x2e7e('0x29')]('.')[0x0];});};exports['ispeechASR']=function(_0x59d17b,_0x219ed5,_0xd29cf2,_0x4adf2d){var _0x51c4c0=util[_0x2e7e('0x70')](_0x2e7e('0x72'),ISPEECH_API,_0x219ed5,_0xd29cf2,base64Encode(_0x59d17b),_0x4adf2d?util[_0x2e7e('0x70')](_0x2e7e('0x73'),encodeURIComponent(_0x4adf2d)):_0x2e7e('0x74'));return uploadFile(_0x51c4c0)[_0x2e7e('0x25')](function(_0x95383){return querystring[_0x2e7e('0xa')](_0x95383);});};exports[_0x2e7e('0x75')]=function(_0x438bcc,_0x159846){return sestek[_0x2e7e('0x76')](_0x438bcc,_0x159846)[_0x2e7e('0x25')](function(_0x4bad4c){logger['info'](JSON[_0x2e7e('0x3a')](_0x4bad4c));var _0x3219bc={'speech':_0x4bad4c[_0x2e7e('0x77')],'action':_0x4bad4c['channelData']?_0x4bad4c[_0x2e7e('0x78')][_0x2e7e('0x79')]:undefined,'actiondata':_0x4bad4c['channelData']?_0x4bad4c[_0x2e7e('0x78')][_0x2e7e('0x7a')]:undefined};if(_0x4bad4c[_0x2e7e('0x78')]&&_0x4bad4c[_0x2e7e('0x78')][_0x2e7e('0x7b')]){return base64Decode(_0x4bad4c[_0x2e7e('0x78')][_0x2e7e('0x7b')][_0x2e7e('0x7c')],path[_0x2e7e('0x35')](__dirname,_0x2e7e('0x21'),rs[_0x2e7e('0x22')](0x4)+'.wav'))[_0x2e7e('0x25')](function(_0xeee816){_0x3219bc['audiofile']=_0xeee816;return _0x3219bc;});}return _0x3219bc;});};exports[_0x2e7e('0x7d')]=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 64ccf8e..5a305e0 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 _0xa9b9=['exports','./nda'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9b9,0x175));var _0x9a9b=function(_0x58ee61,_0x41f78f){_0x58ee61=_0x58ee61-0x0;var _0x1b8825=_0xa9b9[_0x58ee61];return _0x1b8825;};var nda=require(_0x9a9b('0x0'));module[_0x9a9b('0x1')]={'nda':nda}; \ No newline at end of file +var _0x8a2b=['./nda','exports'];(function(_0x1221d5,_0x2332ae){var _0x2bbb04=function(_0x1aa1ec){while(--_0x1aa1ec){_0x1221d5['push'](_0x1221d5['shift']());}};_0x2bbb04(++_0x2332ae);}(_0x8a2b,0x14e));var _0xb8a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8a2b[_0x14add3];return _0x4a174f;};var nda=require(_0xb8a2('0x0'));module[_0xb8a2('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 5ccc31d..dacadf3 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 _0x544a=['body','CustomAction','custom_action','custom_action_data','CustomActionData','request-promise','url','../../../../../config/logger','POST','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','channelData','ProjectName','AudioOutputSettings','audio/wav'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0x544a,0x118));var _0xa544=function(_0x1cd5e6,_0x5dfbf0){_0x1cd5e6=_0x1cd5e6-0x0;var _0x3ec5cd=_0x544a[_0x1cd5e6];return _0x3ec5cd;};'use strict';var rp=require(_0xa544('0x0'));var url=require(_0xa544('0x1'));var logger=require(_0xa544('0x2'))('agi');module['exports']=function(_0x32a74a,_0x456f1){var _0x1e1980={'method':_0xa544('0x3'),'uri':url['resolve'](_0x456f1['ndauth_url'],'/token'),'form':{'grant_type':_0xa544('0x4'),'username':_0x456f1[_0xa544('0x5')],'password':_0x456f1[_0xa544('0x4')]},'json':!![]};return rp(_0x1e1980)['then'](function(_0x196f1e){var _0x13ce7a={'method':_0xa544('0x3'),'uri':url['resolve'](_0x456f1[_0xa544('0x6')],_0xa544('0x7')),'body':{'type':_0x456f1[_0xa544('0x8')]||_0xa544('0x9'),'channelId':'Nda','conversation':{'id':_0x32a74a[_0xa544('0xa')]},'from':{'id':_0x32a74a[_0xa544('0xb')],'name':_0x32a74a[_0xa544('0xc')]},'recipient':{'id':_0x32a74a[_0xa544('0xd')],'name':_0x32a74a[_0xa544('0xe')]},'text':_0x456f1['text'],'channelData':{}},'headers':{'Authorization':_0xa544('0xf')+_0x196f1e['access_token']},'json':!![]};if(_0x456f1['project']){_0x13ce7a['body'][_0xa544('0x10')][_0xa544('0x11')]=_0x456f1['project'];}if(_0x456f1['ndagenerate_audio']=='1'){_0x13ce7a['body'][_0xa544('0x10')][_0xa544('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa544('0x13')};}if(_0x456f1['custom_action']){_0x13ce7a[_0xa544('0x14')][_0xa544('0x10')][_0xa544('0x15')]=_0x456f1[_0xa544('0x16')];if(_0x456f1[_0xa544('0x17')]){_0x13ce7a[_0xa544('0x14')]['channelData'][_0xa544('0x18')]=_0x456f1[_0xa544('0x17')];}}logger['info'](JSON['stringify'](_0x13ce7a));return rp(_0x13ce7a);});}; \ No newline at end of file +var _0x1094=['url','agi','POST','resolve','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','custom_action','CustomAction','custom_action_data','info','stringify','request-promise'];(function(_0x5e9546,_0x2a35b6){var _0x41759e=function(_0x48cffc){while(--_0x48cffc){_0x5e9546['push'](_0x5e9546['shift']());}};_0x41759e(++_0x2a35b6);}(_0x1094,0x143));var _0x4109=function(_0x2ddf2d,_0x272b8a){_0x2ddf2d=_0x2ddf2d-0x0;var _0x53dd02=_0x1094[_0x2ddf2d];return _0x53dd02;};'use strict';var rp=require(_0x4109('0x0'));var url=require(_0x4109('0x1'));var logger=require('../../../../../config/logger')(_0x4109('0x2'));module['exports']=function(_0x42557f,_0x32d6c3){var _0x308136={'method':_0x4109('0x3'),'uri':url[_0x4109('0x4')](_0x32d6c3['ndauth_url'],_0x4109('0x5')),'form':{'grant_type':_0x4109('0x6'),'username':_0x32d6c3[_0x4109('0x7')],'password':_0x32d6c3[_0x4109('0x6')]},'json':!![]};return rp(_0x308136)[_0x4109('0x8')](function(_0x2c34f){var _0x5512e8={'method':_0x4109('0x3'),'uri':url[_0x4109('0x4')](_0x32d6c3[_0x4109('0x9')],_0x4109('0xa')),'body':{'type':_0x32d6c3[_0x4109('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x42557f[_0x4109('0xc')]},'from':{'id':_0x42557f['callerid'],'name':_0x42557f[_0x4109('0xd')]},'recipient':{'id':_0x42557f[_0x4109('0xe')],'name':_0x42557f[_0x4109('0xf')]},'text':_0x32d6c3['text'],'channelData':{}},'headers':{'Authorization':_0x4109('0x10')+_0x2c34f[_0x4109('0x11')]},'json':!![]};if(_0x32d6c3[_0x4109('0x12')]){_0x5512e8[_0x4109('0x13')][_0x4109('0x14')]['ProjectName']=_0x32d6c3[_0x4109('0x12')];}if(_0x32d6c3[_0x4109('0x15')]=='1'){_0x5512e8[_0x4109('0x13')][_0x4109('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x32d6c3[_0x4109('0x16')]){_0x5512e8[_0x4109('0x13')][_0x4109('0x14')][_0x4109('0x17')]=_0x32d6c3[_0x4109('0x16')];if(_0x32d6c3[_0x4109('0x18')]){_0x5512e8[_0x4109('0x13')][_0x4109('0x14')]['CustomActionData']=_0x32d6c3['custom_action_data'];}}logger[_0x4109('0x19')](JSON[_0x4109('0x1a')](_0x5512e8));return rp(_0x5512e8);});}; \ 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 828e289..4bfbae3 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 _0x72c9=['exports'];(function(_0x2c7aa2,_0x5ef162){var _0x1e4a12=function(_0x26880f){while(--_0x26880f){_0x2c7aa2['push'](_0x2c7aa2['shift']());}};_0x1e4a12(++_0x5ef162);}(_0x72c9,0x1ab));var _0x972c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72c9[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require('./lib/api');module[_0x972c('0x0')]=function(_0x405635,_0x2ab34e,_0x34d4ba,_0x4b04c3){return asr(_0x405635,_0x2ab34e,_0x34d4ba,_0x4b04c3);}; \ No newline at end of file +var _0xd966=['exports','./lib/api'];(function(_0xb1c307,_0x3d6cf0){var _0x2df25f=function(_0xfabbe){while(--_0xfabbe){_0xb1c307['push'](_0xb1c307['shift']());}};_0x2df25f(++_0x3d6cf0);}(_0xd966,0x1b7));var _0x6d96=function(_0xf1d988,_0x341f87){_0xf1d988=_0xf1d988-0x0;var _0x264fa0=_0xd966[_0xf1d988];return _0x264fa0;};'use strict';var asr=require(_0x6d96('0x0'));module[_0x6d96('0x1')]=function(_0x599e02,_0x2f2183,_0x38722d,_0x3c015b){return asr(_0x599e02,_0x2f2183,_0x38722d,_0x3c015b);}; \ 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 09377ce..8166112 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 _0x78cb=['parse','status','result','final','info','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','lodash','crypto','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate'];(function(_0x1fab1f,_0x16001a){var _0x3f2a91=function(_0x2e0fee){while(--_0x2e0fee){_0x1fab1f['push'](_0x1fab1f['shift']());}};_0x3f2a91(++_0x16001a);}(_0x78cb,0x11d));var _0xb78c=function(_0x249274,_0x854b12){_0x249274=_0x249274-0x0;var _0x101afe=_0x78cb[_0x249274];return _0x101afe;};'use strict';var BPromise=require('bluebird');var _=require(_0xb78c('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xb78c('0x1'));var logger=require('../../../../../../config/logger')('agi');module['exports']=function(_0x15f433,_0x592546,_0x1e9702,_0x5ce757){return new BPromise(function(_0xc83dd4,_0x5d8aee){logger['info'](_0xb78c('0x2'),_0x5ce757||_0xb78c('0x3'));var _0x149765=new WebSocket(_0x5ce757||_0xb78c('0x3'),{'perMessageDeflate':![]});var _0x209da6='';var _0xa36802='0';var _0x21ebf5='1';var _0x3f535b=_0xb78c('0x4');function _0x547cba(_0x17deaa){var _0x3c3385=crypto[_0xb78c('0x5')](_0xb78c('0x6'));_0x3c3385[_0xb78c('0x7')](_0x17deaa);return _0x3c3385[_0xb78c('0x8')]('hex');}function _0x2438ff(){try{logger['info'](_0xb78c('0x9'));var _0x17f2cf=moment()[_0xb78c('0xa')]();var _0x51065e=_0x547cba(_0x17f2cf+_0x592546+_0x1e9702);_0x149765[_0xb78c('0xb')](JSON[_0xb78c('0xc')]({'appID':_0x592546,'timestamp':_0x17f2cf,'appKey':_0x51065e}));var _0x48b9fe=fs[_0xb78c('0xd')](_0x15f433);_0x48b9fe['on'](_0xb78c('0xe'),function(_0x44348c){_0x149765[_0xb78c('0xb')](_0x44348c);});_0x48b9fe['on'](_0xb78c('0xf'),function(){_0x149765[_0xb78c('0xb')](_0xb78c('0x10'));});}catch(_0x1c4811){logger['error'](_0xb78c('0x11'),JSON[_0xb78c('0xc')](_0x1c4811));_0x149765[_0xb78c('0x12')]();}}function _0x257c38(_0x2526b6){try{if(_0x2526b6){var _0x133129=JSON[_0xb78c('0x13')](_0x2526b6);switch(_0x133129[_0xb78c('0x14')]){case 0x0:if(_0x133129[_0xb78c('0x15')]){if(_0x133129[_0xb78c('0x15')][_0xb78c('0x16')]){logger[_0xb78c('0x17')]('Tilde\x20ASR\x20hypoteses',JSON[_0xb78c('0xc')](_0x133129[_0xb78c('0x15')][_0xb78c('0x18')]));_0x209da6=_0x133129['result'][_0xb78c('0x18')][0x0][_0xb78c('0x19')];_0xa36802=_0x133129['result'][_0xb78c('0x18')][0x0][_0xb78c('0x1a')];_0x21ebf5='0';_0x3f535b=_0xb78c('0x1b');_0x149765['terminate']();}}break;case 0x1:logger['info'](_0xb78c('0x4'));_0x21ebf5='1';_0x3f535b=_0xb78c('0x4');break;case 0x2:logger[_0xb78c('0x17')](_0xb78c('0x1c'));_0x21ebf5='2';_0x3f535b=_0xb78c('0x1c');break;case 0x9:logger[_0xb78c('0x17')](_0xb78c('0x1d'));_0x21ebf5='9';_0x3f535b=_0xb78c('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0x21ebf5='10';_0x3f535b='Authentication\x20failed.';break;case 0xb:logger[_0xb78c('0x17')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x21ebf5='11';_0x3f535b=_0xb78c('0x1e');}}}catch(_0x4469e8){logger[_0xb78c('0x1f')](_0xb78c('0x20'),JSON['stringify'](_0x4469e8));_0x149765[_0xb78c('0x12')]();}}function _0x330ae1(){logger[_0xb78c('0x17')](_0xb78c('0x21'));_0xc83dd4({'transcript':_0x209da6,'confidence':_0xa36802,'status':_0x21ebf5,'status_message':_0x3f535b});}function _0x4953e4(_0x2a9d1a){logger[_0xb78c('0x1f')](_0xb78c('0x22'));if(!_[_0xb78c('0x23')](_0x2a9d1a)){logger[_0xb78c('0x1f')](_[_0xb78c('0x24')](_0x2a9d1a)?JSON[_0xb78c('0xc')](_0x2a9d1a):_0x2a9d1a);}}_0x149765['on'](_0xb78c('0x25'),_0x2438ff);_0x149765['on']('message',_0x257c38);_0x149765['on'](_0xb78c('0xf'),_0x330ae1);_0x149765['on']('error',_0x4953e4);});}; \ No newline at end of file +var _0x3b1f=['terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','open','message','bluebird','lodash','moment','crypto','agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','parse','status','result','final','hypotheses','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0x3b1f,0x177));var _0xf3b1=function(_0x169514,_0xc13eb7){_0x169514=_0x169514-0x0;var _0x489ce1=_0x3b1f[_0x169514];return _0x489ce1;};'use strict';var BPromise=require(_0xf3b1('0x0'));var _=require(_0xf3b1('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf3b1('0x2'));var crypto=require(_0xf3b1('0x3'));var logger=require('../../../../../../config/logger')(_0xf3b1('0x4'));module['exports']=function(_0x1d8839,_0x5a1afe,_0x5707ca,_0x437b18){return new BPromise(function(_0x4b5a11,_0x4268f8){logger[_0xf3b1('0x5')]('Tilde\x20URI',_0x437b18||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x3efb41=new WebSocket(_0x437b18||_0xf3b1('0x6'),{'perMessageDeflate':![]});var _0x1b2307='';var _0x51577a='0';var _0x4b1cec='1';var _0x55e244='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x1a91a3(_0x3a2c4a){var _0x206771=crypto[_0xf3b1('0x7')](_0xf3b1('0x8'));_0x206771[_0xf3b1('0x9')](_0x3a2c4a);return _0x206771['digest'](_0xf3b1('0xa'));}function _0x2a7049(){try{logger['info'](_0xf3b1('0xb'));var _0x3f2cc2=moment()[_0xf3b1('0xc')]();var _0x357148=_0x1a91a3(_0x3f2cc2+_0x5a1afe+_0x5707ca);_0x3efb41[_0xf3b1('0xd')](JSON[_0xf3b1('0xe')]({'appID':_0x5a1afe,'timestamp':_0x3f2cc2,'appKey':_0x357148}));var _0x18af60=fs[_0xf3b1('0xf')](_0x1d8839);_0x18af60['on'](_0xf3b1('0x10'),function(_0x4c9a3a){_0x3efb41[_0xf3b1('0xd')](_0x4c9a3a);});_0x18af60['on'](_0xf3b1('0x11'),function(){_0x3efb41[_0xf3b1('0xd')](_0xf3b1('0x12'));});}catch(_0x450ed2){logger[_0xf3b1('0x13')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf3b1('0xe')](_0x450ed2));_0x3efb41['terminate']();}}function _0x594fb1(_0x2061f0){try{if(_0x2061f0){var _0x548714=JSON[_0xf3b1('0x14')](_0x2061f0);switch(_0x548714[_0xf3b1('0x15')]){case 0x0:if(_0x548714[_0xf3b1('0x16')]){if(_0x548714[_0xf3b1('0x16')][_0xf3b1('0x17')]){logger[_0xf3b1('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0xf3b1('0xe')](_0x548714[_0xf3b1('0x16')][_0xf3b1('0x18')]));_0x1b2307=_0x548714[_0xf3b1('0x16')]['hypotheses'][0x0]['transcript'];_0x51577a=_0x548714['result'][_0xf3b1('0x18')][0x0][_0xf3b1('0x19')];_0x4b1cec='0';_0x55e244=_0xf3b1('0x1a');_0x3efb41['terminate']();}}break;case 0x1:logger[_0xf3b1('0x5')](_0xf3b1('0x1b'));_0x4b1cec='1';_0x55e244=_0xf3b1('0x1b');break;case 0x2:logger[_0xf3b1('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x4b1cec='2';_0x55e244=_0xf3b1('0x1c');break;case 0x9:logger['info'](_0xf3b1('0x1d'));_0x4b1cec='9';_0x55e244=_0xf3b1('0x1d');break;case 0xa:logger[_0xf3b1('0x5')](_0xf3b1('0x1e'));_0x4b1cec='10';_0x55e244='Authentication\x20failed.';break;case 0xb:logger[_0xf3b1('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4b1cec='11';_0x55e244=_0xf3b1('0x1f');}}}catch(_0x16559b){logger[_0xf3b1('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x16559b));_0x3efb41[_0xf3b1('0x20')]();}}function _0x48f0f8(){logger['info'](_0xf3b1('0x21'));_0x4b5a11({'transcript':_0x1b2307,'confidence':_0x51577a,'status':_0x4b1cec,'status_message':_0x55e244});}function _0x3b05a0(_0x116671){logger[_0xf3b1('0x13')](_0xf3b1('0x22'));if(!_['isNil'](_0x116671)){logger[_0xf3b1('0x13')](_['isObject'](_0x116671)?JSON[_0xf3b1('0xe')](_0x116671):_0x116671);}}_0x3efb41['on'](_0xf3b1('0x23'),_0x2a7049);_0x3efb41['on'](_0xf3b1('0x24'),_0x594fb1);_0x3efb41['on'](_0xf3b1('0x11'),_0x48f0f8);_0x3efb41['on']('error',_0x3b05a0);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 10cb4be..04917c9 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x1a87=['./asr','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1a87,0x1cc));var _0x71a8=function(_0x3f9058,_0x5bab3c){_0x3f9058=_0x3f9058-0x0;var _0x8aaa1e=_0x1a87[_0x3f9058];return _0x8aaa1e;};var asr=require(_0x71a8('0x0'));module[_0x71a8('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index a44e960..581dfe7 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(_0x47cde9,_0x19d013){var _0x26fdf1=function(_0x32fb69){while(--_0x32fb69){_0x47cde9['push'](_0x47cde9['shift']());}};_0x26fdf1(++_0x19d013);}(_0xe706,0xa3));var _0x6e70=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xe706[_0x3ceb54];return _0x26d8a6;};'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 _0xd8b0=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection'];(function(_0x22581a,_0x5bd815){var _0xb799f=function(_0x56acbd){while(--_0x56acbd){_0x22581a['push'](_0x22581a['shift']());}};_0xb799f(++_0x5bd815);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var net=require(_0x0d8b('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0d8b('0x2'));var AGIServer=function(_0x5b9b89,_0x43bca1,_0x364286){var _0x8196ed=this;var _0x577834=null;var _0x5e15e6=0x0;if(!_0x5b9b89)_0x5b9b89=0x11dd;if(!_0x43bca1)_0x43bca1=_0x0d8b('0x3');EventEmitter[_0x0d8b('0x4')](_0x8196ed);function _0x39f43a(){if(!_0x5b9b89){_0x8196ed['emit'](_0x0d8b('0x5'),new AGIError(_0x0d8b('0x6')));return![];}_0x577834=net['createServer']();_0x577834[_0x0d8b('0x7')](_0x5b9b89,_0x43bca1);_0x577834['on'](_0x0d8b('0x8'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x8'));});_0x577834['on'](_0x0d8b('0xa'),function(_0x1cac62){_0x577834[_0x0d8b('0xb')](function(_0x28f87c,_0x48fa16){if(_0x28f87c){_0x8196ed[_0x0d8b('0x9')]('error',new AGIError(_0x0d8b('0xc'),_0x28f87c));}else if(_0x364286&&_0x364286<0x0){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xd')));_0x1cac62[_0x0d8b('0xe')]();}else if(_0x364286&&_0x364286>0x0&&_0x364286<_0x48fa16){_0x5e15e6+=0x1;_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xf'),_0x5e15e6));_0x1cac62[_0x0d8b('0xe')]();}else{var _0x2ce75e=new AGIChannel(_0x1cac62);_0x2ce75e['on'](_0x0d8b('0x10'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x2ce75e);});}});});_0x577834['on'](_0x0d8b('0x5'),function(_0x4f6f21){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xc'),_0x4f6f21[_0x0d8b('0x11')]));});_0x577834['on'](_0x0d8b('0x12'),function(){_0x8196ed['emit'](_0x0d8b('0x12'),new AGIError(_0x0d8b('0x13')));});}process[_0x0d8b('0x14')](function(){_0x39f43a();});};util[_0x0d8b('0x15')](AGIServer,EventEmitter);module[_0x0d8b('0x16')]=function(_0x18dd2d,_0x264b39,_0xa3612a){return new AGIServer(_0x18dd2d,_0x264b39,_0xa3612a);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 95ea080..4eca33d 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 _0x3276=['ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','no\x20condition\x20configured','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','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','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','PLAYBACK','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','sms_account_id','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','util','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','rpc','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','url','method','number','includes','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','headers','stringify','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','timeout','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block'];(function(_0xeaa59f,_0xef522e){var _0x11209b=function(_0x360885){while(--_0x360885){_0xeaa59f['push'](_0xeaa59f['shift']());}};_0x11209b(++_0xef522e);}(_0x3276,0xc7));var _0x6327=function(_0x5653b5,_0x4ad361){_0x5653b5=_0x5653b5-0x0;var _0x2da894=_0x3276[_0x5653b5];return _0x2da894;};'use strict';var fs=require('fs');var util=require(_0x6327('0x0'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x6327('0x1'))();var rs=require(_0x6327('0x2'));var moment=require(_0x6327('0x3'));var Mustache=require(_0x6327('0x4'));var rp=require(_0x6327('0x5'));var logger=require(_0x6327('0x6'))(_0x6327('0x7'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var scripts=require(_0x6327('0x8'));var FILES_PATH=_0x6327('0x9');var recursiveMapAttributes=[_0x6327('0xa'),'rawBody'];var verticesWithRetry=[_0x6327('0xb'),_0x6327('0xc'),_0x6327('0xd')];var AGIVertices=function(_0x1dc34b,_0x522c2f,_0x1314d0){this[_0x6327('0xe')]=_0x1dc34b;this['rpc']=_0x522c2f;this[_0x6327('0xf')]=_0x1314d0;};AGIVertices[_0x6327('0x10')]['getVariable']=function(_0x24664f,_0x29af6a){this[_0x6327('0x11')]['getVariableById'](_0x24664f)[_0x6327('0x12')](function(_0x3a72b7){_0x29af6a(null,_0x3a72b7?_0x3a72b7[_0x6327('0x13')]:![]);})[_0x6327('0x14')](function(_0x3ff61b){_0x29af6a(_0x3ff61b);});};AGIVertices[_0x6327('0x10')][_0x6327('0x15')]=function(_0xa5554b,_0x576b1c){this[_0x6327('0x11')]['getVoiceQueueById'](_0xa5554b)[_0x6327('0x12')](function(_0x5915fd){_0x576b1c(null,_0x5915fd?_0x5915fd[_0x6327('0x13')]:![]);})[_0x6327('0x14')](function(_0x43186f){_0x576b1c(_0x43186f);});};AGIVertices['prototype'][_0x6327('0x16')]=function(_0x237721,_0xdbd021){this[_0x6327('0x11')][_0x6327('0x17')](_0x237721)[_0x6327('0x12')](function(_0x341a51){_0xdbd021(null,_0x341a51?_0x341a51[_0x6327('0x13')]:![]);})[_0x6327('0x14')](function(_0xd8e138){_0xdbd021(_0xd8e138);});};AGIVertices[_0x6327('0x10')][_0x6327('0x18')]=function(_0x55cf65,_0x1de532){this[_0x6327('0x11')][_0x6327('0x19')](_0x55cf65)[_0x6327('0x12')](function(_0x4cbc80){_0x1de532(null,_0x4cbc80?_0x4cbc80['dsn']:![]);})[_0x6327('0x14')](function(_0x700766){_0x1de532(_0x700766);});};AGIVertices[_0x6327('0x10')][_0x6327('0x1a')]=function(_0x3078c5,_0x76c718){this[_0x6327('0x11')][_0x6327('0x1b')](_0x3078c5)[_0x6327('0x12')](function(_0x2f153c){_0x76c718(null,_0x2f153c?_0x2f153c[_0x6327('0x13')]:![]);})[_0x6327('0x14')](function(_0x254c2f){_0x76c718(_0x254c2f);});};AGIVertices[_0x6327('0x10')][_0x6327('0x1c')]=function(_0x10e312,_0x4ec954){this['rpc'][_0x6327('0x1d')](_0x10e312)['then'](function(_0x144fcc){_0x4ec954(null,_0x144fcc?_0x144fcc['name']:![]);})[_0x6327('0x14')](function(_0x559dbb){_0x4ec954(_0x559dbb);});};AGIVertices[_0x6327('0x10')][_0x6327('0x1e')]=function(_0x486f8e,_0x44caac){var _0xb02b41=this;this[_0x6327('0x11')][_0x6327('0x1f')](_0x486f8e)[_0x6327('0x12')](function(_0x29f43e){_0x44caac(null,_0x29f43e?_0xb02b41[_0x6327('0x20')](_0x29f43e[_0x6327('0x21')]):![]);})['catch'](function(_0x2ebc01){_0x44caac(_0x2ebc01);});};AGIVertices[_0x6327('0x10')]['getMailAccount']=function(_0x269c33,_0x40e927){this['rpc'][_0x6327('0x22')](_0x269c33)[_0x6327('0x12')](function(_0x330471){_0x40e927(null,_0x330471?_0x330471:![]);})['catch'](function(_0xaf1cb6){_0x40e927(_0xaf1cb6);});};AGIVertices[_0x6327('0x10')][_0x6327('0x23')]=function(_0x2c986a,_0x523b52,_0xf7b0a3){this['mailRpc']['sendMailMessage'](_0x2c986a,_0x523b52)[_0x6327('0x12')](function(){_0xf7b0a3(null);})[_0x6327('0x14')](function(_0x24eb8c){_0xf7b0a3(_0x24eb8c);});};AGIVertices[_0x6327('0x10')]['getIntervals']=function(_0x377efe,_0xc18d65){this[_0x6327('0x11')][_0x6327('0x24')](_0x377efe)['then'](function(_0x409718){if(_0x409718){if(_0x409718[_0x6327('0x25')]){_0xc18d65(null,[_0x409718[_0x6327('0x26')]]);}else{_0xc18d65(null,_['map'](_0x409718[_0x6327('0x27')],_0x6327('0x26')));}}else{_0xc18d65(null,![]);}})[_0x6327('0x14')](function(_0x57a5a2){_0xc18d65(_0x57a5a2);});};AGIVertices['prototype'][_0x6327('0x20')]=function(_0x528a99){return util[_0x6327('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x528a99);};AGIVertices[_0x6327('0x10')][_0x6327('0x29')]=function(_0x21a9cd,_0x9c6e6d,_0x1a20a9){odbc[_0x6327('0x2a')](_0x21a9cd,function(_0x544e6b){if(_0x544e6b){logger[_0x6327('0x2b')](_0x6327('0x2c'),_0x544e6b);_0x1a20a9(_0x544e6b);}else{logger[_0x6327('0x2d')](_0x6327('0x2e'));odbc['query'](_0x9c6e6d,function(_0x47e1a4,_0x458912){if(_0x47e1a4){logger[_0x6327('0x2d')](_0x6327('0x2f'),_0x9c6e6d);_0x1a20a9(_0x47e1a4);}else{logger[_0x6327('0x2d')](_0x6327('0x30'),_0x9c6e6d);odbc['close'](function(_0xbf140d){if(_0xbf140d){logger[_0x6327('0x2b')](_0x6327('0x31'),_0xbf140d);}_0x1a20a9(null,_0x458912);});}});}});};AGIVertices[_0x6327('0x10')][_0x6327('0x32')]=function(_0x4db72b,_0x49a887){this[_0x6327('0x11')]['getSmsAccountById'](_0x4db72b)[_0x6327('0x12')](function(_0x360b46){_0x49a887(null,_0x360b46?_0x360b46:![]);})[_0x6327('0x14')](function(_0x46b813){_0x49a887(_0x46b813);});};AGIVertices['prototype'][_0x6327('0x33')]=function(_0x413a31,_0x53530e){this['rpc'][_0x6327('0x33')](_0x413a31)[_0x6327('0x12')](function(_0x486090){_0x53530e(null,_0x486090);})[_0x6327('0x14')](function(_0x3ce66b){_0x53530e(_0x3ce66b);});};AGIVertices[_0x6327('0x10')][_0x6327('0x34')]=function(_0xab88fb,_0x415d24,_0x12a436){this[_0x6327('0x11')][_0x6327('0x34')]({'uniqueid':this[_0x6327('0xe')][_0x6327('0x35')],'node':_0xab88fb[_0x6327('0x36')],'application':_0xab88fb[_0x6327('0x37')],'data':_0x415d24||null,'project_name':this[_0x6327('0xe')][_0x6327('0x38')],'callerid':this[_0x6327('0xe')][_0x6327('0x39')]})[_0x6327('0x12')](function(_0x482c2e){if(_0x12a436){_0x12a436(null,_0x482c2e);}})[_0x6327('0x14')](function(_0xfdf4f9){if(_0x12a436){_0x12a436(_0xfdf4f9);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x5350f8,_0x177175,_0x25cd37,_0x496724){this[_0x6327('0x11')][_0x6327('0x3a')]({'uniqueid':this[_0x6327('0xe')][_0x6327('0x35')],'callerid':this[_0x6327('0xe')][_0x6327('0x39')],'calleridname':this[_0x6327('0xe')][_0x6327('0x3b')],'context':this[_0x6327('0xe')]['context'],'extension':this[_0x6327('0xe')][_0x6327('0x3c')],'priority':this[_0x6327('0xe')]['priority'],'accountcode':this[_0x6327('0xe')][_0x6327('0x3d')],'dnid':this[_0x6327('0xe')][_0x6327('0x3e')],'projectName':this['channel'][_0x6327('0x38')],'saveName':_0x177175,'filename':_0x5350f8[_0x6327('0x3f')]||_0x177175,'savePath':_0x25cd37})[_0x6327('0x12')](function(_0x248ef6){_0x496724(null,_0x248ef6);})[_0x6327('0x14')](function(_0x163ee4){_0x496724(_0x163ee4);});};AGIVertices[_0x6327('0x10')][_0x6327('0x40')]=function(_0x11030e,_0x1b557c,_0x719283,_0x31882f,_0x3904fc){this[_0x6327('0x11')]['createSquareMessage']({'uniqueid':this['channel'][_0x6327('0x35')],'body':_0x11030e,'direction':_0x1b557c,'providerName':_0x719283,'providerResponse':_0x31882f})[_0x6327('0x12')](function(_0x86d99b){if(_0x3904fc){_0x3904fc(null,_0x86d99b);}})[_0x6327('0x14')](function(_0x108d54){if(_0x3904fc){_0x3904fc(_0x108d54);}});};AGIVertices[_0x6327('0x10')][_0x6327('0x41')]=function(_0x4343ec,_0xbb0fe1){this[_0x6327('0x11')][_0x6327('0x41')]({'firstName':_[_0x6327('0x42')](_0x4343ec[_0x6327('0x13')])||_[_0x6327('0x43')](_0x4343ec['name'])?_0x6327('0x44')+Math[_0x6327('0x45')]():_0x4343ec[_0x6327('0x13')],'lastName':_[_0x6327('0x42')](_0x4343ec['lastName'])||_[_0x6327('0x43')](_0x4343ec[_0x6327('0x46')])?null:_0x4343ec[_0x6327('0x46')],'phone':_0x4343ec[_0x6327('0x47')],'ListId':_0x4343ec[_0x6327('0x48')],'scheduledat':_0x4343ec['scheduledAt'],'callbackUniqueid':this[_0x6327('0xe')]['uniqueid'],'tags':_0x6327('0x49'),'description':_0x6327('0x4a')+_0x4343ec[_0x6327('0x4b')][_0x6327('0x4c')](),'priority':_0x4343ec[_0x6327('0x4d')]})[_0x6327('0x12')](function(_0x581c31){_0xbb0fe1(null,_0x581c31);})[_0x6327('0x14')](function(_0x3ab076){_0xbb0fe1(_0x3ab076);});};AGIVertices['prototype'][_0x6327('0x4e')]=function(_0x435327,_0x16ea2f){this[_0x6327('0x11')][_0x6327('0x4f')](_0x435327)[_0x6327('0x12')](function(_0x4745ca){_0x16ea2f(null,_0x4745ca?_0x4745ca[_0x6327('0x13')]:![]);})['catch'](function(_0x2607a1){_0x16ea2f(_0x2607a1);});};AGIVertices[_0x6327('0x10')][_0x6327('0x50')]=function(_0x2188c2,_0x6b48e0,_0xea3cdd){var _0x486d9f={'role':_0x6327('0x51')};_0x486d9f[_0x2188c2]=this['channel'][_0x6327('0x39')];this[_0x6327('0x11')][_0x6327('0x50')](_0x486d9f,_0x6b48e0,this[_0x6327('0xe')][_0x6327('0x35')])[_0x6327('0x12')](function(_0x40fca8){_0xea3cdd(null,_[_0x6327('0x43')](_0x40fca8)?![]:!![]);})[_0x6327('0x14')](function(_0x44044c){logger[_0x6327('0x2b')](_0x44044c);_0xea3cdd(null,![]);});};AGIVertices[_0x6327('0x10')][_0x6327('0x52')]=function(_0x4d276b,_0x2be066){var _0x13bb56={'role':_0x6327('0x51')};_0x13bb56[_0x4d276b]=this['channel'][_0x6327('0x39')];this[_0x6327('0x11')]['agentUnpause'](_0x13bb56)['then'](function(_0x516d8f){_0x2be066(null,_['isNil'](_0x516d8f)?![]:!![]);})[_0x6327('0x14')](function(_0x129bbc){logger[_0x6327('0x2b')](_0x129bbc);_0x2be066(null,![]);});};AGIVertices[_0x6327('0x10')][_0x6327('0x53')]=function(_0x595b3a,_0x5dea35){var _0x135361={'role':_0x6327('0x51')};_0x135361[_0x595b3a]=this['channel'][_0x6327('0x39')];this[_0x6327('0x11')][_0x6327('0x53')](_0x135361)[_0x6327('0x12')](function(_0x408f56){_0x5dea35(null,_[_0x6327('0x43')](_0x408f56)?![]:!![]);})['catch'](function(_0x5446db){logger['error'](_0x5446db);_0x5dea35(null,![]);});};AGIVertices[_0x6327('0x10')][_0x6327('0x54')]=function(_0x56f690,_0x5493d1){var _0x5e17e7={'role':_0x6327('0x51')};_0x5e17e7[_0x56f690]=this[_0x6327('0xe')][_0x6327('0x39')];var _0x28bfd7=_0x56f690!='internal'?util[_0x6327('0x28')](_0x6327('0x55'),_0x6327('0x56'),this['channel']['callerid']):undefined;this['rpc'][_0x6327('0x54')](_0x5e17e7,_0x28bfd7)[_0x6327('0x12')](function(_0x1c5d1a){_0x5493d1(null,_[_0x6327('0x43')](_0x1c5d1a)?![]:!![]);})['catch'](function(_0x54326a){logger[_0x6327('0x2b')](_0x54326a);_0x5493d1(null,![]);});};AGIVertices['prototype'][_0x6327('0x57')]=function(_0x5e92a8,_0x362873){sh[_0x6327('0x58')](_[_0x6327('0x59')](_0x5e92a8),function(_0x491885,_0x4bdeab){var _0x24bb76=_0x4bdeab[_0x6327('0x5a')](/(\r\n|\n|\r)/gm,'');_0x362873(null,_0x24bb76);});};AGIVertices['prototype'][_0x6327('0x5b')]=function(_0x3f56ba,_0x15de14){scripts['googleCloudTTS'](_0x3f56ba[_0x6327('0x5c')],_0x3f56ba['google_cloud_tts_text_type']||_0x6327('0x5d'),_0x3f56ba[_0x6327('0x5d')],_0x3f56ba[_0x6327('0x5e')]||_0x6327('0x5f'),_0x3f56ba[_0x6327('0x60')]||_0x6327('0x61'),_0x3f56ba[_0x6327('0x62')]||_0x6327('0x63'))['then'](function(_0x34acb9){_0x15de14(null,_0x34acb9);})[_0x6327('0x14')](function(_0x3f8b41){_0x15de14(_0x3f8b41);});};AGIVertices[_0x6327('0x10')]['googleTTS']=function(_0x403367,_0xdf319b){scripts[_0x6327('0x64')](_0x403367[_0x6327('0x5d')],_0x403367['google_tts_language']||'en',0x1)[_0x6327('0x12')](function(_0x80652){_0xdf319b(null,_0x80652);})['catch'](function(_0x14a163){_0xdf319b(_0x14a163);});};AGIVertices[_0x6327('0x10')]['restAPI']=function(_0x1a901b,_0x5bb0cc){var _0xef7bc9={'uri':_0x1a901b[_0x6327('0x65')],'method':_0x1a901b[_0x6327('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1a901b['timeout'])===_0x6327('0x67')&&parseInt(_0x1a901b['timeout'])>=0x1?parseInt(_0x1a901b['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x6327('0x68')](['POST',_0x6327('0x69')],_0xef7bc9[_0x6327('0x66')][_0x6327('0x6a')]())){try{_0xef7bc9[_0x6327('0x6b')]=_0x1a901b[_0x6327('0x6c')]?JSON[_0x6327('0x6d')](_0x1a901b[_0x6327('0x6c')]):{};}catch(_0x29ee0f){logger[_0x6327('0x2b')](_0x6327('0x6e'),_0x29ee0f);}}try{_0xef7bc9['headers']=_0x1a901b[_0x6327('0xa')]?JSON[_0x6327('0x6d')](_0x1a901b[_0x6327('0xa')]):{};}catch(_0x5b5d8d){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5b5d8d);}if(_0x1a901b['computedVariables']){try{var _0x2bc3aa=require(_0x1a901b[_0x6327('0x6f')])[_0x6327('0x70')](this,_0xef7bc9);_0xef7bc9['uri']=Mustache['render'](_0x1a901b[_0x6327('0x65')],_0x2bc3aa,{},['$$','$$']);if(_0xef7bc9[_0x6327('0x71')]){_0xef7bc9[_0x6327('0x71')]=JSON[_0x6327('0x6d')](Mustache['render'](JSON[_0x6327('0x72')](_0xef7bc9[_0x6327('0x71')]),_0x2bc3aa,{},['$$','$$']));}if(_0xef7bc9[_0x6327('0x6b')]){_0xef7bc9[_0x6327('0x6b')]=JSON[_0x6327('0x6d')](Mustache[_0x6327('0x73')](JSON[_0x6327('0x72')](_0xef7bc9['body']),_0x2bc3aa,{},['$$','$$']));}}catch(_0x44c52b){logger['error'](_0x6327('0x74'),_0x44c52b);}}rp(_0xef7bc9)[_0x6327('0x12')](function(_0x101a46){var _0x52b7d9={'statusCode':_0x101a46[_0x6327('0x75')]||0xc8,'statusMessage':_0x101a46[_0x6327('0x76')]||'OK','headers':_0x101a46[_0x6327('0x71')]||{},'body':_0x101a46[_0x6327('0x6b')]||{}};_0x5bb0cc(null,_0x52b7d9);})[_0x6327('0x14')](function(_0x50a2c4){var _0x4beb23={'statusCode':_0x50a2c4[_0x6327('0x75')]||0x1f4,'statusMessage':_0x50a2c4[_0x6327('0x77')]||_0x6327('0x78'),'headers':_0x50a2c4['options'][_0x6327('0x71')]||{},'body':_0x50a2c4[_0x6327('0x79')][_0x6327('0x6b')]||{}};_0x5bb0cc(null,_0x4beb23);});};AGIVertices[_0x6327('0x10')]['googleDialogflow']=function(_0x55c65b,_0x358507){scripts[_0x6327('0x7a')](this['channel']['uniqueid'],_0x55c65b[_0x6327('0x7b')],_0x55c65b[_0x6327('0x5d')],_0x55c65b[_0x6327('0x7c')]||'en')[_0x6327('0x12')](function(_0x1306e9){_0x358507(null,_0x1306e9);})[_0x6327('0x14')](function(_0x30794f){_0x358507(_0x30794f);});};AGIVertices[_0x6327('0x10')]['googleDialogflowV2']=function(_0x4fdddc,_0x2aa93f){scripts[_0x6327('0x7d')](this[_0x6327('0xe')]['uniqueid'],_0x4fdddc['dialogflowV2_project_id'],_0x4fdddc['client_email'],_0x4fdddc[_0x6327('0x7e')],_0x4fdddc['text'],_0x4fdddc[_0x6327('0x7f')]||'en')['then'](function(_0x585a5e){_0x2aa93f(null,_0x585a5e);})['catch'](function(_0x33bb8f){_0x2aa93f(_0x33bb8f);});};AGIVertices['prototype'][_0x6327('0x80')]=function(_0x3cc624,_0x341949){scripts[_0x6327('0x80')](this['channel'],_0x3cc624)[_0x6327('0x12')](function(_0x5e721b){_0x341949(null,_0x5e721b);})[_0x6327('0x14')](function(_0x11e933){_0x341949(_0x11e933);});};AGIVertices[_0x6327('0x10')][_0x6327('0x81')]=function(_0x2a1a1e,_0x19a271){scripts[_0x6327('0x81')](_0x2a1a1e[_0x6327('0x7b')],_0x2a1a1e['text'],_0x2a1a1e['ispeech_tts_language']||_0x6327('0x5f'),_0x2a1a1e[_0x6327('0x82')])[_0x6327('0x12')](function(_0x20b07c){_0x19a271(null,_0x20b07c);})[_0x6327('0x14')](function(_0x115534){_0x19a271(_0x115534);});};AGIVertices['prototype'][_0x6327('0x83')]=function(_0x2e66f7,_0x376164,_0x49e42e){scripts['ispeechASR'](_0x376164,_0x2e66f7[_0x6327('0x7b')],_0x2e66f7[_0x6327('0x84')]||_0x6327('0x5f'),this[_0x6327('0x85')](_0x2e66f7[_0x6327('0x86')])?_0x2e66f7[_0x6327('0x86')]:undefined)['then'](function(_0x47808f){_0x49e42e(null,_0x47808f);})[_0x6327('0x14')](function(_0x2e18fe){_0x49e42e(_0x2e18fe);});};AGIVertices[_0x6327('0x10')][_0x6327('0x87')]=function(_0x331269,_0x348bda){scripts['awsPolly'](_0x331269[_0x6327('0x88')],_0x331269[_0x6327('0x89')],_0x331269[_0x6327('0x8a')],_0x331269[_0x6327('0x8b')]||_0x6327('0x8c'),_0x331269['text'],_0x331269['aws_text_type']||_0x6327('0x5d'))[_0x6327('0x12')](function(_0x1cf98a){_0x348bda(null,_0x1cf98a);})[_0x6327('0x14')](function(_0x44fab1){_0x348bda(_0x44fab1);});};AGIVertices[_0x6327('0x10')]['awsLex']=function(_0x7aab65,_0xde08b4){scripts[_0x6327('0x8d')](this['channel'][_0x6327('0x35')],_0x7aab65[_0x6327('0x88')],_0x7aab65[_0x6327('0x89')],_0x7aab65[_0x6327('0x8e')],_0x7aab65['text'],_0x7aab65[_0x6327('0x8f')])[_0x6327('0x12')](function(_0x18b10a){_0xde08b4(null,_0x18b10a);})[_0x6327('0x14')](function(_0x1d8a79){_0xde08b4(_0x1d8a79);});};AGIVertices[_0x6327('0x10')][_0x6327('0x90')]=function(_0x42120f,_0x1c5fcd,_0x5a3ca0){scripts[_0x6327('0x90')](_0x1c5fcd,_0x42120f['key'],_0x42120f[_0x6327('0x91')]||_0x6327('0x5f'))['then'](function(_0x1f1600){_0x5a3ca0(null,_0x1f1600);})['catch'](function(_0x45d8d0){_0x5a3ca0(_0x45d8d0);});};AGIVertices['prototype'][_0x6327('0x92')]=function(_0x59ca67,_0x213a4e,_0x495d15){scripts[_0x6327('0x92')](_0x213a4e,_0x59ca67[_0x6327('0x93')],_0x59ca67[_0x6327('0x94')],_0x59ca67['uri'])['then'](function(_0x3606d0){_0x495d15(null,_0x3606d0);})[_0x6327('0x14')](function(_0x58dbc2){_0x495d15(_0x58dbc2);});};AGIVertices[_0x6327('0x10')][_0x6327('0x95')]=function(_0x270416){var _0x5d6a16=_[_0x6327('0x68')](verticesWithRetry,_0x270416[_0x6327('0x37')])?_0x270416:_['clone'](_0x270416);for(var _0x5456b6 in _0x5d6a16){if(_0x5d6a16[_0x6327('0x96')](_0x5456b6)){if(_0x5d6a16[_0x5456b6]&&_[_0x6327('0x97')](_0x5d6a16[_0x5456b6])){if(_[_0x6327('0x68')](recursiveMapAttributes,_0x5456b6)){_0x5d6a16[_0x5456b6]=this[_0x6327('0x98')](_0x5d6a16[_0x5456b6]);}else{_0x5d6a16[_0x5456b6]=this['replaceAllVariables'](_0x5d6a16[_0x5456b6]);}}}}return _0x5d6a16;};AGIVertices[_0x6327('0x10')][_0x6327('0x99')]=function(_0x6a3ac){for(var _0x48645b in _0x6a3ac){if(_0x6a3ac[_0x6327('0x96')](_0x48645b)){if(_[_0x6327('0x9a')](_0x6a3ac[_0x48645b])){this[_0x6327('0x99')](_0x6a3ac[_0x48645b]);}else if(_[_0x6327('0x9b')](_0x6a3ac[_0x48645b])){for(var _0x254fdc=0x0;_0x254fdc<_0x6a3ac[_0x48645b][_0x6327('0x9c')];_0x254fdc++){this[_0x6327('0x99')](_0x6a3ac[_0x48645b][_0x254fdc]);}}else if(_[_0x6327('0x97')](_0x6a3ac[_0x48645b])){_0x6a3ac[_0x48645b]=this[_0x6327('0x9d')](_0x6a3ac[_0x48645b]);}}}};AGIVertices[_0x6327('0x10')][_0x6327('0x9e')]=function(_0x4a8429,_0x22085f){for(var _0x5d1b1a in _0x4a8429){if(_0x4a8429[_0x6327('0x96')](_0x5d1b1a)){if(_[_0x6327('0x9a')](_0x4a8429[_0x5d1b1a])){if(!_[_0x6327('0x42')](_0x4a8429[_0x5d1b1a])){this[_0x6327('0x9e')](_0x4a8429[_0x5d1b1a],util[_0x6327('0x28')]('%s.%s',_0x22085f,_0x5d1b1a));}}else if(_[_0x6327('0x9b')](_0x4a8429[_0x5d1b1a])){for(var _0x514e61=0x0;_0x514e61<_0x4a8429[_0x5d1b1a][_0x6327('0x9c')];_0x514e61++){this[_0x6327('0x9e')](_0x4a8429[_0x5d1b1a][_0x514e61],util[_0x6327('0x28')](_0x6327('0x9f'),_0x22085f,_0x5d1b1a+'['+_0x514e61+']'));}}else{if(!_[_0x6327('0x43')](_0x4a8429[_0x5d1b1a])){this[_0x6327('0xe')][_0x6327('0xa0')](util[_0x6327('0x28')](_0x6327('0x9f'),_0x22085f,_0x5d1b1a),_0x4a8429[_0x5d1b1a]);}}}}};AGIVertices[_0x6327('0x10')][_0x6327('0x98')]=function(_0x317cfd){try{var _0x2a3c29=JSON['parse'](_0x317cfd);this[_0x6327('0x99')](_0x2a3c29);return JSON['stringify'](_0x2a3c29);}catch(_0x5f41c3){return this[_0x6327('0x9d')](_0x317cfd);}};AGIVertices[_0x6327('0x10')][_0x6327('0x9d')]=function(_0x609e0e){var _0x552767=_0x609e0e[_0x6327('0xa1')]('{');for(var _0x4f66d6=0x1;_0x4f66d6<_0x552767['length'];_0x4f66d6+=0x1){var _0x526881=_0x552767[_0x4f66d6]['split']('}');if(_0x526881[_0x6327('0x9c')]>0x1){_0x609e0e=_0x609e0e['replaceAll']('{'+_0x526881[0x0]+'}',this[_0x6327('0xe')][_0x6327('0xa2')](_0x526881[0x0])[_0x6327('0xa3')]||_0x526881[0x0]);}}if(_0x552767['length']===0x1){return _0x609e0e[_0x6327('0x4c')]();}return this[_0x6327('0x9d')](_0x609e0e);};AGIVertices[_0x6327('0x10')]['getAndSetVariable']=function(_0x271a7c,_0x465867){var _0x2b6f00=this[_0x6327('0xe')][_0x6327('0xa2')](_0x271a7c);if(_0x2b6f00[_0x6327('0xa4')]===-0x1){return _0x2b6f00;}logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0xa5'),_0x465867,_0x2b6f00[_0x6327('0xa3')]));return this[_0x6327('0xe')]['setVariable'](_0x465867,_0x2b6f00['extra']);};AGIVertices[_0x6327('0x10')][_0x6327('0x85')]=function(_0xd7f460){return _0xd7f460&&_0xd7f460!=='0'&&_0xd7f460!=='-1'&&_0xd7f460!=='';};AGIVertices['prototype']['maxRetry']=function(_0x53df66){this[_0x6327('0x34')]['sync'](this,_0x53df66,'-');_0x53df66[_0x6327('0xa6')]=_0x53df66[_0x6327('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x6327('0xa8')]=function(_0xb303c8){logger[_0x6327('0x2d')](util['format'](_0x6327('0xa9'),_0xb303c8[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0xb303c8[_0x6327('0x5d')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xab'));}var _0x5b08fb='\x22'+_0xb303c8[_0x6327('0x5d')]+'\x22';if(this[_0x6327('0x85')](_0xb303c8[_0x6327('0x79')])){_0x5b08fb+=','+_0xb303c8[_0x6327('0x79')];}var _0x39ab7e=this[_0x6327('0xe')][_0x6327('0x58')]('MRCPSynth',_0x5b08fb);if(_0x39ab7e[_0x6327('0xa4')]===-0x1){return _0x39ab7e;}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0xac'),_0x5b08fb));};AGIVertices[_0x6327('0x10')][_0x6327('0xad')]=function(_0x20e834){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0xae'),_0x20e834[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x20e834['grammar'])){return this['channel'][_0x6327('0xaa')](_0x6327('0xaf'));}var _0x42fb18=_0x20e834[_0x6327('0xb0')];if(this[_0x6327('0x85')](_0x20e834[_0x6327('0x79')])){_0x42fb18+=','+_0x20e834[_0x6327('0x79')];}var _0x23598e=this[_0x6327('0xe')][_0x6327('0x58')]('MRCPRecog',_0x42fb18);if(_0x23598e[_0x6327('0xa4')]===-0x1){return _0x23598e;}var _0x33789a=this[_0x6327('0xb1')](_0x6327('0xb2'),_0x6327('0xb3'));if(_0x33789a[_0x6327('0xa4')]===-0x1){return _0x33789a;}var _0x9c9769=this[_0x6327('0xb1')]('RECOG_INPUT()',_0x6327('0xb4'));if(_0x9c9769[_0x6327('0xa4')]===-0x1){return _0x9c9769;}var _0x42cd3f=this['getAndSetVariable'](_0x6327('0xb5'),_0x6327('0xb6'));if(_0x42cd3f[_0x6327('0xa4')]===-0x1){return _0x42cd3f;}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0xb7'),_0x42fb18));};AGIVertices[_0x6327('0x10')][_0x6327('0x7')]=function(_0x2455f8){logger['info'](util[_0x6327('0x28')](_0x6327('0xb8'),_0x2455f8[_0x6327('0x36')]));return this[_0x6327('0xe')][_0x6327('0x7')]([_0x2455f8['command'],_0x2455f8[_0x6327('0xb9')]]);};AGIVertices['prototype'][_0x6327('0xba')]=function(_0x1dccf6){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0xbb'),_0x1dccf6[_0x6327('0x36')]));if(this['isConfigured'](_0x1dccf6['timeout'])){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1dccf6['timeout']));var _0x8ed8ce=this[_0x6327('0xe')][_0x6327('0xbc')](_0x1dccf6[_0x6327('0xbd')]);if(_0x8ed8ce['result']===-0x1){return _0x8ed8ce;}}return this[_0x6327('0xe')][_0x6327('0xba')]();};AGIVertices[_0x6327('0x10')][_0x6327('0x49')]=function(_0x1a4521){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0xbe'),_0x1a4521[_0x6327('0x36')]));if(!this['isConfigured'](_0x1a4521['list_id'])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x1a4521,_0x6327('0xbf'));}_0x1a4521['scheduledAt']=moment();if(this['isConfigured'](_0x1a4521[_0x6327('0xc0')])){_0x1a4521['scheduledAt']=moment()[_0x6327('0xc1')](_0x1a4521[_0x6327('0xc0')],_0x6327('0xc2'));}if(!this[_0x6327('0x85')](_0x1a4521[_0x6327('0x4d')])){_0x1a4521[_0x6327('0x4d')]=0x2;}this[_0x6327('0x41')][_0x6327('0x70')](this,_0x1a4521);return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x1a4521[_0x6327('0x47')],_0x1a4521[_0x6327('0x48')],_0x1a4521[_0x6327('0x4b')]));};AGIVertices[_0x6327('0x10')]['custom_app']=function(_0x155595){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0xc3'),_0x155595[_0x6327('0x36')]));var _0x44cb36=this[_0x6327('0xe')]['exec'](_0x155595[_0x6327('0xc4')],_0x155595[_0x6327('0x79')]);if(_0x44cb36[_0x6327('0xa4')]===-0x1){return _0x44cb36;}return this['channel'][_0x6327('0xaa')](util['format'](_0x6327('0xc5'),_0x155595[_0x6327('0xc4')],_0x155595[_0x6327('0x79')]));};AGIVertices['prototype'][_0x6327('0xc6')]=function(_0x37dfb3){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0xc7'),_0x37dfb3['label']));if(!this[_0x6327('0x85')](_0x37dfb3['text'])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xab'));}var _0x702aa6='\x22'+_0x37dfb3[_0x6327('0x5d')]+'\x22';if(this[_0x6327('0x85')](_0x37dfb3['options'])){_0x702aa6+=','+_0x37dfb3['options'];}var _0x337d35=this['channel'][_0x6327('0x58')](_0x6327('0xc8'),_0x702aa6);if(_0x337d35[_0x6327('0xa4')]===-0x1){return _0x337d35;}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x702aa6));};AGIVertices[_0x6327('0x10')]['sestektts']=function(_0x58cd8c){logger['info'](util[_0x6327('0x28')](_0x6327('0xc9'),_0x58cd8c['label']));if(!this[_0x6327('0x85')](_0x58cd8c[_0x6327('0x5d')])){return this['channel'][_0x6327('0xaa')](_0x6327('0xab'));}var _0x2f7f05='\x22'+_0x58cd8c[_0x6327('0x5d')]+'\x22';if(this[_0x6327('0x85')](_0x58cd8c[_0x6327('0x79')])){_0x2f7f05+=','+_0x58cd8c[_0x6327('0x79')];}var _0x28e43b=this[_0x6327('0xe')][_0x6327('0x58')](_0x6327('0xc8'),_0x2f7f05);if(_0x28e43b[_0x6327('0xa4')]===-0x1){return _0x28e43b;}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0xac'),_0x2f7f05));};AGIVertices[_0x6327('0x10')]['lumenvoxasr']=function(_0x113a50){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0xca'),_0x113a50[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x113a50[_0x6327('0xb0')])){return this[_0x6327('0xe')][_0x6327('0xaa')]('no\x20grammar\x20configured');}var _0x422d85=_0x113a50[_0x6327('0xb0')];if(this['isConfigured'](_0x113a50[_0x6327('0x79')])){_0x422d85+=','+_0x113a50['options'];}var _0x368476=this[_0x6327('0xe')][_0x6327('0x58')]('MRCPRecog',_0x422d85);if(_0x368476[_0x6327('0xa4')]===-0x1){return _0x368476;}var _0x5b0b2b=this[_0x6327('0xb1')](_0x6327('0xb2'),_0x6327('0xcb'));if(_0x5b0b2b['result']===-0x1){return _0x5b0b2b;}var _0x3c55bc=this[_0x6327('0xb1')](_0x6327('0xcc'),_0x6327('0xcd'));if(_0x3c55bc['result']===-0x1){return _0x3c55bc;}var _0x49035b=this['getAndSetVariable'](_0x6327('0xb5'),'LUMENVOX_ASR_INSTANCE');if(_0x49035b['result']===-0x1){return _0x49035b;}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0xb7'),_0x422d85));};AGIVertices['prototype']['sestekasr']=function(_0x3fc006){logger['info'](util[_0x6327('0x28')](_0x6327('0xce'),_0x3fc006['label']));if(!this[_0x6327('0x85')](_0x3fc006['grammar'])){return this[_0x6327('0xe')]['noop'](_0x6327('0xaf'));}var _0x483c28=_0x3fc006[_0x6327('0xb0')];if(this[_0x6327('0x85')](_0x3fc006[_0x6327('0x79')])){_0x483c28+=','+_0x3fc006[_0x6327('0x79')];}var _0x99ce04=this[_0x6327('0xe')]['exec'](_0x6327('0xcf'),_0x483c28);if(_0x99ce04[_0x6327('0xa4')]===-0x1){return _0x99ce04;}var _0x4ead3f=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x6327('0xd0'));if(_0x4ead3f['result']===-0x1){return _0x4ead3f;}var _0x2eec35=this[_0x6327('0xb1')](_0x6327('0xcc'),'SESTEK_ASR_TRANSCRIPT');if(_0x2eec35['result']===-0x1){return _0x2eec35;}var _0x5a23c0=this[_0x6327('0xb1')](_0x6327('0xb5'),'SESTEK_ASR_INSTANCE');if(_0x5a23c0['result']===-0x1){return _0x5a23c0;}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x483c28));};AGIVertices[_0x6327('0x10')][_0x6327('0xd1')]=function(_0x36cad5){logger['info'](util['format'](_0x6327('0xd2'),_0x36cad5[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x36cad5['odbc_id'])){return this['channel'][_0x6327('0x2b')](_0x36cad5,_0x6327('0xd3'));}var _0x57da1e=this[_0x6327('0x18')][_0x6327('0x70')](this,_0x36cad5['odbc_id']);if(!_0x57da1e){return this[_0x6327('0xe')]['error'](_0x36cad5,'no\x20odbc\x20database\x20found');}if(!this[_0x6327('0x85')](_0x36cad5[_0x6327('0xd4')])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x36cad5,_0x6327('0xd5'));}var _0x419a1a=_0x36cad5[_0x6327('0xd4')][_0x6327('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('query:\x20%s',_0x419a1a));var _0x8c6d53=this[_0x6327('0x29')][_0x6327('0x70')](this,_0x57da1e,_0x419a1a);this[_0x6327('0x34')][_0x6327('0x70')](this,_0x36cad5,_0x419a1a);if(!this[_0x6327('0x85')](_0x36cad5[_0x6327('0xd6')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xd7'));}var _0x5689da=this[_0x6327('0xa2')][_0x6327('0x70')](this,_0x36cad5['variable_id']);if(!_0x5689da){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x36cad5,_0x6327('0xd8'));}var _0xb2511b=this;_0x8c6d53['forEach'](function(_0x18e3d0,_0x208453){Object[_0x6327('0xd9')](_0x18e3d0)[_0x6327('0xda')](function(_0x130229){_0xb2511b[_0x6327('0xe')][_0x6327('0xa0')](util[_0x6327('0x28')](_0x6327('0xdb'),_0x5689da,_0x208453,_0x130229),_0x18e3d0[_0x130229]);});});this[_0x6327('0xe')][_0x6327('0xa0')](util[_0x6327('0x28')](_0x6327('0xdc'),_0x5689da),_0x8c6d53[_0x6327('0x9c')]);return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0xdd'),_0x5689da));};AGIVertices[_0x6327('0x10')][_0x6327('0xde')]=function(_0x1ecdf7){logger[_0x6327('0xdf')](util[_0x6327('0x28')](_0x6327('0xe0'),_0x1ecdf7[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x1ecdf7[_0x6327('0xe1')])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x1ecdf7,_0x6327('0xe2'));}var _0x526d09=this[_0x6327('0x1a')][_0x6327('0x70')](this,_0x1ecdf7['sip_id']);if(!_0x526d09){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x1ecdf7,_0x6327('0xe3'));}var _0x72313f=this[_0x6327('0xe')][_0x6327('0x58')](_0x6327('0xe4'),[util[_0x6327('0x28')](_0x6327('0xe5'),_0x526d09),_0x1ecdf7[_0x6327('0xbd')],_0x1ecdf7[_0x6327('0xe6')],_0x1ecdf7[_0x6327('0x65')]]);if(_0x72313f[_0x6327('0xa4')]===-0x1){return _0x72313f;}return this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')](_0x6327('0xe7'),_0x6327('0xe4')));};AGIVertices['prototype']['dialogflow']=function(_0x51ad5f){logger['info'](util[_0x6327('0x28')](_0x6327('0xe8'),_0x51ad5f[_0x6327('0x36')]));if(!this['isConfigured'](_0x51ad5f[_0x6327('0x7b')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xe9'));}if(!this[_0x6327('0x85')](_0x51ad5f[_0x6327('0x5d')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xab'));}this[_0x6327('0xe')][_0x6327('0xea')]=!![];this[_0x6327('0x34')](_0x51ad5f);this[_0x6327('0x40')](_0x51ad5f[_0x6327('0x5d')],'in','','');this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0xeb'),_0x51ad5f[_0x6327('0x5d')]));var _0x3d7eea=this[_0x6327('0x7a')][_0x6327('0x70')](this,_0x51ad5f);if(_0x3d7eea){for(var _0xb021dc in _0x3d7eea){if(_0x3d7eea[_0x6327('0x96')](_0xb021dc)){this[_0x6327('0xe')][_0x6327('0xa0')](util[_0x6327('0x28')](_0x6327('0xec'),_0xb021dc[_0x6327('0x6a')]()),_0x3d7eea[_0xb021dc]);}}this[_0x6327('0x40')](_0x3d7eea[_0x6327('0xed')],'out','dialogflow','');return this[_0x6327('0xe')][_0x6327('0xaa')](util['format'](_0x6327('0xee'),_0x3d7eea['speech']));}return this[_0x6327('0xe')]['error'](_0x51ad5f,_0x6327('0xef'));};AGIVertices[_0x6327('0x10')]['dialogflowV2']=function(_0x55ce4f){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x55ce4f['label']));if(!this[_0x6327('0x85')](_0x55ce4f[_0x6327('0xf0')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xf1'));}if(!this[_0x6327('0x85')](_0x55ce4f['client_email'])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xf2'));}if(!this[_0x6327('0x85')](_0x55ce4f[_0x6327('0x7e')])){return this['channel']['noop']('no\x20private_key\x20configured');}if(!this[_0x6327('0x85')](_0x55ce4f['dialogflowV2_language'])){return this[_0x6327('0xe')]['noop'](_0x6327('0xf3'));}if(!this[_0x6327('0x85')](_0x55ce4f[_0x6327('0x5d')])){return this[_0x6327('0xe')][_0x6327('0xaa')]('no\x20text\x20configured');}this[_0x6327('0xe')][_0x6327('0xea')]=!![];this[_0x6327('0x34')](_0x55ce4f);this[_0x6327('0x40')](_0x55ce4f['text'],'in','','');this['channel'][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0xf4'),_0x55ce4f[_0x6327('0x5d')]));var _0x11d1cd=this[_0x6327('0x7d')][_0x6327('0x70')](this,_0x55ce4f);if(_0x11d1cd){for(var _0x513c58 in _0x11d1cd){if(_0x11d1cd[_0x6327('0x96')](_0x513c58)){if(_0x513c58!==_0x6327('0xf5')){this[_0x6327('0xe')]['setVariable'](util['format'](_0x6327('0xec'),_0x513c58[_0x6327('0x6a')]()),_0x11d1cd[_0x513c58]);}}}this[_0x6327('0x40')](_0x11d1cd['speech'],'out',_0x6327('0xf6'),_0x11d1cd[_0x6327('0xf5')]);return this['channel'][_0x6327('0xaa')](util[_0x6327('0x28')]('DialogflowV2\x20Result\x20%s',_0x11d1cd[_0x6327('0xed')]));}return this[_0x6327('0xe')][_0x6327('0x2b')](_0x55ce4f,_0x6327('0xf7'));};AGIVertices[_0x6327('0x10')][_0x6327('0xf8')]=function(_0x2c2ac4){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0xf9'),_0x2c2ac4[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x2c2ac4[_0x6327('0xfa')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xfb'));}if(!this[_0x6327('0x85')](_0x2c2ac4[_0x6327('0xfc')])){return this['channel'][_0x6327('0xaa')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x2c2ac4[_0x6327('0xfd')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xfe'));}if(!this['isConfigured'](_0x2c2ac4['ndassistant_url'])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xab'));}this[_0x6327('0xe')]['bot']=!![];this[_0x6327('0x34')](_0x2c2ac4);this[_0x6327('0x40')](_0x2c2ac4['text'],'in','','');this['channel']['noop'](util[_0x6327('0x28')](_0x6327('0xff'),_0x2c2ac4[_0x6327('0x5d')]));var _0x30400b=this[_0x6327('0x80')][_0x6327('0x70')](this,_0x2c2ac4);if(_0x30400b){for(var _0x32e317 in _0x30400b){if(_0x30400b[_0x6327('0x96')](_0x32e317)){this[_0x6327('0xe')][_0x6327('0xa0')](util[_0x6327('0x28')](_0x6327('0x100'),_0x32e317[_0x6327('0x6a')]()),_0x30400b[_0x32e317]);}}this[_0x6327('0x40')](_0x30400b[_0x6327('0xed')],_0x6327('0x101'),_0x6327('0xf8'),'');if(_0x30400b[_0x6327('0x102')]){this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x103'),_0x30400b[_0x6327('0x102')]));var _0x286b4d=this['channel'][_0x6327('0x104')](_0x30400b[_0x6327('0x102')]);try{fs[_0x6327('0x105')](_0x30400b[_0x6327('0x102')]+_0x6327('0x106'));}catch(_0xedd26a){logger['error'](_0xedd26a);}return _0x286b4d;}else{return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('SestekNDA\x20Result\x20%s',_0x30400b[_0x6327('0xed')]));}}return this[_0x6327('0xe')]['error'](_0x2c2ac4,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x6327('0x10')][_0x6327('0x107')]=function(_0x30bdee){logger['info'](util[_0x6327('0x28')](_0x6327('0x108'),_0x30bdee['label']));return this['channel'][_0x6327('0xaa')](_0x6327('0x107'));};AGIVertices['prototype']['ext_dial']=function(_0x1ed0bd){logger[_0x6327('0x2d')](util['format'](_0x6327('0x109'),_0x1ed0bd[_0x6327('0x36')]));var _0x259030='';if(_0x1ed0bd[_0x6327('0x10a')]){if(!this['isConfigured'](_0x1ed0bd['trunk_id'])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x1ed0bd,_0x6327('0x10b'));}else{var _0x692b62=parseInt(_0x1ed0bd[_0x6327('0x10a')],0xa);if(isNaN(_0x692b62)){_0x259030=_0x1ed0bd[_0x6327('0x10a')];}else{_0x259030=this[_0x6327('0x1c')][_0x6327('0x70')](this,_0x1ed0bd[_0x6327('0x10a')]);if(!_0x259030){return this['channel']['error'](_0x1ed0bd,_0x6327('0x10c'));}}}}else if(_0x1ed0bd[_0x6327('0x10d')]){_0x259030=_0x1ed0bd['trunk_name'];}else{return this[_0x6327('0xe')][_0x6327('0x2b')](_0x1ed0bd,_0x6327('0x10b'));}var _0x131d76=this[_0x6327('0xe')]['exec']('DIAL',[util[_0x6327('0x28')](_0x6327('0x10e'),_0x259030,_0x1ed0bd[_0x6327('0x47')]),_0x1ed0bd[_0x6327('0xbd')],_0x1ed0bd[_0x6327('0xe6')],_0x1ed0bd[_0x6327('0x65')]]);if(_0x131d76[_0x6327('0xa4')]===-0x1){return _0x131d76;}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x6327('0x10')][_0x6327('0x10f')]=function(_0x46249e){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x46249e['label']));return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0x10f'));};AGIVertices['prototype']['getdigits']=function(_0x44592c){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x110'),_0x44592c[_0x6327('0x36')]));if(_0x44592c['retry']===0x0){return this[_0x6327('0xa7')](_0x44592c);}_0x44592c['retry']-=0x1;if(!this[_0x6327('0x85')](_0x44592c[_0x6327('0x111')])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x44592c,_0x6327('0x112'));}var _0x46e5fc=this[_0x6327('0x1e')][_0x6327('0x70')](this,_0x44592c[_0x6327('0x111')]);if(!_0x46e5fc){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x44592c,'no\x20file\x20audio\x20found');}if(!this[_0x6327('0x85')](_0x44592c[_0x6327('0xd6')])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x6327('0xd7'));}var _0x2c97aa=this[_0x6327('0xe')][_0x6327('0x113')](_0x46e5fc,_0x44592c['response'],_0x44592c['maxdigit']);var _0xea5943=_0x2c97aa[_0x6327('0xa4')]?_0x2c97aa['result']['toString']():'';logger[_0x6327('0x2d')](_0x6327('0x114'),JSON['stringify'](_0x2c97aa));if(_0x2c97aa['result']===-0x1){this[_0x6327('0x34')][_0x6327('0x70')](this,_0x44592c,_0xea5943);return _0x2c97aa;}else if(_0x2c97aa['extra']===_0x6327('0xbd')){_0x2c97aa[_0x6327('0xa4')]=_0xea5943[_0x6327('0x9c')]>=parseInt(_0x44592c[_0x6327('0x115')])?'x':'i';}else{_0x2c97aa['result']=_0xea5943['length']>=parseInt(_0x44592c[_0x6327('0x115')])&&_0xea5943[_0x6327('0x9c')]<=parseInt(_0x44592c[_0x6327('0x116')])?'x':'i';}var _0x4c83f5=this['getVariable'][_0x6327('0x70')](this,_0x44592c[_0x6327('0xd6')]);if(!_0x4c83f5){return this['channel']['error'](_0x44592c,_0x6327('0xd8'));}this[_0x6327('0xe')][_0x6327('0xa0')](_0x4c83f5,_0xea5943);if(this[_0x6327('0x85')](_0x44592c[_0x6327('0x117')])){var _0x1645d9=parseInt(_0x44592c[_0x6327('0x117')],0xa);var _0x2e200e=rs[_0x6327('0x118')]({'charset':'*','length':_0x1645d9});var _0xc82966=_0xea5943[_0x6327('0x9c')];if(_0xc82966>0x0){if(_0xc82966>_0x1645d9){this[_0x6327('0x34')]['sync'](this,_0x44592c,_0x44592c[_0x6327('0x119')]===_0x6327('0x11a')?_0x2e200e+_0xea5943['substr'](_0x1645d9):_0xea5943['substr'](0x0,_0xc82966-_0x1645d9)+_0x2e200e);}else{this[_0x6327('0x34')][_0x6327('0x70')](this,_0x44592c,rs[_0x6327('0x118')]({'charset':'*','length':_0xc82966}));}}else{this['createSquareDetailsReport'][_0x6327('0x70')](this,_0x44592c,'');}}else{this[_0x6327('0x34')][_0x6327('0x70')](this,_0x44592c,_0xea5943);}return _0x2c97aa;};AGIVertices[_0x6327('0x10')][_0x6327('0xd')]=function(_0xeb0726){logger['info'](util[_0x6327('0x28')](_0x6327('0x11b'),_0xeb0726['label']));return this[_0x6327('0xc')](_0xeb0726);};AGIVertices[_0x6327('0x10')][_0x6327('0x11c')]=function(_0x168c1f){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x11d'),_0x168c1f[_0x6327('0x36')]));this[_0x6327('0x34')][_0x6327('0x70')](this,_0x168c1f,_0x168c1f[_0x6327('0x11e')]);return this[_0x6327('0xe')][_0x6327('0xaa')](util['format'](_0x6327('0x11f'),_0x168c1f[_0x6327('0x11e')]));};AGIVertices[_0x6327('0x10')][_0x6327('0x120')]=function(_0x325ba0){logger[_0x6327('0x2d')](util['format'](_0x6327('0x121'),_0x325ba0[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x325ba0[_0x6327('0x88')])||!this[_0x6327('0x85')](_0x325ba0['aws_secret_access_key'])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0x122'));}if(!this[_0x6327('0x85')](_0x325ba0[_0x6327('0x5d')])){return this[_0x6327('0xe')]['noop'](_0x6327('0xab'));}this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')](_0x6327('0x123'),_0x325ba0[_0x6327('0x5d')]));var _0x6295f2=this[_0x6327('0x87')]['sync'](this,_0x325ba0);if(_0x6295f2){this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x124'),_0x6295f2));var _0x2e9edf=this[_0x6327('0xe')][_0x6327('0x104')](_0x6295f2);try{fs[_0x6327('0x105')](_0x6295f2+'.wav');}catch(_0x8dd5ea){logger[_0x6327('0x2b')](_0x8dd5ea);}return _0x2e9edf;}return this[_0x6327('0xe')][_0x6327('0x2b')](_0x325ba0,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x6327('0x10')][_0x6327('0x125')]=function(_0x186ed7){logger[_0x6327('0x2d')](util['format'](_0x6327('0x126'),_0x186ed7[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x186ed7[_0x6327('0x88')])||!this[_0x6327('0x85')](_0x186ed7[_0x6327('0x89')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0x122'));}if(!this[_0x6327('0x85')](_0x186ed7[_0x6327('0x8f')])){return this[_0x6327('0xe')][_0x6327('0xaa')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x186ed7[_0x6327('0x5d')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xab'));}this['channel'][_0x6327('0xea')]=!![];this[_0x6327('0x34')](_0x186ed7);this[_0x6327('0x40')](_0x186ed7[_0x6327('0x5d')],'in','','');this['channel'][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x127'),_0x186ed7[_0x6327('0x5d')]));var _0x4ace97=this[_0x6327('0x8d')][_0x6327('0x70')](this,_0x186ed7);if(_0x4ace97){for(var _0x4a1607 in _0x4ace97){if(_0x4ace97[_0x6327('0x96')](_0x4a1607)&&_['isString'](_0x4ace97[_0x4a1607])){this[_0x6327('0xe')][_0x6327('0xa0')](util[_0x6327('0x28')]('AWS_LEX_%s',_0x4a1607[_0x6327('0x6a')]()),_0x4ace97[_0x4a1607]);}}if(_[_0x6327('0x43')](_0x4ace97[_0x6327('0x77')])){return this[_0x6327('0xe')]['noop'](_0x6327('0x128'));}else{this[_0x6327('0x40')](_0x4ace97[_0x6327('0x77')],_0x6327('0x101'),_0x6327('0x129'),'');return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x12a'),_0x4ace97[_0x6327('0x77')]));}}return this[_0x6327('0xe')][_0x6327('0x2b')](_0x186ed7,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x6327('0x10')][_0x6327('0x12b')]=function(_0xad1b18){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x12c'),_0xad1b18[_0x6327('0x36')],_0xad1b18[_0x6327('0xbd')]));if(!this[_0x6327('0x85')](_0xad1b18[_0x6327('0x7b')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xe9'));}var _0x2800cf=_0x6327('0x12d');var _0xe9ba20=util['format'](_0x6327('0x12e'),FILES_PATH,rs[_0x6327('0x118')](0x4));var _0x2c80d5=util[_0x6327('0x28')](_0x6327('0x9f'),_0xe9ba20,_0x2800cf);var _0x3e73e8=!![];if(_0xad1b18[_0x6327('0x12f')]===_0x6327('0x130')){_0x3e73e8=![];}var _0x3790c2=this[_0x6327('0xe')][_0x6327('0x131')](_0xe9ba20,_0x2800cf,_0xad1b18[_0x6327('0x132')],_0xad1b18[_0x6327('0xbd')],undefined,_0x3e73e8);if(_0x3790c2[_0x6327('0xa4')]!==-0x1){this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('google\x20%s\x20file\x20created',_0x2c80d5));var _0x4ef0bf=this['googleASR'][_0x6327('0x70')](this,_0xad1b18,_0x2c80d5);if(_0x4ef0bf){for(var _0x36596f in _0x4ef0bf){if(_0x4ef0bf[_0x6327('0x96')](_0x36596f)){this[_0x6327('0xe')][_0x6327('0xa0')](util[_0x6327('0x28')](_0x6327('0x133'),_0x36596f['toUpperCase']()),_0x4ef0bf[_0x36596f]);}}return this['channel'][_0x6327('0xaa')](util[_0x6327('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0x6327('0x72')](_0x4ef0bf)));}}return _0x3790c2;};AGIVertices[_0x6327('0x10')][_0x6327('0x134')]=function(_0x1eece5){logger['info'](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x1eece5[_0x6327('0x36')]));if(!this['isConfigured'](_0x1eece5[_0x6327('0x93')])){return this[_0x6327('0xe')]['noop'](_0x6327('0x135'));}if(!this[_0x6327('0x85')](_0x1eece5[_0x6327('0x94')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0x136'));}var _0x4058e6=_0x6327('0x12d');var _0x3f9de3=util[_0x6327('0x28')](_0x6327('0x12e'),FILES_PATH,rs[_0x6327('0x118')](0x4));var _0x17625f=util[_0x6327('0x28')](_0x6327('0x9f'),_0x3f9de3,_0x4058e6);var _0x18a4ee=!![];if(_0x1eece5[_0x6327('0x12f')]===_0x6327('0x130')){_0x18a4ee=![];}var _0xc81e50=this[_0x6327('0xe')][_0x6327('0x131')](_0x3f9de3,_0x4058e6,_0x1eece5['intKey'],_0x1eece5['timeout'],undefined,_0x18a4ee);if(_0xc81e50[_0x6327('0xa4')]!==-0x1){this['channel'][_0x6327('0xaa')](util[_0x6327('0x28')]('tilde\x20%s\x20file\x20created',_0x17625f));var _0x217d60=this[_0x6327('0x92')]['sync'](this,_0x1eece5,_0x17625f);if(_0x217d60){for(var _0x352226 in _0x217d60){if(_0x217d60[_0x6327('0x96')](_0x352226)){this[_0x6327('0xe')]['setVariable'](util[_0x6327('0x28')](_0x6327('0x137'),_0x352226[_0x6327('0x6a')]()),_0x217d60[_0x352226]);}}return this['channel'][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x138'),JSON['stringify'](_0x217d60)));}}return _0xc81e50;};AGIVertices[_0x6327('0x10')][_0x6327('0x139')]=function(_0x2e8d12){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x13a'),_0x2e8d12[_0x6327('0x36')]));return this[_0x6327('0xe')][_0x6327('0x13b')](_0x2e8d12['context'],_0x2e8d12[_0x6327('0x3c')],_0x2e8d12[_0x6327('0x13c')]);};AGIVertices['prototype'][_0x6327('0x13d')]=function(_0x21db4f){logger['info'](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x21db4f[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x21db4f['condition'])){return this['channel'][_0x6327('0x2b')](_0x21db4f,_0x6327('0x13e'));}try{var _0x388ebd=eval(_0x21db4f[_0x6327('0x13f')])?_0x6327('0x140'):_0x6327('0x141');this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x142'),_0x21db4f[_0x6327('0x13f')],_0x388ebd));return{'code':0xc8,'result':_0x388ebd};}catch(_0x359fef){return{'code':0xc8,'result':_0x6327('0x141')};}};AGIVertices[_0x6327('0x10')][_0x6327('0x143')]=function(_0x800e98){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x144'),_0x800e98[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x800e98[_0x6327('0x145')])){return this['channel'][_0x6327('0x2b')](_0x800e98,_0x6327('0x146'));}var _0x240eba=this['getIntervals'][_0x6327('0x70')](this,_0x800e98['interval_id']);if(!_0x240eba){return this[_0x6327('0xe')]['error'](_0x800e98,'no\x20intervals\x20found');}for(var _0x2a60db=0x0;_0x2a60db<_0x240eba[_0x6327('0x9c')];_0x2a60db+=0x1){var _0x5f4b9a=this[_0x6327('0xe')][_0x6327('0xa2')](util[_0x6327('0x28')](_0x6327('0x147'),_0x240eba[_0x2a60db]));if(_0x5f4b9a['result']===-0x1){return _0x5f4b9a;}logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x240eba[_0x2a60db],_0x5f4b9a[_0x6327('0xa3')]));if(_0x5f4b9a[_0x6327('0xa3')]===_0x6327('0x140')){logger['info'](util[_0x6327('0x28')]('IFTIME\x20%s\x20%s',_0x240eba[_0x2a60db],_0x6327('0x140')));this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')](_0x6327('0x148'),_0x240eba[_0x2a60db],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x148'),_0x240eba[_0x2a60db],_0x6327('0x141')));this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x148'),_0x240eba[_0x2a60db],_0x6327('0x141')));}}return{'code':0xc8,'result':_0x6327('0x141')};};AGIVertices['prototype'][_0x6327('0x149')]=function(_0xfa18f9){logger['info'](util[_0x6327('0x28')](_0x6327('0x14a'),_0xfa18f9['label']));return this[_0x6327('0xe')]['hangup']();};AGIVertices['prototype'][_0x6327('0x14b')]=function(_0x19c126){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x14c'),_0x19c126[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x19c126[_0x6327('0x7b')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xe9'));}var _0x21d942='wav';var _0x2ad28f=util[_0x6327('0x28')](_0x6327('0x12e'),FILES_PATH,rs[_0x6327('0x118')](0x4));var _0x2015a7=util[_0x6327('0x28')](_0x6327('0x9f'),_0x2ad28f,_0x21d942);var _0x4a8fed=!![];if(_0x19c126[_0x6327('0x12f')]===_0x6327('0x130')){_0x4a8fed=![];}var _0x49880e=this[_0x6327('0xe')][_0x6327('0x131')](_0x2ad28f,_0x21d942,_0x19c126[_0x6327('0x132')],_0x19c126['timeout'],undefined,_0x4a8fed);if(_0x49880e[_0x6327('0xa4')]!==-0x1){this[_0x6327('0xe')]['noop'](util['format'](_0x6327('0x14d'),_0x2015a7));var _0x128d5b=this[_0x6327('0x83')][_0x6327('0x70')](this,_0x19c126,_0x2015a7);if(_0x128d5b){for(var _0x3a4258 in _0x128d5b){if(_0x128d5b[_0x6327('0x96')](_0x3a4258)){this[_0x6327('0xe')]['setVariable'](util[_0x6327('0x28')](_0x6327('0x14e'),_0x3a4258[_0x6327('0x6a')]()),_0x128d5b[_0x3a4258]);}}return this[_0x6327('0xe')][_0x6327('0xaa')](util['format'](_0x6327('0x14f'),JSON[_0x6327('0x72')](_0x128d5b)));}}return _0x49880e;};AGIVertices[_0x6327('0x10')][_0x6327('0x150')]=function(_0x218aea){logger['info'](util[_0x6327('0x28')](_0x6327('0x151'),_0x218aea[_0x6327('0x36')]));if(!this['isConfigured'](_0x218aea[_0x6327('0x7b')])){return this['channel'][_0x6327('0xaa')]('no\x20key\x20configured');}if(!this[_0x6327('0x85')](_0x218aea[_0x6327('0x5d')])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xab'));}this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x152'),_0x218aea['text']));var _0x32e0d2=this[_0x6327('0x81')][_0x6327('0x70')](this,_0x218aea);if(_0x32e0d2){this['channel']['noop'](util[_0x6327('0x28')](_0x6327('0x14d'),_0x32e0d2));var _0x3f95e3=this[_0x6327('0xe')][_0x6327('0x104')](_0x32e0d2,_0x218aea[_0x6327('0x132')]);try{fs[_0x6327('0x105')](_0x32e0d2+_0x6327('0x106'));}catch(_0xeb6482){logger[_0x6327('0x2b')](_0xeb6482);}return _0x3f95e3;}return this[_0x6327('0xe')][_0x6327('0x2b')](_0x218aea,_0x6327('0x153'));};AGIVertices[_0x6327('0x10')][_0x6327('0x154')]=function(_0x250aa7){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x250aa7[_0x6327('0x36')]));if(!this['isConfigured'](_0x250aa7[_0x6327('0x155')])){return this[_0x6327('0xe')]['error'](_0x250aa7,_0x6327('0x156'));}logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x157'),this[_0x6327('0xe')]['callerid'],_0x250aa7[_0x6327('0x155')]));var _0x2b5ead=this[_0x6327('0x54')]['sync'](this,_0x250aa7['findBy']);if(_0x2b5ead){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x158'),this[_0x6327('0xe')][_0x6327('0x39')],_0x250aa7[_0x6327('0x155')]));this[_0x6327('0xe')][_0x6327('0xaa')](util['format'](_0x6327('0x158'),this[_0x6327('0xe')]['callerid'],_0x250aa7[_0x6327('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x159'),this['channel'][_0x6327('0x39')],_0x250aa7[_0x6327('0x155')]));this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x159'),this[_0x6327('0xe')][_0x6327('0x39')],_0x250aa7[_0x6327('0x155')]));return{'code':0xc8,'result':_0x6327('0x15a')};}};AGIVertices['prototype']['logout']=function(_0x2fc505){logger['info'](util[_0x6327('0x28')](_0x6327('0x15b'),_0x2fc505[_0x6327('0x36')]));if(!this['isConfigured'](_0x2fc505[_0x6327('0x155')])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x2fc505,_0x6327('0x156'));}logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x157'),this[_0x6327('0xe')][_0x6327('0x39')],_0x2fc505['findBy']));var _0x155bfa=this[_0x6327('0x53')][_0x6327('0x70')](this,_0x2fc505[_0x6327('0x155')]);if(_0x155bfa){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x6327('0x39')],_0x2fc505['findBy']));this['channel'][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x158'),this[_0x6327('0xe')][_0x6327('0x39')],_0x2fc505[_0x6327('0x155')]));return{'code':0xc8,'result':_0x6327('0x15c')};}else{logger[_0x6327('0x2d')](util['format'](_0x6327('0x159'),this[_0x6327('0xe')][_0x6327('0x39')],_0x2fc505[_0x6327('0x155')]));this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')](_0x6327('0x159'),this[_0x6327('0xe')]['callerid'],_0x2fc505[_0x6327('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6327('0x10')]['math']=function(_0x3febfd){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x15d'),_0x3febfd['label']));if(!this[_0x6327('0x85')](_0x3febfd[_0x6327('0x15e')])){return this['channel']['error'](_0x3febfd,_0x6327('0x15f'));}this[_0x6327('0xe')][_0x6327('0xaa')](util['format'](_0x6327('0x160'),_0x3febfd['operation']));var _0x13da56=eval(_0x3febfd['operation']);if(!this[_0x6327('0x85')](_0x3febfd[_0x6327('0xd6')])){return this['channel'][_0x6327('0xaa')](_0x6327('0xd7'));}var _0x237254=this[_0x6327('0xa2')]['sync'](this,_0x3febfd['variable_id']);if(!_0x237254){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x3febfd,_0x6327('0xd8'));}if(_['isArray'](_0x13da56)){var _0x656ea1=this;_0x13da56[_0x6327('0xda')](function(_0x9b3e34,_0x50afd1){_0x656ea1['channel'][_0x6327('0xa0')](util['format']('%s[%s]',_0x237254,_0x50afd1),_0x9b3e34);});return this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')](_0x6327('0x161'),_0x237254));}else{return this[_0x6327('0xe')][_0x6327('0xa0')](_0x237254,_0x13da56);}};AGIVertices[_0x6327('0x10')][_0x6327('0xb')]=function(_0x360e1a){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x162'),_0x360e1a['label']));if(_0x360e1a['retry']===0x0){return this[_0x6327('0xa7')](_0x360e1a);}_0x360e1a[_0x6327('0xa6')]-=0x1;if(!this[_0x6327('0x85')](_0x360e1a['file_id'])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x360e1a,_0x6327('0x112'));}var _0x26c8ca=this['getSound'][_0x6327('0x70')](this,_0x360e1a[_0x6327('0x111')]);if(!_0x26c8ca){return this['channel'][_0x6327('0x2b')](_0x360e1a,_0x6327('0x163'));}var _0x1aed43=this['channel'][_0x6327('0x113')](_0x26c8ca,_0x360e1a[_0x6327('0x164')],_0x360e1a[_0x6327('0x165')]);var _0x1348c1=_0x1aed43[_0x6327('0xa4')];if(_0x1aed43[_0x6327('0xa4')]===-0x1){this['createSquareDetailsReport'][_0x6327('0x70')](this,_0x360e1a,'-1');return _0x1aed43;}else if(_0x1aed43[_0x6327('0xa3')]===_0x6327('0xbd')){_0x1aed43['result']=_0x1aed43['result'][_0x6327('0x9c')]>0x0?_0x1aed43[_0x6327('0xa4')]:'t';}else if(_[_0x6327('0x42')](_0x1aed43[_0x6327('0xa4')])){_0x1aed43[_0x6327('0xa4')]='#';_0x1348c1='#';}if(!this['isConfigured'](_0x360e1a[_0x6327('0xd6')])){this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xd7'));}else{var _0x482a57=this[_0x6327('0xa2')][_0x6327('0x70')](this,_0x360e1a[_0x6327('0xd6')]);if(!_0x482a57){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x360e1a,_0x6327('0xd8'));}this[_0x6327('0xe')][_0x6327('0xa0')](_0x482a57,_0x1348c1);}this['createSquareDetailsReport'][_0x6327('0x70')](this,_0x360e1a,_0x1348c1);return _0x1aed43;};AGIVertices[_0x6327('0x10')][_0x6327('0xaa')]=function(_0x33931d){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x33931d[_0x6327('0x36')]));return this[_0x6327('0xe')]['noop'](_0x33931d[_0x6327('0x166')]||_0x33931d['label']);};AGIVertices[_0x6327('0x10')][_0x6327('0x167')]=function(_0x29bb84){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x168'),_0x29bb84[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x29bb84['findBy'])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x29bb84,_0x6327('0x156'));}logger[_0x6327('0x2d')](util[_0x6327('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6327('0xe')][_0x6327('0x39')],_0x29bb84[_0x6327('0x155')]));var _0x281007=this[_0x6327('0x4e')][_0x6327('0x70')](this,_0x29bb84['pause_id']);var _0x206204=this[_0x6327('0x50')]['sync'](this,_0x29bb84[_0x6327('0x155')],_0x281007);if(_0x206204){logger['info'](util[_0x6327('0x28')](_0x6327('0x158'),this[_0x6327('0xe')][_0x6327('0x39')],_0x29bb84[_0x6327('0x155')]));this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6327('0xe')][_0x6327('0x39')],_0x29bb84['findBy']));return{'code':0xc8,'result':_0x6327('0x15c')};}else{logger['info'](util['format'](_0x6327('0x159'),this[_0x6327('0xe')][_0x6327('0x39')],_0x29bb84[_0x6327('0x155')]));this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')](_0x6327('0x158'),this[_0x6327('0xe')]['callerid'],_0x29bb84['findBy']));return{'code':0xc8,'result':_0x6327('0x15a')};}};AGIVertices[_0x6327('0x10')][_0x6327('0x169')]=function(_0x546e37){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x546e37['label']));if(!this[_0x6327('0x85')](_0x546e37[_0x6327('0x111')])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x546e37,'no\x20file\x20audio\x20selected');}var _0x12caf0=this[_0x6327('0x1e')][_0x6327('0x70')](this,_0x546e37['file_id']);if(!_0x12caf0){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x546e37,_0x6327('0x163'));}var _0x4ec9ef=this[_0x6327('0xe')][_0x6327('0x58')]('PLAYBACK',[_0x12caf0,_0x546e37[_0x6327('0xe6')]]);if(_0x4ec9ef[_0x6327('0xa4')]===-0x1){return _0x4ec9ef;}return this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')](_0x6327('0xc5'),_0x6327('0x16a'),_0x12caf0));};AGIVertices[_0x6327('0x10')]['queue']=function(_0x54e780){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x54e780[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x54e780['queue_id'])){return this['channel']['error'](_0x54e780,_0x6327('0x16b'));}var _0x34daa6='';var _0x2f5f23=parseInt(_0x54e780[_0x6327('0x16c')],0xa);if(isNaN(_0x2f5f23)){_0x34daa6=_0x54e780[_0x6327('0x16c')];}else{_0x34daa6=this['getVoiceQueue']['sync'](this,_0x54e780[_0x6327('0x16c')]);if(!_0x34daa6){return this[_0x6327('0xe')]['error'](_0x54e780,_0x6327('0x16d'));}}var _0x23ee18='';if(this[_0x6327('0x85')](_0x54e780['file_id'])){var _0x1b931b=this[_0x6327('0x1e')][_0x6327('0x70')](this,_0x54e780[_0x6327('0x111')]);if(_0x1b931b){_0x23ee18=_0x1b931b;}}this['createSquareDetailsReport']['sync'](this,_0x54e780,_0x34daa6);if(_0x54e780['opts'][_0x6327('0x16e')]('x')<0x0){_0x54e780[_0x6327('0xe6')]+='x';}if(_0x54e780[_0x6327('0xe6')]['indexOf']('X')<0x0){_0x54e780[_0x6327('0xe6')]+='X';}this[_0x6327('0xe')][_0x6327('0xa0')](_0x6327('0x16f'),_0x34daa6?_0x34daa6[_0x6327('0x170')]():'');var _0x32c768=this['channel'][_0x6327('0x58')](_0x6327('0x171'),[_0x34daa6,_0x54e780[_0x6327('0xe6')],_0x54e780[_0x6327('0x65')],_0x23ee18,_0x54e780[_0x6327('0xbd')],_0x54e780[_0x6327('0x7')],_0x54e780[_0x6327('0x172')],_0x54e780[_0x6327('0x173')],'',_0x54e780['position']]);if(_0x32c768[_0x6327('0xa4')]===-0x1){return _0x32c768;}return this[_0x6327('0xe')][_0x6327('0xaa')](util['format'](_0x6327('0xc5'),'QUEUE',_0x34daa6));};AGIVertices[_0x6327('0x10')][_0x6327('0x174')]=function(_0x1bc3a9){logger['info'](util['format'](_0x6327('0x175'),_0x1bc3a9[_0x6327('0x36')]));var _0x13871f=_0x1bc3a9[_0x6327('0x176')]||_0x6327('0x12d');var _0xd1d3ed=util[_0x6327('0x28')](_0x6327('0x177'),this['channel'][_0x6327('0x35')],rs['generate'](0x5));var _0x3620cd=util[_0x6327('0x28')](_0x6327('0x178'),FILES_PATH,_0xd1d3ed,_0x13871f);var _0x2a2830=util['format'](_0x6327('0x12e'),FILES_PATH,_0xd1d3ed);this[_0x6327('0x3a')][_0x6327('0x70')](this,_0x1bc3a9,_0xd1d3ed,_0x3620cd);this[_0x6327('0xe')][_0x6327('0xa0')](_0x6327('0x179'),_0xd1d3ed);logger[_0x6327('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x2a2830,_0x13871f,_0x1bc3a9['escape_digits'],_0x1bc3a9['timeout']);return this[_0x6327('0xe')][_0x6327('0x131')](_0x2a2830,_0x13871f,_0x1bc3a9['escape_digits'],_0x1bc3a9[_0x6327('0xbd')],undefined,!![]);};AGIVertices['prototype'][_0x6327('0x17a')]=function(_0x2e8dbd){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x2e8dbd['label']));if(!this[_0x6327('0x85')](_0x2e8dbd[_0x6327('0x65')])){return this[_0x6327('0xe')]['noop'](_0x6327('0x17b'));}var _0x41290d=this['restAPI'][_0x6327('0x70')](this,_0x2e8dbd);logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x17c'),util[_0x6327('0x17d')](_0x41290d,{'showHidden':![],'depth':null})));if(!this[_0x6327('0x85')](_0x2e8dbd[_0x6327('0xd6')])){return this[_0x6327('0xe')]['noop'](_0x6327('0x17e'));}var _0xf344cd=this[_0x6327('0xa2')]['sync'](this,_0x2e8dbd[_0x6327('0xd6')]);if(!_0xf344cd){return this['channel'][_0x6327('0x2b')](_0x2e8dbd,_0x6327('0xd8'));}this['channel'][_0x6327('0xa0')](util[_0x6327('0x28')](_0x6327('0x17f'),_0xf344cd),_0x41290d[_0x6327('0x75')]?_0x41290d[_0x6327('0x75')]:'200');this['channel'][_0x6327('0xa0')](util[_0x6327('0x28')]('%s_STATUS_MESSAGE',_0xf344cd),_0x41290d[_0x6327('0x76')]?_0x41290d[_0x6327('0x76')]:'OK');if(_0x41290d[_0x6327('0x6b')]){try{this['saveRestApiResult'](_0x41290d['body'],_0xf344cd);}catch(_0x5f414c){logger['error'](util['format'](_0x6327('0x180'),_0xf344cd));}}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0xdd'),_0xf344cd));};AGIVertices[_0x6327('0x10')]['saydigits']=function(_0x1a96a2){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x181'),_0x1a96a2[_0x6327('0x36')]));return this['channel'][_0x6327('0x182')](_0x1a96a2[_0x6327('0x183')][_0x6327('0x5a')](/\s+/g,''),_0x1a96a2[_0x6327('0x184')]);};AGIVertices['prototype'][_0x6327('0x185')]=function(_0x5016ef){logger[_0x6327('0x2d')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x5016ef[_0x6327('0x36')]));return this[_0x6327('0xe')][_0x6327('0x186')](_0x5016ef[_0x6327('0x67')][_0x6327('0x5a')](/\s+/g,''),_0x5016ef[_0x6327('0x184')]);};AGIVertices[_0x6327('0x10')][_0x6327('0x187')]=function(_0x294d9c){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x188'),_0x294d9c[_0x6327('0x36')]));return this[_0x6327('0xe')]['sayPhonetic'](_0x294d9c[_0x6327('0x5d')],_0x294d9c[_0x6327('0x184')]);};AGIVertices['prototype'][_0x6327('0x189')]=function(_0x257d1f){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x18a'),_0x257d1f['label']));if(!this[_0x6327('0x85')](_0x257d1f['account_id'])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0x18b'));}var _0x2bc968=this[_0x6327('0x18c')][_0x6327('0x70')](this,_0x257d1f['account_id']);if(!_0x2bc968||!_0x2bc968[_0x6327('0x18d')]){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x257d1f,_0x6327('0x18e'));}var _0x3d25fc={'from':util[_0x6327('0x28')](_0x6327('0x18f'),_0x2bc968['name'],_0x2bc968[_0x6327('0x190')]||_0x2bc968[_0x6327('0x18d')][_0x6327('0x191')]),'to':_0x257d1f['to']||'','cc':_0x257d1f['cc']||'','bcc':_0x257d1f[_0x6327('0x192')]||'','subject':_0x257d1f[_0x6327('0x193')],'html':_0x257d1f[_0x6327('0x5d')],'text':_0x257d1f[_0x6327('0x5d')]};if(this[_0x6327('0x85')](_0x257d1f[_0x6327('0x194')])){}logger[_0x6327('0xdf')](_0x6327('0x195'),JSON[_0x6327('0x72')](_0x3d25fc));this[_0x6327('0x34')][_0x6327('0x70')](this,_0x257d1f,_0x257d1f[_0x6327('0x196')]);this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')](_0x6327('0x197'),_0x2bc968['name']));this[_0x6327('0x23')][_0x6327('0x70')](this,_0x2bc968[_0x6327('0x198')],_0x3d25fc);return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0x199'));};AGIVertices[_0x6327('0x10')]['sendFax']=function(_0x28f463){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x28f463['label']));return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0x19a'));};AGIVertices[_0x6327('0x10')][_0x6327('0x19b')]=function(_0x291baa){logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x19c'),_0x291baa['label']));if(!this[_0x6327('0x85')](_0x291baa['sms_account_id'])){return this[_0x6327('0xe')][_0x6327('0xaa')]('no\x20sms\x20account\x20configured');}var _0x25d56d=this[_0x6327('0x32')]['sync'](this,_0x291baa['sms_account_id']);if(!_0x25d56d){return this[_0x6327('0xe')]['error'](_0x291baa,_0x6327('0x19d'));}var _0x62faf6={'body':_0x291baa[_0x6327('0x19e')],'phone':_0x291baa['to']||'','SmsAccountId':_0x25d56d['id']};logger['debug'](_0x6327('0x19f'),JSON[_0x6327('0x72')](_0x62faf6));this[_0x6327('0x34')][_0x6327('0x70')](this,_0x291baa,_0x291baa[_0x6327('0x1a0')]);this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x25d56d[_0x6327('0x13')]));this[_0x6327('0x33')][_0x6327('0x70')](this,_0x62faf6);return this['channel'][_0x6327('0xaa')](_0x6327('0x1a1'));};AGIVertices[_0x6327('0x10')][_0x6327('0x1a2')]=function(_0x402d9c){logger[_0x6327('0x2d')](util['format'](_0x6327('0x1a3'),_0x402d9c['label']));if(!this['isConfigured'](_0x402d9c[_0x6327('0xd6')])){return this[_0x6327('0xe')]['error'](_0x402d9c,_0x6327('0x1a4'));}var _0x2d5e46=this['getVariable']['sync'](this,_0x402d9c['variable_id']);if(!_0x2d5e46){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x402d9c,_0x6327('0xd8'));}return this['channel'][_0x6327('0xa0')](_0x2d5e46,_0x402d9c[_0x6327('0x1a5')]);};AGIVertices[_0x6327('0x10')][_0x6327('0x1a6')]=function(_0x439ca3){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Enter\x20in\x20START\x20(%s)\x20block',_0x439ca3[_0x6327('0x36')]));this[_0x6327('0xe')]['noop'](_0x6327('0x1a7'));if(_0x439ca3[_0x6327('0xba')]==='yes'){this[_0x6327('0xe')]['noop'](_0x6327('0x1a8'));return this['channel'][_0x6327('0xba')]();}return this[_0x6327('0xe')]['noop']('Skipped\x20Answer');};AGIVertices[_0x6327('0x10')][_0x6327('0x1a9')]=function(_0x12844e){logger['info'](util[_0x6327('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x12844e[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x12844e[_0x6327('0x1aa')])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x12844e,'no\x20subproject\x20selected');}var _0x511fb3=this[_0x6327('0x16')][_0x6327('0x70')](this,_0x12844e[_0x6327('0x1aa')]);if(!this[_0x6327('0x85')](_0x511fb3)){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x12844e,util[_0x6327('0x28')](_0x6327('0x1ab'),_0x12844e[_0x6327('0x1aa')]));}if(_0x511fb3===this['channel']['arg_1']){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x12844e,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x6327('0x34')]['sync'](this,_0x12844e,_0x511fb3);var _0x2db59a=this[_0x6327('0xe')][_0x6327('0x58')](_0x6327('0x1ac'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||_0x6327('0x1ad'),_0x511fb3,this[_0x6327('0xe')][_0x6327('0x38')]));if(_0x2db59a[_0x6327('0xa4')]===-0x1){return _0x2db59a;}return this['channel']['noop'](util[_0x6327('0x28')](_0x6327('0xc5'),_0x6327('0x1ac'),_0x511fb3));};AGIVertices[_0x6327('0x10')][_0x6327('0x1ae')]=function(_0x356aad){logger['info'](util[_0x6327('0x28')](_0x6327('0x1af'),_0x356aad[_0x6327('0x36')]));var _0x28e1ce=this['shellCommand']['sync'](this,_0x356aad[_0x6327('0x1b0')]);this[_0x6327('0x34')][_0x6327('0x70')](this,_0x356aad,_0x356aad[_0x6327('0x1b0')]);if(this[_0x6327('0x85')](_0x356aad[_0x6327('0xd6')])){var _0x1ddd27=this[_0x6327('0xa2')]['sync'](this,_0x356aad[_0x6327('0xd6')]);if(_0x1ddd27){this[_0x6327('0xe')][_0x6327('0xa0')](_0x1ddd27,_0x28e1ce);return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x1b1'),_0x356aad[_0x6327('0x1b0')],_0x1ddd27));}}return this['channel'][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x1b2'),_0x356aad[_0x6327('0x1b0')]));};AGIVertices[_0x6327('0x10')][_0x6327('0x1b3')]=function(_0x2d7647){logger[_0x6327('0x2d')](util[_0x6327('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2d7647['label']));_0x2d7647['text']=_0x2d7647[_0x6327('0x5d')][_0x6327('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6327('0x85')](_0x2d7647[_0x6327('0x5c')])){return this[_0x6327('0xe')][_0x6327('0xaa')]('no\x20apiKey\x20configured');}if(!this[_0x6327('0x85')](_0x2d7647['text'])){return this[_0x6327('0xe')][_0x6327('0xaa')](_0x6327('0xab'));}this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x1b4'),_0x2d7647[_0x6327('0x5d')]));var _0x3a5f12=this[_0x6327('0x5b')][_0x6327('0x70')](this,_0x2d7647);if(_0x3a5f12){this[_0x6327('0xe')]['noop'](util[_0x6327('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3a5f12));var _0xd99f8=this[_0x6327('0xe')][_0x6327('0x104')](_0x3a5f12);try{fs[_0x6327('0x105')](_0x3a5f12+_0x6327('0x106'));}catch(_0x5db082){logger[_0x6327('0x2b')](_0x5db082);}return _0xd99f8;}return this[_0x6327('0xe')][_0x6327('0x2b')](_0x2d7647,_0x6327('0x1b5'));};AGIVertices['prototype'][_0x6327('0x1b6')]=function(_0x27cdd3){logger['info'](util[_0x6327('0x28')](_0x6327('0x1b7'),_0x27cdd3[_0x6327('0x36')]));_0x27cdd3[_0x6327('0x5d')]=_0x27cdd3[_0x6327('0x5d')][_0x6327('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6327('0x85')](_0x27cdd3[_0x6327('0x5d')])){return this[_0x6327('0xe')][_0x6327('0xaa')]('no\x20text\x20configured');}this[_0x6327('0xe')]['noop'](util['format']('Trying\x20Google\x20TTS\x20%s',_0x27cdd3[_0x6327('0x5d')]));var _0x2640a8=this['googleTTS'][_0x6327('0x70')](this,_0x27cdd3);if(_0x2640a8){this[_0x6327('0xe')]['noop'](util['format'](_0x6327('0x1b8'),_0x2640a8));var _0x3692fa=this[_0x6327('0xe')][_0x6327('0x104')](_0x2640a8);try{fs[_0x6327('0x105')](_0x2640a8+_0x6327('0x106'));}catch(_0x17c4c1){logger[_0x6327('0x2b')](_0x17c4c1);}return _0x3692fa;}return this[_0x6327('0xe')][_0x6327('0x2b')](_0x27cdd3,_0x6327('0x1b9'));};AGIVertices['prototype']['unpause']=function(_0x1c6d8a){logger[_0x6327('0x2d')](util['format'](_0x6327('0x1ba'),_0x1c6d8a[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x1c6d8a['findBy'])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x1c6d8a,_0x6327('0x156'));}logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x157'),this['channel'][_0x6327('0x39')],_0x1c6d8a[_0x6327('0x155')]));var _0x5d1629=this[_0x6327('0x52')][_0x6327('0x70')](this,_0x1c6d8a[_0x6327('0x155')]);if(_0x5d1629){logger[_0x6327('0x2d')](util['format'](_0x6327('0x158'),this['channel'][_0x6327('0x39')],_0x1c6d8a[_0x6327('0x155')]));this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x158'),this[_0x6327('0xe')]['callerid'],_0x1c6d8a['findBy']));return{'code':0xc8,'result':_0x6327('0x15c')};}else{logger[_0x6327('0x2d')](util[_0x6327('0x28')](_0x6327('0x159'),this[_0x6327('0xe')][_0x6327('0x39')],_0x1c6d8a[_0x6327('0x155')]));this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')](_0x6327('0x159'),this[_0x6327('0xe')]['callerid'],_0x1c6d8a[_0x6327('0x155')]));return{'code':0xc8,'result':_0x6327('0x15a')};}};AGIVertices[_0x6327('0x10')][_0x6327('0x1bb')]=function(_0x47f2b5){logger[_0x6327('0x2d')](util['format'](_0x6327('0x1bc'),_0x47f2b5['label']));var _0x57e7ea=this[_0x6327('0xe')]['exec'](_0x6327('0x1bd'),[_0x47f2b5[_0x6327('0x1be')],_0x47f2b5[_0x6327('0x79')]]);if(_0x57e7ea[_0x6327('0xa4')]===-0x1){return _0x57e7ea;}return this[_0x6327('0xe')][_0x6327('0xaa')](util[_0x6327('0x28')]('Executed\x20command\x20%s\x20%s',_0x6327('0x1bd'),_0x47f2b5[_0x6327('0x1be')]));};AGIVertices[_0x6327('0x10')][_0x6327('0x1bf')]=function(_0x49c326){logger[_0x6327('0x2d')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x49c326[_0x6327('0x36')]));if(!this[_0x6327('0x85')](_0x49c326[_0x6327('0xd6')])){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x49c326,_0x6327('0x1a4'));}var _0x5bcbef=this[_0x6327('0xa2')][_0x6327('0x70')](this,_0x49c326[_0x6327('0xd6')]);if(!_0x5bcbef){return this[_0x6327('0xe')][_0x6327('0x2b')](_0x49c326,_0x6327('0xd8'));}var _0xbd03d3=this['channel'][_0x6327('0xa2')](_0x5bcbef);return{'code':0xc8,'result':_0xbd03d3['extra']?_0xbd03d3[_0x6327('0xa3')]:'-'};};String[_0x6327('0x10')]['replaceAll']=function(_0x583566,_0x54d31c){return this[_0x6327('0xa1')](_0x583566)[_0x6327('0x1c0')](_0x54d31c);};module['exports']=AGIVertices; \ No newline at end of file +var _0xb10d=['error','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleCloudTTS','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','isArray','length','setVariable','split','replaceAll','extra','getAndSetVariable','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','no\x20text\x20configured','lumenvoxasr','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','streamFile','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','wav','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','findBy','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','response','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','failure','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','macro','gosub','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','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','replace','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','Smtp','user','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','smtpOptions','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','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','AGI','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','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','success','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','dnid','file','createSquareMessage','uniqueid','createCmContact','isNil','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0xb10d,0x17f));var _0xdb10=function(_0x134f7d,_0x4191d9){_0x134f7d=_0x134f7d-0x0;var _0x3d2236=_0xb10d[_0x134f7d];return _0x3d2236;};'use strict';var fs=require('fs');var util=require(_0xdb10('0x0'));var _=require('lodash');var sh=require(_0xdb10('0x1'));var odbc=require(_0xdb10('0x2'))();var rs=require(_0xdb10('0x3'));var moment=require(_0xdb10('0x4'));var Mustache=require(_0xdb10('0x5'));var rp=require(_0xdb10('0x6'));var logger=require(_0xdb10('0x7'))(_0xdb10('0x8'));var config=require(_0xdb10('0x9'));var shared=require(_0xdb10('0xa'));var scripts=require(_0xdb10('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xdb10('0xc'),_0xdb10('0xd')];var verticesWithRetry=[_0xdb10('0xe'),_0xdb10('0xf'),_0xdb10('0x10')];var AGIVertices=function(_0x2c4d96,_0x376b42,_0x1cad13){this[_0xdb10('0x11')]=_0x2c4d96;this[_0xdb10('0x12')]=_0x376b42;this[_0xdb10('0x13')]=_0x1cad13;};AGIVertices[_0xdb10('0x14')][_0xdb10('0x15')]=function(_0x318755,_0x1b82a3){this[_0xdb10('0x12')][_0xdb10('0x16')](_0x318755)[_0xdb10('0x17')](function(_0x36bad8){_0x1b82a3(null,_0x36bad8?_0x36bad8[_0xdb10('0x18')]:![]);})[_0xdb10('0x19')](function(_0x21d1ec){_0x1b82a3(_0x21d1ec);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x1a')]=function(_0x4a6978,_0x30b302){this[_0xdb10('0x12')][_0xdb10('0x1b')](_0x4a6978)[_0xdb10('0x17')](function(_0x260d18){_0x30b302(null,_0x260d18?_0x260d18[_0xdb10('0x18')]:![]);})['catch'](function(_0x161e0d){_0x30b302(_0x161e0d);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x1c')]=function(_0x4431e5,_0xbce3f1){this['rpc'][_0xdb10('0x1d')](_0x4431e5)['then'](function(_0xbf36da){_0xbce3f1(null,_0xbf36da?_0xbf36da['name']:![]);})[_0xdb10('0x19')](function(_0xe1d26e){_0xbce3f1(_0xe1d26e);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x1e')]=function(_0x5ec280,_0x3d8fd5){this[_0xdb10('0x12')][_0xdb10('0x1f')](_0x5ec280)[_0xdb10('0x17')](function(_0x5b7409){_0x3d8fd5(null,_0x5b7409?_0x5b7409[_0xdb10('0x20')]:![]);})[_0xdb10('0x19')](function(_0x373964){_0x3d8fd5(_0x373964);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x21')]=function(_0x2b6244,_0x145497){this[_0xdb10('0x12')][_0xdb10('0x22')](_0x2b6244)['then'](function(_0x11a34b){_0x145497(null,_0x11a34b?_0x11a34b[_0xdb10('0x18')]:![]);})['catch'](function(_0x249e94){_0x145497(_0x249e94);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x23')]=function(_0x3d5a18,_0x4a4bc2){this['rpc'][_0xdb10('0x24')](_0x3d5a18)['then'](function(_0x2d67aa){_0x4a4bc2(null,_0x2d67aa?_0x2d67aa[_0xdb10('0x18')]:![]);})[_0xdb10('0x19')](function(_0x4db7ba){_0x4a4bc2(_0x4db7ba);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x25')]=function(_0xb5677,_0xbccd7a){var _0xfa20a0=this;this[_0xdb10('0x12')][_0xdb10('0x26')](_0xb5677)[_0xdb10('0x17')](function(_0xa48d52){_0xbccd7a(null,_0xa48d52?_0xfa20a0[_0xdb10('0x27')](_0xa48d52[_0xdb10('0x28')]):![]);})[_0xdb10('0x19')](function(_0x3073de){_0xbccd7a(_0x3073de);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x29')]=function(_0xfa535a,_0x4a68a9){this[_0xdb10('0x12')][_0xdb10('0x2a')](_0xfa535a)[_0xdb10('0x17')](function(_0x230914){_0x4a68a9(null,_0x230914?_0x230914:![]);})[_0xdb10('0x19')](function(_0x46b0d9){_0x4a68a9(_0x46b0d9);});};AGIVertices[_0xdb10('0x14')]['sendMailMessage']=function(_0x1b2d93,_0x211527,_0x19e1d1){this['mailRpc']['sendMailMessage'](_0x1b2d93,_0x211527)['then'](function(){_0x19e1d1(null);})['catch'](function(_0x3891ea){_0x19e1d1(_0x3891ea);});};AGIVertices[_0xdb10('0x14')]['getIntervals']=function(_0x5c738f,_0x510be0){this[_0xdb10('0x12')]['getIntervalById'](_0x5c738f)[_0xdb10('0x17')](function(_0x391021){if(_0x391021){if(_0x391021['IntervalId']){_0x510be0(null,[_0x391021[_0xdb10('0x2b')]]);}else{_0x510be0(null,_[_0xdb10('0x2c')](_0x391021[_0xdb10('0x2d')],'interval'));}}else{_0x510be0(null,![]);}})[_0xdb10('0x19')](function(_0xc399ab){_0x510be0(_0xc399ab);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x27')]=function(_0x1c3365){return util[_0xdb10('0x2e')](_0xdb10('0x2f'),FILES_PATH,_0x1c3365);};AGIVertices[_0xdb10('0x14')][_0xdb10('0x30')]=function(_0x46701b,_0x3174f8,_0xa12d39){odbc[_0xdb10('0x31')](_0x46701b,function(_0x2e8718){if(_0x2e8718){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2e8718);_0xa12d39(_0x2e8718);}else{logger[_0xdb10('0x32')](_0xdb10('0x33'));odbc[_0xdb10('0x34')](_0x3174f8,function(_0x1f0e9e,_0x1ffe17){if(_0x1f0e9e){logger[_0xdb10('0x32')](_0xdb10('0x35'),_0x3174f8);_0xa12d39(_0x1f0e9e);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x3174f8);odbc[_0xdb10('0x36')](function(_0x4c8743){if(_0x4c8743){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4c8743);}_0xa12d39(null,_0x1ffe17);});}});}});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x37')]=function(_0x37e96b,_0x5d2c0a){this[_0xdb10('0x12')][_0xdb10('0x38')](_0x37e96b)[_0xdb10('0x17')](function(_0x3ee7f0){_0x5d2c0a(null,_0x3ee7f0?_0x3ee7f0:![]);})[_0xdb10('0x19')](function(_0x4529ad){_0x5d2c0a(_0x4529ad);});};AGIVertices['prototype'][_0xdb10('0x39')]=function(_0x35393f,_0x5f25f2){this[_0xdb10('0x12')]['createSmsMessage'](_0x35393f)[_0xdb10('0x17')](function(_0x54a98f){_0x5f25f2(null,_0x54a98f);})['catch'](function(_0x442ae4){_0x5f25f2(_0x442ae4);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x3a')]=function(_0x477391,_0x182ee2,_0x128295){this[_0xdb10('0x12')][_0xdb10('0x3a')]({'uniqueid':this[_0xdb10('0x11')]['uniqueid'],'node':_0x477391['label'],'application':_0x477391[_0xdb10('0x3b')],'data':_0x182ee2||null,'project_name':this['channel'][_0xdb10('0x3c')],'callerid':this[_0xdb10('0x11')][_0xdb10('0x3d')]})['then'](function(_0x143ee9){if(_0x128295){_0x128295(null,_0x143ee9);}})[_0xdb10('0x19')](function(_0xe4e5eb){if(_0x128295){_0x128295(_0xe4e5eb);}});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x3e')]=function(_0x1ad059,_0x38b72a,_0x3ba836,_0x3fcb18){this[_0xdb10('0x12')][_0xdb10('0x3e')]({'uniqueid':this[_0xdb10('0x11')]['uniqueid'],'callerid':this[_0xdb10('0x11')][_0xdb10('0x3d')],'calleridname':this[_0xdb10('0x11')]['calleridname'],'context':this[_0xdb10('0x11')][_0xdb10('0x3f')],'extension':this[_0xdb10('0x11')][_0xdb10('0x40')],'priority':this[_0xdb10('0x11')][_0xdb10('0x41')],'accountcode':this[_0xdb10('0x11')]['accountcode'],'dnid':this['channel'][_0xdb10('0x42')],'projectName':this[_0xdb10('0x11')][_0xdb10('0x3c')],'saveName':_0x38b72a,'filename':_0x1ad059[_0xdb10('0x43')]||_0x38b72a,'savePath':_0x3ba836})[_0xdb10('0x17')](function(_0x166d77){_0x3fcb18(null,_0x166d77);})[_0xdb10('0x19')](function(_0x398669){_0x3fcb18(_0x398669);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x44')]=function(_0x27a67c,_0x3be222,_0x460c21,_0x5121d2,_0x49d075){this[_0xdb10('0x12')][_0xdb10('0x44')]({'uniqueid':this[_0xdb10('0x11')][_0xdb10('0x45')],'body':_0x27a67c,'direction':_0x3be222,'providerName':_0x460c21,'providerResponse':_0x5121d2})[_0xdb10('0x17')](function(_0x12bd00){if(_0x49d075){_0x49d075(null,_0x12bd00);}})['catch'](function(_0x4ff1b1){if(_0x49d075){_0x49d075(_0x4ff1b1);}});};AGIVertices['prototype'][_0xdb10('0x46')]=function(_0x727ab9,_0x23b5e4){this[_0xdb10('0x12')]['createCmContact']({'firstName':_['isEmpty'](_0x727ab9['name'])||_[_0xdb10('0x47')](_0x727ab9[_0xdb10('0x18')])?'callback_'+Math['random']():_0x727ab9['name'],'lastName':_[_0xdb10('0x48')](_0x727ab9[_0xdb10('0x49')])||_[_0xdb10('0x47')](_0x727ab9['lastName'])?null:_0x727ab9['lastName'],'phone':_0x727ab9[_0xdb10('0x4a')],'ListId':_0x727ab9[_0xdb10('0x4b')],'scheduledat':_0x727ab9[_0xdb10('0x4c')],'callbackUniqueid':this[_0xdb10('0x11')][_0xdb10('0x45')],'tags':'callback','description':_0xdb10('0x4d')+_0x727ab9['scheduledAt'][_0xdb10('0x4e')](),'priority':_0x727ab9[_0xdb10('0x4f')]})['then'](function(_0x53846f){_0x23b5e4(null,_0x53846f);})[_0xdb10('0x19')](function(_0x4fe315){_0x23b5e4(_0x4fe315);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x50')]=function(_0xff9309,_0x623f6d){this[_0xdb10('0x12')][_0xdb10('0x51')](_0xff9309)['then'](function(_0x54a73f){_0x623f6d(null,_0x54a73f?_0x54a73f['name']:![]);})[_0xdb10('0x19')](function(_0x48a08b){_0x623f6d(_0x48a08b);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x52')]=function(_0x56bba8,_0x5d87d4,_0x139c83){var _0x1d61a3={'role':_0xdb10('0x53')};_0x1d61a3[_0x56bba8]=this[_0xdb10('0x11')]['callerid'];this[_0xdb10('0x12')][_0xdb10('0x52')](_0x1d61a3,_0x5d87d4,this[_0xdb10('0x11')][_0xdb10('0x45')])[_0xdb10('0x17')](function(_0x2ba783){_0x139c83(null,_[_0xdb10('0x47')](_0x2ba783)?![]:!![]);})[_0xdb10('0x19')](function(_0x268452){logger[_0xdb10('0x54')](_0x268452);_0x139c83(null,![]);});};AGIVertices['prototype'][_0xdb10('0x55')]=function(_0x1a9830,_0x110c9e){var _0x943701={'role':'agent'};_0x943701[_0x1a9830]=this[_0xdb10('0x11')]['callerid'];this[_0xdb10('0x12')][_0xdb10('0x55')](_0x943701)[_0xdb10('0x17')](function(_0x51ba44){_0x110c9e(null,_[_0xdb10('0x47')](_0x51ba44)?![]:!![]);})[_0xdb10('0x19')](function(_0x892878){logger[_0xdb10('0x54')](_0x892878);_0x110c9e(null,![]);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x56')]=function(_0x46a6ab,_0xd13db5){var _0x2cdc72={'role':'agent'};_0x2cdc72[_0x46a6ab]=this['channel'][_0xdb10('0x3d')];this[_0xdb10('0x12')][_0xdb10('0x56')](_0x2cdc72)[_0xdb10('0x17')](function(_0x2ff5bd){_0xd13db5(null,_[_0xdb10('0x47')](_0x2ff5bd)?![]:!![]);})['catch'](function(_0xd33921){logger[_0xdb10('0x54')](_0xd33921);_0xd13db5(null,![]);});};AGIVertices[_0xdb10('0x14')]['agentLogin']=function(_0x35e7e0,_0x315e29){var _0x257108={'role':_0xdb10('0x53')};_0x257108[_0x35e7e0]=this[_0xdb10('0x11')][_0xdb10('0x3d')];var _0x38eb7c=_0x35e7e0!=_0xdb10('0x57')?util['format'](_0xdb10('0x58'),_0xdb10('0x59'),this[_0xdb10('0x11')][_0xdb10('0x3d')]):undefined;this[_0xdb10('0x12')][_0xdb10('0x5a')](_0x257108,_0x38eb7c)[_0xdb10('0x17')](function(_0x22e32a){_0x315e29(null,_[_0xdb10('0x47')](_0x22e32a)?![]:!![]);})[_0xdb10('0x19')](function(_0xe3cbc2){logger[_0xdb10('0x54')](_0xe3cbc2);_0x315e29(null,![]);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x5b')]=function(_0x2f2e50,_0x28b56a){sh[_0xdb10('0x5c')](_[_0xdb10('0x5d')](_0x2f2e50),function(_0x2974fe,_0x52d1d8){var _0x5a3f09=_0x52d1d8['replace'](/(\r\n|\n|\r)/gm,'');_0x28b56a(null,_0x5a3f09);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x5e')]=function(_0x5779ee,_0x22fde0){scripts[_0xdb10('0x5e')](_0x5779ee['apiKey'],_0x5779ee['google_cloud_tts_text_type']||_0xdb10('0x5f'),_0x5779ee[_0xdb10('0x5f')],_0x5779ee['languageCode']||_0xdb10('0x60'),_0x5779ee[_0xdb10('0x61')]||'MALE',_0x5779ee[_0xdb10('0x62')]||_0xdb10('0x63'))[_0xdb10('0x17')](function(_0x4a1f0a){_0x22fde0(null,_0x4a1f0a);})[_0xdb10('0x19')](function(_0x2d903c){_0x22fde0(_0x2d903c);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x64')]=function(_0x618efd,_0x2da03b){scripts['googleTTS'](_0x618efd['text'],_0x618efd[_0xdb10('0x65')]||'en',0x1)[_0xdb10('0x17')](function(_0x355c4c){_0x2da03b(null,_0x355c4c);})['catch'](function(_0x4dfaec){_0x2da03b(_0x4dfaec);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x66')]=function(_0x5531ea,_0x21d060){var _0x26b95c={'uri':_0x5531ea[_0xdb10('0x67')],'method':_0x5531ea[_0xdb10('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5531ea[_0xdb10('0x69')])===_0xdb10('0x6a')&&parseInt(_0x5531ea[_0xdb10('0x69')])>=0x1?parseInt(_0x5531ea[_0xdb10('0x69')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xdb10('0x6b'),_0xdb10('0x6c')],_0x26b95c[_0xdb10('0x68')]['toUpperCase']())){try{_0x26b95c[_0xdb10('0x6d')]=_0x5531ea[_0xdb10('0xd')]?JSON[_0xdb10('0x6e')](_0x5531ea[_0xdb10('0xd')]):{};}catch(_0x226506){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x226506);}}try{_0x26b95c[_0xdb10('0x6f')]=_0x5531ea[_0xdb10('0xc')]?JSON[_0xdb10('0x6e')](_0x5531ea[_0xdb10('0xc')]):{};}catch(_0x1c95a6){logger[_0xdb10('0x54')](_0xdb10('0x70'),_0x1c95a6);}if(_0x5531ea['computedVariables']){try{var _0x2318cf=require(_0x5531ea[_0xdb10('0x71')])[_0xdb10('0x72')](this,_0x26b95c);_0x26b95c[_0xdb10('0x73')]=Mustache[_0xdb10('0x74')](_0x5531ea[_0xdb10('0x67')],_0x2318cf,{},['$$','$$']);if(_0x26b95c[_0xdb10('0x6f')]){_0x26b95c[_0xdb10('0x6f')]=JSON[_0xdb10('0x6e')](Mustache[_0xdb10('0x74')](JSON[_0xdb10('0x75')](_0x26b95c[_0xdb10('0x6f')]),_0x2318cf,{},['$$','$$']));}if(_0x26b95c[_0xdb10('0x6d')]){_0x26b95c[_0xdb10('0x6d')]=JSON[_0xdb10('0x6e')](Mustache[_0xdb10('0x74')](JSON[_0xdb10('0x75')](_0x26b95c[_0xdb10('0x6d')]),_0x2318cf,{},['$$','$$']));}}catch(_0x5a0b48){logger['error'](_0xdb10('0x76'),_0x5a0b48);}}rp(_0x26b95c)[_0xdb10('0x17')](function(_0x44f976){var _0x6e58de={'statusCode':_0x44f976['statusCode']||0xc8,'statusMessage':_0x44f976[_0xdb10('0x77')]||'OK','headers':_0x44f976[_0xdb10('0x6f')]||{},'body':_0x44f976[_0xdb10('0x6d')]||{}};_0x21d060(null,_0x6e58de);})[_0xdb10('0x19')](function(_0xd737ed){var _0x5c6b2e={'statusCode':_0xd737ed[_0xdb10('0x78')]||0x1f4,'statusMessage':_0xd737ed[_0xdb10('0x79')]||_0xdb10('0x7a'),'headers':_0xd737ed[_0xdb10('0x7b')]['headers']||{},'body':_0xd737ed['options']['body']||{}};_0x21d060(null,_0x5c6b2e);});};AGIVertices['prototype'][_0xdb10('0x7c')]=function(_0xc13349,_0x31a63c){scripts[_0xdb10('0x7c')](this[_0xdb10('0x11')][_0xdb10('0x45')],_0xc13349[_0xdb10('0x7d')],_0xc13349[_0xdb10('0x5f')],_0xc13349[_0xdb10('0x7e')]||'en')[_0xdb10('0x17')](function(_0x2afdc9){_0x31a63c(null,_0x2afdc9);})[_0xdb10('0x19')](function(_0x1e039c){_0x31a63c(_0x1e039c);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x7f')]=function(_0x4eb3fc,_0x3726b9){scripts['googleDialogflowV2'](this[_0xdb10('0x11')][_0xdb10('0x45')],_0x4eb3fc[_0xdb10('0x80')],_0x4eb3fc['client_email'],_0x4eb3fc[_0xdb10('0x81')],_0x4eb3fc[_0xdb10('0x5f')],_0x4eb3fc[_0xdb10('0x82')]||'en')[_0xdb10('0x17')](function(_0x3fa9c2){_0x3726b9(null,_0x3fa9c2);})[_0xdb10('0x19')](function(_0x505b32){_0x3726b9(_0x505b32);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x83')]=function(_0x13be39,_0x2e9feb){scripts[_0xdb10('0x83')](this[_0xdb10('0x11')],_0x13be39)['then'](function(_0x3a7f2e){_0x2e9feb(null,_0x3a7f2e);})[_0xdb10('0x19')](function(_0xda1aea){_0x2e9feb(_0xda1aea);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x84')]=function(_0x346083,_0x5d1c51){scripts[_0xdb10('0x84')](_0x346083[_0xdb10('0x7d')],_0x346083[_0xdb10('0x5f')],_0x346083[_0xdb10('0x85')]||_0xdb10('0x60'),_0x346083[_0xdb10('0x86')])[_0xdb10('0x17')](function(_0x212f57){_0x5d1c51(null,_0x212f57);})[_0xdb10('0x19')](function(_0x59db19){_0x5d1c51(_0x59db19);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x87')]=function(_0x18c8ba,_0x267e81,_0x344097){scripts[_0xdb10('0x87')](_0x267e81,_0x18c8ba['key'],_0x18c8ba[_0xdb10('0x88')]||_0xdb10('0x60'),this[_0xdb10('0x89')](_0x18c8ba[_0xdb10('0x8a')])?_0x18c8ba['model']:undefined)['then'](function(_0x2f58f2){_0x344097(null,_0x2f58f2);})[_0xdb10('0x19')](function(_0x24d419){_0x344097(_0x24d419);});};AGIVertices['prototype'][_0xdb10('0x8b')]=function(_0x583e0d,_0x23af2f){scripts['awsPolly'](_0x583e0d[_0xdb10('0x8c')],_0x583e0d['aws_secret_access_key'],_0x583e0d[_0xdb10('0x8d')],_0x583e0d[_0xdb10('0x8e')]||_0xdb10('0x8f'),_0x583e0d[_0xdb10('0x5f')],_0x583e0d[_0xdb10('0x90')]||_0xdb10('0x5f'))[_0xdb10('0x17')](function(_0x22b2b7){_0x23af2f(null,_0x22b2b7);})[_0xdb10('0x19')](function(_0x5541d6){_0x23af2f(_0x5541d6);});};AGIVertices[_0xdb10('0x14')]['awsLex']=function(_0x5c6545,_0x48b2bf){scripts['awsLex'](this[_0xdb10('0x11')][_0xdb10('0x45')],_0x5c6545[_0xdb10('0x8c')],_0x5c6545[_0xdb10('0x91')],_0x5c6545[_0xdb10('0x92')],_0x5c6545[_0xdb10('0x5f')],_0x5c6545[_0xdb10('0x93')])[_0xdb10('0x17')](function(_0x571e6d){_0x48b2bf(null,_0x571e6d);})[_0xdb10('0x19')](function(_0x555dd9){_0x48b2bf(_0x555dd9);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x94')]=function(_0xb2955f,_0x4aef17,_0x44f407){scripts['googleASR'](_0x4aef17,_0xb2955f[_0xdb10('0x7d')],_0xb2955f[_0xdb10('0x95')]||_0xdb10('0x60'))[_0xdb10('0x17')](function(_0x512eb6){_0x44f407(null,_0x512eb6);})[_0xdb10('0x19')](function(_0x2adf0b){_0x44f407(_0x2adf0b);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x96')]=function(_0x351152,_0x51413d,_0x12a7e6){scripts[_0xdb10('0x96')](_0x51413d,_0x351152[_0xdb10('0x97')],_0x351152[_0xdb10('0x98')],_0x351152['uri'])[_0xdb10('0x17')](function(_0x54191c){_0x12a7e6(null,_0x54191c);})['catch'](function(_0x4c8eaf){_0x12a7e6(_0x4c8eaf);});};AGIVertices[_0xdb10('0x14')][_0xdb10('0x99')]=function(_0x428caa){var _0x548415=_[_0xdb10('0x9a')](verticesWithRetry,_0x428caa[_0xdb10('0x3b')])?_0x428caa:_[_0xdb10('0x9b')](_0x428caa);for(var _0x13b4e6 in _0x548415){if(_0x548415[_0xdb10('0x9c')](_0x13b4e6)){if(_0x548415[_0x13b4e6]&&_[_0xdb10('0x9d')](_0x548415[_0x13b4e6])){if(_[_0xdb10('0x9a')](recursiveMapAttributes,_0x13b4e6)){_0x548415[_0x13b4e6]=this['replaceObjectAllVariables'](_0x548415[_0x13b4e6]);}else{_0x548415[_0x13b4e6]=this[_0xdb10('0x9e')](_0x548415[_0x13b4e6]);}}}}return _0x548415;};AGIVertices['prototype'][_0xdb10('0x9f')]=function(_0x2a5b77){for(var _0x5d94fe in _0x2a5b77){if(_0x2a5b77['hasOwnProperty'](_0x5d94fe)){if(_[_0xdb10('0xa0')](_0x2a5b77[_0x5d94fe])){this[_0xdb10('0x9f')](_0x2a5b77[_0x5d94fe]);}else if(_['isArray'](_0x2a5b77[_0x5d94fe])){for(var _0x30ea4c=0x0;_0x30ea4c<_0x2a5b77[_0x5d94fe]['length'];_0x30ea4c++){this[_0xdb10('0x9f')](_0x2a5b77[_0x5d94fe][_0x30ea4c]);}}else if(_[_0xdb10('0x9d')](_0x2a5b77[_0x5d94fe])){_0x2a5b77[_0x5d94fe]=this[_0xdb10('0x9e')](_0x2a5b77[_0x5d94fe]);}}}};AGIVertices[_0xdb10('0x14')][_0xdb10('0xa1')]=function(_0x5da3a1,_0xbb8d60){for(var _0x1e45e3 in _0x5da3a1){if(_0x5da3a1[_0xdb10('0x9c')](_0x1e45e3)){if(_[_0xdb10('0xa0')](_0x5da3a1[_0x1e45e3])){if(!_[_0xdb10('0x48')](_0x5da3a1[_0x1e45e3])){this[_0xdb10('0xa1')](_0x5da3a1[_0x1e45e3],util[_0xdb10('0x2e')](_0xdb10('0xa2'),_0xbb8d60,_0x1e45e3));}}else if(_[_0xdb10('0xa3')](_0x5da3a1[_0x1e45e3])){for(var _0x363ea4=0x0;_0x363ea4<_0x5da3a1[_0x1e45e3][_0xdb10('0xa4')];_0x363ea4++){this[_0xdb10('0xa1')](_0x5da3a1[_0x1e45e3][_0x363ea4],util['format'](_0xdb10('0xa2'),_0xbb8d60,_0x1e45e3+'['+_0x363ea4+']'));}}else{if(!_['isNil'](_0x5da3a1[_0x1e45e3])){this[_0xdb10('0x11')][_0xdb10('0xa5')](util['format'](_0xdb10('0xa2'),_0xbb8d60,_0x1e45e3),_0x5da3a1[_0x1e45e3]);}}}}};AGIVertices[_0xdb10('0x14')]['replaceObjectAllVariables']=function(_0x223fdf){try{var _0x34dcd2=JSON[_0xdb10('0x6e')](_0x223fdf);this['recursiveNodeIndex'](_0x34dcd2);return JSON[_0xdb10('0x75')](_0x34dcd2);}catch(_0x34c59b){return this[_0xdb10('0x9e')](_0x223fdf);}};AGIVertices['prototype'][_0xdb10('0x9e')]=function(_0x48936b){var _0x14c6e2=_0x48936b[_0xdb10('0xa6')]('{');for(var _0x4843ac=0x1;_0x4843ac<_0x14c6e2[_0xdb10('0xa4')];_0x4843ac+=0x1){var _0x1859b0=_0x14c6e2[_0x4843ac]['split']('}');if(_0x1859b0[_0xdb10('0xa4')]>0x1){_0x48936b=_0x48936b[_0xdb10('0xa7')]('{'+_0x1859b0[0x0]+'}',this[_0xdb10('0x11')]['getVariable'](_0x1859b0[0x0])[_0xdb10('0xa8')]||_0x1859b0[0x0]);}}if(_0x14c6e2['length']===0x1){return _0x48936b[_0xdb10('0x4e')]();}return this['replaceAllVariables'](_0x48936b);};AGIVertices[_0xdb10('0x14')][_0xdb10('0xa9')]=function(_0x52015d,_0x3e32af){var _0x28033a=this[_0xdb10('0x11')][_0xdb10('0x15')](_0x52015d);if(_0x28033a[_0xdb10('0xaa')]===-0x1){return _0x28033a;}logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3e32af,_0x28033a['extra']));return this[_0xdb10('0x11')][_0xdb10('0xa5')](_0x3e32af,_0x28033a['extra']);};AGIVertices[_0xdb10('0x14')][_0xdb10('0x89')]=function(_0xb0ebba){return _0xb0ebba&&_0xb0ebba!=='0'&&_0xb0ebba!=='-1'&&_0xb0ebba!=='';};AGIVertices[_0xdb10('0x14')][_0xdb10('0xab')]=function(_0x1edc65){this[_0xdb10('0x3a')]['sync'](this,_0x1edc65,'-');_0x1edc65[_0xdb10('0xac')]=_0x1edc65[_0xdb10('0xab')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x382190){logger['info'](util[_0xdb10('0x2e')](_0xdb10('0xad'),_0x382190[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x382190[_0xdb10('0x5f')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x553bf6='\x22'+_0x382190[_0xdb10('0x5f')]+'\x22';if(this[_0xdb10('0x89')](_0x382190['options'])){_0x553bf6+=','+_0x382190['options'];}var _0x55f487=this['channel'][_0xdb10('0x5c')]('MRCPSynth',_0x553bf6);if(_0x55f487[_0xdb10('0xaa')]===-0x1){return _0x55f487;}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format'](_0xdb10('0xb0'),_0x553bf6));};AGIVertices['prototype'][_0xdb10('0xb1')]=function(_0x5f12d3){logger['info'](util[_0xdb10('0x2e')](_0xdb10('0xb2'),_0x5f12d3[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x5f12d3['grammar'])){return this[_0xdb10('0x11')]['noop'](_0xdb10('0xb3'));}var _0x598b50=_0x5f12d3[_0xdb10('0xb4')];if(this[_0xdb10('0x89')](_0x5f12d3[_0xdb10('0x7b')])){_0x598b50+=','+_0x5f12d3[_0xdb10('0x7b')];}var _0x3fc4d1=this['channel']['exec'](_0xdb10('0xb5'),_0x598b50);if(_0x3fc4d1[_0xdb10('0xaa')]===-0x1){return _0x3fc4d1;}var _0xb452d2=this[_0xdb10('0xa9')]('RECOG_CONFIDENCE()',_0xdb10('0xb6'));if(_0xb452d2['result']===-0x1){return _0xb452d2;}var _0x3f3d93=this[_0xdb10('0xa9')](_0xdb10('0xb7'),_0xdb10('0xb8'));if(_0x3f3d93['result']===-0x1){return _0x3f3d93;}var _0x3d45ea=this[_0xdb10('0xa9')](_0xdb10('0xb9'),_0xdb10('0xba'));if(_0x3d45ea[_0xdb10('0xaa')]===-0x1){return _0x3d45ea;}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x598b50));};AGIVertices['prototype']['agi']=function(_0x1f2f84){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1f2f84[_0xdb10('0xae')]));return this['channel'][_0xdb10('0x8')]([_0x1f2f84['command'],_0x1f2f84[_0xdb10('0xbb')]]);};AGIVertices[_0xdb10('0x14')][_0xdb10('0xbc')]=function(_0x246902){logger[_0xdb10('0x32')](util['format'](_0xdb10('0xbd'),_0x246902[_0xdb10('0xae')]));if(this[_0xdb10('0x89')](_0x246902[_0xdb10('0x69')])){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0xbe'),_0x246902[_0xdb10('0x69')]));var _0x35edd8=this[_0xdb10('0x11')][_0xdb10('0xbf')](_0x246902[_0xdb10('0x69')]);if(_0x35edd8[_0xdb10('0xaa')]===-0x1){return _0x35edd8;}}return this[_0xdb10('0x11')][_0xdb10('0xbc')]();};AGIVertices[_0xdb10('0x14')][_0xdb10('0xc0')]=function(_0x2a3600){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x2a3600[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x2a3600[_0xdb10('0x4b')])){return this['channel'][_0xdb10('0x54')](_0x2a3600,_0xdb10('0xc1'));}_0x2a3600['scheduledAt']=moment();if(this['isConfigured'](_0x2a3600[_0xdb10('0xc2')])){_0x2a3600['scheduledAt']=moment()[_0xdb10('0xc3')](_0x2a3600['delay'],'minutes');}if(!this[_0xdb10('0x89')](_0x2a3600[_0xdb10('0x4f')])){_0x2a3600[_0xdb10('0x4f')]=0x2;}this['createCmContact']['sync'](this,_0x2a3600);return this['channel'][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0xc4'),_0x2a3600['phone'],_0x2a3600['list_id'],_0x2a3600[_0xdb10('0x4c')]));};AGIVertices[_0xdb10('0x14')][_0xdb10('0xc5')]=function(_0x2c020c){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0xc6'),_0x2c020c[_0xdb10('0xae')]));var _0x189e37=this[_0xdb10('0x11')][_0xdb10('0x5c')](_0x2c020c[_0xdb10('0xc7')],_0x2c020c[_0xdb10('0x7b')]);if(_0x189e37[_0xdb10('0xaa')]===-0x1){return _0x189e37;}return this[_0xdb10('0x11')]['noop'](util['format'](_0xdb10('0xc8'),_0x2c020c[_0xdb10('0xc7')],_0x2c020c['options']));};AGIVertices[_0xdb10('0x14')]['lumenvoxtts']=function(_0x2bca07){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0xc9'),_0x2bca07[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x2bca07[_0xdb10('0x5f')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')]('no\x20text\x20configured');}var _0x5004aa='\x22'+_0x2bca07[_0xdb10('0x5f')]+'\x22';if(this['isConfigured'](_0x2bca07[_0xdb10('0x7b')])){_0x5004aa+=','+_0x2bca07[_0xdb10('0x7b')];}var _0x40408a=this['channel'][_0xdb10('0x5c')](_0xdb10('0xca'),_0x5004aa);if(_0x40408a['result']===-0x1){return _0x40408a;}return this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0xb0'),_0x5004aa));};AGIVertices['prototype']['sestektts']=function(_0x10f87c){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x10f87c[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x10f87c[_0xdb10('0x5f')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0xcb'));}var _0x18a45b='\x22'+_0x10f87c['text']+'\x22';if(this[_0xdb10('0x89')](_0x10f87c['options'])){_0x18a45b+=','+_0x10f87c[_0xdb10('0x7b')];}var _0x3a4aa2=this[_0xdb10('0x11')][_0xdb10('0x5c')](_0xdb10('0xca'),_0x18a45b);if(_0x3a4aa2['result']===-0x1){return _0x3a4aa2;}return this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0xb0'),_0x18a45b));};AGIVertices['prototype'][_0xdb10('0xcc')]=function(_0x40da18){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x40da18['label']));if(!this[_0xdb10('0x89')](_0x40da18[_0xdb10('0xb4')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0xb3'));}var _0x118d14=_0x40da18['grammar'];if(this[_0xdb10('0x89')](_0x40da18[_0xdb10('0x7b')])){_0x118d14+=','+_0x40da18[_0xdb10('0x7b')];}var _0x2d3ec7=this[_0xdb10('0x11')][_0xdb10('0x5c')](_0xdb10('0xb5'),_0x118d14);if(_0x2d3ec7['result']===-0x1){return _0x2d3ec7;}var _0x27f290=this[_0xdb10('0xa9')](_0xdb10('0xcd'),_0xdb10('0xce'));if(_0x27f290[_0xdb10('0xaa')]===-0x1){return _0x27f290;}var _0x40bfb5=this[_0xdb10('0xa9')](_0xdb10('0xb7'),_0xdb10('0xcf'));if(_0x40bfb5[_0xdb10('0xaa')]===-0x1){return _0x40bfb5;}var _0x328636=this[_0xdb10('0xa9')](_0xdb10('0xb9'),_0xdb10('0xd0'));if(_0x328636[_0xdb10('0xaa')]===-0x1){return _0x328636;}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')]('Executed\x20command\x20MRCPRecog\x20%s',_0x118d14));};AGIVertices['prototype'][_0xdb10('0xd1')]=function(_0x581108){logger[_0xdb10('0x32')](util['format'](_0xdb10('0xd2'),_0x581108['label']));if(!this[_0xdb10('0x89')](_0x581108[_0xdb10('0xb4')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')]('no\x20grammar\x20configured');}var _0x2cfdce=_0x581108['grammar'];if(this[_0xdb10('0x89')](_0x581108[_0xdb10('0x7b')])){_0x2cfdce+=','+_0x581108['options'];}var _0x122b97=this['channel'][_0xdb10('0x5c')](_0xdb10('0xb5'),_0x2cfdce);if(_0x122b97[_0xdb10('0xaa')]===-0x1){return _0x122b97;}var _0x5df9c6=this['getAndSetVariable'](_0xdb10('0xcd'),_0xdb10('0xd3'));if(_0x5df9c6[_0xdb10('0xaa')]===-0x1){return _0x5df9c6;}var _0x5be86f=this[_0xdb10('0xa9')](_0xdb10('0xb7'),_0xdb10('0xd4'));if(_0x5be86f[_0xdb10('0xaa')]===-0x1){return _0x5be86f;}var _0x53e6d4=this[_0xdb10('0xa9')](_0xdb10('0xb9'),_0xdb10('0xd5'));if(_0x53e6d4[_0xdb10('0xaa')]===-0x1){return _0x53e6d4;}return this['channel'][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0xd6'),_0x2cfdce));};AGIVertices[_0xdb10('0x14')][_0xdb10('0xd7')]=function(_0x2608f2){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0xd8'),_0x2608f2[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x2608f2[_0xdb10('0xd9')])){return this['channel'][_0xdb10('0x54')](_0x2608f2,_0xdb10('0xda'));}var _0x4c609a=this[_0xdb10('0x1e')][_0xdb10('0x72')](this,_0x2608f2[_0xdb10('0xd9')]);if(!_0x4c609a){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x2608f2,_0xdb10('0xdb'));}if(!this[_0xdb10('0x89')](_0x2608f2[_0xdb10('0x34')])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x2608f2,_0xdb10('0xdc'));}var _0xf14671=_0x2608f2[_0xdb10('0x34')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0xdd'),_0xf14671));var _0x58eadf=this[_0xdb10('0x30')][_0xdb10('0x72')](this,_0x4c609a,_0xf14671);this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0x2608f2,_0xf14671);if(!this[_0xdb10('0x89')](_0x2608f2[_0xdb10('0xde')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0xdf'));}var _0x5ab471=this['getVariable'][_0xdb10('0x72')](this,_0x2608f2['variable_id']);if(!_0x5ab471){return this[_0xdb10('0x11')]['error'](_0x2608f2,_0xdb10('0xe0'));}var _0x196429=this;_0x58eadf[_0xdb10('0xe1')](function(_0x39dd35,_0x3ce601){Object['keys'](_0x39dd35)[_0xdb10('0xe1')](function(_0x4242f1){_0x196429[_0xdb10('0x11')][_0xdb10('0xa5')](util[_0xdb10('0x2e')](_0xdb10('0xe2'),_0x5ab471,_0x3ce601,_0x4242f1),_0x39dd35[_0x4242f1]);});});this[_0xdb10('0x11')][_0xdb10('0xa5')](util[_0xdb10('0x2e')](_0xdb10('0xe3'),_0x5ab471),_0x58eadf[_0xdb10('0xa4')]);return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0xe4'),_0x5ab471));};AGIVertices[_0xdb10('0x14')][_0xdb10('0xe5')]=function(_0x11e2da){logger[_0xdb10('0xe6')](util[_0xdb10('0x2e')](_0xdb10('0xe7'),_0x11e2da['label']));if(!this['isConfigured'](_0x11e2da[_0xdb10('0xe8')])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x11e2da,_0xdb10('0xe9'));}var _0x258d7d=this['getUser'][_0xdb10('0x72')](this,_0x11e2da['sip_id']);if(!_0x258d7d){return this[_0xdb10('0x11')]['error'](_0x11e2da,_0xdb10('0xea'));}var _0x57607d=this['channel']['exec'](_0xdb10('0xeb'),[util[_0xdb10('0x2e')]('SIP/%s',_0x258d7d),_0x11e2da[_0xdb10('0x69')],_0x11e2da[_0xdb10('0xec')],_0x11e2da[_0xdb10('0x67')]]);if(_0x57607d['result']===-0x1){return _0x57607d;}return this['channel'][_0xdb10('0xaf')](util['format'](_0xdb10('0xed'),'DIAL'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0xee')]=function(_0x84a5f){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x84a5f[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x84a5f[_0xdb10('0x7d')])){return this[_0xdb10('0x11')]['noop'](_0xdb10('0xef'));}if(!this['isConfigured'](_0x84a5f[_0xdb10('0x5f')])){return this['channel']['noop'](_0xdb10('0xcb'));}this[_0xdb10('0x11')][_0xdb10('0xf0')]=!![];this[_0xdb10('0x3a')](_0x84a5f);this[_0xdb10('0x44')](_0x84a5f[_0xdb10('0x5f')],'in','','');this['channel'][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0xf1'),_0x84a5f['text']));var _0x63e5a6=this[_0xdb10('0x7c')][_0xdb10('0x72')](this,_0x84a5f);if(_0x63e5a6){for(var _0x18befa in _0x63e5a6){if(_0x63e5a6[_0xdb10('0x9c')](_0x18befa)){this[_0xdb10('0x11')]['setVariable'](util[_0xdb10('0x2e')]('DIALOGFLOW_%s',_0x18befa[_0xdb10('0xf2')]()),_0x63e5a6[_0x18befa]);}}this[_0xdb10('0x44')](_0x63e5a6[_0xdb10('0xf3')],_0xdb10('0xf4'),_0xdb10('0xee'),'');return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0xf5'),_0x63e5a6[_0xdb10('0xf3')]));}return this['channel']['error'](_0x84a5f,_0xdb10('0xf6'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0xf7')]=function(_0x3fb1a1){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0xf8'),_0x3fb1a1[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x3fb1a1['dialogflowV2_project_id'])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0xf9'));}if(!this[_0xdb10('0x89')](_0x3fb1a1['client_email'])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0xfa'));}if(!this[_0xdb10('0x89')](_0x3fb1a1[_0xdb10('0x81')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0xfb'));}if(!this[_0xdb10('0x89')](_0x3fb1a1[_0xdb10('0x82')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0xfc'));}if(!this['isConfigured'](_0x3fb1a1[_0xdb10('0x5f')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0xdb10('0xf0')]=!![];this[_0xdb10('0x3a')](_0x3fb1a1);this[_0xdb10('0x44')](_0x3fb1a1[_0xdb10('0x5f')],'in','','');this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0xfd'),_0x3fb1a1[_0xdb10('0x5f')]));var _0x1bd3a8=this[_0xdb10('0x7f')][_0xdb10('0x72')](this,_0x3fb1a1);if(_0x1bd3a8){for(var _0x4082a9 in _0x1bd3a8){if(_0x1bd3a8[_0xdb10('0x9c')](_0x4082a9)){if(_0x4082a9!==_0xdb10('0xfe')){this[_0xdb10('0x11')][_0xdb10('0xa5')](util[_0xdb10('0x2e')]('DIALOGFLOW_%s',_0x4082a9[_0xdb10('0xf2')]()),_0x1bd3a8[_0x4082a9]);}}}this[_0xdb10('0x44')](_0x1bd3a8[_0xdb10('0xf3')],_0xdb10('0xf4'),_0xdb10('0xf7'),_0x1bd3a8[_0xdb10('0xfe')]);return this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format'](_0xdb10('0xff'),_0x1bd3a8[_0xdb10('0xf3')]));}return this[_0xdb10('0x11')]['error'](_0x3fb1a1,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0xdb10('0x100')]=function(_0x3ae9b3){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x101'),_0x3ae9b3['label']));if(!this[_0xdb10('0x89')](_0x3ae9b3['ndauth_url'])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x102'));}if(!this[_0xdb10('0x89')](_0x3ae9b3[_0xdb10('0x103')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x104'));}if(!this[_0xdb10('0x89')](_0x3ae9b3['password'])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x105'));}if(!this[_0xdb10('0x89')](_0x3ae9b3[_0xdb10('0x106')])){return this[_0xdb10('0x11')]['noop'](_0xdb10('0xcb'));}this[_0xdb10('0x11')][_0xdb10('0xf0')]=!![];this[_0xdb10('0x3a')](_0x3ae9b3);this[_0xdb10('0x44')](_0x3ae9b3[_0xdb10('0x5f')],'in','','');this[_0xdb10('0x11')]['noop'](util['format'](_0xdb10('0x107'),_0x3ae9b3[_0xdb10('0x5f')]));var _0x149b8c=this[_0xdb10('0x83')][_0xdb10('0x72')](this,_0x3ae9b3);if(_0x149b8c){for(var _0x23b2b6 in _0x149b8c){if(_0x149b8c[_0xdb10('0x9c')](_0x23b2b6)){this[_0xdb10('0x11')][_0xdb10('0xa5')](util['format'](_0xdb10('0x108'),_0x23b2b6[_0xdb10('0xf2')]()),_0x149b8c[_0x23b2b6]);}}this[_0xdb10('0x44')](_0x149b8c[_0xdb10('0xf3')],_0xdb10('0xf4'),_0xdb10('0x100'),'');if(_0x149b8c[_0xdb10('0x109')]){this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x149b8c[_0xdb10('0x109')]));var _0x356e87=this['channel']['streamFile'](_0x149b8c['audiofile']);try{fs['unlink'](_0x149b8c[_0xdb10('0x109')]+_0xdb10('0x10a'));}catch(_0x5d331b){logger[_0xdb10('0x54')](_0x5d331b);}return _0x356e87;}else{return this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0x10b'),_0x149b8c['speech']));}}return this['channel']['error'](_0x3ae9b3,_0xdb10('0x10c'));};AGIVertices[_0xdb10('0x14')]['end']=function(_0x167e28){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x10d'),_0x167e28['label']));return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x10e'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x10f')]=function(_0x36bced){logger[_0xdb10('0x32')](util['format'](_0xdb10('0x110'),_0x36bced[_0xdb10('0xae')]));var _0x2d11c5='';if(_0x36bced['trunk_id']){if(!this[_0xdb10('0x89')](_0x36bced[_0xdb10('0x111')])){return this['channel'][_0xdb10('0x54')](_0x36bced,_0xdb10('0x112'));}else{var _0x5ac330=parseInt(_0x36bced['trunk_id'],0xa);if(isNaN(_0x5ac330)){_0x2d11c5=_0x36bced[_0xdb10('0x111')];}else{_0x2d11c5=this[_0xdb10('0x23')]['sync'](this,_0x36bced['trunk_id']);if(!_0x2d11c5){return this[_0xdb10('0x11')]['error'](_0x36bced,_0xdb10('0x113'));}}}}else if(_0x36bced[_0xdb10('0x114')]){_0x2d11c5=_0x36bced['trunk_name'];}else{return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x36bced,_0xdb10('0x112'));}var _0x59b97c=this[_0xdb10('0x11')][_0xdb10('0x5c')](_0xdb10('0xeb'),[util['format'](_0xdb10('0x115'),_0x2d11c5,_0x36bced['phone']),_0x36bced['timeout'],_0x36bced[_0xdb10('0xec')],_0x36bced['url']]);if(_0x59b97c[_0xdb10('0xaa')]===-0x1){return _0x59b97c;}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format'](_0xdb10('0xed'),'DIAL'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x116')]=function(_0x5386b4){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x117'),_0x5386b4[_0xdb10('0xae')]));return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x116'));};AGIVertices['prototype'][_0xdb10('0xf')]=function(_0x16b2b0){logger['info'](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x16b2b0[_0xdb10('0xae')]));if(_0x16b2b0['retry']===0x0){return this[_0xdb10('0xab')](_0x16b2b0);}_0x16b2b0['retry']-=0x1;if(!this[_0xdb10('0x89')](_0x16b2b0[_0xdb10('0x118')])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x16b2b0,'no\x20file\x20audio\x20selected');}var _0x1c3746=this[_0xdb10('0x25')][_0xdb10('0x72')](this,_0x16b2b0['file_id']);if(!_0x1c3746){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x16b2b0,_0xdb10('0x119'));}if(!this['isConfigured'](_0x16b2b0[_0xdb10('0xde')])){return this[_0xdb10('0x11')][_0xdb10('0x54')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x50a0ab=this['channel'][_0xdb10('0x11a')](_0x1c3746,_0x16b2b0['response'],_0x16b2b0[_0xdb10('0x11b')]);var _0xe1e143=_0x50a0ab['result']?_0x50a0ab[_0xdb10('0xaa')]['toString']():'';logger[_0xdb10('0x32')](_0xdb10('0x11c'),JSON[_0xdb10('0x75')](_0x50a0ab));if(_0x50a0ab['result']===-0x1){this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0x16b2b0,_0xe1e143);return _0x50a0ab;}else if(_0x50a0ab[_0xdb10('0xa8')]===_0xdb10('0x69')){_0x50a0ab['result']=_0xe1e143[_0xdb10('0xa4')]>=parseInt(_0x16b2b0[_0xdb10('0x11d')])?'x':'i';}else{_0x50a0ab[_0xdb10('0xaa')]=_0xe1e143[_0xdb10('0xa4')]>=parseInt(_0x16b2b0[_0xdb10('0x11d')])&&_0xe1e143[_0xdb10('0xa4')]<=parseInt(_0x16b2b0[_0xdb10('0x11b')])?'x':'i';}var _0x3b977a=this[_0xdb10('0x15')]['sync'](this,_0x16b2b0[_0xdb10('0xde')]);if(!_0x3b977a){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x16b2b0,_0xdb10('0xe0'));}this[_0xdb10('0x11')][_0xdb10('0xa5')](_0x3b977a,_0xe1e143);if(this[_0xdb10('0x89')](_0x16b2b0[_0xdb10('0x11e')])){var _0x128e09=parseInt(_0x16b2b0[_0xdb10('0x11e')],0xa);var _0x3fc711=rs[_0xdb10('0x11f')]({'charset':'*','length':_0x128e09});var _0x4b66de=_0xe1e143['length'];if(_0x4b66de>0x0){if(_0x4b66de>_0x128e09){this['createSquareDetailsReport'][_0xdb10('0x72')](this,_0x16b2b0,_0x16b2b0[_0xdb10('0x120')]===_0xdb10('0x121')?_0x3fc711+_0xe1e143[_0xdb10('0x122')](_0x128e09):_0xe1e143[_0xdb10('0x122')](0x0,_0x4b66de-_0x128e09)+_0x3fc711);}else{this['createSquareDetailsReport']['sync'](this,_0x16b2b0,rs[_0xdb10('0x11f')]({'charset':'*','length':_0x4b66de}));}}else{this['createSquareDetailsReport'][_0xdb10('0x72')](this,_0x16b2b0,'');}}else{this['createSquareDetailsReport'][_0xdb10('0x72')](this,_0x16b2b0,_0xe1e143);}return _0x50a0ab;};AGIVertices[_0xdb10('0x14')][_0xdb10('0x10')]=function(_0x2522ce){logger['info'](util['format'](_0xdb10('0x123'),_0x2522ce['label']));return this[_0xdb10('0xf')](_0x2522ce);};AGIVertices[_0xdb10('0x14')][_0xdb10('0x124')]=function(_0x554d79){logger['info'](util['format'](_0xdb10('0x125'),_0x554d79[_0xdb10('0xae')]));this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0x554d79,_0x554d79[_0xdb10('0x126')]);return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x127'),_0x554d79[_0xdb10('0x126')]));};AGIVertices['prototype'][_0xdb10('0x128')]=function(_0x43087d){logger[_0xdb10('0x32')](util['format'](_0xdb10('0x129'),_0x43087d[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x43087d['aws_access_key_id'])||!this['isConfigured'](_0x43087d[_0xdb10('0x91')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xdb10('0x89')](_0x43087d[_0xdb10('0x5f')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0xcb'));}this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')]('Trying\x20aws\x20Polly\x20%s',_0x43087d['text']));var _0xa59809=this['awsPolly'][_0xdb10('0x72')](this,_0x43087d);if(_0xa59809){this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')]('aws\x20Polly\x20%s\x20file\x20created',_0xa59809));var _0x1a2533=this[_0xdb10('0x11')][_0xdb10('0x12a')](_0xa59809);try{fs[_0xdb10('0x12b')](_0xa59809+_0xdb10('0x10a'));}catch(_0xa53489){logger[_0xdb10('0x54')](_0xa53489);}return _0x1a2533;}return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x43087d,_0xdb10('0x12c'));};AGIVertices['prototype'][_0xdb10('0x12d')]=function(_0x2f1891){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x12e'),_0x2f1891[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x2f1891['aws_access_key_id'])||!this[_0xdb10('0x89')](_0x2f1891[_0xdb10('0x91')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xdb10('0x89')](_0x2f1891['aws_bot_name'])){return this[_0xdb10('0x11')]['noop'](_0xdb10('0x12f'));}if(!this[_0xdb10('0x89')](_0x2f1891[_0xdb10('0x5f')])){return this['channel'][_0xdb10('0xaf')](_0xdb10('0xcb'));}this[_0xdb10('0x11')][_0xdb10('0xf0')]=!![];this[_0xdb10('0x3a')](_0x2f1891);this[_0xdb10('0x44')](_0x2f1891[_0xdb10('0x5f')],'in','','');this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format'](_0xdb10('0x130'),_0x2f1891[_0xdb10('0x5f')]));var _0x467bd4=this[_0xdb10('0x131')]['sync'](this,_0x2f1891);if(_0x467bd4){for(var _0x4ad861 in _0x467bd4){if(_0x467bd4[_0xdb10('0x9c')](_0x4ad861)&&_[_0xdb10('0x9d')](_0x467bd4[_0x4ad861])){this['channel'][_0xdb10('0xa5')](util[_0xdb10('0x2e')](_0xdb10('0x132'),_0x4ad861[_0xdb10('0xf2')]()),_0x467bd4[_0x4ad861]);}}if(_['isNil'](_0x467bd4[_0xdb10('0x79')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x133'));}else{this[_0xdb10('0x44')](_0x467bd4[_0xdb10('0x79')],_0xdb10('0xf4'),'amazonlex','');return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')]('Amazon\x20Lex\x20Result\x20%s',_0x467bd4[_0xdb10('0x79')]));}}return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x2f1891,_0xdb10('0x134'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x135')]=function(_0x277378){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x277378[_0xdb10('0xae')],_0x277378[_0xdb10('0x69')]));if(!this[_0xdb10('0x89')](_0x277378[_0xdb10('0x7d')])){return this[_0xdb10('0x11')]['noop'](_0xdb10('0xef'));}var _0x4ca505='wav';var _0x3b93eb=util[_0xdb10('0x2e')]('%s/recordings/%s',FILES_PATH,rs[_0xdb10('0x11f')](0x4));var _0x3db051=util[_0xdb10('0x2e')]('%s.%s',_0x3b93eb,_0x4ca505);var _0x2c4869=!![];if(_0x277378[_0xdb10('0x136')]===_0xdb10('0x137')){_0x2c4869=![];}var _0x5736c6=this['channel'][_0xdb10('0x138')](_0x3b93eb,_0x4ca505,_0x277378[_0xdb10('0x139')],_0x277378[_0xdb10('0x69')],undefined,_0x2c4869);if(_0x5736c6[_0xdb10('0xaa')]!==-0x1){this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x13a'),_0x3db051));var _0x235463=this['googleASR'][_0xdb10('0x72')](this,_0x277378,_0x3db051);if(_0x235463){for(var _0x2aeddb in _0x235463){if(_0x235463[_0xdb10('0x9c')](_0x2aeddb)){this['channel'][_0xdb10('0xa5')](util['format'](_0xdb10('0x13b'),_0x2aeddb[_0xdb10('0xf2')]()),_0x235463[_0x2aeddb]);}}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x13c'),JSON['stringify'](_0x235463)));}}return _0x5736c6;};AGIVertices[_0xdb10('0x14')][_0xdb10('0x13d')]=function(_0x10fe64){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x13e'),_0x10fe64[_0xdb10('0xae')]));if(!this['isConfigured'](_0x10fe64[_0xdb10('0x97')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x10fe64[_0xdb10('0x98')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x13f'));}var _0x1157c=_0xdb10('0x140');var _0x3c265b=util[_0xdb10('0x2e')](_0xdb10('0x141'),FILES_PATH,rs[_0xdb10('0x11f')](0x4));var _0xf75832=util[_0xdb10('0x2e')]('%s.%s',_0x3c265b,_0x1157c);var _0x45a3ae=!![];if(_0x10fe64['beep']==='NOBEEP'){_0x45a3ae=![];}var _0x1fb1ac=this[_0xdb10('0x11')][_0xdb10('0x138')](_0x3c265b,_0x1157c,_0x10fe64[_0xdb10('0x139')],_0x10fe64['timeout'],undefined,_0x45a3ae);if(_0x1fb1ac[_0xdb10('0xaa')]!==-0x1){this['channel'][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x142'),_0xf75832));var _0xc8f93c=this[_0xdb10('0x96')][_0xdb10('0x72')](this,_0x10fe64,_0xf75832);if(_0xc8f93c){for(var _0x1e6fc8 in _0xc8f93c){if(_0xc8f93c[_0xdb10('0x9c')](_0x1e6fc8)){this[_0xdb10('0x11')]['setVariable'](util[_0xdb10('0x2e')](_0xdb10('0x143'),_0x1e6fc8[_0xdb10('0xf2')]()),_0xc8f93c[_0x1e6fc8]);}}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x144'),JSON[_0xdb10('0x75')](_0xc8f93c)));}}return _0x1fb1ac;};AGIVertices[_0xdb10('0x14')][_0xdb10('0x145')]=function(_0x2cb065){logger['info'](util[_0xdb10('0x2e')](_0xdb10('0x146'),_0x2cb065['label']));return this['channel']['continueAt'](_0x2cb065[_0xdb10('0x3f')],_0x2cb065[_0xdb10('0x40')],_0x2cb065[_0xdb10('0x41')]);};AGIVertices[_0xdb10('0x14')][_0xdb10('0x147')]=function(_0x1800dd){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x148'),_0x1800dd[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x1800dd['condition'])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x1800dd,'no\x20condition\x20configured');}try{var _0x910927=eval(_0x1800dd[_0xdb10('0x149')])?_0xdb10('0x14a'):_0xdb10('0x14b');this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x1800dd[_0xdb10('0x149')],_0x910927));return{'code':0xc8,'result':_0x910927};}catch(_0x17754a){return{'code':0xc8,'result':_0xdb10('0x14b')};}};AGIVertices['prototype'][_0xdb10('0x14c')]=function(_0x1706c3){logger['info'](util['format'](_0xdb10('0x14d'),_0x1706c3[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x1706c3[_0xdb10('0x14e')])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x1706c3,'no\x20interval\x20configured');}var _0xbe1a1a=this['getIntervals'][_0xdb10('0x72')](this,_0x1706c3['interval_id']);if(!_0xbe1a1a){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x1706c3,'no\x20intervals\x20found');}for(var _0x2ce6b5=0x0;_0x2ce6b5<_0xbe1a1a[_0xdb10('0xa4')];_0x2ce6b5+=0x1){var _0xae8de8=this[_0xdb10('0x11')]['getVariable'](util[_0xdb10('0x2e')](_0xdb10('0x14f'),_0xbe1a1a[_0x2ce6b5]));if(_0xae8de8[_0xdb10('0xaa')]===-0x1){return _0xae8de8;}logger['info'](util['format'](_0xdb10('0x150'),_0xbe1a1a[_0x2ce6b5],_0xae8de8['extra']));if(_0xae8de8['extra']===_0xdb10('0x14a')){logger[_0xdb10('0x32')](util['format'](_0xdb10('0x150'),_0xbe1a1a[_0x2ce6b5],_0xdb10('0x14a')));this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x150'),_0xbe1a1a[_0x2ce6b5],_0xdb10('0x14a')));return{'code':0xc8,'result':'true'};}else{logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x150'),_0xbe1a1a[_0x2ce6b5],_0xdb10('0x14b')));this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x150'),_0xbe1a1a[_0x2ce6b5],_0xdb10('0x14b')));}}return{'code':0xc8,'result':_0xdb10('0x14b')};};AGIVertices[_0xdb10('0x14')][_0xdb10('0x151')]=function(_0x677910){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x152'),_0x677910[_0xdb10('0xae')]));return this[_0xdb10('0x11')][_0xdb10('0x151')]();};AGIVertices['prototype'][_0xdb10('0x153')]=function(_0x32b0c6){logger['info'](util['format'](_0xdb10('0x154'),_0x32b0c6[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x32b0c6['key'])){return this[_0xdb10('0x11')]['noop'](_0xdb10('0xef'));}var _0x2451d8=_0xdb10('0x140');var _0x3438a6=util[_0xdb10('0x2e')]('%s/recordings/%s',FILES_PATH,rs[_0xdb10('0x11f')](0x4));var _0x221de0=util[_0xdb10('0x2e')](_0xdb10('0xa2'),_0x3438a6,_0x2451d8);var _0x1d07f8=!![];if(_0x32b0c6[_0xdb10('0x136')]===_0xdb10('0x137')){_0x1d07f8=![];}var _0x5b8495=this[_0xdb10('0x11')]['recordFile'](_0x3438a6,_0x2451d8,_0x32b0c6['intKey'],_0x32b0c6['timeout'],undefined,_0x1d07f8);if(_0x5b8495['result']!==-0x1){this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x155'),_0x221de0));var _0x24a204=this[_0xdb10('0x87')]['sync'](this,_0x32b0c6,_0x221de0);if(_0x24a204){for(var _0x411e75 in _0x24a204){if(_0x24a204[_0xdb10('0x9c')](_0x411e75)){this[_0xdb10('0x11')][_0xdb10('0xa5')](util[_0xdb10('0x2e')](_0xdb10('0x156'),_0x411e75[_0xdb10('0xf2')]()),_0x24a204[_0x411e75]);}}return this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0x157'),JSON[_0xdb10('0x75')](_0x24a204)));}}return _0x5b8495;};AGIVertices[_0xdb10('0x14')][_0xdb10('0x158')]=function(_0xef96b5){logger['info'](util[_0xdb10('0x2e')](_0xdb10('0x159'),_0xef96b5['label']));if(!this[_0xdb10('0x89')](_0xef96b5[_0xdb10('0x7d')])){return this[_0xdb10('0x11')]['noop'](_0xdb10('0xef'));}if(!this[_0xdb10('0x89')](_0xef96b5[_0xdb10('0x5f')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')]('no\x20text\x20configured');}this['channel']['noop'](util[_0xdb10('0x2e')](_0xdb10('0x15a'),_0xef96b5[_0xdb10('0x5f')]));var _0xa9b6a3=this[_0xdb10('0x84')][_0xdb10('0x72')](this,_0xef96b5);if(_0xa9b6a3){this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0x155'),_0xa9b6a3));var _0x37b5c7=this[_0xdb10('0x11')][_0xdb10('0x12a')](_0xa9b6a3,_0xef96b5[_0xdb10('0x139')]);try{fs[_0xdb10('0x12b')](_0xa9b6a3+'.wav');}catch(_0x51746){logger[_0xdb10('0x54')](_0x51746);}return _0x37b5c7;}return this[_0xdb10('0x11')][_0xdb10('0x54')](_0xef96b5,_0xdb10('0x15b'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x15c')]=function(_0x59d00f){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x15d'),_0x59d00f[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x59d00f['findBy'])){return this[_0xdb10('0x11')]['error'](_0x59d00f,_0xdb10('0x15e'));}logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x15f'),this['channel'][_0xdb10('0x3d')],_0x59d00f['findBy']));var _0xb7c08f=this[_0xdb10('0x5a')][_0xdb10('0x72')](this,_0x59d00f['findBy']);if(_0xb7c08f){logger['info'](util[_0xdb10('0x2e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdb10('0x11')][_0xdb10('0x3d')],_0x59d00f['findBy']));this[_0xdb10('0x11')]['noop'](util['format'](_0xdb10('0x160'),this['channel'][_0xdb10('0x3d')],_0x59d00f[_0xdb10('0x161')]));return{'code':0xc8,'result':'success'};}else{logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdb10('0x11')][_0xdb10('0x3d')],_0x59d00f[_0xdb10('0x161')]));this['channel'][_0xdb10('0xaf')](util[_0xdb10('0x2e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdb10('0x11')]['callerid'],_0x59d00f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xdb10('0x14')][_0xdb10('0x162')]=function(_0x1e1396){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x163'),_0x1e1396[_0xdb10('0xae')]));if(!this['isConfigured'](_0x1e1396[_0xdb10('0x161')])){return this[_0xdb10('0x11')]['error'](_0x1e1396,_0xdb10('0x15e'));}logger[_0xdb10('0x32')](util['format'](_0xdb10('0x15f'),this['channel'][_0xdb10('0x3d')],_0x1e1396[_0xdb10('0x161')]));var _0x2d5b98=this[_0xdb10('0x56')]['sync'](this,_0x1e1396[_0xdb10('0x161')]);if(_0x2d5b98){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x160'),this['channel'][_0xdb10('0x3d')],_0x1e1396[_0xdb10('0x161')]));this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdb10('0x11')]['callerid'],_0x1e1396['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xdb10('0x32')](util['format'](_0xdb10('0x164'),this[_0xdb10('0x11')][_0xdb10('0x3d')],_0x1e1396['findBy']));this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0x164'),this[_0xdb10('0x11')]['callerid'],_0x1e1396[_0xdb10('0x161')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xdb10('0x165')]=function(_0xffca84){logger['info'](util[_0xdb10('0x2e')](_0xdb10('0x166'),_0xffca84[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0xffca84['operation'])){return this['channel'][_0xdb10('0x54')](_0xffca84,_0xdb10('0x167'));}this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x168'),_0xffca84['operation']));var _0x418cad=eval(_0xffca84[_0xdb10('0x169')]);if(!this[_0xdb10('0x89')](_0xffca84[_0xdb10('0xde')])){return this[_0xdb10('0x11')]['noop'](_0xdb10('0xdf'));}var _0x37d9b6=this[_0xdb10('0x15')][_0xdb10('0x72')](this,_0xffca84[_0xdb10('0xde')]);if(!_0x37d9b6){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0xffca84,'no\x20variable\x20found');}if(_[_0xdb10('0xa3')](_0x418cad)){var _0x3f699b=this;_0x418cad[_0xdb10('0xe1')](function(_0x35022a,_0x1ac19c){_0x3f699b[_0xdb10('0x11')]['setVariable'](util[_0xdb10('0x2e')](_0xdb10('0x16a'),_0x37d9b6,_0x1ac19c),_0x35022a);});return this['channel'][_0xdb10('0xaf')](util['format'](_0xdb10('0x16b'),_0x37d9b6));}else{return this['channel'][_0xdb10('0xa5')](_0x37d9b6,_0x418cad);}};AGIVertices[_0xdb10('0x14')][_0xdb10('0xe')]=function(_0x1f3190){logger[_0xdb10('0x32')](util['format'](_0xdb10('0x16c'),_0x1f3190['label']));if(_0x1f3190[_0xdb10('0xac')]===0x0){return this[_0xdb10('0xab')](_0x1f3190);}_0x1f3190[_0xdb10('0xac')]-=0x1;if(!this['isConfigured'](_0x1f3190[_0xdb10('0x118')])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x1f3190,_0xdb10('0x16d'));}var _0x4d040d=this[_0xdb10('0x25')]['sync'](this,_0x1f3190['file_id']);if(!_0x4d040d){return this['channel']['error'](_0x1f3190,_0xdb10('0x119'));}var _0x24c0fb=this[_0xdb10('0x11')][_0xdb10('0x11a')](_0x4d040d,_0x1f3190[_0xdb10('0x16e')],_0x1f3190[_0xdb10('0x16f')]);var _0xa5283f=_0x24c0fb[_0xdb10('0xaa')];if(_0x24c0fb['result']===-0x1){this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0x1f3190,'-1');return _0x24c0fb;}else if(_0x24c0fb[_0xdb10('0xa8')]===_0xdb10('0x69')){_0x24c0fb['result']=_0x24c0fb[_0xdb10('0xaa')][_0xdb10('0xa4')]>0x0?_0x24c0fb[_0xdb10('0xaa')]:'t';}else if(_[_0xdb10('0x48')](_0x24c0fb[_0xdb10('0xaa')])){_0x24c0fb[_0xdb10('0xaa')]='#';_0xa5283f='#';}if(!this[_0xdb10('0x89')](_0x1f3190[_0xdb10('0xde')])){this[_0xdb10('0x11')]['noop'](_0xdb10('0xdf'));}else{var _0x57d9e4=this['getVariable'][_0xdb10('0x72')](this,_0x1f3190['variable_id']);if(!_0x57d9e4){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x1f3190,_0xdb10('0xe0'));}this[_0xdb10('0x11')][_0xdb10('0xa5')](_0x57d9e4,_0xa5283f);}this['createSquareDetailsReport'][_0xdb10('0x72')](this,_0x1f3190,_0xa5283f);return _0x24c0fb;};AGIVertices[_0xdb10('0x14')][_0xdb10('0xaf')]=function(_0x4891e4){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x4891e4[_0xdb10('0xae')]));return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0x4891e4[_0xdb10('0x170')]||_0x4891e4[_0xdb10('0xae')]);};AGIVertices[_0xdb10('0x14')]['pause']=function(_0x25576f){logger['info'](util['format'](_0xdb10('0x171'),_0x25576f[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x25576f['findBy'])){return this[_0xdb10('0x11')]['error'](_0x25576f,_0xdb10('0x15e'));}logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x15f'),this[_0xdb10('0x11')][_0xdb10('0x3d')],_0x25576f[_0xdb10('0x161')]));var _0x740f9b=this[_0xdb10('0x50')][_0xdb10('0x72')](this,_0x25576f['pause_id']);var _0x1ce737=this[_0xdb10('0x52')]['sync'](this,_0x25576f[_0xdb10('0x161')],_0x740f9b);if(_0x1ce737){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x160'),this['channel'][_0xdb10('0x3d')],_0x25576f[_0xdb10('0x161')]));this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format'](_0xdb10('0x160'),this[_0xdb10('0x11')]['callerid'],_0x25576f[_0xdb10('0x161')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdb10('0x11')][_0xdb10('0x3d')],_0x25576f[_0xdb10('0x161')]));this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format'](_0xdb10('0x160'),this[_0xdb10('0x11')][_0xdb10('0x3d')],_0x25576f[_0xdb10('0x161')]));return{'code':0xc8,'result':_0xdb10('0x172')};}};AGIVertices[_0xdb10('0x14')]['playback']=function(_0x4d15d0){logger['info'](util[_0xdb10('0x2e')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4d15d0[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x4d15d0[_0xdb10('0x118')])){return this['channel'][_0xdb10('0x54')](_0x4d15d0,_0xdb10('0x16d'));}var _0x5219a9=this[_0xdb10('0x25')][_0xdb10('0x72')](this,_0x4d15d0[_0xdb10('0x118')]);if(!_0x5219a9){return this['channel'][_0xdb10('0x54')](_0x4d15d0,'no\x20file\x20audio\x20found');}var _0x3c9dd5=this[_0xdb10('0x11')][_0xdb10('0x5c')](_0xdb10('0x173'),[_0x5219a9,_0x4d15d0[_0xdb10('0xec')]]);if(_0x3c9dd5[_0xdb10('0xaa')]===-0x1){return _0x3c9dd5;}return this[_0xdb10('0x11')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xdb10('0x173'),_0x5219a9));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x174')]=function(_0x4fb426){logger['info'](util['format'](_0xdb10('0x175'),_0x4fb426['label']));if(!this[_0xdb10('0x89')](_0x4fb426[_0xdb10('0x176')])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x4fb426,'no\x20queue\x20selected');}var _0x3629a3='';var _0x1631ba=parseInt(_0x4fb426[_0xdb10('0x176')],0xa);if(isNaN(_0x1631ba)){_0x3629a3=_0x4fb426[_0xdb10('0x176')];}else{_0x3629a3=this[_0xdb10('0x1a')][_0xdb10('0x72')](this,_0x4fb426[_0xdb10('0x176')]);if(!_0x3629a3){return this['channel'][_0xdb10('0x54')](_0x4fb426,_0xdb10('0x177'));}}var _0x222fa3='';if(this['isConfigured'](_0x4fb426[_0xdb10('0x118')])){var _0x435c86=this['getSound'][_0xdb10('0x72')](this,_0x4fb426[_0xdb10('0x118')]);if(_0x435c86){_0x222fa3=_0x435c86;}}this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0x4fb426,_0x3629a3);if(_0x4fb426['opts'][_0xdb10('0x178')]('x')<0x0){_0x4fb426[_0xdb10('0xec')]+='x';}if(_0x4fb426['opts'][_0xdb10('0x178')]('X')<0x0){_0x4fb426['opts']+='X';}this['channel']['setVariable'](_0xdb10('0x179'),_0x3629a3?_0x3629a3['toLowerCase']():'');var _0x28a5d8=this[_0xdb10('0x11')][_0xdb10('0x5c')]('QUEUE',[_0x3629a3,_0x4fb426['opts'],_0x4fb426[_0xdb10('0x67')],_0x222fa3,_0x4fb426[_0xdb10('0x69')],_0x4fb426[_0xdb10('0x8')],_0x4fb426[_0xdb10('0x17a')],_0x4fb426[_0xdb10('0x17b')],'',_0x4fb426[_0xdb10('0x17c')]]);if(_0x28a5d8[_0xdb10('0xaa')]===-0x1){return _0x28a5d8;}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format'](_0xdb10('0xc8'),'QUEUE',_0x3629a3));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x17d')]=function(_0x3e49ab){logger['info'](util['format'](_0xdb10('0x17e'),_0x3e49ab[_0xdb10('0xae')]));var _0x4abecb=_0x3e49ab[_0xdb10('0x17f')]||_0xdb10('0x140');var _0x13f8aa=util['format'](_0xdb10('0x180'),this['channel'][_0xdb10('0x45')],rs['generate'](0x5));var _0x24ee3f=util['format'](_0xdb10('0x181'),FILES_PATH,_0x13f8aa,_0x4abecb);var _0x1e3596=util[_0xdb10('0x2e')]('%s/recordings/%s',FILES_PATH,_0x13f8aa);this[_0xdb10('0x3e')][_0xdb10('0x72')](this,_0x3e49ab,_0x13f8aa,_0x24ee3f);this[_0xdb10('0x11')][_0xdb10('0xa5')](_0xdb10('0x182'),_0x13f8aa);logger[_0xdb10('0x32')](_0xdb10('0x183'),_0x1e3596,_0x4abecb,_0x3e49ab[_0xdb10('0x184')],_0x3e49ab[_0xdb10('0x69')]);return this['channel'][_0xdb10('0x138')](_0x1e3596,_0x4abecb,_0x3e49ab[_0xdb10('0x184')],_0x3e49ab[_0xdb10('0x69')],undefined,!![]);};AGIVertices[_0xdb10('0x14')]['restapi']=function(_0x387bb5){logger[_0xdb10('0x32')](util['format'](_0xdb10('0x185'),_0x387bb5[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x387bb5[_0xdb10('0x67')])){return this['channel'][_0xdb10('0xaf')](_0xdb10('0x186'));}var _0x1712d3=this['restAPI'][_0xdb10('0x72')](this,_0x387bb5);logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x187'),util[_0xdb10('0x188')](_0x1712d3,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x387bb5[_0xdb10('0xde')])){return this['channel'][_0xdb10('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x4a85be=this[_0xdb10('0x15')][_0xdb10('0x72')](this,_0x387bb5[_0xdb10('0xde')]);if(!_0x4a85be){return this['channel'][_0xdb10('0x54')](_0x387bb5,_0xdb10('0xe0'));}this[_0xdb10('0x11')]['setVariable'](util[_0xdb10('0x2e')](_0xdb10('0x189'),_0x4a85be),_0x1712d3[_0xdb10('0x78')]?_0x1712d3[_0xdb10('0x78')]:_0xdb10('0x18a'));this['channel'][_0xdb10('0xa5')](util[_0xdb10('0x2e')]('%s_STATUS_MESSAGE',_0x4a85be),_0x1712d3['statusMessage']?_0x1712d3[_0xdb10('0x77')]:'OK');if(_0x1712d3[_0xdb10('0x6d')]){try{this['saveRestApiResult'](_0x1712d3[_0xdb10('0x6d')],_0x4a85be);}catch(_0x44249b){logger[_0xdb10('0x54')](util[_0xdb10('0x2e')](_0xdb10('0x18b'),_0x4a85be));}}return this['channel'][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0xe4'),_0x4a85be));};AGIVertices[_0xdb10('0x14')]['saydigits']=function(_0x3f76d6){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x3f76d6[_0xdb10('0xae')]));return this[_0xdb10('0x11')][_0xdb10('0x18c')](_0x3f76d6['digits']['replace'](/\s+/g,''),_0x3f76d6['escape_digits']);};AGIVertices[_0xdb10('0x14')][_0xdb10('0x18d')]=function(_0x155530){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x18e'),_0x155530[_0xdb10('0xae')]));return this[_0xdb10('0x11')][_0xdb10('0x18f')](_0x155530[_0xdb10('0x6a')][_0xdb10('0x190')](/\s+/g,''),_0x155530[_0xdb10('0x184')]);};AGIVertices[_0xdb10('0x14')][_0xdb10('0x191')]=function(_0x3a219e){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x192'),_0x3a219e[_0xdb10('0xae')]));return this[_0xdb10('0x11')][_0xdb10('0x193')](_0x3a219e['text'],_0x3a219e[_0xdb10('0x184')]);};AGIVertices[_0xdb10('0x14')][_0xdb10('0x194')]=function(_0xfb21ae){logger['info'](util[_0xdb10('0x2e')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xfb21ae[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0xfb21ae['account_id'])){return this[_0xdb10('0x11')][_0xdb10('0xaf')]('no\x20mail\x20account\x20configured');}var _0x1e3c6c=this[_0xdb10('0x29')]['sync'](this,_0xfb21ae[_0xdb10('0x195')]);if(!_0x1e3c6c||!_0x1e3c6c['Smtp']){return this['channel'][_0xdb10('0x54')](_0xfb21ae,_0xdb10('0x196'));}var _0x31b884={'from':util['format'](_0xdb10('0x197'),_0x1e3c6c[_0xdb10('0x18')],_0x1e3c6c['email']||_0x1e3c6c[_0xdb10('0x198')][_0xdb10('0x199')]),'to':_0xfb21ae['to']||'','cc':_0xfb21ae['cc']||'','bcc':_0xfb21ae['bcc']||'','subject':_0xfb21ae['subject'],'html':_0xfb21ae[_0xdb10('0x5f')],'text':_0xfb21ae[_0xdb10('0x5f')]};if(this[_0xdb10('0x89')](_0xfb21ae['template_id'])){}logger['debug'](_0xdb10('0x19a'),JSON['stringify'](_0x31b884));this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0xfb21ae,_0xfb21ae[_0xdb10('0x195')]);this['channel'][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x19b'),_0x1e3c6c[_0xdb10('0x18')]));this[_0xdb10('0x19c')]['sync'](this,_0x1e3c6c[_0xdb10('0x19d')],_0x31b884);return this[_0xdb10('0x11')][_0xdb10('0xaf')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xdb10('0x14')]['sendFax']=function(_0xd13f16){logger['info'](util[_0xdb10('0x2e')](_0xdb10('0x19e'),_0xd13f16['label']));return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x19f'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x1a0')]=function(_0x5b60af){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5b60af[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x5b60af['sms_account_id'])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x1a1'));}var _0x2f3400=this[_0xdb10('0x37')][_0xdb10('0x72')](this,_0x5b60af[_0xdb10('0x1a2')]);if(!_0x2f3400){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x5b60af,_0xdb10('0x1a3'));}var _0x123b8f={'body':_0x5b60af[_0xdb10('0x1a4')],'phone':_0x5b60af['to']||'','SmsAccountId':_0x2f3400['id']};logger[_0xdb10('0xe6')](_0xdb10('0x1a5'),JSON[_0xdb10('0x75')](_0x123b8f));this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0x5b60af,_0x5b60af[_0xdb10('0x1a2')]);this['channel'][_0xdb10('0xaf')](util['format'](_0xdb10('0x1a6'),_0x2f3400[_0xdb10('0x18')]));this[_0xdb10('0x39')]['sync'](this,_0x123b8f);return this['channel']['noop'](_0xdb10('0x1a7'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x1a8')]=function(_0x3dff8e){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x1a9'),_0x3dff8e[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x3dff8e['variable_id'])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x3dff8e,_0xdb10('0x1aa'));}var _0x36d823=this[_0xdb10('0x15')][_0xdb10('0x72')](this,_0x3dff8e[_0xdb10('0xde')]);if(!_0x36d823){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x3dff8e,_0xdb10('0xe0'));}return this['channel'][_0xdb10('0xa5')](_0x36d823,_0x3dff8e[_0xdb10('0x1ab')]);};AGIVertices[_0xdb10('0x14')]['start']=function(_0x2c6e76){logger[_0xdb10('0x32')](util['format'](_0xdb10('0x1ac'),_0x2c6e76[_0xdb10('0xae')]));this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x1ad'));if(_0x2c6e76[_0xdb10('0xbc')]===_0xdb10('0x1ae')){this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x1af'));return this[_0xdb10('0x11')][_0xdb10('0xbc')]();}return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x1b0'));};AGIVertices['prototype'][_0xdb10('0x1b1')]=function(_0x18aa02){logger['info'](util[_0xdb10('0x2e')](_0xdb10('0x1b2'),_0x18aa02[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x18aa02['project_id'])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x18aa02,'no\x20subproject\x20selected');}var _0x1fa056=this[_0xdb10('0x1c')]['sync'](this,_0x18aa02[_0xdb10('0x1b3')]);if(!this['isConfigured'](_0x1fa056)){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x18aa02,util[_0xdb10('0x2e')](_0xdb10('0x1b4'),_0x18aa02[_0xdb10('0x1b3')]));}if(_0x1fa056===this[_0xdb10('0x11')][_0xdb10('0x3c')]){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x18aa02,_0xdb10('0x1b5'));}this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0x18aa02,_0x1fa056);var _0xb4edc=this[_0xdb10('0x11')]['exec']('AGI',util[_0xdb10('0x2e')](_0xdb10('0x1b6'),config[_0xdb10('0x8')][_0xdb10('0x1b7')]||_0xdb10('0x1b8'),_0x1fa056,this[_0xdb10('0x11')][_0xdb10('0x3c')]));if(_0xb4edc[_0xdb10('0xaa')]===-0x1){return _0xb4edc;}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')]('Executed\x20command\x20%s\x20%s',_0xdb10('0x1b9'),_0x1fa056));};AGIVertices['prototype']['system']=function(_0xdb0765){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x1ba'),_0xdb0765[_0xdb10('0xae')]));var _0x16ec55=this[_0xdb10('0x5b')][_0xdb10('0x72')](this,_0xdb0765['command']);this[_0xdb10('0x3a')][_0xdb10('0x72')](this,_0xdb0765,_0xdb0765[_0xdb10('0x1bb')]);if(this['isConfigured'](_0xdb0765[_0xdb10('0xde')])){var _0x1613d7=this[_0xdb10('0x15')]['sync'](this,_0xdb0765[_0xdb10('0xde')]);if(_0x1613d7){this[_0xdb10('0x11')][_0xdb10('0xa5')](_0x1613d7,_0x16ec55);return this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0x1bc'),_0xdb0765[_0xdb10('0x1bb')],_0x1613d7));}}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x1bd'),_0xdb0765['command']));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x1be')]=function(_0x7a948d){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x1bf'),_0x7a948d[_0xdb10('0xae')]));_0x7a948d['text']=_0x7a948d[_0xdb10('0x5f')][_0xdb10('0x190')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x7a948d[_0xdb10('0x1c0')])){return this[_0xdb10('0x11')][_0xdb10('0xaf')](_0xdb10('0x1c1'));}if(!this['isConfigured'](_0x7a948d[_0xdb10('0x5f')])){return this[_0xdb10('0x11')]['noop']('no\x20text\x20configured');}this[_0xdb10('0x11')]['noop'](util[_0xdb10('0x2e')](_0xdb10('0x1c2'),_0x7a948d[_0xdb10('0x5f')]));var _0x1be4a3=this[_0xdb10('0x5e')][_0xdb10('0x72')](this,_0x7a948d);if(_0x1be4a3){this['channel'][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x1c3'),_0x1be4a3));var _0x5e5263=this[_0xdb10('0x11')]['streamFile'](_0x1be4a3);try{fs[_0xdb10('0x12b')](_0x1be4a3+'.wav');}catch(_0x3691d7){logger['error'](_0x3691d7);}return _0x5e5263;}return this['channel'][_0xdb10('0x54')](_0x7a948d,_0xdb10('0x1c4'));};AGIVertices['prototype'][_0xdb10('0x1c5')]=function(_0x119756){logger[_0xdb10('0x32')](util['format'](_0xdb10('0x1c6'),_0x119756[_0xdb10('0xae')]));_0x119756['text']=_0x119756[_0xdb10('0x5f')][_0xdb10('0x190')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdb10('0x89')](_0x119756[_0xdb10('0x5f')])){return this['channel'][_0xdb10('0xaf')](_0xdb10('0xcb'));}this['channel'][_0xdb10('0xaf')](util['format'](_0xdb10('0x1c7'),_0x119756['text']));var _0x489500=this[_0xdb10('0x64')][_0xdb10('0x72')](this,_0x119756);if(_0x489500){this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')]('Google\x20TTS\x20%s\x20file\x20created',_0x489500));var _0x3563a8=this[_0xdb10('0x11')]['streamFile'](_0x489500);try{fs[_0xdb10('0x12b')](_0x489500+_0xdb10('0x10a'));}catch(_0x26dd52){logger[_0xdb10('0x54')](_0x26dd52);}return _0x3563a8;}return this[_0xdb10('0x11')][_0xdb10('0x54')](_0x119756,_0xdb10('0x1c8'));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x1c9')]=function(_0xd4c893){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x1ca'),_0xd4c893[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0xd4c893[_0xdb10('0x161')])){return this[_0xdb10('0x11')][_0xdb10('0x54')](_0xd4c893,'no\x20find\x20by\x20configured');}logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x15f'),this[_0xdb10('0x11')]['callerid'],_0xd4c893[_0xdb10('0x161')]));var _0x120721=this['agentUnpause'][_0xdb10('0x72')](this,_0xd4c893['findBy']);if(_0x120721){logger[_0xdb10('0x32')](util[_0xdb10('0x2e')](_0xdb10('0x160'),this[_0xdb10('0x11')][_0xdb10('0x3d')],_0xd4c893[_0xdb10('0x161')]));this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0x160'),this[_0xdb10('0x11')][_0xdb10('0x3d')],_0xd4c893[_0xdb10('0x161')]));return{'code':0xc8,'result':_0xdb10('0x1cb')};}else{logger[_0xdb10('0x32')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xdb10('0x3d')],_0xd4c893['findBy']));this[_0xdb10('0x11')][_0xdb10('0xaf')](util['format'](_0xdb10('0x164'),this[_0xdb10('0x11')]['callerid'],_0xd4c893[_0xdb10('0x161')]));return{'code':0xc8,'result':_0xdb10('0x172')};}};AGIVertices['prototype'][_0xdb10('0x1cc')]=function(_0x3c6e22){logger[_0xdb10('0x32')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3c6e22['label']));var _0x534bab=this[_0xdb10('0x11')]['exec']('VOICEMAIL',[_0x3c6e22[_0xdb10('0x1cd')],_0x3c6e22['options']]);if(_0x534bab[_0xdb10('0xaa')]===-0x1){return _0x534bab;}return this[_0xdb10('0x11')][_0xdb10('0xaf')](util[_0xdb10('0x2e')](_0xdb10('0xc8'),_0xdb10('0x1ce'),_0x3c6e22['mailbox']));};AGIVertices[_0xdb10('0x14')][_0xdb10('0x1cf')]=function(_0x405529){logger['info'](util[_0xdb10('0x2e')](_0xdb10('0x1d0'),_0x405529[_0xdb10('0xae')]));if(!this[_0xdb10('0x89')](_0x405529[_0xdb10('0xde')])){return this[_0xdb10('0x11')]['error'](_0x405529,_0xdb10('0x1aa'));}var _0x2bb632=this[_0xdb10('0x15')][_0xdb10('0x72')](this,_0x405529[_0xdb10('0xde')]);if(!_0x2bb632){return this['channel']['error'](_0x405529,_0xdb10('0xe0'));}var _0x36beef=this[_0xdb10('0x11')]['getVariable'](_0x2bb632);return{'code':0xc8,'result':_0x36beef['extra']?_0x36beef[_0xdb10('0xa8')]:'-'};};String[_0xdb10('0x14')][_0xdb10('0xa7')]=function(_0x40d843,_0x360086){return this[_0xdb10('0xa6')](_0x40d843)[_0xdb10('0x1d1')](_0x360086);};module[_0xdb10('0x1d2')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 9f85f59..2ce1ecc 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 _0x1340=['then','getAgent','voicePause','info','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','finally','[ACW][START]\x20%s','message','uniqueid','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','error','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','attended','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause'];(function(_0x15dbba,_0x33e933){var _0x3ae636=function(_0x32b82a){while(--_0x32b82a){_0x15dbba['push'](_0x15dbba['shift']());}};_0x3ae636(++_0x33e933);}(_0x1340,0xe4));var _0x0134=function(_0x1f0780,_0x352cb9){_0x1f0780=_0x1f0780-0x0;var _0x470c13=_0x1340[_0x1f0780];return _0x470c13;};'use strict';var util=require(_0x0134('0x0'));var _=require(_0x0134('0x1'));var moment=require(_0x0134('0x2'));var ami=require(_0x0134('0x3'));var logger=require(_0x0134('0x4'))(_0x0134('0x5'));var RpcUser=require(_0x0134('0x6'));var RpcVoiceAgentReport=require(_0x0134('0x7'));function Acw(_0x27bc44){this[_0x0134('0x8')]=_0x27bc44[_0x0134('0x8')];this[_0x0134('0x9')]=_0x27bc44[_0x0134('0x9')];this['timers']=_0x27bc44[_0x0134('0xa')];this[_0x0134('0xb')]={};ami['on'](_0x0134('0xc'),this[_0x0134('0xd')][_0x0134('0xe')](this));ami['on'](_0x0134('0xf'),this['syncHangupRequest']['bind'](this));ami['on'](_0x0134('0x10'),this[_0x0134('0x11')][_0x0134('0xe')](this));ami['on'](_0x0134('0x12'),this[_0x0134('0x13')][_0x0134('0xe')](this));ami['on'](_0x0134('0x14'),this[_0x0134('0x15')][_0x0134('0xe')](this));ami['on'](_0x0134('0x16'),this[_0x0134('0x17')]['bind'](this));ami['on'](_0x0134('0x18'),this['syncAgentConnectPreview'][_0x0134('0xe')](this));}function getDiff(_0x309552){var _0x4ad631=moment()['milliseconds'](0x0);var _0x405117=moment(_0x309552)[_0x0134('0x19')](0x0);return _0x4ad631[_0x0134('0x1a')](_0x405117,_0x0134('0x1b'));}Acw[_0x0134('0x1c')][_0x0134('0x1d')]=function(_0x5acbe1){try{var _0x33e9b2=this;var _0x324fd0=this[_0x0134('0xb')][_0x5acbe1]['interface'];var _0x1e95d4=this[_0x0134('0xb')][_0x5acbe1][_0x0134('0x1e')];var _0x3baf40=this['voiceQueues'][_0x1e95d4];var _0x15e129=![];var _0x373867=_0x0134('0x1f');if(_0x3baf40[_0x0134('0x20')]){if(_0x3baf40[_0x0134('0x21')][_0x0134('0x22')]){_0x15e129=!![];_0x373867=_0x3baf40[_0x0134('0x21')][_0x0134('0x22')];}}ami['Action']({'action':_0x0134('0x23'),'interface':_0x324fd0,'paused':!![],'reason':_0x373867})[_0x0134('0x24')](function(_0x385712){if(_0x33e9b2['agents'][_0x324fd0]){return RpcUser[_0x0134('0x25')](_0x33e9b2[_0x0134('0x9')][_0x324fd0]['id'])['then'](function(_0x49577a){if(_0x49577a&&!_0x49577a[_0x0134('0x26')]){logger[_0x0134('0x27')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x5acbe1,_0x324fd0,_0x1e95d4);var _0x64c8a2=_0x33e9b2[_0x0134('0xb')][_0x5acbe1]['attended']&&_0x33e9b2[_0x0134('0xb')][_0x5acbe1]['destlinkedid']?_0x33e9b2['channels'][_0x5acbe1][_0x0134('0x28')]:_0x5acbe1;return RpcUser[_0x0134('0x29')](_0x33e9b2[_0x0134('0x9')][_0x324fd0],_0x373867,_0x64c8a2)[_0x0134('0x24')](function(_0x2a61e5){if(!_0x15e129){_0x33e9b2[_0x0134('0xa')][_0x324fd0]={};logger['info'](_0x0134('0x2a'),_0x5acbe1,_0x33e9b2[_0x0134('0x8')][_0x1e95d4][_0x0134('0x2b')],_0x324fd0,_0x1e95d4);_0x33e9b2[_0x0134('0xa')][_0x324fd0][_0x0134('0x2c')]=setTimeout(_0x33e9b2[_0x0134('0x2d')]['bind'](_0x33e9b2,_0x324fd0),_0x33e9b2['voiceQueues'][_0x1e95d4][_0x0134('0x2b')]*0x3e8);_0x33e9b2[_0x0134('0xa')][_0x324fd0][_0x0134('0x2e')]=moment()[_0x0134('0x2f')](_0x0134('0x30'));_0x33e9b2[_0x0134('0xa')][_0x324fd0]['uniqueid']=_0x5acbe1;_0x33e9b2['timers'][_0x324fd0][_0x0134('0x1e')]=_0x1e95d4;_0x33e9b2[_0x0134('0xa')][_0x324fd0][_0x0134('0x31')]=function(){var _0x379d1b=getDiff(_0x33e9b2[_0x0134('0xa')][_0x324fd0][_0x0134('0x2e')]);clearTimeout(_0x33e9b2['timers'][_0x324fd0]['timer']);_0x33e9b2['timers'][_0x324fd0]['timer']=![];RpcVoiceAgentReport[_0x0134('0x32')]({'acwtime':_0x379d1b},_0x33e9b2[_0x0134('0xa')][_0x324fd0]['uniqueid'],_0x324fd0)[_0x0134('0x24')](function(_0xbf867d){logger[_0x0134('0x27')](_0x0134('0x33'),_0x5acbe1,_0x379d1b,_0xbf867d);})[_0x0134('0x34')](function(_0x5de98a){logger['error'](_0x0134('0x35'),_0x5acbe1,_0x5de98a);});delete _0x33e9b2[_0x0134('0xa')][_0x324fd0];};}});}else{logger[_0x0134('0x27')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5acbe1,_0x324fd0,_0x1e95d4);}});}})[_0x0134('0x34')](function(_0x4e4cb0){logger['error'](_0x0134('0x2a'),_0x5acbe1,_0x33e9b2[_0x0134('0x8')][_0x1e95d4]['acwTimeout'],_0x324fd0,_0x1e95d4);})[_0x0134('0x36')](function(){delete _0x33e9b2[_0x0134('0xb')][_0x5acbe1];});}catch(_0x3baa7e){logger['error'](_0x0134('0x37'),_0x3baa7e[_0x0134('0x38')]);}};Acw['prototype']['stopAcw']=function(_0x121a78){try{var _0x36acfd=this;if(_0x36acfd[_0x0134('0xa')][_0x121a78]){_0x36acfd[_0x0134('0xa')][_0x121a78]['timer']=![];var _0x74caaf=_0x36acfd[_0x0134('0xa')][_0x121a78][_0x0134('0x39')];var _0x2c650a=_0x36acfd[_0x0134('0xa')][_0x121a78]['queue'];var _0x4c1096=_0x36acfd[_0x0134('0x8')][_0x2c650a][_0x0134('0x2b')];logger[_0x0134('0x27')](_0x0134('0x3a'),_0x74caaf,_0x121a78);RpcUser[_0x0134('0x3b')](this[_0x0134('0x9')][_0x121a78]);RpcVoiceAgentReport['update']({'acwtime':_0x4c1096,'agentacw':!![]},_0x74caaf,_0x121a78)[_0x0134('0x24')](function(_0x1d3e7f){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x74caaf,_0x4c1096,_0x1d3e7f);})[_0x0134('0x34')](function(_0x4f1e52){logger[_0x0134('0x3c')](_0x0134('0x35'),_0x74caaf,_0x4f1e52);});}else{logger[_0x0134('0x3c')](_0x0134('0x3d'),_0x121a78);if(_0x36acfd[_0x0134('0xa')]){logger[_0x0134('0x27')](_0x0134('0x3e'),JSON[_0x0134('0x3f')](_0x36acfd['timers']));}}}catch(_0x2edaa6){logger[_0x0134('0x3c')](_0x0134('0x40'),_0x2edaa6[_0x0134('0x38')]);}};Acw[_0x0134('0x1c')]['syncAgentConnect']=function(_0x1fe9bc){try{if(this[_0x0134('0x8')][_0x1fe9bc[_0x0134('0x1e')]]&&(this[_0x0134('0x8')][_0x1fe9bc['queue']][_0x0134('0x5')]||this['voiceQueues'][_0x1fe9bc[_0x0134('0x1e')]][_0x0134('0x20')])){if(this[_0x0134('0x9')][_0x1fe9bc[_0x0134('0x41')]]){this['channels'][_0x1fe9bc[_0x0134('0x39')]]={'queue':_0x1fe9bc[_0x0134('0x1e')],'interface':_0x1fe9bc[_0x0134('0x41')],'destlinkedid':_0x1fe9bc[_0x0134('0x28')]};}}}catch(_0x1509fd){logger['error'](_0x0134('0x42'),_0x1509fd['message']);}};Acw[_0x0134('0x1c')]['syncAgentConnectPreview']=function(_0x517f82){try{if(this[_0x0134('0x8')][_0x517f82['queue']]&&(this['voiceQueues'][_0x517f82[_0x0134('0x1e')]][_0x0134('0x5')]||this['voiceQueues'][_0x517f82[_0x0134('0x1e')]][_0x0134('0x20')])){if(this[_0x0134('0x9')][_0x517f82[_0x0134('0x41')]]){this[_0x0134('0xb')][_0x517f82['uniqueid']]={'queue':_0x517f82[_0x0134('0x1e')],'interface':_0x517f82['interface']};}}}catch(_0x452ad3){logger[_0x0134('0x3c')](_0x0134('0x43'),_0x452ad3[_0x0134('0x38')]);}};Acw[_0x0134('0x1c')][_0x0134('0x44')]=function(_0x49cdba){try{if(this[_0x0134('0xb')][_0x49cdba[_0x0134('0x39')]]&&_['isUndefined'](this[_0x0134('0xb')][_0x49cdba[_0x0134('0x39')]][_0x0134('0x45')])){logger[_0x0134('0x27')](_0x0134('0x46'),_0x49cdba[_0x0134('0x39')]);this[_0x0134('0x1d')](_0x49cdba[_0x0134('0x39')]);}else if(this[_0x0134('0xb')][_0x49cdba['linkedid']]&&_['isUndefined'](this['channels'][_0x49cdba['linkedid']]['attended'])){logger[_0x0134('0x27')](_0x0134('0x47'),_0x49cdba[_0x0134('0x48')]);this[_0x0134('0x1d')](_0x49cdba[_0x0134('0x48')]);}}catch(_0x117b01){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x117b01[_0x0134('0x38')]);}};Acw[_0x0134('0x1c')][_0x0134('0x11')]=function(_0x54fa00){try{if(this[_0x0134('0xb')][_0x54fa00[_0x0134('0x39')]]&&this[_0x0134('0xb')][_0x54fa00[_0x0134('0x39')]][_0x0134('0x45')]){logger[_0x0134('0x27')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x54fa00[_0x0134('0x39')]);this['startAcw'](_0x54fa00[_0x0134('0x39')]);}else if(this['channels'][_0x54fa00[_0x0134('0x48')]]&&this[_0x0134('0xb')][_0x54fa00['linkedid']][_0x0134('0x45')]){logger[_0x0134('0x27')](_0x0134('0x49'),_0x54fa00[_0x0134('0x48')]);this['startAcw'](_0x54fa00[_0x0134('0x48')]);}}catch(_0x3a8865){logger[_0x0134('0x3c')](_0x0134('0x4a'),_0x3a8865[_0x0134('0x38')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x5609bd){try{if(!_['isNil'](this['channels'][_0x5609bd[_0x0134('0x4b')]])){this[_0x0134('0x1d')](_0x5609bd[_0x0134('0x4b')]);if(this[_0x0134('0xb')][_0x5609bd[_0x0134('0x4c')]]){this['channels'][_0x5609bd[_0x0134('0x4c')]]['attended']=!![];this[_0x0134('0xb')][_0x5609bd[_0x0134('0x4d')]]=this[_0x0134('0xb')][_0x5609bd[_0x0134('0x4c')]];delete this[_0x0134('0xb')][_0x5609bd[_0x0134('0x4c')]];}}else if(!_[_0x0134('0x4e')](this[_0x0134('0xb')][_0x5609bd['transfertargetuniqueid']])){this['startAcw'](_0x5609bd[_0x0134('0x4d')]);if(this['channels'][_0x5609bd[_0x0134('0x4f')]]){this[_0x0134('0xb')][_0x5609bd[_0x0134('0x4f')]][_0x0134('0x45')]=!![];this[_0x0134('0xb')][_0x5609bd[_0x0134('0x4b')]]=this[_0x0134('0xb')][_0x5609bd[_0x0134('0x4f')]];delete this[_0x0134('0xb')][_0x5609bd[_0x0134('0x4f')]];}}}catch(_0x509d94){logger[_0x0134('0x3c')]('[ACW][syncAttendedTransfer]\x20%s',_0x509d94[_0x0134('0x38')]);}};Acw[_0x0134('0x1c')][_0x0134('0x17')]=function(_0x303a6c){try{if(this['channels'][_0x303a6c[_0x0134('0x50')]]){logger[_0x0134('0x27')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x303a6c[_0x0134('0x50')]));this[_0x0134('0x1d')](_0x303a6c[_0x0134('0x50')]);}else if(this[_0x0134('0xb')][_0x303a6c['transfererlinkedid']]){logger[_0x0134('0x27')](_0x0134('0x51'),JSON['stringify'](_0x303a6c[_0x0134('0x52')]));this[_0x0134('0x1d')](_0x303a6c['transfererlinkedid']);}}catch(_0x54baa0){logger[_0x0134('0x3c')]('[ACW][syncBlindTransfer]\x20%s',_0x54baa0[_0x0134('0x38')]);}};Acw[_0x0134('0x1c')][_0x0134('0x13')]=function(_0x5f3f42){try{if(this['voiceQueues'][_0x5f3f42[_0x0134('0x1e')]]&&this['voiceQueues'][_0x5f3f42[_0x0134('0x1e')]][_0x0134('0x53')]==='all'){if(this[_0x0134('0x9')][_0x5f3f42[_0x0134('0x41')]]){logger['info'](_0x0134('0x54'),_0x5f3f42[_0x0134('0x39')],_0x5f3f42['interface'],_0x5f3f42[_0x0134('0x1e')]);return RpcUser[_0x0134('0x29')](this[_0x0134('0x9')][_0x5f3f42[_0x0134('0x41')]],_0x0134('0x55'),_0x5f3f42[_0x0134('0x39')]);}}}catch(_0x4c96b8){logger[_0x0134('0x3c')](_0x0134('0x56'),_0x4c96b8[_0x0134('0x38')]);}};module[_0x0134('0x57')]=Acw; \ No newline at end of file +var _0x0973=['[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','uniqueid','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info'];(function(_0x35c718,_0x33a696){var _0x5c3099=function(_0x2810cd){while(--_0x2810cd){_0x35c718['push'](_0x35c718['shift']());}};_0x5c3099(++_0x33a696);}(_0x0973,0x131));var _0x3097=function(_0xdbf95d,_0x36cc99){_0xdbf95d=_0xdbf95d-0x0;var _0x20f56d=_0x0973[_0xdbf95d];return _0x20f56d;};'use strict';var util=require(_0x3097('0x0'));var _=require(_0x3097('0x1'));var moment=require(_0x3097('0x2'));var ami=require(_0x3097('0x3'));var logger=require(_0x3097('0x4'))(_0x3097('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x3097('0x6'));function Acw(_0x1199cf){this[_0x3097('0x7')]=_0x1199cf[_0x3097('0x7')];this[_0x3097('0x8')]=_0x1199cf[_0x3097('0x8')];this[_0x3097('0x9')]=_0x1199cf['timers'];this[_0x3097('0xa')]={};ami['on'](_0x3097('0xb'),this[_0x3097('0xc')][_0x3097('0xd')](this));ami['on']('hanguprequest',this[_0x3097('0xe')][_0x3097('0xd')](this));ami['on'](_0x3097('0xf'),this[_0x3097('0x10')][_0x3097('0xd')](this));ami['on'](_0x3097('0x11'),this[_0x3097('0x12')][_0x3097('0xd')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x3097('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0x3097('0x13')][_0x3097('0xd')](this));}function getDiff(_0x5f1086){var _0x46747e=moment()[_0x3097('0x14')](0x0);var _0x319116=moment(_0x5f1086)['milliseconds'](0x0);return _0x46747e['diff'](_0x319116,_0x3097('0x15'));}Acw[_0x3097('0x16')][_0x3097('0x17')]=function(_0x6f31bd){try{var _0xef7943=this;var _0x5210ef=this['channels'][_0x6f31bd][_0x3097('0x18')];var _0x3e9351=this[_0x3097('0xa')][_0x6f31bd][_0x3097('0x19')];var _0x556255=this[_0x3097('0x7')][_0x3e9351];var _0x50b9b2=![];var _0x5408cc=_0x3097('0x1a');if(_0x556255['mandatoryDisposition']){if(_0x556255[_0x3097('0x1b')][_0x3097('0x1c')]){_0x50b9b2=!![];_0x5408cc=_0x556255['mandatoryDispositionPause']['name'];}}ami[_0x3097('0x1d')]({'action':_0x3097('0x1e'),'interface':_0x5210ef,'paused':!![],'reason':_0x5408cc})[_0x3097('0x1f')](function(_0x295080){if(_0xef7943['agents'][_0x5210ef]){return RpcUser[_0x3097('0x20')](_0xef7943[_0x3097('0x8')][_0x5210ef]['id'])[_0x3097('0x1f')](function(_0x176c18){if(_0x176c18&&!_0x176c18[_0x3097('0x21')]){logger[_0x3097('0x22')](_0x3097('0x23'),_0x6f31bd,_0x5210ef,_0x3e9351);var _0x3538d8=_0xef7943[_0x3097('0xa')][_0x6f31bd]['attended']&&_0xef7943[_0x3097('0xa')][_0x6f31bd][_0x3097('0x24')]?_0xef7943['channels'][_0x6f31bd]['destlinkedid']:_0x6f31bd;return RpcUser[_0x3097('0x25')](_0xef7943[_0x3097('0x8')][_0x5210ef],_0x5408cc,_0x3538d8)['then'](function(_0x1062ac){if(!_0x50b9b2){_0xef7943[_0x3097('0x9')][_0x5210ef]={};logger[_0x3097('0x22')](_0x3097('0x26'),_0x6f31bd,_0xef7943[_0x3097('0x7')][_0x3e9351][_0x3097('0x27')],_0x5210ef,_0x3e9351);_0xef7943['timers'][_0x5210ef]['timer']=setTimeout(_0xef7943[_0x3097('0x28')][_0x3097('0xd')](_0xef7943,_0x5210ef),_0xef7943[_0x3097('0x7')][_0x3e9351][_0x3097('0x27')]*0x3e8);_0xef7943[_0x3097('0x9')][_0x5210ef]['lastPauseAt']=moment()[_0x3097('0x29')]('YYYY-MM-DD\x20HH:mm:ss');_0xef7943[_0x3097('0x9')][_0x5210ef][_0x3097('0x2a')]=_0x6f31bd;_0xef7943[_0x3097('0x9')][_0x5210ef][_0x3097('0x19')]=_0x3e9351;_0xef7943['timers'][_0x5210ef]['updateAcw']=function(){var _0x54a628=getDiff(_0xef7943[_0x3097('0x9')][_0x5210ef]['lastPauseAt']);clearTimeout(_0xef7943[_0x3097('0x9')][_0x5210ef][_0x3097('0x2b')]);_0xef7943[_0x3097('0x9')][_0x5210ef][_0x3097('0x2b')]=![];RpcVoiceAgentReport[_0x3097('0x2c')]({'acwtime':_0x54a628},_0xef7943[_0x3097('0x9')][_0x5210ef][_0x3097('0x2a')],_0x5210ef)[_0x3097('0x1f')](function(_0x1b4b11){logger[_0x3097('0x22')](_0x3097('0x2d'),_0x6f31bd,_0x54a628,_0x1b4b11);})[_0x3097('0x2e')](function(_0x4e3146){logger[_0x3097('0x2f')](_0x3097('0x30'),_0x6f31bd,_0x4e3146);});delete _0xef7943[_0x3097('0x9')][_0x5210ef];};}});}else{logger['info'](_0x3097('0x31'),_0x6f31bd,_0x5210ef,_0x3e9351);}});}})[_0x3097('0x2e')](function(_0x4f90ae){logger[_0x3097('0x2f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x6f31bd,_0xef7943['voiceQueues'][_0x3e9351][_0x3097('0x27')],_0x5210ef,_0x3e9351);})['finally'](function(){delete _0xef7943[_0x3097('0xa')][_0x6f31bd];});}catch(_0x125c34){logger[_0x3097('0x2f')](_0x3097('0x32'),_0x125c34[_0x3097('0x33')]);}};Acw[_0x3097('0x16')][_0x3097('0x28')]=function(_0x5262f7){try{var _0x4b4cbd=this;if(_0x4b4cbd['timers'][_0x5262f7]){_0x4b4cbd[_0x3097('0x9')][_0x5262f7][_0x3097('0x2b')]=![];var _0x44680c=_0x4b4cbd[_0x3097('0x9')][_0x5262f7][_0x3097('0x2a')];var _0x1977e1=_0x4b4cbd['timers'][_0x5262f7][_0x3097('0x19')];var _0x428695=_0x4b4cbd[_0x3097('0x7')][_0x1977e1][_0x3097('0x27')];logger[_0x3097('0x22')](_0x3097('0x34'),_0x44680c,_0x5262f7);RpcUser['saveUnpause'](this['agents'][_0x5262f7]);RpcVoiceAgentReport['update']({'acwtime':_0x428695,'agentacw':!![]},_0x44680c,_0x5262f7)[_0x3097('0x1f')](function(_0x57aca3){logger['info'](_0x3097('0x2d'),_0x44680c,_0x428695,_0x57aca3);})[_0x3097('0x2e')](function(_0x31353d){logger[_0x3097('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x44680c,_0x31353d);});}else{logger['error'](_0x3097('0x35'),_0x5262f7);if(_0x4b4cbd[_0x3097('0x9')]){logger[_0x3097('0x22')](_0x3097('0x36'),JSON[_0x3097('0x37')](_0x4b4cbd[_0x3097('0x9')]));}}}catch(_0x1a8cb){logger[_0x3097('0x2f')](_0x3097('0x38'),_0x1a8cb[_0x3097('0x33')]);}};Acw['prototype']['syncAgentConnect']=function(_0x39ea47){try{if(this[_0x3097('0x7')][_0x39ea47[_0x3097('0x19')]]&&(this[_0x3097('0x7')][_0x39ea47[_0x3097('0x19')]][_0x3097('0x5')]||this['voiceQueues'][_0x39ea47[_0x3097('0x19')]]['mandatoryDisposition'])){if(this[_0x3097('0x8')][_0x39ea47[_0x3097('0x18')]]){this[_0x3097('0xa')][_0x39ea47[_0x3097('0x2a')]]={'queue':_0x39ea47[_0x3097('0x19')],'interface':_0x39ea47[_0x3097('0x18')],'destlinkedid':_0x39ea47[_0x3097('0x24')]};}}}catch(_0xeb1c0a){logger[_0x3097('0x2f')](_0x3097('0x39'),_0xeb1c0a[_0x3097('0x33')]);}};Acw[_0x3097('0x16')][_0x3097('0x13')]=function(_0x45a515){try{if(this[_0x3097('0x7')][_0x45a515[_0x3097('0x19')]]&&(this[_0x3097('0x7')][_0x45a515[_0x3097('0x19')]][_0x3097('0x5')]||this['voiceQueues'][_0x45a515['queue']][_0x3097('0x3a')])){if(this[_0x3097('0x8')][_0x45a515[_0x3097('0x18')]]){this[_0x3097('0xa')][_0x45a515[_0x3097('0x2a')]]={'queue':_0x45a515['queue'],'interface':_0x45a515[_0x3097('0x18')]};}}}catch(_0xee55f9){logger[_0x3097('0x2f')](_0x3097('0x3b'),_0xee55f9[_0x3097('0x33')]);}};Acw[_0x3097('0x16')]['syncHangupRequest']=function(_0x10f479){try{if(this[_0x3097('0xa')][_0x10f479[_0x3097('0x2a')]]&&_[_0x3097('0x3c')](this[_0x3097('0xa')][_0x10f479[_0x3097('0x2a')]][_0x3097('0x3d')])){logger[_0x3097('0x22')]('[%s][HANGUP:UNIQUEID]',_0x10f479['uniqueid']);this[_0x3097('0x17')](_0x10f479[_0x3097('0x2a')]);}else if(this[_0x3097('0xa')][_0x10f479[_0x3097('0x3e')]]&&_[_0x3097('0x3c')](this[_0x3097('0xa')][_0x10f479[_0x3097('0x3e')]]['attended'])){logger[_0x3097('0x22')]('[%s][HANGUP:LINKEDID]',_0x10f479[_0x3097('0x3e')]);this[_0x3097('0x17')](_0x10f479['linkedid']);}}catch(_0x943eac){logger['error'](_0x3097('0x3f'),_0x943eac['message']);}};Acw[_0x3097('0x16')][_0x3097('0x10')]=function(_0x3c045d){try{if(this[_0x3097('0xa')][_0x3c045d['uniqueid']]&&this[_0x3097('0xa')][_0x3c045d[_0x3097('0x2a')]]['attended']){logger[_0x3097('0x22')](_0x3097('0x40'),_0x3c045d[_0x3097('0x2a')]);this['startAcw'](_0x3c045d[_0x3097('0x2a')]);}else if(this[_0x3097('0xa')][_0x3c045d[_0x3097('0x3e')]]&&this['channels'][_0x3c045d[_0x3097('0x3e')]]['attended']){logger[_0x3097('0x22')](_0x3097('0x41'),_0x3c045d[_0x3097('0x3e')]);this[_0x3097('0x17')](_0x3c045d[_0x3097('0x3e')]);}}catch(_0x534319){logger[_0x3097('0x2f')](_0x3097('0x42'),_0x534319[_0x3097('0x33')]);}};Acw['prototype'][_0x3097('0x43')]=function(_0x1c4976){try{if(!_['isNil'](this[_0x3097('0xa')][_0x1c4976[_0x3097('0x44')]])){this['startAcw'](_0x1c4976[_0x3097('0x44')]);if(this['channels'][_0x1c4976[_0x3097('0x45')]]){this[_0x3097('0xa')][_0x1c4976[_0x3097('0x45')]][_0x3097('0x3d')]=!![];this[_0x3097('0xa')][_0x1c4976[_0x3097('0x46')]]=this[_0x3097('0xa')][_0x1c4976[_0x3097('0x45')]];delete this[_0x3097('0xa')][_0x1c4976[_0x3097('0x45')]];}}else if(!_[_0x3097('0x47')](this[_0x3097('0xa')][_0x1c4976[_0x3097('0x46')]])){this[_0x3097('0x17')](_0x1c4976[_0x3097('0x46')]);if(this['channels'][_0x1c4976['origtransfereruniqueid']]){this[_0x3097('0xa')][_0x1c4976[_0x3097('0x48')]][_0x3097('0x3d')]=!![];this[_0x3097('0xa')][_0x1c4976[_0x3097('0x44')]]=this[_0x3097('0xa')][_0x1c4976[_0x3097('0x48')]];delete this[_0x3097('0xa')][_0x1c4976['origtransfereruniqueid']];}}}catch(_0xf0131c){logger['error'](_0x3097('0x49'),_0xf0131c['message']);}};Acw[_0x3097('0x16')][_0x3097('0x4a')]=function(_0x2f8872){try{if(this['channels'][_0x2f8872[_0x3097('0x4b')]]){logger[_0x3097('0x22')](_0x3097('0x4c'),JSON[_0x3097('0x37')](_0x2f8872[_0x3097('0x4b')]));this['startAcw'](_0x2f8872[_0x3097('0x4b')]);}else if(this['channels'][_0x2f8872[_0x3097('0x4d')]]){logger[_0x3097('0x22')](_0x3097('0x4e'),JSON['stringify'](_0x2f8872[_0x3097('0x4d')]));this[_0x3097('0x17')](_0x2f8872[_0x3097('0x4d')]);}}catch(_0x105fd4){logger[_0x3097('0x2f')](_0x3097('0x4f'),_0x105fd4[_0x3097('0x33')]);}};Acw['prototype'][_0x3097('0x12')]=function(_0x4f7e20){try{if(this[_0x3097('0x7')][_0x4f7e20[_0x3097('0x19')]]&&this[_0x3097('0x7')][_0x4f7e20[_0x3097('0x19')]][_0x3097('0x50')]===_0x3097('0x51')){if(this[_0x3097('0x8')][_0x4f7e20[_0x3097('0x18')]]){logger[_0x3097('0x22')](_0x3097('0x52'),_0x4f7e20[_0x3097('0x2a')],_0x4f7e20[_0x3097('0x18')],_0x4f7e20[_0x3097('0x19')]);return RpcUser['savePause'](this[_0x3097('0x8')][_0x4f7e20[_0x3097('0x18')]],_0x3097('0x53'),_0x4f7e20[_0x3097('0x2a')]);}}}catch(_0x56fe45){logger[_0x3097('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x56fe45[_0x3097('0x33')]);}};module[_0x3097('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 7bcc442..64f4828 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 _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x28d7a1,_0x7b015b){var _0x3420f8=function(_0xfea82c){while(--_0xfea82c){_0x28d7a1['push'](_0x28d7a1['shift']());}};_0x3420f8(++_0x7b015b);}(_0xb10b,0x12a));var _0xbb10=function(_0x52dd39,_0xdb90a5){_0x52dd39=_0x52dd39-0x0;var _0x1d4076=_0xb10b[_0x52dd39];return _0x1d4076;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2032,0xd9));var _0x2203=function(_0x1677a5,_0x32ce54){_0x1677a5=_0x1677a5-0x0;var _0xb91c8a=_0x2032[_0x1677a5];return _0xb91c8a;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index f6525e0..5dc03ea 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 _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x5caabf,_0x2ff26b){var _0x4d4e37=function(_0x3158e0){while(--_0x3158e0){_0x5caabf['push'](_0x5caabf['shift']());}};_0x4d4e37(++_0x2ff26b);}(_0xaa88,0x137));var _0x8aa8=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xaa88[_0x330414];return _0x99dbff;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x5f190a,_0x3c8848){var _0x929c0=function(_0x5bd908){while(--_0x5bd908){_0x5f190a['push'](_0x5f190a['shift']());}};_0x929c0(++_0x3c8848);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0xbdb7[_0x33d4a2];return _0x2c793f;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 960ad14..6104bc6 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa3d=['countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','dialCutDigit','number','substring','exports','lodash','string','isNil','voiceQueue','uniqueid','name','Contact','lastName','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x44ef5f,_0x56c683){var _0x23db5c=function(_0x5f427d){while(--_0x5f427d){_0x44ef5f['push'](_0x44ef5f['shift']());}};_0x23db5c(++_0x56c683);}(_0xaa3d,0x113));var _0xdaa3=function(_0x360269,_0x4655a7){_0x360269=_0x360269-0x0;var _0x517429=_0xaa3d[_0x360269];return _0x517429;};'use strict';var util=require('util');var _=require(_0xdaa3('0x0'));var moment=require('moment');function checkNameSurname(_0x35e700,_0x20dd0a,_0x470b38){var _0x53a397='';if(!_['isNil'](_0x20dd0a)&&_0xdaa3('0x1')===typeof _0x20dd0a){_0x53a397+=_0x20dd0a;}if(!_[_0xdaa3('0x2')](_0x470b38)&&_0xdaa3('0x1')===typeof _0x470b38){_0x53a397+='\x20'+_0x470b38;}if(_0x53a397!==''){return _0x53a397;}return _0x35e700;}function Action(_0xd9fbac,_0x6bcf7,_0x55dd2d){this[_0xdaa3('0x3')]=_0xd9fbac;this[_0xdaa3('0x4')]=_0x55dd2d||undefined;this[_0xdaa3('0x5')]=checkNameSurname(_0x6bcf7['Contact']['phone'],_0x6bcf7[_0xdaa3('0x6')]['firstName'],_0x6bcf7['Contact'][_0xdaa3('0x7')]);this['number']=_0x6bcf7[_0xdaa3('0x8')];this[_0xdaa3('0x9')]=_0xd9fbac[_0xdaa3('0x5')];this[_0xdaa3('0xa')]=_0x6bcf7[_0xdaa3('0xa')]||![];this['type']=_0xd9fbac[_0xdaa3('0xb')];this[_0xdaa3('0xc')]=_0xd9fbac[_0xdaa3('0xc')]||0x3;this[_0xdaa3('0xd')]=_0x6bcf7[_0xdaa3('0xd')];this[_0xdaa3('0xe')]=_0x6bcf7['countbusyretry'];this[_0xdaa3('0xf')]=_0x6bcf7['countcongestionretry'];this[_0xdaa3('0x10')]=_0x6bcf7[_0xdaa3('0x10')];this[_0xdaa3('0x11')]=_0x6bcf7[_0xdaa3('0x11')];this['countdropretry']=_0x6bcf7[_0xdaa3('0x12')];this[_0xdaa3('0x13')]=_0x6bcf7['countabandonedretry'];this['countmachineretry']=_0x6bcf7['countmachineretry'];this['countagentrejectretry']=_0x6bcf7[_0xdaa3('0x14')];this[_0xdaa3('0x15')]=_0x6bcf7[_0xdaa3('0x15')];this['ListId']=_0x6bcf7[_0xdaa3('0x16')];this[_0xdaa3('0x17')]=_0x6bcf7[_0xdaa3('0x17')];this[_0xdaa3('0x18')]=_0x6bcf7['VoiceQueueId'];this['CampaignId']=_0x6bcf7[_0xdaa3('0x19')];this['idHopper']=_0x6bcf7['id'];this[_0xdaa3('0x1a')]=_0x6bcf7[_0xdaa3('0x6')][_0xdaa3('0x1b')]||'';this[_0xdaa3('0x1c')]=moment()[_0xdaa3('0x1d')](_0xdaa3('0x1e'));this[_0xdaa3('0x1f')]=_0x6bcf7['callback'];this['callbackuniqueid']=_0x6bcf7[_0xdaa3('0x20')];this[_0xdaa3('0x21')]=_0x6bcf7[_0xdaa3('0x21')];this[_0xdaa3('0x22')]=_0x6bcf7[_0xdaa3('0x22')];this[_0xdaa3('0x23')]='';this['originatecalleridname']='';}Action[_0xdaa3('0x24')][_0xdaa3('0x25')]=function(){return util[_0xdaa3('0x1d')]('\x22%s\x22\x20<%s>',this[_0xdaa3('0x5')],this[_0xdaa3('0x3')][_0xdaa3('0x26')]>0x0?this[_0xdaa3('0x27')][_0xdaa3('0x28')](this[_0xdaa3('0x3')][_0xdaa3('0x26')]):this[_0xdaa3('0x27')]);};Action[_0xdaa3('0x24')]['getQueue']=function(){return this[_0xdaa3('0x9')];};module[_0xdaa3('0x29')]=Action; \ No newline at end of file +var _0x5e0b=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','queue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x5406ab,_0x10ddda){var _0x47e633=function(_0x116721){while(--_0x116721){_0x5406ab['push'](_0x5406ab['shift']());}};_0x47e633(++_0x10ddda);}(_0x5e0b,0x155));var _0xb5e0=function(_0x4bed75,_0x211cc7){_0x4bed75=_0x4bed75-0x0;var _0x2dd8e8=_0x5e0b[_0x4bed75];return _0x2dd8e8;};'use strict';var util=require(_0xb5e0('0x0'));var _=require('lodash');var moment=require(_0xb5e0('0x1'));function checkNameSurname(_0x571c11,_0x4e8a61,_0x54901c){var _0x183395='';if(!_[_0xb5e0('0x2')](_0x4e8a61)&&_0xb5e0('0x3')===typeof _0x4e8a61){_0x183395+=_0x4e8a61;}if(!_['isNil'](_0x54901c)&&_0xb5e0('0x3')===typeof _0x54901c){_0x183395+='\x20'+_0x54901c;}if(_0x183395!==''){return _0x183395;}return _0x571c11;}function Action(_0x3ef656,_0x41c6ab,_0x40d57c){this[_0xb5e0('0x4')]=_0x3ef656;this[_0xb5e0('0x5')]=_0x40d57c||undefined;this[_0xb5e0('0x6')]=checkNameSurname(_0x41c6ab[_0xb5e0('0x7')][_0xb5e0('0x8')],_0x41c6ab[_0xb5e0('0x7')][_0xb5e0('0x9')],_0x41c6ab[_0xb5e0('0x7')][_0xb5e0('0xa')]);this[_0xb5e0('0xb')]=_0x41c6ab[_0xb5e0('0x8')];this['queue']=_0x3ef656['name'];this[_0xb5e0('0xc')]=_0x41c6ab[_0xb5e0('0xc')]||![];this['type']=_0x3ef656[_0xb5e0('0xd')];this[_0xb5e0('0xe')]=_0x3ef656['dialQueueTimeout']||0x3;this[_0xb5e0('0xf')]=_0x41c6ab[_0xb5e0('0xf')];this[_0xb5e0('0x10')]=_0x41c6ab[_0xb5e0('0x10')];this[_0xb5e0('0x11')]=_0x41c6ab[_0xb5e0('0x11')];this['countnoanswerretry']=_0x41c6ab[_0xb5e0('0x12')];this['countnosuchnumberretry']=_0x41c6ab['countnosuchnumberretry'];this[_0xb5e0('0x13')]=_0x41c6ab[_0xb5e0('0x13')];this[_0xb5e0('0x14')]=_0x41c6ab[_0xb5e0('0x14')];this[_0xb5e0('0x15')]=_0x41c6ab[_0xb5e0('0x15')];this['countagentrejectretry']=_0x41c6ab[_0xb5e0('0x16')];this[_0xb5e0('0x17')]=_0x41c6ab[_0xb5e0('0x17')];this[_0xb5e0('0x18')]=_0x41c6ab['ListId'];this['UserId']=_0x41c6ab[_0xb5e0('0x19')];this[_0xb5e0('0x1a')]=_0x41c6ab[_0xb5e0('0x1a')];this[_0xb5e0('0x1b')]=_0x41c6ab[_0xb5e0('0x1b')];this[_0xb5e0('0x1c')]=_0x41c6ab['id'];this[_0xb5e0('0x1d')]=_0x41c6ab[_0xb5e0('0x7')][_0xb5e0('0x9')]||'';this['starttime']=moment()[_0xb5e0('0x1e')](_0xb5e0('0x1f'));this[_0xb5e0('0x20')]=_0x41c6ab[_0xb5e0('0x20')];this['callbackuniqueid']=_0x41c6ab[_0xb5e0('0x21')];this[_0xb5e0('0x22')]=_0x41c6ab['callbackat'];this['recallme']=_0x41c6ab[_0xb5e0('0x23')];this[_0xb5e0('0x24')]='';this['originatecalleridname']='';}Action[_0xb5e0('0x25')][_0xb5e0('0x26')]=function(){return util[_0xb5e0('0x1e')](_0xb5e0('0x27'),this[_0xb5e0('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0xb5e0('0x28')](this[_0xb5e0('0x4')][_0xb5e0('0x29')]):this['number']);};Action[_0xb5e0('0x25')][_0xb5e0('0x2a')]=function(){return this[_0xb5e0('0x2b')];};module[_0xb5e0('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 95b4aff..71685ec 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x783c=['membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','queue'];(function(_0x17e46e,_0x349a85){var _0xd49f2e=function(_0x1a2b2a){while(--_0x1a2b2a){_0x17e46e['push'](_0x17e46e['shift']());}};_0xd49f2e(++_0x349a85);}(_0x783c,0x1bb));var _0xc783=function(_0x638b19,_0x1811e7){_0x638b19=_0x638b19-0x0;var _0x443789=_0x783c[_0x638b19];return _0x443789;};'use strict';var util=require(_0xc783('0x0'));var _=require(_0xc783('0x1'));var moment=require(_0xc783('0x2'));function getSeconds(_0x316504,_0x39ad28){var _0x6bb34d=moment(_0x316504)[_0xc783('0x3')](0x0);var _0x536543=moment(_0x39ad28)[_0xc783('0x3')](0x0);return _0x6bb34d[_0xc783('0x4')](_0x536543,_0xc783('0x5'));}function AgentComplete(_0x1441ef,_0x394e98){this['state']=0x4;this[_0xc783('0x6')]=_0xc783('0x7');this[_0xc783('0x8')]=_0x1441ef[_0xc783('0x8')];this['type']=_0x1441ef[_0xc783('0x9')];this[_0xc783('0xa')]=_0x1441ef[_0xc783('0x9')]==='outbound'?'queue':_0x1441ef[_0xc783('0x9')];this[_0xc783('0xb')]=_0x1441ef['countbusyretry'];this['countcongestionretry']=_0x1441ef[_0xc783('0xc')];this[_0xc783('0xd')]=_0x1441ef[_0xc783('0xd')];this[_0xc783('0xe')]=_0x1441ef['countbusyretry']+_0x1441ef['countcongestionretry']+_0x1441ef[_0xc783('0xd')]+_0x1441ef[_0xc783('0xf')]+_0x1441ef[_0xc783('0x10')]+_0x1441ef[_0xc783('0x11')]+_0x1441ef['countmachineretry']+_0x1441ef['countagentrejectretry'];this[_0xc783('0xf')]=_0x1441ef[_0xc783('0xf')];this[_0xc783('0x10')]=_0x1441ef['countdropretry'];this['countabandonedretry']=_0x1441ef[_0xc783('0x11')];this[_0xc783('0x12')]=_0x1441ef['countmachineretry'];this[_0xc783('0x13')]=_0x1441ef[_0xc783('0x13')];this[_0xc783('0x14')]=_0x394e98[_0xc783('0x14')];this[_0xc783('0x15')]=_0x1441ef['name'];this['calleridnum']=_0x1441ef[_0xc783('0x16')];this[_0xc783('0x17')]=_0x1441ef[_0xc783('0x17')];this[_0xc783('0x18')]=_0x1441ef[_0xc783('0x18')];this[_0xc783('0x19')]=_0x1441ef[_0xc783('0x19')];this[_0xc783('0x1a')]=moment()['format'](_0xc783('0x1b'));this[_0xc783('0x1c')]=getSeconds(_0x1441ef[_0xc783('0x18')],_0x1441ef['starttime']);this['holdtime']=getSeconds(_0x1441ef[_0xc783('0x19')],_0x1441ef[_0xc783('0x18')]);this['talktime']=getSeconds(this[_0xc783('0x1a')],_0x1441ef[_0xc783('0x19')]);this[_0xc783('0x1d')]=_0x394e98['queue'];this[_0xc783('0x1e')]=_0x394e98[_0xc783('0x1e')];this[_0xc783('0x1f')]=_0x394e98[_0xc783('0x1f')];this['callback']=_0x1441ef['callback'];this[_0xc783('0x20')]=_0x1441ef[_0xc783('0x20')];this[_0xc783('0x21')]=_0x1441ef[_0xc783('0x21')];this[_0xc783('0x22')]=_0x1441ef[_0xc783('0x22')];this['ContactId']=_0x1441ef[_0xc783('0x23')];this[_0xc783('0x24')]=_0x1441ef[_0xc783('0x24')];this[_0xc783('0x25')]=_0x1441ef['UserId'];this[_0xc783('0x26')]=_0x1441ef['VoiceQueueId'];this[_0xc783('0x27')]=_0x1441ef['CampaignId'];this[_0xc783('0x28')]=_0x1441ef[_0xc783('0x28')]||'';this[_0xc783('0x29')]=_0x1441ef[_0xc783('0x29')]||'';}module[_0xc783('0x2a')]=AgentComplete; \ No newline at end of file +var _0x900e=['originatecalleridnum','originatecalleridname','exports','moment','milliseconds','state','statedesc','Answer','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x178633,_0x27bc1a){var _0x57b65b=function(_0xdfdcbb){while(--_0xdfdcbb){_0x178633['push'](_0x178633['shift']());}};_0x57b65b(++_0x27bc1a);}(_0x900e,0x1bb));var _0xe900=function(_0x23a299,_0x30e49c){_0x23a299=_0x23a299-0x0;var _0x560bb3=_0x900e[_0x23a299];return _0x560bb3;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe900('0x0'));function getSeconds(_0x162135,_0x2c5bdc){var _0x20e65a=moment(_0x162135)[_0xe900('0x1')](0x0);var _0x358c4c=moment(_0x2c5bdc)[_0xe900('0x1')](0x0);return _0x20e65a['diff'](_0x358c4c,'seconds');}function AgentComplete(_0x526073,_0x454108){this[_0xe900('0x2')]=0x4;this[_0xe900('0x3')]=_0xe900('0x4');this['scheduledat']=_0x526073['scheduledat'];this['type']=_0x526073['type'];this['campaigntype']=_0x526073[_0xe900('0x5')]===_0xe900('0x6')?_0xe900('0x7'):_0x526073[_0xe900('0x5')];this[_0xe900('0x8')]=_0x526073[_0xe900('0x8')];this['countcongestionretry']=_0x526073[_0xe900('0x9')];this[_0xe900('0xa')]=_0x526073[_0xe900('0xa')];this['countglobal']=_0x526073['countbusyretry']+_0x526073[_0xe900('0x9')]+_0x526073[_0xe900('0xa')]+_0x526073[_0xe900('0xb')]+_0x526073[_0xe900('0xc')]+_0x526073[_0xe900('0xd')]+_0x526073['countmachineretry']+_0x526073[_0xe900('0xe')];this[_0xe900('0xb')]=_0x526073['countnosuchnumberretry'];this['countdropretry']=_0x526073[_0xe900('0xc')];this[_0xe900('0xd')]=_0x526073[_0xe900('0xd')];this[_0xe900('0xf')]=_0x526073[_0xe900('0xf')];this[_0xe900('0xe')]=_0x526073[_0xe900('0xe')];this[_0xe900('0x10')]=_0x454108['uniqueid'];this['calleridname']=_0x526073[_0xe900('0x11')];this['calleridnum']=_0x526073['number'];this['starttime']=_0x526073[_0xe900('0x12')];this[_0xe900('0x13')]=_0x526073['responsetime'];this[_0xe900('0x14')]=_0x526073[_0xe900('0x14')];this[_0xe900('0x15')]=moment()[_0xe900('0x16')](_0xe900('0x17'));this[_0xe900('0x18')]=getSeconds(_0x526073[_0xe900('0x13')],_0x526073[_0xe900('0x12')]);this[_0xe900('0x19')]=getSeconds(_0x526073[_0xe900('0x14')],_0x526073[_0xe900('0x13')]);this['talktime']=getSeconds(this[_0xe900('0x15')],_0x526073[_0xe900('0x14')]);this[_0xe900('0x7')]=_0x454108[_0xe900('0x7')];this['membername']=_0x454108[_0xe900('0x1a')];this[_0xe900('0x1b')]=_0x454108[_0xe900('0x1b')];this[_0xe900('0x1c')]=_0x526073['callback'];this[_0xe900('0x1d')]=_0x526073[_0xe900('0x1d')];this['callbackat']=_0x526073[_0xe900('0x1e')];this[_0xe900('0x1f')]=_0x526073['recallme'];this[_0xe900('0x20')]=_0x526073['ContactId'];this[_0xe900('0x21')]=_0x526073[_0xe900('0x21')];this[_0xe900('0x22')]=_0x526073[_0xe900('0x22')];this[_0xe900('0x23')]=_0x526073[_0xe900('0x23')];this[_0xe900('0x24')]=_0x526073['CampaignId'];this[_0xe900('0x25')]=_0x526073['originatecalleridnum']||'';this[_0xe900('0x26')]=_0x526073[_0xe900('0x26')]||'';}module[_0xe900('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 1376835..2994e87 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac31=['holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime'];(function(_0x354083,_0x1a40bb){var _0x37e5a2=function(_0x42505e){while(--_0x42505e){_0x354083['push'](_0x354083['shift']());}};_0x37e5a2(++_0x1a40bb);}(_0xac31,0xca));var _0x1ac3=function(_0x1128fe,_0x547104){_0x1128fe=_0x1128fe-0x0;var _0x5d969c=_0xac31[_0x1128fe];return _0x5d969c;};'use strict';var util=require(_0x1ac3('0x0'));var _=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));function getSeconds(_0x3086c0,_0xd6934){var _0x11dd6d=moment(_0x3086c0)[_0x1ac3('0x3')](0x0);var _0x59b42c=moment(_0xd6934)[_0x1ac3('0x3')](0x0);return _0x11dd6d[_0x1ac3('0x4')](_0x59b42c,'seconds');}function Final(_0x5ef1b6){this[_0x1ac3('0x5')]=_0x5ef1b6[_0x1ac3('0x5')];this[_0x1ac3('0x6')]=_0x5ef1b6[_0x1ac3('0x6')];this[_0x1ac3('0x7')]=_0x5ef1b6['type'];this[_0x1ac3('0x8')]=_0x5ef1b6['type']===_0x1ac3('0x9')?_0x1ac3('0xa'):_0x5ef1b6[_0x1ac3('0x7')];this['countbusyretry']=_0x5ef1b6[_0x1ac3('0xb')];this[_0x1ac3('0xc')]=_0x5ef1b6[_0x1ac3('0xc')];this[_0x1ac3('0xd')]=_0x5ef1b6[_0x1ac3('0xd')];this[_0x1ac3('0xe')]=_0x5ef1b6['countbusyretry']+_0x5ef1b6[_0x1ac3('0xc')]+_0x5ef1b6[_0x1ac3('0xd')]+_0x5ef1b6[_0x1ac3('0xf')]+_0x5ef1b6[_0x1ac3('0x10')]+_0x5ef1b6['countabandonedretry']+_0x5ef1b6[_0x1ac3('0x11')]+_0x5ef1b6[_0x1ac3('0x12')];this[_0x1ac3('0xf')]=_0x5ef1b6[_0x1ac3('0xf')];this['countdropretry']=_0x5ef1b6[_0x1ac3('0x10')];this[_0x1ac3('0x13')]=_0x5ef1b6['countabandonedretry'];this[_0x1ac3('0x11')]=_0x5ef1b6[_0x1ac3('0x11')];this[_0x1ac3('0x12')]=_0x5ef1b6['countagentrejectretry'];this[_0x1ac3('0xa')]=_0x5ef1b6[_0x1ac3('0xa')];this[_0x1ac3('0x14')]=_0x5ef1b6['calleridname'];this[_0x1ac3('0x15')]=_0x5ef1b6['calleridnum'];this[_0x1ac3('0x16')]=_0x5ef1b6[_0x1ac3('0x16')];this[_0x1ac3('0x17')]=_0x5ef1b6[_0x1ac3('0x17')];this[_0x1ac3('0x18')]=_0x5ef1b6['responsetime'];this[_0x1ac3('0x19')]=_0x5ef1b6[_0x1ac3('0x19')]||0x0;this[_0x1ac3('0x1a')]=_0x5ef1b6[_0x1ac3('0x1a')]||0x0;this['talktime']=_0x5ef1b6['talktime']||0x0;this[_0x1ac3('0x1b')]=_0x5ef1b6[_0x1ac3('0x1b')];this[_0x1ac3('0x1c')]=_0x5ef1b6[_0x1ac3('0x1c')];this[_0x1ac3('0x1d')]=_0x5ef1b6[_0x1ac3('0x1d')];this[_0x1ac3('0x1e')]=_0x5ef1b6[_0x1ac3('0x1e')];this[_0x1ac3('0x1f')]=_0x5ef1b6['ContactId'];this[_0x1ac3('0x20')]=_0x5ef1b6[_0x1ac3('0x20')];this['UserId']=_0x5ef1b6[_0x1ac3('0x21')];this[_0x1ac3('0x22')]=_0x5ef1b6['VoiceQueueId'];this[_0x1ac3('0x23')]=_0x5ef1b6[_0x1ac3('0x23')];this[_0x1ac3('0x24')]=_0x5ef1b6[_0x1ac3('0x24')]||'';this[_0x1ac3('0x25')]=_0x5ef1b6['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0x61a5=['scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','moment','milliseconds','diff','uniqueid'];(function(_0x25abd4,_0x5311b7){var _0x3eec65=function(_0x19015d){while(--_0x19015d){_0x25abd4['push'](_0x25abd4['shift']());}};_0x3eec65(++_0x5311b7);}(_0x61a5,0xf0));var _0x561a=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0x61a5[_0x29632e];return _0x426e04;};'use strict';var util=require(_0x561a('0x0'));var _=require('lodash');var moment=require(_0x561a('0x1'));function getSeconds(_0x28892d,_0xc164c0){var _0x862a0e=moment(_0x28892d)[_0x561a('0x2')](0x0);var _0x58f636=moment(_0xc164c0)[_0x561a('0x2')](0x0);return _0x862a0e[_0x561a('0x3')](_0x58f636,'seconds');}function Final(_0x18902a){this[_0x561a('0x4')]=_0x18902a[_0x561a('0x4')];this[_0x561a('0x5')]=_0x18902a[_0x561a('0x5')];this[_0x561a('0x6')]=_0x18902a[_0x561a('0x6')];this['campaigntype']=_0x18902a[_0x561a('0x6')]==='outbound'?_0x561a('0x7'):_0x18902a[_0x561a('0x6')];this['countbusyretry']=_0x18902a[_0x561a('0x8')];this[_0x561a('0x9')]=_0x18902a['countcongestionretry'];this[_0x561a('0xa')]=_0x18902a['countnoanswerretry'];this[_0x561a('0xb')]=_0x18902a[_0x561a('0x8')]+_0x18902a[_0x561a('0x9')]+_0x18902a[_0x561a('0xa')]+_0x18902a[_0x561a('0xc')]+_0x18902a[_0x561a('0xd')]+_0x18902a[_0x561a('0xe')]+_0x18902a[_0x561a('0xf')]+_0x18902a[_0x561a('0x10')];this[_0x561a('0xc')]=_0x18902a[_0x561a('0xc')];this[_0x561a('0xd')]=_0x18902a['countdropretry'];this[_0x561a('0xe')]=_0x18902a[_0x561a('0xe')];this[_0x561a('0xf')]=_0x18902a[_0x561a('0xf')];this[_0x561a('0x10')]=_0x18902a[_0x561a('0x10')];this[_0x561a('0x7')]=_0x18902a[_0x561a('0x7')];this[_0x561a('0x11')]=_0x18902a[_0x561a('0x11')];this[_0x561a('0x12')]=_0x18902a['calleridnum'];this[_0x561a('0x13')]=_0x18902a[_0x561a('0x13')];this['responsetime']=_0x18902a[_0x561a('0x14')];this[_0x561a('0x15')]=_0x18902a['responsetime'];this[_0x561a('0x16')]=_0x18902a['ringtime']||0x0;this['holdtime']=_0x18902a[_0x561a('0x17')]||0x0;this[_0x561a('0x18')]=_0x18902a['talktime']||0x0;this[_0x561a('0x19')]=_0x18902a[_0x561a('0x19')];this[_0x561a('0x1a')]=_0x18902a[_0x561a('0x1a')];this[_0x561a('0x1b')]=_0x18902a[_0x561a('0x1b')];this['recallme']=_0x18902a[_0x561a('0x1c')];this[_0x561a('0x1d')]=_0x18902a[_0x561a('0x1d')];this['ListId']=_0x18902a['ListId'];this[_0x561a('0x1e')]=_0x18902a[_0x561a('0x1e')];this[_0x561a('0x1f')]=_0x18902a[_0x561a('0x1f')];this[_0x561a('0x20')]=_0x18902a[_0x561a('0x20')];this[_0x561a('0x21')]=_0x18902a[_0x561a('0x21')]||'';this['originatecalleridname']=_0x18902a['originatecalleridname']||'';}module[_0x561a('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index dcb673d..a0a5476 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc888=['seconds','state','statedesc','Answer','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff'];(function(_0x4f3dc6,_0x142692){var _0x3afd34=function(_0x215002){while(--_0x215002){_0x4f3dc6['push'](_0x4f3dc6['shift']());}};_0x3afd34(++_0x142692);}(_0xc888,0x191));var _0x8c88=function(_0x397d61,_0x1f2002){_0x397d61=_0x397d61-0x0;var _0x270833=_0xc888[_0x397d61];return _0x270833;};'use strict';var util=require(_0x8c88('0x0'));var _=require(_0x8c88('0x1'));var moment=require('moment');function getSeconds(_0x14f057,_0x5339f2){var _0x2658bd=moment(_0x14f057)[_0x8c88('0x2')](0x0);var _0x508647=moment(_0x5339f2)[_0x8c88('0x2')](0x0);return _0x2658bd[_0x8c88('0x3')](_0x508647,_0x8c88('0x4'));}function Hangup(_0x12187c,_0x617c97){this[_0x8c88('0x5')]=0x4;this[_0x8c88('0x6')]=_0x8c88('0x7');this[_0x8c88('0x8')]=_0x12187c['scheduledat'];this['type']=_0x12187c['type'];this[_0x8c88('0x9')]=_0x12187c[_0x8c88('0xa')]===_0x8c88('0xb')?_0x8c88('0xc'):_0x12187c[_0x8c88('0xa')];this[_0x8c88('0xd')]=_0x12187c[_0x8c88('0xd')];this[_0x8c88('0xe')]=_0x12187c[_0x8c88('0xe')];this[_0x8c88('0xf')]=_0x12187c[_0x8c88('0xf')];this['countglobal']=_0x12187c[_0x8c88('0xd')]+_0x12187c[_0x8c88('0xe')]+_0x12187c[_0x8c88('0xf')]+_0x12187c['countnosuchnumberretry']+_0x12187c[_0x8c88('0x10')]+_0x12187c[_0x8c88('0x11')]+_0x12187c[_0x8c88('0x12')]+_0x12187c[_0x8c88('0x13')];this[_0x8c88('0x14')]=_0x12187c[_0x8c88('0x14')];this['countdropretry']=_0x12187c['countdropretry'];this['countabandonedretry']=_0x12187c[_0x8c88('0x11')];this[_0x8c88('0x12')]=_0x12187c[_0x8c88('0x12')];this[_0x8c88('0x13')]=_0x12187c[_0x8c88('0x13')];this[_0x8c88('0x15')]=_0x617c97[_0x8c88('0x15')];this[_0x8c88('0x16')]=_0x12187c[_0x8c88('0x17')];this['calleridnum']=_0x12187c[_0x8c88('0x18')];this[_0x8c88('0x19')]=_0x12187c[_0x8c88('0x19')];this[_0x8c88('0x1a')]=_0x12187c[_0x8c88('0x1a')];this[_0x8c88('0x1b')]=moment()[_0x8c88('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8c88('0x1d')]=getSeconds(_0x12187c['responsetime'],_0x12187c[_0x8c88('0x19')]);this[_0x8c88('0x1e')]=0x0;this[_0x8c88('0x1f')]=getSeconds(this[_0x8c88('0x1b')],_0x12187c['responsetime']);this[_0x8c88('0xc')]=_0x12187c[_0x8c88('0xc')];this[_0x8c88('0x20')]=_0x8c88('0x21');this['reason']=_0x617c97[_0x8c88('0x22')];this[_0x8c88('0x23')]=_0x12187c[_0x8c88('0x23')];this['callbackuniqueid']=_0x12187c[_0x8c88('0x24')];this[_0x8c88('0x25')]=_0x12187c[_0x8c88('0x25')];this[_0x8c88('0x26')]=_0x12187c[_0x8c88('0x26')];this['ContactId']=_0x12187c[_0x8c88('0x27')];this[_0x8c88('0x28')]=_0x12187c[_0x8c88('0x28')];this[_0x8c88('0x29')]=_0x12187c[_0x8c88('0x29')];this['VoiceQueueId']=_0x12187c[_0x8c88('0x2a')];this[_0x8c88('0x2b')]=_0x12187c[_0x8c88('0x2b')];}module[_0x8c88('0x2c')]=Hangup; \ No newline at end of file +var _0x5d25=['membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue'];(function(_0x58ef5c,_0x5f4162){var _0x40c70b=function(_0x2c0ede){while(--_0x2c0ede){_0x58ef5c['push'](_0x58ef5c['shift']());}};_0x40c70b(++_0x5f4162);}(_0x5d25,0xf3));var _0x55d2=function(_0x222cfe,_0x1be94c){_0x222cfe=_0x222cfe-0x0;var _0xcb1d4=_0x5d25[_0x222cfe];return _0xcb1d4;};'use strict';var util=require(_0x55d2('0x0'));var _=require(_0x55d2('0x1'));var moment=require('moment');function getSeconds(_0x1732dd,_0xc136ee){var _0x18d05b=moment(_0x1732dd)[_0x55d2('0x2')](0x0);var _0x6dc383=moment(_0xc136ee)['milliseconds'](0x0);return _0x18d05b[_0x55d2('0x3')](_0x6dc383,_0x55d2('0x4'));}function Hangup(_0x13e8c5,_0x569211){this['state']=0x4;this[_0x55d2('0x5')]='Answer';this[_0x55d2('0x6')]=_0x13e8c5[_0x55d2('0x6')];this[_0x55d2('0x7')]=_0x13e8c5[_0x55d2('0x7')];this[_0x55d2('0x8')]=_0x13e8c5[_0x55d2('0x7')]===_0x55d2('0x9')?'queue':_0x13e8c5[_0x55d2('0x7')];this[_0x55d2('0xa')]=_0x13e8c5[_0x55d2('0xa')];this[_0x55d2('0xb')]=_0x13e8c5[_0x55d2('0xb')];this[_0x55d2('0xc')]=_0x13e8c5[_0x55d2('0xc')];this[_0x55d2('0xd')]=_0x13e8c5[_0x55d2('0xa')]+_0x13e8c5[_0x55d2('0xb')]+_0x13e8c5[_0x55d2('0xc')]+_0x13e8c5[_0x55d2('0xe')]+_0x13e8c5['countdropretry']+_0x13e8c5[_0x55d2('0xf')]+_0x13e8c5[_0x55d2('0x10')]+_0x13e8c5['countagentrejectretry'];this['countnosuchnumberretry']=_0x13e8c5[_0x55d2('0xe')];this[_0x55d2('0x11')]=_0x13e8c5[_0x55d2('0x11')];this[_0x55d2('0xf')]=_0x13e8c5['countabandonedretry'];this[_0x55d2('0x10')]=_0x13e8c5[_0x55d2('0x10')];this[_0x55d2('0x12')]=_0x13e8c5['countagentrejectretry'];this[_0x55d2('0x13')]=_0x569211[_0x55d2('0x13')];this[_0x55d2('0x14')]=_0x13e8c5[_0x55d2('0x15')];this[_0x55d2('0x16')]=_0x13e8c5[_0x55d2('0x17')];this[_0x55d2('0x18')]=_0x13e8c5[_0x55d2('0x18')];this[_0x55d2('0x19')]=_0x13e8c5['responsetime'];this[_0x55d2('0x1a')]=moment()[_0x55d2('0x1b')](_0x55d2('0x1c'));this[_0x55d2('0x1d')]=getSeconds(_0x13e8c5['responsetime'],_0x13e8c5[_0x55d2('0x18')]);this[_0x55d2('0x1e')]=0x0;this[_0x55d2('0x1f')]=getSeconds(this[_0x55d2('0x1a')],_0x13e8c5[_0x55d2('0x19')]);this[_0x55d2('0x20')]=_0x13e8c5[_0x55d2('0x20')];this[_0x55d2('0x21')]=_0x55d2('0x22');this[_0x55d2('0x23')]=_0x569211[_0x55d2('0x24')];this[_0x55d2('0x25')]=_0x13e8c5[_0x55d2('0x25')];this[_0x55d2('0x26')]=_0x13e8c5[_0x55d2('0x26')];this[_0x55d2('0x27')]=_0x13e8c5[_0x55d2('0x27')];this[_0x55d2('0x28')]=_0x13e8c5[_0x55d2('0x28')];this[_0x55d2('0x29')]=_0x13e8c5['ContactId'];this[_0x55d2('0x2a')]=_0x13e8c5['ListId'];this['UserId']=_0x13e8c5[_0x55d2('0x2b')];this[_0x55d2('0x2c')]=_0x13e8c5['VoiceQueueId'];this[_0x55d2('0x2d')]=_0x13e8c5[_0x55d2('0x2d')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index b6a401c..64488b2 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd80d=['milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','exports','util','lodash'];(function(_0xde3a3b,_0x5a97ab){var _0x3281c3=function(_0x4502d5){while(--_0x4502d5){_0xde3a3b['push'](_0xde3a3b['shift']());}};_0x3281c3(++_0x5a97ab);}(_0xd80d,0x10f));var _0xdd80=function(_0x3755e6,_0x4df500){_0x3755e6=_0x3755e6-0x0;var _0x1c7f67=_0xd80d[_0x3755e6];return _0x1c7f67;};'use strict';var util=require(_0xdd80('0x0'));var _=require(_0xdd80('0x1'));var moment=require('moment');function getSeconds(_0x411c59,_0x584c92){var _0x5bae27=moment(_0x411c59)[_0xdd80('0x2')](0x0);var _0x2c79b1=moment(_0x584c92)[_0xdd80('0x2')](0x0);return _0x5bae27[_0xdd80('0x3')](_0x2c79b1,_0xdd80('0x4'));}function History(_0x29f7bd){this[_0xdd80('0x5')]=_0x29f7bd['uniqueid'];this[_0xdd80('0x6')]=_0x29f7bd['scheduledat']||undefined;this['type']=_0x29f7bd[_0xdd80('0x7')];this[_0xdd80('0x8')]=_0x29f7bd[_0xdd80('0x7')]===_0xdd80('0x9')?_0xdd80('0xa'):_0x29f7bd[_0xdd80('0x7')];this[_0xdd80('0xb')]=_0x29f7bd[_0xdd80('0xb')];this[_0xdd80('0xc')]=_0x29f7bd['countcongestionretry'];this['countnoanswerretry']=_0x29f7bd[_0xdd80('0xd')];this[_0xdd80('0xe')]=_0x29f7bd[_0xdd80('0xb')]+_0x29f7bd[_0xdd80('0xc')]+_0x29f7bd[_0xdd80('0xd')]+_0x29f7bd[_0xdd80('0xf')]+_0x29f7bd[_0xdd80('0x10')]+_0x29f7bd[_0xdd80('0x11')]+_0x29f7bd[_0xdd80('0x12')]+_0x29f7bd['countagentrejectretry'];this[_0xdd80('0xf')]=_0x29f7bd[_0xdd80('0xf')];this[_0xdd80('0x10')]=_0x29f7bd[_0xdd80('0x10')];this[_0xdd80('0x11')]=_0x29f7bd[_0xdd80('0x11')];this[_0xdd80('0x12')]=_0x29f7bd[_0xdd80('0x12')];this['countagentrejectretry']=_0x29f7bd[_0xdd80('0x13')];this[_0xdd80('0xa')]=_0x29f7bd[_0xdd80('0xa')];this[_0xdd80('0x14')]=_0x29f7bd['name'];this[_0xdd80('0x15')]=_0x29f7bd[_0xdd80('0x16')];this[_0xdd80('0x17')]=_0x29f7bd[_0xdd80('0x17')];this[_0xdd80('0x18')]=_0x29f7bd[_0xdd80('0x18')];this[_0xdd80('0x19')]=_0x29f7bd['responsetime'];this[_0xdd80('0x1a')]=getSeconds(_0x29f7bd[_0xdd80('0x18')],_0x29f7bd[_0xdd80('0x17')]);this[_0xdd80('0x1b')]=0x0;this[_0xdd80('0x1c')]=0x0;this[_0xdd80('0x1d')]=_0x29f7bd[_0xdd80('0x1d')];this[_0xdd80('0x1e')]=_0x29f7bd[_0xdd80('0x1e')];this[_0xdd80('0x1f')]=_0x29f7bd['callbackat'];this[_0xdd80('0x20')]=_0x29f7bd['recallme'];this[_0xdd80('0x21')]=_0x29f7bd['ContactId'];this[_0xdd80('0x22')]=_0x29f7bd[_0xdd80('0x22')];this[_0xdd80('0x23')]=_0x29f7bd[_0xdd80('0x23')];this['VoiceQueueId']=_0x29f7bd['VoiceQueueId'];this[_0xdd80('0x24')]=_0x29f7bd[_0xdd80('0x24')];this[_0xdd80('0x25')]=_0x29f7bd['originatecalleridnum']||'';this['originatecalleridname']=_0x29f7bd['originatecalleridname']||'';}module[_0xdd80('0x26')]=History; \ No newline at end of file +var _0x9806=['number','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','calleridname'];(function(_0x3e65b2,_0x6fb4b4){var _0x45c991=function(_0x9a73dc){while(--_0x9a73dc){_0x3e65b2['push'](_0x3e65b2['shift']());}};_0x45c991(++_0x6fb4b4);}(_0x9806,0x121));var _0x6980=function(_0x12c4cc,_0x5859a5){_0x12c4cc=_0x12c4cc-0x0;var _0x118cc1=_0x9806[_0x12c4cc];return _0x118cc1;};'use strict';var util=require(_0x6980('0x0'));var _=require(_0x6980('0x1'));var moment=require('moment');function getSeconds(_0x4b078f,_0x26a5f7){var _0x196bfd=moment(_0x4b078f)[_0x6980('0x2')](0x0);var _0x4ec650=moment(_0x26a5f7)['milliseconds'](0x0);return _0x196bfd['diff'](_0x4ec650,'seconds');}function History(_0x32f638){this[_0x6980('0x3')]=_0x32f638['uniqueid'];this[_0x6980('0x4')]=_0x32f638[_0x6980('0x4')]||undefined;this[_0x6980('0x5')]=_0x32f638[_0x6980('0x5')];this[_0x6980('0x6')]=_0x32f638['type']===_0x6980('0x7')?_0x6980('0x8'):_0x32f638['type'];this[_0x6980('0x9')]=_0x32f638[_0x6980('0x9')];this[_0x6980('0xa')]=_0x32f638['countcongestionretry'];this[_0x6980('0xb')]=_0x32f638[_0x6980('0xb')];this['countglobal']=_0x32f638['countbusyretry']+_0x32f638[_0x6980('0xa')]+_0x32f638[_0x6980('0xb')]+_0x32f638['countnosuchnumberretry']+_0x32f638['countdropretry']+_0x32f638['countabandonedretry']+_0x32f638[_0x6980('0xc')]+_0x32f638['countagentrejectretry'];this[_0x6980('0xd')]=_0x32f638[_0x6980('0xd')];this['countdropretry']=_0x32f638['countdropretry'];this[_0x6980('0xe')]=_0x32f638['countabandonedretry'];this['countmachineretry']=_0x32f638[_0x6980('0xc')];this['countagentrejectretry']=_0x32f638[_0x6980('0xf')];this[_0x6980('0x8')]=_0x32f638['queue'];this[_0x6980('0x10')]=_0x32f638['name'];this['calleridnum']=_0x32f638[_0x6980('0x11')];this[_0x6980('0x12')]=_0x32f638[_0x6980('0x12')];this['responsetime']=_0x32f638[_0x6980('0x13')];this['endtime']=_0x32f638[_0x6980('0x13')];this[_0x6980('0x14')]=getSeconds(_0x32f638[_0x6980('0x13')],_0x32f638[_0x6980('0x12')]);this[_0x6980('0x15')]=0x0;this['talktime']=0x0;this[_0x6980('0x16')]=_0x32f638[_0x6980('0x16')];this['callbackuniqueid']=_0x32f638[_0x6980('0x17')];this[_0x6980('0x18')]=_0x32f638[_0x6980('0x18')];this['recallme']=_0x32f638[_0x6980('0x19')];this[_0x6980('0x1a')]=_0x32f638[_0x6980('0x1a')];this[_0x6980('0x1b')]=_0x32f638[_0x6980('0x1b')];this[_0x6980('0x1c')]=_0x32f638[_0x6980('0x1c')];this[_0x6980('0x1d')]=_0x32f638[_0x6980('0x1d')];this['CampaignId']=_0x32f638[_0x6980('0x1e')];this[_0x6980('0x1f')]=_0x32f638[_0x6980('0x1f')]||'';this[_0x6980('0x20')]=_0x32f638[_0x6980('0x20')]||'';}module[_0x6980('0x21')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index dbd1ff3..5752a8b 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 _0x4bbd=['dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','checkRetriveMax','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','maxNumberOriginate','dialOrderByScheduledAt','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[countReScheduled]\x20','ACTIVE','RUNNING','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','Contact.phone','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/logger','dialer','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','campaigns','agents','trunks','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','queuemember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice_queue:save','ivr','format','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','startProgressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','error','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','actions','sequence','status','channel','catch','updateOriginated','voiceQueues','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','then','swapAdditionalPhones','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isTrunkReachable','reachable','SIP/%s','unmonitored','syncVarSet','uniqueid','variable','amdstatus','exten','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countabandonedretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','queueCallerAbandonCreateState','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','ListId','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','actionid','isNil','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','true','Action','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','online','map','[syncCampaigns]','\x5cw{0,','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','%s%s','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','response','callProgressDetecting','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry'];(function(_0x3bea52,_0x36f47c){var _0x1283cc=function(_0x97701b){while(--_0x97701b){_0x3bea52['push'](_0x3bea52['shift']());}};_0x1283cc(++_0x36f47c);}(_0x4bbd,0x86));var _0xd4bb=function(_0x39d30d,_0x2f9080){_0x39d30d=_0x39d30d-0x0;var _0x387e25=_0x4bbd[_0x39d30d];return _0x387e25;};'use strict';var util=require(_0xd4bb('0x0'));var _=require(_0xd4bb('0x1'));var uuid=require(_0xd4bb('0x2'));var moment=require(_0xd4bb('0x3'));var rr=require('rr');var md5=require(_0xd4bb('0x4'));var Redis=require(_0xd4bb('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0xd4bb('0x6'))(_0xd4bb('0x7'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0xd4bb('0x6'))(_0xd4bb('0x8'));var loggerPredictiveCalls=require(_0xd4bb('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xd4bb('0x6'))(_0xd4bb('0x9'));var ami=require(_0xd4bb('0xa'));config[_0xd4bb('0xb')]=_[_0xd4bb('0xc')](config[_0xd4bb('0xb')],{'host':_0xd4bb('0xd'),'port':0x18eb});var io=require(_0xd4bb('0xe'))(new Redis(config[_0xd4bb('0xb')]));var cmHopper=require(_0xd4bb('0xf'));var cmHopperHistory=require(_0xd4bb('0x10'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0xd4bb('0x11'));var voiceQueueRt=require(_0xd4bb('0x12'));var RpcSetting=require('../rpc/setting');var Action=require(_0xd4bb('0x13'));var History=require(_0xd4bb('0x14'));var Final=require(_0xd4bb('0x15'));var AgentComplete=require(_0xd4bb('0x16'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xd4bb('0x17')][_0xd4bb('0x18')]||_0xd4bb('0x19');var strategy={'rrmemory':_0xd4bb('0x1a'),'roundrobin':_0xd4bb('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xd4bb('0x1c')][_0xd4bb('0x1d')]=function(_0x121930){this['tail']=this[_0xd4bb('0x1e')]?this[_0xd4bb('0x1e')][_0xd4bb('0x1f')](_0x121930):_0x121930();};function Dialer(_0x3067d2,_0x4f2100){this['sequence']=new Sequence();this[_0xd4bb('0x20')]=_0x4f2100;this['voiceQueues']=_0x3067d2['voiceQueues'];this[_0xd4bb('0x21')]=_0x3067d2[_0xd4bb('0x21')];this['agents']=_0x3067d2[_0xd4bb('0x22')];this[_0xd4bb('0x23')]=_0x3067d2[_0xd4bb('0x23')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this['actions']={};this[_0xd4bb('0x24')]={};this[_0xd4bb('0x25')]={};this[_0xd4bb('0x26')]={};this[_0xd4bb('0x27')]={};this['startProgressive']={};this[_0xd4bb('0x28')]={};this[_0xd4bb('0x29')]={};this[_0xd4bb('0x2a')]={};ami['on'](_0xd4bb('0x2b'),this[_0xd4bb('0x2c')]['bind'](this));ami['on'](_0xd4bb('0x2d'),this[_0xd4bb('0x2e')][_0xd4bb('0x2f')](this));ami['on'](_0xd4bb('0x30'),this[_0xd4bb('0x31')]['bind'](this));ami['on'](_0xd4bb('0x32'),this[_0xd4bb('0x33')][_0xd4bb('0x2f')](this));ami['on'](_0xd4bb('0x34'),this[_0xd4bb('0x9')][_0xd4bb('0x2f')](this));ami['on']('custom:queuesummarycomplete',this[_0xd4bb('0x35')][_0xd4bb('0x2f')](this));ami['on']('hangup',this[_0xd4bb('0x36')][_0xd4bb('0x2f')](this));ami['on'](_0xd4bb('0x37'),this[_0xd4bb('0x38')]['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0xd4bb('0x39'),this['syncQueueMember'][_0xd4bb('0x2f')](this));ami['on'](_0xd4bb('0x3a'),this['syncQueueStatusComplete'][_0xd4bb('0x2f')](this));this[_0xd4bb('0x3b')]();this[_0xd4bb('0x3c')]();RpcSetting[_0xd4bb('0x3d')]()['then'](function(_0x88553){previewRecallmeReminderInterval=_0x88553[_0xd4bb('0x3e')];});}function isNotNull(_0x22305c){return _0x22305c!==null&&!_['isUndefined'](_0x22305c);}function checkIsLoggedIn(_0x565a8a,_0x5665b4){return function(){if(_0x5665b4<=0x0){_0x565a8a[_0xd4bb('0x3f')]=_0xd4bb('0x40');throw _0x565a8a[_0xd4bb('0x41')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x2e1d56){return _0x2e1d56;}function checkIsActive(_0x188f68,_0x131ce7){return function(){if(!isActive(_0x131ce7)){_0x188f68[_0xd4bb('0x3f')]=_0xd4bb('0x42');throw _0x188f68[_0xd4bb('0x41')]+_0xd4bb('0x43');}};}function checkInterval(_0x31b777){return function(){if(!isNotNull(_0x31b777[_0xd4bb('0x44')])){_0x31b777[_0xd4bb('0x3f')]=_0xd4bb('0x45');throw _0x31b777[_0xd4bb('0x41')]+_0xd4bb('0x46');}if(!isNotNull(_0x31b777['Interval']['Intervals'])){_0x31b777[_0xd4bb('0x3f')]='INTERVAL_IS_NULL';throw _0x31b777[_0xd4bb('0x41')]+_0xd4bb('0x46');}if(!isNotNull(_[_0xd4bb('0x47')](_0x31b777[_0xd4bb('0x44')][_0xd4bb('0x48')]))){_0x31b777['message']=_0xd4bb('0x45');throw _0x31b777[_0xd4bb('0x41')]+_0xd4bb('0x46');}};}function msgResponse(_0x51c0ab,_0x4cf4cb,_0x207d6){return{'action':_0x51c0ab,'response':_0x4cf4cb,'message':_0x207d6,'stack':_0x207d6};}function myreject(_0x2002e3){return function(_0x40e32b){return _0x2002e3(msgResponse(_0xd4bb('0x49'),_0xd4bb('0x4a'),JSON[_0xd4bb('0x4b')](_0x40e32b)));};}function getSeconds(_0x5f211a,_0x1916e7){var _0x24cf74=moment(_0x5f211a)[_0xd4bb('0x4c')](0x0);var _0x49e0b0=moment(_0x1916e7)[_0xd4bb('0x4c')](0x0);return _0x24cf74[_0xd4bb('0x4d')](_0x49e0b0,'seconds');}function emit(_0x4873c0,_0x4d11e9,_0x3d94dd){io['to'](_0x4873c0)['emit'](_0x4d11e9,_0x3d94dd);}function emitVoiceQueueSummary(_0x177250){if(_0x177250['type']===_0xd4bb('0x4e')){var _0x42ab77={'id':_0x177250['id'],'name':_0x177250[_0xd4bb('0x41')],'strategy':_0x177250[_0xd4bb('0x4f')],'answered':_0x177250['answered'],'available':_0x177250[_0xd4bb('0x50')],'loggedIn':_0x177250[_0xd4bb('0x51')],'pTalking':_0x177250[_0xd4bb('0x52')],'sumBillable':_0x177250[_0xd4bb('0x53')],'sumDuration':_0x177250[_0xd4bb('0x54')],'sumHoldTime':_0x177250[_0xd4bb('0x55')]||0x0,'talking':_0x177250[_0xd4bb('0x56')],'total':_0x177250[_0xd4bb('0x57')],'type':_0x177250[_0xd4bb('0x58')],'unmanaged':_0x177250['unmanaged'],'abandoned':_0x177250['abandoned'],'waiting':_0x177250[_0xd4bb('0x59')],'loggedInDb':_0x177250[_0xd4bb('0x5a')],'dialActive':_0x177250[_0xd4bb('0x5b')],'dialMethod':_0x177250[_0xd4bb('0x5c')],'dialOriginateCallerIdName':_0x177250['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x177250[_0xd4bb('0x5d')],'dialOriginateTimeout':_0x177250[_0xd4bb('0x5e')],'dialPrefix':_0x177250[_0xd4bb('0x5f')],'outboundAnswerAgiCallsDay':_0x177250[_0xd4bb('0x60')],'outboundAnswerCallsDay':_0x177250[_0xd4bb('0x61')],'outboundBlacklistCallsDay':_0x177250['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x177250[_0xd4bb('0x62')],'outboundCongestionCallsDay':_0x177250[_0xd4bb('0x63')],'outboundDropCallsDayACS':_0x177250['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x177250['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x177250[_0xd4bb('0x64')],'outboundNoAnswerCallsDay':_0x177250[_0xd4bb('0x65')],'outboundNoSuchCallsDay':_0x177250['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x177250[_0xd4bb('0x66')],'outboundReCallsDay':_0x177250[_0xd4bb('0x67')],'outboundRejectCallsDay':_0x177250[_0xd4bb('0x68')],'outboundUnknownCallsDay':_0x177250[_0xd4bb('0x69')],'predictiveIntervalAnsweredCalls':_0x177250['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x177250[_0xd4bb('0x6a')],'predictiveIntervalAvgTalktime':_0x177250[_0xd4bb('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x177250[_0xd4bb('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x177250[_0xd4bb('0x6d')],'predictiveIntervalErlangCalls':_0x177250[_0xd4bb('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x177250['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x177250[_0xd4bb('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x177250['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x177250[_0xd4bb('0x70')],'predictiveIntervalAvailable':_0x177250[_0xd4bb('0x71')],'predictiveIntervalTotalCalls':_0x177250[_0xd4bb('0x72')],'message':_0x177250[_0xd4bb('0x3f')],'originated':_0x177250[_0xd4bb('0x73')],'erlangCalls':_0x177250[_0xd4bb('0x74')],'erlangCallToSecond':_0x177250['erlangCallToSecond'],'erlangAbandonmentRate':_0x177250[_0xd4bb('0x75')],'erlangBusyFactor':_0x177250[_0xd4bb('0x76')],'startPredictive':_0x177250[_0xd4bb('0x27')],'startProgressive':_0x177250['startProgressive']};if(_0x177250[_0xd4bb('0x77')]){_0x42ab77[_0xd4bb('0x77')]={'id':_0x177250['Trunk']['id'],'name':_0x177250[_0xd4bb('0x77')]['name'],'active':_0x177250[_0xd4bb('0x77')][_0xd4bb('0x78')],'callerid':_0x177250[_0xd4bb('0x77')][_0xd4bb('0x79')]};}if(_0x177250['Interval']){_0x42ab77[_0xd4bb('0x44')]={'id':_0x177250[_0xd4bb('0x44')]['id'],'name':_0x177250[_0xd4bb('0x44')]['name']};}var _0x5b55b4=md5(JSON[_0xd4bb('0x4b')](_0x42ab77));if(_0x177250[_0xd4bb('0x4')]!==_0x5b55b4){_0x177250[_0xd4bb('0x4')]=_0x5b55b4;emit(util['format']('voice:queue:%s',_0x42ab77[_0xd4bb('0x41')]),_0xd4bb('0x7a'),_0x42ab77);}}}function emitCampaignSummary(_0x12e85f){if(_0x12e85f[_0xd4bb('0x58')]===_0xd4bb('0x7b')){emit(util[_0xd4bb('0x7c')]('campaign:ivr:%s',_0x12e85f[_0xd4bb('0x41')]),_0xd4bb('0x7d'),_0x12e85f);}}function checkGetDataPredictive(_0x3c65c8){if(isNotNull(_0x3c65c8)&&!_[_0xd4bb('0x47')](_0x3c65c8)){loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x7f'));loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x80'),_0x3c65c8[_0xd4bb('0x72')]);loggerPredictive['info'](_0xd4bb('0x81'),_0x3c65c8['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x82'),_0x3c65c8[_0xd4bb('0x6d')]);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x83'),_0x3c65c8[_0xd4bb('0x6c')]);loggerPredictive['info'](_0xd4bb('0x84'),_0x3c65c8['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xd4bb('0x7e')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c65c8['predictiveIntervalAvgTalktime']);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x85'));if(_0x3c65c8[_0xd4bb('0x72')]>0x0){if(!_[_0xd4bb('0x86')](_0x3c65c8[_0xd4bb('0x6b')])&&_0x3c65c8[_0xd4bb('0x6b')]>0x0){return!![];}loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x87'));if(!_[_0xd4bb('0x86')](_0x3c65c8['predictiveIntervalAvgHoldtime'])&&_0x3c65c8[_0xd4bb('0x6a')]>0x0){return!![];}loggerPredictive[_0xd4bb('0x7e')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xd4bb('0x7e')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xd4bb('0x7e')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x10a44a){return function(_0x3eb2a6){loggerPredictive[_0xd4bb('0x7e')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0xd4bb('0x88'),_0x3eb2a6[_0xd4bb('0x74')]);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x89'),_0x3eb2a6[_0xd4bb('0x8a')]);loggerPredictive[_0xd4bb('0x7e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3eb2a6[_0xd4bb('0x75')]);loggerPredictive[_0xd4bb('0x7e')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3eb2a6['erlangBusyFactor']);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x8b'),_0x3eb2a6[_0xd4bb('0x75')]);loggerPredictive[_0xd4bb('0x7e')]('---------------------------');_[_0xd4bb('0x8c')](_0x10a44a,_0x3eb2a6);};}function getDiff(_0x3217fd){var _0x399ff0=moment()[_0xd4bb('0x4c')](0x0);var _0x5a993c=moment(_0x3217fd)[_0xd4bb('0x4c')](0x0);return _0x399ff0[_0xd4bb('0x4d')](_0x5a993c,_0xd4bb('0x8d'));}function ifInterval(_0x1b2049,_0x495c82){if(_['isUndefined'](_0x495c82)){return![];}return getDiff(_0x495c82)<_0x1b2049*0x3c;}function freeVariablesPredictive(_0x20eea9){if(isNotNull(_0x20eea9)){if(!_[_0xd4bb('0x86')](_0x20eea9[_0xd4bb('0x8e')])){_0x20eea9[_0xd4bb('0x8e')]=undefined;loggerPredictive[_0xd4bb('0x7e')](_0x20eea9[_0xd4bb('0x41')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xd4bb('0x86')](_0x20eea9['startPredictive'])){_0x20eea9['startPredictive']=undefined;loggerPredictive[_0xd4bb('0x7e')](_0x20eea9[_0xd4bb('0x41')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xd4bb('0x86')](_0x20eea9[_0xd4bb('0x8f')])){clearInterval(_0x20eea9[_0xd4bb('0x8f')]);_0x20eea9[_0xd4bb('0x8f')]=undefined;loggerPredictive[_0xd4bb('0x7e')](_0x20eea9[_0xd4bb('0x41')],_0xd4bb('0x90'));}}}function erlangb(_0x2cefbd,_0xaeb555){if(_0xaeb555===0x0){return 0x0;}var _0x1f27bc=0x1;for(var _0x29d40f=0x1;_0x29d40f<=_0xaeb555;_0x29d40f+=0x1){_0x1f27bc=0x1+_0x1f27bc*_0x29d40f/_0x2cefbd;}return 0x1/_0x1f27bc;}function isVoiceQueueOutbound(_0x35549d){return _0x35549d==='outbound';}function isNotPreview(_0x5a5c15){return _0x5a5c15!==_0xd4bb('0x20');}function isCampaignIvr(_0x46f92c){return _0x46f92c===_0xd4bb('0x7b');}function getCallerId(_0x5795f5,_0x3707c8,_0x1a3d41){if(!_['isUndefined'](_0x1a3d41)&&typeof _0x1a3d41===_0xd4bb('0x91')&&!_[_0xd4bb('0x47')](_0x1a3d41)){if(!_[_0xd4bb('0x86')](_0x3707c8)&&typeof _0x3707c8===_0xd4bb('0x91')&&!_[_0xd4bb('0x47')](_0x3707c8)){return util[_0xd4bb('0x7c')](_0xd4bb('0x92'),_0x3707c8,_0x1a3d41);}return util[_0xd4bb('0x7c')](_0xd4bb('0x92'),_0x1a3d41,_0x1a3d41);}if(!_['isUndefined'](_0x5795f5)&&typeof _0x5795f5===_0xd4bb('0x91')&&!_[_0xd4bb('0x47')](_0x5795f5)){return _0x5795f5;}return _0xd4bb('0x93');}function loggerCatchQueueSummary(_0x3cad52,_0x45a28f){return function(_0xf2f390){freeVariablesPredictive(_0x45a28f);emitVoiceQueueSummary(_0x45a28f);emitCampaignSummary(_0x45a28f);loggerSyncQueueSummary[_0xd4bb('0x94')](_0x3cad52,util['inspect'](_0xf2f390,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x55cc59,_0x3be1a8){return function(_0x2bd22a){loggerPredictive[_0xd4bb('0x95')](_0x3be1a8['name'],_0x55cc59);loggerPredictive[_0xd4bb('0x95')](_0x2bd22a['stack']);freeVariablesPredictive(_0x3be1a8);};}function loggerCatch(_0x117a56){return function(_0x258da4){logger[_0xd4bb('0x95')](_0x117a56,util[_0xd4bb('0x96')](_0x258da4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x593221){return _0x593221&&!_[_0xd4bb('0x86')](_0x593221)&&_0x593221[_0xd4bb('0x97')]>0x0;}function decremetOriginate(_0xb8f12){if(!_[_0xd4bb('0x86')](_0xb8f12)&&_0xb8f12!==null){if(typeof _0xb8f12['originated']!==_0xd4bb('0x98')){if(_0xb8f12[_0xd4bb('0x73')]>0x0){_0xb8f12[_0xd4bb('0x73')]-=0x1;}else{logger[_0xd4bb('0x95')](_0xd4bb('0x99'));}}}else{logger[_0xd4bb('0x95')](_0xd4bb('0x9a'));}}function checkContactLowerLimitOriginate(_0x487b75,_0xf62c1,_0x13c6df){if(_0xf62c1>_0x13c6df){for(var _0x10ade2=0x0;_0x10ade2<_0xf62c1-_0x13c6df;_0x10ade2+=0x1){decremetOriginate(_0x487b75);}}}function loggerGetContactDialer(_0x4c188b,_0x7609f3,_0x444e29){return function(_0x5dda2e){checkContactLowerLimitOriginate(_0x7609f3,_0x444e29,0x0);logger[_0xd4bb('0x95')](_0x4c188b,util[_0xd4bb('0x96')](_0x5dda2e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x526ac2){return function(_0x4b3167){if(isNotNull(_0x4b3167)&&isNotNull(_0x4b3167[0x0])){if(_0x4b3167[0x0][_0xd4bb('0x9b')]>0x0){_0x526ac2['message']=_0xd4bb('0x9c');logger[_0xd4bb('0x7e')](_0xd4bb('0x9d')+_0x526ac2[_0xd4bb('0x41')],_0x4b3167[0x0][_0xd4bb('0x9b')],_0xd4bb('0x9e'));}else{_0x526ac2[_0xd4bb('0x3f')]=_0xd4bb('0x9f');logger[_0xd4bb('0x7e')](_0xd4bb('0xa0')+_0x526ac2[_0xd4bb('0x41')]);}}};}function notSendMessagesQueue(_0x2026a1){if(_0x2026a1[_0xd4bb('0xa1')]){freeVariablesPredictive(_0x2026a1);if(_0x2026a1[_0xd4bb('0x73')]===0x0&&_0x2026a1[_0xd4bb('0x56')]===0x0&&_0x2026a1['waiting']===0x0&&(_0x2026a1[_0xd4bb('0x52')]||0x0)===0x0){_0x2026a1[_0xd4bb('0xa1')]=![];_0x2026a1[_0xd4bb('0x50')]=0x0;_0x2026a1['message']=_0xd4bb('0x42');loggerSyncQueueSummary[_0xd4bb('0x94')](_0xd4bb('0xa2'),_0x2026a1[_0xd4bb('0x41')],_0xd4bb('0xa3'));}else{_0x2026a1['message']=_0xd4bb('0xa4');loggerSyncQueueSummary[_0xd4bb('0x94')](_0xd4bb('0xa2'),_0x2026a1[_0xd4bb('0x41')],_0xd4bb('0xa5'));}emitVoiceQueueSummary(_0x2026a1);}}function notSendMessagesCampaign(_0x593fd3){if(_0x593fd3[_0xd4bb('0xa1')]){if(_0x593fd3[_0xd4bb('0x73')]===0x0){_0x593fd3[_0xd4bb('0xa1')]=![];_0x593fd3[_0xd4bb('0x3f')]=_0xd4bb('0x42');loggerSyncQueueSummary[_0xd4bb('0x94')](_0xd4bb('0xa6'),_0x593fd3['name'],'is\x20not\x20active');}else{_0x593fd3[_0xd4bb('0x3f')]=_0xd4bb('0xa4');loggerSyncQueueSummary[_0xd4bb('0x94')](_0xd4bb('0xa6'),_0x593fd3[_0xd4bb('0x41')],_0xd4bb('0xa5'));}emitCampaignSummary(_0x593fd3);}}function createObjHistory(_0x3637d3,_0x58a20f,_0x3a9ab9,_0x3d8fdc,_0x482042){_0x3637d3[_0xd4bb('0x3f')]=_0x3a9ab9;var _0x197f2f=new Action(_0x3637d3,_0x58a20f);var _0x12ac92=new History(_0x197f2f);_0x12ac92[_0xd4bb('0xa7')]=_0x3d8fdc;_0x12ac92[_0xd4bb('0xa8')]=_0x482042;_0x12ac92[_0xd4bb('0xa9')]=_0x197f2f[_0xd4bb('0xaa')];return _0x12ac92;}Dialer[_0xd4bb('0x1c')][_0xd4bb('0x3c')]=function(){var _0x173058=this;setInterval(function(){_0x173058[_0xd4bb('0xab')](_0x173058[_0xd4bb('0x25')],'[uniqueid]');_0x173058[_0xd4bb('0xab')](_0x173058[_0xd4bb('0xac')],'[actions]');},0x32c8);};Dialer['prototype'][_0xd4bb('0xab')]=function(_0x267c51,_0x3250a5){var _0x59ce40=this;for(var _0x2d94e0 in _0x267c51){if(typeof _0x267c51[_0x2d94e0]!==_0xd4bb('0x98')){this[_0xd4bb('0xad')][_0xd4bb('0x1d')](function(){if(!_['isNil'](_0x267c51[_0x2d94e0])){return ami['Action']({'action':_0xd4bb('0xae'),'channel':_0x267c51[_0x2d94e0][_0xd4bb('0xaf')]})[_0xd4bb('0xb0')](function(_0x4621ac){if(_0x4621ac[_0xd4bb('0x3f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x267c51[_0x2d94e0]&&_0x267c51[_0x2d94e0][_0xd4bb('0x58')]!==_0xd4bb('0x7b')){_0x59ce40[_0xd4bb('0xb1')](_0x59ce40[_0xd4bb('0xb2')][_0x267c51[_0x2d94e0][_0xd4bb('0xb3')]]);logger['error'](_0xd4bb('0xb4'),_0x3250a5,_0x2d94e0,_0x267c51[_0x2d94e0][_0xd4bb('0xb3')]);delete _0x267c51[_0x2d94e0];}if(_0x267c51[_0x2d94e0]&&_0x267c51[_0x2d94e0]['type']===_0xd4bb('0x7b')){_0x59ce40['updateOriginated'](_0x59ce40['campaigns'][_0x267c51[_0x2d94e0][_0xd4bb('0xb3')]]);logger[_0xd4bb('0x95')](_0xd4bb('0xb5'),_0x3250a5,_0x2d94e0,_0x267c51[_0x2d94e0][_0xd4bb('0xb3')]);delete _0x267c51[_0x2d94e0];}},0x2328);}});}});}}};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xb6')]=function(_0x3e6d6d){return Promise[_0xd4bb('0xb7')]()['then'](cmHopper[_0xd4bb('0xb6')](_0x3e6d6d))[_0xd4bb('0xb0')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xb8')]=function(_0x5217ed){return Promise[_0xd4bb('0xb7')]()['then'](cmHopperBlack[_0xd4bb('0xb8')](_0x5217ed))[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xb9')));};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xba')]=function(_0x5d3487,_0x2bbf4f,_0x590d6b){return Promise[_0xd4bb('0xb7')]()[_0xd4bb('0xbb')](cmHopperAdditionalPhone[_0xd4bb('0xba')](_0x5d3487,_0x2bbf4f,_0x590d6b))[_0xd4bb('0xb0')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer['prototype'][_0xd4bb('0xbc')]=function(_0xcc8622,_0x128e40,_0x141c2f){return Promise[_0xd4bb('0xb7')]()[_0xd4bb('0xbb')](cmHopperAdditionalPhone[_0xd4bb('0xbc')](_0xcc8622,_0x128e40,_0x141c2f))[_0xd4bb('0xb0')](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0xd4bb('0x1c')]['checkIsBlackListIvr']=function(_0x4158f7){return Promise['resolve']()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x4158f7))[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xbd')));};Dialer['prototype'][_0xd4bb('0xbe')]=function(_0x449efd){return Promise[_0xd4bb('0xb7')]()[_0xd4bb('0xbb')](cmHopperHistory['avgHandleTime'](_0x449efd))[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xbf')));};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xc0')]=function(_0x5d6f19){return Promise['resolve']()['then'](cmHopper[_0xd4bb('0xc0')](_0x5d6f19))[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xc1')));};Dialer['prototype'][_0xd4bb('0xc2')]=function(_0x9a4823,_0x564fb2,_0x422013){return Promise['resolve']()[_0xd4bb('0xbb')](cmHopper[_0xd4bb('0xc2')](_0x9a4823,_0x564fb2,_0x422013))['catch'](loggerCatch(_0xd4bb('0xc3')));};Dialer['prototype']['getContactDialer']=function(_0x6d74b9,_0x3bd880,_0x3665ca,_0x40fe02,_0x262f22){return Promise[_0xd4bb('0xb7')]()[_0xd4bb('0xbb')](cmHopper['getContactDialer'](_0x6d74b9,_0x3bd880,_0x3665ca,_0x40fe02))[_0xd4bb('0xb0')](function(_0x2a5189){_0x262f22[_0xd4bb('0xc4')]-=_0x3665ca;_0x262f22['temp']=_0x262f22[_0xd4bb('0xc4')]>0x0?_0x262f22[_0xd4bb('0xc4')]:0x0;loggerCatch(_0xd4bb('0xc5'))(_0x2a5189);});};Dialer['prototype'][_0xd4bb('0xc6')]=function(_0x43e239,_0x4a7439,_0x323a6e,_0x263182){return Promise['resolve']()[_0xd4bb('0xbb')](cmHopper['getContactDialerIvr'](_0x43e239,_0x4a7439,_0x323a6e))[_0xd4bb('0xb0')](function(_0x107f31){_0x263182['temp']-=_0x4a7439;_0x263182[_0xd4bb('0xc4')]=_0x263182[_0xd4bb('0xc4')]>0x0?_0x263182[_0xd4bb('0xc4')]:0x0;loggerCatch(_0xd4bb('0xc7'))(_0x107f31);});};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xc8')]=function(_0x42a200){return Promise[_0xd4bb('0xb7')]()[_0xd4bb('0xbb')](voiceQueueRt[_0xd4bb('0xc8')](_0x42a200))[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xc9')));};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xca')]=function(_0x14ad7b){return Promise['resolve']()[_0xd4bb('0xbb')](cmHopper[_0xd4bb('0xca')](_0x14ad7b))[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xcb')));};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xcc')]=function(_0x2340a2){return Promise['resolve']()[_0xd4bb('0xbb')](cmHopperHistory[_0xd4bb('0xcc')](_0x2340a2))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xb1')]=function(_0x3d8a5a){if(!_[_0xd4bb('0x86')](_0x3d8a5a)&&_0x3d8a5a!==null){if(typeof _0x3d8a5a[_0xd4bb('0x73')]!=='undefined'){if(_0x3d8a5a[_0xd4bb('0x73')]>0x0){_0x3d8a5a['originated']-=0x1;}else{logger[_0xd4bb('0x95')](_0xd4bb('0xcd'));}}}else{logger[_0xd4bb('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xce')]=function(_0x59e655,_0x5ca5e1){var _0x147b8e=this;return function(_0x394e29){_0x147b8e[_0xd4bb('0xb1')](_0x5ca5e1);logger[_0xd4bb('0x95')](_0x59e655,util[_0xd4bb('0x96')](_0x394e29,{'showHidden':![],'depth':null}));};};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xcf')]=function(_0x5603d2,_0x2e698b,_0x2523fa){var _0x51c05b={'state':0x19,'statedesc':'notFound'};this[_0xd4bb('0xb1')](_0x2e698b);this[_0xd4bb('0xd0')](_[_0xd4bb('0x8c')](_0x51c05b,_[_0xd4bb('0xd1')](_0x2523fa,[_0xd4bb('0xd2'),'ListId',_0xd4bb('0xd3'),_0xd4bb('0xd4'),_0xd4bb('0xd5')])),_0xd4bb('0xd6'),'[emptyContact]');logger[_0xd4bb('0x95')](_0x5603d2);};Dialer[_0xd4bb('0x1c')]['isSuccess']=function(_0x2043a4){return _0x2043a4==='Success';};Dialer['prototype'][_0xd4bb('0xd7')]=function(_0xb211c7){return!_['isUndefined'](_0xb211c7)&&_0xb211c7&&!_[_0xd4bb('0x86')](_0xb211c7[_0xd4bb('0x41')])&&!_[_0xd4bb('0x86')](_0xb211c7['active'])&&_0xb211c7['active']&&(this[_0xd4bb('0x23')][util[_0xd4bb('0x7c')]('SIP/%s',_0xb211c7[_0xd4bb('0x41')])][_0xd4bb('0xae')]===_0xd4bb('0xd8')||this[_0xd4bb('0x23')][util[_0xd4bb('0x7c')](_0xd4bb('0xd9'),_0xb211c7[_0xd4bb('0x41')])][_0xd4bb('0xae')]===_0xd4bb('0xda'));};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xd0')]=function(_0x3e3bc5,_0x583ddb,_0x19bd97){this[_0xd4bb('0xcc')](_0x3e3bc5)['catch'](loggerCatch(_0x583ddb));this[_0xd4bb('0xca')](_0x3e3bc5)[_0xd4bb('0xb0')](loggerCatch(_0x19bd97));};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xdb')]=function(_0x50ad42){var _0x2589c0=this;var _0xcc6f90=this[_0xd4bb('0x25')][_0x50ad42[_0xd4bb('0xdc')]];var _0x247e0a;if(!_['isNil'](_0x50ad42)&&!_['isNil'](_0x50ad42[_0xd4bb('0xdd')])&&!_['isNil'](_0x50ad42['variable'][_0xd4bb('0xde')])&&_0x50ad42[_0xd4bb('0xdf')]==='xcally-motion-dialer'&&_0xcc6f90){if(_0xcc6f90['type']!==_0xd4bb('0x7b')&&this['voiceQueues'][_0xcc6f90['queue']][_0xd4bb('0xe0')]&&_0x50ad42[_0xd4bb('0xe1')]===_0xd4bb('0xe2')){delete this[_0xd4bb('0x25')][_0x50ad42['uniqueid']];this['updateOriginated'](this[_0xd4bb('0xb2')][_0xcc6f90[_0xd4bb('0xb3')]]);this[_0xd4bb('0xb2')][_0xcc6f90[_0xd4bb('0xb3')]][_0xd4bb('0x61')]+=0x1;this[_0xd4bb('0xb2')][_0xcc6f90[_0xd4bb('0xb3')]][_0xd4bb('0x60')]+=0x1;_0x247e0a=new Hangup(_0xcc6f90,_0x50ad42);_0x247e0a[_0xd4bb('0xa7')]=0x12;_0x247e0a[_0xd4bb('0xa8')]=_0xd4bb('0xe3');_0x247e0a[_0xd4bb('0xe4')]=_0xd4bb('0xe5');ami[_0xd4bb('0xe6')](_0xd4bb('0xe7'),ut[_0xd4bb('0xe8')](_0x247e0a,_0xd4bb('0xe9')));this['saveInDb'](_0x247e0a,_0xd4bb('0xea'),'[syncHangupInAMD]');}if(_0xcc6f90[_0xd4bb('0x58')]!==_0xd4bb('0x7b')&&this['voiceQueues'][_0xcc6f90['queue']][_0xd4bb('0xe0')]&&_0x50ad42['value']===_0xd4bb('0xeb')){return new Promise(function(_0x4c5dbe,_0x50a9cb){delete _0x2589c0['uniqueId'][_0x50ad42[_0xd4bb('0xdc')]];_0x2589c0[_0xd4bb('0xb1')](_0x2589c0[_0xd4bb('0xb2')][_0xcc6f90[_0xd4bb('0xb3')]]);_0x2589c0[_0xd4bb('0xb2')][_0xcc6f90[_0xd4bb('0xb3')]][_0xd4bb('0x61')]+=0x1;_0x2589c0[_0xd4bb('0xb2')][_0xcc6f90[_0xd4bb('0xb3')]][_0xd4bb('0x60')]+=0x1;var _0x19e15d=_0x2589c0['voiceQueues'][_0xcc6f90[_0xd4bb('0xb3')]];var _0x4f127e=new Hangup(_0xcc6f90,_0x50ad42);_0x4f127e['state']=0x13;_0x4f127e[_0xd4bb('0xa8')]=_0xd4bb('0xec');_0x4f127e['membername']=_0xd4bb('0xe5');_0x4f127e['countmachineretry']+=0x1;_0x4f127e['countglobal']+=0x1;_0x4f127e[_0xd4bb('0xe9')]=!![];ami[_0xd4bb('0xe6')](_0xd4bb('0xe7'),ut[_0xd4bb('0xe8')](_0x4f127e,'amd'));_0x2589c0[_0xd4bb('0xcc')](_0x4f127e)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xed')));if(_0x4f127e[_0xd4bb('0xee')]+_0x4f127e[_0xd4bb('0xef')]+_0x4f127e[_0xd4bb('0xf0')]+_0x4f127e[_0xd4bb('0xf1')]+_0x4f127e[_0xd4bb('0xf2')]+_0x4f127e['countabandonedretry']+_0x4f127e[_0xd4bb('0xf3')]+_0x4f127e['countagentrejectretry']>=_0x19e15d[_0xd4bb('0xf4')]){_0x2589c0['stateGlobal'](_0x4f127e,_0x4c5dbe,_0x50a9cb,_0xd4bb('0xf5'));}else{if(_0x4f127e[_0xd4bb('0xf3')]>=_0x19e15d['dialMachineMaxRetry']){_0x2589c0[_0xd4bb('0xf6')](_0x4f127e,_0x4c5dbe,_0x50a9cb,_0xd4bb('0xf7'));}else{_0x2589c0['rescheduleContact']({'active':![],'countmachineretry':_0x4f127e[_0xd4bb('0xf3')],'scheduledat':moment()[_0xd4bb('0xf8')](_0x19e15d[_0xd4bb('0xf9')],_0xd4bb('0xfa'))[_0xd4bb('0x7c')](_0xd4bb('0xfb')),'ContactId':_0x4f127e['ContactId'],'ListId':_0x4f127e['ListId'],'VoiceQueueId':_0x4f127e[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x4f127e[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch('[rescheduleContact][Machine]'));_0x4c5dbe({'reschedule':0x1});}}});}if(_0xcc6f90[_0xd4bb('0x58')]===_0xd4bb('0x7b')&&this[_0xd4bb('0x21')][_0xcc6f90[_0xd4bb('0xb3')]]['dialAMDActive']&&_0x50ad42[_0xd4bb('0xe1')]==='HANGUP'){delete this[_0xd4bb('0x25')][_0x50ad42['uniqueid']];this[_0xd4bb('0xb1')](this[_0xd4bb('0x21')][_0xcc6f90[_0xd4bb('0xb3')]]);_0x247e0a=new Hangup(_0xcc6f90,_0x50ad42);_0x247e0a[_0xd4bb('0xa7')]=0x12;_0x247e0a['statedesc']=_0xd4bb('0xe3');_0x247e0a[_0xd4bb('0xe4')]=_0xd4bb('0xe5');ami[_0xd4bb('0xe6')](_0xd4bb('0xe7'),ut[_0xd4bb('0xe8')](_0x247e0a,'amd'));this['saveInDb'](_0x247e0a,_0xd4bb('0xfc'),_0xd4bb('0xfd'));}if(_0xcc6f90['type']==='ivr'&&this[_0xd4bb('0x21')][_0xcc6f90[_0xd4bb('0xb3')]][_0xd4bb('0xe0')]&&_0x50ad42['value']===_0xd4bb('0xeb')){return new Promise(function(_0x143cc2,_0x357fc2){delete _0x2589c0['uniqueId'][_0x50ad42[_0xd4bb('0xdc')]];_0x2589c0[_0xd4bb('0xb1')](_0x2589c0[_0xd4bb('0x21')][_0xcc6f90[_0xd4bb('0xb3')]]);_0x2589c0['campaigns'][_0xcc6f90['queue']][_0xd4bb('0x61')]+=0x1;_0x2589c0[_0xd4bb('0x21')][_0xcc6f90[_0xd4bb('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x2ec1f9=_0x2589c0[_0xd4bb('0x21')][_0xcc6f90['queue']];var _0x396dde=new Hangup(_0xcc6f90,_0x50ad42);_0x396dde[_0xd4bb('0xa7')]=0x13;_0x396dde[_0xd4bb('0xa8')]=_0xd4bb('0xec');_0x396dde[_0xd4bb('0xe4')]='AMD';_0x396dde[_0xd4bb('0xf3')]+=0x1;_0x396dde['countglobal']+=0x1;_0x396dde[_0xd4bb('0xe9')]=!![];ami[_0xd4bb('0xe6')]('custom:amd',ut[_0xd4bb('0xe8')](_0x396dde,_0xd4bb('0xe9')));_0x2589c0[_0xd4bb('0xcc')](_0x396dde)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xed')));if(_0x396dde[_0xd4bb('0xee')]+_0x396dde[_0xd4bb('0xef')]+_0x396dde[_0xd4bb('0xf0')]+_0x396dde[_0xd4bb('0xf1')]+_0x396dde[_0xd4bb('0xf2')]+_0x396dde[_0xd4bb('0xfe')]+_0x396dde[_0xd4bb('0xf3')]+_0x396dde[_0xd4bb('0xff')]>=_0x2ec1f9[_0xd4bb('0xf4')]){_0x2589c0[_0xd4bb('0x100')](_0x396dde,_0x143cc2,_0x357fc2,'reason19\x20machine....');}else{if(_0x396dde[_0xd4bb('0xf3')]>=_0x2ec1f9[_0xd4bb('0x101')]){_0x2589c0[_0xd4bb('0xf6')](_0x396dde,_0x143cc2,_0x357fc2,_0xd4bb('0xf7'));}else{_0x2589c0[_0xd4bb('0xc0')]({'active':![],'countmachineretry':_0x396dde[_0xd4bb('0xf3')],'scheduledat':moment()[_0xd4bb('0xf8')](_0x2ec1f9[_0xd4bb('0xf9')],'minutes')[_0xd4bb('0x7c')](_0xd4bb('0xfb')),'ContactId':_0x396dde[_0xd4bb('0xd2')],'ListId':_0x396dde['ListId'],'VoiceQueueId':_0x396dde[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x396dde[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch('[rescheduleContact][Machine]'));_0x143cc2({'reschedule':0x1});}}});}}};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x36')]=function(_0x2e6fd6){var _0x4c1884=this[_0xd4bb('0x25')][_0x2e6fd6['uniqueid']];var _0x1343ed;if(_0x4c1884&&_0x4c1884['type']===_0xd4bb('0x7b')){delete this[_0xd4bb('0x25')][_0x2e6fd6[_0xd4bb('0xdc')]];this[_0xd4bb('0xb1')](this[_0xd4bb('0x21')][_0x4c1884[_0xd4bb('0xb3')]]);this['campaigns'][_0x4c1884[_0xd4bb('0xb3')]][_0xd4bb('0x102')]+=0x1;_0x1343ed=new Hangup(_0x4c1884,_0x2e6fd6);this[_0xd4bb('0xcc')](_0x1343ed)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x103')));this[_0xd4bb('0xca')](_0x1343ed)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x104')));}if(_0x4c1884&&_0x4c1884['type']!==_0xd4bb('0x7b')&&isNotNull(this[_0xd4bb('0xb2')][_0x4c1884[_0xd4bb('0xb3')]][_0xd4bb('0x105')])){delete this[_0xd4bb('0x25')][_0x2e6fd6[_0xd4bb('0xdc')]];this[_0xd4bb('0xb1')](this[_0xd4bb('0xb2')][_0x4c1884[_0xd4bb('0xb3')]]);this[_0xd4bb('0xb2')][_0x4c1884[_0xd4bb('0xb3')]][_0xd4bb('0x61')]+=0x1;this[_0xd4bb('0xb2')][_0x4c1884[_0xd4bb('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x1343ed=new Hangup(_0x4c1884,_0x2e6fd6);_0x1343ed[_0xd4bb('0xa7')]=0x10;_0x1343ed[_0xd4bb('0xa8')]=_0xd4bb('0x106');_0x1343ed['membername']=_0xd4bb('0x107');this[_0xd4bb('0xcc')](_0x1343ed)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x1343ed)[_0xd4bb('0xb0')](loggerCatch('[syncHangupIvr]'));}if(_0x4c1884&&_0x4c1884[_0xd4bb('0x58')]!==_0xd4bb('0x7b')&&!isNotNull(this[_0xd4bb('0xb2')][_0x4c1884['queue']]['dialQueueProject'])){delete this[_0xd4bb('0x25')][_0x2e6fd6[_0xd4bb('0xdc')]];this[_0xd4bb('0xb1')](this[_0xd4bb('0xb2')][_0x4c1884[_0xd4bb('0xb3')]]);this['voiceQueues'][_0x4c1884['queue']][_0xd4bb('0x69')]+=0x1;_0x1343ed=new Hangup(_0x4c1884,_0x2e6fd6);_0x1343ed[_0xd4bb('0xa7')]=0xc;_0x1343ed[_0xd4bb('0xa8')]=_0x2e6fd6['cause-txt'];_0x1343ed[_0xd4bb('0xe4')]=_0xd4bb('0x108');this[_0xd4bb('0xcc')](_0x1343ed)[_0xd4bb('0xb0')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xd4bb('0xca')](_0x1343ed)[_0xd4bb('0xb0')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x33')]=function(_0x223e43){var _0x2125c0=this[_0xd4bb('0x25')][_0x223e43[_0xd4bb('0xdc')]];if(this[_0xd4bb('0xb2')][_0x223e43[_0xd4bb('0xb3')]]){if(_0x2125c0&&_0x2125c0[_0xd4bb('0x58')]!==_0xd4bb('0x7b')){delete this[_0xd4bb('0x25')][_0x223e43[_0xd4bb('0xdc')]];this['voiceQueues'][_0x223e43[_0xd4bb('0xb3')]][_0xd4bb('0x61')]+=0x1;var _0x2c243a=new AgentComplete(_0x2125c0,_0x223e43);if(_0x223e43[_0xd4bb('0x109')]==='agent'){_0x2c243a['agiafterat']=this['voiceQueues'][_0x223e43[_0xd4bb('0xb3')]][_0xd4bb('0x10a')]&&this[_0xd4bb('0xb2')][_0x223e43[_0xd4bb('0xb3')]][_0xd4bb('0x10b')]?moment()[_0xd4bb('0x7c')](_0xd4bb('0xfb')):undefined;}this[_0xd4bb('0xcc')](_0x2c243a)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x10c')));this['moveContactManagedDialer'](_0x2c243a)[_0xd4bb('0xb0')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0xd4bb('0x2c')]=function(_0x2beb46){if(this['voiceQueues'][_0x2beb46[_0xd4bb('0xb3')]]){if(this[_0xd4bb('0x25')][_0x2beb46[_0xd4bb('0xdc')]]&&this['uniqueId'][_0x2beb46[_0xd4bb('0xdc')]][_0xd4bb('0x58')]!==_0xd4bb('0x7b')){this['updateOriginated'](this[_0xd4bb('0xb2')][_0x2beb46[_0xd4bb('0xb3')]]);this[_0xd4bb('0x25')][_0x2beb46[_0xd4bb('0xdc')]]['answertime']=moment()[_0xd4bb('0x7c')](_0xd4bb('0xfb'));}}};Dialer['prototype'][_0xd4bb('0x10d')]=function(_0x5913e7,_0x10ad32){this[_0xd4bb('0xcc')](_0x5913e7)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x10c')));if(_0x10ad32==0x0){this['moveContactManagedDialer'](_0x5913e7)[_0xd4bb('0xb0')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xd4bb('0x1c')]['syncQueueCallerAbandon']=function(_0xa54a0b){var _0x285894=this[_0xd4bb('0x25')][_0xa54a0b['uniqueid']];var _0x1bfd17=this;var _0x348b5d=![];var _0xb2c258;var _0x57a0ea;if(this[_0xd4bb('0xb2')][_0xa54a0b['queue']]){if(_0x285894&&_0x285894[_0xd4bb('0x58')]!==_0xd4bb('0x7b')){delete this[_0xd4bb('0x25')][_0xa54a0b[_0xd4bb('0xdc')]];this[_0xd4bb('0xb1')](this[_0xd4bb('0xb2')][_0xa54a0b['queue']]);_0x285894['droptime']=moment()[_0xd4bb('0x7c')](_0xd4bb('0xfb'));var _0x591fbd=new QueueCallerAbandon(_0x285894,_0xa54a0b);if(getSeconds(_0x285894['droptime'],_0x285894['responsetime'])>=_0x285894[_0xd4bb('0x10e')]){this[_0xd4bb('0xb2')][_0xa54a0b['queue']][_0xd4bb('0x6d')]+=0x1;this['voiceQueues'][_0xa54a0b['queue']]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0xa54a0b[_0xd4bb('0xb3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x591fbd[_0xd4bb('0xa7')]=0xa;_0x591fbd['statedesc']=_0xd4bb('0x10f');_0x591fbd[_0xd4bb('0x110')]=_0xd4bb('0x111');_0x591fbd[_0xd4bb('0x112')]=this[_0xd4bb('0xb2')][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x10a')]?moment()['format'](_0xd4bb('0xfb')):undefined;_0x591fbd[_0xd4bb('0xf2')]+=0x1;_0x591fbd[_0xd4bb('0x113')]+=0x1;_0xb2c258=this['voiceQueues'][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x114')];_0x57a0ea=this[_0xd4bb('0xb2')][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x115')];_0x1bfd17[_0xd4bb('0xba')](_0x591fbd,_0x591fbd['state'],_0x285894[_0xd4bb('0x116')])[_0xd4bb('0xbb')](function(_0x4884de){_0x348b5d=_0x4884de[_0xd4bb('0x117')]==0x1;if(_0x591fbd[_0xd4bb('0xf2')]>=_0x1bfd17[_0xd4bb('0xb2')][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x118')]){_0x1bfd17['queueCallerAbandonCreateState'](_0x591fbd,_0x4884de[_0xd4bb('0x117')]);}else{_0x1bfd17[_0xd4bb('0xc0')]({'active':![],'countdropretry':_0x591fbd[_0xd4bb('0xf2')],'scheduledat':moment()['add'](_0x1bfd17['voiceQueues'][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x114')],_0xd4bb('0xfa'))[_0xd4bb('0x7c')](_0xd4bb('0xfb')),'ContactId':_0x285894[_0xd4bb('0xd2')],'ListId':_0x285894[_0xd4bb('0x119')],'VoiceQueueId':_0x285894[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x285894['CampaignId']||undefined})[_0xd4bb('0xb0')](loggerCatch('[rescheduleContact][Drop]'));var _0x528446=new History(_0x591fbd);_0x528446[_0xd4bb('0xa7')]=0xa;_0x528446[_0xd4bb('0xa8')]=_0xd4bb('0x10f');_0x528446[_0xd4bb('0xaa')]=moment()['format'](_0xd4bb('0xfb'));_0x528446[_0xd4bb('0xa9')]=_0x528446[_0xd4bb('0xaa')];_0x528446[_0xd4bb('0x11a')]=_0x591fbd[_0xd4bb('0x11a')];_0x528446[_0xd4bb('0x11b')]=_0x591fbd[_0xd4bb('0x11b')];_0x1bfd17[_0xd4bb('0xcc')](_0x528446)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x11c')));}})[_0xd4bb('0xbb')](function(){if(_0x348b5d)_0x1bfd17[_0xd4bb('0xbc')](_0x591fbd,_0xb2c258,_0x57a0ea)[_0xd4bb('0xbb')](function(){return 0x1;});});}else{this['voiceQueues'][_0xa54a0b['queue']][_0xd4bb('0x6c')]+=0x1;this[_0xd4bb('0xb2')][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x11d')]+=0x1;_0x591fbd[_0xd4bb('0xa7')]=0xb;_0x591fbd[_0xd4bb('0xa8')]=_0xd4bb('0x11e');_0x591fbd['dropreason']='CALLEREXIT';_0x591fbd['countabandonedretry']+=0x1;_0x591fbd['countglobal']+=0x1;_0xb2c258=this[_0xd4bb('0xb2')][_0xa54a0b['queue']][_0xd4bb('0x11f')];_0x57a0ea=this[_0xd4bb('0xb2')][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x115')];_0x1bfd17[_0xd4bb('0xba')](_0x591fbd,_0x591fbd[_0xd4bb('0xa7')],_0x285894[_0xd4bb('0x116')])[_0xd4bb('0xbb')](function(_0x3d117a){if(_0x591fbd[_0xd4bb('0xfe')]>=_0x1bfd17[_0xd4bb('0xb2')][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x120')]){_0x1bfd17[_0xd4bb('0x10d')](_0x591fbd,_0x3d117a[_0xd4bb('0x117')]);}else{_0x1bfd17[_0xd4bb('0xc0')]({'active':![],'countabandonedretry':_0x591fbd['countabandonedretry'],'scheduledat':moment()['add'](_0x1bfd17['voiceQueues'][_0xa54a0b[_0xd4bb('0xb3')]][_0xd4bb('0x11f')],_0xd4bb('0xfa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x285894['ContactId'],'ListId':_0x285894[_0xd4bb('0x119')],'VoiceQueueId':_0x285894['VoiceQueueId']||undefined,'CampaignId':_0x285894[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x4b6976=new History(_0x591fbd);_0x4b6976[_0xd4bb('0xa7')]=0xb;_0x4b6976[_0xd4bb('0xa8')]=_0xd4bb('0x11e');_0x4b6976[_0xd4bb('0xaa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4b6976[_0xd4bb('0xa9')]=_0x4b6976[_0xd4bb('0xaa')];_0x4b6976['calleridname']=_0x591fbd[_0xd4bb('0x11a')];_0x4b6976[_0xd4bb('0x11b')]=_0x591fbd[_0xd4bb('0x11b')];_0x1bfd17[_0xd4bb('0xcc')](_0x4b6976)[_0xd4bb('0xb0')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x348b5d)_0x1bfd17[_0xd4bb('0xbc')](_0x591fbd,_0xb2c258,_0x57a0ea)['then'](function(){return 0x1;});});}}}};Dialer['prototype'][_0xd4bb('0x38')]=function(_0x381ac0){if(this[_0xd4bb('0xac')][_0x381ac0[_0xd4bb('0xdc')]]){this[_0xd4bb('0xac')][_0x381ac0['uniqueid']]['channel']=_0x381ac0[_0xd4bb('0xaf')];}if(this['uniqueId'][_0x381ac0[_0xd4bb('0xdc')]]){this[_0xd4bb('0x25')][_0x381ac0['uniqueid']][_0xd4bb('0xaf')]=_0x381ac0[_0xd4bb('0xaf')];}};Dialer[_0xd4bb('0x1c')]['syncQueueMember']=function(_0x1ff591){if(strategy[this[_0xd4bb('0xb2')][this[_0xd4bb('0xac')][_0x1ff591['actionid']][_0xd4bb('0xb3')]][_0xd4bb('0x4f')]]===_0xd4bb('0x1b')){if(this[_0xd4bb('0xac')][_0x1ff591[_0xd4bb('0x121')]]&&_[_0xd4bb('0x122')](this['actions'][_0x1ff591['actionid']][_0xd4bb('0x123')])&&_0x1ff591[_0xd4bb('0xae')]==='1'&&_0x1ff591[_0xd4bb('0x124')]==='0'){if(this[_0xd4bb('0x22')][_0x1ff591[_0xd4bb('0x125')]]){if(!this[_0xd4bb('0x22')][_0x1ff591[_0xd4bb('0x125')]][_0xd4bb('0x123')]){this['agents'][_0x1ff591[_0xd4bb('0x125')]]['locked']=!![];this['actions'][_0x1ff591[_0xd4bb('0x121')]]['locked']=!![];this[_0xd4bb('0xac')][_0x1ff591[_0xd4bb('0x121')]]['stateinterface']=_0x1ff591['stateinterface'];}}}}else if((strategy[this[_0xd4bb('0xb2')][this[_0xd4bb('0xac')][_0x1ff591['actionid']][_0xd4bb('0xb3')]]['strategy']]||_0xd4bb('0x1a'))===_0xd4bb('0x1a')){if(this[_0xd4bb('0xac')][_0x1ff591[_0xd4bb('0x121')]]){if(this[_0xd4bb('0x22')][_0x1ff591[_0xd4bb('0x125')]]){this['actions'][_0x1ff591[_0xd4bb('0x121')]][_0xd4bb('0x125')]=_0x1ff591[_0xd4bb('0x125')];if(_[_0xd4bb('0x122')](this['queueBooked'][this[_0xd4bb('0xac')][_0x1ff591[_0xd4bb('0x121')]][_0xd4bb('0xb3')]])){this[_0xd4bb('0x29')][this['actions'][_0x1ff591[_0xd4bb('0x121')]][_0xd4bb('0xb3')]]=[];}this[_0xd4bb('0x29')][this['actions'][_0x1ff591['actionid']][_0xd4bb('0xb3')]][_0xd4bb('0x126')](_[_0xd4bb('0x8c')](_[_0xd4bb('0xd1')](this[_0xd4bb('0xac')][_0x1ff591[_0xd4bb('0x121')]],['idHopper',_0xd4bb('0x125')]),{'status':_0x1ff591[_0xd4bb('0xae')],'paused':_0x1ff591[_0xd4bb('0x124')]}));}}}};function unlockQueueStatus(_0x2b821d,_0x5cd47d){setTimeout(function(){if(_['isUndefined'](_0x2b821d[_0xd4bb('0x127')])){loggerBooked[_0xd4bb('0x95')](_0xd4bb('0x128'),_0x5cd47d);}_0x2b821d[_0xd4bb('0x127')]=!![];loggerBooked[_0xd4bb('0x7e')]('[booked][unlockQueueStatus]',_0x5cd47d,JSON[_0xd4bb('0x4b')](_[_0xd4bb('0xd1')](_0x2b821d,[_0xd4bb('0x41'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xd4bb('0x1c')][_0xd4bb('0x129')]=function(_0xe321f3){var _0x52b181=this;var _0x84159e=_0x52b181[_0xd4bb('0xb2')][_0x52b181[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]];if(strategy[this[_0xd4bb('0xb2')][this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]][_0xd4bb('0x4f')]]===_0xd4bb('0x1b')){if(this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]]&&this[_0xd4bb('0xac')][_0xe321f3['actionid']][_0xd4bb('0x125')]){this[_0xd4bb('0x20')][_0xd4bb('0x12a')](this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0x12b')],this['actions'][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0x125')])[_0xd4bb('0xb0')](function(_0x35faf8){logger[_0xd4bb('0x95')](_0xd4bb('0x12c'),util['inspect'](_0x35faf8,{'showHidden':![],'depth':null}));})[_0xd4bb('0x1f')](function(){_0x52b181[_0xd4bb('0xb1')](_0x52b181['voiceQueues'][_0x52b181[_0xd4bb('0xac')][_0xe321f3['actionid']][_0xd4bb('0xb3')]]);_0x52b181[_0xd4bb('0x22')][_0x52b181[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0x125')]][_0xd4bb('0x123')]=![];delete _0x52b181[_0xd4bb('0xac')][_0xe321f3['actionid']];unlockQueueStatus(_0x84159e);});}else{this[_0xd4bb('0xb1')](this['voiceQueues'][this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]]['queue']]);this[_0xd4bb('0xc0')]({'active':![],'ContactId':this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]]['ContactId'],'ListId':this[_0xd4bb('0xac')][_0xe321f3['actionid']]['ListId'],'VoiceQueueId':this[_0xd4bb('0xac')][_0xe321f3['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xd5')]||undefined})['catch'](loggerCatch(_0xd4bb('0x12d')));delete this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]];unlockQueueStatus(_0x84159e);}}else if((strategy[this['voiceQueues'][this[_0xd4bb('0xac')][_0xe321f3['actionid']][_0xd4bb('0xb3')]]['strategy']]||_0xd4bb('0x1a'))===_0xd4bb('0x1a')){var _0x12ef91;if(this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]]&&!_[_0xd4bb('0x47')](this[_0xd4bb('0x29')][this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]])){if(this[_0xd4bb('0x2a')][_0x52b181['actions'][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]]){this['queueBookedRR'][_0x52b181[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]]=this['queueBookedRR'][this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]]?this[_0xd4bb('0x2a')][this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]]:this[_0xd4bb('0x29')][this['actions'][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]]?this[_0xd4bb('0x29')][this[_0xd4bb('0xac')][_0xe321f3['actionid']]['queue']][_0xd4bb('0x12e')]||0x0:0x0;}this['queueBooked'][this['actions'][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]][_0xd4bb('0x12e')]=this[_0xd4bb('0x2a')][this[_0xd4bb('0xac')][_0xe321f3[_0xd4bb('0x121')]][_0xd4bb('0xb3')]];for(var _0xc11669=0x0;_0xc11669=0x0;})[_0xd4bb('0xb0')](myreject(_0x1b0f88)));}}else{_0x2663a1[_0xd4bb('0x126')](ami[_0xd4bb('0x14c')]({'action':_0xd4bb('0x147'),'command':util[_0xd4bb('0x7c')](_0xd4bb('0x148'),_0x5310d1,!_[_0xd4bb('0x86')](config[_0xd4bb('0x143')][_0x285198])?_0x285198:'')})[_0xd4bb('0xbb')](function(_0x3a66e3){return _0x3a66e3['content'][_0xd4bb('0x14a')]('true')>=0x0;})[_0xd4bb('0xb0')](myreject(_0x1b0f88)));}Promise[_0xd4bb('0x14d')](_0x2663a1)['then'](function(_0x4158a2){var _0xe63f1=_[_0xd4bb('0x14e')](_0x4158a2);if(_0xe63f1){return _0x1dac30(_0xe63f1);}else{_0x47f63b[_0xd4bb('0x3f')]=_0x58c907?_0xd4bb('0x14f'):_0xd4bb('0x150');return _0x1b0f88(msgResponse(_0xd4bb('0x151'),_0xd4bb('0x13f'),'Global:\x20'+_0x58c907+'\x20'+_0x34881a+_0xd4bb('0x152')+util['inspect'](_0x5310d1,{'showHidden':![],'depth':null})+_0xd4bb('0x153')+_0x285198));}})[_0xd4bb('0xb0')](function(_0x17cd80){return _0x1b0f88(msgResponse(_0xd4bb('0x13e'),'Failure',JSON['stringify'](_0x17cd80)));});});};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x154')]=function(_0x2139a1){var _0x3a205a=this;return function(){switch(_0x2139a1[_0xd4bb('0x5c')]){case _0xd4bb('0x155'):freeVariablesPredictive(_0x2139a1);_0x3a205a[_0xd4bb('0x156')](_0x2139a1,0x1);break;case _0xd4bb('0x157'):freeVariablesPredictive(_0x2139a1);_0x3a205a[_0xd4bb('0x156')](_0x2139a1,_0x2139a1[_0xd4bb('0x158')]);break;case _0xd4bb('0x8'):_0x3a205a['predictive'](_0x2139a1);break;case _0xd4bb('0x159'):freeVariablesPredictive(_0x2139a1);_0x3a205a[_0xd4bb('0x156')](_0x2139a1,0x1);break;default:freeVariablesPredictive(_0x2139a1);logger[_0xd4bb('0x95')](_0xd4bb('0x15a'),_0x2139a1[_0xd4bb('0x41')],'method\x20not\x20recognized');}};};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x15b')]=function(_0x2feedb){return Promise[_0xd4bb('0xb7')]()['then'](cmHopper[_0xd4bb('0x15c')](_0x2feedb['id'],previewRecallmeReminderInterval))[_0xd4bb('0xbb')](function(_0x1129f4){for(var _0xd21ff6=0x0;_0xd21ff6<_0x1129f4[_0xd4bb('0x97')];_0xd21ff6++){var _0x5d4f3c=_0x1129f4[_0xd21ff6][_0xd4bb('0x15d')][_0xd4bb('0x41')];if(_0x5d4f3c)io['to'](util['format'](_0xd4bb('0x15e'),_0x5d4f3c))[_0xd4bb('0xe6')](_0xd4bb('0x15f'),{'hopper':_0x1129f4[_0xd21ff6]});}})[_0xd4bb('0xb0')](function(){});};Dialer['prototype'][_0xd4bb('0x160')]=function(_0x1da24b){var _0xb6a1d0=this;return function(){_0xb6a1d0[_0xd4bb('0x161')](_0x1da24b);};};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x9')]=function(_0x534a50){var _0x40c9a9=this;if(isNotPreview(_0x534a50[_0xd4bb('0x5c')])){if(isVoiceQueueOutbound(_0x534a50[_0xd4bb('0x58')])&&isActive(_0x534a50[_0xd4bb('0x5b')])){_0x534a50[_0xd4bb('0xa1')]=!![];Promise[_0xd4bb('0xb7')]()['then'](checkIsLoggedIn(_0x534a50,_0x534a50['loggedIn']))[_0xd4bb('0xbb')](checkIsActive(_0x534a50,_0x534a50[_0xd4bb('0x5b')]))['then'](checkInterval(_0x534a50))[_0xd4bb('0xbb')](_0x40c9a9[_0xd4bb('0x162')](_0x534a50))[_0xd4bb('0xbb')](_0x40c9a9[_0xd4bb('0x13c')](_0x534a50[_0xd4bb('0x163')],_0x534a50['dialTimezone'],_0x534a50[_0xd4bb('0x41')],_0x534a50))[_0xd4bb('0xbb')](_0x40c9a9[_0xd4bb('0x13d')](_0x534a50['Interval'],_0x534a50[_0xd4bb('0x164')],_0x534a50[_0xd4bb('0x41')],_0x534a50))[_0xd4bb('0xbb')](_0x40c9a9['checkDialMethod'](_0x534a50))['catch'](loggerCatchQueueSummary(_0xd4bb('0x165'),_0x534a50));}else{notSendMessagesQueue(_0x534a50);}}else{freeVariablesPredictive(_0x534a50);}};Dialer['prototype'][_0xd4bb('0x35')]=_[_0xd4bb('0x166')](function(){var _0x101b17=_['filter'](this[_0xd4bb('0xb2')],function(_0x40997e){return _0x40997e[_0xd4bb('0x167')];});var _0x12b51f=_['filter'](this[_0xd4bb('0x22')],function(_0x10cdd1){return _0x10cdd1[_0xd4bb('0x168')]&&_0x10cdd1[_0xd4bb('0xae')]===_0xd4bb('0xd8');});if(_0x101b17['length']>0x0&&_0x12b51f[_0xd4bb('0x97')]>0x0){return Promise[_0xd4bb('0xb7')]()[_0xd4bb('0xbb')](cmHopper[_0xd4bb('0x15c')](_['map'](_0x101b17,'id'),previewRecallmeReminderInterval,_[_0xd4bb('0x169')](_0x12b51f,'id')))[_0xd4bb('0xbb')](function(_0x3a9752){for(var _0x2a3117=0x0;_0x2a3117<_0x3a9752[_0xd4bb('0x97')];_0x2a3117++){var _0x4a010d=_0x3a9752[_0x2a3117]['Agent'][_0xd4bb('0x41')];if(_0x4a010d)io['to'](util[_0xd4bb('0x7c')]('user:%s',_0x4a010d))[_0xd4bb('0xe6')]('user:dialPreviewRecallReminder',{'hopper':_0x3a9752[_0x2a3117]});}})['catch'](function(_0x1f5bd0){logger['error'](_0xd4bb('0x15b'),_0x1f5bd0);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xd4bb('0x139')]=function(){var _0x5579e5=this;var _0x43b378;for(var _0x102ea7 in this[_0xd4bb('0x21')]){if(typeof this[_0xd4bb('0x21')][_0x102ea7]!==_0xd4bb('0x98')){_0x43b378=this['campaigns'][_0x102ea7];if(isCampaignIvr(_0x43b378[_0xd4bb('0x58')])&&isActive(_0x43b378[_0xd4bb('0x78')])){_0x43b378['sendMessageOneNotActive']=!![];Promise['resolve']()[_0xd4bb('0xbb')](checkIsActive(_0x43b378,_0x43b378[_0xd4bb('0x78')]))[_0xd4bb('0xbb')](checkInterval(_0x43b378))[_0xd4bb('0xbb')](_0x5579e5['checkIsTrunkReachable'](_0x43b378))[_0xd4bb('0xbb')](_0x5579e5[_0xd4bb('0x13c')](_0x43b378[_0xd4bb('0x163')],_0x43b378[_0xd4bb('0x164')],_0x43b378['name'],_0x43b378))[_0xd4bb('0xbb')](_0x5579e5['checkIfTimeIntervals'](_0x43b378['Interval'],_0x43b378['dialTimezone'],_0x43b378[_0xd4bb('0x41')],_0x43b378))[_0xd4bb('0xbb')](_0x5579e5[_0xd4bb('0x160')](_0x43b378))[_0xd4bb('0xb0')](loggerCatchQueueSummary(_0xd4bb('0x16a'),_0x43b378));}else{notSendMessagesCampaign(_0x43b378);}}}};function getCallerIdRandom(_0x24b77f,_0x313adb){var _0xf964e5;var _0x530007;var _0x15f0c0;if(_0x313adb<=0x0){_0x313adb=0x1;}_0xf964e5=new RegExp(_0xd4bb('0x16b')+_0x313adb+'}$');_0x530007=Math['pow'](0xa,_0x313adb-0x1);_0x15f0c0=Math['pow'](0xa,_0x313adb)-0x1;return util[_0xd4bb('0x7c')]('%s',_[_0xd4bb('0x16c')](_0x24b77f,_0xf964e5,_[_0xd4bb('0x16d')](_0x530007,_0x15f0c0)));}function extractCalleridName(_0x57b8e5){var _0x308faf=_0x57b8e5[_0xd4bb('0x16e')](/"(.*?)"/);return _0x308faf?_0x308faf[0x1]:_0x57b8e5;}Dialer['prototype'][_0xd4bb('0x16f')]=function(_0xf0105e,_0x4b6d0e){var _0x5de14e=this;var _0x10122a=uuid['v4']();this['actions'][_0x10122a]=new Action(_0xf0105e,_0x4b6d0e,_0x10122a);return new Promise(function(_0x23f0a3,_0x2ea0e1){if(_['isUndefined'](_0xf0105e)&&typeof _0xf0105e!==_0xd4bb('0x170')){return _0x2ea0e1(msgResponse(_0xd4bb('0x171'),'Failure',_0xd4bb('0x172')));}if(_[_0xd4bb('0x86')](_0x4b6d0e[_0xd4bb('0x173')])||_0x4b6d0e['phone']===null){return _0x2ea0e1(msgResponse(_0xd4bb('0x171'),'Failure',_0xd4bb('0x174')));}var _0x5778e9={'XMD-CALLERID':_0x5de14e['actions'][_0x10122a][_0xd4bb('0x175')](),'XMD-AGI':_0xf0105e[_0xd4bb('0x105')]?util[_0xd4bb('0x7c')](_0xd4bb('0x176'),ipAgi,_0xf0105e[_0xd4bb('0x105')]):_0xd4bb('0x177'),'XMD-AGIAFTER':_0xf0105e[_0xd4bb('0x10a')]?util[_0xd4bb('0x7c')]('\x22agi://%s/square,%s\x22',ipAgi,_0xf0105e[_0xd4bb('0x10a')]):_0xd4bb('0x177'),'XMD-QUEUE':_0xf0105e['type']===_0xd4bb('0x4e')?util['format']('\x22%s,%s%s,,,%s\x22',_0xf0105e[_0xd4bb('0x41')],_0xf0105e['dialQueueOptions']||'',_0xf0105e[_0xd4bb('0x10b')]?'c':'',_0xf0105e[_0xd4bb('0x10e')]||0x3):_0xd4bb('0x177'),'XMD-CONTACTID':_0x4b6d0e['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5de14e[_0xd4bb('0xac')][_0x10122a][_0xd4bb('0x175')](),'XMD-AMD':_0xf0105e[_0xd4bb('0xe0')]?'ACTIVE':'NONE','XMD-DESTINATION':_0xd4bb('0x178')};if(_0xf0105e[_0xd4bb('0xe0')]){_0x5778e9[_0xd4bb('0x179')]=_0xf0105e[_0xd4bb('0x17a')]||0x9c4;_0x5778e9[_0xd4bb('0x17b')]=_0xf0105e[_0xd4bb('0x17c')]||0x5dc;_0x5778e9[_0xd4bb('0x17d')]=_0xf0105e[_0xd4bb('0x17e')]||0x320;_0x5778e9[_0xd4bb('0x17f')]=_0xf0105e['dialAMDTotalAnalysisTime']||0x1388;_0x5778e9[_0xd4bb('0x180')]=_0xf0105e[_0xd4bb('0x181')]||0x64;_0x5778e9[_0xd4bb('0x182')]=_0xf0105e[_0xd4bb('0x183')]||0x32;_0x5778e9['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0xf0105e['dialAMDMaximumNumberOfWords']||0x3;_0x5778e9[_0xd4bb('0x184')]=_0xf0105e['dialAMDSilenceThreshold']||0x100;_0x5778e9[_0xd4bb('0x185')]=_0xf0105e['dialAMDMaximumWordLength']||0x1388;}if(_0xf0105e['type']==='outbound'){_0x5778e9['XMD-VOICEQUEUEID']=_0x4b6d0e[_0xd4bb('0xd4')];}else{_0x5778e9[_0xd4bb('0x186')]=_0x4b6d0e[_0xd4bb('0xd5')];}for(var _0xfc1682 in _0x4b6d0e['Contact']){if(typeof _0x4b6d0e['Contact'][_0xfc1682]!==_0xd4bb('0x98')){if(isNotNull(_0x4b6d0e[_0xd4bb('0x187')][_0xfc1682])&&_0xfc1682!=='id'&&_0xfc1682!=='tags'&&_0xfc1682!==_0xd4bb('0x188')&&_0xfc1682!==_0xd4bb('0x189')){_0x5778e9[util[_0xd4bb('0x7c')](_0xd4bb('0x18a'),'XMD-',_[_0xd4bb('0x18b')](_0xfc1682))]=_0x4b6d0e['Contact'][_0xfc1682];}}}var _0x41fea8=_0x5de14e[_0xd4bb('0xd7')](_0xf0105e['Trunk'])?getCallerId(_0xf0105e[_0xd4bb('0x77')][_0xd4bb('0x79')],_0xf0105e[_0xd4bb('0x18c')],_0xf0105e[_0xd4bb('0x18d')]>0x0?getCallerIdRandom(_0xf0105e[_0xd4bb('0x5d')],_0xf0105e[_0xd4bb('0x18d')]):_0xf0105e[_0xd4bb('0x5d')]):getCallerId(_[_0xd4bb('0x122')](_0xf0105e[_0xd4bb('0x18e')])?_0xf0105e[_0xd4bb('0x77')][_0xd4bb('0x79')]:_0xf0105e[_0xd4bb('0x18e')]['callerid'],_0xf0105e[_0xd4bb('0x18c')],_0xf0105e[_0xd4bb('0x18d')]>0x0?getCallerIdRandom(_0xf0105e[_0xd4bb('0x5d')],_0xf0105e[_0xd4bb('0x18d')]):_0xf0105e[_0xd4bb('0x5d')]);if(_0x41fea8){_0x5778e9['XMD-ORIGINATECALLERIDNAME']=_0x5de14e[_0xd4bb('0xac')][_0x10122a][_0xd4bb('0x18f')]=extractCalleridName(_0x41fea8);_0x5778e9[_0xd4bb('0x190')]=_0x4b6d0e[_0xd4bb('0x173')];}_0xf0105e['variables']=_0x5778e9;return ami['Action']({'actionid':_0x10122a,'action':_0xd4bb('0x171'),'channel':_0x5de14e[_0xd4bb('0xd7')](_0xf0105e['Trunk'])?util['format'](_0xd4bb('0x191'),_0xf0105e['Trunk'][_0xd4bb('0x41')],isNotNull(_0xf0105e['dialPrefix'])?_0xf0105e[_0xd4bb('0x5f')]['trim']()||'':'',_0xf0105e[_0xd4bb('0x192')]>0x0?_0x4b6d0e[_0xd4bb('0x173')][_0xd4bb('0x193')](_0xf0105e[_0xd4bb('0x192')]):_0x4b6d0e[_0xd4bb('0x173')]):util[_0xd4bb('0x7c')](_0xd4bb('0x191'),_['isNil'](_0xf0105e['TrunkBackup'])?_0xf0105e[_0xd4bb('0x77')][_0xd4bb('0x41')]:_0xf0105e['TrunkBackup']['name'],isNotNull(_0xf0105e['dialPrefix'])?_0xf0105e[_0xd4bb('0x5f')][_0xd4bb('0x194')]()||'':'',_0xf0105e[_0xd4bb('0x192')]>0x0?_0x4b6d0e['phone'][_0xd4bb('0x193')](_0xf0105e[_0xd4bb('0x192')]):_0x4b6d0e[_0xd4bb('0x173')]),'callerid':_0x41fea8,'Exten':_0xd4bb('0x178'),'Context':_0xd4bb('0x195'),'Priority':'1','variable':_0x5778e9,'timeout':(_0xf0105e['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x10122a})[_0xd4bb('0xbb')](function(_0x1a242b){return _0x23f0a3(_0x1a242b);})['catch'](function(_0x22f39e){_0xf0105e[_0xd4bb('0x66')]+=0x1;var _0xf5528d=new History(_0x5de14e[_0xd4bb('0xac')][_0x10122a]);logger['error'](util[_0xd4bb('0x7c')](_0xd4bb('0x196'),JSON['stringify'](_0x22f39e)));_0xf5528d[_0xd4bb('0xa7')]=0xe;_0xf5528d[_0xd4bb('0xa8')]=_0xd4bb('0x197');_0xf5528d[_0xd4bb('0xaa')]=moment()[_0xd4bb('0x7c')](_0xd4bb('0xfb'));_0xf5528d[_0xd4bb('0xa9')]=_0xf5528d['starttime'];_0x5de14e[_0xd4bb('0xcc')](_0xf5528d)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x198')));_0x5de14e['moveContactManagedDialer'](_0xf5528d)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x198')))[_0xd4bb('0x1f')](function(){delete _0x5de14e['actions'][_0x10122a];return _0x2ea0e1(msgResponse(_0xd4bb('0x171'),_0xd4bb('0x4a'),_0xd4bb('0x199')));});});});};Dialer[_0xd4bb('0x1c')]['syncOriginateResponse']=function(_0x6ff17c){var _0x4ca4de=this[_0xd4bb('0xac')][_0x6ff17c['actionid']];if(_0x4ca4de){delete this[_0xd4bb('0xac')][_0x6ff17c[_0xd4bb('0x121')]];_0x4ca4de[_0xd4bb('0x19a')]=moment()[_0xd4bb('0x7c')](_0xd4bb('0xfb'));var _0x4d6cf3=_0x4ca4de[_0xd4bb('0x58')]===_0xd4bb('0x7b')?this[_0xd4bb('0x21')][_0x4ca4de['queue']]:this[_0xd4bb('0xb2')][_0x4ca4de['getQueue']()];if(!this['isSuccess'](_0x6ff17c[_0xd4bb('0x19b')])){this[_0xd4bb('0xb1')](_0x4d6cf3);return this[_0xd4bb('0x19c')](_0x4ca4de,_0x4d6cf3,_0x6ff17c)[_0xd4bb('0xb0')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xd4bb('0x25')][_0x6ff17c['uniqueid']]=_0x4ca4de;}};Dialer[_0xd4bb('0x1c')]['checkRetriveMax']=function(_0x49a1b7,_0x463abd,_0x585fd3){var _0x54d539=new History(_0x463abd);if(_0x54d539[_0xd4bb('0xee')]+_0x54d539[_0xd4bb('0xef')]+_0x54d539['countnoanswerretry']+_0x54d539['countnosuchnumberretry']+_0x54d539[_0xd4bb('0xf2')]+_0x54d539[_0xd4bb('0xfe')]+_0x54d539[_0xd4bb('0xf3')]+_0x54d539[_0xd4bb('0xff')]>=_0x585fd3[_0xd4bb('0xf4')]-0x1){return!![];}switch(_0x49a1b7){case 0x3:if(_0x54d539[_0xd4bb('0xf0')]>=_0x585fd3[_0xd4bb('0x19d')]-0x1){return!![];}this[_0xd4bb('0xc0')]({'active':![],'countnoanswerretry':_0x54d539[_0xd4bb('0xf0')]+=0x1,'scheduledat':moment()[_0xd4bb('0xf8')](_0x585fd3[_0xd4bb('0x19e')],_0xd4bb('0xfa'))[_0xd4bb('0x7c')](_0xd4bb('0xfb')),'ContactId':_0x54d539[_0xd4bb('0xd2')],'ListId':_0x54d539['ListId'],'VoiceQueueId':_0x54d539[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x54d539[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x54d539[_0xd4bb('0xee')]>=_0x585fd3[_0xd4bb('0x19f')]-0x1){return!![];}this[_0xd4bb('0xc0')]({'active':![],'countbusyretry':_0x54d539[_0xd4bb('0xee')]+=0x1,'scheduledat':moment()[_0xd4bb('0xf8')](_0x585fd3[_0xd4bb('0x1a0')],_0xd4bb('0xfa'))['format'](_0xd4bb('0xfb')),'ContactId':_0x54d539[_0xd4bb('0xd2')],'ListId':_0x54d539['ListId'],'VoiceQueueId':_0x54d539[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x54d539[_0xd4bb('0xd5')]||undefined})['catch'](loggerCatch(_0xd4bb('0x1a1')));break;case 0x8:if(_0x54d539[_0xd4bb('0xef')]>=_0x585fd3[_0xd4bb('0x1a2')]-0x1){return!![];}this[_0xd4bb('0xc0')]({'active':![],'countcongestionretry':_0x54d539['countcongestionretry']+=0x1,'scheduledat':moment()[_0xd4bb('0xf8')](_0x585fd3[_0xd4bb('0x1a3')],'minutes')[_0xd4bb('0x7c')](_0xd4bb('0xfb')),'ContactId':_0x54d539[_0xd4bb('0xd2')],'ListId':_0x54d539[_0xd4bb('0x119')],'VoiceQueueId':_0x54d539['VoiceQueueId']||undefined,'CampaignId':_0x54d539[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1a4')));break;case 0x0:if(_0x54d539[_0xd4bb('0xf1')]>=_0x585fd3[_0xd4bb('0x1a5')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x54d539['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xd4bb('0xf8')](_0x585fd3[_0xd4bb('0x1a6')],_0xd4bb('0xfa'))[_0xd4bb('0x7c')](_0xd4bb('0xfb')),'ContactId':_0x54d539[_0xd4bb('0xd2')],'ListId':_0x54d539['ListId'],'VoiceQueueId':_0x54d539[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x54d539['CampaignId']||undefined})[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1a7')));}break;case 0xa:if(_0x54d539[_0xd4bb('0xf2')]>=_0x585fd3[_0xd4bb('0x118')]-0x1){return!![];}this[_0xd4bb('0xc0')]({'active':![],'countdropretry':_0x54d539[_0xd4bb('0xf2')]+=0x1,'scheduledat':moment()[_0xd4bb('0xf8')](_0x585fd3[_0xd4bb('0x114')],'minutes')['format'](_0xd4bb('0xfb')),'ContactId':_0x54d539[_0xd4bb('0xd2')],'ListId':_0x54d539['ListId'],'VoiceQueueId':_0x54d539[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x54d539[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1a8')));break;case 0xb:if(_0x54d539[_0xd4bb('0xfe')]>=_0x585fd3[_0xd4bb('0x120')]-0x1){return!![];}this[_0xd4bb('0xc0')]({'active':![],'countabandonedretry':_0x54d539[_0xd4bb('0xfe')]+=0x1,'scheduledat':moment()[_0xd4bb('0xf8')](_0x585fd3[_0xd4bb('0x11f')],_0xd4bb('0xfa'))[_0xd4bb('0x7c')](_0xd4bb('0xfb')),'ContactId':_0x54d539['ContactId'],'ListId':_0x54d539['ListId'],'VoiceQueueId':_0x54d539['VoiceQueueId']||undefined,'CampaignId':_0x54d539[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1a9')));break;case 0x13:if(_0x54d539['countmachineretry']>=_0x585fd3['dialMachineMaxRetry']-0x1){return!![];}this[_0xd4bb('0xc0')]({'active':![],'countmachineretry':_0x54d539['countmachineretry']+=0x1,'scheduledat':moment()[_0xd4bb('0xf8')](_0x585fd3[_0xd4bb('0xf9')],_0xd4bb('0xfa'))[_0xd4bb('0x7c')](_0xd4bb('0xfb')),'ContactId':_0x54d539[_0xd4bb('0xd2')],'ListId':_0x54d539[_0xd4bb('0x119')],'VoiceQueueId':_0x54d539[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x54d539[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1aa')));break;case 0x14:if(_0x54d539[_0xd4bb('0xff')]>=_0x585fd3[_0xd4bb('0x1ab')]-0x1){return!![];}this[_0xd4bb('0xc0')]({'active':![],'countagentrejectretry':_0x54d539[_0xd4bb('0xff')]+=0x1,'scheduledat':moment()[_0xd4bb('0xf8')](_0x585fd3[_0xd4bb('0x1ac')],_0xd4bb('0xfa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54d539[_0xd4bb('0xd2')],'ListId':_0x54d539['ListId'],'VoiceQueueId':_0x54d539[_0xd4bb('0xd4')]||undefined,'CampaignId':_0x54d539['CampaignId']||undefined})['catch'](loggerCatch(_0xd4bb('0x1ad')));break;default:return!![];}};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x19c')]=function(_0x5be06d,_0x489e70,_0xb10689){var _0x2c2222=this;var _0x5e2fc3=new History(_0x5be06d);var _0x2234d3=![];var _0x1bddcb;var _0x2daa88;return new Promise(function(_0x1a89ee,_0x547460){if(_[_0xd4bb('0x86')](_0x489e70)&&typeof _0x489e70!=='object'){return _0x547460(msgResponse(_0xd4bb('0x1ae'),_0xd4bb('0x13f'),_0xd4bb('0x1af')));}if(_[_0xd4bb('0x86')](_0xb10689)&&typeof _0xb10689!==_0xd4bb('0x170')){return _0x547460(msgResponse(_0xd4bb('0x1ae'),_0xd4bb('0x13f'),_0xd4bb('0x1b0')));}_0x2c2222['verifyAdditionalPhones'](_0x5e2fc3,_0xb10689[_0xd4bb('0x109')],_0x489e70)[_0xd4bb('0xbb')](function(_0x4b7bbc){if(_0x4b7bbc['additional']==0x1)_0x2234d3=!![];switch(_0xb10689['reason']){case'0':_0x489e70[_0xd4bb('0x1b1')]+=0x1;_0x5e2fc3[_0xd4bb('0xa7')]=0x0;_0x5e2fc3[_0xd4bb('0xa8')]=_0xd4bb('0x1b2');_0x5e2fc3['countnosuchnumberretry']+=0x1;_0x5e2fc3[_0xd4bb('0x113')]+=0x1;ami[_0xd4bb('0xe6')]('custom:agentnosuchnumber',ut[_0xd4bb('0xe8')](_0x5be06d,_0xd4bb('0x1b3')));_0x1bddcb=_0x489e70[_0xd4bb('0x1a6')];_0x2daa88=_0x489e70[_0xd4bb('0x115')];_0x2c2222[_0xd4bb('0xcc')](_0x5e2fc3)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0xed')));if(_0x2c2222[_0xd4bb('0x1b4')](0x0,_0x5be06d,_0x489e70)&&!_0x2234d3){if(_0x5e2fc3[_0xd4bb('0xf1')]>=_0x489e70[_0xd4bb('0x1a5')]){_0x2c2222[_0xd4bb('0xf6')](_0x5e2fc3,_0x1a89ee,_0x547460,'reason\x200\x20no\x20such\x20number....');}else{_0x2c2222['stateGlobal'](_0x5e2fc3,_0x1a89ee,_0x547460,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x489e70['outboundNoAnswerCallsDay']+=0x1;_0x5e2fc3[_0xd4bb('0xa7')]=0x3;_0x5e2fc3[_0xd4bb('0xa8')]=_0xd4bb('0x1b5');_0x5e2fc3[_0xd4bb('0xf0')]+=0x1;_0x5e2fc3[_0xd4bb('0x113')]+=0x1;var _0x4cdcb4=ut[_0xd4bb('0x1b6')](_0x5be06d,_0x489e70);ami[_0xd4bb('0xe6')](_0xd4bb('0x1b7'),_0x4cdcb4);_0x1bddcb=_0x489e70[_0xd4bb('0x19e')];_0x2daa88=_0x489e70['callAdditionalPhoneAfterMin'];_0x2c2222[_0xd4bb('0xcc')](_0x5e2fc3)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1b8')));if(_0x2c2222['checkRetriveMax'](0x3,_0x5be06d,_0x489e70)&&!_0x2234d3){if(_0x5e2fc3[_0xd4bb('0xf0')]>=_0x489e70[_0xd4bb('0x19d')]){_0x2c2222[_0xd4bb('0xf6')](_0x5e2fc3,_0x1a89ee,_0x547460,_0xd4bb('0x1b9'));}else{_0x2c2222[_0xd4bb('0x100')](_0x5e2fc3,_0x1a89ee,_0x547460,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x489e70[_0xd4bb('0x62')]+=0x1;_0x5e2fc3[_0xd4bb('0xa7')]=0x5;_0x5e2fc3['statedesc']=_0xd4bb('0x1ba');_0x5e2fc3[_0xd4bb('0xee')]+=0x1;_0x5e2fc3[_0xd4bb('0x113')]+=0x1;ami[_0xd4bb('0xe6')](_0xd4bb('0x1bb'),ut['buildObj'](_0x5be06d,_0xd4bb('0x1bc')));_0x1bddcb=_0x489e70[_0xd4bb('0x1a0')];_0x2daa88=_0x489e70[_0xd4bb('0x115')];_0x2c2222[_0xd4bb('0xcc')](_0x5e2fc3)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1bd')));if(_0x2c2222[_0xd4bb('0x1b4')](0x5,_0x5be06d,_0x489e70)&&!_0x2234d3){if(_0x5e2fc3['countbusyretry']>=_0x489e70[_0xd4bb('0x19f')]){_0x2c2222[_0xd4bb('0xf6')](_0x5e2fc3,_0x1a89ee,_0x547460,_0xd4bb('0x1be'));}else{_0x2c2222[_0xd4bb('0x100')](_0x5e2fc3,_0x1a89ee,_0x547460,_0xd4bb('0x1be'));}}break;case'8':_0x489e70[_0xd4bb('0x63')]+=0x1;_0x5e2fc3[_0xd4bb('0xa7')]=0x8;_0x5e2fc3['statedesc']=_0xd4bb('0x1bf');_0x5e2fc3[_0xd4bb('0xef')]+=0x1;_0x5e2fc3['countglobal']+=0x1;_0x1bddcb=_0x489e70['dialCongestionRetryFrequency'];_0x2daa88=_0x489e70[_0xd4bb('0x115')];ami['emit']('custom:agentcongestion',ut['buildObj'](_0x5be06d,_0xd4bb('0x1c0')));_0x2c2222[_0xd4bb('0xcc')](_0x5e2fc3)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1c1')));if(_0x2c2222['checkRetriveMax'](0x8,_0x5be06d,_0x489e70)&&!_0x2234d3){if(_0x5e2fc3[_0xd4bb('0xef')]>=_0x489e70['dialCongestionMaxRetry']){_0x2c2222[_0xd4bb('0xf6')](_0x5e2fc3,_0x1a89ee,_0x547460,_0xd4bb('0x1c2'));}else{_0x2c2222[_0xd4bb('0x100')](_0x5e2fc3,_0x1a89ee,_0x547460,_0xd4bb('0x1c2'));}}break;case'11':_0x489e70[_0xd4bb('0x1c3')]+=0x1;_0x5e2fc3[_0xd4bb('0xa7')]=0xb;_0x5e2fc3[_0xd4bb('0xa8')]=_0xd4bb('0x11e');_0x5e2fc3['countabandonedretry']+=0x1;_0x5e2fc3[_0xd4bb('0x113')]+=0x1;_0x1bddcb=_0x489e70['dialAbandonedRetryFrequency'];_0x2daa88=_0x489e70[_0xd4bb('0x115')];_0x2c2222[_0xd4bb('0xcc')](_0x5e2fc3)[_0xd4bb('0xb0')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2c2222[_0xd4bb('0x1b4')](0xb,_0x5be06d,_0x489e70)&&!_0x2234d3){if(_0x5e2fc3[_0xd4bb('0xfe')]>=_0x489e70[_0xd4bb('0x120')]){_0x2c2222['createStateFinal'](_0x5e2fc3,_0x1a89ee,_0x547460,_0xd4bb('0x1c4'));}else{_0x2c2222[_0xd4bb('0x100')](_0x5e2fc3,_0x1a89ee,_0x547460,_0xd4bb('0x1c4'));}}break;case'20':_0x489e70['outboundRejectCallsDay']+=0x1;_0x5e2fc3['state']=0x14;_0x5e2fc3[_0xd4bb('0xa8')]=_0xd4bb('0x1c5');_0x5e2fc3[_0xd4bb('0xff')]+=0x1;_0x5e2fc3[_0xd4bb('0x113')]+=0x1;_0x1bddcb=_0x489e70[_0xd4bb('0x1ac')];_0x2daa88=_0x489e70[_0xd4bb('0x115')];ami[_0xd4bb('0xe6')](_0xd4bb('0x1c6'),ut[_0xd4bb('0xe8')](_0x5be06d,_0xd4bb('0x1c7')));_0x2c2222[_0xd4bb('0xcc')](_0x5e2fc3)[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1c8')));if(_0x2c2222['checkRetriveMax'](0x14,_0x5be06d,_0x489e70)&&!_0x2234d3){if(_0x5e2fc3[_0xd4bb('0xff')]>=_0x489e70[_0xd4bb('0x1ab')]){_0x2c2222[_0xd4bb('0xf6')](_0x5e2fc3,_0x1a89ee,_0x547460,'reason\x2020\x20agentreject');}else{_0x2c2222['stateGlobal'](_0x5e2fc3,_0x1a89ee,_0x547460,'reason\x2020\x20agentreject');}}break;default:_0x489e70[_0xd4bb('0x69')]+=0x1;_0x5e2fc3[_0xd4bb('0xa7')]=0xc;_0x5e2fc3[_0xd4bb('0xa8')]=_0xb10689[_0xd4bb('0x109')];_0x1bddcb=_0x489e70[_0xd4bb('0x1ac')];_0x2daa88=_0x489e70[_0xd4bb('0x115')];_0x2c2222[_0xd4bb('0xcc')](_0x5e2fc3)['catch'](loggerCatch(_0xd4bb('0x1c9')));if(_0x2c2222[_0xd4bb('0x1b4')](_0xb10689[_0xd4bb('0x109')],_0x5be06d,_0x489e70)&&!_0x2234d3){if(_0x5e2fc3[_0xd4bb('0xee')]+_0x5e2fc3['countcongestionretry']+_0x5e2fc3[_0xd4bb('0xf0')]+_0x5e2fc3[_0xd4bb('0xf1')]+_0x5e2fc3[_0xd4bb('0xf2')]+_0x5e2fc3[_0xd4bb('0xfe')]+_0x5e2fc3[_0xd4bb('0xf3')]+_0x5e2fc3['countagentrejectretry']>=_0x489e70['dialGlobalMaxRetry']){_0x2c2222['stateGlobal'](_0x5e2fc3,_0x1a89ee,_0x547460,_0xb10689['reason']);}else{_0x2c2222['createStateFinal'](_0x5e2fc3,_0x1a89ee,_0x547460,_0xb10689['reason']);}}}})[_0xd4bb('0xbb')](function(){if(_0x2234d3){_0x2c2222[_0xd4bb('0xbc')](_0x5e2fc3,_0x1bddcb,_0x2daa88)[_0xd4bb('0xbb')](function(){return _0x1a89ee(0x1);});}});});};Dialer['prototype'][_0xd4bb('0x100')]=function(_0x37e325,_0x4189ab,_0x3fa3cd,_0x470347){var _0x5e2fcb=new Final(_0x37e325);_0x5e2fcb['state']=0xf;_0x5e2fcb[_0xd4bb('0xa8')]=_0xd4bb('0x1ca');this[_0xd4bb('0xf6')](_0x5e2fcb,_0x4189ab,_0x3fa3cd,_0x470347);};Dialer[_0xd4bb('0x1c')][_0xd4bb('0xf6')]=function(_0x1ffb0f,_0x542273,_0x12aa22,_0x3f9352){this[_0xd4bb('0xca')](_0x1ffb0f)[_0xd4bb('0xbb')](function(){return _0x542273(msgResponse(_0xd4bb('0x1ae'),_0xd4bb('0x1cb'),_0x3f9352));})['catch'](function(){return _0x12aa22(msgResponse(_0xd4bb('0x1cc'),_0xd4bb('0x13f'),_0xd4bb('0x1cd')));});};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x8')]=function(_0x2fd47a){var _0x14a48f=_0x2fd47a[_0xd4bb('0x1ce')]/0x64;var _0x541afb=_0x2fd47a['outboundDropCallsDayTimeout']/(_0x2fd47a[_0xd4bb('0x64')]+_0x2fd47a['outboundAnswerCallsDay']);var _0x56e637=Math['round'](_0x2fd47a[_0xd4bb('0x71')]*(_0x2fd47a['predictiveIntervalMaxThreshold']/0x64));var _0x450919=Math['round'](_0x2fd47a[_0xd4bb('0x71')]*(_0x2fd47a[_0xd4bb('0x1cf')]/0x64));var _0x957d18=_0x2fd47a[_0xd4bb('0x50')]+_0x2fd47a[_0xd4bb('0x56')];var _0x4a240f=Math[_0xd4bb('0x1d0')](_0x2fd47a['erlangCalls']*_0x2fd47a['erlangAbandonmentRate']*_0x2fd47a[_0xd4bb('0x6f')]*_0x2fd47a[_0xd4bb('0x1d1')]);if(_[_0xd4bb('0x86')](_0x2fd47a[_0xd4bb('0x8e')])){if(!_[_0xd4bb('0x86')](_0x2fd47a[_0xd4bb('0x27')])){_0x2fd47a['startPredictive']=undefined;loggerPredictive[_0xd4bb('0x95')](_0xd4bb('0x1d2'),_0xd4bb('0x1d3'));}if(!_[_0xd4bb('0x86')](_0x2fd47a[_0xd4bb('0x8f')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2fd47a[_0xd4bb('0x8f')]);_0x2fd47a[_0xd4bb('0x8f')]=undefined;}_0x2fd47a[_0xd4bb('0x8e')]=moment()[_0xd4bb('0x7c')](_0xd4bb('0xfb'));loggerPredictive['info'](_0x2fd47a[_0xd4bb('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x2fd47a[_0xd4bb('0x8e')]);this[_0xd4bb('0x156')](_0x2fd47a,0x1);}else if(ifInterval(_0x2fd47a[_0xd4bb('0x1d4')],_0x2fd47a['startProgressive'])){this[_0xd4bb('0x156')](_0x2fd47a,0x1);loggerPredictiveCalls['info'](_0xd4bb('0x1d5'),_0x2fd47a['startProgressive'],_0x2fd47a[_0xd4bb('0x41')]);_0x2fd47a[_0xd4bb('0x74')]=0x0;_0x2fd47a[_0xd4bb('0x1d6')]=0x0;}else if(_0x14a48f<_0x541afb&&_0x2fd47a[_0xd4bb('0x1d7')]===_0xd4bb('0x1d8')){freeVariablesPredictive(_0x2fd47a);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x1d9'),_0xd4bb('0x1da'),_0x541afb,_0xd4bb('0x8e'),_0x2fd47a[_0xd4bb('0x41')]);}else if(_0x4a240f<_0x2fd47a[_0xd4bb('0x1d6')]&&_0x2fd47a[_0xd4bb('0x1d7')]==='dropRate'){freeVariablesPredictive(_0x2fd47a);loggerPredictive['info'](_0xd4bb('0x1db'),_0xd4bb('0x1dc'),_0x4a240f,_0xd4bb('0x1dd'),_0x2fd47a[_0xd4bb('0x1d6')],_0xd4bb('0x8e'),_0x2fd47a['name']);}else if(!ifInterval(_0x2fd47a[_0xd4bb('0x1d4')],_0x2fd47a[_0xd4bb('0x8e')])&&_[_0xd4bb('0x86')](_0x2fd47a[_0xd4bb('0x27')])&&!_[_0xd4bb('0x86')](_0x2fd47a[_0xd4bb('0x8e')])){_0x2fd47a[_0xd4bb('0x27')]=moment()[_0xd4bb('0x7c')](_0xd4bb('0xfb'));loggerPredictive[_0xd4bb('0x7e')](_0x2fd47a[_0xd4bb('0x41')],_0xd4bb('0x1de'),_0x2fd47a[_0xd4bb('0x27')]);this['averageHandleTime'](_0x2fd47a[_0xd4bb('0x1d4')])['then'](this[_0xd4bb('0x1df')](_0x2fd47a))[_0xd4bb('0xbb')](mergeDataErlangB(_0x2fd47a))[_0xd4bb('0xbb')](this[_0xd4bb('0x1e0')](_0x2fd47a))[_0xd4bb('0xb0')](loggerCatchPredictive(_0xd4bb('0x1e1'),_0x2fd47a));}else if(!ifInterval(_0x2fd47a[_0xd4bb('0x1d4')],_0x2fd47a[_0xd4bb('0x27')])){_0x2fd47a[_0xd4bb('0x1d6')]=0x0;_0x2fd47a[_0xd4bb('0x27')]=moment()[_0xd4bb('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xd4bb('0x7e')](_0x2fd47a[_0xd4bb('0x41')],_0xd4bb('0x1e2'),_0x2fd47a['startPredictive']);clearInterval(_0x2fd47a['handlePredictive']);_0x2fd47a[_0xd4bb('0x8f')]=undefined;this['averageHandleTime'](_0x2fd47a['dialPredictiveInterval'])[_0xd4bb('0xbb')](this[_0xd4bb('0x1df')](_0x2fd47a))[_0xd4bb('0xbb')](mergeDataErlangB(_0x2fd47a))[_0xd4bb('0xbb')](this['startMethodPredictive'](_0x2fd47a))[_0xd4bb('0xb0')](loggerCatchPredictive(_0xd4bb('0x1e3'),_0x2fd47a));}else if(_0x2fd47a[_0xd4bb('0x71')]&&_0x957d18<_0x2fd47a[_0xd4bb('0x71')]-_0x450919){freeVariablesPredictive(_0x2fd47a);loggerPredictive[_0xd4bb('0x7e')](_0x2fd47a[_0xd4bb('0x41')],_0xd4bb('0x1e4'),_0x957d18,_0xd4bb('0x1e5'),_0x2fd47a[_0xd4bb('0x71')],'-',_0x450919,'=',_0x2fd47a[_0xd4bb('0x71')]-_0x450919,')');}else if(_0x2fd47a[_0xd4bb('0x71')]&&_0x957d18>_0x2fd47a[_0xd4bb('0x71')]+_0x56e637){freeVariablesPredictive(_0x2fd47a);loggerPredictive[_0xd4bb('0x7e')](_0x2fd47a['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x957d18,_0xd4bb('0x1e6'),_0x2fd47a[_0xd4bb('0x71')],'+',_0x56e637,'=',_0x2fd47a[_0xd4bb('0x71')]+_0x56e637,')');}};Dialer['prototype'][_0xd4bb('0x1df')]=function(_0x276360){var _0x13cf25=this;return function(_0x140c6d){return new Promise(function(_0x4c11fd,_0x2f3f05){_[_0xd4bb('0x8c')](_0x276360,_0x140c6d[0x0]);if(checkGetDataPredictive(_0x140c6d[0x0])){var _0x3687ef=_0x276360[_0xd4bb('0x71')]=_0x276360['talking']+_0x276360[_0xd4bb('0x50')];var _0x413faf=_0x276360[_0xd4bb('0x1d4')]*0x3c;var _0x2338f5=_0x140c6d[0x0][_0xd4bb('0x6b')]+_0x140c6d[0x0]['predictiveIntervalAvgHoldtime'];var _0x5d9b77=(_0x140c6d[0x0][_0xd4bb('0x1e7')]+_0x140c6d[0x0][_0xd4bb('0x6d')]+_0x140c6d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x140c6d[0x0]['predictiveIntervalTotalCalls'];_0x276360[_0xd4bb('0x6f')]=_0x5d9b77>0x0?_0x5d9b77:0x1;switch(_0x276360['dialPredictiveOptimization']){case _0xd4bb('0x1d8'):var _0x292001=_0x276360[_0xd4bb('0x1ce')]/0x64;return _0x13cf25['abandonmentRate'](_0x3687ef,_0x413faf,_0x2338f5,_0x5d9b77,_0x292001)[_0xd4bb('0xbb')](function(_0x20ce4f){return _0x4c11fd(_0x20ce4f);});case'agentBusyFactor':var _0x13de7b=_0x276360[_0xd4bb('0x1ce')]/0x64;return _0x13cf25[_0xd4bb('0x1e8')](_0x3687ef,_0x413faf,_0x2338f5,_0x5d9b77,_0x13de7b)['then'](function(_0x50ab78){return _0x4c11fd(_0x50ab78);});default:return _0x2f3f05(msgResponse(_0xd4bb('0x1e9'),_0xd4bb('0x13f'),_0xd4bb('0x1ea')));}}else{return _0x2f3f05(msgResponse(_0xd4bb('0x1e9'),_0xd4bb('0x13f'),_0xd4bb('0x1eb')));}});};};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x1ec')]=function(_0x16208f){var _0x26c099=this;return function(_0x455d0c){return new Promise(function(_0x1572b2,_0x482541){_[_0xd4bb('0x8c')](_0x16208f,_0x455d0c[0x0]);if(checkGetDataPredictive(_0x455d0c[0x0])){loggerPredictive[_0xd4bb('0x7e')](JSON[_0xd4bb('0x4b')](_0x455d0c[0x0]));if(_0x16208f['dialPredictiveOptimization']===_0xd4bb('0x1d8')){return _0x26c099[_0xd4bb('0xc8')](_0x16208f['id'])[_0xd4bb('0xbb')](function(_0x5a44a9){var _0x55c279=_0x16208f['loggedIn']-_0x5a44a9[0x0][_0xd4bb('0x1ed')];var _0x12f69c=_0x16208f[_0xd4bb('0x1d4')]*0x3c;var _0x222fbe=_0x455d0c[0x0][_0xd4bb('0x6b')]+_0x455d0c[0x0][_0xd4bb('0x6a')];var _0x1c74af=(_0x455d0c[0x0]['predictiveIntervalAnsweredCalls']+_0x455d0c[0x0][_0xd4bb('0x6d')]+_0x455d0c[0x0][_0xd4bb('0x6c')])/_0x455d0c[0x0][_0xd4bb('0x72')];var _0x337561=_0x16208f[_0xd4bb('0x1ce')]/0x64;_0x16208f[_0xd4bb('0x70')]=_0x5a44a9[0x0]['outboundQueuePauses']||0x0;_0x16208f[_0xd4bb('0x6f')]=_0x1c74af>0x0?_0x1c74af:0x1;return _0x26c099[_0xd4bb('0x1ee')](_0x55c279,_0x12f69c,_0x222fbe,_0x1c74af,_0x337561);})[_0xd4bb('0xbb')](function(_0x25db3a){return _0x1572b2(_0x25db3a);})['catch'](function(_0x4ee97e){return _0x482541(msgResponse(_0xd4bb('0x1ef'),_0xd4bb('0x13f'),JSON['stringify'](_0x4ee97e)));});}if(_0x16208f[_0xd4bb('0x1d7')]===_0xd4bb('0x1f0')){return _0x26c099[_0xd4bb('0xc8')](_0x16208f['id'])[_0xd4bb('0xbb')](function(_0x18ec57){var _0x7a619f=_0x16208f[_0xd4bb('0x51')]-_0x18ec57[0x0][_0xd4bb('0x1ed')];var _0x27ebf9=_0x16208f[_0xd4bb('0x1d4')]*0x3c;var _0x423bd4=_0x455d0c[0x0][_0xd4bb('0x6b')]+_0x455d0c[0x0][_0xd4bb('0x6a')];var _0x515744=(_0x455d0c[0x0]['predictiveIntervalAnsweredCalls']+_0x455d0c[0x0][_0xd4bb('0x6d')]+_0x455d0c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x455d0c[0x0]['predictiveIntervalTotalCalls'];var _0x45421e=_0x16208f[_0xd4bb('0x1ce')]/0x64;_0x16208f[_0xd4bb('0x70')]=_0x18ec57[0x0][_0xd4bb('0x1ed')]||0x0;_0x16208f[_0xd4bb('0x6f')]=_0x515744>0x0?_0x515744:0x1;return _0x26c099[_0xd4bb('0x1e8')](_0x7a619f,_0x27ebf9,_0x423bd4,_0x515744,_0x45421e);})['then'](function(_0x2a1055){return _0x1572b2(_0x2a1055);})[_0xd4bb('0xb0')](function(_0x46b870){return _0x482541(msgResponse(_0xd4bb('0x1ef'),'Failure',JSON['stringify'](_0x46b870)));});}}else{return _0x482541(msgResponse(_0xd4bb('0x1e9'),_0xd4bb('0x13f'),'check\x20failure'));}});};};Dialer[_0xd4bb('0x1c')]['startMethodPredictive']=function(_0x548992){var _0x558b26=this;return function(){var _0x25d62a=0x0;var _0x3c7edf=Math[_0xd4bb('0x1d0')](_0x548992[_0xd4bb('0x8a')]*0x3e8);if(_0x3c7edf>0x0){_0x3c7edf=_0x3c7edf<0x64?0x64:_0x3c7edf;loggerPredictive[_0xd4bb('0x7e')](_0x548992[_0xd4bb('0x41')],_0xd4bb('0x1f1'),_0x3c7edf,'milliseconds');_0x548992[_0xd4bb('0x8f')]=setInterval(function(){_0x558b26[_0xd4bb('0x8f')](_0x548992);loggerPredictiveCalls['info'](_0xd4bb('0x1f2'),_0x25d62a+=0x1);},_0x3c7edf);}else{loggerPredictive[_0xd4bb('0x7e')](_0x548992[_0xd4bb('0x41')],_0xd4bb('0x1f3'));}};};Dialer[_0xd4bb('0x1c')]['checkContactBlack']=function(_0x36af3a,_0xbc8869){var _0x267bbe=this;return function(_0x15c535){if(_['isEmpty'](_0x15c535)){if(_[_0xd4bb('0x122')](_0xbc8869[_0xd4bb('0xd3')])||!_0xbc8869[_0xd4bb('0x1f4')]){if(_0x36af3a['dialMethod']===_0xd4bb('0x159')){_0x36af3a['queueStatusComplete']=_[_0xd4bb('0x86')](_0x36af3a['queueStatusComplete'])?!![]:_0x36af3a[_0xd4bb('0x127')];var _0x1f8ff3=uuid['v4']();_0x267bbe[_0xd4bb('0xac')][_0x1f8ff3]=new Action(_0x36af3a,_0xbc8869,_0x1f8ff3);loggerBooked[_0xd4bb('0x7e')](_0xd4bb('0x1f5'),_0x1f8ff3,_0xd4bb('0x1f6'),JSON[_0xd4bb('0x4b')](_0x36af3a[_0xd4bb('0x127')]),_0xd4bb('0x1f7'),_0x36af3a[_0xd4bb('0x41')]);if(_0x36af3a[_0xd4bb('0x127')]){_0x36af3a[_0xd4bb('0x127')]=![];_0x267bbe[_0xd4bb('0x29')][_0x267bbe[_0xd4bb('0xac')][_0x1f8ff3]['queue']]=[];ami[_0xd4bb('0x14c')]({'actionid':_0x1f8ff3,'action':_0xd4bb('0x1f8'),'queue':_0x36af3a[_0xd4bb('0x41')]})[_0xd4bb('0xb0')](function(){_0x267bbe[_0xd4bb('0xb1')](_0x36af3a);_0x267bbe[_0xd4bb('0xc0')]({'active':![],'ContactId':_0x267bbe[_0xd4bb('0xac')][_0x1f8ff3][_0xd4bb('0xd2')],'ListId':_0x267bbe['actions'][_0x1f8ff3][_0xd4bb('0x119')],'VoiceQueueId':_0x267bbe[_0xd4bb('0xac')][_0x1f8ff3]['VoiceQueueId']||undefined,'CampaignId':_0x267bbe['actions'][_0x1f8ff3][_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1f9')));delete _0x267bbe[_0xd4bb('0xac')][_0x1f8ff3];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xd4bb('0x4b')](_0x36af3a['queueStatusComplete']),_0xd4bb('0x1f7'),_0x36af3a[_0xd4bb('0x41')]);_0x267bbe['updateOriginated'](_0x36af3a);_0x267bbe['rescheduleContact']({'active':![],'ContactId':_0x267bbe[_0xd4bb('0xac')][_0x1f8ff3][_0xd4bb('0xd2')],'ListId':_0x267bbe[_0xd4bb('0xac')][_0x1f8ff3][_0xd4bb('0x119')],'VoiceQueueId':_0x267bbe[_0xd4bb('0xac')][_0x1f8ff3][_0xd4bb('0xd4')]||undefined,'CampaignId':_0x267bbe[_0xd4bb('0xac')][_0x1f8ff3][_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x1f9')));delete _0x267bbe[_0xd4bb('0xac')][_0x1f8ff3];}}else{return _0x267bbe['actionOriginate'](_0x36af3a,_0xbc8869);}}else{if(getDiff(_0xbc8869[_0xd4bb('0x1fa')])<_0x36af3a[_0xd4bb('0x1fb')]*0x3c){if(_0xbc8869[_0xd4bb('0x15d')]&&!_0xbc8869[_0xd4bb('0x15d')][_0xd4bb('0x1fc')]){_0x267bbe[_0xd4bb('0x20')][_0xd4bb('0x12a')](_0xbc8869['id'])[_0xd4bb('0x1f')](function(){_0x267bbe['updateOriginated'](_0x36af3a);});}else{_0x267bbe[_0xd4bb('0xc2')]({'active':![]},_0xbc8869['id'],0x1)[_0xd4bb('0x1f')](function(){_0x267bbe[_0xd4bb('0xb1')](_0x36af3a);});}}else{_0x36af3a[_0xd4bb('0x67')]+=0x1;_0x267bbe[_0xd4bb('0xb1')](_0x36af3a);if(_0x36af3a[_0xd4bb('0x1fd')]){_0x267bbe['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0xbc8869['ContactId'],'ListId':_0xbc8869[_0xd4bb('0x119')],'VoiceQueueId':_0xbc8869[_0xd4bb('0xd4')]||undefined,'CampaignId':_0xbc8869[_0xd4bb('0xd5')]||undefined})[_0xd4bb('0xb0')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x267bbe[_0xd4bb('0xcc')](createObjHistory(_0x36af3a,_0xbc8869,_0xd4bb('0x1fe'),0x17,_0xd4bb('0x1ff')))[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x200')));}else{_0x267bbe[_0xd4bb('0xd0')](createObjHistory(_0x36af3a,_0xbc8869,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0xd4bb('0x201'),_0xd4bb('0x202'));}}}}else{_0x36af3a[_0xd4bb('0x203')]+=0x1;_0x267bbe[_0xd4bb('0xd0')](createObjHistory(_0x36af3a,_0xbc8869,'BLACKLIST',0xd,_0xd4bb('0x204')),_0xd4bb('0x205'),_0xd4bb('0x206'));throw _0xd4bb('0x207');}};};Dialer['prototype'][_0xd4bb('0x161')]=function(_0x478b9c){var _0x5977e3=this;var _0x210225=_0x478b9c[_0xd4bb('0x208')]-_0x478b9c[_0xd4bb('0x73')]-_0x478b9c[_0xd4bb('0xc4')];emitCampaignSummary(_0x478b9c);if(_0x210225>0x0){if(_0x210225>this['maxNumberOriginate']){_0x210225=this[_0xd4bb('0x209')];}_0x478b9c[_0xd4bb('0xc4')]+=_0x210225;this[_0xd4bb('0xc6')](_0x478b9c['id'],_0x210225,_0x478b9c[_0xd4bb('0x20a')],_0x478b9c)[_0xd4bb('0xbb')](function(_0x34913b){_0x478b9c[_0xd4bb('0xc4')]-=_0x210225;_0x478b9c[_0xd4bb('0xc4')]=_0x478b9c[_0xd4bb('0xc4')]>0x0?_0x478b9c[_0xd4bb('0xc4')]:0x0;if(!checkContactEmpty(_0x34913b)){_0x478b9c['message']=_0xd4bb('0x9f');logger[_0xd4bb('0x7e')]('[getContactCampaign2][Empty]'+_0x478b9c[_0xd4bb('0x41')]);}else{_0x478b9c[_0xd4bb('0x73')]+=_0x34913b[_0xd4bb('0x97')];_0x478b9c[_0xd4bb('0x3f')]='RUNNING';for(var _0x163bf7=0x0;_0x163bf7<_0x34913b[_0xd4bb('0x97')];_0x163bf7+=0x1){_0x478b9c[_0xd4bb('0x20b')]+=0x1;if(_['isNil'](_0x34913b[_0x163bf7])||_[_0xd4bb('0x122')](_0x34913b[_0x163bf7][_0xd4bb('0x187')])||_['isNil'](_0x34913b[_0x163bf7]['phone'])){_0x5977e3['emptyContact'](_0xd4bb('0x20c'),_0x478b9c,_0x34913b[_0x163bf7]);}else{_0x5977e3[_0xd4bb('0x20d')](_[_0xd4bb('0xd1')](_0x34913b[_0x163bf7],[_0xd4bb('0xd5'),'Contact.phone']))[_0xd4bb('0xbb')](_0x5977e3['checkContactBlack'](_0x478b9c,_0x34913b[_0x163bf7]))['catch'](_0x5977e3[_0xd4bb('0xce')](_0xd4bb('0x20e'),_0x478b9c));}}}})[_0xd4bb('0xb0')](loggerGetContactDialer(_0xd4bb('0x20f'),_0x478b9c,_0x210225));}};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x156')]=function(_0xc92b20,_0x4fd170){var _0x4e6347=this;var _0x2a0c19=[];var _0x5b6e0c=_0x4fd170>=0x1?_0x4fd170:0x1;if(_0xc92b20[_0xd4bb('0x5c')]===_0xd4bb('0x159')){_0x5b6e0c=0x1;}var _0xc76514=Math[_0xd4bb('0x1d0')](_0xc92b20[_0xd4bb('0x50')]*_0x5b6e0c)-_0xc92b20[_0xd4bb('0x73')]-_0xc92b20[_0xd4bb('0xc4')];emitVoiceQueueSummary(_0xc92b20);if(_0xc92b20[_0xd4bb('0x210')]>0x0){var _0x1a5f05=_0xc92b20[_0xd4bb('0x210')]-_0xc92b20['originated']-_0xc92b20[_0xd4bb('0x56')]-_0xc92b20[_0xd4bb('0xc4')]-_0xc92b20['pTalking'];if(_0xc76514>_0x1a5f05){_0xc76514=_0x1a5f05;}}if(_0xc76514>0x0){if(_0xc92b20['dialMethod']===_0xd4bb('0x159')){_0xc76514=0x1;}if(_0xc76514>this['maxNumberOriginate']){_0xc76514=this[_0xd4bb('0x209')];}_0xc92b20['temp']+=_0xc76514;for(var _0x2dd6f9 in this[_0xd4bb('0x22')]){if(typeof this[_0xd4bb('0x22')][_0x2dd6f9]!==_0xd4bb('0x98')){if(this[_0xd4bb('0x22')][_0x2dd6f9]['state']===_0xd4bb('0x211')&&this['agents'][_0x2dd6f9][_0xd4bb('0xae')]===_0xd4bb('0xd8')){_0x2a0c19[_0xd4bb('0x126')](this['agents'][_0x2dd6f9]['id']);}}}this[_0xd4bb('0x212')](_0xc92b20['id'],_0x2a0c19,_0xc76514,_0xc92b20[_0xd4bb('0x20a')],_0xc92b20)[_0xd4bb('0xbb')](function(_0x8b09af){_0xc92b20[_0xd4bb('0xc4')]-=_0xc76514;_0xc92b20[_0xd4bb('0xc4')]=_0xc92b20[_0xd4bb('0xc4')]>0x0?_0xc92b20[_0xd4bb('0xc4')]:0x0;if(!checkContactEmpty(_0x8b09af)){_0x4e6347[_0xd4bb('0xb6')](_0xc92b20)[_0xd4bb('0xbb')](sendMessageReschedule(_0xc92b20))[_0xd4bb('0xb0')](loggerCatch(_0xd4bb('0x213')));}else{_0xc92b20[_0xd4bb('0x73')]+=_0x8b09af[_0xd4bb('0x97')];_0xc92b20[_0xd4bb('0x3f')]=_0xc92b20[_0xd4bb('0x5c')]===_0xd4bb('0x159')?_0xd4bb('0x214'):_0xd4bb('0x215');for(var _0x3bc8e2=0x0;_0x3bc8e2<_0x8b09af[_0xd4bb('0x97')];_0x3bc8e2+=0x1){if(_[_0xd4bb('0x122')](_0x8b09af[_0x3bc8e2])||_[_0xd4bb('0x122')](_0x8b09af[_0x3bc8e2][_0xd4bb('0x187')])||_[_0xd4bb('0x122')](_0x8b09af[_0x3bc8e2][_0xd4bb('0x173')])){_0x4e6347[_0xd4bb('0xcf')](_0xd4bb('0x20c'),_0xc92b20,_0x8b09af[_0x3bc8e2]);}else{_0x4e6347[_0xd4bb('0xb8')](_['pick'](_0x8b09af[_0x3bc8e2],['VoiceQueueId','Contact.phone']))['then'](_0x4e6347[_0xd4bb('0x216')](_0xc92b20,_0x8b09af[_0x3bc8e2]))[_0xd4bb('0xb0')](_0x4e6347[_0xd4bb('0xce')](_0xd4bb('0x20c'),_0xc92b20));}}}})[_0xd4bb('0xb0')](loggerGetContactDialer(_0xd4bb('0x217'),_0xc92b20,_0xc76514));}};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x8f')]=function(_0xeadfdd){if(_0xeadfdd['dialLimitQueue']>0x0){var _0x431f60=_0xeadfdd[_0xd4bb('0x210')]-_0xeadfdd[_0xd4bb('0x73')]-_0xeadfdd[_0xd4bb('0x56')];if(_0x431f60>0x0){this[_0xd4bb('0x218')](_0xeadfdd);}else{loggerPredictiveCalls[_0xd4bb('0x7e')](_0xd4bb('0x219'));}}else{this[_0xd4bb('0x218')](_0xeadfdd);}};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x218')]=function(_0x565d6a){var _0x567415=this;var _0x33edaf=[];_0x565d6a[_0xd4bb('0x73')]+=0x1;for(var _0x522105 in this[_0xd4bb('0x22')]){if(typeof this[_0xd4bb('0x22')][_0x522105]!==_0xd4bb('0x98')){if(this[_0xd4bb('0x22')][_0x522105][_0xd4bb('0xa7')]==='not_inuse'&&this[_0xd4bb('0x22')][_0x522105][_0xd4bb('0xae')]===_0xd4bb('0xd8')){_0x33edaf[_0xd4bb('0x126')](this[_0xd4bb('0x22')][_0x522105]['id']);}}}this['getContactDialer'](_0x565d6a['id'],_0x33edaf,0x1,_0x565d6a[_0xd4bb('0x20a')],_0x565d6a)[_0xd4bb('0xbb')](function(_0x53488c){if(!checkContactEmpty(_0x53488c)){checkContactLowerLimitOriginate(_0x565d6a,0x1,0x0);_0x567415[_0xd4bb('0xb6')](_0x565d6a)[_0xd4bb('0xbb')](sendMessageReschedule(_0x565d6a))[_0xd4bb('0xb0')](loggerCatch('[countReScheduled]\x20'));}else{_0x565d6a['message']=_0xd4bb('0x215');if(_[_0xd4bb('0x122')](_0x53488c[0x0])||_[_0xd4bb('0x122')](_0x53488c[0x0][_0xd4bb('0x187')])||_[_0xd4bb('0x122')](_0x53488c[0x0][_0xd4bb('0x173')])){_0x567415['emptyContact']('[actionOriginate]\x20',_0x565d6a,_0x53488c[0x0]);}else{_0x567415['checkIsBlackList'](_[_0xd4bb('0xd1')](_0x53488c[0x0],[_0xd4bb('0xd4'),_0xd4bb('0x21a')]))[_0xd4bb('0xbb')](_0x567415['checkContactBlack'](_0x565d6a,_0x53488c[0x0]))[_0xd4bb('0xb0')](_0x567415[_0xd4bb('0xce')]('[actionOriginatePredictive]\x20',_0x565d6a));}}})[_0xd4bb('0xb0')](loggerGetContactDialer(_0xd4bb('0x21b'),_0x565d6a,0x1));emitVoiceQueueSummary(_0x565d6a);};Dialer['prototype'][_0xd4bb('0x1ee')]=function(_0x1043f7,_0x22b652,_0x3e2c29,_0x118a9b,_0x8c9fad,_0x4eb422){loggerPredictive[_0xd4bb('0x7e')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x21c'),_0x1043f7);loggerPredictive['info'](_0xd4bb('0x21d'),_0x22b652);loggerPredictive[_0xd4bb('0x7e')]('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',_0x3e2c29);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x21e'),_0x118a9b);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x21f'),_0x8c9fad);loggerPredictive[_0xd4bb('0x7e')](_0xd4bb('0x85'));return new Promise(function(_0x560e10,_0xafe0e3){if(_0x1043f7<=0x0||isNaN(_0x1043f7)){return _0xafe0e3(msgResponse(_0xd4bb('0x220'),_0xd4bb('0x4a'),_0xd4bb('0x221')+_0x1043f7));}if(_0x3e2c29<=0x0||isNaN(_0x3e2c29)){return _0xafe0e3(msgResponse('[abandonmentRate]',_0xd4bb('0x4a'),_0xd4bb('0x222')+_0x3e2c29));}if(_0x118a9b<=0x0||isNaN(_0x118a9b)){return _0xafe0e3(msgResponse(_0xd4bb('0x220'),_0xd4bb('0x4a'),_0xd4bb('0x223')+_0x118a9b));}if(_0x22b652<=0x0||isNaN(_0x22b652)){return _0xafe0e3(msgResponse(_0xd4bb('0x220'),_0xd4bb('0x4a'),_0xd4bb('0x224')+_0x22b652));}if(_0x8c9fad<=0x0||isNaN(_0x8c9fad)){return _0xafe0e3(msgResponse('[abandonmentRate]',_0xd4bb('0x4a'),_0xd4bb('0x225')+_0x8c9fad));}_0x4eb422=_0x4eb422||0x0;var _0x554ba4=0x1/_0x3e2c29;var _0x4504a7=0x0;var _0x3e30cf=0x0;var _0x13489a=0x0;var _0x858887=0x0;for(var _0x36ed2f=0x0;_0x13489a<_0x8c9fad;_0x36ed2f+=0x1){_0x3e30cf=_0x36ed2f/_0x22b652;_0x4504a7=(_0x118a9b*_0x3e30cf+_0x4eb422)/_0x554ba4;_0x13489a=erlangb(_0x4504a7,_0x1043f7);_0x858887=_0x4504a7/_0x1043f7*(0x1-erlangb(_0x4504a7,_0x1043f7));}return _0x560e10({'erlangCalls':_0x36ed2f,'erlangCallToSecond':_0x22b652/_0x36ed2f,'erlangAbandonmentRate':_0x13489a,'erlangBusyFactor':_0x858887});});};Dialer[_0xd4bb('0x1c')][_0xd4bb('0x1e8')]=function(_0x4b7ed9,_0x38a1f7,_0xf45134,_0x205796,_0x2c37b8,_0x540528){loggerPredictive[_0xd4bb('0x7e')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xd4bb('0x7e')]('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',_0x4b7ed9);loggerPredictive['info'](_0xd4bb('0x21d'),_0x38a1f7);loggerPredictive[_0xd4bb('0x7e')]('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',_0xf45134);loggerPredictive['info'](_0xd4bb('0x21e'),_0x205796);loggerPredictive[_0xd4bb('0x7e')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c37b8);loggerPredictive[_0xd4bb('0x7e')]('---------------------------');return new Promise(function(_0xf1b7f2,_0x1aa583){if(_0x4b7ed9<=0x0||isNaN(_0x4b7ed9)){return _0x1aa583(msgResponse(_0xd4bb('0x226'),_0xd4bb('0x4a'),_0xd4bb('0x221')+_0x4b7ed9));}if(_0xf45134<=0x0||isNaN(_0xf45134)){return _0x1aa583(msgResponse(_0xd4bb('0x226'),_0xd4bb('0x4a'),_0xd4bb('0x222')+_0xf45134));}if(_0x205796<=0x0||isNaN(_0x205796)){return _0x1aa583(msgResponse('[busyFactor]',_0xd4bb('0x4a'),'p\x20=\x20'+_0x205796));}if(_0x38a1f7<=0x0||isNaN(_0x38a1f7)){return _0x1aa583(msgResponse(_0xd4bb('0x226'),_0xd4bb('0x4a'),'interval\x20=\x20'+_0x38a1f7));}if(_0x2c37b8<=0x0||isNaN(_0x2c37b8)){return _0x1aa583(msgResponse(_0xd4bb('0x226'),_0xd4bb('0x4a'),_0xd4bb('0x227')+_0x2c37b8));}_0x540528=_0x540528||0x0;var _0x53dd1d=0x1/_0xf45134;var _0x5a7667=0x0;var _0x8a802=0x0;var _0x3e7a96=0x0;var _0x3f3087=0x0;for(var _0x2a3cc5=0x0;_0x3f3087<_0x2c37b8;_0x2a3cc5+=0x1){_0x8a802=_0x2a3cc5/_0x38a1f7;_0x5a7667=(_0x205796*_0x8a802+_0x540528)/_0x53dd1d;_0x3e7a96=erlangb(_0x5a7667,_0x4b7ed9);_0x3f3087=_0x5a7667/_0x4b7ed9*(0x1-erlangb(_0x5a7667,_0x4b7ed9));}return _0xf1b7f2({'erlangCalls':_0x2a3cc5,'erlangCallToSecond':_0x38a1f7/_0x2a3cc5,'erlangAbandonmentRate':_0x3e7a96,'erlangBusyFactor':_0x3f3087});});};module[_0xd4bb('0x228')]=Dialer; \ No newline at end of file +var _0xc499=['uniqueid','state','HangupInAMD','AMD','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','membername','countglobal','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','reason19\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialAMDActive','countbusyretry','countnoanswerretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','Drop','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','dialAbandonedRetryFrequency','queueCallerAbandonCreateState','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','strategy','locked','paused','stateinterface','rrmemory','push','idHopper','queueStatusComplete','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','Action','iftime\x20%s,%s','content','indexOf','true','command','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:dialPreviewRecallReminder','handleIvr','checkIsTrunkReachable','dialTimezone','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','map','user:%s','dialGlobalInterval','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','Contact','tags','createdAt','updatedAt','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','originate','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','dialNoSuchNumberMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','lodash','moment','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','roundrobin','prototype','enqueue','tail','finally','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','message','NOT_ACTIVE','name','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','milliseconds','seconds','emit','outbound','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','isEmpty','info','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalTotalCalls','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','debug','inspect','error','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','statedesc','endtime','[uniqueid]','isNil','channel','catch','No\x20such\x20channel','ivr','updateOriginated','queue','campaigns','checkIsBlackList','resolve','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','status','reachable','unmonitored','variable','amdstatus','xcally-motion-dialer','value','HANGUP'];(function(_0x3e0e65,_0x476a7c){var _0x4cdfc8=function(_0x4300fa){while(--_0x4300fa){_0x3e0e65['push'](_0x3e0e65['shift']());}};_0x4cdfc8(++_0x476a7c);}(_0xc499,0x145));var _0x9c49=function(_0x1785e8,_0x492aac){_0x1785e8=_0x1785e8-0x0;var _0x5e6021=_0xc499[_0x1785e8];return _0x5e6021;};'use strict';var util=require('util');var _=require(_0x9c49('0x0'));var uuid=require('uuid');var moment=require(_0x9c49('0x1'));var rr=require('rr');var md5=require(_0x9c49('0x2'));var Redis=require(_0x9c49('0x3'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x9c49('0x4'))(_0x9c49('0x5'));var loggerBooked=require('../../../config/logger')(_0x9c49('0x6'));var loggerPredictive=require(_0x9c49('0x4'))(_0x9c49('0x7'));var loggerPredictiveCalls=require('../../../config/logger')(_0x9c49('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x9c49('0x9'));var ami=require(_0x9c49('0xa'));config[_0x9c49('0xb')]=_[_0x9c49('0xc')](config[_0x9c49('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x9c49('0xd'))(new Redis(config[_0x9c49('0xb')]));var cmHopper=require(_0x9c49('0xe'));var cmHopperHistory=require(_0x9c49('0xf'));var cmHopperAdditionalPhone=require(_0x9c49('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x9c49('0x11'));var RpcSetting=require('../rpc/setting');var Action=require(_0x9c49('0x12'));var History=require(_0x9c49('0x13'));var Final=require(_0x9c49('0x14'));var AgentComplete=require(_0x9c49('0x15'));var QueueCallerAbandon=require(_0x9c49('0x16'));var Hangup=require(_0x9c49('0x17'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x9c49('0x18')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9c49('0x19')][_0x9c49('0x1a')]=function(_0x3bbcd8){this[_0x9c49('0x1b')]=this['tail']?this[_0x9c49('0x1b')][_0x9c49('0x1c')](_0x3bbcd8):_0x3bbcd8();};function Dialer(_0x4a377f,_0x3fd35d){this['sequence']=new Sequence();this['preview']=_0x3fd35d;this[_0x9c49('0x1d')]=_0x4a377f[_0x9c49('0x1d')];this['campaigns']=_0x4a377f['campaigns'];this[_0x9c49('0x1e')]=_0x4a377f[_0x9c49('0x1e')];this[_0x9c49('0x1f')]=_0x4a377f[_0x9c49('0x1f')];this[_0x9c49('0x20')]=config['maxNumberOriginate']||0x2;this[_0x9c49('0x21')]={};this[_0x9c49('0x22')]={};this[_0x9c49('0x23')]={};this[_0x9c49('0x24')]={};this[_0x9c49('0x25')]={};this[_0x9c49('0x26')]={};this[_0x9c49('0x27')]={};this[_0x9c49('0x28')]={};this[_0x9c49('0x29')]={};this[_0x9c49('0x2a')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x9c49('0x2b')](this));ami['on'](_0x9c49('0x2c'),this[_0x9c49('0x2d')]['bind'](this));ami['on'](_0x9c49('0x2e'),this[_0x9c49('0x2f')][_0x9c49('0x2b')](this));ami['on'](_0x9c49('0x30'),this[_0x9c49('0x31')][_0x9c49('0x2b')](this));ami['on']('custom:queuesummary',this[_0x9c49('0x9')][_0x9c49('0x2b')](this));ami['on'](_0x9c49('0x32'),this[_0x9c49('0x33')][_0x9c49('0x2b')](this));ami['on']('hangup',this[_0x9c49('0x34')][_0x9c49('0x2b')](this));ami['on'](_0x9c49('0x35'),this['syncNewExten'][_0x9c49('0x2b')](this));ami['on'](_0x9c49('0x36'),this[_0x9c49('0x37')][_0x9c49('0x2b')](this));ami['on']('queuemember',this[_0x9c49('0x38')][_0x9c49('0x2b')](this));ami['on'](_0x9c49('0x39'),this['syncQueueStatusComplete'][_0x9c49('0x2b')](this));this[_0x9c49('0x3a')]();this[_0x9c49('0x3b')]();RpcSetting[_0x9c49('0x3c')]()[_0x9c49('0x3d')](function(_0x568423){previewRecallmeReminderInterval=_0x568423[_0x9c49('0x3e')];});}function isNotNull(_0x293656){return _0x293656!==null&&!_[_0x9c49('0x3f')](_0x293656);}function checkIsLoggedIn(_0x1cd9d1,_0x1ea505){return function(){if(_0x1ea505<=0x0){_0x1cd9d1['message']=_0x9c49('0x40');throw _0x1cd9d1['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x8bbd33){return _0x8bbd33;}function checkIsActive(_0x86d3c6,_0x4b51f8){return function(){if(!isActive(_0x4b51f8)){_0x86d3c6[_0x9c49('0x41')]=_0x9c49('0x42');throw _0x86d3c6[_0x9c49('0x43')]+_0x9c49('0x44');}};}function checkInterval(_0xdd5234){return function(){if(!isNotNull(_0xdd5234['Interval'])){_0xdd5234[_0x9c49('0x41')]=_0x9c49('0x45');throw _0xdd5234[_0x9c49('0x43')]+_0x9c49('0x46');}if(!isNotNull(_0xdd5234[_0x9c49('0x47')]['Intervals'])){_0xdd5234['message']=_0x9c49('0x45');throw _0xdd5234[_0x9c49('0x43')]+_0x9c49('0x46');}if(!isNotNull(_['isEmpty'](_0xdd5234[_0x9c49('0x47')][_0x9c49('0x48')]))){_0xdd5234[_0x9c49('0x41')]=_0x9c49('0x45');throw _0xdd5234[_0x9c49('0x43')]+_0x9c49('0x46');}};}function msgResponse(_0x5b00ba,_0x1dff29,_0x297b1f){return{'action':_0x5b00ba,'response':_0x1dff29,'message':_0x297b1f,'stack':_0x297b1f};}function myreject(_0x27404e){return function(_0x57a1f3){return _0x27404e(msgResponse(_0x9c49('0x49'),_0x9c49('0x4a'),JSON['stringify'](_0x57a1f3)));};}function getSeconds(_0x3355d5,_0x1bb66d){var _0x34ce5a=moment(_0x3355d5)[_0x9c49('0x4b')](0x0);var _0x35c1fc=moment(_0x1bb66d)[_0x9c49('0x4b')](0x0);return _0x34ce5a['diff'](_0x35c1fc,_0x9c49('0x4c'));}function emit(_0x375893,_0x1e932d,_0x20c584){io['to'](_0x375893)[_0x9c49('0x4d')](_0x1e932d,_0x20c584);}function emitVoiceQueueSummary(_0x45fd05){if(_0x45fd05['type']===_0x9c49('0x4e')){var _0x5ea42d={'id':_0x45fd05['id'],'name':_0x45fd05[_0x9c49('0x43')],'strategy':_0x45fd05['strategy'],'answered':_0x45fd05[_0x9c49('0x4f')],'available':_0x45fd05[_0x9c49('0x50')],'loggedIn':_0x45fd05[_0x9c49('0x51')],'pTalking':_0x45fd05[_0x9c49('0x52')],'sumBillable':_0x45fd05[_0x9c49('0x53')],'sumDuration':_0x45fd05[_0x9c49('0x54')],'sumHoldTime':_0x45fd05[_0x9c49('0x55')]||0x0,'talking':_0x45fd05['talking'],'total':_0x45fd05['total'],'type':_0x45fd05[_0x9c49('0x56')],'unmanaged':_0x45fd05[_0x9c49('0x57')],'abandoned':_0x45fd05[_0x9c49('0x58')],'waiting':_0x45fd05[_0x9c49('0x59')],'loggedInDb':_0x45fd05[_0x9c49('0x5a')],'dialActive':_0x45fd05[_0x9c49('0x5b')],'dialMethod':_0x45fd05[_0x9c49('0x5c')],'dialOriginateCallerIdName':_0x45fd05[_0x9c49('0x5d')],'dialOriginateCallerIdNumber':_0x45fd05[_0x9c49('0x5e')],'dialOriginateTimeout':_0x45fd05['dialOriginateTimeout'],'dialPrefix':_0x45fd05['dialPrefix'],'outboundAnswerAgiCallsDay':_0x45fd05[_0x9c49('0x5f')],'outboundAnswerCallsDay':_0x45fd05[_0x9c49('0x60')],'outboundBlacklistCallsDay':_0x45fd05['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x45fd05[_0x9c49('0x61')],'outboundCongestionCallsDay':_0x45fd05[_0x9c49('0x62')],'outboundDropCallsDayACS':_0x45fd05['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x45fd05['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x45fd05[_0x9c49('0x63')],'outboundNoAnswerCallsDay':_0x45fd05[_0x9c49('0x64')],'outboundNoSuchCallsDay':_0x45fd05[_0x9c49('0x65')],'outboundOriginateFailureCallsDay':_0x45fd05['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x45fd05[_0x9c49('0x66')],'outboundRejectCallsDay':_0x45fd05['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x45fd05[_0x9c49('0x67')],'predictiveIntervalAnsweredCalls':_0x45fd05['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x45fd05[_0x9c49('0x68')],'predictiveIntervalAvgTalktime':_0x45fd05[_0x9c49('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x45fd05[_0x9c49('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x45fd05[_0x9c49('0x6b')],'predictiveIntervalErlangCalls':_0x45fd05[_0x9c49('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x45fd05[_0x9c49('0x6d')],'predictiveIntervalHitRate':_0x45fd05[_0x9c49('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x45fd05[_0x9c49('0x6f')],'predictiveIntervalPauses':_0x45fd05['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x45fd05[_0x9c49('0x70')],'predictiveIntervalTotalCalls':_0x45fd05['predictiveIntervalTotalCalls'],'message':_0x45fd05[_0x9c49('0x41')],'originated':_0x45fd05[_0x9c49('0x71')],'erlangCalls':_0x45fd05[_0x9c49('0x72')],'erlangCallToSecond':_0x45fd05['erlangCallToSecond'],'erlangAbandonmentRate':_0x45fd05[_0x9c49('0x73')],'erlangBusyFactor':_0x45fd05[_0x9c49('0x74')],'startPredictive':_0x45fd05[_0x9c49('0x26')],'startProgressive':_0x45fd05[_0x9c49('0x27')]};if(_0x45fd05[_0x9c49('0x75')]){_0x5ea42d[_0x9c49('0x75')]={'id':_0x45fd05[_0x9c49('0x75')]['id'],'name':_0x45fd05['Trunk'][_0x9c49('0x43')],'active':_0x45fd05[_0x9c49('0x75')][_0x9c49('0x76')],'callerid':_0x45fd05[_0x9c49('0x75')][_0x9c49('0x77')]};}if(_0x45fd05['Interval']){_0x5ea42d[_0x9c49('0x47')]={'id':_0x45fd05['Interval']['id'],'name':_0x45fd05[_0x9c49('0x47')][_0x9c49('0x43')]};}var _0xdf8163=md5(JSON[_0x9c49('0x78')](_0x5ea42d));if(_0x45fd05[_0x9c49('0x2')]!==_0xdf8163){_0x45fd05[_0x9c49('0x2')]=_0xdf8163;emit(util[_0x9c49('0x79')](_0x9c49('0x7a'),_0x5ea42d[_0x9c49('0x43')]),_0x9c49('0x7b'),_0x5ea42d);}}}function emitCampaignSummary(_0x5d1471){if(_0x5d1471['type']==='ivr'){emit(util[_0x9c49('0x79')](_0x9c49('0x7c'),_0x5d1471[_0x9c49('0x43')]),'campaign:save',_0x5d1471);}}function checkGetDataPredictive(_0x5b808e){if(isNotNull(_0x5b808e)&&!_[_0x9c49('0x7d')](_0x5b808e)){loggerPredictive[_0x9c49('0x7e')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b808e['predictiveIntervalTotalCalls']);loggerPredictive[_0x9c49('0x7e')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b808e[_0x9c49('0x7f')]);loggerPredictive['info'](_0x9c49('0x80'),_0x5b808e[_0x9c49('0x6b')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b808e[_0x9c49('0x6a')]);loggerPredictive['info'](_0x9c49('0x81'),_0x5b808e[_0x9c49('0x68')]);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x82'),_0x5b808e[_0x9c49('0x69')]);loggerPredictive['info'](_0x9c49('0x83'));if(_0x5b808e[_0x9c49('0x84')]>0x0){if(!_[_0x9c49('0x3f')](_0x5b808e[_0x9c49('0x69')])&&_0x5b808e['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x9c49('0x3f')](_0x5b808e[_0x9c49('0x68')])&&_0x5b808e[_0x9c49('0x68')]>0x0){return!![];}loggerPredictive['info'](_0x9c49('0x85'));}else{loggerPredictive[_0x9c49('0x7e')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x86'));}return![];}function mergeDataErlangB(_0x5ac898){return function(_0x5af15c){loggerPredictive[_0x9c49('0x7e')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x87'),_0x5af15c[_0x9c49('0x72')]);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x88'),_0x5af15c['erlangCallToSecond']);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x89'),_0x5af15c[_0x9c49('0x73')]);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x8a'),_0x5af15c[_0x9c49('0x74')]);loggerPredictive['info'](_0x9c49('0x89'),_0x5af15c['erlangAbandonmentRate']);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x83'));_[_0x9c49('0x8b')](_0x5ac898,_0x5af15c);};}function getDiff(_0x1246b6){var _0x145731=moment()['milliseconds'](0x0);var _0x182a87=moment(_0x1246b6)[_0x9c49('0x4b')](0x0);return _0x145731[_0x9c49('0x8c')](_0x182a87,_0x9c49('0x4c'));}function ifInterval(_0x14ecdc,_0x3376db){if(_[_0x9c49('0x3f')](_0x3376db)){return![];}return getDiff(_0x3376db)<_0x14ecdc*0x3c;}function freeVariablesPredictive(_0x316ca0){if(isNotNull(_0x316ca0)){if(!_[_0x9c49('0x3f')](_0x316ca0['startProgressive'])){_0x316ca0[_0x9c49('0x27')]=undefined;loggerPredictive[_0x9c49('0x7e')](_0x316ca0[_0x9c49('0x43')],_0x9c49('0x8d'));}if(!_[_0x9c49('0x3f')](_0x316ca0[_0x9c49('0x26')])){_0x316ca0[_0x9c49('0x26')]=undefined;loggerPredictive['info'](_0x316ca0[_0x9c49('0x43')],_0x9c49('0x8e'));}if(!_[_0x9c49('0x3f')](_0x316ca0[_0x9c49('0x8f')])){clearInterval(_0x316ca0[_0x9c49('0x8f')]);_0x316ca0['handlePredictive']=undefined;loggerPredictive[_0x9c49('0x7e')](_0x316ca0[_0x9c49('0x43')],_0x9c49('0x90'));}}}function erlangb(_0xdc8b43,_0x5453ee){if(_0x5453ee===0x0){return 0x0;}var _0x409477=0x1;for(var _0x34cbff=0x1;_0x34cbff<=_0x5453ee;_0x34cbff+=0x1){_0x409477=0x1+_0x409477*_0x34cbff/_0xdc8b43;}return 0x1/_0x409477;}function isVoiceQueueOutbound(_0x2b9dd5){return _0x2b9dd5===_0x9c49('0x4e');}function isNotPreview(_0x2c2ca1){return _0x2c2ca1!==_0x9c49('0x91');}function isCampaignIvr(_0x3a3cc8){return _0x3a3cc8==='ivr';}function getCallerId(_0x572eea,_0x4052b9,_0x37d6d1){if(!_[_0x9c49('0x3f')](_0x37d6d1)&&typeof _0x37d6d1===_0x9c49('0x92')&&!_['isEmpty'](_0x37d6d1)){if(!_[_0x9c49('0x3f')](_0x4052b9)&&typeof _0x4052b9==='string'&&!_[_0x9c49('0x7d')](_0x4052b9)){return util[_0x9c49('0x79')](_0x9c49('0x93'),_0x4052b9,_0x37d6d1);}return util[_0x9c49('0x79')](_0x9c49('0x93'),_0x37d6d1,_0x37d6d1);}if(!_[_0x9c49('0x3f')](_0x572eea)&&typeof _0x572eea===_0x9c49('0x92')&&!_['isEmpty'](_0x572eea)){return _0x572eea;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x33453a,_0x4a5290){return function(_0xd3096){freeVariablesPredictive(_0x4a5290);emitVoiceQueueSummary(_0x4a5290);emitCampaignSummary(_0x4a5290);loggerSyncQueueSummary[_0x9c49('0x94')](_0x33453a,util[_0x9c49('0x95')](_0xd3096,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2cb656,_0x53babd){return function(_0x5a1345){loggerPredictive[_0x9c49('0x96')](_0x53babd['name'],_0x2cb656);loggerPredictive[_0x9c49('0x96')](_0x5a1345['stack']);freeVariablesPredictive(_0x53babd);};}function loggerCatch(_0x4e07f7){return function(_0x598be8){logger[_0x9c49('0x96')](_0x4e07f7,util['inspect'](_0x598be8,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4d1012){return _0x4d1012&&!_['isUndefined'](_0x4d1012)&&_0x4d1012[_0x9c49('0x97')]>0x0;}function decremetOriginate(_0x5350d5){if(!_[_0x9c49('0x3f')](_0x5350d5)&&_0x5350d5!==null){if(typeof _0x5350d5[_0x9c49('0x71')]!==_0x9c49('0x98')){if(_0x5350d5[_0x9c49('0x71')]>0x0){_0x5350d5[_0x9c49('0x71')]-=0x1;}else{logger[_0x9c49('0x96')](_0x9c49('0x99'));}}}else{logger[_0x9c49('0x96')](_0x9c49('0x9a'));}}function checkContactLowerLimitOriginate(_0x33c59d,_0x3ee0ee,_0x19c32a){if(_0x3ee0ee>_0x19c32a){for(var _0x4670eb=0x0;_0x4670eb<_0x3ee0ee-_0x19c32a;_0x4670eb+=0x1){decremetOriginate(_0x33c59d);}}}function loggerGetContactDialer(_0x1c58ee,_0x34419b,_0x359bb5){return function(_0x4153bb){checkContactLowerLimitOriginate(_0x34419b,_0x359bb5,0x0);logger[_0x9c49('0x96')](_0x1c58ee,util[_0x9c49('0x95')](_0x4153bb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x40700f){return function(_0x50e25c){if(isNotNull(_0x50e25c)&&isNotNull(_0x50e25c[0x0])){if(_0x50e25c[0x0]['contactsRescheduled']>0x0){_0x40700f[_0x9c49('0x41')]='RESCHEDULED_CONTACTS';logger['info']('[getContactDialer2][ReScheduled]'+_0x40700f[_0x9c49('0x43')],_0x50e25c[0x0][_0x9c49('0x9b')],_0x9c49('0x9c'));}else{_0x40700f[_0x9c49('0x41')]=_0x9c49('0x9d');logger[_0x9c49('0x7e')](_0x9c49('0x9e')+_0x40700f[_0x9c49('0x43')]);}}};}function notSendMessagesQueue(_0x2cece5){if(_0x2cece5[_0x9c49('0x9f')]){freeVariablesPredictive(_0x2cece5);if(_0x2cece5[_0x9c49('0x71')]===0x0&&_0x2cece5[_0x9c49('0xa0')]===0x0&&_0x2cece5['waiting']===0x0&&(_0x2cece5['pTalking']||0x0)===0x0){_0x2cece5[_0x9c49('0x9f')]=![];_0x2cece5[_0x9c49('0x50')]=0x0;_0x2cece5[_0x9c49('0x41')]=_0x9c49('0x42');loggerSyncQueueSummary[_0x9c49('0x94')](_0x9c49('0xa1'),_0x2cece5[_0x9c49('0x43')],_0x9c49('0xa2'));}else{_0x2cece5['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x9c49('0x94')](_0x9c49('0xa1'),_0x2cece5[_0x9c49('0x43')],'is\x20disactive');}emitVoiceQueueSummary(_0x2cece5);}}function notSendMessagesCampaign(_0x2b09e8){if(_0x2b09e8[_0x9c49('0x9f')]){if(_0x2b09e8['originated']===0x0){_0x2b09e8[_0x9c49('0x9f')]=![];_0x2b09e8[_0x9c49('0x41')]=_0x9c49('0x42');loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2b09e8[_0x9c49('0x43')],'is\x20not\x20active');}else{_0x2b09e8[_0x9c49('0x41')]=_0x9c49('0xa3');loggerSyncQueueSummary[_0x9c49('0x94')](_0x9c49('0xa4'),_0x2b09e8[_0x9c49('0x43')],_0x9c49('0xa5'));}emitCampaignSummary(_0x2b09e8);}}function createObjHistory(_0x4b973a,_0xb3998d,_0x223c76,_0x14178c,_0x9cafdd){_0x4b973a['message']=_0x223c76;var _0x1f28af=new Action(_0x4b973a,_0xb3998d);var _0x2fa2c5=new History(_0x1f28af);_0x2fa2c5['state']=_0x14178c;_0x2fa2c5[_0x9c49('0xa6')]=_0x9cafdd;_0x2fa2c5[_0x9c49('0xa7')]=_0x1f28af['starttime'];return _0x2fa2c5;}Dialer[_0x9c49('0x19')][_0x9c49('0x3b')]=function(){var _0x25dcd8=this;setInterval(function(){_0x25dcd8['clearZombieChannels'](_0x25dcd8[_0x9c49('0x24')],_0x9c49('0xa8'));_0x25dcd8['clearZombieChannels'](_0x25dcd8['actions'],'[actions]');},0x32c8);};Dialer[_0x9c49('0x19')]['clearZombieChannels']=function(_0x5f518b,_0xfbb18b){var _0x5b2de4=this;for(var _0x3797ea in _0x5f518b){if(typeof _0x5f518b[_0x3797ea]!=='undefined'){this['sequence'][_0x9c49('0x1a')](function(){if(!_[_0x9c49('0xa9')](_0x5f518b[_0x3797ea])){return ami['Action']({'action':'status','channel':_0x5f518b[_0x3797ea][_0x9c49('0xaa')]})[_0x9c49('0xab')](function(_0x5d7ebd){if(_0x5d7ebd[_0x9c49('0x41')]===_0x9c49('0xac')){setTimeout(function(){if(_0x5f518b[_0x3797ea]&&_0x5f518b[_0x3797ea][_0x9c49('0x56')]!==_0x9c49('0xad')){_0x5b2de4[_0x9c49('0xae')](_0x5b2de4['voiceQueues'][_0x5f518b[_0x3797ea][_0x9c49('0xaf')]]);logger[_0x9c49('0x96')]('[Dialer][checkChannel]',_0xfbb18b,_0x3797ea,_0x5f518b[_0x3797ea]['queue']);delete _0x5f518b[_0x3797ea];}if(_0x5f518b[_0x3797ea]&&_0x5f518b[_0x3797ea]['type']===_0x9c49('0xad')){_0x5b2de4['updateOriginated'](_0x5b2de4[_0x9c49('0xb0')][_0x5f518b[_0x3797ea][_0x9c49('0xaf')]]);logger['error']('[Dialer][checkChannel][ivr]',_0xfbb18b,_0x3797ea,_0x5f518b[_0x3797ea][_0x9c49('0xaf')]);delete _0x5f518b[_0x3797ea];}},0x2328);}});}});}}};Dialer[_0x9c49('0x19')]['countReScheduled']=function(_0x46af9b){return Promise['resolve']()[_0x9c49('0x3d')](cmHopper['countReScheduled'](_0x46af9b))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x9c49('0xb1')]=function(_0x1d129f){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopperBlack[_0x9c49('0xb1')](_0x1d129f))[_0x9c49('0xab')](loggerCatch(_0x9c49('0xb3')));};Dialer[_0x9c49('0x19')][_0x9c49('0xb4')]=function(_0x13ad82,_0x433d1c,_0xb5aefd){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopperAdditionalPhone[_0x9c49('0xb4')](_0x13ad82,_0x433d1c,_0xb5aefd))[_0x9c49('0xab')](loggerCatch(_0x9c49('0xb5')));};Dialer[_0x9c49('0x19')][_0x9c49('0xb6')]=function(_0x408d63,_0x4f8eee,_0x2efb9b){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopperAdditionalPhone[_0x9c49('0xb6')](_0x408d63,_0x4f8eee,_0x2efb9b))[_0x9c49('0xab')](loggerCatch(_0x9c49('0xb7')));};Dialer[_0x9c49('0x19')][_0x9c49('0xb8')]=function(_0x3b87c3){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopperBlack[_0x9c49('0xb8')](_0x3b87c3))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype']['averageHandleTime']=function(_0x3bf846){return Promise[_0x9c49('0xb2')]()['then'](cmHopperHistory['avgHandleTime'](_0x3bf846))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x9c49('0x19')]['rescheduleContact']=function(_0x21fa58){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopper[_0x9c49('0xb9')](_0x21fa58))[_0x9c49('0xab')](loggerCatch(_0x9c49('0xba')));};Dialer['prototype']['unlockContact']=function(_0x4b1572,_0x5a0e36,_0x426dc2){return Promise[_0x9c49('0xb2')]()['then'](cmHopper[_0x9c49('0xbb')](_0x4b1572,_0x5a0e36,_0x426dc2))[_0x9c49('0xab')](loggerCatch('[unlockContact]\x20'));};Dialer['prototype']['getContactDialer']=function(_0x639e93,_0x47ed91,_0x49a106,_0x2d7274,_0x5a00da){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopper[_0x9c49('0xbc')](_0x639e93,_0x47ed91,_0x49a106,_0x2d7274))[_0x9c49('0xab')](function(_0x24b98e){_0x5a00da['temp']-=_0x49a106;_0x5a00da[_0x9c49('0xbd')]=_0x5a00da[_0x9c49('0xbd')]>0x0?_0x5a00da[_0x9c49('0xbd')]:0x0;loggerCatch(_0x9c49('0xbe'))(_0x24b98e);});};Dialer[_0x9c49('0x19')][_0x9c49('0xbf')]=function(_0x3c2cd6,_0x3222e7,_0x127009,_0x51f9b1){return Promise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0x3c2cd6,_0x3222e7,_0x127009))[_0x9c49('0xab')](function(_0x50c150){_0x51f9b1['temp']-=_0x3222e7;_0x51f9b1['temp']=_0x51f9b1[_0x9c49('0xbd')]>0x0?_0x51f9b1[_0x9c49('0xbd')]:0x0;loggerCatch(_0x9c49('0xc0'))(_0x50c150);});};Dialer[_0x9c49('0x19')]['getVoiceQueueRtPauses']=function(_0x145f18){return Promise['resolve']()['then'](voiceQueueRt[_0x9c49('0xc1')](_0x145f18))[_0x9c49('0xab')](loggerCatch(_0x9c49('0xc2')));};Dialer[_0x9c49('0x19')][_0x9c49('0xc3')]=function(_0x4135a5){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopper['moveContactManagedDialer'](_0x4135a5))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x9c49('0x19')]['createHistory']=function(_0x1aaf9c){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopperHistory[_0x9c49('0xc4')](_0x1aaf9c))[_0x9c49('0xab')](loggerCatch(_0x9c49('0xc5')));};Dialer[_0x9c49('0x19')][_0x9c49('0xae')]=function(_0xef4fa2){if(!_['isUndefined'](_0xef4fa2)&&_0xef4fa2!==null){if(typeof _0xef4fa2[_0x9c49('0x71')]!==_0x9c49('0x98')){if(_0xef4fa2['originated']>0x0){_0xef4fa2[_0x9c49('0x71')]-=0x1;}else{logger['error'](_0x9c49('0xc6'));}}}else{logger['error'](_0x9c49('0xc7'));}};Dialer[_0x9c49('0x19')][_0x9c49('0xc8')]=function(_0x197007,_0x546d4a){var _0xbd63af=this;return function(_0x2d805b){_0xbd63af[_0x9c49('0xae')](_0x546d4a);logger[_0x9c49('0x96')](_0x197007,util[_0x9c49('0x95')](_0x2d805b,{'showHidden':![],'depth':null}));};};Dialer[_0x9c49('0x19')][_0x9c49('0xc9')]=function(_0x458edf,_0x4b62a1,_0x2f2146){var _0x27e296={'state':0x19,'statedesc':_0x9c49('0xca')};this[_0x9c49('0xae')](_0x4b62a1);this[_0x9c49('0xcb')](_['merge'](_0x27e296,_[_0x9c49('0xcc')](_0x2f2146,['ContactId',_0x9c49('0xcd'),_0x9c49('0xce'),_0x9c49('0xcf'),_0x9c49('0xd0')])),_0x9c49('0xd1'),_0x9c49('0xd2'));logger[_0x9c49('0x96')](_0x458edf);};Dialer[_0x9c49('0x19')][_0x9c49('0xd3')]=function(_0x2e4953){return _0x2e4953==='Success';};Dialer[_0x9c49('0x19')][_0x9c49('0xd4')]=function(_0x32d6ab){return!_[_0x9c49('0x3f')](_0x32d6ab)&&_0x32d6ab&&!_[_0x9c49('0x3f')](_0x32d6ab['name'])&&!_[_0x9c49('0x3f')](_0x32d6ab['active'])&&_0x32d6ab[_0x9c49('0x76')]&&(this[_0x9c49('0x1f')][util[_0x9c49('0x79')](_0x9c49('0xd5'),_0x32d6ab[_0x9c49('0x43')])][_0x9c49('0xd6')]===_0x9c49('0xd7')||this[_0x9c49('0x1f')][util['format'](_0x9c49('0xd5'),_0x32d6ab[_0x9c49('0x43')])][_0x9c49('0xd6')]===_0x9c49('0xd8'));};Dialer[_0x9c49('0x19')][_0x9c49('0xcb')]=function(_0x4f9a9d,_0x33b68c,_0x30bcb5){this[_0x9c49('0xc4')](_0x4f9a9d)[_0x9c49('0xab')](loggerCatch(_0x33b68c));this['moveContactManagedDialer'](_0x4f9a9d)['catch'](loggerCatch(_0x30bcb5));};Dialer[_0x9c49('0x19')][_0x9c49('0x37')]=function(_0x3c3879){var _0x4bb6bf=this;var _0x3d472b=this[_0x9c49('0x24')][_0x3c3879['uniqueid']];var _0x320941;if(!_[_0x9c49('0xa9')](_0x3c3879)&&!_[_0x9c49('0xa9')](_0x3c3879[_0x9c49('0xd9')])&&!_[_0x9c49('0xa9')](_0x3c3879[_0x9c49('0xd9')][_0x9c49('0xda')])&&_0x3c3879['exten']===_0x9c49('0xdb')&&_0x3d472b){if(_0x3d472b[_0x9c49('0x56')]!==_0x9c49('0xad')&&this[_0x9c49('0x1d')][_0x3d472b[_0x9c49('0xaf')]]['dialAMDActive']&&_0x3c3879[_0x9c49('0xdc')]===_0x9c49('0xdd')){delete this[_0x9c49('0x24')][_0x3c3879[_0x9c49('0xde')]];this['updateOriginated'](this[_0x9c49('0x1d')][_0x3d472b[_0x9c49('0xaf')]]);this[_0x9c49('0x1d')][_0x3d472b['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x9c49('0x1d')][_0x3d472b['queue']][_0x9c49('0x5f')]+=0x1;_0x320941=new Hangup(_0x3d472b,_0x3c3879);_0x320941[_0x9c49('0xdf')]=0x12;_0x320941['statedesc']=_0x9c49('0xe0');_0x320941['membername']=_0x9c49('0xe1');ami['emit'](_0x9c49('0xe2'),ut['buildObj'](_0x320941,'amd'));this[_0x9c49('0xcb')](_0x320941,_0x9c49('0xe3'),_0x9c49('0xe4'));}if(_0x3d472b[_0x9c49('0x56')]!==_0x9c49('0xad')&&this[_0x9c49('0x1d')][_0x3d472b[_0x9c49('0xaf')]]['dialAMDActive']&&_0x3c3879[_0x9c49('0xdc')]===_0x9c49('0xe5')){return new Promise(function(_0x534812,_0x8d43bf){delete _0x4bb6bf[_0x9c49('0x24')][_0x3c3879[_0x9c49('0xde')]];_0x4bb6bf[_0x9c49('0xae')](_0x4bb6bf[_0x9c49('0x1d')][_0x3d472b[_0x9c49('0xaf')]]);_0x4bb6bf[_0x9c49('0x1d')][_0x3d472b['queue']]['outboundAnswerCallsDay']+=0x1;_0x4bb6bf['voiceQueues'][_0x3d472b[_0x9c49('0xaf')]][_0x9c49('0x5f')]+=0x1;var _0x5748e0=_0x4bb6bf[_0x9c49('0x1d')][_0x3d472b[_0x9c49('0xaf')]];var _0x91a499=new Hangup(_0x3d472b,_0x3c3879);_0x91a499['state']=0x13;_0x91a499['statedesc']=_0x9c49('0xe6');_0x91a499[_0x9c49('0xe7')]=_0x9c49('0xe1');_0x91a499['countmachineretry']+=0x1;_0x91a499[_0x9c49('0xe8')]+=0x1;_0x91a499[_0x9c49('0xe9')]=!![];ami[_0x9c49('0x4d')](_0x9c49('0xe2'),ut['buildObj'](_0x91a499,_0x9c49('0xe9')));_0x4bb6bf[_0x9c49('0xc4')](_0x91a499)[_0x9c49('0xab')](loggerCatch(_0x9c49('0xea')));if(_0x91a499['countbusyretry']+_0x91a499[_0x9c49('0xeb')]+_0x91a499['countnoanswerretry']+_0x91a499[_0x9c49('0xec')]+_0x91a499[_0x9c49('0xed')]+_0x91a499['countabandonedretry']+_0x91a499[_0x9c49('0xee')]+_0x91a499['countagentrejectretry']>=_0x5748e0['dialGlobalMaxRetry']){_0x4bb6bf['stateGlobal'](_0x91a499,_0x534812,_0x8d43bf,_0x9c49('0xef'));}else{if(_0x91a499['countmachineretry']>=_0x5748e0['dialMachineMaxRetry']){_0x4bb6bf['createStateFinal'](_0x91a499,_0x534812,_0x8d43bf,'reason\x2019\x20machine....');}else{_0x4bb6bf['rescheduleContact']({'active':![],'countmachineretry':_0x91a499[_0x9c49('0xee')],'scheduledat':moment()[_0x9c49('0xf0')](_0x5748e0[_0x9c49('0xf1')],_0x9c49('0xf2'))[_0x9c49('0x79')](_0x9c49('0xf3')),'ContactId':_0x91a499[_0x9c49('0xf4')],'ListId':_0x91a499[_0x9c49('0xcd')],'VoiceQueueId':_0x91a499['VoiceQueueId']||undefined,'CampaignId':_0x91a499[_0x9c49('0xd0')]||undefined})['catch'](loggerCatch(_0x9c49('0xf5')));_0x534812({'reschedule':0x1});}}});}if(_0x3d472b[_0x9c49('0x56')]===_0x9c49('0xad')&&this[_0x9c49('0xb0')][_0x3d472b[_0x9c49('0xaf')]]['dialAMDActive']&&_0x3c3879[_0x9c49('0xdc')]===_0x9c49('0xdd')){delete this['uniqueId'][_0x3c3879['uniqueid']];this[_0x9c49('0xae')](this[_0x9c49('0xb0')][_0x3d472b['queue']]);_0x320941=new Hangup(_0x3d472b,_0x3c3879);_0x320941[_0x9c49('0xdf')]=0x12;_0x320941[_0x9c49('0xa6')]='HangupInAMD';_0x320941['membername']=_0x9c49('0xe1');ami[_0x9c49('0x4d')](_0x9c49('0xe2'),ut[_0x9c49('0xf6')](_0x320941,_0x9c49('0xe9')));this[_0x9c49('0xcb')](_0x320941,_0x9c49('0xf7'),_0x9c49('0xf8'));}if(_0x3d472b[_0x9c49('0x56')]===_0x9c49('0xad')&&this[_0x9c49('0xb0')][_0x3d472b[_0x9c49('0xaf')]][_0x9c49('0xf9')]&&_0x3c3879['value']==='MACHINE'){return new Promise(function(_0x42ca5b,_0x1fd213){delete _0x4bb6bf['uniqueId'][_0x3c3879[_0x9c49('0xde')]];_0x4bb6bf['updateOriginated'](_0x4bb6bf[_0x9c49('0xb0')][_0x3d472b['queue']]);_0x4bb6bf['campaigns'][_0x3d472b['queue']]['outboundAnswerCallsDay']+=0x1;_0x4bb6bf['campaigns'][_0x3d472b[_0x9c49('0xaf')]][_0x9c49('0x5f')]+=0x1;var _0x57cb9e=_0x4bb6bf[_0x9c49('0xb0')][_0x3d472b[_0x9c49('0xaf')]];var _0x21a49d=new Hangup(_0x3d472b,_0x3c3879);_0x21a49d[_0x9c49('0xdf')]=0x13;_0x21a49d[_0x9c49('0xa6')]='Machine';_0x21a49d[_0x9c49('0xe7')]=_0x9c49('0xe1');_0x21a49d[_0x9c49('0xee')]+=0x1;_0x21a49d[_0x9c49('0xe8')]+=0x1;_0x21a49d[_0x9c49('0xe9')]=!![];ami[_0x9c49('0x4d')](_0x9c49('0xe2'),ut['buildObj'](_0x21a49d,'amd'));_0x4bb6bf[_0x9c49('0xc4')](_0x21a49d)['catch'](loggerCatch(_0x9c49('0xea')));if(_0x21a49d[_0x9c49('0xfa')]+_0x21a49d[_0x9c49('0xeb')]+_0x21a49d[_0x9c49('0xfb')]+_0x21a49d[_0x9c49('0xec')]+_0x21a49d[_0x9c49('0xed')]+_0x21a49d[_0x9c49('0xfc')]+_0x21a49d[_0x9c49('0xee')]+_0x21a49d[_0x9c49('0xfd')]>=_0x57cb9e[_0x9c49('0xfe')]){_0x4bb6bf['stateGlobal'](_0x21a49d,_0x42ca5b,_0x1fd213,_0x9c49('0xef'));}else{if(_0x21a49d[_0x9c49('0xee')]>=_0x57cb9e[_0x9c49('0xff')]){_0x4bb6bf[_0x9c49('0x100')](_0x21a49d,_0x42ca5b,_0x1fd213,'reason\x2019\x20machine....');}else{_0x4bb6bf[_0x9c49('0xb9')]({'active':![],'countmachineretry':_0x21a49d[_0x9c49('0xee')],'scheduledat':moment()['add'](_0x57cb9e['dialMachineRetryFrequency'],_0x9c49('0xf2'))['format'](_0x9c49('0xf3')),'ContactId':_0x21a49d[_0x9c49('0xf4')],'ListId':_0x21a49d[_0x9c49('0xcd')],'VoiceQueueId':_0x21a49d[_0x9c49('0xcf')]||undefined,'CampaignId':_0x21a49d[_0x9c49('0xd0')]||undefined})[_0x9c49('0xab')](loggerCatch('[rescheduleContact][Machine]'));_0x42ca5b({'reschedule':0x1});}}});}}};Dialer[_0x9c49('0x19')][_0x9c49('0x34')]=function(_0x27fe05){var _0x38d27a=this['uniqueId'][_0x27fe05[_0x9c49('0xde')]];var _0x1bde7b;if(_0x38d27a&&_0x38d27a[_0x9c49('0x56')]==='ivr'){delete this[_0x9c49('0x24')][_0x27fe05[_0x9c49('0xde')]];this[_0x9c49('0xae')](this['campaigns'][_0x38d27a[_0x9c49('0xaf')]]);this[_0x9c49('0xb0')][_0x38d27a[_0x9c49('0xaf')]]['ivrAnswerCallsDay']+=0x1;_0x1bde7b=new Hangup(_0x38d27a,_0x27fe05);this[_0x9c49('0xc4')](_0x1bde7b)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x101')));this['moveContactManagedDialer'](_0x1bde7b)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x102')));}if(_0x38d27a&&_0x38d27a['type']!==_0x9c49('0xad')&&isNotNull(this[_0x9c49('0x1d')][_0x38d27a[_0x9c49('0xaf')]][_0x9c49('0x103')])){delete this['uniqueId'][_0x27fe05[_0x9c49('0xde')]];this['updateOriginated'](this[_0x9c49('0x1d')][_0x38d27a[_0x9c49('0xaf')]]);this[_0x9c49('0x1d')][_0x38d27a[_0x9c49('0xaf')]][_0x9c49('0x60')]+=0x1;this[_0x9c49('0x1d')][_0x38d27a[_0x9c49('0xaf')]][_0x9c49('0x5f')]+=0x1;_0x1bde7b=new Hangup(_0x38d27a,_0x27fe05);_0x1bde7b[_0x9c49('0xdf')]=0x10;_0x1bde7b[_0x9c49('0xa6')]=_0x9c49('0x104');_0x1bde7b[_0x9c49('0xe7')]='AGI';this[_0x9c49('0xc4')](_0x1bde7b)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x101')));this[_0x9c49('0xc3')](_0x1bde7b)[_0x9c49('0xab')](loggerCatch('[syncHangupIvr]'));}if(_0x38d27a&&_0x38d27a['type']!==_0x9c49('0xad')&&!isNotNull(this[_0x9c49('0x1d')][_0x38d27a[_0x9c49('0xaf')]][_0x9c49('0x103')])){delete this['uniqueId'][_0x27fe05['uniqueid']];this['updateOriginated'](this[_0x9c49('0x1d')][_0x38d27a[_0x9c49('0xaf')]]);this['voiceQueues'][_0x38d27a[_0x9c49('0xaf')]]['outboundUnknownCallsDay']+=0x1;_0x1bde7b=new Hangup(_0x38d27a,_0x27fe05);_0x1bde7b[_0x9c49('0xdf')]=0xc;_0x1bde7b[_0x9c49('0xa6')]=_0x27fe05[_0x9c49('0x105')];_0x1bde7b[_0x9c49('0xe7')]='Unknow';this[_0x9c49('0xc4')](_0x1bde7b)['catch'](loggerCatch(_0x9c49('0x101')));this[_0x9c49('0xc3')](_0x1bde7b)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x102')));}};Dialer['prototype'][_0x9c49('0x31')]=function(_0x4e9adc){var _0x42a0ee=this[_0x9c49('0x24')][_0x4e9adc[_0x9c49('0xde')]];if(this[_0x9c49('0x1d')][_0x4e9adc[_0x9c49('0xaf')]]){if(_0x42a0ee&&_0x42a0ee[_0x9c49('0x56')]!==_0x9c49('0xad')){delete this[_0x9c49('0x24')][_0x4e9adc[_0x9c49('0xde')]];this[_0x9c49('0x1d')][_0x4e9adc['queue']][_0x9c49('0x60')]+=0x1;var _0x4138b6=new AgentComplete(_0x42a0ee,_0x4e9adc);if(_0x4e9adc[_0x9c49('0x106')]===_0x9c49('0x107')){_0x4138b6[_0x9c49('0x108')]=this[_0x9c49('0x1d')][_0x4e9adc[_0x9c49('0xaf')]][_0x9c49('0x109')]&&this[_0x9c49('0x1d')][_0x4e9adc['queue']][_0x9c49('0x10a')]?moment()[_0x9c49('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x9c49('0xc4')](_0x4138b6)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x10b')));this[_0x9c49('0xc3')](_0x4138b6)['catch'](loggerCatch(_0x9c49('0x10c')));}}};Dialer[_0x9c49('0x19')][_0x9c49('0x10d')]=function(_0x5a84df){if(this[_0x9c49('0x1d')][_0x5a84df[_0x9c49('0xaf')]]){if(this[_0x9c49('0x24')][_0x5a84df[_0x9c49('0xde')]]&&this[_0x9c49('0x24')][_0x5a84df[_0x9c49('0xde')]][_0x9c49('0x56')]!=='ivr'){this['updateOriginated'](this['voiceQueues'][_0x5a84df[_0x9c49('0xaf')]]);this[_0x9c49('0x24')][_0x5a84df[_0x9c49('0xde')]][_0x9c49('0x10e')]=moment()[_0x9c49('0x79')](_0x9c49('0xf3'));}}};Dialer[_0x9c49('0x19')]['queueCallerAbandonCreateState']=function(_0x5f5319,_0x51fdf){this[_0x9c49('0xc4')](_0x5f5319)[_0x9c49('0xab')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x51fdf==0x0){this[_0x9c49('0xc3')](_0x5f5319)[_0x9c49('0xab')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x9c49('0x19')][_0x9c49('0x2d')]=function(_0x4580fc){var _0x2d3cc7=this['uniqueId'][_0x4580fc[_0x9c49('0xde')]];var _0x454b1c=this;var _0x36e98f=![];var _0x261a44;var _0x399af8;if(this['voiceQueues'][_0x4580fc[_0x9c49('0xaf')]]){if(_0x2d3cc7&&_0x2d3cc7['type']!=='ivr'){delete this[_0x9c49('0x24')][_0x4580fc[_0x9c49('0xde')]];this['updateOriginated'](this[_0x9c49('0x1d')][_0x4580fc['queue']]);_0x2d3cc7[_0x9c49('0x10f')]=moment()[_0x9c49('0x79')](_0x9c49('0xf3'));var _0x273a06=new QueueCallerAbandon(_0x2d3cc7,_0x4580fc);if(getSeconds(_0x2d3cc7['droptime'],_0x2d3cc7[_0x9c49('0x110')])>=_0x2d3cc7[_0x9c49('0x111')]){this[_0x9c49('0x1d')][_0x4580fc[_0x9c49('0xaf')]][_0x9c49('0x6b')]+=0x1;this['voiceQueues'][_0x4580fc[_0x9c49('0xaf')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x9c49('0x1d')][_0x4580fc['queue']][_0x9c49('0x6d')]+=0x1;_0x273a06[_0x9c49('0xdf')]=0xa;_0x273a06[_0x9c49('0xa6')]='Drop';_0x273a06[_0x9c49('0x112')]=_0x9c49('0x113');_0x273a06[_0x9c49('0x108')]=this[_0x9c49('0x1d')][_0x4580fc['queue']][_0x9c49('0x109')]?moment()[_0x9c49('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x273a06['countdropretry']+=0x1;_0x273a06[_0x9c49('0xe8')]+=0x1;_0x261a44=this[_0x9c49('0x1d')][_0x4580fc[_0x9c49('0xaf')]][_0x9c49('0x114')];_0x399af8=this['voiceQueues'][_0x4580fc[_0x9c49('0xaf')]][_0x9c49('0x115')];_0x454b1c[_0x9c49('0xb4')](_0x273a06,_0x273a06[_0x9c49('0xdf')],_0x2d3cc7[_0x9c49('0x116')])[_0x9c49('0x3d')](function(_0x168ccb){_0x36e98f=_0x168ccb[_0x9c49('0x117')]==0x1;if(_0x273a06[_0x9c49('0xed')]>=_0x454b1c[_0x9c49('0x1d')][_0x4580fc[_0x9c49('0xaf')]][_0x9c49('0x118')]){_0x454b1c['queueCallerAbandonCreateState'](_0x273a06,_0x168ccb[_0x9c49('0x117')]);}else{_0x454b1c[_0x9c49('0xb9')]({'active':![],'countdropretry':_0x273a06[_0x9c49('0xed')],'scheduledat':moment()[_0x9c49('0xf0')](_0x454b1c['voiceQueues'][_0x4580fc['queue']][_0x9c49('0x114')],_0x9c49('0xf2'))[_0x9c49('0x79')](_0x9c49('0xf3')),'ContactId':_0x2d3cc7['ContactId'],'ListId':_0x2d3cc7[_0x9c49('0xcd')],'VoiceQueueId':_0x2d3cc7[_0x9c49('0xcf')]||undefined,'CampaignId':_0x2d3cc7[_0x9c49('0xd0')]||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0x119')));var _0x56e9bd=new History(_0x273a06);_0x56e9bd[_0x9c49('0xdf')]=0xa;_0x56e9bd[_0x9c49('0xa6')]=_0x9c49('0x11a');_0x56e9bd['starttime']=moment()[_0x9c49('0x79')](_0x9c49('0xf3'));_0x56e9bd[_0x9c49('0xa7')]=_0x56e9bd[_0x9c49('0x11b')];_0x56e9bd['calleridname']=_0x273a06[_0x9c49('0x11c')];_0x56e9bd[_0x9c49('0x11d')]=_0x273a06[_0x9c49('0x11d')];_0x454b1c['createHistory'](_0x56e9bd)['catch'](loggerCatch(_0x9c49('0x11e')));}})[_0x9c49('0x3d')](function(){if(_0x36e98f)_0x454b1c['swapAdditionalPhones'](_0x273a06,_0x261a44,_0x399af8)[_0x9c49('0x3d')](function(){return 0x1;});});}else{this[_0x9c49('0x1d')][_0x4580fc['queue']][_0x9c49('0x6a')]+=0x1;this[_0x9c49('0x1d')][_0x4580fc[_0x9c49('0xaf')]][_0x9c49('0x11f')]+=0x1;_0x273a06[_0x9c49('0xdf')]=0xb;_0x273a06[_0x9c49('0xa6')]='Abandoned';_0x273a06[_0x9c49('0x112')]='CALLEREXIT';_0x273a06[_0x9c49('0xfc')]+=0x1;_0x273a06[_0x9c49('0xe8')]+=0x1;_0x261a44=this[_0x9c49('0x1d')][_0x4580fc['queue']][_0x9c49('0x120')];_0x399af8=this[_0x9c49('0x1d')][_0x4580fc[_0x9c49('0xaf')]]['callAdditionalPhoneAfterMin'];_0x454b1c[_0x9c49('0xb4')](_0x273a06,_0x273a06[_0x9c49('0xdf')],_0x2d3cc7['voiceQueue'])['then'](function(_0x151786){if(_0x273a06['countabandonedretry']>=_0x454b1c[_0x9c49('0x1d')][_0x4580fc[_0x9c49('0xaf')]]['dialAbandonedMaxRetry']){_0x454b1c[_0x9c49('0x121')](_0x273a06,_0x151786['additional']);}else{_0x454b1c[_0x9c49('0xb9')]({'active':![],'countabandonedretry':_0x273a06[_0x9c49('0xfc')],'scheduledat':moment()['add'](_0x454b1c[_0x9c49('0x1d')][_0x4580fc[_0x9c49('0xaf')]][_0x9c49('0x120')],_0x9c49('0xf2'))[_0x9c49('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2d3cc7[_0x9c49('0xf4')],'ListId':_0x2d3cc7[_0x9c49('0xcd')],'VoiceQueueId':_0x2d3cc7[_0x9c49('0xcf')]||undefined,'CampaignId':_0x2d3cc7[_0x9c49('0xd0')]||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0x122')));var _0x2e0b44=new History(_0x273a06);_0x2e0b44['state']=0xb;_0x2e0b44['statedesc']=_0x9c49('0x123');_0x2e0b44['starttime']=moment()['format'](_0x9c49('0xf3'));_0x2e0b44[_0x9c49('0xa7')]=_0x2e0b44[_0x9c49('0x11b')];_0x2e0b44[_0x9c49('0x11c')]=_0x273a06[_0x9c49('0x11c')];_0x2e0b44[_0x9c49('0x11d')]=_0x273a06[_0x9c49('0x11d')];_0x454b1c[_0x9c49('0xc4')](_0x2e0b44)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x124')));}})[_0x9c49('0x3d')](function(){if(_0x36e98f)_0x454b1c[_0x9c49('0xb6')](_0x273a06,_0x261a44,_0x399af8)[_0x9c49('0x3d')](function(){return 0x1;});});}}}};Dialer[_0x9c49('0x19')][_0x9c49('0x125')]=function(_0x68b5ca){if(this[_0x9c49('0x22')][_0x68b5ca[_0x9c49('0xde')]]){this[_0x9c49('0x22')][_0x68b5ca[_0x9c49('0xde')]][_0x9c49('0xaa')]=_0x68b5ca[_0x9c49('0xaa')];}if(this[_0x9c49('0x24')][_0x68b5ca[_0x9c49('0xde')]]){this[_0x9c49('0x24')][_0x68b5ca[_0x9c49('0xde')]][_0x9c49('0xaa')]=_0x68b5ca[_0x9c49('0xaa')];}};Dialer[_0x9c49('0x19')][_0x9c49('0x38')]=function(_0x371244){if(strategy[this[_0x9c49('0x1d')][this[_0x9c49('0x22')][_0x371244[_0x9c49('0x126')]][_0x9c49('0xaf')]][_0x9c49('0x127')]]===_0x9c49('0x18')){if(this[_0x9c49('0x22')][_0x371244[_0x9c49('0x126')]]&&_[_0x9c49('0xa9')](this[_0x9c49('0x22')][_0x371244['actionid']][_0x9c49('0x128')])&&_0x371244[_0x9c49('0xd6')]==='1'&&_0x371244[_0x9c49('0x129')]==='0'){if(this['agents'][_0x371244[_0x9c49('0x12a')]]){if(!this[_0x9c49('0x1e')][_0x371244[_0x9c49('0x12a')]][_0x9c49('0x128')]){this[_0x9c49('0x1e')][_0x371244[_0x9c49('0x12a')]][_0x9c49('0x128')]=!![];this[_0x9c49('0x22')][_0x371244[_0x9c49('0x126')]][_0x9c49('0x128')]=!![];this[_0x9c49('0x22')][_0x371244[_0x9c49('0x126')]][_0x9c49('0x12a')]=_0x371244['stateinterface'];}}}}else if((strategy[this[_0x9c49('0x1d')][this['actions'][_0x371244[_0x9c49('0x126')]][_0x9c49('0xaf')]]['strategy']]||_0x9c49('0x12b'))===_0x9c49('0x12b')){if(this[_0x9c49('0x22')][_0x371244[_0x9c49('0x126')]]){if(this[_0x9c49('0x1e')][_0x371244[_0x9c49('0x12a')]]){this[_0x9c49('0x22')][_0x371244[_0x9c49('0x126')]][_0x9c49('0x12a')]=_0x371244[_0x9c49('0x12a')];if(_[_0x9c49('0xa9')](this[_0x9c49('0x29')][this[_0x9c49('0x22')][_0x371244['actionid']][_0x9c49('0xaf')]])){this['queueBooked'][this[_0x9c49('0x22')][_0x371244[_0x9c49('0x126')]][_0x9c49('0xaf')]]=[];}this[_0x9c49('0x29')][this[_0x9c49('0x22')][_0x371244['actionid']]['queue']][_0x9c49('0x12c')](_[_0x9c49('0x8b')](_[_0x9c49('0xcc')](this[_0x9c49('0x22')][_0x371244[_0x9c49('0x126')]],[_0x9c49('0x12d'),_0x9c49('0x12a')]),{'status':_0x371244[_0x9c49('0xd6')],'paused':_0x371244[_0x9c49('0x129')]}));}}}};function unlockQueueStatus(_0x3d3bd9,_0x524131){setTimeout(function(){if(_[_0x9c49('0x3f')](_0x3d3bd9[_0x9c49('0x12e')])){loggerBooked[_0x9c49('0x96')]('[unlockQueueStatus][undefined]',_0x524131);}_0x3d3bd9[_0x9c49('0x12e')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x524131,JSON['stringify'](_[_0x9c49('0xcc')](_0x3d3bd9,[_0x9c49('0x43'),_0x9c49('0x12e')])));},0x1f3);}Dialer[_0x9c49('0x19')][_0x9c49('0x12f')]=function(_0x3ccc7c){var _0x5c601c=this;var _0x25f87e=_0x5c601c[_0x9c49('0x1d')][_0x5c601c[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xaf')]];if(strategy[this['voiceQueues'][this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xaf')]]['strategy']]===_0x9c49('0x18')){if(this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]]&&this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0x12a')]){this[_0x9c49('0x91')][_0x9c49('0x130')](this['actions'][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0x12d')],this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0x12a')])[_0x9c49('0xab')](function(_0x3d8540){logger[_0x9c49('0x96')](_0x9c49('0x131'),util[_0x9c49('0x95')](_0x3d8540,{'showHidden':![],'depth':null}));})[_0x9c49('0x1c')](function(){_0x5c601c[_0x9c49('0xae')](_0x5c601c[_0x9c49('0x1d')][_0x5c601c[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]]['queue']]);_0x5c601c[_0x9c49('0x1e')][_0x5c601c['actions'][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0x12a')]][_0x9c49('0x128')]=![];delete _0x5c601c[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]];unlockQueueStatus(_0x25f87e);});}else{this['updateOriginated'](this[_0x9c49('0x1d')][this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]]['queue']]);this[_0x9c49('0xb9')]({'active':![],'ContactId':this['actions'][_0x3ccc7c['actionid']][_0x9c49('0xf4')],'ListId':this['actions'][_0x3ccc7c[_0x9c49('0x126')]]['ListId'],'VoiceQueueId':this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xcf')]||undefined,'CampaignId':this['actions'][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xd0')]||undefined})['catch'](loggerCatch(_0x9c49('0x132')));delete this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]];unlockQueueStatus(_0x25f87e);}}else if((strategy[this[_0x9c49('0x1d')][this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]]['queue']][_0x9c49('0x127')]]||_0x9c49('0x12b'))==='rrmemory'){var _0x17211c;if(this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]]&&!_[_0x9c49('0x7d')](this[_0x9c49('0x29')][this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xaf')]])){if(this[_0x9c49('0x2a')][_0x5c601c[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xaf')]]){this[_0x9c49('0x2a')][_0x5c601c['actions'][_0x3ccc7c['actionid']][_0x9c49('0xaf')]]=this[_0x9c49('0x2a')][this['actions'][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xaf')]]?this['queueBookedRR'][this[_0x9c49('0x22')][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xaf')]]:this[_0x9c49('0x29')][this['actions'][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xaf')]]?this[_0x9c49('0x29')][this['actions'][_0x3ccc7c[_0x9c49('0x126')]][_0x9c49('0xaf')]][_0x9c49('0x133')]||0x0:0x0;}this[_0x9c49('0x29')][this['actions'][_0x3ccc7c[_0x9c49('0x126')]]['queue']][_0x9c49('0x133')]=this['queueBookedRR'][this[_0x9c49('0x22')][_0x3ccc7c['actionid']]['queue']];for(var _0x1d9a23=0x0;_0x1d9a23=0x0;})[_0x9c49('0xab')](myreject(_0x17c934)));}}else{_0x472d96[_0x9c49('0x12c')](ami[_0x9c49('0x149')]({'action':_0x9c49('0x14e'),'command':util[_0x9c49('0x79')](_0x9c49('0x14a'),_0x155e0a,!_[_0x9c49('0x3f')](config['timezones'][_0x470fd4])?_0x470fd4:'')})[_0x9c49('0x3d')](function(_0xcd318b){return _0xcd318b[_0x9c49('0x14b')][_0x9c49('0x14c')](_0x9c49('0x14d'))>=0x0;})[_0x9c49('0xab')](myreject(_0x17c934)));}Promise[_0x9c49('0x14f')](_0x472d96)[_0x9c49('0x3d')](function(_0x95db26){var _0x5e2575=_['some'](_0x95db26);if(_0x5e2575){return _0x12f00e(_0x5e2575);}else{_0x35aa4a[_0x9c49('0x41')]=_0x130690?_0x9c49('0x150'):_0x9c49('0x151');return _0x17c934(msgResponse(_0x9c49('0x152'),_0x9c49('0x144'),_0x9c49('0x153')+_0x130690+'\x20'+_0x448a9b+_0x9c49('0x154')+util[_0x9c49('0x95')](_0x155e0a,{'showHidden':![],'depth':null})+_0x9c49('0x155')+_0x470fd4));}})[_0x9c49('0xab')](function(_0x48da39){return _0x17c934(msgResponse(_0x9c49('0x140'),_0x9c49('0x144'),JSON['stringify'](_0x48da39)));});});};Dialer[_0x9c49('0x19')][_0x9c49('0x156')]=function(_0x2b5b38){var _0x55a82e=this;return function(){switch(_0x2b5b38[_0x9c49('0x5c')]){case _0x9c49('0x157'):freeVariablesPredictive(_0x2b5b38);_0x55a82e[_0x9c49('0x158')](_0x2b5b38,0x1);break;case _0x9c49('0x159'):freeVariablesPredictive(_0x2b5b38);_0x55a82e['handlePower'](_0x2b5b38,_0x2b5b38['dialPowerLevel']);break;case _0x9c49('0x7'):_0x55a82e[_0x9c49('0x7')](_0x2b5b38);break;case _0x9c49('0x6'):freeVariablesPredictive(_0x2b5b38);_0x55a82e['handlePower'](_0x2b5b38,0x1);break;default:freeVariablesPredictive(_0x2b5b38);logger[_0x9c49('0x96')]('Queue',_0x2b5b38[_0x9c49('0x43')],_0x9c49('0x15a'));}};};Dialer[_0x9c49('0x19')]['checkPreviewRecallReminder']=function(_0x42e296){return Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](cmHopper[_0x9c49('0x15b')](_0x42e296['id'],previewRecallmeReminderInterval))['then'](function(_0x3f2b69){for(var _0x30803e=0x0;_0x30803e<_0x3f2b69[_0x9c49('0x97')];_0x30803e++){var _0x51dc32=_0x3f2b69[_0x30803e][_0x9c49('0x15c')]['name'];if(_0x51dc32)io['to'](util[_0x9c49('0x79')]('user:%s',_0x51dc32))[_0x9c49('0x4d')](_0x9c49('0x15d'),{'hopper':_0x3f2b69[_0x30803e]});}})[_0x9c49('0xab')](function(){});};Dialer['prototype']['launchHandleIvr']=function(_0xbe1c96){var _0x2be008=this;return function(){_0x2be008[_0x9c49('0x15e')](_0xbe1c96);};};Dialer[_0x9c49('0x19')][_0x9c49('0x9')]=function(_0x1b8acc){var _0x3c4edc=this;if(isNotPreview(_0x1b8acc[_0x9c49('0x5c')])){if(isVoiceQueueOutbound(_0x1b8acc['type'])&&isActive(_0x1b8acc[_0x9c49('0x5b')])){_0x1b8acc[_0x9c49('0x9f')]=!![];Promise[_0x9c49('0xb2')]()[_0x9c49('0x3d')](checkIsLoggedIn(_0x1b8acc,_0x1b8acc[_0x9c49('0x51')]))[_0x9c49('0x3d')](checkIsActive(_0x1b8acc,_0x1b8acc['dialActive']))[_0x9c49('0x3d')](checkInterval(_0x1b8acc))[_0x9c49('0x3d')](_0x3c4edc[_0x9c49('0x15f')](_0x1b8acc))['then'](_0x3c4edc[_0x9c49('0x13f')](_0x1b8acc['dialGlobalInterval'],_0x1b8acc[_0x9c49('0x160')],_0x1b8acc['name'],_0x1b8acc))[_0x9c49('0x3d')](_0x3c4edc[_0x9c49('0x141')](_0x1b8acc[_0x9c49('0x47')],_0x1b8acc[_0x9c49('0x160')],_0x1b8acc[_0x9c49('0x43')],_0x1b8acc))[_0x9c49('0x3d')](_0x3c4edc[_0x9c49('0x156')](_0x1b8acc))['catch'](loggerCatchQueueSummary(_0x9c49('0x161'),_0x1b8acc));}else{notSendMessagesQueue(_0x1b8acc);}}else{freeVariablesPredictive(_0x1b8acc);}};Dialer[_0x9c49('0x19')][_0x9c49('0x33')]=_[_0x9c49('0x162')](function(){var _0x1abd3a=_[_0x9c49('0x163')](this[_0x9c49('0x1d')],function(_0x2e1bd4){return _0x2e1bd4[_0x9c49('0x164')];});var _0xe1fcce=_[_0x9c49('0x163')](this[_0x9c49('0x1e')],function(_0x4852e0){return _0x4852e0['online']&&_0x4852e0[_0x9c49('0xd6')]===_0x9c49('0xd7');});if(_0x1abd3a[_0x9c49('0x97')]>0x0&&_0xe1fcce[_0x9c49('0x97')]>0x0){return Promise[_0x9c49('0xb2')]()['then'](cmHopper[_0x9c49('0x15b')](_[_0x9c49('0x165')](_0x1abd3a,'id'),previewRecallmeReminderInterval,_[_0x9c49('0x165')](_0xe1fcce,'id')))['then'](function(_0x54df67){for(var _0x15d668=0x0;_0x15d668<_0x54df67[_0x9c49('0x97')];_0x15d668++){var _0x5ae87d=_0x54df67[_0x15d668][_0x9c49('0x15c')][_0x9c49('0x43')];if(_0x5ae87d)io['to'](util[_0x9c49('0x79')](_0x9c49('0x166'),_0x5ae87d))[_0x9c49('0x4d')](_0x9c49('0x15d'),{'hopper':_0x54df67[_0x15d668]});}})['catch'](function(_0x38c169){logger[_0x9c49('0x96')]('checkPreviewRecallReminder',_0x38c169);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['syncCampaigns']=function(){var _0x23ef3a=this;var _0x71dbb0;for(var _0x37c55d in this[_0x9c49('0xb0')]){if(typeof this[_0x9c49('0xb0')][_0x37c55d]!==_0x9c49('0x98')){_0x71dbb0=this['campaigns'][_0x37c55d];if(isCampaignIvr(_0x71dbb0[_0x9c49('0x56')])&&isActive(_0x71dbb0[_0x9c49('0x76')])){_0x71dbb0[_0x9c49('0x9f')]=!![];Promise['resolve']()[_0x9c49('0x3d')](checkIsActive(_0x71dbb0,_0x71dbb0[_0x9c49('0x76')]))['then'](checkInterval(_0x71dbb0))[_0x9c49('0x3d')](_0x23ef3a['checkIsTrunkReachable'](_0x71dbb0))[_0x9c49('0x3d')](_0x23ef3a[_0x9c49('0x13f')](_0x71dbb0[_0x9c49('0x167')],_0x71dbb0[_0x9c49('0x160')],_0x71dbb0[_0x9c49('0x43')],_0x71dbb0))[_0x9c49('0x3d')](_0x23ef3a[_0x9c49('0x141')](_0x71dbb0[_0x9c49('0x47')],_0x71dbb0[_0x9c49('0x160')],_0x71dbb0['name'],_0x71dbb0))[_0x9c49('0x3d')](_0x23ef3a[_0x9c49('0x168')](_0x71dbb0))[_0x9c49('0xab')](loggerCatchQueueSummary(_0x9c49('0x169'),_0x71dbb0));}else{notSendMessagesCampaign(_0x71dbb0);}}}};function getCallerIdRandom(_0x19b21c,_0x4ee8fa){var _0x59723f;var _0x2a5bce;var _0x200bea;if(_0x4ee8fa<=0x0){_0x4ee8fa=0x1;}_0x59723f=new RegExp(_0x9c49('0x16a')+_0x4ee8fa+'}$');_0x2a5bce=Math[_0x9c49('0x16b')](0xa,_0x4ee8fa-0x1);_0x200bea=Math[_0x9c49('0x16b')](0xa,_0x4ee8fa)-0x1;return util[_0x9c49('0x79')]('%s',_[_0x9c49('0x16c')](_0x19b21c,_0x59723f,_['random'](_0x2a5bce,_0x200bea)));}function extractCalleridName(_0x3628bd){var _0x191c22=_0x3628bd[_0x9c49('0x16d')](/"(.*?)"/);return _0x191c22?_0x191c22[0x1]:_0x3628bd;}Dialer[_0x9c49('0x19')][_0x9c49('0x16e')]=function(_0x631642,_0x5a0d8d){var _0x8fdf6b=this;var _0x391ea5=uuid['v4']();this[_0x9c49('0x22')][_0x391ea5]=new Action(_0x631642,_0x5a0d8d,_0x391ea5);return new Promise(function(_0x263c63,_0x94d3d9){if(_[_0x9c49('0x3f')](_0x631642)&&typeof _0x631642!==_0x9c49('0x16f')){return _0x94d3d9(msgResponse('originate',_0x9c49('0x144'),_0x9c49('0x170')));}if(_[_0x9c49('0x3f')](_0x5a0d8d['phone'])||_0x5a0d8d[_0x9c49('0x171')]===null){return _0x94d3d9(msgResponse('originate',_0x9c49('0x144'),_0x9c49('0x172')));}var _0x58eda2={'XMD-CALLERID':_0x8fdf6b[_0x9c49('0x22')][_0x391ea5][_0x9c49('0x173')](),'XMD-AGI':_0x631642['dialQueueProject']?util[_0x9c49('0x79')](_0x9c49('0x174'),ipAgi,_0x631642['dialQueueProject']):_0x9c49('0x175'),'XMD-AGIAFTER':_0x631642['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x631642['dialQueueProject2']):_0x9c49('0x175'),'XMD-QUEUE':_0x631642[_0x9c49('0x56')]==='outbound'?util[_0x9c49('0x79')](_0x9c49('0x176'),_0x631642['name'],_0x631642[_0x9c49('0x177')]||'',_0x631642[_0x9c49('0x10a')]?'c':'',_0x631642[_0x9c49('0x111')]||0x3):'NONE','XMD-CONTACTID':_0x5a0d8d[_0x9c49('0xf4')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x8fdf6b[_0x9c49('0x22')][_0x391ea5][_0x9c49('0x173')](),'XMD-AMD':_0x631642[_0x9c49('0xf9')]?_0x9c49('0x178'):_0x9c49('0x175'),'XMD-DESTINATION':_0x9c49('0xdb')};if(_0x631642[_0x9c49('0xf9')]){_0x58eda2[_0x9c49('0x179')]=_0x631642[_0x9c49('0x17a')]||0x9c4;_0x58eda2['XMD-AMDGREETING']=_0x631642[_0x9c49('0x17b')]||0x5dc;_0x58eda2['XMD-AMDAFTERGREETINGSILENCE']=_0x631642[_0x9c49('0x17c')]||0x320;_0x58eda2[_0x9c49('0x17d')]=_0x631642[_0x9c49('0x17e')]||0x1388;_0x58eda2[_0x9c49('0x17f')]=_0x631642[_0x9c49('0x180')]||0x64;_0x58eda2[_0x9c49('0x181')]=_0x631642['dialAMDBetweenWordsSilence']||0x32;_0x58eda2[_0x9c49('0x182')]=_0x631642[_0x9c49('0x183')]||0x3;_0x58eda2['XMD-AMDSILENCETHRESHOLD']=_0x631642[_0x9c49('0x184')]||0x100;_0x58eda2[_0x9c49('0x185')]=_0x631642['dialAMDMaximumWordLength']||0x1388;}if(_0x631642['type']===_0x9c49('0x4e')){_0x58eda2[_0x9c49('0x186')]=_0x5a0d8d['VoiceQueueId'];}else{_0x58eda2['XMD-CAMPAIGNID']=_0x5a0d8d[_0x9c49('0xd0')];}for(var _0x1ba492 in _0x5a0d8d['Contact']){if(typeof _0x5a0d8d[_0x9c49('0x187')][_0x1ba492]!==_0x9c49('0x98')){if(isNotNull(_0x5a0d8d['Contact'][_0x1ba492])&&_0x1ba492!=='id'&&_0x1ba492!==_0x9c49('0x188')&&_0x1ba492!==_0x9c49('0x189')&&_0x1ba492!==_0x9c49('0x18a')){_0x58eda2[util['format']('%s%s','XMD-',_['toUpper'](_0x1ba492))]=_0x5a0d8d['Contact'][_0x1ba492];}}}var _0x5043aa=_0x8fdf6b[_0x9c49('0xd4')](_0x631642[_0x9c49('0x75')])?getCallerId(_0x631642['Trunk']['callerid'],_0x631642[_0x9c49('0x5d')],_0x631642[_0x9c49('0x18b')]>0x0?getCallerIdRandom(_0x631642[_0x9c49('0x5e')],_0x631642['dialRandomLastDigitCallerIdNumber']):_0x631642[_0x9c49('0x5e')]):getCallerId(_[_0x9c49('0xa9')](_0x631642['TrunkBackup'])?_0x631642[_0x9c49('0x75')][_0x9c49('0x77')]:_0x631642[_0x9c49('0x13d')][_0x9c49('0x77')],_0x631642['dialOriginateCallerIdName'],_0x631642[_0x9c49('0x18b')]>0x0?getCallerIdRandom(_0x631642[_0x9c49('0x5e')],_0x631642[_0x9c49('0x18b')]):_0x631642[_0x9c49('0x5e')]);if(_0x5043aa){_0x58eda2[_0x9c49('0x18c')]=_0x8fdf6b[_0x9c49('0x22')][_0x391ea5]['originatecalleridname']=extractCalleridName(_0x5043aa);_0x58eda2[_0x9c49('0x18d')]=_0x5a0d8d[_0x9c49('0x171')];}_0x631642[_0x9c49('0x18e')]=_0x58eda2;return ami['Action']({'actionid':_0x391ea5,'action':_0x9c49('0x18f'),'channel':_0x8fdf6b[_0x9c49('0xd4')](_0x631642[_0x9c49('0x75')])?util['format'](_0x9c49('0x190'),_0x631642[_0x9c49('0x75')]['name'],isNotNull(_0x631642[_0x9c49('0x191')])?_0x631642[_0x9c49('0x191')][_0x9c49('0x192')]()||'':'',_0x631642[_0x9c49('0x193')]>0x0?_0x5a0d8d[_0x9c49('0x171')]['substring'](_0x631642[_0x9c49('0x193')]):_0x5a0d8d['phone']):util[_0x9c49('0x79')]('SIP/%s/%s%s',_['isNil'](_0x631642[_0x9c49('0x13d')])?_0x631642[_0x9c49('0x75')][_0x9c49('0x43')]:_0x631642['TrunkBackup'][_0x9c49('0x43')],isNotNull(_0x631642[_0x9c49('0x191')])?_0x631642[_0x9c49('0x191')][_0x9c49('0x192')]()||'':'',_0x631642[_0x9c49('0x193')]>0x0?_0x5a0d8d[_0x9c49('0x171')][_0x9c49('0x194')](_0x631642[_0x9c49('0x193')]):_0x5a0d8d['phone']),'callerid':_0x5043aa,'Exten':_0x9c49('0xdb'),'Context':_0x9c49('0x195'),'Priority':'1','variable':_0x58eda2,'timeout':(_0x631642[_0x9c49('0x196')]||0x1e)*0x3e8,'async':!![],'channelid':_0x391ea5})[_0x9c49('0x3d')](function(_0xba0fb6){return _0x263c63(_0xba0fb6);})['catch'](function(_0x45fd83){_0x631642['outboundOriginateFailureCallsDay']+=0x1;var _0x17fd8e=new History(_0x8fdf6b[_0x9c49('0x22')][_0x391ea5]);logger[_0x9c49('0x96')](util[_0x9c49('0x79')](_0x9c49('0x197'),JSON[_0x9c49('0x78')](_0x45fd83)));_0x17fd8e[_0x9c49('0xdf')]=0xe;_0x17fd8e[_0x9c49('0xa6')]='OriginateError';_0x17fd8e[_0x9c49('0x11b')]=moment()[_0x9c49('0x79')](_0x9c49('0xf3'));_0x17fd8e[_0x9c49('0xa7')]=_0x17fd8e[_0x9c49('0x11b')];_0x8fdf6b[_0x9c49('0xc4')](_0x17fd8e)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x198')));_0x8fdf6b[_0x9c49('0xc3')](_0x17fd8e)[_0x9c49('0xab')](loggerCatch('[originate][error]'))[_0x9c49('0x1c')](function(){delete _0x8fdf6b[_0x9c49('0x22')][_0x391ea5];return _0x94d3d9(msgResponse(_0x9c49('0x18f'),_0x9c49('0x4a'),_0x9c49('0x199')));});});});};Dialer[_0x9c49('0x19')][_0x9c49('0x2f')]=function(_0x4aaa72){var _0x4399d8=this[_0x9c49('0x22')][_0x4aaa72[_0x9c49('0x126')]];if(_0x4399d8){delete this[_0x9c49('0x22')][_0x4aaa72[_0x9c49('0x126')]];_0x4399d8['responsetime']=moment()[_0x9c49('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x6e1b75=_0x4399d8[_0x9c49('0x56')]==='ivr'?this[_0x9c49('0xb0')][_0x4399d8['queue']]:this[_0x9c49('0x1d')][_0x4399d8[_0x9c49('0x19a')]()];if(!this[_0x9c49('0xd3')](_0x4aaa72[_0x9c49('0x19b')])){this[_0x9c49('0xae')](_0x6e1b75);return this[_0x9c49('0x19c')](_0x4399d8,_0x6e1b75,_0x4aaa72)['catch'](loggerCatch(_0x9c49('0x19d')));}this[_0x9c49('0x24')][_0x4aaa72['uniqueid']]=_0x4399d8;}};Dialer[_0x9c49('0x19')]['checkRetriveMax']=function(_0xaee7d0,_0x2fc3bc,_0x1f5d7a){var _0x521429=new History(_0x2fc3bc);if(_0x521429['countbusyretry']+_0x521429[_0x9c49('0xeb')]+_0x521429[_0x9c49('0xfb')]+_0x521429['countnosuchnumberretry']+_0x521429[_0x9c49('0xed')]+_0x521429[_0x9c49('0xfc')]+_0x521429[_0x9c49('0xee')]+_0x521429[_0x9c49('0xfd')]>=_0x1f5d7a[_0x9c49('0xfe')]-0x1){return!![];}switch(_0xaee7d0){case 0x3:if(_0x521429[_0x9c49('0xfb')]>=_0x1f5d7a[_0x9c49('0x19e')]-0x1){return!![];}this[_0x9c49('0xb9')]({'active':![],'countnoanswerretry':_0x521429[_0x9c49('0xfb')]+=0x1,'scheduledat':moment()[_0x9c49('0xf0')](_0x1f5d7a['dialNoAnswerRetryFrequency'],_0x9c49('0xf2'))[_0x9c49('0x79')](_0x9c49('0xf3')),'ContactId':_0x521429[_0x9c49('0xf4')],'ListId':_0x521429[_0x9c49('0xcd')],'VoiceQueueId':_0x521429[_0x9c49('0xcf')]||undefined,'CampaignId':_0x521429[_0x9c49('0xd0')]||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0x19f')));break;case 0x5:if(_0x521429[_0x9c49('0xfa')]>=_0x1f5d7a[_0x9c49('0x1a0')]-0x1){return!![];}this[_0x9c49('0xb9')]({'active':![],'countbusyretry':_0x521429[_0x9c49('0xfa')]+=0x1,'scheduledat':moment()['add'](_0x1f5d7a[_0x9c49('0x1a1')],_0x9c49('0xf2'))['format'](_0x9c49('0xf3')),'ContactId':_0x521429[_0x9c49('0xf4')],'ListId':_0x521429[_0x9c49('0xcd')],'VoiceQueueId':_0x521429[_0x9c49('0xcf')]||undefined,'CampaignId':_0x521429[_0x9c49('0xd0')]||undefined})[_0x9c49('0xab')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x521429['countcongestionretry']>=_0x1f5d7a[_0x9c49('0x1a2')]-0x1){return!![];}this[_0x9c49('0xb9')]({'active':![],'countcongestionretry':_0x521429[_0x9c49('0xeb')]+=0x1,'scheduledat':moment()[_0x9c49('0xf0')](_0x1f5d7a[_0x9c49('0x1a3')],_0x9c49('0xf2'))[_0x9c49('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x521429[_0x9c49('0xf4')],'ListId':_0x521429[_0x9c49('0xcd')],'VoiceQueueId':_0x521429[_0x9c49('0xcf')]||undefined,'CampaignId':_0x521429[_0x9c49('0xd0')]||undefined})['catch'](loggerCatch(_0x9c49('0x1a4')));break;case 0x0:if(_0x521429[_0x9c49('0xec')]>=_0x1f5d7a['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x9c49('0xb9')]({'active':![],'countnosuchnumberretry':_0x521429[_0x9c49('0xec')]+=0x1,'scheduledat':moment()[_0x9c49('0xf0')](_0x1f5d7a[_0x9c49('0x1a5')],_0x9c49('0xf2'))['format'](_0x9c49('0xf3')),'ContactId':_0x521429[_0x9c49('0xf4')],'ListId':_0x521429[_0x9c49('0xcd')],'VoiceQueueId':_0x521429[_0x9c49('0xcf')]||undefined,'CampaignId':_0x521429['CampaignId']||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0x1a6')));}break;case 0xa:if(_0x521429[_0x9c49('0xed')]>=_0x1f5d7a['dialDropMaxRetry']-0x1){return!![];}this[_0x9c49('0xb9')]({'active':![],'countdropretry':_0x521429[_0x9c49('0xed')]+=0x1,'scheduledat':moment()[_0x9c49('0xf0')](_0x1f5d7a[_0x9c49('0x114')],_0x9c49('0xf2'))[_0x9c49('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x521429[_0x9c49('0xf4')],'ListId':_0x521429['ListId'],'VoiceQueueId':_0x521429['VoiceQueueId']||undefined,'CampaignId':_0x521429[_0x9c49('0xd0')]||undefined})['catch'](loggerCatch(_0x9c49('0x119')));break;case 0xb:if(_0x521429[_0x9c49('0xfc')]>=_0x1f5d7a[_0x9c49('0x1a7')]-0x1){return!![];}this[_0x9c49('0xb9')]({'active':![],'countabandonedretry':_0x521429[_0x9c49('0xfc')]+=0x1,'scheduledat':moment()[_0x9c49('0xf0')](_0x1f5d7a['dialAbandonedRetryFrequency'],'minutes')[_0x9c49('0x79')](_0x9c49('0xf3')),'ContactId':_0x521429[_0x9c49('0xf4')],'ListId':_0x521429['ListId'],'VoiceQueueId':_0x521429[_0x9c49('0xcf')]||undefined,'CampaignId':_0x521429[_0x9c49('0xd0')]||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0x122')));break;case 0x13:if(_0x521429['countmachineretry']>=_0x1f5d7a[_0x9c49('0xff')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x521429[_0x9c49('0xee')]+=0x1,'scheduledat':moment()[_0x9c49('0xf0')](_0x1f5d7a[_0x9c49('0xf1')],_0x9c49('0xf2'))[_0x9c49('0x79')](_0x9c49('0xf3')),'ContactId':_0x521429['ContactId'],'ListId':_0x521429['ListId'],'VoiceQueueId':_0x521429[_0x9c49('0xcf')]||undefined,'CampaignId':_0x521429['CampaignId']||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0xf5')));break;case 0x14:if(_0x521429[_0x9c49('0xfd')]>=_0x1f5d7a[_0x9c49('0x1a8')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x521429['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x9c49('0xf0')](_0x1f5d7a[_0x9c49('0x1a9')],_0x9c49('0xf2'))[_0x9c49('0x79')](_0x9c49('0xf3')),'ContactId':_0x521429[_0x9c49('0xf4')],'ListId':_0x521429[_0x9c49('0xcd')],'VoiceQueueId':_0x521429[_0x9c49('0xcf')]||undefined,'CampaignId':_0x521429[_0x9c49('0xd0')]||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0x1aa')));break;default:return!![];}};Dialer[_0x9c49('0x19')][_0x9c49('0x19c')]=function(_0x59efa4,_0xd67117,_0x406a17){var _0x11141b=this;var _0x286df8=new History(_0x59efa4);var _0x11c842=![];var _0x59990a;var _0x468377;return new Promise(function(_0x5365a5,_0x811d41){if(_[_0x9c49('0x3f')](_0xd67117)&&typeof _0xd67117!=='object'){return _0x811d41(msgResponse('[callProgressDetecting]','Failure',_0x9c49('0x1ab')));}if(_[_0x9c49('0x3f')](_0x406a17)&&typeof _0x406a17!==_0x9c49('0x16f')){return _0x811d41(msgResponse('[callProgressDetecting]',_0x9c49('0x144'),_0x9c49('0x1ac')));}_0x11141b[_0x9c49('0xb4')](_0x286df8,_0x406a17[_0x9c49('0x106')],_0xd67117)['then'](function(_0xbba860){if(_0xbba860['additional']==0x1)_0x11c842=!![];switch(_0x406a17[_0x9c49('0x106')]){case'0':_0xd67117[_0x9c49('0x65')]+=0x1;_0x286df8[_0x9c49('0xdf')]=0x0;_0x286df8[_0x9c49('0xa6')]=_0x9c49('0x1ad');_0x286df8[_0x9c49('0xec')]+=0x1;_0x286df8[_0x9c49('0xe8')]+=0x1;ami[_0x9c49('0x4d')](_0x9c49('0x1ae'),ut[_0x9c49('0xf6')](_0x59efa4,_0x9c49('0x1af')));_0x59990a=_0xd67117['dialNoSuchNumberRetryFrequency'];_0x468377=_0xd67117[_0x9c49('0x115')];_0x11141b['createHistory'](_0x286df8)['catch'](loggerCatch(_0x9c49('0xea')));if(_0x11141b[_0x9c49('0x1b0')](0x0,_0x59efa4,_0xd67117)&&!_0x11c842){if(_0x286df8[_0x9c49('0xec')]>=_0xd67117[_0x9c49('0x1b1')]){_0x11141b[_0x9c49('0x100')](_0x286df8,_0x5365a5,_0x811d41,'reason\x200\x20no\x20such\x20number....');}else{_0x11141b[_0x9c49('0x1b2')](_0x286df8,_0x5365a5,_0x811d41,_0x9c49('0x1b3'));}}break;case'3':_0xd67117['outboundNoAnswerCallsDay']+=0x1;_0x286df8[_0x9c49('0xdf')]=0x3;_0x286df8['statedesc']=_0x9c49('0x1b4');_0x286df8[_0x9c49('0xfb')]+=0x1;_0x286df8['countglobal']+=0x1;var _0x25b679=ut[_0x9c49('0x1b5')](_0x59efa4,_0xd67117);ami[_0x9c49('0x4d')]('custom:agentnoanswer',_0x25b679);_0x59990a=_0xd67117[_0x9c49('0x1b6')];_0x468377=_0xd67117[_0x9c49('0x115')];_0x11141b[_0x9c49('0xc4')](_0x286df8)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x11141b[_0x9c49('0x1b0')](0x3,_0x59efa4,_0xd67117)&&!_0x11c842){if(_0x286df8[_0x9c49('0xfb')]>=_0xd67117[_0x9c49('0x19e')]){_0x11141b[_0x9c49('0x100')](_0x286df8,_0x5365a5,_0x811d41,_0x9c49('0x1b7'));}else{_0x11141b[_0x9c49('0x1b2')](_0x286df8,_0x5365a5,_0x811d41,_0x9c49('0x1b7'));}}break;case'5':_0xd67117[_0x9c49('0x61')]+=0x1;_0x286df8[_0x9c49('0xdf')]=0x5;_0x286df8[_0x9c49('0xa6')]=_0x9c49('0x1b8');_0x286df8[_0x9c49('0xfa')]+=0x1;_0x286df8[_0x9c49('0xe8')]+=0x1;ami[_0x9c49('0x4d')](_0x9c49('0x1b9'),ut[_0x9c49('0xf6')](_0x59efa4,_0x9c49('0x1ba')));_0x59990a=_0xd67117[_0x9c49('0x1a1')];_0x468377=_0xd67117[_0x9c49('0x115')];_0x11141b[_0x9c49('0xc4')](_0x286df8)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x1bb')));if(_0x11141b[_0x9c49('0x1b0')](0x5,_0x59efa4,_0xd67117)&&!_0x11c842){if(_0x286df8[_0x9c49('0xfa')]>=_0xd67117['dialBusyMaxRetry']){_0x11141b['createStateFinal'](_0x286df8,_0x5365a5,_0x811d41,_0x9c49('0x1bc'));}else{_0x11141b['stateGlobal'](_0x286df8,_0x5365a5,_0x811d41,'reason\x205\x20busy');}}break;case'8':_0xd67117[_0x9c49('0x62')]+=0x1;_0x286df8['state']=0x8;_0x286df8[_0x9c49('0xa6')]=_0x9c49('0x1bd');_0x286df8[_0x9c49('0xeb')]+=0x1;_0x286df8[_0x9c49('0xe8')]+=0x1;_0x59990a=_0xd67117[_0x9c49('0x1a3')];_0x468377=_0xd67117[_0x9c49('0x115')];ami['emit']('custom:agentcongestion',ut[_0x9c49('0xf6')](_0x59efa4,_0x9c49('0x1be')));_0x11141b[_0x9c49('0xc4')](_0x286df8)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x1bf')));if(_0x11141b[_0x9c49('0x1b0')](0x8,_0x59efa4,_0xd67117)&&!_0x11c842){if(_0x286df8[_0x9c49('0xeb')]>=_0xd67117[_0x9c49('0x1a2')]){_0x11141b[_0x9c49('0x100')](_0x286df8,_0x5365a5,_0x811d41,'reason\x208\x20congestion');}else{_0x11141b[_0x9c49('0x1b2')](_0x286df8,_0x5365a5,_0x811d41,_0x9c49('0x1c0'));}}break;case'11':_0xd67117[_0x9c49('0x1c1')]+=0x1;_0x286df8[_0x9c49('0xdf')]=0xb;_0x286df8['statedesc']=_0x9c49('0x123');_0x286df8[_0x9c49('0xfc')]+=0x1;_0x286df8[_0x9c49('0xe8')]+=0x1;_0x59990a=_0xd67117[_0x9c49('0x120')];_0x468377=_0xd67117[_0x9c49('0x115')];_0x11141b[_0x9c49('0xc4')](_0x286df8)[_0x9c49('0xab')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x11141b['checkRetriveMax'](0xb,_0x59efa4,_0xd67117)&&!_0x11c842){if(_0x286df8[_0x9c49('0xfc')]>=_0xd67117[_0x9c49('0x1a7')]){_0x11141b[_0x9c49('0x100')](_0x286df8,_0x5365a5,_0x811d41,'reason\x2011\x20abandoned');}else{_0x11141b['stateGlobal'](_0x286df8,_0x5365a5,_0x811d41,'reason\x2011\x20abandoned');}}break;case'20':_0xd67117[_0x9c49('0x1c2')]+=0x1;_0x286df8[_0x9c49('0xdf')]=0x14;_0x286df8['statedesc']=_0x9c49('0x1c3');_0x286df8['countagentrejectretry']+=0x1;_0x286df8[_0x9c49('0xe8')]+=0x1;_0x59990a=_0xd67117['dialAgentRejectRetryFrequency'];_0x468377=_0xd67117[_0x9c49('0x115')];ami[_0x9c49('0x4d')](_0x9c49('0x1c4'),ut[_0x9c49('0xf6')](_0x59efa4,_0x9c49('0x1c5')));_0x11141b['createHistory'](_0x286df8)['catch'](loggerCatch(_0x9c49('0x1c6')));if(_0x11141b['checkRetriveMax'](0x14,_0x59efa4,_0xd67117)&&!_0x11c842){if(_0x286df8[_0x9c49('0xfd')]>=_0xd67117[_0x9c49('0x1a8')]){_0x11141b[_0x9c49('0x100')](_0x286df8,_0x5365a5,_0x811d41,_0x9c49('0x1c7'));}else{_0x11141b['stateGlobal'](_0x286df8,_0x5365a5,_0x811d41,'reason\x2020\x20agentreject');}}break;default:_0xd67117[_0x9c49('0x67')]+=0x1;_0x286df8[_0x9c49('0xdf')]=0xc;_0x286df8[_0x9c49('0xa6')]=_0x406a17[_0x9c49('0x106')];_0x59990a=_0xd67117[_0x9c49('0x1a9')];_0x468377=_0xd67117['callAdditionalPhoneAfterMin'];_0x11141b['createHistory'](_0x286df8)[_0x9c49('0xab')](loggerCatch(_0x9c49('0x1c8')));if(_0x11141b[_0x9c49('0x1b0')](_0x406a17['reason'],_0x59efa4,_0xd67117)&&!_0x11c842){if(_0x286df8['countbusyretry']+_0x286df8[_0x9c49('0xeb')]+_0x286df8['countnoanswerretry']+_0x286df8[_0x9c49('0xec')]+_0x286df8[_0x9c49('0xed')]+_0x286df8[_0x9c49('0xfc')]+_0x286df8[_0x9c49('0xee')]+_0x286df8[_0x9c49('0xfd')]>=_0xd67117[_0x9c49('0xfe')]){_0x11141b['stateGlobal'](_0x286df8,_0x5365a5,_0x811d41,_0x406a17[_0x9c49('0x106')]);}else{_0x11141b['createStateFinal'](_0x286df8,_0x5365a5,_0x811d41,_0x406a17['reason']);}}}})[_0x9c49('0x3d')](function(){if(_0x11c842){_0x11141b[_0x9c49('0xb6')](_0x286df8,_0x59990a,_0x468377)[_0x9c49('0x3d')](function(){return _0x5365a5(0x1);});}});});};Dialer[_0x9c49('0x19')][_0x9c49('0x1b2')]=function(_0x5552fe,_0x16aeec,_0x1891ac,_0xa487e0){var _0x405823=new Final(_0x5552fe);_0x405823[_0x9c49('0xdf')]=0xf;_0x405823[_0x9c49('0xa6')]=_0x9c49('0x1c9');this[_0x9c49('0x100')](_0x405823,_0x16aeec,_0x1891ac,_0xa487e0);};Dialer[_0x9c49('0x19')][_0x9c49('0x100')]=function(_0x4159c6,_0x5dc1aa,_0x950b4e,_0x2693c0){this[_0x9c49('0xc3')](_0x4159c6)[_0x9c49('0x3d')](function(){return _0x5dc1aa(msgResponse(_0x9c49('0x1ca'),'Success',_0x2693c0));})[_0x9c49('0xab')](function(){return _0x950b4e(msgResponse(_0x9c49('0x1cb'),'Failure',_0x9c49('0x1cc')));});};Dialer[_0x9c49('0x19')][_0x9c49('0x7')]=function(_0x26dba7){var _0x4ffe27=_0x26dba7[_0x9c49('0x1cd')]/0x64;var _0x32513c=_0x26dba7[_0x9c49('0x63')]/(_0x26dba7['outboundDropCallsDayTimeout']+_0x26dba7['outboundAnswerCallsDay']);var _0x44ca8f=Math[_0x9c49('0x1ce')](_0x26dba7[_0x9c49('0x70')]*(_0x26dba7[_0x9c49('0x1cf')]/0x64));var _0xa46809=Math[_0x9c49('0x1ce')](_0x26dba7[_0x9c49('0x70')]*(_0x26dba7[_0x9c49('0x1d0')]/0x64));var _0x166029=_0x26dba7[_0x9c49('0x50')]+_0x26dba7[_0x9c49('0xa0')];var _0x46a387=Math[_0x9c49('0x1d1')](_0x26dba7[_0x9c49('0x72')]*_0x26dba7[_0x9c49('0x73')]*_0x26dba7[_0x9c49('0x6e')]*_0x26dba7[_0x9c49('0x6f')]);if(_[_0x9c49('0x3f')](_0x26dba7['startProgressive'])){if(!_[_0x9c49('0x3f')](_0x26dba7['startPredictive'])){_0x26dba7[_0x9c49('0x26')]=undefined;loggerPredictive[_0x9c49('0x96')]('[startMethodPredictive][StartProgressive]',_0x9c49('0x1d2'));}if(!_[_0x9c49('0x3f')](_0x26dba7[_0x9c49('0x8f')])){loggerPredictive['error'](_0x9c49('0x1d3'),_0x9c49('0x1d4'));clearInterval(_0x26dba7[_0x9c49('0x8f')]);_0x26dba7[_0x9c49('0x8f')]=undefined;}_0x26dba7[_0x9c49('0x27')]=moment()[_0x9c49('0x79')](_0x9c49('0xf3'));loggerPredictive[_0x9c49('0x7e')](_0x26dba7[_0x9c49('0x43')],_0x9c49('0x1d5'),_0x26dba7[_0x9c49('0x27')]);this['handlePower'](_0x26dba7,0x1);}else if(ifInterval(_0x26dba7[_0x9c49('0x1d6')],_0x26dba7[_0x9c49('0x27')])){this[_0x9c49('0x158')](_0x26dba7,0x1);loggerPredictiveCalls[_0x9c49('0x7e')](_0x9c49('0x1d7'),_0x26dba7[_0x9c49('0x27')],_0x26dba7['name']);_0x26dba7[_0x9c49('0x72')]=0x0;_0x26dba7[_0x9c49('0x6d')]=0x0;}else if(_0x4ffe27<_0x32513c&&_0x26dba7['dialPredictiveOptimization']===_0x9c49('0x1d8')){freeVariablesPredictive(_0x26dba7);loggerPredictive['info'](_0x9c49('0x1d9'),_0x9c49('0x1da'),_0x32513c,_0x9c49('0x27'),_0x26dba7['name']);}else if(_0x46a387<_0x26dba7[_0x9c49('0x6d')]&&_0x26dba7[_0x9c49('0x1db')]===_0x9c49('0x1d8')){freeVariablesPredictive(_0x26dba7);loggerPredictive['info'](_0x9c49('0x1dc'),_0x9c49('0x1dd'),_0x46a387,_0x9c49('0x1de'),_0x26dba7['predictiveIntervalErlangCallsDroppedCalls'],_0x9c49('0x27'),_0x26dba7[_0x9c49('0x43')]);}else if(!ifInterval(_0x26dba7['dialPredictiveInterval'],_0x26dba7[_0x9c49('0x27')])&&_['isUndefined'](_0x26dba7['startPredictive'])&&!_[_0x9c49('0x3f')](_0x26dba7[_0x9c49('0x27')])){_0x26dba7['startPredictive']=moment()['format'](_0x9c49('0xf3'));loggerPredictive[_0x9c49('0x7e')](_0x26dba7['name'],_0x9c49('0x1df'),_0x26dba7[_0x9c49('0x26')]);this[_0x9c49('0x1e0')](_0x26dba7[_0x9c49('0x1d6')])['then'](this[_0x9c49('0x1e1')](_0x26dba7))['then'](mergeDataErlangB(_0x26dba7))[_0x9c49('0x3d')](this['startMethodPredictive'](_0x26dba7))['catch'](loggerCatchPredictive(_0x9c49('0x1e2'),_0x26dba7));}else if(!ifInterval(_0x26dba7[_0x9c49('0x1d6')],_0x26dba7[_0x9c49('0x26')])){_0x26dba7['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x26dba7['startPredictive']=moment()[_0x9c49('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x9c49('0x7e')](_0x26dba7[_0x9c49('0x43')],'recalculate\x20predictive\x20at',_0x26dba7[_0x9c49('0x26')]);clearInterval(_0x26dba7[_0x9c49('0x8f')]);_0x26dba7[_0x9c49('0x8f')]=undefined;this[_0x9c49('0x1e0')](_0x26dba7['dialPredictiveInterval'])[_0x9c49('0x3d')](this['getDataPredictive'](_0x26dba7))['then'](mergeDataErlangB(_0x26dba7))[_0x9c49('0x3d')](this[_0x9c49('0x1e3')](_0x26dba7))[_0x9c49('0xab')](loggerCatchPredictive(_0x9c49('0x1e4'),_0x26dba7));}else if(_0x26dba7[_0x9c49('0x70')]&&_0x166029<_0x26dba7['predictiveIntervalAvailable']-_0xa46809){freeVariablesPredictive(_0x26dba7);loggerPredictive[_0x9c49('0x7e')](_0x26dba7[_0x9c49('0x43')],_0x9c49('0x1e5'),_0x166029,_0x9c49('0x1e6'),_0x26dba7[_0x9c49('0x70')],'-',_0xa46809,'=',_0x26dba7[_0x9c49('0x70')]-_0xa46809,')');}else if(_0x26dba7[_0x9c49('0x70')]&&_0x166029>_0x26dba7[_0x9c49('0x70')]+_0x44ca8f){freeVariablesPredictive(_0x26dba7);loggerPredictive[_0x9c49('0x7e')](_0x26dba7[_0x9c49('0x43')],_0x9c49('0x1e5'),_0x166029,_0x9c49('0x1e7'),_0x26dba7[_0x9c49('0x70')],'+',_0x44ca8f,'=',_0x26dba7[_0x9c49('0x70')]+_0x44ca8f,')');}};Dialer[_0x9c49('0x19')][_0x9c49('0x1e1')]=function(_0x3039f5){var _0x4ebc37=this;return function(_0x16412f){return new Promise(function(_0x13d617,_0x3e35fe){_[_0x9c49('0x8b')](_0x3039f5,_0x16412f[0x0]);if(checkGetDataPredictive(_0x16412f[0x0])){var _0x56724e=_0x3039f5['predictiveIntervalAvailable']=_0x3039f5[_0x9c49('0xa0')]+_0x3039f5[_0x9c49('0x50')];var _0x460141=_0x3039f5[_0x9c49('0x1d6')]*0x3c;var _0x3fc0bf=_0x16412f[0x0][_0x9c49('0x69')]+_0x16412f[0x0]['predictiveIntervalAvgHoldtime'];var _0x45b5cb=(_0x16412f[0x0][_0x9c49('0x7f')]+_0x16412f[0x0][_0x9c49('0x6b')]+_0x16412f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x16412f[0x0][_0x9c49('0x84')];_0x3039f5[_0x9c49('0x6e')]=_0x45b5cb>0x0?_0x45b5cb:0x1;switch(_0x3039f5[_0x9c49('0x1db')]){case _0x9c49('0x1d8'):var _0x21d23d=_0x3039f5[_0x9c49('0x1cd')]/0x64;return _0x4ebc37['abandonmentRate'](_0x56724e,_0x460141,_0x3fc0bf,_0x45b5cb,_0x21d23d)[_0x9c49('0x3d')](function(_0x5c606c){return _0x13d617(_0x5c606c);});case'agentBusyFactor':var _0x35d082=_0x3039f5[_0x9c49('0x1cd')]/0x64;return _0x4ebc37[_0x9c49('0x1e8')](_0x56724e,_0x460141,_0x3fc0bf,_0x45b5cb,_0x35d082)[_0x9c49('0x3d')](function(_0x463e5a){return _0x13d617(_0x463e5a);});default:return _0x3e35fe(msgResponse(_0x9c49('0x1e9'),_0x9c49('0x144'),_0x9c49('0x1ea')));}}else{return _0x3e35fe(msgResponse(_0x9c49('0x1e9'),_0x9c49('0x144'),_0x9c49('0x1eb')));}});};};Dialer[_0x9c49('0x19')][_0x9c49('0x1ec')]=function(_0x2b6732){var _0x399b5b=this;return function(_0x189594){return new Promise(function(_0x565cf2,_0x492612){_[_0x9c49('0x8b')](_0x2b6732,_0x189594[0x0]);if(checkGetDataPredictive(_0x189594[0x0])){loggerPredictive[_0x9c49('0x7e')](JSON[_0x9c49('0x78')](_0x189594[0x0]));if(_0x2b6732[_0x9c49('0x1db')]==='dropRate'){return _0x399b5b[_0x9c49('0xc1')](_0x2b6732['id'])[_0x9c49('0x3d')](function(_0x51d307){var _0x395bcb=_0x2b6732['loggedIn']-_0x51d307[0x0][_0x9c49('0x1ed')];var _0x2631a7=_0x2b6732[_0x9c49('0x1d6')]*0x3c;var _0x17f66a=_0x189594[0x0][_0x9c49('0x69')]+_0x189594[0x0]['predictiveIntervalAvgHoldtime'];var _0x27ebf3=(_0x189594[0x0][_0x9c49('0x7f')]+_0x189594[0x0][_0x9c49('0x6b')]+_0x189594[0x0][_0x9c49('0x6a')])/_0x189594[0x0]['predictiveIntervalTotalCalls'];var _0x14e8fd=_0x2b6732[_0x9c49('0x1cd')]/0x64;_0x2b6732[_0x9c49('0x1ee')]=_0x51d307[0x0][_0x9c49('0x1ed')]||0x0;_0x2b6732[_0x9c49('0x6e')]=_0x27ebf3>0x0?_0x27ebf3:0x1;return _0x399b5b['abandonmentRate'](_0x395bcb,_0x2631a7,_0x17f66a,_0x27ebf3,_0x14e8fd);})[_0x9c49('0x3d')](function(_0x12c9e1){return _0x565cf2(_0x12c9e1);})[_0x9c49('0xab')](function(_0x39380b){return _0x492612(msgResponse(_0x9c49('0x1ef'),'Failure',JSON[_0x9c49('0x78')](_0x39380b)));});}if(_0x2b6732[_0x9c49('0x1db')]===_0x9c49('0x1f0')){return _0x399b5b[_0x9c49('0xc1')](_0x2b6732['id'])[_0x9c49('0x3d')](function(_0x4ff430){var _0x4aa8e1=_0x2b6732[_0x9c49('0x51')]-_0x4ff430[0x0]['outboundQueuePauses'];var _0xe86109=_0x2b6732[_0x9c49('0x1d6')]*0x3c;var _0x287cb8=_0x189594[0x0][_0x9c49('0x69')]+_0x189594[0x0]['predictiveIntervalAvgHoldtime'];var _0x5d9e61=(_0x189594[0x0][_0x9c49('0x7f')]+_0x189594[0x0][_0x9c49('0x6b')]+_0x189594[0x0][_0x9c49('0x6a')])/_0x189594[0x0][_0x9c49('0x84')];var _0x4d62ac=_0x2b6732[_0x9c49('0x1cd')]/0x64;_0x2b6732[_0x9c49('0x1ee')]=_0x4ff430[0x0][_0x9c49('0x1ed')]||0x0;_0x2b6732[_0x9c49('0x6e')]=_0x5d9e61>0x0?_0x5d9e61:0x1;return _0x399b5b[_0x9c49('0x1e8')](_0x4aa8e1,_0xe86109,_0x287cb8,_0x5d9e61,_0x4d62ac);})[_0x9c49('0x3d')](function(_0x53a2b9){return _0x565cf2(_0x53a2b9);})[_0x9c49('0xab')](function(_0x4ebb8d){return _0x492612(msgResponse('[CatchErlangB]',_0x9c49('0x144'),JSON[_0x9c49('0x78')](_0x4ebb8d)));});}}else{return _0x492612(msgResponse('[getDataPredictive]',_0x9c49('0x144'),_0x9c49('0x1eb')));}});};};Dialer[_0x9c49('0x19')][_0x9c49('0x1e3')]=function(_0x210de5){var _0x4a16fe=this;return function(){var _0x14e8f2=0x0;var _0x122fab=Math[_0x9c49('0x1d1')](_0x210de5['erlangCallToSecond']*0x3e8);if(_0x122fab>0x0){_0x122fab=_0x122fab<0x64?0x64:_0x122fab;loggerPredictive['info'](_0x210de5[_0x9c49('0x43')],'one\x20call\x20every:',_0x122fab,_0x9c49('0x4b'));_0x210de5[_0x9c49('0x8f')]=setInterval(function(){_0x4a16fe[_0x9c49('0x8f')](_0x210de5);loggerPredictiveCalls[_0x9c49('0x7e')](_0x9c49('0x1f1'),_0x14e8f2+=0x1);},_0x122fab);}else{loggerPredictive[_0x9c49('0x7e')](_0x210de5[_0x9c49('0x43')],_0x9c49('0x1f2'));}};};Dialer[_0x9c49('0x19')][_0x9c49('0x1f3')]=function(_0x5b42e,_0x2c2cdb){var _0x27da8f=this;return function(_0x52ba24){if(_[_0x9c49('0x7d')](_0x52ba24)){if(_['isNil'](_0x2c2cdb[_0x9c49('0xce')])||!_0x2c2cdb[_0x9c49('0x1f4')]){if(_0x5b42e[_0x9c49('0x5c')]===_0x9c49('0x6')){_0x5b42e[_0x9c49('0x12e')]=_['isUndefined'](_0x5b42e['queueStatusComplete'])?!![]:_0x5b42e[_0x9c49('0x12e')];var _0x3761f6=uuid['v4']();_0x27da8f[_0x9c49('0x22')][_0x3761f6]=new Action(_0x5b42e,_0x2c2cdb,_0x3761f6);loggerBooked['info'](_0x9c49('0x1f5'),_0x3761f6,_0x9c49('0x1f6'),JSON['stringify'](_0x5b42e['queueStatusComplete']),_0x9c49('0x1f7'),_0x5b42e[_0x9c49('0x43')]);if(_0x5b42e[_0x9c49('0x12e')]){_0x5b42e[_0x9c49('0x12e')]=![];_0x27da8f[_0x9c49('0x29')][_0x27da8f['actions'][_0x3761f6]['queue']]=[];ami['Action']({'actionid':_0x3761f6,'action':_0x9c49('0x1f8'),'queue':_0x5b42e[_0x9c49('0x43')]})[_0x9c49('0xab')](function(){_0x27da8f[_0x9c49('0xae')](_0x5b42e);_0x27da8f[_0x9c49('0xb9')]({'active':![],'ContactId':_0x27da8f['actions'][_0x3761f6][_0x9c49('0xf4')],'ListId':_0x27da8f[_0x9c49('0x22')][_0x3761f6][_0x9c49('0xcd')],'VoiceQueueId':_0x27da8f['actions'][_0x3761f6]['VoiceQueueId']||undefined,'CampaignId':_0x27da8f[_0x9c49('0x22')][_0x3761f6][_0x9c49('0xd0')]||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0x1f9')));delete _0x27da8f['actions'][_0x3761f6];});}else{loggerBooked[_0x9c49('0x7e')](_0x9c49('0x1fa'),JSON[_0x9c49('0x78')](_0x5b42e['queueStatusComplete']),'Queue:\x20',_0x5b42e['name']);_0x27da8f[_0x9c49('0xae')](_0x5b42e);_0x27da8f[_0x9c49('0xb9')]({'active':![],'ContactId':_0x27da8f[_0x9c49('0x22')][_0x3761f6][_0x9c49('0xf4')],'ListId':_0x27da8f[_0x9c49('0x22')][_0x3761f6]['ListId'],'VoiceQueueId':_0x27da8f['actions'][_0x3761f6][_0x9c49('0xcf')]||undefined,'CampaignId':_0x27da8f[_0x9c49('0x22')][_0x3761f6]['CampaignId']||undefined})[_0x9c49('0xab')](loggerCatch(_0x9c49('0x1f9')));delete _0x27da8f[_0x9c49('0x22')][_0x3761f6];}}else{return _0x27da8f[_0x9c49('0x16e')](_0x5b42e,_0x2c2cdb);}}else{if(getDiff(_0x2c2cdb[_0x9c49('0x1fb')])<_0x5b42e[_0x9c49('0x1fc')]*0x3c){if(_0x2c2cdb[_0x9c49('0x15c')]&&!_0x2c2cdb[_0x9c49('0x15c')]['voicePause']){_0x27da8f[_0x9c49('0x91')][_0x9c49('0x130')](_0x2c2cdb['id'])[_0x9c49('0x1c')](function(){_0x27da8f[_0x9c49('0xae')](_0x5b42e);});}else{_0x27da8f[_0x9c49('0xbb')]({'active':![]},_0x2c2cdb['id'],0x1)['finally'](function(){_0x27da8f[_0x9c49('0xae')](_0x5b42e);});}}else{_0x5b42e[_0x9c49('0x66')]+=0x1;_0x27da8f['updateOriginated'](_0x5b42e);if(_0x5b42e[_0x9c49('0x1fd')]){_0x27da8f['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2c2cdb[_0x9c49('0xf4')],'ListId':_0x2c2cdb[_0x9c49('0xcd')],'VoiceQueueId':_0x2c2cdb['VoiceQueueId']||undefined,'CampaignId':_0x2c2cdb[_0x9c49('0xd0')]||undefined})['catch'](loggerCatch(_0x9c49('0x1fe')));_0x27da8f[_0x9c49('0xc4')](createObjHistory(_0x5b42e,_0x2c2cdb,_0x9c49('0x1ff'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x9c49('0x200')));}else{_0x27da8f[_0x9c49('0xcb')](createObjHistory(_0x5b42e,_0x2c2cdb,_0x9c49('0x201'),0x16,'RecallFailedTimeout'),_0x9c49('0x202'),'[Originate][HistoryRecallClose]');}}}}else{_0x5b42e[_0x9c49('0x203')]+=0x1;_0x27da8f['saveInDb'](createObjHistory(_0x5b42e,_0x2c2cdb,_0x9c49('0x204'),0xd,'Blacklist'),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x9c49('0x205');}};};Dialer[_0x9c49('0x19')][_0x9c49('0x15e')]=function(_0x24597a){var _0x43eb55=this;var _0xa637ff=_0x24597a['limitCalls']-_0x24597a['originated']-_0x24597a[_0x9c49('0xbd')];emitCampaignSummary(_0x24597a);if(_0xa637ff>0x0){if(_0xa637ff>this[_0x9c49('0x20')]){_0xa637ff=this[_0x9c49('0x20')];}_0x24597a[_0x9c49('0xbd')]+=_0xa637ff;this[_0x9c49('0xbf')](_0x24597a['id'],_0xa637ff,_0x24597a[_0x9c49('0x206')],_0x24597a)['then'](function(_0x98dc5e){_0x24597a['temp']-=_0xa637ff;_0x24597a[_0x9c49('0xbd')]=_0x24597a[_0x9c49('0xbd')]>0x0?_0x24597a[_0x9c49('0xbd')]:0x0;if(!checkContactEmpty(_0x98dc5e)){_0x24597a[_0x9c49('0x41')]=_0x9c49('0x9d');logger[_0x9c49('0x7e')](_0x9c49('0x207')+_0x24597a['name']);}else{_0x24597a[_0x9c49('0x71')]+=_0x98dc5e[_0x9c49('0x97')];_0x24597a[_0x9c49('0x41')]=_0x9c49('0x208');for(var _0x149d5b=0x0;_0x149d5b<_0x98dc5e[_0x9c49('0x97')];_0x149d5b+=0x1){_0x24597a[_0x9c49('0x209')]+=0x1;if(_[_0x9c49('0xa9')](_0x98dc5e[_0x149d5b])||_['isNil'](_0x98dc5e[_0x149d5b][_0x9c49('0x187')])||_[_0x9c49('0xa9')](_0x98dc5e[_0x149d5b][_0x9c49('0x171')])){_0x43eb55['emptyContact'](_0x9c49('0x20a'),_0x24597a,_0x98dc5e[_0x149d5b]);}else{_0x43eb55[_0x9c49('0xb8')](_['pick'](_0x98dc5e[_0x149d5b],['CampaignId',_0x9c49('0x20b')]))[_0x9c49('0x3d')](_0x43eb55['checkContactBlack'](_0x24597a,_0x98dc5e[_0x149d5b]))['catch'](_0x43eb55[_0x9c49('0xc8')](_0x9c49('0x20c'),_0x24597a));}}}})[_0x9c49('0xab')](loggerGetContactDialer(_0x9c49('0x20d'),_0x24597a,_0xa637ff));}};Dialer[_0x9c49('0x19')][_0x9c49('0x158')]=function(_0x5c4717,_0x144862){var _0x1016b7=this;var _0x1a0b41=[];var _0x105cf4=_0x144862>=0x1?_0x144862:0x1;if(_0x5c4717[_0x9c49('0x5c')]===_0x9c49('0x6')){_0x105cf4=0x1;}var _0x37b4df=Math[_0x9c49('0x1d1')](_0x5c4717[_0x9c49('0x50')]*_0x105cf4)-_0x5c4717[_0x9c49('0x71')]-_0x5c4717[_0x9c49('0xbd')];emitVoiceQueueSummary(_0x5c4717);if(_0x5c4717['dialLimitQueue']>0x0){var _0x97c9c4=_0x5c4717[_0x9c49('0x20e')]-_0x5c4717[_0x9c49('0x71')]-_0x5c4717[_0x9c49('0xa0')]-_0x5c4717[_0x9c49('0xbd')]-_0x5c4717[_0x9c49('0x52')];if(_0x37b4df>_0x97c9c4){_0x37b4df=_0x97c9c4;}}if(_0x37b4df>0x0){if(_0x5c4717[_0x9c49('0x5c')]===_0x9c49('0x6')){_0x37b4df=0x1;}if(_0x37b4df>this['maxNumberOriginate']){_0x37b4df=this['maxNumberOriginate'];}_0x5c4717[_0x9c49('0xbd')]+=_0x37b4df;for(var _0x5cf1fc in this[_0x9c49('0x1e')]){if(typeof this[_0x9c49('0x1e')][_0x5cf1fc]!==_0x9c49('0x98')){if(this['agents'][_0x5cf1fc]['state']===_0x9c49('0x20f')&&this[_0x9c49('0x1e')][_0x5cf1fc][_0x9c49('0xd6')]==='reachable'){_0x1a0b41[_0x9c49('0x12c')](this[_0x9c49('0x1e')][_0x5cf1fc]['id']);}}}this[_0x9c49('0xbc')](_0x5c4717['id'],_0x1a0b41,_0x37b4df,_0x5c4717[_0x9c49('0x206')],_0x5c4717)[_0x9c49('0x3d')](function(_0xca608){_0x5c4717[_0x9c49('0xbd')]-=_0x37b4df;_0x5c4717[_0x9c49('0xbd')]=_0x5c4717[_0x9c49('0xbd')]>0x0?_0x5c4717[_0x9c49('0xbd')]:0x0;if(!checkContactEmpty(_0xca608)){_0x1016b7[_0x9c49('0x210')](_0x5c4717)[_0x9c49('0x3d')](sendMessageReschedule(_0x5c4717))[_0x9c49('0xab')](loggerCatch('[countReScheduled]\x20'));}else{_0x5c4717[_0x9c49('0x71')]+=_0xca608[_0x9c49('0x97')];_0x5c4717['message']=_0x5c4717[_0x9c49('0x5c')]==='booked'?'ACTIVE':_0x9c49('0x208');for(var _0x53bd1=0x0;_0x53bd1<_0xca608[_0x9c49('0x97')];_0x53bd1+=0x1){if(_[_0x9c49('0xa9')](_0xca608[_0x53bd1])||_[_0x9c49('0xa9')](_0xca608[_0x53bd1][_0x9c49('0x187')])||_[_0x9c49('0xa9')](_0xca608[_0x53bd1][_0x9c49('0x171')])){_0x1016b7[_0x9c49('0xc9')](_0x9c49('0x20a'),_0x5c4717,_0xca608[_0x53bd1]);}else{_0x1016b7['checkIsBlackList'](_[_0x9c49('0xcc')](_0xca608[_0x53bd1],[_0x9c49('0xcf'),'Contact.phone']))[_0x9c49('0x3d')](_0x1016b7[_0x9c49('0x1f3')](_0x5c4717,_0xca608[_0x53bd1]))[_0x9c49('0xab')](_0x1016b7[_0x9c49('0xc8')](_0x9c49('0x20a'),_0x5c4717));}}}})[_0x9c49('0xab')](loggerGetContactDialer(_0x9c49('0x211'),_0x5c4717,_0x37b4df));}};Dialer[_0x9c49('0x19')]['handlePredictive']=function(_0x514a27){if(_0x514a27[_0x9c49('0x20e')]>0x0){var _0x14baf5=_0x514a27[_0x9c49('0x20e')]-_0x514a27[_0x9c49('0x71')]-_0x514a27['talking'];if(_0x14baf5>0x0){this['tryOriginatePredictive'](_0x514a27);}else{loggerPredictiveCalls[_0x9c49('0x7e')](_0x9c49('0x212'));}}else{this[_0x9c49('0x213')](_0x514a27);}};Dialer['prototype'][_0x9c49('0x213')]=function(_0x34c0a1){var _0x3429f4=this;var _0x4730cd=[];_0x34c0a1[_0x9c49('0x71')]+=0x1;for(var _0x48e696 in this[_0x9c49('0x1e')]){if(typeof this[_0x9c49('0x1e')][_0x48e696]!==_0x9c49('0x98')){if(this[_0x9c49('0x1e')][_0x48e696][_0x9c49('0xdf')]===_0x9c49('0x20f')&&this[_0x9c49('0x1e')][_0x48e696][_0x9c49('0xd6')]===_0x9c49('0xd7')){_0x4730cd[_0x9c49('0x12c')](this[_0x9c49('0x1e')][_0x48e696]['id']);}}}this[_0x9c49('0xbc')](_0x34c0a1['id'],_0x4730cd,0x1,_0x34c0a1[_0x9c49('0x206')],_0x34c0a1)[_0x9c49('0x3d')](function(_0x4b89c0){if(!checkContactEmpty(_0x4b89c0)){checkContactLowerLimitOriginate(_0x34c0a1,0x1,0x0);_0x3429f4['countReScheduled'](_0x34c0a1)[_0x9c49('0x3d')](sendMessageReschedule(_0x34c0a1))[_0x9c49('0xab')](loggerCatch('[countReScheduled]\x20'));}else{_0x34c0a1[_0x9c49('0x41')]=_0x9c49('0x208');if(_[_0x9c49('0xa9')](_0x4b89c0[0x0])||_[_0x9c49('0xa9')](_0x4b89c0[0x0][_0x9c49('0x187')])||_[_0x9c49('0xa9')](_0x4b89c0[0x0][_0x9c49('0x171')])){_0x3429f4[_0x9c49('0xc9')](_0x9c49('0x20a'),_0x34c0a1,_0x4b89c0[0x0]);}else{_0x3429f4[_0x9c49('0xb1')](_[_0x9c49('0xcc')](_0x4b89c0[0x0],[_0x9c49('0xcf'),_0x9c49('0x20b')]))['then'](_0x3429f4[_0x9c49('0x1f3')](_0x34c0a1,_0x4b89c0[0x0]))[_0x9c49('0xab')](_0x3429f4['loggerHandler']('[actionOriginatePredictive]\x20',_0x34c0a1));}}})[_0x9c49('0xab')](loggerGetContactDialer(_0x9c49('0x214'),_0x34c0a1,0x1));emitVoiceQueueSummary(_0x34c0a1);};Dialer['prototype']['abandonmentRate']=function(_0x2c324b,_0x5eb1ce,_0x1e7c5c,_0x58844b,_0x2e174f,_0x4607dd){loggerPredictive[_0x9c49('0x7e')]('--------\x20Drop\x20Rate\x20--------');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',_0x2c324b);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x215'),_0x5eb1ce);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x216'),_0x1e7c5c);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x217'),_0x58844b);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x218'),_0x2e174f);loggerPredictive[_0x9c49('0x7e')]('---------------------------');return new Promise(function(_0x4207a4,_0x3315c9){if(_0x2c324b<=0x0||isNaN(_0x2c324b)){return _0x3315c9(msgResponse(_0x9c49('0x219'),_0x9c49('0x4a'),'m\x20=\x20'+_0x2c324b));}if(_0x1e7c5c<=0x0||isNaN(_0x1e7c5c)){return _0x3315c9(msgResponse(_0x9c49('0x219'),_0x9c49('0x4a'),_0x9c49('0x21a')+_0x1e7c5c));}if(_0x58844b<=0x0||isNaN(_0x58844b)){return _0x3315c9(msgResponse(_0x9c49('0x219'),_0x9c49('0x4a'),'p\x20=\x20'+_0x58844b));}if(_0x5eb1ce<=0x0||isNaN(_0x5eb1ce)){return _0x3315c9(msgResponse('[abandonmentRate]',_0x9c49('0x4a'),_0x9c49('0x21b')+_0x5eb1ce));}if(_0x2e174f<=0x0||isNaN(_0x2e174f)){return _0x3315c9(msgResponse('[abandonmentRate]','Error',_0x9c49('0x21c')+_0x2e174f));}_0x4607dd=_0x4607dd||0x0;var _0x3a134e=0x1/_0x1e7c5c;var _0x4fecdc=0x0;var _0x363a40=0x0;var _0x329ca5=0x0;var _0x3953a3=0x0;for(var _0x168f53=0x0;_0x329ca5<_0x2e174f;_0x168f53+=0x1){_0x363a40=_0x168f53/_0x5eb1ce;_0x4fecdc=(_0x58844b*_0x363a40+_0x4607dd)/_0x3a134e;_0x329ca5=erlangb(_0x4fecdc,_0x2c324b);_0x3953a3=_0x4fecdc/_0x2c324b*(0x1-erlangb(_0x4fecdc,_0x2c324b));}return _0x4207a4({'erlangCalls':_0x168f53,'erlangCallToSecond':_0x5eb1ce/_0x168f53,'erlangAbandonmentRate':_0x329ca5,'erlangBusyFactor':_0x3953a3});});};Dialer[_0x9c49('0x19')]['busyFactor']=function(_0x575c14,_0x281ab5,_0x498e46,_0x28453e,_0x3e2205,_0x4dba7a){loggerPredictive[_0x9c49('0x7e')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x21d'),_0x575c14);loggerPredictive['info'](_0x9c49('0x215'),_0x281ab5);loggerPredictive[_0x9c49('0x7e')]('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',_0x498e46);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x217'),_0x28453e);loggerPredictive[_0x9c49('0x7e')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e2205);loggerPredictive[_0x9c49('0x7e')](_0x9c49('0x83'));return new Promise(function(_0x488467,_0x30d7d1){if(_0x575c14<=0x0||isNaN(_0x575c14)){return _0x30d7d1(msgResponse(_0x9c49('0x21e'),_0x9c49('0x4a'),_0x9c49('0x21f')+_0x575c14));}if(_0x498e46<=0x0||isNaN(_0x498e46)){return _0x30d7d1(msgResponse(_0x9c49('0x21e'),_0x9c49('0x4a'),_0x9c49('0x21a')+_0x498e46));}if(_0x28453e<=0x0||isNaN(_0x28453e)){return _0x30d7d1(msgResponse(_0x9c49('0x21e'),'Error',_0x9c49('0x220')+_0x28453e));}if(_0x281ab5<=0x0||isNaN(_0x281ab5)){return _0x30d7d1(msgResponse(_0x9c49('0x21e'),_0x9c49('0x4a'),'interval\x20=\x20'+_0x281ab5));}if(_0x3e2205<=0x0||isNaN(_0x3e2205)){return _0x30d7d1(msgResponse('[busyFactor]','Error',_0x9c49('0x221')+_0x3e2205));}_0x4dba7a=_0x4dba7a||0x0;var _0x33d053=0x1/_0x498e46;var _0x13b621=0x0;var _0x518d30=0x0;var _0x452820=0x0;var _0x264d54=0x0;for(var _0x5844ba=0x0;_0x264d54<_0x3e2205;_0x5844ba+=0x1){_0x518d30=_0x5844ba/_0x281ab5;_0x13b621=(_0x28453e*_0x518d30+_0x4dba7a)/_0x33d053;_0x452820=erlangb(_0x13b621,_0x575c14);_0x264d54=_0x13b621/_0x575c14*(0x1-erlangb(_0x13b621,_0x575c14));}return _0x488467({'erlangCalls':_0x5844ba,'erlangCallToSecond':_0x281ab5/_0x5844ba,'erlangAbandonmentRate':_0x452820,'erlangBusyFactor':_0x264d54});});};module[_0x9c49('0x222')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 95d068a..8324d87 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3070=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x3efc08,_0x32cb1f){var _0x46ae7e=function(_0x4cfd2a){while(--_0x4cfd2a){_0x3efc08['push'](_0x3efc08['shift']());}};_0x46ae7e(++_0x32cb1f);}(_0x3070,0x184));var _0x0307=function(_0x3ae987,_0x48a8d8){_0x3ae987=_0x3ae987-0x0;var _0x4801ac=_0x3070[_0x3ae987];return _0x4801ac;};'use strict';var util=require(_0x0307('0x0'));var _=require(_0x0307('0x1'));var moment=require('moment');function getSeconds(_0x25fff4,_0xac808c){var _0x5791c6=moment(_0x25fff4)[_0x0307('0x2')](0x0);var _0x543761=moment(_0xac808c)[_0x0307('0x2')](0x0);return _0x5791c6['diff'](_0x543761,'seconds');}function QueueCallerAbandon(_0x323fe1,_0xa0c73c){this[_0x0307('0x3')]=_0x323fe1[_0x0307('0x3')];this[_0x0307('0x4')]=_0x323fe1[_0x0307('0x4')];this[_0x0307('0x5')]=_0x323fe1[_0x0307('0x4')]==='outbound'?_0x0307('0x6'):_0x323fe1[_0x0307('0x4')];this['countbusyretry']=_0x323fe1['countbusyretry'];this[_0x0307('0x7')]=_0x323fe1[_0x0307('0x7')];this['countnoanswerretry']=_0x323fe1[_0x0307('0x8')];this['countglobal']=_0x323fe1['countbusyretry']+_0x323fe1[_0x0307('0x7')]+_0x323fe1[_0x0307('0x8')]+_0x323fe1['countnosuchnumberretry']+_0x323fe1[_0x0307('0x9')]+_0x323fe1[_0x0307('0xa')]+_0x323fe1[_0x0307('0xb')]+_0x323fe1['countagentrejectretry'];this[_0x0307('0xc')]=_0x323fe1['countnosuchnumberretry'];this['countdropretry']=_0x323fe1[_0x0307('0x9')];this['countabandonedretry']=_0x323fe1[_0x0307('0xa')];this['countmachineretry']=_0x323fe1['countmachineretry'];this[_0x0307('0xd')]=_0x323fe1[_0x0307('0xd')];this[_0x0307('0xe')]=_0xa0c73c[_0x0307('0xe')];this[_0x0307('0xf')]=_0x323fe1[_0x0307('0x10')];this['calleridnum']=_0x323fe1['number'];this[_0x0307('0x11')]=_0x323fe1[_0x0307('0x11')];this[_0x0307('0x12')]=_0x323fe1[_0x0307('0x12')];this[_0x0307('0x13')]=_0x323fe1[_0x0307('0x13')];this[_0x0307('0x14')]=this[_0x0307('0x13')];this['ringtime']=getSeconds(_0x323fe1[_0x0307('0x12')],_0x323fe1[_0x0307('0x11')]);this[_0x0307('0x15')]=getSeconds(this['droptime'],_0x323fe1[_0x0307('0x12')]);this[_0x0307('0x16')]=0x0;this[_0x0307('0x6')]=_0xa0c73c[_0x0307('0x6')];this[_0x0307('0x17')]=_0xa0c73c[_0x0307('0x18')];this[_0x0307('0x19')]=_0xa0c73c[_0x0307('0x19')];this[_0x0307('0x1a')]=_0x323fe1[_0x0307('0x1a')];this['callbackuniqueid']=_0x323fe1[_0x0307('0x1b')];this[_0x0307('0x1c')]=_0x323fe1[_0x0307('0x1c')];this[_0x0307('0x1d')]=_0x323fe1[_0x0307('0x1d')];this[_0x0307('0x1e')]=_0x323fe1['ContactId'];this[_0x0307('0x1f')]=_0x323fe1[_0x0307('0x1f')];this[_0x0307('0x20')]=_0x323fe1[_0x0307('0x20')];this[_0x0307('0x21')]=_0x323fe1[_0x0307('0x21')];this[_0x0307('0x22')]=_0x323fe1[_0x0307('0x22')];this[_0x0307('0x23')]=_0x323fe1[_0x0307('0x23')]||'';this[_0x0307('0x24')]=_0x323fe1[_0x0307('0x24')]||'';}module[_0x0307('0x25')]=QueueCallerAbandon; \ No newline at end of file +var _0xd6b1=['outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','droptime','ringtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type'];(function(_0x2047ba,_0x167673){var _0xeaf311=function(_0x4a8fa9){while(--_0x4a8fa9){_0x2047ba['push'](_0x2047ba['shift']());}};_0xeaf311(++_0x167673);}(_0xd6b1,0xef));var _0x1d6b=function(_0x57474b,_0x465fd8){_0x57474b=_0x57474b-0x0;var _0x132d7e=_0xd6b1[_0x57474b];return _0x132d7e;};'use strict';var util=require(_0x1d6b('0x0'));var _=require(_0x1d6b('0x1'));var moment=require(_0x1d6b('0x2'));function getSeconds(_0x11f4e6,_0x373835){var _0x5d9b92=moment(_0x11f4e6)[_0x1d6b('0x3')](0x0);var _0x436c64=moment(_0x373835)[_0x1d6b('0x3')](0x0);return _0x5d9b92[_0x1d6b('0x4')](_0x436c64,'seconds');}function QueueCallerAbandon(_0xa0abef,_0x4d50e7){this['scheduledat']=_0xa0abef[_0x1d6b('0x5')];this[_0x1d6b('0x6')]=_0xa0abef[_0x1d6b('0x6')];this['campaigntype']=_0xa0abef['type']===_0x1d6b('0x7')?_0x1d6b('0x8'):_0xa0abef['type'];this[_0x1d6b('0x9')]=_0xa0abef['countbusyretry'];this['countcongestionretry']=_0xa0abef['countcongestionretry'];this[_0x1d6b('0xa')]=_0xa0abef[_0x1d6b('0xa')];this['countglobal']=_0xa0abef[_0x1d6b('0x9')]+_0xa0abef[_0x1d6b('0xb')]+_0xa0abef[_0x1d6b('0xa')]+_0xa0abef[_0x1d6b('0xc')]+_0xa0abef[_0x1d6b('0xd')]+_0xa0abef[_0x1d6b('0xe')]+_0xa0abef[_0x1d6b('0xf')]+_0xa0abef[_0x1d6b('0x10')];this['countnosuchnumberretry']=_0xa0abef[_0x1d6b('0xc')];this[_0x1d6b('0xd')]=_0xa0abef[_0x1d6b('0xd')];this[_0x1d6b('0xe')]=_0xa0abef[_0x1d6b('0xe')];this[_0x1d6b('0xf')]=_0xa0abef['countmachineretry'];this[_0x1d6b('0x10')]=_0xa0abef[_0x1d6b('0x10')];this[_0x1d6b('0x11')]=_0x4d50e7[_0x1d6b('0x11')];this[_0x1d6b('0x12')]=_0xa0abef[_0x1d6b('0x13')];this[_0x1d6b('0x14')]=_0xa0abef[_0x1d6b('0x15')];this[_0x1d6b('0x16')]=_0xa0abef[_0x1d6b('0x16')];this[_0x1d6b('0x17')]=_0xa0abef['responsetime'];this['droptime']=_0xa0abef['droptime'];this[_0x1d6b('0x18')]=this[_0x1d6b('0x19')];this[_0x1d6b('0x1a')]=getSeconds(_0xa0abef[_0x1d6b('0x17')],_0xa0abef['starttime']);this['holdtime']=getSeconds(this['droptime'],_0xa0abef['responsetime']);this[_0x1d6b('0x1b')]=0x0;this[_0x1d6b('0x8')]=_0x4d50e7[_0x1d6b('0x8')];this[_0x1d6b('0x1c')]=_0x4d50e7['connectedlinename'];this['reason']=_0x4d50e7['reason'];this[_0x1d6b('0x1d')]=_0xa0abef[_0x1d6b('0x1d')];this[_0x1d6b('0x1e')]=_0xa0abef[_0x1d6b('0x1e')];this[_0x1d6b('0x1f')]=_0xa0abef[_0x1d6b('0x1f')];this[_0x1d6b('0x20')]=_0xa0abef[_0x1d6b('0x20')];this[_0x1d6b('0x21')]=_0xa0abef[_0x1d6b('0x21')];this[_0x1d6b('0x22')]=_0xa0abef['ListId'];this[_0x1d6b('0x23')]=_0xa0abef[_0x1d6b('0x23')];this[_0x1d6b('0x24')]=_0xa0abef[_0x1d6b('0x24')];this[_0x1d6b('0x25')]=_0xa0abef['CampaignId'];this[_0x1d6b('0x26')]=_0xa0abef[_0x1d6b('0x26')]||'';this[_0x1d6b('0x27')]=_0xa0abef[_0x1d6b('0x27')]||'';}module[_0x1d6b('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 9cc2a65..3f88355 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(_0x53308b,_0x28dc1a){var _0x5eac23=function(_0x30fe72){while(--_0x30fe72){_0x53308b['push'](_0x53308b['shift']());}};_0x5eac23(++_0x28dc1a);}(_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(_0x5cb96c,_0x1ec09c){var _0x1fa6db=function(_0x973446){while(--_0x973446){_0x5cb96c['push'](_0x5cb96c['shift']());}};_0x1fa6db(++_0x1ec09c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 b84bf52..cd955a6 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 _0x3a6c=['../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','from-voip-provider','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','filename','info','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','then','.pdf','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','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','XMF-PATH','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x3a6c,0x1d1));var _0xc3a6=function(_0x12bdd4,_0x108a0e){_0x12bdd4=_0x12bdd4-0x0;var _0x56fc58=_0x3a6c[_0x12bdd4];return _0x56fc58;};'use strict';var util=require(_0xc3a6('0x0'));var _=require(_0xc3a6('0x1'));var BPromise=require(_0xc3a6('0x2'));var uuid=require(_0xc3a6('0x3'));var moment=require('moment');var path=require(_0xc3a6('0x4'));var tiff2pdf=require(_0xc3a6('0x5'));var gs=require(_0xc3a6('0x6'));var logger=require(_0xc3a6('0x7'))(_0xc3a6('0x8'));var ami=require(_0xc3a6('0x9'));var rpcDb=require(_0xc3a6('0xa'));var Channel=require(_0xc3a6('0xb'));var ut=require(_0xc3a6('0xc'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xc3a6('0xd'));var faxMessage=require(_0xc3a6('0xe'));function Fax(_0x3aff15){this[_0xc3a6('0xf')]={};this[_0xc3a6('0x10')]=_0x3aff15[_0xc3a6('0x10')];this[_0xc3a6('0x11')]=_0x3aff15[_0xc3a6('0x11')];this[_0xc3a6('0x12')]={};ami['on'](_0xc3a6('0x13'),this[_0xc3a6('0x14')][_0xc3a6('0x15')](this));ami['on'](_0xc3a6('0x16'),this[_0xc3a6('0x17')][_0xc3a6('0x15')](this));ami['on'](_0xc3a6('0x18'),this[_0xc3a6('0x19')]['bind'](this));ami['on'](_0xc3a6('0x1a'),this['syncNewExten'][_0xc3a6('0x15')](this));ami['on'](_0xc3a6('0x1b'),this['syncFaxStatus'][_0xc3a6('0x15')](this));ami['on'](_0xc3a6('0x1c'),this[_0xc3a6('0x1d')]['bind'](this));ami['on'](_0xc3a6('0x1e'),this[_0xc3a6('0x1f')][_0xc3a6('0x15')](this));ami['on'](_0xc3a6('0x20'),this['syncOriginateResponse'][_0xc3a6('0x15')](this));}Fax['prototype']['syncNewchannel']=function(_0x501890){if(_0x501890['context']===_0xc3a6('0x21')){for(var _0x1be9fe in this[_0xc3a6('0x10')]){if(this['faxAccounts']['hasOwnProperty'](_0x1be9fe)){if(_0x501890[_0xc3a6('0x22')]===this[_0xc3a6('0x10')][_0x1be9fe][_0xc3a6('0x23')]){this[_0xc3a6('0xf')][_0x501890['uniqueid']]={};this[_0xc3a6('0xf')][_0x501890[_0xc3a6('0x24')]][_0xc3a6('0x25')]=_0x501890[_0xc3a6('0x25')];this[_0xc3a6('0xf')][_0x501890[_0xc3a6('0x24')]]['id']=this[_0xc3a6('0x10')][_0x1be9fe]['id'];this['channels'][_0x501890[_0xc3a6('0x24')]][_0xc3a6('0x26')]=this[_0xc3a6('0x10')][_0x1be9fe]['name'];logger['info'](_0x501890[_0xc3a6('0x24')],_0xc3a6('0x27'));}}}}if(this['actions'][_0x501890['uniqueid']]){this['channels'][_0x501890[_0xc3a6('0x24')]]={};this['channels'][_0x501890[_0xc3a6('0x24')]][_0xc3a6('0x25')]=_0x501890[_0xc3a6('0x25')];logger['info'](_0x501890[_0xc3a6('0x24')],_0xc3a6('0x27'));}};Fax[_0xc3a6('0x28')][_0xc3a6('0x17')]=function(_0x201712){if(this['channels'][_0x201712[_0xc3a6('0x24')]]){for(var _0x4ffa30 in _0x201712['variable']){if(_0x201712[_0xc3a6('0x29')][_0xc3a6('0x2a')](_0x4ffa30)){this[_0xc3a6('0xf')][_0x201712['uniqueid']][_0x4ffa30]=_0x201712[_0xc3a6('0x2b')];}}}};Fax['prototype'][_0xc3a6('0x19')]=function(_0x33fb71){if(this['channels'][_0x33fb71[_0xc3a6('0x24')]]){this[_0xc3a6('0xf')][_0x33fb71[_0xc3a6('0x24')]][_0xc3a6('0x2c')]=_0x33fb71[_0xc3a6('0x2c')];this[_0xc3a6('0xf')][_0x33fb71[_0xc3a6('0x24')]][_0xc3a6('0x2d')]=_0x33fb71[_0xc3a6('0x2d')];}};Fax[_0xc3a6('0x28')][_0xc3a6('0x2e')]=function(_0x587aab){if(this[_0xc3a6('0xf')][_0x587aab['uniqueid']]){for(var _0x1b9856 in _0x587aab[_0xc3a6('0x29')]){if(_0x587aab[_0xc3a6('0x29')][_0xc3a6('0x2a')](_0x1b9856)){this[_0xc3a6('0xf')][_0x587aab['uniqueid']][_0x1b9856]=_0x587aab[_0xc3a6('0x2b')];}}}};Fax[_0xc3a6('0x28')][_0xc3a6('0x2f')]=function(_0x329834){if(this[_0xc3a6('0xf')][_0x329834['uniqueid']]){this[_0xc3a6('0xf')][_0x329834[_0xc3a6('0x24')]]['operation']=_0x329834[_0xc3a6('0x30')];this['channels'][_0x329834['uniqueid']][_0xc3a6('0x31')]=_0x329834[_0xc3a6('0x31')];this['channels'][_0x329834[_0xc3a6('0x24')]]['localstationid']=_0x329834[_0xc3a6('0x23')];this[_0xc3a6('0xf')][_0x329834['uniqueid']][_0xc3a6('0x32')]=_0x329834[_0xc3a6('0x32')];logger[_0xc3a6('0x33')](_0x329834[_0xc3a6('0x24')],_0xc3a6('0x34'));}};Fax[_0xc3a6('0x28')]['syncReceiveFax']=function(_0xc9e066){var _0x486cbb=this;if(this[_0xc3a6('0xf')][_0xc9e066[_0xc3a6('0x24')]]){var _0x3fcf0c=this[_0xc3a6('0xf')][_0xc9e066[_0xc3a6('0x24')]]['id'];this[_0xc3a6('0xf')][_0xc9e066[_0xc3a6('0x24')]][_0xc3a6('0x35')]=_0xc9e066[_0xc3a6('0x35')];this[_0xc3a6('0xf')][_0xc9e066[_0xc3a6('0x24')]][_0xc3a6('0x36')]=_0xc9e066[_0xc3a6('0x36')];this[_0xc3a6('0xf')][_0xc9e066['uniqueid']][_0xc3a6('0x23')]=_0xc9e066[_0xc3a6('0x23')];this[_0xc3a6('0xf')][_0xc9e066[_0xc3a6('0x24')]][_0xc3a6('0x37')]=_0xc9e066[_0xc3a6('0x37')];this[_0xc3a6('0xf')][_0xc9e066['uniqueid']][_0xc3a6('0x38')]=_0xc9e066[_0xc3a6('0x38')];this[_0xc3a6('0xf')][_0xc9e066[_0xc3a6('0x24')]][_0xc3a6('0x32')]=_0xc9e066['filename'];this[_0xc3a6('0xf')][_0xc9e066[_0xc3a6('0x24')]][_0xc3a6('0x39')]=_0xc9e066['calleridnum'];if(this[_0xc3a6('0xf')][_0xc9e066[_0xc3a6('0x24')]][_0xc3a6('0x36')]>0x0){tiff2pdf(_0xc9e066[_0xc3a6('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x162ab8){logger[_0xc3a6('0x33')](_0xc9e066[_0xc3a6('0x24')],'\x20result\x20conversion\x20file\x20',_0x162ab8[_0xc3a6('0x3a')]);attachment[_0xc3a6('0x3b')]({'name':path[_0xc3a6('0x3c')](_0xc9e066[_0xc3a6('0x32')])[_0xc3a6('0x26')],'basename':path[_0xc3a6('0x3c')](_0xc9e066['filename'])[_0xc3a6('0x26')]+'.pdf','type':'application/pdf'})[_0xc3a6('0x3d')](function(_0x15ef50){faxAccount['notify'](_0x3fcf0c,{'from':_0xc9e066[_0xc3a6('0x39')],'mapKey':_0xc3a6('0x8'),'body':path[_0xc3a6('0x3c')](_0xc9e066[_0xc3a6('0x32')])['name']+_0xc3a6('0x3e'),'AttachmentId':_0x15ef50['id']})[_0xc3a6('0x3f')](function(_0xac37f6){logger['error'](_0xc9e066['uniqueid'],_0xc3a6('0x40'),JSON[_0xc3a6('0x41')](_0xac37f6));});})[_0xc3a6('0x3f')](function(_0x6474a8){logger['error'](_0xc9e066[_0xc3a6('0x24')],_0xc3a6('0x42'),JSON[_0xc3a6('0x41')](_0x6474a8));});});}logger[_0xc3a6('0x33')](_0xc9e066['uniqueid'],_0xc3a6('0x42'));}};Fax[_0xc3a6('0x28')]['syncOriginateResponse']=function(_0x5e6f38){if(this['actions'][_0x5e6f38[_0xc3a6('0x24')]]){_[_0xc3a6('0x43')](this['channels'][_0x5e6f38[_0xc3a6('0x24')]],_[_0xc3a6('0x44')](_0x5e6f38,['response',_0xc3a6('0x45')]));}};function updateStatus(_0x1ef015){if(_0x1ef015[_0xc3a6('0x46')]){faxMessage[_0xc3a6('0x47')](_0x1ef015[_0xc3a6('0x46')],{'failMessage':_0xc3a6('0x48')})[_0xc3a6('0x3d')](function(_0x1be8a2){ut[_0xc3a6('0x49')](_0xc3a6('0x4a'),_0x1be8a2);})['catch'](function(_0x37dc67){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x37dc67);});}else{ut[_0xc3a6('0x49')](_0xc3a6('0x4b'));}}Fax[_0xc3a6('0x28')]['updateStatus']=function(_0xb91ba2,_0x1f864e,_0x468604){var _0x1c0cbf=this;var _0x57b735={};if(_0x1f864e){_0x57b735={'read':_0x1f864e};}else{_0x57b735={'failMessage':_0x468604};}if(this[_0xc3a6('0x12')][_0xb91ba2]['AttachmentId']){faxMessage[_0xc3a6('0x47')](this[_0xc3a6('0x12')][_0xb91ba2]['AttachmentId'],_0x57b735)[_0xc3a6('0x3d')](function(_0x91ee00){ut[_0xc3a6('0x49')](_0xc3a6('0x4c'),_0x91ee00);})['catch'](function(_0x5babeb){ut[_0xc3a6('0x49')](_0xc3a6('0x4d'),_0x5babeb);})[_0xc3a6('0x4e')](function(){delete _0x1c0cbf[_0xc3a6('0xf')][_0xb91ba2];delete _0x1c0cbf[_0xc3a6('0x12')][_0xb91ba2];});}else{ut['logger'](_0xc3a6('0x4f'));delete this[_0xc3a6('0xf')][_0xb91ba2];delete this[_0xc3a6('0x12')][_0xb91ba2];}};Fax['prototype'][_0xc3a6('0x1f')]=function(_0x48d18b){var _0x4467b3=this;if(this[_0xc3a6('0xf')][_0x48d18b[_0xc3a6('0x24')]]){if(this[_0xc3a6('0x12')][_0x48d18b[_0xc3a6('0x24')]]){this[_0xc3a6('0xf')][_0x48d18b[_0xc3a6('0x24')]]['id']=this[_0xc3a6('0x12')][_0x48d18b['uniqueid']]['id'];this[_0xc3a6('0xf')][_0x48d18b[_0xc3a6('0x24')]][_0xc3a6('0x26')]=this[_0xc3a6('0x12')][_0x48d18b['uniqueid']][_0xc3a6('0x26')];}logger[_0xc3a6('0x33')](_0x48d18b['uniqueid'],this[_0xc3a6('0x12')][_0x48d18b[_0xc3a6('0x24')]]?_0xc3a6('0x50'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0xc3a6('0xf')][_0x48d18b[_0xc3a6('0x24')]]));if(this[_0xc3a6('0x12')][_0x48d18b[_0xc3a6('0x24')]]){if(this[_0xc3a6('0xf')][_0x48d18b[_0xc3a6('0x24')]][_0xc3a6('0x51')]>0x0&&this[_0xc3a6('0xf')][_0x48d18b[_0xc3a6('0x24')]][_0xc3a6('0x1b')]===_0xc3a6('0x52')){this[_0xc3a6('0x53')](_0x48d18b[_0xc3a6('0x24')],!![]);}else{this[_0xc3a6('0x53')](_0x48d18b[_0xc3a6('0x24')],![],this[_0xc3a6('0xf')][_0x48d18b[_0xc3a6('0x24')]][_0xc3a6('0x54')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x48d18b[_0xc3a6('0x24')]][_0xc3a6('0x54')]:_0xc3a6('0x55'));}}}};Fax[_0xc3a6('0x28')][_0xc3a6('0x56')]=function(_0x26c279){var _0x1d98ac=this;return new BPromise(function(_0x23a801,_0x34ead9){_0x1d98ac[_0xc3a6('0x57')](_0x26c279,_0x1d98ac['faxAccounts'][_0x26c279[_0xc3a6('0x58')]])[_0xc3a6('0x3d')](function(_0x1e8096){ut[_0xc3a6('0x49')](_0xc3a6('0x59'),_0x1e8096);_0x23a801(ut[_0xc3a6('0x3a')](_0xc3a6('0x5a')));})[_0xc3a6('0x3f')](function(_0x5cfec6){ut[_0xc3a6('0x49')](_0xc3a6('0x5b'),_0x5cfec6);updateStatus(_0x26c279);_0x34ead9(ut['message'](_0xc3a6('0x5c')));});});};Fax[_0xc3a6('0x28')]['checkAfterSend']=function(_0x4650fc){var _0x140ae1=this;return new BPromise(function(_0x2897e8,_0x1e22b1){var _0x3fe75f=_0x140ae1[_0xc3a6('0x5d')](_0x140ae1[_0xc3a6('0x10')][_0x4650fc[_0xc3a6('0x58')]][_0xc3a6('0x5e')],_0x4650fc);if(_0x3fe75f[_0xc3a6('0x5f')]){_0x2897e8(ut['message'](_0xc3a6('0x60')));}else{_0x1e22b1(ut[_0xc3a6('0x3a')](_0x3fe75f['message']));}});};function originate(_0x287be8,_0x23455e,_0x381811){return new BPromise(function(_0x3d5bf9,_0x42caa9){if(_0x381811){var _0x3d1765=util[_0xc3a6('0x61')](_0xc3a6('0x62'),path['parse'](_0x287be8['path'])['name'],_0x287be8[_0xc3a6('0x4')]);gs[_0xc3a6('0x63')](_0x3d1765)['then'](function(){_0x287be8[_0xc3a6('0x4')]=util['format'](_0xc3a6('0x64'),path['parse'](_0x287be8[_0xc3a6('0x4')])[_0xc3a6('0x65')],path[_0xc3a6('0x3c')](_0x287be8[_0xc3a6('0x4')])[_0xc3a6('0x26')]);_0x23455e[_0xc3a6('0x66')]=_0x287be8['path'];ut[_0xc3a6('0x49')]('Convert\x20pdf\x20to\x20tif','');ami[_0xc3a6('0x67')](ut[_0xc3a6('0x68')](_0x287be8,_0x23455e))['then'](function(_0x2d957c){_0x3d5bf9(_0x2d957c);})[_0xc3a6('0x3f')](function(_0x176a43){_0x42caa9(_0x176a43);});})[_0xc3a6('0x3f')](function(_0x1e32d0){_0x42caa9(_0x1e32d0);});}else{ami[_0xc3a6('0x67')](ut['variablesAction'](_0x287be8,_0x23455e))[_0xc3a6('0x3d')](function(_0x51bb6e){_0x3d5bf9(_0x51bb6e);})[_0xc3a6('0x3f')](function(_0x3e4124){_0x42caa9(_0x3e4124);});}});}Fax[_0xc3a6('0x28')][_0xc3a6('0x57')]=function(_0x126e6d,_0x520cc8){var _0x33a738=this;return new BPromise(function(_0x37e8ae,_0x1a1eb6){var _0x50aada=uuid['v4']();var _0x580ea8=ut[_0xc3a6('0x69')](_0x126e6d,_0x520cc8);_0x33a738[_0xc3a6('0x12')][_0x50aada]=new Action(_0x50aada,_0x520cc8,_0x126e6d);var _0x4296e0=_0x33a738[_0xc3a6('0x12')][_0x50aada];if(path[_0xc3a6('0x3c')](_0x126e6d[_0xc3a6('0x4')])['ext']==='.pdf'){originate(_0x4296e0,_0x580ea8,!![])['then'](function(_0x4aaf51){_0x37e8ae(_0x4aaf51);})[_0xc3a6('0x3f')](function(_0x4a2131){_0x1a1eb6(_0x4a2131);});}else{originate(_0x4296e0,_0x580ea8,![])[_0xc3a6('0x3d')](function(_0x4f928b){_0x37e8ae(_0x4f928b);})[_0xc3a6('0x3f')](function(_0x3ac2ff){_0x1a1eb6(_0x3ac2ff);});}});};Fax[_0xc3a6('0x28')][_0xc3a6('0x6a')]=function(_0x554ec1){return!_[_0xc3a6('0x6b')](_0x554ec1)&&!_['isNil'](_0x554ec1[_0xc3a6('0x26')])&&!_['isNil'](_0x554ec1[_0xc3a6('0x6c')])&&_0x554ec1['active']&&!_['isNil'](this[_0xc3a6('0x11')][util['format'](_0xc3a6('0x6d'),_0x554ec1['name'])])&&!_[_0xc3a6('0x6b')](this[_0xc3a6('0x11')][util[_0xc3a6('0x61')](_0xc3a6('0x6d'),_0x554ec1[_0xc3a6('0x26')])][_0xc3a6('0x31')])&&(this[_0xc3a6('0x11')][util[_0xc3a6('0x61')](_0xc3a6('0x6d'),_0x554ec1[_0xc3a6('0x26')])]['status']===_0xc3a6('0x6e')||this['trunks'][util['format']('SIP/%s',_0x554ec1[_0xc3a6('0x26')])]['status']===_0xc3a6('0x6f'));};Fax['prototype'][_0xc3a6('0x5d')]=function(_0x6bce2,_0xcddbb0){if(!this[_0xc3a6('0x6a')](_0x6bce2)){ut[_0xc3a6('0x49')](_0xc3a6('0x70'),_[_0xc3a6('0x6b')](_0x6bce2)?'':_0x6bce2['name']+_0xc3a6('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xc3a6('0x6b')](_0xcddbb0[_0xc3a6('0x8')])){ut[_0xc3a6('0x49')](_0xc3a6('0x72'),JSON['stringify'](_0xcddbb0));return{'isValid':![],'message':_0xc3a6('0x73')};}if(_[_0xc3a6('0x6b')](_0xcddbb0[_0xc3a6('0x4')])){ut[_0xc3a6('0x49')](_0xc3a6('0x74'),JSON['stringify'](_0xcddbb0));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xc3a6('0x75')]=Fax; \ No newline at end of file +var _0xb2ef=['[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','./channel','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','channel','variable','channelstate','channelstatedesc','value','syncFaxStatus','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','application/pdf','fax','parse','.pdf','catch','error','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','updateStatus','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb2ef,0x7b));var _0xfb2e=function(_0x3061ca,_0x1214bd){_0x3061ca=_0x3061ca-0x0;var _0x2de7ea=_0xb2ef[_0x3061ca];return _0x2de7ea;};'use strict';var util=require(_0xfb2e('0x0'));var _=require(_0xfb2e('0x1'));var BPromise=require('bluebird');var uuid=require(_0xfb2e('0x2'));var moment=require(_0xfb2e('0x3'));var path=require(_0xfb2e('0x4'));var tiff2pdf=require(_0xfb2e('0x5'));var gs=require(_0xfb2e('0x6'));var logger=require(_0xfb2e('0x7'))('fax');var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xfb2e('0x8'));var ut=require(_0xfb2e('0x9'));var Action=require(_0xfb2e('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0xfb2e('0xb'));function Fax(_0x26ffb9){this[_0xfb2e('0xc')]={};this[_0xfb2e('0xd')]=_0x26ffb9[_0xfb2e('0xd')];this[_0xfb2e('0xe')]=_0x26ffb9[_0xfb2e('0xe')];this[_0xfb2e('0xf')]={};ami['on']('newchannel',this[_0xfb2e('0x10')][_0xfb2e('0x11')](this));ami['on'](_0xfb2e('0x12'),this[_0xfb2e('0x13')][_0xfb2e('0x11')](this));ami['on'](_0xfb2e('0x14'),this[_0xfb2e('0x15')]['bind'](this));ami['on'](_0xfb2e('0x16'),this[_0xfb2e('0x17')]['bind'](this));ami['on'](_0xfb2e('0x18'),this['syncFaxStatus']['bind'](this));ami['on'](_0xfb2e('0x19'),this['syncReceiveFax']['bind'](this));ami['on'](_0xfb2e('0x1a'),this[_0xfb2e('0x1b')]['bind'](this));ami['on'](_0xfb2e('0x1c'),this[_0xfb2e('0x1d')][_0xfb2e('0x11')](this));}Fax[_0xfb2e('0x1e')][_0xfb2e('0x10')]=function(_0x8b3597){if(_0x8b3597[_0xfb2e('0x1f')]===_0xfb2e('0x20')){for(var _0x5b4afd in this['faxAccounts']){if(this['faxAccounts'][_0xfb2e('0x21')](_0x5b4afd)){if(_0x8b3597[_0xfb2e('0x22')]===this['faxAccounts'][_0x5b4afd][_0xfb2e('0x23')]){this[_0xfb2e('0xc')][_0x8b3597['uniqueid']]={};this[_0xfb2e('0xc')][_0x8b3597[_0xfb2e('0x24')]]['channel']=_0x8b3597['channel'];this[_0xfb2e('0xc')][_0x8b3597[_0xfb2e('0x24')]]['id']=this[_0xfb2e('0xd')][_0x5b4afd]['id'];this[_0xfb2e('0xc')][_0x8b3597['uniqueid']][_0xfb2e('0x25')]=this[_0xfb2e('0xd')][_0x5b4afd][_0xfb2e('0x25')];logger[_0xfb2e('0x26')](_0x8b3597['uniqueid'],_0xfb2e('0x27'));}}}}if(this[_0xfb2e('0xf')][_0x8b3597[_0xfb2e('0x24')]]){this[_0xfb2e('0xc')][_0x8b3597['uniqueid']]={};this['channels'][_0x8b3597['uniqueid']][_0xfb2e('0x28')]=_0x8b3597[_0xfb2e('0x28')];logger[_0xfb2e('0x26')](_0x8b3597[_0xfb2e('0x24')],_0xfb2e('0x27'));}};Fax[_0xfb2e('0x1e')][_0xfb2e('0x13')]=function(_0x3a0987){if(this[_0xfb2e('0xc')][_0x3a0987['uniqueid']]){for(var _0x20f7e1 in _0x3a0987[_0xfb2e('0x29')]){if(_0x3a0987['variable']['hasOwnProperty'](_0x20f7e1)){this['channels'][_0x3a0987[_0xfb2e('0x24')]][_0x20f7e1]=_0x3a0987['value'];}}}};Fax[_0xfb2e('0x1e')][_0xfb2e('0x15')]=function(_0x3cf14e){if(this[_0xfb2e('0xc')][_0x3cf14e[_0xfb2e('0x24')]]){this[_0xfb2e('0xc')][_0x3cf14e['uniqueid']][_0xfb2e('0x2a')]=_0x3cf14e[_0xfb2e('0x2a')];this['channels'][_0x3cf14e[_0xfb2e('0x24')]][_0xfb2e('0x2b')]=_0x3cf14e['channelstatedesc'];}};Fax[_0xfb2e('0x1e')][_0xfb2e('0x17')]=function(_0xb81e4a){if(this['channels'][_0xb81e4a[_0xfb2e('0x24')]]){for(var _0x4d52a8 in _0xb81e4a['variable']){if(_0xb81e4a[_0xfb2e('0x29')]['hasOwnProperty'](_0x4d52a8)){this[_0xfb2e('0xc')][_0xb81e4a[_0xfb2e('0x24')]][_0x4d52a8]=_0xb81e4a[_0xfb2e('0x2c')];}}}};Fax['prototype'][_0xfb2e('0x2d')]=function(_0x40192f){if(this[_0xfb2e('0xc')][_0x40192f[_0xfb2e('0x24')]]){this[_0xfb2e('0xc')][_0x40192f[_0xfb2e('0x24')]][_0xfb2e('0x2e')]=_0x40192f[_0xfb2e('0x2e')];this['channels'][_0x40192f[_0xfb2e('0x24')]]['status']=_0x40192f[_0xfb2e('0x2f')];this['channels'][_0x40192f[_0xfb2e('0x24')]][_0xfb2e('0x23')]=_0x40192f[_0xfb2e('0x23')];this[_0xfb2e('0xc')][_0x40192f[_0xfb2e('0x24')]][_0xfb2e('0x30')]=_0x40192f[_0xfb2e('0x30')];logger['info'](_0x40192f['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xfb2e('0x1e')]['syncReceiveFax']=function(_0x54cbfa){var _0x1f1ae8=this;if(this[_0xfb2e('0xc')][_0x54cbfa['uniqueid']]){var _0xee9390=this[_0xfb2e('0xc')][_0x54cbfa['uniqueid']]['id'];this['channels'][_0x54cbfa[_0xfb2e('0x24')]]['remotestationid']=_0x54cbfa[_0xfb2e('0x31')];this[_0xfb2e('0xc')][_0x54cbfa['uniqueid']]['pagestransferred']=_0x54cbfa[_0xfb2e('0x32')];this[_0xfb2e('0xc')][_0x54cbfa[_0xfb2e('0x24')]]['localstationid']=_0x54cbfa[_0xfb2e('0x23')];this[_0xfb2e('0xc')][_0x54cbfa[_0xfb2e('0x24')]][_0xfb2e('0x33')]=_0x54cbfa[_0xfb2e('0x33')];this[_0xfb2e('0xc')][_0x54cbfa['uniqueid']][_0xfb2e('0x34')]=_0x54cbfa[_0xfb2e('0x34')];this[_0xfb2e('0xc')][_0x54cbfa[_0xfb2e('0x24')]]['filename']=_0x54cbfa[_0xfb2e('0x30')];this[_0xfb2e('0xc')][_0x54cbfa[_0xfb2e('0x24')]][_0xfb2e('0x35')]=_0x54cbfa[_0xfb2e('0x35')];if(this['channels'][_0x54cbfa[_0xfb2e('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x54cbfa[_0xfb2e('0x30')],_0xfb2e('0x36'),function(_0x505430){logger[_0xfb2e('0x26')](_0x54cbfa[_0xfb2e('0x24')],'\x20result\x20conversion\x20file\x20',_0x505430['message']);attachment[_0xfb2e('0x37')]({'name':path['parse'](_0x54cbfa['filename'])[_0xfb2e('0x25')],'basename':path['parse'](_0x54cbfa[_0xfb2e('0x30')])[_0xfb2e('0x25')]+'.pdf','type':_0xfb2e('0x38')})['then'](function(_0x2feb73){faxAccount['notify'](_0xee9390,{'from':_0x54cbfa[_0xfb2e('0x35')],'mapKey':_0xfb2e('0x39'),'body':path[_0xfb2e('0x3a')](_0x54cbfa['filename'])[_0xfb2e('0x25')]+_0xfb2e('0x3b'),'AttachmentId':_0x2feb73['id']})[_0xfb2e('0x3c')](function(_0x5819f4){logger[_0xfb2e('0x3d')](_0x54cbfa[_0xfb2e('0x24')],'\x20notify\x20',JSON[_0xfb2e('0x3e')](_0x5819f4));});})[_0xfb2e('0x3c')](function(_0x29cf6b){logger[_0xfb2e('0x3d')](_0x54cbfa[_0xfb2e('0x24')],'\x20receiveFax\x20',JSON[_0xfb2e('0x3e')](_0x29cf6b));});});}logger[_0xfb2e('0x26')](_0x54cbfa[_0xfb2e('0x24')],_0xfb2e('0x3f'));}};Fax[_0xfb2e('0x1e')][_0xfb2e('0x1d')]=function(_0x9cb828){if(this[_0xfb2e('0xf')][_0x9cb828[_0xfb2e('0x24')]]){_[_0xfb2e('0x40')](this[_0xfb2e('0xc')][_0x9cb828['uniqueid']],_['pick'](_0x9cb828,[_0xfb2e('0x41'),_0xfb2e('0x42')]));}};function updateStatus(_0x2610be){if(_0x2610be[_0xfb2e('0x43')]){faxMessage[_0xfb2e('0x44')](_0x2610be[_0xfb2e('0x43')],{'failMessage':_0xfb2e('0x45')})['then'](function(_0x184163){ut['logger'](_0xfb2e('0x46'),_0x184163);})[_0xfb2e('0x3c')](function(_0x506ba1){ut['logger'](_0xfb2e('0x47'),_0x506ba1);});}else{ut[_0xfb2e('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0xfb2e('0x49')]=function(_0x2202b6,_0x554726,_0x5c750e){var _0x1104b8=this;var _0x16dd77={};if(_0x554726){_0x16dd77={'read':_0x554726};}else{_0x16dd77={'failMessage':_0x5c750e};}if(this[_0xfb2e('0xf')][_0x2202b6]['AttachmentId']){faxMessage[_0xfb2e('0x44')](this[_0xfb2e('0xf')][_0x2202b6][_0xfb2e('0x43')],_0x16dd77)[_0xfb2e('0x4a')](function(_0x267997){ut[_0xfb2e('0x48')](_0xfb2e('0x4b'),_0x267997);})['catch'](function(_0x221565){ut['logger']('[Fax][Message][NoUpdate1]',_0x221565);})['finally'](function(){delete _0x1104b8[_0xfb2e('0xc')][_0x2202b6];delete _0x1104b8[_0xfb2e('0xf')][_0x2202b6];});}else{ut['logger'](_0xfb2e('0x4c'));delete this[_0xfb2e('0xc')][_0x2202b6];delete this[_0xfb2e('0xf')][_0x2202b6];}};Fax['prototype']['syncHangup']=function(_0x33258a){var _0x443b1c=this;if(this[_0xfb2e('0xc')][_0x33258a['uniqueid']]){if(this[_0xfb2e('0xf')][_0x33258a[_0xfb2e('0x24')]]){this['channels'][_0x33258a[_0xfb2e('0x24')]]['id']=this[_0xfb2e('0xf')][_0x33258a[_0xfb2e('0x24')]]['id'];this[_0xfb2e('0xc')][_0x33258a[_0xfb2e('0x24')]][_0xfb2e('0x25')]=this[_0xfb2e('0xf')][_0x33258a['uniqueid']][_0xfb2e('0x25')];}logger[_0xfb2e('0x26')](_0x33258a[_0xfb2e('0x24')],this[_0xfb2e('0xf')][_0x33258a[_0xfb2e('0x24')]]?_0xfb2e('0x4d'):_0xfb2e('0x4e'),JSON[_0xfb2e('0x3e')](this['channels'][_0x33258a['uniqueid']]));if(this[_0xfb2e('0xf')][_0x33258a[_0xfb2e('0x24')]]){if(this['channels'][_0x33258a[_0xfb2e('0x24')]][_0xfb2e('0x4f')]>0x0&&this['channels'][_0x33258a[_0xfb2e('0x24')]][_0xfb2e('0x18')]===_0xfb2e('0x50')){this[_0xfb2e('0x49')](_0x33258a[_0xfb2e('0x24')],!![]);}else{this[_0xfb2e('0x49')](_0x33258a[_0xfb2e('0x24')],![],this[_0xfb2e('0xc')][_0x33258a['uniqueid']]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0xfb2e('0xc')][_0x33258a[_0xfb2e('0x24')]][_0xfb2e('0x51')]:_0xfb2e('0x52'));}}}};Fax['prototype'][_0xfb2e('0x53')]=function(_0x18619b){var _0x2d73c9=this;return new BPromise(function(_0x189d26,_0xfc77a2){_0x2d73c9[_0xfb2e('0x54')](_0x18619b,_0x2d73c9[_0xfb2e('0xd')][_0x18619b['FaxAccountId']])[_0xfb2e('0x4a')](function(_0x313255){ut[_0xfb2e('0x48')](_0xfb2e('0x55'),_0x313255);_0x189d26(ut[_0xfb2e('0x56')](_0xfb2e('0x57')));})[_0xfb2e('0x3c')](function(_0xf47bcb){ut[_0xfb2e('0x48')](_0xfb2e('0x58'),_0xf47bcb);updateStatus(_0x18619b);_0xfc77a2(ut[_0xfb2e('0x56')](_0xfb2e('0x59')));});});};Fax[_0xfb2e('0x1e')][_0xfb2e('0x5a')]=function(_0x258e86){var _0x134bfd=this;return new BPromise(function(_0x45fad8,_0x154926){var _0x5eb697=_0x134bfd['checkTrunk'](_0x134bfd[_0xfb2e('0xd')][_0x258e86[_0xfb2e('0x5b')]]['Trunk'],_0x258e86);if(_0x5eb697[_0xfb2e('0x5c')]){_0x45fad8(ut[_0xfb2e('0x56')](_0xfb2e('0x5d')));}else{_0x154926(ut['message'](_0x5eb697[_0xfb2e('0x56')]));}});};function originate(_0x57e35c,_0x227545,_0xca4977){return new BPromise(function(_0x26f3dc,_0x1e78e6){if(_0xca4977){var _0x1ca7c7=util[_0xfb2e('0x5e')]('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[_0xfb2e('0x3a')](_0x57e35c[_0xfb2e('0x4')])[_0xfb2e('0x25')],_0x57e35c[_0xfb2e('0x4')]);gs[_0xfb2e('0x5f')](_0x1ca7c7)['then'](function(){_0x57e35c[_0xfb2e('0x4')]=util['format'](_0xfb2e('0x60'),path[_0xfb2e('0x3a')](_0x57e35c[_0xfb2e('0x4')])[_0xfb2e('0x61')],path['parse'](_0x57e35c['path'])[_0xfb2e('0x25')]);_0x227545[_0xfb2e('0x62')]=_0x57e35c[_0xfb2e('0x4')];ut[_0xfb2e('0x48')](_0xfb2e('0x63'),'');ami[_0xfb2e('0x64')](ut[_0xfb2e('0x65')](_0x57e35c,_0x227545))[_0xfb2e('0x4a')](function(_0x77e0f8){_0x26f3dc(_0x77e0f8);})['catch'](function(_0x8fa097){_0x1e78e6(_0x8fa097);});})[_0xfb2e('0x3c')](function(_0x87b3de){_0x1e78e6(_0x87b3de);});}else{ami['Action'](ut[_0xfb2e('0x65')](_0x57e35c,_0x227545))[_0xfb2e('0x4a')](function(_0x5e5bf8){_0x26f3dc(_0x5e5bf8);})['catch'](function(_0x4d81d5){_0x1e78e6(_0x4d81d5);});}});}Fax[_0xfb2e('0x1e')][_0xfb2e('0x54')]=function(_0x38086e,_0x323ef2){var _0x3c5657=this;return new BPromise(function(_0x54275d,_0x434356){var _0x26595d=uuid['v4']();var _0x1daf3d=ut[_0xfb2e('0x66')](_0x38086e,_0x323ef2);_0x3c5657[_0xfb2e('0xf')][_0x26595d]=new Action(_0x26595d,_0x323ef2,_0x38086e);var _0x11da00=_0x3c5657[_0xfb2e('0xf')][_0x26595d];if(path[_0xfb2e('0x3a')](_0x38086e[_0xfb2e('0x4')])[_0xfb2e('0x67')]===_0xfb2e('0x3b')){originate(_0x11da00,_0x1daf3d,!![])['then'](function(_0x3c17ab){_0x54275d(_0x3c17ab);})['catch'](function(_0x2ca6d6){_0x434356(_0x2ca6d6);});}else{originate(_0x11da00,_0x1daf3d,![])['then'](function(_0x80fd1a){_0x54275d(_0x80fd1a);})[_0xfb2e('0x3c')](function(_0x167809){_0x434356(_0x167809);});}});};Fax['prototype'][_0xfb2e('0x68')]=function(_0x134667){return!_[_0xfb2e('0x69')](_0x134667)&&!_[_0xfb2e('0x69')](_0x134667['name'])&&!_[_0xfb2e('0x69')](_0x134667[_0xfb2e('0x6a')])&&_0x134667['active']&&!_[_0xfb2e('0x69')](this[_0xfb2e('0xe')][util['format']('SIP/%s',_0x134667[_0xfb2e('0x25')])])&&!_[_0xfb2e('0x69')](this[_0xfb2e('0xe')][util[_0xfb2e('0x5e')](_0xfb2e('0x6b'),_0x134667[_0xfb2e('0x25')])][_0xfb2e('0x2f')])&&(this[_0xfb2e('0xe')][util[_0xfb2e('0x5e')](_0xfb2e('0x6b'),_0x134667['name'])]['status']==='reachable'||this['trunks'][util[_0xfb2e('0x5e')](_0xfb2e('0x6b'),_0x134667[_0xfb2e('0x25')])][_0xfb2e('0x2f')]===_0xfb2e('0x6c'));};Fax[_0xfb2e('0x1e')][_0xfb2e('0x6d')]=function(_0x5175db,_0x214085){if(!this[_0xfb2e('0x68')](_0x5175db)){ut[_0xfb2e('0x48')](_0xfb2e('0x6e'),_[_0xfb2e('0x69')](_0x5175db)?'':_0x5175db[_0xfb2e('0x25')]+_0xfb2e('0x6f'));return{'isValid':![],'message':_0xfb2e('0x70')};}if(_[_0xfb2e('0x69')](_0x214085[_0xfb2e('0x39')])){ut[_0xfb2e('0x48')](_0xfb2e('0x71'),JSON['stringify'](_0x214085));return{'isValid':![],'message':_0xfb2e('0x72')};}if(_['isNil'](_0x214085[_0xfb2e('0x4')])){ut['logger'](_0xfb2e('0x73'),JSON[_0xfb2e('0x3e')](_0x214085));return{'isValid':![],'message':_0xfb2e('0x74')};}return{'isValid':!![],'message':_0xfb2e('0x75')};};module[_0xfb2e('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 6871875..9cceb19 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 _0x7b50=['inspect','notify','resolve','then','catch','[Notify]\x20','../../../config/logger','preview','lodash'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x7b50,0x114));var _0x07b5=function(_0x287a88,_0x3cf640){_0x287a88=_0x287a88-0x0;var _0x4e7b66=_0x7b50[_0x287a88];return _0x4e7b66;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x07b5('0x0'))(_0x07b5('0x1'));var _=require(_0x07b5('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x24ef08){return function(_0x387474){logger['error'](_0x24ef08,util[_0x07b5('0x3')](_0x387474,{'showHidden':![],'depth':null}));};}exports[_0x07b5('0x4')]=function(_0x134004,_0x17feef){return BPromise[_0x07b5('0x5')]()[_0x07b5('0x6')](faxAccount['notify'](_0x134004,_0x17feef))[_0x07b5('0x7')](loggerCatch(_0x07b5('0x8')));}; \ No newline at end of file +var _0xcd93=['notify','[Notify]\x20','util','bluebird','lodash','inspect','then'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xcd93,0x1c2));var _0x3cd9=function(_0x1984d8,_0x4989b0){_0x1984d8=_0x1984d8-0x0;var _0x5877e0=_0xcd93[_0x1984d8];return _0x5877e0;};'use strict';var util=require(_0x3cd9('0x0'));var BPromise=require(_0x3cd9('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x3cd9('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x43ed6d){return function(_0x13c84e){logger['error'](_0x43ed6d,util[_0x3cd9('0x3')](_0x13c84e,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x1e2854,_0x2ec245){return BPromise['resolve']()[_0x3cd9('0x4')](faxAccount[_0x3cd9('0x5')](_0x1e2854,_0x2ec245))['catch'](loggerCatch(_0x3cd9('0x6')));}; \ 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 438a311..c720fd0 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 _0xbe5d=['execute','info','Exec\x20gs','inspect','util','fax','bluebird','child_process','exec'];(function(_0x445236,_0x98654e){var _0x77c6f0=function(_0x14e0e3){while(--_0x14e0e3){_0x445236['push'](_0x445236['shift']());}};_0x77c6f0(++_0x98654e);}(_0xbe5d,0x124));var _0xdbe5=function(_0x224f3c,_0x5d49f9){_0x224f3c=_0x224f3c-0x0;var _0x4a0fac=_0xbe5d[_0x224f3c];return _0x4a0fac;};'use strict';var util=require(_0xdbe5('0x0'));var logger=require('../../../../config/logger')(_0xdbe5('0x1'));var BPromise=require(_0xdbe5('0x2'));var exec=require(_0xdbe5('0x3'))[_0xdbe5('0x4')];exports[_0xdbe5('0x5')]=function(_0xf3cb7b){return new BPromise(function(_0x5773d0,_0x1945e0){exec(_0xf3cb7b,function(_0x569689,_0x25616c,_0x1eb0e5){logger[_0xdbe5('0x6')]('Exec\x20gs',_0x25616c);if(_0x569689){logger[_0xdbe5('0x6')](_0xdbe5('0x7'),'\x20Error\x20:',util[_0xdbe5('0x8')](_0x569689,{'showHidden':![],'depth':null}),_0x25616c,_0x1eb0e5);_0x1945e0(_0x569689);}_0x5773d0(_0x25616c);});});}; \ No newline at end of file +var _0x7586=['Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x1f9a41,_0x583cb8){var _0x548642=function(_0x4bc9d2){while(--_0x4bc9d2){_0x1f9a41['push'](_0x1f9a41['shift']());}};_0x548642(++_0x583cb8);}(_0x7586,0x139));var _0x6758=function(_0x350796,_0x1bf21f){_0x350796=_0x350796-0x0;var _0x126f19=_0x7586[_0x350796];return _0x126f19;};'use strict';var util=require('util');var logger=require(_0x6758('0x0'))(_0x6758('0x1'));var BPromise=require(_0x6758('0x2'));var exec=require(_0x6758('0x3'))[_0x6758('0x4')];exports[_0x6758('0x5')]=function(_0x1c9112){return new BPromise(function(_0x4e4e4b,_0x47398e){exec(_0x1c9112,function(_0x58689c,_0x4c33a4,_0xe973e1){logger[_0x6758('0x6')](_0x6758('0x7'),_0x4c33a4);if(_0x58689c){logger[_0x6758('0x6')](_0x6758('0x7'),_0x6758('0x8'),util[_0x6758('0x9')](_0x58689c,{'showHidden':![],'depth':null}),_0x4c33a4,_0xe973e1);_0x47398e(_0x58689c);}_0x4e4e4b(_0x4c33a4);});});}; \ 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 cc3cf94..b40659d 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 _0xa0cf=['uniqueid','originate','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction'];(function(_0x521cf6,_0x4945cd){var _0x166fab=function(_0x14057a){while(--_0x14057a){_0x521cf6['push'](_0x521cf6['shift']());}};_0x166fab(++_0x4945cd);}(_0xa0cf,0x1df));var _0xfa0c=function(_0x40eadc,_0x37af8d){_0x40eadc=_0x40eadc-0x0;var _0x6963b4=_0xa0cf[_0x40eadc];return _0x6963b4;};'use strict';var util=require(_0xfa0c('0x0'));var _=require(_0xfa0c('0x1'));var moment=require(_0xfa0c('0x2'));var logger=require(_0xfa0c('0x3'))(_0xfa0c('0x4'));exports[_0xfa0c('0x5')]=function(_0x2308be){return{'message':_0x2308be};};exports['logger']=function(_0x32e750,_0x131dfe){logger[_0xfa0c('0x6')](_0x32e750,util[_0xfa0c('0x7')](_0x131dfe,{'showHidden':![],'depth':null}));};exports[_0xfa0c('0x8')]=function(_0xe9197a,_0x55abc6){var _0x4f9530={'XMF-ECM':_0x55abc6[_0xfa0c('0x9')],'XMF-HEADERINFO':_0x55abc6[_0xfa0c('0xa')],'XMF-MINRATE':_0x55abc6[_0xfa0c('0xb')],'XMF-MAXRATE':_0x55abc6[_0xfa0c('0xc')],'XMF-MODEM':util[_0xfa0c('0xd')](_0xfa0c('0xe'),_0x55abc6[_0xfa0c('0xf')]),'XMF-GATEWAY':_0x55abc6['gateway'],'XMF-FAXDETECT':_0x55abc6[_0xfa0c('0x10')],'XMF-T38TIMEOUT':_0x55abc6[_0xfa0c('0x11')],'XMF-LOCALSTATIONID':_0x55abc6[_0xfa0c('0x12')],'XMF-PATH':_0xe9197a[_0xfa0c('0x13')]};return _0x4f9530;};exports[_0xfa0c('0x14')]=function(_0x3703e2,_0x141c57){return{'actionid':_0x3703e2[_0xfa0c('0x15')],'action':_0xfa0c('0x16'),'channel':_0x3703e2['channel'],'Exten':'xcally-motion-fax','Context':_0xfa0c('0x17'),'Priority':'1','callerid':util[_0xfa0c('0xd')](_0xfa0c('0x18'),_0x3703e2[_0xfa0c('0xa')]?_0x3703e2[_0xfa0c('0xa')]:'',_0x3703e2[_0xfa0c('0x12')]),'variable':_0x141c57,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3703e2['uniqueid']};}; \ No newline at end of file +var _0xe906=['util','lodash','moment','../../../../config/logger','fax','message','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>'];(function(_0x52cfcb,_0x34dd2c){var _0xbabb72=function(_0x5949bc){while(--_0x5949bc){_0x52cfcb['push'](_0x52cfcb['shift']());}};_0xbabb72(++_0x34dd2c);}(_0xe906,0x64));var _0x6e90=function(_0x5efb97,_0x2e56b7){_0x5efb97=_0x5efb97-0x0;var _0x8a64c5=_0xe906[_0x5efb97];return _0x8a64c5;};'use strict';var util=require(_0x6e90('0x0'));var _=require(_0x6e90('0x1'));var moment=require(_0x6e90('0x2'));var logger=require(_0x6e90('0x3'))(_0x6e90('0x4'));exports[_0x6e90('0x5')]=function(_0x2c33f7){return{'message':_0x2c33f7};};exports['logger']=function(_0x38bb3c,_0x325f75){logger['info'](_0x38bb3c,util[_0x6e90('0x6')](_0x325f75,{'showHidden':![],'depth':null}));};exports[_0x6e90('0x7')]=function(_0x33fda1,_0x54f166){var _0x3da99a={'XMF-ECM':_0x54f166[_0x6e90('0x8')],'XMF-HEADERINFO':_0x54f166[_0x6e90('0x9')],'XMF-MINRATE':_0x54f166[_0x6e90('0xa')],'XMF-MAXRATE':_0x54f166[_0x6e90('0xb')],'XMF-MODEM':util[_0x6e90('0xc')](_0x6e90('0xd'),_0x54f166[_0x6e90('0xe')]),'XMF-GATEWAY':_0x54f166[_0x6e90('0xf')],'XMF-FAXDETECT':_0x54f166[_0x6e90('0x10')],'XMF-T38TIMEOUT':_0x54f166[_0x6e90('0x11')],'XMF-LOCALSTATIONID':_0x54f166[_0x6e90('0x12')],'XMF-PATH':_0x33fda1['path']};return _0x3da99a;};exports[_0x6e90('0x13')]=function(_0x328d25,_0x53d979){return{'actionid':_0x328d25[_0x6e90('0x14')],'action':_0x6e90('0x15'),'channel':_0x328d25[_0x6e90('0x16')],'Exten':_0x6e90('0x17'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x6e90('0x18'),_0x328d25[_0x6e90('0x9')]?_0x328d25[_0x6e90('0x9')]:'',_0x328d25[_0x6e90('0x12')]),'variable':_0x53d979,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x328d25['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index bc64ff4..19bf071 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 _0xda47=['initDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','./server','./realtime','./report','./acw','./trigger','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts'];(function(_0xea46d,_0x254082){var _0x1fa4c5=function(_0x4d7817){while(--_0x4d7817){_0xea46d['push'](_0xea46d['shift']());}};_0x1fa4c5(++_0x254082);}(_0xda47,0x10a));var _0x7da4=function(_0x460666,_0x24bfa0){_0x460666=_0x460666-0x0;var _0x555cbf=_0xda47[_0x460666];return _0x555cbf;};'use strict';var BPromise=require(_0x7da4('0x0'));var util=require('util');var moment=require('moment');var server=require(_0x7da4('0x1'));var Realtime=require(_0x7da4('0x2'));var Report=require(_0x7da4('0x3'));var Acw=require(_0x7da4('0x4'));var Trigger=require(_0x7da4('0x5'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x7da4('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x7da4('0x7'));var voiceCallReport=require(_0x7da4('0x8'));var trunk=require(_0x7da4('0x9'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x7da4('0xa'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x7da4('0xb'));var zendesk=require(_0x7da4('0xc'));var salesforce=require(_0x7da4('0xd'));var sugarcrm=require(_0x7da4('0xe'));var freshdesk=require(_0x7da4('0xf'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x7da4('0x10'));var freshsales=require(_0x7da4('0x11'));var servicenow=require(_0x7da4('0x12'));var dynamics365=require(_0x7da4('0x13'));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(_0x7da4('0x14'))(_0x7da4('0x15'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7da4('0x16')](_0x7da4('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7da4('0x16')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7da4('0x18')]()[_0x7da4('0x19')](user[_0x7da4('0x1a')]())[_0x7da4('0x19')](realtime['initAgents']())[_0x7da4('0x19')](user['getTelephones']())[_0x7da4('0x19')](realtime[_0x7da4('0x1b')]())[_0x7da4('0x19')](trunk[_0x7da4('0x1c')]())[_0x7da4('0x19')](realtime[_0x7da4('0x1d')]())[_0x7da4('0x19')](voiceQueue[_0x7da4('0x1e')]())[_0x7da4('0x19')](realtime['initVoiceQueues']())[_0x7da4('0x19')](trigger[_0x7da4('0x1f')]())[_0x7da4('0x19')](realtime[_0x7da4('0x20')]())[_0x7da4('0x19')](template[_0x7da4('0x21')]())[_0x7da4('0x19')](realtime[_0x7da4('0x22')]())[_0x7da4('0x19')](zendesk[_0x7da4('0x23')]())['then'](realtime['initZendeskAccounts']())[_0x7da4('0x19')](salesforce['getSalesforceAccounts']())[_0x7da4('0x19')](realtime[_0x7da4('0x24')]())[_0x7da4('0x19')](sugarcrm[_0x7da4('0x25')]())[_0x7da4('0x19')](realtime[_0x7da4('0x26')]())['then'](freshdesk[_0x7da4('0x27')]())[_0x7da4('0x19')](realtime[_0x7da4('0x28')]())[_0x7da4('0x19')](desk[_0x7da4('0x29')]())[_0x7da4('0x19')](realtime['initDeskAccounts']())[_0x7da4('0x19')](zoho[_0x7da4('0x2a')]())['then'](realtime[_0x7da4('0x2b')]())[_0x7da4('0x19')](vtiger[_0x7da4('0x2c')]())[_0x7da4('0x19')](realtime['initVtigerAccounts']())['then'](freshsales['getFreshsalesAccounts']())[_0x7da4('0x19')](realtime[_0x7da4('0x2d')]())[_0x7da4('0x19')](servicenow[_0x7da4('0x2e')]())[_0x7da4('0x19')](realtime[_0x7da4('0x2f')]())[_0x7da4('0x19')](dynamics365[_0x7da4('0x30')]())[_0x7da4('0x19')](realtime[_0x7da4('0x31')]())[_0x7da4('0x19')](campaign[_0x7da4('0x32')]())[_0x7da4('0x19')](realtime['initCampaigns']())[_0x7da4('0x19')](voiceExtension['getVoiceExtensions']())[_0x7da4('0x19')](realtime[_0x7da4('0x33')]())[_0x7da4('0x19')](faxAccount[_0x7da4('0x34')]())['then'](realtime[_0x7da4('0x35')]())[_0x7da4('0x19')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x7da4('0x19')](voiceQueueReport[_0x7da4('0x36')]())[_0x7da4('0x19')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x7da4('0x37')]())[_0x7da4('0x19')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x7da4('0x19')](realtime[_0x7da4('0x38')]())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime['initVoiceCallReports']())['catch'](function(_0x1162e4){logger[_0x7da4('0x39')](_0x7da4('0x3a'),util[_0x7da4('0x3b')](_0x1162e4,{'showHidden':![],'depth':null}));});}function main(){return server[_0x7da4('0x3c')](realtime,preview,fax)[_0x7da4('0x19')](function(_0x566bf6){return initRealtime();})[_0x7da4('0x19')](function(){return initParams();})[_0x7da4('0x19')](function(){report[_0x7da4('0x3d')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x4b871c){logger[_0x7da4('0x39')](_0x7da4('0x3e'),util[_0x7da4('0x3b')](_0x4b871c,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xe5cb=['sync','[index.js][main]','inspect','bluebird','util','./realtime','./report','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','getTelephones','initTelephones','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','error','[index.js][initParams]','listen'];(function(_0x3a0936,_0x57ba91){var _0x324a9a=function(_0x344f73){while(--_0x344f73){_0x3a0936['push'](_0x3a0936['shift']());}};_0x324a9a(++_0x57ba91);}(_0xe5cb,0x8d));var _0xbe5c=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xe5cb[_0x58c20f];return _0x3b0318;};'use strict';var BPromise=require(_0xbe5c('0x0'));var util=require(_0xbe5c('0x1'));var moment=require('moment');var server=require('./server');var Realtime=require(_0xbe5c('0x2'));var Report=require(_0xbe5c('0x3'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0xbe5c('0x4'));var Preview=require(_0xbe5c('0x5'));var Fax=require('./fax');var user=require(_0xbe5c('0x6'));var voiceQueue=require(_0xbe5c('0x7'));var voiceQueueReport=require(_0xbe5c('0x8'));var voiceCallReport=require(_0xbe5c('0x9'));var trunk=require(_0xbe5c('0xa'));var trigger=require('./rpc/trigger');var template=require(_0xbe5c('0xb'));var cmHopperHistory=require(_0xbe5c('0xc'));var campaign=require(_0xbe5c('0xd'));var voiceExtension=require(_0xbe5c('0xe'));var faxAccount=require(_0xbe5c('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xbe5c('0x10'));var sugarcrm=require(_0xbe5c('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xbe5c('0x12'));var vtiger=require(_0xbe5c('0x13'));var freshsales=require(_0xbe5c('0x14'));var servicenow=require(_0xbe5c('0x15'));var dynamics365=require(_0xbe5c('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')(_0xbe5c('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xbe5c('0x18')](_0xbe5c('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xbe5c('0x18')](_0xbe5c('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbe5c('0x1a')]()[_0xbe5c('0x1b')](user[_0xbe5c('0x1c')]())[_0xbe5c('0x1b')](realtime['initAgents']())[_0xbe5c('0x1b')](user[_0xbe5c('0x1d')]())['then'](realtime[_0xbe5c('0x1e')]())[_0xbe5c('0x1b')](trunk['getTrunks']())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x1f')]())[_0xbe5c('0x1b')](voiceQueue['getVoiceQueues']())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x20')]())[_0xbe5c('0x1b')](trigger['getTriggers']())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x21')]())[_0xbe5c('0x1b')](template[_0xbe5c('0x22')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x23')]())[_0xbe5c('0x1b')](zendesk[_0xbe5c('0x24')]())['then'](realtime['initZendeskAccounts']())[_0xbe5c('0x1b')](salesforce[_0xbe5c('0x25')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x26')]())[_0xbe5c('0x1b')](sugarcrm[_0xbe5c('0x27')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x28')]())[_0xbe5c('0x1b')](freshdesk['getFreshdeskAccounts']())[_0xbe5c('0x1b')](realtime['initFreshdeskAccounts']())['then'](desk['getDeskAccounts']())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x29')]())['then'](zoho[_0xbe5c('0x2a')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x2b')]())[_0xbe5c('0x1b')](vtiger[_0xbe5c('0x2c')]())['then'](realtime[_0xbe5c('0x2d')]())['then'](freshsales[_0xbe5c('0x2e')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x2f')]())[_0xbe5c('0x1b')](servicenow[_0xbe5c('0x30')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x31')]())[_0xbe5c('0x1b')](dynamics365[_0xbe5c('0x32')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x33')]())[_0xbe5c('0x1b')](campaign[_0xbe5c('0x34')]())[_0xbe5c('0x1b')](realtime['initCampaigns']())['then'](voiceExtension[_0xbe5c('0x35')]())[_0xbe5c('0x1b')](realtime['initVoiceExtensions']())[_0xbe5c('0x1b')](faxAccount[_0xbe5c('0x36')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x37')]())[_0xbe5c('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0xbe5c('0x1a')]()[_0xbe5c('0x1b')](voiceQueueReport[_0xbe5c('0x38')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x39')]())['then'](cmHopperHistory[_0xbe5c('0x3a')]())['then'](realtime[_0xbe5c('0x3b')]())[_0xbe5c('0x1b')](cmHopperHistory[_0xbe5c('0x3c')]())[_0xbe5c('0x1b')](realtime[_0xbe5c('0x3d')]())[_0xbe5c('0x1b')](voiceCallReport['getVoiceCallReports']())[_0xbe5c('0x1b')](realtime['initVoiceCallReports']())[_0xbe5c('0x3e')](function(_0x3142f6){logger[_0xbe5c('0x3f')](_0xbe5c('0x40'),util['inspect'](_0x3142f6,{'showHidden':![],'depth':null}));});}function main(){return server[_0xbe5c('0x41')](realtime,preview,fax)[_0xbe5c('0x1b')](function(_0x86aca1){return initRealtime();})[_0xbe5c('0x1b')](function(){return initParams();})[_0xbe5c('0x1b')](function(){report[_0xbe5c('0x42')]();setInterval(initRealtime,0x1388);})[_0xbe5c('0x3e')](function(_0x19e609){logger[_0xbe5c('0x3f')](_0xbe5c('0x43'),util[_0xbe5c('0x44')](_0x19e609,{'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 27f7a95..3e0bc90 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x5db0fc,_0x1702bf){var _0x1cdcf1=function(_0x57f69d){while(--_0x57f69d){_0x5db0fc['push'](_0x5db0fc['shift']());}};_0x1cdcf1(++_0x1702bf);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x2c8802,_0x4ad8e4){var _0x29fefc=function(_0x92772b){while(--_0x92772b){_0x2c8802['push'](_0x2c8802['shift']());}};_0x29fefc(++_0x4ad8e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 87e3d03..9cc0a63 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 _0xa5ab=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x2eddb1,_0x5b8f97){var _0x444e5c=function(_0x2ac8c7){while(--_0x2ac8c7){_0x2eddb1['push'](_0x2eddb1['shift']());}};_0x444e5c(++_0x5b8f97);}(_0xa5ab,0xee));var _0xba5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ab[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0xdd0bb2){this['id']=_0xdd0bb2['id']||0x0;this[_0xba5a('0x0')]=_0xdd0bb2['name']||'';this[_0xba5a('0x1')]=_0xdd0bb2[_0xba5a('0x1')]||'campaign';this[_0xba5a('0x2')]=0x0;this[_0xba5a('0x3')]=0x0;this[_0xba5a('0x4')]=0x0;this[_0xba5a('0x5')]=0x0;this[_0xba5a('0x6')]='';this[_0xba5a('0x7')]=!![];this[_0xba5a('0x8')]=_0xdd0bb2[_0xba5a('0x8')];this[_0xba5a('0x9')]=_0xdd0bb2[_0xba5a('0x9')];this[_0xba5a('0xa')]=_0xdd0bb2[_0xba5a('0xa')]||null;this[_0xba5a('0xb')]=_0xdd0bb2[_0xba5a('0xb')]?_0xdd0bb2[_0xba5a('0xb')]:null;this['dialOriginateCallerIdName']=_0xdd0bb2[_0xba5a('0xc')];this[_0xba5a('0xd')]=_0xdd0bb2['dialOriginateCallerIdNumber'];this[_0xba5a('0xe')]=_0xdd0bb2[_0xba5a('0xe')]||0x1e;this[_0xba5a('0xf')]=_0xdd0bb2[_0xba5a('0xf')];this[_0xba5a('0x10')]=_0xdd0bb2['dialCongestionRetryFrequency'];this[_0xba5a('0x11')]=_0xdd0bb2[_0xba5a('0x11')];this[_0xba5a('0x12')]=_0xdd0bb2['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0xdd0bb2[_0xba5a('0x13')];this[_0xba5a('0x14')]=_0xdd0bb2[_0xba5a('0x14')];this[_0xba5a('0x15')]=_0xdd0bb2[_0xba5a('0x15')];this[_0xba5a('0x16')]=_0xdd0bb2[_0xba5a('0x16')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xdd0bb2[_0xba5a('0x17')]||0x96;this['dialDropMaxRetry']=_0xdd0bb2[_0xba5a('0x18')]||0x3;this[_0xba5a('0x19')]=_0xdd0bb2[_0xba5a('0x19')]||0x96;this[_0xba5a('0x1a')]=_0xdd0bb2['dialAbandonedMaxRetry']||0x3;this[_0xba5a('0x1b')]=_0xdd0bb2[_0xba5a('0x1b')]||0x96;this[_0xba5a('0x1c')]=_0xdd0bb2[_0xba5a('0x1c')]||0x3;this['dialMachineRetryFrequency']=_0xdd0bb2[_0xba5a('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0xdd0bb2[_0xba5a('0x1e')]||0x3;this['dialAgentRejectRetryFrequency']=_0xdd0bb2['dialAgentRejectRetryFrequency']||0x96;this[_0xba5a('0x1f')]=_0xdd0bb2[_0xba5a('0x1f')]||'DESC';this[_0xba5a('0x20')]=_0xdd0bb2[_0xba5a('0x20')]||undefined;this[_0xba5a('0x21')]=_0xdd0bb2[_0xba5a('0x21')]||undefined;this[_0xba5a('0x22')]=_0xdd0bb2[_0xba5a('0x22')]||undefined;this[_0xba5a('0x23')]=_0xdd0bb2[_0xba5a('0x23')]?_0xdd0bb2[_0xba5a('0x23')]:undefined;this[_0xba5a('0x24')]=_0xdd0bb2[_0xba5a('0x24')]?_0xdd0bb2[_0xba5a('0x24')]:undefined;this['Interval']=_0xdd0bb2[_0xba5a('0x25')]?_0xdd0bb2[_0xba5a('0x25')]:undefined;this[_0xba5a('0x26')]=_0xdd0bb2[_0xba5a('0x26')]?_0xdd0bb2['SquareProject']:undefined;this[_0xba5a('0x27')]=_0xdd0bb2['SquareProject']?_0xdd0bb2[_0xba5a('0x26')][_0xba5a('0x0')]:undefined;this[_0xba5a('0x28')]=_0xdd0bb2['dialAMDActive']||![];this[_0xba5a('0x29')]=_0xdd0bb2[_0xba5a('0x29')];this[_0xba5a('0x2a')]=_0xdd0bb2[_0xba5a('0x2a')];this[_0xba5a('0x2b')]=_0xdd0bb2[_0xba5a('0x2b')];this[_0xba5a('0x2c')]=_0xdd0bb2[_0xba5a('0x2c')];this[_0xba5a('0x2d')]=_0xdd0bb2[_0xba5a('0x2d')];this[_0xba5a('0x2e')]=_0xdd0bb2[_0xba5a('0x2e')];this[_0xba5a('0x2f')]=_0xdd0bb2[_0xba5a('0x2f')];this[_0xba5a('0x30')]=_0xdd0bb2['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0xdd0bb2[_0xba5a('0x31')];}module[_0xba5a('0x32')]=Campaign; \ No newline at end of file +var _0xa52e=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval'];(function(_0xe08aea,_0x4b8c57){var _0x1bc9e2=function(_0x200186){while(--_0x200186){_0xe08aea['push'](_0xe08aea['shift']());}};_0x1bc9e2(++_0x4b8c57);}(_0xa52e,0xc0));var _0xea52=function(_0x1f4755,_0x7c233e){_0x1f4755=_0x1f4755-0x0;var _0xcb6961=_0xa52e[_0x1f4755];return _0xcb6961;};'use strict';function Campaign(_0x14e9c2){this['id']=_0x14e9c2['id']||0x0;this[_0xea52('0x0')]=_0x14e9c2[_0xea52('0x0')]||'';this['type']=_0x14e9c2['type']||_0xea52('0x1');this[_0xea52('0x2')]=0x0;this[_0xea52('0x3')]=0x0;this[_0xea52('0x4')]=0x0;this[_0xea52('0x5')]=0x0;this[_0xea52('0x6')]='';this[_0xea52('0x7')]=!![];this[_0xea52('0x8')]=_0x14e9c2[_0xea52('0x8')];this[_0xea52('0x9')]=_0x14e9c2[_0xea52('0x9')];this[_0xea52('0xa')]=_0x14e9c2[_0xea52('0xa')]||null;this[_0xea52('0xb')]=_0x14e9c2['dialGlobalInterval']?_0x14e9c2['dialGlobalInterval']:null;this[_0xea52('0xc')]=_0x14e9c2[_0xea52('0xc')];this['dialOriginateCallerIdNumber']=_0x14e9c2[_0xea52('0xd')];this[_0xea52('0xe')]=_0x14e9c2[_0xea52('0xe')]||0x1e;this[_0xea52('0xf')]=_0x14e9c2[_0xea52('0xf')];this[_0xea52('0x10')]=_0x14e9c2[_0xea52('0x10')];this['dialBusyMaxRetry']=_0x14e9c2['dialBusyMaxRetry'];this[_0xea52('0x11')]=_0x14e9c2[_0xea52('0x11')];this['dialNoAnswerMaxRetry']=_0x14e9c2[_0xea52('0x12')];this[_0xea52('0x13')]=_0x14e9c2[_0xea52('0x13')];this[_0xea52('0x14')]=_0x14e9c2[_0xea52('0x14')];this[_0xea52('0x15')]=_0x14e9c2[_0xea52('0x15')]||0x3;this[_0xea52('0x16')]=_0x14e9c2[_0xea52('0x16')]||0x96;this[_0xea52('0x17')]=_0x14e9c2[_0xea52('0x17')]||0x3;this[_0xea52('0x18')]=_0x14e9c2[_0xea52('0x18')]||0x96;this[_0xea52('0x19')]=_0x14e9c2['dialAbandonedMaxRetry']||0x3;this[_0xea52('0x1a')]=_0x14e9c2[_0xea52('0x1a')]||0x96;this[_0xea52('0x1b')]=_0x14e9c2[_0xea52('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x14e9c2[_0xea52('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x14e9c2[_0xea52('0x1d')]||0x3;this[_0xea52('0x1e')]=_0x14e9c2[_0xea52('0x1e')]||0x96;this[_0xea52('0x1f')]=_0x14e9c2[_0xea52('0x1f')]||_0xea52('0x20');this['dialPrefix']=_0x14e9c2['dialPrefix']||undefined;this[_0xea52('0x21')]=_0x14e9c2[_0xea52('0x21')]||undefined;this[_0xea52('0x22')]=_0x14e9c2[_0xea52('0x22')]||undefined;this['TrunkBackup']=_0x14e9c2[_0xea52('0x23')]?_0x14e9c2['TrunkBackup']:undefined;this[_0xea52('0x24')]=_0x14e9c2[_0xea52('0x24')]?_0x14e9c2['Trunk']:undefined;this['Interval']=_0x14e9c2[_0xea52('0x25')]?_0x14e9c2[_0xea52('0x25')]:undefined;this['SquareProject']=_0x14e9c2[_0xea52('0x26')]?_0x14e9c2[_0xea52('0x26')]:undefined;this[_0xea52('0x27')]=_0x14e9c2[_0xea52('0x26')]?_0x14e9c2[_0xea52('0x26')][_0xea52('0x0')]:undefined;this[_0xea52('0x28')]=_0x14e9c2['dialAMDActive']||![];this[_0xea52('0x29')]=_0x14e9c2[_0xea52('0x29')];this[_0xea52('0x2a')]=_0x14e9c2['dialAMDGreeting'];this[_0xea52('0x2b')]=_0x14e9c2[_0xea52('0x2b')];this['dialAMDTotalAnalysisTime']=_0x14e9c2[_0xea52('0x2c')];this['dialAMDMinWordLength']=_0x14e9c2[_0xea52('0x2d')];this[_0xea52('0x2e')]=_0x14e9c2[_0xea52('0x2e')];this[_0xea52('0x2f')]=_0x14e9c2[_0xea52('0x2f')];this[_0xea52('0x30')]=_0x14e9c2[_0xea52('0x30')];this[_0xea52('0x31')]=_0x14e9c2[_0xea52('0x31')];}module[_0xea52('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 1277d78..a847e2b 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 _0x6d11=['answertime','endtime','unmanaged','abandoned','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel','destinationchannel','calleridname','connectedlinename','accountcode','linkedid','exten','answered'];(function(_0x3a3e30,_0x5996b5){var _0x19f849=function(_0xc6e736){while(--_0xc6e736){_0x3a3e30['push'](_0x3a3e30['shift']());}};_0x19f849(++_0x5996b5);}(_0x6d11,0xbf));var _0x16d1=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x6d11[_0x55d58f];return _0x1ad6e6;};'use strict';function Channel(){this[_0x16d1('0x0')]=null;this[_0x16d1('0x1')]='';this[_0x16d1('0x2')]='';this['calleridnum']=0x0;this[_0x16d1('0x3')]='';this['connectedlinenum']=undefined;this[_0x16d1('0x4')]=undefined;this[_0x16d1('0x5')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x16d1('0x6')]=0x0;this[_0x16d1('0x7')]=0x0;this[_0x16d1('0x8')]=![];this[_0x16d1('0x9')]=null;this[_0x16d1('0xa')]=null;this[_0x16d1('0xb')]=![];this[_0x16d1('0xc')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this[_0x16d1('0xd')]=0x0;this[_0x16d1('0xe')]=0x0;this[_0x16d1('0xf')]=null;this[_0x16d1('0x10')]=null;this['disposition']=null;this[_0x16d1('0x11')]=![];this[_0x16d1('0x12')]=null;this[_0x16d1('0x13')]=null;this[_0x16d1('0x14')]=[];this[_0x16d1('0x15')]=undefined;this[_0x16d1('0x16')]=undefined;this[_0x16d1('0x17')]=undefined;this[_0x16d1('0x18')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x286a=['monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','accountcode','linkedid','answertime','lastapplication','duration','billableseconds','holdtime','type','tag','monitor'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x286a,0x76));var _0xa286=function(_0x5abf56,_0x34e697){_0x5abf56=_0x5abf56-0x0;var _0x3aef9e=_0x286a[_0x5abf56];return _0x3aef9e;};'use strict';function Channel(){this[_0xa286('0x0')]=null;this[_0xa286('0x1')]='';this[_0xa286('0x2')]='';this[_0xa286('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0xa286('0x4')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0xa286('0x5')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xa286('0x6')]=null;this['endtime']=null;this['unmanaged']=![];this['abandoned']=![];this[_0xa286('0x7')]='';this['lastdata']='';this[_0xa286('0x8')]=0x0;this[_0xa286('0x9')]=0x0;this[_0xa286('0xa')]=0x0;this[_0xa286('0xb')]=null;this[_0xa286('0xc')]=null;this['disposition']=null;this[_0xa286('0xd')]=![];this[_0xa286('0xe')]=null;this[_0xa286('0xf')]=null;this[_0xa286('0x10')]=[];this[_0xa286('0x11')]=undefined;this[_0xa286('0x12')]=undefined;this[_0xa286('0x13')]=undefined;this[_0xa286('0x14')]=0x0;}module[_0xa286('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a5341e1..1236f80 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 _0xfbf7=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x459349,_0x2e6797){var _0x35de00=function(_0x1f5a19){while(--_0x1f5a19){_0x459349['push'](_0x459349['shift']());}};_0x35de00(++_0x2e6797);}(_0xfbf7,0x1b4));var _0x7fbf=function(_0x5d8cfe,_0x4783d6){_0x5d8cfe=_0x5d8cfe-0x0;var _0x5cfc18=_0xfbf7[_0x5d8cfe];return _0x5cfc18;};'use strict';function DeskAccount(_0x290538){this['id']=_0x290538['id']||0x0;this[_0x7fbf('0x0')]=_0x290538[_0x7fbf('0x0')]||'';this['username']=_0x290538[_0x7fbf('0x1')]||'';this[_0x7fbf('0x2')]=_0x290538[_0x7fbf('0x2')]||'';this[_0x7fbf('0x3')]=_0x290538[_0x7fbf('0x3')]||'';this[_0x7fbf('0x4')]=_0x290538['password']||'';this[_0x7fbf('0x5')]=_0x290538['consumerKey']||'';this['consumerSecret']=_0x290538[_0x7fbf('0x6')]||'';this[_0x7fbf('0x7')]=_0x290538[_0x7fbf('0x7')]||'';this[_0x7fbf('0x8')]=_0x290538[_0x7fbf('0x8')]||'';this[_0x7fbf('0x9')]=_0x290538[_0x7fbf('0x9')]||'';this['serverUrl']=_0x290538[_0x7fbf('0xa')]||'';this['Configurations']=_0x290538[_0x7fbf('0xb')]||{};}module[_0x7fbf('0xc')]=DeskAccount; \ No newline at end of file +var _0x6c81=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x6c81,0x1bb));var _0x16c8=function(_0x1765c4,_0x151565){_0x1765c4=_0x1765c4-0x0;var _0x56645f=_0x6c81[_0x1765c4];return _0x56645f;};'use strict';function DeskAccount(_0x21770c){this['id']=_0x21770c['id']||0x0;this[_0x16c8('0x0')]=_0x21770c[_0x16c8('0x0')]||'';this[_0x16c8('0x1')]=_0x21770c[_0x16c8('0x1')]||'';this[_0x16c8('0x2')]=_0x21770c['remoteUri']||'';this[_0x16c8('0x3')]=_0x21770c[_0x16c8('0x3')]||'';this[_0x16c8('0x4')]=_0x21770c[_0x16c8('0x4')]||'';this[_0x16c8('0x5')]=_0x21770c[_0x16c8('0x5')]||'';this[_0x16c8('0x6')]=_0x21770c['consumerSecret']||'';this[_0x16c8('0x7')]=_0x21770c[_0x16c8('0x7')]||'';this[_0x16c8('0x8')]=_0x21770c[_0x16c8('0x8')]||'';this['type']=_0x21770c[_0x16c8('0x9')]||'';this['serverUrl']=_0x21770c[_0x16c8('0xa')]||'';this[_0x16c8('0xb')]=_0x21770c[_0x16c8('0xb')]||{};}module[_0x16c8('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 70005a5..a47e741 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 _0xe98a=['Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientSecret','serverUrl','modernAuthentication'];(function(_0x21775c,_0x160bdd){var _0x2e6351=function(_0x5d19e7){while(--_0x5d19e7){_0x21775c['push'](_0x21775c['shift']());}};_0x2e6351(++_0x160bdd);}(_0xe98a,0x1f2));var _0xae98=function(_0x28509b,_0x5831ff){_0x28509b=_0x28509b-0x0;var _0x1e0b6=_0xe98a[_0x28509b];return _0x1e0b6;};'use strict';function Dynamics365Account(_0x59f059){this['id']=_0x59f059['id']||0x0;this[_0xae98('0x0')]=_0x59f059[_0xae98('0x0')]||'';this[_0xae98('0x1')]=_0x59f059['username']||'';this[_0xae98('0x2')]=_0x59f059['password']||'';this['remoteUri']=_0x59f059[_0xae98('0x3')]||'';this[_0xae98('0x4')]=_0x59f059[_0xae98('0x4')]||'';this['clientId']=_0x59f059['clientId']||'';this['clientSecret']=_0x59f059[_0xae98('0x5')]||{};this[_0xae98('0x6')]=_0x59f059[_0xae98('0x6')]||'';this[_0xae98('0x7')]=_0x59f059[_0xae98('0x7')]||![];this[_0xae98('0x8')]=_0x59f059['Configurations']||{};this[_0xae98('0x9')]=_0x59f059[_0xae98('0x9')]||{};}module[_0xae98('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x0e64=['clientSecret','serverUrl','modernAuthentication','CloudProvider','exports','name','username','password','remoteUri','tenantId'];(function(_0x5058d4,_0x5c9315){var _0x527bc5=function(_0x52ef4d){while(--_0x52ef4d){_0x5058d4['push'](_0x5058d4['shift']());}};_0x527bc5(++_0x5c9315);}(_0x0e64,0xc3));var _0x40e6=function(_0x5a57d1,_0x5ac1a8){_0x5a57d1=_0x5a57d1-0x0;var _0x4b582c=_0x0e64[_0x5a57d1];return _0x4b582c;};'use strict';function Dynamics365Account(_0x5c230e){this['id']=_0x5c230e['id']||0x0;this[_0x40e6('0x0')]=_0x5c230e[_0x40e6('0x0')]||'';this[_0x40e6('0x1')]=_0x5c230e[_0x40e6('0x1')]||'';this[_0x40e6('0x2')]=_0x5c230e['password']||'';this[_0x40e6('0x3')]=_0x5c230e[_0x40e6('0x3')]||'';this['tenantId']=_0x5c230e[_0x40e6('0x4')]||'';this['clientId']=_0x5c230e['clientId']||'';this['clientSecret']=_0x5c230e[_0x40e6('0x5')]||{};this[_0x40e6('0x6')]=_0x5c230e[_0x40e6('0x6')]||'';this[_0x40e6('0x7')]=_0x5c230e['modernAuthentication']||![];this['Configurations']=_0x5c230e['Configurations']||{};this['CloudProvider']=_0x5c230e[_0x40e6('0x8')]||{};}module[_0x40e6('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 130c423..abf7f76 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 _0x0856=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','t38timeout','tech','Trunk','ListId'];(function(_0x597639,_0x344d77){var _0x3aab4b=function(_0x4c36ce){while(--_0x4c36ce){_0x597639['push'](_0x597639['shift']());}};_0x3aab4b(++_0x344d77);}(_0x0856,0x1a6));var _0x6085=function(_0x25d326,_0x3327e5){_0x25d326=_0x25d326-0x0;var _0x5081f4=_0x0856[_0x25d326];return _0x5081f4;};'use strict';function FaxAccount(_0xeee5bb){this['id']=_0xeee5bb['id']||0x0;this['name']=_0xeee5bb[_0x6085('0x0')]||'';this[_0x6085('0x1')]=_0xeee5bb[_0x6085('0x1')];this['ecm']=_0xeee5bb[_0x6085('0x2')];this[_0x6085('0x3')]=_0xeee5bb['headerinfo'];this[_0x6085('0x4')]=_0xeee5bb[_0x6085('0x4')];this[_0x6085('0x5')]=_0xeee5bb[_0x6085('0x5')]||0x960;this['maxrate']=_0xeee5bb[_0x6085('0x6')]||0x3840;this['modem']=_0xeee5bb[_0x6085('0x7')]||'v17,v27,v29';this[_0x6085('0x8')]=_0xeee5bb[_0x6085('0x8')]||'no';this['faxdetect']=_0xeee5bb['faxdetect']||'no';this[_0x6085('0x9')]=_0xeee5bb['t38timeout']||0x1388;this['tech']=_0xeee5bb[_0x6085('0xa')]||'SIP';this['Trunk']=_0xeee5bb[_0x6085('0xb')]?_0xeee5bb[_0x6085('0xb')]:undefined;this[_0x6085('0xc')]=_0xeee5bb[_0x6085('0xc')];this[_0x6085('0xd')]=_0xeee5bb[_0x6085('0xd')];}module[_0x6085('0xe')]=FaxAccount; \ No newline at end of file +var _0x663b=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x663b,0x119));var _0xb663=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x663b[_0x2c91e9];return _0x13f0ff;};'use strict';function FaxAccount(_0x4b1a25){this['id']=_0x4b1a25['id']||0x0;this[_0xb663('0x0')]=_0x4b1a25[_0xb663('0x0')]||'';this['description']=_0x4b1a25[_0xb663('0x1')];this[_0xb663('0x2')]=_0x4b1a25[_0xb663('0x2')];this[_0xb663('0x3')]=_0x4b1a25[_0xb663('0x3')];this[_0xb663('0x4')]=_0x4b1a25[_0xb663('0x4')];this[_0xb663('0x5')]=_0x4b1a25[_0xb663('0x5')]||0x960;this[_0xb663('0x6')]=_0x4b1a25[_0xb663('0x6')]||0x3840;this[_0xb663('0x7')]=_0x4b1a25['modem']||_0xb663('0x8');this[_0xb663('0x9')]=_0x4b1a25['gateway']||'no';this[_0xb663('0xa')]=_0x4b1a25[_0xb663('0xa')]||'no';this['t38timeout']=_0x4b1a25[_0xb663('0xb')]||0x1388;this[_0xb663('0xc')]=_0x4b1a25[_0xb663('0xc')]||_0xb663('0xd');this[_0xb663('0xe')]=_0x4b1a25[_0xb663('0xe')]?_0x4b1a25[_0xb663('0xe')]:undefined;this[_0xb663('0xf')]=_0x4b1a25[_0xb663('0xf')];this['key']=_0x4b1a25[_0xb663('0x10')];}module[_0xb663('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index f9c1765..ec8494d 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 _0xf4cc=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x454eba,_0x5a03c7){var _0x46dadb=function(_0x613679){while(--_0x613679){_0x454eba['push'](_0x454eba['shift']());}};_0x46dadb(++_0x5a03c7);}(_0xf4cc,0x9a));var _0xcf4c=function(_0x15f98b,_0xc40f33){_0x15f98b=_0x15f98b-0x0;var _0x2ede41=_0xf4cc[_0x15f98b];return _0x2ede41;};'use strict';function FreshdeskAccount(_0x4aff45){this['id']=_0x4aff45['id']||0x0;this['name']=_0x4aff45[_0xcf4c('0x0')]||'';this[_0xcf4c('0x1')]=_0x4aff45[_0xcf4c('0x1')]||'';this[_0xcf4c('0x2')]=_0x4aff45['token']||'';this['remoteUri']=_0x4aff45[_0xcf4c('0x3')]||'';this[_0xcf4c('0x4')]=_0x4aff45[_0xcf4c('0x4')]||'';this[_0xcf4c('0x5')]=_0x4aff45['Configurations']||{};}module[_0xcf4c('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xd572=['remoteUri','Configurations','exports','name','username','token'];(function(_0x556049,_0x1112b9){var _0x24008c=function(_0x55e1fd){while(--_0x55e1fd){_0x556049['push'](_0x556049['shift']());}};_0x24008c(++_0x1112b9);}(_0xd572,0xc3));var _0x2d57=function(_0x332593,_0x5b94ed){_0x332593=_0x332593-0x0;var _0x299182=_0xd572[_0x332593];return _0x299182;};'use strict';function FreshdeskAccount(_0x2d5b94){this['id']=_0x2d5b94['id']||0x0;this['name']=_0x2d5b94[_0x2d57('0x0')]||'';this['username']=_0x2d5b94[_0x2d57('0x1')]||'';this['apiKey']=_0x2d5b94[_0x2d57('0x2')]||'';this[_0x2d57('0x3')]=_0x2d5b94[_0x2d57('0x3')]||'';this['serverUrl']=_0x2d5b94['serverUrl']||'';this[_0x2d57('0x4')]=_0x2d5b94[_0x2d57('0x4')]||{};}module[_0x2d57('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 8fb5b46..dec3aab 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 _0xc492=['apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x28ac70,_0x2740c0){var _0x1b8b77=function(_0x1bb64d){while(--_0x1bb64d){_0x28ac70['push'](_0x28ac70['shift']());}};_0x1b8b77(++_0x2740c0);}(_0xc492,0xd7));var _0x2c49=function(_0x3e9004,_0x4f508f){_0x3e9004=_0x3e9004-0x0;var _0x348439=_0xc492[_0x3e9004];return _0x348439;};'use strict';function FreshsalesAccount(_0x2af690){this['id']=_0x2af690['id']||0x0;this[_0x2c49('0x0')]=_0x2af690[_0x2c49('0x0')]||'';this['username']=_0x2af690['username']||'';this[_0x2c49('0x1')]=_0x2af690['token']||'';this['remoteUri']=_0x2af690[_0x2c49('0x2')]||'';this[_0x2c49('0x3')]=_0x2af690['serverUrl']||'';this[_0x2c49('0x4')]=_0x2af690['Configurations']||{};}module[_0x2c49('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x71ad=['name','username','apiKey','token','remoteUri','Configurations','exports'];(function(_0x5df2ff,_0x48300e){var _0x594f25=function(_0x1f5788){while(--_0x1f5788){_0x5df2ff['push'](_0x5df2ff['shift']());}};_0x594f25(++_0x48300e);}(_0x71ad,0xee));var _0xd71a=function(_0x4cdb27,_0x4a0e50){_0x4cdb27=_0x4cdb27-0x0;var _0x293e2b=_0x71ad[_0x4cdb27];return _0x293e2b;};'use strict';function FreshsalesAccount(_0x415f68){this['id']=_0x415f68['id']||0x0;this[_0xd71a('0x0')]=_0x415f68['name']||'';this[_0xd71a('0x1')]=_0x415f68['username']||'';this[_0xd71a('0x2')]=_0x415f68[_0xd71a('0x3')]||'';this['remoteUri']=_0x415f68[_0xd71a('0x4')]||'';this['serverUrl']=_0x415f68['serverUrl']||'';this[_0xd71a('0x5')]=_0x415f68['Configurations']||{};}module[_0xd71a('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 4797243..38ea9c0 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 _0x5732=['accountcode','context','exten','priority','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5732,0x184));var _0x2573=function(_0x2120f6,_0x2c4968){_0x2120f6=_0x2120f6-0x0;var _0x60623b=_0x5732[_0x2120f6];return _0x60623b;};'use strict';function QueueReport(){this[_0x2573('0x0')]=_0x2573('0x1');this[_0x2573('0x2')]='';this[_0x2573('0x3')]='';this['calleridname']='';this[_0x2573('0x4')]='';this[_0x2573('0x5')]=null;this[_0x2573('0x6')]=null;this[_0x2573('0x7')]=0x1;this[_0x2573('0x8')]=0x1;this[_0x2573('0x9')]=![];this[_0x2573('0xa')]=null;this[_0x2573('0xb')]=![];this['queuecallercompleteAt']=null;this[_0x2573('0xc')]=![];this[_0x2573('0xd')]=null;this['originalposition']=0x1;this[_0x2573('0xe')]='';this[_0x2573('0xf')]='';this[_0x2573('0x10')]='';this[_0x2573('0x11')]='';this[_0x2573('0x12')]='';this[_0x2573('0x13')]='';this[_0x2573('0x14')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x2573('0x15')]='';this[_0x2573('0x16')]=_0x2573('0x17');this[_0x2573('0x18')]=0x0;this[_0x2573('0x19')]={};}module[_0x2573('0x1a')]=QueueReport; \ No newline at end of file +var _0x78a9=['voice','mohtime','variables','type','inbound','uniqueid','calleridnum','queue','queuecallerleaveAt','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo'];(function(_0x49b5f8,_0x476d30){var _0x1f8a41=function(_0x15a010){while(--_0x15a010){_0x49b5f8['push'](_0x49b5f8['shift']());}};_0x1f8a41(++_0x476d30);}(_0x78a9,0x153));var _0x978a=function(_0x2f20f2,_0x2fff6c){_0x2f20f2=_0x2f20f2-0x0;var _0x2c8b1f=_0x78a9[_0x2f20f2];return _0x2c8b1f;};'use strict';function QueueReport(){this[_0x978a('0x0')]=_0x978a('0x1');this[_0x978a('0x2')]='';this[_0x978a('0x3')]='';this['calleridname']='';this[_0x978a('0x4')]='';this['queuecallerjoinAt']=null;this[_0x978a('0x5')]=null;this['position']=0x1;this[_0x978a('0x6')]=0x1;this[_0x978a('0x7')]=![];this['queuecallerabandonAt']=null;this[_0x978a('0x8')]=![];this[_0x978a('0x9')]=null;this[_0x978a('0xa')]=![];this[_0x978a('0xb')]=null;this['originalposition']=0x1;this[_0x978a('0xc')]='';this[_0x978a('0xd')]='';this[_0x978a('0xe')]='';this[_0x978a('0xf')]='';this[_0x978a('0x10')]='';this[_0x978a('0x11')]='';this[_0x978a('0x12')]='';this[_0x978a('0x13')]=0x0;this['assigned']=![];this[_0x978a('0x14')]='';this['motionChannel']=_0x978a('0x15');this[_0x978a('0x16')]=0x0;this[_0x978a('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index e0ad482..9d66737 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 _0x71a1=['securityToken','type','integrationTab','serverUrl','Configurations','name','username','password','clientSecret'];(function(_0x6f4352,_0x3286e9){var _0x390d33=function(_0x4f59a0){while(--_0x4f59a0){_0x6f4352['push'](_0x6f4352['shift']());}};_0x390d33(++_0x3286e9);}(_0x71a1,0x1eb));var _0x171a=function(_0x34c54e,_0x1bc4cd){_0x34c54e=_0x34c54e-0x0;var _0x123957=_0x71a1[_0x34c54e];return _0x123957;};'use strict';function SalesforceAccount(_0xe63e10){this['id']=_0xe63e10['id']||0x0;this[_0x171a('0x0')]=_0xe63e10[_0x171a('0x0')]||'';this[_0x171a('0x1')]=_0xe63e10[_0x171a('0x1')]||'';this['remoteUri']=_0xe63e10['remoteUri']||'';this[_0x171a('0x2')]=_0xe63e10[_0x171a('0x2')]||'';this['clientId']=_0xe63e10['clientId']||'';this[_0x171a('0x3')]=_0xe63e10[_0x171a('0x3')]||'';this['securityToken']=_0xe63e10[_0x171a('0x4')]||'';this[_0x171a('0x5')]=_0xe63e10[_0x171a('0x5')]||_0x171a('0x6');this[_0x171a('0x7')]=_0xe63e10[_0x171a('0x7')]||'';this[_0x171a('0x8')]=_0xe63e10[_0x171a('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x0895=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username'];(function(_0xe37cad,_0x9fcbdd){var _0x24593e=function(_0x4170bb){while(--_0x4170bb){_0xe37cad['push'](_0xe37cad['shift']());}};_0x24593e(++_0x9fcbdd);}(_0x0895,0x1a0));var _0x5089=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0895[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x271b5a){this['id']=_0x271b5a['id']||0x0;this[_0x5089('0x0')]=_0x271b5a['name']||'';this[_0x5089('0x1')]=_0x271b5a[_0x5089('0x1')]||'';this['remoteUri']=_0x271b5a[_0x5089('0x2')]||'';this['password']=_0x271b5a[_0x5089('0x3')]||'';this[_0x5089('0x4')]=_0x271b5a[_0x5089('0x4')]||'';this['clientSecret']=_0x271b5a[_0x5089('0x5')]||'';this[_0x5089('0x6')]=_0x271b5a[_0x5089('0x6')]||'';this[_0x5089('0x7')]=_0x271b5a[_0x5089('0x7')]||_0x5089('0x8');this[_0x5089('0x9')]=_0x271b5a[_0x5089('0x9')]||'';this[_0x5089('0xa')]=_0x271b5a[_0x5089('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 7873da9..6f97395 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 _0x8e12=['name','username','password','remoteUri','serverUrl','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8e12,0x66));var _0x28e1=function(_0x3d6610,_0x2799d4){_0x3d6610=_0x3d6610-0x0;var _0x434e14=_0x8e12[_0x3d6610];return _0x434e14;};'use strict';function ServicenowAccount(_0x56389e){this['id']=_0x56389e['id']||0x0;this[_0x28e1('0x0')]=_0x56389e[_0x28e1('0x0')]||'';this[_0x28e1('0x1')]=_0x56389e[_0x28e1('0x1')]||'';this[_0x28e1('0x2')]=_0x56389e['password']||'';this[_0x28e1('0x3')]=_0x56389e[_0x28e1('0x3')]||'';this['serverUrl']=_0x56389e[_0x28e1('0x4')]||'';this['Configurations']=_0x56389e['Configurations']||{};}module[_0x28e1('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x65ad=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x31b88d,_0x32e9ef){var _0x1128c9=function(_0x243665){while(--_0x243665){_0x31b88d['push'](_0x31b88d['shift']());}};_0x1128c9(++_0x32e9ef);}(_0x65ad,0x18b));var _0xd65a=function(_0x4f3e05,_0x3175f0){_0x4f3e05=_0x4f3e05-0x0;var _0x2c546e=_0x65ad[_0x4f3e05];return _0x2c546e;};'use strict';function ServicenowAccount(_0x5e39fa){this['id']=_0x5e39fa['id']||0x0;this[_0xd65a('0x0')]=_0x5e39fa[_0xd65a('0x0')]||'';this[_0xd65a('0x1')]=_0x5e39fa[_0xd65a('0x1')]||'';this[_0xd65a('0x2')]=_0x5e39fa['password']||'';this[_0xd65a('0x3')]=_0x5e39fa['remoteUri']||'';this[_0xd65a('0x4')]=_0x5e39fa[_0xd65a('0x4')]||'';this[_0xd65a('0x5')]=_0x5e39fa[_0xd65a('0x5')]||{};}module[_0xd65a('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 1c1f834..4ca1724 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 _0x615a=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x360289,_0x21e57e){var _0x33b2c2=function(_0x567552){while(--_0x567552){_0x360289['push'](_0x360289['shift']());}};_0x33b2c2(++_0x21e57e);}(_0x615a,0x8d));var _0xa615=function(_0x4f02ac,_0x5b385e){_0x4f02ac=_0x4f02ac-0x0;var _0x463598=_0x615a[_0x4f02ac];return _0x463598;};'use strict';function SugarcrmAccount(_0x4da70e){this['id']=_0x4da70e['id']||0x0;this[_0xa615('0x0')]=_0x4da70e[_0xa615('0x0')]||'';this[_0xa615('0x1')]=_0x4da70e[_0xa615('0x1')]||'';this[_0xa615('0x2')]=_0x4da70e[_0xa615('0x2')]||'';this[_0xa615('0x3')]=_0x4da70e[_0xa615('0x3')]||'';this[_0xa615('0x4')]=_0x4da70e[_0xa615('0x4')]||'';this[_0xa615('0x5')]=_0x4da70e['Configurations']||{};}module[_0xa615('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xe249=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x32f99b,_0x5b53cf){var _0x23236f=function(_0x507249){while(--_0x507249){_0x32f99b['push'](_0x32f99b['shift']());}};_0x23236f(++_0x5b53cf);}(_0xe249,0xe1));var _0x9e24=function(_0x467f23,_0x3cea06){_0x467f23=_0x467f23-0x0;var _0x1287a4=_0xe249[_0x467f23];return _0x1287a4;};'use strict';function SugarcrmAccount(_0x3d72d2){this['id']=_0x3d72d2['id']||0x0;this[_0x9e24('0x0')]=_0x3d72d2[_0x9e24('0x0')]||'';this[_0x9e24('0x1')]=_0x3d72d2[_0x9e24('0x1')]||'';this[_0x9e24('0x2')]=_0x3d72d2[_0x9e24('0x2')]||'';this[_0x9e24('0x3')]=_0x3d72d2[_0x9e24('0x3')]||'';this[_0x9e24('0x4')]=_0x3d72d2[_0x9e24('0x4')]||'';this[_0x9e24('0x5')]=_0x3d72d2[_0x9e24('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index e41a449..d1cdc3b 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 _0xa30e=['unknown','address','exports','name','accountcode','state'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa30e,0x117));var _0xea30=function(_0x5384ae,_0x32e603){_0x5384ae=_0x5384ae-0x0;var _0x4bcf2d=_0xa30e[_0x5384ae];return _0x4bcf2d;};'use strict';function Telephone(_0xe43fb2){this['id']=_0xe43fb2['id']||0x0;this[_0xea30('0x0')]=_0xe43fb2[_0xea30('0x0')]||'';this[_0xea30('0x1')]=_0xe43fb2[_0xea30('0x1')]||'';this[_0xea30('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0xea30('0x3');this[_0xea30('0x4')]='';}module[_0xea30('0x5')]=Telephone; \ No newline at end of file +var _0x8aec=['status','exports','name','accountcode','state','unknown','stateTime'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x8aec,0x1a6));var _0xc8ae=function(_0x3f43f0,_0x456803){_0x3f43f0=_0x3f43f0-0x0;var _0x408fb1=_0x8aec[_0x3f43f0];return _0x408fb1;};'use strict';function Telephone(_0x745fd1){this['id']=_0x745fd1['id']||0x0;this['name']=_0x745fd1[_0xc8ae('0x0')]||'';this[_0xc8ae('0x1')]=_0x745fd1[_0xc8ae('0x1')]||'';this[_0xc8ae('0x2')]=_0xc8ae('0x3');this[_0xc8ae('0x4')]=0x0;this[_0xc8ae('0x5')]=_0xc8ae('0x3');this['address']='';}module[_0xc8ae('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 3cd6554..645a7f2 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x33fc4e,_0x49a716){var _0x115bfa=function(_0x57fbe9){while(--_0x57fbe9){_0x33fc4e['push'](_0x33fc4e['shift']());}};_0x115bfa(++_0x49a716);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x27a14d,_0x241afe){var _0x4d4844=function(_0xed51e6){while(--_0xed51e6){_0x27a14d['push'](_0x27a14d['shift']());}};_0x4d4844(++_0x241afe);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ccbc7,_0x3093c8){_0x3ccbc7=_0x3ccbc7-0x0;var _0x50c97a=_0xb10b[_0x3ccbc7];return _0x50c97a;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index d1ea29c..4bbfeb4 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(_0x24c2d7,_0x164771){var _0x8b3f04=function(_0x1e705a){while(--_0x1e705a){_0x24c2d7['push'](_0x24c2d7['shift']());}};_0x8b3f04(++_0x164771);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x114d98,_0x39f790){_0x114d98=_0x114d98-0x0;var _0x318b3f=_0x9ffd[_0x114d98];return _0x318b3f;};'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 _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1a85,0x178));var _0x51a8=function(_0x6d0143,_0x3d7c30){_0x6d0143=_0x6d0143-0x0;var _0x29cb75=_0x1a85[_0x6d0143];return _0x29cb75;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f3c9d09..ddb4c26 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 _0xf8ca=['domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','host','port'];(function(_0x4e158a,_0x31b81e){var _0x168261=function(_0xdfa847){while(--_0xdfa847){_0x4e158a['push'](_0x4e158a['shift']());}};_0x168261(++_0x31b81e);}(_0xf8ca,0x107));var _0xaf8c=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xf8ca[_0x58dc25];return _0x21b0a7;};'use strict';function Trunk(_0x361525){this['id']=_0x361525['id']||0x0;this[_0xaf8c('0x0')]=_0x361525[_0xaf8c('0x0')]||![];this['name']=_0x361525[_0xaf8c('0x1')]||'';this[_0xaf8c('0x2')]=_0xaf8c('0x3');this['stateTime']=0x0;this[_0xaf8c('0x4')]=_0xaf8c('0x3');this[_0xaf8c('0x5')]=_0x361525[_0xaf8c('0x5')]&&_0x361525[_0xaf8c('0x5')][_0xaf8c('0x6')](':')?_0x361525['registry']['split'](':')[0x0]:'';this[_0xaf8c('0x7')]='';this[_0xaf8c('0x8')]='';this[_0xaf8c('0x9')]='';this[_0xaf8c('0xa')]='';this[_0xaf8c('0xb')]='';this[_0xaf8c('0xc')]=_0xaf8c('0x3');this['registrationtime']='';this[_0xaf8c('0xd')]='';this[_0xaf8c('0xe')]=_0x361525[_0xaf8c('0xe')]||'';}module[_0xaf8c('0xf')]=Trunk; \ No newline at end of file +var _0xd784=['active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domain','refresh','stateRegistry','defaultuser','exports'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0xd784,0x1a4));var _0x4d78=function(_0x520c7d,_0x1ecf31){_0x520c7d=_0x520c7d-0x0;var _0x4efff2=_0xd784[_0x520c7d];return _0x4efff2;};'use strict';function Trunk(_0xfb95ee){this['id']=_0xfb95ee['id']||0x0;this['active']=_0xfb95ee[_0x4d78('0x0')]||![];this[_0x4d78('0x1')]=_0xfb95ee[_0x4d78('0x1')]||'';this['state']=_0x4d78('0x2');this[_0x4d78('0x3')]=0x0;this[_0x4d78('0x4')]='unknown';this[_0x4d78('0x5')]=_0xfb95ee[_0x4d78('0x5')]&&_0xfb95ee[_0x4d78('0x5')][_0x4d78('0x6')](':')?_0xfb95ee[_0x4d78('0x5')][_0x4d78('0x7')](':')[0x0]:'';this[_0x4d78('0x8')]='';this[_0x4d78('0x9')]='';this[_0x4d78('0xa')]='';this['domainport']='';this[_0x4d78('0xb')]='';this[_0x4d78('0xc')]=_0x4d78('0x2');this['registrationtime']='';this['address']='';this[_0x4d78('0xd')]=_0xfb95ee[_0x4d78('0xd')]||'';}module[_0x4d78('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 3a364d3..ba02c97 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 _0xfdd4=['recordingFormat','exports','exten'];(function(_0x4c67e1,_0xbfa4f){var _0x53ef74=function(_0x3fc9b2){while(--_0x3fc9b2){_0x4c67e1['push'](_0x4c67e1['shift']());}};_0x53ef74(++_0xbfa4f);}(_0xfdd4,0x18b));var _0x4fdd=function(_0x41cf07,_0x18b087){_0x41cf07=_0x41cf07-0x0;var _0x54e273=_0xfdd4[_0x41cf07];return _0x54e273;};'use strict';function voiceExtension(_0x547da2){this['id']=_0x547da2['id']||0x0;this['exten']=_0x547da2[_0x4fdd('0x0')]||'';this[_0x4fdd('0x1')]=_0x547da2[_0x4fdd('0x1')]||'none';this['mandatoryDisposition']=_0x547da2['mandatoryDisposition']||![];}module[_0x4fdd('0x2')]=voiceExtension; \ No newline at end of file +var _0xa82c=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0xa82c,0x8e));var _0xca82=function(_0x12f242,_0x2e1fe5){_0x12f242=_0x12f242-0x0;var _0x5dd3de=_0xa82c[_0x12f242];return _0x5dd3de;};'use strict';function voiceExtension(_0x31e277){this['id']=_0x31e277['id']||0x0;this[_0xca82('0x0')]=_0x31e277[_0xca82('0x0')]||'';this[_0xca82('0x1')]=_0x31e277['recordingFormat']||_0xca82('0x2');this[_0xca82('0x3')]=_0x31e277[_0xca82('0x3')]||![];}module[_0xca82('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 c42c468..aa1bf06 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 _0xde55=['dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xde55,0x12c));var _0x5de5=function(_0x2d446e,_0x236f6d){_0x2d446e=_0x2d446e-0x0;var _0x1d2c42=_0xde55[_0x2d446e];return _0x1d2c42;};'use strict';var statusDesc=[_0x5de5('0x0'),_0x5de5('0x1'),_0x5de5('0x2'),_0x5de5('0x3'),_0x5de5('0x4'),_0x5de5('0x5'),_0x5de5('0x6'),_0x5de5('0x7'),'onhold'];var monitorFormat={'wav':_0x5de5('0x8'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0x5de5('0x9'),'roundrobin':_0x5de5('0xa')};function VoiceQueue(_0x552403){this['id']=_0x552403['id']||0x0;this[_0x5de5('0xb')]=_0x552403[_0x5de5('0xb')]||'';this[_0x5de5('0xc')]=_0x552403[_0x5de5('0xc')]||'';this[_0x5de5('0xd')]=_0x552403[_0x5de5('0xd')]||_0x5de5('0xe');this[_0x5de5('0xf')]=0x0;this[_0x5de5('0x10')]=0x0;this[_0x5de5('0x11')]=0x0;this[_0x5de5('0x12')]=0x0;this[_0x5de5('0x13')]=0x0;this['sumHoldTime']=0x0;this[_0x5de5('0x14')]=0x0;this[_0x5de5('0x15')]=0x0;this[_0x5de5('0x16')]=0x0;this[_0x5de5('0x17')]=0x0;this[_0x5de5('0x18')]=0x0;this[_0x5de5('0x19')]=_0x552403[_0x5de5('0x19')]||![];this[_0x5de5('0x1a')]=_0x552403[_0x5de5('0x1a')]||0xa;this[_0x5de5('0x1b')]=_0x552403[_0x5de5('0x1b')]||'no';this[_0x5de5('0x1c')]=!![];this['message']='';this[_0x5de5('0x1d')]=0x0;this[_0x5de5('0x1e')]=0x0;this['dialTimezone']=_0x552403[_0x5de5('0x1f')]||null;this[_0x5de5('0x20')]=_0x552403[_0x5de5('0x20')]?_0x552403['dialGlobalInterval']:null;this[_0x5de5('0x21')]=_0x552403[_0x5de5('0x21')];this[_0x5de5('0x22')]=_0x552403['dialMethod']||_0x5de5('0x23');this[_0x5de5('0x24')]=_0x552403[_0x5de5('0x24')]||0x0;this[_0x5de5('0x25')]=_0x552403[_0x5de5('0x25')]||0x0;this[_0x5de5('0x26')]=_0x552403[_0x5de5('0x26')]||0x1;this[_0x5de5('0x27')]=_0x552403[_0x5de5('0x27')]||_0x5de5('0x28');this[_0x5de5('0x29')]=_0x552403[_0x5de5('0x29')]||0.03;this['dialPredictiveInterval']=_0x552403[_0x5de5('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x552403[_0x5de5('0x2b')]||_0x5de5('0x2c');this[_0x5de5('0x2d')]=_0x552403[_0x5de5('0x2d')]||_0x5de5('0x2c');this['dialOriginateTimeout']=_0x552403[_0x5de5('0x2e')]||0x1e;this[_0x5de5('0x2f')]=_0x552403[_0x5de5('0x2f')]||_0x5de5('0x30');this[_0x5de5('0x31')]=_0x552403['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x552403['dialQueueProject']||undefined;this[_0x5de5('0x32')]=_0x552403[_0x5de5('0x32')]||0x3;this[_0x5de5('0x33')]=_0x552403['dialCongestionRetryFrequency']||0x96;this[_0x5de5('0x34')]=_0x552403['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x552403[_0x5de5('0x35')]||0x96;this[_0x5de5('0x36')]=_0x552403['dialNoAnswerMaxRetry']||0x3;this[_0x5de5('0x37')]=_0x552403[_0x5de5('0x37')]||0x96;this[_0x5de5('0x38')]=_0x552403[_0x5de5('0x38')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x552403[_0x5de5('0x39')]||0x96;this[_0x5de5('0x3a')]=_0x552403[_0x5de5('0x3a')]||0x3;this[_0x5de5('0x3b')]=_0x552403[_0x5de5('0x3b')]||0x96;this[_0x5de5('0x3c')]=_0x552403['dialAbandonedMaxRetry']||0x3;this[_0x5de5('0x3d')]=_0x552403[_0x5de5('0x3d')]||0x96;this[_0x5de5('0x3e')]=_0x552403[_0x5de5('0x3e')]||0x3;this[_0x5de5('0x3f')]=_0x552403[_0x5de5('0x3f')]||0x96;this[_0x5de5('0x40')]=_0x552403['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x552403['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x552403[_0x5de5('0x41')]||0x3;this[_0x5de5('0x42')]=_0x552403[_0x5de5('0x42')]||0x4;this[_0x5de5('0x43')]=_0x552403[_0x5de5('0x43')]?_0x552403[_0x5de5('0x43')]:undefined;this[_0x5de5('0x44')]=_0x552403[_0x5de5('0x44')]?_0x552403['TrunkBackup']:undefined;this[_0x5de5('0x45')]=_0x552403[_0x5de5('0x45')]||undefined;this[_0x5de5('0x46')]=_0x552403[_0x5de5('0x46')]?_0x552403[_0x5de5('0x46')]:undefined;this[_0x5de5('0x47')]=_0x552403[_0x5de5('0x47')]||'DESC';this[_0x5de5('0x48')]=_0x552403[_0x5de5('0x48')]||undefined;this[_0x5de5('0x49')]=_0x552403['dialCutDigit']||undefined;this[_0x5de5('0x4a')]=strategy[_0x552403[_0x5de5('0x4a')]]||_0x5de5('0x9');this['queueStatusComplete']=!![];this[_0x5de5('0x4b')]=_0x552403[_0x5de5('0x4b')]||![];this['dialAMDInitialSilence']=_0x552403[_0x5de5('0x4c')];this[_0x5de5('0x4d')]=_0x552403[_0x5de5('0x4d')];this[_0x5de5('0x4e')]=_0x552403['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x552403['dialAMDTotalAnalysisTime'];this[_0x5de5('0x4f')]=_0x552403[_0x5de5('0x4f')];this['dialAMDBetweenWordsSilence']=_0x552403[_0x5de5('0x50')];this[_0x5de5('0x51')]=_0x552403[_0x5de5('0x51')];this[_0x5de5('0x52')]=_0x552403[_0x5de5('0x52')];this['dialAMDMaximumWordLength']=_0x552403[_0x5de5('0x53')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0x5de5('0x54')]=_0x552403[_0x5de5('0x54')];this[_0x5de5('0x55')]=0x0;this[_0x5de5('0x56')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x5de5('0x57')]=0x0;this[_0x5de5('0x58')]=0x0;this[_0x5de5('0x59')]=0x0;this[_0x5de5('0x5a')]=0x0;this[_0x5de5('0x5b')]=0x0;this[_0x5de5('0x5c')]=0x0;this[_0x5de5('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x5de5('0x5e')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x5de5('0x5f')]=undefined;this[_0x5de5('0x60')]=undefined;this['handlePredictive']=undefined;this[_0x5de5('0x61')]=1.05;this[_0x5de5('0x62')]=0x0;this[_0x5de5('0x63')]=0x0;this[_0x5de5('0x64')]=0x0;this[_0x5de5('0x65')]=0x0;this[_0x5de5('0x66')]=0x0;this[_0x5de5('0x67')]=0x0;this[_0x5de5('0x68')]=0x0;this[_0x5de5('0x69')]=0x0;this[_0x5de5('0x6a')]=_0x552403[_0x5de5('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x552403[_0x5de5('0x6b')]||0xa;this[_0x5de5('0x6c')]=0x0;this[_0x5de5('0x6d')]=0x0;this[_0x5de5('0x6e')]=0x1;this['erlangCalls']=0x0;this[_0x5de5('0x6f')]=0x0;this[_0x5de5('0x70')]=0x0;this['erlangBusyFactor']=0x0;this[_0x5de5('0x71')]=_0x552403['dialRecallMeTimeout']||0x1e;this[_0x5de5('0x72')]=_0x552403[_0x5de5('0x72')]||![];this[_0x5de5('0x73')]=!!_0x552403[_0x5de5('0x73')]||![];this[_0x5de5('0x74')]=!!_0x552403[_0x5de5('0x74')]||![];this[_0x5de5('0x75')]=_0x552403['dialQueueProject2']||undefined;this[_0x5de5('0x76')]=_0x552403[_0x5de5('0x76')]||![];this[_0x5de5('0x77')]=_0x552403['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x552403['monitor_format']]?monitorFormat[_0x552403[_0x5de5('0xc')]]:undefined;this[_0x5de5('0x78')]=_0x552403[_0x5de5('0x78')]||![];this['mandatoryDispositionPause']=_0x552403[_0x5de5('0x79')]?_0x552403[_0x5de5('0x79')]:undefined;}module[_0x5de5('0x7a')]=VoiceQueue; \ No newline at end of file +var _0x5a41=['acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available'];(function(_0x17ec16,_0x2436e3){var _0x1f59f5=function(_0x165b75){while(--_0x165b75){_0x17ec16['push'](_0x17ec16['shift']());}};_0x1f59f5(++_0x2436e3);}(_0x5a41,0x15f));var _0x15a4=function(_0x42e887,_0xd64733){_0x42e887=_0x42e887-0x0;var _0x226761=_0x5a41[_0x42e887];return _0x226761;};'use strict';var statusDesc=[_0x15a4('0x0'),'not_inuse',_0x15a4('0x1'),'busy',_0x15a4('0x2'),_0x15a4('0x3'),'ringing',_0x15a4('0x4'),_0x15a4('0x5')];var monitorFormat={'wav':_0x15a4('0x6'),'wav49':_0x15a4('0x7'),'gsm':_0x15a4('0x8')};var strategy={'rrmemory':_0x15a4('0x9'),'roundrobin':_0x15a4('0xa')};function VoiceQueue(_0x7ab7ca){this['id']=_0x7ab7ca['id']||0x0;this[_0x15a4('0xb')]=_0x7ab7ca[_0x15a4('0xb')]||'';this['monitor_format']=_0x7ab7ca[_0x15a4('0xc')]||'';this['type']=_0x7ab7ca[_0x15a4('0xd')]||_0x15a4('0xe');this['waiting']=0x0;this[_0x15a4('0xf')]=0x0;this[_0x15a4('0x10')]=0x0;this[_0x15a4('0x11')]=0x0;this[_0x15a4('0x12')]=0x0;this['sumHoldTime']=0x0;this[_0x15a4('0x13')]=0x0;this[_0x15a4('0x14')]=0x0;this[_0x15a4('0x15')]=0x0;this[_0x15a4('0x16')]=0x0;this[_0x15a4('0x17')]=0x0;this[_0x15a4('0x18')]=_0x7ab7ca['acw']||![];this[_0x15a4('0x19')]=_0x7ab7ca['acwTimeout']||0xa;this[_0x15a4('0x1a')]=_0x7ab7ca[_0x15a4('0x1a')]||'no';this[_0x15a4('0x1b')]=!![];this['message']='';this[_0x15a4('0x1c')]=0x0;this[_0x15a4('0x1d')]=0x0;this['dialTimezone']=_0x7ab7ca[_0x15a4('0x1e')]||null;this[_0x15a4('0x1f')]=_0x7ab7ca[_0x15a4('0x1f')]?_0x7ab7ca[_0x15a4('0x1f')]:null;this[_0x15a4('0x20')]=_0x7ab7ca[_0x15a4('0x20')];this['dialMethod']=_0x7ab7ca[_0x15a4('0x21')]||_0x15a4('0x22');this[_0x15a4('0x23')]=_0x7ab7ca[_0x15a4('0x23')]||0x0;this['dialLimitQueue']=_0x7ab7ca[_0x15a4('0x24')]||0x0;this[_0x15a4('0x25')]=_0x7ab7ca['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x7ab7ca[_0x15a4('0x26')]||_0x15a4('0x27');this['dialPredictiveOptimizationPercentage']=_0x7ab7ca['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x7ab7ca[_0x15a4('0x28')]||0x258;this['dialOriginateCallerIdName']=_0x7ab7ca[_0x15a4('0x29')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x7ab7ca[_0x15a4('0x2a')]||_0x15a4('0x2b');this[_0x15a4('0x2c')]=_0x7ab7ca[_0x15a4('0x2c')]||0x1e;this[_0x15a4('0x2d')]=_0x7ab7ca[_0x15a4('0x2d')]||_0x15a4('0x2e');this[_0x15a4('0x2f')]=_0x7ab7ca[_0x15a4('0x2f')]||0x3;this[_0x15a4('0x30')]=_0x7ab7ca[_0x15a4('0x30')]||undefined;this[_0x15a4('0x31')]=_0x7ab7ca[_0x15a4('0x31')]||0x3;this[_0x15a4('0x32')]=_0x7ab7ca[_0x15a4('0x32')]||0x96;this[_0x15a4('0x33')]=_0x7ab7ca['dialBusyMaxRetry']||0x3;this[_0x15a4('0x34')]=_0x7ab7ca['dialBusyRetryFrequency']||0x96;this[_0x15a4('0x35')]=_0x7ab7ca['dialNoAnswerMaxRetry']||0x3;this[_0x15a4('0x36')]=_0x7ab7ca[_0x15a4('0x36')]||0x96;this[_0x15a4('0x37')]=_0x7ab7ca[_0x15a4('0x37')]||0x3;this[_0x15a4('0x38')]=_0x7ab7ca[_0x15a4('0x38')]||0x96;this[_0x15a4('0x39')]=_0x7ab7ca['dialDropMaxRetry']||0x3;this[_0x15a4('0x3a')]=_0x7ab7ca[_0x15a4('0x3a')]||0x96;this[_0x15a4('0x3b')]=_0x7ab7ca[_0x15a4('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0x7ab7ca['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x7ab7ca[_0x15a4('0x3c')]||0x3;this[_0x15a4('0x3d')]=_0x7ab7ca['dialMachineRetryFrequency']||0x96;this[_0x15a4('0x3e')]=_0x7ab7ca[_0x15a4('0x3e')]||0x3;this[_0x15a4('0x3f')]=_0x7ab7ca[_0x15a4('0x3f')]||0x96;this[_0x15a4('0x40')]=_0x7ab7ca['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x7ab7ca[_0x15a4('0x41')]||0x4;this[_0x15a4('0x42')]=_0x7ab7ca[_0x15a4('0x42')]?_0x7ab7ca[_0x15a4('0x42')]:undefined;this[_0x15a4('0x43')]=_0x7ab7ca[_0x15a4('0x43')]?_0x7ab7ca[_0x15a4('0x43')]:undefined;this[_0x15a4('0x44')]=_0x7ab7ca[_0x15a4('0x44')]||undefined;this[_0x15a4('0x45')]=_0x7ab7ca[_0x15a4('0x45')]?_0x7ab7ca['Interval']:undefined;this[_0x15a4('0x46')]=_0x7ab7ca['dialOrderByScheduledAt']||_0x15a4('0x47');this[_0x15a4('0x48')]=_0x7ab7ca[_0x15a4('0x48')]||undefined;this[_0x15a4('0x49')]=_0x7ab7ca[_0x15a4('0x49')]||undefined;this[_0x15a4('0x4a')]=strategy[_0x7ab7ca[_0x15a4('0x4a')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0x15a4('0x4b')]=_0x7ab7ca['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x7ab7ca[_0x15a4('0x4c')];this['dialAMDGreeting']=_0x7ab7ca[_0x15a4('0x4d')];this[_0x15a4('0x4e')]=_0x7ab7ca[_0x15a4('0x4e')];this[_0x15a4('0x4f')]=_0x7ab7ca['dialAMDTotalAnalysisTime'];this[_0x15a4('0x50')]=_0x7ab7ca['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x7ab7ca[_0x15a4('0x51')];this[_0x15a4('0x52')]=_0x7ab7ca[_0x15a4('0x52')];this['dialAMDSilenceThreshold']=_0x7ab7ca[_0x15a4('0x53')];this['dialAMDMaximumWordLength']=_0x7ab7ca[_0x15a4('0x54')];this[_0x15a4('0x55')]=0x0;this[_0x15a4('0x56')]=0x0;this[_0x15a4('0x57')]=_0x7ab7ca[_0x15a4('0x57')];this[_0x15a4('0x58')]=0x0;this[_0x15a4('0x59')]=0x0;this[_0x15a4('0x5a')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x15a4('0x5b')]=0x0;this[_0x15a4('0x5c')]=0x0;this[_0x15a4('0x5d')]=0x0;this[_0x15a4('0x5e')]=0x0;this[_0x15a4('0x5f')]=0x0;this[_0x15a4('0x60')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x15a4('0x61')]=0x0;this[_0x15a4('0x62')]=undefined;this[_0x15a4('0x63')]=undefined;this[_0x15a4('0x64')]=undefined;this[_0x15a4('0x65')]=1.05;this[_0x15a4('0x66')]=0x0;this[_0x15a4('0x67')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x15a4('0x68')]=0x0;this[_0x15a4('0x69')]=0x0;this[_0x15a4('0x6a')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x15a4('0x6b')]=_0x7ab7ca[_0x15a4('0x6c')]||0x14;this[_0x15a4('0x6d')]=_0x7ab7ca[_0x15a4('0x6c')]||0xa;this[_0x15a4('0x6e')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x15a4('0x6f')]=0x1;this[_0x15a4('0x70')]=0x0;this[_0x15a4('0x71')]=0x0;this[_0x15a4('0x72')]=0x0;this[_0x15a4('0x73')]=0x0;this[_0x15a4('0x74')]=_0x7ab7ca[_0x15a4('0x74')]||0x1e;this[_0x15a4('0x75')]=_0x7ab7ca[_0x15a4('0x75')]||![];this[_0x15a4('0x76')]=!!_0x7ab7ca[_0x15a4('0x76')]||![];this[_0x15a4('0x77')]=!!_0x7ab7ca[_0x15a4('0x77')]||![];this[_0x15a4('0x78')]=_0x7ab7ca[_0x15a4('0x78')]||undefined;this[_0x15a4('0x79')]=_0x7ab7ca[_0x15a4('0x79')]||![];this[_0x15a4('0x7a')]=_0x7ab7ca[_0x15a4('0x7a')]||![];this[_0x15a4('0xc')]=monitorFormat[_0x7ab7ca['monitor_format']]?monitorFormat[_0x7ab7ca[_0x15a4('0xc')]]:undefined;this[_0x15a4('0x7b')]=_0x7ab7ca[_0x15a4('0x7b')]||![];this[_0x15a4('0x7c')]=_0x7ab7ca[_0x15a4('0x7c')]?_0x7ab7ca[_0x15a4('0x7c')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index eb83a92..1cb7a7e 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 _0xf8b7=['username','accessKey','remoteUri','Configurations','exports','name'];(function(_0x343f88,_0xb73a83){var _0x5d3772=function(_0x33e54a){while(--_0x33e54a){_0x343f88['push'](_0x343f88['shift']());}};_0x5d3772(++_0xb73a83);}(_0xf8b7,0x16d));var _0x7f8b=function(_0x280a2e,_0x244c6f){_0x280a2e=_0x280a2e-0x0;var _0x286f67=_0xf8b7[_0x280a2e];return _0x286f67;};'use strict';function VtigerAccount(_0x207700){this['id']=_0x207700['id']||0x0;this[_0x7f8b('0x0')]=_0x207700[_0x7f8b('0x0')]||'';this[_0x7f8b('0x1')]=_0x207700[_0x7f8b('0x1')]||'';this[_0x7f8b('0x2')]=_0x207700[_0x7f8b('0x2')]||'';this[_0x7f8b('0x3')]=_0x207700[_0x7f8b('0x3')]||'';this['serverUrl']=_0x207700['serverUrl']||'';this['Configurations']=_0x207700[_0x7f8b('0x4')]||{};}module[_0x7f8b('0x5')]=VtigerAccount; \ No newline at end of file +var _0x68ee=['username','accessKey','remoteUri','serverUrl','exports','name'];(function(_0x3a2a92,_0x20e309){var _0x11aea8=function(_0x346370){while(--_0x346370){_0x3a2a92['push'](_0x3a2a92['shift']());}};_0x11aea8(++_0x20e309);}(_0x68ee,0x19d));var _0xe68e=function(_0x933116,_0x4e81d4){_0x933116=_0x933116-0x0;var _0x273f7a=_0x68ee[_0x933116];return _0x273f7a;};'use strict';function VtigerAccount(_0x5d3857){this['id']=_0x5d3857['id']||0x0;this[_0xe68e('0x0')]=_0x5d3857[_0xe68e('0x0')]||'';this[_0xe68e('0x1')]=_0x5d3857[_0xe68e('0x1')]||'';this[_0xe68e('0x2')]=_0x5d3857[_0xe68e('0x2')]||'';this[_0xe68e('0x3')]=_0x5d3857['remoteUri']||'';this[_0xe68e('0x4')]=_0x5d3857[_0xe68e('0x4')]||'';this['Configurations']=_0x5d3857['Configurations']||{};}module[_0xe68e('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 9f6acc0..d0b5fab 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 _0xc4ee=['type','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc4ee,0x158));var _0xec4e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4ee[_0x321bb2];return _0x9c12ed;};'use strict';function ZendeskAccount(_0x401f1a){this['id']=_0x401f1a['id']||0x0;this[_0xec4e('0x0')]=_0x401f1a[_0xec4e('0x0')]||'';this['username']=_0x401f1a[_0xec4e('0x1')]||'';this[_0xec4e('0x2')]=_0x401f1a[_0xec4e('0x2')]||'';this[_0xec4e('0x3')]=_0x401f1a[_0xec4e('0x3')]||'';this[_0xec4e('0x4')]=_0x401f1a['remoteUri']||'';this[_0xec4e('0x5')]=_0x401f1a[_0xec4e('0x5')]||'';this[_0xec4e('0x6')]=_0x401f1a[_0xec4e('0x6')]||'integrationTab';this[_0xec4e('0x7')]=_0x401f1a[_0xec4e('0x7')]||'';this[_0xec4e('0x8')]=_0x401f1a[_0xec4e('0x8')]||{};}module[_0xec4e('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x4e4a=['type','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4e4a,0x72));var _0xa4e4=function(_0x10f9e1,_0x4c7e0b){_0x10f9e1=_0x10f9e1-0x0;var _0x371f06=_0x4e4a[_0x10f9e1];return _0x371f06;};'use strict';function ZendeskAccount(_0x2874fb){this['id']=_0x2874fb['id']||0x0;this['name']=_0x2874fb[_0xa4e4('0x0')]||'';this[_0xa4e4('0x1')]=_0x2874fb[_0xa4e4('0x1')]||'';this[_0xa4e4('0x2')]=_0x2874fb['password']||'';this[_0xa4e4('0x3')]=_0x2874fb[_0xa4e4('0x3')]||'';this[_0xa4e4('0x4')]=_0x2874fb[_0xa4e4('0x4')]||'';this[_0xa4e4('0x5')]=_0x2874fb[_0xa4e4('0x5')]||'';this[_0xa4e4('0x6')]=_0x2874fb[_0xa4e4('0x6')]||'integrationTab';this[_0xa4e4('0x7')]=_0x2874fb[_0xa4e4('0x7')]||'';this[_0xa4e4('0x8')]=_0x2874fb[_0xa4e4('0x8')]||{};}module[_0xa4e4('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 9a53e1f..bb113bd 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 _0x8e3e=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8e3e,0xc1));var _0xe8e3=function(_0x59f3c0,_0x5041fc){_0x59f3c0=_0x59f3c0-0x0;var _0x5d78bf=_0x8e3e[_0x59f3c0];return _0x5d78bf;};'use strict';function ZohoAccount(_0xf5fb26){this['id']=_0xf5fb26['id']||0x0;this[_0xe8e3('0x0')]=_0xf5fb26[_0xe8e3('0x0')]||'';this[_0xe8e3('0x1')]=_0xf5fb26['description']||'';this['host']=_0xf5fb26[_0xe8e3('0x2')]||'';this[_0xe8e3('0x3')]=_0xf5fb26[_0xe8e3('0x3')]||'';this[_0xe8e3('0x4')]=_0xf5fb26['clientId']||'';this[_0xe8e3('0x5')]=_0xf5fb26[_0xe8e3('0x5')]||'';this[_0xe8e3('0x6')]=_0xf5fb26[_0xe8e3('0x6')]||'';this[_0xe8e3('0x7')]=_0xf5fb26[_0xe8e3('0x7')]||'';this[_0xe8e3('0x8')]=_0xf5fb26[_0xe8e3('0x8')]||'';this[_0xe8e3('0x9')]=_0xf5fb26[_0xe8e3('0x9')]||{};}module[_0xe8e3('0xa')]=ZohoAccount; \ No newline at end of file +var _0x420b=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','host','zone','clientId'];(function(_0x55dc04,_0x2149d9){var _0x21fed9=function(_0x2ff0bc){while(--_0x2ff0bc){_0x55dc04['push'](_0x55dc04['shift']());}};_0x21fed9(++_0x2149d9);}(_0x420b,0x92));var _0xb420=function(_0x4b7902,_0x477860){_0x4b7902=_0x4b7902-0x0;var _0x583e28=_0x420b[_0x4b7902];return _0x583e28;};'use strict';function ZohoAccount(_0x2f0c37){this['id']=_0x2f0c37['id']||0x0;this['name']=_0x2f0c37[_0xb420('0x0')]||'';this['description']=_0x2f0c37['description']||'';this['host']=_0x2f0c37[_0xb420('0x1')]||'';this['zone']=_0x2f0c37[_0xb420('0x2')]||'';this[_0xb420('0x3')]=_0x2f0c37[_0xb420('0x3')]||'';this['clientSecret']=_0x2f0c37[_0xb420('0x4')]||'';this[_0xb420('0x5')]=_0x2f0c37['serverUrl']||'';this[_0xb420('0x6')]=_0x2f0c37[_0xb420('0x6')]||'';this[_0xb420('0x7')]=_0x2f0c37[_0xb420('0x7')]||'';this['Configurations']=_0x2f0c37[_0xb420('0x8')]||{};}module[_0xb420('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 3f4840a..78b51fd 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 _0x3266=['callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x3266,0x6a));var _0x6326=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x3266[_0x3511d3];return _0x5d6321;};'use strict';var util=require(_0x6326('0x0'));var _=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));function checkNameSurname(_0x2bed83,_0x545df7,_0x6b67c0){var _0x29aef3='';if(!_[_0x6326('0x3')](_0x545df7)&&_0x6326('0x4')===typeof _0x545df7){_0x29aef3+=_0x545df7;}if(!_['isNil'](_0x6b67c0)&&_0x6326('0x4')===typeof _0x6b67c0){_0x29aef3+='\x20'+_0x6b67c0;}if(_0x29aef3!==''){return _0x29aef3;}return _0x2bed83;}function Action(_0x5f38a3,_0x25ecd8,_0x44460c,_0x14208e,_0x5402e5){this[_0x6326('0x5')]=_0x44460c||undefined;this['idContact']=_0x5f38a3['id'];this[_0x6326('0x6')]=_0x25ecd8[_0x6326('0x7')];this[_0x6326('0x8')]=_0x25ecd8[_0x6326('0x8')];this[_0x6326('0x9')]='queue';this[_0x6326('0xa')]=![];this[_0x6326('0xb')]=_[_0x6326('0x3')](_0x5f38a3[_0x6326('0xc')])?undefined:_0x5f38a3[_0x6326('0xc')][_0x6326('0x7')];this[_0x6326('0xd')]=this[_0x6326('0xb')]?util[_0x6326('0xe')](_0x6326('0xf'),this['membername']):_0x14208e||undefined;this['calleridname']=checkNameSurname(_0x5f38a3[_0x6326('0x10')][_0x6326('0x11')],_0x5f38a3['Contact'][_0x6326('0x12')],_0x5f38a3['Contact'][_0x6326('0x13')]);this[_0x6326('0x14')]=_0x5f38a3[_0x6326('0x14')]||![];this[_0x6326('0x15')]=_0x5f38a3[_0x6326('0x11')];this[_0x6326('0x16')]=_0x5f38a3['scheduledat'];this[_0x6326('0x17')]=_0x5f38a3['countbusyretry']||0x0;this['countcongestionretry']=_0x5f38a3['countcongestionretry']||0x0;this['countnoanswerretry']=_0x5f38a3['countnoanswerretry']||0x0;this['countglobal']=(_0x5f38a3[_0x6326('0x17')]||0x0)+(_0x5f38a3[_0x6326('0x18')]||0x0)+(_0x5f38a3[_0x6326('0x19')]||0x0)+(_0x5f38a3['countnosuchnumberretry']||0x0)+(_0x5f38a3['countdropretry']||0x0)+(_0x5f38a3[_0x6326('0x1a')]||0x0)+(_0x5f38a3[_0x6326('0x1b')]||0x0)+(_0x5f38a3[_0x6326('0x1c')]||0x0);this[_0x6326('0x1d')]=_0x5f38a3[_0x6326('0x1d')]||0x0;this[_0x6326('0x1e')]=_0x5f38a3[_0x6326('0x1e')]||0x0;this['countabandonedretry']=_0x5f38a3[_0x6326('0x1a')]||0x0;this['countmachineretry']=_0x5f38a3[_0x6326('0x1b')]||0x0;this[_0x6326('0x1c')]=_0x5f38a3[_0x6326('0x1c')]||0x0;this[_0x6326('0x1f')]=_0x5f38a3[_0x6326('0x1f')];this[_0x6326('0x20')]=_0x5f38a3[_0x6326('0x20')];this[_0x6326('0x21')]=_0x5f38a3[_0x6326('0x21')];this[_0x6326('0x22')]=_0x5f38a3[_0x6326('0x22')];this['ContactId']=_0x5f38a3[_0x6326('0x23')];this[_0x6326('0x24')]=_0x5f38a3['ListId'];this['UserId']=_['isNil'](_0x5f38a3[_0x6326('0xc')])?_0x5f38a3['UserId']:_0x5f38a3[_0x6326('0xc')]['id'];this[_0x6326('0x25')]=_0x5f38a3['VoiceQueueId'];this[_0x6326('0x26')]='';this[_0x6326('0x27')]='';}Action[_0x6326('0x28')][_0x6326('0x29')]=function(){return util[_0x6326('0xe')](_0x6326('0x2a'),this[_0x6326('0x2b')],this[_0x6326('0x2c')]);};module[_0x6326('0x2d')]=Action; \ No newline at end of file +var _0x8f4c=['lodash','moment','isNil','string','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util'];(function(_0x33f61c,_0x1d6baf){var _0x48d27e=function(_0x445d74){while(--_0x445d74){_0x33f61c['push'](_0x33f61c['shift']());}};_0x48d27e(++_0x1d6baf);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5141a1,_0x509811){_0x5141a1=_0x5141a1-0x0;var _0x236ce1=_0x8f4c[_0x5141a1];return _0x236ce1;};'use strict';var util=require(_0xc8f4('0x0'));var _=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));function checkNameSurname(_0x43926b,_0x19893b,_0x134d73){var _0x580083='';if(!_[_0xc8f4('0x3')](_0x19893b)&&_0xc8f4('0x4')===typeof _0x19893b){_0x580083+=_0x19893b;}if(!_[_0xc8f4('0x3')](_0x134d73)&&'string'===typeof _0x134d73){_0x580083+='\x20'+_0x134d73;}if(_0x580083!==''){return _0x580083;}return _0x43926b;}function Action(_0x32cd80,_0x5208da,_0x4c86f8,_0x520063,_0x373506){this['uniqueid']=_0x4c86f8||undefined;this[_0xc8f4('0x5')]=_0x32cd80['id'];this[_0xc8f4('0x6')]=_0x5208da[_0xc8f4('0x7')];this[_0xc8f4('0x8')]=_0x5208da[_0xc8f4('0x8')];this['campaigntype']=_0xc8f4('0x6');this[_0xc8f4('0x9')]=![];this[_0xc8f4('0xa')]=_[_0xc8f4('0x3')](_0x32cd80['Agent'])?undefined:_0x32cd80[_0xc8f4('0xb')]['name'];this[_0xc8f4('0xc')]=this[_0xc8f4('0xa')]?util[_0xc8f4('0xd')](_0xc8f4('0xe'),this[_0xc8f4('0xa')]):_0x520063||undefined;this['calleridname']=checkNameSurname(_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x10')],_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x11')],_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x12')]);this['active']=_0x32cd80[_0xc8f4('0x13')]||![];this[_0xc8f4('0x14')]=_0x32cd80[_0xc8f4('0x10')];this[_0xc8f4('0x15')]=_0x32cd80[_0xc8f4('0x15')];this['countbusyretry']=_0x32cd80[_0xc8f4('0x16')]||0x0;this['countcongestionretry']=_0x32cd80['countcongestionretry']||0x0;this[_0xc8f4('0x17')]=_0x32cd80[_0xc8f4('0x17')]||0x0;this[_0xc8f4('0x18')]=(_0x32cd80[_0xc8f4('0x16')]||0x0)+(_0x32cd80[_0xc8f4('0x19')]||0x0)+(_0x32cd80[_0xc8f4('0x17')]||0x0)+(_0x32cd80[_0xc8f4('0x1a')]||0x0)+(_0x32cd80[_0xc8f4('0x1b')]||0x0)+(_0x32cd80[_0xc8f4('0x1c')]||0x0)+(_0x32cd80[_0xc8f4('0x1d')]||0x0)+(_0x32cd80[_0xc8f4('0x1e')]||0x0);this[_0xc8f4('0x1a')]=_0x32cd80[_0xc8f4('0x1a')]||0x0;this['countdropretry']=_0x32cd80[_0xc8f4('0x1b')]||0x0;this[_0xc8f4('0x1c')]=_0x32cd80[_0xc8f4('0x1c')]||0x0;this[_0xc8f4('0x1d')]=_0x32cd80[_0xc8f4('0x1d')]||0x0;this[_0xc8f4('0x1e')]=_0x32cd80[_0xc8f4('0x1e')]||0x0;this[_0xc8f4('0x1f')]=_0x32cd80['callback'];this[_0xc8f4('0x20')]=_0x32cd80[_0xc8f4('0x20')];this[_0xc8f4('0x21')]=_0x32cd80[_0xc8f4('0x21')];this['recallme']=_0x32cd80[_0xc8f4('0x22')];this['ContactId']=_0x32cd80[_0xc8f4('0x23')];this['ListId']=_0x32cd80[_0xc8f4('0x24')];this[_0xc8f4('0x25')]=_['isNil'](_0x32cd80[_0xc8f4('0xb')])?_0x32cd80[_0xc8f4('0x25')]:_0x32cd80[_0xc8f4('0xb')]['id'];this[_0xc8f4('0x26')]=_0x32cd80['VoiceQueueId'];this[_0xc8f4('0x27')]='';this[_0xc8f4('0x28')]='';}Action['prototype'][_0xc8f4('0x29')]=function(){return util[_0xc8f4('0xd')](_0xc8f4('0x2a'),this[_0xc8f4('0x2b')],this[_0xc8f4('0x2c')]);};module[_0xc8f4('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1586593..cdd247f 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 _0xad60=['countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','logger','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','SIP/%s','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','DEACTIVATED','syncCampaigns','hasOwnProperty','preview','dialMethod','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','clearZombieChannels','[action]','recallMe','getContactRecallMe','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','totalGlobal','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','countnosuchnumberretry','unlockAgent','activeContact','idContact','incrementPreviewCounters','swapAdditionalPhones','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','countnoanswerretry','NoAnswer','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED'];(function(_0x605aca,_0xf78230){var _0x5700fb=function(_0x26c5f3){while(--_0x26c5f3){_0x605aca['push'](_0x605aca['shift']());}};_0x5700fb(++_0xf78230);}(_0xad60,0x1d2));var _0x0ad6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xad60[_0x199572];return _0x13cfa3;};'use strict';var util=require(_0x0ad6('0x0'));var _=require(_0x0ad6('0x1'));var uuid=require(_0x0ad6('0x2'));var moment=require(_0x0ad6('0x3'));var md5=require(_0x0ad6('0x4'));var Redis=require(_0x0ad6('0x5'));var config=require('../../../config/environment');var logger=require(_0x0ad6('0x6'))('preview');var loggerAction=require(_0x0ad6('0x6'))(_0x0ad6('0x7'));var ami=require(_0x0ad6('0x8'));var rpcDb=require(_0x0ad6('0x9'));var cmHopperAdditionalPhone=require(_0x0ad6('0xa'));var Action=require('./action');var ut=require(_0x0ad6('0xb'));config[_0x0ad6('0xc')]=_[_0x0ad6('0xd')](config[_0x0ad6('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x0ad6('0xe'))(new Redis(config[_0x0ad6('0xc')]));var Sequence=function(){};Sequence[_0x0ad6('0xf')]['enqueue']=function(_0x306b47){this[_0x0ad6('0x10')]=this[_0x0ad6('0x10')]?this['tail'][_0x0ad6('0x11')](_0x306b47):_0x306b47();};function Preview(_0x5a3cd7){this[_0x0ad6('0x12')]=new Sequence();this['campaignsPreview']=_0x5a3cd7[_0x0ad6('0x13')];this['trunks']=_0x5a3cd7[_0x0ad6('0x14')];this[_0x0ad6('0x15')]={};this[_0x0ad6('0x16')]=_0x5a3cd7[_0x0ad6('0x16')];this[_0x0ad6('0x17')]=0x0;ami['on'](_0x0ad6('0x18'),this[_0x0ad6('0x19')][_0x0ad6('0x1a')](this));ami['on'](_0x0ad6('0x1b'),this[_0x0ad6('0x1c')][_0x0ad6('0x1a')](this));ami['on'](_0x0ad6('0x1d'),this[_0x0ad6('0x1e')]['bind'](this));ami['on'](_0x0ad6('0x1f'),this[_0x0ad6('0x20')]['bind'](this));ami['on'](_0x0ad6('0x21'),this[_0x0ad6('0x22')][_0x0ad6('0x1a')](this));ami['on'](_0x0ad6('0x23'),this[_0x0ad6('0x24')][_0x0ad6('0x1a')](this));ami['on']('attendedtransfer',this[_0x0ad6('0x25')][_0x0ad6('0x1a')](this));ami['on'](_0x0ad6('0x26'),this[_0x0ad6('0x27')][_0x0ad6('0x1a')](this));this['loopCampaigns'](this[_0x0ad6('0x28')]);}function emit(_0x59eead,_0x2c89ba,_0x2b4d6f){io['to'](_0x59eead)[_0x0ad6('0x29')](_0x2c89ba,_0x2b4d6f);}function emitCampaignPreview(_0x9689fe){if(_0x9689fe[_0x0ad6('0x2a')]===_0x0ad6('0x2b')){var _0x52c10b={'id':_0x9689fe['id'],'name':_0x9689fe[_0x0ad6('0x2c')],'strategy':_0x9689fe[_0x0ad6('0x2d')],'answered':_0x9689fe[_0x0ad6('0x2e')],'available':_0x9689fe[_0x0ad6('0x2f')],'loggedIn':_0x9689fe[_0x0ad6('0x30')],'pTalking':_0x9689fe[_0x0ad6('0x31')],'sumBillable':_0x9689fe[_0x0ad6('0x32')],'sumDuration':_0x9689fe[_0x0ad6('0x33')],'sumHoldTime':_0x9689fe[_0x0ad6('0x34')]||0x0,'talking':_0x9689fe[_0x0ad6('0x35')],'total':_0x9689fe['total'],'type':_0x9689fe[_0x0ad6('0x2a')],'unmanaged':_0x9689fe[_0x0ad6('0x36')],'abandoned':_0x9689fe['abandoned'],'waiting':_0x9689fe[_0x0ad6('0x37')],'loggedInDb':_0x9689fe[_0x0ad6('0x38')],'dialActive':_0x9689fe[_0x0ad6('0x39')],'dialMethod':_0x9689fe['dialMethod'],'dialOriginateCallerIdName':_0x9689fe[_0x0ad6('0x3a')],'dialOriginateCallerIdNumber':_0x9689fe[_0x0ad6('0x3b')],'dialOriginateTimeout':_0x9689fe['dialOriginateTimeout'],'dialPrefix':_0x9689fe[_0x0ad6('0x3c')],'outboundAnswerAgiCallsDay':_0x9689fe[_0x0ad6('0x3d')],'outboundAnswerCallsDay':_0x9689fe['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x9689fe['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x9689fe['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x9689fe[_0x0ad6('0x3e')],'outboundDropCallsDayACS':_0x9689fe[_0x0ad6('0x3f')],'outboundDropCallsDayCallersExit':_0x9689fe[_0x0ad6('0x40')],'outboundDropCallsDayTimeout':_0x9689fe[_0x0ad6('0x41')],'outboundNoAnswerCallsDay':_0x9689fe[_0x0ad6('0x42')],'outboundNoSuchCallsDay':_0x9689fe[_0x0ad6('0x43')],'outboundOriginateFailureCallsDay':_0x9689fe[_0x0ad6('0x44')],'outboundReCallsDay':_0x9689fe[_0x0ad6('0x45')],'outboundRejectCallsDay':_0x9689fe['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x9689fe[_0x0ad6('0x46')],'outboundAbandonedCallsDay':_0x9689fe['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x9689fe[_0x0ad6('0x47')],'predictiveIntervalAvgHoldtime':_0x9689fe[_0x0ad6('0x48')],'predictiveIntervalAvgTalktime':_0x9689fe[_0x0ad6('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x9689fe['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x9689fe[_0x0ad6('0x4a')],'predictiveIntervalErlangCalls':_0x9689fe['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x9689fe[_0x0ad6('0x4b')],'predictiveIntervalHitRate':_0x9689fe[_0x0ad6('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x9689fe[_0x0ad6('0x4d')],'predictiveIntervalPauses':_0x9689fe['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x9689fe['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x9689fe[_0x0ad6('0x4e')],'message':_0x9689fe[_0x0ad6('0x4f')],'originated':_0x9689fe[_0x0ad6('0x50')],'erlangCalls':_0x9689fe['erlangCalls'],'erlangCallToSecond':_0x9689fe[_0x0ad6('0x51')],'erlangAbandonmentRate':_0x9689fe[_0x0ad6('0x52')],'erlangBusyFactor':_0x9689fe[_0x0ad6('0x53')],'startPredictive':_0x9689fe[_0x0ad6('0x54')],'startProgressive':_0x9689fe['startProgressive']};if(_0x9689fe['Trunk']){_0x52c10b[_0x0ad6('0x55')]={'id':_0x9689fe[_0x0ad6('0x55')]['id'],'name':_0x9689fe[_0x0ad6('0x55')][_0x0ad6('0x2c')],'active':_0x9689fe[_0x0ad6('0x55')][_0x0ad6('0x56')],'callerid':_0x9689fe[_0x0ad6('0x55')][_0x0ad6('0x57')]};}if(_0x9689fe['Interval']){_0x52c10b[_0x0ad6('0x58')]={'id':_0x9689fe['Interval']['id'],'name':_0x9689fe[_0x0ad6('0x58')]['name']};}var _0x17736d=md5(JSON[_0x0ad6('0x59')](_0x52c10b));if(_0x9689fe[_0x0ad6('0x4')]!==_0x17736d){_0x9689fe['md5']=_0x17736d;emit(util[_0x0ad6('0x5a')](_0x0ad6('0x5b'),_0x52c10b[_0x0ad6('0x2c')]),'voice_queue:save',_0x52c10b);}}}function emitVoiceQueueChannelRemove(_0xb9d2d0){logger[_0x0ad6('0x5c')](_0x0ad6('0x5d'),JSON['stringify'](_0xb9d2d0));emit(util['format'](_0x0ad6('0x5b'),_0xb9d2d0[_0x0ad6('0x2c')]),_0x0ad6('0x5e'),_0xb9d2d0);io['emit'](_0x0ad6('0x5f'),_0xb9d2d0);}function notSendMessagesQueue(_0x57a8da){if(_0x57a8da[_0x0ad6('0x60')]){if(_0x57a8da[_0x0ad6('0x50')]===0x0&&_0x57a8da['pTalking']===0x0){_0x57a8da['sendMessageOneNotActive']=![];_0x57a8da['available']=0x0;_0x57a8da[_0x0ad6('0x61')]=0x0;_0x57a8da[_0x0ad6('0x4f')]=_0x0ad6('0x62');ut['logger'](_0x0ad6('0x63'),_0x57a8da[_0x0ad6('0x2c')]+'\x20is\x20not\x20active');}else{_0x57a8da[_0x0ad6('0x4f')]=_0x0ad6('0x64');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x57a8da[_0x0ad6('0x2c')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x57a8da);}}Preview['prototype']['loopCampaigns']=function(){var _0xbdef9b=this;setInterval(function(){_0xbdef9b['syncCampaigns']();},0x7cf);};Preview[_0x0ad6('0xf')][_0x0ad6('0x65')]=function(){var _0x33c30e=this[_0x0ad6('0x28')];this[_0x0ad6('0x17')]+=0x1;for(var _0x4cc8f8 in _0x33c30e){if(_0x33c30e[_0x0ad6('0x66')](_0x4cc8f8)&&(_0x33c30e[_0x4cc8f8]['dialMethod']===_0x0ad6('0x67')||_0x33c30e[_0x4cc8f8][_0x0ad6('0x68')]==='booked')&&_0x33c30e[_0x4cc8f8][_0x0ad6('0x2a')]===_0x0ad6('0x2b')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x33c30e['hasOwnProperty'](_0x4cc8f8)&&_0x33c30e[_0x4cc8f8][_0x0ad6('0x68')]===_0x0ad6('0x67')&&_0x33c30e[_0x4cc8f8][_0x0ad6('0x2a')]==='outbound'){if(_0x33c30e[_0x4cc8f8]['dialActive']){this[_0x0ad6('0x69')](_0x33c30e[_0x4cc8f8]);if(_0x33c30e[_0x4cc8f8][_0x0ad6('0x6a')])this['recallMe'](_0x33c30e[_0x4cc8f8]);}else{notSendMessagesQueue(_0x33c30e[_0x4cc8f8]);}}}};Preview[_0x0ad6('0xf')][_0x0ad6('0x6b')]=function(_0x98ed0f){var _0x544ffa=this;this[_0x0ad6('0x12')]['enqueue'](function(){if(!_['isNil'](_0x544ffa[_0x0ad6('0x15')][_0x98ed0f])){loggerAction[_0x0ad6('0x5c')](_0x0ad6('0x6c'),_0x98ed0f,_0x0ad6('0x6d'),_0x544ffa['actions'][_0x98ed0f][_0x0ad6('0x6e')],_0x0ad6('0x6f'),JSON['stringify'](_0x544ffa[_0x0ad6('0x28')][_0x544ffa['actions'][_0x98ed0f][_0x0ad6('0x6e')]][_0x0ad6('0x50')]),'pTalking:\x20',JSON[_0x0ad6('0x59')](_0x544ffa[_0x0ad6('0x28')][_0x544ffa[_0x0ad6('0x15')][_0x98ed0f]['queue']]['pTalking']),JSON[_0x0ad6('0x59')](_0x544ffa[_0x0ad6('0x15')][_0x98ed0f][_0x0ad6('0x70')]),JSON['stringify'](_[_0x0ad6('0x71')](_0x544ffa[_0x0ad6('0x15')][_0x98ed0f],['contactId',_0x0ad6('0x72'),_0x0ad6('0x73'),_0x0ad6('0x74')])));return ami[_0x0ad6('0x75')]({'action':_0x0ad6('0x76'),'channel':_0x544ffa[_0x0ad6('0x15')][_0x98ed0f][_0x0ad6('0x77')]})[_0x0ad6('0x78')](function(_0x5aa2c7){if(_0x5aa2c7[_0x0ad6('0x4f')]===_0x0ad6('0x79')){setTimeout(function(){if(_0x544ffa[_0x0ad6('0x15')][_0x98ed0f]){ut[_0x0ad6('0x7a')](_0x544ffa['campaignsPreview'][_0x544ffa[_0x0ad6('0x15')][_0x98ed0f]['queue']],_0x0ad6('0x7b'));if(_0x544ffa[_0x0ad6('0x15')][_0x98ed0f][_0x0ad6('0x70')]===!![]){ut[_0x0ad6('0x7c')](_0x544ffa[_0x0ad6('0x28')][_0x544ffa[_0x0ad6('0x15')][_0x98ed0f][_0x0ad6('0x6e')]],_0x0ad6('0x7b'));ut[_0x0ad6('0x7d')](_0x0ad6('0x7e')+_0x98ed0f,_0x544ffa['actions'][_0x98ed0f][_0x0ad6('0x6e')]);}ut[_0x0ad6('0x7d')]('[Dialer][checkChannel][Preview]'+_0x98ed0f,_0x544ffa['actions'][_0x98ed0f]['queue']);delete _0x544ffa[_0x0ad6('0x15')][_0x98ed0f];}},0x2328);}});}});};Preview[_0x0ad6('0xf')][_0x0ad6('0x7f')]=function(){var _0x2a14c0=this;loggerAction[_0x0ad6('0x5c')](_0x0ad6('0x80'),_['size'](this[_0x0ad6('0x15')]));for(var _0x4dad7b in this[_0x0ad6('0x15')]){if(_0x2a14c0[_0x0ad6('0x15')]['hasOwnProperty'](_0x4dad7b)){_0x2a14c0[_0x0ad6('0x6b')](_0x4dad7b);}}};Preview[_0x0ad6('0xf')][_0x0ad6('0x81')]=function(_0x1507cc){var _0x35ad37=this;rpcDb[_0x0ad6('0x82')](_0x1507cc['id'],ut['agentReadyId'](this[_0x0ad6('0x16')]))['then'](function(_0x3735c7){if(!_[_0x0ad6('0x83')](_0x3735c7)){for(var _0x138cc3=0x0;_0x138cc3<_0x3735c7[_0x0ad6('0x84')];_0x138cc3+=0x1){if(ut[_0x0ad6('0x85')](_0x3735c7[_0x138cc3][_0x0ad6('0x86')])<_0x1507cc[_0x0ad6('0x87')]*0x3c){if(_0x3735c7[_0x138cc3][_0x0ad6('0x88')]&&!_0x3735c7[_0x138cc3][_0x0ad6('0x88')][_0x0ad6('0x89')]){_0x35ad37[_0x0ad6('0x8a')](_0x3735c7[_0x138cc3]['id'])[_0x0ad6('0x8b')](ut[_0x0ad6('0x8c')](_0x0ad6('0x8d')))[_0x0ad6('0x78')](ut[_0x0ad6('0x8c')](_0x0ad6('0x8d')));}else{rpcDb[_0x0ad6('0x8e')](_0x3735c7[_0x138cc3]['id']);}}else{var _0x7b4f42=new Action(_0x3735c7[_0x138cc3],_0x1507cc);_0x7b4f42[_0x0ad6('0x8f')]=moment()[_0x0ad6('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1507cc['outboundReCallsDay']+=0x1;ut[_0x0ad6('0x90')](_0x7b4f42,0x17,_0x0ad6('0x91'));if(_0x1507cc['dialRecallInQueue']){rpcDb[_0x0ad6('0x92')](ut[_0x0ad6('0x93')](_0x3735c7[_0x138cc3]));rpcDb['createCustomerHistory'](_0x7b4f42,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x0ad6('0x90')](_0x7b4f42,0x16,'RecallFailedTimeout');rpcDb[_0x0ad6('0x94')](_0x7b4f42,'[HistoryRecallClose]');rpcDb[_0x0ad6('0x95')](_0x7b4f42,_0x0ad6('0x96'));}}}}})[_0x0ad6('0x78')](ut[_0x0ad6('0x8c')]('[getContactRecallMe]'));};Preview[_0x0ad6('0xf')][_0x0ad6('0x69')]=function(_0x3e5ad9){_0x3e5ad9[_0x0ad6('0x60')]=!![];if(ut[_0x0ad6('0x97')](_0x3e5ad9[_0x0ad6('0x30')])){_0x3e5ad9[_0x0ad6('0x4f')]=_0x0ad6('0x98');}else if(!ut[_0x0ad6('0x99')](_0x3e5ad9[_0x0ad6('0x39')])){_0x3e5ad9[_0x0ad6('0x4f')]=_0x0ad6('0x62');}else if(!this[_0x0ad6('0x9a')](_0x3e5ad9[_0x0ad6('0x55')])){if(!this[_0x0ad6('0x9a')](_0x3e5ad9[_0x0ad6('0x9b')])){_0x3e5ad9['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x3e5ad9['message']=_0x0ad6('0x9c');}}else{_0x3e5ad9[_0x0ad6('0x4f')]=_0x0ad6('0x9c');}emitCampaignPreview(_0x3e5ad9);};Preview[_0x0ad6('0xf')][_0x0ad6('0x9d')]=function(_0x523b67,_0x365714,_0x2f32dd){var _0x26fa39=this;var _0x50f5e8=this[_0x0ad6('0x15')][_0x365714];var _0x2fba23=this[_0x0ad6('0x28')][_0x50f5e8[_0x0ad6('0x6e')]];var _0x41de23;var _0x40e4f3=![];var _0x494cc0=0x2;var _0x3b0697=0x3;if(_0x2fba23){switch(_0x2f32dd){case'1':_0x2fba23['outboundNoSuchCallsDay']+=0x1;_0x50f5e8['countnosuchnumberretry']+=0x1;_0x50f5e8[_0x0ad6('0x9e')]=ut['totalGlobal'](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0x0,_0x0ad6('0x9f'));ami['emit'](_0x0ad6('0xa0'),ut[_0x0ad6('0xa1')](_0x50f5e8,_0x0ad6('0xa2')));rpcDb[_0x0ad6('0x94')](_0x50f5e8,_0x0ad6('0xa3'));_0x26fa39[_0x0ad6('0xa4')](_0x50f5e8,'0',_0x2fba23)['then'](function(_0x7f53e2){_0x40e4f3=_0x7f53e2[_0x0ad6('0xa5')]==0x1;_0x494cc0=_0x2fba23[_0x0ad6('0xa6')];_0x3b0697=_0x2fba23['callAdditionalPhoneAfterMin'];if(!_0x40e4f3){if(ut[_0x0ad6('0xa7')](_0x50f5e8)>=_0x2fba23['dialGlobalMaxRetry']){_0x41de23=ut['cloneAction'](_0x50f5e8,0xf,_0x0ad6('0xa8'));rpcDb['createCustomerFinal'](_0x41de23,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x50f5e8['countnosuchnumberretry']>=_0x2fba23[_0x0ad6('0xa9')]){rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xaa'));}else{rpcDb[_0x0ad6('0xab')](ut[_0x0ad6('0xac')](_0x50f5e8,_0x0ad6('0xad'),_0x2fba23['dialNoSuchNumberRetryFrequency']),_0x50f5e8[_0x0ad6('0xae')],_0x50f5e8[_0x0ad6('0xaf')]);}}delete this[_0x0ad6('0x15')][_0x523b67['linkedid']];}else{_0x50f5e8[_0x0ad6('0xad')]++;logger['info']('actioncountonusuch',_0x50f5e8['countnosuchnumberretry']);logger[_0x0ad6('0x5c')]('id',_0x50f5e8[_0x0ad6('0xb0')]);_0x26fa39[_0x0ad6('0xb1')]({'id':_0x50f5e8[_0x0ad6('0xb0')],'field':{'countnosuchnumberretry':_0x50f5e8[_0x0ad6('0xad')]}})[_0x0ad6('0x8b')](function(){_0x26fa39[_0x0ad6('0xb2')](_0x50f5e8,_0x494cc0,_0x3b0697)['then'](function(){});});}});break;case'ANSWER':var _0x5a8e28=moment()[_0x0ad6('0x5a')](_0x0ad6('0xb3'));_0x50f5e8[_0x0ad6('0xb4')]=_0x5a8e28;_0x50f5e8['answertime']=_0x5a8e28;_0x50f5e8[_0x0ad6('0x70')]=!![];_0x2fba23[_0x0ad6('0x31')]+=0x1;logger[_0x0ad6('0x5c')](_0x0ad6('0xb5'),_0x50f5e8[_0x0ad6('0xb6')],_0x0ad6('0xb7'),_0x2fba23[_0x0ad6('0x2c')],_0x0ad6('0xb8'),_0x2fba23[_0x0ad6('0x31')]);ami['emit'](_0x0ad6('0xb9'),ut[_0x0ad6('0xa1')](_0x50f5e8,_0x0ad6('0xba'),this[_0x0ad6('0x28')][_0x50f5e8['queue']]));if(_0x2fba23[_0x0ad6('0xbb')]){ami[_0x0ad6('0x29')](_0x0ad6('0xbc'),ut[_0x0ad6('0xbd')](_0x50f5e8));}break;case'16':ami[_0x0ad6('0x29')](_0x0ad6('0xbe'),ut[_0x0ad6('0xa1')](_0x50f5e8,_0x0ad6('0xbf'),this['campaignsPreview'][_0x50f5e8[_0x0ad6('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0x0ad6('0xa1')](_0x50f5e8,'complete'));_0x2fba23[_0x0ad6('0xc0')]+=0x1;_0x2fba23['total']+=0x1;_0x2fba23[_0x0ad6('0x2e')]+=0x1;ut[_0x0ad6('0x7c')](_0x2fba23,_0x0ad6('0xc1'));_0x50f5e8[_0x0ad6('0x9e')]=ut[_0x0ad6('0xa7')](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0x4,_0x0ad6('0xc2'));rpcDb[_0x0ad6('0x94')](_0x50f5e8,_0x0ad6('0xc3'));rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xc4'));rpcDb[_0x0ad6('0xc5')](_0x50f5e8);_0x2fba23[_0x0ad6('0x33')]+=_0x50f5e8['talktime'];_0x2fba23[_0x0ad6('0x32')]+=_0x50f5e8[_0x0ad6('0xc6')];logger[_0x0ad6('0x5c')](_0x0ad6('0xc7'),_0x50f5e8[_0x0ad6('0xb6')],_0x0ad6('0xb7'),_0x2fba23[_0x0ad6('0x2c')],_0x0ad6('0xb8'),_0x2fba23['pTalking']);delete this[_0x0ad6('0x15')][_0x523b67[_0x0ad6('0xc8')]];break;case'BUSY':_0x2fba23[_0x0ad6('0xc9')]+=0x1;_0x50f5e8['countbusyretry']+=0x1;_0x50f5e8['countglobal']=ut[_0x0ad6('0xa7')](_0x50f5e8);ut['logCustomer'](_0x50f5e8,0x5,_0x0ad6('0xca'));_0x494cc0=_0x2fba23[_0x0ad6('0xcb')];_0x3b0697=_0x2fba23[_0x0ad6('0xcc')];ami[_0x0ad6('0x29')](_0x0ad6('0xcd'),ut['buildObj'](_0x50f5e8,_0x0ad6('0xce')));rpcDb[_0x0ad6('0x94')](_0x50f5e8,'[callProgressDetectingCustomer][logBusy]');_0x26fa39[_0x0ad6('0xa4')](_0x50f5e8,'5',_0x2fba23)[_0x0ad6('0x8b')](function(_0x2ff682){_0x40e4f3=_0x2ff682[_0x0ad6('0xa5')]==0x1;if(!_0x40e4f3){if(ut[_0x0ad6('0xa7')](_0x50f5e8)>=_0x2fba23[_0x0ad6('0xcf')]){_0x41de23=ut[_0x0ad6('0xd0')](_0x50f5e8,0xf,_0x0ad6('0xa8'));rpcDb['createCustomerFinal'](_0x41de23,_0x0ad6('0xd1'));}else{if(_0x50f5e8[_0x0ad6('0xd2')]>=_0x2fba23[_0x0ad6('0xd3')]){rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xd4'));}else{rpcDb[_0x0ad6('0xab')](ut['scheduledAt'](_0x50f5e8,_0x0ad6('0xd2'),_0x2fba23[_0x0ad6('0xcb')]),_0x50f5e8[_0x0ad6('0xae')],_0x50f5e8['activeContact']);}}}else{_0x50f5e8[_0x0ad6('0xd2')]++;_0x26fa39[_0x0ad6('0xb1')]({'id':_0x50f5e8[_0x0ad6('0xb0')],'field':{'countbusyretry':_0x50f5e8[_0x0ad6('0xd2')]}})[_0x0ad6('0x8b')](function(){_0x26fa39[_0x0ad6('0xb2')](_0x50f5e8,_0x494cc0,_0x3b0697)[_0x0ad6('0x8b')](function(){});});}});break;case'NOANSWER':_0x2fba23[_0x0ad6('0x42')]+=0x1;_0x50f5e8[_0x0ad6('0xd5')]+=0x1;_0x50f5e8[_0x0ad6('0x9e')]=ut[_0x0ad6('0xa7')](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0x3,_0x0ad6('0xd6'));_0x494cc0=_0x2fba23['dialNoAnswerRetryFrequency'];_0x3b0697=_0x2fba23[_0x0ad6('0xcc')];var _0x5ccbe6=ut[_0x0ad6('0xd7')](_0x50f5e8,_0x2fba23);ami[_0x0ad6('0x29')]('custom:agentnoanswer',_0x5ccbe6);rpcDb[_0x0ad6('0x94')](_0x50f5e8,_0x0ad6('0xd8'));_0x26fa39['verifyAdditionalPhones'](_0x50f5e8,'3',_0x2fba23)['then'](function(_0x502523){_0x40e4f3=_0x502523[_0x0ad6('0xa5')]==0x1;if(!_0x40e4f3){if(ut[_0x0ad6('0xa7')](_0x50f5e8)>=_0x2fba23[_0x0ad6('0xcf')]){_0x41de23=ut[_0x0ad6('0xd0')](_0x50f5e8,0xf,'Global');rpcDb['createCustomerFinal'](_0x41de23,_0x0ad6('0xd9'));}else{if(_0x50f5e8[_0x0ad6('0xd5')]>=_0x2fba23[_0x0ad6('0xda')]){rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xd8'));}else{rpcDb[_0x0ad6('0xab')](ut[_0x0ad6('0xac')](_0x50f5e8,_0x0ad6('0xd5'),_0x2fba23[_0x0ad6('0xdb')]),_0x50f5e8[_0x0ad6('0xae')],_0x50f5e8[_0x0ad6('0xaf')]);}}}else{_0x50f5e8[_0x0ad6('0xd5')]++;_0x26fa39[_0x0ad6('0xb1')]({'id':_0x50f5e8[_0x0ad6('0xb0')],'field':{'countnoanswerretry':_0x50f5e8['countnoanswerretry']}})[_0x0ad6('0x8b')](function(){_0x26fa39[_0x0ad6('0xb2')](_0x50f5e8,_0x494cc0,_0x3b0697)[_0x0ad6('0x8b')](function(){});});}});break;case'CONGESTION':_0x2fba23['outboundCongestionCallsDay']+=0x1;_0x50f5e8[_0x0ad6('0xdc')]+=0x1;_0x50f5e8[_0x0ad6('0x9e')]=ut[_0x0ad6('0xa7')](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0x8,_0x0ad6('0xdd'));_0x494cc0=_0x2fba23[_0x0ad6('0xde')];_0x3b0697=_0x2fba23[_0x0ad6('0xcc')];ami['emit'](_0x0ad6('0xdf'),ut[_0x0ad6('0xa1')](_0x50f5e8,_0x0ad6('0xe0')));rpcDb[_0x0ad6('0x94')](_0x50f5e8,'[callProgressDetectingCustomer][logCongestion]');_0x26fa39['verifyAdditionalPhones'](_0x50f5e8,'8',_0x2fba23)[_0x0ad6('0x8b')](function(_0x50d827){_0x40e4f3=_0x50d827[_0x0ad6('0xa5')]==0x1;if(!_0x40e4f3){if(ut[_0x0ad6('0xa7')](_0x50f5e8)>=_0x2fba23['dialGlobalMaxRetry']){_0x41de23=ut['cloneAction'](_0x50f5e8,0xf,'Global');rpcDb[_0x0ad6('0x95')](_0x41de23,_0x0ad6('0xe1'));}else{if(_0x50f5e8[_0x0ad6('0xdc')]>=_0x2fba23[_0x0ad6('0xe2')]){rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xe3'));}else{rpcDb[_0x0ad6('0xab')](ut[_0x0ad6('0xac')](_0x50f5e8,'countcongestionretry',_0x2fba23[_0x0ad6('0xcb')]),_0x50f5e8[_0x0ad6('0xae')],_0x50f5e8[_0x0ad6('0xaf')]);}}}else{_0x50f5e8[_0x0ad6('0xdc')]++;_0x26fa39[_0x0ad6('0xb1')]({'id':_0x50f5e8[_0x0ad6('0xb0')],'field':{'countcongestionretry':_0x50f5e8['countcongestionretry']}})[_0x0ad6('0x8b')](function(){_0x26fa39['swapAdditionalPhones'](_0x50f5e8,_0x494cc0,_0x3b0697)[_0x0ad6('0x8b')](function(){});});}});break;case _0x0ad6('0xe4'):_0x2fba23[_0x0ad6('0xe5')]+=0x1;_0x50f5e8[_0x0ad6('0xe6')]+=0x1;_0x50f5e8[_0x0ad6('0x9e')]=ut[_0x0ad6('0xa7')](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0x14,_0x0ad6('0xe7'));_0x494cc0=_0x2fba23[_0x0ad6('0xe8')];_0x3b0697=_0x2fba23['callAdditionalPhoneAfterMin'];ami[_0x0ad6('0x29')](_0x0ad6('0xe9'),ut[_0x0ad6('0xa1')](_0x50f5e8,_0x0ad6('0xea')));rpcDb[_0x0ad6('0x94')](_0x50f5e8,'[syncHangupRequest][logAgentReject]');_0x26fa39[_0x0ad6('0xa4')](_0x50f5e8,'20',_0x2fba23)[_0x0ad6('0x8b')](function(_0x3eb87e){_0x40e4f3=_0x3eb87e[_0x0ad6('0xa5')]==0x1;if(!_0x40e4f3){if(ut[_0x0ad6('0xa7')](_0x50f5e8)>=_0x2fba23['dialGlobalMaxRetry']){_0x41de23=ut[_0x0ad6('0xd0')](_0x50f5e8,0x14,_0x0ad6('0xe7'));rpcDb[_0x0ad6('0x95')](_0x41de23,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x50f5e8['countagentrejectretry']>=_0x2fba23[_0x0ad6('0xeb')]){rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xec'));}else{rpcDb[_0x0ad6('0xab')](ut['scheduledAt'](_0x50f5e8,_0x0ad6('0xe6'),_0x2fba23[_0x0ad6('0xe8')]),_0x50f5e8[_0x0ad6('0xae')],_0x50f5e8['activeContact']);}}}else{_0x50f5e8[_0x0ad6('0xd5')]++;_0x26fa39[_0x0ad6('0xb1')]({'id':_0x50f5e8['idContact'],'field':{'countnoanswerretry':_0x50f5e8[_0x0ad6('0xd5')]}})[_0x0ad6('0x8b')](function(){_0x26fa39[_0x0ad6('0xb2')](_0x50f5e8,_0x494cc0,_0x3b0697)['then'](function(){});});}});break;case _0x0ad6('0xed'):_0x2fba23['outboundAbandonedCallsDay']+=0x1;_0x50f5e8[_0x0ad6('0xee')]+=0x1;_0x50f5e8[_0x0ad6('0x9e')]=ut[_0x0ad6('0xa7')](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0xb,_0x0ad6('0xef'));rpcDb[_0x0ad6('0x94')](_0x50f5e8,_0x0ad6('0xf0'));_0x26fa39[_0x0ad6('0xa4')](_0x50f5e8,'11',_0x2fba23)['then'](function(_0x3ff665){_0x40e4f3=_0x3ff665['additional']==0x1;if(!_0x40e4f3){if(ut['totalGlobal'](_0x50f5e8)>=_0x2fba23[_0x0ad6('0xcf')]){_0x41de23=ut[_0x0ad6('0xd0')](_0x50f5e8,0xf,_0x0ad6('0xa8'));rpcDb[_0x0ad6('0x95')](_0x41de23,_0x0ad6('0xf0'));}else{if(_0x50f5e8[_0x0ad6('0xf1')]>=_0x2fba23[_0x0ad6('0xf2')]){rpcDb['createCustomerFinal'](_0x50f5e8,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x0ad6('0xac')](_0x50f5e8,_0x0ad6('0xee'),_0x2fba23[_0x0ad6('0xf3')]),_0x50f5e8['unlockAgent'],_0x50f5e8[_0x0ad6('0xaf')]);}}}else{_0x50f5e8['countnoanswerretry']++;_0x26fa39[_0x0ad6('0xb1')]({'id':_0x50f5e8['idContact'],'field':{'countnoanswerretry':_0x50f5e8['countnoanswerretry']}})[_0x0ad6('0x8b')](function(){_0x26fa39[_0x0ad6('0xb2')](_0x50f5e8,_0x494cc0,_0x3b0697)[_0x0ad6('0x8b')](function(){});});}});break;case'18':_0x2fba23[_0x0ad6('0x46')]+=0x1;_0x50f5e8[_0x0ad6('0xf4')]+=0x1;_0x50f5e8[_0x0ad6('0x9e')]=ut[_0x0ad6('0xa7')](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0x12,_0x523b67[_0x0ad6('0xf5')]||_0x523b67[_0x0ad6('0xf6')]);ami['emit'](_0x0ad6('0xf7'),ut['buildObj'](_0x50f5e8,_0x0ad6('0xf8')));rpcDb[_0x0ad6('0x94')](_0x50f5e8,_0x0ad6('0xf9'));_0x26fa39['verifyAdditionalPhones'](_0x50f5e8,'18',_0x2fba23)[_0x0ad6('0x8b')](function(_0x3daa0b){_0x40e4f3=_0x3daa0b[_0x0ad6('0xa5')]==0x1;if(!_0x40e4f3){if(ut[_0x0ad6('0xa7')](_0x50f5e8)>=_0x2fba23['dialGlobalMaxRetry']){_0x41de23=ut[_0x0ad6('0xd0')](_0x50f5e8,0x12,'Global');rpcDb['createCustomerFinal'](_0x41de23,_0x0ad6('0xf9'));}else{rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xf9'));}}else{_0x50f5e8['countnoanswerretry']++;_0x26fa39[_0x0ad6('0xb1')]({'id':_0x50f5e8[_0x0ad6('0xb0')],'field':{'countnoanswerretry':_0x50f5e8[_0x0ad6('0xd5')]}})[_0x0ad6('0x8b')](function(){_0x26fa39[_0x0ad6('0xb2')](_0x50f5e8,_0x494cc0,_0x3b0697)['then'](function(){});});}});delete this[_0x0ad6('0x15')][_0x523b67[_0x0ad6('0xc8')]];break;case'19':_0x2fba23[_0x0ad6('0x46')]+=0x1;_0x50f5e8[_0x0ad6('0x9e')]=ut[_0x0ad6('0xa7')](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0x13,_0x523b67[_0x0ad6('0xf5')]||_0x523b67[_0x0ad6('0xf6')]);ami['emit'](_0x0ad6('0xf7'),ut[_0x0ad6('0xa1')](_0x50f5e8,_0x0ad6('0xf8')));rpcDb[_0x0ad6('0x94')](_0x50f5e8,_0x0ad6('0xfa'));_0x26fa39[_0x0ad6('0xa4')](_0x50f5e8,'18',_0x2fba23)['then'](function(_0xc64441){_0x40e4f3=_0xc64441[_0x0ad6('0xa5')]==0x1;if(!_0x40e4f3){if(ut[_0x0ad6('0xa7')](_0x50f5e8)>=_0x2fba23['dialGlobalMaxRetry']){_0x41de23=ut[_0x0ad6('0xd0')](_0x50f5e8,0xf,'Global');rpcDb[_0x0ad6('0x95')](_0x41de23,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xfa'));}}else{_0x50f5e8[_0x0ad6('0xd5')]++;_0x26fa39[_0x0ad6('0xb1')]({'id':_0x50f5e8['idContact'],'field':{'countnoanswerretry':_0x50f5e8[_0x0ad6('0xd5')]}})[_0x0ad6('0x8b')](function(){_0x26fa39[_0x0ad6('0xb2')](_0x50f5e8,_0x494cc0,_0x3b0697)['then'](function(){});});}});delete this['actions'][_0x523b67[_0x0ad6('0xc8')]];break;default:if(_0x50f5e8[_0x0ad6('0x70')]){ut[_0x0ad6('0x7c')](_0x2fba23,'[default]');ut[_0x0ad6('0x7d')](_0x0ad6('0xfb')+_0x2fba23[_0x0ad6('0x2c')],_0x523b67);}_0x2fba23[_0x0ad6('0x46')]+=0x1;_0x50f5e8['countglobal']=ut[_0x0ad6('0xa7')](_0x50f5e8);ut[_0x0ad6('0x90')](_0x50f5e8,0xc,_0x523b67[_0x0ad6('0xf5')]||_0x523b67['dialstatus']);_0x494cc0=_0x2fba23[_0x0ad6('0xe8')];_0x3b0697=_0x2fba23[_0x0ad6('0xcc')];rpcDb['createCustomerHistory'](_0x50f5e8,_0x0ad6('0xfc'));_0x26fa39['verifyAdditionalPhones'](_0x50f5e8,'20',_0x2fba23)[_0x0ad6('0x8b')](function(_0x23ad24){_0x40e4f3=_0x23ad24[_0x0ad6('0xa5')]==0x1;if(!_0x40e4f3){if(ut[_0x0ad6('0xa7')](_0x50f5e8)>=_0x2fba23[_0x0ad6('0xcf')]){_0x41de23=ut['cloneAction'](_0x50f5e8,0xf,_0x0ad6('0xa8'));rpcDb[_0x0ad6('0x95')](_0x41de23,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0ad6('0x95')](_0x50f5e8,_0x0ad6('0xfd'));}delete this['actions'][_0x523b67[_0x0ad6('0xc8')]];}else{_0x26fa39['swapAdditionalPhones'](_0x50f5e8,_0x494cc0,_0x3b0697)[_0x0ad6('0x8b')](function(){});}});}if(!(_0x50f5e8[_0x0ad6('0x70')]&&_0x2f32dd==='16')){ut[_0x0ad6('0x7a')](_0x2fba23,_0x0ad6('0xfe'));logger[_0x0ad6('0x5c')]('[originated][decrement][callProgressDetectingCustomer]',_0x50f5e8[_0x0ad6('0xb6')],_0x0ad6('0xb7'),_0x2fba23[_0x0ad6('0x2c')],_0x0ad6('0x6f'),_0x2fba23[_0x0ad6('0x50')]);}if(_0x2f32dd!=='ANSWER'){delete this['actions'][_0x523b67['linkedid']];delete this[_0x0ad6('0x15')][_0x523b67[_0x0ad6('0xff')]];}}};Preview[_0x0ad6('0xf')][_0x0ad6('0x100')]=function(_0x5d961d,_0x21656d,_0xe0bc9){if(_[_0x0ad6('0x101')](_0x21656d)&&_0x0ad6('0x102')!==typeof _0x21656d){return;}if(_[_0x0ad6('0x101')](_0xe0bc9)&&_0x0ad6('0x102')!==typeof _0xe0bc9){return;}switch(_0xe0bc9[_0x0ad6('0x103')]){case'0':ut[_0x0ad6('0x104')](_0x5d961d,0x0,'NoSuchNumber');rpcDb[_0x0ad6('0x105')](_0x5d961d,_0x0ad6('0x106'));break;case'3':ut['logAgent'](_0x5d961d,0x3,_0x0ad6('0xd6'));rpcDb[_0x0ad6('0x105')](_0x5d961d,_0x0ad6('0x107'));break;case'5':ut[_0x0ad6('0x104')](_0x5d961d,0x5,_0x0ad6('0xca'));rpcDb['createAgentHistory'](_0x5d961d,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x0ad6('0x104')](_0x5d961d,0x8,_0x0ad6('0xdd'));rpcDb[_0x0ad6('0x105')](_0x5d961d,_0x0ad6('0x108'));break;case'22':ut[_0x0ad6('0x104')](_0x5d961d,0x16,_0x0ad6('0x109'));rpcDb[_0x0ad6('0x105')](_0x5d961d,_0x0ad6('0x10a'));break;default:ut['logAgent'](_0x5d961d,0xc,_0xe0bc9[_0x0ad6('0x103')]);rpcDb[_0x0ad6('0x105')](_0x5d961d,_0x0ad6('0x108'));}ut[_0x0ad6('0x7a')](_0x21656d,'[callProgressDetectingAgent]');logger[_0x0ad6('0x5c')](_0x0ad6('0x10b'),_0x5d961d[_0x0ad6('0xb6')],_0x0ad6('0xb7'),_0x21656d[_0x0ad6('0x2c')],_0x0ad6('0x6f'),_0x21656d[_0x0ad6('0x50')]);delete this[_0x0ad6('0x15')][_0x5d961d[_0x0ad6('0xb6')]];};Preview['prototype'][_0x0ad6('0xa4')]=function(_0x5544a3,_0x312c58,_0x13a1de){return Promise[_0x0ad6('0x10c')]()[_0x0ad6('0x8b')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x5544a3,_0x312c58,_0x13a1de))[_0x0ad6('0x78')](logger[_0x0ad6('0x5c')](_0x0ad6('0x10d')));};Preview[_0x0ad6('0xf')]['swapAdditionalPhones']=function(_0x33adbb,_0x46238b,_0x5bae2b){return Promise['resolve']()[_0x0ad6('0x8b')](cmHopperAdditionalPhone[_0x0ad6('0xb2')](_0x33adbb,_0x46238b,_0x5bae2b))[_0x0ad6('0x78')](logger[_0x0ad6('0x5c')]('[swapAdditionalPhone]\x20'));};Preview[_0x0ad6('0xf')][_0x0ad6('0xb1')]=function(_0x3a9c11){return Promise[_0x0ad6('0x10c')]()[_0x0ad6('0x8b')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x3a9c11))['catch'](logger[_0x0ad6('0x5c')](_0x0ad6('0x10e')));};Preview[_0x0ad6('0xf')][_0x0ad6('0x10f')]=function(_0x2f9b12,_0x36cd41,_0x2cd47a,_0x12dd46,_0x21f672){var _0x29d618=this;return new Promise(function(_0x3d9504,_0x1b8423){if(_[_0x0ad6('0x83')](_0x36cd41)||_[_0x0ad6('0x83')](_0x36cd41[_0x0ad6('0x110')])||_['isNil'](_0x36cd41[_0x0ad6('0x111')])||_['isNil'](_0x36cd41['VoiceQueueId'])){_0x1b8423(ut[_0x0ad6('0x4f')](_0x0ad6('0x112'),_0x12dd46,_0x21f672));return;}var _0x42eba7=uuid['v4']();var _0x2d36d4=_0x29d618[_0x0ad6('0x28')][_0x36cd41[_0x0ad6('0x6d')][_0x0ad6('0x2c')]];var _0x38cfe6=_0x2cd47a?_0x29d618[_0x0ad6('0x16')][_0x2cd47a]['id']:undefined;_0x29d618['actions'][_0x42eba7]=new Action(_0x36cd41,_0x2d36d4,_0x42eba7,_0x2cd47a,_0x38cfe6);var _0x3a5964=_0x29d618[_0x0ad6('0x15')][_0x42eba7];_0x3a5964['unlockAgent']=_0x12dd46;_0x3a5964['activeContact']=_0x21f672;_0x3a5964[_0x0ad6('0x113')]=_0x2cd47a;if(_[_0x0ad6('0x114')](_0x2f9b12)){_0x29d618[_0x0ad6('0x115')](_0x3a5964,_0x2d36d4,_0x36cd41,_0x2cd47a)['then'](function(_0x34e1cd){logger[_0x0ad6('0x5c')]('[Preview][execCall][success]',_0x0ad6('0x116')+_0x3a5964['queue']+_0x0ad6('0x117')+_0x3a5964['idContact'],JSON[_0x0ad6('0x59')](_0x34e1cd));ami[_0x0ad6('0x29')](_0x0ad6('0x118'),ut[_0x0ad6('0xa1')](_0x3a5964,_0x0ad6('0x119'),_0x29d618[_0x0ad6('0x28')][_0x3a5964[_0x0ad6('0x6e')]]));_0x3d9504(ut[_0x0ad6('0x4f')](_0x0ad6('0x11a')));})[_0x0ad6('0x78')](function(_0x1f7226){ut[_0x0ad6('0x11b')]('[Preview][execCall][failure]',_0x1f7226);_0x1b8423(ut[_0x0ad6('0x4f')](_0x0ad6('0x11c'),_0x12dd46,_0x21f672));});}else{_0x2d36d4[_0x0ad6('0x11d')]+=0x1;ut[_0x0ad6('0x11e')](_0x3a5964);rpcDb['createHistory'](_0x3a5964,'[Blacklist][error]');delete _0x29d618[_0x0ad6('0x15')][_0x42eba7];_0x1b8423(ut[_0x0ad6('0x4f')]('Contact\x20in\x20black\x20List',_0x12dd46,_0x21f672));}});};Preview[_0x0ad6('0xf')]['isTrunkReachable']=function(_0x1be287){return!_[_0x0ad6('0x83')](_0x1be287)&&!_[_0x0ad6('0x83')](_0x1be287[_0x0ad6('0x2c')])&&!_[_0x0ad6('0x83')](_0x1be287[_0x0ad6('0x56')])&&_0x1be287[_0x0ad6('0x56')]&&!_[_0x0ad6('0x83')](this['trunks'][util[_0x0ad6('0x5a')](_0x0ad6('0x11f'),_0x1be287[_0x0ad6('0x2c')])])&&!_[_0x0ad6('0x83')](this['trunks'][util[_0x0ad6('0x5a')](_0x0ad6('0x11f'),_0x1be287[_0x0ad6('0x2c')])][_0x0ad6('0x76')])&&(this[_0x0ad6('0x14')][util[_0x0ad6('0x5a')](_0x0ad6('0x11f'),_0x1be287[_0x0ad6('0x2c')])][_0x0ad6('0x76')]===_0x0ad6('0x120')||this[_0x0ad6('0x14')][util['format']('SIP/%s',_0x1be287[_0x0ad6('0x2c')])][_0x0ad6('0x76')]===_0x0ad6('0x121'));};Preview['prototype']['run']=function(_0x3d0dd6,_0x26ebdf){var _0x3973f4=this;return new Promise(function(_0x5f5237,_0x354b1d){_0x3973f4['execRun'](_0x3d0dd6,_0x26ebdf)[_0x0ad6('0x8b')](function(_0x1b79d8){_0x5f5237(_[_0x0ad6('0x71')](_0x1b79d8,[_0x0ad6('0x4f')]));})['catch'](function(_0x3f9526){if(_0x3f9526[_0x0ad6('0x122')]){rpcDb[_0x0ad6('0x123')](_0x3d0dd6);}if(_0x3f9526[_0x0ad6('0x56')]){rpcDb[_0x0ad6('0x8e')](_0x3d0dd6);}_0x354b1d(_[_0x0ad6('0x71')](_0x3f9526,['message']));});});};Preview['prototype'][_0x0ad6('0x124')]=function(_0x721485,_0x2d475d){var _0x5d871a=this;return new Promise(function(_0x9ea98a,_0x53dd53){var _0x343a4b,_0x173ec5;rpcDb[_0x0ad6('0x125')](_0x721485)[_0x0ad6('0x8b')](function(_0x598552){if(!_['isNil'](_0x598552[0x0])){_0x173ec5=_0x598552[0x0][_0x0ad6('0x126')]?![]:!![];_0x343a4b=_0x598552[0x0][_0x0ad6('0x126')]?!![]:![];_0x343a4b=_0x2d475d?!![]:_0x343a4b;}var _0x31940b=_0x5d871a[_0x0ad6('0x127')](_0x598552);if(_0x31940b['isValid']){rpcDb['checkIsBlackList'](_[_0x0ad6('0x71')](_0x598552[0x0],[_0x0ad6('0x73'),'phone']))[_0x0ad6('0x8b')](function(_0x14691c){_0x5d871a[_0x0ad6('0x10f')](_0x14691c,_0x598552[0x0],_0x2d475d,_0x173ec5,_0x343a4b)[_0x0ad6('0x8b')](function(_0x12309f){_0x9ea98a(_0x12309f);})[_0x0ad6('0x78')](function(_0x4decfe){_0x53dd53(_0x4decfe);});})[_0x0ad6('0x78')](function(_0x303db8){ut[_0x0ad6('0x11b')](_0x0ad6('0x128'),_0x303db8);_0x53dd53(ut[_0x0ad6('0x4f')](_0x0ad6('0x129'),_0x173ec5,_0x343a4b));});}else{_0x53dd53(ut[_0x0ad6('0x4f')](_0x31940b[_0x0ad6('0x4f')],_0x173ec5,_0x343a4b));}})[_0x0ad6('0x78')](function(_0x4eaaf2){ut[_0x0ad6('0x11b')](_0x0ad6('0x12a'),_0x4eaaf2);_0x53dd53(ut['message'](_0x0ad6('0x129'),![],!![]));});});};Preview['prototype'][_0x0ad6('0x127')]=function(_0x26e3b0){if(_[_0x0ad6('0x83')](_0x26e3b0)||_['isEmpty'](_0x26e3b0)||!_[_0x0ad6('0x83')](_0x26e3b0[0x0]['Agent'])&&_[_0x0ad6('0x83')](_0x26e3b0[0x0][_0x0ad6('0x88')][_0x0ad6('0x2c')])){ut[_0x0ad6('0x11b')](_0x0ad6('0x12b'),_0x26e3b0);return{'isValid':![],'message':_0x0ad6('0x12c')};}var _0xd5b93e=this[_0x0ad6('0x28')][_0x26e3b0[0x0]['Queue'][_0x0ad6('0x2c')]];_0xd5b93e[_0x0ad6('0x4f')]=_0x0ad6('0x9c');if(_[_0x0ad6('0x83')](_0xd5b93e)){ut[_0x0ad6('0x11b')](_0x0ad6('0x12d'),_0xd5b93e);return{'isValid':![],'message':_0x0ad6('0x12e')};}if(!this['isTrunkReachable'](_0xd5b93e[_0x0ad6('0x55')])){ut[_0x0ad6('0x11b')](_0x0ad6('0x12f'),_0x0ad6('0x130')+_0xd5b93e['name']+_0x0ad6('0x131'));if(!this[_0x0ad6('0x9a')](_0xd5b93e[_0x0ad6('0x9b')])){ut[_0x0ad6('0x11b')](_0x0ad6('0x12f'),_0xd5b93e[_0x0ad6('0x2c')]+_0x0ad6('0x132'));return{'isValid':![],'message':_0x0ad6('0x133')};}}if(!ut[_0x0ad6('0x99')](_0xd5b93e[_0x0ad6('0x39')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0xd5b93e[_0x0ad6('0x2c')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x0ad6('0x130')+_0xd5b93e['name']+_0x0ad6('0x134')};}return{'isValid':!![],'message':_0x0ad6('0x135')};};Preview[_0x0ad6('0xf')]['execCall']=function(_0x1e6f42,_0x15115b,_0x4deeae,_0x3915a4){var _0x16d0cd=this;return new Promise(function(_0x3fad6d,_0x5763aa){var _0x5223fc=_0x1e6f42[_0x0ad6('0xb6')];var _0x5c0705=_0x16d0cd['isTrunkReachable'](_0x15115b[_0x0ad6('0x55')])?util[_0x0ad6('0x5a')](_0x0ad6('0x136'),_0x15115b[_0x0ad6('0x55')][_0x0ad6('0x2c')],_['isNil'](_0x15115b[_0x0ad6('0x3c')])?'':_0x15115b[_0x0ad6('0x3c')][_0x0ad6('0x137')]()||'',_0x15115b['dialCutDigit']>0x0?_0x4deeae[_0x0ad6('0x111')]['substring'](_0x15115b[_0x0ad6('0x138')]):_0x4deeae['phone']):util[_0x0ad6('0x5a')](_0x0ad6('0x136'),_[_0x0ad6('0x83')](_0x15115b[_0x0ad6('0x9b')])?_0x15115b[_0x0ad6('0x55')][_0x0ad6('0x2c')]:_0x15115b[_0x0ad6('0x9b')][_0x0ad6('0x2c')],_[_0x0ad6('0x83')](_0x15115b[_0x0ad6('0x3c')])?'':_0x15115b[_0x0ad6('0x3c')]['trim']()||'',_0x15115b[_0x0ad6('0x138')]>0x0?_0x4deeae[_0x0ad6('0x111')][_0x0ad6('0x139')](_0x15115b[_0x0ad6('0x138')]):_0x4deeae[_0x0ad6('0x111')]);var _0x2ed446=_0x16d0cd[_0x0ad6('0x9a')](_0x15115b[_0x0ad6('0x55')])?ut[_0x0ad6('0x13a')](_0x15115b[_0x0ad6('0x55')][_0x0ad6('0x57')],_0x15115b['dialOriginateCallerIdName'],_0x15115b[_0x0ad6('0x13b')]>0x0?ut[_0x0ad6('0x13c')](_0x15115b['dialOriginateCallerIdNumber'],_0x15115b['dialRandomLastDigitCallerIdNumber']):_0x15115b[_0x0ad6('0x3b')]):ut[_0x0ad6('0x13a')](_[_0x0ad6('0x83')](_0x15115b['TrunkBackup'])?_0x15115b['Trunk'][_0x0ad6('0x57')]:_0x15115b[_0x0ad6('0x9b')]['callerid'],_0x15115b['dialOriginateCallerIdName'],_0x15115b[_0x0ad6('0x13b')]>0x0?ut[_0x0ad6('0x13c')](_0x15115b['dialOriginateCallerIdNumber'],_0x15115b['dialRandomLastDigitCallerIdNumber']):_0x15115b['dialOriginateCallerIdNumber']);if(_0x2ed446){_0x1e6f42[_0x0ad6('0x13d')]=ut[_0x0ad6('0x13e')](_0x2ed446);_0x1e6f42[_0x0ad6('0x13f')]=ut[_0x0ad6('0x140')](_0x2ed446);}var _0x3501fe=ut['addVariables'](_0x15115b,_0x4deeae,_0x5c0705,_0x2ed446,_0x5223fc,_0x1e6f42);_[_0x0ad6('0x141')](_0x1e6f42,ut['toLowerVariables'](_0x3501fe));_0x1e6f42[_0x0ad6('0x8f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x15115b['variables']=_0x3501fe;ami[_0x0ad6('0x75')](ut[_0x0ad6('0x142')](_0x1e6f42,_0x15115b,_0x3501fe,_0x1e6f42[_0x0ad6('0xaf')],_0x3915a4))[_0x0ad6('0x8b')](function(_0x5345b7){_0x15115b['originated']+=0x1;logger['info'](_0x0ad6('0x143'),_0x5223fc,'\x20Queue',_0x15115b[_0x0ad6('0x2c')],_0x0ad6('0x6f'),_0x15115b[_0x0ad6('0x50')]);_0x3fad6d(_0x5345b7);})[_0x0ad6('0x78')](function(_0xc22d3b){ut['logAgent'](_0x1e6f42,0xe,_0x0ad6('0x144'));rpcDb[_0x0ad6('0x105')](_0x1e6f42,_0x0ad6('0x145'));_0x5763aa(_0xc22d3b);});});};Preview[_0x0ad6('0xf')]['syncNewExten']=function(_0x31f81f){if(this[_0x0ad6('0x15')][_0x31f81f[_0x0ad6('0xc8')]]){this[_0x0ad6('0x15')][_0x31f81f[_0x0ad6('0xc8')]]['channel']=_0x31f81f[_0x0ad6('0x77')];}};Preview[_0x0ad6('0xf')][_0x0ad6('0x19')]=function(_0x626473){var _0x3ddcec=this;var _0x22864e=this[_0x0ad6('0x15')][_0x626473[_0x0ad6('0x146')]];if(_0x22864e){if(_0x22864e[_0x0ad6('0x113')]&&this[_0x0ad6('0x16')][_0x22864e[_0x0ad6('0x113')]]){ut[_0x0ad6('0x147')](_0x22864e,this[_0x0ad6('0x16')][_0x22864e['lookAgent']][_0x0ad6('0x2c')],this[_0x0ad6('0x16')][_0x22864e[_0x0ad6('0x113')]]['id']);}var _0x1f249c=_[_0x0ad6('0x148')](_0x22864e);_0x1f249c[_0x0ad6('0xb4')]=moment()[_0x0ad6('0x5a')](_0x0ad6('0xb3'));var _0x5c5b83=_0x3ddcec[_0x0ad6('0x28')][_0x22864e[_0x0ad6('0x6e')]];if(ut[_0x0ad6('0x149')](_0x626473[_0x0ad6('0x14a')])){if(_0x22864e[_0x0ad6('0xae')]){rpcDb[_0x0ad6('0x123')](_0x22864e[_0x0ad6('0xb0')]);}if(_0x22864e[_0x0ad6('0xaf')]){rpcDb['disableContact'](_0x22864e['idContact']);}ami[_0x0ad6('0x29')](_0x0ad6('0x14b'),ut[_0x0ad6('0xa1')](_0x22864e,_0x0ad6('0x14c'),this['campaignsPreview'][_0x22864e['queue']]));this['callProgressDetectingAgent'](_0x1f249c,_0x5c5b83,_0x626473);}else{_0x22864e['starttime']=moment()['format'](_0x0ad6('0xb3'));ut[_0x0ad6('0x104')](_0x1f249c,0x4,_0x0ad6('0xc2'));rpcDb['createAgentHistory'](_0x1f249c,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x0ad6('0xf')]['syncHangup']=function(_0x1eeb1e){var _0x5d7a2e=this['actions'][_0x1eeb1e[_0x0ad6('0xc8')]];var _0x1a6f90;if(_0x5d7a2e){_0x1a6f90=this[_0x0ad6('0x28')][_0x5d7a2e['queue']];logger['info'](_0x0ad6('0x14d'),_0x1eeb1e[_0x0ad6('0xc8')],_0x0ad6('0xb7'),_0x1a6f90['name'],_0x0ad6('0xb8'),_0x1a6f90[_0x0ad6('0x31')]);}if(this['actions'][_0x1eeb1e['linkedid']]&&_0x1eeb1e[_0x0ad6('0xc8')]!==_0x1eeb1e[_0x0ad6('0xb6')]){if(_0x1eeb1e[_0x0ad6('0x14e')]==='16'&&this[_0x0ad6('0x15')][_0x1eeb1e['linkedid']]['dialAnswer']){this[_0x0ad6('0x9d')](_0x1eeb1e,_0x1eeb1e[_0x0ad6('0xc8')],_0x1eeb1e[_0x0ad6('0x14e')]);}else if(this[_0x0ad6('0x15')][_0x1eeb1e[_0x0ad6('0xc8')]]['dialAnswer']){logger['info'](_0x0ad6('0x14f'),_0x1eeb1e[_0x0ad6('0xc8')],_0x1eeb1e['cause'],_0x0ad6('0xb7'),_0x1a6f90[_0x0ad6('0x2c')],_0x0ad6('0xb8'),_0x1a6f90[_0x0ad6('0x31')]);this[_0x0ad6('0x9d')](_0x1eeb1e,_0x1eeb1e[_0x0ad6('0xc8')],_0x1eeb1e['cause']);}}else if(_0x5d7a2e&&_[_0x0ad6('0x83')](_0x5d7a2e[_0x0ad6('0x150')])&&_0x1a6f90[_0x0ad6('0x151')]&&_0x1eeb1e[_0x0ad6('0xc8')]===_0x1eeb1e[_0x0ad6('0xb6')]&&_[_0x0ad6('0x83')](_0x1eeb1e[_0x0ad6('0x103')])&&_0x1eeb1e[_0x0ad6('0x14e')]==='16'&&_0x1eeb1e[_0x0ad6('0x152')]==='6'&&_['isUndefined'](_0x5d7a2e['transfer'])){if(_0x5d7a2e[_0x0ad6('0xae')]){rpcDb[_0x0ad6('0x123')](_0x5d7a2e[_0x0ad6('0xb0')]);}if(_0x5d7a2e[_0x0ad6('0xaf')]){rpcDb['disableContact'](_0x5d7a2e[_0x0ad6('0xb0')]);}_0x1eeb1e['reason']='22';this[_0x0ad6('0x100')](_0x5d7a2e,_0x1a6f90,_0x1eeb1e);}else if(_0x5d7a2e&&_0x5d7a2e[_0x0ad6('0x153')]){if(_0x1eeb1e[_0x0ad6('0x14e')]==='16'&&this['actions'][_0x1eeb1e[_0x0ad6('0xc8')]][_0x0ad6('0x70')]){logger[_0x0ad6('0x5c')]('[syncHangup][talking][transfer]',_0x1eeb1e[_0x0ad6('0xc8')],_0x1eeb1e[_0x0ad6('0x14e')],'\x20Queue',_0x1a6f90[_0x0ad6('0x2c')],'pTalking:\x20',_0x1a6f90['pTalking']);this[_0x0ad6('0x9d')](_0x1eeb1e,_0x1eeb1e['linkedid'],_0x1eeb1e[_0x0ad6('0x14e')]);}else if(this[_0x0ad6('0x15')][_0x1eeb1e[_0x0ad6('0xc8')]][_0x0ad6('0x70')]){logger[_0x0ad6('0x5c')](_0x0ad6('0x14f'),_0x1eeb1e[_0x0ad6('0xc8')],_0x1eeb1e[_0x0ad6('0x14e')],_0x0ad6('0xb7'),_0x1a6f90[_0x0ad6('0x2c')],_0x0ad6('0xb8'),_0x1a6f90[_0x0ad6('0x31')]);this[_0x0ad6('0x9d')](_0x1eeb1e,_0x1eeb1e['linkedid'],_0x1eeb1e[_0x0ad6('0x14e')]);}}};Preview[_0x0ad6('0xf')][_0x0ad6('0x20')]=function(_0x3663a6){if(this[_0x0ad6('0x15')][_0x3663a6[_0x0ad6('0xff')]]&&_0x3663a6[_0x0ad6('0xff')]!==_0x3663a6[_0x0ad6('0x154')]){this[_0x0ad6('0x9d')](_0x3663a6,_0x3663a6[_0x0ad6('0xff')],_0x3663a6['dialstatus']);}};Preview[_0x0ad6('0xf')]['syncHangupRequest']=function(_0x30854b){if(this['actions'][_0x30854b[_0x0ad6('0xc8')]]&&_0x30854b[_0x0ad6('0xc8')]!==_0x30854b[_0x0ad6('0xb6')]&&!this[_0x0ad6('0x15')][_0x30854b[_0x0ad6('0xc8')]][_0x0ad6('0x70')]){if(_0x30854b['cause']==='1'){this[_0x0ad6('0x9d')](_0x30854b,_0x30854b['linkedid'],_0x30854b[_0x0ad6('0x14e')]);}}};Preview['prototype'][_0x0ad6('0x155')]=function(_0x50d838,_0x5940a5,_0x3702da){if(this['actions'][_0x50d838]){if(_[_0x0ad6('0x83')](this[_0x0ad6('0x15')][_0x50d838]['variables'])){this[_0x0ad6('0x15')][_0x50d838][_0x0ad6('0x156')]={};}this[_0x0ad6('0x15')][_0x50d838]['variables'][_0x5940a5]=_0x3702da;}};Preview['prototype'][_0x0ad6('0x24')]=function(_0x15ebef){try{if(!_['isNil'](_0x15ebef)){if(ut[_0x0ad6('0x157')](_[_0x0ad6('0x158')](_0x15ebef['variable'])[0x0])){this[_0x0ad6('0x155')](_0x15ebef[_0x0ad6('0xb6')],_[_0x0ad6('0x158')](_0x15ebef[_0x0ad6('0x159')])[0x0],_0x15ebef['value']);}}}catch(_0x10abe6){logger[_0x0ad6('0x15a')](_0x0ad6('0x15b'),util[_0x0ad6('0x15c')](_0x10abe6,{'showHidden':![],'depth':null}));}};Preview[_0x0ad6('0xf')][_0x0ad6('0x25')]=function(_0x6f9a4a){if(_0x6f9a4a){if(this[_0x0ad6('0x15')][_0x6f9a4a[_0x0ad6('0x15d')]]){this[_0x0ad6('0x15')][_0x6f9a4a[_0x0ad6('0x15d')]][_0x0ad6('0x153')]=!![];}}};Preview[_0x0ad6('0xf')][_0x0ad6('0x27')]=function(_0x1dbc0c){if(_0x1dbc0c){if(this[_0x0ad6('0x15')][_0x1dbc0c['transfererlinkedid']]){this[_0x0ad6('0x15')][_0x1dbc0c[_0x0ad6('0x15e')]][_0x0ad6('0x153')]=!![];}}};module[_0x0ad6('0x15f')]=Preview; \ No newline at end of file +var _0x562a=['dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','[callProgressDetectingCustomer][machine]','linkedid','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','\x20Queue','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','phone','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','logger','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','run','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','starttime','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','reason','channelstate','transfer','disableContact','destuniqueid','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','defaults','localhost','enqueue','tail','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','\x20is\x20deactivated','prototype','syncCampaigns','campaignsPreview','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','actions','info','Queue','queue','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','format','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','pTalking:\x20','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','Global','dialNoAnswerMaxRetry','outboundCongestionCallsDay','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry'];(function(_0xf9568c,_0x5dcffd){var _0x53fe5e=function(_0x1b9d4f){while(--_0x1b9d4f){_0xf9568c['push'](_0xf9568c['shift']());}};_0x53fe5e(++_0x5dcffd);}(_0x562a,0x1db));var _0xa562=function(_0x1bc627,_0x31fe37){_0x1bc627=_0x1bc627-0x0;var _0x1a44cc=_0x562a[_0x1bc627];return _0x1a44cc;};'use strict';var util=require(_0xa562('0x0'));var _=require(_0xa562('0x1'));var uuid=require(_0xa562('0x2'));var moment=require(_0xa562('0x3'));var md5=require(_0xa562('0x4'));var Redis=require(_0xa562('0x5'));var config=require(_0xa562('0x6'));var logger=require('../../../config/logger')(_0xa562('0x7'));var loggerAction=require(_0xa562('0x8'))(_0xa562('0x9'));var ami=require(_0xa562('0xa'));var rpcDb=require(_0xa562('0xb'));var cmHopperAdditionalPhone=require(_0xa562('0xc'));var Action=require('./action');var ut=require(_0xa562('0xd'));config[_0xa562('0xe')]=_[_0xa562('0xf')](config[_0xa562('0xe')],{'host':_0xa562('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xa562('0x11')]=function(_0x55bcfe){this[_0xa562('0x12')]=this['tail']?this['tail']['finally'](_0x55bcfe):_0x55bcfe();};function Preview(_0xb95f2){this[_0xa562('0x13')]=new Sequence();this['campaignsPreview']=_0xb95f2[_0xa562('0x14')];this[_0xa562('0x15')]=_0xb95f2[_0xa562('0x15')];this['actions']={};this[_0xa562('0x16')]=_0xb95f2['agents'];this[_0xa562('0x17')]=0x0;ami['on']('originateresponse',this[_0xa562('0x18')][_0xa562('0x19')](this));ami['on'](_0xa562('0x1a'),this['syncHangup'][_0xa562('0x19')](this));ami['on']('hanguprequest',this[_0xa562('0x1b')]['bind'](this));ami['on']('dialend',this[_0xa562('0x1c')][_0xa562('0x19')](this));ami['on'](_0xa562('0x1d'),this[_0xa562('0x1e')][_0xa562('0x19')](this));ami['on']('varset',this[_0xa562('0x1f')]['bind'](this));ami['on'](_0xa562('0x20'),this['syncAttendedTransfer'][_0xa562('0x19')](this));ami['on'](_0xa562('0x21'),this[_0xa562('0x22')][_0xa562('0x19')](this));this[_0xa562('0x23')](this['campaignsPreview']);}function emit(_0x27bf78,_0x4c8fd8,_0x962370){io['to'](_0x27bf78)[_0xa562('0x24')](_0x4c8fd8,_0x962370);}function emitCampaignPreview(_0x16a69b){if(_0x16a69b[_0xa562('0x25')]===_0xa562('0x26')){var _0x43905d={'id':_0x16a69b['id'],'name':_0x16a69b['name'],'strategy':_0x16a69b[_0xa562('0x27')],'answered':_0x16a69b['answered'],'available':_0x16a69b[_0xa562('0x28')],'loggedIn':_0x16a69b[_0xa562('0x29')],'pTalking':_0x16a69b[_0xa562('0x2a')],'sumBillable':_0x16a69b[_0xa562('0x2b')],'sumDuration':_0x16a69b[_0xa562('0x2c')],'sumHoldTime':_0x16a69b['sumHoldTime']||0x0,'talking':_0x16a69b[_0xa562('0x2d')],'total':_0x16a69b[_0xa562('0x2e')],'type':_0x16a69b[_0xa562('0x25')],'unmanaged':_0x16a69b['unmanaged'],'abandoned':_0x16a69b[_0xa562('0x2f')],'waiting':_0x16a69b['waiting'],'loggedInDb':_0x16a69b[_0xa562('0x30')],'dialActive':_0x16a69b[_0xa562('0x31')],'dialMethod':_0x16a69b[_0xa562('0x32')],'dialOriginateCallerIdName':_0x16a69b[_0xa562('0x33')],'dialOriginateCallerIdNumber':_0x16a69b[_0xa562('0x34')],'dialOriginateTimeout':_0x16a69b[_0xa562('0x35')],'dialPrefix':_0x16a69b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x16a69b[_0xa562('0x36')],'outboundAnswerCallsDay':_0x16a69b[_0xa562('0x37')],'outboundBlacklistCallsDay':_0x16a69b[_0xa562('0x38')],'outboundBusyCallsDay':_0x16a69b[_0xa562('0x39')],'outboundCongestionCallsDay':_0x16a69b['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x16a69b[_0xa562('0x3a')],'outboundDropCallsDayCallersExit':_0x16a69b[_0xa562('0x3b')],'outboundDropCallsDayTimeout':_0x16a69b['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x16a69b['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x16a69b['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x16a69b[_0xa562('0x3c')],'outboundReCallsDay':_0x16a69b[_0xa562('0x3d')],'outboundRejectCallsDay':_0x16a69b[_0xa562('0x3e')],'outboundUnknownCallsDay':_0x16a69b['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x16a69b[_0xa562('0x3f')],'predictiveIntervalAnsweredCalls':_0x16a69b[_0xa562('0x40')],'predictiveIntervalAvgHoldtime':_0x16a69b['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x16a69b[_0xa562('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x16a69b[_0xa562('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x16a69b[_0xa562('0x43')],'predictiveIntervalErlangCalls':_0x16a69b['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x16a69b[_0xa562('0x44')],'predictiveIntervalHitRate':_0x16a69b['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x16a69b[_0xa562('0x45')],'predictiveIntervalPauses':_0x16a69b[_0xa562('0x46')],'predictiveIntervalAvailable':_0x16a69b[_0xa562('0x47')],'predictiveIntervalTotalCalls':_0x16a69b[_0xa562('0x48')],'message':_0x16a69b['message'],'originated':_0x16a69b[_0xa562('0x49')],'erlangCalls':_0x16a69b['erlangCalls'],'erlangCallToSecond':_0x16a69b[_0xa562('0x4a')],'erlangAbandonmentRate':_0x16a69b[_0xa562('0x4b')],'erlangBusyFactor':_0x16a69b['erlangBusyFactor'],'startPredictive':_0x16a69b[_0xa562('0x4c')],'startProgressive':_0x16a69b[_0xa562('0x4d')]};if(_0x16a69b[_0xa562('0x4e')]){_0x43905d['Trunk']={'id':_0x16a69b['Trunk']['id'],'name':_0x16a69b[_0xa562('0x4e')][_0xa562('0x4f')],'active':_0x16a69b[_0xa562('0x4e')][_0xa562('0x50')],'callerid':_0x16a69b['Trunk'][_0xa562('0x51')]};}if(_0x16a69b['Interval']){_0x43905d[_0xa562('0x52')]={'id':_0x16a69b[_0xa562('0x52')]['id'],'name':_0x16a69b[_0xa562('0x52')][_0xa562('0x4f')]};}var _0x1ff0c4=md5(JSON[_0xa562('0x53')](_0x43905d));if(_0x16a69b[_0xa562('0x4')]!==_0x1ff0c4){_0x16a69b[_0xa562('0x4')]=_0x1ff0c4;emit(util['format'](_0xa562('0x54'),_0x43905d[_0xa562('0x4f')]),_0xa562('0x55'),_0x43905d);}}}function emitVoiceQueueChannelRemove(_0xecddc5){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xa562('0x53')](_0xecddc5));emit(util['format'](_0xa562('0x54'),_0xecddc5[_0xa562('0x4f')]),_0xa562('0x56'),_0xecddc5);io[_0xa562('0x24')](_0xa562('0x57'),_0xecddc5);}function notSendMessagesQueue(_0x1e8dd3){if(_0x1e8dd3[_0xa562('0x58')]){if(_0x1e8dd3[_0xa562('0x49')]===0x0&&_0x1e8dd3['pTalking']===0x0){_0x1e8dd3[_0xa562('0x58')]=![];_0x1e8dd3[_0xa562('0x28')]=0x0;_0x1e8dd3[_0xa562('0x59')]=0x0;_0x1e8dd3['message']='NOT_ACTIVE';ut['logger'](_0xa562('0x5a'),_0x1e8dd3[_0xa562('0x4f')]+'\x20is\x20not\x20active');}else{_0x1e8dd3[_0xa562('0x5b')]=_0xa562('0x5c');ut['logger'](_0xa562('0x5a'),_0x1e8dd3[_0xa562('0x4f')]+_0xa562('0x5d'));}emitCampaignPreview(_0x1e8dd3);}}Preview[_0xa562('0x5e')][_0xa562('0x23')]=function(){var _0x278444=this;setInterval(function(){_0x278444[_0xa562('0x5f')]();},0x7cf);};Preview[_0xa562('0x5e')][_0xa562('0x5f')]=function(){var _0x6d6255=this[_0xa562('0x60')];this[_0xa562('0x17')]+=0x1;for(var _0x1d2ab1 in _0x6d6255){if(_0x6d6255[_0xa562('0x61')](_0x1d2ab1)&&(_0x6d6255[_0x1d2ab1][_0xa562('0x32')]===_0xa562('0x7')||_0x6d6255[_0x1d2ab1][_0xa562('0x32')]===_0xa562('0x62'))&&_0x6d6255[_0x1d2ab1][_0xa562('0x25')]===_0xa562('0x26')){if(this[_0xa562('0x17')]>0x7){this[_0xa562('0x17')]=0x0;this[_0xa562('0x63')]();}}if(_0x6d6255['hasOwnProperty'](_0x1d2ab1)&&_0x6d6255[_0x1d2ab1]['dialMethod']===_0xa562('0x7')&&_0x6d6255[_0x1d2ab1][_0xa562('0x25')]===_0xa562('0x26')){if(_0x6d6255[_0x1d2ab1][_0xa562('0x31')]){this[_0xa562('0x64')](_0x6d6255[_0x1d2ab1]);if(_0x6d6255[_0x1d2ab1]['dialPreviewAutoRecallMe'])this[_0xa562('0x65')](_0x6d6255[_0x1d2ab1]);}else{notSendMessagesQueue(_0x6d6255[_0x1d2ab1]);}}}};Preview[_0xa562('0x5e')][_0xa562('0x66')]=function(_0x20ba1f){var _0x52df40=this;this['sequence']['enqueue'](function(){if(!_[_0xa562('0x67')](_0x52df40[_0xa562('0x68')][_0x20ba1f])){loggerAction[_0xa562('0x69')]('[clearZombieChannels][talking]',_0x20ba1f,_0xa562('0x6a'),_0x52df40['actions'][_0x20ba1f][_0xa562('0x6b')],'originated:\x20',JSON[_0xa562('0x53')](_0x52df40['campaignsPreview'][_0x52df40[_0xa562('0x68')][_0x20ba1f][_0xa562('0x6b')]][_0xa562('0x49')]),'pTalking:\x20',JSON['stringify'](_0x52df40[_0xa562('0x60')][_0x52df40[_0xa562('0x68')][_0x20ba1f]['queue']]['pTalking']),JSON[_0xa562('0x53')](_0x52df40[_0xa562('0x68')][_0x20ba1f]['dialAnswer']),JSON['stringify'](_[_0xa562('0x6c')](_0x52df40[_0xa562('0x68')][_0x20ba1f],[_0xa562('0x6d'),_0xa562('0x6e'),_0xa562('0x6f'),_0xa562('0x70')])));return ami[_0xa562('0x71')]({'action':_0xa562('0x72'),'channel':_0x52df40[_0xa562('0x68')][_0x20ba1f][_0xa562('0x73')]})[_0xa562('0x74')](function(_0x33ddde){if(_0x33ddde['message']===_0xa562('0x75')){setTimeout(function(){if(_0x52df40[_0xa562('0x68')][_0x20ba1f]){ut['updateOriginated'](_0x52df40[_0xa562('0x60')][_0x52df40['actions'][_0x20ba1f][_0xa562('0x6b')]],'[clearZombieChannel]');if(_0x52df40['actions'][_0x20ba1f][_0xa562('0x76')]===!![]){ut[_0xa562('0x77')](_0x52df40[_0xa562('0x60')][_0x52df40['actions'][_0x20ba1f]['queue']],_0xa562('0x78'));ut[_0xa562('0x79')]('[Dialer][checkChannel][pTalking][Preview]'+_0x20ba1f,_0x52df40['actions'][_0x20ba1f][_0xa562('0x6b')]);}ut[_0xa562('0x79')](_0xa562('0x7a')+_0x20ba1f,_0x52df40[_0xa562('0x68')][_0x20ba1f][_0xa562('0x6b')]);delete _0x52df40[_0xa562('0x68')][_0x20ba1f];}},0x2328);}});}});};Preview[_0xa562('0x5e')][_0xa562('0x63')]=function(){var _0x2971ad=this;loggerAction[_0xa562('0x69')](_0xa562('0x7b'),_['size'](this[_0xa562('0x68')]));for(var _0x5dd0ca in this[_0xa562('0x68')]){if(_0x2971ad[_0xa562('0x68')][_0xa562('0x61')](_0x5dd0ca)){_0x2971ad[_0xa562('0x66')](_0x5dd0ca);}}};Preview['prototype'][_0xa562('0x65')]=function(_0x3a0ed1){var _0xb349e6=this;rpcDb[_0xa562('0x7c')](_0x3a0ed1['id'],ut[_0xa562('0x7d')](this[_0xa562('0x16')]))[_0xa562('0x7e')](function(_0x3c20e4){if(!_[_0xa562('0x67')](_0x3c20e4)){for(var _0x5d0104=0x0;_0x5d0104<_0x3c20e4[_0xa562('0x7f')];_0x5d0104+=0x1){if(ut[_0xa562('0x80')](_0x3c20e4[_0x5d0104][_0xa562('0x81')])<_0x3a0ed1[_0xa562('0x82')]*0x3c){if(_0x3c20e4[_0x5d0104][_0xa562('0x83')]&&!_0x3c20e4[_0x5d0104]['Agent'][_0xa562('0x84')]){_0xb349e6['run'](_0x3c20e4[_0x5d0104]['id'])[_0xa562('0x7e')](ut[_0xa562('0x85')](_0xa562('0x86')))[_0xa562('0x74')](ut['logger2'](_0xa562('0x86')));}else{rpcDb['disableContact'](_0x3c20e4[_0x5d0104]['id']);}}else{var _0x25781c=new Action(_0x3c20e4[_0x5d0104],_0x3a0ed1);_0x25781c['starttime']=moment()[_0xa562('0x87')](_0xa562('0x88'));_0x3a0ed1[_0xa562('0x3d')]+=0x1;ut[_0xa562('0x89')](_0x25781c,0x17,'RecallInQueue');if(_0x3a0ed1[_0xa562('0x8a')]){rpcDb[_0xa562('0x8b')](ut[_0xa562('0x8c')](_0x3c20e4[_0x5d0104]));rpcDb[_0xa562('0x8d')](_0x25781c,_0xa562('0x8e'));}else{ut['logCustomer'](_0x25781c,0x16,_0xa562('0x8f'));rpcDb['createCustomerHistory'](_0x25781c,_0xa562('0x90'));rpcDb[_0xa562('0x91')](_0x25781c,_0xa562('0x90'));}}}}})[_0xa562('0x74')](ut['logger2'](_0xa562('0x92')));};Preview[_0xa562('0x5e')][_0xa562('0x64')]=function(_0x22de76){_0x22de76['sendMessageOneNotActive']=!![];if(ut[_0xa562('0x93')](_0x22de76[_0xa562('0x29')])){_0x22de76[_0xa562('0x5b')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x22de76[_0xa562('0x31')])){_0x22de76[_0xa562('0x5b')]=_0xa562('0x94');}else if(!this['isTrunkReachable'](_0x22de76[_0xa562('0x4e')])){if(!this[_0xa562('0x95')](_0x22de76[_0xa562('0x96')])){_0x22de76[_0xa562('0x5b')]='TRUNK_IS_NOT_REACHABLE';}else{_0x22de76[_0xa562('0x5b')]=_0xa562('0x97');}}else{_0x22de76[_0xa562('0x5b')]=_0xa562('0x97');}emitCampaignPreview(_0x22de76);};Preview[_0xa562('0x5e')][_0xa562('0x98')]=function(_0x55b75b,_0x4fed3e,_0x46afb1){var _0x7e9bb=this;var _0x2661ca=this[_0xa562('0x68')][_0x4fed3e];var _0x41af73=this['campaignsPreview'][_0x2661ca[_0xa562('0x6b')]];var _0x4b9ad6;var _0x308728=![];var _0x2bed7e=0x2;var _0x17c6f9=0x3;if(_0x41af73){switch(_0x46afb1){case'1':_0x41af73[_0xa562('0x99')]+=0x1;_0x2661ca[_0xa562('0x9a')]+=0x1;_0x2661ca[_0xa562('0x9b')]=ut[_0xa562('0x9c')](_0x2661ca);ut[_0xa562('0x89')](_0x2661ca,0x0,'NoSuchNumber');ami[_0xa562('0x24')](_0xa562('0x9d'),ut[_0xa562('0x9e')](_0x2661ca,'nosuchnumber'));rpcDb[_0xa562('0x8d')](_0x2661ca,_0xa562('0x9f'));_0x7e9bb[_0xa562('0xa0')](_0x2661ca,'0',_0x41af73)[_0xa562('0x7e')](function(_0x188271){_0x308728=_0x188271[_0xa562('0xa1')]==0x1;_0x2bed7e=_0x41af73[_0xa562('0xa2')];_0x17c6f9=_0x41af73[_0xa562('0xa3')];if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut[_0xa562('0xa5')](_0x2661ca,0xf,'Global');rpcDb['createCustomerFinal'](_0x4b9ad6,_0xa562('0xa6'));}else{if(_0x2661ca[_0xa562('0x9a')]>=_0x41af73[_0xa562('0xa7')]){rpcDb[_0xa562('0x91')](_0x2661ca,_0xa562('0xa6'));}else{rpcDb[_0xa562('0xa8')](ut[_0xa562('0xa9')](_0x2661ca,'countnosuchnumberretry',_0x41af73[_0xa562('0xa2')]),_0x2661ca['unlockAgent'],_0x2661ca['activeContact']);}}delete this[_0xa562('0x68')][_0x55b75b['linkedid']];}else{_0x2661ca['countnosuchnumberretry']++;logger['info'](_0xa562('0xaa'),_0x2661ca['countnosuchnumberretry']);logger[_0xa562('0x69')]('id',_0x2661ca[_0xa562('0xab')]);_0x7e9bb[_0xa562('0xac')]({'id':_0x2661ca[_0xa562('0xab')],'field':{'countnosuchnumberretry':_0x2661ca[_0xa562('0x9a')]}})[_0xa562('0x7e')](function(){_0x7e9bb[_0xa562('0xad')](_0x2661ca,_0x2bed7e,_0x17c6f9)[_0xa562('0x7e')](function(){});});}});break;case _0xa562('0xae'):var _0x3085a2=moment()['format'](_0xa562('0x88'));_0x2661ca[_0xa562('0xaf')]=_0x3085a2;_0x2661ca[_0xa562('0xb0')]=_0x3085a2;_0x2661ca[_0xa562('0x76')]=!![];_0x41af73[_0xa562('0x2a')]+=0x1;logger['info'](_0xa562('0xb1'),_0x2661ca['uniqueid'],'\x20Queue',_0x41af73[_0xa562('0x4f')],_0xa562('0xb2'),_0x41af73['pTalking']);ami[_0xa562('0x24')]('custom:agentconnect',ut['buildObj'](_0x2661ca,_0xa562('0xb3'),this[_0xa562('0x60')][_0x2661ca['queue']]));if(_0x41af73[_0xa562('0xb4')]){ami[_0xa562('0x24')](_0xa562('0xb5'),ut['buildAcw'](_0x2661ca));}break;case'16':ami['emit'](_0xa562('0xb6'),ut[_0xa562('0x9e')](_0x2661ca,_0xa562('0xb7'),this[_0xa562('0x60')][_0x2661ca[_0xa562('0x6b')]]));emitVoiceQueueChannelRemove(ut[_0xa562('0x9e')](_0x2661ca,_0xa562('0xb7')));_0x41af73[_0xa562('0x37')]+=0x1;_0x41af73[_0xa562('0x2e')]+=0x1;_0x41af73['answered']+=0x1;ut[_0xa562('0x77')](_0x41af73,_0xa562('0xb8'));_0x2661ca['countglobal']=ut[_0xa562('0x9c')](_0x2661ca);ut[_0xa562('0x89')](_0x2661ca,0x4,'Answer');rpcDb[_0xa562('0x8d')](_0x2661ca,_0xa562('0xb9'));rpcDb['createCustomerFinal'](_0x2661ca,_0xa562('0xba'));rpcDb[_0xa562('0xbb')](_0x2661ca);_0x41af73['sumDuration']+=_0x2661ca[_0xa562('0xbc')];_0x41af73[_0xa562('0x2b')]+=_0x2661ca[_0xa562('0xbc')];logger['info'](_0xa562('0xbd'),_0x2661ca['uniqueid'],'\x20Queue',_0x41af73[_0xa562('0x4f')],'pTalking:\x20',_0x41af73[_0xa562('0x2a')]);delete this['actions'][_0x55b75b['linkedid']];break;case _0xa562('0xbe'):_0x41af73['outboundBusyCallsDay']+=0x1;_0x2661ca[_0xa562('0xbf')]+=0x1;_0x2661ca[_0xa562('0x9b')]=ut[_0xa562('0x9c')](_0x2661ca);ut['logCustomer'](_0x2661ca,0x5,_0xa562('0xc0'));_0x2bed7e=_0x41af73[_0xa562('0xc1')];_0x17c6f9=_0x41af73[_0xa562('0xa3')];ami[_0xa562('0x24')](_0xa562('0xc2'),ut[_0xa562('0x9e')](_0x2661ca,'busy'));rpcDb['createCustomerHistory'](_0x2661ca,_0xa562('0xc3'));_0x7e9bb[_0xa562('0xa0')](_0x2661ca,'5',_0x41af73)[_0xa562('0x7e')](function(_0x330ac0){_0x308728=_0x330ac0[_0xa562('0xa1')]==0x1;if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut[_0xa562('0xa5')](_0x2661ca,0xf,'Global');rpcDb[_0xa562('0x91')](_0x4b9ad6,_0xa562('0xc4'));}else{if(_0x2661ca[_0xa562('0xbf')]>=_0x41af73[_0xa562('0xc5')]){rpcDb[_0xa562('0x91')](_0x2661ca,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0xa562('0xa9')](_0x2661ca,_0xa562('0xbf'),_0x41af73[_0xa562('0xc1')]),_0x2661ca[_0xa562('0xc6')],_0x2661ca[_0xa562('0xc7')]);}}}else{_0x2661ca['countbusyretry']++;_0x7e9bb[_0xa562('0xac')]({'id':_0x2661ca[_0xa562('0xab')],'field':{'countbusyretry':_0x2661ca[_0xa562('0xbf')]}})[_0xa562('0x7e')](function(){_0x7e9bb[_0xa562('0xad')](_0x2661ca,_0x2bed7e,_0x17c6f9)[_0xa562('0x7e')](function(){});});}});break;case _0xa562('0xc8'):_0x41af73[_0xa562('0xc9')]+=0x1;_0x2661ca[_0xa562('0xca')]+=0x1;_0x2661ca[_0xa562('0x9b')]=ut[_0xa562('0x9c')](_0x2661ca);ut[_0xa562('0x89')](_0x2661ca,0x3,_0xa562('0xcb'));_0x2bed7e=_0x41af73[_0xa562('0xcc')];_0x17c6f9=_0x41af73[_0xa562('0xa3')];var _0x549079=ut['buildNoAnswerEventPayload'](_0x2661ca,_0x41af73);ami[_0xa562('0x24')](_0xa562('0xcd'),_0x549079);rpcDb[_0xa562('0x8d')](_0x2661ca,'[callProgressDetectingCustomer][logNoAnswer]');_0x7e9bb[_0xa562('0xa0')](_0x2661ca,'3',_0x41af73)[_0xa562('0x7e')](function(_0x4e12dc){_0x308728=_0x4e12dc[_0xa562('0xa1')]==0x1;if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut[_0xa562('0xa5')](_0x2661ca,0xf,_0xa562('0xce'));rpcDb[_0xa562('0x91')](_0x4b9ad6,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x2661ca[_0xa562('0xca')]>=_0x41af73[_0xa562('0xcf')]){rpcDb[_0xa562('0x91')](_0x2661ca,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xa562('0xa8')](ut['scheduledAt'](_0x2661ca,_0xa562('0xca'),_0x41af73[_0xa562('0xcc')]),_0x2661ca[_0xa562('0xc6')],_0x2661ca[_0xa562('0xc7')]);}}}else{_0x2661ca[_0xa562('0xca')]++;_0x7e9bb[_0xa562('0xac')]({'id':_0x2661ca[_0xa562('0xab')],'field':{'countnoanswerretry':_0x2661ca[_0xa562('0xca')]}})['then'](function(){_0x7e9bb[_0xa562('0xad')](_0x2661ca,_0x2bed7e,_0x17c6f9)['then'](function(){});});}});break;case'CONGESTION':_0x41af73[_0xa562('0xd0')]+=0x1;_0x2661ca['countcongestionretry']+=0x1;_0x2661ca['countglobal']=ut[_0xa562('0x9c')](_0x2661ca);ut[_0xa562('0x89')](_0x2661ca,0x8,'Congestion');_0x2bed7e=_0x41af73[_0xa562('0xd1')];_0x17c6f9=_0x41af73['callAdditionalPhoneAfterMin'];ami[_0xa562('0x24')](_0xa562('0xd2'),ut['buildObj'](_0x2661ca,_0xa562('0xd3')));rpcDb[_0xa562('0x8d')](_0x2661ca,_0xa562('0xd4'));_0x7e9bb[_0xa562('0xa0')](_0x2661ca,'8',_0x41af73)[_0xa562('0x7e')](function(_0xf7a874){_0x308728=_0xf7a874['additional']==0x1;if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut[_0xa562('0xa5')](_0x2661ca,0xf,_0xa562('0xce'));rpcDb[_0xa562('0x91')](_0x4b9ad6,_0xa562('0xd5'));}else{if(_0x2661ca[_0xa562('0xd6')]>=_0x41af73['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x2661ca,_0xa562('0xd4'));}else{rpcDb[_0xa562('0xa8')](ut[_0xa562('0xa9')](_0x2661ca,'countcongestionretry',_0x41af73[_0xa562('0xc1')]),_0x2661ca[_0xa562('0xc6')],_0x2661ca[_0xa562('0xc7')]);}}}else{_0x2661ca['countcongestionretry']++;_0x7e9bb['incrementPreviewCounters']({'id':_0x2661ca[_0xa562('0xab')],'field':{'countcongestionretry':_0x2661ca[_0xa562('0xd6')]}})[_0xa562('0x7e')](function(){_0x7e9bb[_0xa562('0xad')](_0x2661ca,_0x2bed7e,_0x17c6f9)['then'](function(){});});}});break;case _0xa562('0xd7'):_0x41af73['outboundRejectCallsDay']+=0x1;_0x2661ca[_0xa562('0xd8')]+=0x1;_0x2661ca[_0xa562('0x9b')]=ut[_0xa562('0x9c')](_0x2661ca);ut[_0xa562('0x89')](_0x2661ca,0x14,_0xa562('0xd9'));_0x2bed7e=_0x41af73['dialAgentRejectRetryFrequency'];_0x17c6f9=_0x41af73[_0xa562('0xa3')];ami[_0xa562('0x24')](_0xa562('0xda'),ut[_0xa562('0x9e')](_0x2661ca,_0xa562('0xdb')));rpcDb[_0xa562('0x8d')](_0x2661ca,_0xa562('0xdc'));_0x7e9bb['verifyAdditionalPhones'](_0x2661ca,'20',_0x41af73)['then'](function(_0x3756e0){_0x308728=_0x3756e0[_0xa562('0xa1')]==0x1;if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut[_0xa562('0xa5')](_0x2661ca,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x4b9ad6,_0xa562('0xdd'));}else{if(_0x2661ca[_0xa562('0xd8')]>=_0x41af73[_0xa562('0xde')]){rpcDb[_0xa562('0x91')](_0x2661ca,_0xa562('0xdd'));}else{rpcDb[_0xa562('0xa8')](ut[_0xa562('0xa9')](_0x2661ca,_0xa562('0xd8'),_0x41af73[_0xa562('0xdf')]),_0x2661ca[_0xa562('0xc6')],_0x2661ca[_0xa562('0xc7')]);}}}else{_0x2661ca['countnoanswerretry']++;_0x7e9bb[_0xa562('0xac')]({'id':_0x2661ca[_0xa562('0xab')],'field':{'countnoanswerretry':_0x2661ca['countnoanswerretry']}})[_0xa562('0x7e')](function(){_0x7e9bb[_0xa562('0xad')](_0x2661ca,_0x2bed7e,_0x17c6f9)[_0xa562('0x7e')](function(){});});}});break;case _0xa562('0xe0'):_0x41af73[_0xa562('0x3f')]+=0x1;_0x2661ca['countabandonedretry']+=0x1;_0x2661ca[_0xa562('0x9b')]=ut[_0xa562('0x9c')](_0x2661ca);ut[_0xa562('0x89')](_0x2661ca,0xb,_0xa562('0xe1'));rpcDb['createCustomerHistory'](_0x2661ca,_0xa562('0xe2'));_0x7e9bb[_0xa562('0xa0')](_0x2661ca,'11',_0x41af73)[_0xa562('0x7e')](function(_0x549556){_0x308728=_0x549556[_0xa562('0xa1')]==0x1;if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut[_0xa562('0xa5')](_0x2661ca,0xf,_0xa562('0xce'));rpcDb[_0xa562('0x91')](_0x4b9ad6,_0xa562('0xe2'));}else{if(_0x2661ca[_0xa562('0xe3')]>=_0x41af73['dialAbandonedMaxRety']){rpcDb[_0xa562('0x91')](_0x2661ca,_0xa562('0xe2'));}else{rpcDb[_0xa562('0xa8')](ut[_0xa562('0xa9')](_0x2661ca,'countabandonedretry',_0x41af73['dialAbandonedRetryFrequency']),_0x2661ca[_0xa562('0xc6')],_0x2661ca['activeContact']);}}}else{_0x2661ca[_0xa562('0xca')]++;_0x7e9bb[_0xa562('0xac')]({'id':_0x2661ca['idContact'],'field':{'countnoanswerretry':_0x2661ca[_0xa562('0xca')]}})['then'](function(){_0x7e9bb[_0xa562('0xad')](_0x2661ca,_0x2bed7e,_0x17c6f9)[_0xa562('0x7e')](function(){});});}});break;case'18':_0x41af73['outboundUnknownCallsDay']+=0x1;_0x2661ca[_0xa562('0xe4')]+=0x1;_0x2661ca[_0xa562('0x9b')]=ut[_0xa562('0x9c')](_0x2661ca);ut['logCustomer'](_0x2661ca,0x12,_0x55b75b[_0xa562('0xe5')]||_0x55b75b[_0xa562('0xe6')]);ami[_0xa562('0x24')](_0xa562('0xe7'),ut['buildObj'](_0x2661ca,_0xa562('0xe8')));rpcDb[_0xa562('0x8d')](_0x2661ca,_0xa562('0xe9'));_0x7e9bb[_0xa562('0xa0')](_0x2661ca,'18',_0x41af73)[_0xa562('0x7e')](function(_0x575b8a){_0x308728=_0x575b8a[_0xa562('0xa1')]==0x1;if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut['cloneAction'](_0x2661ca,0x12,'Global');rpcDb['createCustomerFinal'](_0x4b9ad6,_0xa562('0xe9'));}else{rpcDb['createCustomerFinal'](_0x2661ca,_0xa562('0xe9'));}}else{_0x2661ca[_0xa562('0xca')]++;_0x7e9bb[_0xa562('0xac')]({'id':_0x2661ca[_0xa562('0xab')],'field':{'countnoanswerretry':_0x2661ca['countnoanswerretry']}})[_0xa562('0x7e')](function(){_0x7e9bb[_0xa562('0xad')](_0x2661ca,_0x2bed7e,_0x17c6f9)['then'](function(){});});}});delete this[_0xa562('0x68')][_0x55b75b['linkedid']];break;case'19':_0x41af73[_0xa562('0xea')]+=0x1;_0x2661ca[_0xa562('0x9b')]=ut[_0xa562('0x9c')](_0x2661ca);ut[_0xa562('0x89')](_0x2661ca,0x13,_0x55b75b['cause-txt']||_0x55b75b[_0xa562('0xe6')]);ami[_0xa562('0x24')]('custom:amd',ut['buildObj'](_0x2661ca,'amd'));rpcDb[_0xa562('0x8d')](_0x2661ca,_0xa562('0xeb'));_0x7e9bb['verifyAdditionalPhones'](_0x2661ca,'18',_0x41af73)[_0xa562('0x7e')](function(_0x317e90){_0x308728=_0x317e90[_0xa562('0xa1')]==0x1;if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut[_0xa562('0xa5')](_0x2661ca,0xf,'Global');rpcDb[_0xa562('0x91')](_0x4b9ad6,_0xa562('0xeb'));}else{rpcDb[_0xa562('0x91')](_0x2661ca,_0xa562('0xeb'));}}else{_0x2661ca[_0xa562('0xca')]++;_0x7e9bb['incrementPreviewCounters']({'id':_0x2661ca['idContact'],'field':{'countnoanswerretry':_0x2661ca[_0xa562('0xca')]}})[_0xa562('0x7e')](function(){_0x7e9bb['swapAdditionalPhones'](_0x2661ca,_0x2bed7e,_0x17c6f9)['then'](function(){});});}});delete this[_0xa562('0x68')][_0x55b75b[_0xa562('0xec')]];break;default:if(_0x2661ca[_0xa562('0x76')]){ut[_0xa562('0x77')](_0x41af73,_0xa562('0xed'));ut[_0xa562('0x79')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x41af73[_0xa562('0x4f')],_0x55b75b);}_0x41af73[_0xa562('0xea')]+=0x1;_0x2661ca['countglobal']=ut[_0xa562('0x9c')](_0x2661ca);ut['logCustomer'](_0x2661ca,0xc,_0x55b75b['cause-txt']||_0x55b75b['dialstatus']);_0x2bed7e=_0x41af73['dialAgentRejectRetryFrequency'];_0x17c6f9=_0x41af73[_0xa562('0xa3')];rpcDb[_0xa562('0x8d')](_0x2661ca,_0xa562('0xee'));_0x7e9bb[_0xa562('0xa0')](_0x2661ca,'20',_0x41af73)[_0xa562('0x7e')](function(_0x538b80){_0x308728=_0x538b80[_0xa562('0xa1')]==0x1;if(!_0x308728){if(ut[_0xa562('0x9c')](_0x2661ca)>=_0x41af73[_0xa562('0xa4')]){_0x4b9ad6=ut[_0xa562('0xa5')](_0x2661ca,0xf,_0xa562('0xce'));rpcDb[_0xa562('0x91')](_0x4b9ad6,_0xa562('0xef'));}else{rpcDb[_0xa562('0x91')](_0x2661ca,_0xa562('0xef'));}delete this['actions'][_0x55b75b[_0xa562('0xec')]];}else{_0x7e9bb['swapAdditionalPhones'](_0x2661ca,_0x2bed7e,_0x17c6f9)[_0xa562('0x7e')](function(){});}});}if(!(_0x2661ca[_0xa562('0x76')]&&_0x46afb1==='16')){ut['updateOriginated'](_0x41af73,'[callProgressDetectingCustomer]');logger[_0xa562('0x69')](_0xa562('0xf0'),_0x2661ca[_0xa562('0xf1')],_0xa562('0xf2'),_0x41af73[_0xa562('0x4f')],_0xa562('0xf3'),_0x41af73[_0xa562('0x49')]);}if(_0x46afb1!==_0xa562('0xae')){delete this['actions'][_0x55b75b[_0xa562('0xec')]];delete this['actions'][_0x55b75b[_0xa562('0xf4')]];}}};Preview[_0xa562('0x5e')][_0xa562('0xf5')]=function(_0xb30eb9,_0x2222b9,_0x162e58){if(_[_0xa562('0xf6')](_0x2222b9)&&_0xa562('0xf7')!==typeof _0x2222b9){return;}if(_['isUndefined'](_0x162e58)&&_0xa562('0xf7')!==typeof _0x162e58){return;}switch(_0x162e58['reason']){case'0':ut[_0xa562('0xf8')](_0xb30eb9,0x0,_0xa562('0xf9'));rpcDb['createAgentHistory'](_0xb30eb9,_0xa562('0xfa'));break;case'3':ut[_0xa562('0xf8')](_0xb30eb9,0x3,_0xa562('0xcb'));rpcDb[_0xa562('0xfb')](_0xb30eb9,_0xa562('0xfc'));break;case'5':ut[_0xa562('0xf8')](_0xb30eb9,0x5,_0xa562('0xc0'));rpcDb[_0xa562('0xfb')](_0xb30eb9,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xa562('0xf8')](_0xb30eb9,0x8,'Congestion');rpcDb['createAgentHistory'](_0xb30eb9,_0xa562('0xfd'));break;case'22':ut[_0xa562('0xf8')](_0xb30eb9,0x16,_0xa562('0xfe'));rpcDb[_0xa562('0xfb')](_0xb30eb9,_0xa562('0xff'));break;default:ut[_0xa562('0xf8')](_0xb30eb9,0xc,_0x162e58['reason']);rpcDb['createAgentHistory'](_0xb30eb9,_0xa562('0xfd'));}ut[_0xa562('0x100')](_0x2222b9,_0xa562('0x101'));logger[_0xa562('0x69')]('[originated][decrement][callProgressDetectingAgent]',_0xb30eb9['uniqueid'],_0xa562('0xf2'),_0x2222b9[_0xa562('0x4f')],_0xa562('0xf3'),_0x2222b9[_0xa562('0x49')]);delete this[_0xa562('0x68')][_0xb30eb9['uniqueid']];};Preview[_0xa562('0x5e')][_0xa562('0xa0')]=function(_0x8ee729,_0x336fac,_0x5516d5){return Promise[_0xa562('0x102')]()[_0xa562('0x7e')](cmHopperAdditionalPhone[_0xa562('0xa0')](_0x8ee729,_0x336fac,_0x5516d5))[_0xa562('0x74')](logger[_0xa562('0x69')](_0xa562('0x103')));};Preview[_0xa562('0x5e')][_0xa562('0xad')]=function(_0x11fd92,_0x36837d,_0x3ac00f){return Promise[_0xa562('0x102')]()[_0xa562('0x7e')](cmHopperAdditionalPhone[_0xa562('0xad')](_0x11fd92,_0x36837d,_0x3ac00f))['catch'](logger['info'](_0xa562('0x104')));};Preview[_0xa562('0x5e')][_0xa562('0xac')]=function(_0x43de13){return Promise[_0xa562('0x102')]()[_0xa562('0x7e')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x43de13))[_0xa562('0x74')](logger[_0xa562('0x69')]('[incrementPreviewCounters]\x20'));};Preview[_0xa562('0x5e')]['checkInBlack']=function(_0x4559f4,_0x35535b,_0x1bbc17,_0x3ae64d,_0xc6ee2f){var _0x4a551f=this;return new Promise(function(_0x5f21df,_0x3e7927){if(_['isNil'](_0x35535b)||_[_0xa562('0x67')](_0x35535b['Contact'])||_['isNil'](_0x35535b[_0xa562('0x105')])||_[_0xa562('0x67')](_0x35535b['VoiceQueueId'])){_0x3e7927(ut[_0xa562('0x5b')]('Contact\x20is\x20undefined',_0x3ae64d,_0xc6ee2f));return;}var _0x4d21ad=uuid['v4']();var _0x5bdf16=_0x4a551f['campaignsPreview'][_0x35535b[_0xa562('0x6a')][_0xa562('0x4f')]];var _0x243847=_0x1bbc17?_0x4a551f[_0xa562('0x16')][_0x1bbc17]['id']:undefined;_0x4a551f[_0xa562('0x68')][_0x4d21ad]=new Action(_0x35535b,_0x5bdf16,_0x4d21ad,_0x1bbc17,_0x243847);var _0x5252b4=_0x4a551f[_0xa562('0x68')][_0x4d21ad];_0x5252b4[_0xa562('0xc6')]=_0x3ae64d;_0x5252b4[_0xa562('0xc7')]=_0xc6ee2f;_0x5252b4[_0xa562('0x106')]=_0x1bbc17;if(_[_0xa562('0x107')](_0x4559f4)){_0x4a551f['execCall'](_0x5252b4,_0x5bdf16,_0x35535b,_0x1bbc17)[_0xa562('0x7e')](function(_0x51c53d){logger['info'](_0xa562('0x108'),_0xa562('0x109')+_0x5252b4[_0xa562('0x6b')]+'\x20IdHopper:\x20'+_0x5252b4[_0xa562('0xab')],JSON[_0xa562('0x53')](_0x51c53d));ami[_0xa562('0x24')](_0xa562('0x10a'),ut[_0xa562('0x9e')](_0x5252b4,_0xa562('0x10b'),_0x4a551f[_0xa562('0x60')][_0x5252b4[_0xa562('0x6b')]]));_0x5f21df(ut[_0xa562('0x5b')](_0xa562('0x10c')));})[_0xa562('0x74')](function(_0x25b9d7){ut[_0xa562('0x10d')](_0xa562('0x10e'),_0x25b9d7);_0x3e7927(ut['message'](_0xa562('0x10f'),_0x3ae64d,_0xc6ee2f));});}else{_0x5bdf16[_0xa562('0x38')]+=0x1;ut[_0xa562('0x110')](_0x5252b4);rpcDb[_0xa562('0x111')](_0x5252b4,_0xa562('0x112'));delete _0x4a551f[_0xa562('0x68')][_0x4d21ad];_0x3e7927(ut[_0xa562('0x5b')](_0xa562('0x113'),_0x3ae64d,_0xc6ee2f));}});};Preview[_0xa562('0x5e')][_0xa562('0x95')]=function(_0x5247ba){return!_[_0xa562('0x67')](_0x5247ba)&&!_[_0xa562('0x67')](_0x5247ba[_0xa562('0x4f')])&&!_['isNil'](_0x5247ba[_0xa562('0x50')])&&_0x5247ba[_0xa562('0x50')]&&!_[_0xa562('0x67')](this[_0xa562('0x15')][util[_0xa562('0x87')](_0xa562('0x114'),_0x5247ba['name'])])&&!_[_0xa562('0x67')](this['trunks'][util['format']('SIP/%s',_0x5247ba[_0xa562('0x4f')])][_0xa562('0x72')])&&(this[_0xa562('0x15')][util[_0xa562('0x87')](_0xa562('0x114'),_0x5247ba['name'])]['status']===_0xa562('0x115')||this[_0xa562('0x15')][util['format'](_0xa562('0x114'),_0x5247ba[_0xa562('0x4f')])][_0xa562('0x72')]==='unmonitored');};Preview[_0xa562('0x5e')][_0xa562('0x116')]=function(_0x191067,_0x1cbd3d){var _0x568faa=this;return new Promise(function(_0x3f160b,_0xe378de){_0x568faa[_0xa562('0x117')](_0x191067,_0x1cbd3d)['then'](function(_0x34188b){_0x3f160b(_[_0xa562('0x6c')](_0x34188b,['message']));})['catch'](function(_0xfa5f87){if(_0xfa5f87[_0xa562('0x118')]){rpcDb[_0xa562('0x119')](_0x191067);}if(_0xfa5f87['active']){rpcDb['disableContact'](_0x191067);}_0xe378de(_[_0xa562('0x6c')](_0xfa5f87,['message']));});});};Preview[_0xa562('0x5e')]['execRun']=function(_0x4b0ee6,_0x3909e7){var _0x5af09f=this;return new Promise(function(_0x197e8f,_0x2a6702){var _0x1840bd,_0x382187;rpcDb[_0xa562('0x11a')](_0x4b0ee6)[_0xa562('0x7e')](function(_0x46b792){if(!_[_0xa562('0x67')](_0x46b792[0x0])){_0x382187=_0x46b792[0x0][_0xa562('0x11b')]?![]:!![];_0x1840bd=_0x46b792[0x0]['recallme']?!![]:![];_0x1840bd=_0x3909e7?!![]:_0x1840bd;}var _0x523fa7=_0x5af09f[_0xa562('0x11c')](_0x46b792);if(_0x523fa7['isValid']){rpcDb['checkIsBlackList'](_[_0xa562('0x6c')](_0x46b792[0x0],[_0xa562('0x6f'),_0xa562('0x105')]))[_0xa562('0x7e')](function(_0x178de5){_0x5af09f[_0xa562('0x11d')](_0x178de5,_0x46b792[0x0],_0x3909e7,_0x382187,_0x1840bd)[_0xa562('0x7e')](function(_0xb0acba){_0x197e8f(_0xb0acba);})[_0xa562('0x74')](function(_0x18953a){_0x2a6702(_0x18953a);});})[_0xa562('0x74')](function(_0x39cf8c){ut['logger'](_0xa562('0x11e'),_0x39cf8c);_0x2a6702(ut['message'](_0xa562('0x11f'),_0x382187,_0x1840bd));});}else{_0x2a6702(ut[_0xa562('0x5b')](_0x523fa7[_0xa562('0x5b')],_0x382187,_0x1840bd));}})[_0xa562('0x74')](function(_0x2339f4){ut['logger'](_0xa562('0x120'),_0x2339f4);_0x2a6702(ut['message'](_0xa562('0x11f'),![],!![]));});});};Preview[_0xa562('0x5e')][_0xa562('0x11c')]=function(_0x28708c){if(_[_0xa562('0x67')](_0x28708c)||_[_0xa562('0x107')](_0x28708c)||!_['isNil'](_0x28708c[0x0][_0xa562('0x83')])&&_[_0xa562('0x67')](_0x28708c[0x0][_0xa562('0x83')][_0xa562('0x4f')])){ut[_0xa562('0x10d')](_0xa562('0x121'),_0x28708c);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x4a8533=this[_0xa562('0x60')][_0x28708c[0x0][_0xa562('0x6a')][_0xa562('0x4f')]];_0x4a8533['message']=_0xa562('0x97');if(_['isNil'](_0x4a8533)){ut[_0xa562('0x10d')](_0xa562('0x122'),_0x4a8533);return{'isValid':![],'message':_0xa562('0x123')};}if(!this[_0xa562('0x95')](_0x4a8533[_0xa562('0x4e')])){ut[_0xa562('0x10d')](_0xa562('0x124'),_0xa562('0x125')+_0x4a8533[_0xa562('0x4f')]+_0xa562('0x126'));if(!this['isTrunkReachable'](_0x4a8533['TrunkBackup'])){ut[_0xa562('0x10d')](_0xa562('0x124'),_0x4a8533[_0xa562('0x4f')]+_0xa562('0x127'));return{'isValid':![],'message':_0xa562('0x128')};}}if(!ut[_0xa562('0x129')](_0x4a8533[_0xa562('0x31')])){ut[_0xa562('0x10d')](_0xa562('0x12a'),_0x4a8533[_0xa562('0x4f')]+_0xa562('0x12b'));return{'isValid':![],'message':_0xa562('0x125')+_0x4a8533[_0xa562('0x4f')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xa562('0x12c')};};Preview['prototype'][_0xa562('0x12d')]=function(_0x1e574e,_0x1e3bb2,_0x4bd087,_0x539aa0){var _0x5a58aa=this;return new Promise(function(_0x5092f4,_0x5c710d){var _0x103c5e=_0x1e574e[_0xa562('0xf1')];var _0x1c80eb=_0x5a58aa[_0xa562('0x95')](_0x1e3bb2['Trunk'])?util[_0xa562('0x87')](_0xa562('0x12e'),_0x1e3bb2[_0xa562('0x4e')][_0xa562('0x4f')],_[_0xa562('0x67')](_0x1e3bb2[_0xa562('0x12f')])?'':_0x1e3bb2[_0xa562('0x12f')][_0xa562('0x130')]()||'',_0x1e3bb2[_0xa562('0x131')]>0x0?_0x4bd087['phone'][_0xa562('0x132')](_0x1e3bb2[_0xa562('0x131')]):_0x4bd087[_0xa562('0x105')]):util[_0xa562('0x87')](_0xa562('0x12e'),_[_0xa562('0x67')](_0x1e3bb2['TrunkBackup'])?_0x1e3bb2['Trunk'][_0xa562('0x4f')]:_0x1e3bb2[_0xa562('0x96')][_0xa562('0x4f')],_[_0xa562('0x67')](_0x1e3bb2[_0xa562('0x12f')])?'':_0x1e3bb2[_0xa562('0x12f')][_0xa562('0x130')]()||'',_0x1e3bb2[_0xa562('0x131')]>0x0?_0x4bd087['phone'][_0xa562('0x132')](_0x1e3bb2[_0xa562('0x131')]):_0x4bd087[_0xa562('0x105')]);var _0x157976=_0x5a58aa[_0xa562('0x95')](_0x1e3bb2[_0xa562('0x4e')])?ut[_0xa562('0x133')](_0x1e3bb2[_0xa562('0x4e')][_0xa562('0x51')],_0x1e3bb2[_0xa562('0x33')],_0x1e3bb2[_0xa562('0x134')]>0x0?ut[_0xa562('0x135')](_0x1e3bb2[_0xa562('0x34')],_0x1e3bb2[_0xa562('0x134')]):_0x1e3bb2[_0xa562('0x34')]):ut[_0xa562('0x133')](_[_0xa562('0x67')](_0x1e3bb2[_0xa562('0x96')])?_0x1e3bb2['Trunk']['callerid']:_0x1e3bb2[_0xa562('0x96')][_0xa562('0x51')],_0x1e3bb2['dialOriginateCallerIdName'],_0x1e3bb2['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1e3bb2['dialOriginateCallerIdNumber'],_0x1e3bb2[_0xa562('0x134')]):_0x1e3bb2['dialOriginateCallerIdNumber']);if(_0x157976){_0x1e574e[_0xa562('0x136')]=ut['extractCalleridName'](_0x157976);_0x1e574e[_0xa562('0x137')]=ut[_0xa562('0x138')](_0x157976);}var _0x3efda2=ut[_0xa562('0x139')](_0x1e3bb2,_0x4bd087,_0x1c80eb,_0x157976,_0x103c5e,_0x1e574e);_['merge'](_0x1e574e,ut[_0xa562('0x13a')](_0x3efda2));_0x1e574e[_0xa562('0x13b')]=moment()[_0xa562('0x87')](_0xa562('0x88'));_0x1e3bb2[_0xa562('0x13c')]=_0x3efda2;ami[_0xa562('0x71')](ut['variablesAction'](_0x1e574e,_0x1e3bb2,_0x3efda2,_0x1e574e[_0xa562('0xc7')],_0x539aa0))[_0xa562('0x7e')](function(_0x4034d9){_0x1e3bb2[_0xa562('0x49')]+=0x1;logger[_0xa562('0x69')](_0xa562('0x13d'),_0x103c5e,_0xa562('0xf2'),_0x1e3bb2[_0xa562('0x4f')],_0xa562('0xf3'),_0x1e3bb2['originated']);_0x5092f4(_0x4034d9);})[_0xa562('0x74')](function(_0x4bd2c7){ut[_0xa562('0xf8')](_0x1e574e,0xe,_0xa562('0x13e'));rpcDb[_0xa562('0xfb')](_0x1e574e,_0xa562('0x13f'));_0x5c710d(_0x4bd2c7);});});};Preview[_0xa562('0x5e')][_0xa562('0x1e')]=function(_0x532b84){if(this[_0xa562('0x68')][_0x532b84[_0xa562('0xec')]]){this[_0xa562('0x68')][_0x532b84[_0xa562('0xec')]][_0xa562('0x73')]=_0x532b84[_0xa562('0x73')];}};Preview[_0xa562('0x5e')]['syncOriginateResponse']=function(_0x49d150){var _0x167220=this;var _0x3ac3d2=this[_0xa562('0x68')][_0x49d150[_0xa562('0x140')]];if(_0x3ac3d2){if(_0x3ac3d2[_0xa562('0x106')]&&this[_0xa562('0x16')][_0x3ac3d2[_0xa562('0x106')]]){ut[_0xa562('0x141')](_0x3ac3d2,this[_0xa562('0x16')][_0x3ac3d2[_0xa562('0x106')]][_0xa562('0x4f')],this[_0xa562('0x16')][_0x3ac3d2[_0xa562('0x106')]]['id']);}var _0x147c7a=_[_0xa562('0x142')](_0x3ac3d2);_0x147c7a[_0xa562('0xaf')]=moment()[_0xa562('0x87')](_0xa562('0x88'));var _0x1fece7=_0x167220[_0xa562('0x60')][_0x3ac3d2[_0xa562('0x6b')]];if(ut[_0xa562('0x143')](_0x49d150[_0xa562('0x144')])){if(_0x3ac3d2[_0xa562('0xc6')]){rpcDb['unlockContact'](_0x3ac3d2[_0xa562('0xab')]);}if(_0x3ac3d2[_0xa562('0xc7')]){rpcDb['disableContact'](_0x3ac3d2[_0xa562('0xab')]);}ami[_0xa562('0x24')]('custom:agentringnoanswer',ut['buildObj'](_0x3ac3d2,_0xa562('0x145'),this[_0xa562('0x60')][_0x3ac3d2[_0xa562('0x6b')]]));this[_0xa562('0xf5')](_0x147c7a,_0x1fece7,_0x49d150);}else{_0x3ac3d2['starttime']=moment()['format'](_0xa562('0x88'));ut[_0xa562('0xf8')](_0x147c7a,0x4,'Answer');rpcDb['createAgentHistory'](_0x147c7a,_0xa562('0x146'));}}};Preview[_0xa562('0x5e')][_0xa562('0x147')]=function(_0x30600a){var _0x531fb3=this[_0xa562('0x68')][_0x30600a[_0xa562('0xec')]];var _0x2bb7ed;if(_0x531fb3){_0x2bb7ed=this[_0xa562('0x60')][_0x531fb3[_0xa562('0x6b')]];logger['info'](_0xa562('0x148'),_0x30600a[_0xa562('0xec')],_0xa562('0xf2'),_0x2bb7ed['name'],_0xa562('0xb2'),_0x2bb7ed[_0xa562('0x2a')]);}if(this[_0xa562('0x68')][_0x30600a[_0xa562('0xec')]]&&_0x30600a[_0xa562('0xec')]!==_0x30600a['uniqueid']){if(_0x30600a[_0xa562('0x149')]==='16'&&this[_0xa562('0x68')][_0x30600a[_0xa562('0xec')]][_0xa562('0x76')]){this[_0xa562('0x98')](_0x30600a,_0x30600a[_0xa562('0xec')],_0x30600a['cause']);}else if(this['actions'][_0x30600a[_0xa562('0xec')]][_0xa562('0x76')]){logger[_0xa562('0x69')](_0xa562('0x14a'),_0x30600a['linkedid'],_0x30600a['cause'],'\x20Queue',_0x2bb7ed[_0xa562('0x4f')],'pTalking:\x20',_0x2bb7ed[_0xa562('0x2a')]);this[_0xa562('0x98')](_0x30600a,_0x30600a[_0xa562('0xec')],_0x30600a['cause']);}}else if(_0x531fb3&&_['isNil'](_0x531fb3[_0xa562('0x14b')])&&_0x2bb7ed[_0xa562('0x14c')]&&_0x30600a[_0xa562('0xec')]===_0x30600a['uniqueid']&&_['isNil'](_0x30600a[_0xa562('0x14d')])&&_0x30600a[_0xa562('0x149')]==='16'&&_0x30600a[_0xa562('0x14e')]==='6'&&_[_0xa562('0xf6')](_0x531fb3[_0xa562('0x14f')])){if(_0x531fb3[_0xa562('0xc6')]){rpcDb[_0xa562('0x119')](_0x531fb3[_0xa562('0xab')]);}if(_0x531fb3[_0xa562('0xc7')]){rpcDb[_0xa562('0x150')](_0x531fb3[_0xa562('0xab')]);}_0x30600a[_0xa562('0x14d')]='22';this[_0xa562('0xf5')](_0x531fb3,_0x2bb7ed,_0x30600a);}else if(_0x531fb3&&_0x531fb3[_0xa562('0x14f')]){if(_0x30600a[_0xa562('0x149')]==='16'&&this[_0xa562('0x68')][_0x30600a[_0xa562('0xec')]][_0xa562('0x76')]){logger[_0xa562('0x69')]('[syncHangup][talking][transfer]',_0x30600a['linkedid'],_0x30600a[_0xa562('0x149')],_0xa562('0xf2'),_0x2bb7ed['name'],'pTalking:\x20',_0x2bb7ed[_0xa562('0x2a')]);this['callProgressDetectingCustomer'](_0x30600a,_0x30600a['linkedid'],_0x30600a[_0xa562('0x149')]);}else if(this['actions'][_0x30600a[_0xa562('0xec')]][_0xa562('0x76')]){logger['info'](_0xa562('0x14a'),_0x30600a[_0xa562('0xec')],_0x30600a[_0xa562('0x149')],_0xa562('0xf2'),_0x2bb7ed[_0xa562('0x4f')],_0xa562('0xb2'),_0x2bb7ed[_0xa562('0x2a')]);this[_0xa562('0x98')](_0x30600a,_0x30600a[_0xa562('0xec')],_0x30600a[_0xa562('0x149')]);}}};Preview[_0xa562('0x5e')][_0xa562('0x1c')]=function(_0xd1413b){if(this[_0xa562('0x68')][_0xd1413b['destlinkedid']]&&_0xd1413b[_0xa562('0xf4')]!==_0xd1413b[_0xa562('0x151')]){this[_0xa562('0x98')](_0xd1413b,_0xd1413b[_0xa562('0xf4')],_0xd1413b[_0xa562('0xe6')]);}};Preview[_0xa562('0x5e')][_0xa562('0x1b')]=function(_0x1fe27c){if(this[_0xa562('0x68')][_0x1fe27c['linkedid']]&&_0x1fe27c[_0xa562('0xec')]!==_0x1fe27c[_0xa562('0xf1')]&&!this[_0xa562('0x68')][_0x1fe27c[_0xa562('0xec')]]['dialAnswer']){if(_0x1fe27c[_0xa562('0x149')]==='1'){this['callProgressDetectingCustomer'](_0x1fe27c,_0x1fe27c[_0xa562('0xec')],_0x1fe27c[_0xa562('0x149')]);}}};Preview['prototype'][_0xa562('0x152')]=function(_0x4089cf,_0x34447a,_0x488d2a){if(this[_0xa562('0x68')][_0x4089cf]){if(_[_0xa562('0x67')](this[_0xa562('0x68')][_0x4089cf]['variables'])){this[_0xa562('0x68')][_0x4089cf][_0xa562('0x13c')]={};}this['actions'][_0x4089cf]['variables'][_0x34447a]=_0x488d2a;}};Preview[_0xa562('0x5e')][_0xa562('0x1f')]=function(_0x4d4200){try{if(!_['isNil'](_0x4d4200)){if(ut['filterKey'](_[_0xa562('0x153')](_0x4d4200[_0xa562('0x154')])[0x0])){this[_0xa562('0x152')](_0x4d4200[_0xa562('0xf1')],_[_0xa562('0x153')](_0x4d4200[_0xa562('0x154')])[0x0],_0x4d4200[_0xa562('0x155')]);}}}catch(_0x3016a7){logger[_0xa562('0x156')](_0xa562('0x157'),util[_0xa562('0x158')](_0x3016a7,{'showHidden':![],'depth':null}));}};Preview[_0xa562('0x5e')][_0xa562('0x159')]=function(_0x2098f3){if(_0x2098f3){if(this['actions'][_0x2098f3['transfertargetlinkedid']]){this[_0xa562('0x68')][_0x2098f3[_0xa562('0x15a')]][_0xa562('0x14f')]=!![];}}};Preview[_0xa562('0x5e')]['syncBlindTransfer']=function(_0x51a4b6){if(_0x51a4b6){if(this[_0xa562('0x68')][_0x51a4b6[_0xa562('0x15b')]]){this['actions'][_0x51a4b6[_0xa562('0x15b')]][_0xa562('0x14f')]=!![];}}};module[_0xa562('0x15c')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index a95d311..f0508cc 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 _0xc6dd=['[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer'];(function(_0x13398d,_0x4f2986){var _0x1598d9=function(_0x52bf01){while(--_0x52bf01){_0x13398d['push'](_0x13398d['shift']());}};_0x1598d9(++_0x4f2986);}(_0xc6dd,0x163));var _0xdc6d=function(_0xa4949e,_0x27e8d6){_0xa4949e=_0xa4949e-0x0;var _0x13186d=_0xc6dd[_0xa4949e];return _0x13186d;};'use strict';var util=require(_0xdc6d('0x0'));var BPromise=require(_0xdc6d('0x1'));var logger=require(_0xdc6d('0x2'))('preview');var _=require('lodash');var cmHopper=require(_0xdc6d('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xdc6d('0x4'));var cmHopperBlack=require(_0xdc6d('0x5'));var voiceQueueRt=require(_0xdc6d('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xdc6d('0x7'));function loggerCatch(_0x589ed5){return function(_0x26a58d){logger[_0xdc6d('0x8')](_0x589ed5,util[_0xdc6d('0x9')](_0x26a58d,{'showHidden':![],'depth':null}));};}function create(_0x2ecd80){return BPromise[_0xdc6d('0xa')]()[_0xdc6d('0xb')](cmHopperHistory[_0xdc6d('0xc')](_0x2ecd80))[_0xdc6d('0xd')](loggerCatch(_0xdc6d('0xe')));}function createAgent(_0x3c4049){return BPromise[_0xdc6d('0xa')]()[_0xdc6d('0xb')](agentReportPreview[_0xdc6d('0xc')](_0x3c4049))[_0xdc6d('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x570ee3){return BPromise['resolve']()[_0xdc6d('0xb')](cmHopper[_0xdc6d('0xf')](_0x570ee3,!![]))[_0xdc6d('0xd')](loggerCatch(_0xdc6d('0x10')));}exports['checkIsBlackList']=function(_0x19c96f){return BPromise['resolve']()[_0xdc6d('0xb')](cmHopperBlack['checkIsBlackList'](_0x19c96f))[_0xdc6d('0xd')](loggerCatch(_0xdc6d('0x11')));};exports[_0xdc6d('0x12')]=function(_0x2bb1b5){return BPromise[_0xdc6d('0xa')]()[_0xdc6d('0xb')](cmHopper[_0xdc6d('0x12')](_0x2bb1b5))[_0xdc6d('0xd')](loggerCatch(_0xdc6d('0x13')));};exports['createHistory']=function(_0x395bd2,_0x2716fd){create(_0x395bd2)[_0xdc6d('0xd')](loggerCatch(_0x2716fd));moveContact(_0x395bd2)[_0xdc6d('0xd')](loggerCatch(_0x2716fd));};exports[_0xdc6d('0x14')]=function(_0x264aa2,_0x20037e){createAgent(_0x264aa2)[_0xdc6d('0xd')](loggerCatch(_0x20037e));};exports[_0xdc6d('0x15')]=function(_0x13a0b3,_0x393786){create(_0x13a0b3)['catch'](loggerCatch(_0x393786));};exports[_0xdc6d('0x16')]=function(_0x1977de,_0x3953a2){moveContact(_0x1977de)[_0xdc6d('0xd')](loggerCatch(_0x3953a2));};exports[_0xdc6d('0x17')]=function(_0x442b60,_0x11b10f,_0x1f0bd4){if(_0x11b10f){_0x442b60[_0xdc6d('0x18')]=null;}if(_0x1f0bd4){_0x442b60['active']=![];}return BPromise['resolve']()['then'](cmHopper[_0xdc6d('0x17')](_0x442b60))[_0xdc6d('0xd')](loggerCatch(_0xdc6d('0x19')));};exports[_0xdc6d('0x1a')]=function(_0x6b1fe7){return BPromise[_0xdc6d('0xa')]()[_0xdc6d('0xb')](cmHopper[_0xdc6d('0x1a')](_0x6b1fe7))[_0xdc6d('0xd')](loggerCatch(_0xdc6d('0x1b')));};exports[_0xdc6d('0x1c')]=function(_0x4d549e){return BPromise[_0xdc6d('0xa')]()[_0xdc6d('0xb')](cmHopper[_0xdc6d('0x1c')]({'UserId':null},_0x4d549e,0x1))[_0xdc6d('0xd')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x4574a8){return BPromise['resolve']()[_0xdc6d('0xb')](cmHopper[_0xdc6d('0x1c')]({'active':![]},_0x4574a8,0x1))[_0xdc6d('0xd')](loggerCatch(_0xdc6d('0x1d')));};exports[_0xdc6d('0x1e')]=function(_0x4e1357){var _0x3bd375={};_0x3bd375[_0xdc6d('0x1f')]=_0x4e1357[_0xdc6d('0x1f')];_0x3bd375[_0xdc6d('0x20')]=_0x4e1357[_0xdc6d('0x20')];_0x3bd375[_0xdc6d('0x21')]=_0x4e1357[_0xdc6d('0x21')];_0x3bd375[_0xdc6d('0x22')]=_0x4e1357[_0xdc6d('0x22')];_0x3bd375[_0xdc6d('0x23')]=_0x4e1357['queue'];_0x3bd375['queuecallerjoinAt']=_0x4e1357['answertime'];_0x3bd375[_0xdc6d('0x24')]=_0x4e1357[_0xdc6d('0x25')];_0x3bd375[_0xdc6d('0x26')]=0x1;_0x3bd375['queuecallercompleteAt']=_0x4e1357[_0xdc6d('0x27')];_0x3bd375[_0xdc6d('0x28')]=_0x4e1357['membername'];_0x3bd375['context']=_0xdc6d('0x29');_0x3bd375[_0xdc6d('0x2a')]='xcally-motion-preview';_0x3bd375[_0xdc6d('0x2b')]=0x0;_0x3bd375[_0xdc6d('0x2c')]=0x1;_0x3bd375[_0xdc6d('0x2d')]=_0x4e1357['membername'];_0x3bd375[_0xdc6d('0x2e')]=_0xdc6d('0x2f');return BPromise[_0xdc6d('0xa')]()[_0xdc6d('0xb')](voiceQueueReport[_0xdc6d('0x30')](_0x3bd375))['catch'](loggerCatch(_0xdc6d('0x31')));};exports['getContactRecallMe']=function(_0x143a60,_0x5d6905){return BPromise[_0xdc6d('0xa')]()[_0xdc6d('0xb')](cmHopper[_0xdc6d('0x32')](_0x143a60,_0x5d6905))[_0xdc6d('0xd')](loggerCatch(_0xdc6d('0x33')));};exports[_0xdc6d('0x34')]=function(_0x5dbe87){return BPromise[_0xdc6d('0xa')]()[_0xdc6d('0xb')](cmHopper[_0xdc6d('0x17')](_0x5dbe87,!![],!![]))[_0xdc6d('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x81b4=['[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList'];(function(_0x4a1253,_0x237626){var _0x415f13=function(_0x564c61){while(--_0x564c61){_0x4a1253['push'](_0x4a1253['shift']());}};_0x415f13(++_0x237626);}(_0x81b4,0xd4));var _0x481b=function(_0x524760,_0x154745){_0x524760=_0x524760-0x0;var _0x55d019=_0x81b4[_0x524760];return _0x55d019;};'use strict';var util=require('util');var BPromise=require(_0x481b('0x0'));var logger=require(_0x481b('0x1'))(_0x481b('0x2'));var _=require(_0x481b('0x3'));var cmHopper=require(_0x481b('0x4'));var cmHopperFinal=require(_0x481b('0x5'));var cmHopperHistory=require(_0x481b('0x6'));var cmHopperBlack=require(_0x481b('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x481b('0x8'));var voiceQueueReport=require(_0x481b('0x9'));function loggerCatch(_0x9a8d65){return function(_0x1c8053){logger[_0x481b('0xa')](_0x9a8d65,util[_0x481b('0xb')](_0x1c8053,{'showHidden':![],'depth':null}));};}function create(_0x43a606){return BPromise[_0x481b('0xc')]()['then'](cmHopperHistory[_0x481b('0xd')](_0x43a606))[_0x481b('0xe')](loggerCatch(_0x481b('0xf')));}function createAgent(_0x5bda57){return BPromise['resolve']()[_0x481b('0x10')](agentReportPreview[_0x481b('0xd')](_0x5bda57))[_0x481b('0xe')](loggerCatch(_0x481b('0xf')));}function moveContact(_0xf76cc6){return BPromise[_0x481b('0xc')]()[_0x481b('0x10')](cmHopper[_0x481b('0x11')](_0xf76cc6,!![]))['catch'](loggerCatch(_0x481b('0x12')));}exports[_0x481b('0x13')]=function(_0x42a22a){return BPromise['resolve']()[_0x481b('0x10')](cmHopperBlack[_0x481b('0x13')](_0x42a22a))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x3a9430){return BPromise[_0x481b('0xc')]()[_0x481b('0x10')](cmHopper['getContactPreview'](_0x3a9430))[_0x481b('0xe')](loggerCatch(_0x481b('0x14')));};exports[_0x481b('0xd')]=function(_0x33527e,_0x9c0275){create(_0x33527e)[_0x481b('0xe')](loggerCatch(_0x9c0275));moveContact(_0x33527e)[_0x481b('0xe')](loggerCatch(_0x9c0275));};exports['createAgentHistory']=function(_0x3ca720,_0x47af9b){createAgent(_0x3ca720)[_0x481b('0xe')](loggerCatch(_0x47af9b));};exports[_0x481b('0x15')]=function(_0x3f0d06,_0x5ede68){create(_0x3f0d06)[_0x481b('0xe')](loggerCatch(_0x5ede68));};exports[_0x481b('0x16')]=function(_0x49e9d6,_0x45fb84){moveContact(_0x49e9d6)[_0x481b('0xe')](loggerCatch(_0x45fb84));};exports['rescheduleContact']=function(_0x3821da,_0x27daca,_0x547655){if(_0x27daca){_0x3821da[_0x481b('0x17')]=null;}if(_0x547655){_0x3821da[_0x481b('0x18')]=![];}return BPromise[_0x481b('0xc')]()[_0x481b('0x10')](cmHopper[_0x481b('0x19')](_0x3821da))[_0x481b('0xe')](loggerCatch(_0x481b('0x1a')));};exports['countReScheduled']=function(_0x2cc903){return BPromise['resolve']()[_0x481b('0x10')](cmHopper['countReScheduled'](_0x2cc903))[_0x481b('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x481b('0x1b')]=function(_0x50ed40){return BPromise[_0x481b('0xc')]()[_0x481b('0x10')](cmHopper['unlockContact']({'UserId':null},_0x50ed40,0x1))[_0x481b('0xe')](loggerCatch(_0x481b('0x1c')));};exports[_0x481b('0x1d')]=function(_0x3f9151){return BPromise[_0x481b('0xc')]()['then'](cmHopper[_0x481b('0x1b')]({'active':![]},_0x3f9151,0x1))[_0x481b('0xe')](loggerCatch(_0x481b('0x1e')));};exports[_0x481b('0x1f')]=function(_0x33b07e){var _0xf910={};_0xf910[_0x481b('0x20')]=_0x33b07e[_0x481b('0x20')];_0xf910['uniqueid']=_0x33b07e[_0x481b('0x21')];_0xf910[_0x481b('0x22')]=_0x33b07e[_0x481b('0x22')];_0xf910[_0x481b('0x23')]=_0x33b07e[_0x481b('0x23')];_0xf910[_0x481b('0x24')]=_0x33b07e[_0x481b('0x24')];_0xf910['queuecallerjoinAt']=_0x33b07e['answertime'];_0xf910[_0x481b('0x25')]=_0x33b07e[_0x481b('0x26')];_0xf910[_0x481b('0x27')]=0x1;_0xf910[_0x481b('0x28')]=_0x33b07e[_0x481b('0x29')];_0xf910['connectedlinename']=_0x33b07e[_0x481b('0x2a')];_0xf910[_0x481b('0x2b')]=_0x481b('0x2c');_0xf910[_0x481b('0x2d')]=_0x481b('0x2e');_0xf910[_0x481b('0x2f')]=0x0;_0xf910[_0x481b('0x30')]=0x1;_0xf910[_0x481b('0x31')]=_0x33b07e[_0x481b('0x2a')];_0xf910[_0x481b('0x32')]=_0x481b('0x33');return BPromise[_0x481b('0xc')]()[_0x481b('0x10')](voiceQueueReport[_0x481b('0x34')](_0xf910))[_0x481b('0xe')](loggerCatch(_0x481b('0x35')));};exports[_0x481b('0x36')]=function(_0x1a5438,_0x26632a){return BPromise[_0x481b('0xc')]()['then'](cmHopper[_0x481b('0x36')](_0x1a5438,_0x26632a))[_0x481b('0xe')](loggerCatch(_0x481b('0x37')));};exports[_0x481b('0x38')]=function(_0x4c38be){return BPromise[_0x481b('0xc')]()[_0x481b('0x10')](cmHopper[_0x481b('0x19')](_0x4c38be,!![],!![]))[_0x481b('0xe')](loggerCatch(_0x481b('0x39')));}; \ 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 326a470..1ab6888 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 _0x1dda=['variables','buildNoAnswerEventPayload','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','logger2','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','name','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','dialQueueProject2','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','statedesc','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','logCustomer','YYYY-MM-DD\x20HH:mm:ss','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','active','add','minutes','ContactId','ListId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','queue','motionChannel','buildObj','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer'];(function(_0x5b4aeb,_0x176adc){var _0x4f21d1=function(_0x2bb673){while(--_0x2bb673){_0x5b4aeb['push'](_0x5b4aeb['shift']());}};_0x4f21d1(++_0x176adc);}(_0x1dda,0x8f));var _0xa1dd=function(_0x45b1ba,_0x5a6a21){_0x45b1ba=_0x45b1ba-0x0;var _0x145ddb=_0x1dda[_0x45b1ba];return _0x145ddb;};'use strict';var util=require(_0xa1dd('0x0'));var _=require(_0xa1dd('0x1'));var moment=require(_0xa1dd('0x2'));var logger=require('../../../../config/logger')(_0xa1dd('0x3'));var ipAgi=process[_0xa1dd('0x4')][_0xa1dd('0x5')]||_0xa1dd('0x6');function getSeconds(_0x4f477d,_0x217db8){var _0x156e1d=moment(_0x4f477d)['milliseconds'](0x0);var _0x3356ac=moment(_0x217db8)[_0xa1dd('0x7')](0x0);return _0x156e1d[_0xa1dd('0x8')](_0x3356ac,_0xa1dd('0x9'));}exports['loggerCatch']=function(_0x2c9e29){return function(_0x39d0ee){logger[_0xa1dd('0xa')](_0x2c9e29,util[_0xa1dd('0xb')](_0x39d0ee,{'showHidden':![],'depth':null}));};};exports[_0xa1dd('0xc')]=function(_0x54b93b,_0x3b460f){logger[_0xa1dd('0xd')](_0x54b93b,util['inspect'](_0x3b460f,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x274470,_0x20962a){logger[_0xa1dd('0xa')](_0x274470,util[_0xa1dd('0xb')](_0x20962a,{'showHidden':![],'depth':null}));};exports[_0xa1dd('0xe')]=function(_0x582d4b){return function(_0x168c95){logger[_0xa1dd('0xd')](_0x582d4b,util[_0xa1dd('0xb')](_0x168c95,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x548315,_0x292463,_0x82a92f){return{'message':_0x548315,'unlock':_0x292463,'active':_0x82a92f};};exports['getCallerId']=function(_0x59279a,_0x47700b,_0x2158a9){if(!_['isUndefined'](_0x2158a9)&&_0xa1dd('0xf')===typeof _0x2158a9&&!_[_0xa1dd('0x10')](_0x2158a9)){if(!_[_0xa1dd('0x11')](_0x47700b)&&'string'===typeof _0x47700b&&!_[_0xa1dd('0x10')](_0x47700b)){return util[_0xa1dd('0x12')](_0xa1dd('0x13'),_0x47700b,_0x2158a9);}return util[_0xa1dd('0x12')](_0xa1dd('0x13'),_0x2158a9,_0x2158a9);}if(!_[_0xa1dd('0x11')](_0x59279a)&&_0xa1dd('0xf')===typeof _0x59279a&&!_[_0xa1dd('0x10')](_0x59279a)){return _0x59279a;}return _0xa1dd('0x14');};exports[_0xa1dd('0x15')]=function(_0x5b7e95){if(_[_0xa1dd('0x16')](_0x5b7e95)){return![];}return _0x5b7e95;};exports['addVariables']=function(_0x312f37,_0x3e2ca8,_0xa60a80,_0x3c291f,_0x4de167,_0x5647fe){var _0x759825={'XMD-QUEUE':_0x3e2ca8['Queue']?_0x3e2ca8['Queue'][_0xa1dd('0x17')]:'','XMD-CALLERID':_0x3c291f,'XMD-CALLERID-PREVIEW':_0x5647fe?util[_0xa1dd('0x12')](_0xa1dd('0x13'),_0x5647fe['calleridname'],_0x5647fe[_0xa1dd('0x18')]):_0x3c291f,'XMD-DIALID':_0x4de167,'XMD-CONTACTID':_0x3e2ca8['ContactId'],'XMD-CDRTYPE':_0xa1dd('0x19'),'CALLERID(all)':_0x3c291f,'XMD-VOICEQUEUEID':_0x3e2ca8[_0xa1dd('0x1a')],'XMD-DIALCHANNEL':_0xa60a80,'XMD-DIALTIMEOUT':_0x312f37['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0xa1dd('0x1b'),_0x312f37['dialQueueProject2']?'g':'',_[_0xa1dd('0x10')](_0x312f37[_0xa1dd('0x1c')])?'':_0xa1dd('0x1d')),'XMD-DIALURL':_0x312f37['dialPreviewUrl']||'','XMD-AGI':_0x312f37['dialQueueProject']?util[_0xa1dd('0x12')](_0xa1dd('0x1e'),ipAgi,_0x312f37[_0xa1dd('0x1f')]):'NONE','XMD-AGIAFTER':_0x312f37[_0xa1dd('0x20')]?util[_0xa1dd('0x12')](_0xa1dd('0x1e'),ipAgi,_0x312f37['dialQueueProject2']):_0xa1dd('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x5647fe?_0x5647fe['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x5647fe?_0x5647fe[_0xa1dd('0x22')]:'','XMD-DESTINATION':_0xa1dd('0x23'),'SIPADDHEADER':_0xa1dd('0x24')};if(!_[_0xa1dd('0x10')](_0x312f37['monitor_format'])){_0x759825[util[_0xa1dd('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x312f37[_0xa1dd('0x1c')];_0x759825[util['format']('%s',_0xa1dd('0x25'))]=_0x4de167;}if(_0x3e2ca8&&_0x3e2ca8[_0xa1dd('0x26')]){for(var _0xac7ac7 in _0x3e2ca8[_0xa1dd('0x26')]){if(_0x3e2ca8[_0xa1dd('0x26')]['hasOwnProperty'](_0xac7ac7)){if(!_[_0xa1dd('0x16')](_0x3e2ca8['Contact'][_0xac7ac7])&&_0xac7ac7!=='id'&&_0xac7ac7!==_0xa1dd('0x27')&&_0xac7ac7!==_0xa1dd('0x28')&&_0xac7ac7!==_0xa1dd('0x29')){_0x759825[util['format'](_0xa1dd('0x2a'),'XMD-',_[_0xa1dd('0x2b')](_0xac7ac7))]=_0x3e2ca8['Contact'][_0xac7ac7];}}}}return _0x759825;};exports[_0xa1dd('0x2c')]=function(_0xbcc1c5){var _0x2af409={};for(var _0x2228a2 in _0xbcc1c5){if(_0xbcc1c5[_0xa1dd('0x2d')](_0x2228a2)){_0x2af409[util[_0xa1dd('0x12')]('%s',_[_0xa1dd('0x2e')](_0x2228a2))]=_0xbcc1c5[_0x2228a2];}}return{'variables':_0x2af409};};exports[_0xa1dd('0x2f')]=function(_0x5a65f3,_0x2a947a){if(!_[_0xa1dd('0x16')](_0x5a65f3)){if(_0x5a65f3['hasOwnProperty'](_0xa1dd('0x30'))){if(_0x5a65f3['originated']>0x0){_0x5a65f3['originated']-=0x1;}else{logger[_0xa1dd('0xa')](_0xa1dd('0x31'),_0x2a947a);}}}else{logger['error'](_0xa1dd('0x32'),_0x2a947a);}};exports['logBlacklist']=function(_0x5429c9){var _0x4bcf11=moment()[_0xa1dd('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x5429c9[_0xa1dd('0x33')]=0xd;_0x5429c9[_0xa1dd('0x34')]='Blacklist';_0x5429c9['starttime']=_0x4bcf11;_0x5429c9[_0xa1dd('0x35')]=_0x4bcf11;_0x5429c9[_0xa1dd('0x36')]=_0x4bcf11;};exports[_0xa1dd('0x37')]=function(_0x181247,_0x182a4c,_0x1e7840){var _0xa80168=moment()[_0xa1dd('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x181247['state']=_0x182a4c;_0x181247[_0xa1dd('0x34')]=_0x1e7840;_0x181247['responsetime']=_0xa80168;_0x181247[_0xa1dd('0x38')]=getSeconds(_0x181247[_0xa1dd('0x35')],_0x181247[_0xa1dd('0x39')]);};exports[_0xa1dd('0x3a')]=function(_0x2727fe,_0x1eceda,_0x463612){_0x2727fe[_0xa1dd('0x3b')]=_0x1eceda;_0x2727fe['UserId']=_0x463612;};exports[_0xa1dd('0x3c')]=function(_0x2d11dd,_0x3428ca,_0x18996a){var _0x4cee0c=moment()[_0xa1dd('0x12')](_0xa1dd('0x3d'));_0x2d11dd[_0xa1dd('0x33')]=_0x3428ca;_0x2d11dd[_0xa1dd('0x34')]=_0x18996a;_0x2d11dd['responsetime']=_0x2d11dd['responsetime']?_0x2d11dd[_0xa1dd('0x35')]:_0x4cee0c;_0x2d11dd[_0xa1dd('0x36')]=_0x2d11dd[_0xa1dd('0x36')]?_0x2d11dd[_0xa1dd('0x36')]:_0x4cee0c;_0x2d11dd[_0xa1dd('0x38')]=getSeconds(_0x2d11dd[_0xa1dd('0x35')]||0x0,_0x2d11dd[_0xa1dd('0x39')]||0x0);_0x2d11dd['talktime']=_0x2d11dd['answertime']?getSeconds(_0x2d11dd['endtime'],_0x2d11dd[_0xa1dd('0x3e')]):0x0;};exports[_0xa1dd('0x3f')]=function(_0x63549){return _0x63549===_0xa1dd('0x40');};exports[_0xa1dd('0x41')]=function(_0x398101,_0x491c20,_0x4fc5e4,_0x476e06,_0x22a275){var _0x3769bf=_0x476e06?_0xa1dd('0x42'):_0x398101[_0xa1dd('0x43')];_0x3769bf=_0x22a275?'BOOKED':_0x3769bf;return{'actionid':_0x398101[_0xa1dd('0x44')],'action':'originate','channel':_0x398101[_0xa1dd('0x45')],'callerid':util[_0xa1dd('0x12')]('\x22%s\x22\x20<%s>',_0x3769bf,_0x398101[_0xa1dd('0x18')]),'Exten':_0xa1dd('0x23'),'Context':_0xa1dd('0x46'),'Priority':'1','variable':_0x4fc5e4,'timeout':(_0x491c20[_0xa1dd('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x398101[_0xa1dd('0x44')]};};exports[_0xa1dd('0x48')]=function(_0x45da7e){return _0x45da7e[_0xa1dd('0x49')]+_0x45da7e[_0xa1dd('0x4a')]+_0x45da7e[_0xa1dd('0x4b')]+_0x45da7e[_0xa1dd('0x4c')]+_0x45da7e[_0xa1dd('0x4d')];};exports['cloneAction']=function(_0x47e6b3){var _0x4cdefb=_[_0xa1dd('0x4e')](_0x47e6b3);_0x4cdefb['state']=0xf;_0x4cdefb[_0xa1dd('0x34')]=_0xa1dd('0x4f');return _0x4cdefb;};exports['scheduledAt']=function(_0x3c5c39,_0x5898c2,_0x1f2a13){var _0x44a09d={};_0x44a09d[_0x5898c2]=_0x3c5c39[_0x5898c2];_0x44a09d[_0xa1dd('0x50')]=![];_0x44a09d['scheduledat']=moment()[_0xa1dd('0x51')](_0x1f2a13,_0xa1dd('0x52'))[_0xa1dd('0x12')](_0xa1dd('0x3d'));_0x44a09d[_0xa1dd('0x53')]=_0x3c5c39[_0xa1dd('0x53')];_0x44a09d[_0xa1dd('0x54')]=_0x3c5c39['ListId'];_0x44a09d[_0xa1dd('0x1a')]=_0x3c5c39['VoiceQueueId']||undefined;return _0x44a09d;};exports['decrementTalkink']=function(_0x4554e7,_0x472c1a){if(!_[_0xa1dd('0x16')](_0x4554e7)){if(_0x4554e7['pTalking']>0x0){_0x4554e7[_0xa1dd('0x55')]-=0x1;}else{logger[_0xa1dd('0xa')](_0x472c1a,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x472c1a,_0xa1dd('0x56'));}};exports['IsNotLoggedIn']=function(_0x56f212){if(_0x56f212<=0x0){return!![];}return![];};function buildObj(_0x4abd68,_0x508ef0,_0x4776e2){_0x4abd68['lastevent']=_0x508ef0;_0x4abd68['name']=_0x4abd68[_0xa1dd('0x57')];_0x4abd68['interface']=_0x4abd68[_0xa1dd('0x45')];_0x4abd68[_0xa1dd('0x58')]='voice';if(_0x4776e2){_0x4abd68['mandatoryDisposition']=_0x4776e2['mandatoryDisposition'];}return _0x4abd68;}exports[_0xa1dd('0x59')]=buildObj;exports[_0xa1dd('0x5a')]=function(_0x1d55df){var _0x5cf0d2={};_0x5cf0d2[_0xa1dd('0x57')]=_0x1d55df[_0xa1dd('0x57')];_0x5cf0d2['interface']=_0x1d55df[_0xa1dd('0x45')];_0x5cf0d2[_0xa1dd('0x44')]=_0x1d55df[_0xa1dd('0x44')];return _0x5cf0d2;};exports[_0xa1dd('0x5b')]=function(_0x52c54c){var _0x5a0281=[];for(var _0x4bcf41 in _0x52c54c){if(_0x52c54c['hasOwnProperty'](_0x4bcf41)){if(!_[_0xa1dd('0x16')](_0x52c54c[_0x4bcf41])&&_0x52c54c[_0x4bcf41][_0xa1dd('0x33')]===_0xa1dd('0x5c')&&_0x52c54c[_0x4bcf41]['status']===_0xa1dd('0x5d')){_0x5a0281[_0xa1dd('0x5e')](_0x52c54c[_0x4bcf41]['id']);}}}return _0x5a0281;};exports[_0xa1dd('0x5f')]=function(_0x588764){var _0x459995=moment()[_0xa1dd('0x7')](0x0);var _0x4f5d8e=moment(_0x588764)[_0xa1dd('0x7')](0x0);return _0x459995['diff'](_0x4f5d8e,_0xa1dd('0x9'));};exports[_0xa1dd('0x60')]=function(_0x30d9c4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x30d9c4[_0xa1dd('0x53')],'ListId':_0x30d9c4['ListId'],'VoiceQueueId':_0x30d9c4[_0xa1dd('0x1a')]||undefined,'CampaignId':_0x30d9c4[_0xa1dd('0x61')]||undefined};};exports[_0xa1dd('0x62')]=function(_0x4ad75c){if(_0x4ad75c===_0xa1dd('0x44')||_0x4ad75c===_0xa1dd('0x63')||_0x4ad75c===_0xa1dd('0x57')||_0x4ad75c===_0xa1dd('0x64')||_0x4ad75c===_0xa1dd('0x65')||_0x4ad75c===_0xa1dd('0x66')||_0x4ad75c===_0xa1dd('0x3b')||_0x4ad75c===_0xa1dd('0x45')||_0x4ad75c===_0xa1dd('0x43')||_0x4ad75c===_0xa1dd('0x50')||_0x4ad75c===_0xa1dd('0x18')||_0x4ad75c===_0xa1dd('0x67')||_0x4ad75c===_0xa1dd('0x49')||_0x4ad75c===_0xa1dd('0x4a')||_0x4ad75c===_0xa1dd('0x4b')||_0x4ad75c===_0xa1dd('0x68')||_0x4ad75c===_0xa1dd('0x69')||_0x4ad75c===_0xa1dd('0x6a')||_0x4ad75c==='callbackat'||_0x4ad75c==='recallme'||_0x4ad75c==='ContactId'||_0x4ad75c===_0xa1dd('0x54')||_0x4ad75c==='UserId'||_0x4ad75c===_0xa1dd('0x1a')||_0x4ad75c===_0xa1dd('0x6b')||_0x4ad75c===_0xa1dd('0x6c')||_0x4ad75c===_0xa1dd('0x6d')||_0x4ad75c===_0xa1dd('0x6e')||_0x4ad75c===_0xa1dd('0x6f')||_0x4ad75c===_0xa1dd('0x70')||_0x4ad75c===_0xa1dd('0x71')||_0x4ad75c===_0xa1dd('0x72')||_0x4ad75c==='xmd-dialid'||_0x4ad75c===_0xa1dd('0x73')||_0x4ad75c===_0xa1dd('0x74')||_0x4ad75c===_0xa1dd('0x75')||_0x4ad75c===_0xa1dd('0x76')||_0x4ad75c===_0xa1dd('0x77')||_0x4ad75c===_0xa1dd('0x78')||_0x4ad75c===_0xa1dd('0x79')||_0x4ad75c==='rtpaudioqosbridged'||_0x4ad75c==='rtpaudioqosjitter'||_0x4ad75c===_0xa1dd('0x7a')||_0x4ad75c===_0xa1dd('0x7b')||_0x4ad75c===_0xa1dd('0x7c')||_0x4ad75c===_0xa1dd('0x7d')||_0x4ad75c==='rtpaudioqosrttbridged'||_0x4ad75c==='rtpaudioqos'||_0x4ad75c===_0xa1dd('0x7e')||_0x4ad75c===_0xa1dd('0x7f')||_0x4ad75c===_0xa1dd('0x7a')||_0x4ad75c==='rtpaudioqosloss'||_0x4ad75c===_0xa1dd('0x7c')||_0x4ad75c==='rtpaudioqosrtt'||_0x4ad75c===_0xa1dd('0x80')||_0x4ad75c==='bridgepeer'||_0x4ad75c===_0xa1dd('0x81')||_0x4ad75c==='state'||_0x4ad75c===_0xa1dd('0x34')){return![];}return!![];};exports[_0xa1dd('0x82')]=function(_0x334983,_0x3de24b){var _0x35daf5,_0x201f3e,_0x501534;if(_0x3de24b<=0x0){_0x3de24b=0x1;}_0x35daf5=new RegExp(_0xa1dd('0x83')+_0x3de24b+'}$');_0x201f3e=Math[_0xa1dd('0x84')](0xa,_0x3de24b-0x1);_0x501534=Math[_0xa1dd('0x84')](0xa,_0x3de24b)-0x1;return util['format']('%s',_[_0xa1dd('0x85')](_0x334983,_0x35daf5,_[_0xa1dd('0x86')](_0x201f3e,_0x501534)));};exports[_0xa1dd('0x87')]=function(_0x2be26c){var _0x4a4afd=_0x2be26c[_0xa1dd('0x88')](/"(.*?)"/);return _0x4a4afd?_0x4a4afd[0x1]:_0x2be26c;};exports[_0xa1dd('0x89')]=function(_0x3750e7){var _0x55e177=_0x3750e7[_0xa1dd('0x88')](/<(.*?)>/);return _0x55e177?_0x55e177[0x1]:_0x3750e7;};function buildNoAnswerEventPayload(_0x462495,_0x291df1){var _0x5be099=buildObj(_0x462495,_0xa1dd('0x8a'));if(!_[_0xa1dd('0x10')](_0x291df1[_0xa1dd('0x8b')])){Object['keys'](_0x291df1[_0xa1dd('0x8b')])['forEach'](function(_0x2343ae){_0x5be099[_0x2343ae['toLowerCase']()]=_0x291df1[_0xa1dd('0x8b')][_0x2343ae];});}return _0x5be099;}exports[_0xa1dd('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xf4c2=['keys','forEach','toLowerCase','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','format','addVariables','Queue','\x22%s\x22\x20<%s>','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','updatedAt','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','membername','logCustomer','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','xcally-motion-preview','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','status','reachable','push','diff','createBody','filterKey','idContact','campaigntype','dialAnswer','channelAgent','countglobal','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','noanswer','variables'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xf4c2,0x127));var _0x2f4c=function(_0x4a2ec7,_0x53bd63){_0x4a2ec7=_0x4a2ec7-0x0;var _0x49119b=_0xf4c2[_0x4a2ec7];return _0x49119b;};'use strict';var util=require(_0x2f4c('0x0'));var _=require('lodash');var moment=require(_0x2f4c('0x1'));var logger=require(_0x2f4c('0x2'))(_0x2f4c('0x3'));var ipAgi=process[_0x2f4c('0x4')][_0x2f4c('0x5')]||_0x2f4c('0x6');function getSeconds(_0x7f43bd,_0x161847){var _0xe58d8e=moment(_0x7f43bd)[_0x2f4c('0x7')](0x0);var _0xa2d8f4=moment(_0x161847)[_0x2f4c('0x7')](0x0);return _0xe58d8e['diff'](_0xa2d8f4,_0x2f4c('0x8'));}exports[_0x2f4c('0x9')]=function(_0x15ad66){return function(_0x150d86){logger[_0x2f4c('0xa')](_0x15ad66,util[_0x2f4c('0xb')](_0x150d86,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1c68d4,_0x13963e){logger[_0x2f4c('0xc')](_0x1c68d4,util[_0x2f4c('0xb')](_0x13963e,{'showHidden':![],'depth':null}));};exports[_0x2f4c('0xd')]=function(_0x261289,_0x42f551){logger[_0x2f4c('0xa')](_0x261289,util[_0x2f4c('0xb')](_0x42f551,{'showHidden':![],'depth':null}));};exports[_0x2f4c('0xe')]=function(_0x293a33){return function(_0x566928){logger['info'](_0x293a33,util['inspect'](_0x566928,{'showHidden':![],'depth':null}));};};exports[_0x2f4c('0xf')]=function(_0x36681c,_0x4d0ba1,_0x5b3655){return{'message':_0x36681c,'unlock':_0x4d0ba1,'active':_0x5b3655};};exports[_0x2f4c('0x10')]=function(_0x33a90c,_0x4ad1ce,_0x23c8c6){if(!_[_0x2f4c('0x11')](_0x23c8c6)&&'string'===typeof _0x23c8c6&&!_[_0x2f4c('0x12')](_0x23c8c6)){if(!_['isUndefined'](_0x4ad1ce)&&'string'===typeof _0x4ad1ce&&!_[_0x2f4c('0x12')](_0x4ad1ce)){return util[_0x2f4c('0x13')]('\x22%s\x22\x20<%s>',_0x4ad1ce,_0x23c8c6);}return util['format']('\x22%s\x22\x20<%s>',_0x23c8c6,_0x23c8c6);}if(!_[_0x2f4c('0x11')](_0x33a90c)&&'string'===typeof _0x33a90c&&!_[_0x2f4c('0x12')](_0x33a90c)){return _0x33a90c;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x2bbd6b){if(_['isNil'](_0x2bbd6b)){return![];}return _0x2bbd6b;};exports[_0x2f4c('0x14')]=function(_0x2f4b18,_0x9cd62,_0x85f202,_0x5cb7d2,_0x4c8ca4,_0xc6c0a8){var _0x51aecb={'XMD-QUEUE':_0x9cd62[_0x2f4c('0x15')]?_0x9cd62[_0x2f4c('0x15')]['name']:'','XMD-CALLERID':_0x5cb7d2,'XMD-CALLERID-PREVIEW':_0xc6c0a8?util['format'](_0x2f4c('0x16'),_0xc6c0a8[_0x2f4c('0x17')],_0xc6c0a8[_0x2f4c('0x18')]):_0x5cb7d2,'XMD-DIALID':_0x4c8ca4,'XMD-CONTACTID':_0x9cd62['ContactId'],'XMD-CDRTYPE':_0x2f4c('0x19'),'CALLERID(all)':_0x5cb7d2,'XMD-VOICEQUEUEID':_0x9cd62[_0x2f4c('0x1a')],'XMD-DIALCHANNEL':_0x85f202,'XMD-DIALTIMEOUT':_0x2f4b18[_0x2f4c('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x2f4c('0x13')](_0x2f4c('0x1c'),_0x2f4b18[_0x2f4c('0x1d')]?'g':'',_['isEmpty'](_0x2f4b18['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2f4b18[_0x2f4c('0x1e')]||'','XMD-AGI':_0x2f4b18[_0x2f4c('0x1f')]?util[_0x2f4c('0x13')](_0x2f4c('0x20'),ipAgi,_0x2f4b18[_0x2f4c('0x1f')]):_0x2f4c('0x21'),'XMD-AGIAFTER':_0x2f4b18[_0x2f4c('0x1d')]?util[_0x2f4c('0x13')](_0x2f4c('0x20'),ipAgi,_0x2f4b18[_0x2f4c('0x1d')]):_0x2f4c('0x21'),'XMD-ORIGINATECALLERIDNUM':_0xc6c0a8?_0xc6c0a8[_0x2f4c('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0xc6c0a8?_0xc6c0a8['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x2f4c('0x12')](_0x2f4b18[_0x2f4c('0x23')])){_0x51aecb[util[_0x2f4c('0x13')]('%s',_0x2f4c('0x24'))]=_0x2f4b18[_0x2f4c('0x23')];_0x51aecb[util[_0x2f4c('0x13')]('%s',_0x2f4c('0x25'))]=_0x4c8ca4;}if(_0x9cd62&&_0x9cd62[_0x2f4c('0x26')]){for(var _0x2f5001 in _0x9cd62[_0x2f4c('0x26')]){if(_0x9cd62['Contact'][_0x2f4c('0x27')](_0x2f5001)){if(!_[_0x2f4c('0x28')](_0x9cd62[_0x2f4c('0x26')][_0x2f5001])&&_0x2f5001!=='id'&&_0x2f5001!=='tags'&&_0x2f5001!=='createdAt'&&_0x2f5001!==_0x2f4c('0x29')){_0x51aecb[util[_0x2f4c('0x13')]('%s%s',_0x2f4c('0x2a'),_[_0x2f4c('0x2b')](_0x2f5001))]=_0x9cd62[_0x2f4c('0x26')][_0x2f5001];}}}}return _0x51aecb;};exports['toLowerVariables']=function(_0x117cf7){var _0x2259c2={};for(var _0x5bec40 in _0x117cf7){if(_0x117cf7[_0x2f4c('0x27')](_0x5bec40)){_0x2259c2[util[_0x2f4c('0x13')]('%s',_[_0x2f4c('0x2c')](_0x5bec40))]=_0x117cf7[_0x5bec40];}}return{'variables':_0x2259c2};};exports[_0x2f4c('0x2d')]=function(_0x576878,_0x5a1118){if(!_[_0x2f4c('0x28')](_0x576878)){if(_0x576878[_0x2f4c('0x27')]('originated')){if(_0x576878[_0x2f4c('0x2e')]>0x0){_0x576878[_0x2f4c('0x2e')]-=0x1;}else{logger['error'](_0x2f4c('0x2f'),_0x5a1118);}}}else{logger[_0x2f4c('0xa')](_0x2f4c('0x30'),_0x5a1118);}};exports[_0x2f4c('0x31')]=function(_0x29b8ee){var _0x248b77=moment()[_0x2f4c('0x13')](_0x2f4c('0x32'));_0x29b8ee[_0x2f4c('0x33')]=0xd;_0x29b8ee['statedesc']=_0x2f4c('0x34');_0x29b8ee[_0x2f4c('0x35')]=_0x248b77;_0x29b8ee[_0x2f4c('0x36')]=_0x248b77;_0x29b8ee[_0x2f4c('0x37')]=_0x248b77;};exports[_0x2f4c('0x38')]=function(_0x483180,_0x418906,_0x340a9e){var _0x49710=moment()[_0x2f4c('0x13')](_0x2f4c('0x32'));_0x483180[_0x2f4c('0x33')]=_0x418906;_0x483180[_0x2f4c('0x39')]=_0x340a9e;_0x483180[_0x2f4c('0x36')]=_0x49710;_0x483180[_0x2f4c('0x3a')]=getSeconds(_0x483180[_0x2f4c('0x36')],_0x483180['starttime']);};exports['logLookAgent']=function(_0x5e3e6a,_0x442a4b,_0x2c2adc){_0x5e3e6a[_0x2f4c('0x3b')]=_0x442a4b;_0x5e3e6a['UserId']=_0x2c2adc;};exports[_0x2f4c('0x3c')]=function(_0x453c81,_0x4f1fdc,_0x40691e){var _0xd1e98d=moment()[_0x2f4c('0x13')](_0x2f4c('0x32'));_0x453c81[_0x2f4c('0x33')]=_0x4f1fdc;_0x453c81[_0x2f4c('0x39')]=_0x40691e;_0x453c81[_0x2f4c('0x36')]=_0x453c81['responsetime']?_0x453c81[_0x2f4c('0x36')]:_0xd1e98d;_0x453c81['endtime']=_0x453c81['endtime']?_0x453c81['endtime']:_0xd1e98d;_0x453c81['ringtime']=getSeconds(_0x453c81['responsetime']||0x0,_0x453c81[_0x2f4c('0x35')]||0x0);_0x453c81[_0x2f4c('0x3d')]=_0x453c81[_0x2f4c('0x3e')]?getSeconds(_0x453c81[_0x2f4c('0x37')],_0x453c81[_0x2f4c('0x3e')]):0x0;};exports[_0x2f4c('0x3f')]=function(_0xdbb650){return _0xdbb650===_0x2f4c('0x40');};exports['variablesAction']=function(_0x5026d1,_0xc75ff4,_0x3fec4e,_0x45d40d,_0x41da3e){var _0x424480=_0x45d40d?_0x2f4c('0x41'):_0x5026d1['calleridname'];_0x424480=_0x41da3e?_0x2f4c('0x42'):_0x424480;return{'actionid':_0x5026d1[_0x2f4c('0x43')],'action':_0x2f4c('0x44'),'channel':_0x5026d1['channelAgent'],'callerid':util['format'](_0x2f4c('0x16'),_0x424480,_0x5026d1[_0x2f4c('0x18')]),'Exten':_0x2f4c('0x45'),'Context':'from-sip','Priority':'1','variable':_0x3fec4e,'timeout':(_0xc75ff4[_0x2f4c('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5026d1[_0x2f4c('0x43')]};};exports['totalGlobal']=function(_0x5d935c){return _0x5d935c[_0x2f4c('0x47')]+_0x5d935c[_0x2f4c('0x48')]+_0x5d935c[_0x2f4c('0x49')]+_0x5d935c[_0x2f4c('0x4a')]+_0x5d935c[_0x2f4c('0x4b')];};exports['cloneAction']=function(_0x425291){var _0x30fcc9=_[_0x2f4c('0x4c')](_0x425291);_0x30fcc9[_0x2f4c('0x33')]=0xf;_0x30fcc9[_0x2f4c('0x39')]='Global';return _0x30fcc9;};exports[_0x2f4c('0x4d')]=function(_0x3e6f80,_0x24cb2e,_0x121ef8){var _0x3b6c8a={};_0x3b6c8a[_0x24cb2e]=_0x3e6f80[_0x24cb2e];_0x3b6c8a[_0x2f4c('0x4e')]=![];_0x3b6c8a[_0x2f4c('0x4f')]=moment()[_0x2f4c('0x50')](_0x121ef8,_0x2f4c('0x51'))['format'](_0x2f4c('0x32'));_0x3b6c8a[_0x2f4c('0x52')]=_0x3e6f80[_0x2f4c('0x52')];_0x3b6c8a['ListId']=_0x3e6f80[_0x2f4c('0x53')];_0x3b6c8a[_0x2f4c('0x1a')]=_0x3e6f80[_0x2f4c('0x1a')]||undefined;return _0x3b6c8a;};exports[_0x2f4c('0x54')]=function(_0x26f09a,_0x41b6d1){if(!_[_0x2f4c('0x28')](_0x26f09a)){if(_0x26f09a[_0x2f4c('0x55')]>0x0){_0x26f09a[_0x2f4c('0x55')]-=0x1;}else{logger[_0x2f4c('0xa')](_0x41b6d1,_0x2f4c('0x56'));}}else{logger['error'](_0x41b6d1,_0x2f4c('0x57'));}};exports['IsNotLoggedIn']=function(_0x49a2cb){if(_0x49a2cb<=0x0){return!![];}return![];};function buildObj(_0x4b7a37,_0x184fd7,_0x463966){_0x4b7a37[_0x2f4c('0x58')]=_0x184fd7;_0x4b7a37[_0x2f4c('0x59')]=_0x4b7a37[_0x2f4c('0x5a')];_0x4b7a37[_0x2f4c('0x5b')]=_0x4b7a37['channelAgent'];_0x4b7a37[_0x2f4c('0x5c')]=_0x2f4c('0x5d');if(_0x463966){_0x4b7a37[_0x2f4c('0x5e')]=_0x463966[_0x2f4c('0x5e')];}return _0x4b7a37;}exports[_0x2f4c('0x5f')]=buildObj;exports[_0x2f4c('0x60')]=function(_0x30f715){var _0x24a875={};_0x24a875[_0x2f4c('0x5a')]=_0x30f715[_0x2f4c('0x5a')];_0x24a875['interface']=_0x30f715['channelAgent'];_0x24a875[_0x2f4c('0x43')]=_0x30f715[_0x2f4c('0x43')];return _0x24a875;};exports[_0x2f4c('0x61')]=function(_0x6dc6ea){var _0x4d35ba=[];for(var _0x783a98 in _0x6dc6ea){if(_0x6dc6ea['hasOwnProperty'](_0x783a98)){if(!_[_0x2f4c('0x28')](_0x6dc6ea[_0x783a98])&&_0x6dc6ea[_0x783a98][_0x2f4c('0x33')]==='not_inuse'&&_0x6dc6ea[_0x783a98][_0x2f4c('0x62')]===_0x2f4c('0x63')){_0x4d35ba[_0x2f4c('0x64')](_0x6dc6ea[_0x783a98]['id']);}}}return _0x4d35ba;};exports['getDiff']=function(_0x43da9b){var _0x5166bd=moment()[_0x2f4c('0x7')](0x0);var _0x2b7310=moment(_0x43da9b)[_0x2f4c('0x7')](0x0);return _0x5166bd[_0x2f4c('0x65')](_0x2b7310,_0x2f4c('0x8'));};exports[_0x2f4c('0x66')]=function(_0x394e84){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x394e84['ContactId'],'ListId':_0x394e84[_0x2f4c('0x53')],'VoiceQueueId':_0x394e84[_0x2f4c('0x1a')]||undefined,'CampaignId':_0x394e84['CampaignId']||undefined};};exports[_0x2f4c('0x67')]=function(_0x3662d1){if(_0x3662d1===_0x2f4c('0x43')||_0x3662d1===_0x2f4c('0x68')||_0x3662d1==='queue'||_0x3662d1==='type'||_0x3662d1===_0x2f4c('0x69')||_0x3662d1===_0x2f4c('0x6a')||_0x3662d1===_0x2f4c('0x3b')||_0x3662d1===_0x2f4c('0x6b')||_0x3662d1===_0x2f4c('0x17')||_0x3662d1===_0x2f4c('0x4e')||_0x3662d1===_0x2f4c('0x18')||_0x3662d1===_0x2f4c('0x4f')||_0x3662d1===_0x2f4c('0x47')||_0x3662d1===_0x2f4c('0x48')||_0x3662d1==='countnoanswerretry'||_0x3662d1===_0x2f4c('0x6c')||_0x3662d1===_0x2f4c('0x6d')||_0x3662d1===_0x2f4c('0x6e')||_0x3662d1==='callbackat'||_0x3662d1===_0x2f4c('0x6f')||_0x3662d1==='ContactId'||_0x3662d1==='ListId'||_0x3662d1===_0x2f4c('0x70')||_0x3662d1===_0x2f4c('0x1a')||_0x3662d1===_0x2f4c('0x71')||_0x3662d1===_0x2f4c('0x72')||_0x3662d1===_0x2f4c('0x73')||_0x3662d1===_0x2f4c('0x74')||_0x3662d1===_0x2f4c('0x75')||_0x3662d1===_0x2f4c('0x76')||_0x3662d1===_0x2f4c('0x77')||_0x3662d1===_0x2f4c('0x78')||_0x3662d1===_0x2f4c('0x79')||_0x3662d1===_0x2f4c('0x7a')||_0x3662d1===_0x2f4c('0x7b')||_0x3662d1===_0x2f4c('0x7c')||_0x3662d1===_0x2f4c('0x7d')||_0x3662d1==='xmd-agiafter'||_0x3662d1===_0x2f4c('0x7e')||_0x3662d1===_0x2f4c('0x7f')||_0x3662d1===_0x2f4c('0x80')||_0x3662d1===_0x2f4c('0x81')||_0x3662d1==='rtpaudioqosjitterbridged'||_0x3662d1===_0x2f4c('0x82')||_0x3662d1===_0x2f4c('0x83')||_0x3662d1===_0x2f4c('0x84')||_0x3662d1===_0x2f4c('0x85')||_0x3662d1===_0x2f4c('0x7f')||_0x3662d1==='rtpaudioqosbridged'||_0x3662d1==='rtpaudioqosjitter'||_0x3662d1==='rtpaudioqosjitterbridged'||_0x3662d1==='rtpaudioqosloss'||_0x3662d1===_0x2f4c('0x83')||_0x3662d1===_0x2f4c('0x84')||_0x3662d1===_0x2f4c('0x85')||_0x3662d1===_0x2f4c('0x86')||_0x3662d1===_0x2f4c('0x87')||_0x3662d1===_0x2f4c('0x33')||_0x3662d1===_0x2f4c('0x39')){return![];}return!![];};exports[_0x2f4c('0x88')]=function(_0x2b995f,_0x41da31){var _0x3510f6,_0x403141,_0x1ccea7;if(_0x41da31<=0x0){_0x41da31=0x1;}_0x3510f6=new RegExp('\x5cw{0,'+_0x41da31+'}$');_0x403141=Math[_0x2f4c('0x89')](0xa,_0x41da31-0x1);_0x1ccea7=Math[_0x2f4c('0x89')](0xa,_0x41da31)-0x1;return util['format']('%s',_[_0x2f4c('0x8a')](_0x2b995f,_0x3510f6,_[_0x2f4c('0x8b')](_0x403141,_0x1ccea7)));};exports[_0x2f4c('0x8c')]=function(_0x11dac8){var _0x3d324a=_0x11dac8['match'](/"(.*?)"/);return _0x3d324a?_0x3d324a[0x1]:_0x11dac8;};exports['extractCalleridNumber']=function(_0x252ae9){var _0x2359a7=_0x252ae9['match'](/<(.*?)>/);return _0x2359a7?_0x2359a7[0x1]:_0x252ae9;};function buildNoAnswerEventPayload(_0x25022c,_0x411218){var _0x2a31ae=buildObj(_0x25022c,_0x2f4c('0x8d'));if(!_['isEmpty'](_0x411218[_0x2f4c('0x8e')])){Object[_0x2f4c('0x8f')](_0x411218['variables'])[_0x2f4c('0x90')](function(_0x45fa92){_0x2a31ae[_0x45fa92[_0x2f4c('0x91')]()]=_0x411218[_0x2f4c('0x8e')][_0x45fa92];});}return _0x2a31ae;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 95a8730..e2f6511 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 _0xa6b8=['voicequeuechannelredirect','string','number','boolean','queuepause','reload','voicechannel','voicequeuechannelhangup'];(function(_0x3a8d63,_0x3e468a){var _0xad23e3=function(_0x4f1993){while(--_0x4f1993){_0x3a8d63['push'](_0x3a8d63['shift']());}};_0xad23e3(++_0x3e468a);}(_0xa6b8,0x159));var _0x8a6b=function(_0x53b611,_0x2912fa){_0x53b611=_0x53b611-0x0;var _0x5649aa=_0xa6b8[_0x53b611];return _0x5649aa;};'use strict';exports['queueadd']={'queue':{'type':_0x8a6b('0x0'),'required':!![]},'interface':{'type':_0x8a6b('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x8a6b('0x1'),'required':![]},'paused':{'type':_0x8a6b('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0x8a6b('0x0'),'required':!![]},'interface':{'type':_0x8a6b('0x0'),'required':!![]}};exports[_0x8a6b('0x3')]={'interface':{'type':_0x8a6b('0x0'),'required':!![]},'paused':{'type':_0x8a6b('0x2')},'reason':{'type':_0x8a6b('0x0'),'required':![]}};exports[_0x8a6b('0x4')]={'module':{'type':_0x8a6b('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x8a6b('0x0'),'required':!![]}};exports[_0x8a6b('0x5')]={'uniqueid':{'type':_0x8a6b('0x0'),'required':!![]},'filename':{'type':_0x8a6b('0x0')},'format':{'type':_0x8a6b('0x0')},'mixmonitorid':{'type':_0x8a6b('0x0')}};exports[_0x8a6b('0x6')]={'uniqueid':{'type':_0x8a6b('0x0'),'required':!![]}};exports[_0x8a6b('0x7')]={'uniqueid':{'type':_0x8a6b('0x0'),'required':!![]},'exten':{'type':_0x8a6b('0x0'),'required':!![]},'context':{'type':_0x8a6b('0x0')}}; \ No newline at end of file +var _0x1788=['queueremove','boolean','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x3a58a4,_0x480fdd){var _0x2b1802=function(_0x3ba618){while(--_0x3ba618){_0x3a58a4['push'](_0x3a58a4['shift']());}};_0x2b1802(++_0x480fdd);}(_0x1788,0x1ec));var _0x8178=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1788[_0x199572];return _0x13cfa3;};'use strict';exports[_0x8178('0x0')]={'queue':{'type':_0x8178('0x1'),'required':!![]},'interface':{'type':_0x8178('0x1'),'required':!![]},'membername':{'type':_0x8178('0x1'),'required':!![]},'penalty':{'type':_0x8178('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x8178('0x3')]={'queue':{'type':_0x8178('0x1'),'required':!![]},'interface':{'type':_0x8178('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x8178('0x1'),'required':!![]},'paused':{'type':_0x8178('0x4')},'reason':{'type':'string','required':![]}};exports[_0x8178('0x5')]={'module':{'type':'string','required':![]}};exports[_0x8178('0x6')]={'uniqueid':{'type':_0x8178('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x8178('0x1'),'required':!![]},'filename':{'type':_0x8178('0x1')},'format':{'type':_0x8178('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x8178('0x7')]={'uniqueid':{'type':_0x8178('0x1'),'required':!![]}};exports[_0x8178('0x8')]={'uniqueid':{'type':_0x8178('0x1'),'required':!![]},'exten':{'type':_0x8178('0x1'),'required':!![]},'context':{'type':_0x8178('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index f67c7dd..aeadaed 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 _0xef7e=['../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','triggers','campaigns','templates','outbound','voiceExtensions','channels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','hasOwnProperty','SIP/%s','name','isNil','format','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','initTelephones','length','isUndefined','telephones','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','diff','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','faxAccounts','util','moment','../model/agent','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount'];(function(_0x2f2f9c,_0x1181fc){var _0x2e1d84=function(_0xcc3aad){while(--_0xcc3aad){_0x2f2f9c['push'](_0x2f2f9c['shift']());}};_0x2e1d84(++_0x1181fc);}(_0xef7e,0x194));var _0xeef7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef7e[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xeef7('0x0'));var _=require('lodash');var moment=require(_0xeef7('0x1'));var Agent=require(_0xeef7('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0xeef7('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xeef7('0x4'));var Template=require(_0xeef7('0x5'));var Campaign=require(_0xeef7('0x6'));var VoiceExtension=require(_0xeef7('0x7'));var ZendeskAccount=require(_0xeef7('0x8'));var SalesforceAccount=require(_0xeef7('0x9'));var FreshdeskAccount=require(_0xeef7('0xa'));var SugarcrmAccount=require(_0xeef7('0xb'));var ZohoAccount=require(_0xeef7('0xc'));var DeskAccount=require(_0xeef7('0xd'));var VtigerAccount=require(_0xeef7('0xe'));var ServicenowAccount=require(_0xeef7('0xf'));var Dynamics365Account=require(_0xeef7('0x10'));var FreshsalesAccount=require(_0xeef7('0x11'));var FaxAccount=require(_0xeef7('0x12'));var Realtime=function(){this[_0xeef7('0x13')]={};this['telephones']={};this[_0xeef7('0x14')]={};this['voiceQueues']={};this[_0xeef7('0x15')]={};this[_0xeef7('0x16')]={};this[_0xeef7('0x17')]={};this[_0xeef7('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xeef7('0x19')]={};this[_0xeef7('0x1a')]={};this['queueChannels']={};this['outboundChannels']={};this[_0xeef7('0x1b')]={};this[_0xeef7('0x1c')]={};this[_0xeef7('0x1d')]={};this['salesforceAccounts']={};this[_0xeef7('0x1e')]={};this[_0xeef7('0x1f')]={};this[_0xeef7('0x20')]={};this[_0xeef7('0x21')]={};this['vtigerAccounts']={};this[_0xeef7('0x22')]={};this[_0xeef7('0x23')]={};this[_0xeef7('0x24')]={};this['faxAccounts']={};};function freeIsNotKey(_0x341228,_0x1cc116,_0x388a90){var _0x75cb6f=_['mapKeys'](_0x341228,function(_0x5b187e,_0x197ef1){return _0x5b187e[_0x388a90];});for(var _0x44538e in _0x1cc116){if(_0x1cc116[_0xeef7('0x25')](_0x44538e)){if(!_0x75cb6f[_0x44538e]){delete _0x1cc116[_0x44538e];}}}}function freeIsNotKeySip(_0x1dcd02,_0x224c1f){var _0x5bd438=_['mapKeys'](_0x1dcd02,function(_0x156b64,_0x228cb6){return util['format'](_0xeef7('0x26'),_0x156b64[_0xeef7('0x27')]);});for(var _0x148820 in _0x224c1f){if(_0x224c1f[_0xeef7('0x25')](_0x148820)){if(!_0x5bd438[_0x148820]){delete _0x224c1f[_0x148820];}}}}function freeIsNotKeyAgent(_0x12ce29,_0x1a0c40){var _0x4ddb30=_['mapKeys'](_0x12ce29,function(_0x5a4687,_0x5243fa){var _0x15227e=_[_0xeef7('0x28')](_0x5a4687['interface'])?util[_0xeef7('0x29')]('SIP/%s',_0x5a4687['name']):_0x5a4687[_0xeef7('0x2a')];return _0x15227e;});for(var _0x507781 in _0x1a0c40){if(_0x1a0c40[_0xeef7('0x25')](_0x507781)){if(!_0x4ddb30[_0x507781]){delete _0x1a0c40[_0x507781];}}}}function clearVoiceCallReports(_0x5c0515){_0x5c0515[_0xeef7('0x2b')]=0x0;_0x5c0515[_0xeef7('0x2c')]=0x0;_0x5c0515[_0xeef7('0x2d')]=0x0;_0x5c0515[_0xeef7('0x2e')]=0x0;_0x5c0515[_0xeef7('0x2f')]=0x0;}function clearCampaigns(_0x2b9d7d){if(!_[_0xeef7('0x30')](_0x2b9d7d)){for(var _0xdd5838 in _0x2b9d7d){if(_0x2b9d7d[_0xeef7('0x25')](_0xdd5838)){_0x2b9d7d[_0xdd5838][_0xeef7('0x31')]=0x0;_0x2b9d7d[_0xdd5838]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2dee30){if(!_[_0xeef7('0x30')](_0x2dee30)){for(var _0x13de6a in _0x2dee30){if(_0x2dee30[_0xeef7('0x25')](_0x13de6a)){_0x2dee30[_0x13de6a][_0xeef7('0x2b')]=0x0;_0x2dee30[_0x13de6a]['answered']=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x32')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x33')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x2d')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x2e')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x2f')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x34')]=0x0;_0x2dee30[_0x13de6a]['outboundNoAnswerCallsDay']=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x35')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x36')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x37')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x38')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x39')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x3a')]=0x0;_0x2dee30[_0x13de6a]['outboundBlacklistCallsDay']=0x0;_0x2dee30[_0x13de6a]['outboundOriginateFailureCallsDay']=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x3b')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x3c')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x34')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x3d')]=0x0;_0x2dee30[_0x13de6a][_0xeef7('0x3e')]=!![];}}}}Realtime[_0xeef7('0x3f')][_0xeef7('0x40')]=function(_0x1a7bea,_0x367ea3){for(var _0x4df10a in _0x367ea3){if(_0x1a7bea[_0xeef7('0x25')](_0x4df10a)){_0x1a7bea[_0x4df10a]=_0x367ea3[_0x4df10a];}}};Realtime[_0xeef7('0x3f')][_0xeef7('0x41')]=function(){var _0xa4f9ea=this;return function(_0x11b3fb){if(_0x11b3fb){freeIsNotKeyAgent(_0x11b3fb,_0xa4f9ea['agents']);for(var _0x2d3039=0x0,_0xc67bfc={},_0x16e951={};_0x2d3039<_0x11b3fb['length'];_0x2d3039+=0x1){_0xc67bfc=_0x11b3fb[_0x2d3039];var _0x9c943c=_['isNil'](_0xc67bfc[_0xeef7('0x2a')])?util[_0xeef7('0x29')](_0xeef7('0x26'),_0xc67bfc['name']):_0xc67bfc[_0xeef7('0x2a')];if(_['isUndefined'](_0xa4f9ea['agents'][_0x9c943c])){_0xa4f9ea['agents'][_0x9c943c]=new Agent(_0xc67bfc);}else{_0xa4f9ea['mergeFromDatabase'](_0xa4f9ea['agents'][_0x9c943c],_0xc67bfc);}}}return _0xa4f9ea[_0xeef7('0x13')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x42')]=function(){var _0x3c350d=this;return function(_0x2613bb){if(_0x2613bb){freeIsNotKeySip(_0x2613bb,_0x3c350d['telephones']);for(var _0x55bc5b=0x0,_0x4807d5={},_0x325db1={};_0x55bc5b<_0x2613bb[_0xeef7('0x43')];_0x55bc5b+=0x1){_0x4807d5=_0x2613bb[_0x55bc5b];if(_[_0xeef7('0x44')](_0x3c350d[_0xeef7('0x45')][util['format'](_0xeef7('0x26'),_0x4807d5['name'])])){_0x3c350d[_0xeef7('0x45')][util[_0xeef7('0x29')](_0xeef7('0x26'),_0x4807d5[_0xeef7('0x27')])]=new Telephone(_0x4807d5);}else{_0x3c350d[_0xeef7('0x40')](_0x3c350d[_0xeef7('0x45')][util[_0xeef7('0x29')](_0xeef7('0x26'),_0x4807d5[_0xeef7('0x27')])],_0x4807d5);}}}return _0x3c350d[_0xeef7('0x45')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x46')]=function(){var _0x4bd5b4=this;return function(_0x3b50b8){if(_0x3b50b8){freeIsNotKeySip(_0x3b50b8,_0x4bd5b4['trunks']);for(var _0x7e86b1=0x0,_0x1e62ee={},_0x233017={};_0x7e86b1<_0x3b50b8[_0xeef7('0x43')];_0x7e86b1+=0x1){_0x1e62ee=_0x3b50b8[_0x7e86b1];if(_[_0xeef7('0x44')](_0x4bd5b4[_0xeef7('0x14')][util['format'](_0xeef7('0x26'),_0x1e62ee[_0xeef7('0x27')])])){_0x4bd5b4[_0xeef7('0x14')][util[_0xeef7('0x29')]('SIP/%s',_0x1e62ee[_0xeef7('0x27')])]=new Trunk(_0x1e62ee);}else{_0x4bd5b4[_0xeef7('0x40')](_0x4bd5b4[_0xeef7('0x14')][util[_0xeef7('0x29')](_0xeef7('0x26'),_0x1e62ee[_0xeef7('0x27')])],_0x1e62ee);}}}return _0x4bd5b4[_0xeef7('0x14')];};};Realtime['prototype'][_0xeef7('0x47')]=function(){var _0x8cff13=this;return function(_0x4d3bec){if(_0x4d3bec){freeIsNotKey(_0x4d3bec,_0x8cff13[_0xeef7('0x48')],'name');for(var _0x442e43=0x0,_0x3ad10a={},_0x4f5584={};_0x442e43<_0x4d3bec[_0xeef7('0x43')];_0x442e43+=0x1){_0x3ad10a=_0x4d3bec[_0x442e43];if(_['isUndefined'](_0x8cff13[_0xeef7('0x48')][_0x3ad10a['name']])){_0x8cff13[_0xeef7('0x48')][_0x3ad10a['name']]=new VoiceQueue(_0x3ad10a);}else{_0x8cff13[_0xeef7('0x40')](_0x8cff13['voiceQueues'][_0x3ad10a[_0xeef7('0x27')]],_0x3ad10a);}}}return _0x8cff13[_0xeef7('0x48')];};};Realtime['prototype'][_0xeef7('0x49')]=function(){var _0x3c4c14=this;return function(_0x394eb7){if(_0x394eb7){freeIsNotKey(_0x394eb7,_0x3c4c14['triggers'],'id');for(var _0x3d9685=0x0,_0x19a0f6={},_0x3ceb3d={};_0x3d9685<_0x394eb7['length'];_0x3d9685+=0x1){_0x19a0f6=_0x394eb7[_0x3d9685];if(_['isUndefined'](_0x3c4c14[_0xeef7('0x15')][_0x19a0f6['id']])){_0x3c4c14[_0xeef7('0x15')][_0x19a0f6['id']]=new Trigger(_0x19a0f6);}else{_0x3c4c14[_0xeef7('0x40')](_0x3c4c14[_0xeef7('0x15')][_0x19a0f6['id']],_0x19a0f6);}}}return _0x3c4c14[_0xeef7('0x15')];};};Realtime[_0xeef7('0x3f')]['initTemplates']=function(){var _0x416126=this;return function(_0x125dcc){if(_0x125dcc){freeIsNotKey(_0x125dcc,_0x416126[_0xeef7('0x17')],'id');for(var _0x239a2e=0x0,_0x23794d={},_0x1724e6={};_0x239a2e<_0x125dcc[_0xeef7('0x43')];_0x239a2e+=0x1){_0x23794d=_0x125dcc[_0x239a2e];if(_['isUndefined'](_0x416126[_0xeef7('0x17')][_0x23794d['id']])){_0x416126[_0xeef7('0x17')][_0x23794d['id']]=new Template(_0x23794d);}else{_0x416126['mergeFromDatabase'](_0x416126['templates'][_0x23794d['id']],_0x23794d);}}}return _0x416126[_0xeef7('0x17')];};};Realtime['prototype'][_0xeef7('0x4a')]=function(){var _0x6c76cb=this;return function(_0x38c014){if(_0x38c014){freeIsNotKey(_0x38c014,_0x6c76cb['zendeskAccounts'],'id');for(var _0x1b88ec=0x0,_0x5b079f={},_0x21936f={};_0x1b88ec<_0x38c014[_0xeef7('0x43')];_0x1b88ec+=0x1){_0x5b079f=_0x38c014[_0x1b88ec];if(_[_0xeef7('0x44')](_0x6c76cb['zendeskAccounts'][_0x5b079f['id']])){_0x6c76cb[_0xeef7('0x1d')][_0x5b079f['id']]=new ZendeskAccount(_0x5b079f);}else{_0x6c76cb[_0xeef7('0x40')](_0x6c76cb[_0xeef7('0x1d')][_0x5b079f['id']],_0x5b079f);}}}return _0x6c76cb[_0xeef7('0x1d')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x4b')]=function(){var _0x2ae85c=this;return function(_0x11771f){if(_0x11771f){freeIsNotKey(_0x11771f,_0x2ae85c[_0xeef7('0x4c')],'id');for(var _0x2e4316=0x0,_0x32cc6c={},_0x5d348c={};_0x2e4316<_0x11771f[_0xeef7('0x43')];_0x2e4316+=0x1){_0x32cc6c=_0x11771f[_0x2e4316];if(_[_0xeef7('0x44')](_0x2ae85c[_0xeef7('0x4c')][_0x32cc6c['id']])){_0x2ae85c[_0xeef7('0x4c')][_0x32cc6c['id']]=new SalesforceAccount(_0x32cc6c);}else{_0x2ae85c[_0xeef7('0x40')](_0x2ae85c['salesforceAccounts'][_0x32cc6c['id']],_0x32cc6c);}}}return _0x2ae85c[_0xeef7('0x4c')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x4d')]=function(){var _0x4392e7=this;return function(_0x4eae30){if(_0x4eae30){freeIsNotKey(_0x4eae30,_0x4392e7[_0xeef7('0x1f')],'id');for(var _0x1354b4=0x0,_0x4c789d={},_0x4faa10={};_0x1354b4<_0x4eae30[_0xeef7('0x43')];_0x1354b4+=0x1){_0x4c789d=_0x4eae30[_0x1354b4];if(_[_0xeef7('0x44')](_0x4392e7[_0xeef7('0x1f')][_0x4c789d['id']])){_0x4392e7[_0xeef7('0x1f')][_0x4c789d['id']]=new FreshdeskAccount(_0x4c789d);}else{_0x4392e7['mergeFromDatabase'](_0x4392e7['freshdeskAccounts'][_0x4c789d['id']],_0x4c789d);}}}return _0x4392e7[_0xeef7('0x1f')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x4e')]=function(){var _0xf49cb5=this;return function(_0x3aa6d1){if(_0x3aa6d1){freeIsNotKey(_0x3aa6d1,_0xf49cb5[_0xeef7('0x20')],'id');for(var _0x2ac869=0x0,_0x385be2={},_0x256e6c={};_0x2ac869<_0x3aa6d1[_0xeef7('0x43')];_0x2ac869+=0x1){_0x385be2=_0x3aa6d1[_0x2ac869];if(_[_0xeef7('0x44')](_0xf49cb5[_0xeef7('0x20')][_0x385be2['id']])){_0xf49cb5[_0xeef7('0x20')][_0x385be2['id']]=new ZohoAccount(_0x385be2);}else{_0xf49cb5[_0xeef7('0x40')](_0xf49cb5[_0xeef7('0x20')][_0x385be2['id']],_0x385be2);}}}return _0xf49cb5[_0xeef7('0x20')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x4f')]=function(){var _0x1b0c35=this;return function(_0x12af43){if(_0x12af43){freeIsNotKey(_0x12af43,_0x1b0c35['deskAccounts'],'id');for(var _0x585148=0x0,_0x477a87={},_0xe90fc1={};_0x585148<_0x12af43[_0xeef7('0x43')];_0x585148+=0x1){_0x477a87=_0x12af43[_0x585148];if(_[_0xeef7('0x44')](_0x1b0c35[_0xeef7('0x21')][_0x477a87['id']])){_0x1b0c35[_0xeef7('0x21')][_0x477a87['id']]=new DeskAccount(_0x477a87);}else{_0x1b0c35['mergeFromDatabase'](_0x1b0c35['deskAccounts'][_0x477a87['id']],_0x477a87);}}}return _0x1b0c35[_0xeef7('0x21')];};};Realtime[_0xeef7('0x3f')]['initSugarcrmAccounts']=function(){var _0x271c3b=this;return function(_0x396e28){if(_0x396e28){freeIsNotKey(_0x396e28,_0x271c3b[_0xeef7('0x1e')],'id');for(var _0x3be23b=0x0,_0x38958d={},_0x4f1a5b={};_0x3be23b<_0x396e28[_0xeef7('0x43')];_0x3be23b+=0x1){_0x38958d=_0x396e28[_0x3be23b];if(_[_0xeef7('0x44')](_0x271c3b[_0xeef7('0x1e')][_0x38958d['id']])){_0x271c3b[_0xeef7('0x1e')][_0x38958d['id']]=new SugarcrmAccount(_0x38958d);}else{_0x271c3b['mergeFromDatabase'](_0x271c3b[_0xeef7('0x1e')][_0x38958d['id']],_0x38958d);}}}return _0x271c3b[_0xeef7('0x1e')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x50')]=function(){var _0xee77f7=this;return function(_0x4a2896){if(_0x4a2896){freeIsNotKey(_0x4a2896,_0xee77f7['vtigerAccounts'],'id');for(var _0x23975f=0x0,_0x2a066e={},_0x37827c={};_0x23975f<_0x4a2896['length'];_0x23975f+=0x1){_0x2a066e=_0x4a2896[_0x23975f];if(_[_0xeef7('0x44')](_0xee77f7[_0xeef7('0x51')][_0x2a066e['id']])){_0xee77f7[_0xeef7('0x51')][_0x2a066e['id']]=new VtigerAccount(_0x2a066e);}else{_0xee77f7['mergeFromDatabase'](_0xee77f7[_0xeef7('0x51')][_0x2a066e['id']],_0x2a066e);}}}return _0xee77f7[_0xeef7('0x51')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x52')]=function(){var _0x3f4ded=this;return function(_0x45ed21){if(_0x45ed21){freeIsNotKey(_0x45ed21,_0x3f4ded['servicenowAccounts'],'id');for(var _0xd6439d=0x0,_0xd96e39={},_0x3129a2={};_0xd6439d<_0x45ed21[_0xeef7('0x43')];_0xd6439d+=0x1){_0xd96e39=_0x45ed21[_0xd6439d];if(_[_0xeef7('0x44')](_0x3f4ded['servicenowAccounts'][_0xd96e39['id']])){_0x3f4ded[_0xeef7('0x22')][_0xd96e39['id']]=new ServicenowAccount(_0xd96e39);}else{_0x3f4ded['mergeFromDatabase'](_0x3f4ded[_0xeef7('0x22')][_0xd96e39['id']],_0xd96e39);}}}return _0x3f4ded[_0xeef7('0x22')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x53')]=function(){var _0x4bab58=this;return function(_0x14da0e){if(_0x14da0e){freeIsNotKey(_0x14da0e,_0x4bab58[_0xeef7('0x23')],'id');for(var _0xfaf28d=0x0,_0xb642dc={},_0x3d9824={};_0xfaf28d<_0x14da0e['length'];_0xfaf28d+=0x1){_0xb642dc=_0x14da0e[_0xfaf28d];if(_[_0xeef7('0x44')](_0x4bab58[_0xeef7('0x23')][_0xb642dc['id']])){_0x4bab58[_0xeef7('0x23')][_0xb642dc['id']]=new Dynamics365Account(_0xb642dc);}else{_0x4bab58['mergeFromDatabase'](_0x4bab58[_0xeef7('0x23')][_0xb642dc['id']],_0xb642dc);}}}return _0x4bab58['dynamics365Accounts'];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x54')]=function(){var _0x246917=this;return function(_0x5f30c8){if(_0x5f30c8){freeIsNotKey(_0x5f30c8,_0x246917['freshsalesAccounts'],'id');for(var _0x5e58b4=0x0,_0x49a41c={},_0x233577={};_0x5e58b4<_0x5f30c8['length'];_0x5e58b4+=0x1){_0x49a41c=_0x5f30c8[_0x5e58b4];if(_[_0xeef7('0x44')](_0x246917[_0xeef7('0x24')][_0x49a41c['id']])){_0x246917[_0xeef7('0x24')][_0x49a41c['id']]=new FreshsalesAccount(_0x49a41c);}else{_0x246917[_0xeef7('0x40')](_0x246917['freshsalesAccounts'][_0x49a41c['id']],_0x49a41c);}}}return _0x246917[_0xeef7('0x24')];};};Realtime['prototype'][_0xeef7('0x55')]=function(){var _0x421b79=this;return function(_0x25a6fa){for(var _0x11b9f4=0x0;_0x11b9f4<_0x25a6fa[_0xeef7('0x43')];_0x11b9f4+=0x1){_[_0xeef7('0x56')](_0x421b79[_0xeef7('0x48')][_0x25a6fa[_0x11b9f4][_0xeef7('0x27')]],_0x25a6fa[_0x11b9f4]);}return _0x421b79['voiceQueues'];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x57')]=function(){var _0x1a0586=this;return function(_0x148185){clearVoiceQueues(_0x1a0586['voiceQueues']);if(_0x148185){_0x148185=_['groupBy'](_0x148185,'uniqueid');for(var _0x224df6 in _0x148185){if(_0x148185[_0xeef7('0x25')](_0x224df6)){var _0x768036={};for(var _0x4edd53=0x0;_0x4edd53<_0x148185[_0x224df6]['length'];_0x4edd53+=0x1){var _0x5a0067=_0x148185[_0x224df6][_0x4edd53][_0xeef7('0x58')];if(_0x1a0586[_0xeef7('0x48')][_0x5a0067]){if(_0x148185[_0x224df6][_0x4edd53]['queuecallerexit']){_0x1a0586[_0xeef7('0x48')][_0x5a0067][_0xeef7('0x32')]+=0x1;}if(_0x148185[_0x224df6][_0x4edd53][_0xeef7('0x59')]){_0x1a0586[_0xeef7('0x48')][_0x5a0067][_0xeef7('0x33')]+=0x1;}_0x1a0586[_0xeef7('0x48')][_0x5a0067][_0xeef7('0x2d')]+=moment(_0x148185[_0x224df6][_0x4edd53][_0xeef7('0x5a')])['diff'](moment(_0x148185[_0x224df6][_0x4edd53][_0xeef7('0x5b')]),_0xeef7('0x5c'))||0x0;if(_0x4edd53===_0x148185[_0x224df6][_0xeef7('0x43')]-0x1){_0x1a0586['voiceQueues'][_0x5a0067][_0xeef7('0x2e')]+=moment(_0x148185[_0x224df6][_0x4edd53][_0xeef7('0x5d')]||_0x148185[_0x224df6][_0x4edd53]['queuecallerabandonAt']||_0x148185[_0x224df6][_0x4edd53]['queuecallerexitAt'])[_0xeef7('0x5e')](moment(_0x148185[_0x224df6][_0x4edd53][_0xeef7('0x5b')]),_0xeef7('0x5c'))||0x0;_0x1a0586[_0xeef7('0x48')][_0x5a0067][_0xeef7('0x2b')]+=0x1;if(_0x148185[_0x224df6][_0x4edd53][_0xeef7('0x5f')]){_0x1a0586[_0xeef7('0x48')][_0x5a0067][_0xeef7('0x2c')]+=0x1;_0x1a0586[_0xeef7('0x48')][_0x5a0067]['sumBillable']+=moment(_0x148185[_0x224df6][_0x4edd53]['queuecallercompleteAt'])['diff'](moment(_0x148185[_0x224df6][_0x4edd53]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x1a0586['voiceQueues'][_0x5a0067]['sumDuration']+=_0x1a0586[_0xeef7('0x48')][_0x5a0067][_0xeef7('0x2d')]||0x0;}}}}}}return _0x1a0586['voiceQueues'];};};Realtime[_0xeef7('0x3f')]['initVoiceCallReports']=function(){var _0x37e148=this;return function(_0x3acb28){clearVoiceCallReports(_0x37e148[_0xeef7('0x18')]);if(_0x3acb28){for(var _0x3955ae=0x0;_0x3955ae<_0x3acb28[_0xeef7('0x43')];_0x3955ae+=0x1){_0x37e148[_0xeef7('0x18')][_0xeef7('0x2b')]+=0x1;_0x37e148['outbound'][_0xeef7('0x2e')]+=_0x3acb28[_0x3955ae][_0xeef7('0x60')];if(_0x3acb28[_0x3955ae][_0xeef7('0x61')]===_0xeef7('0x62')){_0x37e148[_0xeef7('0x18')]['answered']+=0x1;_0x37e148['outbound']['sumHoldTime']+=_0x3acb28[_0x3955ae][_0xeef7('0x60')]-_0x3acb28[_0x3955ae][_0xeef7('0x63')]||0x0;_0x37e148[_0xeef7('0x18')][_0xeef7('0x2f')]+=_0x3acb28[_0x3955ae][_0xeef7('0x63')];}}}return _0x37e148[_0xeef7('0x18')];};};Realtime[_0xeef7('0x3f')]['initCampaigns']=function(){var _0xa87976=this;return function(_0x18bbda){if(_0x18bbda){freeIsNotKey(_0x18bbda,_0xa87976[_0xeef7('0x16')],_0xeef7('0x27'));for(var _0x3a1dad=0x0,_0x5affbd={};_0x3a1dad<_0x18bbda['length'];_0x3a1dad+=0x1){_0x5affbd=_0x18bbda[_0x3a1dad];if(_[_0xeef7('0x44')](_0xa87976[_0xeef7('0x16')][_0x5affbd[_0xeef7('0x27')]])){_0xa87976['campaigns'][_0x5affbd[_0xeef7('0x27')]]=new Campaign(_0x5affbd);}else{_0xa87976[_0xeef7('0x40')](_0xa87976[_0xeef7('0x16')][_0x5affbd[_0xeef7('0x27')]],_0x5affbd);_0xa87976[_0xeef7('0x16')][_0x5affbd[_0xeef7('0x27')]][_0xeef7('0x64')]=_0x5affbd[_0xeef7('0x65')]?_0x5affbd[_0xeef7('0x65')]['name']:undefined;}}}return _0xa87976[_0xeef7('0x16')];};};Realtime[_0xeef7('0x3f')]['initVoiceExtensions']=function(){var _0x4227c9=this;return function(_0x4af149){if(_0x4af149){freeIsNotKey(_0x4af149,_0x4227c9[_0xeef7('0x19')],'id');for(var _0x2164c9=0x0,_0x26c3c1={};_0x2164c9<_0x4af149['length'];_0x2164c9+=0x1){_0x26c3c1=_0x4af149[_0x2164c9];if(_[_0xeef7('0x44')](_0x4227c9[_0xeef7('0x19')][_0x26c3c1['id']])){_0x4227c9[_0xeef7('0x19')][_0x26c3c1['id']]=new VoiceExtension(_0x26c3c1);}else{_0x4227c9[_0xeef7('0x40')](_0x4227c9[_0xeef7('0x19')][_0x26c3c1['id']],_0x26c3c1);}}}return _0x4227c9[_0xeef7('0x19')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x66')]=function(){var _0x324afc=this;return function(_0x3a9d98){clearCampaigns(_0x324afc[_0xeef7('0x16')]);for(var _0x4ce1a0=0x0;_0x4ce1a0<_0x3a9d98[_0xeef7('0x43')];_0x4ce1a0+=0x1){_[_0xeef7('0x56')](_0x324afc[_0xeef7('0x16')][_0x3a9d98[_0x4ce1a0][_0xeef7('0x27')]],_0x3a9d98[_0x4ce1a0]);}return _0x324afc[_0xeef7('0x16')];};};Realtime[_0xeef7('0x3f')][_0xeef7('0x67')]=function(){var _0x52088b=this;return function(_0x220e57){if(_0x220e57){freeIsNotKey(_0x220e57,_0x52088b[_0xeef7('0x68')],'id');for(var _0x577ebb=0x0,_0x14a8a2={},_0xec2c1c={};_0x577ebb<_0x220e57[_0xeef7('0x43')];_0x577ebb+=0x1){_0x14a8a2=_0x220e57[_0x577ebb];if(_[_0xeef7('0x44')](_0x52088b[_0xeef7('0x68')][_0x14a8a2['id']])){_0x52088b[_0xeef7('0x68')][_0x14a8a2['id']]=new FaxAccount(_0x14a8a2);}else{_0x52088b[_0xeef7('0x40')](_0x52088b[_0xeef7('0x68')][_0x14a8a2['id']],_0x14a8a2);}}}return _0x52088b[_0xeef7('0x68')];};};module['exports']=Realtime; \ No newline at end of file +var _0x015e=['timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','interface','initTelephones','isUndefined','initVoiceQueues','triggers','initTemplates','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x015e,0x138));var _0xe015=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x015e[_0xc0a3d3];return _0x3386e8;};'use strict';var util=require(_0xe015('0x0'));var _=require(_0xe015('0x1'));var moment=require(_0xe015('0x2'));var Agent=require(_0xe015('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xe015('0x4'));var VoiceQueue=require(_0xe015('0x5'));var Trigger=require(_0xe015('0x6'));var Template=require(_0xe015('0x7'));var Campaign=require(_0xe015('0x8'));var VoiceExtension=require(_0xe015('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xe015('0xa'));var SugarcrmAccount=require(_0xe015('0xb'));var ZohoAccount=require(_0xe015('0xc'));var DeskAccount=require(_0xe015('0xd'));var VtigerAccount=require(_0xe015('0xe'));var ServicenowAccount=require(_0xe015('0xf'));var Dynamics365Account=require(_0xe015('0x10'));var FreshsalesAccount=require(_0xe015('0x11'));var FaxAccount=require(_0xe015('0x12'));var Realtime=function(){this[_0xe015('0x13')]={};this[_0xe015('0x14')]={};this[_0xe015('0x15')]={};this[_0xe015('0x16')]={};this['triggers']={};this[_0xe015('0x17')]={};this[_0xe015('0x18')]={};this[_0xe015('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe015('0x1a')]={};this[_0xe015('0x1b')]={};this[_0xe015('0x1c')]={};this[_0xe015('0x1d')]={};this[_0xe015('0x1e')]={};this[_0xe015('0x1f')]={};this[_0xe015('0x20')]={};this['salesforceAccounts']={};this[_0xe015('0x21')]={};this['freshdeskAccounts']={};this[_0xe015('0x22')]={};this[_0xe015('0x23')]={};this[_0xe015('0x24')]={};this[_0xe015('0x25')]={};this['dynamics365Accounts']={};this[_0xe015('0x26')]={};this[_0xe015('0x27')]={};};function freeIsNotKey(_0xdbcfe,_0xe5cedc,_0x191682){var _0x38b0a7=_[_0xe015('0x28')](_0xdbcfe,function(_0x123271,_0x3c3d25){return _0x123271[_0x191682];});for(var _0x1f2ab8 in _0xe5cedc){if(_0xe5cedc[_0xe015('0x29')](_0x1f2ab8)){if(!_0x38b0a7[_0x1f2ab8]){delete _0xe5cedc[_0x1f2ab8];}}}}function freeIsNotKeySip(_0x802c67,_0x25676f){var _0x179118=_[_0xe015('0x28')](_0x802c67,function(_0x46fc00,_0x3e3b27){return util[_0xe015('0x2a')]('SIP/%s',_0x46fc00['name']);});for(var _0x537ee0 in _0x25676f){if(_0x25676f[_0xe015('0x29')](_0x537ee0)){if(!_0x179118[_0x537ee0]){delete _0x25676f[_0x537ee0];}}}}function freeIsNotKeyAgent(_0x2f4f57,_0x4c8350){var _0x475700=_[_0xe015('0x28')](_0x2f4f57,function(_0x532a24,_0xb8b644){var _0x39d370=_['isNil'](_0x532a24['interface'])?util[_0xe015('0x2a')](_0xe015('0x2b'),_0x532a24[_0xe015('0x2c')]):_0x532a24['interface'];return _0x39d370;});for(var _0x194eac in _0x4c8350){if(_0x4c8350[_0xe015('0x29')](_0x194eac)){if(!_0x475700[_0x194eac]){delete _0x4c8350[_0x194eac];}}}}function clearVoiceCallReports(_0xea72a9){_0xea72a9[_0xe015('0x2d')]=0x0;_0xea72a9[_0xe015('0x2e')]=0x0;_0xea72a9[_0xe015('0x2f')]=0x0;_0xea72a9[_0xe015('0x30')]=0x0;_0xea72a9[_0xe015('0x31')]=0x0;}function clearCampaigns(_0x290e10){if(!_[_0xe015('0x32')](_0x290e10)){for(var _0x42b67e in _0x290e10){if(_0x290e10[_0xe015('0x29')](_0x42b67e)){_0x290e10[_0x42b67e][_0xe015('0x33')]=0x0;_0x290e10[_0x42b67e][_0xe015('0x34')]=0x0;}}}}function clearVoiceQueues(_0x18cf9e){if(!_['isEmpty'](_0x18cf9e)){for(var _0x51a03f in _0x18cf9e){if(_0x18cf9e[_0xe015('0x29')](_0x51a03f)){_0x18cf9e[_0x51a03f]['total']=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x2e')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x35')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x36')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x2f')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x30')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x31')]=0x0;_0x18cf9e[_0x51a03f]['outboundAnswerAgiCallsDay']=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x37')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x38')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x39')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x3a')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x3b')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x3c')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x3d')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x3e')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x3f')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x40')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x41')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x42')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x43')]=0x0;_0x18cf9e[_0x51a03f][_0xe015('0x44')]=!![];}}}}Realtime['prototype'][_0xe015('0x45')]=function(_0x5aded5,_0x4bcedd){for(var _0xa253c2 in _0x4bcedd){if(_0x5aded5[_0xe015('0x29')](_0xa253c2)){_0x5aded5[_0xa253c2]=_0x4bcedd[_0xa253c2];}}};Realtime[_0xe015('0x46')][_0xe015('0x47')]=function(){var _0xb9a144=this;return function(_0xf7e02d){if(_0xf7e02d){freeIsNotKeyAgent(_0xf7e02d,_0xb9a144[_0xe015('0x13')]);for(var _0x3f3989=0x0,_0xc304db={},_0x15f433={};_0x3f3989<_0xf7e02d[_0xe015('0x48')];_0x3f3989+=0x1){_0xc304db=_0xf7e02d[_0x3f3989];var _0x591395=_[_0xe015('0x49')](_0xc304db[_0xe015('0x4a')])?util['format'](_0xe015('0x2b'),_0xc304db[_0xe015('0x2c')]):_0xc304db[_0xe015('0x4a')];if(_['isUndefined'](_0xb9a144['agents'][_0x591395])){_0xb9a144['agents'][_0x591395]=new Agent(_0xc304db);}else{_0xb9a144[_0xe015('0x45')](_0xb9a144['agents'][_0x591395],_0xc304db);}}}return _0xb9a144['agents'];};};Realtime[_0xe015('0x46')][_0xe015('0x4b')]=function(){var _0xca7b1a=this;return function(_0x35e27f){if(_0x35e27f){freeIsNotKeySip(_0x35e27f,_0xca7b1a['telephones']);for(var _0x20ad2a=0x0,_0x4380d5={},_0x505931={};_0x20ad2a<_0x35e27f[_0xe015('0x48')];_0x20ad2a+=0x1){_0x4380d5=_0x35e27f[_0x20ad2a];if(_[_0xe015('0x4c')](_0xca7b1a[_0xe015('0x14')][util[_0xe015('0x2a')](_0xe015('0x2b'),_0x4380d5[_0xe015('0x2c')])])){_0xca7b1a[_0xe015('0x14')][util[_0xe015('0x2a')](_0xe015('0x2b'),_0x4380d5[_0xe015('0x2c')])]=new Telephone(_0x4380d5);}else{_0xca7b1a[_0xe015('0x45')](_0xca7b1a['telephones'][util[_0xe015('0x2a')]('SIP/%s',_0x4380d5['name'])],_0x4380d5);}}}return _0xca7b1a['telephones'];};};Realtime[_0xe015('0x46')]['initTrunks']=function(){var _0x11c430=this;return function(_0x15dba9){if(_0x15dba9){freeIsNotKeySip(_0x15dba9,_0x11c430[_0xe015('0x15')]);for(var _0x1bdf83=0x0,_0x3a1833={},_0x2719c4={};_0x1bdf83<_0x15dba9[_0xe015('0x48')];_0x1bdf83+=0x1){_0x3a1833=_0x15dba9[_0x1bdf83];if(_['isUndefined'](_0x11c430[_0xe015('0x15')][util[_0xe015('0x2a')](_0xe015('0x2b'),_0x3a1833['name'])])){_0x11c430[_0xe015('0x15')][util[_0xe015('0x2a')](_0xe015('0x2b'),_0x3a1833[_0xe015('0x2c')])]=new Trunk(_0x3a1833);}else{_0x11c430['mergeFromDatabase'](_0x11c430[_0xe015('0x15')][util[_0xe015('0x2a')](_0xe015('0x2b'),_0x3a1833[_0xe015('0x2c')])],_0x3a1833);}}}return _0x11c430[_0xe015('0x15')];};};Realtime[_0xe015('0x46')][_0xe015('0x4d')]=function(){var _0x26decf=this;return function(_0x5aca06){if(_0x5aca06){freeIsNotKey(_0x5aca06,_0x26decf[_0xe015('0x16')],_0xe015('0x2c'));for(var _0x2f011f=0x0,_0x184856={},_0x19504c={};_0x2f011f<_0x5aca06[_0xe015('0x48')];_0x2f011f+=0x1){_0x184856=_0x5aca06[_0x2f011f];if(_[_0xe015('0x4c')](_0x26decf['voiceQueues'][_0x184856[_0xe015('0x2c')]])){_0x26decf[_0xe015('0x16')][_0x184856[_0xe015('0x2c')]]=new VoiceQueue(_0x184856);}else{_0x26decf[_0xe015('0x45')](_0x26decf['voiceQueues'][_0x184856['name']],_0x184856);}}}return _0x26decf[_0xe015('0x16')];};};Realtime[_0xe015('0x46')]['initTriggers']=function(){var _0x110ba5=this;return function(_0x10a7de){if(_0x10a7de){freeIsNotKey(_0x10a7de,_0x110ba5['triggers'],'id');for(var _0x4c28bc=0x0,_0xb608e5={},_0x533ad9={};_0x4c28bc<_0x10a7de['length'];_0x4c28bc+=0x1){_0xb608e5=_0x10a7de[_0x4c28bc];if(_[_0xe015('0x4c')](_0x110ba5['triggers'][_0xb608e5['id']])){_0x110ba5[_0xe015('0x4e')][_0xb608e5['id']]=new Trigger(_0xb608e5);}else{_0x110ba5[_0xe015('0x45')](_0x110ba5['triggers'][_0xb608e5['id']],_0xb608e5);}}}return _0x110ba5[_0xe015('0x4e')];};};Realtime[_0xe015('0x46')][_0xe015('0x4f')]=function(){var _0x19a5ae=this;return function(_0x1eed34){if(_0x1eed34){freeIsNotKey(_0x1eed34,_0x19a5ae[_0xe015('0x18')],'id');for(var _0x1813b7=0x0,_0x4a610e={},_0x4428ed={};_0x1813b7<_0x1eed34[_0xe015('0x48')];_0x1813b7+=0x1){_0x4a610e=_0x1eed34[_0x1813b7];if(_[_0xe015('0x4c')](_0x19a5ae['templates'][_0x4a610e['id']])){_0x19a5ae[_0xe015('0x18')][_0x4a610e['id']]=new Template(_0x4a610e);}else{_0x19a5ae[_0xe015('0x45')](_0x19a5ae[_0xe015('0x18')][_0x4a610e['id']],_0x4a610e);}}}return _0x19a5ae[_0xe015('0x18')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x969f91=this;return function(_0x1b9f67){if(_0x1b9f67){freeIsNotKey(_0x1b9f67,_0x969f91['zendeskAccounts'],'id');for(var _0x2efe8b=0x0,_0x6dc5cb={},_0x425dda={};_0x2efe8b<_0x1b9f67[_0xe015('0x48')];_0x2efe8b+=0x1){_0x6dc5cb=_0x1b9f67[_0x2efe8b];if(_[_0xe015('0x4c')](_0x969f91[_0xe015('0x20')][_0x6dc5cb['id']])){_0x969f91[_0xe015('0x20')][_0x6dc5cb['id']]=new ZendeskAccount(_0x6dc5cb);}else{_0x969f91['mergeFromDatabase'](_0x969f91[_0xe015('0x20')][_0x6dc5cb['id']],_0x6dc5cb);}}}return _0x969f91['zendeskAccounts'];};};Realtime[_0xe015('0x46')][_0xe015('0x50')]=function(){var _0x1882f9=this;return function(_0x1eaebe){if(_0x1eaebe){freeIsNotKey(_0x1eaebe,_0x1882f9['salesforceAccounts'],'id');for(var _0x458d17=0x0,_0x1f8fa5={},_0x3a5e85={};_0x458d17<_0x1eaebe[_0xe015('0x48')];_0x458d17+=0x1){_0x1f8fa5=_0x1eaebe[_0x458d17];if(_['isUndefined'](_0x1882f9['salesforceAccounts'][_0x1f8fa5['id']])){_0x1882f9[_0xe015('0x51')][_0x1f8fa5['id']]=new SalesforceAccount(_0x1f8fa5);}else{_0x1882f9[_0xe015('0x45')](_0x1882f9[_0xe015('0x51')][_0x1f8fa5['id']],_0x1f8fa5);}}}return _0x1882f9['salesforceAccounts'];};};Realtime[_0xe015('0x46')][_0xe015('0x52')]=function(){var _0x324a97=this;return function(_0x1414ce){if(_0x1414ce){freeIsNotKey(_0x1414ce,_0x324a97[_0xe015('0x53')],'id');for(var _0x3b36b2=0x0,_0x62d0bc={},_0x119ef4={};_0x3b36b2<_0x1414ce[_0xe015('0x48')];_0x3b36b2+=0x1){_0x62d0bc=_0x1414ce[_0x3b36b2];if(_['isUndefined'](_0x324a97[_0xe015('0x53')][_0x62d0bc['id']])){_0x324a97[_0xe015('0x53')][_0x62d0bc['id']]=new FreshdeskAccount(_0x62d0bc);}else{_0x324a97['mergeFromDatabase'](_0x324a97[_0xe015('0x53')][_0x62d0bc['id']],_0x62d0bc);}}}return _0x324a97['freshdeskAccounts'];};};Realtime[_0xe015('0x46')][_0xe015('0x54')]=function(){var _0x5126f7=this;return function(_0xab40fe){if(_0xab40fe){freeIsNotKey(_0xab40fe,_0x5126f7[_0xe015('0x22')],'id');for(var _0x19d5c9=0x0,_0x45de3e={},_0x5d49a8={};_0x19d5c9<_0xab40fe[_0xe015('0x48')];_0x19d5c9+=0x1){_0x45de3e=_0xab40fe[_0x19d5c9];if(_['isUndefined'](_0x5126f7[_0xe015('0x22')][_0x45de3e['id']])){_0x5126f7[_0xe015('0x22')][_0x45de3e['id']]=new ZohoAccount(_0x45de3e);}else{_0x5126f7[_0xe015('0x45')](_0x5126f7[_0xe015('0x22')][_0x45de3e['id']],_0x45de3e);}}}return _0x5126f7['zohoAccounts'];};};Realtime['prototype'][_0xe015('0x55')]=function(){var _0x172848=this;return function(_0x39b7b1){if(_0x39b7b1){freeIsNotKey(_0x39b7b1,_0x172848[_0xe015('0x23')],'id');for(var _0x55cfb8=0x0,_0x19945c={},_0x456cf2={};_0x55cfb8<_0x39b7b1['length'];_0x55cfb8+=0x1){_0x19945c=_0x39b7b1[_0x55cfb8];if(_[_0xe015('0x4c')](_0x172848[_0xe015('0x23')][_0x19945c['id']])){_0x172848[_0xe015('0x23')][_0x19945c['id']]=new DeskAccount(_0x19945c);}else{_0x172848['mergeFromDatabase'](_0x172848[_0xe015('0x23')][_0x19945c['id']],_0x19945c);}}}return _0x172848[_0xe015('0x23')];};};Realtime[_0xe015('0x46')][_0xe015('0x56')]=function(){var _0x38f915=this;return function(_0x58b7f6){if(_0x58b7f6){freeIsNotKey(_0x58b7f6,_0x38f915[_0xe015('0x21')],'id');for(var _0x5a39fc=0x0,_0xd33cdd={},_0x2b68d4={};_0x5a39fc<_0x58b7f6[_0xe015('0x48')];_0x5a39fc+=0x1){_0xd33cdd=_0x58b7f6[_0x5a39fc];if(_[_0xe015('0x4c')](_0x38f915['sugarcrmAccounts'][_0xd33cdd['id']])){_0x38f915[_0xe015('0x21')][_0xd33cdd['id']]=new SugarcrmAccount(_0xd33cdd);}else{_0x38f915['mergeFromDatabase'](_0x38f915['sugarcrmAccounts'][_0xd33cdd['id']],_0xd33cdd);}}}return _0x38f915[_0xe015('0x21')];};};Realtime[_0xe015('0x46')]['initVtigerAccounts']=function(){var _0xf94f1c=this;return function(_0x4c0206){if(_0x4c0206){freeIsNotKey(_0x4c0206,_0xf94f1c[_0xe015('0x24')],'id');for(var _0x2d3ac7=0x0,_0x2cf3a7={},_0x50bbda={};_0x2d3ac7<_0x4c0206[_0xe015('0x48')];_0x2d3ac7+=0x1){_0x2cf3a7=_0x4c0206[_0x2d3ac7];if(_[_0xe015('0x4c')](_0xf94f1c['vtigerAccounts'][_0x2cf3a7['id']])){_0xf94f1c[_0xe015('0x24')][_0x2cf3a7['id']]=new VtigerAccount(_0x2cf3a7);}else{_0xf94f1c['mergeFromDatabase'](_0xf94f1c[_0xe015('0x24')][_0x2cf3a7['id']],_0x2cf3a7);}}}return _0xf94f1c[_0xe015('0x24')];};};Realtime[_0xe015('0x46')]['initServicenowAccounts']=function(){var _0x275159=this;return function(_0x36d7ab){if(_0x36d7ab){freeIsNotKey(_0x36d7ab,_0x275159['servicenowAccounts'],'id');for(var _0x45dd8e=0x0,_0x31a401={},_0x3cede7={};_0x45dd8e<_0x36d7ab[_0xe015('0x48')];_0x45dd8e+=0x1){_0x31a401=_0x36d7ab[_0x45dd8e];if(_[_0xe015('0x4c')](_0x275159[_0xe015('0x25')][_0x31a401['id']])){_0x275159['servicenowAccounts'][_0x31a401['id']]=new ServicenowAccount(_0x31a401);}else{_0x275159['mergeFromDatabase'](_0x275159[_0xe015('0x25')][_0x31a401['id']],_0x31a401);}}}return _0x275159[_0xe015('0x25')];};};Realtime['prototype'][_0xe015('0x57')]=function(){var _0x1db529=this;return function(_0x3277c9){if(_0x3277c9){freeIsNotKey(_0x3277c9,_0x1db529[_0xe015('0x58')],'id');for(var _0x43e374=0x0,_0x427414={},_0x57c653={};_0x43e374<_0x3277c9[_0xe015('0x48')];_0x43e374+=0x1){_0x427414=_0x3277c9[_0x43e374];if(_[_0xe015('0x4c')](_0x1db529[_0xe015('0x58')][_0x427414['id']])){_0x1db529[_0xe015('0x58')][_0x427414['id']]=new Dynamics365Account(_0x427414);}else{_0x1db529[_0xe015('0x45')](_0x1db529['dynamics365Accounts'][_0x427414['id']],_0x427414);}}}return _0x1db529[_0xe015('0x58')];};};Realtime['prototype'][_0xe015('0x59')]=function(){var _0x4b5503=this;return function(_0x47926b){if(_0x47926b){freeIsNotKey(_0x47926b,_0x4b5503['freshsalesAccounts'],'id');for(var _0x47498a=0x0,_0xddafce={},_0xa9f65d={};_0x47498a<_0x47926b[_0xe015('0x48')];_0x47498a+=0x1){_0xddafce=_0x47926b[_0x47498a];if(_[_0xe015('0x4c')](_0x4b5503[_0xe015('0x26')][_0xddafce['id']])){_0x4b5503['freshsalesAccounts'][_0xddafce['id']]=new FreshsalesAccount(_0xddafce);}else{_0x4b5503['mergeFromDatabase'](_0x4b5503['freshsalesAccounts'][_0xddafce['id']],_0xddafce);}}}return _0x4b5503[_0xe015('0x26')];};};Realtime['prototype'][_0xe015('0x5a')]=function(){var _0x11c01f=this;return function(_0xa6f135){for(var _0x49f041=0x0;_0x49f041<_0xa6f135[_0xe015('0x48')];_0x49f041+=0x1){_['merge'](_0x11c01f[_0xe015('0x16')][_0xa6f135[_0x49f041][_0xe015('0x2c')]],_0xa6f135[_0x49f041]);}return _0x11c01f[_0xe015('0x16')];};};Realtime[_0xe015('0x46')][_0xe015('0x5b')]=function(){var _0x4ffe23=this;return function(_0x3a2381){clearVoiceQueues(_0x4ffe23[_0xe015('0x16')]);if(_0x3a2381){_0x3a2381=_[_0xe015('0x5c')](_0x3a2381,_0xe015('0x5d'));for(var _0x2390d3 in _0x3a2381){if(_0x3a2381[_0xe015('0x29')](_0x2390d3)){var _0x484414={};for(var _0x50e71f=0x0;_0x50e71f<_0x3a2381[_0x2390d3][_0xe015('0x48')];_0x50e71f+=0x1){var _0x49c349=_0x3a2381[_0x2390d3][_0x50e71f]['queue'];if(_0x4ffe23[_0xe015('0x16')][_0x49c349]){if(_0x3a2381[_0x2390d3][_0x50e71f][_0xe015('0x5e')]){_0x4ffe23[_0xe015('0x16')][_0x49c349]['unmanaged']+=0x1;}if(_0x3a2381[_0x2390d3][_0x50e71f]['queuecallerabandon']){_0x4ffe23[_0xe015('0x16')][_0x49c349][_0xe015('0x36')]+=0x1;}_0x4ffe23[_0xe015('0x16')][_0x49c349]['sumHoldTime']+=moment(_0x3a2381[_0x2390d3][_0x50e71f][_0xe015('0x5f')])[_0xe015('0x60')](moment(_0x3a2381[_0x2390d3][_0x50e71f]['queuecallerjoinAt']),_0xe015('0x61'))||0x0;if(_0x50e71f===_0x3a2381[_0x2390d3][_0xe015('0x48')]-0x1){_0x4ffe23[_0xe015('0x16')][_0x49c349]['sumDuration']+=moment(_0x3a2381[_0x2390d3][_0x50e71f][_0xe015('0x62')]||_0x3a2381[_0x2390d3][_0x50e71f][_0xe015('0x63')]||_0x3a2381[_0x2390d3][_0x50e71f][_0xe015('0x64')])[_0xe015('0x60')](moment(_0x3a2381[_0x2390d3][_0x50e71f][_0xe015('0x65')]),_0xe015('0x61'))||0x0;_0x4ffe23['voiceQueues'][_0x49c349][_0xe015('0x2d')]+=0x1;if(_0x3a2381[_0x2390d3][_0x50e71f][_0xe015('0x66')]){_0x4ffe23['voiceQueues'][_0x49c349]['answered']+=0x1;_0x4ffe23[_0xe015('0x16')][_0x49c349]['sumBillable']+=moment(_0x3a2381[_0x2390d3][_0x50e71f]['queuecallercompleteAt'])['diff'](moment(_0x3a2381[_0x2390d3][_0x50e71f][_0xe015('0x5f')]),_0xe015('0x61'))||0x0;}}else{_0x4ffe23['voiceQueues'][_0x49c349][_0xe015('0x30')]+=_0x4ffe23[_0xe015('0x16')][_0x49c349][_0xe015('0x2f')]||0x0;}}}}}}return _0x4ffe23['voiceQueues'];};};Realtime[_0xe015('0x46')][_0xe015('0x67')]=function(){var _0x2341c9=this;return function(_0x1a517){clearVoiceCallReports(_0x2341c9[_0xe015('0x19')]);if(_0x1a517){for(var _0x4734e9=0x0;_0x4734e9<_0x1a517[_0xe015('0x48')];_0x4734e9+=0x1){_0x2341c9[_0xe015('0x19')]['total']+=0x1;_0x2341c9['outbound'][_0xe015('0x30')]+=_0x1a517[_0x4734e9][_0xe015('0x68')];if(_0x1a517[_0x4734e9]['disposition']===_0xe015('0x69')){_0x2341c9['outbound']['answered']+=0x1;_0x2341c9[_0xe015('0x19')]['sumHoldTime']+=_0x1a517[_0x4734e9][_0xe015('0x68')]-_0x1a517[_0x4734e9][_0xe015('0x6a')]||0x0;_0x2341c9[_0xe015('0x19')][_0xe015('0x31')]+=_0x1a517[_0x4734e9][_0xe015('0x6a')];}}}return _0x2341c9[_0xe015('0x19')];};};Realtime[_0xe015('0x46')][_0xe015('0x6b')]=function(){var _0xdfe27b=this;return function(_0x3127aa){if(_0x3127aa){freeIsNotKey(_0x3127aa,_0xdfe27b[_0xe015('0x17')],_0xe015('0x2c'));for(var _0x130e92=0x0,_0x54700b={};_0x130e92<_0x3127aa['length'];_0x130e92+=0x1){_0x54700b=_0x3127aa[_0x130e92];if(_[_0xe015('0x4c')](_0xdfe27b[_0xe015('0x17')][_0x54700b[_0xe015('0x2c')]])){_0xdfe27b[_0xe015('0x17')][_0x54700b[_0xe015('0x2c')]]=new Campaign(_0x54700b);}else{_0xdfe27b[_0xe015('0x45')](_0xdfe27b[_0xe015('0x17')][_0x54700b[_0xe015('0x2c')]],_0x54700b);_0xdfe27b[_0xe015('0x17')][_0x54700b[_0xe015('0x2c')]][_0xe015('0x6c')]=_0x54700b['SquareProject']?_0x54700b[_0xe015('0x6d')][_0xe015('0x2c')]:undefined;}}}return _0xdfe27b[_0xe015('0x17')];};};Realtime['prototype'][_0xe015('0x6e')]=function(){var _0x28c230=this;return function(_0xa04022){if(_0xa04022){freeIsNotKey(_0xa04022,_0x28c230[_0xe015('0x1a')],'id');for(var _0x7af984=0x0,_0x511d64={};_0x7af984<_0xa04022[_0xe015('0x48')];_0x7af984+=0x1){_0x511d64=_0xa04022[_0x7af984];if(_['isUndefined'](_0x28c230['voiceExtensions'][_0x511d64['id']])){_0x28c230[_0xe015('0x1a')][_0x511d64['id']]=new VoiceExtension(_0x511d64);}else{_0x28c230['mergeFromDatabase'](_0x28c230[_0xe015('0x1a')][_0x511d64['id']],_0x511d64);}}}return _0x28c230[_0xe015('0x1a')];};};Realtime['prototype'][_0xe015('0x6f')]=function(){var _0x19e1ef=this;return function(_0x2b51ee){clearCampaigns(_0x19e1ef['campaigns']);for(var _0x3a9513=0x0;_0x3a9513<_0x2b51ee[_0xe015('0x48')];_0x3a9513+=0x1){_[_0xe015('0x70')](_0x19e1ef[_0xe015('0x17')][_0x2b51ee[_0x3a9513]['name']],_0x2b51ee[_0x3a9513]);}return _0x19e1ef[_0xe015('0x17')];};};Realtime[_0xe015('0x46')][_0xe015('0x71')]=function(){var _0x517173=this;return function(_0x18f561){if(_0x18f561){freeIsNotKey(_0x18f561,_0x517173['faxAccounts'],'id');for(var _0x2aa6da=0x0,_0x2c05e0={},_0x37163a={};_0x2aa6da<_0x18f561[_0xe015('0x48')];_0x2aa6da+=0x1){_0x2c05e0=_0x18f561[_0x2aa6da];if(_[_0xe015('0x4c')](_0x517173['faxAccounts'][_0x2c05e0['id']])){_0x517173[_0xe015('0x27')][_0x2c05e0['id']]=new FaxAccount(_0x2c05e0);}else{_0x517173['mergeFromDatabase'](_0x517173[_0xe015('0x27')][_0x2c05e0['id']],_0x2c05e0);}}}return _0x517173['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 1a6337d..0aed858 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 _0x8ccb=['exports','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','format','voiceQueueReport','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','getCallType','channel','split','calleridnum','outbound','destination','exten','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','type','UserId','membername','monitor','monitors','length','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','startsWith','Local','substring','indexOf','phone','SIP/%s','transfererlinkedid'];(function(_0x59af15,_0x406b8b){var _0x4dee18=function(_0x19c50c){while(--_0x19c50c){_0x59af15['push'](_0x59af15['shift']());}};_0x4dee18(++_0x406b8b);}(_0x8ccb,0x1b4));var _0xb8cc=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0x8ccb[_0x143565];return _0x4dc1d9;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xb8cc('0x0'));var config=require(_0xb8cc('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xb8cc('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xb8cc('0x3'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xb8cc('0x4'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xb8cc('0x5'));var VoiceAgentReport=require(_0xb8cc('0x6'));var VoiceDialReport=require(_0xb8cc('0x7'));var UserReport=require('./userReport');function Report(_0x3a4aba){this[_0xb8cc('0x8')]=_0x3a4aba;this[_0xb8cc('0x9')]=_0x3a4aba[_0xb8cc('0x9')];this[_0xb8cc('0xa')]=_0x3a4aba[_0xb8cc('0xa')];}Report[_0xb8cc('0xb')]['sync']=function(_0x21b9b0){var _0x350b6e=new VoiceQueueReport(this['realtime']);var _0x577ef9=new VoiceAgentReport(this['realtime']);var _0x5b32f7=new VoiceDialReport(this[_0xb8cc('0x8')]);var _0x4230d9=new VoiceCallReport(this[_0xb8cc('0x8')]);var _0x1c2e07=new UserReport(this['realtime']);if(config[_0xb8cc('0xc')]&&config[_0xb8cc('0xc')][_0xb8cc('0xd')]){ami['on'](_0xb8cc('0xe'),this['voiceQueueReport'][_0xb8cc('0xf')](this));ami['on'](_0xb8cc('0x10'),this[_0xb8cc('0x11')]['bind'](this));ami['on'](_0xb8cc('0x12'),this['voiceAgentReport'][_0xb8cc('0xf')](this));ami['on']('custom:voiceDialReport',this[_0xb8cc('0x13')][_0xb8cc('0xf')](this));ami['on'](_0xb8cc('0x14'),this[_0xb8cc('0x15')][_0xb8cc('0xf')](this));ami['on'](_0xb8cc('0x16'),this[_0xb8cc('0x17')]['bind'](this));}};Report[_0xb8cc('0xb')][_0xb8cc('0x18')]=function(_0x1f59ab){var _0xe97b3c;_0xe97b3c=_[_0xb8cc('0x19')](this['agents'],function(_0x54857d){return _0x54857d[_0xb8cc('0x1a')]==_0x1f59ab||_0x54857d[_0xb8cc('0x1b')]==_0x1f59ab;});if(_[_0xb8cc('0x1c')](_0xe97b3c)){var _0x48fb9b=_['find'](this['telephones'],function(_0x4b7448){return _0x4b7448['accountcode']==_0x1f59ab||_0x4b7448[_0xb8cc('0x1b')]==_0x1f59ab;});if(_0x48fb9b){_0xe97b3c=_[_0xb8cc('0x19')](this[_0xb8cc('0x9')],function(_0x306bdb){return _0x306bdb['interface']==util[_0xb8cc('0x1d')]('SIP/%s',_0x48fb9b[_0xb8cc('0x1b')]);});}}return _0xe97b3c;};Report[_0xb8cc('0xb')][_0xb8cc('0x1e')]=function(_0x4b6c90){for(var _0x5b618b=0x0;_0x5b618b<_0x4b6c90['length'];_0x5b618b+=0x1){var _0x442b7f=this['findAgent'](_0x4b6c90[_0x5b618b][_0xb8cc('0x1f')]);if(_0x442b7f){_0x4b6c90[_0x5b618b][_0xb8cc('0x1a')]=_0x442b7f[_0xb8cc('0x1a')];_0x4b6c90[_0x5b618b][_0xb8cc('0x20')]=!![];_0x4b6c90[_0x5b618b][_0xb8cc('0x21')]=_0x442b7f['name'];_0x4b6c90[_0x5b618b]['interface']=_[_0xb8cc('0x1c')](_0x442b7f[_0xb8cc('0x22')])?util[_0xb8cc('0x1d')]('SIP/%s',_0x442b7f['name']):_0x442b7f['interface'];if(_0x4b6c90[_0x5b618b]['queuecallercomplete']){_0x4b6c90[_0x5b618b][_0xb8cc('0x23')]=moment()['format'](_0xb8cc('0x24'));}if(_0x4b6c90[_0x5b618b][_0xb8cc('0x25')]){_0x4b6c90[_0x5b618b][_0xb8cc('0x26')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xb8cc('0x1e')](_0x4b6c90[_0x5b618b]);}RpcVoiceQueueReport[_0xb8cc('0x27')](_0x4b6c90[_0x5b618b]);}};function extractCalleridNumber(_0x1d2e2c){var _0x485643=_0x1d2e2c[_0xb8cc('0x28')](/<(.*?)>/);return _0x485643?_0x485643[0x1]:_0x1d2e2c;}Report[_0xb8cc('0xb')][_0xb8cc('0x29')]=function(_0xabb095){for(var _0x23fce7=0x0;_0x23fce7','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','create','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinenum','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','telephones'];(function(_0x251fa8,_0x438d42){var _0x3d89e9=function(_0x5f91dc){while(--_0x5f91dc){_0x251fa8['push'](_0x251fa8['shift']());}};_0x3d89e9(++_0x438d42);}(_0x37b4,0x168));var _0x437b=function(_0x3d2438,_0x2e7922){_0x3d2438=_0x3d2438-0x0;var _0xd18de5=_0x37b4[_0x3d2438];return _0xd18de5;};'use strict';var _=require(_0x437b('0x0'));var moment=require(_0x437b('0x1'));var util=require(_0x437b('0x2'));var config=require(_0x437b('0x3'));var ami=require(_0x437b('0x4'));var RpcVoiceAgentReport=require(_0x437b('0x5'));var RpcVoiceCallReport=require(_0x437b('0x6'));var RpcVoiceDialReport=require(_0x437b('0x7'));var RpcMemberReport=require(_0x437b('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x437b('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x437b('0xa'));var VoiceCallReport=require(_0x437b('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x437b('0xc'));function Report(_0x417e40){this[_0x437b('0xd')]=_0x417e40;this[_0x437b('0xe')]=_0x417e40[_0x437b('0xe')];this[_0x437b('0xf')]=_0x417e40[_0x437b('0xf')];}Report['prototype']['sync']=function(_0xc6600b){var _0x51e2c5=new VoiceQueueReport(this[_0x437b('0xd')]);var _0x553e3b=new VoiceAgentReport(this[_0x437b('0xd')]);var _0x124a9b=new VoiceDialReport(this[_0x437b('0xd')]);var _0x365bb4=new VoiceCallReport(this[_0x437b('0xd')]);var _0x3e315f=new UserReport(this[_0x437b('0xd')]);if(config[_0x437b('0x10')]&&config[_0x437b('0x10')][_0x437b('0x11')]){ami['on']('custom:voiceQueueReport',this[_0x437b('0x12')][_0x437b('0x13')](this));ami['on']('custom:voiceCallReport',this[_0x437b('0x14')][_0x437b('0x13')](this));ami['on'](_0x437b('0x15'),this[_0x437b('0x16')][_0x437b('0x13')](this));ami['on'](_0x437b('0x17'),this[_0x437b('0x18')]['bind'](this));ami['on'](_0x437b('0x19'),this[_0x437b('0x1a')][_0x437b('0x13')](this));ami['on'](_0x437b('0x1b'),this['attendedTransfer'][_0x437b('0x13')](this));}};Report[_0x437b('0x1c')][_0x437b('0x1d')]=function(_0x4e303c){var _0x58aaa3;_0x58aaa3=_[_0x437b('0x1e')](this[_0x437b('0xe')],function(_0x3f576d){return _0x3f576d[_0x437b('0x1f')]==_0x4e303c||_0x3f576d['name']==_0x4e303c;});if(_[_0x437b('0x20')](_0x58aaa3)){var _0x42f943=_[_0x437b('0x1e')](this[_0x437b('0xf')],function(_0x2f73e9){return _0x2f73e9[_0x437b('0x1f')]==_0x4e303c||_0x2f73e9['name']==_0x4e303c;});if(_0x42f943){_0x58aaa3=_[_0x437b('0x1e')](this[_0x437b('0xe')],function(_0x474bff){return _0x474bff[_0x437b('0x21')]==util[_0x437b('0x22')](_0x437b('0x23'),_0x42f943['name']);});}}return _0x58aaa3;};Report[_0x437b('0x1c')][_0x437b('0x12')]=function(_0x5bcb46){for(var _0x54419f=0x0;_0x54419f<_0x5bcb46[_0x437b('0x24')];_0x54419f+=0x1){var _0x5301d6=this['findAgent'](_0x5bcb46[_0x54419f]['connectedlinenum']);if(_0x5301d6){_0x5bcb46[_0x54419f][_0x437b('0x1f')]=_0x5301d6[_0x437b('0x1f')];_0x5bcb46[_0x54419f]['assigned']=!![];_0x5bcb46[_0x54419f][_0x437b('0x25')]=_0x5301d6['name'];_0x5bcb46[_0x54419f][_0x437b('0x21')]=_['isNil'](_0x5301d6['interface'])?util[_0x437b('0x22')](_0x437b('0x23'),_0x5301d6[_0x437b('0x26')]):_0x5301d6[_0x437b('0x21')];if(_0x5bcb46[_0x54419f][_0x437b('0x27')]){_0x5bcb46[_0x54419f][_0x437b('0x28')]=moment()[_0x437b('0x22')](_0x437b('0x29'));}if(_0x5bcb46[_0x54419f]['queuecallerexit']){_0x5bcb46[_0x54419f]['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x437b('0x12')](_0x5bcb46[_0x54419f]);}RpcVoiceQueueReport['create'](_0x5bcb46[_0x54419f]);}};function extractCalleridNumber(_0x34ade9){var _0x31ab34=_0x34ade9[_0x437b('0x2a')](/<(.*?)>/);return _0x31ab34?_0x31ab34[0x1]:_0x34ade9;}Report[_0x437b('0x1c')][_0x437b('0x2b')]=function(_0x28eed5){for(var _0x1bb04b=0x0;_0x1bb04b0x0?_0x1f18c9:0x0;this['voiceQueues'][_0x1c204b[_0xf048('0x6a')]][_0xf048('0x2e')]=this[_0xf048('0x10')][_0x1c204b[_0xf048('0x6a')]]['talking']>_[_0xf048('0x6b')](_0x1c204b[_0xf048('0x6d')])?_[_0xf048('0x6b')](_0x1c204b[_0xf048('0x6d')]):this[_0xf048('0x10')][_0x1c204b[_0xf048('0x6a')]][_0xf048('0x2e')];this[_0xf048('0x53')](this[_0xf048('0x10')][_0x1c204b[_0xf048('0x6a')]],_0xf048('0x13'));}logger[_0xf048('0x46')](_0xf048('0x6e'),util[_0xf048('0x3e')](this[_0xf048('0x10')][_0x1c204b[_0xf048('0x6a')]],{'showHidden':![],'depth':null}));ami[_0xf048('0x4a')](_0xf048('0x6f'),this[_0xf048('0x10')][_0x1c204b['queue']]);}}}catch(_0x4e8cc6){logger[_0xf048('0x3b')](_0xf048('0x70'),util['inspect'](_0x4e8cc6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf048('0x16')]=function(_0x425d27){logger[_0xf048('0x46')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xf048('0x3e')](_0x425d27,{'showHidden':![],'depth':null}));ami[_0xf048('0x4a')](_0xf048('0x71'),{});this[_0xf048('0x11')]=!![];};VoiceQueueReport[_0xf048('0x32')][_0xf048('0x72')]=function(_0x584336){try{if(this['isNotNull'](_0x584336)){logger[_0xf048('0x46')](_0xf048('0x73'),_0x584336['uniqueid'],util[_0xf048('0x3e')](_0x584336,{'showHidden':![],'depth':null}));if(_[_0xf048('0x64')](this['queueReports'][_0x584336['uniqueid']]))this['queueReports'][_0x584336[_0xf048('0x49')]]=[];if(_[_0xf048('0x64')](this['channels'][_0x584336[_0xf048('0x49')]]))this[_0xf048('0xe')][_0x584336['uniqueid']]={};var _0x1e4e4c=new QueueReport();_0x1e4e4c[_0xf048('0x4d')]=_0x584336[_0xf048('0x6a')];_0x1e4e4c['type']=this['voiceQueues'][_0x1e4e4c[_0xf048('0x4d')]]&&this[_0xf048('0x10')][_0x1e4e4c[_0xf048('0x4d')]]['type']?this[_0xf048('0x10')][_0x1e4e4c['name']][_0xf048('0x74')]||'inbound':_0xf048('0x54');_0x1e4e4c[_0xf048('0x6a')]=_0x584336[_0xf048('0x6a')];_0x1e4e4c[_0xf048('0x75')]=moment()[_0xf048('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e4e4c[_0xf048('0x76')]=_0x584336['position'];_0x1e4e4c[_0xf048('0x77')]=_0x584336[_0xf048('0x77')];_0x1e4e4c[_0xf048('0x49')]=_0x584336[_0xf048('0x49')];_0x1e4e4c['routealias']=this[_0xf048('0xe')][_0x584336[_0xf048('0x49')]][_0xf048('0x78')];logger['info'](_0xf048('0x79'),_0x1e4e4c[_0xf048('0x4d')],_0x1e4e4c['type']);_[_0xf048('0x7a')](_0x1e4e4c,_['pick'](_0x584336,_[_0xf048('0x7b')](_0x1e4e4c)));this[_0xf048('0x3c')][_0x584336[_0xf048('0x49')]][_0xf048('0x7c')](_0x1e4e4c);this[_0xf048('0xe')][_0x584336[_0xf048('0x49')]]=_0x1e4e4c;this[_0xf048('0x45')](_0x1e4e4c,_0xf048('0x7d'));}}catch(_0x2f95b6){logger[_0xf048('0x3b')](_0xf048('0x73'),_0x584336[_0xf048('0x49')],util[_0xf048('0x3e')](_0x2f95b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf048('0x32')]['syncQueueCallerAbandon']=function(_0x53e303){try{if(this[_0xf048('0x63')](_0x53e303)){logger[_0xf048('0x46')](_0xf048('0x7e'),_0x53e303[_0xf048('0x49')],util['inspect'](_0x53e303,{'showHidden':![],'depth':null}));if(this[_0xf048('0x3c')][_0x53e303[_0xf048('0x49')]]){var _0x3bc176=_[_0xf048('0x7f')](this[_0xf048('0x3c')][_0x53e303['uniqueid']]);_0x3bc176['queuecallercomplete']=![];_0x3bc176[_0xf048('0x80')]=null;_0x3bc176['holdtime']=_0x53e303[_0xf048('0x81')];_0x3bc176['originalposition']=_0x53e303[_0xf048('0x82')];_0x3bc176['queuecallerabandon']=!![];_0x3bc176[_0xf048('0x83')]=moment()[_0xf048('0x4b')](_0xf048('0x84'));_0x3bc176[_0xf048('0x85')]=_0xf048('0x86');_0x3bc176[_0xf048('0x87')]=null;logger['info'](_0xf048('0x88'),_0x3bc176[_0xf048('0x4d')],_0x3bc176['type']);this[_0xf048('0xe')][_0x53e303['uniqueid']]=_0x3bc176;this[_0xf048('0x43')](_0x3bc176,_0xf048('0x89'));}}}catch(_0x10c8c7){logger[_0xf048('0x3b')](_0xf048('0x7e'),_0x53e303['uniqueid'],util[_0xf048('0x3e')](_0x10c8c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf048('0x32')][_0xf048('0x1a')]=function(_0x15cfa2){try{if(this['isNotNull'](_0x15cfa2)){logger['debug'](_0xf048('0x8a'),_0x15cfa2['uniqueid'],util[_0xf048('0x3e')](_0x15cfa2,{'showHidden':![],'depth':null}));if(this[_0xf048('0x3c')][_0x15cfa2[_0xf048('0x49')]]){var _0x5216f8=_['last'](this[_0xf048('0x3c')][_0x15cfa2[_0xf048('0x49')]]);_0x5216f8[_0xf048('0x8b')]=moment()[_0xf048('0x4b')](_0xf048('0x84'));_0x5216f8[_0xf048('0x8c')]=_0x15cfa2[_0xf048('0x8c')];_0x5216f8[_0xf048('0x8d')]=_0x15cfa2['connectedlinename'];logger[_0xf048('0x67')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5216f8['name'],_0x5216f8[_0xf048('0x74')],_0x15cfa2['connectedlinenum'],_0x15cfa2[_0xf048('0x8d')]);this['channels'][_0x15cfa2[_0xf048('0x49')]]=_0x5216f8;this[_0xf048('0x45')](_0x5216f8,_0xf048('0x19'));}}}catch(_0x15cec0){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x15cfa2[_0xf048('0x49')],util[_0xf048('0x3e')](_0x15cec0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf048('0x32')]['syncAgentConnect']=function(_0x114e1b){try{if(this[_0xf048('0x63')](_0x114e1b)){logger[_0xf048('0x46')]('[%s][voiceQueueReport][agentconnect]',_0x114e1b['uniqueid'],util[_0xf048('0x3e')](_0x114e1b,{'showHidden':![],'depth':null}));if(this[_0xf048('0x3c')][_0x114e1b[_0xf048('0x49')]]){var _0x426a4e=_[_0xf048('0x7f')](this[_0xf048('0x3c')][_0x114e1b['uniqueid']]);_0x426a4e[_0xf048('0x8e')]=!![];_0x426a4e[_0xf048('0x85')]=_0xf048('0x8f');logger[_0xf048('0x67')](_0xf048('0x90'),_0x426a4e[_0xf048('0x4d')],_0x426a4e['type']);}}}catch(_0x371c71){logger[_0xf048('0x3b')](_0xf048('0x91'),_0x114e1b['uniqueid'],util[_0xf048('0x3e')](_0x371c71,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf048('0x32')][_0xf048('0x1c')]=function(_0x50339d){try{if(this[_0xf048('0x63')](_0x50339d)){logger[_0xf048('0x46')](_0xf048('0x92'),_0x50339d[_0xf048('0x49')],util['inspect'](_0x50339d,{'showHidden':![],'depth':null}));if(this[_0xf048('0x3c')][_0x50339d[_0xf048('0x49')]]){var _0x3f839f=_['last'](this[_0xf048('0x3c')][_0x50339d[_0xf048('0x49')]]);_0x3f839f[_0xf048('0x89')]=![];_0x3f839f[_0xf048('0x83')]=null;_0x3f839f[_0xf048('0x93')]=!![];_0x3f839f['lastAssignedTo']=_0x50339d[_0xf048('0x94')];_0x3f839f[_0xf048('0x81')]=_0x50339d['holdtime'];_0x3f839f[_0xf048('0x8e')]=!![];_0x3f839f[_0xf048('0x95')]=![];_0x3f839f[_0xf048('0x96')]=null;if(!_0x3f839f['transfer']){if(_0x50339d[_0xf048('0x97')]==_0xf048('0x98')){_0x3f839f[_0xf048('0x85')]=_0xf048('0x99');logger[_0xf048('0x67')](_0xf048('0x9a'),_0x3f839f[_0xf048('0x4d')],_0x3f839f[_0xf048('0x74')]);}else{if(_['startsWith'](_0x50339d['channel']['toLowerCase'](),_0xf048('0x9b'))){if(this[_0xf048('0x3c')][_0x50339d['linkedid']]){var _0x5d55b9=_[_0xf048('0x7f')](this[_0xf048('0x3c')][_0x50339d['linkedid']]);_0x5d55b9[_0xf048('0x8e')]=![];_0x5d55b9[_0xf048('0x95')]=!![];_0x5d55b9[_0xf048('0x96')]=moment(_0x3f839f[_0xf048('0x75')])[_0xf048('0x9c')](_0x50339d[_0xf048('0x81')],'seconds')[_0xf048('0x4b')](_0xf048('0x84'));_0x5d55b9[_0xf048('0x85')]=_0xf048('0x9d');_0x5d55b9[_0xf048('0x98')]=!![];_0x5d55b9[_0xf048('0x9e')]=_0xf048('0x9f');_0x5d55b9[_0xf048('0xa0')]=_0x50339d[_0xf048('0xa1')];_0x5d55b9[_0xf048('0xa2')]=_0x50339d['uniqueid'];logger[_0xf048('0x67')](_0xf048('0xa3'),_0x5d55b9['name'],_0x5d55b9[_0xf048('0x74')]);var _0x453e9a=this[_0xf048('0x3c')][_0x50339d['linkedid']];this[_0xf048('0x3c')][_0x50339d[_0xf048('0xa4')]]=this[_0xf048('0x3c')][_0x50339d['uniqueid']];this[_0xf048('0x3c')][_0x50339d[_0xf048('0x49')]]=_0x453e9a;}}else{_0x3f839f[_0xf048('0x85')]=_0xf048('0xa5')+_0x50339d[_0xf048('0x97')][_0xf048('0xa6')]();logger[_0xf048('0x67')](_0xf048('0xa7'),_0x3f839f[_0xf048('0x4d')],_0x3f839f['type'],_0x3f839f['queuecallerexitreason']);}}}this[_0xf048('0xe')][_0x50339d[_0xf048('0x49')]]=_0x3f839f;this[_0xf048('0x43')](_0x3f839f,_0xf048('0x1b'));}}}catch(_0x354612){logger[_0xf048('0x3b')](_0xf048('0x92'),_0x50339d[_0xf048('0x49')],util['inspect'](_0x354612,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf048('0x32')][_0xf048('0xa8')]=function(_0x8e7266){try{if(this[_0xf048('0x63')](_0x8e7266)){logger[_0xf048('0x46')](_0xf048('0xa9'),_0x8e7266['uniqueid'],util[_0xf048('0x3e')](_0x8e7266,{'showHidden':![],'depth':null}));this[_0xf048('0xaa')](_0x8e7266['uniqueid'],_['keys'](_0x8e7266[_0xf048('0xab')])[0x0],_0x8e7266['value']);if(this['queueReports'][_0x8e7266[_0xf048('0x49')]]){var _0x2145b7=_[_0xf048('0x7f')](this[_0xf048('0x3c')][_0x8e7266[_0xf048('0x49')]]);if(_0x2145b7){if(this['isNotNull'](_0x8e7266['variable'])&&this[_0xf048('0x63')](_0x8e7266[_0xf048('0xab')][_0xf048('0xac')])){switch(_0x8e7266[_0xf048('0xad')]){case _0xf048('0xae'):_0x2145b7[_0xf048('0x95')]=![];_0x2145b7[_0xf048('0x96')]=null;break;case _0xf048('0xaf'):_0x2145b7[_0xf048('0xb0')]=_0xf048('0xb1');_0x2145b7[_0xf048('0x95')]=!![];_0x2145b7[_0xf048('0x96')]=moment()[_0xf048('0x4b')](_0xf048('0x84'));_0x2145b7[_0xf048('0x8b')]=moment()[_0xf048('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xf048('0x46')](_0xf048('0xb2'),_0x8e7266[_0xf048('0x49')],util[_0xf048('0x3e')](_0x2145b7,{'showHidden':![],'depth':null}));ami[_0xf048('0x4a')](_0xf048('0xb3'),_0x2145b7);break;default:_0x2145b7[_0xf048('0x95')]=!![];_0x2145b7[_0xf048('0x96')]=moment()[_0xf048('0x4b')](_0xf048('0x84'));_0x2145b7[_0xf048('0x8b')]=moment()[_0xf048('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2145b7[_0xf048('0x89')]=![];_0x2145b7[_0xf048('0x83')]=null;_0x2145b7[_0xf048('0x85')]=_0x8e7266[_0xf048('0xad')];this[_0xf048('0xe')][_0x8e7266[_0xf048('0x49')]]=_0x2145b7;this[_0xf048('0x43')](_0x2145b7,_0xf048('0x1e'));}else if(this[_0xf048('0x63')](_0x8e7266['variable'])&&this['isNotNull'](_0x8e7266[_0xf048('0xab')][_0xf048('0xb4')])){if(!_0x2145b7['queuecallerabandon']){_0x2145b7[_0xf048('0x95')]=!![];_0x2145b7[_0xf048('0x96')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2145b7[_0xf048('0x85')]=_0xf048('0xb5');_0x2145b7[_0xf048('0x8b')]=moment()[_0xf048('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf048('0xe')][_0x8e7266[_0xf048('0x49')]]=_0x2145b7;}}logger['info'](_0xf048('0xb6'),_0x8e7266[_0xf048('0x49')],_0x2145b7[_0xf048('0x4d')],_0x2145b7['type'],_['keys'](_0x8e7266[_0xf048('0xab')])[0x0],_0x8e7266[_0xf048('0xad')]);_0x2145b7[_0xf048('0x3f')]=this['variables'][_0x8e7266[_0xf048('0x49')]];}}}}catch(_0x3d5dae){logger[_0xf048('0x3b')](_0xf048('0xa9'),_0x8e7266[_0xf048('0x49')],util['inspect'](_0x3d5dae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf048('0x32')]['addVariable']=function(_0x142786,_0x528ca6,_0x57a3b1){var _0x11c322=[_0xf048('0xb7'),_0xf048('0xb8'),_0xf048('0xb9'),_0xf048('0xba'),_0xf048('0xbb'),_0xf048('0xbc'),_0xf048('0xbd'),_0xf048('0xbe'),_0xf048('0xbf'),_0xf048('0xc0'),_0xf048('0xc1'),_0xf048('0xc2'),_0xf048('0xc3'),_0xf048('0xc4'),_0xf048('0xc5'),_0xf048('0xc6'),_0xf048('0x94'),_0xf048('0xc7'),'memberrealtime'];if(!_['isNil'](_0x528ca6)&&!_[_0xf048('0xc8')](_0x11c322,_0x528ca6)){if(_[_0xf048('0x64')](this[_0xf048('0x3f')][_0x142786])){this[_0xf048('0x3f')][_0x142786]={};}this['variables'][_0x142786][_0x528ca6]=_0x57a3b1;}};VoiceQueueReport[_0xf048('0x32')]['handleHangup']=function(_0x105684,_0x1d92b0,_0x57902f){var _0x21a1d0={};for(var _0x123cd7=0x0;_0x123cd70x0?_0x55bf1a:0x0;this['voiceQueues'][_0xd7a50b[_0x5859('0x62')]]['talking']=this[_0x5859('0xd')][_0xd7a50b[_0x5859('0x62')]][_0x5859('0x2b')]>_['toNumber'](_0xd7a50b[_0x5859('0x67')])?_[_0x5859('0x66')](_0xd7a50b[_0x5859('0x67')]):this[_0x5859('0xd')][_0xd7a50b[_0x5859('0x62')]]['talking'];this['emitVoiceQueueSummary'](this[_0x5859('0xd')][_0xd7a50b[_0x5859('0x62')]],'queuesummary');}logger['debug'](_0x5859('0x68'),util[_0x5859('0x3d')](this['voiceQueues'][_0xd7a50b['queue']],{'showHidden':![],'depth':null}));ami[_0x5859('0x41')](_0x5859('0x69'),this[_0x5859('0xd')][_0xd7a50b[_0x5859('0x62')]]);}}}catch(_0x42f172){logger['error'](_0x5859('0x6a'),util[_0x5859('0x3d')](_0x42f172,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5859('0x30')][_0x5859('0x12')]=function(_0x49e295){logger[_0x5859('0x48')](_0x5859('0x6b'),util[_0x5859('0x3d')](_0x49e295,{'showHidden':![],'depth':null}));ami[_0x5859('0x41')]('custom:queuesummarycomplete',{});this[_0x5859('0x60')]=!![];};VoiceQueueReport[_0x5859('0x30')]['syncQueueCallerJoin']=function(_0x13355c){try{if(this[_0x5859('0x5c')](_0x13355c)){logger[_0x5859('0x48')](_0x5859('0x6c'),_0x13355c[_0x5859('0x43')],util[_0x5859('0x3d')](_0x13355c,{'showHidden':![],'depth':null}));if(_[_0x5859('0x5d')](this[_0x5859('0xa')][_0x13355c[_0x5859('0x43')]]))this[_0x5859('0xa')][_0x13355c[_0x5859('0x43')]]=[];if(_[_0x5859('0x5d')](this[_0x5859('0xc')][_0x13355c[_0x5859('0x43')]]))this['channels'][_0x13355c['uniqueid']]={};var _0x255bbf=new QueueReport();_0x255bbf[_0x5859('0x4b')]=_0x13355c[_0x5859('0x62')];_0x255bbf[_0x5859('0x4e')]=this[_0x5859('0xd')][_0x255bbf[_0x5859('0x4b')]]&&this['voiceQueues'][_0x255bbf[_0x5859('0x4b')]][_0x5859('0x4e')]?this[_0x5859('0xd')][_0x255bbf[_0x5859('0x4b')]]['type']||_0x5859('0x6d'):_0x5859('0x6d');_0x255bbf[_0x5859('0x62')]=_0x13355c[_0x5859('0x62')];_0x255bbf[_0x5859('0x6e')]=moment()[_0x5859('0x44')](_0x5859('0x6f'));_0x255bbf[_0x5859('0x70')]=_0x13355c[_0x5859('0x70')];_0x255bbf[_0x5859('0x71')]=_0x13355c['count'];_0x255bbf[_0x5859('0x43')]=_0x13355c[_0x5859('0x43')];_0x255bbf[_0x5859('0x72')]=this['channels'][_0x13355c[_0x5859('0x43')]][_0x5859('0x72')];logger[_0x5859('0x63')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x255bbf[_0x5859('0x4b')],_0x255bbf[_0x5859('0x4e')]);_['merge'](_0x255bbf,_[_0x5859('0x73')](_0x13355c,_[_0x5859('0x74')](_0x255bbf)));this['queueReports'][_0x13355c['uniqueid']][_0x5859('0x75')](_0x255bbf);this[_0x5859('0xc')][_0x13355c[_0x5859('0x43')]]=_0x255bbf;this[_0x5859('0x42')](_0x255bbf,'queuecallerjoin');}}catch(_0x11d485){logger[_0x5859('0x3b')]('[%s][voiceQueueReport][queuecallerjoin]',_0x13355c[_0x5859('0x43')],util[_0x5859('0x3d')](_0x11d485,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5859('0x30')][_0x5859('0x16')]=function(_0xbe2013){try{if(this[_0x5859('0x5c')](_0xbe2013)){logger['debug'](_0x5859('0x76'),_0xbe2013[_0x5859('0x43')],util[_0x5859('0x3d')](_0xbe2013,{'showHidden':![],'depth':null}));if(this[_0x5859('0xa')][_0xbe2013[_0x5859('0x43')]]){var _0x2d2494=_[_0x5859('0x77')](this['queueReports'][_0xbe2013[_0x5859('0x43')]]);_0x2d2494[_0x5859('0x78')]=![];_0x2d2494['queuecallercompleteAt']=null;_0x2d2494[_0x5859('0x79')]=_0xbe2013[_0x5859('0x79')];_0x2d2494[_0x5859('0x7a')]=_0xbe2013[_0x5859('0x7a')];_0x2d2494[_0x5859('0x15')]=!![];_0x2d2494['queuecallerabandonAt']=moment()['format'](_0x5859('0x6f'));_0x2d2494[_0x5859('0x49')]='ABANDONED';_0x2d2494['lastAssignedTo']=null;logger[_0x5859('0x63')](_0x5859('0x7b'),_0x2d2494[_0x5859('0x4b')],_0x2d2494[_0x5859('0x4e')]);this[_0x5859('0xc')][_0xbe2013[_0x5859('0x43')]]=_0x2d2494;this[_0x5859('0x47')](_0x2d2494,_0x5859('0x15'));}}}catch(_0x2396aa){logger[_0x5859('0x3b')]('[%s][voiceQueueReport][queuecallerabandon]',_0xbe2013[_0x5859('0x43')],util[_0x5859('0x3d')](_0x2396aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5859('0x30')][_0x5859('0x18')]=function(_0x19d07d){try{if(this['isNotNull'](_0x19d07d)){logger[_0x5859('0x48')](_0x5859('0x7c'),_0x19d07d['uniqueid'],util[_0x5859('0x3d')](_0x19d07d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x19d07d[_0x5859('0x43')]]){var _0x1dbd63=_[_0x5859('0x77')](this[_0x5859('0xa')][_0x19d07d[_0x5859('0x43')]]);_0x1dbd63[_0x5859('0x7d')]=moment()[_0x5859('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x1dbd63[_0x5859('0x7e')]=_0x19d07d[_0x5859('0x7e')];_0x1dbd63['connectedlinename']=_0x19d07d['connectedlinename'];logger['info'](_0x5859('0x7f'),_0x1dbd63[_0x5859('0x4b')],_0x1dbd63[_0x5859('0x4e')],_0x19d07d[_0x5859('0x7e')],_0x19d07d['connectedlinename']);this[_0x5859('0xc')][_0x19d07d['uniqueid']]=_0x1dbd63;this['emitVoiceQueueChannelSave'](_0x1dbd63,_0x5859('0x17'));}}}catch(_0x31d2b0){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x19d07d[_0x5859('0x43')],util[_0x5859('0x3d')](_0x31d2b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5859('0x1b')]=function(_0x5c0b48){try{if(this[_0x5859('0x5c')](_0x5c0b48)){logger[_0x5859('0x48')](_0x5859('0x80'),_0x5c0b48[_0x5859('0x43')],util[_0x5859('0x3d')](_0x5c0b48,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5c0b48[_0x5859('0x43')]]){var _0x5f2dc3=_[_0x5859('0x77')](this[_0x5859('0xa')][_0x5c0b48[_0x5859('0x43')]]);_0x5f2dc3['queuecallercomplete']=!![];_0x5f2dc3['queuecallerexitreason']='COMPLETEDBYAGENT';logger['info'](_0x5859('0x81'),_0x5f2dc3[_0x5859('0x4b')],_0x5f2dc3[_0x5859('0x4e')]);}}}catch(_0x4c3d2f){logger[_0x5859('0x3b')]('[%s][voiceQueueReport][agentconnect]',_0x5c0b48[_0x5859('0x43')],util[_0x5859('0x3d')](_0x4c3d2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5859('0x30')][_0x5859('0x1a')]=function(_0x4d8407){try{if(this[_0x5859('0x5c')](_0x4d8407)){logger['debug'](_0x5859('0x82'),_0x4d8407[_0x5859('0x43')],util[_0x5859('0x3d')](_0x4d8407,{'showHidden':![],'depth':null}));if(this[_0x5859('0xa')][_0x4d8407['uniqueid']]){var _0x22e6bd=_[_0x5859('0x77')](this[_0x5859('0xa')][_0x4d8407[_0x5859('0x43')]]);_0x22e6bd[_0x5859('0x15')]=![];_0x22e6bd[_0x5859('0x83')]=null;_0x22e6bd[_0x5859('0x84')]=!![];_0x22e6bd[_0x5859('0x85')]=_0x4d8407[_0x5859('0x86')];_0x22e6bd[_0x5859('0x79')]=_0x4d8407[_0x5859('0x79')];_0x22e6bd[_0x5859('0x78')]=!![];_0x22e6bd[_0x5859('0x87')]=![];_0x22e6bd['queuecallerexitAt']=null;if(!_0x22e6bd['transfer']){if(_0x4d8407[_0x5859('0x88')]==_0x5859('0x89')){_0x22e6bd[_0x5859('0x49')]=_0x5859('0x8a');logger[_0x5859('0x63')](_0x5859('0x8b'),_0x22e6bd[_0x5859('0x4b')],_0x22e6bd[_0x5859('0x4e')]);}else{if(_[_0x5859('0x8c')](_0x4d8407['channel'][_0x5859('0x8d')](),'local/')){if(this['queueReports'][_0x4d8407['linkedid']]){var _0x5c5608=_[_0x5859('0x77')](this['queueReports'][_0x4d8407[_0x5859('0x8e')]]);_0x5c5608[_0x5859('0x78')]=![];_0x5c5608[_0x5859('0x87')]=!![];_0x5c5608[_0x5859('0x8f')]=moment(_0x22e6bd['queuecallerjoinAt'])[_0x5859('0x90')](_0x4d8407[_0x5859('0x79')],_0x5859('0x91'))['format'](_0x5859('0x6f'));_0x5c5608['queuecallerexitreason']='FORWARDTRANSFER';_0x5c5608['transfer']=!![];_0x5c5608['transfertype']='FORWARD';_0x5c5608[_0x5859('0x92')]=_0x4d8407[_0x5859('0x93')];_0x5c5608[_0x5859('0x94')]=_0x4d8407['uniqueid'];logger['info'](_0x5859('0x95'),_0x5c5608[_0x5859('0x4b')],_0x5c5608['type']);var _0x1a3478=this[_0x5859('0xa')][_0x4d8407[_0x5859('0x8e')]];this[_0x5859('0xa')][_0x4d8407[_0x5859('0x8e')]]=this[_0x5859('0xa')][_0x4d8407['uniqueid']];this[_0x5859('0xa')][_0x4d8407[_0x5859('0x43')]]=_0x1a3478;}}else{_0x22e6bd[_0x5859('0x49')]=_0x5859('0x96')+_0x4d8407[_0x5859('0x88')][_0x5859('0x97')]();logger[_0x5859('0x63')](_0x5859('0x98'),_0x22e6bd[_0x5859('0x4b')],_0x22e6bd[_0x5859('0x4e')],_0x22e6bd[_0x5859('0x49')]);}}}this[_0x5859('0xc')][_0x4d8407['uniqueid']]=_0x22e6bd;this[_0x5859('0x47')](_0x22e6bd,_0x5859('0x19'));}}}catch(_0x383843){logger[_0x5859('0x3b')](_0x5859('0x82'),_0x4d8407[_0x5859('0x43')],util['inspect'](_0x383843,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5859('0x1d')]=function(_0x214fd9){try{if(this[_0x5859('0x5c')](_0x214fd9)){logger[_0x5859('0x48')](_0x5859('0x99'),_0x214fd9[_0x5859('0x43')],util[_0x5859('0x3d')](_0x214fd9,{'showHidden':![],'depth':null}));this['addVariable'](_0x214fd9[_0x5859('0x43')],_[_0x5859('0x74')](_0x214fd9[_0x5859('0x9a')])[0x0],_0x214fd9[_0x5859('0x9b')]);if(this[_0x5859('0xa')][_0x214fd9['uniqueid']]){var _0x237b42=_[_0x5859('0x77')](this[_0x5859('0xa')][_0x214fd9[_0x5859('0x43')]]);if(_0x237b42){if(this[_0x5859('0x5c')](_0x214fd9['variable'])&&this[_0x5859('0x5c')](_0x214fd9[_0x5859('0x9a')][_0x5859('0x9c')])){switch(_0x214fd9[_0x5859('0x9b')]){case'CONTINUE':_0x237b42[_0x5859('0x87')]=![];_0x237b42[_0x5859('0x8f')]=null;break;case'TIMEOUT':_0x237b42['lastevent']=_0x5859('0x9d');_0x237b42[_0x5859('0x87')]=!![];_0x237b42[_0x5859('0x8f')]=moment()[_0x5859('0x44')](_0x5859('0x6f'));_0x237b42[_0x5859('0x7d')]=moment()[_0x5859('0x44')](_0x5859('0x6f'));logger[_0x5859('0x48')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x214fd9[_0x5859('0x43')],util[_0x5859('0x3d')](_0x237b42,{'showHidden':![],'depth':null}));ami[_0x5859('0x41')]('custom:timeout',_0x237b42);break;default:_0x237b42[_0x5859('0x87')]=!![];_0x237b42[_0x5859('0x8f')]=moment()[_0x5859('0x44')](_0x5859('0x6f'));_0x237b42[_0x5859('0x7d')]=moment()[_0x5859('0x44')](_0x5859('0x6f'));}_0x237b42[_0x5859('0x15')]=![];_0x237b42[_0x5859('0x83')]=null;_0x237b42[_0x5859('0x49')]=_0x214fd9[_0x5859('0x9b')];this['channels'][_0x214fd9['uniqueid']]=_0x237b42;this['emitVoiceQueueChannelRemove'](_0x237b42,_0x5859('0x1c'));}else if(this[_0x5859('0x5c')](_0x214fd9[_0x5859('0x9a')])&&this[_0x5859('0x5c')](_0x214fd9[_0x5859('0x9a')][_0x5859('0x9e')])){if(!_0x237b42[_0x5859('0x15')]){_0x237b42[_0x5859('0x87')]=!![];_0x237b42['queuecallerexitAt']=moment()[_0x5859('0x44')](_0x5859('0x6f'));_0x237b42[_0x5859('0x49')]=_0x5859('0x9f');_0x237b42[_0x5859('0x7d')]=moment()[_0x5859('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5859('0xc')][_0x214fd9['uniqueid']]=_0x237b42;}}logger[_0x5859('0x63')](_0x5859('0xa0'),_0x214fd9[_0x5859('0x43')],_0x237b42['name'],_0x237b42[_0x5859('0x4e')],_[_0x5859('0x74')](_0x214fd9[_0x5859('0x9a')])[0x0],_0x214fd9[_0x5859('0x9b')]);_0x237b42[_0x5859('0xf')]=this[_0x5859('0xf')][_0x214fd9['uniqueid']];}}}}catch(_0x567aab){logger[_0x5859('0x3b')]('[%s][voiceQueueReport][varset]',_0x214fd9['uniqueid'],util[_0x5859('0x3d')](_0x567aab,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5859('0xa1')]=function(_0x371db4,_0x1e81e1,_0x20fe4b){var _0x23171b=[_0x5859('0xa2'),_0x5859('0xa3'),_0x5859('0xa4'),_0x5859('0xa5'),_0x5859('0xa6'),_0x5859('0xa7'),_0x5859('0xa8'),_0x5859('0xa9'),'sipcallid','sipuri',_0x5859('0xaa'),_0x5859('0xab'),_0x5859('0xac'),_0x5859('0xad'),_0x5859('0xae'),_0x5859('0xaf'),_0x5859('0x86'),_0x5859('0xb0'),'memberrealtime'];if(!_[_0x5859('0x34')](_0x1e81e1)&&!_[_0x5859('0xb1')](_0x23171b,_0x1e81e1)){if(_['isUndefined'](this[_0x5859('0xf')][_0x371db4])){this[_0x5859('0xf')][_0x371db4]={};}this['variables'][_0x371db4][_0x1e81e1]=_0x20fe4b;}};VoiceQueueReport['prototype'][_0x5859('0xb2')]=function(_0x4718f8,_0x4d6297,_0x143656){var _0x610a2e={};for(var _0x17b7c3=0x0;_0x17b7c3=0x0?moment(_0xbb3f20[_0x5a8c('0x18')])['diff'](_0xbb3f20[_0x5a8c('0x17')],'seconds'):null,'data1':_0x5a8c('0x19'),'data2':_0xbb3f20['accountcode'],'data3':_0xbb3f20[_0x5a8c('0x1a')],'data4':_0xbb3f20[_0x5a8c('0x1b')]||null,'role':'agent','internal':_0xbb3f20['accountcode']?_['toNumber'](_0xbb3f20[_0x5a8c('0x13')]):undefined,'uniqueid':_0xbb3f20['uniqueid']},'log':_0x5a8c('0x7')});}; \ No newline at end of file +var _0xf921=['queuecallerexitAt','CreateMemberReport','voice','interface','format','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','accountcode','toNumber','voiceDialReport','Request','membername','starttime','endtime','outbound','dialstring','agent','uniqueid','moment','lodash','../client','voiceQueueReport'];(function(_0x1e6530,_0x4bee5d){var _0x1a5497=function(_0x4013fc){while(--_0x4013fc){_0x1e6530['push'](_0x1e6530['shift']());}};_0x1a5497(++_0x4bee5d);}(_0xf921,0xe4));var _0x1f92=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0xf921[_0x4bd67a];return _0x2be5fb;};'use strict';var moment=require(_0x1f92('0x0'));var _=require(_0x1f92('0x1'));var util=require('util');var client=require(_0x1f92('0x2'));exports[_0x1f92('0x3')]=function(_0x392b3e){var _0x1b58c2=_0x392b3e['queuecallercompleteAt']||_0x392b3e[_0x1f92('0x4')];return client['Request'](_0x1f92('0x5'),{'body':{'channel':_0x1f92('0x6'),'membername':_0x392b3e['lastAssignedTo'],'interface':_['isNil'](_0x392b3e[_0x1f92('0x7')])?util[_0x1f92('0x8')](_0x1f92('0x9'),_0x392b3e[_0x1f92('0xa')]):_0x392b3e[_0x1f92('0x7')],'type':_0x1f92('0xb'),'enterAt':_0x392b3e[_0x1f92('0xc')],'exitAt':_0x1b58c2,'duration':moment(_0x1b58c2)[_0x1f92('0xd')](_0x392b3e[_0x1f92('0xc')],_0x1f92('0xe')),'data1':_0x1f92('0xf'),'data2':_0x392b3e['calleridnum'],'data3':_0x392b3e[_0x1f92('0x10')],'data4':null,'data5':_0x392b3e[_0x1f92('0x11')],'role':'agent','internal':_0x392b3e[_0x1f92('0x12')]?_[_0x1f92('0x13')](_0x392b3e['accountcode']):undefined,'uniqueid':_0x392b3e['uniqueid']},'log':_0x1f92('0x5')});};exports[_0x1f92('0x14')]=function(_0x10a8dd){return client[_0x1f92('0x15')](_0x1f92('0x5'),{'body':{'channel':_0x1f92('0x6'),'membername':_0x10a8dd[_0x1f92('0x16')],'interface':_0x10a8dd[_0x1f92('0x7')],'type':_0x1f92('0xb'),'enterAt':_0x10a8dd[_0x1f92('0x17')],'exitAt':_0x10a8dd['endtime'],'duration':moment(_0x10a8dd['endtime'])[_0x1f92('0xd')](_0x10a8dd['starttime'],_0x1f92('0xe'))>=0x0?moment(_0x10a8dd[_0x1f92('0x18')])[_0x1f92('0xd')](_0x10a8dd[_0x1f92('0x17')],_0x1f92('0xe')):null,'data1':_0x1f92('0x19'),'data2':_0x10a8dd[_0x1f92('0x12')],'data3':_0x10a8dd[_0x1f92('0x10')],'data4':_0x10a8dd[_0x1f92('0x1a')]||null,'role':_0x1f92('0x1b'),'internal':_0x10a8dd[_0x1f92('0x12')]?_['toNumber'](_0x10a8dd[_0x1f92('0x12')]):undefined,'uniqueid':_0x10a8dd[_0x1f92('0x1c')]},'log':_0x1f92('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 93b660f..79baf2e 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 _0xa095=['getSettings','ShowSetting','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x18b389,_0x1891cf){var _0x4a8f44=function(_0x346efe){while(--_0x346efe){_0x18b389['push'](_0x18b389['shift']());}};_0x4a8f44(++_0x1891cf);}(_0xa095,0x7c));var _0x5a09=function(_0x5e2b34,_0x58385c){_0x5e2b34=_0x5e2b34-0x0;var _0x4859f9=_0xa095[_0x5e2b34];return _0x4859f9;};'use strict';var client=require(_0x5a09('0x0'));exports[_0x5a09('0x1')]=function(){return client['Request'](_0x5a09('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x5a09('0x3')]},'log':_0x5a09('0x4')});}; \ No newline at end of file +var _0x6f75=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x6f75,0x71));var _0x56f7=function(_0x2364c0,_0x19cac6){_0x2364c0=_0x2364c0-0x0;var _0xa0313e=_0x6f75[_0x2364c0];return _0xa0313e;};'use strict';var client=require(_0x56f7('0x0'));exports[_0x56f7('0x1')]=function(){return client[_0x56f7('0x2')](_0x56f7('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x56f7('0x4'),_0x56f7('0x5')]},'log':_0x56f7('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 28bd99a..b02dd96 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 _0x7306=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x145ca6,_0x4d7f49){var _0x13cd77=function(_0x47870b){while(--_0x47870b){_0x145ca6['push'](_0x145ca6['shift']());}};_0x13cd77(++_0x4d7f49);}(_0x7306,0xb7));var _0x6730=function(_0x29ea60,_0x408231){_0x29ea60=_0x29ea60-0x0;var _0x57edc8=_0x7306[_0x29ea60];return _0x57edc8;};'use strict';var client=require(_0x6730('0x0'));exports[_0x6730('0x1')]=function(_0x3d6279){return function(_0x1c5abd){return client[_0x6730('0x2')](_0x6730('0x3'),{'options':{'raw':!![],'attributes':['id',_0x6730('0x4'),_0x6730('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xe4bb=['../client','getTemplates','GetTemplate','name'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0xe4bb,0x154));var _0xbe4b=function(_0x297bb7,_0x48f5b3){_0x297bb7=_0x297bb7-0x0;var _0x27b854=_0xe4bb[_0x297bb7];return _0x27b854;};'use strict';var client=require(_0xbe4b('0x0'));exports[_0xbe4b('0x1')]=function(_0x98235d){return function(_0x5ddfb0){return client['Request'](_0xbe4b('0x2'),{'options':{'raw':!![],'attributes':['id',_0xbe4b('0x3'),'html']},'log':_0xbe4b('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ad20734..3d9f3e4 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 _0x6ba6=['AnyConditions','Action','Actions','data1','data4','data5','data7','../client','getTriggers','Request','GetTrigger','channel','status','AllConditions','field','operator','value','Condition'];(function(_0x209ed8,_0x1c1526){var _0x400176=function(_0x4ae8cc){while(--_0x4ae8cc){_0x209ed8['push'](_0x209ed8['shift']());}};_0x400176(++_0x1c1526);}(_0x6ba6,0x73));var _0x66ba=function(_0x4bec30,_0x4badc0){_0x4bec30=_0x4bec30-0x0;var _0x12586c=_0x6ba6[_0x4bec30];return _0x12586c;};'use strict';var client=require(_0x66ba('0x0'));exports[_0x66ba('0x1')]=function(_0x4b3127){return function(_0x57b217){return client[_0x66ba('0x2')](_0x66ba('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x66ba('0x4'),_0x66ba('0x5')],'include':[{'model':'Condition','as':_0x66ba('0x6'),'attributes':['id',_0x66ba('0x7'),_0x66ba('0x8'),_0x66ba('0x9')]},{'model':_0x66ba('0xa'),'as':_0x66ba('0xb'),'attributes':['id',_0x66ba('0x7'),'operator',_0x66ba('0x9')]},{'model':_0x66ba('0xc'),'as':_0x66ba('0xd'),'attributes':['id','action',_0x66ba('0xe'),'data2','data3',_0x66ba('0xf'),_0x66ba('0x10'),'data6',_0x66ba('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xabeb=['Condition','value','Actions','action','data2','data3','data4','data6','../client','Request','GetTrigger','channel','AllConditions','field','operator'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0xabeb,0xad));var _0xbabe=function(_0x15fab0,_0x416c7d){_0x15fab0=_0x15fab0-0x0;var _0x1b41a8=_0xabeb[_0x15fab0];return _0x1b41a8;};'use strict';var client=require(_0xbabe('0x0'));exports['getTriggers']=function(_0x19c0a0){return function(_0x4658b5){return client[_0xbabe('0x1')](_0xbabe('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xbabe('0x3'),'status'],'include':[{'model':'Condition','as':_0xbabe('0x4'),'attributes':['id',_0xbabe('0x5'),_0xbabe('0x6'),'value']},{'model':_0xbabe('0x7'),'as':'AnyConditions','attributes':['id',_0xbabe('0x5'),_0xbabe('0x6'),_0xbabe('0x8')]},{'model':'Action','as':_0xbabe('0x9'),'attributes':['id',_0xbabe('0xa'),'data1',_0xbabe('0xb'),_0xbabe('0xc'),_0xbabe('0xd'),'data5',_0xbabe('0xe'),'data7']}]},'log':_0xbabe('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index ca40aa9..929a7c5 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 _0x83da=['registry','../client','GetTrunk'];(function(_0x14b4c1,_0x587f60){var _0x40c266=function(_0x3e1602){while(--_0x3e1602){_0x14b4c1['push'](_0x14b4c1['shift']());}};_0x40c266(++_0x587f60);}(_0x83da,0xac));var _0xa83d=function(_0x43b39f,_0xde21c4){_0x43b39f=_0x43b39f-0x0;var _0x44cbc5=_0x83da[_0x43b39f];return _0x44cbc5;};'use strict';var client=require(_0xa83d('0x0'));exports['getTrunks']=function(_0x5155db){return function(_0x4f47ef){return client['Request'](_0xa83d('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xa83d('0x2'),'defaultuser']},'log':_0xa83d('0x1')});};}; \ No newline at end of file +var _0x7bb0=['Request','GetTrunk','defaultuser','getTrunks'];(function(_0x315fea,_0x3fad9d){var _0x1b9cfc=function(_0x4c0ddd){while(--_0x4c0ddd){_0x315fea['push'](_0x315fea['shift']());}};_0x1b9cfc(++_0x3fad9d);}(_0x7bb0,0xa7));var _0x07bb=function(_0x22fd2d,_0x4770d3){_0x22fd2d=_0x22fd2d-0x0;var _0x2f8078=_0x7bb0[_0x22fd2d];return _0x2f8078;};'use strict';var client=require('../client');exports[_0x07bb('0x0')]=function(_0x2dae77){return function(_0x32aebd){return client[_0x07bb('0x1')](_0x07bb('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x07bb('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index e9177fc..1f94430 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(_0x7a1b4f,_0x406a26){var _0x774956=function(_0x4129a8){while(--_0x4129a8){_0x7a1b4f['push'](_0x7a1b4f['shift']());}};_0x774956(++_0x406a26);}(_0x70e0,0x17b));var _0x070e=function(_0x267353,_0x57340e){_0x267353=_0x267353-0x0;var _0x1b415e=_0x70e0[_0x267353];return _0x1b415e;};'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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe706,0xa3));var _0x6e70=function(_0x2fc69b,_0x55537d){_0x2fc69b=_0x2fc69b-0x0;var _0x25e3c9=_0xe706[_0x2fc69b];return _0x25e3c9;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 94f1c84..4b0de60 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 _0xee09=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x2e36c4,_0x5182f8){var _0x7c0763=function(_0x436c6e){while(--_0x436c6e){_0x2e36c4['push'](_0x2e36c4['shift']());}};_0x7c0763(++_0x5182f8);}(_0xee09,0x1ae));var _0x9ee0=function(_0x1dd1ed,_0x24d915){_0x1dd1ed=_0x1dd1ed-0x0;var _0x574505=_0xee09[_0x1dd1ed];return _0x574505;};'use strict';var client=require('../client');exports[_0x9ee0('0x0')]=function(_0x2aa67b){return client['Request']('CreateVoiceAgentReport',{'body':_0x2aa67b,'log':_0x9ee0('0x1')});};exports[_0x9ee0('0x2')]=function(_0x58a91e,_0x28adff,_0x4b59bc){return client[_0x9ee0('0x3')](_0x9ee0('0x4'),{'body':_0x58a91e,'options':{'where':{'uniqueid':_0x28adff,'interface':_0x4b59bc,'agentcomplete':!![]}},'log':_0x9ee0('0x4')});}; \ No newline at end of file +var _0xa642=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa642,0x14e));var _0x2a64=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0xa642[_0x291d3f];return _0x242080;};'use strict';var client=require('../client');exports[_0x2a64('0x0')]=function(_0x2c9d09){return client[_0x2a64('0x1')](_0x2a64('0x2'),{'body':_0x2c9d09,'log':_0x2a64('0x2')});};exports[_0x2a64('0x3')]=function(_0x1a237c,_0x179204,_0x419fb7){return client[_0x2a64('0x1')](_0x2a64('0x4'),{'body':_0x1a237c,'options':{'where':{'uniqueid':_0x179204,'interface':_0x419fb7,'agentcomplete':!![]}},'log':_0x2a64('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 3653978..963e014 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 _0xb84a=['lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb84a,0xbb));var _0xab84=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb84a[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xab84('0x0'));var util=require(_0xab84('0x1'));var _=require(_0xab84('0x2'));var client=require(_0xab84('0x3'));exports[_0xab84('0x4')]=function(_0x20982a){return client[_0xab84('0x5')](_0xab84('0x6'),{'body':_[_0xab84('0x7')](_0x20982a,{'source':_0x20982a[_0xab84('0x8')],'destinationcontext':_0x20982a[_0xab84('0x9')],'callerid':_0x20982a[_0xab84('0xa')],'amaflags':'DOCUMENTATION'}),'log':_0xab84('0x6')});};exports[_0xab84('0xb')]=function(){return function(){return client['Request'](_0xab84('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xab84('0xd'))[_0xab84('0xe')](_0xab84('0xf')),moment()[_0xab84('0x10')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xab84('0x11'),_0xab84('0x12'),_0xab84('0x13'),'billableseconds']},'log':_0xab84('0x14')});};}; \ No newline at end of file +var _0x915b=['util','lodash','../client','create','CreateVoiceCallReport','merge','context','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x915b,0xf1));var _0xb915=function(_0x195105,_0x33daf3){_0x195105=_0x195105-0x0;var _0x31ff09=_0x915b[_0x195105];return _0x31ff09;};'use strict';var moment=require(_0xb915('0x0'));var util=require(_0xb915('0x1'));var _=require(_0xb915('0x2'));var client=require(_0xb915('0x3'));exports[_0xb915('0x4')]=function(_0x23ea49){return client['Request'](_0xb915('0x5'),{'body':_[_0xb915('0x6')](_0x23ea49,{'source':_0x23ea49['calleridnum'],'destinationcontext':_0x23ea49[_0xb915('0x7')],'callerid':_0x23ea49['callerid'],'amaflags':_0xb915('0x8')}),'log':_0xb915('0x5')});};exports[_0xb915('0x9')]=function(){return function(){return client[_0xb915('0xa')](_0xb915('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xb915('0xc')](_0xb915('0xd'))[_0xb915('0xe')](_0xb915('0xf')),moment()[_0xb915('0x10')]('day')[_0xb915('0xe')](_0xb915('0xf'))]}},'attributes':[_0xb915('0x11'),_0xb915('0x12'),_0xb915('0x13'),_0xb915('0x14')]},'log':_0xb915('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index bfe77ad..4b16c16 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 _0xe689=['../client','CreateVoiceDialReport'];(function(_0x32f90a,_0xbe4b5c){var _0x47c91e=function(_0x1c3e5f){while(--_0x1c3e5f){_0x32f90a['push'](_0x32f90a['shift']());}};_0x47c91e(++_0xbe4b5c);}(_0xe689,0x124));var _0x9e68=function(_0xe6ced5,_0x4a5d35){_0xe6ced5=_0xe6ced5-0x0;var _0x44b5c4=_0xe689[_0xe6ced5];return _0x44b5c4;};'use strict';var client=require(_0x9e68('0x0'));exports['create']=function(_0x1cea7c){return client['Request'](_0x9e68('0x1'),{'body':_0x1cea7c,'log':_0x9e68('0x1')});}; \ No newline at end of file +var _0x7c98=['CreateVoiceDialReport','Request'];(function(_0x4d1c3c,_0x490ca0){var _0x490809=function(_0x1d65b8){while(--_0x1d65b8){_0x4d1c3c['push'](_0x4d1c3c['shift']());}};_0x490809(++_0x490ca0);}(_0x7c98,0x1cd));var _0x87c9=function(_0xc3555a,_0x599225){_0xc3555a=_0xc3555a-0x0;var _0x5b6b8a=_0x7c98[_0xc3555a];return _0x5b6b8a;};'use strict';var client=require('../client');exports['create']=function(_0x2d1d52){return client[_0x87c9('0x0')]('CreateVoiceDialReport',{'body':_0x2d1d52,'log':_0x87c9('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 8def30a..e118a07 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 _0xb32d=['getVoiceExtensions','Request','GetVoiceExtension','exten','../client'];(function(_0x432196,_0x3a2adf){var _0x1f45ca=function(_0x41580d){while(--_0x41580d){_0x432196['push'](_0x432196['shift']());}};_0x1f45ca(++_0x3a2adf);}(_0xb32d,0x1da));var _0xdb32=function(_0x5ccab3,_0x5c7df5){_0x5ccab3=_0x5ccab3-0x0;var _0x8a5eb3=_0xb32d[_0x5ccab3];return _0x8a5eb3;};'use strict';var client=require(_0xdb32('0x0'));exports[_0xdb32('0x1')]=function(){return function(){return client[_0xdb32('0x2')](_0xdb32('0x3'),{'options':{'raw':!![],'attributes':['id',_0xdb32('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x720c=['../client','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x43412a,_0x3234c5){var _0x5cef5b=function(_0x42e819){while(--_0x42e819){_0x43412a['push'](_0x43412a['shift']());}};_0x5cef5b(++_0x3234c5);}(_0x720c,0x154));var _0xc720=function(_0x1832a0,_0x4ac21c){_0x1832a0=_0x1832a0-0x0;var _0x4fed96=_0x720c[_0x1832a0];return _0x4fed96;};'use strict';var client=require(_0xc720('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xc720('0x1')](_0xc720('0x2'),{'options':{'raw':!![],'attributes':['id',_0xc720('0x3'),_0xc720('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 9736e2f..9c92a03 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 _0x401c=['getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','callerid','active','Pause','Trunk','TrunkBackup','Interval','interval'];(function(_0x20bccf,_0x348156){var _0x26031b=function(_0x287c85){while(--_0x287c85){_0x20bccf['push'](_0x20bccf['shift']());}};_0x26031b(++_0x348156);}(_0x401c,0x17a));var _0xc401=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x401c[_0x11e30d];return _0x2d4e29;};'use strict';var client=require('../client');exports[_0xc401('0x0')]=function(){return function(){return client[_0xc401('0x1')](_0xc401('0x2'),{'options':{'raw':![],'attributes':['id',_0xc401('0x3'),_0xc401('0x4'),'acwTimeout',_0xc401('0x5'),_0xc401('0x6'),_0xc401('0x7'),_0xc401('0x8'),_0xc401('0x9'),_0xc401('0xa'),_0xc401('0xb'),_0xc401('0xc'),'dialPredictiveOptimization',_0xc401('0xd'),_0xc401('0xe'),_0xc401('0xf'),_0xc401('0x10'),_0xc401('0x11'),_0xc401('0x12'),'dialQueueTimeout',_0xc401('0x13'),_0xc401('0x14'),_0xc401('0x15'),_0xc401('0x16'),_0xc401('0x17'),_0xc401('0x18'),_0xc401('0x19'),_0xc401('0x1a'),_0xc401('0x1b'),_0xc401('0x1c'),_0xc401('0x1d'),_0xc401('0x1e'),_0xc401('0x1f'),_0xc401('0x20'),_0xc401('0x21'),'dialAMDAfterGreetingSilence',_0xc401('0x22'),'dialAMDMinWordLength',_0xc401('0x23'),_0xc401('0x24'),_0xc401('0x25'),_0xc401('0x26'),'timeout','dialRecallMeTimeout',_0xc401('0x27'),_0xc401('0x28'),_0xc401('0x29'),_0xc401('0x2a'),'dialQueueProject2','monitor_format','strategy',_0xc401('0x2b'),_0xc401('0x2c'),_0xc401('0x2d'),_0xc401('0x2e'),'dialDropMaxRetry',_0xc401('0x2f'),'dialAbandonedMaxRetry',_0xc401('0x30'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0xc401('0x31'),'dialAgentRejectRetryFrequency',_0xc401('0x32'),_0xc401('0x33'),_0xc401('0x34'),_0xc401('0x35'),_0xc401('0x36'),_0xc401('0x37')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0xc401('0x3'),_0xc401('0x38'),_0xc401('0x39')]},{'model':_0xc401('0x3a'),'as':'mandatoryDispositionPause','attributes':['id',_0xc401('0x3')]},{'model':_0xc401('0x3b'),'as':_0xc401('0x3c'),'attributes':['id',_0xc401('0x3'),'callerid',_0xc401('0x39')]},{'model':_0xc401('0x3d'),'as':_0xc401('0x3d'),'attributes':['id','name'],'include':[{'model':_0xc401('0x3d'),'as':'Intervals','attributes':['id',_0xc401('0x3'),_0xc401('0x3e')]}]}]},'log':_0xc401('0x0')});};}; \ No newline at end of file +var _0x5658=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialDropRetryFrequency'];(function(_0x5b7f0f,_0x4a1481){var _0x32d223=function(_0x5f401e){while(--_0x5f401e){_0x5b7f0f['push'](_0x5b7f0f['shift']());}};_0x32d223(++_0x4a1481);}(_0x5658,0x140));var _0x8565=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5658[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x8565('0x0'));exports[_0x8565('0x1')]=function(){return function(){return client[_0x8565('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x8565('0x3'),_0x8565('0x4'),_0x8565('0x5'),_0x8565('0x6'),'monitor_format','type','dialActive',_0x8565('0x7'),_0x8565('0x8'),_0x8565('0x9'),_0x8565('0xa'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x8565('0xb'),'dialOriginateCallerIdName',_0x8565('0xc'),'dialOriginateTimeout',_0x8565('0xd'),'dialQueueTimeout',_0x8565('0xe'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x8565('0xf'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x8565('0x10'),_0x8565('0x11'),_0x8565('0x12'),_0x8565('0x13'),'dialPrefix',_0x8565('0x14'),'dialAMDActive',_0x8565('0x15'),_0x8565('0x16'),'dialAMDAfterGreetingSilence',_0x8565('0x17'),_0x8565('0x18'),_0x8565('0x19'),_0x8565('0x1a'),_0x8565('0x1b'),'dialAMDMaximumWordLength',_0x8565('0x1c'),_0x8565('0x1d'),'dialRecallInQueue',_0x8565('0x1e'),'dialAgiAfterHangupAgent',_0x8565('0x1f'),_0x8565('0x20'),_0x8565('0x21'),_0x8565('0x22'),_0x8565('0x23'),'dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0x8565('0x24'),_0x8565('0x25'),_0x8565('0x26'),_0x8565('0x27'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x8565('0x28'),_0x8565('0x29'),_0x8565('0x2a'),_0x8565('0x2b'),'dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin'],'include':[{'model':'Trunk','as':_0x8565('0x2c'),'attributes':['id',_0x8565('0x3'),'callerid',_0x8565('0x2d')]},{'model':'Pause','as':_0x8565('0x2e'),'attributes':['id','name']},{'model':_0x8565('0x2c'),'as':_0x8565('0x2f'),'attributes':['id',_0x8565('0x3'),_0x8565('0x30'),_0x8565('0x2d')]},{'model':_0x8565('0x31'),'as':'Interval','attributes':['id',_0x8565('0x3')],'include':[{'model':_0x8565('0x31'),'as':_0x8565('0x32'),'attributes':['id','name','interval']}]}]},'log':_0x8565('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 73a858b..3b5397f 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(_0x302226,_0x623a3){var _0x4c4fa0=function(_0x410b7b){while(--_0x410b7b){_0x302226['push'](_0x302226['shift']());}};_0x4c4fa0(++_0x623a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x15ceb8,_0x41736f){var _0x35fab7=function(_0x1871e4){while(--_0x1871e4){_0x15ceb8['push'](_0x15ceb8['shift']());}};_0x35fab7(++_0x41736f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 a48c4dd..5ba6936 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 _0x7012=['../client','Request','getVoiceQueueRtPauses'];(function(_0x7ddcc2,_0x534d8e){var _0x17d915=function(_0x5d62a6){while(--_0x5d62a6){_0x7ddcc2['push'](_0x7ddcc2['shift']());}};_0x17d915(++_0x534d8e);}(_0x7012,0x78));var _0x2701=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x7012[_0x1a9204];return _0x17ca68;};'use strict';var client=require(_0x2701('0x0'));exports['getVoiceQueueRtPauses']=function(_0x22b3fa){return function(){return client[_0x2701('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x22b3fa,'paused':!![]},'raw':!![]},'log':_0x2701('0x2')});};}; \ No newline at end of file +var _0xda17=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x5cad3c,_0x45ccc8){var _0x18095e=function(_0x1808e4){while(--_0x1808e4){_0x5cad3c['push'](_0x5cad3c['shift']());}};_0x18095e(++_0x45ccc8);}(_0xda17,0x1c7));var _0x7da1=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xda17[_0x5b561d];return _0x431060;};'use strict';var client=require('../client');exports[_0x7da1('0x0')]=function(_0x1b2a72){return function(){return client[_0x7da1('0x1')](_0x7da1('0x2'),{'options':{'where':{'VoiceQueueId':_0x1b2a72,'paused':!![]},'raw':!![]},'log':_0x7da1('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index f0d3158..f70c341 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1e518d,_0x5274b2){var _0x153006=function(_0x33a916){while(--_0x33a916){_0x1e518d['push'](_0x1e518d['shift']());}};_0x153006(++_0x5274b2);}(_0x7a54,0x106));var _0x47a5=function(_0x27dc09,_0x4665cb){_0x27dc09=_0x27dc09-0x0;var _0x5d1e50=_0x7a54[_0x27dc09];return _0x5d1e50;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1af9da,_0x594e1f){var _0x45a78d=function(_0x154fc0){while(--_0x154fc0){_0x1af9da['push'](_0x1af9da['shift']());}};_0x45a78d(++_0x594e1f);}(_0x7a54,0x106));var _0x47a5=function(_0x22fc38,_0x53c775){_0x22fc38=_0x22fc38-0x0;var _0x366205=_0x7a54[_0x22fc38];return _0x366205;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index f5d1047..98e1423 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 _0x338e=['transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','extension','blind','secondtransfererconnectedlinename','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransfererexten','../client','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext'];(function(_0x365a72,_0x2864c7){var _0x407693=function(_0x27b8a7){while(--_0x27b8a7){_0x365a72['push'](_0x365a72['shift']());}};_0x407693(++_0x2864c7);}(_0x338e,0x196));var _0xe338=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x338e[_0x2641f9];return _0x585741;};'use strict';var client=require(_0xe338('0x0'));exports[_0xe338('0x1')]={};exports['blindTransfer']=function(_0x43ebfc){return client[_0xe338('0x2')](_0xe338('0x3'),{'body':{'result':_0x43ebfc[_0xe338('0x4')],'transfererchannel':_0x43ebfc[_0xe338('0x5')],'transferercalleridnum':_0x43ebfc['transferercalleridnum'],'transferercalleridname':_0x43ebfc[_0xe338('0x6')],'transfererconnectedlinenum':_0x43ebfc[_0xe338('0x7')],'transfererconnectedlinename':_0x43ebfc['transfererconnectedlinename'],'transfereraccountcode':_0x43ebfc[_0xe338('0x8')],'transferercontext':_0x43ebfc[_0xe338('0x9')],'transfererexten':_0x43ebfc[_0xe338('0xa')],'transfererlinkedid':_0x43ebfc[_0xe338('0xb')],'transfereechannel':_0x43ebfc['transfereechannel'],'transfereecalleridnum':_0x43ebfc[_0xe338('0xc')],'transfereecalleridname':_0x43ebfc[_0xe338('0xd')],'transfereeconnectedlinenum':_0x43ebfc[_0xe338('0xe')],'transfereeconnectedlinename':_0x43ebfc['transfereeconnectedlinename'],'transfereeaccountcode':_0x43ebfc[_0xe338('0xf')],'transfereecontext':_0x43ebfc[_0xe338('0x10')],'transfereeexten':_0x43ebfc[_0xe338('0x11')],'transfereelinkedid':_0x43ebfc[_0xe338('0x12')],'isexternal':_0x43ebfc['isexternal'],'context':_0x43ebfc['context'],'extension':_0x43ebfc[_0xe338('0x13')],'type':_0xe338('0x14')},'log':_0xe338('0x3')});};exports['attendedTransfer']=function(_0x8b93c4){return client[_0xe338('0x2')](_0xe338('0x3'),{'body':{'result':_0x8b93c4[_0xe338('0x4')],'transfererchannel':_0x8b93c4['origtransfererchannel'],'transferercalleridnum':_0x8b93c4['origtransferercalleridnum'],'transferercalleridname':_0x8b93c4['origtransferercalleridname'],'transfererconnectedlinenum':_0x8b93c4['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x8b93c4[_0xe338('0x15')],'transfereraccountcode':_0x8b93c4['origtransfereraccountcode'],'transferercontext':_0x8b93c4['secondtransferercontext'],'transfererexten':_0x8b93c4['secondtransfererexten'],'transfererlinkedid':_0x8b93c4['origtransfererlinkedid'],'transfereechannel':_0x8b93c4[_0xe338('0x16')],'transfereecalleridnum':_0x8b93c4[_0xe338('0x17')],'transfereecalleridname':_0x8b93c4[_0xe338('0x18')],'transfereeconnectedlinenum':_0x8b93c4['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x8b93c4[_0xe338('0x19')],'transfereeaccountcode':_0x8b93c4[_0xe338('0x1a')],'transfereecontext':_0x8b93c4[_0xe338('0x1b')],'transfereeexten':_0x8b93c4[_0xe338('0x1c')],'transfereelinkedid':_0x8b93c4[_0xe338('0x1d')],'isexternal':_0x8b93c4[_0xe338('0x1e')],'context':_0x8b93c4['origtransferercontext'],'extension':_0x8b93c4[_0xe338('0x1f')],'type':'attended'},'log':_0xe338('0x3')});}; \ No newline at end of file +var _0x7d32=['transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname'];(function(_0x72dba0,_0x339065){var _0x429d2f=function(_0x493e8c){while(--_0x493e8c){_0x72dba0['push'](_0x72dba0['shift']());}};_0x429d2f(++_0x339065);}(_0x7d32,0xde));var _0x27d3=function(_0x44003b,_0x540398){_0x44003b=_0x44003b-0x0;var _0x313ea0=_0x7d32[_0x44003b];return _0x313ea0;};'use strict';var client=require(_0x27d3('0x0'));exports[_0x27d3('0x1')]={};exports['blindTransfer']=function(_0x333259){return client[_0x27d3('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x333259[_0x27d3('0x3')],'transfererchannel':_0x333259[_0x27d3('0x4')],'transferercalleridnum':_0x333259['transferercalleridnum'],'transferercalleridname':_0x333259[_0x27d3('0x5')],'transfererconnectedlinenum':_0x333259[_0x27d3('0x6')],'transfererconnectedlinename':_0x333259[_0x27d3('0x7')],'transfereraccountcode':_0x333259['transfereraccountcode'],'transferercontext':_0x333259['transferercontext'],'transfererexten':_0x333259[_0x27d3('0x8')],'transfererlinkedid':_0x333259['transfererlinkedid'],'transfereechannel':_0x333259[_0x27d3('0x9')],'transfereecalleridnum':_0x333259[_0x27d3('0xa')],'transfereecalleridname':_0x333259[_0x27d3('0xb')],'transfereeconnectedlinenum':_0x333259[_0x27d3('0xc')],'transfereeconnectedlinename':_0x333259[_0x27d3('0xd')],'transfereeaccountcode':_0x333259[_0x27d3('0xe')],'transfereecontext':_0x333259[_0x27d3('0xf')],'transfereeexten':_0x333259['transfereeexten'],'transfereelinkedid':_0x333259[_0x27d3('0x10')],'isexternal':_0x333259[_0x27d3('0x11')],'context':_0x333259['context'],'extension':_0x333259[_0x27d3('0x12')],'type':_0x27d3('0x13')},'log':_0x27d3('0x14')});};exports[_0x27d3('0x15')]=function(_0x404cd3){return client[_0x27d3('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x404cd3[_0x27d3('0x3')],'transfererchannel':_0x404cd3[_0x27d3('0x16')],'transferercalleridnum':_0x404cd3[_0x27d3('0x17')],'transferercalleridname':_0x404cd3[_0x27d3('0x18')],'transfererconnectedlinenum':_0x404cd3[_0x27d3('0x19')],'transfererconnectedlinename':_0x404cd3[_0x27d3('0x1a')],'transfereraccountcode':_0x404cd3[_0x27d3('0x1b')],'transferercontext':_0x404cd3[_0x27d3('0x1c')],'transfererexten':_0x404cd3['secondtransfererexten'],'transfererlinkedid':_0x404cd3[_0x27d3('0x1d')],'transfereechannel':_0x404cd3['transfertargetchannel'],'transfereecalleridnum':_0x404cd3[_0x27d3('0x1e')],'transfereecalleridname':_0x404cd3[_0x27d3('0x1f')],'transfereeconnectedlinenum':_0x404cd3[_0x27d3('0x20')],'transfereeconnectedlinename':_0x404cd3['transfertargetconnectedlinename'],'transfereeaccountcode':_0x404cd3[_0x27d3('0x21')],'transfereecontext':_0x404cd3[_0x27d3('0x22')],'transfereeexten':_0x404cd3['transfertargetexten'],'transfereelinkedid':_0x404cd3[_0x27d3('0x23')],'isexternal':_0x404cd3['isexternal'],'context':_0x404cd3[_0x27d3('0x24')],'extension':_0x404cd3[_0x27d3('0x25')],'type':_0x27d3('0x26')},'log':_0x27d3('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 574f4ea..87a4cb2 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 _0xee4f=['Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','channel','%s.%s','filename','format','ai(mixmonitorid)','/var/spool/asterisk/monitor/','isNil','monitors','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','uniqueid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','queueChannels','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','lodash','validate','moment','../../../config/environment','../ami','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','Action','then','message','command','action','content','catch','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumDuration','total','type','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active'];(function(_0x3bcf18,_0x4e75fc){var _0x3b3537=function(_0x12a614){while(--_0x12a614){_0x3bcf18['push'](_0x3bcf18['shift']());}};_0x3b3537(++_0x4e75fc);}(_0xee4f,0xad));var _0xfee4=function(_0x4ef178,_0x301012){_0x4ef178=_0x4ef178-0x0;var _0xc1e428=_0xee4f[_0x4ef178];return _0xc1e428;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require(_0xfee4('0x1'));var moment=require(_0xfee4('0x2'));var config=require(_0xfee4('0x3'));var properties=require('../properties');var ami=require(_0xfee4('0x4'));exports['listen']=function(_0x27874a,_0x505b55,_0x4da9b6){return new Promise(function(_0x1c39b1,_0x498647){var _0x52fb6b={'QueuePause':function(_0x2fb1b3){return new Promise(function(_0x16cc9a){var _0x34908a=util['format']('%s/%s',_0xfee4('0x5'),_0x2fb1b3[_0xfee4('0x6')]);if(_0x27874a[_0xfee4('0x7')]&&_0x27874a['timers'][_0x34908a]&&_0x27874a['timers'][_0x34908a][_0xfee4('0x8')]){_0x27874a[_0xfee4('0x7')][_0x34908a][_0xfee4('0x9')]();}if(_0x27874a['agents'][_0x34908a]){_0x27874a[_0xfee4('0xa')][_0x34908a][_0xfee4('0xb')]({'statePause':_0x2fb1b3[_0xfee4('0xc')]?!![]:![]});}_0x16cc9a({'code':0xc8,'message':_0xfee4('0xd')});});},'Reload':function(_0x95be61){var _0x1cbbf5=this;return new Promise(function(_0x297cee,_0x562832){if(ami[_0xfee4('0xe')]()==![]){return _0x562832(_0x1cbbf5[_0xfee4('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xfee4('0x10')][_0xfee4('0x11')],_0xfee4('0x12')][_0xfee4('0x13')]('\x20')));}_0x95be61=_[_0xfee4('0x14')](_0x95be61,_[_0xfee4('0x15')](properties[_0xfee4('0x16')]));_0x95be61['action']=_0xfee4('0x17');return ami[_0xfee4('0x18')](_0x95be61)[_0xfee4('0x19')](function(_0x54f5a0){_0x297cee({'code':0xc8,'message':_0x54f5a0[_0xfee4('0x1a')]});})['catch'](function(_0x54a606){_0x562832(_0x1cbbf5[_0xfee4('0xf')](0x1f5,_0x54a606[_0xfee4('0x1a')]));});});},'Command':function(_0x27b531){var _0x44a1ec=this;return new Promise(function(_0x24848c,_0xe7b74d){if(ami[_0xfee4('0xe')]()==![]){return _0xe7b74d(_0x44a1ec[_0xfee4('0xf')](0x1f4,[config[_0xfee4('0x10')]['ip'],config['asterisk'][_0xfee4('0x11')],_0xfee4('0x12')][_0xfee4('0x13')]('\x20')));}_0x27b531=_[_0xfee4('0x14')](_0x27b531,_0xfee4('0x1b'));_0x27b531[_0xfee4('0x1c')]='Command';return ami[_0xfee4('0x18')](_0x27b531)[_0xfee4('0x19')](function(_0xaffd7f){_0x24848c({'code':0xc8,'message':_0xaffd7f[_0xfee4('0x1d')]});})[_0xfee4('0x1e')](function(_0x115d1d){_0xe7b74d(_0x44a1ec[_0xfee4('0xf')](0x1f5,_0x115d1d[_0xfee4('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3ac09a){var _0x471971=[];for(var _0x4eb11b in _0x27874a['voiceQueues']){if(_0x27874a['voiceQueues']['hasOwnProperty'](_0x4eb11b)){var _0x5176a1=_0x27874a[_0xfee4('0x1f')][_0x4eb11b];var _0x6871d4={'id':_0x5176a1['id'],'name':_0x5176a1[_0xfee4('0x6')],'strategy':_0x5176a1[_0xfee4('0x20')],'answered':_0x5176a1[_0xfee4('0x21')],'available':_0x5176a1[_0xfee4('0x22')],'loggedIn':_0x5176a1[_0xfee4('0x23')],'pTalking':_0x5176a1[_0xfee4('0x24')],'sumBillable':_0x5176a1['sumBillable'],'sumDuration':_0x5176a1[_0xfee4('0x25')],'sumHoldTime':_0x5176a1['sumHoldTime']||0x0,'talking':_0x5176a1['talking'],'total':_0x5176a1[_0xfee4('0x26')],'type':_0x5176a1[_0xfee4('0x27')],'unmanaged':_0x5176a1['unmanaged'],'abandoned':_0x5176a1['abandoned'],'waiting':_0x5176a1[_0xfee4('0x28')],'loggedInDb':_0x5176a1['loggedInDb']};if(_0x5176a1['type']===_0xfee4('0x29')){_0x6871d4[_0xfee4('0x2a')]=_0x5176a1['dialActive'];_0x6871d4[_0xfee4('0x2b')]=_0x5176a1['dialMethod'];_0x6871d4[_0xfee4('0x2c')]=_0x5176a1[_0xfee4('0x2c')];_0x6871d4[_0xfee4('0x2d')]=_0x5176a1['dialOriginateCallerIdNumber'];_0x6871d4[_0xfee4('0x2e')]=_0x5176a1[_0xfee4('0x2e')];_0x6871d4[_0xfee4('0x2f')]=_0x5176a1[_0xfee4('0x2f')];_0x6871d4['temp']=_0x5176a1[_0xfee4('0x30')];_0x6871d4['outboundAnswerAgiCallsDay']=_0x5176a1[_0xfee4('0x31')];_0x6871d4[_0xfee4('0x32')]=_0x5176a1['outboundAnswerCallsDay'];_0x6871d4[_0xfee4('0x33')]=_0x5176a1[_0xfee4('0x33')];_0x6871d4['outboundBusyCallsDay']=_0x5176a1[_0xfee4('0x34')];_0x6871d4['outboundCongestionCallsDay']=_0x5176a1[_0xfee4('0x35')];_0x6871d4[_0xfee4('0x36')]=_0x5176a1[_0xfee4('0x36')];_0x6871d4[_0xfee4('0x37')]=_0x5176a1[_0xfee4('0x37')];_0x6871d4[_0xfee4('0x38')]=_0x5176a1['outboundDropCallsDayTimeout'];_0x6871d4[_0xfee4('0x39')]=_0x5176a1['outboundNoAnswerCallsDay'];_0x6871d4[_0xfee4('0x3a')]=_0x5176a1['outboundNoSuchCallsDay'];_0x6871d4[_0xfee4('0x3b')]=_0x5176a1[_0xfee4('0x3b')];_0x6871d4[_0xfee4('0x3c')]=_0x5176a1[_0xfee4('0x3c')];_0x6871d4[_0xfee4('0x3d')]=_0x5176a1[_0xfee4('0x3d')];_0x6871d4['outboundUnknownCallsDay']=_0x5176a1[_0xfee4('0x3e')];_0x6871d4[_0xfee4('0x3f')]=_0x5176a1[_0xfee4('0x3f')];_0x6871d4[_0xfee4('0x40')]=_0x5176a1[_0xfee4('0x40')];_0x6871d4[_0xfee4('0x41')]=_0x5176a1[_0xfee4('0x41')];_0x6871d4['predictiveIntervalDroppedCallsCallersExit']=_0x5176a1[_0xfee4('0x42')];_0x6871d4[_0xfee4('0x43')]=_0x5176a1[_0xfee4('0x43')];_0x6871d4['predictiveIntervalErlangCalls']=_0x5176a1['predictiveIntervalErlangCalls'];_0x6871d4[_0xfee4('0x44')]=_0x5176a1[_0xfee4('0x44')];_0x6871d4[_0xfee4('0x45')]=_0x5176a1['predictiveIntervalHitRate'];_0x6871d4['predictiveIntervalMultiplicativeFactor']=_0x5176a1['predictiveIntervalMultiplicativeFactor'];_0x6871d4[_0xfee4('0x46')]=_0x5176a1[_0xfee4('0x46')];_0x6871d4[_0xfee4('0x47')]=_0x5176a1[_0xfee4('0x47')];_0x6871d4['predictiveIntervalTotalCalls']=_0x5176a1['predictiveIntervalTotalCalls'];_0x6871d4[_0xfee4('0x1a')]=_0x5176a1[_0xfee4('0x1a')];_0x6871d4[_0xfee4('0x48')]=_0x5176a1[_0xfee4('0x48')];_0x6871d4[_0xfee4('0x49')]=_0x5176a1[_0xfee4('0x49')];_0x6871d4[_0xfee4('0x4a')]=_0x5176a1[_0xfee4('0x4a')];_0x6871d4[_0xfee4('0x4b')]=_0x5176a1[_0xfee4('0x4b')];_0x6871d4['erlangBusyFactor']=_0x5176a1[_0xfee4('0x4c')];_0x6871d4[_0xfee4('0x4d')]=_0x5176a1[_0xfee4('0x4d')];_0x6871d4[_0xfee4('0x4e')]=_0x5176a1[_0xfee4('0x4e')];}if(_0x5176a1[_0xfee4('0x4f')]){_0x6871d4[_0xfee4('0x4f')]={'id':_0x5176a1[_0xfee4('0x4f')]['id'],'name':_0x5176a1[_0xfee4('0x4f')][_0xfee4('0x6')],'active':_0x5176a1[_0xfee4('0x4f')][_0xfee4('0x50')],'callerid':_0x5176a1[_0xfee4('0x4f')]['callerid']};}if(_0x5176a1[_0xfee4('0x51')]){_0x6871d4[_0xfee4('0x51')]={'id':_0x5176a1[_0xfee4('0x51')]['id'],'name':_0x5176a1[_0xfee4('0x51')][_0xfee4('0x6')]};}_0x471971[_0xfee4('0x52')](_0x6871d4);}}_0x3ac09a({'count':_0x471971[_0xfee4('0x53')],'rows':_0x471971});});},'UpdateVoiceQueue':function(_0x10aedc){return new Promise(function(_0x113909,_0x4b9093){var _0x29af02=_[_0xfee4('0x54')](_0x27874a['voiceQueues'],{'id':parseInt(_0x10aedc['id'])});var _0x1030b7=_[_0xfee4('0x55')](_0x10aedc,['id']);if(_0x29af02){for(var _0x5212bc in _0x1030b7){if(typeof _0x1030b7[_0x5212bc]!=='undefined'&&typeof _0x29af02[_0x5212bc]!==_0xfee4('0x56')){_0x29af02[_0x5212bc]=_0x1030b7[_0x5212bc];}}_0x113909(_0x29af02);}else{_0x4b9093();}});},'VoiceChannels':function(){return new Promise(function(_0x5c99c3){var _0x5582d9=_[_0xfee4('0x57')](_0x27874a[_0xfee4('0x58')]);_0x5c99c3({'count':_0x5582d9[_0xfee4('0x53')],'rows':_0x5582d9});});},'VoiceChannelMixMonitor':function(_0x32e4c7){var _0x3259ce=this;return new Promise(function(_0x3a4660,_0x4a476e){if(ami[_0xfee4('0xe')]()==![]){return _0x4a476e(_0x3259ce['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xfee4('0x11')],_0xfee4('0x12')][_0xfee4('0x13')]('\x20')));}var _0x585b5a=schema(properties[_0xfee4('0x59')])[_0xfee4('0x1')](_0x32e4c7);if(_0x585b5a[_0xfee4('0x53')]>0x0){return _0x4a476e(_0x3259ce['error'](0x1f4,_[_0xfee4('0x5a')](_0x585b5a,'message')[_0xfee4('0x13')](',\x20')));}var _0x2b85b7=_[_0xfee4('0x54')](_0x27874a[_0xfee4('0x58')],{'uniqueid':_0x32e4c7['uniqueid']});if(_0x2b85b7&&_0x2b85b7[_0xfee4('0x5b')]){var _0x435ced=util['format'](_0xfee4('0x5c'),_0x32e4c7[_0xfee4('0x5d')]||_0x32e4c7['uniqueid'],_0x32e4c7[_0xfee4('0x5e')]||'wav');return ami[_0xfee4('0x18')]({'action':'MixMonitor','channel':_0x2b85b7[_0xfee4('0x5b')],'file':_0x435ced,'options':_0xfee4('0x5f')})['then'](function(_0x3c099d){var _0x6e9b85=_[_0xfee4('0x54')](_0x2b85b7['monitors'],{'filename':_0xfee4('0x60')+_0x435ced['toLowerCase']()});if(_[_0xfee4('0x61')](_0x6e9b85)){_0x2b85b7[_0xfee4('0x62')][_0xfee4('0x52')]({'filename':'/var/spool/asterisk/monitor/'+_0x435ced[_0xfee4('0x63')](),'createdAt':moment()[_0xfee4('0x5e')](_0xfee4('0x64')),'mixmonitorid':_0x3c099d['mixmonitorid'],'status':_0xfee4('0x65')});}else{_0x6e9b85[_0xfee4('0x66')]=_0x3c099d[_0xfee4('0x66')];_0x6e9b85['status']='rec';}_0x3a4660({'code':0xc8,'message':[_0x32e4c7[_0xfee4('0x67')],_0xfee4('0x68'),_0x3c099d[_0xfee4('0x66')]][_0xfee4('0x13')]('\x20'),'mixmonitorid':_0x3c099d['mixmonitorid']});})[_0xfee4('0x1e')](function(_0x15b2f9){_0x4a476e(_0x3259ce[_0xfee4('0xf')](0x1f5,[_0x32e4c7[_0xfee4('0x67')],_0x15b2f9['message'][_0xfee4('0x63')]()][_0xfee4('0x13')]('\x20')));});}else{return _0x4a476e(_0x3259ce[_0xfee4('0xf')](0x1f5,_0xfee4('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x49399e){var _0x4220bf=this;return new Promise(function(_0x1224d3,_0xe7b3a1){if(ami[_0xfee4('0xe')]()==![]){return _0xe7b3a1(_0x4220bf[_0xfee4('0xf')](0x1f4,[config[_0xfee4('0x10')]['ip'],config[_0xfee4('0x10')][_0xfee4('0x11')],_0xfee4('0x12')]['join']('\x20')));}var _0x27df69=schema(properties['voicechannel'])['validate'](_0x49399e);if(_0x27df69[_0xfee4('0x53')]>0x0){return _0xe7b3a1(_0x4220bf[_0xfee4('0xf')](0x1f4,_[_0xfee4('0x5a')](_0x27df69,_0xfee4('0x1a'))[_0xfee4('0x13')](',\x20')));}var _0x48a2c3=_[_0xfee4('0x54')](_0x27874a['channels'],{'uniqueid':_0x49399e[_0xfee4('0x67')]});if(_0x48a2c3){return Promise['resolve']()[_0xfee4('0x19')](function(){if(_0x48a2c3[_0xfee4('0x5b')]){return ami[_0xfee4('0x18')]({'action':_0xfee4('0x6a'),'channel':_0x48a2c3[_0xfee4('0x5b')],'mixmonitorid':_0x49399e[_0xfee4('0x66')]})[_0xfee4('0x1e')](function(){});}})[_0xfee4('0x19')](function(){if(_0x48a2c3[_0xfee4('0x6b')]){return ami[_0xfee4('0x18')]({'action':_0xfee4('0x6a'),'channel':_0x48a2c3[_0xfee4('0x6b')],'mixmonitorid':_0x49399e['mixmonitorid']})[_0xfee4('0x1e')](function(){});}})['then'](function(){var _0x3963ce=_['find'](_0x48a2c3[_0xfee4('0x62')],{'mixmonitorid':_0x49399e[_0xfee4('0x66')]});if(_0x3963ce){_0x3963ce['status']=_0xfee4('0x6c');}})[_0xfee4('0x19')](function(){var _0x320859=util[_0xfee4('0x5e')](_0xfee4('0x5c'),_0x49399e[_0xfee4('0x5d')]||_0x49399e[_0xfee4('0x67')],_0x49399e[_0xfee4('0x5e')]||_0xfee4('0x6d'));var _0x5980bb=_['find'](_0x48a2c3[_0xfee4('0x62')],{'filename':_0xfee4('0x60')+_0x320859[_0xfee4('0x63')]()});if(_0x5980bb){_0x5980bb['status']=_0xfee4('0x6c');}})[_0xfee4('0x19')](function(){_0x1224d3({'code':0xc8,'message':[_0x49399e[_0xfee4('0x67')],_0xfee4('0x6e')][_0xfee4('0x13')]('\x20')});})['catch'](function(_0x2341cc){_0xe7b3a1(_0x4220bf['error'](0x1f5,[_0x49399e['uniqueid'],_0x2341cc['message'][_0xfee4('0x63')]()]['join']('\x20')));});}else{return _0xe7b3a1(_0x4220bf[_0xfee4('0xf')](0x1f5,_0xfee4('0x69')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x35c791){var _0x39e48c=_[_0xfee4('0x57')](_0x27874a[_0xfee4('0x6f')]);_0x35c791({'count':_0x39e48c[_0xfee4('0x53')],'rows':_0x39e48c});});},'VoiceQueuesChannel':function(_0x509424){var _0x3c94e3=this;return new Promise(function(_0x462553,_0x39cabf){var _0x1f3072=schema(properties['voicequeuechannel'])[_0xfee4('0x1')](_0x509424);if(_0x1f3072[_0xfee4('0x53')]>0x0){return _0x39cabf(_0x3c94e3[_0xfee4('0xf')](0x1f4,_[_0xfee4('0x5a')](_0x1f3072,_0xfee4('0x1a'))[_0xfee4('0x13')](',\x20')));}var _0x491760=_[_0xfee4('0x54')](_0x27874a[_0xfee4('0x6f')],{'uniqueid':_0x509424[_0xfee4('0x67')]});if(_0x491760){_0x462553(_0x491760);}else{return _0x39cabf(_0x3c94e3[_0xfee4('0xf')](0x1f5,_0xfee4('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x5767c8){var _0x15d0a8=this;return new Promise(function(_0x3355f1,_0x224023){if(ami[_0xfee4('0xe')]()==![]){return _0x224023(_0x15d0a8[_0xfee4('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xfee4('0x10')][_0xfee4('0x11')],_0xfee4('0x12')][_0xfee4('0x13')]('\x20')));}var _0x550fd4=schema(properties['voicequeuechannelhangup'])['validate'](_0x5767c8);if(_0x550fd4[_0xfee4('0x53')]>0x0){return _0x224023(_0x15d0a8['error'](0x1f4,_[_0xfee4('0x5a')](_0x550fd4,_0xfee4('0x1a'))[_0xfee4('0x13')](',\x20')));}var _0x544086=_[_0xfee4('0x54')](_0x27874a[_0xfee4('0x6f')],{'uniqueid':_0x5767c8[_0xfee4('0x67')]});if(_0x544086&&_0x544086[_0xfee4('0x5b')]){return ami[_0xfee4('0x18')]({'action':'Hangup','channel':_0x544086['channel']})['then'](function(_0x5448c2){_0x3355f1({'code':0xc8,'message':[_0x5767c8[_0xfee4('0x67')],_0x5448c2['message'][_0xfee4('0x63')]()]['join']('\x20')});})['catch'](function(_0x318554){_0x224023(_0x15d0a8[_0xfee4('0xf')](0x1f5,[_0x5767c8[_0xfee4('0x67')],_0x318554[_0xfee4('0x1a')][_0xfee4('0x63')]()][_0xfee4('0x13')]('\x20')));});}else{return _0x224023(_0x15d0a8['error'](0x1f5,_0xfee4('0x69')));}});},'VoiceQueuesChannelRedirect':function(_0x124649){var _0x31c593=this;return new Promise(function(_0x363b60,_0x36d81b){if(ami[_0xfee4('0xe')]()==![]){return _0x36d81b(_0x31c593[_0xfee4('0xf')](0x1f4,[config[_0xfee4('0x10')]['ip'],config['asterisk'][_0xfee4('0x11')],_0xfee4('0x12')][_0xfee4('0x13')]('\x20')));}var _0x2a3eb7=schema(properties['voicequeuechannelredirect'])['validate'](_0x124649);if(_0x2a3eb7[_0xfee4('0x53')]>0x0){return _0x36d81b(_0x31c593['error'](0x1f4,_[_0xfee4('0x5a')](_0x2a3eb7,_0xfee4('0x1a'))['join'](',\x20')));}var _0x4b1275=_[_0xfee4('0x54')](_0x27874a[_0xfee4('0x6f')],{'uniqueid':_0x124649[_0xfee4('0x67')]});if(_0x4b1275&&_0x4b1275['channel']){return ami[_0xfee4('0x18')]({'action':'Redirect','channel':_0x4b1275[_0xfee4('0x5b')],'exten':_0x124649['exten'],'context':_0x124649[_0xfee4('0x70')]||_0x4b1275[_0xfee4('0x70')],'priority':0x1})[_0xfee4('0x19')](function(_0x1c15ca){_0x363b60({'code':0xc8,'message':[_0x124649['uniqueid'],_0x1c15ca[_0xfee4('0x1a')]['toLowerCase']()][_0xfee4('0x13')]('\x20')});})[_0xfee4('0x1e')](function(_0x5bc4d9){_0x36d81b(_0x31c593[_0xfee4('0xf')](0x1f5,[_0x124649[_0xfee4('0x67')],_0x5bc4d9['message'][_0xfee4('0x63')]()]['join']('\x20')));});}else{return _0x36d81b(_0x31c593['error'](0x1f5,_0xfee4('0x69')));}});},'Agents':function(_0x28c005){return new Promise(function(_0x2cadaa){var _0x5b5bad=_[_0xfee4('0x57')](_0x27874a[_0xfee4('0xa')]);if(_0x28c005&&_0x28c005['id']){var _0x31d344=_[_0xfee4('0x54')](_0x5b5bad,function(_0x4a30bc){return _0x4a30bc['id']===_0x28c005['id'];});_0x2cadaa(_0x31d344);}else{_0x2cadaa({'count':_0x5b5bad['length'],'rows':_0x5b5bad});}});},'Telephones':function(){return new Promise(function(_0x40276e){var _0xc1afd7=_[_0xfee4('0x57')](_0x27874a[_0xfee4('0x71')]);_0x40276e({'count':_0xc1afd7[_0xfee4('0x53')],'rows':_0xc1afd7});});},'Trunks':function(){return new Promise(function(_0x15d0ae){var _0x3c5526=_[_0xfee4('0x57')](_0x27874a['trunks']);_0x15d0ae({'count':_0x3c5526['length'],'rows':_0x3c5526});});},'OutboundChannels':function(){return new Promise(function(_0x446b27){var _0x32c1cb=_['values'](_0x27874a[_0xfee4('0x72')]);_0x446b27({'count':_0x32c1cb[_0xfee4('0x53')],'rows':_0x32c1cb});});},'Outbound':function(){return new Promise(function(_0x357afd){_0x357afd(_0x27874a[_0xfee4('0x29')]);});},'Campaigns':function(){return new Promise(function(_0x569432){var _0x399961=_[_0xfee4('0x57')](_0x27874a[_0xfee4('0x73')]);_0x569432({'count':_0x399961['length'],'rows':_0x399961});});},'VoiceQueuesPreview':function(_0xe532f2){var _0x23576d=this;return new Promise(function(_0x234a3f,_0x21e5c6){_0x505b55[_0xfee4('0x74')](_0xe532f2['id'])[_0xfee4('0x19')](function(_0x266df6){_0x234a3f({'code':0xc8,'message':_0x266df6[_0xfee4('0x1a')]});})[_0xfee4('0x1e')](function(_0x218b76){_0x21e5c6(_0x23576d[_0xfee4('0xf')](0x1f4,_0x218b76[_0xfee4('0x1a')]));});});},'EventManager':function(_0x120f0e){var _0x535abe=this;return new Promise(function(_0x10dd43,_0x54b701){if(!_0x120f0e[_0xfee4('0x75')]){return _0x54b701(_0x535abe[_0xfee4('0xf')](0x1f4,_0xfee4('0x76')));}ami['emit']('custom:'+_0x120f0e[_0xfee4('0x75')],_0x120f0e['message']);_0x10dd43({'code':0xc8,'message':_0x120f0e});});},'FaxAccounts':function(){return new Promise(function(_0x3ffbc9){var _0x196f27=_['values'](_0x27874a[_0xfee4('0x77')]);_0x3ffbc9({'count':_0x196f27[_0xfee4('0x53')],'rows':_0x196f27});});},'SendFax':function(_0x17011d){var _0x4ca7a2=this;return new Promise(function(_0x3ee0c1,_0x3f3df1){_0x4da9b6[_0xfee4('0x78')](_0x17011d)[_0xfee4('0x19')](function(_0x1383fb){_0x3ee0c1({'code':0xc8,'message':_0x1383fb[_0xfee4('0x1a')]});})['catch'](function(_0x228eca){_0x3f3df1(_0x4ca7a2[_0xfee4('0xf')](0x1f4,_0x228eca['message']));});});},'CheckAfterSend':function(_0xb2862a){var _0x2e95fd=this;return new Promise(function(_0x15a383,_0x19707d){_0x4da9b6[_0xfee4('0x79')](_0xb2862a)[_0xfee4('0x19')](function(_0x3a7773){_0x15a383({'code':0xc8,'message':_0x3a7773[_0xfee4('0x1a')]});})[_0xfee4('0x1e')](function(_0x1ed4cf){_0x19707d(_0x2e95fd['error'](0x1f4,_0x1ed4cf[_0xfee4('0x1a')]));});});}};var _0x4db6b1=jayson[_0xfee4('0x7a')](_0x52fb6b)[_0xfee4('0x7b')]();_0x4db6b1['on']('error',function(_0x275cd0){return _0x498647(_0x275cd0);});_0x4db6b1[_0xfee4('0x7c')](0x232a,_0xfee4('0x7d'),function(){console[_0xfee4('0x7e')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1c39b1('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xde2c=['agents','updateStatusRealtime','pause','QueuePause','error','username','ami\x20disconnected','join','pick','keys','action','Action','then','message','asterisk','Command','catch','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','omit','undefined','values','channels','length','isConnected','voicechannel','map','find','uniqueid','channel','format','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','campaigns','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','SIP','name','timers','timer'];(function(_0x469593,_0x2039b1){var _0x227b4b=function(_0x1494b0){while(--_0x1494b0){_0x469593['push'](_0x469593['shift']());}};_0x227b4b(++_0x2039b1);}(_0xde2c,0x7f));var _0xcde2=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xde2c[_0x19159a];return _0xa677f4;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var jayson=require(_0xcde2('0x2'));var schema=require(_0xcde2('0x3'));var moment=require(_0xcde2('0x4'));var config=require(_0xcde2('0x5'));var properties=require(_0xcde2('0x6'));var ami=require(_0xcde2('0x7'));exports['listen']=function(_0x4353c8,_0x196898,_0x141f4b){return new Promise(function(_0x1398de,_0x401b16){var _0x53c558={'QueuePause':function(_0x2b27ef){return new Promise(function(_0x385e83){var _0x9c7036=util['format']('%s/%s',_0xcde2('0x8'),_0x2b27ef[_0xcde2('0x9')]);if(_0x4353c8['timers']&&_0x4353c8[_0xcde2('0xa')][_0x9c7036]&&_0x4353c8[_0xcde2('0xa')][_0x9c7036][_0xcde2('0xb')]){_0x4353c8[_0xcde2('0xa')][_0x9c7036]['updateAcw']();}if(_0x4353c8['agents'][_0x9c7036]){_0x4353c8[_0xcde2('0xc')][_0x9c7036][_0xcde2('0xd')]({'statePause':_0x2b27ef[_0xcde2('0xe')]?!![]:![]});}_0x385e83({'code':0xc8,'message':_0xcde2('0xf')});});},'Reload':function(_0x932b90){var _0x1ea4bb=this;return new Promise(function(_0x599294,_0x211215){if(ami['isConnected']()==![]){return _0x211215(_0x1ea4bb[_0xcde2('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xcde2('0x11')],_0xcde2('0x12')][_0xcde2('0x13')]('\x20')));}_0x932b90=_[_0xcde2('0x14')](_0x932b90,_[_0xcde2('0x15')](properties['module']));_0x932b90[_0xcde2('0x16')]='Reload';return ami[_0xcde2('0x17')](_0x932b90)[_0xcde2('0x18')](function(_0xbade43){_0x599294({'code':0xc8,'message':_0xbade43[_0xcde2('0x19')]});})['catch'](function(_0x4fd5aa){_0x211215(_0x1ea4bb['error'](0x1f5,_0x4fd5aa[_0xcde2('0x19')]));});});},'Command':function(_0x582e84){var _0x285ac7=this;return new Promise(function(_0x6cda4e,_0x252372){if(ami['isConnected']()==![]){return _0x252372(_0x285ac7[_0xcde2('0x10')](0x1f4,[config[_0xcde2('0x1a')]['ip'],config[_0xcde2('0x1a')][_0xcde2('0x11')],_0xcde2('0x12')]['join']('\x20')));}_0x582e84=_['pick'](_0x582e84,'command');_0x582e84[_0xcde2('0x16')]=_0xcde2('0x1b');return ami[_0xcde2('0x17')](_0x582e84)[_0xcde2('0x18')](function(_0xc86374){_0x6cda4e({'code':0xc8,'message':_0xc86374['content']});})[_0xcde2('0x1c')](function(_0x52368b){_0x252372(_0x285ac7[_0xcde2('0x10')](0x1f5,_0x52368b[_0xcde2('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x26d18e){var _0x48b598=[];for(var _0x593aa4 in _0x4353c8[_0xcde2('0x1d')]){if(_0x4353c8[_0xcde2('0x1d')][_0xcde2('0x1e')](_0x593aa4)){var _0x217ec9=_0x4353c8[_0xcde2('0x1d')][_0x593aa4];var _0x5a5b92={'id':_0x217ec9['id'],'name':_0x217ec9[_0xcde2('0x9')],'strategy':_0x217ec9[_0xcde2('0x1f')],'answered':_0x217ec9[_0xcde2('0x20')],'available':_0x217ec9['available'],'loggedIn':_0x217ec9[_0xcde2('0x21')],'pTalking':_0x217ec9[_0xcde2('0x22')],'sumBillable':_0x217ec9[_0xcde2('0x23')],'sumDuration':_0x217ec9[_0xcde2('0x24')],'sumHoldTime':_0x217ec9[_0xcde2('0x25')]||0x0,'talking':_0x217ec9[_0xcde2('0x26')],'total':_0x217ec9[_0xcde2('0x27')],'type':_0x217ec9[_0xcde2('0x28')],'unmanaged':_0x217ec9['unmanaged'],'abandoned':_0x217ec9[_0xcde2('0x29')],'waiting':_0x217ec9['waiting'],'loggedInDb':_0x217ec9[_0xcde2('0x2a')]};if(_0x217ec9[_0xcde2('0x28')]===_0xcde2('0x2b')){_0x5a5b92['dialActive']=_0x217ec9[_0xcde2('0x2c')];_0x5a5b92[_0xcde2('0x2d')]=_0x217ec9['dialMethod'];_0x5a5b92[_0xcde2('0x2e')]=_0x217ec9[_0xcde2('0x2e')];_0x5a5b92[_0xcde2('0x2f')]=_0x217ec9[_0xcde2('0x2f')];_0x5a5b92[_0xcde2('0x30')]=_0x217ec9[_0xcde2('0x30')];_0x5a5b92[_0xcde2('0x31')]=_0x217ec9[_0xcde2('0x31')];_0x5a5b92['temp']=_0x217ec9[_0xcde2('0x32')];_0x5a5b92[_0xcde2('0x33')]=_0x217ec9[_0xcde2('0x33')];_0x5a5b92[_0xcde2('0x34')]=_0x217ec9['outboundAnswerCallsDay'];_0x5a5b92[_0xcde2('0x35')]=_0x217ec9[_0xcde2('0x35')];_0x5a5b92[_0xcde2('0x36')]=_0x217ec9[_0xcde2('0x36')];_0x5a5b92['outboundCongestionCallsDay']=_0x217ec9[_0xcde2('0x37')];_0x5a5b92[_0xcde2('0x38')]=_0x217ec9[_0xcde2('0x38')];_0x5a5b92[_0xcde2('0x39')]=_0x217ec9['outboundDropCallsDayCallersExit'];_0x5a5b92[_0xcde2('0x3a')]=_0x217ec9[_0xcde2('0x3a')];_0x5a5b92[_0xcde2('0x3b')]=_0x217ec9[_0xcde2('0x3b')];_0x5a5b92[_0xcde2('0x3c')]=_0x217ec9['outboundNoSuchCallsDay'];_0x5a5b92[_0xcde2('0x3d')]=_0x217ec9[_0xcde2('0x3d')];_0x5a5b92[_0xcde2('0x3e')]=_0x217ec9[_0xcde2('0x3e')];_0x5a5b92['outboundRejectCallsDay']=_0x217ec9['outboundRejectCallsDay'];_0x5a5b92[_0xcde2('0x3f')]=_0x217ec9[_0xcde2('0x3f')];_0x5a5b92[_0xcde2('0x40')]=_0x217ec9[_0xcde2('0x40')];_0x5a5b92[_0xcde2('0x41')]=_0x217ec9[_0xcde2('0x41')];_0x5a5b92[_0xcde2('0x42')]=_0x217ec9[_0xcde2('0x42')];_0x5a5b92[_0xcde2('0x43')]=_0x217ec9['predictiveIntervalDroppedCallsCallersExit'];_0x5a5b92[_0xcde2('0x44')]=_0x217ec9[_0xcde2('0x44')];_0x5a5b92[_0xcde2('0x45')]=_0x217ec9[_0xcde2('0x45')];_0x5a5b92[_0xcde2('0x46')]=_0x217ec9['predictiveIntervalErlangCallsDroppedCalls'];_0x5a5b92['predictiveIntervalHitRate']=_0x217ec9[_0xcde2('0x47')];_0x5a5b92[_0xcde2('0x48')]=_0x217ec9[_0xcde2('0x48')];_0x5a5b92[_0xcde2('0x49')]=_0x217ec9[_0xcde2('0x49')];_0x5a5b92[_0xcde2('0x4a')]=_0x217ec9['predictiveIntervalAvailable'];_0x5a5b92['predictiveIntervalTotalCalls']=_0x217ec9['predictiveIntervalTotalCalls'];_0x5a5b92[_0xcde2('0x19')]=_0x217ec9[_0xcde2('0x19')];_0x5a5b92[_0xcde2('0x4b')]=_0x217ec9[_0xcde2('0x4b')];_0x5a5b92[_0xcde2('0x4c')]=_0x217ec9[_0xcde2('0x4c')];_0x5a5b92[_0xcde2('0x4d')]=_0x217ec9['erlangCallToSecond'];_0x5a5b92['erlangAbandonmentRate']=_0x217ec9[_0xcde2('0x4e')];_0x5a5b92['erlangBusyFactor']=_0x217ec9[_0xcde2('0x4f')];_0x5a5b92['startPredictive']=_0x217ec9[_0xcde2('0x50')];_0x5a5b92[_0xcde2('0x51')]=_0x217ec9[_0xcde2('0x51')];}if(_0x217ec9['Trunk']){_0x5a5b92[_0xcde2('0x52')]={'id':_0x217ec9['Trunk']['id'],'name':_0x217ec9[_0xcde2('0x52')][_0xcde2('0x9')],'active':_0x217ec9[_0xcde2('0x52')][_0xcde2('0x53')],'callerid':_0x217ec9[_0xcde2('0x52')][_0xcde2('0x54')]};}if(_0x217ec9['Interval']){_0x5a5b92['Interval']={'id':_0x217ec9[_0xcde2('0x55')]['id'],'name':_0x217ec9['Interval']['name']};}_0x48b598[_0xcde2('0x56')](_0x5a5b92);}}_0x26d18e({'count':_0x48b598['length'],'rows':_0x48b598});});},'UpdateVoiceQueue':function(_0x243278){return new Promise(function(_0x2e99c8,_0x569d44){var _0x4387bd=_['find'](_0x4353c8['voiceQueues'],{'id':parseInt(_0x243278['id'])});var _0x7e4a5e=_[_0xcde2('0x57')](_0x243278,['id']);if(_0x4387bd){for(var _0x4fc9d5 in _0x7e4a5e){if(typeof _0x7e4a5e[_0x4fc9d5]!==_0xcde2('0x58')&&typeof _0x4387bd[_0x4fc9d5]!=='undefined'){_0x4387bd[_0x4fc9d5]=_0x7e4a5e[_0x4fc9d5];}}_0x2e99c8(_0x4387bd);}else{_0x569d44();}});},'VoiceChannels':function(){return new Promise(function(_0x41f1e5){var _0x59129=_[_0xcde2('0x59')](_0x4353c8[_0xcde2('0x5a')]);_0x41f1e5({'count':_0x59129[_0xcde2('0x5b')],'rows':_0x59129});});},'VoiceChannelMixMonitor':function(_0x4b66d6){var _0x18526c=this;return new Promise(function(_0x3e4fc0,_0x40d14b){if(ami[_0xcde2('0x5c')]()==![]){return _0x40d14b(_0x18526c['error'](0x1f4,[config['asterisk']['ip'],config[_0xcde2('0x1a')]['username'],_0xcde2('0x12')][_0xcde2('0x13')]('\x20')));}var _0x381bd4=schema(properties[_0xcde2('0x5d')])[_0xcde2('0x3')](_0x4b66d6);if(_0x381bd4[_0xcde2('0x5b')]>0x0){return _0x40d14b(_0x18526c['error'](0x1f4,_[_0xcde2('0x5e')](_0x381bd4,'message')[_0xcde2('0x13')](',\x20')));}var _0x5d4969=_[_0xcde2('0x5f')](_0x4353c8[_0xcde2('0x5a')],{'uniqueid':_0x4b66d6[_0xcde2('0x60')]});if(_0x5d4969&&_0x5d4969[_0xcde2('0x61')]){var _0x446cf0=util[_0xcde2('0x62')]('%s.%s',_0x4b66d6[_0xcde2('0x63')]||_0x4b66d6['uniqueid'],_0x4b66d6[_0xcde2('0x62')]||_0xcde2('0x64'));return ami[_0xcde2('0x17')]({'action':_0xcde2('0x65'),'channel':_0x5d4969[_0xcde2('0x61')],'file':_0x446cf0,'options':_0xcde2('0x66')})[_0xcde2('0x18')](function(_0x28bd25){var _0x373cdc=_[_0xcde2('0x5f')](_0x5d4969[_0xcde2('0x67')],{'filename':_0xcde2('0x68')+_0x446cf0['toLowerCase']()});if(_['isNil'](_0x373cdc)){_0x5d4969['monitors'][_0xcde2('0x56')]({'filename':'/var/spool/asterisk/monitor/'+_0x446cf0[_0xcde2('0x69')](),'createdAt':moment()[_0xcde2('0x62')](_0xcde2('0x6a')),'mixmonitorid':_0x28bd25['mixmonitorid'],'status':_0xcde2('0x6b')});}else{_0x373cdc['mixmonitorid']=_0x28bd25[_0xcde2('0x6c')];_0x373cdc['status']=_0xcde2('0x6b');}_0x3e4fc0({'code':0xc8,'message':[_0x4b66d6[_0xcde2('0x60')],'MixMonitor\x20Success',_0x28bd25[_0xcde2('0x6c')]]['join']('\x20'),'mixmonitorid':_0x28bd25['mixmonitorid']});})[_0xcde2('0x1c')](function(_0x2ef935){_0x40d14b(_0x18526c[_0xcde2('0x10')](0x1f5,[_0x4b66d6[_0xcde2('0x60')],_0x2ef935[_0xcde2('0x19')][_0xcde2('0x69')]()]['join']('\x20')));});}else{return _0x40d14b(_0x18526c[_0xcde2('0x10')](0x1f5,_0xcde2('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x21b4e6){var _0x145b4a=this;return new Promise(function(_0x349818,_0x541a70){if(ami['isConnected']()==![]){return _0x541a70(_0x145b4a['error'](0x1f4,[config[_0xcde2('0x1a')]['ip'],config[_0xcde2('0x1a')][_0xcde2('0x11')],_0xcde2('0x12')]['join']('\x20')));}var _0x446765=schema(properties[_0xcde2('0x5d')])[_0xcde2('0x3')](_0x21b4e6);if(_0x446765[_0xcde2('0x5b')]>0x0){return _0x541a70(_0x145b4a[_0xcde2('0x10')](0x1f4,_[_0xcde2('0x5e')](_0x446765,'message')[_0xcde2('0x13')](',\x20')));}var _0x3b9e2d=_['find'](_0x4353c8[_0xcde2('0x5a')],{'uniqueid':_0x21b4e6[_0xcde2('0x60')]});if(_0x3b9e2d){return Promise[_0xcde2('0x6e')]()[_0xcde2('0x18')](function(){if(_0x3b9e2d[_0xcde2('0x61')]){return ami[_0xcde2('0x17')]({'action':_0xcde2('0x6f'),'channel':_0x3b9e2d[_0xcde2('0x61')],'mixmonitorid':_0x21b4e6[_0xcde2('0x6c')]})[_0xcde2('0x1c')](function(){});}})['then'](function(){if(_0x3b9e2d[_0xcde2('0x70')]){return ami[_0xcde2('0x17')]({'action':'StopMixMonitor','channel':_0x3b9e2d[_0xcde2('0x70')],'mixmonitorid':_0x21b4e6[_0xcde2('0x6c')]})[_0xcde2('0x1c')](function(){});}})['then'](function(){var _0x1efcbd=_[_0xcde2('0x5f')](_0x3b9e2d[_0xcde2('0x67')],{'mixmonitorid':_0x21b4e6[_0xcde2('0x6c')]});if(_0x1efcbd){_0x1efcbd[_0xcde2('0x71')]=_0xcde2('0x72');}})[_0xcde2('0x18')](function(){var _0x45bd76=util[_0xcde2('0x62')](_0xcde2('0x73'),_0x21b4e6[_0xcde2('0x63')]||_0x21b4e6['uniqueid'],_0x21b4e6['format']||_0xcde2('0x64'));var _0xd28773=_[_0xcde2('0x5f')](_0x3b9e2d['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x45bd76['toLowerCase']()});if(_0xd28773){_0xd28773[_0xcde2('0x71')]=_0xcde2('0x72');}})[_0xcde2('0x18')](function(){_0x349818({'code':0xc8,'message':[_0x21b4e6[_0xcde2('0x60')],_0xcde2('0x74')][_0xcde2('0x13')]('\x20')});})['catch'](function(_0x4ad98c){_0x541a70(_0x145b4a[_0xcde2('0x10')](0x1f5,[_0x21b4e6[_0xcde2('0x60')],_0x4ad98c[_0xcde2('0x19')][_0xcde2('0x69')]()][_0xcde2('0x13')]('\x20')));});}else{return _0x541a70(_0x145b4a[_0xcde2('0x10')](0x1f5,_0xcde2('0x6d')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x31234a){var _0x3f0b7c=_[_0xcde2('0x59')](_0x4353c8[_0xcde2('0x75')]);_0x31234a({'count':_0x3f0b7c[_0xcde2('0x5b')],'rows':_0x3f0b7c});});},'VoiceQueuesChannel':function(_0xa71d46){var _0x16b6b3=this;return new Promise(function(_0x3f46ca,_0xb5e3){var _0x3cf1aa=schema(properties[_0xcde2('0x76')])[_0xcde2('0x3')](_0xa71d46);if(_0x3cf1aa[_0xcde2('0x5b')]>0x0){return _0xb5e3(_0x16b6b3['error'](0x1f4,_[_0xcde2('0x5e')](_0x3cf1aa,_0xcde2('0x19'))[_0xcde2('0x13')](',\x20')));}var _0x36ee59=_[_0xcde2('0x5f')](_0x4353c8['queueChannels'],{'uniqueid':_0xa71d46[_0xcde2('0x60')]});if(_0x36ee59){_0x3f46ca(_0x36ee59);}else{return _0xb5e3(_0x16b6b3['error'](0x1f5,_0xcde2('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x1b8246){var _0x171cee=this;return new Promise(function(_0x34d66d,_0x31815f){if(ami[_0xcde2('0x5c')]()==![]){return _0x31815f(_0x171cee[_0xcde2('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xcde2('0x11')],'ami\x20disconnected'][_0xcde2('0x13')]('\x20')));}var _0x160ea9=schema(properties[_0xcde2('0x77')])[_0xcde2('0x3')](_0x1b8246);if(_0x160ea9[_0xcde2('0x5b')]>0x0){return _0x31815f(_0x171cee[_0xcde2('0x10')](0x1f4,_[_0xcde2('0x5e')](_0x160ea9,'message')[_0xcde2('0x13')](',\x20')));}var _0x1822b0=_[_0xcde2('0x5f')](_0x4353c8[_0xcde2('0x75')],{'uniqueid':_0x1b8246['uniqueid']});if(_0x1822b0&&_0x1822b0[_0xcde2('0x61')]){return ami[_0xcde2('0x17')]({'action':_0xcde2('0x78'),'channel':_0x1822b0[_0xcde2('0x61')]})[_0xcde2('0x18')](function(_0x2c3ce0){_0x34d66d({'code':0xc8,'message':[_0x1b8246[_0xcde2('0x60')],_0x2c3ce0[_0xcde2('0x19')][_0xcde2('0x69')]()][_0xcde2('0x13')]('\x20')});})[_0xcde2('0x1c')](function(_0x225ddd){_0x31815f(_0x171cee[_0xcde2('0x10')](0x1f5,[_0x1b8246['uniqueid'],_0x225ddd[_0xcde2('0x19')][_0xcde2('0x69')]()][_0xcde2('0x13')]('\x20')));});}else{return _0x31815f(_0x171cee[_0xcde2('0x10')](0x1f5,_0xcde2('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x388558){var _0x42493d=this;return new Promise(function(_0x9ed7e6,_0x422fec){if(ami[_0xcde2('0x5c')]()==![]){return _0x422fec(_0x42493d[_0xcde2('0x10')](0x1f4,[config[_0xcde2('0x1a')]['ip'],config[_0xcde2('0x1a')][_0xcde2('0x11')],_0xcde2('0x12')][_0xcde2('0x13')]('\x20')));}var _0x5c63d9=schema(properties['voicequeuechannelredirect'])[_0xcde2('0x3')](_0x388558);if(_0x5c63d9[_0xcde2('0x5b')]>0x0){return _0x422fec(_0x42493d[_0xcde2('0x10')](0x1f4,_[_0xcde2('0x5e')](_0x5c63d9,'message')[_0xcde2('0x13')](',\x20')));}var _0x5dbcc1=_[_0xcde2('0x5f')](_0x4353c8['queueChannels'],{'uniqueid':_0x388558[_0xcde2('0x60')]});if(_0x5dbcc1&&_0x5dbcc1[_0xcde2('0x61')]){return ami['Action']({'action':_0xcde2('0x79'),'channel':_0x5dbcc1[_0xcde2('0x61')],'exten':_0x388558[_0xcde2('0x7a')],'context':_0x388558['context']||_0x5dbcc1[_0xcde2('0x7b')],'priority':0x1})[_0xcde2('0x18')](function(_0x35db40){_0x9ed7e6({'code':0xc8,'message':[_0x388558[_0xcde2('0x60')],_0x35db40['message']['toLowerCase']()][_0xcde2('0x13')]('\x20')});})[_0xcde2('0x1c')](function(_0x399c47){_0x422fec(_0x42493d[_0xcde2('0x10')](0x1f5,[_0x388558[_0xcde2('0x60')],_0x399c47[_0xcde2('0x19')]['toLowerCase']()][_0xcde2('0x13')]('\x20')));});}else{return _0x422fec(_0x42493d[_0xcde2('0x10')](0x1f5,_0xcde2('0x6d')));}});},'Agents':function(_0x299987){return new Promise(function(_0x24e5cf){var _0x1a32c1=_[_0xcde2('0x59')](_0x4353c8['agents']);if(_0x299987&&_0x299987['id']){var _0x340b52=_[_0xcde2('0x5f')](_0x1a32c1,function(_0x4e711f){return _0x4e711f['id']===_0x299987['id'];});_0x24e5cf(_0x340b52);}else{_0x24e5cf({'count':_0x1a32c1[_0xcde2('0x5b')],'rows':_0x1a32c1});}});},'Telephones':function(){return new Promise(function(_0x43e293){var _0x2b4b1f=_['values'](_0x4353c8[_0xcde2('0x7c')]);_0x43e293({'count':_0x2b4b1f[_0xcde2('0x5b')],'rows':_0x2b4b1f});});},'Trunks':function(){return new Promise(function(_0x482093){var _0x4a8e17=_['values'](_0x4353c8[_0xcde2('0x7d')]);_0x482093({'count':_0x4a8e17[_0xcde2('0x5b')],'rows':_0x4a8e17});});},'OutboundChannels':function(){return new Promise(function(_0x5acf6e){var _0x12b989=_['values'](_0x4353c8['outboundChannels']);_0x5acf6e({'count':_0x12b989[_0xcde2('0x5b')],'rows':_0x12b989});});},'Outbound':function(){return new Promise(function(_0x243504){_0x243504(_0x4353c8[_0xcde2('0x2b')]);});},'Campaigns':function(){return new Promise(function(_0x5ecb90){var _0x19d950=_[_0xcde2('0x59')](_0x4353c8[_0xcde2('0x7e')]);_0x5ecb90({'count':_0x19d950[_0xcde2('0x5b')],'rows':_0x19d950});});},'VoiceQueuesPreview':function(_0x372567){var _0x191ee9=this;return new Promise(function(_0x44e249,_0x540673){_0x196898['run'](_0x372567['id'])[_0xcde2('0x18')](function(_0x2103c9){_0x44e249({'code':0xc8,'message':_0x2103c9[_0xcde2('0x19')]});})[_0xcde2('0x1c')](function(_0x45c6f2){_0x540673(_0x191ee9['error'](0x1f4,_0x45c6f2[_0xcde2('0x19')]));});});},'EventManager':function(_0x51bd42){var _0x5c4458=this;return new Promise(function(_0x34f517,_0x5aa5c9){if(!_0x51bd42['event']){return _0x5aa5c9(_0x5c4458[_0xcde2('0x10')](0x1f4,_0xcde2('0x7f')));}ami[_0xcde2('0x80')](_0xcde2('0x81')+_0x51bd42[_0xcde2('0x82')],_0x51bd42['message']);_0x34f517({'code':0xc8,'message':_0x51bd42});});},'FaxAccounts':function(){return new Promise(function(_0x44d0ad){var _0x562486=_[_0xcde2('0x59')](_0x4353c8[_0xcde2('0x83')]);_0x44d0ad({'count':_0x562486[_0xcde2('0x5b')],'rows':_0x562486});});},'SendFax':function(_0x135223){var _0x5130a5=this;return new Promise(function(_0x4a94ae,_0x4d14b1){_0x141f4b[_0xcde2('0x84')](_0x135223)['then'](function(_0x52e510){_0x4a94ae({'code':0xc8,'message':_0x52e510[_0xcde2('0x19')]});})[_0xcde2('0x1c')](function(_0x35fdca){_0x4d14b1(_0x5130a5[_0xcde2('0x10')](0x1f4,_0x35fdca[_0xcde2('0x19')]));});});},'CheckAfterSend':function(_0x7a6b89){var _0x236d70=this;return new Promise(function(_0x57598f,_0x170def){_0x141f4b[_0xcde2('0x85')](_0x7a6b89)[_0xcde2('0x18')](function(_0x4240a4){_0x57598f({'code':0xc8,'message':_0x4240a4[_0xcde2('0x19')]});})[_0xcde2('0x1c')](function(_0x89b2cc){_0x170def(_0x236d70['error'](0x1f4,_0x89b2cc[_0xcde2('0x19')]));});});}};var _0x51bdb2=jayson['server'](_0x53c558)[_0xcde2('0x86')]();_0x51bdb2['on'](_0xcde2('0x10'),function(_0x1de5cf){return _0x401b16(_0x1de5cf);});_0x51bdb2[_0xcde2('0x87')](0x232a,_0xcde2('0x88'),function(){console[_0xcde2('0x89')](_0xcde2('0x8a'),0x232a);return _0x1398de('RPC\x20listening\x20on\x20port:'+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 c861ca5..a7b73ae 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 _0xe3e7=['data3','split','$or','map','destcalleridnum','calleridnum','routeId','lastName','phone','fax','createdAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','firstName','calleridname','Unknown','destcalleridname','','resolve','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId'];(function(_0x36db13,_0x40a0d1){var _0x2324cc=function(_0x92b1ed){while(--_0x92b1ed){_0x36db13['push'](_0x36db13['shift']());}};_0x2324cc(++_0x40a0d1);}(_0xe3e7,0xe0));var _0x7e3e=function(_0x5d3fa7,_0x257518){_0x5d3fa7=_0x5d3fa7-0x0;var _0x191b15=_0xe3e7[_0x5d3fa7];return _0x191b15;};'use strict';var _=require(_0x7e3e('0x0'));var BPromise=require(_0x7e3e('0x1'));var Redis=require(_0x7e3e('0x2'));var util=require(_0x7e3e('0x3'));var config=require(_0x7e3e('0x4'));var logger=require(_0x7e3e('0x5'))(_0x7e3e('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0x7e3e('0x7')]=_[_0x7e3e('0x8')](config[_0x7e3e('0x7')],{'host':_0x7e3e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7e3e('0x7')]));function emit(_0x442a04,_0x3b8c71,_0xb2dd45,_0x8bc2ec,_0x230514){logger[_0x7e3e('0xa')](_0x7e3e('0xb'),_0x442a04,_0x3b8c71['id'],_0xb2dd45,_0x8bc2ec,JSON[_0x7e3e('0xc')](_0x230514));io['to'](_0xb2dd45)[_0x7e3e('0xd')](_0x8bc2ec,_0x230514);}exports[_0x7e3e('0xe')]=function(_0x47dabb,_0x352cbb,_0x5e9190,_0x2e3324){var _0x2f7285,_0x25cc03;var _0x45fb3b={};var _0x1c9308;var _0x5e2606=Number(_0x5e9190[_0x7e3e('0xf')]);var _0x575e65=_0x5e9190[_0x7e3e('0x10')]?Boolean(Number(_0x5e9190['data2'])):![];var _0x3005e9;var _0x58c0e2=![];if(!_['isNil'](_0x5e9190['data5'])){if(_0x5e9190[_0x7e3e('0x11')]=='1')_0x58c0e2=!![];}if(!_0x58c0e2){if(_0x2e3324['xmd-contactid']){_0x45fb3b['id']=_0x2e3324[_0x7e3e('0x12')];}}if(!_0x45fb3b['id']){_0x45fb3b[_0x7e3e('0x13')]=_0x5e2606;_0x3005e9=_0x5e9190[_0x7e3e('0x14')]&&_0x5e9190[_0x7e3e('0x14')]!=='0'?_0x5e9190[_0x7e3e('0x14')][_0x7e3e('0x15')](','):['phone'];_0x45fb3b[_0x7e3e('0x16')]=_[_0x7e3e('0x17')](_0x3005e9,function(_0x4cbb94){var _0x531bec={};_0x531bec[_0x4cbb94]=_0x2e3324['routeId']?_0x2e3324[_0x7e3e('0x18')]:_0x2e3324[_0x7e3e('0x19')];return _0x531bec;});_0x1c9308=_0x2e3324[_0x7e3e('0x1a')]?_0x2e3324[_0x7e3e('0x18')]:_0x2e3324[_0x7e3e('0x19')];}var _0x3c248b=['id','firstName',_0x7e3e('0x1b'),_0x7e3e('0x1c'),'mobile',_0x7e3e('0x1d'),_0x7e3e('0x13'),_0x7e3e('0x1e'),'scheduledAt',_0x7e3e('0x1f')];var _0x18d1a9=_[_0x7e3e('0x20')](_0x3c248b,_0x3005e9);BPromise['resolve']()[_0x7e3e('0x21')](cmContactRpc[_0x7e3e('0x22')]({'attributes':_0x18d1a9,'where':_0x45fb3b,'phone':_0x1c9308}))['then'](function(_0x5ac501){_0x25cc03=_0x5ac501;if(!_[_0x7e3e('0x23')](_0x25cc03)){if(_0x25cc03[_0x7e3e('0x24')]===0x1){_0x2f7285=_0x25cc03[0x0];logger[_0x7e3e('0xa')](_0x7e3e('0x25'),_0x2e3324[_0x7e3e('0x26')],_0x352cbb['id'],_0x2f7285['id']);}else{logger[_0x7e3e('0xa')](_0x7e3e('0x27'),_0x2e3324[_0x7e3e('0x26')],_0x352cbb['id'],_['map'](_0x25cc03,'id')[_0x7e3e('0x28')](','));}return;}else{logger[_0x7e3e('0xa')](_0x7e3e('0x29'),_0x2e3324['uniqueid'],_0x352cbb['id']);var _0x33d19b={'ListId':_0x5e2606};var _0xbb0022=_0x5e9190[_0x7e3e('0x2a')]&&_0x5e9190[_0x7e3e('0x2a')]!=='0'?_0x5e9190['data4']:_0x7e3e('0x1c');if(_0x575e65){logger[_0x7e3e('0xa')](_0x7e3e('0x2b'),_0x2e3324['uniqueid'],_0x352cbb['id']);_0x33d19b[_0xbb0022]=_['isNil'](_0x2e3324[_0x7e3e('0x1a')])?_0x2e3324[_0x7e3e('0x19')]:_0x2e3324[_0x7e3e('0x18')];if(_[_0x7e3e('0x2c')](_0x2e3324['routeId'])){_0x33d19b[_0x7e3e('0x2d')]=_0x2e3324[_0x7e3e('0x2e')]&&_0x2e3324[_0x7e3e('0x2e')]!==''?_0x2e3324[_0x7e3e('0x2e')]:_0x7e3e('0x2f');}else{_0x33d19b[_0x7e3e('0x2d')]=_0x2e3324[_0x7e3e('0x30')]&&_0x2e3324[_0x7e3e('0x30')]!==_0x7e3e('0x31')?_0x2e3324[_0x7e3e('0x30')]:_0x7e3e('0x2f');}return BPromise[_0x7e3e('0x32')]()[_0x7e3e('0x21')](cmContactRpc['createContact'](_0x33d19b))[_0x7e3e('0x21')](function(_0xa9b8d3){_0x2f7285=_0xa9b8d3;_0x25cc03[_0x7e3e('0x33')](_0xa9b8d3);if(_0x2f7285){logger[_0x7e3e('0xa')](_0x7e3e('0x34'),_0x2e3324[_0x7e3e('0x26')],_0x352cbb['id'],_0x2f7285['id']);}return;});}else{logger[_0x7e3e('0xa')](_0x7e3e('0x35'),_0x2e3324[_0x7e3e('0x26')],_0x352cbb['id']);_0x33d19b[_0xbb0022]=_[_0x7e3e('0x2c')](_0x2e3324['routeId'])?_0x2e3324['calleridnum']:_0x2e3324['destcalleridnum'];if(_[_0x7e3e('0x2c')](_0x2e3324[_0x7e3e('0x1a')])){_0x33d19b[_0x7e3e('0x2d')]=_0x2e3324['calleridname']&&_0x2e3324['calleridname']!==''?_0x2e3324['calleridname']:_0x7e3e('0x2f');}else{_0x33d19b[_0x7e3e('0x2d')]=_0x2e3324[_0x7e3e('0x30')]&&_0x2e3324[_0x7e3e('0x30')]!==_0x7e3e('0x31')?_0x2e3324[_0x7e3e('0x30')]:_0x7e3e('0x2f');}_0x2f7285=_0x33d19b;_0x25cc03['push'](_0x33d19b);return;}}})[_0x7e3e('0x21')](function(){if(_0x47dabb){emit(_0x2e3324[_0x7e3e('0x26')],_0x352cbb,util[_0x7e3e('0x36')](_0x7e3e('0x37'),_0x47dabb[_0x7e3e('0x38')]),util[_0x7e3e('0x36')](_0x7e3e('0x39'),_0x5e9190[_0x7e3e('0x3a')][_0x7e3e('0x3b')]()),{'evt':_[_0x7e3e('0x3c')](_0x2e3324,{'autoCreate':_0x575e65}),'contact':_0x2f7285===undefined?{}:_0x2f7285,'contacts':_0x25cc03[_0x7e3e('0x24')]===0x0?undefined:_0x25cc03});}});}; \ No newline at end of file +var _0x70de=['resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','name','format','trigger:%s','action','toLowerCase','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','createdAt','scheduledAt','updatedAt','union'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x70de,0xb3));var _0xe70d=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0x70de[_0x27bd2c];return _0x3784ea;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xe70d('0x0'));var util=require('util');var config=require(_0xe70d('0x1'));var logger=require(_0xe70d('0x2'))(_0xe70d('0x3'));var cmContactRpc=require(_0xe70d('0x4'));config['redis']=_[_0xe70d('0x5')](config[_0xe70d('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe70d('0x6')]));function emit(_0x4110d0,_0x4e87de,_0x2f8642,_0x35c75c,_0x28e73c){logger[_0xe70d('0x7')](_0xe70d('0x8'),_0x4110d0,_0x4e87de['id'],_0x2f8642,_0x35c75c,JSON[_0xe70d('0x9')](_0x28e73c));io['to'](_0x2f8642)['emit'](_0x35c75c,_0x28e73c);}exports[_0xe70d('0xa')]=function(_0x5190f7,_0x4c6860,_0x100a4b,_0x5c984b){var _0x5999d7,_0x328c4e;var _0x31ab32={};var _0x5d8dcb;var _0x261be9=Number(_0x100a4b[_0xe70d('0xb')]);var _0x411cca=_0x100a4b[_0xe70d('0xc')]?Boolean(Number(_0x100a4b[_0xe70d('0xc')])):![];var _0x47845b;var _0x121b1d=![];if(!_[_0xe70d('0xd')](_0x100a4b[_0xe70d('0xe')])){if(_0x100a4b[_0xe70d('0xe')]=='1')_0x121b1d=!![];}if(!_0x121b1d){if(_0x5c984b['xmd-contactid']){_0x31ab32['id']=_0x5c984b[_0xe70d('0xf')];}}if(!_0x31ab32['id']){_0x31ab32[_0xe70d('0x10')]=_0x261be9;_0x47845b=_0x100a4b[_0xe70d('0x11')]&&_0x100a4b[_0xe70d('0x11')]!=='0'?_0x100a4b[_0xe70d('0x11')][_0xe70d('0x12')](','):[_0xe70d('0x13')];_0x31ab32[_0xe70d('0x14')]=_['map'](_0x47845b,function(_0x209c35){var _0x36e86a={};_0x36e86a[_0x209c35]=_0x5c984b[_0xe70d('0x15')]?_0x5c984b[_0xe70d('0x16')]:_0x5c984b[_0xe70d('0x17')];return _0x36e86a;});_0x5d8dcb=_0x5c984b[_0xe70d('0x15')]?_0x5c984b[_0xe70d('0x16')]:_0x5c984b[_0xe70d('0x17')];}var _0x48ddeb=['id','firstName',_0xe70d('0x18'),'phone','mobile','fax',_0xe70d('0x10'),_0xe70d('0x19'),_0xe70d('0x1a'),_0xe70d('0x1b')];var _0x1ac381=_[_0xe70d('0x1c')](_0x48ddeb,_0x47845b);BPromise[_0xe70d('0x1d')]()[_0xe70d('0x1e')](cmContactRpc[_0xe70d('0x1f')]({'attributes':_0x1ac381,'where':_0x31ab32,'phone':_0x5d8dcb}))['then'](function(_0x554122){_0x328c4e=_0x554122;if(!_[_0xe70d('0x20')](_0x328c4e)){if(_0x328c4e[_0xe70d('0x21')]===0x1){_0x5999d7=_0x328c4e[0x0];logger[_0xe70d('0x7')](_0xe70d('0x22'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id'],_0x5999d7['id']);}else{logger['info'](_0xe70d('0x24'),_0x5c984b['uniqueid'],_0x4c6860['id'],_['map'](_0x328c4e,'id')['join'](','));}return;}else{logger[_0xe70d('0x7')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x5c984b['uniqueid'],_0x4c6860['id']);var _0x23566f={'ListId':_0x261be9};var _0x5ced6c=_0x100a4b[_0xe70d('0x25')]&&_0x100a4b[_0xe70d('0x25')]!=='0'?_0x100a4b[_0xe70d('0x25')]:_0xe70d('0x13');if(_0x411cca){logger[_0xe70d('0x7')](_0xe70d('0x26'),_0x5c984b['uniqueid'],_0x4c6860['id']);_0x23566f[_0x5ced6c]=_['isNil'](_0x5c984b['routeId'])?_0x5c984b[_0xe70d('0x17')]:_0x5c984b['destcalleridnum'];if(_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])){_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x28')]&&_0x5c984b[_0xe70d('0x28')]!==_0xe70d('0x29')?_0x5c984b[_0xe70d('0x28')]:_0xe70d('0x2a');}else{_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x2b')]&&_0x5c984b[_0xe70d('0x2b')]!==''?_0x5c984b[_0xe70d('0x2b')]:_0xe70d('0x2a');}return BPromise[_0xe70d('0x1d')]()['then'](cmContactRpc['createContact'](_0x23566f))[_0xe70d('0x1e')](function(_0x44921d){_0x5999d7=_0x44921d;_0x328c4e[_0xe70d('0x2c')](_0x44921d);if(_0x5999d7){logger[_0xe70d('0x7')](_0xe70d('0x2d'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id'],_0x5999d7['id']);}return;});}else{logger[_0xe70d('0x7')](_0xe70d('0x2e'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id']);_0x23566f[_0x5ced6c]=_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])?_0x5c984b[_0xe70d('0x17')]:_0x5c984b[_0xe70d('0x16')];if(_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])){_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x28')]&&_0x5c984b[_0xe70d('0x28')]!==_0xe70d('0x29')?_0x5c984b[_0xe70d('0x28')]:_0xe70d('0x2a');}else{_0x23566f['firstName']=_0x5c984b['destcalleridname']&&_0x5c984b[_0xe70d('0x2b')]!==''?_0x5c984b[_0xe70d('0x2b')]:_0xe70d('0x2a');}_0x5999d7=_0x23566f;_0x328c4e['push'](_0x23566f);return;}}})[_0xe70d('0x1e')](function(){if(_0x5190f7){emit(_0x5c984b['uniqueid'],_0x4c6860,util['format']('user:%s',_0x5190f7[_0xe70d('0x2f')]),util[_0xe70d('0x30')](_0xe70d('0x31'),_0x100a4b[_0xe70d('0x32')][_0xe70d('0x33')]()),{'evt':_['merge'](_0x5c984b,{'autoCreate':_0x411cca}),'contact':_0x5999d7===undefined?{}:_0x5999d7,'contacts':_0x328c4e[_0xe70d('0x21')]===0x0?undefined:_0x328c4e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 6198c86..dbd0c3f 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 _0x444e=['socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','stringify','prototype','clone','motionChannel','undefined','checkTriggers','interface','hasOwnProperty','status','checkTrigger','variables','Actions','length','action','toLowerCase','data1','popup','TemplateId','data2','render','html','template\x20not\x20found','uri','buildUri','data3','isNil','data4','location','windowWidth','data5','800','windowHeight','600','data6','format','user:%s','name','merge','trigger:%s','exec','integration','routeId','urlforward','parse','query','replace','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','ChatWebsiteId','operator','upperFirst','value','interaction','message','event','queue','agent','membername','lastevent','mailSubstatus','null','substatus','equals','exports','util','url','ioredis','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x444e,0xe8));var _0xe444=function(_0x3b2e08,_0x271a29){_0x3b2e08=_0x3b2e08-0x0;var _0x4036e6=_0x444e[_0x3b2e08];return _0x4036e6;};'use strict';var util=require(_0xe444('0x0'));var _=require('lodash');var url=require(_0xe444('0x1'));var Mustache=require('mustache');var Redis=require(_0xe444('0x2'));var urlforward=require('./urlforward');var integration=require(_0xe444('0x3'));var cmContact=require('./cmContact');var script=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var logger=require(_0xe444('0x6'))(_0xe444('0x7'));var ami=require(_0xe444('0x8'));config[_0xe444('0x9')]=_['defaults'](config[_0xe444('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe444('0xa'))(new Redis(config['redis']));var operators={'equals':function(_0x3199dd,_0x4b5e34){return _0x3199dd==_0x4b5e34;},'not_equals':function(_0x40a368,_0x48907b){return _0x40a368!=_0x48907b;}};var barAndWebActions=['popup',_0xe444('0x1'),_0xe444('0xb')];function Trigger(_0x5e53cb){this[_0xe444('0xc')]=_0x5e53cb['triggers'];this['agents']=_0x5e53cb[_0xe444('0xd')];this['voiceQueues']=_0x5e53cb[_0xe444('0xe')];this[_0xe444('0xf')]=_0x5e53cb['templates'];this[_0xe444('0x10')]=_0x5e53cb['voiceExtensions'];this['zendeskAccounts']=_0x5e53cb[_0xe444('0x11')];this[_0xe444('0x12')]=_0x5e53cb['freshdeskAccounts'];this[_0xe444('0x13')]=_0x5e53cb['salesforceAccounts'];this[_0xe444('0x14')]=_0x5e53cb[_0xe444('0x14')];this[_0xe444('0x15')]=_0x5e53cb[_0xe444('0x15')];this[_0xe444('0x16')]=_0x5e53cb[_0xe444('0x16')];this[_0xe444('0x17')]=_0x5e53cb[_0xe444('0x17')];this[_0xe444('0x18')]=_0x5e53cb[_0xe444('0x18')];this[_0xe444('0x19')]=_0x5e53cb[_0xe444('0x19')];this[_0xe444('0x1a')]=_0x5e53cb['freshsalesAccounts'];this[_0xe444('0x1b')]={'zendesk':this[_0xe444('0x11')],'salesforce':this[_0xe444('0x13')],'freshdesk':this[_0xe444('0x12')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xe444('0x15')],'desk':this[_0xe444('0x16')],'vtiger':this[_0xe444('0x17')],'dynamics365':this[_0xe444('0x19')],'freshsales':this[_0xe444('0x1a')],'servicenow':this['servicenowAccounts']};ami['on'](_0xe444('0x1c'),this[_0xe444('0x1d')]['bind'](this));ami['on'](_0xe444('0x1e'),this['syncCustomEvent'][_0xe444('0x1f')](this));ami['on'](_0xe444('0x20'),this[_0xe444('0x1d')][_0xe444('0x1f')](this));ami['on'](_0xe444('0x21'),this['syncCustomEvent']['bind'](this));ami['on'](_0xe444('0x22'),this[_0xe444('0x1d')][_0xe444('0x1f')](this));ami['on'](_0xe444('0x23'),this[_0xe444('0x1d')]['bind'](this));ami['on'](_0xe444('0x24'),this[_0xe444('0x1d')]['bind'](this));ami['on'](_0xe444('0x25'),this[_0xe444('0x1d')][_0xe444('0x1f')](this));ami['on'](_0xe444('0x26'),this[_0xe444('0x1d')][_0xe444('0x1f')](this));ami['on'](_0xe444('0x27'),this['syncCustomEvent'][_0xe444('0x1f')](this));ami['on'](_0xe444('0x28'),this[_0xe444('0x1d')][_0xe444('0x1f')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0xe444('0x1f')](this));ami['on'](_0xe444('0x29'),this[_0xe444('0x2a')][_0xe444('0x1f')](this));ami['on']('custom:dialconnect',this[_0xe444('0x2a')][_0xe444('0x1f')](this));ami['on'](_0xe444('0x2b'),this[_0xe444('0x2a')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0xe444('0x1f')](this));ami['on'](_0xe444('0x2c'),this[_0xe444('0x1d')][_0xe444('0x1f')](this));ami['on'](_0xe444('0x2d'),this['syncCustomEvent'][_0xe444('0x1f')](this));ami['on'](_0xe444('0x2e'),this[_0xe444('0x1d')]['bind'](this));ami['on'](_0xe444('0x2f'),this['syncCustomEvent']['bind'](this));ami['on'](_0xe444('0x30'),this[_0xe444('0x1d')]['bind'](this));ami['on'](_0xe444('0x31'),this['syncCustomEvent'][_0xe444('0x1f')](this));ami['on']('custom:offlineMessage',this['syncCustomEvent'][_0xe444('0x1f')](this));}Trigger['prototype'][_0xe444('0x32')]=function(_0xa4ed6,_0x9151ca,_0x265882){logger['info'](_0xa4ed6,_0x9151ca,JSON[_0xe444('0x33')](_0x265882));io['to'](_0xa4ed6)[_0xe444('0x32')](_0x9151ca,_0x265882);};Trigger[_0xe444('0x34')]['syncCustomEvent']=function(_0x16fffe){var _0x4843d7=_[_0xe444('0x35')](_0x16fffe);if(typeof _0x4843d7[_0xe444('0x36')]===_0xe444('0x37')){_0x4843d7['motionChannel']='voice';}this[_0xe444('0x38')](_0x4843d7);};Trigger[_0xe444('0x34')][_0xe444('0x2a')]=function(_0x238b2b){if(this[_0xe444('0xd')][_0x238b2b[_0xe444('0x39')]]){this[_0xe444('0x1d')](_0x238b2b);}};Trigger['prototype']['checkTriggers']=function(_0x435240){var _0x495c9d;for(var _0x2df0a2 in this['triggers']){if(this[_0xe444('0xc')][_0xe444('0x3a')](_0x2df0a2)){if(this[_0xe444('0xc')][_0x2df0a2][_0xe444('0x3b')]){_0x495c9d=this[_0xe444('0x3c')](this[_0xe444('0xc')][_0x2df0a2],_0x435240);if(_0x495c9d){_['merge'](_0x435240,_0x435240[_0xe444('0x3d')]);for(var _0x3039ce=0x0,_0x106f5a,_0x402cbf,_0x535b99;_0x3039ce0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','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','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x1a8239,_0x1795e3){var _0x557b6=function(_0x33533a){while(--_0x33533a){_0x1a8239['push'](_0x1a8239['shift']());}};_0x557b6(++_0x1795e3);}(_0x814b,0x1a2));var _0xb814=function(_0x2095ed,_0x156cfb){_0x2095ed=_0x2095ed-0x0;var _0x22dbb0=_0x814b[_0x2095ed];return _0x22dbb0;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index ac16971..757fed3 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 _0x33ea=['POST','getString','Subjects','/contacts(','phonecall','callDirection','queue','Descriptions','Fields','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%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]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','calleridnum',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','clientId','password','clientSecret','then','catch','toUpperCase','message','GET','Bearer\x20','value','isNil','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','username','outbound','destcalleridnum','/systemusers(','4.0','body','odata-entityid','substring','lastIndexOf','telephone1','\x20eq\x20\x27','replace','enduserId','contactid','nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','toLowerCase','indexOf','ticketType','incident'];(function(_0x1bef35,_0x47ebf4){var _0x28b83c=function(_0x4bb293){while(--_0x4bb293){_0x1bef35['push'](_0x1bef35['shift']());}};_0x28b83c(++_0x47ebf4);}(_0x33ea,0x1d0));var _0xa33e=function(_0x4530ee,_0x1e9861){_0x4530ee=_0x4530ee-0x0;var _0x4683be=_0x33ea[_0x4530ee];return _0x4683be;};'use strict';var _=require(_0xa33e('0x0'));var rp=require('request-promise');var util=require(_0xa33e('0x1'));var intUtil=require(_0xa33e('0x2'));var md5=require(_0xa33e('0x3'));var Redis=require(_0xa33e('0x4'));var logger=require(_0xa33e('0x5'))(_0xa33e('0x6'));var config=require(_0xa33e('0x7'));config[_0xa33e('0x8')]=_['defaults'](config[_0xa33e('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa33e('0x8')]));function getAuthToken(_0x319afe,_0x2ddc27,_0x41de5a){if(_0x319afe[_0xa33e('0x9')]){_0x319afe[_0xa33e('0xa')]=_0x319afe[_0xa33e('0xb')][_0xa33e('0xc')];_0x319afe[_0xa33e('0xd')]=_0x319afe['CloudProvider'][_0xa33e('0xe')];return Promise[_0xa33e('0xf')](_0x319afe['CloudProvider'][_0xa33e('0x10')]);}var _0x555bb5={'method':'POST','uri':_0x2ddc27,'form':{'client_id':_0x319afe[_0xa33e('0x11')],'resource':_0x319afe['remoteUri'],'username':_0x319afe['username'],'password':_0x319afe[_0xa33e('0x12')],'grant_type':_0xa33e('0x12'),'client_secret':_0x319afe[_0xa33e('0x13')]},'json':!![]};return rp(_0x555bb5)[_0xa33e('0x14')](function(_0x41e6a7){return _0x41e6a7['access_token'];})[_0xa33e('0x15')](function(_0x28f6a5){logger['error']('['+[_0x41de5a[_0xa33e('0x16')]()]+']\x20Wrong\x20credentials!');return _0x28f6a5[_0xa33e('0x17')];});}function getUser(_0x17646c,_0x4e830e,_0x308c96,_0x2f47a1,_0x2f6c48,_0xdffea8){return new Promise(function(_0x1ae050,_0x568dc7){return getAuthToken(_0x4e830e,_0x2f47a1,_0xdffea8)[_0xa33e('0x14')](function(_0x59bbec){var _0x3fc79f={'method':_0xa33e('0x18'),'uri':_0x2f6c48+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xa33e('0x19')+_0x59bbec,'OData-Version':'4.0'},'json':!![]};return rp(_0x3fc79f);})['then'](function(_0x75dc35){var _0x10dc58=_0x75dc35[_0xa33e('0x1a')];var _0x3aeb01=![];var _0x57f734=null;if(!_[_0xa33e('0x1b')](_0x308c96)){if(intUtil[_0xa33e('0x1c')](_0x308c96[_0xa33e('0x1d')])){_0x17646c['userEmail']=_0x308c96[_0xa33e('0x1d')];for(_0x57f734=0x0;_0x57f734<_0x10dc58['length'];_0x57f734++){if(_0x10dc58[_0x57f734][_0xa33e('0x1e')]===_0x308c96[_0xa33e('0x1d')]&&!_0x10dc58[_0x57f734][_0xa33e('0x1f')]){_0x3aeb01=!![];logger[_0xa33e('0x20')]('['+[_0xdffea8[_0xa33e('0x16')]()]+_0xa33e('0x21')+_0x10dc58[_0x57f734]['systemuserid']+'!');_0x17646c[_0xa33e('0x22')]=_0x10dc58[_0x57f734][_0xa33e('0x23')];}}}}if(!_0x3aeb01){logger[_0xa33e('0x20')]('['+[_0xdffea8[_0xa33e('0x16')]()]+_0xa33e('0x24'));_0x17646c['userEmail']=_0x4e830e['username'];for(_0x57f734=0x0;_0x57f734<_0x10dc58[_0xa33e('0x25')];_0x57f734++){if(_0x10dc58[_0x57f734]['internalemailaddress']===_0x4e830e[_0xa33e('0x26')]){_0x17646c[_0xa33e('0x22')]=_0x10dc58[_0x57f734][_0xa33e('0x23')];}}}_0x1ae050(_0x17646c);})['catch'](function(_0x304349){_0x568dc7(_0x304349['message']);});});}function createEndUser(_0x5965ec,_0x1abbca,_0x5b75d0,_0x420707,_0x2816b5,_0x1f3009,_0x9cc5d2){return new Promise(function(_0x369a1e,_0x82217){return getAuthToken(_0x1abbca,_0x5b75d0,_0x1f3009)['then'](function(_0x42eaa4){var _0x3275f7=_0x1f3009['toLowerCase']()===_0xa33e('0x27')?_0x2816b5[_0xa33e('0x28')]:_0x2816b5['calleridnum'];var _0x3a2b6c={'method':'POST','uri':_0x420707+'contacts','body':{'fullname':_0x3275f7,'firstname':_0x3275f7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa33e('0x29')+_0x5965ec[_0xa33e('0x22')]+')'},'headers':{'Authorization':_0xa33e('0x19')+_0x42eaa4,'OData-Version':_0xa33e('0x2a')},'json':!![],'resolveWithFullResponse':!![]};_0x3a2b6c[_0xa33e('0x2b')][_0x9cc5d2]=_0x3275f7;return rp(_0x3a2b6c);})[_0xa33e('0x14')](function(_0x225a82){var _0x74f017=_0x225a82['headers'][_0xa33e('0x2c')];var _0x478a26=_0x74f017[_0xa33e('0x2d')](_0x74f017['lastIndexOf']('(')+0x1,_0x74f017[_0xa33e('0x2e')](')'));_0x5965ec['enduserId']=_0x478a26;_0x369a1e(_0x5965ec);})[_0xa33e('0x15')](function(_0x33fb6c){_0x82217(_0x33fb6c[_0xa33e('0x17')]);});});}function getEndUser(_0x5b8821,_0x112eb3,_0x5c7720,_0x30700c,_0x4e1059,_0x3ebe15,_0x37d2de,_0x5e40b4){var _0x133937=_0x3ebe15['toLowerCase']()===_0xa33e('0x27')?_0x4e1059[_0xa33e('0x28')]:_0x4e1059['calleridnum'];return getAuthToken(_0x112eb3,_0x5c7720,_0x3ebe15)[_0xa33e('0x14')](function(_0x33a12b){_0x5e40b4=_0x5e40b4?_0x5e40b4:_0xa33e('0x2f');var _0x534222={'method':'GET','uri':_0x30700c+'contacts?$select='+_0x5e40b4+'&$filter='+_0x5e40b4+_0xa33e('0x30')+_0x133937[_0xa33e('0x31')]('+','%2b')+'\x27','headers':{'Authorization':_0xa33e('0x19')+_0x33a12b,'If-None-Match':null,'OData-Version':_0xa33e('0x2a')},'json':!![]};return rp(_0x534222);})['then'](function(_0x3ac8ec){var _0x2eaf75=![];if(!_0x3ac8ec)return _0x2eaf75;var _0x2aa201=_0x3ac8ec['value'];for(var _0x5f10f8=0x0;_0x5f10f8<_0x2aa201[_0xa33e('0x25')];_0x5f10f8++){if(_0x2aa201[_0x5f10f8][_0x5e40b4]===_0x133937){_0x2eaf75=!![];_0x5b8821[_0xa33e('0x32')]=_0x2aa201[_0x5f10f8][_0xa33e('0x33')];}}return _0x2eaf75;})['then'](function(_0x2e5593){if(_0x2e5593)return _0x5b8821;if(_0x37d2de===_0xa33e('0x34')){logger[_0xa33e('0x20')]('['+[_0x3ebe15['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x5b8821;}return createEndUser(_0x5b8821,_0x112eb3,_0x5c7720,_0x30700c,_0x4e1059,_0x3ebe15,_0x5e40b4)[_0xa33e('0x14')](function(_0x496ea5){logger[_0xa33e('0x20')]('['+[_0x3ebe15[_0xa33e('0x16')]()]+_0xa33e('0x35'),_0x496ea5['enduserId']);return _0x496ea5;});});}function getCustomFields(_0x173176,_0x540fe4,_0x135bca){var _0x57486={};if(_0x173176[_0xa33e('0x25')]>0x0){_[_0xa33e('0x36')](_0x173176,function(_0x4557fb){if(_[_0xa33e('0x37')]([_0xa33e('0x38'),_0xa33e('0x39')],_0x4557fb[_0xa33e('0x3a')])&&_0x4557fb[_0xa33e('0x3b')]&&!_0x4557fb[_0xa33e('0x3c')]){var _0x4688c6=_0x4557fb[_0xa33e('0x3d')][_0xa33e('0x3e')]();var _0x194996=_0x4688c6[_0xa33e('0x2d')](0x0,_0x4688c6[_0xa33e('0x3f')]('_'));var _0x206301=_0x4688c6[_0xa33e('0x2d')](_0x4688c6['indexOf']('_')+0x1);if(_0x194996===_0x135bca){_0x57486[_0x206301]=_0x4557fb['content'];}}});}return _0x57486;}function getTicket(_0x4d82df,_0x589b7d,_0x5bfab9,_0x127f00,_0x35ede4,_0x4af1f1,_0x4cfe2f){return new Promise(function(_0x500d6e,_0x141c65){var _0x40eb3d;return getAuthToken(_0x589b7d,_0x5bfab9,_0x4cfe2f)['then'](function(_0x1f7f0b){if(_0x4af1f1[_0xa33e('0x40')]===_0xa33e('0x41')){_0x40eb3d={'method':_0xa33e('0x42'),'uri':_0x127f00+'incidents','body':Object['assign']({},{'title':intUtil[_0xa33e('0x43')](_0x4af1f1[_0xa33e('0x44')],_0x35ede4,'\x20'),'description':intUtil['getString'](_0x4af1f1['Descriptions'],_0x35ede4,'\x0a'),'customerid_contact@odata.bind':_0x4d82df[_0xa33e('0x32')]?_0xa33e('0x45')+_0x4d82df['enduserId']+')':undefined,'ownerid@odata.bind':_0xa33e('0x29')+_0x4d82df[_0xa33e('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x4af1f1['Fields'],_0x35ede4,_0x4af1f1[_0xa33e('0x40')])),'headers':{'Authorization':_0xa33e('0x19')+_0x1f7f0b,'OData-Version':_0xa33e('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4af1f1[_0xa33e('0x40')]===_0xa33e('0x46')){var _0x54d3f1=_0x4d82df[_0xa33e('0x32')]?[{'partyid_systemuser@odata.bind':_0xa33e('0x29')+_0x4d82df[_0xa33e('0x22')]+')','participationtypemask':_0x4d82df['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xa33e('0x45')+_0x4d82df[_0xa33e('0x32')]+')','participationtypemask':_0x4d82df[_0xa33e('0x47')]===_0xa33e('0x48')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4d82df[_0xa33e('0x22')]+')','participationtypemask':_0x4d82df[_0xa33e('0x47')]==='queue'?0x2:0x1}];_0x40eb3d={'method':_0xa33e('0x42'),'uri':_0x127f00+'phonecalls','body':Object['assign']({},{'subject':intUtil['getString'](_0x4af1f1[_0xa33e('0x44')],_0x35ede4,'\x20'),'phonenumber':String(_0x35ede4['calleridnum']),'description':intUtil[_0xa33e('0x43')](_0x4af1f1[_0xa33e('0x49')],_0x35ede4,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4d82df[_0xa33e('0x32')]?_0xa33e('0x45')+_0x4d82df[_0xa33e('0x32')]+')':undefined,'ownerid@odata.bind':_0xa33e('0x29')+_0x4d82df['userId']+')','directioncode':_0x4d82df[_0xa33e('0x47')]===_0xa33e('0x48')?![]:!![],'phonecall_activity_parties':_0x54d3f1},getCustomFields(_0x4af1f1[_0xa33e('0x4a')],_0x35ede4,_0x4af1f1[_0xa33e('0x40')])),'headers':{'Authorization':_0xa33e('0x19')+_0x1f7f0b,'OData-Version':_0xa33e('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x40eb3d);})[_0xa33e('0x14')](function(_0x3aa0d1){var _0x51736a=_0x3aa0d1[_0xa33e('0x4b')][_0xa33e('0x2c')];var _0x2d0a8a=_0x51736a[_0xa33e('0x2d')](_0x51736a[_0xa33e('0x2e')]('(')+0x1,_0x51736a[_0xa33e('0x2e')](')'));_0x4d82df['ticketId']=_0x2d0a8a;_0x500d6e(_0x4d82df);})[_0xa33e('0x15')](function(_0x1e34de){_0x141c65(_0x1e34de[_0xa33e('0x17')]);});});}function emit(_0x378dfd,_0x319a54,_0x27bd61,_0x38eba6){var _0x5e1a67={'uri':util[_0xa33e('0x4c')](_0xa33e('0x4d'),_0x378dfd,_0x27bd61,_0x38eba6)};io['to'](util['format']('user:%s',_0x319a54))['emit'](_0xa33e('0x4e'),_0x5e1a67);}exports['cs']=function(_0x337986,_0x1e5a6a,_0x13f550,_0x18f7f8,_0x260a22,_0x4cb872,_0x42f19c,_0x12ab15){var _0x3cbcdb={};_0x4cb872['remoteUri']=_0x4cb872[_0xa33e('0x9')]?intUtil[_0xa33e('0x4f')](_0x4cb872['CloudProvider'][_0xa33e('0xc')]):intUtil[_0xa33e('0x4f')](_0x4cb872[_0xa33e('0xa')]);_0x4cb872[_0xa33e('0x50')]=intUtil[_0xa33e('0x4f')](_0x4cb872[_0xa33e('0x50')]);_0x3cbcdb[_0xa33e('0x47')]=_0x12ab15===_0xa33e('0x48')||_0x12ab15===_0xa33e('0x51')?_0xa33e('0x48'):_0xa33e('0x27');var _0x35b53f=_0x4cb872['modernAuthentication']?util[_0xa33e('0x4c')](_0xa33e('0x52'),_0x4cb872[_0xa33e('0xb')]['data7']):util[_0xa33e('0x4c')]('%s/api/data/v9.0/',_0x4cb872[_0xa33e('0xa')]);var _0x244c5b=util[_0xa33e('0x4c')](_0xa33e('0x53'),_0x4cb872['tenantId']);var _0x366099=util[_0xa33e('0x4c')](_0xa33e('0x54'),_0x4cb872[_0xa33e('0x50')],_0x1e5a6a[_0xa33e('0x55')],md5(_0x1e5a6a[_0xa33e('0x55')]));if(_0x260a22&&_0x260a22[_0xa33e('0x56')]){logger['info'](_0xa33e('0x57'),_0xa33e('0x58'));_0x1e5a6a[_0xa33e('0x59')]=_0x366099;}else if(_0x42f19c&&_0x42f19c[_0xa33e('0x5a')]&&_0x42f19c[_0xa33e('0x5a')]!=='none'){logger['info'](_0xa33e('0x5b'),'Recording\x20is\x20enabled!');_0x1e5a6a[_0xa33e('0x59')]=_0x366099;}else{_0x1e5a6a[_0xa33e('0x59')]='';}return getUser(_0x3cbcdb,_0x4cb872,_0x18f7f8,_0x244c5b,_0x35b53f,_0x12ab15)[_0xa33e('0x14')](function(_0x37e61d){logger[_0xa33e('0x20')]('['+_0x12ab15[_0xa33e('0x16')]()+_0xa33e('0x5c'),_0x37e61d['userId']);logger[_0xa33e('0x20')]('['+_0x12ab15[_0xa33e('0x16')]()+_0xa33e('0x5d'),_0x37e61d[_0xa33e('0x5e')]);return getEndUser(_0x37e61d,_0x4cb872,_0x244c5b,_0x35b53f,_0x1e5a6a,_0x12ab15,_0x13f550[_0xa33e('0x5f')],_0x13f550[_0xa33e('0x60')]);})[_0xa33e('0x14')](function(_0xa5d0e){logger[_0xa33e('0x20')]('['+_0x12ab15[_0xa33e('0x16')]()+_0xa33e('0x61'),_0xa5d0e[_0xa33e('0x32')]);logger[_0xa33e('0x20')]('['+_0x12ab15[_0xa33e('0x16')]()+_0xa33e('0x62'),_0x1e5a6a[_0xa33e('0x63')]);return getTicket(_0xa5d0e,_0x4cb872,_0x244c5b,_0x35b53f,_0x1e5a6a,_0x13f550,_0x12ab15);})[_0xa33e('0x14')](function(_0x544fec){logger[_0xa33e('0x20')](util['format']('['+_0x12ab15['toUpperCase']()+_0xa33e('0x64'),_0x13f550[_0xa33e('0x40')],_0x544fec[_0xa33e('0x65')]));logger[_0xa33e('0x20')](util['format']('['+_0x12ab15[_0xa33e('0x16')]()+_0xa33e('0x66'),_0x12ab15));if(_0x12ab15!==_0xa33e('0x51')&&_0x13f550[_0xa33e('0x67')]){logger[_0xa33e('0x20')]('['+_0x12ab15[_0xa33e('0x16')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4cb872[_0xa33e('0xa')],_0x18f7f8['name'],_0x13f550[_0xa33e('0x40')],_0x544fec[_0xa33e('0x65')]);}})['catch'](function(_0x2d91c8){logger[_0xa33e('0x68')]('['+_0x12ab15[_0xa33e('0x16')]()+_0xa33e('0x69'),_0x2d91c8[_0xa33e('0x17')]);console['error']('Error\x20running\x20Dynamics365\x20integration',_0x2d91c8);});}; \ No newline at end of file +var _0x745b=['incidents','getString','Subjects','Descriptions','/contacts(','/systemusers(','phonecall','callDirection','queue','assign','Fields','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','data2','resolve','CloudProvider','data5','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase','message','GET','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','email','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','body','headers','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','content','ticketType','incident'];(function(_0x183cb6,_0x33db17){var _0x34fdb6=function(_0x983b93){while(--_0x983b93){_0x183cb6['push'](_0x183cb6['shift']());}};_0x34fdb6(++_0x33db17);}(_0x745b,0x10e));var _0xb745=function(_0x5d1902,_0x2c2f61){_0x5d1902=_0x5d1902-0x0;var _0x2d83aa=_0x745b[_0x5d1902];return _0x2d83aa;};'use strict';var _=require(_0xb745('0x0'));var rp=require(_0xb745('0x1'));var util=require(_0xb745('0x2'));var intUtil=require(_0xb745('0x3'));var md5=require('md5');var Redis=require(_0xb745('0x4'));var logger=require('../../../../config/logger')(_0xb745('0x5'));var config=require('../../../../config/environment');config[_0xb745('0x6')]=_[_0xb745('0x7')](config[_0xb745('0x6')],{'host':_0xb745('0x8'),'port':0x18eb});var io=require(_0xb745('0x9'))(new Redis(config[_0xb745('0x6')]));function getAuthToken(_0x59468d,_0x29c1e5,_0x33c7aa){if(_0x59468d[_0xb745('0xa')]){_0x59468d[_0xb745('0xb')]=_0x59468d['CloudProvider'][_0xb745('0xc')];_0x59468d['tenantId']=_0x59468d['CloudProvider'][_0xb745('0xd')];return Promise[_0xb745('0xe')](_0x59468d[_0xb745('0xf')][_0xb745('0x10')]);}var _0x438e56={'method':_0xb745('0x11'),'uri':_0x29c1e5,'form':{'client_id':_0x59468d[_0xb745('0x12')],'resource':_0x59468d[_0xb745('0xb')],'username':_0x59468d[_0xb745('0x13')],'password':_0x59468d[_0xb745('0x14')],'grant_type':'password','client_secret':_0x59468d[_0xb745('0x15')]},'json':!![]};return rp(_0x438e56)[_0xb745('0x16')](function(_0x2354e5){return _0x2354e5[_0xb745('0x17')];})[_0xb745('0x18')](function(_0x3f0d87){logger[_0xb745('0x19')]('['+[_0x33c7aa[_0xb745('0x1a')]()]+']\x20Wrong\x20credentials!');return _0x3f0d87[_0xb745('0x1b')];});}function getUser(_0x4693e,_0x121801,_0x1c3631,_0x33a95f,_0x1a923a,_0x3de05c){return new Promise(function(_0x5c2389,_0x743d4a){return getAuthToken(_0x121801,_0x33a95f,_0x3de05c)[_0xb745('0x16')](function(_0x3cf168){var _0x3aed26={'method':_0xb745('0x1c'),'uri':_0x1a923a+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xb745('0x1d')+_0x3cf168,'OData-Version':_0xb745('0x1e')},'json':!![]};return rp(_0x3aed26);})[_0xb745('0x16')](function(_0x57efd7){var _0x15463d=_0x57efd7[_0xb745('0x1f')];var _0xc7ac24=![];var _0x2b8e29=null;if(!_[_0xb745('0x20')](_0x1c3631)){if(intUtil[_0xb745('0x21')](_0x1c3631['email'])){_0x4693e[_0xb745('0x22')]=_0x1c3631[_0xb745('0x23')];for(_0x2b8e29=0x0;_0x2b8e29<_0x15463d['length'];_0x2b8e29++){if(_0x15463d[_0x2b8e29]['internalemailaddress']===_0x1c3631[_0xb745('0x23')]&&!_0x15463d[_0x2b8e29]['isdisabled']){_0xc7ac24=!![];logger['info']('['+[_0x3de05c['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x15463d[_0x2b8e29][_0xb745('0x24')]+'!');_0x4693e[_0xb745('0x25')]=_0x15463d[_0x2b8e29][_0xb745('0x24')];}}}}if(!_0xc7ac24){logger[_0xb745('0x26')]('['+[_0x3de05c[_0xb745('0x1a')]()]+_0xb745('0x27'));_0x4693e[_0xb745('0x22')]=_0x121801[_0xb745('0x13')];for(_0x2b8e29=0x0;_0x2b8e29<_0x15463d[_0xb745('0x28')];_0x2b8e29++){if(_0x15463d[_0x2b8e29][_0xb745('0x29')]===_0x121801[_0xb745('0x13')]){_0x4693e[_0xb745('0x25')]=_0x15463d[_0x2b8e29][_0xb745('0x24')];}}}_0x5c2389(_0x4693e);})[_0xb745('0x18')](function(_0x10f7e5){_0x743d4a(_0x10f7e5['message']);});});}function createEndUser(_0x249970,_0x21c0c8,_0x223f04,_0x14c47a,_0x1e6953,_0x42161f,_0x4376bf){return new Promise(function(_0x452f32,_0xb0379d){return getAuthToken(_0x21c0c8,_0x223f04,_0x42161f)[_0xb745('0x16')](function(_0x2b0657){var _0x2361ea=_0x42161f[_0xb745('0x2a')]()===_0xb745('0x2b')?_0x1e6953[_0xb745('0x2c')]:_0x1e6953[_0xb745('0x2d')];var _0x3c5ad3={'method':_0xb745('0x11'),'uri':_0x14c47a+_0xb745('0x2e'),'body':{'fullname':_0x2361ea,'firstname':_0x2361ea,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x249970[_0xb745('0x25')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x2b0657,'OData-Version':_0xb745('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x3c5ad3[_0xb745('0x2f')][_0x4376bf]=_0x2361ea;return rp(_0x3c5ad3);})[_0xb745('0x16')](function(_0x4a36e6){var _0x1942ec=_0x4a36e6[_0xb745('0x30')]['odata-entityid'];var _0x3ae5a1=_0x1942ec[_0xb745('0x31')](_0x1942ec[_0xb745('0x32')]('(')+0x1,_0x1942ec[_0xb745('0x32')](')'));_0x249970[_0xb745('0x33')]=_0x3ae5a1;_0x452f32(_0x249970);})[_0xb745('0x18')](function(_0x455e02){_0xb0379d(_0x455e02['message']);});});}function getEndUser(_0x5d7929,_0x2f95de,_0x23c228,_0x20db14,_0x4dee66,_0x3ccbc8,_0x33d584,_0x3998f4){var _0xbbfb09=_0x3ccbc8[_0xb745('0x2a')]()===_0xb745('0x2b')?_0x4dee66[_0xb745('0x2c')]:_0x4dee66['calleridnum'];return getAuthToken(_0x2f95de,_0x23c228,_0x3ccbc8)[_0xb745('0x16')](function(_0x54c4ea){_0x3998f4=_0x3998f4?_0x3998f4:_0xb745('0x34');var _0x5abc12={'method':_0xb745('0x1c'),'uri':_0x20db14+_0xb745('0x35')+_0x3998f4+_0xb745('0x36')+_0x3998f4+'\x20eq\x20\x27'+_0xbbfb09[_0xb745('0x37')]('+',_0xb745('0x38'))+'\x27','headers':{'Authorization':_0xb745('0x1d')+_0x54c4ea,'If-None-Match':null,'OData-Version':_0xb745('0x1e')},'json':!![]};return rp(_0x5abc12);})[_0xb745('0x16')](function(_0x13b85d){var _0xc558fe=![];if(!_0x13b85d)return _0xc558fe;var _0x926938=_0x13b85d[_0xb745('0x1f')];for(var _0x228903=0x0;_0x228903<_0x926938['length'];_0x228903++){if(_0x926938[_0x228903][_0x3998f4]===_0xbbfb09){_0xc558fe=!![];_0x5d7929[_0xb745('0x33')]=_0x926938[_0x228903][_0xb745('0x39')];}}return _0xc558fe;})['then'](function(_0x48e8af){if(_0x48e8af)return _0x5d7929;if(_0x33d584===_0xb745('0x3a')){logger[_0xb745('0x26')]('['+[_0x3ccbc8[_0xb745('0x1a')]()]+_0xb745('0x3b'));return _0x5d7929;}return createEndUser(_0x5d7929,_0x2f95de,_0x23c228,_0x20db14,_0x4dee66,_0x3ccbc8,_0x3998f4)[_0xb745('0x16')](function(_0x5e5f71){logger[_0xb745('0x26')]('['+[_0x3ccbc8[_0xb745('0x1a')]()]+_0xb745('0x3c'),_0x5e5f71['enduserId']);return _0x5e5f71;});});}function getCustomFields(_0x11726d,_0x61de1,_0x2f4489){var _0x40d64e={};if(_0x11726d[_0xb745('0x28')]>0x0){_[_0xb745('0x3d')](_0x11726d,function(_0x26c0d3){if(_[_0xb745('0x3e')]([_0xb745('0x3f'),_0xb745('0x40')],_0x26c0d3[_0xb745('0x41')])&&_0x26c0d3[_0xb745('0x42')]&&!_0x26c0d3[_0xb745('0x43')]){var _0x4688c5=_0x26c0d3[_0xb745('0x44')][_0xb745('0x2a')]();var _0x5bb769=_0x4688c5['substring'](0x0,_0x4688c5['indexOf']('_'));var _0x2b0f16=_0x4688c5['substring'](_0x4688c5['indexOf']('_')+0x1);if(_0x5bb769===_0x2f4489){_0x40d64e[_0x2b0f16]=_0x26c0d3[_0xb745('0x45')];}}});}return _0x40d64e;}function getTicket(_0x304d01,_0x29f1c6,_0xd6feb,_0x396e1a,_0x2dfa20,_0x3a08ae,_0x2acf11){return new Promise(function(_0x1d2bce,_0x4f88ae){var _0x25e2f4;return getAuthToken(_0x29f1c6,_0xd6feb,_0x2acf11)[_0xb745('0x16')](function(_0x1ac6d3){if(_0x3a08ae[_0xb745('0x46')]===_0xb745('0x47')){_0x25e2f4={'method':_0xb745('0x11'),'uri':_0x396e1a+_0xb745('0x48'),'body':Object['assign']({},{'title':intUtil[_0xb745('0x49')](_0x3a08ae[_0xb745('0x4a')],_0x2dfa20,'\x20'),'description':intUtil[_0xb745('0x49')](_0x3a08ae[_0xb745('0x4b')],_0x2dfa20,'\x0a'),'customerid_contact@odata.bind':_0x304d01[_0xb745('0x33')]?_0xb745('0x4c')+_0x304d01[_0xb745('0x33')]+')':undefined,'ownerid@odata.bind':_0xb745('0x4d')+_0x304d01[_0xb745('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x3a08ae['Fields'],_0x2dfa20,_0x3a08ae[_0xb745('0x46')])),'headers':{'Authorization':_0xb745('0x1d')+_0x1ac6d3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3a08ae[_0xb745('0x46')]===_0xb745('0x4e')){var _0x138c8d=_0x304d01[_0xb745('0x33')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x304d01['userId']+')','participationtypemask':_0x304d01[_0xb745('0x4f')]===_0xb745('0x50')?0x2:0x1},{'partyid_contact@odata.bind':_0xb745('0x4c')+_0x304d01['enduserId']+')','participationtypemask':_0x304d01[_0xb745('0x4f')]===_0xb745('0x50')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xb745('0x4d')+_0x304d01[_0xb745('0x25')]+')','participationtypemask':_0x304d01[_0xb745('0x4f')]===_0xb745('0x50')?0x2:0x1}];_0x25e2f4={'method':_0xb745('0x11'),'uri':_0x396e1a+'phonecalls','body':Object[_0xb745('0x51')]({},{'subject':intUtil[_0xb745('0x49')](_0x3a08ae['Subjects'],_0x2dfa20,'\x20'),'phonenumber':String(_0x2dfa20[_0xb745('0x2d')]),'description':intUtil['getString'](_0x3a08ae[_0xb745('0x4b')],_0x2dfa20,'\x0a'),'regardingobjectid_contact@odata.bind':_0x304d01[_0xb745('0x33')]?_0xb745('0x4c')+_0x304d01[_0xb745('0x33')]+')':undefined,'ownerid@odata.bind':_0xb745('0x4d')+_0x304d01[_0xb745('0x25')]+')','directioncode':_0x304d01[_0xb745('0x4f')]===_0xb745('0x50')?![]:!![],'phonecall_activity_parties':_0x138c8d},getCustomFields(_0x3a08ae[_0xb745('0x52')],_0x2dfa20,_0x3a08ae[_0xb745('0x46')])),'headers':{'Authorization':_0xb745('0x1d')+_0x1ac6d3,'OData-Version':_0xb745('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x25e2f4);})[_0xb745('0x16')](function(_0xf599){var _0x4900a3=_0xf599[_0xb745('0x30')][_0xb745('0x53')];var _0x3d820f=_0x4900a3[_0xb745('0x31')](_0x4900a3['lastIndexOf']('(')+0x1,_0x4900a3[_0xb745('0x32')](')'));_0x304d01['ticketId']=_0x3d820f;_0x1d2bce(_0x304d01);})[_0xb745('0x18')](function(_0x44c8de){_0x4f88ae(_0x44c8de[_0xb745('0x1b')]);});});}function emit(_0x224f09,_0x179149,_0x58ebf3,_0x10fcfc){var _0x489a67={'uri':util[_0xb745('0x54')](_0xb745('0x55'),_0x224f09,_0x58ebf3,_0x10fcfc)};io['to'](util[_0xb745('0x54')]('user:%s',_0x179149))[_0xb745('0x56')](_0xb745('0x57'),_0x489a67);}exports['cs']=function(_0x4cb2c9,_0x3c2f27,_0x236e9e,_0x5186bb,_0x3f49e4,_0x5c143b,_0x475085,_0x4540f6){var _0xab04fd={};_0x5c143b[_0xb745('0xb')]=_0x5c143b[_0xb745('0xa')]?intUtil[_0xb745('0x58')](_0x5c143b[_0xb745('0xf')][_0xb745('0xc')]):intUtil['stripTrailingSlash'](_0x5c143b['remoteUri']);_0x5c143b['serverUrl']=intUtil[_0xb745('0x58')](_0x5c143b[_0xb745('0x59')]);_0xab04fd[_0xb745('0x4f')]=_0x4540f6===_0xb745('0x50')||_0x4540f6==='unmanaged'?_0xb745('0x50'):_0xb745('0x2b');var _0x4e2f5a=_0x5c143b[_0xb745('0xa')]?util[_0xb745('0x54')](_0xb745('0x5a'),_0x5c143b[_0xb745('0xf')][_0xb745('0xc')]):util[_0xb745('0x54')](_0xb745('0x5a'),_0x5c143b[_0xb745('0xb')]);var _0x8923ca=util[_0xb745('0x54')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5c143b[_0xb745('0x5b')]);var _0x4a374f=util[_0xb745('0x54')](_0xb745('0x5c'),_0x5c143b[_0xb745('0x59')],_0x3c2f27[_0xb745('0x5d')],md5(_0x3c2f27[_0xb745('0x5d')]));if(_0x3f49e4&&_0x3f49e4[_0xb745('0x5e')]){logger[_0xb745('0x26')](_0xb745('0x5f'),_0xb745('0x60'));_0x3c2f27[_0xb745('0x61')]=_0x4a374f;}else if(_0x475085&&_0x475085['recordingFormat']&&_0x475085[_0xb745('0x62')]!==_0xb745('0x63')){logger[_0xb745('0x26')](_0xb745('0x64'),_0xb745('0x60'));_0x3c2f27[_0xb745('0x61')]=_0x4a374f;}else{_0x3c2f27['recordingURL']='';}return getUser(_0xab04fd,_0x5c143b,_0x5186bb,_0x8923ca,_0x4e2f5a,_0x4540f6)[_0xb745('0x16')](function(_0x390470){logger[_0xb745('0x26')]('['+_0x4540f6[_0xb745('0x1a')]()+_0xb745('0x65'),_0x390470[_0xb745('0x25')]);logger[_0xb745('0x26')]('['+_0x4540f6['toUpperCase']()+_0xb745('0x66'),_0x390470['userEmail']);return getEndUser(_0x390470,_0x5c143b,_0x8923ca,_0x4e2f5a,_0x3c2f27,_0x4540f6,_0x236e9e[_0xb745('0x67')],_0x236e9e[_0xb745('0x68')]);})[_0xb745('0x16')](function(_0x5f4195){logger[_0xb745('0x26')]('['+_0x4540f6['toUpperCase']()+_0xb745('0x69'),_0x5f4195[_0xb745('0x33')]);logger['info']('['+_0x4540f6[_0xb745('0x1a')]()+_0xb745('0x6a'),_0x3c2f27[_0xb745('0x2d')]);return getTicket(_0x5f4195,_0x5c143b,_0x8923ca,_0x4e2f5a,_0x3c2f27,_0x236e9e,_0x4540f6);})[_0xb745('0x16')](function(_0x25e1ba){logger['info'](util[_0xb745('0x54')]('['+_0x4540f6['toUpperCase']()+_0xb745('0x6b'),_0x236e9e['ticketType'],_0x25e1ba['ticketId']));logger['info'](util[_0xb745('0x54')]('['+_0x4540f6['toUpperCase']()+_0xb745('0x6c'),_0x4540f6));if(_0x4540f6!==_0xb745('0x6d')&&_0x236e9e['openNewTab']){logger[_0xb745('0x26')]('['+_0x4540f6['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5c143b[_0xb745('0xb')],_0x5186bb[_0xb745('0x6e')],_0x236e9e['ticketType'],_0x25e1ba[_0xb745('0x6f')]);}})[_0xb745('0x18')](function(_0x130a03){logger[_0xb745('0x19')]('['+_0x4540f6[_0xb745('0x1a')]()+_0xb745('0x70'),_0x130a03[_0xb745('0x1b')]);console[_0xb745('0x19')](_0xb745('0x71'),_0x130a03);});}; \ 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 e938a99..f46bffd 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 _0xb3ad=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','[OUTBOUND]','uniqueid','Authorization','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','value','format','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','stringify','map','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','push','queue'];(function(_0x39cd3c,_0xa21102){var _0x47a0ae=function(_0x330b05){while(--_0x330b05){_0x39cd3c['push'](_0x39cd3c['shift']());}};_0x47a0ae(++_0xa21102);}(_0xb3ad,0x13b));var _0xdb3a=function(_0x8df308,_0x55d2d3){_0x8df308=_0x8df308-0x0;var _0x5cddab=_0xb3ad[_0x8df308];return _0x5cddab;};'use strict';var _=require(_0xdb3a('0x0'));var rp=require(_0xdb3a('0x1'));var md5=require(_0xdb3a('0x2'));var util=require(_0xdb3a('0x3'));var Redis=require(_0xdb3a('0x4'));var intUtil=require('./util');var config=require(_0xdb3a('0x5'));var logger=require(_0xdb3a('0x6'))(_0xdb3a('0x7'));config[_0xdb3a('0x8')]=_[_0xdb3a('0x9')](config[_0xdb3a('0x8')],{'host':_0xdb3a('0xa'),'port':0x18eb});var io=require(_0xdb3a('0xb'))(new Redis(config[_0xdb3a('0x8')]));var headers={'Content-Type':_0xdb3a('0xc'),'Accept':_0xdb3a('0xc')};function emit(_0x341555,_0x55208b,_0x515791){io['to'](_0x341555)[_0xdb3a('0xd')](_0x55208b,_0x515791);}function getTicket(_0xf5577e,_0x46716c,_0x3378b1,_0x162a44,_0x10265){logger[_0xdb3a('0xe')](_0xdb3a('0xf'));var _0x5eaa96=_[_0xdb3a('0x10')]({'responder_id':_0x46716c['id'],'requester_id':_0x3378b1['id'],'name':util['format'](_0xdb3a('0x11'),_0x10265[_0xdb3a('0x12')]),'phone':_0x10265[_0xdb3a('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x162a44[_0xdb3a('0x14')],_0x10265,'\x20'),'description':intUtil['getString'](_0x162a44[_0xdb3a('0x15')],_0x10265,_0xdb3a('0x16')),'tags':getTags(_0x162a44[_0xdb3a('0x17')],_0xdb3a('0x18'))},getCustomFields(_0x162a44[_0xdb3a('0x19')],_0x10265));_0x5eaa96[_0xdb3a('0x1a')]=_[_0xdb3a('0x1b')](_['keyBy'](_0x5eaa96[_0xdb3a('0x1a')],'id'),_0xdb3a('0x1c'));return request({'uri':util[_0xdb3a('0x1d')]('%s/api/v2/tickets',_0xf5577e[_0xdb3a('0x1e')]),'method':_0xdb3a('0x1f'),'body':_0x5eaa96})[_0xdb3a('0x20')](function(_0x9a1ccc){logger[_0xdb3a('0xe')]('Ticket\x20created!');return _0x9a1ccc;});}function getUser(_0x397539,_0x5754d2){if(intUtil[_0xdb3a('0x21')](_0x5754d2)){return request({'uri':util[_0xdb3a('0x1d')](_0xdb3a('0x22'),_0x397539['remoteUri']),'qs':{'email':_0x5754d2}})[_0xdb3a('0x20')](function(_0x1ffe4e){if(_0x1ffe4e[_0xdb3a('0x23')]){logger['info'](_0xdb3a('0x24'));return _[_0xdb3a('0x25')](_0x1ffe4e,function(_0x2a91fa){return _0x2a91fa['contact'][_0xdb3a('0x26')]===_0x5754d2;});}else{logger[_0xdb3a('0xe')](_0xdb3a('0x27'));return request({'uri':util[_0xdb3a('0x1d')](_0xdb3a('0x28'),_0x397539[_0xdb3a('0x1e')])})[_0xdb3a('0x20')](function(_0x20d412){logger[_0xdb3a('0xe')](_0xdb3a('0x29'));return _0x20d412;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdb3a('0x1d')](_0xdb3a('0x28'),_0x397539[_0xdb3a('0x1e')])})['then'](function(_0x5a7503){logger[_0xdb3a('0xe')](_0xdb3a('0x29'));return _0x5a7503;});}}function getEndUser(_0x25d34e,_0x5c5071,_0x50b892){logger[_0xdb3a('0xe')](_0xdb3a('0x2a'),_0x50b892);return request({'uri':util['format'](_0xdb3a('0x2b'),_0x25d34e['remoteUri']),'qs':{'phone':_0x50b892}})[_0xdb3a('0x20')](function(_0x20209c){if(_0x20209c[_0xdb3a('0x23')]){logger['info'](_0xdb3a('0x2c'));return _[_0xdb3a('0x25')](_0x20209c,{'phone':_0x50b892});}else{logger['info'](_0xdb3a('0x2d'));return request({'uri':util[_0xdb3a('0x1d')](_0xdb3a('0x2b'),_0x25d34e['remoteUri']),'method':_0xdb3a('0x1f'),'body':{'name':_0x5c5071,'phone':_0x50b892}})[_0xdb3a('0x20')](function(_0x34b1c0){logger[_0xdb3a('0xe')](_0xdb3a('0x2e'));return _0x34b1c0;});}});}function getAuth(_0x766d7c){return util['format'](_0xdb3a('0x2f'),new Buffer(_0x766d7c['apiKey']+':X')['toString'](_0xdb3a('0x30')));}function request(_0x3103fa){logger[_0xdb3a('0x31')](_0xdb3a('0x32'),JSON[_0xdb3a('0x33')](_0x3103fa));return rp(_['defaults'](_0x3103fa,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x329d17,_0x1cb1f4){var _0xf3dead=[];if(_0x329d17&&_0x329d17['length']>0x0){_0xf3dead=_[_0xdb3a('0x34')](_0x329d17,_0x1cb1f4);}return _0xf3dead;}function getCustomFields(_0x11ded0,_0x365295){var _0x1cfa21=[];var _0x1b5c02={'custom_fields':[]};if(_0x11ded0['length']>0x0){_['forEach'](_0x11ded0,function(_0x38984b){if(_[_0xdb3a('0x35')]([_0xdb3a('0x36'),_0xdb3a('0x37')],_0x38984b[_0xdb3a('0x38')])&&_0x38984b['nameField']&&!_0x38984b[_0xdb3a('0x39')]){_0x1b5c02[_0x38984b[_0xdb3a('0x3a')][_0xdb3a('0x3b')]()]=_0x38984b[_0xdb3a('0x3c')][_0xdb3a('0x3d')]();}else if(_[_0xdb3a('0x35')](['string',_0xdb3a('0x37')],_0x38984b['type'])&&_0x38984b['idField']&&_0x38984b['customField']){_0x1b5c02[_0xdb3a('0x1a')]['push']({'id':_0x38984b[_0xdb3a('0x3e')],'value':_0x38984b[_0xdb3a('0x3c')][_0xdb3a('0x3d')]()});}else if(_0x38984b[_0xdb3a('0x38')]===_0xdb3a('0x3f')&&_0x38984b[_0xdb3a('0x40')]&&_0x38984b[_0xdb3a('0x3e')]&&_0x38984b[_0xdb3a('0x39')]){_0x365295[_0x38984b[_0xdb3a('0x40')]]&&_0x1b5c02[_0xdb3a('0x1a')]['push']({'id':_0x38984b[_0xdb3a('0x3e')],'value':_0x365295[_0x38984b[_0xdb3a('0x40')]][_0xdb3a('0x3d')]()});}else if(_0x38984b[_0xdb3a('0x38')]===_0xdb3a('0x41')&&_0x38984b['Variable']&&_0x38984b[_0xdb3a('0x42')][_0xdb3a('0x18')]&&_0x38984b['idField']&&_0x38984b[_0xdb3a('0x39')]){_0x365295[_0x38984b[_0xdb3a('0x42')][_0xdb3a('0x18')][_0xdb3a('0x3b')]()]&&_0x1b5c02[_0xdb3a('0x1a')][_0xdb3a('0x43')]({'id':_0x38984b[_0xdb3a('0x3e')],'value':_0x365295[_0x38984b[_0xdb3a('0x42')][_0xdb3a('0x18')][_0xdb3a('0x3b')]()]['toString']()});}});}return _0x1b5c02;}exports[_0xdb3a('0x44')]=function(_0x4d90e9,_0x19bd81,_0x338ff3,_0x316bda,_0x28b231,_0x12d7ec){var _0x14ceff,_0x3e5652;_0x12d7ec[_0xdb3a('0x1e')]=intUtil[_0xdb3a('0x45')](_0x12d7ec[_0xdb3a('0x1e')]);_0x12d7ec[_0xdb3a('0x46')]=intUtil[_0xdb3a('0x45')](_0x12d7ec[_0xdb3a('0x46')]);if(_0x28b231&&_0x28b231[_0xdb3a('0x47')]){logger['info'](_0xdb3a('0x48'),_0xdb3a('0x49'));_0x19bd81[_0xdb3a('0x4a')]=util[_0xdb3a('0x1d')](_0xdb3a('0x4b'),_0x12d7ec[_0xdb3a('0x46')],_0x19bd81['uniqueid'],md5(_0x19bd81['uniqueid']));}else{_0x19bd81[_0xdb3a('0x4a')]='';}headers['Authorization']=getAuth(_0x12d7ec);return getUser(_0x12d7ec,_0x316bda[_0xdb3a('0x26')])[_0xdb3a('0x20')](function(_0x4ba9ed){_0x14ceff=_0x4ba9ed;logger['info'](_0xdb3a('0x4c'),_0x14ceff['id']);return getEndUser(_0x12d7ec,_0x19bd81[_0xdb3a('0x12')],_0x19bd81[_0xdb3a('0x13')]);})[_0xdb3a('0x20')](function(_0x10185c){_0x3e5652=_0x10185c;logger[_0xdb3a('0xe')](_0xdb3a('0x4d'),_0x3e5652['id']);return getTicket(_0x12d7ec,_0x14ceff,_0x3e5652,_0x338ff3,_0x19bd81);})[_0xdb3a('0x20')](function(_0x2c5deb){if(_0x2c5deb&&_0x2c5deb['id']){logger['info'](_0xdb3a('0x4e'));logger[_0xdb3a('0xe')](_0xdb3a('0x4f'),_0x2c5deb['id']);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdb3a('0x1d')](_0xdb3a('0x50'),_0x316bda[_0xdb3a('0x18')]),_0xdb3a('0x51'),{'uri':util[_0xdb3a('0x1d')](_0xdb3a('0x52'),_0x12d7ec['remoteUri'],_0x2c5deb['id'])});}})[_0xdb3a('0x53')](function(_0x4f630d){logger['error'](_0xdb3a('0x48'),JSON[_0xdb3a('0x33')](_0x4f630d));});};exports[_0xdb3a('0x54')]=function(_0x3ae27a,_0x107286,_0x56277a,_0x44db30,_0x42a877,_0x4020ee,_0x1914ac){var _0x555c7e,_0x1bcc2b;_0x4020ee[_0xdb3a('0x1e')]=intUtil[_0xdb3a('0x45')](_0x4020ee[_0xdb3a('0x1e')]);_0x4020ee[_0xdb3a('0x46')]=intUtil[_0xdb3a('0x45')](_0x4020ee[_0xdb3a('0x46')]);if(_0x1914ac&&_0x1914ac[_0xdb3a('0x55')]&&_0x1914ac[_0xdb3a('0x55')]!=='none'){logger[_0xdb3a('0xe')](_0xdb3a('0x56'),'Recording\x20is\x20enabled!');_0x107286['recordingURL']=util['format'](_0xdb3a('0x4b'),_0x4020ee[_0xdb3a('0x46')],_0x107286[_0xdb3a('0x57')],md5(_0x107286[_0xdb3a('0x57')]));}headers[_0xdb3a('0x58')]=getAuth(_0x4020ee);return getUser(_0x4020ee,_0x44db30[_0xdb3a('0x26')])['then'](function(_0x523ce7){_0x555c7e=_0x523ce7;logger[_0xdb3a('0xe')](_0xdb3a('0x4c'),_0x555c7e['id']);return getEndUser(_0x4020ee,_0x107286[_0xdb3a('0x59')],_0x107286[_0xdb3a('0x5a')]);})[_0xdb3a('0x20')](function(_0x221a3f){_0x1bcc2b=_0x221a3f;logger[_0xdb3a('0xe')](_0xdb3a('0x4d'),_0x1bcc2b['id']);return getTicket(_0x4020ee,_0x555c7e,_0x1bcc2b,_0x56277a,_0x107286);})['then'](function(_0x3b7f5e){if(_0x3b7f5e&&_0x3b7f5e['id']){logger[_0xdb3a('0xe')](_0xdb3a('0x4e'));logger[_0xdb3a('0xe')](_0xdb3a('0x4f'),_0x3b7f5e['id']);logger[_0xdb3a('0xe')](_0xdb3a('0x56'),_0xdb3a('0x5b'));emit(util[_0xdb3a('0x1d')](_0xdb3a('0x50'),_0x44db30[_0xdb3a('0x18')]),_0xdb3a('0x51'),{'uri':util[_0xdb3a('0x1d')]('%s/helpdesk/tickets/%d',_0x4020ee[_0xdb3a('0x1e')],_0x3b7f5e['id'])});}})[_0xdb3a('0x53')](function(_0x3f6c21){logger[_0xdb3a('0x5c')](_0xdb3a('0x56'),JSON[_0xdb3a('0x33')](_0x3f6c21));});};exports[_0xdb3a('0x5d')]=function(_0x4ada3f,_0xf90f6d,_0x126ce4,_0x506ff7,_0x338267,_0x121e4f){var _0x1281ab,_0x54b26a;_0x121e4f['remoteUri']=intUtil[_0xdb3a('0x45')](_0x121e4f[_0xdb3a('0x1e')]);_0x121e4f['serverUrl']=intUtil[_0xdb3a('0x45')](_0x121e4f[_0xdb3a('0x46')]);if(_0x338267&&_0x338267[_0xdb3a('0x47')]){logger['info']('['+_0xf90f6d['lastevent'][_0xdb3a('0x5e')]()+']',_0xdb3a('0x49'));_0xf90f6d['recordingURL']=util[_0xdb3a('0x1d')](_0xdb3a('0x4b'),_0x121e4f[_0xdb3a('0x46')],_0xf90f6d[_0xdb3a('0x57')],md5(_0xf90f6d['uniqueid']));}else{_0xf90f6d['recordingURL']='';}headers['Authorization']=getAuth(_0x121e4f);return getUser(_0x121e4f,'')['then'](function(_0x29c6a0){_0x1281ab=_0x29c6a0;logger[_0xdb3a('0xe')]('The\x20User\x20ID\x20is:',_0x1281ab['id']);return getEndUser(_0x121e4f,_0xf90f6d['calleridname'],_0xf90f6d[_0xdb3a('0x13')]);})[_0xdb3a('0x20')](function(_0xebb4fa){_0x54b26a=_0xebb4fa;logger[_0xdb3a('0xe')]('The\x20Enduser\x20ID\x20is:',_0x54b26a['id']);return getTicket(_0x121e4f,_0x1281ab,_0x54b26a,_0x126ce4,_0xf90f6d);})[_0xdb3a('0x20')](function(_0x19003c){if(_0x19003c){logger[_0xdb3a('0xe')]('Ticket\x20created!');logger[_0xdb3a('0xe')](_0xdb3a('0x4f'),_0x19003c['id']);}})[_0xdb3a('0x53')](function(_0x4f6885){logger['error']('['+_0xf90f6d[_0xdb3a('0x5f')]['toUpperCase']()+']',JSON[_0xdb3a('0x33')](_0x4f6885));});}; \ No newline at end of file +var _0xfd1c=['POST','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Ticket\x20created!','[OUTBOUND]','error','unmanaged','toUpperCase','lodash','request-promise','md5','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','then','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts'];(function(_0x13b7c8,_0x14fad5){var _0x40cd1c=function(_0x264dec){while(--_0x264dec){_0x13b7c8['push'](_0x13b7c8['shift']());}};_0x40cd1c(++_0x14fad5);}(_0xfd1c,0xf0));var _0xcfd1=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0xfd1c[_0x9db5d3];return _0x477a81;};'use strict';var _=require(_0xcfd1('0x0'));var rp=require(_0xcfd1('0x1'));var md5=require(_0xcfd1('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xcfd1('0x3'));var config=require(_0xcfd1('0x4'));var logger=require('../../../../config/logger')('freshdesk');config['redis']=_[_0xcfd1('0x5')](config[_0xcfd1('0x6')],{'host':_0xcfd1('0x7'),'port':0x18eb});var io=require(_0xcfd1('0x8'))(new Redis(config[_0xcfd1('0x6')]));var headers={'Content-Type':_0xcfd1('0x9'),'Accept':'application/json'};function emit(_0x12488c,_0x116427,_0x4b8e87){io['to'](_0x12488c)[_0xcfd1('0xa')](_0x116427,_0x4b8e87);}function getTicket(_0x2cca32,_0x4b3eed,_0x41b328,_0x45b9cf,_0x5b9244){logger[_0xcfd1('0xb')](_0xcfd1('0xc'));var _0x1cc1f6=_[_0xcfd1('0xd')]({'responder_id':_0x4b3eed['id'],'requester_id':_0x41b328['id'],'name':util[_0xcfd1('0xe')](_0xcfd1('0xf'),_0x5b9244[_0xcfd1('0x10')]),'phone':_0x5b9244[_0xcfd1('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcfd1('0x12')](_0x45b9cf['Subjects'],_0x5b9244,'\x20'),'description':intUtil[_0xcfd1('0x12')](_0x45b9cf[_0xcfd1('0x13')],_0x5b9244,_0xcfd1('0x14')),'tags':getTags(_0x45b9cf[_0xcfd1('0x15')],_0xcfd1('0x16'))},getCustomFields(_0x45b9cf[_0xcfd1('0x17')],_0x5b9244));_0x1cc1f6[_0xcfd1('0x18')]=_[_0xcfd1('0x19')](_[_0xcfd1('0x1a')](_0x1cc1f6[_0xcfd1('0x18')],'id'),_0xcfd1('0x1b'));return request({'uri':util[_0xcfd1('0xe')](_0xcfd1('0x1c'),_0x2cca32['remoteUri']),'method':'POST','body':_0x1cc1f6})[_0xcfd1('0x1d')](function(_0x1befca){logger[_0xcfd1('0xb')]('Ticket\x20created!');return _0x1befca;});}function getUser(_0x32b3f9,_0x534c59){if(intUtil['validateEmail'](_0x534c59)){return request({'uri':util['format'](_0xcfd1('0x1e'),_0x32b3f9[_0xcfd1('0x1f')]),'qs':{'email':_0x534c59}})['then'](function(_0x410883){if(_0x410883[_0xcfd1('0x20')]){logger[_0xcfd1('0xb')](_0xcfd1('0x21'));return _[_0xcfd1('0x22')](_0x410883,function(_0xa179e){return _0xa179e['contact'][_0xcfd1('0x23')]===_0x534c59;});}else{logger[_0xcfd1('0xb')](_0xcfd1('0x24'));return request({'uri':util[_0xcfd1('0xe')](_0xcfd1('0x25'),_0x32b3f9[_0xcfd1('0x1f')])})[_0xcfd1('0x1d')](function(_0x2dc285){logger[_0xcfd1('0xb')](_0xcfd1('0x26'));return _0x2dc285;});}});}else{logger[_0xcfd1('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcfd1('0xe')](_0xcfd1('0x25'),_0x32b3f9[_0xcfd1('0x1f')])})[_0xcfd1('0x1d')](function(_0x4bf0c7){logger[_0xcfd1('0xb')](_0xcfd1('0x26'));return _0x4bf0c7;});}}function getEndUser(_0x14b639,_0x33466b,_0x52470c){logger[_0xcfd1('0xb')]('Searching\x20enduser\x20with\x20phone',_0x52470c);return request({'uri':util[_0xcfd1('0xe')]('%s/api/v2/contacts',_0x14b639[_0xcfd1('0x1f')]),'qs':{'phone':_0x52470c}})[_0xcfd1('0x1d')](function(_0x17848a){if(_0x17848a[_0xcfd1('0x20')]){logger[_0xcfd1('0xb')](_0xcfd1('0x27'));return _[_0xcfd1('0x22')](_0x17848a,{'phone':_0x52470c});}else{logger[_0xcfd1('0xb')](_0xcfd1('0x28'));return request({'uri':util[_0xcfd1('0xe')](_0xcfd1('0x29'),_0x14b639[_0xcfd1('0x1f')]),'method':_0xcfd1('0x2a'),'body':{'name':_0x33466b,'phone':_0x52470c}})[_0xcfd1('0x1d')](function(_0x42a039){logger[_0xcfd1('0xb')]('Enduser\x20created.');return _0x42a039;});}});}function getAuth(_0x5a2011){return util['format'](_0xcfd1('0x2b'),new Buffer(_0x5a2011[_0xcfd1('0x2c')]+':X')['toString'](_0xcfd1('0x2d')));}function request(_0x4694e7){logger[_0xcfd1('0x2e')](_0xcfd1('0x2f'),JSON[_0xcfd1('0x30')](_0x4694e7));return rp(_[_0xcfd1('0x5')](_0x4694e7,{'method':_0xcfd1('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x46f75a,_0x4fd6b2){var _0x5a993a=[];if(_0x46f75a&&_0x46f75a[_0xcfd1('0x20')]>0x0){_0x5a993a=_[_0xcfd1('0x32')](_0x46f75a,_0x4fd6b2);}return _0x5a993a;}function getCustomFields(_0x10d518,_0x4a97c7){var _0x1c0ae1=[];var _0x5c89b8={'custom_fields':[]};if(_0x10d518['length']>0x0){_['forEach'](_0x10d518,function(_0x3e8a83){if(_[_0xcfd1('0x33')]([_0xcfd1('0x34'),_0xcfd1('0x35')],_0x3e8a83[_0xcfd1('0x36')])&&_0x3e8a83[_0xcfd1('0x37')]&&!_0x3e8a83[_0xcfd1('0x38')]){_0x5c89b8[_0x3e8a83[_0xcfd1('0x37')][_0xcfd1('0x39')]()]=_0x3e8a83[_0xcfd1('0x3a')][_0xcfd1('0x3b')]();}else if(_[_0xcfd1('0x33')](['string','picklist'],_0x3e8a83[_0xcfd1('0x36')])&&_0x3e8a83[_0xcfd1('0x3c')]&&_0x3e8a83[_0xcfd1('0x38')]){_0x5c89b8[_0xcfd1('0x18')][_0xcfd1('0x3d')]({'id':_0x3e8a83[_0xcfd1('0x3c')],'value':_0x3e8a83[_0xcfd1('0x3a')][_0xcfd1('0x3b')]()});}else if(_0x3e8a83['type']===_0xcfd1('0x3e')&&_0x3e8a83[_0xcfd1('0x3f')]&&_0x3e8a83[_0xcfd1('0x3c')]&&_0x3e8a83[_0xcfd1('0x38')]){_0x4a97c7[_0x3e8a83[_0xcfd1('0x3f')]]&&_0x5c89b8[_0xcfd1('0x18')]['push']({'id':_0x3e8a83['idField'],'value':_0x4a97c7[_0x3e8a83[_0xcfd1('0x3f')]][_0xcfd1('0x3b')]()});}else if(_0x3e8a83[_0xcfd1('0x36')]===_0xcfd1('0x40')&&_0x3e8a83[_0xcfd1('0x41')]&&_0x3e8a83['Variable'][_0xcfd1('0x16')]&&_0x3e8a83[_0xcfd1('0x3c')]&&_0x3e8a83[_0xcfd1('0x38')]){_0x4a97c7[_0x3e8a83[_0xcfd1('0x41')][_0xcfd1('0x16')][_0xcfd1('0x39')]()]&&_0x5c89b8[_0xcfd1('0x18')][_0xcfd1('0x3d')]({'id':_0x3e8a83[_0xcfd1('0x3c')],'value':_0x4a97c7[_0x3e8a83[_0xcfd1('0x41')][_0xcfd1('0x16')]['toLowerCase']()][_0xcfd1('0x3b')]()});}});}return _0x5c89b8;}exports[_0xcfd1('0x42')]=function(_0x3c1c3f,_0x10cd2e,_0x3d3af8,_0x501440,_0xbf67ab,_0x2dc9f7){var _0x15898d,_0x79d124;_0x2dc9f7['remoteUri']=intUtil[_0xcfd1('0x43')](_0x2dc9f7['remoteUri']);_0x2dc9f7['serverUrl']=intUtil[_0xcfd1('0x43')](_0x2dc9f7[_0xcfd1('0x44')]);if(_0xbf67ab&&_0xbf67ab[_0xcfd1('0x45')]){logger[_0xcfd1('0xb')](_0xcfd1('0x46'),'Recording\x20is\x20enabled!');_0x10cd2e[_0xcfd1('0x47')]=util[_0xcfd1('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dc9f7[_0xcfd1('0x44')],_0x10cd2e[_0xcfd1('0x48')],md5(_0x10cd2e[_0xcfd1('0x48')]));}else{_0x10cd2e[_0xcfd1('0x47')]='';}headers[_0xcfd1('0x49')]=getAuth(_0x2dc9f7);return getUser(_0x2dc9f7,_0x501440['email'])['then'](function(_0x4bf2b5){_0x15898d=_0x4bf2b5;logger[_0xcfd1('0xb')](_0xcfd1('0x4a'),_0x15898d['id']);return getEndUser(_0x2dc9f7,_0x10cd2e[_0xcfd1('0x10')],_0x10cd2e[_0xcfd1('0x11')]);})['then'](function(_0x27231e){_0x79d124=_0x27231e;logger[_0xcfd1('0xb')](_0xcfd1('0x4b'),_0x79d124['id']);return getTicket(_0x2dc9f7,_0x15898d,_0x79d124,_0x3d3af8,_0x10cd2e);})[_0xcfd1('0x1d')](function(_0x26fd76){if(_0x26fd76&&_0x26fd76['id']){logger[_0xcfd1('0xb')]('Ticket\x20created!');logger['info'](_0xcfd1('0x4c'),_0x26fd76['id']);logger[_0xcfd1('0xb')]('[QUEUE]',_0xcfd1('0x4d'));emit(util[_0xcfd1('0xe')](_0xcfd1('0x4e'),_0x501440[_0xcfd1('0x16')]),_0xcfd1('0x4f'),{'uri':util['format'](_0xcfd1('0x50'),_0x2dc9f7[_0xcfd1('0x1f')],_0x26fd76['id'])});}})[_0xcfd1('0x51')](function(_0x1e3482){logger['error'](_0xcfd1('0x46'),JSON[_0xcfd1('0x30')](_0x1e3482));});};exports[_0xcfd1('0x52')]=function(_0x2aa5f8,_0xbc90c7,_0x17c16f,_0x19beff,_0x1c1090,_0x74110d,_0x1ae0cb){var _0x58560d,_0x1f0905;_0x74110d['remoteUri']=intUtil['stripTrailingSlash'](_0x74110d['remoteUri']);_0x74110d[_0xcfd1('0x44')]=intUtil['stripTrailingSlash'](_0x74110d[_0xcfd1('0x44')]);if(_0x1ae0cb&&_0x1ae0cb[_0xcfd1('0x53')]&&_0x1ae0cb[_0xcfd1('0x53')]!==_0xcfd1('0x54')){logger[_0xcfd1('0xb')]('[OUTBOUND]',_0xcfd1('0x55'));_0xbc90c7['recordingURL']=util[_0xcfd1('0xe')](_0xcfd1('0x56'),_0x74110d[_0xcfd1('0x44')],_0xbc90c7['uniqueid'],md5(_0xbc90c7[_0xcfd1('0x48')]));}headers['Authorization']=getAuth(_0x74110d);return getUser(_0x74110d,_0x19beff[_0xcfd1('0x23')])['then'](function(_0x36acfd){_0x58560d=_0x36acfd;logger['info'](_0xcfd1('0x4a'),_0x58560d['id']);return getEndUser(_0x74110d,_0xbc90c7[_0xcfd1('0x57')],_0xbc90c7[_0xcfd1('0x58')]);})[_0xcfd1('0x1d')](function(_0x2062bb){_0x1f0905=_0x2062bb;logger[_0xcfd1('0xb')](_0xcfd1('0x4b'),_0x1f0905['id']);return getTicket(_0x74110d,_0x58560d,_0x1f0905,_0x17c16f,_0xbc90c7);})['then'](function(_0x1e9f9e){if(_0x1e9f9e&&_0x1e9f9e['id']){logger[_0xcfd1('0xb')](_0xcfd1('0x59'));logger[_0xcfd1('0xb')](_0xcfd1('0x4c'),_0x1e9f9e['id']);logger['info'](_0xcfd1('0x5a'),_0xcfd1('0x4d'));emit(util[_0xcfd1('0xe')]('user:%s',_0x19beff['name']),_0xcfd1('0x4f'),{'uri':util[_0xcfd1('0xe')]('%s/helpdesk/tickets/%d',_0x74110d[_0xcfd1('0x1f')],_0x1e9f9e['id'])});}})[_0xcfd1('0x51')](function(_0x568491){logger[_0xcfd1('0x5b')](_0xcfd1('0x5a'),JSON[_0xcfd1('0x30')](_0x568491));});};exports[_0xcfd1('0x5c')]=function(_0x1b9391,_0x1e479c,_0xccd00e,_0x1b8907,_0x27f106,_0x2fc49b){var _0x36e471,_0x59ac57;_0x2fc49b[_0xcfd1('0x1f')]=intUtil[_0xcfd1('0x43')](_0x2fc49b['remoteUri']);_0x2fc49b[_0xcfd1('0x44')]=intUtil[_0xcfd1('0x43')](_0x2fc49b[_0xcfd1('0x44')]);if(_0x27f106&&_0x27f106[_0xcfd1('0x45')]){logger['info']('['+_0x1e479c['lastevent']['toUpperCase']()+']',_0xcfd1('0x55'));_0x1e479c['recordingURL']=util[_0xcfd1('0xe')](_0xcfd1('0x56'),_0x2fc49b['serverUrl'],_0x1e479c['uniqueid'],md5(_0x1e479c[_0xcfd1('0x48')]));}else{_0x1e479c[_0xcfd1('0x47')]='';}headers['Authorization']=getAuth(_0x2fc49b);return getUser(_0x2fc49b,'')[_0xcfd1('0x1d')](function(_0x4fef44){_0x36e471=_0x4fef44;logger['info'](_0xcfd1('0x4a'),_0x36e471['id']);return getEndUser(_0x2fc49b,_0x1e479c[_0xcfd1('0x10')],_0x1e479c[_0xcfd1('0x11')]);})[_0xcfd1('0x1d')](function(_0x3f5164){_0x59ac57=_0x3f5164;logger[_0xcfd1('0xb')]('The\x20Enduser\x20ID\x20is:',_0x59ac57['id']);return getTicket(_0x2fc49b,_0x36e471,_0x59ac57,_0xccd00e,_0x1e479c);})[_0xcfd1('0x1d')](function(_0x112911){if(_0x112911){logger[_0xcfd1('0xb')](_0xcfd1('0x59'));logger[_0xcfd1('0xb')](_0xcfd1('0x4c'),_0x112911['id']);}})[_0xcfd1('0x51')](function(_0x132bf2){logger[_0xcfd1('0x5b')]('['+_0x1e479c['lastevent'][_0xcfd1('0x5d')]()+']',JSON[_0xcfd1('0x30')](_0x132bf2));});}; \ 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 c6c9015..c1721e2 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 _0x7ea0=['ticketId','task','Task\x20created:','/contacts/','user:%s','emit','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','util','moment','./util','../../../../config/environment','freshsales','defaults','localhost','redis','/api/selector/owners','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','headers','agentEmail','userEmail','length','userId','Admin\x20selected','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','getString','Contact','add'];(function(_0x34a775,_0x3ccf56){var _0x2045aa=function(_0x36b11f){while(--_0x36b11f){_0x34a775['push'](_0x34a775['shift']());}};_0x2045aa(++_0x3ccf56);}(_0x7ea0,0x153));var _0x07ea=function(_0x36f579,_0x312b42){_0x36f579=_0x36f579-0x0;var _0x460e7f=_0x7ea0[_0x36f579];return _0x460e7f;};'use strict';var _=require(_0x07ea('0x0'));var rp=require('request-promise');var md5=require(_0x07ea('0x1'));var util=require(_0x07ea('0x2'));var moment=require(_0x07ea('0x3'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x07ea('0x4'));var config=require(_0x07ea('0x5'));var logger=require('../../../../config/logger')(_0x07ea('0x6'));config['redis']=_[_0x07ea('0x7')](config['redis'],{'host':_0x07ea('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x07ea('0x9')]));function getAdminId(_0x10d054,_0x42b1c4,_0x3832f0,_0x99476a){return new Promise(function(_0x29acfc,_0x537a2a){var _0x10f488=![];var _0x162a92={'method':'GET','uri':_0x99476a+_0x07ea('0xa'),'json':!![]};_0x162a92['headers']=_0x3832f0;logger[_0x07ea('0xb')](_0x07ea('0xc'));return rp(_0x162a92)[_0x07ea('0xd')](function(_0x1ac1cf){if(_0x1ac1cf){var _0x4a00cf=_0x1ac1cf[_0x07ea('0xe')];var _0x53ca7c=null;for(_0x53ca7c=0x0;_0x53ca7c<_0x4a00cf['length'];_0x53ca7c++){if(_0x4a00cf[_0x53ca7c][_0x07ea('0xf')]===_0x10d054[_0x07ea('0x10')]){_0x10d054[_0x07ea('0x11')]=_0x4a00cf[_0x53ca7c]['id'];_0x10f488=!![];}}if(_0x10f488){logger[_0x07ea('0xb')](_0x07ea('0x12'),_0x10d054[_0x07ea('0x11')]);_0x29acfc(_0x10d054);}else{_0x537a2a({'statusCode':0x194,'message':_0x07ea('0x13')});}}else{_0x537a2a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x07ea('0x14')](function(_0x20caca){logger[_0x07ea('0x15')]('['+[_0x42b1c4[_0x07ea('0x16')]()]+']',_0x20caca['message']);_0x537a2a(_0x20caca);});});}function getUser(_0x299ac6,_0xe720ad,_0x36331c){return function(_0x4632f9){return new Promise(function(_0x21561c,_0x553189){var _0x5c3f10={'method':_0x07ea('0x17'),'uri':_0x36331c+'/api/selector/owners','json':!![]};_0x5c3f10[_0x07ea('0x18')]=_0xe720ad;logger[_0x07ea('0xb')]('Getting\x20user\x20list');return rp(_0x5c3f10)[_0x07ea('0xd')](function(_0x1f2d93){if(_0x1f2d93){var _0x25621a=_0x1f2d93['users'];var _0x4ade7b=![];var _0x1e4fdd=null;if(_0x4632f9[_0x07ea('0x19')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x4632f9[_0x07ea('0x19')]);_0x4632f9[_0x07ea('0x1a')]=_0x4632f9[_0x07ea('0x19')];for(_0x1e4fdd=0x0;_0x1e4fdd<_0x25621a[_0x07ea('0x1b')];_0x1e4fdd++){if(_0x25621a[_0x1e4fdd][_0x07ea('0xf')]===_0x4632f9[_0x07ea('0x19')]){_0x4ade7b=!![];_0x4632f9['userId']=_0x25621a[_0x1e4fdd]['id'];logger[_0x07ea('0xb')]('User\x20found:',_0x4632f9[_0x07ea('0x1c')]);}}}if(!_0x4ade7b){logger[_0x07ea('0xb')](_0x07ea('0x1d'));_0x4632f9[_0x07ea('0x1a')]=_0x4632f9['adminEmail'];_0x4632f9[_0x07ea('0x1c')]=_0x4632f9[_0x07ea('0x11')];_0x4ade7b=!![];}if(_0x4ade7b){_0x21561c(_0x4632f9);}else{_0x553189({'statusCode':0x194,'message':_0x07ea('0x13')});}}else{_0x553189({'statusCode':0x194,'message':_0x07ea('0x13')});}})[_0x07ea('0x14')](function(_0x4f5486){logger[_0x07ea('0x15')]('['+[_0x299ac6[_0x07ea('0x16')]()]+']',_0x4f5486[_0x07ea('0x1e')]);_0x553189(_0x4f5486);});});};}function searchContact(_0x4cdc64,_0x291e47,_0x981178,_0xb57606){return new Promise(function(_0x208260,_0x54588a){var _0x191f42={'method':_0x07ea('0x17'),'headers':_0x291e47,'uri':_0x4cdc64+_0x07ea('0x1f')+_0xb57606+_0x07ea('0x20')+_0x981178+_0x07ea('0x21'),'json':!![]};rp(_0x191f42)[_0x07ea('0xd')](function(_0x2d044b){var _0x452352=_[_0x07ea('0x22')](_0x2d044b[_0x07ea('0x23')][_0x07ea('0x23')],[_0x981178,_0xb57606]);_0x208260(_0x452352);})[_0x07ea('0x14')](function(_0x1df7cd){_0x54588a(_0x1df7cd);});});}function getEndUser(_0x9c7eca,_0x2e87b4,_0x4d56cd){return function(_0x53b59a){return new Promise(function(_0x4ce869,_0x3aca52){logger[_0x07ea('0xb')](util[_0x07ea('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x53b59a[_0x07ea('0x25')]));searchContact(_0x4d56cd,_0x2e87b4,_0x07ea('0x26'),_0x53b59a[_0x07ea('0x25')])['then'](function(_0x3950ea){if(_0x3950ea){_0x53b59a['endUserId']=_0x3950ea['id'];logger['info'](_0x07ea('0x27'),_0x53b59a[_0x07ea('0x28')]);return _0x4ce869(_0x53b59a);}searchContact(_0x4d56cd,_0x2e87b4,_0x07ea('0x29'),_0x53b59a['contactNumber'])['then'](function(_0x1f25ce){if(_0x1f25ce){_0x53b59a['endUserId']=_0x1f25ce['id'];logger[_0x07ea('0xb')](_0x07ea('0x2a'),_0x53b59a['endUserId']);return _0x4ce869(_0x53b59a);}createEndUser(_0x53b59a,_0x9c7eca,_0x2e87b4,_0x4d56cd)['then'](function(_0x27d5c5){logger[_0x07ea('0xb')]('Contact\x20created:',_0x27d5c5[_0x07ea('0x28')]);return _0x4ce869(_0x27d5c5);});});})[_0x07ea('0x14')](function(_0x1d8f56){_0x3aca52(_0x1d8f56);});});};}function createEndUser(_0x357984,_0x28d034,_0x175ec9,_0x1f4545){return new Promise(function(_0x4bc57e,_0x3aaf74){var _0x7ac229=moment();var _0x5c19be={'method':_0x07ea('0x2b'),'uri':_0x1f4545+_0x07ea('0x2c'),'body':{'contact':{'last_name':_0x357984[_0x07ea('0x25')],'work_number':_0x357984[_0x07ea('0x25')],'mobile_number':_0x357984['contactNumber'],'owner_id':_0x357984[_0x07ea('0x1c')],'created_at':_0x7ac229[_0x07ea('0x24')](_0x07ea('0x2d'))}},'json':!![]};_0x5c19be['headers']=_0x175ec9;logger[_0x07ea('0xb')](_0x07ea('0x2e'));return rp(_0x5c19be)[_0x07ea('0xd')](function(_0x26193a){_0x357984[_0x07ea('0x28')]=_0x26193a['contact']['id'];_0x4bc57e(_0x357984);})[_0x07ea('0x14')](function(_0x5b9cb1){logger[_0x07ea('0x15')]('['+[_0x28d034[_0x07ea('0x16')]()]+']',_0x5b9cb1['message']);_0x3aaf74(_0x5b9cb1[_0x07ea('0x1e')]);});});}function getTicket(_0x24e50b,_0x1d0ae3,_0x10ed25,_0x333f0d,_0x20b0c0){return function(_0x1969ad){logger[_0x07ea('0xb')]('Creating\x20new\x20task');return new Promise(function(_0x3fda4a,_0x13a8fc){var _0x5637b3=moment();var _0x13bf8c={'method':_0x07ea('0x2b'),'uri':_0x10ed25+_0x07ea('0x2f'),'body':{'title':intUtil[_0x07ea('0x30')](_0x333f0d['Subjects'],_0x20b0c0,'\x20'),'description':intUtil[_0x07ea('0x30')](_0x333f0d['Descriptions'],_0x20b0c0,'\x0a'),'owner_id':_0x1969ad['userId'],'creater_id':_0x1969ad['adminId'],'targetable_id':_0x1969ad[_0x07ea('0x28')],'targetable_type':_0x07ea('0x31'),'created_at':_0x5637b3[_0x07ea('0x24')](_0x07ea('0x2d')),'due_date':_0x5637b3[_0x07ea('0x32')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x13bf8c[_0x07ea('0x18')]=_0x1d0ae3;return rp(_0x13bf8c)[_0x07ea('0xd')](function(_0x474a67){_0x1969ad[_0x07ea('0x33')]=_0x474a67[_0x07ea('0x34')]['id'];logger[_0x07ea('0xb')](_0x07ea('0x35'),_0x1969ad[_0x07ea('0x33')]);_0x3fda4a(_0x1969ad);})['catch'](function(_0x23672d){logger[_0x07ea('0x15')]('['+[_0x24e50b[_0x07ea('0x16')]()]+']',_0x23672d['message']);_0x13a8fc(_0x23672d[_0x07ea('0x1e')]);});});};}function emit(_0x4a8b1,_0x51f978,_0x21be5d){var _0x5a4352={'uri':_0x4a8b1+_0x07ea('0x36')+_0x21be5d};io['to'](util[_0x07ea('0x24')](_0x07ea('0x37'),_0x51f978))[_0x07ea('0x38')]('trigger:browser:url',_0x5a4352);}exports['cs']=function(_0x5e07fa,_0x4cd1a7,_0x492228,_0x5d0eeb,_0x505002,_0x410eea,_0x313b92,_0x182661){var _0x3e7bda={};var _0x30c8bd={'Authorization':'Token\x20token='+_0x410eea[_0x07ea('0x39')]};_0x410eea[_0x07ea('0x3a')]=intUtil[_0x07ea('0x3b')](_0x410eea[_0x07ea('0x3a')]);_0x410eea[_0x07ea('0x3c')]=intUtil[_0x07ea('0x3b')](_0x410eea[_0x07ea('0x3c')]);var _0xb0589=_0x410eea[_0x07ea('0x3a')];_0x3e7bda['adminEmail']=_0x410eea['username'];_0x3e7bda[_0x07ea('0x25')]=_0x182661[_0x07ea('0x3d')]()===_0x07ea('0x3e')?_0x4cd1a7['destcalleridnum']:_0x4cd1a7[_0x07ea('0x3f')];_0x3e7bda[_0x07ea('0x40')]=_0x182661===_0x07ea('0x41')||_0x182661==='unmanaged'?'queue':_0x07ea('0x3e');if(_0x5d0eeb){_0x3e7bda['agentEmail']=_0x5d0eeb[_0x07ea('0xf')];}var _0xaac1ca=util['format'](_0x07ea('0x42'),_0x410eea[_0x07ea('0x3c')],_0x4cd1a7['uniqueid'],md5(_0x4cd1a7[_0x07ea('0x43')]));if(_0x505002&&_0x505002['monitor_format']){logger['info']('[QUEUE]',_0x07ea('0x44'));_0x4cd1a7['recordingURL']=_0xaac1ca;}else if(_0x313b92&&_0x313b92['recordingFormat']&&_0x313b92[_0x07ea('0x45')]!==_0x07ea('0x46')){logger['info'](_0x07ea('0x47'),_0x07ea('0x44'));_0x4cd1a7[_0x07ea('0x48')]=_0xaac1ca;}else{_0x4cd1a7[_0x07ea('0x48')]='';}return getAdminId(_0x3e7bda,_0x182661,_0x30c8bd,_0xb0589)[_0x07ea('0xd')](getUser(_0x182661,_0x30c8bd,_0xb0589))['then'](getEndUser(_0x182661,_0x30c8bd,_0xb0589))[_0x07ea('0xd')](getTicket(_0x182661,_0x30c8bd,_0xb0589,_0x492228,_0x4cd1a7))[_0x07ea('0xd')](function(_0x5b8cec){logger['info'](util[_0x07ea('0x24')](_0x07ea('0x49'),_0x5b8cec[_0x07ea('0x33')]));if(_0x182661!==_0x07ea('0x4a')){logger[_0x07ea('0xb')]('['+[_0x182661['toUpperCase']()]+']',_0x07ea('0x4b'));emit(_0xb0589,_0x5d0eeb[_0x07ea('0x4c')],_0x5b8cec[_0x07ea('0x28')]);}})[_0x07ea('0x14')](function(_0x18add3){logger[_0x07ea('0x15')]('['+[_0x182661[_0x07ea('0x16')]()]+_0x07ea('0x4d'),util['inspect'](_0x18add3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb832=['redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','error','Creating\x20new\x20task','/api/tasks','Subjects','getString','Descriptions','Contact','add','task','Task\x20created:','ticketId','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xb832,0x159));var _0x2b83=function(_0x5c5a52,_0x216d72){_0x5c5a52=_0x5c5a52-0x0;var _0x36a7ec=_0xb832[_0x5c5a52];return _0x36a7ec;};'use strict';var _=require(_0x2b83('0x0'));var rp=require(_0x2b83('0x1'));var md5=require('md5');var util=require(_0x2b83('0x2'));var moment=require(_0x2b83('0x3'));var Promise=require(_0x2b83('0x4'));var Redis=require(_0x2b83('0x5'));var intUtil=require(_0x2b83('0x6'));var config=require(_0x2b83('0x7'));var logger=require(_0x2b83('0x8'))(_0x2b83('0x9'));config['redis']=_[_0x2b83('0xa')](config[_0x2b83('0xb')],{'host':_0x2b83('0xc'),'port':0x18eb});var io=require(_0x2b83('0xd'))(new Redis(config[_0x2b83('0xb')]));function getAdminId(_0x1308c8,_0x326523,_0xa3e3bd,_0x4c715c){return new Promise(function(_0x38b6ac,_0xea37e7){var _0x2ad56c=![];var _0x53b501={'method':_0x2b83('0xe'),'uri':_0x4c715c+_0x2b83('0xf'),'json':!![]};_0x53b501[_0x2b83('0x10')]=_0xa3e3bd;logger[_0x2b83('0x11')](_0x2b83('0x12'));return rp(_0x53b501)['then'](function(_0x4f3690){if(_0x4f3690){var _0x488a71=_0x4f3690[_0x2b83('0x13')];var _0x21e79f=null;for(_0x21e79f=0x0;_0x21e79f<_0x488a71[_0x2b83('0x14')];_0x21e79f++){if(_0x488a71[_0x21e79f][_0x2b83('0x15')]===_0x1308c8[_0x2b83('0x16')]){_0x1308c8['adminId']=_0x488a71[_0x21e79f]['id'];_0x2ad56c=!![];}}if(_0x2ad56c){logger[_0x2b83('0x11')](_0x2b83('0x17'),_0x1308c8[_0x2b83('0x18')]);_0x38b6ac(_0x1308c8);}else{_0xea37e7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xea37e7({'statusCode':0x194,'message':_0x2b83('0x19')});}})[_0x2b83('0x1a')](function(_0x5a7b0e){logger['error']('['+[_0x326523[_0x2b83('0x1b')]()]+']',_0x5a7b0e[_0x2b83('0x1c')]);_0xea37e7(_0x5a7b0e);});});}function getUser(_0x17f8d2,_0x3619f4,_0x29e538){return function(_0x3f85b9){return new Promise(function(_0x35bd1d,_0x2d5e9f){var _0x337c4d={'method':_0x2b83('0xe'),'uri':_0x29e538+_0x2b83('0xf'),'json':!![]};_0x337c4d[_0x2b83('0x10')]=_0x3619f4;logger[_0x2b83('0x11')]('Getting\x20user\x20list');return rp(_0x337c4d)[_0x2b83('0x1d')](function(_0x2993c8){if(_0x2993c8){var _0x47362a=_0x2993c8[_0x2b83('0x13')];var _0x5a66f8=![];var _0x4e523f=null;if(_0x3f85b9[_0x2b83('0x1e')]!==null){logger[_0x2b83('0x11')](_0x2b83('0x1f'),_0x3f85b9[_0x2b83('0x1e')]);_0x3f85b9[_0x2b83('0x20')]=_0x3f85b9[_0x2b83('0x1e')];for(_0x4e523f=0x0;_0x4e523f<_0x47362a[_0x2b83('0x14')];_0x4e523f++){if(_0x47362a[_0x4e523f][_0x2b83('0x15')]===_0x3f85b9[_0x2b83('0x1e')]){_0x5a66f8=!![];_0x3f85b9['userId']=_0x47362a[_0x4e523f]['id'];logger[_0x2b83('0x11')](_0x2b83('0x21'),_0x3f85b9[_0x2b83('0x22')]);}}}if(!_0x5a66f8){logger[_0x2b83('0x11')](_0x2b83('0x23'));_0x3f85b9[_0x2b83('0x20')]=_0x3f85b9[_0x2b83('0x16')];_0x3f85b9['userId']=_0x3f85b9[_0x2b83('0x18')];_0x5a66f8=!![];}if(_0x5a66f8){_0x35bd1d(_0x3f85b9);}else{_0x2d5e9f({'statusCode':0x194,'message':_0x2b83('0x19')});}}else{_0x2d5e9f({'statusCode':0x194,'message':_0x2b83('0x19')});}})[_0x2b83('0x1a')](function(_0x15877c){logger['error']('['+[_0x17f8d2[_0x2b83('0x1b')]()]+']',_0x15877c['message']);_0x2d5e9f(_0x15877c);});});};}function searchContact(_0x51771d,_0x1f3e49,_0x5466f3,_0xa4402){return new Promise(function(_0x585203,_0x44ee8d){var _0xcfb03b={'method':'GET','headers':_0x1f3e49,'uri':_0x51771d+_0x2b83('0x24')+_0xa4402+_0x2b83('0x25')+_0x5466f3+_0x2b83('0x26'),'json':!![]};rp(_0xcfb03b)[_0x2b83('0x1d')](function(_0x2a3377){var _0x3f9717=_[_0x2b83('0x27')](_0x2a3377[_0x2b83('0x28')][_0x2b83('0x28')],[_0x5466f3,_0xa4402]);_0x585203(_0x3f9717);})[_0x2b83('0x1a')](function(_0x1d283f){_0x44ee8d(_0x1d283f);});});}function getEndUser(_0x2a4d2e,_0x149e5f,_0x151b76){return function(_0x539630){return new Promise(function(_0x25ea19,_0x89c6c2){logger[_0x2b83('0x11')](util[_0x2b83('0x29')](_0x2b83('0x2a'),_0x539630[_0x2b83('0x2b')]));searchContact(_0x151b76,_0x149e5f,_0x2b83('0x2c'),_0x539630[_0x2b83('0x2b')])[_0x2b83('0x1d')](function(_0x5a14cc){if(_0x5a14cc){_0x539630['endUserId']=_0x5a14cc['id'];logger[_0x2b83('0x11')](_0x2b83('0x2d'),_0x539630[_0x2b83('0x2e')]);return _0x25ea19(_0x539630);}searchContact(_0x151b76,_0x149e5f,'work_number',_0x539630[_0x2b83('0x2b')])[_0x2b83('0x1d')](function(_0x3cd292){if(_0x3cd292){_0x539630[_0x2b83('0x2e')]=_0x3cd292['id'];logger[_0x2b83('0x11')](_0x2b83('0x2f'),_0x539630[_0x2b83('0x2e')]);return _0x25ea19(_0x539630);}createEndUser(_0x539630,_0x2a4d2e,_0x149e5f,_0x151b76)['then'](function(_0x3468af){logger[_0x2b83('0x11')](_0x2b83('0x30'),_0x3468af['endUserId']);return _0x25ea19(_0x3468af);});});})['catch'](function(_0x66cfb5){_0x89c6c2(_0x66cfb5);});});};}function createEndUser(_0x552238,_0x39ba79,_0x4e46f2,_0x3aced2){return new Promise(function(_0x553d9d,_0x3554ae){var _0x2bad06=moment();var _0x12ae45={'method':_0x2b83('0x31'),'uri':_0x3aced2+_0x2b83('0x32'),'body':{'contact':{'last_name':_0x552238[_0x2b83('0x2b')],'work_number':_0x552238[_0x2b83('0x2b')],'mobile_number':_0x552238[_0x2b83('0x2b')],'owner_id':_0x552238[_0x2b83('0x22')],'created_at':_0x2bad06[_0x2b83('0x29')](_0x2b83('0x33'))}},'json':!![]};_0x12ae45[_0x2b83('0x10')]=_0x4e46f2;logger['info'](_0x2b83('0x34'));return rp(_0x12ae45)[_0x2b83('0x1d')](function(_0x3632c5){_0x552238[_0x2b83('0x2e')]=_0x3632c5[_0x2b83('0x35')]['id'];_0x553d9d(_0x552238);})[_0x2b83('0x1a')](function(_0x3a3ea6){logger[_0x2b83('0x36')]('['+[_0x39ba79[_0x2b83('0x1b')]()]+']',_0x3a3ea6[_0x2b83('0x1c')]);_0x3554ae(_0x3a3ea6['message']);});});}function getTicket(_0x5a0f83,_0x1429b8,_0x1b8735,_0x278c4b,_0x52908a){return function(_0x34b9be){logger['info'](_0x2b83('0x37'));return new Promise(function(_0x9dc90a,_0xb0ae16){var _0x41e9eb=moment();var _0x290c39={'method':'POST','uri':_0x1b8735+_0x2b83('0x38'),'body':{'title':intUtil['getString'](_0x278c4b[_0x2b83('0x39')],_0x52908a,'\x20'),'description':intUtil[_0x2b83('0x3a')](_0x278c4b[_0x2b83('0x3b')],_0x52908a,'\x0a'),'owner_id':_0x34b9be['userId'],'creater_id':_0x34b9be[_0x2b83('0x18')],'targetable_id':_0x34b9be[_0x2b83('0x2e')],'targetable_type':_0x2b83('0x3c'),'created_at':_0x41e9eb[_0x2b83('0x29')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x41e9eb[_0x2b83('0x3d')](0x1e,'m')[_0x2b83('0x29')](_0x2b83('0x33'))},'json':!![]};_0x290c39['headers']=_0x1429b8;return rp(_0x290c39)[_0x2b83('0x1d')](function(_0x3db253){_0x34b9be['ticketId']=_0x3db253[_0x2b83('0x3e')]['id'];logger[_0x2b83('0x11')](_0x2b83('0x3f'),_0x34b9be[_0x2b83('0x40')]);_0x9dc90a(_0x34b9be);})['catch'](function(_0x434904){logger['error']('['+[_0x5a0f83[_0x2b83('0x1b')]()]+']',_0x434904[_0x2b83('0x1c')]);_0xb0ae16(_0x434904[_0x2b83('0x1c')]);});});};}function emit(_0x2df5ae,_0x2f92b6,_0x5abf2f){var _0x4a1248={'uri':_0x2df5ae+'/contacts/'+_0x5abf2f};io['to'](util['format']('user:%s',_0x2f92b6))[_0x2b83('0x41')](_0x2b83('0x42'),_0x4a1248);}exports['cs']=function(_0x15393e,_0x552880,_0xf593b8,_0x63830,_0x5acf38,_0x20bf29,_0x2e41ef,_0x5a0e1e){var _0x52173a={};var _0x132099={'Authorization':_0x2b83('0x43')+_0x20bf29[_0x2b83('0x44')]};_0x20bf29[_0x2b83('0x45')]=intUtil[_0x2b83('0x46')](_0x20bf29[_0x2b83('0x45')]);_0x20bf29[_0x2b83('0x47')]=intUtil['stripTrailingSlash'](_0x20bf29[_0x2b83('0x47')]);var _0xc651fb=_0x20bf29[_0x2b83('0x45')];_0x52173a['adminEmail']=_0x20bf29['username'];_0x52173a[_0x2b83('0x2b')]=_0x5a0e1e[_0x2b83('0x48')]()==='outbound'?_0x552880[_0x2b83('0x49')]:_0x552880[_0x2b83('0x4a')];_0x52173a[_0x2b83('0x4b')]=_0x5a0e1e===_0x2b83('0x4c')||_0x5a0e1e===_0x2b83('0x4d')?_0x2b83('0x4c'):_0x2b83('0x4e');if(_0x63830){_0x52173a[_0x2b83('0x1e')]=_0x63830['email'];}var _0xa46d86=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20bf29[_0x2b83('0x47')],_0x552880[_0x2b83('0x4f')],md5(_0x552880[_0x2b83('0x4f')]));if(_0x5acf38&&_0x5acf38['monitor_format']){logger['info']('[QUEUE]',_0x2b83('0x50'));_0x552880['recordingURL']=_0xa46d86;}else if(_0x2e41ef&&_0x2e41ef[_0x2b83('0x51')]&&_0x2e41ef[_0x2b83('0x51')]!==_0x2b83('0x52')){logger[_0x2b83('0x11')](_0x2b83('0x53'),'Recording\x20is\x20enabled!');_0x552880[_0x2b83('0x54')]=_0xa46d86;}else{_0x552880[_0x2b83('0x54')]='';}return getAdminId(_0x52173a,_0x5a0e1e,_0x132099,_0xc651fb)[_0x2b83('0x1d')](getUser(_0x5a0e1e,_0x132099,_0xc651fb))[_0x2b83('0x1d')](getEndUser(_0x5a0e1e,_0x132099,_0xc651fb))[_0x2b83('0x1d')](getTicket(_0x5a0e1e,_0x132099,_0xc651fb,_0xf593b8,_0x552880))[_0x2b83('0x1d')](function(_0x168ae0){logger[_0x2b83('0x11')](util[_0x2b83('0x29')](_0x2b83('0x55'),_0x168ae0[_0x2b83('0x40')]));if(_0x5a0e1e!==_0x2b83('0x4d')){logger[_0x2b83('0x11')]('['+[_0x5a0e1e['toUpperCase']()]+']',_0x2b83('0x56'));emit(_0xc651fb,_0x63830[_0x2b83('0x57')],_0x168ae0[_0x2b83('0x2e')]);}})[_0x2b83('0x1a')](function(_0x637c2e){logger[_0x2b83('0x36')]('['+[_0x5a0e1e[_0x2b83('0x1b')]()]+_0x2b83('0x58'),util['inspect'](_0x637c2e,{'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 6aaa1ab..947ff48 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 _0xcd8b=['./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','unmanaged','vtiger','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce'];(function(_0x5e00d9,_0x16319b){var _0x3f53d1=function(_0x408f34){while(--_0x408f34){_0x5e00d9['push'](_0x5e00d9['shift']());}};_0x3f53d1(++_0x16319b);}(_0xcd8b,0x15c));var _0xbcd8=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcd8b[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xbcd8('0x0'));var util=require('util');var zendesk=require(_0xbcd8('0x1'));var salesforce=require(_0xbcd8('0x2'));var sugarcrm=require(_0xbcd8('0x3'));var freshdesk=require(_0xbcd8('0x4'));var zoho=require(_0xbcd8('0x5'));var desk=require(_0xbcd8('0x6'));var vtiger=require(_0xbcd8('0x7'));var servicenow=require(_0xbcd8('0x8'));var dynamics365=require(_0xbcd8('0x9'));var freshsales=require('./freshsales');var integrations=[_0xbcd8('0xa'),_0xbcd8('0xb'),_0xbcd8('0xc'),_0xbcd8('0xd'),_0xbcd8('0xe'),_0xbcd8('0xf'),'vtiger',_0xbcd8('0x10'),'freshsales',_0xbcd8('0x11')];exports['exec']=function(_0xf95641,_0x5ccd9a,_0x4b9982,_0x3f60b5,_0x1ce2fb,_0x5dca44){if(_0x4b9982){if(_[_0xbcd8('0x12')](integrations,_0xf95641[_0xbcd8('0x13')][_0xbcd8('0x14')]())){try{var _0x9d9edb=null;var _0x199589='';var _0x637349=_0x4b9982[_0xf95641[_0xbcd8('0x13')][_0xbcd8('0x14')]()];if(_0x637349){var _0x3fd990=_0x637349[_0xf95641[_0xbcd8('0x15')]];if(_0x3fd990){var _0x5f4421=_[_0xbcd8('0x16')](_0x3fd990[_0xbcd8('0x17')],{'id':parseInt(_0xf95641[_0xbcd8('0x18')],0xa)});if(_0x5f4421){if(_0x3f60b5){if(_0x1ce2fb&&_0x5ccd9a[_0xbcd8('0x19')]){_0x199589=_0xbcd8('0x19');}else if(_0x5ccd9a[_0xbcd8('0x1a')]){_0x199589=_0xbcd8('0x1b');}else{console[_0xbcd8('0x1c')]('EVENT\x20UNKNOWN',_0x5ccd9a);}}else{_0x199589=_0xbcd8('0x1d');}switch(_0xf95641[_0xbcd8('0x13')]['toLowerCase']()){case'zendesk':zendesk[_0x199589](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44);break;case _0xbcd8('0xb'):salesforce[_0x199589](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44);break;case _0xbcd8('0xc'):sugarcrm[_0x199589](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44);break;case _0xbcd8('0xd'):freshdesk[_0x199589](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44);break;case _0xbcd8('0xe'):zoho[_0x199589](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44);break;case'desk':desk[_0x199589](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44);break;case _0xbcd8('0x1e'):vtiger[_0x199589](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44);break;case _0xbcd8('0x1f'):freshsales['cs'](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44,_0x199589);break;case _0xbcd8('0x11'):servicenow['cs'](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44,_0x199589);break;case _0xbcd8('0x10'):dynamics365['cs'](_0xf95641,_0x5ccd9a,_0x5f4421,_0x3f60b5,_0x1ce2fb,_0x3fd990,_0x5dca44,_0x199589);break;default:console[_0xbcd8('0x1c')](_0xbcd8('0x20'));}}else{_0x9d9edb=require(_0xbcd8('0x21'))(_0xf95641[_0xbcd8('0x13')][_0xbcd8('0x14')]());_0x9d9edb[_0xbcd8('0x22')](_0xbcd8('0x23'),util['format'](_0xbcd8('0x24'),_0xf95641[_0xbcd8('0x13')][_0xbcd8('0x14')](),_0xf95641[_0xbcd8('0x18')]));}}else{_0x9d9edb=require('../../../../config/logger')(_0xf95641[_0xbcd8('0x13')][_0xbcd8('0x14')]());_0x9d9edb[_0xbcd8('0x22')](_0xbcd8('0x23'),util[_0xbcd8('0x25')](_0xbcd8('0x26'),_0xf95641[_0xbcd8('0x13')]['toLowerCase'](),_0xf95641[_0xbcd8('0x15')]));}}else{}}catch(_0x35d019){console[_0xbcd8('0x22')](_0x35d019);}}}}; \ No newline at end of file +var _0x5ca3=['servicenow','includes','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','unmanaged','log','unknown\x20integration','../../../../config/logger','error','format','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./zoho','./desk','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales'];(function(_0x2fdeb4,_0x5efe4b){var _0x552934=function(_0x1a55fd){while(--_0x1a55fd){_0x2fdeb4['push'](_0x2fdeb4['shift']());}};_0x552934(++_0x5efe4b);}(_0x5ca3,0x10f));var _0x35ca=function(_0x366269,_0x31d7d3){_0x366269=_0x366269-0x0;var _0x34ed77=_0x5ca3[_0x366269];return _0x34ed77;};'use strict';var _=require(_0x35ca('0x0'));var util=require(_0x35ca('0x1'));var zendesk=require(_0x35ca('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x35ca('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x35ca('0x4'));var desk=require(_0x35ca('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0x35ca('0x6'));var dynamics365=require(_0x35ca('0x7'));var freshsales=require('./freshsales');var integrations=[_0x35ca('0x8'),_0x35ca('0x9'),_0x35ca('0xa'),_0x35ca('0xb'),_0x35ca('0xc'),_0x35ca('0xd'),_0x35ca('0xe'),_0x35ca('0xf'),_0x35ca('0x10'),_0x35ca('0x11')];exports['exec']=function(_0x4dbbd1,_0x23a6be,_0x43b00a,_0x7b69c0,_0x199915,_0x2bc370){if(_0x43b00a){if(_[_0x35ca('0x12')](integrations,_0x4dbbd1['data1'][_0x35ca('0x13')]())){try{var _0x38a85a=null;var _0x448719='';var _0x3075ad=_0x43b00a[_0x4dbbd1[_0x35ca('0x14')][_0x35ca('0x13')]()];if(_0x3075ad){var _0x31f796=_0x3075ad[_0x4dbbd1[_0x35ca('0x15')]];if(_0x31f796){var _0x2a2368=_[_0x35ca('0x16')](_0x31f796[_0x35ca('0x17')],{'id':parseInt(_0x4dbbd1[_0x35ca('0x18')],0xa)});if(_0x2a2368){if(_0x7b69c0){if(_0x199915&&_0x23a6be[_0x35ca('0x19')]){_0x448719=_0x35ca('0x19');}else if(_0x23a6be[_0x35ca('0x1a')]){_0x448719='outbound';}else{console['log'](_0x35ca('0x1b'),_0x23a6be);}}else{_0x448719=_0x35ca('0x1c');}switch(_0x4dbbd1[_0x35ca('0x14')][_0x35ca('0x13')]()){case _0x35ca('0x8'):zendesk[_0x448719](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370);break;case _0x35ca('0x9'):salesforce[_0x448719](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370);break;case _0x35ca('0xa'):sugarcrm[_0x448719](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370);break;case _0x35ca('0xb'):freshdesk[_0x448719](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370);break;case _0x35ca('0xc'):zoho[_0x448719](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370);break;case _0x35ca('0xd'):desk[_0x448719](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370);break;case _0x35ca('0xe'):vtiger[_0x448719](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370);break;case'freshsales':freshsales['cs'](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370,_0x448719);break;case _0x35ca('0x11'):servicenow['cs'](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370,_0x448719);break;case _0x35ca('0xf'):dynamics365['cs'](_0x4dbbd1,_0x23a6be,_0x2a2368,_0x7b69c0,_0x199915,_0x31f796,_0x2bc370,_0x448719);break;default:console[_0x35ca('0x1d')](_0x35ca('0x1e'));}}else{_0x38a85a=require(_0x35ca('0x1f'))(_0x4dbbd1[_0x35ca('0x14')][_0x35ca('0x13')]());_0x38a85a[_0x35ca('0x20')]('[EXEC]',util[_0x35ca('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0x4dbbd1['data1']['toLowerCase'](),_0x4dbbd1[_0x35ca('0x18')]));}}else{_0x38a85a=require('../../../../config/logger')(_0x4dbbd1[_0x35ca('0x14')][_0x35ca('0x13')]());_0x38a85a[_0x35ca('0x20')](_0x35ca('0x22'),util[_0x35ca('0x21')](_0x35ca('0x23'),_0x4dbbd1[_0x35ca('0x14')][_0x35ca('0x13')](),_0x4dbbd1[_0x35ca('0x15')]));}}else{}}catch(_0x3ef2e0){console[_0x35ca('0x20')](_0x3ef2e0);}}}}; \ 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 f6b9ad9..235b496 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 _0x7751=['Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','includes','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','catch','lodash','request-promise','jsforce','util','ioredis','./util','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','execute','additionalSearchLead','account_contact_lead','additionalSearchAccount','$or','Lead','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found'];(function(_0x497d6d,_0xff7558){var _0x4a1d9a=function(_0x2d2fdf){while(--_0x2d2fdf){_0x497d6d['push'](_0x497d6d['shift']());}};_0x4a1d9a(++_0xff7558);}(_0x7751,0x1be));var _0x1775=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7751[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1775('0x0'));var rp=require(_0x1775('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x1775('0x2'));var util=require(_0x1775('0x3'));var Redis=require(_0x1775('0x4'));var intUtil=require(_0x1775('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1775('0x6'));config[_0x1775('0x7')]=_[_0x1775('0x8')](config[_0x1775('0x7')],{'host':_0x1775('0x9'),'port':0x18eb});var io=require(_0x1775('0xa'))(new Redis(config['redis']));function emit(_0x55b75f,_0x154daa,_0x1c2ba0){io['to'](_0x55b75f)[_0x1775('0xb')](_0x154daa,_0x1c2ba0);}function getTicket(_0x4ee9fc,_0x22787b,_0x36f8c5,_0x3a6c67,_0x53f4cb,_0x678a19,_0x56948d,_0x2f3cd4){var _0x4aa0f1=Object[_0x1775('0xc')]({},{'OwnerId':_0x22787b['id'],'Subject':intUtil[_0x1775('0xd')](_0x3a6c67[_0x1775('0xe')],_0x53f4cb,'\x20'),'Description':intUtil['getString'](_0x3a6c67['Descriptions'],_0x53f4cb,'\x0a')},getCustomFields(_0x678a19,_0x53f4cb));if(_0x36f8c5){if(_0x3a6c67[_0x1775('0xf')]===_0x1775('0x10')){_0x4aa0f1[_0x1775('0x11')]=moment[_0x1775('0x12')]();_0x4aa0f1[_0x1775('0x13')]=![];_0x4aa0f1[_0x1775('0x14')]=![];if(_0x36f8c5[_0x1775('0x15')]===_0x1775('0x16')||_0x36f8c5['endUserType']===_0x1775('0x17')){_0x4aa0f1['WhoId']=_0x36f8c5['id'];}else if(_0x36f8c5[_0x1775('0x15')]===_0x1775('0x18')){_0x4aa0f1['WhatId']=_0x36f8c5['id'];}}else if(_0x3a6c67['ticketType']==='Case'){if(_0x36f8c5[_0x1775('0x15')]===_0x1775('0x16')){_0x4aa0f1[_0x1775('0x19')]=_0x36f8c5['id'];}else if(_0x36f8c5[_0x1775('0x15')]===_0x1775('0x18')){_0x4aa0f1[_0x1775('0x1a')]=_0x36f8c5['id'];}else if(_0x36f8c5[_0x1775('0x15')]===_0x1775('0x17')&&_0x3a6c67[_0x1775('0x1b')]){_0x4aa0f1[_0x3a6c67[_0x1775('0x1b')]]=_0x36f8c5['id'];}else{logger[_0x1775('0x1c')](_0x1775('0x1d'));}}}return _0x56948d[_0x1775('0x1e')](_0x3a6c67['ticketType'])[_0x1775('0x1f')](_0x4aa0f1);}function getUser(_0x1c994c,_0x5d1af1,_0x6dce1d){if(!_[_0x1775('0x20')](_0x5d1af1)&&intUtil[_0x1775('0x21')](_0x5d1af1)){var _0x160fc5={'Email':_0x5d1af1};var _0xd83779={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x6dce1d['sobject'](_0x1775('0x22'))[_0x1775('0x23')](_0x160fc5,_0xd83779)['execute']()['then'](function(_0x3f342a){if(_0x3f342a[_0x1775('0x24')]){var _0x139314=_[_0x1775('0x23')](_0x3f342a,function(_0x3a5a27){return _0x3a5a27[_0x1775('0x25')]===_0x5d1af1;});if(_0x139314){logger['info'](_0x1775('0x26'),_0x5d1af1);return BPromise[_0x1775('0x27')]({'id':_0x139314['Id'],'name':_0x139314[_0x1775('0x28')]});}}else{logger[_0x1775('0x1c')](_0x1775('0x29'),_0x5d1af1);return _0x6dce1d[_0x1775('0x2a')]()[_0x1775('0x2b')](function(_0x276456){return BPromise[_0x1775('0x27')]({'id':_0x276456[_0x1775('0x2c')],'name':_0x276456[_0x1775('0x2d')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5d1af1);return _0x6dce1d[_0x1775('0x2a')]()[_0x1775('0x2b')](function(_0x1ba186){return BPromise['resolve']({'id':_0x1ba186[_0x1775('0x2c')],'name':_0x1ba186['display_name']});});}}function getEndUser(_0x59647f,_0x3c0198,_0xdb6c18,_0x1a0cb2,_0x112b94){var _0x1e05fd={'$or':{'Phone':_0x1a0cb2}};var _0x30eb55={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1775('0x27')]()[_0x1775('0x2b')](function(){logger[_0x1775('0x1c')](_0x1775('0x2e'),_0x1a0cb2,_0x3c0198[_0x1775('0x2f')]);switch(_0x3c0198[_0x1775('0x2f')]){case _0x1775('0x30'):var _0x48e70f=_[_0x1775('0x31')](_0x1e05fd);if(_0x3c0198['additionalSearchContact']){var _0x3e9e5c={};_0x3e9e5c[_0x3c0198[_0x1775('0x32')]]=_0x1a0cb2;_[_0x1775('0x33')](_0x48e70f['$or'],_0x3e9e5c);}return _0x112b94[_0x1775('0x1e')](_0x1775('0x34'))[_0x1775('0x23')](_0x48e70f,_0x30eb55)[_0x1775('0x35')]()[_0x1775('0x2b')](function(_0x1eebb4){if(_0x1eebb4&&_0x1eebb4[_0x1775('0x24')]){return _0x1eebb4;}else{var _0x3ded42=_['cloneDeep'](_0x1e05fd);if(_0x3c0198[_0x1775('0x36')]){var _0x5d465d={};_0x5d465d[_0x3c0198[_0x1775('0x36')]]=_0x1a0cb2;_[_0x1775('0x33')](_0x3ded42['$or'],_0x5d465d);}return _0x112b94['sobject']('Lead')[_0x1775('0x23')](_0x3ded42,_0x30eb55);}});case _0x1775('0x37'):var _0x9deb40=_[_0x1775('0x31')](_0x1e05fd);if(_0x3c0198[_0x1775('0x38')]){var _0x3e9e5c={};_0x3e9e5c[_0x3c0198[_0x1775('0x38')]]=_0x1a0cb2;_[_0x1775('0x33')](_0x9deb40[_0x1775('0x39')],_0x3e9e5c);}return _0x112b94['sobject']('Account')['find'](_0x9deb40,_0x30eb55)[_0x1775('0x35')]()['then'](function(_0x439ab6){if(_0x439ab6&&_0x439ab6['length']){return _0x439ab6;}else{var _0x731cff=_[_0x1775('0x31')](_0x1e05fd);if(_0x3c0198[_0x1775('0x32')]){var _0x4ddae7={};_0x4ddae7[_0x3c0198[_0x1775('0x32')]]=_0x1a0cb2;_[_0x1775('0x33')](_0x731cff[_0x1775('0x39')],_0x4ddae7);}return _0x112b94['sobject'](_0x1775('0x34'))[_0x1775('0x23')](_0x731cff,_0x30eb55)[_0x1775('0x2b')](function(_0x366013){if(_0x366013&&_0x366013[_0x1775('0x24')]){return _0x366013;}else{var _0x1c2ed8=_['cloneDeep'](_0x1e05fd);if(_0x3c0198['additionalSearchLead']){var _0x31b93f={};_0x31b93f[_0x3c0198[_0x1775('0x36')]]=_0x1a0cb2;_[_0x1775('0x33')](_0x1c2ed8[_0x1775('0x39')],_0x31b93f);}return _0x112b94['sobject'](_0x1775('0x3a'))[_0x1775('0x23')](_0x1c2ed8,_0x30eb55);}});}});case _0x1775('0x16'):var _0x48e70f=_[_0x1775('0x31')](_0x1e05fd);if(_0x3c0198['additionalSearchContact']){var _0x3e9e5c={};_0x3e9e5c[_0x3c0198[_0x1775('0x32')]]=_0x1a0cb2;_[_0x1775('0x33')](_0x48e70f[_0x1775('0x39')],_0x3e9e5c);}return _0x112b94[_0x1775('0x1e')](_0x1775('0x34'))['find'](_0x48e70f,_0x30eb55)[_0x1775('0x35')]();case'lead':var _0xf7aa50=_[_0x1775('0x31')](_0x1e05fd);if(_0x3c0198[_0x1775('0x36')]){var _0x3e9e5c={};_0x3e9e5c[_0x3c0198[_0x1775('0x36')]]=_0x1a0cb2;_[_0x1775('0x33')](_0xf7aa50[_0x1775('0x39')],_0x3e9e5c);}return _0x112b94[_0x1775('0x1e')](_0x1775('0x3a'))[_0x1775('0x23')](_0xf7aa50,_0x30eb55);case _0x1775('0x18'):var _0x9deb40=_[_0x1775('0x31')](_0x1e05fd);if(_0x3c0198[_0x1775('0x38')]){var _0x3e9e5c={};_0x3e9e5c[_0x3c0198['additionalSearchAccount']]=_0x1a0cb2;_[_0x1775('0x33')](_0x9deb40[_0x1775('0x39')],_0x3e9e5c);}return _0x112b94[_0x1775('0x1e')](_0x1775('0x3b'))[_0x1775('0x23')](_0x9deb40,_0x30eb55);default:return null;}})['then'](function(_0x21b676){if(_0x21b676&&_0x21b676['length']){var _0x5e76f5=_[_0x1775('0x3c')](_0x21b676);if(_0x5e76f5){return BPromise[_0x1775('0x27')]({'id':_0x5e76f5['Id'],'name':_0x5e76f5[_0x1775('0x28')],'phone':_0x5e76f5[_0x1775('0x3d')],'endUserType':_0x5e76f5[_0x1775('0x3e')][_0x1775('0x3f')][_0x1775('0x40')]()});}}})[_0x1775('0x2b')](function(_0x3f3764){if(_0x3f3764){logger[_0x1775('0x1c')](_0x1775('0x41'),_0x3f3764[_0x1775('0x15')],_0x1a0cb2);return BPromise[_0x1775('0x27')](_0x3f3764);}else{logger['info'](_0x1775('0x42'),_0x1a0cb2);var _0x1f63fc={'Phone':_0x1a0cb2};if(_0x3c0198[_0x1775('0x43')]){if(_0x3c0198[_0x1775('0x43')]===_0x1775('0x16')){logger['info'](_0x1775('0x44'),_0x1a0cb2,_0x3c0198[_0x1775('0x43')]);_0x1f63fc[_0x1775('0x45')]=_0xdb6c18!==''?_0xdb6c18:util[_0x1775('0x46')](_0x1775('0x47'),_0x1a0cb2);}else if(_0x3c0198[_0x1775('0x43')]==='lead'){logger['info'](_0x1775('0x44'),_0x1a0cb2,_0x3c0198['moduleCreate']);_0x1f63fc['LastName']=_0xdb6c18!==''?_0xdb6c18:util[_0x1775('0x46')]('Caller\x20-\x20%s',_0x1a0cb2);_0x1f63fc['Company']='No\x20Company';}else if(_0x3c0198['moduleCreate']===_0x1775('0x18')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1a0cb2,_0x3c0198[_0x1775('0x43')]);_0x1f63fc[_0x1775('0x28')]=_0xdb6c18!==''?_0xdb6c18:util[_0x1775('0x46')](_0x1775('0x47'),_0x1a0cb2);}else{return null;}}return _0x112b94['sobject'](_['upperFirst'](_0x3c0198['moduleCreate']))[_0x1775('0x1f')](_0x1f63fc)[_0x1775('0x2b')](function(_0x2616cd){return BPromise[_0x1775('0x27')]({'id':_0x2616cd['id'],'endUserType':_0x3c0198[_0x1775('0x43')]});});}});}function getCustomFields(_0x57d3e1,_0xead4d7){var _0x52a95c={};if(_0x57d3e1[_0x1775('0x24')]>0x0){_['forEach'](_0x57d3e1,function(_0x54185e){if(_[_0x1775('0x48')]([_0x1775('0x49'),_0x1775('0x4a')],_0x54185e[_0x1775('0x3f')])&&_0x54185e['idField']){_0x52a95c[_0x54185e[_0x1775('0x4b')]]=_0x54185e[_0x1775('0x4c')]['toString']();}else if(_0x54185e[_0x1775('0x3f')]===_0x1775('0x4d')&&_0x54185e[_0x1775('0x4e')]&&_0x54185e[_0x1775('0x4b')]){_0xead4d7[_0x54185e[_0x1775('0x4e')]]&&(_0x52a95c[_0x54185e[_0x1775('0x4b')]]=_0xead4d7[_0x54185e['variableName']][_0x1775('0x4f')]());}else if(_0x54185e[_0x1775('0x3f')]===_0x1775('0x50')&&_0x54185e['Variable']&&_0x54185e[_0x1775('0x51')]['name']&&_0x54185e[_0x1775('0x4b')]){_0xead4d7[_0x54185e[_0x1775('0x51')][_0x1775('0x52')][_0x1775('0x40')]()]&&(_0x52a95c[_0x54185e[_0x1775('0x4b')]]=_0xead4d7[_0x54185e[_0x1775('0x51')][_0x1775('0x52')][_0x1775('0x40')]()][_0x1775('0x4f')]());}});}return _0x52a95c;}function getConnection(_0x458c6f){var _0x324a9a=_0x458c6f[_0x1775('0x53')][_0x1775('0x54')](_0x458c6f['securityToken']);var _0x15c5f1=new jsforce[(_0x1775('0x55'))]({'oauth2':{'loginUrl':_0x458c6f[_0x1775('0x56')]||_0x1775('0x57'),'clientId':_0x458c6f[_0x1775('0x58')],'clientSecret':_0x458c6f[_0x1775('0x59')]}});return _0x15c5f1[_0x1775('0x5a')](_0x458c6f[_0x1775('0x5b')],_0x324a9a)[_0x1775('0x2b')](function(){logger['info']('Connection\x20established.');return _0x15c5f1;});}exports[_0x1775('0x5c')]=function(_0x4132d9,_0x2163a3,_0x37a160,_0x1b8ad1,_0x18c909,_0x50affe){var _0x38c60e,_0x5aa187,_0x495ed7,_0x3495a9;_0x50affe[_0x1775('0x5d')]=intUtil[_0x1775('0x5e')](_0x50affe['serverUrl']);_0x50affe[_0x1775('0x56')]=intUtil[_0x1775('0x5e')](_0x50affe[_0x1775('0x56')]);if(_0x18c909&&_0x18c909[_0x1775('0x5f')]){logger[_0x1775('0x1c')](_0x1775('0x60'),_0x1775('0x61'));_0x2163a3[_0x1775('0x62')]=util[_0x1775('0x46')](_0x1775('0x63'),_0x50affe[_0x1775('0x5d')],_0x2163a3[_0x1775('0x64')],md5(_0x2163a3[_0x1775('0x64')]));}else{_0x2163a3[_0x1775('0x62')]='';}return getConnection(_0x50affe)[_0x1775('0x2b')](function(_0x22ebc7){_0x3495a9=_0x22ebc7;return getUser(_0x50affe,_0x1b8ad1[_0x1775('0x65')],_0x3495a9);})['then'](function(_0x330436){_0x38c60e=_0x330436;return getEndUser(_0x50affe,_0x37a160,_0x2163a3[_0x1775('0x66')],_0x2163a3[_0x1775('0x67')],_0x3495a9);})[_0x1775('0x2b')](function(_0x4b3cc8){_0x5aa187=_0x4b3cc8;return getTicket(_0x50affe,_0x38c60e,_0x5aa187,_0x37a160,_0x2163a3,_0x37a160[_0x1775('0x68')],_0x3495a9,_0x1775('0x5c'));})['then'](function(_0x31ad53){_0x495ed7=_0x31ad53;logger[_0x1775('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x495ed7['id']);logger[_0x1775('0x1c')](_0x1775('0x69'),_0x495ed7['id'],_0x1b8ad1[_0x1775('0x52')],_0x50affe[_0x1775('0x3f')]);switch(_0x50affe[_0x1775('0x3f')]){case _0x1775('0x6a'):emit(util[_0x1775('0x46')](_0x1775('0x6b'),_0x1b8ad1[_0x1775('0x52')]),'trigger:salesforce:display',{'recordId':_0x495ed7['id']});break;case'newTab':emit(util['format'](_0x1775('0x6b'),_0x1b8ad1[_0x1775('0x52')]),_0x1775('0x6c'),{'uri':util['format']('%s/%s/e',_0x3495a9[_0x1775('0x6d')],_0x495ed7['id'])});break;default:logger[_0x1775('0x6e')](_0x1775('0x6f'));}})['catch'](function(_0x5f1754){logger[_0x1775('0x6e')](_0x1775('0x60'),_0x5f1754);});};exports['outbound']=function(_0x24bb6a,_0x43c652,_0x1e7317,_0x223d63,_0x53399e,_0x1de443,_0x5c9ab0){var _0x3aa9a0,_0x2d4ae6,_0x188bb8,_0x36f068;_0x1de443['serverUrl']=intUtil['stripTrailingSlash'](_0x1de443[_0x1775('0x5d')]);_0x1de443[_0x1775('0x56')]=intUtil[_0x1775('0x5e')](_0x1de443[_0x1775('0x56')]);if(_0x5c9ab0&&_0x5c9ab0[_0x1775('0x70')]&&_0x5c9ab0[_0x1775('0x70')]!==_0x1775('0x71')){logger[_0x1775('0x1c')](_0x1775('0x72'),_0x1775('0x61'));_0x43c652[_0x1775('0x62')]=util[_0x1775('0x46')](_0x1775('0x63'),_0x1de443[_0x1775('0x5d')],_0x43c652[_0x1775('0x64')],md5(_0x43c652[_0x1775('0x64')]));}return getConnection(_0x1de443)['then'](function(_0x433e5f){_0x36f068=_0x433e5f;return getUser(_0x1de443,_0x223d63[_0x1775('0x65')],_0x36f068);})[_0x1775('0x2b')](function(_0x4960cf){_0x3aa9a0=_0x4960cf;return getEndUser(_0x1de443,_0x1e7317,_0x43c652[_0x1775('0x73')],_0x43c652[_0x1775('0x74')],_0x36f068);})[_0x1775('0x2b')](function(_0x3c28a1){_0x2d4ae6=_0x3c28a1;return getTicket(_0x1de443,_0x3aa9a0,_0x2d4ae6,_0x1e7317,_0x43c652,_0x1e7317[_0x1775('0x68')],_0x36f068,_0x1775('0x75'));})[_0x1775('0x2b')](function(_0x2bd7c2){_0x188bb8=_0x2bd7c2;logger['info'](_0x1775('0x76'),_0x188bb8['id']);logger['info'](_0x1775('0x77'),_0x188bb8['id'],_0x223d63[_0x1775('0x52')],_0x1de443[_0x1775('0x3f')]);switch(_0x1de443[_0x1775('0x3f')]){case _0x1775('0x6a'):emit(util[_0x1775('0x46')](_0x1775('0x6b'),_0x223d63[_0x1775('0x52')]),_0x1775('0x78'),{'recordId':_0x188bb8['id']});break;case _0x1775('0x79'):emit(util[_0x1775('0x46')](_0x1775('0x6b'),_0x223d63['name']),_0x1775('0x6c'),{'uri':util['format']('%s/%s/e',_0x36f068['instanceUrl'],_0x188bb8['id'])});break;default:logger[_0x1775('0x6e')](_0x1775('0x72'),_0x1775('0x7a'));}})['catch'](function(_0x13b2d4){logger[_0x1775('0x6e')](_0x1775('0x72'),_0x13b2d4);});};exports[_0x1775('0x7b')]=function(_0x32d538,_0x4b30d5,_0x555fea,_0x19f817,_0x88db7e,_0x43e8dc){var _0x57244a,_0x182f6f,_0x4fbe28,_0x1c00d3;_0x43e8dc[_0x1775('0x5d')]=intUtil[_0x1775('0x5e')](_0x43e8dc[_0x1775('0x5d')]);_0x43e8dc[_0x1775('0x56')]=intUtil[_0x1775('0x5e')](_0x43e8dc[_0x1775('0x56')]);if(_0x88db7e&&_0x88db7e[_0x1775('0x5f')]){logger[_0x1775('0x1c')]('['+_0x4b30d5[_0x1775('0x7c')][_0x1775('0x7d')]()+']',_0x1775('0x61'));_0x4b30d5[_0x1775('0x62')]=util[_0x1775('0x46')](_0x1775('0x63'),_0x43e8dc['serverUrl'],_0x4b30d5['uniqueid'],md5(_0x4b30d5[_0x1775('0x64')]));}else{_0x4b30d5[_0x1775('0x62')]='';}return getConnection(_0x43e8dc)['then'](function(_0x7712bf){_0x1c00d3=_0x7712bf;if(!_['isNil'](_0x19f817)){return getUser(_0x43e8dc,_0x19f817[_0x1775('0x52')],_0x1c00d3);}else{return getUser(_0x43e8dc,null,_0x1c00d3);}})[_0x1775('0x2b')](function(_0x3e020a){_0x57244a=_0x3e020a;return getEndUser(_0x43e8dc,_0x555fea,_0x4b30d5[_0x1775('0x66')],_0x4b30d5[_0x1775('0x67')],_0x1c00d3);})[_0x1775('0x2b')](function(_0x5c5316){_0x182f6f=_0x5c5316;return getTicket(_0x43e8dc,_0x57244a,_0x182f6f,_0x555fea,_0x4b30d5,_0x555fea[_0x1775('0x68')],_0x1c00d3);})['then'](function(_0x3d3fbb){_0x4fbe28=_0x3d3fbb;logger[_0x1775('0x1c')]('['+_0x4b30d5[_0x1775('0x7c')]['toUpperCase']()+_0x1775('0x7e'),_0x4fbe28['id']);logger[_0x1775('0x1c')]('['+_0x4b30d5[_0x1775('0x7c')][_0x1775('0x7d')]()+']\x20Integration\x20account\x20type\x20%s.',_0x43e8dc[_0x1775('0x3f')]);})[_0x1775('0x7f')](function(_0x57ab52){logger[_0x1775('0x6e')]('['+_0x4b30d5['lastevent'][_0x1775('0x7d')]()+']',_0x57ab52);});}; \ No newline at end of file +var _0x2ab1=['execute','cloneDeep','additionalSearchLead','Lead','additionalSearchAccount','merge','Account','first','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','forEach','includes','string','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','assign','getString','Subjects','Task','ActivityDate','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','then','length','find','Email','Agent\x20%s\x20found.','resolve','Name','info','identity','user_id','display_name','contact_lead','additionalSearchContact','$or','Contact'];(function(_0x19344e,_0x14deb7){var _0x5175e3=function(_0x1a44fe){while(--_0x1a44fe){_0x19344e['push'](_0x19344e['shift']());}};_0x5175e3(++_0x14deb7);}(_0x2ab1,0xc5));var _0x12ab=function(_0x576a37,_0x186ed9){_0x576a37=_0x576a37-0x0;var _0x473424=_0x2ab1[_0x576a37];return _0x473424;};'use strict';var _=require(_0x12ab('0x0'));var rp=require(_0x12ab('0x1'));var moment=require('moment');var BPromise=require(_0x12ab('0x2'));var md5=require(_0x12ab('0x3'));var jsforce=require(_0x12ab('0x4'));var util=require(_0x12ab('0x5'));var Redis=require(_0x12ab('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x12ab('0x7'))(_0x12ab('0x8'));config[_0x12ab('0x9')]=_['defaults'](config['redis'],{'host':_0x12ab('0xa'),'port':0x18eb});var io=require(_0x12ab('0xb'))(new Redis(config[_0x12ab('0x9')]));function emit(_0x1e629b,_0x404b9a,_0x567550){io['to'](_0x1e629b)['emit'](_0x404b9a,_0x567550);}function getTicket(_0x15f586,_0xff401b,_0x5c4e3c,_0x2bc2bf,_0x543639,_0x1c4c0f,_0x58bbfe,_0x2e625b){var _0x237a1f=Object[_0x12ab('0xc')]({},{'OwnerId':_0xff401b['id'],'Subject':intUtil[_0x12ab('0xd')](_0x2bc2bf[_0x12ab('0xe')],_0x543639,'\x20'),'Description':intUtil[_0x12ab('0xd')](_0x2bc2bf['Descriptions'],_0x543639,'\x0a')},getCustomFields(_0x1c4c0f,_0x543639));if(_0x5c4e3c){if(_0x2bc2bf['ticketType']===_0x12ab('0xf')){_0x237a1f[_0x12ab('0x10')]=moment['utc']();_0x237a1f['IsReminderSet']=![];_0x237a1f[_0x12ab('0x11')]=![];if(_0x5c4e3c[_0x12ab('0x12')]===_0x12ab('0x13')||_0x5c4e3c[_0x12ab('0x12')]===_0x12ab('0x14')){_0x237a1f[_0x12ab('0x15')]=_0x5c4e3c['id'];}else if(_0x5c4e3c[_0x12ab('0x12')]===_0x12ab('0x16')){_0x237a1f[_0x12ab('0x17')]=_0x5c4e3c['id'];}}else if(_0x2bc2bf[_0x12ab('0x18')]==='Case'){if(_0x5c4e3c[_0x12ab('0x12')]===_0x12ab('0x13')){_0x237a1f[_0x12ab('0x19')]=_0x5c4e3c['id'];}else if(_0x5c4e3c[_0x12ab('0x12')]===_0x12ab('0x16')){_0x237a1f[_0x12ab('0x1a')]=_0x5c4e3c['id'];}else if(_0x5c4e3c[_0x12ab('0x12')]===_0x12ab('0x14')&&_0x2bc2bf[_0x12ab('0x1b')]){_0x237a1f[_0x2bc2bf[_0x12ab('0x1b')]]=_0x5c4e3c['id'];}else{logger['info'](_0x12ab('0x1c'));}}}return _0x58bbfe[_0x12ab('0x1d')](_0x2bc2bf[_0x12ab('0x18')])[_0x12ab('0x1e')](_0x237a1f);}function getUser(_0x3ab0f1,_0x294ff4,_0x3dfddd){if(!_[_0x12ab('0x1f')](_0x294ff4)&&intUtil[_0x12ab('0x20')](_0x294ff4)){var _0x49c015={'Email':_0x294ff4};var _0x1835ba={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3dfddd['sobject'](_0x12ab('0x21'))['find'](_0x49c015,_0x1835ba)['execute']()[_0x12ab('0x22')](function(_0x14fd77){if(_0x14fd77[_0x12ab('0x23')]){var _0x506da3=_[_0x12ab('0x24')](_0x14fd77,function(_0x53b064){return _0x53b064[_0x12ab('0x25')]===_0x294ff4;});if(_0x506da3){logger['info'](_0x12ab('0x26'),_0x294ff4);return BPromise[_0x12ab('0x27')]({'id':_0x506da3['Id'],'name':_0x506da3[_0x12ab('0x28')]});}}else{logger[_0x12ab('0x29')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x294ff4);return _0x3dfddd[_0x12ab('0x2a')]()[_0x12ab('0x22')](function(_0x159e31){return BPromise[_0x12ab('0x27')]({'id':_0x159e31[_0x12ab('0x2b')],'name':_0x159e31[_0x12ab('0x2c')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x294ff4);return _0x3dfddd[_0x12ab('0x2a')]()['then'](function(_0x135788){return BPromise[_0x12ab('0x27')]({'id':_0x135788[_0x12ab('0x2b')],'name':_0x135788[_0x12ab('0x2c')]});});}}function getEndUser(_0x469477,_0x2138fa,_0xd3d4ff,_0x1bede6,_0x418a6e){var _0x326cfb={'$or':{'Phone':_0x1bede6}};var _0x38c0fc={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x12ab('0x27')]()['then'](function(){logger[_0x12ab('0x29')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x1bede6,_0x2138fa['moduleSearch']);switch(_0x2138fa['moduleSearch']){case _0x12ab('0x2d'):var _0x207a87=_['cloneDeep'](_0x326cfb);if(_0x2138fa[_0x12ab('0x2e')]){var _0x1fe08e={};_0x1fe08e[_0x2138fa['additionalSearchContact']]=_0x1bede6;_['merge'](_0x207a87[_0x12ab('0x2f')],_0x1fe08e);}return _0x418a6e['sobject'](_0x12ab('0x30'))['find'](_0x207a87,_0x38c0fc)[_0x12ab('0x31')]()[_0x12ab('0x22')](function(_0x38c0c7){if(_0x38c0c7&&_0x38c0c7[_0x12ab('0x23')]){return _0x38c0c7;}else{var _0x5a2a05=_[_0x12ab('0x32')](_0x326cfb);if(_0x2138fa[_0x12ab('0x33')]){var _0x599c03={};_0x599c03[_0x2138fa[_0x12ab('0x33')]]=_0x1bede6;_['merge'](_0x5a2a05['$or'],_0x599c03);}return _0x418a6e[_0x12ab('0x1d')](_0x12ab('0x34'))[_0x12ab('0x24')](_0x5a2a05,_0x38c0fc);}});case'account_contact_lead':var _0x29dde5=_[_0x12ab('0x32')](_0x326cfb);if(_0x2138fa[_0x12ab('0x35')]){var _0x1fe08e={};_0x1fe08e[_0x2138fa['additionalSearchAccount']]=_0x1bede6;_[_0x12ab('0x36')](_0x29dde5[_0x12ab('0x2f')],_0x1fe08e);}return _0x418a6e[_0x12ab('0x1d')](_0x12ab('0x37'))[_0x12ab('0x24')](_0x29dde5,_0x38c0fc)[_0x12ab('0x31')]()[_0x12ab('0x22')](function(_0x64d898){if(_0x64d898&&_0x64d898['length']){return _0x64d898;}else{var _0x3f4e95=_[_0x12ab('0x32')](_0x326cfb);if(_0x2138fa['additionalSearchContact']){var _0x1a8705={};_0x1a8705[_0x2138fa[_0x12ab('0x2e')]]=_0x1bede6;_[_0x12ab('0x36')](_0x3f4e95[_0x12ab('0x2f')],_0x1a8705);}return _0x418a6e['sobject'](_0x12ab('0x30'))[_0x12ab('0x24')](_0x3f4e95,_0x38c0fc)['then'](function(_0x2ff1e5){if(_0x2ff1e5&&_0x2ff1e5[_0x12ab('0x23')]){return _0x2ff1e5;}else{var _0x538bcb=_[_0x12ab('0x32')](_0x326cfb);if(_0x2138fa[_0x12ab('0x33')]){var _0x5622a7={};_0x5622a7[_0x2138fa[_0x12ab('0x33')]]=_0x1bede6;_[_0x12ab('0x36')](_0x538bcb['$or'],_0x5622a7);}return _0x418a6e[_0x12ab('0x1d')]('Lead')[_0x12ab('0x24')](_0x538bcb,_0x38c0fc);}});}});case _0x12ab('0x13'):var _0x207a87=_[_0x12ab('0x32')](_0x326cfb);if(_0x2138fa[_0x12ab('0x2e')]){var _0x1fe08e={};_0x1fe08e[_0x2138fa[_0x12ab('0x2e')]]=_0x1bede6;_[_0x12ab('0x36')](_0x207a87[_0x12ab('0x2f')],_0x1fe08e);}return _0x418a6e[_0x12ab('0x1d')](_0x12ab('0x30'))[_0x12ab('0x24')](_0x207a87,_0x38c0fc)[_0x12ab('0x31')]();case _0x12ab('0x14'):var _0x473b4e=_['cloneDeep'](_0x326cfb);if(_0x2138fa[_0x12ab('0x33')]){var _0x1fe08e={};_0x1fe08e[_0x2138fa[_0x12ab('0x33')]]=_0x1bede6;_[_0x12ab('0x36')](_0x473b4e['$or'],_0x1fe08e);}return _0x418a6e[_0x12ab('0x1d')](_0x12ab('0x34'))['find'](_0x473b4e,_0x38c0fc);case _0x12ab('0x16'):var _0x29dde5=_[_0x12ab('0x32')](_0x326cfb);if(_0x2138fa['additionalSearchAccount']){var _0x1fe08e={};_0x1fe08e[_0x2138fa[_0x12ab('0x35')]]=_0x1bede6;_[_0x12ab('0x36')](_0x29dde5[_0x12ab('0x2f')],_0x1fe08e);}return _0x418a6e[_0x12ab('0x1d')](_0x12ab('0x37'))[_0x12ab('0x24')](_0x29dde5,_0x38c0fc);default:return null;}})[_0x12ab('0x22')](function(_0x18445d){if(_0x18445d&&_0x18445d[_0x12ab('0x23')]){var _0x426258=_[_0x12ab('0x38')](_0x18445d);if(_0x426258){return BPromise[_0x12ab('0x27')]({'id':_0x426258['Id'],'name':_0x426258[_0x12ab('0x28')],'phone':_0x426258[_0x12ab('0x39')],'endUserType':_0x426258['attributes']['type']['toLowerCase']()});}}})[_0x12ab('0x22')](function(_0x6caa02){if(_0x6caa02){logger[_0x12ab('0x29')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x6caa02[_0x12ab('0x12')],_0x1bede6);return BPromise[_0x12ab('0x27')](_0x6caa02);}else{logger[_0x12ab('0x29')](_0x12ab('0x3a'),_0x1bede6);var _0x1d8ffa={'Phone':_0x1bede6};if(_0x2138fa[_0x12ab('0x3b')]){if(_0x2138fa[_0x12ab('0x3b')]===_0x12ab('0x13')){logger[_0x12ab('0x29')](_0x12ab('0x3c'),_0x1bede6,_0x2138fa[_0x12ab('0x3b')]);_0x1d8ffa[_0x12ab('0x3d')]=_0xd3d4ff!==_0x12ab('0x3e')?_0xd3d4ff:util[_0x12ab('0x3f')](_0x12ab('0x40'),_0x1bede6);}else if(_0x2138fa[_0x12ab('0x3b')]===_0x12ab('0x14')){logger[_0x12ab('0x29')](_0x12ab('0x3c'),_0x1bede6,_0x2138fa[_0x12ab('0x3b')]);_0x1d8ffa[_0x12ab('0x3d')]=_0xd3d4ff!==''?_0xd3d4ff:util[_0x12ab('0x3f')](_0x12ab('0x40'),_0x1bede6);_0x1d8ffa[_0x12ab('0x41')]=_0x12ab('0x42');}else if(_0x2138fa[_0x12ab('0x3b')]===_0x12ab('0x16')){logger[_0x12ab('0x29')](_0x12ab('0x3c'),_0x1bede6,_0x2138fa[_0x12ab('0x3b')]);_0x1d8ffa['Name']=_0xd3d4ff!==_0x12ab('0x3e')?_0xd3d4ff:util[_0x12ab('0x3f')](_0x12ab('0x40'),_0x1bede6);}else{return null;}}return _0x418a6e[_0x12ab('0x1d')](_['upperFirst'](_0x2138fa[_0x12ab('0x3b')]))[_0x12ab('0x1e')](_0x1d8ffa)[_0x12ab('0x22')](function(_0x47a871){return BPromise[_0x12ab('0x27')]({'id':_0x47a871['id'],'endUserType':_0x2138fa[_0x12ab('0x3b')]});});}});}function getCustomFields(_0xbbc073,_0x5e0224){var _0x1281db={};if(_0xbbc073['length']>0x0){_[_0x12ab('0x43')](_0xbbc073,function(_0x437823){if(_[_0x12ab('0x44')]([_0x12ab('0x45'),'picklist'],_0x437823[_0x12ab('0x46')])&&_0x437823[_0x12ab('0x47')]){_0x1281db[_0x437823['idField']]=_0x437823[_0x12ab('0x48')][_0x12ab('0x49')]();}else if(_0x437823[_0x12ab('0x46')]==='variable'&&_0x437823[_0x12ab('0x4a')]&&_0x437823[_0x12ab('0x47')]){_0x5e0224[_0x437823['variableName']]&&(_0x1281db[_0x437823['idField']]=_0x5e0224[_0x437823[_0x12ab('0x4a')]][_0x12ab('0x49')]());}else if(_0x437823[_0x12ab('0x46')]===_0x12ab('0x4b')&&_0x437823[_0x12ab('0x4c')]&&_0x437823[_0x12ab('0x4c')][_0x12ab('0x4d')]&&_0x437823[_0x12ab('0x47')]){_0x5e0224[_0x437823[_0x12ab('0x4c')][_0x12ab('0x4d')][_0x12ab('0x4e')]()]&&(_0x1281db[_0x437823['idField']]=_0x5e0224[_0x437823[_0x12ab('0x4c')]['name']['toLowerCase']()][_0x12ab('0x49')]());}});}return _0x1281db;}function getConnection(_0x3d0403){var _0x473bbe=_0x3d0403[_0x12ab('0x4f')][_0x12ab('0x50')](_0x3d0403[_0x12ab('0x51')]);var _0x23997c=new jsforce[(_0x12ab('0x52'))]({'oauth2':{'loginUrl':_0x3d0403[_0x12ab('0x53')]||_0x12ab('0x54'),'clientId':_0x3d0403[_0x12ab('0x55')],'clientSecret':_0x3d0403[_0x12ab('0x56')]}});return _0x23997c['login'](_0x3d0403['username'],_0x473bbe)[_0x12ab('0x22')](function(){logger[_0x12ab('0x29')](_0x12ab('0x57'));return _0x23997c;});}exports[_0x12ab('0x58')]=function(_0x21745f,_0x40478e,_0x5258ff,_0x158ff6,_0xbfe2be,_0x184344){var _0x35d665,_0x249224,_0x2acd22,_0x3a2c56;_0x184344[_0x12ab('0x59')]=intUtil[_0x12ab('0x5a')](_0x184344['serverUrl']);_0x184344['remoteUri']=intUtil[_0x12ab('0x5a')](_0x184344[_0x12ab('0x53')]);if(_0xbfe2be&&_0xbfe2be[_0x12ab('0x5b')]){logger[_0x12ab('0x29')](_0x12ab('0x5c'),_0x12ab('0x5d'));_0x40478e[_0x12ab('0x5e')]=util[_0x12ab('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x184344[_0x12ab('0x59')],_0x40478e['uniqueid'],md5(_0x40478e[_0x12ab('0x5f')]));}else{_0x40478e[_0x12ab('0x5e')]='';}return getConnection(_0x184344)[_0x12ab('0x22')](function(_0x3eadbb){_0x3a2c56=_0x3eadbb;return getUser(_0x184344,_0x158ff6[_0x12ab('0x60')],_0x3a2c56);})[_0x12ab('0x22')](function(_0xaa6466){_0x35d665=_0xaa6466;return getEndUser(_0x184344,_0x5258ff,_0x40478e[_0x12ab('0x61')],_0x40478e[_0x12ab('0x62')],_0x3a2c56);})['then'](function(_0x4a044e){_0x249224=_0x4a044e;return getTicket(_0x184344,_0x35d665,_0x249224,_0x5258ff,_0x40478e,_0x5258ff[_0x12ab('0x63')],_0x3a2c56,_0x12ab('0x58'));})[_0x12ab('0x22')](function(_0x527cd0){_0x2acd22=_0x527cd0;logger[_0x12ab('0x29')](_0x12ab('0x64'),_0x2acd22['id']);logger[_0x12ab('0x29')](_0x12ab('0x65'),_0x2acd22['id'],_0x158ff6[_0x12ab('0x4d')],_0x184344['type']);switch(_0x184344['type']){case'integrationTab':emit(util['format'](_0x12ab('0x66'),_0x158ff6[_0x12ab('0x4d')]),_0x12ab('0x67'),{'recordId':_0x2acd22['id']});break;case _0x12ab('0x68'):emit(util[_0x12ab('0x3f')](_0x12ab('0x66'),_0x158ff6['name']),_0x12ab('0x69'),{'uri':util['format'](_0x12ab('0x6a'),_0x3a2c56[_0x12ab('0x6b')],_0x2acd22['id'])});break;default:logger[_0x12ab('0x6c')](_0x12ab('0x6d'));}})['catch'](function(_0x2ed6bc){logger['error']('[QUEUE]',_0x2ed6bc);});};exports[_0x12ab('0x6e')]=function(_0x2c363b,_0x2491af,_0xbc6e16,_0x2f83ef,_0x7d6a76,_0x42f74c,_0x49bc03){var _0x16a0d7,_0x922ccc,_0x38b85a,_0x42aebc;_0x42f74c['serverUrl']=intUtil[_0x12ab('0x5a')](_0x42f74c['serverUrl']);_0x42f74c['remoteUri']=intUtil[_0x12ab('0x5a')](_0x42f74c[_0x12ab('0x53')]);if(_0x49bc03&&_0x49bc03[_0x12ab('0x6f')]&&_0x49bc03[_0x12ab('0x6f')]!=='none'){logger[_0x12ab('0x29')](_0x12ab('0x70'),_0x12ab('0x5d'));_0x2491af[_0x12ab('0x5e')]=util['format'](_0x12ab('0x71'),_0x42f74c[_0x12ab('0x59')],_0x2491af[_0x12ab('0x5f')],md5(_0x2491af[_0x12ab('0x5f')]));}return getConnection(_0x42f74c)[_0x12ab('0x22')](function(_0x946348){_0x42aebc=_0x946348;return getUser(_0x42f74c,_0x2f83ef[_0x12ab('0x60')],_0x42aebc);})[_0x12ab('0x22')](function(_0x425318){_0x16a0d7=_0x425318;return getEndUser(_0x42f74c,_0xbc6e16,_0x2491af[_0x12ab('0x72')],_0x2491af[_0x12ab('0x73')],_0x42aebc);})[_0x12ab('0x22')](function(_0x35942a){_0x922ccc=_0x35942a;return getTicket(_0x42f74c,_0x16a0d7,_0x922ccc,_0xbc6e16,_0x2491af,_0xbc6e16['Fields'],_0x42aebc,'outbound');})[_0x12ab('0x22')](function(_0xdb1b08){_0x38b85a=_0xdb1b08;logger[_0x12ab('0x29')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x38b85a['id']);logger[_0x12ab('0x29')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x38b85a['id'],_0x2f83ef['name'],_0x42f74c[_0x12ab('0x46')]);switch(_0x42f74c[_0x12ab('0x46')]){case _0x12ab('0x74'):emit(util['format'](_0x12ab('0x66'),_0x2f83ef[_0x12ab('0x4d')]),_0x12ab('0x67'),{'recordId':_0x38b85a['id']});break;case _0x12ab('0x68'):emit(util[_0x12ab('0x3f')](_0x12ab('0x66'),_0x2f83ef[_0x12ab('0x4d')]),_0x12ab('0x69'),{'uri':util[_0x12ab('0x3f')](_0x12ab('0x6a'),_0x42aebc[_0x12ab('0x6b')],_0x38b85a['id'])});break;default:logger['error'](_0x12ab('0x70'),_0x12ab('0x75'));}})['catch'](function(_0x25d918){logger['error'](_0x12ab('0x70'),_0x25d918);});};exports[_0x12ab('0x76')]=function(_0x18ab1e,_0x368242,_0x2ddcaf,_0x329006,_0x32bd04,_0x260370){var _0x100806,_0x46a504,_0x4f9c5d,_0x2d65ac;_0x260370[_0x12ab('0x59')]=intUtil[_0x12ab('0x5a')](_0x260370[_0x12ab('0x59')]);_0x260370[_0x12ab('0x53')]=intUtil[_0x12ab('0x5a')](_0x260370[_0x12ab('0x53')]);if(_0x32bd04&&_0x32bd04[_0x12ab('0x5b')]){logger[_0x12ab('0x29')]('['+_0x368242['lastevent']['toUpperCase']()+']',_0x12ab('0x5d'));_0x368242['recordingURL']=util[_0x12ab('0x3f')](_0x12ab('0x71'),_0x260370[_0x12ab('0x59')],_0x368242[_0x12ab('0x5f')],md5(_0x368242[_0x12ab('0x5f')]));}else{_0x368242['recordingURL']='';}return getConnection(_0x260370)[_0x12ab('0x22')](function(_0x5590dc){_0x2d65ac=_0x5590dc;if(!_[_0x12ab('0x1f')](_0x329006)){return getUser(_0x260370,_0x329006[_0x12ab('0x4d')],_0x2d65ac);}else{return getUser(_0x260370,null,_0x2d65ac);}})[_0x12ab('0x22')](function(_0x289b87){_0x100806=_0x289b87;return getEndUser(_0x260370,_0x2ddcaf,_0x368242[_0x12ab('0x61')],_0x368242[_0x12ab('0x62')],_0x2d65ac);})[_0x12ab('0x22')](function(_0x423212){_0x46a504=_0x423212;return getTicket(_0x260370,_0x100806,_0x46a504,_0x2ddcaf,_0x368242,_0x2ddcaf[_0x12ab('0x63')],_0x2d65ac);})[_0x12ab('0x22')](function(_0x4cb612){_0x4f9c5d=_0x4cb612;logger[_0x12ab('0x29')]('['+_0x368242[_0x12ab('0x77')][_0x12ab('0x78')]()+']\x20Ticket\x20%s\x20created.',_0x4f9c5d['id']);logger[_0x12ab('0x29')]('['+_0x368242[_0x12ab('0x77')][_0x12ab('0x78')]()+_0x12ab('0x79'),_0x260370[_0x12ab('0x46')]);})[_0x12ab('0x7a')](function(_0x1a5a18){logger[_0x12ab('0x6c')]('['+_0x368242['lastevent'][_0x12ab('0x78')]()+']',_0x1a5a18);});}; \ 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 3b7d666..7ac8c93 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 _0xb095=['recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xb095,0xde));var _0x5b09=function(_0x4d5a94,_0x2cb497){_0x4d5a94=_0x4d5a94-0x0;var _0x55177a=_0xb095[_0x4d5a94];return _0x55177a;};'use strict';var _=require('lodash');var Promise=require(_0x5b09('0x0'));var rp=require('request-promise');var util=require(_0x5b09('0x1'));var md5=require(_0x5b09('0x2'));var Redis=require(_0x5b09('0x3'));var intUtil=require('./util');var config=require(_0x5b09('0x4'));var logger=require(_0x5b09('0x5'))(_0x5b09('0x6'));config[_0x5b09('0x7')]=_[_0x5b09('0x8')](config[_0x5b09('0x7')],{'host':_0x5b09('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x50b4cc,_0x3e3a83,_0x5aaa2b,_0x4d74fc,_0x2fd889,_0x36c3fb){return new Promise(function(_0xee8435,_0x32a8ba){var _0x17ab00={'method':_0x5b09('0xa'),'uri':_0x4d74fc+_0x5b09('0xb')+'&'+_0x2fd889+'&'+_0x36c3fb,'auth':_0x3e3a83,'json':!![]};return rp(_0x17ab00)[_0x5b09('0xc')](function(_0x33ffac){if(_0x33ffac[_0x5b09('0xd')][_0x5b09('0xe')]>0x0){_0x5aaa2b['adminId']=_0x33ffac[_0x5b09('0xd')][0x0][_0x5b09('0xf')];}logger[_0x5b09('0x10')]('['+[_0x50b4cc['toUpperCase']()]+_0x5b09('0x11'),_0x5aaa2b);_0xee8435(_0x5aaa2b);})[_0x5b09('0x12')](function(_0x28bd03){logger[_0x5b09('0x13')]('['+[_0x50b4cc[_0x5b09('0x14')]()]+']',_0x28bd03['message']);_0x32a8ba(_0x28bd03[_0x5b09('0x15')]);});});}function getUser(_0x398c64,_0x5686ab,_0x3eca7e,_0x3e1b64,_0x2512d8){return function(_0x8ac3c3){logger[_0x5b09('0x10')]('['+[_0x398c64[_0x5b09('0x14')]()]+'],\x20getUser\x20input\x20crm',_0x8ac3c3);return new Promise(function(_0x37b5a1,_0x2107ee){if(intUtil[_0x5b09('0x16')](_0x8ac3c3[_0x5b09('0x17')])){var _0x1ea346={'method':'GET','uri':_0x3eca7e+_0x5b09('0x18')+_0x8ac3c3['userEmail']+'&'+_0x3e1b64+'&'+_0x2512d8,'auth':_0x5686ab,'json':!![]};logger[_0x5b09('0x10')]('['+[_0x398c64[_0x5b09('0x14')]()]+_0x5b09('0x19'),_0x1ea346);return rp(_0x1ea346)[_0x5b09('0xc')](function(_0x5dbd5e){logger[_0x5b09('0x10')]('['+[_0x398c64[_0x5b09('0x14')]()]+_0x5b09('0x1a'),_0x5dbd5e);if(_0x5dbd5e['result'][_0x5b09('0xe')]>0x0&&String(_0x5dbd5e[_0x5b09('0xd')][0x0][_0x5b09('0x1b')])==='true'){_0x8ac3c3[_0x5b09('0x1c')]=_0x5dbd5e[_0x5b09('0xd')][0x0][_0x5b09('0xf')];}else{_0x8ac3c3['userId']=_0x8ac3c3[_0x5b09('0x1d')];_0x8ac3c3[_0x5b09('0x17')]=_0x8ac3c3[_0x5b09('0x1e')];}logger[_0x5b09('0x10')]('['+[_0x398c64[_0x5b09('0x14')]()]+'],\x20getUser\x20crm',_0x8ac3c3);_0x37b5a1(_0x8ac3c3);})['catch'](function(_0x18e5fa){logger[_0x5b09('0x13')]('['+[_0x398c64[_0x5b09('0x14')]()]+']',_0x18e5fa[_0x5b09('0x15')]);_0x2107ee(_0x18e5fa[_0x5b09('0x15')]);});}else{logger[_0x5b09('0x10')]('['+[_0x398c64[_0x5b09('0x14')]()]+_0x5b09('0x1f'));_0x8ac3c3[_0x5b09('0x1c')]=_0x8ac3c3[_0x5b09('0x1d')];_0x8ac3c3[_0x5b09('0x17')]=_0x8ac3c3[_0x5b09('0x1e')];_0x37b5a1(_0x8ac3c3);}});};}function createEndUser(_0x9f6cdd,_0x2fe650,_0x198cff,_0x49a6be,_0x5e846f){logger[_0x5b09('0x10')]('['+[_0x9f6cdd['toUpperCase']()]+_0x5b09('0x20'),_0x198cff);return new Promise(function(_0x53db86,_0x257883){var _0x213e40={'method':_0x5b09('0x21'),'uri':_0x49a6be+_0x5b09('0x22')+_0x5e846f,'body':{'user_name':_0x198cff['endUserNumber'],'roles':_0x5b09('0x23'),'first_name':_0x198cff[_0x5b09('0x24')],'active':'true','date_format':_0x5b09('0x25'),'phone':_0x198cff['endUserNumber']},'auth':_0x2fe650,'json':!![]};return rp(_0x213e40)[_0x5b09('0xc')](function(_0x504d1b){logger[_0x5b09('0x10')]('['+[_0x9f6cdd[_0x5b09('0x14')]()]+_0x5b09('0x26'),_0x504d1b[_0x5b09('0xd')]);_0x198cff[_0x5b09('0x27')]=_0x504d1b['result']['sys_id'];_0x53db86(_0x198cff);})[_0x5b09('0x12')](function(_0x2a15e6){logger[_0x5b09('0x13')]('['+[_0x9f6cdd['toUpperCase']()]+']',_0x2a15e6[_0x5b09('0x15')]);_0x257883(_0x2a15e6[_0x5b09('0x15')]);});});}function getEndUser(_0x565b2f,_0x23a515,_0x5d086a,_0x54870f,_0x583218){return function(_0x1a9142){logger['info']('['+[_0x565b2f[_0x5b09('0x14')]()]+'],\x20getEndUser\x20input\x20crm',_0x1a9142);return new Promise(function(_0x3f3d24,_0x4debae){var _0x5af893={'method':_0x5b09('0xa'),'uri':_0x5d086a+_0x5b09('0x28')+_0x1a9142[_0x5b09('0x24')]+'&'+_0x54870f+'&'+_0x583218,'auth':_0x23a515,'json':!![]};return rp(_0x5af893)['then'](function(_0x16b0a4){if(_0x16b0a4[_0x5b09('0xd')][_0x5b09('0xe')]>0x0){_0x1a9142['endUserId']=_0x16b0a4['result'][0x0][_0x5b09('0xf')];logger['info']('['+[_0x565b2f[_0x5b09('0x14')]()]+_0x5b09('0x29'),_0x1a9142);_0x3f3d24(_0x1a9142);}else{return createEndUser(_0x565b2f,_0x23a515,_0x1a9142,_0x5d086a,_0x54870f)['then'](function(_0x3dee56){logger[_0x5b09('0x10')]('['+[_0x565b2f[_0x5b09('0x14')]()]+_0x5b09('0x2a'),_0x3dee56);_0x3f3d24(_0x3dee56);});}})['catch'](function(_0x38d3d5){logger[_0x5b09('0x13')]('['+[_0x565b2f[_0x5b09('0x14')]()]+']',_0x38d3d5[_0x5b09('0x15')]);_0x4debae(_0x38d3d5['message']);});});};}function getCustomFields(_0x5291aa,_0x22d31f){var _0x328319={};if(_0x5291aa[_0x5b09('0xe')]>0x0){_[_0x5b09('0x2b')](_0x5291aa,function(_0x13ba85){if(_[_0x5b09('0x2c')]([_0x5b09('0x2d'),_0x5b09('0x2e')],_0x13ba85[_0x5b09('0x2f')])&&_0x13ba85['nameField']&&!_0x13ba85[_0x5b09('0x30')]){_0x328319[_0x13ba85[_0x5b09('0x31')][_0x5b09('0x32')]()]=_0x13ba85[_0x5b09('0x33')][_0x5b09('0x34')]();}else if(_[_0x5b09('0x2c')]([_0x5b09('0x2d'),'picklist'],_0x13ba85[_0x5b09('0x2f')])&&_0x13ba85[_0x5b09('0x35')]&&_0x13ba85[_0x5b09('0x30')]){_0x328319[_0x13ba85[_0x5b09('0x35')][_0x5b09('0x32')]()]=_0x13ba85[_0x5b09('0x33')][_0x5b09('0x34')]();}else if(_0x13ba85[_0x5b09('0x2f')]===_0x5b09('0x36')&&_0x13ba85[_0x5b09('0x37')]&&_0x13ba85[_0x5b09('0x35')]&&_0x13ba85[_0x5b09('0x30')]){_0x328319[_0x13ba85[_0x5b09('0x35')]['toLowerCase']()]=_0x22d31f[_0x13ba85['variableName']][_0x5b09('0x34')]();}else if(_0x13ba85[_0x5b09('0x2f')]===_0x5b09('0x38')&&_0x13ba85[_0x5b09('0x39')]&&_0x13ba85['Variable'][_0x5b09('0x3a')]&&_0x13ba85[_0x5b09('0x35')]&&_0x13ba85['customField']){_0x328319[_0x13ba85[_0x5b09('0x35')][_0x5b09('0x32')]()]=_0x22d31f[_0x13ba85[_0x5b09('0x39')][_0x5b09('0x3a')][_0x5b09('0x32')]()]['toString']();}});}return _0x328319;}function getTicket(_0x1adf7d,_0x146db3,_0x23cd4b,_0x3e83ad,_0x3b2a2f,_0xfa4904){return function(_0x5d1dd6){logger['info']('['+[_0x1adf7d[_0x5b09('0x14')]()]+_0x5b09('0x3b'),_0x5d1dd6);return new Promise(function(_0x5897b9,_0x959479){var _0xc63d1d=_0x1adf7d[_0x5b09('0x32')]()===_0x5b09('0x3c')?_0x5d1dd6['userId']:_0x5d1dd6[_0x5b09('0x27')];var _0x4892b3={'method':'POST','uri':_0x23cd4b+_0x5b09('0x3d')+'?'+_0xfa4904,'body':Object[_0x5b09('0x3e')]({},{'active':'true','caller_id':_0xc63d1d,'assigned_to':_0x5d1dd6[_0x5b09('0x1c')],'short_description':intUtil[_0x5b09('0x3f')](_0x3e83ad[_0x5b09('0x40')],_0x3b2a2f,'\x20'),'description':intUtil[_0x5b09('0x3f')](_0x3e83ad['Descriptions'],_0x3b2a2f,'\x0a')},getCustomFields(_0x3e83ad[_0x5b09('0x41')],_0x3b2a2f)),'auth':_0x146db3,'json':!![]};return rp(_0x4892b3)['then'](function(_0x5407b9){logger[_0x5b09('0x10')]('['+[_0x1adf7d[_0x5b09('0x14')]()]+_0x5b09('0x42'),_0x5407b9['result']);_0x5d1dd6[_0x5b09('0x43')]=_0x5407b9[_0x5b09('0xd')]['sys_id'];_0x5d1dd6[_0x5b09('0x44')]=_0x5407b9['result']['number'];logger[_0x5b09('0x10')]('['+[_0x1adf7d['toUpperCase']()]+_0x5b09('0x45'),_0x5d1dd6);_0x5897b9(_0x5d1dd6);})[_0x5b09('0x12')](function(_0x213461){logger['error']('['+[_0x1adf7d[_0x5b09('0x14')]()]+']',_0x213461[_0x5b09('0x15')]);_0x959479(_0x213461['message']);});});};}function createRemoteTag(_0x3958e3,_0x4e60be,_0x51ad0e,_0x119dcc){return new Promise(function(_0x169485,_0x10fe20){var _0x299fc4={'method':'POST','uri':_0x51ad0e+_0x5b09('0x46')+'?'+_0x119dcc,'body':{'short_description':_0x3958e3,'global':!![],'active':!![],'name':_0x3958e3},'auth':_0x4e60be,'json':!![]};return rp(_0x299fc4)['then'](function(_0x203fd4){var _0x395e62=_0x203fd4[_0x5b09('0xd')]['sys_id'];_0x169485(_0x395e62);});});}function getRemoteTag(_0x9efc44,_0x468ee0,_0x591475,_0x2e39e2,_0x174951){return new Promise(function(_0x9cf0aa,_0xb0d56b){var _0x401273={'method':_0x5b09('0xa'),'uri':_0x591475+_0x5b09('0x46')+_0x5b09('0x47')+_0x9efc44+'&'+_0x2e39e2,'auth':_0x468ee0,'json':!![]};return rp(_0x401273)[_0x5b09('0xc')](function(_0x231d1e){if(_0x231d1e['result'][_0x5b09('0xe')]>0x0){var _0x56a83b=_0x231d1e['result'][0x0][_0x5b09('0xf')];_0x9cf0aa(_0x56a83b);}else{return createRemoteTag(_0x9efc44,_0x468ee0,_0x591475,_0x2e39e2)[_0x5b09('0xc')](function(_0x4e3007){_0x9cf0aa(_0x4e3007);});}});});}function assignTagToIncident(_0x4df29b,_0x3881ea,_0x4ca078,_0x4c9ca4,_0x2b047b){return new Promise(function(_0x864f4b,_0x4fb880){var _0x50a21f={'method':'POST','uri':_0x4ca078+_0x5b09('0x48')+'?'+_0x2b047b,'body':{'label':_0x4df29b,'table':'incident','id_type':'Incident','table_key':_0x4c9ca4[_0x5b09('0x43')],'title':'Incident\x20-\x20'+_0x4c9ca4[_0x5b09('0x44')],'id_display':_0x4c9ca4[_0x5b09('0x44')]},'auth':_0x3881ea,'json':!![]};return rp(_0x50a21f)[_0x5b09('0xc')](function(_0x4ef74e){_0x864f4b();})['catch'](function(){_0x864f4b();});});}function manageTags(_0x460a4f,_0x3b69e0,_0xe2e043,_0x11e40e,_0xf0f4fe,_0x17dd2b,_0x107b34){return new Promise(function(_0x1d9fc8,_0xd7a8b1){var _0x4823d6=[];_0x3b69e0[_0x5b09('0x2b')](function(_0x4aecfa){_0x4823d6['push'](getRemoteTag(_0x4aecfa,_0xe2e043,_0x11e40e,_0x17dd2b,_0x107b34));});return Promise[_0x5b09('0x49')](_0x4823d6)['then'](function(_0x3a1986){if(_0x3a1986[_0x5b09('0xe')]){logger['info']('['+[_0x460a4f[_0x5b09('0x14')]()]+_0x5b09('0x4a'),_0x3a1986);var _0x4c8e72=[];_0x3a1986[_0x5b09('0x2b')](function(_0x37471c){_0x4c8e72['push'](assignTagToIncident(_0x37471c,_0xe2e043,_0x11e40e,_0xf0f4fe,_0x17dd2b));});return Promise['all'](_0x4c8e72)[_0x5b09('0xc')](function(){_0x1d9fc8();})[_0x5b09('0x12')](function(){_0x1d9fc8();});}else{_0x1d9fc8();}});});}function getTags(_0x3e31b2,_0x5e3daa,_0x45518d,_0x1a3d7e,_0xc6fb63,_0x55197a){return function(_0x3936b3){return new Promise(function(_0xccd0da,_0x1d5b66){var _0x48e655=[];var _0x25cf14=_0x1a3d7e['Tags'];if(_0x25cf14&&_0x25cf14[_0x5b09('0xe')]>0x0){_0x48e655=_[_0x5b09('0x4b')](_0x25cf14,'name');}if(_0x48e655[_0x5b09('0xe')]>0x0){return manageTags(_0x3e31b2,_0x48e655,_0x5e3daa,_0x45518d,_0x3936b3,_0xc6fb63,_0x55197a)[_0x5b09('0xc')](function(){_0xccd0da(_0x3936b3);});}else{_0xccd0da(_0x3936b3);}});};}function emit(_0x4ff11c,_0x43ce1,_0x29de56){var _0x388561=_0x5b09('0x4c')+_0x5b09('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x5b09('0x4e');var _0x238afa={'uri':_0x4ff11c+_0x5b09('0x4f')+_0x29de56+_0x388561};io['to'](util[_0x5b09('0x50')](_0x5b09('0x51'),_0x43ce1))['emit'](_0x5b09('0x52'),_0x238afa);}exports['cs']=function(_0x86bb32,_0x230f96,_0x5c2294,_0x4f30cb,_0x1de425,_0xab8e66,_0x3a1c39,_0x767a4a){var _0x29a0b0={};var _0x2f1c28={'user':_0xab8e66[_0x5b09('0x53')],'pass':_0xab8e66[_0x5b09('0x54')]};var _0x5bbedd='sysparm_limit=1';var _0x139874=_0x5b09('0x55');_0xab8e66['remoteUri']=intUtil['stripTrailingSlash'](_0xab8e66[_0x5b09('0x56')]);_0xab8e66[_0x5b09('0x57')]=intUtil['stripTrailingSlash'](_0xab8e66[_0x5b09('0x57')]);var _0x5c445c=util[_0x5b09('0x50')]('%s/api/now/table/',_0xab8e66[_0x5b09('0x56')]);_0x29a0b0['userEmail']=!_['isNil'](_0x4f30cb)?_0x4f30cb[_0x5b09('0x58')]:null;_0x29a0b0['adminEmail']=_0xab8e66[_0x5b09('0x58')];_0x29a0b0[_0x5b09('0x24')]=_0x767a4a[_0x5b09('0x32')]()===_0x5b09('0x3c')?_0x230f96[_0x5b09('0x59')]:_0x230f96[_0x5b09('0x5a')];_0x29a0b0[_0x5b09('0x5b')]=_0x767a4a===_0x5b09('0x5c')||_0x767a4a===_0x5b09('0x5d')?_0x5b09('0x5c'):'outbound';var _0xcfcca2=util[_0x5b09('0x50')](_0x5b09('0x5e'),_0xab8e66[_0x5b09('0x57')],_0x230f96[_0x5b09('0x5f')],md5(_0x230f96[_0x5b09('0x5f')]));if(_0x1de425&&_0x1de425['monitor_format']){logger[_0x5b09('0x10')](_0x5b09('0x60'),_0x5b09('0x61'));_0x230f96[_0x5b09('0x62')]=_0xcfcca2;}else if(_0x3a1c39&&_0x3a1c39[_0x5b09('0x63')]&&_0x3a1c39['recordingFormat']!==_0x5b09('0x64')){logger[_0x5b09('0x10')](_0x5b09('0x65'),_0x5b09('0x61'));_0x230f96['recordingURL']=_0xcfcca2;}else{_0x230f96[_0x5b09('0x62')]='';}return getAdminUser(_0x767a4a,_0x2f1c28,_0x29a0b0,_0x5c445c,_0x139874,_0x5bbedd)['then'](getUser(_0x767a4a,_0x2f1c28,_0x5c445c,_0x139874,_0x5bbedd))[_0x5b09('0xc')](getEndUser(_0x767a4a,_0x2f1c28,_0x5c445c,_0x139874,_0x5bbedd))[_0x5b09('0xc')](getTicket(_0x767a4a,_0x2f1c28,_0x5c445c,_0x5c2294,_0x230f96,_0x139874))[_0x5b09('0xc')](function(_0x59ca17){logger['info'](util[_0x5b09('0x50')](_0x5b09('0x66'),_0x59ca17[_0x5b09('0x43')]));logger[_0x5b09('0x10')](util[_0x5b09('0x50')](_0x5b09('0x67'),_0x767a4a));if(_0x767a4a!==_0x5b09('0x5d')){logger[_0x5b09('0x10')]('['+[_0x767a4a['toUpperCase']()]+']',_0x5b09('0x68'));emit(_0xab8e66[_0x5b09('0x56')],_0x4f30cb[_0x5b09('0x3a')],_0x59ca17[_0x5b09('0x43')]);}})['catch'](function(_0x1dd85d){logger[_0x5b09('0x13')]('['+[_0x767a4a[_0x5b09('0x14')]()]+_0x5b09('0x69'),util[_0x5b09('0x6a')](_0x1dd85d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6327=['true','userId','adminId','adminEmail','info','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','picklist','type','nameField','toLowerCase','content','toString','string','customField','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','Incident','Incident\x20-\x20','forEach','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','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','result','length','sys_id','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6327,0x1a2));var _0x7632=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x6327[_0xc7348b];return _0x307cec;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x7632('0x0'));var md5=require(_0x7632('0x1'));var Redis=require(_0x7632('0x2'));var intUtil=require(_0x7632('0x3'));var config=require(_0x7632('0x4'));var logger=require(_0x7632('0x5'))(_0x7632('0x6'));config[_0x7632('0x7')]=_[_0x7632('0x8')](config[_0x7632('0x7')],{'host':_0x7632('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x5c5618,_0x4bc971,_0x279fe8,_0x228dfc,_0x3c3453,_0x4e116a){return new Promise(function(_0x1fcb03,_0x8299af){var _0x2cafec={'method':_0x7632('0xa'),'uri':_0x228dfc+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x3c3453+'&'+_0x4e116a,'auth':_0x4bc971,'json':!![]};return rp(_0x2cafec)['then'](function(_0x1c8c39){if(_0x1c8c39[_0x7632('0xb')][_0x7632('0xc')]>0x0){_0x279fe8['adminId']=_0x1c8c39['result'][0x0][_0x7632('0xd')];}logger['info']('['+[_0x5c5618['toUpperCase']()]+_0x7632('0xe'),_0x279fe8);_0x1fcb03(_0x279fe8);})[_0x7632('0xf')](function(_0x51f151){logger[_0x7632('0x10')]('['+[_0x5c5618[_0x7632('0x11')]()]+']',_0x51f151[_0x7632('0x12')]);_0x8299af(_0x51f151[_0x7632('0x12')]);});});}function getUser(_0x245ab0,_0x4c2382,_0x39b7ca,_0x1d9455,_0xa21c6c){return function(_0x3e9e0c){logger['info']('['+[_0x245ab0['toUpperCase']()]+_0x7632('0x13'),_0x3e9e0c);return new Promise(function(_0x453b19,_0x1207bc){if(intUtil[_0x7632('0x14')](_0x3e9e0c[_0x7632('0x15')])){var _0x5a1ec1={'method':_0x7632('0xa'),'uri':_0x39b7ca+_0x7632('0x16')+_0x3e9e0c[_0x7632('0x15')]+'&'+_0x1d9455+'&'+_0xa21c6c,'auth':_0x4c2382,'json':!![]};logger['info']('['+[_0x245ab0[_0x7632('0x11')]()]+_0x7632('0x17'),_0x5a1ec1);return rp(_0x5a1ec1)[_0x7632('0x18')](function(_0x57e8fe){logger['info']('['+[_0x245ab0[_0x7632('0x11')]()]+'],\x20getUser\x20entity',_0x57e8fe);if(_0x57e8fe[_0x7632('0xb')]['length']>0x0&&String(_0x57e8fe[_0x7632('0xb')][0x0][_0x7632('0x19')])===_0x7632('0x1a')){_0x3e9e0c['userId']=_0x57e8fe[_0x7632('0xb')][0x0][_0x7632('0xd')];}else{_0x3e9e0c[_0x7632('0x1b')]=_0x3e9e0c[_0x7632('0x1c')];_0x3e9e0c[_0x7632('0x15')]=_0x3e9e0c[_0x7632('0x1d')];}logger[_0x7632('0x1e')]('['+[_0x245ab0[_0x7632('0x11')]()]+_0x7632('0x1f'),_0x3e9e0c);_0x453b19(_0x3e9e0c);})[_0x7632('0xf')](function(_0x5b36b7){logger[_0x7632('0x10')]('['+[_0x245ab0['toUpperCase']()]+']',_0x5b36b7['message']);_0x1207bc(_0x5b36b7[_0x7632('0x12')]);});}else{logger[_0x7632('0x1e')]('['+[_0x245ab0['toUpperCase']()]+_0x7632('0x20'));_0x3e9e0c['userId']=_0x3e9e0c[_0x7632('0x1c')];_0x3e9e0c[_0x7632('0x15')]=_0x3e9e0c[_0x7632('0x1d')];_0x453b19(_0x3e9e0c);}});};}function createEndUser(_0xcc85df,_0x325d4c,_0x52efdf,_0x525d7b,_0x57e4fd){logger['info']('['+[_0xcc85df['toUpperCase']()]+_0x7632('0x21'),_0x52efdf);return new Promise(function(_0x49237b,_0xd1e20b){var _0x308de9={'method':_0x7632('0x22'),'uri':_0x525d7b+_0x7632('0x23')+_0x57e4fd,'body':{'user_name':_0x52efdf[_0x7632('0x24')],'roles':_0x7632('0x25'),'first_name':_0x52efdf[_0x7632('0x24')],'active':'true','date_format':'System','phone':_0x52efdf[_0x7632('0x24')]},'auth':_0x325d4c,'json':!![]};return rp(_0x308de9)[_0x7632('0x18')](function(_0x6023c2){logger[_0x7632('0x1e')]('['+[_0xcc85df[_0x7632('0x11')]()]+_0x7632('0x26'),_0x6023c2[_0x7632('0xb')]);_0x52efdf[_0x7632('0x27')]=_0x6023c2[_0x7632('0xb')]['sys_id'];_0x49237b(_0x52efdf);})[_0x7632('0xf')](function(_0x1e78e1){logger['error']('['+[_0xcc85df[_0x7632('0x11')]()]+']',_0x1e78e1['message']);_0xd1e20b(_0x1e78e1['message']);});});}function getEndUser(_0x275494,_0x2ffebf,_0x1e1535,_0x13561b,_0x1bc2a1){return function(_0x1d1ac5){logger[_0x7632('0x1e')]('['+[_0x275494[_0x7632('0x11')]()]+_0x7632('0x28'),_0x1d1ac5);return new Promise(function(_0x4994c9,_0x4797dc){var _0x2b5ebb={'method':_0x7632('0xa'),'uri':_0x1e1535+'sys_user?sysparm_query=phone%3D'+_0x1d1ac5['endUserNumber']+'&'+_0x13561b+'&'+_0x1bc2a1,'auth':_0x2ffebf,'json':!![]};return rp(_0x2b5ebb)[_0x7632('0x18')](function(_0x511587){if(_0x511587[_0x7632('0xb')][_0x7632('0xc')]>0x0){_0x1d1ac5[_0x7632('0x27')]=_0x511587['result'][0x0][_0x7632('0xd')];logger['info']('['+[_0x275494[_0x7632('0x11')]()]+_0x7632('0x29'),_0x1d1ac5);_0x4994c9(_0x1d1ac5);}else{return createEndUser(_0x275494,_0x2ffebf,_0x1d1ac5,_0x1e1535,_0x13561b)[_0x7632('0x18')](function(_0x42b28c){logger['info']('['+[_0x275494['toUpperCase']()]+_0x7632('0x2a'),_0x42b28c);_0x4994c9(_0x42b28c);});}})['catch'](function(_0x42f977){logger[_0x7632('0x10')]('['+[_0x275494['toUpperCase']()]+']',_0x42f977[_0x7632('0x12')]);_0x4797dc(_0x42f977[_0x7632('0x12')]);});});};}function getCustomFields(_0x4970d0,_0x257f1e){var _0x41783b={};if(_0x4970d0['length']>0x0){_['forEach'](_0x4970d0,function(_0x5a0d75){if(_[_0x7632('0x2b')](['string',_0x7632('0x2c')],_0x5a0d75[_0x7632('0x2d')])&&_0x5a0d75[_0x7632('0x2e')]&&!_0x5a0d75['customField']){_0x41783b[_0x5a0d75['nameField'][_0x7632('0x2f')]()]=_0x5a0d75[_0x7632('0x30')][_0x7632('0x31')]();}else if(_[_0x7632('0x2b')]([_0x7632('0x32'),_0x7632('0x2c')],_0x5a0d75['type'])&&_0x5a0d75['idField']&&_0x5a0d75[_0x7632('0x33')]){_0x41783b[_0x5a0d75[_0x7632('0x34')][_0x7632('0x2f')]()]=_0x5a0d75[_0x7632('0x30')][_0x7632('0x31')]();}else if(_0x5a0d75[_0x7632('0x2d')]===_0x7632('0x35')&&_0x5a0d75[_0x7632('0x36')]&&_0x5a0d75[_0x7632('0x34')]&&_0x5a0d75[_0x7632('0x33')]){_0x41783b[_0x5a0d75['idField'][_0x7632('0x2f')]()]=_0x257f1e[_0x5a0d75['variableName']][_0x7632('0x31')]();}else if(_0x5a0d75[_0x7632('0x2d')]==='customVariable'&&_0x5a0d75[_0x7632('0x37')]&&_0x5a0d75['Variable']['name']&&_0x5a0d75[_0x7632('0x34')]&&_0x5a0d75[_0x7632('0x33')]){_0x41783b[_0x5a0d75['idField'][_0x7632('0x2f')]()]=_0x257f1e[_0x5a0d75[_0x7632('0x37')][_0x7632('0x38')][_0x7632('0x2f')]()]['toString']();}});}return _0x41783b;}function getTicket(_0x32121e,_0x3ddeef,_0x492a99,_0x496a62,_0x1d10ac,_0x321cbe){return function(_0x10f7e7){logger[_0x7632('0x1e')]('['+[_0x32121e['toUpperCase']()]+_0x7632('0x39'),_0x10f7e7);return new Promise(function(_0x473da8,_0x526c98){var _0x3407ce=_0x32121e[_0x7632('0x2f')]()===_0x7632('0x3a')?_0x10f7e7[_0x7632('0x1b')]:_0x10f7e7[_0x7632('0x27')];var _0x5cf01a={'method':_0x7632('0x22'),'uri':_0x492a99+'incident'+'?'+_0x321cbe,'body':Object[_0x7632('0x3b')]({},{'active':'true','caller_id':_0x3407ce,'assigned_to':_0x10f7e7[_0x7632('0x1b')],'short_description':intUtil[_0x7632('0x3c')](_0x496a62[_0x7632('0x3d')],_0x1d10ac,'\x20'),'description':intUtil['getString'](_0x496a62[_0x7632('0x3e')],_0x1d10ac,'\x0a')},getCustomFields(_0x496a62[_0x7632('0x3f')],_0x1d10ac)),'auth':_0x3ddeef,'json':!![]};return rp(_0x5cf01a)['then'](function(_0x469887){logger[_0x7632('0x1e')]('['+[_0x32121e['toUpperCase']()]+_0x7632('0x40'),_0x469887[_0x7632('0xb')]);_0x10f7e7[_0x7632('0x41')]=_0x469887[_0x7632('0xb')][_0x7632('0xd')];_0x10f7e7[_0x7632('0x42')]=_0x469887['result'][_0x7632('0x43')];logger[_0x7632('0x1e')]('['+[_0x32121e['toUpperCase']()]+_0x7632('0x44'),_0x10f7e7);_0x473da8(_0x10f7e7);})[_0x7632('0xf')](function(_0x1232b5){logger[_0x7632('0x10')]('['+[_0x32121e[_0x7632('0x11')]()]+']',_0x1232b5[_0x7632('0x12')]);_0x526c98(_0x1232b5['message']);});});};}function createRemoteTag(_0x208f0e,_0x12ed51,_0x405607,_0x34629d){return new Promise(function(_0x5c2673,_0x18ae36){var _0x472ab={'method':_0x7632('0x22'),'uri':_0x405607+_0x7632('0x45')+'?'+_0x34629d,'body':{'short_description':_0x208f0e,'global':!![],'active':!![],'name':_0x208f0e},'auth':_0x12ed51,'json':!![]};return rp(_0x472ab)[_0x7632('0x18')](function(_0x2705b0){var _0x3c5e20=_0x2705b0[_0x7632('0xb')][_0x7632('0xd')];_0x5c2673(_0x3c5e20);});});}function getRemoteTag(_0x382ca8,_0x566c6e,_0x4b9c0d,_0x484a55,_0x407bca){return new Promise(function(_0x1ebbf6,_0x55271c){var _0x58dbd5={'method':_0x7632('0xa'),'uri':_0x4b9c0d+_0x7632('0x45')+'?sysparm_query=name%3D'+_0x382ca8+'&'+_0x484a55,'auth':_0x566c6e,'json':!![]};return rp(_0x58dbd5)[_0x7632('0x18')](function(_0x5afb43){if(_0x5afb43[_0x7632('0xb')]['length']>0x0){var _0x1188e7=_0x5afb43[_0x7632('0xb')][0x0][_0x7632('0xd')];_0x1ebbf6(_0x1188e7);}else{return createRemoteTag(_0x382ca8,_0x566c6e,_0x4b9c0d,_0x484a55)[_0x7632('0x18')](function(_0x48e1e3){_0x1ebbf6(_0x48e1e3);});}});});}function assignTagToIncident(_0xc2b3f1,_0x2623fa,_0x1d7d6,_0x29e35a,_0x106b14){return new Promise(function(_0x27ee72,_0x2fab1e){var _0x286cac={'method':_0x7632('0x22'),'uri':_0x1d7d6+'label_entry'+'?'+_0x106b14,'body':{'label':_0xc2b3f1,'table':'incident','id_type':_0x7632('0x46'),'table_key':_0x29e35a[_0x7632('0x41')],'title':_0x7632('0x47')+_0x29e35a['ticketNumber'],'id_display':_0x29e35a[_0x7632('0x42')]},'auth':_0x2623fa,'json':!![]};return rp(_0x286cac)[_0x7632('0x18')](function(_0x4ef563){_0x27ee72();})[_0x7632('0xf')](function(){_0x27ee72();});});}function manageTags(_0x306203,_0x2c95a2,_0x58d893,_0x240966,_0xd7705d,_0x5c3b2d,_0xf8c172){return new Promise(function(_0x2431bb,_0x3c5c04){var _0x21c118=[];_0x2c95a2[_0x7632('0x48')](function(_0x419dfa){_0x21c118[_0x7632('0x49')](getRemoteTag(_0x419dfa,_0x58d893,_0x240966,_0x5c3b2d,_0xf8c172));});return Promise[_0x7632('0x4a')](_0x21c118)[_0x7632('0x18')](function(_0x5bca26){if(_0x5bca26[_0x7632('0xc')]){logger[_0x7632('0x1e')]('['+[_0x306203[_0x7632('0x11')]()]+_0x7632('0x4b'),_0x5bca26);var _0x456235=[];_0x5bca26['forEach'](function(_0x5d41a){_0x456235[_0x7632('0x49')](assignTagToIncident(_0x5d41a,_0x58d893,_0x240966,_0xd7705d,_0x5c3b2d));});return Promise[_0x7632('0x4a')](_0x456235)[_0x7632('0x18')](function(){_0x2431bb();})[_0x7632('0xf')](function(){_0x2431bb();});}else{_0x2431bb();}});});}function getTags(_0x1ebf65,_0x8a2def,_0x1d0396,_0x417cd7,_0x3e3392,_0xfc1e2e){return function(_0x4b48fc){return new Promise(function(_0x21db2b,_0x1567e1){var _0x29d687=[];var _0x2fe7bd=_0x417cd7[_0x7632('0x4c')];if(_0x2fe7bd&&_0x2fe7bd[_0x7632('0xc')]>0x0){_0x29d687=_['map'](_0x2fe7bd,'name');}if(_0x29d687[_0x7632('0xc')]>0x0){return manageTags(_0x1ebf65,_0x29d687,_0x8a2def,_0x1d0396,_0x4b48fc,_0x3e3392,_0xfc1e2e)[_0x7632('0x18')](function(){_0x21db2b(_0x4b48fc);});}else{_0x21db2b(_0x4b48fc);}});};}function emit(_0x206d33,_0x4c296f,_0x217fa8){var _0x4dd4a5=_0x7632('0x4d')+_0x7632('0x4e')+_0x7632('0x4f')+_0x7632('0x50');var _0x163b6e={'uri':_0x206d33+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x217fa8+_0x4dd4a5};io['to'](util[_0x7632('0x51')](_0x7632('0x52'),_0x4c296f))[_0x7632('0x53')](_0x7632('0x54'),_0x163b6e);}exports['cs']=function(_0x454dcd,_0x463182,_0x112eed,_0x28d34d,_0x387c4d,_0x4b8636,_0x55d6ae,_0x1d0ee5){var _0x349ca0={};var _0x24c238={'user':_0x4b8636[_0x7632('0x55')],'pass':_0x4b8636[_0x7632('0x56')]};var _0x7fe420=_0x7632('0x57');var _0x4f06e2=_0x7632('0x58');_0x4b8636[_0x7632('0x59')]=intUtil[_0x7632('0x5a')](_0x4b8636[_0x7632('0x59')]);_0x4b8636[_0x7632('0x5b')]=intUtil['stripTrailingSlash'](_0x4b8636[_0x7632('0x5b')]);var _0x19d5bb=util['format'](_0x7632('0x5c'),_0x4b8636[_0x7632('0x59')]);_0x349ca0['userEmail']=!_[_0x7632('0x5d')](_0x28d34d)?_0x28d34d[_0x7632('0x5e')]:null;_0x349ca0[_0x7632('0x1d')]=_0x4b8636[_0x7632('0x5e')];_0x349ca0['endUserNumber']=_0x1d0ee5[_0x7632('0x2f')]()===_0x7632('0x3a')?_0x463182['destcalleridnum']:_0x463182['calleridnum'];_0x349ca0[_0x7632('0x5f')]=_0x1d0ee5===_0x7632('0x60')||_0x1d0ee5===_0x7632('0x61')?'queue':_0x7632('0x3a');var _0x360427=util[_0x7632('0x51')](_0x7632('0x62'),_0x4b8636[_0x7632('0x5b')],_0x463182[_0x7632('0x63')],md5(_0x463182[_0x7632('0x63')]));if(_0x387c4d&&_0x387c4d[_0x7632('0x64')]){logger[_0x7632('0x1e')](_0x7632('0x65'),'Recording\x20is\x20enabled!');_0x463182[_0x7632('0x66')]=_0x360427;}else if(_0x55d6ae&&_0x55d6ae[_0x7632('0x67')]&&_0x55d6ae['recordingFormat']!==_0x7632('0x68')){logger['info']('[OUTBOUND]',_0x7632('0x69'));_0x463182[_0x7632('0x66')]=_0x360427;}else{_0x463182[_0x7632('0x66')]='';}return getAdminUser(_0x1d0ee5,_0x24c238,_0x349ca0,_0x19d5bb,_0x4f06e2,_0x7fe420)['then'](getUser(_0x1d0ee5,_0x24c238,_0x19d5bb,_0x4f06e2,_0x7fe420))[_0x7632('0x18')](getEndUser(_0x1d0ee5,_0x24c238,_0x19d5bb,_0x4f06e2,_0x7fe420))[_0x7632('0x18')](getTicket(_0x1d0ee5,_0x24c238,_0x19d5bb,_0x112eed,_0x463182,_0x4f06e2))[_0x7632('0x18')](function(_0x573070){logger[_0x7632('0x1e')](util[_0x7632('0x51')](_0x7632('0x6a'),_0x573070[_0x7632('0x41')]));logger[_0x7632('0x1e')](util[_0x7632('0x51')](_0x7632('0x6b'),_0x1d0ee5));if(_0x1d0ee5!==_0x7632('0x61')){logger[_0x7632('0x1e')]('['+[_0x1d0ee5['toUpperCase']()]+']',_0x7632('0x6c'));emit(_0x4b8636['remoteUri'],_0x28d34d['name'],_0x573070[_0x7632('0x41')]);}})[_0x7632('0xf')](function(_0x3f4d9a){logger[_0x7632('0x10')]('['+[_0x1d0ee5[_0x7632('0x11')]()]+_0x7632('0x6d'),util[_0x7632('0x6e')](_0x3f4d9a,{'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 10d11b9..ff8270b 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 _0x4258=['getString','Subjects','assigned_user_id','description','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','forEach','variableName','push','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','stringify','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','length','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','[HTTP]','merge','map','type','string','customField','content','idField','custom_fields','variable','Variable','toLowerCase','login','username','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','recordingURL','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','users','contacts','lastevent','toUpperCase','calleridnum','error','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name'];(function(_0x4f86e6,_0x21a278){var _0x5f3b8d=function(_0x3c4b29){while(--_0x3c4b29){_0x4f86e6['push'](_0x4f86e6['shift']());}};_0x5f3b8d(++_0x21a278);}(_0x4258,0x1cd));var _0x8425=function(_0x1e0539,_0x15ae48){_0x1e0539=_0x1e0539-0x0;var _0x40ba17=_0x4258[_0x1e0539];return _0x40ba17;};'use strict';var _=require(_0x8425('0x0'));var rp=require(_0x8425('0x1'));var BPromise=require(_0x8425('0x2'));var md5=require('md5');var util=require(_0x8425('0x3'));var Redis=require(_0x8425('0x4'));var intUtil=require(_0x8425('0x5'));var config=require(_0x8425('0x6'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x8425('0x7')]=_[_0x8425('0x8')](config[_0x8425('0x7')],{'host':_0x8425('0x9'),'port':0x18eb});var io=require(_0x8425('0xa'))(new Redis(config[_0x8425('0x7')]));var def={'method':_0x8425('0xb'),'json':!![]};function emit(_0x4c1e1d,_0x261f11,_0x583599){io['to'](_0x4c1e1d)[_0x8425('0xc')](_0x261f11,_0x583599);}function getTicket(_0x35ff34,_0x4d0190,_0x2a9e77,_0x55ce85,_0x534e91,_0x476ceb,_0x298e6e,_0xc25e8d){logger['info'](_0x8425('0xd'));var _0x407474=new Date();var _0x2dbbaa=[{'name':_0x8425('0xe'),'value':intUtil[_0x8425('0xf')](_0x55ce85[_0x8425('0x10')],_0x534e91,'\x20')},{'name':_0x8425('0x11'),'value':_0x4d0190['id']},{'name':'created_by','value':_0x4d0190['id']},{'name':_0x8425('0x12'),'value':intUtil['getString'](_0x55ce85['Descriptions'],_0x534e91,'\x0a')},{'name':'date_start','value':_0x407474[_0x8425('0x13')]()[_0x8425('0x14')](0x0,0x13)[_0x8425('0x15')]('T','\x20')},{'name':_0x8425('0x16'),'value':'0'},{'name':_0x8425('0x17'),'value':'15'},{'name':_0x8425('0x18'),'value':_0x2a9e77['id']},{'name':_0x8425('0x19'),'value':'Contacts'},{'name':_0x8425('0x1a'),'value':_0x2a9e77['name']},{'name':_0x8425('0x1b'),'value':_0xc25e8d}];if(_0x476ceb['length']){_[_0x8425('0x1c')](_0x476ceb,function(_0x3d6792){if(_0x534e91[_0x3d6792[_0x8425('0x1d')]]){_0x2dbbaa[_0x8425('0x1e')]({'name':_0x3d6792['idField'],'value':_0x534e91[_0x3d6792[_0x8425('0x1d')]]});}});}return request({'form':{'method':_0x8425('0x1f'),'input_type':_0x8425('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x298e6e['id'],'module_name':_0x8425('0x21'),'name_value_list':_0x2dbbaa})}});}function getAuth(_0x1d148e){return util[_0x8425('0x22')](_0x8425('0x23'),new Buffer(_0x1d148e[_0x8425('0x24')]+':X')[_0x8425('0x25')]('base64'));}function getServerInfo(_0x14171a){return request({'form':{'method':_0x8425('0x26'),'input_type':'JSON','response_type':_0x8425('0x20'),'rest_data':JSON[_0x8425('0x27')]({'session':_0x14171a['id']})}});}function getUser(_0x3c0054,_0x1e83e3,_0x2a75d1){if(!_[_0x8425('0x28')](_0x1e83e3)){logger[_0x8425('0x29')](_0x8425('0x2a'),_0x1e83e3);return request({'form':{'method':_0x8425('0x2b'),'input_type':_0x8425('0x20'),'response_type':'JSON','rest_data':JSON[_0x8425('0x27')]({'session':_0x2a75d1['id'],'module_name':'Employees','query':util[_0x8425('0x22')](_0x8425('0x2c'),_0x1e83e3),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8425('0x2d')](function(_0x497ffb){if(_0x497ffb[_0x8425('0x2e')][_0x8425('0x2f')]){var _0x5f2d21=_[_0x8425('0x30')](_0x497ffb[_0x8425('0x2e')],function(_0x5d3756){return _0x5d3756[_0x8425('0x31')][_0x8425('0x32')][_0x8425('0x33')]===_0x1e83e3;});if(_0x5f2d21){logger[_0x8425('0x29')](_0x8425('0x34'));return BPromise[_0x8425('0x35')]({'id':_0x5f2d21[_0x8425('0x31')]['id']['value'],'name':_0x5f2d21[_0x8425('0x31')]['name'][_0x8425('0x33')]});}}logger[_0x8425('0x29')](_0x8425('0x36'));return BPromise[_0x8425('0x35')]({'id':_0x2a75d1[_0x8425('0x31')][_0x8425('0x37')]['value'],'name':_0x2a75d1[_0x8425('0x31')][_0x8425('0x32')]['value']});});}else{logger[_0x8425('0x29')](_0x8425('0x38'));return BPromise['resolve']({'id':_0x2a75d1[_0x8425('0x31')]['user_id'][_0x8425('0x33')],'name':_0x2a75d1[_0x8425('0x31')][_0x8425('0x32')][_0x8425('0x33')]});}}function getEndUser(_0x560ef5,_0x35695e,_0x433ee6,_0x2f80f5){logger['info']('Searching\x20enduser\x20with\x20phone',_0x433ee6);return request({'form':{'method':'get_entry_list','input_type':_0x8425('0x20'),'response_type':_0x8425('0x20'),'rest_data':JSON[_0x8425('0x27')]({'session':_0x2f80f5['id'],'module_name':_0x8425('0x39'),'query':util[_0x8425('0x22')](_0x8425('0x3a'),_0x433ee6),'order_by':'','offset':'0','select_fields':['id',_0x8425('0xe'),_0x8425('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4cb2b0){if(_0x4cb2b0[_0x8425('0x2e')][_0x8425('0x2f')]){var _0x4b2dcd=_['find'](_0x4cb2b0[_0x8425('0x2e')],function(_0x3b851f){return _0x3b851f['name_value_list']['phone_home'][_0x8425('0x33')]===_0x433ee6;});if(_0x4b2dcd){logger[_0x8425('0x29')](_0x8425('0x3c'));return BPromise['resolve']({'id':_0x4b2dcd[_0x8425('0x31')]['id'][_0x8425('0x33')],'name':_0x4b2dcd[_0x8425('0x31')]['name'][_0x8425('0x33')],'phone':_0x4b2dcd[_0x8425('0x31')][_0x8425('0x3b')][_0x8425('0x33')]});}}else{logger['info'](_0x8425('0x3d'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2f80f5['id'],'module_name':'Contacts','name_value_list':[{'name':_0x8425('0x3e'),'value':_0x35695e!==''?_0x35695e:util['format'](_0x8425('0x3f'),_0x433ee6)},{'name':_0x8425('0x3b'),'value':_0x433ee6}]})}})[_0x8425('0x2d')](function(_0x1012b7){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x1012b7['id'],'name':_0x1012b7[_0x8425('0x2e')][_0x8425('0x3e')][_0x8425('0x33')],'phone':_0x1012b7['entry_list']['phone_home']['value']});});}});}function request(_0x307971){logger['debug'](_0x8425('0x40'),JSON['stringify'](_0x307971));return rp(_[_0x8425('0x41')](def,_0x307971));}function getTags(_0x288f50,_0x27bfbe){var _0x2db3c0=[];if(_0x288f50&&_0x288f50[_0x8425('0x2f')]>0x0){_0x2db3c0=_[_0x8425('0x42')](_0x288f50,_0x27bfbe);}return _0x2db3c0;}function getCustomFields(_0x22e73a,_0x3fe223){var _0x4dab8d=[];var _0x356f2b={'custom_fields':[]};if(_0x22e73a[_0x8425('0x2f')]>0x0){_[_0x8425('0x1c')](_0x22e73a,function(_0x15dff1){if(_0x15dff1[_0x8425('0x43')]===_0x8425('0x44')&&_0x15dff1['nameField']&&!_0x15dff1[_0x8425('0x45')]){_0x356f2b[_0x15dff1['nameField']['toLowerCase']()]=_0x15dff1[_0x8425('0x46')][_0x8425('0x25')]();}else if(_0x15dff1[_0x8425('0x43')]==='string'&&_0x15dff1[_0x8425('0x47')]&&_0x15dff1[_0x8425('0x45')]){_0x356f2b[_0x8425('0x48')][_0x8425('0x1e')]({'id':_0x15dff1[_0x8425('0x47')],'value':_0x15dff1[_0x8425('0x46')][_0x8425('0x25')]()});}else if(_0x15dff1[_0x8425('0x43')]===_0x8425('0x49')&&_0x15dff1[_0x8425('0x1d')]&&_0x15dff1[_0x8425('0x47')]&&_0x15dff1[_0x8425('0x45')]){_0x3fe223[_0x15dff1[_0x8425('0x1d')]]&&_0x356f2b['custom_fields'][_0x8425('0x1e')]({'id':_0x15dff1[_0x8425('0x47')],'value':_0x3fe223[_0x15dff1[_0x8425('0x1d')]][_0x8425('0x25')]()});}else if(_0x15dff1[_0x8425('0x43')]==='customVariable'&&_0x15dff1[_0x8425('0x4a')]&&_0x15dff1['Variable'][_0x8425('0xe')]&&_0x15dff1[_0x8425('0x47')]&&_0x15dff1[_0x8425('0x45')]){_0x3fe223[_0x15dff1[_0x8425('0x4a')][_0x8425('0xe')][_0x8425('0x4b')]()]&&_0x356f2b[_0x8425('0x48')][_0x8425('0x1e')]({'id':_0x15dff1[_0x8425('0x47')],'value':_0x3fe223[_0x15dff1[_0x8425('0x4a')][_0x8425('0xe')][_0x8425('0x4b')]()][_0x8425('0x25')]()});}});}return _0x356f2b;}function getConnection(_0x2a9f59){return request({'method':_0x8425('0xb'),'form':{'method':_0x8425('0x4c'),'input_type':_0x8425('0x20'),'response_type':_0x8425('0x20'),'rest_data':JSON[_0x8425('0x27')]({'user_auth':{'user_name':_0x2a9f59[_0x8425('0x4d')],'password':_0x2a9f59['password'],'encryption':_0x8425('0x4e')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x8425('0x2d')](function(_0x15acea){var _0x223b96=_0x15acea;if(_0x223b96['id']){def[_0x8425('0x4f')]=_0x223b96['id'];return BPromise['resolve'](_0x223b96);}else{throw new Error(util[_0x8425('0x22')](_0x8425('0x50'),_0x2a9f59['id']));}});}function setRelationship(_0x4a73b3,_0x55875b,_0x5e84e2,_0x107220){return request({'form':{'method':_0x8425('0x51'),'input_type':_0x8425('0x20'),'response_type':_0x8425('0x20'),'rest_data':JSON['stringify']({'session':_0x4a73b3['id'],'module_name':_0x8425('0x21'),'module_id':_0x5e84e2['id'],'link_field_name':_0x107220,'related_ids':[_0x55875b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8425('0x52')]=function(_0x101303,_0x52c703,_0x3738e2,_0x35f60c,_0x5cd1b2,_0x559db7){var _0x5c9151,_0x584d4b,_0x2ae391,_0x3fa6d0;_0x559db7[_0x8425('0x53')]=intUtil[_0x8425('0x54')](_0x559db7['remoteUri']);_0x559db7[_0x8425('0x55')]=intUtil[_0x8425('0x54')](_0x559db7[_0x8425('0x55')]);def[_0x8425('0x56')]=util[_0x8425('0x22')]('%s/service/v4_1/rest.php',_0x559db7[_0x8425('0x53')]);if(_0x5cd1b2&&_0x5cd1b2[_0x8425('0x57')]){logger['info'](_0x8425('0x58'),'Recording\x20is\x20enabled!');_0x52c703[_0x8425('0x59')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x559db7['serverUrl'],_0x52c703[_0x8425('0x5a')],md5(_0x52c703[_0x8425('0x5a')]));}else{_0x52c703[_0x8425('0x59')]='';}return getConnection(_0x559db7)['then'](function(_0xaba7d9){_0x3fa6d0=_0xaba7d9;return getUser(_0x559db7,_0x35f60c[_0x8425('0xe')],_0x3fa6d0);})[_0x8425('0x2d')](function(_0x5daff7){_0x5c9151=_0x5daff7;logger[_0x8425('0x29')]('The\x20User\x20ID\x20is:',_0x5c9151['id']);return getEndUser(_0x559db7,_0x52c703[_0x8425('0x5b')],_0x52c703['calleridnum'],_0x3fa6d0);})[_0x8425('0x2d')](function(_0x4364bc){_0x584d4b=_0x4364bc;logger[_0x8425('0x29')](_0x8425('0x5c'),_0x584d4b['id']);return getTicket(_0x559db7,_0x5c9151,_0x584d4b,_0x3738e2,_0x52c703,_0x3738e2[_0x8425('0x5d')],_0x3fa6d0,'Inbound');})[_0x8425('0x2d')](function(_0xf562b){_0x2ae391=_0xf562b;logger[_0x8425('0x29')](_0x8425('0x5e'));logger[_0x8425('0x29')](_0x8425('0x5f'),_0x2ae391['id']);return setRelationship(_0x3fa6d0,_0x5c9151,_0x2ae391,'users');})[_0x8425('0x2d')](function(){return setRelationship(_0x3fa6d0,_0x584d4b,_0x2ae391,'contacts');})[_0x8425('0x2d')](function(){return getServerInfo(_0x3fa6d0);})[_0x8425('0x2d')](function(_0x517ee4){var _0x3bfe91=parseInt(_0x517ee4[_0x8425('0x60')][_0x8425('0x61')](0x0));var _0x4d25c1=util[_0x8425('0x22')](_0x8425('0x62'),_0x559db7[_0x8425('0x53')],_0x2ae391['id']);if(_0x3bfe91>0x6){_0x4d25c1=util['format'](_0x8425('0x63'),_0x559db7['remoteUri'],_0x2ae391['id']);}logger[_0x8425('0x29')]('[QUEUE]',_0x8425('0x64'));emit(util['format'](_0x8425('0x65'),_0x35f60c['name']),_0x8425('0x66'),{'uri':_0x4d25c1});})[_0x8425('0x67')](function(_0x4bb086){logger['error'](_0x8425('0x58'),JSON[_0x8425('0x27')](_0x4bb086));});};exports[_0x8425('0x68')]=function(_0x4f3ef7,_0x2644db,_0x421780,_0x5119be,_0x594bd3,_0x5bcd0f,_0x2c84dc){var _0x4c479f,_0xb3bdb8,_0x31d660,_0x26a125;_0x5bcd0f['remoteUri']=intUtil[_0x8425('0x54')](_0x5bcd0f[_0x8425('0x53')]);_0x5bcd0f[_0x8425('0x55')]=intUtil[_0x8425('0x54')](_0x5bcd0f[_0x8425('0x55')]);def[_0x8425('0x56')]=util[_0x8425('0x22')](_0x8425('0x69'),_0x5bcd0f[_0x8425('0x53')]);if(_0x2c84dc&&_0x2c84dc[_0x8425('0x6a')]&&_0x2c84dc[_0x8425('0x6a')]!==_0x8425('0x6b')){logger[_0x8425('0x29')](_0x8425('0x6c'),_0x8425('0x6d'));_0x2644db['recordingURL']=util[_0x8425('0x22')](_0x8425('0x6e'),_0x5bcd0f['serverUrl'],_0x2644db[_0x8425('0x5a')],md5(_0x2644db['uniqueid']));}return getConnection(_0x5bcd0f)[_0x8425('0x2d')](function(_0x40c0e7){_0x26a125=_0x40c0e7;return getUser(_0x5bcd0f,_0x5119be['name'],_0x26a125);})['then'](function(_0x4e00a7){_0x4c479f=_0x4e00a7;logger[_0x8425('0x29')](_0x8425('0x6f'),_0x4c479f['id']);return getEndUser(_0x5bcd0f,_0x2644db[_0x8425('0x70')],_0x2644db['destcalleridnum'],_0x26a125);})[_0x8425('0x2d')](function(_0x174c8c){_0xb3bdb8=_0x174c8c;logger[_0x8425('0x29')]('The\x20Enduser\x20ID\x20is:',_0xb3bdb8['id']);return getTicket(_0x5bcd0f,_0x4c479f,_0xb3bdb8,_0x421780,_0x2644db,_0x421780[_0x8425('0x5d')],_0x26a125,'Outbound');})[_0x8425('0x2d')](function(_0x3a7d01){_0x31d660=_0x3a7d01;logger['info'](_0x8425('0x5e'));logger[_0x8425('0x29')](_0x8425('0x5f'),_0x31d660['id']);return setRelationship(_0x26a125,_0x4c479f,_0x31d660,_0x8425('0x71'));})[_0x8425('0x2d')](function(){return setRelationship(_0x26a125,_0xb3bdb8,_0x31d660,_0x8425('0x72'));})[_0x8425('0x2d')](function(){return getServerInfo(_0x26a125);})[_0x8425('0x2d')](function(_0x40888d){var _0x8775b5=parseInt(_0x40888d[_0x8425('0x60')]['charAt'](0x0));var _0x4619da=util['format'](_0x8425('0x62'),_0x5bcd0f['remoteUri'],_0x31d660['id']);if(_0x8775b5>0x6){_0x4619da=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5bcd0f[_0x8425('0x53')],_0x31d660['id']);}logger[_0x8425('0x29')](_0x8425('0x6c'),_0x8425('0x64'));emit(util[_0x8425('0x22')](_0x8425('0x65'),_0x5119be[_0x8425('0xe')]),_0x8425('0x66'),{'uri':_0x4619da});})[_0x8425('0x67')](function(_0x4bb789){logger['error'](_0x8425('0x6c'),JSON[_0x8425('0x27')](_0x4bb789));});};exports['unmanaged']=function(_0x39f95e,_0x101565,_0x5f1b9f,_0x20ef55,_0x58c9c2,_0x335b7d){var _0xb11ef2,_0x4e84da,_0x290d2b,_0x13ba07;_0x335b7d[_0x8425('0x53')]=intUtil['stripTrailingSlash'](_0x335b7d[_0x8425('0x53')]);_0x335b7d[_0x8425('0x55')]=intUtil[_0x8425('0x54')](_0x335b7d['serverUrl']);def[_0x8425('0x56')]=util[_0x8425('0x22')](_0x8425('0x69'),_0x335b7d[_0x8425('0x53')]);if(_0x58c9c2&&_0x58c9c2[_0x8425('0x57')]){logger[_0x8425('0x29')]('['+_0x101565[_0x8425('0x73')][_0x8425('0x74')]()+']','Recording\x20is\x20enabled!');_0x101565[_0x8425('0x59')]=util[_0x8425('0x22')](_0x8425('0x6e'),_0x335b7d[_0x8425('0x55')],_0x101565[_0x8425('0x5a')],md5(_0x101565[_0x8425('0x5a')]));}else{_0x101565[_0x8425('0x59')]='';}return getConnection(_0x335b7d)[_0x8425('0x2d')](function(_0x5b4ff5){_0x13ba07=_0x5b4ff5;if(!_['isNil'](_0x20ef55)){return getUser(_0x335b7d,_0x20ef55[_0x8425('0xe')],_0x13ba07);}else{return getUser(_0x335b7d,null,_0x13ba07);}})[_0x8425('0x2d')](function(_0x746c6e){_0xb11ef2=_0x746c6e;logger[_0x8425('0x29')](_0x8425('0x6f'),_0xb11ef2['id']);return getEndUser(_0x335b7d,_0x101565['calleridname'],_0x101565[_0x8425('0x75')],_0x13ba07);})[_0x8425('0x2d')](function(_0x1737e0){_0x4e84da=_0x1737e0;logger[_0x8425('0x29')](_0x8425('0x5c'),_0x4e84da['id']);return getTicket(_0x335b7d,_0xb11ef2,_0x4e84da,_0x5f1b9f,_0x101565,_0x5f1b9f['Fields'],_0x13ba07,'Inbound');})[_0x8425('0x2d')](function(_0x428dc6){_0x290d2b=_0x428dc6;logger[_0x8425('0x29')](_0x8425('0x5e'));logger[_0x8425('0x29')](_0x8425('0x5f'),_0x290d2b['id']);return setRelationship(_0x13ba07,_0xb11ef2,_0x290d2b,'users');})[_0x8425('0x2d')](function(){return setRelationship(_0x13ba07,_0x4e84da,_0x290d2b,_0x8425('0x72'));})['then'](function(){return getServerInfo(_0x13ba07);})[_0x8425('0x67')](function(_0x3bf6a8){logger[_0x8425('0x76')]('['+_0x101565[_0x8425('0x73')][_0x8425('0x74')]()+']',JSON[_0x8425('0x27')](_0x3bf6a8));});}; \ No newline at end of file +var _0x88f2=['custom_fields','push','variable','Variable','login','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','charAt','user:%s','unmanaged','%s/service/v4_1/rest.php','lastevent','toUpperCase','catch','lodash','request-promise','bluebird','md5','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_name','direction','length','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','forEach','type','string','nameField','customField','toLowerCase','content','idField'];(function(_0x1f813a,_0x102327){var _0x5e0b7b=function(_0x41348b){while(--_0x41348b){_0x1f813a['push'](_0x1f813a['shift']());}};_0x5e0b7b(++_0x102327);}(_0x88f2,0xae));var _0x288f=function(_0xf2baf9,_0x1d0d7e){_0xf2baf9=_0xf2baf9-0x0;var _0x1584cc=_0x88f2[_0xf2baf9];return _0x1584cc;};'use strict';var _=require(_0x288f('0x0'));var rp=require(_0x288f('0x1'));var BPromise=require(_0x288f('0x2'));var md5=require(_0x288f('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x288f('0x4'));var config=require(_0x288f('0x5'));var logger=require(_0x288f('0x6'))(_0x288f('0x7'));config[_0x288f('0x8')]=_[_0x288f('0x9')](config[_0x288f('0x8')],{'host':_0x288f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x288f('0x8')]));var def={'method':_0x288f('0xb'),'json':!![]};function emit(_0x2e25ca,_0x18672f,_0xa57180){io['to'](_0x2e25ca)['emit'](_0x18672f,_0xa57180);}function getTicket(_0x2e2449,_0x30d7ee,_0xb6b0e8,_0x454c3a,_0xcb79d4,_0x2bddbc,_0x127cfc,_0x47d86c){logger[_0x288f('0xc')](_0x288f('0xd'));var _0xb3f0d6=new Date();var _0x524d7d=[{'name':_0x288f('0xe'),'value':intUtil['getString'](_0x454c3a[_0x288f('0xf')],_0xcb79d4,'\x20')},{'name':_0x288f('0x10'),'value':_0x30d7ee['id']},{'name':_0x288f('0x11'),'value':_0x30d7ee['id']},{'name':_0x288f('0x12'),'value':intUtil[_0x288f('0x13')](_0x454c3a[_0x288f('0x14')],_0xcb79d4,'\x0a')},{'name':_0x288f('0x15'),'value':_0xb3f0d6[_0x288f('0x16')]()['slice'](0x0,0x13)[_0x288f('0x17')]('T','\x20')},{'name':_0x288f('0x18'),'value':'0'},{'name':_0x288f('0x19'),'value':'15'},{'name':_0x288f('0x1a'),'value':_0xb6b0e8['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x288f('0x1b'),'value':_0xb6b0e8['name']},{'name':_0x288f('0x1c'),'value':_0x47d86c}];if(_0x2bddbc[_0x288f('0x1d')]){_['forEach'](_0x2bddbc,function(_0x121541){if(_0xcb79d4[_0x121541['variableName']]){_0x524d7d['push']({'name':_0x121541['idField'],'value':_0xcb79d4[_0x121541[_0x288f('0x1e')]]});}});}return request({'form':{'method':_0x288f('0x1f'),'input_type':_0x288f('0x20'),'response_type':_0x288f('0x20'),'rest_data':JSON[_0x288f('0x21')]({'session':_0x127cfc['id'],'module_name':_0x288f('0x22'),'name_value_list':_0x524d7d})}});}function getAuth(_0x30135b){return util[_0x288f('0x23')](_0x288f('0x24'),new Buffer(_0x30135b[_0x288f('0x25')]+':X')[_0x288f('0x26')](_0x288f('0x27')));}function getServerInfo(_0x8e3419){return request({'form':{'method':_0x288f('0x28'),'input_type':_0x288f('0x20'),'response_type':_0x288f('0x20'),'rest_data':JSON[_0x288f('0x21')]({'session':_0x8e3419['id']})}});}function getUser(_0x243416,_0x701edb,_0x3c3adf){if(!_[_0x288f('0x29')](_0x701edb)){logger[_0x288f('0xc')](_0x288f('0x2a'),_0x701edb);return request({'form':{'method':'get_entry_list','input_type':_0x288f('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3c3adf['id'],'module_name':'Employees','query':util[_0x288f('0x23')](_0x288f('0x2b'),_0x701edb),'order_by':'','offset':'0','select_fields':['id','name',_0x288f('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x288f('0x2d')](function(_0x17473b){if(_0x17473b['entry_list'][_0x288f('0x1d')]){var _0x15c5ee=_[_0x288f('0x2e')](_0x17473b[_0x288f('0x2f')],function(_0x87e813){return _0x87e813[_0x288f('0x30')][_0x288f('0x2c')][_0x288f('0x31')]===_0x701edb;});if(_0x15c5ee){logger['info'](_0x288f('0x32'));return BPromise[_0x288f('0x33')]({'id':_0x15c5ee[_0x288f('0x30')]['id'][_0x288f('0x31')],'name':_0x15c5ee['name_value_list'][_0x288f('0xe')]['value']});}}logger[_0x288f('0xc')](_0x288f('0x34'));return BPromise[_0x288f('0x33')]({'id':_0x3c3adf['name_value_list']['user_id'][_0x288f('0x31')],'name':_0x3c3adf['name_value_list'][_0x288f('0x2c')]['value']});});}else{logger[_0x288f('0xc')](_0x288f('0x35'));return BPromise[_0x288f('0x33')]({'id':_0x3c3adf[_0x288f('0x30')][_0x288f('0x36')][_0x288f('0x31')],'name':_0x3c3adf[_0x288f('0x30')][_0x288f('0x2c')][_0x288f('0x31')]});}}function getEndUser(_0x519611,_0xcf5705,_0xca95df,_0x573d38){logger[_0x288f('0xc')](_0x288f('0x37'),_0xca95df);return request({'form':{'method':_0x288f('0x38'),'input_type':_0x288f('0x20'),'response_type':_0x288f('0x20'),'rest_data':JSON[_0x288f('0x21')]({'session':_0x573d38['id'],'module_name':_0x288f('0x39'),'query':util['format'](_0x288f('0x3a'),_0xca95df),'order_by':'','offset':'0','select_fields':['id',_0x288f('0xe'),_0x288f('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x288f('0x2d')](function(_0x50cd24){if(_0x50cd24[_0x288f('0x2f')][_0x288f('0x1d')]){var _0x1a97ec=_[_0x288f('0x2e')](_0x50cd24['entry_list'],function(_0x53ba7d){return _0x53ba7d[_0x288f('0x30')]['phone_home'][_0x288f('0x31')]===_0xca95df;});if(_0x1a97ec){logger[_0x288f('0xc')]('Enduser\x20found!');return BPromise[_0x288f('0x33')]({'id':_0x1a97ec[_0x288f('0x30')]['id'][_0x288f('0x31')],'name':_0x1a97ec['name_value_list']['name'][_0x288f('0x31')],'phone':_0x1a97ec[_0x288f('0x30')][_0x288f('0x3b')][_0x288f('0x31')]});}}else{logger['info'](_0x288f('0x3c'));return request({'form':{'method':_0x288f('0x1f'),'input_type':_0x288f('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x573d38['id'],'module_name':_0x288f('0x39'),'name_value_list':[{'name':_0x288f('0x3d'),'value':_0xcf5705!==_0x288f('0x3e')?_0xcf5705:util[_0x288f('0x23')](_0x288f('0x3f'),_0xca95df)},{'name':_0x288f('0x3b'),'value':_0xca95df}]})}})[_0x288f('0x2d')](function(_0x553648){logger[_0x288f('0xc')](_0x288f('0x40'));return BPromise['resolve']({'id':_0x553648['id'],'name':_0x553648['entry_list']['first_name']['value'],'phone':_0x553648[_0x288f('0x2f')]['phone_home'][_0x288f('0x31')]});});}});}function request(_0x14570f){logger[_0x288f('0x41')](_0x288f('0x42'),JSON['stringify'](_0x14570f));return rp(_[_0x288f('0x43')](def,_0x14570f));}function getTags(_0x109c4d,_0x2f59eb){var _0x5c0142=[];if(_0x109c4d&&_0x109c4d[_0x288f('0x1d')]>0x0){_0x5c0142=_['map'](_0x109c4d,_0x2f59eb);}return _0x5c0142;}function getCustomFields(_0x43f262,_0x3a4982){var _0x35fbeb=[];var _0x55a85b={'custom_fields':[]};if(_0x43f262[_0x288f('0x1d')]>0x0){_[_0x288f('0x44')](_0x43f262,function(_0x5e36b9){if(_0x5e36b9[_0x288f('0x45')]===_0x288f('0x46')&&_0x5e36b9[_0x288f('0x47')]&&!_0x5e36b9[_0x288f('0x48')]){_0x55a85b[_0x5e36b9[_0x288f('0x47')][_0x288f('0x49')]()]=_0x5e36b9[_0x288f('0x4a')][_0x288f('0x26')]();}else if(_0x5e36b9[_0x288f('0x45')]==='string'&&_0x5e36b9[_0x288f('0x4b')]&&_0x5e36b9[_0x288f('0x48')]){_0x55a85b[_0x288f('0x4c')][_0x288f('0x4d')]({'id':_0x5e36b9[_0x288f('0x4b')],'value':_0x5e36b9[_0x288f('0x4a')][_0x288f('0x26')]()});}else if(_0x5e36b9[_0x288f('0x45')]===_0x288f('0x4e')&&_0x5e36b9[_0x288f('0x1e')]&&_0x5e36b9['idField']&&_0x5e36b9[_0x288f('0x48')]){_0x3a4982[_0x5e36b9[_0x288f('0x1e')]]&&_0x55a85b[_0x288f('0x4c')]['push']({'id':_0x5e36b9[_0x288f('0x4b')],'value':_0x3a4982[_0x5e36b9['variableName']][_0x288f('0x26')]()});}else if(_0x5e36b9['type']==='customVariable'&&_0x5e36b9['Variable']&&_0x5e36b9[_0x288f('0x4f')][_0x288f('0xe')]&&_0x5e36b9['idField']&&_0x5e36b9['customField']){_0x3a4982[_0x5e36b9[_0x288f('0x4f')][_0x288f('0xe')]['toLowerCase']()]&&_0x55a85b[_0x288f('0x4c')]['push']({'id':_0x5e36b9[_0x288f('0x4b')],'value':_0x3a4982[_0x5e36b9[_0x288f('0x4f')][_0x288f('0xe')][_0x288f('0x49')]()]['toString']()});}});}return _0x55a85b;}function getConnection(_0x182e93){return request({'method':_0x288f('0xb'),'form':{'method':_0x288f('0x50'),'input_type':'JSON','response_type':_0x288f('0x20'),'rest_data':JSON[_0x288f('0x21')]({'user_auth':{'user_name':_0x182e93[_0x288f('0x51')],'password':_0x182e93[_0x288f('0x52')],'encryption':'PLAIN'},'application':_0x288f('0x53')})}})[_0x288f('0x2d')](function(_0x43d382){var _0x1dcc75=_0x43d382;if(_0x1dcc75['id']){def['sessionID']=_0x1dcc75['id'];return BPromise[_0x288f('0x33')](_0x1dcc75);}else{throw new Error(util[_0x288f('0x23')](_0x288f('0x54'),_0x182e93['id']));}});}function setRelationship(_0x2942db,_0x55147e,_0x28a030,_0x19aa5c){return request({'form':{'method':_0x288f('0x55'),'input_type':_0x288f('0x20'),'response_type':_0x288f('0x20'),'rest_data':JSON[_0x288f('0x21')]({'session':_0x2942db['id'],'module_name':_0x288f('0x22'),'module_id':_0x28a030['id'],'link_field_name':_0x19aa5c,'related_ids':[_0x55147e['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x288f('0x56')]=function(_0x50763b,_0x23d293,_0x59fa9c,_0x31940c,_0x409c31,_0x1c6045){var _0x49979c,_0x42a166,_0x4b56d0,_0x1d8b1b;_0x1c6045[_0x288f('0x57')]=intUtil['stripTrailingSlash'](_0x1c6045['remoteUri']);_0x1c6045[_0x288f('0x58')]=intUtil[_0x288f('0x59')](_0x1c6045[_0x288f('0x58')]);def[_0x288f('0x5a')]=util[_0x288f('0x23')]('%s/service/v4_1/rest.php',_0x1c6045[_0x288f('0x57')]);if(_0x409c31&&_0x409c31[_0x288f('0x5b')]){logger[_0x288f('0xc')]('[QUEUE]',_0x288f('0x5c'));_0x23d293['recordingURL']=util[_0x288f('0x23')](_0x288f('0x5d'),_0x1c6045[_0x288f('0x58')],_0x23d293['uniqueid'],md5(_0x23d293[_0x288f('0x5e')]));}else{_0x23d293[_0x288f('0x5f')]='';}return getConnection(_0x1c6045)[_0x288f('0x2d')](function(_0x1fc8dd){_0x1d8b1b=_0x1fc8dd;return getUser(_0x1c6045,_0x31940c[_0x288f('0xe')],_0x1d8b1b);})[_0x288f('0x2d')](function(_0x3e9ef7){_0x49979c=_0x3e9ef7;logger[_0x288f('0xc')](_0x288f('0x60'),_0x49979c['id']);return getEndUser(_0x1c6045,_0x23d293[_0x288f('0x61')],_0x23d293[_0x288f('0x62')],_0x1d8b1b);})[_0x288f('0x2d')](function(_0x3a6aa9){_0x42a166=_0x3a6aa9;logger[_0x288f('0xc')](_0x288f('0x63'),_0x42a166['id']);return getTicket(_0x1c6045,_0x49979c,_0x42a166,_0x59fa9c,_0x23d293,_0x59fa9c[_0x288f('0x64')],_0x1d8b1b,_0x288f('0x65'));})[_0x288f('0x2d')](function(_0x157709){_0x4b56d0=_0x157709;logger[_0x288f('0xc')](_0x288f('0x66'));logger['info'](_0x288f('0x67'),_0x4b56d0['id']);return setRelationship(_0x1d8b1b,_0x49979c,_0x4b56d0,_0x288f('0x68'));})[_0x288f('0x2d')](function(){return setRelationship(_0x1d8b1b,_0x42a166,_0x4b56d0,_0x288f('0x69'));})[_0x288f('0x2d')](function(){return getServerInfo(_0x1d8b1b);})[_0x288f('0x2d')](function(_0x5298ad){var _0x78a9f3=parseInt(_0x5298ad[_0x288f('0x6a')]['charAt'](0x0));var _0x2018bb=util['format'](_0x288f('0x6b'),_0x1c6045[_0x288f('0x57')],_0x4b56d0['id']);if(_0x78a9f3>0x6){_0x2018bb=util[_0x288f('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1c6045['remoteUri'],_0x4b56d0['id']);}logger[_0x288f('0xc')](_0x288f('0x6c'),_0x288f('0x6d'));emit(util['format']('user:%s',_0x31940c[_0x288f('0xe')]),_0x288f('0x6e'),{'uri':_0x2018bb});})['catch'](function(_0x53658f){logger[_0x288f('0x6f')](_0x288f('0x6c'),JSON[_0x288f('0x21')](_0x53658f));});};exports[_0x288f('0x70')]=function(_0x13da11,_0x265b4f,_0x4c7ff6,_0x32e7d9,_0x3dc7c2,_0x3693f1,_0x4e3471){var _0x2dac67,_0x190751,_0x6c9067,_0x1cc30c;_0x3693f1[_0x288f('0x57')]=intUtil[_0x288f('0x59')](_0x3693f1[_0x288f('0x57')]);_0x3693f1[_0x288f('0x58')]=intUtil[_0x288f('0x59')](_0x3693f1[_0x288f('0x58')]);def['uri']=util[_0x288f('0x23')]('%s/service/v4_1/rest.php',_0x3693f1[_0x288f('0x57')]);if(_0x4e3471&&_0x4e3471['recordingFormat']&&_0x4e3471['recordingFormat']!==_0x288f('0x71')){logger[_0x288f('0xc')](_0x288f('0x72'),_0x288f('0x5c'));_0x265b4f['recordingURL']=util['format'](_0x288f('0x5d'),_0x3693f1['serverUrl'],_0x265b4f[_0x288f('0x5e')],md5(_0x265b4f[_0x288f('0x5e')]));}return getConnection(_0x3693f1)['then'](function(_0xad230){_0x1cc30c=_0xad230;return getUser(_0x3693f1,_0x32e7d9[_0x288f('0xe')],_0x1cc30c);})[_0x288f('0x2d')](function(_0x39ec13){_0x2dac67=_0x39ec13;logger[_0x288f('0xc')](_0x288f('0x60'),_0x2dac67['id']);return getEndUser(_0x3693f1,_0x265b4f[_0x288f('0x73')],_0x265b4f[_0x288f('0x74')],_0x1cc30c);})[_0x288f('0x2d')](function(_0x574f86){_0x190751=_0x574f86;logger[_0x288f('0xc')](_0x288f('0x63'),_0x190751['id']);return getTicket(_0x3693f1,_0x2dac67,_0x190751,_0x4c7ff6,_0x265b4f,_0x4c7ff6[_0x288f('0x64')],_0x1cc30c,_0x288f('0x75'));})['then'](function(_0x5ed19e){_0x6c9067=_0x5ed19e;logger[_0x288f('0xc')](_0x288f('0x66'));logger[_0x288f('0xc')](_0x288f('0x67'),_0x6c9067['id']);return setRelationship(_0x1cc30c,_0x2dac67,_0x6c9067,_0x288f('0x68'));})[_0x288f('0x2d')](function(){return setRelationship(_0x1cc30c,_0x190751,_0x6c9067,'contacts');})[_0x288f('0x2d')](function(){return getServerInfo(_0x1cc30c);})['then'](function(_0x54bccb){var _0x4a5abc=parseInt(_0x54bccb[_0x288f('0x6a')][_0x288f('0x76')](0x0));var _0x4fda06=util[_0x288f('0x23')](_0x288f('0x6b'),_0x3693f1[_0x288f('0x57')],_0x6c9067['id']);if(_0x4a5abc>0x6){_0x4fda06=util[_0x288f('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3693f1[_0x288f('0x57')],_0x6c9067['id']);}logger[_0x288f('0xc')](_0x288f('0x72'),_0x288f('0x6d'));emit(util[_0x288f('0x23')](_0x288f('0x77'),_0x32e7d9[_0x288f('0xe')]),_0x288f('0x6e'),{'uri':_0x4fda06});})['catch'](function(_0x4fcb65){logger['error'](_0x288f('0x72'),JSON['stringify'](_0x4fcb65));});};exports[_0x288f('0x78')]=function(_0x11b4e4,_0x396ba9,_0x412197,_0x14b021,_0x28c333,_0x48ea80){var _0xfd18e1,_0x5471a1,_0x122724,_0x3acceb;_0x48ea80[_0x288f('0x57')]=intUtil[_0x288f('0x59')](_0x48ea80[_0x288f('0x57')]);_0x48ea80[_0x288f('0x58')]=intUtil['stripTrailingSlash'](_0x48ea80[_0x288f('0x58')]);def[_0x288f('0x5a')]=util[_0x288f('0x23')](_0x288f('0x79'),_0x48ea80[_0x288f('0x57')]);if(_0x28c333&&_0x28c333[_0x288f('0x5b')]){logger[_0x288f('0xc')]('['+_0x396ba9[_0x288f('0x7a')][_0x288f('0x7b')]()+']',_0x288f('0x5c'));_0x396ba9['recordingURL']=util['format'](_0x288f('0x5d'),_0x48ea80[_0x288f('0x58')],_0x396ba9[_0x288f('0x5e')],md5(_0x396ba9[_0x288f('0x5e')]));}else{_0x396ba9[_0x288f('0x5f')]='';}return getConnection(_0x48ea80)[_0x288f('0x2d')](function(_0x516026){_0x3acceb=_0x516026;if(!_[_0x288f('0x29')](_0x14b021)){return getUser(_0x48ea80,_0x14b021['name'],_0x3acceb);}else{return getUser(_0x48ea80,null,_0x3acceb);}})[_0x288f('0x2d')](function(_0x2c23ca){_0xfd18e1=_0x2c23ca;logger['info']('The\x20User\x20ID\x20is:',_0xfd18e1['id']);return getEndUser(_0x48ea80,_0x396ba9[_0x288f('0x61')],_0x396ba9[_0x288f('0x62')],_0x3acceb);})[_0x288f('0x2d')](function(_0x405843){_0x5471a1=_0x405843;logger[_0x288f('0xc')](_0x288f('0x63'),_0x5471a1['id']);return getTicket(_0x48ea80,_0xfd18e1,_0x5471a1,_0x412197,_0x396ba9,_0x412197['Fields'],_0x3acceb,_0x288f('0x65'));})['then'](function(_0x3c1e77){_0x122724=_0x3c1e77;logger['info'](_0x288f('0x66'));logger[_0x288f('0xc')](_0x288f('0x67'),_0x122724['id']);return setRelationship(_0x3acceb,_0xfd18e1,_0x122724,'users');})[_0x288f('0x2d')](function(){return setRelationship(_0x3acceb,_0x5471a1,_0x122724,_0x288f('0x69'));})['then'](function(){return getServerInfo(_0x3acceb);})[_0x288f('0x7c')](function(_0x4fc0dd){logger[_0x288f('0x6f')]('['+_0x396ba9[_0x288f('0x7a')][_0x288f('0x7b')]()+']',JSON[_0x288f('0x21')](_0x4fc0dd));});}; \ 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 9b7fa8b..440826c 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 _0x8ab1=['keyType','string','key','format','%s:\x20%s','keyContent','customVariable','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','sortBy','length','type','content','variable','variableName','toString','Variable','name','push','toLowerCase'];(function(_0x2bdaec,_0x2ccbd8){var _0x23d694=function(_0x22a2e9){while(--_0x22a2e9){_0x2bdaec['push'](_0x2bdaec['shift']());}};_0x23d694(++_0x2ccbd8);}(_0x8ab1,0x192));var _0x18ab=function(_0x15f71b,_0x156c53){_0x15f71b=_0x15f71b-0x0;var _0x54f41f=_0x8ab1[_0x15f71b];return _0x54f41f;};'use strict';var _=require(_0x18ab('0x0'));var util=require(_0x18ab('0x1'));exports[_0x18ab('0x2')]=function(_0x454cf3,_0x199405,_0x515441){var _0x167496=[];if(_0x454cf3['length']>0x0){var _0x2903fc=_[_0x18ab('0x3')](_0x454cf3,['id']);for(var _0x2498b3=0x0;_0x2498b3<_0x2903fc[_0x18ab('0x4')];_0x2498b3++){var _0x3a6f89=_0x2903fc[_0x2498b3];if(_0x3a6f89[_0x18ab('0x5')]==='string'){_0x167496['push'](_0x3a6f89[_0x18ab('0x6')]);}else if(_0x3a6f89[_0x18ab('0x5')]===_0x18ab('0x7')&&_0x3a6f89[_0x18ab('0x8')]){_0x199405[_0x3a6f89[_0x18ab('0x8')]]&&_0x167496['push'](_0x199405[_0x3a6f89[_0x18ab('0x8')]][_0x18ab('0x9')]());}else if(_0x3a6f89['type']==='customVariable'&&_0x3a6f89[_0x18ab('0xa')]&&_0x3a6f89[_0x18ab('0xa')][_0x18ab('0xb')]){_0x199405[_0x3a6f89[_0x18ab('0xa')][_0x18ab('0xb')]['toLowerCase']()]&&_0x167496[_0x18ab('0xc')](_0x199405[_0x3a6f89[_0x18ab('0xa')]['name'][_0x18ab('0xd')]()][_0x18ab('0x9')]());}else if(_0x3a6f89[_0x18ab('0x5')]==='keyValue'){if(_0x3a6f89[_0x18ab('0xe')]===_0x18ab('0xf')&&_0x3a6f89[_0x18ab('0x10')]){_0x167496[_0x18ab('0xc')](util[_0x18ab('0x11')](_0x18ab('0x12'),_0x3a6f89[_0x18ab('0x10')],_0x3a6f89[_0x18ab('0x13')]));}else if(_0x3a6f89[_0x18ab('0xe')]==='variable'&&_0x3a6f89[_0x18ab('0x8')]&&_0x3a6f89['key']){_0x199405[_0x3a6f89[_0x18ab('0x8')]]&&_0x167496['push'](util['format'](_0x18ab('0x12'),_0x3a6f89[_0x18ab('0x10')],_0x199405[_0x3a6f89['variableName']]));}else if(_0x3a6f89[_0x18ab('0xe')]===_0x18ab('0x14')&&_0x3a6f89[_0x18ab('0xa')]&&_0x3a6f89[_0x18ab('0xa')][_0x18ab('0xb')]&&_0x3a6f89['key']){_0x199405[_0x3a6f89[_0x18ab('0xa')]['name'][_0x18ab('0xd')]()]&&_0x167496[_0x18ab('0xc')](util['format'](_0x18ab('0x12'),_0x3a6f89[_0x18ab('0x10')],_0x199405[_0x3a6f89[_0x18ab('0xa')][_0x18ab('0xb')]['toLowerCase']()]));}}}}return _0x167496['join'](_0x515441);};exports['stripTrailingSlash']=function(_0x1c0668){var _0x38fae6=_0x1c0668[_0x18ab('0x15')](-0x1);if(_0x38fae6==='/'){_0x1c0668=_0x1c0668['substring'](0x0,_0x1c0668[_0x18ab('0x16')](_0x38fae6));}return _0x1c0668;};exports[_0x18ab('0x17')]=function(_0x20a14a){if(!_[_0x18ab('0x18')](_0x20a14a)&&_0x20a14a!==''){var _0x224146=/^(([^<>()\[\]\\.,;:\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 _0x224146[_0x18ab('0x19')](String(_0x20a14a)[_0x18ab('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xa20e=['format','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash','getString','length','sortBy','type','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','string','key','%s:\x20%s','keyContent'];(function(_0x37998b,_0x27ed44){var _0x2bc1ce=function(_0x5072ba){while(--_0x5072ba){_0x37998b['push'](_0x37998b['shift']());}};_0x2bc1ce(++_0x27ed44);}(_0xa20e,0x158));var _0xea20=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xa20e[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xea20('0x0'));var util=require('util');exports[_0xea20('0x1')]=function(_0xbe3dbd,_0x434ecc,_0x4357b9){var _0x47166f=[];if(_0xbe3dbd[_0xea20('0x2')]>0x0){var _0x328d28=_[_0xea20('0x3')](_0xbe3dbd,['id']);for(var _0x45e133=0x0;_0x45e133<_0x328d28['length'];_0x45e133++){var _0x368afa=_0x328d28[_0x45e133];if(_0x368afa[_0xea20('0x4')]==='string'){_0x47166f[_0xea20('0x5')](_0x368afa[_0xea20('0x6')]);}else if(_0x368afa[_0xea20('0x4')]===_0xea20('0x7')&&_0x368afa[_0xea20('0x8')]){_0x434ecc[_0x368afa['variableName']]&&_0x47166f['push'](_0x434ecc[_0x368afa[_0xea20('0x8')]]['toString']());}else if(_0x368afa['type']===_0xea20('0x9')&&_0x368afa[_0xea20('0xa')]&&_0x368afa[_0xea20('0xa')]['name']){_0x434ecc[_0x368afa[_0xea20('0xa')][_0xea20('0xb')][_0xea20('0xc')]()]&&_0x47166f['push'](_0x434ecc[_0x368afa[_0xea20('0xa')][_0xea20('0xb')]['toLowerCase']()][_0xea20('0xd')]());}else if(_0x368afa[_0xea20('0x4')]===_0xea20('0xe')){if(_0x368afa[_0xea20('0xf')]===_0xea20('0x10')&&_0x368afa[_0xea20('0x11')]){_0x47166f[_0xea20('0x5')](util['format'](_0xea20('0x12'),_0x368afa[_0xea20('0x11')],_0x368afa[_0xea20('0x13')]));}else if(_0x368afa[_0xea20('0xf')]==='variable'&&_0x368afa[_0xea20('0x8')]&&_0x368afa[_0xea20('0x11')]){_0x434ecc[_0x368afa['variableName']]&&_0x47166f['push'](util['format'](_0xea20('0x12'),_0x368afa[_0xea20('0x11')],_0x434ecc[_0x368afa[_0xea20('0x8')]]));}else if(_0x368afa['keyType']===_0xea20('0x9')&&_0x368afa[_0xea20('0xa')]&&_0x368afa[_0xea20('0xa')]['name']&&_0x368afa['key']){_0x434ecc[_0x368afa[_0xea20('0xa')][_0xea20('0xb')][_0xea20('0xc')]()]&&_0x47166f[_0xea20('0x5')](util[_0xea20('0x14')](_0xea20('0x12'),_0x368afa['key'],_0x434ecc[_0x368afa[_0xea20('0xa')][_0xea20('0xb')][_0xea20('0xc')]()]));}}}}return _0x47166f[_0xea20('0x15')](_0x4357b9);};exports[_0xea20('0x16')]=function(_0x5bb75c){var _0xfdb166=_0x5bb75c[_0xea20('0x17')](-0x1);if(_0xfdb166==='/'){_0x5bb75c=_0x5bb75c[_0xea20('0x18')](0x0,_0x5bb75c[_0xea20('0x19')](_0xfdb166));}return _0x5bb75c;};exports[_0xea20('0x1a')]=function(_0x5203cd){if(!_['isNil'](_0x5203cd)&&_0x5203cd!==''){var _0x23833e=/^(([^<>()\[\]\\.,;:\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 _0x23833e[_0xea20('0x1b')](String(_0x5203cd)['toLowerCase']());}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 71cdb60..db4e6b3 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(_0x3e5b4c,_0x1883db){var _0x3a2a8c=function(_0x27eb86){while(--_0x27eb86){_0x3e5b4c['push'](_0x3e5b4c['shift']());}};_0x3a2a8c(++_0x1883db);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'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 _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(_0x92794f,_0x2673e6){var _0x3827fc=function(_0x576db0){while(--_0x576db0){_0x92794f['push'](_0x92794f['shift']());}};_0x3827fc(++_0x2673e6);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index a9069d2..f7cdde2 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 _0x1f5d=['The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','picklist','type','nameField','customField','content','string','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x4cf15d,_0x2c20d5){var _0x57a637=function(_0x2f4732){while(--_0x2f4732){_0x4cf15d['push'](_0x4cf15d['shift']());}};_0x57a637(++_0x2c20d5);}(_0x1f5d,0x170));var _0xd1f5=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0x1f5d[_0x5d61b4];return _0x183fc5;};'use strict';var _=require('lodash');var rp=require(_0xd1f5('0x0'));var md5=require(_0xd1f5('0x1'));var util=require(_0xd1f5('0x2'));var Redis=require('ioredis');var intUtil=require(_0xd1f5('0x3'));var config=require(_0xd1f5('0x4'));var logger=require(_0xd1f5('0x5'))('zendesk');config['redis']=_[_0xd1f5('0x6')](config['redis'],{'host':_0xd1f5('0x7'),'port':0x18eb});var io=require(_0xd1f5('0x8'))(new Redis(config[_0xd1f5('0x9')]));function emit(_0x4e301f,_0x472652,_0xb8bb29){io['to'](_0x4e301f)[_0xd1f5('0xa')](_0x472652,_0xb8bb29);}var headers={'Content-Type':_0xd1f5('0xb'),'Accept':_0xd1f5('0xb')};function getTicket(_0x58a1fa,_0xb2426c,_0x1214de,_0x22a046,_0x4ccfd5){logger[_0xd1f5('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xd1f5('0xd')](_0xd1f5('0xe'),_0x58a1fa[_0xd1f5('0xf')]),'method':_0xd1f5('0x10'),'body':{'ticket':_[_0xd1f5('0x11')]({'requester_id':_0x1214de['id'],'submitter_id':_0xb2426c?_0xb2426c['id']:undefined,'assignee_id':_0xb2426c?_0xb2426c['id']:undefined,'tags':getTags(_0x22a046[_0xd1f5('0x12')],_0xd1f5('0x13')),'subject':intUtil[_0xd1f5('0x14')](_0x22a046[_0xd1f5('0x15')],_0x4ccfd5,'\x20'),'description':intUtil[_0xd1f5('0x14')](_0x22a046[_0xd1f5('0x16')],_0x4ccfd5,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd1f5('0x14')](_0x22a046[_0xd1f5('0x16')],_0x4ccfd5,'\x0a')}},getCustomFields(_0x22a046[_0xd1f5('0x17')],_0x4ccfd5))}})[_0xd1f5('0x18')](function(_0x378208){logger[_0xd1f5('0xc')](_0xd1f5('0x19'));return _0x378208['ticket'];});}function getUser(_0x3b15aa,_0x441273){if(intUtil[_0xd1f5('0x1a')](_0x441273)){logger[_0xd1f5('0xc')](_0xd1f5('0x1b'),_0x441273);return request({'uri':util['format']('%s/search.json',_0x3b15aa[_0xd1f5('0xf')]),'qs':{'query':util[_0xd1f5('0xd')]('type:user\x20role:agent\x20email:%s',_0x441273)}})[_0xd1f5('0x18')](function(_0x100002){if(_0x100002[_0xd1f5('0x1c')]){logger[_0xd1f5('0xc')](_0xd1f5('0x1d'));return _[_0xd1f5('0x1e')](_0x100002[_0xd1f5('0x1f')],{'email':_0x441273,'role':_0xd1f5('0x20')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd1f5('0xd')](_0xd1f5('0x21'),_0x3b15aa[_0xd1f5('0xf')])})[_0xd1f5('0x18')](function(_0x52ce3a){logger[_0xd1f5('0xc')](_0xd1f5('0x22'));return _0x52ce3a[_0xd1f5('0x23')];});}});}else{logger[_0xd1f5('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd1f5('0xd')](_0xd1f5('0x21'),_0x3b15aa[_0xd1f5('0xf')])})[_0xd1f5('0x18')](function(_0x5ce6fb){logger[_0xd1f5('0xc')](_0xd1f5('0x22'));return _0x5ce6fb[_0xd1f5('0x23')];});}}function getEndUser(_0x4c9c4b,_0x515a84,_0x20efc2){logger['info'](_0xd1f5('0x24'),_0x20efc2);return request({'uri':util[_0xd1f5('0xd')](_0xd1f5('0x25'),_0x4c9c4b['remoteUri']),'qs':{'query':util['format'](_0xd1f5('0x26'),_0x20efc2)}})['then'](function(_0x2c8589){var _0x2fb8b7;if(_0x2c8589[_0xd1f5('0x1f')]['length']){_0x2c8589['results']=_[_0xd1f5('0x27')](_0x2c8589[_0xd1f5('0x1f')],{'suspended':![],'role':_0xd1f5('0x28')});if(_0x2c8589[_0xd1f5('0x1f')][_0xd1f5('0x29')]){_0x2fb8b7=_['first'](_0x2c8589[_0xd1f5('0x1f')]);}}if(_0x2fb8b7){logger[_0xd1f5('0xc')](_0xd1f5('0x2a'));return _0x2fb8b7;}else{logger[_0xd1f5('0xc')](_0xd1f5('0x2b'));return request({'uri':util['format']('%s/users.json',_0x4c9c4b[_0xd1f5('0xf')]),'method':_0xd1f5('0x10'),'body':{'user':{'role':'end-user','name':util['format'](_0xd1f5('0x2c'),_0x515a84||_0x20efc2),'phone':_0x20efc2}}})[_0xd1f5('0x18')](function(_0x4e5d99){logger[_0xd1f5('0xc')]('Enduser\x20created.');return _0x4e5d99[_0xd1f5('0x23')];});}});}function getAuth(_0x175b7d){var _0x5bb53f;if(_0x175b7d[_0xd1f5('0x2d')]===_0xd1f5('0x2e')){_0x5bb53f=util[_0xd1f5('0xd')](_0xd1f5('0x2f'),_0x175b7d[_0xd1f5('0x30')],_0x175b7d['password']);}else if(_0x175b7d[_0xd1f5('0x2d')]==='token'){_0x5bb53f=util[_0xd1f5('0xd')](_0xd1f5('0x31'),_0x175b7d[_0xd1f5('0x30')],_0x175b7d[_0xd1f5('0x32')]);}return util[_0xd1f5('0xd')](_0xd1f5('0x33'),new Buffer(_0x5bb53f)[_0xd1f5('0x34')](_0xd1f5('0x35')));}function request(_0x17de38){logger[_0xd1f5('0x36')](_0xd1f5('0x37'),JSON[_0xd1f5('0x38')](_0x17de38));return rp(_[_0xd1f5('0x6')](_0x17de38,{'method':_0xd1f5('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x56f49d,_0x5a3b1c){var _0x454163=[];if(_0x56f49d&&_0x56f49d['length']>0x0){_0x454163=_[_0xd1f5('0x3a')](_0x56f49d,_0x5a3b1c);}return _0x454163;}function getCustomFields(_0x358abb,_0x46231e){var _0x5ee3ea=[];var _0x585a75={'custom_fields':[]};if(_0x358abb[_0xd1f5('0x29')]>0x0){_[_0xd1f5('0x3b')](_0x358abb,function(_0x3f3530){if(_['includes'](['string',_0xd1f5('0x3c')],_0x3f3530[_0xd1f5('0x3d')])&&_0x3f3530[_0xd1f5('0x3e')]&&!_0x3f3530[_0xd1f5('0x3f')]){_0x585a75[_0x3f3530[_0xd1f5('0x3e')]['toLowerCase']()]=_0x3f3530[_0xd1f5('0x40')]['toString']();}else if(_['includes']([_0xd1f5('0x41'),_0xd1f5('0x3c')],_0x3f3530[_0xd1f5('0x3d')])&&_0x3f3530[_0xd1f5('0x42')]&&_0x3f3530[_0xd1f5('0x3f')]){_0x585a75[_0xd1f5('0x43')][_0xd1f5('0x44')]({'id':_0x3f3530[_0xd1f5('0x42')],'value':_0x3f3530[_0xd1f5('0x40')][_0xd1f5('0x34')]()});}else if(_0x3f3530[_0xd1f5('0x3d')]===_0xd1f5('0x45')&&_0x3f3530[_0xd1f5('0x46')]&&_0x3f3530['idField']&&_0x3f3530[_0xd1f5('0x3f')]){_0x46231e[_0x3f3530[_0xd1f5('0x46')]]&&_0x585a75['custom_fields'][_0xd1f5('0x44')]({'id':_0x3f3530['idField'],'value':_0x46231e[_0x3f3530['variableName']][_0xd1f5('0x34')]()});}else if(_0x3f3530[_0xd1f5('0x3d')]===_0xd1f5('0x47')&&_0x3f3530[_0xd1f5('0x48')]&&_0x3f3530['Variable']['name']&&_0x3f3530[_0xd1f5('0x42')]&&_0x3f3530['customField']){_0x46231e[_0x3f3530[_0xd1f5('0x48')]['name'][_0xd1f5('0x49')]()]&&_0x585a75[_0xd1f5('0x43')][_0xd1f5('0x44')]({'id':_0x3f3530['idField'],'value':_0x46231e[_0x3f3530[_0xd1f5('0x48')][_0xd1f5('0x13')][_0xd1f5('0x49')]()][_0xd1f5('0x34')]()});}});}return _0x585a75;}exports[_0xd1f5('0x4a')]=function(_0x3dacf1,_0x24cba4,_0x3902e7,_0x18708b,_0x1bc78c,_0x4feaa3){var _0x5c9fcf,_0x4afdbc;_0x4feaa3['remoteUri']=intUtil['stripTrailingSlash'](_0x4feaa3[_0xd1f5('0xf')]);_0x4feaa3[_0xd1f5('0x4b')]=intUtil[_0xd1f5('0x4c')](_0x4feaa3[_0xd1f5('0x4b')]);if(_0x1bc78c&&_0x1bc78c[_0xd1f5('0x4d')]){logger[_0xd1f5('0xc')](_0xd1f5('0x4e'),_0xd1f5('0x4f'));_0x24cba4['recordingURL']=util[_0xd1f5('0xd')](_0xd1f5('0x50'),_0x4feaa3[_0xd1f5('0x4b')],_0x24cba4['uniqueid'],md5(_0x24cba4[_0xd1f5('0x51')]));}else{_0x24cba4[_0xd1f5('0x52')]='';}headers[_0xd1f5('0x53')]=getAuth(_0x4feaa3);return getUser(_0x4feaa3,_0x18708b[_0xd1f5('0x54')])[_0xd1f5('0x18')](function(_0x525215){_0x5c9fcf=_0x525215;logger[_0xd1f5('0xc')]('The\x20User\x20ID\x20is:',_0x5c9fcf['id']);return getEndUser(_0x4feaa3,_0x24cba4[_0xd1f5('0x55')],_0x24cba4[_0xd1f5('0x56')]);})[_0xd1f5('0x18')](function(_0x512cee){_0x4afdbc=_0x512cee;logger[_0xd1f5('0xc')](_0xd1f5('0x57'),_0x4afdbc['id']);return getTicket(_0x4feaa3,_0x5c9fcf,_0x4afdbc,_0x3902e7,_0x24cba4);})[_0xd1f5('0x18')](function(_0x130d88){if(_0x130d88){logger[_0xd1f5('0xc')](_0xd1f5('0x58'),_0x130d88['id']);switch(_0x4feaa3[_0xd1f5('0x3d')]){case'integrationTab':logger['info'](_0xd1f5('0x4e'),_0xd1f5('0x59'));return request({'uri':util[_0xd1f5('0xd')](_0xd1f5('0x5a'),_0x4feaa3[_0xd1f5('0xf')],_0x5c9fcf['id'],_0x130d88['id']),'method':_0xd1f5('0x10')});case _0xd1f5('0x5b'):logger[_0xd1f5('0xc')](_0xd1f5('0x4e'),_0xd1f5('0x5c'));emit(util[_0xd1f5('0xd')](_0xd1f5('0x5d'),_0x18708b[_0xd1f5('0x13')]),_0xd1f5('0x5e'),{'uri':util[_0xd1f5('0xd')](_0xd1f5('0x5f'),_0x4feaa3['remoteUri'][_0xd1f5('0x60')](_0xd1f5('0x61'),''),_0x130d88['id'])});break;default:logger[_0xd1f5('0x62')](_0xd1f5('0x4e'),_0xd1f5('0x63'));}}})[_0xd1f5('0x64')](function(_0x284826){logger['error'](_0xd1f5('0x65'),util[_0xd1f5('0x66')](_0x284826,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4fef6e,_0x5857ce,_0x31b3e9,_0x54dcab,_0x19e92a,_0x14adf1,_0x2f40c3){var _0x44d0c4,_0x3fcc49;_0x14adf1[_0xd1f5('0xf')]=intUtil[_0xd1f5('0x4c')](_0x14adf1['remoteUri']);_0x14adf1['serverUrl']=intUtil[_0xd1f5('0x4c')](_0x14adf1[_0xd1f5('0x4b')]);if(_0x2f40c3&&_0x2f40c3[_0xd1f5('0x67')]&&_0x2f40c3[_0xd1f5('0x67')]!=='none'){logger[_0xd1f5('0xc')](_0xd1f5('0x68'),_0xd1f5('0x4f'));_0x5857ce['recordingURL']=util['format'](_0xd1f5('0x50'),_0x14adf1[_0xd1f5('0x4b')],_0x5857ce['uniqueid'],md5(_0x5857ce['uniqueid']));}headers[_0xd1f5('0x53')]=getAuth(_0x14adf1);return getUser(_0x14adf1,_0x54dcab[_0xd1f5('0x54')])[_0xd1f5('0x18')](function(_0x93a32d){_0x44d0c4=_0x93a32d;logger[_0xd1f5('0xc')]('The\x20User\x20ID\x20is:',_0x44d0c4['id']);return getEndUser(_0x14adf1,_0x5857ce[_0xd1f5('0x69')],_0x5857ce[_0xd1f5('0x6a')]);})['then'](function(_0x35dfd2){_0x3fcc49=_0x35dfd2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3fcc49['id']);return getTicket(_0x14adf1,_0x44d0c4,_0x3fcc49,_0x31b3e9,_0x5857ce);})['then'](function(_0x536285){if(_0x536285){logger[_0xd1f5('0xc')](_0xd1f5('0x58'),_0x536285['id']);switch(_0x14adf1['type']){case _0xd1f5('0x6b'):logger[_0xd1f5('0xc')](_0xd1f5('0x68'),_0xd1f5('0x59'));return request({'uri':util[_0xd1f5('0xd')](_0xd1f5('0x5a'),_0x14adf1[_0xd1f5('0xf')],_0x44d0c4['id'],_0x536285['id']),'method':_0xd1f5('0x10')});case _0xd1f5('0x5b'):logger[_0xd1f5('0xc')](_0xd1f5('0x68'),_0xd1f5('0x5c'));emit(util[_0xd1f5('0xd')](_0xd1f5('0x5d'),_0x54dcab['name']),_0xd1f5('0x5e'),{'uri':util[_0xd1f5('0xd')](_0xd1f5('0x5f'),_0x14adf1[_0xd1f5('0xf')][_0xd1f5('0x60')](_0xd1f5('0x61'),''),_0x536285['id'])});break;default:logger[_0xd1f5('0x62')]('[OUTBOUND]',_0xd1f5('0x63'));}}})[_0xd1f5('0x64')](function(_0x295ad3){logger[_0xd1f5('0x62')](_0xd1f5('0x6c'),util[_0xd1f5('0x66')](_0x295ad3,{'showHidden':!![],'depth':null}));});};exports[_0xd1f5('0x6d')]=function(_0x55d970,_0x3b7b07,_0x77f777,_0x162046,_0x360f8a,_0x1d157c){var _0x3b65c2,_0x2d8eaf;_0x1d157c[_0xd1f5('0xf')]=intUtil['stripTrailingSlash'](_0x1d157c['remoteUri']);_0x1d157c[_0xd1f5('0x4b')]=intUtil[_0xd1f5('0x4c')](_0x1d157c[_0xd1f5('0x4b')]);if(_0x360f8a&&_0x360f8a['monitor_format']){logger[_0xd1f5('0xc')]('['+_0x3b7b07[_0xd1f5('0x6e')][_0xd1f5('0x6f')]()+']',_0xd1f5('0x4f'));_0x3b7b07['recordingURL']=util['format'](_0xd1f5('0x50'),_0x1d157c['serverUrl'],_0x3b7b07[_0xd1f5('0x51')],md5(_0x3b7b07[_0xd1f5('0x51')]));}else{_0x3b7b07[_0xd1f5('0x52')]='';}headers[_0xd1f5('0x53')]=getAuth(_0x1d157c);return getUser(_0x1d157c)[_0xd1f5('0x18')](function(_0xbc266d){_0x3b65c2=_0xbc266d;logger[_0xd1f5('0xc')](_0xd1f5('0x70'),_0x3b65c2['id']);return getEndUser(_0x1d157c,_0x3b7b07['calleridname'],_0x3b7b07[_0xd1f5('0x56')]);})[_0xd1f5('0x18')](function(_0x554e4e){_0x2d8eaf=_0x554e4e;logger[_0xd1f5('0xc')](_0xd1f5('0x57'),_0x2d8eaf['id']);return getTicket(_0x1d157c,_0x3b65c2,_0x2d8eaf,_0x77f777,_0x3b7b07);})['then'](function(_0x366197){if(_0x366197){logger[_0xd1f5('0xc')](_0xd1f5('0x58'),_0x366197['id']);}})[_0xd1f5('0x64')](function(_0x1ce26e){logger[_0xd1f5('0x62')]('['+_0x3b7b07[_0xd1f5('0x6e')][_0xd1f5('0x6f')]()+']'+_0xd1f5('0x71'),util[_0xd1f5('0x66')](_0x1ce26e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0cf3=['monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\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...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','count','Agent\x20found!','find','results','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','toString','base64','debug','stringify','map','forEach','string','type','customField','nameField','toLowerCase','content','includes','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl'];(function(_0x30aa4d,_0x2b360f){var _0x16fc87=function(_0x5c8565){while(--_0x5c8565){_0x30aa4d['push'](_0x30aa4d['shift']());}};_0x16fc87(++_0x2b360f);}(_0x0cf3,0x92));var _0x30cf=function(_0x5b22a9,_0x12bd66){_0x5b22a9=_0x5b22a9-0x0;var _0x3d48fe=_0x0cf3[_0x5b22a9];return _0x3d48fe;};'use strict';var _=require(_0x30cf('0x0'));var rp=require(_0x30cf('0x1'));var md5=require(_0x30cf('0x2'));var util=require(_0x30cf('0x3'));var Redis=require('ioredis');var intUtil=require(_0x30cf('0x4'));var config=require(_0x30cf('0x5'));var logger=require(_0x30cf('0x6'))('zendesk');config['redis']=_[_0x30cf('0x7')](config[_0x30cf('0x8')],{'host':_0x30cf('0x9'),'port':0x18eb});var io=require(_0x30cf('0xa'))(new Redis(config[_0x30cf('0x8')]));function emit(_0x35f9ed,_0x2ebd91,_0x2360b4){io['to'](_0x35f9ed)[_0x30cf('0xb')](_0x2ebd91,_0x2360b4);}var headers={'Content-Type':_0x30cf('0xc'),'Accept':_0x30cf('0xc')};function getTicket(_0x41c20f,_0x33d7f6,_0x2b0440,_0x3389dd,_0x21caf5){logger[_0x30cf('0xd')](_0x30cf('0xe'));return request({'uri':util[_0x30cf('0xf')](_0x30cf('0x10'),_0x41c20f[_0x30cf('0x11')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x2b0440['id'],'submitter_id':_0x33d7f6?_0x33d7f6['id']:undefined,'assignee_id':_0x33d7f6?_0x33d7f6['id']:undefined,'tags':getTags(_0x3389dd[_0x30cf('0x12')],_0x30cf('0x13')),'subject':intUtil[_0x30cf('0x14')](_0x3389dd[_0x30cf('0x15')],_0x21caf5,'\x20'),'description':intUtil['getString'](_0x3389dd['Descriptions'],_0x21caf5,'\x0a'),'comment':{'public':![],'body':intUtil[_0x30cf('0x14')](_0x3389dd[_0x30cf('0x16')],_0x21caf5,'\x0a')}},getCustomFields(_0x3389dd[_0x30cf('0x17')],_0x21caf5))}})[_0x30cf('0x18')](function(_0x2d9200){logger[_0x30cf('0xd')](_0x30cf('0x19'));return _0x2d9200[_0x30cf('0x1a')];});}function getUser(_0x59b5d2,_0x3c7d9b){if(intUtil[_0x30cf('0x1b')](_0x3c7d9b)){logger[_0x30cf('0xd')]('Getting\x20agent\x20with\x20email',_0x3c7d9b);return request({'uri':util[_0x30cf('0xf')]('%s/search.json',_0x59b5d2['remoteUri']),'qs':{'query':util[_0x30cf('0xf')]('type:user\x20role:agent\x20email:%s',_0x3c7d9b)}})[_0x30cf('0x18')](function(_0x5d6d34){if(_0x5d6d34[_0x30cf('0x1c')]){logger[_0x30cf('0xd')](_0x30cf('0x1d'));return _[_0x30cf('0x1e')](_0x5d6d34[_0x30cf('0x1f')],{'email':_0x3c7d9b,'role':'agent'});}else{logger[_0x30cf('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x30cf('0xf')](_0x30cf('0x20'),_0x59b5d2[_0x30cf('0x11')])})[_0x30cf('0x18')](function(_0xd5c25){logger[_0x30cf('0xd')](_0x30cf('0x21'));return _0xd5c25[_0x30cf('0x22')];});}});}else{logger[_0x30cf('0xd')](_0x30cf('0x23'));return request({'uri':util[_0x30cf('0xf')](_0x30cf('0x20'),_0x59b5d2[_0x30cf('0x11')])})['then'](function(_0x4be76e){logger['info'](_0x30cf('0x21'));return _0x4be76e[_0x30cf('0x22')];});}}function getEndUser(_0x10a779,_0x5cc272,_0x133f73){logger[_0x30cf('0xd')](_0x30cf('0x24'),_0x133f73);return request({'uri':util[_0x30cf('0xf')](_0x30cf('0x25'),_0x10a779[_0x30cf('0x11')]),'qs':{'query':util[_0x30cf('0xf')](_0x30cf('0x26'),_0x133f73)}})[_0x30cf('0x18')](function(_0x284982){var _0x3b0695;if(_0x284982[_0x30cf('0x1f')][_0x30cf('0x27')]){_0x284982[_0x30cf('0x1f')]=_['filter'](_0x284982[_0x30cf('0x1f')],{'suspended':![],'role':_0x30cf('0x28')});if(_0x284982['results']['length']){_0x3b0695=_['first'](_0x284982[_0x30cf('0x1f')]);}}if(_0x3b0695){logger[_0x30cf('0xd')]('Enduser\x20found!');return _0x3b0695;}else{logger[_0x30cf('0xd')](_0x30cf('0x29'));return request({'uri':util[_0x30cf('0xf')](_0x30cf('0x2a'),_0x10a779[_0x30cf('0x11')]),'method':_0x30cf('0x2b'),'body':{'user':{'role':_0x30cf('0x28'),'name':util[_0x30cf('0xf')]('Caller\x20-\x20%s',_0x5cc272||_0x133f73),'phone':_0x133f73}}})[_0x30cf('0x18')](function(_0x16ece2){logger['info'](_0x30cf('0x2c'));return _0x16ece2[_0x30cf('0x22')];});}});}function getAuth(_0x555048){var _0x5e87d6;if(_0x555048[_0x30cf('0x2d')]===_0x30cf('0x2e')){_0x5e87d6=util[_0x30cf('0xf')](_0x30cf('0x2f'),_0x555048['username'],_0x555048[_0x30cf('0x2e')]);}else if(_0x555048[_0x30cf('0x2d')]===_0x30cf('0x30')){_0x5e87d6=util[_0x30cf('0xf')](_0x30cf('0x31'),_0x555048[_0x30cf('0x32')],_0x555048['token']);}return util[_0x30cf('0xf')]('Basic\x20%s',new Buffer(_0x5e87d6)[_0x30cf('0x33')](_0x30cf('0x34')));}function request(_0x7e0518){logger[_0x30cf('0x35')]('[HTTP]',JSON[_0x30cf('0x36')](_0x7e0518));return rp(_[_0x30cf('0x7')](_0x7e0518,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x432756,_0x1b1037){var _0x1496eb=[];if(_0x432756&&_0x432756[_0x30cf('0x27')]>0x0){_0x1496eb=_[_0x30cf('0x37')](_0x432756,_0x1b1037);}return _0x1496eb;}function getCustomFields(_0x278311,_0x5b7982){var _0x3b2922=[];var _0x33ffa5={'custom_fields':[]};if(_0x278311['length']>0x0){_[_0x30cf('0x38')](_0x278311,function(_0x2caaa7){if(_['includes']([_0x30cf('0x39'),'picklist'],_0x2caaa7[_0x30cf('0x3a')])&&_0x2caaa7['nameField']&&!_0x2caaa7[_0x30cf('0x3b')]){_0x33ffa5[_0x2caaa7[_0x30cf('0x3c')][_0x30cf('0x3d')]()]=_0x2caaa7[_0x30cf('0x3e')][_0x30cf('0x33')]();}else if(_[_0x30cf('0x3f')](['string','picklist'],_0x2caaa7['type'])&&_0x2caaa7[_0x30cf('0x40')]&&_0x2caaa7['customField']){_0x33ffa5[_0x30cf('0x41')][_0x30cf('0x42')]({'id':_0x2caaa7[_0x30cf('0x40')],'value':_0x2caaa7[_0x30cf('0x3e')][_0x30cf('0x33')]()});}else if(_0x2caaa7[_0x30cf('0x3a')]===_0x30cf('0x43')&&_0x2caaa7[_0x30cf('0x44')]&&_0x2caaa7[_0x30cf('0x40')]&&_0x2caaa7[_0x30cf('0x3b')]){_0x5b7982[_0x2caaa7[_0x30cf('0x44')]]&&_0x33ffa5[_0x30cf('0x41')]['push']({'id':_0x2caaa7[_0x30cf('0x40')],'value':_0x5b7982[_0x2caaa7[_0x30cf('0x44')]][_0x30cf('0x33')]()});}else if(_0x2caaa7[_0x30cf('0x3a')]===_0x30cf('0x45')&&_0x2caaa7[_0x30cf('0x46')]&&_0x2caaa7['Variable'][_0x30cf('0x13')]&&_0x2caaa7[_0x30cf('0x40')]&&_0x2caaa7['customField']){_0x5b7982[_0x2caaa7['Variable']['name']['toLowerCase']()]&&_0x33ffa5['custom_fields']['push']({'id':_0x2caaa7[_0x30cf('0x40')],'value':_0x5b7982[_0x2caaa7[_0x30cf('0x46')][_0x30cf('0x13')][_0x30cf('0x3d')]()]['toString']()});}});}return _0x33ffa5;}exports[_0x30cf('0x47')]=function(_0x119486,_0x5a6a24,_0x5053e7,_0x1181fc,_0x4b085e,_0x61379a){var _0x159f2d,_0x113745;_0x61379a[_0x30cf('0x11')]=intUtil[_0x30cf('0x48')](_0x61379a[_0x30cf('0x11')]);_0x61379a[_0x30cf('0x49')]=intUtil[_0x30cf('0x48')](_0x61379a[_0x30cf('0x49')]);if(_0x4b085e&&_0x4b085e[_0x30cf('0x4a')]){logger['info']('[QUEUE]',_0x30cf('0x4b'));_0x5a6a24[_0x30cf('0x4c')]=util[_0x30cf('0xf')](_0x30cf('0x4d'),_0x61379a[_0x30cf('0x49')],_0x5a6a24[_0x30cf('0x4e')],md5(_0x5a6a24[_0x30cf('0x4e')]));}else{_0x5a6a24['recordingURL']='';}headers[_0x30cf('0x4f')]=getAuth(_0x61379a);return getUser(_0x61379a,_0x1181fc['email'])[_0x30cf('0x18')](function(_0x56c35c){_0x159f2d=_0x56c35c;logger['info'](_0x30cf('0x50'),_0x159f2d['id']);return getEndUser(_0x61379a,_0x5a6a24[_0x30cf('0x51')],_0x5a6a24[_0x30cf('0x52')]);})['then'](function(_0x585665){_0x113745=_0x585665;logger['info'](_0x30cf('0x53'),_0x113745['id']);return getTicket(_0x61379a,_0x159f2d,_0x113745,_0x5053e7,_0x5a6a24);})[_0x30cf('0x18')](function(_0x495fa0){if(_0x495fa0){logger['info']('The\x20Ticket\x20ID\x20is:',_0x495fa0['id']);switch(_0x61379a[_0x30cf('0x3a')]){case _0x30cf('0x54'):logger[_0x30cf('0xd')](_0x30cf('0x55'),_0x30cf('0x56'));return request({'uri':util['format'](_0x30cf('0x57'),_0x61379a['remoteUri'],_0x159f2d['id'],_0x495fa0['id']),'method':'POST'});case _0x30cf('0x58'):logger['info'](_0x30cf('0x55'),_0x30cf('0x59'));emit(util['format'](_0x30cf('0x5a'),_0x1181fc[_0x30cf('0x13')]),_0x30cf('0x5b'),{'uri':util['format'](_0x30cf('0x5c'),_0x61379a[_0x30cf('0x11')]['replace'](_0x30cf('0x5d'),''),_0x495fa0['id'])});break;default:logger['error'](_0x30cf('0x55'),_0x30cf('0x5e'));}}})['catch'](function(_0x31d08d){logger[_0x30cf('0x5f')](_0x30cf('0x60'),util[_0x30cf('0x61')](_0x31d08d,{'showHidden':!![],'depth':null}));});};exports[_0x30cf('0x62')]=function(_0x4ed4b3,_0x58826b,_0xaad326,_0x286384,_0x332689,_0x391976,_0x55a59b){var _0xe0dc3e,_0x9b455f;_0x391976[_0x30cf('0x11')]=intUtil[_0x30cf('0x48')](_0x391976[_0x30cf('0x11')]);_0x391976['serverUrl']=intUtil[_0x30cf('0x48')](_0x391976[_0x30cf('0x49')]);if(_0x55a59b&&_0x55a59b[_0x30cf('0x63')]&&_0x55a59b[_0x30cf('0x63')]!=='none'){logger[_0x30cf('0xd')](_0x30cf('0x64'),_0x30cf('0x4b'));_0x58826b[_0x30cf('0x4c')]=util[_0x30cf('0xf')](_0x30cf('0x4d'),_0x391976[_0x30cf('0x49')],_0x58826b[_0x30cf('0x4e')],md5(_0x58826b[_0x30cf('0x4e')]));}headers[_0x30cf('0x4f')]=getAuth(_0x391976);return getUser(_0x391976,_0x286384[_0x30cf('0x65')])[_0x30cf('0x18')](function(_0x2ad2e1){_0xe0dc3e=_0x2ad2e1;logger[_0x30cf('0xd')](_0x30cf('0x50'),_0xe0dc3e['id']);return getEndUser(_0x391976,_0x58826b[_0x30cf('0x66')],_0x58826b[_0x30cf('0x67')]);})[_0x30cf('0x18')](function(_0x5a3b6c){_0x9b455f=_0x5a3b6c;logger[_0x30cf('0xd')](_0x30cf('0x53'),_0x9b455f['id']);return getTicket(_0x391976,_0xe0dc3e,_0x9b455f,_0xaad326,_0x58826b);})[_0x30cf('0x18')](function(_0x1e60c9){if(_0x1e60c9){logger[_0x30cf('0xd')](_0x30cf('0x68'),_0x1e60c9['id']);switch(_0x391976[_0x30cf('0x3a')]){case _0x30cf('0x54'):logger[_0x30cf('0xd')](_0x30cf('0x64'),_0x30cf('0x56'));return request({'uri':util[_0x30cf('0xf')](_0x30cf('0x57'),_0x391976[_0x30cf('0x11')],_0xe0dc3e['id'],_0x1e60c9['id']),'method':_0x30cf('0x2b')});case _0x30cf('0x58'):logger[_0x30cf('0xd')](_0x30cf('0x64'),_0x30cf('0x59'));emit(util[_0x30cf('0xf')](_0x30cf('0x5a'),_0x286384[_0x30cf('0x13')]),_0x30cf('0x5b'),{'uri':util[_0x30cf('0xf')](_0x30cf('0x5c'),_0x391976[_0x30cf('0x11')]['replace'](_0x30cf('0x5d'),''),_0x1e60c9['id'])});break;default:logger['error'](_0x30cf('0x64'),_0x30cf('0x5e'));}}})[_0x30cf('0x69')](function(_0x2409e0){logger[_0x30cf('0x5f')](_0x30cf('0x6a'),util[_0x30cf('0x61')](_0x2409e0,{'showHidden':!![],'depth':null}));});};exports[_0x30cf('0x6b')]=function(_0x17ddea,_0x7824c5,_0x41e8d0,_0x508195,_0x54b67d,_0x1d9bdb){var _0x219e03,_0x22d35e;_0x1d9bdb[_0x30cf('0x11')]=intUtil['stripTrailingSlash'](_0x1d9bdb[_0x30cf('0x11')]);_0x1d9bdb[_0x30cf('0x49')]=intUtil['stripTrailingSlash'](_0x1d9bdb[_0x30cf('0x49')]);if(_0x54b67d&&_0x54b67d[_0x30cf('0x4a')]){logger['info']('['+_0x7824c5['lastevent'][_0x30cf('0x6c')]()+']',_0x30cf('0x4b'));_0x7824c5[_0x30cf('0x4c')]=util[_0x30cf('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d9bdb[_0x30cf('0x49')],_0x7824c5['uniqueid'],md5(_0x7824c5['uniqueid']));}else{_0x7824c5[_0x30cf('0x4c')]='';}headers[_0x30cf('0x4f')]=getAuth(_0x1d9bdb);return getUser(_0x1d9bdb)['then'](function(_0x382c21){_0x219e03=_0x382c21;logger[_0x30cf('0xd')](_0x30cf('0x50'),_0x219e03['id']);return getEndUser(_0x1d9bdb,_0x7824c5[_0x30cf('0x51')],_0x7824c5['calleridnum']);})[_0x30cf('0x18')](function(_0x28c281){_0x22d35e=_0x28c281;logger[_0x30cf('0xd')](_0x30cf('0x53'),_0x22d35e['id']);return getTicket(_0x1d9bdb,_0x219e03,_0x22d35e,_0x41e8d0,_0x7824c5);})[_0x30cf('0x18')](function(_0x3d3285){if(_0x3d3285){logger['info'](_0x30cf('0x68'),_0x3d3285['id']);}})[_0x30cf('0x69')](function(_0x1dffdb){logger[_0x30cf('0x5f')]('['+_0x7824c5['lastevent'][_0x30cf('0x6c')]()+']'+_0x30cf('0x6d'),util['inspect'](_0x1dffdb,{'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 4e6609c..e24a153 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 _0x1beb=['com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','calleridnum','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','string','picklist','type','idField','content','variable','variableName','toString','Variable','toLowerCase','name','indexOf','split','isNil','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','refresh_token','then','seconds','access_token','catch','Failing\x20creating\x20the\x20access_token','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','data','code','SUCCESS','details','moduleCreate','log','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','Leads','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','abandoned','timeout','Call_Start_Time','agentcalledAt','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','stack','queue','stripTrailingSlash','host','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','zoho.eu'];(function(_0x47f2e2,_0x4a81b1){var _0x1e2010=function(_0x36eae2){while(--_0x36eae2){_0x47f2e2['push'](_0x47f2e2['shift']());}};_0x1e2010(++_0x4a81b1);}(_0x1beb,0x1d2));var _0xb1be=function(_0x43cf32,_0x2481c0){_0x43cf32=_0x43cf32-0x0;var _0x2dc67a=_0x1beb[_0x43cf32];return _0x2dc67a;};'use strict';var _=require(_0xb1be('0x0'));var rp=require(_0xb1be('0x1'));var md5=require(_0xb1be('0x2'));var util=require('util');var intUtil=require(_0xb1be('0x3'));var moment=require(_0xb1be('0x4'));var Redis=require(_0xb1be('0x5'));var BPromise=require(_0xb1be('0x6'));var config=require(_0xb1be('0x7'));var logger=require(_0xb1be('0x8'))('zoho');config[_0xb1be('0x9')]=_['defaults'](config['redis'],{'host':_0xb1be('0xa'),'port':0x18eb});var io=require(_0xb1be('0xb'))(new Redis(config[_0xb1be('0x9')]));function emit(_0x1fe54b,_0x2caa4d,_0x3c6d2b){io['to'](_0x1fe54b)[_0xb1be('0xc')](_0x2caa4d,_0x3c6d2b);}function request(_0x2ef033){logger[_0xb1be('0xd')](_0xb1be('0xe'),JSON[_0xb1be('0xf')](_0x2ef033));return rp(_0x2ef033);}function getCustomFields(_0x3fa95a,_0x1956d6){var _0x546c0e={};if(_0x3fa95a[_0xb1be('0x10')]>0x0){_['forEach'](_0x3fa95a,function(_0x478dc7){if(_[_0xb1be('0x11')]([_0xb1be('0x12'),_0xb1be('0x13')],_0x478dc7[_0xb1be('0x14')])&&_0x478dc7[_0xb1be('0x15')]){_0x546c0e[_0x478dc7[_0xb1be('0x15')]]=_0x478dc7[_0xb1be('0x16')]['toString']();}else if(_0x478dc7[_0xb1be('0x14')]===_0xb1be('0x17')&&_0x478dc7[_0xb1be('0x18')]&&_0x478dc7['idField']&&_0x1956d6[_0x478dc7[_0xb1be('0x18')]]){_0x546c0e[_0x478dc7[_0xb1be('0x15')]]=_0x1956d6[_0x478dc7['variableName']][_0xb1be('0x19')]();}else if(_0x478dc7['type']==='customVariable'&&_0x478dc7[_0xb1be('0x1a')]&&_0x478dc7[_0xb1be('0x1a')]['name']&&_0x478dc7[_0xb1be('0x15')]&&_0x1956d6[_0x478dc7['Variable']['name'][_0xb1be('0x1b')]()]){_0x546c0e[_0x478dc7[_0xb1be('0x15')]]=_0x1956d6[_0x478dc7[_0xb1be('0x1a')][_0xb1be('0x1c')][_0xb1be('0x1b')]()][_0xb1be('0x19')]();}});}return _0x546c0e;}function getName(_0x171a00){if(_0x171a00[_0xb1be('0x1d')]('\x20')>0x0){var _0x1c0cad=_0x171a00[_0xb1be('0x1e')](/ (.+)/);if(_0x1c0cad[0x1]){return _0x1c0cad;}}return[_0x171a00,_0x171a00];}var accountsTokens={};function getAccessToken(_0x48647b){return new Promise(function(_0x4a6d83,_0x189b07){if(!_[_0xb1be('0x1f')](accountsTokens[_0x48647b['id']])&&!_[_0xb1be('0x1f')](accountsTokens[_0x48647b['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x48647b['id']][_0xb1be('0x20')])){_0x4a6d83(accountsTokens[_0x48647b['id']]['access_token']);}}var _0x342c83;switch(_0x48647b[_0xb1be('0x21')]){case'US':_0x342c83=_0xb1be('0x22');break;case'AU':_0x342c83=_0xb1be('0x23');break;case'EU':_0x342c83=_0xb1be('0x24');break;case'IN':_0x342c83='https://accounts.zoho.in';break;case'CN':_0x342c83=_0xb1be('0x25');break;default:_0x342c83=_0xb1be('0x24');break;}var _0x306e40={'method':'POST','uri':_0x342c83+_0xb1be('0x26'),'qs':{'refresh_token':_0x48647b['refreshToken'],'client_id':_0x48647b[_0xb1be('0x27')],'client_secret':_0x48647b['clientSecret'],'grant_type':_0xb1be('0x28')},'json':!![]};return rp(_0x306e40)[_0xb1be('0x29')](function(_0xc0e635){accountsTokens[_0x48647b['id']]={'access_token':_0xc0e635['access_token'],'expires_in':moment()['add'](_0xc0e635[_0xb1be('0x20')],_0xb1be('0x2a'))};_0x4a6d83(_0xc0e635[_0xb1be('0x2b')]);})[_0xb1be('0x2c')](function(_0x373425){logger['error'](_0xb1be('0x2d'),_0x373425['stack']);_0x189b07(_0x373425);});});}function getUser(_0x5ec60a,_0x1442b5,_0x1cb73a,_0x40d8ed){logger['info']('Search\x20user');return request({'method':_0xb1be('0x2e'),'uri':util[_0xb1be('0x2f')](_0xb1be('0x30'),_0x1442b5),'qs':{'type':_0xb1be('0x31')},'headers':{'Authorization':_0xb1be('0x32')+_0x5ec60a},'json':!![]})[_0xb1be('0x29')](function(_0x28ca35){if(_0x28ca35[_0xb1be('0x33')]){var _0x38ab5a=-0x1;if(_[_0xb1be('0x34')](_0x28ca35[_0xb1be('0x33')])){if(!_[_0xb1be('0x1f')](_0x40d8ed)){_0x38ab5a=_[_0xb1be('0x35')](_0x28ca35[_0xb1be('0x33')],function(_0x4a9942){return _0x4a9942['email']===_0x40d8ed;});}if(_0x38ab5a>=0x0){logger[_0xb1be('0x36')](_0xb1be('0x37'));}else{logger[_0xb1be('0x36')](_0xb1be('0x38'));_0x38ab5a=_[_0xb1be('0x35')](_0x28ca35[_0xb1be('0x33')],function(_0x46862b){return _0x46862b[_0xb1be('0x39')][_0xb1be('0x1c')]===_0xb1be('0x3a');});}return _0x28ca35['users'][_0x38ab5a];}else{if(_0x28ca35[_0xb1be('0x3b')][_0xb1be('0x39')]['name']==='Administrator'){logger['info']('Using\x20the\x20admin\x20account!');user=_0x28ca35[_0xb1be('0x3b')];return user;}else{logger[_0xb1be('0x3c')]('The\x20failing\x20result\x20is',JSON[_0xb1be('0xf')](_0x28ca35));throw new Error(_0xb1be('0x3d')+JSON[_0xb1be('0xf')](_0x28ca35));}}}else{logger[_0xb1be('0x3c')](_0xb1be('0x3e'),JSON[_0xb1be('0xf')](_0x28ca35));throw new Error(_0xb1be('0x3d')+JSON[_0xb1be('0xf')](_0x28ca35));}})[_0xb1be('0x2c')](function(_0x1f6a62){console[_0xb1be('0x3c')](_0x1f6a62);});}function getZohoUser(_0xaea0c7,_0x273aab){return new BPromise(function(_0x556983,_0x2532b1){request(_0xaea0c7)[_0xb1be('0x29')](function(_0x592e92){var _0x52998e=null;if(_0x592e92){_0x52998e=_0x592e92['data'][0x0];_0x52998e[_0xb1be('0x3f')]=_0x273aab;}_0x556983(_0x52998e);})[_0xb1be('0x2c')](function(_0x42eb37){_0x2532b1(_0x42eb37);});});}function createEndUser(_0x1e097e,_0x54b26a,_0x58168c,_0x3a5fc1,_0x578b93,_0x597416){var _0x58168c=getName(_0x58168c);return request({'method':_0xb1be('0x40'),'uri':_0xb1be('0x41')+_0x54b26a+_0xb1be('0x42')+_[_0xb1be('0x43')](_0x597416['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x58168c[0x1],'First_Name':_0x58168c[0x0],'Phone':_0x3a5fc1,'Owner':{'name':!_[_0xb1be('0x1f')](_0x578b93[_0xb1be('0x44')][_0xb1be('0x1c')])?_0x578b93[_0xb1be('0x44')][_0xb1be('0x1c')]:!_['isNil'](_0x578b93[_0xb1be('0x45')])?_0x578b93['first_name']+'\x20'+_0x578b93['last_name']:_0x578b93[_0xb1be('0x46')],'id':_0x578b93['id']}}]},'headers':{'Authorization':_0xb1be('0x32')+_0x1e097e},'json':!![]})[_0xb1be('0x29')](function(_0x53722e){if(_0x53722e&&_0x53722e[_0xb1be('0x47')][0x0][_0xb1be('0x48')]===_0xb1be('0x49')){var _0x269117=_0x53722e[_0xb1be('0x47')][0x0][_0xb1be('0x4a')];_0x269117['enduserType']=_[_0xb1be('0x43')](_0x597416[_0xb1be('0x4b')])+'s';return _0x269117;}logger['error'](_0xb1be('0x3e'),JSON[_0xb1be('0xf')](data));throw new Error('Error:\x20'+JSON[_0xb1be('0xf')](data));})[_0xb1be('0x2c')](function(_0x5ce324){console[_0xb1be('0x4c')]('CREATE\x20ERROR',_0x5ce324);});}function getEndUser(_0x2bef55,_0x218f18,_0x1e00e4,_0x534e08,_0x312679,_0x510a3a,_0x53b03b){var _0x2bb558={'method':'GET','uri':'','headers':{'Authorization':_0xb1be('0x32')+_0x2bef55},'json':!![]};switch(_0x53b03b['moduleSearch']){case'contact_lead':_0x2bb558[_0xb1be('0x4d')]='https://www.zohoapis.'+_0x218f18+_0xb1be('0x4e')+_0x312679+'))';return getZohoUser(_0x2bb558,_0xb1be('0x4f'))[_0xb1be('0x29')](function(_0x5b69cf){if(_0x5b69cf)return _0x5b69cf;_0x2bb558[_0xb1be('0x4d')]=_0xb1be('0x41')+_0x218f18+_0xb1be('0x50')+_0x312679+'))';return getZohoUser(_0x2bb558,'Leads')['then'](function(_0x540d49){if(_0x540d49)return _0x540d49;if(_0x53b03b[_0xb1be('0x4b')]!='nothing'){return createEndUser(_0x2bef55,_0x218f18,_0x534e08,_0x312679,_0x510a3a,_0x53b03b);}else{return{};}});});break;case'contact':_0x2bb558[_0xb1be('0x4d')]=_0xb1be('0x41')+_0x218f18+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x312679+'))';return getZohoUser(_0x2bb558,_0xb1be('0x4f'))[_0xb1be('0x29')](function(_0x251cd0){if(_0x251cd0)return _0x251cd0;if(_0x53b03b[_0xb1be('0x4b')]!=_0xb1be('0x51')){return createEndUser(_0x2bef55,_0x218f18,_0x534e08,_0x312679,_0x510a3a,_0x53b03b);}else{return{};}});break;case'lead':_0x2bb558[_0xb1be('0x4d')]=_0xb1be('0x41')+_0x218f18+_0xb1be('0x50')+_0x312679+'))';return getZohoUser(_0x2bb558,_0xb1be('0x52'))[_0xb1be('0x29')](function(_0x34ad0b){if(_0x34ad0b)return _0x34ad0b;if(_0x53b03b[_0xb1be('0x4b')]!=_0xb1be('0x51')){return createEndUser(_0x2bef55,_0x218f18,_0x534e08,_0x312679,_0x510a3a,_0x53b03b);}else{return{};}});break;}}function getCall(_0x4f7b47,_0x2c6566,_0x5a88af,_0x39d109,_0x24c9ae,_0x43213b,_0x6d9aa0,_0x14a872){logger[_0xb1be('0x36')](_0xb1be('0x53'));var _0x4d876e={};_0x4d876e['Owner']={'name':!_[_0xb1be('0x1f')](_0x39d109[_0xb1be('0x44')]['name'])&&!_['isNil'](_0x39d109[_0xb1be('0x39')][_0xb1be('0x1c')])&&_0x39d109[_0xb1be('0x39')][_0xb1be('0x1c')]===_0xb1be('0x54')?_0x39d109[_0xb1be('0x44')][_0xb1be('0x1c')]:!_[_0xb1be('0x1f')](_0x39d109[_0xb1be('0x45')])?_0x39d109[_0xb1be('0x45')]+'\x20'+_0x39d109[_0xb1be('0x46')]:_0x39d109[_0xb1be('0x46')],'id':_0x39d109['id']};_0x4d876e[_0xb1be('0x55')]=intUtil[_0xb1be('0x56')](_0x43213b[_0xb1be('0x57')],_0x6d9aa0,'\x20');_0x4d876e[_0xb1be('0x58')]=intUtil['getString'](_0x43213b[_0xb1be('0x59')],_0x6d9aa0,'\x0a');if(_0x24c9ae['enduserType']===_0xb1be('0x4f')){_0x4d876e['Who_Id']={'name':!_['isNil'](_0x24c9ae[_0xb1be('0x5a')])?_0x24c9ae[_0xb1be('0x5a')]:!_[_0xb1be('0x1f')](_0x24c9ae[_0xb1be('0x5b')])?_0x24c9ae[_0xb1be('0x5b')]+'\x20'+_0x24c9ae['Last_Name']:_0x24c9ae[_0xb1be('0x5c')],'id':_0x24c9ae['id']};}if(_0x24c9ae[_0xb1be('0x3f')]===_0xb1be('0x52')){_0x4d876e['What_Id']={'name':!_[_0xb1be('0x1f')](_0x24c9ae[_0xb1be('0x5a')])?_0x24c9ae[_0xb1be('0x5a')]:!_[_0xb1be('0x1f')](_0x24c9ae[_0xb1be('0x5b')])?_0x24c9ae[_0xb1be('0x5b')]+'\x20'+_0x24c9ae[_0xb1be('0x5c')]:_0x24c9ae['Last_Name'],'id':_0x24c9ae['id']};_0x4d876e[_0xb1be('0x5d')]=_[_0xb1be('0x43')](_0x24c9ae[_0xb1be('0x3f')]);}if(_0x6d9aa0[_0xb1be('0x5e')]){_0x4d876e[_0xb1be('0x5f')]=moment[_0xb1be('0x60')](parseInt(_0x6d9aa0[_0xb1be('0x5e')])*0x3e8)[_0xb1be('0x2f')]('mm:ss');}else if(_0x6d9aa0[_0xb1be('0x61')]&&_0x6d9aa0[_0xb1be('0x62')]){_0x4d876e[_0xb1be('0x5f')]=moment['utc'](moment(_0x6d9aa0[_0xb1be('0x62')],'YYYY-MM-DDTHH:mm:ss')[_0xb1be('0x63')](moment(_0x6d9aa0[_0xb1be('0x64')],_0xb1be('0x65'))))[_0xb1be('0x2f')]('mm:ss');}switch(_0x6d9aa0[_0xb1be('0x66')]){case _0xb1be('0x67'):_0x4d876e[_0xb1be('0x68')]=_0xb1be('0x69');break;case _0xb1be('0x6a'):case _0xb1be('0x6b'):_0x4d876e[_0xb1be('0x68')]=_0xb1be('0x6c');break;case _0xb1be('0x6d'):_0x4d876e[_0xb1be('0x68')]='Rejected';break;case _0xb1be('0x6e'):_0x4d876e[_0xb1be('0x68')]='Abandoned';break;case _0xb1be('0x6f'):_0x4d876e[_0xb1be('0x68')]='Timeout';default:}_0x4d876e[_0xb1be('0x70')]=(_0x14a872==='outbound'?moment(_0x6d9aa0[_0xb1be('0x64')])['format'](_0xb1be('0x65')):moment(_0x6d9aa0[_0xb1be('0x71')])[_0xb1be('0x2f')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x4d876e['Call_Type']=_0x14a872||_0xb1be('0x72');_0x4d876e=_['merge'](_0x4d876e,getCustomFields(_0x43213b[_0xb1be('0x73')],_0x6d9aa0));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x2c6566+_0xb1be('0x74'),'headers':{'Authorization':_0xb1be('0x32')+_0x4f7b47},'body':{'data':[_0x4d876e]},'json':!![]})['then'](function(_0xea9659){if(_0xea9659&&_0xea9659[_0xb1be('0x47')][0x0][_0xb1be('0x48')]==='SUCCESS'){logger[_0xb1be('0x36')](_0xb1be('0x75'));return{'id':_0xea9659['data'][0x0][_0xb1be('0x4a')]['id']};}})['catch'](function(_0x4ea526){logger[_0xb1be('0x36')](_0xb1be('0x76'),_0x4ea526[_0xb1be('0x77')]);console[_0xb1be('0x4c')](_0xb1be('0x76'),_0x4ea526);});}exports[_0xb1be('0x78')]=function(_0x5726a8,_0x4f2f3f,_0x479826,_0x59e5bd,_0xd1485e,_0x4217aa){var _0x19b8b2,_0x5bcef2,_0x304610;_0x4217aa['host']=intUtil[_0xb1be('0x79')](_0x4217aa[_0xb1be('0x7a')]);_0x4217aa[_0xb1be('0x7b')]=intUtil[_0xb1be('0x79')](_0x4217aa[_0xb1be('0x7b')]);if(_0xd1485e&&_0xd1485e['monitor_format']){logger[_0xb1be('0x36')](_0xb1be('0x7c'),_0xb1be('0x7d'));_0x4f2f3f[_0xb1be('0x7e')]=_0x4217aa[_0xb1be('0x7b')]+'/api/voice/recordings/'+_0x4f2f3f['uniqueid']+_0xb1be('0x7f')+md5(_0x4f2f3f[_0xb1be('0x80')]);}else{_0x4f2f3f[_0xb1be('0x7e')]='';}var _0x4b098e=_0x4217aa[_0xb1be('0x7a')]===_0xb1be('0x81')?'eu':_0xb1be('0x82');return getAccessToken(_0x4217aa)[_0xb1be('0x29')](function(_0x4a6e8a){_0x304610=_0x4a6e8a;return getUser(_0x304610,_0x4b098e,_0x4217aa,_0x59e5bd[_0xb1be('0x83')]);})[_0xb1be('0x29')](function(_0x4fa166){_0x19b8b2=_0x4fa166;logger[_0xb1be('0x36')](_0xb1be('0x84'),_0x19b8b2['id']);return getEndUser(_0x304610,_0x4b098e,_0x4217aa,_0x4f2f3f[_0xb1be('0x85')],_0x4f2f3f['calleridnum'],_0x19b8b2,_0x479826);})[_0xb1be('0x29')](function(_0x231b56){_0x5bcef2=_0x231b56;return getCall(_0x304610,_0x4b098e,_0x4217aa,_0x19b8b2,_0x5bcef2,_0x479826,_0x4f2f3f,_0xb1be('0x72'));})[_0xb1be('0x29')](function(_0x44a392){if(_0x44a392){logger[_0xb1be('0x36')](_0xb1be('0x86'),_0x44a392['id']);logger[_0xb1be('0x36')](_0xb1be('0x7c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb1be('0x87'),_0x59e5bd[_0xb1be('0x1c')]),'trigger:browser:url',{'uri':_0xb1be('0x88')+_0x4217aa[_0xb1be('0x7a')]+_0xb1be('0x89')+_0x44a392['id']});}})['catch'](function(_0x217b91){logger[_0xb1be('0x3c')]('[QUEUE]',JSON[_0xb1be('0xf')](_0x217b91));});};exports['outbound']=function(_0x1e5a7a,_0x491cbb,_0x23d356,_0x5deccd,_0x37fa90,_0x46deea,_0x34a8a4){var _0x2c1381,_0x51d33f,_0x25e0b3;_0x46deea[_0xb1be('0x7a')]=intUtil[_0xb1be('0x79')](_0x46deea['host']);_0x46deea[_0xb1be('0x7b')]=intUtil[_0xb1be('0x79')](_0x46deea[_0xb1be('0x7b')]);if(_0x34a8a4&&_0x34a8a4[_0xb1be('0x8a')]&&_0x34a8a4[_0xb1be('0x8a')]!=='none'){logger[_0xb1be('0x36')](_0xb1be('0x8b'),_0xb1be('0x7d'));_0x491cbb[_0xb1be('0x7e')]=_0x46deea[_0xb1be('0x7b')]+_0xb1be('0x8c')+_0x491cbb[_0xb1be('0x80')]+_0xb1be('0x7f')+md5(_0x491cbb[_0xb1be('0x80')]);}var _0x2a113=_0x46deea['host']===_0xb1be('0x81')?'eu':_0xb1be('0x82');return getAccessToken(_0x46deea)[_0xb1be('0x29')](function(_0x405083){_0x25e0b3=_0x405083;return getUser(_0x25e0b3,_0x2a113,_0x46deea,_0x5deccd[_0xb1be('0x83')]);})[_0xb1be('0x29')](function(_0x201605){_0x2c1381=_0x201605;logger[_0xb1be('0x36')](_0xb1be('0x84'),_0x2c1381['id']);return getEndUser(_0x25e0b3,_0x2a113,_0x46deea,_0x491cbb[_0xb1be('0x8d')],_0x491cbb[_0xb1be('0x8e')],_0x2c1381,_0x23d356);})[_0xb1be('0x29')](function(_0x809443){_0x51d33f=_0x809443;return getCall(_0x25e0b3,_0x2a113,_0x46deea,_0x2c1381,_0x51d33f,_0x23d356,_0x491cbb,_0xb1be('0x8f'));})[_0xb1be('0x29')](function(_0x41e64e){if(_0x41e64e){logger['info'](_0xb1be('0x86'),_0x41e64e['id']);logger[_0xb1be('0x36')](_0xb1be('0x8b'),_0xb1be('0x90'));emit(util['format'](_0xb1be('0x87'),_0x5deccd[_0xb1be('0x1c')]),_0xb1be('0x91'),{'uri':_0xb1be('0x88')+_0x46deea[_0xb1be('0x7a')]+_0xb1be('0x89')+_0x41e64e['id']});}})[_0xb1be('0x2c')](function(_0x2e4646){logger['error'](_0xb1be('0x8b'),JSON[_0xb1be('0xf')](_0x2e4646));});};exports[_0xb1be('0x92')]=function(_0x2f85c8,_0x1ad16f,_0xd9be65,_0x4f4738,_0x3eda09,_0x5c78d7){var _0x443f37,_0x206178,_0x514f8d;_0x5c78d7['host']=intUtil[_0xb1be('0x79')](_0x5c78d7[_0xb1be('0x7a')]);_0x5c78d7[_0xb1be('0x7b')]=intUtil[_0xb1be('0x79')](_0x5c78d7['serverUrl']);if(_0x3eda09&&_0x3eda09['monitor_format']){logger[_0xb1be('0x36')]('['+_0x1ad16f['lastevent']['toUpperCase']()+']',_0xb1be('0x7d'));_0x1ad16f[_0xb1be('0x7e')]=_0x5c78d7[_0xb1be('0x7b')]+_0xb1be('0x8c')+_0x1ad16f[_0xb1be('0x80')]+_0xb1be('0x7f')+md5(_0x1ad16f[_0xb1be('0x80')]);}else{_0x1ad16f['recordingURL']='';}var _0x29b0e1=_0x5c78d7[_0xb1be('0x7a')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x5c78d7)['then'](function(_0x1f8e50){_0x514f8d=_0x1f8e50;return getUser(_0x514f8d,_0x29b0e1,_0x5c78d7);})[_0xb1be('0x29')](function(_0x55eb35){_0x443f37=_0x55eb35;logger['info'](_0xb1be('0x84'),_0x443f37['id']);return getEndUser(_0x514f8d,_0x29b0e1,_0x5c78d7,_0x1ad16f[_0xb1be('0x85')],_0x1ad16f[_0xb1be('0x93')],_0x443f37,_0xd9be65);})[_0xb1be('0x29')](function(_0x33c0ab){_0x206178=_0x33c0ab;return getCall(_0x514f8d,_0x29b0e1,_0x5c78d7,_0x443f37,_0x206178,_0xd9be65,_0x1ad16f,_0xb1be('0x72'));})[_0xb1be('0x29')](function(_0x3049d3){if(_0x3049d3){logger[_0xb1be('0x36')](_0xb1be('0x86'),_0x3049d3['id']);}})['catch'](function(_0x1d00d0){logger[_0xb1be('0x3c')]('['+_0x1ad16f[_0xb1be('0x66')][_0xb1be('0x94')]()+']',JSON[_0xb1be('0xf')](_0x1d00d0));});}; \ No newline at end of file +var _0xd98a=['timeout','Call_Start_Time','Call_Type','Inbound','Fields','/crm/v2/Calls','code','Call\x20created!','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','user:%s','https://crm.','[OUTBOUND]','unmanaged','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','indexOf','isNil','access_token','isBefore','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','getString','Subjects','enduserType','Who_Id','Full_Name','Last_Name','What_Id','First_Name','Call_Duration','utc','talktime','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','abandoned','Abandoned'];(function(_0x4bd70a,_0x515c62){var _0x267e8e=function(_0x39d598){while(--_0x39d598){_0x4bd70a['push'](_0x4bd70a['shift']());}};_0x267e8e(++_0x515c62);}(_0xd98a,0x156));var _0xad98=function(_0x285428,_0x486cd9){_0x285428=_0x285428-0x0;var _0x301480=_0xd98a[_0x285428];return _0x301480;};'use strict';var _=require(_0xad98('0x0'));var rp=require(_0xad98('0x1'));var md5=require(_0xad98('0x2'));var util=require(_0xad98('0x3'));var intUtil=require(_0xad98('0x4'));var moment=require('moment');var Redis=require(_0xad98('0x5'));var BPromise=require(_0xad98('0x6'));var config=require('../../../../config/environment');var logger=require(_0xad98('0x7'))(_0xad98('0x8'));config[_0xad98('0x9')]=_[_0xad98('0xa')](config[_0xad98('0x9')],{'host':_0xad98('0xb'),'port':0x18eb});var io=require(_0xad98('0xc'))(new Redis(config[_0xad98('0x9')]));function emit(_0x4d1b10,_0x1154a6,_0xca1fc7){io['to'](_0x4d1b10)[_0xad98('0xd')](_0x1154a6,_0xca1fc7);}function request(_0x1d4ecb){logger['debug'](_0xad98('0xe'),JSON['stringify'](_0x1d4ecb));return rp(_0x1d4ecb);}function getCustomFields(_0x20e86e,_0x398efa){var _0x481181={};if(_0x20e86e['length']>0x0){_[_0xad98('0xf')](_0x20e86e,function(_0x7ceb){if(_['includes']([_0xad98('0x10'),_0xad98('0x11')],_0x7ceb[_0xad98('0x12')])&&_0x7ceb[_0xad98('0x13')]){_0x481181[_0x7ceb['idField']]=_0x7ceb[_0xad98('0x14')][_0xad98('0x15')]();}else if(_0x7ceb[_0xad98('0x12')]===_0xad98('0x16')&&_0x7ceb[_0xad98('0x17')]&&_0x7ceb[_0xad98('0x13')]&&_0x398efa[_0x7ceb[_0xad98('0x17')]]){_0x481181[_0x7ceb[_0xad98('0x13')]]=_0x398efa[_0x7ceb[_0xad98('0x17')]][_0xad98('0x15')]();}else if(_0x7ceb[_0xad98('0x12')]===_0xad98('0x18')&&_0x7ceb[_0xad98('0x19')]&&_0x7ceb[_0xad98('0x19')][_0xad98('0x1a')]&&_0x7ceb['idField']&&_0x398efa[_0x7ceb['Variable'][_0xad98('0x1a')]['toLowerCase']()]){_0x481181[_0x7ceb[_0xad98('0x13')]]=_0x398efa[_0x7ceb['Variable'][_0xad98('0x1a')]['toLowerCase']()][_0xad98('0x15')]();}});}return _0x481181;}function getName(_0x2ed6ab){if(_0x2ed6ab[_0xad98('0x1b')]('\x20')>0x0){var _0x5211b7=_0x2ed6ab['split'](/ (.+)/);if(_0x5211b7[0x1]){return _0x5211b7;}}return[_0x2ed6ab,_0x2ed6ab];}var accountsTokens={};function getAccessToken(_0x35a252){return new Promise(function(_0x173d16,_0x3d0dd9){if(!_[_0xad98('0x1c')](accountsTokens[_0x35a252['id']])&&!_[_0xad98('0x1c')](accountsTokens[_0x35a252['id']][_0xad98('0x1d')])){if(moment()[_0xad98('0x1e')](accountsTokens[_0x35a252['id']]['expires_in'])){_0x173d16(accountsTokens[_0x35a252['id']][_0xad98('0x1d')]);}}var _0xcabdda;switch(_0x35a252['zone']){case'US':_0xcabdda='https://accounts.zoho.com';break;case'AU':_0xcabdda='https://accounts.zoho.com.au';break;case'EU':_0xcabdda=_0xad98('0x1f');break;case'IN':_0xcabdda='https://accounts.zoho.in';break;case'CN':_0xcabdda=_0xad98('0x20');break;default:_0xcabdda=_0xad98('0x1f');break;}var _0x424161={'method':_0xad98('0x21'),'uri':_0xcabdda+_0xad98('0x22'),'qs':{'refresh_token':_0x35a252[_0xad98('0x23')],'client_id':_0x35a252[_0xad98('0x24')],'client_secret':_0x35a252[_0xad98('0x25')],'grant_type':_0xad98('0x26')},'json':!![]};return rp(_0x424161)[_0xad98('0x27')](function(_0x437545){accountsTokens[_0x35a252['id']]={'access_token':_0x437545[_0xad98('0x1d')],'expires_in':moment()[_0xad98('0x28')](_0x437545['expires_in'],_0xad98('0x29'))};_0x173d16(_0x437545[_0xad98('0x1d')]);})[_0xad98('0x2a')](function(_0x4ed0f7){logger[_0xad98('0x2b')](_0xad98('0x2c'),_0x4ed0f7[_0xad98('0x2d')]);_0x3d0dd9(_0x4ed0f7);});});}function getUser(_0x8e022c,_0x24bd1a,_0x1c200c,_0x2b4e3b){logger[_0xad98('0x2e')](_0xad98('0x2f'));return request({'method':_0xad98('0x30'),'uri':util[_0xad98('0x31')](_0xad98('0x32'),_0x24bd1a),'qs':{'type':_0xad98('0x33')},'headers':{'Authorization':_0xad98('0x34')+_0x8e022c},'json':!![]})['then'](function(_0x1d6bf1){if(_0x1d6bf1[_0xad98('0x35')]){var _0x2103b4=-0x1;if(_[_0xad98('0x36')](_0x1d6bf1[_0xad98('0x35')])){if(!_[_0xad98('0x1c')](_0x2b4e3b)){_0x2103b4=_[_0xad98('0x37')](_0x1d6bf1['users'],function(_0x55853f){return _0x55853f[_0xad98('0x38')]===_0x2b4e3b;});}if(_0x2103b4>=0x0){logger[_0xad98('0x2e')](_0xad98('0x39'));}else{logger[_0xad98('0x2e')](_0xad98('0x3a'));_0x2103b4=_['findIndex'](_0x1d6bf1[_0xad98('0x35')],function(_0x38e299){return _0x38e299[_0xad98('0x3b')]['name']===_0xad98('0x3c');});}return _0x1d6bf1['users'][_0x2103b4];}else{if(_0x1d6bf1[_0xad98('0x3d')][_0xad98('0x3b')][_0xad98('0x1a')]===_0xad98('0x3c')){logger[_0xad98('0x2e')](_0xad98('0x3a'));user=_0x1d6bf1['user'];return user;}else{logger[_0xad98('0x2b')]('The\x20failing\x20result\x20is',JSON[_0xad98('0x3e')](_0x1d6bf1));throw new Error(_0xad98('0x3f')+JSON['stringify'](_0x1d6bf1));}}}else{logger['error'](_0xad98('0x40'),JSON['stringify'](_0x1d6bf1));throw new Error(_0xad98('0x3f')+JSON['stringify'](_0x1d6bf1));}})[_0xad98('0x2a')](function(_0x2d3b39){console[_0xad98('0x2b')](_0x2d3b39);});}function getZohoUser(_0x4c5254,_0x3d6f29){return new BPromise(function(_0x19afba,_0x5cd1b7){request(_0x4c5254)[_0xad98('0x27')](function(_0x3f5e41){var _0x3daceb=null;if(_0x3f5e41){_0x3daceb=_0x3f5e41[_0xad98('0x41')][0x0];_0x3daceb['enduserType']=_0x3d6f29;}_0x19afba(_0x3daceb);})['catch'](function(_0x4ac28e){_0x5cd1b7(_0x4ac28e);});});}function createEndUser(_0xb17b45,_0x5a8a17,_0x322a68,_0x56abef,_0x3de0f4,_0x1ac3be){var _0x322a68=getName(_0x322a68);return request({'method':_0xad98('0x21'),'uri':_0xad98('0x42')+_0x5a8a17+_0xad98('0x43')+_[_0xad98('0x44')](_0x1ac3be[_0xad98('0x45')])+'s','body':{'data':[{'Last_Name':_0x322a68[0x1],'First_Name':_0x322a68[0x0],'Phone':_0x56abef,'Owner':{'name':!_['isNil'](_0x3de0f4[_0xad98('0x46')]['name'])?_0x3de0f4[_0xad98('0x46')][_0xad98('0x1a')]:!_[_0xad98('0x1c')](_0x3de0f4[_0xad98('0x47')])?_0x3de0f4[_0xad98('0x47')]+'\x20'+_0x3de0f4[_0xad98('0x48')]:_0x3de0f4[_0xad98('0x48')],'id':_0x3de0f4['id']}}]},'headers':{'Authorization':_0xad98('0x34')+_0xb17b45},'json':!![]})[_0xad98('0x27')](function(_0x1a2ccd){if(_0x1a2ccd&&_0x1a2ccd['data'][0x0]['code']===_0xad98('0x49')){var _0x5d97cc=_0x1a2ccd[_0xad98('0x41')][0x0][_0xad98('0x4a')];_0x5d97cc['enduserType']=_['startCase'](_0x1ac3be[_0xad98('0x45')])+'s';return _0x5d97cc;}logger[_0xad98('0x2b')](_0xad98('0x40'),JSON[_0xad98('0x3e')](data));throw new Error(_0xad98('0x4b')+JSON[_0xad98('0x3e')](data));})[_0xad98('0x2a')](function(_0xbb9600){console['log'](_0xad98('0x4c'),_0xbb9600);});}function getEndUser(_0x5ccc70,_0x60da6d,_0x46ab85,_0x1c8690,_0x3b4940,_0xbf3ae9,_0x568c7b){var _0x15463f={'method':_0xad98('0x30'),'uri':'','headers':{'Authorization':_0xad98('0x34')+_0x5ccc70},'json':!![]};switch(_0x568c7b[_0xad98('0x4d')]){case'contact_lead':_0x15463f[_0xad98('0x4e')]=_0xad98('0x42')+_0x60da6d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3b4940+'))';return getZohoUser(_0x15463f,'Contacts')['then'](function(_0x5ccf0d){if(_0x5ccf0d)return _0x5ccf0d;_0x15463f[_0xad98('0x4e')]=_0xad98('0x42')+_0x60da6d+_0xad98('0x4f')+_0x3b4940+'))';return getZohoUser(_0x15463f,_0xad98('0x50'))['then'](function(_0x55dcc4){if(_0x55dcc4)return _0x55dcc4;if(_0x568c7b[_0xad98('0x45')]!=_0xad98('0x51')){return createEndUser(_0x5ccc70,_0x60da6d,_0x1c8690,_0x3b4940,_0xbf3ae9,_0x568c7b);}else{return{};}});});break;case'contact':_0x15463f[_0xad98('0x4e')]=_0xad98('0x42')+_0x60da6d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3b4940+'))';return getZohoUser(_0x15463f,'Contacts')[_0xad98('0x27')](function(_0x5eae91){if(_0x5eae91)return _0x5eae91;if(_0x568c7b[_0xad98('0x45')]!=_0xad98('0x51')){return createEndUser(_0x5ccc70,_0x60da6d,_0x1c8690,_0x3b4940,_0xbf3ae9,_0x568c7b);}else{return{};}});break;case _0xad98('0x52'):_0x15463f[_0xad98('0x4e')]=_0xad98('0x42')+_0x60da6d+_0xad98('0x4f')+_0x3b4940+'))';return getZohoUser(_0x15463f,_0xad98('0x50'))['then'](function(_0x5dc945){if(_0x5dc945)return _0x5dc945;if(_0x568c7b[_0xad98('0x45')]!=_0xad98('0x51')){return createEndUser(_0x5ccc70,_0x60da6d,_0x1c8690,_0x3b4940,_0xbf3ae9,_0x568c7b);}else{return{};}});break;}}function getCall(_0x4d959a,_0x36d2f4,_0x1626ac,_0x160015,_0x31359c,_0x5803e6,_0xd6fc3d,_0x436150){logger['info'](_0xad98('0x53'));var _0x2e26fc={};_0x2e26fc[_0xad98('0x54')]={'name':!_['isNil'](_0x160015[_0xad98('0x46')][_0xad98('0x1a')])&&!_[_0xad98('0x1c')](_0x160015[_0xad98('0x3b')][_0xad98('0x1a')])&&_0x160015['profile']['name']==='administrator'?_0x160015[_0xad98('0x46')][_0xad98('0x1a')]:!_['isNil'](_0x160015[_0xad98('0x47')])?_0x160015[_0xad98('0x47')]+'\x20'+_0x160015[_0xad98('0x48')]:_0x160015[_0xad98('0x48')],'id':_0x160015['id']};_0x2e26fc['Subject']=intUtil[_0xad98('0x55')](_0x5803e6[_0xad98('0x56')],_0xd6fc3d,'\x20');_0x2e26fc['Description']=intUtil['getString'](_0x5803e6['Descriptions'],_0xd6fc3d,'\x0a');if(_0x31359c[_0xad98('0x57')]==='Contacts'){_0x2e26fc[_0xad98('0x58')]={'name':!_[_0xad98('0x1c')](_0x31359c[_0xad98('0x59')])?_0x31359c['Full_Name']:!_[_0xad98('0x1c')](_0x31359c['First_Name'])?_0x31359c['First_Name']+'\x20'+_0x31359c[_0xad98('0x5a')]:_0x31359c[_0xad98('0x5a')],'id':_0x31359c['id']};}if(_0x31359c['enduserType']==='Leads'){_0x2e26fc[_0xad98('0x5b')]={'name':!_[_0xad98('0x1c')](_0x31359c['Full_Name'])?_0x31359c[_0xad98('0x59')]:!_['isNil'](_0x31359c['First_Name'])?_0x31359c[_0xad98('0x5c')]+'\x20'+_0x31359c[_0xad98('0x5a')]:_0x31359c[_0xad98('0x5a')],'id':_0x31359c['id']};_0x2e26fc['$se_module']=_['startCase'](_0x31359c[_0xad98('0x57')]);}if(_0xd6fc3d['talktime']){_0x2e26fc[_0xad98('0x5d')]=moment[_0xad98('0x5e')](parseInt(_0xd6fc3d[_0xad98('0x5f')])*0x3e8)[_0xad98('0x31')]('mm:ss');}else if(_0xd6fc3d[_0xad98('0x60')]&&_0xd6fc3d[_0xad98('0x61')]){_0x2e26fc[_0xad98('0x5d')]=moment[_0xad98('0x5e')](moment(_0xd6fc3d[_0xad98('0x61')],_0xad98('0x62'))[_0xad98('0x63')](moment(_0xd6fc3d[_0xad98('0x64')],_0xad98('0x62'))))['format'](_0xad98('0x65'));}switch(_0xd6fc3d[_0xad98('0x66')]){case _0xad98('0x67'):_0x2e26fc[_0xad98('0x68')]=_0xad98('0x69');break;case _0xad98('0x6a'):case _0xad98('0x6b'):_0x2e26fc[_0xad98('0x68')]=_0xad98('0x6c');break;case'rejected':_0x2e26fc[_0xad98('0x68')]='Rejected';break;case _0xad98('0x6d'):_0x2e26fc[_0xad98('0x68')]=_0xad98('0x6e');break;case _0xad98('0x6f'):_0x2e26fc[_0xad98('0x68')]='Timeout';default:}_0x2e26fc[_0xad98('0x70')]=(_0x436150==='outbound'?moment(_0xd6fc3d[_0xad98('0x64')])['format'](_0xad98('0x62')):moment(_0xd6fc3d['agentcalledAt'])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xad98('0x31')](_0xad98('0x62'));_0x2e26fc[_0xad98('0x71')]=_0x436150||_0xad98('0x72');_0x2e26fc=_['merge'](_0x2e26fc,getCustomFields(_0x5803e6[_0xad98('0x73')],_0xd6fc3d));return request({'method':'POST','uri':_0xad98('0x42')+_0x36d2f4+_0xad98('0x74'),'headers':{'Authorization':_0xad98('0x34')+_0x4d959a},'body':{'data':[_0x2e26fc]},'json':!![]})['then'](function(_0x2ebc4f){if(_0x2ebc4f&&_0x2ebc4f['data'][0x0][_0xad98('0x75')]==='SUCCESS'){logger[_0xad98('0x2e')](_0xad98('0x76'));return{'id':_0x2ebc4f[_0xad98('0x41')][0x0][_0xad98('0x4a')]['id']};}})[_0xad98('0x2a')](function(_0x346fb8){logger[_0xad98('0x2e')]('err',_0x346fb8['stack']);console[_0xad98('0x77')](_0xad98('0x78'),_0x346fb8);});}exports[_0xad98('0x79')]=function(_0x4e0521,_0x3f7d1d,_0x128695,_0x646ef5,_0x2ff923,_0x4f1f96){var _0x4d29bf,_0x3e4a34,_0x2cbd00;_0x4f1f96[_0xad98('0x7a')]=intUtil[_0xad98('0x7b')](_0x4f1f96['host']);_0x4f1f96[_0xad98('0x7c')]=intUtil[_0xad98('0x7b')](_0x4f1f96[_0xad98('0x7c')]);if(_0x2ff923&&_0x2ff923[_0xad98('0x7d')]){logger[_0xad98('0x2e')](_0xad98('0x7e'),_0xad98('0x7f'));_0x3f7d1d[_0xad98('0x80')]=_0x4f1f96[_0xad98('0x7c')]+_0xad98('0x81')+_0x3f7d1d[_0xad98('0x82')]+_0xad98('0x83')+md5(_0x3f7d1d[_0xad98('0x82')]);}else{_0x3f7d1d[_0xad98('0x80')]='';}var _0x3e4780=_0x4f1f96[_0xad98('0x7a')]===_0xad98('0x84')?'eu':_0xad98('0x85');return getAccessToken(_0x4f1f96)[_0xad98('0x27')](function(_0x1c632e){_0x2cbd00=_0x1c632e;return getUser(_0x2cbd00,_0x3e4780,_0x4f1f96,_0x646ef5[_0xad98('0x38')]);})['then'](function(_0x4d3a56){_0x4d29bf=_0x4d3a56;logger[_0xad98('0x2e')](_0xad98('0x86'),_0x4d29bf['id']);return getEndUser(_0x2cbd00,_0x3e4780,_0x4f1f96,_0x3f7d1d[_0xad98('0x87')],_0x3f7d1d[_0xad98('0x88')],_0x4d29bf,_0x128695);})[_0xad98('0x27')](function(_0x1e3f7b){_0x3e4a34=_0x1e3f7b;return getCall(_0x2cbd00,_0x3e4780,_0x4f1f96,_0x4d29bf,_0x3e4a34,_0x128695,_0x3f7d1d,'Inbound');})[_0xad98('0x27')](function(_0xc258c1){if(_0xc258c1){logger[_0xad98('0x2e')](_0xad98('0x89'),_0xc258c1['id']);logger[_0xad98('0x2e')](_0xad98('0x7e'),_0xad98('0x8a'));emit(util[_0xad98('0x31')]('user:%s',_0x646ef5[_0xad98('0x1a')]),_0xad98('0x8b'),{'uri':'https://crm.'+_0x4f1f96['host']+_0xad98('0x8c')+_0xc258c1['id']});}})[_0xad98('0x2a')](function(_0x2a8ad4){logger[_0xad98('0x2b')](_0xad98('0x7e'),JSON['stringify'](_0x2a8ad4));});};exports[_0xad98('0x8d')]=function(_0x114f78,_0x18c72e,_0x20e969,_0x1071d8,_0x5ef41e,_0x414ee6,_0x4685dd){var _0x2c945c,_0x2a918e,_0x56ac28;_0x414ee6[_0xad98('0x7a')]=intUtil[_0xad98('0x7b')](_0x414ee6[_0xad98('0x7a')]);_0x414ee6[_0xad98('0x7c')]=intUtil[_0xad98('0x7b')](_0x414ee6[_0xad98('0x7c')]);if(_0x4685dd&&_0x4685dd[_0xad98('0x8e')]&&_0x4685dd['recordingFormat']!==_0xad98('0x8f')){logger[_0xad98('0x2e')]('[OUTBOUND]',_0xad98('0x7f'));_0x18c72e[_0xad98('0x80')]=_0x414ee6['serverUrl']+_0xad98('0x81')+_0x18c72e[_0xad98('0x82')]+_0xad98('0x83')+md5(_0x18c72e[_0xad98('0x82')]);}var _0x10bded=_0x414ee6[_0xad98('0x7a')]===_0xad98('0x84')?'eu':_0xad98('0x85');return getAccessToken(_0x414ee6)[_0xad98('0x27')](function(_0x447d0e){_0x56ac28=_0x447d0e;return getUser(_0x56ac28,_0x10bded,_0x414ee6,_0x1071d8[_0xad98('0x38')]);})[_0xad98('0x27')](function(_0x41f536){_0x2c945c=_0x41f536;logger['info'](_0xad98('0x86'),_0x2c945c['id']);return getEndUser(_0x56ac28,_0x10bded,_0x414ee6,_0x18c72e[_0xad98('0x90')],_0x18c72e[_0xad98('0x91')],_0x2c945c,_0x20e969);})[_0xad98('0x27')](function(_0x4daa5f){_0x2a918e=_0x4daa5f;return getCall(_0x56ac28,_0x10bded,_0x414ee6,_0x2c945c,_0x2a918e,_0x20e969,_0x18c72e,_0xad98('0x92'));})[_0xad98('0x27')](function(_0x16513b){if(_0x16513b){logger[_0xad98('0x2e')](_0xad98('0x89'),_0x16513b['id']);logger[_0xad98('0x2e')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xad98('0x31')](_0xad98('0x93'),_0x1071d8[_0xad98('0x1a')]),'trigger:browser:url',{'uri':_0xad98('0x94')+_0x414ee6[_0xad98('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0x16513b['id']});}})['catch'](function(_0x4891d2){logger[_0xad98('0x2b')](_0xad98('0x95'),JSON['stringify'](_0x4891d2));});};exports[_0xad98('0x96')]=function(_0x1b845b,_0x40f425,_0x579982,_0xae0c14,_0x16c848,_0x94079e){var _0x435f07,_0x496030,_0x866cf8;_0x94079e[_0xad98('0x7a')]=intUtil[_0xad98('0x7b')](_0x94079e['host']);_0x94079e[_0xad98('0x7c')]=intUtil[_0xad98('0x7b')](_0x94079e[_0xad98('0x7c')]);if(_0x16c848&&_0x16c848[_0xad98('0x7d')]){logger[_0xad98('0x2e')]('['+_0x40f425[_0xad98('0x66')]['toUpperCase']()+']',_0xad98('0x7f'));_0x40f425[_0xad98('0x80')]=_0x94079e[_0xad98('0x7c')]+_0xad98('0x81')+_0x40f425[_0xad98('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x40f425[_0xad98('0x82')]);}else{_0x40f425[_0xad98('0x80')]='';}var _0x3e8e32=_0x94079e[_0xad98('0x7a')]===_0xad98('0x84')?'eu':_0xad98('0x85');return getAccessToken(_0x94079e)[_0xad98('0x27')](function(_0x2d3de3){_0x866cf8=_0x2d3de3;return getUser(_0x866cf8,_0x3e8e32,_0x94079e);})[_0xad98('0x27')](function(_0x9a2786){_0x435f07=_0x9a2786;logger[_0xad98('0x2e')]('The\x20User\x20ID\x20is:',_0x435f07['id']);return getEndUser(_0x866cf8,_0x3e8e32,_0x94079e,_0x40f425[_0xad98('0x87')],_0x40f425[_0xad98('0x88')],_0x435f07,_0x579982);})['then'](function(_0x131af2){_0x496030=_0x131af2;return getCall(_0x866cf8,_0x3e8e32,_0x94079e,_0x435f07,_0x496030,_0x579982,_0x40f425,_0xad98('0x72'));})[_0xad98('0x27')](function(_0x2b7336){if(_0x2b7336){logger['info'](_0xad98('0x89'),_0x2b7336['id']);}})[_0xad98('0x2a')](function(_0xa04f03){logger[_0xad98('0x2b')]('['+_0x40f425[_0xad98('0x66')]['toUpperCase']()+']',JSON[_0xad98('0x3e')](_0xa04f03));});}; \ 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 da4f47a..09f0b74 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 _0x0ed6=['../../../../config/logger','exec','data2','Script','data3','render','error','format','%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','shelljs','mustache'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x0ed6,0x1de));var _0x60ed=function(_0x307049,_0x1e9968){_0x307049=_0x307049-0x0;var _0x2d3015=_0x0ed6[_0x307049];return _0x2d3015;};'use strict';var util=require(_0x60ed('0x0'));var sh=require(_0x60ed('0x1'));var Mustache=require(_0x60ed('0x2'));var logger=require(_0x60ed('0x3'))('trigger');exports[_0x60ed('0x4')]=function(_0x46e7cd,_0x191ea4){var _0x3ed56d=_0x46e7cd[_0x60ed('0x5')]?_0x46e7cd[_0x60ed('0x5')]:_0x60ed('0x6');var _0x7363ac=_0x46e7cd[_0x60ed('0x7')]?Mustache[_0x60ed('0x8')](_0x46e7cd[_0x60ed('0x7')],_0x191ea4):_0x191ea4;sh[_0x60ed('0x4')](_0x7363ac,function(_0x104878,_0x4eb7ab,_0xf91d8b){if(_0x104878!==0x0){logger[_0x60ed('0x9')](util[_0x60ed('0xa')](_0x60ed('0xb'),_0x3ed56d,_0x7363ac,_0x104878,_0xf91d8b));}else{logger['info'](util[_0x60ed('0xa')](_0x60ed('0xc'),_0x3ed56d,_0x7363ac,_0x4eb7ab));}});}; \ No newline at end of file +var _0xdf7c=['../../../../config/logger','trigger','data2','Script','data3','render','exec','error','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache'];(function(_0x46ac3c,_0x1e7ae2){var _0x1c16eb=function(_0x3fb402){while(--_0x3fb402){_0x46ac3c['push'](_0x46ac3c['shift']());}};_0x1c16eb(++_0x1e7ae2);}(_0xdf7c,0x142));var _0xcdf7=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0xdf7c[_0x1af98d];return _0x3553ea;};'use strict';var util=require(_0xcdf7('0x0'));var sh=require('shelljs');var Mustache=require(_0xcdf7('0x1'));var logger=require(_0xcdf7('0x2'))(_0xcdf7('0x3'));exports['exec']=function(_0x35888e,_0x11fd77){var _0x4bb93d=_0x35888e[_0xcdf7('0x4')]?_0x35888e['data2']:_0xcdf7('0x5');var _0x55df35=_0x35888e[_0xcdf7('0x6')]?Mustache[_0xcdf7('0x7')](_0x35888e[_0xcdf7('0x6')],_0x11fd77):_0x11fd77;sh[_0xcdf7('0x8')](_0x55df35,function(_0x135a08,_0x52222d,_0x53af09){if(_0x135a08!==0x0){logger[_0xcdf7('0x9')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x4bb93d,_0x55df35,_0x135a08,_0x53af09));}else{logger[_0xcdf7('0xa')](util['format'](_0xcdf7('0xb'),_0x4bb93d,_0x55df35,_0x52222d));}});}; \ 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 5afad7a..1c4fc8f 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 _0xe907=['name','message','util','lodash','trigger','exec','data1','toUpperCase','data2','data5','headers','data6','parse','render','error','GET','DELETE','POST','PUT','data7','body','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode'];(function(_0x3a85f7,_0x1f8874){var _0xbd7919=function(_0x326fd0){while(--_0x326fd0){_0x3a85f7['push'](_0x3a85f7['shift']());}};_0xbd7919(++_0x1f8874);}(_0xe907,0xc2));var _0x7e90=function(_0x26c1af,_0x189dde){_0x26c1af=_0x26c1af-0x0;var _0x13fbba=_0xe907[_0x26c1af];return _0x13fbba;};'use strict';var rp=require('request-promise');var util=require(_0x7e90('0x0'));var _=require(_0x7e90('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x7e90('0x2'));exports[_0x7e90('0x3')]=function(_0x44e493,_0x3d7558){var _0x4187b1,_0x4f6a86;var _0x17c115={'method':_0x44e493[_0x7e90('0x4')][_0x7e90('0x5')](),'uri':Mustache['render'](_0x44e493[_0x7e90('0x6')],_0x3d7558),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x44e493['data5'])==='number'&&parseInt(_0x44e493['data5'])>=0x1&&parseInt(_0x44e493[_0x7e90('0x7')])<=0xa?parseInt(_0x44e493[_0x7e90('0x7')])*0x3e8:0x5*0x3e8};try{_0x17c115[_0x7e90('0x8')]=_0x44e493[_0x7e90('0x9')]?JSON[_0x7e90('0xa')](Mustache[_0x7e90('0xb')](_0x44e493[_0x7e90('0x9')],_0x3d7558)):{};}catch(_0x149d19){logger[_0x7e90('0xc')](_0x149d19['stack']);}switch(_0x44e493[_0x7e90('0x4')][_0x7e90('0x5')]()){case _0x7e90('0xd'):case _0x7e90('0xe'):_0x4187b1=null;_0x17c115['qs']=_0x3d7558;break;case _0x7e90('0xf'):case _0x7e90('0x10'):if(_0x44e493['data7']){try{_0x4187b1=JSON['parse'](Mustache['render'](_0x44e493[_0x7e90('0x11')],_0x3d7558));_0x17c115[_0x7e90('0x12')]=_0x4187b1;}catch(_0x383f21){logger['error'](_0x383f21['stack']);logger[_0x7e90('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4187b1=_0x3d7558;_0x17c115['body']=_0x4187b1;}break;}logger['info'](util['format'](_0x7e90('0x13'),_0x44e493[_0x7e90('0x4')],_0x44e493[_0x7e90('0x6')],JSON[_0x7e90('0x14')](_0x17c115)));rp(_0x17c115)[_0x7e90('0x15')](function(_0x4866de){_0x4187b1=!_['isNil'](_0x4187b1)?_0x7e90('0x16')+_0x4187b1:'';_0x4f6a86=typeof _0x4866de[_0x7e90('0x12')]===_0x7e90('0x17')?JSON[_0x7e90('0x14')](_0x4866de['body']):_0x4866de[_0x7e90('0x12')];logger[_0x7e90('0x18')](util[_0x7e90('0x19')](_0x7e90('0x1a'),_0x44e493[_0x7e90('0x4')],_0x44e493['data2'],_0x4866de['statusCode'],_0x4f6a86));})[_0x7e90('0x1b')](function(_0x3330d7){logger['error'](util[_0x7e90('0x19')](_0x7e90('0x1c'),_0x44e493[_0x7e90('0x4')],_0x44e493['data2'],_0x3330d7[_0x7e90('0x1d')],_0x3330d7[_0x7e90('0x1e')],_0x3330d7[_0x7e90('0x1f')]));});}; \ No newline at end of file +var _0x80f4=['then','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','parse','data6','error','stack','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify'];(function(_0x599e2b,_0x153f98){var _0xb66cb=function(_0x21c344){while(--_0x21c344){_0x599e2b['push'](_0x599e2b['shift']());}};_0xb66cb(++_0x153f98);}(_0x80f4,0x6e));var _0x480f=function(_0x4aca46,_0x2251a7){_0x4aca46=_0x4aca46-0x0;var _0x2e8cbb=_0x80f4[_0x4aca46];return _0x2e8cbb;};'use strict';var rp=require('request-promise');var util=require(_0x480f('0x0'));var _=require(_0x480f('0x1'));var Mustache=require(_0x480f('0x2'));var logger=require(_0x480f('0x3'))(_0x480f('0x4'));exports[_0x480f('0x5')]=function(_0x57a3b9,_0x2bedef){var _0x58f4c5,_0x348adc;var _0x29fbfc={'method':_0x57a3b9[_0x480f('0x6')][_0x480f('0x7')](),'uri':Mustache[_0x480f('0x8')](_0x57a3b9[_0x480f('0x9')],_0x2bedef),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x57a3b9[_0x480f('0xa')])===_0x480f('0xb')&&parseInt(_0x57a3b9[_0x480f('0xa')])>=0x1&&parseInt(_0x57a3b9[_0x480f('0xa')])<=0xa?parseInt(_0x57a3b9[_0x480f('0xa')])*0x3e8:0x5*0x3e8};try{_0x29fbfc[_0x480f('0xc')]=_0x57a3b9['data6']?JSON[_0x480f('0xd')](Mustache[_0x480f('0x8')](_0x57a3b9[_0x480f('0xe')],_0x2bedef)):{};}catch(_0x2aea49){logger[_0x480f('0xf')](_0x2aea49[_0x480f('0x10')]);}switch(_0x57a3b9[_0x480f('0x6')][_0x480f('0x7')]()){case _0x480f('0x11'):case'DELETE':_0x58f4c5=null;_0x29fbfc['qs']=_0x2bedef;break;case _0x480f('0x12'):case _0x480f('0x13'):if(_0x57a3b9[_0x480f('0x14')]){try{_0x58f4c5=JSON[_0x480f('0xd')](Mustache[_0x480f('0x8')](_0x57a3b9['data7'],_0x2bedef));_0x29fbfc[_0x480f('0x15')]=_0x58f4c5;}catch(_0xb47c14){logger[_0x480f('0xf')](_0xb47c14[_0x480f('0x10')]);logger[_0x480f('0xf')](_0x480f('0x16'));}}else{_0x58f4c5=_0x2bedef;_0x29fbfc['body']=_0x58f4c5;}break;}logger[_0x480f('0x17')](util[_0x480f('0x18')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x57a3b9[_0x480f('0x6')],_0x57a3b9[_0x480f('0x9')],JSON[_0x480f('0x19')](_0x29fbfc)));rp(_0x29fbfc)[_0x480f('0x1a')](function(_0x5552e4){_0x58f4c5=!_[_0x480f('0x1b')](_0x58f4c5)?',\x20request\x20body:\x20'+_0x58f4c5:'';_0x348adc=typeof _0x5552e4[_0x480f('0x15')]===_0x480f('0x1c')?JSON[_0x480f('0x19')](_0x5552e4[_0x480f('0x15')]):_0x5552e4[_0x480f('0x15')];logger['info'](util['format'](_0x480f('0x1d'),_0x57a3b9[_0x480f('0x6')],_0x57a3b9[_0x480f('0x9')],_0x5552e4[_0x480f('0x1e')],_0x348adc));})[_0x480f('0x1f')](function(_0x1c8f5b){logger['error'](util[_0x480f('0x18')](_0x480f('0x20'),_0x57a3b9[_0x480f('0x6')],_0x57a3b9[_0x480f('0x9')],_0x1c8f5b[_0x480f('0x1e')],_0x1c8f5b[_0x480f('0x21')],_0x1c8f5b['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 12085ec..d5e3501 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 _0xa9c8=['error','message','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','then','debug'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0xa9c8,0x1c5));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x8a9c('0x0'));var BPromise=require(_0x8a9c('0x1'));var logger=require(_0x8a9c('0x2'))(_0x8a9c('0x3'));var client=jayson[_0x8a9c('0x4')]['http']({'port':0x2329});client[_0x8a9c('0x5')]=function(_0x497790,_0x4df162){return new BPromise(function(_0x48bd2b,_0x4911b9){return client[_0x8a9c('0x6')](_0x497790,_0x4df162)[_0x8a9c('0x7')](function(_0xa0ff4b){logger[_0x8a9c('0x8')]('rpc',_0x8a9c('0x3'),_0x497790,_0x4df162,_0xa0ff4b);if(_0xa0ff4b[_0x8a9c('0x9')]){logger[_0x8a9c('0x9')]('rpc','routing',_0x497790,_0xa0ff4b[_0x8a9c('0x9')][_0x8a9c('0xa')],_0x4df162);return _0x4911b9(_0xa0ff4b['error'][_0x8a9c('0xa')]);}else{return _0x48bd2b(_0xa0ff4b['result']);}})[_0x8a9c('0xb')](function(_0x451ba8){logger[_0x8a9c('0x9')](_0x8a9c('0xc'),'routing',_0x497790,_0x451ba8,_0x4df162);return _0x4911b9(_0x451ba8);});});};module[_0x8a9c('0xd')]=client; \ No newline at end of file +var _0xdb00=['client','http','request','debug','routing','error','rpc','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x1ffff7,_0x2f9ff6){var _0x49d017=function(_0x1d2483){while(--_0x1d2483){_0x1ffff7['push'](_0x1ffff7['shift']());}};_0x49d017(++_0x2f9ff6);}(_0xdb00,0xa7));var _0x0db0=function(_0x8c6164,_0x1dc7db){_0x8c6164=_0x8c6164-0x0;var _0x1ca172=_0xdb00[_0x8c6164];return _0x1ca172;};'use strict';var jayson=require(_0x0db0('0x0'));var BPromise=require(_0x0db0('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x0db0('0x2')][_0x0db0('0x3')]({'port':0x2329});client['Request']=function(_0x12712a,_0x7a239c){return new BPromise(function(_0x4e7219,_0x1eb10){return client[_0x0db0('0x4')](_0x12712a,_0x7a239c)['then'](function(_0x54baf3){logger[_0x0db0('0x5')]('rpc',_0x0db0('0x6'),_0x12712a,_0x7a239c,_0x54baf3);if(_0x54baf3[_0x0db0('0x7')]){logger[_0x0db0('0x7')](_0x0db0('0x8'),_0x0db0('0x6'),_0x12712a,_0x54baf3[_0x0db0('0x7')][_0x0db0('0x9')],_0x7a239c);return _0x1eb10(_0x54baf3[_0x0db0('0x7')][_0x0db0('0x9')]);}else{return _0x4e7219(_0x54baf3[_0x0db0('0xa')]);}})[_0x0db0('0xb')](function(_0x13f162){logger['error'](_0x0db0('0x8'),_0x0db0('0x6'),_0x12712a,_0x13f162,_0x7a239c);return _0x1eb10(_0x13f162);});});};module[_0x0db0('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 33a00a6..d89e4e3 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 _0xfd2b=['email','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfd2b,0xb3));var _0xbfd2=function(_0x3b176c,_0xb5c551){_0x3b176c=_0x3b176c-0x0;var _0x7ca0e5=_0xfd2b[_0x3b176c];return _0x7ca0e5;};'use strict';var server=require(_0xbfd2('0x0'));var Realtime=require(_0xbfd2('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0xbfd2('0x2'))(_0xbfd2('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xbfd2('0x4')]()[_0xbfd2('0x5')](mailAccount[_0xbfd2('0x6')]())['then'](realtime[_0xbfd2('0x7')]())[_0xbfd2('0x5')](function(){email[_0xbfd2('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xbfd2('0x9')](realtime,email)[_0xbfd2('0x5')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0xbfd2('0x5')](function(_0x193519){return setInterval(initRealtime,_0x193519[_0xbfd2('0xa')]*0x3e8);})[_0xbfd2('0xb')](function(_0x1f26e6){logger['error'](_0xbfd2('0xc'),_0x1f26e6);});}main(); \ No newline at end of file +var _0xb048=['./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts','mailAccounts','listen','getSettings','catch','error','./server','./realtime'];(function(_0x4f711d,_0x3f4cdc){var _0x2b0185=function(_0x3ec2d7){while(--_0x3ec2d7){_0x4f711d['push'](_0x4f711d['shift']());}};_0x2b0185(++_0x3f4cdc);}(_0xb048,0x1cc));var _0x8b04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb048[_0x3dd15e];return _0x231fd0;};'use strict';var server=require(_0x8b04('0x0'));var Realtime=require(_0x8b04('0x1'));var EmailChannel=require(_0x8b04('0x2'));var mailAccount=require(_0x8b04('0x3'));var setting=require(_0x8b04('0x4'));var logger=require('../../config/logger')(_0x8b04('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x8b04('0x6')]()[_0x8b04('0x7')](mailAccount[_0x8b04('0x8')]())[_0x8b04('0x7')](realtime['initMailAccounts']())[_0x8b04('0x7')](function(){email['refresh'](realtime[_0x8b04('0x9')]);return realtime;});}function main(){return server[_0x8b04('0xa')](realtime,email)[_0x8b04('0x7')](function(){return initRealtime();})[_0x8b04('0x7')](function(){return setting[_0x8b04('0xb')]();})['then'](function(_0x25c1b0){return setInterval(initRealtime,_0x25c1b0['loginMailFrequency']*0x3e8);})[_0x8b04('0xc')](function(_0x25242a){logger[_0x8b04('0xd')]('Email\x20service\x20initialization',_0x25242a);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 84c44e4..0a9ff00 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 _0xaa04=['ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','info','start\x20email\x20channel','mailAccounts','smtp','emit','key','Imap','status','messageStatus','total','isNil','refresh','hasOwnProperty','active','service','provider','custom','imapAccounts','email','box','bind','end','handleImapEnd','error','handleImapError','disabled','name','messages','prototype','handleImapEmail','lastName','from','notify','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verify','then','Smtp','verified','exports','lodash','bluebird','md5'];(function(_0x29d42a,_0x1c6670){var _0x1fe3ef=function(_0x820baa){while(--_0x820baa){_0x29d42a['push'](_0x29d42a['shift']());}};_0x1fe3ef(++_0x1c6670);}(_0xaa04,0x1ec));var _0x4aa0=function(_0x4be678,_0x9dfc3e){_0x4be678=_0x4be678-0x0;var _0x535ad7=_0xaa04[_0x4be678];return _0x535ad7;};'use strict';var _=require(_0x4aa0('0x0'));var moment=require('moment');var BPromise=require(_0x4aa0('0x1'));var md5=require(_0x4aa0('0x2'));var Redis=require(_0x4aa0('0x3'));var config=require(_0x4aa0('0x4'));var logger=require(_0x4aa0('0x5'))('email');config[_0x4aa0('0x6')]=_[_0x4aa0('0x7')](config[_0x4aa0('0x6')],{'host':_0x4aa0('0x8'),'port':0x18eb});var io=require(_0x4aa0('0x9'))(new Redis(config['redis']));var EmailImap=require(_0x4aa0('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2aba02){logger[_0x4aa0('0xb')](_0x4aa0('0xc'));this['mailAccounts']=_0x2aba02[_0x4aa0('0xd')];this['imapAccounts']={};this[_0x4aa0('0xe')]=new EmailSmtp();}EmailChannel['prototype'][_0x4aa0('0xf')]=function(_0x5a796a){var _0x4353c6=this['mailAccounts'][_0x5a796a];var _0x4dcd4b={'id':_0x4353c6['id'],'name':_0x4353c6['name'],'key':_0x4353c6[_0x4aa0('0x10')],'active':_0x4353c6['active'],'Imap':{'status':_0x4353c6[_0x4aa0('0x11')][_0x4aa0('0x12')],'messageStatus':_0x4353c6[_0x4aa0('0x11')][_0x4aa0('0x13')],'total':_0x4353c6[_0x4aa0('0x11')][_0x4aa0('0x14')]}};if(_[_0x4aa0('0x15')](md5Accounts[_0x5a796a])){md5Accounts[_0x5a796a]={};}var _0x37cb2a=md5(JSON['stringify'](_0x4dcd4b));if(md5Accounts[_0x5a796a]['md5']!==_0x37cb2a){md5Accounts[_0x5a796a]['md5']=_0x37cb2a;io[_0x4aa0('0xf')]('mailAccount:update',_0x4dcd4b);}};EmailChannel['prototype'][_0x4aa0('0x16')]=function(_0x387bee){for(var _0xb4f62 in _0x387bee){if(_0x387bee[_0x4aa0('0x17')](_0xb4f62)){if(_0x387bee[_0xb4f62][_0x4aa0('0x11')]&&_0x387bee[_0xb4f62][_0x4aa0('0x18')]){var _0x5ece24=_0x387bee[_0xb4f62][_0x4aa0('0x11')];if(!_0x5ece24[_0x4aa0('0x19')]&&_0x387bee[_0xb4f62][_0x4aa0('0x1a')]!==_0x4aa0('0x1b'))_0x5ece24[_0x4aa0('0x19')]=_0x387bee[_0xb4f62]['provider'];if(!this[_0x4aa0('0x1c')][_0x4aa0('0x17')](_0x5ece24['id'])){this[_0x4aa0('0x1c')][_0x5ece24['id']]=new EmailImap(_0x5ece24,_0x387bee[_0xb4f62][_0x4aa0('0x1d')]);this['imapAccounts'][_0x5ece24['id']]['on'](_0x4aa0('0x1e'),this['handleImapBox']['bind'](this,_0xb4f62));this[_0x4aa0('0x1c')][_0x5ece24['id']]['on'](_0x4aa0('0x1d'),this['handleImapEmail'][_0x4aa0('0x1f')](this,_0xb4f62));this[_0x4aa0('0x1c')][_0x5ece24['id']]['on'](_0x4aa0('0x20'),this[_0x4aa0('0x21')][_0x4aa0('0x1f')](this,_0xb4f62));this[_0x4aa0('0x1c')][_0x5ece24['id']]['on'](_0x4aa0('0x22'),this[_0x4aa0('0x23')][_0x4aa0('0x1f')](this,_0xb4f62));}}else{if(_['isNil'](this['mailAccounts'][_0xb4f62][_0x4aa0('0x11')])){this[_0x4aa0('0xd')][_0xb4f62][_0x4aa0('0x11')]={};}this['mailAccounts'][_0xb4f62]['Imap']['status']=_0x4aa0('0x24');this[_0x4aa0('0xd')][_0xb4f62][_0x4aa0('0x11')][_0x4aa0('0x13')]='';this[_0x4aa0('0xf')](_0xb4f62);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x5c71ca,_0x109b90){if(this['mailAccounts'][_0x5c71ca]){this[_0x4aa0('0xd')][_0x5c71ca]['Imap'][_0x4aa0('0x12')]='connected';this[_0x4aa0('0xd')][_0x5c71ca]['Imap']['messageStatus']=_0x109b90[_0x4aa0('0x25')];if(_0x109b90[_0x4aa0('0x26')]){this[_0x4aa0('0xd')][_0x5c71ca][_0x4aa0('0x11')][_0x4aa0('0x14')]=_0x109b90['messages']['total'];}return this[_0x4aa0('0xf')](_0x5c71ca);}};EmailChannel[_0x4aa0('0x27')][_0x4aa0('0x28')]=function(_0x5811b7,_0x3a2cfc){logger[_0x4aa0('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3a2cfc['firstName'],_0x3a2cfc[_0x4aa0('0x29')],_0x3a2cfc[_0x4aa0('0x2a')],_0x5811b7);if(this[_0x4aa0('0xd')][_0x5811b7]){return mailAccount[_0x4aa0('0x2b')](_0x5811b7,_0x3a2cfc)['then'](function(_0x44ccb7){if(_0x44ccb7){logger['info'](_0x4aa0('0x2c'));}})['catch'](function(_0xfa35fe){logger[_0x4aa0('0x22')](_0x4aa0('0x2d'),JSON[_0x4aa0('0x2e')](_0xfa35fe));});}};EmailChannel[_0x4aa0('0x27')]['handleImapEnd']=function(_0x37abcb){if(this[_0x4aa0('0xd')][_0x37abcb]&&this[_0x4aa0('0xd')][_0x37abcb][_0x4aa0('0x11')]){if(this[_0x4aa0('0x1c')][this[_0x4aa0('0xd')][_0x37abcb][_0x4aa0('0x11')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x37abcb][_0x4aa0('0x11')]['id']];}this[_0x4aa0('0xd')][_0x37abcb][_0x4aa0('0x11')][_0x4aa0('0x2f')]=moment();this[_0x4aa0('0xf')](_0x37abcb);}};EmailChannel['prototype'][_0x4aa0('0x23')]=function(_0x23ff1c,_0x46b057){if(this[_0x4aa0('0xd')][_0x23ff1c]){this[_0x4aa0('0xd')][_0x23ff1c][_0x4aa0('0x11')]['status']='error';this[_0x4aa0('0xd')][_0x23ff1c][_0x4aa0('0x11')][_0x4aa0('0x13')]=_0x46b057;return this['emit'](_0x23ff1c);}};EmailChannel['prototype'][_0x4aa0('0x30')]=function(_0x5a1199,_0x508e3d){return this[_0x4aa0('0xe')][_0x4aa0('0x31')](_0x5a1199,_0x508e3d);};EmailChannel[_0x4aa0('0x27')]['verifySmtp']=function(_0x5a6eb7){var _0x3251ec=this;if(this[_0x4aa0('0xd')][_0x5a6eb7['id']]){if(_[_0x4aa0('0x15')](this[_0x4aa0('0xd')][_0x5a6eb7['id']]['Smtp'])){this[_0x4aa0('0xd')][_0x5a6eb7['id']]['Smtp']={};}this['mailAccounts'][_0x5a6eb7['id']]['Smtp'][_0x4aa0('0x2f')]=moment();return new BPromise(function(_0x383891,_0x318ea6){return _0x3251ec[_0x4aa0('0xe')][_0x4aa0('0x32')](_0x5a6eb7)[_0x4aa0('0x33')](function(_0x18a23e){_0x3251ec['mailAccounts'][_0x5a6eb7['id']][_0x4aa0('0x34')][_0x4aa0('0x12')]=_0x4aa0('0x35');_0x3251ec[_0x4aa0('0xd')][_0x5a6eb7['id']][_0x4aa0('0x34')][_0x4aa0('0x13')]='';_0x3251ec[_0x4aa0('0xf')](_0x5a6eb7['id']);_0x383891(_0x18a23e);})['catch'](function(_0x262569){_0x3251ec['mailAccounts'][_0x5a6eb7['id']][_0x4aa0('0x34')]['status']='error';_0x3251ec['mailAccounts'][_0x5a6eb7['id']]['Smtp']['messageStatus']=_0x262569;_0x3251ec[_0x4aa0('0xf')](_0x5a6eb7['id']);_0x318ea6(_0x262569);});});}return this[_0x4aa0('0xe')][_0x4aa0('0x32')](_0x5a6eb7);};module[_0x4aa0('0x36')]=EmailChannel; \ No newline at end of file +var _0xdca1=['start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','stringify','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','imapAccounts','box','bind','end','handleImapEnd','status','disabled','handleImapBox','connected','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','then','verified','catch','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info'];(function(_0x32177b,_0x4ee567){var _0x5d6bca=function(_0x2bf86d){while(--_0x2bf86d){_0x32177b['push'](_0x32177b['shift']());}};_0x5d6bca(++_0x4ee567);}(_0xdca1,0x1f2));var _0x1dca=function(_0xc924ba,_0x42c52e){_0xc924ba=_0xc924ba-0x0;var _0x56d110=_0xdca1[_0xc924ba];return _0x56d110;};'use strict';var _=require(_0x1dca('0x0'));var moment=require('moment');var BPromise=require(_0x1dca('0x1'));var md5=require(_0x1dca('0x2'));var Redis=require(_0x1dca('0x3'));var config=require(_0x1dca('0x4'));var logger=require(_0x1dca('0x5'))(_0x1dca('0x6'));config[_0x1dca('0x7')]=_[_0x1dca('0x8')](config['redis'],{'host':_0x1dca('0x9'),'port':0x18eb});var io=require(_0x1dca('0xa'))(new Redis(config[_0x1dca('0x7')]));var EmailImap=require(_0x1dca('0xb'));var EmailSmtp=require(_0x1dca('0xc'));var mailAccount=require(_0x1dca('0xd'));var md5Accounts={};function EmailChannel(_0x3865c3){logger[_0x1dca('0xe')](_0x1dca('0xf'));this[_0x1dca('0x10')]=_0x3865c3[_0x1dca('0x10')];this['imapAccounts']={};this[_0x1dca('0x11')]=new EmailSmtp();}EmailChannel[_0x1dca('0x12')][_0x1dca('0x13')]=function(_0x5ced4f){var _0x532b80=this['mailAccounts'][_0x5ced4f];var _0x5a11d0={'id':_0x532b80['id'],'name':_0x532b80[_0x1dca('0x14')],'key':_0x532b80[_0x1dca('0x15')],'active':_0x532b80[_0x1dca('0x16')],'Imap':{'status':_0x532b80[_0x1dca('0x17')]['status'],'messageStatus':_0x532b80['Imap'][_0x1dca('0x18')],'total':_0x532b80[_0x1dca('0x17')]['total']}};if(_['isNil'](md5Accounts[_0x5ced4f])){md5Accounts[_0x5ced4f]={};}var _0x347630=md5(JSON[_0x1dca('0x19')](_0x5a11d0));if(md5Accounts[_0x5ced4f][_0x1dca('0x2')]!==_0x347630){md5Accounts[_0x5ced4f][_0x1dca('0x2')]=_0x347630;io['emit'](_0x1dca('0x1a'),_0x5a11d0);}};EmailChannel[_0x1dca('0x12')][_0x1dca('0x1b')]=function(_0x554821){for(var _0x4e2e77 in _0x554821){if(_0x554821[_0x1dca('0x1c')](_0x4e2e77)){if(_0x554821[_0x4e2e77][_0x1dca('0x17')]&&_0x554821[_0x4e2e77][_0x1dca('0x16')]){var _0x15685d=_0x554821[_0x4e2e77][_0x1dca('0x17')];if(!_0x15685d[_0x1dca('0x1d')]&&_0x554821[_0x4e2e77]['provider']!==_0x1dca('0x1e'))_0x15685d[_0x1dca('0x1d')]=_0x554821[_0x4e2e77][_0x1dca('0x1f')];if(!this[_0x1dca('0x20')][_0x1dca('0x1c')](_0x15685d['id'])){this[_0x1dca('0x20')][_0x15685d['id']]=new EmailImap(_0x15685d,_0x554821[_0x4e2e77][_0x1dca('0x6')]);this[_0x1dca('0x20')][_0x15685d['id']]['on'](_0x1dca('0x21'),this['handleImapBox'][_0x1dca('0x22')](this,_0x4e2e77));this['imapAccounts'][_0x15685d['id']]['on']('email',this['handleImapEmail']['bind'](this,_0x4e2e77));this[_0x1dca('0x20')][_0x15685d['id']]['on'](_0x1dca('0x23'),this[_0x1dca('0x24')][_0x1dca('0x22')](this,_0x4e2e77));this['imapAccounts'][_0x15685d['id']]['on']('error',this['handleImapError'][_0x1dca('0x22')](this,_0x4e2e77));}}else{if(_['isNil'](this[_0x1dca('0x10')][_0x4e2e77][_0x1dca('0x17')])){this[_0x1dca('0x10')][_0x4e2e77][_0x1dca('0x17')]={};}this[_0x1dca('0x10')][_0x4e2e77][_0x1dca('0x17')][_0x1dca('0x25')]=_0x1dca('0x26');this['mailAccounts'][_0x4e2e77][_0x1dca('0x17')][_0x1dca('0x18')]='';this['emit'](_0x4e2e77);}}}};EmailChannel[_0x1dca('0x12')][_0x1dca('0x27')]=function(_0x5cbc21,_0x283d1c){if(this[_0x1dca('0x10')][_0x5cbc21]){this[_0x1dca('0x10')][_0x5cbc21][_0x1dca('0x17')]['status']=_0x1dca('0x28');this[_0x1dca('0x10')][_0x5cbc21]['Imap']['messageStatus']=_0x283d1c['name'];if(_0x283d1c[_0x1dca('0x29')]){this[_0x1dca('0x10')][_0x5cbc21][_0x1dca('0x17')][_0x1dca('0x2a')]=_0x283d1c[_0x1dca('0x29')]['total'];}return this[_0x1dca('0x13')](_0x5cbc21);}};EmailChannel['prototype'][_0x1dca('0x2b')]=function(_0x214c3c,_0x6773e5){logger[_0x1dca('0xe')](_0x1dca('0x2c'),_0x6773e5[_0x1dca('0x2d')],_0x6773e5[_0x1dca('0x2e')],_0x6773e5['from'],_0x214c3c);if(this[_0x1dca('0x10')][_0x214c3c]){return mailAccount['notify'](_0x214c3c,_0x6773e5)['then'](function(_0x2375ca){if(_0x2375ca){logger[_0x1dca('0xe')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x106ce0){logger['error'](_0x1dca('0x2f'),JSON['stringify'](_0x106ce0));});}};EmailChannel[_0x1dca('0x12')]['handleImapEnd']=function(_0x14e8e7){if(this[_0x1dca('0x10')][_0x14e8e7]&&this['mailAccounts'][_0x14e8e7][_0x1dca('0x17')]){if(this[_0x1dca('0x20')][this['mailAccounts'][_0x14e8e7][_0x1dca('0x17')]['id']]){delete this['imapAccounts'][this[_0x1dca('0x10')][_0x14e8e7][_0x1dca('0x17')]['id']];}this[_0x1dca('0x10')][_0x14e8e7][_0x1dca('0x17')][_0x1dca('0x30')]=moment();this['emit'](_0x14e8e7);}};EmailChannel[_0x1dca('0x12')]['handleImapError']=function(_0x5e7afd,_0x25d0ab){if(this[_0x1dca('0x10')][_0x5e7afd]){this[_0x1dca('0x10')][_0x5e7afd][_0x1dca('0x17')]['status']='error';this['mailAccounts'][_0x5e7afd][_0x1dca('0x17')][_0x1dca('0x18')]=_0x25d0ab;return this[_0x1dca('0x13')](_0x5e7afd);}};EmailChannel[_0x1dca('0x12')]['sendMail']=function(_0x4bc4d3,_0x275aec){return this['smtp'][_0x1dca('0x31')](_0x4bc4d3,_0x275aec);};EmailChannel[_0x1dca('0x12')][_0x1dca('0x32')]=function(_0x5e0bd4){var _0x54187c=this;if(this['mailAccounts'][_0x5e0bd4['id']]){if(_['isNil'](this[_0x1dca('0x10')][_0x5e0bd4['id']][_0x1dca('0x33')])){this[_0x1dca('0x10')][_0x5e0bd4['id']][_0x1dca('0x33')]={};}this[_0x1dca('0x10')][_0x5e0bd4['id']][_0x1dca('0x33')][_0x1dca('0x30')]=moment();return new BPromise(function(_0x27415d,_0x5db15c){return _0x54187c[_0x1dca('0x11')][_0x1dca('0x34')](_0x5e0bd4)[_0x1dca('0x35')](function(_0x565aa5){_0x54187c[_0x1dca('0x10')][_0x5e0bd4['id']]['Smtp'][_0x1dca('0x25')]=_0x1dca('0x36');_0x54187c[_0x1dca('0x10')][_0x5e0bd4['id']][_0x1dca('0x33')][_0x1dca('0x18')]='';_0x54187c['emit'](_0x5e0bd4['id']);_0x27415d(_0x565aa5);})[_0x1dca('0x37')](function(_0x1385cb){_0x54187c[_0x1dca('0x10')][_0x5e0bd4['id']][_0x1dca('0x33')][_0x1dca('0x25')]='error';_0x54187c[_0x1dca('0x10')][_0x5e0bd4['id']][_0x1dca('0x33')][_0x1dca('0x18')]=_0x1385cb;_0x54187c[_0x1dca('0x13')](_0x5e0bd4['id']);_0x5db15c(_0x1385cb);});});}return this[_0x1dca('0x11')][_0x1dca('0x34')](_0x5e0bd4);};module[_0x1dca('0x38')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index ce0f94c..4d67fce 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 _0x8506=['imap','account','handleReady','bind','once','end','error','handleError','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','autotls','required','openBox','handleOpenBox','readUnseen','handleCloseBox','search','UNSEEN','fetch','message','handleFetchMessage','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','emit','handleFetchError','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','util','mailparser','iconv','events','EventEmitter','./utils','email','mailbox'];(function(_0x393ab2,_0x27f112){var _0x25821f=function(_0x486515){while(--_0x486515){_0x393ab2['push'](_0x393ab2['shift']());}};_0x25821f(++_0x27f112);}(_0x8506,0xe8));var _0x6850=function(_0x4ff782,_0x34ed81){_0x4ff782=_0x4ff782-0x0;var _0x379381=_0x8506[_0x4ff782];return _0x379381;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var Imap=require('imap');var simpleParser=require(_0x6850('0x1'))['simpleParser'];var Iconv=require(_0x6850('0x2'))['Iconv'];var EventEmitter=require(_0x6850('0x3'))[_0x6850('0x4')];var utils=require(_0x6850('0x5'));var logger=require('../../../config/logger')(_0x6850('0x6'));function EmailImap(_0x372f0b,_0x232459){this[_0x6850('0x7')]='INBOX';this['account']=this['getAccount'](_0x372f0b,_0x232459);this[_0x6850('0x8')]=new Imap(this[_0x6850('0x9')]);this[_0x6850('0x8')]['once']('ready',this[_0x6850('0xa')][_0x6850('0xb')](this));this[_0x6850('0x8')][_0x6850('0xc')](_0x6850('0xd'),this['handleEnd'][_0x6850('0xb')](this));this[_0x6850('0x8')]['on'](_0x6850('0xe'),this[_0x6850('0xf')][_0x6850('0xb')](this));this[_0x6850('0x8')]['connect']();}util[_0x6850('0x10')](EmailImap,EventEmitter);EmailImap[_0x6850('0x11')][_0x6850('0x12')]=function(_0x774bc5,_0x14c027){var _0x32e451={'connTimeout':_0x774bc5['connTimeout']?_0x774bc5[_0x6850('0x13')]*0x3e8:0x2710,'authTimeout':_0x774bc5['authTimeout']?_0x774bc5[_0x6850('0x14')]*0x3e8:0x1388};if(_0x774bc5[_0x6850('0x15')]){_0x32e451[_0x6850('0x16')]=_0x774bc5[_0x6850('0x16')];_0x32e451[_0x6850('0x6')]=_0x14c027||_0x774bc5[_0x6850('0x16')]||_0x6850('0x17');if(_0x774bc5[_0x6850('0x18')]){_0x32e451[_0x6850('0x19')]=utils[_0x6850('0x1a')](_0x774bc5[_0x6850('0x1b')][_0x6850('0x1c')],_0x774bc5[_0x6850('0x16')]);}else{_0x32e451[_0x6850('0x1d')]=_0x774bc5['password'];}}else{if(_0x774bc5['authentication']){_0x32e451[_0x6850('0x16')]=_0x774bc5[_0x6850('0x16')];_0x32e451[_0x6850('0x1d')]=_0x774bc5[_0x6850('0x1d')];}}_0x32e451[_0x6850('0x1e')]=_0x774bc5[_0x6850('0x1e')];_0x32e451['port']=_0x774bc5[_0x6850('0x1f')]||0x3e1;if(_0x774bc5[_0x6850('0x20')]){_0x32e451[_0x6850('0x20')]=!![];}else{_0x32e451[_0x6850('0x20')]=![];_0x32e451[_0x6850('0x21')]=_0x6850('0x22');}return _0x32e451;};EmailImap[_0x6850('0x11')][_0x6850('0xa')]=function(){this[_0x6850('0x8')][_0x6850('0x23')](this[_0x6850('0x7')],![],this[_0x6850('0x24')][_0x6850('0xb')](this));};EmailImap[_0x6850('0x11')][_0x6850('0x24')]=function(_0xeef1ff,_0x574bdd){if(_0xeef1ff){this[_0x6850('0xf')](_0xeef1ff,!![]);}else{this['emit']('box',_0x574bdd);this[_0x6850('0x25')]();}};EmailImap[_0x6850('0x11')][_0x6850('0x26')]=function(_0x2e68ac){if(_0x2e68ac){this['handleError'](_0x2e68ac,!![]);}else{this[_0x6850('0x8')][_0x6850('0xd')]();}};EmailImap['prototype'][_0x6850('0x25')]=function(){this[_0x6850('0x8')][_0x6850('0x27')]([_0x6850('0x28')],this['handleReadUnseen'][_0x6850('0xb')](this));};EmailImap[_0x6850('0x11')]['handleReadUnseen']=function(_0x5c3ff9,_0x2d0f95){if(_0x5c3ff9){this[_0x6850('0xf')](_0x5c3ff9,!![]);}else{if(_0x2d0f95['length']){try{var _0xc5d8a9=this[_0x6850('0x8')][_0x6850('0x29')](_0x2d0f95,{'bodies':'','markSeen':!![]});_0xc5d8a9['on'](_0x6850('0x2a'),this[_0x6850('0x2b')][_0x6850('0xb')](this));_0xc5d8a9[_0x6850('0xc')](_0x6850('0xe'),this['handleFetchError']['bind'](this));_0xc5d8a9[_0x6850('0xc')](_0x6850('0xd'),this[_0x6850('0x2c')][_0x6850('0xb')](this));}catch(_0x233d77){logger[_0x6850('0xe')](_0x233d77);}}else{this[_0x6850('0x8')]['closeBox'](!![],this[_0x6850('0x26')][_0x6850('0xb')](this));}}};EmailImap[_0x6850('0x11')][_0x6850('0x2b')]=function(_0x1f8d7e){_0x1f8d7e['on'](_0x6850('0x2d'),this[_0x6850('0x2e')][_0x6850('0xb')](this));_0x1f8d7e['once'](_0x6850('0x2f'),this[_0x6850('0x30')][_0x6850('0xb')](this));_0x1f8d7e['once'](_0x6850('0xd'),this['handleMessageEnd'][_0x6850('0xb')](this));};EmailImap[_0x6850('0x11')]['handleMessageBody']=function(_0x353331){simpleParser(_0x353331,{'Iconv':Iconv},this[_0x6850('0x31')][_0x6850('0xb')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0x6850('0x11')][_0x6850('0x32')]=function(){};EmailImap[_0x6850('0x11')]['handleSimpleParser']=function(_0x319c66,_0x4dbd7c){if(_0x319c66){logger[_0x6850('0xe')](_0x319c66);}else{var _0x54431e=this;utils[_0x6850('0x33')](this[_0x6850('0x9')],_0x4dbd7c,function(_0x1ea6bb){_0x54431e[_0x6850('0x34')](_0x6850('0x6'),_0x1ea6bb);});}};EmailImap['prototype'][_0x6850('0x2c')]=function(){this[_0x6850('0x8')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0x6850('0x35')]=function(_0x4d046e){this[_0x6850('0xf')](_0x4d046e);this['imap'][_0x6850('0x36')](!![],this[_0x6850('0x26')][_0x6850('0xb')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0x6850('0xd'));};EmailImap[_0x6850('0x11')][_0x6850('0xf')]=function(_0x39bc6a,_0x302d6a){logger[_0x6850('0xe')](_0x6850('0xf'),this[_0x6850('0x9')]['email'],JSON[_0x6850('0x37')](_0x39bc6a));var _0xb56173='';if(_0x39bc6a){if(_0x39bc6a[_0x6850('0x38')]){_0xb56173=_0x39bc6a[_0x6850('0x38')];}else{for(var _0x2f1654 in _0x39bc6a){if(_0x39bc6a[_0x6850('0x39')](_0x2f1654)){_0xb56173+=_[_0x6850('0x3a')](_0x2f1654)+':\x20'+_0x39bc6a[_0x2f1654]+'\x0a';}}}}if(_0x302d6a){this[_0x6850('0x8')][_0x6850('0xd')]();}else{this['emit'](_0x6850('0xe'),_0xb56173);this['emit'](_0x6850('0xd'));}};module[_0x6850('0x3b')]=EmailImap; \ No newline at end of file +var _0xfd2e=['handleEnd','error','handleError','inherits','connTimeout','authTimeout','service','user','email','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','prototype','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','exports','lodash','imap','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','account','once','ready','handleReady','bind','end'];(function(_0x2a7b0b,_0x3be307){var _0x3bca93=function(_0x20fcb8){while(--_0x20fcb8){_0x2a7b0b['push'](_0x2a7b0b['shift']());}};_0x3bca93(++_0x3be307);}(_0xfd2e,0x6e));var _0xefd2=function(_0x487b34,_0x55f1ba){_0x487b34=_0x487b34-0x0;var _0x469b66=_0xfd2e[_0x487b34];return _0x469b66;};'use strict';var _=require(_0xefd2('0x0'));var util=require('util');var Imap=require(_0xefd2('0x1'));var simpleParser=require('mailparser')[_0xefd2('0x2')];var Iconv=require('iconv')[_0xefd2('0x3')];var EventEmitter=require(_0xefd2('0x4'))[_0xefd2('0x5')];var utils=require(_0xefd2('0x6'));var logger=require(_0xefd2('0x7'))('email');function EmailImap(_0x5124c6,_0x40e76c){this['mailbox']='INBOX';this[_0xefd2('0x8')]=this['getAccount'](_0x5124c6,_0x40e76c);this[_0xefd2('0x1')]=new Imap(this[_0xefd2('0x8')]);this[_0xefd2('0x1')][_0xefd2('0x9')](_0xefd2('0xa'),this[_0xefd2('0xb')][_0xefd2('0xc')](this));this['imap'][_0xefd2('0x9')](_0xefd2('0xd'),this[_0xefd2('0xe')][_0xefd2('0xc')](this));this[_0xefd2('0x1')]['on'](_0xefd2('0xf'),this[_0xefd2('0x10')][_0xefd2('0xc')](this));this['imap']['connect']();}util[_0xefd2('0x11')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x87493c,_0x2b4d24){var _0x1150ec={'connTimeout':_0x87493c[_0xefd2('0x12')]?_0x87493c[_0xefd2('0x12')]*0x3e8:0x2710,'authTimeout':_0x87493c['authTimeout']?_0x87493c[_0xefd2('0x13')]*0x3e8:0x1388};if(_0x87493c[_0xefd2('0x14')]){_0x1150ec[_0xefd2('0x15')]=_0x87493c[_0xefd2('0x15')];_0x1150ec[_0xefd2('0x16')]=_0x2b4d24||_0x87493c[_0xefd2('0x15')]||'anonymous@xcally.com';if(_0x87493c['modernAuthentication']){_0x1150ec[_0xefd2('0x17')]=utils[_0xefd2('0x18')](_0x87493c[_0xefd2('0x19')][_0xefd2('0x1a')],_0x87493c[_0xefd2('0x15')]);}else{_0x1150ec['password']=_0x87493c[_0xefd2('0x1b')];}}else{if(_0x87493c[_0xefd2('0x1c')]){_0x1150ec[_0xefd2('0x15')]=_0x87493c[_0xefd2('0x15')];_0x1150ec['password']=_0x87493c[_0xefd2('0x1b')];}}_0x1150ec[_0xefd2('0x1d')]=_0x87493c[_0xefd2('0x1d')];_0x1150ec[_0xefd2('0x1e')]=_0x87493c['port']||0x3e1;if(_0x87493c[_0xefd2('0x1f')]){_0x1150ec[_0xefd2('0x1f')]=!![];}else{_0x1150ec[_0xefd2('0x1f')]=![];_0x1150ec[_0xefd2('0x20')]=_0xefd2('0x21');}return _0x1150ec;};EmailImap[_0xefd2('0x22')][_0xefd2('0xb')]=function(){this['imap']['openBox'](this[_0xefd2('0x23')],![],this[_0xefd2('0x24')][_0xefd2('0xc')](this));};EmailImap[_0xefd2('0x22')][_0xefd2('0x24')]=function(_0x470684,_0x42e4e6){if(_0x470684){this[_0xefd2('0x10')](_0x470684,!![]);}else{this[_0xefd2('0x25')](_0xefd2('0x26'),_0x42e4e6);this[_0xefd2('0x27')]();}};EmailImap['prototype'][_0xefd2('0x28')]=function(_0x37feb6){if(_0x37feb6){this[_0xefd2('0x10')](_0x37feb6,!![]);}else{this[_0xefd2('0x1')][_0xefd2('0xd')]();}};EmailImap[_0xefd2('0x22')][_0xefd2('0x27')]=function(){this['imap'][_0xefd2('0x29')]([_0xefd2('0x2a')],this[_0xefd2('0x2b')][_0xefd2('0xc')](this));};EmailImap[_0xefd2('0x22')]['handleReadUnseen']=function(_0x315f58,_0x328714){if(_0x315f58){this['handleError'](_0x315f58,!![]);}else{if(_0x328714[_0xefd2('0x2c')]){try{var _0xaccd28=this[_0xefd2('0x1')][_0xefd2('0x2d')](_0x328714,{'bodies':'','markSeen':!![]});_0xaccd28['on'](_0xefd2('0x2e'),this[_0xefd2('0x2f')][_0xefd2('0xc')](this));_0xaccd28[_0xefd2('0x9')](_0xefd2('0xf'),this[_0xefd2('0x30')][_0xefd2('0xc')](this));_0xaccd28['once'](_0xefd2('0xd'),this[_0xefd2('0x31')][_0xefd2('0xc')](this));}catch(_0x25d94d){logger[_0xefd2('0xf')](_0x25d94d);}}else{this[_0xefd2('0x1')][_0xefd2('0x32')](!![],this[_0xefd2('0x28')][_0xefd2('0xc')](this));}}};EmailImap[_0xefd2('0x22')][_0xefd2('0x2f')]=function(_0x59edc7){_0x59edc7['on'](_0xefd2('0x33'),this[_0xefd2('0x34')]['bind'](this));_0x59edc7[_0xefd2('0x9')](_0xefd2('0x35'),this['handleMessageAttributes']['bind'](this));_0x59edc7[_0xefd2('0x9')]('end',this[_0xefd2('0x36')][_0xefd2('0xc')](this));};EmailImap[_0xefd2('0x22')][_0xefd2('0x34')]=function(_0x19ea27){simpleParser(_0x19ea27,{'Iconv':Iconv},this['handleSimpleParser'][_0xefd2('0xc')](this));};EmailImap[_0xefd2('0x22')][_0xefd2('0x37')]=function(){};EmailImap[_0xefd2('0x22')][_0xefd2('0x36')]=function(){};EmailImap[_0xefd2('0x22')][_0xefd2('0x38')]=function(_0x284594,_0x304437){if(_0x284594){logger[_0xefd2('0xf')](_0x284594);}else{var _0x470d7f=this;utils[_0xefd2('0x39')](this[_0xefd2('0x8')],_0x304437,function(_0x19bb1e){_0x470d7f[_0xefd2('0x25')](_0xefd2('0x16'),_0x19bb1e);});}};EmailImap[_0xefd2('0x22')][_0xefd2('0x31')]=function(){this[_0xefd2('0x1')][_0xefd2('0x32')](!![],this[_0xefd2('0x28')]['bind'](this));};EmailImap[_0xefd2('0x22')]['handleFetchError']=function(_0x46495b){this['handleError'](_0x46495b);this['imap'][_0xefd2('0x32')](!![],this[_0xefd2('0x28')][_0xefd2('0xc')](this));};EmailImap[_0xefd2('0x22')][_0xefd2('0xe')]=function(){this['emit']('end');};EmailImap[_0xefd2('0x22')]['handleError']=function(_0x23dbee,_0x1b0062){logger['error'](_0xefd2('0x10'),this[_0xefd2('0x8')][_0xefd2('0x16')],JSON[_0xefd2('0x3a')](_0x23dbee));var _0x57e3ac='';if(_0x23dbee){if(_0x23dbee[_0xefd2('0x3b')]){_0x57e3ac=_0x23dbee[_0xefd2('0x3b')];}else{for(var _0x56a891 in _0x23dbee){if(_0x23dbee[_0xefd2('0x3c')](_0x56a891)){_0x57e3ac+=_['upperFirst'](_0x56a891)+':\x20'+_0x23dbee[_0x56a891]+'\x0a';}}}}if(_0x1b0062){this[_0xefd2('0x1')]['end']();}else{this['emit'](_0xefd2('0xf'),_0x57e3ac);this[_0xefd2('0x25')]('end');}};module[_0xefd2('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 e33898a..d345291 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 _0x3ee4=['verify','createTransport','toString','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','use','compile','sendMail'];(function(_0x32342f,_0x2575b7){var _0x5ba070=function(_0x153cf7){while(--_0x153cf7){_0x32342f['push'](_0x32342f['shift']());}};_0x5ba070(++_0x2575b7);}(_0x3ee4,0x163));var _0x43ee=function(_0x29147d,_0x300536){_0x29147d=_0x29147d-0x0;var _0x7bce97=_0x3ee4[_0x29147d];return _0x7bce97;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x43ee('0x0'));function EmailSmtp(){}EmailSmtp[_0x43ee('0x1')]['send']=function(_0x291345,_0x1dbb8d){return new Promise(function(_0xadadc9,_0x1a0999){var _0x687dc7=nodemailer['createTransport'](_0x291345);_0x687dc7[_0x43ee('0x2')](_0x43ee('0x3'),inlineBase64());_0x687dc7[_0x43ee('0x4')](_0x1dbb8d,function(_0x13973d,_0x331a31){if(_0x13973d){_0x1a0999(_0x13973d['toString']());}else{_0xadadc9(_0x331a31);}});});};EmailSmtp[_0x43ee('0x1')][_0x43ee('0x5')]=function(_0x4ab1ea){return new Promise(function(_0x34cc85,_0xf2c950){var _0x35826c=nodemailer[_0x43ee('0x6')](_0x4ab1ea);_0x35826c[_0x43ee('0x5')](function(_0x373a81,_0xdcfa0f){if(_0x373a81){_0xf2c950(_0x373a81[_0x43ee('0x7')]());}else{if(_0xdcfa0f){_0x34cc85(_0xdcfa0f);}else{_0xf2c950(_0x43ee('0x8'));}}});});};module[_0x43ee('0x9')]=EmailSmtp; \ No newline at end of file +var _0xf134=['compile','sendMail','toString','verify','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x359040,_0x26cf83){var _0x250f06=function(_0x5652f6){while(--_0x5652f6){_0x359040['push'](_0x359040['shift']());}};_0x250f06(++_0x26cf83);}(_0xf134,0xee));var _0x4f13=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xf134[_0x2e4aa2];return _0x5e6092;};'use strict';var nodemailer=require(_0x4f13('0x0'));var inlineBase64=require(_0x4f13('0x1'));function EmailSmtp(){}EmailSmtp[_0x4f13('0x2')][_0x4f13('0x3')]=function(_0x273294,_0xdee3ad){return new Promise(function(_0x32cea3,_0x28ab85){var _0x208560=nodemailer[_0x4f13('0x4')](_0x273294);_0x208560['use'](_0x4f13('0x5'),inlineBase64());_0x208560[_0x4f13('0x6')](_0xdee3ad,function(_0x4d7a87,_0x3e9406){if(_0x4d7a87){_0x28ab85(_0x4d7a87[_0x4f13('0x7')]());}else{_0x32cea3(_0x3e9406);}});});};EmailSmtp[_0x4f13('0x2')][_0x4f13('0x8')]=function(_0x25ba7f){return new Promise(function(_0x518059,_0x30feac){var _0x427fa8=nodemailer['createTransport'](_0x25ba7f);_0x427fa8[_0x4f13('0x8')](function(_0x1cc5ea,_0x36adaa){if(_0x1cc5ea){_0x30feac(_0x1cc5ea[_0x4f13('0x7')]());}else{if(_0x36adaa){_0x518059(_0x36adaa);}else{_0x30feac('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 9d76baa..c312a45 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 _0xd4e9=['parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','utf-8','base64','path','util','node-tnef','../../../config/logger','email','value','address','anonymous','generate','head','name','substring','indexOf','split','slice','join','Anonymous','pop','length','isEmpty','@xcally.com','html','replace','attachments','forEach','push','filename','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','bcc','attachment-','format','%s-%s','now','root','server/files/attachments/','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply'];(function(_0x3d0f0d,_0x43c450){var _0x60ce82=function(_0x33eaa9){while(--_0x33eaa9){_0x3d0f0d['push'](_0x3d0f0d['shift']());}};_0x60ce82(++_0x43c450);}(_0xd4e9,0xdf));var _0x9d4e=function(_0x4dc99d,_0x4bbe75){_0x4dc99d=_0x4dc99d-0x0;var _0x5ea055=_0xd4e9[_0x4dc99d];return _0x5ea055;};'use strict';var _=require('lodash');var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x9d4e('0x0'));var util=require(_0x9d4e('0x1'));var tnef=require(_0x9d4e('0x2'));var logger=require(_0x9d4e('0x3'))(_0x9d4e('0x4'));var config=require('../../../config/environment');function getAddress(_0x18eefa){var _0xcf05c4=_['head'](_0x18eefa[_0x9d4e('0x5')]);return _0xcf05c4&&_0xcf05c4[_0x9d4e('0x6')]?_0xcf05c4[_0x9d4e('0x6')]:_0x9d4e('0x7')+random[_0x9d4e('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x5531b0){var _0x40e084=_[_0x9d4e('0x9')](_0x5531b0['value']);if(_0x40e084&&_0x40e084[_0x9d4e('0xa')]){if(_0x40e084['name']==_0x40e084[_0x9d4e('0x6')]){return _0x40e084['name'][_0x9d4e('0xb')](0x0,_0x40e084[_0x9d4e('0xa')][_0x9d4e('0xc')]('@'));}var _0x5cfb0b=_0x40e084['name'][_0x9d4e('0xd')](/\s+/);return _0x5cfb0b['length']>0x1?_0x5cfb0b[_0x9d4e('0xe')](0x0,-0x1)[_0x9d4e('0xf')]('\x20'):_0x40e084['name'];}return _0x9d4e('0x10');}function getLastName(_0x10a9a5){var _0x4d092c=_[_0x9d4e('0x9')](_0x10a9a5[_0x9d4e('0x5')]);if(_0x4d092c&&_0x4d092c[_0x9d4e('0xa')]){var _0x4052d0=_0x4d092c['name'][_0x9d4e('0xd')](/\s+/);return _0x4052d0['length']>0x1?_0x4052d0[_0x9d4e('0x11')]():'';}return'';}function getMails(_0x4f32f9,_0xdb1eb8){var _0x56c7b7='';for(var _0x5887cd=0x0;_0x5887cd<_0xdb1eb8[_0x9d4e('0x5')][_0x9d4e('0x12')];_0x5887cd+=0x1){if(_0xdb1eb8['value'][_0x5887cd]['address']!==_0x4f32f9){if(!_[_0x9d4e('0x13')](_0x56c7b7)){_0x56c7b7+=',';}_0x56c7b7+=_0xdb1eb8[_0x9d4e('0x5')][_0x5887cd]['name']||_0xdb1eb8[_0x9d4e('0x5')][_0x5887cd]['address']||'';_0x56c7b7+='\x20<';_0x56c7b7+=_0xdb1eb8[_0x9d4e('0x5')][_0x5887cd][_0x9d4e('0x6')]?_0xdb1eb8[_0x9d4e('0x5')][_0x5887cd][_0x9d4e('0x6')]:_0x9d4e('0x7')+random[_0x9d4e('0x8')](0x6)+_0x9d4e('0x14');_0x56c7b7+='>';}}return _0x56c7b7;}function parseEmail(_0x53b1eb,_0x1b8552,_0x50c662){if(_0x1b8552['html']){var _0x108c6c=/)<[^<]*)*<\/script>/gi;while(_0x108c6c['test'](_0x1b8552[_0x9d4e('0x15')])){_0x1b8552['html']=_0x1b8552['html'][_0x9d4e('0x16')](_0x108c6c,'');}if(_0x1b8552[_0x9d4e('0x15')]['includes']('{_0x4f4cc6[_0x9d4e('0x19')](_0x4bd1aa[_0x9d4e('0x1a')]);});var _0x369429=/]+>/g;var _0x5e0706=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x10ef3d=_0x1b8552[_0x9d4e('0x15')][_0x9d4e('0x16')](_0x5e0706,'_SRC');var _0x27c464=_0x10ef3d[_0x9d4e('0x16')](_0x369429,_0x9d4e('0x1b'));for(let _0x304b4c=0x0;_0x304b4c<_0x4f4cc6[_0x9d4e('0x12')];_0x304b4c++){var _0x321dc1=_0x27c464[_0x9d4e('0x16')](_0x9d4e('0x1b'),_0x9d4e('0x1c')+_0x4f4cc6[_0x304b4c]+_0x9d4e('0x1d'));_0x27c464=_0x321dc1;}_0x1b8552['html']=_0x27c464;}_0x50c662[_0x9d4e('0x1e')]=_0x1b8552[_0x9d4e('0x15')];}else{_0x50c662[_0x9d4e('0x1e')]=_0x1b8552[_0x9d4e('0x1f')];}if(_0x50c662['body']){_0x50c662[_0x9d4e('0x1e')]=_0x50c662[_0x9d4e('0x1e')][_0x9d4e('0x16')](/0x0){var _0x1ef3bd=[_0x9d4e('0x2d'),'X-Auto-Response-Suppress:\x20All',_0x9d4e('0x2e')];for(var _0x15f08f=0x0;_0x15f08f<_0x1b8552[_0x9d4e('0x2c')][_0x9d4e('0x12')];_0x15f08f++){var _0x221655=_[_0x9d4e('0xc')](_0x1ef3bd,_0x1b8552[_0x9d4e('0x2c')][_0x15f08f][_0x9d4e('0x2f')]);if(_0x221655>=0x0){_0x50c662[_0x9d4e('0x30')]=!![];}}}return _0x50c662;}exports[_0x9d4e('0x31')]=function(_0x4a9a75,_0x49c299,_0x13ef94){var _0x30c3e4={'from':getAddress(_0x49c299[_0x9d4e('0x32')]),'firstName':getFirstName(_0x49c299[_0x9d4e('0x32')]),'lastName':getLastName(_0x49c299[_0x9d4e('0x32')]),'mapKey':_0x9d4e('0x4'),'message':{'from':getMails(_0x4a9a75[_0x9d4e('0x4')],_0x49c299[_0x9d4e('0x32')]),'to':_0x4a9a75[_0x9d4e('0x4')],'cc':'','subject':_0x49c299[_0x9d4e('0x33')]||'','messageId':_0x49c299[_0x9d4e('0x34')],'inReplyTo':_0x49c299[_0x9d4e('0x35')],'sentAt':moment(_0x49c299[_0x9d4e('0x36')])[_0x9d4e('0x25')](_0x9d4e('0x37')),'attach':![],'attachments':[]}};if(!_0x49c299['html']&&!_0x49c299[_0x9d4e('0x1f')]){var _0x1d3d4f=_[_0x9d4e('0x38')](_0x49c299[_0x9d4e('0x17')],{'contentType':_0x9d4e('0x39')});if(_0x1d3d4f[_0x9d4e('0x12')]){logger['info'](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x49c299[_0x9d4e('0x34')]));tnef[_0x9d4e('0x3a')](_[_0x9d4e('0x3b')](_0x1d3d4f)[_0x9d4e('0x2a')],function(_0x5f4eec,_0xab081d){if(_0xab081d){_0x49c299[_0x9d4e('0x15')]=_0xab081d[_0x9d4e('0x3c')]||_0x9d4e('0x3d');if(_0xab081d[_0x9d4e('0x3e')]){for(var _0x53c735=0x0;_0x53c735<_0xab081d[_0x9d4e('0x3e')][_0x9d4e('0x12')];_0x53c735++){var _0x3b43cf=_0xab081d[_0x9d4e('0x3e')][_0x53c735];_0x30c3e4[_0x9d4e('0x20')][_0x9d4e('0x17')][_0x9d4e('0x19')]({'filename':_0x3b43cf[_0x9d4e('0x3f')],'content':Buffer[_0x9d4e('0x32')](_0x3b43cf['Data'])});}}}_0x13ef94(parseEmail(_0x4a9a75,_0x49c299,_0x30c3e4));});}else{_0x49c299[_0x9d4e('0x15')]=_0x9d4e('0x3d');_0x13ef94(parseEmail(_0x4a9a75,_0x49c299,_0x30c3e4));}}else{_0x13ef94(parseEmail(_0x4a9a75,_0x49c299,_0x30c3e4));}};exports[_0x9d4e('0x40')]=function(_0x307cfb,_0x38682c){var _0x31f820=[_0x9d4e('0x41')+(_0x38682c||''),'auth=Bearer\x20'+_0x307cfb,'',''];return Buffer[_0x9d4e('0x32')](_0x31f820[_0x9d4e('0xf')](''),_0x9d4e('0x42'))['toString'](_0x9d4e('0x43'));}; \ No newline at end of file +var _0x88fe=['inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','generateXOAuth2Token','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice','join','Anonymous','length','pop','isEmpty','html','\x20[Attachment:\x20','\x20]','body','0x1?_0xf95c9c[_0xe88f('0x12')](0x0,-0x1)[_0xe88f('0x13')]('\x20'):_0x2b930f[_0xe88f('0xe')];}return _0xe88f('0x14');}function getLastName(_0x5a1ea7){var _0x19f881=_['head'](_0x5a1ea7[_0xe88f('0x9')]);if(_0x19f881&&_0x19f881[_0xe88f('0xe')]){var _0x52fd11=_0x19f881['name'][_0xe88f('0x11')](/\s+/);return _0x52fd11[_0xe88f('0x15')]>0x1?_0x52fd11[_0xe88f('0x16')]():'';}return'';}function getMails(_0x171f39,_0x4bd871){var _0x2e3113='';for(var _0x11590e=0x0;_0x11590e<_0x4bd871[_0xe88f('0x9')][_0xe88f('0x15')];_0x11590e+=0x1){if(_0x4bd871[_0xe88f('0x9')][_0x11590e][_0xe88f('0xa')]!==_0x171f39){if(!_[_0xe88f('0x17')](_0x2e3113)){_0x2e3113+=',';}_0x2e3113+=_0x4bd871['value'][_0x11590e][_0xe88f('0xe')]||_0x4bd871[_0xe88f('0x9')][_0x11590e][_0xe88f('0xa')]||'';_0x2e3113+='\x20<';_0x2e3113+=_0x4bd871[_0xe88f('0x9')][_0x11590e][_0xe88f('0xa')]?_0x4bd871[_0xe88f('0x9')][_0x11590e][_0xe88f('0xa')]:'anonymous'+random[_0xe88f('0xc')](0x6)+_0xe88f('0xd');_0x2e3113+='>';}}return _0x2e3113;}function parseEmail(_0x567175,_0x1a88f7,_0x19a141){if(_0x1a88f7[_0xe88f('0x18')]){var _0x4d7a40=/)<[^<]*)*<\/script>/gi;while(_0x4d7a40['test'](_0x1a88f7[_0xe88f('0x18')])){_0x1a88f7[_0xe88f('0x18')]=_0x1a88f7[_0xe88f('0x18')]['replace'](_0x4d7a40,'');}if(_0x1a88f7[_0xe88f('0x18')]['includes'](_0xe88f('0x19'))){var _0x3dbd67=[];_0x1a88f7[_0xe88f('0x1a')][_0xe88f('0x1b')](_0x3bf593=>{_0x3dbd67[_0xe88f('0x1c')](_0x3bf593['filename']);});var _0x4bdf78=/]+>/g;var _0x2e58d3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5e1912=_0x1a88f7[_0xe88f('0x18')][_0xe88f('0x1d')](_0x2e58d3,_0xe88f('0x1e'));var _0x2206dc=_0x5e1912[_0xe88f('0x1d')](_0x4bdf78,'_IMG');for(let _0x2cee55=0x0;_0x2cee55<_0x3dbd67['length'];_0x2cee55++){var _0x3bf8d8=_0x2206dc['replace'](_0xe88f('0x1f'),_0xe88f('0x20')+_0x3dbd67[_0x2cee55]+_0xe88f('0x21'));_0x2206dc=_0x3bf8d8;}_0x1a88f7['html']=_0x2206dc;}_0x19a141[_0xe88f('0x22')]=_0x1a88f7[_0xe88f('0x18')];}else{_0x19a141[_0xe88f('0x22')]=_0x1a88f7['textAsHtml'];}if(_0x19a141[_0xe88f('0x22')]){_0x19a141['body']=_0x19a141[_0xe88f('0x22')][_0xe88f('0x1d')](/0x0){var _0x37690f=[_0xe88f('0x35'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x41f80e=0x0;_0x41f80e<_0x1a88f7['headerLines'][_0xe88f('0x15')];_0x41f80e++){var _0x11824e=_['indexOf'](_0x37690f,_0x1a88f7[_0xe88f('0x34')][_0x41f80e][_0xe88f('0x36')]);if(_0x11824e>=0x0){_0x19a141[_0xe88f('0x37')]=!![];}}}return _0x19a141;}exports[_0xe88f('0x38')]=function(_0x4f6899,_0x55a208,_0x66820){var _0x48aa1c={'from':getAddress(_0x55a208[_0xe88f('0x39')]),'firstName':getFirstName(_0x55a208[_0xe88f('0x39')]),'lastName':getLastName(_0x55a208['from']),'mapKey':_0xe88f('0x7'),'message':{'from':getMails(_0x4f6899['email'],_0x55a208[_0xe88f('0x39')]),'to':_0x4f6899[_0xe88f('0x7')],'cc':'','subject':_0x55a208[_0xe88f('0x3a')]||'','messageId':_0x55a208[_0xe88f('0x3b')],'inReplyTo':_0x55a208[_0xe88f('0x3c')],'sentAt':moment(_0x55a208[_0xe88f('0x3d')])[_0xe88f('0x2e')](_0xe88f('0x3e')),'attach':![],'attachments':[]}};if(!_0x55a208[_0xe88f('0x18')]&&!_0x55a208['textAsHtml']){var _0x3cf897=_['filter'](_0x55a208[_0xe88f('0x1a')],{'contentType':'application/ms-tnef'});if(_0x3cf897[_0xe88f('0x15')]){logger[_0xe88f('0x3f')](util[_0xe88f('0x2e')](_0xe88f('0x40'),_0x55a208['messageId']));tnef[_0xe88f('0x41')](_[_0xe88f('0x42')](_0x3cf897)[_0xe88f('0x32')],function(_0x9e9fc9,_0x3c6cf6){if(_0x3c6cf6){_0x55a208['html']=_0x3c6cf6[_0xe88f('0x43')]||_0xe88f('0x44');if(_0x3c6cf6['Attachments']){for(var _0x1f99ad=0x0;_0x1f99ad<_0x3c6cf6['Attachments'][_0xe88f('0x15')];_0x1f99ad++){var _0x49ad57=_0x3c6cf6[_0xe88f('0x45')][_0x1f99ad];_0x48aa1c[_0xe88f('0x25')][_0xe88f('0x1a')]['push']({'filename':_0x49ad57[_0xe88f('0x46')],'content':Buffer[_0xe88f('0x39')](_0x49ad57['Data'])});}}}_0x66820(parseEmail(_0x4f6899,_0x55a208,_0x48aa1c));});}else{_0x55a208['html']='

Empty\x20message

';_0x66820(parseEmail(_0x4f6899,_0x55a208,_0x48aa1c));}}else{_0x66820(parseEmail(_0x4f6899,_0x55a208,_0x48aa1c));}};exports[_0xe88f('0x47')]=function(_0x2e7bcb,_0x267311){var _0x5ee01c=['user='+(_0x267311||''),_0xe88f('0x48')+_0x2e7bcb,'',''];return Buffer[_0xe88f('0x39')](_0x5ee01c[_0xe88f('0x13')](''),'utf-8')[_0xe88f('0x49')](_0xe88f('0x4a'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 60dc7c9..b704043 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 _0xef9a=['name','key','active','Imap','Smtp','exports','lodash'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xef9a,0x12c));var _0xaef9=function(_0x9e7c79,_0x2ba070){_0x9e7c79=_0x9e7c79-0x0;var _0x3aa8f1=_0xef9a[_0x9e7c79];return _0x3aa8f1;};'use strict';var _=require(_0xaef9('0x0'));function MailAccount(_0x297fdf){this['id']=_0x297fdf['id']||0x0;this['name']=_0x297fdf[_0xaef9('0x1')]||'Service';this[_0xaef9('0x2')]=_0x297fdf[_0xaef9('0x2')]||'SERV';this[_0xaef9('0x3')]=_0x297fdf[_0xaef9('0x3')]||![];this[_0xaef9('0x4')]=_0x297fdf[_0xaef9('0x4')]||[];this[_0xaef9('0x5')]=_0x297fdf[_0xaef9('0x5')]||[];}module[_0xaef9('0x6')]=MailAccount; \ No newline at end of file +var _0x26fa=['Smtp','name','Service','key','active','Imap'];(function(_0x42544b,_0xd0d2de){var _0x32e22c=function(_0x5deb61){while(--_0x5deb61){_0x42544b['push'](_0x42544b['shift']());}};_0x32e22c(++_0xd0d2de);}(_0x26fa,0x9d));var _0xa26f=function(_0x355081,_0x1ab016){_0x355081=_0x355081-0x0;var _0x399f28=_0x26fa[_0x355081];return _0x399f28;};'use strict';var _=require('lodash');function MailAccount(_0x153736){this['id']=_0x153736['id']||0x0;this[_0xa26f('0x0')]=_0x153736[_0xa26f('0x0')]||_0xa26f('0x1');this[_0xa26f('0x2')]=_0x153736[_0xa26f('0x2')]||'SERV';this[_0xa26f('0x3')]=_0x153736['active']||![];this[_0xa26f('0x4')]=_0x153736[_0xa26f('0x4')]||[];this[_0xa26f('0x5')]=_0x153736[_0xa26f('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 8865323..f6f11e0 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 _0xe4cf=['hasOwnProperty','prototype','initMailAccounts','length','isUndefined','exports','lodash','mailAccounts','mapKeys'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe4cf,0x153));var _0xfe4c=function(_0x131acf,_0x4b4597){_0x131acf=_0x131acf-0x0;var _0x40d32e=_0xe4cf[_0x131acf];return _0x40d32e;};'use strict';var _=require(_0xfe4c('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xfe4c('0x1')]={};};function freeIsNotKey(_0x4d06c2,_0x3a73f3,_0x108b64){var _0x3dcd1f=_[_0xfe4c('0x2')](_0x4d06c2,function(_0x369970,_0x157012){return _0x369970[_0x108b64];});for(var _0xb0a8fa in _0x3a73f3){if(_0x3a73f3[_0xfe4c('0x3')](_0xb0a8fa)){if(!_0x3dcd1f[_0xb0a8fa]){delete _0x3a73f3[_0xb0a8fa];}}}}Realtime[_0xfe4c('0x4')]['mergeFromDatabase']=function(_0x38cb8e,_0x313e57){for(var _0x16aa7a in _0x313e57){if(_0x38cb8e[_0xfe4c('0x3')](_0x16aa7a)){_0x38cb8e[_0x16aa7a]=_0x313e57[_0x16aa7a];}}};Realtime[_0xfe4c('0x4')][_0xfe4c('0x5')]=function(){var _0x269bf5=this;return function(_0x58f5cc){if(_0x58f5cc){freeIsNotKey(_0x58f5cc,_0x269bf5['mailAccounts'],'id');for(var _0x51c858=0x0,_0x191e2e={},_0xefc9c0={};_0x51c858<_0x58f5cc[_0xfe4c('0x6')];_0x51c858+=0x1){_0x191e2e=_0x58f5cc[_0x51c858];if(_[_0xfe4c('0x7')](_0x269bf5['mailAccounts'][_0x191e2e['id']])){_0x269bf5['mailAccounts'][_0x191e2e['id']]=new MailAccount(_0x191e2e);}else{_['merge'](_0x269bf5[_0xfe4c('0x1')][_0x191e2e['id']],_0x191e2e);}}}return _0x269bf5['mailAccounts'];};};module[_0xfe4c('0x8')]=Realtime; \ No newline at end of file +var _0xb249=['length','merge','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','mergeFromDatabase','initMailAccounts','mailAccounts'];(function(_0x4ca448,_0x55a44f){var _0x28803d=function(_0x49dc44){while(--_0x49dc44){_0x4ca448['push'](_0x4ca448['shift']());}};_0x28803d(++_0x55a44f);}(_0xb249,0x107));var _0x9b24=function(_0x276534,_0xa635a9){_0x276534=_0x276534-0x0;var _0x252114=_0xb249[_0x276534];return _0x252114;};'use strict';var _=require(_0x9b24('0x0'));var MailAccount=require(_0x9b24('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x342b70,_0x41f92c,_0x3e3bc4){var _0x437cfa=_[_0x9b24('0x2')](_0x342b70,function(_0x24a7f6,_0x2d4c15){return _0x24a7f6[_0x3e3bc4];});for(var _0x1c63a0 in _0x41f92c){if(_0x41f92c[_0x9b24('0x3')](_0x1c63a0)){if(!_0x437cfa[_0x1c63a0]){delete _0x41f92c[_0x1c63a0];}}}}Realtime['prototype'][_0x9b24('0x4')]=function(_0x2ec997,_0xb8c7d9){for(var _0x4e2da2 in _0xb8c7d9){if(_0x2ec997[_0x9b24('0x3')](_0x4e2da2)){_0x2ec997[_0x4e2da2]=_0xb8c7d9[_0x4e2da2];}}};Realtime['prototype'][_0x9b24('0x5')]=function(){var _0x23b662=this;return function(_0x52f5e4){if(_0x52f5e4){freeIsNotKey(_0x52f5e4,_0x23b662[_0x9b24('0x6')],'id');for(var _0x45388f=0x0,_0x39bb88={},_0x4d5852={};_0x45388f<_0x52f5e4[_0x9b24('0x7')];_0x45388f+=0x1){_0x39bb88=_0x52f5e4[_0x45388f];if(_['isUndefined'](_0x23b662[_0x9b24('0x6')][_0x39bb88['id']])){_0x23b662[_0x9b24('0x6')][_0x39bb88['id']]=new MailAccount(_0x39bb88);}else{_[_0x9b24('0x8')](_0x23b662[_0x9b24('0x6')][_0x39bb88['id']],_0x39bb88);}}}return _0x23b662[_0x9b24('0x6')];};};module[_0x9b24('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 8a77b53..d53d83c 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 _0x8ba5=['email','active','TemplateId','type','data5','MailServerOut','CloudProvider','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service'];(function(_0x52e499,_0x3454d0){var _0x4f067d=function(_0x43d0ee){while(--_0x43d0ee){_0x52e499['push'](_0x52e499['shift']());}};_0x4f067d(++_0x3454d0);}(_0x8ba5,0x1da));var _0x58ba=function(_0x36bab3,_0x19ce33){_0x36bab3=_0x36bab3-0x0;var _0x2d3989=_0x8ba5[_0x36bab3];return _0x2d3989;};'use strict';var client=require(_0x58ba('0x0'));exports[_0x58ba('0x1')]=function(){return function(){return client[_0x58ba('0x2')](_0x58ba('0x3'),{'options':{'attributes':['id',_0x58ba('0x4'),'provider',_0x58ba('0x5'),_0x58ba('0x6'),_0x58ba('0x7'),'key','ListId',_0x58ba('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0x58ba('0x4'),_0x58ba('0x5'),_0x58ba('0x9'),_0x58ba('0xa')],'as':'CloudProvider'}]},{'model':_0x58ba('0xb'),'as':'Smtp','include':[{'model':_0x58ba('0xc'),'attributes':['id',_0x58ba('0x4'),_0x58ba('0x5'),'type',_0x58ba('0xa')],'as':'CloudProvider'}]}]},'log':_0x58ba('0xd')});};};exports['notify']=function(_0x4ba989,_0x11aa55){return client[_0x58ba('0x2')]('NotifyMailAccount',{'account':{'id':_0x4ba989},'body':_0x11aa55,'log':_0x58ba('0xe')});}; \ No newline at end of file +var _0xb366=['name','getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','provider','service','email','TemplateId','MailServerIn','CloudProvider','type','data5','MailServerOut'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb366,0xa4));var _0x6b36=function(_0x52ed32,_0xca289b){_0x52ed32=_0x52ed32-0x0;var _0x4e2935=_0xb366[_0x52ed32];return _0x4e2935;};'use strict';var client=require(_0x6b36('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x6b36('0x1')](_0x6b36('0x2'),{'options':{'attributes':['id','name',_0x6b36('0x3'),_0x6b36('0x4'),_0x6b36('0x5'),'active','key','ListId',_0x6b36('0x6')],'raw':![],'include':[{'model':_0x6b36('0x7'),'as':'Imap','include':[{'model':_0x6b36('0x8'),'attributes':['id','name','service',_0x6b36('0x9'),_0x6b36('0xa')],'as':_0x6b36('0x8')}]},{'model':_0x6b36('0xb'),'as':'Smtp','include':[{'model':_0x6b36('0x8'),'attributes':['id',_0x6b36('0xc'),'service',_0x6b36('0x9'),'data5'],'as':_0x6b36('0x8')}]}]},'log':_0x6b36('0xd')});};};exports[_0x6b36('0xe')]=function(_0x26b236,_0x2bcf71){return client[_0x6b36('0x1')]('NotifyMailAccount',{'account':{'id':_0x26b236},'body':_0x2bcf71,'log':_0x6b36('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 797d93a..5c48d32 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 _0xc0b3=['loginMailFrequency','GetSettings','Request'];(function(_0x4d53bd,_0x324851){var _0x1c5c83=function(_0xd8e172){while(--_0xd8e172){_0x4d53bd['push'](_0x4d53bd['shift']());}};_0x1c5c83(++_0x324851);}(_0xc0b3,0x146));var _0x3c0b=function(_0x3c8016,_0x419568){_0x3c8016=_0x3c8016-0x0;var _0x58f8ab=_0xc0b3[_0x3c8016];return _0x58f8ab;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x3c0b('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3c0b('0x1')]},'log':_0x3c0b('0x2')});}; \ No newline at end of file +var _0x849d=['../client','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x849d,0x1d1));var _0xd849=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x849d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xd849('0x0'));exports['getSettings']=function(){return client[_0xd849('0x1')](_0xd849('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd849('0x3')]},'log':_0xd849('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 956f0f4..aa6109b 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 6b6b191..d53357e 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 _0x46ee=['createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment'];(function(_0x49b2e7,_0x59934f){var _0x30d3d4=function(_0x8c64b5){while(--_0x8c64b5){_0x49b2e7['push'](_0x49b2e7['shift']());}};_0x30d3d4(++_0x59934f);}(_0x46ee,0xe4));var _0xe46e=function(_0x497131,_0x4cec00){_0x497131=_0x497131-0x0;var _0x4edd42=_0x46ee[_0x497131];return _0x4edd42;};'use strict';var _=require(_0xe46e('0x0'));var http=require(_0xe46e('0x1'));var express=require(_0xe46e('0x2'));var sticky=require(_0xe46e('0x3'));var Redis=require(_0xe46e('0x4'));var config=require(_0xe46e('0x5'));var app=express();var server=http[_0xe46e('0x6')](app);server[_0xe46e('0x7')]=0xdbba0;if(sticky[_0xe46e('0x8')](server,config[_0xe46e('0x9')])){var socketio=require(_0xe46e('0xa'))(server,{'transports':[_0xe46e('0xb'),_0xe46e('0xc')]});config[_0xe46e('0xd')]=_[_0xe46e('0xe')](config['redis'],{'host':_0xe46e('0xf'),'port':0x18eb});socketio[_0xe46e('0x10')](require(_0xe46e('0x11'))({'pubClient':new Redis(config[_0xe46e('0xd')]),'subClient':new Redis(config['redis'])}));require(_0xe46e('0x12'))[_0xe46e('0x13')]();require('../../config/socketio')[_0xe46e('0x13')](socketio);require(_0xe46e('0x14'))['default'](app);require('../../routes')['default'](app);}else{server[_0xe46e('0x15')](_0xe46e('0x16'),function(){console[_0xe46e('0x17')](_0xe46e('0x18'),config[_0xe46e('0x9')]);});}exports=module[_0xe46e('0x19')]=app; \ No newline at end of file +var _0xcbfc=['express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','polling','redis','defaults','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http'];(function(_0x10ab8f,_0x46d94b){var _0x4dceb5=function(_0x1e55d3){while(--_0x1e55d3){_0x10ab8f['push'](_0x10ab8f['shift']());}};_0x4dceb5(++_0x46d94b);}(_0xcbfc,0x18e));var _0xccbf=function(_0x4c63e6,_0x579e7c){_0x4c63e6=_0x4c63e6-0x0;var _0x2f8780=_0xcbfc[_0x4c63e6];return _0x2f8780;};'use strict';var _=require(_0xccbf('0x0'));var http=require(_0xccbf('0x1'));var express=require(_0xccbf('0x2'));var sticky=require(_0xccbf('0x3'));var Redis=require(_0xccbf('0x4'));var config=require(_0xccbf('0x5'));var app=express();var server=http[_0xccbf('0x6')](app);server[_0xccbf('0x7')]=0xdbba0;if(sticky[_0xccbf('0x8')](server,config['port'])){var socketio=require(_0xccbf('0x9'))(server,{'transports':[_0xccbf('0xa'),_0xccbf('0xb')]});config[_0xccbf('0xc')]=_[_0xccbf('0xd')](config[_0xccbf('0xc')],{'host':'localhost','port':0x18eb});socketio[_0xccbf('0xe')](require(_0xccbf('0xf'))({'pubClient':new Redis(config[_0xccbf('0xc')]),'subClient':new Redis(config[_0xccbf('0xc')])}));require(_0xccbf('0x10'))['default']();require(_0xccbf('0x11'))[_0xccbf('0x12')](socketio);require(_0xccbf('0x13'))[_0xccbf('0x12')](app);require(_0xccbf('0x14'))['default'](app);}else{server[_0xccbf('0x15')]('listening',function(){console[_0xccbf('0x16')](_0xccbf('0x17'),config[_0xccbf('0x18')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 3084c15..4837a39 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 _0x2903=['error','rpc','message','result','exports','jayson/promise','bluebird','routing','http','Request','request','then','debug'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0x2903,0x157));var _0x3290=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x2903[_0x209941];return _0x1e8729;};'use strict';var jayson=require(_0x3290('0x0'));var BPromise=require(_0x3290('0x1'));var logger=require('../../config/logger')(_0x3290('0x2'));var client=jayson['client'][_0x3290('0x3')]({'port':0x2329});client[_0x3290('0x4')]=function(_0x148fde,_0x2b0e2e){return new BPromise(function(_0x59380b,_0x41e6d0){return client[_0x3290('0x5')](_0x148fde,_0x2b0e2e)[_0x3290('0x6')](function(_0x185351){logger[_0x3290('0x7')]('rpc',_0x3290('0x2'),_0x148fde,_0x2b0e2e,_0x185351);if(_0x185351['error']){logger[_0x3290('0x8')](_0x3290('0x9'),'routing',_0x148fde,_0x185351['error'][_0x3290('0xa')],_0x2b0e2e);return _0x41e6d0(_0x185351[_0x3290('0x8')][_0x3290('0xa')]);}else{return _0x59380b(_0x185351[_0x3290('0xb')]);}})['catch'](function(_0x42258a){logger[_0x3290('0x8')]('rpc',_0x3290('0x2'),_0x148fde,_0x42258a,_0x2b0e2e);return _0x41e6d0(_0x42258a);});});};module[_0x3290('0xc')]=client; \ No newline at end of file +var _0x98ae=['catch','exports','jayson/promise','routing','client','http','Request','request','debug','rpc','error','message','result'];(function(_0x36a7a3,_0x22e47e){var _0x481620=function(_0x546dbf){while(--_0x546dbf){_0x36a7a3['push'](_0x36a7a3['shift']());}};_0x481620(++_0x22e47e);}(_0x98ae,0xc5));var _0xe98a=function(_0x40d21e,_0x4d3c3b){_0x40d21e=_0x40d21e-0x0;var _0x539ba7=_0x98ae[_0x40d21e];return _0x539ba7;};'use strict';var jayson=require(_0xe98a('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xe98a('0x1'));var client=jayson[_0xe98a('0x2')][_0xe98a('0x3')]({'port':0x2329});client[_0xe98a('0x4')]=function(_0x2e6c25,_0x5e908b){return new BPromise(function(_0x41c81a,_0x4198f2){return client[_0xe98a('0x5')](_0x2e6c25,_0x5e908b)['then'](function(_0x2f73d1){logger[_0xe98a('0x6')](_0xe98a('0x7'),_0xe98a('0x1'),_0x2e6c25,_0x5e908b,_0x2f73d1);if(_0x2f73d1[_0xe98a('0x8')]){logger[_0xe98a('0x8')](_0xe98a('0x7'),'routing',_0x2e6c25,_0x2f73d1[_0xe98a('0x8')][_0xe98a('0x9')],_0x5e908b);return _0x4198f2(_0x2f73d1['error']['message']);}else{return _0x41c81a(_0x2f73d1[_0xe98a('0xa')]);}})[_0xe98a('0xb')](function(_0x41c32e){logger[_0xe98a('0x8')](_0xe98a('0x7'),'routing',_0x2e6c25,_0x41c32e,_0x5e908b);return _0x4198f2(_0x41c32e);});});};module[_0xe98a('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index bed6df9..c57b989 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 _0xc30e=['initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','bluebird','./server','./rpc/user','./rpc/interval','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals'];(function(_0x22e884,_0x223122){var _0x22b352=function(_0x290d94){while(--_0x290d94){_0x22e884['push'](_0x22e884['shift']());}};_0x22b352(++_0x223122);}(_0xc30e,0x145));var _0xec30=function(_0x15b57f,_0x5ccbc0){_0x15b57f=_0x15b57f-0x0;var _0x374d0a=_0xc30e[_0x15b57f];return _0x374d0a;};'use strict';var BPromise=require(_0xec30('0x0'));var server=require(_0xec30('0x1'));var Realtime=require('./realtime');var user=require(_0xec30('0x2'));var interval=require(_0xec30('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xec30('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xec30('0x5'));var whatsappQueue=require(_0xec30('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xec30('0x7')]()[_0xec30('0x8')](user['getAgents']())[_0xec30('0x8')](realtime[_0xec30('0x9')]())['then'](interval[_0xec30('0xa')]())[_0xec30('0x8')](realtime[_0xec30('0xb')]())[_0xec30('0x8')](openchannelQueue[_0xec30('0xc')]())[_0xec30('0x8')](realtime[_0xec30('0xd')]())[_0xec30('0x8')](chatQueue[_0xec30('0xe')]())[_0xec30('0x8')](realtime[_0xec30('0xf')]())['then'](smsQueue[_0xec30('0x10')]())[_0xec30('0x8')](realtime['initSmsQueues']())[_0xec30('0x8')](mailQueue[_0xec30('0x11')]())[_0xec30('0x8')](realtime[_0xec30('0x12')]())[_0xec30('0x8')](faxQueue[_0xec30('0x13')]())[_0xec30('0x8')](realtime[_0xec30('0x14')]())[_0xec30('0x8')](whatsappQueue[_0xec30('0x15')]())[_0xec30('0x8')](realtime['initWhatsappQueues']())[_0xec30('0x8')](function(){return realtime;});}function main(){return server[_0xec30('0x16')](realtime)['then'](function(_0x23c484){return initRealtime();})[_0xec30('0x8')](function(_0x21220a){return setInterval(initRealtime,0x1388);})[_0xec30('0x17')](function(_0x578180){console['log'](_0x578180);});}main(); \ No newline at end of file +var _0xbf77=['initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initWhatsappQueues','listen','catch','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues'];(function(_0x4b1a73,_0x19e6f1){var _0x49e036=function(_0x516f9f){while(--_0x516f9f){_0x4b1a73['push'](_0x4b1a73['shift']());}};_0x49e036(++_0x19e6f1);}(_0xbf77,0x89));var _0x7bf7=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xbf77[_0x16b9ed];return _0x66b1f8;};'use strict';var BPromise=require('bluebird');var server=require(_0x7bf7('0x0'));var Realtime=require(_0x7bf7('0x1'));var user=require(_0x7bf7('0x2'));var interval=require(_0x7bf7('0x3'));var openchannelQueue=require(_0x7bf7('0x4'));var chatQueue=require(_0x7bf7('0x5'));var smsQueue=require(_0x7bf7('0x6'));var mailQueue=require(_0x7bf7('0x7'));var faxQueue=require(_0x7bf7('0x8'));var whatsappQueue=require(_0x7bf7('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x7bf7('0xa')](user[_0x7bf7('0xb')]())[_0x7bf7('0xa')](realtime['initAgents']())[_0x7bf7('0xa')](interval[_0x7bf7('0xc')]())[_0x7bf7('0xa')](realtime[_0x7bf7('0xd')]())[_0x7bf7('0xa')](openchannelQueue[_0x7bf7('0xe')]())[_0x7bf7('0xa')](realtime[_0x7bf7('0xf')]())['then'](chatQueue[_0x7bf7('0x10')]())['then'](realtime[_0x7bf7('0x11')]())[_0x7bf7('0xa')](smsQueue[_0x7bf7('0x12')]())[_0x7bf7('0xa')](realtime[_0x7bf7('0x13')]())[_0x7bf7('0xa')](mailQueue[_0x7bf7('0x14')]())['then'](realtime[_0x7bf7('0x15')]())[_0x7bf7('0xa')](faxQueue[_0x7bf7('0x16')]())[_0x7bf7('0xa')](realtime['initFaxQueues']())[_0x7bf7('0xa')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x7bf7('0x17')]())['then'](function(){return realtime;});}function main(){return server[_0x7bf7('0x18')](realtime)[_0x7bf7('0xa')](function(_0x4e2b2b){return initRealtime();})[_0x7bf7('0xa')](function(_0x5c792e){return setInterval(initRealtime,0x1388);})[_0x7bf7('0x19')](function(_0x4cb96e){console['log'](_0x4cb96e);});}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 6f6aae7..561a3e3 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x631577,_0x38e35d){var _0x517397=function(_0x4f9228){while(--_0x4f9228){_0x631577['push'](_0x631577['shift']());}};_0x517397(++_0x38e35d);}(_0x814b,0x1a2));var _0xb814=function(_0x59eacf,_0x56ec4a){_0x59eacf=_0x59eacf-0x0;var _0x5d74f2=_0x814b[_0x59eacf];return _0x5d74f2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x1261[_0x218ca4];return _0x1b3ff9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 179d7c4..1e2864e 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 _0x5875=['error','result','catch','sendMailMessage','bluebird','jayson/promise','client','http','then'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5875,0x1cf));var _0x5587=function(_0x599b81,_0x3af155){_0x599b81=_0x599b81-0x0;var _0x502548=_0x5875[_0x599b81];return _0x502548;};'use strict';var BPromise=require(_0x5587('0x0'));var jayson=require(_0x5587('0x1'));var client=jayson[_0x5587('0x2')][_0x5587('0x3')]({'port':0x232b});function request(_0x5f25f9,_0x599954){return new BPromise(function(_0x3ec4c2,_0x3adaac){return client['request'](_0x5f25f9,_0x599954)[_0x5587('0x4')](function(_0x2cc1e7){if(_0x2cc1e7[_0x5587('0x5')]){return _0x3adaac(_0x2cc1e7[_0x5587('0x5')]['message']);}else{return _0x3ec4c2(_0x2cc1e7[_0x5587('0x6')]);}})[_0x5587('0x7')](function(_0x27f0a1){return _0x3adaac(_0x27f0a1);});});}exports[_0x5587('0x8')]=function(_0x9a87ed,_0x454877){return request('SendMail',{'account':_0x9a87ed,'message':_0x454877});}; \ No newline at end of file +var _0x94ed=['http','then','error','message','catch','sendMailMessage','bluebird','jayson/promise','client'];(function(_0x1b77b1,_0xca2b55){var _0x116bbb=function(_0x49b3e4){while(--_0x49b3e4){_0x1b77b1['push'](_0x1b77b1['shift']());}};_0x116bbb(++_0xca2b55);}(_0x94ed,0xb1));var _0xd94e=function(_0x370338,_0x4178ec){_0x370338=_0x370338-0x0;var _0x2e10df=_0x94ed[_0x370338];return _0x2e10df;};'use strict';var BPromise=require(_0xd94e('0x0'));var jayson=require(_0xd94e('0x1'));var client=jayson[_0xd94e('0x2')][_0xd94e('0x3')]({'port':0x232b});function request(_0x583388,_0x28aeb6){return new BPromise(function(_0x36aa89,_0x731e8d){return client['request'](_0x583388,_0x28aeb6)[_0xd94e('0x4')](function(_0xc7177c){if(_0xc7177c[_0xd94e('0x5')]){return _0x731e8d(_0xc7177c[_0xd94e('0x5')][_0xd94e('0x6')]);}else{return _0x36aa89(_0xc7177c['result']);}})[_0xd94e('0x7')](function(_0xe677ef){return _0x731e8d(_0xe677ef);});});}exports[_0xd94e('0x8')]=function(_0x53cf0c,_0x30cafd){return request('SendMail',{'account':_0x53cf0c,'message':_0x30cafd});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2ee0017..a094765 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 _0x6be9=['lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','openchannel','fax','sms','length','Status','StatusTime','toNumber','mailStatusTime','faxStatus','smsStatus','openchannelStatusTime','stringify','emit','exports'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x6be9,0xec));var _0x96be=function(_0x3b1e8b,_0x4033db){_0x3b1e8b=_0x3b1e8b-0x0;var _0x4ba1b5=_0x6be9[_0x3b1e8b];return _0x4ba1b5;};'use strict';var _=require(_0x96be('0x0'));var moment=require(_0x96be('0x1'));var md5=require(_0x96be('0x2'));var Redis=require(_0x96be('0x3'));var config=require('../../../config/environment');config[_0x96be('0x4')]=_[_0x96be('0x5')](config[_0x96be('0x4')],{'host':_0x96be('0x6'),'port':0x18eb});var io=require(_0x96be('0x7'))(new Redis(config[_0x96be('0x4')]));function Agent(_0x3dcefb){this['id']=_0x3dcefb['id']||0x0;this[_0x96be('0x8')]=_0x3dcefb[_0x96be('0x8')]||'';this[_0x96be('0x9')]=_0x3dcefb[_0x96be('0x9')]||!![];this[_0x96be('0xa')]=_0x3dcefb[_0x96be('0xa')]||![];this['chatPause']=_0x3dcefb[_0x96be('0xb')]||![];this[_0x96be('0xc')]=_0x3dcefb['mailPause']||![];this[_0x96be('0xd')]=_0x3dcefb[_0x96be('0xd')]||![];this[_0x96be('0xe')]=_0x3dcefb['smsPause']||![];this[_0x96be('0xf')]=_0x3dcefb[_0x96be('0xf')]||![];this[_0x96be('0x10')]=_0x96be('0x11');this[_0x96be('0x12')]=0x0;this['chatCapacity']=_0x3dcefb[_0x96be('0x13')]||0x0;this[_0x96be('0x14')]=0x0;this['mailStatus']=_0x96be('0x11');this['mailStatusTime']=0x0;this['mailCapacity']=_0x3dcefb['mailCapacity']||0x0;this[_0x96be('0x15')]=0x0;this['faxStatus']=_0x96be('0x11');this[_0x96be('0x16')]=0x0;this[_0x96be('0x17')]=_0x3dcefb[_0x96be('0x17')]||0x0;this[_0x96be('0x18')]=0x0;this['smsStatus']='unknown';this[_0x96be('0x19')]=0x0;this[_0x96be('0x1a')]=_0x3dcefb[_0x96be('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x96be('0x1b')]=_0x96be('0x11');this[_0x96be('0x1c')]=0x0;this[_0x96be('0x1d')]=_0x3dcefb['whatsappCapacity']||0x0;this[_0x96be('0x1e')]=0x0;this[_0x96be('0x1f')]='unknown';this['openchannelStatusTime']=0x0;this[_0x96be('0x20')]=_0x3dcefb[_0x96be('0x20')]||0x0;this[_0x96be('0x21')]=0x0;this[_0x96be('0x22')]=![];this[_0x96be('0x23')]=undefined;this[_0x96be('0x2')]='';this[_0x96be('0x24')]();}Agent['prototype'][_0x96be('0x25')]=function(_0x4237ae){if(this[_0x4237ae+_0x96be('0x26')]>0x0){if(this[_0x4237ae+_0x96be('0x27')]>0x0&&this[_0x4237ae+_0x96be('0x26')]>=this[_0x4237ae+_0x96be('0x27')]){return _0x96be('0x28');}else{return _0x96be('0x29');}}else{return _0x96be('0x2a');}};Agent[_0x96be('0x2b')][_0x96be('0x24')]=function(){var _0x527338=[_0x96be('0x2c'),'chat',_0x96be('0x2d'),_0x96be('0x2e'),_0x96be('0x2f'),'whatsapp'];for(var _0x13c741=0x0;_0x13c741<_0x527338[_0x96be('0x30')];_0x13c741+=0x1){var _0x5805ae=this[_0x96be('0x25')](_0x527338[_0x13c741]);if(this[_0x527338[_0x13c741]+_0x96be('0x31')]!==_0x5805ae){this[_0x527338[_0x13c741]+_0x96be('0x32')]=_[_0x96be('0x33')](moment()['format']('x'));}this[_0x527338[_0x13c741]+'Status']=_0x5805ae;}var _0x92c853={'id':this['id'],'name':this[_0x96be('0x8')],'online':this[_0x96be('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x96be('0xb')],'mailPause':this[_0x96be('0xc')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x96be('0x10')],'chatStatusTime':this[_0x96be('0x12')],'chatCapacity':this[_0x96be('0x13')],'chatCurrentCapacity':this[_0x96be('0x14')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x96be('0x34')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x96be('0x35')],'faxStatusTime':this[_0x96be('0x16')],'faxCapacity':this[_0x96be('0x17')],'faxCurrentCapacity':this[_0x96be('0x18')],'smsStatus':this[_0x96be('0x36')],'smsStatusTime':this[_0x96be('0x19')],'smsCapacity':this[_0x96be('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x96be('0x1b')],'whatsappStatusTime':this[_0x96be('0x1c')],'whatsappCapacity':this[_0x96be('0x1d')],'whatsappCurrentCapacity':this[_0x96be('0x1e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x96be('0x37')],'openchannelCapacity':this[_0x96be('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x96be('0x22')],'busyQueue':this[_0x96be('0x23')]};var _0x3442a1=md5(JSON[_0x96be('0x38')](_0x92c853));if(this['md5']!==_0x3442a1){this[_0x96be('0x2')]=_0x3442a1;io[_0x96be('0x39')]('user:save',_0x92c853);}};module[_0x96be('0x3a')]=Agent; \ No newline at end of file +var _0xa958=['smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','toNumber','chatStatusTime','mailCurrentCapacity','smsCurrentCapacity','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','mailStatus','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus'];(function(_0x3702d5,_0x144dc8){var _0x3c4157=function(_0xdf8c3f){while(--_0xdf8c3f){_0x3702d5['push'](_0x3702d5['shift']());}};_0x3c4157(++_0x144dc8);}(_0xa958,0x94));var _0x8a95=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xa958[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x8a95('0x0'));var moment=require('moment');var md5=require(_0x8a95('0x1'));var Redis=require(_0x8a95('0x2'));var config=require(_0x8a95('0x3'));config[_0x8a95('0x4')]=_[_0x8a95('0x5')](config[_0x8a95('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8a95('0x4')]));function Agent(_0xc65a39){this['id']=_0xc65a39['id']||0x0;this[_0x8a95('0x6')]=_0xc65a39[_0x8a95('0x6')]||'';this[_0x8a95('0x7')]=_0xc65a39[_0x8a95('0x7')]||!![];this[_0x8a95('0x8')]=_0xc65a39['voicePause']||![];this[_0x8a95('0x9')]=_0xc65a39[_0x8a95('0x9')]||![];this[_0x8a95('0xa')]=_0xc65a39[_0x8a95('0xa')]||![];this[_0x8a95('0xb')]=_0xc65a39[_0x8a95('0xb')]||![];this[_0x8a95('0xc')]=_0xc65a39['smsPause']||![];this[_0x8a95('0xd')]=_0xc65a39[_0x8a95('0xd')]||![];this['chatStatus']=_0x8a95('0xe');this['chatStatusTime']=0x0;this['chatCapacity']=_0xc65a39[_0x8a95('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x8a95('0x10')]=_0x8a95('0xe');this['mailStatusTime']=0x0;this[_0x8a95('0x11')]=_0xc65a39[_0x8a95('0x11')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x8a95('0x12')]=_0x8a95('0xe');this[_0x8a95('0x13')]=0x0;this[_0x8a95('0x14')]=_0xc65a39[_0x8a95('0x14')]||0x0;this[_0x8a95('0x15')]=0x0;this[_0x8a95('0x16')]='unknown';this[_0x8a95('0x17')]=0x0;this['smsCapacity']=_0xc65a39[_0x8a95('0x18')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x8a95('0x19')]=_0x8a95('0xe');this[_0x8a95('0x1a')]=0x0;this[_0x8a95('0x1b')]=_0xc65a39[_0x8a95('0x1b')]||0x0;this[_0x8a95('0x1c')]=0x0;this[_0x8a95('0x1d')]=_0x8a95('0xe');this[_0x8a95('0x1e')]=0x0;this[_0x8a95('0x1f')]=_0xc65a39[_0x8a95('0x1f')]||0x0;this[_0x8a95('0x20')]=0x0;this[_0x8a95('0x21')]=![];this[_0x8a95('0x22')]=undefined;this[_0x8a95('0x1')]='';this[_0x8a95('0x23')]();}Agent[_0x8a95('0x24')]['getChannelStatus']=function(_0x5df2cf){if(this[_0x5df2cf+_0x8a95('0x25')]>0x0){if(this[_0x5df2cf+_0x8a95('0x26')]>0x0&&this[_0x5df2cf+_0x8a95('0x25')]>=this[_0x5df2cf+_0x8a95('0x26')]){return _0x8a95('0x27');}else{return _0x8a95('0x28');}}else{return'idle';}};Agent['prototype'][_0x8a95('0x23')]=function(){var _0x1bf45c=[_0x8a95('0x29'),_0x8a95('0x2a'),_0x8a95('0x2b'),_0x8a95('0x2c'),_0x8a95('0x2d'),_0x8a95('0x2e')];for(var _0x3e880b=0x0;_0x3e880b<_0x1bf45c[_0x8a95('0x2f')];_0x3e880b+=0x1){var _0x530459=this[_0x8a95('0x30')](_0x1bf45c[_0x3e880b]);if(this[_0x1bf45c[_0x3e880b]+_0x8a95('0x31')]!==_0x530459){this[_0x1bf45c[_0x3e880b]+'StatusTime']=_[_0x8a95('0x32')](moment()['format']('x'));}this[_0x1bf45c[_0x3e880b]+'Status']=_0x530459;}var _0xdf645d={'id':this['id'],'name':this['name'],'online':this[_0x8a95('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0x8a95('0x9')],'mailPause':this[_0x8a95('0xa')],'smsPause':this[_0x8a95('0xc')],'faxPause':this[_0x8a95('0xb')],'openchannelPause':this[_0x8a95('0xd')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x8a95('0x33')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x8a95('0x10')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x8a95('0x34')],'faxStatus':this[_0x8a95('0x12')],'faxStatusTime':this[_0x8a95('0x13')],'faxCapacity':this[_0x8a95('0x14')],'faxCurrentCapacity':this[_0x8a95('0x15')],'smsStatus':this[_0x8a95('0x16')],'smsStatusTime':this[_0x8a95('0x17')],'smsCapacity':this[_0x8a95('0x18')],'smsCurrentCapacity':this[_0x8a95('0x35')],'whatsappStatus':this[_0x8a95('0x19')],'whatsappStatusTime':this[_0x8a95('0x1a')],'whatsappCapacity':this[_0x8a95('0x1b')],'whatsappCurrentCapacity':this[_0x8a95('0x1c')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x8a95('0x1e')],'openchannelCapacity':this[_0x8a95('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x8a95('0x21')],'busyQueue':this[_0x8a95('0x22')]};var _0x25e55a=md5(JSON['stringify'](_0xdf645d));if(this[_0x8a95('0x1')]!==_0x25e55a){this[_0x8a95('0x1')]=_0x25e55a;io[_0x8a95('0x36')](_0x8a95('0x37'),_0xdf645d);}};module[_0x8a95('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 7de314f..629aa3e 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 _0xc2a8=['../../../config/environment','redis','defaults','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','updateRealtime','loggedIn','paused','length','online','chatPause','available','name','stringify','format','chat:queue:%s','emit','exports','md5','util','ioredis'];(function(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0xc2a8,0x71));var _0x8c2a=function(_0x55bd6e,_0x4f745d){_0x55bd6e=_0x55bd6e-0x0;var _0x1ec1a2=_0xc2a8[_0x55bd6e];return _0x1ec1a2;};'use strict';var _=require('lodash');var md5=require(_0x8c2a('0x0'));var util=require(_0x8c2a('0x1'));var Redis=require(_0x8c2a('0x2'));var config=require(_0x8c2a('0x3'));config[_0x8c2a('0x4')]=_[_0x8c2a('0x5')](config[_0x8c2a('0x4')],{'host':_0x8c2a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x12ca8d){this['id']=_0x12ca8d['id']||0x0;this['name']=_0x12ca8d['name']||'';this[_0x8c2a('0x7')]=_0x12ca8d[_0x8c2a('0x7')]||0xa;this['strategy']=_0x12ca8d[_0x8c2a('0x8')]||_0x8c2a('0x9');this[_0x8c2a('0xa')]=_0x12ca8d['Agents'];this[_0x8c2a('0xb')]={};this[_0x8c2a('0xc')]=0x0;this[_0x8c2a('0x0')]='';this[_0x8c2a('0xd')]();this['updateRealtime']();}ChatQueue[_0x8c2a('0xe')][_0x8c2a('0xd')]=function(){var _0xd3784e=this[_0x8c2a('0xb')]['_rr'];this[_0x8c2a('0xb')]=_[_0x8c2a('0xf')](this[_0x8c2a('0xa')],'id');this[_0x8c2a('0xb')]['_rr']=_0xd3784e;};ChatQueue[_0x8c2a('0xe')][_0x8c2a('0x10')]=function(){this[_0x8c2a('0x11')]=0x0;this[_0x8c2a('0x12')]=0x0;for(var _0x47ec4d=0x0;_0x47ec4d=0x0?this[_0x8c2a('0x16')]:0x0;var _0x4ac042={'id':this['id'],'available':this[_0x8c2a('0x16')],'loggedIn':this[_0x8c2a('0x11')],'name':this[_0x8c2a('0x17')],'paused':this['paused'],'waiting':this['waiting']};var _0x32968f=md5(JSON[_0x8c2a('0x18')](_0x4ac042));if(this[_0x8c2a('0x0')]!==_0x32968f){this[_0x8c2a('0x0')]=_0x32968f;io['to'](util[_0x8c2a('0x19')](_0x8c2a('0x1a'),_0x4ac042[_0x8c2a('0x17')]))[_0x8c2a('0x1b')]('chat_queue:save',_0x4ac042);}};module[_0x8c2a('0x1c')]=ChatQueue; \ No newline at end of file +var _0xfb8b=['util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','paused','length','loggedIn','available','chat:queue:%s','emit','exports','lodash','md5'];(function(_0x3629de,_0x5b30a0){var _0x2af37a=function(_0x25688a){while(--_0x25688a){_0x3629de['push'](_0x3629de['shift']());}};_0x2af37a(++_0x5b30a0);}(_0xfb8b,0xd6));var _0xbfb8=function(_0xf1c29b,_0x52f5e3){_0xf1c29b=_0xf1c29b-0x0;var _0x54aec4=_0xfb8b[_0xf1c29b];return _0x54aec4;};'use strict';var _=require(_0xbfb8('0x0'));var md5=require(_0xbfb8('0x1'));var util=require(_0xbfb8('0x2'));var Redis=require('ioredis');var config=require(_0xbfb8('0x3'));config[_0xbfb8('0x4')]=_[_0xbfb8('0x5')](config[_0xbfb8('0x4')],{'host':_0xbfb8('0x6'),'port':0x18eb});var io=require(_0xbfb8('0x7'))(new Redis(config[_0xbfb8('0x4')]));function ChatQueue(_0x21065e){this['id']=_0x21065e['id']||0x0;this['name']=_0x21065e[_0xbfb8('0x8')]||'';this[_0xbfb8('0x9')]=_0x21065e[_0xbfb8('0x9')]||0xa;this['strategy']=_0x21065e['strategy']||'beepall';this[_0xbfb8('0xa')]=_0x21065e[_0xbfb8('0xa')];this[_0xbfb8('0xb')]={};this[_0xbfb8('0xc')]=0x0;this[_0xbfb8('0x1')]='';this[_0xbfb8('0xd')]();this[_0xbfb8('0xe')]();}ChatQueue['prototype'][_0xbfb8('0xd')]=function(){var _0x26da4f=this[_0xbfb8('0xb')]['_rr'];this[_0xbfb8('0xb')]=_['map'](this[_0xbfb8('0xa')],'id');this[_0xbfb8('0xb')][_0xbfb8('0xf')]=_0x26da4f;};ChatQueue[_0xbfb8('0x10')][_0xbfb8('0xe')]=function(){this['loggedIn']=0x0;this[_0xbfb8('0x11')]=0x0;for(var _0x44e642=0x0;_0x44e642=0x0?this[_0xbfb8('0x14')]:0x0;var _0x96f218={'id':this['id'],'available':this[_0xbfb8('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xbfb8('0x8')],'paused':this[_0xbfb8('0x11')],'waiting':this['waiting']};var _0x4ce341=md5(JSON['stringify'](_0x96f218));if(this['md5']!==_0x4ce341){this[_0xbfb8('0x1')]=_0x4ce341;io['to'](util['format'](_0xbfb8('0x15'),_0x96f218[_0xbfb8('0x8')]))[_0xbfb8('0x16')]('chat_queue:save',_0x96f218);}};module[_0xbfb8('0x17')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 400c6f1..05a45e0 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 _0xf448=['_rr','loggedIn','paused','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map'];(function(_0x2f3723,_0x4616f6){var _0x5a8922=function(_0x379201){while(--_0x379201){_0x2f3723['push'](_0x2f3723['shift']());}};_0x5a8922(++_0x4616f6);}(_0xf448,0x1be));var _0x8f44=function(_0x2606bd,_0x3148ea){_0x2606bd=_0x2606bd-0x0;var _0x1b6f75=_0xf448[_0x2606bd];return _0x1b6f75;};'use strict';var _=require(_0x8f44('0x0'));var md5=require(_0x8f44('0x1'));var util=require(_0x8f44('0x2'));var Redis=require(_0x8f44('0x3'));var config=require(_0x8f44('0x4'));config[_0x8f44('0x5')]=_['defaults'](config[_0x8f44('0x5')],{'host':_0x8f44('0x6'),'port':0x18eb});var io=require(_0x8f44('0x7'))(new Redis(config[_0x8f44('0x5')]));function FaxQueue(_0x2177af){this['id']=_0x2177af['id']||0x0;this[_0x8f44('0x8')]=_0x2177af[_0x8f44('0x8')]||'';this[_0x8f44('0x9')]=_0x2177af[_0x8f44('0x9')]||0xa;this[_0x8f44('0xa')]=_0x2177af[_0x8f44('0xa')]||_0x8f44('0xb');this[_0x8f44('0xc')]=_0x2177af['Agents'];this[_0x8f44('0xd')]={};this[_0x8f44('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0x8f44('0xf')]();}FaxQueue[_0x8f44('0x10')][_0x8f44('0x11')]=function(){var _0x18d46d=this['mapAgentsId']['_rr'];this[_0x8f44('0xd')]=_[_0x8f44('0x12')](this[_0x8f44('0xc')],'id');this['mapAgentsId'][_0x8f44('0x13')]=_0x18d46d;};FaxQueue['prototype'][_0x8f44('0xf')]=function(){this[_0x8f44('0x14')]=0x0;this[_0x8f44('0x15')]=0x0;for(var _0x51c8bd=0x0;_0x51c8bd=0x0?this[_0x8f44('0x18')]:0x0;var _0x44cfd9={'id':this['id'],'available':this[_0x8f44('0x18')],'loggedIn':this[_0x8f44('0x14')],'name':this[_0x8f44('0x8')],'paused':this[_0x8f44('0x15')],'waiting':this['waiting']};var _0x36495a=md5(JSON[_0x8f44('0x19')](_0x44cfd9));if(this[_0x8f44('0x1')]!==_0x36495a){this[_0x8f44('0x1')]=_0x36495a;io['to'](util[_0x8f44('0x1a')](_0x8f44('0x1b'),_0x44cfd9['name']))[_0x8f44('0x1c')](_0x8f44('0x1d'),_0x44cfd9);}};module[_0x8f44('0x1e')]=FaxQueue; \ No newline at end of file +var _0x82fb=['timeout','strategy','beepall','Agents','waiting','md5','updateRealtime','updateRouting','mapAgentsId','map','_rr','prototype','loggedIn','paused','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','lodash','util','ioredis','defaults','redis','localhost','socket.io-emitter','name'];(function(_0x52f3b0,_0x2ea792){var _0x3077dc=function(_0x734e){while(--_0x734e){_0x52f3b0['push'](_0x52f3b0['shift']());}};_0x3077dc(++_0x2ea792);}(_0x82fb,0x110));var _0xb82f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x82fb[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb82f('0x0'));var md5=require('md5');var util=require(_0xb82f('0x1'));var Redis=require(_0xb82f('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xb82f('0x3')](config[_0xb82f('0x4')],{'host':_0xb82f('0x5'),'port':0x18eb});var io=require(_0xb82f('0x6'))(new Redis(config[_0xb82f('0x4')]));function FaxQueue(_0x3a0852){this['id']=_0x3a0852['id']||0x0;this['name']=_0x3a0852[_0xb82f('0x7')]||'';this[_0xb82f('0x8')]=_0x3a0852[_0xb82f('0x8')]||0xa;this['strategy']=_0x3a0852[_0xb82f('0x9')]||_0xb82f('0xa');this[_0xb82f('0xb')]=_0x3a0852[_0xb82f('0xb')];this['mapAgentsId']={};this[_0xb82f('0xc')]=0x0;this[_0xb82f('0xd')]='';this['updateRouting']();this[_0xb82f('0xe')]();}FaxQueue['prototype'][_0xb82f('0xf')]=function(){var _0x4b6b74=this[_0xb82f('0x10')]['_rr'];this[_0xb82f('0x10')]=_[_0xb82f('0x11')](this[_0xb82f('0xb')],'id');this['mapAgentsId'][_0xb82f('0x12')]=_0x4b6b74;};FaxQueue[_0xb82f('0x13')][_0xb82f('0xe')]=function(){this[_0xb82f('0x14')]=0x0;this[_0xb82f('0x15')]=0x0;for(var _0x4c55f4=0x0;_0x4c55f4=0x0?this['available']:0x0;var _0x38c2ab={'id':this['id'],'available':this[_0xb82f('0x17')],'loggedIn':this[_0xb82f('0x14')],'name':this[_0xb82f('0x7')],'paused':this[_0xb82f('0x15')],'waiting':this['waiting']};var _0xc9b4bb=md5(JSON['stringify'](_0x38c2ab));if(this[_0xb82f('0xd')]!==_0xc9b4bb){this['md5']=_0xc9b4bb;io['to'](util[_0xb82f('0x18')](_0xb82f('0x19'),_0x38c2ab[_0xb82f('0x7')]))[_0xb82f('0x1a')](_0xb82f('0x1b'),_0x38c2ab);}};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 30c9e9e..09ff7e6 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 _0x3fef=['Intervals','exports','name'];(function(_0x4eb76b,_0x50bcf6){var _0x4a1540=function(_0x23cf9b){while(--_0x23cf9b){_0x4eb76b['push'](_0x4eb76b['shift']());}};_0x4a1540(++_0x50bcf6);}(_0x3fef,0x1e8));var _0xf3fe=function(_0x3c6ed2,_0x4923e7){_0x3c6ed2=_0x3c6ed2-0x0;var _0x38017e=_0x3fef[_0x3c6ed2];return _0x38017e;};'use strict';function Interval(_0x572355){this['id']=_0x572355['id']||0x0;this['name']=_0x572355[_0xf3fe('0x0')]||'';this[_0xf3fe('0x1')]=_0x572355['Intervals']||{};}module[_0xf3fe('0x2')]=Interval; \ No newline at end of file +var _0x8d73=['name','Intervals'];(function(_0x57e7b0,_0x26f304){var _0xac8f2a=function(_0x2f1f2b){while(--_0x2f1f2b){_0x57e7b0['push'](_0x57e7b0['shift']());}};_0xac8f2a(++_0x26f304);}(_0x8d73,0x1c8));var _0x38d7=function(_0x3fc10f,_0x19d6dc){_0x3fc10f=_0x3fc10f-0x0;var _0x364921=_0x8d73[_0x3fc10f];return _0x364921;};'use strict';function Interval(_0x33d98c){this['id']=_0x33d98c['id']||0x0;this[_0x38d7('0x0')]=_0x33d98c[_0x38d7('0x0')]||'';this[_0x38d7('0x1')]=_0x33d98c[_0x38d7('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 3b2f14b..641066f 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 _0xb139=['format','mail:queue:%s','emit','mail_queue:save','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','online','mailPause','available','stringify'];(function(_0x2e39c1,_0x3b2e9f){var _0x3df5c7=function(_0x1bb0cb){while(--_0x1bb0cb){_0x2e39c1['push'](_0x2e39c1['shift']());}};_0x3df5c7(++_0x3b2e9f);}(_0xb139,0x138));var _0x9b13=function(_0x11bb7a,_0x1c399a){_0x11bb7a=_0x11bb7a-0x0;var _0x91f328=_0xb139[_0x11bb7a];return _0x91f328;};'use strict';var _=require('lodash');var md5=require(_0x9b13('0x0'));var util=require('util');var Redis=require(_0x9b13('0x1'));var config=require(_0x9b13('0x2'));config[_0x9b13('0x3')]=_[_0x9b13('0x4')](config[_0x9b13('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x9b13('0x5'))(new Redis(config[_0x9b13('0x3')]));function MailQueue(_0x272020){this['id']=_0x272020['id']||0x0;this[_0x9b13('0x6')]=_0x272020[_0x9b13('0x6')]||'';this[_0x9b13('0x7')]=_0x272020[_0x9b13('0x7')]||0xa;this[_0x9b13('0x8')]=_0x272020['strategy']||_0x9b13('0x9');this[_0x9b13('0xa')]=_0x272020[_0x9b13('0xa')];this[_0x9b13('0xb')]={};this[_0x9b13('0xc')]=0x0;this[_0x9b13('0x0')]='';this['updateRouting']();this[_0x9b13('0xd')]();}MailQueue[_0x9b13('0xe')][_0x9b13('0xf')]=function(){var _0xa81dcf=this[_0x9b13('0xb')][_0x9b13('0x10')];this[_0x9b13('0xb')]=_['map'](this[_0x9b13('0xa')],'id');this[_0x9b13('0xb')][_0x9b13('0x10')]=_0xa81dcf;};MailQueue['prototype']['updateRealtime']=function(){this[_0x9b13('0x11')]=0x0;this[_0x9b13('0x12')]=0x0;for(var _0x22b272=0x0;_0x22b272=0x0?this[_0x9b13('0x16')]:0x0;var _0x1b955d={'id':this['id'],'available':this[_0x9b13('0x16')],'loggedIn':this[_0x9b13('0x11')],'name':this[_0x9b13('0x6')],'paused':this[_0x9b13('0x12')],'waiting':this[_0x9b13('0xc')]};var _0x105899=md5(JSON[_0x9b13('0x17')](_0x1b955d));if(this[_0x9b13('0x0')]!==_0x105899){this[_0x9b13('0x0')]=_0x105899;io['to'](util[_0x9b13('0x18')](_0x9b13('0x19'),_0x1b955d[_0x9b13('0x6')]))[_0x9b13('0x1a')](_0x9b13('0x1b'),_0x1b955d);}};module['exports']=MailQueue; \ No newline at end of file +var _0xbe92=['mapAgentsId','_rr','map','length','online','loggedIn','mailPause','available','paused','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','../../../config/environment','defaults','localhost','redis','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype'];(function(_0x3c1105,_0x5c45c1){var _0x35e7ab=function(_0x39ec0c){while(--_0x39ec0c){_0x3c1105['push'](_0x3c1105['shift']());}};_0x35e7ab(++_0x5c45c1);}(_0xbe92,0x1b2));var _0x2be9=function(_0x3546a6,_0x239442){_0x3546a6=_0x3546a6-0x0;var _0x52594c=_0xbe92[_0x3546a6];return _0x52594c;};'use strict';var _=require(_0x2be9('0x0'));var md5=require(_0x2be9('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x2be9('0x2'));config['redis']=_[_0x2be9('0x3')](config['redis'],{'host':_0x2be9('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2be9('0x5')]));function MailQueue(_0x4c1ef0){this['id']=_0x4c1ef0['id']||0x0;this['name']=_0x4c1ef0[_0x2be9('0x6')]||'';this['timeout']=_0x4c1ef0[_0x2be9('0x7')]||0xa;this[_0x2be9('0x8')]=_0x4c1ef0['strategy']||'beepall';this['Agents']=_0x4c1ef0[_0x2be9('0x9')];this['mapAgentsId']={};this[_0x2be9('0xa')]=0x0;this[_0x2be9('0x1')]='';this[_0x2be9('0xb')]();this[_0x2be9('0xc')]();}MailQueue[_0x2be9('0xd')][_0x2be9('0xb')]=function(){var _0x31d9bf=this[_0x2be9('0xe')][_0x2be9('0xf')];this[_0x2be9('0xe')]=_[_0x2be9('0x10')](this[_0x2be9('0x9')],'id');this[_0x2be9('0xe')][_0x2be9('0xf')]=_0x31d9bf;};MailQueue[_0x2be9('0xd')][_0x2be9('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1e45e3=0x0;_0x1e45e3=0x0?this[_0x2be9('0x15')]:0x0;var _0x2c90e9={'id':this['id'],'available':this[_0x2be9('0x15')],'loggedIn':this[_0x2be9('0x13')],'name':this[_0x2be9('0x6')],'paused':this['paused'],'waiting':this[_0x2be9('0xa')]};var _0x1c3429=md5(JSON[_0x2be9('0x17')](_0x2c90e9));if(this[_0x2be9('0x1')]!==_0x1c3429){this[_0x2be9('0x1')]=_0x1c3429;io['to'](util[_0x2be9('0x18')](_0x2be9('0x19'),_0x2c90e9[_0x2be9('0x6')]))['emit'](_0x2be9('0x1a'),_0x2c90e9);}};module[_0x2be9('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 87c6a1c..03bb88b 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2ef3,0xba));var _0x32ef=function(_0x16f37d,_0xb3d1c9){_0x16f37d=_0x16f37d-0x0;var _0x3dbfad=_0x2ef3[_0x16f37d];return _0x3dbfad;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 8c338f6..f241564 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 _0x81bd=['updateRealtime','prototype','_rr','loggedIn','length','online','smsPause','available','paused','stringify','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x81bd,0x7c));var _0xd81b=function(_0x1ce575,_0xbcf48f){_0x1ce575=_0x1ce575-0x0;var _0x20118a=_0x81bd[_0x1ce575];return _0x20118a;};'use strict';var _=require(_0xd81b('0x0'));var md5=require(_0xd81b('0x1'));var util=require(_0xd81b('0x2'));var Redis=require(_0xd81b('0x3'));var config=require(_0xd81b('0x4'));config[_0xd81b('0x5')]=_[_0xd81b('0x6')](config['redis'],{'host':_0xd81b('0x7'),'port':0x18eb});var io=require(_0xd81b('0x8'))(new Redis(config[_0xd81b('0x5')]));function SmsQueue(_0x4d8e7e){this['id']=_0x4d8e7e['id']||0x0;this[_0xd81b('0x9')]=_0x4d8e7e[_0xd81b('0x9')]||'';this[_0xd81b('0xa')]=_0x4d8e7e['timeout']||0xa;this['strategy']=_0x4d8e7e[_0xd81b('0xb')]||'beepall';this[_0xd81b('0xc')]=_0x4d8e7e[_0xd81b('0xc')];this[_0xd81b('0xd')]={};this[_0xd81b('0xe')]=0x0;this[_0xd81b('0x1')]='';this[_0xd81b('0xf')]();this[_0xd81b('0x10')]();}SmsQueue[_0xd81b('0x11')][_0xd81b('0xf')]=function(){var _0x23c789=this[_0xd81b('0xd')][_0xd81b('0x12')];this[_0xd81b('0xd')]=_['map'](this[_0xd81b('0xc')],'id');this['mapAgentsId'][_0xd81b('0x12')]=_0x23c789;};SmsQueue[_0xd81b('0x11')]['updateRealtime']=function(){this[_0xd81b('0x13')]=0x0;this['paused']=0x0;for(var _0x13dd00=0x0;_0x13dd00=0x0?this[_0xd81b('0x17')]:0x0;var _0x6746f0={'id':this['id'],'available':this[_0xd81b('0x17')],'loggedIn':this[_0xd81b('0x13')],'name':this[_0xd81b('0x9')],'paused':this[_0xd81b('0x18')],'waiting':this[_0xd81b('0xe')]};var _0xfa27e0=md5(JSON[_0xd81b('0x19')](_0x6746f0));if(this[_0xd81b('0x1')]!==_0xfa27e0){this[_0xd81b('0x1')]=_0xfa27e0;io['to'](util['format']('sms:queue:%s',_0x6746f0[_0xd81b('0x9')]))[_0xd81b('0x1a')](_0xd81b('0x1b'),_0x6746f0);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x447b=['length','online','smsPause','available','loggedIn','waiting','stringify','format','sms:queue:%s','emit','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','paused'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x447b,0xe4));var _0xb447=function(_0x4049a2,_0x11129f){_0x4049a2=_0x4049a2-0x0;var _0x1b4367=_0x447b[_0x4049a2];return _0x1b4367;};'use strict';var _=require(_0xb447('0x0'));var md5=require(_0xb447('0x1'));var util=require('util');var Redis=require(_0xb447('0x2'));var config=require(_0xb447('0x3'));config[_0xb447('0x4')]=_[_0xb447('0x5')](config[_0xb447('0x4')],{'host':_0xb447('0x6'),'port':0x18eb});var io=require(_0xb447('0x7'))(new Redis(config[_0xb447('0x4')]));function SmsQueue(_0x7b0a81){this['id']=_0x7b0a81['id']||0x0;this[_0xb447('0x8')]=_0x7b0a81['name']||'';this['timeout']=_0x7b0a81[_0xb447('0x9')]||0xa;this['strategy']=_0x7b0a81[_0xb447('0xa')]||_0xb447('0xb');this[_0xb447('0xc')]=_0x7b0a81[_0xb447('0xc')];this[_0xb447('0xd')]={};this['waiting']=0x0;this[_0xb447('0x1')]='';this[_0xb447('0xe')]();this[_0xb447('0xf')]();}SmsQueue[_0xb447('0x10')]['updateRouting']=function(){var _0xf02e17=this[_0xb447('0xd')][_0xb447('0x11')];this[_0xb447('0xd')]=_[_0xb447('0x12')](this[_0xb447('0xc')],'id');this[_0xb447('0xd')][_0xb447('0x11')]=_0xf02e17;};SmsQueue[_0xb447('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xb447('0x13')]=0x0;for(var _0x56b103=0x0;_0x56b103=0x0?this[_0xb447('0x17')]:0x0;var _0x1552bd={'id':this['id'],'available':this[_0xb447('0x17')],'loggedIn':this[_0xb447('0x18')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb447('0x19')]};var _0x1fcd14=md5(JSON[_0xb447('0x1a')](_0x1552bd));if(this['md5']!==_0x1fcd14){this[_0xb447('0x1')]=_0x1fcd14;io['to'](util[_0xb447('0x1b')](_0xb447('0x1c'),_0x1552bd[_0xb447('0x8')]))[_0xb447('0x1d')]('sms_queue:save',_0x1552bd);}};module[_0xb447('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 6f95f80..401b883 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 _0xd8c2=['whatsapp_queue:save','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','online','whatsappPause','available','loggedIn','stringify','format','whatsapp:queue:%s','emit'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd8c2,0x6d));var _0x2d8c=function(_0x1ac429,_0x239000){_0x1ac429=_0x1ac429-0x0;var _0x914b8e=_0xd8c2[_0x1ac429];return _0x914b8e;};'use strict';var _=require('lodash');var md5=require(_0x2d8c('0x0'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x2d8c('0x1')]=_[_0x2d8c('0x2')](config['redis'],{'host':_0x2d8c('0x3'),'port':0x18eb});var io=require(_0x2d8c('0x4'))(new Redis(config[_0x2d8c('0x1')]));function WhatsappQueue(_0x39697d){this['id']=_0x39697d['id']||0x0;this[_0x2d8c('0x5')]=_0x39697d[_0x2d8c('0x5')]||'';this[_0x2d8c('0x6')]=_0x39697d[_0x2d8c('0x6')]||0xa;this[_0x2d8c('0x7')]=_0x39697d[_0x2d8c('0x7')]||_0x2d8c('0x8');this[_0x2d8c('0x9')]=_0x39697d[_0x2d8c('0x9')];this[_0x2d8c('0xa')]={};this[_0x2d8c('0xb')]=0x0;this[_0x2d8c('0x0')]='';this[_0x2d8c('0xc')]();this[_0x2d8c('0xd')]();}WhatsappQueue[_0x2d8c('0xe')][_0x2d8c('0xc')]=function(){var _0x5c4f40=this[_0x2d8c('0xa')][_0x2d8c('0xf')];this['mapAgentsId']=_[_0x2d8c('0x10')](this[_0x2d8c('0x9')],'id');this[_0x2d8c('0xa')]['_rr']=_0x5c4f40;};WhatsappQueue[_0x2d8c('0xe')][_0x2d8c('0xd')]=function(){this['loggedIn']=0x0;this[_0x2d8c('0x11')]=0x0;for(var _0xb2b06=0x0;_0xb2b06=0x0?this[_0x2d8c('0x14')]:0x0;var _0x28767a={'id':this['id'],'available':this[_0x2d8c('0x14')],'loggedIn':this[_0x2d8c('0x15')],'name':this[_0x2d8c('0x5')],'paused':this['paused'],'waiting':this[_0x2d8c('0xb')]};var _0x5d2e70=md5(JSON[_0x2d8c('0x16')](_0x28767a));if(this[_0x2d8c('0x0')]!==_0x5d2e70){this['md5']=_0x5d2e70;io['to'](util[_0x2d8c('0x17')](_0x2d8c('0x18'),_0x28767a[_0x2d8c('0x5')]))[_0x2d8c('0x19')](_0x2d8c('0x1a'),_0x28767a);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x9ecb=['mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','paused','online','loggedIn','whatsappPause','available','name','stringify','format','whatsapp:queue:%s','emit','exports','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','beepall','Agents'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9ecb,0xe9));var _0xb9ec=function(_0x2fff8e,_0x3f8df4){_0x2fff8e=_0x2fff8e-0x0;var _0x5ed4b6=_0x9ecb[_0x2fff8e];return _0x5ed4b6;};'use strict';var _=require('lodash');var md5=require(_0xb9ec('0x0'));var util=require(_0xb9ec('0x1'));var Redis=require(_0xb9ec('0x2'));var config=require(_0xb9ec('0x3'));config[_0xb9ec('0x4')]=_[_0xb9ec('0x5')](config[_0xb9ec('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xb9ec('0x6'))(new Redis(config[_0xb9ec('0x4')]));function WhatsappQueue(_0x514827){this['id']=_0x514827['id']||0x0;this['name']=_0x514827['name']||'';this[_0xb9ec('0x7')]=_0x514827['timeout']||0xa;this['strategy']=_0x514827['strategy']||_0xb9ec('0x8');this[_0xb9ec('0x9')]=_0x514827[_0xb9ec('0x9')];this[_0xb9ec('0xa')]={};this[_0xb9ec('0xb')]=0x0;this[_0xb9ec('0x0')]='';this[_0xb9ec('0xc')]();this[_0xb9ec('0xd')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x529c07=this[_0xb9ec('0xa')][_0xb9ec('0xe')];this[_0xb9ec('0xa')]=_['map'](this['Agents'],'id');this[_0xb9ec('0xa')][_0xb9ec('0xe')]=_0x529c07;};WhatsappQueue[_0xb9ec('0xf')][_0xb9ec('0xd')]=function(){this['loggedIn']=0x0;this[_0xb9ec('0x10')]=0x0;for(var _0x461436=0x0;_0x461436=0x0?this[_0xb9ec('0x14')]:0x0;var _0x171c57={'id':this['id'],'available':this[_0xb9ec('0x14')],'loggedIn':this[_0xb9ec('0x12')],'name':this[_0xb9ec('0x15')],'paused':this[_0xb9ec('0x10')],'waiting':this[_0xb9ec('0xb')]};var _0x45ebc1=md5(JSON[_0xb9ec('0x16')](_0x171c57));if(this['md5']!==_0x45ebc1){this['md5']=_0x45ebc1;io['to'](util[_0xb9ec('0x17')](_0xb9ec('0x18'),_0x171c57['name']))[_0xb9ec('0x19')]('whatsapp_queue:save',_0x171c57);}};module[_0xb9ec('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 89d4dde..3667138 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x2d3c74,_0x48277a){var _0x45cd21=function(_0x5903b8){while(--_0x5903b8){_0x2d3c74['push'](_0x2d3c74['shift']());}};_0x45cd21(++_0x48277a);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e409e,_0x2d227e){_0x2e409e=_0x2e409e-0x0;var _0xe6e039=_0xb10b[_0x2e409e];return _0xe6e039;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x229052,_0x301068){var _0xd7f7cf=function(_0x50c174){while(--_0x50c174){_0x229052['push'](_0x229052['shift']());}};_0xd7f7cf(++_0x301068);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a148f,_0x114dfa){_0x5a148f=_0x5a148f-0x0;var _0x5af2d4=_0xb10b[_0x5a148f];return _0x5af2d4;};'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 c8c6cc5..404374c 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 _0x8058=['../client','Request','UpdateChatInteraction','addTags'];(function(_0x9861d0,_0x9904af){var _0x126cf8=function(_0x5040b9){while(--_0x5040b9){_0x9861d0['push'](_0x9861d0['shift']());}};_0x126cf8(++_0x9904af);}(_0x8058,0x120));var _0x8805=function(_0x350796,_0x1bf21f){_0x350796=_0x350796-0x0;var _0x126f19=_0x8058[_0x350796];return _0x126f19;};'use strict';var client=require(_0x8805('0x0'));exports['update']=function(_0x32e8f3,_0x35520b){return client[_0x8805('0x1')](_0x8805('0x2'),{'body':_0x35520b,'options':{'where':{'id':_0x32e8f3}},'log':'updateChatInteraction'});};exports[_0x8805('0x3')]=function(_0x4f31df,_0x2bb04b){return client[_0x8805('0x1')]('AddTagsToChatInteraction',{'body':_0x2bb04b,'options':{'where':{'id':_0x4f31df}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x5aa9=['UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x5aa9,0xd8));var _0x95aa=function(_0xbc9024,_0x4a8e5d){_0xbc9024=_0xbc9024-0x0;var _0x218f85=_0x5aa9[_0xbc9024];return _0x218f85;};'use strict';var client=require(_0x95aa('0x0'));exports['update']=function(_0x2d703a,_0x3d3bc1){return client['Request'](_0x95aa('0x1'),{'body':_0x3d3bc1,'options':{'where':{'id':_0x2d703a}},'log':_0x95aa('0x2')});};exports[_0x95aa('0x3')]=function(_0x1c955c,_0x5a89f7){return client[_0x95aa('0x4')](_0x95aa('0x5'),{'body':_0x5a89f7,'options':{'where':{'id':_0x1c955c}},'log':_0x95aa('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 5ca90bb..ac062d3 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 _0xc0a5=['../client','create','Request','CreateChatMessage'];(function(_0xb429d3,_0x507d86){var _0x31d3d6=function(_0x390f88){while(--_0x390f88){_0xb429d3['push'](_0xb429d3['shift']());}};_0x31d3d6(++_0x507d86);}(_0xc0a5,0xbc));var _0x5c0a=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xc0a5[_0x2aea9e];return _0x430b92;};'use strict';var client=require(_0x5c0a('0x0'));exports[_0x5c0a('0x1')]=function(_0x1b3c50){return client[_0x5c0a('0x2')](_0x5c0a('0x3'),{'body':_0x1b3c50,'log':'createChatMessage'});}; \ No newline at end of file +var _0x1bb0=['../client','create','CreateChatMessage','createChatMessage'];(function(_0x1e2a2d,_0xe60081){var _0x2f0eee=function(_0x2761cb){while(--_0x2761cb){_0x1e2a2d['push'](_0x1e2a2d['shift']());}};_0x2f0eee(++_0xe60081);}(_0x1bb0,0x160));var _0x01bb=function(_0x5e069b,_0x1befa3){_0x5e069b=_0x5e069b-0x0;var _0x2c6806=_0x1bb0[_0x5e069b];return _0x2c6806;};'use strict';var client=require(_0x01bb('0x0'));exports[_0x01bb('0x1')]=function(_0x5c748f){return client['Request'](_0x01bb('0x2'),{'body':_0x5c748f,'log':_0x01bb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 08cf792..c7f905f 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 _0xfd6e=['getChatQueues','../client','Request','name','timeout'];(function(_0x129248,_0x3a7f17){var _0x51949e=function(_0x3eecd0){while(--_0x3eecd0){_0x129248['push'](_0x129248['shift']());}};_0x51949e(++_0x3a7f17);}(_0xfd6e,0x16e));var _0xefd6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd6e[_0x2641f9];return _0x585741;};'use strict';var client=require(_0xefd6('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xefd6('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xefd6('0x2'),_0xefd6('0x3'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xefd6('0x2'),'online','chatPause']}]},'log':_0xefd6('0x4')});};}; \ No newline at end of file +var _0x5334=['getChatQueues','Request','GetChatQueue','name','strategy','Agents','../client'];(function(_0xdf4fd2,_0x253d68){var _0x40c29c=function(_0xc52a6c){while(--_0xc52a6c){_0xdf4fd2['push'](_0xdf4fd2['shift']());}};_0x40c29c(++_0x253d68);}(_0x5334,0x84));var _0x4533=function(_0x1577ee,_0xd7ffc1){_0x1577ee=_0x1577ee-0x0;var _0x5a0873=_0x5334[_0x1577ee];return _0x5a0873;};'use strict';var client=require(_0x4533('0x0'));exports[_0x4533('0x1')]=function(){return function(){return client[_0x4533('0x2')](_0x4533('0x3'),{'options':{'raw':![],'attributes':['id',_0x4533('0x4'),'timeout',_0x4533('0x5')],'include':[{'model':'User','as':_0x4533('0x6'),'attributes':['id',_0x4533('0x4'),'online','chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 76eee59..b4f499f 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 _0x615a=['UpdateChatQueueReport','../client','CreateChatQueueReport','update','Request'];(function(_0x24f96e,_0x4d2c65){var _0x4b9971=function(_0x5428ae){while(--_0x5428ae){_0x24f96e['push'](_0x24f96e['shift']());}};_0x4b9971(++_0x4d2c65);}(_0x615a,0x119));var _0xa615=function(_0x3050b5,_0x182c6a){_0x3050b5=_0x3050b5-0x0;var _0x37cceb=_0x615a[_0x3050b5];return _0x37cceb;};'use strict';var client=require(_0xa615('0x0'));exports['create']=function(_0x21ebaf){return client['Request'](_0xa615('0x1'),{'body':_0x21ebaf,'log':_0xa615('0x1')});};exports[_0xa615('0x2')]=function(_0x11fd6e,_0x52ae35){return client[_0xa615('0x3')](_0xa615('0x4'),{'body':_0x52ae35,'options':{'where':{'uniqueid':_0x11fd6e},'order':[['id','DESC']],'limit':0x1},'log':_0xa615('0x4')});}; \ No newline at end of file +var _0x615a=['UpdateChatQueueReport','../client','CreateChatQueueReport','update','Request'];(function(_0x2a4f05,_0x44e643){var _0x3822c8=function(_0x493c99){while(--_0x493c99){_0x2a4f05['push'](_0x2a4f05['shift']());}};_0x3822c8(++_0x44e643);}(_0x615a,0x119));var _0xa615=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x615a[_0x2f3848];return _0x102668;};'use strict';var client=require(_0xa615('0x0'));exports['create']=function(_0x21ebaf){return client['Request'](_0xa615('0x1'),{'body':_0x21ebaf,'log':_0xa615('0x1')});};exports[_0xa615('0x2')]=function(_0x11fd6e,_0x52ae35){return client[_0xa615('0x3')](_0xa615('0x4'),{'body':_0x52ae35,'options':{'where':{'uniqueid':_0x11fd6e},'order':[['id','DESC']],'limit':0x1},'log':_0xa615('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index a42fd6e..9c8eb7e 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x538db5,_0x98824b){var _0x51d6b1=function(_0x383160){while(--_0x383160){_0x538db5['push'](_0x538db5['shift']());}};_0x51d6b1(++_0x98824b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0x7a54,0x106));var _0x47a5=function(_0x2768c6,_0x1be5fa){_0x2768c6=_0x2768c6-0x0;var _0x424e22=_0x7a54[_0x2768c6];return _0x424e22;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 0b602e1..d4b27cc 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 _0xdeb5=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x388e06,_0x4f0e86){var _0x35d91d=function(_0x430fa5){while(--_0x430fa5){_0x388e06['push'](_0x388e06['shift']());}};_0x35d91d(++_0x4f0e86);}(_0xdeb5,0xf6));var _0x5deb=function(_0x5d5085,_0x30a2e4){_0x5d5085=_0x5d5085-0x0;var _0x312ee8=_0xdeb5[_0x5d5085];return _0x312ee8;};'use strict';var client=require(_0x5deb('0x0'));exports[_0x5deb('0x1')]=function(_0x1d775d){return client[_0x5deb('0x2')](_0x5deb('0x3'),{'body':_0x1d775d,'log':_0x5deb('0x4')});}; \ No newline at end of file +var _0x0c1b=['Request','createFaxMessage','../client','create'];(function(_0x5b0865,_0x2949b0){var _0x509c4b=function(_0x3d0ec6){while(--_0x3d0ec6){_0x5b0865['push'](_0x5b0865['shift']());}};_0x509c4b(++_0x2949b0);}(_0x0c1b,0x1f2));var _0xb0c1=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x0c1b[_0x2b9e8a];return _0x520e67;};'use strict';var client=require(_0xb0c1('0x0'));exports[_0xb0c1('0x1')]=function(_0x1d300){return client[_0xb0c1('0x2')]('CreateFaxMessage',{'body':_0x1d300,'log':_0xb0c1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 0a0279e..41ff88b 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 _0x4f5a=['User','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x2c43f8,_0x3cd046){var _0x4648fc=function(_0x3bd94a){while(--_0x3bd94a){_0x2c43f8['push'](_0x2c43f8['shift']());}};_0x4648fc(++_0x3cd046);}(_0x4f5a,0xf7));var _0xa4f5=function(_0x4ad0a4,_0x59264a){_0x4ad0a4=_0x4ad0a4-0x0;var _0x24a31d=_0x4f5a[_0x4ad0a4];return _0x24a31d;};'use strict';var client=require(_0xa4f5('0x0'));exports[_0xa4f5('0x1')]=function(){return function(){return client[_0xa4f5('0x2')](_0xa4f5('0x3'),{'options':{'raw':![],'attributes':['id',_0xa4f5('0x4'),'timeout','strategy'],'include':[{'model':_0xa4f5('0x5'),'as':'Agents','attributes':['id',_0xa4f5('0x4'),'online','faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xadce=['Agents','online','Request','GetFaxQueue','name','strategy'];(function(_0x20d303,_0x22bec3){var _0x1bbe3c=function(_0x37b0fa){while(--_0x37b0fa){_0x20d303['push'](_0x20d303['shift']());}};_0x1bbe3c(++_0x22bec3);}(_0xadce,0x194));var _0xeadc=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xadce[_0x15c421];return _0x5e5ed5;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xeadc('0x0')](_0xeadc('0x1'),{'options':{'raw':![],'attributes':['id',_0xeadc('0x2'),'timeout',_0xeadc('0x3')],'include':[{'model':'User','as':_0xeadc('0x4'),'attributes':['id',_0xeadc('0x2'),_0xeadc('0x5'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index c0d9b61..7ac4feb 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 _0x5f3f=['UpdateFaxQueueReport','DESC','../client','CreateFaxQueueReport','Request'];(function(_0x45b9c6,_0x1ec45c){var _0xfc724e=function(_0x3db2be){while(--_0x3db2be){_0x45b9c6['push'](_0x45b9c6['shift']());}};_0xfc724e(++_0x1ec45c);}(_0x5f3f,0x1f1));var _0xf5f3=function(_0x2b0a08,_0x351fca){_0x2b0a08=_0x2b0a08-0x0;var _0x51aac5=_0x5f3f[_0x2b0a08];return _0x51aac5;};'use strict';var client=require(_0xf5f3('0x0'));exports['create']=function(_0xf69d47){return client['Request'](_0xf5f3('0x1'),{'body':_0xf69d47,'log':_0xf5f3('0x1')});};exports['update']=function(_0x42c41f,_0x11407f){return client[_0xf5f3('0x2')](_0xf5f3('0x3'),{'body':_0x11407f,'options':{'where':{'uniqueid':_0x42c41f},'order':[['id',_0xf5f3('0x4')]],'limit':0x1},'log':_0xf5f3('0x3')});}; \ No newline at end of file +var _0x448c=['UpdateFaxQueueReport','DESC','../client','Request','CreateFaxQueueReport','update'];(function(_0x120551,_0x58b3c7){var _0x8cb3f3=function(_0x2049dd){while(--_0x2049dd){_0x120551['push'](_0x120551['shift']());}};_0x8cb3f3(++_0x58b3c7);}(_0x448c,0x176));var _0xc448=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x448c[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0xc448('0x0'));exports['create']=function(_0x3525c6){return client[_0xc448('0x1')](_0xc448('0x2'),{'body':_0x3525c6,'log':_0xc448('0x2')});};exports[_0xc448('0x3')]=function(_0x105241,_0x40b33f){return client[_0xc448('0x1')](_0xc448('0x4'),{'body':_0x40b33f,'options':{'where':{'uniqueid':_0x105241},'order':[['id',_0xc448('0x5')]],'limit':0x1},'log':_0xc448('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 960beac..a2a86be 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 _0x5d5f=['name','Intervals','interval','../client','getIntervals','GetInterval'];(function(_0x22f8a2,_0x2c6908){var _0x586c6e=function(_0xb3358b){while(--_0xb3358b){_0x22f8a2['push'](_0x22f8a2['shift']());}};_0x586c6e(++_0x2c6908);}(_0x5d5f,0xed));var _0xf5d5=function(_0x21ebf6,_0x592611){_0x21ebf6=_0x21ebf6-0x0;var _0x14a0da=_0x5d5f[_0x21ebf6];return _0x14a0da;};'use strict';var client=require(_0xf5d5('0x0'));exports[_0xf5d5('0x1')]=function(){return function(){return client['Request'](_0xf5d5('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf5d5('0x3')],'include':[{'model':'Interval','as':_0xf5d5('0x4'),'attributes':['id',_0xf5d5('0x3'),_0xf5d5('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xc481=['getIntervals','Request','name','interval','../client'];(function(_0x523997,_0x5015d5){var _0x1c3450=function(_0x3ec79a){while(--_0x3ec79a){_0x523997['push'](_0x523997['shift']());}};_0x1c3450(++_0x5015d5);}(_0xc481,0x199));var _0x1c48=function(_0x112aa9,_0x51a391){_0x112aa9=_0x112aa9-0x0;var _0xebc169=_0xc481[_0x112aa9];return _0xebc169;};'use strict';var client=require(_0x1c48('0x0'));exports[_0x1c48('0x1')]=function(){return function(){return client[_0x1c48('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1c48('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0x1c48('0x4')]}]},'log':_0x1c48('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 848f2ae..36caf1a 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 _0xadb5=['Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update'];(function(_0x1eeb04,_0x380814){var _0x56b7ed=function(_0xe4b5b8){while(--_0xe4b5b8){_0x1eeb04['push'](_0x1eeb04['shift']());}};_0x56b7ed(++_0x380814);}(_0xadb5,0xad));var _0x5adb=function(_0x418304,_0x37a01f){_0x418304=_0x418304-0x0;var _0x5c9afe=_0xadb5[_0x418304];return _0x5c9afe;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(_0x49fc17,_0x3d6340){return client[_0x5adb('0x1')](_0x5adb('0x2'),{'body':_0x3d6340,'options':{'where':{'id':_0x49fc17}},'log':'updateMailInteraction'});};exports[_0x5adb('0x3')]=function(_0x31457,_0x2e3ef4){return client['Request'](_0x5adb('0x4'),{'body':_0x2e3ef4,'options':{'where':{'id':_0x31457}},'log':_0x5adb('0x5')});}; \ No newline at end of file +var _0x1c9a=['updateMailInteraction','AddTagsToMailInteraction','../client','Request','UpdateMailInteraction'];(function(_0x370732,_0x304cac){var _0x3226d8=function(_0xafef58){while(--_0xafef58){_0x370732['push'](_0x370732['shift']());}};_0x3226d8(++_0x304cac);}(_0x1c9a,0x98));var _0xa1c9=function(_0x45057d,_0x585f7c){_0x45057d=_0x45057d-0x0;var _0x171115=_0x1c9a[_0x45057d];return _0x171115;};'use strict';var client=require(_0xa1c9('0x0'));exports['update']=function(_0x470dcd,_0x5c45c5){return client[_0xa1c9('0x1')](_0xa1c9('0x2'),{'body':_0x5c45c5,'options':{'where':{'id':_0x470dcd}},'log':_0xa1c9('0x3')});};exports['addTags']=function(_0x21c0fc,_0x45d1f7){return client[_0xa1c9('0x1')](_0xa1c9('0x4'),{'body':_0x45d1f7,'options':{'where':{'id':_0x21c0fc}},'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 589336b..c31ee67 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 _0xa239=['../client','CreateMailMessage','createMailMessage'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa239,0x14d));var _0x9a23=function(_0x503e92,_0x23ccb8){_0x503e92=_0x503e92-0x0;var _0x3062c7=_0xa239[_0x503e92];return _0x3062c7;};'use strict';var client=require(_0x9a23('0x0'));exports['create']=function(_0xb80118){return client['Request'](_0x9a23('0x1'),{'body':_0xb80118,'log':_0x9a23('0x2')});}; \ No newline at end of file +var _0x7568=['CreateMailMessage','createMailMessage','../client','create'];(function(_0x1fa118,_0x240182){var _0x34ebbe=function(_0x686173){while(--_0x686173){_0x1fa118['push'](_0x1fa118['shift']());}};_0x34ebbe(++_0x240182);}(_0x7568,0x9a));var _0x8756=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x7568[_0x556bb1];return _0x45455f;};'use strict';var client=require(_0x8756('0x0'));exports[_0x8756('0x1')]=function(_0x3a25fc){return client['Request'](_0x8756('0x2'),{'body':_0x3a25fc,'log':_0x8756('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 3daee26..e5aef8a 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 _0xba48=['strategy','User','Agents','online','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x1f4e19,_0x44ddb4){var _0x136a51=function(_0x858d23){while(--_0x858d23){_0x1f4e19['push'](_0x1f4e19['shift']());}};_0x136a51(++_0x44ddb4);}(_0xba48,0xd3));var _0x8ba4=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xba48[_0x4154a6];return _0x3b2786;};'use strict';var client=require(_0x8ba4('0x0'));exports[_0x8ba4('0x1')]=function(){return function(){return client[_0x8ba4('0x2')](_0x8ba4('0x3'),{'options':{'raw':![],'attributes':['id',_0x8ba4('0x4'),'timeout',_0x8ba4('0x5')],'include':[{'model':_0x8ba4('0x6'),'as':_0x8ba4('0x7'),'attributes':['id',_0x8ba4('0x4'),_0x8ba4('0x8'),'mailPause']}]},'log':_0x8ba4('0x1')});};}; \ No newline at end of file +var _0x6a26=['../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x41f4a0,_0x59e659){var _0x395b4c=function(_0x29cbcf){while(--_0x29cbcf){_0x41f4a0['push'](_0x41f4a0['shift']());}};_0x395b4c(++_0x59e659);}(_0x6a26,0x1d4));var _0x66a2=function(_0x5318c8,_0x29ec1b){_0x5318c8=_0x5318c8-0x0;var _0x44b0be=_0x6a26[_0x5318c8];return _0x44b0be;};'use strict';var client=require(_0x66a2('0x0'));exports[_0x66a2('0x1')]=function(){return function(){return client[_0x66a2('0x2')](_0x66a2('0x3'),{'options':{'raw':![],'attributes':['id',_0x66a2('0x4'),_0x66a2('0x5'),_0x66a2('0x6')],'include':[{'model':_0x66a2('0x7'),'as':_0x66a2('0x8'),'attributes':['id','name','online','mailPause']}]},'log':_0x66a2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 40d4f2a..715efca 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 _0x0e15=['Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x35bbb9,_0x274ecc){var _0x463e72=function(_0x1c04f0){while(--_0x1c04f0){_0x35bbb9['push'](_0x35bbb9['shift']());}};_0x463e72(++_0x274ecc);}(_0x0e15,0x10c));var _0x50e1=function(_0x14b280,_0x152d8e){_0x14b280=_0x14b280-0x0;var _0x437453=_0x0e15[_0x14b280];return _0x437453;};'use strict';var client=require('../client');exports['create']=function(_0x4ead58){return client[_0x50e1('0x0')](_0x50e1('0x1'),{'body':_0x4ead58,'log':_0x50e1('0x1')});};exports[_0x50e1('0x2')]=function(_0x94e842,_0x2144a7){return client[_0x50e1('0x0')]('UpdateMailQueueReport',{'body':_0x2144a7,'options':{'where':{'uniqueid':_0x94e842},'order':[['id','DESC']],'limit':0x1},'log':_0x50e1('0x3')});}; \ No newline at end of file +var _0xf7eb=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf7eb,0x6d));var _0xbf7e=function(_0x3242da,_0x70834f){_0x3242da=_0x3242da-0x0;var _0x4e04e0=_0xf7eb[_0x3242da];return _0x4e04e0;};'use strict';var client=require(_0xbf7e('0x0'));exports[_0xbf7e('0x1')]=function(_0x58050f){return client[_0xbf7e('0x2')](_0xbf7e('0x3'),{'body':_0x58050f,'log':_0xbf7e('0x3')});};exports[_0xbf7e('0x4')]=function(_0x3cc621,_0x4cb6ef){return client[_0xbf7e('0x2')](_0xbf7e('0x5'),{'body':_0x4cb6ef,'options':{'where':{'uniqueid':_0x3cc621},'order':[['id',_0xbf7e('0x6')]],'limit':0x1},'log':_0xbf7e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 2c1796e..2d2a2ef 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 _0x017d=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0x017d,0x70));var _0xd017=function(_0x573425,_0x1ad9cd){_0x573425=_0x573425-0x0;var _0x14c458=_0x017d[_0x573425];return _0x14c458;};'use strict';var client=require(_0xd017('0x0'));exports[_0xd017('0x1')]=function(_0xf4f0d0,_0x557f05){return client[_0xd017('0x2')](_0xd017('0x3'),{'body':_0x557f05,'options':{'where':{'id':_0xf4f0d0}},'log':_0xd017('0x4')});};exports[_0xd017('0x5')]=function(_0x8a6110,_0x451238){return client[_0xd017('0x2')](_0xd017('0x6'),{'body':_0x451238,'options':{'where':{'id':_0x8a6110}},'log':_0xd017('0x7')});}; \ No newline at end of file +var _0xdbbe=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbbe,0xda));var _0xedbb=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0xdbbe[_0x53d172];return _0x1bd0a2;};'use strict';var client=require('../client');exports[_0xedbb('0x0')]=function(_0x36edd7,_0x4882b4){return client[_0xedbb('0x1')](_0xedbb('0x2'),{'body':_0x4882b4,'options':{'where':{'id':_0x36edd7}},'log':_0xedbb('0x3')});};exports[_0xedbb('0x4')]=function(_0x6d7e79,_0x30553e){return client[_0xedbb('0x1')](_0xedbb('0x5'),{'body':_0x30553e,'options':{'where':{'id':_0x6d7e79}},'log':_0xedbb('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 4c5cb66..77b9437 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 _0x4dce=['create','Request','createOpenchannelMessage'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x4dce,0xd2));var _0xe4dc=function(_0xa7662e,_0x22304d){_0xa7662e=_0xa7662e-0x0;var _0x425053=_0x4dce[_0xa7662e];return _0x425053;};'use strict';var client=require('../client');exports[_0xe4dc('0x0')]=function(_0x30da99){return client[_0xe4dc('0x1')]('CreateOpenchannelMessage',{'body':_0x30da99,'log':_0xe4dc('0x2')});}; \ No newline at end of file +var _0x9f6d=['../client','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x18a494,_0xb35894){var _0x232f4e=function(_0x1a36e0){while(--_0x1a36e0){_0x18a494['push'](_0x18a494['shift']());}};_0x232f4e(++_0xb35894);}(_0x9f6d,0x18c));var _0xd9f6=function(_0x49f353,_0x16d359){_0x49f353=_0x49f353-0x0;var _0xc86538=_0x9f6d[_0x49f353];return _0xc86538;};'use strict';var client=require(_0xd9f6('0x0'));exports['create']=function(_0x412779){return client[_0xd9f6('0x1')](_0xd9f6('0x2'),{'body':_0x412779,'log':_0xd9f6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 1657a0d..72d2af1 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 _0x2a0b=['name','timeout','User','Agents','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x195155,_0x5bc11f){var _0x62cf02=function(_0x5f1881){while(--_0x5f1881){_0x195155['push'](_0x195155['shift']());}};_0x62cf02(++_0x5bc11f);}(_0x2a0b,0xc3));var _0xb2a0=function(_0x1943a1,_0x36f236){_0x1943a1=_0x1943a1-0x0;var _0x1b5e6c=_0x2a0b[_0x1943a1];return _0x1b5e6c;};'use strict';var client=require('../client');exports[_0xb2a0('0x0')]=function(){return function(){return client[_0xb2a0('0x1')](_0xb2a0('0x2'),{'options':{'raw':![],'attributes':['id',_0xb2a0('0x3'),_0xb2a0('0x4'),'strategy'],'include':[{'model':_0xb2a0('0x5'),'as':_0xb2a0('0x6'),'attributes':['id','name',_0xb2a0('0x7'),_0xb2a0('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xc045=['User','online','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x4a127f,_0x4806a0){var _0x230c6a=function(_0x5b5783){while(--_0x5b5783){_0x4a127f['push'](_0x4a127f['shift']());}};_0x230c6a(++_0x4806a0);}(_0xc045,0x19a));var _0x5c04=function(_0x4dccf2,_0x5cfcd7){_0x4dccf2=_0x4dccf2-0x0;var _0x12640e=_0xc045[_0x4dccf2];return _0x12640e;};'use strict';var client=require('../client');exports[_0x5c04('0x0')]=function(){return function(){return client[_0x5c04('0x1')](_0x5c04('0x2'),{'options':{'raw':![],'attributes':['id',_0x5c04('0x3'),_0x5c04('0x4'),_0x5c04('0x5')],'include':[{'model':_0x5c04('0x6'),'as':'Agents','attributes':['id','name',_0x5c04('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 65d1cf4..e6f975b 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 _0xce61=['update','DESC','../client','Request','CreateOpenchannelQueueReport'];(function(_0x59f0c5,_0x1eec55){var _0x3d3ee5=function(_0x23d240){while(--_0x23d240){_0x59f0c5['push'](_0x59f0c5['shift']());}};_0x3d3ee5(++_0x1eec55);}(_0xce61,0x66));var _0x1ce6=function(_0x27f54f,_0x14bf3a){_0x27f54f=_0x27f54f-0x0;var _0x1dd993=_0xce61[_0x27f54f];return _0x1dd993;};'use strict';var client=require(_0x1ce6('0x0'));exports['create']=function(_0x1ea0c6){return client[_0x1ce6('0x1')]('CreateOpenchannelQueueReport',{'body':_0x1ea0c6,'log':_0x1ce6('0x2')});};exports[_0x1ce6('0x3')]=function(_0x18c1ac,_0x6c164f){return client[_0x1ce6('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x6c164f,'options':{'where':{'uniqueid':_0x18c1ac},'order':[['id',_0x1ce6('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x6027=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x6027,0xc5));var _0x7602=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x6027[_0x4e11d5];return _0x5e4e4c;};'use strict';var client=require(_0x7602('0x0'));exports[_0x7602('0x1')]=function(_0x3f3c84){return client[_0x7602('0x2')](_0x7602('0x3'),{'body':_0x3f3c84,'log':_0x7602('0x3')});};exports['update']=function(_0x484ac7,_0xc3bcb8){return client['Request'](_0x7602('0x4'),{'body':_0xc3bcb8,'options':{'where':{'uniqueid':_0x484ac7},'order':[['id','DESC']],'limit':0x1},'log':_0x7602('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 6ee5eb1..7ef80c1 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 _0x5eb8=['update','UpdateSmsInteraction','updateSmsInteraction','Request','AddTagsToSmsInteraction'];(function(_0x39eaf2,_0x20c7a5){var _0x400821=function(_0xf2e27d){while(--_0xf2e27d){_0x39eaf2['push'](_0x39eaf2['shift']());}};_0x400821(++_0x20c7a5);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x163977,_0x4ef72e){_0x163977=_0x163977-0x0;var _0x28bf3a=_0x5eb8[_0x163977];return _0x28bf3a;};'use strict';var client=require('../client');exports[_0x85eb('0x0')]=function(_0x3d2bc4,_0x5d08e2){return client['Request'](_0x85eb('0x1'),{'body':_0x5d08e2,'options':{'where':{'id':_0x3d2bc4}},'log':_0x85eb('0x2')});};exports['addTags']=function(_0x41b11e,_0x30ac6a){return client[_0x85eb('0x3')](_0x85eb('0x4'),{'body':_0x30ac6a,'options':{'where':{'id':_0x41b11e}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xc23a=['update','UpdateSmsInteraction','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0xc23a,0xd2));var _0xac23=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xc23a[_0xe45118];return _0x15e15d;};'use strict';var client=require('../client');exports[_0xac23('0x0')]=function(_0xc17fba,_0xf70a16){return client['Request'](_0xac23('0x1'),{'body':_0xf70a16,'options':{'where':{'id':_0xc17fba}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x35c541,_0x4f104c){return client[_0xac23('0x2')](_0xac23('0x3'),{'body':_0x4f104c,'options':{'where':{'id':_0x35c541}},'log':_0xac23('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index b0a7de8..ace0d88 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 _0xd291=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd291,0x1c2));var _0x1d29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd291[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x1d29('0x0'));exports[_0x1d29('0x1')]=function(_0x53bc63){return client[_0x1d29('0x2')](_0x1d29('0x3'),{'body':_0x53bc63,'log':_0x1d29('0x4')});}; \ No newline at end of file +var _0xbbe9=['create','Request','CreateSmsMessage','../client'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0xbbe9,0x13f));var _0x9bbe=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xbbe9[_0x3d42d8];return _0x27fc41;};'use strict';var client=require(_0x9bbe('0x0'));exports[_0x9bbe('0x1')]=function(_0x283bf4){return client[_0x9bbe('0x2')](_0x9bbe('0x3'),{'body':_0x283bf4,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index af33d3c..30ea5f7 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x2b9c0c,_0x4678a3){var _0xd8577b=function(_0x2dd9eb){while(--_0x2dd9eb){_0x2b9c0c['push'](_0x2b9c0c['shift']());}};_0xd8577b(++_0x4678a3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x57d862,_0x316dea){var _0x320229=function(_0x19c988){while(--_0x19c988){_0x57d862['push'](_0x57d862['shift']());}};_0x320229(++_0x316dea);}(_0x70e0,0x17b));var _0x070e=function(_0x177fc3,_0x4813de){_0x177fc3=_0x177fc3-0x0;var _0x34ba9a=_0x70e0[_0x177fc3];return _0x34ba9a;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 762ab27..1332888 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(_0xf34218,_0x540a71){var _0x13c3c3=function(_0x2a1593){while(--_0x2a1593){_0xf34218['push'](_0xf34218['shift']());}};_0x13c3c3(++_0x540a71);}(_0x3e74,0x175));var _0x43e7=function(_0x403ad4,_0x281ddb){_0x403ad4=_0x403ad4-0x0;var _0x4c8fef=_0x3e74[_0x403ad4];return _0x4c8fef;};'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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x2d6cae,_0x1664f9){var _0x563a9e=function(_0x2171d9){while(--_0x2171d9){_0x2d6cae['push'](_0x2d6cae['shift']());}};_0x563a9e(++_0x1664f9);}(_0x34e8,0x12c));var _0x834e=function(_0xc8452a,_0x51c896){_0xc8452a=_0xc8452a-0x0;var _0x51bc58=_0x34e8[_0xc8452a];return _0x51bc58;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 43bdc22..64a5325 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(_0x342881,_0x2194cc){var _0x39f77e=function(_0x399489){while(--_0x399489){_0x342881['push'](_0x342881['shift']());}};_0x39f77e(++_0x2194cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x23b5d3,_0x52625f){var _0x38c51f=function(_0x151cce){while(--_0x151cce){_0x23b5d3['push'](_0x23b5d3['shift']());}};_0x38c51f(++_0x52625f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 4e65fd6..5d9de0d 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 _0x8daf=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction'];(function(_0x590327,_0x5f4c8f){var _0x31e17c=function(_0xd0b92){while(--_0xd0b92){_0x590327['push'](_0x590327['shift']());}};_0x31e17c(++_0x5f4c8f);}(_0x8daf,0x15c));var _0xf8da=function(_0x1116cd,_0x41a0b7){_0x1116cd=_0x1116cd-0x0;var _0x52974a=_0x8daf[_0x1116cd];return _0x52974a;};'use strict';var client=require('../client');exports['update']=function(_0x5836b2,_0x56529b){return client[_0xf8da('0x0')](_0xf8da('0x1'),{'body':_0x56529b,'options':{'where':{'id':_0x5836b2}},'log':'updateWhatsappInteraction'});};exports[_0xf8da('0x2')]=function(_0x109758,_0x258561){return client[_0xf8da('0x0')](_0xf8da('0x3'),{'body':_0x258561,'options':{'where':{'id':_0x109758}},'log':_0xf8da('0x4')});}; \ No newline at end of file +var _0x3595=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','update'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0x3595,0x147));var _0x5359=function(_0x2ebbda,_0x129ce9){_0x2ebbda=_0x2ebbda-0x0;var _0x3755ad=_0x3595[_0x2ebbda];return _0x3755ad;};'use strict';var client=require(_0x5359('0x0'));exports[_0x5359('0x1')]=function(_0xa74118,_0x52b0f5){return client[_0x5359('0x2')](_0x5359('0x3'),{'body':_0x52b0f5,'options':{'where':{'id':_0xa74118}},'log':_0x5359('0x4')});};exports[_0x5359('0x5')]=function(_0x1fa814,_0x125c76){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x125c76,'options':{'where':{'id':_0x1fa814}},'log':_0x5359('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 738fa95..aede9d7 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 _0x10d2=['CreateWhatsappMessage','../client','create','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x10d2,0xf5));var _0x210d=function(_0x499883,_0x4ddfbf){_0x499883=_0x499883-0x0;var _0x460480=_0x10d2[_0x499883];return _0x460480;};'use strict';var client=require(_0x210d('0x0'));exports[_0x210d('0x1')]=function(_0x4155c2){return client[_0x210d('0x2')](_0x210d('0x3'),{'body':_0x4155c2,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x91b6=['Request','CreateWhatsappMessage','createWhatsappMessage','create'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x91b6,0xff));var _0x691b=function(_0x583e98,_0x5534f5){_0x583e98=_0x583e98-0x0;var _0x84cc30=_0x91b6[_0x583e98];return _0x84cc30;};'use strict';var client=require('../client');exports[_0x691b('0x0')]=function(_0x57edb8){return client[_0x691b('0x1')](_0x691b('0x2'),{'body':_0x57edb8,'log':_0x691b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index e6f9de4..8c3a255 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 _0x986b=['whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','strategy','User','Agents','name'];(function(_0x39828c,_0x7ec604){var _0x5f4c03=function(_0x2be4ac){while(--_0x2be4ac){_0x39828c['push'](_0x39828c['shift']());}};_0x5f4c03(++_0x7ec604);}(_0x986b,0x89));var _0xb986=function(_0x9a2c7e,_0x23f76f){_0x9a2c7e=_0x9a2c7e-0x0;var _0x4884b5=_0x986b[_0x9a2c7e];return _0x4884b5;};'use strict';var client=require('../client');exports[_0xb986('0x0')]=function(){return function(){return client[_0xb986('0x1')](_0xb986('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xb986('0x3')],'include':[{'model':_0xb986('0x4'),'as':_0xb986('0x5'),'attributes':['id',_0xb986('0x6'),'online',_0xb986('0x7')]}]},'log':_0xb986('0x0')});};}; \ No newline at end of file +var _0xdf02=['../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','User','Agents','name','whatsappPause'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0xdf02,0x171));var _0x2df0=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xdf02[_0x13b8f3];return _0x1a6d06;};'use strict';var client=require(_0x2df0('0x0'));exports[_0x2df0('0x1')]=function(){return function(){return client[_0x2df0('0x2')](_0x2df0('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2df0('0x4'),'strategy'],'include':[{'model':_0x2df0('0x5'),'as':_0x2df0('0x6'),'attributes':['id',_0x2df0('0x7'),'online',_0x2df0('0x8')]}]},'log':_0x2df0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index a415e42..becd075 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 _0x8b03=['Request','UpdateWhatsappQueueReport','DESC','create','CreateWhatsappQueueReport','update'];(function(_0x3486dd,_0x14cc41){var _0x1ab27b=function(_0x57b0c6){while(--_0x57b0c6){_0x3486dd['push'](_0x3486dd['shift']());}};_0x1ab27b(++_0x14cc41);}(_0x8b03,0x141));var _0x38b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b03[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x38b0('0x0')]=function(_0x57fcb9){return client['Request'](_0x38b0('0x1'),{'body':_0x57fcb9,'log':_0x38b0('0x1')});};exports[_0x38b0('0x2')]=function(_0x1d0cbc,_0x4c724c){return client[_0x38b0('0x3')](_0x38b0('0x4'),{'body':_0x4c724c,'options':{'where':{'uniqueid':_0x1d0cbc},'order':[['id',_0x38b0('0x5')]],'limit':0x1},'log':_0x38b0('0x4')});}; \ No newline at end of file +var _0x58d4=['UpdateWhatsappQueueReport','DESC','CreateWhatsappQueueReport','update','Request'];(function(_0x586efd,_0xd89dfe){var _0x26cab5=function(_0x4f9689){while(--_0x4f9689){_0x586efd['push'](_0x586efd['shift']());}};_0x26cab5(++_0xd89dfe);}(_0x58d4,0xf2));var _0x458d=function(_0x413c0b,_0xa4f540){_0x413c0b=_0x413c0b-0x0;var _0x20f16b=_0x58d4[_0x413c0b];return _0x20f16b;};'use strict';var client=require('../client');exports['create']=function(_0x42a4b2){return client['Request']('CreateWhatsappQueueReport',{'body':_0x42a4b2,'log':_0x458d('0x0')});};exports[_0x458d('0x1')]=function(_0x2a942b,_0x372939){return client[_0x458d('0x2')](_0x458d('0x3'),{'body':_0x372939,'options':{'where':{'uniqueid':_0x2a942b},'order':[['id',_0x458d('0x4')]],'limit':0x1},'log':_0x458d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index dbfcad2..1cfad19 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 _0x61db=['rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','seq-queue','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','[%s][AGENT]\x20%s','message','stop','timeout','createQueue','atimeout','channel','START:%s'];(function(_0x2be4ac,_0xa4d52d){var _0x46d6e8=function(_0x5ddfd2){while(--_0x5ddfd2){_0x2be4ac['push'](_0x2be4ac['shift']());}};_0x46d6e8(++_0xa4d52d);}(_0x61db,0x160));var _0xb61d=function(_0x12bd62,_0x8ee23a){_0x12bd62=_0x12bd62-0x0;var _0x573216=_0x61db[_0x12bd62];return _0x573216;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0xb61d('0x0'));var logger=require(_0xb61d('0x1'))(_0xb61d('0x2'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xb61d('0x3')},'timeout':{'type':'number','message':_0xb61d('0x4')}});function writeLog(_0x269b18,_0x1f4758,_0x31b6b0){return logger['info'](util[_0xb61d('0x5')](_0xb61d('0x6'),_0x269b18,_0x1f4758[_0xb61d('0x7')],_0x31b6b0));}function handleFindAgent(_0x231bae){return function(_0x279d7d){return _0x279d7d[_0xb61d('0x7')][_0xb61d('0x8')]()===_0x231bae['toLowerCase']();};}exports[_0xb61d('0x9')]=function(_0x24d483,_0x44c271,_0x4e10ab,_0x5f417b){return function(_0x452950){try{var _0x6519f={'name':_0x44c271[0x0],'timeout':_0x44c271[0x1]};var _0x3a385d=queue[_0xb61d('0xa')](_0x6519f,{'typecast':!![]});if(_0x3a385d[_0xb61d('0xb')]){logger['error'](_0xb61d('0xc'),_0x24d483,_['map'](_0x3a385d,_0xb61d('0xd'))['join'](',\x20'));_0x452950[_0xb61d('0xe')]();}else{var _0x113d4c=_['find'](_0x4e10ab['agents'],handleFindAgent(_0x6519f[_0xb61d('0x7')]));if(_0x113d4c){var _0x3c2e4d=(_0x6519f[_0xb61d('0xf')]||0xa)*0x3e8;var _0x4dd1ba,_0x2bb998;var _0x5cafeb=seqqueue[_0xb61d('0x10')](_0x3c2e4d);_0x5cafeb['id']=_0x24d483;_0x5cafeb[_0xb61d('0x11')]=_0x3c2e4d;_0x5cafeb[_0xb61d('0x12')]=_0x5f417b[_0xb61d('0x12')];writeLog(_0x24d483,_0x113d4c,util[_0xb61d('0x5')](_0xb61d('0x13'),_0x3c2e4d));_0x4e10ab[_0xb61d('0x14')][_0x24d483]['on'](_0xb61d('0x15'),function(){logger[_0xb61d('0x16')](_0xb61d('0x17'),_0x24d483);clearTimeout(_0x2bb998);_0x2bb998=undefined;_0x5cafeb['close']();if(_0x4e10ab['rules'][_0x24d483]){delete _0x4e10ab['rules'][_0x24d483];}_0x452950[_0xb61d('0xe')]();});_0x4e10ab[_0xb61d('0x14')][_0x24d483]['on'](_0xb61d('0x18'),function(){if(_0x4e10ab[_0xb61d('0x14')][_0x24d483]){delete _0x4e10ab['rules'][_0x24d483];}});_0x2bb998=setTimeout(function(){logger[_0xb61d('0x16')](_0xb61d('0x19'),_0x24d483);clearTimeout(_0x2bb998);_0x5cafeb[_0xb61d('0x1a')]();_0x452950['next']();},_0x3c2e4d);strategy['agent'](_0x5cafeb,_0x113d4c,_0x4e10ab,_0x5f417b);}else{logger[_0xb61d('0x1b')](_0xb61d('0x1c'),_0x24d483,_0x6519f[_0xb61d('0x7')]);_0x452950[_0xb61d('0xe')]();}}}catch(_0x52cbb5){console[_0xb61d('0x1d')](_0x52cbb5);logger['error']('[%s][QUEUE]\x20%s',_0x24d483,_0x52cbb5[_0xb61d('0x1e')]);_0x452950['stop']();}};}; \ No newline at end of file +var _0x1826=['[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error'];(function(_0x56d829,_0x1d98bf){var _0x15e98e=function(_0x2995a2){while(--_0x2995a2){_0x56d829['push'](_0x56d829['shift']());}};_0x15e98e(++_0x1d98bf);}(_0x1826,0x192));var _0x6182=function(_0x5ddafe,_0x1fb508){_0x5ddafe=_0x5ddafe-0x0;var _0x5e23aa=_0x1826[_0x5ddafe];return _0x5e23aa;};'use strict';var schema=require(_0x6182('0x0'));var _=require(_0x6182('0x1'));var util=require(_0x6182('0x2'));var seqqueue=require(_0x6182('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x6182('0x4'));var queue=schema({'name':{'type':_0x6182('0x5'),'required':!![],'message':_0x6182('0x6')},'timeout':{'type':_0x6182('0x7'),'message':_0x6182('0x8')}});function writeLog(_0x218b41,_0x20c798,_0x53810e){return logger[_0x6182('0x9')](util['format'](_0x6182('0xa'),_0x218b41,_0x20c798[_0x6182('0xb')],_0x53810e));}function handleFindAgent(_0x57ccda){return function(_0x10a853){return _0x10a853[_0x6182('0xb')]['toLowerCase']()===_0x57ccda[_0x6182('0xc')]();};}exports[_0x6182('0xd')]=function(_0x243e85,_0x29fea6,_0x4feebc,_0x40045d){return function(_0x150705){try{var _0x3c398f={'name':_0x29fea6[0x0],'timeout':_0x29fea6[0x1]};var _0xbd9ded=queue[_0x6182('0x0')](_0x3c398f,{'typecast':!![]});if(_0xbd9ded[_0x6182('0xe')]){logger[_0x6182('0xf')](_0x6182('0x10'),_0x243e85,_[_0x6182('0x11')](_0xbd9ded,'message')[_0x6182('0x12')](',\x20'));_0x150705[_0x6182('0x13')]();}else{var _0x1c649c=_[_0x6182('0x14')](_0x4feebc[_0x6182('0x15')],handleFindAgent(_0x3c398f[_0x6182('0xb')]));if(_0x1c649c){var _0x253ea9=(_0x3c398f[_0x6182('0x16')]||0xa)*0x3e8;var _0x928c67,_0x13f2b8;var _0x34a7ba=seqqueue[_0x6182('0x17')](_0x253ea9);_0x34a7ba['id']=_0x243e85;_0x34a7ba['atimeout']=_0x253ea9;_0x34a7ba[_0x6182('0x18')]=_0x40045d[_0x6182('0x18')];writeLog(_0x243e85,_0x1c649c,util[_0x6182('0x19')](_0x6182('0x1a'),_0x253ea9));_0x4feebc[_0x6182('0x1b')][_0x243e85]['on'](_0x6182('0x1c'),function(){logger[_0x6182('0x9')](_0x6182('0x1d'),_0x243e85);clearTimeout(_0x13f2b8);_0x13f2b8=undefined;_0x34a7ba[_0x6182('0x1e')]();if(_0x4feebc[_0x6182('0x1b')][_0x243e85]){delete _0x4feebc[_0x6182('0x1b')][_0x243e85];}_0x150705[_0x6182('0x13')]();});_0x4feebc[_0x6182('0x1b')][_0x243e85]['on'](_0x6182('0x1f'),function(){if(_0x4feebc[_0x6182('0x1b')][_0x243e85]){delete _0x4feebc[_0x6182('0x1b')][_0x243e85];}});_0x13f2b8=setTimeout(function(){logger[_0x6182('0x9')](_0x6182('0x20'),_0x243e85);clearTimeout(_0x13f2b8);_0x34a7ba[_0x6182('0x1e')]();_0x150705[_0x6182('0x21')]();},_0x253ea9);strategy[_0x6182('0x22')](_0x34a7ba,_0x1c649c,_0x4feebc,_0x40045d);}else{logger[_0x6182('0xf')](_0x6182('0x23'),_0x243e85,_0x3c398f[_0x6182('0xb')]);_0x150705[_0x6182('0x13')]();}}}catch(_0x2eef2a){console[_0x6182('0x24')](_0x2eef2a);logger['error'](_0x6182('0x25'),_0x243e85,_0x2eef2a['stack']);_0x150705[_0x6182('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 29a2865..e7b7ddd 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 _0x4055=['getMustacheRender','Message','then','info','[%s][AMAZONLEX]\x20%s','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerResponse','create','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body'];(function(_0x3cc16f,_0x5228ab){var _0xb75d9b=function(_0x1b45cf){while(--_0x1b45cf){_0x3cc16f['push'](_0x3cc16f['shift']());}};_0xb75d9b(++_0x5228ab);}(_0x4055,0x12f));var _0x5405=function(_0x385f81,_0x394333){_0x385f81=_0x385f81-0x0;var _0x390b9e=_0x4055[_0x385f81];return _0x390b9e;};'use strict';var _=require(_0x5405('0x0'));var moment=require(_0x5405('0x1'));var AWS=require(_0x5405('0x2'));var utils=require(_0x5405('0x3'));var logger=require(_0x5405('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5405('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5405('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5405('0x7'))};exports[_0x5405('0x8')]=function(_0x3a7e69,_0x45491c){return function(_0x4554ed){try{if(!_['isNil'](this[_0x5405('0x9')]['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3a7e69,_0x5405('0xa'));return _0x4554ed[_0x5405('0xb')]();}var _0x323a56={'ContactId':this[_0x5405('0xc')]['id'],'sentAt':moment()[_0x5405('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x5405('0xe')};if(this[_0x5405('0xf')]==='sms'||this[_0x5405('0xf')]===_0x5405('0x10')){_0x323a56[_0x5405('0x11')]=this['interaction'][_0x5405('0x11')];}var _0x3dd99a=this[_0x5405('0xf')];if(_0x3dd99a===_0x5405('0x12')){_0x323a56['ChatWebsiteId']=this[_0x5405('0x13')]['id'];}else{_0x323a56[_[_0x5405('0x14')](_0x3dd99a)+_0x5405('0x15')]=this[_0x5405('0x13')]['id'];}_0x323a56[_[_0x5405('0x14')](_0x3dd99a)+_0x5405('0x16')]=this['interaction']['id'];if(this[_0x5405('0x9')][_0x5405('0x17')]){var _0x229f11=_0x45491c[0x4];if(!_[_0x5405('0x18')](_0x229f11)){_0x323a56[_0x5405('0x19')]=utils[_0x5405('0x1a')](_0x229f11,this);return rpc[_0x3dd99a+_0x5405('0x1b')]['create'](_0x323a56)[_0x5405('0x1c')](function(_0x216d07){logger[_0x5405('0x1d')](_0x5405('0x1e'),_0x3a7e69,_0x323a56[_0x5405('0x19')]);})[_0x5405('0x1f')](function(_0x4b7e14){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3a7e69,JSON[_0x5405('0x20')](_0x4b7e14));})[_0x5405('0x21')](function(){logger[_0x5405('0x1d')](_0x5405('0x22'),_0x3a7e69);_0x4554ed[_0x5405('0x23')]();});}else{logger['info'](_0x5405('0x24'),_0x3a7e69);_0x4554ed[_0x5405('0x23')]();}}else{var _0x51c979=this;var _0x23361c=new AWS[(_0x5405('0x25'))]({'accessKeyId':_0x45491c[0x0],'secretAccessKey':_0x45491c[0x1],'region':_0x45491c[0x2]});var _0x245ddf={'botAlias':_0x5405('0x26'),'botName':_0x45491c[0x3],'inputText':this[_0x5405('0x27')]['body'],'userId':this[_0x5405('0xf')]+':'+this[_0x5405('0x9')]['id'][_0x5405('0x28')]()};_0x23361c[_0x5405('0x29')](_0x245ddf,function(_0x2f8613,_0x21b8a5){if(_0x2f8613){logger[_0x5405('0x2a')](_0x5405('0x1e'),_0x3a7e69,_0x2f8613[_0x5405('0x27')]);_0x4554ed[_0x5405('0xb')]();}else if(_0x21b8a5&&_0x21b8a5[_0x5405('0x27')]){_0x51c979[_0x5405('0x19')][_0x5405('0x2b')]=_0x21b8a5;_0x323a56['body']=_0x21b8a5[_0x5405('0x27')];_0x323a56['providerName']=_0x5405('0x2b');_0x323a56[_0x5405('0x2c')]=JSON['stringify'](_0x21b8a5);return rpc[_0x3dd99a+'Message'][_0x5405('0x2d')](_0x323a56)['then'](function(_0x16dbf2){logger[_0x5405('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3a7e69,_0x323a56[_0x5405('0x19')]);if(_0x21b8a5[_0x5405('0x2e')]=='Failed'){_0x4554ed[_0x5405('0xb')]();}else{_0x4554ed['stop']();}})['catch'](function(_0x41d609){logger[_0x5405('0x2a')]('[%s][AMAZONLEX]\x20%s',_0x3a7e69,JSON[_0x5405('0x20')](_0x41d609));_0x4554ed['next']();});}else{_0x4554ed[_0x5405('0xb')]();}});}}catch(_0x53ba97){logger[_0x5405('0x2a')](_0x5405('0x1e'),_0x3a7e69,JSON[_0x5405('0x20')](_0x53ba97));_0x4554ed[_0x5405('0x23')]();}};}; \ No newline at end of file +var _0xf77d=['moment','aws-sdk','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','postText','error','amazonlex','providerName','providerResponse','dialogState','lodash'];(function(_0x427c89,_0x2e6e8b){var _0x26395c=function(_0x2f4f8c){while(--_0x2f4f8c){_0x427c89['push'](_0x427c89['shift']());}};_0x26395c(++_0x2e6e8b);}(_0xf77d,0xf4));var _0xdf77=function(_0x161341,_0x1c054d){_0x161341=_0x161341-0x0;var _0x5e06c3=_0xf77d[_0x161341];return _0x5e06c3;};'use strict';var _=require(_0xdf77('0x0'));var moment=require(_0xdf77('0x1'));var AWS=require(_0xdf77('0x2'));var utils=require(_0xdf77('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xdf77('0x4')),'openchannelMessage':require(_0xdf77('0x5')),'mailMessage':require(_0xdf77('0x6')),'smsMessage':require(_0xdf77('0x7')),'faxMessage':require(_0xdf77('0x8')),'whatsappMessage':require(_0xdf77('0x9'))};exports[_0xdf77('0xa')]=function(_0x1bb20f,_0xa50bbb){return function(_0x2bfb9f){try{if(!_[_0xdf77('0xb')](this[_0xdf77('0xc')][_0xdf77('0xd')])){logger[_0xdf77('0xe')]('[%s][AMAZONLEX]\x20%s',_0x1bb20f,_0xdf77('0xf'));return _0x2bfb9f[_0xdf77('0x10')]();}var _0x68d35f={'ContactId':this[_0xdf77('0x11')]['id'],'sentAt':moment()[_0xdf77('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xdf77('0x13')};if(this[_0xdf77('0x14')]===_0xdf77('0x15')||this[_0xdf77('0x14')]===_0xdf77('0x16')){_0x68d35f[_0xdf77('0x17')]=this['interaction'][_0xdf77('0x17')];}var _0xd3b788=this[_0xdf77('0x14')];if(_0xd3b788===_0xdf77('0x18')){_0x68d35f['ChatWebsiteId']=this[_0xdf77('0x19')]['id'];}else{_0x68d35f[_[_0xdf77('0x1a')](_0xd3b788)+_0xdf77('0x1b')]=this[_0xdf77('0x19')]['id'];}_0x68d35f[_[_0xdf77('0x1a')](_0xd3b788)+_0xdf77('0x1c')]=this['interaction']['id'];if(this[_0xdf77('0xc')][_0xdf77('0x1d')]){var _0x5c0f68=_0xa50bbb[0x4];if(!_[_0xdf77('0x1e')](_0x5c0f68)){_0x68d35f[_0xdf77('0x1f')]=utils[_0xdf77('0x20')](_0x5c0f68,this);return rpc[_0xd3b788+_0xdf77('0x21')][_0xdf77('0x22')](_0x68d35f)[_0xdf77('0x23')](function(_0x2fe5b5){logger['info'](_0xdf77('0x24'),_0x1bb20f,_0x68d35f[_0xdf77('0x1f')]);})['catch'](function(_0x47b09b){logger['error'](_0xdf77('0x24'),_0x1bb20f,JSON[_0xdf77('0x25')](_0x47b09b));})[_0xdf77('0x26')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1bb20f);_0x2bfb9f[_0xdf77('0x27')]();});}else{logger[_0xdf77('0xe')](_0xdf77('0x28'),_0x1bb20f);_0x2bfb9f[_0xdf77('0x27')]();}}else{var _0x3b8d2b=this;var _0xa5e836=new AWS[(_0xdf77('0x29'))]({'accessKeyId':_0xa50bbb[0x0],'secretAccessKey':_0xa50bbb[0x1],'region':_0xa50bbb[0x2]});var _0x201d33={'botAlias':'$LATEST','botName':_0xa50bbb[0x3],'inputText':this[_0xdf77('0x2a')][_0xdf77('0x1f')],'userId':this[_0xdf77('0x14')]+':'+this[_0xdf77('0xc')]['id']['toString']()};_0xa5e836[_0xdf77('0x2b')](_0x201d33,function(_0xca410a,_0x20eefe){if(_0xca410a){logger[_0xdf77('0x2c')](_0xdf77('0x24'),_0x1bb20f,_0xca410a[_0xdf77('0x2a')]);_0x2bfb9f[_0xdf77('0x10')]();}else if(_0x20eefe&&_0x20eefe['message']){_0x3b8d2b[_0xdf77('0x1f')][_0xdf77('0x2d')]=_0x20eefe;_0x68d35f['body']=_0x20eefe[_0xdf77('0x2a')];_0x68d35f[_0xdf77('0x2e')]=_0xdf77('0x2d');_0x68d35f[_0xdf77('0x2f')]=JSON[_0xdf77('0x25')](_0x20eefe);return rpc[_0xd3b788+_0xdf77('0x21')]['create'](_0x68d35f)['then'](function(_0x2ce133){logger['info'](_0xdf77('0x24'),_0x1bb20f,_0x68d35f[_0xdf77('0x1f')]);if(_0x20eefe[_0xdf77('0x30')]=='Failed'){_0x2bfb9f['next']();}else{_0x2bfb9f[_0xdf77('0x27')]();}})['catch'](function(_0x38e197){logger[_0xdf77('0x2c')](_0xdf77('0x24'),_0x1bb20f,JSON[_0xdf77('0x25')](_0x38e197));_0x2bfb9f['next']();});}else{_0x2bfb9f['next']();}});}}catch(_0x12e108){logger[_0xdf77('0x2c')](_0xdf77('0x24'),_0x1bb20f,JSON[_0xdf77('0x25')](_0x12e108));_0x2bfb9f[_0xdf77('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 a9cf3a8..19ee7c1 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 _0xfc7c=[''+_[_0xcfc7('0x2c')](_0x8ed613['body'],_0xcfc7('0x2d'),_0xcfc7('0x2e'))+'';_0x8ed613[_0xcfc7('0x2f')]={'Auto-Submitted':_0xcfc7('0x30'),'X-Auto-Response-Suppress':'All','Precedence':_0xcfc7('0x31')};return mailRpc[_0xcfc7('0x32')](this[_0xcfc7('0x25')][_0xcfc7('0x33')],_0x8ed613)[_0xcfc7('0x34')](function(_0x3d2e17){logger[_0xcfc7('0x11')](_0xcfc7('0x35'),_0x5ca504);_0x8ed613[_0xcfc7('0x2a')]=_0x3d2e17[_0xcfc7('0x1f')][_0xcfc7('0x2a')];return rpc[_0x40fd40+_0xcfc7('0x28')]['create'](_0x8ed613);})[_0xcfc7('0x34')](function(_0xcfa07){logger['info'](_0xcfc7('0x12'),_0x5ca504,JSON['stringify'](_0xcfa07));})[_0xcfc7('0x36')](function(_0x1e3936){logger[_0xcfc7('0x37')](_0xcfc7('0x38'),_0x5ca504,JSON[_0xcfc7('0x39')](_0x1e3936));})[_0xcfc7('0x3a')](function(){Promise[_0xcfc7('0x3b')]()['then'](function(){if(_0x4d07bb[0x0]!=='2'||_0x28f8e0['autoreplyExecuted'])return;return rpc[_0x40fd40+_0xcfc7('0x3c')][_0xcfc7('0x3d')](_0x28f8e0['id'],{'autoreplyExecuted':!![]})[_0xcfc7('0x34')](function(_0x284cbf){logger[_0xcfc7('0x11')](_0xcfc7('0x19'),_0x5ca504,JSON[_0xcfc7('0x39')](_0x284cbf));})[_0xcfc7('0x36')](function(_0x914c7b){logger[_0xcfc7('0x37')](_0xcfc7('0x3e'),_0x5ca504,JSON[_0xcfc7('0x39')](_0x914c7b));});})[_0xcfc7('0x34')](function(){_0x5513b0['next']();});});}else{return rpc[this[_0xcfc7('0xe')]+_0xcfc7('0x28')][_0xcfc7('0x3f')](_0x8ed613)[_0xcfc7('0x34')](function(){logger['info'](_0xcfc7('0x12'),_0x5ca504,_0x8ed613['body']);})[_0xcfc7('0x36')](function(_0xb523b7){logger[_0xcfc7('0x37')]('[%s][AUTOREPLY]\x20%s',_0x5ca504,JSON[_0xcfc7('0x39')](_0xb523b7));})[_0xcfc7('0x3a')](function(){Promise[_0xcfc7('0x3b')]()['then'](function(){if(_0x4d07bb[0x0]!=='2'||_0x28f8e0[_0xcfc7('0x40')])return;return rpc[_0x40fd40+'Interaction'][_0xcfc7('0x3d')](_0x28f8e0['id'],{'autoreplyExecuted':!![]})[_0xcfc7('0x34')](function(_0x38e30a){logger['info'](_0xcfc7('0x19'),_0x5ca504,JSON[_0xcfc7('0x39')](_0x38e30a));})[_0xcfc7('0x36')](function(_0x455fda){logger[_0xcfc7('0x37')](_0xcfc7('0x3e'),_0x5ca504,JSON[_0xcfc7('0x39')](_0x455fda));});})[_0xcfc7('0x34')](function(){_0x5513b0[_0xcfc7('0x18')]();});});}}}catch(_0x58134a){logger[_0xcfc7('0x37')](_0xcfc7('0x12'),_0x5ca504,JSON[_0xcfc7('0x39')](_0x58134a));_0x5513b0[_0xcfc7('0x41')]();}};}; \ No newline at end of file +var _0xf4b4=['mail','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','channel','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','','replace','';_0x1df8a7['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x4f4b('0x33'),'Precedence':_0x4f4b('0x34')};return mailRpc[_0x4f4b('0x35')](this[_0x4f4b('0x29')][_0x4f4b('0x36')],_0x1df8a7)[_0x4f4b('0x37')](function(_0x19830f){logger[_0x4f4b('0x18')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x5f1350);_0x1df8a7['messageId']=_0x19830f[_0x4f4b('0x21')][_0x4f4b('0x2f')];return rpc[_0x3b88bf+_0x4f4b('0x2d')]['create'](_0x1df8a7);})['then'](function(_0x4b3b21){logger['info'](_0x4f4b('0x10'),_0x5f1350,JSON[_0x4f4b('0x38')](_0x4b3b21));})[_0x4f4b('0x39')](function(_0x54a19a){logger[_0x4f4b('0x3a')](_0x4f4b('0x3b'),_0x5f1350,JSON[_0x4f4b('0x38')](_0x54a19a));})[_0x4f4b('0x3c')](function(){Promise[_0x4f4b('0x3d')]()['then'](function(){if(_0x35d123[0x0]!=='2'||_0x1caa71[_0x4f4b('0x17')])return;return rpc[_0x3b88bf+_0x4f4b('0x3e')][_0x4f4b('0x3f')](_0x1caa71['id'],{'autoreplyExecuted':!![]})[_0x4f4b('0x37')](function(_0x2ad4b6){logger[_0x4f4b('0x18')](_0x4f4b('0x19'),_0x5f1350,JSON['stringify'](_0x2ad4b6));})[_0x4f4b('0x39')](function(_0x40cabf){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5f1350,JSON[_0x4f4b('0x38')](_0x40cabf));});})['then'](function(){_0x4fad3f[_0x4f4b('0x12')]();});});}else{return rpc[this['channel']+_0x4f4b('0x2d')]['create'](_0x1df8a7)[_0x4f4b('0x37')](function(){logger[_0x4f4b('0x18')](_0x4f4b('0x10'),_0x5f1350,_0x1df8a7[_0x4f4b('0x1f')]);})[_0x4f4b('0x39')](function(_0x38a458){logger[_0x4f4b('0x3a')](_0x4f4b('0x10'),_0x5f1350,JSON['stringify'](_0x38a458));})['finally'](function(){Promise[_0x4f4b('0x3d')]()[_0x4f4b('0x37')](function(){if(_0x35d123[0x0]!=='2'||_0x1caa71[_0x4f4b('0x17')])return;return rpc[_0x3b88bf+'Interaction'][_0x4f4b('0x3f')](_0x1caa71['id'],{'autoreplyExecuted':!![]})[_0x4f4b('0x37')](function(_0x2910ad){logger[_0x4f4b('0x18')](_0x4f4b('0x19'),_0x5f1350,JSON[_0x4f4b('0x38')](_0x2910ad));})[_0x4f4b('0x39')](function(_0x703e64){logger[_0x4f4b('0x3a')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5f1350,JSON[_0x4f4b('0x38')](_0x703e64));});})[_0x4f4b('0x37')](function(){_0x4fad3f[_0x4f4b('0x12')]();});});}}}catch(_0x5e2587){logger[_0x4f4b('0x3a')]('[%s][AUTOREPLY]\x20%s',_0x5f1350,JSON['stringify'](_0x5e2587));_0x4fad3f[_0x4f4b('0x40')]();}};}; \ 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 f25b62b..08a0e59 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 _0x72bb=['error','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','catch','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x17c872,_0x1b0c7c){var _0x54d55b=function(_0x467fb4){while(--_0x467fb4){_0x17c872['push'](_0x17c872['shift']());}};_0x54d55b(++_0x1b0c7c);}(_0x72bb,0xf2));var _0xb72b=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x72bb[_0x1e381c];return _0x9b5ea9;};'use strict';var moment=require(_0xb72b('0x0'));var logger=require(_0xb72b('0x1'))(_0xb72b('0x2'));var rpc={'chatInteraction':require(_0xb72b('0x3')),'openchannelInteraction':require(_0xb72b('0x4')),'smsInteraction':require(_0xb72b('0x5')),'mailInteraction':require(_0xb72b('0x6')),'faxInteraction':require(_0xb72b('0x7')),'whatsappInteraction':require(_0xb72b('0x8'))};exports[_0xb72b('0x9')]=function(_0x244ea3,_0x1d9356,_0x2dc0ea,_0x2567fa){return function(_0x481087){try{logger[_0xb72b('0xa')]('[%s][CLOSE]\x20reason\x20%s',_0x244ea3,_0x1d9356[0x0]);var _0x5e6c4d={'closed':0x1,'closedAt':moment()[_0xb72b('0xb')](_0xb72b('0xc')),'closeReason':_0xb72b('0xd'),'disposition':_0x1d9356[0x0]};if(rpc[_0x2567fa['channel']+_0xb72b('0xe')]){rpc[_0x2567fa[_0xb72b('0xf')]+_0xb72b('0xe')][_0xb72b('0x10')](_0x2567fa[_0xb72b('0x11')]['id'],_0x5e6c4d)['then'](function(_0x4c38ce){logger[_0xb72b('0xa')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x244ea3,_0x2567fa[_0xb72b('0x11')]['id']);})[_0xb72b('0x12')](function(_0x4b0f65){logger['error'](_0xb72b('0x13'),_0x244ea3,JSON[_0xb72b('0x14')](_0x4b0f65));})[_0xb72b('0x15')](function(){_0x481087['stop']();});}}catch(_0x454881){logger[_0xb72b('0x16')](_0xb72b('0x13'),_0x244ea3,JSON['stringify'](_0x454881));_0x481087[_0xb72b('0x17')]();}};}; \ No newline at end of file +var _0xcf13=['system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x7e6b91,_0x33d1e9){var _0x38b1fd=function(_0x26f25f){while(--_0x26f25f){_0x7e6b91['push'](_0x7e6b91['shift']());}};_0x38b1fd(++_0x33d1e9);}(_0xcf13,0x1d8));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x3cf1('0x0'));var logger=require(_0x3cf1('0x1'))('routing');var rpc={'chatInteraction':require(_0x3cf1('0x2')),'openchannelInteraction':require(_0x3cf1('0x3')),'smsInteraction':require(_0x3cf1('0x4')),'mailInteraction':require(_0x3cf1('0x5')),'faxInteraction':require(_0x3cf1('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x507970,_0x22bdf6,_0x458c54,_0x24f43f){return function(_0x2fa890){try{logger[_0x3cf1('0x7')](_0x3cf1('0x8'),_0x507970,_0x22bdf6[0x0]);var _0x44fa4b={'closed':0x1,'closedAt':moment()[_0x3cf1('0x9')](_0x3cf1('0xa')),'closeReason':_0x3cf1('0xb'),'disposition':_0x22bdf6[0x0]};if(rpc[_0x24f43f[_0x3cf1('0xc')]+_0x3cf1('0xd')]){rpc[_0x24f43f[_0x3cf1('0xc')]+'Interaction'][_0x3cf1('0xe')](_0x24f43f[_0x3cf1('0xf')]['id'],_0x44fa4b)['then'](function(_0x60210){logger['info'](_0x3cf1('0x10'),_0x507970,_0x24f43f[_0x3cf1('0xf')]['id']);})[_0x3cf1('0x11')](function(_0x407b99){logger[_0x3cf1('0x12')](_0x3cf1('0x13'),_0x507970,JSON[_0x3cf1('0x14')](_0x407b99));})[_0x3cf1('0x15')](function(){_0x2fa890[_0x3cf1('0x16')]();});}}catch(_0x163bc0){logger[_0x3cf1('0x12')]('[%s][CLOSE]\x20%s',_0x507970,JSON[_0x3cf1('0x14')](_0x163bc0));_0x2fa890[_0x3cf1('0x16')]();}};}; \ 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 0157d28..707492f 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 _0xffd6=['getMustacheRender','Message','create','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','dialogflow','result','fulfillment','speech','stringify','metadata','message','lodash','moment','apiai-promise','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body'];(function(_0x4a6a6b,_0x1909e3){var _0x3335a6=function(_0x1a944e){while(--_0x1a944e){_0x4a6a6b['push'](_0x4a6a6b['shift']());}};_0x3335a6(++_0x1909e3);}(_0xffd6,0x97));var _0x6ffd=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xffd6[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x6ffd('0x0'));var moment=require(_0x6ffd('0x1'));var apiai=require(_0x6ffd('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0x6ffd('0x3'))(_0x6ffd('0x4'));var rpc={'chatMessage':require(_0x6ffd('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6ffd('0x6')),'smsMessage':require(_0x6ffd('0x7')),'faxMessage':require(_0x6ffd('0x8')),'whatsappMessage':require(_0x6ffd('0x9'))};exports['consequence']=function(_0x122b71,_0xeefe34){return function(_0x2445a0){try{if(!_[_0x6ffd('0xa')](this[_0x6ffd('0xb')]['UserId'])){logger[_0x6ffd('0xc')](_0x6ffd('0xd'),_0x122b71,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2445a0[_0x6ffd('0xe')]();}var _0x38fc68={'ContactId':this[_0x6ffd('0xf')]['id'],'sentAt':moment()[_0x6ffd('0x10')](_0x6ffd('0x11')),'direction':_0x6ffd('0x12')};if(this[_0x6ffd('0x13')]==='sms'||this[_0x6ffd('0x13')]===_0x6ffd('0x14')){_0x38fc68['phone']=this[_0x6ffd('0xb')][_0x6ffd('0x15')];}var _0x24e55b=this[_0x6ffd('0x13')];if(_0x24e55b==='chat'){_0x38fc68[_0x6ffd('0x16')]=this['account']['id'];}else{_0x38fc68[_[_0x6ffd('0x17')](_0x24e55b)+'AccountId']=this[_0x6ffd('0x18')]['id'];}_0x38fc68[_[_0x6ffd('0x17')](_0x24e55b)+_0x6ffd('0x19')]=this['interaction']['id'];if(this[_0x6ffd('0xb')][_0x6ffd('0x1a')]){var _0x350c94=_0xeefe34[0x2];if(!_[_0x6ffd('0x1b')](_0x350c94)){_0x38fc68[_0x6ffd('0x1c')]=utils[_0x6ffd('0x1d')](_0x350c94,this);return rpc[_0x24e55b+_0x6ffd('0x1e')][_0x6ffd('0x1f')](_0x38fc68)['then'](function(_0x11a609){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x122b71,_0x38fc68[_0x6ffd('0x1c')]);})[_0x6ffd('0x20')](function(_0x50aaa2){logger[_0x6ffd('0x21')](_0x6ffd('0xd'),_0x122b71,JSON['stringify'](_0x50aaa2));})['finally'](function(){logger[_0x6ffd('0xc')](_0x6ffd('0x22'),_0x122b71);_0x2445a0['stop']();});}else{logger[_0x6ffd('0xc')](_0x6ffd('0x23'),_0x122b71);_0x2445a0[_0x6ffd('0x24')]();}}else{var _0x53128a=this;var _0x3ba429=apiai(_0xeefe34[0x0],{'language':_0xeefe34[0x1]||'en'});return _0x3ba429[_0x6ffd('0x25')](this['message'][_0x6ffd('0x1c')],{'sessionId':md5(this[_0x6ffd('0xb')]['id'])})['then'](function(_0x31fb22){_0x53128a[_0x6ffd('0x1c')][_0x6ffd('0x26')]=_0x31fb22;_0x38fc68['body']=_0x31fb22[_0x6ffd('0x27')][_0x6ffd('0x28')][_0x6ffd('0x29')];_0x38fc68['providerName']=_0x6ffd('0x26');_0x38fc68['providerResponse']=JSON[_0x6ffd('0x2a')](_0x31fb22);return rpc[_0x24e55b+_0x6ffd('0x1e')]['create'](_0x38fc68)['then'](function(_0x252201){logger[_0x6ffd('0xc')](_0x6ffd('0xd'),_0x122b71,_0x38fc68['body']);if(_0x31fb22['result'][_0x6ffd('0x2b')]['endConversation']){_0x2445a0[_0x6ffd('0xe')]();}else{_0x2445a0[_0x6ffd('0x24')]();}})['catch'](function(_0x6b5aba){logger[_0x6ffd('0x21')](_0x6ffd('0xd'),_0x122b71,JSON[_0x6ffd('0x2a')](_0x6b5aba));_0x2445a0[_0x6ffd('0xe')]();});})[_0x6ffd('0x20')](function(_0x225c66){logger[_0x6ffd('0x21')](_0x6ffd('0xd'),_0x122b71,_0x225c66[_0x6ffd('0x2c')]);_0x2445a0[_0x6ffd('0xe')]();});}}catch(_0x352656){logger[_0x6ffd('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x122b71,JSON['stringify'](_0x352656));_0x2445a0['stop']();}};}; \ No newline at end of file +var _0x297f=['stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerResponse','Message','create','endConversation','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat','ChatWebsiteId','upperFirst','AccountId','created','body','getMustacheRender','then','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x2daf16,_0x2c7eed){var _0x513184=function(_0x289838){while(--_0x289838){_0x2daf16['push'](_0x2daf16['shift']());}};_0x513184(++_0x2c7eed);}(_0x297f,0x1f0));var _0xf297=function(_0x5e322b,_0x38fcf1){_0x5e322b=_0x5e322b-0x0;var _0x2c6292=_0x297f[_0x5e322b];return _0x2c6292;};'use strict';var _=require(_0xf297('0x0'));var moment=require(_0xf297('0x1'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xf297('0x2'));var logger=require(_0xf297('0x3'))(_0xf297('0x4'));var rpc={'chatMessage':require(_0xf297('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf297('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf297('0x7')),'whatsappMessage':require(_0xf297('0x8'))};exports[_0xf297('0x9')]=function(_0x4bb956,_0x4a3862){return function(_0x302320){try{if(!_[_0xf297('0xa')](this[_0xf297('0xb')]['UserId'])){logger[_0xf297('0xc')](_0xf297('0xd'),_0x4bb956,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x302320[_0xf297('0xe')]();}var _0x481d0d={'ContactId':this[_0xf297('0xf')]['id'],'sentAt':moment()[_0xf297('0x10')](_0xf297('0x11')),'direction':'out'};if(this[_0xf297('0x12')]==='sms'||this[_0xf297('0x12')]==='whatsapp'){_0x481d0d['phone']=this[_0xf297('0xb')][_0xf297('0x13')];}var _0x1f0459=this[_0xf297('0x12')];if(_0x1f0459===_0xf297('0x14')){_0x481d0d[_0xf297('0x15')]=this['account']['id'];}else{_0x481d0d[_[_0xf297('0x16')](_0x1f0459)+_0xf297('0x17')]=this['account']['id'];}_0x481d0d[_[_0xf297('0x16')](_0x1f0459)+'InteractionId']=this[_0xf297('0xb')]['id'];if(this[_0xf297('0xb')][_0xf297('0x18')]){var _0x4cc9a4=_0x4a3862[0x2];if(!_['isEmpty'](_0x4cc9a4)){_0x481d0d[_0xf297('0x19')]=utils[_0xf297('0x1a')](_0x4cc9a4,this);return rpc[_0x1f0459+'Message']['create'](_0x481d0d)[_0xf297('0x1b')](function(_0x1932df){logger['info'](_0xf297('0xd'),_0x4bb956,_0x481d0d[_0xf297('0x19')]);})[_0xf297('0x1c')](function(_0x480c10){logger[_0xf297('0x1d')](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x480c10));})['finally'](function(){logger[_0xf297('0xc')](_0xf297('0x1f'),_0x4bb956);_0x302320[_0xf297('0x20')]();});}else{logger['info'](_0xf297('0x21'),_0x4bb956);_0x302320[_0xf297('0x20')]();}}else{var _0x4023a3=this;var _0x4cf7f7=apiai(_0x4a3862[0x0],{'language':_0x4a3862[0x1]||'en'});return _0x4cf7f7[_0xf297('0x22')](this[_0xf297('0x23')][_0xf297('0x19')],{'sessionId':md5(this[_0xf297('0xb')]['id'])})['then'](function(_0x27265c){_0x4023a3['body'][_0xf297('0x24')]=_0x27265c;_0x481d0d[_0xf297('0x19')]=_0x27265c[_0xf297('0x25')][_0xf297('0x26')][_0xf297('0x27')];_0x481d0d['providerName']='dialogflow';_0x481d0d[_0xf297('0x28')]=JSON[_0xf297('0x1e')](_0x27265c);return rpc[_0x1f0459+_0xf297('0x29')][_0xf297('0x2a')](_0x481d0d)[_0xf297('0x1b')](function(_0x456573){logger['info'](_0xf297('0xd'),_0x4bb956,_0x481d0d['body']);if(_0x27265c['result']['metadata'][_0xf297('0x2b')]){_0x302320[_0xf297('0xe')]();}else{_0x302320[_0xf297('0x20')]();}})[_0xf297('0x1c')](function(_0x2cdfc6){logger['error'](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x2cdfc6));_0x302320['next']();});})[_0xf297('0x1c')](function(_0x38a4f6){logger[_0xf297('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x4bb956,_0x38a4f6[_0xf297('0x23')]);_0x302320[_0xf297('0xe')]();});}}catch(_0x2be167){logger['error'](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x2be167));_0x302320['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 6777b42..124c10b 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 _0x210d=['stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','SessionsClient','message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','all','dialogflow','md5','moment','bluebird','routing','../../rpc/mailMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','phone','interaction','chat','ChatWebsiteId','account','InteractionId','created','isEmpty'];(function(_0x184ba5,_0x4b05e8){var _0x39e738=function(_0x357586){while(--_0x357586){_0x184ba5['push'](_0x184ba5['shift']());}};_0x39e738(++_0x4b05e8);}(_0x210d,0x1e6));var _0xd210=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x210d[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require('lodash');var dialogflow=require(_0xd210('0x0'));var md5=require(_0xd210('0x1'));var moment=require(_0xd210('0x2'));var Promise=require(_0xd210('0x3'));var logger=require('../../../../config/logger')(_0xd210('0x4'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd210('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd210('0x6'))};function createMessage(_0xe19b50,_0x1a4d7f,_0x4a83e2,_0x4355a5){return new Promise(function(_0x40ba6c,_0x12860c){var _0x1a06cf=_[_0xd210('0x7')](_0x4a83e2);_0x1a06cf[_0xd210('0x8')]=_0x4355a5;return rpc[_0x1a4d7f+_0xd210('0x9')][_0xd210('0xa')](_0x1a06cf)[_0xd210('0xb')](function(){logger[_0xd210('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0xe19b50,_0x1a06cf[_0xd210('0x8')]);_0x40ba6c();})[_0xd210('0xd')](function(_0x3eef9a){logger[_0xd210('0xe')](_0xd210('0xf'),_0xe19b50,JSON['stringify'](_0x3eef9a));_0x12860c(_0x3eef9a);});});}exports[_0xd210('0x10')]=function(_0x191d36,_0x38dff7){return function(_0x442aaa){try{if(!_[_0xd210('0x11')](this['interaction'][_0xd210('0x12')])){logger[_0xd210('0xc')](_0xd210('0xf'),_0x191d36,_0xd210('0x13'));return _0x442aaa[_0xd210('0x14')]();}var _0x4e741c={'ContactId':this[_0xd210('0x15')]['id'],'sentAt':moment()[_0xd210('0x16')](_0xd210('0x17')),'direction':_0xd210('0x18')};if(this['channel']===_0xd210('0x19')||this['channel']==='whatsapp'){_0x4e741c[_0xd210('0x1a')]=this[_0xd210('0x1b')]['phone'];}var _0x388e5f=this['channel'];if(_0x388e5f===_0xd210('0x1c')){_0x4e741c[_0xd210('0x1d')]=this[_0xd210('0x1e')]['id'];}else{_0x4e741c[_['upperFirst'](_0x388e5f)+'AccountId']=this[_0xd210('0x1e')]['id'];}_0x4e741c[_['upperFirst'](_0x388e5f)+_0xd210('0x1f')]=this[_0xd210('0x1b')]['id'];if(this[_0xd210('0x1b')][_0xd210('0x20')]){var _0x4cb010=_0x38dff7[0x4];if(!_[_0xd210('0x21')](_0x4cb010)){_0x4e741c['body']=utils['getMustacheRender'](_0x4cb010,this);return rpc[_0x388e5f+_0xd210('0x9')][_0xd210('0xa')](_0x4e741c)[_0xd210('0xb')](function(_0x2e3cb1){logger['info'](_0xd210('0xf'),_0x191d36,_0x4e741c['body']);})['catch'](function(_0x4431f7){logger['error'](_0xd210('0xf'),_0x191d36,JSON[_0xd210('0x22')](_0x4431f7));})[_0xd210('0x23')](function(){logger[_0xd210('0xc')](_0xd210('0x24'),_0x191d36);_0x442aaa[_0xd210('0x25')]();});}else{logger[_0xd210('0xc')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x191d36);_0x442aaa['stop']();}}else{var _0x3708a6=this;var _0x19cf52=_0x38dff7[0x2]['replace'](/\\n/g,'\x0a');var _0x118d1e={'credentials':{'private_key':_0x19cf52,'client_email':_0x38dff7[0x1]}};var _0x408830=new dialogflow[(_0xd210('0x26'))](_0x118d1e);var _0x299f2b=_0x408830['sessionPath'](_0x38dff7[0x0],md5(_0x3708a6[_0xd210('0x1b')]['id']));var _0x11ac94={'session':_0x299f2b,'queryInput':{'text':{'text':_0x3708a6[_0xd210('0x27')]['body'],'languageCode':_0x38dff7[0x3]||'en'}}};return _0x408830['detectIntent'](_0x11ac94)[_0xd210('0xb')](function(_0x42f7ea){if(_0x42f7ea&&_0x42f7ea[_0xd210('0x28')]){_0x3708a6['body'][_0xd210('0x29')]=_0x42f7ea;var _0x4b0bf8=_0x42f7ea[0x0];var _0x482ac5=_0x4b0bf8[_0xd210('0x2a')]['diagnosticInfo']&&_0x4b0bf8[_0xd210('0x2a')][_0xd210('0x2b')]['fields']?_0x4b0bf8['queryResult'][_0xd210('0x2b')][_0xd210('0x2c')][_0xd210('0x2d')]['boolValue']:![];_0x3708a6['body'][_0xd210('0x2e')]=_0x4b0bf8['queryResult'][_0xd210('0x2f')];_0x3708a6[_0xd210('0x8')][_0xd210('0x30')]=_0x4b0bf8[_0xd210('0x2a')]['allRequiredParamsPresent'];_0x3708a6[_0xd210('0x8')][_0xd210('0x31')]=_0x4b0bf8[_0xd210('0x2a')][_0xd210('0x2b')]&&_0x4b0bf8['queryResult'][_0xd210('0x2b')]['fields']?_0x4b0bf8['queryResult'][_0xd210('0x2b')][_0xd210('0x2c')][_0xd210('0x2d')][_0xd210('0x32')]:![];_0x3708a6[_0xd210('0x8')][_0xd210('0x33')]=_0x4b0bf8['queryResult']['intent']['name'];_0x3708a6[_0xd210('0x8')][_0xd210('0x34')]=_0x4b0bf8['queryResult'][_0xd210('0x35')][_0xd210('0x36')];_0x3708a6['body'][_0xd210('0x37')]=_0x4b0bf8[_0xd210('0x2a')][_0xd210('0x35')][_0xd210('0x38')];_0x3708a6['body'][_0xd210('0x39')]=_0x4b0bf8['queryResult'][_0xd210('0x3a')];_0x3708a6['body']['DIALOGFLOWV2_QUERYTEXT']=_0x4b0bf8[_0xd210('0x2a')][_0xd210('0x3b')];_0x3708a6['body'][_0xd210('0x3c')]=_0x4b0bf8[_0xd210('0x2a')][_0xd210('0x3d')];_0x4e741c['providerName']='dialogflowV2';_0x4e741c[_0xd210('0x3e')]=JSON[_0xd210('0x22')](_0x42f7ea);var _0x56f3a4=[];for(var _0xe237a4=0x0;_0xe237a4<_0x42f7ea[_0xd210('0x28')];_0xe237a4++){var _0x2ad115=_0x42f7ea[_0xe237a4];if(_0x2ad115&&_0x2ad115['queryResult']&&_0x2ad115['queryResult'][_0xd210('0x3f')]){_0x56f3a4['push'](createMessage(_0x191d36,_0x388e5f,_0x4e741c,_0x2ad115[_0xd210('0x2a')]['fulfillmentText']));}}return Promise[_0xd210('0x40')](_0x56f3a4)['then'](function(){if(_0x482ac5){_0x442aaa['next']();}else{_0x442aaa[_0xd210('0x25')]();}})[_0xd210('0xd')](function(_0x30fd2a){logger[_0xd210('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x191d36,JSON[_0xd210('0x22')](_0x30fd2a));_0x442aaa[_0xd210('0x14')]();});}})['catch'](function(_0x590a96){logger[_0xd210('0xe')](_0xd210('0xf'),_0x191d36,_0x590a96[_0xd210('0x27')]);_0x442aaa[_0xd210('0x14')]();});}}catch(_0x5ac8cf){logger[_0xd210('0xe')](_0xd210('0xf'),_0x191d36,JSON[_0xd210('0x22')](_0x5ac8cf));_0x442aaa[_0xd210('0x25')]();}};}; \ No newline at end of file +var _0x0eee=['providerName','providerResponse','fulfillmentText','push','all','next','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','then','[%s][DIALOGFLOWV2]\x20%s','body','error','stringify','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','getMustacheRender','create','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE'];(function(_0x38594b,_0xa76600){var _0x1b870f=function(_0x17f40a){while(--_0x17f40a){_0x38594b['push'](_0x38594b['shift']());}};_0x1b870f(++_0xa76600);}(_0x0eee,0x96));var _0xe0ee=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x0eee[_0xffa198];return _0x1e4b50;};'use strict';var _=require('lodash');var dialogflow=require(_0xe0ee('0x0'));var md5=require(_0xe0ee('0x1'));var moment=require(_0xe0ee('0x2'));var Promise=require(_0xe0ee('0x3'));var logger=require('../../../../config/logger')(_0xe0ee('0x4'));var utils=require(_0xe0ee('0x5'));var rpc={'chatMessage':require(_0xe0ee('0x6')),'openchannelMessage':require(_0xe0ee('0x7')),'mailMessage':require(_0xe0ee('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe0ee('0x9')),'whatsappMessage':require(_0xe0ee('0xa'))};function createMessage(_0x49e76f,_0xf5d7b,_0x3d78ec,_0x28713c){return new Promise(function(_0x368b0c,_0x18c073){var _0x2f45b3=_[_0xe0ee('0xb')](_0x3d78ec);_0x2f45b3['body']=_0x28713c;return rpc[_0xf5d7b+_0xe0ee('0xc')]['create'](_0x2f45b3)[_0xe0ee('0xd')](function(){logger['info'](_0xe0ee('0xe'),_0x49e76f,_0x2f45b3[_0xe0ee('0xf')]);_0x368b0c();})['catch'](function(_0x11f43b){logger[_0xe0ee('0x10')](_0xe0ee('0xe'),_0x49e76f,JSON[_0xe0ee('0x11')](_0x11f43b));_0x18c073(_0x11f43b);});});}exports[_0xe0ee('0x12')]=function(_0x51c290,_0x48968d){return function(_0xcf8b21){try{if(!_[_0xe0ee('0x13')](this['interaction']['UserId'])){logger[_0xe0ee('0x14')](_0xe0ee('0xe'),_0x51c290,_0xe0ee('0x15'));return _0xcf8b21['next']();}var _0x165a45={'ContactId':this[_0xe0ee('0x16')]['id'],'sentAt':moment()[_0xe0ee('0x17')](_0xe0ee('0x18')),'direction':_0xe0ee('0x19')};if(this['channel']===_0xe0ee('0x1a')||this[_0xe0ee('0x1b')]==='whatsapp'){_0x165a45[_0xe0ee('0x1c')]=this['interaction']['phone'];}var _0x3bb72e=this['channel'];if(_0x3bb72e==='chat'){_0x165a45[_0xe0ee('0x1d')]=this[_0xe0ee('0x1e')]['id'];}else{_0x165a45[_[_0xe0ee('0x1f')](_0x3bb72e)+_0xe0ee('0x20')]=this[_0xe0ee('0x1e')]['id'];}_0x165a45[_['upperFirst'](_0x3bb72e)+_0xe0ee('0x21')]=this[_0xe0ee('0x22')]['id'];if(this[_0xe0ee('0x22')]['created']){var _0x38feb5=_0x48968d[0x4];if(!_['isEmpty'](_0x38feb5)){_0x165a45[_0xe0ee('0xf')]=utils[_0xe0ee('0x23')](_0x38feb5,this);return rpc[_0x3bb72e+'Message'][_0xe0ee('0x24')](_0x165a45)[_0xe0ee('0xd')](function(_0x5f5c54){logger[_0xe0ee('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x51c290,_0x165a45[_0xe0ee('0xf')]);})[_0xe0ee('0x25')](function(_0x2fe52f){logger[_0xe0ee('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x51c290,JSON['stringify'](_0x2fe52f));})[_0xe0ee('0x26')](function(){logger[_0xe0ee('0x14')](_0xe0ee('0x27'),_0x51c290);_0xcf8b21[_0xe0ee('0x28')]();});}else{logger[_0xe0ee('0x14')](_0xe0ee('0x29'),_0x51c290);_0xcf8b21[_0xe0ee('0x28')]();}}else{var _0x12b1c5=this;var _0x2d6c63=_0x48968d[0x2][_0xe0ee('0x2a')](/\\n/g,'\x0a');var _0x13a09b={'credentials':{'private_key':_0x2d6c63,'client_email':_0x48968d[0x1]}};var _0x14322f=new dialogflow['SessionsClient'](_0x13a09b);var _0x56bbcf=_0x14322f[_0xe0ee('0x2b')](_0x48968d[0x0],md5(_0x12b1c5[_0xe0ee('0x22')]['id']));var _0x2523d2={'session':_0x56bbcf,'queryInput':{'text':{'text':_0x12b1c5[_0xe0ee('0x2c')][_0xe0ee('0xf')],'languageCode':_0x48968d[0x3]||'en'}}};return _0x14322f[_0xe0ee('0x2d')](_0x2523d2)[_0xe0ee('0xd')](function(_0x5a031b){if(_0x5a031b&&_0x5a031b[_0xe0ee('0x2e')]){_0x12b1c5[_0xe0ee('0xf')][_0xe0ee('0x2f')]=_0x5a031b;var _0x3c5ffa=_0x5a031b[0x0];var _0x5928e5=_0x3c5ffa[_0xe0ee('0x30')][_0xe0ee('0x31')]&&_0x3c5ffa['queryResult'][_0xe0ee('0x31')][_0xe0ee('0x32')]?_0x3c5ffa['queryResult']['diagnosticInfo'][_0xe0ee('0x32')][_0xe0ee('0x33')][_0xe0ee('0x34')]:![];_0x12b1c5[_0xe0ee('0xf')][_0xe0ee('0x35')]=_0x3c5ffa[_0xe0ee('0x30')][_0xe0ee('0x36')];_0x12b1c5[_0xe0ee('0xf')][_0xe0ee('0x37')]=_0x3c5ffa['queryResult']['allRequiredParamsPresent'];_0x12b1c5[_0xe0ee('0xf')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x3c5ffa[_0xe0ee('0x30')][_0xe0ee('0x31')]&&_0x3c5ffa[_0xe0ee('0x30')]['diagnosticInfo'][_0xe0ee('0x32')]?_0x3c5ffa[_0xe0ee('0x30')][_0xe0ee('0x31')]['fields']['end_conversation']['boolValue']:![];_0x12b1c5[_0xe0ee('0xf')][_0xe0ee('0x38')]=_0x3c5ffa[_0xe0ee('0x30')][_0xe0ee('0x39')][_0xe0ee('0x3a')];_0x12b1c5[_0xe0ee('0xf')][_0xe0ee('0x3b')]=_0x3c5ffa[_0xe0ee('0x30')]['intent'][_0xe0ee('0x3c')];_0x12b1c5['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x3c5ffa[_0xe0ee('0x30')][_0xe0ee('0x39')][_0xe0ee('0x3d')];_0x12b1c5[_0xe0ee('0xf')][_0xe0ee('0x3e')]=_0x3c5ffa[_0xe0ee('0x30')][_0xe0ee('0x3f')];_0x12b1c5[_0xe0ee('0xf')]['DIALOGFLOWV2_QUERYTEXT']=_0x3c5ffa['queryResult'][_0xe0ee('0x40')];_0x12b1c5[_0xe0ee('0xf')][_0xe0ee('0x41')]=_0x3c5ffa['queryResult']['intentDetectionConfidence'];_0x165a45[_0xe0ee('0x42')]='dialogflowV2';_0x165a45[_0xe0ee('0x43')]=JSON[_0xe0ee('0x11')](_0x5a031b);var _0x520984=[];for(var _0x2df919=0x0;_0x2df919<_0x5a031b[_0xe0ee('0x2e')];_0x2df919++){var _0x3cef11=_0x5a031b[_0x2df919];if(_0x3cef11&&_0x3cef11[_0xe0ee('0x30')]&&_0x3cef11['queryResult'][_0xe0ee('0x44')]){_0x520984[_0xe0ee('0x45')](createMessage(_0x51c290,_0x3bb72e,_0x165a45,_0x3cef11[_0xe0ee('0x30')][_0xe0ee('0x44')]));}}return Promise[_0xe0ee('0x46')](_0x520984)['then'](function(){if(_0x5928e5){_0xcf8b21[_0xe0ee('0x47')]();}else{_0xcf8b21[_0xe0ee('0x28')]();}})['catch'](function(_0x312132){logger['error'](_0xe0ee('0xe'),_0x51c290,JSON[_0xe0ee('0x11')](_0x312132));_0xcf8b21['next']();});}})[_0xe0ee('0x25')](function(_0x132662){logger[_0xe0ee('0x10')](_0xe0ee('0xe'),_0x51c290,_0x132662[_0xe0ee('0x2c')]);_0xcf8b21[_0xe0ee('0x47')]();});}}catch(_0x5822c3){logger[_0xe0ee('0x10')](_0xe0ee('0xe'),_0x51c290,JSON[_0xe0ee('0x11')](_0x5822c3));_0xcf8b21['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 611276d..72c4ad6 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 _0xfbc8=['number','priority\x20true\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0xfbc8,0xa1));var _0x8fbc=function(_0x8dd419,_0x58acff){_0x8dd419=_0x8dd419-0x0;var _0x4fadf8=_0xfbc8[_0x8dd419];return _0x4fadf8;};'use strict';var schema=require(_0x8fbc('0x0'));var _=require(_0x8fbc('0x1'));var htmlToText=require(_0x8fbc('0x2'));var utils=require(_0x8fbc('0x3'));var logger=require('../../../../config/logger')(_0x8fbc('0x4'));var gotoif=schema({'condition':{'type':_0x8fbc('0x5'),'required':!![],'message':_0x8fbc('0x6')},'priorityTrue':{'type':_0x8fbc('0x7'),'message':_0x8fbc('0x8')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x8fbc('0x9')]=function(_0x29f15d,_0x14e79a){return function(_0x341f88){try{var _0x39ffcc={'condition':htmlToText['fromString'](utils[_0x8fbc('0xa')](_0x14e79a[0x0],this),{'wordwrap':![]})[_0x8fbc('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x14e79a[0x1],'priorityFalse':_0x14e79a[0x2]};var _0x2d5fb4=gotoif['validate'](_0x39ffcc,{'typecast':!![]});if(_0x2d5fb4[_0x8fbc('0xc')]){logger['error'](_0x8fbc('0xd'),_0x29f15d,_[_0x8fbc('0xe')](_0x2d5fb4,_0x8fbc('0xf'))[_0x8fbc('0x10')](',\x20'));_0x341f88[_0x8fbc('0x11')]();}else{try{var _0x3e5668=eval('('+_0x39ffcc['condition']+')');var _0x1f8b54=_0x3e5668?_0x39ffcc[_0x8fbc('0x12')]:_0x39ffcc[_0x8fbc('0x13')];logger[_0x8fbc('0x14')](_0x8fbc('0x15'),_0x29f15d,_0x39ffcc[_0x8fbc('0x16')],_0x3e5668,_0x1f8b54||'next');if(_0x1f8b54){var _0x2b1fe7=_[_0x8fbc('0x17')](_0x341f88[_0x8fbc('0x18')](),{'p':_0x1f8b54});if(_0x2b1fe7>=0x0){logger[_0x8fbc('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x29f15d,_0x1f8b54||_0x8fbc('0x19'),_0x2b1fe7);_0x341f88[_0x8fbc('0x19')](_0x2b1fe7);}else{logger[_0x8fbc('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x29f15d,_0x1f8b54||_0x8fbc('0x19'));_0x341f88[_0x8fbc('0x11')]();}}else{_0x341f88[_0x8fbc('0x19')]();}}catch(_0x1ee047){logger['error'](_0x8fbc('0x1a'),_0x29f15d,_0x1ee047['message']);_0x341f88[_0x8fbc('0x11')]();}}}catch(_0x5042ec){logger['error'](_0x8fbc('0xd'),_0x29f15d,JSON[_0x8fbc('0x1b')](_0x5042ec));_0x341f88[_0x8fbc('0x11')]();}};}; \ No newline at end of file +var _0xb052=['lodash','html-to-text','./utils','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xb052,0x90));var _0x2b05=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0xb052[_0x56fb33];return _0x435ee4;};'use strict';var schema=require(_0x2b05('0x0'));var _=require(_0x2b05('0x1'));var htmlToText=require(_0x2b05('0x2'));var utils=require(_0x2b05('0x3'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0x2b05('0x4'),'required':!![],'message':_0x2b05('0x5')},'priorityTrue':{'type':_0x2b05('0x6'),'message':_0x2b05('0x7')},'priorityFalse':{'type':_0x2b05('0x6'),'message':_0x2b05('0x8')}});exports[_0x2b05('0x9')]=function(_0xa9888d,_0x1ff2e6){return function(_0x2a758d){try{var _0x4cbd17={'condition':htmlToText[_0x2b05('0xa')](utils[_0x2b05('0xb')](_0x1ff2e6[0x0],this),{'wordwrap':![]})[_0x2b05('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ff2e6[0x1],'priorityFalse':_0x1ff2e6[0x2]};var _0x2cb76d=gotoif[_0x2b05('0x0')](_0x4cbd17,{'typecast':!![]});if(_0x2cb76d[_0x2b05('0xd')]){logger['error'](_0x2b05('0xe'),_0xa9888d,_[_0x2b05('0xf')](_0x2cb76d,'message')[_0x2b05('0x10')](',\x20'));_0x2a758d[_0x2b05('0x11')]();}else{try{var _0x528061=eval('('+_0x4cbd17[_0x2b05('0x12')]+')');var _0x1b8291=_0x528061?_0x4cbd17[_0x2b05('0x13')]:_0x4cbd17['priorityFalse'];logger[_0x2b05('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0xa9888d,_0x4cbd17[_0x2b05('0x12')],_0x528061,_0x1b8291||_0x2b05('0x15'));if(_0x1b8291){var _0x12723d=_[_0x2b05('0x16')](_0x2a758d[_0x2b05('0x17')](),{'p':_0x1b8291});if(_0x12723d>=0x0){logger[_0x2b05('0x14')](_0x2b05('0x18'),_0xa9888d,_0x1b8291||'next',_0x12723d);_0x2a758d[_0x2b05('0x15')](_0x12723d);}else{logger[_0x2b05('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0xa9888d,_0x1b8291||_0x2b05('0x15'));_0x2a758d[_0x2b05('0x11')]();}}else{_0x2a758d[_0x2b05('0x15')]();}}catch(_0x104916){logger[_0x2b05('0x19')](_0x2b05('0x1a'),_0xa9888d,_0x104916[_0x2b05('0x1b')]);_0x2a758d[_0x2b05('0x11')]();}}}catch(_0x345115){logger['error'](_0x2b05('0xe'),_0xa9888d,JSON[_0x2b05('0x1c')](_0x345115));_0x2a758d[_0x2b05('0x11')]();}};}; \ 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 5645c33..49180c4 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 _0xa0ca=['validate','lodash','../../../../config/logger','routing','number','consequence','length','error','map','join','stop','info','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify'];(function(_0x94cd8,_0x80691a){var _0x5572f4=function(_0x2cae9b){while(--_0x2cae9b){_0x94cd8['push'](_0x94cd8['shift']());}};_0x5572f4(++_0x80691a);}(_0xa0ca,0x156));var _0xaa0c=function(_0x26dc22,_0x4b02a2){_0x26dc22=_0x26dc22-0x0;var _0x1295f1=_0xa0ca[_0x26dc22];return _0x1295f1;};'use strict';var schema=require(_0xaa0c('0x0'));var _=require(_0xaa0c('0x1'));var logger=require(_0xaa0c('0x2'))(_0xaa0c('0x3'));var gotop=schema({'priority':{'type':_0xaa0c('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xaa0c('0x5')]=function(_0x3a314a,_0x56c7a8){return function(_0x5d33b8){try{var _0x297907={'priority':_0x56c7a8[0x0]};var _0x5a0219=gotop['validate'](_0x297907,{'typecast':!![]});if(_0x5a0219[_0xaa0c('0x6')]){logger[_0xaa0c('0x7')]('[%s][GOTOP]\x20%s',_0x3a314a,_[_0xaa0c('0x8')](_0x5a0219,'message')[_0xaa0c('0x9')](',\x20'));_0x5d33b8[_0xaa0c('0xa')]();}else{logger[_0xaa0c('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x3a314a,_0x297907[_0xaa0c('0xc')]);if(_0x297907['priority']){var _0x58ae58=_[_0xaa0c('0xd')](_0x5d33b8[_0xaa0c('0xe')](),{'p':_0x297907[_0xaa0c('0xc')]});if(_0x58ae58>=0x0){logger[_0xaa0c('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3a314a,_0x297907[_0xaa0c('0xc')]||_0xaa0c('0xf'),_0x58ae58);_0x5d33b8[_0xaa0c('0xf')](_0x58ae58);}else{logger[_0xaa0c('0xb')](_0xaa0c('0x10'),_0x3a314a,_0x297907[_0xaa0c('0xc')]||'next');_0x5d33b8['stop']();}}else{_0x5d33b8[_0xaa0c('0xf')]();}}}catch(_0x8e7fb9){logger[_0xaa0c('0x7')](_0xaa0c('0x11'),_0x3a314a,JSON[_0xaa0c('0x12')](_0x8e7fb9));_0x5d33b8[_0xaa0c('0xa')]();}};}; \ No newline at end of file +var _0x2847=['consequence','validate','length','error','[%s][GOTOP]\x20%s','message','stop','priority','info','next','stringify','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x1d606d,_0x376e51){var _0x3c38bd=function(_0x2ea4e2){while(--_0x2ea4e2){_0x1d606d['push'](_0x1d606d['shift']());}};_0x3c38bd(++_0x376e51);}(_0x2847,0x1cd));var _0x7284=function(_0x262baa,_0x283058){_0x262baa=_0x262baa-0x0;var _0x4f2257=_0x2847[_0x262baa];return _0x4f2257;};'use strict';var schema=require('validate');var _=require(_0x7284('0x0'));var logger=require(_0x7284('0x1'))(_0x7284('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x7284('0x3')}});exports[_0x7284('0x4')]=function(_0x1ab49d,_0x36890a){return function(_0x52d483){try{var _0x283d1a={'priority':_0x36890a[0x0]};var _0x5c9617=gotop[_0x7284('0x5')](_0x283d1a,{'typecast':!![]});if(_0x5c9617[_0x7284('0x6')]){logger[_0x7284('0x7')](_0x7284('0x8'),_0x1ab49d,_['map'](_0x5c9617,_0x7284('0x9'))['join'](',\x20'));_0x52d483[_0x7284('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x1ab49d,_0x283d1a[_0x7284('0xb')]);if(_0x283d1a['priority']){var _0x1722ce=_['findIndex'](_0x52d483['rules'](),{'p':_0x283d1a['priority']});if(_0x1722ce>=0x0){logger[_0x7284('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1ab49d,_0x283d1a[_0x7284('0xb')]||_0x7284('0xd'),_0x1722ce);_0x52d483['next'](_0x1722ce);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1ab49d,_0x283d1a[_0x7284('0xb')]||_0x7284('0xd'));_0x52d483['stop']();}}else{_0x52d483[_0x7284('0xd')]();}}}catch(_0x369ae5){logger[_0x7284('0x7')]('[%s][GOTOP]\x20%s',_0x1ab49d,JSON[_0x7284('0xe')](_0x369ae5));_0x52d483['stop']();}};}; \ 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 9541690..b1a849a 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 _0x95a7=['contact','ChatWebsiteId','upperFirst','channel','AccountId','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x54386b,_0x5c7ea7){var _0x50b0d4=function(_0x5ed88a){while(--_0x5ed88a){_0x54386b['push'](_0x54386b['shift']());}};_0x50b0d4(++_0x5c7ea7);}(_0x95a7,0x6a));var _0x795a=function(_0x57866e,_0x363556){_0x57866e=_0x57866e-0x0;var _0x5a19d7=_0x95a7[_0x57866e];return _0x5a19d7;};'use strict';var _=require(_0x795a('0x0'));var utils=require(_0x795a('0x1'));var logger=require('../../../../config/logger')(_0x795a('0x2'));var rpc={'chatMessage':require(_0x795a('0x3')),'openchannelMessage':require(_0x795a('0x4')),'mailMessage':require(_0x795a('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x795a('0x6')),'whatsappMessage':require(_0x795a('0x7'))};exports[_0x795a('0x8')]=function(_0x4a22c1,_0x1d922d){return function(_0x289f4a){try{var _0x4de856={'body':utils[_0x795a('0x9')](_0x1d922d[0x0],this),'ContactId':this[_0x795a('0xa')]['id']};if(this['channel']==='chat'){_0x4de856[_0x795a('0xb')]=this['account']['id'];}else{_0x4de856[_[_0x795a('0xc')](this[_0x795a('0xd')])+_0x795a('0xe')]=this[_0x795a('0xf')]['id'];}_0x4de856[_[_0x795a('0xc')](this[_0x795a('0xd')])+_0x795a('0x10')]=this[_0x795a('0x11')]['id'];if(rpc[this[_0x795a('0xd')]+'Message']){return rpc[this[_0x795a('0xd')]+_0x795a('0x12')][_0x795a('0x13')](_0x4de856)[_0x795a('0x14')](function(_0x319243){logger[_0x795a('0x15')](_0x795a('0x16'),_0x4a22c1,_0x4de856[_0x795a('0x17')]);_0x289f4a[_0x795a('0x18')]();})[_0x795a('0x19')](function(_0x210871){logger[_0x795a('0x1a')](_0x795a('0x16'),_0x4a22c1,JSON['stringify'](_0x210871));_0x289f4a['stop']();});}}catch(_0x5b1b79){logger[_0x795a('0x1a')](_0x795a('0x16'),_0x4a22c1,JSON[_0x795a('0x1b')](_0x5b1b79));_0x289f4a[_0x795a('0x1c')]();}};}; \ No newline at end of file +var _0x6c00=['../../rpc/whatsappMessage','consequence','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x1180da,_0x4c9df2){var _0x2d6fb9=function(_0x36e2ff){while(--_0x36e2ff){_0x1180da['push'](_0x1180da['shift']());}};_0x2d6fb9(++_0x4c9df2);}(_0x6c00,0x1a9));var _0x06c0=function(_0x55257d,_0x3998ec){_0x55257d=_0x55257d-0x0;var _0x4d296d=_0x6c00[_0x55257d];return _0x4d296d;};'use strict';var _=require(_0x06c0('0x0'));var utils=require(_0x06c0('0x1'));var logger=require(_0x06c0('0x2'))('routing');var rpc={'chatMessage':require(_0x06c0('0x3')),'openchannelMessage':require(_0x06c0('0x4')),'mailMessage':require(_0x06c0('0x5')),'smsMessage':require(_0x06c0('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x06c0('0x7'))};exports[_0x06c0('0x8')]=function(_0x1006d3,_0x466f82){return function(_0x32510f){try{var _0x5978d1={'body':utils['getMustacheRender'](_0x466f82[0x0],this),'ContactId':this[_0x06c0('0x9')]['id']};if(this[_0x06c0('0xa')]==='chat'){_0x5978d1[_0x06c0('0xb')]=this[_0x06c0('0xc')]['id'];}else{_0x5978d1[_[_0x06c0('0xd')](this[_0x06c0('0xa')])+_0x06c0('0xe')]=this[_0x06c0('0xc')]['id'];}_0x5978d1[_[_0x06c0('0xd')](this[_0x06c0('0xa')])+_0x06c0('0xf')]=this[_0x06c0('0x10')]['id'];if(rpc[this[_0x06c0('0xa')]+'Message']){return rpc[this['channel']+_0x06c0('0x11')][_0x06c0('0x12')](_0x5978d1)[_0x06c0('0x13')](function(_0xd1d3a6){logger[_0x06c0('0x14')]('[%s][MESSAGE]\x20%s',_0x1006d3,_0x5978d1['body']);_0x32510f[_0x06c0('0x15')]();})[_0x06c0('0x16')](function(_0x1c950b){logger[_0x06c0('0x17')](_0x06c0('0x18'),_0x1006d3,JSON[_0x06c0('0x19')](_0x1c950b));_0x32510f[_0x06c0('0x1a')]();});}}catch(_0x573ef5){logger[_0x06c0('0x17')](_0x06c0('0x18'),_0x1006d3,JSON[_0x06c0('0x19')](_0x573ef5));_0x32510f[_0x06c0('0x1a')]();}};}; \ 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 dec17e6..096aa26 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 _0x3c19=['consequence','info','[%s][NOOP]\x20%s','next','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x5c88a4,_0x7e31bc){var _0x5b0915=function(_0x498549){while(--_0x498549){_0x5c88a4['push'](_0x5c88a4['shift']());}};_0x5b0915(++_0x7e31bc);}(_0x3c19,0x177));var _0x93c1=function(_0x5a7680,_0x35abea){_0x5a7680=_0x5a7680-0x0;var _0x335d01=_0x3c19[_0x5a7680];return _0x335d01;};'use strict';var utils=require(_0x93c1('0x0'));var logger=require(_0x93c1('0x1'))(_0x93c1('0x2'));exports[_0x93c1('0x3')]=function(_0x4f8af8,_0x263147){return function(_0x40f080){try{logger[_0x93c1('0x4')](_0x93c1('0x5'),_0x4f8af8,utils['getMustacheRender'](_0x263147[0x0],this));_0x40f080[_0x93c1('0x6')]();}catch(_0x465108){logger['error']('[%s][NOOP]\x20%s',_0x4f8af8,JSON[_0x93c1('0x7')](_0x465108));_0x40f080[_0x93c1('0x8')]();}};}; \ No newline at end of file +var _0x0acc=['next','error','stringify','stop','../../../../config/logger','routing','consequence','info','getMustacheRender'];(function(_0x147434,_0x49ffc1){var _0x25b348=function(_0x2e0f29){while(--_0x2e0f29){_0x147434['push'](_0x147434['shift']());}};_0x25b348(++_0x49ffc1);}(_0x0acc,0xb8));var _0xc0ac=function(_0x372845,_0x21fdd1){_0x372845=_0x372845-0x0;var _0x168cb9=_0x0acc[_0x372845];return _0x168cb9;};'use strict';var utils=require('./utils');var logger=require(_0xc0ac('0x0'))(_0xc0ac('0x1'));exports[_0xc0ac('0x2')]=function(_0x35cdc3,_0x5ad102){return function(_0x46df84){try{logger[_0xc0ac('0x3')]('[%s][NOOP]\x20%s',_0x35cdc3,utils[_0xc0ac('0x4')](_0x5ad102[0x0],this));_0x46df84[_0xc0ac('0x5')]();}catch(_0xa697fc){logger[_0xc0ac('0x6')]('[%s][NOOP]\x20%s',_0x35cdc3,JSON[_0xc0ac('0x7')](_0xa697fc));_0x46df84[_0xc0ac('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index d7eed5a..4153e26 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 _0x1f4f=['timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','interaction','MessageId','message','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','moment','ioredis','../../../../config/logger','defaults','redis','queue_id','queue','joinAt','emit','clone','account','%sQueuesWaitingInteractions','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x5690c6,_0x40fc47){var _0x3ae5e5=function(_0x5d2f13){while(--_0x5d2f13){_0x5690c6['push'](_0x5690c6['shift']());}};_0x3ae5e5(++_0x40fc47);}(_0x1f4f,0x1a8));var _0xf1f4=function(_0x39d9e6,_0x635773){_0x39d9e6=_0x39d9e6-0x0;var _0x48f3cd=_0x1f4f[_0x39d9e6];return _0x48f3cd;};'use strict';var schema=require(_0xf1f4('0x0'));var _=require(_0xf1f4('0x1'));var util=require(_0xf1f4('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xf1f4('0x3'));var Redis=require(_0xf1f4('0x4'));var config=require('../../../../config/environment');var logger=require(_0xf1f4('0x5'))('routing');var strategy=require('./strategy');config['redis']=_[_0xf1f4('0x6')](config[_0xf1f4('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf1f4('0x7')]));var attributes=['id',_0xf1f4('0x8'),'account',_0xf1f4('0x9'),'from',_0xf1f4('0xa')];function emit(_0x4e5727,_0x345c2a,_0x2ac777){io['to'](_0x4e5727)[_0xf1f4('0xb')](_0x345c2a,_0x2ac777);}function emitChannelQueueInteraction(_0xa91c42,_0x4cb867,_0x13e66f,_0x15d25c,_0x10b8ea,_0x56f9a6,_0x34c39c,_0x3c9e69){var _0x4d2d14=_[_0xf1f4('0xc')](_0x13e66f);_0x4d2d14[_0xf1f4('0x8')]=_0x3c9e69;_0x4d2d14[_0xf1f4('0x9')]=_0x4cb867;_0x4d2d14[_0xf1f4('0xd')]=_0x15d25c;_0x4d2d14['id']=_0x10b8ea;if(_0x56f9a6){_0x34c39c[util['format'](_0xf1f4('0xe'),_0xa91c42)][_0x10b8ea]=_['pick'](_0x4d2d14,attributes);}else{delete _0x34c39c[util[_0xf1f4('0xf')](_0xf1f4('0xe'),_0xa91c42)][_0x10b8ea];}emit(util[_0xf1f4('0xf')](_0xf1f4('0x10'),_0xa91c42,_0x4cb867),util[_0xf1f4('0xf')](_0xf1f4('0x11'),_0xa91c42,_0x56f9a6?_0xf1f4('0x12'):'remove'),_[_0xf1f4('0x13')](_0x4d2d14,attributes));}var rpc={'openchannelQueueReport':require(_0xf1f4('0x14')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xf1f4('0x15')),'smsQueueReport':require(_0xf1f4('0x16')),'faxQueueReport':require(_0xf1f4('0x17')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xf1f4('0x18')},'timeout':{'type':_0xf1f4('0x19'),'message':_0xf1f4('0x1a')}});function startRouting(_0x4e9af8,_0x278a39,_0x5a03c6,_0x339b9e){if(_0x4e9af8&&_0x278a39&&_0x5a03c6){_0x278a39[_0xf1f4('0x1b')]+=0x1;var _0x54c25b={'uniqueid':_0x4e9af8,'from':_0x5a03c6[_0xf1f4('0x1c')]?_0x5a03c6[_0xf1f4('0x1c')][_0xf1f4('0x1d')]:'','joinAt':moment()[_0xf1f4('0xf')](_0xf1f4('0x1e')),'ContactId':_0x5a03c6[_0xf1f4('0x1f')]?_0x5a03c6['contact']['id']:null,'ListId':_0x5a03c6['list']?_0x5a03c6['list']['id']:null};_0x54c25b[_[_0xf1f4('0x20')](_0x5a03c6[_0xf1f4('0x21')])+_0xf1f4('0x22')]=_0x278a39['id']||null;_0x54c25b[_[_0xf1f4('0x20')](_0x5a03c6[_0xf1f4('0x21')])+'InteractionId']=_0x5a03c6[_0xf1f4('0x23')]?_0x5a03c6[_0xf1f4('0x23')]['id']:null;_0x54c25b[_[_0xf1f4('0x20')](_0x5a03c6[_0xf1f4('0x21')])+_0xf1f4('0x24')]=_0x5a03c6[_0xf1f4('0x25')]?_0x5a03c6['message']['id']:null;_0x54c25b[_[_0xf1f4('0x20')](_0x5a03c6['channel'])+(_0x5a03c6[_0xf1f4('0x21')]!=='chat'?_0xf1f4('0x26'):_0xf1f4('0x27'))]=_0x5a03c6[_0xf1f4('0xd')]?_0x5a03c6[_0xf1f4('0xd')]['id']:null;logger['info'](util[_0xf1f4('0xf')](_0xf1f4('0x28'),_0x4e9af8,_0x278a39[_0xf1f4('0x29')]));emitChannelQueueInteraction(_0x5a03c6[_0xf1f4('0x21')],_0x278a39['name'],_0x54c25b,_0x5a03c6[_0xf1f4('0xd')][_0xf1f4('0x29')],_0x5a03c6[_0xf1f4('0x25')]['id'],!![],_0x339b9e,_0x278a39['id']);if(rpc[_0x5a03c6['channel']+_0xf1f4('0x2a')]){return rpc[_0x5a03c6[_0xf1f4('0x21')]+_0xf1f4('0x2a')][_0xf1f4('0x2b')](_0x54c25b)[_0xf1f4('0x2c')](function(_0x3c1587){logger[_0xf1f4('0x2d')](_0xf1f4('0x2e'));});}}}function stopRouting(_0xc221c3,_0x371b05,_0x2e9a1b,_0x3e514c){if(_0xc221c3&&_0x371b05){_0x371b05[_0xf1f4('0x1b')]-=0x1;var _0x29d972={'leaveAt':moment()[_0xf1f4('0xf')](_0xf1f4('0x1e')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf1f4('0x2f')};logger[_0xf1f4('0x30')](util['format'](_0xf1f4('0x31'),_0xc221c3,_0x371b05[_0xf1f4('0x29')]));emitChannelQueueInteraction(_0x2e9a1b[_0xf1f4('0x21')],_0x371b05[_0xf1f4('0x29')],_0x2e9a1b[_0xf1f4('0x1c')],_0x2e9a1b[_0xf1f4('0xd')]['name'],_0x2e9a1b[_0xf1f4('0x25')]['id'],![],_0x3e514c,_0x371b05['id']);if(rpc[_0x2e9a1b['channel']+_0xf1f4('0x2a')]){return rpc[_0x2e9a1b[_0xf1f4('0x21')]+_0xf1f4('0x2a')][_0xf1f4('0x32')](_0xc221c3,_0x29d972)[_0xf1f4('0x2c')](function(_0x50c16e){logger[_0xf1f4('0x2d')](_0xf1f4('0x33'));});}}}function endRouting(_0x4472a9,_0x5ba694,_0x593997,_0x14b01a){if(_0x4472a9&&_0x5ba694){_0x5ba694[_0xf1f4('0x1b')]-=0x1;var _0x3126cb={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xf1f4('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf1f4('0x34')};logger[_0xf1f4('0x30')](util[_0xf1f4('0xf')](_0xf1f4('0x35'),_0x4472a9,_0x5ba694[_0xf1f4('0x29')]));emitChannelQueueInteraction(_0x593997[_0xf1f4('0x21')],_0x5ba694[_0xf1f4('0x29')],_0x593997[_0xf1f4('0x1c')],_0x593997[_0xf1f4('0xd')]['name'],_0x593997[_0xf1f4('0x25')]['id'],![],_0x14b01a);if(rpc[_0x593997[_0xf1f4('0x21')]+_0xf1f4('0x2a')]){return rpc[_0x593997[_0xf1f4('0x21')]+'QueueReport'][_0xf1f4('0x32')](_0x4472a9,_0x3126cb)[_0xf1f4('0x2c')](function(_0xb521fa){logger[_0xf1f4('0x2d')](_0xf1f4('0x33'));});}}}function handleFindQueue(_0x409c37){return function(_0x4fc3f1){return _0x4fc3f1['name']['toLowerCase']()===_0x409c37[_0xf1f4('0x36')]();};}exports[_0xf1f4('0x37')]=function(_0x1a2d0f,_0x408451,_0x5673ac,_0xb1e9f){return function(_0x21bb44){try{var _0x1da7d3={'name':_0x408451[0x0],'timeout':_0x408451[0x1]};var _0x768d1b=queue[_0xf1f4('0x0')](_0x1da7d3,{'typecast':!![]});if(_0x768d1b['length']){logger[_0xf1f4('0x2d')]('[%s][QUEUE]\x20%s',_0x1a2d0f,_[_0xf1f4('0x38')](_0x768d1b,_0xf1f4('0x25'))[_0xf1f4('0x39')](',\x20'));_0x21bb44[_0xf1f4('0x3a')]();}else{var _0x22ac1b=_['find'](_0x5673ac[_0xb1e9f[_0xf1f4('0x21')]+_0xf1f4('0x3b')],handleFindQueue(_0x1da7d3[_0xf1f4('0x29')]));if(_0x22ac1b){startRouting(_0x1a2d0f,_0x22ac1b,_0xb1e9f,_0x5673ac);var _0x382125=(_0x22ac1b[_0xf1f4('0x34')]||0xa)*0x3e8;var _0x4031d1=(_0x1da7d3[_0xf1f4('0x34')]||0x14)*0x3e8;var _0x596f25,_0x55043c;if(_0x382125>_0x4031d1){_0x4031d1=_0x382125;}var _0x16398e=seqqueue[_0xf1f4('0x3c')](_0x382125);_0x16398e['id']=_0x1a2d0f;_0x16398e[_0xf1f4('0x3d')]=_0x382125;_0x16398e[_0xf1f4('0x3e')]=_0x4031d1;_0x16398e[_0xf1f4('0x21')]=_0xb1e9f[_0xf1f4('0x21')];_0x5673ac[_0xf1f4('0x3f')][_0x1a2d0f]['on'](_0xf1f4('0x40'),function(){logger[_0xf1f4('0x30')](_0xf1f4('0x41'),_0x1a2d0f);stopRouting(_0x1a2d0f,_0x22ac1b,_0xb1e9f,_0x5673ac);clearTimeout(_0x596f25);_0x596f25=undefined;_0x16398e[_0xf1f4('0x42')](!![]);if(_0x5673ac[_0xf1f4('0x3f')][_0x1a2d0f]){delete _0x5673ac['rules'][_0x1a2d0f];}_0x21bb44['stop']();});_0x5673ac['rules'][_0x1a2d0f]['on']('complete',function(){if(_0x5673ac[_0xf1f4('0x3f')][_0x1a2d0f]){delete _0x5673ac[_0xf1f4('0x3f')][_0x1a2d0f];}});_0x596f25=setTimeout(function(){logger[_0xf1f4('0x30')](_0xf1f4('0x43'),_0x1a2d0f);endRouting(_0x1a2d0f,_0x22ac1b,_0xb1e9f,_0x5673ac);clearTimeout(_0x596f25);_0x16398e[_0xf1f4('0x42')](!![]);_0x21bb44[_0xf1f4('0x44')]();},_0x4031d1);switch(_0x22ac1b[_0xf1f4('0x45')]){case _0xf1f4('0x46'):strategy[_0xf1f4('0x46')](_0x16398e,_0x22ac1b,_0x5673ac,_0xb1e9f);break;default:strategy[_0xf1f4('0x47')](_0x16398e,_0x22ac1b,_0x5673ac,_0xb1e9f);}}else{logger[_0xf1f4('0x2d')](_0xf1f4('0x48'),_0x1a2d0f,_0x1da7d3[_0xf1f4('0x29')]);_0x21bb44[_0xf1f4('0x3a')]();}}}catch(_0x2acf24){console['log'](_0x2acf24);logger[_0xf1f4('0x2d')](_0xf1f4('0x49'),_0x1a2d0f,_0x2acf24[_0xf1f4('0x4a')]);_0x21bb44['stop']();}};}; \ No newline at end of file +var _0x9f34=['[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','accepted','update','error','update\x20queue\x20report','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','join','find','Queues','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','seq-queue','moment','../../../../config/environment','./strategy','redis','localhost','queue_id','account','joinAt','queue','format','pick','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','WebsiteId','info'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9f34,0x1c1));var _0x49f3=function(_0x3ac13d,_0x11af52){_0x3ac13d=_0x3ac13d-0x0;var _0x4dce85=_0x9f34[_0x3ac13d];return _0x4dce85;};'use strict';var schema=require(_0x49f3('0x0'));var _=require(_0x49f3('0x1'));var util=require('util');var seqqueue=require(_0x49f3('0x2'));var moment=require(_0x49f3('0x3'));var Redis=require('ioredis');var config=require(_0x49f3('0x4'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x49f3('0x5'));config[_0x49f3('0x6')]=_['defaults'](config[_0x49f3('0x6')],{'host':_0x49f3('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x49f3('0x8'),_0x49f3('0x9'),'queue','from',_0x49f3('0xa')];function emit(_0x40d1d8,_0x11baa6,_0x11fc44){io['to'](_0x40d1d8)['emit'](_0x11baa6,_0x11fc44);}function emitChannelQueueInteraction(_0x5c250f,_0x3d7429,_0x43e344,_0x2f07e2,_0x60327b,_0x45c26f,_0x4d36b0,_0x344169){var _0x3a2677=_['clone'](_0x43e344);_0x3a2677['queue_id']=_0x344169;_0x3a2677[_0x49f3('0xb')]=_0x3d7429;_0x3a2677[_0x49f3('0x9')]=_0x2f07e2;_0x3a2677['id']=_0x60327b;if(_0x45c26f){_0x4d36b0[util[_0x49f3('0xc')]('%sQueuesWaitingInteractions',_0x5c250f)][_0x60327b]=_[_0x49f3('0xd')](_0x3a2677,attributes);}else{delete _0x4d36b0[util[_0x49f3('0xc')](_0x49f3('0xe'),_0x5c250f)][_0x60327b];}emit(util[_0x49f3('0xc')]('%s:queue:%s',_0x5c250f,_0x3d7429),util[_0x49f3('0xc')](_0x49f3('0xf'),_0x5c250f,_0x45c26f?_0x49f3('0x10'):'remove'),_[_0x49f3('0xd')](_0x3a2677,attributes));}var rpc={'openchannelQueueReport':require(_0x49f3('0x11')),'mailQueueReport':require(_0x49f3('0x12')),'chatQueueReport':require(_0x49f3('0x13')),'smsQueueReport':require(_0x49f3('0x14')),'faxQueueReport':require(_0x49f3('0x15')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x49f3('0x16'),'required':!![],'message':_0x49f3('0x17')},'timeout':{'type':_0x49f3('0x18'),'message':_0x49f3('0x19')}});function startRouting(_0x53d30a,_0x4db41d,_0x24cea2,_0x5c2251){if(_0x53d30a&&_0x4db41d&&_0x24cea2){_0x4db41d[_0x49f3('0x1a')]+=0x1;var _0x4625a9={'uniqueid':_0x53d30a,'from':_0x24cea2['body']?_0x24cea2[_0x49f3('0x1b')][_0x49f3('0x1c')]:'','joinAt':moment()[_0x49f3('0xc')](_0x49f3('0x1d')),'ContactId':_0x24cea2[_0x49f3('0x1e')]?_0x24cea2[_0x49f3('0x1e')]['id']:null,'ListId':_0x24cea2[_0x49f3('0x1f')]?_0x24cea2['list']['id']:null};_0x4625a9[_[_0x49f3('0x20')](_0x24cea2[_0x49f3('0x21')])+_0x49f3('0x22')]=_0x4db41d['id']||null;_0x4625a9[_['upperFirst'](_0x24cea2[_0x49f3('0x21')])+'InteractionId']=_0x24cea2[_0x49f3('0x23')]?_0x24cea2['interaction']['id']:null;_0x4625a9[_[_0x49f3('0x20')](_0x24cea2[_0x49f3('0x21')])+_0x49f3('0x24')]=_0x24cea2[_0x49f3('0x25')]?_0x24cea2[_0x49f3('0x25')]['id']:null;_0x4625a9[_[_0x49f3('0x20')](_0x24cea2[_0x49f3('0x21')])+(_0x24cea2[_0x49f3('0x21')]!==_0x49f3('0x26')?'AccountId':_0x49f3('0x27'))]=_0x24cea2['account']?_0x24cea2[_0x49f3('0x9')]['id']:null;logger[_0x49f3('0x28')](util['format'](_0x49f3('0x29'),_0x53d30a,_0x4db41d[_0x49f3('0x2a')]));emitChannelQueueInteraction(_0x24cea2[_0x49f3('0x21')],_0x4db41d[_0x49f3('0x2a')],_0x4625a9,_0x24cea2[_0x49f3('0x9')][_0x49f3('0x2a')],_0x24cea2[_0x49f3('0x25')]['id'],!![],_0x5c2251,_0x4db41d['id']);if(rpc[_0x24cea2['channel']+_0x49f3('0x2b')]){return rpc[_0x24cea2['channel']+_0x49f3('0x2b')][_0x49f3('0x2c')](_0x4625a9)[_0x49f3('0x2d')](function(_0x241b68){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x636904,_0x1a7e4a,_0x870a17,_0x5817de){if(_0x636904&&_0x1a7e4a){_0x1a7e4a[_0x49f3('0x1a')]-=0x1;var _0x12560a={'leaveAt':moment()[_0x49f3('0xc')](_0x49f3('0x1d')),'acceptAt':moment()[_0x49f3('0xc')](_0x49f3('0x1d')),'reason':_0x49f3('0x2e')};logger['info'](util[_0x49f3('0xc')]('[%s][STOP:QUEUE][NAME:%s]',_0x636904,_0x1a7e4a['name']));emitChannelQueueInteraction(_0x870a17[_0x49f3('0x21')],_0x1a7e4a[_0x49f3('0x2a')],_0x870a17[_0x49f3('0x1b')],_0x870a17[_0x49f3('0x9')][_0x49f3('0x2a')],_0x870a17[_0x49f3('0x25')]['id'],![],_0x5817de,_0x1a7e4a['id']);if(rpc[_0x870a17[_0x49f3('0x21')]+_0x49f3('0x2b')]){return rpc[_0x870a17[_0x49f3('0x21')]+'QueueReport'][_0x49f3('0x2f')](_0x636904,_0x12560a)[_0x49f3('0x2d')](function(_0x1c1cdc){logger[_0x49f3('0x30')](_0x49f3('0x31'));});}}}function endRouting(_0x5c23f5,_0x56f932,_0x9c6ffd,_0x42dcb3){if(_0x5c23f5&&_0x56f932){_0x56f932[_0x49f3('0x1a')]-=0x1;var _0x914552={'leaveAt':moment()[_0x49f3('0xc')](_0x49f3('0x1d')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x49f3('0x32')};logger[_0x49f3('0x28')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x5c23f5,_0x56f932['name']));emitChannelQueueInteraction(_0x9c6ffd['channel'],_0x56f932[_0x49f3('0x2a')],_0x9c6ffd['body'],_0x9c6ffd[_0x49f3('0x9')][_0x49f3('0x2a')],_0x9c6ffd[_0x49f3('0x25')]['id'],![],_0x42dcb3);if(rpc[_0x9c6ffd[_0x49f3('0x21')]+_0x49f3('0x2b')]){return rpc[_0x9c6ffd['channel']+_0x49f3('0x2b')][_0x49f3('0x2f')](_0x5c23f5,_0x914552)[_0x49f3('0x2d')](function(_0x3c18db){logger[_0x49f3('0x30')](_0x49f3('0x31'));});}}}function handleFindQueue(_0x509d3e){return function(_0x4fbeae){return _0x4fbeae[_0x49f3('0x2a')][_0x49f3('0x33')]()===_0x509d3e[_0x49f3('0x33')]();};}exports['consequence']=function(_0xdec6a8,_0xba0ef,_0x5c3648,_0x163998){return function(_0x5cc79e){try{var _0x4a5732={'name':_0xba0ef[0x0],'timeout':_0xba0ef[0x1]};var _0x4f3533=queue[_0x49f3('0x0')](_0x4a5732,{'typecast':!![]});if(_0x4f3533[_0x49f3('0x34')]){logger['error'](_0x49f3('0x35'),_0xdec6a8,_['map'](_0x4f3533,_0x49f3('0x25'))[_0x49f3('0x36')](',\x20'));_0x5cc79e['stop']();}else{var _0x381570=_[_0x49f3('0x37')](_0x5c3648[_0x163998[_0x49f3('0x21')]+_0x49f3('0x38')],handleFindQueue(_0x4a5732['name']));if(_0x381570){startRouting(_0xdec6a8,_0x381570,_0x163998,_0x5c3648);var _0x59c873=(_0x381570[_0x49f3('0x32')]||0xa)*0x3e8;var _0xd58b89=(_0x4a5732[_0x49f3('0x32')]||0x14)*0x3e8;var _0x4543a3,_0x347018;if(_0x59c873>_0xd58b89){_0xd58b89=_0x59c873;}var _0x59d4b7=seqqueue['createQueue'](_0x59c873);_0x59d4b7['id']=_0xdec6a8;_0x59d4b7['atimeout']=_0x59c873;_0x59d4b7['qtimeout']=_0xd58b89;_0x59d4b7['channel']=_0x163998[_0x49f3('0x21')];_0x5c3648[_0x49f3('0x39')][_0xdec6a8]['on'](_0x49f3('0x3a'),function(){logger[_0x49f3('0x28')](_0x49f3('0x3b'),_0xdec6a8);stopRouting(_0xdec6a8,_0x381570,_0x163998,_0x5c3648);clearTimeout(_0x4543a3);_0x4543a3=undefined;_0x59d4b7[_0x49f3('0x3c')](!![]);if(_0x5c3648[_0x49f3('0x39')][_0xdec6a8]){delete _0x5c3648[_0x49f3('0x39')][_0xdec6a8];}_0x5cc79e[_0x49f3('0x3d')]();});_0x5c3648[_0x49f3('0x39')][_0xdec6a8]['on'](_0x49f3('0x3e'),function(){if(_0x5c3648[_0x49f3('0x39')][_0xdec6a8]){delete _0x5c3648['rules'][_0xdec6a8];}});_0x4543a3=setTimeout(function(){logger[_0x49f3('0x28')](_0x49f3('0x3f'),_0xdec6a8);endRouting(_0xdec6a8,_0x381570,_0x163998,_0x5c3648);clearTimeout(_0x4543a3);_0x59d4b7[_0x49f3('0x3c')](!![]);_0x5cc79e[_0x49f3('0x40')]();},_0xd58b89);switch(_0x381570[_0x49f3('0x41')]){case'rrmemory':strategy[_0x49f3('0x42')](_0x59d4b7,_0x381570,_0x5c3648,_0x163998);break;default:strategy[_0x49f3('0x43')](_0x59d4b7,_0x381570,_0x5c3648,_0x163998);}}else{logger[_0x49f3('0x30')](_0x49f3('0x44'),_0xdec6a8,_0x4a5732[_0x49f3('0x2a')]);_0x5cc79e[_0x49f3('0x3d')]();}}}catch(_0x1ac967){console[_0x49f3('0x45')](_0x1ac967);logger[_0x49f3('0x30')](_0x49f3('0x35'),_0xdec6a8,_0x1ac967['stack']);_0x5cc79e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 876e820..79f88c6 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 _0xe121=['lodash','uuid','./util','../../../../../config/logger','routing','agent','realtime','squeue','push','handleRun','handleTimeout','bind','drained','prototype','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','showNotification','notificationId','writeLog','RINGING',':FORCED','debug','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','TIMEOUT','exports'];(function(_0x314afc,_0x31d5de){var _0x572a20=function(_0x1f6020){while(--_0x1f6020){_0x314afc['push'](_0x314afc['shift']());}};_0x572a20(++_0x31d5de);}(_0xe121,0x88));var _0x1e12=function(_0x59e71e,_0x28f897){_0x59e71e=_0x59e71e-0x0;var _0x3d8c08=_0xe121[_0x59e71e];return _0x3d8c08;};'use strict';var _=require(_0x1e12('0x0'));var uuid=require(_0x1e12('0x1'));var util=require(_0x1e12('0x2'));var logger=require(_0x1e12('0x3'))(_0x1e12('0x4'));var Agent=function(_0x51c9b8,_0x31f67d,_0x148273,_0x85a721){this['notificationId']=uuid['v4']();this['squeue']=_0x51c9b8;this[_0x1e12('0x5')]=_0x31f67d;this[_0x1e12('0x6')]=_0x148273;this[_0x1e12('0x4')]=_0x85a721;this[_0x1e12('0x7')][_0x1e12('0x8')](this[_0x1e12('0x9')]['bind'](this),this[_0x1e12('0xa')][_0x1e12('0xb')](this));this[_0x1e12('0x7')]['on']('timeout',this[_0x1e12('0xa')]['bind'](this));this[_0x1e12('0x7')]['on'](_0x1e12('0xc'),this['handleDrained'][_0x1e12('0xb')](this));};Agent[_0x1e12('0xd')][_0x1e12('0x8')]=function(){this[_0x1e12('0x7')]['push'](this['handleRun'][_0x1e12('0xb')](this),this['handleTimeout'][_0x1e12('0xb')](this));};Agent[_0x1e12('0xd')][_0x1e12('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0x1e12('0xd')][_0x1e12('0x9')]=function(){logger['debug'](_0x1e12('0xf'),this[_0x1e12('0x7')]['id'],this[_0x1e12('0x5')]['id']);if(_['isNil'](this['realtime'][_0x1e12('0x10')][this[_0x1e12('0x5')]['id']])){logger['debug'](_0x1e12('0x11'),this['squeue']['id'],this[_0x1e12('0x5')]['id']);setTimeout(this[_0x1e12('0x8')]['bind'](this),0x3e8);}else{if(this[_0x1e12('0x4')][_0x1e12('0x12')]||util['isAgentAvailable'](this[_0x1e12('0x7')]['id'],this[_0x1e12('0x6')]['agents'][this[_0x1e12('0x5')]['id']],this[_0x1e12('0x7')][_0x1e12('0x13')],![])){this[_0x1e12('0x6')][_0x1e12('0x10')][this[_0x1e12('0x5')]['id']][_0x1e12('0x14')]=!![];this[_0x1e12('0x6')][_0x1e12('0x10')][this[_0x1e12('0x5')]['id']]['busyQueue']=undefined;util[_0x1e12('0x15')](this[_0x1e12('0x16')],this['squeue']['id'],this[_0x1e12('0x6')][_0x1e12('0x10')][this[_0x1e12('0x5')]['id']],null,this[_0x1e12('0x4')]);util[_0x1e12('0x17')](this[_0x1e12('0x7')]['id'],this[_0x1e12('0x6')]['agents'][this[_0x1e12('0x5')]['id']],_0x1e12('0x18')+(this[_0x1e12('0x4')]['forcedOwnership']?_0x1e12('0x19'):''));}else{logger[_0x1e12('0x1a')](_0x1e12('0x1b'),this[_0x1e12('0x7')]['id'],this[_0x1e12('0x5')]['id']);setTimeout(this['push'][_0x1e12('0xb')](this),0x3e8);}}};Agent[_0x1e12('0xd')]['handleTimeout']=function(_0x3b7e2c){if(_[_0x1e12('0x1c')](this['realtime'][_0x1e12('0x10')][this[_0x1e12('0x5')]['id']])){return logger[_0x1e12('0x1a')](_0x1e12('0x11'),this[_0x1e12('0x7')]['id'],this[_0x1e12('0x5')]['id']);}else{logger[_0x1e12('0x1a')](_0x1e12('0x1d'),this[_0x1e12('0x7')]['id'],this[_0x1e12('0x5')]['id']);util[_0x1e12('0x1e')](this[_0x1e12('0x16')],this['squeue']['id'],this[_0x1e12('0x6')][_0x1e12('0x10')][this['agent']['id']],null,this['routing']);this[_0x1e12('0x6')][_0x1e12('0x10')][this[_0x1e12('0x5')]['id']][_0x1e12('0x14')]=![];this[_0x1e12('0x6')][_0x1e12('0x10')][this[_0x1e12('0x5')]['id']][_0x1e12('0x1f')]=undefined;util[_0x1e12('0x17')](this[_0x1e12('0x7')]['id'],this[_0x1e12('0x6')][_0x1e12('0x10')][this[_0x1e12('0x5')]['id']],_0x3b7e2c?'STOP':_0x1e12('0x20'));}if(!_0x3b7e2c){setTimeout(this[_0x1e12('0x8')][_0x1e12('0xb')](this),0x3e8);}};function agent(_0x1e2951,_0x2e9360,_0x1d5328,_0x18d779){return new Agent(_0x1e2951,_0x2e9360,_0x1d5328,_0x18d779);}module[_0x1e12('0x21')]=agent; \ No newline at end of file +var _0x830b=['squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','hideNotification','STOP','exports','./util','../../../../../config/logger','routing','notificationId'];(function(_0x77081,_0x449c45){var _0x4816cd=function(_0x3fc9f0){while(--_0x3fc9f0){_0x77081['push'](_0x77081['shift']());}};_0x4816cd(++_0x449c45);}(_0x830b,0x182));var _0xb830=function(_0x144637,_0x5c805f){_0x144637=_0x144637-0x0;var _0x3869e4=_0x830b[_0x144637];return _0x3869e4;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xb830('0x0'));var logger=require(_0xb830('0x1'))(_0xb830('0x2'));var Agent=function(_0x139393,_0x4def52,_0x4e5777,_0x4a1962){this[_0xb830('0x3')]=uuid['v4']();this[_0xb830('0x4')]=_0x139393;this[_0xb830('0x5')]=_0x4def52;this[_0xb830('0x6')]=_0x4e5777;this[_0xb830('0x2')]=_0x4a1962;this['squeue'][_0xb830('0x7')](this[_0xb830('0x8')][_0xb830('0x9')](this),this[_0xb830('0xa')][_0xb830('0x9')](this));this[_0xb830('0x4')]['on'](_0xb830('0xb'),this[_0xb830('0xa')][_0xb830('0x9')](this));this[_0xb830('0x4')]['on'](_0xb830('0xc'),this[_0xb830('0xd')]['bind'](this));};Agent[_0xb830('0xe')][_0xb830('0x7')]=function(){this[_0xb830('0x4')][_0xb830('0x7')](this[_0xb830('0x8')][_0xb830('0x9')](this),this[_0xb830('0xa')][_0xb830('0x9')](this));};Agent[_0xb830('0xe')][_0xb830('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0xb830('0xe')][_0xb830('0x8')]=function(){logger[_0xb830('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xb830('0x4')]['id'],this[_0xb830('0x5')]['id']);if(_[_0xb830('0x10')](this[_0xb830('0x6')][_0xb830('0x11')][this[_0xb830('0x5')]['id']])){logger[_0xb830('0xf')](_0xb830('0x12'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0xb830('0x7')][_0xb830('0x9')](this),0x3e8);}else{if(this[_0xb830('0x2')][_0xb830('0x13')]||util[_0xb830('0x14')](this['squeue']['id'],this['realtime'][_0xb830('0x11')][this[_0xb830('0x5')]['id']],this[_0xb830('0x4')]['channel'],![])){this[_0xb830('0x6')]['agents'][this[_0xb830('0x5')]['id']][_0xb830('0x15')]=!![];this['realtime']['agents'][this[_0xb830('0x5')]['id']][_0xb830('0x16')]=undefined;util[_0xb830('0x17')](this[_0xb830('0x3')],this[_0xb830('0x4')]['id'],this['realtime']['agents'][this[_0xb830('0x5')]['id']],null,this[_0xb830('0x2')]);util[_0xb830('0x18')](this['squeue']['id'],this[_0xb830('0x6')][_0xb830('0x11')][this[_0xb830('0x5')]['id']],_0xb830('0x19')+(this[_0xb830('0x2')][_0xb830('0x13')]?_0xb830('0x1a'):''));}else{logger[_0xb830('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xb830('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xb830('0x7')][_0xb830('0x9')](this),0x3e8);}}};Agent[_0xb830('0xe')][_0xb830('0xa')]=function(_0xd26b08){if(_[_0xb830('0x10')](this[_0xb830('0x6')][_0xb830('0x11')][this[_0xb830('0x5')]['id']])){return logger[_0xb830('0xf')](_0xb830('0x12'),this[_0xb830('0x4')]['id'],this['agent']['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xb830('0x4')]['id'],this[_0xb830('0x5')]['id']);util[_0xb830('0x1b')](this[_0xb830('0x3')],this[_0xb830('0x4')]['id'],this[_0xb830('0x6')][_0xb830('0x11')][this[_0xb830('0x5')]['id']],null,this[_0xb830('0x2')]);this['realtime'][_0xb830('0x11')][this[_0xb830('0x5')]['id']][_0xb830('0x15')]=![];this[_0xb830('0x6')]['agents'][this[_0xb830('0x5')]['id']]['busyQueue']=undefined;util[_0xb830('0x18')](this[_0xb830('0x4')]['id'],this[_0xb830('0x6')][_0xb830('0x11')][this['agent']['id']],_0xd26b08?_0xb830('0x1c'):'TIMEOUT');}if(!_0xd26b08){setTimeout(this['push'][_0xb830('0x9')](this),0x3e8);}};function agent(_0x514890,_0x5c4cd8,_0x54017a,_0x59f576){return new Agent(_0x514890,_0x5c4cd8,_0x54017a,_0x59f576);}module[_0xb830('0x1d')]=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 353595e..2f679af 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 _0x12c9=['./util','routing','notificationId','squeue','queue','realtime','push','handleRun','handleTimeout','timeout','drained','bind','prototype','handleDrained','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','debug','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','busy','busyQueue','lodash'];(function(_0x2e2da8,_0x4f975e){var _0x2d8448=function(_0x29a768){while(--_0x29a768){_0x2e2da8['push'](_0x2e2da8['shift']());}};_0x2d8448(++_0x4f975e);}(_0x12c9,0x9f));var _0x912c=function(_0x6fd5ad,_0x373ead){_0x6fd5ad=_0x6fd5ad-0x0;var _0x4eefa9=_0x12c9[_0x6fd5ad];return _0x4eefa9;};'use strict';var _=require(_0x912c('0x0'));var uuid=require('uuid');var util=require(_0x912c('0x1'));var logger=require('../../../../../config/logger')(_0x912c('0x2'));var Beepall=function(_0x522495,_0x3364ce,_0x2740fa,_0x438fd6){this[_0x912c('0x3')]=uuid['v4']();this[_0x912c('0x4')]=_0x522495;this[_0x912c('0x5')]=_0x3364ce;this[_0x912c('0x6')]=_0x2740fa;this['routing']=_0x438fd6;this[_0x912c('0x4')][_0x912c('0x7')](this[_0x912c('0x8')]['bind'](this),this[_0x912c('0x9')]['bind'](this));this['squeue']['on'](_0x912c('0xa'),this['handleTimeout']['bind'](this));this['squeue']['on'](_0x912c('0xb'),this['handleDrained'][_0x912c('0xc')](this));};Beepall[_0x912c('0xd')][_0x912c('0x7')]=function(){this[_0x912c('0x4')][_0x912c('0x7')](this[_0x912c('0x8')][_0x912c('0xc')](this),this['handleTimeout'][_0x912c('0xc')](this));};Beepall[_0x912c('0xd')][_0x912c('0xe')]=function(){this['handleTimeout'](!![]);};Beepall['prototype'][_0x912c('0x8')]=function(){var _0x28142d=!![];if(!_['isNil'](this[_0x912c('0x5')])&&!_[_0x912c('0xf')](this['queue']['Agents'])&&this[_0x912c('0x5')][_0x912c('0x10')][_0x912c('0x11')]>0x0){for(var _0x533f99=0x0,_0x436180;_0x533f990x0){for(var _0x4c0eb9=0x0,_0x1e9317;_0x4c0eb90x0&&_0x3e7e28[_0x357446+'CurrentCapacity']>=_0x3e7e28[_0x357446+_0x4f49('0x25')]){writeLog(_0x509f7c,_0x3e7e28,_0x357446[_0x4f49('0x26')]()+_0x4f49('0x27'));return![];}}return!![];};exports['showNotification']=function(_0xc54070,_0x2eed1c,_0x298785,_0x148153,_0xfefbab){return sendNotification(!![],_0xc54070,_0x2eed1c,_0x298785,_0x148153,_0xfefbab);};exports[_0x4f49('0x28')]=function(_0x4915af,_0x50c571,_0x239f44,_0x2c00ee,_0x605c91){return sendNotification(![],_0x4915af,_0x50c571,_0x239f44,_0x2c00ee,_0x605c91);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x7da7=['routing','defaults','redis','socket.io-emitter','format','user:%s','emit','user:save','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','notification:%s','save','remove','debug','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','lodash','util','../utils','../../../../../config/logger'];(function(_0x45a9f4,_0x109356){var _0x31c17c=function(_0x5e85e4){while(--_0x5e85e4){_0x45a9f4['push'](_0x45a9f4['shift']());}};_0x31c17c(++_0x109356);}(_0x7da7,0x10d));var _0x77da=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x7da7[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var utils=require(_0x77da('0x2'));var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require(_0x77da('0x3'))(_0x77da('0x4'));config['redis']=_[_0x77da('0x5')](config[_0x77da('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x77da('0x7'))(new Redis(config[_0x77da('0x6')]));function sendNotification(_0x47da81,_0x30afe0,_0x47cf1d,_0x1191de,_0x13992e,_0x37c5ab){io['to'](util[_0x77da('0x8')](_0x77da('0x9'),_0x1191de['name']))[_0x77da('0xa')](_0x77da('0xb'),_0x1191de);var _0x172d7f=_0x37c5ab||{};var _0x5ea12f=_0x47cf1d[_0x77da('0xc')]('.');var _0x1ab717={'uniqueid':_0x30afe0,'channel':_0x5ea12f[0x0],'id':_0x5ea12f[0x1],'title':_0x5ea12f[0x0]+_0x77da('0xd'),'interactionId':_0x5ea12f[0x2],'queue':_0x13992e?_0x13992e[_0x77da('0xe')]:null,'sound':_0x172d7f['account'][_0x77da('0xf')],'shake':_0x172d7f[_0x77da('0x10')][_0x77da('0x11')]};try{if(!_0x172d7f['body']){_0x172d7f['body']={};}if(_0x13992e){_0x172d7f[_0x77da('0x12')][_0x77da('0x13')]=_0x13992e;}else if(_0x172d7f['body'][_0x77da('0x13')]){delete _0x172d7f[_0x77da('0x12')][_0x77da('0x13')];}_0x1ab717[_0x77da('0x14')]=utils['getMustacheRender'](_0x172d7f[_0x77da('0x10')]['notificationTemplate'],_0x172d7f);}catch(_0x29cd7b){_0x1ab717[_0x77da('0x14')]=_0x77da('0x15');logger[_0x77da('0x16')](util['format']('[%s][QUEUE]\x20%s',_0x30afe0,_0x29cd7b['message']));}io['to'](util['format'](_0x77da('0x9'),_0x1191de[_0x77da('0xe')]))[_0x77da('0xa')](util[_0x77da('0x8')](_0x77da('0x17'),_0x47da81?_0x77da('0x18'):_0x77da('0x19')),_0x1ab717);}function writeLog(_0x3b6dde,_0x544104,_0x492063){return logger[_0x77da('0x1a')](util[_0x77da('0x8')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3b6dde,_0x544104[_0x77da('0xe')],_0x492063));}exports[_0x77da('0x1b')]=function(_0x24aa8a,_0x5ab79a,_0x58270c,_0x3e6cfe){if(_0x5ab79a['busy']){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x1c'));return![];}if(!_0x5ab79a[_0x77da('0x1d')]){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x1e'));return![];}if(_0x5ab79a[_0x58270c+_0x77da('0x1f')]){writeLog(_0x24aa8a,_0x5ab79a,_0x77da('0x20'));return![];}if(_0x3e6cfe&&_0x5ab79a[_0x77da('0x21')](_0x58270c+_0x77da('0x22'))&&_0x5ab79a['hasOwnProperty'](_0x58270c+'CurrentCapacity')){if(_0x5ab79a[_0x58270c+_0x77da('0x22')]>0x0&&_0x5ab79a[_0x58270c+_0x77da('0x23')]>=_0x5ab79a[_0x58270c+_0x77da('0x22')]){writeLog(_0x24aa8a,_0x5ab79a,_0x58270c[_0x77da('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x77da('0x25')]=function(_0x167240,_0x470c9f,_0x36115b,_0x446ae7,_0x5997b6){return sendNotification(!![],_0x167240,_0x470c9f,_0x36115b,_0x446ae7,_0x5997b6);};exports[_0x77da('0x26')]=function(_0x3e090d,_0x1f2279,_0x2913f7,_0x496ecd,_0x5b4638){return sendNotification(![],_0x3e090d,_0x1f2279,_0x2913f7,_0x496ecd,_0x5b4638);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 4613a7e..a53ee55 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 _0x37dc=['join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','validate','shelljs','lodash','./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x37dc,0x1e9));var _0xc37d=function(_0x530769,_0x5e4c52){_0x530769=_0x530769-0x0;var _0x94bdda=_0x37dc[_0x530769];return _0x94bdda;};'use strict';var schema=require(_0xc37d('0x0'));var sh=require(_0xc37d('0x1'));var _=require(_0xc37d('0x2'));var utils=require(_0xc37d('0x3'));var logger=require('../../../../config/logger')(_0xc37d('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0xc37d('0x5')}});exports['consequence']=function(_0x5ecb1f,_0x5458fb){return function(_0x4eabf9){try{var _0x33c9db={'command':_0x5458fb[0x0]};var _0xa63f50=system[_0xc37d('0x0')](_0x33c9db,{'typecast':!![]});if(_0xa63f50[_0xc37d('0x6')]){logger[_0xc37d('0x7')](_0xc37d('0x8'),_0x5ecb1f,_[_0xc37d('0x9')](_0xa63f50,_0xc37d('0xa'))[_0xc37d('0xb')](',\x20'));logger['info'](_0xc37d('0xc'),_0x5ecb1f);_0x4eabf9[_0xc37d('0xd')]();}else{var _0x4dcf99=this;var _0x18f584=utils[_0xc37d('0xe')](_0x5458fb[0x0],this);logger['info'](_0xc37d('0xf'),_0x5ecb1f,_0x18f584);sh[_0xc37d('0x10')](_['trim'](_0x18f584),function(_0x1860e9,_0x1e2078){logger[_0xc37d('0x11')](_0xc37d('0x12'),_0x5ecb1f,_0x1860e9);if(_0x1860e9==0x0){var _0x345666=_0x1e2078[_0xc37d('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xc37d('0x14')](_0x5458fb[0x1])||_[_0xc37d('0x15')](_0x5458fb[0x1])){logger[_0xc37d('0x11')](_0xc37d('0x16'),_0x5ecb1f);_0x4dcf99[_0xc37d('0x17')][_0x5458fb[0x1]]=_0x345666;}else{logger[_0xc37d('0x11')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x5ecb1f,_0x5458fb[0x1],_0x345666);_0x4dcf99['body'][_0x5458fb[0x1]]=_0x345666;}}_0x4eabf9[_0xc37d('0xd')]();});}}catch(_0x5bca59){logger['error'](_0xc37d('0x8'),_0x5ecb1f,_[_0xc37d('0x18')](_0x5bca59)?JSON['stringify'](_0x5bca59):_0x5bca59);logger[_0xc37d('0x11')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5ecb1f);_0x4eabf9['next']();}};}; \ No newline at end of file +var _0x6a73=['stringify','validate','shelljs','routing','string','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject'];(function(_0xe501ff,_0x955b7e){var _0x17135d=function(_0x8e3458){while(--_0x8e3458){_0xe501ff['push'](_0xe501ff['shift']());}};_0x17135d(++_0x955b7e);}(_0x6a73,0x171));var _0x36a7=function(_0x2534cf,_0x545be6){_0x2534cf=_0x2534cf-0x0;var _0x221461=_0x6a73[_0x2534cf];return _0x221461;};'use strict';var schema=require(_0x36a7('0x0'));var sh=require(_0x36a7('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x36a7('0x2'));var system=schema({'command':{'type':_0x36a7('0x3'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x36a7('0x4')]=function(_0x4cdd41,_0x2de952){return function(_0x5469ef){try{var _0x23ecdb={'command':_0x2de952[0x0]};var _0x1ef676=system['validate'](_0x23ecdb,{'typecast':!![]});if(_0x1ef676[_0x36a7('0x5')]){logger[_0x36a7('0x6')](_0x36a7('0x7'),_0x4cdd41,_['map'](_0x1ef676,_0x36a7('0x8'))[_0x36a7('0x9')](',\x20'));logger[_0x36a7('0xa')](_0x36a7('0xb'),_0x4cdd41);_0x5469ef[_0x36a7('0xc')]();}else{var _0x5f3198=this;var _0x573f95=utils['getMustacheRender'](_0x2de952[0x0],this);logger[_0x36a7('0xa')](_0x36a7('0xd'),_0x4cdd41,_0x573f95);sh[_0x36a7('0xe')](_['trim'](_0x573f95),function(_0x115691,_0x43eb49){logger['info'](_0x36a7('0xf'),_0x4cdd41,_0x115691);if(_0x115691==0x0){var _0x268970=_0x43eb49[_0x36a7('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x36a7('0x11')](_0x2de952[0x1])||_[_0x36a7('0x12')](_0x2de952[0x1])){logger[_0x36a7('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x4cdd41);_0x5f3198[_0x36a7('0x13')][_0x2de952[0x1]]=_0x268970;}else{logger[_0x36a7('0xa')](_0x36a7('0x14'),_0x4cdd41,_0x2de952[0x1],_0x268970);_0x5f3198[_0x36a7('0x13')][_0x2de952[0x1]]=_0x268970;}}_0x5469ef[_0x36a7('0xc')]();});}}catch(_0x5b3099){logger['error'](_0x36a7('0x7'),_0x4cdd41,_[_0x36a7('0x15')](_0x5b3099)?JSON[_0x36a7('0x16')](_0x5b3099):_0x5b3099);logger[_0x36a7('0xa')](_0x36a7('0xb'),_0x4cdd41);_0x5469ef[_0x36a7('0xc')]();}};}; \ 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 5a03ecf..edacbbd 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 _0x7af9=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','next','isObject','validate','lodash','../../rpc/chatInteraction'];(function(_0x5b4f8e,_0x207654){var _0x2ce76f=function(_0x4e9b16){while(--_0x4e9b16){_0x5b4f8e['push'](_0x5b4f8e['shift']());}};_0x2ce76f(++_0x207654);}(_0x7af9,0x141));var _0x97af=function(_0x26b53c,_0x232e0d){_0x26b53c=_0x26b53c-0x0;var _0x636641=_0x7af9[_0x26b53c];return _0x636641;};'use strict';var schema=require(_0x97af('0x0'));var _=require(_0x97af('0x1'));var rpc={'chatInteraction':require(_0x97af('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x97af('0x3')),'mailInteraction':require(_0x97af('0x4')),'faxInteraction':require(_0x97af('0x5')),'whatsappInteraction':require(_0x97af('0x6'))};var logger=require('../../../../config/logger')(_0x97af('0x7'));var tag=schema({'tag':{'type':_0x97af('0x8'),'required':!![],'message':_0x97af('0x9')}});exports[_0x97af('0xa')]=function(_0x4ad5d8,_0x56b6f8,_0x1baae1,_0x42c832){return function(_0x2b5e37){try{var _0x1b48e2={'tag':_0x56b6f8[0x0]};var _0x200e63=tag[_0x97af('0x0')](_0x1b48e2,{'typecast':!![]});if(_0x200e63[_0x97af('0xb')]){logger[_0x97af('0xc')]('[%s][TAG]\x20%s',_0x4ad5d8,_[_0x97af('0xd')](_0x200e63,'message')[_0x97af('0xe')](',\x20'));logger['info'](_0x97af('0xf'),_0x4ad5d8);_0x2b5e37['next']();}else{var _0x22bfd4={'ids':[_0x56b6f8[0x0]]};if(rpc[_0x42c832['channel']+_0x97af('0x10')]){rpc[_0x42c832['channel']+_0x97af('0x10')]['addTags'](_0x42c832[_0x97af('0x11')]['id'],_0x22bfd4)[_0x97af('0x12')](function(_0xe9158){logger[_0x97af('0x13')](_0x97af('0x14'),_0x4ad5d8,_0x56b6f8[0x1],_0x42c832['channel'],_0x42c832[_0x97af('0x11')]['id']);})[_0x97af('0x15')](function(_0xaa248){logger[_0x97af('0xc')](_0x97af('0x16'),_0x4ad5d8,JSON[_0x97af('0x17')](_0xaa248));logger[_0x97af('0x13')](_0x97af('0xf'),_0x4ad5d8);})[_0x97af('0x18')](function(){_0x2b5e37[_0x97af('0x19')]();});}}}catch(_0x54e8cd){logger['error'](_0x97af('0x16'),_0x4ad5d8,_[_0x97af('0x1a')](_0x54e8cd)?JSON[_0x97af('0x17')](_0x54e8cd):_0x54e8cd);logger['info'](_0x97af('0xf'),_0x4ad5d8);_0x2b5e37[_0x97af('0x19')]();}};}; \ No newline at end of file +var _0x1263=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction'];(function(_0x184b89,_0x33669b){var _0x28fc98=function(_0x455981){while(--_0x455981){_0x184b89['push'](_0x184b89['shift']());}};_0x28fc98(++_0x33669b);}(_0x1263,0x76));var _0x3126=function(_0x4a9878,_0x13e75f){_0x4a9878=_0x4a9878-0x0;var _0x449d4d=_0x1263[_0x4a9878];return _0x449d4d;};'use strict';var schema=require('validate');var _=require(_0x3126('0x0'));var rpc={'chatInteraction':require(_0x3126('0x1')),'openchannelInteraction':require(_0x3126('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x3126('0x3')),'faxInteraction':require(_0x3126('0x4')),'whatsappInteraction':require(_0x3126('0x5'))};var logger=require(_0x3126('0x6'))(_0x3126('0x7'));var tag=schema({'tag':{'type':_0x3126('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x3126('0x9')]=function(_0x1b8bce,_0x114c1c,_0x1f5958,_0x4b1dff){return function(_0x3a63f0){try{var _0x10c69d={'tag':_0x114c1c[0x0]};var _0x403479=tag[_0x3126('0xa')](_0x10c69d,{'typecast':!![]});if(_0x403479[_0x3126('0xb')]){logger[_0x3126('0xc')](_0x3126('0xd'),_0x1b8bce,_[_0x3126('0xe')](_0x403479,_0x3126('0xf'))[_0x3126('0x10')](',\x20'));logger[_0x3126('0x11')](_0x3126('0x12'),_0x1b8bce);_0x3a63f0[_0x3126('0x13')]();}else{var _0x39c9c7={'ids':[_0x114c1c[0x0]]};if(rpc[_0x4b1dff[_0x3126('0x14')]+_0x3126('0x15')]){rpc[_0x4b1dff['channel']+_0x3126('0x15')]['addTags'](_0x4b1dff['interaction']['id'],_0x39c9c7)['then'](function(_0x9fb8b5){logger[_0x3126('0x11')](_0x3126('0x16'),_0x1b8bce,_0x114c1c[0x1],_0x4b1dff[_0x3126('0x14')],_0x4b1dff[_0x3126('0x17')]['id']);})[_0x3126('0x18')](function(_0x411adc){logger['error'](_0x3126('0xd'),_0x1b8bce,JSON[_0x3126('0x19')](_0x411adc));logger[_0x3126('0x11')](_0x3126('0x12'),_0x1b8bce);})[_0x3126('0x1a')](function(){_0x3a63f0[_0x3126('0x13')]();});}}}catch(_0x497e53){logger[_0x3126('0xc')]('[%s][TAG]\x20%s',_0x1b8bce,_[_0x3126('0x1b')](_0x497e53)?JSON[_0x3126('0x19')](_0x497e53):_0x497e53);logger[_0x3126('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1b8bce);_0x3a63f0[_0x3126('0x13')]();}};}; \ 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 ba1c7d6..c99ef3e 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 _0x2305=['login','push','stringify','utf8','POST','application/json-rpc','then','parse','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','next','request-promise','../../../../config/logger','routing','lodash','consequence','\x20-\x20','includes','urlOnRing','jsonrpc','2.0','method'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2305,0x1b7));var _0x5230=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x2305[_0x40df5f];return _0x1573f1;};'use strict';var rp=require(_0x5230('0x0'));var logger=require(_0x5230('0x1'))(_0x5230('0x2'));var _=require(_0x5230('0x3'));var arr=[];exports[_0x5230('0x4')]=function(_0x45b88c,_0x58d149){return function(_0x4c8c41){var _0x3e1538=_0x58d149[0xa];var _0x25bede=_0x58d149[0xb];var _0x2f3cec=_0x58d149[0xc];var _0x47ee38=_0x58d149[0xd];var _0x17e478=_0x58d149[0xe];var _0x4a74c7=_0x58d149[0xf]['replace'](/\n/g,_0x5230('0x5'));var _0xdabd24=_0x58d149[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x5230('0x6')](_0x25bede)){arr['push'](_0x25bede);var _0x2eb2a2=_0x58d149[0x3];var _0x38b1f6=_0x58d149[0x4];var _0x4d140f=_0x58d149[0x1];var _0x1e7fbd=_0x58d149[0x0];var _0xa18857={};_0xa18857['urlOnAnswer']=_0x58d149[0x8]+'?params='+_0x2f3cec+'|'+_0x3e1538+'|'+_0x47ee38+'|'+_0x25bede+'|'+_0x17e478;_0xa18857[_0x5230('0x7')]=_0x58d149[0x7]+'?params='+_0x2f3cec+'|'+_0x3e1538+'|'+_0x47ee38+'|'+_0x25bede+'|'+_0x17e478+'|'+_0x4a74c7+'|'+_0xdabd24;_0xa18857['title']=_0x58d149[0x9];var _0x1373a3={};_0x1373a3[_0x5230('0x8')]=_0x5230('0x9');_0x1373a3[_0x5230('0xa')]=_0x5230('0xb');var _0x3edad2=[];_0x3edad2[_0x5230('0xc')](_0x58d149[0x2]);_0x3edad2[_0x5230('0xc')](_0x58d149[0x5]);_0x3edad2['push'](_0x58d149[0x6]);_0x1373a3['params']=_0x3edad2;_0x1373a3['id']=0x1;var _0x33ef8e=JSON[_0x5230('0xd')](_0x1373a3);var _0x21a949={'encoding':_0x5230('0xe'),'method':_0x5230('0xf'),'timeout':0x2710,'url':_0x2eb2a2,'headers':{'Content-Type':_0x5230('0x10')},'body':_0x33ef8e};return rp(_0x21a949)[_0x5230('0x11')](function(_0x33bb08){const _0x2c9a4c=JSON[_0x5230('0x12')](_0x33bb08);if(!_0x2c9a4c['result']['logged']){throw new Error(_0x5230('0x13'));}var _0x5b1d39=_0x25bede;var _0x29ca1a=_0x5230('0x14')+_0x4d140f+'&serviceId='+_0x1e7fbd+_0x5230('0x15')+_0x5b1d39+'&data='+JSON[_0x5230('0xd')](_0xa18857);var _0x156acb=_0x38b1f6+'?'+_0x29ca1a;return rp(_0x156acb);})[_0x5230('0x11')](function(_0x2441e5){logger[_0x5230('0x16')](_0x5230('0x17'),_0x45b88c,_0x2441e5);_0x4c8c41['stop']();})[_0x5230('0x18')](function(_0x3815f6){logger[_0x5230('0x19')](_0x5230('0x1a'),_0x45b88c,_[_0x5230('0x1b')](_0x3815f6)?JSON[_0x5230('0xd')](_0x3815f6):_0x3815f6);_0x4c8c41[_0x5230('0x1c')]();});}else{logger[_0x5230('0x16')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x45b88c);_0x4c8c41[_0x5230('0x1d')]();}};}; \ No newline at end of file +var _0x594f=['../../../../config/logger','routing','lodash','consequence','replace','includes','push','?params=','urlOnRing','title','jsonrpc','2.0','method','login','utf8','POST','application/json-rpc','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','stringify','then','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise'];(function(_0x511615,_0x426236){var _0x96f13a=function(_0x17c5f4){while(--_0x17c5f4){_0x511615['push'](_0x511615['shift']());}};_0x96f13a(++_0x426236);}(_0x594f,0x16a));var _0xf594=function(_0x26801d,_0x42506d){_0x26801d=_0x26801d-0x0;var _0x4339e9=_0x594f[_0x26801d];return _0x4339e9;};'use strict';var rp=require(_0xf594('0x0'));var logger=require(_0xf594('0x1'))(_0xf594('0x2'));var _=require(_0xf594('0x3'));var arr=[];exports[_0xf594('0x4')]=function(_0x2a4a05,_0x29c7f2){return function(_0x4c1c92){var _0x117175=_0x29c7f2[0xa];var _0x59e99e=_0x29c7f2[0xb];var _0x4c918a=_0x29c7f2[0xc];var _0x5926=_0x29c7f2[0xd];var _0x2943bd=_0x29c7f2[0xe];var _0x4d367b=_0x29c7f2[0xf][_0xf594('0x5')](/\n/g,'\x20-\x20');var _0x201f3d=_0x29c7f2[0x10][_0xf594('0x5')](/\n/g,'\x20');if(!arr[_0xf594('0x6')](_0x59e99e)){arr[_0xf594('0x7')](_0x59e99e);var _0x5bab35=_0x29c7f2[0x3];var _0x27c179=_0x29c7f2[0x4];var _0x2819ec=_0x29c7f2[0x1];var _0x41da95=_0x29c7f2[0x0];var _0x1d588a={};_0x1d588a['urlOnAnswer']=_0x29c7f2[0x8]+_0xf594('0x8')+_0x4c918a+'|'+_0x117175+'|'+_0x5926+'|'+_0x59e99e+'|'+_0x2943bd;_0x1d588a[_0xf594('0x9')]=_0x29c7f2[0x7]+'?params='+_0x4c918a+'|'+_0x117175+'|'+_0x5926+'|'+_0x59e99e+'|'+_0x2943bd+'|'+_0x4d367b+'|'+_0x201f3d;_0x1d588a[_0xf594('0xa')]=_0x29c7f2[0x9];var _0x243cba={};_0x243cba[_0xf594('0xb')]=_0xf594('0xc');_0x243cba[_0xf594('0xd')]=_0xf594('0xe');var _0x3098f6=[];_0x3098f6['push'](_0x29c7f2[0x2]);_0x3098f6['push'](_0x29c7f2[0x5]);_0x3098f6[_0xf594('0x7')](_0x29c7f2[0x6]);_0x243cba['params']=_0x3098f6;_0x243cba['id']=0x1;var _0x44c2ee=JSON['stringify'](_0x243cba);var _0x43d341={'encoding':_0xf594('0xf'),'method':_0xf594('0x10'),'timeout':0x2710,'url':_0x5bab35,'headers':{'Content-Type':_0xf594('0x11')},'body':_0x44c2ee};return rp(_0x43d341)['then'](function(_0x342688){const _0x3f98b1=JSON[_0xf594('0x12')](_0x342688);if(!_0x3f98b1[_0xf594('0x13')]['logged']){throw new Error(_0xf594('0x14'));}var _0x3ca7d6=_0x59e99e;var _0x40a3fd='channelId='+_0x2819ec+_0xf594('0x15')+_0x41da95+'&sessionId='+_0x3ca7d6+_0xf594('0x16')+JSON[_0xf594('0x17')](_0x1d588a);var _0x21b582=_0x27c179+'?'+_0x40a3fd;return rp(_0x21b582);})[_0xf594('0x18')](function(_0x3ec1ce){logger['info'](_0xf594('0x19'),_0x2a4a05,_0x3ec1ce);_0x4c1c92['stop']();})[_0xf594('0x1a')](function(_0x51a4fd){logger[_0xf594('0x1b')](_0xf594('0x1c'),_0x2a4a05,_[_0xf594('0x1d')](_0x51a4fd)?JSON['stringify'](_0x51a4fd):_0x51a4fd);_0x4c1c92['stop']();});}else{logger[_0xf594('0x1e')](_0xf594('0x1f'),_0x2a4a05);_0x4c1c92[_0xf594('0x20')]();}};}; \ 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 0cbb273..f4edc4f 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x8d74b8,_0x474139){var _0x38c564=function(_0x4a3360){while(--_0x4a3360){_0x8d74b8['push'](_0x8d74b8['shift']());}};_0x38c564(++_0x474139);}(_0xe706,0xa3));var _0x6e70=function(_0x21c81e,_0x5de28f){_0x21c81e=_0x21c81e-0x0;var _0x16a6d7=_0xe706[_0x21c81e];return _0x16a6d7;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x7a3068,_0x37d1b5){var _0x43ce27=function(_0x572902){while(--_0x572902){_0x7a3068['push'](_0x7a3068['shift']());}};_0x43ce27(++_0x37d1b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 f7053a5..b228590 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 _0xee24=['CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','paused','mailQueues','loggedIn','name','waiting','openchannelQueues','smsQueues','available','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','bluebird','./applications/utils','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','channel','message','interaction','isArray','applications','length','join','app','.js','toLowerCase','split','mail','push','slice','dialogflow','appdata','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','rules','execute','stringify','matchPath','complete','agent','agents','busy','busyQueue','end','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','emit','capacity','hasOwnProperty'];(function(_0x76594d,_0x3cb48e){var _0x210c08=function(_0x585f4a){while(--_0x585f4a){_0x76594d['push'](_0x76594d['shift']());}};_0x210c08(++_0x3cb48e);}(_0xee24,0x1a6));var _0x4ee2=function(_0x189061,_0x21d774){_0x189061=_0x189061-0x0;var _0x257e15=_0xee24[_0x189061];return _0x257e15;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var path=require(_0x4ee2('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x4ee2('0x2'));var utils=require(_0x4ee2('0x3'));var logger=require(_0x4ee2('0x4'))(_0x4ee2('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4ee2('0x6')),'chatQueueReport':require(_0x4ee2('0x7')),'smsQueueReport':require(_0x4ee2('0x8')),'faxQueueReport':require(_0x4ee2('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x4ee2('0xa'));function getId(_0x319d9d,_0xe966eb,_0x9a963c){return util[_0x4ee2('0xb')](_0x4ee2('0xc'),_0x319d9d,_0xe966eb||0x0,_0x9a963c||0x0);}function getIntervals(_0x32c572,_0x3b6028){var _0x550e8d=[];if(!_['isNil'](_0x3b6028[_0x4ee2('0xd')])&&!_[_0x4ee2('0xe')](_0x32c572[_0x3b6028[_0x4ee2('0xd')]])&&!_[_0x4ee2('0xe')](_0x32c572[_0x3b6028[_0x4ee2('0xd')]]['Intervals'])){_0x550e8d=_[_0x4ee2('0xf')](_0x32c572[_0x3b6028[_0x4ee2('0xd')]][_0x4ee2('0x10')],_0x4ee2('0x11'));}else if(!_['isNil'](_0x3b6028[_0x4ee2('0x11')])){_0x550e8d=[_0x3b6028[_0x4ee2('0x11')]];}return _0x550e8d;}exports[_0x4ee2('0x12')]=function(_0x23c1c9){_0x23c1c9['rules']={};return new BPromise(function(_0x481181,_0x2357c5){var _0x2bf4c2={'Start':function(_0x5a3c5c){var _0x34dacb=this;return new Promise(function(_0x231d5,_0x3c4279){if(_0x5a3c5c){try{var _0x1b95c5=[];var _0x14bc72=getId(_0x5a3c5c[_0x4ee2('0x13')],_0x5a3c5c['message']?_0x5a3c5c[_0x4ee2('0x14')]['id']:0x0,_0x5a3c5c[_0x4ee2('0x15')]?_0x5a3c5c[_0x4ee2('0x15')]['id']:0x0);if(_0x5a3c5c['applications']&&_[_0x4ee2('0x16')](_0x5a3c5c[_0x4ee2('0x17')])&&_0x5a3c5c[_0x4ee2('0x17')][_0x4ee2('0x18')]){for(var _0x92caf9=0x0;_0x92caf9<_0x5a3c5c[_0x4ee2('0x17')][_0x4ee2('0x18')];_0x92caf9+=0x1){var _0x1e598f=_0x5a3c5c['applications'][_0x92caf9];if(fs['existsSync'](path[_0x4ee2('0x19')](__dirname,'applications',_0x1e598f[_0x4ee2('0x1a')]+_0x4ee2('0x1b')))){var _0x1d9a37=[];switch(_0x1e598f[_0x4ee2('0x1a')][_0x4ee2('0x1c')]()){case'autoreply':var _0x1d5037=_0x1e598f['appdata'][_0x4ee2('0x1d')](',');if(_0x5a3c5c[_0x4ee2('0x13')]===_0x4ee2('0x1e')){_0x1d9a37[_0x4ee2('0x1f')](_0x1d5037[0x0]);_0x1d9a37[_0x4ee2('0x1f')](_0x1d5037[0x1]);_0x1d9a37[_0x4ee2('0x1f')](_0x1d5037[_0x4ee2('0x20')](0x2,_0x1d5037['length'])[_0x4ee2('0x19')](','));}else{_0x1d9a37['push'](_0x1d5037[0x0]);_0x1d9a37['push'](_0x1d5037[_0x4ee2('0x20')](0x1,_0x1d5037[_0x4ee2('0x18')])[_0x4ee2('0x19')](','));}break;case _0x4ee2('0x21'):var _0x17119=_0x1e598f['appdata']['split'](',');_0x1d9a37[_0x4ee2('0x1f')](_0x17119[0x0]);_0x1d9a37[_0x4ee2('0x1f')](_0x17119[0x1]);_0x1d9a37['push'](_0x17119[_0x4ee2('0x20')](0x2,_0x17119['length'])['join'](','));break;case'dialogflowv2':var _0x45dc43=_0x1e598f[_0x4ee2('0x22')]['split'](',');_0x1d9a37[_0x4ee2('0x1f')](_0x45dc43[0x0]);_0x1d9a37[_0x4ee2('0x1f')](_0x45dc43[0x1]);_0x1d9a37['push'](_0x45dc43[0x2]);_0x1d9a37[_0x4ee2('0x1f')](_0x45dc43[0x3]);_0x1d9a37['push'](_0x45dc43[_0x4ee2('0x20')](0x4,_0x45dc43[_0x4ee2('0x18')])[_0x4ee2('0x19')](','));break;case'amazonlex':var _0x4c1617=_0x1e598f[_0x4ee2('0x22')][_0x4ee2('0x1d')](',');_0x1d9a37[_0x4ee2('0x1f')](_0x4c1617[0x0]);_0x1d9a37['push'](_0x4c1617[0x1]);_0x1d9a37[_0x4ee2('0x1f')](_0x4c1617[0x2]);_0x1d9a37[_0x4ee2('0x1f')](_0x4c1617[0x3]);_0x1d9a37[_0x4ee2('0x1f')](_0x4c1617[_0x4ee2('0x20')](0x4,_0x4c1617[_0x4ee2('0x18')])[_0x4ee2('0x19')](','));break;case _0x4ee2('0x14'):_0x1d9a37[_0x4ee2('0x1f')](_0x1e598f[_0x4ee2('0x22')]);break;case _0x4ee2('0x23'):_0x1d9a37[_0x4ee2('0x1f')](_0x1e598f[_0x4ee2('0x24')]);_0x1d9a37['push'](_0x1e598f[_0x4ee2('0x22')]);break;case _0x4ee2('0x25'):var _0x5c4ab7=utils[_0x4ee2('0x26')](_0x5a3c5c[_0x4ee2('0x27')][_0x4ee2('0x28')],_0x5a3c5c);var _0x2e1092=_0x1e598f[_0x4ee2('0x22')][_0x4ee2('0x1d')](',');_0x1d9a37[_0x4ee2('0x1f')](_0x2e1092[0x0]);_0x1d9a37['push'](_0x2e1092[0x1]);_0x1d9a37[_0x4ee2('0x1f')](_0x2e1092[0x2]);_0x1d9a37[_0x4ee2('0x1f')](_0x2e1092[0x3]);_0x1d9a37[_0x4ee2('0x1f')](_0x2e1092[0x4]);_0x1d9a37['push'](_0x2e1092[0x5]);_0x1d9a37[_0x4ee2('0x1f')](_0x2e1092[0x6]);_0x1d9a37['push'](_0x2e1092[0x7]);_0x1d9a37[_0x4ee2('0x1f')](_0x2e1092[0x8]);_0x1d9a37[_0x4ee2('0x1f')](_0x2e1092[0x9]);_0x1d9a37[_0x4ee2('0x1f')](_0x2e1092[0xa]);_0x1d9a37[_0x4ee2('0x1f')](_0x5a3c5c[_0x4ee2('0x15')]['id']);_0x1d9a37[_0x4ee2('0x1f')](_0x5a3c5c['message']['id']);_0x1d9a37['push'](_0x1e598f[_0x4ee2('0x29')]);_0x1d9a37[_0x4ee2('0x1f')](_0x5a3c5c[_0x4ee2('0x15')][_0x4ee2('0x2a')]);_0x1d9a37[_0x4ee2('0x1f')](_0x5a3c5c[_0x4ee2('0x2b')][_0x4ee2('0x2b')]);_0x1d9a37[_0x4ee2('0x1f')](_0x5c4ab7);break;default:_0x1d9a37=_[_0x4ee2('0xe')](_0x1e598f[_0x4ee2('0x22')])?[]:_0x1e598f['appdata']['split'](',');}var _0x2e12f3={'id':util[_0x4ee2('0xb')](_0x4ee2('0x2c'),_0x14bc72,_0x1e598f['id'],_0x1e598f['app']),'condition':require(_0x4ee2('0x2d'))[_0x4ee2('0x2e')](_0x14bc72,getIntervals(_0x23c1c9[_0x4ee2('0x2f')],_0x1e598f),_0x23c1c9),'consequence':require(_0x4ee2('0x30')+_0x1e598f[_0x4ee2('0x1a')])[_0x4ee2('0x31')](_0x14bc72,_0x1d9a37,_0x23c1c9,_0x5a3c5c),'p':_0x1e598f[_0x4ee2('0x32')]||0x0};logger[_0x4ee2('0x33')](_0x4ee2('0x34'),_0x2e12f3['id'],_0x4ee2('0x35'),getIntervals(_0x23c1c9['intervals'],_0x1e598f)['join'](_0x4ee2('0x36')));_0x1b95c5[_0x4ee2('0x1f')](_0x2e12f3);}else{logger[_0x4ee2('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x4ee2('0x19')](__dirname,'applications',_0x1e598f[_0x4ee2('0x1a')]+'.js'));}}_0x23c1c9[_0x4ee2('0x38')][_0x14bc72]=new RuleEngine(_0x1b95c5);_0x23c1c9[_0x4ee2('0x38')][_0x14bc72][_0x4ee2('0x39')](_0x5a3c5c,function(_0x5bc5f3){logger[_0x4ee2('0x33')]('Applications\x20executed',JSON[_0x4ee2('0x3a')](_0x5bc5f3[_0x4ee2('0x3b')]));if(_0x23c1c9[_0x4ee2('0x38')][_0x14bc72]){_0x23c1c9[_0x4ee2('0x38')][_0x14bc72]['emit'](_0x4ee2('0x3c'));}});return _0x231d5({'code':0xc8,'message':_0x5a3c5c});}else{logger[_0x4ee2('0x33')]('No\x20applications\x20to\x20execute');return _0x231d5({'code':0xc8,'message':_0x5a3c5c});}}catch(_0x1c4325){logger['error'](_0x1c4325['stack']);return _0x3c4279(_0x34dacb[_0x4ee2('0x37')](0x1f4,_0x1c4325));}}return _0x3c4279('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2bba32){var _0x53635c=this;return new Promise(function(_0x3011e4,_0x4641b8){if(_0x2bba32[_0x4ee2('0x3d')]&&_0x2bba32['agent']['id']){if(_0x23c1c9[_0x4ee2('0x3e')][_0x2bba32[_0x4ee2('0x3d')]['id']]){_0x23c1c9[_0x4ee2('0x3e')][_0x2bba32[_0x4ee2('0x3d')]['id']][_0x4ee2('0x3f')]=![];_0x23c1c9['agents'][_0x2bba32[_0x4ee2('0x3d')]['id']][_0x4ee2('0x40')]=undefined;}}if(_0x2bba32['message']&&_0x2bba32['message']['id']){try{var _0x253d0e=getId(_0x2bba32['channel'],_0x2bba32[_0x4ee2('0x14')]?_0x2bba32[_0x4ee2('0x14')]['id']:0x0,_0x2bba32['interaction']?_0x2bba32[_0x4ee2('0x15')]['id']:0x0);if(_0x23c1c9[_0x4ee2('0x38')][_0x253d0e]){_0x23c1c9[_0x4ee2('0x38')][_0x253d0e]['emit'](_0x4ee2('0x41'));if(rpc[_0x2bba32[_0x4ee2('0x13')]+'QueueReport']){rpc[_0x2bba32['channel']+'QueueReport']['update'](_0x253d0e,{'UserId':_0x2bba32[_0x4ee2('0x14')][_0x4ee2('0x42')]})['catch'](function(){logger[_0x4ee2('0x37')](_0x4ee2('0x43'));});}}return _0x3011e4({'code':0xc8,'message':_0x2bba32});}catch(_0x391424){logger[_0x4ee2('0x37')](_0x391424[_0x4ee2('0x44')]);return _0x4641b8(_0x53635c[_0x4ee2('0x37')](0x1f4,_0x391424));}}logger[_0x4ee2('0x37')]('message\x20is\x20empty');return _0x4641b8(_0x53635c[_0x4ee2('0x37')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x13cb09){var _0x14a86d=this;return new Promise(function(_0x5b8d0,_0x56c1ca){if(_0x13cb09[_0x4ee2('0x3d')]&&_0x13cb09[_0x4ee2('0x3d')]['id']){try{if(_0x23c1c9[_0x4ee2('0x3e')][_0x13cb09['agent']['id']]){_0x23c1c9['agents'][_0x13cb09[_0x4ee2('0x3d')]['id']][_0x4ee2('0x3f')]=![];_0x23c1c9[_0x4ee2('0x3e')][_0x13cb09[_0x4ee2('0x3d')]['id']]['busyQueue']=undefined;}return _0x5b8d0({'code':0xc8,'message':_0x13cb09});}catch(_0x32bd64){logger[_0x4ee2('0x37')](_0x32bd64[_0x4ee2('0x44')]);return _0x56c1ca(_0x14a86d[_0x4ee2('0x37')](0x1f4,_0x32bd64));}}logger[_0x4ee2('0x37')](_0x4ee2('0x45'));return _0x56c1ca(_0x14a86d[_0x4ee2('0x37')](0x1f4,_0x4ee2('0x45')));});},'AbandonInteraction':function(_0x279c28){var _0x1c685=this;return new Promise(function(_0x227c9c,_0x1a1021){if(_0x279c28['channel']&&_0x279c28['interaction']&&_0x279c28[_0x4ee2('0x15')]['id']){try{var _0x34519a=getId(_0x279c28[_0x4ee2('0x13')],_0x279c28['message']?_0x279c28['message']['id']:0x0,_0x279c28[_0x4ee2('0x15')]?_0x279c28[_0x4ee2('0x15')]['id']:0x0);if(_0x23c1c9[_0x4ee2('0x38')][_0x34519a]){_0x23c1c9['rules'][_0x34519a][_0x4ee2('0x46')](_0x4ee2('0x41'));}return _0x227c9c({'code':0xc8,'message':_0x279c28});}catch(_0x413d8d){logger[_0x4ee2('0x37')](_0x413d8d[_0x4ee2('0x44')]);return _0x1a1021(_0x1c685['error'](0x1f4,_0x413d8d));}}logger['error'](_0x4ee2('0x45'));return _0x1a1021(_0x1c685[_0x4ee2('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3c4120){var _0xdf70bd=this;return new Promise(function(_0x2b42b1,_0x71e7ce){if(_0x23c1c9[_0x4ee2('0x3e')]['hasOwnProperty'](_0x3c4120['id'])){for(var _0x344e1c in _0x3c4120['capacity']){if(_0x3c4120[_0x4ee2('0x47')][_0x4ee2('0x48')](_0x344e1c)){if(_0x23c1c9['agents'][_0x3c4120['id']][_0x4ee2('0x48')](_0x344e1c+_0x4ee2('0x49'))){_0x23c1c9[_0x4ee2('0x3e')][_0x3c4120['id']][_0x344e1c+_0x4ee2('0x49')]=parseInt(_0x3c4120['capacity'][_0x344e1c],0xa);}}}_0x23c1c9[_0x4ee2('0x3e')][_0x3c4120['id']][_0x4ee2('0x4a')]();return _0x2b42b1({'code':0xc8,'message':_0x23c1c9['agents'][_0x3c4120['id']]});}else{return _0x71e7ce(_0xdf70bd[_0x4ee2('0x37')](0x1f4,_0x4ee2('0x4b')));}});},'Agents':function(_0x33992f){return new Promise(function(_0x1f542a){var _0x56eda8=_[_0x4ee2('0x4c')](_0x23c1c9[_0x4ee2('0x3e')]);if(_0x33992f&&_0x33992f['id']){var _0xb1a4b2=_[_0x4ee2('0x4d')](_0x56eda8,function(_0xe57e83){return _0xe57e83['id']===_0x33992f['id'];});_0x1f542a(_0xb1a4b2);}else{_0x1f542a({'count':_0x56eda8[_0x4ee2('0x18')],'rows':_0x56eda8});}});},'ChatQueues':function(){return new Promise(function(_0x4c5988){var _0x211e6d=[];for(var _0x19d41b in _0x23c1c9[_0x4ee2('0x4e')]){if(_0x23c1c9[_0x4ee2('0x4e')][_0x4ee2('0x48')](_0x19d41b)){var _0x1e204e=_0x23c1c9[_0x4ee2('0x4e')][_0x19d41b];var _0x2136ad={'id':_0x1e204e['id'],'available':_0x1e204e['available'],'loggedIn':_0x1e204e['loggedIn'],'name':_0x1e204e['name'],'paused':_0x1e204e[_0x4ee2('0x4f')],'waiting':_0x1e204e['waiting']};_0x211e6d[_0x4ee2('0x1f')](_0x2136ad);}}_0x4c5988({'count':_0x211e6d[_0x4ee2('0x18')],'rows':_0x211e6d});});},'MailQueues':function(){return new Promise(function(_0x355212){var _0x4c8d70=[];for(var _0x5a5a9e in _0x23c1c9[_0x4ee2('0x50')]){if(_0x23c1c9[_0x4ee2('0x50')][_0x4ee2('0x48')](_0x5a5a9e)){var _0x373ad4=_0x23c1c9[_0x4ee2('0x50')][_0x5a5a9e];var _0x3ff36a={'id':_0x373ad4['id'],'available':_0x373ad4['available'],'loggedIn':_0x373ad4[_0x4ee2('0x51')],'name':_0x373ad4[_0x4ee2('0x52')],'paused':_0x373ad4[_0x4ee2('0x4f')],'waiting':_0x373ad4[_0x4ee2('0x53')]};_0x4c8d70[_0x4ee2('0x1f')](_0x3ff36a);}}_0x355212({'count':_0x4c8d70[_0x4ee2('0x18')],'rows':_0x4c8d70});});},'OpenchannelQueues':function(){return new Promise(function(_0xace7e9){var _0x7168d=[];for(var _0x136ec5 in _0x23c1c9['openchannelQueues']){if(_0x23c1c9['openchannelQueues'][_0x4ee2('0x48')](_0x136ec5)){var _0x4a3f7a=_0x23c1c9[_0x4ee2('0x54')][_0x136ec5];var _0x55e987={'id':_0x4a3f7a['id'],'available':_0x4a3f7a['available'],'loggedIn':_0x4a3f7a[_0x4ee2('0x51')],'name':_0x4a3f7a[_0x4ee2('0x52')],'paused':_0x4a3f7a['paused'],'waiting':_0x4a3f7a[_0x4ee2('0x53')]};_0x7168d['push'](_0x55e987);}}_0xace7e9({'count':_0x7168d[_0x4ee2('0x18')],'rows':_0x7168d});});},'SmsQueues':function(){return new Promise(function(_0x3f23f1){var _0x3aa69e=[];for(var _0x54d595 in _0x23c1c9[_0x4ee2('0x55')]){if(_0x23c1c9[_0x4ee2('0x55')]['hasOwnProperty'](_0x54d595)){var _0x340905=_0x23c1c9[_0x4ee2('0x55')][_0x54d595];var _0x102682={'id':_0x340905['id'],'available':_0x340905[_0x4ee2('0x56')],'loggedIn':_0x340905[_0x4ee2('0x51')],'name':_0x340905[_0x4ee2('0x52')],'paused':_0x340905[_0x4ee2('0x4f')],'waiting':_0x340905['waiting']};_0x3aa69e['push'](_0x102682);}}_0x3f23f1({'count':_0x3aa69e[_0x4ee2('0x18')],'rows':_0x3aa69e});});},'FaxQueues':function(){return new Promise(function(_0x15db25){var _0xb29abd=[];for(var _0x53e591 in _0x23c1c9[_0x4ee2('0x57')]){if(_0x23c1c9[_0x4ee2('0x57')]['hasOwnProperty'](_0x53e591)){var _0x5ae3c6=_0x23c1c9[_0x4ee2('0x57')][_0x53e591];var _0x4cb15a={'id':_0x5ae3c6['id'],'available':_0x5ae3c6[_0x4ee2('0x56')],'loggedIn':_0x5ae3c6[_0x4ee2('0x51')],'name':_0x5ae3c6['name'],'paused':_0x5ae3c6[_0x4ee2('0x4f')],'waiting':_0x5ae3c6[_0x4ee2('0x53')]};_0xb29abd[_0x4ee2('0x1f')](_0x4cb15a);}}_0x15db25({'count':_0xb29abd[_0x4ee2('0x18')],'rows':_0xb29abd});});},'WhatsappQueues':function(){return new Promise(function(_0x2c3b73){var _0x14abad=[];for(var _0x1e093a in _0x23c1c9[_0x4ee2('0x58')]){if(_0x23c1c9[_0x4ee2('0x58')][_0x4ee2('0x48')](_0x1e093a)){var _0x1a2721=_0x23c1c9[_0x4ee2('0x58')][_0x1e093a];var _0x43ae88={'id':_0x1a2721['id'],'available':_0x1a2721[_0x4ee2('0x56')],'loggedIn':_0x1a2721[_0x4ee2('0x51')],'name':_0x1a2721[_0x4ee2('0x52')],'paused':_0x1a2721[_0x4ee2('0x4f')],'waiting':_0x1a2721[_0x4ee2('0x53')]};_0x14abad[_0x4ee2('0x1f')](_0x43ae88);}}_0x2c3b73({'count':_0x14abad[_0x4ee2('0x18')],'rows':_0x14abad});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3a4394){var _0x4e4abb=_['values'](_0x23c1c9[_0x4ee2('0x59')]);_0x3a4394({'count':_0x4e4abb[_0x4ee2('0x18')],'rows':_0x4e4abb});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1ee369){var _0x117e7b=_[_0x4ee2('0x4c')](_0x23c1c9[_0x4ee2('0x5a')]);_0x1ee369({'count':_0x117e7b[_0x4ee2('0x18')],'rows':_0x117e7b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2192a9){var _0x49e09e=_[_0x4ee2('0x4c')](_0x23c1c9['openchannelQueuesWaitingInteractions']);_0x2192a9({'count':_0x49e09e[_0x4ee2('0x18')],'rows':_0x49e09e});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x27de1d){var _0x367396=_['values'](_0x23c1c9[_0x4ee2('0x5b')]);_0x27de1d({'count':_0x367396[_0x4ee2('0x18')],'rows':_0x367396});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x36be3f){var _0x169d43=_[_0x4ee2('0x4c')](_0x23c1c9[_0x4ee2('0x5c')]);_0x36be3f({'count':_0x169d43[_0x4ee2('0x18')],'rows':_0x169d43});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x233718){var _0x233284=_[_0x4ee2('0x4c')](_0x23c1c9[_0x4ee2('0x5d')]);_0x233718({'count':_0x233284['length'],'rows':_0x233284});});}};var _0xb7dbf3=jayson[_0x4ee2('0x5e')](_0x2bf4c2)['http']();_0xb7dbf3['on']('error',function(_0x576440){logger[_0x4ee2('0x37')](JSON[_0x4ee2('0x3a')](_0x576440));return _0x2357c5(_0x576440);});_0xb7dbf3[_0x4ee2('0x12')](0x232c,_0x4ee2('0x5f'),function(){console[_0x4ee2('0x60')](_0x4ee2('0x61'),0x232c);return _0x481181(_0x4ee2('0x62')+0x232c);});});}; \ No newline at end of file +var _0x9bde=['agents','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','util','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','split','mail','push','slice','appdata','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','rules','execute','info','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','busy'];(function(_0x4a2a6b,_0xd6a093){var _0x41ea18=function(_0x3790f8){while(--_0x3790f8){_0x4a2a6b['push'](_0x4a2a6b['shift']());}};_0x41ea18(++_0xd6a093);}(_0x9bde,0xe1));var _0xe9bd=function(_0x26922e,_0x373531){_0x26922e=_0x26922e-0x0;var _0x18aa86=_0x9bde[_0x26922e];return _0x18aa86;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0xe9bd('0x1'));var BPromise=require('bluebird');var utils=require(_0xe9bd('0x2'));var logger=require(_0xe9bd('0x3'))(_0xe9bd('0x4'));var rpc={'openchannelQueueReport':require(_0xe9bd('0x5')),'mailQueueReport':require(_0xe9bd('0x6')),'chatQueueReport':require(_0xe9bd('0x7')),'smsQueueReport':require(_0xe9bd('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xe9bd('0x9'))};var RuleEngine=require(_0xe9bd('0xa'));function getId(_0x22a438,_0xa66ae2,_0x2d5c75){return util[_0xe9bd('0xb')](_0xe9bd('0xc'),_0x22a438,_0xa66ae2||0x0,_0x2d5c75||0x0);}function getIntervals(_0xbefddb,_0x439abc){var _0x45c7ba=[];if(!_['isNil'](_0x439abc['IntervalId'])&&!_[_0xe9bd('0xd')](_0xbefddb[_0x439abc[_0xe9bd('0xe')]])&&!_[_0xe9bd('0xd')](_0xbefddb[_0x439abc['IntervalId']][_0xe9bd('0xf')])){_0x45c7ba=_[_0xe9bd('0x10')](_0xbefddb[_0x439abc[_0xe9bd('0xe')]][_0xe9bd('0xf')],'interval');}else if(!_[_0xe9bd('0xd')](_0x439abc['interval'])){_0x45c7ba=[_0x439abc[_0xe9bd('0x11')]];}return _0x45c7ba;}exports[_0xe9bd('0x12')]=function(_0x3435b4){_0x3435b4['rules']={};return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818={'Start':function(_0x3a9e5f){var _0x46a59b=this;return new Promise(function(_0x3360bd,_0x389e7b){if(_0x3a9e5f){try{var _0x45a9f2=[];var _0x573350=getId(_0x3a9e5f[_0xe9bd('0x13')],_0x3a9e5f[_0xe9bd('0x14')]?_0x3a9e5f[_0xe9bd('0x14')]['id']:0x0,_0x3a9e5f['interaction']?_0x3a9e5f[_0xe9bd('0x15')]['id']:0x0);if(_0x3a9e5f[_0xe9bd('0x16')]&&_[_0xe9bd('0x17')](_0x3a9e5f[_0xe9bd('0x16')])&&_0x3a9e5f['applications'][_0xe9bd('0x18')]){for(var _0x50a5e8=0x0;_0x50a5e8<_0x3a9e5f[_0xe9bd('0x16')]['length'];_0x50a5e8+=0x1){var _0x26aa4a=_0x3a9e5f[_0xe9bd('0x16')][_0x50a5e8];if(fs[_0xe9bd('0x19')](path[_0xe9bd('0x1a')](__dirname,_0xe9bd('0x16'),_0x26aa4a[_0xe9bd('0x1b')]+_0xe9bd('0x1c')))){var _0x49165b=[];switch(_0x26aa4a[_0xe9bd('0x1b')][_0xe9bd('0x1d')]()){case'autoreply':var _0x37aec1=_0x26aa4a['appdata'][_0xe9bd('0x1e')](',');if(_0x3a9e5f[_0xe9bd('0x13')]===_0xe9bd('0x1f')){_0x49165b[_0xe9bd('0x20')](_0x37aec1[0x0]);_0x49165b['push'](_0x37aec1[0x1]);_0x49165b[_0xe9bd('0x20')](_0x37aec1[_0xe9bd('0x21')](0x2,_0x37aec1[_0xe9bd('0x18')])[_0xe9bd('0x1a')](','));}else{_0x49165b[_0xe9bd('0x20')](_0x37aec1[0x0]);_0x49165b[_0xe9bd('0x20')](_0x37aec1[_0xe9bd('0x21')](0x1,_0x37aec1[_0xe9bd('0x18')])[_0xe9bd('0x1a')](','));}break;case'dialogflow':var _0x3c211a=_0x26aa4a[_0xe9bd('0x22')]['split'](',');_0x49165b[_0xe9bd('0x20')](_0x3c211a[0x0]);_0x49165b[_0xe9bd('0x20')](_0x3c211a[0x1]);_0x49165b[_0xe9bd('0x20')](_0x3c211a[_0xe9bd('0x21')](0x2,_0x3c211a[_0xe9bd('0x18')])[_0xe9bd('0x1a')](','));break;case'dialogflowv2':var _0x5b7f1d=_0x26aa4a[_0xe9bd('0x22')]['split'](',');_0x49165b[_0xe9bd('0x20')](_0x5b7f1d[0x0]);_0x49165b[_0xe9bd('0x20')](_0x5b7f1d[0x1]);_0x49165b[_0xe9bd('0x20')](_0x5b7f1d[0x2]);_0x49165b[_0xe9bd('0x20')](_0x5b7f1d[0x3]);_0x49165b[_0xe9bd('0x20')](_0x5b7f1d['slice'](0x4,_0x5b7f1d['length'])[_0xe9bd('0x1a')](','));break;case _0xe9bd('0x23'):var _0x3f96a0=_0x26aa4a[_0xe9bd('0x22')][_0xe9bd('0x1e')](',');_0x49165b[_0xe9bd('0x20')](_0x3f96a0[0x0]);_0x49165b[_0xe9bd('0x20')](_0x3f96a0[0x1]);_0x49165b[_0xe9bd('0x20')](_0x3f96a0[0x2]);_0x49165b[_0xe9bd('0x20')](_0x3f96a0[0x3]);_0x49165b['push'](_0x3f96a0[_0xe9bd('0x21')](0x4,_0x3f96a0[_0xe9bd('0x18')])[_0xe9bd('0x1a')](','));break;case'message':_0x49165b['push'](_0x26aa4a[_0xe9bd('0x22')]);break;case _0xe9bd('0x24'):_0x49165b[_0xe9bd('0x20')](_0x26aa4a[_0xe9bd('0x25')]);_0x49165b[_0xe9bd('0x20')](_0x26aa4a[_0xe9bd('0x22')]);break;case _0xe9bd('0x26'):var _0x1c6173=utils[_0xe9bd('0x27')](_0x3a9e5f[_0xe9bd('0x28')][_0xe9bd('0x29')],_0x3a9e5f);var _0x549dd1=_0x26aa4a[_0xe9bd('0x22')][_0xe9bd('0x1e')](',');_0x49165b[_0xe9bd('0x20')](_0x549dd1[0x0]);_0x49165b[_0xe9bd('0x20')](_0x549dd1[0x1]);_0x49165b[_0xe9bd('0x20')](_0x549dd1[0x2]);_0x49165b[_0xe9bd('0x20')](_0x549dd1[0x3]);_0x49165b['push'](_0x549dd1[0x4]);_0x49165b[_0xe9bd('0x20')](_0x549dd1[0x5]);_0x49165b[_0xe9bd('0x20')](_0x549dd1[0x6]);_0x49165b['push'](_0x549dd1[0x7]);_0x49165b[_0xe9bd('0x20')](_0x549dd1[0x8]);_0x49165b[_0xe9bd('0x20')](_0x549dd1[0x9]);_0x49165b['push'](_0x549dd1[0xa]);_0x49165b['push'](_0x3a9e5f[_0xe9bd('0x15')]['id']);_0x49165b[_0xe9bd('0x20')](_0x3a9e5f['message']['id']);_0x49165b[_0xe9bd('0x20')](_0x26aa4a[_0xe9bd('0x2a')]);_0x49165b[_0xe9bd('0x20')](_0x3a9e5f['interaction'][_0xe9bd('0x2b')]);_0x49165b['push'](_0x3a9e5f[_0xe9bd('0x2c')][_0xe9bd('0x2c')]);_0x49165b[_0xe9bd('0x20')](_0x1c6173);break;default:_0x49165b=_[_0xe9bd('0xd')](_0x26aa4a['appdata'])?[]:_0x26aa4a[_0xe9bd('0x22')][_0xe9bd('0x1e')](',');}var _0x327e1a={'id':util[_0xe9bd('0xb')](_0xe9bd('0x2d'),_0x573350,_0x26aa4a['id'],_0x26aa4a[_0xe9bd('0x1b')]),'condition':require(_0xe9bd('0x2e'))[_0xe9bd('0x2f')](_0x573350,getIntervals(_0x3435b4[_0xe9bd('0x30')],_0x26aa4a),_0x3435b4),'consequence':require(_0xe9bd('0x31')+_0x26aa4a['app'])['consequence'](_0x573350,_0x49165b,_0x3435b4,_0x3a9e5f),'p':_0x26aa4a[_0xe9bd('0x32')]||0x0};logger['info'](_0xe9bd('0x33'),_0x327e1a['id'],_0xe9bd('0x34'),getIntervals(_0x3435b4[_0xe9bd('0x30')],_0x26aa4a)['join'](_0xe9bd('0x35')));_0x45a9f2[_0xe9bd('0x20')](_0x327e1a);}else{logger[_0xe9bd('0x36')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xe9bd('0x1a')](__dirname,_0xe9bd('0x16'),_0x26aa4a[_0xe9bd('0x1b')]+_0xe9bd('0x1c')));}}_0x3435b4[_0xe9bd('0x37')][_0x573350]=new RuleEngine(_0x45a9f2);_0x3435b4[_0xe9bd('0x37')][_0x573350][_0xe9bd('0x38')](_0x3a9e5f,function(_0x3c4482){logger[_0xe9bd('0x39')](_0xe9bd('0x3a'),JSON[_0xe9bd('0x3b')](_0x3c4482[_0xe9bd('0x3c')]));if(_0x3435b4[_0xe9bd('0x37')][_0x573350]){_0x3435b4[_0xe9bd('0x37')][_0x573350][_0xe9bd('0x3d')]('complete');}});return _0x3360bd({'code':0xc8,'message':_0x3a9e5f});}else{logger['info'](_0xe9bd('0x3e'));return _0x3360bd({'code':0xc8,'message':_0x3a9e5f});}}catch(_0x2ced7c){logger[_0xe9bd('0x36')](_0x2ced7c['stack']);return _0x389e7b(_0x46a59b['error'](0x1f4,_0x2ced7c));}}return _0x389e7b(_0xe9bd('0x3f'));});},'AcceptMessage':function(_0x3f6f22){var _0x165942=this;return new Promise(function(_0x15da40,_0x39fb61){if(_0x3f6f22[_0xe9bd('0x40')]&&_0x3f6f22[_0xe9bd('0x40')]['id']){if(_0x3435b4['agents'][_0x3f6f22[_0xe9bd('0x40')]['id']]){_0x3435b4['agents'][_0x3f6f22[_0xe9bd('0x40')]['id']][_0xe9bd('0x41')]=![];_0x3435b4[_0xe9bd('0x42')][_0x3f6f22[_0xe9bd('0x40')]['id']][_0xe9bd('0x43')]=undefined;}}if(_0x3f6f22['message']&&_0x3f6f22[_0xe9bd('0x14')]['id']){try{var _0x3e5d44=getId(_0x3f6f22[_0xe9bd('0x13')],_0x3f6f22['message']?_0x3f6f22[_0xe9bd('0x14')]['id']:0x0,_0x3f6f22[_0xe9bd('0x15')]?_0x3f6f22[_0xe9bd('0x15')]['id']:0x0);if(_0x3435b4['rules'][_0x3e5d44]){_0x3435b4[_0xe9bd('0x37')][_0x3e5d44][_0xe9bd('0x3d')](_0xe9bd('0x44'));if(rpc[_0x3f6f22[_0xe9bd('0x13')]+_0xe9bd('0x45')]){rpc[_0x3f6f22['channel']+_0xe9bd('0x45')]['update'](_0x3e5d44,{'UserId':_0x3f6f22[_0xe9bd('0x14')][_0xe9bd('0x46')]})[_0xe9bd('0x47')](function(){logger[_0xe9bd('0x36')](_0xe9bd('0x48'));});}}return _0x15da40({'code':0xc8,'message':_0x3f6f22});}catch(_0x4944e3){logger[_0xe9bd('0x36')](_0x4944e3['stack']);return _0x39fb61(_0x165942[_0xe9bd('0x36')](0x1f4,_0x4944e3));}}logger[_0xe9bd('0x36')]('message\x20is\x20empty');return _0x39fb61(_0x165942['error'](0x1f4,_0xe9bd('0x49')));});},'RejectMessage':function(_0x524da7){var _0x1ad573=this;return new Promise(function(_0x519535,_0x26b25a){if(_0x524da7[_0xe9bd('0x40')]&&_0x524da7['agent']['id']){try{if(_0x3435b4[_0xe9bd('0x42')][_0x524da7['agent']['id']]){_0x3435b4[_0xe9bd('0x42')][_0x524da7[_0xe9bd('0x40')]['id']][_0xe9bd('0x41')]=![];_0x3435b4['agents'][_0x524da7[_0xe9bd('0x40')]['id']][_0xe9bd('0x43')]=undefined;}return _0x519535({'code':0xc8,'message':_0x524da7});}catch(_0x45b69e){logger[_0xe9bd('0x36')](_0x45b69e['stack']);return _0x26b25a(_0x1ad573['error'](0x1f4,_0x45b69e));}}logger[_0xe9bd('0x36')]('message\x20is\x20empty');return _0x26b25a(_0x1ad573[_0xe9bd('0x36')](0x1f4,_0xe9bd('0x49')));});},'AbandonInteraction':function(_0xc7dd2f){var _0xc818b4=this;return new Promise(function(_0x159f68,_0x145ea3){if(_0xc7dd2f[_0xe9bd('0x13')]&&_0xc7dd2f[_0xe9bd('0x15')]&&_0xc7dd2f[_0xe9bd('0x15')]['id']){try{var _0x3be526=getId(_0xc7dd2f[_0xe9bd('0x13')],_0xc7dd2f[_0xe9bd('0x14')]?_0xc7dd2f['message']['id']:0x0,_0xc7dd2f['interaction']?_0xc7dd2f['interaction']['id']:0x0);if(_0x3435b4[_0xe9bd('0x37')][_0x3be526]){_0x3435b4['rules'][_0x3be526][_0xe9bd('0x3d')](_0xe9bd('0x44'));}return _0x159f68({'code':0xc8,'message':_0xc7dd2f});}catch(_0x90db01){logger[_0xe9bd('0x36')](_0x90db01[_0xe9bd('0x4a')]);return _0x145ea3(_0xc818b4[_0xe9bd('0x36')](0x1f4,_0x90db01));}}logger[_0xe9bd('0x36')](_0xe9bd('0x49'));return _0x145ea3(_0xc818b4[_0xe9bd('0x36')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x242f9f){var _0x2abc41=this;return new Promise(function(_0x3d3e74,_0x3f848d){if(_0x3435b4['agents'][_0xe9bd('0x4b')](_0x242f9f['id'])){for(var _0xc44b92 in _0x242f9f[_0xe9bd('0x4c')]){if(_0x242f9f['capacity'][_0xe9bd('0x4b')](_0xc44b92)){if(_0x3435b4[_0xe9bd('0x42')][_0x242f9f['id']][_0xe9bd('0x4b')](_0xc44b92+_0xe9bd('0x4d'))){_0x3435b4['agents'][_0x242f9f['id']][_0xc44b92+'CurrentCapacity']=parseInt(_0x242f9f[_0xe9bd('0x4c')][_0xc44b92],0xa);}}}_0x3435b4[_0xe9bd('0x42')][_0x242f9f['id']][_0xe9bd('0x4e')]();return _0x3d3e74({'code':0xc8,'message':_0x3435b4[_0xe9bd('0x42')][_0x242f9f['id']]});}else{return _0x3f848d(_0x2abc41['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x305efa){return new Promise(function(_0x20855b){var _0x3ea0cc=_[_0xe9bd('0x4f')](_0x3435b4[_0xe9bd('0x42')]);if(_0x305efa&&_0x305efa['id']){var _0x23f476=_['find'](_0x3ea0cc,function(_0x179c8d){return _0x179c8d['id']===_0x305efa['id'];});_0x20855b(_0x23f476);}else{_0x20855b({'count':_0x3ea0cc['length'],'rows':_0x3ea0cc});}});},'ChatQueues':function(){return new Promise(function(_0x27e07c){var _0x28dd03=[];for(var _0x3223f0 in _0x3435b4[_0xe9bd('0x50')]){if(_0x3435b4['chatQueues'][_0xe9bd('0x4b')](_0x3223f0)){var _0x263ad9=_0x3435b4[_0xe9bd('0x50')][_0x3223f0];var _0x4f35c4={'id':_0x263ad9['id'],'available':_0x263ad9[_0xe9bd('0x51')],'loggedIn':_0x263ad9[_0xe9bd('0x52')],'name':_0x263ad9[_0xe9bd('0x53')],'paused':_0x263ad9[_0xe9bd('0x54')],'waiting':_0x263ad9[_0xe9bd('0x55')]};_0x28dd03[_0xe9bd('0x20')](_0x4f35c4);}}_0x27e07c({'count':_0x28dd03[_0xe9bd('0x18')],'rows':_0x28dd03});});},'MailQueues':function(){return new Promise(function(_0x336222){var _0x38e2bf=[];for(var _0x37bb08 in _0x3435b4[_0xe9bd('0x56')]){if(_0x3435b4[_0xe9bd('0x56')]['hasOwnProperty'](_0x37bb08)){var _0x3a12e9=_0x3435b4[_0xe9bd('0x56')][_0x37bb08];var _0x481368={'id':_0x3a12e9['id'],'available':_0x3a12e9[_0xe9bd('0x51')],'loggedIn':_0x3a12e9[_0xe9bd('0x52')],'name':_0x3a12e9['name'],'paused':_0x3a12e9['paused'],'waiting':_0x3a12e9[_0xe9bd('0x55')]};_0x38e2bf[_0xe9bd('0x20')](_0x481368);}}_0x336222({'count':_0x38e2bf['length'],'rows':_0x38e2bf});});},'OpenchannelQueues':function(){return new Promise(function(_0x4ec8be){var _0x4a6422=[];for(var _0x246487 in _0x3435b4['openchannelQueues']){if(_0x3435b4['openchannelQueues']['hasOwnProperty'](_0x246487)){var _0x4bcf2b=_0x3435b4[_0xe9bd('0x57')][_0x246487];var _0x46da33={'id':_0x4bcf2b['id'],'available':_0x4bcf2b[_0xe9bd('0x51')],'loggedIn':_0x4bcf2b['loggedIn'],'name':_0x4bcf2b[_0xe9bd('0x53')],'paused':_0x4bcf2b[_0xe9bd('0x54')],'waiting':_0x4bcf2b[_0xe9bd('0x55')]};_0x4a6422[_0xe9bd('0x20')](_0x46da33);}}_0x4ec8be({'count':_0x4a6422['length'],'rows':_0x4a6422});});},'SmsQueues':function(){return new Promise(function(_0x2656e9){var _0x10ef2b=[];for(var _0x11ebcb in _0x3435b4['smsQueues']){if(_0x3435b4['smsQueues'][_0xe9bd('0x4b')](_0x11ebcb)){var _0x2530e1=_0x3435b4[_0xe9bd('0x58')][_0x11ebcb];var _0x40d9e0={'id':_0x2530e1['id'],'available':_0x2530e1[_0xe9bd('0x51')],'loggedIn':_0x2530e1[_0xe9bd('0x52')],'name':_0x2530e1[_0xe9bd('0x53')],'paused':_0x2530e1[_0xe9bd('0x54')],'waiting':_0x2530e1['waiting']};_0x10ef2b[_0xe9bd('0x20')](_0x40d9e0);}}_0x2656e9({'count':_0x10ef2b[_0xe9bd('0x18')],'rows':_0x10ef2b});});},'FaxQueues':function(){return new Promise(function(_0x3c18ca){var _0x3db47a=[];for(var _0x2364fc in _0x3435b4['faxQueues']){if(_0x3435b4[_0xe9bd('0x59')]['hasOwnProperty'](_0x2364fc)){var _0x5c0d19=_0x3435b4[_0xe9bd('0x59')][_0x2364fc];var _0x4496e3={'id':_0x5c0d19['id'],'available':_0x5c0d19['available'],'loggedIn':_0x5c0d19[_0xe9bd('0x52')],'name':_0x5c0d19[_0xe9bd('0x53')],'paused':_0x5c0d19[_0xe9bd('0x54')],'waiting':_0x5c0d19[_0xe9bd('0x55')]};_0x3db47a['push'](_0x4496e3);}}_0x3c18ca({'count':_0x3db47a[_0xe9bd('0x18')],'rows':_0x3db47a});});},'WhatsappQueues':function(){return new Promise(function(_0x41fb41){var _0x4a5b5b=[];for(var _0x2a014e in _0x3435b4[_0xe9bd('0x5a')]){if(_0x3435b4[_0xe9bd('0x5a')][_0xe9bd('0x4b')](_0x2a014e)){var _0x2e63c7=_0x3435b4[_0xe9bd('0x5a')][_0x2a014e];var _0x466a89={'id':_0x2e63c7['id'],'available':_0x2e63c7['available'],'loggedIn':_0x2e63c7[_0xe9bd('0x52')],'name':_0x2e63c7[_0xe9bd('0x53')],'paused':_0x2e63c7[_0xe9bd('0x54')],'waiting':_0x2e63c7[_0xe9bd('0x55')]};_0x4a5b5b[_0xe9bd('0x20')](_0x466a89);}}_0x41fb41({'count':_0x4a5b5b[_0xe9bd('0x18')],'rows':_0x4a5b5b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x18a387){var _0x2adc49=_[_0xe9bd('0x4f')](_0x3435b4['chatQueuesWaitingInteractions']);_0x18a387({'count':_0x2adc49[_0xe9bd('0x18')],'rows':_0x2adc49});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x466952){var _0x256890=_[_0xe9bd('0x4f')](_0x3435b4[_0xe9bd('0x5b')]);_0x466952({'count':_0x256890[_0xe9bd('0x18')],'rows':_0x256890});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1bad42){var _0x4b9c08=_[_0xe9bd('0x4f')](_0x3435b4[_0xe9bd('0x5c')]);_0x1bad42({'count':_0x4b9c08['length'],'rows':_0x4b9c08});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x32a61d){var _0x17f733=_[_0xe9bd('0x4f')](_0x3435b4[_0xe9bd('0x5d')]);_0x32a61d({'count':_0x17f733[_0xe9bd('0x18')],'rows':_0x17f733});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x332228){var _0x28331d=_['values'](_0x3435b4['faxQueuesWaitingInteractions']);_0x332228({'count':_0x28331d[_0xe9bd('0x18')],'rows':_0x28331d});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x16aa41){var _0x3d0163=_[_0xe9bd('0x4f')](_0x3435b4[_0xe9bd('0x5e')]);_0x16aa41({'count':_0x3d0163[_0xe9bd('0x18')],'rows':_0x3d0163});});}};var _0x1b46f4=jayson['server'](_0x248818)[_0xe9bd('0x5f')]();_0x1b46f4['on'](_0xe9bd('0x36'),function(_0x29833b){logger[_0xe9bd('0x36')](JSON[_0xe9bd('0x3b')](_0x29833b));return _0x46a95e(_0x29833b);});_0x1b46f4[_0xe9bd('0x12')](0x232c,_0xe9bd('0x60'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x47ba5e('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 194149f..fd6c83f 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 _0xc4c1=['catch','condition','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','../../../config/logger','routing','http','request','then','error','message','result'];(function(_0x292754,_0x2f00ee){var _0x87bdbe=function(_0x2f0574){while(--_0x2f0574){_0x292754['push'](_0x292754['shift']());}};_0x87bdbe(++_0x2f00ee);}(_0xc4c1,0x17d));var _0x1c4c=function(_0xcd7db,_0x127c41){_0xcd7db=_0xcd7db-0x0;var _0x45a0d8=_0xc4c1[_0xcd7db];return _0x45a0d8;};'use strict';var util=require(_0x1c4c('0x0'));var BPromise=require(_0x1c4c('0x1'));var jayson=require(_0x1c4c('0x2'));var _=require('lodash');var logger=require(_0x1c4c('0x3'))(_0x1c4c('0x4'));var client=jayson['client'][_0x1c4c('0x5')]({'port':0x232a});function request(_0x1be190,_0xfc26){return new BPromise(function(_0x17fe20,_0x292ed0){return client[_0x1c4c('0x6')](_0x1be190,_0xfc26)[_0x1c4c('0x7')](function(_0x7a368b){if(_0x7a368b[_0x1c4c('0x8')]){return _0x292ed0(_0x7a368b['error'][_0x1c4c('0x9')]);}else{return _0x17fe20(_0x7a368b[_0x1c4c('0xa')]);}})[_0x1c4c('0xb')](function(_0x1c305c){return _0x292ed0(_0x1c305c);});});}exports[_0x1c4c('0xc')]=function(_0x34e27d,_0x1e51a4,_0x3c9942){return function(_0x17341c){if(_0x3c9942['rules']&&!_0x3c9942['rules'][_0x34e27d]){logger['info'](_0x1c4c('0xd'),_0x34e27d);return _0x17341c[_0x1c4c('0xe')]();}var _0x4db576=[];for(var _0x16038e=0x0;_0x16038e<_0x1e51a4['length'];_0x16038e+=0x1){_0x4db576[_0x1c4c('0xf')](request(_0x1c4c('0x10'),{'command':util['format']('iftime\x20%s',_0x1e51a4[_0x16038e])})['then'](function(_0x360bd0){return _0x360bd0&&_0x360bd0[_0x1c4c('0x9')]&&_0x360bd0['message'][_0x1c4c('0x11')](_0x1c4c('0x12'))>=0x0?!![]:![];})[_0x1c4c('0xb')](function(_0x2dd33){logger[_0x1c4c('0x8')](_0x1c4c('0x13'),_0x34e27d,_0x1e51a4[_0x16038e]);}));}BPromise[_0x1c4c('0x14')](_0x4db576)[_0x1c4c('0x7')](function(_0x23e179){var _0xd3e1ec=_[_0x1c4c('0x15')](_0x23e179);logger[_0x1c4c('0x16')]('[%s][INTERVAL]\x20%s\x20%s',_0x34e27d,_0x1e51a4['join'](_0x1c4c('0x17')),_0xd3e1ec);_0x17341c[_0x1c4c('0x18')](_0xd3e1ec);})[_0x1c4c('0xb')](function(_0x30412c){console[_0x1c4c('0x19')](_0x30412c);logger[_0x1c4c('0x8')](_0x1c4c('0x1a'),_0x34e27d,_0x1e51a4['join'](_0x1c4c('0x17')),_0x30412c[_0x1c4c('0x1b')]);_0x17341c['stop']();});};}; \ No newline at end of file +var _0x37af=['routing','client','http','request','error','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','format','iftime\x20%s','then','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','when','join','stack','util','bluebird','jayson/promise','lodash','../../../config/logger'];(function(_0xea71c9,_0x5ed759){var _0x21e2ae=function(_0x4d5f0e){while(--_0x4d5f0e){_0xea71c9['push'](_0xea71c9['shift']());}};_0x21e2ae(++_0x5ed759);}(_0x37af,0x157));var _0xf37a=function(_0x11cee5,_0x124978){_0x11cee5=_0x11cee5-0x0;var _0x2216f2=_0x37af[_0x11cee5];return _0x2216f2;};'use strict';var util=require(_0xf37a('0x0'));var BPromise=require(_0xf37a('0x1'));var jayson=require(_0xf37a('0x2'));var _=require(_0xf37a('0x3'));var logger=require(_0xf37a('0x4'))(_0xf37a('0x5'));var client=jayson[_0xf37a('0x6')][_0xf37a('0x7')]({'port':0x232a});function request(_0x84a425,_0x3d5957){return new BPromise(function(_0x55ca2f,_0x4d1609){return client[_0xf37a('0x8')](_0x84a425,_0x3d5957)['then'](function(_0x549584){if(_0x549584[_0xf37a('0x9')]){return _0x4d1609(_0x549584[_0xf37a('0x9')]['message']);}else{return _0x55ca2f(_0x549584[_0xf37a('0xa')]);}})[_0xf37a('0xb')](function(_0x1e7d8b){return _0x4d1609(_0x1e7d8b);});});}exports['condition']=function(_0x182009,_0x589b95,_0x447d9a){return function(_0x3187c3){if(_0x447d9a[_0xf37a('0xc')]&&!_0x447d9a[_0xf37a('0xc')][_0x182009]){logger[_0xf37a('0xd')](_0xf37a('0xe'),_0x182009);return _0x3187c3[_0xf37a('0xf')]();}var _0x26c0bc=[];for(var _0x2c4781=0x0;_0x2c4781<_0x589b95['length'];_0x2c4781+=0x1){_0x26c0bc['push'](request('Command',{'command':util[_0xf37a('0x10')](_0xf37a('0x11'),_0x589b95[_0x2c4781])})[_0xf37a('0x12')](function(_0x4cdde6){return _0x4cdde6&&_0x4cdde6['message']&&_0x4cdde6[_0xf37a('0x13')][_0xf37a('0x14')](_0xf37a('0x15'))>=0x0?!![]:![];})['catch'](function(_0x429e58){logger[_0xf37a('0x9')](_0xf37a('0x16'),_0x182009,_0x589b95[_0x2c4781]);}));}BPromise[_0xf37a('0x17')](_0x26c0bc)[_0xf37a('0x12')](function(_0x4eb28c){var _0x1883b2=_[_0xf37a('0x18')](_0x4eb28c);logger[_0xf37a('0xd')](_0xf37a('0x19'),_0x182009,_0x589b95['join']('\x20|\x20'),_0x1883b2);_0x3187c3[_0xf37a('0x1a')](_0x1883b2);})[_0xf37a('0xb')](function(_0x12620a){console['log'](_0x12620a);logger[_0xf37a('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x182009,_0x589b95[_0xf37a('0x1b')]('\x20|\x20'),_0x12620a[_0xf37a('0x1c')]);_0x3187c3[_0xf37a('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 6e80b74..5794a4f 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 _0x97c1=['connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','ringtime','talktime','push','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','called'];(function(_0x8976b,_0x357673){var _0x14fae3=function(_0x3f8bc0){while(--_0x3f8bc0){_0x8976b['push'](_0x8976b['shift']());}};_0x14fae3(++_0x357673);}(_0x97c1,0xdf));var _0x197c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x97c1[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e2e81,_0x498f9c){utils['info'](util[_0x197c('0x2')](_0x197c('0x3'),_0x5e2e81[_0x197c('0x4')],_0x5e2e81[_0x197c('0x5')],_0x5e2e81[_0x197c('0x6')],_0x5e2e81['membername'],_0x5e2e81['interface'],_0x5e2e81[_0x197c('0x7')],_0x5e2e81[_0x197c('0x8')],_0x5e2e81[_0x197c('0x9')]));if(_0x5e2e81[_0x197c('0x6')]){utils['getVoiceQueueByName'](_0x5e2e81['queue'])[_0x197c('0xa')](function(_0x5cffb8){if(_0x5cffb8){_0x5e2e81[_0x197c('0xb')]=_0x5cffb8[_0x197c('0xb')];_0x5e2e81[_0x197c('0xc')]=_0x5e2e81[_0x197c('0xd')]?_0x5cffb8['acw']:![];_0x5e2e81[_0x197c('0xe')]=_0x5e2e81[_0x197c('0xc')]?_0x5cffb8[_0x197c('0xf')]:0x0;}utils[_0x197c('0x10')](_0x197c('0x11'),_0x5e2e81);});}else{utils['request'](_0x197c('0x11'),_0x5e2e81);}if(_0x498f9c){delete transfers[_0x5e2e81[_0x197c('0x4')]];}else{delete agents[_0x5e2e81[_0x197c('0x12')]];}}exports[_0x197c('0x13')]=function(_0x567658){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x567658);agents[_0x567658[_0x197c('0x12')]]=_0x567658;agents[_0x567658[_0x197c('0x12')]]['agentcalledAt']=utils['now']();agents[_0x567658[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x16');agents[_0x567658[_0x197c('0x12')]][_0x197c('0x8')]=null;agents[_0x567658[_0x197c('0x12')]][_0x197c('0x17')]=null;utils[_0x197c('0x18')](util['format'](_0x197c('0x19'),_0x567658['uniqueid'],agents[_0x567658['destuniqueid']][_0x197c('0x1a')],_0x567658[_0x197c('0x12')]));}catch(_0x2eca5e){utils[_0x197c('0x1b')](util['format'](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x2eca5e);}};exports[_0x197c('0x1c')]=function(_0x5c278a){try{if(!_[_0x197c('0x1d')](agents[_0x5c278a[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a[_0x197c('0x4')]),_0x5c278a);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x1f'),_0x5c278a[_0x197c('0x4')],agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1a')],_0x5c278a[_0x197c('0x12')]));agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1c')]=!![];agents[_0x5c278a[_0x197c('0x12')]]['agentringnoanswerAt']=utils[_0x197c('0x20')]();agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x9')]='timeout';agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x21')]='timeout';agents[_0x5c278a['destuniqueid']][_0x197c('0x22')]=_0x5c278a['ringtime']?parseInt(_0x5c278a[_0x197c('0x23')])/0x3e8:0x0;agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x24')]=0x0;unanswered[_0x197c('0x25')](_0x5c278a[_0x197c('0x12')]);}}catch(_0x3cdcd8){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a['uniqueid']),_0x3cdcd8);}};exports['queuecallerabandon']=function(_0x574274){try{_['forIn'](agents,function(_0x5f7425,_0x4c9256){if(_0x5f7425[_0x197c('0x4')]==_0x574274[_0x197c('0x4')]&&!_['includes'](unanswered,_0x5f7425[_0x197c('0x12')])){utils['debug'](util[_0x197c('0x2')](_0x197c('0x26'),_0x574274[_0x197c('0x4')]),_0x574274);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x27'),_0x574274[_0x197c('0x4')],_0x5f7425[_0x197c('0x1a')],_0x5f7425[_0x197c('0x12')]));_0x5f7425['agentringnoanswer']=!![];_0x5f7425['agentringnoanswerAt']=utils[_0x197c('0x20')]();_0x5f7425[_0x197c('0x9')]=_0x197c('0x28');_0x5f7425[_0x197c('0x21')]=_0x197c('0x28');_0x5f7425[_0x197c('0x22')]=_0x574274[_0x197c('0x22')];_0x5f7425['talktime']=0x0;writeDB(_0x5f7425);}});}catch(_0x54e6be){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][queuecallerabandon]',_0x574274['uniqueid']),_0x54e6be);}};exports[_0x197c('0x29')]=function(_0x2a884b){try{if(agents[_0x2a884b[_0x197c('0x12')]]){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x2a'),_0x2a884b[_0x197c('0x4')]),_0x2a884b);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2a884b[_0x197c('0x4')],agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x1a')],_0x2a884b[_0x197c('0x12')]));agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x2b')]=utils['now']();agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x8')]=_0x2a884b[_0x197c('0x8')];agents[_0x2a884b['destuniqueid']][_0x197c('0x17')]=_0x2a884b[_0x197c('0x17')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x2c');_[_0x197c('0x2d')](agents,function(_0x1dc01b,_0x4a12fc){if(_0x1dc01b[_0x197c('0x12')]!=_0x2a884b[_0x197c('0x12')]&&_0x1dc01b['uniqueid']==_0x2a884b['uniqueid']){_0x1dc01b[_0x197c('0x24')]=0x0;_0x1dc01b[_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];_0x1dc01b[_0x197c('0x1c')]=!![];_0x1dc01b[_0x197c('0x2e')]=utils['now']();_0x1dc01b[_0x197c('0x9')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x21')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x30')]=_0x2a884b['destuniqueid'];_0x1dc01b[_0x197c('0x31')]=_0x2a884b[_0x197c('0x1a')];writeDB(_0x1dc01b);}});}}catch(_0x6d7bda){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][agentconnect]',_0x2a884b[_0x197c('0x4')]),_0x6d7bda);}};exports[_0x197c('0xd')]=function(_0x3b7fc1){try{if(!_[_0x197c('0x1d')](agents[_0x3b7fc1[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1[_0x197c('0x4')]),_0x3b7fc1);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3b7fc1['uniqueid'],agents[_0x3b7fc1['destuniqueid']]['membername'],_0x3b7fc1[_0x197c('0x12')]));agents[_0x3b7fc1[_0x197c('0x12')]]['agentcomplete']=!![];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')]=utils['now']();agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x24')]=utils['diffTime'](agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')],agents[_0x3b7fc1['destuniqueid']][_0x197c('0x2b')]);agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x21')]=_0x3b7fc1['reason'];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x34');writeDB(agents[_0x3b7fc1[_0x197c('0x12')]]);}}catch(_0x53295b){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1['uniqueid']),_0x53295b);}};exports['blindtransfer']=function(_0x3a5089){try{if(!_[_0x197c('0x1d')](agents[_0x3a5089[_0x197c('0x35')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089['uniqueid']),_0x3a5089);utils[_0x197c('0x18')](util['format'](_0x197c('0x37'),_0x3a5089[_0x197c('0x4')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x1a')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')]));agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x38')]=!![];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x39')]=_0x197c('0x3a');agents[_0x3a5089[_0x197c('0x35')]]['transferexten']=_0x3a5089[_0x197c('0x3b')];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x3c')]=agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')];}}catch(_0x22a106){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089[_0x197c('0x4')]),_0x22a106);}};exports['attendedtransfer']=function(_0x3e3176){try{utils[_0x197c('0x14')](util[_0x197c('0x2')]('[%s][agents][attendedtransfer]',_0x3e3176[_0x197c('0x3d')]),_0x3e3176);if(_0x3e3176[_0x197c('0x3d')]==_0x3e3176[_0x197c('0x3e')]){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3f')]])){utils['info'](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3f')]]['transfer']=!![];agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x42')]=_0x3e3176[_0x197c('0x43')];agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x3c')]=_0x3e3176[_0x197c('0x3d')];}if(_0x3e3176[_0x197c('0x44')]&&agents[_0x3e3176['transfereeuniqueid']]){agents[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176['transfereeuniqueid']]=_['clone'](agents[_0x3e3176[_0x197c('0x44')]]);transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x7')]=agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x7')];transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3f')]]['calleridname'];transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x47')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x2b')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x2;}}else if(_0x3e3176[_0x197c('0x3f')]==_0x3e3176['secondtransfererlinkedid']){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3d')]])){utils[_0x197c('0x18')](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x38')]=!![];agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176[_0x197c('0x3d')]]['transferexten']=_0x3e3176[_0x197c('0x48')];agents[_0x3e3176['origtransfereruniqueid']]['transferuniqueid']=_0x3e3176['secondtransfereruniqueid'];}if(_0x3e3176['transfertargetuniqueid']&&agents[_0x3e3176[_0x197c('0x49')]]){agents[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176[_0x197c('0x49')]]=_['clone'](agents[_0x3e3176[_0x197c('0x49')]]);transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x7')]=agents[_0x3e3176['origtransfereruniqueid']][_0x197c('0x7')];transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x46')];transfers[_0x3e3176[_0x197c('0x49')]]['agentcalledAt']=utils[_0x197c('0x20')]();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x2b')]=utils['now']();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x22')]=0x0;transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x2;}}}catch(_0x5596f3){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x4a'),_0x3e3176[_0x197c('0x3d')]),_0x5596f3);}};exports[_0x197c('0x4b')]=function(_0x342efa){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x4c'),_0x342efa[_0x197c('0x4')]),_0x342efa);if(agents[_0x342efa[_0x197c('0x4')]]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]==='timeout'){if(_0x342efa['cause']==='21'){agents[_0x342efa['uniqueid']][_0x197c('0x21')]='rejected';agents[_0x342efa[_0x197c('0x4')]]['lastevent']='rejected';}utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa['uniqueid'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],agents[_0x342efa['uniqueid']][_0x197c('0x21')],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);var _0x54206a=unanswered[_0x197c('0x4e')](_0x342efa['uniqueid']);if(_0x54206a>-0x1){unanswered[_0x197c('0x4f')](_0x54206a,0x1);}}if(transfers[_0x342efa['uniqueid']]){transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0xd')]=!![];transfers[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils[_0x197c('0x20')]();transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils['diffTime'](transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]);transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]='agent';transfers[_0x342efa[_0x197c('0x4')]]['lastevent']='complete';utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x342efa[_0x197c('0x4')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],transfers[_0x342efa['uniqueid']]['lastevent']));writeDB(transfers[_0x342efa['uniqueid']],!![]);}if(agents[_0x342efa['uniqueid']]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]){agents[_0x342efa['uniqueid']]['agentcomplete']=!![];agents[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils['now']();agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils[_0x197c('0x50')](agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],agents[_0x342efa[_0x197c('0x4')]]['agentconnectAt']);agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]=agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x38')]?_0x197c('0x38'):_0x197c('0x51');agents[_0x342efa[_0x197c('0x4')]]['lastevent']=_0x197c('0x34');utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa[_0x197c('0x4')],agents[_0x342efa[_0x197c('0x4')]]['membername'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],agents[_0x342efa['uniqueid']][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);}}catch(_0x173303){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][hangup]',_0x342efa['uniqueid']),_0x173303);}}; \ No newline at end of file +var _0xeb74=['timeout','reason','holdtime','ringtime','talktime','push','error','includes','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','agentcomplete','agentcompleteAt','diffTime','agentconnectAt','complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','calleridnum','calleridname','ATTENDED','transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','lodash','util','./utils','info','format','uniqueid','channel','queue','membername','interface','connectedlinenum','getVoiceQueueByName','type','agentacw','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb74,0xe3));var _0x4eb7=function(_0x51ac45,_0x52f1ec){_0x51ac45=_0x51ac45-0x0;var _0x26c5dc=_0xeb74[_0x51ac45];return _0x26c5dc;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var utils=require(_0x4eb7('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x9b674c,_0x2b5a60){utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x9b674c[_0x4eb7('0x5')],_0x9b674c[_0x4eb7('0x6')],_0x9b674c[_0x4eb7('0x7')],_0x9b674c[_0x4eb7('0x8')],_0x9b674c[_0x4eb7('0x9')],_0x9b674c['calleridnum'],_0x9b674c[_0x4eb7('0xa')],_0x9b674c['lastevent']));if(_0x9b674c[_0x4eb7('0x7')]){utils[_0x4eb7('0xb')](_0x9b674c['queue'])['then'](function(_0xe07330){if(_0xe07330){_0x9b674c[_0x4eb7('0xc')]=_0xe07330['type'];_0x9b674c[_0x4eb7('0xd')]=_0x9b674c['agentcomplete']?_0xe07330[_0x4eb7('0xe')]:![];_0x9b674c[_0x4eb7('0xf')]=_0x9b674c[_0x4eb7('0xd')]?_0xe07330['acwTimeout']:0x0;}utils[_0x4eb7('0x10')](_0x4eb7('0x11'),_0x9b674c);});}else{utils[_0x4eb7('0x10')](_0x4eb7('0x11'),_0x9b674c);}if(_0x2b5a60){delete transfers[_0x9b674c[_0x4eb7('0x5')]];}else{delete agents[_0x9b674c[_0x4eb7('0x12')]];}}exports[_0x4eb7('0x13')]=function(_0x4c27a4){try{utils['debug'](util['format'](_0x4eb7('0x14'),_0x4c27a4['uniqueid']),_0x4c27a4);agents[_0x4c27a4[_0x4eb7('0x12')]]=_0x4c27a4;agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x15')]=utils[_0x4eb7('0x16')]();agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x17')]=_0x4eb7('0x18');agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0xa')]=null;agents[_0x4c27a4[_0x4eb7('0x12')]]['connectedlinename']=null;utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x19'),_0x4c27a4[_0x4eb7('0x5')],agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x4c27a4[_0x4eb7('0x12')]));}catch(_0x16c024){utils['error'](util[_0x4eb7('0x4')](_0x4eb7('0x14'),_0x4c27a4[_0x4eb7('0x5')]),_0x16c024);}};exports[_0x4eb7('0x1a')]=function(_0x32f0f5){try{if(!_[_0x4eb7('0x1b')](agents[_0x32f0f5[_0x4eb7('0x12')]])){utils['debug'](util[_0x4eb7('0x4')](_0x4eb7('0x1c'),_0x32f0f5[_0x4eb7('0x5')]),_0x32f0f5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x1d'),_0x32f0f5[_0x4eb7('0x5')],agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x32f0f5[_0x4eb7('0x12')]));agents[_0x32f0f5['destuniqueid']][_0x4eb7('0x1a')]=!![];agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x17')]=_0x4eb7('0x1f');agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x20')]=_0x4eb7('0x1f');agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x21')]=_0x32f0f5[_0x4eb7('0x22')]?parseInt(_0x32f0f5[_0x4eb7('0x22')])/0x3e8:0x0;agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x23')]=0x0;unanswered[_0x4eb7('0x24')](_0x32f0f5[_0x4eb7('0x12')]);}}catch(_0x33a2c1){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x1c'),_0x32f0f5[_0x4eb7('0x5')]),_0x33a2c1);}};exports['queuecallerabandon']=function(_0x34515c){try{_['forIn'](agents,function(_0x446872,_0x13f71a){if(_0x446872[_0x4eb7('0x5')]==_0x34515c[_0x4eb7('0x5')]&&!_[_0x4eb7('0x26')](unanswered,_0x446872[_0x4eb7('0x12')])){utils[_0x4eb7('0x27')](util[_0x4eb7('0x4')](_0x4eb7('0x28'),_0x34515c['uniqueid']),_0x34515c);utils[_0x4eb7('0x3')](util['format'](_0x4eb7('0x29'),_0x34515c[_0x4eb7('0x5')],_0x446872['membername'],_0x446872['destuniqueid']));_0x446872[_0x4eb7('0x1a')]=!![];_0x446872[_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();_0x446872[_0x4eb7('0x17')]='abandoned';_0x446872[_0x4eb7('0x20')]=_0x4eb7('0x2a');_0x446872[_0x4eb7('0x21')]=_0x34515c[_0x4eb7('0x21')];_0x446872[_0x4eb7('0x23')]=0x0;writeDB(_0x446872);}});}catch(_0x5ab58d){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x28'),_0x34515c['uniqueid']),_0x5ab58d);}};exports[_0x4eb7('0x2b')]=function(_0xe1cc8f){try{if(agents[_0xe1cc8f[_0x4eb7('0x12')]]){utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][agentconnect]',_0xe1cc8f[_0x4eb7('0x5')]),_0xe1cc8f);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x2c'),_0xe1cc8f['uniqueid'],agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0xe1cc8f[_0x4eb7('0x12')]));agents[_0xe1cc8f[_0x4eb7('0x12')]]['agentconnectAt']=utils['now']();agents[_0xe1cc8f['destuniqueid']][_0x4eb7('0xa')]=_0xe1cc8f[_0x4eb7('0xa')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x2d')]=_0xe1cc8f[_0x4eb7('0x2d')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x21')]=_0xe1cc8f[_0x4eb7('0x22')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x17')]='connect';_[_0x4eb7('0x2e')](agents,function(_0x38218f,_0xe04d76){if(_0x38218f[_0x4eb7('0x12')]!=_0xe1cc8f[_0x4eb7('0x12')]&&_0x38218f[_0x4eb7('0x5')]==_0xe1cc8f[_0x4eb7('0x5')]){_0x38218f[_0x4eb7('0x23')]=0x0;_0x38218f[_0x4eb7('0x21')]=_0xe1cc8f[_0x4eb7('0x22')];_0x38218f[_0x4eb7('0x1a')]=!![];_0x38218f[_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();_0x38218f[_0x4eb7('0x17')]=_0x4eb7('0x2f');_0x38218f[_0x4eb7('0x20')]=_0x4eb7('0x2f');_0x38218f[_0x4eb7('0x30')]=_0xe1cc8f[_0x4eb7('0x12')];_0x38218f[_0x4eb7('0x31')]=_0xe1cc8f['membername'];writeDB(_0x38218f);}});}}catch(_0x2fd5c2){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x32'),_0xe1cc8f[_0x4eb7('0x5')]),_0x2fd5c2);}};exports[_0x4eb7('0x33')]=function(_0x3cd9e5){try{if(!_[_0x4eb7('0x1b')](agents[_0x3cd9e5[_0x4eb7('0x12')]])){utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][agentcomplete]',_0x3cd9e5[_0x4eb7('0x5')]),_0x3cd9e5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3cd9e5[_0x4eb7('0x5')],agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x3cd9e5[_0x4eb7('0x12')]));agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x33')]=!![];agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x23')]=utils[_0x4eb7('0x35')](agents[_0x3cd9e5['destuniqueid']]['agentcompleteAt'],agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x36')]);agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x20')]=_0x3cd9e5[_0x4eb7('0x20')];agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x17')]=_0x4eb7('0x37');writeDB(agents[_0x3cd9e5['destuniqueid']]);}}catch(_0x22e09c){utils[_0x4eb7('0x25')](util['format'](_0x4eb7('0x38'),_0x3cd9e5[_0x4eb7('0x5')]),_0x22e09c);}};exports[_0x4eb7('0x39')]=function(_0x5774d5){try{if(!_[_0x4eb7('0x1b')](agents[_0x5774d5['transfereruniqueid']])){utils['debug'](util[_0x4eb7('0x4')](_0x4eb7('0x3a'),_0x5774d5[_0x4eb7('0x5')]),_0x5774d5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x3b'),_0x5774d5[_0x4eb7('0x5')],agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x8')],agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x5')]));agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x3d')]=!![];agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x3e')]=_0x4eb7('0x3f');agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x40')]=_0x5774d5[_0x4eb7('0x41')];agents[_0x5774d5[_0x4eb7('0x3c')]]['transferuniqueid']=agents[_0x5774d5[_0x4eb7('0x3c')]]['uniqueid'];}}catch(_0x4db5f7){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x3a'),_0x5774d5[_0x4eb7('0x5')]),_0x4db5f7);}};exports[_0x4eb7('0x42')]=function(_0x553736){try{utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][attendedtransfer]',_0x553736[_0x4eb7('0x43')]),_0x553736);if(_0x553736[_0x4eb7('0x43')]==_0x553736[_0x4eb7('0x44')]){if(!_[_0x4eb7('0x1b')](agents[_0x553736['secondtransfereruniqueid']])){utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x45'),_0x553736[_0x4eb7('0x43')],agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x8')]));agents[_0x553736[_0x4eb7('0x46')]]['transfer']=!![];agents[_0x553736[_0x4eb7('0x46')]][_0x4eb7('0x3e')]='ATTENDED';agents[_0x553736[_0x4eb7('0x46')]]['transferexten']=_0x553736[_0x4eb7('0x47')];agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x48')]=_0x553736[_0x4eb7('0x43')];}if(_0x553736[_0x4eb7('0x49')]&&agents[_0x553736[_0x4eb7('0x49')]]){agents[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4a')]=0x1;transfers[_0x553736['transfereeuniqueid']]=_['clone'](agents[_0x553736[_0x4eb7('0x49')]]);transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4b')]=agents[_0x553736[_0x4eb7('0x46')]]['calleridnum'];transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4c')]=agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x4c')];transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x15')]=utils[_0x4eb7('0x16')]();transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x36')]=utils[_0x4eb7('0x16')]();transfers[_0x553736['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x553736[_0x4eb7('0x49')]]['agententerreason']=0x2;}}else if(_0x553736[_0x4eb7('0x46')]==_0x553736['secondtransfererlinkedid']){if(!_[_0x4eb7('0x1b')](agents[_0x553736['origtransfereruniqueid']])){utils['info'](util[_0x4eb7('0x4')](_0x4eb7('0x45'),_0x553736['origtransfereruniqueid'],agents[_0x553736[_0x4eb7('0x43')]]['membername']));agents[_0x553736[_0x4eb7('0x43')]][_0x4eb7('0x3d')]=!![];agents[_0x553736['origtransfereruniqueid']][_0x4eb7('0x3e')]=_0x4eb7('0x4d');agents[_0x553736['origtransfereruniqueid']]['transferexten']=_0x553736['secondtransfererexten'];agents[_0x553736['origtransfereruniqueid']][_0x4eb7('0x48')]=_0x553736['secondtransfereruniqueid'];}if(_0x553736[_0x4eb7('0x4e')]&&agents[_0x553736[_0x4eb7('0x4e')]]){agents[_0x553736['transfertargetuniqueid']][_0x4eb7('0x4a')]=0x1;transfers[_0x553736[_0x4eb7('0x4e')]]=_[_0x4eb7('0x4f')](agents[_0x553736[_0x4eb7('0x4e')]]);transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x4b')]=agents[_0x553736['origtransfereruniqueid']]['calleridnum'];transfers[_0x553736['transfertargetuniqueid']][_0x4eb7('0x4c')]=agents[_0x553736[_0x4eb7('0x43')]][_0x4eb7('0x4c')];transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x15')]=utils['now']();transfers[_0x553736['transfertargetuniqueid']][_0x4eb7('0x36')]=utils[_0x4eb7('0x16')]();transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x21')]=0x0;transfers[_0x553736[_0x4eb7('0x4e')]]['agententerreason']=0x2;}}}catch(_0x439861){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x50'),_0x553736['origtransfereruniqueid']),_0x439861);}};exports['hangup']=function(_0x3bcbd1){try{utils[_0x4eb7('0x27')](util['format'](_0x4eb7('0x51'),_0x3bcbd1['uniqueid']),_0x3bcbd1);if(agents[_0x3bcbd1[_0x4eb7('0x5')]]&&agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]===_0x4eb7('0x1f')){if(_0x3bcbd1['cause']==='21'){agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]=_0x4eb7('0x52');agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]=_0x4eb7('0x52');}utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]));writeDB(agents[_0x3bcbd1[_0x4eb7('0x5')]]);var _0x31e6d2=unanswered[_0x4eb7('0x54')](_0x3bcbd1['uniqueid']);if(_0x31e6d2>-0x1){unanswered['splice'](_0x31e6d2,0x1);}}if(transfers[_0x3bcbd1[_0x4eb7('0x5')]]){transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x33')]=!![];transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x23')]=utils['diffTime'](transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')],transfers[_0x3bcbd1[_0x4eb7('0x5')]]['agentconnectAt']);transfers[_0x3bcbd1['uniqueid']][_0x4eb7('0x20')]=_0x4eb7('0x55');transfers[_0x3bcbd1[_0x4eb7('0x5')]]['lastevent']='complete';utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]));writeDB(transfers[_0x3bcbd1[_0x4eb7('0x5')]],!![]);}if(agents[_0x3bcbd1[_0x4eb7('0x5')]]&&agents[_0x3bcbd1['uniqueid']]['agentconnectAt']){agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x33')]=!![];agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();agents[_0x3bcbd1[_0x4eb7('0x5')]]['talktime']=utils['diffTime'](agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x36')]);agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]=agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x3d')]?_0x4eb7('0x3d'):_0x4eb7('0x55');agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]=_0x4eb7('0x37');utils[_0x4eb7('0x3')](util['format'](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],agents[_0x3bcbd1['uniqueid']][_0x4eb7('0x20')],agents[_0x3bcbd1[_0x4eb7('0x5')]]['lastevent']));writeDB(agents[_0x3bcbd1[_0x4eb7('0x5')]]);}}catch(_0x2448a1){utils[_0x4eb7('0x25')](util['format'](_0x4eb7('0x51'),_0x3bcbd1[_0x4eb7('0x5')]),_0x2448a1);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index bf49a5c..310da6c 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 _0x6440=['variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','lastIndexOf','includes','noop','execif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','debug','[%s][calls][newstate]','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','channelstate','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]'];(function(_0xc2c1fa,_0x95160e){var _0x2b6dab=function(_0x74cdab){while(--_0x74cdab){_0xc2c1fa['push'](_0xc2c1fa['shift']());}};_0x2b6dab(++_0x95160e);}(_0x6440,0x1de));var _0x0644=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x6440[_0x207d2f];return _0x3c3498;};'use strict';var _=require(_0x0644('0x0'));var util=require(_0x0644('0x1'));var utils=require('./utils');var transfers=require(_0x0644('0x2'));var dispositions=[_0x0644('0x3'),_0x0644('0x4'),'FAILED',_0x0644('0x3'),_0x0644('0x3'),_0x0644('0x3'),_0x0644('0x5'),_0x0644('0x6'),_0x0644('0x4'),_0x0644('0x4'),_0x0644('0x4')];var channels={};function writeDB(_0x4c13a5){var _0xec9447;if(transfers['blinds'][_0x4c13a5['uniqueid']]){_0xec9447=_0x4c13a5['uniqueid'];_0x4c13a5[_0x0644('0x7')]=transfers[_0x0644('0x8')][_0x4c13a5[_0x0644('0x7')]][_0x0644('0x9')];}utils[_0x0644('0xa')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4c13a5[_0x0644('0x7')],_0x4c13a5[_0x0644('0xb')],_0x4c13a5[_0x0644('0xc')],_0x4c13a5[_0x0644('0xd')],_0x4c13a5[_0x0644('0xe')],_0x4c13a5[_0x0644('0xf')],_0x4c13a5[_0x0644('0x10')],_0x4c13a5[_0x0644('0x11')]));if(_0x4c13a5[_0x0644('0x12')]){utils[_0x0644('0x13')](_0x4c13a5[_0x0644('0x12')])[_0x0644('0x14')](function(_0x4e5d83){if(_0x4e5d83){_0x4c13a5[_0x0644('0x15')]=_0x4e5d83['id'];}utils[_0x0644('0x16')](_0x0644('0x17'),_0x4c13a5);});}else{utils[_0x0644('0x16')](_0x0644('0x17'),_0x4c13a5);}if(channels[_0x4c13a5[_0x0644('0x7')]]){delete channels[_0x4c13a5[_0x0644('0x7')]];}else if(_0xec9447&&channels[_0xec9447]){if(!transfers['blinds'][_0xec9447][_0x0644('0x18')])delete transfers[_0x0644('0x8')][_0xec9447];delete channels[_0xec9447];}}exports[_0x0644('0x19')]=function(_0x45991e){try{utils['debug'](util[_0x0644('0x1a')](_0x0644('0x1b'),_0x45991e[_0x0644('0x7')]),_0x45991e);if(_0x45991e[_0x0644('0x7')]==_0x45991e[_0x0644('0x1c')]&&_0x45991e[_0x0644('0xb')]!=_0x0644('0x1d')){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x1e'),_0x45991e[_0x0644('0x7')],_0x45991e[_0x0644('0x1f')],_0x45991e[_0x0644('0x20')]));channels[_0x45991e[_0x0644('0x7')]]={'uniqueid':_0x45991e[_0x0644('0x7')],'accountcode':_0x45991e[_0x0644('0x12')],'source':_0x45991e[_0x0644('0xf')],'destination':_0x45991e['exten'],'destinationcontext':_0x45991e[_0x0644('0x1f')],'channel':_0x45991e['channel'],'starttime':utils[_0x0644('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x0644('0x3'),'amaflags':_0x0644('0x22')};}}catch(_0x733c72){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x1b'),_0x45991e[_0x0644('0x7')]),_0x733c72);}};exports['newstate']=function(_0x52dec2){try{utils[_0x0644('0x24')](util['format'](_0x0644('0x25'),_0x52dec2[_0x0644('0x7')]),_0x52dec2);if(!_[_0x0644('0x26')](channels[_0x52dec2[_0x0644('0x7')]])&&_0x52dec2['channelstate']==0x6){utils['info'](util[_0x0644('0x1a')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x52dec2[_0x0644('0x7')],_0x52dec2['context'],_0x52dec2[_0x0644('0xb')]));if(_['isNil'](channels[_0x52dec2[_0x0644('0x7')]][_0x0644('0x27')])){channels[_0x52dec2[_0x0644('0x7')]][_0x0644('0x27')]=utils[_0x0644('0x21')]();}}else if(!_[_0x0644('0x26')](channels[_0x52dec2['linkedid']])&&_0x52dec2['channelstate']==0x6&&_0x52dec2[_0x0644('0x1f')]!=_0x0644('0x28')){utils['info'](util[_0x0644('0x1a')](_0x0644('0x29'),_0x52dec2['uniqueid'],_0x52dec2[_0x0644('0x1c')],_0x52dec2[_0x0644('0x1f')],_0x52dec2['channel']));channels[_0x52dec2[_0x0644('0x1c')]][_0x0644('0x12')]=_0x52dec2[_0x0644('0x12')];channels[_0x52dec2[_0x0644('0x1c')]]['destinationchannel']=_0x52dec2[_0x0644('0xb')];if(_[_0x0644('0x26')](channels[_0x52dec2[_0x0644('0x1c')]][_0x0644('0x2a')])){channels[_0x52dec2[_0x0644('0x1c')]]['answertime']=utils['now']();}channels[_0x52dec2[_0x0644('0x1c')]][_0x0644('0x2b')]=dispositions[_[_0x0644('0x2c')](_0x52dec2[_0x0644('0x2d')])]||_0x0644('0x5');}}catch(_0x2b4a38){utils['error'](util[_0x0644('0x1a')]('[%s][calls][newstate]',_0x52dec2['uniqueid']),_0x2b4a38);}};exports[_0x0644('0x2e')]=function(_0x75b7a0){try{if(!_[_0x0644('0x26')](channels[_0x75b7a0['uniqueid']])){utils['debug'](util[_0x0644('0x1a')]('[%s][calls][hangup]',_0x75b7a0[_0x0644('0x7')]),_0x75b7a0);if(_[_0x0644('0x26')](channels[_0x75b7a0['uniqueid']]['callerid'])){channels[_0x75b7a0['uniqueid']][_0x0644('0x2f')]=_0x75b7a0['calleridname']+'\x20<'+_0x75b7a0[_0x0644('0xf')]+'>';}utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x30'),_0x75b7a0[_0x0644('0x7')],channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x2f')],_0x75b7a0[_0x0644('0x31')]));channels[_0x75b7a0['uniqueid']]['endtime']=utils[_0x0644('0x21')]();channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x32')]=utils[_0x0644('0x33')](channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x34')],channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x35')]);channels[_0x75b7a0[_0x0644('0x7')]]['billableseconds']=channels[_0x75b7a0[_0x0644('0x7')]][_0x0644('0x2a')]?utils['diffTime'](channels[_0x75b7a0['uniqueid']][_0x0644('0x34')],channels[_0x75b7a0[_0x0644('0x7')]]['answertime']):0x0;writeDB(channels[_0x75b7a0[_0x0644('0x7')]]);}}catch(_0x3a6403){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x36'),_0x75b7a0[_0x0644('0x7')]),_0x3a6403);}};exports[_0x0644('0x37')]=function(_0x3e8115){try{if(!_['isNil'](channels[_0x3e8115[_0x0644('0x38')]])){utils[_0x0644('0x24')](util['format'](_0x0644('0x39'),_0x3e8115[_0x0644('0x3a')]),_0x3e8115);if(channels[_0x3e8115[_0x0644('0x38')]]['channel']==_0x3e8115[_0x0644('0x3b')]){utils[_0x0644('0xa')](util[_0x0644('0x1a')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3e8115['origtransfereruniqueid'],_0x3e8115[_0x0644('0x38')],_0x3e8115['secondtransfererchannel']));channels[_0x3e8115[_0x0644('0x38')]]['destinationchannel']=_0x3e8115[_0x0644('0x3c')];channels[_0x3e8115[_0x0644('0x38')]][_0x0644('0x3d')]=_0x0644('0x3e');}else if(channels[_0x3e8115[_0x0644('0x38')]][_0x0644('0xb')]=_0x3e8115[_0x0644('0x3f')]){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x40'),_0x3e8115[_0x0644('0x3a')],_0x3e8115['localtwolinkedid'],_0x3e8115['origtransfererchannel']));channels[_0x3e8115[_0x0644('0x38')]][_0x0644('0x41')]=_0x3e8115[_0x0644('0x42')];channels[_0x3e8115[_0x0644('0x38')]][_0x0644('0x3d')]=_0x0644('0x3e');}}}catch(_0x5a82e4){utils['error'](util[_0x0644('0x1a')](_0x0644('0x39'),_0x3e8115['origtransfereruniqueid']),_0x5a82e4);}};exports[_0x0644('0x43')]=function(_0x14aa0d){try{if(!_[_0x0644('0x26')](channels[_0x14aa0d['uniqueid']])){utils[_0x0644('0x24')](util[_0x0644('0x1a')](_0x0644('0x44'),_0x14aa0d[_0x0644('0x7')]),_0x14aa0d);channels[_0x14aa0d[_0x0644('0x7')]]['musiconholdstartAt']=utils[_0x0644('0x21')]();utils[_0x0644('0xa')](util['format'](_0x0644('0x45'),_0x14aa0d[_0x0644('0x7')],channels[_0x14aa0d['uniqueid']]['musiconholdstartAt']));}}catch(_0x4b5b9e){utils['error'](util[_0x0644('0x1a')](_0x0644('0x44'),_0x14aa0d['uniqueid']),_0x4b5b9e);}};exports[_0x0644('0x46')]=function(_0x128c7e){try{if(!_['isNil'](channels[_0x128c7e[_0x0644('0x7')]])){utils['debug'](util[_0x0644('0x1a')](_0x0644('0x47'),_0x128c7e[_0x0644('0x7')]),_0x128c7e);if(!_['isNil'](channels[_0x128c7e[_0x0644('0x7')]][_0x0644('0x48')])){channels[_0x128c7e[_0x0644('0x7')]][_0x0644('0x49')]+=utils[_0x0644('0x33')](utils[_0x0644('0x21')](),channels[_0x128c7e['uniqueid']][_0x0644('0x48')]);utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x4a'),_0x128c7e[_0x0644('0x7')],channels[_0x128c7e[_0x0644('0x7')]]['mohtime']));delete channels[_0x128c7e[_0x0644('0x7')]][_0x0644('0x48')];}}}catch(_0x558cef){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x47'),_0x128c7e['uniqueid']),_0x558cef);}};exports[_0x0644('0x4b')]=function(_0x2096f4){try{if(!_[_0x0644('0x26')](channels[_0x2096f4[_0x0644('0x7')]])){utils['debug'](util['format'](_0x0644('0x4c'),_0x2096f4['uniqueid']),_0x2096f4);if(!_['isNil'](_0x2096f4[_0x0644('0x4d')]['xmd-originatecalleridnum'])){utils['info'](util[_0x0644('0x1a')](_0x0644('0x4e'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]]['source']=_0x2096f4[_0x0644('0x4f')];}if(!_['isNil'](_0x2096f4[_0x0644('0x4d')][_0x0644('0x50')])){utils[_0x0644('0xa')](util['format'](_0x0644('0x51'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x52')]=_0x2096f4[_0x0644('0x4f')];channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x2f')]='\x22'+_0x2096f4[_0x0644('0x4f')]+_0x0644('0x53')+_0x2096f4[_0x0644('0x4f')]+'>';}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')]['xmd-callerid-preview'])||!_['isNil'](_0x2096f4[_0x0644('0x4d')][_0x0644('0x54')])){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x55'),_0x2096f4[_0x0644('0x7')],!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')][_0x0644('0x56')])?_0x0644('0x56'):'xmd-callerid',_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x2f')]=_0x2096f4[_0x0644('0x4f')];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')]['xmd-queue'])||!_[_0x0644('0x26')](_0x2096f4['variable']['xmcs-queue'])){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x55'),_0x2096f4[_0x0644('0x7')],!_['isNil'](_0x2096f4['variable'][_0x0644('0x57')])?'xmd-queue':_0x0644('0x58'),_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]]['lastapplication']=_0x0644('0x59');channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x5a')]=_0x2096f4[_0x0644('0x4f')];channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0xc')]=!![];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')]['xmd-contactid'])){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x5b'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]]['ContactId']=_0x2096f4[_0x0644('0x4f')];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')][_0x0644('0x5c')])){utils['info'](util[_0x0644('0x1a')](_0x0644('0x5d'),_0x2096f4['uniqueid'],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4['uniqueid']]['type']=_0x2096f4[_0x0644('0x4f')];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')][_0x0644('0x5e')])){utils[_0x0644('0xa')](util['format'](_0x0644('0x5f'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]][_0x0644('0x60')]=_0x2096f4[_0x0644('0x4f')];}if(!_[_0x0644('0x26')](_0x2096f4[_0x0644('0x4d')][_0x0644('0x61')])){utils[_0x0644('0xa')](util[_0x0644('0x1a')](_0x0644('0x62'),_0x2096f4[_0x0644('0x7')],_0x2096f4[_0x0644('0x4f')]));channels[_0x2096f4[_0x0644('0x7')]]['sipcallid']=_0x2096f4[_0x0644('0x4f')];}}}catch(_0x1a9adf){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x4c'),_0x2096f4[_0x0644('0x7')]),_0x1a9adf);}};exports[_0x0644('0x63')]=function(_0x4639f7){try{if(!_[_0x0644('0x26')](channels[_0x4639f7[_0x0644('0x7')]])){utils[_0x0644('0x24')](util[_0x0644('0x1a')](_0x0644('0x64'),_0x4639f7[_0x0644('0x7')]),_0x4639f7);utils[_0x0644('0xa')](util['format'](_0x0644('0x65'),_0x4639f7[_0x0644('0x7')],_0x4639f7[_0x0644('0x66')],_0x4639f7[_0x0644('0x67')]));if(_0x4639f7['application']['toLowerCase']()==_0x0644('0x68')&&_['startsWith'](_0x4639f7[_0x0644('0x67')][_0x0644('0x69')](),'cdr')){var _0x3e5b8c=_0x4639f7[_0x0644('0x67')][_0x0644('0x6a')]('=');var _0x2259d1=_0x3e5b8c[0x0]['substring'](_0x3e5b8c[0x0][_0x0644('0x6b')]('(')+0x1,_0x3e5b8c[0x0]['lastIndexOf'](')'));var _0x12c9dd=_0x3e5b8c[0x1];channels[_0x4639f7['uniqueid']][_0x2259d1]=_0x12c9dd;}if(!_[_0x0644('0x6c')](['hangup',_0x0644('0x6d'),_0x0644('0x6e'),_0x0644('0x68'),'gotoif'],_0x4639f7[_0x0644('0x66')]['toLowerCase']())){channels[_0x4639f7['uniqueid']]['lastapplication']=_0x4639f7[_0x0644('0x66')];channels[_0x4639f7[_0x0644('0x7')]]['lastdata']=_0x4639f7[_0x0644('0x67')];}}}catch(_0x211b79){utils[_0x0644('0x23')](util[_0x0644('0x1a')](_0x0644('0x64'),_0x4639f7[_0x0644('0x7')]),_0x211b79);}}; \ No newline at end of file +var _0x0c23=['./transfers.controller','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','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','isNil','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%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','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','gotoif','application','lodash','util','./utils'];(function(_0x1f8d28,_0x164423){var _0x236aab=function(_0x2e172f){while(--_0x2e172f){_0x1f8d28['push'](_0x1f8d28['shift']());}};_0x236aab(++_0x164423);}(_0x0c23,0x13e));var _0x30c2=function(_0x4a4114,_0x23d508){_0x4a4114=_0x4a4114-0x0;var _0x1f20f8=_0x0c23[_0x4a4114];return _0x1f20f8;};'use strict';var _=require(_0x30c2('0x0'));var util=require(_0x30c2('0x1'));var utils=require(_0x30c2('0x2'));var transfers=require(_0x30c2('0x3'));var dispositions=[_0x30c2('0x4'),_0x30c2('0x5'),_0x30c2('0x5'),'NO\x20ANSWER',_0x30c2('0x4'),_0x30c2('0x4'),_0x30c2('0x6'),_0x30c2('0x7'),_0x30c2('0x5'),_0x30c2('0x5'),'FAILED'];var channels={};function writeDB(_0x406fd0){var _0x41b74d;if(transfers[_0x30c2('0x8')][_0x406fd0[_0x30c2('0x9')]]){_0x41b74d=_0x406fd0[_0x30c2('0x9')];_0x406fd0['uniqueid']=transfers[_0x30c2('0x8')][_0x406fd0[_0x30c2('0x9')]]['transfereeuniqueid'];}utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0xc'),_0x406fd0[_0x30c2('0x9')],_0x406fd0[_0x30c2('0xd')],_0x406fd0[_0x30c2('0xe')],_0x406fd0['membername'],_0x406fd0['interface'],_0x406fd0['calleridnum'],_0x406fd0[_0x30c2('0xf')],_0x406fd0[_0x30c2('0x10')]));if(_0x406fd0[_0x30c2('0x11')]){utils[_0x30c2('0x12')](_0x406fd0[_0x30c2('0x11')])[_0x30c2('0x13')](function(_0x2712dc){if(_0x2712dc){_0x406fd0['UserId']=_0x2712dc['id'];}utils[_0x30c2('0x14')](_0x30c2('0x15'),_0x406fd0);});}else{utils['request'](_0x30c2('0x15'),_0x406fd0);}if(channels[_0x406fd0[_0x30c2('0x9')]]){delete channels[_0x406fd0[_0x30c2('0x9')]];}else if(_0x41b74d&&channels[_0x41b74d]){if(!transfers[_0x30c2('0x8')][_0x41b74d][_0x30c2('0x16')])delete transfers[_0x30c2('0x8')][_0x41b74d];delete channels[_0x41b74d];}}exports[_0x30c2('0x17')]=function(_0x271d10){try{utils[_0x30c2('0x18')](util[_0x30c2('0xb')](_0x30c2('0x19'),_0x271d10[_0x30c2('0x9')]),_0x271d10);if(_0x271d10['uniqueid']==_0x271d10[_0x30c2('0x1a')]&&_0x271d10['channel']!='OutgoingSpoolFailed'){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x1b'),_0x271d10['uniqueid'],_0x271d10[_0x30c2('0x1c')],_0x271d10[_0x30c2('0x1d')]));channels[_0x271d10[_0x30c2('0x9')]]={'uniqueid':_0x271d10[_0x30c2('0x9')],'accountcode':_0x271d10[_0x30c2('0x11')],'source':_0x271d10[_0x30c2('0x1e')],'destination':_0x271d10[_0x30c2('0x1d')],'destinationcontext':_0x271d10[_0x30c2('0x1c')],'channel':_0x271d10['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x30c2('0x4'),'amaflags':_0x30c2('0x1f')};}}catch(_0x55d4e1){utils[_0x30c2('0x20')](util[_0x30c2('0xb')]('[%s][calls][newchannel]',_0x271d10[_0x30c2('0x9')]),_0x55d4e1);}};exports[_0x30c2('0x21')]=function(_0x1a11b1){try{utils['debug'](util[_0x30c2('0xb')](_0x30c2('0x22'),_0x1a11b1[_0x30c2('0x9')]),_0x1a11b1);if(!_['isNil'](channels[_0x1a11b1[_0x30c2('0x9')]])&&_0x1a11b1[_0x30c2('0x23')]==0x6){utils[_0x30c2('0xa')](util['format'](_0x30c2('0x24'),_0x1a11b1[_0x30c2('0x9')],_0x1a11b1[_0x30c2('0x1c')],_0x1a11b1[_0x30c2('0xd')]));if(_['isNil'](channels[_0x1a11b1['uniqueid']][_0x30c2('0x25')])){channels[_0x1a11b1['uniqueid']][_0x30c2('0x25')]=utils[_0x30c2('0x26')]();}}else if(!_[_0x30c2('0x27')](channels[_0x1a11b1['linkedid']])&&_0x1a11b1[_0x30c2('0x23')]==0x6&&_0x1a11b1[_0x30c2('0x1c')]!='transfer'){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x28'),_0x1a11b1[_0x30c2('0x9')],_0x1a11b1[_0x30c2('0x1a')],_0x1a11b1[_0x30c2('0x1c')],_0x1a11b1[_0x30c2('0xd')]));channels[_0x1a11b1[_0x30c2('0x1a')]][_0x30c2('0x11')]=_0x1a11b1[_0x30c2('0x11')];channels[_0x1a11b1[_0x30c2('0x1a')]][_0x30c2('0x29')]=_0x1a11b1[_0x30c2('0xd')];if(_[_0x30c2('0x27')](channels[_0x1a11b1[_0x30c2('0x1a')]][_0x30c2('0x2a')])){channels[_0x1a11b1[_0x30c2('0x1a')]]['answertime']=utils['now']();}channels[_0x1a11b1[_0x30c2('0x1a')]]['disposition']=dispositions[_['toNumber'](_0x1a11b1[_0x30c2('0x23')])]||_0x30c2('0x6');}}catch(_0x4f9ee4){utils['error'](util[_0x30c2('0xb')](_0x30c2('0x22'),_0x1a11b1[_0x30c2('0x9')]),_0x4f9ee4);}};exports[_0x30c2('0x2b')]=function(_0x3aa7af){try{if(!_[_0x30c2('0x27')](channels[_0x3aa7af[_0x30c2('0x9')]])){utils['debug'](util[_0x30c2('0xb')](_0x30c2('0x2c'),_0x3aa7af[_0x30c2('0x9')]),_0x3aa7af);if(_['isNil'](channels[_0x3aa7af['uniqueid']][_0x30c2('0x2d')])){channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x2d')]=_0x3aa7af[_0x30c2('0x2e')]+'\x20<'+_0x3aa7af[_0x30c2('0x1e')]+'>';}utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x2f'),_0x3aa7af[_0x30c2('0x9')],channels[_0x3aa7af[_0x30c2('0x9')]]['callerid'],_0x3aa7af[_0x30c2('0x30')]));channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x31')]=utils[_0x30c2('0x26')]();channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x32')]=utils[_0x30c2('0x33')](channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x31')],channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x34')]);channels[_0x3aa7af['uniqueid']][_0x30c2('0x35')]=channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x2a')]?utils[_0x30c2('0x33')](channels[_0x3aa7af[_0x30c2('0x9')]][_0x30c2('0x31')],channels[_0x3aa7af['uniqueid']][_0x30c2('0x2a')]):0x0;writeDB(channels[_0x3aa7af[_0x30c2('0x9')]]);}}catch(_0x2d2af6){utils[_0x30c2('0x20')](util[_0x30c2('0xb')]('[%s][calls][hangup]',_0x3aa7af[_0x30c2('0x9')]),_0x2d2af6);}};exports[_0x30c2('0x36')]=function(_0x5388c7){try{if(!_[_0x30c2('0x27')](channels[_0x5388c7[_0x30c2('0x37')]])){utils['debug'](util[_0x30c2('0xb')]('[%s][calls][attendedtransfer]',_0x5388c7[_0x30c2('0x38')]),_0x5388c7);if(channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0xd')]==_0x5388c7[_0x30c2('0x39')]){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x3a'),_0x5388c7[_0x30c2('0x38')],_0x5388c7[_0x30c2('0x37')],_0x5388c7[_0x30c2('0x3b')]));channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0x29')]=_0x5388c7[_0x30c2('0x3b')];channels[_0x5388c7['localtwolinkedid']][_0x30c2('0x3c')]=_0x30c2('0x3d');}else if(channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0xd')]=_0x5388c7[_0x30c2('0x3e')]){utils[_0x30c2('0xa')](util[_0x30c2('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5388c7[_0x30c2('0x38')],_0x5388c7[_0x30c2('0x37')],_0x5388c7[_0x30c2('0x3f')]));channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0x29')]=_0x5388c7['origtransfererchannel'];channels[_0x5388c7[_0x30c2('0x37')]][_0x30c2('0x3c')]=_0x30c2('0x3d');}}}catch(_0x240918){utils[_0x30c2('0x20')](util[_0x30c2('0xb')](_0x30c2('0x40'),_0x5388c7['origtransfereruniqueid']),_0x240918);}};exports[_0x30c2('0x41')]=function(_0x3fa210){try{if(!_['isNil'](channels[_0x3fa210[_0x30c2('0x9')]])){utils[_0x30c2('0x18')](util[_0x30c2('0xb')](_0x30c2('0x42'),_0x3fa210[_0x30c2('0x9')]),_0x3fa210);channels[_0x3fa210[_0x30c2('0x9')]][_0x30c2('0x43')]=utils[_0x30c2('0x26')]();utils[_0x30c2('0xa')](util[_0x30c2('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3fa210['uniqueid'],channels[_0x3fa210['uniqueid']][_0x30c2('0x43')]));}}catch(_0xc8efc5){utils[_0x30c2('0x20')](util[_0x30c2('0xb')](_0x30c2('0x42'),_0x3fa210['uniqueid']),_0xc8efc5);}};exports['musiconholdstop']=function(_0x38212e){try{if(!_[_0x30c2('0x27')](channels[_0x38212e['uniqueid']])){utils[_0x30c2('0x18')](util['format'](_0x30c2('0x44'),_0x38212e[_0x30c2('0x9')]),_0x38212e);if(!_[_0x30c2('0x27')](channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x43')])){channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x45')]+=utils[_0x30c2('0x33')](utils['now'](),channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x43')]);utils[_0x30c2('0xa')](util['format'](_0x30c2('0x46'),_0x38212e['uniqueid'],channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x45')]));delete channels[_0x38212e[_0x30c2('0x9')]][_0x30c2('0x43')];}}}catch(_0x5f1d52){utils['error'](util[_0x30c2('0xb')](_0x30c2('0x44'),_0x38212e[_0x30c2('0x9')]),_0x5f1d52);}};exports[_0x30c2('0x47')]=function(_0x449c29){try{if(!_[_0x30c2('0x27')](channels[_0x449c29[_0x30c2('0x9')]])){utils[_0x30c2('0x18')](util['format'](_0x30c2('0x48'),_0x449c29[_0x30c2('0x9')]),_0x449c29);if(!_['isNil'](_0x449c29[_0x30c2('0x49')]['xmd-originatecalleridnum'])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x4a'),_0x449c29[_0x30c2('0x9')],_0x449c29['value']));channels[_0x449c29['uniqueid']]['source']=_0x449c29[_0x30c2('0x4b')];}if(!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')][_0x30c2('0x4c')])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x4d'),_0x449c29['uniqueid'],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]]['destination']=_0x449c29[_0x30c2('0x4b')];channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x2d')]='\x22'+_0x449c29[_0x30c2('0x4b')]+_0x30c2('0x4e')+_0x449c29[_0x30c2('0x4b')]+'>';}if(!_['isNil'](_0x449c29[_0x30c2('0x49')][_0x30c2('0x4f')])||!_['isNil'](_0x449c29[_0x30c2('0x49')]['xmd-callerid'])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x50'),_0x449c29['uniqueid'],!_['isNil'](_0x449c29[_0x30c2('0x49')]['xmd-callerid-preview'])?'xmd-callerid-preview':'xmd-callerid',_0x449c29['value']));channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x2d')]=_0x449c29[_0x30c2('0x4b')];}if(!_[_0x30c2('0x27')](_0x449c29['variable'][_0x30c2('0x51')])||!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')]['xmcs-queue'])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x449c29[_0x30c2('0x9')],!_['isNil'](_0x449c29[_0x30c2('0x49')][_0x30c2('0x51')])?_0x30c2('0x51'):_0x30c2('0x52'),_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x53')]=_0x30c2('0x54');channels[_0x449c29['uniqueid']][_0x30c2('0x55')]=_0x449c29[_0x30c2('0x4b')];channels[_0x449c29['uniqueid']]['queue']=!![];}if(!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')]['xmd-contactid'])){utils['info'](util['format'](_0x30c2('0x56'),_0x449c29[_0x30c2('0x9')],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]]['ContactId']=_0x449c29['value'];}if(!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')]['xmd-cdrtype'])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x57'),_0x449c29[_0x30c2('0x9')],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29['uniqueid']][_0x30c2('0x58')]=_0x449c29[_0x30c2('0x4b')];}if(!_[_0x30c2('0x27')](_0x449c29[_0x30c2('0x49')][_0x30c2('0x59')])){utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x5a'),_0x449c29[_0x30c2('0x9')],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x5b')]=_0x449c29['value'];}if(!_['isNil'](_0x449c29[_0x30c2('0x49')][_0x30c2('0x5c')])){utils[_0x30c2('0xa')](util['format'](_0x30c2('0x5d'),_0x449c29['uniqueid'],_0x449c29[_0x30c2('0x4b')]));channels[_0x449c29[_0x30c2('0x9')]][_0x30c2('0x5c')]=_0x449c29[_0x30c2('0x4b')];}}}catch(_0x254354){utils[_0x30c2('0x20')](util['format']('[%s][calls][varset]',_0x449c29[_0x30c2('0x9')]),_0x254354);}};exports[_0x30c2('0x5e')]=function(_0x13f444){try{if(!_[_0x30c2('0x27')](channels[_0x13f444[_0x30c2('0x9')]])){utils[_0x30c2('0x18')](util[_0x30c2('0xb')](_0x30c2('0x5f'),_0x13f444[_0x30c2('0x9')]),_0x13f444);utils[_0x30c2('0xa')](util[_0x30c2('0xb')](_0x30c2('0x60'),_0x13f444['uniqueid'],_0x13f444['application'],_0x13f444[_0x30c2('0x61')]));if(_0x13f444['application'][_0x30c2('0x62')]()==_0x30c2('0x63')&&_[_0x30c2('0x64')](_0x13f444[_0x30c2('0x61')][_0x30c2('0x62')](),_0x30c2('0x65'))){var _0x1de6f4=_0x13f444[_0x30c2('0x61')]['split']('=');var _0x233c89=_0x1de6f4[0x0][_0x30c2('0x66')](_0x1de6f4[0x0]['lastIndexOf']('(')+0x1,_0x1de6f4[0x0][_0x30c2('0x67')](')'));var _0x19eec2=_0x1de6f4[0x1];channels[_0x13f444['uniqueid']][_0x233c89]=_0x19eec2;}if(!_[_0x30c2('0x68')]([_0x30c2('0x2b'),'noop','execif',_0x30c2('0x63'),_0x30c2('0x69')],_0x13f444[_0x30c2('0x6a')][_0x30c2('0x62')]())){channels[_0x13f444['uniqueid']]['lastapplication']=_0x13f444[_0x30c2('0x6a')];channels[_0x13f444[_0x30c2('0x9')]][_0x30c2('0x55')]=_0x13f444[_0x30c2('0x61')];}}}catch(_0xa81df3){utils[_0x30c2('0x20')](util['format'](_0x30c2('0x5f'),_0x13f444['uniqueid']),_0xa81df3);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 45dcc58..f463d55 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 _0x56a9=['info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils','connect'];(function(_0x1c3c59,_0x5f251a){var _0x1100b7=function(_0x1cf80c){while(--_0x1cf80c){_0x1c3c59['push'](_0x1c3c59['shift']());}};_0x1100b7(++_0x5f251a);}(_0x56a9,0x1b6));var _0x956a=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0x56a9[_0x1034ee];return _0x2922af;};'use strict';var utils=require(_0x956a('0x0'));exports[_0x956a('0x1')]=function(){utils[_0x956a('0x2')](_0x956a('0x3'));};exports[_0x956a('0x4')]=function(){utils[_0x956a('0x2')]('[core]\x20shutdown');};exports[_0x956a('0x5')]=function(){utils[_0x956a('0x2')](_0x956a('0x6'));};exports['error']=function(_0x1d5fa1){utils[_0x956a('0x7')]('[core]\x20error',_0x1d5fa1);};exports[_0x956a('0x8')]=function(){utils[_0x956a('0x2')](_0x956a('0x9'));};exports[_0x956a('0xa')]=function(_0x18d2e3){}; \ No newline at end of file +var _0x8b88=['[core]\x20close','managerevent','./utils','connect','info','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8b88,0xf4));var _0x88b8=function(_0x5c00dd,_0x4a36ad){_0x5c00dd=_0x5c00dd-0x0;var _0x1854aa=_0x8b88[_0x5c00dd];return _0x1854aa;};'use strict';var utils=require(_0x88b8('0x0'));exports[_0x88b8('0x1')]=function(){utils[_0x88b8('0x2')]('[core]\x20connected');};exports[_0x88b8('0x3')]=function(){utils['info'](_0x88b8('0x4'));};exports['fullybooted']=function(){utils[_0x88b8('0x2')](_0x88b8('0x5'));};exports[_0x88b8('0x6')]=function(_0x14a8f5){utils[_0x88b8('0x6')](_0x88b8('0x7'),_0x14a8f5);};exports[_0x88b8('0x8')]=function(){utils[_0x88b8('0x2')](_0x88b8('0x9'));};exports[_0x88b8('0xa')]=function(_0x14d8cd){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index fbf4a6c..e43c9d0 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 _0xa201=['[%s][dials][dialend]','dialstatus','ANSWER','assign','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','diffTime','lodash','util','./utils','info','format','dialstring','calleridnum','connectedlinenum','request','newexten','debug','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend'];(function(_0x503081,_0x172df1){var _0x214b13=function(_0x24baaf){while(--_0x24baaf){_0x503081['push'](_0x503081['shift']());}};_0x214b13(++_0x172df1);}(_0xa201,0xfe));var _0x1a20=function(_0x40ec8b,_0x447ec4){_0x40ec8b=_0x40ec8b-0x0;var _0x313650=_0xa201[_0x40ec8b];return _0x313650;};'use strict';var _=require(_0x1a20('0x0'));var util=require(_0x1a20('0x1'));var utils=require(_0x1a20('0x2'));var dials={};function writeDB(_0x1fc773){utils[_0x1a20('0x3')](util[_0x1a20('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1fc773['uniqueid'],_0x1fc773['channel'],_0x1fc773[_0x1a20('0x5')],_0x1fc773[_0x1a20('0x6')],_0x1fc773[_0x1a20('0x7')],_0x1fc773['dialstatus']));utils[_0x1a20('0x8')]('CreateVoiceDialReport',_0x1fc773);delete dials[_0x1fc773['uniqueid']];}exports[_0x1a20('0x9')]=function(_0x3640ba){try{utils[_0x1a20('0xa')](util[_0x1a20('0x4')](_0x1a20('0xb'),_0x3640ba[_0x1a20('0xc')]),_0x3640ba);utils['info'](util[_0x1a20('0x4')](_0x1a20('0xd'),_0x3640ba[_0x1a20('0xc')],_0x3640ba[_0x1a20('0xe')],_0x3640ba['appdata']));if(_0x3640ba[_0x1a20('0xe')][_0x1a20('0xf')]()==_0x1a20('0x10')&&_[_0x1a20('0x11')](_0x3640ba['appdata'][_0x1a20('0xf')](),'cdr(routeid)')){var _0x1c3e3b=_0x3640ba[_0x1a20('0x12')][_0x1a20('0x13')]('=');dials[_0x3640ba['uniqueid']]={'routeId':_0x1c3e3b[0x1]};}}catch(_0xbce1e1){utils[_0x1a20('0x14')](util[_0x1a20('0x4')]('[%s][dials][newexten]',_0x3640ba['uniqueid']),_0xbce1e1);}};exports[_0x1a20('0x15')]=function(_0x1584be){try{utils[_0x1a20('0xa')](util[_0x1a20('0x4')](_0x1a20('0x16'),_0x1584be['uniqueid']),_0x1584be);if(!_[_0x1a20('0x17')](_0x1584be[_0x1a20('0x18')][_0x1a20('0x19')])){utils['info'](util[_0x1a20('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x1584be[_0x1a20('0xc')],_0x1584be[_0x1a20('0x1a')]));dials[_0x1584be[_0x1a20('0xc')]]={'routeId':_0x1584be[_0x1a20('0x1a')]};}}catch(_0x59eca6){utils['error'](util[_0x1a20('0x4')](_0x1a20('0x16'),_0x1584be[_0x1a20('0xc')]),_0x59eca6);}};exports[_0x1a20('0x1b')]=function(_0x109b69){try{if(!_[_0x1a20('0x17')](dials[_0x109b69[_0x1a20('0xc')]])){utils['debug'](util[_0x1a20('0x4')](_0x1a20('0x1c'),_0x109b69[_0x1a20('0xc')]),_0x109b69);dials[_0x109b69[_0x1a20('0xc')]]=_['assign'](dials[_0x109b69[_0x1a20('0xc')]],_0x109b69);dials[_0x109b69['uniqueid']][_0x1a20('0x1d')]=utils[_0x1a20('0x1e')]();dials[_0x109b69[_0x1a20('0xc')]][_0x1a20('0x1f')]='called';utils[_0x1a20('0x3')](util[_0x1a20('0x4')](_0x1a20('0x20'),_0x109b69['uniqueid'],dials[_0x109b69['uniqueid']][_0x1a20('0x1d')]));}}catch(_0x1bfb66){utils['error'](util['format']('[%s][dials][dialbegin]',_0x109b69[_0x1a20('0xc')]),_0x1bfb66);}};exports[_0x1a20('0x21')]=function(_0x214760){try{if(!_[_0x1a20('0x17')](dials[_0x214760[_0x1a20('0xc')]])){utils[_0x1a20('0xa')](util['format'](_0x1a20('0x22'),_0x214760[_0x1a20('0xc')]),_0x214760);dials[_0x214760[_0x1a20('0xc')]][_0x1a20('0x23')]=_0x214760[_0x1a20('0x23')];if(_0x214760['dialstatus']==_0x1a20('0x24')){dials[_0x214760['uniqueid']]=_[_0x1a20('0x25')](dials[_0x214760[_0x1a20('0xc')]],_0x214760);dials[_0x214760[_0x1a20('0xc')]][_0x1a20('0x26')]=utils[_0x1a20('0x1e')]();dials[_0x214760[_0x1a20('0xc')]][_0x1a20('0x1f')]='connect';utils['info'](util[_0x1a20('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x214760[_0x1a20('0xc')],_0x214760[_0x1a20('0x23')],dials[_0x214760[_0x1a20('0xc')]][_0x1a20('0x26')]));}else{utils[_0x1a20('0x3')](util[_0x1a20('0x4')](_0x1a20('0x27'),_0x214760[_0x1a20('0xc')],_0x214760['dialstatus']));}}}catch(_0x5526bc){utils[_0x1a20('0x14')](util[_0x1a20('0x4')](_0x1a20('0x22'),_0x214760['uniqueid']),_0x5526bc);}};exports[_0x1a20('0x28')]=function(_0x9c4cfe){try{if(!_[_0x1a20('0x17')](dials[_0x9c4cfe['uniqueid']])){utils[_0x1a20('0xa')](util[_0x1a20('0x4')](_0x1a20('0x29'),_0x9c4cfe[_0x1a20('0xc')]),_0x9c4cfe);utils['info'](util[_0x1a20('0x4')](_0x1a20('0x2a'),_0x9c4cfe[_0x1a20('0xc')],_0x9c4cfe[_0x1a20('0x6')],_0x9c4cfe[_0x1a20('0x2b')],_0x9c4cfe['cause-txt']));dials[_0x9c4cfe[_0x1a20('0xc')]]=_[_0x1a20('0x25')](dials[_0x9c4cfe['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x1a20('0x2c')});dials[_0x9c4cfe[_0x1a20('0xc')]][_0x1a20('0x2d')]=utils['diffTime'](dials[_0x9c4cfe['uniqueid']][_0x1a20('0x2e')],dials[_0x9c4cfe[_0x1a20('0xc')]]['starttime']);dials[_0x9c4cfe['uniqueid']]['holdtime']=utils[_0x1a20('0x2f')](dials[_0x9c4cfe[_0x1a20('0xc')]][_0x1a20('0x26')]||dials[_0x9c4cfe['uniqueid']][_0x1a20('0x2e')],dials[_0x9c4cfe['uniqueid']][_0x1a20('0x1d')]);dials[_0x9c4cfe[_0x1a20('0xc')]]['billableseconds']=dials[_0x9c4cfe[_0x1a20('0xc')]][_0x1a20('0x26')]?utils[_0x1a20('0x2f')](dials[_0x9c4cfe[_0x1a20('0xc')]][_0x1a20('0x2e')],dials[_0x9c4cfe['uniqueid']][_0x1a20('0x26')]):0x0;writeDB(dials[_0x9c4cfe[_0x1a20('0xc')]]);}}catch(_0x4d5d03){utils['error'](util[_0x1a20('0x4')](_0x1a20('0x29'),_0x9c4cfe[_0x1a20('0xc')]),_0x4d5d03);}}; \ No newline at end of file +var _0x8c9e=['hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','duration','endtime','holdtime','diffTime','billableseconds','util','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','connectedlinenum','request','CreateVoiceDialReport','uniqueid','debug','[%s][dials][newexten]','info','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','dialbegin','isNil','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s'];(function(_0x13ba44,_0x506be8){var _0x1f7532=function(_0xcce50a){while(--_0xcce50a){_0x13ba44['push'](_0x13ba44['shift']());}};_0x1f7532(++_0x506be8);}(_0x8c9e,0x1a2));var _0xe8c9=function(_0x3dab54,_0x17ae72){_0x3dab54=_0x3dab54-0x0;var _0x144d02=_0x8c9e[_0x3dab54];return _0x144d02;};'use strict';var _=require('lodash');var util=require(_0xe8c9('0x0'));var utils=require(_0xe8c9('0x1'));var dials={};function writeDB(_0x423785){utils['info'](util['format'](_0xe8c9('0x2'),_0x423785['uniqueid'],_0x423785[_0xe8c9('0x3')],_0x423785[_0xe8c9('0x4')],_0x423785['calleridnum'],_0x423785[_0xe8c9('0x5')],_0x423785['dialstatus']));utils[_0xe8c9('0x6')](_0xe8c9('0x7'),_0x423785);delete dials[_0x423785[_0xe8c9('0x8')]];}exports['newexten']=function(_0x2914ed){try{utils[_0xe8c9('0x9')](util['format'](_0xe8c9('0xa'),_0x2914ed['uniqueid']),_0x2914ed);utils[_0xe8c9('0xb')](util[_0xe8c9('0xc')](_0xe8c9('0xd'),_0x2914ed['uniqueid'],_0x2914ed[_0xe8c9('0xe')],_0x2914ed[_0xe8c9('0xf')]));if(_0x2914ed[_0xe8c9('0xe')][_0xe8c9('0x10')]()==_0xe8c9('0x11')&&_[_0xe8c9('0x12')](_0x2914ed['appdata'][_0xe8c9('0x10')](),'cdr(routeid)')){var _0x5c1038=_0x2914ed[_0xe8c9('0xf')]['split']('=');dials[_0x2914ed[_0xe8c9('0x8')]]={'routeId':_0x5c1038[0x1]};}}catch(_0x53bac6){utils['error'](util[_0xe8c9('0xc')](_0xe8c9('0xa'),_0x2914ed[_0xe8c9('0x8')]),_0x53bac6);}};exports['varset']=function(_0x27095b){try{utils[_0xe8c9('0x9')](util['format']('[%s][dials][varset]',_0x27095b['uniqueid']),_0x27095b);if(!_['isNil'](_0x27095b[_0xe8c9('0x13')][_0xe8c9('0x14')])){utils['info'](util[_0xe8c9('0xc')](_0xe8c9('0x15'),_0x27095b['uniqueid'],_0x27095b[_0xe8c9('0x16')]));dials[_0x27095b[_0xe8c9('0x8')]]={'routeId':_0x27095b[_0xe8c9('0x16')]};}}catch(_0x17ed42){utils[_0xe8c9('0x17')](util[_0xe8c9('0xc')](_0xe8c9('0x18'),_0x27095b['uniqueid']),_0x17ed42);}};exports[_0xe8c9('0x19')]=function(_0x1e483d){try{if(!_[_0xe8c9('0x1a')](dials[_0x1e483d[_0xe8c9('0x8')]])){utils['debug'](util[_0xe8c9('0xc')]('[%s][dials][dialbegin]',_0x1e483d['uniqueid']),_0x1e483d);dials[_0x1e483d['uniqueid']]=_[_0xe8c9('0x1b')](dials[_0x1e483d[_0xe8c9('0x8')]],_0x1e483d);dials[_0x1e483d[_0xe8c9('0x8')]][_0xe8c9('0x1c')]=utils[_0xe8c9('0x1d')]();dials[_0x1e483d[_0xe8c9('0x8')]][_0xe8c9('0x1e')]=_0xe8c9('0x1f');utils['info'](util[_0xe8c9('0xc')](_0xe8c9('0x20'),_0x1e483d['uniqueid'],dials[_0x1e483d[_0xe8c9('0x8')]]['starttime']));}}catch(_0x52c12){utils[_0xe8c9('0x17')](util[_0xe8c9('0xc')](_0xe8c9('0x21'),_0x1e483d['uniqueid']),_0x52c12);}};exports[_0xe8c9('0x22')]=function(_0x3420ed){try{if(!_[_0xe8c9('0x1a')](dials[_0x3420ed[_0xe8c9('0x8')]])){utils[_0xe8c9('0x9')](util['format']('[%s][dials][dialend]',_0x3420ed[_0xe8c9('0x8')]),_0x3420ed);dials[_0x3420ed['uniqueid']][_0xe8c9('0x23')]=_0x3420ed[_0xe8c9('0x23')];if(_0x3420ed[_0xe8c9('0x23')]==_0xe8c9('0x24')){dials[_0x3420ed[_0xe8c9('0x8')]]=_[_0xe8c9('0x1b')](dials[_0x3420ed['uniqueid']],_0x3420ed);dials[_0x3420ed[_0xe8c9('0x8')]][_0xe8c9('0x25')]=utils[_0xe8c9('0x1d')]();dials[_0x3420ed['uniqueid']]['lastevent']=_0xe8c9('0x26');utils[_0xe8c9('0xb')](util[_0xe8c9('0xc')](_0xe8c9('0x27'),_0x3420ed[_0xe8c9('0x8')],_0x3420ed[_0xe8c9('0x23')],dials[_0x3420ed[_0xe8c9('0x8')]][_0xe8c9('0x25')]));}else{utils[_0xe8c9('0xb')](util[_0xe8c9('0xc')](_0xe8c9('0x28'),_0x3420ed[_0xe8c9('0x8')],_0x3420ed[_0xe8c9('0x23')]));}}}catch(_0x50c033){utils[_0xe8c9('0x17')](util[_0xe8c9('0xc')]('[%s][dials][dialend]',_0x3420ed[_0xe8c9('0x8')]),_0x50c033);}};exports[_0xe8c9('0x29')]=function(_0x244e4e){try{if(!_[_0xe8c9('0x1a')](dials[_0x244e4e[_0xe8c9('0x8')]])){utils[_0xe8c9('0x9')](util['format'](_0xe8c9('0x2a'),_0x244e4e[_0xe8c9('0x8')]),_0x244e4e);utils[_0xe8c9('0xb')](util[_0xe8c9('0xc')](_0xe8c9('0x2b'),_0x244e4e['uniqueid'],_0x244e4e[_0xe8c9('0x2c')],_0x244e4e[_0xe8c9('0x2d')],_0x244e4e['cause-txt']));dials[_0x244e4e[_0xe8c9('0x8')]]=_[_0xe8c9('0x1b')](dials[_0x244e4e[_0xe8c9('0x8')]],{'endtime':utils[_0xe8c9('0x1d')](),'lastevent':'complete'});dials[_0x244e4e[_0xe8c9('0x8')]][_0xe8c9('0x2e')]=utils['diffTime'](dials[_0x244e4e[_0xe8c9('0x8')]][_0xe8c9('0x2f')],dials[_0x244e4e[_0xe8c9('0x8')]][_0xe8c9('0x1c')]);dials[_0x244e4e[_0xe8c9('0x8')]][_0xe8c9('0x30')]=utils[_0xe8c9('0x31')](dials[_0x244e4e['uniqueid']]['answertime']||dials[_0x244e4e[_0xe8c9('0x8')]]['endtime'],dials[_0x244e4e[_0xe8c9('0x8')]][_0xe8c9('0x1c')]);dials[_0x244e4e['uniqueid']][_0xe8c9('0x32')]=dials[_0x244e4e[_0xe8c9('0x8')]]['answertime']?utils[_0xe8c9('0x31')](dials[_0x244e4e[_0xe8c9('0x8')]][_0xe8c9('0x2f')],dials[_0x244e4e[_0xe8c9('0x8')]][_0xe8c9('0x25')]):0x0;writeDB(dials[_0x244e4e[_0xe8c9('0x8')]]);}}catch(_0x1da0bd){utils[_0xe8c9('0x17')](util[_0xe8c9('0xc')](_0xe8c9('0x2a'),_0x244e4e[_0xe8c9('0x8')]),_0x1da0bd);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 490cbcb..df45592 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 _0x0b01=['attendedtransfer','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','local','port','asterisk','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','[%s][index][devicestatechange]','device','devicestatechange','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b01,0x1b4));var _0x10b0=function(_0x479674,_0x2bc4c4){_0x479674=_0x479674-0x0;var _0x4abab9=_0x0b01[_0x479674];return _0x4abab9;};var AsteriskManager=require(_0x10b0('0x0'));var config=require(_0x10b0('0x1'));var utils=require('./utils');var util=require(_0x10b0('0x2'));var isXDREnabled=config[_0x10b0('0x3')]&&config['xdr'][_0x10b0('0x4')]?!config['xdr'][_0x10b0('0x4')]:!![];var isProduction=config[_0x10b0('0x5')]===_0x10b0('0x6')||![];var isLocalAsterisk=config[_0x10b0('0x3')]&&config[_0x10b0('0x3')][_0x10b0('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x10b0('0x8')],config[_0x10b0('0x9')]['ip'],config['asterisk']['username'],config[_0x10b0('0x9')][_0x10b0('0xa')],!![]);ami[_0x10b0('0xb')]();if(!isXDREnabled){utils['info'](_0x10b0('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x10b0('0xd')](_0x10b0('0xe'));}else{var agents=require(_0x10b0('0xf'));var calls=require(_0x10b0('0x10'));var queues=require(_0x10b0('0x11'));var recordings=require(_0x10b0('0x12'));var members=require(_0x10b0('0x13'));var dials=require(_0x10b0('0x14'));var transfers=require(_0x10b0('0x15'));var core=require(_0x10b0('0x16'));ami['on'](_0x10b0('0x17'),core[_0x10b0('0x17')]);ami['on'](_0x10b0('0x18'),core['shutdown']);ami['on'](_0x10b0('0x19'),core[_0x10b0('0x19')]);ami['on'](_0x10b0('0x1a'),core[_0x10b0('0x1a')]);ami['on'](_0x10b0('0x1b'),core[_0x10b0('0x1b')]);ami['on'](_0x10b0('0x1c'),core[_0x10b0('0x1c')]);ami['on']('devicestatechange',function(_0x2aeb15){try{utils[_0x10b0('0x1d')](util['format'](_0x10b0('0x1e'),_0x2aeb15[_0x10b0('0x1f')]),_0x2aeb15);members[_0x10b0('0x20')](_0x2aeb15);}catch(_0x550090){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')](_0x10b0('0x1e'),_0x2aeb15['device']),_0x550090);}});ami['on']('agentcalled',function(_0x455120){try{utils['debug'](util['format'](_0x10b0('0x22'),_0x455120['uniqueid']),_0x455120);agents['agentcalled'](_0x455120);}catch(_0x1b8f68){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')]('[%s][index][agentcalled]',_0x455120[_0x10b0('0x23')]),_0x1b8f68);}});ami['on'](_0x10b0('0x24'),function(_0x3f039c){try{utils[_0x10b0('0x1d')](util[_0x10b0('0x21')](_0x10b0('0x25'),_0x3f039c[_0x10b0('0x23')]),_0x3f039c);agents[_0x10b0('0x24')](_0x3f039c);}catch(_0x2b7181){utils[_0x10b0('0x1a')](util['format']('[%s][index][agentringnoanswer]',_0x3f039c[_0x10b0('0x23')]),_0x2b7181);}});ami['on']('agentconnect',function(_0x5c0fcd){try{utils['debug'](util[_0x10b0('0x21')](_0x10b0('0x26'),_0x5c0fcd[_0x10b0('0x23')]),_0x5c0fcd);agents['agentconnect'](_0x5c0fcd);queues[_0x10b0('0x27')](_0x5c0fcd);}catch(_0x39802c){utils[_0x10b0('0x1a')](util['format'](_0x10b0('0x26'),_0x5c0fcd[_0x10b0('0x23')]),_0x39802c);}});ami['on']('agentcomplete',function(_0x2a256d){try{utils[_0x10b0('0x1d')](util['format'](_0x10b0('0x28'),_0x2a256d['uniqueid']),_0x2a256d);agents[_0x10b0('0x29')](_0x2a256d);queues['agentcomplete'](_0x2a256d);members[_0x10b0('0x29')](_0x2a256d);}catch(_0xe37966){utils[_0x10b0('0x1a')](util['format'](_0x10b0('0x28'),_0x2a256d['uniqueid']),_0xe37966);}});ami['on'](_0x10b0('0x2a'),function(_0x5b65c6){try{utils[_0x10b0('0x1d')](util['format'](_0x10b0('0x2b'),_0x5b65c6[_0x10b0('0x23')]),_0x5b65c6);agents[_0x10b0('0x2a')](_0x5b65c6);queues['queuecallerabandon'](_0x5b65c6);}catch(_0x55b499){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')](_0x10b0('0x2b'),_0x5b65c6[_0x10b0('0x23')]),_0x55b499);}});ami['on'](_0x10b0('0x2c'),function(_0x3acf32){try{utils['debug'](util[_0x10b0('0x21')](_0x10b0('0x2d'),_0x3acf32[_0x10b0('0x23')]),_0x3acf32);queues[_0x10b0('0x2c')](_0x3acf32);recordings[_0x10b0('0x2c')](_0x3acf32);}catch(_0x40edd0){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')]('[%s][index][queuecallerjoin]',_0x3acf32[_0x10b0('0x23')]),_0x40edd0);}});ami['on']('queuecallerleave',function(_0x41bed9){try{utils['debug'](util[_0x10b0('0x21')](_0x10b0('0x2e'),_0x41bed9[_0x10b0('0x23')]),_0x41bed9);queues[_0x10b0('0x2f')](_0x41bed9);}catch(_0x1d3deb){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')](_0x10b0('0x2e'),_0x41bed9[_0x10b0('0x23')]),_0x1d3deb);}});ami['on'](_0x10b0('0x30'),function(_0xdbd96f){try{utils[_0x10b0('0x1d')](util[_0x10b0('0x21')](_0x10b0('0x31'),_0xdbd96f[_0x10b0('0x23')]),_0xdbd96f);queues[_0x10b0('0x30')](_0xdbd96f);calls[_0x10b0('0x30')](_0xdbd96f);}catch(_0x186e9c){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')]('[%s][index][musiconholdstart]',_0xdbd96f[_0x10b0('0x23')]),_0x186e9c);}});ami['on']('musiconholdstop',function(_0x491be3){try{utils['debug'](util[_0x10b0('0x21')](_0x10b0('0x32'),_0x491be3['uniqueid']),_0x491be3);queues['musiconholdstop'](_0x491be3);calls[_0x10b0('0x33')](_0x491be3);}catch(_0x4b3e87){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')](_0x10b0('0x32'),_0x491be3[_0x10b0('0x23')]),_0x4b3e87);}});ami['on'](_0x10b0('0x34'),function(_0x5257e7){try{utils[_0x10b0('0x1d')](util[_0x10b0('0x21')](_0x10b0('0x35'),_0x5257e7[_0x10b0('0x23')]),_0x5257e7);calls['newstate'](_0x5257e7);recordings['newstate'](_0x5257e7);}catch(_0x496e2e){utils[_0x10b0('0x1a')](util['format'](_0x10b0('0x35'),_0x5257e7[_0x10b0('0x23')]),_0x496e2e);}});ami['on'](_0x10b0('0x36'),function(_0x27fc4e){try{utils[_0x10b0('0x1d')](util[_0x10b0('0x21')]('[%s][index][hangup]',_0x27fc4e['uniqueid']),_0x27fc4e);calls[_0x10b0('0x36')](_0x27fc4e);recordings[_0x10b0('0x36')](_0x27fc4e);dials[_0x10b0('0x36')](_0x27fc4e);agents['hangup'](_0x27fc4e);queues[_0x10b0('0x36')](_0x27fc4e);}catch(_0x1f4b65){utils[_0x10b0('0x1a')](util['format'](_0x10b0('0x37'),_0x27fc4e[_0x10b0('0x23')]),_0x1f4b65);}});ami['on']('cdr',function(_0x42d5c0){try{utils[_0x10b0('0x1d')](util[_0x10b0('0x21')](_0x10b0('0x38'),_0x42d5c0[_0x10b0('0x23')]),_0x42d5c0);members['cdr'](_0x42d5c0);}catch(_0x16fc06){utils[_0x10b0('0x1a')](util['format']('[%s][index][cdr]',_0x42d5c0[_0x10b0('0x23')]),_0x16fc06);}});ami['on'](_0x10b0('0x39'),function(_0xfbefb8){try{utils['debug'](util['format'](_0x10b0('0x3a'),_0xfbefb8[_0x10b0('0x23')]),_0xfbefb8);queues[_0x10b0('0x39')](_0xfbefb8);agents[_0x10b0('0x39')](_0xfbefb8);transfers['blindtransfer'](_0xfbefb8);recordings['blindtransfer'](_0xfbefb8);}catch(_0x1ce187){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')]('[%s][index][blindtransfer]',_0xfbefb8['uniqueid']),_0x1ce187);}});ami['on']('attendedtransfer',function(_0x2a77d1){try{utils[_0x10b0('0x1d')](util['format'](_0x10b0('0x3b'),_0x2a77d1[_0x10b0('0x3c')]),_0x2a77d1);queues[_0x10b0('0x3d')](_0x2a77d1);transfers['attendedtransfer'](_0x2a77d1);agents[_0x10b0('0x3d')](_0x2a77d1);calls[_0x10b0('0x3d')](_0x2a77d1);}catch(_0x3f088e){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')](_0x10b0('0x3b'),_0x2a77d1['origtransfereruniqueid']),_0x3f088e);}});ami['on'](_0x10b0('0x3e'),function(_0x3945b2){try{utils[_0x10b0('0x1d')](util['format'](_0x10b0('0x3f'),_0x3945b2[_0x10b0('0x23')]),_0x3945b2);queues[_0x10b0('0x3e')](_0x3945b2);recordings[_0x10b0('0x3e')](_0x3945b2);calls[_0x10b0('0x3e')](_0x3945b2);dials[_0x10b0('0x3e')](_0x3945b2);}catch(_0x5e9bd6){utils['error'](util[_0x10b0('0x21')](_0x10b0('0x3f'),_0x3945b2['uniqueid']),_0x5e9bd6);}});ami['on']('newexten',function(_0x24e6bd){try{utils[_0x10b0('0x1d')](util['format'](_0x10b0('0x40'),_0x24e6bd[_0x10b0('0x23')]),_0x24e6bd);calls[_0x10b0('0x41')](_0x24e6bd);recordings[_0x10b0('0x41')](_0x24e6bd);dials[_0x10b0('0x41')](_0x24e6bd);}catch(_0x4cb9fa){utils['error'](util[_0x10b0('0x21')](_0x10b0('0x40'),_0x24e6bd[_0x10b0('0x23')]),_0x4cb9fa);}});ami['on'](_0x10b0('0x42'),function(_0x43c912){try{utils[_0x10b0('0x1d')](util[_0x10b0('0x21')]('[%s][index][newchannel]',_0x43c912[_0x10b0('0x23')]),_0x43c912);calls['newchannel'](_0x43c912);recordings[_0x10b0('0x42')](_0x43c912);}catch(_0x443c73){utils[_0x10b0('0x1a')](util[_0x10b0('0x21')]('[%s][index][newchannel]',_0x43c912[_0x10b0('0x23')]),_0x443c73);}});ami['on'](_0x10b0('0x43'),function(_0x27a8b7){try{utils[_0x10b0('0x1d')](util[_0x10b0('0x21')](_0x10b0('0x44'),_0x27a8b7[_0x10b0('0x23')]),_0x27a8b7);dials[_0x10b0('0x43')](_0x27a8b7);}catch(_0x3532aa){utils[_0x10b0('0x1a')](util['format']('[%s]dialbegin',_0x27a8b7[_0x10b0('0x23')]),_0x3532aa);}});ami['on'](_0x10b0('0x45'),function(_0x49d05a){try{utils['debug'](util[_0x10b0('0x21')](_0x10b0('0x46'),_0x49d05a[_0x10b0('0x23')]),_0x49d05a);dials[_0x10b0('0x45')](_0x49d05a);}catch(_0x5d2781){utils['error'](util[_0x10b0('0x21')](_0x10b0('0x46'),_0x49d05a['uniqueid']),_0x5d2781);}});} \ No newline at end of file +var _0x2ac5=['[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','dialend','[%s][index][dialend]','util','xdr','disabled','env','local','port','asterisk','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr'];(function(_0x289db0,_0x200ca7){var _0x4a88f2=function(_0x19ab52){while(--_0x19ab52){_0x289db0['push'](_0x289db0['shift']());}};_0x4a88f2(++_0x200ca7);}(_0x2ac5,0x1f3));var _0x52ac=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x2ac5[_0x3c4a7c];return _0xf13d1e;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x52ac('0x0'));var isXDREnabled=config[_0x52ac('0x1')]&&config[_0x52ac('0x1')][_0x52ac('0x2')]?!config[_0x52ac('0x1')][_0x52ac('0x2')]:!![];var isProduction=config[_0x52ac('0x3')]==='production'||![];var isLocalAsterisk=config[_0x52ac('0x1')]&&config[_0x52ac('0x1')][_0x52ac('0x4')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x52ac('0x5')],config['asterisk']['ip'],config[_0x52ac('0x6')][_0x52ac('0x7')],config[_0x52ac('0x6')][_0x52ac('0x8')],!![]);ami[_0x52ac('0x9')]();if(!isXDREnabled){utils[_0x52ac('0xa')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x52ac('0xa')](_0x52ac('0xb'));}else{var agents=require(_0x52ac('0xc'));var calls=require('./calls.controller');var queues=require(_0x52ac('0xd'));var recordings=require(_0x52ac('0xe'));var members=require(_0x52ac('0xf'));var dials=require(_0x52ac('0x10'));var transfers=require(_0x52ac('0x11'));var core=require('./core.controller');ami['on'](_0x52ac('0x12'),core[_0x52ac('0x12')]);ami['on']('shutdown',core[_0x52ac('0x13')]);ami['on'](_0x52ac('0x14'),core[_0x52ac('0x14')]);ami['on']('error',core[_0x52ac('0x15')]);ami['on'](_0x52ac('0x16'),core['close']);ami['on'](_0x52ac('0x17'),core[_0x52ac('0x17')]);ami['on'](_0x52ac('0x18'),function(_0x4bbb54){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x1b'),_0x4bbb54[_0x52ac('0x1c')]),_0x4bbb54);members[_0x52ac('0x18')](_0x4bbb54);}catch(_0x19c53e){utils['error'](util[_0x52ac('0x1a')]('[%s][index][devicestatechange]',_0x4bbb54['device']),_0x19c53e);}});ami['on'](_0x52ac('0x1d'),function(_0x47d74d){try{utils[_0x52ac('0x19')](util['format'](_0x52ac('0x1e'),_0x47d74d[_0x52ac('0x1f')]),_0x47d74d);agents[_0x52ac('0x1d')](_0x47d74d);}catch(_0x268ed1){utils['error'](util[_0x52ac('0x1a')](_0x52ac('0x1e'),_0x47d74d[_0x52ac('0x1f')]),_0x268ed1);}});ami['on'](_0x52ac('0x20'),function(_0x504f6d){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')]('[%s][index][agentringnoanswer]',_0x504f6d[_0x52ac('0x1f')]),_0x504f6d);agents['agentringnoanswer'](_0x504f6d);}catch(_0x3c0507){utils['error'](util[_0x52ac('0x1a')](_0x52ac('0x21'),_0x504f6d[_0x52ac('0x1f')]),_0x3c0507);}});ami['on']('agentconnect',function(_0x26b337){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x22'),_0x26b337[_0x52ac('0x1f')]),_0x26b337);agents[_0x52ac('0x23')](_0x26b337);queues[_0x52ac('0x23')](_0x26b337);}catch(_0x37f9c9){utils[_0x52ac('0x15')](util['format'](_0x52ac('0x22'),_0x26b337[_0x52ac('0x1f')]),_0x37f9c9);}});ami['on']('agentcomplete',function(_0x54af20){try{utils[_0x52ac('0x19')](util['format'](_0x52ac('0x24'),_0x54af20['uniqueid']),_0x54af20);agents['agentcomplete'](_0x54af20);queues[_0x52ac('0x25')](_0x54af20);members[_0x52ac('0x25')](_0x54af20);}catch(_0x34d96b){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')](_0x52ac('0x24'),_0x54af20[_0x52ac('0x1f')]),_0x34d96b);}});ami['on']('queuecallerabandon',function(_0x149b63){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')]('[%s][index][queuecallerabandon]',_0x149b63[_0x52ac('0x1f')]),_0x149b63);agents['queuecallerabandon'](_0x149b63);queues[_0x52ac('0x26')](_0x149b63);}catch(_0x58d414){utils['error'](util[_0x52ac('0x1a')](_0x52ac('0x27'),_0x149b63['uniqueid']),_0x58d414);}});ami['on'](_0x52ac('0x28'),function(_0x566f64){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x29'),_0x566f64['uniqueid']),_0x566f64);queues[_0x52ac('0x28')](_0x566f64);recordings[_0x52ac('0x28')](_0x566f64);}catch(_0x1f7fb3){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')](_0x52ac('0x29'),_0x566f64['uniqueid']),_0x1f7fb3);}});ami['on'](_0x52ac('0x2a'),function(_0x28fb1f){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x2b'),_0x28fb1f[_0x52ac('0x1f')]),_0x28fb1f);queues[_0x52ac('0x2a')](_0x28fb1f);}catch(_0x335e69){utils[_0x52ac('0x15')](util['format']('[%s][index][queuecallerleave]',_0x28fb1f[_0x52ac('0x1f')]),_0x335e69);}});ami['on'](_0x52ac('0x2c'),function(_0x29818f){try{utils['debug'](util[_0x52ac('0x1a')](_0x52ac('0x2d'),_0x29818f[_0x52ac('0x1f')]),_0x29818f);queues[_0x52ac('0x2c')](_0x29818f);calls[_0x52ac('0x2c')](_0x29818f);}catch(_0x3eb0a9){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')]('[%s][index][musiconholdstart]',_0x29818f['uniqueid']),_0x3eb0a9);}});ami['on'](_0x52ac('0x2e'),function(_0x517f78){try{utils[_0x52ac('0x19')](util['format'](_0x52ac('0x2f'),_0x517f78['uniqueid']),_0x517f78);queues['musiconholdstop'](_0x517f78);calls['musiconholdstop'](_0x517f78);}catch(_0x4c2752){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')]('[%s][index][musiconholdstop]',_0x517f78[_0x52ac('0x1f')]),_0x4c2752);}});ami['on'](_0x52ac('0x30'),function(_0x5e12e1){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x31'),_0x5e12e1[_0x52ac('0x1f')]),_0x5e12e1);calls[_0x52ac('0x30')](_0x5e12e1);recordings[_0x52ac('0x30')](_0x5e12e1);}catch(_0x37e569){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')]('[%s][index][newstate]',_0x5e12e1[_0x52ac('0x1f')]),_0x37e569);}});ami['on'](_0x52ac('0x32'),function(_0x20525a){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x33'),_0x20525a['uniqueid']),_0x20525a);calls[_0x52ac('0x32')](_0x20525a);recordings[_0x52ac('0x32')](_0x20525a);dials[_0x52ac('0x32')](_0x20525a);agents[_0x52ac('0x32')](_0x20525a);queues[_0x52ac('0x32')](_0x20525a);}catch(_0x34a2f9){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')](_0x52ac('0x33'),_0x20525a[_0x52ac('0x1f')]),_0x34a2f9);}});ami['on'](_0x52ac('0x34'),function(_0x3171ee){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x35'),_0x3171ee[_0x52ac('0x1f')]),_0x3171ee);members[_0x52ac('0x34')](_0x3171ee);}catch(_0x584ae5){utils[_0x52ac('0x15')](util['format'](_0x52ac('0x35'),_0x3171ee[_0x52ac('0x1f')]),_0x584ae5);}});ami['on'](_0x52ac('0x36'),function(_0x239d89){try{utils['debug'](util[_0x52ac('0x1a')](_0x52ac('0x37'),_0x239d89[_0x52ac('0x1f')]),_0x239d89);queues['blindtransfer'](_0x239d89);agents[_0x52ac('0x36')](_0x239d89);transfers[_0x52ac('0x36')](_0x239d89);recordings[_0x52ac('0x36')](_0x239d89);}catch(_0x21cf3a){utils[_0x52ac('0x15')](util['format']('[%s][index][blindtransfer]',_0x239d89['uniqueid']),_0x21cf3a);}});ami['on'](_0x52ac('0x38'),function(_0x2fe638){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x39'),_0x2fe638[_0x52ac('0x3a')]),_0x2fe638);queues[_0x52ac('0x38')](_0x2fe638);transfers[_0x52ac('0x38')](_0x2fe638);agents[_0x52ac('0x38')](_0x2fe638);calls[_0x52ac('0x38')](_0x2fe638);}catch(_0x262e30){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')]('[%s][index][attendedtransfer]',_0x2fe638[_0x52ac('0x3a')]),_0x262e30);}});ami['on'](_0x52ac('0x3b'),function(_0x20f221){try{utils['debug'](util[_0x52ac('0x1a')](_0x52ac('0x3c'),_0x20f221[_0x52ac('0x1f')]),_0x20f221);queues[_0x52ac('0x3b')](_0x20f221);recordings[_0x52ac('0x3b')](_0x20f221);calls['varset'](_0x20f221);dials[_0x52ac('0x3b')](_0x20f221);}catch(_0x3f8e37){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')](_0x52ac('0x3c'),_0x20f221['uniqueid']),_0x3f8e37);}});ami['on'](_0x52ac('0x3d'),function(_0x2047b0){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x3e'),_0x2047b0[_0x52ac('0x1f')]),_0x2047b0);calls['newexten'](_0x2047b0);recordings[_0x52ac('0x3d')](_0x2047b0);dials['newexten'](_0x2047b0);}catch(_0x891edc){utils[_0x52ac('0x15')](util['format'](_0x52ac('0x3e'),_0x2047b0[_0x52ac('0x1f')]),_0x891edc);}});ami['on'](_0x52ac('0x3f'),function(_0x5aead9){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x40'),_0x5aead9['uniqueid']),_0x5aead9);calls[_0x52ac('0x3f')](_0x5aead9);recordings[_0x52ac('0x3f')](_0x5aead9);}catch(_0x462b67){utils['error'](util[_0x52ac('0x1a')]('[%s][index][newchannel]',_0x5aead9[_0x52ac('0x1f')]),_0x462b67);}});ami['on']('dialbegin',function(_0x332f71){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')](_0x52ac('0x41'),_0x332f71[_0x52ac('0x1f')]),_0x332f71);dials[_0x52ac('0x42')](_0x332f71);}catch(_0x555474){utils[_0x52ac('0x15')](util['format']('[%s]dialbegin',_0x332f71[_0x52ac('0x1f')]),_0x555474);}});ami['on'](_0x52ac('0x43'),function(_0x44a4c8){try{utils[_0x52ac('0x19')](util[_0x52ac('0x1a')]('[%s][index][dialend]',_0x44a4c8[_0x52ac('0x1f')]),_0x44a4c8);dials[_0x52ac('0x43')](_0x44a4c8);}catch(_0x4e439d){utils[_0x52ac('0x15')](util[_0x52ac('0x1a')](_0x52ac('0x44'),_0x44a4c8[_0x52ac('0x1f')]),_0x4e439d);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 8a7e466..59181e9 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 _0x4ef1=['INUSE','BUSY','agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data3','destinationchannel','destination','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','then','membername','name','internal','CreateMemberReport','getUserByName','split','request','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state'];(function(_0x545240,_0x5daa34){var _0x4cf537=function(_0x4be372){while(--_0x4be372){_0x545240['push'](_0x545240['shift']());}};_0x4cf537(++_0x5daa34);}(_0x4ef1,0xeb));var _0x14ef=function(_0x3b016b,_0x6d4ddd){_0x3b016b=_0x3b016b-0x0;var _0x34ca82=_0x4ef1[_0x3b016b];return _0x34ca82;};'use strict';var _=require(_0x14ef('0x0'));var util=require(_0x14ef('0x1'));var utils=require('./utils');var members={};var exclude=[_0x14ef('0x2'),_0x14ef('0x3')];function writeDB(_0x3c673a){utils[_0x14ef('0x4')](util[_0x14ef('0x5')](_0x14ef('0x6'),_0x3c673a[_0x14ef('0x7')],_0x3c673a[_0x14ef('0x8')],_0x3c673a[_0x14ef('0x9')],_0x3c673a[_0x14ef('0xa')],_0x3c673a['membername'],_0x3c673a[_0x14ef('0xb')]));if(_0x3c673a[_0x14ef('0x8')]){utils['getUserByInterface'](_0x3c673a[_0x14ef('0x8')])[_0x14ef('0xc')](function(_0x1f7950){if(_0x1f7950){_0x3c673a[_0x14ef('0xd')]=_0x1f7950[_0x14ef('0xe')];_0x3c673a['internal']=_0x1f7950[_0x14ef('0xf')];utils['request'](_0x14ef('0x10'),_0x3c673a);}else{utils[_0x14ef('0x11')](_0x3c673a[_0x14ef('0x8')][_0x14ef('0x12')]('/')[0x1])['then'](function(_0x4cbc50){if(_0x4cbc50){_0x3c673a[_0x14ef('0xd')]=_0x4cbc50[_0x14ef('0xe')];_0x3c673a['internal']=_0x4cbc50[_0x14ef('0xf')];utils[_0x14ef('0x13')](_0x14ef('0x10'),_0x3c673a);}});}})['catch'](function(_0x22d7c2){utils[_0x14ef('0x14')](util[_0x14ef('0x5')](_0x14ef('0x15'),_0x3c673a['uniqueid']),_0x22d7c2);});}delete members[_0x3c673a[_0x14ef('0x8')]];}function startsWith(_0x14b857,_0x435fc1){return _[_0x14ef('0x16')](_0x14b857,function(_0x5364e5){return _[_0x14ef('0x17')](_0x435fc1,_0x5364e5);});}exports[_0x14ef('0x18')]=function(_0x24556b){try{utils[_0x14ef('0x19')](util[_0x14ef('0x5')](_0x14ef('0x1a'),members[_0x24556b[_0x14ef('0x1b')]]?members[_0x24556b[_0x14ef('0x1b')]][_0x14ef('0x7')]:_0x24556b[_0x14ef('0x1b')]),_0x24556b);utils[_0x14ef('0x4')](util[_0x14ef('0x5')](_0x14ef('0x1c'),members[_0x24556b[_0x14ef('0x1b')]]?members[_0x24556b['device']]['uniqueid']:_0x24556b[_0x14ef('0x1b')],_0x24556b[_0x14ef('0x1d')],_0x24556b[_0x14ef('0x1b')]));switch(_0x24556b[_0x14ef('0x1d')]){case _0x14ef('0x1e'):case _0x14ef('0x1f'):if(!startsWith(exclude,_0x24556b[_0x14ef('0x1b')])){members[_0x24556b[_0x14ef('0x1b')]]={'channel':'voice','interface':_0x24556b[_0x14ef('0x1b')],'type':'TALKING','enterAt':utils['now'](),'role':_0x14ef('0x20')};}break;case _0x14ef('0x21'):if(!_[_0x14ef('0x22')](members[_0x24556b[_0x14ef('0x1b')]])){members[_0x24556b[_0x14ef('0x1b')]][_0x14ef('0x23')]=utils[_0x14ef('0x24')]();members[_0x24556b[_0x14ef('0x1b')]][_0x14ef('0x25')]=utils[_0x14ef('0x26')](members[_0x24556b['device']][_0x14ef('0x23')],members[_0x24556b[_0x14ef('0x1b')]][_0x14ef('0x27')]);if(members[_0x24556b[_0x14ef('0x1b')]][_0x14ef('0x7')]){writeDB(members[_0x24556b[_0x14ef('0x1b')]]);}}break;default:break;}}catch(_0x5f2af1){utils[_0x14ef('0x14')](util['format']('[%s][members][devicestatechange]',members[_0x24556b[_0x14ef('0x1b')]]?members[_0x24556b[_0x14ef('0x1b')]][_0x14ef('0x7')]:_0x24556b[_0x14ef('0x1b')]),_0x5f2af1);}};exports[_0x14ef('0x28')]=function(_0x42ef99){try{if(!_[_0x14ef('0x22')](members[_0x42ef99[_0x14ef('0x8')]])){utils['debug'](util[_0x14ef('0x5')](_0x14ef('0x29'),_0x42ef99[_0x14ef('0x7')]),_0x42ef99);utils[_0x14ef('0x4')](util[_0x14ef('0x5')](_0x14ef('0x2a'),_0x42ef99[_0x14ef('0x7')],_0x42ef99[_0x14ef('0x8')],_0x42ef99[_0x14ef('0x2b')]));members[_0x42ef99[_0x14ef('0x8')]]=_[_0x14ef('0x2c')](members[_0x42ef99['interface']],{'data4':_0x42ef99['queue'],'uniqueid':_0x42ef99[_0x14ef('0x7')]});}}catch(_0x50b78a){utils[_0x14ef('0x14')](util[_0x14ef('0x5')]('[%s][members][agentcomplete]',_0x42ef99['uniqueid']),_0x50b78a);}};exports[_0x14ef('0x2d')]=function(_0x161a78){try{utils[_0x14ef('0x19')](util[_0x14ef('0x5')](_0x14ef('0x2e'),_0x161a78[_0x14ef('0x7')]),_0x161a78);if(_0x161a78['channel']){var _0x2202e0=_0x161a78[_0x14ef('0x9')][_0x14ef('0x12')]('-')[0x0];if(!_['isNil'](members[_0x2202e0])){members[_0x2202e0]=_['assign'](members[_0x2202e0],{'data1':members[_0x2202e0]['data1']||_0x161a78[_0x14ef('0xb')],'data2':members[_0x2202e0][_0x14ef('0xa')]||_0x161a78[_0x14ef('0x2f')],'data3':members[_0x2202e0]['data3']||_0x161a78['destination'],'uniqueid':members[_0x2202e0][_0x14ef('0x7')]||_0x161a78['uniqueid']});utils[_0x14ef('0x4')](util[_0x14ef('0x5')](_0x14ef('0x30'),_0x161a78['uniqueid'],members[_0x2202e0][_0x14ef('0x31')],members[_0x2202e0][_0x14ef('0xa')],members[_0x2202e0][_0x14ef('0x32')]));if(members[_0x2202e0]['exitAt']){writeDB(members[_0x2202e0]);}}}if(_0x161a78[_0x14ef('0x33')]){var _0x5e0bcc=_0x161a78[_0x14ef('0x33')][_0x14ef('0x12')]('-')[0x0];if(!_[_0x14ef('0x22')](members[_0x5e0bcc])){members[_0x5e0bcc]=_[_0x14ef('0x2c')](members[_0x5e0bcc],{'data1':members[_0x5e0bcc]['data1']||_0x161a78[_0x14ef('0xb')],'data2':members[_0x5e0bcc][_0x14ef('0xa')]||_0x161a78[_0x14ef('0x2f')],'data3':members[_0x5e0bcc]['data3']||_0x161a78[_0x14ef('0x34')],'uniqueid':members[_0x5e0bcc][_0x14ef('0x7')]||_0x161a78['uniqueid']});utils[_0x14ef('0x4')](util['format'](_0x14ef('0x30'),_0x161a78[_0x14ef('0x7')],members[_0x5e0bcc][_0x14ef('0x31')],members[_0x5e0bcc][_0x14ef('0xa')],members[_0x5e0bcc]['data3']));if(members[_0x5e0bcc][_0x14ef('0x23')]){writeDB(members[_0x5e0bcc]);}}}}catch(_0x361b32){utils['error'](util[_0x14ef('0x5')](_0x14ef('0x2e'),_0x161a78['uniqueid']),_0x361b32);}}; \ No newline at end of file +var _0xc4f5=['some','devicestatechange','device','state','INUSE','now','NOT_INUSE','isNil','exitAt','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','debug','assign','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','[%s][members][cdr]','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','then','membername','internal','request','CreateMemberReport','getUserByName','split','name','catch','error','[%s][members][writeDB]'];(function(_0x165f38,_0x2422f0){var _0x2104de=function(_0x5c4256){while(--_0x5c4256){_0x165f38['push'](_0x165f38['shift']());}};_0x2104de(++_0x2422f0);}(_0xc4f5,0x75));var _0x5c4f=function(_0x508dc5,_0x1aa23c){_0x508dc5=_0x508dc5-0x0;var _0x403554=_0xc4f5[_0x508dc5];return _0x403554;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x5c4f('0x0'));var members={};var exclude=['Local/_attended@transfer',_0x5c4f('0x1')];function writeDB(_0x19e8c4){utils[_0x5c4f('0x2')](util[_0x5c4f('0x3')](_0x5c4f('0x4'),_0x19e8c4[_0x5c4f('0x5')],_0x19e8c4[_0x5c4f('0x6')],_0x19e8c4[_0x5c4f('0x7')],_0x19e8c4[_0x5c4f('0x8')],_0x19e8c4['membername'],_0x19e8c4[_0x5c4f('0x9')]));if(_0x19e8c4[_0x5c4f('0x6')]){utils['getUserByInterface'](_0x19e8c4[_0x5c4f('0x6')])[_0x5c4f('0xa')](function(_0x29a2a1){if(_0x29a2a1){_0x19e8c4[_0x5c4f('0xb')]=_0x29a2a1['name'];_0x19e8c4[_0x5c4f('0xc')]=_0x29a2a1[_0x5c4f('0xc')];utils[_0x5c4f('0xd')](_0x5c4f('0xe'),_0x19e8c4);}else{utils[_0x5c4f('0xf')](_0x19e8c4[_0x5c4f('0x6')][_0x5c4f('0x10')]('/')[0x1])[_0x5c4f('0xa')](function(_0x2a4c06){if(_0x2a4c06){_0x19e8c4[_0x5c4f('0xb')]=_0x2a4c06[_0x5c4f('0x11')];_0x19e8c4[_0x5c4f('0xc')]=_0x2a4c06[_0x5c4f('0xc')];utils[_0x5c4f('0xd')]('CreateMemberReport',_0x19e8c4);}});}})[_0x5c4f('0x12')](function(_0x15c8f4){utils[_0x5c4f('0x13')](util[_0x5c4f('0x3')](_0x5c4f('0x14'),_0x19e8c4[_0x5c4f('0x5')]),_0x15c8f4);});}delete members[_0x19e8c4[_0x5c4f('0x6')]];}function startsWith(_0x229c47,_0x555d4e){return _[_0x5c4f('0x15')](_0x229c47,function(_0x43dcc0){return _['startsWith'](_0x555d4e,_0x43dcc0);});}exports[_0x5c4f('0x16')]=function(_0x3fcf73){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x3fcf73[_0x5c4f('0x17')]]?members[_0x3fcf73[_0x5c4f('0x17')]][_0x5c4f('0x5')]:_0x3fcf73[_0x5c4f('0x17')]),_0x3fcf73);utils[_0x5c4f('0x2')](util[_0x5c4f('0x3')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x3fcf73['device']]?members[_0x3fcf73[_0x5c4f('0x17')]][_0x5c4f('0x5')]:_0x3fcf73['device'],_0x3fcf73[_0x5c4f('0x18')],_0x3fcf73[_0x5c4f('0x17')]));switch(_0x3fcf73[_0x5c4f('0x18')]){case _0x5c4f('0x19'):case'BUSY':if(!startsWith(exclude,_0x3fcf73['device'])){members[_0x3fcf73[_0x5c4f('0x17')]]={'channel':'voice','interface':_0x3fcf73[_0x5c4f('0x17')],'type':'TALKING','enterAt':utils[_0x5c4f('0x1a')](),'role':'agent'};}break;case _0x5c4f('0x1b'):if(!_[_0x5c4f('0x1c')](members[_0x3fcf73['device']])){members[_0x3fcf73[_0x5c4f('0x17')]][_0x5c4f('0x1d')]=utils[_0x5c4f('0x1a')]();members[_0x3fcf73[_0x5c4f('0x17')]]['duration']=utils[_0x5c4f('0x1e')](members[_0x3fcf73[_0x5c4f('0x17')]][_0x5c4f('0x1d')],members[_0x3fcf73[_0x5c4f('0x17')]][_0x5c4f('0x1f')]);if(members[_0x3fcf73['device']][_0x5c4f('0x5')]){writeDB(members[_0x3fcf73[_0x5c4f('0x17')]]);}}break;default:break;}}catch(_0x3d0a30){utils['error'](util[_0x5c4f('0x3')](_0x5c4f('0x20'),members[_0x3fcf73[_0x5c4f('0x17')]]?members[_0x3fcf73[_0x5c4f('0x17')]][_0x5c4f('0x5')]:_0x3fcf73['device']),_0x3d0a30);}};exports[_0x5c4f('0x21')]=function(_0x41748f){try{if(!_[_0x5c4f('0x1c')](members[_0x41748f[_0x5c4f('0x6')]])){utils['debug'](util[_0x5c4f('0x3')]('[%s][members][agentcomplete]',_0x41748f['uniqueid']),_0x41748f);utils[_0x5c4f('0x2')](util[_0x5c4f('0x3')](_0x5c4f('0x22'),_0x41748f[_0x5c4f('0x5')],_0x41748f['interface'],_0x41748f['queue']));members[_0x41748f[_0x5c4f('0x6')]]=_['assign'](members[_0x41748f[_0x5c4f('0x6')]],{'data4':_0x41748f[_0x5c4f('0x23')],'uniqueid':_0x41748f[_0x5c4f('0x5')]});}}catch(_0x1fea2b){utils[_0x5c4f('0x13')](util['format'](_0x5c4f('0x24'),_0x41748f[_0x5c4f('0x5')]),_0x1fea2b);}};exports['cdr']=function(_0x3106ad){try{utils[_0x5c4f('0x25')](util['format']('[%s][members][cdr]',_0x3106ad[_0x5c4f('0x5')]),_0x3106ad);if(_0x3106ad[_0x5c4f('0x7')]){var _0x3c788f=_0x3106ad[_0x5c4f('0x7')][_0x5c4f('0x10')]('-')[0x0];if(!_[_0x5c4f('0x1c')](members[_0x3c788f])){members[_0x3c788f]=_[_0x5c4f('0x26')](members[_0x3c788f],{'data1':members[_0x3c788f]['data1']||_0x3106ad[_0x5c4f('0x9')],'data2':members[_0x3c788f][_0x5c4f('0x8')]||_0x3106ad[_0x5c4f('0x27')],'data3':members[_0x3c788f][_0x5c4f('0x28')]||_0x3106ad[_0x5c4f('0x29')],'uniqueid':members[_0x3c788f][_0x5c4f('0x5')]||_0x3106ad['uniqueid']});utils[_0x5c4f('0x2')](util[_0x5c4f('0x3')](_0x5c4f('0x2a'),_0x3106ad[_0x5c4f('0x5')],members[_0x3c788f][_0x5c4f('0x2b')],members[_0x3c788f]['data2'],members[_0x3c788f][_0x5c4f('0x28')]));if(members[_0x3c788f]['exitAt']){writeDB(members[_0x3c788f]);}}}if(_0x3106ad[_0x5c4f('0x2c')]){var _0x99a3aa=_0x3106ad['destinationchannel'][_0x5c4f('0x10')]('-')[0x0];if(!_[_0x5c4f('0x1c')](members[_0x99a3aa])){members[_0x99a3aa]=_['assign'](members[_0x99a3aa],{'data1':members[_0x99a3aa]['data1']||_0x3106ad[_0x5c4f('0x9')],'data2':members[_0x99a3aa][_0x5c4f('0x8')]||_0x3106ad['source'],'data3':members[_0x99a3aa][_0x5c4f('0x28')]||_0x3106ad[_0x5c4f('0x29')],'uniqueid':members[_0x99a3aa][_0x5c4f('0x5')]||_0x3106ad[_0x5c4f('0x5')]});utils[_0x5c4f('0x2')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3106ad[_0x5c4f('0x5')],members[_0x99a3aa][_0x5c4f('0x2b')],members[_0x99a3aa][_0x5c4f('0x8')],members[_0x99a3aa][_0x5c4f('0x28')]));if(members[_0x99a3aa][_0x5c4f('0x1d')]){writeDB(members[_0x99a3aa]);}}}}catch(_0x5c7b08){utils[_0x5c4f('0x13')](util[_0x5c4f('0x3')](_0x5c4f('0x2d'),_0x3106ad[_0x5c4f('0x5')]),_0x5c7b08);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 540f99e..bb405f3 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 _0xb71a=['secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','isNil','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xb71a,0x150));var _0xab71=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0xb71a[_0x13b392];return _0x39db24;};'use strict';var _=require(_0xab71('0x0'));var util=require(_0xab71('0x1'));var utils=require(_0xab71('0x2'));var queues={};function writeDB(_0x59cbd6){utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x5'),_0x59cbd6[_0xab71('0x6')],_0x59cbd6[_0xab71('0x7')],_0x59cbd6['queue'],_0x59cbd6[_0xab71('0x8')],_0x59cbd6[_0xab71('0x9')],_0x59cbd6[_0xab71('0xa')],_0x59cbd6[_0xab71('0xb')]));if(_0x59cbd6[_0xab71('0xc')]){utils[_0xab71('0xd')](_0x59cbd6[_0xab71('0xc')])['then'](function(_0x5b5b6e){if(_0x5b5b6e){_0x59cbd6[_0xab71('0xe')]=_0x5b5b6e[_0xab71('0xe')];}utils[_0xab71('0xf')](_0xab71('0x10'),_0x59cbd6);});}else{utils[_0xab71('0xf')](_0xab71('0x10'),_0x59cbd6);}if(_0x59cbd6['transfereduniqueid']){delete queues[_0x59cbd6['transfereduniqueid']];}else{delete queues[_0x59cbd6[_0xab71('0x6')]];}}exports[_0xab71('0x11')]=function(_0x837a00){try{utils[_0xab71('0x12')](util[_0xab71('0x4')](_0xab71('0x13'),_0x837a00['uniqueid']),_0x837a00);utils['info'](util[_0xab71('0x4')](_0xab71('0x14'),_0x837a00[_0xab71('0x6')],_0x837a00[_0xab71('0xc')],_0x837a00[_0xab71('0x15')]));queues[_0x837a00[_0xab71('0x6')]]=_[_0xab71('0x16')](_0x837a00,{'originalposition':_0x837a00['position'],'queuecallerjoinAt':utils[_0xab71('0x17')](),'mohtime':0x0});}catch(_0x587cf3){utils[_0xab71('0x18')](util[_0xab71('0x4')](_0xab71('0x13'),_0x837a00['uniqueid']),_0x587cf3);}};exports['hangup']=function(_0x5ac585){try{if(!_['isNil'](queues[_0x5ac585[_0xab71('0x6')]])){utils[_0xab71('0x12')](util[_0xab71('0x4')](_0xab71('0x19'),_0x5ac585[_0xab71('0x6')]),_0x5ac585);if(queues[_0x5ac585[_0xab71('0x6')]][_0xab71('0x1a')]){if(!queues[_0x5ac585[_0xab71('0x6')]][_0xab71('0x1b')]&&!queues[_0x5ac585[_0xab71('0x6')]]['queuecallerexit']){queues[_0x5ac585['uniqueid']]['queuecallercomplete']=!![];queues[_0x5ac585[_0xab71('0x6')]]['queuecallercompleteAt']=utils[_0xab71('0x17')]();queues[_0x5ac585['uniqueid']][_0xab71('0xb')]=_0xab71('0x1c');}utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x1d'),_0x5ac585[_0xab71('0x6')],queues[_0x5ac585[_0xab71('0x6')]][_0xab71('0x1e')],queues[_0x5ac585[_0xab71('0x6')]][_0xab71('0xb')]));writeDB(queues[_0x5ac585[_0xab71('0x6')]]);}else if(queues[_0x5ac585[_0xab71('0x6')]][_0xab71('0x1f')]){utils['info'](util[_0xab71('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5ac585[_0xab71('0x6')],queues[_0x5ac585[_0xab71('0x6')]][_0xab71('0x1e')],queues[_0x5ac585[_0xab71('0x6')]]['transfereduniqueid']));queues[queues[_0x5ac585[_0xab71('0x6')]][_0xab71('0x1f')]]=queues[_0x5ac585[_0xab71('0x6')]];queues[queues[_0x5ac585['uniqueid']][_0xab71('0x1f')]][_0xab71('0x20')]=0x2;delete queues[_0x5ac585[_0xab71('0x6')]];}}}catch(_0x2680a7){utils[_0xab71('0x18')](util[_0xab71('0x4')](_0xab71('0x19'),_0x5ac585[_0xab71('0x6')]),_0x2680a7);}};exports['varset']=function(_0x14e5b9){try{utils[_0xab71('0x12')](util[_0xab71('0x4')](_0xab71('0x21'),_0x14e5b9[_0xab71('0x6')]),_0x14e5b9);if(!_['isNil'](_0x14e5b9[_0xab71('0x22')][_0xab71('0x23')])&&_0x14e5b9[_0xab71('0x24')][_0xab71('0x25')]()!=='CONTINUE'){if(!_[_0xab71('0x26')](queues[_0x14e5b9[_0xab71('0x6')]])){queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x1b')]=![];queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x27')]=null;queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x28')]=!![];queues[_0x14e5b9['uniqueid']][_0xab71('0x29')]=utils[_0xab71('0x17')]();queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0xb')]=_0x14e5b9[_0xab71('0x24')]['toUpperCase']();utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x2a'),_0x14e5b9['uniqueid'],queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x1e')],_0x14e5b9[_0xab71('0x24')],queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0xb')]));writeDB(queues[_0x14e5b9[_0xab71('0x6')]]);}}else if(!_[_0xab71('0x26')](_0x14e5b9[_0xab71('0x22')][_0xab71('0x2b')])){if(!_[_0xab71('0x26')](queues[_0x14e5b9[_0xab71('0x6')]])&&!queues[_0x14e5b9[_0xab71('0x6')]]['queuecallerabandon']){queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x1b')]=![];queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x27')]=null;queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x28')]=!![];queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x29')]=utils[_0xab71('0x17')]();queues[_0x14e5b9['uniqueid']][_0xab71('0xb')]=_0xab71('0x2c');utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x2d'),_0x14e5b9[_0xab71('0x6')],queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0x1e')],_0x14e5b9[_0xab71('0x24')],queues[_0x14e5b9[_0xab71('0x6')]][_0xab71('0xb')]));}}}catch(_0x352707){utils[_0xab71('0x18')](util[_0xab71('0x4')](_0xab71('0x21'),_0x14e5b9[_0xab71('0x6')]),_0x352707);}};exports[_0xab71('0x1b')]=function(_0x27f591){try{if(!_['isNil'](queues[_0x27f591[_0xab71('0x6')]])){utils['debug'](util[_0xab71('0x4')](_0xab71('0x2e'),_0x27f591[_0xab71('0x6')]),_0x27f591);queues[_0x27f591['uniqueid']][_0xab71('0x28')]=![];queues[_0x27f591[_0xab71('0x6')]][_0xab71('0x29')]=null;queues[_0x27f591['uniqueid']][_0xab71('0x1b')]=!![];queues[_0x27f591['uniqueid']][_0xab71('0x27')]=utils[_0xab71('0x17')]();queues[_0x27f591[_0xab71('0x6')]]['queuecallerexitreason']=_0xab71('0x2f');utils[_0xab71('0x3')](util['format'](_0xab71('0x30'),_0x27f591[_0xab71('0x6')],queues[_0x27f591[_0xab71('0x6')]][_0xab71('0x1e')],queues[_0x27f591['uniqueid']]['queuecallerexitreason']));}}catch(_0x3a1618){utils[_0xab71('0x18')](util['format'](_0xab71('0x2e'),_0x27f591[_0xab71('0x6')]),_0x3a1618);}};exports[_0xab71('0x31')]=function(_0x49d852){try{if(!_[_0xab71('0x26')](queues[_0x49d852[_0xab71('0x6')]])){utils[_0xab71('0x12')](util[_0xab71('0x4')](_0xab71('0x32'),_0x49d852[_0xab71('0x6')]),_0x49d852);utils['info'](util['format'](_0xab71('0x33'),_0x49d852['uniqueid'],queues[_0x49d852[_0xab71('0x6')]][_0xab71('0x1e')],_0x49d852[_0xab71('0x34')],_0x49d852[_0xab71('0x35')]));queues[_0x49d852['uniqueid']][_0xab71('0x31')]=!![];queues[_0x49d852[_0xab71('0x6')]]['queuecallerleaveAt']=utils['now']();queues[_0x49d852['uniqueid']][_0xab71('0x36')]=utils[_0xab71('0x37')](queues[_0x49d852[_0xab71('0x6')]][_0xab71('0x1a')],queues[_0x49d852['uniqueid']][_0xab71('0x38')]);queues[_0x49d852[_0xab71('0x6')]][_0xab71('0x15')]=_0x49d852['position'];queues[_0x49d852[_0xab71('0x6')]][_0xab71('0x39')]=_0x49d852['count'];queues[_0x49d852[_0xab71('0x6')]][_0xab71('0x34')]=_0x49d852['connectedlinenum'];queues[_0x49d852['uniqueid']]['connectedlinename']=_0x49d852['connectedlinename'];}}catch(_0x453320){utils[_0xab71('0x18')](util[_0xab71('0x4')](_0xab71('0x32'),_0x49d852[_0xab71('0x6')]),_0x453320);}};exports[_0xab71('0x3a')]=function(_0x3a77a4){try{if(!_[_0xab71('0x26')](queues[_0x3a77a4[_0xab71('0x6')]])){utils['debug'](util[_0xab71('0x4')]('[%s][queues][agentconnect]',_0x3a77a4[_0xab71('0x6')]),_0x3a77a4);utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x3b'),_0x3a77a4[_0xab71('0x6')],queues[_0x3a77a4[_0xab71('0x6')]]['name'],_0x3a77a4[_0xab71('0x3c')],_0x3a77a4[_0xab71('0x3d')]));queues[_0x3a77a4['uniqueid']][_0xab71('0x1b')]=![];queues[_0x3a77a4[_0xab71('0x6')]][_0xab71('0x1b')]=![];queues[_0x3a77a4['uniqueid']][_0xab71('0x27')]=null;queues[_0x3a77a4[_0xab71('0x6')]]['queuecallerexit']=![];queues[_0x3a77a4['uniqueid']]['queuecallerexitreason']=null;queues[_0x3a77a4[_0xab71('0x6')]][_0xab71('0x29')]=null;queues[_0x3a77a4[_0xab71('0x6')]][_0xab71('0x3e')]=!![];queues[_0x3a77a4[_0xab71('0x6')]][_0xab71('0xa')]=_0x3a77a4['destaccountcode'];queues[_0x3a77a4[_0xab71('0x6')]][_0xab71('0x8')]=_0x3a77a4[_0xab71('0x3c')];}}catch(_0x3c429a){utils[_0xab71('0x18')](util['format'](_0xab71('0x3f'),_0x3a77a4[_0xab71('0x6')]),_0x3c429a);}};exports[_0xab71('0x40')]=function(_0x25b518){try{if(!_['isNil'](queues[_0x25b518[_0xab71('0x6')]])){if(queues[_0x25b518['uniqueid']][_0xab71('0x1a')]){utils[_0xab71('0x12')](util[_0xab71('0x4')](_0xab71('0x41'),_0x25b518['uniqueid']),_0x25b518);queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x1b')]=![];queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x1b')]=![];queues[_0x25b518['uniqueid']][_0xab71('0x27')]=null;queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x28')]=![];queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x29')]=null;queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x3e')]=!![];queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x8')]=_0x25b518[_0xab71('0x3c')];queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x42')]=!![];queues[_0x25b518[_0xab71('0x6')]]['queuecallercompleteAt']=utils[_0xab71('0x17')]();if(_0x25b518[_0xab71('0x43')]==_0xab71('0x44')){if(!queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x44')]){queues[_0x25b518[_0xab71('0x6')]][_0xab71('0xb')]=_0xab71('0x45');}}else{queues[_0x25b518[_0xab71('0x6')]][_0xab71('0xb')]=_0xab71('0x46')+_0x25b518[_0xab71('0x43')]['toUpperCase']();}utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x47'),_0x25b518[_0xab71('0x6')],queues[_0x25b518[_0xab71('0x6')]][_0xab71('0x1e')],_0x25b518[_0xab71('0x3c')],queues[_0x25b518[_0xab71('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x25b518[_0xab71('0x6')]]);}}}catch(_0x24f000){utils[_0xab71('0x18')](util['format'](_0xab71('0x41'),_0x25b518[_0xab71('0x6')]),_0x24f000);}};exports[_0xab71('0x48')]=function(_0x2940c2){try{if(!_['isNil'](queues[_0x2940c2[_0xab71('0x49')]])){utils[_0xab71('0x12')](util['format'](_0xab71('0x4a'),_0x2940c2[_0xab71('0x6')]),_0x2940c2);queues[_0x2940c2[_0xab71('0x49')]][_0xab71('0x44')]=!![];queues[_0x2940c2[_0xab71('0x49')]]['transfertype']=_0xab71('0x4b');queues[_0x2940c2['transfereeuniqueid']][_0xab71('0x4c')]=_0x2940c2['extension'];queues[_0x2940c2[_0xab71('0x49')]][_0xab71('0x4d')]=_0x2940c2[_0xab71('0x49')];queues[_0x2940c2['transfereeuniqueid']]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x4e'),_0x2940c2[_0xab71('0x6')],queues[_0x2940c2[_0xab71('0x49')]][_0xab71('0x1e')],_0x2940c2[_0xab71('0x49')],_0x2940c2[_0xab71('0x4f')]));}}catch(_0x513e50){utils[_0xab71('0x18')](util[_0xab71('0x4')]('[%s][queues][blindtransfer]',_0x2940c2[_0xab71('0x6')]),_0x513e50);}};exports[_0xab71('0x50')]=function(_0x489dde){try{utils['debug'](util['format'](_0xab71('0x51'),_0x489dde[_0xab71('0x52')]),_0x489dde);if(_0x489dde[_0xab71('0x52')]==_0x489dde[_0xab71('0x53')]){if(!_[_0xab71('0x26')](queues[_0x489dde[_0xab71('0x54')]])){utils['info'](util[_0xab71('0x4')](_0xab71('0x55'),_0x489dde[_0xab71('0x52')],queues[_0x489dde['secondtransfererlinkedid']][_0xab71('0x1e')],_0x489dde[_0xab71('0x56')]));queues[_0x489dde[_0xab71('0x54')]][_0xab71('0x44')]=!![];queues[_0x489dde[_0xab71('0x54')]][_0xab71('0x57')]=_0xab71('0x58');queues[_0x489dde[_0xab71('0x54')]]['transferexten']=_0x489dde[_0xab71('0x56')];queues[_0x489dde[_0xab71('0x54')]]['transferuniqueid']=_0x489dde[_0xab71('0x52')];queues[_0x489dde[_0xab71('0x54')]][_0xab71('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xab71('0x26')](queues[_0x489dde[_0xab71('0x53')]])){if(_0x489dde[_0xab71('0x59')]&&queues[_0x489dde[_0xab71('0x59')]]){queues[_0x489dde[_0xab71('0x59')]]['queuecallerenterreason']=0x1;queues[_0x489dde[_0xab71('0x49')]]=_[_0xab71('0x5a')](queues[_0x489dde[_0xab71('0x59')]]);queues[_0x489dde[_0xab71('0x49')]][_0xab71('0x1f')]=_0x489dde[_0xab71('0x5b')];queues[_0x489dde['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x489dde[_0xab71('0x49')]][_0xab71('0x9')]=queues[_0x489dde['secondtransfererlinkedid']][_0xab71('0x9')];queues[_0x489dde[_0xab71('0x49')]]['calleridname']=queues[_0x489dde[_0xab71('0x54')]][_0xab71('0x5c')];queues[_0x489dde['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0xab71('0x17')]();queues[_0x489dde[_0xab71('0x49')]][_0xab71('0x1a')]=utils[_0xab71('0x17')]();queues[_0x489dde['transfereeuniqueid']]['holdtime']=0x0;queues[_0x489dde[_0xab71('0x49')]][_0xab71('0x5d')]=0x0;utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x5e'),_0x489dde[_0xab71('0x52')],queues[_0x489dde[_0xab71('0x49')]][_0xab71('0x1e')],queues[_0x489dde[_0xab71('0x49')]][_0xab71('0x9')],queues[_0x489dde[_0xab71('0x49')]][_0xab71('0x5c')]));}else{utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x5f'),_0x489dde[_0xab71('0x52')],queues[_0x489dde['origtransfererlinkedid']][_0xab71('0x1e')],_0x489dde[_0xab71('0x54')]));queues[_0x489dde['origtransfererlinkedid']]['transfereduniqueid']=_0x489dde[_0xab71('0x54')];}}}else if(_0x489dde[_0xab71('0x60')]==_0x489dde[_0xab71('0x54')]){if(!_[_0xab71('0x26')](queues[_0x489dde[_0xab71('0x53')]])){utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x61'),_0x489dde['origtransfereruniqueid'],queues[_0x489dde[_0xab71('0x53')]][_0xab71('0x1e')],_0x489dde[_0xab71('0x60')],_0x489dde[_0xab71('0x62')]));queues[_0x489dde[_0xab71('0x53')]][_0xab71('0x44')]=!![];queues[_0x489dde[_0xab71('0x53')]][_0xab71('0x57')]=_0xab71('0x58');queues[_0x489dde['origtransfererlinkedid']][_0xab71('0x4c')]=_0x489dde[_0xab71('0x62')];queues[_0x489dde[_0xab71('0x53')]][_0xab71('0x4d')]=_0x489dde[_0xab71('0x60')];queues[_0x489dde[_0xab71('0x53')]][_0xab71('0xb')]=_0xab71('0x63');}if(!_[_0xab71('0x26')](queues[_0x489dde[_0xab71('0x54')]])){if(_0x489dde[_0xab71('0x64')]&&queues[_0x489dde[_0xab71('0x64')]]){queues[_0x489dde['transfertargetlinkedid']][_0xab71('0x20')]=0x1;queues[_0x489dde['transfertargetuniqueid']]=_[_0xab71('0x5a')](queues[_0x489dde[_0xab71('0x64')]]);queues[_0x489dde[_0xab71('0x5b')]]['transfereduniqueid']=_0x489dde[_0xab71('0x5b')];queues[_0x489dde[_0xab71('0x5b')]]['queuecallerenterreason']=0x2;queues[_0x489dde[_0xab71('0x5b')]][_0xab71('0x9')]=queues[_0x489dde[_0xab71('0x53')]][_0xab71('0x9')];queues[_0x489dde['transfertargetuniqueid']]['calleridname']=queues[_0x489dde['origtransfererlinkedid']][_0xab71('0x5c')];queues[_0x489dde[_0xab71('0x5b')]][_0xab71('0x38')]=utils[_0xab71('0x17')]();queues[_0x489dde[_0xab71('0x5b')]]['queuecallerleaveAt']=utils[_0xab71('0x17')]();queues[_0x489dde['transfertargetuniqueid']][_0xab71('0x36')]=0x0;queues[_0x489dde[_0xab71('0x5b')]][_0xab71('0x5d')]=0x0;utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x65'),_0x489dde[_0xab71('0x52')],queues[_0x489dde[_0xab71('0x5b')]][_0xab71('0x1e')],queues[_0x489dde[_0xab71('0x5b')]]['transfereduniqueid'],queues[_0x489dde[_0xab71('0x5b')]][_0xab71('0x9')],queues[_0x489dde[_0xab71('0x5b')]][_0xab71('0x5c')]));}else{utils[_0xab71('0x3')](util[_0xab71('0x4')](_0xab71('0x5f'),_0x489dde[_0xab71('0x52')],queues[_0x489dde['secondtransfererlinkedid']][_0xab71('0x1e')],_0x489dde[_0xab71('0x53')]));queues[_0x489dde[_0xab71('0x54')]]['transfereduniqueid']=_0x489dde[_0xab71('0x53')];}}}}catch(_0x46d502){utils['error'](util[_0xab71('0x4')](_0xab71('0x51'),_0x489dde[_0xab71('0x52')]),_0x46d502);}};exports['musiconholdstart']=function(_0x46cee1){try{if(!_[_0xab71('0x26')](queues[_0x46cee1['uniqueid']])){utils['debug'](util[_0xab71('0x4')](_0xab71('0x66'),_0x46cee1[_0xab71('0x6')]),_0x46cee1);queues[_0x46cee1[_0xab71('0x6')]][_0xab71('0x67')]=utils[_0xab71('0x17')]();utils['info'](util[_0xab71('0x4')](_0xab71('0x68'),_0x46cee1[_0xab71('0x6')],queues[_0x46cee1['uniqueid']][_0xab71('0x1e')],queues[_0x46cee1[_0xab71('0x6')]]['musiconholdstartAt']));}}catch(_0x13c88b){utils[_0xab71('0x18')](util[_0xab71('0x4')](_0xab71('0x66'),_0x46cee1[_0xab71('0x6')]),_0x13c88b);}};exports[_0xab71('0x69')]=function(_0x512486){try{if(!_['isNil'](queues[_0x512486[_0xab71('0x6')]])){if(!_[_0xab71('0x26')](queues[_0x512486['uniqueid']][_0xab71('0x67')])){utils[_0xab71('0x12')](util[_0xab71('0x4')](_0xab71('0x6a'),_0x512486[_0xab71('0x6')]),_0x512486);queues[_0x512486[_0xab71('0x6')]][_0xab71('0x5d')]+=utils['diffTime'](utils[_0xab71('0x17')](),queues[_0x512486[_0xab71('0x6')]][_0xab71('0x67')]);utils['info'](util[_0xab71('0x4')](_0xab71('0x6b'),_0x512486['uniqueid'],queues[_0x512486[_0xab71('0x6')]][_0xab71('0x1e')],queues[_0x512486[_0xab71('0x6')]][_0xab71('0x5d')]));delete queues[_0x512486[_0xab71('0x6')]][_0xab71('0x67')];}}}catch(_0x1e5d52){utils[_0xab71('0x18')](util[_0xab71('0x4')](_0xab71('0x6a'),_0x512486[_0xab71('0x6')]),_0x1e5d52);}}; \ No newline at end of file +var _0x89e3=['secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','diffTime','[%s][queues][musiconholdstop]','lodash','util','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','now','COMPLETEDBYAGENT','queuecallerexitreason','transfereduniqueid','name','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentcomplete]','queuecallercompleteAt','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','origtransfererlinkedid','transfereelinkedid','clone','mohtime','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x89e3,0x75));var _0x389e=function(_0xee0966,_0x3d1505){_0xee0966=_0xee0966-0x0;var _0x13b8ca=_0x89e3[_0xee0966];return _0x13b8ca;};'use strict';var _=require(_0x389e('0x0'));var util=require(_0x389e('0x1'));var utils=require(_0x389e('0x2'));var queues={};function writeDB(_0x157ca0){utils['info'](util['format'](_0x389e('0x3'),_0x157ca0[_0x389e('0x4')],_0x157ca0[_0x389e('0x5')],_0x157ca0[_0x389e('0x6')],_0x157ca0['lastAssignedTo'],_0x157ca0[_0x389e('0x7')],_0x157ca0[_0x389e('0x8')],_0x157ca0['queuecallerexitreason']));if(_0x157ca0['queue']){utils[_0x389e('0x9')](_0x157ca0[_0x389e('0x6')])[_0x389e('0xa')](function(_0x2cb783){if(_0x2cb783){_0x157ca0['type']=_0x2cb783[_0x389e('0xb')];}utils['request'](_0x389e('0xc'),_0x157ca0);});}else{utils[_0x389e('0xd')](_0x389e('0xc'),_0x157ca0);}if(_0x157ca0['transfereduniqueid']){delete queues[_0x157ca0['transfereduniqueid']];}else{delete queues[_0x157ca0['uniqueid']];}}exports[_0x389e('0xe')]=function(_0x430396){try{utils[_0x389e('0xf')](util[_0x389e('0x10')](_0x389e('0x11'),_0x430396[_0x389e('0x4')]),_0x430396);utils[_0x389e('0x12')](util[_0x389e('0x10')](_0x389e('0x13'),_0x430396[_0x389e('0x4')],_0x430396[_0x389e('0x6')],_0x430396[_0x389e('0x14')]));queues[_0x430396[_0x389e('0x4')]]=_[_0x389e('0x15')](_0x430396,{'originalposition':_0x430396[_0x389e('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x18b700){utils[_0x389e('0x16')](util[_0x389e('0x10')](_0x389e('0x11'),_0x430396[_0x389e('0x4')]),_0x18b700);}};exports[_0x389e('0x17')]=function(_0xd39005){try{if(!_[_0x389e('0x18')](queues[_0xd39005[_0x389e('0x4')]])){utils['debug'](util['format'](_0x389e('0x19'),_0xd39005[_0x389e('0x4')]),_0xd39005);if(queues[_0xd39005[_0x389e('0x4')]][_0x389e('0x1a')]){if(!queues[_0xd39005[_0x389e('0x4')]][_0x389e('0x1b')]&&!queues[_0xd39005[_0x389e('0x4')]]['queuecallerexit']){queues[_0xd39005[_0x389e('0x4')]][_0x389e('0x1c')]=!![];queues[_0xd39005[_0x389e('0x4')]]['queuecallercompleteAt']=utils[_0x389e('0x1d')]();queues[_0xd39005['uniqueid']]['queuecallerexitreason']=_0x389e('0x1e');}utils[_0x389e('0x12')](util[_0x389e('0x10')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0xd39005[_0x389e('0x4')],queues[_0xd39005[_0x389e('0x4')]]['name'],queues[_0xd39005['uniqueid']][_0x389e('0x1f')]));writeDB(queues[_0xd39005['uniqueid']]);}else if(queues[_0xd39005[_0x389e('0x4')]][_0x389e('0x20')]){utils['info'](util[_0x389e('0x10')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0xd39005[_0x389e('0x4')],queues[_0xd39005[_0x389e('0x4')]][_0x389e('0x21')],queues[_0xd39005[_0x389e('0x4')]][_0x389e('0x20')]));queues[queues[_0xd39005[_0x389e('0x4')]][_0x389e('0x20')]]=queues[_0xd39005[_0x389e('0x4')]];queues[queues[_0xd39005[_0x389e('0x4')]]['transfereduniqueid']][_0x389e('0x22')]=0x2;delete queues[_0xd39005[_0x389e('0x4')]];}}}catch(_0x29f344){utils[_0x389e('0x16')](util[_0x389e('0x10')](_0x389e('0x19'),_0xd39005[_0x389e('0x4')]),_0x29f344);}};exports[_0x389e('0x23')]=function(_0x55919a){try{utils[_0x389e('0xf')](util[_0x389e('0x10')](_0x389e('0x24'),_0x55919a[_0x389e('0x4')]),_0x55919a);if(!_[_0x389e('0x18')](_0x55919a['variable'][_0x389e('0x25')])&&_0x55919a[_0x389e('0x26')][_0x389e('0x27')]()!==_0x389e('0x28')){if(!_['isNil'](queues[_0x55919a[_0x389e('0x4')]])){queues[_0x55919a['uniqueid']][_0x389e('0x1b')]=![];queues[_0x55919a[_0x389e('0x4')]]['queuecallerabandonAt']=null;queues[_0x55919a[_0x389e('0x4')]][_0x389e('0x29')]=!![];queues[_0x55919a[_0x389e('0x4')]][_0x389e('0x2a')]=utils[_0x389e('0x1d')]();queues[_0x55919a['uniqueid']]['queuecallerexitreason']=_0x55919a['value']['toUpperCase']();utils[_0x389e('0x12')](util['format'](_0x389e('0x2b'),_0x55919a[_0x389e('0x4')],queues[_0x55919a[_0x389e('0x4')]]['name'],_0x55919a[_0x389e('0x26')],queues[_0x55919a[_0x389e('0x4')]][_0x389e('0x1f')]));writeDB(queues[_0x55919a['uniqueid']]);}}else if(!_[_0x389e('0x18')](_0x55919a['variable'][_0x389e('0x2c')])){if(!_[_0x389e('0x18')](queues[_0x55919a[_0x389e('0x4')]])&&!queues[_0x55919a[_0x389e('0x4')]][_0x389e('0x1b')]){queues[_0x55919a[_0x389e('0x4')]]['queuecallerabandon']=![];queues[_0x55919a[_0x389e('0x4')]][_0x389e('0x2d')]=null;queues[_0x55919a[_0x389e('0x4')]]['queuecallerexit']=!![];queues[_0x55919a['uniqueid']][_0x389e('0x2a')]=utils[_0x389e('0x1d')]();queues[_0x55919a[_0x389e('0x4')]][_0x389e('0x1f')]='EXITWITHKEY';utils[_0x389e('0x12')](util['format'](_0x389e('0x2e'),_0x55919a[_0x389e('0x4')],queues[_0x55919a[_0x389e('0x4')]][_0x389e('0x21')],_0x55919a['value'],queues[_0x55919a['uniqueid']][_0x389e('0x1f')]));}}}catch(_0x43d3d8){utils[_0x389e('0x16')](util[_0x389e('0x10')](_0x389e('0x24'),_0x55919a[_0x389e('0x4')]),_0x43d3d8);}};exports['queuecallerabandon']=function(_0x1a6522){try{if(!_[_0x389e('0x18')](queues[_0x1a6522[_0x389e('0x4')]])){utils['debug'](util[_0x389e('0x10')](_0x389e('0x2f'),_0x1a6522[_0x389e('0x4')]),_0x1a6522);queues[_0x1a6522[_0x389e('0x4')]]['queuecallerexit']=![];queues[_0x1a6522['uniqueid']][_0x389e('0x2a')]=null;queues[_0x1a6522[_0x389e('0x4')]][_0x389e('0x1b')]=!![];queues[_0x1a6522[_0x389e('0x4')]][_0x389e('0x2d')]=utils['now']();queues[_0x1a6522['uniqueid']][_0x389e('0x1f')]=_0x389e('0x30');utils['info'](util[_0x389e('0x10')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x1a6522[_0x389e('0x4')],queues[_0x1a6522['uniqueid']][_0x389e('0x21')],queues[_0x1a6522['uniqueid']]['queuecallerexitreason']));}}catch(_0x1854c7){utils['error'](util[_0x389e('0x10')](_0x389e('0x2f'),_0x1a6522[_0x389e('0x4')]),_0x1854c7);}};exports[_0x389e('0x31')]=function(_0x426bf0){try{if(!_[_0x389e('0x18')](queues[_0x426bf0[_0x389e('0x4')]])){utils[_0x389e('0xf')](util[_0x389e('0x10')]('[%s][queues][queuecallerleave]',_0x426bf0[_0x389e('0x4')]),_0x426bf0);utils[_0x389e('0x12')](util[_0x389e('0x10')](_0x389e('0x32'),_0x426bf0[_0x389e('0x4')],queues[_0x426bf0[_0x389e('0x4')]][_0x389e('0x21')],_0x426bf0[_0x389e('0x33')],_0x426bf0[_0x389e('0x34')]));queues[_0x426bf0[_0x389e('0x4')]][_0x389e('0x31')]=!![];queues[_0x426bf0['uniqueid']]['queuecallerleaveAt']=utils[_0x389e('0x1d')]();queues[_0x426bf0[_0x389e('0x4')]][_0x389e('0x35')]=utils['diffTime'](queues[_0x426bf0[_0x389e('0x4')]]['queuecallerleaveAt'],queues[_0x426bf0['uniqueid']][_0x389e('0x36')]);queues[_0x426bf0[_0x389e('0x4')]][_0x389e('0x14')]=_0x426bf0[_0x389e('0x14')];queues[_0x426bf0[_0x389e('0x4')]][_0x389e('0x37')]=_0x426bf0[_0x389e('0x37')];queues[_0x426bf0[_0x389e('0x4')]][_0x389e('0x33')]=_0x426bf0[_0x389e('0x33')];queues[_0x426bf0[_0x389e('0x4')]][_0x389e('0x34')]=_0x426bf0[_0x389e('0x34')];}}catch(_0x2547ec){utils[_0x389e('0x16')](util[_0x389e('0x10')]('[%s][queues][queuecallerleave]',_0x426bf0[_0x389e('0x4')]),_0x2547ec);}};exports[_0x389e('0x38')]=function(_0x790a74){try{if(!_[_0x389e('0x18')](queues[_0x790a74[_0x389e('0x4')]])){utils['debug'](util[_0x389e('0x10')](_0x389e('0x39'),_0x790a74[_0x389e('0x4')]),_0x790a74);utils[_0x389e('0x12')](util[_0x389e('0x10')](_0x389e('0x3a'),_0x790a74[_0x389e('0x4')],queues[_0x790a74[_0x389e('0x4')]][_0x389e('0x21')],_0x790a74[_0x389e('0x3b')],_0x790a74[_0x389e('0x3c')]));queues[_0x790a74[_0x389e('0x4')]]['queuecallerabandon']=![];queues[_0x790a74[_0x389e('0x4')]][_0x389e('0x1b')]=![];queues[_0x790a74[_0x389e('0x4')]][_0x389e('0x2d')]=null;queues[_0x790a74[_0x389e('0x4')]][_0x389e('0x29')]=![];queues[_0x790a74[_0x389e('0x4')]][_0x389e('0x1f')]=null;queues[_0x790a74[_0x389e('0x4')]][_0x389e('0x2a')]=null;queues[_0x790a74['uniqueid']][_0x389e('0x3d')]=!![];queues[_0x790a74[_0x389e('0x4')]][_0x389e('0x8')]=_0x790a74[_0x389e('0x3c')];queues[_0x790a74[_0x389e('0x4')]][_0x389e('0x3e')]=_0x790a74['membername'];}}catch(_0x55ed34){utils[_0x389e('0x16')](util[_0x389e('0x10')]('[%s][queues][agentconnect]',_0x790a74['uniqueid']),_0x55ed34);}};exports['agentcomplete']=function(_0x41d7b8){try{if(!_[_0x389e('0x18')](queues[_0x41d7b8[_0x389e('0x4')]])){if(queues[_0x41d7b8['uniqueid']][_0x389e('0x1a')]){utils[_0x389e('0xf')](util[_0x389e('0x10')](_0x389e('0x3f'),_0x41d7b8[_0x389e('0x4')]),_0x41d7b8);queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x1b')]=![];queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x1b')]=![];queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x2d')]=null;queues[_0x41d7b8['uniqueid']]['queuecallerexit']=![];queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x2a')]=null;queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x3d')]=!![];queues[_0x41d7b8['uniqueid']][_0x389e('0x3e')]=_0x41d7b8[_0x389e('0x3b')];queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x1c')]=!![];queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x40')]=utils[_0x389e('0x1d')]();if(_0x41d7b8['reason']==_0x389e('0x41')){if(!queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x41')]){queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x1f')]='TRANSFER';}}else{queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x1f')]=_0x389e('0x42')+_0x41d7b8[_0x389e('0x43')][_0x389e('0x27')]();}utils[_0x389e('0x12')](util['format'](_0x389e('0x44'),_0x41d7b8[_0x389e('0x4')],queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x21')],_0x41d7b8[_0x389e('0x3b')],queues[_0x41d7b8[_0x389e('0x4')]][_0x389e('0x1f')]));writeDB(queues[_0x41d7b8[_0x389e('0x4')]]);}}}catch(_0x57e384){utils[_0x389e('0x16')](util['format'](_0x389e('0x3f'),_0x41d7b8[_0x389e('0x4')]),_0x57e384);}};exports[_0x389e('0x45')]=function(_0x1eb1e3){try{if(!_[_0x389e('0x18')](queues[_0x1eb1e3[_0x389e('0x46')]])){utils[_0x389e('0xf')](util[_0x389e('0x10')](_0x389e('0x47'),_0x1eb1e3[_0x389e('0x4')]),_0x1eb1e3);queues[_0x1eb1e3['transfereeuniqueid']][_0x389e('0x41')]=!![];queues[_0x1eb1e3['transfereeuniqueid']][_0x389e('0x48')]=_0x389e('0x49');queues[_0x1eb1e3[_0x389e('0x46')]][_0x389e('0x4a')]=_0x1eb1e3[_0x389e('0x4b')];queues[_0x1eb1e3['transfereeuniqueid']][_0x389e('0x4c')]=_0x1eb1e3[_0x389e('0x46')];queues[_0x1eb1e3[_0x389e('0x46')]][_0x389e('0x1f')]=_0x389e('0x4d');utils[_0x389e('0x12')](util[_0x389e('0x10')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x1eb1e3[_0x389e('0x4')],queues[_0x1eb1e3[_0x389e('0x46')]][_0x389e('0x21')],_0x1eb1e3[_0x389e('0x46')],_0x1eb1e3['extension']));}}catch(_0x5428ec){utils[_0x389e('0x16')](util[_0x389e('0x10')](_0x389e('0x47'),_0x1eb1e3[_0x389e('0x4')]),_0x5428ec);}};exports[_0x389e('0x4e')]=function(_0xd72485){try{utils[_0x389e('0xf')](util[_0x389e('0x10')](_0x389e('0x4f'),_0xd72485[_0x389e('0x50')]),_0xd72485);if(_0xd72485[_0x389e('0x50')]==_0xd72485['origtransfererlinkedid']){if(!_[_0x389e('0x18')](queues[_0xd72485['secondtransfererlinkedid']])){utils['info'](util['format'](_0x389e('0x51'),_0xd72485[_0x389e('0x50')],queues[_0xd72485[_0x389e('0x52')]][_0x389e('0x21')],_0xd72485[_0x389e('0x53')]));queues[_0xd72485['secondtransfererlinkedid']][_0x389e('0x41')]=!![];queues[_0xd72485[_0x389e('0x52')]][_0x389e('0x48')]=_0x389e('0x54');queues[_0xd72485['secondtransfererlinkedid']][_0x389e('0x4a')]=_0xd72485[_0x389e('0x53')];queues[_0xd72485[_0x389e('0x52')]][_0x389e('0x4c')]=_0xd72485['origtransfereruniqueid'];queues[_0xd72485['secondtransfererlinkedid']][_0x389e('0x1f')]='ATTENDEDTRANSFER';}if(!_[_0x389e('0x18')](queues[_0xd72485[_0x389e('0x55')]])){if(_0xd72485[_0x389e('0x56')]&&queues[_0xd72485[_0x389e('0x56')]]){queues[_0xd72485[_0x389e('0x56')]][_0x389e('0x22')]=0x1;queues[_0xd72485[_0x389e('0x46')]]=_[_0x389e('0x57')](queues[_0xd72485[_0x389e('0x56')]]);queues[_0xd72485[_0x389e('0x46')]]['transfereduniqueid']=_0xd72485['transfertargetuniqueid'];queues[_0xd72485[_0x389e('0x46')]]['queuecallerenterreason']=0x2;queues[_0xd72485[_0x389e('0x46')]][_0x389e('0x7')]=queues[_0xd72485[_0x389e('0x52')]][_0x389e('0x7')];queues[_0xd72485[_0x389e('0x46')]]['calleridname']=queues[_0xd72485[_0x389e('0x52')]]['calleridname'];queues[_0xd72485[_0x389e('0x46')]][_0x389e('0x36')]=utils[_0x389e('0x1d')]();queues[_0xd72485[_0x389e('0x46')]]['queuecallerleaveAt']=utils['now']();queues[_0xd72485[_0x389e('0x46')]][_0x389e('0x35')]=0x0;queues[_0xd72485[_0x389e('0x46')]][_0x389e('0x58')]=0x0;utils[_0x389e('0x12')](util[_0x389e('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0xd72485[_0x389e('0x50')],queues[_0xd72485[_0x389e('0x46')]][_0x389e('0x21')],queues[_0xd72485[_0x389e('0x46')]][_0x389e('0x7')],queues[_0xd72485[_0x389e('0x46')]][_0x389e('0x59')]));}else{utils['info'](util[_0x389e('0x10')](_0x389e('0x5a'),_0xd72485['origtransfereruniqueid'],queues[_0xd72485['origtransfererlinkedid']][_0x389e('0x21')],_0xd72485[_0x389e('0x52')]));queues[_0xd72485[_0x389e('0x55')]][_0x389e('0x20')]=_0xd72485['secondtransfererlinkedid'];}}}else if(_0xd72485['secondtransfereruniqueid']==_0xd72485[_0x389e('0x52')]){if(!_[_0x389e('0x18')](queues[_0xd72485['origtransfererlinkedid']])){utils['info'](util[_0x389e('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0xd72485[_0x389e('0x50')],queues[_0xd72485[_0x389e('0x55')]][_0x389e('0x21')],_0xd72485[_0x389e('0x5b')],_0xd72485['secondtransfererexten']));queues[_0xd72485['origtransfererlinkedid']][_0x389e('0x41')]=!![];queues[_0xd72485[_0x389e('0x55')]][_0x389e('0x48')]=_0x389e('0x54');queues[_0xd72485[_0x389e('0x55')]][_0x389e('0x4a')]=_0xd72485[_0x389e('0x5c')];queues[_0xd72485['origtransfererlinkedid']]['transferuniqueid']=_0xd72485[_0x389e('0x5b')];queues[_0xd72485[_0x389e('0x55')]]['queuecallerexitreason']=_0x389e('0x5d');}if(!_['isNil'](queues[_0xd72485[_0x389e('0x52')]])){if(_0xd72485[_0x389e('0x5e')]&&queues[_0xd72485[_0x389e('0x5e')]]){queues[_0xd72485[_0x389e('0x5e')]][_0x389e('0x22')]=0x1;queues[_0xd72485['transfertargetuniqueid']]=_['clone'](queues[_0xd72485[_0x389e('0x5e')]]);queues[_0xd72485[_0x389e('0x5f')]][_0x389e('0x20')]=_0xd72485[_0x389e('0x5f')];queues[_0xd72485[_0x389e('0x5f')]]['queuecallerenterreason']=0x2;queues[_0xd72485['transfertargetuniqueid']][_0x389e('0x7')]=queues[_0xd72485[_0x389e('0x55')]][_0x389e('0x7')];queues[_0xd72485[_0x389e('0x5f')]]['calleridname']=queues[_0xd72485[_0x389e('0x55')]][_0x389e('0x59')];queues[_0xd72485[_0x389e('0x5f')]][_0x389e('0x36')]=utils[_0x389e('0x1d')]();queues[_0xd72485['transfertargetuniqueid']][_0x389e('0x1a')]=utils[_0x389e('0x1d')]();queues[_0xd72485['transfertargetuniqueid']][_0x389e('0x35')]=0x0;queues[_0xd72485[_0x389e('0x5f')]][_0x389e('0x58')]=0x0;utils['info'](util[_0x389e('0x10')](_0x389e('0x60'),_0xd72485[_0x389e('0x50')],queues[_0xd72485['transfertargetuniqueid']][_0x389e('0x21')],queues[_0xd72485['transfertargetuniqueid']][_0x389e('0x20')],queues[_0xd72485['transfertargetuniqueid']][_0x389e('0x7')],queues[_0xd72485[_0x389e('0x5f')]][_0x389e('0x59')]));}else{utils[_0x389e('0x12')](util[_0x389e('0x10')](_0x389e('0x5a'),_0xd72485[_0x389e('0x50')],queues[_0xd72485['secondtransfererlinkedid']]['name'],_0xd72485[_0x389e('0x55')]));queues[_0xd72485[_0x389e('0x52')]]['transfereduniqueid']=_0xd72485[_0x389e('0x55')];}}}}catch(_0x18f0d0){utils[_0x389e('0x16')](util[_0x389e('0x10')]('[%s][queues][attendedtransfer]',_0xd72485[_0x389e('0x50')]),_0x18f0d0);}};exports[_0x389e('0x61')]=function(_0x176eed){try{if(!_[_0x389e('0x18')](queues[_0x176eed[_0x389e('0x4')]])){utils['debug'](util[_0x389e('0x10')](_0x389e('0x62'),_0x176eed[_0x389e('0x4')]),_0x176eed);queues[_0x176eed[_0x389e('0x4')]][_0x389e('0x63')]=utils['now']();utils[_0x389e('0x12')](util[_0x389e('0x10')](_0x389e('0x64'),_0x176eed[_0x389e('0x4')],queues[_0x176eed['uniqueid']][_0x389e('0x21')],queues[_0x176eed[_0x389e('0x4')]]['musiconholdstartAt']));}}catch(_0x3e5248){utils[_0x389e('0x16')](util['format'](_0x389e('0x62'),_0x176eed[_0x389e('0x4')]),_0x3e5248);}};exports[_0x389e('0x65')]=function(_0x5306d2){try{if(!_[_0x389e('0x18')](queues[_0x5306d2['uniqueid']])){if(!_[_0x389e('0x18')](queues[_0x5306d2[_0x389e('0x4')]][_0x389e('0x63')])){utils[_0x389e('0xf')](util['format']('[%s][queues][musiconholdstop]',_0x5306d2['uniqueid']),_0x5306d2);queues[_0x5306d2[_0x389e('0x4')]][_0x389e('0x58')]+=utils[_0x389e('0x66')](utils['now'](),queues[_0x5306d2[_0x389e('0x4')]][_0x389e('0x63')]);utils[_0x389e('0x12')](util[_0x389e('0x10')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x5306d2[_0x389e('0x4')],queues[_0x5306d2[_0x389e('0x4')]][_0x389e('0x21')],queues[_0x5306d2['uniqueid']][_0x389e('0x58')]));delete queues[_0x5306d2[_0x389e('0x4')]][_0x389e('0x63')];}}}catch(_0x2c41c0){utils[_0x389e('0x16')](util['format'](_0x389e('0x67'),_0x5306d2[_0x389e('0x4')]),_0x2c41c0);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index cee25c2..40e6ec7 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 _0x6a31=['blinds','accountcode','then','membername','name','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','debug','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','.wav49','.WAV','find','push','value','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','monitors','forEach','clone','newexten','[%s][recordings][newexten]','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid'];(function(_0x51d3bd,_0x35b279){var _0x494938=function(_0x25e30e){while(--_0x25e30e){_0x51d3bd['push'](_0x51d3bd['shift']());}};_0x494938(++_0x35b279);}(_0x6a31,0x1e4));var _0x16a3=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x6a31[_0x2ca9d4];return _0x258956;};'use strict';var _=require('lodash');var util=require(_0x16a3('0x0'));var utils=require(_0x16a3('0x1'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x52b9f1){var _0x32b985;utils[_0x16a3('0x2')](util[_0x16a3('0x3')](_0x16a3('0x4'),_0x52b9f1[_0x16a3('0x5')]));if(transfers[_0x16a3('0x6')][_0x52b9f1[_0x16a3('0x5')]]){_0x32b985=_0x52b9f1['uniqueid'];_0x52b9f1[_0x16a3('0x5')]=transfers[_0x16a3('0x6')][_0x52b9f1[_0x16a3('0x5')]]['transfereeuniqueid'];}if(_0x52b9f1[_0x16a3('0x7')]){utils['getUserByInternal'](_0x52b9f1[_0x16a3('0x7')])[_0x16a3('0x8')](function(_0x17a19f){if(_0x17a19f){_0x52b9f1[_0x16a3('0x9')]=_0x17a19f[_0x16a3('0xa')];_0x52b9f1['UserId']=_0x17a19f['id'];}utils[_0x16a3('0xb')](_0x16a3('0xc'),_0x52b9f1);});}else{utils[_0x16a3('0xb')](_0x16a3('0xc'),_0x52b9f1);}if(_0x32b985)delete transfers[_0x16a3('0x6')][_0x32b985];}exports[_0x16a3('0xd')]=function(_0x44c074){try{utils['debug'](util[_0x16a3('0x3')](_0x16a3('0xe'),_0x44c074[_0x16a3('0x5')]),_0x44c074);if(_0x44c074[_0x16a3('0x5')]==_0x44c074[_0x16a3('0xf')]){utils[_0x16a3('0x2')](util[_0x16a3('0x3')](_0x16a3('0x10'),_0x44c074[_0x16a3('0x5')],_0x44c074[_0x16a3('0x11')],_0x44c074[_0x16a3('0x12')]));recordings[_0x44c074['uniqueid']]={'uniqueid':_0x44c074[_0x16a3('0x5')],'accountcode':_0x44c074[_0x16a3('0x7')],'exten':_0x44c074['exten'],'context':_0x44c074[_0x16a3('0x11')],'channel':_0x44c074[_0x16a3('0x13')],'monitors':[]};}}catch(_0x3bfb34){utils['error'](util[_0x16a3('0x3')](_0x16a3('0xe'),_0x44c074[_0x16a3('0x5')]),_0x3bfb34);}};exports[_0x16a3('0x14')]=function(_0x2df843){try{utils[_0x16a3('0x15')](util['format']('[%s][recordings][newstate]',_0x2df843[_0x16a3('0x5')]),_0x2df843);if(!_[_0x16a3('0x16')](recordings[_0x2df843[_0x16a3('0x5')]])&&_0x2df843[_0x16a3('0x17')]==0x6){utils[_0x16a3('0x2')](util[_0x16a3('0x3')](_0x16a3('0x18'),_0x2df843[_0x16a3('0x5')],_0x2df843[_0x16a3('0x11')],_0x2df843[_0x16a3('0x13')]));}else if(!_['isNil'](recordings[_0x2df843[_0x16a3('0xf')]])&&_0x2df843['channelstate']==0x6&&_0x2df843[_0x16a3('0x11')]!=_0x16a3('0x19')){utils['info'](util[_0x16a3('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2df843[_0x16a3('0x5')],_0x2df843[_0x16a3('0xf')],_0x2df843[_0x16a3('0x11')],_0x2df843[_0x16a3('0x13')]));recordings[_0x2df843[_0x16a3('0xf')]][_0x16a3('0x7')]=_0x2df843[_0x16a3('0x7')];}}catch(_0xd2a60){utils[_0x16a3('0x1a')](util['format']('[%s][recordings][newstate]',_0x2df843['uniqueid']),_0xd2a60);}};exports[_0x16a3('0x1b')]=function(_0x1bcaa2){try{if(!_[_0x16a3('0x16')](_0x1bcaa2['variable'])&&!_[_0x16a3('0x16')](_0x1bcaa2[_0x16a3('0x1c')][_0x16a3('0x1d')])){utils[_0x16a3('0x15')](util[_0x16a3('0x3')](_0x16a3('0x1e'),_0x1bcaa2['uniqueid']),_0x1bcaa2);utils['info'](util[_0x16a3('0x3')](_0x16a3('0x1f'),_0x1bcaa2[_0x16a3('0x5')],_0x1bcaa2['variable'],_0x1bcaa2['value']));if(_[_0x16a3('0x20')](_0x1bcaa2['value'],_0x16a3('0x21'))){_0x1bcaa2['value']=_0x1bcaa2['value']['replace']('.wav49',_0x16a3('0x22'));}if(recordings[_0x1bcaa2[_0x16a3('0xf')]]){var _0x19554b=_[_0x16a3('0x23')](recordings[_0x1bcaa2['linkedid']]['monitors'],{'value':_0x1bcaa2['value']});if(_[_0x16a3('0x16')](_0x19554b)){recordings[_0x1bcaa2[_0x16a3('0xf')]]['monitors'][_0x16a3('0x24')]({'value':_0x1bcaa2[_0x16a3('0x25')]});}}}}catch(_0x2ac88f){utils[_0x16a3('0x1a')](util[_0x16a3('0x3')](_0x16a3('0x1e'),_0x1bcaa2[_0x16a3('0x5')]),_0x2ac88f);}};exports[_0x16a3('0x26')]=function(_0x4e51af){try{if(!_[_0x16a3('0x16')](recordings[_0x4e51af[_0x16a3('0x5')]])){utils[_0x16a3('0x15')](util[_0x16a3('0x3')](_0x16a3('0x27'),_0x4e51af[_0x16a3('0x5')]),_0x4e51af);utils[_0x16a3('0x2')](util[_0x16a3('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4e51af[_0x16a3('0x5')],_0x4e51af[_0x16a3('0x28')],_0x4e51af['calleridname'],_0x4e51af['cause-txt']));recordings[_0x4e51af[_0x16a3('0x5')]][_0x16a3('0x28')]=_0x4e51af['calleridnum'];recordings[_0x4e51af[_0x16a3('0x5')]]['calleridname']=_0x4e51af[_0x16a3('0x29')];recordings[_0x4e51af[_0x16a3('0x5')]][_0x16a3('0x2a')]=_0x4e51af[_0x16a3('0x2a')];recordings[_0x4e51af[_0x16a3('0x5')]][_0x16a3('0x2b')]=_0x4e51af[_0x16a3('0x2b')];if(recordings[_0x4e51af[_0x16a3('0x5')]]['type']==_0x16a3('0x2c')&&recordings[_0x4e51af[_0x16a3('0x5')]][_0x16a3('0x7')]){recordings[_0x4e51af[_0x16a3('0x5')]][_0x16a3('0x2a')]=recordings[_0x4e51af[_0x16a3('0x5')]][_0x16a3('0x7')];recordings[_0x4e51af[_0x16a3('0x5')]][_0x16a3('0x2b')]='';}recordings[_0x4e51af['uniqueid']][_0x16a3('0x2d')][_0x16a3('0x2e')](function(_0x5c9947){var _0x3dd8c5=_[_0x16a3('0x2f')](recordings[_0x4e51af[_0x16a3('0x5')]]);_0x3dd8c5[_0x16a3('0x25')]=_0x5c9947[_0x16a3('0x25')];writeDB(_0x3dd8c5);});delete recordings[_0x4e51af['uniqueid']];}}catch(_0x2db7d1){utils[_0x16a3('0x1a')](util[_0x16a3('0x3')](_0x16a3('0x27'),_0x4e51af[_0x16a3('0x5')]),_0x2db7d1);}};exports[_0x16a3('0x30')]=function(_0x245fc7){try{if(!_[_0x16a3('0x16')](recordings[_0x245fc7[_0x16a3('0x5')]])){utils[_0x16a3('0x15')](util[_0x16a3('0x3')](_0x16a3('0x31'),_0x245fc7[_0x16a3('0x5')]),_0x245fc7);utils['info'](util[_0x16a3('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x245fc7[_0x16a3('0x5')],_0x245fc7[_0x16a3('0x32')],_0x245fc7['appdata']));if(_0x245fc7[_0x16a3('0x32')][_0x16a3('0x33')]()==_0x16a3('0x34')&&_[_0x16a3('0x35')](_0x245fc7[_0x16a3('0x36')][_0x16a3('0x33')](),'cdr')){var _0x1598da=_0x245fc7[_0x16a3('0x36')][_0x16a3('0x37')]('=');var _0xd3ed17=_0x1598da[0x0][_0x16a3('0x38')](_0x1598da[0x0][_0x16a3('0x39')]('(')+0x1,_0x1598da[0x0][_0x16a3('0x39')](')'));var _0x8aefcc=_0x1598da[0x1];recordings[_0x245fc7[_0x16a3('0x5')]][_0xd3ed17]=_0x8aefcc;}}}catch(_0x3ffbf0){utils[_0x16a3('0x1a')](util[_0x16a3('0x3')]('[%s][recordings][newexten]',_0x245fc7[_0x16a3('0x5')]),_0x3ffbf0);}};exports[_0x16a3('0x3a')]=function(_0x1ded5f){try{if(!_[_0x16a3('0x16')](recordings[_0x1ded5f[_0x16a3('0x5')]])){utils['debug'](util[_0x16a3('0x3')]('[%s][recordings][queuecallerjoin]',_0x1ded5f[_0x16a3('0x5')]),_0x1ded5f);utils[_0x16a3('0x2')](util[_0x16a3('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1ded5f[_0x16a3('0x5')],_0x1ded5f[_0x16a3('0x3b')]));recordings[_0x1ded5f[_0x16a3('0x5')]][_0x16a3('0x3b')]=_0x1ded5f[_0x16a3('0x3b')];}}catch(_0x1aca43){utils[_0x16a3('0x1a')](util[_0x16a3('0x3')](_0x16a3('0x3c'),_0x1ded5f[_0x16a3('0x5')]),_0x1aca43);}};exports[_0x16a3('0x3d')]=function(_0x1f8a9e){try{utils[_0x16a3('0x15')](util[_0x16a3('0x3')](_0x16a3('0x3e'),_0x1f8a9e['uniqueid']),_0x1f8a9e);utils[_0x16a3('0x2')](util['format'](_0x16a3('0x3f'),_0x1f8a9e[_0x16a3('0x5')],_0x1f8a9e[_0x16a3('0x40')],_0x1f8a9e[_0x16a3('0x41')],_0x1f8a9e[_0x16a3('0x42')],_0x1f8a9e[_0x16a3('0x43')]));if(recordings[_0x1f8a9e['transfereruniqueid']]&&transfers[_0x16a3('0x6')][_0x1f8a9e[_0x16a3('0x44')]]){transfers[_0x16a3('0x6')][_0x1f8a9e[_0x16a3('0x44')]][_0x16a3('0x45')]=!![];}}catch(_0x227570){utils[_0x16a3('0x1a')](util['format']('[%s][recordings][blindtransfer]',_0x1f8a9e[_0x16a3('0x5')]),_0x227570);}}; \ No newline at end of file +var _0x6761=['.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','./utils','./transfers.controller','format','uniqueid','blinds','accountcode','then','membername','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','value','endsWith'];(function(_0x42f687,_0x558724){var _0x108838=function(_0x725814){while(--_0x725814){_0x42f687['push'](_0x42f687['shift']());}};_0x108838(++_0x558724);}(_0x6761,0xad));var _0x1676=function(_0x3612af,_0x1961c5){_0x3612af=_0x3612af-0x0;var _0x33f4b8=_0x6761[_0x3612af];return _0x33f4b8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x1676('0x0'));var transfers=require(_0x1676('0x1'));var recordings={};function writeDB(_0x83f1b3){var _0x3ea8b0;utils['info'](util[_0x1676('0x2')]('[%s][recordings][writeDB]',_0x83f1b3[_0x1676('0x3')]));if(transfers[_0x1676('0x4')][_0x83f1b3[_0x1676('0x3')]]){_0x3ea8b0=_0x83f1b3[_0x1676('0x3')];_0x83f1b3['uniqueid']=transfers['blinds'][_0x83f1b3[_0x1676('0x3')]]['transfereeuniqueid'];}if(_0x83f1b3[_0x1676('0x5')]){utils['getUserByInternal'](_0x83f1b3['accountcode'])[_0x1676('0x6')](function(_0x11a334){if(_0x11a334){_0x83f1b3[_0x1676('0x7')]=_0x11a334['name'];_0x83f1b3[_0x1676('0x8')]=_0x11a334['id'];}utils[_0x1676('0x9')]('CreateVoiceRecording',_0x83f1b3);});}else{utils[_0x1676('0x9')](_0x1676('0xa'),_0x83f1b3);}if(_0x3ea8b0)delete transfers[_0x1676('0x4')][_0x3ea8b0];}exports['newchannel']=function(_0x2dc554){try{utils[_0x1676('0xb')](util[_0x1676('0x2')](_0x1676('0xc'),_0x2dc554['uniqueid']),_0x2dc554);if(_0x2dc554['uniqueid']==_0x2dc554[_0x1676('0xd')]){utils[_0x1676('0xe')](util[_0x1676('0x2')](_0x1676('0xf'),_0x2dc554[_0x1676('0x3')],_0x2dc554[_0x1676('0x10')],_0x2dc554[_0x1676('0x11')]));recordings[_0x2dc554['uniqueid']]={'uniqueid':_0x2dc554['uniqueid'],'accountcode':_0x2dc554[_0x1676('0x5')],'exten':_0x2dc554[_0x1676('0x11')],'context':_0x2dc554[_0x1676('0x10')],'channel':_0x2dc554[_0x1676('0x12')],'monitors':[]};}}catch(_0x55ced3){utils[_0x1676('0x13')](util[_0x1676('0x2')](_0x1676('0xc'),_0x2dc554[_0x1676('0x3')]),_0x55ced3);}};exports['newstate']=function(_0x2cb4f4){try{utils[_0x1676('0xb')](util[_0x1676('0x2')]('[%s][recordings][newstate]',_0x2cb4f4[_0x1676('0x3')]),_0x2cb4f4);if(!_[_0x1676('0x14')](recordings[_0x2cb4f4[_0x1676('0x3')]])&&_0x2cb4f4[_0x1676('0x15')]==0x6){utils['info'](util[_0x1676('0x2')](_0x1676('0x16'),_0x2cb4f4[_0x1676('0x3')],_0x2cb4f4[_0x1676('0x10')],_0x2cb4f4[_0x1676('0x12')]));}else if(!_[_0x1676('0x14')](recordings[_0x2cb4f4[_0x1676('0xd')]])&&_0x2cb4f4[_0x1676('0x15')]==0x6&&_0x2cb4f4[_0x1676('0x10')]!=_0x1676('0x17')){utils[_0x1676('0xe')](util[_0x1676('0x2')](_0x1676('0x18'),_0x2cb4f4[_0x1676('0x3')],_0x2cb4f4[_0x1676('0xd')],_0x2cb4f4[_0x1676('0x10')],_0x2cb4f4[_0x1676('0x12')]));recordings[_0x2cb4f4[_0x1676('0xd')]]['accountcode']=_0x2cb4f4[_0x1676('0x5')];}}catch(_0x95f224){utils[_0x1676('0x13')](util[_0x1676('0x2')](_0x1676('0x19'),_0x2cb4f4[_0x1676('0x3')]),_0x95f224);}};exports[_0x1676('0x1a')]=function(_0x3cd8c3){try{if(!_[_0x1676('0x14')](_0x3cd8c3[_0x1676('0x1b')])&&!_[_0x1676('0x14')](_0x3cd8c3[_0x1676('0x1b')][_0x1676('0x1c')])){utils[_0x1676('0xb')](util[_0x1676('0x2')]('[%s][recordings][varset]',_0x3cd8c3[_0x1676('0x3')]),_0x3cd8c3);utils['info'](util[_0x1676('0x2')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3cd8c3[_0x1676('0x3')],_0x3cd8c3[_0x1676('0x1b')],_0x3cd8c3[_0x1676('0x1d')]));if(_[_0x1676('0x1e')](_0x3cd8c3['value'],'.wav49')){_0x3cd8c3[_0x1676('0x1d')]=_0x3cd8c3[_0x1676('0x1d')]['replace'](_0x1676('0x1f'),_0x1676('0x20'));}if(recordings[_0x3cd8c3[_0x1676('0xd')]]){var _0x1aedc0=_[_0x1676('0x21')](recordings[_0x3cd8c3[_0x1676('0xd')]][_0x1676('0x22')],{'value':_0x3cd8c3['value']});if(_[_0x1676('0x14')](_0x1aedc0)){recordings[_0x3cd8c3[_0x1676('0xd')]][_0x1676('0x22')][_0x1676('0x23')]({'value':_0x3cd8c3[_0x1676('0x1d')]});}}}}catch(_0x56a209){utils[_0x1676('0x13')](util['format'](_0x1676('0x24'),_0x3cd8c3[_0x1676('0x3')]),_0x56a209);}};exports['hangup']=function(_0x4fc57f){try{if(!_[_0x1676('0x14')](recordings[_0x4fc57f[_0x1676('0x3')]])){utils[_0x1676('0xb')](util['format'](_0x1676('0x25'),_0x4fc57f[_0x1676('0x3')]),_0x4fc57f);utils[_0x1676('0xe')](util[_0x1676('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4fc57f['uniqueid'],_0x4fc57f['calleridnum'],_0x4fc57f[_0x1676('0x26')],_0x4fc57f[_0x1676('0x27')]));recordings[_0x4fc57f[_0x1676('0x3')]][_0x1676('0x28')]=_0x4fc57f[_0x1676('0x28')];recordings[_0x4fc57f[_0x1676('0x3')]][_0x1676('0x26')]=_0x4fc57f[_0x1676('0x26')];recordings[_0x4fc57f[_0x1676('0x3')]][_0x1676('0x29')]=_0x4fc57f[_0x1676('0x29')];recordings[_0x4fc57f['uniqueid']][_0x1676('0x2a')]=_0x4fc57f[_0x1676('0x2a')];if(recordings[_0x4fc57f[_0x1676('0x3')]][_0x1676('0x2b')]==_0x1676('0x2c')&&recordings[_0x4fc57f['uniqueid']][_0x1676('0x5')]){recordings[_0x4fc57f[_0x1676('0x3')]]['connectedlinenum']=recordings[_0x4fc57f[_0x1676('0x3')]][_0x1676('0x5')];recordings[_0x4fc57f[_0x1676('0x3')]][_0x1676('0x2a')]='';}recordings[_0x4fc57f[_0x1676('0x3')]][_0x1676('0x22')]['forEach'](function(_0x596e5c){var _0x514ee4=_[_0x1676('0x2d')](recordings[_0x4fc57f[_0x1676('0x3')]]);_0x514ee4[_0x1676('0x1d')]=_0x596e5c[_0x1676('0x1d')];writeDB(_0x514ee4);});delete recordings[_0x4fc57f[_0x1676('0x3')]];}}catch(_0x3e2f46){utils[_0x1676('0x13')](util[_0x1676('0x2')](_0x1676('0x25'),_0x4fc57f[_0x1676('0x3')]),_0x3e2f46);}};exports['newexten']=function(_0x589025){try{if(!_[_0x1676('0x14')](recordings[_0x589025['uniqueid']])){utils[_0x1676('0xb')](util['format']('[%s][recordings][newexten]',_0x589025[_0x1676('0x3')]),_0x589025);utils[_0x1676('0xe')](util['format'](_0x1676('0x2e'),_0x589025[_0x1676('0x3')],_0x589025[_0x1676('0x2f')],_0x589025['appdata']));if(_0x589025[_0x1676('0x2f')][_0x1676('0x30')]()==_0x1676('0x31')&&_[_0x1676('0x32')](_0x589025[_0x1676('0x33')][_0x1676('0x30')](),_0x1676('0x34'))){var _0x687797=_0x589025['appdata'][_0x1676('0x35')]('=');var _0x564841=_0x687797[0x0][_0x1676('0x36')](_0x687797[0x0][_0x1676('0x37')]('(')+0x1,_0x687797[0x0][_0x1676('0x37')](')'));var _0x13562c=_0x687797[0x1];recordings[_0x589025[_0x1676('0x3')]][_0x564841]=_0x13562c;}}}catch(_0x42d3b9){utils[_0x1676('0x13')](util[_0x1676('0x2')](_0x1676('0x38'),_0x589025[_0x1676('0x3')]),_0x42d3b9);}};exports[_0x1676('0x39')]=function(_0x5b3bf4){try{if(!_[_0x1676('0x14')](recordings[_0x5b3bf4[_0x1676('0x3')]])){utils[_0x1676('0xb')](util[_0x1676('0x2')](_0x1676('0x3a'),_0x5b3bf4[_0x1676('0x3')]),_0x5b3bf4);utils[_0x1676('0xe')](util['format'](_0x1676('0x3b'),_0x5b3bf4[_0x1676('0x3')],_0x5b3bf4[_0x1676('0x3c')]));recordings[_0x5b3bf4[_0x1676('0x3')]][_0x1676('0x3c')]=_0x5b3bf4[_0x1676('0x3c')];}}catch(_0x3f4afe){utils['error'](util[_0x1676('0x2')](_0x1676('0x3a'),_0x5b3bf4[_0x1676('0x3')]),_0x3f4afe);}};exports['blindtransfer']=function(_0x551945){try{utils[_0x1676('0xb')](util[_0x1676('0x2')](_0x1676('0x3d'),_0x551945['uniqueid']),_0x551945);utils['info'](util[_0x1676('0x2')](_0x1676('0x3e'),_0x551945[_0x1676('0x3')],_0x551945['transferercalleridnum'],_0x551945[_0x1676('0x3f')],_0x551945[_0x1676('0x40')],_0x551945[_0x1676('0x41')]));if(recordings[_0x551945[_0x1676('0x42')]]&&transfers[_0x1676('0x4')][_0x551945['transfereruniqueid']]){transfers[_0x1676('0x4')][_0x551945[_0x1676('0x42')]][_0x1676('0x43')]=!![];}}catch(_0x231d45){utils[_0x1676('0x13')](util[_0x1676('0x2')]('[%s][recordings][blindtransfer]',_0x551945[_0x1676('0x3')]),_0x231d45);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index b13b202..4553202 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 _0xe0a4=['blind','transfereruniqueid','error','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','debug','format','[%s][transfers][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname'];(function(_0x3715ce,_0x5ec6f7){var _0x1d2d2e=function(_0x1b5167){while(--_0x1b5167){_0x3715ce['push'](_0x3715ce['shift']());}};_0x1d2d2e(++_0x5ec6f7);}(_0xe0a4,0x1bd));var _0x4e0a=function(_0x25b3b7,_0x222935){_0x25b3b7=_0x25b3b7-0x0;var _0x7573c5=_0xe0a4[_0x25b3b7];return _0x7573c5;};'use strict';var _=require(_0x4e0a('0x0'));var util=require(_0x4e0a('0x1'));var utils=require('./utils');function writeDB(_0x675d9a){utils[_0x4e0a('0x2')](util['format'](_0x4e0a('0x3'),_0x675d9a[_0x4e0a('0x4')]===_0x4e0a('0x5')?_0x675d9a[_0x4e0a('0x6')]:_0x675d9a[_0x4e0a('0x7')],_0x675d9a[_0x4e0a('0x4')]));utils[_0x4e0a('0x8')](_0x4e0a('0x9'),_0x675d9a);}exports[_0x4e0a('0xa')]={};exports['blindtransfer']=function(_0xf34c4f){try{utils[_0x4e0a('0xb')](util[_0x4e0a('0xc')](_0x4e0a('0xd'),_0xf34c4f['uniqueid']),_0xf34c4f);utils[_0x4e0a('0x2')](util[_0x4e0a('0xc')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xf34c4f[_0x4e0a('0x7')],_0xf34c4f['transferercalleridnum'],_0xf34c4f[_0x4e0a('0xe')],_0xf34c4f[_0x4e0a('0xf')],_0xf34c4f[_0x4e0a('0x10')]));_0xf34c4f[_0x4e0a('0x4')]=_0x4e0a('0x11');exports['blinds'][_0xf34c4f[_0x4e0a('0x12')]]=_0xf34c4f;writeDB(_0xf34c4f);}catch(_0x2732a5){utils[_0x4e0a('0x13')](util['format']('[%s][transfers][blindtransfer]',_0xf34c4f[_0x4e0a('0x7')]),_0x2732a5);}};exports['attendedtransfer']=function(_0x45c9a6){try{utils[_0x4e0a('0xb')](util[_0x4e0a('0xc')]('[%s][transfers][attendedtransfer]',_0x45c9a6[_0x4e0a('0x6')]),_0x45c9a6);utils[_0x4e0a('0x2')](util[_0x4e0a('0xc')](_0x4e0a('0x14'),_0x45c9a6[_0x4e0a('0x6')],_0x45c9a6['origtransferercalleridnum'],_0x45c9a6[_0x4e0a('0x15')],_0x45c9a6[_0x4e0a('0x16')],_0x45c9a6[_0x4e0a('0x17')]));_0x45c9a6=_[_0x4e0a('0x18')](_0x45c9a6,{'transfererchannel':_0x45c9a6[_0x4e0a('0x19')],'transferercalleridnum':_0x45c9a6[_0x4e0a('0x1a')],'transferercalleridname':_0x45c9a6[_0x4e0a('0x15')],'transfererconnectedlinenum':_0x45c9a6[_0x4e0a('0x1b')],'transfererconnectedlinename':_0x45c9a6[_0x4e0a('0x1c')],'transfereraccountcode':_0x45c9a6['origtransfereraccountcode'],'transferercontext':_0x45c9a6['secondtransferercontext'],'transfererexten':_0x45c9a6[_0x4e0a('0x1d')],'transfererlinkedid':_0x45c9a6[_0x4e0a('0x1e')],'context':_0x45c9a6['origtransferercontext'],'extension':_0x45c9a6[_0x4e0a('0x1f')],'type':'attended'});if(_[_0x4e0a('0x20')](_0x45c9a6[_0x4e0a('0x21')])){_0x45c9a6=_[_0x4e0a('0x18')](_0x45c9a6,{'transfereechannel':_0x45c9a6[_0x4e0a('0x22')],'transfereecalleridnum':_0x45c9a6[_0x4e0a('0x16')],'transfereecalleridname':_0x45c9a6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x45c9a6[_0x4e0a('0x23')],'transfereeconnectedlinename':_0x45c9a6[_0x4e0a('0x24')],'transfereeaccountcode':_0x45c9a6[_0x4e0a('0x25')],'transfereecontext':_0x45c9a6[_0x4e0a('0x26')],'transfereeexten':_0x45c9a6[_0x4e0a('0x27')],'transfereelinkedid':_0x45c9a6[_0x4e0a('0x28')]});}writeDB(_0x45c9a6);}catch(_0x4ef21f){utils['error'](util[_0x4e0a('0xc')](_0x4e0a('0x29'),_0x45c9a6[_0x4e0a('0x6')]),_0x4ef21f);}}; \ No newline at end of file +var _0xfef4=['origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum'];(function(_0x2fe1a5,_0x2eaf39){var _0x565aea=function(_0x260a5d){while(--_0x260a5d){_0x2fe1a5['push'](_0x2fe1a5['shift']());}};_0x565aea(++_0x2eaf39);}(_0xfef4,0x74));var _0x4fef=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xfef4[_0x50a004];return _0x5e9992;};'use strict';var _=require('lodash');var util=require(_0x4fef('0x0'));var utils=require(_0x4fef('0x1'));function writeDB(_0x3b62cb){utils[_0x4fef('0x2')](util[_0x4fef('0x3')](_0x4fef('0x4'),_0x3b62cb[_0x4fef('0x5')]===_0x4fef('0x6')?_0x3b62cb[_0x4fef('0x7')]:_0x3b62cb['uniqueid'],_0x3b62cb[_0x4fef('0x5')]));utils[_0x4fef('0x8')](_0x4fef('0x9'),_0x3b62cb);}exports['blinds']={};exports[_0x4fef('0xa')]=function(_0x63b164){try{utils[_0x4fef('0xb')](util[_0x4fef('0x3')](_0x4fef('0xc'),_0x63b164[_0x4fef('0xd')]),_0x63b164);utils['info'](util[_0x4fef('0x3')](_0x4fef('0xe'),_0x63b164[_0x4fef('0xd')],_0x63b164[_0x4fef('0xf')],_0x63b164[_0x4fef('0x10')],_0x63b164[_0x4fef('0x11')],_0x63b164[_0x4fef('0x12')]));_0x63b164[_0x4fef('0x5')]=_0x4fef('0x13');exports[_0x4fef('0x14')][_0x63b164[_0x4fef('0x15')]]=_0x63b164;writeDB(_0x63b164);}catch(_0x215f0b){utils['error'](util['format'](_0x4fef('0xc'),_0x63b164['uniqueid']),_0x215f0b);}};exports[_0x4fef('0x16')]=function(_0x72f4){try{utils[_0x4fef('0xb')](util[_0x4fef('0x3')]('[%s][transfers][attendedtransfer]',_0x72f4[_0x4fef('0x7')]),_0x72f4);utils[_0x4fef('0x2')](util[_0x4fef('0x3')](_0x4fef('0x17'),_0x72f4['origtransfereruniqueid'],_0x72f4[_0x4fef('0x18')],_0x72f4[_0x4fef('0x19')],_0x72f4['transfertargetcalleridnum'],_0x72f4[_0x4fef('0x1a')]));_0x72f4=_['assign'](_0x72f4,{'transfererchannel':_0x72f4[_0x4fef('0x1b')],'transferercalleridnum':_0x72f4['origtransferercalleridnum'],'transferercalleridname':_0x72f4[_0x4fef('0x19')],'transfererconnectedlinenum':_0x72f4[_0x4fef('0x1c')],'transfererconnectedlinename':_0x72f4[_0x4fef('0x1d')],'transfereraccountcode':_0x72f4['origtransfereraccountcode'],'transferercontext':_0x72f4[_0x4fef('0x1e')],'transfererexten':_0x72f4[_0x4fef('0x1f')],'transfererlinkedid':_0x72f4[_0x4fef('0x20')],'context':_0x72f4[_0x4fef('0x21')],'extension':_0x72f4['origtransfererexten'],'type':'attended'});if(_[_0x4fef('0x22')](_0x72f4[_0x4fef('0x23')])){_0x72f4=_[_0x4fef('0x24')](_0x72f4,{'transfereechannel':_0x72f4[_0x4fef('0x25')],'transfereecalleridnum':_0x72f4[_0x4fef('0x26')],'transfereecalleridname':_0x72f4['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x72f4[_0x4fef('0x27')],'transfereeconnectedlinename':_0x72f4[_0x4fef('0x28')],'transfereeaccountcode':_0x72f4[_0x4fef('0x29')],'transfereecontext':_0x72f4[_0x4fef('0x2a')],'transfereeexten':_0x72f4[_0x4fef('0x2b')],'transfereelinkedid':_0x72f4[_0x4fef('0x2c')]});}writeDB(_0x72f4);}catch(_0x40b792){utils[_0x4fef('0x2d')](util['format'](_0x4fef('0x2e'),_0x72f4[_0x4fef('0x7')]),_0x40b792);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 32712c2..c81621b 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 _0x0639=['acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','seconds','sumTime','now','isAfter','isBefore','jayson/promise','moment','client','http','info','inspect','debug','request','[utils][request]\x20name:%s','catch','GetUser','name','then','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','error','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','found','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type'];(function(_0x4b6993,_0x1ac22c){var _0x509173=function(_0x1b6e54){while(--_0x1b6e54){_0x4b6993['push'](_0x4b6993['shift']());}};_0x509173(++_0x1ac22c);}(_0x0639,0x1ae));var _0x9063=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x0639[_0x32b542];return _0x554d54;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x9063('0x0'));var moment=require(_0x9063('0x1'));var util=require('util');var client=jayson[_0x9063('0x2')][_0x9063('0x3')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x9063('0x4')]=function(_0x49e926,_0x5173fe){logger[_0x9063('0x4')](_0x49e926,_0x5173fe?util[_0x9063('0x5')](_0x5173fe,{'showHidden':![],'depth':null}):'');};exports[_0x9063('0x6')]=function(_0x17546a,_0x3a4367){logger['debug'](_0x17546a,_0x3a4367?util[_0x9063('0x5')](_0x3a4367,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x236d2f,_0x3f6e85){logger['error'](_0x236d2f,_0x3f6e85?util[_0x9063('0x5')](_0x3f6e85,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x5b56f6,_0x50a435){return client[_0x9063('0x7')](_0x5b56f6,{'body':_0x50a435})['then'](function(_0x5227e7){logger['debug'](_0x9063('0x8'),_0x5b56f6,_0x5227e7?util[_0x9063('0x5')](_0x5227e7,{'showHidden':![],'depth':null}):'');})[_0x9063('0x9')](function(_0x1b9bea){logger['error'](_0x9063('0x8'),_0x5b56f6,_0x1b9bea?util[_0x9063('0x5')](_0x1b9bea,{'showHidden':![],'depth':null}):'');});};function getUser(_0x47865c){return client[_0x9063('0x7')](_0x9063('0xa'),{'options':{'raw':!![],'attributes':['id','internal',_0x9063('0xb'),'interface'],'where':_0x47865c,'limit':0x1}})[_0x9063('0xc')](function(_0x497a56){logger[_0x9063('0x6')]('[utils][getUser]\x20where:%s',JSON[_0x9063('0xd')](_0x47865c),_0x497a56?util[_0x9063('0x5')](_0x497a56,{'showHidden':![],'depth':null}):'');return _0x497a56[_0x9063('0xe')][_0x9063('0xf')]?_0x497a56[_0x9063('0xe')][0x0]:null;});}exports['getUserByInternal']=function(_0x2d040f){return new BPromise(function(_0x20e347,_0x930499){if(_0x2d040f){return getUser({'internal':_0x2d040f})['then'](function(_0x21dba8){logger[_0x9063('0x4')](_0x9063('0x10'),_0x2d040f,_0x21dba8?'found':_0x9063('0x11'));return _0x20e347(_0x21dba8);})[_0x9063('0x9')](function(_0x178bc5){logger[_0x9063('0x12')](_0x9063('0x13'),_0x178bc5?util[_0x9063('0x5')](_0x178bc5,{'showHidden':![],'depth':null}):'');return _0x20e347(null);});}return _0x20e347(null);});};exports[_0x9063('0x14')]=function(_0xe58959){return new BPromise(function(_0x1cd311,_0x168803){if(_0xe58959){return getUser({'interface':_0xe58959})[_0x9063('0xc')](function(_0x80d309){logger['info'](_0x9063('0x15'),_0xe58959,_0x80d309?'found':_0x9063('0x11'));return _0x1cd311(_0x80d309);})[_0x9063('0x9')](function(_0x43fd10){logger[_0x9063('0x12')](_0x9063('0x16'),_0x43fd10?util[_0x9063('0x5')](_0x43fd10,{'showHidden':![],'depth':null}):'');return _0x1cd311(null);});}return _0x1cd311(null);});};exports[_0x9063('0x17')]=function(_0x305cfb){return new BPromise(function(_0xe4e443,_0xc200c8){if(_0x305cfb){return getUser({'name':_0x305cfb})[_0x9063('0xc')](function(_0x317cff){logger['info'](_0x9063('0x18'),_0x305cfb,_0x317cff?_0x9063('0x19'):_0x9063('0x11'));return _0xe4e443(_0x317cff);})[_0x9063('0x9')](function(_0x281135){logger[_0x9063('0x12')](_0x9063('0x1a'),_0x281135?util[_0x9063('0x5')](_0x281135,{'showHidden':![],'depth':null}):'');return _0xe4e443(null);});}return _0xe4e443(null);});};exports[_0x9063('0x1b')]=function(_0x325713){return new BPromise(function(_0xef4fc9,_0x370711){if(_0x325713){return client[_0x9063('0x7')](_0x9063('0x1c'),{'options':{'raw':!![],'attributes':['id',_0x9063('0xb'),_0x9063('0x1d'),'acw',_0x9063('0x1e')],'where':{'name':_0x325713},'limit':0x1}})['then'](function(_0x49a1fc){logger['debug'](_0x9063('0x1f'),_0x325713,_0x49a1fc?util[_0x9063('0x5')](_0x49a1fc,{'showHidden':![],'depth':null}):'');logger[_0x9063('0x4')](_0x9063('0x20'),_0x325713,_0x49a1fc?'found':_0x9063('0x11'));return _0xef4fc9(_0x49a1fc['result'][_0x9063('0xf')]?_0x49a1fc[_0x9063('0xe')][0x0]:null);})[_0x9063('0x9')](function(_0x38bc47){logger[_0x9063('0x12')]('[utils][getVoiceQueueByName]',_0x38bc47?util[_0x9063('0x5')](_0x38bc47,{'showHidden':![],'depth':null}):'');return _0xef4fc9(null);});}return _0xef4fc9(null);});};exports[_0x9063('0x21')]=function(_0x1cbe3f,_0x4b42dd){return moment(_0x1cbe3f)[_0x9063('0x22')](_0x4b42dd,'seconds')[_0x9063('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9063('0x24')]=function(_0x14cd1d,_0x493c12){return moment(_0x14cd1d)[_0x9063('0x25')](_0x493c12,'seconds')[_0x9063('0x23')](_0x9063('0x26'));};exports[_0x9063('0x27')]=function(_0x138766,_0x119587){return moment(_0x138766)[_0x9063('0x28')](moment(_0x119587),_0x9063('0x29'));};exports[_0x9063('0x2a')]=function(_0x7bf0e0,_0x3fd20a){return parseInt(_0x7bf0e0,0xa)+parseInt(_0x3fd20a,0xa);};exports[_0x9063('0x2b')]=function(){return moment()['format'](_0x9063('0x26'));};exports['isAfter']=function(_0x28b910,_0x16af86){if(_0x16af86){return moment(_0x28b910)[_0x9063('0x2c')](_0x16af86);}return!![];};exports[_0x9063('0x2d')]=function(_0x38d8f3,_0x4b7808){if(_0x4b7808){return moment(_0x38d8f3)[_0x9063('0x2d')](_0x4b7808);}else if(_0x38d8f3){return!![];}return![];}; \ No newline at end of file +var _0x4760=['debug','error','request','[utils][request]\x20name:%s','catch','GetUser','internal','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','xdr','info','inspect'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4760,0xe8));var _0x0476=function(_0x32a337,_0x14e81c){_0x32a337=_0x32a337-0x0;var _0xafea82=_0x4760[_0x32a337];return _0xafea82;};'use strict';var BPromise=require(_0x0476('0x0'));var jayson=require(_0x0476('0x1'));var moment=require(_0x0476('0x2'));var util=require(_0x0476('0x3'));var client=jayson['client'][_0x0476('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x0476('0x5'));exports[_0x0476('0x6')]=function(_0x2378eb,_0xa6394a){logger[_0x0476('0x6')](_0x2378eb,_0xa6394a?util[_0x0476('0x7')](_0xa6394a,{'showHidden':![],'depth':null}):'');};exports[_0x0476('0x8')]=function(_0xf1e277,_0x439988){logger['debug'](_0xf1e277,_0x439988?util[_0x0476('0x7')](_0x439988,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x5b3b0f,_0x38f9d3){logger[_0x0476('0x9')](_0x5b3b0f,_0x38f9d3?util[_0x0476('0x7')](_0x38f9d3,{'showHidden':![],'depth':null}):'');};exports[_0x0476('0xa')]=function(_0x3aa2ba,_0x4bf893){return client[_0x0476('0xa')](_0x3aa2ba,{'body':_0x4bf893})['then'](function(_0x188959){logger[_0x0476('0x8')](_0x0476('0xb'),_0x3aa2ba,_0x188959?util['inspect'](_0x188959,{'showHidden':![],'depth':null}):'');})[_0x0476('0xc')](function(_0x51ede3){logger[_0x0476('0x9')](_0x0476('0xb'),_0x3aa2ba,_0x51ede3?util['inspect'](_0x51ede3,{'showHidden':![],'depth':null}):'');});};function getUser(_0x365ed0){return client[_0x0476('0xa')](_0x0476('0xd'),{'options':{'raw':!![],'attributes':['id',_0x0476('0xe'),'name','interface'],'where':_0x365ed0,'limit':0x1}})[_0x0476('0xf')](function(_0x3b44e2){logger[_0x0476('0x8')](_0x0476('0x10'),JSON[_0x0476('0x11')](_0x365ed0),_0x3b44e2?util[_0x0476('0x7')](_0x3b44e2,{'showHidden':![],'depth':null}):'');return _0x3b44e2[_0x0476('0x12')][_0x0476('0x13')]?_0x3b44e2['result'][0x0]:null;});}exports[_0x0476('0x14')]=function(_0x886c58){return new BPromise(function(_0x57eafa,_0x36f777){if(_0x886c58){return getUser({'internal':_0x886c58})['then'](function(_0x216c27){logger[_0x0476('0x6')](_0x0476('0x15'),_0x886c58,_0x216c27?_0x0476('0x16'):'notfound');return _0x57eafa(_0x216c27);})[_0x0476('0xc')](function(_0x1878ed){logger[_0x0476('0x9')](_0x0476('0x17'),_0x1878ed?util[_0x0476('0x7')](_0x1878ed,{'showHidden':![],'depth':null}):'');return _0x57eafa(null);});}return _0x57eafa(null);});};exports[_0x0476('0x18')]=function(_0x2c8884){return new BPromise(function(_0x3ce753,_0x315376){if(_0x2c8884){return getUser({'interface':_0x2c8884})[_0x0476('0xf')](function(_0x4e618a){logger[_0x0476('0x6')](_0x0476('0x19'),_0x2c8884,_0x4e618a?_0x0476('0x16'):'notfound');return _0x3ce753(_0x4e618a);})[_0x0476('0xc')](function(_0xe97cf3){logger['error'](_0x0476('0x1a'),_0xe97cf3?util['inspect'](_0xe97cf3,{'showHidden':![],'depth':null}):'');return _0x3ce753(null);});}return _0x3ce753(null);});};exports['getUserByName']=function(_0x4de4cc){return new BPromise(function(_0x370cc6,_0x13e0e4){if(_0x4de4cc){return getUser({'name':_0x4de4cc})[_0x0476('0xf')](function(_0x144f6b){logger['info'](_0x0476('0x1b'),_0x4de4cc,_0x144f6b?_0x0476('0x16'):_0x0476('0x1c'));return _0x370cc6(_0x144f6b);})['catch'](function(_0x4c9ad6){logger[_0x0476('0x9')](_0x0476('0x1d'),_0x4c9ad6?util[_0x0476('0x7')](_0x4c9ad6,{'showHidden':![],'depth':null}):'');return _0x370cc6(null);});}return _0x370cc6(null);});};exports[_0x0476('0x1e')]=function(_0x4988fd){return new BPromise(function(_0x10973a,_0x5193b3){if(_0x4988fd){return client[_0x0476('0xa')](_0x0476('0x1f'),{'options':{'raw':!![],'attributes':['id','name','type',_0x0476('0x20'),_0x0476('0x21')],'where':{'name':_0x4988fd},'limit':0x1}})[_0x0476('0xf')](function(_0xb69945){logger[_0x0476('0x8')](_0x0476('0x22'),_0x4988fd,_0xb69945?util['inspect'](_0xb69945,{'showHidden':![],'depth':null}):'');logger[_0x0476('0x6')](_0x0476('0x23'),_0x4988fd,_0xb69945?_0x0476('0x16'):'notfound');return _0x10973a(_0xb69945[_0x0476('0x12')]['length']?_0xb69945[_0x0476('0x12')][0x0]:null);})[_0x0476('0xc')](function(_0x8a9b77){logger['error']('[utils][getVoiceQueueByName]',_0x8a9b77?util[_0x0476('0x7')](_0x8a9b77,{'showHidden':![],'depth':null}):'');return _0x10973a(null);});}return _0x10973a(null);});};exports[_0x0476('0x24')]=function(_0x381637,_0x2b263){return moment(_0x381637)[_0x0476('0x25')](_0x2b263,_0x0476('0x26'))[_0x0476('0x27')](_0x0476('0x28'));};exports['subtractTime']=function(_0x14dec5,_0x9ff023){return moment(_0x14dec5)[_0x0476('0x29')](_0x9ff023,_0x0476('0x26'))[_0x0476('0x27')](_0x0476('0x28'));};exports[_0x0476('0x2a')]=function(_0x5d5a8e,_0x48dbee){return moment(_0x5d5a8e)[_0x0476('0x2b')](moment(_0x48dbee),'seconds');};exports[_0x0476('0x2c')]=function(_0xe8f385,_0x2cd25d){return parseInt(_0xe8f385,0xa)+parseInt(_0x2cd25d,0xa);};exports[_0x0476('0x2d')]=function(){return moment()['format'](_0x0476('0x28'));};exports[_0x0476('0x2e')]=function(_0x4661ad,_0x5f3a97){if(_0x5f3a97){return moment(_0x4661ad)['isAfter'](_0x5f3a97);}return!![];};exports[_0x0476('0x2f')]=function(_0x3399ea,_0x3477ab){if(_0x3477ab){return moment(_0x3399ea)['isBefore'](_0x3477ab);}else if(_0x3399ea){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 bac5aab..c7e87a0 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 _0x9697=['util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','then','user','data','catch','api','set','client-side-logger','use','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','role','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_id','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path'];(function(_0xe1ad57,_0x329a5c){var _0x96baa8=function(_0x5ec4ba){while(--_0x5ec4ba){_0xe1ad57['push'](_0xe1ad57['shift']());}};_0x96baa8(++_0x329a5c);}(_0x9697,0x19a));var _0x7969=function(_0x1eb30f,_0x460e51){_0x1eb30f=_0x1eb30f-0x0;var _0x43156d=_0x9697[_0x1eb30f];return _0x43156d;};var fs=require(_0x7969('0x0'));var _=require(_0x7969('0x1'));var ewinston=require(_0x7969('0x2'));var path=require(_0x7969('0x3'));var util=require(_0x7969('0x4'));var fileLogger=require(_0x7969('0x5'))['fileLogger'];var safeTemplate=require(_0x7969('0x6'))[_0x7969('0x7')];var maskSensitiveData=require(_0x7969('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x40a689(_0x3c3b5a){var _0x319495=path[_0x7969('0x9')](_0x7969('0xa'),_0x7969('0xb'),_0x7969('0xc'));var _0x1ca25b=path[_0x7969('0x9')](_0x7969('0xd'),_0x3c3b5a['role']+'-'+_0x3c3b5a[_0x7969('0xe')]);return fs[_0x7969('0xf')](path['join'](_0x319495,_0x1ca25b))[_0x7969('0x10')](function(){var _0x1a28f5=fileLogger(_0x7969('0xd'),path[_0x7969('0x9')](_0x319495,_0x1ca25b));return _0x1a28f5;})['catch'](function(_0x492176){throw _0x492176;});}this[_0x7969('0xb')]=function(_0x50bb61,_0x34d06e,_0x2ee92b,_0x3bc224){return _0x40a689(_0x50bb61[_0x7969('0x11')])[_0x7969('0x10')](function(_0x297397){var _0x5307c9=_0x297397[_0x34d06e];return _0x5307c9;})[_0x7969('0x10')](function(_0x4ba0e8){var _0x26ca7f=_0x50bb61['user']?_0x50bb61[_0x7969('0x11')]['id']:'no-user';var _0x6cf70a=_0x3bc224[_0x7969('0x12')];var _0x244002=_0x3bc224['timestamp'];var _0x5ec96c=new Date(Number(_0x244002));return _0x4ba0e8(_0x26ca7f,_0x5ec96c,_0x2ee92b,_0x6cf70a);})[_0x7969('0x13')](function(_0x527fa8){fileLogger(_0x7969('0xd'))['error'](_0x527fa8);});};}function setupLoggers(_0x206fd8){return new Promise(function(_0x5bbce3){var _0x52c4cd=new ClientSideLogger();var _0x2cc3a7=fileLogger(_0x7969('0x14'));var _0x76af54=fileLogger('auth');_0x206fd8[_0x7969('0x15')](_0x7969('0x16'),_0x52c4cd);_0x206fd8[_0x7969('0x17')](ewinston['logger']({'winstonInstance':_0x2cc3a7,'meta':![],'statusLevels':!![],'msg':function(_0xc99c50,_0x323606){var _0x593ee0='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0xc99c50[_0x7969('0x18')])){_0x593ee0+=_0x7969('0x19');var _0x370c79=_0xc99c50[_0x7969('0x18')];maskSensitiveData(_0x370c79);}return safeTemplate(util[_0x7969('0x1a')](_0x593ee0,_0xc99c50[_0x7969('0x1b')],_0xc99c50[_0x7969('0x1c')]['x-forwarded-for']?_0xc99c50['headers'][_0x7969('0x1d')]:_0xc99c50[_0x7969('0x1e')][_0x7969('0x1f')]||_0xc99c50['ip'],_0xc99c50[_0x7969('0x20')],_0x323606[_0x7969('0x21')],_0x323606[_0x7969('0x22')],_0xc99c50['user']?_0xc99c50[_0x7969('0x11')]['id']:null,_0xc99c50['user']?_0xc99c50[_0x7969('0x11')][_0x7969('0xe')]:null,_0xc99c50[_0x7969('0x11')]?_0xc99c50[_0x7969('0x11')][_0x7969('0x23')]:null,_0x370c79?util[_0x7969('0x24')](_0x370c79,![],null):''));}}));_0x206fd8[_0x7969('0x17')](ewinston[_0x7969('0x25')]({'winstonInstance':_0x76af54,'meta':![],'statusLevels':!![],'msg':function(_0x254839,_0x2aad29){var _0x1cb339=_0x7969('0x26');if(_0x254839[_0x7969('0x18')]&&_0x254839[_0x7969('0x18')][_0x7969('0x27')]&&_0x254839[_0x7969('0x18')]['agent_id']){_0x1cb339=_0x7969('0x28');}return util[_0x7969('0x1a')](_0x1cb339,_0x254839[_0x7969('0x1b')],_0x254839[_0x7969('0x1c')][_0x7969('0x1d')]?_0x254839[_0x7969('0x1c')]['x-forwarded-for']:_0x254839['connection'][_0x7969('0x1f')]||_0x254839['ip'],_0x254839[_0x7969('0x20')],_0x2aad29['statusCode'],_0x2aad29[_0x7969('0x22')],_0x254839[_0x7969('0x11')]?_0x254839[_0x7969('0x11')]['id']:null,_0x254839['user']?_0x254839[_0x7969('0x11')][_0x7969('0xe')]:null,_0x254839[_0x7969('0x11')]?_0x254839[_0x7969('0x11')][_0x7969('0x23')]:null,_0x254839[_0x7969('0x18')]&&_0x254839[_0x7969('0x18')]['device']?_0x254839['body'][_0x7969('0x27')]:_0x7969('0x29'),_0x254839[_0x7969('0x18')]&&_0x254839[_0x7969('0x18')][_0x7969('0x2a')]?_0x254839[_0x7969('0x18')][_0x7969('0x2a')]:'',_0x254839[_0x7969('0x18')]&&_0x254839['body'][_0x7969('0x2b')]?_0x254839[_0x7969('0x18')][_0x7969('0x2b')]:'');},'ignoreRoute':function(_0x532d7a){var _0x1586b3=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1586b3[_0x7969('0x2c')](_0x532d7a[_0x7969('0x20')]);}}));return _0x5bbce3();});}exports[_0x7969('0x2d')]=setupLoggers; \ No newline at end of file +var _0xccc8=['\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','inspect','logger','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','responseTime','agent_id','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','set','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body'];(function(_0x29ab86,_0x226b03){var _0x1f64bd=function(_0x20b05a){while(--_0x20b05a){_0x29ab86['push'](_0x29ab86['shift']());}};_0x1f64bd(++_0x226b03);}(_0xccc8,0x102));var _0x8ccc=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0xccc8[_0x3a3c17];return _0xd07f21;};var fs=require(_0x8ccc('0x0'));var _=require(_0x8ccc('0x1'));var ewinston=require(_0x8ccc('0x2'));var path=require(_0x8ccc('0x3'));var util=require(_0x8ccc('0x4'));var fileLogger=require(_0x8ccc('0x5'))[_0x8ccc('0x6')];var safeTemplate=require(_0x8ccc('0x7'))[_0x8ccc('0x8')];var maskSensitiveData=require(_0x8ccc('0x9'))['maskSensitiveData'];function ClientSideLogger(){function _0x21e4a8(_0x3e71c1){var _0x359af4=path[_0x8ccc('0xa')]('/var',_0x8ccc('0xb'),_0x8ccc('0xc'));var _0x3e4efc=path[_0x8ccc('0xa')](_0x8ccc('0xd'),_0x3e71c1[_0x8ccc('0xe')]+'-'+_0x3e71c1[_0x8ccc('0xf')]);return fs[_0x8ccc('0x10')](path[_0x8ccc('0xa')](_0x359af4,_0x3e4efc))[_0x8ccc('0x11')](function(){var _0x52a8d3=fileLogger(_0x8ccc('0xd'),path[_0x8ccc('0xa')](_0x359af4,_0x3e4efc));return _0x52a8d3;})[_0x8ccc('0x12')](function(_0x2877dc){throw _0x2877dc;});}this['log']=function(_0x932150,_0x56e3f4,_0xa93734,_0xda2edd){return _0x21e4a8(_0x932150[_0x8ccc('0x13')])[_0x8ccc('0x11')](function(_0x418408){var _0x577a05=_0x418408[_0x56e3f4];return _0x577a05;})[_0x8ccc('0x11')](function(_0xc12422){var _0xccd674=_0x932150[_0x8ccc('0x13')]?_0x932150[_0x8ccc('0x13')]['id']:_0x8ccc('0x14');var _0x22eb08=_0xda2edd[_0x8ccc('0x15')];var _0x411222=_0xda2edd[_0x8ccc('0x16')];var _0x20d461=new Date(Number(_0x411222));return _0xc12422(_0xccd674,_0x20d461,_0xa93734,_0x22eb08);})[_0x8ccc('0x12')](function(_0x25b8b5){fileLogger(_0x8ccc('0xd'))[_0x8ccc('0x17')](_0x25b8b5);});};}function setupLoggers(_0x452ebc){return new Promise(function(_0x3b914e){var _0x285785=new ClientSideLogger();var _0x3a1d84=fileLogger(_0x8ccc('0x18'));var _0x1b083e=fileLogger(_0x8ccc('0x19'));_0x452ebc[_0x8ccc('0x1a')]('client-side-logger',_0x285785);_0x452ebc[_0x8ccc('0x1b')](ewinston['logger']({'winstonInstance':_0x3a1d84,'meta':![],'statusLevels':!![],'msg':function(_0x54363c,_0x5a7b83){var _0x2d22ab=_0x8ccc('0x1c');if(!_['isEmpty'](_0x54363c[_0x8ccc('0x1d')])){_0x2d22ab+=_0x8ccc('0x1e');var _0x1be026=_0x54363c[_0x8ccc('0x1d')];maskSensitiveData(_0x1be026);}return safeTemplate(util[_0x8ccc('0x1f')](_0x2d22ab,_0x54363c[_0x8ccc('0x20')],_0x54363c[_0x8ccc('0x21')][_0x8ccc('0x22')]?_0x54363c[_0x8ccc('0x21')]['x-forwarded-for']:_0x54363c[_0x8ccc('0x23')][_0x8ccc('0x24')]||_0x54363c['ip'],_0x54363c['url'],_0x5a7b83[_0x8ccc('0x25')],_0x5a7b83['responseTime'],_0x54363c[_0x8ccc('0x13')]?_0x54363c[_0x8ccc('0x13')]['id']:null,_0x54363c['user']?_0x54363c[_0x8ccc('0x13')][_0x8ccc('0xf')]:null,_0x54363c['user']?_0x54363c[_0x8ccc('0x13')][_0x8ccc('0xe')]:null,_0x1be026?util[_0x8ccc('0x26')](_0x1be026,![],null):''));}}));_0x452ebc['use'](ewinston[_0x8ccc('0x27')]({'winstonInstance':_0x1b083e,'meta':![],'statusLevels':!![],'msg':function(_0x4af79c,_0x30e85e){var _0x1197ab='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4af79c['body']&&_0x4af79c[_0x8ccc('0x1d')][_0x8ccc('0x28')]&&_0x4af79c['body']['agent_id']){_0x1197ab=_0x8ccc('0x29');}return util[_0x8ccc('0x1f')](_0x1197ab,_0x4af79c[_0x8ccc('0x20')],_0x4af79c['headers'][_0x8ccc('0x22')]?_0x4af79c[_0x8ccc('0x21')][_0x8ccc('0x22')]:_0x4af79c[_0x8ccc('0x23')][_0x8ccc('0x24')]||_0x4af79c['ip'],_0x4af79c[_0x8ccc('0x2a')],_0x30e85e[_0x8ccc('0x25')],_0x30e85e[_0x8ccc('0x2b')],_0x4af79c[_0x8ccc('0x13')]?_0x4af79c[_0x8ccc('0x13')]['id']:null,_0x4af79c[_0x8ccc('0x13')]?_0x4af79c[_0x8ccc('0x13')]['name']:null,_0x4af79c[_0x8ccc('0x13')]?_0x4af79c[_0x8ccc('0x13')][_0x8ccc('0xe')]:null,_0x4af79c['body']&&_0x4af79c[_0x8ccc('0x1d')][_0x8ccc('0x28')]?_0x4af79c[_0x8ccc('0x1d')][_0x8ccc('0x28')]:'other',_0x4af79c[_0x8ccc('0x1d')]&&_0x4af79c[_0x8ccc('0x1d')][_0x8ccc('0x2c')]?_0x4af79c['body']['agent_id']:'',_0x4af79c[_0x8ccc('0x1d')]&&_0x4af79c['body'][_0x8ccc('0x2d')]?_0x4af79c[_0x8ccc('0x1d')]['agent_name']:'');},'ignoreRoute':function(_0x8ac57d){var _0x7ee3d5=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x7ee3d5[_0x8ccc('0x2e')](_0x8ac57d[_0x8ccc('0x2a')]);}}));return _0x3b914e();});}exports[_0x8ccc('0x2f')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 4c3b33d..a27506e 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa82=['Logger','transports','warn','File','error','Console','consoleLogger','fileLogger','moment','winston','debugLevel','toLowerCase','info','red','white','bold\x20white','bold\x20green','gray','bold\x20blue','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','stringify'];(function(_0x24332c,_0x15ecf4){var _0x4c9ae8=function(_0x7cd0ca){while(--_0x7cd0ca){_0x24332c['push'](_0x24332c['shift']());}};_0x4c9ae8(++_0x15ecf4);}(_0xfa82,0x15c));var _0x2fa8=function(_0x5b580c,_0x59a5dd){_0x5b580c=_0x5b580c-0x0;var _0xc70259=_0xfa82[_0x5b580c];return _0xc70259;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x2fa8('0x0'));var winston=require(_0x2fa8('0x1'));var config=require('../config/environment');var debugLevel=config[_0x2fa8('0x2')]?config[_0x2fa8('0x2')][_0x2fa8('0x3')]():_0x2fa8('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':'redBG\x20white','error':_0x2fa8('0x5'),'warn':'bold\x20yellow','info':_0x2fa8('0x6'),'print':_0x2fa8('0x7'),'success':_0x2fa8('0x8'),'http':_0x2fa8('0x9'),'verbose':'bold\x20magenta','debug':_0x2fa8('0xa'),'silly':'bold\x20cyan'};winston[_0x2fa8('0xb')](XC_LOG_COLORS);function getLogFileName(_0x31257c,_0x265c2b,_0x45312c){var _0x80b8e0=_0x31257c||_0x2fa8('0xc');return path[_0x2fa8('0xd')](_0x80b8e0,util[_0x2fa8('0xe')](_0x2fa8('0xf'),_0x265c2b,_0x45312c));}function formatter(_0x31cfdb,_0x36972d){_0x36972d[_0x2fa8('0x10')]=_0x36972d[_0x2fa8('0x10')][_0x2fa8('0x11')](/@@{/g,_0x2fa8('0x12'))[_0x2fa8('0x11')](/}@@/g,_0x2fa8('0x13'))[_0x2fa8('0x11')](/@{/g,'{{')[_0x2fa8('0x11')](/}@/g,'}}');return util[_0x2fa8('0xe')](_0x2fa8('0x14'),moment()[_0x2fa8('0xe')](_0x2fa8('0x15')),_0x36972d[_0x2fa8('0x16')][_0x2fa8('0x17')](),_0x31cfdb,_0x36972d['message']);}function fileFormat(_0x5a8bd5,_0x3b77f2){_0x3b77f2[_0x2fa8('0x10')]=_0x3b77f2[_0x2fa8('0x10')][_0x2fa8('0x11')](/@@{/g,_0x2fa8('0x12'))[_0x2fa8('0x11')](/}@@/g,_0x2fa8('0x13'))[_0x2fa8('0x11')](/@{/g,'{{')[_0x2fa8('0x11')](/}@/g,'}}');var _0x947cda=_0x3b77f2[_0x2fa8('0x18')]&&Object['keys'](_0x3b77f2[_0x2fa8('0x18')])['length']?'\x0a\x09'+JSON[_0x2fa8('0x19')](_0x3b77f2[_0x2fa8('0x18')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x2fa8('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3b77f2[_0x2fa8('0x16')][_0x2fa8('0x17')](),_0x5a8bd5,_0x3b77f2[_0x2fa8('0x10')],_0x947cda);}function consoleLogger(){var _0x15bbae=new winston[(_0x2fa8('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2fa8('0x1b'))]['Console']({'level':_0x2fa8('0x1c'),'json':![],'formatter':function(_0x144015){return formatter('',_0x144015);}})]});return _0x15bbae;}function fileLogger(_0x12a685,_0x163e86){var _0x5b45e3=new winston[(_0x2fa8('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x2fa8('0x1d'))]({'name':util[_0x2fa8('0xe')]('%s-%s',_0x12a685,_0x2fa8('0x1e')),'filename':getLogFileName(_0x163e86,_0x12a685,_0x2fa8('0x1e')),'level':_0x2fa8('0x1e'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x15a7eb){return fileFormat(_0x12a685,_0x15a7eb);}}),new winston[(_0x2fa8('0x1b'))][(_0x2fa8('0x1d'))]({'name':util['format']('%s-%s',_0x12a685,debugLevel),'filename':getLogFileName(_0x163e86,_0x12a685,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x218458){return fileFormat(_0x12a685,_0x218458);}}),new winston[(_0x2fa8('0x1b'))][(_0x2fa8('0x1f'))]({'level':_0x2fa8('0x1c'),'json':![],'formatter':function(_0x17d4ba){return fileFormat(_0x12a685,_0x17d4ba);}})]});return _0x5b45e3;}exports[_0x2fa8('0x20')]=consoleLogger;exports[_0x2fa8('0x21')]=fileLogger; \ No newline at end of file +var _0x5906=['bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20blue','/var/log/xcally','join','format','message','replace','{{{','level','}}}','meta','keys','length','stringify','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','winston','debugLevel','toLowerCase','info','red'];(function(_0xeb0c12,_0x2e3f6f){var _0x27d455=function(_0x26d9cb){while(--_0x26d9cb){_0xeb0c12['push'](_0xeb0c12['shift']());}};_0x27d455(++_0x2e3f6f);}(_0x5906,0x1cd));var _0x6590=function(_0x524b15,_0x51c457){_0x524b15=_0x524b15-0x0;var _0x28bdef=_0x5906[_0x524b15];return _0x28bdef;};'use strict';var path=require(_0x6590('0x0'));var util=require(_0x6590('0x1'));var moment=require('moment');var winston=require(_0x6590('0x2'));var config=require('../config/environment');var debugLevel=config[_0x6590('0x3')]?config['debugLevel'][_0x6590('0x4')]():_0x6590('0x5');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':_0x6590('0x6'),'warn':_0x6590('0x7'),'info':_0x6590('0x8'),'print':_0x6590('0x9'),'success':_0x6590('0xa'),'http':_0x6590('0xb'),'verbose':'bold\x20magenta','debug':_0x6590('0xc'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x31ed25,_0x2ff85e,_0x1df61f){var _0x50f98c=_0x31ed25||_0x6590('0xd');return path[_0x6590('0xe')](_0x50f98c,util[_0x6590('0xf')]('%s-%s.log',_0x2ff85e,_0x1df61f));}function formatter(_0x4f01d1,_0x39cdb2){_0x39cdb2[_0x6590('0x10')]=_0x39cdb2[_0x6590('0x10')][_0x6590('0x11')](/@@{/g,_0x6590('0x12'))[_0x6590('0x11')](/}@@/g,'}}}')['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x6590('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x6590('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0x39cdb2[_0x6590('0x13')]['toUpperCase'](),_0x4f01d1,_0x39cdb2['message']);}function fileFormat(_0x246aa3,_0x293b90){_0x293b90[_0x6590('0x10')]=_0x293b90[_0x6590('0x10')]['replace'](/@@{/g,_0x6590('0x12'))[_0x6590('0x11')](/}@@/g,_0x6590('0x14'))[_0x6590('0x11')](/@{/g,'{{')[_0x6590('0x11')](/}@/g,'}}');var _0x4cdb34=_0x293b90[_0x6590('0x15')]&&Object[_0x6590('0x16')](_0x293b90['meta'])[_0x6590('0x17')]?'\x0a\x09'+JSON[_0x6590('0x18')](_0x293b90[_0x6590('0x15')]):'';return util[_0x6590('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x6590('0xf')](_0x6590('0x19')),_0x293b90[_0x6590('0x13')][_0x6590('0x1a')](),_0x246aa3,_0x293b90[_0x6590('0x10')],_0x4cdb34);}function consoleLogger(){var _0xd70038=new winston[(_0x6590('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6590('0x1c'))][(_0x6590('0x1d'))]({'level':_0x6590('0x1e'),'json':![],'formatter':function(_0x2efed0){return formatter('',_0x2efed0);}})]});return _0xd70038;}function fileLogger(_0x4e989c,_0x11315c){var _0x275d56=new winston[(_0x6590('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6590('0x1c'))][(_0x6590('0x1f'))]({'name':util[_0x6590('0xf')](_0x6590('0x20'),_0x4e989c,_0x6590('0x21')),'filename':getLogFileName(_0x11315c,_0x4e989c,_0x6590('0x21')),'level':_0x6590('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x535eb2){return fileFormat(_0x4e989c,_0x535eb2);}}),new winston[(_0x6590('0x1c'))]['File']({'name':util['format'](_0x6590('0x20'),_0x4e989c,debugLevel),'filename':getLogFileName(_0x11315c,_0x4e989c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1da0ee){return fileFormat(_0x4e989c,_0x1da0ee);}}),new winston[(_0x6590('0x1c'))][(_0x6590('0x1d'))]({'level':_0x6590('0x1e'),'json':![],'formatter':function(_0x4813da){return fileFormat(_0x4e989c,_0x4813da);}})]});return _0x275d56;}exports[_0x6590('0x22')]=consoleLogger;exports[_0x6590('0x23')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 6233d2a..6c4c94e 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 _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0xa43910,_0x3768dc){var _0x168dad=function(_0x43c815){while(--_0x43c815){_0xa43910['push'](_0xa43910['shift']());}};_0x168dad(++_0x3768dc);}(_0x2ef3,0xba));var _0x32ef=function(_0x561adb,_0x275786){_0x561adb=_0x561adb-0x0;var _0xed3d4e=_0x2ef3[_0x561adb];return _0xed3d4e;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0x0295,0x1f0));var _0x5029=function(_0x3a16d4,_0x23ecda){_0x3a16d4=_0x3a16d4-0x0;var _0x31ea9c=_0x0295[_0x3a16d4];return _0x31ea9c;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 8ec1d3b..1765b7e 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 _0x4cf8=['safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','exports'];(function(_0x4826e4,_0x1c3693){var _0x2af9fe=function(_0x54377e){while(--_0x54377e){_0x4826e4['push'](_0x4826e4['shift']());}};_0x2af9fe(++_0x1c3693);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x4cf8[_0x4c12ec];return _0x3ae42c;};var _=require(_0x84cf('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2d03b6){return _0x2d03b6==='{{'?_0x84cf('0x1'):_0x84cf('0x2');}function safeTemplate(_0xae953){var _0x28455b=_0xae953;if(typeof _0xae953===_0x84cf('0x3')){_0x28455b=_0xae953[_0x84cf('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x84cf('0x5')](_0xae953)){_0x28455b=_0xae953[_0x84cf('0x6')](function(_0x5844d7){return safeTemplate(_0x5844d7);});}else if(_[_0x84cf('0x7')](_0xae953)){_0x28455b=Object['keys'](_0xae953)['reduce'](function(_0x455345,_0x56c5cc){_0x455345[_0x56c5cc]=safeTemplate(_0xae953[_0x56c5cc]);return _0x455345;},{});}return _0x28455b;}module[_0x84cf('0x8')][_0x84cf('0x9')]=safeTemplate; \ No newline at end of file +var _0xf7b4=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}'];(function(_0xa3c533,_0x22f07f){var _0x4ea7e6=function(_0x60533e){while(--_0x60533e){_0xa3c533['push'](_0xa3c533['shift']());}};_0x4ea7e6(++_0x22f07f);}(_0xf7b4,0x152));var _0x4f7b=function(_0x456a6e,_0x1b32e8){_0x456a6e=_0x456a6e-0x0;var _0xd19cfa=_0xf7b4[_0x456a6e];return _0xd19cfa;};var _=require(_0x4f7b('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5579ed){return _0x5579ed==='{{'?'{\x20{\x20':_0x4f7b('0x1');}function safeTemplate(_0x103165){var _0x50ea23=_0x103165;if(typeof _0x103165==='string'){_0x50ea23=_0x103165[_0x4f7b('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x4f7b('0x3')](_0x103165)){_0x50ea23=_0x103165[_0x4f7b('0x4')](function(_0x44f991){return safeTemplate(_0x44f991);});}else if(_[_0x4f7b('0x5')](_0x103165)){_0x50ea23=Object[_0x4f7b('0x6')](_0x103165)[_0x4f7b('0x7')](function(_0x3ad135,_0x173784){_0x3ad135[_0x173784]=safeTemplate(_0x103165[_0x173784]);return _0x3ad135;},{});}return _0x50ea23;}module[_0x4f7b('0x8')][_0x4f7b('0x9')]=safeTemplate; \ No newline at end of file -- 1.7.1